From d49a7e8a5c58370439e739775dbe4faecfb0ad21 Mon Sep 17 00:00:00 2001 From: Daniel Tipping Date: Tue, 10 Dec 2019 17:07:45 +0000 Subject: [PATCH 01/82] Remove trailing whitespace --- tigge/tigge_check.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tigge/tigge_check.c b/tigge/tigge_check.c index 14b0255e3..a0dae7ac3 100755 --- a/tigge/tigge_check.c +++ b/tigge/tigge_check.c @@ -86,8 +86,8 @@ static void pressure_level(grib_handle*,const parameter*,double,double); static void potential_temperature_level(grib_handle*,const parameter*,double,double); static void potential_vorticity_level(grib_handle*,const parameter*,double,double); -/* -TODO: +/* +TODO: - Shape of the earth - Levels */ @@ -500,7 +500,7 @@ static void point_in_time(grib_handle* h,const parameter* p,double min,double ma CHECK(eq(h,"indicatorOfUnitOfTimeRange",1));/* Hours */ CHECK((get(h,"forecastTime") % 3) == 0); /* Every three hours */ } - } + } else if (is_uerra) { if(get(h,"indicatorOfUnitOfTimeRange") == 1) /* hourly */ { @@ -747,8 +747,8 @@ static void statistical_process(grib_handle* h,const parameter* p,double min,dou CHECK(eq(h,"indicatorOfUnitOfTimeRange",1));/* Hours */ CHECK((get(h,"forecastTime") % 3) == 0); /* Every three hours */ } - } - else if (is_uerra) + } + else if (is_uerra) { /* forecastTime for uerra might be all steps decreased by 1 i.e 0,1,2,3,4,5,8,11...29 too many... */ if(get(h,"indicatorOfUnitOfTimeRange") == 1) @@ -756,7 +756,7 @@ static void statistical_process(grib_handle* h,const parameter* p,double min,dou CHECK(le(h,"forecastTime",30)); } } - else + else { if(get(h,"indicatorOfUnitOfTimeRange") == 11) /* six hours */ { @@ -799,7 +799,7 @@ static void statistical_process(grib_handle* h,const parameter* p,double min,dou { CHECK((get(h,"endStep") % 6) == 0); /* Every six hours */ } - + if(get(h,"indicatorOfUnitForTimeRange") == 11) { From 5e57e7b576ed883fd8f841bcd077964c6f36f8b8 Mon Sep 17 00:00:00 2001 From: Daniel Tipping Date: Thu, 12 Dec 2019 16:00:52 +0000 Subject: [PATCH 02/82] CI: get libnetcdf from conda-forge --- .appveyor.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 56c8d5b27..e417ff74c 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -50,11 +50,8 @@ install: m2-diffutils ^ m2-perl - # get the latest version of cmake - - cmd: conda install -c conda-forge cmake - - # other deps - - cmd: conda install libnetcdf + # get deps + - cmd: conda install -c conda-forge cmake libnetcdf #---------------------------------# # build configuration # From 49c02428124fd843094ea3ef05d1bb50366e1570 Mon Sep 17 00:00:00 2001 From: Daniel Tipping Date: Thu, 12 Dec 2019 16:59:54 +0000 Subject: [PATCH 03/82] Attempt to debug netcdf.dll location --- .appveyor.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.appveyor.yml b/.appveyor.yml index e417ff74c..b942005ef 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -28,6 +28,9 @@ init: - cmd: call %CONDA%\Scripts\activate.bat # add eccodes\build\bin to path so tests can find eccodes.dll - cmd: set PATH=%PATH%;%ECCODES_SRC%\build\bin + # add %CONDA_PREFIX%\Library\bin to path so tests can find netcdf.dll + # I'm pretty sure this should already be in the system path once Conda is activated. + - cmd: set PATH=%PATH%;%CONDA_PREFIX%\Library\bin # auto-yes for conda - cmd: conda config --set always_yes yes @@ -53,6 +56,10 @@ install: # get deps - cmd: conda install -c conda-forge cmake libnetcdf + # debug + - cmd: find %CONDA_PREFIX% -n netcdf.dll + - cmd: where netcdf.dll + #---------------------------------# # build configuration # #---------------------------------# From cfc210c645467db94a62869af3e04a3025f78d06 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 13 Dec 2019 12:42:43 +0000 Subject: [PATCH 04/82] ECC-499 and Windows test eccodes_t_grib_ecc-979 --- examples/C/grib_nearest.sh | 53 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100755 examples/C/grib_nearest.sh diff --git a/examples/C/grib_nearest.sh b/examples/C/grib_nearest.sh new file mode 100755 index 000000000..bf825216d --- /dev/null +++ b/examples/C/grib_nearest.sh @@ -0,0 +1,53 @@ +#!/bin/sh +# 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. +# + +. ./include.sh + +label="grib_nearest" +temp=$label.temp +tempRef=$label.ref +input_grb=${data_dir}/reduced_gaussian_pressure_level.grib1 + +# Nearest with decoding the data values +# -------------------------------------- +${examples_dir}/c_grib_nearest $input_grb > $temp +cat > $tempRef < $temp +cat > $tempRef < Date: Fri, 13 Dec 2019 13:19:33 +0000 Subject: [PATCH 05/82] ECC-499 and Windows test eccodes_t_grib_ecc-979 --- examples/C/CMakeLists.txt | 1 + examples/C/grib_nearest.c | 42 +++++++++++++++++++++++++++------------ 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/examples/C/CMakeLists.txt b/examples/C/CMakeLists.txt index 83a97fea4..f6e40fc24 100644 --- a/examples/C/CMakeLists.txt +++ b/examples/C/CMakeLists.txt @@ -83,6 +83,7 @@ list( APPEND tests_extra grib_set_bitmap grib_list grib_get_data + grib_nearest grib_nearest_multiple set_missing bufr_attributes diff --git a/examples/C/grib_nearest.c b/examples/C/grib_nearest.c index cd45548da..acb82fea1 100644 --- a/examples/C/grib_nearest.c +++ b/examples/C/grib_nearest.c @@ -22,7 +22,7 @@ #include "eccodes.h" static void usage(const char* prog) { - printf("Usage: %s grib_file grib_file ...\n",prog); + printf("Usage: %s [-n] grib_file grib_file ...\n",prog); exit(1); } @@ -30,9 +30,10 @@ int main(int argc, char** argv) { int err = 0; long step=0; - size_t nfiles; - int i=0; + size_t nfiles=0; + size_t i=0, j=0; codes_fieldset* set=NULL; + const size_t max_numfiles = 100; codes_handle* h=NULL; char param[20]={0,}; size_t len=20; @@ -42,6 +43,7 @@ int main(int argc, char** argv) double distances[4]={0,}; int indexes[4]={0,}; char* order_by="param,step"; + double* pValues = values; /* Default: decode the values */ size_t size=4; double lat=-40,lon=15; @@ -52,16 +54,24 @@ int main(int argc, char** argv) if (argc < 2) usage(argv[0]); - nfiles=argc-1; - filenames=(char**)malloc(sizeof(char*)*nfiles); - for (i=0;i= max_numfiles) + break; + filenames[j++]=(char*)strdup(argv[i]); + } + } + nfiles = j; set=codes_fieldset_new_from_files(0,filenames,nfiles,0,0,0,order_by,&err); CODES_CHECK(err,0); - printf("\nordering by %s\n",order_by); - printf("\n%d fields in the fieldset\n",codes_fieldset_count(set)); + printf("ordering by %s\n",order_by); + printf("%d fields in the fieldset\n",codes_fieldset_count(set)); printf("n,step,param\n"); mode=CODES_NEAREST_SAME_GRID | CODES_NEAREST_SAME_POINT; @@ -75,10 +85,16 @@ int main(int argc, char** argv) printf("%d %ld %s ",count,step,param); if (!nearest) nearest=codes_grib_nearest_new(h,&err); CODES_CHECK(err,0); - CODES_CHECK(codes_grib_nearest_find(nearest,h,lat,lon,mode,lats,lons,values,distances,indexes,&size),0); - printf("\nIdx\tlat\tlon\tdist\tval\n"); - for (i=0;i<4;i++) printf("%d\t%.2f\t%.2f\t%g\t%g\n", - (int)indexes[i],lats[i],lons[i],distances[i],values[i]); + CODES_CHECK(codes_grib_nearest_find(nearest,h,lat,lon,mode,lats,lons,pValues,distances,indexes,&size),0); + if (!pValues) { + printf("\nIdx\tlat\tlon\tdist\n"); + for (i=0;i<4;i++) printf("%d\t%.2f\t%.2f\t%g\n", + (int)indexes[i],lats[i],lons[i],distances[i]); + } else { + printf("\nIdx\tlat\tlon\tdist\tval\n"); + for (i=0;i<4;i++) printf("%d\t%.2f\t%.2f\t%g\t%g\n", + (int)indexes[i],lats[i],lons[i],distances[i],pValues[i]); + } printf("\n"); codes_handle_delete(h); From 4c2ae0239841d5fac19abf27120760a81b2315f8 Mon Sep 17 00:00:00 2001 From: Daniel Tipping Date: Fri, 13 Dec 2019 16:36:05 +0000 Subject: [PATCH 06/82] Fix mistyped `find` command --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index b942005ef..935cc47d4 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -57,7 +57,7 @@ install: - cmd: conda install -c conda-forge cmake libnetcdf # debug - - cmd: find %CONDA_PREFIX% -n netcdf.dll + - cmd: find %CONDA_PREFIX% -name netcdf.dll - cmd: where netcdf.dll #---------------------------------# From a764686c9a7784feeb0bdb035d8e4de1520202f1 Mon Sep 17 00:00:00 2001 From: Daniel Tipping Date: Fri, 13 Dec 2019 17:38:05 +0000 Subject: [PATCH 07/82] Debug with ntldd --- .appveyor.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 935cc47d4..c4fc61b96 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -51,7 +51,8 @@ install: m2-sed ^ m2-gawk ^ m2-diffutils ^ - m2-perl + m2-perl ^ + m2w64-ntldd-git # get deps - cmd: conda install -c conda-forge cmake libnetcdf @@ -87,6 +88,7 @@ build_script: -D WINDOWS_TESTING_BASHRC=%WINDOWS_TESTING_BASHRC% ^ .. - cmd: nmake + - cmd: ntldd %ECCODES_SRC%/build/bin/grib_to_netcdf.exe # debug - cmd: ctest --output-on-failure - cmd: nmake install From ee1462d106b9be870f450bbefc015e8b754bc31e Mon Sep 17 00:00:00 2001 From: Daniel Tipping Date: Fri, 13 Dec 2019 19:45:17 +0000 Subject: [PATCH 08/82] Check PATH before running tests --- .appveyor.yml | 1 + tests/grib_to_netcdf.sh | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index c4fc61b96..a880117c4 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -89,6 +89,7 @@ build_script: .. - cmd: nmake - cmd: ntldd %ECCODES_SRC%/build/bin/grib_to_netcdf.exe # debug + - cmd: echo %PATH% - cmd: ctest --output-on-failure - cmd: nmake install diff --git a/tests/grib_to_netcdf.sh b/tests/grib_to_netcdf.sh index bb5fd53a0..adcfc42f3 100755 --- a/tests/grib_to_netcdf.sh +++ b/tests/grib_to_netcdf.sh @@ -3,7 +3,7 @@ # # 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. @@ -28,6 +28,9 @@ ncf_types="NC_SHORT NC_INT NC_FLOAT NC_DOUBLE" tmp_netcdf=tmp.ncf +# debug +echo $PATH + # Go thru all the specified GRIB files and convert them to NetCDF for dt in $ncf_types do From d62ba211067ef3833f87fbfa319f235d209ef8f7 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 16 Dec 2019 13:36:44 +0000 Subject: [PATCH 09/82] Testing: Don't compare doubles with 10 decimal places --- data/bitmap.diff | 272 ++++++++++++++++++++++++------------------- data/no_bitmap.diff | 257 +++++++++++++++++++++++----------------- tests/grib_bitmap.sh | 40 +++++-- 3 files changed, 331 insertions(+), 238 deletions(-) diff --git a/data/bitmap.diff b/data/bitmap.diff index a1b7615a0..22ea9aa68 100644 --- a/data/bitmap.diff +++ b/data/bitmap.diff @@ -1,123 +1,151 @@ #============== MESSAGE 1 ( length=11680 ) ============== -1-4 identifier = GRIB -5-7 totalLength = 11680 -8 editionNumber = 1 -====================== SECTION_1 ( length=52, padding=0 ) ====================== -1-3 section1Length = 52 -4 table2Version = 128 -5 centre = 98 [European Centre for Medium-Range Weather Forecasts (common/c-1.table) ] -6 generatingProcessIdentifier = 130 -7 gridDefinition = 255 -8 section1Flags = 192 [11000000] -9 indicatorOfParameter = 130 [Temperature (K) (grib1/2.98.128.table) ] -10 indicatorOfTypeOfLevel = 109 [Hybrid level level number (2 octets) (grib1/local/ecmf/3.table , grib1/3.table) ] -11-12 level = 1 -13 yearOfCentury = 8 -14 month = 2 -15 day = 6 -16 hour = 12 -17 minute = 0 -18 unitOfTimeRange = 1 [Hour (grib1/4.table) ] -19 P1 = 0 -20 P2 = 0 -21 timeRangeIndicator = 0 [Forecast product valid at reference time + P1 (P1>0) (grib1/local/ecmf/5.table , grib1/5.table) ] -22-23 numberIncludedInAverage = 0 -24 numberMissingFromAveragesOrAccumulations = 0 -25 centuryOfReferenceTimeOfData = 21 -26 subCentre = 0 [Unknown code table entry (grib1/0.ecmf.table) ] -27-28 decimalScaleFactor = 0 -29-40 reservedNeedNotBePresent = 12 { - 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 - } # pad reservedNeedNotBePresent -41 localDefinitionNumber = 1 [MARS labelling or ensemble forecast data (grib1/localDefinitionNumber.98.table) ] -42 marsClass = 1 [Operational archive (mars/class.table) ] -43 marsType = 2 [Analysis (mars/type.table) ] -44-45 marsStream = 1025 [Atmospheric model (mars/stream.table) ] -46-49 experimentVersionNumber = 0001 -50 perturbationNumber = 0 -51 numberOfForecastsInEnsemble = 0 -52 padding_local1_1 = 1 { - 00 - } # pad padding_local1_1 -====================== SECTION_2 ( length=896, padding=0 ) ====================== -1-3 section2Length = 896 -4 numberOfVerticalCoordinateValues = 184 -5 pvlLocation = 33 -6 dataRepresentationType = 4 [Gaussian Latitude/Longitude Grid (grib1/6.table) ] -7-8 Ni = MISSING -9-10 Nj = 64 -11-13 latitudeOfFirstGridPoint = 87864 -14-16 longitudeOfFirstGridPoint = 0 -17 resolutionAndComponentFlags = 0 [00000000] -18-20 latitudeOfLastGridPoint = -87864 -21-23 longitudeOfLastGridPoint = 357188 -24-25 iDirectionIncrement = MISSING -26-27 N = 32 -28 scanningMode = 0 [00000000] -29-32 padding_grid4_1 = 4 { - 00, 00, 00, 00 - } # pad padding_grid4_1 -33-768 pv = (184,736) { -0.0000000000e+00, 2.0000400543e+00, 3.9808320999e+00, 7.3871860504e+00, 1.2908319473e+01, 2.1413604736e+01, 3.3952865601e+01, 5.1746597290e+01, -7.6167663574e+01, 1.0871556091e+02, 1.5098602295e+02, 2.0463745117e+02, 2.7135644531e+02, 3.5282446289e+02, 4.5068579102e+02, 5.6651928711e+02, -7.0181323242e+02, 8.5794580078e+02, 1.0361665039e+03, 1.2375854492e+03, 1.4631638184e+03, 1.7137097168e+03, 1.9898745117e+03, 2.2921555176e+03, -2.6208984375e+03, 2.9763022461e+03, 3.3584257812e+03, 3.7671960449e+03, 4.2024179688e+03, 4.6637773438e+03, 5.1508593750e+03, 5.6631562500e+03, -6.1998398438e+03, 6.7597265625e+03, 7.3414687500e+03, 7.9429257812e+03, 8.5646250000e+03, 9.2083046875e+03, 9.8735625000e+03, 1.0558882812e+04, -1.1262484375e+04, 1.1982660156e+04, 1.2713898438e+04, 1.3453226562e+04, 1.4192011719e+04, 1.4922687500e+04, 1.5638054688e+04, 1.6329562500e+04, -1.6990625000e+04, 1.7613281250e+04, 1.8191031250e+04, 1.8716968750e+04, 1.9184546875e+04, 1.9587515625e+04, 1.9919796875e+04, 2.0175394531e+04, -2.0348917969e+04, 2.0434156250e+04, 2.0426218750e+04, 2.0319011719e+04, 2.0107031250e+04, 1.9785359375e+04, 1.9348777344e+04, 1.8798824219e+04, -1.8141296875e+04, 1.7385593750e+04, 1.6544585938e+04, 1.5633566406e+04, 1.4665644531e+04, 1.3653218750e+04, 1.2608382812e+04, 1.1543167969e+04, -1.0471312500e+04, 9.4052226562e+03, 8.3562539062e+03, 7.3351640625e+03, 6.3539218750e+03, 5.4228007812e+03, 4.5502148438e+03, 3.7434643555e+03, -3.0101469727e+03, 2.3562026367e+03, 1.7848544922e+03, 1.2976562500e+03, 8.9519360352e+02, 5.7631420898e+02, 3.3677246094e+02, 1.6204342651e+02, -5.4208343506e+01, 6.5756282806e+00, 3.1600000802e-03, 0.0000000000e+00, 0.0000000000e+00, 0.0000000000e+00, 0.0000000000e+00, 0.0000000000e+00, -0.0000000000e+00, 0.0000000000e+00, 0.0000000000e+00, 0.0000000000e+00 -... 84 more values -} # ibmfloat pv -769-896 pl = (64,128) { -2.0000000000e+01, 2.7000000000e+01, 3.6000000000e+01, 4.0000000000e+01, 4.5000000000e+01, 5.0000000000e+01, 6.0000000000e+01, 6.4000000000e+01, -7.2000000000e+01, 7.5000000000e+01, 8.0000000000e+01, 9.0000000000e+01, 9.0000000000e+01, 9.6000000000e+01, 1.0000000000e+02, 1.0800000000e+02, -1.0800000000e+02, 1.2000000000e+02, 1.2000000000e+02, 1.2000000000e+02, 1.2800000000e+02, 1.2800000000e+02, 1.2800000000e+02, 1.2800000000e+02, -1.2800000000e+02, 1.2800000000e+02, 1.2800000000e+02, 1.2800000000e+02, 1.2800000000e+02, 1.2800000000e+02, 1.2800000000e+02, 1.2800000000e+02, -1.2800000000e+02, 1.2800000000e+02, 1.2800000000e+02, 1.2800000000e+02, 1.2800000000e+02, 1.2800000000e+02, 1.2800000000e+02, 1.2800000000e+02, -1.2800000000e+02, 1.2800000000e+02, 1.2800000000e+02, 1.2800000000e+02, 1.2000000000e+02, 1.2000000000e+02, 1.2000000000e+02, 1.0800000000e+02, -1.0800000000e+02, 1.0000000000e+02, 9.6000000000e+01, 9.0000000000e+01, 9.0000000000e+01, 8.0000000000e+01, 7.5000000000e+01, 7.2000000000e+01, -6.4000000000e+01, 6.0000000000e+01, 5.0000000000e+01, 4.5000000000e+01, 4.0000000000e+01, 3.6000000000e+01, 2.7000000000e+01, 2.0000000000e+01 -} # unsigned pl -====================== SECTION_3 ( length=772, padding=0 ) ====================== -1-3 section3Length = 772 -4 numberOfUnusedBitsAtEndOfSection3 = 14 -5-6 tableReference = 0 -7-772 bitmap = 766 { - ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, - ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, - ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, - ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, - ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, - ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, ff, - ff, ff, ff, ff - ... 665 more values - } # g1bitmap bitmap -====================== SECTION_4 ( length=9948, padding=0 ) ====================== -1-3 section4Length = 9948 -4 dataFlag = 14 [00001110] -5-6 binaryScaleFactor = -6 -7-10 referenceValue = 160.252 -11 bitsPerValue = 13 -12-9948 codedValues = (6114,9937) { -1.9907963562e+02, 1.9872026062e+02, 1.9851713562e+02, 1.9839213562e+02, 1.9822026062e+02, 1.9798588562e+02, 1.9770463562e+02, 1.9747026062e+02, -1.9737651062e+02, 1.9740776062e+02, 1.9756401062e+02, 1.9787651062e+02, 1.9839213562e+02, 1.9907963562e+02, 1.9979838562e+02, 2.0034526062e+02, -2.0059526062e+02, 2.0053276062e+02, 2.0015776062e+02, 1.9959526062e+02, 1.9984526062e+02, 1.9959526062e+02, 1.9954838562e+02, 1.9943901062e+02, -1.9940776062e+02, 1.9926713562e+02, 1.9875151062e+02, 1.9789213562e+02, 1.9698588562e+02, 1.9642338562e+02, 1.9637651062e+02, 1.9679838562e+02, -1.9737651062e+02, 1.9782963562e+02, 1.9806401062e+02, 1.9814213562e+02, 1.9843901062e+02, 1.9925151062e+02, 2.0065776062e+02, 2.0222026062e+02, -2.0334526062e+02, 2.0389213562e+02, 2.0420463562e+02, 2.0442338562e+02, 2.0404838562e+02, 2.0265776062e+02, 2.0090776062e+02, 2.0176713562e+02, -2.0101713562e+02, 2.0039213562e+02, 1.9961088562e+02, 1.9925151062e+02, 1.9940776062e+02, 1.9934526062e+02, 1.9872026062e+02, 1.9790776062e+02, -1.9725151062e+02, 1.9670463562e+02, 1.9623588562e+02, 1.9597026062e+02, 1.9595463562e+02, 1.9612651062e+02, 1.9645463562e+02, 1.9692338562e+02, -1.9750151062e+02, 1.9809526062e+02, 1.9845463562e+02, 1.9845463562e+02, 1.9829838562e+02, 1.9837651062e+02, 1.9882963562e+02, 1.9993901062e+02, -2.0181401062e+02, 2.0401713562e+02, 2.0581401062e+02, 2.0700151062e+02, 2.0781401062e+02, 2.0848588562e+02, 2.0926713562e+02, 2.0973588562e+02, -2.0887651062e+02, 2.0640776062e+02, 2.0356401062e+02, 2.0676713562e+02, 2.0443901062e+02, 2.0272026062e+02, 2.0140776062e+02, 2.0081401062e+02, -2.0068901062e+02, 1.9993901062e+02, 1.9834526062e+02, 1.9704838562e+02, 1.9695463562e+02, 1.9770463562e+02, 1.9812651062e+02, 1.9779838562e+02, -1.9726713562e+02, 1.9690776062e+02, 1.9653276062e+02, 1.9626713562e+02 -... 6014 more values -} # data_g1simple_packing codedValues -====================== SECTION_5 ( length=4, padding=0 ) ====================== -1-4 7777 = 7777 +GRIB { + editionNumber = 1; + table2Version = 128; + # European Centre for Medium-Range Weather Forecasts (common/c-1.table) + centre = 98; + generatingProcessIdentifier = 130; + # Temperature (K) (grib1/2.98.128.table) + indicatorOfParameter = 130; + # Hybrid level level number (2 octets) (grib1/local/ecmf/3.table , grib1/3.table) + indicatorOfTypeOfLevel = 109; + level = 1; + # Forecast product valid at reference time + P1 (P1>0) (grib1/local/ecmf/5.table , grib1/5.table) + timeRangeIndicator = 0; + # Unknown code table entry (grib1/0.ecmf.table) + subCentre = 0; + paramId = 130; + #-READ ONLY- cfNameECMF = air_temperature; + #-READ ONLY- cfName = air_temperature; + #-READ ONLY- cfVarNameECMF = t; + #-READ ONLY- cfVarName = t; + #-READ ONLY- units = K; + #-READ ONLY- nameECMF = Temperature; + #-READ ONLY- name = Temperature; + decimalScaleFactor = 0; + dataDate = 20080206; + dataTime = 1200; + # Hour (stepUnits.table) + stepUnits = 1; + stepRange = 0; + startStep = 0; + endStep = 0; + #-READ ONLY- marsParam = 130.128; + # MARS labelling or ensemble forecast data (grib1/localDefinitionNumber.98.table) + localDefinitionNumber = 1; + # Operational archive (mars/class.table) + marsClass = 1; + # Analysis (mars/type.table) + marsType = 2; + # Atmospheric model (mars/stream.table) + marsStream = 1025; + experimentVersionNumber = 0001; + perturbationNumber = 0; + numberOfForecastsInEnsemble = 0; + shortName = t; + GDSPresent = 1; + bitmapPresent = 1; + numberOfVerticalCoordinateValues = 184; + Ni = MISSING; + Nj = 64; + latitudeOfFirstGridPointInDegrees = 87.864; + longitudeOfFirstGridPointInDegrees = 0; + earthIsOblate = 0; + uvRelativeToGrid = 0; + latitudeOfLastGridPointInDegrees = -87.864; + longitudeOfLastGridPointInDegrees = 357.188; + iDirectionIncrement = MISSING; + iDirectionIncrementInDegrees = MISSING; + N = 32; + iScansNegatively = 0; + jScansPositively = 0; + jPointsAreConsecutive = 0; + #-READ ONLY- alternativeRowScanning = 0; + global = 1; + #-READ ONLY- numberOfDataPoints = 6114; + #-READ ONLY- numberOfDataPointsExpected = 6114; + #-READ ONLY- numberOfValues = 6114; + isOctahedral = 0; + pv(184) = { + 0, 2.00004, 3.98083, 7.38719, 12.9083, + 21.4136, 33.9529, 51.7466, 76.1677, 108.716, + 150.986, 204.637, 271.356, 352.824, 450.686, + 566.519, 701.813, 857.946, 1036.17, 1237.59, + 1463.16, 1713.71, 1989.87, 2292.16, 2620.9, + 2976.3, 3358.43, 3767.2, 4202.42, 4663.78, + 5150.86, 5663.16, 6199.84, 6759.73, 7341.47, + 7942.93, 8564.62, 9208.3, 9873.56, 10558.9, + 11262.5, 11982.7, 12713.9, 13453.2, 14192, + 14922.7, 15638.1, 16329.6, 16990.6, 17613.3, + 18191, 18717, 19184.5, 19587.5, 19919.8, + 20175.4, 20348.9, 20434.2, 20426.2, 20319, + 20107, 19785.4, 19348.8, 18798.8, 18141.3, + 17385.6, 16544.6, 15633.6, 14665.6, 13653.2, + 12608.4, 11543.2, 10471.3, 9405.22, 8356.25, + 7335.16, 6353.92, 5422.8, 4550.21, 3743.46, + 3010.15, 2356.2, 1784.85, 1297.66, 895.194, + 576.314, 336.772, 162.043, 54.2083, 6.57563, + 0.00316, 0, 0, 0, 0, + 0, 0, 0, 0, 0 + ... 84 more values + } + pl(64) = { + 20, 27, 36, 40, 45, + 50, 60, 64, 72, 75, + 80, 90, 90, 96, 100, + 108, 108, 120, 120, 120, + 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, + 128, 128, 128, 128, 120, + 120, 120, 108, 108, 100, + 96, 90, 90, 80, 75, + 72, 64, 60, 50, 45, + 40, 36, 27, 20 + } + missingValue = 9999; + tableReference = 0; + #-READ ONLY- binaryScaleFactor = -6; + #-READ ONLY- referenceValue = 160.252; + sphericalHarmonics = 0; + complexPacking = 0; + integerPointValues = 0; + additionalFlagPresent = 0; + packingType = grid_simple; + bitsPerValue = 13; + values(6114) = { + 199.08, 198.72, 198.517, 198.392, 198.22, + 197.986, 197.705, 197.47, 197.377, 197.408, + 197.564, 197.877, 198.392, 199.08, 199.798, + 200.345, 200.595, 200.533, 200.158, 199.595, + 199.845, 199.595, 199.548, 199.439, 199.408, + 199.267, 198.752, 197.892, 196.986, 196.423, + 196.377, 196.798, 197.377, 197.83, 198.064, + 198.142, 198.439, 199.252, 200.658, 202.22, + 203.345, 203.892, 204.205, 204.423, 204.048, + 202.658, 200.908, 201.767, 201.017, 200.392, + 199.611, 199.252, 199.408, 199.345, 198.72, + 197.908, 197.252, 196.705, 196.236, 195.97, + 195.955, 196.127, 196.455, 196.923, 197.502, + 198.095, 198.455, 198.455, 198.298, 198.377, + 198.83, 199.939, 201.814, 204.017, 205.814, + 207.002, 207.814, 208.486, 209.267, 209.736, + 208.877, 206.408, 203.564, 206.767, 204.439, + 202.72, 201.408, 200.814, 200.689, 199.939, + 198.345, 197.048, 196.955, 197.705, 198.127, + 197.798, 197.267, 196.908, 196.533, 196.267 + ... 6014 more values + } + #-READ ONLY- numberOfCodedValues = 6114; + #-READ ONLY- maximum = 224.455; + #-READ ONLY- minimum = 160.252; + #-READ ONLY- average = 194.458; + #-READ ONLY- numberOfMissing = 0; + #-READ ONLY- standardDeviation = 12.8976; + #-READ ONLY- skewness = -0.807543; + #-READ ONLY- kurtosis = 0.45733; + #-READ ONLY- isConstant = 0; + gridType = reduced_gg; + #-READ ONLY- getNumberOfValues = 6114; +} diff --git a/data/no_bitmap.diff b/data/no_bitmap.diff index fb1ddc413..dc6dc9221 100644 --- a/data/no_bitmap.diff +++ b/data/no_bitmap.diff @@ -1,109 +1,150 @@ #============== MESSAGE 1 ( length=10908 ) ============== -1-4 identifier = GRIB -5-7 totalLength = 10908 -8 editionNumber = 1 -====================== SECTION_1 ( length=52, padding=0 ) ====================== -1-3 section1Length = 52 -4 table2Version = 128 -5 centre = 98 [European Centre for Medium-Range Weather Forecasts (common/c-1.table) ] -6 generatingProcessIdentifier = 130 -7 gridDefinition = 255 -8 section1Flags = 128 [10000000] -9 indicatorOfParameter = 130 [Temperature (K) (grib1/2.98.128.table) ] -10 indicatorOfTypeOfLevel = 109 [Hybrid level level number (2 octets) (grib1/local/ecmf/3.table , grib1/3.table) ] -11-12 level = 1 -13 yearOfCentury = 8 -14 month = 2 -15 day = 6 -16 hour = 12 -17 minute = 0 -18 unitOfTimeRange = 1 [Hour (grib1/4.table) ] -19 P1 = 0 -20 P2 = 0 -21 timeRangeIndicator = 0 [Forecast product valid at reference time + P1 (P1>0) (grib1/local/ecmf/5.table , grib1/5.table) ] -22-23 numberIncludedInAverage = 0 -24 numberMissingFromAveragesOrAccumulations = 0 -25 centuryOfReferenceTimeOfData = 21 -26 subCentre = 0 [Unknown code table entry (grib1/0.ecmf.table) ] -27-28 decimalScaleFactor = 0 -29-40 reservedNeedNotBePresent = 12 { - 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 - } # pad reservedNeedNotBePresent -41 localDefinitionNumber = 1 [MARS labelling or ensemble forecast data (grib1/localDefinitionNumber.98.table) ] -42 marsClass = 1 [Operational archive (mars/class.table) ] -43 marsType = 2 [Analysis (mars/type.table) ] -44-45 marsStream = 1025 [Atmospheric model (mars/stream.table) ] -46-49 experimentVersionNumber = 0001 -50 perturbationNumber = 0 -51 numberOfForecastsInEnsemble = 0 -52 padding_local1_1 = 1 { - 00 - } # pad padding_local1_1 -====================== SECTION_2 ( length=896, padding=0 ) ====================== -1-3 section2Length = 896 -4 numberOfVerticalCoordinateValues = 184 -5 pvlLocation = 33 -6 dataRepresentationType = 4 [Gaussian Latitude/Longitude Grid (grib1/6.table) ] -7-8 Ni = MISSING -9-10 Nj = 64 -11-13 latitudeOfFirstGridPoint = 87864 -14-16 longitudeOfFirstGridPoint = 0 -17 resolutionAndComponentFlags = 0 [00000000] -18-20 latitudeOfLastGridPoint = -87864 -21-23 longitudeOfLastGridPoint = 357188 -24-25 iDirectionIncrement = MISSING -26-27 N = 32 -28 scanningMode = 0 [00000000] -29-32 padding_grid4_1 = 4 { - 00, 00, 00, 00 - } # pad padding_grid4_1 -33-768 pv = (184,736) { -0.0000000000e+00, 2.0000400543e+00, 3.9808320999e+00, 7.3871860504e+00, 1.2908319473e+01, 2.1413604736e+01, 3.3952865601e+01, 5.1746597290e+01, -7.6167663574e+01, 1.0871556091e+02, 1.5098602295e+02, 2.0463745117e+02, 2.7135644531e+02, 3.5282446289e+02, 4.5068579102e+02, 5.6651928711e+02, -7.0181323242e+02, 8.5794580078e+02, 1.0361665039e+03, 1.2375854492e+03, 1.4631638184e+03, 1.7137097168e+03, 1.9898745117e+03, 2.2921555176e+03, -2.6208984375e+03, 2.9763022461e+03, 3.3584257812e+03, 3.7671960449e+03, 4.2024179688e+03, 4.6637773438e+03, 5.1508593750e+03, 5.6631562500e+03, -6.1998398438e+03, 6.7597265625e+03, 7.3414687500e+03, 7.9429257812e+03, 8.5646250000e+03, 9.2083046875e+03, 9.8735625000e+03, 1.0558882812e+04, -1.1262484375e+04, 1.1982660156e+04, 1.2713898438e+04, 1.3453226562e+04, 1.4192011719e+04, 1.4922687500e+04, 1.5638054688e+04, 1.6329562500e+04, -1.6990625000e+04, 1.7613281250e+04, 1.8191031250e+04, 1.8716968750e+04, 1.9184546875e+04, 1.9587515625e+04, 1.9919796875e+04, 2.0175394531e+04, -2.0348917969e+04, 2.0434156250e+04, 2.0426218750e+04, 2.0319011719e+04, 2.0107031250e+04, 1.9785359375e+04, 1.9348777344e+04, 1.8798824219e+04, -1.8141296875e+04, 1.7385593750e+04, 1.6544585938e+04, 1.5633566406e+04, 1.4665644531e+04, 1.3653218750e+04, 1.2608382812e+04, 1.1543167969e+04, -1.0471312500e+04, 9.4052226562e+03, 8.3562539062e+03, 7.3351640625e+03, 6.3539218750e+03, 5.4228007812e+03, 4.5502148438e+03, 3.7434643555e+03, -3.0101469727e+03, 2.3562026367e+03, 1.7848544922e+03, 1.2976562500e+03, 8.9519360352e+02, 5.7631420898e+02, 3.3677246094e+02, 1.6204342651e+02, -5.4208343506e+01, 6.5756282806e+00, 3.1600000802e-03, 0.0000000000e+00, 0.0000000000e+00, 0.0000000000e+00, 0.0000000000e+00, 0.0000000000e+00, -0.0000000000e+00, 0.0000000000e+00, 0.0000000000e+00, 0.0000000000e+00 -... 84 more values -} # ibmfloat pv -769-896 pl = (64,128) { -2.0000000000e+01, 2.7000000000e+01, 3.6000000000e+01, 4.0000000000e+01, 4.5000000000e+01, 5.0000000000e+01, 6.0000000000e+01, 6.4000000000e+01, -7.2000000000e+01, 7.5000000000e+01, 8.0000000000e+01, 9.0000000000e+01, 9.0000000000e+01, 9.6000000000e+01, 1.0000000000e+02, 1.0800000000e+02, -1.0800000000e+02, 1.2000000000e+02, 1.2000000000e+02, 1.2000000000e+02, 1.2800000000e+02, 1.2800000000e+02, 1.2800000000e+02, 1.2800000000e+02, -1.2800000000e+02, 1.2800000000e+02, 1.2800000000e+02, 1.2800000000e+02, 1.2800000000e+02, 1.2800000000e+02, 1.2800000000e+02, 1.2800000000e+02, -1.2800000000e+02, 1.2800000000e+02, 1.2800000000e+02, 1.2800000000e+02, 1.2800000000e+02, 1.2800000000e+02, 1.2800000000e+02, 1.2800000000e+02, -1.2800000000e+02, 1.2800000000e+02, 1.2800000000e+02, 1.2800000000e+02, 1.2000000000e+02, 1.2000000000e+02, 1.2000000000e+02, 1.0800000000e+02, -1.0800000000e+02, 1.0000000000e+02, 9.6000000000e+01, 9.0000000000e+01, 9.0000000000e+01, 8.0000000000e+01, 7.5000000000e+01, 7.2000000000e+01, -6.4000000000e+01, 6.0000000000e+01, 5.0000000000e+01, 4.5000000000e+01, 4.0000000000e+01, 3.6000000000e+01, 2.7000000000e+01, 2.0000000000e+01 -} # unsigned pl -====================== SECTION_4 ( length=9948, padding=0 ) ====================== -1-3 section4Length = 9948 -4 dataFlag = 14 [00001110] -5-6 binaryScaleFactor = -6 -7-10 referenceValue = 160.252 -11 bitsPerValue = 13 -12-9948 values = (6114,9937) { -1.9907963562e+02, 1.9872026062e+02, 1.9851713562e+02, 1.9839213562e+02, 1.9822026062e+02, 1.9798588562e+02, 1.9770463562e+02, 1.9747026062e+02, -1.9737651062e+02, 1.9740776062e+02, 1.9756401062e+02, 1.9787651062e+02, 1.9839213562e+02, 1.9907963562e+02, 1.9979838562e+02, 2.0034526062e+02, -2.0059526062e+02, 2.0053276062e+02, 2.0015776062e+02, 1.9959526062e+02, 1.9984526062e+02, 1.9959526062e+02, 1.9954838562e+02, 1.9943901062e+02, -1.9940776062e+02, 1.9926713562e+02, 1.9875151062e+02, 1.9789213562e+02, 1.9698588562e+02, 1.9642338562e+02, 1.9637651062e+02, 1.9679838562e+02, -1.9737651062e+02, 1.9782963562e+02, 1.9806401062e+02, 1.9814213562e+02, 1.9843901062e+02, 1.9925151062e+02, 2.0065776062e+02, 2.0222026062e+02, -2.0334526062e+02, 2.0389213562e+02, 2.0420463562e+02, 2.0442338562e+02, 2.0404838562e+02, 2.0265776062e+02, 2.0090776062e+02, 2.0176713562e+02, -2.0101713562e+02, 2.0039213562e+02, 1.9961088562e+02, 1.9925151062e+02, 1.9940776062e+02, 1.9934526062e+02, 1.9872026062e+02, 1.9790776062e+02, -1.9725151062e+02, 1.9670463562e+02, 1.9623588562e+02, 1.9597026062e+02, 1.9595463562e+02, 1.9612651062e+02, 1.9645463562e+02, 1.9692338562e+02, -1.9750151062e+02, 1.9809526062e+02, 1.9845463562e+02, 1.9845463562e+02, 1.9829838562e+02, 1.9837651062e+02, 1.9882963562e+02, 1.9993901062e+02, -2.0181401062e+02, 2.0401713562e+02, 2.0581401062e+02, 2.0700151062e+02, 2.0781401062e+02, 2.0848588562e+02, 2.0926713562e+02, 2.0973588562e+02, -2.0887651062e+02, 2.0640776062e+02, 2.0356401062e+02, 2.0676713562e+02, 2.0443901062e+02, 2.0272026062e+02, 2.0140776062e+02, 2.0081401062e+02, -2.0068901062e+02, 1.9993901062e+02, 1.9834526062e+02, 1.9704838562e+02, 1.9695463562e+02, 1.9770463562e+02, 1.9812651062e+02, 1.9779838562e+02, -1.9726713562e+02, 1.9690776062e+02, 1.9653276062e+02, 1.9626713562e+02 -... 6014 more values -} # data_g1simple_packing values -====================== SECTION_5 ( length=4, padding=0 ) ====================== -1-4 7777 = 7777 +GRIB { + editionNumber = 1; + table2Version = 128; + # European Centre for Medium-Range Weather Forecasts (common/c-1.table) + centre = 98; + generatingProcessIdentifier = 130; + # Temperature (K) (grib1/2.98.128.table) + indicatorOfParameter = 130; + # Hybrid level level number (2 octets) (grib1/local/ecmf/3.table , grib1/3.table) + indicatorOfTypeOfLevel = 109; + level = 1; + # Forecast product valid at reference time + P1 (P1>0) (grib1/local/ecmf/5.table , grib1/5.table) + timeRangeIndicator = 0; + # Unknown code table entry (grib1/0.ecmf.table) + subCentre = 0; + paramId = 130; + #-READ ONLY- cfNameECMF = air_temperature; + #-READ ONLY- cfName = air_temperature; + #-READ ONLY- cfVarNameECMF = t; + #-READ ONLY- cfVarName = t; + #-READ ONLY- units = K; + #-READ ONLY- nameECMF = Temperature; + #-READ ONLY- name = Temperature; + decimalScaleFactor = 0; + dataDate = 20080206; + dataTime = 1200; + # Hour (stepUnits.table) + stepUnits = 1; + stepRange = 0; + startStep = 0; + endStep = 0; + #-READ ONLY- marsParam = 130.128; + # MARS labelling or ensemble forecast data (grib1/localDefinitionNumber.98.table) + localDefinitionNumber = 1; + # Operational archive (mars/class.table) + marsClass = 1; + # Analysis (mars/type.table) + marsType = 2; + # Atmospheric model (mars/stream.table) + marsStream = 1025; + experimentVersionNumber = 0001; + perturbationNumber = 0; + numberOfForecastsInEnsemble = 0; + shortName = t; + GDSPresent = 1; + bitmapPresent = 0; + numberOfVerticalCoordinateValues = 184; + Ni = MISSING; + Nj = 64; + latitudeOfFirstGridPointInDegrees = 87.864; + longitudeOfFirstGridPointInDegrees = 0; + earthIsOblate = 0; + uvRelativeToGrid = 0; + latitudeOfLastGridPointInDegrees = -87.864; + longitudeOfLastGridPointInDegrees = 357.188; + iDirectionIncrement = MISSING; + iDirectionIncrementInDegrees = MISSING; + N = 32; + iScansNegatively = 0; + jScansPositively = 0; + jPointsAreConsecutive = 0; + #-READ ONLY- alternativeRowScanning = 0; + global = 1; + #-READ ONLY- numberOfDataPoints = 6114; + #-READ ONLY- numberOfDataPointsExpected = 6114; + #-READ ONLY- numberOfValues = 6114; + isOctahedral = 0; + pv(184) = { + 0, 2.00004, 3.98083, 7.38719, 12.9083, + 21.4136, 33.9529, 51.7466, 76.1677, 108.716, + 150.986, 204.637, 271.356, 352.824, 450.686, + 566.519, 701.813, 857.946, 1036.17, 1237.59, + 1463.16, 1713.71, 1989.87, 2292.16, 2620.9, + 2976.3, 3358.43, 3767.2, 4202.42, 4663.78, + 5150.86, 5663.16, 6199.84, 6759.73, 7341.47, + 7942.93, 8564.62, 9208.3, 9873.56, 10558.9, + 11262.5, 11982.7, 12713.9, 13453.2, 14192, + 14922.7, 15638.1, 16329.6, 16990.6, 17613.3, + 18191, 18717, 19184.5, 19587.5, 19919.8, + 20175.4, 20348.9, 20434.2, 20426.2, 20319, + 20107, 19785.4, 19348.8, 18798.8, 18141.3, + 17385.6, 16544.6, 15633.6, 14665.6, 13653.2, + 12608.4, 11543.2, 10471.3, 9405.22, 8356.25, + 7335.16, 6353.92, 5422.8, 4550.21, 3743.46, + 3010.15, 2356.2, 1784.85, 1297.66, 895.194, + 576.314, 336.772, 162.043, 54.2083, 6.57563, + 0.00316, 0, 0, 0, 0, + 0, 0, 0, 0, 0 + ... 84 more values + } + pl(64) = { + 20, 27, 36, 40, 45, + 50, 60, 64, 72, 75, + 80, 90, 90, 96, 100, + 108, 108, 120, 120, 120, + 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, + 128, 128, 128, 128, 120, + 120, 120, 108, 108, 100, + 96, 90, 90, 80, 75, + 72, 64, 60, 50, 45, + 40, 36, 27, 20 + } + missingValue = 9999; + #-READ ONLY- binaryScaleFactor = -6; + #-READ ONLY- referenceValue = 160.252; + sphericalHarmonics = 0; + complexPacking = 0; + integerPointValues = 0; + additionalFlagPresent = 0; + packingType = grid_simple; + bitsPerValue = 13; + values(6114) = { + 199.08, 198.72, 198.517, 198.392, 198.22, + 197.986, 197.705, 197.47, 197.377, 197.408, + 197.564, 197.877, 198.392, 199.08, 199.798, + 200.345, 200.595, 200.533, 200.158, 199.595, + 199.845, 199.595, 199.548, 199.439, 199.408, + 199.267, 198.752, 197.892, 196.986, 196.423, + 196.377, 196.798, 197.377, 197.83, 198.064, + 198.142, 198.439, 199.252, 200.658, 202.22, + 203.345, 203.892, 204.205, 204.423, 204.048, + 202.658, 200.908, 201.767, 201.017, 200.392, + 199.611, 199.252, 199.408, 199.345, 198.72, + 197.908, 197.252, 196.705, 196.236, 195.97, + 195.955, 196.127, 196.455, 196.923, 197.502, + 198.095, 198.455, 198.455, 198.298, 198.377, + 198.83, 199.939, 201.814, 204.017, 205.814, + 207.002, 207.814, 208.486, 209.267, 209.736, + 208.877, 206.408, 203.564, 206.767, 204.439, + 202.72, 201.408, 200.814, 200.689, 199.939, + 198.345, 197.048, 196.955, 197.705, 198.127, + 197.798, 197.267, 196.908, 196.533, 196.267 + ... 6014 more values + } + #-READ ONLY- numberOfCodedValues = 6114; + #-READ ONLY- maximum = 224.455; + #-READ ONLY- minimum = 160.252; + #-READ ONLY- average = 194.458; + #-READ ONLY- numberOfMissing = 0; + #-READ ONLY- standardDeviation = 12.8976; + #-READ ONLY- skewness = -0.807543; + #-READ ONLY- kurtosis = 0.45733; + #-READ ONLY- isConstant = 0; + gridType = reduced_gg; + #-READ ONLY- getNumberOfValues = 6114; +} diff --git a/tests/grib_bitmap.sh b/tests/grib_bitmap.sh index 69e7d84b1..242af89ce 100755 --- a/tests/grib_bitmap.sh +++ b/tests/grib_bitmap.sh @@ -22,27 +22,51 @@ temp2=out.bmp.grib2 tempData1=out.bmp.grib1.data tempData2=out.bmp.grib2.data tempRules=bitmap.rules +tempRef=grib_bitmap.ref rm -f $outfile +# Add a bitmap +# ------------- ${tools_dir}/grib_set -s bitmapPresent=1 $infile $outfile >$REDIRECT -${tools_dir}/grib_dump -O $infile | grep -v FILE > $infile.dump -${tools_dir}/grib_dump -O $outfile | grep -v FILE > $outfile.dump +${tools_dir}/grib_dump $infile | grep -v FILE > $infile.dump +${tools_dir}/grib_dump $outfile | grep -v FILE > $outfile.dump + +grib_check_key_equals $outfile section1Flags,section3Length '192 772' +diff $outfile.dump ${data_dir}/bitmap.diff >$REDIRECT 2>&1 +diff $infile.dump ${data_dir}/no_bitmap.diff >$REDIRECT 2>&1 + + +${tools_dir}/grib_dump -O -p bitmap $outfile | grep -v FILE > $outfile.dump +cat > $tempRef <$REDIRECT -${tools_dir}/grib_dump -O $outfile1 | grep -v FILE > $outfile1.dump -${tools_dir}/grib_dump -O $outfile | grep -v FILE> $outfile.dump +${tools_dir}/grib_dump $outfile1 | grep -v FILE > $outfile1.dump +${tools_dir}/grib_dump $outfile | grep -v FILE > $outfile.dump diff $outfile1.dump ${data_dir}/no_bitmap.diff -rm -f $outfile1 $outfile1.dump $outfile $outfile.dump || true +rm -f $outfile1 $outfile1.dump $outfile $outfile.dump + cat > $tempRules< Date: Mon, 16 Dec 2019 13:37:13 +0000 Subject: [PATCH 10/82] Windows: Use stat rather than fstat --- tests/grib_multi_from_message.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/grib_multi_from_message.c b/tests/grib_multi_from_message.c index d511e5395..8eed585ac 100644 --- a/tests/grib_multi_from_message.c +++ b/tests/grib_multi_from_message.c @@ -9,7 +9,7 @@ */ /* - * test: reading multi fields messages from memory + * test: reading GRIB2 multi fields messages from memory */ #include "grib_api.h" @@ -20,15 +20,17 @@ #include #endif -static void usage(const char* prog) { - printf("usage: %s [-m] file.grib\n",prog); +static void usage(const char* prog) +{ + fprintf(stderr, "usage: %s [-m] file.grib\n", prog); exit(1); } -int main(int argc,char* argv[]) { +int main(int argc,char* argv[]) +{ struct stat finfo; char shortName[20]={0,}; - size_t len=20; + size_t len; grib_handle* h=NULL; size_t fsize; unsigned char* data=NULL; @@ -52,7 +54,7 @@ int main(int argc,char* argv[]) { f=fopen(filename,"rb"); if (!f) {perror(filename);exit(1);} - fstat(fileno((FILE*)f),&finfo); + stat(filename, &finfo); fsize=finfo.st_size; data=(unsigned char*)malloc(fsize); From c2ba86593aa38f758c2b0dd190ca9be3b000a49e Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 16 Dec 2019 13:37:34 +0000 Subject: [PATCH 11/82] Tests: grib_nearest --- examples/C/CMakeLists.txt | 1 - examples/C/grib_nearest.c | 42 ++++++++++++--------------------------- 2 files changed, 13 insertions(+), 30 deletions(-) diff --git a/examples/C/CMakeLists.txt b/examples/C/CMakeLists.txt index f6e40fc24..83a97fea4 100644 --- a/examples/C/CMakeLists.txt +++ b/examples/C/CMakeLists.txt @@ -83,7 +83,6 @@ list( APPEND tests_extra grib_set_bitmap grib_list grib_get_data - grib_nearest grib_nearest_multiple set_missing bufr_attributes diff --git a/examples/C/grib_nearest.c b/examples/C/grib_nearest.c index acb82fea1..cd45548da 100644 --- a/examples/C/grib_nearest.c +++ b/examples/C/grib_nearest.c @@ -22,7 +22,7 @@ #include "eccodes.h" static void usage(const char* prog) { - printf("Usage: %s [-n] grib_file grib_file ...\n",prog); + printf("Usage: %s grib_file grib_file ...\n",prog); exit(1); } @@ -30,10 +30,9 @@ int main(int argc, char** argv) { int err = 0; long step=0; - size_t nfiles=0; - size_t i=0, j=0; + size_t nfiles; + int i=0; codes_fieldset* set=NULL; - const size_t max_numfiles = 100; codes_handle* h=NULL; char param[20]={0,}; size_t len=20; @@ -43,7 +42,6 @@ int main(int argc, char** argv) double distances[4]={0,}; int indexes[4]={0,}; char* order_by="param,step"; - double* pValues = values; /* Default: decode the values */ size_t size=4; double lat=-40,lon=15; @@ -54,24 +52,16 @@ int main(int argc, char** argv) if (argc < 2) usage(argv[0]); - filenames=(char**)malloc(sizeof(char*)*max_numfiles); - - for(i=1; i= max_numfiles) - break; - filenames[j++]=(char*)strdup(argv[i]); - } - } - nfiles = j; + nfiles=argc-1; + filenames=(char**)malloc(sizeof(char*)*nfiles); + for (i=0;i Date: Mon, 16 Dec 2019 14:56:58 +0000 Subject: [PATCH 12/82] Testing: show diff results when they fail --- tests/grib_bitmap.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/grib_bitmap.sh b/tests/grib_bitmap.sh index 242af89ce..27f563dfa 100755 --- a/tests/grib_bitmap.sh +++ b/tests/grib_bitmap.sh @@ -34,8 +34,8 @@ ${tools_dir}/grib_dump $infile | grep -v FILE > $infile.dump ${tools_dir}/grib_dump $outfile | grep -v FILE > $outfile.dump grib_check_key_equals $outfile section1Flags,section3Length '192 772' -diff $outfile.dump ${data_dir}/bitmap.diff >$REDIRECT 2>&1 -diff $infile.dump ${data_dir}/no_bitmap.diff >$REDIRECT 2>&1 +diff $outfile.dump ${data_dir}/bitmap.diff +diff $infile.dump ${data_dir}/no_bitmap.diff ${tools_dir}/grib_dump -O -p bitmap $outfile | grep -v FILE > $outfile.dump From 9f1c5845726406e6b2ab7c84a3137b12840c614f Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 16 Dec 2019 15:43:47 +0000 Subject: [PATCH 13/82] Testing: Windows diff dumps --- tests/grib_bitmap.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/grib_bitmap.sh b/tests/grib_bitmap.sh index 27f563dfa..991cc8dcb 100755 --- a/tests/grib_bitmap.sh +++ b/tests/grib_bitmap.sh @@ -34,9 +34,13 @@ ${tools_dir}/grib_dump $infile | grep -v FILE > $infile.dump ${tools_dir}/grib_dump $outfile | grep -v FILE > $outfile.dump grib_check_key_equals $outfile section1Flags,section3Length '192 772' -diff $outfile.dump ${data_dir}/bitmap.diff -diff $infile.dump ${data_dir}/no_bitmap.diff +if [ $ECCODES_ON_WINDOWS -eq 0 ]; then + # There are some minute floating point differences on Windows + # so the diff would not work there + diff $outfile.dump ${data_dir}/bitmap.diff + diff $infile.dump ${data_dir}/no_bitmap.diff +fi ${tools_dir}/grib_dump -O -p bitmap $outfile | grep -v FILE > $outfile.dump cat > $tempRef <$REDIRECT ${tools_dir}/grib_dump $outfile1 | grep -v FILE > $outfile1.dump ${tools_dir}/grib_dump $outfile | grep -v FILE > $outfile.dump -diff $outfile1.dump ${data_dir}/no_bitmap.diff +if [ $ECCODES_ON_WINDOWS -eq 0 ]; then + diff $outfile1.dump ${data_dir}/no_bitmap.diff +fi rm -f $outfile1 $outfile1.dump $outfile $outfile.dump From 2b6011153b08af61e2654bf26ec59168898f0e3b Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 16 Dec 2019 18:15:31 +0000 Subject: [PATCH 14/82] Windows: Fix BUFR decode (long vs size_t) (Part 1) --- src/grib_accessor_class_bufr_data_array.c | 6 +- src/grib_api_prototypes.h | 1 + src/grib_bits.c | 1 + src/grib_bits_any_endian.c | 67 +++++++++++++++++++++++ 4 files changed, 72 insertions(+), 3 deletions(-) diff --git a/src/grib_accessor_class_bufr_data_array.c b/src/grib_accessor_class_bufr_data_array.c index 31851d8a1..de485e02d 100644 --- a/src/grib_accessor_class_bufr_data_array.c +++ b/src/grib_accessor_class_bufr_data_array.c @@ -606,7 +606,7 @@ static grib_darray* decode_double_array(grib_context* c,unsigned char* data,long { grib_darray* ret=NULL; int j; - unsigned long lval; + size_t lval; int localReference,localWidth,modifiedWidth,modifiedReference; double modifiedFactor,dval; int bufr_multi_element_constant_arrays = c->bufr_multi_element_constant_arrays; @@ -627,7 +627,7 @@ static grib_darray* decode_double_array(grib_context* c,unsigned char* data,long *err=0; return ret; } - lval=grib_decode_unsigned_long(data,pos,modifiedWidth); + lval=grib_decode_size_t(data,pos,modifiedWidth); localReference=(long)lval+modifiedReference; localWidth=grib_decode_unsigned_long(data,pos,6); grib_context_log(c, GRIB_LOG_DEBUG,"BUFR data decoding: \tlocalWidth=%ld",localWidth); @@ -644,7 +644,7 @@ static grib_darray* decode_double_array(grib_context* c,unsigned char* data,long return ret; } for (j=0;jnumberOfSubsets;j++) { - lval=grib_decode_unsigned_long(data,pos,localWidth); + lval=grib_decode_size_t(data,pos,localWidth); if (grib_is_all_bits_one(lval,localWidth) && canBeMissing) { dval=GRIB_MISSING_DOUBLE; } else { diff --git a/src/grib_api_prototypes.h b/src/grib_api_prototypes.h index 129de01b3..cb3c9bc97 100644 --- a/src/grib_api_prototypes.h +++ b/src/grib_api_prototypes.h @@ -1552,6 +1552,7 @@ int grib_encode_string(unsigned char *bitStream, long *bitOffset, size_t numberO char *grib_decode_string(const unsigned char *bitStream, long *bitOffset, size_t numberOfCharacters, char *string); unsigned long grib_decode_unsigned_long(const unsigned char *p, long *bitp, long nbits); int grib_encode_unsigned_long(unsigned char *p, unsigned long val, long *bitp, long nbits); +size_t grib_decode_size_t(const unsigned char* p, long* bitp, long nbits); int grib_encode_unsigned_longb(unsigned char *p, unsigned long val, long *bitp, long nb); /* grib_bits_any_endian_simple.c */ diff --git a/src/grib_bits.c b/src/grib_bits.c index 066509d18..442c96a8a 100644 --- a/src/grib_bits.c +++ b/src/grib_bits.c @@ -33,6 +33,7 @@ long GRIB_MASK = -1; /* Mask of sword bits */ static const unsigned long dmasks[] = { 0xFF, 0xFE, 0xFC, 0xF8, 0xF0, 0xE0, 0xC0, 0x80, 0x00, }; static const int max_nbits = sizeof(unsigned long)*8; +static const int max_nbits_size_t = sizeof(size_t)*8; unsigned long grib_decode_unsigned_byte_long(const unsigned char* p, long o, int l) { diff --git a/src/grib_bits_any_endian.c b/src/grib_bits_any_endian.c index 4f12705c1..5d7cfb7d7 100644 --- a/src/grib_bits_any_endian.c +++ b/src/grib_bits_any_endian.c @@ -298,6 +298,73 @@ int grib_encode_unsigned_long(unsigned char* p, unsigned long val ,long *bitp, l return GRIB_SUCCESS; } +/* + * Note: On x64 Micrsoft Windows a "long" is 32 bits but "size_t" is 64 bits + */ +#define BIT_MASK_SIZE_T(x) \ + (((x) == max_nbits_size_t) ? \ + (size_t) -1UL : (1UL << (x)) - 1) + +size_t grib_decode_size_t(const unsigned char* p, long *bitp, long nbits) +{ + size_t ret = 0; + long oc = *bitp / 8; + size_t mask = 0; + long pi = 0; + int usefulBitsInByte = 0; + long bitsToRead = 0; + + if (nbits == 0) return 0; + + if (nbits > max_nbits_size_t) + { + int bits = nbits; + int mod = bits % max_nbits_size_t; + + if (mod != 0) + { + int e = grib_decode_size_t(p, bitp, mod); + Assert(e == 0); + bits -= mod; + } + + while (bits > max_nbits_size_t) + { + int e = grib_decode_size_t(p, bitp, max_nbits_size_t); + Assert(e == 0); + bits -= max_nbits_size_t; + } + + return grib_decode_size_t(p, bitp, bits); + } + + mask = BIT_MASK_SIZE_T(nbits); + /* pi: position of bitp in p[]. >>3 == /8 */ + pi = oc; + /* number of useful bits in current byte */ + usefulBitsInByte = 8 - (*bitp & 7); + /* read at least enough bits (byte by byte) from input */ + bitsToRead = nbits; + while (bitsToRead > 0) { + ret <<= 8; + /* ret += p[pi]; */ + DebugAssert((ret & p[pi]) == 0); + ret = ret | p[pi]; + pi++; + bitsToRead -= usefulBitsInByte; + usefulBitsInByte = 8; + } + *bitp += nbits; + + /* bitsToRead might now be negative (too many bits read) */ + /* remove those which are too much */ + ret >>= -1 * bitsToRead; + /* remove leading bits (from previous value) */ + ret &= mask; + + return ret; +} + int grib_encode_unsigned_longb(unsigned char* p, unsigned long val ,long *bitp, long nb) { long i = 0; From dd023122f18046d38d1d4960182b7325defe5a6f Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 17 Dec 2019 13:42:35 +0000 Subject: [PATCH 15/82] Windows: Fix BUFR decode (long vs size_t) (Part 2) --- src/grib_accessor_class_bufr_data_array.c | 4 ++-- src/grib_accessor_class_count_missing.c | 13 ++++++------- src/grib_accessor_class_gen.c | 20 +++++++++++++++++--- src/grib_dumper_class_wmo.c | 13 ++++++++++--- 4 files changed, 35 insertions(+), 15 deletions(-) diff --git a/src/grib_accessor_class_bufr_data_array.c b/src/grib_accessor_class_bufr_data_array.c index de485e02d..bcc0af2aa 100644 --- a/src/grib_accessor_class_bufr_data_array.c +++ b/src/grib_accessor_class_bufr_data_array.c @@ -1012,7 +1012,7 @@ static double decode_double_value(grib_context* c,unsigned char* data,long* pos, bufr_descriptor* bd,int canBeMissing, grib_accessor_bufr_data_array* self,int* err) { - unsigned long lval; + size_t lval; int modifiedWidth,modifiedReference; double modifiedFactor; double dval=0; @@ -1026,7 +1026,7 @@ static double decode_double_value(grib_context* c,unsigned char* data,long* pos, CHECK_END_DATA_RETURN(c, self, modifiedWidth, 0); if (*err) {*err=0; return GRIB_MISSING_DOUBLE;} - lval=grib_decode_unsigned_long(data,pos,modifiedWidth); + lval=grib_decode_size_t(data,pos,modifiedWidth); if (grib_is_all_bits_one(lval,modifiedWidth) && canBeMissing) { dval=GRIB_MISSING_DOUBLE; } else { diff --git a/src/grib_accessor_class_count_missing.c b/src/grib_accessor_class_count_missing.c index 1f188b65e..3a72bc9fa 100644 --- a/src/grib_accessor_class_count_missing.c +++ b/src/grib_accessor_class_count_missing.c @@ -173,7 +173,6 @@ static const unsigned char bitson[]={ 8 }; */ - static void init(grib_accessor* a, const long len , grib_arguments* arg ) { int n=0; @@ -185,7 +184,7 @@ static void init(grib_accessor* a, const long len , grib_arguments* arg ) self->numberOfDataPoints = grib_arguments_get_name(grib_handle_of_accessor(a),arg,n++); } -static const int used[] ={ 0,1,3,7,15,31,63,127,255}; +static const int used[] = { 0,1,3,7,15,31,63,127,255}; static int unpack_long(grib_accessor* a, long* val, size_t *len) { @@ -197,7 +196,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) long unusedBitsInBitmap=0; long numberOfDataPoints=0; grib_handle* h=grib_handle_of_accessor(a); - grib_accessor* bitmap=grib_find_accessor(grib_handle_of_accessor(a),self->bitmap); + grib_accessor* bitmap=grib_find_accessor(h, self->bitmap); *val=0; *len=1; @@ -214,14 +213,14 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) unusedBitsInBitmap=size*8-numberOfDataPoints; } - p=grib_handle_of_accessor(a)->buffer->data+offset; + p = h->buffer->data+offset; - size-=unusedBitsInBitmap/8; - unusedBitsInBitmap= unusedBitsInBitmap % 8; + size -= unusedBitsInBitmap/8; + unusedBitsInBitmap = unusedBitsInBitmap % 8; for (i=0;i= 0) { + length = strlen(v[i]); + err = grib_pack_string(as, v[i], &length); + if (err) return err; + --i; + as = as->same; + } + return GRIB_SUCCESS; } static int pack_string(grib_accessor*a , const char* v, size_t *len){ @@ -508,7 +522,7 @@ static int pack_string(grib_accessor*a , const char* v, size_t *len){ } grib_context_log(a->context,GRIB_LOG_ERROR, - " Should not grib_pack %s as string", a->name); + " Should not grib_pack %s as string", a->name); return GRIB_NOT_IMPLEMENTED; } diff --git a/src/grib_dumper_class_wmo.c b/src/grib_dumper_class_wmo.c index 3cba3a273..feb08475f 100644 --- a/src/grib_dumper_class_wmo.c +++ b/src/grib_dumper_class_wmo.c @@ -404,6 +404,7 @@ static void dump_values(grib_dumper* d,grib_accessor* a) double* buf = NULL; size_t size=0; long count=0; + int is_char = 0; if( a->length == 0 && (d->option_flags & GRIB_DUMP_FLAG_CODED) != 0) @@ -420,6 +421,11 @@ static void dump_values(grib_dumper* d,grib_accessor* a) set_begin_end(d,a); + /* For the DIAG pseudo GRIBs. Key charValues uses 1-byte integers to represent a character */ + if ( a->flags & GRIB_ACCESSOR_FLAG_STRING_TYPE ) { + is_char = 1; + } + /*for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," ");*/ print_offset(self->dumper.out,self->begin,self->theEnd); if ((d->option_flags & GRIB_DUMP_FLAG_TYPE) != 0) @@ -453,7 +459,6 @@ static void dump_values(grib_dumper* d,grib_accessor* a) size = 100; } - k = 0; while(k < size) { @@ -462,14 +467,16 @@ static void dump_values(grib_dumper* d,grib_accessor* a) /*for(i = 0; i < d->depth + 3 ; i++) fprintf(self->dumper.out," ");*/ for(j = 0; j < 8 && k < size; j++, k++) { - fprintf(self->dumper.out,"%.10e",buf[k]); + if (is_char) fprintf(self->dumper.out,"'%c'",(char)buf[k]); + else fprintf(self->dumper.out,"%.10e",buf[k]); if(k != size-1) fprintf(self->dumper.out,", "); } fprintf(self->dumper.out,"\n"); #else - fprintf(self->dumper.out,"%d %g\n",k,buf[k]); + if(is_char) fprintf(self->dumper.out,"%d '%c'\n",k,(char)buf[k]); + else fprintf(self->dumper.out,"%d %g\n",k,buf[k]); #endif From 4f1cf21771cd99404a6c4b0239a824f8515d1ac1 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 17 Dec 2019 15:13:41 +0000 Subject: [PATCH 16/82] Windows: Fix BUFR encode (long vs size_t) (Part 3) --- src/grib_accessor_class_bufr_data_array.c | 14 ++++++------ src/grib_api_prototypes.h | 2 ++ src/grib_bits_any_endian.c | 28 +++++++++++++++++++++++ 3 files changed, 37 insertions(+), 7 deletions(-) diff --git a/src/grib_accessor_class_bufr_data_array.c b/src/grib_accessor_class_bufr_data_array.c index bcc0af2aa..85f0c4049 100644 --- a/src/grib_accessor_class_bufr_data_array.c +++ b/src/grib_accessor_class_bufr_data_array.c @@ -748,7 +748,7 @@ static int encode_double_array(grib_context* c,grib_buffer* buff,long* pos, bufr { int err=0; int j,i; - unsigned long lval; + size_t lval; long localReference=0,localWidth=0,modifiedWidth,modifiedReference; long reference,allone; double localRange,modifiedFactor,inverseFactor; @@ -801,7 +801,7 @@ static int encode_double_array(grib_context* c,grib_buffer* buff,long* pos, bufr } } else { lval=round(*v * inverseFactor)-modifiedReference; - grib_encode_unsigned_longb(buff->data,lval,pos,modifiedWidth); + grib_encode_size_tb(buff->data,lval,pos,modifiedWidth); } } grib_buffer_set_ulength_bits(c,buff,buff->ulength_bits+6); @@ -827,7 +827,7 @@ static int encode_double_array(grib_context* c,grib_buffer* buff,long* pos, bufr grib_set_bits_on(buff->data,pos,modifiedWidth); } else { lval=round(*v * inverseFactor)-modifiedReference; - grib_encode_unsigned_longb(buff->data,lval,pos,modifiedWidth); + grib_encode_size_tb(buff->data,lval,pos,modifiedWidth); } grib_buffer_set_ulength_bits(c,buff,buff->ulength_bits+6); grib_encode_unsigned_longb(buff->data,localWidth,pos,6); @@ -908,7 +908,7 @@ static int encode_double_array(grib_context* c,grib_buffer* buff,long* pos, bufr grib_set_bits_on(buff->data,pos,modifiedWidth); } else { lval=localReference-modifiedReference; - grib_encode_unsigned_longb(buff->data,lval,pos,modifiedWidth); + grib_encode_size_tb(buff->data,lval,pos,modifiedWidth); } } grib_buffer_set_ulength_bits(c,buff,buff->ulength_bits+6); @@ -921,7 +921,7 @@ static int encode_double_array(grib_context* c,grib_buffer* buff,long* pos, bufr grib_set_bits_on(buff->data,pos,localWidth); } else { lval=round(values[j]*inverseFactor)-reference; - grib_encode_unsigned_longb(buff->data,lval,pos,localWidth); + grib_encode_size_tb(buff->data,lval,pos,localWidth); } } } @@ -934,7 +934,7 @@ static int encode_double_array(grib_context* c,grib_buffer* buff,long* pos, bufr static int encode_double_value(grib_context* c,grib_buffer* buff,long* pos,bufr_descriptor* bd, grib_accessor_bufr_data_array* self,double value) { - unsigned long lval; + size_t lval; double maxAllowed,minAllowed; int err=0; int modifiedWidth,modifiedReference; @@ -968,7 +968,7 @@ static int encode_double_value(grib_context* c,grib_buffer* buff,long* pos,bufr_ else { lval=round(value/modifiedFactor)-modifiedReference; if (c->debug) grib_context_log(c, GRIB_LOG_DEBUG, "encode_double_value %s: value=%.15f lval=%lu\n", bd->shortName,value,lval); - grib_encode_unsigned_longb(buff->data,lval,pos,modifiedWidth); + grib_encode_size_tb(buff->data,lval,pos,modifiedWidth); } return err; diff --git a/src/grib_api_prototypes.h b/src/grib_api_prototypes.h index cb3c9bc97..80fb72392 100644 --- a/src/grib_api_prototypes.h +++ b/src/grib_api_prototypes.h @@ -1554,6 +1554,8 @@ unsigned long grib_decode_unsigned_long(const unsigned char *p, long *bitp, long int grib_encode_unsigned_long(unsigned char *p, unsigned long val, long *bitp, long nbits); size_t grib_decode_size_t(const unsigned char* p, long* bitp, long nbits); int grib_encode_unsigned_longb(unsigned char *p, unsigned long val, long *bitp, long nb); +int grib_encode_size_tb(unsigned char* p, size_t val ,long *bitp, long nb); + /* grib_bits_any_endian_simple.c */ int grib_decode_long_array(const unsigned char *p, long *bitp, long bitsPerValue, size_t n_vals, long *val); diff --git a/src/grib_bits_any_endian.c b/src/grib_bits_any_endian.c index 5d7cfb7d7..5ec1ff973 100644 --- a/src/grib_bits_any_endian.c +++ b/src/grib_bits_any_endian.c @@ -391,6 +391,34 @@ int grib_encode_unsigned_longb(unsigned char* p, unsigned long val ,long *bitp, return GRIB_SUCCESS; } +/// +int grib_encode_size_tb(unsigned char* p, size_t val ,long *bitp, long nb) +{ + long i = 0; + + if (nb > max_nbits_size_t) { + fprintf(stderr, "Number of bits (%ld) exceeds maximum number of bits (%d)\n", nb, max_nbits_size_t); + Assert(0); + } +#ifdef DEBUG + { + size_t maxV = grib_power(nb,2); + if (val > maxV) { + fprintf(stderr, "grib_encode_size_tb: Value=%lu, but number of bits=%ld!\n", val, nb); + Assert(0); + } + } +#endif + for(i=nb-1; i >= 0; i--){ + if(test(val,i)) + grib_set_bit_on (p, bitp); + else + grib_set_bit_off(p, bitp); + } + return GRIB_SUCCESS; +} +/// + #if OMP_PACKING #include "grib_bits_any_endian_omp.c" #elif VECTOR From d8554cdef645e548c9d7cf5b754858820c1406a0 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 17 Dec 2019 16:36:41 +0000 Subject: [PATCH 17/82] Windows: Add relative tolerance for BUFR compare --- tests/bufr_dump_encode_filter.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/bufr_dump_encode_filter.sh b/tests/bufr_dump_encode_filter.sh index 71277c195..2ceff8f5e 100755 --- a/tests/bufr_dump_encode_filter.sh +++ b/tests/bufr_dump_encode_filter.sh @@ -46,6 +46,11 @@ files=`cat ${data_dir}/bufr/bufr_data_files.txt` # set #1#3HourPressureChange=-1.6; # The hash cannot be followed by a number! exclude="ias1_240.bufr syno_multi.bufr tropical_cyclone.bufr aeolus_wmo_26.bufr israel_observations_2017041010.bufr " +cmp_options="" + +if [ $ECCODES_ON_WINDOWS -eq 1 ]; then + cmp_options="-R all=7e-8" +fi for f in $files do @@ -60,7 +65,8 @@ do ${tools_dir}/bufr_dump -Efilter $f > $fRules ${tools_dir}/codes_bufr_filter -o $fBufrTmp $fRules $f - ${tools_dir}/bufr_compare $fBufrTmp $f + + ${tools_dir}/bufr_compare $cmp_options $fBufrTmp $f TEMP_OUT1=${label}.$f.dump.out TEMP_OUT2=${label}.$fBufrTmp.dump.out From 1a456709491e394a9605f7846f26fd1cb131d97b Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 17 Dec 2019 22:03:17 +0000 Subject: [PATCH 18/82] Windows: Increase relative tolerance for BUFR compare --- tests/bufr_dump_encode_filter.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/bufr_dump_encode_filter.sh b/tests/bufr_dump_encode_filter.sh index 2ceff8f5e..b6db7e5e0 100755 --- a/tests/bufr_dump_encode_filter.sh +++ b/tests/bufr_dump_encode_filter.sh @@ -49,7 +49,7 @@ exclude="ias1_240.bufr syno_multi.bufr tropical_cyclone.bufr aeolus_wmo_26.bufr cmp_options="" if [ $ECCODES_ON_WINDOWS -eq 1 ]; then - cmp_options="-R all=7e-8" + cmp_options="-R all=1e-7" fi for f in $files From 528f31df9510e5d570507651c79006da30c2a973 Mon Sep 17 00:00:00 2001 From: Daniel Tipping Date: Wed, 18 Dec 2019 07:39:45 +0000 Subject: [PATCH 19/82] Debug test env --- tests/grib_to_netcdf.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/grib_to_netcdf.sh b/tests/grib_to_netcdf.sh index adcfc42f3..095758b88 100755 --- a/tests/grib_to_netcdf.sh +++ b/tests/grib_to_netcdf.sh @@ -30,6 +30,7 @@ tmp_netcdf=tmp.ncf # debug echo $PATH +env # Go thru all the specified GRIB files and convert them to NetCDF for dt in $ncf_types From 012f5d5820d5ce18faa2827362f21152bbb9d62a Mon Sep 17 00:00:00 2001 From: Daniel Tipping Date: Wed, 18 Dec 2019 07:46:19 +0000 Subject: [PATCH 20/82] Use %CONDA% instead of %CONDA_PREFIX% %CONDA_PREFIX%\Library\bin seems to be converted to /bin by m2bash --- .appveyor.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index a880117c4..85abd31a5 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -28,9 +28,8 @@ init: - cmd: call %CONDA%\Scripts\activate.bat # add eccodes\build\bin to path so tests can find eccodes.dll - cmd: set PATH=%PATH%;%ECCODES_SRC%\build\bin - # add %CONDA_PREFIX%\Library\bin to path so tests can find netcdf.dll - # I'm pretty sure this should already be in the system path once Conda is activated. - - cmd: set PATH=%PATH%;%CONDA_PREFIX%\Library\bin + # add %CONDA%\Library\bin to path so tests can find netcdf.dll + - cmd: set PATH=%PATH%;%CONDA%\Library\bin # auto-yes for conda - cmd: conda config --set always_yes yes From e361d1dea0c2014310a6970179188b23619aa558 Mon Sep 17 00:00:00 2001 From: Daniel Tipping Date: Wed, 18 Dec 2019 08:24:48 +0000 Subject: [PATCH 21/82] Check /bin for netcdf.dll --- tests/grib_to_netcdf.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/grib_to_netcdf.sh b/tests/grib_to_netcdf.sh index 095758b88..da222d0f0 100755 --- a/tests/grib_to_netcdf.sh +++ b/tests/grib_to_netcdf.sh @@ -31,6 +31,7 @@ tmp_netcdf=tmp.ncf # debug echo $PATH env +ls /bin # Go thru all the specified GRIB files and convert them to NetCDF for dt in $ncf_types From 0b6eb518d9008671888f91a5996cb581e4962301 Mon Sep 17 00:00:00 2001 From: Daniel Tipping Date: Wed, 18 Dec 2019 09:27:19 +0000 Subject: [PATCH 22/82] Debug bash location --- .appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.appveyor.yml b/.appveyor.yml index 85abd31a5..5d0a26f73 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -59,6 +59,7 @@ install: # debug - cmd: find %CONDA_PREFIX% -name netcdf.dll - cmd: where netcdf.dll + - cmd: where bash.exe #---------------------------------# # build configuration # From 36ae21b397d46cac6386f80ecdf72b1b6e8ef35a Mon Sep 17 00:00:00 2001 From: Daniel Tipping Date: Wed, 18 Dec 2019 10:06:54 +0000 Subject: [PATCH 23/82] Attempt to fix missing netcdf.dll --- .appveyor.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.appveyor.yml b/.appveyor.yml index 5d0a26f73..f57d0c48a 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -61,6 +61,23 @@ install: - cmd: where netcdf.dll - cmd: where bash.exe + # We saw a problem with the grib_to_netcdf test where we could not find netcdf.dll. + # + # $ where netcdf.dll + # c:\Miniconda37-x64\Library\bin\netcdf.dll + # $ where bash.exe + # c:\Miniconda37-x64\Library\usr\bin\bash.exe + # + # When we use m2-bash for the tests it changes our system path. + # c:\Miniconda37-x64\Library\bin\ becomes /bin + # yet `ls /bin` shows bash.exe amongst others. + # It seems that /bin is actually pointing to c:\Miniconda37-x64\Library\usr\bin + # which means the path conversion is wrong. + # Seems like this could be a bug in m2-bash. + # + # Put netcdf.dll somewhere we can find it. + - cmd: cp %CONDA_PREFIX%\Library\bin\netcdf.dll %CONDA_PREFIX%\Library\usr\bin\netcdf.dll + #---------------------------------# # build configuration # #---------------------------------# From adfca52ede7cb010c11388472c928b9cfd13db61 Mon Sep 17 00:00:00 2001 From: Daniel Tipping Date: Wed, 18 Dec 2019 10:07:16 +0000 Subject: [PATCH 24/82] Check contents of /usr/bin --- tests/grib_to_netcdf.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/grib_to_netcdf.sh b/tests/grib_to_netcdf.sh index da222d0f0..5b97d3598 100755 --- a/tests/grib_to_netcdf.sh +++ b/tests/grib_to_netcdf.sh @@ -32,6 +32,7 @@ tmp_netcdf=tmp.ncf echo $PATH env ls /bin +ls /usr/bin # Go thru all the specified GRIB files and convert them to NetCDF for dt in $ncf_types From 17e907672e06e7ac1cf47385496c1da900f180f1 Mon Sep 17 00:00:00 2001 From: Daniel Tipping Date: Wed, 18 Dec 2019 11:10:39 +0000 Subject: [PATCH 25/82] More ntldd --- .appveyor.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index f57d0c48a..56c36efed 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -106,7 +106,9 @@ build_script: .. - cmd: nmake - cmd: ntldd %ECCODES_SRC%/build/bin/grib_to_netcdf.exe # debug - - cmd: echo %PATH% + - cmd: ntldd %CONDA_PREFIX%/Library/bin/netcdf.dll # debug + - cmd: ntldd %CONDA_PREFIX%/Library/usr/bin\netcdf.dll # debug + - cmd: echo %PATH% # debug - cmd: ctest --output-on-failure - cmd: nmake install From 9f3dac53afdceea2b2840050126b0a75ffb275a3 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 18 Dec 2019 17:25:32 +0000 Subject: [PATCH 26/82] Latest changes from develop --- definitions/boot.def | 6 +- definitions/diag/boot.def | 14 + definitions/diag/section.1.def | 79 ++++ definitions/diag/section.4.def | 41 ++ examples/C/grib_nearest.sh | 53 --- examples/C/include.ctest.sh.in | 2 + samples/diag.tmpl | Bin 0 -> 2423 bytes src/grib_bits_any_endian.c | 7 +- tests/CMakeLists.txt | 1 + tests/diag.sh | 80 ++++ tests/grib_local.sh | 20 + tests/grib_to_netcdf.sh | 47 ++- tools/grib_to_netcdf.c | 3 +- windows/msvc/bufr_filter/bufr_filter.vcproj | 375 ++++++++++++++++++ windows/msvc/bufr_filter/bufr_filter.vcxproj | 209 ++++++++++ .../bufr_filter/bufr_filter.vcxproj.filters | 22 + windows/msvc/grib_api.sln | 10 + 17 files changed, 898 insertions(+), 71 deletions(-) create mode 100644 definitions/diag/boot.def create mode 100644 definitions/diag/section.1.def create mode 100644 definitions/diag/section.4.def delete mode 100755 examples/C/grib_nearest.sh create mode 100644 samples/diag.tmpl create mode 100755 tests/diag.sh create mode 100644 windows/msvc/bufr_filter/bufr_filter.vcproj create mode 100755 windows/msvc/bufr_filter/bufr_filter.vcxproj create mode 100755 windows/msvc/bufr_filter/bufr_filter.vcxproj.filters diff --git a/definitions/boot.def b/definitions/boot.def index 15ff30351..83ea9f2ee 100644 --- a/definitions/boot.def +++ b/definitions/boot.def @@ -64,10 +64,14 @@ if(kindOfProduct == `GRIB`){ template GRIB "grib[GRIBEditionNumber:l]/boot.def" ; } -if(kindOfProduct == `BUDG`){ +if(kindOfProduct == `BUDG` ){ template BUDG "budg/boot.def" ; } +if(kindOfProduct == `DIAG`){ + template DIAG "diag/boot.def" ; +} + if(kindOfProduct == `TIDE`){ template TIDE "tide/boot.def" ; } diff --git a/definitions/diag/boot.def b/definitions/diag/boot.def new file mode 100644 index 000000000..a4b3f4eb0 --- /dev/null +++ b/definitions/diag/boot.def @@ -0,0 +1,14 @@ +## Copyright 2005-2019 ECMWF. + +position startOfHeaders; +ascii[4] identifier; + +alias ls.identifier=identifier; +transient missingValue = 9999; +constant ieeeFloats = 0: edition_specific; +constant zero=0:hidden; + +template section1 "diag/section.1.def"; +template section4 "diag/section.4.def"; +ascii[4] endMark; +position totalLength; diff --git a/definitions/diag/section.1.def b/definitions/diag/section.1.def new file mode 100644 index 000000000..1fd931c43 --- /dev/null +++ b/definitions/diag/section.1.def @@ -0,0 +1,79 @@ +# Copyright 2005-2019 ECMWF. + +section_length[3] section1Length ; + +unsigned[1] gribTablesVersionNo ; +codetable[1] centre 'common/c-1.table' : string_type; + +alias ls.centre=centre; +alias identificationOfOriginatingGeneratingCentre=centre; + +unsigned[1] generatingProcessIdentifier ; + +unsigned[1] gridDefinition ; + +flags[1] flag 'grib1/1.table'; + +codetable[1] indicatorOfParameter 'grib1/2.[centre:l].[gribTablesVersionNo:l].table'; + +codetable[1] indicatorOfTypeOfLevel 'grib1/3.table'; +codetable[2] heightPressureEtcOfLevels 'grib1/3.table'; +alias ls.levelType=indicatorOfTypeOfLevel; + +unsigned[1] yearOfCentury ; +unsigned[1] month ; +unsigned[1] day; +unsigned[1] hour ; +unsigned[1] minute ; + +transient second = 0; +meta dataDate budgdate(yearOfCentury,month,day); +alias ls.date=dataDate; +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 +codetable[1] indicatorOfUnitOfTimeRange 'grib1/4.table'; + +# P1 - Period of time (number of time units) +unsigned[1] periodOfTime ; +alias P1 = periodOfTime ; + +# P2 - Period of time +unsigned[1] periodOfTimeIntervals ; +alias P2 = periodOfTimeIntervals ; + +codetable[1] timeRangeIndicator 'grib1/5.table'; + +codetable[1] stepUnits 'grib2/tables/1/4.4.table' = 1 : transient,dump,no_copy; + +concept stepType { + "instant" = {timeRangeIndicator=1;} + "instant" = {timeRangeIndicator=10;} + "instant" = {timeRangeIndicator=0;} + "avg" = {timeRangeIndicator=3;} + "accum" = {timeRangeIndicator=4;} + "max" = {timeRangeIndicator=2;} + "min" = {timeRangeIndicator=2;} + "diff" = {timeRangeIndicator=5;} + "rms" = {timeRangeIndicator=2;} + "sd" = {timeRangeIndicator=2;} + "cov" = {timeRangeIndicator=2;} + "ratio" = {timeRangeIndicator=2;} +} + +meta ls.stepRange g1step_range(P1,P2,timeRangeIndicator,indicatorOfUnitOfTimeRange,stepUnits,stepType) : dump; +meta startStep long_vector(stepRange,0) : dump; +meta endStep long_vector(stepRange,1) : dump; + +# Set stepUnits to 1 to get step range in hours +meta stepRangeInHours g1step_range(P1,P2,timeRangeIndicator,indicatorOfUnitOfTimeRange,one,stepType); +meta startStepInHours long_vector(stepRangeInHours,0) : dump; +meta endStepInHours long_vector(stepRangeInHours,1) : dump; + +constant paramId = 0; +alias parameter = paramId; +alias ls.parameter=parameter; + +section_padding section1Padding : read_only; diff --git a/definitions/diag/section.4.def b/definitions/diag/section.4.def new file mode 100644 index 000000000..63b1dd5d1 --- /dev/null +++ b/definitions/diag/section.4.def @@ -0,0 +1,41 @@ +# Copyright 2005-2019 ECMWF. + +section_length[3] section4Length ; + +unsigned[1] reserved1=0 : hidden; +flags[1] missingDataFlag 'grib1/1.table'; +unsigned[1] numberOfBytesPerInteger=4; + +unsigned[2] reserved=0 : hidden ; + +unsigned[3] numberOfCharacters : dump; +alias numberOfChars=numberOfCharacters ; + +unsigned[3] numberOfFloats : dump; + +unsigned[3] numberOfIntegers=0 : dump; +alias numberOfInts=numberOfIntegers ; + +unsigned[3] numberOfLogicals ; +unsigned[3] numberOfReservedBytes ; +unsigned[4] reserved=0 : hidden; +unsigned[4] reserved=0 : hidden; +unsigned[1] reserved=0 : hidden; + +ibmfloat floatValues[numberOfFloats] : dump; +alias floatVal=floatValues; + +if (numberOfIntegers) { + signed[4] integerValues[numberOfIntegers] : dump; +} + +# Have to use integers to represent single char strings +if (numberOfCharacters) { + unsigned[1] charValues[numberOfCharacters] : dump, string_type; +} +#charList list(numberOfCharacters) { +# ascii[1] charValues : dump; +#} + +# Final padding +section_padding padding; diff --git a/examples/C/grib_nearest.sh b/examples/C/grib_nearest.sh deleted file mode 100755 index bf825216d..000000000 --- a/examples/C/grib_nearest.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh -# 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. -# - -. ./include.sh - -label="grib_nearest" -temp=$label.temp -tempRef=$label.ref -input_grb=${data_dir}/reduced_gaussian_pressure_level.grib1 - -# Nearest with decoding the data values -# -------------------------------------- -${examples_dir}/c_grib_nearest $input_grb > $temp -cat > $tempRef < $temp -cat > $tempRef <AVXBspZkbgPrw5q%G_sRjPbKJ}sY@OH#w300U>P zE??u3G~|Bny06{uH*Y$*{(SuWsRQfk!`gN4MSa(GZ#&auxn2E_Z~yu)zrJI6!0&mt z`#U9G`WGIThusc*S;mx!OW>1pIyXI?T~CA?TdeTO8Hoa)rfcEbveRq2o&t-Gz&mV8RdS!-T7`2~kW%RSL_U|nE67o=BizQw{EbaK|X~;zR0;e-7I?u~U_Zh?O zbrxj~+?Ru_=w6so)xqu&-4^N@#*6!xGKV z%pTbNHoN&TyIE}Z#%qb3ZGqV*;zv9>G9&mJ_+fu@{b7&Oym^?OoL~1X_H}=By)S~6 z^H7>zrl#k>)7WTm~8z|Vn?fm44Ot3Mrjs=OaYsi1l8nR4Yz%BR4xE9!y% zSb3V046k|`vrJ~p=SyW?w`WB5bG0)w;VjWQoW)~&Q@?NtdRd!Jx>e@4Z8Ns*F_r;q zPTd{Jk2C4Dl((E;}4@7vZ@~bQ PlyiD2<7wvO?kBGQe1t|H literal 0 HcmV?d00001 diff --git a/src/grib_bits_any_endian.c b/src/grib_bits_any_endian.c index 5ec1ff973..8e5c31c01 100644 --- a/src/grib_bits_any_endian.c +++ b/src/grib_bits_any_endian.c @@ -391,10 +391,12 @@ int grib_encode_unsigned_longb(unsigned char* p, unsigned long val ,long *bitp, return GRIB_SUCCESS; } -/// +/* + * Note: On x64 Micrsoft Windows a "long" is 32 bits but "size_t" is 64 bits + */ int grib_encode_size_tb(unsigned char* p, size_t val ,long *bitp, long nb) { - long i = 0; + long i = 0; if (nb > max_nbits_size_t) { fprintf(stderr, "Number of bits (%ld) exceeds maximum number of bits (%d)\n", nb, max_nbits_size_t); @@ -417,7 +419,6 @@ int grib_encode_size_tb(unsigned char* p, size_t val ,long *bitp, long nb) } return GRIB_SUCCESS; } -/// #if OMP_PACKING #include "grib_bits_any_endian_omp.c" diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 0f21ce5b5..ba6a908ee 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -66,6 +66,7 @@ list( APPEND tests_no_data_reqd bufr_rdbSubTypes grib_efas grib_sh_imag + diag ) # These tests do require data downloads list( APPEND tests_data_reqd diff --git a/tests/diag.sh b/tests/diag.sh new file mode 100755 index 000000000..76b06371a --- /dev/null +++ b/tests/diag.sh @@ -0,0 +1,80 @@ +#!/bin/sh +# 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. +# + +# Tests for Pseudo-GRIB format "DIAG" + +. ./include.sh +label="pseudo-diag-test" +tempOut=temp.${label}.out +tempTxt=temp.${label}.txt +tempRef=temp.${label}.ref + +REDIRECT=/dev/null + +sample=$ECCODES_SAMPLES_PATH/diag.tmpl + +# Basic grib commands should not fail +# ------------------------------------ +${tools_dir}/grib_ls $sample > $REDIRECT +${tools_dir}/grib_dump $sample > $REDIRECT + +# Check setting keys +# ------------------- +echo 'set numberOfIntegers=3; set integerValues={55, 44, 66}; write;' | ${tools_dir}/grib_filter -o $tempOut - $sample +${tools_dir}/grib_dump -p numberOfFloats,numberOfIntegers,floatValues,integerValues $tempOut | sed 1d > $tempTxt +cat > $tempRef < $tempTxt +cat > $tempRef < $tempTxt +cat > $tempRef </dev/null 2>&1; then + NC_DUMPER="ncdump" +fi + +# ECC-1041: One parameter with different expvers +# This has 5 messages, all 'tp'. Change the first message to have a different expver +input=${data_dir}/tp_ecmwf.grib +${tools_dir}/grib_set -w stepRange=12 -s experimentVersionNumber=0005 $input $tempGrib +${tools_dir}/grib_to_netcdf -o $tempNetcdf $tempGrib +if test "x$NC_DUMPER" != "x"; then + $NC_DUMPER -h $tempNetcdf > $tempText + grep -q "short tp_0005" $tempText + grep -q "short tp_0001" $tempText +fi + + grib_files="\ regular_latlon_surface.grib2 \ regular_latlon_surface.grib1 \ @@ -35,23 +57,22 @@ ls /bin ls /usr/bin # Go thru all the specified GRIB files and convert them to NetCDF -for dt in $ncf_types -do - for f in $grib_files - do - rm -f $tmp_netcdf +for dt in $ncf_types; do + for f in $grib_files; do + rm -f $tempNetcdf [ -f ${data_dir}/$f ] - ${tools_dir}/grib_to_netcdf -D $dt -o $tmp_netcdf ${data_dir}/$f >/dev/null - ${tools_dir}/grib_to_netcdf -T -o $tmp_netcdf ${data_dir}/$f >/dev/null + ${tools_dir}/grib_to_netcdf -D $dt -o $tempNetcdf ${data_dir}/$f >/dev/null + ${tools_dir}/grib_to_netcdf -T -o $tempNetcdf ${data_dir}/$f >/dev/null done done # Try creating different kinds; netcdf3 classic and large # TODO: enable tests for netcdf4 formats too input=${data_dir}/regular_latlon_surface.grib2 -${tools_dir}/grib_to_netcdf -k 1 -o $tmp_netcdf $input >/dev/null -${tools_dir}/grib_to_netcdf -k 2 -o $tmp_netcdf $input >/dev/null -#${tools_dir}/grib_to_netcdf -k 3 -o $tmp_netcdf $input >/dev/null -#${tools_dir}/grib_to_netcdf -k 4 -o $tmp_netcdf $input >/dev/null +${tools_dir}/grib_to_netcdf -k 1 -o $tempNetcdf $input >/dev/null +${tools_dir}/grib_to_netcdf -k 2 -o $tempNetcdf $input >/dev/null +#${tools_dir}/grib_to_netcdf -k 3 -o $tempNetcdf $input >/dev/null +#${tools_dir}/grib_to_netcdf -k 4 -o $tempNetcdf $input >/dev/null + -rm -f $tmp_netcdf +rm -f $tempNetcdf $tempGrib $tempText diff --git a/tools/grib_to_netcdf.c b/tools/grib_to_netcdf.c index 176c18782..88c9f7a3f 100644 --- a/tools/grib_to_netcdf.c +++ b/tools/grib_to_netcdf.c @@ -3573,7 +3573,8 @@ static void find_nc_attributes(const request *subset_r, const request *user_r, n if(!isalpha(att->name[0])) { char buf[1048]; - sprintf(buf,"p%s",att->name); + const char *val = get_value(subset_r, "param", 0); + sprintf(buf,"%s_%s", (val ? val : "p"), att->name); strcpy(att->name,buf); } } diff --git a/windows/msvc/bufr_filter/bufr_filter.vcproj b/windows/msvc/bufr_filter/bufr_filter.vcproj new file mode 100644 index 000000000..61a6d0608 --- /dev/null +++ b/windows/msvc/bufr_filter/bufr_filter.vcproj @@ -0,0 +1,375 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/windows/msvc/bufr_filter/bufr_filter.vcxproj b/windows/msvc/bufr_filter/bufr_filter.vcxproj new file mode 100755 index 000000000..c21304f36 --- /dev/null +++ b/windows/msvc/bufr_filter/bufr_filter.vcxproj @@ -0,0 +1,209 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {12E795DB-41D6-495E-8529-35B4FB0EDF8B} + bufr_filter + Win32Proj + 10.0.17763.0 + + + + Application + v141 + Unicode + true + + + Application + v141 + Unicode + + + Application + v141 + Unicode + true + + + Application + v141 + Unicode + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>15.0.27625.0 + + + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + + + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + + + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + + Disabled + ..\..\..\src;..\..\..\tools;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;HAVE_STRING_H;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + $(IntDir)$(ProjectName).pch + $(IntDir) + true + $(IntDir) + Level3 + EditAndContinue + + + true + $(OutDir)$(ProjectName).pdb + true + $(OutDir)$(ProjectName).map + Console + MachineX86 + + + + + X64 + + + Disabled + ..\..\..\src;..\..\..\tools;%(AdditionalIncludeDirectories) + WIN32;_WIN64;_DEBUG;_CONSOLE;HAVE_STRING_H;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + $(IntDir)$(ProjectName).pch + $(IntDir) + true + $(IntDir) + Level3 + ProgramDatabase + + + true + $(OutDir)$(ProjectName).pdb + true + $(OutDir)$(ProjectName).map + Console + MachineX64 + + + + + MaxSpeed + true + ..\..\..\src;..\..\..\tools;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;HAVE_STRING_H;%(PreprocessorDefinitions) + MultiThreadedDLL + true + + $(IntDir)$(ProjectName).pch + $(IntDir) + $(IntDir) + Level3 + ProgramDatabase + + + false + $(OutDir)$(ProjectName).pdb + true + $(OutDir)$(ProjectName).map + Console + true + true + MachineX86 + + + + + X64 + + + MaxSpeed + true + ..\..\..\src;..\..\..\tools;%(AdditionalIncludeDirectories) + WIN32;_WIN64;NDEBUG;_CONSOLE;HAVE_STRING_H;%(PreprocessorDefinitions) + MultiThreadedDLL + true + + $(IntDir)$(ProjectName).pch + $(IntDir) + $(IntDir) + Level3 + ProgramDatabase + + + false + $(OutDir)$(ProjectName).pdb + true + $(OutDir)$(ProjectName).map + Console + true + true + MachineX64 + + + + + + + + {3de8b13f-7dfe-48ed-9158-b34d774500ec} + false + + + + + + \ No newline at end of file diff --git a/windows/msvc/bufr_filter/bufr_filter.vcxproj.filters b/windows/msvc/bufr_filter/bufr_filter.vcxproj.filters new file mode 100755 index 000000000..d42250fcb --- /dev/null +++ b/windows/msvc/bufr_filter/bufr_filter.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Source Files + + + diff --git a/windows/msvc/grib_api.sln b/windows/msvc/grib_api.sln index 17b1a109e..035e03ddc 100644 --- a/windows/msvc/grib_api.sln +++ b/windows/msvc/grib_api.sln @@ -23,6 +23,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grib_set", "grib_set\grib_s EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bufr_dump", "bufr_dump\bufr_dump.vcxproj", "{A785A1F1-2AE8-4CD8-B484-9035D1961D42}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bufr_filter", "bufr_filter\bufr_filter.vcxproj", "{12E795DB-41D6-495E-8529-35B4FB0EDF8B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -111,6 +113,14 @@ Global {A785A1F1-2AE8-4CD8-B484-9035D1961D42}.Release|Win32.Build.0 = Release|Win32 {A785A1F1-2AE8-4CD8-B484-9035D1961D42}.Release|x64.ActiveCfg = Release|x64 {A785A1F1-2AE8-4CD8-B484-9035D1961D42}.Release|x64.Build.0 = Release|x64 + {12E795DB-41D6-495E-8529-35B4FB0EDF8B}.Debug|Win32.ActiveCfg = Debug|Win32 + {12E795DB-41D6-495E-8529-35B4FB0EDF8B}.Debug|Win32.Build.0 = Debug|Win32 + {12E795DB-41D6-495E-8529-35B4FB0EDF8B}.Debug|x64.ActiveCfg = Debug|x64 + {12E795DB-41D6-495E-8529-35B4FB0EDF8B}.Debug|x64.Build.0 = Debug|x64 + {12E795DB-41D6-495E-8529-35B4FB0EDF8B}.Release|Win32.ActiveCfg = Release|Win32 + {12E795DB-41D6-495E-8529-35B4FB0EDF8B}.Release|Win32.Build.0 = Release|Win32 + {12E795DB-41D6-495E-8529-35B4FB0EDF8B}.Release|x64.ActiveCfg = Release|x64 + {12E795DB-41D6-495E-8529-35B4FB0EDF8B}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From 3e95ed7b99d41f70938aace7d45a4c0cec7f4107 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 19 Dec 2019 17:44:47 +0000 Subject: [PATCH 27/82] ECC-1045: GRIB1: Local definition 5: Allow lowerThreshold and upperThreshold to be MISSING --- definitions/grib1/local.98.5.def | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/definitions/grib1/local.98.5.def b/definitions/grib1/local.98.5.def index c3139e8ef..e51fb8c04 100644 --- a/definitions/grib1/local.98.5.def +++ b/definitions/grib1/local.98.5.def @@ -13,20 +13,19 @@ _if (timeRangeIndicator==3 || timeRangeIndicator==4 alias productDefinitionTemplateNumber=probPoint; } - template mars_labeling "grib1/mars_labeling.def"; -unsigned[1] forecastProbabilityNumber : dump ; +unsigned[1] forecastProbabilityNumber : dump; -unsigned[1] totalNumberOfForecastProbabilities : dump; +unsigned[1] totalNumberOfForecastProbabilities : dump; -signed[1] localDecimalScaleFactor : dump ; +signed[1] localDecimalScaleFactor : dump; -unsigned[1] thresholdIndicator : dump ; +unsigned[1] thresholdIndicator : dump; -signed[2] lowerThreshold : dump ; +signed[2] lowerThreshold : can_be_missing,dump; -signed[2] upperThreshold : dump; +signed[2] upperThreshold : can_be_missing,dump; # 1 to 2 conversion _if (thresholdIndicator == 1) { @@ -56,7 +55,6 @@ _if (thresholdIndicator == 3) { transient scaledValueOfUpperLimit=upperThreshold; } - # spareSetToZero pad padding_loc5_1(1); alias number = forecastProbabilityNumber; From c6a804bd2cf94b7238e0b0dc57d1dbc6698f3740 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 23 Dec 2019 13:17:54 +0000 Subject: [PATCH 28/82] Windows: BUFR encoding (no need to #define 'round') --- src/grib_accessor_class_bufr_data_array.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/grib_accessor_class_bufr_data_array.c b/src/grib_accessor_class_bufr_data_array.c index 85f0c4049..8f1eea64d 100644 --- a/src/grib_accessor_class_bufr_data_array.c +++ b/src/grib_accessor_class_bufr_data_array.c @@ -236,10 +236,6 @@ static void init_class(grib_accessor_class* c) #define OVERRIDDEN_REFERENCE_VALUES_KEY "inputOverriddenReferenceValues" -#ifdef ECCODES_ON_WINDOWS -#define round(a) ( (a) >=0 ? ((a)+0.5) : ((a)-0.5) ) -#endif - /* Set the error code, if it is bad and we should fail (default case), return */ /* variable 'err' is assumed to be pointer to int */ /* If BUFRDC mode is enabled, then we tolerate problems like wrong data section length */ From 884aea3229a2ac465d15f003b5988c821c36b372 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 23 Dec 2019 13:22:08 +0000 Subject: [PATCH 29/82] Resolve tests/grib_to_netcdf.sh conflict --- tests/grib_to_netcdf.sh | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/tests/grib_to_netcdf.sh b/tests/grib_to_netcdf.sh index 68ecb3296..617ac9f75 100755 --- a/tests/grib_to_netcdf.sh +++ b/tests/grib_to_netcdf.sh @@ -3,7 +3,7 @@ # # 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. @@ -12,7 +12,7 @@ # Disable if autotools being used src_config=${src_dir}/config.h if [ -f ${src_config} ]; then - exit 0 + exit 0 fi label="grib_to_netcdf_test" @@ -48,22 +48,14 @@ grib_files="\ ncf_types="NC_SHORT NC_INT NC_FLOAT NC_DOUBLE" -tmp_netcdf=tmp.ncf - -# debug -echo $PATH -env -ls /bin -ls /usr/bin - # Go thru all the specified GRIB files and convert them to NetCDF for dt in $ncf_types; do for f in $grib_files; do rm -f $tempNetcdf - [ -f ${data_dir}/$f ] + [ -f ${data_dir}/$f ] ${tools_dir}/grib_to_netcdf -D $dt -o $tempNetcdf ${data_dir}/$f >/dev/null ${tools_dir}/grib_to_netcdf -T -o $tempNetcdf ${data_dir}/$f >/dev/null - done + done done # Try creating different kinds; netcdf3 classic and large From b5dd3c7266e094ac2db02088344ec56e98323363 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 23 Dec 2019 13:57:08 +0000 Subject: [PATCH 30/82] Windows: re-enable tests --- tests/bufr_dump_encode_filter.sh | 6 +++--- tests/grib_lam_bf.sh | 4 ---- tests/grib_optimize_scaling.sh | 5 ----- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/tests/bufr_dump_encode_filter.sh b/tests/bufr_dump_encode_filter.sh index b6db7e5e0..44571bc57 100755 --- a/tests/bufr_dump_encode_filter.sh +++ b/tests/bufr_dump_encode_filter.sh @@ -48,9 +48,9 @@ files=`cat ${data_dir}/bufr/bufr_data_files.txt` exclude="ias1_240.bufr syno_multi.bufr tropical_cyclone.bufr aeolus_wmo_26.bufr israel_observations_2017041010.bufr " cmp_options="" -if [ $ECCODES_ON_WINDOWS -eq 1 ]; then - cmp_options="-R all=1e-7" -fi +#if [ $ECCODES_ON_WINDOWS -eq 1 ]; then +# cmp_options="-R all=1e-7" +#fi for f in $files do diff --git a/tests/grib_lam_bf.sh b/tests/grib_lam_bf.sh index 077e0220f..59b1ec187 100755 --- a/tests/grib_lam_bf.sh +++ b/tests/grib_lam_bf.sh @@ -13,10 +13,6 @@ label="grib_lam_bf" temp=temp.$label.txt -if [ $ECCODES_ON_WINDOWS -eq 1 ]; then - echo "$0: This test is currently disabled on Windows" - exit 0 -fi dump_and_check() { diff --git a/tests/grib_optimize_scaling.sh b/tests/grib_optimize_scaling.sh index ac0d38425..d7a956d5a 100755 --- a/tests/grib_optimize_scaling.sh +++ b/tests/grib_optimize_scaling.sh @@ -10,9 +10,4 @@ . ./include.sh -if [ $ECCODES_ON_WINDOWS -eq 1 ]; then - echo "$0: This test is currently disabled on Windows" - exit 0 -fi - exec $test_dir/grib_optimize_scaling From fd95cefee35bd0db61738f67b462896dd19e0342 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 23 Dec 2019 18:12:48 +0000 Subject: [PATCH 31/82] ECC-1045: add test --- tests/bufr_filter.sh | 1 + tests/grib_local.sh | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/tests/bufr_filter.sh b/tests/bufr_filter.sh index 46166ab81..40ad99af6 100755 --- a/tests/bufr_filter.sh +++ b/tests/bufr_filter.sh @@ -418,6 +418,7 @@ rm -f ${f}.ref ${f}.log #rm -f new_*bufr #rm -f $testScript $testScript1 + #----------------------------------------------------------- # Test: packing #----------------------------------------------------------- diff --git a/tests/grib_local.sh b/tests/grib_local.sh index 19385b9e6..b573ffc56 100755 --- a/tests/grib_local.sh +++ b/tests/grib_local.sh @@ -109,6 +109,11 @@ grib_check_key_equals $temp.3 edition,productDefinitionTemplateNumber "2 5" grib_check_key_equals $temp.3 forecastProbabilityNumber,totalNumberOfForecastProbabilities "2 25" grib_check_key_equals $temp.3 probabilityType,scaledValueOfLowerLimit,scaledValueOfUpperLimit "2 54 56" +# ECC-1045 +${tools_dir}/grib_set -s localDefinitionNumber=5,lowerThreshold=missing,upperThreshold=missing \ + $sample_g1 $temp.1 +grib_check_key_equals $temp.1 'lowerThreshold,upperThreshold' 'MISSING MISSING' + # Local Definition 42 for GRIB2 (LC-WFV) # --------------------------------------- From 11f3725f69b36382affc8254d6cabe6ecb829389 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 24 Dec 2019 20:00:48 +0000 Subject: [PATCH 32/82] Windows: BUFR encoding (eccodes_t_bufr_dump_encode_filter) --- src/grib_accessor_class_bits.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/grib_accessor_class_bits.c b/src/grib_accessor_class_bits.c index 686e785c8..de71a4e19 100644 --- a/src/grib_accessor_class_bits.c +++ b/src/grib_accessor_class_bits.c @@ -150,10 +150,6 @@ static void init_class(grib_accessor_class* c) /* END_CLASS_IMP */ -#ifdef ECCODES_ON_WINDOWS -#define round(a) ( (a) >=0 ? ((a)+0.5) : ((a)-0.5) ) -#endif - static void init(grib_accessor* a,const long l, grib_arguments* c) { grib_accessor_bits* self = (grib_accessor_bits*)a; From 63695e21629dd6b85577468151602c02b186daa3 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 24 Dec 2019 20:34:33 +0000 Subject: [PATCH 33/82] Tests: Print out norm on failure --- tests/grib_lam_bf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/grib_lam_bf.c b/tests/grib_lam_bf.c index 73c493836..6a9f5cf93 100644 --- a/tests/grib_lam_bf.c +++ b/tests/grib_lam_bf.c @@ -804,7 +804,7 @@ int main (int argc, char *argv[]) free (vals); if (norm > 0.0001) { - fprintf (stderr, "Error too large !\n"); + fprintf (stderr, "Error too large! norm=%g\n", norm); return 1; } fclose (fp); From dad45e7ecd8ca39d865968c42a184cecffee3040 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 27 Dec 2019 11:41:34 +0000 Subject: [PATCH 34/82] Tools: check if input paths are directories --- src/codes_util.c | 13 +++++++++++++ src/grib_accessor_class_data_ccsds_packing.c | 2 +- src/grib_accessor_class_data_png_packing.c | 2 +- src/grib_api_prototypes.h | 1 + tools/bufr_compare.c | 7 ++++--- tools/bufr_split_by_rdbSubtype.c | 9 +++------ tools/codes_count.c | 14 +------------- tools/codes_split_file.c | 9 +++------ tools/grib_compare.c | 4 +--- tools/grib_tools.c | 10 +++------- tools/gts_compare.c | 4 +--- tools/metar_compare.c | 4 +--- 12 files changed, 33 insertions(+), 46 deletions(-) diff --git a/src/codes_util.c b/src/codes_util.c index 7667954d5..bc3271dcd 100644 --- a/src/codes_util.c +++ b/src/codes_util.c @@ -43,6 +43,19 @@ char get_dir_separator_char(void) return DIR_SEPARATOR_CHAR; } +/* Return 1 if the filepath is a directory, 0 otherwise */ +int path_is_directory(const char* filename) +{ + struct stat s; + int stat_val = stat(filename, &s); + if ( stat_val == 0 ) { + if (S_ISDIR(s.st_mode)) { + return 1; + } + } + return 0; +} + char* codes_getenv(const char* name) { /* Look for the new ecCodes environment variable names */ diff --git a/src/grib_accessor_class_data_ccsds_packing.c b/src/grib_accessor_class_data_ccsds_packing.c index 6fcb8925b..dcaa5a4ba 100644 --- a/src/grib_accessor_class_data_ccsds_packing.c +++ b/src/grib_accessor_class_data_ccsds_packing.c @@ -312,7 +312,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) int err = GRIB_SUCCESS; int i; - size_t buflen = grib_byte_count(a); + size_t buflen = 0; unsigned char* buf = NULL; unsigned char* encoded = NULL; diff --git a/src/grib_accessor_class_data_png_packing.c b/src/grib_accessor_class_data_png_packing.c index 6c9a01e6a..63d5e9656 100644 --- a/src/grib_accessor_class_data_png_packing.c +++ b/src/grib_accessor_class_data_png_packing.c @@ -374,7 +374,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) int err = GRIB_SUCCESS; int i,j; - size_t buflen = grib_byte_count(a); + size_t buflen = 0; unsigned char* buf = NULL; unsigned char* encoded = NULL; diff --git a/src/grib_api_prototypes.h b/src/grib_api_prototypes.h index 80fb72392..5aba681d0 100644 --- a/src/grib_api_prototypes.h +++ b/src/grib_api_prototypes.h @@ -1464,6 +1464,7 @@ grib_expression *grib_arguments_get_expression(grib_handle *h, grib_arguments *a /* codes_util.c */ char get_dir_separator_char(void); +int path_is_directory(const char* filename); char *codes_getenv(const char *name); /* grib_util.c */ diff --git a/tools/bufr_compare.c b/tools/bufr_compare.c index 87b8054fc..302277ae1 100644 --- a/tools/bufr_compare.c +++ b/tools/bufr_compare.c @@ -301,6 +301,9 @@ int grib_tool_init(grib_runtime_options* options) context->blacklist=blacklist; } + /* Check 1st file is not a directory */ + exit_if_input_is_directory(grib_tool_name, options->infile_extra->name); + if (grib_options_on("r")) { char* filename[1]; filename[0]=options->infile_extra->name; @@ -369,11 +372,9 @@ int grib_tool_init(grib_runtime_options* options) { /* Check for 2nd file being a directory. If so, we assume user is comparing to a file */ /* with the same name as first file in that directory */ - struct stat s; grib_tools_file* infile = options->infile; /* the 2nd file in comparison */ if (infile) { - int stat_val = stat(infile->name, &s); - if ( stat_val == 0 && S_ISDIR(s.st_mode)) { + if (path_is_directory(infile->name)) { /* Take the filename of the 1st file and append to dir */ char bufr[2048] = {0,}; /* options->infile_extra->name is the 1st file */ diff --git a/tools/bufr_split_by_rdbSubtype.c b/tools/bufr_split_by_rdbSubtype.c index 6e3dbfee3..0f49f15c0 100644 --- a/tools/bufr_split_by_rdbSubtype.c +++ b/tools/bufr_split_by_rdbSubtype.c @@ -162,7 +162,6 @@ int main(int argc,char* argv[]) FILE* infh = NULL; char* filename; int i, status=0; - struct stat s; int err=0; unsigned long count=0; @@ -176,11 +175,9 @@ int main(int argc,char* argv[]) } filename=argv[i]; - if (stat(filename, &s)==0) { - if (S_ISDIR(s.st_mode)) { - fprintf(stderr, "ERROR: %s: Is a directory\n", filename); - return 1; - } + if (path_is_directory(filename)) { + fprintf(stderr, "ERROR: %s: Is a directory\n", filename); + return 1; } infh=fopen(filename,"rb"); if (!infh) { diff --git a/tools/codes_count.c b/tools/codes_count.c index 87bfa232f..bde85af3c 100644 --- a/tools/codes_count.c +++ b/tools/codes_count.c @@ -66,18 +66,6 @@ static int count_messages(FILE* in, int message_type, unsigned long *count) return err; } -static int is_a_directory(const char* filename) -{ - struct stat s; - int stat_val = stat(filename, &s); - if ( stat_val == 0 ) { - if (S_ISDIR(s.st_mode)) { - return 1; - } - } - return 0; -} - int main(int argc,char* argv[]) { FILE* infh = NULL; @@ -105,7 +93,7 @@ int main(int argc,char* argv[]) continue; } filename=argv[i]; - if (is_a_directory(filename)) { + if (path_is_directory(filename)) { fprintf(stderr, "%s: ERROR: \"%s\": Is a directory\n", tool_name, filename); continue; } diff --git a/tools/codes_split_file.c b/tools/codes_split_file.c index 00166bf56..3248861ab 100644 --- a/tools/codes_split_file.c +++ b/tools/codes_split_file.c @@ -111,7 +111,6 @@ int main(int argc,char* argv[]) FILE* infh = NULL; char* filename; int i, status=0; - struct stat s; int err=0,nchunks=0; unsigned long count=0; @@ -133,11 +132,9 @@ int main(int argc,char* argv[]) i++; filename=argv[i]; - if (stat(filename, &s)==0) { - if (S_ISDIR(s.st_mode)) { - fprintf(stderr, "ERROR: %s: Is a directory\n", filename); - return 1; - } + if (path_is_directory(filename)) { + fprintf(stderr, "ERROR: %s: Is a directory\n", filename); + return 1; } infh=fopen(filename,"rb"); if (!infh) { diff --git a/tools/grib_compare.c b/tools/grib_compare.c index 0686d7566..bd21142b4 100644 --- a/tools/grib_compare.c +++ b/tools/grib_compare.c @@ -308,11 +308,9 @@ int grib_tool_init(grib_runtime_options* options) { /* Check for 2nd file being a directory. If so, we assume user is comparing to a file */ /* with the same name as first file in that directory */ - struct stat s; grib_tools_file* infile = options->infile; /* the 2nd file in comparison */ if (infile) { - int stat_val = stat(infile->name, &s); - if ( stat_val == 0 && S_ISDIR(s.st_mode)) { + if (path_is_directory(infile->name)) { /* Take the filename of the 1st file and append to dir */ char bufr[2048] = {0,}; /* options->infile_extra->name is the 1st file */ diff --git a/tools/grib_tools.c b/tools/grib_tools.c index 61202fb68..caf97086e 100644 --- a/tools/grib_tools.c +++ b/tools/grib_tools.c @@ -1272,13 +1272,9 @@ void grib_tools_write_message(grib_runtime_options* options, grib_handle* h) } int exit_if_input_is_directory(const char* tool_name, const char* filename) { - struct stat s; - int stat_val = stat(filename, &s); - if ( stat_val == 0 ) { - if (S_ISDIR(s.st_mode)) { - fprintf(stderr, "%s: ERROR: \"%s\": Is a directory\n", tool_name, filename); - exit(1); - } + if ( path_is_directory(filename) ) { + fprintf(stderr, "%s: ERROR: \"%s\": Is a directory\n", tool_name, filename); + exit(1); } return 0; } diff --git a/tools/gts_compare.c b/tools/gts_compare.c index aa8114edc..0d3cbc429 100644 --- a/tools/gts_compare.c +++ b/tools/gts_compare.c @@ -228,11 +228,9 @@ int grib_tool_init(grib_runtime_options* options) { /* Check for 2nd file being a directory. If so, we assume user is comparing to a file */ /* with the same name as first file in that directory */ - struct stat s; grib_tools_file* infile = options->infile; /* the 2nd file in comparison */ if (infile) { - int stat_val = stat(infile->name, &s); - if ( stat_val == 0 && S_ISDIR(s.st_mode)) { + if (path_is_directory(infile->name)) { /* Take the filename of the 1st file and append to dir */ char bufr[2048] = {0,}; /* options->infile_extra->name is the 1st file */ diff --git a/tools/metar_compare.c b/tools/metar_compare.c index 296d7e603..05434deed 100644 --- a/tools/metar_compare.c +++ b/tools/metar_compare.c @@ -313,11 +313,9 @@ int grib_tool_init(grib_runtime_options* options) { /* Check for 2nd file being a directory. If so, we assume user is comparing to a file */ /* with the same name as first file in that directory */ - struct stat s; grib_tools_file* infile = options->infile; /* the 2nd file in comparison */ if (infile) { - int stat_val = stat(infile->name, &s); - if ( stat_val == 0 && S_ISDIR(s.st_mode)) { + if (path_is_directory(infile->name)) { /* Take the filename of the 1st file and append to dir */ char bufr[2048] = {0,}; /* options->infile_extra->name is the 1st file */ From 24c96fd47c0128c5acb5d235a60413054bd9b13e Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 27 Dec 2019 12:25:39 +0000 Subject: [PATCH 35/82] Windows: The 'round' function is now supported (since 2017) --- src/grib_accessor_class_bufr_extract_datetime_subsets.c | 4 ---- src/grib_accessor_class_g2grid.c | 4 ---- src/grib_util.c | 3 --- 3 files changed, 11 deletions(-) diff --git a/src/grib_accessor_class_bufr_extract_datetime_subsets.c b/src/grib_accessor_class_bufr_extract_datetime_subsets.c index d125c8c6c..496e66f25 100644 --- a/src/grib_accessor_class_bufr_extract_datetime_subsets.c +++ b/src/grib_accessor_class_bufr_extract_datetime_subsets.c @@ -133,10 +133,6 @@ static void init_class(grib_accessor_class* c) /* END_CLASS_IMP */ -#ifdef ECCODES_ON_WINDOWS -#define round(a) ( (a) >=0 ? ((a)+0.5) : ((a)-0.5) ) -#endif - static void init(grib_accessor* a, const long len , grib_arguments* arg ) { int n=0; diff --git a/src/grib_accessor_class_g2grid.c b/src/grib_accessor_class_g2grid.c index cca4bb776..279aa33f5 100644 --- a/src/grib_accessor_class_g2grid.c +++ b/src/grib_accessor_class_g2grid.c @@ -149,10 +149,6 @@ static void init_class(grib_accessor_class* c) /* END_CLASS_IMP */ -#ifdef ECCODES_ON_WINDOWS -#define round(a) ( (a) >=0 ? ((a)+0.5) : ((a)-0.5) ) -#endif - static void init(grib_accessor* a,const long l, grib_arguments* c) { grib_accessor_g2grid* self = (grib_accessor_g2grid*)a; diff --git a/src/grib_util.c b/src/grib_util.c index 6a8ed2ad3..3e015c9b9 100644 --- a/src/grib_util.c +++ b/src/grib_util.c @@ -448,9 +448,6 @@ static int angle_can_be_encoded(grib_handle* h, const double angle) return retval; } -#ifdef ECCODES_ON_WINDOWS -#define round(a) ( (a) >=0 ? ((a)+0.5) : ((a)-0.5) ) -#endif static double adjust_angle(const double angle, const RoundingPolicy policy, const double angle_subdivisions) { double result = 0; From 20c5829b3e85ae230f03930bbe951490b693990e Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 27 Dec 2019 13:10:47 +0000 Subject: [PATCH 36/82] Tests: check bufr_compare input path and cleanup --- tests/bufr_compare.sh | 32 ++++++++++++++++++++++++++------ tests/bufr_dump_encode_filter.sh | 7 +------ tests/gts_compare.sh | 2 +- tests/metar_compare.sh | 2 +- 4 files changed, 29 insertions(+), 14 deletions(-) diff --git a/tests/bufr_compare.sh b/tests/bufr_compare.sh index e77367961..63edee393 100755 --- a/tests/bufr_compare.sh +++ b/tests/bufr_compare.sh @@ -56,7 +56,7 @@ set -e # Test: comparing with and without the -b switch #---------------------------------------------------- f="syno_1.bufr" -echo "Test: comparing with and witout the -b switch" >> $fLog +echo "Test: comparing with and without the -b switch" >> $fLog echo "file: $f" >> $fLog #Alter a key in the file @@ -92,6 +92,7 @@ ${tools_dir}/bufr_compare -b dataCategory $f ${fBufrTmp}>> $fLog #---------------------------------------------------- # Change subCentre and compare #---------------------------------------------------- +echo "Test: Change subCentre and compare" >> $fLog ${tools_dir}/bufr_set -s bufrHeaderSubCentre=12 aaen_55.bufr $fBufrTmp set +e ${tools_dir}/bufr_compare aaen_55.bufr $fBufrTmp > $fLog 2>&1 @@ -100,9 +101,23 @@ set -e [ $status -eq 1 ] fgrep -q "[bufrHeaderSubCentre]: [70] != [12]" $fLog +#---------------------------------------------------- +# First argument of bufr_compare is a directory (error) +#---------------------------------------------------- +echo "Test: First argument of bufr_compare is a directory (error)" >> $fLog +temp_dir=tempdir.${label} +mkdir -p $temp_dir +set +e +${tools_dir}/bufr_compare $temp_dir aaen_55.bufr >/dev/null +status=$? +set -e +[ $status -eq 1 ] +rm -fr $temp_dir + #---------------------------------------------------- # Second argument of bufr_compare is a directory #---------------------------------------------------- +echo "Test: Second argument of bufr_compare is a directory" >> $fLog temp_dir=tempdir.${label} mkdir -p $temp_dir infile=aaen_55.bufr @@ -113,6 +128,7 @@ rm -fr $temp_dir #---------------------------------------------------- # Compare attributes #---------------------------------------------------- +echo "Test: Compare attributes" >> $fLog set +e ${tools_dir}/bufr_compare amv2_87.bufr amv3_87.bufr > $fLog 2>&1 status=$? @@ -124,8 +140,9 @@ grep -q "#1#windSpeed->percentConfidence" $fLog grep -q "#1#coldestClusterTemperature->percentConfidence" $fLog #---------------------------------------------------- -# Header only mode +# Header-only mode #---------------------------------------------------- +echo "Test: Header-only mode" >> $fLog f="syno_1.bufr" cat > $fRules <> $fLog f=$ECCODES_SAMPLES_PATH/BUFR3.tmpl # Add a local section ${tools_dir}/bufr_set -s section2Present=1 $f $fBufrTmp @@ -156,16 +174,17 @@ set -e #---------------------------------------------------- # ECC-656: using relative comparison (-R) with 'all' #---------------------------------------------------- +echo "Test: ECC-656: using relative comparison (-R) with 'all'" >> $fLog f='airc_142.bufr' echo 'set unpack=1;set airTemperature=228; set height=1.037e+04; set pack=1; write;' |\ ${tools_dir}/codes_bufr_filter -o $fBufrTmp - $f ${tools_dir}/bufr_compare -R airTemperature=0.004,height=0.001 $f $fBufrTmp ${tools_dir}/bufr_compare -R all=0.004 $f $fBufrTmp -#---------------------------------------------------- -# ECC-658: apply relative comparison (-R) to all -# ranks of a given key -#---------------------------------------------------- +#-------------------------------------------------------------------- +# ECC-658: apply relative comparison (-R) to all ranks of a given key +#-------------------------------------------------------------------- +echo "Test: ECC-658: apply relative comparison (-R) to all ranks of a given key" >> $fLog f='PraticaTemp.bufr' ${tools_dir}/codes_bufr_filter -o $fBufrTmp - $f <> $fLog diff --git a/tests/metar_compare.sh b/tests/metar_compare.sh index 3322d0d4a..fece81678 100755 --- a/tests/metar_compare.sh +++ b/tests/metar_compare.sh @@ -48,7 +48,7 @@ if [ $status -eq 0 ]; then fi #---------------------------------------------------- -# Test: comparing with and witout the -b switch +# Test: comparing with and without the -b switch #---------------------------------------------------- # ${tools_dir}/metar_compare -b GG $metar_file $fMetarTmp >> $fLog From e8af13f229590aae123093f573dda920668293a6 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 30 Dec 2019 16:37:51 +0000 Subject: [PATCH 37/82] Latest updates from develop --- CMakeLists.txt | 2 +- ...rib_accessor_class_data_g22order_packing.c | 43 +++++++++++++------ ..._accessor_class_data_g2bifourier_packing.c | 8 ++-- src/grib_util.c | 2 - tests/CMakeLists.txt | 1 + tests/bufr_ecc-604.c | 3 +- tests/bufr_ecc-765.sh | 6 --- tests/bufr_extract_headers.c | 1 + tests/grib_complex.sh | 32 ++++++++++++++ tests/grib_ecc-604-encode.c | 3 +- tests/grib_ecc-604.c | 3 +- 11 files changed, 75 insertions(+), 29 deletions(-) create mode 100755 tests/grib_complex.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index f807529be..e8641f96d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -204,7 +204,7 @@ set( HAVE_LIBOPENJPEG 0 ) if( ENABLE_JPG ) - # Note: ecbuild_add_extra_search_paths is a deprecated feature but we need it to find Jasper at ECMWF. + # Note: The function ecbuild_add_extra_search_paths is deprecated but we need it to find Jasper at ECMWF. # It modifies CMAKE_PREFIX_PATH # which can affect future package discovery if not undone by the caller. # The current CMAKE_PREFIX_PATH is backed up as _CMAKE_PREFIX_PATH diff --git a/src/grib_accessor_class_data_g22order_packing.c b/src/grib_accessor_class_data_g22order_packing.c index fc94cd0d8..f0f7aca95 100644 --- a/src/grib_accessor_class_data_g22order_packing.c +++ b/src/grib_accessor_class_data_g22order_packing.c @@ -707,21 +707,35 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) long lengthIncrementForTheGroupLengths; long trueLengthOfLastGroup; long numberOfBitsUsedForTheScaledGroupLengths; + long orderOfSpatialDifferencing; + long numberOfOctetsExtraDescriptors; long maxgrw ; long maxgrl ; + char packingType[254]={0,}; + size_t slen=254; if (*len ==0) return GRIB_NO_VALUES; - if((err = grib_get_long_internal(gh,self->bits_per_value,&bits_per_value )) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->decimal_scale_factor,&decimal_scale_factor )) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->typeOfOriginalFieldValues,&typeOfOriginalFieldValues )) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->groupSplittingMethodUsed,&groupSplittingMethodUsed )) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->missingValueManagementUsed,&missingValueManagementUsed )) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->primaryMissingValueSubstitute,&primaryMissingValueSubstitute )) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->secondaryMissingValueSubstitute,&secondaryMissingValueSubstitute )) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->numberOfBitsUsedForTheGroupWidths,&numberOfBitsUsedForTheGroupWidths )) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->numberOfBitsUsedForTheScaledGroupLengths,&numberOfBitsUsedForTheScaledGroupLengths )) != GRIB_SUCCESS) return err; + if((err = grib_get_long_internal(gh,self->bits_per_value,&bits_per_value )) != GRIB_SUCCESS) return err; + if((err = grib_get_long_internal(gh,self->decimal_scale_factor,&decimal_scale_factor )) != GRIB_SUCCESS) return err; + if((err = grib_get_long_internal(gh,self->typeOfOriginalFieldValues,&typeOfOriginalFieldValues )) != GRIB_SUCCESS) return err; + + /*if((err = grib_get_long_internal(gh,self->groupSplittingMethodUsed,&groupSplittingMethodUsed )) != GRIB_SUCCESS) return err;*/ + /* Key groupSplittingMethodUsed uses Code table 5.4 which has two entries: + * 0 Row by row splitting + * 1 General group splitting + * We only support General group splitting + */ + groupSplittingMethodUsed = 1; + + if((err = grib_get_long_internal(gh,self->missingValueManagementUsed,&missingValueManagementUsed )) != GRIB_SUCCESS) return err; + if((err = grib_get_long_internal(gh,self->primaryMissingValueSubstitute,&primaryMissingValueSubstitute )) != GRIB_SUCCESS) return err; + if((err = grib_get_long_internal(gh,self->secondaryMissingValueSubstitute,&secondaryMissingValueSubstitute )) != GRIB_SUCCESS) return err; + if((err = grib_get_long_internal(gh,self->numberOfBitsUsedForTheGroupWidths,&numberOfBitsUsedForTheGroupWidths )) != GRIB_SUCCESS) return err; + if((err = grib_get_long_internal(gh,self->numberOfBitsUsedForTheScaledGroupLengths,&numberOfBitsUsedForTheScaledGroupLengths )) != GRIB_SUCCESS) return err; + if((err = grib_get_long_internal(gh,self->orderOfSpatialDifferencing,&orderOfSpatialDifferencing)) != GRIB_SUCCESS) return err; + if((err = grib_get_long_internal(gh,self->numberOfOctetsExtraDescriptors,&numberOfOctetsExtraDescriptors)) != GRIB_SUCCESS) return err; self->dirty=1; @@ -811,8 +825,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) nv-=nvals_per_group; } - /* fprintf(stdout," %d bytes %d marked\n", (ref_p+7)/8 + (width_p+7)/8 + (length_p+7)/8 + (vals_p+7)/8,buf_size); - */ + /*fprintf(stdout,"spatial pack_double:: %ld bytes %lu marked\n", (ref_p+7)/8 + (width_p+7)/8 + (length_p+7)/8 + (vals_p+7)/8, buf_size);*/ grib_buffer_replace(a, buf,buf_size,1,1); grib_context_free (a->context,buf); @@ -841,8 +854,12 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) if((err = grib_set_long_internal(gh,self->trueLengthOfLastGroup,trueLengthOfLastGroup )) != GRIB_SUCCESS) return err; if((err = grib_set_long_internal(gh,self->numberOfBitsUsedForTheScaledGroupLengths,numberOfBitsUsedForTheScaledGroupLengths )) != GRIB_SUCCESS) return err; - if((err = grib_set_long_internal(gh,self->orderOfSpatialDifferencing,0 )) != GRIB_SUCCESS) return err; - if((err = grib_set_long_internal(gh,self->numberOfOctetsExtraDescriptors,0 )) != GRIB_SUCCESS) return err; + err = grib_get_string(gh, "packingType", packingType, &slen); + if (!err && strcmp(packingType, "grid_complex_spatial_differencing")==0) { + if((err = grib_set_long_internal(gh,self->orderOfSpatialDifferencing,0 )) != GRIB_SUCCESS) return err; + if((err = grib_set_long_internal(gh,self->numberOfOctetsExtraDescriptors,0 )) != GRIB_SUCCESS) return err; + } + /* ECC-259: Set correct number of values */ if((err = grib_set_long_internal(gh,self->numberOfValues,*len )) != GRIB_SUCCESS) return err; diff --git a/src/grib_accessor_class_data_g2bifourier_packing.c b/src/grib_accessor_class_data_g2bifourier_packing.c index a3fccd2c3..91ff4da6c 100644 --- a/src/grib_accessor_class_data_g2bifourier_packing.c +++ b/src/grib_accessor_class_data_g2bifourier_packing.c @@ -408,8 +408,8 @@ static double laplam (bif_trunc_t * bt, const double val[]) if (! insub) { - int k = i*i+j*j; - itab1[k] = 1; + const int kk = i*i+j*j; + itab1[kk] = 1; } } @@ -450,9 +450,9 @@ static double laplam (bif_trunc_t * bt, const double val[]) } else { - int m, l = itab1[i*i+j*j]; + int m, ll = itab1[i*i+j*j]; for (m = 0; m < 4; m++, isp++) - znorm[l] = MAX (znorm[l], fabs (val[isp])); + znorm[ll] = MAX (znorm[ll], fabs (val[isp])); } } diff --git a/src/grib_util.c b/src/grib_util.c index 3e015c9b9..a5b584c12 100644 --- a/src/grib_util.c +++ b/src/grib_util.c @@ -2015,8 +2015,6 @@ int grib2_select_PDTN(int is_eps, int is_instant, if (is_instant) return 0; else return 8; } - - return -1; } int is_grib_index_file(const char* filename) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index ba6a908ee..61b6d3fe8 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -71,6 +71,7 @@ list( APPEND tests_no_data_reqd # These tests do require data downloads list( APPEND tests_data_reqd bpv_limit + grib_complex grib_double_cmp grib_change_packing bufr_dump_data diff --git a/tests/bufr_ecc-604.c b/tests/bufr_ecc-604.c index cfc5951ec..f280595be 100644 --- a/tests/bufr_ecc-604.c +++ b/tests/bufr_ecc-604.c @@ -118,7 +118,7 @@ int main(int argc, char **argv) } { - pthread_t workers[NUM_THREADS]; + pthread_t* workers = malloc(NUM_THREADS * sizeof(pthread_t)); for (i = 0; i < NUM_THREADS; i++) { struct v *data = (struct v *) malloc(sizeof(struct v)); data->number = i; @@ -139,6 +139,7 @@ int main(int argc, char **argv) pthread_join(workers[i], NULL); } } + free (workers); } return 0; diff --git a/tests/bufr_ecc-765.sh b/tests/bufr_ecc-765.sh index b7352f604..c2bc081c2 100755 --- a/tests/bufr_ecc-765.sh +++ b/tests/bufr_ecc-765.sh @@ -39,7 +39,6 @@ bufr_files_zero_leaks=" aeolus_wmo_26.bufr delayed_repl_01.bufr goes16_nm.bufr - good_j2eo.bufr israel_observations_2017041010.bufr mhen_55.bufr modw_87.bufr @@ -173,10 +172,7 @@ bufr_files_known_leaks=" s4kn_165.bufr sb19_206.bufr sbu8_206.bufr - ship_11.bufr - ship_12.bufr ship_13.bufr - ship_14.bufr ship_19.bufr ship_9.bufr smin_49.bufr @@ -190,11 +186,9 @@ bufr_files_known_leaks=" ssbt_127.bufr stuk_7.bufr syno_1.bufr - syno_2.bufr syno_3.bufr syno_4.bufr syno_multi.bufr - synop.bufr temp-land-with-substituted-values.bufr temp_101.bufr temp_102.bufr diff --git a/tests/bufr_extract_headers.c b/tests/bufr_extract_headers.c index cebdc7552..2d664b92e 100644 --- a/tests/bufr_extract_headers.c +++ b/tests/bufr_extract_headers.c @@ -38,6 +38,7 @@ int main(int argc, char* argv[]) /* Mimic the behaviour of bufr_get -f -p keys for testing */ err = parse_keyval_string(NULL, keys, 0, GRIB_TYPE_UNDEFINED, requested_print_keys, &requested_print_keys_count); + assert(!err); assert(requested_print_keys_count > 0); for (i=0; i < num_messages; ++i) { int j; diff --git a/tests/grib_complex.sh b/tests/grib_complex.sh new file mode 100755 index 000000000..a67d26f70 --- /dev/null +++ b/tests/grib_complex.sh @@ -0,0 +1,32 @@ +#!/bin/sh +# 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. +# + +. ./include.sh + +REDIRECT=/dev/null +label="grib_complex" +temp=${label}".grib.tmp" +temp1=${label}".1.tmp" +temp2=${label}".2.tmp" + +files="sample.grib2" + +for file in $files; do + infile=${data_dir}/$file + ${tools_dir}/grib_set -r -s packingType=grid_complex $infile $temp + + grib_check_key_equals $temp packingType grid_complex + + ${tools_dir}/grib_get '-F%.2f' -p min,max,avg $infile > $temp1 + ${tools_dir}/grib_get '-F%.2f' -p min,max,avg $temp > $temp2 + diff $temp1 $temp2 + + rm -f $temp $temp1 $temp2 +done diff --git a/tests/grib_ecc-604-encode.c b/tests/grib_ecc-604-encode.c index ad6a4c33a..c5280ddd1 100644 --- a/tests/grib_ecc-604-encode.c +++ b/tests/grib_ecc-604-encode.c @@ -79,7 +79,7 @@ int main(int argc, char **argv) } { - pthread_t workers[NUM_THREADS]; + pthread_t* workers = malloc(NUM_THREADS * sizeof(pthread_t)); for (i = 0; i < NUM_THREADS; i++) { struct v *data = (struct v *) malloc(sizeof(struct v)); data->number = i; @@ -99,6 +99,7 @@ int main(int argc, char **argv) pthread_join(workers[i], NULL); } } + free (workers); } return 0; diff --git a/tests/grib_ecc-604.c b/tests/grib_ecc-604.c index 45dcc8d84..eb87441d2 100644 --- a/tests/grib_ecc-604.c +++ b/tests/grib_ecc-604.c @@ -127,7 +127,7 @@ int main(int argc, char **argv) } { - pthread_t workers[NUM_THREADS]; + pthread_t* workers = malloc(NUM_THREADS * sizeof(pthread_t)); for (i = 0; i < NUM_THREADS; i++) { struct v *data = (struct v *) malloc(sizeof(struct v)); data->number = i; @@ -148,6 +148,7 @@ int main(int argc, char **argv) pthread_join(workers[i], NULL); } } + free (workers); } return 0; From 77d4521caeeda79fc07fb959fd98b5c0e9f4c344 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 6 Jan 2020 12:12:11 +0000 Subject: [PATCH 38/82] Re-enable failing windows tests --- examples/C/bufr_copy_data.sh | 5 ----- tests/CMakeLists.txt | 2 +- tests/Makefile.am | 2 -- tests/bufr_ecc-197.sh | 17 ++++++++++++----- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/examples/C/bufr_copy_data.sh b/examples/C/bufr_copy_data.sh index 31dd3b5c2..959a71411 100755 --- a/examples/C/bufr_copy_data.sh +++ b/examples/C/bufr_copy_data.sh @@ -12,11 +12,6 @@ #Define a common label for all the tmp files label="bufr_copy_data_c" -if [ $ECCODES_ON_WINDOWS -eq 1 ]; then - echo "$0: This test is currently disabled on Windows" - exit 0 -fi - TEMP_BUFR=$label.out.bufr TEMP_TEXT=$label.out.txt REF=$label.compare.log.ref diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index e4e8fc4b5..61b6d3fe8 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -299,7 +299,7 @@ endif() ecbuild_add_test( TARGET eccodes_t_grib_to_netcdf TYPE SCRIPT - CONDITION HAVE_NETCDF AND ENABLE_EXTRA_TESTS AND NOT ECCODES_ON_WINDOWS + CONDITION HAVE_NETCDF AND ENABLE_EXTRA_TESTS COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_to_netcdf.sh TEST_DEPENDS eccodes_download_gribs ) diff --git a/tests/Makefile.am b/tests/Makefile.am index e6f20bc62..6649d1eb2 100755 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -43,7 +43,6 @@ TESTS = definitions.sh \ grib_compare.sh \ grib_level.sh \ index.sh \ - grib_bitmap.sh \ grib_list.sh \ grib_second_order.sh \ grib_change_scanning.sh \ @@ -61,7 +60,6 @@ TESTS = definitions.sh \ grib_ccsds.sh \ md5.sh \ grib_neg_fctime.sh \ - bufr_ecc-197.sh \ bufr_ecc-286.sh \ bufr_ecc-288.sh diff --git a/tests/bufr_ecc-197.sh b/tests/bufr_ecc-197.sh index e19fcf3d6..bfb221d81 100755 --- a/tests/bufr_ecc-197.sh +++ b/tests/bufr_ecc-197.sh @@ -18,13 +18,20 @@ label="bufr_ecc-197-test" input=${data_dir}/bufr/vos308014_v3_26.bufr -if [ ! -f $input ]; then - echo "Data file $input not available" - exit 0 -fi TEMP=${label}.temp +LOG=${label}.log + + +# Get expanded descriptors +cat > $TEMP < $LOG 2>&1 +grep -q "ECCODES ERROR.*no match for sequences=308014" $LOG + # Create a temporary directory which holds the tables etc +# This BUFR file uses masterTablesVersionNumber 26 TEMP_DIR=${label}.temp-dir.$$ rm -rf $TEMP_DIR mkdir -p $TEMP_DIR/definitions/bufr/tables/0/wmo/26 @@ -47,4 +54,4 @@ set `wc -l $TEMP` [ $1 -gt 35700 ] rm -rf $TEMP_DIR -rm -f $TEMP +rm -f $TEMP $LOG From 6a58685e76730302d3463129b44c4d926325c073 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 6 Jan 2020 12:33:27 +0000 Subject: [PATCH 39/82] Fix failing test eccodes_t_bufr_ecc-197 --- definitions/Makefile.am | 108 ++++++++++++++---- ...grib_accessor_class_expanded_descriptors.c | 35 +++--- 2 files changed, 104 insertions(+), 39 deletions(-) diff --git a/definitions/Makefile.am b/definitions/Makefile.am index 50a393265..3776a97cd 100644 --- a/definitions/Makefile.am +++ b/definitions/Makefile.am @@ -13392,6 +13392,12 @@ dist_definitionscommon_DATA = \ common/statistics_grid.def\ common/statistics_spectral.def +definitionsdiagdir = @ECCODES_DEFINITION_PATH@/diag +dist_definitionsdiag_DATA = \ + diag/boot.def\ + diag/section.1.def\ + diag/section.4.def + definitionsgrib1dir = @ECCODES_DEFINITION_PATH@/grib1 dist_definitionsgrib1_DATA = \ grib1/0.ecmf.table\ @@ -13672,6 +13678,7 @@ dist_definitionsgrib1_localConcepts_edzw_DATA = \ grib1/localConcepts/edzw/paramId.def\ grib1/localConcepts/edzw/shortName.def\ grib1/localConcepts/edzw/stepType.def\ + grib1/localConcepts/edzw/typeOfLevel.def\ grib1/localConcepts/edzw/units.def definitionsgrib1_localConcepts_efkldir = @ECCODES_DEFINITION_PATH@/grib1/localConcepts/efkl @@ -13767,6 +13774,8 @@ dist_definitionsgrib2_DATA = \ grib2/boot_multifield.def\ grib2/cfName.def\ grib2/cfVarName.def\ + grib2/crraLocalVersion.table\ + grib2/crra_suiteName.table\ grib2/dimension.0.table\ grib2/dimensionTableNumber.table\ grib2/dimensionType.table\ @@ -13785,6 +13794,7 @@ dist_definitionsgrib2_DATA = \ grib2/local.98.0.def\ grib2/local.98.1.def\ grib2/local.98.11.def\ + grib2/local.98.12.def\ grib2/local.98.14.def\ grib2/local.98.15.def\ grib2/local.98.16.def\ @@ -13808,6 +13818,7 @@ dist_definitionsgrib2_DATA = \ grib2/local.98.7.def\ grib2/local.98.9.def\ grib2/local.98.def\ + grib2/local.crra.1.def\ grib2/local.tigge.1.def\ grib2/ls.def\ grib2/ls_labeling.82.def\ @@ -13820,6 +13831,8 @@ dist_definitionsgrib2_DATA = \ grib2/parameters.def\ grib2/products_0.def\ grib2/products_1.def\ + grib2/products_10.def\ + grib2/products_11.def\ grib2/products_2.def\ grib2/products_3.def\ grib2/products_4.def\ @@ -13828,6 +13841,7 @@ dist_definitionsgrib2_DATA = \ grib2/products_7.def\ grib2/products_8.def\ grib2/products_9.def\ + grib2/products_crra.def\ grib2/products_s2s.def\ grib2/products_tigge.def\ grib2/products_uerra.def\ @@ -13952,7 +13966,15 @@ dist_definitionsgrib2_DATA = \ grib2/template.4.71.def\ grib2/template.4.72.def\ grib2/template.4.73.def\ + grib2/template.4.76.def\ + grib2/template.4.77.def\ + grib2/template.4.78.def\ + grib2/template.4.79.def\ grib2/template.4.8.def\ + grib2/template.4.80.def\ + grib2/template.4.81.def\ + grib2/template.4.82.def\ + grib2/template.4.83.def\ grib2/template.4.9.def\ grib2/template.4.91.def\ grib2/template.4.categorical.def\ @@ -13964,8 +13986,11 @@ dist_definitionsgrib2_DATA = \ grib2/template.4.parameter_aerosol.def\ grib2/template.4.parameter_aerosol_44.def\ grib2/template.4.parameter_aerosol_optical.def\ + grib2/template.4.parameter_aerosol_optical_source.def\ + grib2/template.4.parameter_aerosol_source.def\ grib2/template.4.parameter_chemical.def\ grib2/template.4.parameter_chemical_distribution.def\ + grib2/template.4.parameter_chemical_source.def\ grib2/template.4.parameter_partition.def\ grib2/template.4.parameter_postproc.def\ grib2/template.4.parameter_tile.def\ @@ -14186,7 +14211,6 @@ dist_definitionsgrib2_tables_0_DATA = \ grib2/tables/0/4.2.2.3.table\ grib2/tables/0/4.2.3.0.table\ grib2/tables/0/4.2.3.1.table\ - grib2/tables/0/4.2.table\ grib2/tables/0/4.201.table\ grib2/tables/0/4.202.table\ grib2/tables/0/4.203.table\ @@ -14226,8 +14250,7 @@ dist_definitionsgrib2_tables_0_DATA = \ grib2/tables/0/5.7.table\ grib2/tables/0/5.8.table\ grib2/tables/0/5.9.table\ - grib2/tables/0/6.0.table\ - grib2/tables/0/stepType.table + grib2/tables/0/6.0.table definitionsgrib2_tables_1dir = @ECCODES_DEFINITION_PATH@/grib2/tables/1 dist_definitionsgrib2_tables_1_DATA = \ @@ -14293,7 +14316,6 @@ dist_definitionsgrib2_tables_1_DATA = \ grib2/tables/1/4.2.2.3.table\ grib2/tables/1/4.2.3.0.table\ grib2/tables/1/4.2.3.1.table\ - grib2/tables/1/4.2.table\ grib2/tables/1/4.201.table\ grib2/tables/1/4.202.table\ grib2/tables/1/4.203.table\ @@ -14333,8 +14355,7 @@ dist_definitionsgrib2_tables_1_DATA = \ grib2/tables/1/5.7.table\ grib2/tables/1/5.8.table\ grib2/tables/1/5.9.table\ - grib2/tables/1/6.0.table\ - grib2/tables/1/stepType.table + grib2/tables/1/6.0.table definitionsgrib2_tables_10dir = @ECCODES_DEFINITION_PATH@/grib2/tables/10 dist_definitionsgrib2_tables_10_DATA = \ @@ -14406,7 +14427,6 @@ dist_definitionsgrib2_tables_10_DATA = \ grib2/tables/10/4.2.2.4.table\ grib2/tables/10/4.2.3.0.table\ grib2/tables/10/4.2.3.1.table\ - grib2/tables/10/4.2.table\ grib2/tables/10/4.201.table\ grib2/tables/10/4.202.table\ grib2/tables/10/4.203.table\ @@ -15674,7 +15694,6 @@ dist_definitionsgrib2_tables_2_DATA = \ grib2/tables/2/4.2.2.3.table\ grib2/tables/2/4.2.3.0.table\ grib2/tables/2/4.2.3.1.table\ - grib2/tables/2/4.2.table\ grib2/tables/2/4.201.table\ grib2/tables/2/4.202.table\ grib2/tables/2/4.203.table\ @@ -15714,8 +15733,7 @@ dist_definitionsgrib2_tables_2_DATA = \ grib2/tables/2/5.7.table\ grib2/tables/2/5.8.table\ grib2/tables/2/5.9.table\ - grib2/tables/2/6.0.table\ - grib2/tables/2/stepType.table + grib2/tables/2/6.0.table definitionsgrib2_tables_20dir = @ECCODES_DEFINITION_PATH@/grib2/tables/20 dist_definitionsgrib2_tables_20_DATA = \ @@ -15956,6 +15974,7 @@ dist_definitionsgrib2_tables_21_DATA = \ grib2/tables/21/4.233.table\ grib2/tables/21/4.234.table\ grib2/tables/21/4.236.table\ + grib2/tables/21/4.238.table\ grib2/tables/21/4.240.table\ grib2/tables/21/4.241.table\ grib2/tables/21/4.242.table\ @@ -16047,7 +16066,6 @@ dist_definitionsgrib2_tables_3_DATA = \ grib2/tables/3/4.2.2.3.table\ grib2/tables/3/4.2.3.0.table\ grib2/tables/3/4.2.3.1.table\ - grib2/tables/3/4.2.table\ grib2/tables/3/4.201.table\ grib2/tables/3/4.202.table\ grib2/tables/3/4.203.table\ @@ -16412,7 +16430,6 @@ dist_definitionsgrib2_tables_4_DATA = \ grib2/tables/4/4.2.2.3.table\ grib2/tables/4/4.2.3.0.table\ grib2/tables/4/4.2.3.1.table\ - grib2/tables/4/4.2.table\ grib2/tables/4/4.201.table\ grib2/tables/4/4.202.table\ grib2/tables/4/4.203.table\ @@ -16779,7 +16796,6 @@ dist_definitionsgrib2_tables_5_DATA = \ grib2/tables/5/4.2.2.3.table\ grib2/tables/5/4.2.3.0.table\ grib2/tables/5/4.2.3.1.table\ - grib2/tables/5/4.2.table\ grib2/tables/5/4.201.table\ grib2/tables/5/4.202.table\ grib2/tables/5/4.203.table\ @@ -17152,7 +17168,6 @@ dist_definitionsgrib2_tables_6_DATA = \ grib2/tables/6/4.2.2.4.table\ grib2/tables/6/4.2.3.0.table\ grib2/tables/6/4.2.3.1.table\ - grib2/tables/6/4.2.table\ grib2/tables/6/4.201.table\ grib2/tables/6/4.202.table\ grib2/tables/6/4.203.table\ @@ -17525,7 +17540,6 @@ dist_definitionsgrib2_tables_7_DATA = \ grib2/tables/7/4.2.2.4.table\ grib2/tables/7/4.2.3.0.table\ grib2/tables/7/4.2.3.1.table\ - grib2/tables/7/4.2.table\ grib2/tables/7/4.201.table\ grib2/tables/7/4.202.table\ grib2/tables/7/4.203.table\ @@ -17900,7 +17914,6 @@ dist_definitionsgrib2_tables_8_DATA = \ grib2/tables/8/4.2.2.4.table\ grib2/tables/8/4.2.3.0.table\ grib2/tables/8/4.2.3.1.table\ - grib2/tables/8/4.2.table\ grib2/tables/8/4.201.table\ grib2/tables/8/4.202.table\ grib2/tables/8/4.203.table\ @@ -18276,7 +18289,6 @@ dist_definitionsgrib2_tables_9_DATA = \ grib2/tables/9/4.2.2.4.table\ grib2/tables/9/4.2.3.0.table\ grib2/tables/9/4.2.3.1.table\ - grib2/tables/9/4.2.table\ grib2/tables/9/4.201.table\ grib2/tables/9/4.202.table\ grib2/tables/9/4.203.table\ @@ -18331,6 +18343,7 @@ dist_definitionsgrib2_tables_9_DATA = \ definitionsgrib2_tables_local_ecmfdir = @ECCODES_DEFINITION_PATH@/grib2/tables/local/ecmf dist_definitionsgrib2_tables_local_ecmf_DATA = \ + grib2/tables/local/ecmf/1.1.table\ grib2/tables/local/ecmf/obstat.1.0.table\ grib2/tables/local/ecmf/obstat.10.0.table\ grib2/tables/local/ecmf/obstat.11.0.table\ @@ -18345,12 +18358,33 @@ dist_definitionsgrib2_tables_local_ecmf_DATA = \ grib2/tables/local/ecmf/obstat.reporttype.table\ grib2/tables/local/ecmf/obstat.varno.table +definitionsgrib2_tables_local_ecmf_1dir = @ECCODES_DEFINITION_PATH@/grib2/tables/local/ecmf/1 +dist_definitionsgrib2_tables_local_ecmf_1_DATA = \ + grib2/tables/local/ecmf/1/4.2.0.20.table\ + grib2/tables/local/ecmf/1/4.2.2.0.table\ + grib2/tables/local/ecmf/1/4.230.table\ + grib2/tables/local/ecmf/1/4.233.table + definitionsgrib2_tables_local_ecmf_4dir = @ECCODES_DEFINITION_PATH@/grib2/tables/local/ecmf/4 dist_definitionsgrib2_tables_local_ecmf_4_DATA = \ grib2/tables/local/ecmf/4/1.2.table definitionsgrib2_tables_local_edzw_1dir = @ECCODES_DEFINITION_PATH@/grib2/tables/local/edzw/1 dist_definitionsgrib2_tables_local_edzw_1_DATA = \ + grib2/tables/local/edzw/1/1.4.table\ + grib2/tables/local/edzw/1/4.0.table\ + grib2/tables/local/edzw/1/4.1.0.table\ + grib2/tables/local/edzw/1/4.11.table\ + grib2/tables/local/edzw/1/4.2.0.0.table\ + grib2/tables/local/edzw/1/4.2.0.1.table\ + grib2/tables/local/edzw/1/4.2.0.13.table\ + grib2/tables/local/edzw/1/4.2.0.14.table\ + grib2/tables/local/edzw/1/4.2.0.15.table\ + grib2/tables/local/edzw/1/4.2.0.16.table\ + grib2/tables/local/edzw/1/4.2.0.17.table\ + grib2/tables/local/edzw/1/4.2.0.18.table\ + grib2/tables/local/edzw/1/4.2.0.19.table\ + grib2/tables/local/edzw/1/4.2.0.191.table\ grib2/tables/local/edzw/1/4.2.0.192.table\ grib2/tables/local/edzw/1/4.2.0.193.table\ grib2/tables/local/edzw/1/4.2.0.194.table\ @@ -18359,11 +18393,32 @@ dist_definitionsgrib2_tables_local_edzw_1_DATA = \ grib2/tables/local/edzw/1/4.2.0.197.table\ grib2/tables/local/edzw/1/4.2.0.198.table\ grib2/tables/local/edzw/1/4.2.0.199.table\ + grib2/tables/local/edzw/1/4.2.0.2.table\ + grib2/tables/local/edzw/1/4.2.0.20.table\ grib2/tables/local/edzw/1/4.2.0.254.table\ + grib2/tables/local/edzw/1/4.2.0.3.table\ + grib2/tables/local/edzw/1/4.2.0.4.table\ + grib2/tables/local/edzw/1/4.2.0.5.table\ + grib2/tables/local/edzw/1/4.2.0.6.table\ + grib2/tables/local/edzw/1/4.2.0.7.table\ + grib2/tables/local/edzw/1/4.2.1.0.table\ + grib2/tables/local/edzw/1/4.2.10.0.table\ + grib2/tables/local/edzw/1/4.2.10.3.table\ + grib2/tables/local/edzw/1/4.2.2.0.table\ + grib2/tables/local/edzw/1/4.2.2.3.table\ grib2/tables/local/edzw/1/4.2.215.19.table\ grib2/tables/local/edzw/1/4.2.215.2.table\ grib2/tables/local/edzw/1/4.2.215.5.table\ - grib2/tables/local/edzw/1/4.2.215.7.table + grib2/tables/local/edzw/1/4.2.215.7.table\ + grib2/tables/local/edzw/1/4.2.3.0.table\ + grib2/tables/local/edzw/1/4.2.3.1.table\ + grib2/tables/local/edzw/1/4.3.table\ + grib2/tables/local/edzw/1/4.5.table\ + grib2/tables/local/edzw/1/4.6.table\ + grib2/tables/local/edzw/1/4.7.table\ + grib2/tables/local/edzw/1/4.9.table\ + grib2/tables/local/edzw/1/backgroundProcess.table\ + grib2/tables/local/edzw/1/generatingProcessIdentifier.table definitionsgrib2_tables_local_kwbc_1dir = @ECCODES_DEFINITION_PATH@/grib2/tables/local/kwbc/1 dist_definitionsgrib2_tables_local_kwbc_1_DATA = \ @@ -18641,8 +18696,7 @@ dist_definitionsgrib3_tables_0_DATA = \ grib3/tables/0/5.7.table\ grib3/tables/0/5.8.table\ grib3/tables/0/5.9.table\ - grib3/tables/0/6.0.table\ - grib3/tables/0/stepType.table + grib3/tables/0/6.0.table definitionsgrib3_tables_1dir = @ECCODES_DEFINITION_PATH@/grib3/tables/1 dist_definitionsgrib3_tables_1_DATA = \ @@ -18766,8 +18820,7 @@ dist_definitionsgrib3_tables_1_DATA = \ grib3/tables/1/7.3.0.7.table\ grib3/tables/1/7.3.1.0.table\ grib3/tables/1/7.3.1.1.table\ - grib3/tables/1/7.3.1.2.table\ - grib3/tables/1/stepType.table + grib3/tables/1/7.3.1.2.table definitionsgrib3_tables_local_ecmfdir = @ECCODES_DEFINITION_PATH@/grib3/tables/local/ecmf dist_definitionsgrib3_tables_local_ecmf_DATA = \ @@ -19053,6 +19106,7 @@ dist_definitionsmars_DATA = \ mars/grib.oper.fa.def\ mars/grib.oper.fc.def\ mars/grib.oper.fg.def\ + mars/grib.oper.gai.def\ mars/grib.oper.go.def\ mars/grib.oper.ia.def\ mars/grib.oper.im.def\ @@ -19063,6 +19117,7 @@ dist_definitionsmars_DATA = \ mars/grib.oper.ssd.def\ mars/grib.scda.4i.def\ mars/grib.scda.me.def\ + mars/grib.scda.ssd.def\ mars/grib.seap.an.def\ mars/grib.seap.ef.def\ mars/grib.seap.es.def\ @@ -19120,6 +19175,15 @@ dist_definitionsmars_DATA = \ mars/grib.wehs.em.def\ mars/grib.wehs.es.def\ mars/grib.weov.pf.def\ + mars/grib.wfas.cf.def\ + mars/grib.wfas.fc.def\ + mars/grib.wfas.fu.def\ + mars/grib.wfas.pf.def\ + mars/grib.wfas.sfo.def\ + mars/grib.wfcl.cf.def\ + mars/grib.wfcl.fc.def\ + mars/grib.wfcl.pf.def\ + mars/grib.wfcl.sfo.def\ mars/grib.wmfm.fcmax.def\ mars/grib.wmfm.fcmean.def\ mars/grib.wmfm.fcmin.def\ diff --git a/src/grib_accessor_class_expanded_descriptors.c b/src/grib_accessor_class_expanded_descriptors.c index f0236e0ae..c8fa61921 100644 --- a/src/grib_accessor_class_expanded_descriptors.c +++ b/src/grib_accessor_class_expanded_descriptors.c @@ -173,7 +173,7 @@ typedef struct change_coding_params { /* Handy macro to catch errors. * Arguments: array is a pointer to 'bufr_descriptors_array', result is pointer to 'bufr_descriptor' */ #define DESCRIPTORS_POP_FRONT_OR_RETURN(array,result) {\ - if(array->n == 0) { *err=GRIB_INTERNAL_ERROR; return 0; } \ + if(array->n == 0) { *err=GRIB_INTERNAL_ERROR; return; } \ result=grib_bufr_descriptors_array_pop_front(array); \ } @@ -210,7 +210,7 @@ static int global_depth=-1; #define BUFR_DESCRIPTORS_ARRAY_USED_SIZE(v) ((v)->n) -static size_t __expand(grib_accessor* a, bufr_descriptors_array* unexpanded, bufr_descriptors_array* expanded, +static void __expand(grib_accessor* a, bufr_descriptors_array* unexpanded, bufr_descriptors_array* expanded, change_coding_params* ccp, int* err) { int k,j,i; @@ -227,11 +227,12 @@ static size_t __expand(grib_accessor* a, bufr_descriptors_array* unexpanded, buf bufr_descriptor* us=NULL; bufr_descriptors_array* inner_expanded=NULL; bufr_descriptors_array* inner_unexpanded=NULL; + grib_handle* hand = grib_handle_of_accessor(a); #if MYDEBUG int idepth; #endif - if (BUFR_DESCRIPTORS_ARRAY_USED_SIZE(unexpanded)==0) return 0; + if (BUFR_DESCRIPTORS_ARRAY_USED_SIZE(unexpanded)==0) return; us=grib_bufr_descriptor_clone(grib_bufr_descriptors_array_get(unexpanded,0)); us->context = c; @@ -250,13 +251,13 @@ static size_t __expand(grib_accessor* a, bufr_descriptors_array* unexpanded, buf printf("+++ pop %06ld\n",u->code); #endif /*this is to get the sequence elements of the sequence unexpanded[i] */ - *err=grib_set_long(grib_handle_of_accessor(a),self->sequence,u->code); - *err=grib_get_size(grib_handle_of_accessor(a),self->sequence,&size); + *err=grib_set_long(hand,self->sequence,u->code); + *err=grib_get_size(hand,self->sequence,&size); grib_bufr_descriptor_delete(u); - if (*err) return 0; + if (*err) return; v=(long*)grib_context_malloc_clear(c,sizeof(long)*size); - *err=grib_get_long_array(grib_handle_of_accessor(a),self->sequence,v,&size); - if (*err) return 0; + *err=grib_get_long_array(hand,self->sequence,v,&size); + if (*err) return; inner_unexpanded=grib_bufr_descriptors_array_new(c,DESC_SIZE_INIT,DESC_SIZE_INCR); for (i=0;in;i++) { @@ -299,7 +300,7 @@ static size_t __expand(grib_accessor* a, bufr_descriptors_array* unexpanded, buf "Delayed replication: %06ld: expected %d but only found %lu elements", u->code, us->X, unexpanded->n - 1); *err = GRIB_DECODING_ERROR; - return 0; + return; } for (j=0;jX+1;j++) { DESCRIPTORS_POP_FRONT_OR_RETURN(unexpanded, u0); @@ -310,7 +311,7 @@ static size_t __expand(grib_accessor* a, bufr_descriptors_array* unexpanded, buf #endif } inner_expanded=do_expand(a,inner_unexpanded,ccp,err); - if (*err) return 0; + if (*err) return; grib_bufr_descriptors_array_delete(inner_unexpanded); size=BUFR_DESCRIPTORS_ARRAY_USED_SIZE(inner_expanded); #if MYDEBUG @@ -353,7 +354,7 @@ static size_t __expand(grib_accessor* a, bufr_descriptors_array* unexpanded, buf for (i=0;iX;i++) grib_bufr_descriptor_delete(ur[i]); grib_context_free(c,ur); inner_expanded=do_expand(a,inner_unexpanded,ccp,err); - if (*err) return 0; + if (*err) return; grib_bufr_descriptors_array_delete(inner_unexpanded); #if MYDEBUG for (i=0;in;i++) { @@ -482,7 +483,6 @@ static size_t __expand(grib_accessor* a, bufr_descriptors_array* unexpanded, buf printf("expanding <== %d-%.2d-%.3d (size=%ld)\n\n",us->F,us->X,us->Y,size); #endif if (us) grib_bufr_descriptor_delete(us); - return size; } static bufr_descriptors_array* do_expand(grib_accessor* a,bufr_descriptors_array* unexpanded,change_coding_params* ccp,int *err) @@ -566,7 +566,7 @@ static int expand(grib_accessor* a) return err; } - err=grib_get_size(grib_handle_of_accessor(a),self->unexpandedDescriptors,&unexpandedSize); + err=grib_get_size(h,self->unexpandedDescriptors,&unexpandedSize); if (err) return err; if (unexpandedSize==0) { grib_context_log(c, GRIB_LOG_ERROR, "%s: Unexpanded size is zero!", a->name); @@ -574,7 +574,7 @@ static int expand(grib_accessor* a) } u=(long*)grib_context_malloc_clear(c,sizeof(long)*unexpandedSize); if (!u) {err=GRIB_OUT_OF_MEMORY; return err;} - err=grib_get_long_array(grib_handle_of_accessor(a),self->unexpandedDescriptors,u,&unexpandedSize); + err=grib_get_long_array(h,self->unexpandedDescriptors,u,&unexpandedSize); if (err) return err; err=grib_get_long(h,"bufrHeaderCentre",¢re); @@ -595,7 +595,7 @@ static int expand(grib_accessor* a) } if (!self->tablesAccessor) { - self->tablesAccessor=grib_find_accessor(grib_handle_of_accessor(a),self->tablesAccessorName); + self->tablesAccessor=grib_find_accessor(h,self->tablesAccessorName); Assert(self->tablesAccessor); } @@ -696,8 +696,9 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) size_t i; ret=expand(a); - rlen=BUFR_DESCRIPTORS_ARRAY_USED_SIZE(self->expanded); if (ret) return ret; + if (!self->expanded) return GRIB_DECODING_ERROR; + rlen=BUFR_DESCRIPTORS_ARRAY_USED_SIZE(self->expanded); if(*len < rlen) { From 494a9a40a1fec1c441ee39e7665dcf1ea6af9fdd Mon Sep 17 00:00:00 2001 From: Daniel Tipping Date: Mon, 6 Jan 2020 21:05:27 +0000 Subject: [PATCH 40/82] Add netcdf.dll location to $PATH for testing --- tests/grib_to_netcdf.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/grib_to_netcdf.sh b/tests/grib_to_netcdf.sh index 617ac9f75..a5a53bdb7 100755 --- a/tests/grib_to_netcdf.sh +++ b/tests/grib_to_netcdf.sh @@ -3,12 +3,25 @@ # # 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. . ./include.sh +if [ $ECCODES_ON_WINDOWS -eq 1 ]; then + # m2-bash messes with the system path. + # %CONDA_PREFIX%\Library\usr\bin is converted to /usr/bin. + # %CONDA_PREFIX%\Library\bin is converted to /bin. + # However the contents of /bin and /usr/bin are identical. + # They both point to %CONDA_PREFIX%\Library\usr\bin! + # This means we're unable to access important dlls (like netcdf.dll) which live in + # %CONDA_PREFIX%\Library\bin. + # It is not obvious why this behaviour exists. + # We add this directory back to the path manually. + export PATH=$PATH:$CONDA_PREFIX/Library/bin +fi + # Disable if autotools being used src_config=${src_dir}/config.h if [ -f ${src_config} ]; then From 828cfeaee2b379d0afcac73479372fa6dda857d5 Mon Sep 17 00:00:00 2001 From: Daniel Tipping Date: Mon, 6 Jan 2020 21:36:54 +0000 Subject: [PATCH 41/82] Remove debug and failed attempts to put netcdf.dll in path --- .appveyor.yml | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 56c36efed..456eb4ade 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -28,8 +28,6 @@ init: - cmd: call %CONDA%\Scripts\activate.bat # add eccodes\build\bin to path so tests can find eccodes.dll - cmd: set PATH=%PATH%;%ECCODES_SRC%\build\bin - # add %CONDA%\Library\bin to path so tests can find netcdf.dll - - cmd: set PATH=%PATH%;%CONDA%\Library\bin # auto-yes for conda - cmd: conda config --set always_yes yes @@ -56,28 +54,6 @@ install: # get deps - cmd: conda install -c conda-forge cmake libnetcdf - # debug - - cmd: find %CONDA_PREFIX% -name netcdf.dll - - cmd: where netcdf.dll - - cmd: where bash.exe - - # We saw a problem with the grib_to_netcdf test where we could not find netcdf.dll. - # - # $ where netcdf.dll - # c:\Miniconda37-x64\Library\bin\netcdf.dll - # $ where bash.exe - # c:\Miniconda37-x64\Library\usr\bin\bash.exe - # - # When we use m2-bash for the tests it changes our system path. - # c:\Miniconda37-x64\Library\bin\ becomes /bin - # yet `ls /bin` shows bash.exe amongst others. - # It seems that /bin is actually pointing to c:\Miniconda37-x64\Library\usr\bin - # which means the path conversion is wrong. - # Seems like this could be a bug in m2-bash. - # - # Put netcdf.dll somewhere we can find it. - - cmd: cp %CONDA_PREFIX%\Library\bin\netcdf.dll %CONDA_PREFIX%\Library\usr\bin\netcdf.dll - #---------------------------------# # build configuration # #---------------------------------# @@ -105,10 +81,6 @@ build_script: -D WINDOWS_TESTING_BASHRC=%WINDOWS_TESTING_BASHRC% ^ .. - cmd: nmake - - cmd: ntldd %ECCODES_SRC%/build/bin/grib_to_netcdf.exe # debug - - cmd: ntldd %CONDA_PREFIX%/Library/bin/netcdf.dll # debug - - cmd: ntldd %CONDA_PREFIX%/Library/usr/bin\netcdf.dll # debug - - cmd: echo %PATH% # debug - cmd: ctest --output-on-failure - cmd: nmake install From 25d64cdfa1dc1f4ede6a961a0f3bb4b28e3b8492 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 7 Jan 2020 16:26:57 +0000 Subject: [PATCH 42/82] Latest updates from develop --- definitions/grib1/local.98.49.def | 31 +++++++++++++++++++ .../grib1/localDefinitionNumber.98.table | 1 + definitions/grib2/products_s2s.def | 1 - definitions/grib2/template.4.30.def | 2 +- definitions/grib2/template.4.31.def | 2 +- definitions/grib2/template.4.311.def | 2 +- definitions/grib2/template.4.32.def | 2 +- definitions/grib2/template.4.35.def | 2 +- tests/grib_local.sh | 7 +++++ tests/include.sh | 3 ++ 10 files changed, 47 insertions(+), 6 deletions(-) create mode 100644 definitions/grib1/local.98.49.def diff --git a/definitions/grib1/local.98.49.def b/definitions/grib1/local.98.49.def new file mode 100644 index 000000000..0124cec40 --- /dev/null +++ b/definitions/grib1/local.98.49.def @@ -0,0 +1,31 @@ +# Copyright 2005-2019 ECMWF. + +template mars_labeling "grib1/mars_labeling.def"; + +#1->2 +alias grib2LocalSectionPresent=present; +constant grib2LocalSectionNumber=49; +if (stepType is "instant") { + alias productDefinitionTemplateNumber=zero; +} else { + alias productDefinitionTemplateNumber=eight; +} + +constant GRIBEXSection1Problem = 56 - section1Length ; + +# Ensemble forecast number: = 0 for a control forecast. Not used for analysis (set to zero) +unsigned[1] perturbationNumber : dump; +alias mars.number=perturbationNumber; +# Total number of forecasts in ensemble (Set to 1 for analysis) +unsigned[1] numberOfForecastsInEnsemble : dump; +# Model error type: 1=Full state 2=Forcing 3=Model Bias +unsigned[1] modelErrorType : dump; + +# Hours +unsigned[2] offsetToEndOf4DvarWindow : dump; +unsigned[2] lengthOf4DvarWindow : dump; +alias anoffset=offsetToEndOf4DvarWindow; + +alias local.perturbationNumber=perturbationNumber; +alias local.numberOfForecastsInEnsemble=numberOfForecastsInEnsemble; +alias local.modelErrorType=modelErrorType; diff --git a/definitions/grib1/localDefinitionNumber.98.table b/definitions/grib1/localDefinitionNumber.98.table index dda47507b..f63cf1477 100644 --- a/definitions/grib1/localDefinitionNumber.98.table +++ b/definitions/grib1/localDefinitionNumber.98.table @@ -36,6 +36,7 @@ 38 38 4D variational increments for long window 4Dvar system 39 39 4DVar model errors for long window 4Dvar system 40 40 MARS labeling with domain and model (for LAM) +49 49 4DVar model errors for ELDA 50 50 Member State data 190 190 Multiple ECMWF local definitions 191 191 Free format data descriptor data diff --git a/definitions/grib2/products_s2s.def b/definitions/grib2/products_s2s.def index 27633207a..59bacd8de 100644 --- a/definitions/grib2/products_s2s.def +++ b/definitions/grib2/products_s2s.def @@ -101,7 +101,6 @@ if (isHindcast == 1) { # ECC-891, ECC-1013 concept is_ocean2d_param(zero) { '1' = { discipline=10; typeOfFirstFixedSurface=160; scaleFactorOfFirstFixedSurface=0; scaledValueOfFirstFixedSurface=0; typeOfSecondFixedSurface=255; } - '1' = { discipline=10; typeOfFirstFixedSurface=160; scaleFactorOfFirstFixedSurface=missing(); scaledValueOfFirstFixedSurface=missing(); typeOfSecondFixedSurface=255; } '1' = { discipline=10; typeOfFirstFixedSurface=20; scaleFactorOfFirstFixedSurface=2; scaledValueOfFirstFixedSurface=29315; typeOfSecondFixedSurface=255; } '1' = { discipline=10; typeOfFirstFixedSurface=169; scaleFactorOfFirstFixedSurface=2; scaledValueOfFirstFixedSurface=1; typeOfSecondFixedSurface=255; } '1' = { discipline=10; typeOfFirstFixedSurface=160; scaleFactorOfFirstFixedSurface=0; scaledValueOfFirstFixedSurface=0; typeOfSecondFixedSurface=160; scaleFactorOfSecondFixedSurface=0; scaledValueOfSecondFixedSurface=300; } diff --git a/definitions/grib2/template.4.30.def b/definitions/grib2/template.4.30.def index a8b50b976..afb3ae3cd 100644 --- a/definitions/grib2/template.4.30.def +++ b/definitions/grib2/template.4.30.def @@ -1,6 +1,6 @@ # Copyright 2005-2019 ECMWF. -# For grib2 to grib1 convertion +# For grib2 to grib1 conversion constant dataRepresentationType = 90; # TEMPLATE 4.30, Satellite Product diff --git a/definitions/grib2/template.4.31.def b/definitions/grib2/template.4.31.def index c846d7236..0fe7dacb9 100644 --- a/definitions/grib2/template.4.31.def +++ b/definitions/grib2/template.4.31.def @@ -1,6 +1,6 @@ # Copyright 2005-2019 ECMWF. -# For grib2 to grib1 convertion +# For grib2 to grib1 conversion constant dataRepresentationType = 90; # TEMPLATE 4.31, Satellite Product diff --git a/definitions/grib2/template.4.311.def b/definitions/grib2/template.4.311.def index 03066cdc1..85566fa63 100644 --- a/definitions/grib2/template.4.311.def +++ b/definitions/grib2/template.4.311.def @@ -1,6 +1,6 @@ # Copyright 2005-2019 ECMWF. -# For grib2 to grib1 convertion +# For grib2 to grib1 conversion constant dataRepresentationType = 90; # TEMPLATE 4.311, Satellite Product Auxiliary Information diff --git a/definitions/grib2/template.4.32.def b/definitions/grib2/template.4.32.def index 04e901256..896eb5fc2 100644 --- a/definitions/grib2/template.4.32.def +++ b/definitions/grib2/template.4.32.def @@ -1,6 +1,6 @@ # Copyright 2005-2019 ECMWF. -# For grib2 to grib1 convertion +# For grib2 to grib1 conversion constant dataRepresentationType = 90; # TEMPLATE 4.32, Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data diff --git a/definitions/grib2/template.4.35.def b/definitions/grib2/template.4.35.def index b77f5f6ea..de7ede3d3 100644 --- a/definitions/grib2/template.4.35.def +++ b/definitions/grib2/template.4.35.def @@ -1,6 +1,6 @@ # Copyright 2005-2019 ECMWF. -# For grib2 to grib1 convertion +# For grib2 to grib1 conversion constant dataRepresentationType = 90; # TEMPLATE 4.35, satellite product with or without associated quality values diff --git a/tests/grib_local.sh b/tests/grib_local.sh index b573ffc56..c130e8975 100755 --- a/tests/grib_local.sh +++ b/tests/grib_local.sh @@ -126,6 +126,13 @@ ${tools_dir}/grib_set -s setLocalDefinition=1,localDefinitionNumber=16,numberOfF grib_check_key_equals $temp 'totalNumber' '51' +# Local Definition 49 for GRIB1 +# ----------------------------- +${tools_dir}/grib_set -s localDefinitionNumber=49,type=35 $sample_g1 $temp +grib_check_key_equals $temp 'perturbationNumber,numberOfForecastsInEnsemble' '0 0' + + + # Local Definition 18 (list of ascii keys) # ---------------------------------------- ${tools_dir}/grib_filter -o $temp - $sample_g1 << EOF diff --git a/tests/include.sh b/tests/include.sh index 96f8dbb8d..4cc46453f 100644 --- a/tests/include.sh +++ b/tests/include.sh @@ -20,6 +20,9 @@ else echo echo "TEST: $0" + # Only Unix supported + ECCODES_ON_WINDOWS=0 + data_dir="" # save current working dir save=`pwd` From 888ed8a7adfd2739ca2b749e1ea97b6ace5df411 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 9 Jan 2020 18:28:28 +0000 Subject: [PATCH 43/82] Latest updates from develop (2) --- CMakeLists.txt | 6 +- src/grib_accessor_class_box.c | 29 +- src/grib_accessor_class_constant.c | 29 +- ...grib_accessor_class_data_complex_packing.c | 9 +- src/grib_accessor_class_double.c | 21 +- src/grib_accessor_class_evaluate.c | 28 +- src/grib_accessor_class_g1bitmap.c | 18 +- src/grib_accessor_class_g1fcperiod.c | 33 +- src/grib_accessor_class_label.c | 28 +- src/grib_accessor_class_latlon_increment.c | 10 +- src/grib_accessor_class_local_definition.c | 3 +- src/grib_accessor_class_long_vector.c | 129 ++--- src/grib_accessor_class_message.c | 52 +- src/grib_accessor_class_message_copy.c | 39 +- src/grib_accessor_class_nearest.c | 31 +- src/grib_accessor_class_offset_file.c | 47 +- src/grib_accessor_class_pack_bufr_values.c | 59 +- src/grib_accessor_class_padding.c | 27 +- src/grib_accessor_class_padtoeven.c | 40 +- src/grib_accessor_class_size.c | 27 +- src/grib_dumper_class_bufr_encode_filter.c | 33 +- src/grib_dumper_class_grib_encode_C.c | 535 +++++++++--------- src/grib_dumper_class_serialize.c | 477 ++++++++-------- src/grib_expression_class_is_in_list.c | 227 ++++---- src/grib_expression_class_is_integer.c | 131 +++-- tigge/tigge_check.h | 8 +- 26 files changed, 1035 insertions(+), 1041 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e8641f96d..0be2645cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,7 +118,7 @@ ecbuild_add_option( FEATURE AEC ) ecbuild_add_option( FEATURE PYTHON - DESCRIPTION "Build the ecCodes Python interface" + DESCRIPTION "Build the ecCodes Python2 interface" DEFAULT ON REQUIRED_PACKAGES "Python VERSION 2.6 NO_LIBS" NumPy ) @@ -491,6 +491,10 @@ ecbuild_info(" | ecCodes version ${ECCODES_VERSION} |") ecbuild_info(" +--------------------------+") ecbuild_info("") +if( HAVE_PYTHON ) + ecbuild_deprecate("Python2 support is deprecated and will be discontinued") +endif() + ecbuild_info(" +--------------------------------------+") ecbuild_info(" | Please note: |") ecbuild_info(" | For Python3 support, first install |") diff --git a/src/grib_accessor_class_box.c b/src/grib_accessor_class_box.c index dfcb8148c..7ed4bc27f 100644 --- a/src/grib_accessor_class_box.c +++ b/src/grib_accessor_class_box.c @@ -131,31 +131,30 @@ static void init_class(grib_accessor_class* c) static void init(grib_accessor* a,const long l, grib_arguments* args) { - grib_accessor_box* self = (grib_accessor_box*)a; - self->args = args; + grib_accessor_box* self = (grib_accessor_box*)a; + self->args = args; } static void dump(grib_accessor* a,grib_dumper* dumper) { - /* TODO: pass args */ - grib_dump_label(dumper,a,NULL); + /* TODO: pass args */ + grib_dump_label(dumper,a,NULL); } grib_box* grib_box_new(grib_handle* h,int* error) { - grib_accessor* a = NULL; - grib_accessor_box* na =NULL; - grib_box* n =NULL; - *error=GRIB_NOT_IMPLEMENTED; - a = grib_find_accessor(h,"BOX"); - na = (grib_accessor_box*)a; + grib_accessor* a = NULL; + grib_accessor_box* na =NULL; + grib_box* n =NULL; + *error=GRIB_NOT_IMPLEMENTED; + a = grib_find_accessor(h,"BOX"); + na = (grib_accessor_box*)a; - if (!a) return NULL; + if (!a) return NULL; - n = grib_box_factory(h,na->args); + n = grib_box_factory(h,na->args); - if (n) *error=GRIB_SUCCESS; + if (n) *error=GRIB_SUCCESS; - return n; + return n; } - diff --git a/src/grib_accessor_class_constant.c b/src/grib_accessor_class_constant.c index 3f6ef998e..20f8c98a6 100644 --- a/src/grib_accessor_class_constant.c +++ b/src/grib_accessor_class_constant.c @@ -136,40 +136,39 @@ static void init_class(grib_accessor_class* c) /* END_CLASS_IMP */ - -void accessor_constant_set_type(grib_accessor* a,int type) { - grib_accessor_constant* self = (grib_accessor_constant*)a; - self->type=type; +void accessor_constant_set_type(grib_accessor* a,int type) +{ + grib_accessor_constant* self = (grib_accessor_constant*)a; + self->type=type; } -void accessor_constant_set_dval(grib_accessor* a,double dval) { - grib_accessor_constant* self = (grib_accessor_constant*)a; - self->dval=dval; +void accessor_constant_set_dval(grib_accessor* a,double dval) +{ + grib_accessor_constant* self = (grib_accessor_constant*)a; + self->dval=dval; } - -static void init(grib_accessor* a, const long len , grib_arguments* arg ) +static void init(grib_accessor* a, const long len , grib_arguments* arg) { - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } static int pack_bytes(grib_accessor* a,const unsigned char* val, size_t *len) { - return GRIB_READ_ONLY; + return GRIB_READ_ONLY; } static int pack_double(grib_accessor* a, const double* val,size_t *len) { - return GRIB_READ_ONLY; + return GRIB_READ_ONLY; } static int pack_long(grib_accessor* a, const long* val,size_t *len) { - return GRIB_READ_ONLY; + return GRIB_READ_ONLY; } static int pack_string(grib_accessor* a, const char* val, size_t *len) { - return GRIB_READ_ONLY; + return GRIB_READ_ONLY; } - diff --git a/src/grib_accessor_class_data_complex_packing.c b/src/grib_accessor_class_data_complex_packing.c index 1ed10628d..2339d558a 100644 --- a/src/grib_accessor_class_data_complex_packing.c +++ b/src/grib_accessor_class_data_complex_packing.c @@ -380,11 +380,10 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len) } /* - printf("UNPACKING LAPLACE=%.20f\n",laplacianOperator); - - printf("packed offset=%ld\n",packed_offset); - for(i=0;iflags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) - { - int e=grib_unpack_double(a,&value,&one); - Assert(e == 0); - return value == GRIB_MISSING_DOUBLE; - } - return 0; + size_t one = 1; + double value = GRIB_MISSING_DOUBLE; + + if(a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) + { + int e=grib_unpack_double(a,&value,&one); + Assert(e == 0); + return value == GRIB_MISSING_DOUBLE; + } + return 0; } */ diff --git a/src/grib_accessor_class_evaluate.c b/src/grib_accessor_class_evaluate.c index 10974350a..e10d8e91b 100644 --- a/src/grib_accessor_class_evaluate.c +++ b/src/grib_accessor_class_evaluate.c @@ -132,28 +132,24 @@ static void init_class(grib_accessor_class* c) static void init(grib_accessor* a,const long l, grib_arguments* c) { - grib_accessor_evaluate* self = (grib_accessor_evaluate*)a; - self->arg = c; - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + grib_accessor_evaluate* self = (grib_accessor_evaluate*)a; + self->arg = c; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } -static int pack_long(grib_accessor* a, const long* val, size_t *len){ - - return GRIB_NOT_IMPLEMENTED; - +static int pack_long(grib_accessor* a, const long* val, size_t *len) +{ + return GRIB_NOT_IMPLEMENTED; } - static int unpack_long(grib_accessor* a, long* val, size_t *len) { - int ret=0; - grib_accessor_evaluate* self = (grib_accessor_evaluate*)a; - grib_expression* e = grib_arguments_get_expression(grib_handle_of_accessor(a),self->arg,0); - + int ret=0; + grib_accessor_evaluate* self = (grib_accessor_evaluate*)a; + grib_expression* e = grib_arguments_get_expression(grib_handle_of_accessor(a),self->arg,0); - ret = grib_expression_evaluate_long(grib_handle_of_accessor(a),e,val); - *len = 1; + ret = grib_expression_evaluate_long(grib_handle_of_accessor(a),e,val); + *len = 1; - return ret; + return ret; } - diff --git a/src/grib_accessor_class_g1bitmap.c b/src/grib_accessor_class_g1bitmap.c index e4808bb84..aa685f930 100644 --- a/src/grib_accessor_class_g1bitmap.c +++ b/src/grib_accessor_class_g1bitmap.c @@ -139,19 +139,15 @@ static void init_class(grib_accessor_class* c) static void grib_set_bit_on( unsigned char* p, long *bitp); -static void init(grib_accessor* a, const long len , grib_arguments* arg ) +static void init(grib_accessor* a, const long len , grib_arguments* arg) { - grib_accessor_g1bitmap* self = (grib_accessor_g1bitmap*)a; - self->unusedBits = grib_arguments_get_name(grib_handle_of_accessor(a),arg,4); - } - -static int pack_double(grib_accessor* a, const double* val,size_t *len){ +static int pack_double(grib_accessor* a, const double* val,size_t *len) +{ grib_accessor_g1bitmap* self = (grib_accessor_g1bitmap*)a; - size_t tlen; unsigned char* buf = NULL; @@ -191,7 +187,6 @@ static int pack_double(grib_accessor* a, const double* val,size_t *len){ return GRIB_SUCCESS; } - static int value_count(grib_accessor* a,long* count) { grib_accessor_g1bitmap* self = (grib_accessor_g1bitmap*)a; @@ -201,8 +196,8 @@ static int value_count(grib_accessor* a,long* count) if ((err=grib_get_long_internal(grib_handle_of_accessor(a), self->unusedBits, &tlen)) != GRIB_SUCCESS) grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_class_bitmap.value_count : cannot get %s err=%d",self->unusedBits,err); - *count = (a->length*8)-tlen; - return err; + *count = (a->length*8)-tlen; + return err; } static int unpack_bytes(grib_accessor* a, unsigned char* val, size_t *len) @@ -232,7 +227,8 @@ static int unpack_bytes(grib_accessor* a, unsigned char* val, size_t *len) return GRIB_SUCCESS; } -static void grib_set_bit_on( unsigned char* p, long *bitp){ +static void grib_set_bit_on( unsigned char* p, long *bitp) +{ unsigned char o = 1; p += (*bitp >> 3); o <<= 7-((*bitp)%8); diff --git a/src/grib_accessor_class_g1fcperiod.c b/src/grib_accessor_class_g1fcperiod.c index fe7eaccf8..dad7d2c85 100644 --- a/src/grib_accessor_class_g1fcperiod.c +++ b/src/grib_accessor_class_g1fcperiod.c @@ -138,30 +138,27 @@ static void init_class(grib_accessor_class* c) /* END_CLASS_IMP */ - static int unpack_string(grib_accessor* a, char* val, size_t *len) { - long start = 0, theEnd = 0; - char tmp[1024]; - int err = grib_g1_step_get_steps(a,&start,&theEnd); - size_t l = 0; + long start = 0, theEnd = 0; + char tmp[1024]; + int err = grib_g1_step_get_steps(a,&start,&theEnd); + size_t l = 0; + if(err) return err; - if(err) return err; + sprintf(tmp,"%ld-%ld",start/24,theEnd/24); + /*printf("---- FCPERIOD %s [start:%g, end:%g]",tmp,start,end);*/ - sprintf(tmp,"%ld-%ld",start/24,theEnd/24); - /*printf("---- FCPERIOD %s [start:%g, end:%g]",tmp,start,end);*/ + l = strlen(tmp) + 1; + if(*len < l) + { + *len = l; + return GRIB_BUFFER_TOO_SMALL; + } - l = strlen(tmp) + 1; - if(*len < l) - { *len = l; - return GRIB_BUFFER_TOO_SMALL; - } - - *len = l; - strcpy(val,tmp); - + strcpy(val,tmp); - return GRIB_SUCCESS; + return GRIB_SUCCESS; } diff --git a/src/grib_accessor_class_label.c b/src/grib_accessor_class_label.c index a51fa7616..011c52302 100644 --- a/src/grib_accessor_class_label.c +++ b/src/grib_accessor_class_label.c @@ -129,33 +129,31 @@ static void init_class(grib_accessor_class* c) static void init(grib_accessor* a, const long len , grib_arguments* arg) { - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; - a->length = 0; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; + a->length = 0; } - static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_label(dumper,a,NULL); + grib_dump_label(dumper,a,NULL); } static int get_native_type(grib_accessor* a) { - return GRIB_TYPE_LABEL; + return GRIB_TYPE_LABEL; } - -static int compare(grib_accessor* a, grib_accessor* b) { - return GRIB_SUCCESS; +static int compare(grib_accessor* a, grib_accessor* b) +{ + return GRIB_SUCCESS; } static int unpack_string(grib_accessor* a, char* val, size_t *len) { - size_t vlen=strlen(a->name); - if (vlen > *len) return GRIB_BUFFER_TOO_SMALL; - *len=vlen; - strcpy(val,a->name); - return GRIB_SUCCESS; + size_t vlen=strlen(a->name); + if (vlen > *len) return GRIB_BUFFER_TOO_SMALL; + *len=vlen; + strcpy(val,a->name); + return GRIB_SUCCESS; } - diff --git a/src/grib_accessor_class_latlon_increment.c b/src/grib_accessor_class_latlon_increment.c index 353b64bc7..9b5955169 100644 --- a/src/grib_accessor_class_latlon_increment.c +++ b/src/grib_accessor_class_latlon_increment.c @@ -162,7 +162,7 @@ static void init(grib_accessor* a,const long l, grib_arguments* c) self->isLongitude=grib_arguments_get_long(grib_handle_of_accessor(a), c,n++); } -static int unpack_double (grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t *len) { grib_accessor_latlon_increment* self = (grib_accessor_latlon_increment*)a; int ret = 0; @@ -315,8 +315,8 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) } /*ret = grib_set_long_internal(grib_handle_of_accessor(a), self->numberOfPoints,numberOfPoints); - if(ret ) - grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannot pack value for %s error %d \n", a->name, self->numberOfPoints, ret); + if(ret) + grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannot pack value for %s error %d \n", a->name, self->numberOfPoints, ret); */ grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints,&codedNumberOfPoints); @@ -342,8 +342,8 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) return ret; } -static int is_missing(grib_accessor* a){ - +static int is_missing(grib_accessor* a) +{ size_t len=1; double val=0; diff --git a/src/grib_accessor_class_local_definition.c b/src/grib_accessor_class_local_definition.c index 0118fa9f8..9ef251987 100644 --- a/src/grib_accessor_class_local_definition.c +++ b/src/grib_accessor_class_local_definition.c @@ -395,7 +395,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t *len) grib_set_long(hand, self->grib2LocalSectionNumber,*val); - return 0; + return 0; } static int value_count(grib_accessor* a,long* count) @@ -403,4 +403,3 @@ static int value_count(grib_accessor* a,long* count) *count=1; return 0; } - diff --git a/src/grib_accessor_class_long_vector.c b/src/grib_accessor_class_long_vector.c index 8787adf18..7bfc49f3a 100644 --- a/src/grib_accessor_class_long_vector.c +++ b/src/grib_accessor_class_long_vector.c @@ -142,90 +142,91 @@ static void init_class(grib_accessor_class* c) /* END_CLASS_IMP */ typedef struct grib_accessor_abstract_long_vector { - grib_accessor att; - /* Members defined in gen */ - /* Members defined in abstract_long_vector */ - long* v; - long pack_index; - int number_of_elements; + grib_accessor att; + /* Members defined in gen */ + /* Members defined in abstract_long_vector */ + long* v; + long pack_index; + int number_of_elements; } grib_accessor_abstract_long_vector; static void init(grib_accessor* a,const long l, grib_arguments* c) { - grib_accessor_long_vector* self = (grib_accessor_long_vector*)a; - grib_accessor* va=NULL; - grib_accessor_abstract_long_vector* v =NULL; - int n = 0; + grib_accessor_long_vector* self = (grib_accessor_long_vector*)a; + grib_accessor* va=NULL; + grib_accessor_abstract_long_vector* v =NULL; + int n = 0; - self->vector = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); + self->vector = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - va=(grib_accessor*)grib_find_accessor(grib_handle_of_accessor(a),self->vector); - v=(grib_accessor_abstract_long_vector*)va; + va=(grib_accessor*)grib_find_accessor(grib_handle_of_accessor(a),self->vector); + v=(grib_accessor_abstract_long_vector*)va; - self->index = grib_arguments_get_long(grib_handle_of_accessor(a),c,n++); + self->index = grib_arguments_get_long(grib_handle_of_accessor(a),c,n++); - /* check self->index on init and never change it */ - Assert(self->index < v->number_of_elements && self->index>=0); + /* check self->index on init and never change it */ + Assert(self->index < v->number_of_elements && self->index>=0); - a->length=0; + a->length=0; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) { - size_t size=0; - long* vector; - grib_accessor_long_vector* self = (grib_accessor_long_vector*)a; - grib_accessor* va=NULL; - grib_accessor_abstract_long_vector* v =NULL; - - va=(grib_accessor*)grib_find_accessor(grib_handle_of_accessor(a),self->vector); - v=(grib_accessor_abstract_long_vector*)va; - - /*TODO implement the dirty mechanism to avoid to unpack every time */ - grib_get_size(grib_handle_of_accessor(a),self->vector,&size); - vector=(long*)grib_context_malloc(a->context,sizeof(long)*size); - grib_unpack_long(va,vector,&size); - grib_context_free(a->context,vector); - - - *val = v->v[self->index]; - - return GRIB_SUCCESS; -} +static int unpack_long(grib_accessor* a, long* val, size_t *len) +{ + size_t size=0; + long* vector; + grib_accessor_long_vector* self = (grib_accessor_long_vector*)a; + grib_accessor* va=NULL; + grib_accessor_abstract_long_vector* v =NULL; + + va=(grib_accessor*)grib_find_accessor(grib_handle_of_accessor(a),self->vector); + v=(grib_accessor_abstract_long_vector*)va; -static int unpack_double(grib_accessor* a, double* val, size_t *len) { - long lval=0; - int err=0; - grib_accessor_long_vector* self = (grib_accessor_long_vector*)a; - grib_accessor* va=NULL; - grib_accessor_abstract_long_vector* v =NULL; - va=(grib_accessor*)grib_find_accessor(grib_handle_of_accessor(a),self->vector); - v=(grib_accessor_abstract_long_vector*)va; - - err=unpack_long(a,&lval,len); + /*TODO implement the dirty mechanism to avoid to unpack every time */ + grib_get_size(grib_handle_of_accessor(a),self->vector,&size); + vector=(long*)grib_context_malloc(a->context,sizeof(long)*size); + grib_unpack_long(va,vector,&size); + grib_context_free(a->context,vector); - *val = (double)v->v[self->index]; + *val = v->v[self->index]; - return err; + return GRIB_SUCCESS; } -static int pack_long (grib_accessor* a, const long* val, size_t *len) { - int err=0; - grib_accessor_long_vector* self = (grib_accessor_long_vector*)a; - grib_accessor* va=NULL; - grib_accessor_abstract_long_vector* v =NULL; - - va=(grib_accessor*)grib_find_accessor(grib_handle_of_accessor(a),self->vector); - v=(grib_accessor_abstract_long_vector*)va; +static int unpack_double(grib_accessor* a, double* val, size_t *len) +{ + long lval=0; + int err=0; + grib_accessor_long_vector* self = (grib_accessor_long_vector*)a; + grib_accessor* va=NULL; + grib_accessor_abstract_long_vector* v =NULL; + va=(grib_accessor*)grib_find_accessor(grib_handle_of_accessor(a),self->vector); + v=(grib_accessor_abstract_long_vector*)va; - v->pack_index=self->index; + err=unpack_long(a,&lval,len); - err=grib_pack_long(va,val,len); + *val = (double)v->v[self->index]; - return err; + return err; } -static int get_native_type(grib_accessor* a){ - return GRIB_TYPE_LONG; -} +static int pack_long(grib_accessor* a, const long* val, size_t *len) +{ + int err=0; + grib_accessor_long_vector* self = (grib_accessor_long_vector*)a; + grib_accessor* va=NULL; + grib_accessor_abstract_long_vector* v =NULL; + va=(grib_accessor*)grib_find_accessor(grib_handle_of_accessor(a),self->vector); + v=(grib_accessor_abstract_long_vector*)va; + v->pack_index=self->index; + + err=grib_pack_long(va,val,len); + + return err; +} + +static int get_native_type(grib_accessor* a) +{ + return GRIB_TYPE_LONG; +} diff --git a/src/grib_accessor_class_message.c b/src/grib_accessor_class_message.c index 7dd2c1e71..0c03cc657 100644 --- a/src/grib_accessor_class_message.c +++ b/src/grib_accessor_class_message.c @@ -136,9 +136,9 @@ static void init_class(grib_accessor_class* c) static void init(grib_accessor* a, const long len, grib_arguments*arg ) { - a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->length=grib_handle_of_accessor(a)->buffer->ulength-len-a->offset; + a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->length=grib_handle_of_accessor(a)->buffer->ulength-len-a->offset; } static int compare(grib_accessor* a, grib_accessor* b) @@ -149,43 +149,41 @@ static int compare(grib_accessor* a, grib_accessor* b) static void update_size(grib_accessor* a,size_t new_size) { - /* printf("update_size: grib_accessor_class_message.c %ld %ld %s %s\n", (long)new_size,(long)a->length,a->cclass->name,a->name); */ - a->length = new_size; + /* printf("update_size: grib_accessor_class_message.c %ld %ld %s %s\n", (long)new_size,(long)a->length,a->cclass->name,a->name); */ + a->length = new_size; } static void resize(grib_accessor* a,size_t new_size) { - void* zero = grib_context_malloc_clear(a->context,new_size); - - grib_buffer_replace(a,(const unsigned char*)zero,new_size,1,0); - grib_context_free(a->context,zero); - grib_context_log(a->context,GRIB_LOG_DEBUG,"resize: grib_accessor_class_message.c %ld %ld %s %s\n",(long)new_size,(long)a->length,a->cclass->name,a->name); - Assert(new_size == a->length); + void* zero = grib_context_malloc_clear(a->context,new_size); + grib_buffer_replace(a,(const unsigned char*)zero,new_size,1,0); + grib_context_free(a->context,zero); + grib_context_log(a->context,GRIB_LOG_DEBUG,"resize: grib_accessor_class_message.c %ld %ld %s %s\n",(long)new_size,(long)a->length,a->cclass->name,a->name); + Assert(new_size == a->length); } static int value_count(grib_accessor* a,long* count){ *count=1;return 0;} static int unpack_string(grib_accessor* a, char* val, size_t *len) { - - int i = 0; - - if(len[0] < (a->length+1)) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%d) for %s it contains %d values ", len[0], a->name , a->length+1 ); - len[0] = 0; - return GRIB_ARRAY_TOO_SMALL; - } - - for ( i = 0; i < a->length; i++) - val[i] = grib_handle_of_accessor(a)->buffer->data[a->offset+i]; - val[i] = 0; - len[0] = i; - return GRIB_SUCCESS; + int i = 0; + + if(len[0] < (a->length+1)) + { + grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%d) for %s it contains %d values ", len[0], a->name , a->length+1 ); + len[0] = 0; + return GRIB_ARRAY_TOO_SMALL; + } + + for ( i = 0; i < a->length; i++) + val[i] = grib_handle_of_accessor(a)->buffer->data[a->offset+i]; + val[i] = 0; + len[0] = i; + return GRIB_SUCCESS; } static size_t string_length(grib_accessor* a) { - return a->length; + return a->length; } diff --git a/src/grib_accessor_class_message_copy.c b/src/grib_accessor_class_message_copy.c index 01a04e37e..76f5aaf9a 100644 --- a/src/grib_accessor_class_message_copy.c +++ b/src/grib_accessor_class_message_copy.c @@ -131,42 +131,43 @@ static void init_class(grib_accessor_class* c) static void init(grib_accessor* a, const long length , grib_arguments* args ) { - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->length=0; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->length=0; } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_string(dumper,a,NULL); + grib_dump_string(dumper,a,NULL); } static int get_native_type(grib_accessor* a) { - return GRIB_TYPE_STRING; + return GRIB_TYPE_STRING; } -static int unpack_string (grib_accessor* a, char* val, size_t *len){ - size_t slen=grib_handle_of_accessor(a)->buffer->ulength ; - size_t i; - unsigned char* v=0; +static int unpack_string(grib_accessor* a, char* val, size_t *len) +{ + size_t slen=grib_handle_of_accessor(a)->buffer->ulength ; + size_t i; + unsigned char* v=0; - if (*len < slen) { return GRIB_ARRAY_TOO_SMALL; } - v=grib_handle_of_accessor(a)->buffer->data; - /* replace unprintable characters with space */ - for (i=0;i126) v[i]=32; - memcpy(val,grib_handle_of_accessor(a)->buffer->data,slen); + if (*len < slen) { return GRIB_ARRAY_TOO_SMALL; } + v=grib_handle_of_accessor(a)->buffer->data; + /* replace unprintable characters with space */ + for (i=0;i126) v[i]=32; + memcpy(val,grib_handle_of_accessor(a)->buffer->data,slen); - *len=slen; + *len=slen; - return GRIB_SUCCESS; + return GRIB_SUCCESS; } static size_t string_length(grib_accessor* a) { - return grib_handle_of_accessor(a)->buffer->ulength; + return grib_handle_of_accessor(a)->buffer->ulength; } -static long byte_count(grib_accessor* a) { - return a->length; +static long byte_count(grib_accessor* a) +{ + return a->length; } - diff --git a/src/grib_accessor_class_nearest.c b/src/grib_accessor_class_nearest.c index 2adb1107f..45bf2ac7d 100644 --- a/src/grib_accessor_class_nearest.c +++ b/src/grib_accessor_class_nearest.c @@ -130,32 +130,31 @@ static void init_class(grib_accessor_class* c) static void init(grib_accessor* a,const long l, grib_arguments* args) { - grib_accessor_nearest* self = (grib_accessor_nearest*)a; - self->args = args; + grib_accessor_nearest* self = (grib_accessor_nearest*)a; + self->args = args; } static void dump(grib_accessor* a,grib_dumper* dumper) { - /* TODO: pass args */ - grib_dump_label(dumper,a,NULL); + /* TODO: pass args */ + grib_dump_label(dumper,a,NULL); } grib_nearest* grib_nearest_new(const grib_handle* ch, int* error) { - grib_handle* h = (grib_handle*)ch; - grib_accessor* a = NULL; - grib_accessor_nearest* na =NULL; - grib_nearest* n =NULL; - *error=GRIB_NOT_IMPLEMENTED; - a = grib_find_accessor(h,"NEAREST"); - na = (grib_accessor_nearest*)a; + grib_handle* h = (grib_handle*)ch; + grib_accessor* a = NULL; + grib_accessor_nearest* na =NULL; + grib_nearest* n =NULL; + *error=GRIB_NOT_IMPLEMENTED; + a = grib_find_accessor(h,"NEAREST"); + na = (grib_accessor_nearest*)a; - if (!a) return NULL; + if (!a) return NULL; - n = grib_nearest_factory(h,na->args); + n = grib_nearest_factory(h,na->args); - if (n) *error=GRIB_SUCCESS; + if (n) *error=GRIB_SUCCESS; - return n; + return n; } - diff --git a/src/grib_accessor_class_offset_file.c b/src/grib_accessor_class_offset_file.c index 09d11b5ae..81aedd4e5 100644 --- a/src/grib_accessor_class_offset_file.c +++ b/src/grib_accessor_class_offset_file.c @@ -134,42 +134,39 @@ static void init_class(grib_accessor_class* c) static void init(grib_accessor* a,const long l, grib_arguments* c) { - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->length=0; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->length=0; } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t *len) { - *val = (double)grib_handle_of_accessor(a)->offset; - *len =1; - return 0; + *val = (double)grib_handle_of_accessor(a)->offset; + *len =1; + return 0; } -static int unpack_string(grib_accessor*a , char* v, size_t *len){ +static int unpack_string(grib_accessor*a , char* v, size_t *len) +{ + double val = 0; + size_t l = 1; + char repres[1024]; - double val = 0; - size_t l = 1; - char repres[1024]; + grib_unpack_double (a , &val, &l); - grib_unpack_double (a , &val, &l); + sprintf(repres,"%.0f", val); - sprintf(repres,"%.0f", val); + l = strlen(repres)+1; - l = strlen(repres)+1; + if(l >*len ){ + grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_long : unpack_string : Buffer too small for %s ", a->name ); - if(l >*len ){ - grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_long : unpack_string : Buffer too small for %s ", a->name ); + *len = l; + return GRIB_BUFFER_TOO_SMALL; + } + grib_context_log(a->context,GRIB_LOG_DEBUG, "grib_accessor_long: Casting double %s to string ", a->name); *len = l; - return GRIB_BUFFER_TOO_SMALL; - } - grib_context_log(a->context,GRIB_LOG_DEBUG, "grib_accessor_long: Casting double %s to string ", a->name); - - *len = l; - - strcpy(v,repres); - return GRIB_SUCCESS; - + strcpy(v,repres); + return GRIB_SUCCESS; } - diff --git a/src/grib_accessor_class_pack_bufr_values.c b/src/grib_accessor_class_pack_bufr_values.c index da2f0d44b..d77cc61e7 100644 --- a/src/grib_accessor_class_pack_bufr_values.c +++ b/src/grib_accessor_class_pack_bufr_values.c @@ -134,70 +134,67 @@ static void init_class(grib_accessor_class* c) /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len, grib_arguments* params) { - - char* key; - grib_accessor_pack_bufr_values* self = (grib_accessor_pack_bufr_values*)a; - key = (char*)grib_arguments_get_name(grib_handle_of_accessor(a),params,0); - self->data_accessor=grib_find_accessor(grib_handle_of_accessor(a),key); +static void init(grib_accessor* a, const long len, grib_arguments* params) +{ + char* key; + grib_accessor_pack_bufr_values* self = (grib_accessor_pack_bufr_values*)a; + key = (char*)grib_arguments_get_name(grib_handle_of_accessor(a),params,0); + self->data_accessor=grib_find_accessor(grib_handle_of_accessor(a),key); - a->length = 0; + a->length = 0; } static void dump(grib_accessor* a, grib_dumper* dumper) { - return; } -static int unpack_string_array (grib_accessor* a, char** buffer, size_t *len) +static int unpack_string_array(grib_accessor* a, char** buffer, size_t *len) { - return GRIB_NOT_IMPLEMENTED; + return GRIB_NOT_IMPLEMENTED; } -static int unpack_string (grib_accessor* a, char* buffer, size_t *len) +static int unpack_string(grib_accessor* a, char* buffer, size_t *len) { - return GRIB_NOT_IMPLEMENTED; + return GRIB_NOT_IMPLEMENTED; } -static int unpack_long (grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t *len) { - return GRIB_NOT_IMPLEMENTED; + return GRIB_NOT_IMPLEMENTED; } -static int unpack_double (grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t *len) { - return GRIB_NOT_IMPLEMENTED; + return GRIB_NOT_IMPLEMENTED; } static int value_count(grib_accessor* a,long* count) { - *count=1; - return 0; + *count=1; + return 0; } static void destroy(grib_context* context,grib_accessor* a) { - return; } -static int get_native_type(grib_accessor* a){ - return GRIB_TYPE_LONG; +static int get_native_type(grib_accessor* a) +{ + return GRIB_TYPE_LONG; } -static int pack_long (grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t *len) { - grib_accessor_pack_bufr_values* self = (grib_accessor_pack_bufr_values*)a; - grib_accessor* data=(grib_accessor*)self->data_accessor; + grib_accessor_pack_bufr_values* self = (grib_accessor_pack_bufr_values*)a; + grib_accessor* data=(grib_accessor*)self->data_accessor; - return grib_pack_double(data,0,0); + return grib_pack_double(data,0,0); } - -static int pack_double (grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t *len) { - grib_accessor_pack_bufr_values* self = (grib_accessor_pack_bufr_values*)a; - grib_accessor* data=(grib_accessor*)self->data_accessor; + grib_accessor_pack_bufr_values* self = (grib_accessor_pack_bufr_values*)a; + grib_accessor* data=(grib_accessor*)self->data_accessor; - return grib_pack_double(data,0,0); + return grib_pack_double(data,0,0); } - diff --git a/src/grib_accessor_class_padding.c b/src/grib_accessor_class_padding.c index 48a063666..e391fbed2 100644 --- a/src/grib_accessor_class_padding.c +++ b/src/grib_accessor_class_padding.c @@ -132,33 +132,32 @@ static void init_class(grib_accessor_class* c) /* END_CLASS_IMP */ - static void init(grib_accessor* a, const long len, grib_arguments*arg ) { - a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } -static int compare(grib_accessor* a, grib_accessor* b) { - if (a->length != b->length) return GRIB_COUNT_MISMATCH; - return GRIB_SUCCESS; +static int compare(grib_accessor* a, grib_accessor* b) +{ + if (a->length != b->length) return GRIB_COUNT_MISMATCH; + return GRIB_SUCCESS; } static void update_size(grib_accessor* a,size_t new_size) { - /* printf("update_size: grib_accessor_class_padding.c %ld %ld %s %s\n", (long)new_size,(long)a->length,a->cclass->name,a->name); */ - a->length = new_size; + /* printf("update_size: grib_accessor_class_padding.c %ld %ld %s %s\n", (long)new_size,(long)a->length,a->cclass->name,a->name); */ + a->length = new_size; } static void resize(grib_accessor* a,size_t new_size) { - void* zero = grib_context_malloc_clear(a->context,new_size); - - grib_buffer_replace(a,(const unsigned char*)zero,new_size,1,0); - grib_context_free(a->context,zero); - grib_context_log(a->context,GRIB_LOG_DEBUG,"resize: grib_accessor_class_padding.c %ld %ld %s %s\n",(long)new_size,(long)a->length,a->cclass->name,a->name); - Assert(new_size == a->length); + void* zero = grib_context_malloc_clear(a->context,new_size); + grib_buffer_replace(a,(const unsigned char*)zero,new_size,1,0); + grib_context_free(a->context,zero); + grib_context_log(a->context,GRIB_LOG_DEBUG,"resize: grib_accessor_class_padding.c %ld %ld %s %s\n",(long)new_size,(long)a->length,a->cclass->name,a->name); + Assert(new_size == a->length); } static int value_count(grib_accessor* a,long *c){ *c=a->length; return 0;} diff --git a/src/grib_accessor_class_padtoeven.c b/src/grib_accessor_class_padtoeven.c index 7a9a786a9..ddcb97840 100644 --- a/src/grib_accessor_class_padtoeven.c +++ b/src/grib_accessor_class_padtoeven.c @@ -139,38 +139,36 @@ static void init_class(grib_accessor_class* c) static size_t preferred_size(grib_accessor* a,int from_handle) { - grib_accessor_padtoeven* self = (grib_accessor_padtoeven*)a; - long offset = 0; - long length = 0; - long seclen; + grib_accessor_padtoeven* self = (grib_accessor_padtoeven*)a; + long offset = 0; + long length = 0; + long seclen; - grib_get_long_internal(grib_handle_of_accessor(a),self->section_offset,&offset); - grib_get_long_internal(grib_handle_of_accessor(a),self->section_length,&length); + grib_get_long_internal(grib_handle_of_accessor(a),self->section_offset,&offset); + grib_get_long_internal(grib_handle_of_accessor(a),self->section_length,&length); - if((length%2) && from_handle) { + if((length%2) && from_handle) { #if 0 - grib_context_log(a->context, - GRIB_LOG_ERROR,"GRIB message has an odd length section (%ld, %s)", - (long)length,a->name); + grib_context_log(a->context, + GRIB_LOG_ERROR,"GRIB message has an odd length section (%ld, %s)", + (long)length,a->name); #endif - return 0; + return 0; - } + } - /* printf("EVEN %ld %ld\n",(long) a->offset,(long) offset);*/ + /* printf("EVEN %ld %ld\n",(long) a->offset,(long) offset);*/ + seclen = a->offset - offset; - seclen = a->offset - offset; - - return seclen % 2 ? 1 : 0; + return seclen % 2 ? 1 : 0; } static void init(grib_accessor* a, const long len, grib_arguments* args) { - grib_accessor_padtoeven* self = (grib_accessor_padtoeven*)a; - - self->section_offset = grib_arguments_get_name(grib_handle_of_accessor(a),args,0); - self->section_length = grib_arguments_get_name(grib_handle_of_accessor(a),args,1); + grib_accessor_padtoeven* self = (grib_accessor_padtoeven*)a; - a->length = preferred_size(a,1); + self->section_offset = grib_arguments_get_name(grib_handle_of_accessor(a),args,0); + self->section_length = grib_arguments_get_name(grib_handle_of_accessor(a),args,1); + a->length = preferred_size(a,1); } diff --git a/src/grib_accessor_class_size.c b/src/grib_accessor_class_size.c index dd3922761..c495c8993 100644 --- a/src/grib_accessor_class_size.c +++ b/src/grib_accessor_class_size.c @@ -131,21 +131,20 @@ static void init_class(grib_accessor_class* c) static void init(grib_accessor* a,const long l, grib_arguments* c) { - grib_accessor_size* self = (grib_accessor_size*)a; - self->accessor = grib_arguments_get_name(grib_handle_of_accessor(a),c,0); - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; - a->length=0; + grib_accessor_size* self = (grib_accessor_size*)a; + self->accessor = grib_arguments_get_name(grib_handle_of_accessor(a),c,0); + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; + a->length=0; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t *len) { - int ret=0; - size_t size=0; - grib_accessor_size* self = (grib_accessor_size*)a; - ret=grib_get_size(grib_handle_of_accessor(a),self->accessor,&size); - *val=(long)size; - *len =1; - return ret; + int ret=0; + size_t size=0; + grib_accessor_size* self = (grib_accessor_size*)a; + ret=grib_get_size(grib_handle_of_accessor(a),self->accessor,&size); + *val=(long)size; + *len =1; + return ret; } - diff --git a/src/grib_dumper_class_bufr_encode_filter.c b/src/grib_dumper_class_bufr_encode_filter.c index fce8a6ab2..dfe65b260 100644 --- a/src/grib_dumper_class_bufr_encode_filter.c +++ b/src/grib_dumper_class_bufr_encode_filter.c @@ -20,6 +20,7 @@ IMPLEMENTS = dump_bytes;dump_values IMPLEMENTS = dump_label;dump_section IMPLEMENTS = init;destroy + IMPLEMENTS = header MEMBERS = long section_offset MEMBERS = long begin MEMBERS = long empty @@ -54,6 +55,7 @@ static void dump_bytes (grib_dumper* d, grib_accessor* a,const char* commen static void dump_values (grib_dumper* d, grib_accessor* a); static void dump_label (grib_dumper* d, grib_accessor* a,const char* comment); static void dump_section (grib_dumper* d, grib_accessor* a,grib_block_of_accessors* block); +static void header (grib_dumper*,grib_handle*); typedef struct grib_dumper_bufr_encode_filter { grib_dumper dumper; @@ -85,7 +87,7 @@ static grib_dumper_class _grib_dumper_class_bufr_encode_filter = { &dump_bits, /* dump bits */ &dump_section, /* dump section */ &dump_values, /* dump values */ - 0, /* header */ + &header, /* header */ 0, /* footer */ }; @@ -720,6 +722,31 @@ static void dump_attributes(grib_dumper* d,grib_accessor* a, const char* prefix) a->attributes[i]->flags=flags; i++; } - self->isLeaf=0; - self->isAttribute=0; + self->isLeaf = 0; + self->isAttribute = 0; +} + +static void header(grib_dumper* d, grib_handle* h) +{ + grib_dumper_bufr_encode_filter *self = (grib_dumper_bufr_encode_filter*)d; + char sampleName[128]={0}; + long localSectionPresent, edition, bufrHeaderCentre, isSatellite; + + Assert(h->product_kind == PRODUCT_BUFR); + + grib_get_long(h, "localSectionPresent", &localSectionPresent); + grib_get_long(h, "bufrHeaderCentre", &bufrHeaderCentre); + grib_get_long(h, "edition", &edition); + + if (localSectionPresent && bufrHeaderCentre == 98) { + grib_get_long(h, "isSatellite", &isSatellite); + if (isSatellite) + sprintf(sampleName, "BUFR%ld_local_satellite", edition); + else + sprintf(sampleName, "BUFR%ld_local", edition); + } else { + sprintf(sampleName, "BUFR%ld", edition); + } + + fprintf(self->dumper.out, "# BUFR sample file: %s.tmpl\n", sampleName); } diff --git a/src/grib_dumper_class_grib_encode_C.c b/src/grib_dumper_class_grib_encode_C.c index bb656ec26..110cf74ae 100644 --- a/src/grib_dumper_class_grib_encode_C.c +++ b/src/grib_dumper_class_grib_encode_C.c @@ -86,69 +86,69 @@ static void init_class (grib_dumper_class* c){} static int init(grib_dumper* d) { - /* grib_dumper_grib_encode_C *self = (grib_dumper_grib_encode_C*)d; */ - return GRIB_SUCCESS; + /* grib_dumper_grib_encode_C *self = (grib_dumper_grib_encode_C*)d; */ + return GRIB_SUCCESS; } static int destroy (grib_dumper* d){ - return GRIB_SUCCESS; + return GRIB_SUCCESS; } static void pcomment(FILE* f,long value,const char* p) { - int cr = 0; - fprintf(f,"\n /* %ld = ",value); + int cr = 0; + fprintf(f,"\n /* %ld = ",value); - while(*p) - { - switch(*p) + while(*p) { - case ';': - fprintf(f,"\n "); - cr = 1; - break; - - case ':': - if(cr) - fprintf(f,"\n See "); - else - fprintf(f,". See "); - break; - - default: - fputc(*p,f); - break; + switch(*p) + { + case ';': + fprintf(f,"\n "); + cr = 1; + break; + + case ':': + if(cr) + fprintf(f,"\n See "); + else + fprintf(f,". See "); + break; + + default: + fputc(*p,f); + break; + } + + p++; } - p++; - } - - fprintf(f," */\n"); + fprintf(f," */\n"); } static void dump_long(grib_dumper* d,grib_accessor* a,const char* comment) { - grib_dumper_grib_encode_C *self = (grib_dumper_grib_encode_C*)d; - long value; size_t size = 1; - int err = grib_unpack_long(a,&value,&size); + grib_dumper_grib_encode_C *self = (grib_dumper_grib_encode_C*)d; + long value; size_t size = 1; + int err = grib_unpack_long(a,&value,&size); - if((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY)) - return; + if((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY)) + return; #if 1 - if(comment) pcomment(self->dumper.out,value,comment); + if(comment) pcomment(self->dumper.out,value,comment); #endif - if( ((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && (value == GRIB_MISSING_LONG)) - fprintf(self->dumper.out," GRIB_CHECK(grib_set_missing(h,\"%s\"),%d);\n",a->name,0); - else - fprintf(self->dumper.out," GRIB_CHECK(grib_set_long(h,\"%s\",%ld),%d);\n",a->name,value,0); + if( ((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && (value == GRIB_MISSING_LONG)) + fprintf(self->dumper.out," GRIB_CHECK(grib_set_missing(h,\"%s\"),%d);\n",a->name,0); + else + fprintf(self->dumper.out," GRIB_CHECK(grib_set_long(h,\"%s\",%ld),%d);\n",a->name,value,0); - if(err) - fprintf(self->dumper.out," /* Error accessing %s (%s) */",a->name,grib_get_error_message(err)); + if(err) + fprintf(self->dumper.out," /* Error accessing %s (%s) */",a->name,grib_get_error_message(err)); - if(comment) fprintf(self->dumper.out,"\n"); + if(comment) fprintf(self->dumper.out,"\n"); } @@ -157,302 +157,301 @@ static int test_bit(long a, long b) {return a&(1<flags & GRIB_ACCESSOR_FLAG_READ_ONLY) - return; + if(a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) + return; - if(a->length == 0) - return; + if(a->length == 0) + return; - buf[0] = 0; + buf[0] = 0; - for(i=0;i<(a->length*8);i++) { - if(test_bit(value,a->length*8-i-1)) - strcat(buf,"1"); - else - strcat(buf,"0"); - } + for(i=0;i<(a->length*8);i++) { + if(test_bit(value,a->length*8-i-1)) + strcat(buf,"1"); + else + strcat(buf,"0"); + } - if(comment) { - strcat(buf,";"); - strcat(buf,comment); - } + if(comment) { + strcat(buf,";"); + strcat(buf,comment); + } - pcomment(self->dumper.out,value,buf); + pcomment(self->dumper.out,value,buf); - if(err) - fprintf(self->dumper.out," /* Error accessing %s (%s) */",a->name,grib_get_error_message(err)); - else - fprintf(self->dumper.out," GRIB_CHECK(grib_set_long(h,\"%s\",%ld),%d);\n",a->name,value,0); + if(err) + fprintf(self->dumper.out," /* Error accessing %s (%s) */",a->name,grib_get_error_message(err)); + else + fprintf(self->dumper.out," GRIB_CHECK(grib_set_long(h,\"%s\",%ld),%d);\n",a->name,value,0); - fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out,"\n"); } static void dump_double(grib_dumper* d,grib_accessor* a,const char* comment) { - grib_dumper_grib_encode_C *self = (grib_dumper_grib_encode_C*)d; - double value; size_t size = 1; - int err = grib_unpack_double(a,&value,&size); - if(a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) - return; + grib_dumper_grib_encode_C *self = (grib_dumper_grib_encode_C*)d; + double value; size_t size = 1; + int err = grib_unpack_double(a,&value,&size); + if(a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) + return; - if(a->length == 0) - return; + if(a->length == 0) + return; #if 0 - if(comment) fprintf(self->dumper.out,"/* %s */\n",comment); + if(comment) fprintf(self->dumper.out,"/* %s */\n",comment); #endif - fprintf(self->dumper.out," GRIB_CHECK(grib_set_double(h,\"%s\",%g),%d);\n",a->name,value,0); + fprintf(self->dumper.out," GRIB_CHECK(grib_set_double(h,\"%s\",%g),%d);\n",a->name,value,0); - if(err) - fprintf(self->dumper.out," /* Error accessing %s (%s) */",a->name,grib_get_error_message(err)); + if(err) + fprintf(self->dumper.out," /* Error accessing %s (%s) */",a->name,grib_get_error_message(err)); } static void dump_string(grib_dumper* d,grib_accessor* a,const char* comment) { - grib_dumper_grib_encode_C *self = (grib_dumper_grib_encode_C*)d; - char value[1024]; size_t size = sizeof(value); - int err = grib_unpack_string(a,value,&size); + grib_dumper_grib_encode_C *self = (grib_dumper_grib_encode_C*)d; + char value[1024]; size_t size = sizeof(value); + int err = grib_unpack_string(a,value,&size); - if (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) - return; + if (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) + return; - if(a->length == 0) - return; + if(a->length == 0) + return; #if 1 - if(comment) fprintf(self->dumper.out,"/* %s */\n",comment); + if(comment) fprintf(self->dumper.out,"/* %s */\n",comment); #endif - fprintf(self->dumper.out," p = \"%s\";\n",value); - fprintf(self->dumper.out," size = strlen(p);\n"); - fprintf(self->dumper.out," GRIB_CHECK(grib_set_string(h,\"%s\",p,&size),%d);\n",a->name,0); + fprintf(self->dumper.out," p = \"%s\";\n",value); + fprintf(self->dumper.out," size = strlen(p);\n"); + fprintf(self->dumper.out," GRIB_CHECK(grib_set_string(h,\"%s\",p,&size),%d);\n",a->name,0); - if(err) - fprintf(self->dumper.out," /* Error accessing %s (%s) */",a->name,grib_get_error_message(err)); + if(err) + fprintf(self->dumper.out," /* Error accessing %s (%s) */",a->name,grib_get_error_message(err)); } static void dump_bytes(grib_dumper* d,grib_accessor* a,const char* comment) { - grib_dumper_grib_encode_C *self = (grib_dumper_grib_encode_C*)d; - int err =0; - size_t size = a->length; - unsigned char* buf; + grib_dumper_grib_encode_C *self = (grib_dumper_grib_encode_C*)d; + int err =0; + size_t size = a->length; + unsigned char* buf; - if (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) - return; + if (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) + return; - if(size == 0) - return; + if(size == 0) + return; - buf = (unsigned char*)grib_context_malloc(d->handle->context,size); + buf = (unsigned char*)grib_context_malloc(d->handle->context,size); - if(!buf) - { - fprintf(self->dumper.out,"/* %s: cannot malloc(%ld) */\n",a->name,(long)size); - return; - } + if(!buf) + { + fprintf(self->dumper.out,"/* %s: cannot malloc(%ld) */\n",a->name,(long)size); + return; + } - err = grib_unpack_bytes(a,buf,&size); - if(err){ - grib_context_free(d->handle->context,buf); - fprintf(self->dumper.out," *** ERR=%d (%s) [grib_dumper_grib_encode_C::dump_bytes]\n}",err,grib_get_error_message(err)); - return ; - } + err = grib_unpack_bytes(a,buf,&size); + if(err){ + grib_context_free(d->handle->context,buf); + fprintf(self->dumper.out," *** ERR=%d (%s) [grib_dumper_grib_encode_C::dump_bytes]\n}",err,grib_get_error_message(err)); + return ; + } #if 0 - if(size > 100) { - more = size - 100; - size = 100; - } - - k = 0; - /* if(size > 100) size = 100; */ - while(k < size) - { - int j; - for(i = 0; i < d->depth + 3 ; i++) fprintf(self->dumper.out," "); - for(j = 0; j < 16 && k < size; j++, k++) + if(size > 100) { + more = size - 100; + size = 100; + } + + k = 0; + /* if(size > 100) size = 100; */ + while(k < size) { - fprintf(self->dumper.out,"%02x",buf[k]); - if(k != size-1) - fprintf(self->dumper.out,", "); + int j; + for(i = 0; i < d->depth + 3 ; i++) fprintf(self->dumper.out," "); + for(j = 0; j < 16 && k < size; j++, k++) + { + fprintf(self->dumper.out,"%02x",buf[k]); + if(k != size-1) + fprintf(self->dumper.out,", "); + } + fprintf(self->dumper.out,"\n"); } - fprintf(self->dumper.out,"\n"); - } #endif - grib_context_free(d->handle->context,buf); + grib_context_free(d->handle->context,buf); } static void dump_values(grib_dumper* d,grib_accessor* a) { - grib_dumper_grib_encode_C *self = (grib_dumper_grib_encode_C*)d; - int k,err =0; - double* buf = NULL; - int type=0; - char stype[10]; - size_t size=0; - long count=0; - - stype[0]='\0'; - - if((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) - || ((a->flags & GRIB_ACCESSOR_FLAG_DATA) - && (d->option_flags & GRIB_DUMP_FLAG_NO_DATA) ) ) - return; - - grib_value_count(a,&count); - size=count; - - if(size == 1){ - dump_double(d,a,NULL); - return ; - } - - type=grib_accessor_get_native_type(a); - switch (type) { - case GRIB_TYPE_LONG: - sprintf(stype,"%s","long"); - break; - case GRIB_TYPE_DOUBLE: - sprintf(stype,"%s","double"); - break; - default: - return; - } - - buf = (double*)grib_context_malloc(d->handle->context,size * sizeof(double)); - if(!buf) - { - fprintf(self->dumper.out,"/* %s: cannot malloc(%ld) */\n",a->name,(long)size); - return; - } - - err = grib_unpack_double(a,buf,&size); - - if(err){ + grib_dumper_grib_encode_C *self = (grib_dumper_grib_encode_C*)d; + int k,err =0; + double* buf = NULL; + int type=0; + char stype[10]; + size_t size=0; + long count=0; + + stype[0]='\0'; + + if((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) + || ((a->flags & GRIB_ACCESSOR_FLAG_DATA) + && (d->option_flags & GRIB_DUMP_FLAG_NO_DATA) ) ) + return; + + grib_value_count(a,&count); + size=count; + + if(size == 1){ + dump_double(d,a,NULL); + return ; + } + + type=grib_accessor_get_native_type(a); + switch (type) { + case GRIB_TYPE_LONG: + sprintf(stype,"%s","long"); + break; + case GRIB_TYPE_DOUBLE: + sprintf(stype,"%s","double"); + break; + default: + return; + } + + buf = (double*)grib_context_malloc(d->handle->context,size * sizeof(double)); + if(!buf) + { + fprintf(self->dumper.out,"/* %s: cannot malloc(%ld) */\n",a->name,(long)size); + return; + } + + err = grib_unpack_double(a,buf,&size); + + if(err){ + grib_context_free(d->handle->context,buf); + fprintf(self->dumper.out," /* Error accessing %s (%s) */",a->name,grib_get_error_message(err)); + return ; + } + + fprintf(self->dumper.out," size = %ld;\n",(long)size); + fprintf(self->dumper.out," v%s = (%s*)calloc(size,sizeof(%s));\n",stype,stype,stype); + fprintf(self->dumper.out," if(!v%s) {\n",stype); + fprintf(self->dumper.out," fprintf(stderr,\"failed to allocate %%d bytes\\n\",size*sizeof(%s));\n",stype); + fprintf(self->dumper.out," exit(1);\n"); + fprintf(self->dumper.out," }\n"); + + + fprintf(self->dumper.out,"\n "); + k = 0; + while(k < size) + { + fprintf(self->dumper.out," v%s[%4d] = %7g;",stype,k,buf[k]); + k++; + if(k%4 == 0) fprintf(self->dumper.out,"\n "); + + } + if(size%4) fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out," GRIB_CHECK(grib_set_%s_array(h,\"%s\",v%s,size),%d);\n",stype,a->name,stype,0); + fprintf(self->dumper.out," free(v%s);\n",stype); + grib_context_free(d->handle->context,buf); - fprintf(self->dumper.out," /* Error accessing %s (%s) */",a->name,grib_get_error_message(err)); - return ; - } - - fprintf(self->dumper.out," size = %ld;\n",(long)size); - fprintf(self->dumper.out," v%s = (%s*)calloc(size,sizeof(%s));\n",stype,stype,stype); - fprintf(self->dumper.out," if(!v%s) {\n",stype); - fprintf(self->dumper.out," fprintf(stderr,\"failed to allocate %%d bytes\\n\",size*sizeof(%s));\n",stype); - fprintf(self->dumper.out," exit(1);\n"); - fprintf(self->dumper.out," }\n"); - - - fprintf(self->dumper.out,"\n "); - k = 0; - while(k < size) - { - fprintf(self->dumper.out," v%s[%4d] = %7g;",stype,k,buf[k]); - k++; - if(k%4 == 0) fprintf(self->dumper.out,"\n "); - - } - if(size%4) fprintf(self->dumper.out,"\n"); - fprintf(self->dumper.out,"\n"); - fprintf(self->dumper.out," GRIB_CHECK(grib_set_%s_array(h,\"%s\",v%s,size),%d);\n",stype,a->name,stype,0); - fprintf(self->dumper.out," free(v%s);\n",stype); - - grib_context_free(d->handle->context,buf); } static void dump_label(grib_dumper* d,grib_accessor* a,const char* comment) { - grib_dumper_grib_encode_C *self = (grib_dumper_grib_encode_C*)d; - fprintf(self->dumper.out,"\n /* %s */\n\n",a->name); + grib_dumper_grib_encode_C *self = (grib_dumper_grib_encode_C*)d; + fprintf(self->dumper.out,"\n /* %s */\n\n",a->name); } static void dump_section(grib_dumper* d,grib_accessor* a,grib_block_of_accessors* block) { - /*grib_dumper_grib_encode_C *self = (grib_dumper_grib_encode_C*)d;*/ - grib_dump_accessors_block(d,block); + /*grib_dumper_grib_encode_C *self = (grib_dumper_grib_encode_C*)d;*/ + grib_dump_accessors_block(d,block); } static void header(grib_dumper* d,grib_handle* h) { - long edition=0; - int ret=0; - grib_dumper_grib_encode_C *self = (grib_dumper_grib_encode_C*)d; + long edition=0; + int ret=0; + grib_dumper_grib_encode_C *self = (grib_dumper_grib_encode_C*)d; ret=grib_get_long(h,"editionNumber",&edition); - if (ret != GRIB_SUCCESS) { - grib_context_log(h->context,GRIB_LOG_ERROR,"Unable to get edition number."); - Assert(0); - } - - fprintf(self->dumper.out, - "#include \n" - "\n" - "/* This code was generated automatically */\n" - "\n"); - - fprintf(self->dumper.out, - "\n" - "int main(int argc,const char** argv)\n" - "{\n" - " grib_handle *h = NULL;\n" - " size_t size = 0;\n" - " double* vdouble = NULL;\n" - " long* vlong = NULL;\n" - " FILE* f = NULL;\n" - " const char* p = NULL;\n" - " const void* buffer = NULL;\n" - "\n" - " if(argc != 2) {\n" - " fprintf(stderr,\"usage: %%s out\\n\",argv[0]);\n" - " exit(1);\n" - " }\n" - "\n" - " h = grib_handle_new_from_samples(NULL,\"GRIB%ld\");\n" - " if(!h) {\n" - " fprintf(stderr,\"Cannot create grib handle\\n\");\n" - " exit(1);\n" - " }\n" - "\n",(long)edition + if (ret != GRIB_SUCCESS) { + grib_context_log(h->context,GRIB_LOG_ERROR,"Unable to get edition number."); + Assert(0); + } + + fprintf(self->dumper.out, + "#include \n" + "\n" + "/* This code was generated automatically */\n" + "\n"); + + fprintf(self->dumper.out, + "\n" + "int main(int argc,const char** argv)\n" + "{\n" + " grib_handle *h = NULL;\n" + " size_t size = 0;\n" + " double* vdouble = NULL;\n" + " long* vlong = NULL;\n" + " FILE* f = NULL;\n" + " const char* p = NULL;\n" + " const void* buffer = NULL;\n" + "\n" + " if(argc != 2) {\n" + " fprintf(stderr,\"usage: %%s out\\n\",argv[0]);\n" + " exit(1);\n" + " }\n" + "\n" + " h = grib_handle_new_from_samples(NULL,\"GRIB%ld\");\n" + " if(!h) {\n" + " fprintf(stderr,\"Cannot create grib handle\\n\");\n" + " exit(1);\n" + " }\n" + "\n",(long)edition ); } static void footer(grib_dumper* d,grib_handle* h) { - grib_dumper_grib_encode_C *self = (grib_dumper_grib_encode_C*)d; - - fprintf(self->dumper.out, - - "/* Save the message */\n" - "\n" - " f = fopen(argv[1],\"w\");\n" - " if(!f) {\n" - " perror(argv[1]);\n" - " exit(1);\n" - " }\n" - "\n" - " GRIB_CHECK(grib_get_message(h,&buffer,&size),0);\n" - "\n" - " if(fwrite(buffer,1,size,f) != size) {\n" - " perror(argv[1]);\n" - " exit(1);\n" - " }\n" - "\n" - " if(fclose(f)) {\n" - " perror(argv[1]);\n" - " exit(1);\n" - " }\n" - "\n" - " grib_handle_delete(h);\n" - " return 0;\n" - "}\n" + grib_dumper_grib_encode_C *self = (grib_dumper_grib_encode_C*)d; + + fprintf(self->dumper.out, + "/* Save the message */\n" + "\n" + " f = fopen(argv[1],\"w\");\n" + " if(!f) {\n" + " perror(argv[1]);\n" + " exit(1);\n" + " }\n" + "\n" + " GRIB_CHECK(grib_get_message(h,&buffer,&size),0);\n" + "\n" + " if(fwrite(buffer,1,size,f) != size) {\n" + " perror(argv[1]);\n" + " exit(1);\n" + " }\n" + "\n" + " if(fclose(f)) {\n" + " perror(argv[1]);\n" + " exit(1);\n" + " }\n" + "\n" + " grib_handle_delete(h);\n" + " return 0;\n" + "}\n" ); } diff --git a/src/grib_dumper_class_serialize.c b/src/grib_dumper_class_serialize.c index 85bbb706b..809d547e7 100644 --- a/src/grib_dumper_class_serialize.c +++ b/src/grib_dumper_class_serialize.c @@ -87,46 +87,46 @@ static void init_class (grib_dumper_class* c){} static int init(grib_dumper* d) { - grib_dumper_serialize *self = (grib_dumper_serialize*)d; - self->format = (char*)d->arg; - return GRIB_SUCCESS; + grib_dumper_serialize *self = (grib_dumper_serialize*)d; + self->format = (char*)d->arg; + return GRIB_SUCCESS; } -static int destroy (grib_dumper* d){ - return GRIB_SUCCESS; +static int destroy (grib_dumper* d) +{ + return GRIB_SUCCESS; } static void dump_long(grib_dumper* d,grib_accessor* a,const char* comment) { - grib_dumper_serialize *self = (grib_dumper_serialize*)d; - long value=0; size_t size = 1; - int err = grib_unpack_long(a,&value,&size); + grib_dumper_serialize *self = (grib_dumper_serialize*)d; + long value=0; size_t size = 1; + int err = grib_unpack_long(a,&value,&size); - if( (a->flags & GRIB_ACCESSOR_FLAG_HIDDEN) != 0 ) - return; + if( (a->flags & GRIB_ACCESSOR_FLAG_HIDDEN) != 0 ) + return; - if( (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0 && - (d->option_flags & GRIB_DUMP_FLAG_READ_ONLY) == 0 && - (strcmp(a->cclass->name,"lookup") != 0) ) - return; + if( (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0 && + (d->option_flags & GRIB_DUMP_FLAG_READ_ONLY) == 0 && + (strcmp(a->cclass->name,"lookup") != 0) ) + return; - if( ((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && (value == GRIB_MISSING_LONG)) - fprintf(self->dumper.out,"%s = MISSING", a->name); - else - fprintf(self->dumper.out,"%s = %ld", a->name,value); + if( ((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && (value == GRIB_MISSING_LONG)) + fprintf(self->dumper.out,"%s = MISSING", a->name); + else + fprintf(self->dumper.out,"%s = %ld", a->name,value); - if ( ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) && - (strcmp(a->cclass->name,"lookup") != 0) ) - fprintf(self->dumper.out," (read_only)"); + if ( ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) && + (strcmp(a->cclass->name,"lookup") != 0) ) + fprintf(self->dumper.out," (read_only)"); #if 0 - if(comment) fprintf(self->dumper.out," [%s]",comment); + if(comment) fprintf(self->dumper.out," [%s]",comment); #endif - if(err) - fprintf(self->dumper.out," *** ERR=%d (%s) [grib_dumper_serialize::dump_long]",err,grib_get_error_message(err)); - - fprintf(self->dumper.out,"\n"); + if(err) + fprintf(self->dumper.out," *** ERR=%d (%s) [grib_dumper_serialize::dump_long]",err,grib_get_error_message(err)); + fprintf(self->dumper.out,"\n"); } #if 0 @@ -135,299 +135,292 @@ static int test_bit(long a, long b) {return a&(1<flags & GRIB_ACCESSOR_FLAG_HIDDEN) != 0 ) - return; + if( (a->flags & GRIB_ACCESSOR_FLAG_HIDDEN) != 0 ) + return; - if( (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0 && - (d->option_flags & GRIB_DUMP_FLAG_READ_ONLY) == 0) - return; + if( (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0 && + (d->option_flags & GRIB_DUMP_FLAG_READ_ONLY) == 0) + return; - fprintf(self->dumper.out,"%s = %ld ", a->name,value); + fprintf(self->dumper.out,"%s = %ld ", a->name,value); #if 0 - fprintf(self->dumper.out,"["); - for(i=0;i<(a->length*8);i++) { - if(test_bit(value,a->length*8-i-1)) - fprintf(self->dumper.out,"1"); - else - fprintf(self->dumper.out,"0"); - } + fprintf(self->dumper.out,"["); + for(i=0;i<(a->length*8);i++) { + if(test_bit(value,a->length*8-i-1)) + fprintf(self->dumper.out,"1"); + else + fprintf(self->dumper.out,"0"); + } - if(comment) - fprintf(self->dumper.out,":%s]",comment); - else - fprintf(self->dumper.out,"]"); + if(comment) + fprintf(self->dumper.out,":%s]",comment); + else + fprintf(self->dumper.out,"]"); #endif - if(err) - fprintf(self->dumper.out," *** ERR=%d (%s)",err,grib_get_error_message(err)); - - fprintf(self->dumper.out,"\n"); + if(err) + fprintf(self->dumper.out," *** ERR=%d (%s)",err,grib_get_error_message(err)); + fprintf(self->dumper.out,"\n"); } static void dump_double(grib_dumper* d,grib_accessor* a,const char* comment) { - grib_dumper_serialize *self = (grib_dumper_serialize*)d; - double value; size_t size = 1; - int err = grib_unpack_double(a,&value,&size); - - if( (a->flags & GRIB_ACCESSOR_FLAG_HIDDEN) != 0 ) - return; + grib_dumper_serialize *self = (grib_dumper_serialize*)d; + double value; size_t size = 1; + int err = grib_unpack_double(a,&value,&size); - if( (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0 && - (d->option_flags & GRIB_DUMP_FLAG_READ_ONLY) == 0) - return; + if( (a->flags & GRIB_ACCESSOR_FLAG_HIDDEN) != 0 ) + return; + if( (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0 && + (d->option_flags & GRIB_DUMP_FLAG_READ_ONLY) == 0) + return; - if( ((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && (value == GRIB_MISSING_DOUBLE)) - fprintf(self->dumper.out,"%s = MISSING", a->name); - else - fprintf(self->dumper.out,"%s = %g",a->name,value); + if( ((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && (value == GRIB_MISSING_DOUBLE)) + fprintf(self->dumper.out,"%s = MISSING", a->name); + else + fprintf(self->dumper.out,"%s = %g",a->name,value); - if ( (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0 ) fprintf(self->dumper.out," (read_only)"); + if ( (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0 ) fprintf(self->dumper.out," (read_only)"); #if 0 - if(comment) fprintf(self->dumper.out," [%s]",comment); + if(comment) fprintf(self->dumper.out," [%s]",comment); #endif - if(err) - fprintf(self->dumper.out," *** ERR=%d (%s) [grib_dumper_serialize::dump_double]",err,grib_get_error_message(err)); - fprintf(self->dumper.out,"\n"); - + if(err) + fprintf(self->dumper.out," *** ERR=%d (%s) [grib_dumper_serialize::dump_double]",err,grib_get_error_message(err)); + fprintf(self->dumper.out,"\n"); } static void dump_string(grib_dumper* d,grib_accessor* a,const char* comment) { - grib_dumper_serialize *self = (grib_dumper_serialize*)d; - char value[1024]={0,}; size_t size = sizeof(value); - int err = grib_unpack_string(a,value,&size); - int i; + grib_dumper_serialize *self = (grib_dumper_serialize*)d; + char value[1024]={0,}; size_t size = sizeof(value); + int err = grib_unpack_string(a,value,&size); + int i; - char *p = value; + char *p = value; - if( (a->flags & GRIB_ACCESSOR_FLAG_HIDDEN) != 0 ) - return; + if( (a->flags & GRIB_ACCESSOR_FLAG_HIDDEN) != 0 ) + return; - if( (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0 && - (d->option_flags & GRIB_DUMP_FLAG_READ_ONLY) == 0) - return; + if( (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0 && + (d->option_flags & GRIB_DUMP_FLAG_READ_ONLY) == 0) + return; - while(*p) { if(!isprint(*p)) *p = '.'; p++; } + while(*p) { if(!isprint(*p)) *p = '.'; p++; } - for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," "); + for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," "); - - - fprintf(self->dumper.out,"%s = %s", a->name,value); - if ( (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0 ) fprintf(self->dumper.out," (read_only)"); + fprintf(self->dumper.out,"%s = %s", a->name,value); + if ( (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0 ) fprintf(self->dumper.out," (read_only)"); #if 0 - if(comment) fprintf(self->dumper.out," [%s]",comment); + if(comment) fprintf(self->dumper.out," [%s]",comment); #endif - if(err) - fprintf(self->dumper.out," *** ERR=%d (%s) [grib_dumper_serialize::dump_string]",err,grib_get_error_message(err)); - fprintf(self->dumper.out,"\n"); + if(err) + fprintf(self->dumper.out," *** ERR=%d (%s) [grib_dumper_serialize::dump_string]",err,grib_get_error_message(err)); + fprintf(self->dumper.out,"\n"); } static void dump_bytes(grib_dumper* d,grib_accessor* a,const char* comment) { - grib_dumper_serialize *self = (grib_dumper_serialize*)d; - int i,k,err =0; - int more = 0; - size_t size = a->length; - unsigned char* buf = (unsigned char*)grib_context_malloc(d->handle->context,size); - - if( (a->flags & GRIB_ACCESSOR_FLAG_HIDDEN) != 0 ) - return; - - if( (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0 && - (d->option_flags & GRIB_DUMP_FLAG_READ_ONLY) == 0) - return; - - for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"%s = (%ld) {", a->name,a->length); - - if(!buf) - { - if(size == 0) - fprintf(self->dumper.out,"}\n"); - else - fprintf(self->dumper.out," *** ERR cannot malloc(%ld) }\n",(long)size); - return; - } + grib_dumper_serialize *self = (grib_dumper_serialize*)d; + int i,k,err =0; + int more = 0; + size_t size = a->length; + unsigned char* buf = (unsigned char*)grib_context_malloc(d->handle->context,size); - fprintf(self->dumper.out,"\n"); + if( (a->flags & GRIB_ACCESSOR_FLAG_HIDDEN) != 0 ) + return; - err = grib_unpack_bytes(a,buf,&size); - if(err){ - grib_context_free(d->handle->context,buf); - fprintf(self->dumper.out," *** ERR=%d (%s) [grib_dumper_serialize::dump_bytes]\n}",err,grib_get_error_message(err)); - return ; - } - - if(size > 100) { - more = size - 100; - size = 100; - } - - k = 0; - /* if(size > 100) size = 100; */ - while(k < size) - { - int j; - for(i = 0; i < d->depth + 3 ; i++) fprintf(self->dumper.out," "); - for(j = 0; j < 16 && k < size; j++, k++) + if( (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0 && + (d->option_flags & GRIB_DUMP_FLAG_READ_ONLY) == 0) + return; + + for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," "); + fprintf(self->dumper.out,"%s = (%ld) {", a->name,a->length); + + if(!buf) { - fprintf(self->dumper.out,"%02x",buf[k]); - if(k != size-1) - fprintf(self->dumper.out,", "); + if(size == 0) + fprintf(self->dumper.out,"}\n"); + else + fprintf(self->dumper.out," *** ERR cannot malloc(%ld) }\n",(long)size); + return; } + fprintf(self->dumper.out,"\n"); - } - if(more) - { - for(i = 0; i < d->depth + 3 ; i++) fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"... %d more values\n",more); - } + err = grib_unpack_bytes(a,buf,&size); + if(err){ + grib_context_free(d->handle->context,buf); + fprintf(self->dumper.out," *** ERR=%d (%s) [grib_dumper_serialize::dump_bytes]\n}",err,grib_get_error_message(err)); + return ; + } + + if(size > 100) { + more = size - 100; + size = 100; + } + + k = 0; + /* if(size > 100) size = 100; */ + while(k < size) + { + int j; + for(i = 0; i < d->depth + 3 ; i++) fprintf(self->dumper.out," "); + for(j = 0; j < 16 && k < size; j++, k++) + { + fprintf(self->dumper.out,"%02x",buf[k]); + if(k != size-1) + fprintf(self->dumper.out,", "); + } + fprintf(self->dumper.out,"\n"); + } - for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"} # %s %s \n",a->creator->op, a->name); - grib_context_free(d->handle->context,buf); + if(more) + { + for(i = 0; i < d->depth + 3 ; i++) fprintf(self->dumper.out," "); + fprintf(self->dumper.out,"... %d more values\n",more); + } + + for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," "); + fprintf(self->dumper.out,"} # %s %s \n",a->creator->op, a->name); + grib_context_free(d->handle->context,buf); } static void dump_values(grib_dumper* d,grib_accessor* a) { - grib_dumper_serialize *self = (grib_dumper_serialize*)d; - int k,err =0; - double* buf = NULL; - int last=0; - int columns=4; - char* values_format=NULL; - char* default_format="%.16e"; - char* columns_str=NULL; - size_t len=0; - char* pc=NULL; - char* pcf=NULL; - size_t size=0; - long count=0; - values_format=default_format; - - if((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY)) - return; - - grib_value_count(a,&count); - size=count; - - if (self->format) { - if (self->format[0]=='\"') values_format=self->format+1; - else values_format=self->format; - last=strlen(values_format)-1; - if (values_format[last]=='\"') values_format[last]='\0'; - } - - - pc = values_format; - pcf = values_format; - while( *pc!='\0' && *pc != '%') pc++; - if (strlen(pc) > 1 ) { - values_format=pc; - len=pc-pcf; - } else { + grib_dumper_serialize *self = (grib_dumper_serialize*)d; + int k,err =0; + double* buf = NULL; + int last=0; + int columns=4; + char* values_format=NULL; + char* default_format="%.16e"; + char* columns_str=NULL; + size_t len=0; + char* pc=NULL; + char* pcf=NULL; + size_t size=0; + long count=0; values_format=default_format; - len=0; - } - if (len>0) { - columns_str=(char*)malloc((len+1)*sizeof(char)); - Assert(columns_str); - columns_str=(char*)memcpy(columns_str,pcf,len); - columns_str[len]='\0'; - columns=atoi(columns_str); - free(columns_str); - } + if((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY)) + return; - if(size == 1){ - dump_double(d,a,NULL); - return ; - } + grib_value_count(a,&count); + size=count; - if ((d->option_flags & GRIB_DUMP_FLAG_VALUES) == 0 ) return; + if (self->format) { + if (self->format[0]=='\"') values_format=self->format+1; + else values_format=self->format; + last=strlen(values_format)-1; + if (values_format[last]=='\"') values_format[last]='\0'; + } - buf = (double*)grib_context_malloc(d->handle->context,size * sizeof(double)); + pc = values_format; + pcf = values_format; + while( *pc!='\0' && *pc != '%') pc++; + if (strlen(pc) > 1 ) { + values_format=pc; + len=pc-pcf; + } else { + values_format=default_format; + len=0; + } - fprintf(self->dumper.out,"%s (%ld) {",a->name,(long)size); + if (len>0) { + columns_str=(char*)malloc((len+1)*sizeof(char)); + Assert(columns_str); + columns_str=(char*)memcpy(columns_str,pcf,len); + columns_str[len]='\0'; + columns=atoi(columns_str); + free(columns_str); + } - if(!buf) - { - if(size == 0) - fprintf(self->dumper.out,"}\n"); - else - fprintf(self->dumper.out," *** ERR cannot malloc(%ld) }\n",(long)size); - return; - } + if(size == 1){ + dump_double(d,a,NULL); + return ; + } - fprintf(self->dumper.out,"\n"); + if ((d->option_flags & GRIB_DUMP_FLAG_VALUES) == 0 ) return; - err = grib_unpack_double(a,buf,&size); + buf = (double*)grib_context_malloc(d->handle->context,size * sizeof(double)); - if(err){ - grib_context_free(d->handle->context,buf); - fprintf(self->dumper.out," *** ERR=%d (%s) [grib_dumper_serialize::dump_values]\n}",err,grib_get_error_message(err)); - return ; - } - - k = 0; - while(k < size) - { - int j; - for(j = 0; j < columns && k < size; j++, k++) + fprintf(self->dumper.out,"%s (%ld) {",a->name,(long)size); + + if(!buf) { - fprintf(self->dumper.out,values_format,buf[k]); - if(k != size-1) - fprintf(self->dumper.out,", "); + if(size == 0) + fprintf(self->dumper.out,"}\n"); + else + fprintf(self->dumper.out," *** ERR cannot malloc(%ld) }\n",(long)size); + return; } + fprintf(self->dumper.out,"\n"); - } - fprintf(self->dumper.out,"}\n"); - grib_context_free(d->handle->context,buf); + + err = grib_unpack_double(a,buf,&size); + + if(err){ + grib_context_free(d->handle->context,buf); + fprintf(self->dumper.out," *** ERR=%d (%s) [grib_dumper_serialize::dump_values]\n}",err,grib_get_error_message(err)); + return ; + } + + k = 0; + while(k < size) + { + int j; + for(j = 0; j < columns && k < size; j++, k++) + { + fprintf(self->dumper.out,values_format,buf[k]); + if(k != size-1) + fprintf(self->dumper.out,", "); + } + fprintf(self->dumper.out,"\n"); + } + fprintf(self->dumper.out,"}\n"); + grib_context_free(d->handle->context,buf); } static void dump_label(grib_dumper* d,grib_accessor* a,const char* comment) { #if 0 - grib_dumper_serialize *self = (grib_dumper_serialize*)d; - int i; - for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"----> %s %s %s\n",a->creator->op, a->name,comment?comment:""); + grib_dumper_serialize *self = (grib_dumper_serialize*)d; + int i; + for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," "); + fprintf(self->dumper.out,"----> %s %s %s\n",a->creator->op, a->name,comment?comment:""); #endif } static void dump_section(grib_dumper* d,grib_accessor* a,grib_block_of_accessors* block) { - const char* secstr="section"; - int len=0; - grib_dumper_serialize *self = (grib_dumper_serialize*)d; - - len=strlen(secstr); + const char* secstr="section"; + int len=0; + grib_dumper_serialize *self = (grib_dumper_serialize*)d; - if(a->name[0] == '_'){ - grib_dump_accessors_block(d,block); - return; - } + len=strlen(secstr); - if (strncmp(secstr,a->name,len)==0) - fprintf(self->dumper.out,"#------ %s -------\n",a->name); + if(a->name[0] == '_'){ + grib_dump_accessors_block(d,block); + return; + } + if (strncmp(secstr,a->name,len)==0) + fprintf(self->dumper.out,"#------ %s -------\n",a->name); - grib_dump_accessors_block(d,block); + grib_dump_accessors_block(d,block); #if 0 - fprintf(self->dumper.out,"<------ %s %s\n",a->creator->op, a->name); + fprintf(self->dumper.out,"<------ %s %s\n",a->creator->op, a->name); #endif } diff --git a/src/grib_expression_class_is_in_list.c b/src/grib_expression_class_is_in_list.c index 51cf8c057..0fb44b4fb 100644 --- a/src/grib_expression_class_is_in_list.c +++ b/src/grib_expression_class_is_in_list.c @@ -91,167 +91,164 @@ static void init_class(grib_expression_class* c) /* END_CLASS_IMP */ -static grib_trie* load_list(grib_context* c,grib_expression* e, int* err) { - - grib_expression_is_in_list* self = (grib_expression_is_in_list*)e; - - char* filename=NULL; - char line[1024]={0,}; - grib_trie* list=NULL; - FILE* f=NULL; - - *err=GRIB_SUCCESS; - - filename=grib_context_full_defs_path(c,self->list); - if (!filename) { - grib_context_log(c,GRIB_LOG_ERROR,"unable to find def file %s",self->list); - *err=GRIB_FILE_NOT_FOUND; - return NULL; - } else { - grib_context_log(c,GRIB_LOG_DEBUG,"found def file %s",filename); - } - list=(grib_trie*)grib_trie_get(c->lists,filename); - if (list) { - grib_context_log(c,GRIB_LOG_DEBUG,"using list %s from cache",self->list); - return list; - } else { - grib_context_log(c,GRIB_LOG_DEBUG,"using list %s from file %s",self->list,filename); - } - - f=codes_fopen(filename,"r"); - if (!f) {*err=GRIB_IO_PROBLEM; return NULL;} - - list=grib_trie_new(c); - - while(fgets(line,sizeof(line)-1,f)) { - unsigned char* p=(unsigned char*)line; - while (*p!=0) { - if (*p<33) {*p=0; break;} - p++; - } - grib_trie_insert(list,line,line); - } - - grib_trie_insert(c->lists,filename,list); - - fclose(f); - - return list; - +static grib_trie* load_list(grib_context* c,grib_expression* e, int* err) +{ + grib_expression_is_in_list* self = (grib_expression_is_in_list*)e; + + char* filename=NULL; + char line[1024]={0,}; + grib_trie* list=NULL; + FILE* f=NULL; + + *err=GRIB_SUCCESS; + + filename=grib_context_full_defs_path(c,self->list); + if (!filename) { + grib_context_log(c,GRIB_LOG_ERROR,"unable to find def file %s",self->list); + *err=GRIB_FILE_NOT_FOUND; + return NULL; + } else { + grib_context_log(c,GRIB_LOG_DEBUG,"found def file %s",filename); + } + list=(grib_trie*)grib_trie_get(c->lists,filename); + if (list) { + grib_context_log(c,GRIB_LOG_DEBUG,"using list %s from cache",self->list); + return list; + } else { + grib_context_log(c,GRIB_LOG_DEBUG,"using list %s from file %s",self->list,filename); + } + + f=codes_fopen(filename,"r"); + if (!f) {*err=GRIB_IO_PROBLEM; return NULL;} + + list=grib_trie_new(c); + + while(fgets(line,sizeof(line)-1,f)) { + unsigned char* p=(unsigned char*)line; + while (*p!=0) { + if (*p<33) {*p=0; break;} + p++; + } + grib_trie_insert(list,line,line); + } + + grib_trie_insert(c->lists,filename,list); + + fclose(f); + + return list; } static const char* get_name(grib_expression* g) { - grib_expression_is_in_list* e = (grib_expression_is_in_list*)g; - return e->name; + grib_expression_is_in_list* e = (grib_expression_is_in_list*)g; + return e->name; } static int evaluate_long(grib_expression* g,grib_handle *h,long* result) { - grib_expression_is_in_list* e = (grib_expression_is_in_list*)g; - int err=0; - char mybuf[1024]={0,}; - size_t size=1024; + grib_expression_is_in_list* e = (grib_expression_is_in_list*)g; + int err=0; + char mybuf[1024]={0,}; + size_t size=1024; - grib_trie* list=load_list(h->context,g,&err); + grib_trie* list=load_list(h->context,g,&err); - if((err=grib_get_string_internal(h,e->name,mybuf,&size)) != GRIB_SUCCESS) - return err; + if((err=grib_get_string_internal(h,e->name,mybuf,&size)) != GRIB_SUCCESS) + return err; - if (grib_trie_get(list,mybuf)) *result=1; - else *result=0; + if (grib_trie_get(list,mybuf)) *result=1; + else *result=0; - return err; + return err; } static int evaluate_double(grib_expression *g,grib_handle *h,double* result) { - grib_expression_is_in_list* e = (grib_expression_is_in_list*)g; - int err=0; - char mybuf[1024]={0,}; - size_t size=1024; + grib_expression_is_in_list* e = (grib_expression_is_in_list*)g; + int err=0; + char mybuf[1024]={0,}; + size_t size=1024; - grib_trie* list=load_list(h->context,g,&err); + grib_trie* list=load_list(h->context,g,&err); - if((err=grib_get_string_internal(h,e->name,mybuf,&size)) != GRIB_SUCCESS) - return err; + if((err=grib_get_string_internal(h,e->name,mybuf,&size)) != GRIB_SUCCESS) + return err; - if (grib_trie_get(list,mybuf)) *result=1; - else *result=0; + if (grib_trie_get(list,mybuf)) *result=1; + else *result=0; - return err; + return err; } static string evaluate_string(grib_expression* g,grib_handle* h,char* buf,size_t* size,int* err) { - grib_expression_is_in_list* e = (grib_expression_is_in_list*)g; - char mybuf[1024]={0,}; - size_t sizebuf=1024; - long result; + grib_expression_is_in_list* e = (grib_expression_is_in_list*)g; + char mybuf[1024]={0,}; + size_t sizebuf=1024; + long result; - grib_trie* list=load_list(h->context,g,err); + grib_trie* list=load_list(h->context,g,err); - if((*err=grib_get_string_internal(h,e->name,mybuf,&sizebuf)) != GRIB_SUCCESS) - return NULL; + if((*err=grib_get_string_internal(h,e->name,mybuf,&sizebuf)) != GRIB_SUCCESS) + return NULL; - if (grib_trie_get(list,mybuf)) result=1; - else result=0; + if (grib_trie_get(list,mybuf)) result=1; + else result=0; - sprintf(buf,"%ld",result); - *size=strlen(buf); - return buf; + sprintf(buf,"%ld",result); + *size=strlen(buf); + return buf; } static void print(grib_context* c,grib_expression* g,grib_handle* f) { - grib_expression_is_in_list* e = (grib_expression_is_in_list*)g; - printf("access('%s",e->name); - if(f) - { - long s = 0; - grib_get_long(f,e->name,&s); - printf("=%ld",s); - } - printf("')"); + grib_expression_is_in_list* e = (grib_expression_is_in_list*)g; + printf("access('%s",e->name); + if(f) + { + long s = 0; + grib_get_long(f,e->name,&s); + printf("=%ld",s); + } + printf("')"); } static void destroy(grib_context* c,grib_expression* g) { } +static void add_dependency(grib_expression* g, grib_accessor* observer){ + grib_expression_is_in_list* e = (grib_expression_is_in_list*)g; + grib_accessor *observed = grib_find_accessor(grib_handle_of_accessor(observer),e->name); -static void add_dependency(grib_expression* g, grib_accessor* observer){ - grib_expression_is_in_list* e = (grib_expression_is_in_list*)g; - grib_accessor *observed = grib_find_accessor(grib_handle_of_accessor(observer),e->name); - - if(!observed) - { - /* grib_context_log(observer->context, GRIB_LOG_ERROR, */ - /* "Error in accessor_add_dependency: cannot find [%s]", e->name); */ - /* Assert(observed); */ - return; - } + if(!observed) + { + /* grib_context_log(observer->context, GRIB_LOG_ERROR, */ + /* "Error in accessor_add_dependency: cannot find [%s]", e->name); */ + /* Assert(observed); */ + return; + } - grib_dependency_add(observer,observed); + grib_dependency_add(observer,observed); } grib_expression* new_is_in_list_expression(grib_context* c,const char* name,const char* list) { - grib_expression_is_in_list* e = (grib_expression_is_in_list*)grib_context_malloc_clear_persistent(c,sizeof(grib_expression_is_in_list)); - e->base.cclass = grib_expression_class_is_in_list; - e->name = grib_context_strdup_persistent(c,name); - e->list = grib_context_strdup_persistent(c,list); - return (grib_expression*)e; + grib_expression_is_in_list* e = (grib_expression_is_in_list*)grib_context_malloc_clear_persistent(c,sizeof(grib_expression_is_in_list)); + e->base.cclass = grib_expression_class_is_in_list; + e->name = grib_context_strdup_persistent(c,name); + e->list = grib_context_strdup_persistent(c,list); + return (grib_expression*)e; } static int native_type(grib_expression* g,grib_handle *h) { - grib_expression_is_in_list* e = (grib_expression_is_in_list*)g; - int type = 0; - int err; - if((err=grib_get_native_type(h,e->name,&type)) != GRIB_SUCCESS) - grib_context_log(h->context, GRIB_LOG_ERROR, - "Error in native_type %s : %s", e->name,grib_get_error_message(err)); - return type; + grib_expression_is_in_list* e = (grib_expression_is_in_list*)g; + int type = 0; + int err; + if((err=grib_get_native_type(h,e->name,&type)) != GRIB_SUCCESS) + grib_context_log(h->context, GRIB_LOG_ERROR, + "Error in native_type %s : %s", e->name,grib_get_error_message(err)); + return type; } - diff --git a/src/grib_expression_class_is_integer.c b/src/grib_expression_class_is_integer.c index 6933f7365..1eed17568 100644 --- a/src/grib_expression_class_is_integer.c +++ b/src/grib_expression_class_is_integer.c @@ -94,113 +94,112 @@ static void init_class(grib_expression_class* c) static const char* get_name(grib_expression* g) { - grib_expression_is_integer* e = (grib_expression_is_integer*)g; - return e->name; + grib_expression_is_integer* e = (grib_expression_is_integer*)g; + return e->name; } static int evaluate_long(grib_expression* g,grib_handle *h,long* result) { - grib_expression_is_integer* e = (grib_expression_is_integer*)g; - int err=0; - char mybuf[1024]={0,}; - size_t size=1024; - char *p=0; - long val=0; - char* start=0; + grib_expression_is_integer* e = (grib_expression_is_integer*)g; + int err=0; + char mybuf[1024]={0,}; + size_t size=1024; + char *p=0; + long val=0; + char* start=0; - if((err=grib_get_string_internal(h,e->name,mybuf,&size)) != GRIB_SUCCESS) - return err; + if((err=grib_get_string_internal(h,e->name,mybuf,&size)) != GRIB_SUCCESS) + return err; - start=mybuf+e->start; + start=mybuf+e->start; - if (e->length > 0 ) start[e->length]=0; + if (e->length > 0 ) start[e->length]=0; - val=strtol(start,&p,10); + val=strtol(start,&p,10); - if (*p!=0) - *result=0; - else - *result=1; + if (*p!=0) + *result=0; + else + *result=1; - (void)val; - return err; + (void)val; + return err; } static int evaluate_double(grib_expression *g,grib_handle *h,double* result) { - int err=0; - long lresult=0; + int err=0; + long lresult=0; - err=evaluate_long(g,h,&lresult); - *result=lresult; - return err; + err=evaluate_long(g,h,&lresult); + *result=lresult; + return err; } static string evaluate_string(grib_expression* g,grib_handle* h,char* buf,size_t* size,int* err) { - long lresult=0; - double dresult=0.0; + long lresult=0; + double dresult=0.0; - switch (grib_expression_native_type(h, g)) { + switch (grib_expression_native_type(h, g)) { case GRIB_TYPE_LONG: - *err=evaluate_long(g,h,&lresult); - sprintf(buf,"%ld",lresult); - break; + *err=evaluate_long(g,h,&lresult); + sprintf(buf,"%ld",lresult); + break; case GRIB_TYPE_DOUBLE: - *err=evaluate_double(g,h,&dresult); - sprintf(buf,"%g",dresult); - break; - } - return buf; + *err=evaluate_double(g,h,&dresult); + sprintf(buf,"%g",dresult); + break; + } + return buf; } static void print(grib_context* c,grib_expression* g,grib_handle* f) { - grib_expression_is_integer* e = (grib_expression_is_integer*)g; - printf("access('%s",e->name); - if(f) - { - long s = 0; - grib_get_long(f,e->name,&s); - printf("=%ld",s); - } - printf("')"); + grib_expression_is_integer* e = (grib_expression_is_integer*)g; + printf("access('%s",e->name); + if(f) + { + long s = 0; + grib_get_long(f,e->name,&s); + printf("=%ld",s); + } + printf("')"); } static void destroy(grib_context* c,grib_expression* g) { - grib_expression_is_integer* e = (grib_expression_is_integer*)g; - grib_context_free_persistent(c,e->name); + grib_expression_is_integer* e = (grib_expression_is_integer*)g; + grib_context_free_persistent(c,e->name); } -static void add_dependency(grib_expression* g, grib_accessor* observer){ - grib_expression_is_integer* e = (grib_expression_is_integer*)g; - grib_accessor *observed = grib_find_accessor(grib_handle_of_accessor(observer),e->name); +static void add_dependency(grib_expression* g, grib_accessor* observer){ + grib_expression_is_integer* e = (grib_expression_is_integer*)g; + grib_accessor *observed = grib_find_accessor(grib_handle_of_accessor(observer),e->name); - if(!observed) - { - /* grib_context_log(observer->context, GRIB_LOG_ERROR, */ - /* "Error in accessor_add_dependency: cannot find [%s]", e->name); */ - /* Assert(observed); */ - return; - } + if(!observed) + { + /* grib_context_log(observer->context, GRIB_LOG_ERROR, */ + /* "Error in accessor_add_dependency: cannot find [%s]", e->name); */ + /* Assert(observed); */ + return; + } - grib_dependency_add(observer,observed); + grib_dependency_add(observer,observed); } grib_expression* new_is_integer_expression(grib_context* c,const char *name,int start,int length) { - grib_expression_is_integer* e = (grib_expression_is_integer*)grib_context_malloc_clear_persistent(c,sizeof(grib_expression_is_integer)); - e->base.cclass = grib_expression_class_is_integer; - e->name = grib_context_strdup_persistent(c,name); - e->start = start; - e->length = length; - return (grib_expression*)e; + grib_expression_is_integer* e = (grib_expression_is_integer*)grib_context_malloc_clear_persistent(c,sizeof(grib_expression_is_integer)); + e->base.cclass = grib_expression_class_is_integer; + e->name = grib_context_strdup_persistent(c,name); + e->start = start; + e->length = length; + return (grib_expression*)e; } static int native_type(grib_expression* g,grib_handle *h) { - return GRIB_TYPE_LONG; + return GRIB_TYPE_LONG; } - diff --git a/tigge/tigge_check.h b/tigge/tigge_check.h index 67a0420c1..2f9b0fe48 100644 --- a/tigge/tigge_check.h +++ b/tigge/tigge_check.h @@ -3869,10 +3869,12 @@ uerra, eswi-enfo:total_cloud_cover_sfc maximum value 96.4844 is not in [100,100] {"parameterNumber", GRIB_TYPE_LONG, 2}, {"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 160}, + {"scaleFactorOfFirstFixedSurface", GRIB_TYPE_LONG, 0}, + {"scaledValueOfFirstFixedSurface", GRIB_TYPE_LONG, 0}, {NULL, }, }, - {&daily_average, &predefined_level, &has_bitmap}, + {&daily_average, &given_level, &has_bitmap}, }, { "northward_sea_water_velocity_o2d.s2", @@ -3889,10 +3891,12 @@ uerra, eswi-enfo:total_cloud_cover_sfc maximum value 96.4844 is not in [100,100] {"parameterNumber", GRIB_TYPE_LONG, 3}, {"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 160}, + {"scaleFactorOfFirstFixedSurface", GRIB_TYPE_LONG, 0}, + {"scaledValueOfFirstFixedSurface", GRIB_TYPE_LONG, 0}, {NULL, }, }, - {&daily_average, &predefined_level, &has_bitmap}, + {&daily_average, &given_level, &has_bitmap}, }, { "sea-ice_thickness_o2d.s2", From 8c9c9970f3cfff8ccf82491f4f7a41dd7eee8d05 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 10 Jan 2020 12:24:10 +0000 Subject: [PATCH 44/82] Latest updates from develop (3) --- CMakeLists.txt | 2 +- definitions/boot.def | 5 + definitions/param_limits.def | 9 ++ src/action_class_concept.c | 94 ++++++++++++++++++ src/grib_accessor_class_concept.c | 8 ++ src/grib_accessor_class_data_simple_packing.c | 29 ++++-- src/grib_api_internal.h | 1 + src/grib_api_prototypes.h | 2 + src/grib_context.c | 33 +++++-- src/grib_util.c | 64 +++++++++++++ tests/CMakeLists.txt | 1 + tests/grib_data_quality_checks.sh | 96 +++++++++++++++++++ tests/unit_tests.c | 27 ++++++ tigge/tigge_check.c | 14 +-- tools/codes_info.c | 6 +- 15 files changed, 361 insertions(+), 30 deletions(-) create mode 100644 definitions/param_limits.def create mode 100755 tests/grib_data_quality_checks.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 0be2645cd..8830e64dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,7 +118,7 @@ ecbuild_add_option( FEATURE AEC ) ecbuild_add_option( FEATURE PYTHON - DESCRIPTION "Build the ecCodes Python2 interface" + DESCRIPTION "Build the ecCodes Python2 interface (deprecated)" DEFAULT ON REQUIRED_PACKAGES "Python VERSION 2.6 NO_LIBS" NumPy ) diff --git a/definitions/boot.def b/definitions/boot.def index 83ea9f2ee..069df6900 100644 --- a/definitions/boot.def +++ b/definitions/boot.def @@ -15,6 +15,11 @@ UseEcmfConventions = getenv("ECCODES_USE_ECMF_CONVENTIONS","1") :hidden ; constant defaultTypeOfLevel="unknown" : hidden; +gribDataQualityChecks = getenv("ECCODES_GRIB_DATA_QUALITY_CHECKS","0") : hidden; +if (gribDataQualityChecks) { + template LIMITS "param_limits.def"; +} + # GRIBEX special boustrophedonic mode. See GRIB-472 # If the environment variable is not defined, the key will be 0 GRIBEX_boustrophedonic = getenv("ECCODES_GRIBEX_BOUSTROPHEDONIC","0") :hidden; diff --git a/definitions/param_limits.def b/definitions/param_limits.def new file mode 100644 index 000000000..24616f996 --- /dev/null +++ b/definitions/param_limits.def @@ -0,0 +1,9 @@ +constant default_min_val = -1e9 : long_type, hidden; +constant default_max_val = +1e9 : long_type, hidden; + +concept param_value_min(default_min_val) { + 0 = { paramId=167; } +} : long_type, hidden; +concept param_value_max(default_max_val) { + 373 = { paramId=167; } +} : long_type, hidden; diff --git a/src/action_class_concept.c b/src/action_class_concept.c index 19589c458..71e3ab2fc 100644 --- a/src/action_class_concept.c +++ b/src/action_class_concept.c @@ -305,3 +305,97 @@ static grib_concept_value* get_concept(grib_handle* h, grib_action_concept* self GRIB_MUTEX_UNLOCK(&mutex); return result; } + +static int concept_condition_expression_true(grib_handle* h, grib_concept_condition* c, char* exprVal) +{ + long lval; + long lres=0; + int ok = 0; + int err=0; + const int type = grib_expression_native_type(h,c->expression); + + switch(type) + { + case GRIB_TYPE_LONG: + grib_expression_evaluate_long(h,c->expression,&lres); + ok = (grib_get_long(h,c->name,&lval) == GRIB_SUCCESS) && + (lval == lres); + if (ok) sprintf(exprVal, "%ld", lres); + break; + + case GRIB_TYPE_DOUBLE: { + double dval; + double dres=0.0; + grib_expression_evaluate_double(h,c->expression,&dres); + ok = (grib_get_double(h,c->name,&dval) == GRIB_SUCCESS) && + (dval == dres); + if (ok) sprintf(exprVal, "%g", dres); + break; + } + + case GRIB_TYPE_STRING: { + const char *cval; + char buf[80]; + char tmp[80]; + size_t len = sizeof(buf); + size_t size=sizeof(tmp); + + ok = (grib_get_string(h,c->name,buf,&len) == GRIB_SUCCESS) && + ((cval = grib_expression_evaluate_string(h,c->expression,tmp,&size,&err)) != NULL) && + (err==0) && (strcmp(buf,cval) == 0); + if (ok) sprintf(exprVal, "%s", cval); + break; + } + + default: + /* TODO: */ + break; + } + return ok; +} + +/* Caller has to allocate space for the result. + * INPUTS: h, key and value (can be NULL) + * OUTPUT: result + * Example: key='typeOfLevel' whose value is 'mixedLayerDepth', + * result='typeOfFirstFixedSurface=169,typeOfSecondFixedSurface=255' + */ +int get_concept_condition_string(grib_handle* h, const char* key, const char* value, char* result) +{ + int err = 0; + int length = 0; + char strVal[64]={0,}; + char exprVal[256]={0,}; + const char* pValue = value; + size_t len = sizeof(strVal); + grib_concept_value* concept_value = NULL; + grib_accessor* acc = grib_find_accessor(h, key); + if (!acc) return GRIB_NOT_FOUND; + + if (!value) { + err = grib_get_string(h, key, strVal,&len); + if (err) return GRIB_INTERNAL_ERROR; + pValue = strVal; + } + + concept_value = action_concept_get_concept(acc); + while (concept_value) { + grib_concept_condition* concept_condition = concept_value->conditions; + + if (strcmp(pValue, concept_value->name)==0) { + while (concept_condition) { + grib_expression* expression = concept_condition->expression; + Assert(expression); + if (concept_condition_expression_true(h, concept_condition, exprVal)) { + length += sprintf(result+length, "%s%s=%s", + (length==0?"":","),concept_condition->name, exprVal); + } + concept_condition = concept_condition->next; + } + } + + concept_value = concept_value->next; + } + if (length == 0) return GRIB_CONCEPT_NO_MATCH; + return GRIB_SUCCESS; +} diff --git a/src/grib_accessor_class_concept.c b/src/grib_accessor_class_concept.c index 40d2f2c1a..fcfb44c90 100644 --- a/src/grib_accessor_class_concept.c +++ b/src/grib_accessor_class_concept.c @@ -615,6 +615,14 @@ static int unpack_string (grib_accessor* a, char* val, size_t *len) } strcpy(val,p); *len = slen; +#if 0 + if (a->context->debug==1) { + int err = 0; + char result[1024] = {0,}; + err = get_concept_condition_string(grib_handle_of_accessor(a), a->name, val, result); + if (!err) fprintf(stderr, "ECCODES DEBUG concept name=%s, value=%s, conditions=%s\n", a->name, val, result); + } +#endif return GRIB_SUCCESS; } diff --git a/src/grib_accessor_class_data_simple_packing.c b/src/grib_accessor_class_data_simple_packing.c index f08c6c188..50e7a7695 100644 --- a/src/grib_accessor_class_data_simple_packing.c +++ b/src/grib_accessor_class_data_simple_packing.c @@ -505,12 +505,26 @@ static int producing_large_constant_fields(const grib_context* c, grib_handle* h } #endif -static int check_range(const double val) +static int check_range(grib_handle* h, const double min_val, const double max_val) { - if (val < DBL_MAX && val > -DBL_MAX) - return GRIB_SUCCESS; - else + int result = GRIB_SUCCESS; + grib_context* ctx = h->context; + + if ( !(min_val < DBL_MAX && min_val > -DBL_MAX) ) { + grib_context_log(ctx, GRIB_LOG_ERROR, "Minimum value out of range: %g", min_val); return GRIB_ENCODING_ERROR; + } + if ( !(max_val < DBL_MAX && max_val > -DBL_MAX) ) { + grib_context_log(ctx, GRIB_LOG_ERROR, "Maximum value out of range: %g", max_val); + return GRIB_ENCODING_ERROR; + } + + /* Data Quality checks */ + if (ctx->grib_data_quality_checks) { + result = grib_util_grib_data_quality_check(h, min_val, max_val); + } + + return result; } static int pack_double(grib_accessor* a, const double* val, size_t *len) @@ -577,12 +591,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) else if (val[i] < min ) min = val[i]; } #endif - if ((err = check_range(max)) != GRIB_SUCCESS) { - grib_context_log(a->context,GRIB_LOG_ERROR,"Maximum value out of range: %g", max); - return err; - } - if ((err = check_range(min)) != GRIB_SUCCESS) { - grib_context_log(a->context,GRIB_LOG_ERROR,"Minimum value out of range: %g", min); + if ((err = check_range(gh, min, max)) != GRIB_SUCCESS) { return err; } diff --git a/src/grib_api_internal.h b/src/grib_api_internal.h index 43fa2722e..5028d7ff3 100644 --- a/src/grib_api_internal.h +++ b/src/grib_api_internal.h @@ -1056,6 +1056,7 @@ struct grib_context int bufrdc_mode; int bufr_set_to_missing_if_out_of_range; int bufr_multi_element_constant_arrays; + int grib_data_quality_checks; FILE* log_stream; grib_trie* classes; grib_trie* lists; diff --git a/src/grib_api_prototypes.h b/src/grib_api_prototypes.h index 5aba681d0..2dc932a06 100644 --- a/src/grib_api_prototypes.h +++ b/src/grib_api_prototypes.h @@ -67,6 +67,7 @@ grib_action *grib_action_create_when(grib_context *context, grib_expression *exp grib_concept_value *action_concept_get_concept(grib_accessor *a); int action_concept_get_nofail(grib_accessor *a); grib_action *grib_action_create_concept(grib_context *context, const char *name, grib_concept_value *concept, const char *basename, const char *name_space, const char *defaultkey, const char *masterDir, const char *localDir, const char *ecmfDir, int flags, int nofail); +int get_concept_condition_string(grib_handle* h, const char* key, const char* value, char* result); /* action_class_hash_array.c */ grib_action *grib_action_create_hash_array(grib_context *context, const char *name, grib_hash_array_value *hash_array, const char *basename, const char *name_space, const char *defaultkey, const char *masterDir, const char *localDir, const char *ecmfDir, int flags, int nofail); @@ -1483,6 +1484,7 @@ int grib2_is_PDTN_AerosolOptical(long productDefinitionTemplateNumber); int grib2_select_PDTN(int is_eps, int is_instant, int is_chemical, int is_chemical_distfn, int is_aerosol, int is_aerosol_optical); int is_grib_index_file(const char *filename); size_t sum_of_pl_array(const long* pl, size_t plsize); +int grib_util_grib_data_quality_check(grib_handle* h, double min_val, double max_val); /* bufr_util.c */ int compute_bufr_key_rank(grib_handle *h, grib_string_list *keys, const char *key); diff --git a/src/grib_context.c b/src/grib_context.c index da8b61d2e..e2616c08d 100644 --- a/src/grib_context.c +++ b/src/grib_context.c @@ -308,13 +308,13 @@ static grib_context default_grib_context = { &default_seek, /* lfile seek procedure */ &default_feof, /* file feof procedure */ - &default_log, /* logging_procedure */ - &default_print, /* print procedure */ - 0, /* grib_codetable* */ - 0, /* grib_smart_table* */ - 0, /* char* outfilename */ - 0, /* int multi_support_on */ - 0, /* grib_multi_support* multi_support*/ + &default_log, /* output_log */ + &default_print, /* print */ + 0, /* codetable */ + 0, /* smart_table */ + 0, /* outfilename */ + 0, /* multi_support_on */ + 0, /* multi_support */ 0, /* grib_definition_files_dir */ 0, /* handle_file_count */ 0, /* handle_total_count */ @@ -323,9 +323,9 @@ static grib_context default_grib_context = { 0, /* gts_header_on */ 0, /* gribex_mode_on */ 0, /* large_constant_fields */ - 0, /* grib_itrie* keys */ + 0, /* keys */ 0, /* keys_count */ - 0, /* grib_itrie* concepts_index */ + 0, /* concepts_index */ 0, /* concepts_count */ {0,}, /* concepts */ 0, /* hash_array_index */ @@ -337,6 +337,7 @@ static grib_context default_grib_context = { 0, /* bufrdc_mode */ 0, /* bufr_set_to_missing_if_out_of_range */ 0, /* bufr_multi_element_constant_arrays */ + 0, /* grib_data_quality_checks */ 0, /* log_stream */ 0, /* classes */ 0, /* lists */ @@ -371,6 +372,7 @@ grib_context* grib_context_get_default() const char* bufrdc_mode = NULL; const char* bufr_set_to_missing_if_out_of_range = NULL; const char* bufr_multi_element_constant_arrays = NULL; + const char* grib_data_quality_checks = NULL; const char* file_pool_max_opened_files = NULL; #ifdef ENABLE_FLOATING_POINT_EXCEPTIONS @@ -381,6 +383,7 @@ grib_context* grib_context_get_default() bufrdc_mode = getenv("ECCODES_BUFRDC_MODE_ON"); bufr_set_to_missing_if_out_of_range = getenv("ECCODES_BUFR_SET_TO_MISSING_IF_OUT_OF_RANGE"); bufr_multi_element_constant_arrays = getenv("ECCODES_BUFR_MULTI_ELEMENT_CONSTANT_ARRAYS"); + grib_data_quality_checks = getenv("ECCODES_GRIB_DATA_QUALITY_CHECKS"); large_constant_fields = codes_getenv("ECCODES_GRIB_LARGE_CONSTANT_FIELDS"); no_abort = codes_getenv("ECCODES_NO_ABORT"); debug = codes_getenv("ECCODES_DEBUG"); @@ -458,6 +461,16 @@ grib_context* grib_context_get_default() } } + /* Definitions path extra: Added at the head of (i.e. before) existing path */ + { + const char* defs_extra = getenv("ECCODES_EXTRA_DEFINITION_PATH"); + if (defs_extra) { + char buffer[DEF_PATH_MAXLEN]; + ecc_snprintf(buffer, DEF_PATH_MAXLEN, "%s:%s", defs_extra, default_grib_context.grib_definition_files_path); + default_grib_context.grib_definition_files_path = strdup(buffer); + } + } + grib_context_log(&default_grib_context, GRIB_LOG_DEBUG, "Definitions path: %s", default_grib_context.grib_definition_files_path); grib_context_log(&default_grib_context, GRIB_LOG_DEBUG, "Samples path: %s", @@ -479,6 +492,8 @@ grib_context* grib_context_get_default() atoi(bufr_set_to_missing_if_out_of_range) : 0; default_grib_context.bufr_multi_element_constant_arrays = bufr_multi_element_constant_arrays ? atoi(bufr_multi_element_constant_arrays) : 0; + default_grib_context.grib_data_quality_checks = grib_data_quality_checks ? + atoi(grib_data_quality_checks) : 0; default_grib_context.file_pool_max_opened_files = file_pool_max_opened_files ? atoi(file_pool_max_opened_files) : DEFAULT_FILE_POOL_MAX_OPENED_FILES; } diff --git a/src/grib_util.c b/src/grib_util.c index a5b584c12..7e5d7e94b 100644 --- a/src/grib_util.c +++ b/src/grib_util.c @@ -2048,3 +2048,67 @@ size_t sum_of_pl_array(const long* pl, size_t plsize) } return count; } + +int grib_util_grib_data_quality_check(grib_handle* h, double min_val, double max_val) +{ + int err = 0; + long min_field_value_allowed=0, max_field_value_allowed=0; + long paramId = 0; + double dmin_allowed=0, dmax_allowed=0; + grib_context* ctx = h->context; + int is_error = 1; + /* + * If grib_data_quality_checks == 1, limits failure results in an error + * If grib_data_quality_checks == 2, limits failure results in a warning + */ + Assert( ctx->grib_data_quality_checks == 1 || ctx->grib_data_quality_checks == 2 ); + is_error = (ctx->grib_data_quality_checks == 1); + + /* The limit keys must exist if we are here */ + err = grib_get_long(h, "param_value_min", &min_field_value_allowed); + if (err) { + grib_context_log(ctx, GRIB_LOG_ERROR,"grib_data_quality_check: Could not get param_value_min"); + return err; + } + err = grib_get_long(h, "param_value_max", &max_field_value_allowed); + if (err) { + grib_context_log(ctx, GRIB_LOG_ERROR,"grib_data_quality_check: Could not get param_value_max"); + return err; + } + + dmin_allowed = (double)min_field_value_allowed; + dmax_allowed = (double)max_field_value_allowed; + + if (min_val < dmin_allowed) { + char description[1024] = {0,}; + if (get_concept_condition_string(h, "param_value_min", NULL, description)==GRIB_SUCCESS) { + fprintf(stderr, "ECCODES %s : (%s): minimum (%g) is less than the allowable limit (%g)\n", + (is_error? "ERROR":"WARNING"), description, min_val, dmin_allowed); + } else { + if (grib_get_long(h, "paramId", ¶mId) == GRIB_SUCCESS) { + fprintf(stderr, "ECCODES %s : (paramId=%ld): minimum (%g) is less than the default allowable limit (%g)\n", + (is_error? "ERROR":"WARNING"), paramId, min_val, dmin_allowed); + } + } + if (is_error) { + return GRIB_OUT_OF_RANGE; /* Failure */ + } + } + if (max_val > dmax_allowed) { + char description[1024] = {0,}; + if (get_concept_condition_string(h, "param_value_max", NULL, description)==GRIB_SUCCESS) { + fprintf(stderr, "ECCODES %s : (%s): maximum (%g) is more than the allowable limit (%g)\n", + (is_error? "ERROR":"WARNING"), description, max_val, dmax_allowed); + } else { + if (grib_get_long(h, "paramId", ¶mId) == GRIB_SUCCESS) { + fprintf(stderr, "ECCODES %s : (paramId=%ld): maximum (%g) is more than the default allowable limit (%g)\n", + (is_error? "ERROR":"WARNING"), paramId, max_val, dmax_allowed); + } + } + if (is_error) { + return GRIB_OUT_OF_RANGE; /* Failure */ + } + } + + return GRIB_SUCCESS; +} diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 61b6d3fe8..bb4efaf3b 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -70,6 +70,7 @@ list( APPEND tests_no_data_reqd ) # These tests do require data downloads list( APPEND tests_data_reqd + grib_data_quality_checks bpv_limit grib_complex grib_double_cmp diff --git a/tests/grib_data_quality_checks.sh b/tests/grib_data_quality_checks.sh new file mode 100755 index 000000000..65a08ce79 --- /dev/null +++ b/tests/grib_data_quality_checks.sh @@ -0,0 +1,96 @@ +#!/bin/sh +# 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. +# + +. ./include.sh +set -u +# --------------------------------------------------------- +# Tests for data quality checks +# --------------------------------------------------------- +label="grib_data_quality" +tempOut=temp.1.${label}.out +temp2=temp.2.${label}.out +tempErr=temp.${label}.err + +# Start with clean environment +unset ECCODES_GRIB_DATA_QUALITY_CHECKS +unset ECCODES_EXTRA_DEFINITION_PATH + + +input1=${data_dir}/reduced_gaussian_surface.grib1 +input2=${data_dir}/reduced_gaussian_surface.grib2 +grib_check_key_equals $input1 paramId 167 +grib_check_key_equals $input2 paramId 167 + +# Data quality checks disabled. Create huge values for temperature +${tools_dir}/grib_set -s scaleValuesBy=100 $input1 $tempOut +${tools_dir}/grib_set -s scaleValuesBy=100 $input2 $tempOut + +# Data quality checks enabled. Repacking should fail +export ECCODES_GRIB_DATA_QUALITY_CHECKS=1 +set +e +${tools_dir}/grib_copy -r $tempOut /dev/null 2>$tempErr +status=$? +set -e +[ $status -ne 0 ] +grep -q 'more than the allowable limit' $tempErr + + +# Data quality checks enabled but only as a warning. Repacking should pass +export ECCODES_GRIB_DATA_QUALITY_CHECKS=2 +${tools_dir}/grib_copy -r $tempOut /dev/null 2>$tempErr +grep -q 'more than the allowable limit' $tempErr + + +# Data quality checks enabled. Scaling should fail +export ECCODES_GRIB_DATA_QUALITY_CHECKS=1 +set +e +${tools_dir}/grib_set -s scaleValuesBy=100 $input1 $tempOut 2>$tempErr +status=$? +set -e +[ $status -ne 0 ] +grep -q 'GRIB1 simple packing: unable to set values' $tempErr +grep -q 'allowable limit' $tempErr + +set +e +${tools_dir}/grib_set -s scaleValuesBy=100 $input2 $tempOut 2>$tempErr +status=$? +set -e +[ $status -ne 0 ] +grep -q 'GRIB2 simple packing: unable to set values' $tempErr +grep -q 'allowable limit' $tempErr + + +# Override the defaults +# ---------------------- +tempDir=tempdir.$label +rm -rf $tempDir +mkdir -p $tempDir +# Set a large limit for temperature +cat > $tempDir/param_limits.def <grib_definition_files_path); printf("Definition files path can be changed by setting ECCODES_DEFINITION_PATH environment variable\n"); } printf("\n"); @@ -118,7 +118,7 @@ int main( int argc,char* argv[]) if ((path=codes_getenv("ECCODES_DEFINITION_PATH")) != NULL) { printf("%s",path); } else { - printf("%s",ECCODES_DEFINITION_PATH); + printf("%s",context->grib_definition_files_path); } } From 455d05fadce0401ecd015d59767a45409dd57fcf Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 10 Jan 2020 13:05:05 +0000 Subject: [PATCH 45/82] Windows: Fix test failure (eccodes_t_grib_data_quality_checks) --- src/grib_context.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/grib_context.c b/src/grib_context.c index e2616c08d..629142c22 100644 --- a/src/grib_context.c +++ b/src/grib_context.c @@ -26,6 +26,16 @@ int feenableexcept(int excepts); grib_string_list grib_file_not_found; +/* Windows always has a colon in pathnames e.g. C:\temp\file. So instead we use semi-colons as delimiter */ +/* in order to have multiple definitions directories */ +#ifdef ECCODES_ON_WINDOWS +# define DEFS_PATH_DELIMITER_CHAR ';' +# define DEFS_PATH_DELIMITER_STR ";" +#else +# define DEFS_PATH_DELIMITER_CHAR ':' +# define DEFS_PATH_DELIMITER_STR ":" +#endif + #if GRIB_PTHREADS static pthread_once_t once = PTHREAD_ONCE_INIT; @@ -466,7 +476,7 @@ grib_context* grib_context_get_default() const char* defs_extra = getenv("ECCODES_EXTRA_DEFINITION_PATH"); if (defs_extra) { char buffer[DEF_PATH_MAXLEN]; - ecc_snprintf(buffer, DEF_PATH_MAXLEN, "%s:%s", defs_extra, default_grib_context.grib_definition_files_path); + ecc_snprintf(buffer, DEF_PATH_MAXLEN, "%s%c%s", defs_extra, DEFS_PATH_DELIMITER_CHAR, default_grib_context.grib_definition_files_path); default_grib_context.grib_definition_files_path = strdup(buffer); } } @@ -566,16 +576,6 @@ static char* resolve_path(grib_context* c, char* path) return result; } -/* Windows always has a colon in pathnames e.g. C:\temp\file. So instead we use semi-colons as delimiter */ -/* in order to have multiple definitions directories */ -#ifdef ECCODES_ON_WINDOWS -# define DEFS_PATH_DELIMITER_CHAR ';' -# define DEFS_PATH_DELIMITER_STR ";" -#else -# define DEFS_PATH_DELIMITER_CHAR ':' -# define DEFS_PATH_DELIMITER_STR ":" -#endif - static int init_definition_files_dir(grib_context* c) { int err=0; From dabe970a2813c3810603871a8a4889f7748545cf Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 10 Jan 2020 13:42:11 +0000 Subject: [PATCH 46/82] Github: Trigger Travis build From 0f5dfa4fe01105043a337dca699a1c230c444f06 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 10 Jan 2020 16:24:09 +0000 Subject: [PATCH 47/82] ECC-1018 --- samples/diag.tmpl | Bin 2423 -> 120 bytes src/grib_accessor_class_long.c | 26 +++++++++++------------ src/grib_accessor_class_section_length.c | 16 +++++++------- src/grib_accessor_class_variable.c | 20 ++++++++--------- tests/diag.sh | 23 ++++++++++++++------ 5 files changed, 47 insertions(+), 38 deletions(-) diff --git a/samples/diag.tmpl b/samples/diag.tmpl index 94b2b629d1ade8f50606e677c63e029ce93be313..e9603d191887997477a7c383d7ab6505f550fc68 100644 GIT binary patch literal 120 zcmZ?qbaZE6kYGq+WMlw=3@&~i1|S>4(_&y?0f_>65Cr1Df%8KKh6V;E-Bbp1AYd?u IOAx^T0JDPyo&W#< literal 2423 zcmYk7yN=sH3`LbklORBfG^ql&>AVXBspZkbgPrw5q%G_sRjPbKJ}sY@OH#w300U>P zE??u3G~|Bny06{uH*Y$*{(SuWsRQfk!`gN4MSa(GZ#&auxn2E_Z~yu)zrJI6!0&mt z`#U9G`WGIThusc*S;mx!OW>1pIyXI?T~CA?TdeTO8Hoa)rfcEbveRq2o&t-Gz&mV8RdS!-T7`2~kW%RSL_U|nE67o=BizQw{EbaK|X~;zR0;e-7I?u~U_Zh?O zbrxj~+?Ru_=w6so)xqu&-4^N@#*6!xGKV z%pTbNHoN&TyIE}Z#%qb3ZGqV*;zv9>G9&mJ_+fu@{b7&Oym^?OoL~1X_H}=By)S~6 z^H7>zrl#k>)7WTm~8z|Vn?fm44Ot3Mrjs=OaYsi1l8nR4Yz%BR4xE9!y% zSb3V046k|`vrJ~p=SyW?w`WB5bG0)w;VjWQoW)~&Q@?NtdRd!Jx>e@4Z8Ns*F_r;q zPTd{Jk2C4Dl((E;}4@7vZ@~bQ PlyiD2<7wvO?kBGQe1t|H diff --git a/src/grib_accessor_class_long.c b/src/grib_accessor_class_long.c index 9c1684d85..2ddba18f7 100644 --- a/src/grib_accessor_class_long.c +++ b/src/grib_accessor_class_long.c @@ -186,20 +186,20 @@ static int pack_missing(grib_accessor* a) /* static int is_missing(grib_accessor* a){ - size_t one = 1; - long value = GRIB_MISSING_LONG; - long ret=0; - - if(a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) - { - ret = grib_unpack_long(a,&value,&one); - Assert( ret == 0); - return value == GRIB_MISSING_LONG; - } - - return 0; + size_t one = 1; + long value = GRIB_MISSING_LONG; + long ret=0; + + if(a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) + { + ret = grib_unpack_long(a,&value,&one); + Assert( ret == 0); + return value == GRIB_MISSING_LONG; + } + + return 0; } - */ +*/ static int unpack_double(grib_accessor* a, double* val,size_t *len) { diff --git a/src/grib_accessor_class_section_length.c b/src/grib_accessor_class_section_length.c index 291074715..f80a2f895 100644 --- a/src/grib_accessor_class_section_length.c +++ b/src/grib_accessor_class_section_length.c @@ -133,20 +133,20 @@ static void init_class(grib_accessor_class* c) static void init(grib_accessor* a, const long len , grib_arguments* arg ) { - a->parent->aclength = a; - a->length = len; - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; - Assert(a->length>=0); + a->parent->aclength = a; + a->length = len; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; + Assert(a->length>=0); } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_long(dumper,a,NULL); + grib_dump_long(dumper,a,NULL); } static int value_count(grib_accessor* a,long* c) { - *c=1; - return 0; + *c=1; + return 0; } diff --git a/src/grib_accessor_class_variable.c b/src/grib_accessor_class_variable.c index 2cc343faf..19bdb6ccb 100644 --- a/src/grib_accessor_class_variable.c +++ b/src/grib_accessor_class_variable.c @@ -356,16 +356,16 @@ static long byte_count(grib_accessor* a) /* NOT ANY MORE static long byte_count(grib_accessor* a) { - grib_accessor_variable *self = (grib_accessor_variable*)a; - char buf[80]={0,}; - - if(self->type == GRIB_TYPE_STRING) { - return strlen(self->cval) +1; - } else { - sprintf(buf,"%g",self->dval); - printf("========> \"%s\"\n",buf); - return strlen(buf)+1; - } + grib_accessor_variable *self = (grib_accessor_variable*)a; + char buf[80]={0,}; + + if(self->type == GRIB_TYPE_STRING) { + return strlen(self->cval) +1; + } else { + sprintf(buf,"%g",self->dval); + printf("========> \"%s\"\n",buf); + return strlen(buf)+1; + } } */ diff --git a/tests/diag.sh b/tests/diag.sh index 76b06371a..41509629f 100755 --- a/tests/diag.sh +++ b/tests/diag.sh @@ -25,16 +25,14 @@ sample=$ECCODES_SAMPLES_PATH/diag.tmpl ${tools_dir}/grib_ls $sample > $REDIRECT ${tools_dir}/grib_dump $sample > $REDIRECT -# Check setting keys -# ------------------- +echo "Check setting integer keys..." +# ---------------------------------- echo 'set numberOfIntegers=3; set integerValues={55, 44, 66}; write;' | ${tools_dir}/grib_filter -o $tempOut - $sample ${tools_dir}/grib_dump -p numberOfFloats,numberOfIntegers,floatValues,integerValues $tempOut | sed 1d > $tempTxt cat > $tempRef < $tempTxt cat > $tempRef < $tempRef < $tempTxt @@ -70,6 +72,13 @@ cat > $tempRef < $tempTxt +grep -q "'E', 'C', 'M', 'W', 'F', ' '" $tempTxt + # TODO encoding of characters not fully working. We are using one-byte integers instead #echo 'set numberOfCharacters=4; set charValues={"J","u","m","p"}; write;'| ${tools_dir}/grib_filter -o $tempOut - $sample #res=`${tools_dir}/grib_dump $tempOut | grep charValues | tr -d '\n' | tr -d ' '` From d7303752eb03198bdf1bae17e0a8a1b5c36fbc11 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 16 Jan 2020 12:18:26 +0000 Subject: [PATCH 48/82] Latest updates from develop (4) --- .appveyor.yml | 2 +- CMakeLists.txt | 6 +++ VERSION.cmake | 2 +- definitions/CMakeLists.txt | 11 +++- src/grib_api_prototypes.h | 1 + ...rator_class_lambert_azimuthal_equal_area.c | 4 +- src/grib_iterator_class_lambert_conformal.c | 5 ++ src/grib_iterator_class_polar_stereographic.c | 5 ++ src/grib_util.c | 10 ++++ tests/grib_filter.sh | 52 +++++++++++++------ version.sh | 2 +- 11 files changed, 77 insertions(+), 23 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 456eb4ade..7ae9c60a9 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -2,7 +2,7 @@ # general configuration # #---------------------------------# -version: 2.16.0-{build}-{branch} +version: 2.17.0-{build}-{branch} branches: only: diff --git a/CMakeLists.txt b/CMakeLists.txt index 8830e64dc..e94027361 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -478,6 +478,12 @@ if( HAVE_FORTRAN ) ) endif() +############################################################################### +# Debugging aid. Print all known CMake variables +# get_cmake_property(_variableNames VARIABLES) +# foreach( _variableName ${_variableNames} ) +# ecbuild_info(" ${_variableName}=${${_variableName}}") +# endforeach() ############################################################################### # finalize diff --git a/VERSION.cmake b/VERSION.cmake index 5034baae0..b4cbdd932 100644 --- a/VERSION.cmake +++ b/VERSION.cmake @@ -1 +1 @@ -set( ${PROJECT_NAME}_VERSION_STR "2.16.0" ) +set( ${PROJECT_NAME}_VERSION_STR "2.17.0" ) diff --git a/definitions/CMakeLists.txt b/definitions/CMakeLists.txt index 5ddcb11ea..4270b7cbf 100644 --- a/definitions/CMakeLists.txt +++ b/definitions/CMakeLists.txt @@ -5,6 +5,15 @@ set(definition_files ${definition_files} PARENT_SCOPE) # needed for memfs file( GLOB table_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.table" ) file( GLOB text_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.txt" ) +# Collect all directories at the top-level of definitions +file( GLOB children RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*" ) +set( dirlist "" ) +foreach( child ${children} ) + if( IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${child} ) + list( APPEND dirlist ${child} ) + endif() +endforeach() + if(HAVE_INSTALL_ECCODES_DEFINITIONS) install( FILES ${definition_files} ${table_files} ${text_files} @@ -14,7 +23,7 @@ if(HAVE_INSTALL_ECCODES_DEFINITIONS) install( FILES installDefinitions.sh DESTINATION ${ECCODES_DEFINITION_SUFF}) - install( DIRECTORY budg bufr cdf common grib1 grib2 grib3 gts mars metar tide hdf5 wrap + install( DIRECTORY ${dirlist} DESTINATION ${ECCODES_DEFINITION_SUFF} FILES_MATCHING PATTERN "*.def" diff --git a/src/grib_api_prototypes.h b/src/grib_api_prototypes.h index 2dc932a06..3a91d5c73 100644 --- a/src/grib_api_prototypes.h +++ b/src/grib_api_prototypes.h @@ -1484,6 +1484,7 @@ int grib2_is_PDTN_AerosolOptical(long productDefinitionTemplateNumber); int grib2_select_PDTN(int is_eps, int is_instant, int is_chemical, int is_chemical_distfn, int is_aerosol, int is_aerosol_optical); int is_grib_index_file(const char *filename); size_t sum_of_pl_array(const long* pl, size_t plsize); +int grib_is_earth_oblate(grib_handle* h); int grib_util_grib_data_quality_check(grib_handle* h, double min_val, double max_val); /* bufr_util.c */ diff --git a/src/grib_iterator_class_lambert_azimuthal_equal_area.c b/src/grib_iterator_class_lambert_azimuthal_equal_area.c index e999ec2f0..26af32179 100644 --- a/src/grib_iterator_class_lambert_azimuthal_equal_area.c +++ b/src/grib_iterator_class_lambert_azimuthal_equal_area.c @@ -138,11 +138,11 @@ static int init(grib_iterator* iter,grib_handle* h,grib_arguments* args) if((ret = grib_get_double_internal(h, sradius,&radius)) != GRIB_SUCCESS) { /* Check if it's an oblate spheroid */ - long oblate=0; - if (grib_get_long(h,"earthIsOblate",&oblate)==GRIB_SUCCESS && oblate==1) + if (grib_is_earth_oblate(h)) grib_context_log(h->context,GRIB_LOG_ERROR,"Lambert Azimuthal Equal Area only supported for spherical earth."); return ret; } + if((ret = grib_get_long_internal(h, snx,&nx)) != GRIB_SUCCESS) return ret; if((ret = grib_get_long_internal(h, sny,&ny)) != GRIB_SUCCESS) diff --git a/src/grib_iterator_class_lambert_conformal.c b/src/grib_iterator_class_lambert_conformal.c index 2f01801c4..c3e5e245c 100644 --- a/src/grib_iterator_class_lambert_conformal.c +++ b/src/grib_iterator_class_lambert_conformal.c @@ -146,6 +146,11 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) if((err = grib_get_long_internal(h, sny,&ny)) != GRIB_SUCCESS) return err; + if (grib_is_earth_oblate(h)) { + grib_context_log(h->context,GRIB_LOG_ERROR,"Lambert Conformal only supported for spherical earth."); + return GRIB_GEOCALCULUS_PROBLEM; + } + if (iter->nv!=nx*ny) { grib_context_log(h->context,GRIB_LOG_ERROR,"Wrong number of points (%ld!=%ldx%ld)",iter->nv,nx,ny); return GRIB_WRONG_GRID; diff --git a/src/grib_iterator_class_polar_stereographic.c b/src/grib_iterator_class_polar_stereographic.c index 11eb2653e..de2af4f7b 100644 --- a/src/grib_iterator_class_polar_stereographic.c +++ b/src/grib_iterator_class_polar_stereographic.c @@ -151,6 +151,11 @@ static int init(grib_iterator* iter,grib_handle* h,grib_arguments* args) if((ret = grib_get_long_internal(h, snx,&nx)) != GRIB_SUCCESS) return ret; if((ret = grib_get_long_internal(h, sny,&ny)) != GRIB_SUCCESS) return ret; + if (grib_is_earth_oblate(h)) { + grib_context_log(h->context,GRIB_LOG_ERROR,"Polar stereographic only supported for spherical earth."); + return GRIB_GEOCALCULUS_PROBLEM; + } + if (iter->nv!=nx*ny) { grib_context_log(h->context,GRIB_LOG_ERROR, "Wrong number of points (%ld!=%ldx%ld)", iter->nv,nx,ny); return GRIB_WRONG_GRID; diff --git a/src/grib_util.c b/src/grib_util.c index 7e5d7e94b..cb06d5e1d 100644 --- a/src/grib_util.c +++ b/src/grib_util.c @@ -2049,6 +2049,16 @@ size_t sum_of_pl_array(const long* pl, size_t plsize) return count; } +int grib_is_earth_oblate(grib_handle* h) +{ + long oblate = 0; + int err = grib_get_long(h, "earthIsOblate", &oblate); + if (!err && oblate == 1) { + return 1; + } + return 0; +} + int grib_util_grib_data_quality_check(grib_handle* h, double min_val, double max_val) { int err = 0; diff --git a/tests/grib_filter.sh b/tests/grib_filter.sh index d9599eab7..18fe2bb6d 100755 --- a/tests/grib_filter.sh +++ b/tests/grib_filter.sh @@ -32,8 +32,8 @@ rm -f ${data_dir}/split/* rmdir ${data_dir}/split rm -f ${data_dir}/f.rules -# Test with nonexistent keys. Note spelling of centre! -# ---------------------------------------------------- +echo "Test with nonexistent keys. Note spelling of centre!" +# --------------------------------------------------------- cat >${data_dir}/nonexkey.rules < ${data_dir}/formatint.rules < ${data_dir}/formatint.rules <temp.filt < ${data_dir}/binop.rules </dev/null -# GRIB-526 grib_filter very picky about format of floats -# ------------------------------------------------------- +echo "Test GRIB-526: grib_filter very picky about format of floats" +# ---------------------------------------------------------------- cat >temp.filt <temp.filt < temp.filt < Date: Fri, 17 Jan 2020 12:59:49 +0000 Subject: [PATCH 49/82] Latest updates from develop (5) --- definitions/bufr/section.3.def | 2 +- examples/C/include.ctest.sh.in | 5 +++++ examples/F90/include.ctest.sh.in | 5 +++++ examples/python/include.ctest.sh.in | 5 +++++ examples/python/metar_get_keys.sh | 5 ++++- memfs.py | 3 ++- 6 files changed, 22 insertions(+), 3 deletions(-) diff --git a/definitions/bufr/section.3.def b/definitions/bufr/section.3.def index cbff5edf2..0264a4acd 100644 --- a/definitions/bufr/section.3.def +++ b/definitions/bufr/section.3.def @@ -34,7 +34,7 @@ when (changed(tablesLocalDir)) { set clearTables=1;} # we should implement some table version dependency #constant templatesMasterDir="bufr/templates/[masterTableNumber]/[masterTablesVersionNumber]"; #constant templatesLocalDir="bufr/templates/local/[masterTableNumber]/[bufrHeaderCentre:l]/[localTablesVersionNumber]"; -constant templatesMasterDir="bufr/templates/"; +constant templatesMasterDir="bufr/templates"; constant templatesLocalDir="bufr/templates/local"; transient tableNumber=0; diff --git a/examples/C/include.ctest.sh.in b/examples/C/include.ctest.sh.in index 5dabcb29d..d221f0ddd 100644 --- a/examples/C/include.ctest.sh.in +++ b/examples/C/include.ctest.sh.in @@ -4,6 +4,7 @@ set -eax proj_dir=@PROJECT_SOURCE_DIR@ data_dir=@PROJECT_BINARY_DIR@/data +HAVE_MEMFS=@HAVE_MEMFS@ # use definitions from binary dir to test if installation will be correct def_dir="@CMAKE_BINARY_DIR@/@ECCODES_DEFINITION_SUFF@" @@ -20,6 +21,10 @@ if test "x$ECCODES_TEST_WITH_VALGRIND" != "x"; then examples_dir="valgrind --error-exitcode=1 -q $examples_dir" fi +if [ $HAVE_MEMFS -eq 1 ]; then + unset ECCODES_DEFINITION_PATH +fi + # use samples from binary dir to test if installation will be correct samp_dir="@CMAKE_BINARY_DIR@/@ECCODES_SAMPLES_SUFF@" ECCODES_SAMPLES_PATH=${samp_dir} diff --git a/examples/F90/include.ctest.sh.in b/examples/F90/include.ctest.sh.in index 9b522d839..e73107145 100644 --- a/examples/F90/include.ctest.sh.in +++ b/examples/F90/include.ctest.sh.in @@ -4,6 +4,7 @@ set -eax proj_dir=@PROJECT_SOURCE_DIR@ data_dir=@PROJECT_BINARY_DIR@/data +HAVE_MEMFS=@HAVE_MEMFS@ # use definitions from binary dir to test if installation will be correct def_dir="@CMAKE_BINARY_DIR@/@ECCODES_DEFINITION_SUFF@" @@ -24,3 +25,7 @@ fi samp_dir="@CMAKE_BINARY_DIR@/@ECCODES_SAMPLES_SUFF@" ECCODES_SAMPLES_PATH=${samp_dir} export ECCODES_SAMPLES_PATH + +if [ $HAVE_MEMFS -eq 1 ]; then + unset ECCODES_DEFINITION_PATH +fi diff --git a/examples/python/include.ctest.sh.in b/examples/python/include.ctest.sh.in index 3a7c0765c..5b651aece 100644 --- a/examples/python/include.ctest.sh.in +++ b/examples/python/include.ctest.sh.in @@ -3,6 +3,7 @@ set -eax data_dir=@PROJECT_BINARY_DIR@/data +HAVE_MEMFS=@HAVE_MEMFS@ # use definitions from binary dir to test if installation will be correct def_dir="@CMAKE_BINARY_DIR@/@ECCODES_DEFINITION_SUFF@" @@ -18,6 +19,10 @@ samp_dir="@CMAKE_BINARY_DIR@/@ECCODES_SAMPLES_SUFF@" ECCODES_SAMPLES_PATH=${samp_dir} export ECCODES_SAMPLES_PATH +if [ $HAVE_MEMFS -eq 1 ]; then + unset ECCODES_DEFINITION_PATH +fi + PYTHONPATH=@PROJECT_BINARY_DIR@/@ECCODES_PYTHON_DIR@:$PYTHONPATH export PYTHONPATH diff --git a/examples/python/metar_get_keys.sh b/examples/python/metar_get_keys.sh index 23a7e1ebe..b7833df06 100755 --- a/examples/python/metar_get_keys.sh +++ b/examples/python/metar_get_keys.sh @@ -9,7 +9,10 @@ # . ./include.sh - +if [ $HAVE_MEMFS -eq 1 ]; then + echo "$0: This test is currently disabled with MEMFS" + exit 0 +fi #Define a common label for all the tmp files label="metar_get_keys_test_p" diff --git a/memfs.py b/memfs.py index 32a0ab7df..52c471ced 100755 --- a/memfs.py +++ b/memfs.py @@ -9,7 +9,8 @@ # For now exclude GRIB3 as it is still experimental # The BUFR codetables is not used in the engine -EXCLUDED = ['grib3', 'codetables'] +# METAR and TAF are also experimental +EXCLUDED = ['grib3', 'codetables', 'taf', 'metar'] dirs = [os.path.realpath(x) for x in sys.argv[1:-1]] print(dirs) From dbb3b0f94a8818b1fe2e06e2842c2a98f6e6cccb Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 24 Jan 2020 14:47:13 +0000 Subject: [PATCH 50/82] Latest updates from develop (6) --- .clang-format | 106 + examples/C/box.c | 39 +- examples/C/bufr_attributes.c | 69 +- examples/C/bufr_clone.c | 31 +- examples/C/bufr_copy_data.c | 63 +- examples/C/bufr_expanded.c | 41 +- examples/C/bufr_get_keys.c | 57 +- examples/C/bufr_get_string_array.c | 26 +- examples/C/bufr_keys_iterator.c | 58 +- examples/C/bufr_missing.c | 32 +- examples/C/bufr_pthreads.c | 36 +- examples/C/bufr_read_header.c | 58 +- examples/C/bufr_read_scatterometer.c | 69 +- examples/C/bufr_read_synop.c | 71 +- examples/C/bufr_read_temp.c | 71 +- examples/C/bufr_set_keys.c | 44 +- examples/C/bufr_subset.c | 64 +- examples/C/fieldset.c | 59 +- examples/C/get_product_kind.c | 27 +- examples/C/grib_clone.c | 31 +- examples/C/grib_copy_message.c | 29 +- examples/C/grib_ensemble_index.c | 46 +- examples/C/grib_get_data.c | 58 +- examples/C/grib_get_keys.c | 81 +- examples/C/grib_index.c | 139 +- examples/C/grib_iterator.c | 42 +- examples/C/grib_iterator_bitmap.c | 61 +- examples/C/grib_keys_iterator.c | 44 +- examples/C/grib_list.c | 52 +- examples/C/grib_multi.c | 33 +- examples/C/grib_multi_write.c | 45 +- examples/C/grib_nearest.c | 82 +- examples/C/grib_nearest_multiple.c | 164 +- examples/C/grib_precipitation.c | 40 +- examples/C/grib_precision.c | 97 +- examples/C/grib_print_data.c | 61 +- examples/C/grib_pthreads.c | 70 +- examples/C/grib_sections_copy.c | 45 +- examples/C/grib_set_bitmap.c | 48 +- examples/C/grib_set_data.c | 37 +- examples/C/grib_set_keys.c | 55 +- examples/C/grib_set_pv.c | 52 +- examples/C/large_grib1.c | 22 +- examples/C/mars_param.c | 18 +- examples/C/multi2.c | 30 +- examples/C/nc.c | 29 +- examples/C/new_sample.c | 246 +- examples/C/set_missing.c | 49 +- examples/C/values_check.c | 87 +- examples/F90/get_product_kind.f90 | 4 + examples/F90/get_product_kind.sh | 8 +- fortran/eccodes_f90_tail.f90 | 20 + fortran/eccodes_visibility.h | 1 + fortran/grib_fortran.c | 12 + fortran/grib_fortran_prototypes.h | 5 + src/accessor.class | 57 +- src/action.c | 125 +- src/action_class_alias.c | 257 +- src/action_class_assert.c | 130 +- src/action_class_close.c | 100 +- src/action_class_concept.c | 381 +- src/action_class_gen.c | 176 +- src/action_class_hash_array.c | 301 +- src/action_class_if.c | 245 +- src/action_class_list.c | 169 +- src/action_class_meta.c | 106 +- src/action_class_modify.c | 120 +- src/action_class_noop.c | 78 +- src/action_class_print.c | 126 +- src/action_class_put.c | 110 +- src/action_class_remove.c | 116 +- src/action_class_rename.c | 125 +- src/action_class_section.c | 148 +- src/action_class_set.c | 120 +- src/action_class_set_darray.c | 101 +- src/action_class_set_iarray.c | 99 +- src/action_class_set_missing.c | 85 +- src/action_class_set_sarray.c | 99 +- src/action_class_switch.c | 271 +- src/action_class_template.c | 204 +- src/action_class_transient_darray.c | 132 +- src/action_class_trigger.c | 141 +- src/action_class_variable.c | 87 +- src/action_class_when.c | 189 +- src/action_class_while.c | 205 +- src/action_class_write.c | 130 +- src/bufr_keys_iterator.c | 190 +- src/bufr_util.c | 991 ++-- src/codes_memfs.c | 4 +- src/codes_util.c | 99 +- src/eccodes.c | 308 +- src/encode_double_array.c | 383 +- src/functions.c | 171 +- src/grib_2order_packer_simple.c | 88 +- src/grib_accessor.c | 681 ++- src/grib_accessor_class.c | 299 +- ...grib_accessor_class_abstract_long_vector.c | 163 +- src/grib_accessor_class_abstract_vector.c | 163 +- src/grib_accessor_class_apply_operators.c | 1141 ++--- src/grib_accessor_class_array.c | 163 +- src/grib_accessor_class_ascii.c | 264 +- src/grib_accessor_class_assert.c | 168 +- src/grib_accessor_class_bit.c | 271 +- src/grib_accessor_class_bitmap.c | 270 +- src/grib_accessor_class_bits.c | 366 +- src/grib_accessor_class_bits_per_value.c | 226 +- src/grib_accessor_class_blob.c | 163 +- src/grib_accessor_class_box.c | 185 +- src/grib_accessor_class_budgdate.c | 217 +- src/grib_accessor_class_bufr_clear_tables.c | 161 +- src/grib_accessor_class_bufr_data.c | 357 +- src/grib_accessor_class_bufr_data_array.c | 4069 +++++++++-------- src/grib_accessor_class_bufr_data_element.c | 641 +-- src/grib_accessor_class_bufr_elements_table.c | 470 +- ...accessor_class_bufr_extract_area_subsets.c | 396 +- ...ssor_class_bufr_extract_datetime_subsets.c | 543 ++- ...grib_accessor_class_bufr_extract_subsets.c | 200 +- src/grib_accessor_class_bufr_group.c | 177 +- ...essor_class_bufr_has_delayed_replication.c | 209 +- ...grib_accessor_class_bufr_simple_thinning.c | 293 +- src/grib_accessor_class_bufr_string_values.c | 229 +- ...cessor_class_bufrdc_expanded_descriptors.c | 270 +- src/grib_accessor_class_bytes.c | 174 +- ...accessor_class_change_scanning_direction.c | 328 +- ...ib_accessor_class_check_internal_version.c | 173 +- src/grib_accessor_class_codeflag.c | 234 +- src/grib_accessor_class_codetable.c | 782 ++-- src/grib_accessor_class_codetable_title.c | 209 +- src/grib_accessor_class_codetable_units.c | 207 +- src/grib_accessor_class_concept.c | 643 +-- src/grib_accessor_class_constant.c | 185 +- src/grib_accessor_class_count_file.c | 167 +- src/grib_accessor_class_count_missing.c | 266 +- src/grib_accessor_class_count_total.c | 167 +- src/grib_accessor_class_data_2order_packing.c | 1172 ++--- ...accessor_class_data_2order_packing_count.c | 259 +- src/grib_accessor_class_data_apply_bitmap.c | 401 +- ...ccessor_class_data_apply_boustrophedonic.c | 449 +- ..._class_data_apply_boustrophedonic_bitmap.c | 480 +- ..._accessor_class_data_apply_gdsnotpresent.c | 324 +- src/grib_accessor_class_data_ccsds_packing.c | 481 +- ...grib_accessor_class_data_complex_packing.c | 1029 +++-- src/grib_accessor_class_data_constant_field.c | 232 +- src/grib_accessor_class_data_dummy_field.c | 295 +- ...ib_accessor_class_data_g1complex_packing.c | 344 +- ...ta_g1second_order_constant_width_packing.c | 381 +- ..._g1second_order_general_extended_packing.c | 1479 +++--- ...lass_data_g1second_order_general_packing.c | 400 +- ...s_data_g1second_order_row_by_row_packing.c | 566 +-- ...b_accessor_class_data_g1secondary_bitmap.c | 267 +- ...b_accessor_class_data_g1shsimple_packing.c | 196 +- ...rib_accessor_class_data_g1simple_packing.c | 439 +- ...rib_accessor_class_data_g22order_packing.c | 882 ++-- ..._accessor_class_data_g2bifourier_packing.c | 802 ++-- ...ib_accessor_class_data_g2complex_packing.c | 246 +- ...b_accessor_class_data_g2secondary_bitmap.c | 253 +- ...b_accessor_class_data_g2shsimple_packing.c | 223 +- ...rib_accessor_class_data_g2simple_packing.c | 325 +- ...data_g2simple_packing_with_preprocessing.c | 375 +- ...rib_accessor_class_data_jpeg2000_packing.c | 617 +-- src/grib_accessor_class_data_png_packing.c | 567 ++- src/grib_accessor_class_data_raw_packing.c | 346 +- ...rib_accessor_class_data_secondary_bitmap.c | 258 +- src/grib_accessor_class_data_sh_packed.c | 511 ++- src/grib_accessor_class_data_sh_unpacked.c | 480 +- ...rib_accessor_class_data_shsimple_packing.c | 192 +- src/grib_accessor_class_data_simple_packing.c | 758 +-- src/grib_accessor_class_decimal_precision.c | 259 +- src/grib_accessor_class_dictionary.c | 442 +- src/grib_accessor_class_dirty.c | 171 +- src/grib_accessor_class_divdouble.c | 188 +- src/grib_accessor_class_double.c | 221 +- src/grib_accessor_class_element.c | 222 +- src/grib_accessor_class_evaluate.c | 173 +- ...grib_accessor_class_expanded_descriptors.c | 1003 ++-- src/grib_accessor_class_forward.c | 153 +- ...sor_class_from_scale_factor_scaled_value.c | 248 +- ...rib_accessor_class_g1_half_byte_codeflag.c | 210 +- src/grib_accessor_class_g1_increment.c | 272 +- src/grib_accessor_class_g1_message_length.c | 243 +- src/grib_accessor_class_g1_section4_length.c | 207 +- src/grib_accessor_class_g1area.c | 280 +- src/grib_accessor_class_g1bitmap.c | 242 +- src/grib_accessor_class_g1date.c | 316 +- ...ib_accessor_class_g1day_of_the_year_date.c | 230 +- ...accessor_class_g1end_of_interval_monthly.c | 315 +- src/grib_accessor_class_g1fcperiod.c | 189 +- src/grib_accessor_class_g1forecastmonth.c | 224 +- src/grib_accessor_class_g1monthlydate.c | 191 +- ...lass_g1number_of_coded_values_sh_complex.c | 239 +- ...class_g1number_of_coded_values_sh_simple.c | 214 +- src/grib_accessor_class_g1p1p2.c | 199 +- src/grib_accessor_class_g1param.c | 233 +- src/grib_accessor_class_g1step_range.c | 887 ++-- src/grib_accessor_class_g1verificationdate.c | 212 +- src/grib_accessor_class_g2_aerosol.c | 249 +- src/grib_accessor_class_g2_chemical.c | 241 +- src/grib_accessor_class_g2_eps.c | 347 +- src/grib_accessor_class_g2_mars_labeling.c | 801 ++-- src/grib_accessor_class_g2bitmap.c | 285 +- src/grib_accessor_class_g2bitmap_present.c | 199 +- src/grib_accessor_class_g2date.c | 227 +- src/grib_accessor_class_g2end_step.c | 523 ++- src/grib_accessor_class_g2grid.c | 362 +- src/grib_accessor_class_g2latlon.c | 226 +- src/grib_accessor_class_g2level.c | 388 +- src/grib_accessor_class_g2lon.c | 183 +- src/grib_accessor_class_g2step.c | 221 +- src/grib_accessor_class_g2step_range.c | 283 +- src/grib_accessor_class_gaussian_grid_name.c | 201 +- src/grib_accessor_class_gds_is_present.c | 238 +- ...ib_accessor_class_gds_not_present_bitmap.c | 263 +- src/grib_accessor_class_gen.c | 521 ++- src/grib_accessor_class_getenv.c | 198 +- src/grib_accessor_class_global_gaussian.c | 418 +- src/grib_accessor_class_group.c | 278 +- src/grib_accessor_class_gts_header.c | 226 +- src/grib_accessor_class_hash_array.c | 314 +- src/grib_accessor_class_headers_only.c | 169 +- src/grib_accessor_class_ibmfloat.c | 273 +- src/grib_accessor_class_ieeefloat.c | 263 +- src/grib_accessor_class_ifs_param.c | 242 +- src/grib_accessor_class_int16.c | 156 +- src/grib_accessor_class_int16_little_endian.c | 164 +- src/grib_accessor_class_int32.c | 156 +- src/grib_accessor_class_int32_little_endian.c | 164 +- src/grib_accessor_class_int64.c | 170 +- src/grib_accessor_class_int64_little_endian.c | 178 +- src/grib_accessor_class_int8.c | 166 +- src/grib_accessor_class_iterator.c | 192 +- src/grib_accessor_class_julian_date.c | 589 +-- src/grib_accessor_class_julian_day.c | 271 +- src/grib_accessor_class_ksec1expver.c | 209 +- src/grib_accessor_class_label.c | 152 +- src/grib_accessor_class_laplacian.c | 262 +- src/grib_accessor_class_latitudes.c | 376 +- src/grib_accessor_class_latlon_increment.c | 371 +- src/grib_accessor_class_latlonvalues.c | 220 +- src/grib_accessor_class_library_version.c | 186 +- src/grib_accessor_class_local_definition.c | 574 +-- src/grib_accessor_class_long.c | 278 +- src/grib_accessor_class_long_vector.c | 252 +- src/grib_accessor_class_longitudes.c | 365 +- src/grib_accessor_class_lookup.c | 220 +- src/grib_accessor_class_mars_param.c | 246 +- src/grib_accessor_class_mars_step.c | 241 +- src/grib_accessor_class_md5.c | 297 +- src/grib_accessor_class_message.c | 189 +- src/grib_accessor_class_message_copy.c | 175 +- src/grib_accessor_class_missing.c | 194 +- src/grib_accessor_class_nearest.c | 185 +- src/grib_accessor_class_non_alpha.c | 282 +- ...ib_accessor_class_number_of_coded_values.c | 218 +- src/grib_accessor_class_number_of_points.c | 220 +- ...accessor_class_number_of_points_gaussian.c | 521 ++- src/grib_accessor_class_number_of_values.c | 226 +- ..._class_number_of_values_data_raw_packing.c | 229 +- src/grib_accessor_class_octahedral_gaussian.c | 218 +- src/grib_accessor_class_octect_number.c | 183 +- src/grib_accessor_class_offset_file.c | 185 +- src/grib_accessor_class_offset_values.c | 231 +- src/grib_accessor_class_pack_bufr_values.c | 187 +- src/grib_accessor_class_pad.c | 182 +- src/grib_accessor_class_padding.c | 184 +- src/grib_accessor_class_padto.c | 184 +- src/grib_accessor_class_padtoeven.c | 186 +- src/grib_accessor_class_padtomultiple.c | 196 +- src/grib_accessor_class_position.c | 173 +- src/grib_accessor_class_raw.c | 243 +- src/grib_accessor_class_rdbtime_guess_date.c | 237 +- ...rib_accessor_class_reference_value_error.c | 196 +- src/grib_accessor_class_round.c | 185 +- src/grib_accessor_class_scale.c | 242 +- src/grib_accessor_class_scale_values.c | 232 +- ...cessor_class_second_order_bits_per_value.c | 279 +- src/grib_accessor_class_section.c | 209 +- src/grib_accessor_class_section_length.c | 177 +- src/grib_accessor_class_section_padding.c | 201 +- src/grib_accessor_class_section_pointer.c | 211 +- ...grib_accessor_class_select_step_template.c | 428 +- src/grib_accessor_class_sexagesimal2decimal.c | 323 +- src/grib_accessor_class_signed.c | 323 +- src/grib_accessor_class_signed_bits.c | 280 +- ...grib_accessor_class_simple_packing_error.c | 231 +- src/grib_accessor_class_size.c | 179 +- src/grib_accessor_class_smart_table.c | 588 +-- src/grib_accessor_class_smart_table_column.c | 353 +- src/grib_accessor_class_spd.c | 278 +- src/grib_accessor_class_spectral_truncation.c | 232 +- src/grib_accessor_class_sprintf.c | 304 +- src/grib_accessor_class_statistics.c | 382 +- src/grib_accessor_class_statistics_spectral.c | 342 +- src/grib_accessor_class_step_in_units.c | 421 +- src/grib_accessor_class_sum.c | 241 +- src/grib_accessor_class_suppressed.c | 205 +- src/grib_accessor_class_time.c | 246 +- src/grib_accessor_class_times.c | 262 +- src/grib_accessor_class_to_double.c | 337 +- src/grib_accessor_class_to_integer.c | 297 +- src/grib_accessor_class_to_string.c | 301 +- src/grib_accessor_class_transient.c | 163 +- src/grib_accessor_class_transient_darray.c | 299 +- src/grib_accessor_class_uint16.c | 164 +- ...grib_accessor_class_uint16_little_endian.c | 164 +- src/grib_accessor_class_uint32.c | 166 +- ...grib_accessor_class_uint32_little_endian.c | 164 +- src/grib_accessor_class_uint64.c | 180 +- ...grib_accessor_class_uint64_little_endian.c | 178 +- src/grib_accessor_class_uint8.c | 160 +- ...ib_accessor_class_unexpanded_descriptors.c | 286 +- src/grib_accessor_class_unpack_bufr_values.c | 219 +- src/grib_accessor_class_unsigned.c | 363 +- src/grib_accessor_class_unsigned_bits.c | 282 +- src/grib_accessor_class_validity_date.c | 296 +- src/grib_accessor_class_validity_time.c | 292 +- src/grib_accessor_class_values.c | 262 +- src/grib_accessor_class_variable.c | 432 +- src/grib_accessor_class_vector.c | 221 +- src/grib_accessor_class_when.c | 167 +- src/grib_api_version.c | 5 +- src/grib_bits.c | 141 +- src/grib_bits_any_endian.c | 229 +- src/grib_bits_any_endian_omp.c | 116 +- src/grib_bits_any_endian_simple.c | 143 +- src/grib_bits_any_endian_vector.c | 201 +- src/grib_bits_fast_big_endian.c | 137 +- src/grib_bits_fast_big_endian_omp.c | 592 ++- src/grib_bits_fast_big_endian_simple.c | 499 +- src/grib_bits_fast_big_endian_vector.c | 657 ++- src/grib_bits_ibmpow.c | 101 +- src/grib_bits_ibmpow_opt.c | 305 +- src/grib_box.c | 126 +- src/grib_box_class.c | 55 +- src/grib_box_class_gen.c | 54 +- src/grib_box_class_reduced_gaussian.c | 362 +- src/grib_box_class_regular_gaussian.c | 52 +- src/grib_buffer.c | 154 +- src/grib_bufr_descriptor.c | 144 +- src/grib_bufr_descriptors_array.c | 158 +- src/grib_compressor.c | 104 +- src/grib_concept.c | 37 +- src/grib_concept_index.c | 268 +- src/grib_context.c | 907 ++-- src/grib_darray.c | 118 +- src/grib_date.c | 148 +- src/grib_db.c | 1425 +++--- src/grib_dependency.c | 111 +- src/grib_dumper.c | 165 +- src/grib_dumper_class.c | 107 +- src/grib_dumper_class_bufr_decode_C.c | 863 ++-- src/grib_dumper_class_bufr_decode_filter.c | 680 +-- src/grib_dumper_class_bufr_decode_fortran.c | 755 +-- src/grib_dumper_class_bufr_decode_python.c | 759 +-- src/grib_dumper_class_bufr_encode_C.c | 1124 ++--- src/grib_dumper_class_bufr_encode_filter.c | 932 ++-- src/grib_dumper_class_bufr_encode_fortran.c | 1106 ++--- src/grib_dumper_class_bufr_encode_python.c | 1063 +++-- src/grib_dumper_class_bufr_simple.c | 938 ++-- src/grib_dumper_class_debug.c | 570 +-- src/grib_dumper_class_default.c | 720 +-- src/grib_dumper_class_grib_encode_C.c | 399 +- src/grib_dumper_class_json.c | 664 +-- src/grib_dumper_class_keys.c | 282 +- src/grib_dumper_class_serialize.c | 430 +- src/grib_dumper_class_wmo.c | 696 +-- src/grib_expression.c | 261 +- src/grib_expression_class_accessor.c | 139 +- src/grib_expression_class_binop.c | 142 +- src/grib_expression_class_column.c | 126 +- src/grib_expression_class_constant.c | 74 +- src/grib_expression_class_double.c | 100 +- src/grib_expression_class_functor.c | 131 +- src/grib_expression_class_is_in_dict.c | 297 +- src/grib_expression_class_is_in_list.c | 212 +- src/grib_expression_class_is_integer.c | 163 +- src/grib_expression_class_length.c | 125 +- src/grib_expression_class_logical_and.c | 169 +- src/grib_expression_class_logical_or.c | 171 +- src/grib_expression_class_long.c | 100 +- src/grib_expression_class_string.c | 92 +- src/grib_expression_class_string_compare.c | 137 +- src/grib_expression_class_sub_string.c | 100 +- src/grib_expression_class_true.c | 88 +- src/grib_expression_class_unop.c | 113 +- src/grib_fieldset.c | 1009 ++-- src/grib_filepool.c | 348 +- src/grib_gaussian_reduced.c | 219 +- src/grib_geography.c | 182 +- src/grib_handle.c | 1688 +++---- src/grib_hash_array.c | 53 +- src/grib_header_compute.c | 412 +- src/grib_iarray.c | 190 +- src/grib_ibmfloat.c | 183 +- src/grib_ieeefloat.c | 416 +- src/grib_index.c | 1631 ++++--- src/grib_io.c | 1538 ++++--- src/grib_iterator.c | 127 +- src/grib_iterator_class.c | 55 +- src/grib_iterator_class_gaussian.c | 161 +- src/grib_iterator_class_gaussian_reduced.c | 317 +- src/grib_iterator_class_gen.c | 139 +- ...rator_class_lambert_azimuthal_equal_area.c | 310 +- src/grib_iterator_class_lambert_conformal.c | 231 +- src/grib_iterator_class_latlon.c | 171 +- src/grib_iterator_class_latlon_reduced.c | 255 +- src/grib_iterator_class_polar_stereographic.c | 244 +- src/grib_iterator_class_regular.c | 167 +- src/grib_iterator_class_space_view.c | 275 +- src/grib_itrie.c | 637 +-- src/grib_itrie_keys.c | 635 +-- src/grib_jasper_encoding.c | 171 +- src/grib_keys_iterator.c | 128 +- src/grib_loader_from_array.c | 226 +- src/grib_loader_from_file.c | 266 +- src/grib_loader_from_handle.c | 301 +- src/grib_memory.c | 366 +- src/grib_nearest.c | 257 +- src/grib_nearest_class.c | 53 +- src/grib_nearest_class_gen.c | 66 +- src/grib_nearest_class_lambert_conformal.c | 262 +- src/grib_nearest_class_latlon_reduced.c | 457 +- src/grib_nearest_class_polar_stereographic.c | 262 +- src/grib_nearest_class_reduced.c | 694 +-- src/grib_nearest_class_regular.c | 333 +- src/grib_nearest_class_sh.c | 300 +- src/grib_oarray.c | 99 +- src/grib_openjpeg_encoding.c | 263 +- src/grib_optimize_decimal_factor.c | 136 +- src/grib_parse_utils.c | 959 ++-- src/grib_query.c | 626 +-- src/grib_rules.c | 20 +- src/grib_sarray.c | 99 +- src/grib_scaling.c | 97 +- src/grib_templates.c | 137 +- src/grib_timer.c | 224 +- src/grib_trie.c | 668 +-- src/grib_trie_with_rank.c | 655 +-- src/grib_util.c | 2102 +++++---- src/grib_value.c | 1900 ++++---- src/grib_vdarray.c | 102 +- src/grib_viarray.c | 96 +- src/grib_vsarray.c | 100 +- src/make_class.pl | 26 +- src/md5.c | 319 +- src/minmax_val.c | 148 +- src/string_util.c | 50 +- tests/CMakeLists.txt | 1 + tests/grib_ecc-1065.sh | 28 + tests/grib_sh_ieee64.sh | 5 - tests/grib_to_netcdf.sh | 15 +- tests/unit_tests.c | 16 +- tools/big2gribex.c | 88 +- tools/bufr_3to4.c | 153 +- tools/bufr_compare.c | 1482 +++--- tools/bufr_copy.c | 91 +- tools/bufr_dump.c | 594 +-- tools/bufr_filter.c | 82 +- tools/bufr_get.c | 78 +- tools/bufr_index_build.c | 125 +- tools/bufr_ls.c | 100 +- tools/bufr_set.c | 122 +- tools/bufr_split_by_rdbSubtype.c | 163 +- tools/codes_count.c | 110 +- tools/codes_info.c | 127 +- tools/codes_parser.c | 35 +- tools/codes_split_file.c | 103 +- tools/compile.c | 72 +- tools/gaussian.c | 33 +- tools/gg_sub_area_check.c | 291 +- tools/grib2ppm.c | 209 +- tools/grib_2_request.c | 118 +- tools/grib_check_gaussian_grid.c | 163 +- tools/grib_compare.c | 1403 +++--- tools/grib_copy.c | 110 +- tools/grib_dump.c | 195 +- tools/grib_filter.c | 84 +- tools/grib_get.c | 227 +- tools/grib_get_data.c | 344 +- tools/grib_histogram.c | 97 +- tools/grib_index_build.c | 125 +- tools/grib_ls.c | 425 +- tools/grib_merge.c | 423 +- tools/grib_nearest_land.c | 196 +- tools/grib_options.c | 517 ++- tools/grib_repair.c | 91 +- tools/grib_set.c | 133 +- tools/grib_to_json.c | 134 +- tools/grib_to_netcdf.c | 3154 ++++++------- tools/grib_tools.c | 1227 ++--- tools/gts_compare.c | 962 ++-- tools/gts_copy.c | 83 +- tools/gts_dump.c | 175 +- tools/gts_filter.c | 87 +- tools/gts_get.c | 76 +- tools/gts_ls.c | 74 +- tools/list_keys.c | 107 +- tools/load.c | 235 +- tools/mars_request.c | 60 +- tools/metar_compare.c | 1300 +++--- tools/metar_copy.c | 83 +- tools/metar_dump.c | 120 +- tools/metar_filter.c | 78 +- tools/metar_get.c | 82 +- tools/metar_ls.c | 103 +- tools/taf_dump.c | 126 +- tools/taf_filter.c | 82 +- tools/taf_get.c | 87 +- tools/taf_ls.c | 162 +- tools/test.c | 39 +- tools/wingetopt.c | 40 +- tools/xref.c | 33 +- 511 files changed, 75970 insertions(+), 71214 deletions(-) create mode 100644 .clang-format create mode 100755 tests/grib_ecc-1065.sh mode change 100755 => 100644 tools/codes_parser.c mode change 100755 => 100644 tools/compile.c mode change 100755 => 100644 tools/list_keys.c mode change 100755 => 100644 tools/xref.c diff --git a/.clang-format b/.clang-format new file mode 100644 index 000000000..6570f09ec --- /dev/null +++ b/.clang-format @@ -0,0 +1,106 @@ +--- +Language: Cpp +AccessModifierOffset: -4 +AlignAfterOpenBracket: Align +AlignConsecutiveAssignments: true +AlignConsecutiveDeclarations: false +AlignEscapedNewlines: Left +AlignOperands: true +AlignTrailingComments: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortBlocksOnASingleLine: true +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: Inline +AllowShortIfStatementsOnASingleLine: true +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: true +AlwaysBreakTemplateDeclarations: true +BinPackArguments: true +BinPackParameters: true +BraceWrapping: + AfterClass: true + AfterControlStatement: false + AfterEnum: true + AfterFunction: true + AfterNamespace: true + AfterObjCDeclaration: false + AfterStruct: true + AfterUnion: true + BeforeCatch: true + BeforeElse: true + IndentBraces: false + SplitEmptyFunction: true + SplitEmptyRecord: true + SplitEmptyNamespace: true +BreakBeforeBinaryOperators: None +BreakBeforeBraces: Custom +BreakBeforeInheritanceComma: false +BreakBeforeTernaryOperators: true +BreakConstructorInitializersBeforeComma: false +BreakConstructorInitializers: AfterColon +BreakAfterJavaFieldAnnotations: false +BreakStringLiterals: true +ColumnLimit: 0 +CommentPragmas: '^ IWYU pragma:' +CompactNamespaces: false +ConstructorInitializerAllOnOneLineOrOnePerLine: true +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 4 +Cpp11BracedListStyle: false +DerivePointerAlignment: false +DisableFormat: false +ExperimentalAutoDetectBinPacking: false +FixNamespaceComments: true +ForEachMacros: + - foreach + - Q_FOREACH + - BOOST_FOREACH +IncludeCategories: + - Regex: '^<.*\.h>' + Priority: 1 + - Regex: '^<.*' + Priority: 2 + - Regex: '.*' + Priority: 3 +IncludeIsMainRegex: '([-_](test|unittest))?$' +IndentCaseLabels: true +IndentWidth: 4 +IndentWrappedFunctionNames: false +JavaScriptQuotes: Leave +JavaScriptWrapImports: true +KeepEmptyLinesAtTheStartOfBlocks: false +MacroBlockBegin: '' +MacroBlockEnd: '' +MaxEmptyLinesToKeep: 2 +NamespaceIndentation: None +ObjCBlockIndentWidth: 2 +ObjCSpaceAfterProperty: false +ObjCSpaceBeforeProtocolList: false +PenaltyBreakAssignment: 2 +PenaltyBreakBeforeFirstCallParameter: 1 +PenaltyBreakComment: 300 +PenaltyBreakFirstLessLess: 120 +PenaltyBreakString: 1000 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 200 +PointerAlignment: Left +ReflowComments: true +SortIncludes: false +SortUsingDeclarations: true +SpaceAfterCStyleCast: false +SpaceAfterTemplateKeyword: true +SpaceBeforeAssignmentOperators: true +SpaceBeforeParens: ControlStatements +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 2 +SpacesInAngles: false +SpacesInContainerLiterals: true +SpacesInCStyleCastParentheses: false +SpacesInParentheses: false +SpacesInSquareBrackets: false +Standard: Auto +TabWidth: 4 +UseTab: Never +... diff --git a/examples/C/box.c b/examples/C/box.c index b7d9166bc..58b640c53 100644 --- a/examples/C/box.c +++ b/examples/C/box.c @@ -13,53 +13,52 @@ int main(int argc, char* argv[]) { FILE* f; - int err=0; - char infile[]="../../data/reduced_gaussian_model_level.grib1"; - codes_handle *h=NULL; + int err = 0; + char infile[] = "../../data/reduced_gaussian_model_level.grib1"; + codes_handle* h = NULL; codes_box* box; codes_points* points; - codes_context* c=codes_context_get_default(); - double north,west,south,east; + codes_context* c = codes_context_get_default(); + double north, west, south, east; double* val; int i; - north=60; - south=10; - west=-10; - east=30; + north = 60; + south = 10; + west = -10; + east = 30; - f=fopen(infile,"rb"); + f = fopen(infile, "rb"); if (!f) { perror(infile); exit(1); } - h=codes_handle_new_from_file(c, f, PRODUCT_GRIB, &err); + h = codes_handle_new_from_file(c, f, PRODUCT_GRIB, &err); if (!h) { - printf("unable to create handle from file %s\n",infile); + printf("unable to create handle from file %s\n", infile); exit(err); } - box=codes_box_new(h,&err); + box = codes_box_new(h, &err); if (!box) { printf("unable to create box\n"); exit(err); } - points=codes_box_get_points(box,north,west,south,east,&err); + points = codes_box_get_points(box, north, west, south, east, &err); - val=(double*)malloc(sizeof(double)*points->n); - codes_points_get_values(h,points,val); + val = (double*)malloc(sizeof(double) * points->n); + codes_points_get_values(h, points, val); - for (i=0;in;i++) { - printf("%d -- %.3f %.3f %ld %g\n",i, - points->latitudes[i], points->longitudes[i], (long)(points->indexes[i]), val[i]); + for (i = 0; i < points->n; i++) { + printf("%d -- %.3f %.3f %ld %g\n", i, + points->latitudes[i], points->longitudes[i], (long)(points->indexes[i]), val[i]); } free(val); fclose(f); return 0; - } diff --git a/examples/C/bufr_attributes.c b/examples/C/bufr_attributes.c index 12af8ca84..7a5f744ef 100644 --- a/examples/C/bufr_attributes.c +++ b/examples/C/bufr_attributes.c @@ -18,42 +18,41 @@ #include "eccodes.h" -int main(int argc,char* argv[]) +int main(int argc, char* argv[]) { FILE* in = NULL; /* message handle. Required in all the eccodes calls acting on a message.*/ - codes_handle* h=NULL; + codes_handle* h = NULL; - char* units= NULL; - char* unitsPercent= NULL; + char* units = NULL; + char* unitsPercent = NULL; long longVal; double doubleVal; - size_t len=0; - int err=0; - int cnt=0; + size_t len = 0; + int err = 0; + int cnt = 0; const char* infile = "../../data/bufr/syno_multi.bufr"; - in=fopen(infile,"rb"); + in = fopen(infile, "rb"); if (!in) { printf("ERROR: unable to open file %s\n", infile); return 1; } /* loop over the messages in the bufr file */ - while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) - { + while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) { if (h == NULL) { - printf("Error: unable to create handle for message %d\n",cnt); + printf("Error: unable to create handle for message %d\n", cnt); cnt++; continue; } - printf("message: %d\n",cnt); + printf("message: %d\n", cnt); /* we need to instruct ecCodes to expand the descriptors i.e. unpack the data values */ - CODES_CHECK(codes_set_long(h, "unpack", 1),0); + CODES_CHECK(codes_set_long(h, "unpack", 1), 0); /* ---------------------------------------------------------------- We will read the value and all the attributes available for @@ -61,34 +60,34 @@ int main(int argc,char* argv[]) -------------------------------------------------------------------*/ /* get the value as double */ - CODES_CHECK(codes_get_double(h, "airTemperatureAt2M", &doubleVal),0); - printf(" airTemperatureAt2M: %.2f\n",doubleVal); + CODES_CHECK(codes_get_double(h, "airTemperatureAt2M", &doubleVal), 0); + printf(" airTemperatureAt2M: %.2f\n", doubleVal); /* get the element's code (see BUFR code table B) */ - CODES_CHECK(codes_get_long(h, "airTemperatureAt2M->code", &longVal),0); - printf(" airTemperatureAt2M->code: %ld\n",longVal); + CODES_CHECK(codes_get_long(h, "airTemperatureAt2M->code", &longVal), 0); + printf(" airTemperatureAt2M->code: %ld\n", longVal); /* get the element's units (see BUFR code table B) */ /* get the size and allocate memory*/ CODES_CHECK(codes_get_length(h, "airTemperatureAt2M->units", &len), 0); - units = (char*)malloc(len*sizeof(char)); + units = (char*)malloc(len * sizeof(char)); /* get the values*/ codes_get_string(h, "airTemperatureAt2M->units", units, &len); printf(" airTemperatureAt2M->units: %s\n", units); /* get the element's scale (see BUFR code table B) */ - CODES_CHECK(codes_get_long(h, "airTemperatureAt2M->scale", &longVal),0); - printf(" airTemperatureAt2M->scale: %ld\n",longVal); + CODES_CHECK(codes_get_long(h, "airTemperatureAt2M->scale", &longVal), 0); + printf(" airTemperatureAt2M->scale: %ld\n", longVal); /* get the element's reference (see BUFR code table B) */ - CODES_CHECK(codes_get_long(h, "airTemperatureAt2M->reference", &longVal),0); - printf(" airTemperatureAt2M->reference: %ld\n",longVal); + CODES_CHECK(codes_get_long(h, "airTemperatureAt2M->reference", &longVal), 0); + printf(" airTemperatureAt2M->reference: %ld\n", longVal); /* get the element's width (see BUFR code table B) */ - CODES_CHECK(codes_get_long(h, "airTemperatureAt2M->width", &longVal),0); - printf(" airTemperatureAt2M->width: %ld\n",longVal); + CODES_CHECK(codes_get_long(h, "airTemperatureAt2M->width", &longVal), 0); + printf(" airTemperatureAt2M->width: %ld\n", longVal); /* ----------------------------------------------------------------- The 2m temperature data element in this message has an associated @@ -97,34 +96,34 @@ int main(int argc,char* argv[]) ----------------------------------------------------------------- */ /* get the value as long */ - CODES_CHECK(codes_get_long(h, "airTemperatureAt2M->percentConfidence", &longVal),0); - printf(" airTemperatureAt2M->percentConfidence: %ld\n",longVal); + CODES_CHECK(codes_get_long(h, "airTemperatureAt2M->percentConfidence", &longVal), 0); + printf(" airTemperatureAt2M->percentConfidence: %ld\n", longVal); /* get the element's code (see BUFR code table B) */ - CODES_CHECK(codes_get_long(h, "airTemperatureAt2M->percentConfidence->code", &longVal),0); - printf(" airTemperatureAt2M->percentConfidence->code: %ld\n",longVal); + CODES_CHECK(codes_get_long(h, "airTemperatureAt2M->percentConfidence->code", &longVal), 0); + printf(" airTemperatureAt2M->percentConfidence->code: %ld\n", longVal); /* get the element's units (see BUFR code table B) */ /* get the size and allocate memory*/ CODES_CHECK(codes_get_length(h, "airTemperatureAt2M->percentConfidence->units", &len), 0); - unitsPercent = (char*)malloc(len*sizeof(char)); + unitsPercent = (char*)malloc(len * sizeof(char)); /* get the values*/ codes_get_string(h, "airTemperatureAt2M->percentConfidence->units", unitsPercent, &len); printf(" airTemperatureAt2M->percentConfidence->units: %s\n", unitsPercent); /* get the element's scale (see BUFR code table B) */ - CODES_CHECK(codes_get_long(h, "airTemperatureAt2M->percentConfidence->scale", &longVal),0); - printf(" airTemperatureAt2M->percentConfidence->scale: %ld\n",longVal); + CODES_CHECK(codes_get_long(h, "airTemperatureAt2M->percentConfidence->scale", &longVal), 0); + printf(" airTemperatureAt2M->percentConfidence->scale: %ld\n", longVal); /* get the element's reference (see BUFR code table B) */ - CODES_CHECK(codes_get_long(h, "airTemperatureAt2M->percentConfidence->reference", &longVal),0); - printf(" airTemperatureAt2M->percentConfidence->reference: %ld\n",longVal); + CODES_CHECK(codes_get_long(h, "airTemperatureAt2M->percentConfidence->reference", &longVal), 0); + printf(" airTemperatureAt2M->percentConfidence->reference: %ld\n", longVal); /* get the element's width (see BUFR code table B) */ - CODES_CHECK(codes_get_long(h, "airTemperatureAt2M->percentConfidence->width", &longVal),0); - printf(" airTemperatureAt2M->percentConfidence->width: %ld\n",longVal); + CODES_CHECK(codes_get_long(h, "airTemperatureAt2M->percentConfidence->width", &longVal), 0); + printf(" airTemperatureAt2M->percentConfidence->width: %ld\n", longVal); /* free allocated arrays */ free(units); diff --git a/examples/C/bufr_clone.c b/examples/C/bufr_clone.c index e354700fa..f68e0fda7 100644 --- a/examples/C/bufr_clone.c +++ b/examples/C/bufr_clone.c @@ -18,21 +18,21 @@ #include #include "eccodes.h" -static void usage(const char *app) +static void usage(const char* app) { - fprintf(stderr,"Usage is: %s input_file ouput_file\n", app); + fprintf(stderr, "Usage is: %s input_file ouput_file\n", app); } -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - FILE *in = NULL; - FILE *out = NULL; + FILE* in = NULL; + FILE* out = NULL; /* message handle. Required in all the ecCodes calls acting on a message.*/ - codes_handle *source_handle = NULL; + codes_handle* source_handle = NULL; - const void *buffer = NULL; - size_t size = 0; + const void* buffer = NULL; + size_t size = 0; int i, err = 0; if (argc != 3) { @@ -40,8 +40,8 @@ int main(int argc, char *argv[]) return 1; } - in = fopen(argv[1],"rb"); - out = fopen(argv[2],"wb"); + in = fopen(argv[1], "rb"); + out = fopen(argv[2], "wb"); /* open input and output */ if (!in || !out) { @@ -64,10 +64,9 @@ int main(int argc, char *argv[]) /* create several clones of this message and alter them in different ways */ - for(i=0; i < 3; i++) { - + for (i = 0; i < 3; i++) { /* clone the current handle */ - codes_handle *clone_handle = codes_handle_clone(source_handle); + codes_handle* clone_handle = codes_handle_clone(source_handle); if (clone_handle == NULL) { perror("ERROR: could not clone field"); @@ -77,13 +76,13 @@ int main(int argc, char *argv[]) /* This is the place where you may wish to modify the clone E.g. we change the typicalDay key */ - CODES_CHECK(codes_set_long(clone_handle, "typicalDay", 20+i),0); + CODES_CHECK(codes_set_long(clone_handle, "typicalDay", 20 + i), 0); /* get the coded message in a buffer */ - CODES_CHECK(codes_get_message(clone_handle, &buffer, &size),0); + CODES_CHECK(codes_get_message(clone_handle, &buffer, &size), 0); /* write the buffer to a file */ - if(fwrite(buffer, 1, size, out) != size) { + if (fwrite(buffer, 1, size, out) != size) { perror("ERROR: could not write message to file"); return 1; } diff --git a/examples/C/bufr_copy_data.c b/examples/C/bufr_copy_data.c index fb6f3bdfe..3c9f7eba6 100644 --- a/examples/C/bufr_copy_data.c +++ b/examples/C/bufr_copy_data.c @@ -19,35 +19,35 @@ static void usage(const char* progname); -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - FILE* f = NULL; - codes_handle* h = NULL; + FILE* f = NULL; + codes_handle* h = NULL; codes_handle* ho = NULL; long size; - char** keys = NULL; - size_t nkeys=0,i; - int err=0; - char* outfile = NULL; + char** keys = NULL; + size_t nkeys = 0, i; + int err = 0; + char* outfile = NULL; const char* sampleName = "BUFR3"; - const long ibitmap[]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,0}; + const long ibitmap[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 0 }; - const long ud[]={307011,7006,10004,222000,101023,31031,1031,1032,101023,33007, - 225000,236000,101023,31031,1031,1032,8024,101001,225255,225000, - 236000,101023,31031,1031,1032,8024,101001,225255, - 1063,2001,4001,4002,4003,4004,4005,5002, - 6002,7001,7006,11001,11016,11017,11002}; + const long ud[] = { 307011, 7006, 10004, 222000, 101023, 31031, 1031, 1032, 101023, 33007, + 225000, 236000, 101023, 31031, 1031, 1032, 8024, 101001, 225255, 225000, + 236000, 101023, 31031, 1031, 1032, 8024, 101001, 225255, + 1063, 2001, 4001, 4002, 4003, 4004, 4005, 5002, + 6002, 7001, 7006, 11001, 11016, 11017, 11002 }; if (argc != 3) usage(argv[0]); - outfile=argv[2]; + outfile = argv[2]; - f = fopen(argv[1],"rb"); - if(!f) { + f = fopen(argv[1], "rb"); + if (!f) { perror(argv[1]); exit(1); } @@ -58,7 +58,7 @@ int main(int argc, char *argv[]) return 1; } - size = sizeof(ibitmap)/sizeof(ibitmap[0]); + size = sizeof(ibitmap) / sizeof(ibitmap[0]); CODES_CHECK(codes_set_long_array(ho, "inputDataPresentIndicator", ibitmap, size), 0); CODES_CHECK(codes_set_long(ho, "bufrHeaderCentre", 98), 0); CODES_CHECK(codes_set_long(ho, "updateSequenceNumber", 1), 0); @@ -75,17 +75,16 @@ int main(int argc, char *argv[]) CODES_CHECK(codes_set_long(ho, "observedData", 1), 0); CODES_CHECK(codes_set_long(ho, "compressedData", 0), 0); - size = sizeof(ud)/sizeof(ud[0]); - codes_set_long_array(ho,"unexpandedDescriptors",ud,size); + size = sizeof(ud) / sizeof(ud[0]); + codes_set_long_array(ho, "unexpandedDescriptors", ud, size); - while((h = codes_handle_new_from_file(0,f,PRODUCT_BUFR,&err)) != NULL) - { - if(!h) { + while ((h = codes_handle_new_from_file(0, f, PRODUCT_BUFR, &err)) != NULL) { + if (!h) { printf("ERROR: Unable to create BUFR handle\n"); return 1; } /* codes_copy_key(h,ho,"unexpandedDescriptors",0); */ - err = codes_set_long(h,"unpack",1); + err = codes_set_long(h, "unpack", 1); if (err) { printf("ERROR: Unable to unpack BUFR message. Quitting\n"); printf(" %s\n", codes_get_error_message(err)); @@ -93,9 +92,9 @@ int main(int argc, char *argv[]) } /* err=codes_bufr_copy_data(h,ho); */ - keys=codes_bufr_copy_data_return_copied_keys(h,ho,&nkeys,&err); - for (i=0;i value missing\n"); } - else - { + else { printf(" --> value present\n"); } diff --git a/examples/C/bufr_pthreads.c b/examples/C/bufr_pthreads.c index 08b9ae9d7..2d03c5d29 100644 --- a/examples/C/bufr_pthreads.c +++ b/examples/C/bufr_pthreads.c @@ -22,36 +22,36 @@ static void* process_bufr(void* arg) { - FILE* fin = (FILE*)arg; - int err = 0; + FILE* fin = (FILE*)arg; + int err = 0; codes_handle* h = NULL; long numSubsets = 0, lVal = 0; - size_t size = 0, i=0; + size_t size = 0, i = 0; double* dValues = NULL; /* Each thread gets a different message handle */ h = codes_handle_new_from_file(NULL, fin, PRODUCT_BUFR, &err); assert(h); /* Check expected values for this BUFR file */ - CODES_CHECK(codes_get_long(h,"numberOfSubsets", &numSubsets),0); - assert( numSubsets == 1 ); + CODES_CHECK(codes_get_long(h, "numberOfSubsets", &numSubsets), 0); + assert(numSubsets == 1); CODES_CHECK(codes_get_long(h, "rectimeSecond", &lVal), 0); - assert( lVal == 27 ); + assert(lVal == 27); - CODES_CHECK(codes_set_long(h, "unpack", 1),0); + CODES_CHECK(codes_set_long(h, "unpack", 1), 0); - dValues = (double*)malloc(numSubsets*sizeof(double)); + dValues = (double*)malloc(numSubsets * sizeof(double)); assert(dValues); size = numSubsets; CODES_CHECK(codes_get_double_array(h, "latitude", dValues, &size), 0); - for(i=0; i 70 ); + assert(dValues[0] < 79 && dValues[0] > 70); } free(dValues); - + /* Some encoding too */ - CODES_CHECK(codes_set_long(h, "bufrHeaderCentre", 88),0); + CODES_CHECK(codes_set_long(h, "bufrHeaderCentre", 88), 0); CODES_CHECK(codes_set_long(h, "blockNumber", 2), 0); CODES_CHECK(codes_set_long(h, "#3#verticalSignificanceSurfaceObservations", 8), 0); CODES_CHECK(codes_set_long(h, "pack", 1), 0); @@ -62,20 +62,20 @@ static void* process_bufr(void* arg) int main(int argc, char** argv) { pthread_t thread1, thread2, thread3; - int err = 0; - FILE* fin = 0; + int err = 0; + FILE* fin = 0; codes_handle* h1 = 0; codes_handle* h2 = 0; - fin = fopen("../../data/bufr/syno_multi.bufr", "rb"); + fin = fopen("../../data/bufr/syno_multi.bufr", "rb"); assert(fin); - err = pthread_create(&thread1, NULL, process_bufr, (void *)fin); + err = pthread_create(&thread1, NULL, process_bufr, (void*)fin); assert(!err); - err = pthread_create(&thread2, NULL, process_bufr, (void *)fin); + err = pthread_create(&thread2, NULL, process_bufr, (void*)fin); assert(!err); - err = pthread_create(&thread3, NULL, process_bufr, (void *)fin); + err = pthread_create(&thread3, NULL, process_bufr, (void*)fin); assert(!err); pthread_join(thread1, NULL); diff --git a/examples/C/bufr_read_header.c b/examples/C/bufr_read_header.c index e61a5e014..cd715d18a 100644 --- a/examples/C/bufr_read_header.c +++ b/examples/C/bufr_read_header.c @@ -17,67 +17,67 @@ #include "eccodes.h" -static void usage(const char* prog) { - printf("usage: %s infile\n",prog); +static void usage(const char* prog) +{ + printf("usage: %s infile\n", prog); exit(1); } -int main(int argc,char* argv[]) +int main(int argc, char* argv[]) { char* filename = NULL; - FILE* in = NULL; + FILE* in = NULL; /* message handle. Required in all the eccodes calls acting on a message.*/ - codes_handle* h=NULL; + codes_handle* h = NULL; long longVal; - int err=0, cnt=0; + int err = 0, cnt = 0; - if (argc!=2) usage(argv[0]); + if (argc != 2) usage(argv[0]); - filename=argv[1]; + filename = argv[1]; - in=fopen(filename,"rb"); + in = fopen(filename, "rb"); if (!in) { printf("ERROR: unable to open file %s\n", filename); return 1; } /* loop over the messages in the bufr file */ - while ((h = codes_handle_new_from_file(NULL,in,PRODUCT_BUFR,&err)) != NULL || err != CODES_SUCCESS) - { + while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) { if (h == NULL) { - printf("Error: unable to create handle for message %d\n",cnt); + printf("Error: unable to create handle for message %d\n", cnt); cnt++; continue; } - printf("message: %d\n",cnt); + printf("message: %d\n", cnt); /* get and print some keys form the BUFR header */ - CODES_CHECK(codes_get_long(h,"dataCategory",&longVal),0); - printf(" dataCategory: %ld\n",longVal); + CODES_CHECK(codes_get_long(h, "dataCategory", &longVal), 0); + printf(" dataCategory: %ld\n", longVal); - CODES_CHECK(codes_get_long(h,"dataSubCategory",&longVal),0); - printf(" dataSubCategory: %ld\n",longVal); + CODES_CHECK(codes_get_long(h, "dataSubCategory", &longVal), 0); + printf(" dataSubCategory: %ld\n", longVal); - CODES_CHECK(codes_get_long(h,"typicalDate",&longVal),0); - printf(" typicalDate: %ld\n",longVal); + CODES_CHECK(codes_get_long(h, "typicalDate", &longVal), 0); + printf(" typicalDate: %ld\n", longVal); - CODES_CHECK(codes_get_long(h,"bufrHeaderCentre",&longVal),0); - printf(" bufrHeaderCentre: %ld\n",longVal); + CODES_CHECK(codes_get_long(h, "bufrHeaderCentre", &longVal), 0); + printf(" bufrHeaderCentre: %ld\n", longVal); - CODES_CHECK(codes_get_long(h,"bufrHeaderSubCentre",&longVal),0); - printf(" bufrHeaderSubCentre: %ld\n",longVal); + CODES_CHECK(codes_get_long(h, "bufrHeaderSubCentre", &longVal), 0); + printf(" bufrHeaderSubCentre: %ld\n", longVal); - CODES_CHECK(codes_get_long(h,"masterTablesVersionNumber",&longVal),0); - printf(" masterTablesVersionNumber: %ld\n",longVal); + CODES_CHECK(codes_get_long(h, "masterTablesVersionNumber", &longVal), 0); + printf(" masterTablesVersionNumber: %ld\n", longVal); - CODES_CHECK(codes_get_long(h,"localTablesVersionNumber",&longVal),0); - printf(" localTablesVersionNumber: %ld\n",longVal); + CODES_CHECK(codes_get_long(h, "localTablesVersionNumber", &longVal), 0); + printf(" localTablesVersionNumber: %ld\n", longVal); - CODES_CHECK(codes_get_long(h,"numberOfSubsets",&longVal),0); - printf(" numberOfSubsets: %ld\n",longVal); + CODES_CHECK(codes_get_long(h, "numberOfSubsets", &longVal), 0); + printf(" numberOfSubsets: %ld\n", longVal); /* delete handle */ codes_handle_delete(h); diff --git a/examples/C/bufr_read_scatterometer.c b/examples/C/bufr_read_scatterometer.c index f1bf5e791..1cba6fcc3 100644 --- a/examples/C/bufr_read_scatterometer.c +++ b/examples/C/bufr_read_scatterometer.c @@ -23,41 +23,40 @@ #include "eccodes.h" -int main(int argc,char* argv[]) +int main(int argc, char* argv[]) { FILE* in = NULL; /* Message handle. Required in all the eccodes calls acting on a message.*/ - codes_handle* h=NULL; + codes_handle* h = NULL; - double *lat=NULL, *lon=NULL, *bscatter=NULL; - long numObs=0; - size_t len=0; - int i, err=0; - int cnt=0; + double *lat = NULL, *lon = NULL, *bscatter = NULL; + long numObs = 0; + size_t len = 0; + int i, err = 0; + int cnt = 0; const char* infile = "../../data/bufr/asca_139.bufr"; char key_name[128]; - in=fopen(infile,"rb"); + in = fopen(infile, "rb"); if (!in) { printf("ERROR: unable to open file %s\n", infile); return 1; } /* Loop over the messages in the bufr file */ - while ((h = codes_handle_new_from_file(NULL,in,PRODUCT_BUFR,&err)) != NULL || err != CODES_SUCCESS) - { + while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) { if (h == NULL) { - printf("Error: unable to create handle for message %d\n",cnt); + printf("Error: unable to create handle for message %d\n", cnt); cnt++; continue; } - printf("message: %d\n",cnt); + printf("message: %d\n", cnt); /* We need to instruct ecCodes to expand the descriptors * i.e. unpack the data values */ - CODES_CHECK(codes_set_long(h,"unpack",1),0); + CODES_CHECK(codes_set_long(h, "unpack", 1), 0); /* The BUFR file contains a single message with 2016 subsets in a compressed form. * It means each subset has exactly the same structure: they store one location with @@ -67,60 +66,60 @@ int main(int argc,char* argv[]) * we will simply access the key by condition (see below) */ /* Get the total number of subsets. */ - CODES_CHECK(codes_get_long(h,"numberOfSubsets",&numObs),0); + CODES_CHECK(codes_get_long(h, "numberOfSubsets", &numObs), 0); - printf("Number of values: %ld\n",numObs); + printf("Number of values: %ld\n", numObs); /* Get latitude */ - sprintf(key_name,"latitude"); + sprintf(key_name, "latitude"); /* Check the size (including all the subsets) */ - CODES_CHECK(codes_get_size(h,key_name,&len),0); - if(len != numObs) { - printf("inconsistent number of %s values found!\n",key_name); + CODES_CHECK(codes_get_size(h, key_name, &len), 0); + if (len != numObs) { + printf("inconsistent number of %s values found!\n", key_name); return 1; } /* Allocate memory for the values to be read. Each * parameter must have the same number of values. */ - lat = (double*)malloc(numObs*sizeof(double)); + lat = (double*)malloc(numObs * sizeof(double)); /* Get the values (from all the subsets) */ - CODES_CHECK(codes_get_double_array(h,key_name,lat,&len),0); + CODES_CHECK(codes_get_double_array(h, key_name, lat, &len), 0); /* Get longitude */ - sprintf(key_name,"longitude"); + sprintf(key_name, "longitude"); /* Check the size (including all the subsets) */ - CODES_CHECK(codes_get_size(h,key_name,&len),0); - if(len != numObs) { - printf("inconsistent number of %s values found!\n",key_name); + CODES_CHECK(codes_get_size(h, key_name, &len), 0); + if (len != numObs) { + printf("inconsistent number of %s values found!\n", key_name); return 1; } /* Get the values (from all the subsets) */ - lon = (double*)malloc(numObs*sizeof(double)); - CODES_CHECK(codes_get_double_array(h,key_name,lon,&len),0); + lon = (double*)malloc(numObs * sizeof(double)); + CODES_CHECK(codes_get_double_array(h, key_name, lon, &len), 0); /* Get backScatter for beam two. We use an access by condition for this key. */ - sprintf(key_name,"/beamIdentifier=2/backscatter"); + sprintf(key_name, "/beamIdentifier=2/backscatter"); /* Check the size (including all the subsets) */ - CODES_CHECK(codes_get_size(h,key_name,&len),0); - if(len != numObs) { - printf("inconsistent number of %s values found!\n",key_name); + CODES_CHECK(codes_get_size(h, key_name, &len), 0); + if (len != numObs) { + printf("inconsistent number of %s values found!\n", key_name); return 1; } /* Get the values (from all the subsets) */ - bscatter = (double*)malloc(numObs*sizeof(double)); - CODES_CHECK(codes_get_double_array(h,key_name,bscatter,&len),0); + bscatter = (double*)malloc(numObs * sizeof(double)); + CODES_CHECK(codes_get_double_array(h, key_name, bscatter, &len), 0); /* Print the values */ printf("pixel lat lon backscatter \n"); printf("-------------------------------\n"); - for(i=0; i < numObs; i++) { - printf("%4d %.3f %.3f %.3f \n", i+1,lat[i],lon[i],bscatter[i]); + for (i = 0; i < numObs; i++) { + printf("%4d %.3f %.3f %.3f \n", i + 1, lat[i], lon[i], bscatter[i]); } /* Delete handle */ diff --git a/examples/C/bufr_read_synop.c b/examples/C/bufr_read_synop.c index b02895d3f..cf3602da0 100644 --- a/examples/C/bufr_read_synop.c +++ b/examples/C/bufr_read_synop.c @@ -24,67 +24,66 @@ #include "eccodes.h" -int main(int argc,char* argv[]) +int main(int argc, char* argv[]) { FILE* in = NULL; /* message handle. Required in all the eccodes calls acting on a message.*/ - codes_handle* h=NULL; + codes_handle* h = NULL; long longVal; double doubleVal; - int err=0; - int cnt=0; + int err = 0; + int cnt = 0; const char* infile = "../../data/bufr/syno_multi.bufr"; - in=fopen(infile,"rb"); + in = fopen(infile, "rb"); if (!in) { printf("ERROR: unable to open file %s\n", infile); return 1; } /* loop over the messages in the bufr file */ - while ((h = codes_handle_new_from_file(NULL,in,PRODUCT_BUFR,&err)) != NULL || err != CODES_SUCCESS) - { + while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) { if (h == NULL) { - printf("Error: unable to create handle for message %d\n",cnt); + printf("Error: unable to create handle for message %d\n", cnt); cnt++; continue; } - printf("message: %d\n",cnt); + printf("message: %d\n", cnt); /* we need to instruct ecCodes to unpack the data values */ - CODES_CHECK(codes_set_long(h,"unpack",1),0); + CODES_CHECK(codes_set_long(h, "unpack", 1), 0); /* station id*/ - CODES_CHECK(codes_get_long(h,"blockNumber",&longVal),0); - printf(" blockNumber: %ld\n",longVal); + CODES_CHECK(codes_get_long(h, "blockNumber", &longVal), 0); + printf(" blockNumber: %ld\n", longVal); - CODES_CHECK(codes_get_long(h,"stationNumber",&longVal),0); - printf(" stationNumber: %ld\n",longVal); + CODES_CHECK(codes_get_long(h, "stationNumber", &longVal), 0); + printf(" stationNumber: %ld\n", longVal); /* location*/ - CODES_CHECK(codes_get_double(h,"latitude",&doubleVal),0); - printf(" latitude: %f\n",doubleVal); + CODES_CHECK(codes_get_double(h, "latitude", &doubleVal), 0); + printf(" latitude: %f\n", doubleVal); - CODES_CHECK(codes_get_double(h,"longitude",&doubleVal),0); - printf(" longitude: %f\n",doubleVal); + CODES_CHECK(codes_get_double(h, "longitude", &doubleVal), 0); + printf(" longitude: %f\n", doubleVal); /* 2m temperature */ - CODES_CHECK(codes_get_double(h,"airTemperatureAt2M",&doubleVal),0); - printf(" airTemperatureAt2M: %f\n",doubleVal); + CODES_CHECK(codes_get_double(h, "airTemperatureAt2M", &doubleVal), 0); + printf(" airTemperatureAt2M: %f\n", doubleVal); /* 2m dewpoint temperature */ - CODES_CHECK(codes_get_double(h,"dewpointTemperatureAt2M",&doubleVal),0); - printf(" dewpointTemperatureAt2M: %f\n",doubleVal); + CODES_CHECK(codes_get_double(h, "dewpointTemperatureAt2M", &doubleVal), 0); + printf(" dewpointTemperatureAt2M: %f\n", doubleVal); /* 10 wind */ - CODES_CHECK(codes_get_double(h,"windSpeedAt10M",&doubleVal),0); - printf(" windSpeedAt10M: %f\n",doubleVal); + CODES_CHECK(codes_get_double(h, "windSpeedAt10M", &doubleVal), 0); + printf(" windSpeedAt10M: %f\n", doubleVal); - CODES_CHECK(codes_get_double(h,"windDirectionAt10M",&doubleVal),0); - printf(" windDirectionAt10M: %f\n",doubleVal); + CODES_CHECK(codes_get_double(h, "windDirectionAt10M", &doubleVal), 0); + printf(" windDirectionAt10M: %f\n", doubleVal); /* The cloud information is stored in several blocks in the * SYNOP message and the same key means a different thing in different @@ -95,24 +94,24 @@ int main(int argc,char* argv[]) * read so we will use the # (occurrence) operator accordingly. */ /* Cloud amount (low and middleclouds) */ - CODES_CHECK(codes_get_long(h,"#1#cloudAmount",&longVal),0); - printf(" cloudAmount (low and middle): %ld\n",longVal); + CODES_CHECK(codes_get_long(h, "#1#cloudAmount", &longVal), 0); + printf(" cloudAmount (low and middle): %ld\n", longVal); /* Height of cloud base */ - CODES_CHECK(codes_get_long(h,"#1#heightOfBaseOfCloud",&longVal),0); - printf(" heightOfBaseOfCloud: %ld\n",longVal); + CODES_CHECK(codes_get_long(h, "#1#heightOfBaseOfCloud", &longVal), 0); + printf(" heightOfBaseOfCloud: %ld\n", longVal); /* Cloud type (low clouds) */ - CODES_CHECK(codes_get_long(h,"#1#cloudType",&longVal),0); - printf(" cloudType (low): %ld\n",longVal); + CODES_CHECK(codes_get_long(h, "#1#cloudType", &longVal), 0); + printf(" cloudType (low): %ld\n", longVal); /* Cloud type (middle clouds) */ - CODES_CHECK(codes_get_long(h,"#2#cloudType",&longVal),0); - printf(" cloudType (middle): %ld\n",longVal); + CODES_CHECK(codes_get_long(h, "#2#cloudType", &longVal), 0); + printf(" cloudType (middle): %ld\n", longVal); /* Cloud type (high clouds) */ - CODES_CHECK(codes_get_long(h,"#3#cloudType",&longVal),0); - printf(" cloudType (high): %ld\n",longVal); + CODES_CHECK(codes_get_long(h, "#3#cloudType", &longVal), 0); + printf(" cloudType (high): %ld\n", longVal); /* delete handle */ codes_handle_delete(h); diff --git a/examples/C/bufr_read_temp.c b/examples/C/bufr_read_temp.c index 542dd4db0..52d34d4b7 100644 --- a/examples/C/bufr_read_temp.c +++ b/examples/C/bufr_read_temp.c @@ -23,41 +23,40 @@ #include "eccodes.h" -int main(int argc,char* argv[]) +int main(int argc, char* argv[]) { FILE* in = NULL; /* Message handle. Required in all the eccodes calls acting on a message.*/ - codes_handle* h=NULL; + codes_handle* h = NULL; - double *sigt_pres=NULL, *sigt_geo=NULL, *sigt_t=NULL; - double *sigt_td=NULL; - size_t sigt_len=0, len=0, i=0; - int err=0; - int cnt=0; + double *sigt_pres = NULL, *sigt_geo = NULL, *sigt_t = NULL; + double* sigt_td = NULL; + size_t sigt_len = 0, len = 0, i = 0; + int err = 0; + int cnt = 0; const char* infile = "../../data/bufr/temp_101.bufr"; char key_name[128]; - in=fopen(infile,"rb"); + in = fopen(infile, "rb"); if (!in) { printf("ERROR: unable to open file %s\n", infile); return 1; } /* Loop over the messages in the bufr file */ - while ((h = codes_handle_new_from_file(NULL,in,PRODUCT_BUFR,&err)) != NULL || err != CODES_SUCCESS) - { + while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) { if (h == NULL) { - printf("Error: unable to create handle for message %d\n",cnt); + printf("Error: unable to create handle for message %d\n", cnt); cnt++; continue; } - printf("message: %d\n",cnt); + printf("message: %d\n", cnt); /* We need to instruct ecCodes to expand the descriptors i.e. unpack the data values */ - CODES_CHECK(codes_set_long(h,"unpack",1),0); + CODES_CHECK(codes_set_long(h, "unpack", 1), 0); /* In what follows we rely on the fact that for * temperature significant levels the value of key @@ -75,67 +74,65 @@ int main(int argc,char* argv[]) /* We find out the number of temperature significant levels by * counting how many pressure values we have on these levels.*/ - sprintf(key_name,"/verticalSoundingSignificance=4/pressure"); - CODES_CHECK(codes_get_size(h,key_name,&sigt_len),0); + sprintf(key_name, "/verticalSoundingSignificance=4/pressure"); + CODES_CHECK(codes_get_size(h, key_name, &sigt_len), 0); - printf("Number of T significant levels: %lu\n",sigt_len); + printf("Number of T significant levels: %lu\n", sigt_len); /* Allocate memory for the values to be read. Each * parameter must have the same number of values. */ - sigt_pres = (double*)malloc(sigt_len*sizeof(double)); - sigt_geo = (double*)malloc(sigt_len*sizeof(double)); - sigt_t = (double*)malloc(sigt_len*sizeof(double)); - sigt_td = (double*)malloc(sigt_len*sizeof(double)); + sigt_pres = (double*)malloc(sigt_len * sizeof(double)); + sigt_geo = (double*)malloc(sigt_len * sizeof(double)); + sigt_t = (double*)malloc(sigt_len * sizeof(double)); + sigt_td = (double*)malloc(sigt_len * sizeof(double)); /* Get pressure */ - sprintf(key_name,"/verticalSoundingSignificance=4/pressure"); - len=sigt_len; - CODES_CHECK(codes_get_double_array(h,key_name,sigt_pres,&len),0); + sprintf(key_name, "/verticalSoundingSignificance=4/pressure"); + len = sigt_len; + CODES_CHECK(codes_get_double_array(h, key_name, sigt_pres, &len), 0); /* Get geopotential */ - sprintf(key_name,"/verticalSoundingSignificance=4/nonCoordinateGeopotential"); + sprintf(key_name, "/verticalSoundingSignificance=4/nonCoordinateGeopotential"); /* Check the size */ - CODES_CHECK(codes_get_size(h,key_name,&len),0); - if(len != sigt_len) - { + CODES_CHECK(codes_get_size(h, key_name, &len), 0); + if (len != sigt_len) { printf("inconsistent number of geopotential values found!\n"); return 1; } /* Get the values */ - CODES_CHECK(codes_get_double_array(h,key_name,sigt_geo,&len),0); + CODES_CHECK(codes_get_double_array(h, key_name, sigt_geo, &len), 0); /* Get temperature */ - if(len != sigt_len) /* Check the size */ + if (len != sigt_len) /* Check the size */ { printf("inconsistent number of temperature values found!\n"); return 1; } /* Get the values */ - sprintf(key_name,"/verticalSoundingSignificance=4/airTemperature"); - CODES_CHECK(codes_get_double_array(h,key_name,sigt_t,&len),0); + sprintf(key_name, "/verticalSoundingSignificance=4/airTemperature"); + CODES_CHECK(codes_get_double_array(h, key_name, sigt_t, &len), 0); /* Get dew point */ - if(len != sigt_len) /* Check the size */ + if (len != sigt_len) /* Check the size */ { printf("inconsistent number of dewpoint temperature values found!\n"); return 1; } /* Get the values */ - sprintf(key_name,"/verticalSoundingSignificance=4/dewpointTemperature"); - CODES_CHECK(codes_get_double_array(h,key_name,sigt_td,&len),0); + sprintf(key_name, "/verticalSoundingSignificance=4/dewpointTemperature"); + CODES_CHECK(codes_get_double_array(h, key_name, sigt_td, &len), 0); /* Print the values */ printf("lev pres geo t td\n"); printf("-------------------------------\n"); - for(i=0; i < sigt_len; i++) - { + for (i = 0; i < sigt_len; i++) { printf("%3lu %6.0f %6.0f %.1f %.1f\n", - i+1,sigt_pres[i],sigt_geo[i],sigt_t[i],sigt_td[i]); + i + 1, sigt_pres[i], sigt_geo[i], sigt_t[i], sigt_td[i]); } /* Delete handle */ diff --git a/examples/C/bufr_set_keys.c b/examples/C/bufr_set_keys.c index 5c4041e23..ba268458b 100644 --- a/examples/C/bufr_set_keys.c +++ b/examples/C/bufr_set_keys.c @@ -17,34 +17,35 @@ #include "eccodes.h" -static void usage(const char* prog) { - printf("usage: %s infile\n",prog); +static void usage(const char* prog) +{ + printf("usage: %s infile\n", prog); exit(1); } -int main(int argc,char* argv[]) +int main(int argc, char* argv[]) { - FILE* in = NULL; + FILE* in = NULL; FILE* out = NULL; /* message handle. Required in all the eccodes calls acting on a message.*/ - codes_handle* h=NULL; + codes_handle* h = NULL; long longVal; /*double doubleVal;*/ - int err=0; - int cnt=0; - size_t size = 0; + int err = 0; + int cnt = 0; + size_t size = 0; const char* infile = "../../data/bufr/syno_multi.bufr"; - const void *buffer = NULL; + const void* buffer = NULL; if (argc != 2) { usage(argv[0]); return 1; } - in = fopen(infile,"rb"); - out = fopen(argv[1],"wb"); + in = fopen(infile, "rb"); + out = fopen(argv[1], "wb"); if (!in || !out) { perror("ERROR: unable to open files"); @@ -54,15 +55,14 @@ int main(int argc,char* argv[]) } /* loop over the messages in the bufr file */ - while ((h = codes_handle_new_from_file(NULL,in,PRODUCT_BUFR,&err)) != NULL || err != CODES_SUCCESS) - { + while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) { if (h == NULL) { - printf("Error: unable to create handle for message %d\n",cnt); + printf("Error: unable to create handle for message %d\n", cnt); cnt++; continue; } - printf("message: %d\n",cnt); + printf("message: %d\n", cnt); /* we need to instruct ecCodes to expand the descriptors i.e. unpack the data values */ @@ -72,20 +72,20 @@ int main(int argc,char* argv[]) /*E.g. we change the centre */ /* set bufrHeaderCentre */ - longVal=222; - CODES_CHECK(codes_set_long(h, "bufrHeaderCentre", longVal),0); - printf(" set bufrHeaderCentre to: %ld\n",longVal); + longVal = 222; + CODES_CHECK(codes_set_long(h, "bufrHeaderCentre", longVal), 0); + printf(" set bufrHeaderCentre to: %ld\n", longVal); /* check bufrHeaderCentre */ - CODES_CHECK(codes_get_long(h,"bufrHeaderCentre",&longVal),0); - printf(" bufrHeaderCentre's new value is: %ld\n",longVal); + CODES_CHECK(codes_get_long(h, "bufrHeaderCentre", &longVal), 0); + printf(" bufrHeaderCentre's new value is: %ld\n", longVal); /* get the modified message in a buffer */ - CODES_CHECK(codes_get_message(h,&buffer,&size),0); + CODES_CHECK(codes_get_message(h, &buffer, &size), 0); /* write the buffer to a file */ - if(fwrite(buffer,1,size,out) != size) { + if (fwrite(buffer, 1, size, out) != size) { perror(argv[0]); return 1; } diff --git a/examples/C/bufr_subset.c b/examples/C/bufr_subset.c index dd07f0fcf..80b8521c8 100644 --- a/examples/C/bufr_subset.c +++ b/examples/C/bufr_subset.c @@ -18,74 +18,72 @@ #include "eccodes.h" #include -int main(int argc,char* argv[]) +int main(int argc, char* argv[]) { - char key[200]={0,}; + char key[200] = {0,}; FILE* in = NULL; /* message handle. Required in all the eccodes calls acting on a message.*/ - codes_handle* h=NULL; + codes_handle* h = NULL; - long numberOfSubsets=0; + long numberOfSubsets = 0; long longVal; double doubleVal; size_t stringLen; - char stringVal[100]={0,}; - int i,err=0; - int cnt=0; + char stringVal[100] = {0,}; + int i, err = 0; + int cnt = 0; const char* infile = "../../data/bufr/synop_multi_subset.bufr"; - in=fopen(infile,"rb"); + in = fopen(infile, "rb"); if (!in) { printf("ERROR: unable to open file %s\n", infile); return 1; } /* loop over the messages in the bufr file */ - while ((h = codes_handle_new_from_file(NULL,in,PRODUCT_BUFR,&err)) != NULL || err != CODES_SUCCESS) - { + while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) { if (h == NULL) { - printf("Error: unable to create handle for message %d\n",cnt); + printf("Error: unable to create handle for message %d\n", cnt); cnt++; continue; } - printf("message: %d\n",cnt); + printf("message: %d\n", cnt); /* we need to instruct ecCodes to expand all the descriptors i.e. unpack the data values */ - CODES_CHECK(codes_set_long(h,"unpack",1),0); + CODES_CHECK(codes_set_long(h, "unpack", 1), 0); /* find out the number of subsets */ - CODES_CHECK(codes_get_long(h,"numberOfSubsets",&numberOfSubsets),0); - printf(" numberOfSubsets: %ld\n",numberOfSubsets); + CODES_CHECK(codes_get_long(h, "numberOfSubsets", &numberOfSubsets), 0); + printf(" numberOfSubsets: %ld\n", numberOfSubsets); /* loop over the subsets */ - for(i=1; i <= numberOfSubsets; i++) - { - sprintf(key,"/subsetNumber=%d/blockNumber",i); + for (i = 1; i <= numberOfSubsets; i++) { + sprintf(key, "/subsetNumber=%d/blockNumber", i); - printf(" subsetNumber=%d",i); + printf(" subsetNumber=%d", i); /* read and print some data values */ - CODES_CHECK(codes_get_long(h,key,&longVal), 0); - printf(" blockNumber=%ld",longVal); + CODES_CHECK(codes_get_long(h, key, &longVal), 0); + printf(" blockNumber=%ld", longVal); - sprintf(key,"/subsetNumber=%d/stationNumber",i); - CODES_CHECK(codes_get_long(h,key,&longVal), 0); - printf(" stationNumber=%ld",longVal); + sprintf(key, "/subsetNumber=%d/stationNumber", i); + CODES_CHECK(codes_get_long(h, key, &longVal), 0); + printf(" stationNumber=%ld", longVal); - sprintf(key,"/subsetNumber=%d/stationOrSiteName->units",i); - CODES_CHECK(codes_get_length(h,key,&stringLen), 0); + sprintf(key, "/subsetNumber=%d/stationOrSiteName->units", i); + CODES_CHECK(codes_get_length(h, key, &stringLen), 0); assert(stringLen == 10); /* should be "CCITT IA5" */ - sprintf(key,"/subsetNumber=%d/stationOrSiteName",i); - CODES_CHECK(codes_get_length(h,key,&stringLen), 0); - CODES_CHECK(codes_get_string(h,key,stringVal,&stringLen), 0); + sprintf(key, "/subsetNumber=%d/stationOrSiteName", i); + CODES_CHECK(codes_get_length(h, key, &stringLen), 0); + CODES_CHECK(codes_get_string(h, key, stringVal, &stringLen), 0); assert(stringLen > 0 && stringLen < 17); - printf(" stationOrSiteName=\"%s\"",stringVal); + printf(" stationOrSiteName=\"%s\"", stringVal); - sprintf(key,"/subsetNumber=%d/airTemperature",i); - CODES_CHECK(codes_get_double(h,key,&doubleVal),0); - printf(" airTemperature=%g\n",doubleVal); + sprintf(key, "/subsetNumber=%d/airTemperature", i); + CODES_CHECK(codes_get_double(h, key, &doubleVal), 0); + printf(" airTemperature=%g\n", doubleVal); assert(doubleVal > 265 && doubleVal < 278); } diff --git a/examples/C/fieldset.c b/examples/C/fieldset.c index 1ad72dd71..b85e21b23 100644 --- a/examples/C/fieldset.c +++ b/examples/C/fieldset.c @@ -21,57 +21,58 @@ #include "eccodes.h" -void usage(char* prog) { - printf("Usage: %s order_by grib_file grib_file ...\n",prog); +void usage(char* prog) +{ + printf("Usage: %s order_by grib_file grib_file ...\n", prog); exit(1); } int main(int argc, char** argv) { int err = 0; - long step,levelType; + long step, levelType; char** filenames; - size_t nkeys,nfiles; - int i=0; - char* keys[]={"step","date","param","levelType"}; + size_t nkeys, nfiles; + int i = 0; + char* keys[] = { "step", "date", "param", "levelType" }; codes_fieldset* set; codes_handle* h; - char param[20]={0,}; - char date[10]={0,}; - size_t datelen=10; - size_t len=20; - char* order_by=0; + char param[20] = {0,}; + char date[10] = {0,}; + size_t datelen = 10; + size_t len = 20; + char* order_by = 0; if (argc != 3) usage(argv[0]); - nkeys=sizeof(keys)/sizeof(*keys); - order_by=strdup(argv[1]); + nkeys = sizeof(keys) / sizeof(*keys); + order_by = strdup(argv[1]); - nfiles=argc-2; - filenames=(char**)malloc(sizeof(char*)*nfiles); - for (i=0;i #include "eccodes.h" -static void usage(const char *app) +static void usage(const char* app) { - fprintf(stderr,"Usage is: %s input_file ouput_file\n", app); + fprintf(stderr, "Usage is: %s input_file ouput_file\n", app); } -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - FILE *in = NULL; - FILE *out = NULL; - codes_handle *source_handle = NULL; - const void *buffer = NULL; - size_t size = 0; - int err = 0; + FILE* in = NULL; + FILE* out = NULL; + codes_handle* source_handle = NULL; + const void* buffer = NULL; + size_t size = 0; + int err = 0; if (argc != 3) { usage(argv[0]); return 1; } - in = fopen(argv[1],"rb"); - out = fopen(argv[2],"wb"); + in = fopen(argv[1], "rb"); + out = fopen(argv[2], "wb"); if (!in || !out) { perror("ERROR: unable to open files"); @@ -48,9 +48,8 @@ int main(int argc, char *argv[]) } /* loop over the messages in the source grib and clone them */ - while ((source_handle = codes_handle_new_from_file(0, in, PRODUCT_GRIB, &err))!=NULL) - { - codes_handle *clone_handle = codes_handle_clone(source_handle); + while ((source_handle = codes_handle_new_from_file(0, in, PRODUCT_GRIB, &err)) != NULL) { + codes_handle* clone_handle = codes_handle_clone(source_handle); if (clone_handle == NULL) { perror("ERROR: could not clone field"); @@ -64,9 +63,9 @@ int main(int argc, char *argv[]) */ /* get the coded message in a buffer */ - CODES_CHECK(codes_get_message(clone_handle,&buffer,&size),0); + CODES_CHECK(codes_get_message(clone_handle, &buffer, &size), 0); /* write the buffer to a file */ - if(fwrite(buffer,1,size,out) != size) { + if (fwrite(buffer, 1, size, out) != size) { perror(argv[1]); return 1; } diff --git a/examples/C/grib_copy_message.c b/examples/C/grib_copy_message.c index 3b501a7ba..5223db8a6 100644 --- a/examples/C/grib_copy_message.c +++ b/examples/C/grib_copy_message.c @@ -18,23 +18,23 @@ #include "eccodes.h" #include -static void usage(const char *prog) +static void usage(const char* prog) { - fprintf(stderr,"Usage is: %s input_file ouput_file\n", prog); + fprintf(stderr, "Usage is: %s input_file ouput_file\n", prog); } -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - FILE *in = NULL; - codes_handle *source_handle = NULL; - int err = 0; + FILE* in = NULL; + codes_handle* source_handle = NULL; + int err = 0; if (argc != 3) { usage(argv[0]); return 1; } - in = fopen(argv[1],"rb"); + in = fopen(argv[1], "rb"); if (!in) { perror("ERROR: unable to input file"); @@ -42,16 +42,15 @@ int main(int argc, char *argv[]) } /* loop over the GRIB messages in the source */ - while ((source_handle = codes_handle_new_from_file(0, in, PRODUCT_GRIB, &err))!=NULL) - { + while ((source_handle = codes_handle_new_from_file(0, in, PRODUCT_GRIB, &err)) != NULL) { size_t totalLength = 0, size = 0; - const void* buffer = NULL; + const void* buffer = NULL; codes_handle* new_handle = NULL; - CODES_CHECK(codes_get_message_size(source_handle,&totalLength),0); - buffer=(unsigned char*)malloc(totalLength*sizeof(char)); + CODES_CHECK(codes_get_message_size(source_handle, &totalLength), 0); + buffer = (unsigned char*)malloc(totalLength * sizeof(char)); - CODES_CHECK(codes_get_message(source_handle, &buffer, &size),0); + CODES_CHECK(codes_get_message(source_handle, &buffer, &size), 0); assert(size == totalLength); new_handle = codes_handle_new_from_message(0, buffer, totalLength); @@ -60,8 +59,8 @@ int main(int argc, char *argv[]) perror("ERROR: could not create GRIB handle from message"); return 1; } - CODES_CHECK(codes_set_long(new_handle, "hour", 18),0); - CODES_CHECK(codes_write_message(new_handle, argv[2], "w"),0); + CODES_CHECK(codes_set_long(new_handle, "hour", 18), 0); + CODES_CHECK(codes_write_message(new_handle, argv[2], "w"), 0); codes_handle_delete(new_handle); codes_handle_delete(source_handle); diff --git a/examples/C/grib_ensemble_index.c b/examples/C/grib_ensemble_index.c index 31da3eaa1..5fd96163b 100644 --- a/examples/C/grib_ensemble_index.c +++ b/examples/C/grib_ensemble_index.c @@ -17,41 +17,41 @@ #include "eccodes.h" -int main(int argc, char * argv[]) +int main(int argc, char* argv[]) { int ret; int i, j; - int count=0; - size_t paramIdSize, numberSize, values_len=0; + int count = 0; + size_t paramIdSize, numberSize, values_len = 0; char** paramId; long* number; double* values; - double* result=NULL; - double min=1e13,max=-1e13,avg=0; + double* result = NULL; + double min = 1e13, max = -1e13, avg = 0; codes_index* index; - codes_handle* h=NULL; + codes_handle* h = NULL; - if (argc<2) return 1; + if (argc < 2) return 1; /* create index of file contents for paramId and number */ - index = codes_index_new_from_file(0, argv[1], "paramId,number",&ret); - CODES_CHECK(ret,0); + index = codes_index_new_from_file(0, argv[1], "paramId,number", &ret); + CODES_CHECK(ret, 0); /* get size of "paramId" list */ - CODES_CHECK(codes_index_get_size(index, "paramId", ¶mIdSize),0); - printf("grib contains %lu different parameters\n",paramIdSize); + CODES_CHECK(codes_index_get_size(index, "paramId", ¶mIdSize), 0); + printf("grib contains %lu different parameters\n", paramIdSize); /* allocate memory for "paramId" list */ - paramId = (char**) malloc(paramIdSize * sizeof(char*)); + paramId = (char**)malloc(paramIdSize * sizeof(char*)); /* get list of "paramId" */ - CODES_CHECK(codes_index_get_string(index, "paramId", paramId, ¶mIdSize),0); + CODES_CHECK(codes_index_get_string(index, "paramId", paramId, ¶mIdSize), 0); /* get size of ensemble number list */ - CODES_CHECK(codes_index_get_size(index, "number", &numberSize),0); - printf("GRIB contains %lu different ensemble members\n",numberSize); + CODES_CHECK(codes_index_get_size(index, "number", &numberSize), 0); + printf("GRIB contains %lu different ensemble members\n", numberSize); /* allocate memory for ensemble number list */ - number = (long*) malloc(numberSize * sizeof(long)); + number = (long*)malloc(numberSize * sizeof(long)); /* get list of ensemble numbers */ - CODES_CHECK(codes_index_get_long(index, "number", number, &numberSize),0); + CODES_CHECK(codes_index_get_long(index, "number", number, &numberSize), 0); /* select T850 with paramId 130 */ CODES_CHECK(codes_index_select_string(index, "paramId", "130"), 0); @@ -63,7 +63,7 @@ int main(int argc, char * argv[]) CODES_CHECK(codes_index_select_long(index, "number", number[i]), 0); /* create handle for next GRIB message */ - h=codes_handle_new_from_index(index, &ret); + h = codes_handle_new_from_index(index, &ret); if (ret) { printf("Error: %s\n", codes_get_error_message(ret)); exit(ret); @@ -76,8 +76,8 @@ int main(int argc, char * argv[]) values = (double*)malloc(values_len * sizeof(double)); /* allocate memory for result */ - if ( i == 0 ) { - result = (double *)calloc(values_len, sizeof(double)); + if (i == 0) { + result = (double*)calloc(values_len, sizeof(double)); } /* get data values */ @@ -106,15 +106,15 @@ int main(int argc, char * argv[]) } avg += result[j]; } - avg = avg/values_len; + avg = avg / values_len; printf("==============================================================================\n"); printf("Stats for ensemble mean of T850\n"); - printf("Min: %f Max: %f Avg: %f\n",min,max,avg); + printf("Min: %f Max: %f Avg: %f\n", min, max, avg); printf("==============================================================================\n"); /* finally free all other memory */ - for (i=0;i #include "eccodes.h" -static void usage(const char* prog) { - printf("usage: %s in.grib out.grib\n",prog); +static void usage(const char* prog) +{ + printf("usage: %s in.grib out.grib\n", prog); exit(1); } int main(int argc, char** argv) { - int err = 0; + int err = 0; FILE* in = NULL; FILE* of = NULL; long edition, step; - char* filename=NULL; - char* ofilename=NULL; - codes_handle *h = NULL; - codes_multi_handle *mh=NULL; + char* filename = NULL; + char* ofilename = NULL; + codes_handle* h = NULL; + codes_multi_handle* mh = NULL; const int start_section = 4; /* Grib2 Product Definition Section */ if (argc < 3) usage(argv[0]); - filename=argv[1]; - ofilename=argv[2]; + filename = argv[1]; + ofilename = argv[2]; /* open input file */ - in = fopen(filename,"rb"); - if(!in) { - fprintf(stderr, "ERROR: unable to open input file %s\n",filename); + in = fopen(filename, "rb"); + if (!in) { + fprintf(stderr, "ERROR: unable to open input file %s\n", filename); return 1; } /* new grib handle from input file */ h = codes_handle_new_from_file(0, in, PRODUCT_GRIB, &err); - CODES_CHECK(err,0); - CODES_CHECK(codes_get_long(h,"edition",&edition),0); + CODES_CHECK(err, 0); + CODES_CHECK(codes_get_long(h, "edition", &edition), 0); if (edition != 2) { fprintf(stderr, "ERROR: Input grib must be edition 2 for multi fields\n"); exit(1); } /* create a new empty multi field handle */ - mh=codes_grib_multi_handle_new(0); + mh = codes_grib_multi_handle_new(0); if (!mh) { - fprintf(stderr,"ERROR: Unable to create multi field handle\n"); + fprintf(stderr, "ERROR: Unable to create multi field handle\n"); exit(1); } - for (step=12;step<=120;step+=12) { + for (step = 12; step <= 120; step += 12) { /* set step */ - codes_set_long(h,"step",step); + codes_set_long(h, "step", step); /* append h to mh repeating from section 4 */ /* i.e. starting from section 4 all the sections to the end of the message will be copied */ codes_grib_multi_handle_append(h, start_section, mh); } /* open output file */ - of=fopen(ofilename,"w"); - if(!of) { - fprintf(stderr, "ERROR: unable to open output file %s\n",ofilename); + of = fopen(ofilename, "w"); + if (!of) { + fprintf(stderr, "ERROR: unable to open output file %s\n", ofilename); exit(1); } /* write multi fields handle to output file */ - codes_grib_multi_handle_write(mh,of); + codes_grib_multi_handle_write(mh, of); fclose(of); /* release memory */ diff --git a/examples/C/grib_nearest.c b/examples/C/grib_nearest.c index cd45548da..4adecf620 100644 --- a/examples/C/grib_nearest.c +++ b/examples/C/grib_nearest.c @@ -21,64 +21,66 @@ #include "eccodes.h" -static void usage(const char* prog) { - printf("Usage: %s grib_file grib_file ...\n",prog); +static void usage(const char* prog) +{ + printf("Usage: %s grib_file grib_file ...\n", prog); exit(1); } int main(int argc, char** argv) { - int err = 0; - long step=0; + int err = 0; + long step = 0; size_t nfiles; - int i=0; - codes_fieldset* set=NULL; - codes_handle* h=NULL; - char param[20]={0,}; - size_t len=20; - double lats[4]={0,}; - double lons[4]={0,}; - double values[4]={0,}; - double distances[4]={0,}; - int indexes[4]={0,}; - char* order_by="param,step"; - - size_t size=4; - double lat=-40,lon=15; - int mode=0; + int i = 0; + codes_fieldset* set = NULL; + codes_handle* h = NULL; + char param[20] = {0,}; + size_t len = 20; + double lats[4] = {0,}; + double lons[4] = {0,}; + double values[4] = {0,}; + double distances[4] = {0,}; + int indexes[4] = {0,}; + char* order_by = "param,step"; + + size_t size = 4; + double lat = -40, lon = 15; + int mode = 0; int count; char** filenames; - codes_nearest* nearest=NULL; + codes_nearest* nearest = NULL; if (argc < 2) usage(argv[0]); - nfiles=argc-1; - filenames=(char**)malloc(sizeof(char*)*nfiles); - for (i=0;i maxv ) maxv=values2[i]; - if ( values2[i] < minv ) minv=values2[i]; - if ( values2[i] !=0 ) r=fabs((values2[i]-values1[i])/values2[i]); - if ( a > maxa ) maxa=a; - if ( r > maxr ) maxr=r; + maxa = 0; + maxr = 0; + maxv = values2[0]; + minv = maxv; + for (i = 0; i < size; i++) { + double a = fabs(values2[i] - values1[i]); + if (values2[i] > maxv) maxv = values2[i]; + if (values2[i] < minv) minv = values2[i]; + if (values2[i] != 0) r = fabs((values2[i] - values1[i]) / values2[i]); + if (a > maxa) maxa = a; + if (r > maxr) maxr = r; } - printf("max absolute error = %g\n",maxa); - printf("max relative error = %g\n",maxr); - printf("min value = %g\n",minv); - printf("max value = %g\n",maxv); + printf("max absolute error = %g\n", maxa); + printf("max relative error = %g\n", maxr); + printf("min value = %g\n", minv); + printf("max value = %g\n", maxv); assert(fabs(minv - EXPECTED_MIN) < EPSILON); assert(fabs(maxv - EXPECTED_MAX) < EPSILON); /* get the coded message in a buffer */ - CODES_CHECK(codes_get_message(h,&buffer,&size),0); + CODES_CHECK(codes_get_message(h, &buffer, &size), 0); /* write the buffer in a file*/ - if(fwrite(buffer,1,size,out) != size) - { + if (fwrite(buffer, 1, size, out) != size) { perror(argv[1]); exit(1); } diff --git a/examples/C/grib_print_data.c b/examples/C/grib_print_data.c index df7d5d90b..f5b40d58c 100644 --- a/examples/C/grib_print_data.c +++ b/examples/C/grib_print_data.c @@ -19,68 +19,69 @@ #include "eccodes.h" -static void usage(const char* prog) { - printf("usage: %s filename\n",prog); +static void usage(const char* prog) +{ + printf("usage: %s filename\n", prog); exit(1); } int main(int argc, char** argv) { - int err = 0,i; - double *values = NULL; - double max,min,average; - size_t values_len= 0; + int err = 0, i; + double* values = NULL; + double max, min, average; + size_t values_len = 0; FILE* in = NULL; - char* filename ; - codes_handle *h = NULL; + char* filename; + codes_handle* h = NULL; - if (argc<2) usage(argv[0]); - filename=argv[1]; + if (argc < 2) usage(argv[0]); + filename = argv[1]; - in = fopen(filename,"rb"); - if(!in) { - printf("ERROR: unable to open file %s\n",filename); + in = fopen(filename, "rb"); + if (!in) { + printf("ERROR: unable to open file %s\n", filename); return 1; } /* create new handle from a message in a file*/ h = codes_handle_new_from_file(0, in, PRODUCT_GRIB, &err); if (h == NULL) { - printf("Error: unable to create handle from file %s\n",filename); + printf("Error: unable to create handle from file %s\n", filename); } /* get the size of the values array*/ - CODES_CHECK(codes_get_size(h,"values",&values_len),0); + CODES_CHECK(codes_get_size(h, "values", &values_len), 0); - values = (double*)malloc(values_len*sizeof(double)); + values = (double*)malloc(values_len * sizeof(double)); /* get data values*/ - CODES_CHECK(codes_get_double_array(h,"values",values,&values_len),0); + CODES_CHECK(codes_get_double_array(h, "values", values, &values_len), 0); - for(i = 0; i < values_len; i++) - printf("%d %.10e\n",i,values[i]); + for (i = 0; i < values_len; i++) + printf("%d %.10e\n", i, values[i]); free(values); - CODES_CHECK(codes_get_double(h,"max",&max),0); - CODES_CHECK(codes_get_double(h,"min",&min),0); - CODES_CHECK(codes_get_double(h,"average",&average),0); + CODES_CHECK(codes_get_double(h, "max", &max), 0); + CODES_CHECK(codes_get_double(h, "min", &min), 0); + CODES_CHECK(codes_get_double(h, "average", &average), 0); - printf("%d values found in %s\n",(int)values_len,filename); - printf("max=%.10e min=%.10e average=%.10e\n",max,min,average); + printf("%d values found in %s\n", (int)values_len, filename); + printf("max=%.10e min=%.10e average=%.10e\n", max, min, average); { /* Example of accessing specific elements from data values */ - double vals_arr[3] = {0, 0, 0}; - const int NUM = 3; + double vals_arr[3] = { 0, 0, 0 }; + const int NUM = 3; int index_arr[3]; - index_arr[0] = 0; /* first element */ - index_arr[1] = values_len/2; /* middle element */ - index_arr[2] = values_len-1; /* last element */ + index_arr[0] = 0; /* first element */ + index_arr[1] = values_len / 2; /* middle element */ + index_arr[2] = values_len - 1; /* last element */ CODES_CHECK(codes_get_double_elements(h, "values", index_arr, NUM, vals_arr), 0); - for (i=0; i tolerance) { - ret=1; + ret = 1; } return ret; } @@ -32,12 +32,12 @@ static void* process_grib(void* threadID) size_t str_len = 20, i = 0; long indicatorOfUnitOfTimeRange = 1, step = 0; char mystring[100]; - double* values = NULL; + double* values = NULL; size_t values_len = 0; - double min=0,max=0,avg=0; - const double tol = 1e-6; - double pv[4]={1,2,3,4}; - const size_t pvsize=4; + double min = 0, max = 0, avg = 0; + const double tol = 1e-6; + double pv[4] = { 1, 2, 3, 4 }; + const size_t pvsize = 4; ProductKind prod_kind = 0; codes_handle* h = codes_grib_handle_new_from_samples(0, "regular_ll_pl_grib2"); @@ -46,35 +46,37 @@ static void* process_grib(void* threadID) assert(prod_kind == PRODUCT_GRIB); printf("Thread %ld running\n", tid); - CODES_CHECK(codes_set_long(h,"indicatorOfUnitOfTimeRange", indicatorOfUnitOfTimeRange),0); - CODES_CHECK(codes_set_string(h,"indicatorOfUnitOfTimeRange", "s", &str_len),0); - CODES_CHECK(codes_set_string(h,"stepUnits", "s", &str_len),0); + CODES_CHECK(codes_set_long(h, "indicatorOfUnitOfTimeRange", indicatorOfUnitOfTimeRange), 0); + CODES_CHECK(codes_set_string(h, "indicatorOfUnitOfTimeRange", "s", &str_len), 0); + CODES_CHECK(codes_set_string(h, "stepUnits", "s", &str_len), 0); CODES_CHECK(codes_set_long(h, "endStep", 86400), 0); - CODES_CHECK(codes_set_long(h,"centre", 80),0); + CODES_CHECK(codes_set_long(h, "centre", 80), 0); - CODES_CHECK(codes_get_long(h,"endStep", &step),0); - CODES_CHECK(codes_get_string(h, "indicatorOfUnitOfTimeRange", mystring, &str_len),0); + CODES_CHECK(codes_get_long(h, "endStep", &step), 0); + CODES_CHECK(codes_get_string(h, "indicatorOfUnitOfTimeRange", mystring, &str_len), 0); - CODES_CHECK(codes_set_long(h,"PVPresent", 1),0); - CODES_CHECK(codes_set_double_array(h, "pv", pv, pvsize),0); + CODES_CHECK(codes_set_long(h, "PVPresent", 1), 0); + CODES_CHECK(codes_set_double_array(h, "pv", pv, pvsize), 0); - CODES_CHECK(codes_get_size(h,"values",&values_len),0); - values = (double*)malloc(values_len*sizeof(double)); - CODES_CHECK(codes_get_double_array(h, "values", values, &values_len),0); - for (i=0;i -static void usage(const char* prog) { - printf("usage: %s in1.grib in2.grib what out.grib\n",prog); +static void usage(const char* prog) +{ + printf("usage: %s in1.grib in2.grib what out.grib\n", prog); printf("in1.grib The grib in whose sections we are interested, i.e. the source of the sections (read-only)\n"); printf("in2.grib The input grib (read-only)\n"); printf("what The section(s) to copy: p(Product), g(Grid), l(Local), d(Data), b(Bitmap)\n"); @@ -19,38 +20,38 @@ static void usage(const char* prog) { exit(1); } -int main ( int argc, char* argv[]) +int main(int argc, char* argv[]) { - codes_handle *hfrom,*hto,*h; - FILE *in; + codes_handle *hfrom, *hto, *h; + FILE* in; char *in_name1, *in_name2, *what_str, *out_name; - int i, err=0, what=0; + int i, err = 0, what = 0; - if (argc<5) usage(argv[0]); + if (argc < 5) usage(argv[0]); - in_name1=argv[1]; - in_name2=argv[2]; - what_str=argv[3]; - out_name=argv[4]; + in_name1 = argv[1]; + in_name2 = argv[2]; + what_str = argv[3]; + out_name = argv[4]; - in=fopen(in_name1,"rb"); + in = fopen(in_name1, "rb"); if (!in) { perror(in_name1); exit(1); } - hfrom=codes_handle_new_from_file(0, in, PRODUCT_GRIB, &err); - CODES_CHECK(err,0); + hfrom = codes_handle_new_from_file(0, in, PRODUCT_GRIB, &err); + CODES_CHECK(err, 0); fclose(in); - in=fopen(in_name2,"rb"); + in = fopen(in_name2, "rb"); if (!in) { perror(in_name2); exit(1); } - hto=codes_handle_new_from_file(0, in, PRODUCT_GRIB, &err); - CODES_CHECK(err,0); + hto = codes_handle_new_from_file(0, in, PRODUCT_GRIB, &err); + CODES_CHECK(err, 0); fclose(in); /* The sections for the "what" argument are: @@ -62,7 +63,7 @@ int main ( int argc, char* argv[]) * One can bitwise-OR them to have more than one section copied * E.g. what = CODES_SECTION_PRODUCT | CODES_SECTION_LOCAL; */ - for(i=0; i100) {e*=10; count=1;} - values[i]=d; + values = (double*)malloc(values_len * sizeof(double)); + d = 10e-8; + e = d; + count = 1; + for (i = 0; i < values_len; i++) { + if (count > 100) { + e *= 10; + count = 1; + } + values[i] = d; /*printf("%g \n",values[i]);*/ - d+=e; + d += e; count++; } - CODES_CHECK(codes_set_long(h,"bitsPerValue",16),0); + CODES_CHECK(codes_set_long(h, "bitsPerValue", 16), 0); /* set data values */ - CODES_CHECK(codes_set_double_array(h,"values",values,values_len),0); + CODES_CHECK(codes_set_double_array(h, "values", values, values_len), 0); CODES_CHECK(codes_write_message(h, argv[1], "w"), 0); diff --git a/examples/C/grib_set_keys.c b/examples/C/grib_set_keys.c index 1bf2d16ac..5c761fed3 100644 --- a/examples/C/grib_set_keys.c +++ b/examples/C/grib_set_keys.c @@ -21,30 +21,30 @@ int main(int argc, char** argv) { - int err = 0; - long centre=80; - long long_value=0; + int err = 0; + long centre = 80; + long long_value = 0; char string_value[100]; - size_t len = sizeof(string_value)/sizeof(char); - size_t size=0; + size_t len = sizeof(string_value) / sizeof(char); + size_t size = 0; - FILE* in = NULL; - const char* infile = "../../data/regular_latlon_surface.grib1"; - FILE* out = NULL; + FILE* in = NULL; + const char* infile = "../../data/regular_latlon_surface.grib1"; + FILE* out = NULL; const char* outfile = "out.set.grib1"; - codes_handle *h = NULL; - const void* buffer = NULL; - size_t str_len = 0; /* See the call to codes_set_string later */ + codes_handle* h = NULL; + const void* buffer = NULL; + size_t str_len = 0; /* See the call to codes_set_string later */ - in = fopen(infile,"rb"); - if(!in) { - printf("ERROR: unable to open file %s\n",infile); + in = fopen(infile, "rb"); + if (!in) { + printf("ERROR: unable to open file %s\n", infile); return 1; } - out = fopen(outfile,"wb"); - if(!out) { - printf("ERROR: unable to open file %s\n",outfile); + out = fopen(outfile, "wb"); + if (!out) { + printf("ERROR: unable to open file %s\n", outfile); fclose(in); return 1; } @@ -52,31 +52,30 @@ int main(int argc, char** argv) /* create a new handle from a message in a file */ h = codes_handle_new_from_file(0, in, PRODUCT_GRIB, &err); if (h == NULL) { - printf("Error: unable to create handle from file %s\n",infile); + printf("Error: unable to create handle from file %s\n", infile); } /* set centre as a long */ - CODES_CHECK(codes_set_long(h,"centre",centre),0); + CODES_CHECK(codes_set_long(h, "centre", centre), 0); /* set paramId and shortName - normally you would do one or the other */ - CODES_CHECK(codes_set_long(h,"paramId", 500004),0); + CODES_CHECK(codes_set_long(h, "paramId", 500004), 0); /* the value of str_len is not used, it can be anything! */ - CODES_CHECK(codes_set_string(h,"shortName", "fis", &str_len),0); + CODES_CHECK(codes_set_string(h, "shortName", "fis", &str_len), 0); /* get centre as a long */ - CODES_CHECK(codes_get_long(h,"centre",&long_value),0); - printf("centre long value=%ld\n",long_value); + CODES_CHECK(codes_get_long(h, "centre", &long_value), 0); + printf("centre long value=%ld\n", long_value); /* get centre as a string */ - CODES_CHECK(codes_get_string(h,"centre",string_value,&len),0); - printf("centre string value=%s\n",string_value); + CODES_CHECK(codes_get_string(h, "centre", string_value, &len), 0); + printf("centre string value=%s\n", string_value); /* get the coded message in a buffer */ - CODES_CHECK(codes_get_message(h,&buffer,&size),0); + CODES_CHECK(codes_get_message(h, &buffer, &size), 0); /* write the buffer in a file*/ - if(fwrite(buffer,1,size,out) != size) - { + if (fwrite(buffer, 1, size, out) != size) { perror(argv[1]); exit(1); } diff --git a/examples/C/grib_set_pv.c b/examples/C/grib_set_pv.c index 4e50c6768..c16ef6fba 100644 --- a/examples/C/grib_set_pv.c +++ b/examples/C/grib_set_pv.c @@ -19,39 +19,40 @@ #include #include "eccodes.h" -static void usage(const char* prog) { - fprintf(stderr, "usage: %s in out\n",prog); +static void usage(const char* prog) +{ + fprintf(stderr, "usage: %s in out\n", prog); exit(1); } int main(int argc, char** argv) { - int err = 0; - long NV = 0; - size_t size=0; - double pv[4]={1,2,3,4}; - size_t pvsize=4; + int err = 0; + long NV = 0; + size_t size = 0; + double pv[4] = { 1, 2, 3, 4 }; + size_t pvsize = 4; - FILE* in = NULL; - char* infile = NULL; - FILE* out = NULL; - char* outfile = NULL; - codes_handle *h = NULL; + FILE* in = NULL; + char* infile = NULL; + FILE* out = NULL; + char* outfile = NULL; + codes_handle* h = NULL; const void* buffer = NULL; if (argc != 3) usage(argv[0]); - infile = argv[1]; - outfile= argv[2]; + infile = argv[1]; + outfile = argv[2]; in = fopen(infile, "rb"); - if(!in) { - fprintf(stderr, "ERROR: unable to open input file %s\n",infile); + if (!in) { + fprintf(stderr, "ERROR: unable to open input file %s\n", infile); return 1; } out = fopen(outfile, "wb"); - if(!out) { - fprintf(stderr, "ERROR: unable to open output file %s\n",outfile); + if (!out) { + fprintf(stderr, "ERROR: unable to open output file %s\n", outfile); fclose(in); return 1; } @@ -59,23 +60,22 @@ int main(int argc, char** argv) /* create a new handle from a message in a file */ h = codes_handle_new_from_file(0, in, PRODUCT_GRIB, &err); if (h == NULL) { - fprintf(stderr, "Error: unable to create handle from file %s\n",infile); + fprintf(stderr, "Error: unable to create handle from file %s\n", infile); } - CODES_CHECK(codes_set_long(h,"PVPresent", 1),0); + CODES_CHECK(codes_set_long(h, "PVPresent", 1), 0); - CODES_CHECK(codes_set_double_array(h, "pv", pv, pvsize),0); + CODES_CHECK(codes_set_double_array(h, "pv", pv, pvsize), 0); /* Once we set the pv array, the NV key should be also set */ - CODES_CHECK(codes_get_long(h, "NV", &NV),0); - assert( NV == pvsize ); + CODES_CHECK(codes_get_long(h, "NV", &NV), 0); + assert(NV == pvsize); /* get the coded message in a buffer */ - CODES_CHECK(codes_get_message(h, &buffer, &size),0); + CODES_CHECK(codes_get_message(h, &buffer, &size), 0); /* write the buffer in a file*/ - if(fwrite(buffer, 1, size, out) != size) - { + if (fwrite(buffer, 1, size, out) != size) { perror(argv[1]); exit(1); } diff --git a/examples/C/large_grib1.c b/examples/C/large_grib1.c index 8fc11852e..0bc5e0553 100644 --- a/examples/C/large_grib1.c +++ b/examples/C/large_grib1.c @@ -17,19 +17,19 @@ int main() { const int ni = 2880; const int nj = 2880; - double *values; - int i = 0; - codes_handle *h = NULL; + double* values; + int i = 0; + codes_handle* h = NULL; const char* filename = "bigfile.grib"; - values = (double*) malloc(ni*nj*sizeof(double)); + values = (double*)malloc(ni * nj * sizeof(double)); if (!values) { - printf ("Malloc failed\n"); + printf("Malloc failed\n"); exit(1); } - for (i=0; i paramId= "); while (list) { - printf("%s ",list->value); - list2=codes_grib_util_get_param_id("130.128"); + printf("%s ", list->value); + list2 = codes_grib_util_get_param_id("130.128"); printf("mars.param=11.2 -> paramId= "); while (list2) { - printf("%s ",list2->value); - list2=list2->next; + printf("%s ", list2->value); + list2 = list2->next; } - list=list->next; + list = list->next; } printf("\n"); printf("\n"); printf("paramId=130 -> mars.param= "); - list=codes_grib_util_get_mars_param("130"); + list = codes_grib_util_get_mars_param("130"); while (list) { - printf("%s ",list->value); - list=list->next; + printf("%s ", list->value); + list = list->next; } printf("\n"); diff --git a/examples/C/multi2.c b/examples/C/multi2.c index f6759fd40..e5a9e94cd 100644 --- a/examples/C/multi2.c +++ b/examples/C/multi2.c @@ -21,36 +21,36 @@ #include #include -const int NUM_FIELDS = 4; -const int COUNT = 20; +const int NUM_FIELDS = 4; +const int COUNT = 20; const char* file_path = "../../data/multi_created.grib2"; static void read_data(int num_msgs) { - int err = 0,i; - FILE* fp = NULL; - long stepRange = 0; - codes_handle *h = NULL; + int err = 0, i; + FILE* fp = NULL; + long stepRange = 0; + codes_handle* h = NULL; fp = fopen(file_path, "rb"); - if(!fp) { + if (!fp) { fprintf(stderr, "ERROR: unable to open grib file %s\n", file_path); exit(1); } printf("Opened GRIB file %s: \n", file_path); - for(i=0; i2) usage(argv[0]); + if (argc > 2) usage(argv[0]); - file=argv[1]; + file = argv[1]; - h=codes_handle_new_from_nc_file(c,file,&err); - codes_get_string(h,"identifier",identifier,&len); - printf("%s\n",identifier); - CODES_CHECK(err,0); + h = codes_handle_new_from_nc_file(c, file, &err); + codes_get_string(h, "identifier", identifier, &len); + printf("%s\n", identifier); + CODES_CHECK(err, 0); return err; } diff --git a/examples/C/new_sample.c b/examples/C/new_sample.c index b39e73315..887f8e011 100644 --- a/examples/C/new_sample.c +++ b/examples/C/new_sample.c @@ -14,123 +14,123 @@ int main(int argc, char** argv) { - codes_handle *h = NULL; + codes_handle* h = NULL; size_t size = 0; double* vdouble = NULL; FILE* f = NULL; const void* buffer = NULL; - if(argc != 2) { - fprintf(stderr,"usage: %s out\n",argv[0]); + if (argc != 2) { + fprintf(stderr, "usage: %s out\n", argv[0]); exit(1); } - h = codes_grib_handle_new_from_samples(NULL,"GRIB2"); - if(!h) { - fprintf(stderr,"Cannot create grib handle\n"); + h = codes_grib_handle_new_from_samples(NULL, "GRIB2"); + if (!h) { + fprintf(stderr, "Cannot create grib handle\n"); exit(1); } - CODES_CHECK(codes_set_long(h,"parametersVersion",1),0); - CODES_CHECK(codes_set_long(h,"truncateLaplacian",0),0); - CODES_CHECK(codes_set_long(h,"truncateDegrees",0),0); - CODES_CHECK(codes_set_long(h,"dummy",1),0); - CODES_CHECK(codes_set_long(h,"changingPrecision",0),0); - CODES_CHECK(codes_set_long(h,"unitsFactor",1),0); - CODES_CHECK(codes_set_long(h,"unitsBias",0),0); - CODES_CHECK(codes_set_long(h,"timeRangeIndicatorFromStepRange",-1),0); - CODES_CHECK(codes_set_long(h,"missingValue",9999),0); + CODES_CHECK(codes_set_long(h, "parametersVersion", 1), 0); + CODES_CHECK(codes_set_long(h, "truncateLaplacian", 0), 0); + CODES_CHECK(codes_set_long(h, "truncateDegrees", 0), 0); + CODES_CHECK(codes_set_long(h, "dummy", 1), 0); + CODES_CHECK(codes_set_long(h, "changingPrecision", 0), 0); + CODES_CHECK(codes_set_long(h, "unitsFactor", 1), 0); + CODES_CHECK(codes_set_long(h, "unitsBias", 0), 0); + CODES_CHECK(codes_set_long(h, "timeRangeIndicatorFromStepRange", -1), 0); + CODES_CHECK(codes_set_long(h, "missingValue", 9999), 0); /* 0 = Meteorological products (grib2/tables/4/0.0.table) */ - CODES_CHECK(codes_set_long(h,"discipline",0),0); + CODES_CHECK(codes_set_long(h, "discipline", 0), 0); - CODES_CHECK(codes_set_long(h,"editionNumber",2),0); + CODES_CHECK(codes_set_long(h, "editionNumber", 2), 0); /* 98 = European Center for Medium-Range Weather Forecasts */ - CODES_CHECK(codes_set_long(h,"centre",98),0); + CODES_CHECK(codes_set_long(h, "centre", 98), 0); - CODES_CHECK(codes_set_long(h,"subCentre",0),0); + CODES_CHECK(codes_set_long(h, "subCentre", 0), 0); /* 4 = Version implemented on 7 November 2007 (grib2/tables/1.0.table) */ - CODES_CHECK(codes_set_long(h,"tablesVersion",4),0); + CODES_CHECK(codes_set_long(h, "tablesVersion", 4), 0); /* 0 = Local tables not used (grib2/tables/4/1.1.table) */ - CODES_CHECK(codes_set_long(h,"localTablesVersion",0),0); + CODES_CHECK(codes_set_long(h, "localTablesVersion", 0), 0); /* 1 = Start of forecast (grib2/tables/4/1.2.table) */ - CODES_CHECK(codes_set_long(h,"significanceOfReferenceTime",1),0); + CODES_CHECK(codes_set_long(h, "significanceOfReferenceTime", 1), 0); - CODES_CHECK(codes_set_long(h,"year",2007),0); - CODES_CHECK(codes_set_long(h,"month",3),0); - CODES_CHECK(codes_set_long(h,"day",23),0); - CODES_CHECK(codes_set_long(h,"hour",12),0); - CODES_CHECK(codes_set_long(h,"minute",0),0); - CODES_CHECK(codes_set_long(h,"second",0),0); - CODES_CHECK(codes_set_long(h,"dataDate",20070323),0); - CODES_CHECK(codes_set_long(h,"dataTime",1200),0); + CODES_CHECK(codes_set_long(h, "year", 2007), 0); + CODES_CHECK(codes_set_long(h, "month", 3), 0); + CODES_CHECK(codes_set_long(h, "day", 23), 0); + CODES_CHECK(codes_set_long(h, "hour", 12), 0); + CODES_CHECK(codes_set_long(h, "minute", 0), 0); + CODES_CHECK(codes_set_long(h, "second", 0), 0); + CODES_CHECK(codes_set_long(h, "dataDate", 20070323), 0); + CODES_CHECK(codes_set_long(h, "dataTime", 1200), 0); /* 0 = Operational products (grib2/tables/4/1.3.table) */ - CODES_CHECK(codes_set_long(h,"productionStatusOfProcessedData",0),0); + CODES_CHECK(codes_set_long(h, "productionStatusOfProcessedData", 0), 0); /* 2 = Analysis and forecast products (grib2/tables/4/1.4.table) */ - CODES_CHECK(codes_set_long(h,"typeOfProcessedData",2),0); + CODES_CHECK(codes_set_long(h, "typeOfProcessedData", 2), 0); - CODES_CHECK(codes_set_long(h,"selectStepTemplateInterval",1),0); - CODES_CHECK(codes_set_long(h,"selectStepTemplateInstant",1),0); - CODES_CHECK(codes_set_long(h,"grib2LocalSectionPresent",0),0); + CODES_CHECK(codes_set_long(h, "selectStepTemplateInterval", 1), 0); + CODES_CHECK(codes_set_long(h, "selectStepTemplateInstant", 1), 0); + CODES_CHECK(codes_set_long(h, "grib2LocalSectionPresent", 0), 0); /* 0 = Specified in Code table 3.1 (grib2/tables/4/3.0.table) */ - CODES_CHECK(codes_set_long(h,"sourceOfGridDefinition",0),0); + CODES_CHECK(codes_set_long(h, "sourceOfGridDefinition", 0), 0); - CODES_CHECK(codes_set_long(h,"numberOfDataPoints",496),0); - CODES_CHECK(codes_set_long(h,"numberOfOctectsForNumberOfPoints",0),0); + CODES_CHECK(codes_set_long(h, "numberOfDataPoints", 496), 0); + CODES_CHECK(codes_set_long(h, "numberOfOctectsForNumberOfPoints", 0), 0); /* 0 = There is no appended list (grib2/tables/4/3.11.table) */ - CODES_CHECK(codes_set_long(h,"interpretationOfNumberOfPoints",0),0); + CODES_CHECK(codes_set_long(h, "interpretationOfNumberOfPoints", 0), 0); - CODES_CHECK(codes_set_long(h,"PLPresent",0),0); + CODES_CHECK(codes_set_long(h, "PLPresent", 0), 0); /* 0 = Latitude/longitude. Also called equidistant cylindrical, or Plate Carree (grib2/tables/4/3.1.table) */ - CODES_CHECK(codes_set_long(h,"gridDefinitionTemplateNumber",0),0); + CODES_CHECK(codes_set_long(h, "gridDefinitionTemplateNumber", 0), 0); /* 0 = Earth assumed spherical with radius = 6,367,470.0 m (grib2/tables/4/3.2.table) */ - CODES_CHECK(codes_set_long(h,"shapeOfTheEarth",0),0); - - CODES_CHECK(codes_set_missing(h,"scaleFactorOfRadiusOfSphericalEarth"),0); - CODES_CHECK(codes_set_missing(h,"scaledValueOfRadiusOfSphericalEarth"),0); - CODES_CHECK(codes_set_missing(h,"scaleFactorOfEarthMajorAxis"),0); - CODES_CHECK(codes_set_missing(h,"scaledValueOfEarthMajorAxis"),0); - CODES_CHECK(codes_set_missing(h,"scaleFactorOfEarthMinorAxis"),0); - CODES_CHECK(codes_set_missing(h,"scaledValueOfEarthMinorAxis"),0); - CODES_CHECK(codes_set_long(h,"radius",6367470),0); - CODES_CHECK(codes_set_long(h,"Ni",16),0); - CODES_CHECK(codes_set_long(h,"Nj",31),0); - CODES_CHECK(codes_set_long(h,"basicAngleOfTheInitialProductionDomain",0),0); - CODES_CHECK(codes_set_long(h,"mBasicAngle",0),0); - CODES_CHECK(codes_set_long(h,"angleMultiplier",1),0); - CODES_CHECK(codes_set_long(h,"mAngleMultiplier",1000000),0); - CODES_CHECK(codes_set_missing(h,"subdivisionsOfBasicAngle"),0); - CODES_CHECK(codes_set_long(h,"angleDivisor",1000000),0); - CODES_CHECK(codes_set_long(h,"latitudeOfFirstGridPoint",60000000),0); - CODES_CHECK(codes_set_long(h,"longitudeOfFirstGridPoint",0),0); + CODES_CHECK(codes_set_long(h, "shapeOfTheEarth", 0), 0); + + CODES_CHECK(codes_set_missing(h, "scaleFactorOfRadiusOfSphericalEarth"), 0); + CODES_CHECK(codes_set_missing(h, "scaledValueOfRadiusOfSphericalEarth"), 0); + CODES_CHECK(codes_set_missing(h, "scaleFactorOfEarthMajorAxis"), 0); + CODES_CHECK(codes_set_missing(h, "scaledValueOfEarthMajorAxis"), 0); + CODES_CHECK(codes_set_missing(h, "scaleFactorOfEarthMinorAxis"), 0); + CODES_CHECK(codes_set_missing(h, "scaledValueOfEarthMinorAxis"), 0); + CODES_CHECK(codes_set_long(h, "radius", 6367470), 0); + CODES_CHECK(codes_set_long(h, "Ni", 16), 0); + CODES_CHECK(codes_set_long(h, "Nj", 31), 0); + CODES_CHECK(codes_set_long(h, "basicAngleOfTheInitialProductionDomain", 0), 0); + CODES_CHECK(codes_set_long(h, "mBasicAngle", 0), 0); + CODES_CHECK(codes_set_long(h, "angleMultiplier", 1), 0); + CODES_CHECK(codes_set_long(h, "mAngleMultiplier", 1000000), 0); + CODES_CHECK(codes_set_missing(h, "subdivisionsOfBasicAngle"), 0); + CODES_CHECK(codes_set_long(h, "angleDivisor", 1000000), 0); + CODES_CHECK(codes_set_long(h, "latitudeOfFirstGridPoint", 60000000), 0); + CODES_CHECK(codes_set_long(h, "longitudeOfFirstGridPoint", 0), 0); /* 48 = 00110000 (3=1) i direction increments given (4=1) j direction increments given (5=0) Resolved u- and v- components of vector quantities relative to easterly and northerly directions See grib2/tables/[tablesVersion]/3.3.table */ - CODES_CHECK(codes_set_long(h,"resolutionAndComponentFlags",48),0); + CODES_CHECK(codes_set_long(h, "resolutionAndComponentFlags", 48), 0); - CODES_CHECK(codes_set_long(h,"iDirectionIncrementGiven",1),0); - CODES_CHECK(codes_set_long(h,"jDirectionIncrementGiven",1),0); - CODES_CHECK(codes_set_long(h,"uvRelativeToGrid",0),0); - CODES_CHECK(codes_set_long(h,"latitudeOfLastGridPoint",0),0); - CODES_CHECK(codes_set_long(h,"longitudeOfLastGridPoint",30000000),0); - CODES_CHECK(codes_set_long(h,"iDirectionIncrement",2000000),0); - CODES_CHECK(codes_set_long(h,"jDirectionIncrement",2000000),0); + CODES_CHECK(codes_set_long(h, "iDirectionIncrementGiven", 1), 0); + CODES_CHECK(codes_set_long(h, "jDirectionIncrementGiven", 1), 0); + CODES_CHECK(codes_set_long(h, "uvRelativeToGrid", 0), 0); + CODES_CHECK(codes_set_long(h, "latitudeOfLastGridPoint", 0), 0); + CODES_CHECK(codes_set_long(h, "longitudeOfLastGridPoint", 30000000), 0); + CODES_CHECK(codes_set_long(h, "iDirectionIncrement", 2000000), 0); + CODES_CHECK(codes_set_long(h, "jDirectionIncrement", 2000000), 0); /* 0 = 00000000 (1=0) Points of first row or column scan in the +i (+x) direction @@ -138,101 +138,101 @@ int main(int argc, char** argv) (3=0) Adjacent points in i (x) direction are consecutive (4=0) All rows scan in the same direction See grib2/tables/[tablesVersion]/3.4.table */ - CODES_CHECK(codes_set_long(h,"scanningMode",0),0); + CODES_CHECK(codes_set_long(h, "scanningMode", 0), 0); - CODES_CHECK(codes_set_long(h,"iScansNegatively",0),0); - CODES_CHECK(codes_set_long(h,"jScansPositively",0),0); - CODES_CHECK(codes_set_long(h,"jPointsAreConsecutive",0),0); - CODES_CHECK(codes_set_long(h,"alternativeRowScanning",0),0); - CODES_CHECK(codes_set_long(h,"iScansPositively",1),0); + CODES_CHECK(codes_set_long(h, "iScansNegatively", 0), 0); + CODES_CHECK(codes_set_long(h, "jScansPositively", 0), 0); + CODES_CHECK(codes_set_long(h, "jPointsAreConsecutive", 0), 0); + CODES_CHECK(codes_set_long(h, "alternativeRowScanning", 0), 0); + CODES_CHECK(codes_set_long(h, "iScansPositively", 1), 0); /* ITERATOR */ /* NEAREST */ - CODES_CHECK(codes_set_long(h,"timeRangeIndicator",0),0); - CODES_CHECK(codes_set_long(h,"NV",0),0); - CODES_CHECK(codes_set_long(h,"neitherPresent",0),0); + CODES_CHECK(codes_set_long(h, "timeRangeIndicator", 0), 0); + CODES_CHECK(codes_set_long(h, "NV", 0), 0); + CODES_CHECK(codes_set_long(h, "neitherPresent", 0), 0); /* 0 = Analysis or forecast at a horizontal level or in a horizontal layer at a point in time (grib2/tables/4/4.0.table) */ - CODES_CHECK(codes_set_long(h,"productDefinitionTemplateNumber",0),0); + CODES_CHECK(codes_set_long(h, "productDefinitionTemplateNumber", 0), 0); /* Parameter information */ /* 0 = Temperature (grib2/tables/4/4.1.0.table) */ - CODES_CHECK(codes_set_long(h,"parameterCategory",0),0); + CODES_CHECK(codes_set_long(h, "parameterCategory", 0), 0); /* 0 = Temperature (K) (grib2/tables/4/4.2.0.0.table) */ - CODES_CHECK(codes_set_long(h,"parameterNumber",0),0); + CODES_CHECK(codes_set_long(h, "parameterNumber", 0), 0); /* 0 = Analysis (grib2/tables/4/4.3.table) */ - CODES_CHECK(codes_set_long(h,"typeOfGeneratingProcess",0),0); + CODES_CHECK(codes_set_long(h, "typeOfGeneratingProcess", 0), 0); - CODES_CHECK(codes_set_long(h,"backgroundProcess",255),0); - CODES_CHECK(codes_set_long(h,"generatingProcessIdentifier",128),0); - CODES_CHECK(codes_set_long(h,"hoursAfterDataCutoff",0),0); - CODES_CHECK(codes_set_long(h,"minutesAfterDataCutoff",0),0); + CODES_CHECK(codes_set_long(h, "backgroundProcess", 255), 0); + CODES_CHECK(codes_set_long(h, "generatingProcessIdentifier", 128), 0); + CODES_CHECK(codes_set_long(h, "hoursAfterDataCutoff", 0), 0); + CODES_CHECK(codes_set_long(h, "minutesAfterDataCutoff", 0), 0); /* 1 = Hour (grib2/tables/4/4.4.table) */ - CODES_CHECK(codes_set_long(h,"indicatorOfUnitOfTimeRange",1),0); + CODES_CHECK(codes_set_long(h, "indicatorOfUnitOfTimeRange", 1), 0); /* 1 = Hour (stepUnits.table) */ - CODES_CHECK(codes_set_long(h,"stepUnits",1),0); + CODES_CHECK(codes_set_long(h, "stepUnits", 1), 0); - CODES_CHECK(codes_set_long(h,"forecastTime",0),0); + CODES_CHECK(codes_set_long(h, "forecastTime", 0), 0); /* 1 = Ground or water surface (grib2/tables/4/4.5.table) */ - CODES_CHECK(codes_set_long(h,"typeOfFirstFixedSurface",1),0); + CODES_CHECK(codes_set_long(h, "typeOfFirstFixedSurface", 1), 0); - CODES_CHECK(codes_set_missing(h,"scaleFactorOfFirstFixedSurface"),0); - CODES_CHECK(codes_set_missing(h,"scaledValueOfFirstFixedSurface"),0); + CODES_CHECK(codes_set_missing(h, "scaleFactorOfFirstFixedSurface"), 0); + CODES_CHECK(codes_set_missing(h, "scaledValueOfFirstFixedSurface"), 0); /* 255 = Missing (grib2/tables/4/4.5.table) */ - CODES_CHECK(codes_set_long(h,"typeOfSecondFixedSurface",255),0); + CODES_CHECK(codes_set_long(h, "typeOfSecondFixedSurface", 255), 0); - CODES_CHECK(codes_set_missing(h,"scaleFactorOfSecondFixedSurface"),0); - CODES_CHECK(codes_set_missing(h,"scaledValueOfSecondFixedSurface"),0); - CODES_CHECK(codes_set_long(h,"level",0),0); - CODES_CHECK(codes_set_long(h,"bottomLevel",0),0); - CODES_CHECK(codes_set_long(h,"topLevel",0),0); - CODES_CHECK(codes_set_long(h,"dummyc",0),0); - CODES_CHECK(codes_set_long(h,"PVPresent",0),0); + CODES_CHECK(codes_set_missing(h, "scaleFactorOfSecondFixedSurface"), 0); + CODES_CHECK(codes_set_missing(h, "scaledValueOfSecondFixedSurface"), 0); + CODES_CHECK(codes_set_long(h, "level", 0), 0); + CODES_CHECK(codes_set_long(h, "bottomLevel", 0), 0); + CODES_CHECK(codes_set_long(h, "topLevel", 0), 0); + CODES_CHECK(codes_set_long(h, "dummyc", 0), 0); + CODES_CHECK(codes_set_long(h, "PVPresent", 0), 0); /* grib 2 Section 5 DATA REPRESENTATION SECTION */ - CODES_CHECK(codes_set_long(h,"numberOfValues",496),0); + CODES_CHECK(codes_set_long(h, "numberOfValues", 496), 0); /* 0 = Grid point data - simple packing (grib2/tables/4/5.0.table) */ - CODES_CHECK(codes_set_long(h,"dataRepresentationTemplateNumber",0),0); + CODES_CHECK(codes_set_long(h, "dataRepresentationTemplateNumber", 0), 0); - CODES_CHECK(codes_set_long(h,"decimalScaleFactor",0),0); - CODES_CHECK(codes_set_long(h,"bitsPerValue",0),0); + CODES_CHECK(codes_set_long(h, "decimalScaleFactor", 0), 0); + CODES_CHECK(codes_set_long(h, "bitsPerValue", 0), 0); /* 0 = Floating point (grib2/tables/4/5.1.table) */ - CODES_CHECK(codes_set_long(h,"typeOfOriginalFieldValues",0),0); + CODES_CHECK(codes_set_long(h, "typeOfOriginalFieldValues", 0), 0); - CODES_CHECK(codes_set_long(h,"representationMode",0),0); + CODES_CHECK(codes_set_long(h, "representationMode", 0), 0); /* grib 2 Section 6 BIT-MAP SECTION */ /* 255 = A bit map does not apply to this product (grib2/tables/4/6.0.table) */ - CODES_CHECK(codes_set_long(h,"bitMapIndicator",255),0); + CODES_CHECK(codes_set_long(h, "bitMapIndicator", 255), 0); - CODES_CHECK(codes_set_long(h,"bitmapPresent",0),0); + CODES_CHECK(codes_set_long(h, "bitmapPresent", 0), 0); /* grib 2 Section 7 data */ - size = 496; - vdouble = (double*)calloc(size,sizeof(double)); - if(!vdouble) { - fprintf(stderr,"failed to allocate %lu bytes\n",size*sizeof(double)); + size = 496; + vdouble = (double*)calloc(size, sizeof(double)); + if (!vdouble) { + fprintf(stderr, "failed to allocate %lu bytes\n", size * sizeof(double)); exit(1); } @@ -361,28 +361,28 @@ int main(int argc, char** argv) vdouble[ 488] = 1; vdouble[ 489] = 1; vdouble[ 490] = 1; vdouble[ 491] = 1; vdouble[ 492] = 1; vdouble[ 493] = 1; vdouble[ 494] = 1; vdouble[ 495] = 1; - CODES_CHECK(codes_set_double_array(h,"values",vdouble,size),0); + CODES_CHECK(codes_set_double_array(h, "values", vdouble, size), 0); free(vdouble); - CODES_CHECK(codes_set_long(h,"dirty_statistics",1),0); - CODES_CHECK(codes_set_long(h,"changeDecimalPrecision",0),0); - CODES_CHECK(codes_set_long(h,"decimalPrecision",0),0); - CODES_CHECK(codes_set_long(h,"setBitsPerValue",0),0); -/* Save the message */ - - f = fopen(argv[1],"wb"); - if(!f) { + CODES_CHECK(codes_set_long(h, "dirty_statistics", 1), 0); + CODES_CHECK(codes_set_long(h, "changeDecimalPrecision", 0), 0); + CODES_CHECK(codes_set_long(h, "decimalPrecision", 0), 0); + CODES_CHECK(codes_set_long(h, "setBitsPerValue", 0), 0); + /* Save the message */ + + f = fopen(argv[1], "wb"); + if (!f) { perror(argv[1]); exit(1); } - CODES_CHECK(codes_get_message(h,&buffer,&size),0); + CODES_CHECK(codes_get_message(h, &buffer, &size), 0); - if(fwrite(buffer,1,size,f) != size) { + if (fwrite(buffer, 1, size, f) != size) { perror(argv[1]); exit(1); } - if(fclose(f)) { + if (fclose(f)) { perror(argv[1]); exit(1); } diff --git a/examples/C/set_missing.c b/examples/C/set_missing.c index bb7ae284a..e65c70483 100644 --- a/examples/C/set_missing.c +++ b/examples/C/set_missing.c @@ -23,26 +23,26 @@ int main(int argc, char** argv) { int err = 0, is_missing = 0; - FILE* in = NULL; - const char* infile = "../../data/reduced_gaussian_pressure_level.grib2"; - FILE* out = NULL; + FILE* in = NULL; + const char* infile = "../../data/reduced_gaussian_pressure_level.grib2"; + FILE* out = NULL; const char* outfile = "out_surface_level.grib2"; - codes_handle *h = NULL; - const void* buffer = NULL; - size_t size=0; - char str[]="sfc"; - size_t str_len=3; - long Ni = 0; + codes_handle* h = NULL; + const void* buffer = NULL; + size_t size = 0; + char str[] = "sfc"; + size_t str_len = 3; + long Ni = 0; - in = fopen(infile,"rb"); - if(!in) { - printf("ERROR: unable to open input file %s\n",infile); + in = fopen(infile, "rb"); + if (!in) { + printf("ERROR: unable to open input file %s\n", infile); return 1; } - out = fopen(outfile,"wb"); - if(!out) { - printf("ERROR: unable to open output file %s\n",outfile); + out = fopen(outfile, "wb"); + if (!out) { + printf("ERROR: unable to open output file %s\n", outfile); fclose(in); return 1; } @@ -50,26 +50,25 @@ int main(int argc, char** argv) /* create a new handle from a message in a file */ h = codes_handle_new_from_file(0, in, PRODUCT_GRIB, &err); if (h == NULL) { - printf("Error: unable to create handle from file %s\n",infile); + printf("Error: unable to create handle from file %s\n", infile); } - CODES_CHECK(codes_set_string(h,"typeOfFirstFixedSurface",str,&str_len),0); - CODES_CHECK(codes_set_missing(h,"scaleFactorOfFirstFixedSurface"),0); - CODES_CHECK(codes_set_missing(h,"scaledValueOfFirstFixedSurface"),0); + CODES_CHECK(codes_set_string(h, "typeOfFirstFixedSurface", str, &str_len), 0); + CODES_CHECK(codes_set_missing(h, "scaleFactorOfFirstFixedSurface"), 0); + CODES_CHECK(codes_set_missing(h, "scaledValueOfFirstFixedSurface"), 0); /* See GRIB-490 */ - CODES_CHECK(codes_get_long(h,"Ni",&Ni),0); + CODES_CHECK(codes_get_long(h, "Ni", &Ni), 0); is_missing = codes_is_missing(h, "Ni", &err); - CODES_CHECK(err,0); + CODES_CHECK(err, 0); if (is_missing != 1) assert(!"Ni should be missing"); - CODES_CHECK(codes_set_long(h,"Ni", Ni),0); + CODES_CHECK(codes_set_long(h, "Ni", Ni), 0); /* get the coded message in a buffer */ - CODES_CHECK(codes_get_message(h,&buffer,&size),0); + CODES_CHECK(codes_get_message(h, &buffer, &size), 0); /* write the buffer in a file*/ - if(fwrite(buffer,1,size,out) != size) - { + if (fwrite(buffer, 1, size, out) != size) { perror(argv[1]); exit(1); } diff --git a/examples/C/values_check.c b/examples/C/values_check.c index de6d22e37..2796668f0 100644 --- a/examples/C/values_check.c +++ b/examples/C/values_check.c @@ -11,55 +11,54 @@ int main(int argc, char* argv[]) { - FILE* f; - int err=0; - char infile[]="../../data/reduced_gaussian_model_level.grib1"; - codes_handle *h=NULL; - codes_context* c=codes_context_get_default(); - codes_values values[2]; - int nvalues=2; - int i; - char* name = NULL; + FILE* f; + int err = 0; + char infile[] = "../../data/reduced_gaussian_model_level.grib1"; + codes_handle* h = NULL; + codes_context* c = codes_context_get_default(); + codes_values values[2]; + int nvalues = 2; + int i; + char* name = NULL; - f=fopen(infile,"rb"); - if (!f) { - perror(infile); - exit(1); - } + f = fopen(infile, "rb"); + if (!f) { + perror(infile); + exit(1); + } - h=codes_handle_new_from_file(c,f,PRODUCT_GRIB,&err); - if (!h) { - printf("unable to create handle from file %s\n",infile); - exit(err); - } - fclose(f); + h = codes_handle_new_from_file(c, f, PRODUCT_GRIB, &err); + if (!h) { + printf("unable to create handle from file %s\n", infile); + exit(err); + } + fclose(f); - values[0].type=CODES_TYPE_LONG; - values[0].name="centre"; - values[0].long_value=98; + values[0].type = CODES_TYPE_LONG; + values[0].name = "centre"; + values[0].long_value = 98; - values[1].type=CODES_TYPE_LONG; - values[1].name="level"; - values[1].long_value=2; + values[1].type = CODES_TYPE_LONG; + values[1].name = "level"; + values[1].long_value = 2; - /*CODES_VALUE_DIFFERENT -> value is different*/ - err=codes_values_check(h,values,nvalues); - if (err) { - for (i=0;i value is different*/ + err = codes_values_check(h, values, nvalues); + if (err) { + for (i = 0; i < nvalues; i++) { + if (values[i].error == err) name = (char*)values[i].name; + } + printf("ERROR: \"%s\" %s\n", name, codes_get_error_message(err)); + } - values[1].name="levelll"; - err=codes_values_check(h,values,nvalues); - if (err) { - for (i=0;i$fTmp -${examples_dir}/eccodes_f_get_product_kind $fTmp >/dev/null 2>&1 +${examples_dir}/eccodes_f_get_product_kind $fTmp > $fOut +cat $fOut +grep -q "product: BUFR" $fOut +grep -q "product: GRIB" $fOut -rm -f ${fTmp} +rm -f $fTmp $fOut diff --git a/fortran/eccodes_f90_tail.f90 b/fortran/eccodes_f90_tail.f90 index f4e81d0c3..31a8e73ee 100644 --- a/fortran/eccodes_f90_tail.f90 +++ b/fortran/eccodes_f90_tail.f90 @@ -1545,6 +1545,26 @@ subroutine codes_dump ( msgid , status) call grib_dump (msgid, status) end subroutine codes_dump + + !> Get the API version + !> + !> In case of error, if the status parameter (optional) is not given, the program will + !> exit with an error message.\n Otherwise the error message can be + !> gathered with @ref grib_get_error_string. + !> + !> @param api_version The version as an integer + !> @param status GRIB_SUCCESS if OK, integer value on error +subroutine codes_get_api_version(api_version, status) + integer(kind = kindOfInt), intent(out) :: api_version + integer(kind=kindOfInt),optional, intent(out) :: status + + call grib_f_get_api_version(api_version) + if (present(status)) then + status = CODES_SUCCESS + endif +end subroutine codes_get_api_version + + !> Get the error message given an error code !> !> @param error error code diff --git a/fortran/eccodes_visibility.h b/fortran/eccodes_visibility.h index d057f4361..ad3cf2fbd 100644 --- a/fortran/eccodes_visibility.h +++ b/fortran/eccodes_visibility.h @@ -26,6 +26,7 @@ public :: codes_new_from_message, & public :: codes_release public :: codes_dump public :: codes_get_error_string +public :: codes_get_api_version public :: codes_get_size public :: codes_get_message_size, codes_copy_message public :: codes_write, codes_grib_multi_append diff --git a/fortran/grib_fortran.c b/fortran/grib_fortran.c index f9235c5ce..a804e2c6c 100644 --- a/fortran/grib_fortran.c +++ b/fortran/grib_fortran.c @@ -2160,6 +2160,18 @@ int grib_f_get_error_string(int* err, char* buf, int len){ return grib_f_get_error_string_(err,buf,len); } +/*****************************************************************************/ +int grib_f_get_api_version_(int* apiVersion,int len){ + *apiVersion = grib_get_api_version(); + return GRIB_SUCCESS; +} +int grib_f_get_api_version__(int* apiVersion, int len){ + return grib_f_get_api_version_(apiVersion, len); +} +int grib_f_get_api_version(int* apiVersion, int len){ + return grib_f_get_api_version_(apiVersion, len); +} + /*****************************************************************************/ int grib_f_get_size_int_(int* gid, char* key, int* val, int len){ grib_handle *h = get_handle(*gid); diff --git a/fortran/grib_fortran_prototypes.h b/fortran/grib_fortran_prototypes.h index 2c3dd1698..1676eefac 100644 --- a/fortran/grib_fortran_prototypes.h +++ b/fortran/grib_fortran_prototypes.h @@ -202,6 +202,11 @@ int grib_f_dump(int *gid); int grib_f_print_(int *gid, char *key, int len); int grib_f_print__(int *gid, char *key, int len); int grib_f_print(int *gid, char *key, int len); + +int grib_f_get_api_version_(int* apiVersion,int len); +int grib_f_get_api_version__(int* apiVersion,int len); +int grib_f_get_api_version(int* apiVersion,int len); + int grib_f_get_error_string_(int *err, char *buf, int len); int grib_f_get_error_string__(int *err, char *buf, int len); int grib_f_get_error_string(int *err, char *buf, int len); diff --git a/src/accessor.class b/src/accessor.class index 701bb9dd7..f36f35e64 100644 --- a/src/accessor.class +++ b/src/accessor.class @@ -1,42 +1,43 @@ static grib_section* sub_section(grib_accessor* a); -static int get_native_type(grib_accessor*); +static int get_native_type(grib_accessor*); static int pack_missing(grib_accessor*); static int is_missing(grib_accessor*); -static int pack_bytes(grib_accessor*,const unsigned char*, size_t *len); -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int pack_string(grib_accessor*, const char*, size_t *len); -static int pack_string_array(grib_accessor*, const char**, size_t *len); +static int pack_bytes(grib_accessor*, const unsigned char*, size_t* len); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int pack_string(grib_accessor*, const char*, size_t* len); +static int pack_string_array(grib_accessor*, const char**, size_t* len); static int pack_expression(grib_accessor*, grib_expression*); -static int unpack_bytes (grib_accessor*,unsigned char*, size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); -static int unpack_string_array (grib_accessor*, char**, size_t *len); +static int unpack_bytes(grib_accessor*, unsigned char*, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); +static int unpack_string_array(grib_accessor*, char**, size_t* len); static size_t string_length(grib_accessor*); static long byte_count(grib_accessor*); static long byte_offset(grib_accessor*); static long next_offset(grib_accessor*); -static int value_count(grib_accessor*,long*); -static void destroy(grib_context*,grib_accessor*); +static int value_count(grib_accessor*, long*); +static void destroy(grib_context*, grib_accessor*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void post_init(grib_accessor*); static void init_class(grib_accessor_class*); -static int notify_change(grib_accessor*,grib_accessor*); -static void update_size(grib_accessor*,size_t); -static size_t preferred_size(grib_accessor*,int); +static int notify_change(grib_accessor*, grib_accessor*); +static void update_size(grib_accessor*, size_t); +static size_t preferred_size(grib_accessor*, int); static void resize(grib_accessor*,size_t); -static int nearest_smaller_value (grib_accessor*, double,double*); +static int nearest_smaller_value (grib_accessor*, double, double*); static grib_accessor* next(grib_accessor*, int); static int compare(grib_accessor*, grib_accessor*); -static int unpack_double_element(grib_accessor*,size_t i, double* val); -static int unpack_double_subarray(grib_accessor*, double* val,size_t start,size_t len); +static int unpack_double_element(grib_accessor*, size_t i, double* val); +static int unpack_double_subarray(grib_accessor*, double* val, size_t start, size_t len); static int clear(grib_accessor*); -static grib_accessor* make_clone(grib_accessor*,grib_section*,int*); +static grib_accessor* make_clone(grib_accessor*, grib_section*, int*); -typedef struct grib_accessor_NAME { - grib_accessor att; +typedef struct grib_accessor_NAME +{ + grib_accessor att; MEMBERS } grib_accessor_NAME; @@ -74,15 +75,15 @@ static grib_accessor_class _grib_accessor_class_NAME = { &pack_expression, /* pack_expression */ ¬ify_change, /* notify_change */ &update_size, /* update_size */ - &preferred_size, /* preferred_size */ - &resize, /* resize */ + &preferred_size, /* preferred_size */ + &resize, /* resize */ &nearest_smaller_value, /* nearest_smaller_value */ &next, /* next accessor */ &compare, /* compare vs. another accessor */ - &unpack_double_element, /* unpack only ith value */ + &unpack_double_element, /* unpack only ith value */ &unpack_double_subarray, /* unpack a subarray */ - &clear, /* clear */ - &make_clone, /* clone accessor */ + &clear, /* clear */ + &make_clone, /* clone accessor */ }; diff --git a/src/action.c b/src/action.c index 545161094..02f16b270 100644 --- a/src/action.c +++ b/src/action.c @@ -16,16 +16,16 @@ #include "grib_api_internal.h" #if GRIB_PTHREADS -static pthread_once_t once = PTHREAD_ONCE_INIT; +static pthread_once_t once = PTHREAD_ONCE_INIT; static pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER; -static void init_mutex() { +static void init_mutex() +{ pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); - pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init(&mutex1,&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&mutex1, &attr); pthread_mutexattr_destroy(&attr); - } #elif GRIB_OMP_THREADS static int once = 0; @@ -35,8 +35,7 @@ static void init_mutex() { GRIB_OMP_CRITICAL(lock_action_c) { - if (once == 0) - { + if (once == 0) { omp_init_nest_lock(&mutex1); once = 1; } @@ -45,16 +44,16 @@ static void init_mutex() #endif -static void init(grib_action_class *c) +static void init(grib_action_class* c) { - if (!c) return; + if (!c) + return; - GRIB_MUTEX_INIT_ONCE(&once,&init_mutex); + GRIB_MUTEX_INIT_ONCE(&once, &init_mutex); GRIB_MUTEX_LOCK(&mutex1); - if(!c->inited) - { + if (!c->inited) { if (c->super) { - init( *(c->super) ); + init(*(c->super)); } c->init_class(c); c->inited = 1; @@ -89,13 +88,11 @@ static void init(grib_action_class *c) void grib_dump(grib_action* a, FILE* f, int l) { - grib_action_class *c = a->cclass; + grib_action_class* c = a->cclass; init(c); - while(c) - { - if(c->dump) - { + while (c) { + if (c->dump) { c->dump(a, f, l); return; } @@ -104,72 +101,67 @@ void grib_dump(grib_action* a, FILE* f, int l) Assert(0); } -void grib_xref(grib_action* a, FILE* f,const char* path) +void grib_xref(grib_action* a, FILE* f, const char* path) { - grib_action_class *c = a->cclass; + grib_action_class* c = a->cclass; init(c); - while(c) - { - if(c->xref) - { - c->xref(a, f,path); + while (c) { + if (c->xref) { + c->xref(a, f, path); return; } c = c->super ? *(c->super) : NULL; } - printf("xref not implemented for %s\n",a->cclass->name); + printf("xref not implemented for %s\n", a->cclass->name); Assert(0); } -void grib_action_delete(grib_context* context,grib_action* a) +void grib_action_delete(grib_context* context, grib_action* a) { - grib_action_class *c = a->cclass; + grib_action_class* c = a->cclass; init(c); - while(c) - { - if(c->destroy) + while (c) { + if (c->destroy) c->destroy(context, a); c = c->super ? *(c->super) : NULL; } grib_context_free_persistent(context, a); } -int grib_create_accessor(grib_section* p, grib_action* a, grib_loader* h) +int grib_create_accessor(grib_section* p, grib_action* a, grib_loader* h) { - grib_action_class *c = a->cclass; + grib_action_class* c = a->cclass; init(c); - while(c) - { - if(c->create_accessor) { + while (c) { + if (c->create_accessor) { int ret; /* ECC-604: Do not lock excessively */ /*GRIB_MUTEX_INIT_ONCE(&once,&init_mutex);*/ /*GRIB_MUTEX_LOCK(&mutex1);*/ - ret=c->create_accessor(p, a, h); + ret = c->create_accessor(p, a, h); /*GRIB_MUTEX_UNLOCK(&mutex1);*/ return ret; } c = c->super ? *(c->super) : NULL; } - fprintf(stderr,"Cannot create accessor %s %s\n",a->name,a->cclass->name); + fprintf(stderr, "Cannot create accessor %s %s\n", a->name, a->cclass->name); Assert(0); return 0; } -int grib_action_notify_change( grib_action* a, grib_accessor *observer, grib_accessor *observed) +int grib_action_notify_change(grib_action* a, grib_accessor* observer, grib_accessor* observed) { - grib_action_class *c = a->cclass; + grib_action_class* c = a->cclass; /*GRIB_MUTEX_INIT_ONCE(&once,&init_mutex);*/ /*GRIB_MUTEX_LOCK(&mutex1);*/ init(c); - while(c) - { - if(c->notify_change) { - int result = c->notify_change(a,observer,observed); + while (c) { + if (c->notify_change) { + int result = c->notify_change(a, observer, observed); /*GRIB_MUTEX_UNLOCK(&mutex1);*/ return result; } @@ -180,54 +172,49 @@ int grib_action_notify_change( grib_action* a, grib_accessor *observer, grib_acc return 0; } -grib_action* grib_action_reparse( grib_action* a, grib_accessor* acc,int* doit) +grib_action* grib_action_reparse(grib_action* a, grib_accessor* acc, int* doit) { - grib_action_class *c = a->cclass; + grib_action_class* c = a->cclass; init(c); - while(c) - { - if(c->reparse) - return c->reparse(a,acc,doit); + while (c) { + if (c->reparse) + return c->reparse(a, acc, doit); c = c->super ? *(c->super) : NULL; } Assert(0); return 0; } -int grib_action_execute( grib_action* a, grib_handle* h) +int grib_action_execute(grib_action* a, grib_handle* h) { - grib_action_class *c = a->cclass; + grib_action_class* c = a->cclass; init(c); - while(c) - { - if(c->execute) - return c->execute(a,h); + while (c) { + if (c->execute) + return c->execute(a, h); c = c->super ? *(c->super) : NULL; } Assert(0); return 0; } -void grib_dump_action_branch(FILE* out,grib_action* a, int decay) +void grib_dump_action_branch(FILE* out, grib_action* a, int decay) { - while(a) - { - grib_dump(a,out,decay); - a=a->next; + while (a) { + grib_dump(a, out, decay); + a = a->next; } } -void grib_dump_action_tree( grib_context* ctx,FILE* out) +void grib_dump_action_tree(grib_context* ctx, FILE* out) { - grib_dump_action_branch( out, ctx->grib_reader->first->root ,0); + grib_dump_action_branch(out, ctx->grib_reader->first->root, 0); } -void grib_xref_action_branch(FILE* out,grib_action* a,const char* path) +void grib_xref_action_branch(FILE* out, grib_action* a, const char* path) { - while(a) - { - grib_xref(a,out,path); - a=a->next; + while (a) { + grib_xref(a, out, path); + a = a->next; } } - diff --git a/src/action_class_alias.c b/src/action_class_alias.c index a97e59fdb..498022162 100644 --- a/src/action_class_alias.c +++ b/src/action_class_alias.c @@ -37,37 +37,38 @@ or edit "action.class" and rerun ./make_class.pl */ -static void init_class (grib_action_class*); -static void dump (grib_action* d, FILE*,int); -static void xref (grib_action* d, FILE* f,const char* path); -static void destroy (grib_context*,grib_action*); -static int create_accessor(grib_section*,grib_action*,grib_loader*); +static void init_class(grib_action_class*); +static void dump(grib_action* d, FILE*, int); +static void xref(grib_action* d, FILE* f, const char* path); +static void destroy(grib_context*, grib_action*); +static int create_accessor(grib_section*, grib_action*, grib_loader*); -typedef struct grib_action_alias { - grib_action act; -/* Members defined in alias */ - char* target; +typedef struct grib_action_alias +{ + grib_action act; + /* Members defined in alias */ + char* target; } grib_action_alias; static grib_action_class _grib_action_class_alias = { - 0, /* super */ - "action_class_alias", /* name */ - sizeof(grib_action_alias), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - &destroy, /* destroy */ - - &dump, /* dump */ - &xref, /* xref */ - - &create_accessor, /* create_accessor*/ - - 0, /* notify_change */ - 0, /* reparse */ - 0, /* execute */ + 0, /* super */ + "action_class_alias", /* name */ + sizeof(grib_action_alias), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + &destroy, /* destroy */ + + &dump, /* dump */ + &xref, /* xref */ + + &create_accessor, /* create_accessor*/ + + 0, /* notify_change */ + 0, /* reparse */ + 0, /* execute */ }; grib_action_class* grib_action_class_alias = &_grib_action_class_alias; @@ -81,211 +82,211 @@ static void init_class(grib_action_class* c) /* 0 means input strings are equal and 1 means not equal */ GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b) { - if (*a != *b) return 1; - while((*a!=0 && *b!=0) && *(a) == *(b) ) {a++;b++;} - return (*a==0 && *b==0) ? 0 : 1; + if (*a != *b) + return 1; + while ((*a != 0 && *b != 0) && *(a) == *(b)) { + a++; + b++; + } + return (*a == 0 && *b == 0) ? 0 : 1; } -grib_action* grib_action_create_alias(grib_context* context, const char* name, const char* arg1,const char* name_space,int flags) +grib_action* grib_action_create_alias(grib_context* context, const char* name, const char* arg1, const char* name_space, int flags) { - grib_action_alias* a ; - grib_action_class* c = grib_action_class_alias; - grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context,c->size); + grib_action_alias* a; + grib_action_class* c = grib_action_class_alias; + grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context, c->size); act->context = context; - act->op = NULL; - act->name = grib_context_strdup_persistent(context, name); - if(name_space) - act->name_space = grib_context_strdup_persistent(context, name_space); + act->op = NULL; + act->name = grib_context_strdup_persistent(context, name); + if (name_space) + act->name_space = grib_context_strdup_persistent(context, name_space); - act->cclass = c; - act->flags = flags; - a = (grib_action_alias*)act; - a->target = arg1 ? grib_context_strdup_persistent(context, arg1) : NULL; + act->cclass = c; + act->flags = flags; + a = (grib_action_alias*)act; + a->target = arg1 ? grib_context_strdup_persistent(context, arg1) : NULL; return act; } -static int same(const char* a,const char* b) +static int same(const char* a, const char* b) { - if(a == b) return 1; - if(a && b) return (grib_inline_strcmp(a,b) == 0); + if (a == b) + return 1; + if (a && b) + return (grib_inline_strcmp(a, b) == 0); return 0; } -static int create_accessor( grib_section* p, grib_action* act,grib_loader *h) +static int create_accessor(grib_section* p, grib_action* act, grib_loader* h) { - int i,j,id; + int i, j, id; grib_action_alias* self = (grib_action_alias*)act; - grib_accessor *x=NULL ; - grib_accessor *y=NULL ; - grib_handle* hand = NULL; + grib_accessor* x = NULL; + grib_accessor* y = NULL; + grib_handle* hand = NULL; /*if alias and target have the same name add only the namespace */ - if (self->target && !grib_inline_strcmp(act->name,self->target) && act->name_space!=NULL) { - x = grib_find_accessor_fast(p->h,self->target); - if(x == NULL) - { - grib_context_log(p->h->context,GRIB_LOG_DEBUG,"alias %s: cannot find %s (part 1)", - act->name,self->target); - grib_context_log(p->h->context,GRIB_LOG_WARNING,"alias %s: cannot find %s", - act->name,self->target); + if (self->target && !grib_inline_strcmp(act->name, self->target) && act->name_space != NULL) { + x = grib_find_accessor_fast(p->h, self->target); + if (x == NULL) { + grib_context_log(p->h->context, GRIB_LOG_DEBUG, "alias %s: cannot find %s (part 1)", + act->name, self->target); + grib_context_log(p->h->context, GRIB_LOG_WARNING, "alias %s: cannot find %s", + act->name, self->target); return GRIB_SUCCESS; } - if (x->name_space==NULL) - x->name_space=act->name_space; + if (x->name_space == NULL) + x->name_space = act->name_space; grib_context_log(p->h->context, GRIB_LOG_DEBUG, "alias: add only namespace: %s.%s", - act->name_space, act->name); + act->name_space, act->name); i = 0; - while(i < MAX_ACCESSOR_NAMES) { - if(x->all_names[i] != NULL && !grib_inline_strcmp(x->all_names[i],act->name) ) { - if (x->all_name_spaces[i]==NULL) { - x->all_name_spaces[i] = act->name_space; + while (i < MAX_ACCESSOR_NAMES) { + if (x->all_names[i] != NULL && !grib_inline_strcmp(x->all_names[i], act->name)) { + if (x->all_name_spaces[i] == NULL) { + x->all_name_spaces[i] = act->name_space; return GRIB_SUCCESS; - } else if (!grib_inline_strcmp(x->all_name_spaces[i],act->name_space) ) { + } + else if (!grib_inline_strcmp(x->all_name_spaces[i], act->name_space)) { return GRIB_SUCCESS; } } i++; } - i=0; - while(i < MAX_ACCESSOR_NAMES) { - if (x->all_names[i]==NULL) { - x->all_names[i]=act->name; - x->all_name_spaces[i] = act->name_space; + i = 0; + while (i < MAX_ACCESSOR_NAMES) { + if (x->all_names[i] == NULL) { + x->all_names[i] = act->name; + x->all_name_spaces[i] = act->name_space; return GRIB_SUCCESS; } i++; } - grib_context_log(p->h->context,GRIB_LOG_FATAL, - "unable to alias %s : increase MAX_ACCESSOR_NAMES",act->name); + grib_context_log(p->h->context, GRIB_LOG_FATAL, + "unable to alias %s : increase MAX_ACCESSOR_NAMES", act->name); return GRIB_INTERNAL_ERROR; } - y = grib_find_accessor_fast(p->h,act->name); + y = grib_find_accessor_fast(p->h, act->name); /* delete old alias if already defined */ - if ( y != NULL ) - { - i=0; - while ( i < MAX_ACCESSOR_NAMES && y->all_names[i] ) - { - if ( same ( y->all_names[i],act->name ) && same ( y->all_name_spaces[i],act->name_space ) ) - { - grib_context_log ( p->h->context,GRIB_LOG_DEBUG,"alias %s.%s already defined for %s. Deleting old alias", - act->name_space,act->name,y->name ); + if (y != NULL) { + i = 0; + while (i < MAX_ACCESSOR_NAMES && y->all_names[i]) { + if (same(y->all_names[i], act->name) && same(y->all_name_spaces[i], act->name_space)) { + grib_context_log(p->h->context, GRIB_LOG_DEBUG, "alias %s.%s already defined for %s. Deleting old alias", + act->name_space, act->name, y->name); /* printf("[%s %s]\n",y->all_names[i], y->all_name_spaces[i]); */ - while ( i < MAX_ACCESSOR_NAMES-1 ) - { - y->all_names[i] = y->all_names[i+1]; - y->all_name_spaces[i] = y->all_name_spaces[i+1]; + while (i < MAX_ACCESSOR_NAMES - 1) { + y->all_names[i] = y->all_names[i + 1]; + y->all_name_spaces[i] = y->all_name_spaces[i + 1]; i++; } - y->all_names[MAX_ACCESSOR_NAMES-1] = NULL; - y->all_name_spaces[MAX_ACCESSOR_NAMES-1] = NULL; + y->all_names[MAX_ACCESSOR_NAMES - 1] = NULL; + y->all_name_spaces[MAX_ACCESSOR_NAMES - 1] = NULL; break; } i++; } - if ( self->target == NULL ) + if (self->target == NULL) return GRIB_SUCCESS; } - if (!self->target) return GRIB_SUCCESS; + if (!self->target) + return GRIB_SUCCESS; - x = grib_find_accessor_fast(p->h,self->target); - if(x == NULL) - { - grib_context_log(p->h->context,GRIB_LOG_DEBUG,"alias %s: cannot find %s (part 2)", - act->name,self->target); - grib_context_log(p->h->context,GRIB_LOG_WARNING,"alias %s: cannot find %s", - act->name,self->target); + x = grib_find_accessor_fast(p->h, self->target); + if (x == NULL) { + grib_context_log(p->h->context, GRIB_LOG_DEBUG, "alias %s: cannot find %s (part 2)", + act->name, self->target); + grib_context_log(p->h->context, GRIB_LOG_WARNING, "alias %s: cannot find %s", + act->name, self->target); return GRIB_SUCCESS; } hand = grib_handle_of_accessor(x); if (hand->use_trie) { - id=grib_hash_keys_get_id(x->context->keys,act->name); + id = grib_hash_keys_get_id(x->context->keys, act->name); if (hand->accessors[id] != x) { /*x->same=hand->accessors[id];*/ - hand->accessors[id]=x; + hand->accessors[id] = x; } } i = 0; - while(i < MAX_ACCESSOR_NAMES) { - if(x->all_names[i] == NULL) - { + while (i < MAX_ACCESSOR_NAMES) { + if (x->all_names[i] == NULL) { /* Only add entries if not already there */ int found = 0; - for(j=0; jall_names[j], act->name); int namespaceSame = same(x->all_name_spaces[j], act->name_space); if (nameSame && namespaceSame) { found = 1; } } - if (!found) { /* Not there. So add them */ - x->all_names[i] = act->name; - x->all_name_spaces[i] = act->name_space; + if (!found) { /* Not there. So add them */ + x->all_names[i] = act->name; + x->all_name_spaces[i] = act->name_space; grib_context_log(p->h->context, GRIB_LOG_DEBUG, "alias %s.%s added (%s)", - act->name_space, act->name, self->target ); + act->name_space, act->name, self->target); } return GRIB_SUCCESS; } i++; } - for(i = 0 ; i < MAX_ACCESSOR_NAMES; i++) - grib_context_log(p->h->context,GRIB_LOG_ERROR,"alias %s= ( %s already bound to %s )", - act->name,self->target,x->all_names[i]); + for (i = 0; i < MAX_ACCESSOR_NAMES; i++) + grib_context_log(p->h->context, GRIB_LOG_ERROR, "alias %s= ( %s already bound to %s )", + act->name, self->target, x->all_names[i]); return GRIB_SUCCESS; } -static void dump( grib_action* act, FILE* f, int lvl) +static void dump(grib_action* act, FILE* f, int lvl) { grib_action_alias* a = (grib_action_alias*)act; - int i =0; - for (i=0;icontext,f," "); - if(a->target) - grib_context_print(act->context,f," alias %s %s \n", act->name, a->target ); + int i = 0; + for (i = 0; i < lvl; i++) + grib_context_print(act->context, f, " "); + if (a->target) + grib_context_print(act->context, f, " alias %s %s \n", act->name, a->target); else - grib_context_print(act->context,f," unalias %s \n", act->name); + grib_context_print(act->context, f, " unalias %s \n", act->name); } -static void xref( grib_action* act, FILE* f,const char* path) +static void xref(grib_action* act, FILE* f, const char* path) { grib_action_alias* a = (grib_action_alias*)act; - if(a->target) { - fprintf(f,"bless({name=>'%s', target=>'%s', path=>'%s'},'xref::alias'),\n", act->name, a->target,path ); - if(act->name_space) - fprintf(f,"bless({name=>'%s.%s', target=>'%s', path=>'%s'},'xref::alias'),\n", act->name_space,act->name, a->target,path ); + if (a->target) { + fprintf(f, "bless({name=>'%s', target=>'%s', path=>'%s'},'xref::alias'),\n", act->name, a->target, path); + if (act->name_space) + fprintf(f, "bless({name=>'%s.%s', target=>'%s', path=>'%s'},'xref::alias'),\n", act->name_space, act->name, a->target, path); } - else - { - fprintf(f,"bless({name=>'%s', path=>'%s'},'xref::unalias'),\n", act->name, path ); - if(act->name_space) - fprintf(f,"bless({name=>'%s.%s', path=>'%s'},'xref::unalias'),\n", act->name_space,act->name, path ); + else { + fprintf(f, "bless({name=>'%s', path=>'%s'},'xref::unalias'),\n", act->name, path); + if (act->name_space) + fprintf(f, "bless({name=>'%s.%s', path=>'%s'},'xref::unalias'),\n", act->name_space, act->name, path); } } -static void destroy(grib_context* context,grib_action* act) +static void destroy(grib_context* context, grib_action* act) { grib_action_alias* a = (grib_action_alias*)act; - if(a->target) + if (a->target) grib_context_free_persistent(context, a->target); grib_context_free_persistent(context, act->name); diff --git a/src/action_class_assert.c b/src/action_class_assert.c index 4a7b2aa4e..37df3ae85 100644 --- a/src/action_class_assert.c +++ b/src/action_class_assert.c @@ -36,38 +36,39 @@ or edit "action.class" and rerun ./make_class.pl */ -static void init_class (grib_action_class*); -static void dump (grib_action* d, FILE*,int); -static void destroy (grib_context*,grib_action*); -static int create_accessor(grib_section*,grib_action*,grib_loader*); -static int notify_change(grib_action* a, grib_accessor* observer,grib_accessor* observed); -static int execute(grib_action* a,grib_handle* h); - - -typedef struct grib_action_assert { - grib_action act; -/* Members defined in assert */ - grib_expression *expression; +static void init_class(grib_action_class*); +static void dump(grib_action* d, FILE*, int); +static void destroy(grib_context*, grib_action*); +static int create_accessor(grib_section*, grib_action*, grib_loader*); +static int notify_change(grib_action* a, grib_accessor* observer, grib_accessor* observed); +static int execute(grib_action* a, grib_handle* h); + + +typedef struct grib_action_assert +{ + grib_action act; + /* Members defined in assert */ + grib_expression* expression; } grib_action_assert; static grib_action_class _grib_action_class_assert = { - 0, /* super */ - "action_class_assert", /* name */ - sizeof(grib_action_assert), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - &destroy, /* destroy */ - - &dump, /* dump */ - 0, /* xref */ - - &create_accessor, /* create_accessor*/ - - ¬ify_change, /* notify_change */ - 0, /* reparse */ - &execute, /* execute */ + 0, /* super */ + "action_class_assert", /* name */ + sizeof(grib_action_assert), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + &destroy, /* destroy */ + + &dump, /* dump */ + 0, /* xref */ + + &create_accessor, /* create_accessor*/ + + ¬ify_change, /* notify_change */ + 0, /* reparse */ + &execute, /* execute */ }; grib_action_class* grib_action_class_assert = &_grib_action_class_assert; @@ -77,80 +78,81 @@ static void init_class(grib_action_class* c) } /* END_CLASS_IMP */ -grib_action* grib_action_create_assert( grib_context* context, grib_expression* expression) +grib_action* grib_action_create_assert(grib_context* context, grib_expression* expression) { - grib_action_assert* a = NULL; - grib_action_class* c = grib_action_class_assert; - grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context,c->size); - act->next = NULL; - act->name = grib_context_strdup_persistent(context, "assertion"); - act->op = grib_context_strdup_persistent(context, "evaluate"); - act->cclass = c; - act->context = context; - a = (grib_action_assert*)act; - a->expression = expression; + grib_action_assert* a = NULL; + grib_action_class* c = grib_action_class_assert; + grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context, c->size); + act->next = NULL; + act->name = grib_context_strdup_persistent(context, "assertion"); + act->op = grib_context_strdup_persistent(context, "evaluate"); + act->cclass = c; + act->context = context; + a = (grib_action_assert*)act; + a->expression = expression; return act; } -static int create_accessor(grib_section* p, grib_action* act,grib_loader *h) +static int create_accessor(grib_section* p, grib_action* act, grib_loader* h) { grib_action_assert* self = (grib_action_assert*)act; - grib_accessor* as = grib_accessor_factory(p, act,0,NULL); - if(!as)return GRIB_INTERNAL_ERROR; - grib_dependency_observe_expression(as,self->expression); + grib_accessor* as = grib_accessor_factory(p, act, 0, NULL); + if (!as) + return GRIB_INTERNAL_ERROR; + grib_dependency_observe_expression(as, self->expression); - grib_push_accessor(as,p->block); + grib_push_accessor(as, p->block); return GRIB_SUCCESS; } -static void dump( grib_action* act, FILE* f, int lvl) +static void dump(grib_action* act, FILE* f, int lvl) { - int i =0; - grib_action_assert* self=(grib_action_assert*)act; - for (i=0;icontext,f," "); - grib_expression_print(act->context,self->expression,0); + int i = 0; + grib_action_assert* self = (grib_action_assert*)act; + for (i = 0; i < lvl; i++) + grib_context_print(act->context, f, " "); + grib_expression_print(act->context, self->expression, 0); printf("\n"); } -static void destroy(grib_context* context,grib_action* act) +static void destroy(grib_context* context, grib_action* act) { - grib_action_assert* a = ( grib_action_assert*)act; - grib_expression_free(context,a->expression); + grib_action_assert* a = (grib_action_assert*)act; + grib_expression_free(context, a->expression); grib_context_free_persistent(context, act->name); grib_context_free_persistent(context, act->op); } -static int execute(grib_action* a,grib_handle* h) +static int execute(grib_action* a, grib_handle* h) { - int ret=0; - double res=0; - grib_action_assert* self= (grib_action_assert*)a; + int ret = 0; + double res = 0; + grib_action_assert* self = (grib_action_assert*)a; - if ((ret=grib_expression_evaluate_double(h,self->expression,&res)) != GRIB_SUCCESS) + if ((ret = grib_expression_evaluate_double(h, self->expression, &res)) != GRIB_SUCCESS) return ret; if (res != 0) { return GRIB_SUCCESS; } else { - grib_context_log(h->context,GRIB_LOG_ERROR,"Assertion failure: "); - grib_expression_print(h->context,self->expression,h); + grib_context_log(h->context, GRIB_LOG_ERROR, "Assertion failure: "); + grib_expression_print(h->context, self->expression, h); printf("\n"); return GRIB_ASSERTION_FAILURE; } } -static int notify_change(grib_action* a, grib_accessor* observer,grib_accessor* observed) +static int notify_change(grib_action* a, grib_accessor* observer, grib_accessor* observed) { - grib_action_assert* self = (grib_action_assert*) a; + grib_action_assert* self = (grib_action_assert*)a; int ret = GRIB_SUCCESS; long lres; - if ((ret = grib_expression_evaluate_long(grib_handle_of_accessor(observed), self->expression,&lres)) - != GRIB_SUCCESS) return ret; + if ((ret = grib_expression_evaluate_long(grib_handle_of_accessor(observed), self->expression, &lres)) != GRIB_SUCCESS) + return ret; if (lres != 0) return GRIB_SUCCESS; diff --git a/src/action_class_close.c b/src/action_class_close.c index 82e13a23e..fcf7ae317 100644 --- a/src/action_class_close.c +++ b/src/action_class_close.c @@ -31,36 +31,37 @@ or edit "action.class" and rerun ./make_class.pl */ -static void init_class (grib_action_class*); -static void dump (grib_action* d, FILE*,int); -static void destroy (grib_context*,grib_action*); -static int execute(grib_action* a,grib_handle* h); +static void init_class(grib_action_class*); +static void dump(grib_action* d, FILE*, int); +static void destroy(grib_context*, grib_action*); +static int execute(grib_action* a, grib_handle* h); -typedef struct grib_action_close { - grib_action act; -/* Members defined in close */ - char *filename; +typedef struct grib_action_close +{ + grib_action act; + /* Members defined in close */ + char* filename; } grib_action_close; static grib_action_class _grib_action_class_close = { - 0, /* super */ - "action_class_close", /* name */ - sizeof(grib_action_close), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - &destroy, /* destroy */ - - &dump, /* dump */ - 0, /* xref */ - - 0, /* create_accessor*/ - - 0, /* notify_change */ - 0, /* reparse */ - &execute, /* execute */ + 0, /* super */ + "action_class_close", /* name */ + sizeof(grib_action_close), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + &destroy, /* destroy */ + + &dump, /* dump */ + 0, /* xref */ + + 0, /* create_accessor*/ + + 0, /* notify_change */ + 0, /* reparse */ + &execute, /* execute */ }; grib_action_class* grib_action_class_close = &_grib_action_class_close; @@ -70,43 +71,46 @@ static void init_class(grib_action_class* c) } /* END_CLASS_IMP */ -grib_action* grib_action_create_close( grib_context* context, char* filename) +grib_action* grib_action_create_close(grib_context* context, char* filename) { char buf[1024]; - grib_action_close* a ; - grib_action_class* c = grib_action_class_close; - grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context,c->size); - act->op = grib_context_strdup_persistent(context,"section"); + grib_action_close* a; + grib_action_class* c = grib_action_class_close; + grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context, c->size); + act->op = grib_context_strdup_persistent(context, "section"); - act->cclass = c; - a = (grib_action_close*)act; - act->context = context; + act->cclass = c; + a = (grib_action_close*)act; + act->context = context; - a->filename = grib_context_strdup_persistent(context,filename); + a->filename = grib_context_strdup_persistent(context, filename); - sprintf(buf,"close_%p",(void*)a->filename); + sprintf(buf, "close_%p", (void*)a->filename); - act->name = grib_context_strdup_persistent(context,buf); + act->name = grib_context_strdup_persistent(context, buf); return act; } -static int execute(grib_action* act, grib_handle *h) +static int execute(grib_action* act, grib_handle* h) { - char filename[2048]={0,}; - size_t len=2048; - grib_action_close* self = (grib_action_close*) act; - int err =0; - grib_file* file=0; + char filename[2048] = {0,}; + size_t len = 2048; + grib_action_close* self = (grib_action_close*)act; + int err = 0; + grib_file* file = 0; - err=grib_get_string(h,self->filename,filename,&len); + err = grib_get_string(h, self->filename, filename, &len); /* fprintf(stderr,"++++ name %s\n",filename); */ - if (err) return err; + if (err) + return err; /* grib_file_close(filename,1,&err); */ - file=grib_get_file(filename,&err); - if (err) return err; - if (file) grib_file_pool_delete_file(file); + file = grib_get_file(filename, &err); + if (err) + return err; + if (file) + grib_file_pool_delete_file(file); return err; } @@ -115,9 +119,9 @@ static void dump(grib_action* act, FILE* f, int lvl) { } -static void destroy(grib_context* context,grib_action* act) +static void destroy(grib_context* context, grib_action* act) { - grib_action_close* a = (grib_action_close*) act; + grib_action_close* a = (grib_action_close*)act; grib_context_free_persistent(context, a->filename); grib_context_free_persistent(context, act->name); diff --git a/src/action_class_concept.c b/src/action_class_concept.c index 71e3ab2fc..c35b87514 100644 --- a/src/action_class_concept.c +++ b/src/action_class_concept.c @@ -41,66 +41,68 @@ or edit "action.class" and rerun ./make_class.pl */ -static void init_class (grib_action_class*); -static void dump (grib_action* d, FILE*,int); -static void destroy (grib_context*,grib_action*); - - -typedef struct grib_action_concept { - grib_action act; -/* Members defined in gen */ - long len; - grib_arguments* params; -/* Members defined in concept */ - grib_concept_value* concept; - char* basename; - char* masterDir; - char* localDir; - int nofail; +static void init_class(grib_action_class*); +static void dump(grib_action* d, FILE*, int); +static void destroy(grib_context*, grib_action*); + + +typedef struct grib_action_concept +{ + grib_action act; + /* Members defined in gen */ + long len; + grib_arguments* params; + /* Members defined in concept */ + grib_concept_value* concept; + char* basename; + char* masterDir; + char* localDir; + int nofail; } grib_action_concept; extern grib_action_class* grib_action_class_gen; static grib_action_class _grib_action_class_concept = { - &grib_action_class_gen, /* super */ - "action_class_concept", /* name */ - sizeof(grib_action_concept), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - &destroy, /* destroy */ - - &dump, /* dump */ - 0, /* xref */ - - 0, /* create_accessor*/ - - 0, /* notify_change */ - 0, /* reparse */ - 0, /* execute */ + &grib_action_class_gen, /* super */ + "action_class_concept", /* name */ + sizeof(grib_action_concept), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + &destroy, /* destroy */ + + &dump, /* dump */ + 0, /* xref */ + + 0, /* create_accessor*/ + + 0, /* notify_change */ + 0, /* reparse */ + 0, /* execute */ }; grib_action_class* grib_action_class_concept = &_grib_action_class_concept; static void init_class(grib_action_class* c) { - c->xref = (*(c->super))->xref; - c->create_accessor = (*(c->super))->create_accessor; - c->notify_change = (*(c->super))->notify_change; - c->reparse = (*(c->super))->reparse; - c->execute = (*(c->super))->execute; + c->xref = (*(c->super))->xref; + c->create_accessor = (*(c->super))->create_accessor; + c->notify_change = (*(c->super))->notify_change; + c->reparse = (*(c->super))->reparse; + c->execute = (*(c->super))->execute; } /* END_CLASS_IMP */ #if GRIB_PTHREADS -static pthread_once_t once = PTHREAD_ONCE_INIT; +static pthread_once_t once = PTHREAD_ONCE_INIT; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; -static void init() { +static void init() +{ pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); - pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init(&mutex,&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&mutex, &attr); pthread_mutexattr_destroy(&attr); } #elif GRIB_OMP_THREADS @@ -111,8 +113,7 @@ static void init() { GRIB_OMP_CRITICAL(lock_action_class_concept_c) { - if (once == 0) - { + if (once == 0) { omp_init_nest_lock(&mutex); once = 1; } @@ -120,66 +121,69 @@ static void init() } #endif -static grib_concept_value* get_concept(grib_handle* h,grib_action_concept* self); +static grib_concept_value* get_concept(grib_handle* h, grib_action_concept* self); grib_concept_value* action_concept_get_concept(grib_accessor* a) { - return get_concept(grib_handle_of_accessor(a),(grib_action_concept*)a->creator); + return get_concept(grib_handle_of_accessor(a), (grib_action_concept*)a->creator); } int action_concept_get_nofail(grib_accessor* a) { - grib_action_concept* self = (grib_action_concept*)a->creator ; + grib_action_concept* self = (grib_action_concept*)a->creator; return self->nofail; } -grib_action* grib_action_create_concept( grib_context* context, - const char* name, - grib_concept_value* concept, - const char* basename,const char* name_space,const char* defaultkey, - const char* masterDir,const char* localDir,const char* ecmfDir,int flags,int nofail ) +grib_action* grib_action_create_concept(grib_context* context, + const char* name, + grib_concept_value* concept, + const char* basename, const char* name_space, const char* defaultkey, + const char* masterDir, const char* localDir, const char* ecmfDir, int flags, int nofail) { - grib_action_concept* a=NULL ; - grib_action_class* c = grib_action_class_concept; - grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context,c->size); - act->op = grib_context_strdup_persistent(context,"concept"); + grib_action_concept* a = NULL; + grib_action_class* c = grib_action_class_concept; + grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context, c->size); + act->op = grib_context_strdup_persistent(context, "concept"); - act->cclass = c; - a=(grib_action_concept*)act ; - act->context = context; - act->flags = flags; + act->cclass = c; + a = (grib_action_concept*)act; + act->context = context; + act->flags = flags; if (name_space) - act->name_space = grib_context_strdup_persistent(context,name_space); + act->name_space = grib_context_strdup_persistent(context, name_space); if (basename) - a->basename= grib_context_strdup_persistent(context,basename); - else a->basename=NULL; + a->basename = grib_context_strdup_persistent(context, basename); + else + a->basename = NULL; if (masterDir) - a->masterDir= grib_context_strdup_persistent(context,masterDir); - else a->masterDir=NULL; + a->masterDir = grib_context_strdup_persistent(context, masterDir); + else + a->masterDir = NULL; if (localDir) - a->localDir= grib_context_strdup_persistent(context,localDir); - else a->localDir=NULL; + a->localDir = grib_context_strdup_persistent(context, localDir); + else + a->localDir = NULL; if (defaultkey) - act->defaultkey = grib_context_strdup_persistent(context,defaultkey); + act->defaultkey = grib_context_strdup_persistent(context, defaultkey); - a->concept = concept; + a->concept = concept; if (concept) { - grib_concept_value* conc_val=concept; - grib_trie* index=grib_trie_new(context); + grib_concept_value* conc_val = concept; + grib_trie* index = grib_trie_new(context); while (conc_val) { - conc_val->index=index; - grib_trie_insert_no_replace(index,conc_val->name,conc_val); - conc_val=conc_val->next; + conc_val->index = index; + grib_trie_insert_no_replace(index, conc_val->name, conc_val); + conc_val = conc_val->next; } } - act->name = grib_context_strdup_persistent(context,name); + act->name = grib_context_strdup_persistent(context, name); - a->nofail=nofail; + a->nofail = nofail; return act; } @@ -188,27 +192,27 @@ static void dump(grib_action* act, FILE* f, int lvl) { int i = 0; - for (i=0;icontext,f," "); + for (i = 0; i < lvl; i++) + grib_context_print(act->context, f, " "); - printf("concept(%s) { ",act->name); + printf("concept(%s) { ", act->name); printf("\n"); - for (i=0;icontext,f," "); + for (i = 0; i < lvl; i++) + grib_context_print(act->context, f, " "); printf("}\n"); } -static void destroy(grib_context* context,grib_action* act) +static void destroy(grib_context* context, grib_action* act) { - grib_action_concept* self = (grib_action_concept*) act; + grib_action_concept* self = (grib_action_concept*)act; - grib_concept_value * v = self->concept; - if (v) grib_trie_delete(v->index); - while(v) - { + grib_concept_value* v = self->concept; + if (v) + grib_trie_delete(v->index); + while (v) { grib_concept_value* n = v->next; - grib_concept_value_delete(context,v); + grib_concept_value_delete(context, v); v = n; } grib_context_free_persistent(context, self->masterDir); @@ -216,78 +220,82 @@ static void destroy(grib_context* context,grib_action* act) grib_context_free_persistent(context, self->basename); } -static grib_concept_value* get_concept_impl(grib_handle* h,grib_action_concept* self) +static grib_concept_value* get_concept_impl(grib_handle* h, grib_action_concept* self) { - char buf[4096]={0,}; - char master[1024]={0,}; - char local[1024]={0,}; - char masterDir[1024]={0,}; - size_t lenMasterDir=1024; - char key[4096]={0,}; - char* full=0; + char buf[4096] = {0,}; + char master[1024] = {0,}; + char local[1024] = {0,}; + char masterDir[1024] = {0,}; + size_t lenMasterDir = 1024; + char key[4096] = {0,}; + char* full = 0; int id; - grib_context* context=((grib_action*)self)->context; - grib_concept_value* c=NULL; + grib_context* context = ((grib_action*)self)->context; + grib_concept_value* c = NULL; if (self->concept != NULL) return self->concept; Assert(self->masterDir); - grib_get_string(h,self->masterDir,masterDir,&lenMasterDir); + grib_get_string(h, self->masterDir, masterDir, &lenMasterDir); - sprintf(buf,"%s/%s",masterDir,self->basename); + sprintf(buf, "%s/%s", masterDir, self->basename); - grib_recompose_name(h,NULL, buf, master,1); + grib_recompose_name(h, NULL, buf, master, 1); if (self->localDir) { - char localDir[1024]={0,}; - size_t lenLocalDir=1024; - grib_get_string(h,self->localDir,localDir,&lenLocalDir); - sprintf(buf,"%s/%s",localDir,self->basename); - grib_recompose_name(h,NULL, buf, local,1); + char localDir[1024] = {0,}; + size_t lenLocalDir = 1024; + grib_get_string(h, self->localDir, localDir, &lenLocalDir); + sprintf(buf, "%s/%s", localDir, self->basename); + grib_recompose_name(h, NULL, buf, local, 1); } - sprintf(key,"%s%s",master,local); + sprintf(key, "%s%s", master, local); - id=grib_itrie_get_id(h->context->concepts_index,key); - if ((c=h->context->concepts[id])!=NULL) return c; + id = grib_itrie_get_id(h->context->concepts_index, key); + if ((c = h->context->concepts[id]) != NULL) + return c; - if (*local && (full=grib_context_full_defs_path(context,local))!=NULL) { - c=grib_parse_concept_file(context,full); - grib_context_log(h->context,GRIB_LOG_DEBUG, - "Loading concept %s from %s",((grib_action*)self)->name,full); + if (*local && (full = grib_context_full_defs_path(context, local)) != NULL) { + c = grib_parse_concept_file(context, full); + grib_context_log(h->context, GRIB_LOG_DEBUG, + "Loading concept %s from %s", ((grib_action*)self)->name, full); } - full=grib_context_full_defs_path(context,master); + full = grib_context_full_defs_path(context, master); - if(c) { - grib_concept_value* last=c; - while (last->next) last=last->next; + if (c) { + grib_concept_value* last = c; + while (last->next) + last = last->next; if (full) { - last->next=grib_parse_concept_file(context,full); + last->next = grib_parse_concept_file(context, full); } - } else if (full) { - c=grib_parse_concept_file(context,full); - } else { - grib_context_log(context,GRIB_LOG_FATAL, - "unable to find definition file %s in %s:%s\nDefinition files path=\"%s\"", - self->basename,master,local,context->grib_definition_files_path); + } + else if (full) { + c = grib_parse_concept_file(context, full); + } + else { + grib_context_log(context, GRIB_LOG_FATAL, + "unable to find definition file %s in %s:%s\nDefinition files path=\"%s\"", + self->basename, master, local, context->grib_definition_files_path); return NULL; } if (full) { - grib_context_log(h->context,GRIB_LOG_DEBUG, - "Loading concept %s from %s",((grib_action*)self)->name,full); + grib_context_log(h->context, GRIB_LOG_DEBUG, + "Loading concept %s from %s", ((grib_action*)self)->name, full); } - h->context->concepts[id]=c; + h->context->concepts[id] = c; if (c) { - grib_trie* index=grib_trie_new(context); + grib_trie* index = grib_trie_new(context); while (c) { - c->index=index; - grib_trie_insert_no_replace(index,c->name,c); - c=c->next; + c->index = index; + grib_trie_insert_no_replace(index, c->name, c); + c = c->next; } } @@ -297,7 +305,7 @@ static grib_concept_value* get_concept_impl(grib_handle* h,grib_action_concept* static grib_concept_value* get_concept(grib_handle* h, grib_action_concept* self) { grib_concept_value* result = NULL; - GRIB_MUTEX_INIT_ONCE(&once,&init) + GRIB_MUTEX_INIT_ONCE(&once, &init) GRIB_MUTEX_LOCK(&mutex); result = get_concept_impl(h, self); @@ -309,47 +317,49 @@ static grib_concept_value* get_concept(grib_handle* h, grib_action_concept* self static int concept_condition_expression_true(grib_handle* h, grib_concept_condition* c, char* exprVal) { long lval; - long lres=0; - int ok = 0; - int err=0; - const int type = grib_expression_native_type(h,c->expression); - - switch(type) - { - case GRIB_TYPE_LONG: - grib_expression_evaluate_long(h,c->expression,&lres); - ok = (grib_get_long(h,c->name,&lval) == GRIB_SUCCESS) && - (lval == lres); - if (ok) sprintf(exprVal, "%ld", lres); - break; - - case GRIB_TYPE_DOUBLE: { - double dval; - double dres=0.0; - grib_expression_evaluate_double(h,c->expression,&dres); - ok = (grib_get_double(h,c->name,&dval) == GRIB_SUCCESS) && - (dval == dres); - if (ok) sprintf(exprVal, "%g", dres); - break; - } + long lres = 0; + int ok = 0; + int err = 0; + const int type = grib_expression_native_type(h, c->expression); + + switch (type) { + case GRIB_TYPE_LONG: + grib_expression_evaluate_long(h, c->expression, &lres); + ok = (grib_get_long(h, c->name, &lval) == GRIB_SUCCESS) && + (lval == lres); + if (ok) + sprintf(exprVal, "%ld", lres); + break; + + case GRIB_TYPE_DOUBLE: { + double dval; + double dres = 0.0; + grib_expression_evaluate_double(h, c->expression, &dres); + ok = (grib_get_double(h, c->name, &dval) == GRIB_SUCCESS) && + (dval == dres); + if (ok) + sprintf(exprVal, "%g", dres); + break; + } - case GRIB_TYPE_STRING: { - const char *cval; - char buf[80]; - char tmp[80]; - size_t len = sizeof(buf); - size_t size=sizeof(tmp); - - ok = (grib_get_string(h,c->name,buf,&len) == GRIB_SUCCESS) && - ((cval = grib_expression_evaluate_string(h,c->expression,tmp,&size,&err)) != NULL) && - (err==0) && (strcmp(buf,cval) == 0); - if (ok) sprintf(exprVal, "%s", cval); - break; - } + case GRIB_TYPE_STRING: { + const char* cval; + char buf[80]; + char tmp[80]; + size_t len = sizeof(buf); + size_t size = sizeof(tmp); + + ok = (grib_get_string(h, c->name, buf, &len) == GRIB_SUCCESS) && + ((cval = grib_expression_evaluate_string(h, c->expression, tmp, &size, &err)) != NULL) && + (err == 0) && (strcmp(buf, cval) == 0); + if (ok) + sprintf(exprVal, "%s", cval); + break; + } - default: - /* TODO: */ - break; + default: + /* TODO: */ + break; } return ok; } @@ -362,19 +372,21 @@ static int concept_condition_expression_true(grib_handle* h, grib_concept_condit */ int get_concept_condition_string(grib_handle* h, const char* key, const char* value, char* result) { - int err = 0; - int length = 0; - char strVal[64]={0,}; - char exprVal[256]={0,}; - const char* pValue = value; - size_t len = sizeof(strVal); + int err = 0; + int length = 0; + char strVal[64] = {0,}; + char exprVal[256] = {0,}; + const char* pValue = value; + size_t len = sizeof(strVal); grib_concept_value* concept_value = NULL; - grib_accessor* acc = grib_find_accessor(h, key); - if (!acc) return GRIB_NOT_FOUND; + grib_accessor* acc = grib_find_accessor(h, key); + if (!acc) + return GRIB_NOT_FOUND; if (!value) { - err = grib_get_string(h, key, strVal,&len); - if (err) return GRIB_INTERNAL_ERROR; + err = grib_get_string(h, key, strVal, &len); + if (err) + return GRIB_INTERNAL_ERROR; pValue = strVal; } @@ -382,13 +394,13 @@ int get_concept_condition_string(grib_handle* h, const char* key, const char* va while (concept_value) { grib_concept_condition* concept_condition = concept_value->conditions; - if (strcmp(pValue, concept_value->name)==0) { + if (strcmp(pValue, concept_value->name) == 0) { while (concept_condition) { grib_expression* expression = concept_condition->expression; Assert(expression); if (concept_condition_expression_true(h, concept_condition, exprVal)) { - length += sprintf(result+length, "%s%s=%s", - (length==0?"":","),concept_condition->name, exprVal); + length += sprintf(result + length, "%s%s=%s", + (length == 0 ? "" : ","), concept_condition->name, exprVal); } concept_condition = concept_condition->next; } @@ -396,6 +408,7 @@ int get_concept_condition_string(grib_handle* h, const char* key, const char* va concept_value = concept_value->next; } - if (length == 0) return GRIB_CONCEPT_NO_MATCH; + if (length == 0) + return GRIB_CONCEPT_NO_MATCH; return GRIB_SUCCESS; } diff --git a/src/action_class_gen.c b/src/action_class_gen.c index f4f0e97f6..465456780 100644 --- a/src/action_class_gen.c +++ b/src/action_class_gen.c @@ -39,39 +39,40 @@ or edit "action.class" and rerun ./make_class.pl */ -static void init_class (grib_action_class*); -static void dump (grib_action* d, FILE*,int); -static void xref (grib_action* d, FILE* f,const char* path); -static void destroy (grib_context*,grib_action*); -static int create_accessor(grib_section*,grib_action*,grib_loader*); -static int notify_change(grib_action* a, grib_accessor* observer,grib_accessor* observed); - - -typedef struct grib_action_gen { - grib_action act; -/* Members defined in gen */ - long len; - grib_arguments* params; +static void init_class(grib_action_class*); +static void dump(grib_action* d, FILE*, int); +static void xref(grib_action* d, FILE* f, const char* path); +static void destroy(grib_context*, grib_action*); +static int create_accessor(grib_section*, grib_action*, grib_loader*); +static int notify_change(grib_action* a, grib_accessor* observer, grib_accessor* observed); + + +typedef struct grib_action_gen +{ + grib_action act; + /* Members defined in gen */ + long len; + grib_arguments* params; } grib_action_gen; static grib_action_class _grib_action_class_gen = { - 0, /* super */ - "action_class_gen", /* name */ - sizeof(grib_action_gen), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - &destroy, /* destroy */ - - &dump, /* dump */ - &xref, /* xref */ - - &create_accessor, /* create_accessor*/ - - ¬ify_change, /* notify_change */ - 0, /* reparse */ - 0, /* execute */ + 0, /* super */ + "action_class_gen", /* name */ + sizeof(grib_action_gen), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + &destroy, /* destroy */ + + &dump, /* dump */ + &xref, /* xref */ + + &create_accessor, /* create_accessor*/ + + ¬ify_change, /* notify_change */ + 0, /* reparse */ + 0, /* execute */ }; grib_action_class* grib_action_class_gen = &_grib_action_class_gen; @@ -83,53 +84,57 @@ static void init_class(grib_action_class* c) grib_action* grib_action_create_gen(grib_context* context, const char* name, const char* op, const long len, - grib_arguments* params, grib_arguments* default_value,int flags,const char* name_space,const char* set) + grib_arguments* params, grib_arguments* default_value, int flags, const char* name_space, const char* set) { - grib_action_gen* a = NULL; - grib_action_class* c = grib_action_class_gen; - grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context,c->size); - act->next = NULL; - act->name = grib_context_strdup_persistent(context, name); - act->op = grib_context_strdup_persistent(context, op); - if(name_space) - act->name_space = grib_context_strdup_persistent(context, name_space); - act->cclass = c; - act->context = context; - act->flags = flags; - a = (grib_action_gen*)act; - - a->len = len; - - a->params = params; + grib_action_gen* a = NULL; + grib_action_class* c = grib_action_class_gen; + grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context, c->size); + act->next = NULL; + act->name = grib_context_strdup_persistent(context, name); + act->op = grib_context_strdup_persistent(context, op); + if (name_space) + act->name_space = grib_context_strdup_persistent(context, name_space); + act->cclass = c; + act->context = context; + act->flags = flags; + a = (grib_action_gen*)act; + + a->len = len; + + a->params = params; if (set) - act->set = grib_context_strdup_persistent(context, set); - act->default_value = default_value; + act->set = grib_context_strdup_persistent(context, set); + act->default_value = default_value; return act; } -static void dump( grib_action* act, FILE* f, int lvl) +static void dump(grib_action* act, FILE* f, int lvl) { - grib_action_gen* a = ( grib_action_gen*)act; - int i =0; - for (i=0;icontext,f," "); - grib_context_print(act->context,f,"%s[%d] %s \n", act->op, a->len , act->name); + grib_action_gen* a = (grib_action_gen*)act; + int i = 0; + for (i = 0; i < lvl; i++) + grib_context_print(act->context, f, " "); + grib_context_print(act->context, f, "%s[%d] %s \n", act->op, a->len, act->name); } -#define F(x) if(flg&x) { fprintf(f,"%s=>1,",#x); flg &= !x; } -static int count=0; -static void xref( grib_action* act, FILE* f,const char *path) +#define F(x) \ + if (flg & x) { \ + fprintf(f, "%s=>1,", #x); \ + flg &= !x; \ + } +static int count = 0; +static void xref(grib_action* act, FILE* f, const char* path) { - grib_action_gen* a = ( grib_action_gen*)act; - unsigned long flg = act->flags; - int position= a->len > 0 ? count++ : -1; + grib_action_gen* a = (grib_action_gen*)act; + unsigned long flg = act->flags; + int position = a->len > 0 ? count++ : -1; - fprintf(f,"bless({path=>'%s',size => %ld, name=> '%s', position=> %d, ",path, (long)a->len , act->name,position); + fprintf(f, "bless({path=>'%s',size => %ld, name=> '%s', position=> %d, ", path, (long)a->len, act->name, position); - fprintf(f," params=> ["); - grib_arguments_print(act->context,a->params,NULL); - fprintf(f,"], flags=> {"); + fprintf(f, " params=> ["); + grib_arguments_print(act->context, a->params, NULL); + fprintf(f, "], flags=> {"); F(GRIB_ACCESSOR_FLAG_READ_ONLY); F(GRIB_ACCESSOR_FLAG_DUMP); @@ -148,46 +153,49 @@ static void xref( grib_action* act, FILE* f,const char *path) F(GRIB_ACCESSOR_FLAG_DOUBLE_TYPE); /* make sure all flags are processed */ - if(flg) { printf("FLG = %ld\n",(long)flg); } + if (flg) { + printf("FLG = %ld\n", (long)flg); + } Assert(flg == 0); - fprintf(f,"}, defaults=> ["); - grib_arguments_print(act->context,act->default_value,NULL); + fprintf(f, "}, defaults=> ["); + grib_arguments_print(act->context, act->default_value, NULL); - fprintf(f,"]}, 'xref::%s'),\n",act->op); + fprintf(f, "]}, 'xref::%s'),\n", act->op); } -static int create_accessor( grib_section* p, grib_action* act, grib_loader *loader) +static int create_accessor(grib_section* p, grib_action* act, grib_loader* loader) { - grib_action_gen* a = ( grib_action_gen*)act; - grib_accessor* ga = NULL; + grib_action_gen* a = (grib_action_gen*)act; + grib_accessor* ga = NULL; - ga = grib_accessor_factory( p, act,a->len,a->params); - if(!ga) return GRIB_INTERNAL_ERROR; + ga = grib_accessor_factory(p, act, a->len, a->params); + if (!ga) + return GRIB_INTERNAL_ERROR; - grib_push_accessor(ga,p->block); + grib_push_accessor(ga, p->block); - if(ga->flags & GRIB_ACCESSOR_FLAG_CONSTRAINT) - grib_dependency_observe_arguments(ga,act->default_value); + if (ga->flags & GRIB_ACCESSOR_FLAG_CONSTRAINT) + grib_dependency_observe_arguments(ga, act->default_value); - if(loader == NULL) + if (loader == NULL) return GRIB_SUCCESS; else - return loader->init_accessor(loader,ga,act->default_value); + return loader->init_accessor(loader, ga, act->default_value); } -static int notify_change(grib_action* act, grib_accessor * notified, grib_accessor* changed) +static int notify_change(grib_action* act, grib_accessor* notified, grib_accessor* changed) { - if(act->default_value) - return grib_pack_expression(notified,grib_arguments_get_expression(grib_handle_of_accessor(notified),act->default_value,0)); + if (act->default_value) + return grib_pack_expression(notified, grib_arguments_get_expression(grib_handle_of_accessor(notified), act->default_value, 0)); return GRIB_SUCCESS; } -static void destroy(grib_context* context,grib_action* act) +static void destroy(grib_context* context, grib_action* act) { - grib_action_gen* a = ( grib_action_gen*)act; + grib_action_gen* a = (grib_action_gen*)act; - if(a->params != act->default_value) + if (a->params != act->default_value) grib_arguments_free(context, a->params); grib_arguments_free(context, act->default_value); diff --git a/src/action_class_hash_array.c b/src/action_class_hash_array.c index 5b9039b45..69ae83811 100644 --- a/src/action_class_hash_array.c +++ b/src/action_class_hash_array.c @@ -41,67 +41,69 @@ or edit "action.class" and rerun ./make_class.pl */ -static void init_class (grib_action_class*); -static void dump (grib_action* d, FILE*,int); -static void destroy (grib_context*,grib_action*); - - -typedef struct grib_action_hash_array { - grib_action act; -/* Members defined in gen */ - long len; - grib_arguments* params; -/* Members defined in hash_array */ - grib_hash_array_value* hash_array; - char* basename; - char* masterDir; - char* localDir; - char* ecmfDir; - int nofail; +static void init_class(grib_action_class*); +static void dump(grib_action* d, FILE*, int); +static void destroy(grib_context*, grib_action*); + + +typedef struct grib_action_hash_array +{ + grib_action act; + /* Members defined in gen */ + long len; + grib_arguments* params; + /* Members defined in hash_array */ + grib_hash_array_value* hash_array; + char* basename; + char* masterDir; + char* localDir; + char* ecmfDir; + int nofail; } grib_action_hash_array; extern grib_action_class* grib_action_class_gen; static grib_action_class _grib_action_class_hash_array = { - &grib_action_class_gen, /* super */ - "action_class_hash_array", /* name */ - sizeof(grib_action_hash_array), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - &destroy, /* destroy */ - - &dump, /* dump */ - 0, /* xref */ - - 0, /* create_accessor*/ - - 0, /* notify_change */ - 0, /* reparse */ - 0, /* execute */ + &grib_action_class_gen, /* super */ + "action_class_hash_array", /* name */ + sizeof(grib_action_hash_array), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + &destroy, /* destroy */ + + &dump, /* dump */ + 0, /* xref */ + + 0, /* create_accessor*/ + + 0, /* notify_change */ + 0, /* reparse */ + 0, /* execute */ }; grib_action_class* grib_action_class_hash_array = &_grib_action_class_hash_array; static void init_class(grib_action_class* c) { - c->xref = (*(c->super))->xref; - c->create_accessor = (*(c->super))->create_accessor; - c->notify_change = (*(c->super))->notify_change; - c->reparse = (*(c->super))->reparse; - c->execute = (*(c->super))->execute; + c->xref = (*(c->super))->xref; + c->create_accessor = (*(c->super))->create_accessor; + c->notify_change = (*(c->super))->notify_change; + c->reparse = (*(c->super))->reparse; + c->execute = (*(c->super))->execute; } /* END_CLASS_IMP */ #if GRIB_PTHREADS -static pthread_once_t once = PTHREAD_ONCE_INIT; +static pthread_once_t once = PTHREAD_ONCE_INIT; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; -static void init() { +static void init() +{ pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); - pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init(&mutex,&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&mutex, &attr); pthread_mutexattr_destroy(&attr); } #elif GRIB_OMP_THREADS @@ -112,8 +114,7 @@ static void init() { GRIB_OMP_CRITICAL(lock_action_class_hash_array_c) { - if (once == 0) - { + if (once == 0) { omp_init_nest_lock(&mutex); once = 1; } @@ -121,57 +122,61 @@ static void init() } #endif -grib_action* grib_action_create_hash_array( grib_context* context, - const char* name, - grib_hash_array_value* hash_array, - const char* basename,const char* name_space,const char* defaultkey, - const char* masterDir,const char* localDir,const char* ecmfDir,int flags,int nofail ) +grib_action* grib_action_create_hash_array(grib_context* context, + const char* name, + grib_hash_array_value* hash_array, + const char* basename, const char* name_space, const char* defaultkey, + const char* masterDir, const char* localDir, const char* ecmfDir, int flags, int nofail) { - grib_action_hash_array* a=NULL ; - grib_action_class* c = grib_action_class_hash_array; - grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context,c->size); - act->op = grib_context_strdup_persistent(context,"hash_array"); + grib_action_hash_array* a = NULL; + grib_action_class* c = grib_action_class_hash_array; + grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context, c->size); + act->op = grib_context_strdup_persistent(context, "hash_array"); - act->cclass = c; - a=(grib_action_hash_array*)act ; - act->context = context; - act->flags = flags; + act->cclass = c; + a = (grib_action_hash_array*)act; + act->context = context; + act->flags = flags; if (name_space) - act->name_space = grib_context_strdup_persistent(context,name_space); + act->name_space = grib_context_strdup_persistent(context, name_space); if (basename) - a->basename= grib_context_strdup_persistent(context,basename); - else a->basename=NULL; + a->basename = grib_context_strdup_persistent(context, basename); + else + a->basename = NULL; if (masterDir) - a->masterDir= grib_context_strdup_persistent(context,masterDir); - else a->masterDir=NULL; + a->masterDir = grib_context_strdup_persistent(context, masterDir); + else + a->masterDir = NULL; if (localDir) - a->localDir= grib_context_strdup_persistent(context,localDir); - else a->localDir=NULL; + a->localDir = grib_context_strdup_persistent(context, localDir); + else + a->localDir = NULL; if (ecmfDir) - a->ecmfDir= grib_context_strdup_persistent(context,ecmfDir); - else a->ecmfDir=NULL; + a->ecmfDir = grib_context_strdup_persistent(context, ecmfDir); + else + a->ecmfDir = NULL; if (defaultkey) - act->defaultkey = grib_context_strdup_persistent(context,defaultkey); + act->defaultkey = grib_context_strdup_persistent(context, defaultkey); a->hash_array = hash_array; if (hash_array) { - grib_hash_array_value* ha=hash_array; - grib_trie* index=grib_trie_new(context); + grib_hash_array_value* ha = hash_array; + grib_trie* index = grib_trie_new(context); while (ha) { - ha->index=index; - grib_trie_insert_no_replace(index,ha->name,ha); - ha=ha->next; + ha->index = index; + grib_trie_insert_no_replace(index, ha->name, ha); + ha = ha->next; } } - act->name = grib_context_strdup_persistent(context,name); + act->name = grib_context_strdup_persistent(context, name); - a->nofail=nofail; + a->nofail = nofail; return act; } @@ -180,28 +185,28 @@ static void dump(grib_action* act, FILE* f, int lvl) { int i = 0; - for (i=0;icontext,f," "); + for (i = 0; i < lvl; i++) + grib_context_print(act->context, f, " "); - printf("hash_array(%s) { ",act->name); + printf("hash_array(%s) { ", act->name); printf("\n"); - for (i=0;icontext,f," "); + for (i = 0; i < lvl; i++) + grib_context_print(act->context, f, " "); printf("}\n"); } -static void destroy(grib_context* context,grib_action* act) +static void destroy(grib_context* context, grib_action* act) { - grib_action_hash_array* self = (grib_action_hash_array*) act; + grib_action_hash_array* self = (grib_action_hash_array*)act; - grib_hash_array_value * v = self->hash_array; - if (v) grib_trie_delete(v->index); - while(v) - { + grib_hash_array_value* v = self->hash_array; + if (v) + grib_trie_delete(v->index); + while (v) { grib_hash_array_value* n = v->next; - grib_hash_array_value_delete(context,v); + grib_hash_array_value_delete(context, v); v = n; } @@ -211,105 +216,109 @@ static void destroy(grib_context* context,grib_action* act) grib_context_free_persistent(context, self->basename); } -static grib_hash_array_value* get_hash_array_impl(grib_handle* h,grib_action* a) +static grib_hash_array_value* get_hash_array_impl(grib_handle* h, grib_action* a) { - char buf[4096]={0,}; - char master[1024]={0,}; - char local[1024]={0,}; - char ecmf[1024]={0,}; - char masterDir[1024]={0,}; - size_t lenMasterDir=1024; - char localDir[1024]={0,}; - size_t lenLocalDir=1024; - char ecmfDir[1024]={0,}; - size_t lenEcmfDir=1024; - char key[4096]={0,}; - char* full=0; + char buf[4096] = {0,}; + char master[1024] = {0,}; + char local[1024] = {0,}; + char ecmf[1024] = {0,}; + char masterDir[1024] = {0,}; + size_t lenMasterDir = 1024; + char localDir[1024] = {0,}; + size_t lenLocalDir = 1024; + char ecmfDir[1024] = {0,}; + size_t lenEcmfDir = 1024; + char key[4096] = {0,}; + char* full = 0; int id; int err; - grib_action_hash_array* self=(grib_action_hash_array*)a; + grib_action_hash_array* self = (grib_action_hash_array*)a; - grib_context* context=((grib_action*)self)->context; - grib_hash_array_value* c=NULL; + grib_context* context = ((grib_action*)self)->context; + grib_hash_array_value* c = NULL; if (self->hash_array != NULL) return self->hash_array; Assert(self->masterDir); - grib_get_string(h,self->masterDir,masterDir,&lenMasterDir); + grib_get_string(h, self->masterDir, masterDir, &lenMasterDir); - sprintf(buf,"%s/%s",masterDir,self->basename); + sprintf(buf, "%s/%s", masterDir, self->basename); - err=grib_recompose_name(h,NULL, buf, master,1); + err = grib_recompose_name(h, NULL, buf, master, 1); if (err) { - grib_context_log(context,GRIB_LOG_ERROR, - "unable to build name of directory %s",self->masterDir); + grib_context_log(context, GRIB_LOG_ERROR, + "unable to build name of directory %s", self->masterDir); return NULL; } if (self->localDir) { - grib_get_string(h,self->localDir,localDir,&lenLocalDir); - sprintf(buf,"%s/%s",localDir,self->basename); - grib_recompose_name(h,NULL, buf, local,1); + grib_get_string(h, self->localDir, localDir, &lenLocalDir); + sprintf(buf, "%s/%s", localDir, self->basename); + grib_recompose_name(h, NULL, buf, local, 1); } if (self->ecmfDir) { - grib_get_string(h,self->ecmfDir,ecmfDir,&lenEcmfDir); - sprintf(buf,"%s/%s",ecmfDir,self->basename); - grib_recompose_name(h,NULL, buf, ecmf,1); + grib_get_string(h, self->ecmfDir, ecmfDir, &lenEcmfDir); + sprintf(buf, "%s/%s", ecmfDir, self->basename); + grib_recompose_name(h, NULL, buf, ecmf, 1); } - sprintf(key,"%s%s%s",master,local,ecmf); + sprintf(key, "%s%s%s", master, local, ecmf); - id=grib_itrie_get_id(h->context->hash_array_index,key); - if ((c=h->context->hash_array[id])!=NULL) return c; + id = grib_itrie_get_id(h->context->hash_array_index, key); + if ((c = h->context->hash_array[id]) != NULL) + return c; - if (*local && (full=grib_context_full_defs_path(context,local))!=NULL) { - c=grib_parse_hash_array_file(context,full); - grib_context_log(h->context,GRIB_LOG_DEBUG, - "Loading hash_array %s from %s",((grib_action*)self)->name,full); - } else if (*ecmf && (full=grib_context_full_defs_path(context,ecmf))!=NULL) { - c=grib_parse_hash_array_file(context,full); - grib_context_log(h->context,GRIB_LOG_DEBUG, - "Loading hash_array %s from %s",((grib_action*)self)->name,full); + if (*local && (full = grib_context_full_defs_path(context, local)) != NULL) { + c = grib_parse_hash_array_file(context, full); + grib_context_log(h->context, GRIB_LOG_DEBUG, + "Loading hash_array %s from %s", ((grib_action*)self)->name, full); } + else if (*ecmf && (full = grib_context_full_defs_path(context, ecmf)) != NULL) { + c = grib_parse_hash_array_file(context, full); + grib_context_log(h->context, GRIB_LOG_DEBUG, + "Loading hash_array %s from %s", ((grib_action*)self)->name, full); + } + + full = grib_context_full_defs_path(context, master); - full=grib_context_full_defs_path(context,master); - - if(c) { - grib_hash_array_value* last=c; - while (last->next) last=last->next; - last->next=grib_parse_hash_array_file(context,full); - } else if (full) { - c=grib_parse_hash_array_file(context,full); - } else { - grib_context_log(context,GRIB_LOG_ERROR, - "unable to find definition file %s in %s:%s:%s\nDefinition files path=\"%s\"", - self->basename,master,ecmf,local,context->grib_definition_files_path); + if (c) { + grib_hash_array_value* last = c; + while (last->next) + last = last->next; + last->next = grib_parse_hash_array_file(context, full); + } + else if (full) { + c = grib_parse_hash_array_file(context, full); + } + else { + grib_context_log(context, GRIB_LOG_ERROR, + "unable to find definition file %s in %s:%s:%s\nDefinition files path=\"%s\"", + self->basename, master, ecmf, local, context->grib_definition_files_path); return NULL; } - grib_context_log(h->context,GRIB_LOG_DEBUG, - "Loading hash_array %s from %s",((grib_action*)self)->name,full); + grib_context_log(h->context, GRIB_LOG_DEBUG, + "Loading hash_array %s from %s", ((grib_action*)self)->name, full); - h->context->hash_array[id]=c; + h->context->hash_array[id] = c; if (c) { - grib_trie* index=grib_trie_new(context); + grib_trie* index = grib_trie_new(context); while (c) { - c->index=index; - grib_trie_insert_no_replace(index,c->name,c); - c=c->next; + c->index = index; + grib_trie_insert_no_replace(index, c->name, c); + c = c->next; } - } return h->context->hash_array[id]; } -grib_hash_array_value* get_hash_array(grib_handle* h,grib_action* a) +grib_hash_array_value* get_hash_array(grib_handle* h, grib_action* a) { grib_hash_array_value* result = NULL; - GRIB_MUTEX_INIT_ONCE(&once,&init); + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex); result = get_hash_array_impl(h, a); diff --git a/src/action_class_if.c b/src/action_class_if.c index baf1c0dd9..9838871c4 100644 --- a/src/action_class_if.c +++ b/src/action_class_if.c @@ -43,68 +43,69 @@ or edit "action.class" and rerun ./make_class.pl */ -static void init_class (grib_action_class*); -static void dump (grib_action* d, FILE*,int); -static void xref (grib_action* d, FILE* f,const char* path); -static void destroy (grib_context*,grib_action*); -static int create_accessor(grib_section*,grib_action*,grib_loader*); -static grib_action* reparse(grib_action* a,grib_accessor* acc,int *doit); -static int execute(grib_action* a,grib_handle* h); - - -typedef struct grib_action_if { - grib_action act; -/* Members defined in section */ -/* Members defined in if */ - grib_expression *expression; - grib_action *block_true; - grib_action *block_false; - int transient; +static void init_class(grib_action_class*); +static void dump(grib_action* d, FILE*, int); +static void xref(grib_action* d, FILE* f, const char* path); +static void destroy(grib_context*, grib_action*); +static int create_accessor(grib_section*, grib_action*, grib_loader*); +static grib_action* reparse(grib_action* a, grib_accessor* acc, int* doit); +static int execute(grib_action* a, grib_handle* h); + + +typedef struct grib_action_if +{ + grib_action act; + /* Members defined in section */ + /* Members defined in if */ + grib_expression* expression; + grib_action* block_true; + grib_action* block_false; + int transient; } grib_action_if; extern grib_action_class* grib_action_class_section; static grib_action_class _grib_action_class_if = { - &grib_action_class_section, /* super */ - "action_class_if", /* name */ - sizeof(grib_action_if), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - &destroy, /* destroy */ - - &dump, /* dump */ - &xref, /* xref */ - - &create_accessor, /* create_accessor*/ - - 0, /* notify_change */ - &reparse, /* reparse */ - &execute, /* execute */ + &grib_action_class_section, /* super */ + "action_class_if", /* name */ + sizeof(grib_action_if), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + &destroy, /* destroy */ + + &dump, /* dump */ + &xref, /* xref */ + + &create_accessor, /* create_accessor*/ + + 0, /* notify_change */ + &reparse, /* reparse */ + &execute, /* execute */ }; grib_action_class* grib_action_class_if = &_grib_action_class_if; static void init_class(grib_action_class* c) { - c->notify_change = (*(c->super))->notify_change; + c->notify_change = (*(c->super))->notify_change; } /* END_CLASS_IMP */ -grib_action* grib_action_create_if( grib_context* context, - grib_expression* expression, - grib_action* block_true,grib_action* block_false,int transient, - int lineno, char* file_being_parsed) +grib_action* grib_action_create_if(grib_context* context, + grib_expression* expression, + grib_action* block_true, grib_action* block_false, int transient, + int lineno, char* file_being_parsed) { char name[1024]; - grib_action_if* a ; + grib_action_if* a; grib_action_class* c = grib_action_class_if; - grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context,c->size); - act->op = grib_context_strdup_persistent(context,"section"); + grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context, c->size); + act->op = grib_context_strdup_persistent(context, "section"); - act->cclass = c; - a = (grib_action_if*)act; - act->context = context; + act->cclass = c; + a = (grib_action_if*)act; + act->context = context; a->expression = expression; a->block_true = block_true; @@ -112,115 +113,120 @@ grib_action* grib_action_create_if( grib_context* context, a->transient = transient; if (transient) - sprintf(name,"__if%p",(void*)a); + sprintf(name, "__if%p", (void*)a); else - sprintf(name,"_if%p",(void*)a); + sprintf(name, "_if%p", (void*)a); - act->name = grib_context_strdup_persistent(context,name); - act->debug_info= NULL; + act->name = grib_context_strdup_persistent(context, name); + act->debug_info = NULL; if (context->debug > 0 && file_being_parsed) { /* Construct debug information showing definition file and line */ /* number of IF statement */ char debug_info[1024]; sprintf(debug_info, "File=%s line=%d", file_being_parsed, lineno); - act->debug_info= grib_context_strdup_persistent(context,debug_info); + act->debug_info = grib_context_strdup_persistent(context, debug_info); } return act; } -static int create_accessor( grib_section* p, grib_action* act, grib_loader *h) +static int create_accessor(grib_section* p, grib_action* act, grib_loader* h) { grib_action_if* a = (grib_action_if*)act; grib_action* next = NULL; - int ret = 0; - long lres=0; + int ret = 0; + long lres = 0; grib_accessor* as = NULL; - grib_section* gs = NULL; + grib_section* gs = NULL; - as = grib_accessor_factory(p, act,0,NULL); - if(!as)return GRIB_INTERNAL_ERROR; + as = grib_accessor_factory(p, act, 0, NULL); + if (!as) + return GRIB_INTERNAL_ERROR; gs = as->sub_section; - grib_push_accessor(as,p->block); + grib_push_accessor(as, p->block); - if ((ret=grib_expression_evaluate_long(p->h,a->expression,&lres)) != GRIB_SUCCESS) + if ((ret = grib_expression_evaluate_long(p->h, a->expression, &lres)) != GRIB_SUCCESS) return ret; - if(lres) + if (lres) next = a->block_true; else next = a->block_false; - if(p->h->context->debug > 1) - { + if (p->h->context->debug > 1) { printf("EVALUATE create_accessor_handle "); - grib_expression_print(p->h->context,a->expression,p->h); - printf(" [%s][_if%p]\n", (next == a->block_true ? "true":"false"), (void*)a); + grib_expression_print(p->h->context, a->expression, p->h); + printf(" [%s][_if%p]\n", (next == a->block_true ? "true" : "false"), (void*)a); /*grib_dump_action_branch(stdout,next,5);*/ } gs->branch = next; - grib_dependency_observe_expression(as,a->expression); - - while(next){ + grib_dependency_observe_expression(as, a->expression); + while (next) { ret = grib_create_accessor(gs, next, h); - if(ret != GRIB_SUCCESS) return ret; - next= next->next; + if (ret != GRIB_SUCCESS) + return ret; + next = next->next; } return GRIB_SUCCESS; } -static void print_expression_debug_info(grib_context *ctx, grib_expression *exp, grib_handle *h) +static void print_expression_debug_info(grib_context* ctx, grib_expression* exp, grib_handle* h) { - grib_expression_print(ctx, exp, h);/* writes to stdout without a newline */ + grib_expression_print(ctx, exp, h); /* writes to stdout without a newline */ printf("\n"); } -static int execute(grib_action* act, grib_handle *h) +static int execute(grib_action* act, grib_handle* h) { grib_action_if* a = (grib_action_if*)act; grib_action* next = NULL; grib_context* ctx = h->context; - int ret = 0; - long lres=0; + int ret = 0; + long lres = 0; /* See GRIB-394 */ int type = grib_expression_native_type(h, a->expression); if (type != GRIB_TYPE_DOUBLE) { - if ((ret=grib_expression_evaluate_long(h,a->expression,&lres)) != GRIB_SUCCESS) { - if (ret == GRIB_NOT_FOUND) lres=0; + if ((ret = grib_expression_evaluate_long(h, a->expression, &lres)) != GRIB_SUCCESS) { + if (ret == GRIB_NOT_FOUND) + lres = 0; else { - if (ctx->debug) print_expression_debug_info(ctx, a->expression, h); + if (ctx->debug) + print_expression_debug_info(ctx, a->expression, h); return ret; } } } else { double dres = 0.0; - ret = grib_expression_evaluate_double(h, a->expression, &dres); - lres = (long)dres; - if ( ret != GRIB_SUCCESS ) { - if (ret == GRIB_NOT_FOUND) lres=0; + ret = grib_expression_evaluate_double(h, a->expression, &dres); + lres = (long)dres; + if (ret != GRIB_SUCCESS) { + if (ret == GRIB_NOT_FOUND) + lres = 0; else { - if (ctx->debug) print_expression_debug_info(ctx, a->expression, h); + if (ctx->debug) + print_expression_debug_info(ctx, a->expression, h); return ret; } } } - if(lres) + if (lres) next = a->block_true; else next = a->block_false; - while(next){ + while (next) { ret = grib_action_execute(next, h); - if(ret != GRIB_SUCCESS) return ret; - next= next->next; + if (ret != GRIB_SUCCESS) + return ret; + next = next->next; } return GRIB_SUCCESS; @@ -229,78 +235,77 @@ static int execute(grib_action* act, grib_handle *h) static void dump(grib_action* act, FILE* f, int lvl) { grib_action_if* a = (grib_action_if*)act; - int i = 0; + int i = 0; - for (i=0;icontext,f," "); + for (i = 0; i < lvl; i++) + grib_context_print(act->context, f, " "); - printf("if(%s) { ",act->name); grib_expression_print(act->context,a->expression,0); + printf("if(%s) { ", act->name); + grib_expression_print(act->context, a->expression, 0); printf("\n"); - if(a->block_true){ + if (a->block_true) { /* grib_context_print(act->context,f,"IF \t TODO \n"); TODO */ - grib_dump_action_branch(f,a->block_true,lvl+1); + grib_dump_action_branch(f, a->block_true, lvl + 1); } - if(a->block_false){ + if (a->block_false) { printf("}\n"); - for (i=0;icontext,f," "); - printf("else(%s) { ",act->name); grib_expression_print(act->context,a->expression,0); + for (i = 0; i < lvl; i++) + grib_context_print(act->context, f, " "); + printf("else(%s) { ", act->name); + grib_expression_print(act->context, a->expression, 0); /* grib_context_print(act->context,f,"ELSE \n" );*/ - grib_dump_action_branch(f,a->block_false,lvl+1); + grib_dump_action_branch(f, a->block_false, lvl + 1); } - for (i=0;icontext,f," "); + for (i = 0; i < lvl; i++) + grib_context_print(act->context, f, " "); printf("}\n"); } -static grib_action* reparse(grib_action* a,grib_accessor* acc,int* doit) +static grib_action* reparse(grib_action* a, grib_accessor* acc, int* doit) { - int ret=0; - long lres=0; + int ret = 0; + long lres = 0; grib_action_if* self = (grib_action_if*)a; /* printf("reparse %s %s\n",a->name,acc->name); */ - if((ret=grib_expression_evaluate_long(grib_handle_of_accessor(acc),self->expression,&lres)) != GRIB_SUCCESS) + if ((ret = grib_expression_evaluate_long(grib_handle_of_accessor(acc), self->expression, &lres)) != GRIB_SUCCESS) grib_context_log(acc->context, - GRIB_LOG_ERROR,"if reparse grib_expression_evaluate_long %s", - grib_get_error_message(ret)); + GRIB_LOG_ERROR, "if reparse grib_expression_evaluate_long %s", + grib_get_error_message(ret)); - if(lres) + if (lres) return self->block_true; else return self->block_false; - } -static void destroy(grib_context* context,grib_action* act) +static void destroy(grib_context* context, grib_action* act) { - grib_action_if* a = (grib_action_if*) act; - grib_action *t = a->block_true; - grib_action *f = a->block_false; - - while(t) - { - grib_action *nt = t->next; - grib_action_delete(context,t); + grib_action_if* a = (grib_action_if*)act; + grib_action* t = a->block_true; + grib_action* f = a->block_false; + + while (t) { + grib_action* nt = t->next; + grib_action_delete(context, t); t = nt; } - while(f) - { - grib_action *nf = f->next; - grib_action_delete(context,f); + while (f) { + grib_action* nf = f->next; + grib_action_delete(context, f); f = nf; } - grib_expression_free(context,a->expression); + grib_expression_free(context, a->expression); grib_context_free_persistent(context, act->name); grib_context_free_persistent(context, act->debug_info); grib_context_free_persistent(context, act->op); } -static void xref(grib_action* d, FILE* f,const char* path) +static void xref(grib_action* d, FILE* f, const char* path) { } diff --git a/src/action_class_list.c b/src/action_class_list.c index ea805cc82..d776563d6 100644 --- a/src/action_class_list.c +++ b/src/action_class_list.c @@ -40,130 +40,134 @@ or edit "action.class" and rerun ./make_class.pl */ -static void init_class (grib_action_class*); -static void dump (grib_action* d, FILE*,int); -static void destroy (grib_context*,grib_action*); -static int create_accessor(grib_section*,grib_action*,grib_loader*); -static grib_action* reparse(grib_action* a,grib_accessor* acc,int *doit); - - -typedef struct grib_action_list { - grib_action act; -/* Members defined in section */ -/* Members defined in list */ - grib_expression *expression; - grib_action *block_list; +static void init_class(grib_action_class*); +static void dump(grib_action* d, FILE*, int); +static void destroy(grib_context*, grib_action*); +static int create_accessor(grib_section*, grib_action*, grib_loader*); +static grib_action* reparse(grib_action* a, grib_accessor* acc, int* doit); + + +typedef struct grib_action_list +{ + grib_action act; + /* Members defined in section */ + /* Members defined in list */ + grib_expression* expression; + grib_action* block_list; } grib_action_list; extern grib_action_class* grib_action_class_section; static grib_action_class _grib_action_class_list = { - &grib_action_class_section, /* super */ - "action_class_list", /* name */ - sizeof(grib_action_list), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - &destroy, /* destroy */ - - &dump, /* dump */ - 0, /* xref */ - - &create_accessor, /* create_accessor*/ - - 0, /* notify_change */ - &reparse, /* reparse */ - 0, /* execute */ + &grib_action_class_section, /* super */ + "action_class_list", /* name */ + sizeof(grib_action_list), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + &destroy, /* destroy */ + + &dump, /* dump */ + 0, /* xref */ + + &create_accessor, /* create_accessor*/ + + 0, /* notify_change */ + &reparse, /* reparse */ + 0, /* execute */ }; grib_action_class* grib_action_class_list = &_grib_action_class_list; static void init_class(grib_action_class* c) { - c->xref = (*(c->super))->xref; - c->notify_change = (*(c->super))->notify_change; - c->execute = (*(c->super))->execute; + c->xref = (*(c->super))->xref; + c->notify_change = (*(c->super))->notify_change; + c->execute = (*(c->super))->execute; } /* END_CLASS_IMP */ -static void dump( grib_action* act, FILE* f, int lvl) +static void dump(grib_action* act, FILE* f, int lvl) { - grib_action_list* a = ( grib_action_list*)act; - int i = 0; - for (i=0;icontext,f," "); - grib_context_print(act->context,f,"Loop %s\n", act->name ); - grib_dump_action_branch(f,a->block_list,lvl+1); + grib_action_list* a = (grib_action_list*)act; + int i = 0; + for (i = 0; i < lvl; i++) + grib_context_print(act->context, f, " "); + grib_context_print(act->context, f, "Loop %s\n", act->name); + grib_dump_action_branch(f, a->block_list, lvl + 1); } -static int create_accessor(grib_section* p, grib_action* act,grib_loader* h) +static int create_accessor(grib_section* p, grib_action* act, grib_loader* h) { - grib_action_list* a = ( grib_action_list*)act; + grib_action_list* a = (grib_action_list*)act; grib_accessor* ga = NULL; - grib_section* gs = NULL; - grib_action* la = NULL; - grib_action* next = NULL; - int ret = 0; - long val = 0; - - if ((ret=grib_expression_evaluate_long(p->h,a->expression,&val)) != GRIB_SUCCESS){ - grib_context_log(p->h->context, GRIB_LOG_DEBUG, " List %s creating %d values unable to evaluate long \n", act->name, val ); + grib_section* gs = NULL; + grib_action* la = NULL; + grib_action* next = NULL; + int ret = 0; + long val = 0; + + if ((ret = grib_expression_evaluate_long(p->h, a->expression, &val)) != GRIB_SUCCESS) { + grib_context_log(p->h->context, GRIB_LOG_DEBUG, " List %s creating %d values unable to evaluate long \n", act->name, val); return ret; } - grib_context_log(p->h->context, GRIB_LOG_DEBUG, " List %s creating %d values \n", act->name, val ); + grib_context_log(p->h->context, GRIB_LOG_DEBUG, " List %s creating %d values \n", act->name, val); - ga = grib_accessor_factory(p, act,0,NULL); - if(!ga) return GRIB_BUFFER_TOO_SMALL; - gs = ga->sub_section; + ga = grib_accessor_factory(p, act, 0, NULL); + if (!ga) + return GRIB_BUFFER_TOO_SMALL; + gs = ga->sub_section; ga->loop = val; - grib_push_accessor(ga,p->block); + grib_push_accessor(ga, p->block); la = a->block_list; gs->branch = la; - grib_dependency_observe_expression(ga,a->expression); + grib_dependency_observe_expression(ga, a->expression); - while(val--){ + while (val--) { next = la; - while(next){ - ret = grib_create_accessor(gs, next,h); - if(ret != GRIB_SUCCESS) return ret; - next= next->next; + while (next) { + ret = grib_create_accessor(gs, next, h); + if (ret != GRIB_SUCCESS) + return ret; + next = next->next; } } return GRIB_SUCCESS; } -grib_action* grib_action_create_list( grib_context* context, const char* name, grib_expression* expression, grib_action* block) +grib_action* grib_action_create_list(grib_context* context, const char* name, grib_expression* expression, grib_action* block) { - grib_action_list* a ; - grib_action_class* c = grib_action_class_list; - grib_action* act = ( grib_action*)grib_context_malloc_clear_persistent(context,c->size); - act->cclass = c; - act->context = context; - a = ( grib_action_list*)act; - act->next = NULL; - act->name = grib_context_strdup_persistent(context,name); - act->op = grib_context_strdup_persistent(context,"section"); - a->expression = expression; + grib_action_list* a; + grib_action_class* c = grib_action_class_list; + grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context, c->size); + act->cclass = c; + act->context = context; + a = (grib_action_list*)act; + act->next = NULL; + act->name = grib_context_strdup_persistent(context, name); + act->op = grib_context_strdup_persistent(context, "section"); + a->expression = expression; a->block_list = block; - grib_context_log(context, GRIB_LOG_DEBUG, " Action List %s is created \n",act->name); + grib_context_log(context, GRIB_LOG_DEBUG, " Action List %s is created \n", act->name); return act; } -static grib_action* reparse(grib_action* a,grib_accessor* acc,int *doit) +static grib_action* reparse(grib_action* a, grib_accessor* acc, int* doit) { - grib_action_list* self = ( grib_action_list*)a; + grib_action_list* self = (grib_action_list*)a; - int ret = 0; + int ret = 0; long val = 0; - if ((ret=grib_expression_evaluate_long(grib_handle_of_accessor(acc),self->expression,&val)) != GRIB_SUCCESS){ - grib_context_log(acc->context, GRIB_LOG_ERROR, " List %s creating %d values unable to evaluate long \n", acc->name, val ); + if ((ret = grib_expression_evaluate_long(grib_handle_of_accessor(acc), self->expression, &val)) != GRIB_SUCCESS) { + grib_context_log(acc->context, GRIB_LOG_ERROR, " List %s creating %d values unable to evaluate long \n", acc->name, val); } *doit = (val != acc->loop); @@ -171,15 +175,14 @@ static grib_action* reparse(grib_action* a,grib_accessor* acc,int *doit) return self->block_list; } -static void destroy(grib_context* context,grib_action* act) +static void destroy(grib_context* context, grib_action* act) { - grib_action_list* self = ( grib_action_list*)act; - grib_action *a = self->block_list; + grib_action_list* self = (grib_action_list*)act; + grib_action* a = self->block_list; - while(a) - { - grib_action *na = a->next; - grib_action_delete(context,a); + while (a) { + grib_action* na = a->next; + grib_action_delete(context, a); a = na; } diff --git a/src/action_class_meta.c b/src/action_class_meta.c index a25bfd3d3..4cddc5528 100644 --- a/src/action_class_meta.c +++ b/src/action_class_meta.c @@ -36,82 +36,84 @@ or edit "action.class" and rerun ./make_class.pl */ -static void init_class (grib_action_class*); -static void dump (grib_action* d, FILE*,int); -static int execute(grib_action* a,grib_handle* h); +static void init_class(grib_action_class*); +static void dump(grib_action* d, FILE*, int); +static int execute(grib_action* a, grib_handle* h); -typedef struct grib_action_meta { - grib_action act; -/* Members defined in gen */ - long len; - grib_arguments* params; -/* Members defined in meta */ +typedef struct grib_action_meta +{ + grib_action act; + /* Members defined in gen */ + long len; + grib_arguments* params; + /* Members defined in meta */ } grib_action_meta; extern grib_action_class* grib_action_class_gen; static grib_action_class _grib_action_class_meta = { - &grib_action_class_gen, /* super */ - "action_class_meta", /* name */ - sizeof(grib_action_meta), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - 0, /* destroy */ - - &dump, /* dump */ - 0, /* xref */ - - 0, /* create_accessor*/ - - 0, /* notify_change */ - 0, /* reparse */ - &execute, /* execute */ + &grib_action_class_gen, /* super */ + "action_class_meta", /* name */ + sizeof(grib_action_meta), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + 0, /* destroy */ + + &dump, /* dump */ + 0, /* xref */ + + 0, /* create_accessor*/ + + 0, /* notify_change */ + 0, /* reparse */ + &execute, /* execute */ }; grib_action_class* grib_action_class_meta = &_grib_action_class_meta; static void init_class(grib_action_class* c) { - c->xref = (*(c->super))->xref; - c->create_accessor = (*(c->super))->create_accessor; - c->notify_change = (*(c->super))->notify_change; - c->reparse = (*(c->super))->reparse; + c->xref = (*(c->super))->xref; + c->create_accessor = (*(c->super))->create_accessor; + c->notify_change = (*(c->super))->notify_change; + c->reparse = (*(c->super))->reparse; } /* END_CLASS_IMP */ -grib_action* grib_action_create_meta( grib_context* context, const char* name, const char* op, - grib_arguments* params, grib_arguments* default_value,unsigned long flags,const char* name_space) +grib_action* grib_action_create_meta(grib_context* context, const char* name, const char* op, + grib_arguments* params, grib_arguments* default_value, unsigned long flags, const char* name_space) { - grib_action_meta* a = (grib_action_meta*)grib_context_malloc_clear_persistent(context,sizeof(grib_action_meta)); - grib_action* act = (grib_action*)a; - act->next = NULL; - act->name = grib_context_strdup_persistent(context, name); - act->op = grib_context_strdup_persistent(context, op); - if(name_space) - act->name_space = grib_context_strdup_persistent(context, name_space); - act->cclass = grib_action_class_meta; - act->context = context; - act->flags = flags; - a->params = params; - act->default_value = default_value; - a->len = 0; + grib_action_meta* a = (grib_action_meta*)grib_context_malloc_clear_persistent(context, sizeof(grib_action_meta)); + grib_action* act = (grib_action*)a; + act->next = NULL; + act->name = grib_context_strdup_persistent(context, name); + act->op = grib_context_strdup_persistent(context, op); + if (name_space) + act->name_space = grib_context_strdup_persistent(context, name_space); + act->cclass = grib_action_class_meta; + act->context = context; + act->flags = flags; + a->params = params; + act->default_value = default_value; + a->len = 0; /* grib_arguments_print(context,a->params,0); printf("\n"); */ return act; } -static void dump( grib_action* act, FILE* f, int lvl) +static void dump(grib_action* act, FILE* f, int lvl) { - int i =0; - for (i=0;icontext,f," "); - grib_context_print(act->context,f," meta %s \n", act->name ); + int i = 0; + for (i = 0; i < lvl; i++) + grib_context_print(act->context, f, " "); + grib_context_print(act->context, f, " meta %s \n", act->name); } -static int execute(grib_action* act, grib_handle *h) { - grib_action_class* super=*(act->cclass)->super; - return super->create_accessor(h->root,act,NULL); +static int execute(grib_action* act, grib_handle* h) +{ + grib_action_class* super = *(act->cclass)->super; + return super->create_accessor(h->root, act, NULL); } diff --git a/src/action_class_modify.c b/src/action_class_modify.c index 64fca9bef..588c22129 100644 --- a/src/action_class_modify.c +++ b/src/action_class_modify.c @@ -37,38 +37,39 @@ or edit "action.class" and rerun ./make_class.pl */ -static void init_class (grib_action_class*); -static void dump (grib_action* d, FILE*,int); -static void xref (grib_action* d, FILE* f,const char* path); -static void destroy (grib_context*,grib_action*); -static int create_accessor(grib_section*,grib_action*,grib_loader*); - - -typedef struct grib_action_modify { - grib_action act; -/* Members defined in modify */ - long flags; - char *name; +static void init_class(grib_action_class*); +static void dump(grib_action* d, FILE*, int); +static void xref(grib_action* d, FILE* f, const char* path); +static void destroy(grib_context*, grib_action*); +static int create_accessor(grib_section*, grib_action*, grib_loader*); + + +typedef struct grib_action_modify +{ + grib_action act; + /* Members defined in modify */ + long flags; + char* name; } grib_action_modify; static grib_action_class _grib_action_class_modify = { - 0, /* super */ - "action_class_modify", /* name */ - sizeof(grib_action_modify), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - &destroy, /* destroy */ - - &dump, /* dump */ - &xref, /* xref */ - - &create_accessor, /* create_accessor*/ - - 0, /* notify_change */ - 0, /* reparse */ - 0, /* execute */ + 0, /* super */ + "action_class_modify", /* name */ + sizeof(grib_action_modify), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + &destroy, /* destroy */ + + &dump, /* dump */ + &xref, /* xref */ + + &create_accessor, /* create_accessor*/ + + 0, /* notify_change */ + 0, /* reparse */ + 0, /* execute */ }; grib_action_class* grib_action_class_modify = &_grib_action_class_modify; @@ -78,58 +79,57 @@ static void init_class(grib_action_class* c) } /* END_CLASS_IMP */ -grib_action* grib_action_create_modify( grib_context* context, - const char* name, - long flags) -{ - - grib_action_modify* a ; - grib_action_class* c = grib_action_class_modify; - grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context,c->size); - act->op = grib_context_strdup_persistent(context,"section"); +grib_action* grib_action_create_modify(grib_context* context, + const char* name, + long flags) +{ + grib_action_modify* a; + grib_action_class* c = grib_action_class_modify; + grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context, c->size); + act->op = grib_context_strdup_persistent(context, "section"); - act->cclass = c; - a = (grib_action_modify*)act; - act->context = context; + act->cclass = c; + a = (grib_action_modify*)act; + act->context = context; - a->flags = flags; - a->name = grib_context_strdup_persistent(context,name); + a->flags = flags; + a->name = grib_context_strdup_persistent(context, name); - act->name = grib_context_strdup_persistent(context,"flags"); + act->name = grib_context_strdup_persistent(context, "flags"); - return act; + return act; } static void dump(grib_action* act, FILE* f, int lvl) { } -static int create_accessor(grib_section* p, grib_action* act,grib_loader *h) +static int create_accessor(grib_section* p, grib_action* act, grib_loader* h) { - grib_action_modify* a = ( grib_action_modify*)act; - grib_accessor* ga = NULL; + grib_action_modify* a = (grib_action_modify*)act; + grib_accessor* ga = NULL; - ga = grib_find_accessor(p->h, a->name); + ga = grib_find_accessor(p->h, a->name); - if(ga) - ga->flags = a->flags; + if (ga) + ga->flags = a->flags; - else{ - grib_context_log(act->context, GRIB_LOG_DEBUG, "action_class_modify: create_accessor_buffer : No accessor named %s to modify.", a->name); - } - return GRIB_SUCCESS; + else { + grib_context_log(act->context, GRIB_LOG_DEBUG, "action_class_modify: create_accessor_buffer : No accessor named %s to modify.", a->name); + } + return GRIB_SUCCESS; } -static void destroy(grib_context* context,grib_action* act) +static void destroy(grib_context* context, grib_action* act) { - grib_action_modify* a = (grib_action_modify*) act; + grib_action_modify* a = (grib_action_modify*)act; - grib_context_free_persistent(context, a->name); - grib_context_free_persistent(context, act->name); - grib_context_free_persistent(context, act->op); + grib_context_free_persistent(context, a->name); + grib_context_free_persistent(context, act->name); + grib_context_free_persistent(context, act->op); } -static void xref(grib_action* d, FILE* f,const char* path) +static void xref(grib_action* d, FILE* f, const char* path) { } diff --git a/src/action_class_noop.c b/src/action_class_noop.c index f0812412f..c6200daad 100644 --- a/src/action_class_noop.c +++ b/src/action_class_noop.c @@ -33,36 +33,37 @@ or edit "action.class" and rerun ./make_class.pl */ -static void init_class (grib_action_class*); -static void dump (grib_action* d, FILE*,int); -static void xref (grib_action* d, FILE* f,const char* path); -static void destroy (grib_context*,grib_action*); -static int execute(grib_action* a,grib_handle* h); +static void init_class(grib_action_class*); +static void dump(grib_action* d, FILE*, int); +static void xref(grib_action* d, FILE* f, const char* path); +static void destroy(grib_context*, grib_action*); +static int execute(grib_action* a, grib_handle* h); -typedef struct grib_action_noop { - grib_action act; -/* Members defined in noop */ +typedef struct grib_action_noop +{ + grib_action act; + /* Members defined in noop */ } grib_action_noop; static grib_action_class _grib_action_class_noop = { - 0, /* super */ - "action_class_noop", /* name */ - sizeof(grib_action_noop), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - &destroy, /* destroy */ - - &dump, /* dump */ - &xref, /* xref */ - - 0, /* create_accessor*/ - - 0, /* notify_change */ - 0, /* reparse */ - &execute, /* execute */ + 0, /* super */ + "action_class_noop", /* name */ + sizeof(grib_action_noop), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + &destroy, /* destroy */ + + &dump, /* dump */ + &xref, /* xref */ + + 0, /* create_accessor*/ + + 0, /* notify_change */ + 0, /* reparse */ + &execute, /* execute */ }; grib_action_class* grib_action_class_noop = &_grib_action_class_noop; @@ -72,22 +73,22 @@ static void init_class(grib_action_class* c) } /* END_CLASS_IMP */ -grib_action* grib_action_create_noop( grib_context* context,const char* fname) +grib_action* grib_action_create_noop(grib_context* context, const char* fname) { char buf[1024]; - grib_action_noop* a ; - grib_action_class* c = grib_action_class_noop; - grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context,c->size); - act->op = grib_context_strdup_persistent(context,"section"); + grib_action_noop* a; + grib_action_class* c = grib_action_class_noop; + grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context, c->size); + act->op = grib_context_strdup_persistent(context, "section"); - act->cclass = c; - a = (grib_action_noop*)act; - act->context = context; + act->cclass = c; + a = (grib_action_noop*)act; + act->context = context; - sprintf(buf,"_noop%p",(void*)a); + sprintf(buf, "_noop%p", (void*)a); - act->name = grib_context_strdup_persistent(context,buf); + act->name = grib_context_strdup_persistent(context, buf); return act; } @@ -96,14 +97,17 @@ static void dump(grib_action* act, FILE* f, int lvl) { } -static void destroy(grib_context* context,grib_action* act) +static void destroy(grib_context* context, grib_action* act) { grib_context_free_persistent(context, act->name); grib_context_free_persistent(context, act->op); } -static void xref(grib_action* d, FILE* f,const char* path) +static void xref(grib_action* d, FILE* f, const char* path) { } -static int execute(grib_action* act, grib_handle *h) {return 0;} +static int execute(grib_action* act, grib_handle* h) +{ + return 0; +} diff --git a/src/action_class_print.c b/src/action_class_print.c index 01e2b3b4e..872a1e182 100644 --- a/src/action_class_print.c +++ b/src/action_class_print.c @@ -36,37 +36,38 @@ or edit "action.class" and rerun ./make_class.pl */ -static void init_class (grib_action_class*); -static void dump (grib_action* d, FILE*,int); -static void destroy (grib_context*,grib_action*); -static int execute(grib_action* a,grib_handle* h); +static void init_class(grib_action_class*); +static void dump(grib_action* d, FILE*, int); +static void destroy(grib_context*, grib_action*); +static int execute(grib_action* a, grib_handle* h); -typedef struct grib_action_print { - grib_action act; -/* Members defined in print */ - char *name; - char *outname; +typedef struct grib_action_print +{ + grib_action act; + /* Members defined in print */ + char* name; + char* outname; } grib_action_print; static grib_action_class _grib_action_class_print = { - 0, /* super */ - "action_class_print", /* name */ - sizeof(grib_action_print), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - &destroy, /* destroy */ - - &dump, /* dump */ - 0, /* xref */ - - 0, /* create_accessor*/ - - 0, /* notify_change */ - 0, /* reparse */ - &execute, /* execute */ + 0, /* super */ + "action_class_print", /* name */ + sizeof(grib_action_print), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + &destroy, /* destroy */ + + &dump, /* dump */ + 0, /* xref */ + + 0, /* create_accessor*/ + + 0, /* notify_change */ + 0, /* reparse */ + &execute, /* execute */ }; grib_action_class* grib_action_class_print = &_grib_action_class_print; @@ -76,63 +77,66 @@ static void init_class(grib_action_class* c) } /* END_CLASS_IMP */ -grib_action* grib_action_create_print( grib_context* context, const char* name,char* outname) +grib_action* grib_action_create_print(grib_context* context, const char* name, char* outname) { char buf[1024]; - grib_action_print* a ; - grib_action_class* c = grib_action_class_print; - grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context,c->size); - act->op = grib_context_strdup_persistent(context,"section"); + grib_action_print* a; + grib_action_class* c = grib_action_class_print; + grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context, c->size); + act->op = grib_context_strdup_persistent(context, "section"); - act->cclass = c; - a = (grib_action_print*)act; - act->context = context; + act->cclass = c; + a = (grib_action_print*)act; + act->context = context; - a->name = grib_context_strdup_persistent(context,name); + a->name = grib_context_strdup_persistent(context, name); if (outname) { - FILE* out=NULL; - int ioerr=0; - a->outname = grib_context_strdup_persistent(context,outname); - out=fopen(outname,"w"); - ioerr=errno; - if (!out) { - grib_context_log(act->context,(GRIB_LOG_ERROR)|(GRIB_LOG_PERROR), - "IO ERROR: %s: %s",strerror(ioerr),outname); + FILE* out = NULL; + int ioerr = 0; + a->outname = grib_context_strdup_persistent(context, outname); + out = fopen(outname, "w"); + ioerr = errno; + if (!out) { + grib_context_log(act->context, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), + "IO ERROR: %s: %s", strerror(ioerr), outname); } - if (out) fclose(out); + if (out) + fclose(out); } - sprintf(buf,"print%p",(void*)a->name); + sprintf(buf, "print%p", (void*)a->name); - act->name = grib_context_strdup_persistent(context,buf); + act->name = grib_context_strdup_persistent(context, buf); return act; } -static int execute(grib_action* act, grib_handle *h) +static int execute(grib_action* act, grib_handle* h) { - grib_action_print* self = (grib_action_print*) act; - int err =0; - FILE* out=NULL; - int ioerr=0; + grib_action_print* self = (grib_action_print*)act; + int err = 0; + FILE* out = NULL; + int ioerr = 0; if (self->outname) { - out=fopen(self->outname,"a"); - ioerr=errno; - if (!out) { - grib_context_log(act->context,(GRIB_LOG_ERROR)|(GRIB_LOG_PERROR), - "IO ERROR: %s: %s",strerror(ioerr),self->outname); + out = fopen(self->outname, "a"); + ioerr = errno; + if (!out) { + grib_context_log(act->context, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), + "IO ERROR: %s: %s", strerror(ioerr), self->outname); return GRIB_IO_PROBLEM; } - } else { - out=stdout; + } + else { + out = stdout; } - err=grib_recompose_print(h,NULL,self->name,0,out); + err = grib_recompose_print(h, NULL, self->name, 0, out); - if (self->outname) fclose(out); + if (self->outname) + fclose(out); return err; } @@ -141,9 +145,9 @@ static void dump(grib_action* act, FILE* f, int lvl) { } -static void destroy(grib_context* context,grib_action* act) +static void destroy(grib_context* context, grib_action* act) { - grib_action_print* a = (grib_action_print*) act; + grib_action_print* a = (grib_action_print*)act; grib_context_free_persistent(context, a->name); grib_context_free_persistent(context, act->name); diff --git a/src/action_class_put.c b/src/action_class_put.c index deb3823c9..c8423e075 100644 --- a/src/action_class_put.c +++ b/src/action_class_put.c @@ -37,36 +37,37 @@ or edit "action.class" and rerun ./make_class.pl */ -static void init_class (grib_action_class*); -static void dump (grib_action* d, FILE*,int); -static void destroy (grib_context*,grib_action*); -static int create_accessor(grib_section*,grib_action*,grib_loader*); +static void init_class(grib_action_class*); +static void dump(grib_action* d, FILE*, int); +static void destroy(grib_context*, grib_action*); +static int create_accessor(grib_section*, grib_action*, grib_loader*); -typedef struct grib_action_put { - grib_action act; -/* Members defined in put */ - grib_arguments* args; +typedef struct grib_action_put +{ + grib_action act; + /* Members defined in put */ + grib_arguments* args; } grib_action_put; static grib_action_class _grib_action_class_put = { - 0, /* super */ - "action_class_put", /* name */ - sizeof(grib_action_put), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - &destroy, /* destroy */ - - &dump, /* dump */ - 0, /* xref */ - - &create_accessor, /* create_accessor*/ - - 0, /* notify_change */ - 0, /* reparse */ - 0, /* execute */ + 0, /* super */ + "action_class_put", /* name */ + sizeof(grib_action_put), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + &destroy, /* destroy */ + + &dump, /* dump */ + 0, /* xref */ + + &create_accessor, /* create_accessor*/ + + 0, /* notify_change */ + 0, /* reparse */ + 0, /* execute */ }; grib_action_class* grib_action_class_put = &_grib_action_class_put; @@ -76,61 +77,64 @@ static void init_class(grib_action_class* c) } /* END_CLASS_IMP */ -grib_action* grib_action_create_put( grib_context* context, const char* name ,grib_arguments *args ) +grib_action* grib_action_create_put(grib_context* context, const char* name, grib_arguments* args) { - grib_action_put* a = NULL; - grib_action_class* c = grib_action_class_put; - grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context,c->size); - act->next = NULL; - act->name = grib_context_strdup_persistent(context,name); - act->op = grib_context_strdup_persistent(context,"forward"); - act->cclass = c; - act->context = context; - a = (grib_action_put*)act; - a->args = args; + grib_action_put* a = NULL; + grib_action_class* c = grib_action_class_put; + grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context, c->size); + act->next = NULL; + act->name = grib_context_strdup_persistent(context, name); + act->op = grib_context_strdup_persistent(context, "forward"); + act->cclass = c; + act->context = context; + a = (grib_action_put*)act; + a->args = args; return act; } -static int create_accessor(grib_section* p, grib_action* act,grib_loader *h) +static int create_accessor(grib_section* p, grib_action* act, grib_loader* h) { - grib_action_put* a = ( grib_action_put*)act; + grib_action_put* a = (grib_action_put*)act; grib_section* ts = NULL; grib_accessor* ga = NULL; - ga = grib_find_accessor(p->h, grib_arguments_get_name(p->h,a->args,1)); - if(ga) + ga = grib_find_accessor(p->h, grib_arguments_get_name(p->h, a->args, 1)); + if (ga) ts = ga->sub_section; /* ts = grib_get_sub_section(ga); */ - else return GRIB_BUFFER_TOO_SMALL; - - if(ts){ - ga = grib_accessor_factory( ts, act,0,a->args); - if(ga)grib_push_accessor(ga,ts->block); - else return GRIB_BUFFER_TOO_SMALL; - + else + return GRIB_BUFFER_TOO_SMALL; + + if (ts) { + ga = grib_accessor_factory(ts, act, 0, a->args); + if (ga) + grib_push_accessor(ga, ts->block); + else + return GRIB_BUFFER_TOO_SMALL; } - else{ - grib_context_log(act->context, GRIB_LOG_ERROR, "Action_class_put : create_accessor_buffer : No Section named %s to export %s ", grib_arguments_get_name(p->h,a->args,1), grib_arguments_get_name(p->h,a->args,0)); + else { + grib_context_log(act->context, GRIB_LOG_ERROR, "Action_class_put : create_accessor_buffer : No Section named %s to export %s ", grib_arguments_get_name(p->h, a->args, 1), grib_arguments_get_name(p->h, a->args, 0)); } return GRIB_SUCCESS; } -static void dump( grib_action* act, FILE* f, int lvl) +static void dump(grib_action* act, FILE* f, int lvl) { - grib_action_put* a = ( grib_action_put*)act; + grib_action_put* a = (grib_action_put*)act; int i = 0; - for (i=0;icontext,f," "); + for (i = 0; i < lvl; i++) + grib_context_print(act->context, f, " "); - grib_context_print(act->context,f,"put %s as %s in %s\n",grib_arguments_get_name(0,a->args,0),act->name,grib_arguments_get_name(0,a->args,1)); + grib_context_print(act->context, f, "put %s as %s in %s\n", grib_arguments_get_name(0, a->args, 0), act->name, grib_arguments_get_name(0, a->args, 1)); } static void destroy(grib_context* context, grib_action* act) { - grib_action_put* a = ( grib_action_put*)act; + grib_action_put* a = (grib_action_put*)act; grib_arguments_free(context, a->args); grib_context_free_persistent(context, act->name); diff --git a/src/action_class_remove.c b/src/action_class_remove.c index 7ea6f3bc0..1470eb50a 100644 --- a/src/action_class_remove.c +++ b/src/action_class_remove.c @@ -36,37 +36,38 @@ or edit "action.class" and rerun ./make_class.pl */ -static void init_class (grib_action_class*); -static void dump (grib_action* d, FILE*,int); -static void xref (grib_action* d, FILE* f,const char* path); -static void destroy (grib_context*,grib_action*); -static int create_accessor(grib_section*,grib_action*,grib_loader*); +static void init_class(grib_action_class*); +static void dump(grib_action* d, FILE*, int); +static void xref(grib_action* d, FILE* f, const char* path); +static void destroy(grib_context*, grib_action*); +static int create_accessor(grib_section*, grib_action*, grib_loader*); -typedef struct grib_action_remove { - grib_action act; -/* Members defined in remove */ - grib_arguments* args; +typedef struct grib_action_remove +{ + grib_action act; + /* Members defined in remove */ + grib_arguments* args; } grib_action_remove; static grib_action_class _grib_action_class_remove = { - 0, /* super */ - "action_class_remove", /* name */ - sizeof(grib_action_remove), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - &destroy, /* destroy */ - - &dump, /* dump */ - &xref, /* xref */ - - &create_accessor, /* create_accessor*/ - - 0, /* notify_change */ - 0, /* reparse */ - 0, /* execute */ + 0, /* super */ + "action_class_remove", /* name */ + sizeof(grib_action_remove), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + &destroy, /* destroy */ + + &dump, /* dump */ + &xref, /* xref */ + + &create_accessor, /* create_accessor*/ + + 0, /* notify_change */ + 0, /* reparse */ + 0, /* execute */ }; grib_action_class* grib_action_class_remove = &_grib_action_class_remove; @@ -76,84 +77,87 @@ static void init_class(grib_action_class* c) } /* END_CLASS_IMP */ -grib_action* grib_action_create_remove( grib_context* context, grib_arguments *args ) +grib_action* grib_action_create_remove(grib_context* context, grib_arguments* args) { - grib_action_remove* a = NULL; - grib_action_class* c = grib_action_class_remove; - grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context,c->size); - act->next = NULL; - act->name = grib_context_strdup_persistent(context,"DELETE"); - act->op = grib_context_strdup_persistent(context,"remove"); - act->cclass = c; - act->context = context; - a = (grib_action_remove*)act; - a->args = args; + grib_action_remove* a = NULL; + grib_action_class* c = grib_action_class_remove; + grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context, c->size); + act->next = NULL; + act->name = grib_context_strdup_persistent(context, "DELETE"); + act->op = grib_context_strdup_persistent(context, "remove"); + act->cclass = c; + act->context = context; + a = (grib_action_remove*)act; + a->args = args; return act; } -static void remove_accessor(grib_accessor *a) +static void remove_accessor(grib_accessor* a) { grib_section* s = NULL; int id; - if (!a || !a->previous) return; + if (!a || !a->previous) + return; s = a->parent; if (grib_handle_of_accessor(a)->use_trie && *(a->all_names[0]) != '_') { - id=grib_hash_keys_get_id(a->context->keys,a->all_names[0]); - grib_handle_of_accessor(a)->accessors[id]=NULL; + id = grib_hash_keys_get_id(a->context->keys, a->all_names[0]); + grib_handle_of_accessor(a)->accessors[id] = NULL; } - if (a->next) a->previous->next = a->next; - else return; + if (a->next) + a->previous->next = a->next; + else + return; a->next->previous = a->previous; - grib_accessor_delete(s->h->context,a); + grib_accessor_delete(s->h->context, a); return; } -static int create_accessor(grib_section* p, grib_action* act,grib_loader*h) +static int create_accessor(grib_section* p, grib_action* act, grib_loader* h) { - grib_action_remove* a = ( grib_action_remove*)act; + grib_action_remove* a = (grib_action_remove*)act; grib_accessor* ga = NULL; - ga = grib_find_accessor(p->h, grib_arguments_get_name(p->h,a->args,0)); + ga = grib_find_accessor(p->h, grib_arguments_get_name(p->h, a->args, 0)); - if(ga) + if (ga) remove_accessor(ga); - else{ - grib_context_log(act->context, GRIB_LOG_DEBUG, "Action_class_remove : create_accessor_buffer : No accessor named %s to remove ", grib_arguments_get_name(p->h,a->args,0)); + else { + grib_context_log(act->context, GRIB_LOG_DEBUG, "Action_class_remove : create_accessor_buffer : No accessor named %s to remove ", grib_arguments_get_name(p->h, a->args, 0)); } return GRIB_SUCCESS; } -static void dump( grib_action* act, FILE* f, int lvl) +static void dump(grib_action* act, FILE* f, int lvl) { - grib_action_remove* a = ( grib_action_remove*)act; + grib_action_remove* a = (grib_action_remove*)act; int i = 0; - for (i=0;icontext,f," "); - - grib_context_print(act->context,f,"remove %s as %s in %s\n",grib_arguments_get_name(0,a->args,0),act->name,grib_arguments_get_name(0,a->args,1)); + for (i = 0; i < lvl; i++) + grib_context_print(act->context, f, " "); + grib_context_print(act->context, f, "remove %s as %s in %s\n", grib_arguments_get_name(0, a->args, 0), act->name, grib_arguments_get_name(0, a->args, 1)); } static void destroy(grib_context* context, grib_action* act) { - grib_action_remove* a = ( grib_action_remove*)act; + grib_action_remove* a = (grib_action_remove*)act; grib_arguments_free(context, a->args); grib_context_free_persistent(context, act->name); grib_context_free_persistent(context, act->op); } -static void xref(grib_action* d, FILE* f,const char* path) +static void xref(grib_action* d, FILE* f, const char* path) { } diff --git a/src/action_class_rename.c b/src/action_class_rename.c index 06bd6767b..8480dab9b 100644 --- a/src/action_class_rename.c +++ b/src/action_class_rename.c @@ -37,38 +37,39 @@ or edit "action.class" and rerun ./make_class.pl */ -static void init_class (grib_action_class*); -static void dump (grib_action* d, FILE*,int); -static void xref (grib_action* d, FILE* f,const char* path); -static void destroy (grib_context*,grib_action*); -static int create_accessor(grib_section*,grib_action*,grib_loader*); - - -typedef struct grib_action_rename { - grib_action act; -/* Members defined in rename */ - char* the_old; - char* the_new; +static void init_class(grib_action_class*); +static void dump(grib_action* d, FILE*, int); +static void xref(grib_action* d, FILE* f, const char* path); +static void destroy(grib_context*, grib_action*); +static int create_accessor(grib_section*, grib_action*, grib_loader*); + + +typedef struct grib_action_rename +{ + grib_action act; + /* Members defined in rename */ + char* the_old; + char* the_new; } grib_action_rename; static grib_action_class _grib_action_class_rename = { - 0, /* super */ - "action_class_rename", /* name */ - sizeof(grib_action_rename), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - &destroy, /* destroy */ - - &dump, /* dump */ - &xref, /* xref */ - - &create_accessor, /* create_accessor*/ - - 0, /* notify_change */ - 0, /* reparse */ - 0, /* execute */ + 0, /* super */ + "action_class_rename", /* name */ + sizeof(grib_action_rename), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + &destroy, /* destroy */ + + &dump, /* dump */ + &xref, /* xref */ + + &create_accessor, /* create_accessor*/ + + 0, /* notify_change */ + 0, /* reparse */ + 0, /* execute */ }; grib_action_class* grib_action_class_rename = &_grib_action_class_rename; @@ -78,69 +79,71 @@ static void init_class(grib_action_class* c) } /* END_CLASS_IMP */ -grib_action* grib_action_create_rename( grib_context* context, char* the_old, char* the_new) +grib_action* grib_action_create_rename(grib_context* context, char* the_old, char* the_new) { - grib_action_rename* a = NULL; - grib_action_class* c = grib_action_class_rename; - grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context,c->size); - act->next = NULL; - act->name = grib_context_strdup_persistent(context,"RENAME"); - act->op = grib_context_strdup_persistent(context,"rename"); - act->cclass = c; - act->context = context; - a = (grib_action_rename*)act; - a->the_old=grib_context_strdup_persistent(context,the_old); - a->the_new=grib_context_strdup_persistent(context,the_new); + grib_action_rename* a = NULL; + grib_action_class* c = grib_action_class_rename; + grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context, c->size); + act->next = NULL; + act->name = grib_context_strdup_persistent(context, "RENAME"); + act->op = grib_context_strdup_persistent(context, "rename"); + act->cclass = c; + act->context = context; + a = (grib_action_rename*)act; + a->the_old = grib_context_strdup_persistent(context, the_old); + a->the_new = grib_context_strdup_persistent(context, the_new); return act; } -static void rename_accessor(grib_accessor *a,char* name) +static void rename_accessor(grib_accessor* a, char* name) { int id; - char* the_old=(char*)a->all_names[0]; + char* the_old = (char*)a->all_names[0]; if (grib_handle_of_accessor(a)->use_trie && *(a->all_names[0]) != '_') { - id=grib_hash_keys_get_id(a->context->keys,a->all_names[0]); - grib_handle_of_accessor(a)->accessors[id]=NULL; - id=grib_hash_keys_get_id(a->context->keys,name); - grib_handle_of_accessor(a)->accessors[id]=a; + id = grib_hash_keys_get_id(a->context->keys, a->all_names[0]); + grib_handle_of_accessor(a)->accessors[id] = NULL; + id = grib_hash_keys_get_id(a->context->keys, name); + grib_handle_of_accessor(a)->accessors[id] = a; } - a->all_names[0]=grib_context_strdup_persistent(a->context,name); - a->name=a->all_names[0]; - grib_context_log(a->context,GRIB_LOG_DEBUG,"Renaming %s to %s",the_old,name); + a->all_names[0] = grib_context_strdup_persistent(a->context, name); + a->name = a->all_names[0]; + grib_context_log(a->context, GRIB_LOG_DEBUG, "Renaming %s to %s", the_old, name); /* grib_context_free(a->context,the_old); */ } -static int create_accessor(grib_section* p, grib_action* act,grib_loader*h) +static int create_accessor(grib_section* p, grib_action* act, grib_loader* h) { - grib_action_rename* a = ( grib_action_rename*)act; - grib_accessor* ga = NULL; + grib_action_rename* a = (grib_action_rename*)act; + grib_accessor* ga = NULL; ga = grib_find_accessor(p->h, a->the_old); - if(ga) { - rename_accessor(ga,a->the_new); - } else{ + if (ga) { + rename_accessor(ga, a->the_new); + } + else { grib_context_log(act->context, GRIB_LOG_DEBUG, "Action_class_rename : create_accessor_buffer : No accessor named %s to rename ", a->the_old); } return GRIB_SUCCESS; } -static void dump( grib_action* act, FILE* f, int lvl) +static void dump(grib_action* act, FILE* f, int lvl) { - grib_action_rename* a = ( grib_action_rename*)act; + grib_action_rename* a = (grib_action_rename*)act; int i = 0; - for (i=0;icontext,f," "); + for (i = 0; i < lvl; i++) + grib_context_print(act->context, f, " "); - grib_context_print(act->context,f,"rename %s as %s in %s\n",a->the_old,act->name,a->the_new); + grib_context_print(act->context, f, "rename %s as %s in %s\n", a->the_old, act->name, a->the_new); } static void destroy(grib_context* context, grib_action* act) { - grib_action_rename* a = ( grib_action_rename*)act; + grib_action_rename* a = (grib_action_rename*)act; grib_context_free_persistent(context, a->the_old); grib_context_free_persistent(context, a->the_new); @@ -148,6 +151,6 @@ static void destroy(grib_context* context, grib_action* act) grib_context_free_persistent(context, act->op); } -static void xref(grib_action* d, FILE* f,const char* path) +static void xref(grib_action* d, FILE* f, const char* path) { } diff --git a/src/action_class_section.c b/src/action_class_section.c index 56a28dcc0..2ade627d8 100644 --- a/src/action_class_section.c +++ b/src/action_class_section.c @@ -37,35 +37,36 @@ or edit "action.class" and rerun ./make_class.pl */ -static void init_class (grib_action_class*); -static void xref (grib_action* d, FILE* f,const char* path); -static int notify_change(grib_action* a, grib_accessor* observer,grib_accessor* observed); -static grib_action* reparse(grib_action* a,grib_accessor* acc,int *doit); +static void init_class(grib_action_class*); +static void xref(grib_action* d, FILE* f, const char* path); +static int notify_change(grib_action* a, grib_accessor* observer, grib_accessor* observed); +static grib_action* reparse(grib_action* a, grib_accessor* acc, int* doit); -typedef struct grib_action_section { - grib_action act; -/* Members defined in section */ +typedef struct grib_action_section +{ + grib_action act; + /* Members defined in section */ } grib_action_section; static grib_action_class _grib_action_class_section = { - 0, /* super */ - "action_class_section", /* name */ - sizeof(grib_action_section), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - 0, /* destroy */ - - 0, /* dump */ - &xref, /* xref */ - - 0, /* create_accessor*/ - - ¬ify_change, /* notify_change */ - &reparse, /* reparse */ - 0, /* execute */ + 0, /* super */ + "action_class_section", /* name */ + sizeof(grib_action_section), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + 0, /* destroy */ + + 0, /* dump */ + &xref, /* xref */ + + 0, /* create_accessor*/ + + ¬ify_change, /* notify_change */ + &reparse, /* reparse */ + 0, /* execute */ }; grib_action_class* grib_action_class_section = &_grib_action_class_section; @@ -90,16 +91,16 @@ static void check_sections(grib_section *s,grib_handle* h) } #endif -static int notify_change(grib_action* act, grib_accessor * notified, - grib_accessor* changed) +static int notify_change(grib_action* act, grib_accessor* notified, + grib_accessor* changed) { - grib_loader loader = { 0,0,0,0,0 }; + grib_loader loader = { 0, 0, 0, 0, 0 }; - grib_section *old_section = NULL; - grib_handle *h = grib_handle_of_accessor(notified); - size_t len = 0; - size_t size = 0; - int err=0; + grib_section* old_section = NULL; + grib_handle* h = grib_handle_of_accessor(notified); + size_t len = 0; + size_t size = 0; + int err = 0; grib_handle* tmp_handle; int doit = 0; @@ -111,11 +112,11 @@ static int notify_change(grib_action* act, grib_accessor * notified, sprintf(debug_str, " (%s)", act->debug_info); } grib_context_log(h->context, - GRIB_LOG_DEBUG,"------------- SECTION action %s (%s) is triggered by [%s]%s", - act->name, notified->name, changed->name, debug_str); + GRIB_LOG_DEBUG, "------------- SECTION action %s (%s) is triggered by [%s]%s", + act->name, notified->name, changed->name, debug_str); } - la = grib_action_reparse(act,notified,&doit); + la = grib_action_reparse(act, notified, &doit); old_section = notified->sub_section; Assert(old_section); @@ -125,29 +126,29 @@ static int notify_change(grib_action* act, grib_accessor * notified, /* printf("new = %p\n",(void*)la); */ grib_context_log(h->context, - GRIB_LOG_DEBUG,"------------- DOIT %ld OLD %p NEW %p", - doit,old_section->branch,la); + GRIB_LOG_DEBUG, "------------- DOIT %ld OLD %p NEW %p", + doit, old_section->branch, la); - if(!doit) { - if(la != NULL || old_section->branch != NULL) - if(la == old_section->branch) - { - grib_context_log(h->context,GRIB_LOG_DEBUG,"IGNORING TRIGGER action %s (%s) is triggered %p", act->name, notified->name - ,(void*)la); + if (!doit) { + if (la != NULL || old_section->branch != NULL) + if (la == old_section->branch) { + grib_context_log(h->context, GRIB_LOG_DEBUG, "IGNORING TRIGGER action %s (%s) is triggered %p", act->name, notified->name, (void*)la); return GRIB_SUCCESS; } } loader.list_is_resized = (la == old_section->branch); - if (!strcmp(changed->name,"GRIBEditionNumber")) loader.changing_edition=1; - else loader.changing_edition=0; + if (!strcmp(changed->name, "GRIBEditionNumber")) + loader.changing_edition = 1; + else + loader.changing_edition = 0; old_section->branch = la; tmp_handle = grib_new_handle(h->context); - if(!tmp_handle) + if (!tmp_handle) return GRIB_OUT_OF_MEMORY; tmp_handle->buffer = grib_create_growable_buffer(h->context); @@ -163,33 +164,35 @@ static int notify_change(grib_action* act, grib_accessor * notified, Assert(h->kid == NULL); tmp_handle->loader = &loader; - tmp_handle->main = h; - h->kid = tmp_handle; + tmp_handle->main = h; + h->kid = tmp_handle; /* printf("tmp_handle- main %p %p\n",(void*)tmp_handle,(void*)h); */ - grib_context_log(h->context,GRIB_LOG_DEBUG,"------------- CREATE TMP BLOCK act=%s notified=%s", act->name, notified->name); - tmp_handle->root = grib_section_create(tmp_handle,NULL); + grib_context_log(h->context, GRIB_LOG_DEBUG, "------------- CREATE TMP BLOCK act=%s notified=%s", act->name, notified->name); + tmp_handle->root = grib_section_create(tmp_handle, NULL); - tmp_handle->use_trie=1; + tmp_handle->use_trie = 1; - err=grib_create_accessor(tmp_handle->root, act, &loader); + err = grib_create_accessor(tmp_handle->root, act, &loader); if (err) { - if (err == GRIB_NOT_FOUND && strcmp(act->name, "dataValues")==0) { + if (err == GRIB_NOT_FOUND && strcmp(act->name, "dataValues") == 0) { /* FIXME: Allow this error. Needed when changing some packingTypes e.g. CCSDS to Simple */ err = GRIB_SUCCESS; - } else { + } + else { return err; } } - err = grib_section_adjust_sizes(tmp_handle->root,1,0); - if (err) return err; + err = grib_section_adjust_sizes(tmp_handle->root, 1, 0); + if (err) + return err; grib_section_post_init(tmp_handle->root); /* grib_recompute_sections_lengths(tmp_handle->root); */ - grib_get_block_length(tmp_handle->root,&len); - grib_context_log(h->context,GRIB_LOG_DEBUG,"------------- TMP BLOCK IS sectlen=%d buffer=%d", len, tmp_handle->buffer->ulength); + grib_get_block_length(tmp_handle->root, &len); + grib_context_log(h->context, GRIB_LOG_DEBUG, "------------- TMP BLOCK IS sectlen=%d buffer=%d", len, tmp_handle->buffer->ulength); #if 0 if(h->context->debug > 10) @@ -199,31 +202,32 @@ static int notify_change(grib_action* act, grib_accessor * notified, /* Assert(tmp_handle->buffer->ulength == len); */ /* grib_empty_section(h->context,old_section); */ - grib_buffer_replace(notified, tmp_handle->buffer->data, tmp_handle->buffer->ulength,0,1); + grib_buffer_replace(notified, tmp_handle->buffer->data, tmp_handle->buffer->ulength, 0, 1); Assert(tmp_handle->root->block->first != NULL); grib_swap_sections(old_section, - tmp_handle->root->block->first->sub_section); + tmp_handle->root->block->first->sub_section); Assert(tmp_handle->dependencies == NULL); /* printf("grib_handle_delete %p\n",(void*)tmp_handle); */ grib_handle_delete(tmp_handle); - h->use_trie = 1; - h->trie_invalid=1; - h->kid = NULL; + h->use_trie = 1; + h->trie_invalid = 1; + h->kid = NULL; - err = grib_section_adjust_sizes(h->root,1,0); - if (err) return err; + err = grib_section_adjust_sizes(h->root, 1, 0); + if (err) + return err; grib_section_post_init(h->root); - grib_get_block_length(old_section,&size); + grib_get_block_length(old_section, &size); - grib_context_log(h->context,GRIB_LOG_DEBUG,"------------- BLOCK SIZE %ld, buffer len=%ld", size,len); - if(h->context->debug > 10) - grib_dump_content(h,stdout,"debug",~0,NULL); + grib_context_log(h->context, GRIB_LOG_DEBUG, "------------- BLOCK SIZE %ld, buffer len=%ld", size, len); + if (h->context->debug > 10) + grib_dump_content(h, stdout, "debug", ~0, NULL); Assert(size == len); @@ -232,15 +236,15 @@ static int notify_change(grib_action* act, grib_accessor * notified, return err; } -static grib_action* reparse(grib_action* a,grib_accessor* acc,int* doit) +static grib_action* reparse(grib_action* a, grib_accessor* acc, int* doit) { /* Should be inherited */ - printf("reparse should be inherited: %s\n",a->name); + printf("reparse should be inherited: %s\n", a->name); - Assert(1==0); + Assert(1 == 0); return 0; } -static void xref(grib_action* d, FILE* f,const char* path) +static void xref(grib_action* d, FILE* f, const char* path) { } diff --git a/src/action_class_set.c b/src/action_class_set.c index 86e28d6fb..e95adc010 100644 --- a/src/action_class_set.c +++ b/src/action_class_set.c @@ -36,39 +36,40 @@ or edit "action.class" and rerun ./make_class.pl */ -static void init_class (grib_action_class*); -static void dump (grib_action* d, FILE*,int); -static void xref (grib_action* d, FILE* f,const char* path); -static void destroy (grib_context*,grib_action*); -static int execute(grib_action* a,grib_handle* h); - - -typedef struct grib_action_set { - grib_action act; -/* Members defined in set */ - grib_expression *expression; - char *name; - int nofail; +static void init_class(grib_action_class*); +static void dump(grib_action* d, FILE*, int); +static void xref(grib_action* d, FILE* f, const char* path); +static void destroy(grib_context*, grib_action*); +static int execute(grib_action* a, grib_handle* h); + + +typedef struct grib_action_set +{ + grib_action act; + /* Members defined in set */ + grib_expression* expression; + char* name; + int nofail; } grib_action_set; static grib_action_class _grib_action_class_set = { - 0, /* super */ - "action_class_set", /* name */ - sizeof(grib_action_set), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - &destroy, /* destroy */ - - &dump, /* dump */ - &xref, /* xref */ - - 0, /* create_accessor*/ - - 0, /* notify_change */ - 0, /* reparse */ - &execute, /* execute */ + 0, /* super */ + "action_class_set", /* name */ + sizeof(grib_action_set), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + &destroy, /* destroy */ + + &dump, /* dump */ + &xref, /* xref */ + + 0, /* create_accessor*/ + + 0, /* notify_change */ + 0, /* reparse */ + &execute, /* execute */ }; grib_action_class* grib_action_class_set = &_grib_action_class_set; @@ -78,65 +79,66 @@ static void init_class(grib_action_class* c) } /* END_CLASS_IMP */ -grib_action* grib_action_create_set( grib_context* context, - const char* name, grib_expression* expression,int nofail) +grib_action* grib_action_create_set(grib_context* context, + const char* name, grib_expression* expression, int nofail) { char buf[1024]; - grib_action_set* a ; - grib_action_class* c = grib_action_class_set; - grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context,c->size); - act->op = grib_context_strdup_persistent(context,"section"); + grib_action_set* a; + grib_action_class* c = grib_action_class_set; + grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context, c->size); + act->op = grib_context_strdup_persistent(context, "section"); - act->cclass = c; - a = (grib_action_set*)act; - act->context = context; + act->cclass = c; + a = (grib_action_set*)act; + act->context = context; - a->expression = expression; - a->name = grib_context_strdup_persistent(context,name); - a->nofail = nofail; + a->expression = expression; + a->name = grib_context_strdup_persistent(context, name); + a->nofail = nofail; - sprintf(buf,"set%p",(void*)expression); + sprintf(buf, "set%p", (void*)expression); - act->name = grib_context_strdup_persistent(context,buf); + act->name = grib_context_strdup_persistent(context, buf); return act; } -static int execute(grib_action* a, grib_handle *h) +static int execute(grib_action* a, grib_handle* h) { - int ret=0; - grib_action_set* self = (grib_action_set*) a; - ret=grib_set_expression(h,self->name,self->expression); - if (self->nofail) return 0; + int ret = 0; + grib_action_set* self = (grib_action_set*)a; + ret = grib_set_expression(h, self->name, self->expression); + if (self->nofail) + return 0; if (ret != GRIB_SUCCESS) { - grib_context_log(h->context,GRIB_LOG_ERROR,"Error while setting key %s (%s)", - self->name,grib_get_error_message(ret)); + grib_context_log(h->context, GRIB_LOG_ERROR, "Error while setting key %s (%s)", + self->name, grib_get_error_message(ret)); } return ret; } static void dump(grib_action* act, FILE* f, int lvl) { - int i =0; - grib_action_set* self=(grib_action_set*)act; - for (i=0;icontext,f," "); - grib_context_print(act->context,f,self->name); + int i = 0; + grib_action_set* self = (grib_action_set*)act; + for (i = 0; i < lvl; i++) + grib_context_print(act->context, f, " "); + grib_context_print(act->context, f, self->name); printf("\n"); } -static void destroy(grib_context* context,grib_action* act) +static void destroy(grib_context* context, grib_action* act) { - grib_action_set* a = (grib_action_set*) act; + grib_action_set* a = (grib_action_set*)act; grib_context_free_persistent(context, a->name); - grib_expression_free(context,a->expression); + grib_expression_free(context, a->expression); grib_context_free_persistent(context, act->name); grib_context_free_persistent(context, act->op); } -static void xref(grib_action* d, FILE* f,const char *path) +static void xref(grib_action* d, FILE* f, const char* path) { } diff --git a/src/action_class_set_darray.c b/src/action_class_set_darray.c index d5941638b..bac34f26c 100644 --- a/src/action_class_set_darray.c +++ b/src/action_class_set_darray.c @@ -35,38 +35,39 @@ or edit "action.class" and rerun ./make_class.pl */ -static void init_class (grib_action_class*); -static void dump (grib_action* d, FILE*,int); -static void xref (grib_action* d, FILE* f,const char* path); -static void destroy (grib_context*,grib_action*); -static int execute(grib_action* a,grib_handle* h); - - -typedef struct grib_action_set_darray { - grib_action act; -/* Members defined in set_darray */ - grib_darray *darray; - char *name; +static void init_class(grib_action_class*); +static void dump(grib_action* d, FILE*, int); +static void xref(grib_action* d, FILE* f, const char* path); +static void destroy(grib_context*, grib_action*); +static int execute(grib_action* a, grib_handle* h); + + +typedef struct grib_action_set_darray +{ + grib_action act; + /* Members defined in set_darray */ + grib_darray* darray; + char* name; } grib_action_set_darray; static grib_action_class _grib_action_class_set_darray = { 0, /* super */ - "action_class_set_darray", /* name */ - sizeof(grib_action_set_darray), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - &destroy, /* destroy */ + "action_class_set_darray", /* name */ + sizeof(grib_action_set_darray), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + &destroy, /* destroy */ - &dump, /* dump */ - &xref, /* xref */ + &dump, /* dump */ + &xref, /* xref */ - 0, /* create_accessor*/ + 0, /* create_accessor*/ - 0, /* notify_change */ - 0, /* reparse */ - &execute, /* execute */ + 0, /* notify_change */ + 0, /* reparse */ + &execute, /* execute */ }; grib_action_class* grib_action_class_set_darray = &_grib_action_class_set_darray; @@ -76,59 +77,59 @@ static void init_class(grib_action_class* c) } /* END_CLASS_IMP */ -grib_action* grib_action_create_set_darray( grib_context* context, - const char* name, - grib_darray* darray) +grib_action* grib_action_create_set_darray(grib_context* context, + const char* name, + grib_darray* darray) { char buf[1024]; - grib_action_set_darray* a ; - grib_action_class* c = grib_action_class_set_darray; - grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context,c->size); - act->op = grib_context_strdup_persistent(context,"section"); + grib_action_set_darray* a; + grib_action_class* c = grib_action_class_set_darray; + grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context, c->size); + act->op = grib_context_strdup_persistent(context, "section"); - act->cclass = c; - a = (grib_action_set_darray*)act; - act->context = context; + act->cclass = c; + a = (grib_action_set_darray*)act; + act->context = context; - a->darray = darray; - a->name = grib_context_strdup_persistent(context,name); + a->darray = darray; + a->name = grib_context_strdup_persistent(context, name); - sprintf(buf,"set_darray%p",(void*)darray); + sprintf(buf, "set_darray%p", (void*)darray); - act->name = grib_context_strdup_persistent(context,buf); + act->name = grib_context_strdup_persistent(context, buf); return act; } -static int execute(grib_action* a, grib_handle *h) +static int execute(grib_action* a, grib_handle* h) { - grib_action_set_darray* self = (grib_action_set_darray*) a; + grib_action_set_darray* self = (grib_action_set_darray*)a; - return grib_set_double_array(h,self->name,self->darray->v,self->darray->n); + return grib_set_double_array(h, self->name, self->darray->v, self->darray->n); } static void dump(grib_action* act, FILE* f, int lvl) { - int i =0; - grib_action_set_darray* self=(grib_action_set_darray*)act; - for (i=0;icontext,f," "); - grib_context_print(act->context,f,self->name); + int i = 0; + grib_action_set_darray* self = (grib_action_set_darray*)act; + for (i = 0; i < lvl; i++) + grib_context_print(act->context, f, " "); + grib_context_print(act->context, f, self->name); printf("\n"); } -static void destroy(grib_context* context,grib_action* act) +static void destroy(grib_context* context, grib_action* act) { - grib_action_set_darray* a = (grib_action_set_darray*) act; + grib_action_set_darray* a = (grib_action_set_darray*)act; grib_context_free_persistent(context, a->name); - grib_darray_delete(context,a->darray); + grib_darray_delete(context, a->darray); grib_context_free_persistent(context, act->name); grib_context_free_persistent(context, act->op); } -static void xref(grib_action* d, FILE* f,const char *path) +static void xref(grib_action* d, FILE* f, const char* path) { } diff --git a/src/action_class_set_iarray.c b/src/action_class_set_iarray.c index f5971f7f7..d0c52f0fb 100644 --- a/src/action_class_set_iarray.c +++ b/src/action_class_set_iarray.c @@ -35,38 +35,39 @@ or edit "action.class" and rerun ./make_class.pl */ -static void init_class (grib_action_class*); -static void dump (grib_action* d, FILE*,int); -static void xref (grib_action* d, FILE* f,const char* path); -static void destroy (grib_context*,grib_action*); -static int execute(grib_action* a,grib_handle* h); - - -typedef struct grib_action_set_iarray { - grib_action act; -/* Members defined in set_iarray */ - grib_iarray *iarray; - char *name; +static void init_class(grib_action_class*); +static void dump(grib_action* d, FILE*, int); +static void xref(grib_action* d, FILE* f, const char* path); +static void destroy(grib_context*, grib_action*); +static int execute(grib_action* a, grib_handle* h); + + +typedef struct grib_action_set_iarray +{ + grib_action act; + /* Members defined in set_iarray */ + grib_iarray* iarray; + char* name; } grib_action_set_iarray; static grib_action_class _grib_action_class_set_iarray = { 0, /* super */ - "action_class_set_iarray", /* name */ - sizeof(grib_action_set_iarray), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - &destroy, /* destroy */ + "action_class_set_iarray", /* name */ + sizeof(grib_action_set_iarray), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + &destroy, /* destroy */ - &dump, /* dump */ - &xref, /* xref */ + &dump, /* dump */ + &xref, /* xref */ - 0, /* create_accessor*/ + 0, /* create_accessor*/ - 0, /* notify_change */ - 0, /* reparse */ - &execute, /* execute */ + 0, /* notify_change */ + 0, /* reparse */ + &execute, /* execute */ }; grib_action_class* grib_action_class_set_iarray = &_grib_action_class_set_iarray; @@ -76,52 +77,52 @@ static void init_class(grib_action_class* c) } /* END_CLASS_IMP */ -grib_action* grib_action_create_set_iarray( grib_context* context, - const char* name, - grib_iarray* iarray) +grib_action* grib_action_create_set_iarray(grib_context* context, + const char* name, + grib_iarray* iarray) { char buf[1024]; - grib_action_set_iarray* a ; - grib_action_class* c = grib_action_class_set_iarray; - grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context,c->size); - act->op = grib_context_strdup_persistent(context,"section"); + grib_action_set_iarray* a; + grib_action_class* c = grib_action_class_set_iarray; + grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context, c->size); + act->op = grib_context_strdup_persistent(context, "section"); - act->cclass = c; - a = (grib_action_set_iarray*)act; - act->context = context; + act->cclass = c; + a = (grib_action_set_iarray*)act; + act->context = context; - a->iarray = iarray; - a->name = grib_context_strdup_persistent(context,name); + a->iarray = iarray; + a->name = grib_context_strdup_persistent(context, name); - sprintf(buf,"set_iarray%p",(void*)iarray); + sprintf(buf, "set_iarray%p", (void*)iarray); - act->name = grib_context_strdup_persistent(context,buf); + act->name = grib_context_strdup_persistent(context, buf); return act; } -static int execute(grib_action* a, grib_handle *h) +static int execute(grib_action* a, grib_handle* h) { - grib_action_set_iarray* self = (grib_action_set_iarray*) a; + grib_action_set_iarray* self = (grib_action_set_iarray*)a; - return grib_set_long_array(h,self->name,self->iarray->v,self->iarray->n); + return grib_set_long_array(h, self->name, self->iarray->v, self->iarray->n); } static void dump(grib_action* act, FILE* f, int lvl) { - int i =0; - grib_action_set_iarray* self=(grib_action_set_iarray*)act; - for (i=0;icontext,f," "); - grib_context_print(act->context,f,self->name); + int i = 0; + grib_action_set_iarray* self = (grib_action_set_iarray*)act; + for (i = 0; i < lvl; i++) + grib_context_print(act->context, f, " "); + grib_context_print(act->context, f, self->name); printf("\n"); } -static void destroy(grib_context* context,grib_action* act) +static void destroy(grib_context* context, grib_action* act) { - grib_action_set_iarray* a = (grib_action_set_iarray*) act; + grib_action_set_iarray* a = (grib_action_set_iarray*)act; grib_context_free_persistent(context, a->name); grib_iarray_delete(a->iarray); @@ -129,6 +130,6 @@ static void destroy(grib_context* context,grib_action* act) grib_context_free_persistent(context, act->op); } -static void xref(grib_action* d, FILE* f,const char *path) +static void xref(grib_action* d, FILE* f, const char* path) { } diff --git a/src/action_class_set_missing.c b/src/action_class_set_missing.c index 73d75057c..7ba4c2a18 100644 --- a/src/action_class_set_missing.c +++ b/src/action_class_set_missing.c @@ -34,36 +34,37 @@ or edit "action.class" and rerun ./make_class.pl */ -static void init_class (grib_action_class*); -static void dump (grib_action* d, FILE*,int); -static void destroy (grib_context*,grib_action*); -static int execute(grib_action* a,grib_handle* h); +static void init_class(grib_action_class*); +static void dump(grib_action* d, FILE*, int); +static void destroy(grib_context*, grib_action*); +static int execute(grib_action* a, grib_handle* h); -typedef struct grib_action_set_missing { - grib_action act; -/* Members defined in set_missing */ - char *name; +typedef struct grib_action_set_missing +{ + grib_action act; + /* Members defined in set_missing */ + char* name; } grib_action_set_missing; static grib_action_class _grib_action_class_set_missing = { - 0, /* super */ - "action_class_set_missing", /* name */ - sizeof(grib_action_set_missing), /* size */ - 0, /* inited */ - &init_class, /* init_class */ + 0, /* super */ + "action_class_set_missing", /* name */ + sizeof(grib_action_set_missing), /* size */ + 0, /* inited */ + &init_class, /* init_class */ 0, /* init */ - &destroy, /* destroy */ + &destroy, /* destroy */ - &dump, /* dump */ - 0, /* xref */ + &dump, /* dump */ + 0, /* xref */ - 0, /* create_accessor*/ + 0, /* create_accessor*/ - 0, /* notify_change */ - 0, /* reparse */ - &execute, /* execute */ + 0, /* notify_change */ + 0, /* reparse */ + &execute, /* execute */ }; grib_action_class* grib_action_class_set_missing = &_grib_action_class_set_missing; @@ -73,49 +74,49 @@ static void init_class(grib_action_class* c) } /* END_CLASS_IMP */ -grib_action* grib_action_create_set_missing( grib_context* context, - const char* name) +grib_action* grib_action_create_set_missing(grib_context* context, + const char* name) { char buf[1024]; - grib_action_set_missing* a ; - grib_action_class* c = grib_action_class_set_missing; - grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context,c->size); - act->op = grib_context_strdup_persistent(context,"set_missing"); + grib_action_set_missing* a; + grib_action_class* c = grib_action_class_set_missing; + grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context, c->size); + act->op = grib_context_strdup_persistent(context, "set_missing"); - act->cclass = c; - a = (grib_action_set_missing*)act; - act->context = context; + act->cclass = c; + a = (grib_action_set_missing*)act; + act->context = context; - a->name = grib_context_strdup_persistent(context,name); + a->name = grib_context_strdup_persistent(context, name); - sprintf(buf,"set_missing_%s",name); + sprintf(buf, "set_missing_%s", name); - act->name = grib_context_strdup_persistent(context,buf); + act->name = grib_context_strdup_persistent(context, buf); return act; } -static int execute(grib_action* a, grib_handle *h) +static int execute(grib_action* a, grib_handle* h) { - grib_action_set_missing* self = (grib_action_set_missing*) a; + grib_action_set_missing* self = (grib_action_set_missing*)a; - return grib_set_missing(h,self->name); + return grib_set_missing(h, self->name); } static void dump(grib_action* act, FILE* f, int lvl) { - int i =0; - grib_action_set_missing* self=(grib_action_set_missing*)act; - for (i=0;icontext,f," "); - grib_context_print(act->context,f,self->name); + int i = 0; + grib_action_set_missing* self = (grib_action_set_missing*)act; + for (i = 0; i < lvl; i++) + grib_context_print(act->context, f, " "); + grib_context_print(act->context, f, self->name); printf("\n"); } -static void destroy(grib_context* context,grib_action* act) +static void destroy(grib_context* context, grib_action* act) { - grib_action_set_missing* a = (grib_action_set_missing*) act; + grib_action_set_missing* a = (grib_action_set_missing*)act; grib_context_free_persistent(context, a->name); grib_context_free_persistent(context, act->name); diff --git a/src/action_class_set_sarray.c b/src/action_class_set_sarray.c index 48f621c91..02d51d5f1 100644 --- a/src/action_class_set_sarray.c +++ b/src/action_class_set_sarray.c @@ -35,38 +35,39 @@ or edit "action.class" and rerun ./make_class.pl */ -static void init_class (grib_action_class*); -static void dump (grib_action* d, FILE*,int); -static void xref (grib_action* d, FILE* f,const char* path); -static void destroy (grib_context*,grib_action*); -static int execute(grib_action* a,grib_handle* h); - - -typedef struct grib_action_set_sarray { - grib_action act; -/* Members defined in set_sarray */ - grib_sarray *sarray; - char *name; +static void init_class(grib_action_class*); +static void dump(grib_action* d, FILE*, int); +static void xref(grib_action* d, FILE* f, const char* path); +static void destroy(grib_context*, grib_action*); +static int execute(grib_action* a, grib_handle* h); + + +typedef struct grib_action_set_sarray +{ + grib_action act; + /* Members defined in set_sarray */ + grib_sarray* sarray; + char* name; } grib_action_set_sarray; static grib_action_class _grib_action_class_set_sarray = { 0, /* super */ - "action_class_set_sarray", /* name */ - sizeof(grib_action_set_sarray), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - &destroy, /* destroy */ + "action_class_set_sarray", /* name */ + sizeof(grib_action_set_sarray), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + &destroy, /* destroy */ - &dump, /* dump */ - &xref, /* xref */ + &dump, /* dump */ + &xref, /* xref */ - 0, /* create_accessor*/ + 0, /* create_accessor*/ - 0, /* notify_change */ - 0, /* reparse */ - &execute, /* execute */ + 0, /* notify_change */ + 0, /* reparse */ + &execute, /* execute */ }; grib_action_class* grib_action_class_set_sarray = &_grib_action_class_set_sarray; @@ -76,59 +77,59 @@ static void init_class(grib_action_class* c) } /* END_CLASS_IMP */ -grib_action* grib_action_create_set_sarray( grib_context* context, - const char* name, - grib_sarray* sarray) +grib_action* grib_action_create_set_sarray(grib_context* context, + const char* name, + grib_sarray* sarray) { char buf[1024]; - grib_action_set_sarray* a ; - grib_action_class* c = grib_action_class_set_sarray; - grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context,c->size); - act->op = grib_context_strdup_persistent(context,"section"); + grib_action_set_sarray* a; + grib_action_class* c = grib_action_class_set_sarray; + grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context, c->size); + act->op = grib_context_strdup_persistent(context, "section"); - act->cclass = c; - a = (grib_action_set_sarray*)act; - act->context = context; + act->cclass = c; + a = (grib_action_set_sarray*)act; + act->context = context; - a->sarray = sarray; - a->name = grib_context_strdup_persistent(context,name); + a->sarray = sarray; + a->name = grib_context_strdup_persistent(context, name); - sprintf(buf,"set_sarray%p",(void*)sarray); + sprintf(buf, "set_sarray%p", (void*)sarray); - act->name = grib_context_strdup_persistent(context,buf); + act->name = grib_context_strdup_persistent(context, buf); return act; } -static int execute(grib_action* a, grib_handle *h) +static int execute(grib_action* a, grib_handle* h) { - grib_action_set_sarray* self = (grib_action_set_sarray*) a; + grib_action_set_sarray* self = (grib_action_set_sarray*)a; return grib_set_string_array(h, self->name, (const char**)self->sarray->v, self->sarray->n); } static void dump(grib_action* act, FILE* f, int lvl) { - int i =0; - grib_action_set_sarray* self=(grib_action_set_sarray*)act; - for (i=0;icontext,f," "); - grib_context_print(act->context,f,self->name); + int i = 0; + grib_action_set_sarray* self = (grib_action_set_sarray*)act; + for (i = 0; i < lvl; i++) + grib_context_print(act->context, f, " "); + grib_context_print(act->context, f, self->name); printf("\n"); } -static void destroy(grib_context* context,grib_action* act) +static void destroy(grib_context* context, grib_action* act) { - grib_action_set_sarray* a = (grib_action_set_sarray*) act; + grib_action_set_sarray* a = (grib_action_set_sarray*)act; grib_context_free_persistent(context, a->name); - grib_sarray_delete(context,a->sarray); + grib_sarray_delete(context, a->sarray); grib_context_free_persistent(context, act->name); grib_context_free_persistent(context, act->op); } -static void xref(grib_action* d, FILE* f,const char *path) +static void xref(grib_action* d, FILE* f, const char* path) { } diff --git a/src/action_class_switch.c b/src/action_class_switch.c index 734e08a24..8d31c3a38 100644 --- a/src/action_class_switch.c +++ b/src/action_class_switch.c @@ -39,196 +39,209 @@ or edit "action.class" and rerun ./make_class.pl */ -static void init_class (grib_action_class*); -static void xref (grib_action* d, FILE* f,const char* path); -static void destroy (grib_context*,grib_action*); -static int execute(grib_action* a,grib_handle* h); - - -typedef struct grib_action_switch { - grib_action act; -/* Members defined in section */ -/* Members defined in switch */ - grib_arguments* args; - grib_case *Case; - grib_action *Default; +static void init_class(grib_action_class*); +static void xref(grib_action* d, FILE* f, const char* path); +static void destroy(grib_context*, grib_action*); +static int execute(grib_action* a, grib_handle* h); + + +typedef struct grib_action_switch +{ + grib_action act; + /* Members defined in section */ + /* Members defined in switch */ + grib_arguments* args; + grib_case* Case; + grib_action* Default; } grib_action_switch; extern grib_action_class* grib_action_class_section; static grib_action_class _grib_action_class_switch = { - &grib_action_class_section, /* super */ - "action_class_switch", /* name */ - sizeof(grib_action_switch), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - &destroy, /* destroy */ - - 0, /* dump */ - &xref, /* xref */ - - 0, /* create_accessor*/ - - 0, /* notify_change */ - 0, /* reparse */ - &execute, /* execute */ + &grib_action_class_section, /* super */ + "action_class_switch", /* name */ + sizeof(grib_action_switch), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + &destroy, /* destroy */ + + 0, /* dump */ + &xref, /* xref */ + + 0, /* create_accessor*/ + + 0, /* notify_change */ + 0, /* reparse */ + &execute, /* execute */ }; grib_action_class* grib_action_class_switch = &_grib_action_class_switch; static void init_class(grib_action_class* c) { - c->dump = (*(c->super))->dump; - c->create_accessor = (*(c->super))->create_accessor; - c->notify_change = (*(c->super))->notify_change; - c->reparse = (*(c->super))->reparse; + c->dump = (*(c->super))->dump; + c->create_accessor = (*(c->super))->create_accessor; + c->notify_change = (*(c->super))->notify_change; + c->reparse = (*(c->super))->reparse; } /* END_CLASS_IMP */ -grib_action* grib_action_create_switch( grib_context* context, - grib_arguments* args, - grib_case* Case, - grib_action* Default) -{ char name[1024]; -grib_action_switch* a ; -grib_action_class* c = grib_action_class_switch; -grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context,c->size); -act->op = grib_context_strdup_persistent(context,"section"); +grib_action* grib_action_create_switch(grib_context* context, + grib_arguments* args, + grib_case* Case, + grib_action* Default) +{ + char name[1024]; + grib_action_switch* a; + grib_action_class* c = grib_action_class_switch; + grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context, c->size); + act->op = grib_context_strdup_persistent(context, "section"); -act->cclass = c; -a = (grib_action_switch*)act; -act->context = context; + act->cclass = c; + a = (grib_action_switch*)act; + act->context = context; -a->args = args; -a->Case = Case; -a->Default = Default; + a->args = args; + a->Case = Case; + a->Default = Default; -sprintf(name,"_switch%p",(void*)a); + sprintf(name, "_switch%p", (void*)a); -act->name = grib_context_strdup_persistent(context,name); + act->name = grib_context_strdup_persistent(context, name); -return act; + return act; } -grib_case* grib_case_new(grib_context* c,grib_arguments* values,grib_action* action) +grib_case* grib_case_new(grib_context* c, grib_arguments* values, grib_action* action) { - grib_case* Case = (grib_case*)grib_context_malloc_clear_persistent(c,sizeof(grib_case)); + grib_case* Case = (grib_case*)grib_context_malloc_clear_persistent(c, sizeof(grib_case)); - Case->values=values; - Case->action=action; + Case->values = values; + Case->action = action; return Case; } -static int execute(grib_action* act, grib_handle *h) { +static int execute(grib_action* act, grib_handle* h) +{ grib_action_switch* a = (grib_action_switch*)act; - grib_case* c=a->Case; - grib_action* next = a->Default; - grib_arguments* args=a->args; + grib_case* c = a->Case; + grib_action* next = a->Default; + grib_arguments* args = a->args; grib_arguments* values; grib_expression* e; grib_expression* value; - int ret = 0; - long lres=0; - double dres=0; - long lval=0; - double dval=0; - int type=0; - int ok=0; - const char *cval; - const char *cres; + int ret = 0; + long lres = 0; + double dres = 0; + long lval = 0; + double dval = 0; + int type = 0; + int ok = 0; + const char* cval; + const char* cres; char buf[80]; char tmp[80]; - size_t len = sizeof(buf); - size_t size=sizeof(tmp); - int err=0; + size_t len = sizeof(buf); + size_t size = sizeof(tmp); + int err = 0; Assert(args); while (c) { - e=args->expression; - values=c->values; - value=values->expression; - ok=0; + e = args->expression; + values = c->values; + value = values->expression; + ok = 0; while (e && value) { - if (!strcmp(value->cclass->name,"true")) ok=1; + if (!strcmp(value->cclass->name, "true")) + ok = 1; else { - type=grib_expression_native_type(h,value); - - switch(type) { - case GRIB_TYPE_LONG: - ok= ( grib_expression_evaluate_long(h,value,&lres) == GRIB_SUCCESS) && - ( grib_expression_evaluate_long(h,e,&lval) == GRIB_SUCCESS) && - (lval == lres); - break; - - case GRIB_TYPE_DOUBLE: - ok = ( grib_expression_evaluate_double(h,value,&dres) == GRIB_SUCCESS) && - ( grib_expression_evaluate_double(h,e,&dval) == GRIB_SUCCESS) && - (dval == dres); - break; - - case GRIB_TYPE_STRING: - len = sizeof(buf); - size=sizeof(tmp); - ok = ((cres=grib_expression_evaluate_string(h,e,buf,&len,&err)) != NULL ) && - (err==0) && ((cval = grib_expression_evaluate_string(h,value,tmp,&size,&err)) != NULL) && - (err==0) && ((strcmp(buf,cval) == 0) || (strcmp(cval,"*")==0)); - break; - - default: - /* TODO: */ - break; + type = grib_expression_native_type(h, value); + + switch (type) { + case GRIB_TYPE_LONG: + ok = (grib_expression_evaluate_long(h, value, &lres) == GRIB_SUCCESS) && + (grib_expression_evaluate_long(h, e, &lval) == GRIB_SUCCESS) && + (lval == lres); + break; + + case GRIB_TYPE_DOUBLE: + ok = (grib_expression_evaluate_double(h, value, &dres) == GRIB_SUCCESS) && + (grib_expression_evaluate_double(h, e, &dval) == GRIB_SUCCESS) && + (dval == dres); + break; + + case GRIB_TYPE_STRING: + len = sizeof(buf); + size = sizeof(tmp); + ok = ((cres = grib_expression_evaluate_string(h, e, buf, &len, &err)) != NULL) && + (err == 0) && ((cval = grib_expression_evaluate_string(h, value, tmp, &size, &err)) != NULL) && + (err == 0) && ((strcmp(buf, cval) == 0) || (strcmp(cval, "*") == 0)); + break; + + default: + /* TODO: */ + break; } } - if (!ok) break; - - args=args->next; - if (args) e=args->expression; - else e=NULL; - - values=values->next; - if (values) value=values->expression; - else value=NULL; + if (!ok) + break; + + args = args->next; + if (args) + e = args->expression; + else + e = NULL; + + values = values->next; + if (values) + value = values->expression; + else + value = NULL; } - if(ok) { next=c->action; break; } + if (ok) { + next = c->action; + break; + } - c=c->next; + c = c->next; } - if (!next) return GRIB_SWITCH_NO_MATCH; + if (!next) + return GRIB_SWITCH_NO_MATCH; - while(next){ + while (next) { ret = grib_action_execute(next, h); - if(ret != GRIB_SUCCESS) return ret; - next= next->next; + if (ret != GRIB_SUCCESS) + return ret; + next = next->next; } return GRIB_SUCCESS; } -static void destroy(grib_context* context,grib_action* act) +static void destroy(grib_context* context, grib_action* act) { - grib_action_switch* a = (grib_action_switch*) act; - grib_case *t = a->Case; - - while(t) - { - grib_case *nt = t->next; - grib_action_delete(context,t->action); - grib_arguments_free(context,t->values); - grib_context_free(context,t); + grib_action_switch* a = (grib_action_switch*)act; + grib_case* t = a->Case; + + while (t) { + grib_case* nt = t->next; + grib_action_delete(context, t->action); + grib_arguments_free(context, t->values); + grib_context_free(context, t); t = nt; } - grib_action_delete(context,a->Default); + grib_action_delete(context, a->Default); grib_context_free_persistent(context, act->name); grib_context_free_persistent(context, act->op); } -static void xref(grib_action* d, FILE* f,const char* path) +static void xref(grib_action* d, FILE* f, const char* path) { } diff --git a/src/action_class_template.c b/src/action_class_template.c index 24aef7ae7..1a31356b9 100644 --- a/src/action_class_template.c +++ b/src/action_class_template.c @@ -41,164 +41,172 @@ or edit "action.class" and rerun ./make_class.pl */ -static void init_class (grib_action_class*); -static void dump (grib_action* d, FILE*,int); -static void destroy (grib_context*,grib_action*); -static int create_accessor(grib_section*,grib_action*,grib_loader*); -static grib_action* reparse(grib_action* a,grib_accessor* acc,int *doit); - - -typedef struct grib_action_template { - grib_action act; -/* Members defined in section */ -/* Members defined in template */ - int nofail; - char* arg; +static void init_class(grib_action_class*); +static void dump(grib_action* d, FILE*, int); +static void destroy(grib_context*, grib_action*); +static int create_accessor(grib_section*, grib_action*, grib_loader*); +static grib_action* reparse(grib_action* a, grib_accessor* acc, int* doit); + + +typedef struct grib_action_template +{ + grib_action act; + /* Members defined in section */ + /* Members defined in template */ + int nofail; + char* arg; } grib_action_template; extern grib_action_class* grib_action_class_section; static grib_action_class _grib_action_class_template = { - &grib_action_class_section, /* super */ - "action_class_template", /* name */ - sizeof(grib_action_template), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - &destroy, /* destroy */ - - &dump, /* dump */ - 0, /* xref */ - - &create_accessor, /* create_accessor*/ - - 0, /* notify_change */ - &reparse, /* reparse */ - 0, /* execute */ + &grib_action_class_section, /* super */ + "action_class_template", /* name */ + sizeof(grib_action_template), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + &destroy, /* destroy */ + + &dump, /* dump */ + 0, /* xref */ + + &create_accessor, /* create_accessor*/ + + 0, /* notify_change */ + &reparse, /* reparse */ + 0, /* execute */ }; grib_action_class* grib_action_class_template = &_grib_action_class_template; static void init_class(grib_action_class* c) { - c->xref = (*(c->super))->xref; - c->notify_change = (*(c->super))->notify_change; - c->execute = (*(c->super))->execute; + c->xref = (*(c->super))->xref; + c->notify_change = (*(c->super))->notify_change; + c->execute = (*(c->super))->execute; } /* END_CLASS_IMP */ -grib_action* grib_action_create_template( grib_context* context,int nofail,const char* name , const char* arg1) +grib_action* grib_action_create_template(grib_context* context, int nofail, const char* name, const char* arg1) { - grib_action_template* a ; - grib_action_class* c = grib_action_class_template; - grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context,c->size); - act-> name = grib_context_strdup_persistent(context,name); - act-> op = grib_context_strdup_persistent(context,"section"); - act-> cclass = c; - act-> next = NULL; - act->context = context; - a = (grib_action_template*)act; - a->nofail=nofail; - if (arg1) a->arg = grib_context_strdup_persistent(context,arg1); - else a->arg = NULL; + grib_action_template* a; + grib_action_class* c = grib_action_class_template; + grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context, c->size); + act->name = grib_context_strdup_persistent(context, name); + act->op = grib_context_strdup_persistent(context, "section"); + act->cclass = c; + act->next = NULL; + act->context = context; + a = (grib_action_template*)act; + a->nofail = nofail; + if (arg1) + a->arg = grib_context_strdup_persistent(context, arg1); + else + a->arg = NULL; return act; } -static void dump( grib_action* act, FILE* f, int lvl) +static void dump(grib_action* act, FILE* f, int lvl) { - grib_action_template* a = ( grib_action_template*)act; - int i = 0; - for (i=0;icontext,f," "); - grib_context_print(act->context,f,"Template %s %s\n",act->name , a->arg ); + grib_action_template* a = (grib_action_template*)act; + int i = 0; + for (i = 0; i < lvl; i++) + grib_context_print(act->context, f, " "); + grib_context_print(act->context, f, "Template %s %s\n", act->name, a->arg); } -grib_action* get_empty_template(grib_context* c,int *err) +grib_action* get_empty_template(grib_context* c, int* err) { - char fname[]="empty_template.def"; - char* path=0; + char fname[] = "empty_template.def"; + char* path = 0; - path=grib_context_full_defs_path(c,fname); + path = grib_context_full_defs_path(c, fname); if (path) { - *err=GRIB_SUCCESS; + *err = GRIB_SUCCESS; return grib_parse_file(c, path); - } else { - *err=GRIB_INTERNAL_ERROR; - grib_context_log(c,GRIB_LOG_ERROR,"get_empty_template: unable to get template %s",fname); + } + else { + *err = GRIB_INTERNAL_ERROR; + grib_context_log(c, GRIB_LOG_ERROR, "get_empty_template: unable to get template %s", fname); return NULL; } } -static int create_accessor(grib_section* p, grib_action* act, grib_loader *h) +static int create_accessor(grib_section* p, grib_action* act, grib_loader* h) { - int ret = GRIB_SUCCESS; - grib_action_template* a = ( grib_action_template*)act; - grib_action* la = NULL; - grib_action* next = NULL; - grib_accessor* as = NULL; - grib_section* gs = NULL; + int ret = GRIB_SUCCESS; + grib_action_template* a = (grib_action_template*)act; + grib_action* la = NULL; + grib_action* next = NULL; + grib_accessor* as = NULL; + grib_section* gs = NULL; - char fname[1024]={0,}; - char *fpath=0; + char fname[1024] = {0,}; + char* fpath = 0; - as = grib_accessor_factory(p, act,0,NULL); + as = grib_accessor_factory(p, act, 0, NULL); - if(!as) return GRIB_INTERNAL_ERROR; - if(a->arg){ - ret = grib_recompose_name(p->h,as,a->arg,fname,1); + if (!as) + return GRIB_INTERNAL_ERROR; + if (a->arg) { + ret = grib_recompose_name(p->h, as, a->arg, fname, 1); - if ((fpath=grib_context_full_defs_path(p->h->context,fname))==NULL) { + if ((fpath = grib_context_full_defs_path(p->h->context, fname)) == NULL) { if (!a->nofail) { - grib_context_log(p->h->context,GRIB_LOG_ERROR, - "Unable to find template %s from %s ",act->name,fname); + grib_context_log(p->h->context, GRIB_LOG_ERROR, + "Unable to find template %s from %s ", act->name, fname); return GRIB_FILE_NOT_FOUND; } - la = get_empty_template(p->h->context,&ret); - if (ret) return ret; - } else + la = get_empty_template(p->h->context, &ret); + if (ret) + return ret; + } + else la = grib_parse_file(p->h->context, fpath); } as->flags |= GRIB_ACCESSOR_FLAG_HIDDEN; - gs = as->sub_section; + gs = as->sub_section; gs->branch = la; /* Will be used to prevent unnecessary reparse */ - grib_push_accessor(as,p->block); + grib_push_accessor(as, p->block); - if(la){ + if (la) { next = la; - while(next){ - ret = grib_create_accessor(gs, next,h); - if(ret != GRIB_SUCCESS) { - if(p->h->context->debug) - { - grib_context_log(p->h->context,GRIB_LOG_ERROR, - "Error processing template %s: %s [%s] %04lx", - fname,grib_get_error_message(ret),next->name,next->flags); + while (next) { + ret = grib_create_accessor(gs, next, h); + if (ret != GRIB_SUCCESS) { + if (p->h->context->debug) { + grib_context_log(p->h->context, GRIB_LOG_ERROR, + "Error processing template %s: %s [%s] %04lx", + fname, grib_get_error_message(ret), next->name, next->flags); } return ret; } - next= next->next; + next = next->next; } } return GRIB_SUCCESS; } -static grib_action* reparse(grib_action* a,grib_accessor* acc,int *doit) +static grib_action* reparse(grib_action* a, grib_accessor* acc, int* doit) { grib_action_template* self = (grib_action_template*)a; - char *fpath=0; + char* fpath = 0; - if(self->arg){ + if (self->arg) { char fname[1024]; - grib_recompose_name(grib_handle_of_accessor(acc),NULL,self->arg,fname,1); + grib_recompose_name(grib_handle_of_accessor(acc), NULL, self->arg, fname, 1); - if ((fpath=grib_context_full_defs_path(acc->context,fname))==NULL) { + if ((fpath = grib_context_full_defs_path(acc->context, fname)) == NULL) { if (!self->nofail) { - grib_context_log(acc->context,GRIB_LOG_ERROR, - "Unable to find template %s from %s ",a->name,fname); + grib_context_log(acc->context, GRIB_LOG_ERROR, + "Unable to find template %s from %s ", a->name, fname); return NULL; - } return a; + } + return a; } /* printf("REPARSE %s\n",fpath); */ @@ -208,7 +216,7 @@ static grib_action* reparse(grib_action* a,grib_accessor* acc,int *doit) return NULL; } -static void destroy(grib_context* context,grib_action* act) +static void destroy(grib_context* context, grib_action* act) { grib_action_template* a = (grib_action_template*)act; diff --git a/src/action_class_transient_darray.c b/src/action_class_transient_darray.c index ca1f66566..c4c469ae2 100644 --- a/src/action_class_transient_darray.c +++ b/src/action_class_transient_darray.c @@ -36,112 +36,114 @@ or edit "action.class" and rerun ./make_class.pl */ -static void init_class (grib_action_class*); -static void dump (grib_action* d, FILE*,int); -static void xref (grib_action* d, FILE* f,const char* path); -static void destroy (grib_context*,grib_action*); -static int execute(grib_action* a,grib_handle* h); - - -typedef struct grib_action_transient_darray { - grib_action act; -/* Members defined in gen */ - long len; - grib_arguments* params; -/* Members defined in transient_darray */ - grib_darray *darray; - char *name; +static void init_class(grib_action_class*); +static void dump(grib_action* d, FILE*, int); +static void xref(grib_action* d, FILE* f, const char* path); +static void destroy(grib_context*, grib_action*); +static int execute(grib_action* a, grib_handle* h); + + +typedef struct grib_action_transient_darray +{ + grib_action act; + /* Members defined in gen */ + long len; + grib_arguments* params; + /* Members defined in transient_darray */ + grib_darray* darray; + char* name; } grib_action_transient_darray; extern grib_action_class* grib_action_class_gen; static grib_action_class _grib_action_class_transient_darray = { - &grib_action_class_gen, /* super */ - "action_class_transient_darray", /* name */ - sizeof(grib_action_transient_darray), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - &destroy, /* destroy */ - - &dump, /* dump */ - &xref, /* xref */ - - 0, /* create_accessor*/ - - 0, /* notify_change */ - 0, /* reparse */ - &execute, /* execute */ + &grib_action_class_gen, /* super */ + "action_class_transient_darray", /* name */ + sizeof(grib_action_transient_darray), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + &destroy, /* destroy */ + + &dump, /* dump */ + &xref, /* xref */ + + 0, /* create_accessor*/ + + 0, /* notify_change */ + 0, /* reparse */ + &execute, /* execute */ }; grib_action_class* grib_action_class_transient_darray = &_grib_action_class_transient_darray; static void init_class(grib_action_class* c) { - c->create_accessor = (*(c->super))->create_accessor; - c->notify_change = (*(c->super))->notify_change; - c->reparse = (*(c->super))->reparse; + c->create_accessor = (*(c->super))->create_accessor; + c->notify_change = (*(c->super))->notify_change; + c->reparse = (*(c->super))->reparse; } /* END_CLASS_IMP */ -grib_action* grib_action_create_transient_darray( grib_context* context, const char* name, grib_darray* darray,int flags) +grib_action* grib_action_create_transient_darray(grib_context* context, const char* name, grib_darray* darray, int flags) { grib_action_transient_darray* a = NULL; - grib_action_class* c = grib_action_class_transient_darray; - grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context,c->size); - act->op = grib_context_strdup_persistent(context,"transient_darray"); + grib_action_class* c = grib_action_class_transient_darray; + grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context, c->size); + act->op = grib_context_strdup_persistent(context, "transient_darray"); - act->cclass = c; - a = (grib_action_transient_darray*)act; - act->context = context; - act->flags = flags; + act->cclass = c; + a = (grib_action_transient_darray*)act; + act->context = context; + act->flags = flags; - a->darray = darray; - a->name = grib_context_strdup_persistent(context,name); + a->darray = darray; + a->name = grib_context_strdup_persistent(context, name); - act->name = grib_context_strdup_persistent(context,name); + act->name = grib_context_strdup_persistent(context, name); return act; } -static int execute(grib_action* act, grib_handle *h) +static int execute(grib_action* act, grib_handle* h) { - grib_action_transient_darray* self = (grib_action_transient_darray*) act; - size_t len=grib_darray_used_size(self->darray); - grib_accessor* a=NULL; - grib_section* p=h->root; + grib_action_transient_darray* self = (grib_action_transient_darray*)act; + size_t len = grib_darray_used_size(self->darray); + grib_accessor* a = NULL; + grib_section* p = h->root; - a = grib_accessor_factory( p, act,self->len,self->params); - if(!a) return GRIB_INTERNAL_ERROR; + a = grib_accessor_factory(p, act, self->len, self->params); + if (!a) + return GRIB_INTERNAL_ERROR; - grib_push_accessor(a,p->block); + grib_push_accessor(a, p->block); - if(a->flags & GRIB_ACCESSOR_FLAG_CONSTRAINT) - grib_dependency_observe_arguments(a,act->default_value); + if (a->flags & GRIB_ACCESSOR_FLAG_CONSTRAINT) + grib_dependency_observe_arguments(a, act->default_value); - return grib_pack_double(a,self->darray->v,&len); + return grib_pack_double(a, self->darray->v, &len); } static void dump(grib_action* act, FILE* f, int lvl) { - int i =0; - grib_action_transient_darray* self=(grib_action_transient_darray*)act; - for (i=0;icontext,f," "); - grib_context_print(act->context,f,self->name); + int i = 0; + grib_action_transient_darray* self = (grib_action_transient_darray*)act; + for (i = 0; i < lvl; i++) + grib_context_print(act->context, f, " "); + grib_context_print(act->context, f, self->name); printf("\n"); } -static void destroy(grib_context* context,grib_action* act) +static void destroy(grib_context* context, grib_action* act) { - grib_action_transient_darray* a = (grib_action_transient_darray*) act; + grib_action_transient_darray* a = (grib_action_transient_darray*)act; grib_context_free_persistent(context, a->name); - grib_darray_delete(context,a->darray); + grib_darray_delete(context, a->darray); grib_context_free_persistent(context, act->name); grib_context_free_persistent(context, act->op); } -static void xref(grib_action* d, FILE* f,const char *path) +static void xref(grib_action* d, FILE* f, const char* path) { } diff --git a/src/action_class_trigger.c b/src/action_class_trigger.c index 796770633..c2715f497 100644 --- a/src/action_class_trigger.c +++ b/src/action_class_trigger.c @@ -41,130 +41,133 @@ or edit "action.class" and rerun ./make_class.pl */ -static void init_class (grib_action_class*); -static void dump (grib_action* d, FILE*,int); -static void destroy (grib_context*,grib_action*); -static int create_accessor(grib_section*,grib_action*,grib_loader*); -static grib_action* reparse(grib_action* a,grib_accessor* acc,int *doit); - - -typedef struct grib_action_trigger { - grib_action act; -/* Members defined in section */ -/* Members defined in trigger */ - grib_arguments* trigger_on; - grib_action *block; +static void init_class(grib_action_class*); +static void dump(grib_action* d, FILE*, int); +static void destroy(grib_context*, grib_action*); +static int create_accessor(grib_section*, grib_action*, grib_loader*); +static grib_action* reparse(grib_action* a, grib_accessor* acc, int* doit); + + +typedef struct grib_action_trigger +{ + grib_action act; + /* Members defined in section */ + /* Members defined in trigger */ + grib_arguments* trigger_on; + grib_action* block; } grib_action_trigger; extern grib_action_class* grib_action_class_section; static grib_action_class _grib_action_class_trigger = { - &grib_action_class_section, /* super */ - "action_class_trigger", /* name */ - sizeof(grib_action_trigger), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - &destroy, /* destroy */ - - &dump, /* dump */ - 0, /* xref */ - - &create_accessor, /* create_accessor*/ - - 0, /* notify_change */ - &reparse, /* reparse */ - 0, /* execute */ + &grib_action_class_section, /* super */ + "action_class_trigger", /* name */ + sizeof(grib_action_trigger), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + &destroy, /* destroy */ + + &dump, /* dump */ + 0, /* xref */ + + &create_accessor, /* create_accessor*/ + + 0, /* notify_change */ + &reparse, /* reparse */ + 0, /* execute */ }; grib_action_class* grib_action_class_trigger = &_grib_action_class_trigger; static void init_class(grib_action_class* c) { - c->xref = (*(c->super))->xref; - c->notify_change = (*(c->super))->notify_change; - c->execute = (*(c->super))->execute; + c->xref = (*(c->super))->xref; + c->notify_change = (*(c->super))->notify_change; + c->execute = (*(c->super))->execute; } /* END_CLASS_IMP */ -grib_action *grib_action_create_trigger(grib_context *context, grib_arguments *args, grib_action *block) +grib_action* grib_action_create_trigger(grib_context* context, grib_arguments* args, grib_action* block) { char name[1024]; grib_action_trigger* a = 0; - grib_action_class* c = grib_action_class_trigger; - grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context,c->size); + grib_action_class* c = grib_action_class_trigger; + grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context, c->size); - sprintf(name,"_trigger%p",(void*)act); + sprintf(name, "_trigger%p", (void*)act); - act-> name = grib_context_strdup_persistent(context,name); - act-> op = grib_context_strdup_persistent(context,"section"); - act-> cclass = c; - act-> next = NULL; - act->context = context; + act->name = grib_context_strdup_persistent(context, name); + act->op = grib_context_strdup_persistent(context, "section"); + act->cclass = c; + act->next = NULL; + act->context = context; - a = ( grib_action_trigger*)act; - a->trigger_on = args; - a->block = block; + a = (grib_action_trigger*)act; + a->trigger_on = args; + a->block = block; return act; } -static void dump( grib_action* act, FILE* f, int lvl) +static void dump(grib_action* act, FILE* f, int lvl) { /* grib_action_trigger* a = ( grib_action_trigger*)act; */ int i = 0; - for (i=0;icontext,f," "); - grib_context_print(act->context,f,"Trigger\n"); + for (i = 0; i < lvl; i++) + grib_context_print(act->context, f, " "); + grib_context_print(act->context, f, "Trigger\n"); } -static int create_accessor(grib_section* p, grib_action* act, grib_loader *h ) +static int create_accessor(grib_section* p, grib_action* act, grib_loader* h) { - int ret = GRIB_SUCCESS; - grib_action_trigger* a = ( grib_action_trigger*)act; - grib_action* next = NULL; - grib_accessor* as = NULL; - grib_section* gs = NULL; + int ret = GRIB_SUCCESS; + grib_action_trigger* a = (grib_action_trigger*)act; + grib_action* next = NULL; + grib_accessor* as = NULL; + grib_section* gs = NULL; - as = grib_accessor_factory(p, act,0,NULL); + as = grib_accessor_factory(p, act, 0, NULL); - if(!as) return GRIB_INTERNAL_ERROR; + if (!as) + return GRIB_INTERNAL_ERROR; - gs = as->sub_section; + gs = as->sub_section; gs->branch = 0; /* Force a reparse each time */ - grib_push_accessor(as,p->block); - grib_dependency_observe_arguments(as,a->trigger_on); + grib_push_accessor(as, p->block); + grib_dependency_observe_arguments(as, a->trigger_on); next = a->block; - while(next){ - ret = grib_create_accessor(gs, next,h); - if(ret != GRIB_SUCCESS) return ret; - next= next->next; + while (next) { + ret = grib_create_accessor(gs, next, h); + if (ret != GRIB_SUCCESS) + return ret; + next = next->next; } return GRIB_SUCCESS; } -static grib_action* reparse(grib_action* a,grib_accessor* acc,int* doit) +static grib_action* reparse(grib_action* a, grib_accessor* acc, int* doit) { grib_action_trigger* self = (grib_action_trigger*)a; return self->block; } /* COMEBACK */ -static void destroy(grib_context* context,grib_action* act) +static void destroy(grib_context* context, grib_action* act) { grib_action_trigger* a = (grib_action_trigger*)act; - grib_action *b = a->block; + grib_action* b = a->block; - while(b) - { - grib_action *n = b->next; - grib_action_delete(context,b); + while (b) { + grib_action* n = b->next; + grib_action_delete(context, b); b = n; } diff --git a/src/action_class_variable.c b/src/action_class_variable.c index b6f23bbef..9c3e6758c 100644 --- a/src/action_class_variable.c +++ b/src/action_class_variable.c @@ -34,75 +34,76 @@ or edit "action.class" and rerun ./make_class.pl */ -static void init_class (grib_action_class*); -static int execute(grib_action* a,grib_handle* h); +static void init_class(grib_action_class*); +static int execute(grib_action* a, grib_handle* h); -typedef struct grib_action_variable { - grib_action act; -/* Members defined in gen */ - long len; - grib_arguments* params; -/* Members defined in variable */ +typedef struct grib_action_variable +{ + grib_action act; + /* Members defined in gen */ + long len; + grib_arguments* params; + /* Members defined in variable */ } grib_action_variable; extern grib_action_class* grib_action_class_gen; static grib_action_class _grib_action_class_variable = { - &grib_action_class_gen, /* super */ - "action_class_variable", /* name */ - sizeof(grib_action_variable), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ + &grib_action_class_gen, /* super */ + "action_class_variable", /* name */ + sizeof(grib_action_variable), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ 0, /* destroy */ - 0, /* dump */ - 0, /* xref */ + 0, /* dump */ + 0, /* xref */ - 0, /* create_accessor*/ + 0, /* create_accessor*/ - 0, /* notify_change */ - 0, /* reparse */ - &execute, /* execute */ + 0, /* notify_change */ + 0, /* reparse */ + &execute, /* execute */ }; grib_action_class* grib_action_class_variable = &_grib_action_class_variable; static void init_class(grib_action_class* c) { - c->dump = (*(c->super))->dump; - c->xref = (*(c->super))->xref; - c->create_accessor = (*(c->super))->create_accessor; - c->notify_change = (*(c->super))->notify_change; - c->reparse = (*(c->super))->reparse; + c->dump = (*(c->super))->dump; + c->xref = (*(c->super))->xref; + c->create_accessor = (*(c->super))->create_accessor; + c->notify_change = (*(c->super))->notify_change; + c->reparse = (*(c->super))->reparse; } /* END_CLASS_IMP */ -grib_action* grib_action_create_variable( grib_context* context, const char* name, const char* op, const long len, grib_arguments* params, grib_arguments* default_value,int flags,const char* name_space) +grib_action* grib_action_create_variable(grib_context* context, const char* name, const char* op, const long len, grib_arguments* params, grib_arguments* default_value, int flags, const char* name_space) { - grib_action_variable* a = NULL; - grib_action_class* c = grib_action_class_variable; - grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context,c->size); - act->next = NULL; - act->name = grib_context_strdup_persistent(context, name); - if(name_space) - act->name_space = grib_context_strdup_persistent(context, name_space); - act->op = grib_context_strdup_persistent(context, op); - act->cclass = c; - act->context = context; - act->flags = flags; - a = (grib_action_variable*)act; - a->len = len; - a->params = params; - act->default_value = default_value; + grib_action_variable* a = NULL; + grib_action_class* c = grib_action_class_variable; + grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context, c->size); + act->next = NULL; + act->name = grib_context_strdup_persistent(context, name); + if (name_space) + act->name_space = grib_context_strdup_persistent(context, name_space); + act->op = grib_context_strdup_persistent(context, op); + act->cclass = c; + act->context = context; + act->flags = flags; + a = (grib_action_variable*)act; + a->len = len; + a->params = params; + act->default_value = default_value; /* printf("CREATE %s\n",name); */ return act; } -static int execute(grib_action* a, grib_handle *h) +static int execute(grib_action* a, grib_handle* h) { - return grib_create_accessor(h->root, a, NULL ); + return grib_create_accessor(h->root, a, NULL); } diff --git a/src/action_class_when.c b/src/action_class_when.c index 285595f3c..26f277a56 100644 --- a/src/action_class_when.c +++ b/src/action_class_when.c @@ -38,41 +38,42 @@ or edit "action.class" and rerun ./make_class.pl */ -static void init_class (grib_action_class*); -static void dump (grib_action* d, FILE*,int); -static void xref (grib_action* d, FILE* f,const char* path); -static void destroy (grib_context*,grib_action*); -static int create_accessor(grib_section*,grib_action*,grib_loader*); -static int notify_change(grib_action* a, grib_accessor* observer,grib_accessor* observed); - - -typedef struct grib_action_when { - grib_action act; -/* Members defined in when */ - grib_expression *expression; - grib_action *block_true; - grib_action *block_false; - int loop; +static void init_class(grib_action_class*); +static void dump(grib_action* d, FILE*, int); +static void xref(grib_action* d, FILE* f, const char* path); +static void destroy(grib_context*, grib_action*); +static int create_accessor(grib_section*, grib_action*, grib_loader*); +static int notify_change(grib_action* a, grib_accessor* observer, grib_accessor* observed); + + +typedef struct grib_action_when +{ + grib_action act; + /* Members defined in when */ + grib_expression* expression; + grib_action* block_true; + grib_action* block_false; + int loop; } grib_action_when; static grib_action_class _grib_action_class_when = { - 0, /* super */ - "action_class_when", /* name */ - sizeof(grib_action_when), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - &destroy, /* destroy */ - - &dump, /* dump */ - &xref, /* xref */ - - &create_accessor, /* create_accessor*/ - - ¬ify_change, /* notify_change */ - 0, /* reparse */ - 0, /* execute */ + 0, /* super */ + "action_class_when", /* name */ + sizeof(grib_action_when), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + &destroy, /* destroy */ + + &dump, /* dump */ + &xref, /* xref */ + + &create_accessor, /* create_accessor*/ + + ¬ify_change, /* notify_change */ + 0, /* reparse */ + 0, /* execute */ }; grib_action_class* grib_action_class_when = &_grib_action_class_when; @@ -84,44 +85,45 @@ static void init_class(grib_action_class* c) /* The check on self->loop can only be done in non-threaded mode */ #if defined(DEBUG) && GRIB_PTHREADS == 0 && GRIB_OMP_THREADS == 0 - #define CHECK_LOOP 1 +#define CHECK_LOOP 1 #endif -grib_action* grib_action_create_when( grib_context* context, - grib_expression* expression, - grib_action* block_true,grib_action* block_false) +grib_action* grib_action_create_when(grib_context* context, + grib_expression* expression, + grib_action* block_true, grib_action* block_false) { char name[1024]; - grib_action_when* a ; - grib_action_class* c = grib_action_class_when; - grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context,c->size); - act->op = grib_context_strdup_persistent(context,"when"); + grib_action_when* a; + grib_action_class* c = grib_action_class_when; + grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context, c->size); + act->op = grib_context_strdup_persistent(context, "when"); - act->cclass = c; - a = (grib_action_when*)act; - act->context = context; + act->cclass = c; + a = (grib_action_when*)act; + act->context = context; a->expression = expression; - a->block_true = block_true; - a->block_false = block_false; + a->block_true = block_true; + a->block_false = block_false; - sprintf(name,"_when%p",(void*)expression); + sprintf(name, "_when%p", (void*)expression); - act->name = grib_context_strdup_persistent(context,name); + act->name = grib_context_strdup_persistent(context, name); return act; } -static int create_accessor(grib_section* p, grib_action* act,grib_loader *h) +static int create_accessor(grib_section* p, grib_action* act, grib_loader* h) { grib_action_when* self = (grib_action_when*)act; - grib_accessor* as = grib_accessor_factory(p, act,0,0); - if(!as)return GRIB_INTERNAL_ERROR; + grib_accessor* as = grib_accessor_factory(p, act, 0, 0); + if (!as) + return GRIB_INTERNAL_ERROR; - grib_dependency_observe_expression(as,self->expression); + grib_dependency_observe_expression(as, self->expression); - grib_push_accessor(as,p->block); + grib_push_accessor(as, p->block); return GRIB_SUCCESS; } @@ -129,74 +131,73 @@ static int create_accessor(grib_section* p, grib_action* act,grib_loader *h) static void dump(grib_action* act, FILE* f, int lvl) { grib_action_when* a = (grib_action_when*)act; - int i = 0; + int i = 0; - for (i=0;icontext,f," "); + for (i = 0; i < lvl; i++) + grib_context_print(act->context, f, " "); - printf("when(%s) { ",act->name); - grib_expression_print(act->context,a->expression,0); + printf("when(%s) { ", act->name); + grib_expression_print(act->context, a->expression, 0); printf("\n"); - grib_dump_action_branch(f,a->block_true,lvl+1); + grib_dump_action_branch(f, a->block_true, lvl + 1); - for (i=0;icontext,f," "); + for (i = 0; i < lvl; i++) + grib_context_print(act->context, f, " "); printf("}"); if (a->block_false) { printf(" else { "); - grib_dump_action_branch(f,a->block_true,lvl+1); + grib_dump_action_branch(f, a->block_true, lvl + 1); - for (i=0;icontext,f," "); + for (i = 0; i < lvl; i++) + grib_context_print(act->context, f, " "); printf("}"); } printf("\n"); } #ifdef CHECK_LOOP - #define SET_LOOP(self,v) self->loop=v; +#define SET_LOOP(self, v) self->loop = v; #else - #define SET_LOOP(self,v) +#define SET_LOOP(self, v) #endif -static int notify_change(grib_action* a, grib_accessor* observer,grib_accessor* observed) +static int notify_change(grib_action* a, grib_accessor* observer, grib_accessor* observed) { - grib_action_when* self = (grib_action_when*) a; - grib_action *b = NULL; - int ret = GRIB_SUCCESS; + grib_action_when* self = (grib_action_when*)a; + grib_action* b = NULL; + int ret = GRIB_SUCCESS; long lres; /* ECC-974: observed->parent will change as a result of the execute * so must store the handle once here (in 'hand') rather than call * grib_handle_of_accessor(observed) later */ - grib_handle* hand=grib_handle_of_accessor(observed); + grib_handle* hand = grib_handle_of_accessor(observed); - if ((ret = grib_expression_evaluate_long(hand, self->expression,&lres)) - != GRIB_SUCCESS) return ret; + if ((ret = grib_expression_evaluate_long(hand, self->expression, &lres)) != GRIB_SUCCESS) + return ret; #ifdef CHECK_LOOP - if(self->loop) - { + if (self->loop) { printf("LOOP detected...\n"); - printf("WHEN triggered by %s %ld\n",observed->name,lres); - grib_expression_print(observed->context,self->expression,0); + printf("WHEN triggered by %s %ld\n", observed->name, lres); + grib_expression_print(observed->context, self->expression, 0); printf("\n"); return ret; } #endif SET_LOOP(self, 1); - if(lres) - b=self->block_true; + if (lres) + b = self->block_true; else - b=self->block_false; + b = self->block_false; - while(b) { - ret = grib_action_execute(b,hand); - if(ret != GRIB_SUCCESS) { + while (b) { + ret = grib_action_execute(b, hand); + if (ret != GRIB_SUCCESS) { SET_LOOP(self, 0); return ret; } @@ -208,32 +209,30 @@ static int notify_change(grib_action* a, grib_accessor* observer,grib_accessor* return GRIB_SUCCESS; } -static void destroy(grib_context* context,grib_action* act) +static void destroy(grib_context* context, grib_action* act) { - grib_action_when* self = (grib_action_when*) act; - grib_action *t = self->block_true; + grib_action_when* self = (grib_action_when*)act; + grib_action* t = self->block_true; - while(t) - { - grib_action *nt = t->next; - grib_action_delete(context,t); + while (t) { + grib_action* nt = t->next; + grib_action_delete(context, t); t = nt; } - t=self->block_false; - while(t) - { - grib_action *nt = t->next; - grib_action_delete(context,t); + t = self->block_false; + while (t) { + grib_action* nt = t->next; + grib_action_delete(context, t); t = nt; } - grib_expression_free(context,self->expression); + grib_expression_free(context, self->expression); grib_context_free_persistent(context, act->name); grib_context_free_persistent(context, act->op); } -static void xref(grib_action* d, FILE* f,const char* path) +static void xref(grib_action* d, FILE* f, const char* path) { } diff --git a/src/action_class_while.c b/src/action_class_while.c index 6be44a512..4a1119c9d 100644 --- a/src/action_class_while.c +++ b/src/action_class_while.c @@ -34,144 +34,143 @@ or edit "action.class" and rerun ./make_class.pl */ -static void init_class (grib_action_class*); -static void dump (grib_action* d, FILE*,int); -static void destroy (grib_context*,grib_action*); -static int create_accessor(grib_section*,grib_action*,grib_loader*); - - -typedef struct grib_action_while { - grib_action act; -/* Members defined in section */ -/* Members defined in while */ - grib_expression *expression; - grib_action *block_while; +static void init_class(grib_action_class*); +static void dump(grib_action* d, FILE*, int); +static void destroy(grib_context*, grib_action*); +static int create_accessor(grib_section*, grib_action*, grib_loader*); + + +typedef struct grib_action_while +{ + grib_action act; + /* Members defined in section */ + /* Members defined in while */ + grib_expression* expression; + grib_action* block_while; } grib_action_while; extern grib_action_class* grib_action_class_section; static grib_action_class _grib_action_class_while = { - &grib_action_class_section, /* super */ - "action_class_while", /* name */ - sizeof(grib_action_while), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - &destroy, /* destroy */ - - &dump, /* dump */ - 0, /* xref */ - - &create_accessor, /* create_accessor*/ - - 0, /* notify_change */ - 0, /* reparse */ - 0, /* execute */ + &grib_action_class_section, /* super */ + "action_class_while", /* name */ + sizeof(grib_action_while), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + &destroy, /* destroy */ + + &dump, /* dump */ + 0, /* xref */ + + &create_accessor, /* create_accessor*/ + + 0, /* notify_change */ + 0, /* reparse */ + 0, /* execute */ }; grib_action_class* grib_action_class_while = &_grib_action_class_while; static void init_class(grib_action_class* c) { - c->xref = (*(c->super))->xref; - c->notify_change = (*(c->super))->notify_change; - c->reparse = (*(c->super))->reparse; - c->execute = (*(c->super))->execute; + c->xref = (*(c->super))->xref; + c->notify_change = (*(c->super))->notify_change; + c->reparse = (*(c->super))->reparse; + c->execute = (*(c->super))->execute; } /* END_CLASS_IMP */ -static void dump( grib_action* act, FILE* f, int lvl) +static void dump(grib_action* act, FILE* f, int lvl) { - grib_action_while* a = ( grib_action_while*)act; - int i = 0; - for (i=0;icontext,f," "); - grib_context_print(act->context,f,"Loop %s\n", act->name ); - grib_dump_action_branch(f,a->block_while,lvl+1); + grib_action_while* a = (grib_action_while*)act; + int i = 0; + for (i = 0; i < lvl; i++) + grib_context_print(act->context, f, " "); + grib_context_print(act->context, f, "Loop %s\n", act->name); + grib_dump_action_branch(f, a->block_while, lvl + 1); } -static int create_accessor(grib_section* p, grib_action* act,grib_loader* h) +static int create_accessor(grib_section* p, grib_action* act, grib_loader* h) { - grib_action_while* a = ( grib_action_while*)act; + grib_action_while* a = (grib_action_while*)act; - grib_accessor* ga = NULL; - grib_section* gs = NULL; - grib_action* la = NULL; - grib_action* next = NULL; - int ret = 0; - /* long n = 0; */ + grib_accessor* ga = NULL; + grib_section* gs = NULL; + grib_action* la = NULL; + grib_action* next = NULL; + int ret = 0; + /* long n = 0; */ - ga = grib_accessor_factory(p, act,0,NULL); - if(!ga) return GRIB_BUFFER_TOO_SMALL; - gs = ga->sub_section; + ga = grib_accessor_factory(p, act, 0, NULL); + if (!ga) + return GRIB_BUFFER_TOO_SMALL; + gs = ga->sub_section; - grib_push_accessor(ga,p->block); + grib_push_accessor(ga, p->block); - la = a->block_while; + la = a->block_while; - for(;;) - { - long val = 0; + for (;;) { + long val = 0; - if ((ret=grib_expression_evaluate_long(p->h,a->expression,&val)) != GRIB_SUCCESS){ - grib_context_log(p->h->context, GRIB_LOG_DEBUG, " List %s creating %d values unable to evaluate long \n", act->name, val ); - return ret; - } + if ((ret = grib_expression_evaluate_long(p->h, a->expression, &val)) != GRIB_SUCCESS) { + grib_context_log(p->h->context, GRIB_LOG_DEBUG, " List %s creating %d values unable to evaluate long \n", act->name, val); + return ret; + } - /* printf("val=%ld %ld\n",val,n++); */ + /* printf("val=%ld %ld\n",val,n++); */ - if(!val) - break; + if (!val) + break; - next = la; - while(next){ - ret = grib_create_accessor(gs, next,h); - if(ret != GRIB_SUCCESS) return ret; - next= next->next; - } - } - return GRIB_SUCCESS; - + next = la; + while (next) { + ret = grib_create_accessor(gs, next, h); + if (ret != GRIB_SUCCESS) + return ret; + next = next->next; + } + } + return GRIB_SUCCESS; } -grib_action* grib_action_create_while( grib_context* context, grib_expression* expression, grib_action* block) +grib_action* grib_action_create_while(grib_context* context, grib_expression* expression, grib_action* block) { - char name[80]; - grib_action_while* a ; - grib_action_class* c = grib_action_class_while; - grib_action* act = ( grib_action*)grib_context_malloc_clear_persistent(context,c->size); - act->cclass = c; - act->context = context; - a = ( grib_action_while*)act; - act->next = NULL; + char name[80]; + grib_action_while* a; + grib_action_class* c = grib_action_class_while; + grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context, c->size); + act->cclass = c; + act->context = context; + a = (grib_action_while*)act; + act->next = NULL; - sprintf(name,"_while%p",(void*)a); - act->name = grib_context_strdup_persistent(context,name); - act->op = grib_context_strdup_persistent(context,"section"); - a->expression = expression; + sprintf(name, "_while%p", (void*)a); + act->name = grib_context_strdup_persistent(context, name); + act->op = grib_context_strdup_persistent(context, "section"); + a->expression = expression; - a->block_while = block; + a->block_while = block; - grib_context_log(context, GRIB_LOG_DEBUG, " Action List %s is created \n",act->name); - return act; + grib_context_log(context, GRIB_LOG_DEBUG, " Action List %s is created \n", act->name); + return act; } -static void destroy(grib_context* context,grib_action* act) +static void destroy(grib_context* context, grib_action* act) { - grib_action_while* self = ( grib_action_while*)act; - grib_action *a = self->block_while; - - while(a) - { - grib_action *na = a->next; - grib_action_delete(context,a); - a = na; - } - - grib_context_free_persistent(context, act->name); - grib_context_free_persistent(context, act->op); - grib_expression_free(context, self->expression); - -} - + grib_action_while* self = (grib_action_while*)act; + grib_action* a = self->block_while; + + while (a) { + grib_action* na = a->next; + grib_action_delete(context, a); + a = na; + } + + grib_context_free_persistent(context, act->name); + grib_context_free_persistent(context, act->op); + grib_expression_free(context, self->expression); +} diff --git a/src/action_class_write.c b/src/action_class_write.c index c3238a441..76f6cb560 100644 --- a/src/action_class_write.c +++ b/src/action_class_write.c @@ -36,38 +36,39 @@ or edit "action.class" and rerun ./make_class.pl */ -static void init_class (grib_action_class*); -static void dump (grib_action* d, FILE*,int); -static void destroy (grib_context*,grib_action*); -static int execute(grib_action* a,grib_handle* h); - - -typedef struct grib_action_write { - grib_action act; -/* Members defined in write */ - char *name; - int append; - int padtomultiple; +static void init_class(grib_action_class*); +static void dump(grib_action* d, FILE*, int); +static void destroy(grib_context*, grib_action*); +static int execute(grib_action* a, grib_handle* h); + + +typedef struct grib_action_write +{ + grib_action act; + /* Members defined in write */ + char* name; + int append; + int padtomultiple; } grib_action_write; static grib_action_class _grib_action_class_write = { - 0, /* super */ - "action_class_write", /* name */ - sizeof(grib_action_write), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - &destroy, /* destroy */ - - &dump, /* dump */ - 0, /* xref */ - - 0, /* create_accessor*/ - - 0, /* notify_change */ - 0, /* reparse */ - &execute, /* execute */ + 0, /* super */ + "action_class_write", /* name */ + sizeof(grib_action_write), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + &destroy, /* destroy */ + + &dump, /* dump */ + 0, /* xref */ + + 0, /* create_accessor*/ + + 0, /* notify_change */ + 0, /* reparse */ + &execute, /* execute */ }; grib_action_class* grib_action_class_write = &_grib_action_class_write; @@ -79,79 +80,84 @@ static void init_class(grib_action_class* c) /*extern int errno;*/ -grib_action* grib_action_create_write( grib_context* context, const char* name,int append,int padtomultiple) +grib_action* grib_action_create_write(grib_context* context, const char* name, int append, int padtomultiple) { char buf[1024]; - grib_action_write* a =NULL; - grib_action_class* c = grib_action_class_write; - grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context,c->size); - act->op = grib_context_strdup_persistent(context,"section"); + grib_action_write* a = NULL; + grib_action_class* c = grib_action_class_write; + grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context, c->size); + act->op = grib_context_strdup_persistent(context, "section"); - act->cclass = c; - a = (grib_action_write*)act; - act->context = context; + act->cclass = c; + a = (grib_action_write*)act; + act->context = context; - a->name = grib_context_strdup_persistent(context,name); + a->name = grib_context_strdup_persistent(context, name); - sprintf(buf,"write%p",(void*)a->name); + sprintf(buf, "write%p", (void*)a->name); - act->name = grib_context_strdup_persistent(context,buf); - a->append=append; - a->padtomultiple=padtomultiple; + act->name = grib_context_strdup_persistent(context, buf); + a->append = append; + a->padtomultiple = padtomultiple; return act; } -static int execute(grib_action* act, grib_handle *h) +static int execute(grib_action* act, grib_handle* h) { - grib_action_write* a = (grib_action_write*) act; - int err = GRIB_SUCCESS; + grib_action_write* a = (grib_action_write*)act; + int err = GRIB_SUCCESS; size_t size; - const void* buffer = NULL; + const void* buffer = NULL; const char* filename = NULL; - char string[1024] = { 0, }; + char string[1024] = {0,}; grib_file* of = NULL; if ((err = grib_get_message(h, &buffer, &size)) != GRIB_SUCCESS) { - grib_context_log(act->context, GRIB_LOG_ERROR,"unable to get message\n"); + grib_context_log(act->context, GRIB_LOG_ERROR, "unable to get message\n"); return err; } if (strlen(a->name) != 0) { - err = grib_recompose_name(h, NULL, a->name, string, 0); + err = grib_recompose_name(h, NULL, a->name, string, 0); filename = string; - } else { + } + else { if (act->context->outfilename) { filename = act->context->outfilename; - err = grib_recompose_name(h, NULL, act->context->outfilename, string, 0); - if (!err) filename = string; - } else { + err = grib_recompose_name(h, NULL, act->context->outfilename, string, 0); + if (!err) + filename = string; + } + else { filename = "filter.out"; } } Assert(filename); - if (a->append) of = grib_file_open(filename, "a", &err); - else of = grib_file_open(filename, "w", &err); + if (a->append) + of = grib_file_open(filename, "a", &err); + else + of = grib_file_open(filename, "w", &err); if (!of || !of->handle) { - grib_context_log(act->context, GRIB_LOG_ERROR,"unable to open file %s\n", filename); + grib_context_log(act->context, GRIB_LOG_ERROR, "unable to open file %s\n", filename); return GRIB_IO_PROBLEM; } if (h->gts_header) { if (fwrite(h->gts_header, 1, h->gts_header_len, of->handle) != h->gts_header_len) { grib_context_log(act->context, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), - "Error writing GTS header to %s", filename); + "Error writing GTS header to %s", filename); return GRIB_IO_PROBLEM; } } if (fwrite(buffer, 1, size, of->handle) != size) { grib_context_log(act->context, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), - "Error writing to %s", filename); + "Error writing to %s", filename); return GRIB_IO_PROBLEM; } @@ -163,7 +169,7 @@ static int execute(grib_action* act, grib_handle *h) Assert(zeros); if (fwrite(zeros, 1, padding, of->handle) != padding) { grib_context_log(act->context, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), - "Error writing to %s", filename); + "Error writing to %s", filename); free(zeros); return GRIB_IO_PROBLEM; } @@ -174,14 +180,14 @@ static int execute(grib_action* act, grib_handle *h) char gts_trailer[4] = { '\x0D', '\x0D', '\x0A', '\x03' }; if (fwrite(gts_trailer, 1, 4, of->handle) != 4) { grib_context_log(act->context, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), - "Error writing GTS trailer to %s", filename); + "Error writing GTS trailer to %s", filename); return GRIB_IO_PROBLEM; } } grib_file_close(filename, 0, &err); if (err != GRIB_SUCCESS) { - grib_context_log(act->context, GRIB_LOG_ERROR,"unable to write message\n"); + grib_context_log(act->context, GRIB_LOG_ERROR, "unable to write message\n"); return err; } @@ -192,9 +198,9 @@ static void dump(grib_action* act, FILE* f, int lvl) { } -static void destroy(grib_context* context,grib_action* act) +static void destroy(grib_context* context, grib_action* act) { - grib_action_write* a = (grib_action_write*) act; + grib_action_write* a = (grib_action_write*)act; grib_context_free_persistent(context, a->name); grib_context_free_persistent(context, act->name); diff --git a/src/bufr_keys_iterator.c b/src/bufr_keys_iterator.c index 35fd18cb5..cfe121419 100644 --- a/src/bufr_keys_iterator.c +++ b/src/bufr_keys_iterator.c @@ -12,9 +12,10 @@ bufr_keys_iterator* codes_bufr_keys_iterator_new(grib_handle* h, unsigned long filter_flags) { - bufr_keys_iterator* ki=NULL; + bufr_keys_iterator* ki = NULL; - if (!h) return NULL; + if (!h) + return NULL; if (h->product_kind != PRODUCT_BUFR) { grib_context_log(h->context, GRIB_LOG_ERROR, @@ -22,57 +23,63 @@ bufr_keys_iterator* codes_bufr_keys_iterator_new(grib_handle* h, unsigned long f return NULL; } - ki= (bufr_keys_iterator*)grib_context_malloc_clear(h->context,sizeof(bufr_keys_iterator)); - if (!ki) return NULL; + ki = (bufr_keys_iterator*)grib_context_malloc_clear(h->context, sizeof(bufr_keys_iterator)); + if (!ki) + return NULL; ki->filter_flags = filter_flags; ki->handle = h; DebugAssert(h->product_kind == PRODUCT_BUFR); - ki->key_name = NULL; - ki->i_curr_attribute=0; - ki->accessor_flags_only= GRIB_ACCESSOR_FLAG_DUMP; - ki->accessor_flags_skip= GRIB_ACCESSOR_FLAG_HIDDEN; /*ECC-568*/ + ki->key_name = NULL; + ki->i_curr_attribute = 0; + ki->accessor_flags_only = GRIB_ACCESSOR_FLAG_DUMP; + ki->accessor_flags_skip = GRIB_ACCESSOR_FLAG_HIDDEN; /*ECC-568*/ - ki->at_start = 1; - ki->match = 0; + ki->at_start = 1; + ki->match = 0; - if (ki->seen==NULL ) ki->seen = grib_trie_new(h->context); + if (ki->seen == NULL) + ki->seen = grib_trie_new(h->context); return ki; } bufr_keys_iterator* codes_bufr_data_section_keys_iterator_new(grib_handle* h) { - bufr_keys_iterator* ki=NULL; + bufr_keys_iterator* ki = NULL; - if (!h) return NULL; + if (!h) + return NULL; - ki= (bufr_keys_iterator*)grib_context_malloc_clear(h->context,sizeof(bufr_keys_iterator)); - if (!ki) return NULL; + ki = (bufr_keys_iterator*)grib_context_malloc_clear(h->context, sizeof(bufr_keys_iterator)); + if (!ki) + return NULL; - ki->handle = h; + ki->handle = h; DebugAssert(h->product_kind == PRODUCT_BUFR); - ki->i_curr_attribute=0; - ki->accessor_flags_only= GRIB_ACCESSOR_FLAG_BUFR_DATA | GRIB_ACCESSOR_FLAG_DUMP; - ki->accessor_flags_skip= GRIB_ACCESSOR_FLAG_HIDDEN | GRIB_ACCESSOR_FLAG_READ_ONLY; + ki->i_curr_attribute = 0; + ki->accessor_flags_only = GRIB_ACCESSOR_FLAG_BUFR_DATA | GRIB_ACCESSOR_FLAG_DUMP; + ki->accessor_flags_skip = GRIB_ACCESSOR_FLAG_HIDDEN | GRIB_ACCESSOR_FLAG_READ_ONLY; - ki->at_start = 1; - ki->match = 0; + ki->at_start = 1; + ki->match = 0; - if(ki->seen==NULL ) ki->seen = grib_trie_new(h->context); + if (ki->seen == NULL) + ki->seen = grib_trie_new(h->context); return ki; } -static void mark_seen(bufr_keys_iterator* ki,const char* name) +static void mark_seen(bufr_keys_iterator* ki, const char* name) { - int* r=(int*)grib_trie_get(ki->seen,name); + int* r = (int*)grib_trie_get(ki->seen, name); - if (r) (*r)++; + if (r) + (*r)++; else { - r=(int*)grib_context_malloc(ki->handle->context,sizeof(int)); - *r=1; - grib_trie_insert(ki->seen,name,(void*)r); + r = (int*)grib_context_malloc(ki->handle->context, sizeof(int)); + *r = 1; + grib_trie_insert(ki->seen, name, (void*)r); } } @@ -88,9 +95,8 @@ static int is_ident_key(const bufr_keys_iterator* kiter) return 0; if ((GRIB_ACCESSOR_FLAG_HIDDEN & kiter->current->flags) != 0 && - strcmp(kiter->current->name, "keyMore")==0 && - grib_is_defined(kiter->handle, "ls.ident")) - { + strcmp(kiter->current->name, "keyMore") == 0 && + grib_is_defined(kiter->handle, "ls.ident")) { return 1; } return 0; @@ -98,67 +104,71 @@ static int is_ident_key(const bufr_keys_iterator* kiter) static int skip(bufr_keys_iterator* kiter) { - if(kiter->current->sub_section) + if (kiter->current->sub_section) return 1; - if(kiter->current->flags & kiter->accessor_flags_skip) { + if (kiter->current->flags & kiter->accessor_flags_skip) { /* The "ident" key deserves special treatment */ if (is_ident_key(kiter)) return 0; return 1; } - if(kiter->accessor_flags_only == (kiter->current->flags & kiter->accessor_flags_only)) { - mark_seen(kiter,kiter->current->name); + if (kiter->accessor_flags_only == (kiter->current->flags & kiter->accessor_flags_only)) { + mark_seen(kiter, kiter->current->name); return 0; - } else { + } + else { return 1; } } static int next_attribute(bufr_keys_iterator* kiter) { - int *r=0; + int* r = 0; int i_curr_attribute; - if (!kiter->current) return 0; + if (!kiter->current) + return 0; if (!kiter->attributes) { - kiter->attributes=kiter->current->attributes; - kiter->prefix=0; - kiter->i_curr_attribute=0; + kiter->attributes = kiter->current->attributes; + kiter->prefix = 0; + kiter->i_curr_attribute = 0; } - i_curr_attribute=kiter->i_curr_attribute-1; + i_curr_attribute = kiter->i_curr_attribute - 1; - while (kiter->i_curr_attribute < MAX_ACCESSOR_ATTRIBUTES && kiter->attributes[kiter->i_curr_attribute] ) { - if ((kiter->attributes[kiter->i_curr_attribute]->flags & GRIB_ACCESSOR_FLAG_DUMP) != 0 - && (kiter->attributes[kiter->i_curr_attribute]->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) ==0) break; + while (kiter->i_curr_attribute < MAX_ACCESSOR_ATTRIBUTES && kiter->attributes[kiter->i_curr_attribute]) { + if ((kiter->attributes[kiter->i_curr_attribute]->flags & GRIB_ACCESSOR_FLAG_DUMP) != 0 && (kiter->attributes[kiter->i_curr_attribute]->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) == 0) + break; kiter->i_curr_attribute++; } if (kiter->attributes[kiter->i_curr_attribute]) { if (!kiter->prefix) { - kiter->prefix=(char*)grib_context_malloc_clear(kiter->current->context,strlen(kiter->current->name)+10); - r=(int*)grib_trie_get(kiter->seen,kiter->current->name); - sprintf(kiter->prefix,"#%d#%s",*r,kiter->current->name); + kiter->prefix = (char*)grib_context_malloc_clear(kiter->current->context, strlen(kiter->current->name) + 10); + r = (int*)grib_trie_get(kiter->seen, kiter->current->name); + sprintf(kiter->prefix, "#%d#%s", *r, kiter->current->name); } kiter->i_curr_attribute++; return 1; - } else { - char* prefix=0; - if (!kiter->prefix) return 0; + } + else { + char* prefix = 0; + if (!kiter->prefix) + return 0; if (!kiter->attributes[i_curr_attribute]) { - grib_context_free(kiter->current->context,kiter->prefix); - kiter->prefix=0; + grib_context_free(kiter->current->context, kiter->prefix); + kiter->prefix = 0; return 0; } - prefix=(char*)grib_context_malloc_clear(kiter->current->context,strlen(kiter->prefix)+strlen(kiter->attributes[i_curr_attribute]->name)+3); + prefix = (char*)grib_context_malloc_clear(kiter->current->context, strlen(kiter->prefix) + strlen(kiter->attributes[i_curr_attribute]->name) + 3); /*sprintf(prefix,"%s->%s",kiter->prefix,kiter->attributes[i_curr_attribute]->name);*/ - strcpy(prefix, kiter->prefix); /* strcpy and strcat here are much faster than sprintf */ + strcpy(prefix, kiter->prefix); /* strcpy and strcat here are much faster than sprintf */ strcat(prefix, "->"); strcat(prefix, kiter->attributes[i_curr_attribute]->name); - grib_context_free(kiter->current->context,kiter->prefix); - kiter->prefix=prefix; - kiter->attributes=kiter->attributes[i_curr_attribute]->attributes; - kiter->i_curr_attribute=0; + grib_context_free(kiter->current->context, kiter->prefix); + kiter->prefix = prefix; + kiter->attributes = kiter->attributes[i_curr_attribute]->attributes; + kiter->i_curr_attribute = 0; return next_attribute(kiter); } } @@ -169,30 +179,29 @@ int codes_bufr_keys_iterator_next(bufr_keys_iterator* kiter) grib_context_free(kiter->handle->context, kiter->key_name); kiter->key_name = NULL; - if(kiter->at_start) - { - kiter->current = kiter->handle->root->block->first; - kiter->at_start = 0; - kiter->i_curr_attribute=0; - kiter->prefix=0; - kiter->attributes=0; + if (kiter->at_start) { + kiter->current = kiter->handle->root->block->first; + kiter->at_start = 0; + kiter->i_curr_attribute = 0; + kiter->prefix = 0; + kiter->attributes = 0; } - else - { + else { if (next_attribute(kiter)) { return 1; - } else { - kiter->current = grib_next_accessor(kiter->current); - kiter->attributes=0; + } + else { + kiter->current = grib_next_accessor(kiter->current); + kiter->attributes = 0; if (kiter->prefix) { - grib_context_free(kiter->current->context,kiter->prefix); - kiter->prefix=0; + grib_context_free(kiter->current->context, kiter->prefix); + kiter->prefix = 0; } - kiter->i_curr_attribute=0; + kiter->i_curr_attribute = 0; } } - while(kiter->current && skip(kiter)) + while (kiter->current && skip(kiter)) kiter->current = grib_next_accessor(kiter->current); return kiter->current != NULL; @@ -203,29 +212,32 @@ int codes_bufr_keys_iterator_next(bufr_keys_iterator* kiter) char* codes_bufr_keys_iterator_get_name(const bufr_keys_iterator* ckiter) { bufr_keys_iterator* kiter = (bufr_keys_iterator*)ckiter; - int *r=0; - char* ret=0; - grib_context* c = kiter->handle->context; + int* r = 0; + char* ret = 0; + grib_context* c = kiter->handle->context; DebugAssert(kiter->current); if (kiter->prefix) { - int iattribute=kiter->i_curr_attribute-1; - ret=(char*)grib_context_malloc_clear(c,strlen(kiter->prefix)+strlen(kiter->attributes[iattribute]->name)+10); + int iattribute = kiter->i_curr_attribute - 1; + ret = (char*)grib_context_malloc_clear(c, strlen(kiter->prefix) + strlen(kiter->attributes[iattribute]->name) + 10); /*sprintf(ret,"%s->%s",kiter->prefix,kiter->attributes[iattribute]->name);*/ strcpy(ret, kiter->prefix); /* strcpy and strcat here are much faster than sprintf */ strcat(ret, "->"); strcat(ret, kiter->attributes[iattribute]->name); - } else { - ret=(char*)grib_context_malloc_clear(c,strlen(kiter->current->name)+10); + } + else { + ret = (char*)grib_context_malloc_clear(c, strlen(kiter->current->name) + 10); if (kiter->current->flags & GRIB_ACCESSOR_FLAG_BUFR_DATA) { - r=(int*)grib_trie_get(kiter->seen,kiter->current->name); - sprintf(ret,"#%d#%s",*r,kiter->current->name); - } else { + r = (int*)grib_trie_get(kiter->seen, kiter->current->name); + sprintf(ret, "#%d#%s", *r, kiter->current->name); + } + else { if (is_ident_key(kiter)) { strcpy(ret, "ident"); - } else { - strcpy(ret,kiter->current->name); + } + else { + strcpy(ret, kiter->current->name); } } } @@ -245,9 +257,9 @@ int codes_bufr_keys_iterator_delete(bufr_keys_iterator* kiter) if (kiter) { grib_context* c = kiter->handle->context; kiter->key_name = NULL; - if(kiter->seen) + if (kiter->seen) grib_trie_delete(kiter->seen); - grib_context_free(c,kiter); + grib_context_free(c, kiter); } return 0; } diff --git a/src/bufr_util.c b/src/bufr_util.c index 8483b2ece..1f1a9db52 100644 --- a/src/bufr_util.c +++ b/src/bufr_util.c @@ -14,38 +14,39 @@ /* The argument 'keys' is an input as well as output from each call */ int compute_bufr_key_rank(grib_handle* h, grib_string_list* keys, const char* key) { - grib_string_list* next=keys; - grib_string_list* prev=keys; - int theRank=0; - size_t size=0; - grib_context* c=h->context; + grib_string_list* next = keys; + grib_string_list* prev = keys; + int theRank = 0; + size_t size = 0; + grib_context* c = h->context; DebugAssert(h->product_kind == PRODUCT_BUFR); while (next && next->value && strcmp(next->value, key)) { - prev=next; - next=next->next; + prev = next; + next = next->next; } if (!next) { DebugAssert(prev); prev->next = (grib_string_list*)grib_context_malloc_clear(c, sizeof(grib_string_list)); - next=prev->next; + next = prev->next; } if (!next->value) { - next->value=strdup(key); - next->count=0; + next->value = strdup(key); + next->count = 0; } next->count++; - theRank=next->count; - if (theRank==1) { + theRank = next->count; + if (theRank == 1) { /* If the count is 1 it could mean two things: */ /* This is the first instance of the key and there is another one */ /* This is the first and only instance of the key */ /* So we check if there is a second one of this key, */ /* If not, then rank is zero i.e. this is the only instance */ - char* s = (char*)grib_context_malloc_clear(c, strlen(key)+5); + char* s = (char*)grib_context_malloc_clear(c, strlen(key) + 5); sprintf(s, "#2#%s", key); - if (grib_get_size(h, s, &size) == GRIB_NOT_FOUND) theRank=0; + if (grib_get_size(h, s, &size) == GRIB_NOT_FOUND) + theRank = 0; grib_context_free(c, s); } @@ -54,41 +55,41 @@ int compute_bufr_key_rank(grib_handle* h, grib_string_list* keys, const char* ke char** codes_bufr_copy_data_return_copied_keys(grib_handle* hin, grib_handle* hout, size_t* nkeys, int* err) { - bufr_keys_iterator* kiter=NULL; - char* name=0; - char** keys=NULL; - grib_sarray* k=0; + bufr_keys_iterator* kiter = NULL; + char* name = 0; + char** keys = NULL; + grib_sarray* k = 0; - if (hin==NULL || hout==NULL) { + if (hin == NULL || hout == NULL) { *err = GRIB_NULL_HANDLE; return NULL; } - kiter=codes_bufr_data_section_keys_iterator_new(hin); - if (!kiter) return NULL; - k=grib_sarray_new(hin->context, 50, 10); + kiter = codes_bufr_data_section_keys_iterator_new(hin); + if (!kiter) + return NULL; + k = grib_sarray_new(hin->context, 50, 10); - while (codes_bufr_keys_iterator_next(kiter)) - { + while (codes_bufr_keys_iterator_next(kiter)) { name = codes_bufr_keys_iterator_get_name(kiter); /* if the copy fails we want to keep copying without any errors. This is because the copy can be between structures that are not identical and we want to copy what can be copied and skip what cannot be copied because is not in the output handle */ - *err=codes_copy_key(hin, hout, name, 0); - if (*err==0) { + *err = codes_copy_key(hin, hout, name, 0); + if (*err == 0) { /* 'name' will be freed when we call codes_bufr_keys_iterator_delete so copy */ char* copied_name = strdup(name); - k=grib_sarray_push(hin->context, k, copied_name); + k = grib_sarray_push(hin->context, k, copied_name); } } - *nkeys=grib_sarray_used_size(k); - keys=grib_sarray_get_array(hin->context, k); + *nkeys = grib_sarray_used_size(k); + keys = grib_sarray_get_array(hin->context, k); grib_sarray_delete(hin->context, k); if (*nkeys > 0) { /* Do the pack if something was copied */ - *err=grib_set_long(hout, "pack", 1); + *err = grib_set_long(hout, "pack", 1); } codes_bufr_keys_iterator_delete(kiter); return keys; @@ -96,33 +97,34 @@ char** codes_bufr_copy_data_return_copied_keys(grib_handle* hin, grib_handle* ho int codes_bufr_copy_data(grib_handle* hin, grib_handle* hout) { - bufr_keys_iterator* kiter=NULL; - char* name=0; - int err=0; - int nkeys=0; + bufr_keys_iterator* kiter = NULL; + char* name = 0; + int err = 0; + int nkeys = 0; - if (hin==NULL || hout==NULL) { + if (hin == NULL || hout == NULL) { return GRIB_NULL_HANDLE; } - kiter=codes_bufr_data_section_keys_iterator_new(hin); - if (!kiter) return GRIB_INTERNAL_ERROR; + kiter = codes_bufr_data_section_keys_iterator_new(hin); + if (!kiter) + return GRIB_INTERNAL_ERROR; - while (codes_bufr_keys_iterator_next(kiter)) - { + while (codes_bufr_keys_iterator_next(kiter)) { name = codes_bufr_keys_iterator_get_name(kiter); /* if the copy fails we want to keep copying without any error messages. This is because the copy can be between structures that are not identical and we want to copy what can be copied and skip what cannot be copied because is not in the output handle */ - err=codes_copy_key(hin, hout, name, GRIB_TYPE_UNDEFINED); - if (err==0) nkeys++; + err = codes_copy_key(hin, hout, name, GRIB_TYPE_UNDEFINED); + if (err == 0) + nkeys++; } if (nkeys > 0) { /* Do the pack if something was copied */ - err=grib_set_long(hout, "pack", 1); + err = grib_set_long(hout, "pack", 1); } codes_bufr_keys_iterator_delete(kiter); @@ -133,7 +135,7 @@ int codes_bufr_copy_data(grib_handle* hin, grib_handle* hout) static int bufr_extract_edition(const void* message, long* edition) { const long nbits_edition = 8; - long pos_edition = 7*8; + long pos_edition = 7 * 8; *edition = (long)grib_decode_unsigned_long(message, &pos_edition, nbits_edition); return GRIB_SUCCESS; @@ -141,19 +143,19 @@ static int bufr_extract_edition(const void* message, long* edition) /* The ECMWF BUFR local use section */ static int bufr_decode_rdb_keys(const void* message, long offset_section2, codes_bufr_header* hdr) { - long nbits_rdbType = 1*8; - long pos_rdbType = (offset_section2+4)*8; - long nbits_oldSubtype = 1*8; - long pos_oldSubtype = (offset_section2+5)*8; - - long nbits_qualityControl = 1*8; - long pos_qualityControl = (offset_section2+48)*8; - long nbits_newSubtype = 2*8; - long pos_newSubtype = (offset_section2+49)*8; - long nbits_daLoop = 1*8; - long pos_daLoop = (offset_section2+51)*8; - - long start = 0; + long nbits_rdbType = 1 * 8; + long pos_rdbType = (offset_section2 + 4) * 8; + long nbits_oldSubtype = 1 * 8; + long pos_oldSubtype = (offset_section2 + 5) * 8; + + long nbits_qualityControl = 1 * 8; + long pos_qualityControl = (offset_section2 + 48) * 8; + long nbits_newSubtype = 2 * 8; + long pos_newSubtype = (offset_section2 + 49) * 8; + long nbits_daLoop = 1 * 8; + long pos_daLoop = (offset_section2 + 51) * 8; + + long start = 0; const long offset_keyData = offset_section2 + 6; const long offset_rdbtime = offset_section2 + 38; const long offset_rectime = offset_section2 + 41; @@ -162,10 +164,10 @@ static int bufr_decode_rdb_keys(const void* message, long offset_section2, codes DebugAssert(hdr->ecmwfLocalSectionPresent); - hdr->rdbType = (long)grib_decode_unsigned_long(message, &pos_rdbType, nbits_rdbType); + hdr->rdbType = (long)grib_decode_unsigned_long(message, &pos_rdbType, nbits_rdbType); hdr->oldSubtype = (long)grib_decode_unsigned_long(message, &pos_oldSubtype, nbits_oldSubtype); - start = 0; + start = 0; hdr->localYear = (long)grib_decode_unsigned_long(p, &start, 12); hdr->localMonth = (long)grib_decode_unsigned_long(p, &start, 4); hdr->localDay = (long)grib_decode_unsigned_long(p, &start, 6); @@ -174,16 +176,16 @@ static int bufr_decode_rdb_keys(const void* message, long offset_section2, codes hdr->localSecond = (long)grib_decode_unsigned_long(p, &start, 6); /* rdbtime */ - p = (unsigned char*)message + offset_rdbtime; - start = 0; + p = (unsigned char*)message + offset_rdbtime; + start = 0; hdr->rdbtimeDay = (long)grib_decode_unsigned_long(p, &start, 6); hdr->rdbtimeHour = (long)grib_decode_unsigned_long(p, &start, 5); hdr->rdbtimeMinute = (long)grib_decode_unsigned_long(p, &start, 6); hdr->rdbtimeSecond = (long)grib_decode_unsigned_long(p, &start, 6); /* rectime */ - p = (unsigned char*)message + offset_rectime; - start = 0; + p = (unsigned char*)message + offset_rectime; + start = 0; hdr->rectimeDay = (long)grib_decode_unsigned_long(p, &start, 6); hdr->rectimeHour = (long)grib_decode_unsigned_long(p, &start, 5); hdr->rectimeMinute = (long)grib_decode_unsigned_long(p, &start, 6); @@ -192,7 +194,7 @@ static int bufr_decode_rdb_keys(const void* message, long offset_section2, codes hdr->qualityControl = (long)grib_decode_unsigned_long(message, &pos_qualityControl, nbits_qualityControl); hdr->newSubtype = (long)grib_decode_unsigned_long(message, &pos_newSubtype, nbits_newSubtype); hdr->daLoop = (long)grib_decode_unsigned_long(message, &pos_daLoop, nbits_daLoop); - hdr->rdbSubtype = (hdr->oldSubtype < 255) ? hdr->oldSubtype : hdr->newSubtype; + hdr->rdbSubtype = (hdr->oldSubtype < 255) ? hdr->oldSubtype : hdr->newSubtype; return GRIB_SUCCESS; } @@ -200,72 +202,71 @@ static int bufr_decode_rdb_keys(const void* message, long offset_section2, codes /* The ECMWF BUFR local use section */ static int bufr_decode_extra_rdb_keys(const void* message, long offset_section2, codes_bufr_header* hdr) { - size_t i = 0; - int isSatelliteType = 0; - long start = 0; + size_t i = 0; + int isSatelliteType = 0; + long start = 0; const long offset_keyData = offset_section2 + 6; const long offset_keyMore = offset_section2 + 19; /* 8 bytes long */ const long offset_keySat = offset_section2 + 27; /* 9 bytes long */ unsigned char* pKeyData = (unsigned char*)message + offset_keyData; - char* pKeyMore = (char*)message + offset_keyMore; + char* pKeyMore = (char*)message + offset_keyMore; DebugAssert(hdr->ecmwfLocalSectionPresent); - if ( hdr->rdbType == 2 || hdr->rdbType == 3 || hdr->rdbType == 8 || hdr->rdbType == 12 ) { + if (hdr->rdbType == 2 || hdr->rdbType == 3 || hdr->rdbType == 8 || hdr->rdbType == 12) { isSatelliteType = 1; } if (isSatelliteType || hdr->numberOfSubsets > 1) { hdr->isSatellite = 1; - } else { + } + else { hdr->isSatellite = 0; } if (hdr->isSatellite) { unsigned char* pKeyMoreLong = (unsigned char*)message + offset_keyMore; /* as an integer */ unsigned char* pKeySat = (unsigned char*)message + offset_keySat; - long lValue = 0; - start = 40; - lValue = (long)grib_decode_unsigned_long(pKeyData, &start, 26); - hdr->localLongitude1 = (lValue - 18000000.0)/100000.0; - start = 72; - lValue = (long)grib_decode_unsigned_long(pKeyData, &start, 25); - hdr->localLatitude1 = (lValue - 9000000.0)/100000.0; - start = 0; - lValue = (long)grib_decode_unsigned_long(pKeyMoreLong, &start, 26); - hdr->localLongitude2 = (lValue -18000000.0)/100000.0; - start = 32; - lValue = (long)grib_decode_unsigned_long(pKeyMoreLong, &start, 25); - hdr->localLatitude2 = (lValue - 9000000)/100000.0; + long lValue = 0; + start = 40; + lValue = (long)grib_decode_unsigned_long(pKeyData, &start, 26); + hdr->localLongitude1 = (lValue - 18000000.0) / 100000.0; + start = 72; + lValue = (long)grib_decode_unsigned_long(pKeyData, &start, 25); + hdr->localLatitude1 = (lValue - 9000000.0) / 100000.0; + start = 0; + lValue = (long)grib_decode_unsigned_long(pKeyMoreLong, &start, 26); + hdr->localLongitude2 = (lValue - 18000000.0) / 100000.0; + start = 32; + lValue = (long)grib_decode_unsigned_long(pKeyMoreLong, &start, 25); + hdr->localLatitude2 = (lValue - 9000000) / 100000.0; if (hdr->oldSubtype == 255 || hdr->numberOfSubsets > 255 || - (hdr->oldSubtype >= 121 && hdr->oldSubtype <= 130) || - hdr->oldSubtype==31) - { - start = 0; + (hdr->oldSubtype >= 121 && hdr->oldSubtype <= 130) || + hdr->oldSubtype == 31) { + start = 0; hdr->localNumberOfObservations = (long)grib_decode_unsigned_long(pKeySat, &start, 16); - start = 16; - hdr->satelliteID = (long)grib_decode_unsigned_long(pKeySat, &start, 16); + start = 16; + hdr->satelliteID = (long)grib_decode_unsigned_long(pKeySat, &start, 16); } - else - { - start = 0; + else { + start = 0; hdr->localNumberOfObservations = (long)grib_decode_unsigned_long(pKeySat, &start, 8); - start = 8; - hdr->satelliteID = (long)grib_decode_unsigned_long(pKeySat, &start, 16); + start = 8; + hdr->satelliteID = (long)grib_decode_unsigned_long(pKeySat, &start, 16); } } else { - long lValue = 0; - start = 72; - lValue = (long)grib_decode_unsigned_long(pKeyData, &start, 25); - hdr->localLatitude = (lValue -9000000.0)/100000.0; - start = 40; - lValue = (long)grib_decode_unsigned_long(pKeyData, &start, 26); - hdr->localLongitude = (lValue - 18000000.0)/100000.0; + long lValue = 0; + start = 72; + lValue = (long)grib_decode_unsigned_long(pKeyData, &start, 25); + hdr->localLatitude = (lValue - 9000000.0) / 100000.0; + start = 40; + lValue = (long)grib_decode_unsigned_long(pKeyData, &start, 26); + hdr->localLongitude = (lValue - 18000000.0) / 100000.0; /* interpret keyMore as a string */ - for (i=0; i<8; ++i) { + for (i = 0; i < 8; ++i) { hdr->ident[i] = *pKeyMore++; } hdr->ident[i] = '\0'; @@ -278,119 +279,119 @@ static int bufr_decode_edition3(const void* message, codes_bufr_header* hdr) { int err = GRIB_SUCCESS; - unsigned long totalLength = 0; - const long nbits_totalLength = 3*8; - long pos_totalLength = 4*8; + unsigned long totalLength = 0; + const long nbits_totalLength = 3 * 8; + long pos_totalLength = 4 * 8; - unsigned long section1Length = 0; - const long nbits_section1Length = 3*8; - long pos_section1Length = 8*8; + unsigned long section1Length = 0; + const long nbits_section1Length = 3 * 8; + long pos_section1Length = 8 * 8; - long nbits_masterTableNumber = 1*8; - long pos_masterTableNumber = 11*8; + long nbits_masterTableNumber = 1 * 8; + long pos_masterTableNumber = 11 * 8; - long nbits_bufrHeaderSubCentre = 1*8; - long pos_bufrHeaderSubCentre = 12*8; + long nbits_bufrHeaderSubCentre = 1 * 8; + long pos_bufrHeaderSubCentre = 12 * 8; - long nbits_bufrHeaderCentre = 1*8; - long pos_bufrHeaderCentre = 13*8; + long nbits_bufrHeaderCentre = 1 * 8; + long pos_bufrHeaderCentre = 13 * 8; - long nbits_updateSequenceNumber = 1*8; - long pos_updateSequenceNumber = 14*8; + long nbits_updateSequenceNumber = 1 * 8; + long pos_updateSequenceNumber = 14 * 8; - long section1Flags = 0; - long nbits_section1Flags = 1*8; - long pos_section1Flags = 15*8; + long section1Flags = 0; + long nbits_section1Flags = 1 * 8; + long pos_section1Flags = 15 * 8; - long nbits_dataCategory = 1*8; - long pos_dataCategory = 16*8; + long nbits_dataCategory = 1 * 8; + long pos_dataCategory = 16 * 8; - long nbits_dataSubCategory = 1*8; - long pos_dataSubCategory = 17*8; + long nbits_dataSubCategory = 1 * 8; + long pos_dataSubCategory = 17 * 8; - long nbits_masterTablesVersionNumber = 1*8; - long pos_masterTablesVersionNumber = 18*8; + long nbits_masterTablesVersionNumber = 1 * 8; + long pos_masterTablesVersionNumber = 18 * 8; - long nbits_localTablesVersionNumber = 1*8; - long pos_localTablesVersionNumber = 19*8; + long nbits_localTablesVersionNumber = 1 * 8; + long pos_localTablesVersionNumber = 19 * 8; - const long typicalCentury = 21; /* This century */ - long typicalYearOfCentury = 0; - long nbits_typicalYearOfCentury = 1*8; - long pos_typicalYearOfCentury = 20*8; + const long typicalCentury = 21; /* This century */ + long typicalYearOfCentury = 0; + long nbits_typicalYearOfCentury = 1 * 8; + long pos_typicalYearOfCentury = 20 * 8; - long nbits_typicalMonth = 1*8; - long pos_typicalMonth = 21*8; + long nbits_typicalMonth = 1 * 8; + long pos_typicalMonth = 21 * 8; - long nbits_typicalDay = 1*8; - long pos_typicalDay = 22*8; + long nbits_typicalDay = 1 * 8; + long pos_typicalDay = 22 * 8; - long nbits_typicalHour = 1*8; - long pos_typicalHour = 23*8; + long nbits_typicalHour = 1 * 8; + long pos_typicalHour = 23 * 8; - long nbits_typicalMinute = 1*8; - long pos_typicalMinute = 24*8; + long nbits_typicalMinute = 1 * 8; + long pos_typicalMinute = 24 * 8; - long section2Length = 0; - long offset_section2 = 0; - long offset_section3 = 0; - long nbits_numberOfSubsets = 2*8; - long pos_numberOfSubsets = 0; /*depends on offset_section3*/ + long section2Length = 0; + long offset_section2 = 0; + long offset_section3 = 0; + long nbits_numberOfSubsets = 2 * 8; + long pos_numberOfSubsets = 0; /*depends on offset_section3*/ long section3Flags; - long nbits_section3Flags = 1*8; - long pos_section3Flags = 0; /*depends on offset_section3*/ + long nbits_section3Flags = 1 * 8; + long pos_section3Flags = 0; /*depends on offset_section3*/ - totalLength = grib_decode_unsigned_long(message, &pos_totalLength, nbits_totalLength); + totalLength = grib_decode_unsigned_long(message, &pos_totalLength, nbits_totalLength); if (totalLength != hdr->message_size) { return GRIB_WRONG_LENGTH; } - section1Length = grib_decode_unsigned_long(message, &pos_section1Length, nbits_section1Length); - hdr->masterTableNumber = (long)grib_decode_unsigned_long(message, &pos_masterTableNumber, nbits_masterTableNumber); - hdr->bufrHeaderSubCentre = (long)grib_decode_unsigned_long(message, &pos_bufrHeaderSubCentre, nbits_bufrHeaderSubCentre); - hdr->bufrHeaderCentre = (long)grib_decode_unsigned_long(message, &pos_bufrHeaderCentre, nbits_bufrHeaderCentre); - hdr->updateSequenceNumber = (long)grib_decode_unsigned_long(message, &pos_updateSequenceNumber, nbits_updateSequenceNumber); - section1Flags = (long)grib_decode_unsigned_long(message, &pos_section1Flags, nbits_section1Flags); - hdr->dataCategory = (long)grib_decode_unsigned_long(message, &pos_dataCategory, nbits_dataCategory); - hdr->dataSubCategory = (long)grib_decode_unsigned_long(message, &pos_dataSubCategory, nbits_dataSubCategory); + section1Length = grib_decode_unsigned_long(message, &pos_section1Length, nbits_section1Length); + hdr->masterTableNumber = (long)grib_decode_unsigned_long(message, &pos_masterTableNumber, nbits_masterTableNumber); + hdr->bufrHeaderSubCentre = (long)grib_decode_unsigned_long(message, &pos_bufrHeaderSubCentre, nbits_bufrHeaderSubCentre); + hdr->bufrHeaderCentre = (long)grib_decode_unsigned_long(message, &pos_bufrHeaderCentre, nbits_bufrHeaderCentre); + hdr->updateSequenceNumber = (long)grib_decode_unsigned_long(message, &pos_updateSequenceNumber, nbits_updateSequenceNumber); + section1Flags = (long)grib_decode_unsigned_long(message, &pos_section1Flags, nbits_section1Flags); + hdr->dataCategory = (long)grib_decode_unsigned_long(message, &pos_dataCategory, nbits_dataCategory); + hdr->dataSubCategory = (long)grib_decode_unsigned_long(message, &pos_dataSubCategory, nbits_dataSubCategory); hdr->masterTablesVersionNumber = (long)grib_decode_unsigned_long( - message, &pos_masterTablesVersionNumber, nbits_masterTablesVersionNumber); + message, &pos_masterTablesVersionNumber, nbits_masterTablesVersionNumber); hdr->localTablesVersionNumber = (long)grib_decode_unsigned_long(message, &pos_localTablesVersionNumber, nbits_localTablesVersionNumber); - typicalYearOfCentury = (long)grib_decode_unsigned_long(message, &pos_typicalYearOfCentury, nbits_typicalYearOfCentury); - hdr->typicalYear = (typicalCentury - 1) * 100 + typicalYearOfCentury; - hdr->typicalMonth = (long)grib_decode_unsigned_long(message, &pos_typicalMonth, nbits_typicalMonth); - hdr->typicalDay = (long)grib_decode_unsigned_long(message, &pos_typicalDay, nbits_typicalDay); - hdr->typicalHour = (long)grib_decode_unsigned_long(message, &pos_typicalHour, nbits_typicalHour); - hdr->typicalMinute = (long)grib_decode_unsigned_long(message, &pos_typicalMinute, nbits_typicalMinute); - hdr->typicalSecond = 0; - hdr->typicalDate = hdr->typicalYear * 10000 + hdr->typicalMonth * 100 + hdr->typicalDay; - hdr->typicalTime = hdr->typicalHour * 10000 + hdr->typicalMinute * 100 + hdr->typicalSecond; - - offset_section2 = BUFR_SECTION0_LEN + section1Length; /*bytes*/ - section2Length = 0; + typicalYearOfCentury = (long)grib_decode_unsigned_long(message, &pos_typicalYearOfCentury, nbits_typicalYearOfCentury); + hdr->typicalYear = (typicalCentury - 1) * 100 + typicalYearOfCentury; + hdr->typicalMonth = (long)grib_decode_unsigned_long(message, &pos_typicalMonth, nbits_typicalMonth); + hdr->typicalDay = (long)grib_decode_unsigned_long(message, &pos_typicalDay, nbits_typicalDay); + hdr->typicalHour = (long)grib_decode_unsigned_long(message, &pos_typicalHour, nbits_typicalHour); + hdr->typicalMinute = (long)grib_decode_unsigned_long(message, &pos_typicalMinute, nbits_typicalMinute); + hdr->typicalSecond = 0; + hdr->typicalDate = hdr->typicalYear * 10000 + hdr->typicalMonth * 100 + hdr->typicalDay; + hdr->typicalTime = hdr->typicalHour * 10000 + hdr->typicalMinute * 100 + hdr->typicalSecond; + + offset_section2 = BUFR_SECTION0_LEN + section1Length; /*bytes*/ + section2Length = 0; hdr->localSectionPresent = (section1Flags != 0); if (hdr->localSectionPresent) { long pos_section2Length; - const long nbits_section2Length = 3*8; - pos_section2Length = offset_section2*8; + const long nbits_section2Length = 3 * 8; + pos_section2Length = offset_section2 * 8; section2Length = grib_decode_unsigned_long(message, &pos_section2Length, nbits_section2Length); if (hdr->bufrHeaderCentre == 98) { hdr->ecmwfLocalSectionPresent = 1; - err = bufr_decode_rdb_keys(message, offset_section2, hdr); + err = bufr_decode_rdb_keys(message, offset_section2, hdr); } } - offset_section3 = BUFR_SECTION0_LEN + section1Length + section2Length; /*bytes*/ - nbits_numberOfSubsets = 2*8; - pos_numberOfSubsets = (offset_section3+4)*8; + offset_section3 = BUFR_SECTION0_LEN + section1Length + section2Length; /*bytes*/ + nbits_numberOfSubsets = 2 * 8; + pos_numberOfSubsets = (offset_section3 + 4) * 8; hdr->numberOfSubsets = grib_decode_unsigned_long(message, &pos_numberOfSubsets, nbits_numberOfSubsets); - pos_section3Flags = (offset_section3+6)*8; + pos_section3Flags = (offset_section3 + 6) * 8; section3Flags = (long)grib_decode_unsigned_long(message, &pos_section3Flags, nbits_section3Flags); - hdr->observedData = (section3Flags & 1<<7) ? 1 : 0; - hdr->compressedData = (section3Flags & 1<<6) ? 1 : 0; + hdr->observedData = (section3Flags & 1 << 7) ? 1 : 0; + hdr->compressedData = (section3Flags & 1 << 6) ? 1 : 0; if (hdr->ecmwfLocalSectionPresent && hdr->bufrHeaderCentre == 98 && section2Length == 52) { err = bufr_decode_extra_rdb_keys(message, offset_section2, hdr); @@ -403,125 +404,125 @@ static int bufr_decode_edition4(const void* message, codes_bufr_header* hdr) { int err = GRIB_SUCCESS; - unsigned long totalLength = 0; - const long nbits_totalLength = 3*8; - long pos_totalLength = 4*8; + unsigned long totalLength = 0; + const long nbits_totalLength = 3 * 8; + long pos_totalLength = 4 * 8; unsigned long section1Length; - const long nbits_section1Length = 3*8; - long pos_section1Length = 8*8; + const long nbits_section1Length = 3 * 8; + long pos_section1Length = 8 * 8; - long nbits_masterTableNumber = 1*8; - long pos_masterTableNumber = 11*8; + long nbits_masterTableNumber = 1 * 8; + long pos_masterTableNumber = 11 * 8; - long nbits_bufrHeaderCentre = 2*8; - long pos_bufrHeaderCentre = 12*8; + long nbits_bufrHeaderCentre = 2 * 8; + long pos_bufrHeaderCentre = 12 * 8; - long nbits_bufrHeaderSubCentre = 2*8; - long pos_bufrHeaderSubCentre = 14*8; + long nbits_bufrHeaderSubCentre = 2 * 8; + long pos_bufrHeaderSubCentre = 14 * 8; - long nbits_updateSequenceNumber = 1*8; - long pos_updateSequenceNumber = 16*8; + long nbits_updateSequenceNumber = 1 * 8; + long pos_updateSequenceNumber = 16 * 8; - long section1Flags = 0; - long nbits_section1Flags = 1*8; - long pos_section1Flags = 17*8; + long section1Flags = 0; + long nbits_section1Flags = 1 * 8; + long pos_section1Flags = 17 * 8; - long nbits_dataCategory = 1*8; - long pos_dataCategory = 18*8; + long nbits_dataCategory = 1 * 8; + long pos_dataCategory = 18 * 8; - long nbits_internationalDataSubCategory = 1*8; - long pos_internationalDataSubCategory = 19*8; + long nbits_internationalDataSubCategory = 1 * 8; + long pos_internationalDataSubCategory = 19 * 8; - long nbits_dataSubCategory = 1*8; - long pos_dataSubCategory = 20*8; + long nbits_dataSubCategory = 1 * 8; + long pos_dataSubCategory = 20 * 8; - long nbits_masterTablesVersionNumber = 1*8; - long pos_masterTablesVersionNumber = 21*8; + long nbits_masterTablesVersionNumber = 1 * 8; + long pos_masterTablesVersionNumber = 21 * 8; - long nbits_localTablesVersionNumber = 1*8; - long pos_localTablesVersionNumber = 22*8; + long nbits_localTablesVersionNumber = 1 * 8; + long pos_localTablesVersionNumber = 22 * 8; - long typicalYear2 = 0; /* corrected */ - long nbits_typicalYear = 2*8; - long pos_typicalYear = 23*8; + long typicalYear2 = 0; /* corrected */ + long nbits_typicalYear = 2 * 8; + long pos_typicalYear = 23 * 8; - long nbits_typicalMonth = 1*8; - long pos_typicalMonth = 25*8; + long nbits_typicalMonth = 1 * 8; + long pos_typicalMonth = 25 * 8; - long nbits_typicalDay = 1*8; - long pos_typicalDay = 26*8; + long nbits_typicalDay = 1 * 8; + long pos_typicalDay = 26 * 8; - long nbits_typicalHour = 1*8; - long pos_typicalHour = 27*8; + long nbits_typicalHour = 1 * 8; + long pos_typicalHour = 27 * 8; - long nbits_typicalMinute = 1*8; - long pos_typicalMinute = 28*8; + long nbits_typicalMinute = 1 * 8; + long pos_typicalMinute = 28 * 8; - long nbits_typicalSecond = 1*8; - long pos_typicalSecond = 29*8; + long nbits_typicalSecond = 1 * 8; + long pos_typicalSecond = 29 * 8; - long section2Length = 0; - long offset_section2 = 0; - long offset_section3 = 0; - long nbits_numberOfSubsets = 2*8; - long pos_numberOfSubsets = 0; /*depends on offset_section3*/ + long section2Length = 0; + long offset_section2 = 0; + long offset_section3 = 0; + long nbits_numberOfSubsets = 2 * 8; + long pos_numberOfSubsets = 0; /*depends on offset_section3*/ long section3Flags; - long nbits_section3Flags = 1*8; - long pos_section3Flags = 0; /*depends on offset_section3*/ + long nbits_section3Flags = 1 * 8; + long pos_section3Flags = 0; /*depends on offset_section3*/ - totalLength = grib_decode_unsigned_long(message, &pos_totalLength, nbits_totalLength); + totalLength = grib_decode_unsigned_long(message, &pos_totalLength, nbits_totalLength); if (totalLength != hdr->message_size) { return GRIB_WRONG_LENGTH; } - section1Length = grib_decode_unsigned_long(message, &pos_section1Length, nbits_section1Length); - hdr->masterTableNumber = (long)grib_decode_unsigned_long(message, &pos_masterTableNumber, nbits_masterTableNumber); - hdr->bufrHeaderCentre = (long)grib_decode_unsigned_long(message, &pos_bufrHeaderCentre, nbits_bufrHeaderCentre); - hdr->bufrHeaderSubCentre = (long)grib_decode_unsigned_long(message, &pos_bufrHeaderSubCentre, nbits_bufrHeaderSubCentre); - hdr->updateSequenceNumber = (long)grib_decode_unsigned_long(message, &pos_updateSequenceNumber, nbits_updateSequenceNumber); - section1Flags = (long)grib_decode_unsigned_long(message, &pos_section1Flags, nbits_section1Flags); - hdr->dataCategory = (long)grib_decode_unsigned_long(message, &pos_dataCategory, nbits_dataCategory); + section1Length = grib_decode_unsigned_long(message, &pos_section1Length, nbits_section1Length); + hdr->masterTableNumber = (long)grib_decode_unsigned_long(message, &pos_masterTableNumber, nbits_masterTableNumber); + hdr->bufrHeaderCentre = (long)grib_decode_unsigned_long(message, &pos_bufrHeaderCentre, nbits_bufrHeaderCentre); + hdr->bufrHeaderSubCentre = (long)grib_decode_unsigned_long(message, &pos_bufrHeaderSubCentre, nbits_bufrHeaderSubCentre); + hdr->updateSequenceNumber = (long)grib_decode_unsigned_long(message, &pos_updateSequenceNumber, nbits_updateSequenceNumber); + section1Flags = (long)grib_decode_unsigned_long(message, &pos_section1Flags, nbits_section1Flags); + hdr->dataCategory = (long)grib_decode_unsigned_long(message, &pos_dataCategory, nbits_dataCategory); hdr->internationalDataSubCategory = (long)grib_decode_unsigned_long(message, &pos_internationalDataSubCategory, nbits_internationalDataSubCategory); - hdr->dataSubCategory = (long)grib_decode_unsigned_long(message, &pos_dataSubCategory, nbits_dataSubCategory); - hdr->masterTablesVersionNumber = (long)grib_decode_unsigned_long(message, &pos_masterTablesVersionNumber, nbits_masterTablesVersionNumber); - hdr->localTablesVersionNumber = (long)grib_decode_unsigned_long(message, &pos_localTablesVersionNumber, nbits_localTablesVersionNumber); + hdr->dataSubCategory = (long)grib_decode_unsigned_long(message, &pos_dataSubCategory, nbits_dataSubCategory); + hdr->masterTablesVersionNumber = (long)grib_decode_unsigned_long(message, &pos_masterTablesVersionNumber, nbits_masterTablesVersionNumber); + hdr->localTablesVersionNumber = (long)grib_decode_unsigned_long(message, &pos_localTablesVersionNumber, nbits_localTablesVersionNumber); hdr->typicalYear = (long)grib_decode_unsigned_long(message, &pos_typicalYear, nbits_typicalYear); - typicalYear2 = hdr->typicalYear < 100 ? 2000 + hdr->typicalYear : hdr->typicalYear; /*ECC-556*/ + typicalYear2 = hdr->typicalYear < 100 ? 2000 + hdr->typicalYear : hdr->typicalYear; /*ECC-556*/ hdr->typicalMonth = (long)grib_decode_unsigned_long(message, &pos_typicalMonth, nbits_typicalMonth); hdr->typicalDay = (long)grib_decode_unsigned_long(message, &pos_typicalDay, nbits_typicalDay); hdr->typicalHour = (long)grib_decode_unsigned_long(message, &pos_typicalHour, nbits_typicalHour); hdr->typicalMinute = (long)grib_decode_unsigned_long(message, &pos_typicalMinute, nbits_typicalMinute); hdr->typicalSecond = (long)grib_decode_unsigned_long(message, &pos_typicalSecond, nbits_typicalSecond); - hdr->typicalDate = typicalYear2 * 10000 + hdr->typicalMonth * 100 + hdr->typicalDay; - hdr->typicalTime = hdr->typicalHour * 10000 + hdr->typicalMinute * 100 + hdr->typicalSecond; + hdr->typicalDate = typicalYear2 * 10000 + hdr->typicalMonth * 100 + hdr->typicalDay; + hdr->typicalTime = hdr->typicalHour * 10000 + hdr->typicalMinute * 100 + hdr->typicalSecond; - offset_section2 = BUFR_SECTION0_LEN + section1Length; /*bytes*/ - section2Length = 0; + offset_section2 = BUFR_SECTION0_LEN + section1Length; /*bytes*/ + section2Length = 0; hdr->localSectionPresent = (section1Flags != 0); if (hdr->localSectionPresent) { long pos_section2Length; - const long nbits_section2Length = 3*8; - pos_section2Length = offset_section2*8; + const long nbits_section2Length = 3 * 8; + pos_section2Length = offset_section2 * 8; section2Length = grib_decode_unsigned_long(message, &pos_section2Length, nbits_section2Length); if (hdr->bufrHeaderCentre == 98) { hdr->ecmwfLocalSectionPresent = 1; - err = bufr_decode_rdb_keys(message, offset_section2, hdr); + err = bufr_decode_rdb_keys(message, offset_section2, hdr); } } - offset_section3 = BUFR_SECTION0_LEN + section1Length + section2Length; /*bytes*/ - nbits_numberOfSubsets = 2*8; - pos_numberOfSubsets = (offset_section3+4)*8; + offset_section3 = BUFR_SECTION0_LEN + section1Length + section2Length; /*bytes*/ + nbits_numberOfSubsets = 2 * 8; + pos_numberOfSubsets = (offset_section3 + 4) * 8; hdr->numberOfSubsets = grib_decode_unsigned_long(message, &pos_numberOfSubsets, nbits_numberOfSubsets); - pos_section3Flags = (offset_section3+6)*8; + pos_section3Flags = (offset_section3 + 6) * 8; section3Flags = (long)grib_decode_unsigned_long(message, &pos_section3Flags, nbits_section3Flags); - hdr->observedData = (section3Flags & 1<<7) ? 1 : 0; - hdr->compressedData = (section3Flags & 1<<6) ? 1 : 0; + hdr->observedData = (section3Flags & 1 << 7) ? 1 : 0; + hdr->compressedData = (section3Flags & 1 << 6) ? 1 : 0; if (hdr->ecmwfLocalSectionPresent && hdr->bufrHeaderCentre == 98 && section2Length == 52) { err = bufr_decode_extra_rdb_keys(message, offset_section2, hdr); @@ -541,9 +542,11 @@ static int bufr_decode_header(grib_context* c, const void* message, off_t offset if (hdr->edition == 3) { err = bufr_decode_edition3(message, hdr); - } else if (hdr->edition == 4) { + } + else if (hdr->edition == 4) { err = bufr_decode_edition4(message, hdr); - } else { + } + else { grib_context_log(c, GRIB_LOG_ERROR, "Unsupported BUFR edition: %ld", hdr->edition); err = GRIB_DECODING_ERROR; } @@ -553,16 +556,17 @@ static int bufr_decode_header(grib_context* c, const void* message, off_t offset static int count_bufr_messages(grib_context* c, FILE* f, int* n, int strict_mode) { - int err=0; - void* mesg=NULL; - size_t size=0; - off_t offset=0; - int done = 0; + int err = 0; + void* mesg = NULL; + size_t size = 0; + off_t offset = 0; + int done = 0; *n = 0; - if (!c) c=grib_context_get_default(); + if (!c) + c = grib_context_get_default(); - while(!done) { + while (!done) { mesg = wmo_read_bufr_from_file_malloc(f, 0, &size, &offset, &err); /*printf("Count so far=%ld, mesg=%x, err=%d (%s)\n", *count, mesg, err, grib_get_error_message(err));*/ if (!mesg) { @@ -570,27 +574,30 @@ static int count_bufr_messages(grib_context* c, FILE* f, int* n, int strict_mode done = 1; /* reached the end */ break; } - if (strict_mode) return GRIB_DECODING_ERROR; + if (strict_mode) + return GRIB_DECODING_ERROR; } if (mesg && !err) { - grib_context_free(c,mesg); + grib_context_free(c, mesg); } (*n)++; } rewind(f); - if (err==GRIB_END_OF_FILE) err=GRIB_SUCCESS; + if (err == GRIB_END_OF_FILE) + err = GRIB_SUCCESS; return err; } int codes_bufr_extract_headers_malloc(grib_context* c, const char* filename, codes_bufr_header** result, int* num_messages, int strict_mode) { int err = 0, i = 0; - FILE* fp = NULL; - void* mesg = NULL; - size_t size = 0; + FILE* fp = NULL; + void* mesg = NULL; + size_t size = 0; off_t offset = 0; - if (!c) c=grib_context_get_default(); + if (!c) + c = grib_context_get_default(); fp = fopen(filename, "rb"); if (!fp) { grib_context_log(c, GRIB_LOG_ERROR, "codes_bufr_extract_headers_malloc: Unable to read file \"%s\"", filename); @@ -616,7 +623,8 @@ int codes_bufr_extract_headers_malloc(grib_context* c, const char* filename, cod } i = 0; while (err != GRIB_END_OF_FILE) { - if (i >= *num_messages) break; + if (i >= *num_messages) + break; mesg = wmo_read_bufr_from_file_malloc(fp, 0, &size, &offset, &err); if (mesg != NULL && err == 0) { int err2 = bufr_decode_header(c, mesg, offset, size, &(*result)[i]); @@ -653,50 +661,94 @@ int codes_bufr_extract_headers_malloc(grib_context* c, const char* filename, cod static char* codes_bufr_header_get_centre_name(long edition, long centre_code) { switch (centre_code) { - case 1: return "ammc"; - case 4: return "rums"; - case 7: return "kwbc"; - case 24: return "fapr"; - case 28: return "vabb"; - case 29: return "dems"; - case 34: return "rjtd"; - case 38: return "babj"; - case 40: return "rksl"; - case 41: return "sabm"; - case 46: return "sbsj"; - case 54: return "cwao"; - case 58: return "fnmo"; - case 69: return "nzkl"; - case 74: return "egrr"; - case 78: return "edzw"; - case 80: return "cnmc"; - case 82: return "eswi"; - case 84: return "lfpw"; - case 85: return "lfpw"; - case 86: return "efkl"; - case 88: return "enmi"; - case 94: return "ekmi"; - case 98: return "ecmf"; - case 173: return "nasa"; - case 195: return "wiix"; - case 204: return "niwa"; - case 214: return "lemm"; - case 215: return "lssw"; - case 218: return "habp"; - case 224: return "lowm"; - case 227: return "ebum"; - case 233: return "eidb"; - case 235: return "ingv"; - case 239: return "crfc"; - case 244: return "vuwien"; - case 245: return "knmi"; - case 246: return "ifmk"; - case 247: return "hadc"; - case 250: return "cosmo"; - case 252: return "mpim"; - case 254: return "eums"; - case 255: return "consensus"; - default: return NULL; + case 1: + return "ammc"; + case 4: + return "rums"; + case 7: + return "kwbc"; + case 24: + return "fapr"; + case 28: + return "vabb"; + case 29: + return "dems"; + case 34: + return "rjtd"; + case 38: + return "babj"; + case 40: + return "rksl"; + case 41: + return "sabm"; + case 46: + return "sbsj"; + case 54: + return "cwao"; + case 58: + return "fnmo"; + case 69: + return "nzkl"; + case 74: + return "egrr"; + case 78: + return "edzw"; + case 80: + return "cnmc"; + case 82: + return "eswi"; + case 84: + return "lfpw"; + case 85: + return "lfpw"; + case 86: + return "efkl"; + case 88: + return "enmi"; + case 94: + return "ekmi"; + case 98: + return "ecmf"; + case 173: + return "nasa"; + case 195: + return "wiix"; + case 204: + return "niwa"; + case 214: + return "lemm"; + case 215: + return "lssw"; + case 218: + return "habp"; + case 224: + return "lowm"; + case 227: + return "ebum"; + case 233: + return "eidb"; + case 235: + return "ingv"; + case 239: + return "crfc"; + case 244: + return "vuwien"; + case 245: + return "knmi"; + case 246: + return "ifmk"; + case 247: + return "hadc"; + case 250: + return "cosmo"; + case 252: + return "mpim"; + case 254: + return "eums"; + case 255: + return "consensus"; + default: + return NULL; } } @@ -758,89 +810,266 @@ static char* codes_bufr_header_get_centre_name(long edition, long centre_code) } #endif -int codes_bufr_header_get_string(codes_bufr_header* bh, const char* key, char *val, size_t *len) +int codes_bufr_header_get_string(codes_bufr_header* bh, const char* key, char* val, size_t* len) { static const char* NOT_FOUND = "not_found"; - int isEcmwfLocal = 0; + int isEcmwfLocal = 0; Assert(bh); Assert(key); *len = strlen(NOT_FOUND); /*By default*/ isEcmwfLocal = (bh->ecmwfLocalSectionPresent == 1); - Assert( !(isEcmwfLocal && bh->bufrHeaderCentre != 98) ); - Assert( !(bh->ecmwfLocalSectionPresent && !bh->localSectionPresent) ); - - if (strcmp(key, "message_offset")==0) *len = sprintf(val, "%lu", bh->message_offset); - else if (strcmp(key, "offset")==0) *len = sprintf(val, "%lu", bh->message_offset); - else if (strcmp(key, "message_size")==0) *len = sprintf(val, "%lu", bh->message_size); - else if (strcmp(key, "totalLength")==0) *len = sprintf(val, "%lu", bh->message_size); - else if (strcmp(key, "edition")==0) *len = sprintf(val, "%ld", bh->edition); - else if (strcmp(key, "masterTableNumber")==0) *len = sprintf(val, "%ld", bh->masterTableNumber); - else if (strcmp(key, "bufrHeaderSubCentre")==0) *len = sprintf(val, "%ld", bh->bufrHeaderSubCentre); - else if (strcmp(key, "bufrHeaderCentre")==0) *len = sprintf(val, "%ld", bh->bufrHeaderCentre); - - else if (strcmp(key, "centre")==0) { + Assert(!(isEcmwfLocal && bh->bufrHeaderCentre != 98)); + Assert(!(bh->ecmwfLocalSectionPresent && !bh->localSectionPresent)); + + if (strcmp(key, "message_offset") == 0) + *len = sprintf(val, "%lu", bh->message_offset); + else if (strcmp(key, "offset") == 0) + *len = sprintf(val, "%lu", bh->message_offset); + else if (strcmp(key, "message_size") == 0) + *len = sprintf(val, "%lu", bh->message_size); + else if (strcmp(key, "totalLength") == 0) + *len = sprintf(val, "%lu", bh->message_size); + else if (strcmp(key, "edition") == 0) + *len = sprintf(val, "%ld", bh->edition); + else if (strcmp(key, "masterTableNumber") == 0) + *len = sprintf(val, "%ld", bh->masterTableNumber); + else if (strcmp(key, "bufrHeaderSubCentre") == 0) + *len = sprintf(val, "%ld", bh->bufrHeaderSubCentre); + else if (strcmp(key, "bufrHeaderCentre") == 0) + *len = sprintf(val, "%ld", bh->bufrHeaderCentre); + + else if (strcmp(key, "centre") == 0) { char* centre_str = codes_bufr_header_get_centre_name(bh->edition, bh->bufrHeaderCentre); - if (centre_str) *len = sprintf(val, "%s", centre_str); - else *len = sprintf(val, "%ld", bh->bufrHeaderCentre); - } - - else if (strcmp(key, "updateSequenceNumber")==0) *len = sprintf(val, "%ld", bh->updateSequenceNumber); - else if (strcmp(key, "dataCategory")==0) *len = sprintf(val, "%ld", bh->dataCategory); - else if (strcmp(key, "dataSubCategory")==0) *len = sprintf(val, "%ld", bh->dataSubCategory); - else if (strcmp(key, "masterTablesVersionNumber")==0) *len = sprintf(val, "%ld", bh->masterTablesVersionNumber); - else if (strcmp(key, "localTablesVersionNumber")==0) *len = sprintf(val, "%ld", bh->localTablesVersionNumber); - else if (strcmp(key, "typicalYear")==0) *len = sprintf(val, "%ld", bh->typicalYear); - else if (strcmp(key, "typicalMonth")==0) *len = sprintf(val, "%ld", bh->typicalMonth); - else if (strcmp(key, "typicalDay")==0) *len = sprintf(val, "%ld", bh->typicalDay); - else if (strcmp(key, "typicalHour")==0) *len = sprintf(val, "%ld", bh->typicalHour); - else if (strcmp(key, "typicalMinute")==0) *len = sprintf(val, "%ld", bh->typicalMinute); - else if (strcmp(key, "typicalSecond")==0) *len = sprintf(val, "%ld", bh->typicalSecond); - else if (strcmp(key, "typicalDate")==0) *len = sprintf(val, "%06ld", bh->typicalDate); - else if (strcmp(key, "typicalTime")==0) *len = sprintf(val, "%06ld", bh->typicalTime); - else if (strcmp(key, "internationalDataSubCategory")==0) *len = sprintf(val, "%ld", bh->internationalDataSubCategory); - else if (strcmp(key, "localSectionPresent")==0) *len = sprintf(val, "%ld", bh->localSectionPresent); - else if (strcmp(key, "ecmwfLocalSectionPresent")==0) *len = sprintf(val, "%ld", bh->ecmwfLocalSectionPresent); + if (centre_str) + *len = sprintf(val, "%s", centre_str); + else + *len = sprintf(val, "%ld", bh->bufrHeaderCentre); + } + + else if (strcmp(key, "updateSequenceNumber") == 0) + *len = sprintf(val, "%ld", bh->updateSequenceNumber); + else if (strcmp(key, "dataCategory") == 0) + *len = sprintf(val, "%ld", bh->dataCategory); + else if (strcmp(key, "dataSubCategory") == 0) + *len = sprintf(val, "%ld", bh->dataSubCategory); + else if (strcmp(key, "masterTablesVersionNumber") == 0) + *len = sprintf(val, "%ld", bh->masterTablesVersionNumber); + else if (strcmp(key, "localTablesVersionNumber") == 0) + *len = sprintf(val, "%ld", bh->localTablesVersionNumber); + else if (strcmp(key, "typicalYear") == 0) + *len = sprintf(val, "%ld", bh->typicalYear); + else if (strcmp(key, "typicalMonth") == 0) + *len = sprintf(val, "%ld", bh->typicalMonth); + else if (strcmp(key, "typicalDay") == 0) + *len = sprintf(val, "%ld", bh->typicalDay); + else if (strcmp(key, "typicalHour") == 0) + *len = sprintf(val, "%ld", bh->typicalHour); + else if (strcmp(key, "typicalMinute") == 0) + *len = sprintf(val, "%ld", bh->typicalMinute); + else if (strcmp(key, "typicalSecond") == 0) + *len = sprintf(val, "%ld", bh->typicalSecond); + else if (strcmp(key, "typicalDate") == 0) + *len = sprintf(val, "%06ld", bh->typicalDate); + else if (strcmp(key, "typicalTime") == 0) + *len = sprintf(val, "%06ld", bh->typicalTime); + else if (strcmp(key, "internationalDataSubCategory") == 0) + *len = sprintf(val, "%ld", bh->internationalDataSubCategory); + else if (strcmp(key, "localSectionPresent") == 0) + *len = sprintf(val, "%ld", bh->localSectionPresent); + else if (strcmp(key, "ecmwfLocalSectionPresent") == 0) + *len = sprintf(val, "%ld", bh->ecmwfLocalSectionPresent); /* Local ECMWF keys. Can be absent so must return NOT_FOUND */ - else if (strcmp(key, "rdbType")==0) { if (isEcmwfLocal) *len = sprintf(val, "%ld", bh->rdbType); else strcpy(val, NOT_FOUND); } - else if (strcmp(key, "oldSubtype")==0) { if (isEcmwfLocal) *len = sprintf(val, "%ld", bh->oldSubtype); else strcpy(val, NOT_FOUND); } - else if (strcmp(key, "ident")==0) { - if (!isEcmwfLocal || strlen(bh->ident)==0) strcpy(val, NOT_FOUND); - else *len = sprintf(val, "%s", bh->ident); - } - else if (strcmp(key, "localYear")==0) { if (isEcmwfLocal) *len = sprintf(val, "%ld", bh->localYear); else strcpy(val, NOT_FOUND); } - else if (strcmp(key, "localMonth")==0) { if (isEcmwfLocal) *len = sprintf(val, "%ld", bh->localMonth); else strcpy(val, NOT_FOUND); } - else if (strcmp(key, "localDay")==0) { if (isEcmwfLocal) *len = sprintf(val, "%ld", bh->localDay); else strcpy(val, NOT_FOUND); } - else if (strcmp(key, "localHour")==0) { if (isEcmwfLocal) *len = sprintf(val, "%ld", bh->localHour); else strcpy(val, NOT_FOUND); } - else if (strcmp(key, "localMinute")==0) { if (isEcmwfLocal) *len = sprintf(val, "%ld", bh->localMinute); else strcpy(val, NOT_FOUND); } - else if (strcmp(key, "localSecond")==0) { if (isEcmwfLocal) *len = sprintf(val, "%ld", bh->localSecond); else strcpy(val, NOT_FOUND); } - else if (strcmp(key, "rdbtimeDay")==0) { if (isEcmwfLocal) *len = sprintf(val, "%ld", bh->rdbtimeDay); else strcpy(val, NOT_FOUND); } - else if (strcmp(key, "rdbtimeHour")==0) { if (isEcmwfLocal) *len = sprintf(val, "%ld", bh->rdbtimeHour); else strcpy(val, NOT_FOUND); } - else if (strcmp(key, "rdbtimeMinute")==0) { if (isEcmwfLocal) *len = sprintf(val, "%ld", bh->rdbtimeMinute); else strcpy(val, NOT_FOUND); } - else if (strcmp(key, "rdbtimeSecond")==0) { if (isEcmwfLocal) *len = sprintf(val, "%ld", bh->rdbtimeSecond); else strcpy(val, NOT_FOUND); } - else if (strcmp(key, "rectimeDay")==0) { if (isEcmwfLocal) *len = sprintf(val, "%ld", bh->rectimeDay); else strcpy(val, NOT_FOUND); } - else if (strcmp(key, "rectimeHour")==0) { if (isEcmwfLocal) *len = sprintf(val, "%ld", bh->rectimeHour); else strcpy(val, NOT_FOUND); } - else if (strcmp(key, "rectimeMinute")==0) { if (isEcmwfLocal) *len = sprintf(val, "%ld", bh->rectimeMinute); else strcpy(val, NOT_FOUND); } - else if (strcmp(key, "rectimeSecond")==0) { if (isEcmwfLocal) *len = sprintf(val, "%ld", bh->rectimeSecond); else strcpy(val, NOT_FOUND); } - else if (strcmp(key, "isSatellite")==0) { if (isEcmwfLocal) *len = sprintf(val, "%ld", bh->isSatellite); else strcpy(val, NOT_FOUND); } - else if (strcmp(key, "localLongitude1")==0) { if (isEcmwfLocal) *len = sprintf(val, "%g", bh->localLongitude1); else strcpy(val, NOT_FOUND); } - else if (strcmp(key, "localLatitude1")==0) { if (isEcmwfLocal) *len = sprintf(val, "%g", bh->localLatitude1); else strcpy(val, NOT_FOUND); } - else if (strcmp(key, "localLongitude2")==0) { if (isEcmwfLocal) *len = sprintf(val, "%g", bh->localLongitude2); else strcpy(val, NOT_FOUND); } - else if (strcmp(key, "localLatitude2")==0) { if (isEcmwfLocal) *len = sprintf(val, "%g", bh->localLatitude2); else strcpy(val, NOT_FOUND); } - else if (strcmp(key, "localLatitude")==0) { if (isEcmwfLocal) *len = sprintf(val, "%g", bh->localLatitude); else strcpy(val, NOT_FOUND); } - else if (strcmp(key, "localLongitude")==0) { if (isEcmwfLocal) *len = sprintf(val, "%g", bh->localLongitude); else strcpy(val, NOT_FOUND); } - else if (strcmp(key, "qualityControl")==0) { if (isEcmwfLocal) *len = sprintf(val, "%ld", bh->qualityControl); else strcpy(val, NOT_FOUND); } - else if (strcmp(key, "newSubtype")==0) { if (isEcmwfLocal) *len = sprintf(val, "%ld", bh->newSubtype); else strcpy(val, NOT_FOUND); } - else if (strcmp(key, "rdbSubtype")==0) { if (isEcmwfLocal) *len = sprintf(val, "%ld", bh->rdbSubtype); else strcpy(val, NOT_FOUND); } - else if (strcmp(key, "daLoop")==0) { if (isEcmwfLocal) *len = sprintf(val, "%ld", bh->daLoop); else strcpy(val, NOT_FOUND); } - else if (strcmp(key, "localNumberOfObservations")==0) { if (isEcmwfLocal) *len = sprintf(val, "%ld", bh->localNumberOfObservations); else strcpy(val, NOT_FOUND); } - else if (strcmp(key, "satelliteID")==0) { if (isEcmwfLocal) *len = sprintf(val, "%ld", bh->satelliteID); else strcpy(val, NOT_FOUND); } - - else if (strcmp(key, "numberOfSubsets")==0) *len = sprintf(val, "%lu", bh->numberOfSubsets); - else if (strcmp(key, "observedData")==0) *len = sprintf(val, "%ld", bh->observedData); - else if (strcmp(key, "compressedData")==0) *len = sprintf(val, "%ld", bh->compressedData); - else return GRIB_NOT_FOUND; + else if (strcmp(key, "rdbType") == 0) { + if (isEcmwfLocal) + *len = sprintf(val, "%ld", bh->rdbType); + else + strcpy(val, NOT_FOUND); + } + else if (strcmp(key, "oldSubtype") == 0) { + if (isEcmwfLocal) + *len = sprintf(val, "%ld", bh->oldSubtype); + else + strcpy(val, NOT_FOUND); + } + else if (strcmp(key, "ident") == 0) { + if (!isEcmwfLocal || strlen(bh->ident) == 0) + strcpy(val, NOT_FOUND); + else + *len = sprintf(val, "%s", bh->ident); + } + else if (strcmp(key, "localYear") == 0) { + if (isEcmwfLocal) + *len = sprintf(val, "%ld", bh->localYear); + else + strcpy(val, NOT_FOUND); + } + else if (strcmp(key, "localMonth") == 0) { + if (isEcmwfLocal) + *len = sprintf(val, "%ld", bh->localMonth); + else + strcpy(val, NOT_FOUND); + } + else if (strcmp(key, "localDay") == 0) { + if (isEcmwfLocal) + *len = sprintf(val, "%ld", bh->localDay); + else + strcpy(val, NOT_FOUND); + } + else if (strcmp(key, "localHour") == 0) { + if (isEcmwfLocal) + *len = sprintf(val, "%ld", bh->localHour); + else + strcpy(val, NOT_FOUND); + } + else if (strcmp(key, "localMinute") == 0) { + if (isEcmwfLocal) + *len = sprintf(val, "%ld", bh->localMinute); + else + strcpy(val, NOT_FOUND); + } + else if (strcmp(key, "localSecond") == 0) { + if (isEcmwfLocal) + *len = sprintf(val, "%ld", bh->localSecond); + else + strcpy(val, NOT_FOUND); + } + else if (strcmp(key, "rdbtimeDay") == 0) { + if (isEcmwfLocal) + *len = sprintf(val, "%ld", bh->rdbtimeDay); + else + strcpy(val, NOT_FOUND); + } + else if (strcmp(key, "rdbtimeHour") == 0) { + if (isEcmwfLocal) + *len = sprintf(val, "%ld", bh->rdbtimeHour); + else + strcpy(val, NOT_FOUND); + } + else if (strcmp(key, "rdbtimeMinute") == 0) { + if (isEcmwfLocal) + *len = sprintf(val, "%ld", bh->rdbtimeMinute); + else + strcpy(val, NOT_FOUND); + } + else if (strcmp(key, "rdbtimeSecond") == 0) { + if (isEcmwfLocal) + *len = sprintf(val, "%ld", bh->rdbtimeSecond); + else + strcpy(val, NOT_FOUND); + } + else if (strcmp(key, "rectimeDay") == 0) { + if (isEcmwfLocal) + *len = sprintf(val, "%ld", bh->rectimeDay); + else + strcpy(val, NOT_FOUND); + } + else if (strcmp(key, "rectimeHour") == 0) { + if (isEcmwfLocal) + *len = sprintf(val, "%ld", bh->rectimeHour); + else + strcpy(val, NOT_FOUND); + } + else if (strcmp(key, "rectimeMinute") == 0) { + if (isEcmwfLocal) + *len = sprintf(val, "%ld", bh->rectimeMinute); + else + strcpy(val, NOT_FOUND); + } + else if (strcmp(key, "rectimeSecond") == 0) { + if (isEcmwfLocal) + *len = sprintf(val, "%ld", bh->rectimeSecond); + else + strcpy(val, NOT_FOUND); + } + else if (strcmp(key, "isSatellite") == 0) { + if (isEcmwfLocal) + *len = sprintf(val, "%ld", bh->isSatellite); + else + strcpy(val, NOT_FOUND); + } + else if (strcmp(key, "localLongitude1") == 0) { + if (isEcmwfLocal) + *len = sprintf(val, "%g", bh->localLongitude1); + else + strcpy(val, NOT_FOUND); + } + else if (strcmp(key, "localLatitude1") == 0) { + if (isEcmwfLocal) + *len = sprintf(val, "%g", bh->localLatitude1); + else + strcpy(val, NOT_FOUND); + } + else if (strcmp(key, "localLongitude2") == 0) { + if (isEcmwfLocal) + *len = sprintf(val, "%g", bh->localLongitude2); + else + strcpy(val, NOT_FOUND); + } + else if (strcmp(key, "localLatitude2") == 0) { + if (isEcmwfLocal) + *len = sprintf(val, "%g", bh->localLatitude2); + else + strcpy(val, NOT_FOUND); + } + else if (strcmp(key, "localLatitude") == 0) { + if (isEcmwfLocal) + *len = sprintf(val, "%g", bh->localLatitude); + else + strcpy(val, NOT_FOUND); + } + else if (strcmp(key, "localLongitude") == 0) { + if (isEcmwfLocal) + *len = sprintf(val, "%g", bh->localLongitude); + else + strcpy(val, NOT_FOUND); + } + else if (strcmp(key, "qualityControl") == 0) { + if (isEcmwfLocal) + *len = sprintf(val, "%ld", bh->qualityControl); + else + strcpy(val, NOT_FOUND); + } + else if (strcmp(key, "newSubtype") == 0) { + if (isEcmwfLocal) + *len = sprintf(val, "%ld", bh->newSubtype); + else + strcpy(val, NOT_FOUND); + } + else if (strcmp(key, "rdbSubtype") == 0) { + if (isEcmwfLocal) + *len = sprintf(val, "%ld", bh->rdbSubtype); + else + strcpy(val, NOT_FOUND); + } + else if (strcmp(key, "daLoop") == 0) { + if (isEcmwfLocal) + *len = sprintf(val, "%ld", bh->daLoop); + else + strcpy(val, NOT_FOUND); + } + else if (strcmp(key, "localNumberOfObservations") == 0) { + if (isEcmwfLocal) + *len = sprintf(val, "%ld", bh->localNumberOfObservations); + else + strcpy(val, NOT_FOUND); + } + else if (strcmp(key, "satelliteID") == 0) { + if (isEcmwfLocal) + *len = sprintf(val, "%ld", bh->satelliteID); + else + strcpy(val, NOT_FOUND); + } + + else if (strcmp(key, "numberOfSubsets") == 0) + *len = sprintf(val, "%lu", bh->numberOfSubsets); + else if (strcmp(key, "observedData") == 0) + *len = sprintf(val, "%ld", bh->observedData); + else if (strcmp(key, "compressedData") == 0) + *len = sprintf(val, "%ld", bh->compressedData); + else + return GRIB_NOT_FOUND; return GRIB_SUCCESS; } diff --git a/src/codes_memfs.c b/src/codes_memfs.c index bc4552101..3e31f3847 100644 --- a/src/codes_memfs.c +++ b/src/codes_memfs.c @@ -16,9 +16,9 @@ int codes_memfs_exists(const char* path); FILE* codes_memfs_open(const char* path); -FILE* codes_fopen(const char* name, const char *mode) +FILE* codes_fopen(const char* name, const char* mode) { - FILE *f; + FILE* f; if (strcmp(mode, "r") != 0) { return fopen(name, mode); diff --git a/src/codes_util.c b/src/codes_util.c index bc3271dcd..bfda21879 100644 --- a/src/codes_util.c +++ b/src/codes_util.c @@ -12,33 +12,33 @@ #ifdef ECCODES_ON_WINDOWS - /* Replace C99/Unix rint() for Windows Visual C++ (only before VC++ 2013 versions) */ - #if defined _MSC_VER && _MSC_VER < 1800 - double rint(double x) - { - char * buf = 0; - int decimal=0, sign=0, err = 0; - double result = 0; - buf = (char*) malloc(_CVTBUFSIZE); - err = _fcvt_s(buf, _CVTBUFSIZE, x, 0, &decimal, &sign); - Assert(err == 0); - result = atof(buf); - if(sign == 1) { - result = result * -1; - } - free(buf); - return result; - } - #endif +/* Replace C99/Unix rint() for Windows Visual C++ (only before VC++ 2013 versions) */ +#if defined _MSC_VER && _MSC_VER < 1800 +double rint(double x) +{ + char* buf = 0; + int decimal = 0, sign = 0, err = 0; + double result = 0; + buf = (char*)malloc(_CVTBUFSIZE); + err = _fcvt_s(buf, _CVTBUFSIZE, x, 0, &decimal, &sign); + Assert(err == 0); + result = atof(buf); + if (sign == 1) { + result = result * -1; + } + free(buf); + return result; +} +#endif #endif char get_dir_separator_char(void) { #ifdef ECCODES_ON_WINDOWS -# define DIR_SEPARATOR_CHAR '\\' +#define DIR_SEPARATOR_CHAR '\\' #else -# define DIR_SEPARATOR_CHAR '/' +#define DIR_SEPARATOR_CHAR '/' #endif return DIR_SEPARATOR_CHAR; } @@ -48,7 +48,7 @@ int path_is_directory(const char* filename) { struct stat s; int stat_val = stat(filename, &s); - if ( stat_val == 0 ) { + if (stat_val == 0) { if (S_ISDIR(s.st_mode)) { return 1; } @@ -65,26 +65,45 @@ char* codes_getenv(const char* name) const char* old_name = name; /* Test the most commonly used variables first */ - if (STR_EQ(name, "ECCODES_SAMPLES_PATH")) old_name="GRIB_SAMPLES_PATH"; - else if (STR_EQ(name, "ECCODES_DEFINITION_PATH")) old_name="GRIB_DEFINITION_PATH"; - else if (STR_EQ(name, "ECCODES_DEBUG")) old_name="GRIB_API_DEBUG"; + if (STR_EQ(name, "ECCODES_SAMPLES_PATH")) + old_name = "GRIB_SAMPLES_PATH"; + else if (STR_EQ(name, "ECCODES_DEFINITION_PATH")) + old_name = "GRIB_DEFINITION_PATH"; + else if (STR_EQ(name, "ECCODES_DEBUG")) + old_name = "GRIB_API_DEBUG"; - else if (STR_EQ(name, "ECCODES_FAIL_IF_LOG_MESSAGE")) old_name="GRIB_API_FAIL_IF_LOG_MESSAGE"; - else if (STR_EQ(name, "ECCODES_GRIB_WRITE_ON_FAIL")) old_name="GRIB_API_WRITE_ON_FAIL"; - else if (STR_EQ(name, "ECCODES_GRIB_LARGE_CONSTANT_FIELDS")) old_name="GRIB_API_LARGE_CONSTANT_FIELDS"; - else if (STR_EQ(name, "ECCODES_NO_ABORT")) old_name="GRIB_API_NO_ABORT"; - else if (STR_EQ(name, "ECCODES_GRIBEX_MODE_ON")) old_name="GRIB_GRIBEX_MODE_ON"; - else if (STR_EQ(name, "ECCODES_GRIB_IEEE_PACKING")) old_name="GRIB_IEEE_PACKING"; - else if (STR_EQ(name, "ECCODES_IO_BUFFER_SIZE")) old_name="GRIB_API_IO_BUFFER_SIZE"; - else if (STR_EQ(name, "ECCODES_LOG_STREAM")) old_name="GRIB_API_LOG_STREAM"; - else if (STR_EQ(name, "ECCODES_GRIB_NO_BIG_GROUP_SPLIT")) old_name="GRIB_API_NO_BIG_GROUP_SPLIT"; - else if (STR_EQ(name, "ECCODES_GRIB_NO_SPD")) old_name="GRIB_API_NO_SPD"; - else if (STR_EQ(name, "ECCODES_GRIB_KEEP_MATRIX")) old_name="GRIB_API_KEEP_MATRIX"; - else if (STR_EQ(name, "_ECCODES_ECMWF_TEST_DEFINITION_PATH")) old_name="_GRIB_API_ECMWF_TEST_DEFINITION_PATH"; - else if (STR_EQ(name, "_ECCODES_ECMWF_TEST_SAMPLES_PATH")) old_name="_GRIB_API_ECMWF_TEST_SAMPLES_PATH"; - else if (STR_EQ(name, "ECCODES_GRIB_JPEG")) old_name="GRIB_JPEG"; - else if (STR_EQ(name, "ECCODES_GRIB_DUMP_JPG_FILE")) old_name="GRIB_DUMP_JPG_FILE"; - else if (STR_EQ(name, "ECCODES_PRINT_MISSING")) old_name="GRIB_PRINT_MISSING"; + else if (STR_EQ(name, "ECCODES_FAIL_IF_LOG_MESSAGE")) + old_name = "GRIB_API_FAIL_IF_LOG_MESSAGE"; + else if (STR_EQ(name, "ECCODES_GRIB_WRITE_ON_FAIL")) + old_name = "GRIB_API_WRITE_ON_FAIL"; + else if (STR_EQ(name, "ECCODES_GRIB_LARGE_CONSTANT_FIELDS")) + old_name = "GRIB_API_LARGE_CONSTANT_FIELDS"; + else if (STR_EQ(name, "ECCODES_NO_ABORT")) + old_name = "GRIB_API_NO_ABORT"; + else if (STR_EQ(name, "ECCODES_GRIBEX_MODE_ON")) + old_name = "GRIB_GRIBEX_MODE_ON"; + else if (STR_EQ(name, "ECCODES_GRIB_IEEE_PACKING")) + old_name = "GRIB_IEEE_PACKING"; + else if (STR_EQ(name, "ECCODES_IO_BUFFER_SIZE")) + old_name = "GRIB_API_IO_BUFFER_SIZE"; + else if (STR_EQ(name, "ECCODES_LOG_STREAM")) + old_name = "GRIB_API_LOG_STREAM"; + else if (STR_EQ(name, "ECCODES_GRIB_NO_BIG_GROUP_SPLIT")) + old_name = "GRIB_API_NO_BIG_GROUP_SPLIT"; + else if (STR_EQ(name, "ECCODES_GRIB_NO_SPD")) + old_name = "GRIB_API_NO_SPD"; + else if (STR_EQ(name, "ECCODES_GRIB_KEEP_MATRIX")) + old_name = "GRIB_API_KEEP_MATRIX"; + else if (STR_EQ(name, "_ECCODES_ECMWF_TEST_DEFINITION_PATH")) + old_name = "_GRIB_API_ECMWF_TEST_DEFINITION_PATH"; + else if (STR_EQ(name, "_ECCODES_ECMWF_TEST_SAMPLES_PATH")) + old_name = "_GRIB_API_ECMWF_TEST_SAMPLES_PATH"; + else if (STR_EQ(name, "ECCODES_GRIB_JPEG")) + old_name = "GRIB_JPEG"; + else if (STR_EQ(name, "ECCODES_GRIB_DUMP_JPG_FILE")) + old_name = "GRIB_DUMP_JPG_FILE"; + else if (STR_EQ(name, "ECCODES_PRINT_MISSING")) + old_name = "GRIB_PRINT_MISSING"; result = getenv(old_name); } diff --git a/src/eccodes.c b/src/eccodes.c index 7ed0ad6ed..d202bf94d 100644 --- a/src/eccodes.c +++ b/src/eccodes.c @@ -12,11 +12,11 @@ /* Generic functions */ /******************************************************************************/ -char* codes_samples_path(const grib_context *c) +char* codes_samples_path(const grib_context* c) { return grib_samples_path(c); } -char* codes_definition_path(const grib_context *c) +char* codes_definition_path(const grib_context* c) { return grib_definition_path(c); } @@ -36,9 +36,9 @@ void codes_print_api_version(FILE* out) { grib_print_api_version(out); } -int codes_count_in_file(grib_context* c, FILE* f,int* n) +int codes_count_in_file(grib_context* c, FILE* f, int* n) { - return grib_count_in_file(c,f,n); + return grib_count_in_file(c, f, n); } int codes_count_in_filename(grib_context* c, const char* filename, int* n) { @@ -57,19 +57,19 @@ const char* codes_get_type_name(int type) { return grib_get_type_name(type); } -int codes_get_native_type(const grib_handle* h, const char* name,int* type) +int codes_get_native_type(const grib_handle* h, const char* name, int* type) { - return grib_get_native_type(h,name,type); + return grib_get_native_type(h, name, type); } -void codes_check(const char* call,const char* file,int line,int e,const char* msg) +void codes_check(const char* call, const char* file, int line, int e, const char* msg) { - grib_check(call,file,line,e,msg); + grib_check(call, file, line, e, msg); } /* Fieldsets */ /******************************************************************************/ -grib_fieldset *codes_fieldset_new_from_files(grib_context *c, char *filenames[], int nfiles, char **keys, int nkeys, const char *where_string, const char *order_by_string, int *err) +grib_fieldset* codes_fieldset_new_from_files(grib_context* c, char* filenames[], int nfiles, char** keys, int nkeys, const char* where_string, const char* order_by_string, int* err) { return grib_fieldset_new_from_files(c, filenames, nfiles, keys, nkeys, where_string, order_by_string, err); } @@ -81,72 +81,72 @@ void codes_fieldset_rewind(grib_fieldset* set) { grib_fieldset_rewind(set); } -int codes_fieldset_apply_order_by(grib_fieldset* set,const char* order_by_string) +int codes_fieldset_apply_order_by(grib_fieldset* set, const char* order_by_string) { - return grib_fieldset_apply_order_by(set,order_by_string); + return grib_fieldset_apply_order_by(set, order_by_string); } -grib_handle* codes_fieldset_next_handle(grib_fieldset* set,int* err) +grib_handle* codes_fieldset_next_handle(grib_fieldset* set, int* err) { - return grib_fieldset_next_handle(set,err); + return grib_fieldset_next_handle(set, err); } -int codes_fieldset_count(grib_fieldset *set) +int codes_fieldset_count(grib_fieldset* set) { return grib_fieldset_count(set); } /* Indexing */ /******************************************************************************/ -grib_index* codes_index_new_from_file(grib_context* c,char* filename,const char* keys,int *err) +grib_index* codes_index_new_from_file(grib_context* c, char* filename, const char* keys, int* err) { - return grib_index_new_from_file(c,filename,keys,err); + return grib_index_new_from_file(c, filename, keys, err); } -grib_index* codes_index_new(grib_context* c, const char* keys,int *err) +grib_index* codes_index_new(grib_context* c, const char* keys, int* err) { - return grib_index_new(c,keys,err); + return grib_index_new(c, keys, err); } -int codes_index_add_file(grib_index *index, const char *filename) +int codes_index_add_file(grib_index* index, const char* filename) { - return grib_index_add_file(index,filename); + return grib_index_add_file(index, filename); } -int codes_index_write(grib_index *index, const char *filename) +int codes_index_write(grib_index* index, const char* filename) { - return grib_index_write(index,filename); + return grib_index_write(index, filename); } -grib_index* codes_index_read(grib_context* c,const char* filename,int *err) +grib_index* codes_index_read(grib_context* c, const char* filename, int* err) { - return grib_index_read(c,filename,err); + return grib_index_read(c, filename, err); } -int codes_index_get_size(const grib_index* index,const char* key,size_t* size) +int codes_index_get_size(const grib_index* index, const char* key, size_t* size) { - return grib_index_get_size(index,key,size); + return grib_index_get_size(index, key, size); } -int codes_index_get_long(const grib_index* index,const char* key,long* values,size_t *size) +int codes_index_get_long(const grib_index* index, const char* key, long* values, size_t* size) { - return grib_index_get_long(index,key,values,size); + return grib_index_get_long(index, key, values, size); } -int codes_index_get_double(const grib_index* index,const char* key, double* values,size_t *size) +int codes_index_get_double(const grib_index* index, const char* key, double* values, size_t* size) { - return grib_index_get_double(index,key,values,size); + return grib_index_get_double(index, key, values, size); } -int codes_index_get_string(const grib_index* index,const char* key,char** values,size_t *size) +int codes_index_get_string(const grib_index* index, const char* key, char** values, size_t* size) { - return grib_index_get_string(index,key,values,size); + return grib_index_get_string(index, key, values, size); } -int codes_index_select_long(grib_index* index,const char* key,long value) +int codes_index_select_long(grib_index* index, const char* key, long value) { - return grib_index_select_long(index,key,value); + return grib_index_select_long(index, key, value); } -int codes_index_select_double(grib_index* index,const char* key,double value) +int codes_index_select_double(grib_index* index, const char* key, double value) { - return grib_index_select_double(index,key,value); + return grib_index_select_double(index, key, value); } -int codes_index_select_string(grib_index* index,const char* key,char* value) +int codes_index_select_string(grib_index* index, const char* key, char* value) { - return grib_index_select_string(index,key,value); + return grib_index_select_string(index, key, value); } -grib_handle* codes_handle_new_from_index(grib_index* index,int *err) +grib_handle* codes_handle_new_from_index(grib_index* index, int* err) { - return grib_handle_new_from_index(index,err); + return grib_handle_new_from_index(index, err); } void codes_index_delete(grib_index* index) { @@ -155,17 +155,17 @@ void codes_index_delete(grib_index* index) /* Create handle */ /******************************************************************************/ -int codes_write_message(const grib_handle* h,const char* file,const char* mode) +int codes_write_message(const grib_handle* h, const char* file, const char* mode) { - return grib_write_message(h,file,mode); + return grib_write_message(h, file, mode); } grib_handle* codes_handle_new_from_message(grib_context* c, const void* data, size_t data_len) { - return grib_handle_new_from_message(c,data,data_len); + return grib_handle_new_from_message(c, data, data_len); } grib_handle* codes_handle_new_from_message_copy(grib_context* c, const void* data, size_t data_len) { - return grib_handle_new_from_message_copy(c,data,data_len); + return grib_handle_new_from_message_copy(c, data, data_len); } grib_handle* codes_grib_handle_new_from_samples(grib_context* c, const char* sample_name) { @@ -181,36 +181,36 @@ int codes_handle_delete(grib_handle* h) } grib_handle* codes_handle_new_from_partial_message_copy(grib_context* c, const void* data, size_t size) { - return grib_handle_new_from_partial_message_copy(c,data,size); + return grib_handle_new_from_partial_message_copy(c, data, size); } grib_handle* codes_handle_new_from_partial_message(grib_context* c, const void* data, size_t buflen) { - return grib_handle_new_from_partial_message(c,data,buflen); + return grib_handle_new_from_partial_message(c, data, buflen); } -int codes_get_message(const grib_handle* h ,const void** message, size_t *message_length ) +int codes_get_message(const grib_handle* h, const void** message, size_t* message_length) { - return grib_get_message(h,message,message_length); + return grib_get_message(h, message, message_length); } -int codes_get_message_copy(const grib_handle* h, void* message,size_t *message_length ) +int codes_get_message_copy(const grib_handle* h, void* message, size_t* message_length) { - return grib_get_message_copy(h,message,message_length); + return grib_get_message_copy(h, message, message_length); } /* Specific to GRIB */ /******************************************************************************/ -grib_handle *codes_grib_util_set_spec(grib_handle *h, - const grib_util_grid_spec *grid_spec, - const grib_util_packing_spec *packing_spec, - int flags, - const double *data_values, - size_t data_values_count, - int *err) +grib_handle* codes_grib_util_set_spec(grib_handle* h, + const grib_util_grid_spec* grid_spec, + const grib_util_packing_spec* packing_spec, + int flags, + const double* data_values, + size_t data_values_count, + int* err) { return grib_util_set_spec(h, grid_spec, packing_spec, flags, data_values, data_values_count, err); } -grib_handle* codes_grib_util_sections_copy(grib_handle* hfrom,grib_handle* hto,int what,int *err) +grib_handle* codes_grib_util_sections_copy(grib_handle* hfrom, grib_handle* hto, int what, int* err) { - return grib_util_sections_copy(hfrom,hto,what,err); + return grib_util_sections_copy(hfrom, hto, what, err); } grib_string_list* codes_grib_util_get_param_id(const char* mars_param) { @@ -232,15 +232,15 @@ void codes_grib_multi_support_reset_file(grib_context* c, FILE* f) { grib_multi_support_reset_file(c, f); } -grib_handle* codes_grib_handle_new_from_multi_message(grib_context* c,void** data,size_t *data_len,int* error) +grib_handle* codes_grib_handle_new_from_multi_message(grib_context* c, void** data, size_t* data_len, int* error) { - return grib_handle_new_from_multi_message(c,data,data_len,error); + return grib_handle_new_from_multi_message(c, data, data_len, error); } grib_multi_handle* codes_grib_multi_handle_new(grib_context* c) { return grib_multi_handle_new(c); } -int codes_grib_multi_handle_append(grib_handle* h,int start_section,grib_multi_handle* mh) +int codes_grib_multi_handle_append(grib_handle* h, int start_section, grib_multi_handle* mh) { return grib_multi_handle_append(h, start_section, mh); } @@ -248,60 +248,60 @@ int codes_grib_multi_handle_delete(grib_multi_handle* mh) { return grib_multi_handle_delete(mh); } -int codes_grib_multi_handle_write(grib_multi_handle* mh,FILE* f) +int codes_grib_multi_handle_write(grib_multi_handle* mh, FILE* f) { - return grib_multi_handle_write(mh,f); + return grib_multi_handle_write(mh, f); } /* Lat/Lon iterator and nearest (GRIB specific) */ /******************************************************************************/ -grib_iterator* codes_grib_iterator_new(const grib_handle* h, unsigned long flags,int* error) +grib_iterator* codes_grib_iterator_new(const grib_handle* h, unsigned long flags, int* error) { - return grib_iterator_new(h,flags,error); + return grib_iterator_new(h, flags, error); } -int codes_grib_get_data(const grib_handle *h, double *lats, double *lons, double *values) +int codes_grib_get_data(const grib_handle* h, double* lats, double* lons, double* values) { - return grib_get_data(h,lats,lons,values); + return grib_get_data(h, lats, lons, values); } -int codes_grib_iterator_next(grib_iterator *i, double* lat,double* lon,double* value) +int codes_grib_iterator_next(grib_iterator* i, double* lat, double* lon, double* value) { - return grib_iterator_next(i,lat,lon,value); + return grib_iterator_next(i, lat, lon, value); } -int codes_grib_iterator_previous(grib_iterator *i, double* lat,double* lon,double* value) +int codes_grib_iterator_previous(grib_iterator* i, double* lat, double* lon, double* value) { - return grib_iterator_previous(i,lat,lon,value); + return grib_iterator_previous(i, lat, lon, value); } -int codes_grib_iterator_has_next(grib_iterator *i) +int codes_grib_iterator_has_next(grib_iterator* i) { return grib_iterator_has_next(i); } -int codes_grib_iterator_reset(grib_iterator *i) +int codes_grib_iterator_reset(grib_iterator* i) { return grib_iterator_reset(i); } -int codes_grib_iterator_delete(grib_iterator *i) +int codes_grib_iterator_delete(grib_iterator* i) { return grib_iterator_delete(i); } grib_nearest* codes_grib_nearest_new(const grib_handle* h, int* error) { - return grib_nearest_new(h,error); + return grib_nearest_new(h, error); } -int codes_grib_nearest_find(grib_nearest *nearest, const grib_handle* h,double inlat,double inlon, - unsigned long flags,double* outlats,double* outlons, - double* values,double* distances,int* indexes,size_t *len) +int codes_grib_nearest_find(grib_nearest* nearest, const grib_handle* h, double inlat, double inlon, + unsigned long flags, double* outlats, double* outlons, + double* values, double* distances, int* indexes, size_t* len) { return grib_nearest_find(nearest, h, inlat, inlon, flags, outlats, outlons, values, distances, indexes, len); } int codes_grib_nearest_find_multiple(const grib_handle* h, int is_lsm, - const double* inlats, const double* inlons, long npoints, - double* outlats, double* outlons, - double* values, double* distances, int* indexes) + const double* inlats, const double* inlons, long npoints, + double* outlats, double* outlons, + double* values, double* distances, int* indexes) { return grib_nearest_find_multiple(h, is_lsm, inlats, inlons, npoints, outlats, outlons, values, distances, indexes); } -int codes_grib_nearest_delete(grib_nearest *nearest) +int codes_grib_nearest_delete(grib_nearest* nearest) { return grib_nearest_delete(nearest); } @@ -311,111 +311,111 @@ int codes_grib_nearest_delete(grib_nearest *nearest) /******************************************************************************/ int codes_is_missing(const grib_handle* h, const char* key, int* err) { - return grib_is_missing(h,key,err); + return grib_is_missing(h, key, err); } int codes_is_defined(const grib_handle* h, const char* key) { - return grib_is_defined(h,key); + return grib_is_defined(h, key); } int codes_set_missing(grib_handle* h, const char* key) { - return grib_set_missing(h,key); + return grib_set_missing(h, key); } -int codes_get_size(const grib_handle* h, const char* key,size_t *size) +int codes_get_size(const grib_handle* h, const char* key, size_t* size) { - return grib_get_size(h,key,size); + return grib_get_size(h, key, size); } -int codes_get_length(const grib_handle* h, const char* key,size_t *length) +int codes_get_length(const grib_handle* h, const char* key, size_t* length) { - return grib_get_length(h,key,length); + return grib_get_length(h, key, length); } int codes_get_long(const grib_handle* h, const char* key, long* value) { - return grib_get_long(h,key,value); + return grib_get_long(h, key, value); } int codes_get_double(const grib_handle* h, const char* key, double* value) { - return grib_get_double(h,key,value); + return grib_get_double(h, key, value); } int codes_get_double_element(const grib_handle* h, const char* key, int i, double* value) { - return grib_get_double_element(h,key,i,value); + return grib_get_double_element(h, key, i, value); } -int codes_get_double_elements(const grib_handle* h, const char* key, int* i, long size,double* value) +int codes_get_double_elements(const grib_handle* h, const char* key, int* i, long size, double* value) { - return grib_get_double_elements(h,key,i,size,value); + return grib_get_double_elements(h, key, i, size, value); } -int codes_get_string(const grib_handle* h, const char* key, char* mesg, size_t *length) +int codes_get_string(const grib_handle* h, const char* key, char* mesg, size_t* length) { - return grib_get_string(h,key,mesg,length); + return grib_get_string(h, key, mesg, length); } -int codes_get_string_array(const grib_handle* h, const char* key, char** vals, size_t *length) +int codes_get_string_array(const grib_handle* h, const char* key, char** vals, size_t* length) { - return grib_get_string_array(h,key,vals,length); + return grib_get_string_array(h, key, vals, length); } -int codes_get_bytes(const grib_handle* h, const char* key, unsigned char* bytes, size_t *length) +int codes_get_bytes(const grib_handle* h, const char* key, unsigned char* bytes, size_t* length) { - return grib_get_bytes(h,key,bytes,length); + return grib_get_bytes(h, key, bytes, length); } -int codes_get_double_array(const grib_handle* h, const char* key, double* vals, size_t *length) +int codes_get_double_array(const grib_handle* h, const char* key, double* vals, size_t* length) { - return grib_get_double_array(h,key,vals,length); + return grib_get_double_array(h, key, vals, length); } -int codes_get_long_array(const grib_handle* h, const char* key, long* vals, size_t *length) +int codes_get_long_array(const grib_handle* h, const char* key, long* vals, size_t* length) { - return grib_get_long_array(h,key,vals,length); + return grib_get_long_array(h, key, vals, length); } int codes_copy_namespace(grib_handle* dest, const char* name, grib_handle* src) { - return grib_copy_namespace(dest,name,src); + return grib_copy_namespace(dest, name, src); } int codes_set_long(grib_handle* h, const char* key, long val) { - return grib_set_long(h,key,val); + return grib_set_long(h, key, val); } int codes_set_double(grib_handle* h, const char* key, double val) { - return grib_set_double(h,key,val); + return grib_set_double(h, key, val); } -int codes_set_string(grib_handle* h, const char* key , const char* mesg, size_t *length) +int codes_set_string(grib_handle* h, const char* key, const char* mesg, size_t* length) { - return grib_set_string(h,key,mesg,length); + return grib_set_string(h, key, mesg, length); } -int codes_set_bytes(grib_handle* h, const char* key, const unsigned char* bytes, size_t *length) +int codes_set_bytes(grib_handle* h, const char* key, const unsigned char* bytes, size_t* length) { - return grib_set_bytes(h,key,bytes,length); + return grib_set_bytes(h, key, bytes, length); } int codes_set_double_array(grib_handle* h, const char* key, const double* vals, size_t length) { - return grib_set_double_array(h,key,vals,length); + return grib_set_double_array(h, key, vals, length); } int codes_set_force_double_array(grib_handle* h, const char* key, const double* vals, size_t length) { - return grib_set_force_double_array(h,key,vals,length); + return grib_set_force_double_array(h, key, vals, length); } int codes_set_long_array(grib_handle* h, const char* key, const long* vals, size_t length) { - return grib_set_long_array(h,key,vals,length); + return grib_set_long_array(h, key, vals, length); } -int codes_set_string_array(grib_handle *h, const char *key, const char **vals, size_t length) +int codes_set_string_array(grib_handle* h, const char* key, const char** vals, size_t length) { return grib_set_string_array(h, key, vals, length); } -int codes_set_values(grib_handle* h,grib_values* grib_values , size_t arg_count) +int codes_set_values(grib_handle* h, grib_values* grib_values, size_t arg_count) { - return grib_set_values(h,grib_values,arg_count); + return grib_set_values(h, grib_values, arg_count); } -int codes_get_message_offset(const grib_handle* h,off_t* offset) +int codes_get_message_offset(const grib_handle* h, off_t* offset) { - return grib_get_message_offset (h,offset); + return grib_get_message_offset(h, offset); } -int codes_get_message_size(const grib_handle* h,size_t* size) +int codes_get_message_size(const grib_handle* h, size_t* size) { - return grib_get_message_size (h,size); + return grib_get_message_size(h, size); } -void codes_dump_content(const grib_handle* h,FILE* out,const char* mode, unsigned long option_flags,void* arg) +void codes_dump_content(const grib_handle* h, FILE* out, const char* mode, unsigned long option_flags, void* arg) { grib_dump_content(h, out, mode, option_flags, arg); } @@ -440,19 +440,19 @@ void codes_gribex_mode_off(grib_context* c) /* keys iterator */ /******************************************************************************/ -grib_keys_iterator* codes_keys_iterator_new(grib_handle* h,unsigned long filter_flags, const char* name_space) +grib_keys_iterator* codes_keys_iterator_new(grib_handle* h, unsigned long filter_flags, const char* name_space) { - return grib_keys_iterator_new(h,filter_flags,name_space); + return grib_keys_iterator_new(h, filter_flags, name_space); } -int codes_keys_iterator_next(grib_keys_iterator *kiter) +int codes_keys_iterator_next(grib_keys_iterator* kiter) { return grib_keys_iterator_next(kiter); } -const char* codes_keys_iterator_get_name(const grib_keys_iterator *kiter) +const char* codes_keys_iterator_get_name(const grib_keys_iterator* kiter) { return grib_keys_iterator_get_name(kiter); } -int codes_keys_iterator_delete( grib_keys_iterator* kiter) +int codes_keys_iterator_delete(grib_keys_iterator* kiter) { return grib_keys_iterator_delete(kiter); } @@ -460,48 +460,48 @@ int codes_keys_iterator_rewind(grib_keys_iterator* kiter) { return grib_keys_iterator_rewind(kiter); } -int codes_keys_iterator_set_flags(grib_keys_iterator *kiter,unsigned long flags) +int codes_keys_iterator_set_flags(grib_keys_iterator* kiter, unsigned long flags) { - return grib_keys_iterator_set_flags(kiter,flags); + return grib_keys_iterator_set_flags(kiter, flags); } -int codes_keys_iterator_get_long(const grib_keys_iterator *kiter, long *v, size_t *len) +int codes_keys_iterator_get_long(const grib_keys_iterator* kiter, long* v, size_t* len) { - return grib_keys_iterator_get_long(kiter,v,len); + return grib_keys_iterator_get_long(kiter, v, len); } -int codes_keys_iterator_get_double(const grib_keys_iterator *kiter, double *v, size_t *len) +int codes_keys_iterator_get_double(const grib_keys_iterator* kiter, double* v, size_t* len) { - return grib_keys_iterator_get_double(kiter,v,len); + return grib_keys_iterator_get_double(kiter, v, len); } -int codes_keys_iterator_get_string(const grib_keys_iterator *kiter, char *v, size_t *len) +int codes_keys_iterator_get_string(const grib_keys_iterator* kiter, char* v, size_t* len) { - return grib_keys_iterator_get_string(kiter,v,len); + return grib_keys_iterator_get_string(kiter, v, len); } -int codes_keys_iterator_get_bytes(const grib_keys_iterator *kiter, unsigned char *v, size_t *len) +int codes_keys_iterator_get_bytes(const grib_keys_iterator* kiter, unsigned char* v, size_t* len) { - return grib_keys_iterator_get_bytes(kiter,v,len); + return grib_keys_iterator_get_bytes(kiter, v, len); } /* Utility functions */ /******************************************************************************/ int codes_values_check(grib_handle* h, grib_values* values, int count) { - return grib_values_check(h,values,count); + return grib_values_check(h, values, count); } void codes_update_sections_lengths(grib_handle* h) { grib_update_sections_lengths(h); } -int codes_get_gaussian_latitudes(long truncation,double* latitudes) +int codes_get_gaussian_latitudes(long truncation, double* latitudes) { - return grib_get_gaussian_latitudes(truncation,latitudes); + return grib_get_gaussian_latitudes(truncation, latitudes); } -int codes_julian_to_datetime(double jd, long *year, long *month, long *day, long *hour, long *minute, long *second) +int codes_julian_to_datetime(double jd, long* year, long* month, long* day, long* hour, long* minute, long* second) { - return grib_julian_to_datetime(jd,year,month,day,hour,minute,second); + return grib_julian_to_datetime(jd, year, month, day, hour, minute, second); } -int codes_datetime_to_julian(long year, long month, long day, long hour, long minute, long second, double *jd) +int codes_datetime_to_julian(long year, long month, long day, long hour, long minute, long second, double* jd) { - return grib_datetime_to_julian(year,month,day,hour,minute,second,jd); + return grib_datetime_to_julian(year, month, day, hour, minute, second, jd); } long codes_julian_to_date(long jdate) { @@ -511,26 +511,26 @@ long codes_date_to_julian(long ddate) { return grib_date_to_julian(ddate); } -void codes_get_reduced_row(long pl,double lon_first,double lon_last,long* npoints,long* ilon_first, long* ilon_last ) +void codes_get_reduced_row(long pl, double lon_first, double lon_last, long* npoints, long* ilon_first, long* ilon_last) { - grib_get_reduced_row(pl,lon_first,lon_last,npoints,ilon_first,ilon_last); + grib_get_reduced_row(pl, lon_first, lon_last, npoints, ilon_first, ilon_last); } -void codes_get_reduced_row_p(long pl, double lon_first, double lon_last, long *npoints, double *olon_first, double *olon_last) +void codes_get_reduced_row_p(long pl, double lon_first, double lon_last, long* npoints, double* olon_first, double* olon_last) { grib_get_reduced_row_p(pl, lon_first, lon_last, npoints, olon_first, olon_last); } -grib_box* codes_box_new(grib_handle* h,int* error) +grib_box* codes_box_new(grib_handle* h, int* error) { - return grib_box_new(h,error); + return grib_box_new(h, error); } -grib_points* codes_box_get_points(grib_box *box,double north, double west,double south,double east, int *err) +grib_points* codes_box_get_points(grib_box* box, double north, double west, double south, double east, int* err) { - return grib_box_get_points(box,north,west,south,east,err); + return grib_box_get_points(box, north, west, south, east, err); } int codes_points_get_values(grib_handle* h, grib_points* points, double* val) { - return grib_points_get_values(h,points,val); + return grib_points_get_values(h, points, val); } void codes_context_delete(grib_context* c) { @@ -538,7 +538,7 @@ void codes_context_delete(grib_context* c) } void codes_context_set_definitions_path(grib_context* c, const char* path) { - grib_context_set_definitions_path(c,path); + grib_context_set_definitions_path(c, path); } void codes_context_set_samples_path(grib_context* c, const char* path) { diff --git a/src/encode_double_array.c b/src/encode_double_array.c index 04732e002..3eca3784d 100644 --- a/src/encode_double_array.c +++ b/src/encode_double_array.c @@ -14,61 +14,55 @@ #endif -static -void encode_double_array_common(int numBits, long packStart, long datasize, GRIBPACK *lGrib, - const double *data, double zref, double factor, long *gz) +static void encode_double_array_common(int numBits, long packStart, long datasize, GRIBPACK* lGrib, + const double* data, double zref, double factor, long* gz) { long i, z = *gz; unsigned int ival; int cbits, jbits; unsigned int c; - static unsigned int mask[] = {0,1,3,7,15,31,63,127,255}; + static unsigned int mask[] = { 0, 1, 3, 7, 15, 31, 63, 127, 255 }; /* code from gribw routine flist2bitstream */ cbits = 8; - c = 0; - for ( i = packStart; i < datasize; i++ ) - { + c = 0; + for (i = packStart; i < datasize; i++) { /* note float -> unsigned int .. truncate */ - ival = (unsigned int) ((data[i] - zref) * factor + 0.5); + ival = (unsigned int)((data[i] - zref) * factor + 0.5); /* if ( ival > max_nbpv_pow2 ) ival = max_nbpv_pow2; if ( ival < 0 ) ival = 0; */ jbits = numBits; - while ( cbits <= jbits ) - { - if ( cbits == 8 ) - { + while (cbits <= jbits) { + if (cbits == 8) { jbits -= 8; lGrib[z++] = (ival >> jbits) & 0xFF; } - else - { + else { jbits -= cbits; lGrib[z++] = (c << cbits) + ((ival >> jbits) & mask[cbits]); - cbits = 8; - c = 0; + cbits = 8; + c = 0; } } /* now jbits < cbits */ - if ( jbits ) - { + if (jbits) { c = (c << jbits) + (ival & mask[jbits]); cbits -= jbits; } } - if ( cbits != 8 ) lGrib[z++] = c << cbits; + if (cbits != 8) + lGrib[z++] = c << cbits; *gz = z; } -static -void encode_double_array_byte(int numBits, long packStart, long datasize, - GRIBPACK *restrict lGrib, - const double *restrict data, - double zref, double factor, long *restrict gz) +static void encode_double_array_byte(int numBits, long packStart, long datasize, + GRIBPACK* restrict lGrib, + const double* restrict data, + double zref, double factor, long* restrict gz) { long i, z = *gz; unsigned long ival; @@ -77,125 +71,113 @@ void encode_double_array_byte(int numBits, long packStart, long datasize, data += packStart; datasize -= packStart; - if ( numBits == 8 ) - { -#ifdef _GET_IBM_COUNTER + if (numBits == 8) { +#ifdef _GET_IBM_COUNTER hpmStart(2, "pack 8 bit base"); #endif -#if defined (CRAY) +#if defined(CRAY) #pragma _CRI ivdep -#elif defined (SX) +#elif defined(SX) #pragma vdir nodep -#elif defined (__uxp__) +#elif defined(__uxp__) #pragma loop novrec #endif - for ( i = 0; i < datasize; i++ ) - { - tmp = ((data[i] - zref) * factor + 0.5); - ival = (unsigned long) tmp; - lGrib[z ] = ival; + for (i = 0; i < datasize; i++) { + tmp = ((data[i] - zref) * factor + 0.5); + ival = (unsigned long)tmp; + lGrib[z] = ival; z++; } -#ifdef _GET_IBM_COUNTER +#ifdef _GET_IBM_COUNTER hpmStop(2); #endif } - else if ( numBits == 16 ) - { -#ifdef _GET_IBM_COUNTER + else if (numBits == 16) { +#ifdef _GET_IBM_COUNTER hpmStart(3, "pack 16 bit base"); #endif -#if defined (CRAY) +#if defined(CRAY) #pragma _CRI ivdep -#elif defined (SX) +#elif defined(SX) #pragma vdir nodep -#elif defined (__uxp__) +#elif defined(__uxp__) #pragma loop novrec #endif - for ( i = 0; i < datasize; i++ ) - { - tmp = ((data[i] - zref) * factor + 0.5); - ival = (unsigned long) tmp; - lGrib[z ] = ival >> 8; - lGrib[z+1] = ival; + for (i = 0; i < datasize; i++) { + tmp = ((data[i] - zref) * factor + 0.5); + ival = (unsigned long)tmp; + lGrib[z] = ival >> 8; + lGrib[z + 1] = ival; z += 2; } -#ifdef _GET_IBM_COUNTER +#ifdef _GET_IBM_COUNTER hpmStop(3); #endif } - else if ( numBits == 24 ) - { -#ifdef _GET_IBM_COUNTER + else if (numBits == 24) { +#ifdef _GET_IBM_COUNTER hpmStart(4, "pack 24 bit base"); #endif -#if defined (CRAY) +#if defined(CRAY) #pragma _CRI ivdep -#elif defined (SX) +#elif defined(SX) #pragma vdir nodep -#elif defined (__uxp__) +#elif defined(__uxp__) #pragma loop novrec #endif - for ( i = 0; i < datasize; i++ ) - { - tmp = ((data[i] - zref) * factor + 0.5); - ival = (unsigned long) tmp; - lGrib[z ] = ival >> 16; - lGrib[z+1] = ival >> 8; - lGrib[z+2] = ival; + for (i = 0; i < datasize; i++) { + tmp = ((data[i] - zref) * factor + 0.5); + ival = (unsigned long)tmp; + lGrib[z] = ival >> 16; + lGrib[z + 1] = ival >> 8; + lGrib[z + 2] = ival; z += 3; } -#ifdef _GET_IBM_COUNTER +#ifdef _GET_IBM_COUNTER hpmStop(4); #endif } - else if ( numBits == 32 ) - { -#ifdef _GET_IBM_COUNTER + else if (numBits == 32) { +#ifdef _GET_IBM_COUNTER hpmStart(5, "pack 32 bit base"); #endif -#if defined (CRAY) +#if defined(CRAY) #pragma _CRI ivdep -#elif defined (SX) +#elif defined(SX) #pragma vdir nodep -#elif defined (__uxp__) +#elif defined(__uxp__) #pragma loop novrec #endif - for ( i = 0; i < datasize; i++ ) - { - tmp = ((data[i] - zref) * factor + 0.5); - ival = (unsigned long) tmp; - lGrib[z ] = ival >> 24; - lGrib[z+1] = ival >> 16; - lGrib[z+2] = ival >> 8; - lGrib[z+3] = ival; + for (i = 0; i < datasize; i++) { + tmp = ((data[i] - zref) * factor + 0.5); + ival = (unsigned long)tmp; + lGrib[z] = ival >> 24; + lGrib[z + 1] = ival >> 16; + lGrib[z + 2] = ival >> 8; + lGrib[z + 3] = ival; z += 4; } -#ifdef _GET_IBM_COUNTER +#ifdef _GET_IBM_COUNTER hpmStop(5); #endif } - else if ( numBits > 0 && numBits <= 32 ) - { + else if (numBits > 0 && numBits <= 32) { encode_double_array_common(numBits, 0, datasize, lGrib, - data, zref, factor, &z); + data, zref, factor, &z); } - else if ( numBits == 0 ) - { + else if (numBits == 0) { } - else - { + else { Error("Unimplemented packing factor %d!", numBits); } *gz = z; } -static -void encode_double_array_unrolled(int numBits, long packStart, long datasize, - GRIBPACK *restrict lGrib, - const double *restrict data, - double zref, double factor, long *restrict gz) +static void encode_double_array_unrolled(int numBits, long packStart, long datasize, + GRIBPACK* restrict lGrib, + const double* restrict data, + double zref, double factor, long* restrict gz) { U_BYTEORDER; long i, j, z = *gz; @@ -206,214 +188,175 @@ void encode_double_array_unrolled(int numBits, long packStart, long datasize, datasize -= packStart; { - long residual = datasize % __UNROLL_DEPTH_2; - long ofs = datasize - residual; + long residual = datasize % __UNROLL_DEPTH_2; + long ofs = datasize - residual; double dval[__UNROLL_DEPTH_2]; unsigned long ival; /* reducing FP operations to single FMA is slowing down on pwr6 ... */ - if ( numBits == 8 ) - { - unsigned char *cgrib = (unsigned char *) (lGrib + z); -#ifdef _GET_IBM_COUNTER + if (numBits == 8) { + unsigned char* cgrib = (unsigned char*)(lGrib + z); +#ifdef _GET_IBM_COUNTER hpmStart(2, "pack 8 bit unrolled"); #endif - for ( i = 0; i < datasize - residual; i += __UNROLL_DEPTH_2 ) - { - for (j = 0; j < __UNROLL_DEPTH_2; j++) - { - dval[j] = ((data[i+j] - zref) * factor + 0.5); + for (i = 0; i < datasize - residual; i += __UNROLL_DEPTH_2) { + for (j = 0; j < __UNROLL_DEPTH_2; j++) { + dval[j] = ((data[i + j] - zref) * factor + 0.5); } - for (j = 0; j < __UNROLL_DEPTH_2; j++) - { - *cgrib = (unsigned long) dval[j]; + for (j = 0; j < __UNROLL_DEPTH_2; j++) { + *cgrib = (unsigned long)dval[j]; cgrib++; z++; } } - for (j = 0; j < residual; j++) - { - dval[j] = ((data[ofs+j] - zref) * factor + 0.5); + for (j = 0; j < residual; j++) { + dval[j] = ((data[ofs + j] - zref) * factor + 0.5); } - for (j = 0; j < residual; j++) - { - *cgrib = (unsigned long) dval[j]; + for (j = 0; j < residual; j++) { + *cgrib = (unsigned long)dval[j]; cgrib++; z++; } -#ifdef _GET_IBM_COUNTER +#ifdef _GET_IBM_COUNTER hpmStop(2); #endif } - else if ( numBits == 16 ) - { - unsigned short *sgrib = (unsigned short *) (lGrib + z); -#ifdef _GET_IBM_COUNTER + else if (numBits == 16) { + unsigned short* sgrib = (unsigned short*)(lGrib + z); +#ifdef _GET_IBM_COUNTER hpmStart(3, "pack 16 bit unrolled"); #endif - for ( i = 0; i < datasize - residual; i += __UNROLL_DEPTH_2 ) - { - for (j = 0; j < __UNROLL_DEPTH_2; j++) - { - dval[j] = ((data[i+j] - zref) * factor + 0.5); + for (i = 0; i < datasize - residual; i += __UNROLL_DEPTH_2) { + for (j = 0; j < __UNROLL_DEPTH_2; j++) { + dval[j] = ((data[i + j] - zref) * factor + 0.5); } - if ( IS_BIGENDIAN() ) - { - for (j = 0; j < __UNROLL_DEPTH_2; j++) - { - *sgrib = (unsigned long) dval[j]; + if (IS_BIGENDIAN()) { + for (j = 0; j < __UNROLL_DEPTH_2; j++) { + *sgrib = (unsigned long)dval[j]; sgrib++; z += 2; } } - else - { - for (j = 0; j < __UNROLL_DEPTH_2; j++) - { - ival = (unsigned long) dval[j]; - lGrib[z ] = ival >> 8; - lGrib[z+1] = ival; + else { + for (j = 0; j < __UNROLL_DEPTH_2; j++) { + ival = (unsigned long)dval[j]; + lGrib[z] = ival >> 8; + lGrib[z + 1] = ival; z += 2; } } } - for (j = 0; j < residual; j++) - { - dval[j] = ((data[ofs+j] - zref) * factor + 0.5); + for (j = 0; j < residual; j++) { + dval[j] = ((data[ofs + j] - zref) * factor + 0.5); } - if ( IS_BIGENDIAN() ) - { - for (j = 0; j < residual; j++) - { - *sgrib = (unsigned long) dval[j]; + if (IS_BIGENDIAN()) { + for (j = 0; j < residual; j++) { + *sgrib = (unsigned long)dval[j]; sgrib++; z += 2; } } - else - { - for (j = 0; j < residual; j++) - { - ival = (unsigned long) dval[j]; - lGrib[z ] = ival >> 8; - lGrib[z+1] = ival; + else { + for (j = 0; j < residual; j++) { + ival = (unsigned long)dval[j]; + lGrib[z] = ival >> 8; + lGrib[z + 1] = ival; z += 2; } } -#ifdef _GET_IBM_COUNTER +#ifdef _GET_IBM_COUNTER hpmStop(3); #endif } - else if ( numBits == 24 ) - { -#ifdef _GET_IBM_COUNTER + else if (numBits == 24) { +#ifdef _GET_IBM_COUNTER hpmStart(4, "pack 24 bit unrolled"); #endif - for ( i = 0; i < datasize - residual; i += __UNROLL_DEPTH_2 ) - { - for (j = 0; j < __UNROLL_DEPTH_2; j++) - { - dval[j] = ((data[i+j] - zref) * factor + 0.5); + for (i = 0; i < datasize - residual; i += __UNROLL_DEPTH_2) { + for (j = 0; j < __UNROLL_DEPTH_2; j++) { + dval[j] = ((data[i + j] - zref) * factor + 0.5); } - for (j = 0; j < __UNROLL_DEPTH_2; j++) - { - ival = (unsigned long) dval[j]; - lGrib[z ] = ival >> 16; - lGrib[z+1] = ival >> 8; - lGrib[z+2] = ival; + for (j = 0; j < __UNROLL_DEPTH_2; j++) { + ival = (unsigned long)dval[j]; + lGrib[z] = ival >> 16; + lGrib[z + 1] = ival >> 8; + lGrib[z + 2] = ival; z += 3; } } - for (j = 0; j < residual; j++) - { - dval[j] = ((data[ofs+j] - zref) * factor + 0.5); + for (j = 0; j < residual; j++) { + dval[j] = ((data[ofs + j] - zref) * factor + 0.5); } - for (j = 0; j < residual; j++) - { - ival = (unsigned long) dval[j]; - lGrib[z ] = ival >> 16; - lGrib[z+1] = ival >> 8; - lGrib[z+2] = ival; + for (j = 0; j < residual; j++) { + ival = (unsigned long)dval[j]; + lGrib[z] = ival >> 16; + lGrib[z + 1] = ival >> 8; + lGrib[z + 2] = ival; z += 3; } -#ifdef _GET_IBM_COUNTER +#ifdef _GET_IBM_COUNTER hpmStop(4); #endif } - else if ( numBits == 32 ) - { -#ifdef _GET_IBM_COUNTER + else if (numBits == 32) { +#ifdef _GET_IBM_COUNTER hpmStart(5, "pack 32 bit unrolled"); #endif - unsigned int *igrib = (unsigned int *) (lGrib + z); - for ( i = 0; i < datasize - residual; i += __UNROLL_DEPTH_2 ) - { - for (j = 0; j < __UNROLL_DEPTH_2; j++) - { - dval[j] = ((data[i+j] - zref) * factor + 0.5); + unsigned int* igrib = (unsigned int*)(lGrib + z); + for (i = 0; i < datasize - residual; i += __UNROLL_DEPTH_2) { + for (j = 0; j < __UNROLL_DEPTH_2; j++) { + dval[j] = ((data[i + j] - zref) * factor + 0.5); } - if ( IS_BIGENDIAN() ) - { - for (j = 0; j < __UNROLL_DEPTH_2; j++) - { - *igrib = (unsigned long) dval[j]; + if (IS_BIGENDIAN()) { + for (j = 0; j < __UNROLL_DEPTH_2; j++) { + *igrib = (unsigned long)dval[j]; igrib++; z += 4; } } - else - { - for (j = 0; j < __UNROLL_DEPTH_2; j++) - { - ival = (unsigned long) dval[j]; - lGrib[z ] = ival >> 24; - lGrib[z+1] = ival >> 16; - lGrib[z+2] = ival >> 8; - lGrib[z+3] = ival; + else { + for (j = 0; j < __UNROLL_DEPTH_2; j++) { + ival = (unsigned long)dval[j]; + lGrib[z] = ival >> 24; + lGrib[z + 1] = ival >> 16; + lGrib[z + 2] = ival >> 8; + lGrib[z + 3] = ival; z += 4; } } } - for (j = 0; j < residual; j++) - { - dval[j] = ((data[ofs+j] - zref) * factor + 0.5); + for (j = 0; j < residual; j++) { + dval[j] = ((data[ofs + j] - zref) * factor + 0.5); } - if ( IS_BIGENDIAN() ) - { - for (j = 0; j < residual; j++) - { - *igrib = (unsigned long) dval[j]; + if (IS_BIGENDIAN()) { + for (j = 0; j < residual; j++) { + *igrib = (unsigned long)dval[j]; igrib++; z += 4; } } - else - { - for (j = 0; j < residual; j++) - { - ival = (unsigned long) dval[j]; - lGrib[z ] = ival >> 24; - lGrib[z+1] = ival >> 16; - lGrib[z+2] = ival >> 8; - lGrib[z+3] = ival; + else { + for (j = 0; j < residual; j++) { + ival = (unsigned long)dval[j]; + lGrib[z] = ival >> 24; + lGrib[z + 1] = ival >> 16; + lGrib[z + 2] = ival >> 8; + lGrib[z + 3] = ival; z += 4; } } -#ifdef _GET_IBM_COUNTER +#ifdef _GET_IBM_COUNTER hpmStop(5); #endif } - else if ( numBits > 0 && numBits <= 32 ) - { + else if (numBits > 0 && numBits <= 32) { encode_double_array_common(numBits, 0, datasize, lGrib, - data, zref, factor, &z); + data, zref, factor, &z); } - else if ( numBits == 0 ) - { + else if (numBits == 0) { } - else - { + else { Error("Unimplemented packing factor %d!", numBits); } } diff --git a/src/functions.c b/src/functions.c index b1ad7cafb..6790e2958 100644 --- a/src/functions.c +++ b/src/functions.c @@ -10,48 +10,140 @@ #include "grib_api_internal.h" -long grib_op_eq(long a, long b) {return a == b;} -long grib_op_ne(long a, long b) {return a != b;} -long grib_op_lt(long a, long b) {return a < b;} -long grib_op_gt(long a, long b) {return a > b;} -long grib_op_and(long a, long b) {return a && b;} -long grib_op_or(long a, long b) {return a || b;} -long grib_op_ge(long a, long b) {return a >= b;} -long grib_op_le(long a, long b) {return a <= b;} +long grib_op_eq(long a, long b) +{ + return a == b; +} +long grib_op_ne(long a, long b) +{ + return a != b; +} +long grib_op_lt(long a, long b) +{ + return a < b; +} +long grib_op_gt(long a, long b) +{ + return a > b; +} +long grib_op_and(long a, long b) +{ + return a && b; +} +long grib_op_or(long a, long b) +{ + return a || b; +} +long grib_op_ge(long a, long b) +{ + return a >= b; +} +long grib_op_le(long a, long b) +{ + return a <= b; +} -long grib_op_bit(long a, long b) {return a&(1< b;} -double grib_op_ge_d(double a, double b) {return a >= b;} -double grib_op_le_d(double a, double b) {return a <= b;} +double grib_op_eq_d(double a, double b) +{ + return a == b; +} +double grib_op_ne_d(double a, double b) +{ + return a != b; +} +double grib_op_lt_d(double a, double b) +{ + return a < b; +} +double grib_op_gt_d(double a, double b) +{ + return a > b; +} +double grib_op_ge_d(double a, double b) +{ + return a >= b; +} +double grib_op_le_d(double a, double b) +{ + return a <= b; +} -#define LOOKUP(a) if(proc == a) {return "&"#a;} +#define LOOKUP(a) \ + if (proc == a) { \ + return "&" #a; \ + } const char* grib_binop_long_proc_name(grib_binop_long_proc proc) { - if(!proc) return "NULL"; + if (!proc) + return "NULL"; LOOKUP(grib_op_eq); LOOKUP(grib_op_ne); LOOKUP(grib_op_lt); @@ -68,14 +160,15 @@ const char* grib_binop_long_proc_name(grib_binop_long_proc proc) LOOKUP(grib_op_div); LOOKUP(grib_op_mul); LOOKUP(grib_op_modulo); - fprintf(stderr,"Cannot find grib_binop_long_proc\n"); + fprintf(stderr, "Cannot find grib_binop_long_proc\n"); Assert(0); return NULL; } const char* grib_binop_double_proc_name(grib_binop_double_proc proc) { - if(!proc) return "NULL"; + if (!proc) + return "NULL"; LOOKUP(grib_op_mul_d); LOOKUP(grib_op_div_d); LOOKUP(grib_op_add_d); @@ -86,26 +179,28 @@ const char* grib_binop_double_proc_name(grib_binop_double_proc proc) LOOKUP(grib_op_gt_d); LOOKUP(grib_op_ge_d); LOOKUP(grib_op_le_d); - fprintf(stderr,"Cannot find grib_binop_double_proc_name\n"); + fprintf(stderr, "Cannot find grib_binop_double_proc_name\n"); Assert(0); return NULL; } const char* grib_unop_long_proc_name(grib_unop_long_proc proc) { - if(!proc) return "NULL"; + if (!proc) + return "NULL"; LOOKUP(grib_op_not); LOOKUP(grib_op_neg); - fprintf(stderr,"Cannot find grib_unop_long_proc_name\n"); + fprintf(stderr, "Cannot find grib_unop_long_proc_name\n"); Assert(0); return NULL; } const char* grib_unop_double_proc_name(grib_unop_double_proc proc) { - if(!proc) return "NULL"; + if (!proc) + return "NULL"; LOOKUP(grib_op_neg_d); - fprintf(stderr,"Cannot find grib_unop_double_proc_name\n"); + fprintf(stderr, "Cannot find grib_unop_double_proc_name\n"); Assert(0); return NULL; } diff --git a/src/grib_2order_packer_simple.c b/src/grib_2order_packer_simple.c index 4517532a9..f4feeecbf 100644 --- a/src/grib_2order_packer_simple.c +++ b/src/grib_2order_packer_simple.c @@ -13,90 +13,98 @@ static unsigned long calc_pow_2(unsigned long op) { unsigned long a = 1; - while(op--) a*=2; + while (op--) + a *= 2; return a; } static int calc_bits_needed(unsigned long spread) { int nbit = 0; - if (spread == 0) return nbit; - while (spread>0){ - spread/=2; + if (spread == 0) + return nbit; + while (spread > 0) { + spread /= 2; nbit++; } return nbit; } -static int find_next_group(const unsigned long* vals, size_t len, unsigned long w, unsigned long l,unsigned long* nbits, unsigned long* groupsize, long* r_val) +static int find_next_group(const unsigned long* vals, size_t len, unsigned long w, unsigned long l, unsigned long* nbits, unsigned long* groupsize, long* r_val) { long lmin = 0; long lmax = 0; size_t i = 0; - if (len == 0 ) return GRIB_ARRAY_TOO_SMALL; + if (len == 0) + return GRIB_ARRAY_TOO_SMALL; lmin = vals[0]; lmax = lmin; - while(i < len) { - if (vals[i] > lmax) lmax = vals[i]; - else if (vals[i] < lmin) lmin = vals[i]; - Assert((lmax-lmin) >= 0); - *nbits = calc_bits_needed(lmax-lmin); + while (i < len) { + if (vals[i] > lmax) + lmax = vals[i]; + else if (vals[i] < lmin) + lmin = vals[i]; + Assert((lmax - lmin) >= 0); + *nbits = calc_bits_needed(lmax - lmin); *r_val = lmin; i++; *groupsize = i; - if(*groupsize > l-2) return GRIB_SUCCESS; - if(*nbits > w-2) return GRIB_SUCCESS; + if (*groupsize > l - 2) + return GRIB_SUCCESS; + if (*nbits > w - 2) + return GRIB_SUCCESS; } return GRIB_SUCCESS; } -void grib_free_second_order_groups(grib_context *c,second_order_packed* sp) +void grib_free_second_order_groups(grib_context* c, second_order_packed* sp) { - if(!sp) return; - grib_context_free(c,sp->array_of_group_size); - grib_context_free(c,sp->array_of_group_refs); - grib_context_free(c,sp->array_of_group_width); - grib_context_free(c,sp); + if (!sp) + return; + grib_context_free(c, sp->array_of_group_size); + grib_context_free(c, sp->array_of_group_refs); + grib_context_free(c, sp->array_of_group_width); + grib_context_free(c, sp); } -second_order_packed* grib_get_second_order_groups(grib_context *c, const unsigned long* vals, size_t len) +second_order_packed* grib_get_second_order_groups(grib_context* c, const unsigned long* vals, size_t len) { - second_order_packed* s = (second_order_packed*)grib_context_malloc_clear(c,sizeof(second_order_packed)); + second_order_packed* s = (second_order_packed*)grib_context_malloc_clear(c, sizeof(second_order_packed)); const unsigned long* group_val = vals; - size_t nv = len; - size_t i = 0; + size_t nv = len; + size_t i = 0; unsigned long nbit_per_group; unsigned long size_of_group; long ref_of_group; - s->packed_byte_count = 0; - s->nbits_per_group_size = 6; - s->nbits_per_widths = 4; - s->size_of_group_array = 0; + s->packed_byte_count = 0; + s->nbits_per_group_size = 6; + s->nbits_per_widths = 4; + s->size_of_group_array = 0; - while(find_next_group(group_val, nv, calc_pow_2(s->nbits_per_widths), calc_pow_2(s->nbits_per_group_size ), &nbit_per_group, &size_of_group, &ref_of_group) == GRIB_SUCCESS){ + while (find_next_group(group_val, nv, calc_pow_2(s->nbits_per_widths), calc_pow_2(s->nbits_per_group_size), &nbit_per_group, &size_of_group, &ref_of_group) == GRIB_SUCCESS) { s->size_of_group_array += 1; - nv -= size_of_group; - group_val += size_of_group; - s->packed_byte_count += size_of_group*nbit_per_group; + nv -= size_of_group; + group_val += size_of_group; + s->packed_byte_count += size_of_group * nbit_per_group; } - s->packed_byte_count = ((s->packed_byte_count+7)/8); + s->packed_byte_count = ((s->packed_byte_count + 7) / 8); - s->array_of_group_size = (unsigned long*)grib_context_malloc_clear(c,sizeof(unsigned long)*s->size_of_group_array); - s->array_of_group_width = (unsigned long*)grib_context_malloc_clear(c,sizeof(unsigned long)*s->size_of_group_array); - s->array_of_group_refs = (long*)grib_context_malloc_clear(c,sizeof( long)*s->size_of_group_array); + s->array_of_group_size = (unsigned long*)grib_context_malloc_clear(c, sizeof(unsigned long) * s->size_of_group_array); + s->array_of_group_width = (unsigned long*)grib_context_malloc_clear(c, sizeof(unsigned long) * s->size_of_group_array); + s->array_of_group_refs = (long*)grib_context_malloc_clear(c, sizeof(long) * s->size_of_group_array); group_val = vals; - nv = len; + nv = len; - while(find_next_group(group_val, nv, calc_pow_2(s->nbits_per_widths), calc_pow_2(s->nbits_per_group_size ), &nbit_per_group, &size_of_group, &ref_of_group) == GRIB_SUCCESS){ - nv -= size_of_group; - group_val += size_of_group; - Assert(isize_of_group_array); + while (find_next_group(group_val, nv, calc_pow_2(s->nbits_per_widths), calc_pow_2(s->nbits_per_group_size), &nbit_per_group, &size_of_group, &ref_of_group) == GRIB_SUCCESS) { + nv -= size_of_group; + group_val += size_of_group; + Assert(i < s->size_of_group_array); s->array_of_group_size[i] = size_of_group; s->array_of_group_width[i] = nbit_per_group; s->array_of_group_refs[i] = ref_of_group; diff --git a/src/grib_accessor.c b/src/grib_accessor.c index 23287117a..321275d56 100644 --- a/src/grib_accessor.c +++ b/src/grib_accessor.c @@ -18,19 +18,22 @@ /* Note: A fast cut-down version of strcmp which does NOT return -1 */ /* 0 means input strings are equal and 1 means not equal */ -GRIB_INLINE static int grib_inline_strcmp(const char* a,const char* b) { - if (*a != *b) return 1; - while((*a!=0 && *b!=0) && *(a) == *(b) ) {a++;b++;} - return (*a==0 && *b==0) ? 0 : 1; +GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b) +{ + if (*a != *b) + return 1; + while ((*a != 0 && *b != 0) && *(a) == *(b)) { + a++; + b++; + } + return (*a == 0 && *b == 0) ? 0 : 1; } -void grib_accessor_dump(grib_accessor* a, grib_dumper* f) +void grib_accessor_dump(grib_accessor* a, grib_dumper* f) { - grib_accessor_class *c = a->cclass; - while(c) - { - if(c->dump) - { + grib_accessor_class* c = a->cclass; + while (c) { + if (c->dump) { c->dump(a, f); return; } @@ -41,12 +44,10 @@ void grib_accessor_dump(grib_accessor* a, grib_dumper* f) int grib_pack_missing(grib_accessor* a) { - grib_accessor_class *c = a->cclass; + grib_accessor_class* c = a->cclass; /*grib_context_log(a->context, GRIB_LOG_DEBUG, "(%s)%s is packing (double) %g",(a->parent->owner)?(a->parent->owner->name):"root", a->name ,v?(*v):0); */ - while(c) - { - if(c->pack_missing) - { + while (c) { + if (c->pack_missing) { return c->pack_missing(a); } c = c->super ? *(c->super) : NULL; @@ -57,12 +58,10 @@ int grib_pack_missing(grib_accessor* a) int grib_pack_zero(grib_accessor* a) { - grib_accessor_class *c = a->cclass; + grib_accessor_class* c = a->cclass; /*grib_context_log(a->context, GRIB_LOG_DEBUG, "(%s)%s is packing (double) %g",(a->parent->owner)?(a->parent->owner->name):"root", a->name ,v?(*v):0); */ - while(c) - { - if(c->clear) - { + while (c) { + if (c->clear) { return c->clear(a); } c = c->super ? *(c->super) : NULL; @@ -73,12 +72,10 @@ int grib_pack_zero(grib_accessor* a) int grib_is_missing_internal(grib_accessor* a) { - grib_accessor_class *c = a->cclass; + grib_accessor_class* c = a->cclass; /*grib_context_log(a->context, GRIB_LOG_DEBUG, "(%s)%s is packing (double) %g",(a->parent->owner)?(a->parent->owner->name):"root", a->name ,v?(*v):0); */ - while(c) - { - if(c->is_missing) - { + while (c) { + if (c->is_missing) { return c->is_missing(a); } c = c->super ? *(c->super) : NULL; @@ -87,15 +84,13 @@ int grib_is_missing_internal(grib_accessor* a) return 0; } -int grib_pack_double(grib_accessor* a, const double* v, size_t *len ) +int grib_pack_double(grib_accessor* a, const double* v, size_t* len) { - grib_accessor_class *c = a->cclass; + grib_accessor_class* c = a->cclass; /*grib_context_log(a->context, GRIB_LOG_DEBUG, "(%s)%s is packing (double) %g",(a->parent->owner)?(a->parent->owner->name):"root", a->name ,v?(*v):0); */ - while(c) - { - if(c->pack_double) - { - return c->pack_double(a,v,len); + while (c) { + if (c->pack_double) { + return c->pack_double(a, v, len); } c = c->super ? *(c->super) : NULL; } @@ -103,15 +98,13 @@ int grib_pack_double(grib_accessor* a, const double* v, size_t *len ) return 0; } -int grib_pack_expression(grib_accessor* a, grib_expression *e ) +int grib_pack_expression(grib_accessor* a, grib_expression* e) { - grib_accessor_class *c = a->cclass; + grib_accessor_class* c = a->cclass; /*grib_context_log(a->context, GRIB_LOG_DEBUG, "(%s)%s is packing (double) %g",(a->parent->owner)?(a->parent->owner->name):"root", a->name ,v?(*v):0); */ - while(c) - { - if(c->pack_expression) - { - return c->pack_expression(a,e); + while (c) { + if (c->pack_expression) { + return c->pack_expression(a, e); } c = c->super ? *(c->super) : NULL; } @@ -119,16 +112,13 @@ int grib_pack_expression(grib_accessor* a, grib_expression *e ) return 0; } -int grib_pack_string(grib_accessor* a, const char* v, size_t *len ) +int grib_pack_string(grib_accessor* a, const char* v, size_t* len) { - grib_accessor_class *c = a->cclass; + grib_accessor_class* c = a->cclass; /*grib_context_log(a->context, GRIB_LOG_DEBUG, "(%s)%s is packing (string) %s",(a->parent->owner)?(a->parent->owner->name):"root", a->name ,v?v:"(null)");*/ - while(c) - { - - if(c->pack_string) - { - return c->pack_string(a,v,len); + while (c) { + if (c->pack_string) { + return c->pack_string(a, v, len); } c = c->super ? *(c->super) : NULL; } @@ -136,15 +126,13 @@ int grib_pack_string(grib_accessor* a, const char* v, size_t *len ) return 0; } -int grib_pack_string_array(grib_accessor* a, const char** v, size_t *len ) +int grib_pack_string_array(grib_accessor* a, const char** v, size_t* len) { - grib_accessor_class *c = a->cclass; + grib_accessor_class* c = a->cclass; /*grib_context_log(a->context, GRIB_LOG_DEBUG, "(%s)%s is packing (string) %s",(a->parent->owner)?(a->parent->owner->name):"root", a->name ,v?v:"(null)");*/ - while(c) - { - if(c->pack_string_array) - { - return c->pack_string_array(a,v,len); + while (c) { + if (c->pack_string_array) { + return c->pack_string_array(a, v, len); } c = c->super ? *(c->super) : NULL; } @@ -152,15 +140,13 @@ int grib_pack_string_array(grib_accessor* a, const char** v, size_t *len ) return 0; } -int grib_pack_long(grib_accessor* a,const long* v, size_t *len ) +int grib_pack_long(grib_accessor* a, const long* v, size_t* len) { - grib_accessor_class *c = a->cclass; + grib_accessor_class* c = a->cclass; /*grib_context_log(a->context, GRIB_LOG_DEBUG, "(%s)%s is packing (long) %d",(a->parent->owner)?(a->parent->owner->name):"root", a->name ,v?(*v):0); */ - while(c) - { - if(c->pack_long) - { - return c->pack_long(a,v,len); + while (c) { + if (c->pack_long) { + return c->pack_long(a, v, len); } c = c->super ? *(c->super) : NULL; } @@ -168,15 +154,13 @@ int grib_pack_long(grib_accessor* a,const long* v, size_t *len ) return 0; } -int grib_pack_bytes(grib_accessor* a, const unsigned char* v, size_t *len ) +int grib_pack_bytes(grib_accessor* a, const unsigned char* v, size_t* len) { - grib_accessor_class *c = a->cclass; + grib_accessor_class* c = a->cclass; /*grib_context_log(a->context, GRIB_LOG_DEBUG, "(%s)%s is packing (bytes) %d",(a->parent->owner)?(a->parent->owner->name):"root", a->name ,v?(*v):0); */ - while(c) - { - if(c->pack_bytes) - { - return c->pack_bytes(a,v,len); + while (c) { + if (c->pack_bytes) { + return c->pack_bytes(a, v, len); } c = c->super ? *(c->super) : NULL; } @@ -184,15 +168,13 @@ int grib_pack_bytes(grib_accessor* a, const unsigned char* v, size_t *len ) return 0; } -int grib_unpack_bytes(grib_accessor* a, unsigned char* v, size_t *len ) +int grib_unpack_bytes(grib_accessor* a, unsigned char* v, size_t* len) { - grib_accessor_class *c = a->cclass; + grib_accessor_class* c = a->cclass; /*grib_context_log(a->context, GRIB_LOG_DEBUG, "(%s)%s is unpacking (bytes)",(a->parent->owner)?(a->parent->owner->name):"root", a->name ); */ - while(c) - { - if(c->unpack_bytes) - { - return c->unpack_bytes(a,v,len); + while (c) { + if (c->unpack_bytes) { + return c->unpack_bytes(a, v, len); } c = c->super ? *(c->super) : NULL; } @@ -200,14 +182,12 @@ int grib_unpack_bytes(grib_accessor* a, unsigned char* v, size_t *len ) return 0; } -int grib_unpack_double_subarray(grib_accessor* a, double* v, size_t start, size_t len ) +int grib_unpack_double_subarray(grib_accessor* a, double* v, size_t start, size_t len) { - grib_accessor_class *c = a->cclass; - while(c) - { - if(c->unpack_double_subarray) - { - return c->unpack_double_subarray(a,v,start,len); + grib_accessor_class* c = a->cclass; + while (c) { + if (c->unpack_double_subarray) { + return c->unpack_double_subarray(a, v, start, len); } c = c->super ? *(c->super) : NULL; } @@ -215,15 +195,13 @@ int grib_unpack_double_subarray(grib_accessor* a, double* v, size_t start, size_ return 0; } -int grib_unpack_double(grib_accessor* a, double* v, size_t *len ) +int grib_unpack_double(grib_accessor* a, double* v, size_t* len) { - grib_accessor_class *c = a->cclass; + grib_accessor_class* c = a->cclass; /*grib_context_log(a->context, GRIB_LOG_DEBUG, "(%s)%s is unpacking (double)",(a->parent->owner)?(a->parent->owner->name):"root", a->name ); */ - while(c) - { - if(c->unpack_double) - { - return c->unpack_double(a,v,len); + while (c) { + if (c->unpack_double) { + return c->unpack_double(a, v, len); } c = c->super ? *(c->super) : NULL; } @@ -231,29 +209,25 @@ int grib_unpack_double(grib_accessor* a, double* v, size_t *len ) return 0; } -int grib_unpack_double_element(grib_accessor* a, size_t i ,double* v ) +int grib_unpack_double_element(grib_accessor* a, size_t i, double* v) { - grib_accessor_class *c = a->cclass; - while(c) - { - if(c->unpack_double_element) - { - return c->unpack_double_element(a,i,v); + grib_accessor_class* c = a->cclass; + while (c) { + if (c->unpack_double_element) { + return c->unpack_double_element(a, i, v); } c = c->super ? *(c->super) : NULL; } return GRIB_NOT_IMPLEMENTED; } -int grib_unpack_string(grib_accessor* a, char* v, size_t *len ) +int grib_unpack_string(grib_accessor* a, char* v, size_t* len) { - grib_accessor_class *c = a->cclass; + grib_accessor_class* c = a->cclass; /* grib_context_log(a->context, GRIB_LOG_DEBUG, "(%s)%s is unpacking (string)",(a->parent->owner)?(a->parent->owner->name):"root", a->name ); */ - while(c) - { - if(c->unpack_string) - { - return c->unpack_string(a,v,len); + while (c) { + if (c->unpack_string) { + return c->unpack_string(a, v, len); } c = c->super ? *(c->super) : NULL; } @@ -261,14 +235,12 @@ int grib_unpack_string(grib_accessor* a, char* v, size_t *len ) return 0; } -int grib_unpack_string_array(grib_accessor* a, char** v, size_t *len ) +int grib_unpack_string_array(grib_accessor* a, char** v, size_t* len) { - grib_accessor_class *c = a->cclass; - while(c) - { - if(c->unpack_string_array) - { - return c->unpack_string_array(a,v,len); + grib_accessor_class* c = a->cclass; + while (c) { + if (c->unpack_string_array) { + return c->unpack_string_array(a, v, len); } c = c->super ? *(c->super) : NULL; } @@ -276,66 +248,64 @@ int grib_unpack_string_array(grib_accessor* a, char** v, size_t *len ) return 0; } -int grib_accessors_list_unpack_long(grib_accessors_list* al,long* val,size_t* buffer_len) +int grib_accessors_list_unpack_long(grib_accessors_list* al, long* val, size_t* buffer_len) { - int err=GRIB_SUCCESS; - size_t unpacked_len=0; - size_t len=0; + int err = GRIB_SUCCESS; + size_t unpacked_len = 0; + size_t len = 0; - while (al && err==GRIB_SUCCESS ) { - len=*buffer_len-unpacked_len; - err=grib_unpack_long(al->accessor, val + unpacked_len, &len); + while (al && err == GRIB_SUCCESS) { + len = *buffer_len - unpacked_len; + err = grib_unpack_long(al->accessor, val + unpacked_len, &len); unpacked_len += len; - al=al->next; + al = al->next; } - *buffer_len=unpacked_len; + *buffer_len = unpacked_len; return err; } -int grib_accessors_list_unpack_double(grib_accessors_list* al,double* val,size_t* buffer_len) +int grib_accessors_list_unpack_double(grib_accessors_list* al, double* val, size_t* buffer_len) { - int err=GRIB_SUCCESS; - size_t unpacked_len=0; - size_t len=0; + int err = GRIB_SUCCESS; + size_t unpacked_len = 0; + size_t len = 0; - while (al && err==GRIB_SUCCESS ) { - len=*buffer_len-unpacked_len; - err=grib_unpack_double(al->accessor, val + unpacked_len, &len); + while (al && err == GRIB_SUCCESS) { + len = *buffer_len - unpacked_len; + err = grib_unpack_double(al->accessor, val + unpacked_len, &len); unpacked_len += len; - al=al->next; + al = al->next; } - *buffer_len=unpacked_len; + *buffer_len = unpacked_len; return err; } -int grib_accessors_list_unpack_string(grib_accessors_list* al,char** val,size_t* buffer_len) +int grib_accessors_list_unpack_string(grib_accessors_list* al, char** val, size_t* buffer_len) { - int err=GRIB_SUCCESS; - size_t unpacked_len=0; - size_t len=0; + int err = GRIB_SUCCESS; + size_t unpacked_len = 0; + size_t len = 0; - while (al && err==GRIB_SUCCESS ) { - len=*buffer_len-unpacked_len; - err=grib_unpack_string_array(al->accessor, val + unpacked_len, &len); + while (al && err == GRIB_SUCCESS) { + len = *buffer_len - unpacked_len; + err = grib_unpack_string_array(al->accessor, val + unpacked_len, &len); unpacked_len += len; - al=al->next; + al = al->next; } - *buffer_len=unpacked_len; + *buffer_len = unpacked_len; return err; } -int grib_unpack_long(grib_accessor* a,long* v, size_t *len ) +int grib_unpack_long(grib_accessor* a, long* v, size_t* len) { - grib_accessor_class *c = a->cclass; + grib_accessor_class* c = a->cclass; /*grib_context_log(a->context, GRIB_LOG_DEBUG, "(%s)%s is unpacking (long)",(a->parent->owner)?(a->parent->owner->name):"root", a->name ); */ - while(c) - { - if(c->unpack_long) - { - return c->unpack_long(a,v,len); + while (c) { + if (c->unpack_long) { + return c->unpack_long(a, v, len); } c = c->super ? *(c->super) : NULL; } @@ -345,12 +315,12 @@ int grib_unpack_long(grib_accessor* a,long* v, size_t *len ) long grib_accessor_get_native_type(grib_accessor* a) { - grib_accessor_class *c = NULL; - if (a) c = a->cclass; + grib_accessor_class* c = NULL; + if (a) + c = a->cclass; - while(c) - { - if(c->get_native_type) + while (c) { + if (c->get_native_type) return c->get_native_type(a); c = c->super ? *(c->super) : NULL; } @@ -360,13 +330,13 @@ long grib_accessor_get_native_type(grib_accessor* a) long grib_get_next_position_offset(grib_accessor* a) { - grib_accessor_class *c = NULL; + grib_accessor_class* c = NULL; /*grib_context_log(a->context, GRIB_LOG_DEBUG, "(%s)%s is checking next (long)",(a->parent->owner)?(a->parent->owner->name):"root", a->name ); */ - if (a) c = a->cclass; + if (a) + c = a->cclass; - while(c) - { - if(c->next_offset) + while (c) { + if (c->next_offset) return c->next_offset(a); c = c->super ? *(c->super) : NULL; } @@ -376,12 +346,12 @@ long grib_get_next_position_offset(grib_accessor* a) long grib_string_length(grib_accessor* a) { - grib_accessor_class *c = NULL; - if (a) c = a->cclass; + grib_accessor_class* c = NULL; + if (a) + c = a->cclass; - while(c) - { - if(c->string_length) + while (c) { + if (c->string_length) return c->string_length(a); c = c->super ? *(c->super) : NULL; } @@ -391,12 +361,12 @@ long grib_string_length(grib_accessor* a) long grib_byte_offset(grib_accessor* a) { - grib_accessor_class *c = NULL; - if (a) c = a->cclass; + grib_accessor_class* c = NULL; + if (a) + c = a->cclass; - while(c) - { - if(c->byte_offset) + while (c) { + if (c->byte_offset) return c->byte_offset(a); c = c->super ? *(c->super) : NULL; } @@ -406,12 +376,12 @@ long grib_byte_offset(grib_accessor* a) long grib_byte_count(grib_accessor* a) { - grib_accessor_class *c = NULL; - if (a) c = a->cclass; + grib_accessor_class* c = NULL; + if (a) + c = a->cclass; - while(c) - { - if(c->byte_count) + while (c) { + if (c->byte_count) return c->byte_count(a); c = c->super ? *(c->super) : NULL; } @@ -419,15 +389,15 @@ long grib_byte_count(grib_accessor* a) return 0; } -int grib_value_count(grib_accessor* a,long* count) +int grib_value_count(grib_accessor* a, long* count) { - grib_accessor_class *c = NULL; - int err = 0; - if (a) c = a->cclass; + grib_accessor_class* c = NULL; + int err = 0; + if (a) + c = a->cclass; - while(c) - { - if(c->value_count) { + while (c) { + if (c->value_count) { err = c->value_count(a, count); return err; } @@ -437,48 +407,50 @@ int grib_value_count(grib_accessor* a,long* count) return 0; } -int grib_accessors_list_value_count(grib_accessors_list* al,size_t* count) +int grib_accessors_list_value_count(grib_accessors_list* al, size_t* count) { - long lcount=0; - *count=0; + long lcount = 0; + *count = 0; while (al) { - grib_value_count(al->accessor,&lcount); - *count+=lcount; - al=al->next; + grib_value_count(al->accessor, &lcount); + *count += lcount; + al = al->next; } return 0; } -int grib_accessor_notify_change(grib_accessor* a,grib_accessor* changed) +int grib_accessor_notify_change(grib_accessor* a, grib_accessor* changed) { - grib_accessor_class *c = NULL; - if (a) c = a->cclass; + grib_accessor_class* c = NULL; + if (a) + c = a->cclass; - while(c) - { - if(c->notify_change) - return c->notify_change(a,changed); + while (c) { + if (c->notify_change) + return c->notify_change(a, changed); c = c->super ? *(c->super) : NULL; } - if (a) printf("notify_change not implemented for %s %s\n",a->cclass->name, a->name); + if (a) + printf("notify_change not implemented for %s %s\n", a->cclass->name, a->name); Assert(0); return 0; } /* For this one, ALL init are called */ -static void init_accessor(grib_accessor_class* c,grib_accessor* a, const long len, grib_arguments* args) +static void init_accessor(grib_accessor_class* c, grib_accessor* a, const long len, grib_arguments* args) { - if(c) { - grib_accessor_class *s = c->super ? *(c->super) : NULL; - init_accessor(s,a,len,args); - if(c->init) c->init(a,len, args); + if (c) { + grib_accessor_class* s = c->super ? *(c->super) : NULL; + init_accessor(s, a, len, args); + if (c->init) + c->init(a, len, args); } } void grib_init_accessor(grib_accessor* a, const long len, grib_arguments* args) { - init_accessor(a->cclass,a,len,args); + init_accessor(a->cclass, a, len, args); } #if 0 @@ -494,47 +466,43 @@ static void post_init_accessor(grib_accessor_class* c,grib_accessor* a) /* For this one, ALL destroy are called */ -void grib_accessor_delete(grib_context *ct, grib_accessor* a) +void grib_accessor_delete(grib_context* ct, grib_accessor* a) { - grib_accessor_class *c = a->cclass; - while(c) - { - grib_accessor_class *s = c->super ? *(c->super) : NULL; + grib_accessor_class* c = a->cclass; + while (c) { + grib_accessor_class* s = c->super ? *(c->super) : NULL; /*printf("grib_accessor_delete: before destroy a=%p c->name=%s ==> a->name=%s\n", (void*)a, c->name, a->name);*/ - if(c->destroy) { - c->destroy(ct,a); + if (c->destroy) { + c->destroy(ct, a); } c = s; } /*printf("grib_accessor_delete before free a=%p\n", (void*)a);*/ - grib_context_free(ct,a); + grib_context_free(ct, a); } -grib_accessor* grib_accessor_clone(grib_accessor* a,grib_section* s,int* err) +grib_accessor* grib_accessor_clone(grib_accessor* a, grib_section* s, int* err) { - grib_accessor_class *c = a->cclass; - grib_context* ct=a->context; - while(c) - { - grib_accessor_class *super = c->super ? *(c->super) : NULL; - grib_context_log(ct,GRIB_LOG_DEBUG,"clone %s ==> %s",c->name,a->name); - if(c->make_clone) { - return c->make_clone(a,s,err); + grib_accessor_class* c = a->cclass; + grib_context* ct = a->context; + while (c) { + grib_accessor_class* super = c->super ? *(c->super) : NULL; + grib_context_log(ct, GRIB_LOG_DEBUG, "clone %s ==> %s", c->name, a->name); + if (c->make_clone) { + return c->make_clone(a, s, err); } c = super; } return 0; } -void grib_update_size(grib_accessor* a, size_t len ) +void grib_update_size(grib_accessor* a, size_t len) { - grib_accessor_class *c = a->cclass; + grib_accessor_class* c = a->cclass; /*grib_context_log(a->context, GRIB_LOG_DEBUG, "(%s)%s is packing (double) %g",(a->parent->owner)?(a->parent->owner->name):"root", a->name ,v?(*v):0); */ - while(c) - { - if(c->update_size) - { - c->update_size(a,len); + while (c) { + if (c->update_size) { + c->update_size(a, len); return; } c = c->super ? *(c->super) : NULL; @@ -542,14 +510,12 @@ void grib_update_size(grib_accessor* a, size_t len ) Assert(0); } -int grib_nearest_smaller_value(grib_accessor* a,double val,double* nearest) +int grib_nearest_smaller_value(grib_accessor* a, double val, double* nearest) { - grib_accessor_class *c = a->cclass; - while(c) - { - if(c->nearest_smaller_value) - { - return c->nearest_smaller_value(a,val,nearest); + grib_accessor_class* c = a->cclass; + while (c) { + if (c->nearest_smaller_value) { + return c->nearest_smaller_value(a, val, nearest); } c = c->super ? *(c->super) : NULL; } @@ -558,15 +524,13 @@ int grib_nearest_smaller_value(grib_accessor* a,double val,double* nearest) } -size_t grib_preferred_size(grib_accessor* a,int from_handle) +size_t grib_preferred_size(grib_accessor* a, int from_handle) { - grib_accessor_class *c = a->cclass; + grib_accessor_class* c = a->cclass; /*grib_context_log(a->context, GRIB_LOG_DEBUG, "(%s)%s is packing (long) %d",(a->parent->owner)?(a->parent->owner->name):"root", a->name ,v?(*v):0); */ - while(c) - { - if(c->preferred_size) - { - return c->preferred_size(a,from_handle); + while (c) { + if (c->preferred_size) { + return c->preferred_size(a, from_handle); } c = c->super ? *(c->super) : NULL; } @@ -576,12 +540,10 @@ size_t grib_preferred_size(grib_accessor* a,int from_handle) grib_accessor* grib_next_accessor(grib_accessor* a) { - grib_accessor_class *c = a->cclass; - while(c) - { - if(c->next) - { - return c->next(a,1); + grib_accessor_class* c = a->cclass; + while (c) { + if (c->next) { + return c->next(a, 1); } c = c->super ? *(c->super) : NULL; } @@ -589,16 +551,14 @@ grib_accessor* grib_next_accessor(grib_accessor* a) return 0; } -void grib_resize(grib_accessor* a,size_t new_size) +void grib_resize(grib_accessor* a, size_t new_size) { - grib_accessor_class *c = a->cclass; + grib_accessor_class* c = a->cclass; /*grib_context_log(a->context, GRIB_LOG_DEBUG, "(%s)%s is packing (long) %d",(a->parent->owner)?(a->parent->owner->name):"root", a->name ,v?(*v):0); */ - while(c) - { - if(c->resize) - { - c->resize(a,new_size); - return ; + while (c) { + if (c->resize) { + c->resize(a, new_size); + return; } c = c->super ? *(c->super) : NULL; } @@ -606,31 +566,28 @@ void grib_resize(grib_accessor* a,size_t new_size) return; } -int grib_compare_accessors(grib_accessor* a1,grib_accessor* a2,int compare_flags) +int grib_compare_accessors(grib_accessor* a1, grib_accessor* a2, int compare_flags) { - int ret=0; - long type1=0; - long type2=0; - int type_mismatch=0; - grib_accessor_class *c1=NULL; + int ret = 0; + long type1 = 0; + long type2 = 0; + int type_mismatch = 0; + grib_accessor_class* c1 = NULL; - if ((compare_flags & GRIB_COMPARE_NAMES) && grib_inline_strcmp(a1->name,a2->name)) + if ((compare_flags & GRIB_COMPARE_NAMES) && grib_inline_strcmp(a1->name, a2->name)) return GRIB_NAME_MISMATCH; - if ( compare_flags & GRIB_COMPARE_TYPES ) { - type1=grib_accessor_get_native_type( a1 ); - type2=grib_accessor_get_native_type( a2 ); + if (compare_flags & GRIB_COMPARE_TYPES) { + type1 = grib_accessor_get_native_type(a1); + type2 = grib_accessor_get_native_type(a2); type_mismatch = type1 != type2 ? 1 : 0; } - ret=GRIB_UNABLE_TO_COMPARE_ACCESSORS; - c1 = a1->cclass; - while(c1) - { - - if(c1->compare) - { + ret = GRIB_UNABLE_TO_COMPARE_ACCESSORS; + c1 = a1->cclass; + while (c1) { + if (c1->compare) { ret = c1->compare(a1, a2); break; } @@ -645,14 +602,19 @@ int grib_compare_accessors(grib_accessor* a1,grib_accessor* a2,int compare_flags const char* grib_get_type_name(int type) { - switch(type) - { - case GRIB_TYPE_LONG: return "long"; - case GRIB_TYPE_STRING: return "string"; - case GRIB_TYPE_BYTES: return "bytes"; - case GRIB_TYPE_DOUBLE: return "double"; - case GRIB_TYPE_LABEL: return "label"; - case GRIB_TYPE_SECTION: return "section"; + switch (type) { + case GRIB_TYPE_LONG: + return "long"; + case GRIB_TYPE_STRING: + return "string"; + case GRIB_TYPE_BYTES: + return "bytes"; + case GRIB_TYPE_DOUBLE: + return "double"; + case GRIB_TYPE_LABEL: + return "label"; + case GRIB_TYPE_SECTION: + return "section"; } return "unknown"; } @@ -668,82 +630,87 @@ int grib_accessor_clear_attributes(grib_accessor* a) } */ -int grib_accessor_add_attribute(grib_accessor* a,grib_accessor* attr,int nest_if_clash) +int grib_accessor_add_attribute(grib_accessor* a, grib_accessor* attr, int nest_if_clash) { - int id=0; - int idx=0; - grib_accessor* same=NULL; - grib_accessor* aloc=a; + int id = 0; + int idx = 0; + grib_accessor* same = NULL; + grib_accessor* aloc = a; - if(grib_accessor_has_attributes(a)) { - same=_grib_accessor_get_attribute(a,attr->name,&id); + if (grib_accessor_has_attributes(a)) { + same = _grib_accessor_get_attribute(a, attr->name, &id); } if (same) { - if (nest_if_clash==0) return GRIB_ATTRIBUTE_CLASH; - aloc=same; + if (nest_if_clash == 0) + return GRIB_ATTRIBUTE_CLASH; + aloc = same; } - for (id=0;idattributes[id] == NULL) { /* attr->parent=a->parent; */ - aloc->attributes[id]=attr; - attr->parent_as_attribute=aloc; + aloc->attributes[id] = attr; + attr->parent_as_attribute = aloc; if (aloc->same) - attr->same=_grib_accessor_get_attribute(aloc->same,attr->name,&idx); + attr->same = _grib_accessor_get_attribute(aloc->same, attr->name, &idx); - grib_context_log(a->context,GRIB_LOG_DEBUG,"added attribute %s->%s",a->name,attr->name); + grib_context_log(a->context, GRIB_LOG_DEBUG, "added attribute %s->%s", a->name, attr->name); return GRIB_SUCCESS; } } return GRIB_TOO_MANY_ATTRIBUTES; } -int grib_accessor_replace_attribute(grib_accessor* a,grib_accessor* attr) +int grib_accessor_replace_attribute(grib_accessor* a, grib_accessor* attr) { - int id=0; - int idx=0; - if (_grib_accessor_get_attribute(a,attr->name,&id) != NULL) { - grib_accessor_delete(a->context,a->attributes[id]); - a->attributes[id]=attr; - attr->parent_as_attribute=a; + int id = 0; + int idx = 0; + if (_grib_accessor_get_attribute(a, attr->name, &id) != NULL) { + grib_accessor_delete(a->context, a->attributes[id]); + a->attributes[id] = attr; + attr->parent_as_attribute = a; if (a->same) - attr->same=_grib_accessor_get_attribute(a->same,attr->name,&idx); - } else { - grib_accessor_add_attribute(a,attr,0); + attr->same = _grib_accessor_get_attribute(a->same, attr->name, &idx); + } + else { + grib_accessor_add_attribute(a, attr, 0); } return GRIB_SUCCESS; } -int grib_accessor_delete_attribute(grib_accessor* a,const char* name) +int grib_accessor_delete_attribute(grib_accessor* a, const char* name) { - int id=0; - if (_grib_accessor_get_attribute(a,name,&id) != NULL) { - grib_accessor_delete(a->context,a->attributes[id]); - a->attributes[id]=NULL; + int id = 0; + if (_grib_accessor_get_attribute(a, name, &id) != NULL) { + grib_accessor_delete(a->context, a->attributes[id]); + a->attributes[id] = NULL; return GRIB_SUCCESS; - } else { + } + else { return GRIB_NOT_FOUND; } } -grib_accessor* grib_accessor_get_attribute_by_index(grib_accessor* a,int index) +grib_accessor* grib_accessor_get_attribute_by_index(grib_accessor* a, int index) { - if (indexattributes[index]; + if (index < MAX_ACCESSOR_ATTRIBUTES) + return a->attributes[index]; return NULL; } -const char* grib_accessor_get_name(grib_accessor* a) { +const char* grib_accessor_get_name(grib_accessor* a) +{ return a->name; } -grib_accessor* _grib_accessor_get_attribute(grib_accessor* a,const char* name,int* index) +grib_accessor* _grib_accessor_get_attribute(grib_accessor* a, const char* name, int* index) { - int i=0; - while (iattributes[i]) { - if (!grib_inline_strcmp(a->attributes[i]->name,name)) { - *index=i; + int i = 0; + while (i < MAX_ACCESSOR_ATTRIBUTES && a->attributes[i]) { + if (!grib_inline_strcmp(a->attributes[i]->name, name)) { + *index = i; return a->attributes[i]; } i++; @@ -753,53 +720,58 @@ grib_accessor* _grib_accessor_get_attribute(grib_accessor* a,const char* name,in int grib_accessor_has_attributes(grib_accessor* a) { - return a->attributes[0] ? 1 : 0 ; + return a->attributes[0] ? 1 : 0; } grib_accessor* grib_accessor_get_attribute(grib_accessor* a, const char* name) { - int index=0; - const char* p=0; - char* basename=NULL; - const char* attribute_name=NULL; - grib_accessor* acc=NULL; - p=name; - while ( *(p+1) != '\0' && ( *p != '-' || *(p+1)!= '>' ) ) p++; - if (*(p+1) == '\0') { - return _grib_accessor_get_attribute(a,name,&index); - } else { - size_t size=p-name; - attribute_name=p+2; - basename=(char*)grib_context_malloc_clear(a->context,size+1); - basename=(char*)memcpy(basename,name,size); - acc=_grib_accessor_get_attribute(a,basename,&index); - grib_context_free(a->context,basename); - if (acc) return grib_accessor_get_attribute(acc,attribute_name); - else return NULL; + int index = 0; + const char* p = 0; + char* basename = NULL; + const char* attribute_name = NULL; + grib_accessor* acc = NULL; + p = name; + while (*(p + 1) != '\0' && (*p != '-' || *(p + 1) != '>')) + p++; + if (*(p + 1) == '\0') { + return _grib_accessor_get_attribute(a, name, &index); + } + else { + size_t size = p - name; + attribute_name = p + 2; + basename = (char*)grib_context_malloc_clear(a->context, size + 1); + basename = (char*)memcpy(basename, name, size); + acc = _grib_accessor_get_attribute(a, basename, &index); + grib_context_free(a->context, basename); + if (acc) + return grib_accessor_get_attribute(acc, attribute_name); + else + return NULL; } } grib_accessors_list* grib_accessors_list_create(grib_context* c) { - return (grib_accessors_list*)grib_context_malloc_clear(c,sizeof(grib_accessors_list)); + return (grib_accessors_list*)grib_context_malloc_clear(c, sizeof(grib_accessors_list)); } -void grib_accessors_list_push(grib_accessors_list* al,grib_accessor* a,int rank) +void grib_accessors_list_push(grib_accessors_list* al, grib_accessor* a, int rank) { grib_accessors_list* last; - grib_context* c=a->context; + grib_context* c = a->context; - last=grib_accessors_list_last(al); + last = grib_accessors_list_last(al); if (last && last->accessor) { - last->next=(grib_accessors_list*)grib_context_malloc_clear(c,sizeof(grib_accessors_list)); - last->next->accessor=a; - last->next->prev=last; - last->next->rank=rank; - al->last=last->next; - } else { - al->accessor=a; - al->rank=rank; - al->last=al; + last->next = (grib_accessors_list*)grib_context_malloc_clear(c, sizeof(grib_accessors_list)); + last->next->accessor = a; + last->next->prev = last; + last->next->rank = rank; + al->last = last->next; + } + else { + al->accessor = a; + al->rank = rank; + al->last = al; } } @@ -817,29 +789,30 @@ grib_accessors_list* grib_accessors_list_last(grib_accessors_list* al) return al->last; } -grib_accessors_list* grib_accessors_list_find(grib_accessors_list* al,grib_accessor* a) +grib_accessors_list* grib_accessors_list_find(grib_accessors_list* al, grib_accessor* a) { - grib_accessors_list* last=al; - grib_accessors_list* next=al->next; + grib_accessors_list* last = al; + grib_accessors_list* next = al->next; - while(next) { - if (last->accessor == a) return last; - last=next; - next=last->next; + while (next) { + if (last->accessor == a) + return last; + last = next; + next = last->next; } return NULL; } -void grib_accessors_list_delete(grib_context* c,grib_accessors_list* al) +void grib_accessors_list_delete(grib_context* c, grib_accessors_list* al) { grib_accessors_list* tmp; while (al) { - tmp=al->next; + tmp = al->next; /*grib_accessor_delete(c, al->accessor);*/ - grib_context_free(c,al); - al=tmp; + grib_context_free(c, al); + al = tmp; } } diff --git a/src/grib_accessor_class.c b/src/grib_accessor_class.c index a926b9dae..f53a43050 100644 --- a/src/grib_accessor_class.c +++ b/src/grib_accessor_class.c @@ -18,16 +18,16 @@ #include "grib_accessor_class.h" #if GRIB_PTHREADS -static pthread_once_t once = PTHREAD_ONCE_INIT; +static pthread_once_t once = PTHREAD_ONCE_INIT; static pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER; -static void init() { +static void init() +{ pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); - pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init(&mutex1,&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&mutex1, &attr); pthread_mutexattr_destroy(&attr); - } #elif GRIB_OMP_THREADS static int once = 0; @@ -37,8 +37,7 @@ static void init() { GRIB_OMP_CRITICAL(lock_grib_accessor_class_c) { - if (once == 0) - { + if (once == 0) { omp_init_nest_lock(&mutex1); once = 1; } @@ -48,182 +47,190 @@ static void init() struct table_entry { - char *type; - grib_accessor_class **cclass; + char* type; + grib_accessor_class** cclass; }; #ifdef ACCESSOR_FACTORY_USE_TRIE /* Note: A fast cut-down version of strcmp which does NOT return -1 */ /* 0 means input strings are equal and 1 means not equal */ -static GRIB_INLINE int grib_inline_strcmp(const char* a,const char* b) +static GRIB_INLINE int grib_inline_strcmp(const char* a, const char* b) { - if (*a != *b) return 1; - while((*a!=0 && *b!=0) && *(a) == *(b) ) {a++;b++;} - return (*a==0 && *b==0) ? 0 : 1; + if (*a != *b) + return 1; + while ((*a != 0 && *b != 0) && *(a) == *(b)) { + a++; + b++; + } + return (*a == 0 && *b == 0) ? 0 : 1; } -static struct table_entry table[] = -{ +static struct table_entry table[] = { /* This file is generated by ./make_class.pl */ #include "grib_accessor_factory.h" }; #endif -#define NUMBER(x) (sizeof(x)/sizeof(x[0])) +#define NUMBER(x) (sizeof(x) / sizeof(x[0])) -grib_section* grib_create_root_section(const grib_context *context, grib_handle *h) +grib_section* grib_create_root_section(const grib_context* context, grib_handle* h) { - char* fpath=0; - grib_section* s = (grib_section*) grib_context_malloc_clear(context,sizeof(grib_section)); + char* fpath = 0; + grib_section* s = (grib_section*)grib_context_malloc_clear(context, sizeof(grib_section)); - GRIB_MUTEX_INIT_ONCE(&once,&init); + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex1); - if(h->context->grib_reader == NULL) { - if ((fpath=grib_context_full_defs_path(h->context,"boot.def"))==NULL) { - grib_context_log(h->context,GRIB_LOG_FATAL, - "Unable to find boot.def. Context path=%s\n" - "\nPossible causes:\n" - "- The software is not correctly installed\n" - "- The environment variable ECCODES_DEFINITION_PATH is defined but incorrect\n", - context->grib_definition_files_path); + if (h->context->grib_reader == NULL) { + if ((fpath = grib_context_full_defs_path(h->context, "boot.def")) == NULL) { + grib_context_log(h->context, GRIB_LOG_FATAL, + "Unable to find boot.def. Context path=%s\n" + "\nPossible causes:\n" + "- The software is not correctly installed\n" + "- The environment variable ECCODES_DEFINITION_PATH is defined but incorrect\n", + context->grib_definition_files_path); } - grib_parse_file(h->context,fpath); + grib_parse_file(h->context, fpath); } GRIB_MUTEX_UNLOCK(&mutex1); - s->h = h; + s->h = h; s->aclength = NULL; s->owner = NULL; s->block = (grib_block_of_accessors*) - grib_context_malloc_clear(context, sizeof(grib_block_of_accessors)); + grib_context_malloc_clear(context, sizeof(grib_block_of_accessors)); grib_context_log(context, GRIB_LOG_DEBUG, "Creating root section"); return s; } /* Only used if ACCESSOR_FACTORY_USE_TRIE */ #ifdef ACCESSOR_FACTORY_USE_TRIE -static GRIB_INLINE grib_accessor_class* get_class(grib_context* c,char* type) +static GRIB_INLINE grib_accessor_class* get_class(grib_context* c, char* type) { int i; - int table_count = 0; - grib_accessor_class** the_class=NULL; + int table_count = 0; + grib_accessor_class** the_class = NULL; - if ( (the_class=(grib_accessor_class**)grib_trie_get(c->classes,type))!=NULL) + if ((the_class = (grib_accessor_class**)grib_trie_get(c->classes, type)) != NULL) return *(the_class); table_count = NUMBER(table); - for(i = 0; i < table_count ; i++) { - if( grib_inline_strcmp(type,table[i].type) == 0 ) - { - grib_trie_insert(c->classes,type,table[i].cclass); + for (i = 0; i < table_count; i++) { + if (grib_inline_strcmp(type, table[i].type) == 0) { + grib_trie_insert(c->classes, type, table[i].cclass); return *(table[i].cclass); } } grib_context_log(c, GRIB_LOG_ERROR, "ecCodes Version: %s\nDefinition files path: %s\n", - ECCODES_VERSION_STR, c->grib_definition_files_path); - grib_context_log(c,GRIB_LOG_FATAL,"unable to create class %s",type); + ECCODES_VERSION_STR, c->grib_definition_files_path); + grib_context_log(c, GRIB_LOG_FATAL, "unable to create class %s", type); return NULL; } #endif grib_accessor* grib_accessor_factory(grib_section* p, grib_action* creator, - const long len, grib_arguments* params) + const long len, grib_arguments* params) { - grib_accessor_class* c=NULL; - grib_accessor* a=NULL; - size_t size=0; + grib_accessor_class* c = NULL; + grib_accessor* a = NULL; + size_t size = 0; #ifdef ACCESSOR_FACTORY_USE_TRIE - c = get_class(p->h->context,creator->op); + c = get_class(p->h->context, creator->op); #else /* Use the hash table built with gperf (See make_accessor_class_hash.ksh) */ - c=*((grib_accessor_classes_hash(creator->op,strlen(creator->op)))->cclass); + c = *((grib_accessor_classes_hash(creator->op, strlen(creator->op)))->cclass); #endif - a = (grib_accessor*) grib_context_malloc_clear(p->h->context,c->size); + a = (grib_accessor*)grib_context_malloc_clear(p->h->context, c->size); - a->name = creator->name; - a->name_space = creator->name_space; + a->name = creator->name; + a->name_space = creator->name_space; - a->all_names[0] = creator->name; - a->all_name_spaces[0] = creator->name_space; + a->all_names[0] = creator->name; + a->all_name_spaces[0] = creator->name_space; - a->creator = creator; - a->context = p->h->context; - a->h = NULL; - a->next = NULL; - a->previous = NULL; - a->parent = p; - a->length = 0 ; - a->offset = 0; - a->flags = creator->flags; - a->set = creator->set; + a->creator = creator; + a->context = p->h->context; + a->h = NULL; + a->next = NULL; + a->previous = NULL; + a->parent = p; + a->length = 0; + a->offset = 0; + a->flags = creator->flags; + a->set = creator->set; - if(p->block->last) { - a->offset = grib_get_next_position_offset(p->block->last); + if (p->block->last) { + a->offset = grib_get_next_position_offset(p->block->last); #if 0 printf("offset: p->block->last %s %s %ld %ld\n", p->block->last->cclass->name, p->block->last->name,(long)p->block->last->offset,(long)p->block->last->length); #endif - } else { - if(p->owner) { - a->offset = p->owner->offset; - } else - a->offset = 0; + } + else { + if (p->owner) { + a->offset = p->owner->offset; + } + else + a->offset = 0; } - a->cclass = c; + a->cclass = c; - grib_init_accessor(a, len, params); + grib_init_accessor(a, len, params); size = grib_get_next_position_offset(a); - if(size > p->h->buffer->ulength) { - if(!p->h->buffer->growable) { - if(!p->h->partial) + if (size > p->h->buffer->ulength) { + if (!p->h->buffer->growable) { + if (!p->h->partial) grib_context_log(p->h->context, GRIB_LOG_ERROR, - "Creating (%s)%s of %s at offset %d-%d over message boundary (%d)", - p->owner?p->owner->name : "" ,a->name , - creator->op, a->offset, - a->offset + a->length, - p->h->buffer->ulength); + "Creating (%s)%s of %s at offset %d-%d over message boundary (%d)", + p->owner ? p->owner->name : "", a->name, + creator->op, a->offset, + a->offset + a->length, + p->h->buffer->ulength); - grib_accessor_delete(p->h->context,a); + grib_accessor_delete(p->h->context, a); return NULL; - } else { - grib_context_log(p->h->context,GRIB_LOG_DEBUG, - "CREATE: name=%s class=%s offset=%ld length=%ld action=", - a->name,a->cclass->name,a->offset,a->length); + } + else { + grib_context_log(p->h->context, GRIB_LOG_DEBUG, + "CREATE: name=%s class=%s offset=%ld length=%ld action=", + a->name, a->cclass->name, a->offset, a->length); - grib_grow_buffer(p->h->context,p->h->buffer,size); + grib_grow_buffer(p->h->context, p->h->buffer, size); p->h->buffer->ulength = size; } } if (p->h->context->debug == 1) { - if(p->owner) + if (p->owner) grib_context_log(p->h->context, GRIB_LOG_DEBUG, - "Creating (%s)%s of %s at offset %d [len=%d]", - p->owner->name ,a->name ,creator->op, a->offset,len,p->block); + "Creating (%s)%s of %s at offset %d [len=%d]", + p->owner->name, a->name, creator->op, a->offset, len, p->block); else grib_context_log(p->h->context, GRIB_LOG_DEBUG, - "Creating root %s of %s at offset %d [len=%d]", - a->name ,creator->op, a->offset,len,p->block); + "Creating root %s of %s at offset %d [len=%d]", + a->name, creator->op, a->offset, len, p->block); } return a; } -static void link_same_attributes(grib_accessor* a,grib_accessor* b) +static void link_same_attributes(grib_accessor* a, grib_accessor* b) { - int i=0; - int idx=0; - grib_accessor* bAttribute=NULL; - if (a==NULL || b==NULL) return; - if (!grib_accessor_has_attributes(b)) return; - while (iattributes[i]) { - bAttribute=_grib_accessor_get_attribute(b,a->attributes[i]->name,&idx); - if (bAttribute) a->attributes[i]->same=bAttribute; + int i = 0; + int idx = 0; + grib_accessor* bAttribute = NULL; + if (a == NULL || b == NULL) + return; + if (!grib_accessor_has_attributes(b)) + return; + while (i < MAX_ACCESSOR_ATTRIBUTES && a->attributes[i]) { + bAttribute = _grib_accessor_get_attribute(b, a->attributes[i]->name, &idx); + if (bAttribute) + a->attributes[i]->same = bAttribute; i++; } } @@ -234,24 +241,24 @@ void grib_push_accessor(grib_accessor* a, grib_block_of_accessors* l) grib_handle* hand = grib_handle_of_accessor(a); if (!l->first) l->first = l->last = a; - else{ + else { l->last->next = a; - a->previous = l->last; + a->previous = l->last; } l->last = a; if (hand->use_trie) { if (*(a->all_names[0]) != '_') { - id=grib_hash_keys_get_id(a->context->keys,a->all_names[0]); + id = grib_hash_keys_get_id(a->context->keys, a->all_names[0]); - DebugAssert(id >=0 && id < ACCESSORS_ARRAY_SIZE); + DebugAssert(id >= 0 && id < ACCESSORS_ARRAY_SIZE); - a->same=hand->accessors[id]; - link_same_attributes(a,a->same); - hand->accessors[id]=a; + a->same = hand->accessors[id]; + link_same_attributes(a, a->same); + hand->accessors[id] = a; - if(a->same == a) { - fprintf(stderr,"---> %s\n",a->name); + if (a->same == a) { + fprintf(stderr, "---> %s\n", a->name); Assert(a->same != a); } } @@ -262,35 +269,37 @@ void grib_section_post_init(grib_section* s) { grib_accessor* a = s ? s->block->first : NULL; - while(a ) { - grib_accessor_class* c=a->cclass; - if(c->post_init) c->post_init(a); + while (a) { + grib_accessor_class* c = a->cclass; + if (c->post_init) + c->post_init(a); if (a->sub_section) grib_section_post_init(a->sub_section); a = a->next; } } -int grib_section_adjust_sizes(grib_section* s,int update,int depth) +int grib_section_adjust_sizes(grib_section* s, int update, int depth) { - int err = 0; + int err = 0; grib_accessor* a = s ? s->block->first : NULL; - size_t length = update ? 0 : (s?s->padding:0); - size_t offset = (s && s->owner) ? s->owner->offset:0; + size_t length = update ? 0 : (s ? s->padding : 0); + size_t offset = (s && s->owner) ? s->owner->offset : 0; int force_update = update > 1; - while(a) { + while (a) { register long l; /* grib_section_adjust_sizes(grib_get_sub_section(a),update,depth+1); */ - err = grib_section_adjust_sizes(a->sub_section,update,depth+1); - if (err) return err; + err = grib_section_adjust_sizes(a->sub_section, update, depth + 1); + if (err) + return err; /*grib_context_log(a->context,GRIB_LOG_DEBUG,"grib_section_adjust_sizes: %s %ld [len=%ld] (depth=%d)",a->name,(long)a->offset,(long)a->length,depth);*/ l = a->length; - if(offset != a->offset) { - grib_context_log(a->context,GRIB_LOG_ERROR, - "Offset mismatch %s A->offset %ld offset %ld\n",a->name,(long)a->offset, (long)offset); + if (offset != a->offset) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "Offset mismatch %s A->offset %ld offset %ld\n", a->name, (long)a->offset, (long)offset); a->offset = offset; return GRIB_DECODING_ERROR; } @@ -299,30 +308,25 @@ int grib_section_adjust_sizes(grib_section* s,int update,int depth) a = a->next; } - if(s) - { - if(s->aclength) - { - size_t len = 1; - long plen = 0; - int lret=grib_unpack_long(s->aclength, &plen, &len); - Assert( lret == GRIB_SUCCESS); + if (s) { + if (s->aclength) { + size_t len = 1; + long plen = 0; + int lret = grib_unpack_long(s->aclength, &plen, &len); + Assert(lret == GRIB_SUCCESS); /* This happens when there is some padding */ - if((plen != length) || force_update) - { - if(update) - { + if ((plen != length) || force_update) { + if (update) { plen = length; - lret=grib_pack_long(s->aclength, &plen, &len); + lret = grib_pack_long(s->aclength, &plen, &len); Assert(lret == GRIB_SUCCESS); s->padding = 0; } else { - if(!s->h->partial) { - if(length >= plen) - { - grib_context_log(s->h->context,GRIB_LOG_ERROR,"Invalid size %ld found for %s, assuming %ld", - (long)plen,s->owner->name,(long)length); + if (!s->h->partial) { + if (length >= plen) { + grib_context_log(s->h->context, GRIB_LOG_ERROR, "Invalid size %ld found for %s, assuming %ld", + (long)plen, s->owner->name, (long)length); plen = length; } s->padding = plen - length; @@ -332,7 +336,7 @@ int grib_section_adjust_sizes(grib_section* s,int update,int depth) } } - if(s->owner) { + if (s->owner) { /*grib_context_log(s->owner->context,GRIB_LOG_DEBUG,"grib_section_adjust_sizes: updating owner (%s->length old=%ld new=%ld)",s->owner->name,(long)s->owner->length,(long)length);*/ s->owner->length = length; } @@ -341,7 +345,7 @@ int grib_section_adjust_sizes(grib_section* s,int update,int depth) return err; } -int grib_get_block_length(grib_section* s, size_t *l) +int grib_get_block_length(grib_section* s, size_t* l) { *l = s->length; return GRIB_SUCCESS; @@ -399,13 +403,13 @@ grib_accessor* find_paddings(grib_section* s) { grib_accessor* a = s ? s->block->first : NULL; - while(a) - { + while (a) { /* grib_accessor* p = find_paddings(grib_get_sub_section(a)); */ grib_accessor* p = find_paddings(a->sub_section); - if(p) return p; + if (p) + return p; - if(grib_preferred_size(a,0) != a->length) + if (grib_preferred_size(a, 0) != a->length) return a; a = a->next; @@ -420,10 +424,9 @@ void grib_update_paddings(grib_section* s) grib_accessor* changed; /* while((changed = find_paddings(s)) != NULL) */ - while((changed = find_paddings(s->h->root)) != NULL) - { + while ((changed = find_paddings(s->h->root)) != NULL) { Assert(changed != last); - grib_resize(changed,grib_preferred_size(changed,0)); + grib_resize(changed, grib_preferred_size(changed, 0)); last = changed; } } diff --git a/src/grib_accessor_class_abstract_long_vector.c b/src/grib_accessor_class_abstract_long_vector.c index 8dcf3f286..eebb1887f 100644 --- a/src/grib_accessor_class_abstract_long_vector.c +++ b/src/grib_accessor_class_abstract_long_vector.c @@ -38,58 +38,59 @@ or edit "accessor.class" and rerun ./make_class.pl static void init_class(grib_accessor_class*); -typedef struct grib_accessor_abstract_long_vector { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in abstract_long_vector */ - long* v; - long pack_index; - int number_of_elements; +typedef struct grib_accessor_abstract_long_vector +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in abstract_long_vector */ + long* v; + long pack_index; + int number_of_elements; } grib_accessor_abstract_long_vector; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_abstract_long_vector = { - &grib_accessor_class_gen, /* super */ - "abstract_long_vector", /* name */ - sizeof(grib_accessor_abstract_long_vector), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "abstract_long_vector", /* name */ + sizeof(grib_accessor_abstract_long_vector), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -98,42 +99,38 @@ grib_accessor_class* grib_accessor_class_abstract_long_vector = &_grib_accessor_ static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ - - - - diff --git a/src/grib_accessor_class_abstract_vector.c b/src/grib_accessor_class_abstract_vector.c index 399eb9707..672b8fd43 100644 --- a/src/grib_accessor_class_abstract_vector.c +++ b/src/grib_accessor_class_abstract_vector.c @@ -37,58 +37,59 @@ or edit "accessor.class" and rerun ./make_class.pl static void init_class(grib_accessor_class*); -typedef struct grib_accessor_abstract_vector { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in double */ -/* Members defined in abstract_vector */ - double* v; - int number_of_elements; +typedef struct grib_accessor_abstract_vector +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in double */ + /* Members defined in abstract_vector */ + double* v; + int number_of_elements; } grib_accessor_abstract_vector; extern grib_accessor_class* grib_accessor_class_double; static grib_accessor_class _grib_accessor_class_abstract_vector = { - &grib_accessor_class_double, /* super */ - "abstract_vector", /* name */ - sizeof(grib_accessor_abstract_vector), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_double, /* super */ + "abstract_vector", /* name */ + sizeof(grib_accessor_abstract_vector), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -97,42 +98,38 @@ grib_accessor_class* grib_accessor_class_abstract_vector = &_grib_accessor_class static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ - - - - diff --git a/src/grib_accessor_class_apply_operators.c b/src/grib_accessor_class_apply_operators.c index b8779e768..015ef3241 100644 --- a/src/grib_accessor_class_apply_operators.c +++ b/src/grib_accessor_class_apply_operators.c @@ -59,91 +59,92 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int unpack_string_array (grib_accessor*, char**, size_t *len); -static int value_count(grib_accessor*,long*); -static void destroy(grib_context*,grib_accessor*); +static int get_native_type(grib_accessor*); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int unpack_string_array(grib_accessor*, char**, size_t* len); +static int value_count(grib_accessor*, long*); +static void destroy(grib_context*, grib_accessor*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_apply_operators { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in apply_operators */ - const char* expandedDescriptors; - const char* expandedScale; - const char* expandedReference; - const char* expandedWidth; - const char* abbreviation; - const char* type; - const char* name; - const char* unit; - int index; - long* expandedAO; - long* scaleAO; - double* referenceAO; - long* widthAO; - long* bitmapNumber; - long* associatedBitmapNumber; - long* associatedBitmapIndex; - long* associatedInfoNumber; - char** abbreviations; - char** types; - char** names; - char** units; - size_t expandedAOSize; - int do_compute; +typedef struct grib_accessor_apply_operators +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in apply_operators */ + const char* expandedDescriptors; + const char* expandedScale; + const char* expandedReference; + const char* expandedWidth; + const char* abbreviation; + const char* type; + const char* name; + const char* unit; + int index; + long* expandedAO; + long* scaleAO; + double* referenceAO; + long* widthAO; + long* bitmapNumber; + long* associatedBitmapNumber; + long* associatedBitmapIndex; + long* associatedInfoNumber; + char** abbreviations; + char** types; + char** names; + char** units; + size_t expandedAOSize; + int do_compute; } grib_accessor_apply_operators; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_apply_operators = { - &grib_accessor_class_long, /* super */ - "apply_operators", /* name */ - sizeof(grib_accessor_apply_operators), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - &unpack_string_array, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "apply_operators", /* name */ + sizeof(grib_accessor_apply_operators), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + &destroy, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + &unpack_string_array, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -152,64 +153,66 @@ grib_accessor_class* grib_accessor_class_apply_operators = &_grib_accessor_class static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ #define MAX_DELAYED_REPLICATION_COUNT 1000 -static void self_clear(grib_context* c,grib_accessor_apply_operators* self) +static void self_clear(grib_context* c, grib_accessor_apply_operators* self) { - size_t i=0; - if (!self->expandedAOSize) return; - - grib_context_free(c,self->expandedAO); - grib_context_free(c,self->scaleAO); - grib_context_free(c,self->referenceAO); - grib_context_free(c,self->widthAO); - grib_context_free(c,self->bitmapNumber); - grib_context_free(c,self->associatedBitmapNumber); - grib_context_free(c,self->associatedBitmapIndex); - grib_context_free(c,self->associatedInfoNumber); - - for (i=0;iexpandedAOSize;i++) { - if (!self->abbreviations[i]) break; - grib_context_free(c,self->abbreviations[i]); - grib_context_free(c,self->types[i]); - grib_context_free(c,self->names[i]); - grib_context_free(c,self->units[i]); + size_t i = 0; + if (!self->expandedAOSize) + return; + + grib_context_free(c, self->expandedAO); + grib_context_free(c, self->scaleAO); + grib_context_free(c, self->referenceAO); + grib_context_free(c, self->widthAO); + grib_context_free(c, self->bitmapNumber); + grib_context_free(c, self->associatedBitmapNumber); + grib_context_free(c, self->associatedBitmapIndex); + grib_context_free(c, self->associatedInfoNumber); + + for (i = 0; i < self->expandedAOSize; i++) { + if (!self->abbreviations[i]) + break; + grib_context_free(c, self->abbreviations[i]); + grib_context_free(c, self->types[i]); + grib_context_free(c, self->names[i]); + grib_context_free(c, self->units[i]); } - grib_context_free(c,self->abbreviations); - grib_context_free(c,self->types); - grib_context_free(c,self->names); - grib_context_free(c,self->units); + grib_context_free(c, self->abbreviations); + grib_context_free(c, self->types); + grib_context_free(c, self->names); + grib_context_free(c, self->units); } -static void init(grib_accessor* a, const long len , grib_arguments* args ) +static void init(grib_accessor* a, const long len, grib_arguments* args) { #if 0 grib_accessor_apply_operators* self = (grib_accessor_apply_operators*)a; @@ -233,73 +236,76 @@ static void init(grib_accessor* a, const long len , grib_arguments* args ) static void dump(grib_accessor* a, grib_dumper* dumper) { - int type=get_native_type(a); + int type = get_native_type(a); switch (type) { - case GRIB_TYPE_LONG: - grib_dump_long(dumper,a,NULL); - break; - case GRIB_TYPE_DOUBLE: - grib_dump_double(dumper,a,NULL); - break; - case GRIB_TYPE_STRING: - grib_dump_string_array(dumper,a,NULL); - break; + case GRIB_TYPE_LONG: + grib_dump_long(dumper, a, NULL); + break; + case GRIB_TYPE_DOUBLE: + grib_dump_double(dumper, a, NULL); + break; + case GRIB_TYPE_STRING: + grib_dump_string_array(dumper, a, NULL); + break; } } -static int get_native_type(grib_accessor* a) +static int get_native_type(grib_accessor* a) { - int type=GRIB_TYPE_LONG; + int type = GRIB_TYPE_LONG; if (a->flags & GRIB_ACCESSOR_FLAG_STRING_TYPE) - type=GRIB_TYPE_STRING; + type = GRIB_TYPE_STRING; return type; } -size_t compute_size_AO(long* descriptors,size_t numberOfDescriptors) +size_t compute_size_AO(long* descriptors, size_t numberOfDescriptors) { - int i=0; - size_t sizeAO=numberOfDescriptors; - int extraElement=0; - int X,F,Y; - - for (i=0;i0) { - self->expandedAO[delayedReplicationIndex[i]]-=1000; + long i = 0; + for (i = 0; i < delayedReplicationCount; i++) { + if (delayedReplication[i] > 0) { + self->expandedAO[delayedReplicationIndex[i]] -= 1000; delayedReplication[i]--; } } @@ -308,272 +314,292 @@ static void computeDelayedReplication(grib_accessor_apply_operators* self, static int apply_operators(grib_accessor* a) { grib_accessor_apply_operators* self = (grib_accessor_apply_operators*)a; - grib_context* c=a->context; - grib_handle* h=grib_handle_of_accessor(a); - int useDefinedBitmap=0; - long* descriptors=0; - long* scale=0; - long* width=0; - long* reference=0; - char** abbreviations=0; - char** names=0; - char** types=0; - char** units=0; - int bitmapNumber=0; - double referenceValueFactor=1; - int X,F,Y; - long extraWidth=0,extraScale=0,localDescriptorWidth=0; - size_t size=0,sizeAO=0,iq=0,numberOfDescriptors; - size_t i=0,j=0,ielement=0; - int err=0; - char* missing="???"; - long associatedFieldWidth=0; - char* firstOrderStatisticsAbbreviation="firstOrderStatistics"; - char* differenceStatisticsAbbreviation="differenceStatistics"; - char* associatedFieldAbbreviation="associatedField"; - char* substitutedValueAbbreviation="substitutedValue"; - char* associatedFieldName="associated field"; - char* associatedFieldType="long"; - char* associatedFieldUnit="CODE TABLE 31021"; - long associatedFieldDescriptor=99999; - long delayedReplication[MAX_DELAYED_REPLICATION_COUNT]={0,}; - long delayedReplicationIndex[MAX_DELAYED_REPLICATION_COUNT]={0,}; - long delayedReplicationCount=0; - long iassociatedInfoNumber=0; - int id=0; - - if (!self->do_compute) return GRIB_SUCCESS; - self_clear(c,self); - - err=grib_get_size(grib_handle_of_accessor(a),self->expandedDescriptors,&size); - if (err) return err; - numberOfDescriptors=size; - - descriptors=(long*)grib_context_malloc_clear(c,sizeof(long)*size); - scale=(long*)grib_context_malloc_clear(c,sizeof(long)*size); - reference=(long*)grib_context_malloc_clear(c,sizeof(long)*size); - width=(long*)grib_context_malloc_clear(c,sizeof(long)*size); - - abbreviations=(char**)grib_context_malloc_clear(c,sizeof(char*)*size); - types=(char**)grib_context_malloc_clear(c,sizeof(char*)*size); - names=(char**)grib_context_malloc_clear(c,sizeof(char*)*size); - units=(char**)grib_context_malloc_clear(c,sizeof(char*)*size); - - err=grib_get_string_array(h,self->abbreviation,abbreviations,&size); - if (err) return err; - err=grib_get_string_array(h,self->type,types,&size); - if (err) return err; - err=grib_get_string_array(h,self->name,names,&size); - if (err) return err; - err=grib_get_string_array(h,self->unit,units,&size); - if (err) return err; - - err=grib_get_long_array(h,self->expandedDescriptors,descriptors,&size); - if (err) return err; - err=grib_get_long_array(h,self->expandedScale,scale,&size); - if (err) return err; - err=grib_get_long_array(h,self->expandedReference,reference,&size); - if (err) return err; - err=grib_get_long_array(h,self->expandedWidth,width,&size); - if (err) return err; - - sizeAO=compute_size_AO(descriptors,numberOfDescriptors); - self->expandedAO=(long*)grib_context_malloc_clear(c,sizeof(long)*sizeAO); - self->scaleAO=(long*)grib_context_malloc_clear(c,sizeof(long)*sizeAO); - self->referenceAO=(double*)grib_context_malloc_clear(c,sizeof(double)*sizeAO); - self->widthAO=(long*)grib_context_malloc_clear(c,sizeof(long)*sizeAO); - self->bitmapNumber=(long*)grib_context_malloc_clear(c,sizeof(long)*sizeAO); - self->associatedBitmapNumber=(long*)grib_context_malloc_clear(c,sizeof(long)*sizeAO); - self->associatedBitmapIndex=(long*)grib_context_malloc_clear(c,sizeof(long)*sizeAO); - self->associatedInfoNumber=(long*)grib_context_malloc_clear(c,sizeof(long)*sizeAO); - self->abbreviations=(char**)grib_context_malloc_clear(c,sizeof(char*)*sizeAO); - self->types=(char**)grib_context_malloc_clear(c,sizeof(char*)*sizeAO); - self->names=(char**)grib_context_malloc_clear(c,sizeof(char*)*sizeAO); - self->units=(char**)grib_context_malloc_clear(c,sizeof(char*)*sizeAO); - - j=0; - ielement=0; - iassociatedInfoNumber=0; - for (i=0;icontext; + grib_handle* h = grib_handle_of_accessor(a); + int useDefinedBitmap = 0; + long* descriptors = 0; + long* scale = 0; + long* width = 0; + long* reference = 0; + char** abbreviations = 0; + char** names = 0; + char** types = 0; + char** units = 0; + int bitmapNumber = 0; + double referenceValueFactor = 1; + int X, F, Y; + long extraWidth = 0, extraScale = 0, localDescriptorWidth = 0; + size_t size = 0, sizeAO = 0, iq = 0, numberOfDescriptors; + size_t i = 0, j = 0, ielement = 0; + int err = 0; + char* missing = "???"; + long associatedFieldWidth = 0; + char* firstOrderStatisticsAbbreviation = "firstOrderStatistics"; + char* differenceStatisticsAbbreviation = "differenceStatistics"; + char* associatedFieldAbbreviation = "associatedField"; + char* substitutedValueAbbreviation = "substitutedValue"; + char* associatedFieldName = "associated field"; + char* associatedFieldType = "long"; + char* associatedFieldUnit = "CODE TABLE 31021"; + long associatedFieldDescriptor = 99999; + long delayedReplication[MAX_DELAYED_REPLICATION_COUNT] = {0,}; + long delayedReplicationIndex[MAX_DELAYED_REPLICATION_COUNT] = {0,}; + long delayedReplicationCount = 0; + long iassociatedInfoNumber = 0; + int id = 0; + + if (!self->do_compute) + return GRIB_SUCCESS; + self_clear(c, self); + + err = grib_get_size(grib_handle_of_accessor(a), self->expandedDescriptors, &size); + if (err) + return err; + numberOfDescriptors = size; + + descriptors = (long*)grib_context_malloc_clear(c, sizeof(long) * size); + scale = (long*)grib_context_malloc_clear(c, sizeof(long) * size); + reference = (long*)grib_context_malloc_clear(c, sizeof(long) * size); + width = (long*)grib_context_malloc_clear(c, sizeof(long) * size); + + abbreviations = (char**)grib_context_malloc_clear(c, sizeof(char*) * size); + types = (char**)grib_context_malloc_clear(c, sizeof(char*) * size); + names = (char**)grib_context_malloc_clear(c, sizeof(char*) * size); + units = (char**)grib_context_malloc_clear(c, sizeof(char*) * size); + + err = grib_get_string_array(h, self->abbreviation, abbreviations, &size); + if (err) + return err; + err = grib_get_string_array(h, self->type, types, &size); + if (err) + return err; + err = grib_get_string_array(h, self->name, names, &size); + if (err) + return err; + err = grib_get_string_array(h, self->unit, units, &size); + if (err) + return err; + + err = grib_get_long_array(h, self->expandedDescriptors, descriptors, &size); + if (err) + return err; + err = grib_get_long_array(h, self->expandedScale, scale, &size); + if (err) + return err; + err = grib_get_long_array(h, self->expandedReference, reference, &size); + if (err) + return err; + err = grib_get_long_array(h, self->expandedWidth, width, &size); + if (err) + return err; + + sizeAO = compute_size_AO(descriptors, numberOfDescriptors); + self->expandedAO = (long*)grib_context_malloc_clear(c, sizeof(long) * sizeAO); + self->scaleAO = (long*)grib_context_malloc_clear(c, sizeof(long) * sizeAO); + self->referenceAO = (double*)grib_context_malloc_clear(c, sizeof(double) * sizeAO); + self->widthAO = (long*)grib_context_malloc_clear(c, sizeof(long) * sizeAO); + self->bitmapNumber = (long*)grib_context_malloc_clear(c, sizeof(long) * sizeAO); + self->associatedBitmapNumber = (long*)grib_context_malloc_clear(c, sizeof(long) * sizeAO); + self->associatedBitmapIndex = (long*)grib_context_malloc_clear(c, sizeof(long) * sizeAO); + self->associatedInfoNumber = (long*)grib_context_malloc_clear(c, sizeof(long) * sizeAO); + self->abbreviations = (char**)grib_context_malloc_clear(c, sizeof(char*) * sizeAO); + self->types = (char**)grib_context_malloc_clear(c, sizeof(char*) * sizeAO); + self->names = (char**)grib_context_malloc_clear(c, sizeof(char*) * sizeAO); + self->units = (char**)grib_context_malloc_clear(c, sizeof(char*) * sizeAO); + + j = 0; + ielement = 0; + iassociatedInfoNumber = 0; + for (i = 0; i < numberOfDescriptors; i++) { + F = descriptors[i] / 100000; + X = (descriptors[i] - F * 100000) / 1000; + Y = (descriptors[i] - F * 100000) % 1000; + + if (F == 2) { /*operators*/ switch (X) { - case 1: - extraWidth = Y ? Y-128 : 0; - computeDelayedReplication(self,delayedReplication,delayedReplicationIndex,delayedReplicationCount,i); - break; - case 2: - extraScale = Y ? Y-128 : 0; - computeDelayedReplication(self,delayedReplication,delayedReplicationIndex,delayedReplicationCount,i); - break; - case 4: - /* associated field*/ - associatedFieldWidth=Y; - computeDelayedReplication(self,delayedReplication,delayedReplicationIndex,delayedReplicationCount,i); - break; - case 6: - /*signify data width*/ - localDescriptorWidth=Y; - computeDelayedReplication(self,delayedReplication,delayedReplicationIndex,delayedReplicationCount,i); - break; - case 7: - if (Y) { - extraScale = Y; - referenceValueFactor=grib_power(Y,10); - extraWidth=((10*Y)+2)/3; - } else { - extraWidth=0; - extraScale=0; - referenceValueFactor=1; - } - computeDelayedReplication(self,delayedReplication,delayedReplicationIndex,delayedReplicationCount,i); - break; - case 22: - /*quality information follows*/ - iq=1; - set_bitmap_number(descriptors,&useDefinedBitmap,&i,&bitmapNumber); - iassociatedInfoNumber=bitmapNumber; - computeDelayedReplication(self,delayedReplication,delayedReplicationIndex,delayedReplicationCount,i); - break; - case 23: - /*substituted values*/ - switch (Y) { - case 0: - iq=1; - set_bitmap_number(descriptors,&useDefinedBitmap,&i,&bitmapNumber); - iassociatedInfoNumber=bitmapNumber; + case 1: + extraWidth = Y ? Y - 128 : 0; + computeDelayedReplication(self, delayedReplication, delayedReplicationIndex, delayedReplicationCount, i); + break; + case 2: + extraScale = Y ? Y - 128 : 0; + computeDelayedReplication(self, delayedReplication, delayedReplicationIndex, delayedReplicationCount, i); + break; + case 4: + /* associated field*/ + associatedFieldWidth = Y; + computeDelayedReplication(self, delayedReplication, delayedReplicationIndex, delayedReplicationCount, i); + break; + case 6: + /*signify data width*/ + localDescriptorWidth = Y; + computeDelayedReplication(self, delayedReplication, delayedReplicationIndex, delayedReplicationCount, i); + break; + case 7: + if (Y) { + extraScale = Y; + referenceValueFactor = grib_power(Y, 10); + extraWidth = ((10 * Y) + 2) / 3; + } + else { + extraWidth = 0; + extraScale = 0; + referenceValueFactor = 1; + } + computeDelayedReplication(self, delayedReplication, delayedReplicationIndex, delayedReplicationCount, i); break; - case 255: - self->expandedAO[j]=descriptors[i]; - self->associatedBitmapIndex[j]=iq; - self->associatedBitmapNumber[j]=bitmapNumber; - self->abbreviations[j]=grib_context_strdup(c,substitutedValueAbbreviation); - self->types[j]=grib_context_strdup(c,missing); - self->names[j]=grib_context_strdup(c,missing); - self->units[j]=grib_context_strdup(c,missing); - iq++; - j++; + case 22: + /*quality information follows*/ + iq = 1; + set_bitmap_number(descriptors, &useDefinedBitmap, &i, &bitmapNumber); + iassociatedInfoNumber = bitmapNumber; + computeDelayedReplication(self, delayedReplication, delayedReplicationIndex, delayedReplicationCount, i); + break; + case 23: + /*substituted values*/ + switch (Y) { + case 0: + iq = 1; + set_bitmap_number(descriptors, &useDefinedBitmap, &i, &bitmapNumber); + iassociatedInfoNumber = bitmapNumber; + break; + case 255: + self->expandedAO[j] = descriptors[i]; + self->associatedBitmapIndex[j] = iq; + self->associatedBitmapNumber[j] = bitmapNumber; + self->abbreviations[j] = grib_context_strdup(c, substitutedValueAbbreviation); + self->types[j] = grib_context_strdup(c, missing); + self->names[j] = grib_context_strdup(c, missing); + self->units[j] = grib_context_strdup(c, missing); + iq++; + j++; + break; + default: + grib_context_log(c, GRIB_LOG_FATAL, "operator %d not implemented", (int)descriptors[i]); + } break; - default : - grib_context_log(c,GRIB_LOG_FATAL,"operator %d not implemented", (int)descriptors[i]); - } - break; case 24: /*first order statistical operators values*/ switch (Y) { - case 0: - iq=1; - set_bitmap_number(descriptors,&useDefinedBitmap,&i,&bitmapNumber); - iassociatedInfoNumber=bitmapNumber; - break; - case 255: - self->expandedAO[j]=descriptors[i]; - self->associatedBitmapIndex[j]=iq; - self->associatedBitmapNumber[j]=bitmapNumber; - self->abbreviations[j]=grib_context_strdup(c,firstOrderStatisticsAbbreviation); - self->types[j]=grib_context_strdup(c,missing); - self->names[j]=grib_context_strdup(c,missing); - self->units[j]=grib_context_strdup(c,missing); - iq++; - j++; - break; - default : - grib_context_log(c,GRIB_LOG_FATAL,"operator %d not implemented", (int)descriptors[i]); + case 0: + iq = 1; + set_bitmap_number(descriptors, &useDefinedBitmap, &i, &bitmapNumber); + iassociatedInfoNumber = bitmapNumber; + break; + case 255: + self->expandedAO[j] = descriptors[i]; + self->associatedBitmapIndex[j] = iq; + self->associatedBitmapNumber[j] = bitmapNumber; + self->abbreviations[j] = grib_context_strdup(c, firstOrderStatisticsAbbreviation); + self->types[j] = grib_context_strdup(c, missing); + self->names[j] = grib_context_strdup(c, missing); + self->units[j] = grib_context_strdup(c, missing); + iq++; + j++; + break; + default: + grib_context_log(c, GRIB_LOG_FATAL, "operator %d not implemented", (int)descriptors[i]); } break; - case 25: - /*difference statistical operators values*/ - switch (Y) { + case 25: + /*difference statistical operators values*/ + switch (Y) { case 0: - iq=1; - set_bitmap_number(descriptors,&useDefinedBitmap,&i,&bitmapNumber); - iassociatedInfoNumber=bitmapNumber; + iq = 1; + set_bitmap_number(descriptors, &useDefinedBitmap, &i, &bitmapNumber); + iassociatedInfoNumber = bitmapNumber; break; case 255: - self->expandedAO[j]=descriptors[i]; - self->associatedBitmapIndex[j]=iq; - self->associatedBitmapNumber[j]=bitmapNumber; - self->abbreviations[j]=grib_context_strdup(c,differenceStatisticsAbbreviation); - self->types[j]=grib_context_strdup(c,missing); - self->names[j]=grib_context_strdup(c,missing); - self->units[j]=grib_context_strdup(c,missing); + self->expandedAO[j] = descriptors[i]; + self->associatedBitmapIndex[j] = iq; + self->associatedBitmapNumber[j] = bitmapNumber; + self->abbreviations[j] = grib_context_strdup(c, differenceStatisticsAbbreviation); + self->types[j] = grib_context_strdup(c, missing); + self->names[j] = grib_context_strdup(c, missing); + self->units[j] = grib_context_strdup(c, missing); iq++; j++; break; - default : - grib_context_log(c,GRIB_LOG_FATAL,"operator %d not implemented", (int)descriptors[i]); - } - break; default: - grib_context_log(c,GRIB_LOG_ERROR,"operator %d not implemented",(int)descriptors[i]); + grib_context_log(c, GRIB_LOG_FATAL, "operator %d not implemented", (int)descriptors[i]); + } + break; + default: + grib_context_log(c, GRIB_LOG_ERROR, "operator %d not implemented", (int)descriptors[i]); } - } else if ( F==1 ) { - self->expandedAO[j]=descriptors[i]; - self->abbreviations[j]=grib_context_strdup(c,missing); - self->types[j]=grib_context_strdup(c,missing); - self->names[j]=grib_context_strdup(c,missing); - self->units[j]=grib_context_strdup(c,missing); - delayedReplication[delayedReplicationCount]=X; - delayedReplicationIndex[delayedReplicationCount]=j; + } + else if (F == 1) { + self->expandedAO[j] = descriptors[i]; + self->abbreviations[j] = grib_context_strdup(c, missing); + self->types[j] = grib_context_strdup(c, missing); + self->names[j] = grib_context_strdup(c, missing); + self->units[j] = grib_context_strdup(c, missing); + delayedReplication[delayedReplicationCount] = X; + delayedReplicationIndex[delayedReplicationCount] = j; delayedReplicationCount++; - Assert(delayedReplicationCount<=MAX_DELAYED_REPLICATION_COUNT); + Assert(delayedReplicationCount <= MAX_DELAYED_REPLICATION_COUNT); j++; - } else { + } + else { if (localDescriptorWidth) { - if (scale[ielement]==GRIB_MISSING_LONG) scale[ielement] = 0 ; - if (reference[ielement]==GRIB_MISSING_LONG) reference[ielement]=0; - if (width[ielement]==GRIB_MISSING_LONG) width[ielement]=localDescriptorWidth; - localDescriptorWidth=0; + if (scale[ielement] == GRIB_MISSING_LONG) + scale[ielement] = 0; + if (reference[ielement] == GRIB_MISSING_LONG) + reference[ielement] = 0; + if (width[ielement] == GRIB_MISSING_LONG) + width[ielement] = localDescriptorWidth; + localDescriptorWidth = 0; } - if (associatedFieldWidth && X!=31) { - self->scaleAO[j]=0; - self->referenceAO[j]=0; - self->widthAO[j]=associatedFieldWidth; - self->abbreviations[j]=grib_context_strdup(c,associatedFieldAbbreviation); - self->names[j]=grib_context_strdup(c,associatedFieldName); - self->types[j]=grib_context_strdup(c,associatedFieldType); - self->units[j]=grib_context_strdup(c,associatedFieldUnit); - self->expandedAO[j]=associatedFieldDescriptor; - - for (id=0;idscaleAO[j] = 0; + self->referenceAO[j] = 0; + self->widthAO[j] = associatedFieldWidth; + self->abbreviations[j] = grib_context_strdup(c, associatedFieldAbbreviation); + self->names[j] = grib_context_strdup(c, associatedFieldName); + self->types[j] = grib_context_strdup(c, associatedFieldType); + self->units[j] = grib_context_strdup(c, associatedFieldUnit); + self->expandedAO[j] = associatedFieldDescriptor; + + for (id = 0; id < delayedReplicationCount; id++) + delayedReplication[id]--; j++; } - if (!strncmp(units[ielement],"CODE",4) || !strncmp(units[ielement],"FLAG",4)) { - self->scaleAO[j]=scale[ielement]; - self->associatedInfoNumber[j]=iassociatedInfoNumber; - self->referenceAO[j]=reference[ielement]; - self->widthAO[j]=width[ielement]; - } else { - self->scaleAO[j]=extraScale+scale[ielement]; - self->associatedInfoNumber[j]=iassociatedInfoNumber; - self->referenceAO[j]=reference[ielement]*referenceValueFactor; - self->widthAO[j]=width[ielement]+extraWidth; + if (!strncmp(units[ielement], "CODE", 4) || !strncmp(units[ielement], "FLAG", 4)) { + self->scaleAO[j] = scale[ielement]; + self->associatedInfoNumber[j] = iassociatedInfoNumber; + self->referenceAO[j] = reference[ielement]; + self->widthAO[j] = width[ielement]; } - self->abbreviations[j]=abbreviations[ielement]; - self->names[j]=names[ielement]; - self->types[j]=types[ielement]; - self->units[j]=units[ielement]; - self->expandedAO[j]=descriptors[i]; + else { + self->scaleAO[j] = extraScale + scale[ielement]; + self->associatedInfoNumber[j] = iassociatedInfoNumber; + self->referenceAO[j] = reference[ielement] * referenceValueFactor; + self->widthAO[j] = width[ielement] + extraWidth; + } + self->abbreviations[j] = abbreviations[ielement]; + self->names[j] = names[ielement]; + self->types[j] = types[ielement]; + self->units[j] = units[ielement]; + self->expandedAO[j] = descriptors[i]; /* quality information*/ - if (X==33) { - self->associatedBitmapIndex[j]=iq; - self->associatedBitmapNumber[j]=bitmapNumber; + if (X == 33) { + self->associatedBitmapIndex[j] = iq; + self->associatedBitmapNumber[j] = bitmapNumber; iq++; } /* bitmap */ - if (X==31 && Y==31) { self->bitmapNumber[j]=bitmapNumber; } + if (X == 31 && Y == 31) { + self->bitmapNumber[j] = bitmapNumber; + } - for (id=0;idexpandedAOSize=j; + self->expandedAOSize = j; /* { int mycount=1; @@ -586,238 +612,253 @@ static int apply_operators(grib_accessor* a) printf("\n"); } */ - grib_context_free(c,abbreviations); - grib_context_free(c,names); - grib_context_free(c,types); - grib_context_free(c,units); - grib_context_free(c,descriptors); - grib_context_free(c,scale); - grib_context_free(c,reference); - grib_context_free(c,width); - self->do_compute=0; + grib_context_free(c, abbreviations); + grib_context_free(c, names); + grib_context_free(c, types); + grib_context_free(c, units); + grib_context_free(c, descriptors); + grib_context_free(c, scale); + grib_context_free(c, reference); + grib_context_free(c, width); + self->do_compute = 0; return err; } -static void long_to_string(grib_context* c,long* v,size_t len,char** val) +static void long_to_string(grib_context* c, long* v, size_t len, char** val) { size_t i; - char tmp[1024]={0,}; - for (i=0;icontext; + int ret = 0; + int i = 0; + grib_context* c = a->context; - ret=apply_operators(a); - if (ret) return ret; + ret = apply_operators(a); + if (ret) + return ret; - if(*len < self->expandedAOSize) - { + if (*len < self->expandedAOSize) { grib_context_log(a->context, GRIB_LOG_ERROR, - " wrong size (%ld) for %s it contains %d values ",*len, a->name , self->expandedAOSize); + " wrong size (%ld) for %s it contains %d values ", *len, a->name, self->expandedAOSize); *len = 0; return GRIB_ARRAY_TOO_SMALL; } *len = self->expandedAOSize; switch (self->index) { - case 0: - long_to_string(a->context,self->expandedAO,self->expandedAOSize,val); - break; - case 1: - long_to_string(a->context,self->scaleAO,self->expandedAOSize,val); - break; - case 2: - double_to_string(a->context,self->referenceAO,self->expandedAOSize,val); - break; - case 3: - long_to_string(a->context,self->widthAO,self->expandedAOSize,val); - break; - case 4: - long_to_string(a->context,self->bitmapNumber,self->expandedAOSize,val); - break; - case 5: - long_to_string(a->context,self->associatedBitmapNumber,self->expandedAOSize,val); - break; - case 6: - long_to_string(a->context,self->associatedBitmapIndex,self->expandedAOSize,val); - break; - case 7: - for (i=0;iexpandedAOSize;i++) - val[i]=grib_context_strdup(c,self->abbreviations[i]); - break; - case 8: - for (i=0;iexpandedAOSize;i++) - val[i]=grib_context_strdup(c,self->types[i]); - break; - case 9: - for (i=0;iexpandedAOSize;i++) - val[i]=grib_context_strdup(c,self->names[i]); - break; - case 10: - for (i=0;iexpandedAOSize;i++) - val[i]=grib_context_strdup(c,self->units[i]); - break; - case 11: - long_to_string(a->context,self->associatedInfoNumber,self->expandedAOSize,val); - break; - default: - Assert(0); + case 0: + long_to_string(a->context, self->expandedAO, self->expandedAOSize, val); + break; + case 1: + long_to_string(a->context, self->scaleAO, self->expandedAOSize, val); + break; + case 2: + double_to_string(a->context, self->referenceAO, self->expandedAOSize, val); + break; + case 3: + long_to_string(a->context, self->widthAO, self->expandedAOSize, val); + break; + case 4: + long_to_string(a->context, self->bitmapNumber, self->expandedAOSize, val); + break; + case 5: + long_to_string(a->context, self->associatedBitmapNumber, self->expandedAOSize, val); + break; + case 6: + long_to_string(a->context, self->associatedBitmapIndex, self->expandedAOSize, val); + break; + case 7: + for (i = 0; i < self->expandedAOSize; i++) + val[i] = grib_context_strdup(c, self->abbreviations[i]); + break; + case 8: + for (i = 0; i < self->expandedAOSize; i++) + val[i] = grib_context_strdup(c, self->types[i]); + break; + case 9: + for (i = 0; i < self->expandedAOSize; i++) + val[i] = grib_context_strdup(c, self->names[i]); + break; + case 10: + for (i = 0; i < self->expandedAOSize; i++) + val[i] = grib_context_strdup(c, self->units[i]); + break; + case 11: + long_to_string(a->context, self->associatedInfoNumber, self->expandedAOSize, val); + break; + default: + Assert(0); } return GRIB_SUCCESS; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_apply_operators* self = (grib_accessor_apply_operators*)a; - int ret=0; + int ret = 0; size_t i; - ret=apply_operators(a); - if (ret) return ret; + ret = apply_operators(a); + if (ret) + return ret; - if(*len < self->expandedAOSize) - { + if (*len < self->expandedAOSize) { grib_context_log(a->context, GRIB_LOG_ERROR, - " wrong size (%ld) for %s it contains %d values ",*len, a->name , self->expandedAOSize); + " wrong size (%ld) for %s it contains %d values ", *len, a->name, self->expandedAOSize); *len = 0; return GRIB_ARRAY_TOO_SMALL; } *len = self->expandedAOSize; switch (self->index) { - case 0: - for (i=0;i<*len;i++) val[i]=self->expandedAO[i]; - break; - case 1: - for (i=0;i<*len;i++) val[i]=self->scaleAO[i]; - break; - case 2: - for (i=0;i<*len;i++) val[i]=self->referenceAO[i]; - break; - case 3: - for (i=0;i<*len;i++) val[i]=self->widthAO[i]; - break; - case 4: - for (i=0;i<*len;i++) val[i]=self->bitmapNumber[i]; - break; - case 5: - for (i=0;i<*len;i++) val[i]=self->associatedBitmapNumber[i]; - break; - case 6: - for (i=0;i<*len;i++) val[i]=self->associatedBitmapIndex[i]; - break; - case 11: - for (i=0;i<*len;i++) val[i]=self->associatedInfoNumber[i]; - break; - default: - Assert(0); + case 0: + for (i = 0; i < *len; i++) + val[i] = self->expandedAO[i]; + break; + case 1: + for (i = 0; i < *len; i++) + val[i] = self->scaleAO[i]; + break; + case 2: + for (i = 0; i < *len; i++) + val[i] = self->referenceAO[i]; + break; + case 3: + for (i = 0; i < *len; i++) + val[i] = self->widthAO[i]; + break; + case 4: + for (i = 0; i < *len; i++) + val[i] = self->bitmapNumber[i]; + break; + case 5: + for (i = 0; i < *len; i++) + val[i] = self->associatedBitmapNumber[i]; + break; + case 6: + for (i = 0; i < *len; i++) + val[i] = self->associatedBitmapIndex[i]; + break; + case 11: + for (i = 0; i < *len; i++) + val[i] = self->associatedInfoNumber[i]; + break; + default: + Assert(0); } return GRIB_SUCCESS; } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { grib_accessor_apply_operators* self = (grib_accessor_apply_operators*)a; - int ret=0; + int ret = 0; size_t i; - ret=apply_operators(a); - if (ret) return ret; + ret = apply_operators(a); + if (ret) + return ret; - if(*len < self->expandedAOSize) - { + if (*len < self->expandedAOSize) { grib_context_log(a->context, GRIB_LOG_ERROR, - " wrong size (%ld) for %s it contains %d values ",*len, a->name , self->expandedAOSize); + " wrong size (%ld) for %s it contains %d values ", *len, a->name, self->expandedAOSize); *len = 0; return GRIB_ARRAY_TOO_SMALL; } *len = self->expandedAOSize; switch (self->index) { - case 0: - for (i=0;i<*len;i++) val[i]=self->expandedAO[i]; - break; - case 1: - for (i=0;i<*len;i++) val[i]=self->scaleAO[i]; - break; - case 2: - for (i=0;i<*len;i++) val[i]=self->referenceAO[i]; - break; - case 3: - for (i=0;i<*len;i++) val[i]=self->widthAO[i]; - break; - case 4: - for (i=0;i<*len;i++) val[i]=self->bitmapNumber[i]; - break; - case 5: - for (i=0;i<*len;i++) val[i]=self->associatedBitmapNumber[i]; - break; - case 6: - for (i=0;i<*len;i++) val[i]=self->associatedBitmapIndex[i]; - break; - default: - Assert(0); + case 0: + for (i = 0; i < *len; i++) + val[i] = self->expandedAO[i]; + break; + case 1: + for (i = 0; i < *len; i++) + val[i] = self->scaleAO[i]; + break; + case 2: + for (i = 0; i < *len; i++) + val[i] = self->referenceAO[i]; + break; + case 3: + for (i = 0; i < *len; i++) + val[i] = self->widthAO[i]; + break; + case 4: + for (i = 0; i < *len; i++) + val[i] = self->bitmapNumber[i]; + break; + case 5: + for (i = 0; i < *len; i++) + val[i] = self->associatedBitmapNumber[i]; + break; + case 6: + for (i = 0; i < *len; i++) + val[i] = self->associatedBitmapIndex[i]; + break; + default: + Assert(0); } return GRIB_SUCCESS; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { grib_accessor_apply_operators* self = (grib_accessor_apply_operators*)a; - self->do_compute=1; + self->do_compute = 1; return GRIB_NOT_IMPLEMENTED; } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { grib_accessor_apply_operators* self = (grib_accessor_apply_operators*)a; - self->do_compute=1; + self->do_compute = 1; return GRIB_NOT_IMPLEMENTED; } -static int value_count(grib_accessor* a,long* rlen) +static int value_count(grib_accessor* a, long* rlen) { - int ret=0; + int ret = 0; grib_accessor_apply_operators* self = (grib_accessor_apply_operators*)a; - *rlen=0; + *rlen = 0; - ret=apply_operators(a); + ret = apply_operators(a); if (ret) { - grib_context_log(a->context,GRIB_LOG_ERROR, - "%s unable to compute size",a->name); + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s unable to compute size", a->name); return ret; } - *rlen=self->expandedAOSize; + *rlen = self->expandedAOSize; return ret; } -static void destroy(grib_context* c,grib_accessor* a) +static void destroy(grib_context* c, grib_accessor* a) { grib_accessor_apply_operators* self = (grib_accessor_apply_operators*)a; - self_clear(c,self); + self_clear(c, self); } diff --git a/src/grib_accessor_class_array.c b/src/grib_accessor_class_array.c index d275430ad..40cc06c56 100644 --- a/src/grib_accessor_class_array.c +++ b/src/grib_accessor_class_array.c @@ -36,60 +36,61 @@ or edit "accessor.class" and rerun ./make_class.pl */ static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_array { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in array */ - grib_action* *builder; - grib_block_of_accessors *block; +typedef struct grib_accessor_array +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in array */ + grib_action** builder; + grib_block_of_accessors* block; } grib_accessor_array; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_array = { - &grib_accessor_class_gen, /* super */ - "array", /* name */ - sizeof(grib_accessor_array), /* size */ + &grib_accessor_class_gen, /* super */ + "array", /* name */ + sizeof(grib_accessor_array), /* size */ 0, /* inited */ &init_class, /* init_class */ &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ + 0, /* post_init */ + 0, /* free mem */ &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -98,53 +99,51 @@ grib_accessor_class* grib_accessor_class_array = &_grib_accessor_class_array; static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len , grib_arguments* arg ) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { - grib_accessor_array* self = (grib_accessor_array*)a; - self->block = (grib_block_of_accessors*) grib_context_malloc_clear(a->context,sizeof(grib_block_of_accessors)); - a->length = 0; + grib_accessor_array* self = (grib_accessor_array*)a; + self->block = (grib_block_of_accessors*)grib_context_malloc_clear(a->context, sizeof(grib_block_of_accessors)); + a->length = 0; } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_accessor_array* self = (grib_accessor_array*)a; - grib_dump_section(dumper,a,self->block); + grib_accessor_array* self = (grib_accessor_array*)a; + grib_dump_section(dumper, a, self->block); } - - diff --git a/src/grib_accessor_class_ascii.c b/src/grib_accessor_class_ascii.c index 10207e0ed..f939c41fb 100644 --- a/src/grib_accessor_class_ascii.c +++ b/src/grib_accessor_class_ascii.c @@ -39,69 +39,70 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int pack_string(grib_accessor*, const char*, size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); +static int get_native_type(grib_accessor*); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int pack_string(grib_accessor*, const char*, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); static size_t string_length(grib_accessor*); -static int value_count(grib_accessor*,long*); +static int value_count(grib_accessor*, long*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); static int compare(grib_accessor*, grib_accessor*); -typedef struct grib_accessor_ascii { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in ascii */ +typedef struct grib_accessor_ascii +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in ascii */ } grib_accessor_ascii; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_ascii = { - &grib_accessor_class_gen, /* super */ - "ascii", /* name */ - sizeof(grib_accessor_ascii), /* size */ + &grib_accessor_class_gen, /* super */ + "ascii", /* name */ + sizeof(grib_accessor_ascii), /* size */ 0, /* inited */ &init_class, /* init_class */ &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ + 0, /* post_init */ + 0, /* free mem */ &dump, /* describes himself */ - 0, /* get length of section */ + 0, /* get length of section */ &string_length, /* get length of string */ &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ &unpack_double, /* grib_unpack procedures double */ &pack_string, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -110,40 +111,40 @@ grib_accessor_class* grib_accessor_class_ascii = &_grib_accessor_class_ascii; static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len , grib_arguments* arg ) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { a->length = len; - Assert(a->length>=0); + Assert(a->length >= 0); } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - *count=1; + *count = 1; return 0; } @@ -154,145 +155,148 @@ static size_t string_length(grib_accessor* a) static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_string(dumper,a,NULL); + grib_dump_string(dumper, a, NULL); } -static int get_native_type(grib_accessor* a) +static int get_native_type(grib_accessor* a) { return GRIB_TYPE_STRING; } -static int unpack_string(grib_accessor* a, char* val, size_t *len) +static int unpack_string(grib_accessor* a, char* val, size_t* len) { - int i = 0; + int i = 0; grib_handle* hand = grib_handle_of_accessor(a); - if(len[0] < (a->length+1)) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%d) for %s it contains %d values ", len[0], a->name , a->length+1 ); + if (len[0] < (a->length + 1)) { + grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%d) for %s it contains %d values ", len[0], a->name, a->length + 1); len[0] = 0; return GRIB_ARRAY_TOO_SMALL; } - for ( i = 0; i < a->length; i++) - val[i] = hand->buffer->data[a->offset+i]; + for (i = 0; i < a->length; i++) + val[i] = hand->buffer->data[a->offset + i]; val[i] = 0; len[0] = i; return GRIB_SUCCESS; } -static int pack_string(grib_accessor* a, const char* val, size_t *len) +static int pack_string(grib_accessor* a, const char* val, size_t* len) { - int i = 0; + int i = 0; grib_handle* hand = grib_handle_of_accessor(a); - if(len[0] > (a->length)+1) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "pack_string: Wrong size (%d) for %s it contains %d values ", len[0], a->name , a->length+1 ); + if (len[0] > (a->length) + 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "pack_string: Wrong size (%d) for %s it contains %d values ", len[0], a->name, a->length + 1); len[0] = 0; return GRIB_BUFFER_TOO_SMALL; } - for ( i = 0; i < a->length; i++) - { - if( i < len[0] ) - hand->buffer->data[a->offset+i] = val[i]; + for (i = 0; i < a->length; i++) { + if (i < len[0]) + hand->buffer->data[a->offset + i] = val[i]; else - hand->buffer->data[a->offset+i] = 0; + hand->buffer->data[a->offset + i] = 0; } return GRIB_SUCCESS; } -static int pack_long(grib_accessor* a, const long* v, size_t *len) +static int pack_long(grib_accessor* a, const long* v, size_t* len) { - grib_context_log(a->context,GRIB_LOG_ERROR, " Should not pack %s as long", a->name); + grib_context_log(a->context, GRIB_LOG_ERROR, " Should not pack %s as long", a->name); return GRIB_NOT_IMPLEMENTED; } -static int pack_double(grib_accessor* a, const double*v, size_t *len) +static int pack_double(grib_accessor* a, const double* v, size_t* len) { - grib_context_log(a->context,GRIB_LOG_ERROR, " Should not pack %s as double", a->name); + grib_context_log(a->context, GRIB_LOG_ERROR, " Should not pack %s as double", a->name); return GRIB_NOT_IMPLEMENTED; } -static int unpack_long (grib_accessor* a, long* v, size_t *len) +static int unpack_long(grib_accessor* a, long* v, size_t* len) { - char val[1024]={0,}; - size_t l = sizeof(val); - size_t i =0; - char *last = NULL; - int err=grib_unpack_string (a , val, &l); + char val[1024] = {0,}; + size_t l = sizeof(val); + size_t i = 0; + char* last = NULL; + int err = grib_unpack_string(a, val, &l); - if (err) return err; + if (err) + return err; - i=0; - while ( val[i]==' ' && val[i]!=0 && icontext,GRIB_LOG_DEBUG, " Casting string %s to long", a->name); + grib_context_log(a->context, GRIB_LOG_DEBUG, " Casting string %s to long", a->name); return GRIB_SUCCESS; } -static int unpack_double (grib_accessor* a, double*v, size_t *len) +static int unpack_double(grib_accessor* a, double* v, size_t* len) { char val[1024]; - size_t l = sizeof(val); - char *last = NULL; + size_t l = sizeof(val); + char* last = NULL; - grib_unpack_string (a , val, &l); + grib_unpack_string(a, val, &l); - *v = strtod(val,&last); + *v = strtod(val, &last); - if(*last == 0) - { - grib_context_log(a->context,GRIB_LOG_DEBUG, " Casting string %s to long", a->name); + if (*last == 0) { + grib_context_log(a->context, GRIB_LOG_DEBUG, " Casting string %s to long", a->name); return GRIB_SUCCESS; } - grib_context_log(a->context,GRIB_LOG_WARNING,"Cannot unpack %s as double. Hint: Try unpacking as string",a->name); + grib_context_log(a->context, GRIB_LOG_WARNING, "Cannot unpack %s as double. Hint: Try unpacking as string", a->name); return GRIB_NOT_IMPLEMENTED; } -static int compare(grib_accessor* a,grib_accessor* b) +static int compare(grib_accessor* a, grib_accessor* b) { - int retval=0; - char *aval=0; - char *bval=0; - int err=0; + int retval = 0; + char* aval = 0; + char* bval = 0; + int err = 0; size_t alen = 0; size_t blen = 0; - long count=0; + long count = 0; - err=grib_value_count(a,&count); - if (err) return err; - alen=count; + err = grib_value_count(a, &count); + if (err) + return err; + alen = count; - err=grib_value_count(b,&count); - if (err) return err; - blen=count; + err = grib_value_count(b, &count); + if (err) + return err; + blen = count; - if (alen != blen) return GRIB_COUNT_MISMATCH; + if (alen != blen) + return GRIB_COUNT_MISMATCH; - aval=(char*)grib_context_malloc(a->context,alen*sizeof(char)); - bval=(char*)grib_context_malloc(b->context,blen*sizeof(char)); + aval = (char*)grib_context_malloc(a->context, alen * sizeof(char)); + bval = (char*)grib_context_malloc(b->context, blen * sizeof(char)); - grib_unpack_string(a,aval,&alen); - grib_unpack_string(b,bval,&blen); + grib_unpack_string(a, aval, &alen); + grib_unpack_string(b, bval, &blen); retval = GRIB_SUCCESS; - if (strcmp(aval,bval)) retval = GRIB_STRING_VALUE_MISMATCH; + if (strcmp(aval, bval)) + retval = GRIB_STRING_VALUE_MISMATCH; - grib_context_free(a->context,aval); - grib_context_free(b->context,bval); + grib_context_free(a->context, aval); + grib_context_free(b->context, bval); return retval; } diff --git a/src/grib_accessor_class_assert.c b/src/grib_accessor_class_assert.c index 01395b96f..03c230bde 100644 --- a/src/grib_accessor_class_assert.c +++ b/src/grib_accessor_class_assert.c @@ -37,59 +37,60 @@ or edit "accessor.class" and rerun ./make_class.pl */ static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -static int notify_change(grib_accessor*,grib_accessor*); +static int notify_change(grib_accessor*, grib_accessor*); -typedef struct grib_accessor_assert { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in assert */ +typedef struct grib_accessor_assert +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in assert */ } grib_accessor_assert; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_assert = { - &grib_accessor_class_gen, /* super */ - "assert", /* name */ - sizeof(grib_accessor_assert), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - ¬ify_change, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "assert", /* name */ + sizeof(grib_accessor_assert), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + ¬ify_change, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -98,55 +99,54 @@ grib_accessor_class* grib_accessor_class_assert = &_grib_accessor_class_assert; static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len , grib_arguments* arg) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { - a->length = 0; - a->flags |= GRIB_ACCESSOR_FLAG_HIDDEN; - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->length = 0; + a->flags |= GRIB_ACCESSOR_FLAG_HIDDEN; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } static void dump(grib_accessor* a, grib_dumper* dumper) { - /* grib_dump_assert(dumper,a,NULL); */ + /* grib_dump_assert(dumper,a,NULL); */ } -static int notify_change(grib_accessor* a,grib_accessor* changed) +static int notify_change(grib_accessor* a, grib_accessor* changed) { - return grib_action_notify_change(a->creator,a,changed); + return grib_action_notify_change(a->creator, a, changed); } - diff --git a/src/grib_accessor_class_bit.c b/src/grib_accessor_class_bit.c index 31131b209..55d699cd0 100644 --- a/src/grib_accessor_class_bit.c +++ b/src/grib_accessor_class_bit.c @@ -34,64 +34,65 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_bit { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in bit */ - const char* owner; - int bit_index; +typedef struct grib_accessor_bit +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in bit */ + const char* owner; + int bit_index; } grib_accessor_bit; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_bit = { - &grib_accessor_class_long, /* super */ - "bit", /* name */ - sizeof(grib_accessor_bit), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "bit", /* name */ + sizeof(grib_accessor_bit), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -100,105 +101,103 @@ grib_accessor_class* grib_accessor_class_bit = &_grib_accessor_class_bit; static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len , grib_arguments* arg ) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { - grib_accessor_bit *ac = (grib_accessor_bit*) a; - a->length = 0; - ac->owner = grib_arguments_get_name(grib_handle_of_accessor(a),arg,0); - ac->bit_index = grib_arguments_get_long(grib_handle_of_accessor(a),arg,1); + grib_accessor_bit* ac = (grib_accessor_bit*)a; + a->length = 0; + ac->owner = grib_arguments_get_name(grib_handle_of_accessor(a), arg, 0); + ac->bit_index = grib_arguments_get_long(grib_handle_of_accessor(a), arg, 1); } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_long(dumper,a,NULL); + grib_dump_long(dumper, a, NULL); } -static int unpack_long (grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - grib_accessor_bit *ac = (grib_accessor_bit*) a; - int ret = 0; - - long data = 0; - - if(*len < 1) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_bit : unpack_long : Wrong size for %s it contains %d values ", a->name , 1 ); - *len = 0; - return GRIB_ARRAY_TOO_SMALL; - } - - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),ac->owner,&data)) != GRIB_SUCCESS){ - *len = 0; - return ret; - } - - if(data & (1<bit_index)) - *val = 1; - else - *val = 0; - - *len = 1; - return GRIB_SUCCESS; + grib_accessor_bit* ac = (grib_accessor_bit*)a; + int ret = 0; + + long data = 0; + + if (*len < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_bit : unpack_long : Wrong size for %s it contains %d values ", a->name, 1); + *len = 0; + return GRIB_ARRAY_TOO_SMALL; + } + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), ac->owner, &data)) != GRIB_SUCCESS) { + *len = 0; + return ret; + } + + if (data & (1 << ac->bit_index)) + *val = 1; + else + *val = 0; + + *len = 1; + return GRIB_SUCCESS; } -static int pack_long (grib_accessor* a, const long *val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { - grib_accessor_bit *ac = (grib_accessor_bit*) a; - grib_accessor* owner = NULL; - unsigned char *mdata = 0; - if(*len < 1) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_bit : pack_long : At least one value to pack for %s", a->name ); - *len = 0; - return GRIB_ARRAY_TOO_SMALL; - } - - owner = grib_find_accessor(grib_handle_of_accessor(a),ac->owner); - - if(!owner){ - grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_bit : Cannot get the owner %s for computing the bit value of %s ",ac->owner, a->name); - *len = 0; - return GRIB_NOT_FOUND; - } - - mdata = grib_handle_of_accessor(a)->buffer->data; - mdata += grib_byte_offset(owner); - - grib_set_bit( mdata,7-ac->bit_index , *val>0); - - *len = 1; - return GRIB_SUCCESS; + grib_accessor_bit* ac = (grib_accessor_bit*)a; + grib_accessor* owner = NULL; + unsigned char* mdata = 0; + if (*len < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_bit : pack_long : At least one value to pack for %s", a->name); + *len = 0; + return GRIB_ARRAY_TOO_SMALL; + } + + owner = grib_find_accessor(grib_handle_of_accessor(a), ac->owner); + + if (!owner) { + grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_bit : Cannot get the owner %s for computing the bit value of %s ", ac->owner, a->name); + *len = 0; + return GRIB_NOT_FOUND; + } + + mdata = grib_handle_of_accessor(a)->buffer->data; + mdata += grib_byte_offset(owner); + + grib_set_bit(mdata, 7 - ac->bit_index, *val > 0); + + *len = 1; + return GRIB_SUCCESS; } diff --git a/src/grib_accessor_class_bitmap.c b/src/grib_accessor_class_bitmap.c index 5a7c67634..8ece7686f 100644 --- a/src/grib_accessor_class_bitmap.c +++ b/src/grib_accessor_class_bitmap.c @@ -39,70 +39,71 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); static long next_offset(grib_accessor*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -static void update_size(grib_accessor*,size_t); -static int unpack_double_element(grib_accessor*,size_t i, double* val); - -typedef struct grib_accessor_bitmap { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in bytes */ -/* Members defined in bitmap */ - const char* tableReference; - const char* missing_value; - const char* offsetbsec; - const char* sLength; +static void update_size(grib_accessor*, size_t); +static int unpack_double_element(grib_accessor*, size_t i, double* val); + +typedef struct grib_accessor_bitmap +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in bytes */ + /* Members defined in bitmap */ + const char* tableReference; + const char* missing_value; + const char* offsetbsec; + const char* sLength; } grib_accessor_bitmap; extern grib_accessor_class* grib_accessor_class_bytes; static grib_accessor_class _grib_accessor_class_bitmap = { - &grib_accessor_class_bytes, /* super */ - "bitmap", /* name */ - sizeof(grib_accessor_bitmap), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - &next_offset, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - &update_size, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - &unpack_double_element, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_bytes, /* super */ + "bitmap", /* name */ + sizeof(grib_accessor_bitmap), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + &next_offset, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + &update_size, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + &unpack_double_element, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -111,31 +112,31 @@ grib_accessor_class* grib_accessor_class_bitmap = &_grib_accessor_class_bitmap; static void init_class(grib_accessor_class* c) { - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->pack_double = (*(c->super))->pack_double; - c->pack_string = (*(c->super))->pack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->pack_double = (*(c->super))->pack_double; + c->pack_string = (*(c->super))->pack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ @@ -143,16 +144,15 @@ static void init_class(grib_accessor_class* c) static void compute_size(grib_accessor* a) { - long slen = 0; - long off = 0; + long slen = 0; + long off = 0; grib_handle* hand = grib_handle_of_accessor(a); grib_accessor_bitmap* self = (grib_accessor_bitmap*)a; - grib_get_long_internal(hand, self->offsetbsec,&off); + grib_get_long_internal(hand, self->offsetbsec, &off); grib_get_long_internal(hand, self->sLength, &slen); - if(slen == 0) - { + if (slen == 0) { grib_accessor* seclen; size_t size; /* Assume reparsing */ @@ -160,7 +160,7 @@ static void compute_size(grib_accessor* a) if (hand->loader != 0) { seclen = grib_find_accessor(hand, self->sLength); Assert(seclen); - grib_get_block_length(seclen->parent,&size); + grib_get_block_length(seclen->parent, &size); slen = size; } } @@ -170,28 +170,27 @@ static void compute_size(grib_accessor* a) (long)off,(long)slen,(long)a->offset); #endif - a->length = off+(slen-a->offset); + a->length = off + (slen - a->offset); - if(a->length < 0) - { + if (a->length < 0) { /* Assume reparsing */ /*Assert(hand->loader != 0);*/ a->length = 0; } - Assert(a->length>=0); + Assert(a->length >= 0); } -static void init(grib_accessor* a, const long len , grib_arguments* arg ) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { grib_accessor_bitmap* self = (grib_accessor_bitmap*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int n = 0; + grib_handle* hand = grib_handle_of_accessor(a); + int n = 0; - self->tableReference = grib_arguments_get_name(hand,arg,n++); - self->missing_value = grib_arguments_get_name(hand,arg,n++); - self->offsetbsec = grib_arguments_get_name(hand,arg,n++); - self->sLength = grib_arguments_get_name(hand,arg,n++); + self->tableReference = grib_arguments_get_name(hand, arg, n++); + self->missing_value = grib_arguments_get_name(hand, arg, n++); + self->offsetbsec = grib_arguments_get_name(hand, arg, n++); + self->sLength = grib_arguments_get_name(hand, arg, n++); compute_size(a); } @@ -206,93 +205,90 @@ static void dump(grib_accessor* a, grib_dumper* dumper) long len = 0; char label[1024]; - grib_value_count(a,&len); + grib_value_count(a, &len); - sprintf(label,"Bitmap of %ld values",len); - grib_dump_bytes(dumper, a,label); + sprintf(label, "Bitmap of %ld values", len); + grib_dump_bytes(dumper, a, label); } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - long pos = a->offset*8; - long tlen=0; - long i=0; - int err=0; + long pos = a->offset * 8; + long tlen = 0; + long i = 0; + int err = 0; grib_handle* hand = grib_handle_of_accessor(a); - err = grib_value_count(a,&tlen); - if (err) return err; + err = grib_value_count(a, &tlen); + if (err) + return err; - if(*len < tlen) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name , tlen ); + if (*len < tlen) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, tlen); *len = 0; return GRIB_ARRAY_TOO_SMALL; } - for(i=0;ibuffer->data, &pos,1); + for (i = 0; i < tlen; i++) { + val[i] = (long)grib_decode_unsigned_long(hand->buffer->data, &pos, 1); } *len = tlen; return GRIB_SUCCESS; } -static int unpack_double (grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - long pos = a->offset*8; + long pos = a->offset * 8; long tlen; long i; - int err=0; + int err = 0; grib_handle* hand = grib_handle_of_accessor(a); - err = grib_value_count(a,&tlen); - if (err) return err; + err = grib_value_count(a, &tlen); + if (err) + return err; - if(*len < tlen) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name , tlen ); + if (*len < tlen) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, tlen); *len = 0; return GRIB_ARRAY_TOO_SMALL; } - for(i=0;ibuffer->data, &pos,1); + for (i = 0; i < tlen; i++) { + val[i] = (double)grib_decode_unsigned_long(hand->buffer->data, &pos, 1); } *len = tlen; return GRIB_SUCCESS; } -static int unpack_double_element (grib_accessor* a, size_t idx, double* val) +static int unpack_double_element(grib_accessor* a, size_t idx, double* val) { - long pos = a->offset*8; + long pos = a->offset * 8; - pos+=idx; - *val = (double)grib_decode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, &pos,1); + pos += idx; + *val = (double)grib_decode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, &pos, 1); return GRIB_SUCCESS; } -static void update_size(grib_accessor* a,size_t s) +static void update_size(grib_accessor* a, size_t s) { a->length = s; } -static int unpack_string(grib_accessor* a, char* val, size_t *len) +static int unpack_string(grib_accessor* a, char* val, size_t* len) { - int i = 0; + int i = 0; grib_handle* hand = grib_handle_of_accessor(a); - if(len[0] < (a->length)) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%d) for %s it contains %d values ", len[0], a->name , a->length ); + if (len[0] < (a->length)) { + grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%d) for %s it contains %d values ", len[0], a->name, a->length); len[0] = 0; return GRIB_ARRAY_TOO_SMALL; } - for ( i = 0; i < a->length; i++) - val[i] = hand->buffer->data[a->offset+i]; + for (i = 0; i < a->length; i++) + val[i] = hand->buffer->data[a->offset + i]; len[0] = a->length; diff --git a/src/grib_accessor_class_bits.c b/src/grib_accessor_class_bits.c index de71a4e19..4068d36e6 100644 --- a/src/grib_accessor_class_bits.c +++ b/src/grib_accessor_class_bits.c @@ -48,72 +48,73 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_bytes (grib_accessor*,unsigned char*, size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); +static int get_native_type(grib_accessor*); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_bytes(grib_accessor*, unsigned char*, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); static long byte_count(grib_accessor*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_bits { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in bits */ - const char* argument; - long start; - long len; - double referenceValue; - double referenceValuePresent; - double scale; +typedef struct grib_accessor_bits +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in bits */ + const char* argument; + long start; + long len; + double referenceValue; + double referenceValuePresent; + double scale; } grib_accessor_bits; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_bits = { - &grib_accessor_class_gen, /* super */ - "bits", /* name */ - sizeof(grib_accessor_bits), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - &byte_count, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - &unpack_bytes, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "bits", /* name */ + sizeof(grib_accessor_bits), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + &byte_count, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + &unpack_bytes, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -122,144 +123,152 @@ grib_accessor_class* grib_accessor_class_bits = &_grib_accessor_class_bits; static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_string = (*(c->super))->pack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_string = (*(c->super))->pack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_bits* self = (grib_accessor_bits*)a; - grib_handle* hand = grib_handle_of_accessor(a); - grib_expression* e=NULL; - int n = 0; - - self->argument = grib_arguments_get_name(hand,c,n++); - self->start = grib_arguments_get_long(hand,c,n++); - self->len = grib_arguments_get_long(hand,c,n++); - e=grib_arguments_get_expression(hand,c,n++); + grib_handle* hand = grib_handle_of_accessor(a); + grib_expression* e = NULL; + int n = 0; + + self->argument = grib_arguments_get_name(hand, c, n++); + self->start = grib_arguments_get_long(hand, c, n++); + self->len = grib_arguments_get_long(hand, c, n++); + e = grib_arguments_get_expression(hand, c, n++); if (e) { - grib_expression_evaluate_double(hand,e,&(self->referenceValue)); - self->referenceValuePresent=1; - } else { - self->referenceValuePresent=0; + grib_expression_evaluate_double(hand, e, &(self->referenceValue)); + self->referenceValuePresent = 1; + } + else { + self->referenceValuePresent = 0; } self->scale = 1; if (self->referenceValuePresent) { - self->scale=grib_arguments_get_double(hand,c,n++); + self->scale = grib_arguments_get_double(hand, c, n++); } - Assert(self->len <= sizeof(long)*8); + Assert(self->len <= sizeof(long) * 8); - a->length=0; + a->length = 0; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_bits* self = (grib_accessor_bits*)a; - grib_accessor* x=NULL; - unsigned char* p=NULL; - grib_handle* h=grib_handle_of_accessor(a); - long start,length; - int ret=0; + grib_accessor* x = NULL; + unsigned char* p = NULL; + grib_handle* h = grib_handle_of_accessor(a); + long start, length; + int ret = 0; - if(*len < 1) return GRIB_WRONG_ARRAY_SIZE; + if (*len < 1) + return GRIB_WRONG_ARRAY_SIZE; - start=self->start; - length=self->len; + start = self->start; + length = self->len; - x=grib_find_accessor(grib_handle_of_accessor(a),self->argument); - if (!x) return GRIB_NOT_FOUND; + x = grib_find_accessor(grib_handle_of_accessor(a), self->argument); + if (!x) + return GRIB_NOT_FOUND; - p = h->buffer->data + grib_byte_offset(x); - *val=grib_decode_unsigned_long(p,&start,length); + p = h->buffer->data + grib_byte_offset(x); + *val = grib_decode_unsigned_long(p, &start, length); - *len=1; + *len = 1; return ret; } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { grib_accessor_bits* self = (grib_accessor_bits*)a; - grib_accessor* x=NULL; - unsigned char* p=NULL; - grib_handle* h=grib_handle_of_accessor(a); - long start,length; - int ret=0; + grib_accessor* x = NULL; + unsigned char* p = NULL; + grib_handle* h = grib_handle_of_accessor(a); + long start, length; + int ret = 0; - if(*len < 1) return GRIB_WRONG_ARRAY_SIZE; + if (*len < 1) + return GRIB_WRONG_ARRAY_SIZE; - start=self->start; - length=self->len; + start = self->start; + length = self->len; - x=grib_find_accessor(grib_handle_of_accessor(a),self->argument); - if (!x) return GRIB_NOT_FOUND; + x = grib_find_accessor(grib_handle_of_accessor(a), self->argument); + if (!x) + return GRIB_NOT_FOUND; - p = h->buffer->data + grib_byte_offset(x); - *val=grib_decode_unsigned_long(p,&start,length); + p = h->buffer->data + grib_byte_offset(x); + *val = grib_decode_unsigned_long(p, &start, length); - *val=((long)*val+self->referenceValue)/self->scale; + *val = ((long)*val + self->referenceValue) / self->scale; - *len=1; + *len = 1; return ret; } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { grib_accessor_bits* self = (grib_accessor_bits*)a; - grib_accessor* x=NULL; - grib_handle* h=grib_handle_of_accessor(a); - unsigned char* p=NULL; - long start,length,lval; + grib_accessor* x = NULL; + grib_handle* h = grib_handle_of_accessor(a); + unsigned char* p = NULL; + long start, length, lval; - if(*len != 1) return GRIB_WRONG_ARRAY_SIZE; + if (*len != 1) + return GRIB_WRONG_ARRAY_SIZE; start = self->start; length = self->len; - x=grib_find_accessor(grib_handle_of_accessor(a),self->argument); - if (!x) return GRIB_NOT_FOUND; + x = grib_find_accessor(grib_handle_of_accessor(a), self->argument); + if (!x) + return GRIB_NOT_FOUND; - p=h->buffer->data + grib_byte_offset(x); + p = h->buffer->data + grib_byte_offset(x); - lval= round(*val * self->scale) - self->referenceValue; - return grib_encode_unsigned_longb(p,lval,&start,length); + lval = round(*val * self->scale) - self->referenceValue; + return grib_encode_unsigned_longb(p, lval, &start, length); } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { grib_accessor_bits* self = (grib_accessor_bits*)a; - grib_accessor* x=NULL; - grib_handle* h=grib_handle_of_accessor(a); - unsigned char* p=NULL; - long start,length, maxval; + grib_accessor* x = NULL; + grib_handle* h = grib_handle_of_accessor(a); + unsigned char* p = NULL; + long start, length, maxval; - if(*len != 1) return GRIB_WRONG_ARRAY_SIZE; + if (*len != 1) + return GRIB_WRONG_ARRAY_SIZE; if (get_native_type(a) == GRIB_TYPE_DOUBLE) { /* ECC-402 */ @@ -270,78 +279,79 @@ static int pack_long(grib_accessor* a, const long* val, size_t *len) start = self->start; length = self->len; - x=grib_find_accessor(grib_handle_of_accessor(a),self->argument); - if (!x) return GRIB_NOT_FOUND; + x = grib_find_accessor(grib_handle_of_accessor(a), self->argument); + if (!x) + return GRIB_NOT_FOUND; /* Check the input value */ if (*val < 0) { - grib_context_log(h->context, GRIB_LOG_ERROR, "key=%s: value cannot be negative",a->name); + grib_context_log(h->context, GRIB_LOG_ERROR, "key=%s: value cannot be negative", a->name); return GRIB_ENCODING_ERROR; } maxval = (1 << length) - 1; - if (*val > maxval){ + if (*val > maxval) { grib_context_log(h->context, GRIB_LOG_ERROR, - "key=%s: Trying to encode value of %ld but the maximum allowable value is %ld (number of bits=%ld)", - a->name, *val, maxval, length); + "key=%s: Trying to encode value of %ld but the maximum allowable value is %ld (number of bits=%ld)", + a->name, *val, maxval, length); return GRIB_ENCODING_ERROR; } - p=h->buffer->data + grib_byte_offset(x); - return grib_encode_unsigned_longb(p,*val,&start,length); + p = h->buffer->data + grib_byte_offset(x); + return grib_encode_unsigned_longb(p, *val, &start, length); } static int get_native_type(grib_accessor* a) { - int type=GRIB_TYPE_BYTES; + int type = GRIB_TYPE_BYTES; grib_accessor_bits* self = (grib_accessor_bits*)a; if (a->flags & GRIB_ACCESSOR_FLAG_STRING_TYPE) - type=GRIB_TYPE_STRING; + type = GRIB_TYPE_STRING; if (a->flags & GRIB_ACCESSOR_FLAG_LONG_TYPE) - type=GRIB_TYPE_LONG; + type = GRIB_TYPE_LONG; if (self->referenceValuePresent) - type=GRIB_TYPE_DOUBLE; + type = GRIB_TYPE_DOUBLE; return type; } -static int unpack_string(grib_accessor*a , char* v, size_t *len) +static int unpack_string(grib_accessor* a, char* v, size_t* len) { - int ret=0; - double dval=0; - long lval=0; - size_t llen=1; + int ret = 0; + double dval = 0; + long lval = 0; + size_t llen = 1; grib_accessor_class* super = NULL; switch (get_native_type(a)) { - case GRIB_TYPE_LONG: - ret=unpack_long(a,&lval,&llen); - sprintf(v,"%ld",lval); - *len=strlen(v); - break; - - case GRIB_TYPE_DOUBLE: - ret=unpack_double(a,&dval,&llen); - sprintf(v,"%g",dval); - *len=strlen(v); - break; - - default: - super = *(a->cclass->super); - ret = super->unpack_string(a,v,len); + case GRIB_TYPE_LONG: + ret = unpack_long(a, &lval, &llen); + sprintf(v, "%ld", lval); + *len = strlen(v); + break; + + case GRIB_TYPE_DOUBLE: + ret = unpack_double(a, &dval, &llen); + sprintf(v, "%g", dval); + *len = strlen(v); + break; + + default: + super = *(a->cclass->super); + ret = super->unpack_string(a, v, len); } return ret; } static long byte_count(grib_accessor* a) { - grib_context_log(a->context,GRIB_LOG_DEBUG,"byte_count of %s = %ld",a->name,a->length); + grib_context_log(a->context, GRIB_LOG_DEBUG, "byte_count of %s = %ld", a->name, a->length); return a->length; } -static int unpack_bytes (grib_accessor* a,unsigned char* buffer, size_t *len) +static int unpack_bytes(grib_accessor* a, unsigned char* buffer, size_t* len) { if (*len < a->length) { *len = a->length; diff --git a/src/grib_accessor_class_bits_per_value.c b/src/grib_accessor_class_bits_per_value.c index 3225340df..9d5566c0d 100644 --- a/src/grib_accessor_class_bits_per_value.c +++ b/src/grib_accessor_class_bits_per_value.c @@ -36,63 +36,64 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_bits_per_value { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in bits_per_value */ - const char* values; - const char* bits_per_value; +typedef struct grib_accessor_bits_per_value +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in bits_per_value */ + const char* values; + const char* bits_per_value; } grib_accessor_bits_per_value; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_bits_per_value = { - &grib_accessor_class_long, /* super */ - "bits_per_value", /* name */ - sizeof(grib_accessor_bits_per_value), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "bits_per_value", /* name */ + sizeof(grib_accessor_bits_per_value), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -101,94 +102,95 @@ grib_accessor_class* grib_accessor_class_bits_per_value = &_grib_accessor_class_ static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* args) +static void init(grib_accessor* a, const long l, grib_arguments* args) { - int n=0; - grib_accessor_bits_per_value* self= (grib_accessor_bits_per_value*)a; - self->values=grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->bits_per_value=grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); + int n = 0; + grib_accessor_bits_per_value* self = (grib_accessor_bits_per_value*)a; + self->values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->bits_per_value = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; - a->length=0; + a->length = 0; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - int ret=0; - grib_accessor_bits_per_value* self= (grib_accessor_bits_per_value*)a; - grib_handle* h=grib_handle_of_accessor(a); + int ret = 0; + grib_accessor_bits_per_value* self = (grib_accessor_bits_per_value*)a; + grib_handle* h = grib_handle_of_accessor(a); - if((ret = grib_get_long_internal(h,self->bits_per_value,val)) - != GRIB_SUCCESS) return ret; + if ((ret = grib_get_long_internal(h, self->bits_per_value, val)) != GRIB_SUCCESS) + return ret; - *len =1; + *len = 1; return ret; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { - double* values=NULL; - size_t size=0; - int ret=0; - grib_accessor_bits_per_value* self= (grib_accessor_bits_per_value*)a; - grib_context* c=a->context; - grib_handle* h=grib_handle_of_accessor(a); - - if ( (ret=grib_get_size(h,self->values,&size)) != GRIB_SUCCESS) return ret; + double* values = NULL; + size_t size = 0; + int ret = 0; + grib_accessor_bits_per_value* self = (grib_accessor_bits_per_value*)a; + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); + + if ((ret = grib_get_size(h, self->values, &size)) != GRIB_SUCCESS) + return ret; - values=(double*)grib_context_malloc(c,size*sizeof(double)); - if (!values) return GRIB_OUT_OF_MEMORY; + values = (double*)grib_context_malloc(c, size * sizeof(double)); + if (!values) + return GRIB_OUT_OF_MEMORY; - if((ret = grib_get_double_array_internal(h,self->values,values,&size)) - != GRIB_SUCCESS) { - grib_context_free(c,values); + if ((ret = grib_get_double_array_internal(h, self->values, values, &size)) != GRIB_SUCCESS) { + grib_context_free(c, values); return ret; } - if ((ret = grib_set_long_internal(h, self->bits_per_value,*val)) != GRIB_SUCCESS) { - grib_context_free(c,values); + if ((ret = grib_set_long_internal(h, self->bits_per_value, *val)) != GRIB_SUCCESS) { + grib_context_free(c, values); return ret; } - if ((ret = grib_set_double_array_internal(h, self->values,values,size)) != GRIB_SUCCESS) { - grib_context_free(c,values); + if ((ret = grib_set_double_array_internal(h, self->values, values, size)) != GRIB_SUCCESS) { + grib_context_free(c, values); return ret; } - grib_context_free(c,values); + grib_context_free(c, values); return GRIB_SUCCESS; } diff --git a/src/grib_accessor_class_blob.c b/src/grib_accessor_class_blob.c index 0e405a846..25d4fbdba 100644 --- a/src/grib_accessor_class_blob.c +++ b/src/grib_accessor_class_blob.c @@ -31,61 +31,62 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int unpack_bytes (grib_accessor*,unsigned char*, size_t *len); +static int get_native_type(grib_accessor*); +static int unpack_bytes(grib_accessor*, unsigned char*, size_t* len); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_blob { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in blob */ +typedef struct grib_accessor_blob +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in blob */ } grib_accessor_blob; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_blob = { - &grib_accessor_class_gen, /* super */ - "blob", /* name */ - sizeof(grib_accessor_blob), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - &unpack_bytes, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "blob", /* name */ + sizeof(grib_accessor_blob), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + &unpack_bytes, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -94,51 +95,51 @@ grib_accessor_class* grib_accessor_class_blob = &_grib_accessor_class_blob; static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len , grib_arguments* arg ) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { grib_get_long_internal(grib_handle_of_accessor(a), grib_arguments_get_name(a->parent->h, arg, 0), &a->length); - Assert(a->length>=0); + Assert(a->length >= 0); } -static int get_native_type(grib_accessor* a) +static int get_native_type(grib_accessor* a) { return GRIB_TYPE_BYTES; } -static int unpack_bytes (grib_accessor* a,unsigned char* buffer, size_t *len) +static int unpack_bytes(grib_accessor* a, unsigned char* buffer, size_t* len) { if (*len < a->length) { *len = a->length; @@ -153,5 +154,5 @@ static int unpack_bytes (grib_accessor* a,unsigned char* buffer, size_t *len) static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_bytes(dumper,a,NULL); + grib_dump_bytes(dumper, a, NULL); } diff --git a/src/grib_accessor_class_box.c b/src/grib_accessor_class_box.c index 7ed4bc27f..14377c5ec 100644 --- a/src/grib_accessor_class_box.c +++ b/src/grib_accessor_class_box.c @@ -33,59 +33,60 @@ or edit "accessor.class" and rerun ./make_class.pl */ static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_box { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in box */ - grib_arguments* args; +typedef struct grib_accessor_box +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in box */ + grib_arguments* args; } grib_accessor_box; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_box = { - &grib_accessor_class_gen, /* super */ - "box", /* name */ - sizeof(grib_accessor_box), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "box", /* name */ + sizeof(grib_accessor_box), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -94,67 +95,69 @@ grib_accessor_class* grib_accessor_class_box = &_grib_accessor_class_box; static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* args) +static void init(grib_accessor* a, const long l, grib_arguments* args) { grib_accessor_box* self = (grib_accessor_box*)a; - self->args = args; + self->args = args; } -static void dump(grib_accessor* a,grib_dumper* dumper) +static void dump(grib_accessor* a, grib_dumper* dumper) { /* TODO: pass args */ - grib_dump_label(dumper,a,NULL); + grib_dump_label(dumper, a, NULL); } -grib_box* grib_box_new(grib_handle* h,int* error) +grib_box* grib_box_new(grib_handle* h, int* error) { - grib_accessor* a = NULL; - grib_accessor_box* na =NULL; - grib_box* n =NULL; - *error=GRIB_NOT_IMPLEMENTED; - a = grib_find_accessor(h,"BOX"); - na = (grib_accessor_box*)a; + grib_accessor* a = NULL; + grib_accessor_box* na = NULL; + grib_box* n = NULL; + *error = GRIB_NOT_IMPLEMENTED; + a = grib_find_accessor(h, "BOX"); + na = (grib_accessor_box*)a; - if (!a) return NULL; + if (!a) + return NULL; - n = grib_box_factory(h,na->args); + n = grib_box_factory(h, na->args); - if (n) *error=GRIB_SUCCESS; + if (n) + *error = GRIB_SUCCESS; return n; } diff --git a/src/grib_accessor_class_budgdate.c b/src/grib_accessor_class_budgdate.c index e69c15ffa..a51b2f3e6 100644 --- a/src/grib_accessor_class_budgdate.c +++ b/src/grib_accessor_class_budgdate.c @@ -35,64 +35,65 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_budgdate { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in budgdate */ - const char* year; - const char* month; - const char* day; +typedef struct grib_accessor_budgdate +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in budgdate */ + const char* year; + const char* month; + const char* day; } grib_accessor_budgdate; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_budgdate = { - &grib_accessor_class_long, /* super */ - "budgdate", /* name */ - sizeof(grib_accessor_budgdate), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "budgdate", /* name */ + sizeof(grib_accessor_budgdate), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -101,67 +102,67 @@ grib_accessor_class* grib_accessor_class_budgdate = &_grib_accessor_class_budgda static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_budgdate* self = (grib_accessor_budgdate*)a; - int n = 0; + int n = 0; - self->year = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->month = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->day = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); + self->year = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->month = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->day = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - int ret=0; + int ret = 0; grib_accessor_budgdate* self = (grib_accessor_budgdate*)a; - long year = 0; + long year = 0; long month = 0; - long day = 0; + long day = 0; - if ((ret=grib_get_long_internal(grib_handle_of_accessor(a), self->day,&day))!=GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->day, &day)) != GRIB_SUCCESS) return ret; - if ((ret=grib_get_long_internal(grib_handle_of_accessor(a), self->month,&month))!=GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->month, &month)) != GRIB_SUCCESS) return ret; - if ((ret=grib_get_long_internal(grib_handle_of_accessor(a), self->year,&year))!=GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->year, &year)) != GRIB_SUCCESS) return ret; - if(*len < 1) + if (*len < 1) return GRIB_WRONG_ARRAY_SIZE; val[0] = (1900 + year) * 10000 + month * 100 + day; @@ -170,32 +171,34 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) } /* TODO: Check for a valid date */ -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { - int ret=0; - long v = val[0]; + int ret = 0; + long v = val[0]; grib_accessor_budgdate* self = (grib_accessor_budgdate*)a; - long year = 0; - long month = 0; - long day = 0; + long year = 0; + long month = 0; + long day = 0; - if(*len != 1) + if (*len != 1) return GRIB_WRONG_ARRAY_SIZE; - year = v / 10000; v %= 10000; - month = v / 100; v %= 100; - day = v; + year = v / 10000; + v %= 10000; + month = v / 100; + v %= 100; + day = v; year -= 1900; Assert(year < 255); - if ((ret=grib_set_long_internal(grib_handle_of_accessor(a),self->day,day))!=GRIB_SUCCESS) + if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->day, day)) != GRIB_SUCCESS) return ret; - if ((ret=grib_set_long_internal(grib_handle_of_accessor(a),self->month,month))!=GRIB_SUCCESS) + if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->month, month)) != GRIB_SUCCESS) return ret; - if ((ret=grib_set_long_internal(grib_handle_of_accessor(a),self->year,year))!=GRIB_SUCCESS) + if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->year, year)) != GRIB_SUCCESS) return ret; return ret; diff --git a/src/grib_accessor_class_bufr_clear_tables.c b/src/grib_accessor_class_bufr_clear_tables.c index 8faace2d7..a227f5c30 100644 --- a/src/grib_accessor_class_bufr_clear_tables.c +++ b/src/grib_accessor_class_bufr_clear_tables.c @@ -35,59 +35,60 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_long(grib_accessor*, const long* val,size_t *len); +static int get_native_type(grib_accessor*); +static int pack_long(grib_accessor*, const long* val, size_t* len); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_bufr_clear_tables { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in bufr_clear_tables */ +typedef struct grib_accessor_bufr_clear_tables +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in bufr_clear_tables */ } grib_accessor_bufr_clear_tables; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_bufr_clear_tables = { - &grib_accessor_class_gen, /* super */ - "bufr_clear_tables", /* name */ - sizeof(grib_accessor_bufr_clear_tables), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "bufr_clear_tables", /* name */ + sizeof(grib_accessor_bufr_clear_tables), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -96,48 +97,48 @@ grib_accessor_class* grib_accessor_class_bufr_clear_tables = &_grib_accessor_cla static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static int pack_long(grib_accessor* a, const long* val,size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { - grib_handle* h=grib_handle_of_accessor(a); - h->bufr_elements_table=NULL; + grib_handle* h = grib_handle_of_accessor(a); + h->bufr_elements_table = NULL; return GRIB_SUCCESS; } -static int get_native_type(grib_accessor* a) +static int get_native_type(grib_accessor* a) { return GRIB_TYPE_UNDEFINED; } diff --git a/src/grib_accessor_class_bufr_data.c b/src/grib_accessor_class_bufr_data.c index b6b5ef4b9..e4d302751 100644 --- a/src/grib_accessor_class_bufr_data.c +++ b/src/grib_accessor_class_bufr_data.c @@ -75,105 +75,106 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); +static int get_native_type(grib_accessor*); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); static long byte_count(grib_accessor*); static long byte_offset(grib_accessor*); static long next_offset(grib_accessor*); -static int value_count(grib_accessor*,long*); -static void destroy(grib_context*,grib_accessor*); +static int value_count(grib_accessor*, long*); +static void destroy(grib_context*, grib_accessor*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -static void update_size(grib_accessor*,size_t); +static void update_size(grib_accessor*, size_t); static int compare(grib_accessor*, grib_accessor*); -typedef struct grib_accessor_bufr_data { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in bufr_data */ - const char* offsetSection4Name; - const char* offsetBeforeDataName; - const char* offsetEndSection4Name; - const char* section4LengthName; - const char* numberOfDataSubsetsName; - const char* subsetNumberName; - const char* expandedDescriptorsName; - const char* abbreviationName; - const char* typeName; - const char* nameName; - const char* unitName; - const char* referenceName; - const char* scaleName; - const char* widthName; - const char* codeFlags; - const char* bitmapNumberName; - const char* associatedBitmapNumberName; - const char* associatedBitmapIndexName; - const char* associatedInfoNumberName; - long* expandedDescriptors; - char** abbreviation; - char** type; - char** names; - char** units; - long* reference; - double* factor; - long* width; - long* bitmapNumber; - long* associatedBitmapNumber; - long* associatedBitmapIndex; - long* associatedInfoNumber; - long numberOfElements; - long numberOfDataSubsets; - size_t numberOfDescriptors; - int do_compute; +typedef struct grib_accessor_bufr_data +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in bufr_data */ + const char* offsetSection4Name; + const char* offsetBeforeDataName; + const char* offsetEndSection4Name; + const char* section4LengthName; + const char* numberOfDataSubsetsName; + const char* subsetNumberName; + const char* expandedDescriptorsName; + const char* abbreviationName; + const char* typeName; + const char* nameName; + const char* unitName; + const char* referenceName; + const char* scaleName; + const char* widthName; + const char* codeFlags; + const char* bitmapNumberName; + const char* associatedBitmapNumberName; + const char* associatedBitmapIndexName; + const char* associatedInfoNumberName; + long* expandedDescriptors; + char** abbreviation; + char** type; + char** names; + char** units; + long* reference; + double* factor; + long* width; + long* bitmapNumber; + long* associatedBitmapNumber; + long* associatedBitmapIndex; + long* associatedInfoNumber; + long numberOfElements; + long numberOfDataSubsets; + size_t numberOfDescriptors; + int do_compute; } grib_accessor_bufr_data; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_bufr_data = { - &grib_accessor_class_gen, /* super */ - "bufr_data", /* name */ - sizeof(grib_accessor_bufr_data), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* free mem */ - &dump, /* describes himself */ - &next_offset, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - &byte_count, /* get number of bytes */ - &byte_offset, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - &update_size, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "bufr_data", /* name */ + sizeof(grib_accessor_bufr_data), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + &destroy, /* free mem */ + &dump, /* describes himself */ + &next_offset, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + &byte_count, /* get number of bytes */ + &byte_offset, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + &update_size, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + &compare, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -182,54 +183,56 @@ grib_accessor_class* grib_accessor_class_bufr_data = &_grib_accessor_class_bufr_ static void init_class(grib_accessor_class* c) { - c->string_length = (*(c->super))->string_length; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->string_length = (*(c->super))->string_length; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -typedef struct grib_accessor_constant { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in variable */ - double dval; - char* cval; - int type; -/* Members defined in constant */ +typedef struct grib_accessor_constant +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in variable */ + double dval; + char* cval; + int type; + /* Members defined in constant */ } grib_accessor_constant; -typedef struct grib_accessor_bufr_data_element { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in bufr_data_element */ - int type; - size_t numberOfValues; - double* dvalues; - long* lvalues; - grib_sarray* svalues; - int isConstant; +typedef struct grib_accessor_bufr_data_element +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in bufr_data_element */ + int type; + size_t numberOfValues; + double* dvalues; + long* lvalues; + grib_sarray* svalues; + int isConstant; } grib_accessor_bufr_data_element; -#define IS_QUALIFIER(a) (a==8 || a==1 || a==2) +#define IS_QUALIFIER(a) (a == 8 || a == 1 || a == 2) #define NUMBER_OF_QUALIFIERS_PER_CATEGORY 256 #define NUMBER_OF_QUALIFIERS_CATEGORIES 3 @@ -255,7 +258,7 @@ static long init_length(grib_accessor* a) #endif static int get_elements_and_decode(grib_accessor* a); -static void init(grib_accessor* a,const long v, grib_arguments* params) +static void init(grib_accessor* a, const long v, grib_arguments* params) { #if 0 grib_accessor_bufr_data *self =(grib_accessor_bufr_data*)a; @@ -302,68 +305,72 @@ static void init(grib_accessor* a,const long v, grib_arguments* params) #endif } -static void self_clear(grib_context* c,grib_accessor_bufr_data* self) +static void self_clear(grib_context* c, grib_accessor_bufr_data* self) { - int i=0; - for (i=0;inumberOfDescriptors;i++) { - grib_context_free(c,self->abbreviation[i]); - grib_context_free(c,self->type[i]); - grib_context_free(c,self->names[i]); - grib_context_free(c,self->units[i]); + int i = 0; + for (i = 0; i < self->numberOfDescriptors; i++) { + grib_context_free(c, self->abbreviation[i]); + grib_context_free(c, self->type[i]); + grib_context_free(c, self->names[i]); + grib_context_free(c, self->units[i]); } - grib_context_free(c,self->expandedDescriptors); - grib_context_free(c,self->abbreviation); - grib_context_free(c,self->type); - grib_context_free(c,self->names); - grib_context_free(c,self->units); - grib_context_free(c,self->reference); - grib_context_free(c,self->width); - grib_context_free(c,self->bitmapNumber); - grib_context_free(c,self->associatedBitmapNumber); - grib_context_free(c,self->associatedBitmapIndex); - grib_context_free(c,self->associatedInfoNumber); - grib_context_free(c,self->factor); + grib_context_free(c, self->expandedDescriptors); + grib_context_free(c, self->abbreviation); + grib_context_free(c, self->type); + grib_context_free(c, self->names); + grib_context_free(c, self->units); + grib_context_free(c, self->reference); + grib_context_free(c, self->width); + grib_context_free(c, self->bitmapNumber); + grib_context_free(c, self->associatedBitmapNumber); + grib_context_free(c, self->associatedBitmapIndex); + grib_context_free(c, self->associatedInfoNumber); + grib_context_free(c, self->factor); } -static int get_native_type(grib_accessor* a){ +static int get_native_type(grib_accessor* a) +{ return GRIB_TYPE_DOUBLE; } -static long byte_count(grib_accessor* a){ +static long byte_count(grib_accessor* a) +{ return a->length; - } -static long byte_offset(grib_accessor* a){ +static long byte_offset(grib_accessor* a) +{ return a->offset; } -static long next_offset(grib_accessor* a){ - return a->offset+a->length; +static long next_offset(grib_accessor* a) +{ + return a->offset + a->length; } -static void update_size(grib_accessor* a,size_t s) +static void update_size(grib_accessor* a, size_t s) { - grib_context_log(a->context,GRIB_LOG_DEBUG,"updating size of %s old %ld new %ld",a->name,a->length,s); + grib_context_log(a->context, GRIB_LOG_DEBUG, "updating size of %s old %ld new %ld", a->name, a->length, s); a->length = s; - Assert(a->length>=0); + Assert(a->length >= 0); } -static int compare(grib_accessor* a, grib_accessor* b) { +static int compare(grib_accessor* a, grib_accessor* b) +{ return GRIB_NOT_IMPLEMENTED; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { - grib_accessor_bufr_data *self =(grib_accessor_bufr_data*)a; - self->do_compute=1; + grib_accessor_bufr_data* self = (grib_accessor_bufr_data*)a; + self->do_compute = 1; return GRIB_NOT_IMPLEMENTED; } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { - grib_accessor_bufr_data *self =(grib_accessor_bufr_data*)a; - self->do_compute=1; + grib_accessor_bufr_data* self = (grib_accessor_bufr_data*)a; + self->do_compute = 1; return GRIB_NOT_IMPLEMENTED; } @@ -536,7 +543,7 @@ static GRIB_INLINE void reset_deeper_qualifiers(grib_accessor* significanceQuali #endif static int decode_elements(grib_accessor* a) { - int err=0; + int err = 0; Assert(!"The accessor bufr_data is not used"); #if 0 grib_accessor_bufr_data *self =(grib_accessor_bufr_data*)a; @@ -869,12 +876,12 @@ static void dump(grib_accessor* a, grib_dumper* dumper) { get_elements_and_decode(a); - grib_dump_section(dumper,a,a->sub_section->block); + grib_dump_section(dumper, a, a->sub_section->block); return; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { return GRIB_NOT_IMPLEMENTED; #if 0 @@ -892,7 +899,7 @@ static int value_count(grib_accessor* a,long* count) #endif } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { return GRIB_NOT_IMPLEMENTED; #if 0 @@ -908,18 +915,18 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len) static int get_elements_and_decode(grib_accessor* a) { - grib_accessor_bufr_data *self =(grib_accessor_bufr_data*)a; - int err=0; + grib_accessor_bufr_data* self = (grib_accessor_bufr_data*)a; + int err = 0; if (self->do_compute) { - err=decode_elements(a); - self->do_compute=0; + err = decode_elements(a); + self->do_compute = 0; } return err; } -static void destroy(grib_context* c,grib_accessor* a) +static void destroy(grib_context* c, grib_accessor* a) { - grib_accessor_bufr_data *self =(grib_accessor_bufr_data*)a; - self_clear(c,self); - grib_section_delete(c,a->sub_section); + grib_accessor_bufr_data* self = (grib_accessor_bufr_data*)a; + self_clear(c, self); + grib_section_delete(c, a->sub_section); } diff --git a/src/grib_accessor_class_bufr_data_array.c b/src/grib_accessor_class_bufr_data_array.c index 8f1eea64d..a1f00db49 100644 --- a/src/grib_accessor_class_bufr_data_array.c +++ b/src/grib_accessor_class_bufr_data_array.c @@ -85,115 +85,116 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); +static int get_native_type(grib_accessor*); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); static long byte_count(grib_accessor*); static long byte_offset(grib_accessor*); static long next_offset(grib_accessor*); -static int value_count(grib_accessor*,long*); -static void destroy(grib_context*,grib_accessor*); +static int value_count(grib_accessor*, long*); +static void destroy(grib_context*, grib_accessor*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); static int compare(grib_accessor*, grib_accessor*); -typedef struct grib_accessor_bufr_data_array { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in bufr_data_array */ - const char* bufrDataEncodedName; - const char* numberOfSubsetsName; - const char* expandedDescriptorsName; - const char* flagsName; - const char* unitsName; - const char* elementsDescriptorsIndexName; - const char* compressedDataName; - bufr_descriptors_array* expanded; - grib_accessor* expandedAccessor; - int* canBeMissing; - long numberOfSubsets; - long compressedData; - grib_vdarray* numericValues; - grib_vsarray* stringValues; - grib_viarray* elementsDescriptorsIndex; - int do_decode; - int bitmapStartElementsDescriptorsIndex; - int bitmapCurrentElementsDescriptorsIndex; - int bitmapSize; - int bitmapStart; - int bitmapCurrent; - grib_accessors_list* dataAccessors; - int unpackMode; - int bitsToEndData; - grib_section* dataKeys; - double* inputBitmap; - int nInputBitmap; - int iInputBitmap; - long* inputReplications; - int nInputReplications; - int iInputReplications; - long* inputExtendedReplications; - int nInputExtendedReplications; - int iInputExtendedReplications; - long* inputShortReplications; - int nInputShortReplications; - int iInputShortReplications; - grib_iarray* iss_list; - grib_trie_with_rank* dataAccessorsTrie; - grib_sarray* tempStrings; - int change_ref_value_operand; - size_t refValListSize; - long* refValList; - long refValIndex; - bufr_tableb_override* tableb_override; - int set_to_missing_if_out_of_range; +typedef struct grib_accessor_bufr_data_array +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in bufr_data_array */ + const char* bufrDataEncodedName; + const char* numberOfSubsetsName; + const char* expandedDescriptorsName; + const char* flagsName; + const char* unitsName; + const char* elementsDescriptorsIndexName; + const char* compressedDataName; + bufr_descriptors_array* expanded; + grib_accessor* expandedAccessor; + int* canBeMissing; + long numberOfSubsets; + long compressedData; + grib_vdarray* numericValues; + grib_vsarray* stringValues; + grib_viarray* elementsDescriptorsIndex; + int do_decode; + int bitmapStartElementsDescriptorsIndex; + int bitmapCurrentElementsDescriptorsIndex; + int bitmapSize; + int bitmapStart; + int bitmapCurrent; + grib_accessors_list* dataAccessors; + int unpackMode; + int bitsToEndData; + grib_section* dataKeys; + double* inputBitmap; + int nInputBitmap; + int iInputBitmap; + long* inputReplications; + int nInputReplications; + int iInputReplications; + long* inputExtendedReplications; + int nInputExtendedReplications; + int iInputExtendedReplications; + long* inputShortReplications; + int nInputShortReplications; + int iInputShortReplications; + grib_iarray* iss_list; + grib_trie_with_rank* dataAccessorsTrie; + grib_sarray* tempStrings; + int change_ref_value_operand; + size_t refValListSize; + long* refValList; + long refValIndex; + bufr_tableb_override* tableb_override; + int set_to_missing_if_out_of_range; } grib_accessor_bufr_data_array; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_bufr_data_array = { - &grib_accessor_class_gen, /* super */ - "bufr_data_array", /* name */ - sizeof(grib_accessor_bufr_data_array), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* free mem */ - &dump, /* describes himself */ - &next_offset, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - &byte_count, /* get number of bytes */ - &byte_offset, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "bufr_data_array", /* name */ + sizeof(grib_accessor_bufr_data_array), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + &destroy, /* free mem */ + &dump, /* describes himself */ + &next_offset, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + &byte_count, /* get number of bytes */ + &byte_offset, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + &compare, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -202,98 +203,105 @@ grib_accessor_class* grib_accessor_class_bufr_data_array = &_grib_accessor_class static void init_class(grib_accessor_class* c) { - c->string_length = (*(c->super))->string_length; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->string_length = (*(c->super))->string_length; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ #define MAX_NESTED_REPLICATIONS 8 -#define PROCESS_DECODE 0 -#define PROCESS_NEW_DATA 1 -#define PROCESS_ENCODE 2 +#define PROCESS_DECODE 0 +#define PROCESS_NEW_DATA 1 +#define PROCESS_ENCODE 2 #define OVERRIDDEN_REFERENCE_VALUES_KEY "inputOverriddenReferenceValues" /* Set the error code, if it is bad and we should fail (default case), return */ /* variable 'err' is assumed to be pointer to int */ /* If BUFRDC mode is enabled, then we tolerate problems like wrong data section length */ -#define CHECK_END_DATA_RETURN(ctx,b,size,retval) {*err=check_end_data(ctx,b,size); if (*err!=0 && ctx->bufrdc_mode==0) return retval; } +#define CHECK_END_DATA_RETURN(ctx, b, size, retval) \ + { \ + *err = check_end_data(ctx, b, size); \ + if (*err != 0 && ctx->bufrdc_mode == 0) \ + return retval; \ + } -static int process_elements(grib_accessor* a,int flag,long onlySubset,long startSubset,long endSubset); +static int process_elements(grib_accessor* a, int flag, long onlySubset, long startSubset, long endSubset); -typedef int (*codec_element_proc) (grib_context* c,grib_accessor_bufr_data_array* self,int subsetIndex, grib_buffer* b,unsigned char* data,long *pos,int i,bufr_descriptor* descriptor,long elementIndex,grib_darray* dval,grib_sarray* sval); -typedef int (*codec_replication_proc) (grib_context* c,grib_accessor_bufr_data_array* self,int subsetIndex,grib_buffer* buff,unsigned char* data,long *pos,int i,long elementIndex,grib_darray* dval,long* numberOfRepetitions); +typedef int (*codec_element_proc)(grib_context* c, grib_accessor_bufr_data_array* self, int subsetIndex, grib_buffer* b, unsigned char* data, long* pos, int i, bufr_descriptor* descriptor, long elementIndex, grib_darray* dval, grib_sarray* sval); +typedef int (*codec_replication_proc)(grib_context* c, grib_accessor_bufr_data_array* self, int subsetIndex, grib_buffer* buff, unsigned char* data, long* pos, int i, long elementIndex, grib_darray* dval, long* numberOfRepetitions); -static int create_keys(grib_accessor* a,long onlySubset,long startSubset,long endSubset); +static int create_keys(grib_accessor* a, long onlySubset, long startSubset, long endSubset); -static void restart_bitmap(grib_accessor_bufr_data_array *self) +static void restart_bitmap(grib_accessor_bufr_data_array* self) { - self->bitmapCurrent=-1; - self->bitmapCurrentElementsDescriptorsIndex=self->bitmapStartElementsDescriptorsIndex-1; + self->bitmapCurrent = -1; + self->bitmapCurrentElementsDescriptorsIndex = self->bitmapStartElementsDescriptorsIndex - 1; } -static void cancel_bitmap(grib_accessor_bufr_data_array *self) +static void cancel_bitmap(grib_accessor_bufr_data_array* self) { - self->bitmapCurrent=-1; - self->bitmapStart=-1; + self->bitmapCurrent = -1; + self->bitmapStart = -1; } -static int is_bitmap_start_defined(grib_accessor_bufr_data_array *self) +static int is_bitmap_start_defined(grib_accessor_bufr_data_array* self) { - return self->bitmapStart==-1 ? 0 : 1; + return self->bitmapStart == -1 ? 0 : 1; } static size_t get_length(grib_accessor* a) { - grib_accessor_bufr_data_array *self =(grib_accessor_bufr_data_array*)a; - size_t len=0; + grib_accessor_bufr_data_array* self = (grib_accessor_bufr_data_array*)a; + size_t len = 0; - grib_handle* h=grib_handle_of_accessor(a); + grib_handle* h = grib_handle_of_accessor(a); - grib_get_size(h,self->bufrDataEncodedName,&len); + grib_get_size(h, self->bufrDataEncodedName, &len); return len; } /* Operator 203YYY: Store the TableB code and changed reference value in linked list */ -static void tableB_override_store_ref_val(grib_context* c, grib_accessor_bufr_data_array *self, int code, long new_ref_val) +static void tableB_override_store_ref_val(grib_context* c, grib_accessor_bufr_data_array* self, int code, long new_ref_val) { - bufr_tableb_override* tb=(bufr_tableb_override*)grib_context_malloc_clear(c, sizeof(bufr_tableb_override)); - tb->code = code; - tb->new_ref_val = new_ref_val; + bufr_tableb_override* tb = (bufr_tableb_override*)grib_context_malloc_clear(c, sizeof(bufr_tableb_override)); + tb->code = code; + tb->new_ref_val = new_ref_val; if (!self->tableb_override) { self->tableb_override = tb; - } else { + } + else { /*Add to end of linked list*/ bufr_tableb_override* q = self->tableb_override; - while(q->next) q=q->next; + while (q->next) + q = q->next; q->next = tb; } } /* Operator 203YYY: Retrieve changed reference value from linked list */ -static int tableB_override_get_ref_val(grib_accessor_bufr_data_array *self, int code, long* out_ref_val) +static int tableB_override_get_ref_val(grib_accessor_bufr_data_array* self, int code, long* out_ref_val) { bufr_tableb_override* p = self->tableb_override; while (p) { @@ -306,24 +314,24 @@ static int tableB_override_get_ref_val(grib_accessor_bufr_data_array *self, int return GRIB_NOT_FOUND; } /* Operator 203YYY: Clear and free linked list */ -static void tableB_override_clear(grib_context* c, grib_accessor_bufr_data_array *self) +static void tableB_override_clear(grib_context* c, grib_accessor_bufr_data_array* self) { bufr_tableb_override* tb = self->tableb_override; - while(tb) { + while (tb) { bufr_tableb_override* n = tb->next; - grib_context_free(c,tb); + grib_context_free(c, tb); tb = n; } - self->tableb_override=NULL; + self->tableb_override = NULL; } /* Operator 203YYY: Copy contents of linked list to the transient array key */ -static int tableB_override_set_key(grib_handle* h, grib_accessor_bufr_data_array *self) +static int tableB_override_set_key(grib_handle* h, grib_accessor_bufr_data_array* self) { - int err = GRIB_SUCCESS; - size_t size = 0; - long* refVals = NULL; + int err = GRIB_SUCCESS; + size_t size = 0; + long* refVals = NULL; grib_iarray* refValArray = grib_iarray_new(h->context, 10, 10); - bufr_tableb_override* p = self->tableb_override; + bufr_tableb_override* p = self->tableb_override; while (p) { grib_iarray_push(refValArray, p->new_ref_val); p = p->next; @@ -331,23 +339,23 @@ static int tableB_override_set_key(grib_handle* h, grib_accessor_bufr_data_array size = grib_iarray_used_size(refValArray); if (size > 0) { refVals = grib_iarray_get_array(refValArray); - err=grib_set_long_array(h, OVERRIDDEN_REFERENCE_VALUES_KEY, refVals, size); + err = grib_set_long_array(h, OVERRIDDEN_REFERENCE_VALUES_KEY, refVals, size); grib_context_free(h->context, refVals); } grib_iarray_delete(refValArray); return err; } /* Check numBits is sufficient for entries in the overridden reference values list*/ -static int check_overridden_reference_values(const grib_context *c, long* refValList, size_t refValListSize, int numBits) +static int check_overridden_reference_values(const grib_context* c, long* refValList, size_t refValListSize, int numBits) { - const long maxval = (1 << (numBits-1))-1; - const long minval = -(1 << (numBits-1)); - size_t i=0; - for(i=0; i maxval) { grib_context_log(c, GRIB_LOG_ERROR, "Overridden reference value: entry %d (%ld) does not fit in %d bits (specified by operator 203)", - refValList[i], i, numBits); + refValList[i], i, numBits); return GRIB_OUT_OF_RANGE; } } @@ -369,41 +377,41 @@ static void tableB_override_dump(grib_accessor_bufr_data_array *self) #define DYN_ARRAY_SIZE_INIT 1000 /* Initial size for grib_iarray_new and grib_darray_new */ #define DYN_ARRAY_SIZE_INCR 1000 /* Increment size for grib_iarray_new and grib_darray_new */ -static void init(grib_accessor* a,const long v, grib_arguments* params) -{ - grib_accessor_bufr_data_array *self =(grib_accessor_bufr_data_array*)a; - int n = 0; - const char* dataKeysName=NULL; - grib_accessor* dataKeysAcc=NULL; - - self->bufrDataEncodedName = grib_arguments_get_name(grib_handle_of_accessor(a),params,n++); - self->numberOfSubsetsName = grib_arguments_get_name(grib_handle_of_accessor(a),params,n++); - self->expandedDescriptorsName = grib_arguments_get_name(grib_handle_of_accessor(a),params,n++); - self->flagsName = grib_arguments_get_name(grib_handle_of_accessor(a),params,n++); - self->elementsDescriptorsIndexName = grib_arguments_get_name(grib_handle_of_accessor(a),params,n++); - self->compressedDataName = grib_arguments_get_name(grib_handle_of_accessor(a),params,n++); - dataKeysName = grib_arguments_get_name(grib_handle_of_accessor(a),params,n++); - - dataKeysAcc=grib_find_accessor(grib_handle_of_accessor(a),dataKeysName); - self->dataKeys=dataKeysAcc->parent; - self->do_decode=1; - self->elementsDescriptorsIndex=0; - self->numericValues=0; - self->stringValues=0; +static void init(grib_accessor* a, const long v, grib_arguments* params) +{ + grib_accessor_bufr_data_array* self = (grib_accessor_bufr_data_array*)a; + int n = 0; + const char* dataKeysName = NULL; + grib_accessor* dataKeysAcc = NULL; + + self->bufrDataEncodedName = grib_arguments_get_name(grib_handle_of_accessor(a), params, n++); + self->numberOfSubsetsName = grib_arguments_get_name(grib_handle_of_accessor(a), params, n++); + self->expandedDescriptorsName = grib_arguments_get_name(grib_handle_of_accessor(a), params, n++); + self->flagsName = grib_arguments_get_name(grib_handle_of_accessor(a), params, n++); + self->elementsDescriptorsIndexName = grib_arguments_get_name(grib_handle_of_accessor(a), params, n++); + self->compressedDataName = grib_arguments_get_name(grib_handle_of_accessor(a), params, n++); + dataKeysName = grib_arguments_get_name(grib_handle_of_accessor(a), params, n++); + + dataKeysAcc = grib_find_accessor(grib_handle_of_accessor(a), dataKeysName); + self->dataKeys = dataKeysAcc->parent; + self->do_decode = 1; + self->elementsDescriptorsIndex = 0; + self->numericValues = 0; + self->stringValues = 0; cancel_bitmap(self); - self->expanded=0; - self->expandedAccessor=0; - self->dataAccessorsTrie=0; - self->change_ref_value_operand=0; /* Operator 203YYY: 0, 255 or YYY */ - self->refValListSize = 0; /* Operator 203YYY: size of overridden reference values array */ - self->refValList=NULL; /* Operator 203YYY: overridden reference values array */ - self->refValIndex=0; /* Operator 203YYY: index into overridden reference values array */ - self->tableb_override = NULL; /* Operator 203YYY: Table B lookup linked list */ - self->set_to_missing_if_out_of_range = 0; /* By default fail if out of range */ - - a->length=0; - self->bitsToEndData = get_length(a)*8; - self->unpackMode=CODES_BUFR_UNPACK_STRUCTURE; + self->expanded = 0; + self->expandedAccessor = 0; + self->dataAccessorsTrie = 0; + self->change_ref_value_operand = 0; /* Operator 203YYY: 0, 255 or YYY */ + self->refValListSize = 0; /* Operator 203YYY: size of overridden reference values array */ + self->refValList = NULL; /* Operator 203YYY: overridden reference values array */ + self->refValIndex = 0; /* Operator 203YYY: index into overridden reference values array */ + self->tableb_override = NULL; /* Operator 203YYY: Table B lookup linked list */ + self->set_to_missing_if_out_of_range = 0; /* By default fail if out of range */ + + a->length = 0; + self->bitsToEndData = get_length(a) * 8; + self->unpackMode = CODES_BUFR_UNPACK_STRUCTURE; /* Assert(a->length>=0); */ } @@ -420,38 +428,42 @@ static void clean_string(char* s,int len) } */ -static int check_end_data(grib_context* c,grib_accessor_bufr_data_array* self,int size) +static int check_end_data(grib_context* c, grib_accessor_bufr_data_array* self, int size) { - grib_context_log(c, GRIB_LOG_DEBUG,"BUFR data decoding: \tbitsToEndData=%d elementSize=%d", self->bitsToEndData,size); - self->bitsToEndData-=size; - if (self->bitsToEndData<0) + grib_context_log(c, GRIB_LOG_DEBUG, "BUFR data decoding: \tbitsToEndData=%d elementSize=%d", self->bitsToEndData, size); + self->bitsToEndData -= size; + if (self->bitsToEndData < 0) return GRIB_DECODING_ERROR; return 0; } -static void self_clear(grib_context* c,grib_accessor_bufr_data_array* self) +static void self_clear(grib_context* c, grib_accessor_bufr_data_array* self) { - grib_context_free(c,self->canBeMissing); - grib_vdarray_delete_content(c,self->numericValues); - grib_vdarray_delete(c,self->numericValues); - if(self->stringValues) { - grib_vsarray_delete_content(c,self->stringValues); - grib_vsarray_delete(c,self->stringValues); + grib_context_free(c, self->canBeMissing); + grib_vdarray_delete_content(c, self->numericValues); + grib_vdarray_delete(c, self->numericValues); + if (self->stringValues) { + grib_vsarray_delete_content(c, self->stringValues); + grib_vsarray_delete(c, self->stringValues); } - grib_viarray_delete_content(c,self->elementsDescriptorsIndex); - grib_viarray_delete(c,self->elementsDescriptorsIndex); - if (self->inputReplications) grib_context_free(c,self->inputReplications); - if (self->inputExtendedReplications) grib_context_free(c,self->inputExtendedReplications); - if (self->inputShortReplications) grib_context_free(c,self->inputShortReplications); + grib_viarray_delete_content(c, self->elementsDescriptorsIndex); + grib_viarray_delete(c, self->elementsDescriptorsIndex); + if (self->inputReplications) + grib_context_free(c, self->inputReplications); + if (self->inputExtendedReplications) + grib_context_free(c, self->inputExtendedReplications); + if (self->inputShortReplications) + grib_context_free(c, self->inputShortReplications); self->change_ref_value_operand = 0; - self->refValListSize = 0; - if (self->refValList) grib_context_free(c, self->refValList); - self->refValIndex=0; + self->refValListSize = 0; + if (self->refValList) + grib_context_free(c, self->refValList); + self->refValIndex = 0; tableB_override_clear(c, self); self->set_to_missing_if_out_of_range = 0; } -static int get_native_type(grib_accessor* a) +static int get_native_type(grib_accessor* a) { return GRIB_TYPE_DOUBLE; } @@ -476,243 +488,254 @@ static int compare(grib_accessor* a, grib_accessor* b) return GRIB_NOT_IMPLEMENTED; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { - grib_accessor_bufr_data_array *self =(grib_accessor_bufr_data_array*)a; - self->do_decode=1; + grib_accessor_bufr_data_array* self = (grib_accessor_bufr_data_array*)a; + self->do_decode = 1; return GRIB_NOT_IMPLEMENTED; } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { - grib_accessor_bufr_data_array *self =(grib_accessor_bufr_data_array*)a; - self->do_decode=1; - return process_elements(a,PROCESS_ENCODE,0,0,0); + grib_accessor_bufr_data_array* self = (grib_accessor_bufr_data_array*)a; + self->do_decode = 1; + return process_elements(a, PROCESS_ENCODE, 0, 0, 0); } grib_vsarray* accessor_bufr_data_array_get_stringValues(grib_accessor* a) { - grib_accessor_bufr_data_array *self =(grib_accessor_bufr_data_array*)a; - process_elements(a,PROCESS_DECODE,0,0,0); + grib_accessor_bufr_data_array* self = (grib_accessor_bufr_data_array*)a; + process_elements(a, PROCESS_DECODE, 0, 0, 0); return self->stringValues; } grib_accessors_list* accessor_bufr_data_array_get_dataAccessors(grib_accessor* a) { - grib_accessor_bufr_data_array *self =(grib_accessor_bufr_data_array*)a; + grib_accessor_bufr_data_array* self = (grib_accessor_bufr_data_array*)a; return self->dataAccessors; } grib_trie_with_rank* accessor_bufr_data_array_get_dataAccessorsTrie(grib_accessor* a) { - grib_accessor_bufr_data_array *self =(grib_accessor_bufr_data_array*)a; + grib_accessor_bufr_data_array* self = (grib_accessor_bufr_data_array*)a; return self->dataAccessorsTrie; } -void accessor_bufr_data_array_set_unpackMode(grib_accessor* a,int unpackMode) +void accessor_bufr_data_array_set_unpackMode(grib_accessor* a, int unpackMode) { - grib_accessor_bufr_data_array *self =(grib_accessor_bufr_data_array*)a; - self->unpackMode=unpackMode; + grib_accessor_bufr_data_array* self = (grib_accessor_bufr_data_array*)a; + self->unpackMode = unpackMode; } static int get_descriptors(grib_accessor* a) { - grib_accessor_bufr_data_array *self =(grib_accessor_bufr_data_array*)a; - int ret=0,i,numberOfDescriptors; - grib_handle* h=grib_handle_of_accessor(a); - grib_context* c=a->context; + grib_accessor_bufr_data_array* self = (grib_accessor_bufr_data_array*)a; + int ret = 0, i, numberOfDescriptors; + grib_handle* h = grib_handle_of_accessor(a); + grib_context* c = a->context; if (!self->expandedAccessor) - self->expandedAccessor=grib_find_accessor(grib_handle_of_accessor(a),self->expandedDescriptorsName); - self->expanded=grib_accessor_class_expanded_descriptors_get_expanded(self->expandedAccessor,&ret); - if (ret != GRIB_SUCCESS) return ret; + self->expandedAccessor = grib_find_accessor(grib_handle_of_accessor(a), self->expandedDescriptorsName); + self->expanded = grib_accessor_class_expanded_descriptors_get_expanded(self->expandedAccessor, &ret); + if (ret != GRIB_SUCCESS) + return ret; - numberOfDescriptors=grib_bufr_descriptors_array_used_size(self->expanded); - self->canBeMissing=(int*)grib_context_malloc_clear(c,numberOfDescriptors*sizeof(int)); - for (i=0;icanBeMissing[i]=grib_bufr_descriptor_can_be_missing(self->expanded->v[i]); + numberOfDescriptors = grib_bufr_descriptors_array_used_size(self->expanded); + self->canBeMissing = (int*)grib_context_malloc_clear(c, numberOfDescriptors * sizeof(int)); + for (i = 0; i < numberOfDescriptors; i++) + self->canBeMissing[i] = grib_bufr_descriptor_can_be_missing(self->expanded->v[i]); - ret=grib_get_long(h,self->numberOfSubsetsName,&(self->numberOfSubsets)); - if (ret != GRIB_SUCCESS) return ret; - ret=grib_get_long(h,self->compressedDataName,&(self->compressedData)); + ret = grib_get_long(h, self->numberOfSubsetsName, &(self->numberOfSubsets)); + if (ret != GRIB_SUCCESS) + return ret; + ret = grib_get_long(h, self->compressedDataName, &(self->compressedData)); return ret; } static int decode_string_array(grib_context* c, unsigned char* data, long* pos, bufr_descriptor* bd, - grib_accessor_bufr_data_array* self) + grib_accessor_bufr_data_array* self) { - int ret=0; - int* err = &ret; - char* sval=0; - int j,modifiedWidth,width; - grib_sarray* sa=grib_sarray_new(c,self->numberOfSubsets,10); + int ret = 0; + int* err = &ret; + char* sval = 0; + int j, modifiedWidth, width; + grib_sarray* sa = grib_sarray_new(c, self->numberOfSubsets, 10); int bufr_multi_element_constant_arrays = c->bufr_multi_element_constant_arrays; - modifiedWidth= bd->width; + modifiedWidth = bd->width; - sval=(char*)grib_context_malloc_clear(c,modifiedWidth/8+1); + sval = (char*)grib_context_malloc_clear(c, modifiedWidth / 8 + 1); CHECK_END_DATA_RETURN(c, self, modifiedWidth, *err); if (*err) { - grib_sarray_push(c,sa,sval); - grib_vsarray_push(c,self->stringValues,sa); + grib_sarray_push(c, sa, sval); + grib_vsarray_push(c, self->stringValues, sa); return ret; } - grib_decode_string(data,pos,modifiedWidth/8,sval); + grib_decode_string(data, pos, modifiedWidth / 8, sval); CHECK_END_DATA_RETURN(c, self, 6, *err); if (*err) { - grib_sarray_push(c,sa,sval); - grib_vsarray_push(c,self->stringValues,sa); + grib_sarray_push(c, sa, sval); + grib_vsarray_push(c, self->stringValues, sa); return ret; } - width=grib_decode_unsigned_long(data,pos,6); + width = grib_decode_unsigned_long(data, pos, 6); if (width) { - CHECK_END_DATA_RETURN(c, self, width*8*self->numberOfSubsets, *err); + CHECK_END_DATA_RETURN(c, self, width * 8 * self->numberOfSubsets, *err); if (*err) { - grib_sarray_push(c,sa,sval); - grib_vsarray_push(c,self->stringValues,sa); + grib_sarray_push(c, sa, sval); + grib_vsarray_push(c, self->stringValues, sa); return ret; } - grib_context_free(c,sval); - for (j=0;jnumberOfSubsets;j++) { - sval=(char*)grib_context_malloc_clear(c,width+1); - grib_decode_string(data,pos,width,sval); - grib_sarray_push(c,sa,sval); + grib_context_free(c, sval); + for (j = 0; j < self->numberOfSubsets; j++) { + sval = (char*)grib_context_malloc_clear(c, width + 1); + grib_decode_string(data, pos, width, sval); + grib_sarray_push(c, sa, sval); } - } else { + } + else { if (bufr_multi_element_constant_arrays) { - for (j=0;jnumberOfSubsets;j++) { + for (j = 0; j < self->numberOfSubsets; j++) { char* pStr = sval; - if (j>0) pStr = strdup(sval); - grib_sarray_push(c,sa,pStr); + if (j > 0) + pStr = strdup(sval); + grib_sarray_push(c, sa, pStr); } - } else { - grib_sarray_push(c,sa,sval); + } + else { + grib_sarray_push(c, sa, sval); } } - grib_vsarray_push(c,self->stringValues,sa); + grib_vsarray_push(c, self->stringValues, sa); return ret; } -static grib_darray* decode_double_array(grib_context* c,unsigned char* data,long* pos, - bufr_descriptor* bd,int canBeMissing, - grib_accessor_bufr_data_array* self,int *err) +static grib_darray* decode_double_array(grib_context* c, unsigned char* data, long* pos, + bufr_descriptor* bd, int canBeMissing, + grib_accessor_bufr_data_array* self, int* err) { - grib_darray* ret=NULL; + grib_darray* ret = NULL; int j; size_t lval; - int localReference,localWidth,modifiedWidth,modifiedReference; - double modifiedFactor,dval; + int localReference, localWidth, modifiedWidth, modifiedReference; + double modifiedFactor, dval; int bufr_multi_element_constant_arrays = c->bufr_multi_element_constant_arrays; - *err=0; + *err = 0; - modifiedReference= bd->reference; - modifiedFactor= bd->factor; - modifiedWidth= bd->width; + modifiedReference = bd->reference; + modifiedFactor = bd->factor; + modifiedWidth = bd->width; - CHECK_END_DATA_RETURN(c, self, modifiedWidth+6, NULL); + CHECK_END_DATA_RETURN(c, self, modifiedWidth + 6, NULL); if (*err) { - dval=GRIB_MISSING_DOUBLE; - lval=0; - grib_context_log(c, GRIB_LOG_DEBUG," modifiedWidth=%ld lval=%ld dval=%g", modifiedWidth,lval,dval); - ret=grib_darray_new(c,DYN_ARRAY_SIZE_INIT,DYN_ARRAY_SIZE_INCR); - grib_darray_push(c,ret,dval); - *err=0; + dval = GRIB_MISSING_DOUBLE; + lval = 0; + grib_context_log(c, GRIB_LOG_DEBUG, " modifiedWidth=%ld lval=%ld dval=%g", modifiedWidth, lval, dval); + ret = grib_darray_new(c, DYN_ARRAY_SIZE_INIT, DYN_ARRAY_SIZE_INCR); + grib_darray_push(c, ret, dval); + *err = 0; return ret; } - lval=grib_decode_size_t(data,pos,modifiedWidth); - localReference=(long)lval+modifiedReference; - localWidth=grib_decode_unsigned_long(data,pos,6); - grib_context_log(c, GRIB_LOG_DEBUG,"BUFR data decoding: \tlocalWidth=%ld",localWidth); - ret=grib_darray_new(c,self->numberOfSubsets,50); + lval = grib_decode_size_t(data, pos, modifiedWidth); + localReference = (long)lval + modifiedReference; + localWidth = grib_decode_unsigned_long(data, pos, 6); + grib_context_log(c, GRIB_LOG_DEBUG, "BUFR data decoding: \tlocalWidth=%ld", localWidth); + ret = grib_darray_new(c, self->numberOfSubsets, 50); if (localWidth) { - CHECK_END_DATA_RETURN(c, self, localWidth*self->numberOfSubsets, NULL); + CHECK_END_DATA_RETURN(c, self, localWidth * self->numberOfSubsets, NULL); if (*err) { - dval=GRIB_MISSING_DOUBLE; - lval=0; - grib_context_log(c, GRIB_LOG_DEBUG," modifiedWidth=%ld lval=%ld dval=%g", modifiedWidth,lval,dval); - ret=grib_darray_new(c,DYN_ARRAY_SIZE_INIT,DYN_ARRAY_SIZE_INCR); - grib_darray_push(c,ret,dval); - *err=0; + dval = GRIB_MISSING_DOUBLE; + lval = 0; + grib_context_log(c, GRIB_LOG_DEBUG, " modifiedWidth=%ld lval=%ld dval=%g", modifiedWidth, lval, dval); + ret = grib_darray_new(c, DYN_ARRAY_SIZE_INIT, DYN_ARRAY_SIZE_INCR); + grib_darray_push(c, ret, dval); + *err = 0; return ret; } - for (j=0;jnumberOfSubsets;j++) { - lval=grib_decode_size_t(data,pos,localWidth); - if (grib_is_all_bits_one(lval,localWidth) && canBeMissing) { - dval=GRIB_MISSING_DOUBLE; - } else { - dval=((long)lval+localReference)*modifiedFactor; + for (j = 0; j < self->numberOfSubsets; j++) { + lval = grib_decode_size_t(data, pos, localWidth); + if (grib_is_all_bits_one(lval, localWidth) && canBeMissing) { + dval = GRIB_MISSING_DOUBLE; + } + else { + dval = ((long)lval + localReference) * modifiedFactor; } - grib_darray_push(c,ret,dval); + grib_darray_push(c, ret, dval); } - } else { + } + else { /* ECC-428 */ - if (grib_is_all_bits_one(lval,modifiedWidth) && canBeMissing) { - dval=GRIB_MISSING_DOUBLE; - } else { - dval=localReference*modifiedFactor; + if (grib_is_all_bits_one(lval, modifiedWidth) && canBeMissing) { + dval = GRIB_MISSING_DOUBLE; + } + else { + dval = localReference * modifiedFactor; } /* dataPresentIndicator is special and has to have SINGLE VALUE if constant array */ if (bufr_multi_element_constant_arrays == 1 && bd->code == 31031) { - bufr_multi_element_constant_arrays=0; + bufr_multi_element_constant_arrays = 0; } - if(bufr_multi_element_constant_arrays) { - grib_context_log(c, GRIB_LOG_DEBUG," modifiedWidth=%ld lval=%ld dval=%g (const array multi values)", modifiedWidth,lval,dval,bd->code); - for (j=0;jnumberOfSubsets;j++) { - grib_darray_push(c,ret,dval); + if (bufr_multi_element_constant_arrays) { + grib_context_log(c, GRIB_LOG_DEBUG, " modifiedWidth=%ld lval=%ld dval=%g (const array multi values)", modifiedWidth, lval, dval, bd->code); + for (j = 0; j < self->numberOfSubsets; j++) { + grib_darray_push(c, ret, dval); } - } else { - grib_context_log(c, GRIB_LOG_DEBUG," modifiedWidth=%ld lval=%ld dval=%g (const array single value)", modifiedWidth,lval,dval,bd->code); - grib_darray_push(c,ret,dval); + } + else { + grib_context_log(c, GRIB_LOG_DEBUG, " modifiedWidth=%ld lval=%ld dval=%g (const array single value)", modifiedWidth, lval, dval, bd->code); + grib_darray_push(c, ret, dval); } } return ret; } -static int encode_string_array(grib_context* c,grib_buffer* buff,long* pos, bufr_descriptor* bd, - grib_accessor_bufr_data_array* self,grib_sarray* stringValues) +static int encode_string_array(grib_context* c, grib_buffer* buff, long* pos, bufr_descriptor* bd, + grib_accessor_bufr_data_array* self, grib_sarray* stringValues) { - int err=0,n,ival; - int k,j,modifiedWidth,width; + int err = 0, n, ival; + int k, j, modifiedWidth, width; - if (self->iss_list==NULL) { - grib_context_log(c, GRIB_LOG_ERROR,"encode_string_array: self->iss_list==NULL"); + if (self->iss_list == NULL) { + grib_context_log(c, GRIB_LOG_ERROR, "encode_string_array: self->iss_list==NULL"); return GRIB_INTERNAL_ERROR; } - n=grib_iarray_used_size(self->iss_list); + n = grib_iarray_used_size(self->iss_list); - if (n<=0) return GRIB_NO_VALUES; + if (n <= 0) + return GRIB_NO_VALUES; - if (grib_sarray_used_size(stringValues)==1) { - n=1; - ival=0; - } else { - ival=self->iss_list->v[0]; + if (grib_sarray_used_size(stringValues) == 1) { + n = 1; + ival = 0; + } + else { + ival = self->iss_list->v[0]; } - if (n>grib_sarray_used_size(stringValues)) + if (n > grib_sarray_used_size(stringValues)) return GRIB_ARRAY_TOO_SMALL; - modifiedWidth= bd->width; + modifiedWidth = bd->width; - grib_buffer_set_ulength_bits(c,buff,buff->ulength_bits+modifiedWidth); - grib_encode_string(buff->data,pos,modifiedWidth/8,stringValues->v[ival]); - width= n > 1 ? modifiedWidth : 0; + grib_buffer_set_ulength_bits(c, buff, buff->ulength_bits + modifiedWidth); + grib_encode_string(buff->data, pos, modifiedWidth / 8, stringValues->v[ival]); + width = n > 1 ? modifiedWidth : 0; - grib_buffer_set_ulength_bits(c,buff,buff->ulength_bits+6); - grib_encode_unsigned_longb(buff->data,width/8,pos,6); + grib_buffer_set_ulength_bits(c, buff, buff->ulength_bits + 6); + grib_encode_unsigned_longb(buff->data, width / 8, pos, 6); if (width) { - grib_buffer_set_ulength_bits(c,buff,buff->ulength_bits+width*n); - for (j=0;jiss_list->v[j]; - grib_encode_string(buff->data,pos,width/8,stringValues->v[k]); + grib_buffer_set_ulength_bits(c, buff, buff->ulength_bits + width * n); + for (j = 0; j < n; j++) { + k = self->iss_list->v[j]; + grib_encode_string(buff->data, pos, width / 8, stringValues->v[k]); } } return err; @@ -720,15 +743,16 @@ static int encode_string_array(grib_context* c,grib_buffer* buff,long* pos, bufr static void set_missing_long_to_double(grib_darray* dvalues) { - size_t i,n=grib_darray_used_size(dvalues); - for (i=0;iv[i]==GRIB_MISSING_LONG) dvalues->v[i]=GRIB_MISSING_DOUBLE; + size_t i, n = grib_darray_used_size(dvalues); + for (i = 0; i < n; i++) { + if (dvalues->v[i] == GRIB_MISSING_LONG) + dvalues->v[i] = GRIB_MISSING_DOUBLE; } } /* ECC-750: The 'factor' argument is 10^-scale */ static int descriptor_get_min_max(bufr_descriptor* bd, long width, long reference, double factor, - double* minAllowed, double* maxAllowed) + double* minAllowed, double* maxAllowed) { /* Maximum value is allowed to be the largest number (all bits 1) which means it's MISSING */ unsigned long max1 = (1UL << width) - 1; /* Highest value for number with 'width' bits */ @@ -739,109 +763,119 @@ static int descriptor_get_min_max(bufr_descriptor* bd, long width, long referenc return GRIB_SUCCESS; } -static int encode_double_array(grib_context* c,grib_buffer* buff,long* pos, bufr_descriptor* bd, - grib_accessor_bufr_data_array* self,grib_darray* dvalues) +static int encode_double_array(grib_context* c, grib_buffer* buff, long* pos, bufr_descriptor* bd, + grib_accessor_bufr_data_array* self, grib_darray* dvalues) { - int err=0; - int j,i; + int err = 0; + int j, i; size_t lval; - long localReference=0,localWidth=0,modifiedWidth,modifiedReference; - long reference,allone; - double localRange,modifiedFactor,inverseFactor; + long localReference = 0, localWidth = 0, modifiedWidth, modifiedReference; + long reference, allone; + double localRange, modifiedFactor, inverseFactor; size_t ii, index_of_min, index_of_max; - int nvals = 0; - double min=0,max=0,maxAllowed,minAllowed; - double* v=NULL; - double* values=NULL; - int thereIsAMissing=0; + int nvals = 0; + double min = 0, max = 0, maxAllowed, minAllowed; + double* v = NULL; + double* values = NULL; + int thereIsAMissing = 0; int is_constant; double val0; /* ECC-379, ECC-830 */ const int dont_fail_if_out_of_range = self->set_to_missing_if_out_of_range; - if (self->iss_list==NULL) { - grib_context_log(c, GRIB_LOG_ERROR,"encode_double_array: self->iss_list==NULL"); + if (self->iss_list == NULL) { + grib_context_log(c, GRIB_LOG_ERROR, "encode_double_array: self->iss_list==NULL"); return GRIB_INTERNAL_ERROR; } - modifiedReference= bd->reference; - modifiedFactor= bd->factor; - inverseFactor= grib_power(bd->scale,10); - modifiedWidth= bd->width; + modifiedReference = bd->reference; + modifiedFactor = bd->factor; + inverseFactor = grib_power(bd->scale, 10); + modifiedWidth = bd->width; descriptor_get_min_max(bd, modifiedWidth, modifiedReference, modifiedFactor, &minAllowed, &maxAllowed); - nvals=grib_iarray_used_size(self->iss_list); - if (nvals<=0) return GRIB_NO_VALUES; + nvals = grib_iarray_used_size(self->iss_list); + if (nvals <= 0) + return GRIB_NO_VALUES; set_missing_long_to_double(dvalues); - v=dvalues->v; + v = dvalues->v; /* is constant */ - if (grib_darray_is_constant(dvalues,modifiedFactor*.5)) { - localWidth=0; - grib_buffer_set_ulength_bits(c,buff,buff->ulength_bits+modifiedWidth); + if (grib_darray_is_constant(dvalues, modifiedFactor * .5)) { + localWidth = 0; + grib_buffer_set_ulength_bits(c, buff, buff->ulength_bits + modifiedWidth); if (*v == GRIB_MISSING_DOUBLE) { - grib_set_bits_on(buff->data,pos,modifiedWidth); - } else { + grib_set_bits_on(buff->data, pos, modifiedWidth); + } + else { if (*v > maxAllowed || *v < minAllowed) { if (dont_fail_if_out_of_range) { - fprintf(stderr, "ECCODES WARNING : encode_double_array: %s. Value (%g) out of range (minAllowed=%g, maxAllowed=%g)." - " Setting it to missing value\n", bd->shortName, *v, minAllowed, maxAllowed); - grib_set_bits_on(buff->data,pos,modifiedWidth); - } else { - grib_context_log(c, GRIB_LOG_ERROR, "encode_double_array: %s. Value (%g) out of range (minAllowed=%g, maxAllowed=%g).", + fprintf(stderr, + "ECCODES WARNING : encode_double_array: %s. Value (%g) out of range (minAllowed=%g, maxAllowed=%g)." + " Setting it to missing value\n", bd->shortName, *v, minAllowed, maxAllowed); + grib_set_bits_on(buff->data, pos, modifiedWidth); + } + else { + grib_context_log(c, GRIB_LOG_ERROR, "encode_double_array: %s. Value (%g) out of range (minAllowed=%g, maxAllowed=%g).", + bd->shortName, *v, minAllowed, maxAllowed); return GRIB_OUT_OF_RANGE; /* ECC-611 */ } - } else { - lval=round(*v * inverseFactor)-modifiedReference; - grib_encode_size_tb(buff->data,lval,pos,modifiedWidth); + } + else { + lval = round(*v * inverseFactor) - modifiedReference; + grib_encode_size_tb(buff->data, lval, pos, modifiedWidth); } } - grib_buffer_set_ulength_bits(c,buff,buff->ulength_bits+6); - grib_encode_unsigned_longb(buff->data,localWidth,pos,6); + grib_buffer_set_ulength_bits(c, buff, buff->ulength_bits + 6); + grib_encode_unsigned_longb(buff->data, localWidth, pos, 6); return err; } - if (nvals>grib_darray_used_size(dvalues)) return GRIB_ARRAY_TOO_SMALL; - values=(double*)grib_context_malloc_clear(c,sizeof(double)*nvals); - val0=dvalues->v[self->iss_list->v[0]]; - is_constant=1; - for (i=0;iv[self->iss_list->v[i]]; - if (val0 != values[i]) is_constant=0; + if (nvals > grib_darray_used_size(dvalues)) + return GRIB_ARRAY_TOO_SMALL; + values = (double*)grib_context_malloc_clear(c, sizeof(double) * nvals); + val0 = dvalues->v[self->iss_list->v[0]]; + is_constant = 1; + for (i = 0; i < nvals; i++) { + values[i] = dvalues->v[self->iss_list->v[i]]; + if (val0 != values[i]) + is_constant = 0; } - v=values; + v = values; /* encoding a range with constant values*/ - if (is_constant==1) { - localWidth=0; - grib_buffer_set_ulength_bits(c,buff,buff->ulength_bits+modifiedWidth); + if (is_constant == 1) { + localWidth = 0; + grib_buffer_set_ulength_bits(c, buff, buff->ulength_bits + modifiedWidth); if (*v == GRIB_MISSING_DOUBLE) { - grib_set_bits_on(buff->data,pos,modifiedWidth); - } else { - lval=round(*v * inverseFactor)-modifiedReference; - grib_encode_size_tb(buff->data,lval,pos,modifiedWidth); + grib_set_bits_on(buff->data, pos, modifiedWidth); + } + else { + lval = round(*v * inverseFactor) - modifiedReference; + grib_encode_size_tb(buff->data, lval, pos, modifiedWidth); } - grib_buffer_set_ulength_bits(c,buff,buff->ulength_bits+6); - grib_encode_unsigned_longb(buff->data,localWidth,pos,6); + grib_buffer_set_ulength_bits(c, buff, buff->ulength_bits + 6); + grib_encode_unsigned_longb(buff->data, localWidth, pos, 6); return err; } - ii=0; - while (ii maxAllowed)) { - fprintf(stderr, "ECCODES WARNING : encode_double_array: %s. Value at index %ld (%g) out of range (minAllowed=%g, maxAllowed=%g)." + if (*v != GRIB_MISSING_DOUBLE && (*v < minAllowed || *v > maxAllowed)) { + fprintf(stderr, + "ECCODES WARNING : encode_double_array: %s. Value at index %ld (%g) out of range (minAllowed=%g, maxAllowed=%g)." " Setting it to missing value\n", bd->shortName, (long)ii, *v, minAllowed, maxAllowed); *v = GRIB_MISSING_DOUBLE; @@ -853,391 +887,433 @@ static int encode_double_array(grib_context* c,grib_buffer* buff,long* pos, bufr /* Determine min and max values. */ /* Note: value[0] could be missing so cannot set min/max to this. * Find first value which is non-missing as a starting point */ - for (i=0;imax && *v!=GRIB_MISSING_DOUBLE) { max=*v; index_of_max=ii; } - if (*v == GRIB_MISSING_DOUBLE) thereIsAMissing=1; + ii = 0; + index_of_min = index_of_max = 0; + v = values; + while (ii < nvals) { + if (*v < min && *v != GRIB_MISSING_DOUBLE) { + min = *v; + index_of_min = ii; + } + if (*v > max && *v != GRIB_MISSING_DOUBLE) { + max = *v; + index_of_max = ii; + } + if (*v == GRIB_MISSING_DOUBLE) + thereIsAMissing = 1; ii++; v++; } - if (max>maxAllowed && max!=GRIB_MISSING_DOUBLE) { + if (max > maxAllowed && max != GRIB_MISSING_DOUBLE) { grib_context_log(c, GRIB_LOG_ERROR, "encode_double_array: %s. Maximum value (value[%lu]=%g) out of range (maxAllowed=%g).", - bd->shortName, index_of_max, max, maxAllowed, index_of_max); + bd->shortName, index_of_max, max, maxAllowed, index_of_max); return GRIB_OUT_OF_RANGE; } - if (minshortName, index_of_min, min, minAllowed); + bd->shortName, index_of_min, min, minAllowed); return GRIB_OUT_OF_RANGE; } - reference=round(min*inverseFactor); - localReference=reference-modifiedReference; - if (max!=min) { - localRange = (max-min)*inverseFactor+1; - localWidth=ceil(log(localRange)/log(2.0)); - lval=round(max*inverseFactor)-reference; - allone=grib_power(localWidth,2)-1; + reference = round(min * inverseFactor); + localReference = reference - modifiedReference; + if (max != min) { + localRange = (max - min) * inverseFactor + 1; + localWidth = ceil(log(localRange) / log(2.0)); + lval = round(max * inverseFactor) - reference; + allone = grib_power(localWidth, 2) - 1; while (allone <= lval) { localWidth++; - allone=grib_power(localWidth,2)-1; + allone = grib_power(localWidth, 2) - 1; } - if (localWidth == 1) localWidth++; - } else { - if (thereIsAMissing==1) localWidth=1; - else localWidth=0; + if (localWidth == 1) + localWidth++; + } + else { + if (thereIsAMissing == 1) + localWidth = 1; + else + localWidth = 0; } - grib_buffer_set_ulength_bits(c,buff,buff->ulength_bits+modifiedWidth); + grib_buffer_set_ulength_bits(c, buff, buff->ulength_bits + modifiedWidth); if (localWidth) { - grib_encode_unsigned_longb(buff->data,localReference,pos,modifiedWidth); - } else { - if (min==GRIB_MISSING_DOUBLE) { - grib_set_bits_on(buff->data,pos,modifiedWidth); - } else { - lval=localReference-modifiedReference; - grib_encode_size_tb(buff->data,lval,pos,modifiedWidth); + grib_encode_unsigned_longb(buff->data, localReference, pos, modifiedWidth); + } + else { + if (min == GRIB_MISSING_DOUBLE) { + grib_set_bits_on(buff->data, pos, modifiedWidth); + } + else { + lval = localReference - modifiedReference; + grib_encode_size_tb(buff->data, lval, pos, modifiedWidth); } } - grib_buffer_set_ulength_bits(c,buff,buff->ulength_bits+6); - grib_encode_unsigned_longb(buff->data,localWidth,pos,6); + grib_buffer_set_ulength_bits(c, buff, buff->ulength_bits + 6); + grib_encode_unsigned_longb(buff->data, localWidth, pos, 6); if (localWidth) { - grib_buffer_set_ulength_bits(c,buff,buff->ulength_bits+nvals*localWidth); - for (j=0;jdata,pos,localWidth); - } else { - lval=round(values[j]*inverseFactor)-reference; - grib_encode_size_tb(buff->data,lval,pos,localWidth); + grib_buffer_set_ulength_bits(c, buff, buff->ulength_bits + nvals * localWidth); + for (j = 0; j < nvals; j++) { + if (values[j] == GRIB_MISSING_DOUBLE) { + grib_set_bits_on(buff->data, pos, localWidth); + } + else { + lval = round(values[j] * inverseFactor) - reference; + grib_encode_size_tb(buff->data, lval, pos, localWidth); } } } - grib_context_free(c,values); + grib_context_free(c, values); return err; } -static int encode_double_value(grib_context* c,grib_buffer* buff,long* pos,bufr_descriptor* bd, - grib_accessor_bufr_data_array* self,double value) +static int encode_double_value(grib_context* c, grib_buffer* buff, long* pos, bufr_descriptor* bd, + grib_accessor_bufr_data_array* self, double value) { size_t lval; - double maxAllowed,minAllowed; - int err=0; - int modifiedWidth,modifiedReference; + double maxAllowed, minAllowed; + int err = 0; + int modifiedWidth, modifiedReference; double modifiedFactor; /* ECC-379, ECC-830 */ const int dont_fail_if_out_of_range = self->set_to_missing_if_out_of_range; - modifiedReference= bd->reference; - modifiedFactor= bd->factor; - modifiedWidth= bd->width; + modifiedReference = bd->reference; + modifiedFactor = bd->factor; + modifiedWidth = bd->width; descriptor_get_min_max(bd, modifiedWidth, modifiedReference, modifiedFactor, &minAllowed, &maxAllowed); - grib_buffer_set_ulength_bits(c,buff,buff->ulength_bits+modifiedWidth); - if (value==GRIB_MISSING_DOUBLE) { - grib_set_bits_on(buff->data,pos,modifiedWidth); + grib_buffer_set_ulength_bits(c, buff, buff->ulength_bits + modifiedWidth); + if (value == GRIB_MISSING_DOUBLE) { + grib_set_bits_on(buff->data, pos, modifiedWidth); } - else if (value>maxAllowed || value maxAllowed || value < minAllowed) { if (dont_fail_if_out_of_range) { - fprintf(stderr, "ECCODES WARNING : encode_double_value: %s. Value (%g) out of range (minAllowed=%g, maxAllowed=%g)." + fprintf(stderr, + "ECCODES WARNING : encode_double_value: %s. Value (%g) out of range (minAllowed=%g, maxAllowed=%g)." " Setting it to missing value\n", bd->shortName, value, minAllowed, maxAllowed); - value = GRIB_MISSING_DOUBLE; /* Ignore the bad value and instead use 'missing' */ - grib_set_bits_on(buff->data,pos,modifiedWidth); - } else { + value = GRIB_MISSING_DOUBLE; /* Ignore the bad value and instead use 'missing' */ + grib_set_bits_on(buff->data, pos, modifiedWidth); + } + else { grib_context_log(c, GRIB_LOG_ERROR, "encode_double_value: %s. Value (%g) out of range (minAllowed=%g, maxAllowed=%g).", - bd->shortName, value, minAllowed, maxAllowed); + bd->shortName, value, minAllowed, maxAllowed); return GRIB_OUT_OF_RANGE; } } else { - lval=round(value/modifiedFactor)-modifiedReference; - if (c->debug) grib_context_log(c, GRIB_LOG_DEBUG, "encode_double_value %s: value=%.15f lval=%lu\n", bd->shortName,value,lval); - grib_encode_size_tb(buff->data,lval,pos,modifiedWidth); + lval = round(value / modifiedFactor) - modifiedReference; + if (c->debug) + grib_context_log(c, GRIB_LOG_DEBUG, "encode_double_value %s: value=%.15f lval=%lu\n", bd->shortName, value, lval); + grib_encode_size_tb(buff->data, lval, pos, modifiedWidth); } return err; } -static int encode_string_value(grib_context* c,grib_buffer* buff,long* pos, bufr_descriptor* bd, - grib_accessor_bufr_data_array* self,char* sval) +static int encode_string_value(grib_context* c, grib_buffer* buff, long* pos, bufr_descriptor* bd, + grib_accessor_bufr_data_array* self, char* sval) { - int err=0; + int err = 0; int len; - len= bd->width / 8; - grib_buffer_set_ulength_bits(c,buff,buff->ulength_bits+bd->width); + len = bd->width / 8; + grib_buffer_set_ulength_bits(c, buff, buff->ulength_bits + bd->width); - grib_encode_string(buff->data,pos,len,sval); + grib_encode_string(buff->data, pos, len, sval); return err; } -static char* decode_string_value(grib_context* c,unsigned char* data,long* pos, bufr_descriptor* bd, - grib_accessor_bufr_data_array* self,int *err) +static char* decode_string_value(grib_context* c, unsigned char* data, long* pos, bufr_descriptor* bd, + grib_accessor_bufr_data_array* self, int* err) { - char* sval=0; + char* sval = 0; int len; - *err=0; + *err = 0; - len= bd->width / 8; + len = bd->width / 8; CHECK_END_DATA_RETURN(c, self, bd->width, NULL); - sval=(char*)grib_context_malloc_clear(c,len+1); - if (*err) {*err=0; return sval;} - grib_decode_string(data,pos,len,sval); + sval = (char*)grib_context_malloc_clear(c, len + 1); + if (*err) { + *err = 0; + return sval; + } + grib_decode_string(data, pos, len, sval); /* clean_string(sval,len); */ return sval; } -static double decode_double_value(grib_context* c,unsigned char* data,long* pos, - bufr_descriptor* bd,int canBeMissing, - grib_accessor_bufr_data_array* self,int* err) +static double decode_double_value(grib_context* c, unsigned char* data, long* pos, + bufr_descriptor* bd, int canBeMissing, + grib_accessor_bufr_data_array* self, int* err) { size_t lval; - int modifiedWidth,modifiedReference; + int modifiedWidth, modifiedReference; double modifiedFactor; - double dval=0; + double dval = 0; - *err=0; + *err = 0; - modifiedReference= bd->reference; - modifiedFactor= bd->factor; - modifiedWidth= bd->width; + modifiedReference = bd->reference; + modifiedFactor = bd->factor; + modifiedWidth = bd->width; CHECK_END_DATA_RETURN(c, self, modifiedWidth, 0); - if (*err) {*err=0; return GRIB_MISSING_DOUBLE;} + if (*err) { + *err = 0; + return GRIB_MISSING_DOUBLE; + } - lval=grib_decode_size_t(data,pos,modifiedWidth); - if (grib_is_all_bits_one(lval,modifiedWidth) && canBeMissing) { - dval=GRIB_MISSING_DOUBLE; - } else { - dval=((long)lval+modifiedReference)*modifiedFactor; + lval = grib_decode_size_t(data, pos, modifiedWidth); + if (grib_is_all_bits_one(lval, modifiedWidth) && canBeMissing) { + dval = GRIB_MISSING_DOUBLE; + } + else { + dval = ((long)lval + modifiedReference) * modifiedFactor; } return dval; } -static int decode_element(grib_context* c,grib_accessor_bufr_data_array* self,int subsetIndex, - grib_buffer* b,unsigned char* data,long *pos,int i,bufr_descriptor* descriptor,long elementIndex, - grib_darray* dval,grib_sarray* sval) +static int decode_element(grib_context* c, grib_accessor_bufr_data_array* self, int subsetIndex, + grib_buffer* b, unsigned char* data, long* pos, int i, bufr_descriptor* descriptor, long elementIndex, + grib_darray* dval, grib_sarray* sval) { - grib_accessor* a=(grib_accessor*)self; - grib_darray* dar=0; - grib_sarray* sar=0; - int index=0,ii,stringValuesLen; - char* csval=0; - double cdval=0,x; - int err=0; - bufr_descriptor* bd = descriptor==NULL ? self->expanded->v[i] : descriptor ; + grib_accessor* a = (grib_accessor*)self; + grib_darray* dar = 0; + grib_sarray* sar = 0; + int index = 0, ii, stringValuesLen; + char* csval = 0; + double cdval = 0, x; + int err = 0; + bufr_descriptor* bd = descriptor == NULL ? self->expanded->v[i] : descriptor; /* Assert( b->data == data); */ if (self->change_ref_value_operand > 0 && self->change_ref_value_operand != 255) { /* Operator 203YYY: Change Reference Values: Definition phase */ const int number_of_bits = self->change_ref_value_operand; - long new_ref_val = grib_decode_signed_longb(data, pos, number_of_bits); - grib_context_log(c, GRIB_LOG_DEBUG,"BUFR data decoding: -**- \tcode=203YYY width=%ld pos=%ld -> %ld", - number_of_bits,(long)*pos,(long)(*pos-a->offset*8)); + long new_ref_val = grib_decode_signed_longb(data, pos, number_of_bits); + grib_context_log(c, GRIB_LOG_DEBUG, "BUFR data decoding: -**- \tcode=203YYY width=%ld pos=%ld -> %ld", + number_of_bits, (long)*pos, (long)(*pos - a->offset * 8)); grib_context_log(c, GRIB_LOG_DEBUG, "Operator 203YYY: Store for code %6.6ld => new ref val %ld", bd->code, new_ref_val); tableB_override_store_ref_val(c, self, bd->code, new_ref_val); - bd->nokey=1; - err=check_end_data(c, self, number_of_bits); /*advance bitsToEnd*/ + bd->nokey = 1; + err = check_end_data(c, self, number_of_bits); /*advance bitsToEnd*/ return err; } - grib_context_log(c, GRIB_LOG_DEBUG,"BUFR data decoding: -%ld- \tcode=%6.6ld width=%ld scale=%ld ref=%ld type=%ld (pos=%ld -> %ld)", - i, bd->code, bd->width, bd->scale, bd->reference, bd->type, - (long)*pos, (long)(*pos-a->offset*8)); - if (bd->type==BUFR_DESCRIPTOR_TYPE_STRING) { + grib_context_log(c, GRIB_LOG_DEBUG, "BUFR data decoding: -%ld- \tcode=%6.6ld width=%ld scale=%ld ref=%ld type=%ld (pos=%ld -> %ld)", + i, bd->code, bd->width, bd->scale, bd->reference, bd->type, + (long)*pos, (long)(*pos - a->offset * 8)); + if (bd->type == BUFR_DESCRIPTOR_TYPE_STRING) { /* string */ if (self->compressedData) { - err = decode_string_array(c,data,pos,bd,self); - index=grib_vsarray_used_size(self->stringValues); - dar=grib_darray_new(c,self->numberOfSubsets,10); - index=self->numberOfSubsets*(index-1); - for (ii=1;ii<=self->numberOfSubsets;ii++) { - x=(index+ii)*1000+bd->width/8; - grib_darray_push(c,dar,x); + err = decode_string_array(c, data, pos, bd, self); + index = grib_vsarray_used_size(self->stringValues); + dar = grib_darray_new(c, self->numberOfSubsets, 10); + index = self->numberOfSubsets * (index - 1); + for (ii = 1; ii <= self->numberOfSubsets; ii++) { + x = (index + ii) * 1000 + bd->width / 8; + grib_darray_push(c, dar, x); } - grib_vdarray_push(c,self->numericValues,dar); - } else { - csval=decode_string_value(c,data,pos,bd,self,&err); - grib_context_log(c, GRIB_LOG_DEBUG,"BUFR data decoding: \t %s = %s", - bd->shortName,csval); - sar=grib_sarray_push(c,sar,csval); - grib_vsarray_push(c,self->stringValues,sar); - stringValuesLen=grib_vsarray_used_size(self->stringValues); - index=0; - for (ii=0;iistringValues->v[ii]); + grib_vdarray_push(c, self->numericValues, dar); + } + else { + csval = decode_string_value(c, data, pos, bd, self, &err); + grib_context_log(c, GRIB_LOG_DEBUG, "BUFR data decoding: \t %s = %s", + bd->shortName, csval); + sar = grib_sarray_push(c, sar, csval); + grib_vsarray_push(c, self->stringValues, sar); + stringValuesLen = grib_vsarray_used_size(self->stringValues); + index = 0; + for (ii = 0; ii < stringValuesLen; ii++) { + index += grib_sarray_used_size(self->stringValues->v[ii]); } - cdval=index*1000+bd->width / 8; - grib_darray_push(c,dval,cdval); + cdval = index * 1000 + bd->width / 8; + grib_darray_push(c, dval, cdval); } - } else { + } + else { /* numeric or codetable or flagtable */ /* Operator 203YYY: Check if we have changed ref value for this element. If so modify bd->reference */ - if (self->change_ref_value_operand!=0 && tableB_override_get_ref_val(self, bd->code, &(bd->reference)) == GRIB_SUCCESS) { - grib_context_log(c, GRIB_LOG_DEBUG,"Operator 203YYY: For code %6.6ld, changed ref val: %ld", bd->code, bd->reference); + if (self->change_ref_value_operand != 0 && tableB_override_get_ref_val(self, bd->code, &(bd->reference)) == GRIB_SUCCESS) { + grib_context_log(c, GRIB_LOG_DEBUG, "Operator 203YYY: For code %6.6ld, changed ref val: %ld", bd->code, bd->reference); } if (bd->width > 64) { - grib_context_log(c, GRIB_LOG_ERROR,"Descriptor %6.6ld has bit width %ld!", bd->code,bd->width); + grib_context_log(c, GRIB_LOG_ERROR, "Descriptor %6.6ld has bit width %ld!", bd->code, bd->width); return GRIB_DECODING_ERROR; } if (self->compressedData) { - dar=decode_double_array(c,data,pos,bd,self->canBeMissing[i],self,&err); - grib_vdarray_push(c,self->numericValues,dar); - } else { + dar = decode_double_array(c, data, pos, bd, self->canBeMissing[i], self, &err); + grib_vdarray_push(c, self->numericValues, dar); + } + else { /* Uncompressed */ - cdval=decode_double_value(c,data,pos,bd,self->canBeMissing[i],self,&err); - grib_context_log(c, GRIB_LOG_DEBUG,"BUFR data decoding: \t %s = %g", - bd->shortName,cdval); - grib_darray_push(c,dval,cdval); + cdval = decode_double_value(c, data, pos, bd, self->canBeMissing[i], self, &err); + grib_context_log(c, GRIB_LOG_DEBUG, "BUFR data decoding: \t %s = %g", + bd->shortName, cdval); + grib_darray_push(c, dval, cdval); } } return err; } -static int decode_replication(grib_context* c,grib_accessor_bufr_data_array* self,int subsetIndex, - grib_buffer* buff,unsigned char* data,long *pos,int i,long elementIndex,grib_darray* dval,long* numberOfRepetitions) +static int decode_replication(grib_context* c, grib_accessor_bufr_data_array* self, int subsetIndex, + grib_buffer* buff, unsigned char* data, long* pos, int i, long elementIndex, grib_darray* dval, long* numberOfRepetitions) { - int ret=0; - int *err; - int localReference,width; - bufr_descriptor** descriptors=0; - err=&ret; - descriptors=self->expanded->v; + int ret = 0; + int* err; + int localReference, width; + bufr_descriptor** descriptors = 0; + err = &ret; + descriptors = self->expanded->v; /* Assert(buff->data == data); */ - grib_context_log(c, GRIB_LOG_DEBUG,"BUFR data decoding: -%ld- \tcode=%6.6ld width=%ld ", - i,self->expanded->v[i]->code,self->expanded->v[i]->width); + grib_context_log(c, GRIB_LOG_DEBUG, "BUFR data decoding: -%ld- \tcode=%6.6ld width=%ld ", + i, self->expanded->v[i]->code, self->expanded->v[i]->width); if (self->compressedData) { - grib_context_log(c, GRIB_LOG_DEBUG,"BUFR data decoding: \tdelayed replication localReference width=%ld", descriptors[i]->width); - CHECK_END_DATA_RETURN(c, self, descriptors[i]->width+6, *err); + grib_context_log(c, GRIB_LOG_DEBUG, "BUFR data decoding: \tdelayed replication localReference width=%ld", descriptors[i]->width); + CHECK_END_DATA_RETURN(c, self, descriptors[i]->width + 6, *err); if (*err) { - *numberOfRepetitions=0; - } else { - localReference=grib_decode_unsigned_long(data,pos,descriptors[i]->width)+descriptors[i]->reference; - grib_context_log(c, GRIB_LOG_DEBUG,"BUFR data decoding: \tdelayed replication localWidth width=6"); - width=grib_decode_unsigned_long(data,pos,6); + *numberOfRepetitions = 0; + } + else { + localReference = grib_decode_unsigned_long(data, pos, descriptors[i]->width) + descriptors[i]->reference; + grib_context_log(c, GRIB_LOG_DEBUG, "BUFR data decoding: \tdelayed replication localWidth width=6"); + width = grib_decode_unsigned_long(data, pos, 6); if (width) { - grib_context_log(c, GRIB_LOG_DEBUG,"BUFR data decoding: \tdelayed replication is NOT constant for compressed data!"); + grib_context_log(c, GRIB_LOG_DEBUG, "BUFR data decoding: \tdelayed replication is NOT constant for compressed data!"); /* delayed replication number is not constant. NOT IMPLEMENTED */ return GRIB_NOT_IMPLEMENTED; - } else { - *numberOfRepetitions=localReference*descriptors[i]->factor; - grib_context_log(c, GRIB_LOG_DEBUG,"BUFR data decoding: \tdelayed replication value=%ld",*numberOfRepetitions); + } + else { + *numberOfRepetitions = localReference * descriptors[i]->factor; + grib_context_log(c, GRIB_LOG_DEBUG, "BUFR data decoding: \tdelayed replication value=%ld", *numberOfRepetitions); } } - } else { + } + else { CHECK_END_DATA_RETURN(c, self, descriptors[i]->width, *err); - if (*err) { - *numberOfRepetitions=0; - } else { - *numberOfRepetitions=grib_decode_unsigned_long(data,pos,descriptors[i]->width)+ - descriptors[i]->reference*descriptors[i]->factor; - grib_context_log(c, GRIB_LOG_DEBUG,"BUFR data decoding: \tdelayed replication value=%ld",*numberOfRepetitions); + if (*err) { + *numberOfRepetitions = 0; + } + else { + *numberOfRepetitions = grib_decode_unsigned_long(data, pos, descriptors[i]->width) + + descriptors[i]->reference * descriptors[i]->factor; + grib_context_log(c, GRIB_LOG_DEBUG, "BUFR data decoding: \tdelayed replication value=%ld", *numberOfRepetitions); } } if (self->compressedData) { - dval=grib_darray_new(c,1,100); - if(c->bufr_multi_element_constant_arrays) { + dval = grib_darray_new(c, 1, 100); + if (c->bufr_multi_element_constant_arrays) { long j; - for (j=0;jnumberOfSubsets;j++) { - grib_darray_push(c,dval,(double)(*numberOfRepetitions)); + for (j = 0; j < self->numberOfSubsets; j++) { + grib_darray_push(c, dval, (double)(*numberOfRepetitions)); } - } else { - grib_darray_push(c,dval,(double)(*numberOfRepetitions)); } - grib_vdarray_push(c,self->numericValues,dval); - } else { - grib_darray_push(c,dval,(double)(*numberOfRepetitions)); + else { + grib_darray_push(c, dval, (double)(*numberOfRepetitions)); + } + grib_vdarray_push(c, self->numericValues, dval); + } + else { + grib_darray_push(c, dval, (double)(*numberOfRepetitions)); } return ret; } -static int encode_new_bitmap(grib_context* c,grib_buffer* buff,long *pos,int idx,grib_accessor_bufr_data_array* self) +static int encode_new_bitmap(grib_context* c, grib_buffer* buff, long* pos, int idx, grib_accessor_bufr_data_array* self) { - grib_darray* doubleValues=NULL; - int err=0; - double cdval=0; - if (self->nInputBitmap>0) { + grib_darray* doubleValues = NULL; + int err = 0; + double cdval = 0; + if (self->nInputBitmap > 0) { if (self->nInputBitmap < self->iInputBitmap) return GRIB_ARRAY_TOO_SMALL; - cdval=self->inputBitmap[self->iInputBitmap++]; + cdval = self->inputBitmap[self->iInputBitmap++]; } if (self->compressedData) { - doubleValues=grib_darray_new(c,1,1); - grib_darray_push(c,doubleValues,cdval); - err=encode_double_array(c,buff,pos,self->expanded->v[idx],self,doubleValues); - grib_darray_delete(c,doubleValues); - } else { - err=encode_double_value(c,buff,pos,self->expanded->v[idx],self,cdval); + doubleValues = grib_darray_new(c, 1, 1); + grib_darray_push(c, doubleValues, cdval); + err = encode_double_array(c, buff, pos, self->expanded->v[idx], self, doubleValues); + grib_darray_delete(c, doubleValues); + } + else { + err = encode_double_value(c, buff, pos, self->expanded->v[idx], self, cdval); } return err; } /* Operator 203YYY: Change Reference Values: Encoding definition phase */ static int encode_overridden_reference_value(grib_context* c, grib_accessor_bufr_data_array* self, - grib_buffer* buff, long *pos, bufr_descriptor* bd) + grib_buffer* buff, long* pos, bufr_descriptor* bd) { - int err = 0; + int err = 0; long currRefVal = -1; - long numBits = self->change_ref_value_operand; + long numBits = self->change_ref_value_operand; /* We must be encoding between 203YYY and 203255 */ Assert(self->change_ref_value_operand > 0 && self->change_ref_value_operand != 255); - if ( self->refValListSize == 0 ) { - grib_context_log(c, GRIB_LOG_ERROR,"encode_new_element: Overridden Reference Values array is empty!"); + if (self->refValListSize == 0) { + grib_context_log(c, GRIB_LOG_ERROR, + "encode_new_element: Overridden Reference Values array is empty! " + "(Hint: set the key '%s')", + OVERRIDDEN_REFERENCE_VALUES_KEY); + grib_context_log(c, GRIB_LOG_ERROR, + "The number of overridden reference values must be equal to " + "number of descriptors between operator 203YYY and 203255"); return GRIB_ENCODING_ERROR; } - if ( self->refValIndex >= self->refValListSize ) { - grib_context_log(c, GRIB_LOG_ERROR,"encode_new_element: Overridden Reference Values: index=%ld, size=%ld. " - "\nThe number of overridden reference values must be equal to " - "number of descriptors between operator 203YYY and 203255", - self->refValIndex, self->refValListSize); + if (self->refValIndex >= self->refValListSize) { + grib_context_log(c, GRIB_LOG_ERROR, + "encode_new_element: Overridden Reference Values: index=%ld, size=%ld. " + "\nThe number of overridden reference values must be equal to " + "number of descriptors between operator 203YYY and 203255", + self->refValIndex, self->refValListSize); return GRIB_ENCODING_ERROR; } currRefVal = self->refValList[self->refValIndex]; - grib_context_log(c,GRIB_LOG_DEBUG, "encode_new_element: Operator 203YYY: writing ref val %ld (self->refValIndex=%ld)", - currRefVal, self->refValIndex); - grib_buffer_set_ulength_bits(c,buff,buff->ulength_bits+numBits); + grib_context_log(c, GRIB_LOG_DEBUG, "encode_new_element: Operator 203YYY: writing ref val %ld (self->refValIndex=%ld)", + currRefVal, self->refValIndex); + grib_buffer_set_ulength_bits(c, buff, buff->ulength_bits + numBits); err = grib_encode_signed_longb(buff->data, currRefVal, pos, numBits); if (err) { - grib_context_log(c,GRIB_LOG_ERROR,"encoding overridden reference value %ld for %s (code=%6.6ld)", - currRefVal, bd->shortName, bd->code); + grib_context_log(c, GRIB_LOG_ERROR, "encoding overridden reference value %ld for %s (code=%6.6ld)", + currRefVal, bd->shortName, bd->code); } self->refValIndex++; return err; } -static int encode_new_element(grib_context* c,grib_accessor_bufr_data_array* self,int subsetIndex, - grib_buffer* buff,unsigned char* data,long *pos,int i,bufr_descriptor* descriptor, - long elementIndex,grib_darray* dval,grib_sarray* sval) +static int encode_new_element(grib_context* c, grib_accessor_bufr_data_array* self, int subsetIndex, + grib_buffer* buff, unsigned char* data, long* pos, int i, bufr_descriptor* descriptor, + long elementIndex, grib_darray* dval, grib_sarray* sval) { int ii; - char* csval=0; - unsigned char missingChar=0xFF; - double cdval=GRIB_MISSING_DOUBLE; - int err=0; + char* csval = 0; + unsigned char missingChar = 0xFF; + double cdval = GRIB_MISSING_DOUBLE; + int err = 0; size_t slen; - bufr_descriptor* bd = descriptor==NULL ? self->expanded->v[i] : descriptor ; + bufr_descriptor* bd = descriptor == NULL ? self->expanded->v[i] : descriptor; - grib_context_log(c, GRIB_LOG_DEBUG,"BUFR data encoding: \tcode=%6.6ld width=%ld pos=%ld ulength=%ld ulength_bits=%ld", - bd->code,bd->width,(long)*pos,buff->ulength,buff->ulength_bits); + grib_context_log(c, GRIB_LOG_DEBUG, "BUFR data encoding: \tcode=%6.6ld width=%ld pos=%ld ulength=%ld ulength_bits=%ld", + bd->code, bd->width, (long)*pos, buff->ulength, buff->ulength_bits); if (self->change_ref_value_operand > 0 && self->change_ref_value_operand != 255) { /* Operator 203YYY: Change Reference Values: Encoding definition phase */ @@ -1245,113 +1321,117 @@ static int encode_new_element(grib_context* c,grib_accessor_bufr_data_array* sel return err; } - if (bd->type==BUFR_DESCRIPTOR_TYPE_STRING) { + if (bd->type == BUFR_DESCRIPTOR_TYPE_STRING) { /* string */ - slen=bd->width/8; - csval=(char*)grib_context_malloc_clear(c,slen+1); - for (ii=0;iishortName,csval); + slen = bd->width / 8; + csval = (char*)grib_context_malloc_clear(c, slen + 1); + for (ii = 0; ii < slen; ii++) + csval[ii] = missingChar; + grib_context_log(c, GRIB_LOG_DEBUG, "BUFR data encoding: \t %s = %s", + bd->shortName, csval); if (self->compressedData) { - grib_sarray* stringValues=grib_sarray_new(c,1,1); - grib_sarray_push(c,stringValues,csval); - err=encode_string_array(c,buff,pos,bd,self,stringValues); - grib_sarray_delete_content(c,stringValues); - grib_sarray_delete(c,stringValues); - } else { - err=encode_string_value(c,buff,pos,bd,self,csval); - } - } else { + grib_sarray* stringValues = grib_sarray_new(c, 1, 1); + grib_sarray_push(c, stringValues, csval); + err = encode_string_array(c, buff, pos, bd, self, stringValues); + grib_sarray_delete_content(c, stringValues); + grib_sarray_delete(c, stringValues); + } + else { + err = encode_string_value(c, buff, pos, bd, self, csval); + } + } + else { /* numeric or codetable or flagtable */ - grib_context_log(c, GRIB_LOG_DEBUG,"BUFR data encoding: \t %s = %g", - bd->shortName,cdval); - if (bd->code==31031) - return encode_new_bitmap(c,buff,pos,i,self); + grib_context_log(c, GRIB_LOG_DEBUG, "BUFR data encoding: \t %s = %g", + bd->shortName, cdval); + if (bd->code == 31031) + return encode_new_bitmap(c, buff, pos, i, self); if (self->compressedData) { - grib_darray* doubleValues=grib_darray_new(c,1,1); - grib_darray_push(c,doubleValues,cdval); - err=encode_double_array(c,buff,pos,bd,self,doubleValues); - grib_darray_delete(c,doubleValues); - } else { - err=encode_double_value(c,buff,pos,bd,self,cdval); + grib_darray* doubleValues = grib_darray_new(c, 1, 1); + grib_darray_push(c, doubleValues, cdval); + err = encode_double_array(c, buff, pos, bd, self, doubleValues); + grib_darray_delete(c, doubleValues); + } + else { + err = encode_double_value(c, buff, pos, bd, self, cdval); } } return err; } -static int encode_new_replication(grib_context* c,grib_accessor_bufr_data_array* self,int subsetIndex, - grib_buffer* buff,unsigned char* data,long *pos,int i,long elementIndex,grib_darray* dval,long* numberOfRepetitions) +static int encode_new_replication(grib_context* c, grib_accessor_bufr_data_array* self, int subsetIndex, + grib_buffer* buff, unsigned char* data, long* pos, int i, long elementIndex, grib_darray* dval, long* numberOfRepetitions) { - int err=0; - unsigned long repetitions=1; - bufr_descriptor** descriptors=self->expanded->v; + int err = 0; + unsigned long repetitions = 1; + bufr_descriptor** descriptors = self->expanded->v; /* Assert( buff->data==data); */ - switch(descriptors[i]->code) { - case 31000: - if (self->nInputShortReplications>=0) { - if (self->iInputShortReplications>=self->nInputShortReplications) { - grib_context_log(c,GRIB_LOG_ERROR,"array inputShortDelayedDescriptorReplicationFactor: dimension mismatch (nInputShortReplications=%d)", - self->nInputShortReplications); - return GRIB_ARRAY_TOO_SMALL; + switch (descriptors[i]->code) { + case 31000: + if (self->nInputShortReplications >= 0) { + if (self->iInputShortReplications >= self->nInputShortReplications) { + grib_context_log(c, GRIB_LOG_ERROR, "array inputShortDelayedDescriptorReplicationFactor: dimension mismatch (nInputShortReplications=%d)", + self->nInputShortReplications); + return GRIB_ARRAY_TOO_SMALL; + } + repetitions = self->inputShortReplications[self->iInputShortReplications]; + self->iInputShortReplications++; } - repetitions=self->inputShortReplications[self->iInputShortReplications]; - self->iInputShortReplications++; - } - break; - case 31001: - if (self->nInputReplications>=0) { - if (self->iInputReplications>=self->nInputReplications) { - grib_context_log(c,GRIB_LOG_ERROR,"array inputDelayedDescriptorReplicationFactor: dimension mismatch (nInputReplications=%d)", - self->nInputReplications); - return GRIB_ARRAY_TOO_SMALL; + break; + case 31001: + if (self->nInputReplications >= 0) { + if (self->iInputReplications >= self->nInputReplications) { + grib_context_log(c, GRIB_LOG_ERROR, "array inputDelayedDescriptorReplicationFactor: dimension mismatch (nInputReplications=%d)", + self->nInputReplications); + return GRIB_ARRAY_TOO_SMALL; + } + repetitions = self->inputReplications[self->iInputReplications]; + self->iInputReplications++; } - repetitions=self->inputReplications[self->iInputReplications]; - self->iInputReplications++; - } - break; - case 31002: - if (self->nInputExtendedReplications>=0) { - if (self->iInputExtendedReplications>=self->nInputExtendedReplications) { - grib_context_log(c,GRIB_LOG_ERROR,"array inputExtendedDelayedDescriptorReplicationFactor: dimension mismatch (nInputExtendedReplications=%d)", - self->nInputExtendedReplications); - return GRIB_ARRAY_TOO_SMALL; + break; + case 31002: + if (self->nInputExtendedReplications >= 0) { + if (self->iInputExtendedReplications >= self->nInputExtendedReplications) { + grib_context_log(c, GRIB_LOG_ERROR, "array inputExtendedDelayedDescriptorReplicationFactor: dimension mismatch (nInputExtendedReplications=%d)", + self->nInputExtendedReplications); + return GRIB_ARRAY_TOO_SMALL; + } + repetitions = self->inputExtendedReplications[self->iInputExtendedReplications]; + self->iInputExtendedReplications++; } - repetitions=self->inputExtendedReplications[self->iInputExtendedReplications]; - self->iInputExtendedReplications++; - } - break; - default: - grib_context_log(c, GRIB_LOG_ERROR, "unsupported descriptor code %d\n", descriptors[i]->code); - return GRIB_INTERNAL_ERROR; + break; + default: + grib_context_log(c, GRIB_LOG_ERROR, "unsupported descriptor code %d\n", descriptors[i]->code); + return GRIB_INTERNAL_ERROR; } - grib_context_log(c, GRIB_LOG_DEBUG,"BUFR data encoding replication: \twidth=%ld pos=%ld ulength=%ld ulength_bits=%ld", - (long)descriptors[i]->width,(long)*pos,(long)buff->ulength,(long)buff->ulength_bits); - grib_buffer_set_ulength_bits(c,buff,buff->ulength_bits+descriptors[i]->width); - grib_encode_unsigned_longb(data,repetitions,pos,descriptors[i]->width); + grib_context_log(c, GRIB_LOG_DEBUG, "BUFR data encoding replication: \twidth=%ld pos=%ld ulength=%ld ulength_bits=%ld", + (long)descriptors[i]->width, (long)*pos, (long)buff->ulength, (long)buff->ulength_bits); + grib_buffer_set_ulength_bits(c, buff, buff->ulength_bits + descriptors[i]->width); + grib_encode_unsigned_longb(data, repetitions, pos, descriptors[i]->width); - *numberOfRepetitions=repetitions; + *numberOfRepetitions = repetitions; if (self->compressedData) { - grib_buffer_set_ulength_bits(c,buff,buff->ulength_bits+6); - grib_encode_unsigned_longb(buff->data,0,pos,6); + grib_buffer_set_ulength_bits(c, buff, buff->ulength_bits + 6); + grib_encode_unsigned_longb(buff->data, 0, pos, 6); }; return err; } -static int encode_element(grib_context* c,grib_accessor_bufr_data_array* self,int subsetIndex, - grib_buffer* buff,unsigned char* data,long *pos,int i,bufr_descriptor* descriptor, - long elementIndex,grib_darray* dval,grib_sarray* sval) +static int encode_element(grib_context* c, grib_accessor_bufr_data_array* self, int subsetIndex, + grib_buffer* buff, unsigned char* data, long* pos, int i, bufr_descriptor* descriptor, + long elementIndex, grib_darray* dval, grib_sarray* sval) { - int idx,j; - int err=0; - bufr_descriptor* bd = descriptor==NULL ? self->expanded->v[i] : descriptor ; + int idx, j; + int err = 0; + bufr_descriptor* bd = descriptor == NULL ? self->expanded->v[i] : descriptor; /* Assert( buff->data == data); */ - grib_context_log(c, GRIB_LOG_DEBUG,"BUFR data encoding: -%ld- \tcode=%6.6ld width=%ld pos=%ld ulength=%ld ulength_bits=%ld", - i,bd->code,bd->width,(long)*pos,buff->ulength,buff->ulength_bits); + grib_context_log(c, GRIB_LOG_DEBUG, "BUFR data encoding: -%ld- \tcode=%6.6ld width=%ld pos=%ld ulength=%ld ulength_bits=%ld", + i, bd->code, bd->width, (long)*pos, buff->ulength, buff->ulength_bits); if (self->change_ref_value_operand > 0 && self->change_ref_value_operand != 255) { /* Operator 203YYY: Change Reference Values: Encoding definition phase */ @@ -1359,438 +1439,479 @@ static int encode_element(grib_context* c,grib_accessor_bufr_data_array* self,in return err; } - if (bd->type==BUFR_DESCRIPTOR_TYPE_STRING) { + if (bd->type == BUFR_DESCRIPTOR_TYPE_STRING) { /* string */ /* grib_context_log(c, GRIB_LOG_DEBUG,"BUFR data encoding: \t %s = %s", bd->shortName,csval); */ if (self->compressedData) { - idx=((int)self->numericValues->v[elementIndex]->v[0]/1000-1)/self->numberOfSubsets; - err=encode_string_array(c,buff,pos,bd,self,self->stringValues->v[idx]); - } else { + idx = ((int)self->numericValues->v[elementIndex]->v[0] / 1000 - 1) / self->numberOfSubsets; + err = encode_string_array(c, buff, pos, bd, self, self->stringValues->v[idx]); + } + else { if (self->numericValues->v[subsetIndex] == NULL) { - grib_context_log(c,GRIB_LOG_ERROR,"Invalid subset index %d (number of subsets=%ld)", subsetIndex, self->numberOfSubsets); + grib_context_log(c, GRIB_LOG_ERROR, "Invalid subset index %d (number of subsets=%ld)", subsetIndex, self->numberOfSubsets); return GRIB_INVALID_ARGUMENT; } - idx=(int)self->numericValues->v[subsetIndex]->v[elementIndex]/1000-1; + idx = (int)self->numericValues->v[subsetIndex]->v[elementIndex] / 1000 - 1; if (idx < 0 || idx >= self->stringValues->n) { - grib_context_log(c,GRIB_LOG_ERROR,"encode_element: %s: Invalid index %d", bd->shortName, idx); + grib_context_log(c, GRIB_LOG_ERROR, "encode_element: %s: Invalid index %d", bd->shortName, idx); return GRIB_INVALID_ARGUMENT; } - err=encode_string_value(c,buff,pos,bd,self,self->stringValues->v[idx]->v[0]); + err = encode_string_value(c, buff, pos, bd, self, self->stringValues->v[idx]->v[0]); } - } else { + } + else { /* numeric or codetable or flagtable */ if (self->compressedData) { - err=encode_double_array(c,buff,pos,bd,self,self->numericValues->v[elementIndex]); + err = encode_double_array(c, buff, pos, bd, self, self->numericValues->v[elementIndex]); if (err) { - grib_context_log(c,GRIB_LOG_ERROR,"encoding %s ( code=%6.6ld width=%ld scale=%ld reference=%ld )", - bd->shortName, bd->code, bd->width, - bd->scale, bd->reference); - for (j=0;jnumericValues->v[elementIndex]);j++) - grib_context_log(c,GRIB_LOG_ERROR,"value[%d]\t= %g", j,self->numericValues->v[elementIndex]->v[j]); + grib_context_log(c, GRIB_LOG_ERROR, "encoding %s ( code=%6.6ld width=%ld scale=%ld reference=%ld )", + bd->shortName, bd->code, bd->width, + bd->scale, bd->reference); + for (j = 0; j < grib_darray_used_size(self->numericValues->v[elementIndex]); j++) + grib_context_log(c, GRIB_LOG_ERROR, "value[%d]\t= %g", j, self->numericValues->v[elementIndex]->v[j]); } - } else { + } + else { if (self->numericValues->v[subsetIndex] == NULL) { - grib_context_log(c,GRIB_LOG_ERROR,"Invalid subset index %d (number of subsets=%ld)", subsetIndex, self->numberOfSubsets); + grib_context_log(c, GRIB_LOG_ERROR, "Invalid subset index %d (number of subsets=%ld)", subsetIndex, self->numberOfSubsets); return GRIB_INVALID_ARGUMENT; } - err=encode_double_value(c,buff,pos,bd,self,self->numericValues->v[subsetIndex]->v[elementIndex]); + err = encode_double_value(c, buff, pos, bd, self, self->numericValues->v[subsetIndex]->v[elementIndex]); if (err) { - grib_context_log(c,GRIB_LOG_ERROR,"Cannot encode %s=%g (subset=%d)", /*subsetIndex starts from 0*/ - bd->shortName, self->numericValues->v[subsetIndex]->v[elementIndex], subsetIndex+1); + grib_context_log(c, GRIB_LOG_ERROR, "Cannot encode %s=%g (subset=%d)", /*subsetIndex starts from 0*/ + bd->shortName, self->numericValues->v[subsetIndex]->v[elementIndex], subsetIndex + 1); } } } return err; } -static int encode_replication(grib_context* c,grib_accessor_bufr_data_array* self,int subsetIndex, - grib_buffer* buff,unsigned char* data,long *pos,int i,long elementIndex,grib_darray* dval,long* numberOfRepetitions) +static int encode_replication(grib_context* c, grib_accessor_bufr_data_array* self, int subsetIndex, + grib_buffer* buff, unsigned char* data, long* pos, int i, long elementIndex, grib_darray* dval, long* numberOfRepetitions) { /* Assert( buff->data == data); */ if (self->compressedData) { - DebugAssert(grib_darray_used_size(self->numericValues->v[elementIndex])==1); - *numberOfRepetitions=self->numericValues->v[elementIndex]->v[0]; - } else { - *numberOfRepetitions=self->numericValues->v[subsetIndex]->v[elementIndex]; + DebugAssert(grib_darray_used_size(self->numericValues->v[elementIndex]) == 1); + *numberOfRepetitions = self->numericValues->v[elementIndex]->v[0]; + } + else { + *numberOfRepetitions = self->numericValues->v[subsetIndex]->v[elementIndex]; } - return encode_element(c,self,subsetIndex,buff,data,pos,i,0,elementIndex,dval,0); + return encode_element(c, self, subsetIndex, buff, data, pos, i, 0, elementIndex, dval, 0); } -static int build_bitmap(grib_accessor_bufr_data_array *self,unsigned char* data,long* pos,int iel,grib_iarray* elementsDescriptorsIndex,int iBitmapOperator) +static int build_bitmap(grib_accessor_bufr_data_array* self, unsigned char* data, long* pos, int iel, grib_iarray* elementsDescriptorsIndex, int iBitmapOperator) { - int bitmapSize=0,iDelayedReplication=0; - int i,localReference,width,bitmapEndElementsDescriptorsIndex; - long ppos,n; - grib_accessor* a=(grib_accessor*)self; - grib_context* c=a->context; - bufr_descriptor** descriptors=self->expanded->v; - long* edi=elementsDescriptorsIndex->v; + int bitmapSize = 0, iDelayedReplication = 0; + int i, localReference, width, bitmapEndElementsDescriptorsIndex; + long ppos, n; + grib_accessor* a = (grib_accessor*)self; + grib_context* c = a->context; + bufr_descriptor** descriptors = self->expanded->v; + long* edi = elementsDescriptorsIndex->v; /* int iel=grib_iarray_used_size(elementsDescriptorsIndex)-1; */ - int err=0; + int err = 0; switch (descriptors[iBitmapOperator]->code) { - case 222000: - case 223000: - case 236000: - cancel_bitmap(self); - if (iel < 0) { return GRIB_ENCODING_ERROR; } - while (descriptors[edi[iel]]->code>=100000 || iel==0) { - iel--; - if (iel < 0) { return GRIB_ENCODING_ERROR; } - } - bitmapEndElementsDescriptorsIndex=iel; - /*looking for another bitmap and pointing before it. + case 222000: + case 223000: + case 236000: + cancel_bitmap(self); + if (iel < 0) { + return GRIB_ENCODING_ERROR; + } + while (descriptors[edi[iel]]->code >= 100000 || iel == 0) { + iel--; + if (iel < 0) { + return GRIB_ENCODING_ERROR; + } + } + bitmapEndElementsDescriptorsIndex = iel; + /*looking for another bitmap and pointing before it. This behaviour is not documented in the Manual on codes it is copied from BUFRDC ECC-243 */ - while (iel>0) { - while ( descriptors[edi[iel]]->code!=236000 && descriptors[edi[iel]]->code!=222000 && descriptors[edi[iel]]->code!=223000 && iel!=0) iel--; - if (iel!=0) { - while (descriptors[edi[iel]]->code>=100000 && iel!=0) iel--; - bitmapEndElementsDescriptorsIndex=iel; + while (iel > 0) { + while (descriptors[edi[iel]]->code != 236000 && descriptors[edi[iel]]->code != 222000 && descriptors[edi[iel]]->code != 223000 && iel != 0) + iel--; + if (iel != 0) { + while (descriptors[edi[iel]]->code >= 100000 && iel != 0) + iel--; + bitmapEndElementsDescriptorsIndex = iel; + } } - } - i=iBitmapOperator+1; - if (descriptors[i]->code==101000) { - iDelayedReplication=iBitmapOperator+2; - Assert( descriptors[iDelayedReplication]->code==31001 || - descriptors[iDelayedReplication]->code==31002 ); - i=iDelayedReplication; - if (self->compressedData) { - ppos=*pos; - if (err) return err; - localReference=grib_decode_unsigned_long(data,pos,descriptors[i]->width)+descriptors[i]->reference; - width=grib_decode_unsigned_long(data,pos,6); - *pos=ppos; - if (width) { - /* delayed replication number is not constant. NOT IMPLEMENTED */ - grib_context_log(c,GRIB_LOG_ERROR, "Delayed replication number is not constant"); - return GRIB_NOT_IMPLEMENTED; - } else { - bitmapSize=localReference*descriptors[i]->factor; + i = iBitmapOperator + 1; + if (descriptors[i]->code == 101000) { + iDelayedReplication = iBitmapOperator + 2; + Assert(descriptors[iDelayedReplication]->code == 31001 || + descriptors[iDelayedReplication]->code == 31002); + i = iDelayedReplication; + if (self->compressedData) { + ppos = *pos; + if (err) + return err; + localReference = grib_decode_unsigned_long(data, pos, descriptors[i]->width) + descriptors[i]->reference; + width = grib_decode_unsigned_long(data, pos, 6); + *pos = ppos; + if (width) { + /* delayed replication number is not constant. NOT IMPLEMENTED */ + grib_context_log(c, GRIB_LOG_ERROR, "Delayed replication number is not constant"); + return GRIB_NOT_IMPLEMENTED; + } + else { + bitmapSize = localReference * descriptors[i]->factor; + } + } + else { + ppos = *pos; + if (err) + return err; + bitmapSize = grib_decode_unsigned_long(data, pos, descriptors[i]->width) + + descriptors[i]->reference * descriptors[i]->factor; + *pos = ppos; } - } else { - ppos=*pos; - if (err) return err; - bitmapSize=grib_decode_unsigned_long(data,pos,descriptors[i]->width)+ - descriptors[i]->reference*descriptors[i]->factor; - *pos=ppos; } - } else if (descriptors[i]->code==31031){ - bitmapSize=0; - while (descriptors[i]->code==31031) {bitmapSize++;i++;} - } - iel=bitmapEndElementsDescriptorsIndex; - n=bitmapSize-1; - while ( n>0 && iel>=0 ) { - if (descriptors[edi[iel]]->code<100000) n--; - iel--; - } - self->bitmapStartElementsDescriptorsIndex=iel; - restart_bitmap(self); - break; - default : - grib_context_log(c,GRIB_LOG_ERROR,"build_bitmap: unsupported operator %d\n", - descriptors[iBitmapOperator]->code); - return GRIB_INTERNAL_ERROR; + else if (descriptors[i]->code == 31031) { + bitmapSize = 0; + while (descriptors[i]->code == 31031) { + bitmapSize++; + i++; + } + } + iel = bitmapEndElementsDescriptorsIndex; + n = bitmapSize - 1; + while (n > 0 && iel >= 0) { + if (descriptors[edi[iel]]->code < 100000) + n--; + iel--; + } + self->bitmapStartElementsDescriptorsIndex = iel; + restart_bitmap(self); + break; + default: + grib_context_log(c, GRIB_LOG_ERROR, "build_bitmap: unsupported operator %d\n", + descriptors[iBitmapOperator]->code); + return GRIB_INTERNAL_ERROR; } return GRIB_SUCCESS; } -static int consume_bitmap(grib_accessor_bufr_data_array *self,int iBitmapOperator) +static int consume_bitmap(grib_accessor_bufr_data_array* self, int iBitmapOperator) { - int bitmapSize=0,iDelayedReplication; + int bitmapSize = 0, iDelayedReplication; int i; - bufr_descriptor** descriptors=self->expanded->v; + bufr_descriptor** descriptors = self->expanded->v; - i=iBitmapOperator+1; - if (descriptors[i]->code==101000) { - iDelayedReplication=iBitmapOperator+2; + i = iBitmapOperator + 1; + if (descriptors[i]->code == 101000) { + iDelayedReplication = iBitmapOperator + 2; switch (descriptors[iDelayedReplication]->code) { - case 31001: - bitmapSize=self->inputReplications[self->iInputReplications]; - break; - case 31002: - bitmapSize=self->inputExtendedReplications[self->iInputExtendedReplications]; - break; - default : - Assert(0); + case 31001: + bitmapSize = self->inputReplications[self->iInputReplications]; + break; + case 31002: + bitmapSize = self->inputExtendedReplications[self->iInputExtendedReplications]; + break; + default: + Assert(0); } - } else if (descriptors[i]->code==31031){ - bitmapSize=0; - while (descriptors[i]->code==31031) {bitmapSize++;i++;} } - self->bitmapCurrent+=bitmapSize; + else if (descriptors[i]->code == 31031) { + bitmapSize = 0; + while (descriptors[i]->code == 31031) { + bitmapSize++; + i++; + } + } + self->bitmapCurrent += bitmapSize; return GRIB_SUCCESS; } -static int build_bitmap_new_data(grib_accessor_bufr_data_array *self,unsigned char* data,long* pos,int iel,grib_iarray* elementsDescriptorsIndex,int iBitmapOperator) +static int build_bitmap_new_data(grib_accessor_bufr_data_array* self, unsigned char* data, long* pos, int iel, grib_iarray* elementsDescriptorsIndex, int iBitmapOperator) { - int bitmapSize=0,iDelayedReplication=0; - int i,bitmapEndElementsDescriptorsIndex; + int bitmapSize = 0, iDelayedReplication = 0; + int i, bitmapEndElementsDescriptorsIndex; long n; - grib_accessor* a=(grib_accessor*)self; - grib_context* c=a->context; - bufr_descriptor** descriptors=self->expanded->v; - long* edi=elementsDescriptorsIndex->v; + grib_accessor* a = (grib_accessor*)self; + grib_context* c = a->context; + bufr_descriptor** descriptors = self->expanded->v; + long* edi = elementsDescriptorsIndex->v; switch (descriptors[iBitmapOperator]->code) { - case 222000: - case 223000: - case 236000: - if (iel < 0) { return GRIB_ENCODING_ERROR; } - while (descriptors[edi[iel]]->code>=100000) { - iel--; - if (iel < 0) { return GRIB_ENCODING_ERROR; } - } - bitmapEndElementsDescriptorsIndex=iel; - /*looking for another bitmap and pointing before it. + case 222000: + case 223000: + case 236000: + if (iel < 0) { + return GRIB_ENCODING_ERROR; + } + while (descriptors[edi[iel]]->code >= 100000) { + iel--; + if (iel < 0) { + return GRIB_ENCODING_ERROR; + } + } + bitmapEndElementsDescriptorsIndex = iel; + /*looking for another bitmap and pointing before it. This behaviour is not documented in the Manual on codes it is copied from BUFRDC ECC-243 */ - while (iel>0) { - while ( descriptors[edi[iel]]->code!=236000 && descriptors[edi[iel]]->code!=222000 && descriptors[edi[iel]]->code!=223000 && iel!=0) iel--; - if (iel!=0) { - while (descriptors[edi[iel]]->code>=100000 && iel!=0) iel--; - bitmapEndElementsDescriptorsIndex=iel; + while (iel > 0) { + while (descriptors[edi[iel]]->code != 236000 && descriptors[edi[iel]]->code != 222000 && descriptors[edi[iel]]->code != 223000 && iel != 0) + iel--; + if (iel != 0) { + while (descriptors[edi[iel]]->code >= 100000 && iel != 0) + iel--; + bitmapEndElementsDescriptorsIndex = iel; + } } - } - i=iBitmapOperator+1; - if (descriptors[i]->code==101000) { - iDelayedReplication=iBitmapOperator+2; - switch (descriptors[iDelayedReplication]->code) { - case 31001: - if(!self->inputReplications) {grib_context_log(c,GRIB_LOG_ERROR,"build_bitmap_new_data: No inputReplications"); return GRIB_ENCODING_ERROR;} - bitmapSize=self->inputReplications[self->iInputReplications]; - break; - case 31002: - if(!self->inputExtendedReplications) {grib_context_log(c,GRIB_LOG_ERROR,"build_bitmap_new_data: No inputExtendedReplications");return GRIB_ENCODING_ERROR;} - bitmapSize=self->inputExtendedReplications[self->iInputExtendedReplications]; - break; - default : - Assert(0); + i = iBitmapOperator + 1; + if (descriptors[i]->code == 101000) { + iDelayedReplication = iBitmapOperator + 2; + switch (descriptors[iDelayedReplication]->code) { + case 31001: + if (!self->inputReplications) { + grib_context_log(c, GRIB_LOG_ERROR, "build_bitmap_new_data: No inputReplications"); + return GRIB_ENCODING_ERROR; + } + bitmapSize = self->inputReplications[self->iInputReplications]; + break; + case 31002: + if (!self->inputExtendedReplications) { + grib_context_log(c, GRIB_LOG_ERROR, "build_bitmap_new_data: No inputExtendedReplications"); + return GRIB_ENCODING_ERROR; + } + bitmapSize = self->inputExtendedReplications[self->iInputExtendedReplications]; + break; + default: + Assert(0); + } } - } else if (descriptors[i]->code==31031){ - bitmapSize=0; - while (descriptors[i]->code==31031) {bitmapSize++;i++;} - } - iel=bitmapEndElementsDescriptorsIndex; - n=bitmapSize-1; - while ( n>0 && iel>=0 ) { - if (descriptors[edi[iel]]->code<100000) n--; - iel--; - } - self->bitmapStartElementsDescriptorsIndex=iel; - self->bitmapCurrentElementsDescriptorsIndex=iel-1; - break; - default : - grib_context_log(c,GRIB_LOG_ERROR,"build_bitmap_new_data: unsupported operator %d\n", - descriptors[iBitmapOperator]->code); - return GRIB_INTERNAL_ERROR; + else if (descriptors[i]->code == 31031) { + bitmapSize = 0; + while (descriptors[i]->code == 31031) { + bitmapSize++; + i++; + } + } + iel = bitmapEndElementsDescriptorsIndex; + n = bitmapSize - 1; + while (n > 0 && iel >= 0) { + if (descriptors[edi[iel]]->code < 100000) + n--; + iel--; + } + self->bitmapStartElementsDescriptorsIndex = iel; + self->bitmapCurrentElementsDescriptorsIndex = iel - 1; + break; + default: + grib_context_log(c, GRIB_LOG_ERROR, "build_bitmap_new_data: unsupported operator %d\n", + descriptors[iBitmapOperator]->code); + return GRIB_INTERNAL_ERROR; } return GRIB_SUCCESS; } -static int get_next_bitmap_descriptor_index_new_bitmap(grib_accessor_bufr_data_array *self,grib_iarray* elementsDescriptorsIndex,int compressedData) +static int get_next_bitmap_descriptor_index_new_bitmap(grib_accessor_bufr_data_array* self, grib_iarray* elementsDescriptorsIndex, int compressedData) { int i; - bufr_descriptor** descriptors=self->expanded->v; + bufr_descriptor** descriptors = self->expanded->v; self->bitmapCurrent++; self->bitmapCurrentElementsDescriptorsIndex++; - i=self->bitmapCurrent; + i = self->bitmapCurrent; if (self->compressedData) { - DebugAssert(inInputBitmap); - if (i>=self->nInputBitmap) return GRIB_WRONG_BITMAP_SIZE; - while (self->inputBitmap[i]==1) { + DebugAssert(i < self->nInputBitmap); + if (i >= self->nInputBitmap) + return GRIB_WRONG_BITMAP_SIZE; + while (self->inputBitmap[i] == 1) { self->bitmapCurrent++; self->bitmapCurrentElementsDescriptorsIndex++; - while (descriptors[elementsDescriptorsIndex->v[self->bitmapCurrentElementsDescriptorsIndex]]->code - >100000) + while (descriptors[elementsDescriptorsIndex->v[self->bitmapCurrentElementsDescriptorsIndex]]->code > 100000) self->bitmapCurrentElementsDescriptorsIndex++; i++; } - } else { - if (i>=self->nInputBitmap) return GRIB_WRONG_BITMAP_SIZE; - while (self->inputBitmap[i]==1) { + } + else { + if (i >= self->nInputBitmap) + return GRIB_WRONG_BITMAP_SIZE; + while (self->inputBitmap[i] == 1) { self->bitmapCurrent++; self->bitmapCurrentElementsDescriptorsIndex++; - while (descriptors[elementsDescriptorsIndex->v[self->bitmapCurrentElementsDescriptorsIndex]]->code - >100000) + while (descriptors[elementsDescriptorsIndex->v[self->bitmapCurrentElementsDescriptorsIndex]]->code > 100000) self->bitmapCurrentElementsDescriptorsIndex++; i++; } } - while (descriptors[elementsDescriptorsIndex->v[self->bitmapCurrentElementsDescriptorsIndex]]->code - >100000) + while (descriptors[elementsDescriptorsIndex->v[self->bitmapCurrentElementsDescriptorsIndex]]->code > 100000) self->bitmapCurrentElementsDescriptorsIndex++; return elementsDescriptorsIndex->v[self->bitmapCurrentElementsDescriptorsIndex]; } -static int get_next_bitmap_descriptor_index(grib_accessor_bufr_data_array *self,grib_iarray* elementsDescriptorsIndex,grib_darray* numericValues) +static int get_next_bitmap_descriptor_index(grib_accessor_bufr_data_array* self, grib_iarray* elementsDescriptorsIndex, grib_darray* numericValues) { int i; - bufr_descriptor** descriptors=self->expanded->v; + bufr_descriptor** descriptors = self->expanded->v; if (self->compressedData) { - if (self->numericValues->n==0) - return get_next_bitmap_descriptor_index_new_bitmap(self,elementsDescriptorsIndex,1); + if (self->numericValues->n == 0) + return get_next_bitmap_descriptor_index_new_bitmap(self, elementsDescriptorsIndex, 1); self->bitmapCurrent++; self->bitmapCurrentElementsDescriptorsIndex++; - i=self->bitmapCurrent+self->bitmapStart; - DebugAssert(inumericValues->n); - while (self->numericValues->v[i]->v[0]==1) { + i = self->bitmapCurrent + self->bitmapStart; + DebugAssert(i < self->numericValues->n); + while (self->numericValues->v[i]->v[0] == 1) { self->bitmapCurrent++; self->bitmapCurrentElementsDescriptorsIndex++; - while (descriptors[elementsDescriptorsIndex->v[self->bitmapCurrentElementsDescriptorsIndex]]->code - >100000) + while (descriptors[elementsDescriptorsIndex->v[self->bitmapCurrentElementsDescriptorsIndex]]->code > 100000) self->bitmapCurrentElementsDescriptorsIndex++; i++; } - } else { - if (numericValues->n==0) - return get_next_bitmap_descriptor_index_new_bitmap(self,elementsDescriptorsIndex,0); + } + else { + if (numericValues->n == 0) + return get_next_bitmap_descriptor_index_new_bitmap(self, elementsDescriptorsIndex, 0); self->bitmapCurrent++; self->bitmapCurrentElementsDescriptorsIndex++; - i=self->bitmapCurrent+self->bitmapStart; - DebugAssert(in); - while (numericValues->v[i]==1) { + i = self->bitmapCurrent + self->bitmapStart; + DebugAssert(i < numericValues->n); + while (numericValues->v[i] == 1) { self->bitmapCurrent++; self->bitmapCurrentElementsDescriptorsIndex++; - while (descriptors[elementsDescriptorsIndex->v[self->bitmapCurrentElementsDescriptorsIndex]]->code - >100000) + while (descriptors[elementsDescriptorsIndex->v[self->bitmapCurrentElementsDescriptorsIndex]]->code > 100000) self->bitmapCurrentElementsDescriptorsIndex++; i++; } } - while (descriptors[elementsDescriptorsIndex->v[self->bitmapCurrentElementsDescriptorsIndex]]->code - >100000) + while (descriptors[elementsDescriptorsIndex->v[self->bitmapCurrentElementsDescriptorsIndex]]->code > 100000) self->bitmapCurrentElementsDescriptorsIndex++; return elementsDescriptorsIndex->v[self->bitmapCurrentElementsDescriptorsIndex]; } -static void push_zero_element(grib_accessor_bufr_data_array* self,grib_darray* dval) +static void push_zero_element(grib_accessor_bufr_data_array* self, grib_darray* dval) { - grib_darray* d=0; - grib_accessor* a=(grib_accessor*)self; - grib_context* c=a->context; + grib_darray* d = 0; + grib_accessor* a = (grib_accessor*)self; + grib_context* c = a->context; if (self->compressedData) { - d=grib_darray_new(c,1,100); - grib_darray_push(c,d,0); - grib_vdarray_push(c,self->numericValues,d); - } else { - grib_darray_push(c,dval,0); + d = grib_darray_new(c, 1, 100); + grib_darray_push(c, d, 0); + grib_vdarray_push(c, self->numericValues, d); + } + else { + grib_darray_push(c, dval, 0); } } -static grib_accessor* create_attribute_variable(char* name,grib_section* section,int type,char* sval,double dval,long lval,unsigned long flags) +static grib_accessor* create_attribute_variable(char* name, grib_section* section, int type, char* sval, double dval, long lval, unsigned long flags) { - grib_accessor* a=NULL; - grib_action creator = {0, }; + grib_accessor* a = NULL; + grib_action creator = {0,}; size_t len; creator.op = "variable"; creator.name_space = ""; - creator.flags = GRIB_ACCESSOR_FLAG_READ_ONLY | flags ; + creator.flags = GRIB_ACCESSOR_FLAG_READ_ONLY | flags; creator.set = 0; - creator.name=name; - a=grib_accessor_factory(section, &creator, 0, NULL); - a->parent=NULL; - a->h=section->h; - accessor_variable_set_type(a,type); - len=1; + creator.name = name; + a = grib_accessor_factory(section, &creator, 0, NULL); + a->parent = NULL; + a->h = section->h; + accessor_variable_set_type(a, type); + len = 1; switch (type) { - case GRIB_TYPE_LONG: - grib_pack_long(a,&lval,&len); - break; - case GRIB_TYPE_DOUBLE: - grib_pack_double(a,&dval,&len); - break; - case GRIB_TYPE_STRING: - if (!sval) - return NULL; - len=strlen(sval); - grib_pack_string(a,sval,&len); - break; + case GRIB_TYPE_LONG: + grib_pack_long(a, &lval, &len); + break; + case GRIB_TYPE_DOUBLE: + grib_pack_double(a, &dval, &len); + break; + case GRIB_TYPE_STRING: + if (!sval) + return NULL; + len = strlen(sval); + grib_pack_string(a, sval, &len); + break; } return a; } -static void set_creator_name(grib_action* creator,int code) +static void set_creator_name(grib_action* creator, int code) { switch (code) { - case 222000: - creator->name = (char*)"qualityInformationFollows"; - break; - case 223000: - creator->name = (char*)"substitutedValuesOperator"; - break; - case 223255: - creator->name = (char*)"substitutedValue"; - break; - case 224000: - creator->name = (char*)"firstOrderStatiticalValuesFollow"; - break; - case 224255: - creator->name = (char*)"firstOrderStatisticalValue"; - break; - case 225000: - creator->name = (char*)"differenceStatisticalValuesFollow"; - break; - case 225255: - creator->name = (char*)"differenceStatisticalValue"; - break; - case 232000: - creator->name = (char*)"replacedRetainedValuesFollow"; - break; - case 232255: - creator->name = (char*)"replacedRetainedValue"; - break; - case 235000: - creator->name = (char*)"cancelBackwardDataReference"; - break; - case 236000: - creator->name = (char*)"defineDataPresentBitmap"; - break; - case 237000: - creator->name = (char*)"useDefinedDataPresentBitmap"; - break; - case 237255: - creator->name = (char*)"cancelUseDefinedDataPresentBitmap"; - break; - case 241000: - creator->name = (char*)"defineEvent"; - break; - case 241255: - creator->name = (char*)"cancelDefineEvent"; - break; - case 242000: - creator->name = (char*)"defineConditioningEvent"; - break; - case 242255: - creator->name = (char*)"canceDefineConditioningEvent"; - break; - case 243000: - creator->name = (char*)"categoricalForecastValuesFollow"; - break; - case 243255: - creator->name = (char*)"cancelCategoricalForecastValuesFollow"; - break; - case 999999: - creator->name = (char*)"associatedField"; - break; - default : - if (code > 204999 && code < 206000) creator->name = (char*)"text"; - else creator->name = (char*)"operator"; - break; + case 222000: + creator->name = (char*)"qualityInformationFollows"; + break; + case 223000: + creator->name = (char*)"substitutedValuesOperator"; + break; + case 223255: + creator->name = (char*)"substitutedValue"; + break; + case 224000: + creator->name = (char*)"firstOrderStatiticalValuesFollow"; + break; + case 224255: + creator->name = (char*)"firstOrderStatisticalValue"; + break; + case 225000: + creator->name = (char*)"differenceStatisticalValuesFollow"; + break; + case 225255: + creator->name = (char*)"differenceStatisticalValue"; + break; + case 232000: + creator->name = (char*)"replacedRetainedValuesFollow"; + break; + case 232255: + creator->name = (char*)"replacedRetainedValue"; + break; + case 235000: + creator->name = (char*)"cancelBackwardDataReference"; + break; + case 236000: + creator->name = (char*)"defineDataPresentBitmap"; + break; + case 237000: + creator->name = (char*)"useDefinedDataPresentBitmap"; + break; + case 237255: + creator->name = (char*)"cancelUseDefinedDataPresentBitmap"; + break; + case 241000: + creator->name = (char*)"defineEvent"; + break; + case 241255: + creator->name = (char*)"cancelDefineEvent"; + break; + case 242000: + creator->name = (char*)"defineConditioningEvent"; + break; + case 242255: + creator->name = (char*)"canceDefineConditioningEvent"; + break; + case 243000: + creator->name = (char*)"categoricalForecastValuesFollow"; + break; + case 243255: + creator->name = (char*)"cancelCategoricalForecastValuesFollow"; + break; + case 999999: + creator->name = (char*)"associatedField"; + break; + default: + if (code > 204999 && code < 206000) + creator->name = (char*)"text"; + else + creator->name = (char*)"operator"; + break; } } @@ -1798,236 +1919,259 @@ static void set_creator_name(grib_action* creator,int code) static int adding_extra_key_attributes(grib_handle* h) { long skip = 0; /* default is to add */ - int err = 0; - err = grib_get_long(h,"skipExtraKeyAttributes",&skip); - if (err) return 1; + int err = 0; + err = grib_get_long(h, "skipExtraKeyAttributes", &skip); + if (err) + return 1; return (!skip); } static grib_accessor* create_accessor_from_descriptor(grib_accessor* a, grib_accessor* attribute, grib_section* section, - long ide,long subset,int dump,int count,int add_extra_attributes) -{ - grib_accessor_bufr_data_array *self =(grib_accessor_bufr_data_array*)a; - char code[10]={0,}; - char* temp_str = NULL; - int idx=0; - unsigned long flags=GRIB_ACCESSOR_FLAG_READ_ONLY; - grib_action operatorCreator = {0, }; - grib_accessor* elementAccessor=NULL; - grib_action creator = {0, }; + long ide, long subset, int dump, int count, int add_extra_attributes) +{ + grib_accessor_bufr_data_array* self = (grib_accessor_bufr_data_array*)a; + char code[10] = {0,}; + char* temp_str = NULL; + int idx = 0; + unsigned long flags = GRIB_ACCESSOR_FLAG_READ_ONLY; + grib_action operatorCreator = {0,}; + grib_accessor* elementAccessor = NULL; + grib_action creator = {0,}; creator.op = "bufr_data_element"; creator.name_space = ""; creator.set = 0; operatorCreator.op = "variable"; operatorCreator.name_space = ""; - operatorCreator.flags = GRIB_ACCESSOR_FLAG_READ_ONLY; + operatorCreator.flags = GRIB_ACCESSOR_FLAG_READ_ONLY; operatorCreator.set = 0; - operatorCreator.name="operator"; + operatorCreator.name = "operator"; - if(attribute) { DebugAssert(attribute->parent==NULL); } + if (attribute) { + DebugAssert(attribute->parent == NULL); + } if (dump) { - creator.flags = GRIB_ACCESSOR_FLAG_DUMP; - operatorCreator.flags |= GRIB_ACCESSOR_FLAG_DUMP; + creator.flags = GRIB_ACCESSOR_FLAG_DUMP; + operatorCreator.flags |= GRIB_ACCESSOR_FLAG_DUMP; } - idx = self->compressedData ? self->elementsDescriptorsIndex->v[0]->v[ide] : - self->elementsDescriptorsIndex->v[subset]->v[ide] ; + idx = self->compressedData ? self->elementsDescriptorsIndex->v[0]->v[ide] : self->elementsDescriptorsIndex->v[subset]->v[ide]; switch (self->expanded->v[idx]->F) { - case 0: - case 1: - creator.name=grib_context_strdup(a->context, self->expanded->v[idx]->shortName); - /* ECC-325: store alloc'd string (due to strdup) for clean up later */ - grib_sarray_push(a->context, self->tempStrings, creator.name); - elementAccessor = grib_accessor_factory(section, &creator, 0, NULL); - if (self->canBeMissing[idx]) elementAccessor->flags |= GRIB_ACCESSOR_FLAG_CAN_BE_MISSING; - if (self->expanded->v[idx]->code == 31000 || self->expanded->v[idx]->code == 31001 || self->expanded->v[idx]->code == 31002 || self->expanded->v[idx]->code == 31031) - elementAccessor->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - accessor_bufr_data_element_set_index(elementAccessor,ide); - accessor_bufr_data_element_set_descriptors(elementAccessor,self->expanded); - accessor_bufr_data_element_set_elementsDescriptorsIndex(elementAccessor,self->elementsDescriptorsIndex); - accessor_bufr_data_element_set_numericValues(elementAccessor,self->numericValues); - accessor_bufr_data_element_set_stringValues(elementAccessor,self->stringValues); - accessor_bufr_data_element_set_compressedData(elementAccessor,self->compressedData); - accessor_bufr_data_element_set_type(elementAccessor,self->expanded->v[idx]->type); - accessor_bufr_data_element_set_numberOfSubsets(elementAccessor,self->numberOfSubsets); - accessor_bufr_data_element_set_subsetNumber(elementAccessor,subset); - - self->expanded->v[idx]->a=elementAccessor; - - if (attribute) { - /* attribute->parent=elementAccessor->parent; */ - /* + case 0: + case 1: + creator.name = grib_context_strdup(a->context, self->expanded->v[idx]->shortName); + /* ECC-325: store alloc'd string (due to strdup) for clean up later */ + grib_sarray_push(a->context, self->tempStrings, creator.name); + elementAccessor = grib_accessor_factory(section, &creator, 0, NULL); + if (self->canBeMissing[idx]) + elementAccessor->flags |= GRIB_ACCESSOR_FLAG_CAN_BE_MISSING; + if (self->expanded->v[idx]->code == 31000 || self->expanded->v[idx]->code == 31001 || self->expanded->v[idx]->code == 31002 || self->expanded->v[idx]->code == 31031) + elementAccessor->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + accessor_bufr_data_element_set_index(elementAccessor, ide); + accessor_bufr_data_element_set_descriptors(elementAccessor, self->expanded); + accessor_bufr_data_element_set_elementsDescriptorsIndex(elementAccessor, self->elementsDescriptorsIndex); + accessor_bufr_data_element_set_numericValues(elementAccessor, self->numericValues); + accessor_bufr_data_element_set_stringValues(elementAccessor, self->stringValues); + accessor_bufr_data_element_set_compressedData(elementAccessor, self->compressedData); + accessor_bufr_data_element_set_type(elementAccessor, self->expanded->v[idx]->type); + accessor_bufr_data_element_set_numberOfSubsets(elementAccessor, self->numberOfSubsets); + accessor_bufr_data_element_set_subsetNumber(elementAccessor, subset); + + self->expanded->v[idx]->a = elementAccessor; + + if (attribute) { + /* attribute->parent=elementAccessor->parent; */ + /* for (i=0;iattributes[i]) attribute->attributes[i]->parent=elementAccessor->parent; } */ - grib_accessor_add_attribute(elementAccessor,attribute,0); - } - - attribute=create_attribute_variable("index",section,GRIB_TYPE_LONG,0,0,count,flags); - if (!attribute) return NULL; - grib_accessor_add_attribute(elementAccessor,attribute,0); - - sprintf(code,"%06ld",self->expanded->v[idx]->code); - temp_str = grib_context_strdup(a->context,code); - attribute=create_attribute_variable("code",section,GRIB_TYPE_STRING,temp_str,0,0,flags); - if (!attribute) return NULL; - grib_sarray_push(a->context, self->tempStrings, temp_str);/* ECC-325: store alloc'd string (due to strdup) for clean up later */ - grib_accessor_add_attribute(elementAccessor,attribute,0); - - if (add_extra_attributes) { - attribute=create_attribute_variable("units",section,GRIB_TYPE_STRING,self->expanded->v[idx]->units,0,0,GRIB_ACCESSOR_FLAG_DUMP | flags); - if (!attribute) return NULL; - grib_accessor_add_attribute(elementAccessor,attribute,0); - - attribute=create_attribute_variable("scale",section,GRIB_TYPE_LONG,0,0,self->expanded->v[idx]->scale,flags); - if (!attribute) return NULL; - grib_accessor_add_attribute(elementAccessor,attribute,0); - - attribute=create_attribute_variable("reference",section,GRIB_TYPE_DOUBLE,0,self->expanded->v[idx]->reference,0,flags); - if (!attribute) return NULL; - grib_accessor_add_attribute(elementAccessor,attribute,0); + grib_accessor_add_attribute(elementAccessor, attribute, 0); + } - attribute=create_attribute_variable("width",section,GRIB_TYPE_LONG,0,0,self->expanded->v[idx]->width,flags); - if (!attribute) return NULL; - grib_accessor_add_attribute(elementAccessor,attribute,0); - } - break; - case 2: - set_creator_name(&creator,self->expanded->v[idx]->code); - if (bufr_descriptor_is_marker(self->expanded->v[idx]) ) { + attribute = create_attribute_variable("index", section, GRIB_TYPE_LONG, 0, 0, count, flags); + if (!attribute) + return NULL; + grib_accessor_add_attribute(elementAccessor, attribute, 0); + + sprintf(code, "%06ld", self->expanded->v[idx]->code); + temp_str = grib_context_strdup(a->context, code); + attribute = create_attribute_variable("code", section, GRIB_TYPE_STRING, temp_str, 0, 0, flags); + if (!attribute) + return NULL; + grib_sarray_push(a->context, self->tempStrings, temp_str); /* ECC-325: store alloc'd string (due to strdup) for clean up later */ + grib_accessor_add_attribute(elementAccessor, attribute, 0); + + if (add_extra_attributes) { + attribute = create_attribute_variable("units", section, GRIB_TYPE_STRING, self->expanded->v[idx]->units, 0, 0, GRIB_ACCESSOR_FLAG_DUMP | flags); + if (!attribute) + return NULL; + grib_accessor_add_attribute(elementAccessor, attribute, 0); + + attribute = create_attribute_variable("scale", section, GRIB_TYPE_LONG, 0, 0, self->expanded->v[idx]->scale, flags); + if (!attribute) + return NULL; + grib_accessor_add_attribute(elementAccessor, attribute, 0); + + attribute = create_attribute_variable("reference", section, GRIB_TYPE_DOUBLE, 0, self->expanded->v[idx]->reference, 0, flags); + if (!attribute) + return NULL; + grib_accessor_add_attribute(elementAccessor, attribute, 0); + + attribute = create_attribute_variable("width", section, GRIB_TYPE_LONG, 0, 0, self->expanded->v[idx]->width, flags); + if (!attribute) + return NULL; + grib_accessor_add_attribute(elementAccessor, attribute, 0); + } + break; + case 2: + set_creator_name(&creator, self->expanded->v[idx]->code); + if (bufr_descriptor_is_marker(self->expanded->v[idx])) { + elementAccessor = grib_accessor_factory(section, &creator, 0, NULL); + if (self->canBeMissing[idx]) + elementAccessor->flags |= GRIB_ACCESSOR_FLAG_CAN_BE_MISSING; + accessor_bufr_data_element_set_index(elementAccessor, ide); + accessor_bufr_data_element_set_descriptors(elementAccessor, self->expanded); + accessor_bufr_data_element_set_elementsDescriptorsIndex(elementAccessor, self->elementsDescriptorsIndex); + accessor_bufr_data_element_set_numericValues(elementAccessor, self->numericValues); + accessor_bufr_data_element_set_stringValues(elementAccessor, self->stringValues); + accessor_bufr_data_element_set_compressedData(elementAccessor, self->compressedData); + accessor_bufr_data_element_set_type(elementAccessor, self->expanded->v[idx]->type); + accessor_bufr_data_element_set_numberOfSubsets(elementAccessor, self->numberOfSubsets); + accessor_bufr_data_element_set_subsetNumber(elementAccessor, subset); + + attribute = create_attribute_variable("index", section, GRIB_TYPE_LONG, 0, 0, count, flags); + if (!attribute) + return NULL; + grib_accessor_add_attribute(elementAccessor, attribute, 0); + } + else { + elementAccessor = grib_accessor_factory(section, &operatorCreator, 0, NULL); + accessor_variable_set_type(elementAccessor, GRIB_TYPE_LONG); + + attribute = create_attribute_variable("index", section, GRIB_TYPE_LONG, 0, 0, count, flags); + if (!attribute) + return NULL; + grib_accessor_add_attribute(elementAccessor, attribute, 0); + + sprintf(code, "%06ld", self->expanded->v[idx]->code); + attribute = create_attribute_variable("code", section, GRIB_TYPE_STRING, code, 0, 0, flags); + if (!attribute) + return NULL; + grib_accessor_add_attribute(elementAccessor, attribute, 0); + } + self->expanded->v[idx]->a = elementAccessor; + break; + case 9: + set_creator_name(&creator, self->expanded->v[idx]->code); elementAccessor = grib_accessor_factory(section, &creator, 0, NULL); - if (self->canBeMissing[idx]) elementAccessor->flags |= GRIB_ACCESSOR_FLAG_CAN_BE_MISSING; - accessor_bufr_data_element_set_index(elementAccessor,ide); - accessor_bufr_data_element_set_descriptors(elementAccessor,self->expanded); - accessor_bufr_data_element_set_elementsDescriptorsIndex(elementAccessor,self->elementsDescriptorsIndex); - accessor_bufr_data_element_set_numericValues(elementAccessor,self->numericValues); - accessor_bufr_data_element_set_stringValues(elementAccessor,self->stringValues); - accessor_bufr_data_element_set_compressedData(elementAccessor,self->compressedData); - accessor_bufr_data_element_set_type(elementAccessor,self->expanded->v[idx]->type); - accessor_bufr_data_element_set_numberOfSubsets(elementAccessor,self->numberOfSubsets); - accessor_bufr_data_element_set_subsetNumber(elementAccessor,subset); - - attribute=create_attribute_variable("index",section,GRIB_TYPE_LONG,0,0,count,flags); - if (!attribute) return NULL; - grib_accessor_add_attribute(elementAccessor,attribute,0); - - } else { - elementAccessor = grib_accessor_factory(section, &operatorCreator, 0, NULL); - accessor_variable_set_type(elementAccessor,GRIB_TYPE_LONG); - - attribute=create_attribute_variable("index",section,GRIB_TYPE_LONG,0,0,count,flags); - if (!attribute) return NULL; - grib_accessor_add_attribute(elementAccessor,attribute,0); - - sprintf(code,"%06ld",self->expanded->v[idx]->code); - attribute=create_attribute_variable("code",section,GRIB_TYPE_STRING,code,0,0,flags); - if (!attribute) return NULL; - grib_accessor_add_attribute(elementAccessor,attribute,0); - } - self->expanded->v[idx]->a=elementAccessor; - break; - case 9: - set_creator_name(&creator,self->expanded->v[idx]->code); - elementAccessor = grib_accessor_factory(section, &creator, 0, NULL); - accessor_bufr_data_element_set_index(elementAccessor,ide); - accessor_bufr_data_element_set_descriptors(elementAccessor,self->expanded); - accessor_bufr_data_element_set_elementsDescriptorsIndex(elementAccessor,self->elementsDescriptorsIndex); - accessor_bufr_data_element_set_numericValues(elementAccessor,self->numericValues); - accessor_bufr_data_element_set_stringValues(elementAccessor,self->stringValues); - accessor_bufr_data_element_set_compressedData(elementAccessor,self->compressedData); - accessor_bufr_data_element_set_type(elementAccessor,self->expanded->v[idx]->type); - accessor_bufr_data_element_set_numberOfSubsets(elementAccessor,self->numberOfSubsets); - accessor_bufr_data_element_set_subsetNumber(elementAccessor,subset); - - attribute=create_attribute_variable("index",section,GRIB_TYPE_LONG,0,0,count,flags); - if (!attribute) return NULL; - grib_accessor_add_attribute(elementAccessor,attribute,0); - - sprintf(code,"%06ld",self->expanded->v[idx]->code); - attribute=create_attribute_variable("code",section,GRIB_TYPE_STRING,code,0,0,flags); - if (!attribute) return NULL; - grib_accessor_add_attribute(elementAccessor,attribute,0); - - if (add_extra_attributes) { - attribute=create_attribute_variable("units",section,GRIB_TYPE_STRING,self->expanded->v[idx]->units,0,0,GRIB_ACCESSOR_FLAG_DUMP); - if (!attribute) return NULL; - grib_accessor_add_attribute(elementAccessor,attribute,0); - - attribute=create_attribute_variable("scale",section,GRIB_TYPE_LONG,0,0,self->expanded->v[idx]->scale,flags); - if (!attribute) return NULL; - grib_accessor_add_attribute(elementAccessor,attribute,0); - - attribute=create_attribute_variable("reference",section,GRIB_TYPE_DOUBLE,0,self->expanded->v[idx]->reference,0,flags); - if (!attribute) return NULL; - grib_accessor_add_attribute(elementAccessor,attribute,0); - - attribute=create_attribute_variable("width",section,GRIB_TYPE_LONG,0,0,self->expanded->v[idx]->width,flags); - if (!attribute) return NULL; - grib_accessor_add_attribute(elementAccessor,attribute,0); - } - break; + accessor_bufr_data_element_set_index(elementAccessor, ide); + accessor_bufr_data_element_set_descriptors(elementAccessor, self->expanded); + accessor_bufr_data_element_set_elementsDescriptorsIndex(elementAccessor, self->elementsDescriptorsIndex); + accessor_bufr_data_element_set_numericValues(elementAccessor, self->numericValues); + accessor_bufr_data_element_set_stringValues(elementAccessor, self->stringValues); + accessor_bufr_data_element_set_compressedData(elementAccessor, self->compressedData); + accessor_bufr_data_element_set_type(elementAccessor, self->expanded->v[idx]->type); + accessor_bufr_data_element_set_numberOfSubsets(elementAccessor, self->numberOfSubsets); + accessor_bufr_data_element_set_subsetNumber(elementAccessor, subset); + + attribute = create_attribute_variable("index", section, GRIB_TYPE_LONG, 0, 0, count, flags); + if (!attribute) + return NULL; + grib_accessor_add_attribute(elementAccessor, attribute, 0); + + sprintf(code, "%06ld", self->expanded->v[idx]->code); + attribute = create_attribute_variable("code", section, GRIB_TYPE_STRING, code, 0, 0, flags); + if (!attribute) + return NULL; + grib_accessor_add_attribute(elementAccessor, attribute, 0); + + if (add_extra_attributes) { + attribute = create_attribute_variable("units", section, GRIB_TYPE_STRING, self->expanded->v[idx]->units, 0, 0, GRIB_ACCESSOR_FLAG_DUMP); + if (!attribute) + return NULL; + grib_accessor_add_attribute(elementAccessor, attribute, 0); + + attribute = create_attribute_variable("scale", section, GRIB_TYPE_LONG, 0, 0, self->expanded->v[idx]->scale, flags); + if (!attribute) + return NULL; + grib_accessor_add_attribute(elementAccessor, attribute, 0); + + attribute = create_attribute_variable("reference", section, GRIB_TYPE_DOUBLE, 0, self->expanded->v[idx]->reference, 0, flags); + if (!attribute) + return NULL; + grib_accessor_add_attribute(elementAccessor, attribute, 0); + + attribute = create_attribute_variable("width", section, GRIB_TYPE_LONG, 0, 0, self->expanded->v[idx]->width, flags); + if (!attribute) + return NULL; + grib_accessor_add_attribute(elementAccessor, attribute, 0); + } + break; } return elementAccessor; } -#define IS_QUALIFIER(a) (a==8 || a==1 || a==2 || a==4 || a==5 || a==6 || a==7) +#define IS_QUALIFIER(a) (a == 8 || a == 1 || a == 2 || a == 4 || a == 5 || a == 6 || a == 7) #define NUMBER_OF_QUALIFIERS_PER_CATEGORY 256 #define NUMBER_OF_QUALIFIERS_CATEGORIES 7 #define MAX_NUMBER_OF_BITMAPS 5 -static const int number_of_qualifiers=NUMBER_OF_QUALIFIERS_PER_CATEGORY*NUMBER_OF_QUALIFIERS_CATEGORIES; +static const int number_of_qualifiers = NUMBER_OF_QUALIFIERS_PER_CATEGORY * NUMBER_OF_QUALIFIERS_CATEGORIES; -static GRIB_INLINE int significanceQualifierIndex(int X,int Y) +static GRIB_INLINE int significanceQualifierIndex(int X, int Y) { - int a[]={-1,0,1,-1,2,3,4,5,6}; - int ret=Y+a[X]*NUMBER_OF_QUALIFIERS_PER_CATEGORY; - DebugAssert(ret>0); + int a[] = { -1, 0, 1, -1, 2, 3, 4, 5, 6 }; + int ret = Y + a[X] * NUMBER_OF_QUALIFIERS_PER_CATEGORY; + DebugAssert(ret > 0); return ret; } static GRIB_INLINE void reset_deeper_qualifiers( - grib_accessor* significanceQualifierGroup[], - const int* const significanceQualifierDepth, - int numElements, int depth) + grib_accessor* significanceQualifierGroup[], + const int* const significanceQualifierDepth, + int numElements, int depth) { int i; - for (i=0;idepth) { - significanceQualifierGroup[i]=0; + for (i = 0; i < numElements; i++) { + if (significanceQualifierDepth[i] > depth) { + significanceQualifierGroup[i] = 0; } } } -typedef struct bitmap_s { +typedef struct bitmap_s +{ grib_accessors_list* cursor; grib_accessors_list* referredElement; grib_accessors_list* referredElementStart; } bitmap_s; -static grib_accessor* get_element_from_bitmap(grib_accessor* a,bitmap_s* bitmap) +static grib_accessor* get_element_from_bitmap(grib_accessor* a, bitmap_s* bitmap) { int ret; - long bitmapVal=1; + long bitmapVal = 1; size_t len; while (bitmapVal) { - len=1; + len = 1; if (bitmap->cursor && bitmap->cursor->accessor) { - ret=grib_unpack_long(bitmap->cursor->accessor,&bitmapVal,&len); - } else { + ret = grib_unpack_long(bitmap->cursor->accessor, &bitmapVal, &len); + } + else { return NULL; } - if (ret!=0) return NULL; - bitmap->cursor=bitmap->cursor->next; - if(bitmap->referredElement) bitmap->referredElement=bitmap->referredElement->next; + if (ret != 0) + return NULL; + bitmap->cursor = bitmap->cursor->next; + if (bitmap->referredElement) + bitmap->referredElement = bitmap->referredElement->next; } - return bitmap->referredElement ? bitmap->referredElement->prev->accessor : NULL ; + return bitmap->referredElement ? bitmap->referredElement->prev->accessor : NULL; } /* @@ -2041,67 +2185,70 @@ static GRIB_INLINE void reset_qualifiers(grib_accessor* significanceQualifierGro static void grib_convert_to_attribute(grib_accessor* a) { - if (a->h==NULL && a->parent!=NULL) { - a->h=grib_handle_of_accessor(a); - a->parent=NULL; + if (a->h == NULL && a->parent != NULL) { + a->h = grib_handle_of_accessor(a); + a->parent = NULL; } } -static grib_iarray* set_subset_list(grib_context* c,grib_accessor_bufr_data_array *self,long onlySubset,long startSubset,long endSubset,long* subsetList,size_t subsetListSize) +static grib_iarray* set_subset_list(grib_context* c, grib_accessor_bufr_data_array* self, long onlySubset, long startSubset, long endSubset, long* subsetList, size_t subsetListSize) { - grib_iarray* list=grib_iarray_new(c,self->numberOfSubsets,10); + grib_iarray* list = grib_iarray_new(c, self->numberOfSubsets, 10); long s; - if (startSubset>0) { - s=startSubset; - while (s<=endSubset) { - grib_iarray_push(list,s-1); + if (startSubset > 0) { + s = startSubset; + while (s <= endSubset) { + grib_iarray_push(list, s - 1); s++; } } - if (onlySubset>0) - grib_iarray_push(list,onlySubset-1); + if (onlySubset > 0) + grib_iarray_push(list, onlySubset - 1); - if (subsetList && subsetList[0]>0) { - for (s=0;s 0) { + for (s = 0; s < subsetListSize; s++) + grib_iarray_push(list, subsetList[s] - 1); } - if (grib_iarray_used_size(list)==0) { - for (s=0;snumberOfSubsets;s++) - grib_iarray_push(list,s); + if (grib_iarray_used_size(list) == 0) { + for (s = 0; s < self->numberOfSubsets; s++) + grib_iarray_push(list, s); } return list; } -static int bitmap_ref_skip(grib_accessors_list* al,int* err) +static int bitmap_ref_skip(grib_accessors_list* al, int* err) { - grib_accessor* acode=NULL; + grib_accessor* acode = NULL; long code[1]; - size_t l=1; + size_t l = 1; - if (!al || !al->accessor) return 0; + if (!al || !al->accessor) + return 0; - acode=grib_accessor_get_attribute(al->accessor,"code"); + acode = grib_accessor_get_attribute(al->accessor, "code"); - if (acode) *err=grib_unpack_long(acode,code,&l); - else return 1; + if (acode) + *err = grib_unpack_long(acode, code, &l); + else + return 1; switch (code[0]) { - case 222000: - case 223000: - case 224000: - case 225000: - case 232000: - case 236000: - case 237000: - case 243000: - case 31000: - case 31001: - case 31002: - return 1; + case 222000: + case 223000: + case 224000: + case 225000: + case 232000: + case 236000: + case 237000: + case 243000: + case 31000: + case 31001: + case 31002: + return 1; } return 0; } @@ -2109,32 +2256,35 @@ static int bitmap_ref_skip(grib_accessors_list* al,int* err) /* Return 1 if the descriptor is an operator marking the start of a bitmap */ static int is_bitmap_start_descriptor(grib_accessors_list* al, int* err) { - grib_accessor* acode=NULL; + grib_accessor* acode = NULL; long code[1]; - size_t l=1; - if (!al || !al->accessor) return 0; - - acode=grib_accessor_get_attribute(al->accessor,"code"); - if (acode) *err=grib_unpack_long(acode,code,&l); - else return 1; + size_t l = 1; + if (!al || !al->accessor) + return 0; + + acode = grib_accessor_get_attribute(al->accessor, "code"); + if (acode) + *err = grib_unpack_long(acode, code, &l); + else + return 1; switch (code[0]) { - case 222000: - case 223000: - case 224000: - case 225000: - case 232000: - /*case 236000:*/ - case 237000: - /*case 243000:*/ - { + case 222000: + case 223000: + case 224000: + case 225000: + case 232000: + /*case 236000:*/ + case 237000: + /*case 243000:*/ + { #if 0 long index[1]; grib_accessor* anindex=grib_accessor_get_attribute(al->accessor,"index"); grib_unpack_long(anindex,index,&l); #endif - return 1; - } + return 1; + } } return 0; } @@ -2143,75 +2293,77 @@ static void print_bitmap_debug_info(grib_context* c, bitmap_s* bitmap, grib_acce { int i = 0, ret = 0; fprintf(stderr, "ECCODES DEBUG: bitmap_init: bitmapSize=%d\n", bitmapSize); - bitmap->cursor=bitmapStart->next; - bitmap->referredElement=bitmapStart; + bitmap->cursor = bitmapStart->next; + bitmap->referredElement = bitmapStart; - while (bitmap_ref_skip(bitmap->referredElement,&ret)) { + while (bitmap_ref_skip(bitmap->referredElement, &ret)) { int is_bmp = 0; - if (is_bitmap_start_descriptor(bitmap->referredElement,&ret)) { + if (is_bitmap_start_descriptor(bitmap->referredElement, &ret)) { is_bmp = 1; } - bitmap->referredElement=bitmap->referredElement->prev; + bitmap->referredElement = bitmap->referredElement->prev; if (is_bmp) { break; } } - for (i=1;ireferredElement) { - fprintf(stderr, "ECCODES DEBUG:\t bitmap_init: i=%d |%s|\n", i,bitmap->referredElement->accessor->name); - bitmap->referredElement=bitmap->referredElement->prev; + fprintf(stderr, "ECCODES DEBUG:\t bitmap_init: i=%d |%s|\n", i, bitmap->referredElement->accessor->name); + bitmap->referredElement = bitmap->referredElement->prev; } } } static int bitmap_init(grib_context* c, bitmap_s* bitmap, - grib_accessors_list* bitmapStart, int bitmapSize, grib_accessors_list* lastAccessorInList) + grib_accessors_list* bitmapStart, int bitmapSize, grib_accessors_list* lastAccessorInList) { - int ret=0,i; - bitmap->cursor=bitmapStart->next; - if (bitmap->referredElementStart!=NULL) { - bitmap->referredElement=bitmap->referredElementStart; + int ret = 0, i; + bitmap->cursor = bitmapStart->next; + if (bitmap->referredElementStart != NULL) { + bitmap->referredElement = bitmap->referredElementStart; return ret; } - bitmap->referredElement=bitmapStart; + bitmap->referredElement = bitmapStart; /*while (bitmap_ref_skip(bitmap->referredElement,&ret)) bitmap->referredElement=bitmap->referredElement->prev;*/ /* See ECC-869 * We have to INCLUDE the replication factors that come after the bitmap operators */ - while (bitmap_ref_skip(bitmap->referredElement,&ret)) { + while (bitmap_ref_skip(bitmap->referredElement, &ret)) { int is_bmp = 0; - if (is_bitmap_start_descriptor(bitmap->referredElement,&ret)) { + if (is_bitmap_start_descriptor(bitmap->referredElement, &ret)) { is_bmp = 1; } - bitmap->referredElement=bitmap->referredElement->prev; + bitmap->referredElement = bitmap->referredElement->prev; if (is_bmp) { break; } } /*printf("bitmap_init: bitmapSize=%d\n", bitmapSize);*/ - for (i=1;ireferredElement==NULL) { - grib_context_log(c, GRIB_LOG_ERROR,"bitmap_init: bitmap->referredElement==NULL"); - if (c->debug) print_bitmap_debug_info(c, bitmap, bitmapStart, bitmapSize); + for (i = 1; i < bitmapSize; i++) { + if (bitmap->referredElement == NULL) { + grib_context_log(c, GRIB_LOG_ERROR, "bitmap_init: bitmap->referredElement==NULL"); + if (c->debug) + print_bitmap_debug_info(c, bitmap, bitmapStart, bitmapSize); return GRIB_INTERNAL_ERROR; } /*printf(" bitmap_init: i=%d |%s|\n", i,bitmap->referredElement->accessor->name);*/ - bitmap->referredElement=bitmap->referredElement->prev; + bitmap->referredElement = bitmap->referredElement->prev; } - bitmap->referredElementStart=bitmap->referredElement; + bitmap->referredElementStart = bitmap->referredElement; return ret; } -static grib_accessor* accessor_or_attribute_with_same_name(grib_accessor* a,const char* name) +static grib_accessor* accessor_or_attribute_with_same_name(grib_accessor* a, const char* name) { - if (grib_accessor_has_attributes(a)==0) { + if (grib_accessor_has_attributes(a) == 0) { return a; - } else { - grib_accessor* ok=a; + } + else { + grib_accessor* ok = a; grib_accessor* next; - while ((next=grib_accessor_get_attribute(ok,name))!=NULL) { - ok=next; + while ((next = grib_accessor_get_attribute(ok, name)) != NULL) { + ok = next; } return ok; } @@ -2235,46 +2387,46 @@ static int grib_data_accessors_trie_push(grib_trie_with_rank* accessorsTrie, gri return grib_trie_with_rank_insert(accessorsTrie, a->name, a); } -static int create_keys(grib_accessor* a,long onlySubset,long startSubset,long endSubset) +static int create_keys(grib_accessor* a, long onlySubset, long startSubset, long endSubset) { - grib_accessor_bufr_data_array *self =(grib_accessor_bufr_data_array*)a; - int err=0; + grib_accessor_bufr_data_array* self = (grib_accessor_bufr_data_array*)a; + int err = 0; int rank; - grib_accessor* elementAccessor=0; - grib_accessor* associatedFieldAccessor=0; - grib_accessor* associatedFieldSignificanceAccessor=0; - long iss,end,elementsInSubset,ide; - grib_section* section=NULL; + grib_accessor* elementAccessor = 0; + grib_accessor* associatedFieldAccessor = 0; + grib_accessor* associatedFieldSignificanceAccessor = 0; + long iss, end, elementsInSubset, ide; + grib_section* section = NULL; /*grib_section* rootSection=NULL;*/ bufr_descriptor* descriptor; /*grib_section* sectionUp=0;*/ - grib_section* groupSection=0; - long groupNumber=0; + grib_section* groupSection = 0; + long groupNumber = 0; /*long indexOfGroupNumber=0;*/ int depth; int max_depth = -1; /* highest value of depth */ int idx; - grib_context* c=a->context; - int qualityPresent=0; - bitmap_s bitmap={0,}; - int extraElement=0; + grib_context* c = a->context; + int qualityPresent = 0; + bitmap_s bitmap = {0,}; + int extraElement = 0; int add_extra_attributes = 1; - grib_accessor* gaGroup=0; - grib_action creatorGroup = {0, }; - grib_accessor* significanceQualifierGroup[NUMBER_OF_QUALIFIERS_PER_CATEGORY*NUMBER_OF_QUALIFIERS_CATEGORIES]={0,}; - int significanceQualifierDepth[NUMBER_OF_QUALIFIERS_PER_CATEGORY*NUMBER_OF_QUALIFIERS_CATEGORIES]={0,}; - - grib_accessor* bitmapGroup[MAX_NUMBER_OF_BITMAPS]={0,}; - int bitmapDepth[MAX_NUMBER_OF_BITMAPS]={0,}; - int bitmapSize[MAX_NUMBER_OF_BITMAPS]={0,}; - grib_accessors_list* bitmapStart[MAX_NUMBER_OF_BITMAPS]={0,}; - grib_accessors_list* lastAccessorInList=NULL; - int bitmapIndex=-1; - int incrementBitmapIndex=1; - grib_accessor* elementFromBitmap=NULL; + grib_accessor* gaGroup = 0; + grib_action creatorGroup = {0,}; + grib_accessor* significanceQualifierGroup[NUMBER_OF_QUALIFIERS_PER_CATEGORY * NUMBER_OF_QUALIFIERS_CATEGORIES] = {0,}; + int significanceQualifierDepth[NUMBER_OF_QUALIFIERS_PER_CATEGORY * NUMBER_OF_QUALIFIERS_CATEGORIES] = {0,}; + + grib_accessor* bitmapGroup[MAX_NUMBER_OF_BITMAPS] = {0,}; + int bitmapDepth[MAX_NUMBER_OF_BITMAPS] = {0,}; + int bitmapSize[MAX_NUMBER_OF_BITMAPS] = {0,}; + grib_accessors_list* bitmapStart[MAX_NUMBER_OF_BITMAPS] = {0,}; + grib_accessors_list* lastAccessorInList = NULL; + int bitmapIndex = -1; + int incrementBitmapIndex = 1; + grib_accessor* elementFromBitmap = NULL; /*int reuseBitmap=0;*/ - int dump=1,count=0; + int dump = 1, count = 0; /*int forceGroupClosure=0;*/ creatorGroup.op = "bufr_group"; @@ -2284,254 +2436,264 @@ static int create_keys(grib_accessor* a,long onlySubset,long startSubset,long en creatorGroup.set = 0; if (self->dataAccessors) { - grib_accessors_list_delete(c,self->dataAccessors); + grib_accessors_list_delete(c, self->dataAccessors); } - self->dataAccessors=grib_accessors_list_create(c); + self->dataAccessors = grib_accessors_list_create(c); if (self->dataAccessorsTrie) { grib_trie_with_rank_delete(self->dataAccessorsTrie); } - self->dataAccessorsTrie=grib_trie_with_rank_new(c); + self->dataAccessorsTrie = grib_trie_with_rank_new(c); if (self->tempStrings) { grib_sarray_delete_content(c, self->tempStrings); - grib_sarray_delete (c, self->tempStrings); - self->tempStrings=NULL; + grib_sarray_delete(c, self->tempStrings); + self->tempStrings = NULL; } self->tempStrings = grib_sarray_new(c, self->numberOfSubsets, 500); - end= self->compressedData ? 1 : self->numberOfSubsets; - groupNumber=1; + end = self->compressedData ? 1 : self->numberOfSubsets; + groupNumber = 1; - gaGroup = grib_accessor_factory(self->dataKeys, &creatorGroup, 0, NULL); - gaGroup->bufr_group_number=groupNumber; - gaGroup->sub_section=grib_section_create(grib_handle_of_accessor(a),gaGroup); - section=gaGroup->sub_section; + gaGroup = grib_accessor_factory(self->dataKeys, &creatorGroup, 0, NULL); + gaGroup->bufr_group_number = groupNumber; + gaGroup->sub_section = grib_section_create(grib_handle_of_accessor(a), gaGroup); + section = gaGroup->sub_section; /*rootSection=section;*/ /*sectionUp=self->dataKeys;*/ - accessor_constant_set_type(gaGroup,GRIB_TYPE_LONG); - accessor_constant_set_dval(gaGroup,groupNumber); + accessor_constant_set_type(gaGroup, GRIB_TYPE_LONG); + accessor_constant_set_dval(gaGroup, groupNumber); /* ECC-765: Don't empty out the section_4 keys otherwise there will be memory leaks. */ /* Setting first and last to zero effectively masks out those section 4 keys! */ /* self->dataKeys->block->first=0; */ /* self->dataKeys->block->last=0; */ - grib_push_accessor(gaGroup,self->dataKeys->block);/* Add group accessors to section 4 */ + grib_push_accessor(gaGroup, self->dataKeys->block); /* Add group accessors to section 4 */ /*indexOfGroupNumber=0;*/ - depth=0; - extraElement=0; + depth = 0; + extraElement = 0; add_extra_attributes = adding_extra_key_attributes(grib_handle_of_accessor(a)); - for (iss=0;isscompressedData ? grib_iarray_used_size(self->elementsDescriptorsIndex->v[0]) : - grib_iarray_used_size(self->elementsDescriptorsIndex->v[iss]); + elementsInSubset = self->compressedData ? grib_iarray_used_size(self->elementsDescriptorsIndex->v[0]) : grib_iarray_used_size(self->elementsDescriptorsIndex->v[iss]); /*if (associatedFieldAccessor) grib_accessor_delete(c, associatedFieldAccessor);*/ - associatedFieldAccessor=NULL; - if(associatedFieldSignificanceAccessor) { + associatedFieldAccessor = NULL; + if (associatedFieldSignificanceAccessor) { grib_accessor_delete(c, associatedFieldSignificanceAccessor); - associatedFieldSignificanceAccessor=NULL; + associatedFieldSignificanceAccessor = NULL; } - for (ide=0;idecompressedData ? self->elementsDescriptorsIndex->v[0]->v[ide] : - self->elementsDescriptorsIndex->v[iss]->v[ide] ; + for (ide = 0; ide < elementsInSubset; ide++) { + idx = self->compressedData ? self->elementsDescriptorsIndex->v[0]->v[ide] : self->elementsDescriptorsIndex->v[iss]->v[ide]; - descriptor=self->expanded->v[idx]; - if (descriptor->nokey==1) { - continue; /* Descriptor does not have an associated key e.g. inside op 203YYY */ + descriptor = self->expanded->v[idx]; + if (descriptor->nokey == 1) { + continue; /* Descriptor does not have an associated key e.g. inside op 203YYY */ } - elementFromBitmap=NULL; - if (descriptor->F==0 && IS_QUALIFIER(descriptor->X) && - self->unpackMode==CODES_BUFR_UNPACK_STRUCTURE) { - int sidx=significanceQualifierIndex(descriptor->X,descriptor->Y); + elementFromBitmap = NULL; + if (descriptor->F == 0 && IS_QUALIFIER(descriptor->X) && + self->unpackMode == CODES_BUFR_UNPACK_STRUCTURE) { + int sidx = significanceQualifierIndex(descriptor->X, descriptor->Y); groupNumber++; if (significanceQualifierGroup[sidx]) { - groupSection=significanceQualifierGroup[sidx]->parent; - depth=significanceQualifierDepth[sidx]; + groupSection = significanceQualifierGroup[sidx]->parent; + depth = significanceQualifierDepth[sidx]; if (depth < max_depth) { /* If depth >= max_depth, then no entry will be deeper so no need for call */ - reset_deeper_qualifiers(significanceQualifierGroup,significanceQualifierDepth, - number_of_qualifiers,depth); + reset_deeper_qualifiers(significanceQualifierGroup, significanceQualifierDepth, + number_of_qualifiers, depth); } - } else { + } + else { /* if (forceGroupClosure) { */ /* groupSection=sectionUp; */ /* forceGroupClosure=0; */ /* depth=0; */ /* } else { */ - groupSection=section; + groupSection = section; depth++; /* } */ } - gaGroup = grib_accessor_factory(groupSection, &creatorGroup, 0, NULL); - gaGroup->sub_section=grib_section_create(grib_handle_of_accessor(a),gaGroup); - gaGroup->bufr_group_number=groupNumber; - accessor_constant_set_type(gaGroup,GRIB_TYPE_LONG); - accessor_constant_set_dval(gaGroup,groupNumber); - grib_push_accessor(gaGroup,groupSection->block); + gaGroup = grib_accessor_factory(groupSection, &creatorGroup, 0, NULL); + gaGroup->sub_section = grib_section_create(grib_handle_of_accessor(a), gaGroup); + gaGroup->bufr_group_number = groupNumber; + accessor_constant_set_type(gaGroup, GRIB_TYPE_LONG); + accessor_constant_set_dval(gaGroup, groupNumber); + grib_push_accessor(gaGroup, groupSection->block); - section=gaGroup->sub_section; + section = gaGroup->sub_section; /*sectionUp=gaGroup->parent;*/ - significanceQualifierGroup[sidx]=gaGroup; - significanceQualifierDepth[sidx]=depth; - if (depth > max_depth) max_depth = depth; - incrementBitmapIndex=1; - dump=1; - } else if (descriptor->code == 31031 && incrementBitmapIndex!=0) { + significanceQualifierGroup[sidx] = gaGroup; + significanceQualifierDepth[sidx] = depth; + if (depth > max_depth) + max_depth = depth; + incrementBitmapIndex = 1; + dump = 1; + } + else if (descriptor->code == 31031 && incrementBitmapIndex != 0) { /* bitmap */ bitmapIndex++; groupNumber++; - incrementBitmapIndex=0; + incrementBitmapIndex = 0; if (bitmapIndex >= MAX_NUMBER_OF_BITMAPS) { grib_context_log(c, GRIB_LOG_ERROR, "Bitmap error: bitmap index=%d, max num bitmaps=%d\n", bitmapIndex, MAX_NUMBER_OF_BITMAPS); err = GRIB_DECODING_ERROR; return err; } - bitmapStart[bitmapIndex]=grib_accessors_list_last(self->dataAccessors); - bitmapSize[bitmapIndex]=1; - if (self->expanded->v[idx-1]->code ==31002 || self->expanded->v[idx-1]->code==31001) - extraElement+=1; + bitmapStart[bitmapIndex] = grib_accessors_list_last(self->dataAccessors); + bitmapSize[bitmapIndex] = 1; + if (self->expanded->v[idx - 1]->code == 31002 || self->expanded->v[idx - 1]->code == 31001) + extraElement += 1; if (bitmapGroup[bitmapIndex]) { - groupSection=bitmapGroup[bitmapIndex]->parent; - depth=bitmapDepth[bitmapIndex]; - reset_deeper_qualifiers(significanceQualifierGroup,significanceQualifierDepth, - number_of_qualifiers,depth); + groupSection = bitmapGroup[bitmapIndex]->parent; + depth = bitmapDepth[bitmapIndex]; + reset_deeper_qualifiers(significanceQualifierGroup, significanceQualifierDepth, + number_of_qualifiers, depth); /* TODO: This branch is not reached in our tests! */ - reset_deeper_qualifiers(bitmapGroup,bitmapDepth,MAX_NUMBER_OF_BITMAPS,depth); - } else { - groupSection=section; + reset_deeper_qualifiers(bitmapGroup, bitmapDepth, MAX_NUMBER_OF_BITMAPS, depth); + } + else { + groupSection = section; depth++; } - gaGroup = grib_accessor_factory(groupSection, &creatorGroup, 0, NULL); - gaGroup->sub_section=grib_section_create(grib_handle_of_accessor(a),gaGroup); - gaGroup->bufr_group_number=groupNumber; - accessor_constant_set_type(gaGroup,GRIB_TYPE_LONG); - accessor_constant_set_dval(gaGroup,groupNumber); - grib_push_accessor(gaGroup,groupSection->block); - - section=gaGroup->sub_section; + gaGroup = grib_accessor_factory(groupSection, &creatorGroup, 0, NULL); + gaGroup->sub_section = grib_section_create(grib_handle_of_accessor(a), gaGroup); + gaGroup->bufr_group_number = groupNumber; + accessor_constant_set_type(gaGroup, GRIB_TYPE_LONG); + accessor_constant_set_dval(gaGroup, groupNumber); + grib_push_accessor(gaGroup, groupSection->block); + + section = gaGroup->sub_section; /*sectionUp=gaGroup->parent;*/ - bitmapGroup[bitmapIndex]=gaGroup; - bitmapDepth[bitmapIndex]=depth; - dump=1; - } else if (descriptor->code == 31031) { - dump=1; + bitmapGroup[bitmapIndex] = gaGroup; + bitmapDepth[bitmapIndex] = depth; + dump = 1; + } + else if (descriptor->code == 31031) { + dump = 1; bitmapSize[bitmapIndex]++; - bitmap.cursor=0; - } else if (descriptor->code == 222000 || descriptor->code == 223000 || descriptor->code == 224000 || descriptor->code == 225000 ) { - bitmap.referredElement=NULL; - qualityPresent=1; - incrementBitmapIndex=1; - dump=1; - bitmap.cursor=0; - extraElement+=1; - } else if (descriptor->code == 236000 || descriptor->code == 237000 ) { - bitmap.referredElement=NULL; - bitmap.cursor=0; + bitmap.cursor = 0; + } + else if (descriptor->code == 222000 || descriptor->code == 223000 || descriptor->code == 224000 || descriptor->code == 225000) { + bitmap.referredElement = NULL; + qualityPresent = 1; + incrementBitmapIndex = 1; + dump = 1; + bitmap.cursor = 0; + extraElement += 1; + } + else if (descriptor->code == 236000 || descriptor->code == 237000) { + bitmap.referredElement = NULL; + bitmap.cursor = 0; /*reuseBitmap=1;*/ - extraElement+=1; - dump=1; - } else if (descriptor->code == 237255 ) { + extraElement += 1; + dump = 1; + } + else if (descriptor->code == 237255) { /*reuseBitmap=0;*/ - incrementBitmapIndex=1; - bitmap.cursor=0; - dump=1; - } else if ( ( descriptor->X==33 || bufr_descriptor_is_marker(descriptor) ) && qualityPresent) { + incrementBitmapIndex = 1; + bitmap.cursor = 0; + dump = 1; + } + else if ((descriptor->X == 33 || bufr_descriptor_is_marker(descriptor)) && qualityPresent) { if (!bitmap.referredElement) - bitmap_init(c, &bitmap,bitmapStart[bitmapIndex],bitmapSize[bitmapIndex],lastAccessorInList); - elementFromBitmap=get_element_from_bitmap(a,&bitmap); - dump=1; + bitmap_init(c, &bitmap, bitmapStart[bitmapIndex], bitmapSize[bitmapIndex], lastAccessorInList); + elementFromBitmap = get_element_from_bitmap(a, &bitmap); + dump = 1; /* } else if ( descriptor->Y==1 && IS_QUALIFIER(self->expanded->v[idx-1]->X)==0) { */ /* forceGroupClosure=1; */ /* reset_qualifiers(significanceQualifierGroup); */ - } else if (descriptor->X==33 && !qualityPresent) { - dump=1; /* ECC-690: percentConfidence WITHOUT a bitmap! e.g. NOAA GOES16 BUFR */ + } + else if (descriptor->X == 33 && !qualityPresent) { + dump = 1; /* ECC-690: percentConfidence WITHOUT a bitmap! e.g. NOAA GOES16 BUFR */ } - if (ide==0 && !self->compressedData) { - grib_accessor* asn=NULL; - long subsetNumber=iss+1; - size_t len=1; - grib_action creatorsn = {0, }; + if (ide == 0 && !self->compressedData) { + grib_accessor* asn = NULL; + long subsetNumber = iss + 1; + size_t len = 1; + grib_action creatorsn = {0,}; creatorsn.op = "variable"; creatorsn.name_space = ""; - creatorsn.flags = GRIB_ACCESSOR_FLAG_READ_ONLY | GRIB_ACCESSOR_FLAG_DUMP ; + creatorsn.flags = GRIB_ACCESSOR_FLAG_READ_ONLY | GRIB_ACCESSOR_FLAG_DUMP; creatorsn.set = 0; - creatorsn.name="subsetNumber"; - asn=grib_accessor_factory(section, &creatorsn, 0, NULL); - accessor_variable_set_type(asn,GRIB_TYPE_LONG); - grib_pack_long(asn,&subsetNumber,&len); + creatorsn.name = "subsetNumber"; + asn = grib_accessor_factory(section, &creatorsn, 0, NULL); + accessor_variable_set_type(asn, GRIB_TYPE_LONG); + grib_pack_long(asn, &subsetNumber, &len); - grib_push_accessor(asn,section->block); - rank=grib_data_accessors_trie_push(self->dataAccessorsTrie,asn); - grib_accessors_list_push(self->dataAccessors,asn,rank); + grib_push_accessor(asn, section->block); + rank = grib_data_accessors_trie_push(self->dataAccessorsTrie, asn); + grib_accessors_list_push(self->dataAccessors, asn, rank); } count++; - elementAccessor=create_accessor_from_descriptor(a,associatedFieldAccessor,section,ide,iss,dump,count,add_extra_attributes); + elementAccessor = create_accessor_from_descriptor(a, associatedFieldAccessor, section, ide, iss, dump, count, add_extra_attributes); if (!elementAccessor) { err = GRIB_DECODING_ERROR; return err; } /*if (associatedFieldAccessor) grib_accessor_delete(c, associatedFieldAccessor);*/ - associatedFieldAccessor=NULL; - if (elementFromBitmap && self->unpackMode==CODES_BUFR_UNPACK_STRUCTURE) { - if (descriptor->code != 33007 && descriptor->code != 223255 ) { - char* aname = grib_context_strdup(c,elementFromBitmap->name); - grib_accessor* newAccessor=grib_accessor_clone(elementAccessor,section,&err); - newAccessor->parent=groupSection; - newAccessor->name=aname; + associatedFieldAccessor = NULL; + if (elementFromBitmap && self->unpackMode == CODES_BUFR_UNPACK_STRUCTURE) { + if (descriptor->code != 33007 && descriptor->code != 223255) { + char* aname = grib_context_strdup(c, elementFromBitmap->name); + grib_accessor* newAccessor = grib_accessor_clone(elementAccessor, section, &err); + newAccessor->parent = groupSection; + newAccessor->name = aname; grib_sarray_push(a->context, self->tempStrings, aname); - grib_push_accessor(newAccessor,groupSection->block); - rank=grib_data_accessors_trie_push(self->dataAccessorsTrie,newAccessor); - grib_accessors_list_push(self->dataAccessors,newAccessor,rank); + grib_push_accessor(newAccessor, groupSection->block); + rank = grib_data_accessors_trie_push(self->dataAccessorsTrie, newAccessor); + grib_accessors_list_push(self->dataAccessors, newAccessor, rank); } - err=grib_accessor_add_attribute(accessor_or_attribute_with_same_name(elementFromBitmap,elementAccessor->name),elementAccessor,1); - } else if (elementAccessor) { + err = grib_accessor_add_attribute(accessor_or_attribute_with_same_name(elementFromBitmap, elementAccessor->name), elementAccessor, 1); + } + else if (elementAccessor) { int add_key = 1; switch (descriptor->code) { - case 999999: - /*if (associatedFieldAccessor) grib_accessor_delete(c, associatedFieldAccessor);*/ - associatedFieldAccessor=elementAccessor; - grib_convert_to_attribute(associatedFieldAccessor); - if (associatedFieldSignificanceAccessor) { - grib_accessor* newAccessor=grib_accessor_clone(associatedFieldSignificanceAccessor,section,&err); - if (err) { - grib_context_log(a->context,GRIB_LOG_ERROR,"unable to clone accessor '%s'\n",associatedFieldSignificanceAccessor->name); - return err; + case 999999: + /*if (associatedFieldAccessor) grib_accessor_delete(c, associatedFieldAccessor);*/ + associatedFieldAccessor = elementAccessor; + grib_convert_to_attribute(associatedFieldAccessor); + if (associatedFieldSignificanceAccessor) { + grib_accessor* newAccessor = grib_accessor_clone(associatedFieldSignificanceAccessor, section, &err); + if (err) { + grib_context_log(a->context, GRIB_LOG_ERROR, "unable to clone accessor '%s'\n", associatedFieldSignificanceAccessor->name); + return err; + } + grib_accessor_add_attribute(associatedFieldAccessor, newAccessor, 1); } - grib_accessor_add_attribute(associatedFieldAccessor,newAccessor,1); - } - break; - case 31021: - if(associatedFieldSignificanceAccessor) grib_accessor_delete(c, associatedFieldSignificanceAccessor); - associatedFieldSignificanceAccessor=elementAccessor; - break; - /*case 33007:*/ - /* ECC-690: See later */ - /* break; */ - default: - add_key = 1; - /* ECC-690: percentConfidence WITHOUT a bitmap! e.g. NOAA GOES16 BUFR */ - if(descriptor->code==33007) { - add_key = 0; /* Standard behaviour */ - if (!qualityPresent) { - add_key = 1; + break; + case 31021: + if (associatedFieldSignificanceAccessor) + grib_accessor_delete(c, associatedFieldSignificanceAccessor); + associatedFieldSignificanceAccessor = elementAccessor; + break; + /*case 33007:*/ + /* ECC-690: See later */ + /* break; */ + default: + add_key = 1; + /* ECC-690: percentConfidence WITHOUT a bitmap! e.g. NOAA GOES16 BUFR */ + if (descriptor->code == 33007) { + add_key = 0; /* Standard behaviour */ + if (!qualityPresent) { + add_key = 1; + } + } + if (add_key) { + grib_push_accessor(elementAccessor, section->block); + rank = grib_data_accessors_trie_push(self->dataAccessorsTrie, elementAccessor); + grib_accessors_list_push(self->dataAccessors, elementAccessor, rank); + lastAccessorInList = grib_accessors_list_last(self->dataAccessors); } - } - if (add_key) { - grib_push_accessor(elementAccessor,section->block); - rank=grib_data_accessors_trie_push(self->dataAccessorsTrie,elementAccessor); - grib_accessors_list_push(self->dataAccessors,elementAccessor,rank); - lastAccessorInList=grib_accessors_list_last(self->dataAccessors); - } } } } @@ -2540,548 +2702,620 @@ static int create_keys(grib_accessor* a,long onlySubset,long startSubset,long en return err; } -static void set_input_replications(grib_handle* h,grib_accessor_bufr_data_array *self) +static void set_input_replications(grib_handle* h, grib_accessor_bufr_data_array* self) { size_t nInputReplications; size_t nInputExtendedReplications; size_t nInputShortReplications; - self->nInputReplications=-1; - self->nInputExtendedReplications=-1; - self->nInputShortReplications=-1; - self->iInputReplications=0; - self->iInputExtendedReplications=0; - self->iInputShortReplications=0; - if (grib_get_size(h,"inputDelayedDescriptorReplicationFactor",&nInputReplications)==0 && nInputReplications!=0) { - if (self->inputReplications) grib_context_free(h->context,self->inputReplications); - self->inputReplications=(long*)grib_context_malloc_clear(h->context,sizeof(long)*nInputReplications); - grib_get_long_array(h,"inputDelayedDescriptorReplicationFactor",self->inputReplications,&nInputReplications); + self->nInputReplications = -1; + self->nInputExtendedReplications = -1; + self->nInputShortReplications = -1; + self->iInputReplications = 0; + self->iInputExtendedReplications = 0; + self->iInputShortReplications = 0; + if (grib_get_size(h, "inputDelayedDescriptorReplicationFactor", &nInputReplications) == 0 && nInputReplications != 0) { + if (self->inputReplications) + grib_context_free(h->context, self->inputReplications); + self->inputReplications = (long*)grib_context_malloc_clear(h->context, sizeof(long) * nInputReplications); + grib_get_long_array(h, "inputDelayedDescriptorReplicationFactor", self->inputReplications, &nInputReplications); /* default-> no input replications*/ - if (self->inputReplications[0]<0) self->nInputReplications=-1; - else self->nInputReplications=nInputReplications; - } - if (grib_get_size(h,"inputExtendedDelayedDescriptorReplicationFactor",&nInputExtendedReplications)==0 && nInputExtendedReplications!=0) { - if (self->inputExtendedReplications) grib_context_free(h->context,self->inputExtendedReplications); - self->inputExtendedReplications=(long*)grib_context_malloc_clear(h->context,sizeof(long)*nInputExtendedReplications); - grib_get_long_array(h,"inputExtendedDelayedDescriptorReplicationFactor",self->inputExtendedReplications,&nInputExtendedReplications); + if (self->inputReplications[0] < 0) + self->nInputReplications = -1; + else + self->nInputReplications = nInputReplications; + } + if (grib_get_size(h, "inputExtendedDelayedDescriptorReplicationFactor", &nInputExtendedReplications) == 0 && nInputExtendedReplications != 0) { + if (self->inputExtendedReplications) + grib_context_free(h->context, self->inputExtendedReplications); + self->inputExtendedReplications = (long*)grib_context_malloc_clear(h->context, sizeof(long) * nInputExtendedReplications); + grib_get_long_array(h, "inputExtendedDelayedDescriptorReplicationFactor", self->inputExtendedReplications, &nInputExtendedReplications); /* default-> no input replications*/ - if (self->inputExtendedReplications[0]<0) self->nInputExtendedReplications=-1; - else self->nInputExtendedReplications=nInputExtendedReplications; - } - if (grib_get_size(h,"inputShortDelayedDescriptorReplicationFactor",&nInputShortReplications)==0 && nInputShortReplications!=0) { - if (self->inputShortReplications) grib_context_free(h->context,self->inputShortReplications); - self->inputShortReplications=(long*)grib_context_malloc_clear(h->context,sizeof(long)*nInputShortReplications); - grib_get_long_array(h,"inputShortDelayedDescriptorReplicationFactor",self->inputShortReplications,&nInputShortReplications); + if (self->inputExtendedReplications[0] < 0) + self->nInputExtendedReplications = -1; + else + self->nInputExtendedReplications = nInputExtendedReplications; + } + if (grib_get_size(h, "inputShortDelayedDescriptorReplicationFactor", &nInputShortReplications) == 0 && nInputShortReplications != 0) { + if (self->inputShortReplications) + grib_context_free(h->context, self->inputShortReplications); + self->inputShortReplications = (long*)grib_context_malloc_clear(h->context, sizeof(long) * nInputShortReplications); + grib_get_long_array(h, "inputShortDelayedDescriptorReplicationFactor", self->inputShortReplications, &nInputShortReplications); /* default-> no input replications*/ - if (self->inputShortReplications[0]<0) self->nInputShortReplications=-1; - else self->nInputShortReplications=nInputShortReplications; + if (self->inputShortReplications[0] < 0) + self->nInputShortReplications = -1; + else + self->nInputShortReplications = nInputShortReplications; } } -static void set_input_bitmap(grib_handle* h,grib_accessor_bufr_data_array *self) +static void set_input_bitmap(grib_handle* h, grib_accessor_bufr_data_array* self) { size_t nInputBitmap; - self->nInputBitmap=-1; - self->iInputBitmap=0; - if (grib_get_size(h,"inputDataPresentIndicator",&nInputBitmap)==0 && nInputBitmap!=0) { - if (self->inputBitmap) grib_context_free(h->context,self->inputBitmap); - self->inputBitmap=(double*)grib_context_malloc_clear(h->context,sizeof(double)*nInputBitmap); - grib_get_double_array(h,"inputDataPresentIndicator",self->inputBitmap,&nInputBitmap); + self->nInputBitmap = -1; + self->iInputBitmap = 0; + if (grib_get_size(h, "inputDataPresentIndicator", &nInputBitmap) == 0 && nInputBitmap != 0) { + if (self->inputBitmap) + grib_context_free(h->context, self->inputBitmap); + self->inputBitmap = (double*)grib_context_malloc_clear(h->context, sizeof(double) * nInputBitmap); + grib_get_double_array(h, "inputDataPresentIndicator", self->inputBitmap, &nInputBitmap); /* default-> no input bitmap*/ - if (self->inputBitmap[0]<0) self->nInputBitmap=-1; - else self->nInputBitmap=nInputBitmap; + if (self->inputBitmap[0] < 0) + self->nInputBitmap = -1; + else + self->nInputBitmap = nInputBitmap; } } static int set_to_missing_if_out_of_range(grib_handle* h) { /* First check if the transient key is set */ - long setToMissingIfOutOfRange=0; - if (grib_get_long(h, "setToMissingIfOutOfRange", &setToMissingIfOutOfRange)==GRIB_SUCCESS && - setToMissingIfOutOfRange != 0) - { + long setToMissingIfOutOfRange = 0; + if (grib_get_long(h, "setToMissingIfOutOfRange", &setToMissingIfOutOfRange) == GRIB_SUCCESS && + setToMissingIfOutOfRange != 0) { return 1; } /* Then check the environment variable via the context */ return h->context->bufr_set_to_missing_if_out_of_range; } -static int process_elements(grib_accessor* a,int flag,long onlySubset,long startSubset,long endSubset) +static int process_elements(grib_accessor* a, int flag, long onlySubset, long startSubset, long endSubset) { - int err=0; - long inr,innr,ir,ip; - long n[MAX_NESTED_REPLICATIONS]={0,}; - long nn[MAX_NESTED_REPLICATIONS]={0,}; - long numberOfElementsToRepeat[MAX_NESTED_REPLICATIONS]={0,}; - long numberOfRepetitions[MAX_NESTED_REPLICATIONS]={0,}; - long startRepetition[MAX_NESTED_REPLICATIONS]={0,}; - long numberOfNestedRepetitions=0; - unsigned char* data=0; - size_t subsetListSize=0; - long* subsetList=0; + int err = 0; + long inr, innr, ir, ip; + long n[MAX_NESTED_REPLICATIONS] = {0,}; + long nn[MAX_NESTED_REPLICATIONS] = {0,}; + long numberOfElementsToRepeat[MAX_NESTED_REPLICATIONS] = {0,}; + long numberOfRepetitions[MAX_NESTED_REPLICATIONS] = {0,}; + long startRepetition[MAX_NESTED_REPLICATIONS] = {0,}; + long numberOfNestedRepetitions = 0; + unsigned char* data = 0; + size_t subsetListSize = 0; + long* subsetList = 0; int i; - grib_iarray* elementsDescriptorsIndex=0; + grib_iarray* elementsDescriptorsIndex = 0; - long pos=0,dataOffset=0; - long iiss,iss,end,elementIndex,index; + long pos = 0, dataOffset = 0; + long iiss, iss, end, elementIndex, index; long numberOfDescriptors; long totalSize; - bufr_descriptor** descriptors=0; + bufr_descriptor** descriptors = 0; long icount; - int decoding=0,do_clean=1; - grib_buffer* buffer=NULL; + int decoding = 0, do_clean = 1; + grib_buffer* buffer = NULL; codec_element_proc codec_element; codec_replication_proc codec_replication; - grib_accessor* dataAccessor=NULL; - bufr_descriptor* bd=0; + grib_accessor* dataAccessor = NULL; + bufr_descriptor* bd = 0; - grib_darray* dval = NULL; - grib_sarray* sval = NULL; - grib_accessor_bufr_data_array *self =(grib_accessor_bufr_data_array*)a; + grib_darray* dval = NULL; + grib_sarray* sval = NULL; + grib_accessor_bufr_data_array* self = (grib_accessor_bufr_data_array*)a; - grib_handle* h=grib_handle_of_accessor(a); - grib_context* c=h->context; + grib_handle* h = grib_handle_of_accessor(a); + grib_context* c = h->context; - totalSize=self->bitsToEndData; + totalSize = self->bitsToEndData; switch (flag) { - case PROCESS_DECODE: - if (!self->do_decode) return 0; - self->do_decode=0; - buffer=h->buffer; - decoding=1; - do_clean=1; - dataAccessor=grib_find_accessor(grib_handle_of_accessor(a),self->bufrDataEncodedName); - DebugAssert(dataAccessor); - dataOffset=accessor_raw_get_offset(dataAccessor); - pos=dataOffset*8; - codec_element=&decode_element; - codec_replication=&decode_replication; - break; - case PROCESS_NEW_DATA: - buffer=grib_create_growable_buffer(c); - decoding=0; - do_clean=1; - self->do_decode=1; - self->set_to_missing_if_out_of_range = set_to_missing_if_out_of_range(h); - pos=0; - codec_element=&encode_new_element; - codec_replication=&encode_new_replication; - - set_input_replications(h,self); - set_input_bitmap(h,self); - - break; - case PROCESS_ENCODE: - buffer=grib_create_growable_buffer(c); - decoding=0; - do_clean=0; - self->do_decode=0; - self->set_to_missing_if_out_of_range = set_to_missing_if_out_of_range(h); - pos=0; - codec_element=&encode_element; - grib_get_long(grib_handle_of_accessor(a),"extractSubset",&onlySubset); - grib_get_long(grib_handle_of_accessor(a),"extractSubsetIntervalStart",&startSubset); - grib_get_long(grib_handle_of_accessor(a),"extractSubsetIntervalEnd",&endSubset); - err=grib_get_size(grib_handle_of_accessor(a),"extractSubsetList",&subsetListSize); - if (err) return err; - if (subsetList) grib_context_free(c,subsetList); - subsetList=(long*)grib_context_malloc_clear(c,subsetListSize*sizeof(long)); - err=grib_get_long_array(grib_handle_of_accessor(a),"extractSubsetList",subsetList,&subsetListSize); - if (err) return err; - - codec_replication=&encode_replication; - break; - default : - return GRIB_NOT_IMPLEMENTED; + case PROCESS_DECODE: + if (!self->do_decode) + return 0; + self->do_decode = 0; + buffer = h->buffer; + decoding = 1; + do_clean = 1; + dataAccessor = grib_find_accessor(grib_handle_of_accessor(a), self->bufrDataEncodedName); + DebugAssert(dataAccessor); + dataOffset = accessor_raw_get_offset(dataAccessor); + pos = dataOffset * 8; + codec_element = &decode_element; + codec_replication = &decode_replication; + break; + case PROCESS_NEW_DATA: + buffer = grib_create_growable_buffer(c); + decoding = 0; + do_clean = 1; + self->do_decode = 1; + self->set_to_missing_if_out_of_range = set_to_missing_if_out_of_range(h); + pos = 0; + codec_element = &encode_new_element; + codec_replication = &encode_new_replication; + + set_input_replications(h, self); + set_input_bitmap(h, self); + + break; + case PROCESS_ENCODE: + buffer = grib_create_growable_buffer(c); + decoding = 0; + do_clean = 0; + self->do_decode = 0; + self->set_to_missing_if_out_of_range = set_to_missing_if_out_of_range(h); + pos = 0; + codec_element = &encode_element; + grib_get_long(grib_handle_of_accessor(a), "extractSubset", &onlySubset); + grib_get_long(grib_handle_of_accessor(a), "extractSubsetIntervalStart", &startSubset); + grib_get_long(grib_handle_of_accessor(a), "extractSubsetIntervalEnd", &endSubset); + err = grib_get_size(grib_handle_of_accessor(a), "extractSubsetList", &subsetListSize); + if (err) + return err; + if (subsetList) + grib_context_free(c, subsetList); + subsetList = (long*)grib_context_malloc_clear(c, subsetListSize * sizeof(long)); + err = grib_get_long_array(grib_handle_of_accessor(a), "extractSubsetList", subsetList, &subsetListSize); + if (err) + return err; + + codec_replication = &encode_replication; + break; + default: + return GRIB_NOT_IMPLEMENTED; } data = buffer->data; - err=get_descriptors(a); - if (err) return err; + err = get_descriptors(a); + if (err) + return err; - descriptors=self->expanded->v; + descriptors = self->expanded->v; - if (do_clean==1 && self->numericValues) { - grib_vdarray_delete_content(c,self->numericValues); - grib_vdarray_delete(c,self->numericValues); - grib_vsarray_delete_content(c,self->stringValues); - grib_vsarray_delete(c,self->stringValues); + if (do_clean == 1 && self->numericValues) { + grib_vdarray_delete_content(c, self->numericValues); + grib_vdarray_delete(c, self->numericValues); + grib_vsarray_delete_content(c, self->stringValues); + grib_vsarray_delete(c, self->stringValues); } - if (flag!=PROCESS_ENCODE) { - self->numericValues=grib_vdarray_new(c,1000,1000); - self->stringValues=grib_vsarray_new(c,10,10); + if (flag != PROCESS_ENCODE) { + self->numericValues = grib_vdarray_new(c, 1000, 1000); + self->stringValues = grib_vsarray_new(c, 10, 10); - if (self->elementsDescriptorsIndex) grib_viarray_delete(c,self->elementsDescriptorsIndex); - self->elementsDescriptorsIndex=grib_viarray_new(c,100,100); + if (self->elementsDescriptorsIndex) + grib_viarray_delete(c, self->elementsDescriptorsIndex); + self->elementsDescriptorsIndex = grib_viarray_new(c, 100, 100); } - if (flag != PROCESS_DECODE) { /* Operator 203YYY: key OVERRIDDEN_REFERENCE_VALUES_KEY */ - err=grib_get_size(h, OVERRIDDEN_REFERENCE_VALUES_KEY, &self->refValListSize); - if (err) return err; - if (self->refValList) grib_context_free(c, self->refValList); + if (flag != PROCESS_DECODE) { /* Operator 203YYY: key OVERRIDDEN_REFERENCE_VALUES_KEY */ + err = grib_get_size(h, OVERRIDDEN_REFERENCE_VALUES_KEY, &self->refValListSize); + if (err) + return err; + if (self->refValList) + grib_context_free(c, self->refValList); if (self->refValListSize > 0) { - self->refValList=(long*)grib_context_malloc_clear(c, self->refValListSize*sizeof(long)); - err=grib_get_long_array(grib_handle_of_accessor(a),OVERRIDDEN_REFERENCE_VALUES_KEY, self->refValList, &self->refValListSize); - if (err) return err; + self->refValList = (long*)grib_context_malloc_clear(c, self->refValListSize * sizeof(long)); + err = grib_get_long_array(grib_handle_of_accessor(a), OVERRIDDEN_REFERENCE_VALUES_KEY, self->refValList, &self->refValListSize); + if (err) + return err; } } - numberOfDescriptors=grib_bufr_descriptors_array_used_size(self->expanded); + numberOfDescriptors = grib_bufr_descriptors_array_used_size(self->expanded); if (self->iss_list) { grib_iarray_delete(self->iss_list); - self->iss_list=0; + self->iss_list = 0; } - end= self->compressedData == 1 ? 1 : self->numberOfSubsets ; + end = self->compressedData == 1 ? 1 : self->numberOfSubsets; - if (flag!=PROCESS_DECODE) { - self->iss_list=set_subset_list(c,self,onlySubset,startSubset,endSubset,subsetList,subsetListSize); - end= self->compressedData == 1 ? 1 : grib_iarray_used_size(self->iss_list) ; + if (flag != PROCESS_DECODE) { + self->iss_list = set_subset_list(c, self, onlySubset, startSubset, endSubset, subsetList, subsetListSize); + end = self->compressedData == 1 ? 1 : grib_iarray_used_size(self->iss_list); } - for (iiss=0;iisscompressedData==0 && self->iss_list) { - iss=self->iss_list->v[iiss]; - } else { - iss=iiss; + for (iiss = 0; iiss < end; iiss++) { + icount = 1; + if (self->compressedData == 0 && self->iss_list) { + iss = self->iss_list->v[iiss]; + } + else { + iss = iiss; } - grib_context_log(c, GRIB_LOG_DEBUG,"BUFR data processing: subsetNumber=%ld", iss+1); + grib_context_log(c, GRIB_LOG_DEBUG, "BUFR data processing: subsetNumber=%ld", iss + 1); self->refValIndex = 0; - if (flag!=PROCESS_ENCODE) { - elementsDescriptorsIndex=grib_iarray_new(c,DYN_ARRAY_SIZE_INIT,DYN_ARRAY_SIZE_INCR); + if (flag != PROCESS_ENCODE) { + elementsDescriptorsIndex = grib_iarray_new(c, DYN_ARRAY_SIZE_INIT, DYN_ARRAY_SIZE_INCR); if (!self->compressedData) { - dval=grib_darray_new(c,DYN_ARRAY_SIZE_INIT,DYN_ARRAY_SIZE_INCR); + dval = grib_darray_new(c, DYN_ARRAY_SIZE_INIT, DYN_ARRAY_SIZE_INCR); /* sval=grib_sarray_new(c,10,10); */ } - } else { - if (self->elementsDescriptorsIndex==NULL) { - return GRIB_ENCODING_ERROR; /* See ECC-359 */ + } + else { + if (self->elementsDescriptorsIndex == NULL) { + return GRIB_ENCODING_ERROR; /* See ECC-359 */ } - elementsDescriptorsIndex=self->elementsDescriptorsIndex->v[iss]; - dval=self->numericValues->v[iss]; - } - elementIndex=0; - - numberOfNestedRepetitions=0; - inr=0; - for (i=0;icode); - switch(descriptors[i]->F) { - case 0: - /* Table B element */ - if (flag!=PROCESS_ENCODE) grib_iarray_push(elementsDescriptorsIndex,i); - if (descriptors[i]->code==31031 && !is_bitmap_start_defined(self)) { - /* self->bitmapStart=grib_iarray_used_size(elementsDescriptorsIndex)-1; */ - self->bitmapStart=elementIndex; - } - - err=codec_element(c,self,iss,buffer,data,&pos,i,0,elementIndex,dval,sval); - if (err) return err; - elementIndex++; - break; - case 1: - /* Delayed replication */ - inr=numberOfNestedRepetitions; - numberOfNestedRepetitions++; - DebugAssert(numberOfNestedRepetitions<=MAX_NESTED_REPLICATIONS); - numberOfElementsToRepeat[inr]=descriptors[i]->X; - n[inr]=numberOfElementsToRepeat[inr]; - i++; - - /* ECC-517 */ - data = buffer->data; - err=codec_replication(c,self,iss,buffer,data,&pos,i,elementIndex,dval,&(numberOfRepetitions[inr])); - if (err) return err; - - startRepetition[inr]=i; - nn[inr]=numberOfRepetitions[inr]; - if (flag!=PROCESS_ENCODE) grib_iarray_push(elementsDescriptorsIndex,i); - elementIndex++; - if (numberOfRepetitions[inr]==0) { - i+=numberOfElementsToRepeat[inr]; - if (inr>0) { - n[inr-1]-=numberOfElementsToRepeat[inr]+2; - /* if the empty nested repetition is at the end of the nesting repetition - we need to re-point to the start of the nesting repetition */ - ip=inr-1; - while (ip>=0 && n[ip]==0) { - nn[ip]--; - if (nn[ip]<=0) { - numberOfNestedRepetitions--; - } else { - n[ip]=numberOfElementsToRepeat[ip]; - i=startRepetition[ip]; - } - ip--; - } - } - numberOfNestedRepetitions--; - } - continue; - case 2: - /* Operator */ - switch(descriptors[i]->X) { - - case 3: - /* Change reference values */ - if (self->compressedData == 1 && flag != PROCESS_DECODE) { - grib_context_log(c,GRIB_LOG_ERROR,"process_elements: operator %d not supported for encoding compressed data",descriptors[i]->X); - return GRIB_INTERNAL_ERROR; - } - if (descriptors[i]->Y == 255) { - grib_context_log(c, GRIB_LOG_DEBUG,"Operator 203YYY: Y=255, definition of new reference values is concluded"); - self->change_ref_value_operand = 255; - /*if (c->debug) tableB_override_dump(self);*/ - if (iss == 0 && flag == PROCESS_DECODE) { - /*Write out the contents of the TableB overridden reference values to the transient array key*/ - err = tableB_override_set_key(h, self); - if (err) return err; - } - if (flag != PROCESS_DECODE) { - /* Encoding operator 203YYY */ - if (self->refValIndex != self->refValListSize) { - grib_context_log(c, GRIB_LOG_ERROR, - "process_elements: The number of overridden reference values (%ld) different from" - " number of descriptors between operator 203YYY and 203255 (%ld)", - self->refValListSize, self->refValIndex); - return GRIB_ENCODING_ERROR; - } - } - } else if (descriptors[i]->Y == 0) { - grib_context_log(c, GRIB_LOG_DEBUG,"Operator 203YYY: Y=0, clearing override of table B"); - tableB_override_clear(c, self); - self->change_ref_value_operand = 0; - } else { - const int numBits = descriptors[i]->Y; - grib_context_log(c, GRIB_LOG_DEBUG,"Operator 203YYY: Definition phase: Num bits=%d", numBits); - self->change_ref_value_operand = numBits; - tableB_override_clear(c, self); - if (flag != PROCESS_DECODE) { - err = check_overridden_reference_values(c, self->refValList, self->refValListSize, numBits); - if (err) return err; - } + elementsDescriptorsIndex = self->elementsDescriptorsIndex->v[iss]; + dval = self->numericValues->v[iss]; + } + elementIndex = 0; + + numberOfNestedRepetitions = 0; + inr = 0; + for (i = 0; i < numberOfDescriptors; i++) { + grib_context_log(c, GRIB_LOG_DEBUG, "BUFR data processing: elementNumber=%ld code=%6.6ld", icount++, descriptors[i]->code); + switch (descriptors[i]->F) { + case 0: + /* Table B element */ + if (flag != PROCESS_ENCODE) + grib_iarray_push(elementsDescriptorsIndex, i); + if (descriptors[i]->code == 31031 && !is_bitmap_start_defined(self)) { + /* self->bitmapStart=grib_iarray_used_size(elementsDescriptorsIndex)-1; */ + self->bitmapStart = elementIndex; } - /*grib_iarray_push(elementsDescriptorsIndex,i);*/ - if (decoding) push_zero_element(self,dval); - break; - case 5: /* Signify character */ - descriptors[i]->width=descriptors[i]->Y*8; - descriptors[i]->type=BUFR_DESCRIPTOR_TYPE_STRING; - err=codec_element(c,self,iss,buffer,data,&pos,i,0,elementIndex,dval,sval); - if (err) return err; - if (flag!=PROCESS_ENCODE) grib_iarray_push(elementsDescriptorsIndex,i); + err = codec_element(c, self, iss, buffer, data, &pos, i, 0, elementIndex, dval, sval); + if (err) + return err; elementIndex++; break; - case 22: /* Quality information follows */ - if (descriptors[i]->Y==0) { - if (flag==PROCESS_DECODE) { - grib_iarray_push(elementsDescriptorsIndex,i); - push_zero_element(self,dval); - } else if (flag==PROCESS_ENCODE) { - if (descriptors[i+1] && descriptors[i+1]->code!=236000 && descriptors[i+1]->code!=237000 ) - restart_bitmap(self); - } else if (flag==PROCESS_NEW_DATA) { - grib_iarray_push(elementsDescriptorsIndex,i); - if (descriptors[i+1] && descriptors[i+1]->code!=236000 && descriptors[i+1]->code!=237000 ) - consume_bitmap(self,i); - } - elementIndex++; - } - break; - case 26: - case 27: - case 29: - case 30: - case 31: - case 33: - case 34: - case 38: - case 39: - case 40: - case 41: - case 42: - if (flag!=PROCESS_ENCODE) grib_iarray_push(elementsDescriptorsIndex,i); - if (decoding) push_zero_element(self,dval); + case 1: + /* Delayed replication */ + inr = numberOfNestedRepetitions; + numberOfNestedRepetitions++; + DebugAssert(numberOfNestedRepetitions <= MAX_NESTED_REPLICATIONS); + numberOfElementsToRepeat[inr] = descriptors[i]->X; + n[inr] = numberOfElementsToRepeat[inr]; + i++; + + /* ECC-517 */ + data = buffer->data; + err = codec_replication(c, self, iss, buffer, data, &pos, i, elementIndex, dval, &(numberOfRepetitions[inr])); + if (err) + return err; + + startRepetition[inr] = i; + nn[inr] = numberOfRepetitions[inr]; + if (flag != PROCESS_ENCODE) + grib_iarray_push(elementsDescriptorsIndex, i); elementIndex++; - break; - case 24: - /*first-order statistical values marker operator*/ - case 32: - /*replaced/retained values marker operator*/ - if (descriptors[i]->Y==255) { - index=get_next_bitmap_descriptor_index(self,elementsDescriptorsIndex,dval); - err=codec_element(c,self,iss,buffer,data,&pos,index,0,elementIndex,dval,sval); - if (err) return err; - /* self->expanded->v[index] */ - if (flag!=PROCESS_ENCODE) grib_iarray_push(elementsDescriptorsIndex,i); - elementIndex++; - } else { - if (flag!=PROCESS_ENCODE) grib_iarray_push(elementsDescriptorsIndex,i); - if (decoding) { - push_zero_element(self,dval); + if (numberOfRepetitions[inr] == 0) { + i += numberOfElementsToRepeat[inr]; + if (inr > 0) { + n[inr - 1] -= numberOfElementsToRepeat[inr] + 2; + /* if the empty nested repetition is at the end of the nesting repetition + we need to re-point to the start of the nesting repetition */ + ip = inr - 1; + while (ip >= 0 && n[ip] == 0) { + nn[ip]--; + if (nn[ip] <= 0) { + numberOfNestedRepetitions--; + } + else { + n[ip] = numberOfElementsToRepeat[ip]; + i = startRepetition[ip]; + } + ip--; + } } - elementIndex++; + numberOfNestedRepetitions--; } - break; - case 23: - if (descriptors[i]->Y==255) { - index=get_next_bitmap_descriptor_index(self,elementsDescriptorsIndex,dval); - err=codec_element(c,self,iss,buffer,data,&pos,index,0,elementIndex,dval,sval); - if (err) return err; - /* self->expanded->v[index] */ - if (flag!=PROCESS_ENCODE) grib_iarray_push(elementsDescriptorsIndex,i); - elementIndex++; - } else { - if (flag==PROCESS_DECODE) { - grib_iarray_push(elementsDescriptorsIndex,i); - push_zero_element(self,dval); - if ( descriptors[i+1] && descriptors[i+1]->code!=236000 && descriptors[i+1]->code!=237000 ) { - err = build_bitmap(self,data,&pos,elementIndex,elementsDescriptorsIndex,i); - if (err) return err; + continue; + case 2: + /* Operator */ + switch (descriptors[i]->X) { + case 3: + /* Change reference values */ + if (self->compressedData == 1 && flag != PROCESS_DECODE) { + grib_context_log(c, GRIB_LOG_ERROR, "process_elements: operator %d not supported for encoding compressed data", descriptors[i]->X); + return GRIB_INTERNAL_ERROR; } - } else if (flag==PROCESS_ENCODE) { - if ( descriptors[i+1] && descriptors[i+1]->code!=236000 && descriptors[i+1]->code!=237000 ) + if (descriptors[i]->Y == 255) { + grib_context_log(c, GRIB_LOG_DEBUG, "Operator 203YYY: Y=255, definition of new reference values is concluded"); + self->change_ref_value_operand = 255; + /*if (c->debug) tableB_override_dump(self);*/ + if (iss == 0 && flag == PROCESS_DECODE) { + /*Write out the contents of the TableB overridden reference values to the transient array key*/ + err = tableB_override_set_key(h, self); + if (err) + return err; + } + if (flag != PROCESS_DECODE) { + /* Encoding operator 203YYY */ + if (self->refValIndex != self->refValListSize) { + grib_context_log(c, GRIB_LOG_ERROR, + "process_elements: The number of overridden reference values (%ld) different from" + " number of descriptors between operator 203YYY and 203255 (%ld)", + self->refValListSize, self->refValIndex); + return GRIB_ENCODING_ERROR; + } + } + } + else if (descriptors[i]->Y == 0) { + grib_context_log(c, GRIB_LOG_DEBUG, "Operator 203YYY: Y=0, clearing override of table B"); + tableB_override_clear(c, self); + self->change_ref_value_operand = 0; + } + else { + const int numBits = descriptors[i]->Y; + grib_context_log(c, GRIB_LOG_DEBUG, "Operator 203YYY: Definition phase: Num bits=%d", numBits); + self->change_ref_value_operand = numBits; + tableB_override_clear(c, self); + if (flag != PROCESS_DECODE) { + err = check_overridden_reference_values(c, self->refValList, self->refValListSize, numBits); + if (err) + return err; + } + } + /*grib_iarray_push(elementsDescriptorsIndex,i);*/ + if (decoding) + push_zero_element(self, dval); + break; + + case 5: /* Signify character */ + descriptors[i]->width = descriptors[i]->Y * 8; + descriptors[i]->type = BUFR_DESCRIPTOR_TYPE_STRING; + err = codec_element(c, self, iss, buffer, data, &pos, i, 0, elementIndex, dval, sval); + if (err) + return err; + if (flag != PROCESS_ENCODE) + grib_iarray_push(elementsDescriptorsIndex, i); + elementIndex++; + break; + case 22: /* Quality information follows */ + if (descriptors[i]->Y == 0) { + if (flag == PROCESS_DECODE) { + grib_iarray_push(elementsDescriptorsIndex, i); + push_zero_element(self, dval); + } + else if (flag == PROCESS_ENCODE) { + if (descriptors[i + 1] && descriptors[i + 1]->code != 236000 && descriptors[i + 1]->code != 237000) + restart_bitmap(self); + } + else if (flag == PROCESS_NEW_DATA) { + grib_iarray_push(elementsDescriptorsIndex, i); + if (descriptors[i + 1] && descriptors[i + 1]->code != 236000 && descriptors[i + 1]->code != 237000) + consume_bitmap(self, i); + } + elementIndex++; + } + break; + case 26: + case 27: + case 29: + case 30: + case 31: + case 33: + case 34: + case 38: + case 39: + case 40: + case 41: + case 42: + if (flag != PROCESS_ENCODE) + grib_iarray_push(elementsDescriptorsIndex, i); + if (decoding) + push_zero_element(self, dval); + elementIndex++; + break; + case 24: + /*first-order statistical values marker operator*/ + case 32: + /*replaced/retained values marker operator*/ + if (descriptors[i]->Y == 255) { + index = get_next_bitmap_descriptor_index(self, elementsDescriptorsIndex, dval); + err = codec_element(c, self, iss, buffer, data, &pos, index, 0, elementIndex, dval, sval); + if (err) + return err; + /* self->expanded->v[index] */ + if (flag != PROCESS_ENCODE) + grib_iarray_push(elementsDescriptorsIndex, i); + elementIndex++; + } + else { + if (flag != PROCESS_ENCODE) + grib_iarray_push(elementsDescriptorsIndex, i); + if (decoding) { + push_zero_element(self, dval); + } + elementIndex++; + } + break; + case 23: + if (descriptors[i]->Y == 255) { + index = get_next_bitmap_descriptor_index(self, elementsDescriptorsIndex, dval); + err = codec_element(c, self, iss, buffer, data, &pos, index, 0, elementIndex, dval, sval); + if (err) + return err; + /* self->expanded->v[index] */ + if (flag != PROCESS_ENCODE) + grib_iarray_push(elementsDescriptorsIndex, i); + elementIndex++; + } + else { + if (flag == PROCESS_DECODE) { + grib_iarray_push(elementsDescriptorsIndex, i); + push_zero_element(self, dval); + if (descriptors[i + 1] && descriptors[i + 1]->code != 236000 && descriptors[i + 1]->code != 237000) { + err = build_bitmap(self, data, &pos, elementIndex, elementsDescriptorsIndex, i); + if (err) + return err; + } + } + else if (flag == PROCESS_ENCODE) { + if (descriptors[i + 1] && descriptors[i + 1]->code != 236000 && descriptors[i + 1]->code != 237000) + restart_bitmap(self); + } + else if (flag == PROCESS_NEW_DATA) { + grib_iarray_push(elementsDescriptorsIndex, i); + if (descriptors[i + 1] && descriptors[i + 1]->code != 236000 && descriptors[i + 1]->code != 237000) { + err = build_bitmap_new_data(self, data, &pos, elementIndex, elementsDescriptorsIndex, i); + if (err) + return err; + } + } + elementIndex++; + } + break; + case 25: + /*difference statistical values marker operator*/ + if (descriptors[i]->Y == 255) { + index = get_next_bitmap_descriptor_index(self, elementsDescriptorsIndex, dval); + bd = grib_bufr_descriptor_clone(self->expanded->v[index]); + bd->reference = -grib_power(bd->width, 2); + bd->width++; + + err = codec_element(c, self, iss, buffer, data, &pos, index, bd, elementIndex, dval, sval); + grib_bufr_descriptor_delete(bd); + if (err) + return err; + /* self->expanded->v[index] */ + if (flag != PROCESS_ENCODE) + grib_iarray_push(elementsDescriptorsIndex, i); + elementIndex++; + } + else { + if (flag != PROCESS_ENCODE) + grib_iarray_push(elementsDescriptorsIndex, i); + if (decoding) + push_zero_element(self, dval); + elementIndex++; + } + break; + case 35: + /* cancel bitmap */ + if (flag != PROCESS_ENCODE) { + grib_iarray_push(elementsDescriptorsIndex, i); + if (decoding) + push_zero_element(self, dval); + if (descriptors[i]->Y == 0) + cancel_bitmap(self); + } + elementIndex++; + break; + case 36: + /* bitmap */ + if (flag == PROCESS_DECODE) { + grib_iarray_push(elementsDescriptorsIndex, i); + if (decoding) + push_zero_element(self, dval); + err = build_bitmap(self, data, &pos, elementIndex, elementsDescriptorsIndex, i); + if (err) + return err; + } + else if (flag == PROCESS_ENCODE) { restart_bitmap(self); - } else if (flag==PROCESS_NEW_DATA) { - grib_iarray_push(elementsDescriptorsIndex,i); - if ( descriptors[i+1] && descriptors[i+1]->code!=236000 && descriptors[i+1]->code!=237000 ) { - err = build_bitmap_new_data(self,data,&pos,elementIndex,elementsDescriptorsIndex,i); - if (err) return err; } - } - elementIndex++; - } - break; - case 25: - /*difference statistical values marker operator*/ - if (descriptors[i]->Y==255) { - index=get_next_bitmap_descriptor_index(self,elementsDescriptorsIndex,dval); - bd=grib_bufr_descriptor_clone(self->expanded->v[index]); - bd->reference=-grib_power(bd->width,2); - bd->width++; - - err=codec_element(c,self,iss,buffer,data,&pos,index,bd,elementIndex,dval,sval); - grib_bufr_descriptor_delete(bd); - if (err) return err; - /* self->expanded->v[index] */ - if (flag!=PROCESS_ENCODE) grib_iarray_push(elementsDescriptorsIndex,i); - elementIndex++; - } else { - if (flag!=PROCESS_ENCODE) grib_iarray_push(elementsDescriptorsIndex,i); - if (decoding) push_zero_element(self,dval); - elementIndex++; - } - break; - case 35: - /* cancel bitmap */ - if (flag!=PROCESS_ENCODE) { - grib_iarray_push(elementsDescriptorsIndex,i); - if (decoding) push_zero_element(self,dval); - if (descriptors[i]->Y==0) cancel_bitmap(self); - } - elementIndex++; - break; - case 36: - /* bitmap */ - if (flag==PROCESS_DECODE) { - grib_iarray_push(elementsDescriptorsIndex,i); - if (decoding) push_zero_element(self,dval); - err = build_bitmap(self,data,&pos,elementIndex,elementsDescriptorsIndex,i); - if (err) return err; - } else if (flag==PROCESS_ENCODE) { - restart_bitmap(self); - } else if (flag==PROCESS_NEW_DATA) { - grib_iarray_push(elementsDescriptorsIndex,i); - err = build_bitmap_new_data(self,data,&pos,elementIndex,elementsDescriptorsIndex,i); - if (err) return err; - } - elementIndex++; - break; - case 37: - /* reuse defined bitmap */ - if (flag!=PROCESS_ENCODE) { - grib_iarray_push(elementsDescriptorsIndex,i); - if (decoding) push_zero_element(self,dval); - } - if (descriptors[i]->Y==0) restart_bitmap(self); - /* cancel reuse */ - else cancel_bitmap(self); - elementIndex++; + else if (flag == PROCESS_NEW_DATA) { + grib_iarray_push(elementsDescriptorsIndex, i); + err = build_bitmap_new_data(self, data, &pos, elementIndex, elementsDescriptorsIndex, i); + if (err) + return err; + } + elementIndex++; + break; + case 37: + /* reuse defined bitmap */ + if (flag != PROCESS_ENCODE) { + grib_iarray_push(elementsDescriptorsIndex, i); + if (decoding) + push_zero_element(self, dval); + } + if (descriptors[i]->Y == 0) + restart_bitmap(self); + /* cancel reuse */ + else + cancel_bitmap(self); + elementIndex++; + break; + default: + grib_context_log(c, GRIB_LOG_ERROR, "process_elements: unsupported operator %d\n", descriptors[i]->X); + return GRIB_INTERNAL_ERROR; + } /* F == 2 */ break; - default : - grib_context_log(c,GRIB_LOG_ERROR,"process_elements: unsupported operator %d\n",descriptors[i]->X); - return GRIB_INTERNAL_ERROR; - } /* F == 2 */ - break; case 9: /* associated field */ - if (descriptors[i]->X==99 && descriptors[i]->Y==999) { - err=codec_element(c,self,iss,buffer,data,&pos,i,0,elementIndex,dval,sval); - if (err) return err; - if (flag!=PROCESS_ENCODE) grib_iarray_push(elementsDescriptorsIndex,i); + if (descriptors[i]->X == 99 && descriptors[i]->Y == 999) { + err = codec_element(c, self, iss, buffer, data, &pos, i, 0, elementIndex, dval, sval); + if (err) + return err; + if (flag != PROCESS_ENCODE) + grib_iarray_push(elementsDescriptorsIndex, i); elementIndex++; - } else { + } + else { return GRIB_INTERNAL_ERROR; } break; default: - err=GRIB_INTERNAL_ERROR; + err = GRIB_INTERNAL_ERROR; return err; } /* switch F */ /* delayed repetition check */ - innr=numberOfNestedRepetitions-1; - for (ir=innr;ir>=0;ir--) { - if (nn[ir]) { - if (n[ir]>1) { + innr = numberOfNestedRepetitions - 1; + for (ir = innr; ir >= 0; ir--) { + if (nn[ir]) { + if (n[ir] > 1) { n[ir]--; break; - } else { - n[ir]=numberOfElementsToRepeat[ir]; + } + else { + n[ir] = numberOfElementsToRepeat[ir]; nn[ir]--; if (nn[ir]) { - i=startRepetition[ir]; + i = startRepetition[ir]; break; - } else { - if (ir>0) { - n[ir-1]-=numberOfElementsToRepeat[ir]+1; + } + else { + if (ir > 0) { + n[ir - 1] -= numberOfElementsToRepeat[ir] + 1; } - i=startRepetition[ir]+numberOfElementsToRepeat[ir]; + i = startRepetition[ir] + numberOfElementsToRepeat[ir]; numberOfNestedRepetitions--; } } - } else { - if (ir==0) { - i=startRepetition[ir]+numberOfElementsToRepeat[ir]+1; - numberOfNestedRepetitions=0; - } else { + } + else { + if (ir == 0) { + i = startRepetition[ir] + numberOfElementsToRepeat[ir] + 1; + numberOfNestedRepetitions = 0; + } + else { numberOfNestedRepetitions--; } } } } - if (flag!=PROCESS_ENCODE) grib_viarray_push(c,self->elementsDescriptorsIndex,elementsDescriptorsIndex); + if (flag != PROCESS_ENCODE) + grib_viarray_push(c, self->elementsDescriptorsIndex, elementsDescriptorsIndex); if (decoding && !self->compressedData) { - grib_vdarray_push(c,self->numericValues,dval); + grib_vdarray_push(c, self->numericValues, dval); } } /*if (c->debug) grib_vdarray_print("process_elements: self->numericValues", self->numericValues);*/ - if(decoding) { - err=create_keys(a,0,0,0); - self->bitsToEndData=totalSize; - } else { - self->bitsToEndData=buffer->ulength*8; - grib_set_bytes(grib_handle_of_accessor(a),self->bufrDataEncodedName,buffer->data,&(buffer->ulength)); - grib_buffer_delete(c,buffer); - if (self->numberOfSubsets != grib_iarray_used_size(self->iss_list) ) { - grib_set_long(h,self->numberOfSubsetsName,grib_iarray_used_size(self->iss_list)); + if (decoding) { + err = create_keys(a, 0, 0, 0); + self->bitsToEndData = totalSize; + } + else { + self->bitsToEndData = buffer->ulength * 8; + grib_set_bytes(grib_handle_of_accessor(a), self->bufrDataEncodedName, buffer->data, &(buffer->ulength)); + grib_buffer_delete(c, buffer); + if (self->numberOfSubsets != grib_iarray_used_size(self->iss_list)) { + grib_set_long(h, self->numberOfSubsetsName, grib_iarray_used_size(self->iss_list)); } } @@ -3098,63 +3332,70 @@ static void dump(grib_accessor* a, grib_dumper* dumper) return; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - int err=0,l; + int err = 0, l; long i; - grib_accessor_bufr_data_array *self =(grib_accessor_bufr_data_array*)a; + grib_accessor_bufr_data_array* self = (grib_accessor_bufr_data_array*)a; - err=process_elements(a,PROCESS_DECODE,0,0,0); - if (err) return err; + err = process_elements(a, PROCESS_DECODE, 0, 0, 0); + if (err) + return err; if (self->compressedData) { - l=grib_vdarray_used_size(self->numericValues); + l = grib_vdarray_used_size(self->numericValues); - *count=l*self->numberOfSubsets; - } else { - *count=0; - for (i=0;inumberOfSubsets;i++) - *count+=grib_iarray_used_size(self->elementsDescriptorsIndex->v[i]); + *count = l * self->numberOfSubsets; + } + else { + *count = 0; + for (i = 0; i < self->numberOfSubsets; i++) + *count += grib_iarray_used_size(self->elementsDescriptorsIndex->v[i]); } return err; } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - int err=0,i,k,ii; - int proc_flag=PROCESS_DECODE; - size_t l=0,elementsInSubset; - long numberOfSubsets=0; - grib_accessor_bufr_data_array *self =(grib_accessor_bufr_data_array*)a; + int err = 0, i, k, ii; + int proc_flag = PROCESS_DECODE; + size_t l = 0, elementsInSubset; + long numberOfSubsets = 0; + grib_accessor_bufr_data_array* self = (grib_accessor_bufr_data_array*)a; - if (self->unpackMode == CODES_BUFR_NEW_DATA) proc_flag=PROCESS_NEW_DATA; + if (self->unpackMode == CODES_BUFR_NEW_DATA) + proc_flag = PROCESS_NEW_DATA; - err=process_elements(a,proc_flag,0,0,0); - if (err) return err; - if (!val) return err; + err = process_elements(a, proc_flag, 0, 0, 0); + if (err) + return err; + if (!val) + return err; /* When we set unpack=1, then the 'val' argument is NULL and we return * but when client requests a key like 'numericValues', then we end up here */ - l=grib_vdarray_used_size(self->numericValues); - err=grib_get_long(grib_handle_of_accessor(a),self->numberOfSubsetsName,&numberOfSubsets); - if (err) return err; + l = grib_vdarray_used_size(self->numericValues); + err = grib_get_long(grib_handle_of_accessor(a), self->numberOfSubsetsName, &numberOfSubsets); + if (err) + return err; if (self->compressedData) { - ii=0; - for (k=0;knumericValues->v[i]->n > 1 ? self->numericValues->v[i]->v[k] : self->numericValues->v[i]->v[0]; + ii = 0; + for (k = 0; k < numberOfSubsets; k++) { + for (i = 0; i < l; i++) { + val[ii++] = self->numericValues->v[i]->n > 1 ? self->numericValues->v[i]->v[k] : self->numericValues->v[i]->v[0]; } } - } else { - ii=0; - for (k=0;kelementsDescriptorsIndex->v[k]); - for (i=0;inumericValues->v[k]->v[i]; + } + else { + ii = 0; + for (k = 0; k < numberOfSubsets; k++) { + elementsInSubset = grib_iarray_used_size(self->elementsDescriptorsIndex->v[k]); + for (i = 0; i < elementsInSubset; i++) { + val[ii++] = self->numericValues->v[k]->v[i]; } } } @@ -3162,14 +3403,16 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len) return GRIB_SUCCESS; } -static void destroy(grib_context* c,grib_accessor* a) +static void destroy(grib_context* c, grib_accessor* a) { - grib_accessor_bufr_data_array *self =(grib_accessor_bufr_data_array*)a; - self_clear(c,self); - if (self->dataAccessors) grib_accessors_list_delete(c,self->dataAccessors); - if (self->dataAccessorsTrie) grib_trie_with_rank_delete_container(self->dataAccessorsTrie); + grib_accessor_bufr_data_array* self = (grib_accessor_bufr_data_array*)a; + self_clear(c, self); + if (self->dataAccessors) + grib_accessors_list_delete(c, self->dataAccessors); + if (self->dataAccessorsTrie) + grib_trie_with_rank_delete_container(self->dataAccessorsTrie); if (self->tempStrings) { grib_sarray_delete_content(c, self->tempStrings); - grib_sarray_delete (c, self->tempStrings); + grib_sarray_delete(c, self->tempStrings); } } diff --git a/src/grib_accessor_class_bufr_data_element.c b/src/grib_accessor_class_bufr_data_element.c index f940a1a00..b66db443f 100644 --- a/src/grib_accessor_class_bufr_data_element.c +++ b/src/grib_accessor_class_bufr_data_element.c @@ -50,82 +50,83 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int pack_string(grib_accessor*, const char*, size_t *len); -static int pack_string_array(grib_accessor*, const char**, size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); -static int unpack_string_array (grib_accessor*, char**, size_t *len); -static int value_count(grib_accessor*,long*); -static void destroy(grib_context*,grib_accessor*); +static int get_native_type(grib_accessor*); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int pack_string(grib_accessor*, const char*, size_t* len); +static int pack_string_array(grib_accessor*, const char**, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); +static int unpack_string_array(grib_accessor*, char**, size_t* len); +static int value_count(grib_accessor*, long*); +static void destroy(grib_context*, grib_accessor*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -static int unpack_double_element(grib_accessor*,size_t i, double* val); -static grib_accessor* make_clone(grib_accessor*,grib_section*,int*); - -typedef struct grib_accessor_bufr_data_element { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in bufr_data_element */ - long index; - int type; - long compressedData; - long subsetNumber; - long numberOfSubsets; - bufr_descriptors_array* descriptors; - grib_vdarray* numericValues; - grib_vsarray* stringValues; - grib_viarray* elementsDescriptorsIndex; - char* cname; +static int unpack_double_element(grib_accessor*, size_t i, double* val); +static grib_accessor* make_clone(grib_accessor*, grib_section*, int*); + +typedef struct grib_accessor_bufr_data_element +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in bufr_data_element */ + long index; + int type; + long compressedData; + long subsetNumber; + long numberOfSubsets; + bufr_descriptors_array* descriptors; + grib_vdarray* numericValues; + grib_vsarray* stringValues; + grib_viarray* elementsDescriptorsIndex; + char* cname; } grib_accessor_bufr_data_element; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_bufr_data_element = { - &grib_accessor_class_gen, /* super */ - "bufr_data_element", /* name */ - sizeof(grib_accessor_bufr_data_element), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - &pack_string, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - &pack_string_array, /* grib_pack array procedures string */ - &unpack_string_array, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - &unpack_double_element, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - &make_clone, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "bufr_data_element", /* name */ + sizeof(grib_accessor_bufr_data_element), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + &destroy, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + &pack_string, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + &pack_string_array, /* grib_pack array procedures string */ + &unpack_string_array, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + &unpack_double_element, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + &make_clone, /* clone accessor */ }; @@ -134,135 +135,135 @@ grib_accessor_class* grib_accessor_class_bufr_data_element = &_grib_accessor_cla static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; } /* END_CLASS_IMP */ -static grib_accessor* make_clone(grib_accessor* a,grib_section* s,int* err) +static grib_accessor* make_clone(grib_accessor* a, grib_section* s, int* err) { - grib_accessor* the_clone=NULL; - grib_accessor* attribute=NULL; + grib_accessor* the_clone = NULL; + grib_accessor* attribute = NULL; grib_accessor_bufr_data_element* elementAccessor; grib_accessor_bufr_data_element* self; char* copied_name = NULL; int i; - grib_action creator = {0, }; + grib_action creator = {0,}; creator.op = "bufr_data_element"; creator.name_space = ""; creator.set = 0; - creator.name="unknown"; - if (strcmp(a->cclass->name,"bufr_data_element")) { - grib_context_log(a->context,GRIB_LOG_FATAL,"wrong accessor type: '%s' should be '%s'",a->cclass->name,"bufr_data_element"); + creator.name = "unknown"; + if (strcmp(a->cclass->name, "bufr_data_element")) { + grib_context_log(a->context, GRIB_LOG_FATAL, "wrong accessor type: '%s' should be '%s'", a->cclass->name, "bufr_data_element"); } - *err=0; - - the_clone = grib_accessor_factory(s, &creator, 0, NULL); - copied_name = grib_context_strdup(a->context,a->name); - the_clone->name=copied_name; - elementAccessor=(grib_accessor_bufr_data_element*)the_clone; - self=(grib_accessor_bufr_data_element*)a; - the_clone->flags=a->flags; - the_clone->parent=NULL; - the_clone->h=s->h; - elementAccessor->index=self->index; - elementAccessor->type=self->type; - elementAccessor->numberOfSubsets=self->numberOfSubsets; - elementAccessor->subsetNumber=self->subsetNumber; - elementAccessor->compressedData=self->compressedData; - elementAccessor->descriptors=self->descriptors; - elementAccessor->numericValues=self->numericValues; - elementAccessor->stringValues=self->stringValues; - elementAccessor->elementsDescriptorsIndex=self->elementsDescriptorsIndex; - elementAccessor->cname = copied_name; /* ECC-765 */ - - i=0; + *err = 0; + + the_clone = grib_accessor_factory(s, &creator, 0, NULL); + copied_name = grib_context_strdup(a->context, a->name); + the_clone->name = copied_name; + elementAccessor = (grib_accessor_bufr_data_element*)the_clone; + self = (grib_accessor_bufr_data_element*)a; + the_clone->flags = a->flags; + the_clone->parent = NULL; + the_clone->h = s->h; + elementAccessor->index = self->index; + elementAccessor->type = self->type; + elementAccessor->numberOfSubsets = self->numberOfSubsets; + elementAccessor->subsetNumber = self->subsetNumber; + elementAccessor->compressedData = self->compressedData; + elementAccessor->descriptors = self->descriptors; + elementAccessor->numericValues = self->numericValues; + elementAccessor->stringValues = self->stringValues; + elementAccessor->elementsDescriptorsIndex = self->elementsDescriptorsIndex; + elementAccessor->cname = copied_name; /* ECC-765 */ + + i = 0; while (a->attributes[i]) { - attribute=grib_accessor_clone(a->attributes[i],s,err); + attribute = grib_accessor_clone(a->attributes[i], s, err); /* attribute->parent=a->parent; */ - grib_accessor_add_attribute(the_clone,attribute,0); + grib_accessor_add_attribute(the_clone, attribute, 0); i++; } return the_clone; } -void accessor_bufr_data_element_set_index(grib_accessor* a,long index) +void accessor_bufr_data_element_set_index(grib_accessor* a, long index) { grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; - self->index=index; + self->index = index; } -void accessor_bufr_data_element_set_type(grib_accessor* a,int type) +void accessor_bufr_data_element_set_type(grib_accessor* a, int type) { grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; - self->type=type; + self->type = type; } -void accessor_bufr_data_element_set_numberOfSubsets(grib_accessor* a,long numberOfSubsets) +void accessor_bufr_data_element_set_numberOfSubsets(grib_accessor* a, long numberOfSubsets) { grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; - self->numberOfSubsets=numberOfSubsets; + self->numberOfSubsets = numberOfSubsets; } -void accessor_bufr_data_element_set_subsetNumber(grib_accessor* a,long subsetNumber) +void accessor_bufr_data_element_set_subsetNumber(grib_accessor* a, long subsetNumber) { grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; - self->subsetNumber=subsetNumber; + self->subsetNumber = subsetNumber; } -void accessor_bufr_data_element_set_compressedData(grib_accessor* a,int compressedData) +void accessor_bufr_data_element_set_compressedData(grib_accessor* a, int compressedData) { grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; - self->compressedData=compressedData; + self->compressedData = compressedData; } -void accessor_bufr_data_element_set_descriptors(grib_accessor* a,bufr_descriptors_array* descriptors) +void accessor_bufr_data_element_set_descriptors(grib_accessor* a, bufr_descriptors_array* descriptors) { grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; - self->descriptors=descriptors; + self->descriptors = descriptors; } -void accessor_bufr_data_element_set_numericValues(grib_accessor* a,grib_vdarray* numericValues) +void accessor_bufr_data_element_set_numericValues(grib_accessor* a, grib_vdarray* numericValues) { grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; - self->numericValues=numericValues; + self->numericValues = numericValues; } -void accessor_bufr_data_element_set_stringValues(grib_accessor* a,grib_vsarray* stringValues) +void accessor_bufr_data_element_set_stringValues(grib_accessor* a, grib_vsarray* stringValues) { grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; - self->stringValues=stringValues; + self->stringValues = stringValues; } -void accessor_bufr_data_element_set_elementsDescriptorsIndex(grib_accessor* a,grib_viarray* elementsDescriptorsIndex) +void accessor_bufr_data_element_set_elementsDescriptorsIndex(grib_accessor* a, grib_viarray* elementsDescriptorsIndex) { grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; - self->elementsDescriptorsIndex=elementsDescriptorsIndex; + self->elementsDescriptorsIndex = elementsDescriptorsIndex; } static void init(grib_accessor* a, const long len, grib_arguments* params) { grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; - a->length = 0; + a->length = 0; a->flags |= GRIB_ACCESSOR_FLAG_BUFR_DATA; /* a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; */ self->cname = NULL; @@ -270,289 +271,305 @@ static void init(grib_accessor* a, const long len, grib_arguments* params) static void dump(grib_accessor* a, grib_dumper* dumper) { - int type=get_native_type(a); + int type = get_native_type(a); switch (type) { - case GRIB_TYPE_LONG: - grib_dump_long(dumper,a,NULL); - break; - case GRIB_TYPE_DOUBLE: - grib_dump_values(dumper,a); - break; - case GRIB_TYPE_STRING: - grib_dump_string_array(dumper,a,NULL); - break; + case GRIB_TYPE_LONG: + grib_dump_long(dumper, a, NULL); + break; + case GRIB_TYPE_DOUBLE: + grib_dump_values(dumper, a); + break; + case GRIB_TYPE_STRING: + grib_dump_string_array(dumper, a, NULL); + break; } } -static int unpack_string_array (grib_accessor* a, char** val, size_t *len) +static int unpack_string_array(grib_accessor* a, char** val, size_t* len) { grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; - int ret=0,i,idx; - long count=0; - grib_context* c=a->context; + int ret = 0, i, idx; + long count = 0; + grib_context* c = a->context; if (self->compressedData) { DebugAssert(self->index < self->numericValues->n); - idx=((int)self->numericValues->v[self->index]->v[0]/1000-1)/self->numberOfSubsets; + idx = ((int)self->numericValues->v[self->index]->v[0] / 1000 - 1) / self->numberOfSubsets; DebugAssert(idx < self->stringValues->n); - count=grib_sarray_used_size(self->stringValues->v[idx]); - for (i=0;istringValues->v[idx]->v[i]); + count = grib_sarray_used_size(self->stringValues->v[idx]); + for (i = 0; i < count; i++) { + val[i] = grib_context_strdup(c, self->stringValues->v[idx]->v[i]); } - *len=count; - } else { + *len = count; + } + else { DebugAssert(self->subsetNumber < self->numericValues->n); DebugAssert(self->index < self->numericValues->v[self->subsetNumber]->n); - idx=(int)self->numericValues->v[self->subsetNumber]->v[self->index]/1000-1; - val[0]=grib_context_strdup(c,self->stringValues->v[idx]->v[0]); - *len=1; + idx = (int)self->numericValues->v[self->subsetNumber]->v[self->index] / 1000 - 1; + val[0] = grib_context_strdup(c, self->stringValues->v[idx]->v[0]); + *len = 1; } return ret; } -static int pack_string_array(grib_accessor*a , const char** v, size_t *len) +static int pack_string_array(grib_accessor* a, const char** v, size_t* len) { grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; - int ret=0,i,idx; - char* s=NULL; - grib_context* c=a->context; + int ret = 0, i, idx; + char* s = NULL; + grib_context* c = a->context; if (self->compressedData) { - idx=((int)self->numericValues->v[self->index]->v[0]/1000-1)/self->numberOfSubsets; - if (*len!=1 && *len!=self->numberOfSubsets) { - grib_context_log(c,GRIB_LOG_ERROR,"Number of values mismatch for '%s': %ld strings provided but expected %ld (=number of subsets)", - self->descriptors->v[self->elementsDescriptorsIndex->v[0]->v[idx]]->shortName,*len,self->numberOfSubsets); + idx = ((int)self->numericValues->v[self->index]->v[0] / 1000 - 1) / self->numberOfSubsets; + if (*len != 1 && *len != self->numberOfSubsets) { + grib_context_log(c, GRIB_LOG_ERROR, "Number of values mismatch for '%s': %ld strings provided but expected %ld (=number of subsets)", + self->descriptors->v[self->elementsDescriptorsIndex->v[0]->v[idx]]->shortName, *len, self->numberOfSubsets); return GRIB_ARRAY_TOO_SMALL; } - grib_sarray_delete(c,self->stringValues->v[idx]); - self->stringValues->v[idx]=grib_sarray_new(c,*len,1); - for (i=0;i<*len;i++) { - s=grib_context_strdup(c,v[i]); - grib_sarray_push(c,self->stringValues->v[idx],s); + grib_sarray_delete(c, self->stringValues->v[idx]); + self->stringValues->v[idx] = grib_sarray_new(c, *len, 1); + for (i = 0; i < *len; i++) { + s = grib_context_strdup(c, v[i]); + grib_sarray_push(c, self->stringValues->v[idx], s); } - } else { - ret=GRIB_NOT_IMPLEMENTED; + } + else { + ret = GRIB_NOT_IMPLEMENTED; } return ret; } -static int unpack_string (grib_accessor* a, char* val, size_t *len) +static int unpack_string(grib_accessor* a, char* val, size_t* len) { grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; - char* str=NULL; - char* p=0; - size_t slen=0; - char sval[100]={0,}; - double dval=0; - size_t dlen=1; + char* str = NULL; + char* p = 0; + size_t slen = 0; + char sval[100] = {0,}; + double dval = 0; + size_t dlen = 1; - int ret=0,idx; - grib_context* c=a->context; + int ret = 0, idx; + grib_context* c = a->context; if (self->type != BUFR_DESCRIPTOR_TYPE_STRING) { - unpack_double(a,&dval,&dlen); - sprintf(sval,"%g",dval); - slen=strlen(sval); - if (*len < slen) return GRIB_ARRAY_TOO_SMALL; - strcpy(val,sval); + unpack_double(a, &dval, &dlen); + sprintf(sval, "%g", dval); + slen = strlen(sval); + if (*len < slen) + return GRIB_ARRAY_TOO_SMALL; + strcpy(val, sval); return GRIB_SUCCESS; } if (self->compressedData) { DebugAssert(self->index < self->numericValues->n); - idx=((int)self->numericValues->v[self->index]->v[0]/1000-1)/self->numberOfSubsets; - if (idx < 0) return GRIB_INTERNAL_ERROR; - str=grib_context_strdup(c,self->stringValues->v[idx]->v[0]); - } else { + idx = ((int)self->numericValues->v[self->index]->v[0] / 1000 - 1) / self->numberOfSubsets; + if (idx < 0) + return GRIB_INTERNAL_ERROR; + str = grib_context_strdup(c, self->stringValues->v[idx]->v[0]); + } + else { DebugAssert(self->subsetNumber < self->numericValues->n); - idx=(int)self->numericValues->v[self->subsetNumber]->v[self->index]/1000-1; - if (idx < 0) return GRIB_INTERNAL_ERROR; + idx = (int)self->numericValues->v[self->subsetNumber]->v[self->index] / 1000 - 1; + if (idx < 0) + return GRIB_INTERNAL_ERROR; DebugAssert(idx < self->stringValues->n); - str=grib_context_strdup(c,self->stringValues->v[idx]->v[0]); + str = grib_context_strdup(c, self->stringValues->v[idx]->v[0]); } - if (str==0 || strlen(str)==0) { - *len=0; - *val=0; + if (str == 0 || strlen(str) == 0) { + *len = 0; + *val = 0; return ret; } - p=str; - while (*p!=0) p++; + p = str; + while (*p != 0) + p++; p--; - while (p!=str) { - if (*p!=' ') break; - else *p=0; + while (p != str) { + if (*p != ' ') + break; + else + *p = 0; p--; } - slen=strlen(str); - if (slen>*len) return GRIB_ARRAY_TOO_SMALL; + slen = strlen(str); + if (slen > *len) + return GRIB_ARRAY_TOO_SMALL; - strcpy(val,str); - grib_context_free(c,str); - *len=slen; + strcpy(val, str); + grib_context_free(c, str); + *len = slen; return ret; } -static int pack_string(grib_accessor* a, const char* val, size_t *len) +static int pack_string(grib_accessor* a, const char* val, size_t* len) { grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; - int ret=0,idx; - char* s=NULL; - grib_context* c=a->context; + int ret = 0, idx; + char* s = NULL; + grib_context* c = a->context; if (self->compressedData) { - idx=((int)self->numericValues->v[self->index]->v[0]/1000-1)/self->numberOfSubsets; - } else { - idx=(int)self->numericValues->v[self->subsetNumber]->v[self->index]/1000-1; + idx = ((int)self->numericValues->v[self->index]->v[0] / 1000 - 1) / self->numberOfSubsets; + } + else { + idx = (int)self->numericValues->v[self->subsetNumber]->v[self->index] / 1000 - 1; } - grib_sarray_delete(c,self->stringValues->v[idx]); - self->stringValues->v[idx]=grib_sarray_new(c,1,1); - s=grib_context_strdup(c,val); - grib_sarray_push(c,self->stringValues->v[idx],s); + grib_sarray_delete(c, self->stringValues->v[idx]); + self->stringValues->v[idx] = grib_sarray_new(c, 1, 1); + s = grib_context_strdup(c, val); + grib_sarray_push(c, self->stringValues->v[idx], s); return ret; } -static int unpack_long (grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; - int ret=0,i; - long count=0; + int ret = 0, i; + long count = 0; - value_count(a,&count); + value_count(a, &count); - if (*lencompressedData) { - for (i=0;iindex < self->numericValues->n); DebugAssert(i < self->numericValues->v[self->index]->n); - val[i]= self->numericValues->v[self->index]->v[i] == GRIB_MISSING_DOUBLE ? - GRIB_MISSING_LONG : (long)self->numericValues->v[self->index]->v[i]; + val[i] = self->numericValues->v[self->index]->v[i] == GRIB_MISSING_DOUBLE ? GRIB_MISSING_LONG : (long)self->numericValues->v[self->index]->v[i]; } - *len=count; - } else { + *len = count; + } + else { DebugAssert(self->subsetNumber < self->numericValues->n); DebugAssert(self->index < self->numericValues->v[self->subsetNumber]->n); - val[0]= self->numericValues->v[self->subsetNumber]->v[self->index] == GRIB_MISSING_DOUBLE ? - GRIB_MISSING_LONG : (long)self->numericValues->v[self->subsetNumber]->v[self->index]; - *len=1; + val[0] = self->numericValues->v[self->subsetNumber]->v[self->index] == GRIB_MISSING_DOUBLE ? GRIB_MISSING_LONG : (long)self->numericValues->v[self->subsetNumber]->v[self->index]; + *len = 1; } return ret; } -static int unpack_double (grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; - int ret=0,i; - long count=0; + int ret = 0, i; + long count = 0; - value_count(a,&count); + value_count(a, &count); - if (*lencompressedData) { - for (i=0;iindex < self->numericValues->n); DebugAssert(i < self->numericValues->v[self->index]->n); - val[i]=self->numericValues->v[self->index]->v[i]; + val[i] = self->numericValues->v[self->index]->v[i]; } - *len=count; - } else { + *len = count; + } + else { DebugAssert(self->subsetNumber < self->numericValues->n); DebugAssert(self->index < self->numericValues->v[self->subsetNumber]->n); - val[0]=self->numericValues->v[self->subsetNumber]->v[self->index]; - *len=1; + val[0] = self->numericValues->v[self->subsetNumber]->v[self->index]; + *len = 1; } return ret; } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; - int ret=0,i; - long count=1; - grib_context* c=a->context; + int ret = 0, i; + long count = 1; + grib_context* c = a->context; if (self->compressedData) { - count=*len; - if (count!=1 && count!=self->numberOfSubsets) { - grib_context_log(c,GRIB_LOG_ERROR,"Number of values mismatch for '%s': %ld doubles provided but expected %ld (=number of subsets)", - self->descriptors->v[self->elementsDescriptorsIndex->v[0]->v[self->index]]->shortName,count,self->numberOfSubsets); + count = *len; + if (count != 1 && count != self->numberOfSubsets) { + grib_context_log(c, GRIB_LOG_ERROR, "Number of values mismatch for '%s': %ld doubles provided but expected %ld (=number of subsets)", + self->descriptors->v[self->elementsDescriptorsIndex->v[0]->v[self->index]]->shortName, count, self->numberOfSubsets); return GRIB_ARRAY_TOO_SMALL; } - grib_darray_delete(a->context,self->numericValues->v[self->index]); - self->numericValues->v[self->index]=grib_darray_new(a->context,count,1); + grib_darray_delete(a->context, self->numericValues->v[self->index]); + self->numericValues->v[self->index] = grib_darray_new(a->context, count, 1); - for (i=0;icontext,self->numericValues->v[self->index],val[i]); + for (i = 0; i < count; i++) + grib_darray_push(a->context, self->numericValues->v[self->index], val[i]); - *len=count; - } else { - self->numericValues->v[self->subsetNumber]->v[self->index]=val[0]; - *len=1; + *len = count; + } + else { + self->numericValues->v[self->subsetNumber]->v[self->index] = val[0]; + *len = 1; } return ret; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; - int ret=0,i; - long count=1; - grib_context* c=a->context; + int ret = 0, i; + long count = 1; + grib_context* c = a->context; if (self->compressedData) { - count=*len; - if (count!=1 && count!=self->numberOfSubsets) { - grib_context_log(c,GRIB_LOG_ERROR,"Number of values mismatch for '%s': %ld integers provided but expected %ld (=number of subsets)", - self->descriptors->v[self->elementsDescriptorsIndex->v[0]->v[self->index]]->shortName,count,self->numberOfSubsets); + count = *len; + if (count != 1 && count != self->numberOfSubsets) { + grib_context_log(c, GRIB_LOG_ERROR, "Number of values mismatch for '%s': %ld integers provided but expected %ld (=number of subsets)", + self->descriptors->v[self->elementsDescriptorsIndex->v[0]->v[self->index]]->shortName, count, self->numberOfSubsets); return GRIB_ARRAY_TOO_SMALL; } - grib_darray_delete(a->context,self->numericValues->v[self->index]); - self->numericValues->v[self->index]=grib_darray_new(a->context,count,1); + grib_darray_delete(a->context, self->numericValues->v[self->index]); + self->numericValues->v[self->index] = grib_darray_new(a->context, count, 1); - for (i=0;icontext,self->numericValues->v[self->index], val[i] == GRIB_MISSING_LONG ? GRIB_MISSING_DOUBLE : val[i]); + for (i = 0; i < count; i++) { + grib_darray_push(a->context, self->numericValues->v[self->index], val[i] == GRIB_MISSING_LONG ? GRIB_MISSING_DOUBLE : val[i]); } - *len=count; - } else { - self->numericValues->v[self->subsetNumber]->v[self->index] = val[0] == GRIB_MISSING_LONG ? GRIB_MISSING_DOUBLE : val[0]; - *len=1; + *len = count; + } + else { + self->numericValues->v[self->subsetNumber]->v[self->index] = val[0] == GRIB_MISSING_LONG ? GRIB_MISSING_DOUBLE : val[0]; + *len = 1; } return ret; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - int ret=0,size,type,idx; + int ret = 0, size, type, idx; grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; if (!self->compressedData) { - *count=1; + *count = 1; return 0; } - type=get_native_type(a); + type = get_native_type(a); - if (type==GRIB_TYPE_STRING) { + if (type == GRIB_TYPE_STRING) { DebugAssert(self->index < self->numericValues->n); - idx=((int)self->numericValues->v[self->index]->v[0]/1000-1)/self->numberOfSubsets; - size=grib_sarray_used_size(self->stringValues->v[idx]); - } else { + idx = ((int)self->numericValues->v[self->index]->v[0] / 1000 - 1) / self->numberOfSubsets; + size = grib_sarray_used_size(self->stringValues->v[idx]); + } + else { DebugAssert(self->index < self->numericValues->n); - size=grib_darray_used_size(self->numericValues->v[self->index]); + size = grib_darray_used_size(self->numericValues->v[self->index]); } *count = size == 1 ? 1 : self->numberOfSubsets; @@ -564,8 +581,8 @@ static int unpack_double_element(grib_accessor* a, size_t idx, double* val) { /* ECC-415 */ grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; - int ret = GRIB_SUCCESS; - long count = 0; + int ret = GRIB_SUCCESS; + long count = 0; value_count(a, &count); if (idx >= count) { @@ -574,33 +591,34 @@ static int unpack_double_element(grib_accessor* a, size_t idx, double* val) if (self->compressedData) { *val = self->numericValues->v[self->index]->v[idx]; - } else { + } + else { ret = GRIB_NOT_IMPLEMENTED; } return ret; } -static int get_native_type(grib_accessor* a) +static int get_native_type(grib_accessor* a) { grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; - int ret=GRIB_TYPE_DOUBLE; + int ret = GRIB_TYPE_DOUBLE; switch (self->type) { - case BUFR_DESCRIPTOR_TYPE_STRING: - ret=GRIB_TYPE_STRING; - break; - case BUFR_DESCRIPTOR_TYPE_DOUBLE: - ret=GRIB_TYPE_DOUBLE; - break; - case BUFR_DESCRIPTOR_TYPE_LONG: - ret=GRIB_TYPE_LONG; - break; - case BUFR_DESCRIPTOR_TYPE_TABLE: - ret=GRIB_TYPE_LONG; - break; - case BUFR_DESCRIPTOR_TYPE_FLAG: - ret=GRIB_TYPE_LONG; - break; + case BUFR_DESCRIPTOR_TYPE_STRING: + ret = GRIB_TYPE_STRING; + break; + case BUFR_DESCRIPTOR_TYPE_DOUBLE: + ret = GRIB_TYPE_DOUBLE; + break; + case BUFR_DESCRIPTOR_TYPE_LONG: + ret = GRIB_TYPE_LONG; + break; + case BUFR_DESCRIPTOR_TYPE_TABLE: + ret = GRIB_TYPE_LONG; + break; + case BUFR_DESCRIPTOR_TYPE_FLAG: + ret = GRIB_TYPE_LONG; + break; } return ret; @@ -609,13 +627,14 @@ static int get_native_type(grib_accessor* a) static void destroy(grib_context* ct, grib_accessor* a) { grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; - int i=0; - if (self->cname) grib_context_free(ct,self->cname); /* ECC-765 */ - while (iattributes[i]) { + int i = 0; + if (self->cname) + grib_context_free(ct, self->cname); /* ECC-765 */ + while (i < MAX_ACCESSOR_ATTRIBUTES && a->attributes[i]) { /*grib_context_log(ct,GRIB_LOG_DEBUG,"deleting attribute %s->%s",a->name,a->attributes[i]->name);*/ /*printf("bufr_data_element destroy %s %p\n", a->attributes[i]->name, (void*)a->attributes[i]);*/ - grib_accessor_delete(ct,a->attributes[i]); - a->attributes[i]=NULL; + grib_accessor_delete(ct, a->attributes[i]); + a->attributes[i] = NULL; i++; } } diff --git a/src/grib_accessor_class_bufr_elements_table.c b/src/grib_accessor_class_bufr_elements_table.c index 68cff98af..d21077c4b 100644 --- a/src/grib_accessor_class_bufr_elements_table.c +++ b/src/grib_accessor_class_bufr_elements_table.c @@ -15,14 +15,15 @@ #include "grib_api_internal.h" #if GRIB_PTHREADS -static pthread_once_t once = PTHREAD_ONCE_INIT; +static pthread_once_t once = PTHREAD_ONCE_INIT; static pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER; -static void thread_init() { +static void thread_init() +{ pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); - pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init(&mutex1,&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&mutex1, &attr); pthread_mutexattr_destroy(&attr); } #elif GRIB_OMP_THREADS @@ -33,8 +34,7 @@ static void thread_init() { GRIB_OMP_CRITICAL(lock_grib_accessor_class_bufr_elements_table_c) { - if (once == 0) - { + if (once == 0) { omp_init_nest_lock(&mutex1); once = 1; } @@ -67,66 +67,67 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int get_native_type(grib_accessor*); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_bufr_elements_table { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in bufr_elements_table */ - const char* dictionary; - const char* masterDir; - const char* localDir; +typedef struct grib_accessor_bufr_elements_table +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in bufr_elements_table */ + const char* dictionary; + const char* masterDir; + const char* localDir; } grib_accessor_bufr_elements_table; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_bufr_elements_table = { - &grib_accessor_class_gen, /* super */ - "bufr_elements_table", /* name */ - sizeof(grib_accessor_bufr_elements_table), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "bufr_elements_table", /* name */ + sizeof(grib_accessor_bufr_elements_table), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -135,45 +136,45 @@ grib_accessor_class* grib_accessor_class_bufr_elements_table = &_grib_accessor_c static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->pack_double = (*(c->super))->pack_double; - c->pack_string = (*(c->super))->pack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->pack_double = (*(c->super))->pack_double; + c->pack_string = (*(c->super))->pack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ static void init(grib_accessor* a, const long len, grib_arguments* params) { - int n=0; - grib_accessor_bufr_elements_table* self = (grib_accessor_bufr_elements_table*)a; + int n = 0; + grib_accessor_bufr_elements_table* self = (grib_accessor_bufr_elements_table*)a; - self->dictionary = grib_arguments_get_string(grib_handle_of_accessor(a),params,n++); - self->masterDir = grib_arguments_get_name(grib_handle_of_accessor(a),params,n++); - self->localDir = grib_arguments_get_name(grib_handle_of_accessor(a),params,n++); + self->dictionary = grib_arguments_get_string(grib_handle_of_accessor(a), params, n++); + self->masterDir = grib_arguments_get_name(grib_handle_of_accessor(a), params, n++); + self->localDir = grib_arguments_get_name(grib_handle_of_accessor(a), params, n++); a->length = 0; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; @@ -183,91 +184,105 @@ static grib_trie* load_bufr_elements_table(grib_accessor* a, int* err) { grib_accessor_bufr_elements_table* self = (grib_accessor_bufr_elements_table*)a; - char* filename=NULL; - char line[1024]={0,}; - char masterDir[1024]={0,}; - char localDir[1024]={0,}; - char dictName[1024]={0,}; - char *localFilename=0; - char** list=0; - size_t len=1024; - grib_trie* dictionary=NULL; - FILE* f=NULL; - grib_handle* h=grib_handle_of_accessor(a); - grib_context* c=a->context; - - *err=GRIB_SUCCESS; - - len=1024; - if (self->masterDir != NULL) grib_get_string(h,self->masterDir,masterDir,&len); - len=1024; - if (self->localDir != NULL) grib_get_string(h,self->localDir,localDir,&len); - - GRIB_MUTEX_INIT_ONCE(&once,&thread_init); + char* filename = NULL; + char line[1024] = {0,}; + char masterDir[1024] = {0,}; + char localDir[1024] = {0,}; + char dictName[1024] = {0,}; + char* localFilename = 0; + char** list = 0; + size_t len = 1024; + grib_trie* dictionary = NULL; + FILE* f = NULL; + grib_handle* h = grib_handle_of_accessor(a); + grib_context* c = a->context; + + *err = GRIB_SUCCESS; + + len = 1024; + if (self->masterDir != NULL) + grib_get_string(h, self->masterDir, masterDir, &len); + len = 1024; + if (self->localDir != NULL) + grib_get_string(h, self->localDir, localDir, &len); + + GRIB_MUTEX_INIT_ONCE(&once, &thread_init); GRIB_MUTEX_LOCK(&mutex1); - if (*masterDir!=0) { - char name[4096]={0,}; - char recomposed[4096]={0,}; - sprintf(name,"%s/%s",masterDir,self->dictionary); - grib_recompose_name(h, NULL,name, recomposed,0); - filename=grib_context_full_defs_path(c,recomposed); - } else { - filename=grib_context_full_defs_path(c,self->dictionary); + if (*masterDir != 0) { + char name[4096] = {0,}; + char recomposed[4096] = {0,}; + sprintf(name, "%s/%s", masterDir, self->dictionary); + grib_recompose_name(h, NULL, name, recomposed, 0); + filename = grib_context_full_defs_path(c, recomposed); + } + else { + filename = grib_context_full_defs_path(c, self->dictionary); } - if (*localDir!=0) { - char localRecomposed[1024]={0,}; - char localName[2048]={0,}; - sprintf(localName,"%s/%s",localDir,self->dictionary); - grib_recompose_name(h, NULL,localName, localRecomposed,0); - localFilename=grib_context_full_defs_path(c,localRecomposed); - sprintf(dictName,"%s:%s",localFilename,filename); - } else { - sprintf(dictName,"%s",filename); + if (*localDir != 0) { + char localRecomposed[1024] = {0,}; + char localName[2048] = {0,}; + sprintf(localName, "%s/%s", localDir, self->dictionary); + grib_recompose_name(h, NULL, localName, localRecomposed, 0); + localFilename = grib_context_full_defs_path(c, localRecomposed); + sprintf(dictName, "%s:%s", localFilename, filename); + } + else { + sprintf(dictName, "%s", filename); } if (!filename) { - grib_context_log(c,GRIB_LOG_ERROR,"unable to find def file %s",self->dictionary); - *err=GRIB_FILE_NOT_FOUND; - dictionary=NULL; + grib_context_log(c, GRIB_LOG_ERROR, "unable to find def file %s", self->dictionary); + *err = GRIB_FILE_NOT_FOUND; + dictionary = NULL; goto the_end; - } else { - grib_context_log(c,GRIB_LOG_DEBUG,"found def file %s",filename); + } + else { + grib_context_log(c, GRIB_LOG_DEBUG, "found def file %s", filename); } - dictionary=(grib_trie*)grib_trie_get(c->lists,dictName); + dictionary = (grib_trie*)grib_trie_get(c->lists, dictName); if (dictionary) { /*grib_context_log(c,GRIB_LOG_DEBUG,"using dictionary %s from cache",self->dictionary);*/ goto the_end; - } else { - grib_context_log(c,GRIB_LOG_DEBUG,"using dictionary %s from file %s",self->dictionary,filename); + } + else { + grib_context_log(c, GRIB_LOG_DEBUG, "using dictionary %s from file %s", self->dictionary, filename); } - f=codes_fopen(filename,"r"); - if (!f) {*err=GRIB_IO_PROBLEM; dictionary=NULL; goto the_end;} + f = codes_fopen(filename, "r"); + if (!f) { + *err = GRIB_IO_PROBLEM; + dictionary = NULL; + goto the_end; + } - dictionary=grib_trie_new(c); + dictionary = grib_trie_new(c); - while(fgets(line,sizeof(line)-1,f)) { - list=string_split(line, "|"); - grib_trie_insert(dictionary,list[0],list); + while (fgets(line, sizeof(line) - 1, f)) { + list = string_split(line, "|"); + grib_trie_insert(dictionary, list[0], list); } fclose(f); - if (localFilename!=0) { - f=codes_fopen(localFilename,"r"); - if (!f) {*err=GRIB_IO_PROBLEM; dictionary=NULL; goto the_end;} + if (localFilename != 0) { + f = codes_fopen(localFilename, "r"); + if (!f) { + *err = GRIB_IO_PROBLEM; + dictionary = NULL; + goto the_end; + } - while(fgets(line,sizeof(line)-1,f)) { - list=string_split(line, "|"); - grib_trie_insert(dictionary,list[0],list); + while (fgets(line, sizeof(line) - 1, f)) { + list = string_split(line, "|"); + grib_trie_insert(dictionary, list[0], list); } fclose(f); } - grib_trie_insert(c->lists,dictName,dictionary); + grib_trie_insert(c->lists, dictName, dictionary); the_end: GRIB_MUTEX_UNLOCK(&mutex1); @@ -276,127 +291,136 @@ static grib_trie* load_bufr_elements_table(grib_accessor* a, int* err) static int convert_type(const char* stype) { - int ret=BUFR_DESCRIPTOR_TYPE_UNKNOWN; + int ret = BUFR_DESCRIPTOR_TYPE_UNKNOWN; switch (stype[0]) { - case 's': - if (!strcmp(stype,"string") ) ret=BUFR_DESCRIPTOR_TYPE_STRING; - break; - case 'l': - if (!strcmp(stype,"long") ) ret=BUFR_DESCRIPTOR_TYPE_LONG; - break; - case 'd': - if (!strcmp(stype,"double") ) ret=BUFR_DESCRIPTOR_TYPE_DOUBLE; - break; - case 't': - if (!strcmp(stype,"table") ) ret=BUFR_DESCRIPTOR_TYPE_TABLE; - break; - case 'f': - if (!strcmp(stype,"flag") ) ret=BUFR_DESCRIPTOR_TYPE_FLAG; - break; - default: - ret=BUFR_DESCRIPTOR_TYPE_UNKNOWN; + case 's': + if (!strcmp(stype, "string")) + ret = BUFR_DESCRIPTOR_TYPE_STRING; + break; + case 'l': + if (!strcmp(stype, "long")) + ret = BUFR_DESCRIPTOR_TYPE_LONG; + break; + case 'd': + if (!strcmp(stype, "double")) + ret = BUFR_DESCRIPTOR_TYPE_DOUBLE; + break; + case 't': + if (!strcmp(stype, "table")) + ret = BUFR_DESCRIPTOR_TYPE_TABLE; + break; + case 'f': + if (!strcmp(stype, "flag")) + ret = BUFR_DESCRIPTOR_TYPE_FLAG; + break; + default: + ret = BUFR_DESCRIPTOR_TYPE_UNKNOWN; } return ret; } -static long atol_fast(const char *input) +static long atol_fast(const char* input) { - if(strcmp(input,"0")==0) + if (strcmp(input, "0") == 0) return 0; return atol(input); } -static int bufr_get_from_table(grib_accessor* a,bufr_descriptor* v) +static int bufr_get_from_table(grib_accessor* a, bufr_descriptor* v) { - int ret=0; - char** list=0; - char code[7]={0}; + int ret = 0; + char** list = 0; + char code[7] = { 0 }; - grib_trie* table = load_bufr_elements_table(a,&ret); - if (ret) return ret; + grib_trie* table = load_bufr_elements_table(a, &ret); + if (ret) + return ret; - sprintf(code,"%06ld",v->code); + sprintf(code, "%06ld", v->code); - list=(char**)grib_trie_get(table,code); - if (!list) return GRIB_NOT_FOUND; + list = (char**)grib_trie_get(table, code); + if (!list) + return GRIB_NOT_FOUND; - v->shortName=grib_context_strdup(a->context,list[1]); - v->type=convert_type(list[2]); + v->shortName = grib_context_strdup(a->context, list[1]); + v->type = convert_type(list[2]); /* v->name=grib_context_strdup(c,list[3]); See ECC-489 */ - v->units=grib_context_strdup(a->context,list[4]); + v->units = grib_context_strdup(a->context, list[4]); /* ECC-985: Scale and reference are often 0 so we can reduce calls to atol */ - v->scale=atol_fast(list[5]); - v->factor=grib_power(-v->scale,10); + v->scale = atol_fast(list[5]); + v->factor = grib_power(-v->scale, 10); - v->reference=atol_fast(list[6]); - v->width=atol(list[7]); + v->reference = atol_fast(list[6]); + v->width = atol(list[7]); return ret; } int bufr_descriptor_is_marker(bufr_descriptor* d) { - int isMarker=0; + int isMarker = 0; switch (d->code) { - case 223255: - case 224255: - case 225255: - case 232255: - return 1; + case 223255: + case 224255: + case 225255: + case 232255: + return 1; } - if (d->F==2 && d->X==5) isMarker=1; + if (d->F == 2 && d->X == 5) + isMarker = 1; return isMarker; } -bufr_descriptor* accessor_bufr_elements_table_get_descriptor(grib_accessor* a,int code,int *err) +bufr_descriptor* accessor_bufr_elements_table_get_descriptor(grib_accessor* a, int code, int* err) { grib_context* c; - bufr_descriptor* v=NULL; + bufr_descriptor* v = NULL; - if (!a) return NULL; + if (!a) + return NULL; - c=a->context; + c = a->context; DebugAssert(c); - v=(bufr_descriptor*)grib_context_malloc_clear(c,sizeof(bufr_descriptor)); + v = (bufr_descriptor*)grib_context_malloc_clear(c, sizeof(bufr_descriptor)); if (!v) { - grib_context_log(c,GRIB_LOG_ERROR, - "grib_bufr_descriptor_new unable to allocate %d bytes\n",sizeof(bufr_descriptor)); - *err=GRIB_OUT_OF_MEMORY; + grib_context_log(c, GRIB_LOG_ERROR, + "grib_bufr_descriptor_new unable to allocate %d bytes\n", sizeof(bufr_descriptor)); + *err = GRIB_OUT_OF_MEMORY; return NULL; } - v->context=c; - v->code=code; - v->F=code/100000; - v->X=(code-v->F*100000)/1000; - v->Y=(code-v->F*100000)%1000; + v->context = c; + v->code = code; + v->F = code / 100000; + v->X = (code - v->F * 100000) / 1000; + v->Y = (code - v->F * 100000) % 1000; switch (v->F) { - case 0: - *err=bufr_get_from_table(a,v); - break; - case 1: - v->type=BUFR_DESCRIPTOR_TYPE_REPLICATION; - break; - case 2: - v->type=BUFR_DESCRIPTOR_TYPE_OPERATOR; - break; - case 3: - v->type=BUFR_DESCRIPTOR_TYPE_SEQUENCE; - break; + case 0: + *err = bufr_get_from_table(a, v); + break; + case 1: + v->type = BUFR_DESCRIPTOR_TYPE_REPLICATION; + break; + case 2: + v->type = BUFR_DESCRIPTOR_TYPE_OPERATOR; + break; + case 3: + v->type = BUFR_DESCRIPTOR_TYPE_SEQUENCE; + break; } return v; } -static int unpack_string (grib_accessor* a, char* buffer, size_t *len) +static int unpack_string(grib_accessor* a, char* buffer, size_t* len) { return GRIB_NOT_IMPLEMENTED; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - *count=1; + *count = 1; return 0; } @@ -405,12 +429,12 @@ static int get_native_type(grib_accessor* a) return GRIB_TYPE_STRING; } -static int unpack_long (grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { return GRIB_NOT_IMPLEMENTED; } -static int unpack_double (grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { return GRIB_NOT_IMPLEMENTED; } diff --git a/src/grib_accessor_class_bufr_extract_area_subsets.c b/src/grib_accessor_class_bufr_extract_area_subsets.c index 6c3148ae4..efbb6f6c0 100644 --- a/src/grib_accessor_class_bufr_extract_area_subsets.c +++ b/src/grib_accessor_class_bufr_extract_area_subsets.c @@ -41,70 +41,71 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int get_native_type(grib_accessor*); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_bufr_extract_area_subsets { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in bufr_extract_area_subsets */ - const char* doExtractSubsets; - const char* numberOfSubsets; - const char* extractSubsetList; - const char* extractAreaWestLongitude; - const char* extractAreaEastLongitude; - const char* extractAreaNorthLatitude; - const char* extractAreaSouthLatitude; - const char* extractAreaLongitudeRank; - const char* extractAreaLatitudeRank; - const char* extractedAreaNumberOfSubsets; +typedef struct grib_accessor_bufr_extract_area_subsets +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in bufr_extract_area_subsets */ + const char* doExtractSubsets; + const char* numberOfSubsets; + const char* extractSubsetList; + const char* extractAreaWestLongitude; + const char* extractAreaEastLongitude; + const char* extractAreaNorthLatitude; + const char* extractAreaSouthLatitude; + const char* extractAreaLongitudeRank; + const char* extractAreaLatitudeRank; + const char* extractedAreaNumberOfSubsets; } grib_accessor_bufr_extract_area_subsets; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_bufr_extract_area_subsets = { - &grib_accessor_class_gen, /* super */ - "bufr_extract_area_subsets", /* name */ - sizeof(grib_accessor_bufr_extract_area_subsets), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "bufr_extract_area_subsets", /* name */ + sizeof(grib_accessor_bufr_extract_area_subsets), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -113,56 +114,56 @@ grib_accessor_class* grib_accessor_class_bufr_extract_area_subsets = &_grib_acce static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len , grib_arguments* arg ) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { - int n=0; - grib_accessor_bufr_extract_area_subsets *self =(grib_accessor_bufr_extract_area_subsets*)a; - - a->length=0; - self->doExtractSubsets = grib_arguments_get_name(grib_handle_of_accessor(a),arg,n++); - self->numberOfSubsets = grib_arguments_get_name(grib_handle_of_accessor(a),arg,n++); - self->extractSubsetList = grib_arguments_get_name(grib_handle_of_accessor(a),arg,n++); - self->extractAreaWestLongitude = grib_arguments_get_name(grib_handle_of_accessor(a),arg,n++); - self->extractAreaEastLongitude = grib_arguments_get_name(grib_handle_of_accessor(a),arg,n++); - self->extractAreaNorthLatitude = grib_arguments_get_name(grib_handle_of_accessor(a),arg,n++); - self->extractAreaSouthLatitude = grib_arguments_get_name(grib_handle_of_accessor(a),arg,n++); - self->extractAreaLongitudeRank = grib_arguments_get_name(grib_handle_of_accessor(a),arg,n++); - self->extractAreaLatitudeRank = grib_arguments_get_name(grib_handle_of_accessor(a),arg,n++); - self->extractedAreaNumberOfSubsets = grib_arguments_get_name(grib_handle_of_accessor(a),arg,n++); + int n = 0; + grib_accessor_bufr_extract_area_subsets* self = (grib_accessor_bufr_extract_area_subsets*)a; + + a->length = 0; + self->doExtractSubsets = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); + self->numberOfSubsets = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); + self->extractSubsetList = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); + self->extractAreaWestLongitude = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); + self->extractAreaEastLongitude = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); + self->extractAreaNorthLatitude = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); + self->extractAreaSouthLatitude = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); + self->extractAreaLongitudeRank = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); + self->extractAreaLatitudeRank = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); + self->extractedAreaNumberOfSubsets = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; } @@ -176,143 +177,168 @@ static int get_native_type(grib_accessor* a) static void fill_in(double a[], long length) { long i; - for (i=1; icontext; - - double *lat=0; - double *lon=0; + int ret = 0; + long compressed = 0; + grib_accessor_bufr_extract_area_subsets* self = (grib_accessor_bufr_extract_area_subsets*)a; + grib_handle* h = grib_handle_of_accessor(a); + grib_context* c = h->context; + + double* lat = 0; + double* lon = 0; size_t n; - double lonWest,lonEast,latNorth,latSouth; - long numberOfSubsets,i,latRank,lonRank; + double lonWest, lonEast, latNorth, latSouth; + long numberOfSubsets, i, latRank, lonRank; grib_iarray* subsets; - long *subsets_ar=0; - size_t nsubsets=0; - char latstr[20]={0,}; - char lonstr[20]={0,}; + long* subsets_ar = 0; + size_t nsubsets = 0; + char latstr[20] = {0,}; + char lonstr[20] = {0,}; - ret=grib_get_long(h,"compressedData",&compressed); - if (ret) return ret; + ret = grib_get_long(h, "compressedData", &compressed); + if (ret) + return ret; - ret=grib_get_long(h,self->numberOfSubsets,&numberOfSubsets); - if (ret) return ret; + ret = grib_get_long(h, self->numberOfSubsets, &numberOfSubsets); + if (ret) + return ret; - subsets=grib_iarray_new(c,numberOfSubsets,10); + subsets = grib_iarray_new(c, numberOfSubsets, 10); - ret=grib_set_long(h,"unpack",1); - if (ret) return ret; + ret = grib_set_long(h, "unpack", 1); + if (ret) + return ret; if (compressed) { - ret=grib_get_long(h,self->extractAreaLongitudeRank,&lonRank); - if (ret) return ret; - sprintf(lonstr,"#%ld#longitude",lonRank); - ret=grib_get_long(h,self->extractAreaLatitudeRank,&latRank); - if (ret) return ret; - sprintf(latstr,"#%ld#latitude",latRank); + ret = grib_get_long(h, self->extractAreaLongitudeRank, &lonRank); + if (ret) + return ret; + sprintf(lonstr, "#%ld#longitude", lonRank); + ret = grib_get_long(h, self->extractAreaLatitudeRank, &latRank); + if (ret) + return ret; + sprintf(latstr, "#%ld#latitude", latRank); } /* Latitudes */ - n=numberOfSubsets; - lat=(double*)grib_context_malloc_clear(c,sizeof(double)*numberOfSubsets); + n = numberOfSubsets; + lat = (double*)grib_context_malloc_clear(c, sizeof(double) * numberOfSubsets); if (compressed) { - ret=grib_get_double_array(h,latstr,lat,&n); - if (ret) return ret; - if (! (n==1 || n==numberOfSubsets) ) { + ret = grib_get_double_array(h, latstr, lat, &n); + if (ret) + return ret; + if (!(n == 1 || n == numberOfSubsets)) { /* n can be 1 if all latitudes are the same */ return GRIB_INTERNAL_ERROR; } if (n == 1) { fill_in(lat, numberOfSubsets); } - } else { - size_t values_len=0; - for(i=0; i1) + } + else { + size_t values_len = 0; + for (i = 0; i < numberOfSubsets; ++i) { + sprintf(latstr, "#%ld#latitude", i + 1); + ret = grib_get_size(h, latstr, &values_len); + if (ret) + return ret; + if (values_len > 1) return GRIB_NOT_IMPLEMENTED; - ret=grib_get_double(h,latstr,&(lat[i])); - if (ret) return ret; + ret = grib_get_double(h, latstr, &(lat[i])); + if (ret) + return ret; } } /* Longitudes */ - n=numberOfSubsets; - lon=(double*)grib_context_malloc_clear(c,sizeof(double)*numberOfSubsets); + n = numberOfSubsets; + lon = (double*)grib_context_malloc_clear(c, sizeof(double) * numberOfSubsets); if (compressed) { - ret=grib_get_double_array(h,lonstr,lon,&n); - if (ret) return ret; - if (! (n==1 || n==numberOfSubsets) ) { + ret = grib_get_double_array(h, lonstr, lon, &n); + if (ret) + return ret; + if (!(n == 1 || n == numberOfSubsets)) { /* n can be 1 if all longitudes are the same */ return GRIB_INTERNAL_ERROR; } if (n == 1) { fill_in(lon, numberOfSubsets); } - } else { - size_t values_len=0; - for(i=0; i1) + } + else { + size_t values_len = 0; + for (i = 0; i < numberOfSubsets; ++i) { + sprintf(lonstr, "#%ld#longitude", i + 1); + ret = grib_get_size(h, lonstr, &values_len); + if (ret) + return ret; + if (values_len > 1) return GRIB_NOT_IMPLEMENTED; - ret=grib_get_double(h,lonstr,&(lon[i])); - if (ret) return ret; + ret = grib_get_double(h, lonstr, &(lon[i])); + if (ret) + return ret; } } - ret=grib_get_double(h,self->extractAreaWestLongitude,&lonWest); - if (ret) return ret; - ret=grib_get_double(h,self->extractAreaEastLongitude,&lonEast); - if (ret) return ret; - ret=grib_get_double(h,self->extractAreaNorthLatitude,&latNorth); - if (ret) return ret; - ret=grib_get_double(h,self->extractAreaSouthLatitude,&latSouth); - if (ret) return ret; - - for (i=0;iextractAreaWestLongitude, &lonWest); + if (ret) + return ret; + ret = grib_get_double(h, self->extractAreaEastLongitude, &lonEast); + if (ret) + return ret; + ret = grib_get_double(h, self->extractAreaNorthLatitude, &latNorth); + if (ret) + return ret; + ret = grib_get_double(h, self->extractAreaSouthLatitude, &latSouth); + if (ret) + return ret; + + for (i = 0; i < numberOfSubsets; i++) { /* printf("++++++ lat: %g <= %g <= %g lon: %g <= %g <= %g \n",latSouth,lat[i],latNorth,lonWest,lon[i],lonEast); */ - if (lat[i]>=latSouth && lat[i]<=latNorth && lon[i]>=lonWest && lon[i]<=lonEast) { - grib_iarray_push(subsets,i+1); + if (lat[i] >= latSouth && lat[i] <= latNorth && lon[i] >= lonWest && lon[i] <= lonEast) { + grib_iarray_push(subsets, i + 1); /* printf("++++++++ %ld\n",i+1); */ } } - nsubsets=grib_iarray_used_size(subsets); - ret=grib_set_long(h,self->extractedAreaNumberOfSubsets,nsubsets); - if (ret) return ret; + nsubsets = grib_iarray_used_size(subsets); + ret = grib_set_long(h, self->extractedAreaNumberOfSubsets, nsubsets); + if (ret) + return ret; - if (nsubsets!=0) { - subsets_ar=grib_iarray_get_array(subsets); - ret=grib_set_long_array(h,self->extractSubsetList,subsets_ar,nsubsets); - if (ret) return ret; + if (nsubsets != 0) { + subsets_ar = grib_iarray_get_array(subsets); + ret = grib_set_long_array(h, self->extractSubsetList, subsets_ar, nsubsets); + if (ret) + return ret; - ret=grib_set_long(h,self->doExtractSubsets,1); - if (ret) return ret; + ret = grib_set_long(h, self->doExtractSubsets, 1); + if (ret) + return ret; } - grib_context_free(c,lat); - grib_context_free(c,lon); + grib_context_free(c, lat); + grib_context_free(c, lon); grib_iarray_delete(subsets); - subsets=0; + subsets = 0; return ret; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { - int err=0; + int err = 0; /*grib_accessor_bufr_extract_area_subsets *self =(grib_accessor_bufr_extract_area_subsets*)a;*/ - if (*len==0) return GRIB_SUCCESS; - err=select_area(a); - if (err) return err; + if (*len == 0) + return GRIB_SUCCESS; + err = select_area(a); + if (err) + return err; return err; } diff --git a/src/grib_accessor_class_bufr_extract_datetime_subsets.c b/src/grib_accessor_class_bufr_extract_datetime_subsets.c index 496e66f25..4d7482bb7 100644 --- a/src/grib_accessor_class_bufr_extract_datetime_subsets.c +++ b/src/grib_accessor_class_bufr_extract_datetime_subsets.c @@ -34,63 +34,64 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int get_native_type(grib_accessor*); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_bufr_extract_datetime_subsets { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in bufr_extract_datetime_subsets */ - const char* doExtractSubsets; - const char* numberOfSubsets; - const char* extractSubsetList; +typedef struct grib_accessor_bufr_extract_datetime_subsets +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in bufr_extract_datetime_subsets */ + const char* doExtractSubsets; + const char* numberOfSubsets; + const char* extractSubsetList; } grib_accessor_bufr_extract_datetime_subsets; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_bufr_extract_datetime_subsets = { - &grib_accessor_class_gen, /* super */ - "bufr_extract_datetime_subsets", /* name */ - sizeof(grib_accessor_bufr_extract_datetime_subsets), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "bufr_extract_datetime_subsets", /* name */ + sizeof(grib_accessor_bufr_extract_datetime_subsets), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -99,49 +100,49 @@ grib_accessor_class* grib_accessor_class_bufr_extract_datetime_subsets = &_grib_ static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len , grib_arguments* arg ) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { - int n=0; - grib_accessor_bufr_extract_datetime_subsets *self =(grib_accessor_bufr_extract_datetime_subsets*)a; + int n = 0; + grib_accessor_bufr_extract_datetime_subsets* self = (grib_accessor_bufr_extract_datetime_subsets*)a; - a->length=0; - self->doExtractSubsets = grib_arguments_get_name(grib_handle_of_accessor(a),arg,n++); - self->numberOfSubsets = grib_arguments_get_name(grib_handle_of_accessor(a),arg,n++); - self->extractSubsetList = grib_arguments_get_name(grib_handle_of_accessor(a),arg,n++); + a->length = 0; + self->doExtractSubsets = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); + self->numberOfSubsets = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); + self->extractSubsetList = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; } @@ -152,66 +153,72 @@ static int get_native_type(grib_accessor* a) } /* Convert input date to Julian number. If date is invalid, return -1 */ -static double date_to_julian(long year,long month,long day,long hour,long minute,double second) +static double date_to_julian(long year, long month, long day, long hour, long minute, double second) { double result = 0; /* For validating the date/time, we specify seconds as an integer */ long lSecond = (long)second; - grib_datetime_to_julian(year,month,day,hour,minute,lSecond, &result); + grib_datetime_to_julian(year, month, day, hour, minute, lSecond, &result); { /* Check conversion worked by going other way */ long year1, month1, day1, hour1, minute1, lSecond1; grib_julian_to_datetime(result, &year1, &month1, &day1, &hour1, &minute1, &lSecond1); - if (year1 != year || month1 != month || day1 != day || minute1 != minute || lSecond1 != lSecond) - { + if (year1 != year || month1 != month || day1 != day || minute1 != minute || lSecond1 != lSecond) { return -1; /* Failed. Invalid date*/ } } /* Now get the proper Julian number specifying the seconds in double precision */ - grib_datetime_to_julian_d(year,month,day,hour,minute,second, &result); + grib_datetime_to_julian_d(year, month, day, hour, minute, second, &result); return result; } /* Helper function to construct the array of long for year, month, day etc. */ /* The boolean zero_on_error flag is for the case where codes_get fails and we fill with zeros */ static int build_long_array(grib_context* c, grib_handle* h, int compressed, - long** array, const char* key, long numberOfSubsets, int zero_on_error) + long** array, const char* key, long numberOfSubsets, int zero_on_error) { int err = 0; long i; - size_t n=numberOfSubsets; - *array=(long*)grib_context_malloc_clear(c, sizeof(long)*numberOfSubsets); - if(compressed) { + size_t n = numberOfSubsets; + *array = (long*)grib_context_malloc_clear(c, sizeof(long) * numberOfSubsets); + if (compressed) { err = grib_get_long_array(h, key, *array, &n); if (zero_on_error) { if (err) { - err = 0; + err = 0; (*array)[0] = 0; - n = 1; + n = 1; } } - if (err) return err; - if (n!=numberOfSubsets) { - if (n==1) { - for (i=1;i1) + sprintf(keystr, "#%ld#%s", i + 1, key); + err = grib_get_size(h, keystr, &values_len); + if (err) + return err; + if (values_len > 1) return GRIB_NOT_IMPLEMENTED; - err=grib_get_long(h,keystr, &lVal ); - if (err) return err; - (*array)[i]=lVal; + err = grib_get_long(h, keystr, &lVal); + if (err) + return err; + (*array)[i] = lVal; } } return err; @@ -219,212 +226,252 @@ static int build_long_array(grib_context* c, grib_handle* h, int compressed, static int select_datetime(grib_accessor* a) { - int ret=0; - long compressed=0; - grib_accessor_bufr_extract_datetime_subsets *self =(grib_accessor_bufr_extract_datetime_subsets*)a; - grib_handle* h=grib_handle_of_accessor(a); - grib_context* c=h->context; + int ret = 0; + long compressed = 0; + grib_accessor_bufr_extract_datetime_subsets* self = (grib_accessor_bufr_extract_datetime_subsets*)a; + grib_handle* h = grib_handle_of_accessor(a); + grib_context* c = h->context; size_t n; - double julianStart=0, julianEnd=0, julianDT=0; - char start_str[80]={0,},end_str[80]={0,},datetime_str[80]={0,}; - long yearRank,monthRank,dayRank,hourRank,minuteRank,secondRank; - long yearStart,monthStart,dayStart,hourStart,minuteStart,secondStart; - long yearEnd,monthEnd,dayEnd,hourEnd,minuteEnd,secondEnd; - long *year,*month,*day,*hour,*minute; - double *second; - long numberOfSubsets,i; + double julianStart = 0, julianEnd = 0, julianDT = 0; + char start_str[80] = {0,}, end_str[80] = {0,}, datetime_str[80] = {0,}; + long yearRank, monthRank, dayRank, hourRank, minuteRank, secondRank; + long yearStart, monthStart, dayStart, hourStart, minuteStart, secondStart; + long yearEnd, monthEnd, dayEnd, hourEnd, minuteEnd, secondEnd; + long *year, *month, *day, *hour, *minute; + double* second; + long numberOfSubsets, i; grib_iarray* subsets; - long *subsets_ar=0; - size_t nsubsets=0; - char yearstr[20]="year"; - char monthstr[20]="month"; - char daystr[20]="day"; - char hourstr[20]="hour"; - char minutestr[20]="minute"; - char secondstr[20]="second"; + long* subsets_ar = 0; + size_t nsubsets = 0; + char yearstr[20] = "year"; + char monthstr[20] = "month"; + char daystr[20] = "day"; + char hourstr[20] = "hour"; + char minutestr[20] = "minute"; + char secondstr[20] = "second"; - ret=grib_get_long(h,"compressedData",&compressed); - if (ret) return ret; + ret = grib_get_long(h, "compressedData", &compressed); + if (ret) + return ret; - ret=grib_get_long(h,self->numberOfSubsets,&numberOfSubsets); - if (ret) return ret; + ret = grib_get_long(h, self->numberOfSubsets, &numberOfSubsets); + if (ret) + return ret; - subsets=grib_iarray_new(c,numberOfSubsets,10); + subsets = grib_iarray_new(c, numberOfSubsets, 10); - ret=grib_set_long(h,"unpack",1); - if (ret) return ret; + ret = grib_set_long(h, "unpack", 1); + if (ret) + return ret; if (compressed) { - ret=grib_get_long(h,"extractDateTimeYearRank",&yearRank); - if (ret) return ret; - sprintf(yearstr,"#%ld#year",yearRank); - - ret=grib_get_long(h,"extractDateTimeMonthRank",&monthRank); - if (ret) return ret; - sprintf(monthstr,"#%ld#month",monthRank); - - ret=grib_get_long(h,"extractDateTimeDayRank",&dayRank); - if (ret) return ret; - sprintf(daystr,"#%ld#day",dayRank); - - ret=grib_get_long(h,"extractDateTimeHourRank",&hourRank); - if (ret) return ret; - sprintf(hourstr,"#%ld#hour",hourRank); - - ret=grib_get_long(h,"extractDateTimeMinuteRank",&minuteRank); - if (ret) return ret; - sprintf(minutestr,"#%ld#minute",minuteRank); - - ret=grib_get_long(h,"extractDateTimeSecondRank",&secondRank); - if (ret) return ret; - sprintf(secondstr,"#%ld#second",secondRank); + ret = grib_get_long(h, "extractDateTimeYearRank", &yearRank); + if (ret) + return ret; + sprintf(yearstr, "#%ld#year", yearRank); + + ret = grib_get_long(h, "extractDateTimeMonthRank", &monthRank); + if (ret) + return ret; + sprintf(monthstr, "#%ld#month", monthRank); + + ret = grib_get_long(h, "extractDateTimeDayRank", &dayRank); + if (ret) + return ret; + sprintf(daystr, "#%ld#day", dayRank); + + ret = grib_get_long(h, "extractDateTimeHourRank", &hourRank); + if (ret) + return ret; + sprintf(hourstr, "#%ld#hour", hourRank); + + ret = grib_get_long(h, "extractDateTimeMinuteRank", &minuteRank); + if (ret) + return ret; + sprintf(minutestr, "#%ld#minute", minuteRank); + + ret = grib_get_long(h, "extractDateTimeSecondRank", &secondRank); + if (ret) + return ret; + sprintf(secondstr, "#%ld#second", secondRank); } /* YEAR */ ret = build_long_array(c, h, compressed, &year, yearstr, numberOfSubsets, 0); - if (ret) return ret; + if (ret) + return ret; /* MONTH */ ret = build_long_array(c, h, compressed, &month, monthstr, numberOfSubsets, 0); - if (ret) return ret; + if (ret) + return ret; /* DAY */ ret = build_long_array(c, h, compressed, &day, daystr, numberOfSubsets, 0); - if (ret) return ret; + if (ret) + return ret; /* HOUR */ ret = build_long_array(c, h, compressed, &hour, hourstr, numberOfSubsets, 0); - if (ret) return ret; + if (ret) + return ret; /* MINUTE: Special treatment if error => set all entries to zero */ ret = build_long_array(c, h, compressed, &minute, minutestr, numberOfSubsets, 1); - if (ret) return ret; + if (ret) + return ret; /* SECOND: Double array */ - n=numberOfSubsets; - second=(double*)grib_context_malloc_clear(c,sizeof(double)*numberOfSubsets); - if(compressed) { - ret=grib_get_double_array(h,secondstr,second,&n); + n = numberOfSubsets; + second = (double*)grib_context_malloc_clear(c, sizeof(double) * numberOfSubsets); + if (compressed) { + ret = grib_get_double_array(h, secondstr, second, &n); if (ret) { - ret=0; - second[0]=0; - n=1; + ret = 0; + second[0] = 0; + n = 1; } - if (n!=numberOfSubsets) { - if (n==1) { - for (i=1;i1) return GRIB_NOT_IMPLEMENTED; - ret=grib_get_double(h,secondstr,&(second[i])); - if (ret) return ret; + for (i = 1; i < numberOfSubsets; i++) + second[i] = second[0]; + } + else { + if (values_len > 1) + return GRIB_NOT_IMPLEMENTED; + ret = grib_get_double(h, secondstr, &(second[i])); + if (ret) + return ret; } } } - ret=grib_get_long(h,"extractDateTimeYearStart",&yearStart); - if (ret) return ret; - ret=grib_get_long(h,"extractDateTimeMonthStart",&monthStart); - if (ret) return ret; - ret=grib_get_long(h,"extractDateTimeDayStart",&dayStart); - if (ret) return ret; - ret=grib_get_long(h,"extractDateTimeHourStart",&hourStart); - if (ret) return ret; - ret=grib_get_long(h,"extractDateTimeMinuteStart",&minuteStart); - if (ret) minuteStart=0; - ret=grib_get_long(h,"extractDateTimeSecondStart",&secondStart); - if (ret) secondStart=0; - sprintf(start_str,"%04ld/%02ld/%02ld %02ld:%02ld:%02ld",yearStart,monthStart,dayStart,hourStart,minuteStart,secondStart); - julianStart = date_to_julian(yearStart,monthStart,dayStart,hourStart,minuteStart,secondStart); + ret = grib_get_long(h, "extractDateTimeYearStart", &yearStart); + if (ret) + return ret; + ret = grib_get_long(h, "extractDateTimeMonthStart", &monthStart); + if (ret) + return ret; + ret = grib_get_long(h, "extractDateTimeDayStart", &dayStart); + if (ret) + return ret; + ret = grib_get_long(h, "extractDateTimeHourStart", &hourStart); + if (ret) + return ret; + ret = grib_get_long(h, "extractDateTimeMinuteStart", &minuteStart); + if (ret) + minuteStart = 0; + ret = grib_get_long(h, "extractDateTimeSecondStart", &secondStart); + if (ret) + secondStart = 0; + sprintf(start_str, "%04ld/%02ld/%02ld %02ld:%02ld:%02ld", yearStart, monthStart, dayStart, hourStart, minuteStart, secondStart); + julianStart = date_to_julian(yearStart, monthStart, dayStart, hourStart, minuteStart, secondStart); if (julianStart == -1) { - grib_context_log(c,GRIB_LOG_ERROR,"Invalid start date/time: %s", start_str); + grib_context_log(c, GRIB_LOG_ERROR, "Invalid start date/time: %s", start_str); return GRIB_INTERNAL_ERROR; } - ret=grib_get_long(h,"extractDateTimeYearEnd",&yearEnd); - if (ret) return ret; - ret=grib_get_long(h,"extractDateTimeMonthEnd",&monthEnd); - if (ret) return ret; - ret=grib_get_long(h,"extractDateTimeDayEnd",&dayEnd); - if (ret) return ret; - ret=grib_get_long(h,"extractDateTimeHourEnd",&hourEnd); - if (ret) return ret; - ret=grib_get_long(h,"extractDateTimeMinuteEnd",&minuteEnd); - if (ret) minuteEnd=0; - ret=grib_get_long(h,"extractDateTimeSecondEnd",&secondEnd); - if (ret) secondEnd=0; - sprintf(end_str,"%04ld/%02ld/%02ld %02ld:%02ld:%02ld",yearEnd,monthEnd,dayEnd,hourEnd,minuteEnd,secondEnd); - julianEnd = date_to_julian(yearEnd,monthEnd,dayEnd,hourEnd,minuteEnd,secondEnd); + ret = grib_get_long(h, "extractDateTimeYearEnd", &yearEnd); + if (ret) + return ret; + ret = grib_get_long(h, "extractDateTimeMonthEnd", &monthEnd); + if (ret) + return ret; + ret = grib_get_long(h, "extractDateTimeDayEnd", &dayEnd); + if (ret) + return ret; + ret = grib_get_long(h, "extractDateTimeHourEnd", &hourEnd); + if (ret) + return ret; + ret = grib_get_long(h, "extractDateTimeMinuteEnd", &minuteEnd); + if (ret) + minuteEnd = 0; + ret = grib_get_long(h, "extractDateTimeSecondEnd", &secondEnd); + if (ret) + secondEnd = 0; + sprintf(end_str, "%04ld/%02ld/%02ld %02ld:%02ld:%02ld", yearEnd, monthEnd, dayEnd, hourEnd, minuteEnd, secondEnd); + julianEnd = date_to_julian(yearEnd, monthEnd, dayEnd, hourEnd, minuteEnd, secondEnd); if (julianEnd == -1) { - grib_context_log(c,GRIB_LOG_ERROR,"Invalid end date/time: %s", end_str); + grib_context_log(c, GRIB_LOG_ERROR, "Invalid end date/time: %s", end_str); return GRIB_INTERNAL_ERROR; } if (julianEnd <= julianStart) { - grib_context_log(c,GRIB_LOG_ERROR,"Wrong definition of time interval: end (%s) is not after start (%s)",end_str,start_str); + grib_context_log(c, GRIB_LOG_ERROR, "Wrong definition of time interval: end (%s) is not after start (%s)", end_str, start_str); return GRIB_INTERNAL_ERROR; } - for (i=0;i=julianStart && julianEnd>=julianDT) { + if (julianDT >= julianStart && julianEnd >= julianDT) { /*printf(" ....ADDING subset %ld\n",i);*/ - grib_iarray_push(subsets,i+1); - } else { + grib_iarray_push(subsets, i + 1); + } + else { /*printf(" ....Exclude subset %ld\n",i);*/ } } - nsubsets=grib_iarray_used_size(subsets); - ret=grib_set_long(h,"extractedDateTimeNumberOfSubsets",nsubsets); - if (ret) return ret; + nsubsets = grib_iarray_used_size(subsets); + ret = grib_set_long(h, "extractedDateTimeNumberOfSubsets", nsubsets); + if (ret) + return ret; - if (nsubsets!=0) { - subsets_ar=grib_iarray_get_array(subsets); - ret=grib_set_long_array(h,self->extractSubsetList,subsets_ar,nsubsets); - if (ret) return ret; + if (nsubsets != 0) { + subsets_ar = grib_iarray_get_array(subsets); + ret = grib_set_long_array(h, self->extractSubsetList, subsets_ar, nsubsets); + if (ret) + return ret; - ret=grib_set_long(h,self->doExtractSubsets,1); - if (ret) return ret; + ret = grib_set_long(h, self->doExtractSubsets, 1); + if (ret) + return ret; } - grib_context_free(c,year); - grib_context_free(c,month); - grib_context_free(c,day); - grib_context_free(c,hour); - grib_context_free(c,minute); - grib_context_free(c,second); + grib_context_free(c, year); + grib_context_free(c, month); + grib_context_free(c, day); + grib_context_free(c, hour); + grib_context_free(c, minute); + grib_context_free(c, second); grib_iarray_delete(subsets); - subsets=0; + subsets = 0; return ret; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { - int err=0; + int err = 0; /*grib_accessor_bufr_extract_datetime_subsets *self =(grib_accessor_bufr_extract_datetime_subsets*)a;*/ - if (*len==0) return GRIB_SUCCESS; - err=select_datetime(a); - if (err) return err; + if (*len == 0) + return GRIB_SUCCESS; + err = select_datetime(a); + if (err) + return err; return err; } diff --git a/src/grib_accessor_class_bufr_extract_subsets.c b/src/grib_accessor_class_bufr_extract_subsets.c index a67239640..33471fee3 100644 --- a/src/grib_accessor_class_bufr_extract_subsets.c +++ b/src/grib_accessor_class_bufr_extract_subsets.c @@ -35,64 +35,65 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int get_native_type(grib_accessor*); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_bufr_extract_subsets { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in bufr_extract_subsets */ - const char* numericValues; - const char* pack; - grib_accessor* numericValuesAccessor; - grib_accessor* packAccessor; +typedef struct grib_accessor_bufr_extract_subsets +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in bufr_extract_subsets */ + const char* numericValues; + const char* pack; + grib_accessor* numericValuesAccessor; + grib_accessor* packAccessor; } grib_accessor_bufr_extract_subsets; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_bufr_extract_subsets = { - &grib_accessor_class_gen, /* super */ - "bufr_extract_subsets", /* name */ - sizeof(grib_accessor_bufr_extract_subsets), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "bufr_extract_subsets", /* name */ + sizeof(grib_accessor_bufr_extract_subsets), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -101,58 +102,59 @@ grib_accessor_class* grib_accessor_class_bufr_extract_subsets = &_grib_accessor_ static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ static void get_accessors(grib_accessor* a) { - grib_accessor_bufr_extract_subsets *self =(grib_accessor_bufr_extract_subsets*)a; - grib_handle* h=grib_handle_of_accessor(a); + grib_accessor_bufr_extract_subsets* self = (grib_accessor_bufr_extract_subsets*)a; + grib_handle* h = grib_handle_of_accessor(a); - if (self->packAccessor) return; - self->numericValuesAccessor=grib_find_accessor(h,self->numericValues); - self->packAccessor=grib_find_accessor(h,self->pack); + if (self->packAccessor) + return; + self->numericValuesAccessor = grib_find_accessor(h, self->numericValues); + self->packAccessor = grib_find_accessor(h, self->pack); } -static void init(grib_accessor* a, const long len , grib_arguments* arg ) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { - int n=0; - grib_accessor_bufr_extract_subsets *self =(grib_accessor_bufr_extract_subsets*)a; + int n = 0; + grib_accessor_bufr_extract_subsets* self = (grib_accessor_bufr_extract_subsets*)a; - a->length=0; - self->numericValues = grib_arguments_get_name(grib_handle_of_accessor(a),arg,n++); - self->pack = grib_arguments_get_name(grib_handle_of_accessor(a),arg,n++); + a->length = 0; + self->numericValues = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); + self->pack = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; } @@ -161,20 +163,20 @@ static int get_native_type(grib_accessor* a) return GRIB_TYPE_LONG; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { - int err=0; - grib_accessor_bufr_extract_subsets *self =(grib_accessor_bufr_extract_subsets*)a; - size_t l=1; + int err = 0; + grib_accessor_bufr_extract_subsets* self = (grib_accessor_bufr_extract_subsets*)a; + size_t l = 1; long v[1]; get_accessors(a); - v[0]=1; - err=grib_pack_long(self->packAccessor,v,&l); + v[0] = 1; + err = grib_pack_long(self->packAccessor, v, &l); if (err) { if (err == GRIB_ENCODING_ERROR) - grib_context_log(a->context,GRIB_LOG_ERROR,"Could not extract subset(s).\n\tHint: Did you forget to set unpack=1?"); + grib_context_log(a->context, GRIB_LOG_ERROR, "Could not extract subset(s).\n\tHint: Did you forget to set unpack=1?"); return err; } diff --git a/src/grib_accessor_class_bufr_group.c b/src/grib_accessor_class_bufr_group.c index abc81adb2..fb02477f5 100644 --- a/src/grib_accessor_class_bufr_group.c +++ b/src/grib_accessor_class_bufr_group.c @@ -35,60 +35,61 @@ static void dump(grib_accessor*, grib_dumper*); static void init_class(grib_accessor_class*); static grib_accessor* next(grib_accessor*, int); -typedef struct grib_accessor_bufr_group { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in variable */ - double dval; - char* cval; - char* cname; - int type; -/* Members defined in bufr_group */ +typedef struct grib_accessor_bufr_group +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in variable */ + double dval; + char* cval; + char* cname; + int type; + /* Members defined in bufr_group */ } grib_accessor_bufr_group; extern grib_accessor_class* grib_accessor_class_variable; static grib_accessor_class _grib_accessor_class_bufr_group = { - &grib_accessor_class_variable, /* super */ - "bufr_group", /* name */ - sizeof(grib_accessor_bufr_group), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - &next, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_variable, /* super */ + "bufr_group", /* name */ + sizeof(grib_accessor_bufr_group), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + &next, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -97,57 +98,59 @@ grib_accessor_class* grib_accessor_class_bufr_group = &_grib_accessor_class_bufr static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_section(dumper,a,a->sub_section->block); + grib_dump_section(dumper, a, a->sub_section->block); } -static grib_accessor* next(grib_accessor* a,int explore) +static grib_accessor* next(grib_accessor* a, int explore) { - grib_accessor* next=NULL; + grib_accessor* next = NULL; if (explore) { - next=a->sub_section->block->first; - if (!next) next=a->next; - } else { - next=a->next; + next = a->sub_section->block->first; + if (!next) + next = a->next; + } + else { + next = a->next; } if (!next) { if (a->parent->owner) - next=a->parent->owner->cclass->next(a->parent->owner,0); + next = a->parent->owner->cclass->next(a->parent->owner, 0); } return next; } diff --git a/src/grib_accessor_class_bufr_has_delayed_replication.c b/src/grib_accessor_class_bufr_has_delayed_replication.c index b80ba4324..6582b8e5d 100644 --- a/src/grib_accessor_class_bufr_has_delayed_replication.c +++ b/src/grib_accessor_class_bufr_has_delayed_replication.c @@ -35,63 +35,64 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int get_native_type(grib_accessor*); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_bufr_has_delayed_replication { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in bufr_has_delayed_replication */ - const char* expandedDescriptors; +typedef struct grib_accessor_bufr_has_delayed_replication +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in bufr_has_delayed_replication */ + const char* expandedDescriptors; } grib_accessor_bufr_has_delayed_replication; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_bufr_has_delayed_replication = { - &grib_accessor_class_long, /* super */ - "bufr_has_delayed_replication", /* name */ - sizeof(grib_accessor_bufr_has_delayed_replication), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "bufr_has_delayed_replication", /* name */ + sizeof(grib_accessor_bufr_has_delayed_replication), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -100,85 +101,87 @@ grib_accessor_class* grib_accessor_class_bufr_has_delayed_replication = &_grib_a static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len , grib_arguments* args ) +static void init(grib_accessor* a, const long len, grib_arguments* args) { grib_accessor_bufr_has_delayed_replication* self = (grib_accessor_bufr_has_delayed_replication*)a; - int n=0; - self->expandedDescriptors=grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - a->length = 0; - a->flags=GRIB_ACCESSOR_FLAG_HIDDEN; + int n = 0; + self->expandedDescriptors = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + a->length = 0; + a->flags = GRIB_ACCESSOR_FLAG_HIDDEN; } -static int get_native_type(grib_accessor* a) +static int get_native_type(grib_accessor* a) { return GRIB_TYPE_LONG; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_bufr_has_delayed_replication* self = (grib_accessor_bufr_has_delayed_replication*)a; - size_t size=0,i=0; - long* descriptors=0; - int err=0; + size_t size = 0, i = 0; + long* descriptors = 0; + int err = 0; long F; - grib_context* c=a->context; + grib_context* c = a->context; - err=grib_get_size(grib_handle_of_accessor(a),self->expandedDescriptors,&size); - if (err) return err; + err = grib_get_size(grib_handle_of_accessor(a), self->expandedDescriptors, &size); + if (err) + return err; - descriptors=(long*)grib_context_malloc_clear(c,sizeof(long)*size); + descriptors = (long*)grib_context_malloc_clear(c, sizeof(long) * size); - err=grib_get_long_array(grib_handle_of_accessor(a),self->expandedDescriptors,descriptors,&size); - if (err) return err; + err = grib_get_long_array(grib_handle_of_accessor(a), self->expandedDescriptors, descriptors, &size); + if (err) + return err; - *val=0; - for (i=0;idump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len , grib_arguments* arg ) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { - int n=0; - grib_accessor_bufr_simple_thinning *self =(grib_accessor_bufr_simple_thinning*)a; + int n = 0; + grib_accessor_bufr_simple_thinning* self = (grib_accessor_bufr_simple_thinning*)a; - a->length=0; - self->doExtractSubsets = grib_arguments_get_name(grib_handle_of_accessor(a),arg,n++); - self->numberOfSubsets = grib_arguments_get_name(grib_handle_of_accessor(a),arg,n++); - self->extractSubsetList = grib_arguments_get_name(grib_handle_of_accessor(a),arg,n++); - self->simpleThinningStart = grib_arguments_get_name(grib_handle_of_accessor(a),arg,n++); - self->simpleThinningMissingRadius = grib_arguments_get_name(grib_handle_of_accessor(a),arg,n++); - self->simpleThinningSkip = grib_arguments_get_name(grib_handle_of_accessor(a),arg,n++); + a->length = 0; + self->doExtractSubsets = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); + self->numberOfSubsets = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); + self->extractSubsetList = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); + self->simpleThinningStart = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); + self->simpleThinningMissingRadius = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); + self->simpleThinningSkip = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; } @@ -162,71 +163,83 @@ static int get_native_type(grib_accessor* a) static int apply_thinning(grib_accessor* a) { - grib_accessor_bufr_simple_thinning *self =(grib_accessor_bufr_simple_thinning*)a; - int ret=0; + grib_accessor_bufr_simple_thinning* self = (grib_accessor_bufr_simple_thinning*)a; + int ret = 0; long skip; - grib_handle* h=grib_handle_of_accessor(a); - grib_context* c=h->context; - long compressed=0,nsubsets; + grib_handle* h = grib_handle_of_accessor(a); + grib_context* c = h->context; + long compressed = 0, nsubsets; long i; grib_iarray* subsets; - long *subsets_ar=0; - long start=0,radius=0; + long* subsets_ar = 0; + long start = 0, radius = 0; - ret=grib_get_long(h,"compressedData",&compressed); - if (ret) return ret; + ret = grib_get_long(h, "compressedData", &compressed); + if (ret) + return ret; if (compressed) { - long numberOfSubsets=0; - ret=grib_get_long(h,self->numberOfSubsets,&numberOfSubsets); - if (ret) return ret; - - ret=grib_get_long(h,self->simpleThinningStart,&start); - if (ret) return ret; - - ret=grib_get_long(h,self->simpleThinningSkip,&skip); - if (ret) return ret; - if (skip <= 0) return GRIB_INVALID_KEY_VALUE; - - ret=grib_get_long(h,self->simpleThinningMissingRadius,&radius); - if (ret) return ret; - - subsets=grib_iarray_new(c,numberOfSubsets / skip + 1 ,10); - for (i=0;inumberOfSubsets, &numberOfSubsets); + if (ret) + return ret; + + ret = grib_get_long(h, self->simpleThinningStart, &start); + if (ret) + return ret; + + ret = grib_get_long(h, self->simpleThinningSkip, &skip); + if (ret) + return ret; + if (skip <= 0) + return GRIB_INVALID_KEY_VALUE; + + ret = grib_get_long(h, self->simpleThinningMissingRadius, &radius); + if (ret) + return ret; + + subsets = grib_iarray_new(c, numberOfSubsets / skip + 1, 10); + for (i = 0; i < numberOfSubsets; i += skip + 1) { + grib_iarray_push(subsets, i + 1); } - nsubsets=grib_iarray_used_size(subsets); + nsubsets = grib_iarray_used_size(subsets); - if (nsubsets!=0) { - subsets_ar=grib_iarray_get_array(subsets); - ret=grib_set_long_array(h,self->extractSubsetList,subsets_ar,nsubsets); - if (ret) return ret; + if (nsubsets != 0) { + subsets_ar = grib_iarray_get_array(subsets); + ret = grib_set_long_array(h, self->extractSubsetList, subsets_ar, nsubsets); + if (ret) + return ret; - ret=grib_set_long(h,"unpack",1); - if (ret) return ret; + ret = grib_set_long(h, "unpack", 1); + if (ret) + return ret; - ret=grib_set_long(h,self->doExtractSubsets,1); - if (ret) return ret; + ret = grib_set_long(h, self->doExtractSubsets, 1); + if (ret) + return ret; } - - } else { + } + else { return GRIB_NOT_IMPLEMENTED; } return ret; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { - int err=0; - grib_accessor_bufr_simple_thinning *self =(grib_accessor_bufr_simple_thinning*)a; - - if (*len==0) return GRIB_SUCCESS; - err=apply_thinning(a); - if (err) return err; - - err=grib_set_long(a->parent->h,self->doExtractSubsets,1); - if (err) return err; + int err = 0; + grib_accessor_bufr_simple_thinning* self = (grib_accessor_bufr_simple_thinning*)a; + + if (*len == 0) + return GRIB_SUCCESS; + err = apply_thinning(a); + if (err) + return err; + + err = grib_set_long(a->parent->h, self->doExtractSubsets, 1); + if (err) + return err; return err; } diff --git a/src/grib_accessor_class_bufr_string_values.c b/src/grib_accessor_class_bufr_string_values.c index a7f7aa1a4..734dc4cfe 100644 --- a/src/grib_accessor_class_bufr_string_values.c +++ b/src/grib_accessor_class_bufr_string_values.c @@ -43,68 +43,69 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_string(grib_accessor*, const char*, size_t *len); -static int pack_string_array(grib_accessor*, const char**, size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); -static int unpack_string_array (grib_accessor*, char**, size_t *len); -static int value_count(grib_accessor*,long*); -static void destroy(grib_context*,grib_accessor*); +static int pack_string(grib_accessor*, const char*, size_t* len); +static int pack_string_array(grib_accessor*, const char**, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); +static int unpack_string_array(grib_accessor*, char**, size_t* len); +static int value_count(grib_accessor*, long*); +static void destroy(grib_context*, grib_accessor*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_bufr_string_values { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in ascii */ -/* Members defined in bufr_string_values */ - const char* dataAccessorName; - grib_accessor* dataAccessor; +typedef struct grib_accessor_bufr_string_values +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in ascii */ + /* Members defined in bufr_string_values */ + const char* dataAccessorName; + grib_accessor* dataAccessor; } grib_accessor_bufr_string_values; extern grib_accessor_class* grib_accessor_class_ascii; static grib_accessor_class _grib_accessor_class_bufr_string_values = { - &grib_accessor_class_ascii, /* super */ - "bufr_string_values", /* name */ - sizeof(grib_accessor_bufr_string_values), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - &pack_string, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - &pack_string_array, /* grib_pack array procedures string */ - &unpack_string_array, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_ascii, /* super */ + "bufr_string_values", /* name */ + sizeof(grib_accessor_bufr_string_values), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + &destroy, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + &pack_string, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + &pack_string_array, /* grib_pack array procedures string */ + &unpack_string_array, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -113,114 +114,116 @@ grib_accessor_class* grib_accessor_class_bufr_string_values = &_grib_accessor_cl static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len , grib_arguments* args ) +static void init(grib_accessor* a, const long len, grib_arguments* args) { grib_accessor_bufr_string_values* self = (grib_accessor_bufr_string_values*)a; - int n=0; - self->dataAccessorName=grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->dataAccessor=NULL; - a->length = 0; + int n = 0; + self->dataAccessorName = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->dataAccessor = NULL; + a->length = 0; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_string_array(dumper,a,NULL); + grib_dump_string_array(dumper, a, NULL); } static grib_accessor* get_accessor(grib_accessor* a) { grib_accessor_bufr_string_values* self = (grib_accessor_bufr_string_values*)a; if (!self->dataAccessor) { - self->dataAccessor=grib_find_accessor(grib_handle_of_accessor(a),self->dataAccessorName); + self->dataAccessor = grib_find_accessor(grib_handle_of_accessor(a), self->dataAccessorName); } return self->dataAccessor; } -static int unpack_string_array (grib_accessor* a, char** buffer, size_t *len) +static int unpack_string_array(grib_accessor* a, char** buffer, size_t* len) { - grib_accessor* data=0; - grib_context* c=a->context; - grib_vsarray* stringValues=NULL; - long l=0,n=0,tl; - size_t i,j; + grib_accessor* data = 0; + grib_context* c = a->context; + grib_vsarray* stringValues = NULL; + long l = 0, n = 0, tl; + size_t i, j; /*char buf[25]={0,};*/ - char** b=buffer; + char** b = buffer; - data=get_accessor(a); - if (!data) return GRIB_NOT_FOUND; + data = get_accessor(a); + if (!data) + return GRIB_NOT_FOUND; - stringValues=accessor_bufr_data_array_get_stringValues(data); + stringValues = accessor_bufr_data_array_get_stringValues(data); - n=grib_vsarray_used_size(stringValues); + n = grib_vsarray_used_size(stringValues); - tl=0; - for (j=0;jv[j]); - tl+=l; + tl = 0; + for (j = 0; j < n; j++) { + l = grib_sarray_used_size(stringValues->v[j]); + tl += l; - if (tl>*len) return GRIB_ARRAY_TOO_SMALL; + if (tl > *len) + return GRIB_ARRAY_TOO_SMALL; - for (i=0;iv[j]->v[i]); + for (i = 0; i < l; i++) { + *(b++) = grib_context_strdup(c, stringValues->v[j]->v[i]); } } - *len=tl; + *len = tl; return GRIB_SUCCESS; } -static int pack_string_array(grib_accessor*a , const char** v, size_t *len) +static int pack_string_array(grib_accessor* a, const char** v, size_t* len) { return GRIB_NOT_IMPLEMENTED; } -static int unpack_string(grib_accessor* a, char* val, size_t *len) +static int unpack_string(grib_accessor* a, char* val, size_t* len) { return GRIB_NOT_IMPLEMENTED; } -static int pack_string(grib_accessor* a, const char* val, size_t *len) +static int pack_string(grib_accessor* a, const char* val, size_t* len) { return GRIB_NOT_IMPLEMENTED; } -static int value_count(grib_accessor* a,long* rlen) +static int value_count(grib_accessor* a, long* rlen) { - grib_accessor* descriptors=get_accessor(a); - return grib_value_count(descriptors,rlen); + grib_accessor* descriptors = get_accessor(a); + return grib_value_count(descriptors, rlen); } -static void destroy(grib_context* c,grib_accessor* a) +static void destroy(grib_context* c, grib_accessor* a) { } diff --git a/src/grib_accessor_class_bufrdc_expanded_descriptors.c b/src/grib_accessor_class_bufrdc_expanded_descriptors.c index 2a8b0c5e0..fde586436 100644 --- a/src/grib_accessor_class_bufrdc_expanded_descriptors.c +++ b/src/grib_accessor_class_bufrdc_expanded_descriptors.c @@ -43,66 +43,67 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int unpack_string_array (grib_accessor*, char**, size_t *len); -static int value_count(grib_accessor*,long*); -static void destroy(grib_context*,grib_accessor*); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int unpack_string_array(grib_accessor*, char**, size_t* len); +static int value_count(grib_accessor*, long*); +static void destroy(grib_context*, grib_accessor*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_bufrdc_expanded_descriptors { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in bufrdc_expanded_descriptors */ - const char* expandedDescriptors; - grib_accessor* expandedDescriptorsAccessor; +typedef struct grib_accessor_bufrdc_expanded_descriptors +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in bufrdc_expanded_descriptors */ + const char* expandedDescriptors; + grib_accessor* expandedDescriptorsAccessor; } grib_accessor_bufrdc_expanded_descriptors; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_bufrdc_expanded_descriptors = { - &grib_accessor_class_long, /* super */ - "bufrdc_expanded_descriptors", /* name */ - sizeof(grib_accessor_bufrdc_expanded_descriptors), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - &unpack_string_array, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "bufrdc_expanded_descriptors", /* name */ + sizeof(grib_accessor_bufrdc_expanded_descriptors), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + &destroy, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + &unpack_string_array, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -111,124 +112,127 @@ grib_accessor_class* grib_accessor_class_bufrdc_expanded_descriptors = &_grib_ac static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len , grib_arguments* args ) +static void init(grib_accessor* a, const long len, grib_arguments* args) { grib_accessor_bufrdc_expanded_descriptors* self = (grib_accessor_bufrdc_expanded_descriptors*)a; - int n=0; - self->expandedDescriptors=grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->expandedDescriptorsAccessor=0; - a->length = 0; + int n = 0; + self->expandedDescriptors = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->expandedDescriptorsAccessor = 0; + a->length = 0; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_long(dumper,a,NULL); + grib_dump_long(dumper, a, NULL); } static grib_accessor* get_accessor(grib_accessor* a) { grib_accessor_bufrdc_expanded_descriptors* self = (grib_accessor_bufrdc_expanded_descriptors*)a; if (!self->expandedDescriptorsAccessor) { - self->expandedDescriptorsAccessor=grib_find_accessor(grib_handle_of_accessor(a),self->expandedDescriptors); + self->expandedDescriptorsAccessor = grib_find_accessor(grib_handle_of_accessor(a), self->expandedDescriptors); } return self->expandedDescriptorsAccessor; } -static int unpack_long (grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - grib_accessor* descriptors=0; - size_t rlen=0,l; - long lenall=0; + grib_accessor* descriptors = 0; + size_t rlen = 0, l; + long lenall = 0; size_t i; - long* v=0; - grib_context* c=a->context; - - descriptors=get_accessor(a); - if (!descriptors) return GRIB_NOT_FOUND; - - grib_value_count(a,&lenall); - v=(long*)grib_context_malloc_clear(c,sizeof(long)*lenall); - l=lenall; - grib_unpack_long(descriptors,v,&l); - - rlen=0; - for (i=0;i 221999 ) ) - val[rlen++]=v[i]; + long* v = 0; + grib_context* c = a->context; + + descriptors = get_accessor(a); + if (!descriptors) + return GRIB_NOT_FOUND; + + grib_value_count(a, &lenall); + v = (long*)grib_context_malloc_clear(c, sizeof(long) * lenall); + l = lenall; + grib_unpack_long(descriptors, v, &l); + + rlen = 0; + for (i = 0; i < l; i++) { + if ((v[i] < 100000 || v[i] > 221999)) + val[rlen++] = v[i]; } - *len=rlen; + *len = rlen; return GRIB_SUCCESS; } -static int unpack_string_array (grib_accessor* a, char** buffer, size_t *len) +static int unpack_string_array(grib_accessor* a, char** buffer, size_t* len) { - grib_accessor* descriptors=0; - grib_context* c=a->context; - long l=0; - size_t size,i; - char buf[25]={0,}; - long* v=0; - - descriptors=get_accessor(a); - if (!descriptors) return GRIB_NOT_FOUND; - - value_count(descriptors,&l); - if (l>*len) return GRIB_ARRAY_TOO_SMALL; - - v=(long*)grib_context_malloc_clear(c,sizeof(long)*l); - size=l; - unpack_long(a,v,&size); - - for (i=0;icontext; + long l = 0; + size_t size, i; + char buf[25] = {0,}; + long* v = 0; + + descriptors = get_accessor(a); + if (!descriptors) + return GRIB_NOT_FOUND; + + value_count(descriptors, &l); + if (l > *len) + return GRIB_ARRAY_TOO_SMALL; + + v = (long*)grib_context_malloc_clear(c, sizeof(long) * l); + size = l; + unpack_long(a, v, &size); + + for (i = 0; i < size; i++) { + sprintf(buf, "%06ld", v[i]); + buffer[i] = grib_context_strdup(c, buf); } - *len=l; + *len = l; return GRIB_SUCCESS; } -static int value_count(grib_accessor* a,long* rlen) +static int value_count(grib_accessor* a, long* rlen) { - grib_accessor* descriptors=get_accessor(a); + grib_accessor* descriptors = get_accessor(a); - return grib_value_count(descriptors,rlen); + return grib_value_count(descriptors, rlen); } -static void destroy(grib_context* c,grib_accessor* a) +static void destroy(grib_context* c, grib_accessor* a) { } diff --git a/src/grib_accessor_class_bytes.c b/src/grib_accessor_class_bytes.c index 500685de2..050e3551e 100644 --- a/src/grib_accessor_class_bytes.c +++ b/src/grib_accessor_class_bytes.c @@ -31,61 +31,62 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int unpack_string (grib_accessor*, char*, size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int get_native_type(grib_accessor*); +static int unpack_string(grib_accessor*, char*, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); static int compare(grib_accessor*, grib_accessor*); -typedef struct grib_accessor_bytes { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in bytes */ +typedef struct grib_accessor_bytes +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in bytes */ } grib_accessor_bytes; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_bytes = { - &grib_accessor_class_gen, /* super */ - "bytes", /* name */ - sizeof(grib_accessor_bytes), /* size */ + &grib_accessor_class_gen, /* super */ + "bytes", /* name */ + sizeof(grib_accessor_bytes), /* size */ 0, /* inited */ &init_class, /* init_class */ &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -94,83 +95,84 @@ grib_accessor_class* grib_accessor_class_bytes = &_grib_accessor_class_bytes; static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len , grib_arguments* arg ) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { /*grib_accessor_signed* self = (grib_accessor_signed*)a; */ a->length = len; - Assert(a->length>=0); + Assert(a->length >= 0); } -static int get_native_type(grib_accessor* a) +static int get_native_type(grib_accessor* a) { return GRIB_TYPE_BYTES; } static int compare(grib_accessor* a, grib_accessor* b) { - int retval=GRIB_SUCCESS; + int retval = GRIB_SUCCESS; size_t alen = (size_t)grib_byte_count(a); size_t blen = (size_t)grib_byte_count(b); - if (alen != blen) return GRIB_COUNT_MISMATCH; + if (alen != blen) + return GRIB_COUNT_MISMATCH; return retval; } -static int unpack_string(grib_accessor *a , char* v, size_t *len) +static int unpack_string(grib_accessor* a, char* v, size_t* len) { - unsigned char* p=NULL; - char* s=v; + unsigned char* p = NULL; + char* s = v; int i; - long length=grib_byte_count(a); + long length = grib_byte_count(a); - if (*len < 2*length) { - *len=2*length; + if (*len < 2 * length) { + *len = 2 * length; return GRIB_ARRAY_TOO_SMALL; } - p = grib_handle_of_accessor(a)->buffer->data + grib_byte_offset(a); + p = grib_handle_of_accessor(a)->buffer->data + grib_byte_offset(a); - for (i = 0; i < length; i++) { - sprintf (s,"%02x", *(p++)); - s+=2; + for (i = 0; i < length; i++) { + sprintf(s, "%02x", *(p++)); + s += 2; } - *len=length; + *len = length; return GRIB_SUCCESS; } diff --git a/src/grib_accessor_class_change_scanning_direction.c b/src/grib_accessor_class_change_scanning_direction.c index 3451929cc..a95efd286 100644 --- a/src/grib_accessor_class_change_scanning_direction.c +++ b/src/grib_accessor_class_change_scanning_direction.c @@ -44,69 +44,70 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int get_native_type(grib_accessor*); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_change_scanning_direction { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in change_scanning_direction */ - const char* values; - const char* Ni; - const char* Nj; - const char* i_scans_negatively; - const char* j_scans_positively; - const char* first; - const char* last; - const char* axis; +typedef struct grib_accessor_change_scanning_direction +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in change_scanning_direction */ + const char* values; + const char* Ni; + const char* Nj; + const char* i_scans_negatively; + const char* j_scans_positively; + const char* first; + const char* last; + const char* axis; } grib_accessor_change_scanning_direction; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_change_scanning_direction = { - &grib_accessor_class_gen, /* super */ - "change_scanning_direction", /* name */ - sizeof(grib_accessor_change_scanning_direction), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "change_scanning_direction", /* name */ + sizeof(grib_accessor_change_scanning_direction), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -115,142 +116,153 @@ grib_accessor_class* grib_accessor_class_change_scanning_direction = &_grib_acce static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len , grib_arguments* args ) +static void init(grib_accessor* a, const long len, grib_arguments* args) { - int n=0; - grib_accessor_change_scanning_direction* self= (grib_accessor_change_scanning_direction*)a; - - self->values=grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->Ni=grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->Nj=grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->i_scans_negatively=grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->j_scans_positively=grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->first=grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->last=grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->axis=grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); + int n = 0; + grib_accessor_change_scanning_direction* self = (grib_accessor_change_scanning_direction*)a; + + self->values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->Ni = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->Nj = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->i_scans_negatively = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->j_scans_positively = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->first = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->last = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->axis = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; a->length = 0; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { - int ret=0; - long i,j,jr,theEnd,Ni,Nj,k,kp; + int ret = 0; + long i, j, jr, theEnd, Ni, Nj, k, kp; double tmp; - long iScansNegatively=0; - long jScansPositively=0; - double first=0; - double last=0; - size_t size=0; - double* values=NULL; - grib_accessor_change_scanning_direction* self= (grib_accessor_change_scanning_direction*)a; - grib_context* c=a->context; - grib_handle* h=grib_handle_of_accessor(a); - - if (*val==0) return 0; - - if((ret = grib_get_long_internal(h,self->Ni,&Ni)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h,self->Nj,&Nj)) != GRIB_SUCCESS) return ret; + long iScansNegatively = 0; + long jScansPositively = 0; + double first = 0; + double last = 0; + size_t size = 0; + double* values = NULL; + grib_accessor_change_scanning_direction* self = (grib_accessor_change_scanning_direction*)a; + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); + + if (*val == 0) + return 0; + + if ((ret = grib_get_long_internal(h, self->Ni, &Ni)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(h, self->Nj, &Nj)) != GRIB_SUCCESS) + return ret; - if((ret = grib_get_long_internal(h,self->i_scans_negatively,&iScansNegatively)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h,self->j_scans_positively,&jScansPositively)) != GRIB_SUCCESS) return ret; + if ((ret = grib_get_long_internal(h, self->i_scans_negatively, &iScansNegatively)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(h, self->j_scans_positively, &jScansPositively)) != GRIB_SUCCESS) + return ret; - if((ret = grib_get_double_internal(h,self->first,&first)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_double_internal(h,self->last,&last)) != GRIB_SUCCESS) return ret; + if ((ret = grib_get_double_internal(h, self->first, &first)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_double_internal(h, self->last, &last)) != GRIB_SUCCESS) + return ret; - if ( (ret=grib_get_size(h,self->values,&size)) != GRIB_SUCCESS) return ret; + if ((ret = grib_get_size(h, self->values, &size)) != GRIB_SUCCESS) + return ret; - if (size>Ni*Nj) { - grib_context_log(c,GRIB_LOG_ERROR,"change_scanning_direction: wrong values size!=Ni*Nj (%ld!=%ld*%ld)",size,Ni,Nj); + if (size > Ni * Nj) { + grib_context_log(c, GRIB_LOG_ERROR, "change_scanning_direction: wrong values size!=Ni*Nj (%ld!=%ld*%ld)", size, Ni, Nj); return GRIB_WRONG_ARRAY_SIZE; } - values=(double*)grib_context_malloc(c,size*sizeof(double)); - if (!values) return GRIB_OUT_OF_MEMORY; + values = (double*)grib_context_malloc(c, size * sizeof(double)); + if (!values) + return GRIB_OUT_OF_MEMORY; - if((ret = grib_get_double_array_internal(h,self->values,values,&size)) - != GRIB_SUCCESS) { - grib_context_free(c,values); + if ((ret = grib_get_double_array_internal(h, self->values, values, &size)) != GRIB_SUCCESS) { + grib_context_free(c, values); return ret; } if (self->axis[0] == 'x') { - theEnd=(Ni+0.5)/2; - for (j=0;ji_scans_negatively,iScansNegatively)) - != GRIB_SUCCESS) return ret; - } else { + iScansNegatively = !iScansNegatively; + if ((ret = grib_set_long_internal(h, self->i_scans_negatively, iScansNegatively)) != GRIB_SUCCESS) + return ret; + } + else { long kpj; - theEnd=(Nj+0.5)/2; - for (i=0;ij_scans_positively,jScansPositively)) - != GRIB_SUCCESS) return ret; + jScansPositively = !jScansPositively; + if ((ret = grib_set_long_internal(h, self->j_scans_positively, jScansPositively)) != GRIB_SUCCESS) + return ret; } - if((ret = grib_set_double_array_internal(h,self->values,values,size)) != GRIB_SUCCESS) { - grib_context_free(c,values); + if ((ret = grib_set_double_array_internal(h, self->values, values, size)) != GRIB_SUCCESS) { + grib_context_free(c, values); return ret; } - if((ret = grib_set_double_internal(h,self->first,last)) != GRIB_SUCCESS) return ret; + if ((ret = grib_set_double_internal(h, self->first, last)) != GRIB_SUCCESS) + return ret; - if((ret = grib_set_double_internal(h,self->last,first)) != GRIB_SUCCESS) return ret; + if ((ret = grib_set_double_internal(h, self->last, first)) != GRIB_SUCCESS) + return ret; - grib_context_free(c,values); + grib_context_free(c, values); return GRIB_SUCCESS; } @@ -260,9 +272,9 @@ static int get_native_type(grib_accessor* a) return GRIB_TYPE_LONG; } -static int unpack_long(grib_accessor* a, long* v, size_t *len) +static int unpack_long(grib_accessor* a, long* v, size_t* len) { /* ECC-976: decoding this accessor doesn't make sense so we return a dummy value */ - *v=-1; + *v = -1; return GRIB_SUCCESS; } diff --git a/src/grib_accessor_class_check_internal_version.c b/src/grib_accessor_class_check_internal_version.c index 432366b51..95fa9a48e 100644 --- a/src/grib_accessor_class_check_internal_version.c +++ b/src/grib_accessor_class_check_internal_version.c @@ -32,60 +32,61 @@ or edit "accessor.class" and rerun ./make_class.pl */ static size_t string_length(grib_accessor*); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_check_internal_version { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in ascii */ -/* Members defined in check_internal_version */ +typedef struct grib_accessor_check_internal_version +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in ascii */ + /* Members defined in check_internal_version */ } grib_accessor_check_internal_version; extern grib_accessor_class* grib_accessor_class_ascii; static grib_accessor_class _grib_accessor_class_check_internal_version = { - &grib_accessor_class_ascii, /* super */ - "check_internal_version", /* name */ - sizeof(grib_accessor_check_internal_version), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - &string_length, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_ascii, /* super */ + "check_internal_version", /* name */ + sizeof(grib_accessor_check_internal_version), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + &string_length, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -94,36 +95,36 @@ grib_accessor_class* grib_accessor_class_check_internal_version = &_grib_accesso static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ @@ -136,9 +137,9 @@ static void init_class(grib_accessor_class* c) static void init(grib_accessor* a, const long l, grib_arguments* args) { /* Check version of definition files is compatible with the engine */ - int err = 0; - long defs_file_version = 0; - grib_handle* h = grib_handle_of_accessor(a); + int err = 0; + long defs_file_version = 0; + grib_handle* h = grib_handle_of_accessor(a); const char* s_defn_version = grib_arguments_get_name(h, args, 0); Assert(s_defn_version); @@ -146,17 +147,17 @@ static void init(grib_accessor* a, const long l, grib_arguments* args) if (!err) { if (defs_file_version > LATEST_ENGINE_VERSION) { grib_context_log(h->context, GRIB_LOG_FATAL, - "Definition files version (%d) is greater than engine version (%d)!\n" - " " /* indent for 2nd line */ - "These definition files are for a later version of the ecCodes engine.", - defs_file_version, LATEST_ENGINE_VERSION); + "Definition files version (%d) is greater than engine version (%d)!\n" + " " /* indent for 2nd line */ + "These definition files are for a later version of the ecCodes engine.", + defs_file_version, LATEST_ENGINE_VERSION); } } } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - *count=1; + *count = 1; return 0; } diff --git a/src/grib_accessor_class_codeflag.c b/src/grib_accessor_class_codeflag.c index 5a5c6daa8..2cf52f742 100644 --- a/src/grib_accessor_class_codeflag.c +++ b/src/grib_accessor_class_codeflag.c @@ -36,65 +36,66 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int value_count(grib_accessor*,long*); +static int value_count(grib_accessor*, long*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_codeflag { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in unsigned */ - long nbytes; - grib_arguments* arg; -/* Members defined in codeflag */ - const char* tablename; +typedef struct grib_accessor_codeflag +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in unsigned */ + long nbytes; + grib_arguments* arg; + /* Members defined in codeflag */ + const char* tablename; } grib_accessor_codeflag; extern grib_accessor_class* grib_accessor_class_unsigned; static grib_accessor_class _grib_accessor_class_codeflag = { - &grib_accessor_class_unsigned, /* super */ - "codeflag", /* name */ - sizeof(grib_accessor_codeflag), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_unsigned, /* super */ + "codeflag", /* name */ + sizeof(grib_accessor_codeflag), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -103,77 +104,76 @@ grib_accessor_class* grib_accessor_class_codeflag = &_grib_accessor_class_codefl static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init (grib_accessor* a,const long len, grib_arguments* param) +static void init(grib_accessor* a, const long len, grib_arguments* param) { grib_accessor_codeflag* self = (grib_accessor_codeflag*)a; - a->length = len; - self->tablename = grib_arguments_get_string(grib_handle_of_accessor(a),param,0); - Assert(a->length>=0); + a->length = len; + self->tablename = grib_arguments_get_string(grib_handle_of_accessor(a), param, 0); + Assert(a->length >= 0); } static int test_bit(long a, long b) { - return a&(1<tablename, fname,1); + grib_recompose_name(grib_handle_of_accessor(a), NULL, self->tablename, fname, 1); - if ((filename=grib_context_full_defs_path(a->context,fname))==NULL) { - grib_context_log(a->context,GRIB_LOG_WARNING,"Cannot open flag table %s",filename); + if ((filename = grib_context_full_defs_path(a->context, fname)) == NULL) { + grib_context_log(a->context, GRIB_LOG_WARNING, "Cannot open flag table %s", filename); strcpy(codename, "Cannot open flag table"); return GRIB_FILE_NOT_FOUND; } f = codes_fopen(filename, "r"); - if (!f) - { - grib_context_log(a->context,(GRIB_LOG_WARNING)|(GRIB_LOG_PERROR),"Cannot open flag table %s",filename); + if (!f) { + grib_context_log(a->context, (GRIB_LOG_WARNING) | (GRIB_LOG_PERROR), "Cannot open flag table %s", filename); strcpy(codename, "Cannot open flag table"); return GRIB_FILE_NOT_FOUND; } @@ -184,44 +184,42 @@ static int grib_get_codeflag(grib_accessor* a, long code, char* codename) j = strlen(codename); #endif - while(fgets(line,sizeof(line)-1,f)) - { - sscanf(line,"%49s %49s", num, bval); + while (fgets(line, sizeof(line) - 1, f)) { + sscanf(line, "%49s %49s", num, bval); - if(num[0] != '#') - { - if((test_bit(code, a->length*8-atol(num))>0) == atol(bval)) - { + if (num[0] != '#') { + if ((test_bit(code, a->length * 8 - atol(num)) > 0) == atol(bval)) { size_t linelen = strlen(line); - codename[j++] = '('; - codename[j++] = num[0]; - codename[j++] = '='; - codename[j++] = bval[0]; - codename[j++] = ')'; - codename[j++] = ' '; - if(j) + codename[j++] = '('; + codename[j++] = num[0]; + codename[j++] = '='; + codename[j++] = bval[0]; + codename[j++] = ')'; + codename[j++] = ' '; + if (j) codename[j++] = ' '; - for(i=(strlen(num)+strlen(bval)+2); i < linelen-1;i++) + for (i = (strlen(num) + strlen(bval) + 2); i < linelen - 1; i++) codename[j++] = line[i]; - if(line[i]!='\n') + if (line[i] != '\n') codename[j++] = line[i]; codename[j++] = ';'; } } } - if(j>1 && codename[j-1] == ';') j--; + if (j > 1 && codename[j - 1] == ';') + j--; codename[j] = 0; - strcat(codename,":"); - strcat(codename,self->tablename); + strcat(codename, ":"); + strcat(codename, self->tablename); fclose(f); return GRIB_SUCCESS; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { *count = 1; return 0; @@ -236,10 +234,10 @@ static void dump(grib_accessor* a, grib_dumper* dumper) size_t llen = 1; - grib_recompose_name(grib_handle_of_accessor(a),NULL, self->tablename, fname,1); + grib_recompose_name(grib_handle_of_accessor(a), NULL, self->tablename, fname, 1); grib_unpack_long(a, &v, &llen); grib_get_codeflag(a, v, flagname); - grib_dump_bits(dumper,a,flagname); + grib_dump_bits(dumper, a, flagname); } diff --git a/src/grib_accessor_class_codetable.c b/src/grib_accessor_class_codetable.c index 9ab68d983..38b47986f 100644 --- a/src/grib_accessor_class_codetable.c +++ b/src/grib_accessor_class_codetable.c @@ -16,14 +16,15 @@ #include #if GRIB_PTHREADS -static pthread_once_t once = PTHREAD_ONCE_INIT; +static pthread_once_t once = PTHREAD_ONCE_INIT; static pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER; -static void thread_init() { +static void thread_init() +{ pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); - pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init(&mutex1,&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&mutex1, &attr); pthread_mutexattr_destroy(&attr); } #elif GRIB_OMP_THREADS @@ -34,8 +35,7 @@ static void thread_init() { GRIB_OMP_CRITICAL(lock_grib_accessor_class_codetable_c) { - if (once == 0) - { + if (once == 0) { omp_init_nest_lock(&mutex1); once = 1; } @@ -70,75 +70,76 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_string(grib_accessor*, const char*, size_t *len); +static int get_native_type(grib_accessor*); +static int pack_string(grib_accessor*, const char*, size_t* len); static int pack_expression(grib_accessor*, grib_expression*); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); -static int value_count(grib_accessor*,long*); -static void destroy(grib_context*,grib_accessor*); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); +static int value_count(grib_accessor*, long*); +static void destroy(grib_context*, grib_accessor*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_codetable { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in unsigned */ - long nbytes; - grib_arguments* arg; -/* Members defined in codetable */ - const char* tablename; - const char* masterDir; - const char* localDir; - grib_codetable* table; - int table_loaded; +typedef struct grib_accessor_codetable +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in unsigned */ + long nbytes; + grib_arguments* arg; + /* Members defined in codetable */ + const char* tablename; + const char* masterDir; + const char* localDir; + grib_codetable* table; + int table_loaded; } grib_accessor_codetable; extern grib_accessor_class* grib_accessor_class_unsigned; static grib_accessor_class _grib_accessor_class_codetable = { - &grib_accessor_class_unsigned, /* super */ - "codetable", /* name */ - sizeof(grib_accessor_codetable), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - &pack_string, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - &pack_expression, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_unsigned, /* super */ + "codetable", /* name */ + sizeof(grib_accessor_codetable), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + &destroy, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + &pack_string, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + &pack_expression, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -147,45 +148,45 @@ grib_accessor_class* grib_accessor_class_codetable = &_grib_accessor_class_codet static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static int grib_load_codetable(grib_context* c,const char* filename, - const char* recomposed_name,size_t size,grib_codetable* t); +static int grib_load_codetable(grib_context* c, const char* filename, + const char* recomposed_name, size_t size, grib_codetable* t); static void init(grib_accessor* a, const long len, grib_arguments* params) { - int n=0; - long new_len = len; - grib_handle* hand = grib_handle_of_accessor(a); - grib_accessor_codetable* self = (grib_accessor_codetable*)a; - grib_action* act=(grib_action*)(a->creator); + int n = 0; + long new_len = len; + grib_handle* hand = grib_handle_of_accessor(a); + grib_accessor_codetable* self = (grib_accessor_codetable*)a; + grib_action* act = (grib_action*)(a->creator); DebugAssert(len == self->nbytes); if (new_len == 0) { @@ -193,19 +194,19 @@ static void init(grib_accessor* a, const long len, grib_arguments* params) * its length as an identifier not an integer. This identifier is * added to the argument list (at the beginning) */ - new_len = grib_arguments_get_long(hand,params,n++); - if ( new_len <= 0 ) { - grib_context_log(a->context,GRIB_LOG_FATAL,"%s: codetable length must be a positive integer",a->name); + new_len = grib_arguments_get_long(hand, params, n++); + if (new_len <= 0) { + grib_context_log(a->context, GRIB_LOG_FATAL, "%s: codetable length must be a positive integer", a->name); } self->nbytes = new_len; } - self->tablename = grib_arguments_get_string(hand,params,n++); + self->tablename = grib_arguments_get_string(hand, params, n++); if (self->tablename == NULL) { - grib_context_log(a->context,GRIB_LOG_FATAL,"%s: codetable table is invalid",a->name); + grib_context_log(a->context, GRIB_LOG_FATAL, "%s: codetable table is invalid", a->name); } - self->masterDir = grib_arguments_get_name(hand,params,n++); /* can be NULL */ - self->localDir = grib_arguments_get_name(hand,params,n++); /* can be NULL */ + self->masterDir = grib_arguments_get_name(hand, params, n++); /* can be NULL */ + self->localDir = grib_arguments_get_name(hand, params, n++); /* can be NULL */ /*if (a->flags & GRIB_ACCESSOR_FLAG_STRING_TYPE) printf("-------- %s type string (%ld)\n",a->name,a->flags);*/ @@ -213,57 +214,63 @@ static void init(grib_accessor* a, const long len, grib_arguments* params) if (a->flags & GRIB_ACCESSOR_FLAG_TRANSIENT) { a->length = 0; if (!a->vvalue) - a->vvalue = (grib_virtual_value*)grib_context_malloc_clear(a->context,sizeof(grib_virtual_value)); - a->vvalue->type=grib_accessor_get_native_type(a); + a->vvalue = (grib_virtual_value*)grib_context_malloc_clear(a->context, sizeof(grib_virtual_value)); + a->vvalue->type = grib_accessor_get_native_type(a); a->vvalue->length = new_len; - if (act->default_value!=NULL) { + if (act->default_value != NULL) { const char* p = 0; - size_t s_len = 1; + size_t s_len = 1; long l; - int ret=0; + int ret = 0; double d; char tmp[1024]; - grib_expression* expression=grib_arguments_get_expression(hand,act->default_value,0); - int type = grib_expression_native_type(hand,expression); - switch(type) { - case GRIB_TYPE_DOUBLE: - grib_expression_evaluate_double(hand,expression,&d); - grib_pack_double(a,&d,&s_len); - break; - - case GRIB_TYPE_LONG: - grib_expression_evaluate_long(grib_handle_of_accessor(a),expression,&l); - grib_pack_long(a,&l,&s_len); - break; - - default: - s_len = sizeof(tmp); - p = grib_expression_evaluate_string(grib_handle_of_accessor(a),expression,tmp,&s_len,&ret); - if (ret != GRIB_SUCCESS) { - grib_context_log(a->context,GRIB_LOG_FATAL, - "unable to evaluate %s as string",a->name); - } - s_len = strlen(p)+1; - pack_string(a,p,&s_len); - break; + grib_expression* expression = grib_arguments_get_expression(hand, act->default_value, 0); + int type = grib_expression_native_type(hand, expression); + switch (type) { + case GRIB_TYPE_DOUBLE: + grib_expression_evaluate_double(hand, expression, &d); + grib_pack_double(a, &d, &s_len); + break; + + case GRIB_TYPE_LONG: + grib_expression_evaluate_long(grib_handle_of_accessor(a), expression, &l); + grib_pack_long(a, &l, &s_len); + break; + + default: + s_len = sizeof(tmp); + p = grib_expression_evaluate_string(grib_handle_of_accessor(a), expression, tmp, &s_len, &ret); + if (ret != GRIB_SUCCESS) { + grib_context_log(a->context, GRIB_LOG_FATAL, + "unable to evaluate %s as string", a->name); + } + s_len = strlen(p) + 1; + pack_string(a, p, &s_len); + break; } } - } else { + } + else { a->length = new_len; } } /* Note: A fast cut-down version of strcmp which does NOT return -1 */ /* 0 means input strings are equal and 1 means not equal */ -GRIB_INLINE static int grib_inline_strcmp(const char* a,const char* b) { - if (*a != *b) return 1; - while((*a!=0 && *b!=0) && *(a) == *(b) ) {a++;b++;} - return (*a==0 && *b==0) ? 0 : 1; +GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b) +{ + if (*a != *b) + return 1; + while ((*a != 0 && *b != 0) && *(a) == *(b)) { + a++; + b++; + } + return (*a == 0 && *b == 0) ? 0 : 1; } static int str_eq(const char* a, const char* b) { - if ( a && b && (grib_inline_strcmp(a,b)==0) ) + if (a && b && (grib_inline_strcmp(a, b) == 0)) return 1; return 0; } @@ -272,10 +279,10 @@ static int str_eq(const char* a, const char* b) static void dump_codetable(grib_codetable* atable) { grib_codetable* next = NULL; - int count = 0; + int count = 0; - next=atable; - while(next) { + next = atable; + while (next) { printf("[%.2d] CodeTable Dump: f0=%s f1=%s\n", count, next->filename[0], next->filename[1]); count++; next = next->next; @@ -284,45 +291,46 @@ static void dump_codetable(grib_codetable* atable) #endif static grib_codetable* load_table(grib_accessor_codetable* self) { - size_t size = 0; - grib_handle* h = ((grib_accessor*)self)->parent->h; - grib_context* c = h->context; - grib_codetable* t = NULL; - grib_codetable* next=NULL ; - grib_accessor* a=(grib_accessor*)self; - char *filename=0; - char recomposed[1024]={0,}; - char localRecomposed[1024]={0,}; - char *localFilename=0; - char masterDir[1024]={0,}; - char localDir[1024]={0,}; - size_t len=1024; + size_t size = 0; + grib_handle* h = ((grib_accessor*)self)->parent->h; + grib_context* c = h->context; + grib_codetable* t = NULL; + grib_codetable* next = NULL; + grib_accessor* a = (grib_accessor*)self; + char* filename = 0; + char recomposed[1024] = {0,}; + char localRecomposed[1024] = {0,}; + char* localFilename = 0; + char masterDir[1024] = {0,}; + char localDir[1024] = {0,}; + size_t len = 1024; if (self->masterDir != NULL) - grib_get_string(h,self->masterDir,masterDir,&len); + grib_get_string(h, self->masterDir, masterDir, &len); - len=1024; + len = 1024; if (self->localDir != NULL) - grib_get_string(h,self->localDir,localDir,&len); + grib_get_string(h, self->localDir, localDir, &len); - if (*masterDir!=0) { - char name[2048]={0,}; - sprintf(name,"%s/%s",masterDir,self->tablename); - grib_recompose_name(h, NULL,name, recomposed,0); - filename=grib_context_full_defs_path(c,recomposed); - } else { - grib_recompose_name(h, NULL,self->tablename, recomposed,0); - filename=grib_context_full_defs_path(c,recomposed); + if (*masterDir != 0) { + char name[2048] = {0,}; + sprintf(name, "%s/%s", masterDir, self->tablename); + grib_recompose_name(h, NULL, name, recomposed, 0); + filename = grib_context_full_defs_path(c, recomposed); + } + else { + grib_recompose_name(h, NULL, self->tablename, recomposed, 0); + filename = grib_context_full_defs_path(c, recomposed); } - if (*localDir!=0) { - char localName[2048]={0,}; - sprintf(localName,"%s/%s",localDir,self->tablename); - grib_recompose_name(h, NULL,localName, localRecomposed,0); - localFilename=grib_context_full_defs_path(c,localRecomposed); + if (*localDir != 0) { + char localName[2048] = {0,}; + sprintf(localName, "%s/%s", localDir, self->tablename); + grib_recompose_name(h, NULL, localName, localRecomposed, 0); + localFilename = grib_context_full_defs_path(c, localRecomposed); } - GRIB_MUTEX_INIT_ONCE(&once,&thread_init); + GRIB_MUTEX_INIT_ONCE(&once, &thread_init); GRIB_MUTEX_LOCK(&mutex1); /* GRIB-930 */ /*printf("DBG %s: Look in cache: f=%s lf=%s (recomposed=%s)\n", self->att.name, filename, localFilename,recomposed);*/ @@ -330,22 +338,18 @@ static grib_codetable* load_table(grib_accessor_codetable* self) t = NULL; goto the_end; } - next=c->codetable; - while(next) { - if ((filename && next->filename[0] && grib_inline_strcmp(filename,next->filename[0]) == 0) && - ((localFilename==0 && next->filename[1]==NULL) || - ((localFilename!=0 && next->filename[1]!=NULL) - && grib_inline_strcmp(localFilename,next->filename[1]) ==0)) ) - { + next = c->codetable; + while (next) { + if ((filename && next->filename[0] && grib_inline_strcmp(filename, next->filename[0]) == 0) && + ((localFilename == 0 && next->filename[1] == NULL) || + ((localFilename != 0 && next->filename[1] != NULL) && grib_inline_strcmp(localFilename, next->filename[1]) == 0))) { t = next; goto the_end; } /* Special case: see GRIB-735 */ - if (filename==NULL && localFilename!=NULL) - { - if ( str_eq(localFilename, next->filename[0]) || - str_eq(localFilename, next->filename[1]) ) - { + if (filename == NULL && localFilename != NULL) { + if (str_eq(localFilename, next->filename[0]) || + str_eq(localFilename, next->filename[1])) { t = next; goto the_end; } @@ -354,27 +358,28 @@ static grib_codetable* load_table(grib_accessor_codetable* self) } if (a->flags & GRIB_ACCESSOR_FLAG_TRANSIENT) { - Assert(a->vvalue!=NULL); - size=a->vvalue->length*8; - } else { + Assert(a->vvalue != NULL); + size = a->vvalue->length * 8; + } + else { size = grib_byte_count((grib_accessor*)self) * 8; } size = (1UL << size); /* 2^size */ - t = (grib_codetable*)grib_context_malloc_clear_persistent(c,sizeof(grib_codetable) + - (size-1)*sizeof(code_table_entry)); + t = (grib_codetable*)grib_context_malloc_clear_persistent(c, sizeof(grib_codetable) + + (size - 1) * sizeof(code_table_entry)); - if (filename!=0) - grib_load_codetable(c,filename,recomposed,size,t); + if (filename != 0) + grib_load_codetable(c, filename, recomposed, size, t); - if (localFilename!=0) - grib_load_codetable(c,localFilename,localRecomposed,size,t); + if (localFilename != 0) + grib_load_codetable(c, localFilename, localRecomposed, size, t); /*dump_codetable(c->codetable);*/ - if (t->filename[0]==NULL && t->filename[1]==NULL) { - grib_context_free_persistent(c,t); + if (t->filename[0] == NULL && t->filename[1] == NULL) { + grib_context_free_persistent(c, t); t = NULL; goto the_end; } @@ -385,93 +390,97 @@ static grib_codetable* load_table(grib_accessor_codetable* self) return t; } -static int grib_load_codetable(grib_context* c,const char* filename, - const char* recomposed_name,size_t size,grib_codetable* t) +static int grib_load_codetable(grib_context* c, const char* filename, + const char* recomposed_name, size_t size, grib_codetable* t) { char line[1024]; - FILE *f = NULL; + FILE* f = NULL; int lineNumber = 0; - grib_context_log(c,GRIB_LOG_DEBUG,"Loading code table from %s",filename); + grib_context_log(c, GRIB_LOG_DEBUG, "Loading code table from %s", filename); f = codes_fopen(filename, "r"); - if (!f) return GRIB_IO_PROBLEM; + if (!f) + return GRIB_IO_PROBLEM; - Assert(t!=NULL); + Assert(t != NULL); - if (t->filename[0] == NULL ){ - t->filename[0] = grib_context_strdup_persistent(c,filename); - t->recomposed_name[0] = grib_context_strdup_persistent(c,recomposed_name); - t->next = c->codetable; - t->size = size; - c->codetable = t; - } else { - t->filename[1] = grib_context_strdup_persistent(c,filename); - t->recomposed_name[1] = grib_context_strdup_persistent(c,recomposed_name); + if (t->filename[0] == NULL) { + t->filename[0] = grib_context_strdup_persistent(c, filename); + t->recomposed_name[0] = grib_context_strdup_persistent(c, recomposed_name); + t->next = c->codetable; + t->size = size; + c->codetable = t; + } + else { + t->filename[1] = grib_context_strdup_persistent(c, filename); + t->recomposed_name[1] = grib_context_strdup_persistent(c, recomposed_name); } - while(fgets(line,sizeof(line)-1,f)) - { - char* p = line; - int code = 0; + while (fgets(line, sizeof(line) - 1, f)) { + char* p = line; + int code = 0; char abbreviation[1024] = {0,}; - char title[1024]={0,}; - char* q = abbreviation; - char* r = title; - char* units=0; - char unknown[]="unknown"; + char title[1024] = {0,}; + char* q = abbreviation; + char* r = title; + char* units = 0; + char unknown[] = "unknown"; char* last_open_paren = NULL; char* last_clos_paren = NULL; ++lineNumber; - line[strlen(line)-1] = 0; + line[strlen(line) - 1] = 0; - while(*p != '\0' && isspace(*p)) p++; + while (*p != '\0' && isspace(*p)) + p++; - if(*p == '#') + if (*p == '#') continue; last_open_paren = strrchr(line, '('); - while(*p != '\0' && isspace(*p)) p++; + while (*p != '\0' && isspace(*p)) + p++; - if( *p =='\0' ) continue; + if (*p == '\0') + continue; - if (!isdigit(*p)) - { - grib_context_log(c,GRIB_LOG_ERROR, "Invalid entry in file %s: line %d", filename, lineNumber); + if (!isdigit(*p)) { + grib_context_log(c, GRIB_LOG_ERROR, "Invalid entry in file %s: line %d", filename, lineNumber); continue; /* skip this line */ } Assert(isdigit(*p)); - while(*p != '\0') - { - if(isspace(*p)) break; + while (*p != '\0') { + if (isspace(*p)) + break; code *= 10; code += *p - '0'; p++; } - if(code <0 || code >= size) - { - grib_context_log(c,GRIB_LOG_WARNING,"code_table_entry: invalid code in %s: %d (table size=%d)",filename,code,size); + if (code < 0 || code >= size) { + grib_context_log(c, GRIB_LOG_WARNING, "code_table_entry: invalid code in %s: %d (table size=%d)", filename, code, size); continue; } - while(*p != '\0' && isspace(*p)) p++; + while (*p != '\0' && isspace(*p)) + p++; - while(*p != '\0') - { - if(isspace(*p)) break; + while (*p != '\0') { + if (isspace(*p)) + break; *q++ = *p++; } *q = 0; - while(*p != '\0' && isspace(*p)) p++; + while (*p != '\0' && isspace(*p)) + p++; /* The title goes as far as the last open paren */ - while(*p != '\0') - { - if( last_open_paren && p >= last_open_paren && *p == '(' ) break; + while (*p != '\0') { + if (last_open_paren && p >= last_open_paren && *p == '(') + break; *r++ = *p++; } *r = 0; @@ -479,30 +488,30 @@ static int grib_load_codetable(grib_context* c,const char* filename, /* units at the end */ if (last_open_paren) { last_clos_paren = strrchr(line, ')'); - if (last_clos_paren && last_open_paren!=last_clos_paren) { - units = last_open_paren+1; - p = units; + if (last_clos_paren && last_open_paren != last_clos_paren) { + units = last_open_paren + 1; + p = units; p += (last_clos_paren - last_open_paren - 1); - *p='\0'; + *p = '\0'; } } - if (!units) units=unknown; + if (!units) + units = unknown; Assert(*abbreviation); Assert(*title); - if(t->entries[code].abbreviation != NULL) - { - grib_context_log(c,GRIB_LOG_WARNING,"code_table_entry: duplicate code in %s: %d (table size=%d)",filename,code,size); + if (t->entries[code].abbreviation != NULL) { + grib_context_log(c, GRIB_LOG_WARNING, "code_table_entry: duplicate code in %s: %d (table size=%d)", filename, code, size); continue; } Assert(t->entries[code].abbreviation == NULL); - Assert(t->entries[code].title == NULL); + Assert(t->entries[code].title == NULL); - t->entries[code].abbreviation = grib_context_strdup_persistent(c,abbreviation); - t->entries[code].title = grib_context_strdup_persistent(c,title); - t->entries[code].units = grib_context_strdup_persistent(c,units); + t->entries[code].abbreviation = grib_context_strdup_persistent(c, abbreviation); + t->entries[code].title = grib_context_strdup_persistent(c, title); + t->entries[code].units = grib_context_strdup_persistent(c, units); } fclose(f); @@ -514,30 +523,28 @@ void grib_codetable_delete(grib_context* c) { grib_codetable* t = c->codetable; - while(t) - { + while (t) { grib_codetable* s = t->next; int i; - for(i = 0; i < t->size; i++) - { - grib_context_free_persistent(c,t->entries[i].abbreviation); - grib_context_free_persistent(c,t->entries[i].title); + for (i = 0; i < t->size; i++) { + grib_context_free_persistent(c, t->entries[i].abbreviation); + grib_context_free_persistent(c, t->entries[i].title); } - grib_context_free_persistent(c,t->filename[0]); - if(t->filename[1]) - grib_context_free_persistent(c,t->filename[1]); - grib_context_free_persistent(c,t->recomposed_name[0]); + grib_context_free_persistent(c, t->filename[0]); + if (t->filename[1]) + grib_context_free_persistent(c, t->filename[1]); + grib_context_free_persistent(c, t->recomposed_name[0]); if (t->recomposed_name[1]) - grib_context_free_persistent(c,t->recomposed_name[1]); - grib_context_free_persistent(c,t); + grib_context_free_persistent(c, t->recomposed_name[1]); + grib_context_free_persistent(c, t); t = s; } } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_accessor_codetable* self = (grib_accessor_codetable*)a; + grib_accessor_codetable* self = (grib_accessor_codetable*)a; char comment[2048]; grib_codetable* table; @@ -545,90 +552,80 @@ static void dump(grib_accessor* a, grib_dumper* dumper) long value; if (!self->table_loaded) { - self->table = load_table(self); /* may return NULL */ + self->table = load_table(self); /* may return NULL */ self->table_loaded = 1; } - table=self->table; + table = self->table; - grib_unpack_long(a, &value,&llen); + grib_unpack_long(a, &value, &llen); - if(value == GRIB_MISSING_LONG) - { - if(a->length < 4) - { + if (value == GRIB_MISSING_LONG) { + if (a->length < 4) { value = (1L << a->length) - 1; } } - if(table && value >= 0 && value < table->size) - { - if(table->entries[value].abbreviation) - { + if (table && value >= 0 && value < table->size) { + if (table->entries[value].abbreviation) { int b = atol(table->entries[value].abbreviation); - if(b == value) - strcpy(comment,table->entries[value].title); + if (b == value) + strcpy(comment, table->entries[value].title); else - sprintf(comment,"%s", table->entries[value].title); + sprintf(comment, "%s", table->entries[value].title); - if (table->entries[value].units!=NULL && grib_inline_strcmp(table->entries[value].units,"unknown")) { - strcat(comment," ("); - strcat(comment,table->entries[value].units); - strcat(comment,") "); + if (table->entries[value].units != NULL && grib_inline_strcmp(table->entries[value].units, "unknown")) { + strcat(comment, " ("); + strcat(comment, table->entries[value].units); + strcat(comment, ") "); } } - else - { - strcpy(comment,"Unknown code table entry"); + else { + strcpy(comment, "Unknown code table entry"); } - } - else - { - strcpy(comment,"Unknown code table entry"); + else { + strcpy(comment, "Unknown code table entry"); } - strcat(comment," ("); + strcat(comment, " ("); if (table) { - strcat(comment,table->recomposed_name[0]); - if (table->recomposed_name[1]!=NULL) { - strcat(comment," , "); - strcat(comment,table->recomposed_name[1]); + strcat(comment, table->recomposed_name[0]); + if (table->recomposed_name[1] != NULL) { + strcat(comment, " , "); + strcat(comment, table->recomposed_name[1]); } } - strcat(comment,") "); + strcat(comment, ") "); - grib_dump_long(dumper,a,comment); + grib_dump_long(dumper, a, comment); } -static int unpack_string (grib_accessor* a, char* buffer, size_t *len) +static int unpack_string(grib_accessor* a, char* buffer, size_t* len) { grib_accessor_codetable* self = (grib_accessor_codetable*)a; - grib_codetable* table = NULL; + grib_codetable* table = NULL; size_t size = 1; - long value; + long value; int err = GRIB_SUCCESS; char tmp[1024]; size_t l = 0; - if( (err = grib_unpack_long(a,&value,&size)) != GRIB_SUCCESS) + if ((err = grib_unpack_long(a, &value, &size)) != GRIB_SUCCESS) return err; if (!self->table_loaded) { - self->table = load_table(self); /* may return NULL */ - self->table_loaded=1; + self->table = load_table(self); /* may return NULL */ + self->table_loaded = 1; } - table=self->table; + table = self->table; - if(table && (value >= 0) && (value < table->size) && table->entries[value].abbreviation) - { - strcpy(tmp,table->entries[value].abbreviation); + if (table && (value >= 0) && (value < table->size) && table->entries[value].abbreviation) { + strcpy(tmp, table->entries[value].abbreviation); } - else - { - + else { #if 1 - sprintf(tmp,"%d",(int)value); + sprintf(tmp, "%d", (int)value); #else return GRIB_DECODING_ERROR; #endif @@ -636,28 +633,27 @@ static int unpack_string (grib_accessor* a, char* buffer, size_t *len) l = strlen(tmp) + 1; - if(*len < l) - { + if (*len < l) { *len = l; return GRIB_BUFFER_TOO_SMALL; } - strcpy(buffer,tmp); + strcpy(buffer, tmp); *len = l; return GRIB_SUCCESS; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - *count=1; + *count = 1; return 0; } -static int pack_string(grib_accessor* a, const char* buffer, size_t *len) +static int pack_string(grib_accessor* a, const char* buffer, size_t* len) { grib_accessor_codetable* self = (grib_accessor_codetable*)a; - grib_codetable* table ; + grib_codetable* table; long i; size_t size = 1; @@ -670,125 +666,126 @@ static int pack_string(grib_accessor* a, const char* buffer, size_t *len) #endif if (!self->table_loaded) { - self->table = load_table(self); /* may return NULL */ - self->table_loaded=1; + self->table = load_table(self); /* may return NULL */ + self->table_loaded = 1; } - table=self->table; + table = self->table; - if(!table) + if (!table) return GRIB_ENCODING_ERROR; if (a->set) { - int err=grib_set_string(grib_handle_of_accessor(a),a->set,buffer,len); - if (err!=0) return err; + int err = grib_set_string(grib_handle_of_accessor(a), a->set, buffer, len); + if (err != 0) + return err; } - for(i = 0 ; i < table->size; i++) - if(table->entries[i].abbreviation) - if(cmp(table->entries[i].abbreviation,buffer) == 0) - return grib_pack_long(a,&i,&size); + for (i = 0; i < table->size; i++) + if (table->entries[i].abbreviation) + if (cmp(table->entries[i].abbreviation, buffer) == 0) + return grib_pack_long(a, &i, &size); if (a->flags & GRIB_ACCESSOR_FLAG_NO_FAIL) { - grib_action* act=(grib_action*)(a->creator); - if (act->default_value!=NULL) { + grib_action* act = (grib_action*)(a->creator); + if (act->default_value != NULL) { const char* p = 0; - size_t s_len = 1; + size_t s_len = 1; long l; - int ret=0; + int ret = 0; double d; char tmp[1024]; - grib_expression* expression=grib_arguments_get_expression(grib_handle_of_accessor(a),act->default_value,0); - int type = grib_expression_native_type(grib_handle_of_accessor(a),expression); - switch(type) { - case GRIB_TYPE_DOUBLE: - grib_expression_evaluate_double(grib_handle_of_accessor(a),expression,&d); - grib_pack_double(a,&d,&s_len); - break; - - case GRIB_TYPE_LONG: - grib_expression_evaluate_long(grib_handle_of_accessor(a),expression,&l); - grib_pack_long(a,&l,&s_len); - break; - - default: - s_len = sizeof(tmp); - p = grib_expression_evaluate_string(grib_handle_of_accessor(a),expression,tmp,&s_len,&ret); - if (ret != GRIB_SUCCESS) { - grib_context_log(a->context,GRIB_LOG_FATAL, - "unable to evaluate %s as string",a->name); - return ret; - } - s_len = strlen(p)+1; - pack_string(a,p,&s_len); - break; + grib_expression* expression = grib_arguments_get_expression(grib_handle_of_accessor(a), act->default_value, 0); + int type = grib_expression_native_type(grib_handle_of_accessor(a), expression); + switch (type) { + case GRIB_TYPE_DOUBLE: + grib_expression_evaluate_double(grib_handle_of_accessor(a), expression, &d); + grib_pack_double(a, &d, &s_len); + break; + + case GRIB_TYPE_LONG: + grib_expression_evaluate_long(grib_handle_of_accessor(a), expression, &l); + grib_pack_long(a, &l, &s_len); + break; + + default: + s_len = sizeof(tmp); + p = grib_expression_evaluate_string(grib_handle_of_accessor(a), expression, tmp, &s_len, &ret); + if (ret != GRIB_SUCCESS) { + grib_context_log(a->context, GRIB_LOG_FATAL, + "unable to evaluate %s as string", a->name); + return ret; + } + s_len = strlen(p) + 1; + pack_string(a, p, &s_len); + break; } return GRIB_SUCCESS; } - } return GRIB_ENCODING_ERROR; } -static int pack_expression(grib_accessor* a, grib_expression *e) +static int pack_expression(grib_accessor* a, grib_expression* e) { - const char* cval=NULL; - int ret=0; - long lval=0; - size_t len = 1; + const char* cval = NULL; + int ret = 0; + long lval = 0; + size_t len = 1; grib_handle* hand = grib_handle_of_accessor(a); - if (strcmp(e->cclass->name,"long")==0) { - ret=grib_expression_evaluate_long(hand,e,&lval); + if (strcmp(e->cclass->name, "long") == 0) { + ret = grib_expression_evaluate_long(hand, e, &lval); /*if (hand->context->debug) printf("ECCODES DEBUG grib_accessor_class_codetable::pack_expression %s %ld\n", a->name,lval);*/ - ret = grib_pack_long(a,&lval,&len); - } else { + ret = grib_pack_long(a, &lval, &len); + } + else { char tmp[1024]; - len = sizeof(tmp); - cval = grib_expression_evaluate_string(hand,e,tmp,&len,&ret); - if (ret!=GRIB_SUCCESS) { - grib_context_log(a->context,GRIB_LOG_ERROR,"grib_accessor_codetable.pack_expression: unable to evaluate string %s to be set in %s\n",grib_expression_get_name(e),a->name); + len = sizeof(tmp); + cval = grib_expression_evaluate_string(hand, e, tmp, &len, &ret); + if (ret != GRIB_SUCCESS) { + grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_codetable.pack_expression: unable to evaluate string %s to be set in %s\n", grib_expression_get_name(e), a->name); return ret; } len = strlen(cval) + 1; /*if (hand->context->debug) printf("ECCODES DEBUG grib_accessor_class_codetable::pack_expression %s %s\n", a->name, cval);*/ - ret = grib_pack_string(a,cval,&len); + ret = grib_pack_string(a, cval, &len); } return ret; } -static void destroy(grib_context* context,grib_accessor* a) +static void destroy(grib_context* context, grib_accessor* a) { if (a->vvalue != NULL) { grib_context_free(context, a->vvalue); - a->vvalue=NULL; + a->vvalue = NULL; } } static int get_native_type(grib_accessor* a) { - int type=GRIB_TYPE_LONG; + int type = GRIB_TYPE_LONG; /*printf("---------- %s flags=%ld GRIB_ACCESSOR_FLAG_STRING_TYPE=%d\n", a->name,a->flags,GRIB_ACCESSOR_FLAG_STRING_TYPE);*/ if (a->flags & GRIB_ACCESSOR_FLAG_STRING_TYPE) - type=GRIB_TYPE_STRING; + type = GRIB_TYPE_STRING; return type; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_codetable* self = (grib_accessor_codetable*)a; - long rlen = 0; + long rlen = 0; - unsigned long i = 0; - long pos = a->offset*8; + unsigned long i = 0; + long pos = a->offset * 8; grib_handle* hand = NULL; #ifdef DEBUG { - int err = grib_value_count(a,&rlen); + int err = grib_value_count(a, &rlen); Assert(!err); Assert(rlen == 1); } @@ -796,29 +793,30 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) rlen = 1; /* ECC-480 Performance: avoid func call overhead of grib_value_count */ if (!self->table_loaded) { - self->table = load_table(self); /* may return NULL */ - self->table_loaded=1; + self->table = load_table(self); /* may return NULL */ + self->table_loaded = 1; } - if(*len < rlen) - { - grib_context_log(a->context, GRIB_LOG_ERROR, " wrong size (%ld) for %s it contains %d values ",*len, a->name , rlen); + if (*len < rlen) { + grib_context_log(a->context, GRIB_LOG_ERROR, " wrong size (%ld) for %s it contains %d values ", *len, a->name, rlen); *len = 0; return GRIB_ARRAY_TOO_SMALL; } if (a->flags & GRIB_ACCESSOR_FLAG_TRANSIENT) { - *val=a->vvalue->lval; - *len=1; + *val = a->vvalue->lval; + *len = 1; return GRIB_SUCCESS; } /* ECC-480 Performance: inline the grib_handle_of_accessor here to reduce func call overhead */ - if (a->parent==NULL) hand = a->h; - else hand = a->parent->h; + if (a->parent == NULL) + hand = a->h; + else + hand = a->parent->h; - for(i=0; i< rlen;i++){ - val[i] = (long)grib_decode_unsigned_long(hand->buffer->data , &pos, self->nbytes*8); + for (i = 0; i < rlen; i++) { + val[i] = (long)grib_decode_unsigned_long(hand->buffer->data, &pos, self->nbytes * 8); } *len = rlen; diff --git a/src/grib_accessor_class_codetable_title.c b/src/grib_accessor_class_codetable_title.c index 81352165b..dfd43277e 100644 --- a/src/grib_accessor_class_codetable_title.c +++ b/src/grib_accessor_class_codetable_title.c @@ -32,61 +32,62 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int unpack_string (grib_accessor*, char*, size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int get_native_type(grib_accessor*); +static int unpack_string(grib_accessor*, char*, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_codetable_title { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in codetable_title */ - const char* codetable; +typedef struct grib_accessor_codetable_title +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in codetable_title */ + const char* codetable; } grib_accessor_codetable_title; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_codetable_title = { - &grib_accessor_class_gen, /* super */ - "codetable_title", /* name */ - sizeof(grib_accessor_codetable_title), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "codetable_title", /* name */ + sizeof(grib_accessor_codetable_title), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -95,48 +96,49 @@ grib_accessor_class* grib_accessor_class_codetable_title = &_grib_accessor_class static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -typedef struct grib_accessor_codetable { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in unsigned */ +typedef struct grib_accessor_codetable +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in unsigned */ long nbytes; grib_arguments* arg; -/* Members defined in codetable */ + /* Members defined in codetable */ const char* tablename; const char* masterDir; const char* localDir; @@ -147,42 +149,40 @@ typedef struct grib_accessor_codetable { static void init(grib_accessor* a, const long len, grib_arguments* params) { grib_accessor_codetable_title* self = (grib_accessor_codetable_title*)a; - int n=0; - self->codetable = grib_arguments_get_name(grib_handle_of_accessor(a),params,n++); - a->length=0; - a->flags|= GRIB_ACCESSOR_FLAG_READ_ONLY; + int n = 0; + self->codetable = grib_arguments_get_name(grib_handle_of_accessor(a), params, n++); + a->length = 0; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } -static int get_native_type(grib_accessor* a) +static int get_native_type(grib_accessor* a) { return GRIB_TYPE_STRING; } -static int unpack_string(grib_accessor* a, char* buffer, size_t *len) +static int unpack_string(grib_accessor* a, char* buffer, size_t* len) { grib_accessor_codetable_title* self = (grib_accessor_codetable_title*)a; - grib_codetable* table = NULL; + grib_codetable* table = NULL; size_t size = 1; - long value; + long value; int err = GRIB_SUCCESS; char tmp[1024]; - size_t l = 1024; - grib_accessor_codetable* ca=(grib_accessor_codetable*)grib_find_accessor(grib_handle_of_accessor(a),self->codetable); + size_t l = 1024; + grib_accessor_codetable* ca = (grib_accessor_codetable*)grib_find_accessor(grib_handle_of_accessor(a), self->codetable); - if( (err = grib_unpack_long((grib_accessor*)ca,&value,&size)) != GRIB_SUCCESS) + if ((err = grib_unpack_long((grib_accessor*)ca, &value, &size)) != GRIB_SUCCESS) return err; - table=ca->table; + table = ca->table; - if(table && (value >= 0) && (value < table->size) && table->entries[value].title) - { - strcpy(tmp,table->entries[value].title); + if (table && (value >= 0) && (value < table->size) && table->entries[value].title) { + strcpy(tmp, table->entries[value].title); } - else - { + else { #if 1 - sprintf(tmp,"%d",(int)value); + sprintf(tmp, "%d", (int)value); #else return GRIB_DECODING_ERROR; #endif @@ -190,13 +190,12 @@ static int unpack_string(grib_accessor* a, char* buffer, size_t *len) l = strlen(tmp) + 1; - if(*len < l) - { + if (*len < l) { *len = l; return GRIB_BUFFER_TOO_SMALL; } - strcpy(buffer,tmp); + strcpy(buffer, tmp); *len = l; return GRIB_SUCCESS; diff --git a/src/grib_accessor_class_codetable_units.c b/src/grib_accessor_class_codetable_units.c index 0839d87a1..42173e428 100644 --- a/src/grib_accessor_class_codetable_units.c +++ b/src/grib_accessor_class_codetable_units.c @@ -32,61 +32,62 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int unpack_string (grib_accessor*, char*, size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int get_native_type(grib_accessor*); +static int unpack_string(grib_accessor*, char*, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_codetable_units { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in codetable_units */ - const char* codetable; +typedef struct grib_accessor_codetable_units +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in codetable_units */ + const char* codetable; } grib_accessor_codetable_units; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_codetable_units = { - &grib_accessor_class_gen, /* super */ - "codetable_units", /* name */ - sizeof(grib_accessor_codetable_units), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "codetable_units", /* name */ + sizeof(grib_accessor_codetable_units), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -95,48 +96,49 @@ grib_accessor_class* grib_accessor_class_codetable_units = &_grib_accessor_class static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -typedef struct grib_accessor_codetable { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in unsigned */ +typedef struct grib_accessor_codetable +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in unsigned */ long nbytes; grib_arguments* arg; -/* Members defined in codetable */ + /* Members defined in codetable */ const char* tablename; const char* masterDir; const char* localDir; @@ -146,52 +148,49 @@ typedef struct grib_accessor_codetable { static void init(grib_accessor* a, const long len, grib_arguments* params) { grib_accessor_codetable_units* self = (grib_accessor_codetable_units*)a; - int n=0; - self->codetable = grib_arguments_get_name(grib_handle_of_accessor(a),params,n++); - a->length=0; + int n = 0; + self->codetable = grib_arguments_get_name(grib_handle_of_accessor(a), params, n++); + a->length = 0; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } -static int get_native_type(grib_accessor* a) +static int get_native_type(grib_accessor* a) { return GRIB_TYPE_STRING; } -static int unpack_string (grib_accessor* a, char* buffer, size_t *len) +static int unpack_string(grib_accessor* a, char* buffer, size_t* len) { grib_accessor_codetable_units* self = (grib_accessor_codetable_units*)a; - grib_codetable* table = NULL; + grib_codetable* table = NULL; size_t size = 1; - long value; + long value; int err = GRIB_SUCCESS; char tmp[1024]; - size_t l = 1024; - grib_accessor_codetable* ca=(grib_accessor_codetable*)grib_find_accessor(grib_handle_of_accessor(a),self->codetable); + size_t l = 1024; + grib_accessor_codetable* ca = (grib_accessor_codetable*)grib_find_accessor(grib_handle_of_accessor(a), self->codetable); - if( (err = grib_unpack_long((grib_accessor*)ca,&value,&size)) != GRIB_SUCCESS) + if ((err = grib_unpack_long((grib_accessor*)ca, &value, &size)) != GRIB_SUCCESS) return err; - table=ca->table; + table = ca->table; - if(table && (value >= 0) && (value < table->size) && table->entries[value].units) - { - strcpy(tmp,table->entries[value].units); + if (table && (value >= 0) && (value < table->size) && table->entries[value].units) { + strcpy(tmp, table->entries[value].units); } - else - { - sprintf(tmp,"%d",(int)value); + else { + sprintf(tmp, "%d", (int)value); } l = strlen(tmp) + 1; - if(*len < l) - { + if (*len < l) { *len = l; return GRIB_BUFFER_TOO_SMALL; } - strcpy(buffer,tmp); + strcpy(buffer, tmp); *len = l; return GRIB_SUCCESS; diff --git a/src/grib_accessor_class_concept.c b/src/grib_accessor_class_concept.c index fcfb44c90..ee9d52a7c 100644 --- a/src/grib_accessor_class_concept.c +++ b/src/grib_accessor_class_concept.c @@ -40,70 +40,71 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int pack_string(grib_accessor*, const char*, size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); +static int get_native_type(grib_accessor*); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int pack_string(grib_accessor*, const char*, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); static size_t string_length(grib_accessor*); -static int value_count(grib_accessor*,long*); -static void destroy(grib_context*,grib_accessor*); +static int value_count(grib_accessor*, long*); +static void destroy(grib_context*, grib_accessor*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); static int compare(grib_accessor*, grib_accessor*); -typedef struct grib_accessor_concept { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in concept */ +typedef struct grib_accessor_concept +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in concept */ } grib_accessor_concept; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_concept = { - &grib_accessor_class_gen, /* super */ - "concept", /* name */ - sizeof(grib_accessor_concept), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - &string_length, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - &pack_string, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "concept", /* name */ + sizeof(grib_accessor_concept), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + &destroy, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + &string_length, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + &pack_string, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + &compare, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -112,27 +113,27 @@ grib_accessor_class* grib_accessor_class_concept = &_grib_accessor_class_concept static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ @@ -141,85 +142,92 @@ static void init_class(grib_accessor_class* c) /* Note: A fast cut-down version of strcmp which does NOT return -1 */ /* 0 means input strings are equal and 1 means not equal */ -GRIB_INLINE static int grib_inline_strcmp(const char* a,const char* b) +GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b) { - if (*a != *b) return 1; - while((*a!=0 && *b!=0) && *(a) == *(b) ) {a++;b++;} - return (*a==0 && *b==0) ? 0 : 1; + if (*a != *b) + return 1; + while ((*a != 0 && *b != 0) && *(a) == *(b)) { + a++; + b++; + } + return (*a == 0 && *b == 0) ? 0 : 1; } -static void init(grib_accessor* a, const long len , grib_arguments* args ) +static void init(grib_accessor* a, const long len, grib_arguments* args) { a->length = 0; } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_string(dumper,a,NULL); + grib_dump_string(dumper, a, NULL); } -static int concept_condition_expression_true(grib_handle* h,grib_concept_condition* c) { +static int concept_condition_expression_true(grib_handle* h, grib_concept_condition* c) +{ long lval; - long lres=0; - int ok = 0; - int err=0; - const int type = grib_expression_native_type(h,c->expression); + long lres = 0; + int ok = 0; + int err = 0; + const int type = grib_expression_native_type(h, c->expression); + + switch (type) { + case GRIB_TYPE_LONG: + grib_expression_evaluate_long(h, c->expression, &lres); + ok = (grib_get_long(h, c->name, &lval) == GRIB_SUCCESS) && + (lval == lres); + break; - switch(type) - { - case GRIB_TYPE_LONG: - grib_expression_evaluate_long(h,c->expression,&lres); - ok = (grib_get_long(h,c->name,&lval) == GRIB_SUCCESS) && - (lval == lres); - break; - - case GRIB_TYPE_DOUBLE: { - double dval; - double dres=0.0; - grib_expression_evaluate_double(h,c->expression,&dres); - ok = (grib_get_double(h,c->name,&dval) == GRIB_SUCCESS) && - (dval == dres); - break; - } + case GRIB_TYPE_DOUBLE: { + double dval; + double dres = 0.0; + grib_expression_evaluate_double(h, c->expression, &dres); + ok = (grib_get_double(h, c->name, &dval) == GRIB_SUCCESS) && + (dval == dres); + break; + } - case GRIB_TYPE_STRING: { - const char *cval; - char buf[80]; - char tmp[80]; - size_t len = sizeof(buf); - size_t size=sizeof(tmp); - - ok = (grib_get_string(h,c->name,buf,&len) == GRIB_SUCCESS) && - ((cval = grib_expression_evaluate_string(h,c->expression,tmp,&size,&err)) != NULL) && - (err==0) && (grib_inline_strcmp(buf,cval) == 0); - break; - } + case GRIB_TYPE_STRING: { + const char* cval; + char buf[80]; + char tmp[80]; + size_t len = sizeof(buf); + size_t size = sizeof(tmp); - default: - /* TODO: */ - break; + ok = (grib_get_string(h, c->name, buf, &len) == GRIB_SUCCESS) && + ((cval = grib_expression_evaluate_string(h, c->expression, tmp, &size, &err)) != NULL) && + (err == 0) && (grib_inline_strcmp(buf, cval) == 0); + break; + } + + default: + /* TODO: */ + break; } return ok; } -static int concept_condition_iarray_true(grib_handle* h,grib_concept_condition* c) { - long *val; - size_t size=0,i; +static int concept_condition_iarray_true(grib_handle* h, grib_concept_condition* c) +{ + long* val; + size_t size = 0, i; int ret; - int err=0; + int err = 0; - err=grib_get_size(h,c->name,&size); - if (err==0 || size!=grib_iarray_used_size(c->iarray)) return 0; + err = grib_get_size(h, c->name, &size); + if (err == 0 || size != grib_iarray_used_size(c->iarray)) + return 0; - val=(long*)grib_context_malloc_clear(h->context,sizeof(long)*size); + val = (long*)grib_context_malloc_clear(h->context, sizeof(long) * size); - err=grib_get_long_array(h,c->name,val,&size); - if (err==0) return 0; + err = grib_get_long_array(h, c->name, val, &size); + if (err == 0) + return 0; - ret=1; - for (i=0;iiarray->v[i]) { - ret=0; + ret = 1; + for (i = 0; i < size; i++) { + if (val[i] != c->iarray->v[i]) { + ret = 0; break; } } @@ -227,33 +235,34 @@ static int concept_condition_iarray_true(grib_handle* h,grib_concept_condition* return ret; } -static int concept_condition_true(grib_handle* h,grib_concept_condition* c) { - if (c->expression==NULL) return concept_condition_iarray_true(h,c); - else return concept_condition_expression_true(h,c); +static int concept_condition_true(grib_handle* h, grib_concept_condition* c) +{ + if (c->expression == NULL) + return concept_condition_iarray_true(h, c); + else + return concept_condition_expression_true(h, c); } static const char* concept_evaluate(grib_accessor* a) { - int match = 0; + int match = 0; const char* best = 0; /* const char* prev = 0; */ - grib_concept_value* c = action_concept_get_concept(a); - grib_handle* h=grib_handle_of_accessor(a); + grib_concept_value* c = action_concept_get_concept(a); + grib_handle* h = grib_handle_of_accessor(a); - while(c) - { + while (c) { grib_concept_condition* e = c->conditions; - int cnt = 0; - while(e) - { - if(!concept_condition_true(h,e)) break; + int cnt = 0; + while (e) { + if (!concept_condition_true(h, e)) + break; e = e->next; cnt++; } - if(e == NULL) - { - if(cnt >= match) { + if (e == NULL) { + if (cnt >= match) { /* prev = (cnt > match) ? NULL : best; */ match = cnt; best = c->name; @@ -268,90 +277,94 @@ static const char* concept_evaluate(grib_accessor* a) #define MAX_NUM_CONCEPT_VALUES 40 -static int concept_conditions_expression_apply(grib_handle* h,grib_concept_condition* e,grib_values* values,grib_sarray* sa,int* n) +static int concept_conditions_expression_apply(grib_handle* h, grib_concept_condition* e, grib_values* values, grib_sarray* sa, int* n) { - long lres=0; - double dres=0.0; - int count=*n; + long lres = 0; + double dres = 0.0; + int count = *n; size_t size; - int err=0; + int err = 0; - Assert(count<1024); + Assert(count < 1024); values[count].name = e->name; - values[count].type = grib_expression_native_type(h,e->expression); - switch(values[count].type) - { - case GRIB_TYPE_LONG: - grib_expression_evaluate_long(h,e->expression,&lres); - values[count].long_value = lres; - break; - case GRIB_TYPE_DOUBLE: - grib_expression_evaluate_double(h,e->expression,&dres); - values[count].double_value = dres; - break; - case GRIB_TYPE_STRING: - size = sizeof(sa->v[count]); - values[count].string_value = grib_expression_evaluate_string(h,e->expression,sa->v[count],&size,&err); - break; - default: - return GRIB_NOT_IMPLEMENTED; - break; + values[count].type = grib_expression_native_type(h, e->expression); + switch (values[count].type) { + case GRIB_TYPE_LONG: + grib_expression_evaluate_long(h, e->expression, &lres); + values[count].long_value = lres; + break; + case GRIB_TYPE_DOUBLE: + grib_expression_evaluate_double(h, e->expression, &dres); + values[count].double_value = dres; + break; + case GRIB_TYPE_STRING: + size = sizeof(sa->v[count]); + values[count].string_value = grib_expression_evaluate_string(h, e->expression, sa->v[count], &size, &err); + break; + default: + return GRIB_NOT_IMPLEMENTED; + break; } (*n)++; return err; } -static int concept_conditions_iarray_apply(grib_handle* h,grib_concept_condition* c) +static int concept_conditions_iarray_apply(grib_handle* h, grib_concept_condition* c) { - size_t size=grib_iarray_used_size(c->iarray); - return grib_set_long_array(h,c->name,c->iarray->v,size); + size_t size = grib_iarray_used_size(c->iarray); + return grib_set_long_array(h, c->name, c->iarray->v, size); } -static int concept_conditions_apply(grib_handle* h,grib_concept_condition* c,grib_values* values,grib_sarray* sa,int* n) +static int concept_conditions_apply(grib_handle* h, grib_concept_condition* c, grib_values* values, grib_sarray* sa, int* n) { - if (c->expression==NULL) return concept_conditions_iarray_apply(h,c); - else return concept_conditions_expression_apply(h,c,values,sa,n); + if (c->expression == NULL) + return concept_conditions_iarray_apply(h, c); + else + return concept_conditions_expression_apply(h, c, values, sa, n); } -static int cmpstringp(const void *p1, const void *p2) +static int cmpstringp(const void* p1, const void* p2) { /* The actual arguments to this function are "pointers to pointers to char", but strcmp(3) arguments are "pointers to char", hence the following cast plus dereference */ - return strcmp(* (char * const *) p1, * (char * const *) p2); + return strcmp(*(char* const*)p1, *(char* const*)p2); } static int grib_concept_apply(grib_accessor* a, const char* name) { - int err=0; - int count = 0; - grib_concept_condition* e=NULL; + int err = 0; + int count = 0; + grib_concept_condition* e = NULL; grib_values values[1024]; - grib_sarray* sa=NULL; - grib_concept_value* c=NULL; - grib_concept_value* concepts = action_concept_get_concept(a); - grib_handle* h=grib_handle_of_accessor(a); - grib_action* act=a->creator; - int nofail=action_concept_get_nofail(a); + grib_sarray* sa = NULL; + grib_concept_value* c = NULL; + grib_concept_value* concepts = action_concept_get_concept(a); + grib_handle* h = grib_handle_of_accessor(a); + grib_action* act = a->creator; + int nofail = action_concept_get_nofail(a); - Assert(concepts!=NULL); + Assert(concepts != NULL); - c=(grib_concept_value*)grib_trie_get(concepts->index,name); + c = (grib_concept_value*)grib_trie_get(concepts->index, name); - if (!c) c=(grib_concept_value*)grib_trie_get(concepts->index,"default"); + if (!c) + c = (grib_concept_value*)grib_trie_get(concepts->index, "default"); - if (!c){ - err= nofail ? GRIB_SUCCESS : GRIB_CONCEPT_NO_MATCH; + if (!c) { + err = nofail ? GRIB_SUCCESS : GRIB_CONCEPT_NO_MATCH; if (err) { size_t i = 0, concept_count = 0; - long editionNumber=0; - char* all_concept_vals[MAX_NUM_CONCEPT_VALUES] = {NULL,}; /* sorted array containing concept values */ + long editionNumber = 0; + char* all_concept_vals[MAX_NUM_CONCEPT_VALUES] = { + NULL, + }; /* sorted array containing concept values */ grib_concept_value* pCon = concepts; - grib_context_log(h->context,GRIB_LOG_ERROR, "concept: no match for %s=%s", act->name,name); - if (grib_get_long(h,"edition",&editionNumber)==GRIB_SUCCESS) { - grib_context_log(h->context,GRIB_LOG_ERROR, "concept: input handle edition=%ld", editionNumber); + grib_context_log(h->context, GRIB_LOG_ERROR, "concept: no match for %s=%s", act->name, name); + if (grib_get_long(h, "edition", &editionNumber) == GRIB_SUCCESS) { + grib_context_log(h->context, GRIB_LOG_ERROR, "concept: input handle edition=%ld", editionNumber); } /* Create a list of all possible values for this concept and sort it */ @@ -359,7 +372,7 @@ static int grib_concept_apply(grib_accessor* a, const char* name) if (i >= MAX_NUM_CONCEPT_VALUES) break; all_concept_vals[i++] = pCon->name; - pCon = pCon->next; + pCon = pCon->next; } concept_count = i; /* Only print out all concepts if fewer than MAX_NUM_CONCEPT_VALUES. @@ -367,51 +380,52 @@ static int grib_concept_apply(grib_accessor* a, const char* name) if (concept_count < MAX_NUM_CONCEPT_VALUES) { fprintf(stderr, "Here are the possible values for concept %s:\n", act->name); qsort(&all_concept_vals, concept_count, sizeof(char*), cmpstringp); - for(i=0; i0 && strcmp(all_concept_vals[i], all_concept_vals[i-1]) == 0) { - print_it = 0; /* skip duplicate entries */ + if (i > 0 && strcmp(all_concept_vals[i], all_concept_vals[i - 1]) == 0) { + print_it = 0; /* skip duplicate entries */ } - if (print_it) fprintf(stderr, "\t%s\n", all_concept_vals[i]); + if (print_it) + fprintf(stderr, "\t%s\n", all_concept_vals[i]); } } } } return err; } - e = c->conditions; - sa=grib_sarray_new(h->context,10,10); - while(e) - { - concept_conditions_apply(h,e,values,sa,&count); + e = c->conditions; + sa = grib_sarray_new(h->context, 10, 10); + while (e) { + concept_conditions_apply(h, e, values, sa, &count); e = e->next; } - grib_sarray_delete(h->context,sa); + grib_sarray_delete(h->context, sa); - if (count) err=grib_set_values(h,values,count); + if (count) + err = grib_set_values(h, values, count); return err; } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { return GRIB_NOT_IMPLEMENTED; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { char buf[80]; size_t s; - sprintf(buf,"%ld",*val); + sprintf(buf, "%ld", *val); #if 0 if(*len > 1) return GRIB_NOT_IMPLEMENTED; #endif - s = strlen(buf)+1; - return pack_string(a,buf,&s); + s = strlen(buf) + 1; + return pack_string(a, buf, &s); } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { /* * If we want to have a condition which contains tests for paramId as well @@ -421,7 +435,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len) */ /*return GRIB_NOT_IMPLEMENTED*/ long lval = 0; - int ret = unpack_long(a, &lval, len); + int ret = unpack_long(a, &lval, len); if (ret == GRIB_SUCCESS) { *val = lval; } @@ -432,16 +446,20 @@ static long guess_paramId(grib_handle* h) { int err = 0; long discipline, category, number; - err=grib_get_long(h,"discipline",&discipline); + err = grib_get_long(h, "discipline", &discipline); if (err || discipline != 192) return -1; - err=grib_get_long(h,"parameterCategory",&category); - if (err) return -1; - err=grib_get_long(h,"parameterNumber",&number); - if (err) return -1; + err = grib_get_long(h, "parameterCategory", &category); + if (err) + return -1; + err = grib_get_long(h, "parameterNumber", &number); + if (err) + return -1; - if (category==128) return number; - else return (category * 1000 + number); + if (category == 128) + return number; + else + return (category * 1000 + number); } /* Return -1 if cannot match */ @@ -451,31 +469,33 @@ static long get_ECMWF_local_paramId(grib_accessor* a, grib_handle* h) long edition, centre; if (h->product_kind != PRODUCT_GRIB) return -1; - err=grib_get_long(h,"centre",¢re); - if (err) return -1; - err=grib_get_long(h,"edition",&edition); - if (err) return -1; - if (edition==2 && centre==98 && strncmp(a->name,"paramId",7)==0) { + err = grib_get_long(h, "centre", ¢re); + if (err) + return -1; + err = grib_get_long(h, "edition", &edition); + if (err) + return -1; + if (edition == 2 && centre == 98 && strncmp(a->name, "paramId", 7) == 0) { return guess_paramId(h); } return -1; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - const char *p = concept_evaluate(a); + const char* p = concept_evaluate(a); - if(!p) { + if (!p) { grib_handle* h = grib_handle_of_accessor(a); const long pid = get_ECMWF_local_paramId(a, h); if (pid != -1) { - grib_context_log(h->context,GRIB_LOG_DEBUG,"ECMWF local grib2: paramId guessed to be %ld",pid); + grib_context_log(h->context, GRIB_LOG_DEBUG, "ECMWF local grib2: paramId guessed to be %ld", pid); *val = pid; *len = 1; return GRIB_SUCCESS; } if (a->creator->defaultkey) - return grib_get_long_internal(h,a->creator->defaultkey,val); + return grib_get_long_internal(h, a->creator->defaultkey, val); return GRIB_NOT_FOUND; } @@ -505,14 +525,14 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) static int get_native_type(grib_accessor* a) { - int type=GRIB_TYPE_STRING; + int type = GRIB_TYPE_STRING; if (a->flags & GRIB_ACCESSOR_FLAG_LONG_TYPE) - type=GRIB_TYPE_LONG; + type = GRIB_TYPE_LONG; return type; } -static void destroy(grib_context* c,grib_accessor* a) +static void destroy(grib_context* c, grib_accessor* a) { /* * grib_accessor_concept *self = (grib_accessor_concept*)a; @@ -522,8 +542,8 @@ static void destroy(grib_context* c,grib_accessor* a) static int is_local_ecmwf_grib2_param_key(grib_accessor* a, long edition, long centre) { - if (edition==2 && centre==98) { - if (a->parent->owner && a->parent->owner->name && strcmp(a->parent->owner->name,"parameters")==0) + if (edition == 2 && centre == 98) { + if (a->parent->owner && a->parent->owner->name && strcmp(a->parent->owner->name, "parameters") == 0) return 1; } return 0; @@ -532,21 +552,36 @@ static int is_local_ecmwf_grib2_param_key(grib_accessor* a, long edition, long c static char* get_legacy_param_info(const char* key_name, long paramId) { if (paramId == 210) { - if (strcmp(key_name, "paramId")==0) return "210"; - if (strcmp(key_name, "shortName")==0) return "ssrc"; - if (strcmp(key_name, "units")==0) return "J m**-2"; - if (strcmp(key_name, "name")==0) return "Surface net solar radiation, clear sky"; - if (strcmp(key_name, "cfVarName")==0) return "ssrc"; - if (strcmp(key_name, "cfName")==0) return "surface_net_downward_shortwave_flux_assuming_clear_sky"; - } else if (paramId == 211) { - if (strcmp(key_name, "paramId")==0) return "211"; - if (strcmp(key_name, "shortName")==0) return "strc"; - if (strcmp(key_name, "units")==0) return "J m**-2"; - if (strcmp(key_name, "name")==0) return "Surface net thermal radiation, clear sky"; - if (strcmp(key_name, "cfVarName")==0) return "strc"; - if (strcmp(key_name, "cfName")==0) return "surface_net_downward_longwave_flux_assuming_clear_sky"; - } else if (paramId == 228051 || paramId == 228053 || paramId == 228057 || paramId == 228058 || paramId == 228059 || paramId == 228060) { - if (strcmp(key_name, "cfName")==0) return "unknown"; + if (strcmp(key_name, "paramId") == 0) + return "210"; + if (strcmp(key_name, "shortName") == 0) + return "ssrc"; + if (strcmp(key_name, "units") == 0) + return "J m**-2"; + if (strcmp(key_name, "name") == 0) + return "Surface net solar radiation, clear sky"; + if (strcmp(key_name, "cfVarName") == 0) + return "ssrc"; + if (strcmp(key_name, "cfName") == 0) + return "surface_net_downward_shortwave_flux_assuming_clear_sky"; + } + else if (paramId == 211) { + if (strcmp(key_name, "paramId") == 0) + return "211"; + if (strcmp(key_name, "shortName") == 0) + return "strc"; + if (strcmp(key_name, "units") == 0) + return "J m**-2"; + if (strcmp(key_name, "name") == 0) + return "Surface net thermal radiation, clear sky"; + if (strcmp(key_name, "cfVarName") == 0) + return "strc"; + if (strcmp(key_name, "cfName") == 0) + return "surface_net_downward_longwave_flux_assuming_clear_sky"; + } + else if (paramId == 228051 || paramId == 228053 || paramId == 228057 || paramId == 228058 || paramId == 228059 || paramId == 228060) { + if (strcmp(key_name, "cfName") == 0) + return "unknown"; } return NULL; } @@ -556,64 +591,68 @@ static char* get_legacy_param_info(const char* key_name, long paramId) */ static const char* get_ECMWF_local_parameter(grib_accessor* a, grib_handle* h) { - int err = 0; + int err = 0; const char* key_name = a->name; /*this is the key whose value we want*/ long edition, centre; if (h->product_kind != PRODUCT_GRIB) return NULL; - err=grib_get_long(h,"centre",¢re); - if (err) return NULL; - err=grib_get_long(h,"edition",&edition); - if (err) return NULL; - if (is_local_ecmwf_grib2_param_key(a,edition,centre)) { + err = grib_get_long(h, "centre", ¢re); + if (err) + return NULL; + err = grib_get_long(h, "edition", &edition); + if (err) + return NULL; + if (is_local_ecmwf_grib2_param_key(a, edition, centre)) { char* pLocalParam = NULL; /* Must be one of: 'name', 'shortName', 'units', 'cfName' etc */ - grib_accessor* a2 = NULL; + grib_accessor* a2 = NULL; const long pid_guess = guess_paramId(h); - if (pid_guess == -1) return NULL; + if (pid_guess == -1) + return NULL; /* TODO: Need to revisit */ pLocalParam = get_legacy_param_info(key_name, pid_guess); - if (pLocalParam) return pLocalParam; + if (pLocalParam) + return pLocalParam; /* Change the paramId so we can get the other string key*/ err = grib_set_long(h, "paramId", pid_guess); - if (err) return NULL; + if (err) + return NULL; /* Get the string value of key. Do not call grib_get_string() to avoid * dangers of infinite recursion as that calls unpack_string()! */ a2 = grib_find_accessor(h, key_name); - if (!a2) return NULL; + if (!a2) + return NULL; return concept_evaluate(a2); } return NULL; - } -static int unpack_string (grib_accessor* a, char* val, size_t *len) +static int unpack_string(grib_accessor* a, char* val, size_t* len) { - size_t slen ; - const char *p = concept_evaluate(a); + size_t slen; + const char* p = concept_evaluate(a); - if(!p) { + if (!p) { grib_handle* h = grib_handle_of_accessor(a); - p = get_ECMWF_local_parameter(a, h); + p = get_ECMWF_local_parameter(a, h); if (!p) { if (a->creator->defaultkey) - return grib_get_string_internal(h,a->creator->defaultkey,val,len); + return grib_get_string_internal(h, a->creator->defaultkey, val, len); return GRIB_NOT_FOUND; } - grib_context_log(h->context,GRIB_LOG_DEBUG,"ECMWF local grib2 parameter: %s=%s", a->name,p); + grib_context_log(h->context, GRIB_LOG_DEBUG, "ECMWF local grib2 parameter: %s=%s", a->name, p); } - slen = strlen(p) +1; - if(*len < slen) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "Variable unpack_string Wrong size for %s it is %d bytes big (len=%d)", a->name , slen ,*len); + slen = strlen(p) + 1; + if (*len < slen) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Variable unpack_string Wrong size for %s it is %d bytes big (len=%d)", a->name, slen, *len); *len = slen; return GRIB_BUFFER_TOO_SMALL; } - strcpy(val,p); + strcpy(val, p); *len = slen; #if 0 if (a->context->debug==1) { @@ -626,9 +665,9 @@ static int unpack_string (grib_accessor* a, char* val, size_t *len) return GRIB_SUCCESS; } -static int pack_string(grib_accessor* a, const char* val, size_t *len) +static int pack_string(grib_accessor* a, const char* val, size_t* len) { - return grib_concept_apply(a,val); + return grib_concept_apply(a, val); } static size_t string_length(grib_accessor* a) @@ -636,44 +675,48 @@ static size_t string_length(grib_accessor* a) return MAX_CONCEPT_STRING_LENGTH; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - *count=1; + *count = 1; return 0; } -static int compare(grib_accessor* a,grib_accessor* b) +static int compare(grib_accessor* a, grib_accessor* b) { - int retval=0; - char *aval=0; - char *bval=0; + int retval = 0; + char* aval = 0; + char* bval = 0; size_t alen = 0; size_t blen = 0; - int err=0; - long count=0; + int err = 0; + long count = 0; - err=grib_value_count(a,&count); - if (err) return err; - alen=count; + err = grib_value_count(a, &count); + if (err) + return err; + alen = count; - err=grib_value_count(b,&count); - if (err) return err; - blen=count; + err = grib_value_count(b, &count); + if (err) + return err; + blen = count; - if (alen != blen) return GRIB_COUNT_MISMATCH; + if (alen != blen) + return GRIB_COUNT_MISMATCH; - aval=(char*)grib_context_malloc(a->context,alen*sizeof(char)); - bval=(char*)grib_context_malloc(b->context,blen*sizeof(char)); + aval = (char*)grib_context_malloc(a->context, alen * sizeof(char)); + bval = (char*)grib_context_malloc(b->context, blen * sizeof(char)); - grib_unpack_string(a,aval,&alen); - grib_unpack_string(b,bval,&blen); + grib_unpack_string(a, aval, &alen); + grib_unpack_string(b, bval, &blen); retval = GRIB_SUCCESS; - if (!aval || !bval || grib_inline_strcmp(aval,bval)) retval = GRIB_STRING_VALUE_MISMATCH; + if (!aval || !bval || grib_inline_strcmp(aval, bval)) + retval = GRIB_STRING_VALUE_MISMATCH; - grib_context_free(a->context,aval); - grib_context_free(b->context,bval); + grib_context_free(a->context, aval); + grib_context_free(b->context, bval); return retval; } diff --git a/src/grib_accessor_class_constant.c b/src/grib_accessor_class_constant.c index 20f8c98a6..9e0bd7412 100644 --- a/src/grib_accessor_class_constant.c +++ b/src/grib_accessor_class_constant.c @@ -35,67 +35,68 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_bytes(grib_accessor*,const unsigned char*, size_t *len); -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int pack_string(grib_accessor*, const char*, size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_bytes(grib_accessor*, const unsigned char*, size_t* len); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int pack_string(grib_accessor*, const char*, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_constant { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in variable */ - double dval; - char* cval; - char* cname; - int type; -/* Members defined in constant */ +typedef struct grib_accessor_constant +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in variable */ + double dval; + char* cval; + char* cname; + int type; + /* Members defined in constant */ } grib_accessor_constant; extern grib_accessor_class* grib_accessor_class_variable; static grib_accessor_class _grib_accessor_class_constant = { - &grib_accessor_class_variable, /* super */ - "constant", /* name */ - sizeof(grib_accessor_constant), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - &pack_string, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - &pack_bytes, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_variable, /* super */ + "constant", /* name */ + sizeof(grib_accessor_constant), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + &pack_string, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + &pack_bytes, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -104,71 +105,71 @@ grib_accessor_class* grib_accessor_class_constant = &_grib_accessor_class_consta static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->unpack_long = (*(c->super))->unpack_long; - c->unpack_double = (*(c->super))->unpack_double; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->unpack_long = (*(c->super))->unpack_long; + c->unpack_double = (*(c->super))->unpack_double; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -void accessor_constant_set_type(grib_accessor* a,int type) +void accessor_constant_set_type(grib_accessor* a, int type) { grib_accessor_constant* self = (grib_accessor_constant*)a; - self->type=type; + self->type = type; } -void accessor_constant_set_dval(grib_accessor* a,double dval) +void accessor_constant_set_dval(grib_accessor* a, double dval) { grib_accessor_constant* self = (grib_accessor_constant*)a; - self->dval=dval; + self->dval = dval; } -static void init(grib_accessor* a, const long len , grib_arguments* arg) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } -static int pack_bytes(grib_accessor* a,const unsigned char* val, size_t *len) +static int pack_bytes(grib_accessor* a, const unsigned char* val, size_t* len) { return GRIB_READ_ONLY; } -static int pack_double(grib_accessor* a, const double* val,size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { return GRIB_READ_ONLY; } -static int pack_long(grib_accessor* a, const long* val,size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { return GRIB_READ_ONLY; } -static int pack_string(grib_accessor* a, const char* val, size_t *len) +static int pack_string(grib_accessor* a, const char* val, size_t* len) { return GRIB_READ_ONLY; } diff --git a/src/grib_accessor_class_count_file.c b/src/grib_accessor_class_count_file.c index c06dd1220..c5b6f74a2 100644 --- a/src/grib_accessor_class_count_file.c +++ b/src/grib_accessor_class_count_file.c @@ -34,60 +34,61 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_long(grib_accessor*, long* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_count_file { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in count_file */ +typedef struct grib_accessor_count_file +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in count_file */ } grib_accessor_count_file; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_count_file = { - &grib_accessor_class_long, /* super */ - "count_file", /* name */ - sizeof(grib_accessor_count_file), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "count_file", /* name */ + sizeof(grib_accessor_count_file), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -96,50 +97,50 @@ grib_accessor_class* grib_accessor_class_count_file = &_grib_accessor_class_coun static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->length=0; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->length = 0; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { *val = grib_context_get_handle_file_count(a->context); - *len =1; + *len = 1; return 0; } diff --git a/src/grib_accessor_class_count_missing.c b/src/grib_accessor_class_count_missing.c index 3a72bc9fa..502a2bcda 100644 --- a/src/grib_accessor_class_count_missing.c +++ b/src/grib_accessor_class_count_missing.c @@ -35,64 +35,65 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_count_missing { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in count_missing */ - const char* bitmap; - const char* unusedBitsInBitmap; - const char* numberOfDataPoints; +typedef struct grib_accessor_count_missing +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in count_missing */ + const char* bitmap; + const char* unusedBitsInBitmap; + const char* numberOfDataPoints; } grib_accessor_count_missing; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_count_missing = { - &grib_accessor_class_long, /* super */ - "count_missing", /* name */ - sizeof(grib_accessor_count_missing), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "count_missing", /* name */ + sizeof(grib_accessor_count_missing), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -101,57 +102,58 @@ grib_accessor_class* grib_accessor_class_count_missing = &_grib_accessor_class_c static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static const unsigned char bitsoff[]={ -8, 7, 7, 6, 7, 6, 6, 5, 7, 6, 6, 5, 6, 5, 5, 4, 7, -6, 6, 5, 6, 5, 5, 4, 6, 5, 5, 4, 5, 4, 4, 3, 7, 6, -6, 5, 6, 5, 5, 4, 6, 5, 5, 4, 5, 4, 4, 3, 6, 5, 5, -4, 5, 4, 4, 3, 5, 4, 4, 3, 4, 3, 3, 2, 7, 6, 6, 5, -6, 5, 5, 4, 6, 5, 5, 4, 5, 4, 4, 3, 6, 5, 5, 4, 5, -4, 4, 3, 5, 4, 4, 3, 4, 3, 3, 2, 6, 5, 5, 4, 5, 4, -4, 3, 5, 4, 4, 3, 4, 3, 3, 2, 5, 4, 4, 3, 4, 3, 3, -2, 4, 3, 3, 2, 3, 2, 2, 1, 7, 6, 6, 5, 6, 5, 5, 4, -6, 5, 5, 4, 5, 4, 4, 3, 6, 5, 5, 4, 5, 4, 4, 3, 5, -4, 4, 3, 4, 3, 3, 2, 6, 5, 5, 4, 5, 4, 4, 3, 5, 4, -4, 3, 4, 3, 3, 2, 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, -2, 3, 2, 2, 1, 6, 5, 5, 4, 5, 4, 4, 3, 5, 4, 4, 3, -4, 3, 3, 2, 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, -2, 2, 1, 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, -2, 1, 4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, -0 }; +static const unsigned char bitsoff[] = { + 8, 7, 7, 6, 7, 6, 6, 5, 7, 6, 6, 5, 6, 5, 5, 4, 7, + 6, 6, 5, 6, 5, 5, 4, 6, 5, 5, 4, 5, 4, 4, 3, 7, 6, + 6, 5, 6, 5, 5, 4, 6, 5, 5, 4, 5, 4, 4, 3, 6, 5, 5, + 4, 5, 4, 4, 3, 5, 4, 4, 3, 4, 3, 3, 2, 7, 6, 6, 5, + 6, 5, 5, 4, 6, 5, 5, 4, 5, 4, 4, 3, 6, 5, 5, 4, 5, + 4, 4, 3, 5, 4, 4, 3, 4, 3, 3, 2, 6, 5, 5, 4, 5, 4, + 4, 3, 5, 4, 4, 3, 4, 3, 3, 2, 5, 4, 4, 3, 4, 3, 3, + 2, 4, 3, 3, 2, 3, 2, 2, 1, 7, 6, 6, 5, 6, 5, 5, 4, + 6, 5, 5, 4, 5, 4, 4, 3, 6, 5, 5, 4, 5, 4, 4, 3, 5, + 4, 4, 3, 4, 3, 3, 2, 6, 5, 5, 4, 5, 4, 4, 3, 5, 4, + 4, 3, 4, 3, 3, 2, 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, + 2, 3, 2, 2, 1, 6, 5, 5, 4, 5, 4, 4, 3, 5, 4, 4, 3, + 4, 3, 3, 2, 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, + 2, 2, 1, 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, + 2, 1, 4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, + 0 +}; /* static const unsigned char bitson[]={ @@ -173,60 +175,62 @@ static const unsigned char bitson[]={ 8 }; */ -static void init(grib_accessor* a, const long len , grib_arguments* arg ) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { - int n=0; + int n = 0; grib_accessor_count_missing* self = (grib_accessor_count_missing*)a; - a->length=0; - a->flags|=GRIB_ACCESSOR_FLAG_READ_ONLY; - self->bitmap = grib_arguments_get_name(grib_handle_of_accessor(a),arg,n++); - self->unusedBitsInBitmap = grib_arguments_get_name(grib_handle_of_accessor(a),arg,n++); - self->numberOfDataPoints = grib_arguments_get_name(grib_handle_of_accessor(a),arg,n++); + a->length = 0; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + self->bitmap = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); + self->unusedBitsInBitmap = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); + self->numberOfDataPoints = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); } -static const int used[] = { 0,1,3,7,15,31,63,127,255}; +static const int used[] = { 0, 1, 3, 7, 15, 31, 63, 127, 255 }; -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_count_missing* self = (grib_accessor_count_missing*)a; unsigned char* p; int i; - long size=0; - long offset=0; - long unusedBitsInBitmap=0; - long numberOfDataPoints=0; - grib_handle* h=grib_handle_of_accessor(a); - grib_accessor* bitmap=grib_find_accessor(h, self->bitmap); - - *val=0; - *len=1; - if (!bitmap) return GRIB_SUCCESS; - - size=grib_byte_count(bitmap); - offset=grib_byte_offset(bitmap); - - if (grib_get_long(h,self->unusedBitsInBitmap,&unusedBitsInBitmap) != GRIB_SUCCESS) { - if (grib_get_long(h,self->numberOfDataPoints,&numberOfDataPoints) != GRIB_SUCCESS) { - grib_context_log(a->context,GRIB_LOG_ERROR,"unable to count missing values"); + long size = 0; + long offset = 0; + long unusedBitsInBitmap = 0; + long numberOfDataPoints = 0; + grib_handle* h = grib_handle_of_accessor(a); + grib_accessor* bitmap = grib_find_accessor(h, self->bitmap); + + *val = 0; + *len = 1; + if (!bitmap) + return GRIB_SUCCESS; + + size = grib_byte_count(bitmap); + offset = grib_byte_offset(bitmap); + + if (grib_get_long(h, self->unusedBitsInBitmap, &unusedBitsInBitmap) != GRIB_SUCCESS) { + if (grib_get_long(h, self->numberOfDataPoints, &numberOfDataPoints) != GRIB_SUCCESS) { + grib_context_log(a->context, GRIB_LOG_ERROR, "unable to count missing values"); return GRIB_INTERNAL_ERROR; } - unusedBitsInBitmap=size*8-numberOfDataPoints; + unusedBitsInBitmap = size * 8 - numberOfDataPoints; } - p = h->buffer->data+offset; + p = h->buffer->data + offset; - size -= unusedBitsInBitmap/8; + size -= unusedBitsInBitmap / 8; unusedBitsInBitmap = unusedBitsInBitmap % 8; - for (i=0;idump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->length=0; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->length = 0; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { *val = grib_context_get_handle_total_count(a->context); - *len =1; + *len = 1; return 0; } diff --git a/src/grib_accessor_class_data_2order_packing.c b/src/grib_accessor_class_data_2order_packing.c index 917ec1704..a199afc01 100644 --- a/src/grib_accessor_class_data_2order_packing.c +++ b/src/grib_accessor_class_data_2order_packing.c @@ -58,90 +58,91 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_data_2order_packing { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in values */ - int carg; - const char* seclen; - const char* offsetdata; - const char* offsetsection; - int dirty; -/* Members defined in data_2order_packing */ - const char* bits_per_value; - const char* reference_value; - const char* binary_scale_factor; - const char* decimal_scale_factor; - const char* half_byte; - const char* n1; - const char* n2; - const char* extraValues; - const char* p1; - const char* p2; - const char* matrix_values; - const char* snd_bitmap; - const char* snd_ordr_wdiff; - const char* general_ext; - const char* boustrophedonic; - const char* two_ordr_spd; - const char* plus1_spd; - const char* width_widths; - const char* width_lengths; - const char* octet_start_group; - const char* width_spd_sp_desc; - const char* nap; - const char* bitmap; +typedef struct grib_accessor_data_2order_packing +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in values */ + int carg; + const char* seclen; + const char* offsetdata; + const char* offsetsection; + int dirty; + /* Members defined in data_2order_packing */ + const char* bits_per_value; + const char* reference_value; + const char* binary_scale_factor; + const char* decimal_scale_factor; + const char* half_byte; + const char* n1; + const char* n2; + const char* extraValues; + const char* p1; + const char* p2; + const char* matrix_values; + const char* snd_bitmap; + const char* snd_ordr_wdiff; + const char* general_ext; + const char* boustrophedonic; + const char* two_ordr_spd; + const char* plus1_spd; + const char* width_widths; + const char* width_lengths; + const char* octet_start_group; + const char* width_spd_sp_desc; + const char* nap; + const char* bitmap; } grib_accessor_data_2order_packing; extern grib_accessor_class* grib_accessor_class_values; static grib_accessor_class _grib_accessor_class_data_2order_packing = { - &grib_accessor_class_values, /* super */ - "data_2order_packing", /* name */ - sizeof(grib_accessor_data_2order_packing), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_values, /* super */ + "data_2order_packing", /* name */ + sizeof(grib_accessor_data_2order_packing), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -150,262 +151,262 @@ grib_accessor_class* grib_accessor_class_data_2order_packing = &_grib_accessor_c static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long v, grib_arguments* args) +static void init(grib_accessor* a, const long v, grib_arguments* args) { - grib_handle* gh = grib_handle_of_accessor(a); - grib_accessor_data_2order_packing *self =(grib_accessor_data_2order_packing*)a; + grib_handle* gh = grib_handle_of_accessor(a); + grib_accessor_data_2order_packing* self = (grib_accessor_data_2order_packing*)a; - self->bits_per_value = grib_arguments_get_name(gh,args,self->carg++); + self->bits_per_value = grib_arguments_get_name(gh, args, self->carg++); - self->reference_value = grib_arguments_get_name(gh,args,self->carg++); + self->reference_value = grib_arguments_get_name(gh, args, self->carg++); - self->binary_scale_factor = grib_arguments_get_name(gh,args,self->carg++); + self->binary_scale_factor = grib_arguments_get_name(gh, args, self->carg++); - self->decimal_scale_factor = grib_arguments_get_name(gh,args,self->carg++); + self->decimal_scale_factor = grib_arguments_get_name(gh, args, self->carg++); - self->half_byte = grib_arguments_get_name(gh,args,self->carg++); + self->half_byte = grib_arguments_get_name(gh, args, self->carg++); - self->n1 = grib_arguments_get_name(gh,args,self->carg++); - self->n2 = grib_arguments_get_name(gh,args,self->carg++); - self->p1 = grib_arguments_get_name(gh,args,self->carg++); - self->extraValues = grib_arguments_get_name(gh,args,self->carg++); - self->p2 = grib_arguments_get_name(gh,args,self->carg++); + self->n1 = grib_arguments_get_name(gh, args, self->carg++); + self->n2 = grib_arguments_get_name(gh, args, self->carg++); + self->p1 = grib_arguments_get_name(gh, args, self->carg++); + self->extraValues = grib_arguments_get_name(gh, args, self->carg++); + self->p2 = grib_arguments_get_name(gh, args, self->carg++); - self->matrix_values = grib_arguments_get_name(gh ,args,self->carg++); - self->snd_bitmap = grib_arguments_get_name(gh ,args,self->carg++); - self->snd_ordr_wdiff = grib_arguments_get_name(gh ,args,self->carg++); + self->matrix_values = grib_arguments_get_name(gh, args, self->carg++); + self->snd_bitmap = grib_arguments_get_name(gh, args, self->carg++); + self->snd_ordr_wdiff = grib_arguments_get_name(gh, args, self->carg++); - self->general_ext = grib_arguments_get_name(gh ,args,self->carg++); - self->boustrophedonic = grib_arguments_get_name(gh ,args,self->carg++); - self->two_ordr_spd = grib_arguments_get_name(gh ,args,self->carg++); - self->plus1_spd = grib_arguments_get_name(gh ,args,self->carg++); + self->general_ext = grib_arguments_get_name(gh, args, self->carg++); + self->boustrophedonic = grib_arguments_get_name(gh, args, self->carg++); + self->two_ordr_spd = grib_arguments_get_name(gh, args, self->carg++); + self->plus1_spd = grib_arguments_get_name(gh, args, self->carg++); - self->width_widths = grib_arguments_get_name(gh ,args,self->carg++); - self->width_lengths = grib_arguments_get_name(gh ,args,self->carg++); - self->octet_start_group = grib_arguments_get_name(gh ,args,self->carg++); - self->width_spd_sp_desc = grib_arguments_get_name(gh ,args,self->carg++); - self->nap = grib_arguments_get_name(gh ,args,self->carg++); - self->bitmap = grib_arguments_get_name(gh, args,self->carg++); + self->width_widths = grib_arguments_get_name(gh, args, self->carg++); + self->width_lengths = grib_arguments_get_name(gh, args, self->carg++); + self->octet_start_group = grib_arguments_get_name(gh, args, self->carg++); + self->width_spd_sp_desc = grib_arguments_get_name(gh, args, self->carg++); + self->nap = grib_arguments_get_name(gh, args, self->carg++); + self->bitmap = grib_arguments_get_name(gh, args, self->carg++); a->flags |= GRIB_ACCESSOR_FLAG_DATA; - } -static const unsigned char BitsSetTable256[256] = -{ -# define B2(n) n, n+1, n+1, n+2 -# define B4(n) B2(n), B2(n+1), B2(n+1), B2(n+2) -# define B6(n) B4(n), B4(n+1), B4(n+1), B4(n+2) - B6(0), B6(1), B6(1), B6(2) +static const unsigned char BitsSetTable256[256] = { +#define B2(n) n, n + 1, n + 1, n + 2 +#define B4(n) B2(n), B2(n + 1), B2(n + 1), B2(n + 2) +#define B6(n) B4(n), B4(n + 1), B4(n + 1), B4(n + 2) + B6(0), B6(1), B6(1), B6(2) }; -static const unsigned char left_mask[8]={0,0x80,0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe }; -static const unsigned char right_mask[8]={0,0x80,0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe }; +static const unsigned char left_mask[8] = { 0, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe }; +static const unsigned char right_mask[8] = { 0, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe }; -static unsigned char* bitmap_pop_line(unsigned char* bitmap,long* bitmap_len,int *bit_offset, - long points_in_line,int *values_in_line) +static unsigned char* bitmap_pop_line(unsigned char* bitmap, long* bitmap_len, int* bit_offset, + long points_in_line, int* values_in_line) { - unsigned char* p=bitmap; - int m=0,bits=0; - int bytes=0; + unsigned char* p = bitmap; + int m = 0, bits = 0; + int bytes = 0; - *values_in_line=0; + *values_in_line = 0; if (*bit_offset) { - bits=8 - *bit_offset; - m=*(p++) & right_mask[bits]; + bits = 8 - *bit_offset; + m = *(p++) & right_mask[bits]; *values_in_line += BitsSetTable256[m]; - points_in_line-=bits; + points_in_line -= bits; (*bitmap_len)--; - *bit_offset=0; + *bit_offset = 0; } - bytes=points_in_line/8; + bytes = points_in_line / 8; while (bytes) { - m=*(p++) & 0xff; + m = *(p++) & 0xff; *values_in_line += BitsSetTable256[m]; (*bitmap_len)--; bytes--; } - *bit_offset=points_in_line % 8; - m=*p & left_mask[*bit_offset]; + *bit_offset = points_in_line % 8; + m = *p & left_mask[*bit_offset]; *values_in_line += BitsSetTable256[m]; return p; } -static int reverse_rows (unsigned long* data, long len, long number_along_parallel, - unsigned char* bitmap,long bitmap_len) +static int reverse_rows(unsigned long* data, long len, long number_along_parallel, + unsigned char* bitmap, long bitmap_len) { - long i = 0; - long left = 0; - long right = number_along_parallel-1; - long tmp = 0; + long i = 0; + long left = 0; + long right = number_along_parallel - 1; + long tmp = 0; long inc; - if (bitmap_len==0) { + if (bitmap_len == 0) { /* NO BITMAP*/ long count = 0; - inc=number_along_parallel; - count = number_along_parallel; + inc = number_along_parallel; + count = number_along_parallel; - while(count < len){ - left = 0; - right = number_along_parallel-1; + while (count < len) { + left = 0; + right = number_along_parallel - 1; data += inc; - for (i = 0;i0); + Assert(left < len); + Assert(right > 0); } - inc=number_along_parallel*2; + inc = number_along_parallel * 2; count += inc; } - } else { + } + else { /*BITMAP present number of point per line not constant*/ - int line_len=0,bit_offset=0; - long bitmap_left_len=bitmap_len; - unsigned char* p=bitmap; - long count=0; - - p=bitmap_pop_line(p,&bitmap_left_len,&bit_offset,number_along_parallel,&line_len); - while(bitmap_left_len>0 && count>=len){ - count+=line_len; + int line_len = 0, bit_offset = 0; + long bitmap_left_len = bitmap_len; + unsigned char* p = bitmap; + long count = 0; + + p = bitmap_pop_line(p, &bitmap_left_len, &bit_offset, number_along_parallel, &line_len); + while (bitmap_left_len > 0 && count >= len) { + count += line_len; data += line_len; - p=bitmap_pop_line(p,&bitmap_left_len,&bit_offset,number_along_parallel,&line_len); - left = 0; - right = line_len-1; + p = bitmap_pop_line(p, &bitmap_left_len, &bit_offset, number_along_parallel, &line_len); + left = 0; + right = line_len - 1; - for (i = 0;i0); + Assert(left < len); + Assert(right > 0); } - count+=line_len; - Assert(countv[j]) + for (j = order; j < len; j++) { + v[j] -= vals[j - 1]; + v[j] -= vals[j - 1] - vals[j - 2]; + if (*bias > v[j]) *bias = v[j]; } - for(j = order; j< len;j++){ - Assert(v[j]-*bias >=0); - vals[j] = v[j]-*bias; + for (j = order; j < len; j++) { + Assert(v[j] - *bias >= 0); + vals[j] = v[j] - *bias; } - grib_context_free(c,v); + grib_context_free(c, v); return 0; } -static int de_spatial_difference (grib_context *c, unsigned long* vals, long len, long order, long bias) +static int de_spatial_difference(grib_context* c, unsigned long* vals, long len, long order, long bias) { - long j = 0; - long i_origin = 0; - long i_first_diff = 0; + long j = 0; + long i_origin = 0; + long i_first_diff = 0; long i_second_diff = 0; - if(order == 0)return 0; + if (order == 0) + return 0; Assert(order > 0); Assert(order <= 3); - i_origin=vals[order-1]; + i_origin = vals[order - 1]; if (order == 1) { - for(j = 1; j< len;j++){ - i_origin=i_origin+(vals[j]+bias); - vals[j]=i_origin; + for (j = 1; j < len; j++) { + i_origin = i_origin + (vals[j] + bias); + vals[j] = i_origin; } } - if (order == 2){ - i_first_diff=vals[1]-vals[0]; - for(j = 2; j< len;j++){ - i_first_diff=i_first_diff+(vals[j]+bias); - i_origin=i_origin+i_first_diff; - vals[j]=i_origin; + if (order == 2) { + i_first_diff = vals[1] - vals[0]; + for (j = 2; j < len; j++) { + i_first_diff = i_first_diff + (vals[j] + bias); + i_origin = i_origin + i_first_diff; + vals[j] = i_origin; } } - if (order == 3){ - i_first_diff=vals[2]-vals[1]; - i_second_diff=i_first_diff-(vals[1]-vals[0]); - for(j = 3; j< len;j++){ - i_second_diff=i_second_diff+(vals[j]+bias); - i_first_diff=i_first_diff+i_second_diff; - i_origin=i_origin+i_first_diff; + if (order == 3) { + i_first_diff = vals[2] - vals[1]; + i_second_diff = i_first_diff - (vals[1] - vals[0]); + for (j = 3; j < len; j++) { + i_second_diff = i_second_diff + (vals[j] + bias); + i_first_diff = i_first_diff + i_second_diff; + i_origin = i_origin + i_first_diff; /* if(j<10) fprintf(stdout,"> %d = %d\n",j,i_origin); - */ vals[j]=i_origin; - + */ + vals[j] = i_origin; } } return 0; @@ -417,39 +418,39 @@ static int de_spatial_difference (grib_context *c, unsigned long* vals, long le second_order_packed* sd = NULL; #endif -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - grib_accessor_data_2order_packing* self = (grib_accessor_data_2order_packing*)a; + grib_accessor_data_2order_packing* self = (grib_accessor_data_2order_packing*)a; - size_t i = 0; - size_t j = 0; + size_t i = 0; + size_t j = 0; size_t n_vals = 0; - int err=0; + int err = 0; - long vcount = 0, bias = 0; - double reference_value; - long binary_scale_factor; - long bits_per_value, decimal_scale_factor; - long n1 = 0, n2 = 0, extraValues = 0, p1 = 0, p2 = 0; + long vcount = 0, bias = 0; + double reference_value; + long binary_scale_factor; + long bits_per_value, decimal_scale_factor; + long n1 = 0, n2 = 0, extraValues = 0, p1 = 0, p2 = 0; - long offsetsection = 0, snd_bitmap = 0, snd_ordr_wdiff = 0; + long offsetsection = 0, snd_bitmap = 0, snd_ordr_wdiff = 0; - long matrix_values =0; - long general_ext =0; - long boustrophedonic =0; - long two_ordr_spd =0; - long plus1_spd =0; + long matrix_values = 0; + long general_ext = 0; + long boustrophedonic = 0; + long two_ordr_spd = 0; + long plus1_spd = 0; - long nbits_per_width =0; - long nbits_per_group_size =0; - long octet_start_group =0; - long width_spd_sp_desc =0; - grib_handle* gh = grib_handle_of_accessor(a); + long nbits_per_width = 0; + long nbits_per_group_size = 0; + long octet_start_group = 0; + long width_spd_sp_desc = 0; + grib_handle* gh = grib_handle_of_accessor(a); unsigned char* buf_size_of_groups = (unsigned char*)gh->buffer->data; unsigned char* buf_width_of_group = (unsigned char*)gh->buffer->data; - unsigned char* bufrefs = (unsigned char*)gh->buffer->data; - unsigned char* bufvals = (unsigned char*)gh->buffer->data; + unsigned char* bufrefs = (unsigned char*)gh->buffer->data; + unsigned char* bufvals = (unsigned char*)gh->buffer->data; double s = 0; double d = 0; @@ -457,84 +458,93 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len) double max = 0; double min = 0; - unsigned long* sec_val = NULL; - long ref_vals = 0; - short n_sp_diff = 0; + unsigned long* sec_val = NULL; + long ref_vals = 0; + short n_sp_diff = 0; - short f_size_of_group = 0; + short f_size_of_group = 0; short f_width_of_group = 0; - long bitp = 0; - long pointer_of_group_size = 0; + long bitp = 0; + long pointer_of_group_size = 0; long pointer_of_group_width = 0; - long refsp = 0; - long nap = 0; - long nn=0; - unsigned char* bitmap=NULL; - grib_accessor* abitmap=NULL; - size_t bitmap_len=0; - - err=grib_value_count(a,&nn); - n_vals=nn; - - if((err = grib_get_long_internal(gh,self->offsetsection,&offsetsection)) - != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->bits_per_value,&bits_per_value)) - != GRIB_SUCCESS) return err; - if((err = grib_get_double_internal(gh,self->reference_value, &reference_value)) - != GRIB_SUCCESS)return err; - if((err = grib_get_long_internal(gh,self->binary_scale_factor, &binary_scale_factor)) - != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->decimal_scale_factor, &decimal_scale_factor)) - != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->n1,&n1)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->n2, &n2)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->p1, &p1)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->extraValues, &extraValues)) != GRIB_SUCCESS) return err; - - p1=p1+65536*extraValues; - - if((err = grib_get_long_internal(gh,self->p2, &p2)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->matrix_values, &matrix_values)) - != GRIB_SUCCESS)return err; - if((err = grib_get_long_internal(gh,self->snd_bitmap, &snd_bitmap)) - != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->snd_ordr_wdiff, &snd_ordr_wdiff)) - != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->general_ext, &general_ext)) - != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->boustrophedonic, &boustrophedonic)) - != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->two_ordr_spd, &two_ordr_spd)) - != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->plus1_spd, &plus1_spd)) - != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->width_widths, &nbits_per_width)) - != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->width_lengths, &nbits_per_group_size)) - != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->octet_start_group, &octet_start_group)) - != GRIB_SUCCESS) return err; - - if((err = grib_get_long_internal(gh,self->width_spd_sp_desc, &width_spd_sp_desc)) - != GRIB_SUCCESS) width_spd_sp_desc=-1; - - if((err = grib_get_long_internal(gh,self->nap, &nap)) != GRIB_SUCCESS) return err; - - self->dirty=0; - - n_sp_diff = two_ordr_spd*2+plus1_spd; - - Assert(bits_per_value < (sizeof(unsigned long)*8)-1); - - if ((abitmap=grib_find_accessor(gh,self->bitmap))!=NULL) { - bitmap_len=grib_byte_count(abitmap); - bitmap=(unsigned char*)grib_context_malloc_clear(a->context,sizeof(char)*bitmap_len); - err=grib_unpack_bytes(abitmap,bitmap,&bitmap_len); - if (err) {grib_context_free(a->context,bitmap); return err;} + long refsp = 0; + long nap = 0; + long nn = 0; + unsigned char* bitmap = NULL; + grib_accessor* abitmap = NULL; + size_t bitmap_len = 0; + + err = grib_value_count(a, &nn); + n_vals = nn; + + if ((err = grib_get_long_internal(gh, self->offsetsection, &offsetsection)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_double_internal(gh, self->reference_value, &reference_value)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->n1, &n1)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->n2, &n2)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->p1, &p1)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->extraValues, &extraValues)) != GRIB_SUCCESS) + return err; + + p1 = p1 + 65536 * extraValues; + + if ((err = grib_get_long_internal(gh, self->p2, &p2)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->matrix_values, &matrix_values)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->snd_bitmap, &snd_bitmap)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->snd_ordr_wdiff, &snd_ordr_wdiff)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->general_ext, &general_ext)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->boustrophedonic, &boustrophedonic)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->two_ordr_spd, &two_ordr_spd)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->plus1_spd, &plus1_spd)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->width_widths, &nbits_per_width)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->width_lengths, &nbits_per_group_size)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->octet_start_group, &octet_start_group)) != GRIB_SUCCESS) + return err; + + if ((err = grib_get_long_internal(gh, self->width_spd_sp_desc, &width_spd_sp_desc)) != GRIB_SUCCESS) + width_spd_sp_desc = -1; + + if ((err = grib_get_long_internal(gh, self->nap, &nap)) != GRIB_SUCCESS) + return err; + + self->dirty = 0; + + n_sp_diff = two_ordr_spd * 2 + plus1_spd; + + Assert(bits_per_value < (sizeof(unsigned long) * 8) - 1); + + if ((abitmap = grib_find_accessor(gh, self->bitmap)) != NULL) { + bitmap_len = grib_byte_count(abitmap); + bitmap = (unsigned char*)grib_context_malloc_clear(a->context, sizeof(char) * bitmap_len); + err = grib_unpack_bytes(abitmap, bitmap, &bitmap_len); + if (err) { + grib_context_free(a->context, bitmap); + return err; + } } - if(bits_per_value == 0) + if (bits_per_value == 0) return GRIB_NOT_IMPLEMENTED; /* I have everything now start decoding */ @@ -567,150 +577,151 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len) fprintf(stdout," offset w = %ld\n", octet_start_group + offsetsection); fprintf(stdout,"\n****************************************\n"); */ - if(snd_bitmap || matrix_values) + if (snd_bitmap || matrix_values) return GRIB_NOT_IMPLEMENTED; - sec_val = (unsigned long*)grib_context_malloc(a->context,(n_vals)*sizeof(unsigned long)); + sec_val = (unsigned long*)grib_context_malloc(a->context, (n_vals) * sizeof(unsigned long)); - buf_width_of_group += a->offset; - buf_size_of_groups += offsetsection+(octet_start_group-1); /* -1 because of documented starting at 1(and not 0)*/ - bufrefs += offsetsection+n1-1; /* -1 because of documented starting at 1(and not 0)*/ + buf_width_of_group += a->offset; + buf_size_of_groups += offsetsection + (octet_start_group - 1); /* -1 because of documented starting at 1(and not 0)*/ + bufrefs += offsetsection + n1 - 1; /* -1 because of documented starting at 1(and not 0)*/ pointer_of_group_size = 0; - pointer_of_group_width = 0; - refsp = 0; + pointer_of_group_width = 0; + refsp = 0; - for(i=0;i < n_sp_diff;i++) - sec_val[i] = grib_decode_unsigned_long(buf_width_of_group, &pointer_of_group_width, width_spd_sp_desc); + for (i = 0; i < n_sp_diff; i++) + sec_val[i] = grib_decode_unsigned_long(buf_width_of_group, &pointer_of_group_width, width_spd_sp_desc); - bias = grib_decode_signed_longb(buf_width_of_group, &pointer_of_group_width, width_spd_sp_desc); + bias = grib_decode_signed_longb(buf_width_of_group, &pointer_of_group_width, width_spd_sp_desc); - bufvals += offsetsection+n2-1; - bitp = 0; - vcount = n_sp_diff; + bufvals += offsetsection + n2 - 1; + bitp = 0; + vcount = n_sp_diff; - if(pointer_of_group_width%8) - pointer_of_group_width = 8+(pointer_of_group_width-(pointer_of_group_width%8)); + if (pointer_of_group_width % 8) + pointer_of_group_width = 8 + (pointer_of_group_width - (pointer_of_group_width % 8)); #if KEEP_OLD == 1 - if(sd == NULL){ - sd = grib_context_malloc_clear(a->context,sizeof(second_order_packed)); - sd->packed_byte_count = 0; - sd->nbits_per_group_size = nbits_per_group_size; - sd->nbits_per_widths = nbits_per_width; - sd->size_of_group_array = p1; - sd->array_of_group_size = grib_context_malloc_clear(a->context,sizeof(unsigned long)*sd->size_of_group_array); - sd->array_of_group_width = grib_context_malloc_clear(a->context,sizeof(unsigned long)*sd->size_of_group_array); - sd->array_of_group_refs = grib_context_malloc_clear(a->context,sizeof( long)*sd->size_of_group_array); + if (sd == NULL) { + sd = grib_context_malloc_clear(a->context, sizeof(second_order_packed)); + sd->packed_byte_count = 0; + sd->nbits_per_group_size = nbits_per_group_size; + sd->nbits_per_widths = nbits_per_width; + sd->size_of_group_array = p1; + sd->array_of_group_size = grib_context_malloc_clear(a->context, sizeof(unsigned long) * sd->size_of_group_array); + sd->array_of_group_width = grib_context_malloc_clear(a->context, sizeof(unsigned long) * sd->size_of_group_array); + sd->array_of_group_refs = grib_context_malloc_clear(a->context, sizeof(long) * sd->size_of_group_array); } #endif - for(i=0;i < p1;i++){ - f_width_of_group = (short) grib_decode_unsigned_long(buf_width_of_group, &pointer_of_group_width, nbits_per_width); - f_size_of_group = (short) grib_decode_unsigned_long(buf_size_of_groups, &pointer_of_group_size, nbits_per_group_size); - ref_vals = grib_decode_unsigned_long(bufrefs, &refsp, bits_per_value); + for (i = 0; i < p1; i++) { + f_width_of_group = (short)grib_decode_unsigned_long(buf_width_of_group, &pointer_of_group_width, nbits_per_width); + f_size_of_group = (short)grib_decode_unsigned_long(buf_size_of_groups, &pointer_of_group_size, nbits_per_group_size); + ref_vals = grib_decode_unsigned_long(bufrefs, &refsp, bits_per_value); #if KEEP_OLD == 1 - if(sd->packed_byte_count == 0){ - sd->array_of_group_width[i] = f_width_of_group; - sd->array_of_group_size[i] = f_size_of_group; - sd->array_of_group_refs[i] = ref_vals; + if (sd->packed_byte_count == 0) { + sd->array_of_group_width[i] = f_width_of_group; + sd->array_of_group_size[i] = f_size_of_group; + sd->array_of_group_refs[i] = ref_vals; } #endif - for(j=0; j < f_size_of_group;j++){ - sec_val[vcount+j] = ref_vals + grib_decode_unsigned_long(bufvals, &bitp, f_width_of_group); + for (j = 0; j < f_size_of_group; j++) { + sec_val[vcount + j] = ref_vals + grib_decode_unsigned_long(bufvals, &bitp, f_width_of_group); } vcount += f_size_of_group; } #if KEEP_OLD == 1 - if(sd->packed_byte_count == 0) sd->packed_byte_count = (bitp+7)/8; + if (sd->packed_byte_count == 0) + sd->packed_byte_count = (bitp + 7) / 8; #endif - Assert (n_vals == vcount); + Assert(n_vals == vcount); /*for(i=0;i < 10;i++) printf("readvalue [%d] %ld %ld bias %ld <<\n", i,sec_val[i],binary_scale_factor,bias );*/ - if(snd_ordr_wdiff) - de_spatial_difference(a->context,sec_val, n_vals, n_sp_diff, bias); + if (snd_ordr_wdiff) + de_spatial_difference(a->context, sec_val, n_vals, n_sp_diff, bias); - if(boustrophedonic) - reverse_rows(sec_val,n_vals,nap,bitmap,bitmap_len); + if (boustrophedonic) + reverse_rows(sec_val, n_vals, nap, bitmap, bitmap_len); - s = grib_power(binary_scale_factor,2); - d = grib_power(-decimal_scale_factor,10) ; + s = grib_power(binary_scale_factor, 2); + d = grib_power(-decimal_scale_factor, 10); - for(i=0;i < n_vals;i++) - val[i] = (double) ((((double)sec_val[i])*s)+reference_value)*d; + for (i = 0; i < n_vals; i++) + val[i] = (double)((((double)sec_val[i]) * s) + reference_value) * d; max = val[0]; min = max; - for(i=0;i< n_vals;i++) - { - if ( val[i] > max ) + for (i = 0; i < n_vals; i++) { + if (val[i] > max) max = val[i]; - else if ( val[i] < min ) + else if (val[i] < min) min = val[i]; } min *= d; max *= d; - grib_context_free(a->context,sec_val); - if (bitmap!=NULL) grib_context_free(a->context,bitmap); + grib_context_free(a->context, sec_val); + if (bitmap != NULL) + grib_context_free(a->context, bitmap); return err; } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { - grib_accessor_data_2order_packing* self = (grib_accessor_data_2order_packing*)a; - grib_handle* gh = grib_handle_of_accessor(a); + grib_accessor_data_2order_packing* self = (grib_accessor_data_2order_packing*)a; + grib_handle* gh = grib_handle_of_accessor(a); - size_t i = 0; - size_t j = 0; - size_t n_vals = *len; + size_t i = 0; + size_t j = 0; + size_t n_vals = *len; size_t buff_len = 0; - double divisor = 1; - long vcount = 0; - int err = 0; - long bias = 0; - double reference_value; - long binary_scale_factor; - long bits_per_value; + double divisor = 1; + long vcount = 0; + int err = 0; + long bias = 0; + double reference_value; + long binary_scale_factor; + long bits_per_value; /*long bit_per_val_rectified_for_gribex;*/ - long decimal_scale_factor; - long n1 = 0; - long n2 = 0; - long p1 = 0; - long n_unused_bits = 0; - long used_bits = 0; - long offsetsection = 0; - long snd_bitmap = 0; - long snd_ordr_wdiff = 0; - - long matrix_values = 0; - - long general_ext = 0; - long boustrophedonic = 0; - long two_ordr_spd = 0; - long plus1_spd = 0; - - long octet_start_group = 0; - long width_spd_sp_desc = 0; - - unsigned char* buf = NULL; - unsigned char* buf_size_of_groups = NULL; + long decimal_scale_factor; + long n1 = 0; + long n2 = 0; + long p1 = 0; + long n_unused_bits = 0; + long used_bits = 0; + long offsetsection = 0; + long snd_bitmap = 0; + long snd_ordr_wdiff = 0; + + long matrix_values = 0; + + long general_ext = 0; + long boustrophedonic = 0; + long two_ordr_spd = 0; + long plus1_spd = 0; + + long octet_start_group = 0; + long width_spd_sp_desc = 0; + + unsigned char* buf = NULL; + unsigned char* buf_size_of_groups = NULL; unsigned char* buf_width_of_group = NULL; - unsigned char* buf_refs = NULL; - unsigned char* buf_vals = NULL; + unsigned char* buf_refs = NULL; + unsigned char* buf_vals = NULL; double d = 0; - unsigned long* sec_val = NULL; - unsigned long* group_val = NULL; + unsigned long* sec_val = NULL; + unsigned long* group_val = NULL; - short n_sp_diff = 0; - unsigned char* bitmap=NULL; - grib_accessor* abitmap=NULL; - size_t bitmap_len=0; + short n_sp_diff = 0; + unsigned char* bitmap = NULL; + grib_accessor* abitmap = NULL; + size_t bitmap_len = 0; #if KEEP_OLD == 1 @@ -718,264 +729,289 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) second_order_packed* sd = NULL; #endif - long bitp = 0; - long pointer_of_group_size = 0; - long pointer_of_group_width = 0; - long refsp = 0; - long nap = 0; - long offsetdata = 0; + long bitp = 0; + long pointer_of_group_size = 0; + long pointer_of_group_width = 0; + long refsp = 0; + long nap = 0; + long offsetdata = 0; double max; double min; - int extraValues=0; - - size_t nv =0; - - if (*len ==0) return GRIB_NO_VALUES; - - if((err = grib_get_long_internal(gh,self->offsetsection,&offsetsection)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->offsetdata,&offsetdata)) != GRIB_SUCCESS) - return err; - if((err = grib_get_long_internal(gh,self->bits_per_value,&bits_per_value)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->matrix_values, &matrix_values)) != GRIB_SUCCESS)return err; - if((err = grib_get_long_internal(gh,self->snd_bitmap, &snd_bitmap)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->snd_ordr_wdiff, &snd_ordr_wdiff)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->general_ext, &general_ext)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->boustrophedonic, &boustrophedonic)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->width_spd_sp_desc, &width_spd_sp_desc)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->nap, &nap)) != GRIB_SUCCESS) return err; - - if ((abitmap=grib_find_accessor(gh,self->bitmap))!=NULL) { - bitmap_len=grib_byte_count(abitmap); - bitmap=(unsigned char*)grib_context_malloc_clear(a->context,sizeof(char)*bitmap_len); - err=grib_unpack_bytes(abitmap,bitmap,&bitmap_len); - if (err) {grib_context_free(a->context,bitmap); return err;} + int extraValues = 0; + + size_t nv = 0; + + if (*len == 0) + return GRIB_NO_VALUES; + + if ((err = grib_get_long_internal(gh, self->offsetsection, &offsetsection)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->offsetdata, &offsetdata)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->matrix_values, &matrix_values)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->snd_bitmap, &snd_bitmap)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->snd_ordr_wdiff, &snd_ordr_wdiff)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->general_ext, &general_ext)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->boustrophedonic, &boustrophedonic)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->width_spd_sp_desc, &width_spd_sp_desc)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->nap, &nap)) != GRIB_SUCCESS) + return err; + + if ((abitmap = grib_find_accessor(gh, self->bitmap)) != NULL) { + bitmap_len = grib_byte_count(abitmap); + bitmap = (unsigned char*)grib_context_malloc_clear(a->context, sizeof(char) * bitmap_len); + err = grib_unpack_bytes(abitmap, bitmap, &bitmap_len); + if (err) { + grib_context_free(a->context, bitmap); + return err; + } } two_ordr_spd = 1; - plus1_spd = 0; + plus1_spd = 0; - if(bits_per_value == 0) + if (bits_per_value == 0) return GRIB_NOT_IMPLEMENTED; - n_sp_diff = two_ordr_spd*2+plus1_spd; + n_sp_diff = two_ordr_spd * 2 + plus1_spd; /* calculation of integer array */ - sec_val = (unsigned long*)grib_context_malloc(a->context,(n_vals)*sizeof(long)); - d = grib_power(decimal_scale_factor,10) ; - max = val[0]; - min = max; - for(i=0;i< n_vals;i++) - { - if ( val[i] > max ) max = val[i]; - else if ( val[i] < min ) min = val[i]; + sec_val = (unsigned long*)grib_context_malloc(a->context, (n_vals) * sizeof(long)); + d = grib_power(decimal_scale_factor, 10); + max = val[0]; + min = max; + for (i = 0; i < n_vals; i++) { + if (val[i] > max) + max = val[i]; + else if (val[i] < min) + min = val[i]; } min *= d; max *= d; /*bit_per_val_rectified_for_gribex = bits_per_value+8-bits_per_value%8;*/ - if (grib_get_nearest_smaller_value(gh,self->reference_value,min,&reference_value) - !=GRIB_SUCCESS) { - grib_context_log(a->context,GRIB_LOG_ERROR, - "unable to find nearest_smaller_value of %g for %s",min,self->reference_value); + if (grib_get_nearest_smaller_value(gh, self->reference_value, min, &reference_value) != GRIB_SUCCESS) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "unable to find nearest_smaller_value of %g for %s", min, self->reference_value); return GRIB_INTERNAL_ERROR; } /* the scale factor in Grib 1 is adjusted in gribex, for "normalization purpose" ... ?*/ - binary_scale_factor = grib_get_binary_scale_fact(max,reference_value,bits_per_value,&err); + binary_scale_factor = grib_get_binary_scale_fact(max, reference_value, bits_per_value, &err); - divisor = grib_power(-binary_scale_factor,2); + divisor = grib_power(-binary_scale_factor, 2); - for(i=0;i< n_vals;i++) - sec_val[i] = (unsigned long)((((val[i]*d)-reference_value)*divisor)+0.5); + for (i = 0; i < n_vals; i++) + sec_val[i] = (unsigned long)((((val[i] * d) - reference_value) * divisor) + 0.5); /* reverse the rows*/ - if(boustrophedonic) - reverse_rows(sec_val,n_vals,nap,bitmap,bitmap_len); + if (boustrophedonic) + reverse_rows(sec_val, n_vals, nap, bitmap, bitmap_len); - if(snd_ordr_wdiff) - if((err = spatial_difference(a->context,sec_val, n_vals, n_sp_diff, &bias))){ - grib_context_free(a->context,sec_val); + if (snd_ordr_wdiff) + if ((err = spatial_difference(a->context, sec_val, n_vals, n_sp_diff, &bias))) { + grib_context_free(a->context, sec_val); return err; } - /* for(i=0;i < 10;i++) printf("packing value [%d] %g %ld %ld bias %ld <<\n", i, val[i],sec_val[i],binary_scale_factor,bias ); */ - nv = n_vals-n_sp_diff; - group_val = sec_val+n_sp_diff; + nv = n_vals - n_sp_diff; + group_val = sec_val + n_sp_diff; #if KEEP_OLD == 1 #else - sd = grib_get_second_order_groups(a->context, group_val, nv); + sd = grib_get_second_order_groups(a->context, group_val, nv); #endif - bitp = 0; - p1 = sd->size_of_group_array; + bitp = 0; + p1 = sd->size_of_group_array; - bitp = (width_spd_sp_desc*(n_sp_diff+1)) ; - octet_start_group = (bitp+7)/8; + bitp = (width_spd_sp_desc * (n_sp_diff + 1)); + octet_start_group = (bitp + 7) / 8; - bitp = (p1*sd->nbits_per_widths); - octet_start_group += (bitp+7)/8; + bitp = (p1 * sd->nbits_per_widths); + octet_start_group += (bitp + 7) / 8; - bitp = (octet_start_group*8) + (sd->nbits_per_group_size*p1); - n1 = (bitp+7)/8; + bitp = (octet_start_group * 8) + (sd->nbits_per_group_size * p1); + n1 = (bitp + 7) / 8; - bitp = n1*8 + bits_per_value*p1; - n2 = (bitp+7)/8; + bitp = n1 * 8 + bits_per_value * p1; + n2 = (bitp + 7) / 8; - used_bits = n2*8; + used_bits = n2 * 8; - buff_len = (n2+sd->packed_byte_count); + buff_len = (n2 + sd->packed_byte_count); - if((a->offset+buff_len)%2) buff_len++; + if ((a->offset + buff_len) % 2) + buff_len++; buf = NULL; - buf = (unsigned char*)grib_context_malloc_clear(a->context,buff_len); + buf = (unsigned char*)grib_context_malloc_clear(a->context, buff_len); - buf_width_of_group = buf; - buf_size_of_groups = buf+octet_start_group; - buf_refs = buf+n1; - buf_vals = buf+n2; + buf_width_of_group = buf; + buf_size_of_groups = buf + octet_start_group; + buf_refs = buf + n1; + buf_vals = buf + n2; - pointer_of_group_size = 0; - pointer_of_group_width = 0; - refsp = 0; - bitp = 0; + pointer_of_group_size = 0; + pointer_of_group_width = 0; + refsp = 0; + bitp = 0; - for(i=0;i < n_sp_diff;i++) - grib_encode_unsigned_longb(buf_width_of_group,sec_val[i], &pointer_of_group_width, width_spd_sp_desc); + for (i = 0; i < n_sp_diff; i++) + grib_encode_unsigned_longb(buf_width_of_group, sec_val[i], &pointer_of_group_width, width_spd_sp_desc); - grib_encode_signed_longb(buf_width_of_group, bias, &pointer_of_group_width, width_spd_sp_desc); + grib_encode_signed_longb(buf_width_of_group, bias, &pointer_of_group_width, width_spd_sp_desc); - if(pointer_of_group_width%8) - pointer_of_group_width = 8+(pointer_of_group_width-(pointer_of_group_width%8)); + if (pointer_of_group_width % 8) + pointer_of_group_width = 8 + (pointer_of_group_width - (pointer_of_group_width % 8)); - vcount = n_sp_diff; + vcount = n_sp_diff; - for(i = 0;iarray_of_group_width[i],&pointer_of_group_width,sd->nbits_per_widths); - grib_encode_unsigned_longb(buf_size_of_groups,sd->array_of_group_size[i], &pointer_of_group_size ,sd->nbits_per_group_size); - grib_encode_unsigned_longb(buf_refs, sd->array_of_group_refs[i], &refsp , bits_per_value); - used_bits += sd->array_of_group_size[i]*sd->array_of_group_width[i]; - for(j=0; j < sd->array_of_group_size[i];j++){ - grib_encode_unsigned_longb(buf_vals, sec_val[vcount+j]-sd->array_of_group_refs[i] ,&bitp , sd->array_of_group_width[i]); + for (i = 0; i < p1; i++) { + grib_encode_unsigned_longb(buf_width_of_group, sd->array_of_group_width[i], &pointer_of_group_width, sd->nbits_per_widths); + grib_encode_unsigned_longb(buf_size_of_groups, sd->array_of_group_size[i], &pointer_of_group_size, sd->nbits_per_group_size); + grib_encode_unsigned_longb(buf_refs, sd->array_of_group_refs[i], &refsp, bits_per_value); + used_bits += sd->array_of_group_size[i] * sd->array_of_group_width[i]; + for (j = 0; j < sd->array_of_group_size[i]; j++) { + grib_encode_unsigned_longb(buf_vals, sec_val[vcount + j] - sd->array_of_group_refs[i], &bitp, sd->array_of_group_width[i]); /* if(vcount+j < 10) printf(">>packing value [%ld] %g %ld %ld nb %ld <<\n", vcount+j, val[vcount+j],sec_val[vcount+j],binary_scale_factor,sd->array_of_group_refs[i] );*/ } - vcount+= sd->array_of_group_size[i]; + vcount += sd->array_of_group_size[i]; } - n_unused_bits = (buff_len*8)-used_bits; + n_unused_bits = (buff_len * 8) - used_bits; - grib_buffer_replace(a, buf,buff_len,1,1); + grib_buffer_replace(a, buf, buff_len, 1, 1); - if((buff_len + (offsetdata-offsetsection)) %2) { - buff_len ++; - grib_update_size(a,buff_len); + if ((buff_len + (offsetdata - offsetsection)) % 2) { + buff_len++; + grib_update_size(a, buff_len); } - octet_start_group += 1+ a->offset-offsetsection; - if((err = grib_set_long_internal(gh,self->octet_start_group, octet_start_group)) != GRIB_SUCCESS) return err; + octet_start_group += 1 + a->offset - offsetsection; + if ((err = grib_set_long_internal(gh, self->octet_start_group, octet_start_group)) != GRIB_SUCCESS) + return err; - n1 += 1+a->offset-offsetsection; - if((err = grib_set_long_internal(gh,self->n1,n1)) != GRIB_SUCCESS) return err; + n1 += 1 + a->offset - offsetsection; + if ((err = grib_set_long_internal(gh, self->n1, n1)) != GRIB_SUCCESS) + return err; - n2 += 1+a->offset-offsetsection; - if((err = grib_set_long_internal(gh,self->n2,n2)) != GRIB_SUCCESS) return err; + n2 += 1 + a->offset - offsetsection; + if ((err = grib_set_long_internal(gh, self->n2, n2)) != GRIB_SUCCESS) + return err; - extraValues=0; + extraValues = 0; while (p1 > 65535) { - p1-=65536; + p1 -= 65536; extraValues++; } - if((err = grib_set_long_internal(gh,self->p1,p1)) != GRIB_SUCCESS) return err; + if ((err = grib_set_long_internal(gh, self->p1, p1)) != GRIB_SUCCESS) + return err; - if((err = grib_set_long_internal(gh,self->extraValues,extraValues)) != GRIB_SUCCESS) return err; + if ((err = grib_set_long_internal(gh, self->extraValues, extraValues)) != GRIB_SUCCESS) + return err; - if((err = grib_set_long_internal(gh,self->p2,n_vals - n_sp_diff)) != GRIB_SUCCESS) return err; + if ((err = grib_set_long_internal(gh, self->p2, n_vals - n_sp_diff)) != GRIB_SUCCESS) + return err; - if((err = grib_set_double_internal(gh,self->reference_value, reference_value)) != GRIB_SUCCESS)return err; + if ((err = grib_set_double_internal(gh, self->reference_value, reference_value)) != GRIB_SUCCESS) + return err; { /* Make sure we can decode it again */ double ref = 1e-100; - grib_get_double_internal(gh,self->reference_value,&ref); + grib_get_double_internal(gh, self->reference_value, &ref); Assert(ref == reference_value); } - if((err = grib_set_long_internal(gh,self->binary_scale_factor, binary_scale_factor)) != GRIB_SUCCESS) return err; + if ((err = grib_set_long_internal(gh, self->binary_scale_factor, binary_scale_factor)) != GRIB_SUCCESS) + return err; - if((err = grib_set_long_internal(gh,self->decimal_scale_factor, decimal_scale_factor)) != GRIB_SUCCESS) return err; - if((err = grib_set_long_internal(gh,self->width_widths, sd->nbits_per_widths)) != GRIB_SUCCESS) return err; - if((err = grib_set_long_internal(gh,self->width_lengths, sd->nbits_per_group_size)) != GRIB_SUCCESS) return err; + if ((err = grib_set_long_internal(gh, self->decimal_scale_factor, decimal_scale_factor)) != GRIB_SUCCESS) + return err; + if ((err = grib_set_long_internal(gh, self->width_widths, sd->nbits_per_widths)) != GRIB_SUCCESS) + return err; + if ((err = grib_set_long_internal(gh, self->width_lengths, sd->nbits_per_group_size)) != GRIB_SUCCESS) + return err; - err = grib_set_long_internal(gh,self->half_byte, n_unused_bits); - if(err != GRIB_SUCCESS) return err; + err = grib_set_long_internal(gh, self->half_byte, n_unused_bits); + if (err != GRIB_SUCCESS) + return err; #if KEEP_OLD == 1 #else - - grib_free_second_order_groups(a->context,sd); + grib_free_second_order_groups(a->context, sd); #endif - ; - grib_context_free(a->context,buf); - grib_context_free(a->context,sec_val); - if (bitmap!=NULL) grib_context_free(a->context,bitmap); + grib_context_free(a->context, buf); + grib_context_free(a->context, sec_val); + if (bitmap != NULL) + grib_context_free(a->context, bitmap); return GRIB_SUCCESS; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - int err=0; - grib_accessor_data_2order_packing* self = (grib_accessor_data_2order_packing*)a; - long two_ordr_spd = 0; - long plus1_spd = 0; - grib_handle* gh = grib_handle_of_accessor(a); - unsigned char* buf_size_of_groups = (unsigned char*)gh->buffer->data; - long octet_start_group = 0; - long offsetsection = 0; - long nbits_per_lengths = 0; - long pointer_of_group_size = 0; - long p1 = 0; - long extraValues=0; + int err = 0; + grib_accessor_data_2order_packing* self = (grib_accessor_data_2order_packing*)a; + long two_ordr_spd = 0; + long plus1_spd = 0; + grib_handle* gh = grib_handle_of_accessor(a); + unsigned char* buf_size_of_groups = (unsigned char*)gh->buffer->data; + long octet_start_group = 0; + long offsetsection = 0; + long nbits_per_lengths = 0; + long pointer_of_group_size = 0; + long p1 = 0; + long extraValues = 0; size_t i = 0; - if((err=grib_get_long_internal(gh,self->two_ordr_spd, &two_ordr_spd)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(gh, self->two_ordr_spd, &two_ordr_spd)) != GRIB_SUCCESS) return err; - if( (err=grib_get_long_internal(gh,self->plus1_spd, &plus1_spd)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(gh, self->plus1_spd, &plus1_spd)) != GRIB_SUCCESS) return err; - if( (err=grib_get_long_internal(gh,self->width_lengths, &nbits_per_lengths)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(gh, self->width_lengths, &nbits_per_lengths)) != GRIB_SUCCESS) return err; - if( (err=grib_get_long_internal(gh,self->offsetsection, &offsetsection)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(gh, self->offsetsection, &offsetsection)) != GRIB_SUCCESS) return err; - if( (err=grib_get_long_internal(gh,self->octet_start_group, &octet_start_group)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(gh, self->octet_start_group, &octet_start_group)) != GRIB_SUCCESS) return err; - if( (err=grib_get_long_internal(gh,self->p1, &p1)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(gh, self->p1, &p1)) != GRIB_SUCCESS) return err; - if( (err=grib_get_long_internal(gh,self->extraValues, &extraValues)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(gh, self->extraValues, &extraValues)) != GRIB_SUCCESS) return err; - p1+=extraValues*65536; + p1 += extraValues * 65536; - buf_size_of_groups += offsetsection+(octet_start_group-1); - *count = two_ordr_spd*2+plus1_spd; + buf_size_of_groups += offsetsection + (octet_start_group - 1); + *count = two_ordr_spd * 2 + plus1_spd; - for(i=0;i < p1;i++) - *count += grib_decode_unsigned_long(buf_size_of_groups, &pointer_of_group_size, nbits_per_lengths); + for (i = 0; i < p1; i++) + *count += grib_decode_unsigned_long(buf_size_of_groups, &pointer_of_group_size, nbits_per_lengths); return err; } diff --git a/src/grib_accessor_class_data_2order_packing_count.c b/src/grib_accessor_class_data_2order_packing_count.c index e0e938e31..cb442ea92 100644 --- a/src/grib_accessor_class_data_2order_packing_count.c +++ b/src/grib_accessor_class_data_2order_packing_count.c @@ -38,69 +38,70 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_long(grib_accessor*, long* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_data_2order_packing_count { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in unsigned */ - long nbytes; - grib_arguments* arg; -/* Members defined in data_2order_packing_count */ - const char* offsetsection; - const char* p1; - const char* two_ordr_spd; - const char* plus1_spd; - const char* width_lengths; - const char* octet_start_group; +typedef struct grib_accessor_data_2order_packing_count +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in unsigned */ + long nbytes; + grib_arguments* arg; + /* Members defined in data_2order_packing_count */ + const char* offsetsection; + const char* p1; + const char* two_ordr_spd; + const char* plus1_spd; + const char* width_lengths; + const char* octet_start_group; } grib_accessor_data_2order_packing_count; extern grib_accessor_class* grib_accessor_class_unsigned; static grib_accessor_class _grib_accessor_class_data_2order_packing_count = { - &grib_accessor_class_unsigned, /* super */ - "data_2order_packing_count", /* name */ - sizeof(grib_accessor_data_2order_packing_count), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_unsigned, /* super */ + "data_2order_packing_count", /* name */ + sizeof(grib_accessor_data_2order_packing_count), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -109,92 +110,92 @@ grib_accessor_class* grib_accessor_class_data_2order_packing_count = &_grib_acce static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long v, grib_arguments* args) +static void init(grib_accessor* a, const long v, grib_arguments* args) { - grib_accessor_data_2order_packing_count *self =(grib_accessor_data_2order_packing_count*)a; - int n=0; + grib_accessor_data_2order_packing_count* self = (grib_accessor_data_2order_packing_count*)a; + int n = 0; - self->offsetsection = grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->p1 = grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->two_ordr_spd = grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->plus1_spd = grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->width_lengths = grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->octet_start_group = grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); + self->offsetsection = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->p1 = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->two_ordr_spd = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->plus1_spd = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->width_lengths = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->octet_start_group = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } -static int unpack_long (grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - int ret=0; - grib_accessor_data_2order_packing_count* self = (grib_accessor_data_2order_packing_count*)a; - long count = 0; - long two_ordr_spd = 0; - long plus1_spd = 0; - unsigned char* buf_size_of_groups = (unsigned char*)grib_handle_of_accessor(a)->buffer->data; - long octet_start_group = 0; - long offsetsection = 0; - long nbits_per_lengths = 0; - long pointer_of_group_size = 0; - long p1 = 0; + int ret = 0; + grib_accessor_data_2order_packing_count* self = (grib_accessor_data_2order_packing_count*)a; + long count = 0; + long two_ordr_spd = 0; + long plus1_spd = 0; + unsigned char* buf_size_of_groups = (unsigned char*)grib_handle_of_accessor(a)->buffer->data; + long octet_start_group = 0; + long offsetsection = 0; + long nbits_per_lengths = 0; + long pointer_of_group_size = 0; + long p1 = 0; size_t i = 0; - if ((ret=grib_get_long_internal(grib_handle_of_accessor(a),self->two_ordr_spd, &two_ordr_spd)) - !=GRIB_SUCCESS) return ret; - if ((ret=grib_get_long_internal(grib_handle_of_accessor(a),self->plus1_spd, &plus1_spd)) - !=GRIB_SUCCESS) return ret; - if ((ret=grib_get_long_internal(grib_handle_of_accessor(a),self->width_lengths, &nbits_per_lengths)) - !=GRIB_SUCCESS) return ret; - if ((ret=grib_get_long_internal(grib_handle_of_accessor(a),self->offsetsection, &offsetsection)) - !=GRIB_SUCCESS) return ret; - if ((ret=grib_get_long_internal(grib_handle_of_accessor(a),self->octet_start_group, &octet_start_group)) - !=GRIB_SUCCESS) return ret; - if ((ret=grib_get_long_internal(grib_handle_of_accessor(a),self->p1, &p1)) - !=GRIB_SUCCESS) return ret; - - buf_size_of_groups += offsetsection+(octet_start_group-1); - count = two_ordr_spd*2+plus1_spd; - - for(i=0;i < p1;i++) - count += grib_decode_unsigned_long(buf_size_of_groups, &pointer_of_group_size, nbits_per_lengths); - - *val=count; - *len=1; + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->two_ordr_spd, &two_ordr_spd)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->plus1_spd, &plus1_spd)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->width_lengths, &nbits_per_lengths)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetsection, &offsetsection)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->octet_start_group, &octet_start_group)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->p1, &p1)) != GRIB_SUCCESS) + return ret; + + buf_size_of_groups += offsetsection + (octet_start_group - 1); + count = two_ordr_spd * 2 + plus1_spd; + + for (i = 0; i < p1; i++) + count += grib_decode_unsigned_long(buf_size_of_groups, &pointer_of_group_size, nbits_per_lengths); + + *val = count; + *len = 1; return GRIB_SUCCESS; } diff --git a/src/grib_accessor_class_data_apply_bitmap.c b/src/grib_accessor_class_data_apply_bitmap.c index 05705e350..92ec1ee8a 100644 --- a/src/grib_accessor_class_data_apply_bitmap.c +++ b/src/grib_accessor_class_data_apply_bitmap.c @@ -40,70 +40,71 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int value_count(grib_accessor*,long*); +static int get_native_type(grib_accessor*); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int value_count(grib_accessor*, long*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -static int unpack_double_element(grib_accessor*,size_t i, double* val); - -typedef struct grib_accessor_data_apply_bitmap { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in data_apply_bitmap */ - const char* coded_values; - const char* bitmap; - const char* missing_value; - const char* number_of_data_points; - const char* number_of_values; - const char* binary_scale_factor; +static int unpack_double_element(grib_accessor*, size_t i, double* val); + +typedef struct grib_accessor_data_apply_bitmap +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in data_apply_bitmap */ + const char* coded_values; + const char* bitmap; + const char* missing_value; + const char* number_of_data_points; + const char* number_of_values; + const char* binary_scale_factor; } grib_accessor_data_apply_bitmap; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_data_apply_bitmap = { - &grib_accessor_class_gen, /* super */ - "data_apply_bitmap", /* name */ - sizeof(grib_accessor_data_apply_bitmap), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - &unpack_double_element, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "data_apply_bitmap", /* name */ + sizeof(grib_accessor_data_apply_bitmap), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + &unpack_double_element, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -112,247 +113,251 @@ grib_accessor_class* grib_accessor_class_data_apply_bitmap = &_grib_accessor_cla static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long v, grib_arguments* args) +static void init(grib_accessor* a, const long v, grib_arguments* args) { - int n=0; - grib_accessor_data_apply_bitmap *self =(grib_accessor_data_apply_bitmap*)a; + int n = 0; + grib_accessor_data_apply_bitmap* self = (grib_accessor_data_apply_bitmap*)a; - self->coded_values = grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->bitmap = grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->missing_value = grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->binary_scale_factor = grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->number_of_data_points = grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->number_of_values = grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); + self->coded_values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->bitmap = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->missing_value = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->binary_scale_factor = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->number_of_data_points = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->number_of_values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); a->length = 0; } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_values(dumper,a); + grib_dump_values(dumper, a); } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - grib_accessor_data_apply_bitmap *self =(grib_accessor_data_apply_bitmap*)a; - size_t len = 0; - int ret = 0; + grib_accessor_data_apply_bitmap* self = (grib_accessor_data_apply_bitmap*)a; + size_t len = 0; + int ret = 0; - if(grib_find_accessor(grib_handle_of_accessor(a),self->bitmap)) - ret = grib_get_size(grib_handle_of_accessor(a),self->bitmap,&len); + if (grib_find_accessor(grib_handle_of_accessor(a), self->bitmap)) + ret = grib_get_size(grib_handle_of_accessor(a), self->bitmap, &len); else - ret = grib_get_size(grib_handle_of_accessor(a),self->coded_values,&len); + ret = grib_get_size(grib_handle_of_accessor(a), self->coded_values, &len); - *count=len; + *count = len; return ret; } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - grib_accessor_data_apply_bitmap* self = (grib_accessor_data_apply_bitmap*)a; - - size_t i = 0; - size_t j = 0; - size_t n_vals = 0; - long nn=0; - int err=0; - size_t coded_n_vals = 0; - double* coded_vals = NULL; + grib_accessor_data_apply_bitmap* self = (grib_accessor_data_apply_bitmap*)a; + + size_t i = 0; + size_t j = 0; + size_t n_vals = 0; + long nn = 0; + int err = 0; + size_t coded_n_vals = 0; + double* coded_vals = NULL; double missing_value = 0; - err=grib_value_count(a,&nn); - n_vals=nn; - if (err) return err; + err = grib_value_count(a, &nn); + n_vals = nn; + if (err) + return err; - if(!grib_find_accessor(grib_handle_of_accessor(a),self->bitmap)) - return grib_get_double_array(grib_handle_of_accessor(a),self->coded_values,val,len); + if (!grib_find_accessor(grib_handle_of_accessor(a), self->bitmap)) + return grib_get_double_array(grib_handle_of_accessor(a), self->coded_values, val, len); - if((err = grib_get_size(grib_handle_of_accessor(a),self->coded_values,&coded_n_vals)) != GRIB_SUCCESS) + if ((err = grib_get_size(grib_handle_of_accessor(a), self->coded_values, &coded_n_vals)) != GRIB_SUCCESS) return err; - if((err = grib_get_double_internal(grib_handle_of_accessor(a),self->missing_value,&missing_value)) - != GRIB_SUCCESS) return err; + if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->missing_value, &missing_value)) != GRIB_SUCCESS) + return err; - if(*len < n_vals) { + if (*len < n_vals) { *len = n_vals; return GRIB_ARRAY_TOO_SMALL; } - if (coded_n_vals==0) { - for(i=0;i < n_vals;i++) + if (coded_n_vals == 0) { + for (i = 0; i < n_vals; i++) val[i] = missing_value; - *len=n_vals; + *len = n_vals; return GRIB_SUCCESS; } - if((err = grib_get_double_array_internal(grib_handle_of_accessor(a),self->bitmap,val,&n_vals)) - != GRIB_SUCCESS) + if ((err = grib_get_double_array_internal(grib_handle_of_accessor(a), self->bitmap, val, &n_vals)) != GRIB_SUCCESS) return err; - coded_vals = (double*)grib_context_malloc(a->context,coded_n_vals*sizeof(double)); - if(coded_vals == NULL) return GRIB_OUT_OF_MEMORY; + coded_vals = (double*)grib_context_malloc(a->context, coded_n_vals * sizeof(double)); + if (coded_vals == NULL) + return GRIB_OUT_OF_MEMORY; - if((err = grib_get_double_array(grib_handle_of_accessor(a),self->coded_values,coded_vals,&coded_n_vals)) - != GRIB_SUCCESS) - { - grib_context_free(a->context,coded_vals); + if ((err = grib_get_double_array(grib_handle_of_accessor(a), self->coded_values, coded_vals, &coded_n_vals)) != GRIB_SUCCESS) { + grib_context_free(a->context, coded_vals); return err; } grib_context_log(a->context, GRIB_LOG_DEBUG, - "grib_accessor_class_data_apply_bitmap: unpack_double : creating %s, %d values", - a->name, n_vals); + "grib_accessor_class_data_apply_bitmap: unpack_double : creating %s, %d values", + a->name, n_vals); - for(i=0;i < n_vals;i++) - { - if(val[i] == 0 ){ + for (i = 0; i < n_vals; i++) { + if (val[i] == 0) { val[i] = missing_value; } - else - { + else { val[i] = coded_vals[j++]; - if(j>coded_n_vals) - { - grib_context_free(a->context,coded_vals); + if (j > coded_n_vals) { + grib_context_free(a->context, coded_vals); grib_context_log(a->context, GRIB_LOG_ERROR, - "grib_accessor_class_data_apply_bitmap [%s]:" - " unpack_double : number of coded values does not match bitmap %ld %ld", - a->name,coded_n_vals,n_vals); + "grib_accessor_class_data_apply_bitmap [%s]:" + " unpack_double : number of coded values does not match bitmap %ld %ld", + a->name, coded_n_vals, n_vals); return GRIB_ARRAY_TOO_SMALL; } } } - *len = n_vals; + *len = n_vals; - grib_context_free(a->context,coded_vals); + grib_context_free(a->context, coded_vals); return err; } -static int unpack_double_element(grib_accessor* a, size_t idx,double* val) +static int unpack_double_element(grib_accessor* a, size_t idx, double* val) { - grib_accessor_data_apply_bitmap* self = (grib_accessor_data_apply_bitmap*)a; - int err = 0,i=0; - size_t cidx=0; + grib_accessor_data_apply_bitmap* self = (grib_accessor_data_apply_bitmap*)a; + int err = 0, i = 0; + size_t cidx = 0; double missing_value = 0; - double* bvals=NULL; - size_t n_vals = 0; - long nn=0; + double* bvals = NULL; + size_t n_vals = 0; + long nn = 0; - err=grib_value_count(a,&nn); - n_vals=nn; - if (err) return err; + err = grib_value_count(a, &nn); + n_vals = nn; + if (err) + return err; - if(!grib_find_accessor(grib_handle_of_accessor(a),self->bitmap)) - return grib_get_double_element_internal(grib_handle_of_accessor(a),self->coded_values,idx,val); + if (!grib_find_accessor(grib_handle_of_accessor(a), self->bitmap)) + return grib_get_double_element_internal(grib_handle_of_accessor(a), self->coded_values, idx, val); - if((err = grib_get_double_internal(grib_handle_of_accessor(a),self->missing_value,&missing_value)) != GRIB_SUCCESS) + if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->missing_value, &missing_value)) != GRIB_SUCCESS) return err; - if((err = grib_get_double_element_internal(grib_handle_of_accessor(a),self->bitmap,idx,val)) != GRIB_SUCCESS) + if ((err = grib_get_double_element_internal(grib_handle_of_accessor(a), self->bitmap, idx, val)) != GRIB_SUCCESS) return err; - if (*val == 0) {*val=missing_value;return GRIB_SUCCESS;} + if (*val == 0) { + *val = missing_value; + return GRIB_SUCCESS; + } - bvals = (double*)grib_context_malloc(a->context,n_vals*sizeof(double)); - if(bvals == NULL) return GRIB_OUT_OF_MEMORY; + bvals = (double*)grib_context_malloc(a->context, n_vals * sizeof(double)); + if (bvals == NULL) + return GRIB_OUT_OF_MEMORY; - if((err = grib_get_double_array_internal(grib_handle_of_accessor(a),self->bitmap,bvals,&n_vals)) != GRIB_SUCCESS) + if ((err = grib_get_double_array_internal(grib_handle_of_accessor(a), self->bitmap, bvals, &n_vals)) != GRIB_SUCCESS) return err; - cidx=0; - for (i=0;icontext,bvals); + grib_context_free(a->context, bvals); - return grib_get_double_element_internal(grib_handle_of_accessor(a),self->coded_values,cidx,val); + return grib_get_double_element_internal(grib_handle_of_accessor(a), self->coded_values, cidx, val); } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { - grib_accessor_data_apply_bitmap* self = (grib_accessor_data_apply_bitmap*)a; - int err = 0; - size_t bmaplen = *len; - long coded_n_vals = 0; - double* coded_vals = NULL; - long i = 0; - long j = 0; - double missing_value = 0; - - if (*len ==0) return GRIB_NO_VALUES; - - if(!grib_find_accessor(grib_handle_of_accessor(a),self->bitmap)){ - err = grib_set_double_array_internal(grib_handle_of_accessor(a),self->coded_values,val,*len); + grib_accessor_data_apply_bitmap* self = (grib_accessor_data_apply_bitmap*)a; + int err = 0; + size_t bmaplen = *len; + long coded_n_vals = 0; + double* coded_vals = NULL; + long i = 0; + long j = 0; + double missing_value = 0; + + if (*len == 0) + return GRIB_NO_VALUES; + + if (!grib_find_accessor(grib_handle_of_accessor(a), self->bitmap)) { + err = grib_set_double_array_internal(grib_handle_of_accessor(a), self->coded_values, val, *len); /*printf("SETTING TOTAL number_of_data_points %s %ld\n",self->number_of_data_points,*len);*/ - if(self->number_of_data_points) - grib_set_long_internal(grib_handle_of_accessor(a),self->number_of_data_points,*len); + if (self->number_of_data_points) + grib_set_long_internal(grib_handle_of_accessor(a), self->number_of_data_points, *len); return err; } - if((err = grib_get_double_internal(grib_handle_of_accessor(a),self->missing_value,&missing_value)) != GRIB_SUCCESS) + if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->missing_value, &missing_value)) != GRIB_SUCCESS) return err; - if((err = grib_set_double_array_internal(grib_handle_of_accessor(a),self->bitmap,val,bmaplen)) != GRIB_SUCCESS) + if ((err = grib_set_double_array_internal(grib_handle_of_accessor(a), self->bitmap, val, bmaplen)) != GRIB_SUCCESS) return err; coded_n_vals = *len; - if(coded_n_vals < 1){ - err = grib_set_double_array_internal(grib_handle_of_accessor(a),self->coded_values,NULL,0); + if (coded_n_vals < 1) { + err = grib_set_double_array_internal(grib_handle_of_accessor(a), self->coded_values, NULL, 0); return err; } - coded_vals = (double*)grib_context_malloc_clear(a->context,coded_n_vals*sizeof(double)); - if(!coded_vals) return GRIB_OUT_OF_MEMORY; + coded_vals = (double*)grib_context_malloc_clear(a->context, coded_n_vals * sizeof(double)); + if (!coded_vals) + return GRIB_OUT_OF_MEMORY; - for(i=0; i<*len ; i++) - { - if(val[i] != missing_value) { + for (i = 0; i < *len; i++) { + if (val[i] != missing_value) { coded_vals[j++] = val[i]; } } - err = grib_set_double_array_internal(grib_handle_of_accessor(a),self->coded_values,coded_vals,j); - if (j==0) { + err = grib_set_double_array_internal(grib_handle_of_accessor(a), self->coded_values, coded_vals, j); + if (j == 0) { if (self->number_of_values) - err=grib_set_long_internal(grib_handle_of_accessor(a),self->number_of_values,0); + err = grib_set_long_internal(grib_handle_of_accessor(a), self->number_of_values, 0); if (self->binary_scale_factor) - err=grib_set_long_internal(grib_handle_of_accessor(a),self->binary_scale_factor,0); + err = grib_set_long_internal(grib_handle_of_accessor(a), self->binary_scale_factor, 0); } - grib_context_free(a->context,coded_vals); + grib_context_free(a->context, coded_vals); return err; } diff --git a/src/grib_accessor_class_data_apply_boustrophedonic.c b/src/grib_accessor_class_data_apply_boustrophedonic.c index 6c8a2917d..acd7f3c7d 100644 --- a/src/grib_accessor_class_data_apply_boustrophedonic.c +++ b/src/grib_accessor_class_data_apply_boustrophedonic.c @@ -39,69 +39,70 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int value_count(grib_accessor*,long*); +static int get_native_type(grib_accessor*); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int value_count(grib_accessor*, long*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -static int unpack_double_element(grib_accessor*,size_t i, double* val); - -typedef struct grib_accessor_data_apply_boustrophedonic { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in data_apply_boustrophedonic */ - const char* values; - const char* numberOfRows; - const char* numberOfColumns; - const char* numberOfPoints; - const char* pl; +static int unpack_double_element(grib_accessor*, size_t i, double* val); + +typedef struct grib_accessor_data_apply_boustrophedonic +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in data_apply_boustrophedonic */ + const char* values; + const char* numberOfRows; + const char* numberOfColumns; + const char* numberOfPoints; + const char* pl; } grib_accessor_data_apply_boustrophedonic; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_data_apply_boustrophedonic = { - &grib_accessor_class_gen, /* super */ - "data_apply_boustrophedonic", /* name */ - sizeof(grib_accessor_data_apply_boustrophedonic), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - &unpack_double_element, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "data_apply_boustrophedonic", /* name */ + sizeof(grib_accessor_data_apply_boustrophedonic), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + &unpack_double_element, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -110,237 +111,261 @@ grib_accessor_class* grib_accessor_class_data_apply_boustrophedonic = &_grib_acc static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long v, grib_arguments* args) +static void init(grib_accessor* a, const long v, grib_arguments* args) { - int n=0; - grib_accessor_data_apply_boustrophedonic *self =(grib_accessor_data_apply_boustrophedonic*)a; + int n = 0; + grib_accessor_data_apply_boustrophedonic* self = (grib_accessor_data_apply_boustrophedonic*)a; - self->values = grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->numberOfRows = grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->numberOfColumns = grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->numberOfPoints = grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->pl = grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); + self->values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->numberOfRows = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->numberOfColumns = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->numberOfPoints = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->pl = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); a->length = 0; } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_values(dumper,a); + grib_dump_values(dumper, a); } static int value_count(grib_accessor* a, long* numberOfPoints) { - grib_accessor_data_apply_boustrophedonic *self =(grib_accessor_data_apply_boustrophedonic*)a; - int ret=0; + grib_accessor_data_apply_boustrophedonic* self = (grib_accessor_data_apply_boustrophedonic*)a; + int ret = 0; - *numberOfPoints=0; - ret=grib_get_long_internal(grib_handle_of_accessor(a),self->numberOfPoints,numberOfPoints); + *numberOfPoints = 0; + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints, numberOfPoints); return ret; } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - grib_accessor_data_apply_boustrophedonic* self = (grib_accessor_data_apply_boustrophedonic*)a; - size_t plSize=0; - long *pl=0; - double *values=0; - double *pvalues=0; - double *pval=0; - size_t valuesSize=0; - long i,j; + grib_accessor_data_apply_boustrophedonic* self = (grib_accessor_data_apply_boustrophedonic*)a; + size_t plSize = 0; + long* pl = 0; + double* values = 0; + double* pvalues = 0; + double* pval = 0; + size_t valuesSize = 0; + long i, j; int ret; - long numberOfPoints,numberOfRows,numberOfColumns; + long numberOfPoints, numberOfRows, numberOfColumns; - ret=grib_get_long_internal(grib_handle_of_accessor(a),self->numberOfPoints,&numberOfPoints); - if (ret) return ret; + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints, &numberOfPoints); + if (ret) + return ret; - if(*len < numberOfPoints) { + if (*len < numberOfPoints) { *len = numberOfPoints; return GRIB_ARRAY_TOO_SMALL; } - ret=grib_get_size(grib_handle_of_accessor(a),self->values,&valuesSize); - if (ret) return ret; + ret = grib_get_size(grib_handle_of_accessor(a), self->values, &valuesSize); + if (ret) + return ret; /* constant field */ - if (valuesSize==0) return 0; + if (valuesSize == 0) + return 0; - if (valuesSize!=numberOfPoints) { - grib_context_log(a->context,GRIB_LOG_ERROR,"boustrophedonic ordering error: ( %s=%ld ) != (sizeOf(%s)=%ld)", - self->numberOfPoints,numberOfPoints,self->values,(long)valuesSize); + if (valuesSize != numberOfPoints) { + grib_context_log(a->context, GRIB_LOG_ERROR, "boustrophedonic ordering error: ( %s=%ld ) != (sizeOf(%s)=%ld)", + self->numberOfPoints, numberOfPoints, self->values, (long)valuesSize); return GRIB_DECODING_ERROR; } - values=(double*)grib_context_malloc_clear(a->context,sizeof(double)*numberOfPoints); - ret=grib_get_double_array_internal(grib_handle_of_accessor(a),self->values,values,&valuesSize); - if (ret) return ret; - - pvalues=values; - pval=val; - - ret=grib_get_long_internal(grib_handle_of_accessor(a),self->numberOfRows,&numberOfRows); - if (ret) return ret; - - ret=grib_get_long_internal(grib_handle_of_accessor(a),self->numberOfColumns,&numberOfColumns); - if (ret) return ret; - - if (grib_get_size(grib_handle_of_accessor(a),self->pl,&plSize) == GRIB_SUCCESS) { - Assert(plSize==numberOfRows); - pl=(long*)grib_context_malloc_clear(a->context,sizeof(long)*plSize); - ret=grib_get_long_array_internal(grib_handle_of_accessor(a),self->pl,pl,&plSize); - if (ret) return ret; - - for (j=0;jcontext, sizeof(double) * numberOfPoints); + ret = grib_get_double_array_internal(grib_handle_of_accessor(a), self->values, values, &valuesSize); + if (ret) + return ret; + + pvalues = values; + pval = val; + + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfRows, &numberOfRows); + if (ret) + return ret; + + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfColumns, &numberOfColumns); + if (ret) + return ret; + + if (grib_get_size(grib_handle_of_accessor(a), self->pl, &plSize) == GRIB_SUCCESS) { + Assert(plSize == numberOfRows); + pl = (long*)grib_context_malloc_clear(a->context, sizeof(long) * plSize); + ret = grib_get_long_array_internal(grib_handle_of_accessor(a), self->pl, pl, &plSize); + if (ret) + return ret; + + for (j = 0; j < numberOfRows; j++) { + if (j % 2) { + pval += pl[j]; + for (i = 0; i < pl[j]; i++) + *(pval--) = *(pvalues++); + pval += pl[j]; + } + else { + for (i = 0; i < pl[j]; i++) + *(pval++) = *(pvalues++); } } - grib_context_free(a->context,pl); - - } else { - - for (j=0;jcontext, pl); + } + else { + for (j = 0; j < numberOfRows; j++) { + if (j % 2) { + pval += numberOfColumns - 1; + for (i = 0; i < numberOfColumns; i++) + *(pval--) = *(pvalues++); + pval += numberOfColumns + 1; + } + else { + for (i = 0; i < numberOfColumns; i++) + *(pval++) = *(pvalues++); } } - } - grib_context_free(a->context,values); + grib_context_free(a->context, values); return GRIB_SUCCESS; } -static int unpack_double_element(grib_accessor* a, size_t idx,double* val) +static int unpack_double_element(grib_accessor* a, size_t idx, double* val) { size_t size; double* values; int err = 0; - - /* GRIB-564: The index idx relates to codedValues NOT values! */ - err=grib_get_size(a->parent->h,"codedValues",&size); - if (err) return err; - if (idx > size) return GRIB_INVALID_NEAREST; + /* GRIB-564: The index idx relates to codedValues NOT values! */ - values=(double*)grib_context_malloc_clear(a->parent->h->context,size*sizeof(double)); - err=grib_get_double_array(a->parent->h,"codedValues",values,&size); - if (err) return err; - *val=values[idx]; - grib_context_free(a->parent->h->context,values); + err = grib_get_size(a->parent->h, "codedValues", &size); + if (err) + return err; + if (idx > size) + return GRIB_INVALID_NEAREST; + + values = (double*)grib_context_malloc_clear(a->parent->h->context, size * sizeof(double)); + err = grib_get_double_array(a->parent->h, "codedValues", values, &size); + if (err) + return err; + *val = values[idx]; + grib_context_free(a->parent->h->context, values); return err; } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { - grib_accessor_data_apply_boustrophedonic* self = (grib_accessor_data_apply_boustrophedonic*)a; - size_t plSize=0; - long *pl=0; - double *values=0; - double *pvalues=0; - double *pval=0; - size_t valuesSize=0; - long i,j; + grib_accessor_data_apply_boustrophedonic* self = (grib_accessor_data_apply_boustrophedonic*)a; + size_t plSize = 0; + long* pl = 0; + double* values = 0; + double* pvalues = 0; + double* pval = 0; + size_t valuesSize = 0; + long i, j; int ret; - long numberOfPoints,numberOfRows,numberOfColumns; + long numberOfPoints, numberOfRows, numberOfColumns; - ret=grib_get_long_internal(grib_handle_of_accessor(a),self->numberOfPoints,&numberOfPoints); - if (ret) return ret; + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints, &numberOfPoints); + if (ret) + return ret; - if(*len < numberOfPoints) { + if (*len < numberOfPoints) { *len = numberOfPoints; return GRIB_ARRAY_TOO_SMALL; } - valuesSize=numberOfPoints; + valuesSize = numberOfPoints; - values=(double*)grib_context_malloc_clear(a->context,sizeof(double)*numberOfPoints); + values = (double*)grib_context_malloc_clear(a->context, sizeof(double) * numberOfPoints); - pvalues=values; - pval=(double*)val; + pvalues = values; + pval = (double*)val; - ret=grib_get_long_internal(grib_handle_of_accessor(a),self->numberOfRows,&numberOfRows); - if (ret) return ret; + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfRows, &numberOfRows); + if (ret) + return ret; - ret=grib_get_long_internal(grib_handle_of_accessor(a),self->numberOfColumns,&numberOfColumns); - if (ret) return ret; + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfColumns, &numberOfColumns); + if (ret) + return ret; - if (grib_get_size(grib_handle_of_accessor(a),self->pl,&plSize) == GRIB_SUCCESS) { - Assert(plSize==numberOfRows); - pl=(long*)grib_context_malloc_clear(a->context,sizeof(long)*plSize); - ret=grib_get_long_array_internal(grib_handle_of_accessor(a),self->pl,pl,&plSize); - if (ret) return ret; + if (grib_get_size(grib_handle_of_accessor(a), self->pl, &plSize) == GRIB_SUCCESS) { + Assert(plSize == numberOfRows); + pl = (long*)grib_context_malloc_clear(a->context, sizeof(long) * plSize); + ret = grib_get_long_array_internal(grib_handle_of_accessor(a), self->pl, pl, &plSize); + if (ret) + return ret; - for (j=0;jcontext,pl); - - } else { - - for (j=0;jcontext, pl); + } + else { + for (j = 0; j < numberOfRows; j++) { + if (j % 2) { + pvalues += numberOfColumns; + for (i = 0; i < numberOfColumns; i++) + *(--pvalues) = *(pval++); + pvalues += numberOfColumns; + } + else { + for (i = 0; i < numberOfColumns; i++) + *(pvalues++) = *(pval++); } } - } - ret=grib_set_double_array_internal(grib_handle_of_accessor(a),self->values,values,valuesSize); - if (ret) return ret; + ret = grib_set_double_array_internal(grib_handle_of_accessor(a), self->values, values, valuesSize); + if (ret) + return ret; - grib_context_free(a->context,values); + grib_context_free(a->context, values); return ret; } diff --git a/src/grib_accessor_class_data_apply_boustrophedonic_bitmap.c b/src/grib_accessor_class_data_apply_boustrophedonic_bitmap.c index aaf0c270f..d35a17dd6 100644 --- a/src/grib_accessor_class_data_apply_boustrophedonic_bitmap.c +++ b/src/grib_accessor_class_data_apply_boustrophedonic_bitmap.c @@ -42,71 +42,72 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int value_count(grib_accessor*,long*); +static int get_native_type(grib_accessor*); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int value_count(grib_accessor*, long*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -static int unpack_double_element(grib_accessor*,size_t i, double* val); - -typedef struct grib_accessor_data_apply_boustrophedonic_bitmap { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in data_apply_boustrophedonic_bitmap */ - const char* coded_values; - const char* bitmap; - const char* missing_value; - const char* binary_scale_factor; - const char* numberOfRows; - const char* numberOfColumns; - const char* numberOfPoints; +static int unpack_double_element(grib_accessor*, size_t i, double* val); + +typedef struct grib_accessor_data_apply_boustrophedonic_bitmap +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in data_apply_boustrophedonic_bitmap */ + const char* coded_values; + const char* bitmap; + const char* missing_value; + const char* binary_scale_factor; + const char* numberOfRows; + const char* numberOfColumns; + const char* numberOfPoints; } grib_accessor_data_apply_boustrophedonic_bitmap; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_data_apply_boustrophedonic_bitmap = { - &grib_accessor_class_gen, /* super */ - "data_apply_boustrophedonic_bitmap", /* name */ - sizeof(grib_accessor_data_apply_boustrophedonic_bitmap), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - &unpack_double_element, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "data_apply_boustrophedonic_bitmap", /* name */ + sizeof(grib_accessor_data_apply_boustrophedonic_bitmap), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + &unpack_double_element, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -115,322 +116,327 @@ grib_accessor_class* grib_accessor_class_data_apply_boustrophedonic_bitmap = &_g static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long v, grib_arguments* args) +static void init(grib_accessor* a, const long v, grib_arguments* args) { - int n=0; - grib_accessor_data_apply_boustrophedonic_bitmap *self =(grib_accessor_data_apply_boustrophedonic_bitmap*)a; - grib_handle* gh = grib_handle_of_accessor(a); + int n = 0; + grib_accessor_data_apply_boustrophedonic_bitmap* self = (grib_accessor_data_apply_boustrophedonic_bitmap*)a; + grib_handle* gh = grib_handle_of_accessor(a); - self->coded_values = grib_arguments_get_name(gh,args,n++); - self->bitmap = grib_arguments_get_name(gh,args,n++); - self->missing_value = grib_arguments_get_name(gh,args,n++); - self->binary_scale_factor = grib_arguments_get_name(gh,args,n++); + self->coded_values = grib_arguments_get_name(gh, args, n++); + self->bitmap = grib_arguments_get_name(gh, args, n++); + self->missing_value = grib_arguments_get_name(gh, args, n++); + self->binary_scale_factor = grib_arguments_get_name(gh, args, n++); - self->numberOfRows = grib_arguments_get_name(gh,args,n++); - self->numberOfColumns = grib_arguments_get_name(gh,args,n++); - self->numberOfPoints = grib_arguments_get_name(gh,args,n++); + self->numberOfRows = grib_arguments_get_name(gh, args, n++); + self->numberOfColumns = grib_arguments_get_name(gh, args, n++); + self->numberOfPoints = grib_arguments_get_name(gh, args, n++); a->length = 0; } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_values(dumper,a); + grib_dump_values(dumper, a); } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - grib_accessor_data_apply_boustrophedonic_bitmap *self =(grib_accessor_data_apply_boustrophedonic_bitmap*)a; - grib_handle* gh = grib_handle_of_accessor(a); - size_t len = 0; - int ret = 0; + grib_accessor_data_apply_boustrophedonic_bitmap* self = (grib_accessor_data_apply_boustrophedonic_bitmap*)a; + grib_handle* gh = grib_handle_of_accessor(a); + size_t len = 0; + int ret = 0; /* This accessor is for data with a bitmap after all */ Assert(grib_find_accessor(gh, self->bitmap)); - ret = grib_get_size(gh, self->bitmap, &len); - *count=len; + ret = grib_get_size(gh, self->bitmap, &len); + *count = len; return ret; } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - grib_accessor_data_apply_boustrophedonic_bitmap* self = (grib_accessor_data_apply_boustrophedonic_bitmap*)a; - grib_handle* gh = grib_handle_of_accessor(a); + grib_accessor_data_apply_boustrophedonic_bitmap* self = (grib_accessor_data_apply_boustrophedonic_bitmap*)a; + grib_handle* gh = grib_handle_of_accessor(a); size_t i = 0, j = 0, n_vals = 0, irow = 0; - long nn=0; - int err=0; - size_t coded_n_vals = 0; - double* coded_vals = NULL; + long nn = 0; + int err = 0; + size_t coded_n_vals = 0; + double* coded_vals = NULL; double missing_value = 0; long numberOfPoints, numberOfRows, numberOfColumns; - err=grib_value_count(a,&nn); - n_vals=nn; - if (err) return err; + err = grib_value_count(a, &nn); + n_vals = nn; + if (err) + return err; - err=grib_get_long_internal(gh,self->numberOfRows,&numberOfRows); - if (err) return err; - err=grib_get_long_internal(gh,self->numberOfColumns,&numberOfColumns); - if (err) return err; - err=grib_get_long_internal(gh,self->numberOfPoints,&numberOfPoints); - if (err) return err; + err = grib_get_long_internal(gh, self->numberOfRows, &numberOfRows); + if (err) + return err; + err = grib_get_long_internal(gh, self->numberOfColumns, &numberOfColumns); + if (err) + return err; + err = grib_get_long_internal(gh, self->numberOfPoints, &numberOfPoints); + if (err) + return err; Assert(nn == numberOfPoints); - if(!grib_find_accessor(gh,self->bitmap)) - return grib_get_double_array_internal(gh,self->coded_values,val,len); + if (!grib_find_accessor(gh, self->bitmap)) + return grib_get_double_array_internal(gh, self->coded_values, val, len); - if((err = grib_get_size(gh,self->coded_values,&coded_n_vals)) != GRIB_SUCCESS) + if ((err = grib_get_size(gh, self->coded_values, &coded_n_vals)) != GRIB_SUCCESS) return err; - if((err = grib_get_double_internal(gh,self->missing_value,&missing_value)) - != GRIB_SUCCESS) return err; + if ((err = grib_get_double_internal(gh, self->missing_value, &missing_value)) != GRIB_SUCCESS) + return err; - if(*len < n_vals) { + if (*len < n_vals) { *len = n_vals; return GRIB_ARRAY_TOO_SMALL; } - if (coded_n_vals==0) { - for(i=0;i < n_vals;i++) + if (coded_n_vals == 0) { + for (i = 0; i < n_vals; i++) val[i] = missing_value; - *len=n_vals; + *len = n_vals; return GRIB_SUCCESS; } - if((err = grib_get_double_array_internal(gh,self->bitmap,val,&n_vals)) - != GRIB_SUCCESS) + if ((err = grib_get_double_array_internal(gh, self->bitmap, val, &n_vals)) != GRIB_SUCCESS) return err; - coded_vals = (double*)grib_context_malloc(a->context,coded_n_vals*sizeof(double)); - if(coded_vals == NULL) return GRIB_OUT_OF_MEMORY; + coded_vals = (double*)grib_context_malloc(a->context, coded_n_vals * sizeof(double)); + if (coded_vals == NULL) + return GRIB_OUT_OF_MEMORY; - if((err = grib_get_double_array_internal(gh,self->coded_values,coded_vals,&coded_n_vals)) - != GRIB_SUCCESS) - { - grib_context_free(a->context,coded_vals); + if ((err = grib_get_double_array_internal(gh, self->coded_values, coded_vals, &coded_n_vals)) != GRIB_SUCCESS) { + grib_context_free(a->context, coded_vals); return err; } grib_context_log(a->context, GRIB_LOG_DEBUG, - "grib_accessor_class_data_apply_boustrophedonic_bitmap: unpack_double : creating %s, %d values", - a->name, n_vals); + "grib_accessor_class_data_apply_boustrophedonic_bitmap: unpack_double : creating %s, %d values", + a->name, n_vals); /* Boustrophedonic ordering (See GRIB-472): * Values on even rank lines (the initial line scanned having rank 1) are swapped */ - for(irow=0; irowcoded_n_vals) - { - grib_context_free(a->context,coded_vals); + if (j > coded_n_vals) { + grib_context_free(a->context, coded_vals); grib_context_log(a->context, GRIB_LOG_ERROR, - "grib_accessor_class_data_apply_boustrophedonic_bitmap [%s]:" - " unpack_double : number of coded values does not match bitmap %ld %ld", - a->name,coded_n_vals,n_vals); + "grib_accessor_class_data_apply_boustrophedonic_bitmap [%s]:" + " unpack_double : number of coded values does not match bitmap %ld %ld", + a->name, coded_n_vals, n_vals); return GRIB_ARRAY_TOO_SMALL; } } } - *len = n_vals; + *len = n_vals; - grib_context_free(a->context,coded_vals); + grib_context_free(a->context, coded_vals); return err; } -static int unpack_double_element(grib_accessor* a, size_t idx,double* val) +static int unpack_double_element(grib_accessor* a, size_t idx, double* val) { - grib_accessor_data_apply_boustrophedonic_bitmap* self = (grib_accessor_data_apply_boustrophedonic_bitmap*)a; - grib_handle* gh = grib_handle_of_accessor(a); - int err = 0,i=0; - size_t cidx=0; + grib_accessor_data_apply_boustrophedonic_bitmap* self = (grib_accessor_data_apply_boustrophedonic_bitmap*)a; + grib_handle* gh = grib_handle_of_accessor(a); + int err = 0, i = 0; + size_t cidx = 0; double missing_value = 0; - double* bvals=NULL; - size_t n_vals = 0; - long nn=0; + double* bvals = NULL; + size_t n_vals = 0; + long nn = 0; - err=grib_value_count(a,&nn); - n_vals=nn; - if (err) return err; + err = grib_value_count(a, &nn); + n_vals = nn; + if (err) + return err; - if(!grib_find_accessor(gh,self->bitmap)) - return grib_get_double_element_internal(gh,self->coded_values,idx,val); + if (!grib_find_accessor(gh, self->bitmap)) + return grib_get_double_element_internal(gh, self->coded_values, idx, val); - if((err = grib_get_double_internal(gh,self->missing_value,&missing_value)) != GRIB_SUCCESS) + if ((err = grib_get_double_internal(gh, self->missing_value, &missing_value)) != GRIB_SUCCESS) return err; - if((err = grib_get_double_element_internal(gh,self->bitmap,idx,val)) != GRIB_SUCCESS) + if ((err = grib_get_double_element_internal(gh, self->bitmap, idx, val)) != GRIB_SUCCESS) return err; - if (*val == 0) {*val=missing_value;return GRIB_SUCCESS;} + if (*val == 0) { + *val = missing_value; + return GRIB_SUCCESS; + } - bvals = (double*)grib_context_malloc(a->context,n_vals*sizeof(double)); - if(bvals == NULL) return GRIB_OUT_OF_MEMORY; + bvals = (double*)grib_context_malloc(a->context, n_vals * sizeof(double)); + if (bvals == NULL) + return GRIB_OUT_OF_MEMORY; - if((err = grib_get_double_array_internal(gh,self->bitmap,bvals,&n_vals)) != GRIB_SUCCESS) + if ((err = grib_get_double_array_internal(gh, self->bitmap, bvals, &n_vals)) != GRIB_SUCCESS) return err; - cidx=0; - for (i=0;icontext,bvals); + grib_context_free(a->context, bvals); - return grib_get_double_element_internal(gh,self->coded_values,cidx,val); + return grib_get_double_element_internal(gh, self->coded_values, cidx, val); } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { - grib_accessor_data_apply_boustrophedonic_bitmap* self = (grib_accessor_data_apply_boustrophedonic_bitmap*)a; - grib_handle* gh = grib_handle_of_accessor(a); - int err = 0; - size_t bmaplen = *len; - size_t irow = 0; - long coded_n_vals = 0; - double* coded_vals = NULL; - double *values=0; - long i = 0; - long j = 0; + grib_accessor_data_apply_boustrophedonic_bitmap* self = (grib_accessor_data_apply_boustrophedonic_bitmap*)a; + grib_handle* gh = grib_handle_of_accessor(a); + int err = 0; + size_t bmaplen = *len; + size_t irow = 0; + long coded_n_vals = 0; + double* coded_vals = NULL; + double* values = 0; + long i = 0; + long j = 0; long numberOfPoints, numberOfRows, numberOfColumns; double missing_value = 0; - if (*len ==0) return GRIB_NO_VALUES; + if (*len == 0) + return GRIB_NO_VALUES; - if(!grib_find_accessor(gh,self->bitmap)){ - err = grib_set_double_array_internal(gh,self->coded_values,val,*len); + if (!grib_find_accessor(gh, self->bitmap)) { + err = grib_set_double_array_internal(gh, self->coded_values, val, *len); /*printf("SETTING TOTAL number_of_data_points %s %ld\n",self->number_of_data_points,*len);*/ /*if(self->number_of_data_points) grib_set_long_internal(gh,self->number_of_data_points,*len);*/ return err; } - if((err = grib_get_double_internal(gh,self->missing_value,&missing_value)) != GRIB_SUCCESS) + if ((err = grib_get_double_internal(gh, self->missing_value, &missing_value)) != GRIB_SUCCESS) return err; - err=grib_get_long_internal(gh,self->numberOfRows, &numberOfRows); - if (err) return err; - err=grib_get_long_internal(gh,self->numberOfColumns, &numberOfColumns); - if (err) return err; - err=grib_get_long_internal(gh,self->numberOfPoints,&numberOfPoints); - if (err) return err; + err = grib_get_long_internal(gh, self->numberOfRows, &numberOfRows); + if (err) + return err; + err = grib_get_long_internal(gh, self->numberOfColumns, &numberOfColumns); + if (err) + return err; + err = grib_get_long_internal(gh, self->numberOfPoints, &numberOfPoints); + if (err) + return err; Assert(numberOfPoints == bmaplen); /* Create a copy of the incoming 'val' array because we're going to change it */ - values = (double*)grib_context_malloc_clear(a->context, sizeof(double)*numberOfPoints); - if (!values) return GRIB_OUT_OF_MEMORY; - for(i=0; icontext, sizeof(double) * numberOfPoints); + if (!values) + return GRIB_OUT_OF_MEMORY; + for (i = 0; i < numberOfPoints; ++i) { values[i] = val[i]; } /* Boustrophedonic ordering must be applied to the bitmap (See GRIB-472) */ - for(irow=0; irowbitmap,values,bmaplen)) != GRIB_SUCCESS) + if ((err = grib_set_double_array_internal(gh, self->bitmap, values, bmaplen)) != GRIB_SUCCESS) return err; - grib_context_free(a->context,values); + grib_context_free(a->context, values); coded_n_vals = *len; - if(coded_n_vals < 1){ - err = grib_set_double_array_internal(gh,self->coded_values,NULL,0); + if (coded_n_vals < 1) { + err = grib_set_double_array_internal(gh, self->coded_values, NULL, 0); return err; } - coded_vals = (double*)grib_context_malloc_clear(a->context,coded_n_vals*sizeof(double)); - if(!coded_vals) return GRIB_OUT_OF_MEMORY; + coded_vals = (double*)grib_context_malloc_clear(a->context, coded_n_vals * sizeof(double)); + if (!coded_vals) + return GRIB_OUT_OF_MEMORY; - for(i=0; i<*len ; i++) - { + for (i = 0; i < *len; i++) { /* To set the coded values, look at 'val' (the original array) */ /* NOT 'values' (bitmap) which we swapped about */ - if(val[i] != missing_value) { + if (val[i] != missing_value) { coded_vals[j++] = val[i]; } } - err = grib_set_double_array_internal(gh,self->coded_values,coded_vals,j); - if (j==0) { + err = grib_set_double_array_internal(gh, self->coded_values, coded_vals, j); + if (j == 0) { /*if (self->number_of_values) err=grib_set_long_internal(gh,self->number_of_values,0);*/ if (self->binary_scale_factor) - err=grib_set_long_internal(gh,self->binary_scale_factor,0); + err = grib_set_long_internal(gh, self->binary_scale_factor, 0); } - grib_context_free(a->context,coded_vals); + grib_context_free(a->context, coded_vals); return err; } diff --git a/src/grib_accessor_class_data_apply_gdsnotpresent.c b/src/grib_accessor_class_data_apply_gdsnotpresent.c index b398fafca..06628f6e2 100644 --- a/src/grib_accessor_class_data_apply_gdsnotpresent.c +++ b/src/grib_accessor_class_data_apply_gdsnotpresent.c @@ -47,71 +47,72 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int value_count(grib_accessor*,long*); +static int get_native_type(grib_accessor*); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int value_count(grib_accessor*, long*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_data_apply_gdsnotpresent { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in data_apply_gdsnotpresent */ - const char* coded_values; - const char* number_of_values; - const char* number_of_points; - const char* latitude_of_first_point; - const char* ni; - const char* missing_value; - const char* bitmap_present; - const char* bitmap; +typedef struct grib_accessor_data_apply_gdsnotpresent +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in data_apply_gdsnotpresent */ + const char* coded_values; + const char* number_of_values; + const char* number_of_points; + const char* latitude_of_first_point; + const char* ni; + const char* missing_value; + const char* bitmap_present; + const char* bitmap; } grib_accessor_data_apply_gdsnotpresent; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_data_apply_gdsnotpresent = { - &grib_accessor_class_gen, /* super */ - "data_apply_gdsnotpresent", /* name */ - sizeof(grib_accessor_data_apply_gdsnotpresent), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "data_apply_gdsnotpresent", /* name */ + sizeof(grib_accessor_data_apply_gdsnotpresent), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -120,166 +121,169 @@ grib_accessor_class* grib_accessor_class_data_apply_gdsnotpresent = &_grib_acces static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long v, grib_arguments* args) +static void init(grib_accessor* a, const long v, grib_arguments* args) { - int n=0; - grib_accessor_data_apply_gdsnotpresent *self =(grib_accessor_data_apply_gdsnotpresent*)a; - - self->coded_values = grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->number_of_values = grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->number_of_points = grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->latitude_of_first_point = grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->ni = grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->missing_value = grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->bitmap_present = grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->bitmap = grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); + int n = 0; + grib_accessor_data_apply_gdsnotpresent* self = (grib_accessor_data_apply_gdsnotpresent*)a; + + self->coded_values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->number_of_values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->number_of_points = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->latitude_of_first_point = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->ni = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->missing_value = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->bitmap_present = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->bitmap = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); a->length = 0; } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_values(dumper,a); + grib_dump_values(dumper, a); } -static int value_count(grib_accessor* a,long* number_of_points) +static int value_count(grib_accessor* a, long* number_of_points) { - int ret=0; + int ret = 0; - grib_accessor_data_apply_gdsnotpresent *self =(grib_accessor_data_apply_gdsnotpresent*)a; + grib_accessor_data_apply_gdsnotpresent* self = (grib_accessor_data_apply_gdsnotpresent*)a; - *number_of_points=0; - if((ret = grib_get_long(grib_handle_of_accessor(a),self->number_of_points,number_of_points)) - != GRIB_SUCCESS) { + *number_of_points = 0; + if ((ret = grib_get_long(grib_handle_of_accessor(a), self->number_of_points, number_of_points)) != GRIB_SUCCESS) { grib_context_log(a->context, GRIB_LOG_ERROR, - "grib_accessor_data_apply_gdsnotpresent: value_count: unable to get number of points"); + "grib_accessor_data_apply_gdsnotpresent: value_count: unable to get number of points"); } return ret; } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - grib_accessor_data_apply_gdsnotpresent* self = (grib_accessor_data_apply_gdsnotpresent*)a; - - long number_of_points=0,number_of_values=0,ni=0; - long latitude_of_first_point=0; - size_t i = 0; - size_t n_vals = 0; - long nn=0; - int err=0; - size_t size=0; + grib_accessor_data_apply_gdsnotpresent* self = (grib_accessor_data_apply_gdsnotpresent*)a; + + long number_of_points = 0, number_of_values = 0, ni = 0; + long latitude_of_first_point = 0; + size_t i = 0; + size_t n_vals = 0; + long nn = 0; + int err = 0; + size_t size = 0; long missing_value; double* coded_vals = NULL; - err=grib_value_count(a,&nn); - n_vals=nn; - if (err) return err; + err = grib_value_count(a, &nn); + n_vals = nn; + if (err) + return err; - if((err = grib_get_long(grib_handle_of_accessor(a),self->number_of_points,&number_of_points)) - != GRIB_SUCCESS) return err; + if ((err = grib_get_long(grib_handle_of_accessor(a), self->number_of_points, &number_of_points)) != GRIB_SUCCESS) + return err; - if((err = grib_get_long(grib_handle_of_accessor(a),self->number_of_values,&number_of_values)) - != GRIB_SUCCESS) return err; + if ((err = grib_get_long(grib_handle_of_accessor(a), self->number_of_values, &number_of_values)) != GRIB_SUCCESS) + return err; - if((err = grib_get_long(grib_handle_of_accessor(a),self->latitude_of_first_point,&latitude_of_first_point)) - != GRIB_SUCCESS) return err; + if ((err = grib_get_long(grib_handle_of_accessor(a), self->latitude_of_first_point, &latitude_of_first_point)) != GRIB_SUCCESS) + return err; - if((err = grib_get_long(grib_handle_of_accessor(a),self->missing_value,&missing_value)) - != GRIB_SUCCESS) return err; + if ((err = grib_get_long(grib_handle_of_accessor(a), self->missing_value, &missing_value)) != GRIB_SUCCESS) + return err; - if((err = grib_get_long(grib_handle_of_accessor(a),self->ni,&ni)) - != GRIB_SUCCESS) return err; + if ((err = grib_get_long(grib_handle_of_accessor(a), self->ni, &ni)) != GRIB_SUCCESS) + return err; - if(*len < number_of_points) - { + if (*len < number_of_points) { *len = n_vals; return GRIB_ARRAY_TOO_SMALL; } - if(number_of_values > 0){ - coded_vals = (double*)grib_context_malloc(a->context,number_of_values*sizeof(double)); + if (number_of_values > 0) { + coded_vals = (double*)grib_context_malloc(a->context, number_of_values * sizeof(double)); - if(coded_vals == NULL) + if (coded_vals == NULL) return GRIB_OUT_OF_MEMORY; } - size=number_of_values; - if((err=grib_get_double_array_internal(grib_handle_of_accessor(a),self->coded_values,coded_vals,&size)) - != GRIB_SUCCESS) { - grib_context_free(a->context,coded_vals); + size = number_of_values; + if ((err = grib_get_double_array_internal(grib_handle_of_accessor(a), self->coded_values, coded_vals, &size)) != GRIB_SUCCESS) { + grib_context_free(a->context, coded_vals); return err; } - if (number_of_values!=size) { + if (number_of_values != size) { grib_context_log(a->context, GRIB_LOG_ERROR, - "grib_accessor_data_apply_gdsnotpresent : wrong numberOfValues %ld != %ld", - number_of_values,size); + "grib_accessor_data_apply_gdsnotpresent : wrong numberOfValues %ld != %ld", + number_of_values, size); } grib_context_log(a->context, GRIB_LOG_DEBUG, - "grib_accessor_data_apply_gdsnotpresent : unpack_double : creating %s, %d values", - a->name, number_of_points); + "grib_accessor_data_apply_gdsnotpresent : unpack_double : creating %s, %d values", + a->name, number_of_points); if (latitude_of_first_point == 0) { - for (i=0;i < number_of_values;i++) val[i]=coded_vals[i]; - for (i=number_of_values;icontext,coded_vals); + grib_context_free(a->context, coded_vals); return err; } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { - int ret=GRIB_SUCCESS; - long bitmap_present=0; + int ret = GRIB_SUCCESS; + long bitmap_present = 0; - grib_accessor_data_apply_gdsnotpresent* self = (grib_accessor_data_apply_gdsnotpresent*)a; + grib_accessor_data_apply_gdsnotpresent* self = (grib_accessor_data_apply_gdsnotpresent*)a; - if (*len ==0) return GRIB_NO_VALUES; + if (*len == 0) + return GRIB_NO_VALUES; - ret=grib_set_long(grib_handle_of_accessor(a),self->bitmap_present,bitmap_present); - if(ret) { + ret = grib_set_long(grib_handle_of_accessor(a), self->bitmap_present, bitmap_present); + if (ret) { grib_context_log(a->context, GRIB_LOG_ERROR, - "Accessor %s cannont pack value for %s error %d \n", a->name, self->bitmap_present, ret); + "Accessor %s cannont pack value for %s error %d \n", a->name, self->bitmap_present, ret); return ret; } @@ -291,10 +295,10 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) } #endif - ret = grib_set_double_array_internal(grib_handle_of_accessor(a),self->coded_values,val,*len); - if(ret) { + ret = grib_set_double_array_internal(grib_handle_of_accessor(a), self->coded_values, val, *len); + if (ret) { grib_context_log(a->context, GRIB_LOG_ERROR, - "Accessor %s cannont pack value for %s error %d \n", a->name, self->coded_values, ret); + "Accessor %s cannont pack value for %s error %d \n", a->name, self->coded_values, ret); return ret; } diff --git a/src/grib_accessor_class_data_ccsds_packing.c b/src/grib_accessor_class_data_ccsds_packing.c index dcaa5a4ba..7263e0867 100644 --- a/src/grib_accessor_class_data_ccsds_packing.c +++ b/src/grib_accessor_class_data_ccsds_packing.c @@ -47,77 +47,78 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -static int unpack_double_element(grib_accessor*,size_t i, double* val); - -typedef struct grib_accessor_data_ccsds_packing { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in values */ - int carg; - const char* seclen; - const char* offsetdata; - const char* offsetsection; - int dirty; -/* Members defined in data_ccsds_packing */ - const char* number_of_values; - const char* reference_value; - const char* binary_scale_factor; - const char* decimal_scale_factor; - const char* bits_per_value; - const char* number_of_data_points; - const char* ccsds_flags; - const char* ccsds_block_size; - const char* ccsds_rsi; +static int unpack_double_element(grib_accessor*, size_t i, double* val); + +typedef struct grib_accessor_data_ccsds_packing +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in values */ + int carg; + const char* seclen; + const char* offsetdata; + const char* offsetsection; + int dirty; + /* Members defined in data_ccsds_packing */ + const char* number_of_values; + const char* reference_value; + const char* binary_scale_factor; + const char* decimal_scale_factor; + const char* bits_per_value; + const char* number_of_data_points; + const char* ccsds_flags; + const char* ccsds_block_size; + const char* ccsds_rsi; } grib_accessor_data_ccsds_packing; extern grib_accessor_class* grib_accessor_class_values; static grib_accessor_class _grib_accessor_class_data_ccsds_packing = { - &grib_accessor_class_values, /* super */ - "data_ccsds_packing", /* name */ - sizeof(grib_accessor_data_ccsds_packing), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - &unpack_double_element, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_values, /* super */ + "data_ccsds_packing", /* name */ + sizeof(grib_accessor_data_ccsds_packing), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + &unpack_double_element, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -126,131 +127,130 @@ grib_accessor_class* grib_accessor_class_data_ccsds_packing = &_grib_accessor_cl static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long v, grib_arguments* args) +static void init(grib_accessor* a, const long v, grib_arguments* args) { - grib_accessor_data_ccsds_packing *self =(grib_accessor_data_ccsds_packing*)a; + grib_accessor_data_ccsds_packing* self = (grib_accessor_data_ccsds_packing*)a; - self->number_of_values = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->reference_value = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->binary_scale_factor = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->decimal_scale_factor = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->bits_per_value = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); + self->number_of_values = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->reference_value = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->binary_scale_factor = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->decimal_scale_factor = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->bits_per_value = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); - self->number_of_data_points = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); + self->number_of_data_points = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); - self->ccsds_flags = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->ccsds_block_size = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->ccsds_rsi = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); + self->ccsds_flags = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->ccsds_block_size = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->ccsds_rsi = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); a->flags |= GRIB_ACCESSOR_FLAG_DATA; } static int value_count(grib_accessor* a, long* count) { - grib_accessor_data_ccsds_packing *self =(grib_accessor_data_ccsds_packing*)a; - *count = 0; - return grib_get_long_internal(grib_handle_of_accessor(a),self->number_of_values,count); + grib_accessor_data_ccsds_packing* self = (grib_accessor_data_ccsds_packing*)a; + *count = 0; + return grib_get_long_internal(grib_handle_of_accessor(a), self->number_of_values, count); } -#if defined (HAVE_LIBAEC) || defined(HAVE_AEC) +#if defined(HAVE_LIBAEC) || defined(HAVE_AEC) #include -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - grib_accessor_data_ccsds_packing *self =(grib_accessor_data_ccsds_packing*)a; + grib_accessor_data_ccsds_packing* self = (grib_accessor_data_ccsds_packing*)a; int err = GRIB_SUCCESS; int i; size_t buflen = grib_byte_count(a); struct aec_stream strm; - double bscale = 0; - double dscale = 0; + double bscale = 0; + double dscale = 0; unsigned char* buf = NULL; - size_t n_vals = 0; + size_t n_vals = 0; size_t size; unsigned char* decoded = NULL; - unsigned char *p = NULL; - long pos = 0; - long nn=0; + unsigned char* p = NULL; + long pos = 0; + long nn = 0; - long binary_scale_factor = 0; + long binary_scale_factor = 0; long decimal_scale_factor = 0; - double reference_value = 0; - long bits_per_value =0; + double reference_value = 0; + long bits_per_value = 0; long bits8; long ccsds_flags; long ccsds_block_size; long ccsds_rsi; - self->dirty=0; + self->dirty = 0; - if((err = grib_value_count(a, &nn)) != GRIB_SUCCESS) + if ((err = grib_value_count(a, &nn)) != GRIB_SUCCESS) return err; - n_vals=nn; + n_vals = nn; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->bits_per_value,&bits_per_value)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) return err; - if((err = grib_get_double_internal(grib_handle_of_accessor(a),self->reference_value, &reference_value)) != GRIB_SUCCESS) + if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->reference_value, &reference_value)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) return err; /* ECC-477: Don't call grib_get_long_internal to suppress error message being output */ - if((err = grib_get_long(grib_handle_of_accessor(a),self->ccsds_flags,&ccsds_flags)) != GRIB_SUCCESS) + if ((err = grib_get_long(grib_handle_of_accessor(a), self->ccsds_flags, &ccsds_flags)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->ccsds_block_size, &ccsds_block_size)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->ccsds_block_size, &ccsds_block_size)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->ccsds_rsi, &ccsds_rsi)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->ccsds_rsi, &ccsds_rsi)) != GRIB_SUCCESS) return err; - bscale = grib_power(binary_scale_factor,2); - dscale = grib_power(-decimal_scale_factor,10); + bscale = grib_power(binary_scale_factor, 2); + dscale = grib_power(-decimal_scale_factor, 10); /* TODO: This should be called upstream */ - if(*len < n_vals) + if (*len < n_vals) return GRIB_ARRAY_TOO_SMALL; /* Special case */ - if(bits_per_value == 0) - { - for(i = 0; i < n_vals; i++) + if (bits_per_value == 0) { + for (i = 0; i < n_vals; i++) val[i] = reference_value; *len = n_vals; return GRIB_SUCCESS; @@ -259,33 +259,32 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len) buf = (unsigned char*)grib_handle_of_accessor(a)->buffer->data; buf += grib_byte_offset(a); - strm.flags = ccsds_flags; + strm.flags = ccsds_flags; strm.bits_per_sample = bits_per_value; - strm.block_size = ccsds_block_size; - strm.rsi = ccsds_rsi; + strm.block_size = ccsds_block_size; + strm.rsi = ccsds_rsi; - strm.next_in = buf; + strm.next_in = buf; strm.avail_in = buflen; -/* + /* printf("aec_options.options_mask %d\n", aec_options.options_mask); printf("aec_options.bits_per_pixel %d\n", aec_options.bits_per_pixel); printf("aec_options.pixels_per_block %d\n", aec_options.pixels_per_block); printf("aec_options.pixels_per_scanline %d\n", aec_options.pixels_per_scanline); */ - bits8 = ((bits_per_value + 7)/8)*8; - size = n_vals * ((bits_per_value + 7)/8); - decoded = grib_context_buffer_malloc_clear(a->context,size); - if(!decoded) { + bits8 = ((bits_per_value + 7) / 8) * 8; + size = n_vals * ((bits_per_value + 7) / 8); + decoded = grib_context_buffer_malloc_clear(a->context, size); + if (!decoded) { err = GRIB_OUT_OF_MEMORY; goto cleanup; } - strm.next_out = decoded; + strm.next_out = decoded; strm.avail_out = size; - if((err = aec_buffer_decode(&strm)) != AEC_OK) - { + if ((err = aec_buffer_decode(&strm)) != AEC_OK) { fprintf(stderr, "aec_buffer_decode Error %d\n", err); err = GRIB_ENCODING_ERROR; goto cleanup; @@ -293,42 +292,41 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len) /* printf("bscale=%g dscale=%g reference_value=%g\n",bscale,dscale,reference_value); */ pos = 0; - p = decoded; - for(i = 0; i < n_vals; i++) - { - val[i] = (double) (((grib_decode_unsigned_long(p, &pos, bits8)*bscale)+reference_value)*dscale); + p = decoded; + for (i = 0; i < n_vals; i++) { + val[i] = (double)(((grib_decode_unsigned_long(p, &pos, bits8) * bscale) + reference_value) * dscale); } /*-------------------------------------------*/ *len = n_vals; cleanup: - grib_context_buffer_free(a->context,decoded); + grib_context_buffer_free(a->context, decoded); return err; } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { - grib_accessor_data_ccsds_packing *self =(grib_accessor_data_ccsds_packing*)a; + grib_accessor_data_ccsds_packing* self = (grib_accessor_data_ccsds_packing*)a; int err = GRIB_SUCCESS; int i; size_t buflen = 0; - unsigned char* buf = NULL; + unsigned char* buf = NULL; unsigned char* encoded = NULL; - size_t n_vals = 0; - long nn=0; + size_t n_vals = 0; + long nn = 0; - long binary_scale_factor = 0; + long binary_scale_factor = 0; long decimal_scale_factor = 0; - double reference_value = 0; + double reference_value = 0; long bits8; - long bits_per_value =0; - double max,min; + long bits_per_value = 0; + double max, min; double d; - unsigned char *p; + unsigned char* p; double divisor; long number_of_data_points; @@ -339,106 +337,103 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) struct aec_stream strm; - self->dirty=1; + self->dirty = 1; - if((err = grib_value_count(a, &nn)) != GRIB_SUCCESS) + if ((err = grib_value_count(a, &nn)) != GRIB_SUCCESS) return err; - n_vals=nn; + n_vals = nn; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->bits_per_value,&bits_per_value)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) return err; - if((err = grib_get_double_internal(grib_handle_of_accessor(a),self->reference_value, &reference_value)) != GRIB_SUCCESS) + if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->reference_value, &reference_value)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->ccsds_flags,&ccsds_flags)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->ccsds_flags, &ccsds_flags)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->ccsds_block_size, &ccsds_block_size)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->ccsds_block_size, &ccsds_block_size)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->ccsds_rsi, &ccsds_rsi)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->ccsds_rsi, &ccsds_rsi)) != GRIB_SUCCESS) return err; /* Special case */ - if(*len == 0) { - grib_buffer_replace(a, NULL, 0,1,1); + if (*len == 0) { + grib_buffer_replace(a, NULL, 0, 1, 1); return GRIB_SUCCESS; } - if(bits_per_value == 0) - { + if (bits_per_value == 0) { int i; /* constant field */ - for(i = 1 ; i < n_vals; i++) + for (i = 1; i < n_vals; i++) Assert(val[i] == val[0]); - if((err = grib_set_double_internal(grib_handle_of_accessor(a),self->reference_value, val[0])) != GRIB_SUCCESS) + if ((err = grib_set_double_internal(grib_handle_of_accessor(a), self->reference_value, val[0])) != GRIB_SUCCESS) return err; { /* Make sure we can decode it again */ double ref = 1e-100; - grib_get_double_internal(grib_handle_of_accessor(a),self->reference_value,&ref); + grib_get_double_internal(grib_handle_of_accessor(a), self->reference_value, &ref); /*printf("%g %g %g\n",reference_value,ref,reference_value-ref);*/ Assert(ref == reference_value); } - if((err = grib_set_long_internal(grib_handle_of_accessor(a),self->number_of_values, n_vals)) != GRIB_SUCCESS) + if ((err = grib_set_long_internal(grib_handle_of_accessor(a), self->number_of_values, n_vals)) != GRIB_SUCCESS) return err; - grib_buffer_replace(a, NULL, 0,1,1); + grib_buffer_replace(a, NULL, 0, 1, 1); return GRIB_SUCCESS; } - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->number_of_data_points,&number_of_data_points)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->number_of_data_points, &number_of_data_points)) != GRIB_SUCCESS) return err; - d = grib_power(decimal_scale_factor,10) ; + d = grib_power(decimal_scale_factor, 10); max = val[0]; min = max; - for(i=1;i< n_vals;i++) - { - if (val[i] > max) max = val[i]; - else if (val[i] < min) min = val[i]; + for (i = 1; i < n_vals; i++) { + if (val[i] > max) + max = val[i]; + else if (val[i] < min) + min = val[i]; } min *= d; max *= d; - if (grib_get_nearest_smaller_value(grib_handle_of_accessor(a),self->reference_value,min,&reference_value) - !=GRIB_SUCCESS) { - grib_context_log(a->context,GRIB_LOG_ERROR, - "unable to find nearest_smaller_value of %g for %s",min,self->reference_value); + if (grib_get_nearest_smaller_value(grib_handle_of_accessor(a), self->reference_value, min, &reference_value) != GRIB_SUCCESS) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "unable to find nearest_smaller_value of %g for %s", min, self->reference_value); return GRIB_INTERNAL_ERROR; } - if(reference_value > min) - { - fprintf(stderr,"reference_value=%g min_value=%g diff=%g\n",reference_value,min,reference_value-min); + if (reference_value > min) { + fprintf(stderr, "reference_value=%g min_value=%g diff=%g\n", reference_value, min, reference_value - min); Assert(reference_value <= min); } - binary_scale_factor = grib_get_binary_scale_fact(max,reference_value,bits_per_value,&err); - divisor = grib_power(-binary_scale_factor,2); + binary_scale_factor = grib_get_binary_scale_fact(max, reference_value, bits_per_value, &err); + divisor = grib_power(-binary_scale_factor, 2); - bits8 = (bits_per_value+7)/8*8; - encoded = grib_context_buffer_malloc_clear(a->context,bits8/8*n_vals); + bits8 = (bits_per_value + 7) / 8 * 8; + encoded = grib_context_buffer_malloc_clear(a->context, bits8 / 8 * n_vals); - if(!encoded) { + if (!encoded) { err = GRIB_OUT_OF_MEMORY; goto cleanup; } buflen = 0; - p = encoded; - for(i=0;i< n_vals;i++){ - long blen = bits8; - unsigned long unsigned_val = (unsigned long)((((val[i]*d)-(reference_value))*divisor)+0.5); - while(blen >= 8) - { - blen -= 8; + p = encoded; + for (i = 0; i < n_vals; i++) { + long blen = bits8; + unsigned long unsigned_val = (unsigned long)((((val[i] * d) - (reference_value)) * divisor) + 0.5); + while (blen >= 8) { + blen -= 8; *p = (unsigned_val >> blen); p++; buflen++; @@ -450,37 +445,37 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) "grib_accessor_data_ccsds_packing : pack_double : packing %s, %d values", a->name, n_vals); buflen += 10240; - buf = grib_context_buffer_malloc_clear(a->context,buflen); + buf = grib_context_buffer_malloc_clear(a->context, buflen); - if(!buf) { + if (!buf) { err = GRIB_OUT_OF_MEMORY; goto cleanup; } - if((err = grib_set_double_internal(grib_handle_of_accessor(a),self->reference_value, reference_value)) != GRIB_SUCCESS) + if ((err = grib_set_double_internal(grib_handle_of_accessor(a), self->reference_value, reference_value)) != GRIB_SUCCESS) return err; { /* Make sure we can decode it again */ double ref = 1e-100; - grib_get_double_internal(grib_handle_of_accessor(a),self->reference_value,&ref); + grib_get_double_internal(grib_handle_of_accessor(a), self->reference_value, &ref); Assert(ref == reference_value); } - if((err = grib_set_long_internal(grib_handle_of_accessor(a),self->binary_scale_factor, binary_scale_factor)) != GRIB_SUCCESS) + if ((err = grib_set_long_internal(grib_handle_of_accessor(a), self->binary_scale_factor, binary_scale_factor)) != GRIB_SUCCESS) return err; - if((err = grib_set_long_internal(grib_handle_of_accessor(a),self->decimal_scale_factor, decimal_scale_factor)) != GRIB_SUCCESS) + if ((err = grib_set_long_internal(grib_handle_of_accessor(a), self->decimal_scale_factor, decimal_scale_factor)) != GRIB_SUCCESS) return err; - strm.flags = ccsds_flags; + strm.flags = ccsds_flags; strm.bits_per_sample = bits_per_value; - strm.block_size = ccsds_block_size; - strm.rsi = ccsds_rsi; + strm.block_size = ccsds_block_size; + strm.rsi = ccsds_rsi; - strm.next_out = buf; + strm.next_out = buf; strm.avail_out = buflen; - strm.next_in = encoded; - strm.avail_in = bits8/8*n_vals; + strm.next_in = encoded; + strm.avail_in = bits8 / 8 * n_vals; /* This does not support spherical harmonics, and treats 24 differently than: @@ -494,9 +489,8 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) printf("aec_options.pixels_per_scanline %d\n", aec_options.pixels_per_scanline); */ - if((err = aec_buffer_encode(&strm)) != AEC_OK) - { - fprintf(stderr,"aec_buffer_encode Error %d\n", err); + if ((err = aec_buffer_encode(&strm)) != AEC_OK) { + fprintf(stderr, "aec_buffer_encode Error %d\n", err); err = GRIB_ENCODING_ERROR; goto cleanup; } @@ -506,17 +500,17 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) printf("in %ld out => %ld\n", (long)bits8/8*n_vals,(long) buflen); */ buflen = strm.total_out; - grib_buffer_replace(a, buf, buflen ,1,1); + grib_buffer_replace(a, buf, buflen, 1, 1); cleanup: - grib_context_buffer_free(a->context,buf); - grib_context_buffer_free(a->context,encoded); + grib_context_buffer_free(a->context, buf); + grib_context_buffer_free(a->context, encoded); - if(err == GRIB_SUCCESS) - err = grib_set_long_internal(grib_handle_of_accessor(a),self->number_of_values, *len); + if (err == GRIB_SUCCESS) + err = grib_set_long_internal(grib_handle_of_accessor(a), self->number_of_values, *len); - if(err == GRIB_SUCCESS) - err = grib_set_long_internal(grib_handle_of_accessor(a),self->bits_per_value, strm.bits_per_sample); + if (err == GRIB_SUCCESS) + err = grib_set_long_internal(grib_handle_of_accessor(a), self->bits_per_value, strm.bits_per_sample); return err; } @@ -524,17 +518,20 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) static int unpack_double_element(grib_accessor* a, size_t idx, double* val) { /* The index idx relates to codedValues NOT values! */ - size_t size = 0; + size_t size = 0; double* values = NULL; - int err=grib_get_size(grib_handle_of_accessor(a),"codedValues",&size); - if (err) return err; - if (idx > size) return GRIB_INVALID_NEAREST; - - values=(double*)grib_context_malloc_clear(a->context,size*sizeof(double)); - err=grib_get_double_array(grib_handle_of_accessor(a),"codedValues",values,&size); - if (err) return err; - *val=values[idx]; - grib_context_free(a->context,values); + int err = grib_get_size(grib_handle_of_accessor(a), "codedValues", &size); + if (err) + return err; + if (idx > size) + return GRIB_INVALID_NEAREST; + + values = (double*)grib_context_malloc_clear(a->context, size * sizeof(double)); + err = grib_get_double_array(grib_handle_of_accessor(a), "codedValues", values, &size); + if (err) + return err; + *val = values[idx]; + grib_context_free(a->context, values); return err; } @@ -543,15 +540,15 @@ static int unpack_double_element(grib_accessor* a, size_t idx, double* val) static void print_error_msg(grib_context* c) { grib_context_log(c, GRIB_LOG_ERROR, - "grib_accessor_data_ccsds_packing: CCSDS support not enabled. " - "Please rebuild with -DENABLE_AEC=ON (Adaptive Entropy Coding library)"); + "grib_accessor_data_ccsds_packing: CCSDS support not enabled. " + "Please rebuild with -DENABLE_AEC=ON (Adaptive Entropy Coding library)"); } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { print_error_msg(a->context); return GRIB_FUNCTIONALITY_NOT_ENABLED; } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { print_error_msg(a->context); return GRIB_FUNCTIONALITY_NOT_ENABLED; diff --git a/src/grib_accessor_class_data_complex_packing.c b/src/grib_accessor_class_data_complex_packing.c index 2339d558a..182adbe48 100644 --- a/src/grib_accessor_class_data_complex_packing.c +++ b/src/grib_accessor_class_data_complex_packing.c @@ -46,88 +46,89 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_data_complex_packing { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in values */ - int carg; - const char* seclen; - const char* offsetdata; - const char* offsetsection; - int dirty; -/* Members defined in data_simple_packing */ - int edition; - const char* units_factor; - const char* units_bias; - const char* changing_precision; - const char* number_of_values; - const char* bits_per_value; - const char* reference_value; - const char* binary_scale_factor; - const char* decimal_scale_factor; - const char* optimize_scaling_factor; -/* Members defined in data_complex_packing */ - const char* GRIBEX_sh_bug_present; - const char* ieee_floats; - const char* laplacianOperatorIsSet; - const char* laplacianOperator; - const char* sub_j; - const char* sub_k; - const char* sub_m; - const char* pen_j; - const char* pen_k; - const char* pen_m; +typedef struct grib_accessor_data_complex_packing +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in values */ + int carg; + const char* seclen; + const char* offsetdata; + const char* offsetsection; + int dirty; + /* Members defined in data_simple_packing */ + int edition; + const char* units_factor; + const char* units_bias; + const char* changing_precision; + const char* number_of_values; + const char* bits_per_value; + const char* reference_value; + const char* binary_scale_factor; + const char* decimal_scale_factor; + const char* optimize_scaling_factor; + /* Members defined in data_complex_packing */ + const char* GRIBEX_sh_bug_present; + const char* ieee_floats; + const char* laplacianOperatorIsSet; + const char* laplacianOperator; + const char* sub_j; + const char* sub_k; + const char* sub_m; + const char* pen_j; + const char* pen_k; + const char* pen_m; } grib_accessor_data_complex_packing; extern grib_accessor_class* grib_accessor_class_data_simple_packing; static grib_accessor_class _grib_accessor_class_data_complex_packing = { - &grib_accessor_class_data_simple_packing, /* super */ - "data_complex_packing", /* name */ - sizeof(grib_accessor_data_complex_packing), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_data_simple_packing, /* super */ + "data_complex_packing", /* name */ + sizeof(grib_accessor_data_complex_packing), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -136,245 +137,245 @@ grib_accessor_class* grib_accessor_class_data_complex_packing = &_grib_accessor_ static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ typedef unsigned long (*encode_float_proc)(double); -typedef double (*decode_float_proc)(unsigned long); +typedef double (*decode_float_proc)(unsigned long); -static void init(grib_accessor* a,const long v, grib_arguments* args) +static void init(grib_accessor* a, const long v, grib_arguments* args) { - grib_accessor_data_complex_packing *self =(grib_accessor_data_complex_packing*)a; - grib_handle* gh = grib_handle_of_accessor(a); - - self->GRIBEX_sh_bug_present = grib_arguments_get_name(gh,args,self->carg++); - self->ieee_floats = grib_arguments_get_name(gh,args,self->carg++); - self->laplacianOperatorIsSet = grib_arguments_get_name(gh,args,self->carg++); - self->laplacianOperator = grib_arguments_get_name(gh,args,self->carg++); - self->sub_j = grib_arguments_get_name(gh,args,self->carg++); - self->sub_k = grib_arguments_get_name(gh,args,self->carg++); - self->sub_m = grib_arguments_get_name(gh,args,self->carg++); - self->pen_j = grib_arguments_get_name(gh,args,self->carg++); - self->pen_k = grib_arguments_get_name(gh,args,self->carg++); - self->pen_m = grib_arguments_get_name(gh,args,self->carg++); + grib_accessor_data_complex_packing* self = (grib_accessor_data_complex_packing*)a; + grib_handle* gh = grib_handle_of_accessor(a); + + self->GRIBEX_sh_bug_present = grib_arguments_get_name(gh, args, self->carg++); + self->ieee_floats = grib_arguments_get_name(gh, args, self->carg++); + self->laplacianOperatorIsSet = grib_arguments_get_name(gh, args, self->carg++); + self->laplacianOperator = grib_arguments_get_name(gh, args, self->carg++); + self->sub_j = grib_arguments_get_name(gh, args, self->carg++); + self->sub_k = grib_arguments_get_name(gh, args, self->carg++); + self->sub_m = grib_arguments_get_name(gh, args, self->carg++); + self->pen_j = grib_arguments_get_name(gh, args, self->carg++); + self->pen_k = grib_arguments_get_name(gh, args, self->carg++); + self->pen_m = grib_arguments_get_name(gh, args, self->carg++); a->flags |= GRIB_ACCESSOR_FLAG_DATA; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - grib_accessor_data_complex_packing *self =(grib_accessor_data_complex_packing*)a; - int ret = 0; - grib_handle* gh = grib_handle_of_accessor(a); + grib_accessor_data_complex_packing* self = (grib_accessor_data_complex_packing*)a; + int ret = 0; + grib_handle* gh = grib_handle_of_accessor(a); - long pen_j= 0; - long pen_k= 0; - long pen_m= 0; + long pen_j = 0; + long pen_k = 0; + long pen_m = 0; - *count=0; + *count = 0; - if(a->length == 0) return 0; + if (a->length == 0) + return 0; - if((ret = grib_get_long_internal(gh,self->pen_j,&pen_j)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->pen_j, &pen_j)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(gh,self->pen_k,&pen_k)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->pen_k, &pen_k)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(gh,self->pen_m,&pen_m)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->pen_m, &pen_m)) != GRIB_SUCCESS) return ret; - if (pen_j != pen_k || pen_j!=pen_m ) { - grib_context_log(a->context,GRIB_LOG_ERROR,"pen_j=%ld, pen_k=%ld, pen_m=%ld\n",pen_j,pen_k,pen_m); - Assert ((pen_j == pen_k) && (pen_j == pen_m)); + if (pen_j != pen_k || pen_j != pen_m) { + grib_context_log(a->context, GRIB_LOG_ERROR, "pen_j=%ld, pen_k=%ld, pen_m=%ld\n", pen_j, pen_k, pen_m); + Assert((pen_j == pen_k) && (pen_j == pen_m)); } - *count=(pen_j+1)*(pen_j+2); + *count = (pen_j + 1) * (pen_j + 2); return ret; } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - grib_accessor_data_complex_packing* self = (grib_accessor_data_complex_packing*)a; - grib_handle* gh = grib_handle_of_accessor(a); - - size_t i = 0; - int ret = GRIB_SUCCESS; - long hcount = 0; - long lcount = 0; - long hpos = 0; - long lup = 0; - long mmax = 0; - long n_vals = 0; - double *scals = NULL; - double *pscals=NULL,*pval=NULL; - - double s = 0; - double d = 0; + grib_accessor_data_complex_packing* self = (grib_accessor_data_complex_packing*)a; + grib_handle* gh = grib_handle_of_accessor(a); + + size_t i = 0; + int ret = GRIB_SUCCESS; + long hcount = 0; + long lcount = 0; + long hpos = 0; + long lup = 0; + long mmax = 0; + long n_vals = 0; + double* scals = NULL; + double *pscals = NULL, *pval = NULL; + + double s = 0; + double d = 0; double laplacianOperator = 0; - unsigned char* buf = NULL; - unsigned char* hres = NULL; - unsigned char* lres = NULL; + unsigned char* buf = NULL; + unsigned char* hres = NULL; + unsigned char* lres = NULL; unsigned long packed_offset; - long lpos = 0; - - long maxv = 0; - long GRIBEX_sh_bug_present =0; - long ieee_floats = 0; - - long offsetdata = 0; - long bits_per_value = 0; - double reference_value = 0; - long binary_scale_factor = 0; - long decimal_scale_factor = 0; - - long sub_j= 0; - long sub_k= 0; - long sub_m= 0; - long pen_j= 0; - long pen_k= 0; - long pen_m= 0; - - double operat= 0; + long lpos = 0; + + long maxv = 0; + long GRIBEX_sh_bug_present = 0; + long ieee_floats = 0; + + long offsetdata = 0; + long bits_per_value = 0; + double reference_value = 0; + long binary_scale_factor = 0; + long decimal_scale_factor = 0; + + long sub_j = 0; + long sub_k = 0; + long sub_m = 0; + long pen_j = 0; + long pen_k = 0; + long pen_m = 0; + + double operat = 0; int bytes; - int err=0; + int err = 0; decode_float_proc decode_float = NULL; - err=grib_value_count(a,&n_vals); - if (err) return err; + err = grib_value_count(a, &n_vals); + if (err) + return err; - if(*len < n_vals){ + if (*len < n_vals) { *len = n_vals; return GRIB_ARRAY_TOO_SMALL; } - if((ret = grib_get_long_internal(gh,self->offsetdata,&offsetdata)) - != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(gh,self->bits_per_value,&bits_per_value)) - != GRIB_SUCCESS) return ret; - if((ret = grib_get_double_internal(gh,self->reference_value,&reference_value)) - != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(gh,self->binary_scale_factor,&binary_scale_factor)) - != GRIB_SUCCESS) return ret; + if ((ret = grib_get_long_internal(gh, self->offsetdata, &offsetdata)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(gh, self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_double_internal(gh, self->reference_value, &reference_value)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(gh, self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) + return ret; - if((ret = grib_get_long_internal(gh,self->decimal_scale_factor,&decimal_scale_factor)) - != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(gh,self->GRIBEX_sh_bug_present,&GRIBEX_sh_bug_present)) - != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->GRIBEX_sh_bug_present, &GRIBEX_sh_bug_present)) != GRIB_SUCCESS) return ret; /* ECC-774: don't use grib_get_long_internal */ - if((ret = grib_get_long(gh,self->ieee_floats,&ieee_floats)) != GRIB_SUCCESS) + if ((ret = grib_get_long(gh, self->ieee_floats, &ieee_floats)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_double_internal(gh,self->laplacianOperator,&laplacianOperator)) - != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(gh, self->laplacianOperator, &laplacianOperator)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(gh,self->sub_j,&sub_j)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->sub_j, &sub_j)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(gh,self->sub_k,&sub_k)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->sub_k, &sub_k)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(gh,self->sub_m,&sub_m)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->sub_m, &sub_m)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(gh,self->pen_j,&pen_j)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->pen_j, &pen_j)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(gh,self->pen_k,&pen_k)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->pen_k, &pen_k)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(gh,self->pen_m,&pen_m)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->pen_m, &pen_m)) != GRIB_SUCCESS) return ret; - self->dirty=0; + self->dirty = 0; switch (ieee_floats) { - case 0: - decode_float=grib_long_to_ibm; - bytes=4; - break; - case 1: - decode_float=grib_long_to_ieee; - bytes=4; - break; - case 2: - decode_float=grib_long_to_ieee64; - bytes=8; - break; - default: - return GRIB_NOT_IMPLEMENTED; + case 0: + decode_float = grib_long_to_ibm; + bytes = 4; + break; + case 1: + decode_float = grib_long_to_ieee; + bytes = 4; + break; + case 2: + decode_float = grib_long_to_ieee64; + bytes = 8; + break; + default: + return GRIB_NOT_IMPLEMENTED; } - Assert (sub_j == sub_k); - Assert (sub_j == sub_m); - Assert (pen_j == pen_k); - Assert (pen_j == pen_m); + Assert(sub_j == sub_k); + Assert(sub_j == sub_m); + Assert(pen_j == pen_k); + Assert(pen_j == pen_m); buf = (unsigned char*)gh->buffer->data; - maxv = pen_j+1; + maxv = pen_j + 1; - buf += grib_byte_offset(a); + buf += grib_byte_offset(a); hres = buf; lres = buf; if (pen_j == sub_j) { - n_vals = (pen_j+1)*(pen_j+2); - d = grib_power(-decimal_scale_factor,10) ; - grib_ieee_decode_array(a->context,buf,n_vals,bytes,val); + n_vals = (pen_j + 1) * (pen_j + 2); + d = grib_power(-decimal_scale_factor, 10); + grib_ieee_decode_array(a->context, buf, n_vals, bytes, val); if (d) { - for (i=0;icontext,maxv*sizeof(double)); + scals = (double*)grib_context_malloc(a->context, maxv * sizeof(double)); Assert(scals); scals[0] = 0; - for(i=1;icontext,GRIB_LOG_WARNING, - "COMPLEX_PACKING : problem with operator div by zero at index %d of %d \n", - i , maxv); + for (i = 1; i < maxv; i++) { + operat = pow(i * (i + 1), laplacianOperator); + if (operat != 0) + scals[i] = (1.0 / operat); + else { + grib_context_log(a->context, GRIB_LOG_WARNING, + "COMPLEX_PACKING : problem with operator div by zero at index %d of %d \n", + i, maxv); scals[i] = 0; } } @@ -385,108 +386,103 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len) for(i=0;i0) - { - lup=mmax; - if(sub_k>=0) - { - for(hcount=0;hcount 0) { + lup = mmax; + if (sub_k >= 0) { + for (hcount = 0; hcount < sub_k + 1; hcount++) { + val[i++] = decode_float(grib_decode_unsigned_long(hres, &hpos, 8 * bytes)); + val[i++] = decode_float(grib_decode_unsigned_long(hres, &hpos, 8 * bytes)); + + if (GRIBEX_sh_bug_present && hcount == sub_k) { /* bug in ecmwf data, last row (K+1)is scaled but should not */ - val[i-2] *= scals[lup]; - val[i-1] *= scals[lup]; + val[i - 2] *= scals[lup]; + val[i - 1] *= scals[lup]; } lup++; } sub_k--; } - pscals=scals+lup; - pval=val+i; + pscals = scals + lup; + pval = val + i; #if FAST_BIG_ENDIAN grib_decode_double_array_complex(lres, - &lpos,bits_per_value, - reference_value,s,pscals,(maxv-hcount)*2,pval); - i+=(maxv-hcount)*2; + &lpos, bits_per_value, + reference_value, s, pscals, (maxv - hcount) * 2, pval); + i += (maxv - hcount) * 2; #else (void)pscals; /* suppress gcc warning */ (void)pval; /* suppress gcc warning */ - for(lcount=hcount; lcount < maxv ; lcount++) - { - val[i++] = d * (double) ((grib_decode_unsigned_long(lres, &lpos, - bits_per_value)*s)+reference_value)*scals[lup]; - val[i++] = d * (double) ((grib_decode_unsigned_long(lres, &lpos, - bits_per_value)*s)+reference_value)*scals[lup]; + for (lcount = hcount; lcount < maxv; lcount++) { + val[i++] = d * (double)((grib_decode_unsigned_long(lres, &lpos, bits_per_value) * s) + reference_value) * scals[lup]; + val[i++] = d * (double)((grib_decode_unsigned_long(lres, &lpos, bits_per_value) * s) + reference_value) * scals[lup]; /* These values should always be zero, but as they are packed, it is necessary to force them back to zero */ if (mmax == 0) - val[i-1] = 0; + val[i - 1] = 0; lup++; } #endif maxv--; - hcount=0; + hcount = 0; mmax++; } Assert(*len >= i); *len = i; - grib_context_free(a->context,scals); + grib_context_free(a->context, scals); return ret; } -#define MAXVAL(a,b) a>b?a:b +#define MAXVAL(a, b) a > b ? a : b -static double calculate_pfactor(grib_context *ctx,const double* spectralField, long fieldTruncation, long subsetTruncation) +static double calculate_pfactor(grib_context* ctx, const double* spectralField, long fieldTruncation, long subsetTruncation) { /*long n_vals = ((fieldTruncation+1)*(fieldTruncation+2));*/ long loop, index, m, n = 0; double pFactor, zeps = 1.0e-15; - long ismin = (subsetTruncation+1), ismax = (fieldTruncation+1); - double* weights, range, * norms; + long ismin = (subsetTruncation + 1), ismax = (fieldTruncation + 1); + double *weights, range, *norms; double weightedSumOverX = 0.0, weightedSumOverY = 0.0, sumOfWeights = 0.0, x, y; double numerator = 0.0, denominator = 0.0, slope; /* Catch corner case. See GRIB-172 */ - if (ismax-ismin <= 1) { + if (ismax - ismin <= 1) { return 1; /* any value will do! we cannot do linear fit on a single point! */ } /* * Setup the weights */ - range = (double) (ismax - ismin +1); - weights = (double*) grib_context_malloc(ctx,(ismax+1)*sizeof(double)); - for( loop = ismin; loop <= ismax; loop++ ) - weights[loop] = range / (double) (loop-ismin+1); + range = (double)(ismax - ismin + 1); + weights = (double*)grib_context_malloc(ctx, (ismax + 1) * sizeof(double)); + for (loop = ismin; loop <= ismax; loop++) + weights[loop] = range / (double)(loop - ismin + 1); /* * Compute norms * Handle values 2 at a time (real and imaginary parts). */ - norms = (double*) grib_context_malloc(ctx,(ismax+1)*sizeof(double)); - for( loop = 0; loop < ismax+1; loop++ ) norms[loop] = 0.0; + norms = (double*)grib_context_malloc(ctx, (ismax + 1) * sizeof(double)); + for (loop = 0; loop < ismax + 1; loop++) + norms[loop] = 0.0; /* * Form norms for the rows which contain part of the unscaled subset. */ index = -2; - for( m = 0; m < subsetTruncation; m++ ) { - for( n = m; n <= fieldTruncation; n++ ) { + for (m = 0; m < subsetTruncation; m++) { + for (n = m; n <= fieldTruncation; n++) { index += 2; - if( n >= subsetTruncation ) { - norms[n] = MAXVAL(norms[n],fabs(spectralField[index])); - norms[n] = MAXVAL(norms[n],fabs(spectralField[index+1])); + if (n >= subsetTruncation) { + norms[n] = MAXVAL(norms[n], fabs(spectralField[index])); + norms[n] = MAXVAL(norms[n], fabs(spectralField[index + 1])); } } } @@ -495,11 +491,11 @@ static double calculate_pfactor(grib_context *ctx,const double* spectralField, l * Form norms for the rows which do not contain part of the unscaled subset. */ - for( m = subsetTruncation; m <= fieldTruncation; m++ ) { - for( n = m; n <= fieldTruncation; n++ ) { + for (m = subsetTruncation; m <= fieldTruncation; m++) { + for (n = m; n <= fieldTruncation; n++) { index += 2; - norms[n] = MAXVAL(norms[n],fabs(spectralField[index])); - norms[n] = MAXVAL(norms[n],fabs(spectralField[index+1])); + norms[n] = MAXVAL(norms[n], fabs(spectralField[index])); + norms[n] = MAXVAL(norms[n], fabs(spectralField[index + 1])); } } @@ -507,21 +503,22 @@ static double calculate_pfactor(grib_context *ctx,const double* spectralField, l * Ensure the norms have a value which is not too small in case of * problems with math functions (e.g. LOG). */ - for( loop = ismin; loop <= ismax; loop++ ) { - norms[loop] = MAXVAL(norms[loop],zeps); - if( norms[loop] == zeps ) weights[loop] = 100.0 * zeps; + for (loop = ismin; loop <= ismax; loop++) { + norms[loop] = MAXVAL(norms[loop], zeps); + if (norms[loop] == zeps) + weights[loop] = 100.0 * zeps; } /* * Do linear fit to find the slope */ - for( loop = ismin; loop <= ismax; loop++ ) { - x = log( (double) (loop*(loop+1)) ); - Assert( norms[loop] > 0 ); - y = log( norms[loop] ); + for (loop = ismin; loop <= ismax; loop++) { + x = log((double)(loop * (loop + 1))); + Assert(norms[loop] > 0); + y = log(norms[loop]); weightedSumOverX = weightedSumOverX + x * weights[loop]; weightedSumOverY = weightedSumOverY + y * weights[loop]; - sumOfWeights = sumOfWeights + weights[loop]; + sumOfWeights = sumOfWeights + weights[loop]; } weightedSumOverX = weightedSumOverX / sumOfWeights; weightedSumOverY = weightedSumOverY / sumOfWeights; @@ -530,303 +527,307 @@ static double calculate_pfactor(grib_context *ctx,const double* spectralField, l * Perform a least square fit for the equation */ - for( loop = ismin; loop <= ismax; loop++ ) { - x = log( (double)(loop*(loop+1)) ); - y = log( norms[loop] ); + for (loop = ismin; loop <= ismax; loop++) { + x = log((double)(loop * (loop + 1))); + y = log(norms[loop]); numerator = - numerator + weights[loop] * (y-weightedSumOverY) * (x-weightedSumOverX); + numerator + weights[loop] * (y - weightedSumOverY) * (x - weightedSumOverX); denominator = - denominator + weights[loop] * ((x-weightedSumOverX) * (x-weightedSumOverX)); + denominator + weights[loop] * ((x - weightedSumOverX) * (x - weightedSumOverX)); } slope = numerator / denominator; - grib_context_free(ctx,weights); - grib_context_free(ctx,norms); + grib_context_free(ctx, weights); + grib_context_free(ctx, norms); pFactor = -slope; - if( pFactor < -9999.9 ) pFactor = -9999.9; - if( pFactor > 9999.9 ) pFactor = 9999.9; + if (pFactor < -9999.9) + pFactor = -9999.9; + if (pFactor > 9999.9) + pFactor = 9999.9; return pFactor; } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { - grib_accessor_data_complex_packing* self = (grib_accessor_data_complex_packing*)a; - grib_handle* gh = grib_handle_of_accessor(a); - - size_t i = 0; - int ret = GRIB_SUCCESS; - long hcount = 0; - long lcount = 0; - long hpos = 0; - long lup = 0; - long mmax = 0; - long n_vals = 0; - double *scals = NULL; + grib_accessor_data_complex_packing* self = (grib_accessor_data_complex_packing*)a; + grib_handle* gh = grib_handle_of_accessor(a); + + size_t i = 0; + int ret = GRIB_SUCCESS; + long hcount = 0; + long lcount = 0; + long hpos = 0; + long lup = 0; + long mmax = 0; + long n_vals = 0; + double* scals = NULL; double s = 0; double d = 0; - unsigned char* buf = NULL; + unsigned char* buf = NULL; - size_t buflen = 0; - size_t hsize = 0; - size_t lsize = 0; + size_t buflen = 0; + size_t hsize = 0; + size_t lsize = 0; unsigned char* hres = NULL; unsigned char* lres = NULL; - long lpos = 0; - long maxv = 0; - - long offsetdata = 0; - long bits_per_value = 0; - double reference_value = 0; - long binary_scale_factor = 0; - long decimal_scale_factor = 0; - long optimize_scaling_factor = 0; - long laplacianOperatorIsSet = 0; - - double laplacianOperator = 0; - long sub_j= 0; - long sub_k= 0; - long sub_m= 0; - long pen_j= 0; - long pen_k= 0; - long pen_m= 0; - long GRIBEX_sh_bug_present =0; - long ieee_floats =0; - double min = 0; - double max = 0; - double current_val = 0; - short mixmax_unset = 0; + long lpos = 0; + long maxv = 0; + + long offsetdata = 0; + long bits_per_value = 0; + double reference_value = 0; + long binary_scale_factor = 0; + long decimal_scale_factor = 0; + long optimize_scaling_factor = 0; + long laplacianOperatorIsSet = 0; + + double laplacianOperator = 0; + long sub_j = 0; + long sub_k = 0; + long sub_m = 0; + long pen_j = 0; + long pen_k = 0; + long pen_m = 0; + long GRIBEX_sh_bug_present = 0; + long ieee_floats = 0; + double min = 0; + double max = 0; + double current_val = 0; + short mixmax_unset = 0; int bytes; encode_float_proc encode_float = NULL; - if (*len ==0) return GRIB_NO_VALUES; + if (*len == 0) + return GRIB_NO_VALUES; - if((ret = grib_get_long_internal(gh,self->offsetdata,&offsetdata)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->offsetdata, &offsetdata)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(gh,self->bits_per_value,&bits_per_value)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(gh,self->decimal_scale_factor,&decimal_scale_factor)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(gh,self->optimize_scaling_factor,&optimize_scaling_factor)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->optimize_scaling_factor, &optimize_scaling_factor)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(gh,self->GRIBEX_sh_bug_present,&GRIBEX_sh_bug_present)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->GRIBEX_sh_bug_present, &GRIBEX_sh_bug_present)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(gh,self->ieee_floats,&ieee_floats)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->ieee_floats, &ieee_floats)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(gh,self->laplacianOperatorIsSet,&laplacianOperatorIsSet)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->laplacianOperatorIsSet, &laplacianOperatorIsSet)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_double_internal(gh,self->laplacianOperator,&laplacianOperator)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(gh, self->laplacianOperator, &laplacianOperator)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(gh,self->sub_j,&sub_j)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->sub_j, &sub_j)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(gh,self->sub_k,&sub_k)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->sub_k, &sub_k)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(gh,self->sub_m,&sub_m)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->sub_m, &sub_m)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(gh,self->pen_j,&pen_j)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->pen_j, &pen_j)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(gh,self->pen_k,&pen_k)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->pen_k, &pen_k)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(gh,self->pen_m,&pen_m)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->pen_m, &pen_m)) != GRIB_SUCCESS) return ret; - self->dirty=1; + self->dirty = 1; switch (ieee_floats) { - case 0: - encode_float =grib_ibm_to_long; - bytes=4; - break; - case 1: - encode_float =grib_ieee_to_long; - bytes=4; - break; - case 2: - encode_float =grib_ieee64_to_long; - bytes=8; - break; - default: - return GRIB_NOT_IMPLEMENTED; + case 0: + encode_float = grib_ibm_to_long; + bytes = 4; + break; + case 1: + encode_float = grib_ieee_to_long; + bytes = 4; + break; + case 2: + encode_float = grib_ieee64_to_long; + bytes = 8; + break; + default: + return GRIB_NOT_IMPLEMENTED; } - Assert (sub_j == sub_k); Assert( sub_j == sub_m); - Assert (pen_j == pen_k); Assert( pen_j == pen_m); + Assert(sub_j == sub_k); + Assert(sub_j == sub_m); + Assert(pen_j == pen_k); + Assert(pen_j == pen_m); - n_vals = (pen_j+1)*(pen_j+2); + n_vals = (pen_j + 1) * (pen_j + 2); - if(*len != n_vals){ - grib_context_log(a->context,GRIB_LOG_ERROR,"COMPLEX_PACKING : wrong number of values, expected %d - got %d",n_vals,*len); + if (*len != n_vals) { + grib_context_log(a->context, GRIB_LOG_ERROR, "COMPLEX_PACKING : wrong number of values, expected %d - got %d", n_vals, *len); return GRIB_INTERNAL_ERROR; } if (pen_j == sub_j) { double* values; - d = grib_power(decimal_scale_factor,10) ; + d = grib_power(decimal_scale_factor, 10); if (d) { - values=(double*)grib_context_malloc_clear(a->context,sizeof(double)*n_vals); - for (i=0;icontext, sizeof(double) * n_vals); + for (i = 0; i < n_vals; i++) + values[i] = val[i] * d; } - buflen=n_vals*bytes; - buf = (unsigned char*)grib_context_malloc_clear(a->context,buflen); - grib_ieee_encode_array(a->context,values,n_vals,bytes,buf); - if (d) grib_context_free(a->context,values); - grib_buffer_replace(a, buf, buflen,1,1); - grib_context_free(a->context,buf); + else { + values = (double*)val; + } + buflen = n_vals * bytes; + buf = (unsigned char*)grib_context_malloc_clear(a->context, buflen); + grib_ieee_encode_array(a->context, values, n_vals, bytes, buf); + if (d) + grib_context_free(a->context, values); + grib_buffer_replace(a, buf, buflen, 1, 1); + grib_context_free(a->context, buf); return 0; } - if(!laplacianOperatorIsSet) { - laplacianOperator = calculate_pfactor(a->context,val,pen_j,sub_j); - if((ret = grib_set_double_internal(gh,self->laplacianOperator,laplacianOperator)) - != GRIB_SUCCESS) return ret; - grib_get_double_internal(gh,self->laplacianOperator,&laplacianOperator); + if (!laplacianOperatorIsSet) { + laplacianOperator = calculate_pfactor(a->context, val, pen_j, sub_j); + if ((ret = grib_set_double_internal(gh, self->laplacianOperator, laplacianOperator)) != GRIB_SUCCESS) + return ret; + grib_get_double_internal(gh, self->laplacianOperator, &laplacianOperator); } - hsize = bytes*(sub_k+1)*(sub_k+2); - lsize = ((n_vals - ((sub_k+1)*(sub_k+2)))*bits_per_value)/8; + hsize = bytes * (sub_k + 1) * (sub_k + 2); + lsize = ((n_vals - ((sub_k + 1) * (sub_k + 2))) * bits_per_value) / 8; - buflen = hsize+lsize; + buflen = hsize + lsize; - buf = (unsigned char*)grib_context_malloc(a->context,buflen); + buf = (unsigned char*)grib_context_malloc(a->context, buflen); hres = buf; - lres = buf+hsize; + lres = buf + hsize; - maxv = pen_j+1; + maxv = pen_j + 1; lpos = 0; hpos = 0; - scals = (double*) grib_context_malloc(a->context,maxv*sizeof(double)); + scals = (double*)grib_context_malloc(a->context, maxv * sizeof(double)); Assert(scals); - scals[0] =0; - for(i=1;i0) - { - lup=mmax; + while (maxv > 0) { + lup = mmax; - if(sub_k>=0) - { - i += 2*(sub_k+1); - lup += sub_k+1 ; - hcount += sub_k+1 ; + if (sub_k >= 0) { + i += 2 * (sub_k + 1); + lup += sub_k + 1; + hcount += sub_k + 1; sub_k--; } - for(lcount=hcount; lcount < maxv ; lcount++) - { + for (lcount = hcount; lcount < maxv; lcount++) { current_val = ((val[i++]) * scals[lup]); - if(mixmax_unset == 0){ - max = current_val; - min = current_val; + if (mixmax_unset == 0) { + max = current_val; + min = current_val; mixmax_unset = 1; } - if(current_val > max) max = current_val; - if(current_val < min) min = current_val; + if (current_val > max) + max = current_val; + if (current_val < min) + min = current_val; current_val = ((val[i++]) * scals[lup]); - if(current_val > max) max = current_val; - if(current_val < min) min = current_val; + if (current_val > max) + max = current_val; + if (current_val < min) + min = current_val; lup++; } maxv--; - hcount=0; + hcount = 0; mmax++; } - if (optimize_scaling_factor) - { - ret = grib_optimize_decimal_factor (a, self->reference_value, - max, min, bits_per_value, 0, 1, - &decimal_scale_factor, - &binary_scale_factor, - &reference_value); - if (ret !=GRIB_SUCCESS) { - grib_context_log(gh->context,GRIB_LOG_ERROR, - "unable to find nearest_smaller_value of %g for %s",min,self->reference_value); + if (optimize_scaling_factor) { + ret = grib_optimize_decimal_factor(a, self->reference_value, + max, min, bits_per_value, 0, 1, + &decimal_scale_factor, + &binary_scale_factor, + &reference_value); + if (ret != GRIB_SUCCESS) { + grib_context_log(gh->context, GRIB_LOG_ERROR, + "unable to find nearest_smaller_value of %g for %s", min, self->reference_value); return GRIB_INTERNAL_ERROR; } - d = grib_power(+decimal_scale_factor,10); + d = grib_power(+decimal_scale_factor, 10); } - else - { - d = grib_power(+decimal_scale_factor,10); - if (grib_get_nearest_smaller_value(gh,self->reference_value,d*min,&reference_value) - !=GRIB_SUCCESS) { - grib_context_log(gh->context,GRIB_LOG_ERROR, - "unable to find nearest_smaller_value of %g for %s",d*min,self->reference_value); + else { + d = grib_power(+decimal_scale_factor, 10); + if (grib_get_nearest_smaller_value(gh, self->reference_value, d * min, &reference_value) != GRIB_SUCCESS) { + grib_context_log(gh->context, GRIB_LOG_ERROR, + "unable to find nearest_smaller_value of %g for %s", d * min, self->reference_value); return GRIB_INTERNAL_ERROR; } - binary_scale_factor = grib_get_binary_scale_fact(d*max,reference_value,bits_per_value,&ret); + binary_scale_factor = grib_get_binary_scale_fact(d * max, reference_value, bits_per_value, &ret); - if (ret==GRIB_UNDERFLOW) { - d=0; + if (ret == GRIB_UNDERFLOW) { + d = 0; binary_scale_factor = 0; - reference_value=0; - } else { - if (ret!=GRIB_SUCCESS) { - grib_context_log(a->context,GRIB_LOG_ERROR,"COMPLEX_PACKING : Cannot compute binary_scale_factor"); + reference_value = 0; + } + else { + if (ret != GRIB_SUCCESS) { + grib_context_log(a->context, GRIB_LOG_ERROR, "COMPLEX_PACKING : Cannot compute binary_scale_factor"); return ret; } } } - s = grib_power(- binary_scale_factor, 2); + s = grib_power(-binary_scale_factor, 2); - i=0; + i = 0; - mmax = 0; - maxv = pen_j+1; - i=0; - lcount=0; - hcount=0; - sub_k = sub_j; + mmax = 0; + maxv = pen_j + 1; + i = 0; + lcount = 0; + hcount = 0; + sub_k = sub_j; - while(maxv>0) - { - lup=mmax; + while (maxv > 0) { + lup = mmax; - if(sub_k>=0) - { - for(hcount=0;hcount= 0) { + for (hcount = 0; hcount < sub_k + 1; hcount++) { + if (GRIBEX_sh_bug_present && hcount == sub_k) { /* _test(val[i]*d*scals[lup],1); */ - grib_encode_unsigned_long(hres, encode_float((val[i++]*d)*scals[lup]) , &hpos, 8*bytes); + grib_encode_unsigned_long(hres, encode_float((val[i++] * d) * scals[lup]), &hpos, 8 * bytes); /* _test(val[i]*d*scals[lup],1); */ - grib_encode_unsigned_long(hres, encode_float((val[i++]*d)*scals[lup]) , &hpos, 8*bytes); - }else{ - + grib_encode_unsigned_long(hres, encode_float((val[i++] * d) * scals[lup]), &hpos, 8 * bytes); + } + else { /* _test(val[i]*d,0); */ - grib_encode_unsigned_long(hres, encode_float(val[i++]) , &hpos, 8*bytes); + grib_encode_unsigned_long(hres, encode_float(val[i++]), &hpos, 8 * bytes); /* _test(val[i]*d,0); */ - grib_encode_unsigned_long(hres, encode_float(val[i++]) , &hpos, 8*bytes); + grib_encode_unsigned_long(hres, encode_float(val[i++]), &hpos, 8 * bytes); } lup++; } @@ -834,38 +835,37 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) } #if FAST_BIG_ENDIAN - grib_encode_double_array_complex((maxv-hcount)*2,&(val[i]),bits_per_value,reference_value,&(scals[lup]),d,s,lres,&lpos); - i+=(maxv-hcount)*2; + grib_encode_double_array_complex((maxv - hcount) * 2, &(val[i]), bits_per_value, reference_value, &(scals[lup]), d, s, lres, &lpos); + i += (maxv - hcount) * 2; #else if (bits_per_value % 8) { - for(lcount=hcount; lcount < maxv ; lcount++) - { - current_val = (((((val[i++]*d) * scals[lup])-reference_value)*s)+0.5); - if(current_val < 0) - grib_context_log(a->context,GRIB_LOG_ERROR, - "COMPLEX_PACKING : negative coput before packing (%g)", current_val); + for (lcount = hcount; lcount < maxv; lcount++) { + current_val = (((((val[i++] * d) * scals[lup]) - reference_value) * s) + 0.5); + if (current_val < 0) + grib_context_log(a->context, GRIB_LOG_ERROR, + "COMPLEX_PACKING : negative coput before packing (%g)", current_val); grib_encode_unsigned_longb(lres, current_val, &lpos, bits_per_value); - current_val = (((((val[i++]*d) * scals[lup])-reference_value)*s)+0.5); - if(current_val < 0) - grib_context_log(a->context,GRIB_LOG_ERROR, - "COMPLEX_PACKING : negative coput before packing (%g)", current_val); + current_val = (((((val[i++] * d) * scals[lup]) - reference_value) * s) + 0.5); + if (current_val < 0) + grib_context_log(a->context, GRIB_LOG_ERROR, + "COMPLEX_PACKING : negative coput before packing (%g)", current_val); grib_encode_unsigned_longb(lres, current_val, &lpos, bits_per_value); lup++; } - } else { - for(lcount=hcount; lcount < maxv ; lcount++) - { - current_val = (((((val[i++]*d) * scals[lup])-reference_value)*s)+0.5); - if(current_val < 0) - grib_context_log(a->context,GRIB_LOG_ERROR, - "COMPLEX_PACKING : negative coput before packing (%g)", current_val); + } + else { + for (lcount = hcount; lcount < maxv; lcount++) { + current_val = (((((val[i++] * d) * scals[lup]) - reference_value) * s) + 0.5); + if (current_val < 0) + grib_context_log(a->context, GRIB_LOG_ERROR, + "COMPLEX_PACKING : negative coput before packing (%g)", current_val); grib_encode_unsigned_long(lres, current_val, &lpos, bits_per_value); - current_val = (((((val[i++]*d) * scals[lup])-reference_value)*s)+0.5); - if(current_val < 0) - grib_context_log(a->context,GRIB_LOG_ERROR, - "COMPLEX_PACKING : negative coput before packing (%g)", current_val); + current_val = (((((val[i++] * d) * scals[lup]) - reference_value) * s) + 0.5); + if (current_val < 0) + grib_context_log(a->context, GRIB_LOG_ERROR, + "COMPLEX_PACKING : negative coput before packing (%g)", current_val); grib_encode_unsigned_long(lres, current_val, &lpos, bits_per_value); lup++; } @@ -873,38 +873,37 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) #endif maxv--; - hcount=0; + hcount = 0; mmax++; } - if(((hpos/8) != hsize) &&((lpos/8) != lsize)) - { - grib_context_log(a->context,GRIB_LOG_ERROR, - "COMPLEX_PACKING : Mismatch in packing between high resolution and low resolution part"); - grib_context_free(a->context,buf); - grib_context_free(a->context,scals); + if (((hpos / 8) != hsize) && ((lpos / 8) != lsize)) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "COMPLEX_PACKING : Mismatch in packing between high resolution and low resolution part"); + grib_context_free(a->context, buf); + grib_context_free(a->context, scals); return GRIB_INTERNAL_ERROR; } - buflen = ((hpos + lpos)/8); + buflen = ((hpos + lpos) / 8); - if((ret = grib_set_double_internal(gh,self->reference_value, reference_value)) != GRIB_SUCCESS) + if ((ret = grib_set_double_internal(gh, self->reference_value, reference_value)) != GRIB_SUCCESS) return ret; { /* Make sure we can decode it again */ double ref = 1e-100; - grib_get_double_internal(gh,self->reference_value,&ref); + grib_get_double_internal(gh, self->reference_value, &ref); Assert(ref == reference_value); } - if((ret = grib_set_long_internal(gh,self->binary_scale_factor, binary_scale_factor)) != GRIB_SUCCESS) + if ((ret = grib_set_long_internal(gh, self->binary_scale_factor, binary_scale_factor)) != GRIB_SUCCESS) return ret; - if((ret = grib_set_long_internal(gh,self->decimal_scale_factor,decimal_scale_factor)) != GRIB_SUCCESS) + if ((ret = grib_set_long_internal(gh, self->decimal_scale_factor, decimal_scale_factor)) != GRIB_SUCCESS) return ret; - grib_buffer_replace(a, buf, buflen,1,1); - grib_context_free(a->context,buf); - grib_context_free(a->context,scals); + grib_buffer_replace(a, buf, buflen, 1, 1); + grib_context_free(a->context, buf); + grib_context_free(a->context, scals); return ret; } diff --git a/src/grib_accessor_class_data_constant_field.c b/src/grib_accessor_class_data_constant_field.c index 3c22cd09f..c5d3b046f 100644 --- a/src/grib_accessor_class_data_constant_field.c +++ b/src/grib_accessor_class_data_constant_field.c @@ -37,70 +37,71 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_data_constant_field { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in values */ - int carg; - const char* seclen; - const char* offsetdata; - const char* offsetsection; - int dirty; -/* Members defined in data_constant_field */ - const char* ni; - const char* nj; - const char* reference_value; +typedef struct grib_accessor_data_constant_field +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in values */ + int carg; + const char* seclen; + const char* offsetdata; + const char* offsetsection; + int dirty; + /* Members defined in data_constant_field */ + const char* ni; + const char* nj; + const char* reference_value; } grib_accessor_data_constant_field; extern grib_accessor_class* grib_accessor_class_values; static grib_accessor_class _grib_accessor_class_data_constant_field = { - &grib_accessor_class_values, /* super */ - "data_constant_field", /* name */ - sizeof(grib_accessor_data_constant_field), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_values, /* super */ + "data_constant_field", /* name */ + sizeof(grib_accessor_data_constant_field), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -109,96 +110,97 @@ grib_accessor_class* grib_accessor_class_data_constant_field = &_grib_accessor_c static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long v, grib_arguments* args) +static void init(grib_accessor* a, const long v, grib_arguments* args) { - grib_accessor_data_constant_field* self = (grib_accessor_data_constant_field*)a; + grib_accessor_data_constant_field* self = (grib_accessor_data_constant_field*)a; - self->ni = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->nj = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->reference_value = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); + self->ni = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->nj = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->reference_value = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - grib_accessor_data_constant_field* self = (grib_accessor_data_constant_field*)a; + grib_accessor_data_constant_field* self = (grib_accessor_data_constant_field*)a; long ni; long nj; int err = 0; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->ni,&ni)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->ni, &ni)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->nj, &nj)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->nj, &nj)) != GRIB_SUCCESS) return err; - *count=ni*nj; + *count = ni * nj; return err; } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - grib_accessor_data_constant_field* self = (grib_accessor_data_constant_field*)a; - size_t i = 0; - long n_vals = 0; - int err=0; - double reference_value = 0; - - err=grib_value_count(a,&n_vals); - if (err) return err; + grib_accessor_data_constant_field* self = (grib_accessor_data_constant_field*)a; + size_t i = 0; + long n_vals = 0; + int err = 0; + double reference_value = 0; + + err = grib_value_count(a, &n_vals); + if (err) + return err; - if(*len < n_vals){ + if (*len < n_vals) { *len = n_vals; return GRIB_ARRAY_TOO_SMALL; } - if((err = grib_get_double_internal(grib_handle_of_accessor(a),self->reference_value, &reference_value)) != GRIB_SUCCESS) + if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->reference_value, &reference_value)) != GRIB_SUCCESS) return err; - for(i=0;i < n_vals;i++) + for (i = 0; i < n_vals; i++) val[i] = reference_value; - *len = (long) n_vals; + *len = (long)n_vals; return err; } -static int pack_double(grib_accessor* a, const double* val, size_t *len) -{ +static int pack_double(grib_accessor* a, const double* val, size_t* len) +{ /* This should keep GRIBEX happy */ - unsigned char zero =0; - if(a->offset%2) - grib_buffer_replace(a, &zero, 1,1,1); + unsigned char zero = 0; + if (a->offset % 2) + grib_buffer_replace(a, &zero, 1, 1, 1); else - grib_buffer_replace(a, NULL, 0,1,1); + grib_buffer_replace(a, NULL, 0, 1, 1); return GRIB_SUCCESS; } diff --git a/src/grib_accessor_class_data_dummy_field.c b/src/grib_accessor_class_data_dummy_field.c index 9d7e51345..af9e07b91 100644 --- a/src/grib_accessor_class_data_dummy_field.c +++ b/src/grib_accessor_class_data_dummy_field.c @@ -37,86 +37,87 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_data_dummy_field { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in values */ - int carg; - const char* seclen; - const char* offsetdata; - const char* offsetsection; - int dirty; -/* Members defined in data_simple_packing */ - int edition; - const char* units_factor; - const char* units_bias; - const char* changing_precision; - const char* number_of_values; - const char* bits_per_value; - const char* reference_value; - const char* binary_scale_factor; - const char* decimal_scale_factor; - const char* optimize_scaling_factor; -/* Members defined in data_g1simple_packing */ - const char* half_byte; - const char* packingType; - const char* ieee_packing; - const char* precision; -/* Members defined in data_dummy_field */ - const char* missing_value; - const char* numberOfPoints; - const char* bitmap; +typedef struct grib_accessor_data_dummy_field +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in values */ + int carg; + const char* seclen; + const char* offsetdata; + const char* offsetsection; + int dirty; + /* Members defined in data_simple_packing */ + int edition; + const char* units_factor; + const char* units_bias; + const char* changing_precision; + const char* number_of_values; + const char* bits_per_value; + const char* reference_value; + const char* binary_scale_factor; + const char* decimal_scale_factor; + const char* optimize_scaling_factor; + /* Members defined in data_g1simple_packing */ + const char* half_byte; + const char* packingType; + const char* ieee_packing; + const char* precision; + /* Members defined in data_dummy_field */ + const char* missing_value; + const char* numberOfPoints; + const char* bitmap; } grib_accessor_data_dummy_field; extern grib_accessor_class* grib_accessor_class_data_g1simple_packing; static grib_accessor_class _grib_accessor_class_data_dummy_field = { - &grib_accessor_class_data_g1simple_packing, /* super */ - "data_dummy_field", /* name */ - sizeof(grib_accessor_data_dummy_field), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_data_g1simple_packing, /* super */ + "data_dummy_field", /* name */ + sizeof(grib_accessor_data_dummy_field), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -125,128 +126,128 @@ grib_accessor_class* grib_accessor_class_data_dummy_field = &_grib_accessor_clas static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long v, grib_arguments* args) +static void init(grib_accessor* a, const long v, grib_arguments* args) { - grib_accessor_data_dummy_field* self = (grib_accessor_data_dummy_field*)a; - self->missing_value = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->numberOfPoints = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->bitmap = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); + grib_accessor_data_dummy_field* self = (grib_accessor_data_dummy_field*)a; + self->missing_value = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->numberOfPoints = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->bitmap = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - grib_accessor_data_dummy_field* self = (grib_accessor_data_dummy_field*)a; - size_t i = 0; - size_t n_vals = 0; + grib_accessor_data_dummy_field* self = (grib_accessor_data_dummy_field*)a; + size_t i = 0; + size_t n_vals = 0; long numberOfPoints; double missing_value = 0; - int err = 0; + int err = 0; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->numberOfPoints, &numberOfPoints)) - != GRIB_SUCCESS) return err; - n_vals =numberOfPoints; + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints, &numberOfPoints)) != GRIB_SUCCESS) + return err; + n_vals = numberOfPoints; - if((err = grib_get_double_internal(grib_handle_of_accessor(a),self->missing_value, &missing_value)) - != GRIB_SUCCESS) return err; + if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->missing_value, &missing_value)) != GRIB_SUCCESS) + return err; - if(*len < n_vals){ + if (*len < n_vals) { *len = n_vals; return GRIB_ARRAY_TOO_SMALL; } - for(i=0;i < n_vals;i++) + for (i = 0; i < n_vals; i++) val[i] = missing_value; - if(grib_find_accessor(grib_handle_of_accessor(a),self->bitmap)) { - if((err = grib_set_double_array_internal(grib_handle_of_accessor(a),self->bitmap,val,n_vals)) != GRIB_SUCCESS) + if (grib_find_accessor(grib_handle_of_accessor(a), self->bitmap)) { + if ((err = grib_set_double_array_internal(grib_handle_of_accessor(a), self->bitmap, val, n_vals)) != GRIB_SUCCESS) return err; } - *len = (long) n_vals; + *len = (long)n_vals; return err; } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { - grib_accessor_data_dummy_field* self = (grib_accessor_data_dummy_field*)a; + grib_accessor_data_dummy_field* self = (grib_accessor_data_dummy_field*)a; size_t n_vals = *len; - int err = 0; + int err = 0; - long bits_per_value = 0; + long bits_per_value = 0; - long half_byte = 0; + long half_byte = 0; - size_t buflen = 0; - unsigned char* buf = NULL; + size_t buflen = 0; + unsigned char* buf = NULL; - if (*len ==0) return GRIB_NO_VALUES; + if (*len == 0) + return GRIB_NO_VALUES; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->bits_per_value,&bits_per_value)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) return err; - buflen = (1+((bits_per_value*n_vals)/8))*sizeof(unsigned char); + buflen = (1 + ((bits_per_value * n_vals) / 8)) * sizeof(unsigned char); - buf = (unsigned char*)grib_context_malloc_clear(a->context,buflen); - if (!buf) return GRIB_OUT_OF_MEMORY; + buf = (unsigned char*)grib_context_malloc_clear(a->context, buflen); + if (!buf) + return GRIB_OUT_OF_MEMORY; - half_byte = (buflen*8)-((*len)*bits_per_value); + half_byte = (buflen * 8) - ((*len) * bits_per_value); - if((err = grib_set_long_internal(grib_handle_of_accessor(a),self->half_byte, half_byte)) != GRIB_SUCCESS){ - grib_context_free(a->context,buf); + if ((err = grib_set_long_internal(grib_handle_of_accessor(a), self->half_byte, half_byte)) != GRIB_SUCCESS) { + grib_context_free(a->context, buf); return err; } - grib_buffer_replace(a, buf, buflen,1,1); + grib_buffer_replace(a, buf, buflen, 1, 1); - grib_context_free(a->context,buf); + grib_context_free(a->context, buf); return GRIB_SUCCESS; - } -static int value_count(grib_accessor* a,long* numberOfPoints) +static int value_count(grib_accessor* a, long* numberOfPoints) { - grib_accessor_data_dummy_field* self = (grib_accessor_data_dummy_field*)a; - int err=0; - *numberOfPoints = 0; + grib_accessor_data_dummy_field* self = (grib_accessor_data_dummy_field*)a; + int err = 0; + *numberOfPoints = 0; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->numberOfPoints, numberOfPoints)) - != GRIB_SUCCESS) { - grib_context_log(a->context,GRIB_LOG_ERROR,"unable to get count of %s (%s)",a->name,grib_get_error_message(err)); + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints, numberOfPoints)) != GRIB_SUCCESS) { + grib_context_log(a->context, GRIB_LOG_ERROR, "unable to get count of %s (%s)", a->name, grib_get_error_message(err)); } return err; diff --git a/src/grib_accessor_class_data_g1complex_packing.c b/src/grib_accessor_class_data_g1complex_packing.c index b44891933..cd5c48656 100644 --- a/src/grib_accessor_class_data_g1complex_packing.c +++ b/src/grib_accessor_class_data_g1complex_packing.c @@ -38,92 +38,93 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_double(grib_accessor*, const double* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_data_g1complex_packing { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in values */ - int carg; - const char* seclen; - const char* offsetdata; - const char* offsetsection; - int dirty; -/* Members defined in data_simple_packing */ - int edition; - const char* units_factor; - const char* units_bias; - const char* changing_precision; - const char* number_of_values; - const char* bits_per_value; - const char* reference_value; - const char* binary_scale_factor; - const char* decimal_scale_factor; - const char* optimize_scaling_factor; -/* Members defined in data_complex_packing */ - const char* GRIBEX_sh_bug_present; - const char* ieee_floats; - const char* laplacianOperatorIsSet; - const char* laplacianOperator; - const char* sub_j; - const char* sub_k; - const char* sub_m; - const char* pen_j; - const char* pen_k; - const char* pen_m; -/* Members defined in data_g1complex_packing */ - const char* N; - const char* half_byte; - const char* packingType; - const char* ieee_packing; - const char* precision; +typedef struct grib_accessor_data_g1complex_packing +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in values */ + int carg; + const char* seclen; + const char* offsetdata; + const char* offsetsection; + int dirty; + /* Members defined in data_simple_packing */ + int edition; + const char* units_factor; + const char* units_bias; + const char* changing_precision; + const char* number_of_values; + const char* bits_per_value; + const char* reference_value; + const char* binary_scale_factor; + const char* decimal_scale_factor; + const char* optimize_scaling_factor; + /* Members defined in data_complex_packing */ + const char* GRIBEX_sh_bug_present; + const char* ieee_floats; + const char* laplacianOperatorIsSet; + const char* laplacianOperator; + const char* sub_j; + const char* sub_k; + const char* sub_m; + const char* pen_j; + const char* pen_k; + const char* pen_m; + /* Members defined in data_g1complex_packing */ + const char* N; + const char* half_byte; + const char* packingType; + const char* ieee_packing; + const char* precision; } grib_accessor_data_g1complex_packing; extern grib_accessor_class* grib_accessor_class_data_complex_packing; static grib_accessor_class _grib_accessor_class_data_g1complex_packing = { - &grib_accessor_class_data_complex_packing, /* super */ - "data_g1complex_packing", /* name */ - sizeof(grib_accessor_data_g1complex_packing), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_data_complex_packing, /* super */ + "data_g1complex_packing", /* name */ + sizeof(grib_accessor_data_g1complex_packing), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -132,132 +133,137 @@ grib_accessor_class* grib_accessor_class_data_g1complex_packing = &_grib_accesso static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long v, grib_arguments* args) +static void init(grib_accessor* a, const long v, grib_arguments* args) { - grib_accessor_data_g1complex_packing *self =(grib_accessor_data_g1complex_packing*)a; - self->half_byte = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->N = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->packingType = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->ieee_packing = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->precision = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->edition=1; + grib_accessor_data_g1complex_packing* self = (grib_accessor_data_g1complex_packing*)a; + self->half_byte = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->N = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->packingType = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->ieee_packing = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->precision = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->edition = 1; a->flags |= GRIB_ACCESSOR_FLAG_DATA; } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { grib_accessor_data_g1complex_packing* self = - (grib_accessor_data_g1complex_packing*)a; - int ret = GRIB_SUCCESS; - long seclen=0; - long sub_j= 0; - long sub_k= 0; - long sub_m= 0; - long n= 0; - long half_byte= 0; - long bits_per_value =0; - size_t buflen =0; - grib_context* c=a->context; - grib_handle* h=grib_handle_of_accessor(a); - char* ieee_packing_s=NULL; - char* packingType_s=NULL; - char* precision_s=NULL; + (grib_accessor_data_g1complex_packing*)a; + int ret = GRIB_SUCCESS; + long seclen = 0; + long sub_j = 0; + long sub_k = 0; + long sub_m = 0; + long n = 0; + long half_byte = 0; + long bits_per_value = 0; + size_t buflen = 0; + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); + char* ieee_packing_s = NULL; + char* packingType_s = NULL; + char* precision_s = NULL; grib_accessor_class* super = *(a->cclass->super); - if (*len ==0) return GRIB_NO_VALUES; + if (*len == 0) + return GRIB_NO_VALUES; if (c->ieee_packing && self->ieee_packing) { - long precision=c->ieee_packing==32 ? 1 : 2; - size_t lenstr=strlen(self->ieee_packing); + long precision = c->ieee_packing == 32 ? 1 : 2; + size_t lenstr = strlen(self->ieee_packing); - packingType_s=grib_context_strdup(c,self->packingType); - ieee_packing_s=grib_context_strdup(c,self->ieee_packing); - precision_s=grib_context_strdup(c,self->precision); + packingType_s = grib_context_strdup(c, self->packingType); + ieee_packing_s = grib_context_strdup(c, self->ieee_packing); + precision_s = grib_context_strdup(c, self->precision); - grib_set_string(h,packingType_s,ieee_packing_s,&lenstr); - grib_set_long(h,precision_s,precision); + grib_set_string(h, packingType_s, ieee_packing_s, &lenstr); + grib_set_long(h, precision_s, precision); - grib_context_free(c,packingType_s); - grib_context_free(c,ieee_packing_s); - grib_context_free(c,precision_s); - return grib_set_double_array(h,"values",val,*len); + grib_context_free(c, packingType_s); + grib_context_free(c, ieee_packing_s); + grib_context_free(c, precision_s); + return grib_set_double_array(h, "values", val, *len); } - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->sub_j,&sub_j)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->sub_j, &sub_j)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->sub_k,&sub_k)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->sub_k, &sub_k)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->sub_m,&sub_m)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->sub_m, &sub_m)) != GRIB_SUCCESS) return ret; - self->dirty=1; + self->dirty = 1; - Assert ((sub_j== sub_k) && (sub_m== sub_j)); + Assert((sub_j == sub_k) && (sub_m == sub_j)); - ret = super->pack_double(a,val,len); + ret = super->pack_double(a, val, len); - if(ret == GRIB_SUCCESS){ - n = a->offset + 4*((sub_k+1)*(sub_k+2)); + if (ret == GRIB_SUCCESS) { + n = a->offset + 4 * ((sub_k + 1) * (sub_k + 2)); #if 1 /* Octet number starts from beginning of message but shouldn't */ - if((ret = grib_set_long_internal(grib_handle_of_accessor(a),self->N,n)) != GRIB_SUCCESS) + if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->N, n)) != GRIB_SUCCESS) return ret; #else - ret = grib_get_long_internal(grib_handle_of_accessor(a),self->offsetsection,&offsetsection); - if(ret != GRIB_SUCCESS) return ret; - if((ret = grib_set_long_internal(grib_handle_of_accessor(a),self->N,n-offsetsection)) - != GRIB_SUCCESS) return ret; + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetsection, &offsetsection); + if (ret != GRIB_SUCCESS) + return ret; + if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->N, n - offsetsection)) != GRIB_SUCCESS) + return ret; #endif - ret = grib_get_long_internal(grib_handle_of_accessor(a),self->bits_per_value,&bits_per_value); - if(ret != GRIB_SUCCESS) return ret; + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->bits_per_value, &bits_per_value); + if (ret != GRIB_SUCCESS) + return ret; - ret = grib_get_long_internal(grib_handle_of_accessor(a),self->seclen,&seclen); - if(ret != GRIB_SUCCESS) return ret; + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->seclen, &seclen); + if (ret != GRIB_SUCCESS) + return ret; - buflen = 32*(sub_k+1)*(sub_k+2)+(*len-(sub_k+1)*(sub_k+2))*bits_per_value+18*8; - half_byte = seclen*8-buflen; - if (a->context->debug==-1) { - fprintf(stderr, "ECCODES DEBUG: half_byte=%ld\n",half_byte); + buflen = 32 * (sub_k + 1) * (sub_k + 2) + (*len - (sub_k + 1) * (sub_k + 2)) * bits_per_value + 18 * 8; + half_byte = seclen * 8 - buflen; + if (a->context->debug == -1) { + fprintf(stderr, "ECCODES DEBUG: half_byte=%ld\n", half_byte); } - ret = grib_set_long_internal(grib_handle_of_accessor(a),self->half_byte, half_byte); - if(ret != GRIB_SUCCESS) return ret; + ret = grib_set_long_internal(grib_handle_of_accessor(a), self->half_byte, half_byte); + if (ret != GRIB_SUCCESS) + return ret; } return ret; } diff --git a/src/grib_accessor_class_data_g1second_order_constant_width_packing.c b/src/grib_accessor_class_data_g1second_order_constant_width_packing.c index 53b9374ae..3639c8325 100644 --- a/src/grib_accessor_class_data_g1second_order_constant_width_packing.c +++ b/src/grib_accessor_class_data_g1second_order_constant_width_packing.c @@ -51,94 +51,95 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_data_g1second_order_constant_width_packing { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in values */ - int carg; - const char* seclen; - const char* offsetdata; - const char* offsetsection; - int dirty; -/* Members defined in data_simple_packing */ - int edition; - const char* units_factor; - const char* units_bias; - const char* changing_precision; - const char* number_of_values; - const char* bits_per_value; - const char* reference_value; - const char* binary_scale_factor; - const char* decimal_scale_factor; - const char* optimize_scaling_factor; -/* Members defined in data_g1second_order_constant_width_packing */ - const char* half_byte; - const char* packingType; - const char* ieee_packing; - const char* precision; - const char* widthOfFirstOrderValues; - const char* N1; - const char* N2; - const char* numberOfGroups; - const char* numberOfSecondOrderPackedValues; - const char* extraValues; - const char* pl; - const char* Ni; - const char* Nj; - const char* jPointsAreConsecutive; - const char* bitmap; - const char* groupWidth; +typedef struct grib_accessor_data_g1second_order_constant_width_packing +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in values */ + int carg; + const char* seclen; + const char* offsetdata; + const char* offsetsection; + int dirty; + /* Members defined in data_simple_packing */ + int edition; + const char* units_factor; + const char* units_bias; + const char* changing_precision; + const char* number_of_values; + const char* bits_per_value; + const char* reference_value; + const char* binary_scale_factor; + const char* decimal_scale_factor; + const char* optimize_scaling_factor; + /* Members defined in data_g1second_order_constant_width_packing */ + const char* half_byte; + const char* packingType; + const char* ieee_packing; + const char* precision; + const char* widthOfFirstOrderValues; + const char* N1; + const char* N2; + const char* numberOfGroups; + const char* numberOfSecondOrderPackedValues; + const char* extraValues; + const char* pl; + const char* Ni; + const char* Nj; + const char* jPointsAreConsecutive; + const char* bitmap; + const char* groupWidth; } grib_accessor_data_g1second_order_constant_width_packing; extern grib_accessor_class* grib_accessor_class_data_simple_packing; static grib_accessor_class _grib_accessor_class_data_g1second_order_constant_width_packing = { - &grib_accessor_class_data_simple_packing, /* super */ - "data_g1second_order_constant_width_packing", /* name */ - sizeof(grib_accessor_data_g1second_order_constant_width_packing), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_data_simple_packing, /* super */ + "data_g1second_order_constant_width_packing", /* name */ + sizeof(grib_accessor_data_g1second_order_constant_width_packing), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -147,154 +148,156 @@ grib_accessor_class* grib_accessor_class_data_g1second_order_constant_width_pack static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long v, grib_arguments* args) +static void init(grib_accessor* a, const long v, grib_arguments* args) { - grib_accessor_data_g1second_order_constant_width_packing *self =(grib_accessor_data_g1second_order_constant_width_packing*)a; - - self->half_byte = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->packingType = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->ieee_packing = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->precision = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->widthOfFirstOrderValues = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->N1 = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->N2 = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->numberOfGroups = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->numberOfSecondOrderPackedValues = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->extraValues = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->Ni = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->Nj = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->pl = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->jPointsAreConsecutive = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->bitmap = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->groupWidth = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->edition=1; + grib_accessor_data_g1second_order_constant_width_packing* self = (grib_accessor_data_g1second_order_constant_width_packing*)a; + + self->half_byte = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->packingType = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->ieee_packing = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->precision = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->widthOfFirstOrderValues = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->N1 = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->N2 = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->numberOfGroups = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->numberOfSecondOrderPackedValues = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->extraValues = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->Ni = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->Nj = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->pl = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->jPointsAreConsecutive = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->bitmap = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->groupWidth = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->edition = 1; a->flags |= GRIB_ACCESSOR_FLAG_DATA; } -static int value_count(grib_accessor* a,long* numberOfSecondOrderPackedValues) +static int value_count(grib_accessor* a, long* numberOfSecondOrderPackedValues) { - int err=0; - grib_accessor_data_g1second_order_constant_width_packing *self =(grib_accessor_data_g1second_order_constant_width_packing*)a; - *numberOfSecondOrderPackedValues=0; + int err = 0; + grib_accessor_data_g1second_order_constant_width_packing* self = (grib_accessor_data_g1second_order_constant_width_packing*)a; + *numberOfSecondOrderPackedValues = 0; - err=grib_get_long_internal(grib_handle_of_accessor(a),self->numberOfSecondOrderPackedValues,numberOfSecondOrderPackedValues); + err = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfSecondOrderPackedValues, numberOfSecondOrderPackedValues); return err; } -static int unpack_double(grib_accessor* a, double* values, size_t *len) +static int unpack_double(grib_accessor* a, double* values, size_t* len) { - grib_accessor_data_g1second_order_constant_width_packing* self = (grib_accessor_data_g1second_order_constant_width_packing*)a; - int ret=0; - long numberOfGroups,numberOfSecondOrderPackedValues; - long groupWidth=0; - long* firstOrderValues=0; - long* X=0; - long numberPerRow=0; - long pos=0; - long widthOfFirstOrderValues=0; + grib_accessor_data_g1second_order_constant_width_packing* self = (grib_accessor_data_g1second_order_constant_width_packing*)a; + int ret = 0; + long numberOfGroups, numberOfSecondOrderPackedValues; + long groupWidth = 0; + long* firstOrderValues = 0; + long* X = 0; + long numberPerRow = 0; + long pos = 0; + long widthOfFirstOrderValues = 0; long jPointsAreConsecutive; unsigned char* buf = (unsigned char*)grib_handle_of_accessor(a)->buffer->data; - long i,n; + long i, n; double reference_value; long binary_scale_factor; long decimal_scale_factor; - double s,d; + double s, d; long* secondaryBitmap; buf += grib_byte_offset(a); - if((ret=grib_get_long_internal(grib_handle_of_accessor(a),self->numberOfGroups,&numberOfGroups)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfGroups, &numberOfGroups)) != GRIB_SUCCESS) return ret; - if((ret=grib_get_long_internal(grib_handle_of_accessor(a),self->jPointsAreConsecutive,&jPointsAreConsecutive)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->jPointsAreConsecutive, &jPointsAreConsecutive)) != GRIB_SUCCESS) return ret; if (jPointsAreConsecutive) { - if((ret=grib_get_long_internal(grib_handle_of_accessor(a),self->Ni,&numberPerRow)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->Ni, &numberPerRow)) != GRIB_SUCCESS) return ret; - } else { - if((ret=grib_get_long_internal(grib_handle_of_accessor(a),self->Nj,&numberPerRow)) != GRIB_SUCCESS) + } + else { + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->Nj, &numberPerRow)) != GRIB_SUCCESS) return ret; } - if((ret=grib_get_long_internal(grib_handle_of_accessor(a),self->widthOfFirstOrderValues,&widthOfFirstOrderValues)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->widthOfFirstOrderValues, &widthOfFirstOrderValues)) != GRIB_SUCCESS) return ret; - if((ret=grib_get_long_internal(grib_handle_of_accessor(a),self->binary_scale_factor,&binary_scale_factor)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) return ret; - if((ret=grib_get_long_internal(grib_handle_of_accessor(a),self->decimal_scale_factor,&decimal_scale_factor)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) return ret; - if((ret=grib_get_double_internal(grib_handle_of_accessor(a),self->reference_value,&reference_value)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(grib_handle_of_accessor(a), self->reference_value, &reference_value)) != GRIB_SUCCESS) return ret; - if((ret=grib_get_long_internal(grib_handle_of_accessor(a),self->numberOfSecondOrderPackedValues, - &numberOfSecondOrderPackedValues)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfSecondOrderPackedValues, + &numberOfSecondOrderPackedValues)) != GRIB_SUCCESS) return ret; - if((ret=grib_get_long_internal(grib_handle_of_accessor(a),self->groupWidth, &groupWidth)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->groupWidth, &groupWidth)) != GRIB_SUCCESS) return ret; - secondaryBitmap=(long*)grib_context_malloc_clear(a->context,sizeof(long)*numberOfSecondOrderPackedValues); - grib_decode_long_array(buf,&pos,1,numberOfSecondOrderPackedValues,secondaryBitmap); - pos = 8 * ( (pos + 7 ) / 8); + secondaryBitmap = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfSecondOrderPackedValues); + grib_decode_long_array(buf, &pos, 1, numberOfSecondOrderPackedValues, secondaryBitmap); + pos = 8 * ((pos + 7) / 8); - firstOrderValues=(long*)grib_context_malloc_clear(a->context,sizeof(long)*numberOfGroups); - grib_decode_long_array(buf,&pos,widthOfFirstOrderValues,numberOfGroups,firstOrderValues); - pos = 8 * ( (pos + 7 ) / 8); + firstOrderValues = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfGroups); + grib_decode_long_array(buf, &pos, widthOfFirstOrderValues, numberOfGroups, firstOrderValues); + pos = 8 * ((pos + 7) / 8); - X=(long*)grib_context_malloc_clear(a->context,sizeof(long)*numberOfSecondOrderPackedValues); + X = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfSecondOrderPackedValues); - if (groupWidth>0) { - grib_decode_long_array(buf,&pos,groupWidth,numberOfSecondOrderPackedValues,X); - n=0; - i=-1; - while (n 0) { + grib_decode_long_array(buf, &pos, groupWidth, numberOfSecondOrderPackedValues, X); + n = 0; + i = -1; + while (n < numberOfSecondOrderPackedValues) { + i += secondaryBitmap[n]; + X[n] = firstOrderValues[i] + X[n]; n++; } - } else { - n=0; - i=-1; - while (ncontext,secondaryBitmap); - grib_context_free(a->context,firstOrderValues); - grib_context_free(a->context,X); + *len = numberOfSecondOrderPackedValues; + grib_context_free(a->context, secondaryBitmap); + grib_context_free(a->context, firstOrderValues); + grib_context_free(a->context, X); return ret; } -static int pack_double(grib_accessor* a, const double* cval, size_t *len) +static int pack_double(grib_accessor* a, const double* cval, size_t* len) { - grib_context_log(a->context,GRIB_LOG_ERROR,"constant width packing not implemented"); + grib_context_log(a->context, GRIB_LOG_ERROR, "constant width packing not implemented"); return GRIB_NOT_IMPLEMENTED; } diff --git a/src/grib_accessor_class_data_g1second_order_general_extended_packing.c b/src/grib_accessor_class_data_g1second_order_general_extended_packing.c index 9e2fcae32..ff5183b16 100644 --- a/src/grib_accessor_class_data_g1second_order_general_extended_packing.c +++ b/src/grib_accessor_class_data_g1second_order_general_extended_packing.c @@ -63,104 +63,105 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void destroy(grib_context*,grib_accessor*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void destroy(grib_context*, grib_accessor*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -static int unpack_double_element(grib_accessor*,size_t i, double* val); - -typedef struct grib_accessor_data_g1second_order_general_extended_packing { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in values */ - int carg; - const char* seclen; - const char* offsetdata; - const char* offsetsection; - int dirty; -/* Members defined in data_simple_packing */ - int edition; - const char* units_factor; - const char* units_bias; - const char* changing_precision; - const char* number_of_values; - const char* bits_per_value; - const char* reference_value; - const char* binary_scale_factor; - const char* decimal_scale_factor; - const char* optimize_scaling_factor; -/* Members defined in data_g1second_order_general_extended_packing */ - const char* half_byte; - const char* packingType; - const char* ieee_packing; - const char* precision; - const char* widthOfFirstOrderValues; - const char* firstOrderValues; - const char* N1; - const char* N2; - const char* numberOfGroups; - const char* codedNumberOfGroups; - const char* numberOfSecondOrderPackedValues; - const char* extraValues; - const char* groupWidths; - const char* widthOfWidths; - const char* groupLengths; - const char* widthOfLengths; - const char* NL; - const char* SPD; - const char* widthOfSPD; - const char* orderOfSPD; - const char* numberOfPoints; - const char* dataFlag; - double* values; - size_t size; +static int unpack_double_element(grib_accessor*, size_t i, double* val); + +typedef struct grib_accessor_data_g1second_order_general_extended_packing +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in values */ + int carg; + const char* seclen; + const char* offsetdata; + const char* offsetsection; + int dirty; + /* Members defined in data_simple_packing */ + int edition; + const char* units_factor; + const char* units_bias; + const char* changing_precision; + const char* number_of_values; + const char* bits_per_value; + const char* reference_value; + const char* binary_scale_factor; + const char* decimal_scale_factor; + const char* optimize_scaling_factor; + /* Members defined in data_g1second_order_general_extended_packing */ + const char* half_byte; + const char* packingType; + const char* ieee_packing; + const char* precision; + const char* widthOfFirstOrderValues; + const char* firstOrderValues; + const char* N1; + const char* N2; + const char* numberOfGroups; + const char* codedNumberOfGroups; + const char* numberOfSecondOrderPackedValues; + const char* extraValues; + const char* groupWidths; + const char* widthOfWidths; + const char* groupLengths; + const char* widthOfLengths; + const char* NL; + const char* SPD; + const char* widthOfSPD; + const char* orderOfSPD; + const char* numberOfPoints; + const char* dataFlag; + double* values; + size_t size; } grib_accessor_data_g1second_order_general_extended_packing; extern grib_accessor_class* grib_accessor_class_data_simple_packing; static grib_accessor_class _grib_accessor_class_data_g1second_order_general_extended_packing = { - &grib_accessor_class_data_simple_packing, /* super */ - "data_g1second_order_general_extended_packing", /* name */ - sizeof(grib_accessor_data_g1second_order_general_extended_packing), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - &unpack_double_element, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_data_simple_packing, /* super */ + "data_g1second_order_general_extended_packing", /* name */ + sizeof(grib_accessor_data_g1second_order_general_extended_packing), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + &destroy, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + &unpack_double_element, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -169,34 +170,34 @@ grib_accessor_class* grib_accessor_class_data_g1second_order_general_extended_pa static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ @@ -204,105 +205,109 @@ static void init_class(grib_accessor_class* c) #define MAX_NUMBER_OF_GROUPS 65534 #define EFDEBUG 0 -static const unsigned long nbits[64]={ - 0x1, 0x2, 0x4, 0x8, - 0x10, 0x20, 0x40, 0x80, - 0x100, 0x200, 0x400, 0x800, - 0x1000, 0x2000, 0x4000, 0x8000, - 0x10000, 0x20000, 0x40000, 0x80000, - 0x100000, 0x200000, 0x400000, 0x800000, - 0x1000000, 0x2000000, 0x4000000, 0x8000000, - 0x10000000, 0x20000000, 0x40000000, 0x80000000, - 0x100000000, 0x200000000, 0x400000000, 0x800000000, - 0x1000000000, 0x2000000000, 0x4000000000, 0x8000000000, - 0x10000000000, 0x20000000000, 0x40000000000, 0x80000000000, - 0x100000000000, 0x200000000000, 0x400000000000, 0x800000000000, - 0x1000000000000, 0x2000000000000, 0x4000000000000, 0x8000000000000, - 0x10000000000000, 0x20000000000000, 0x40000000000000, 0x80000000000000, - 0x100000000000000, 0x200000000000000, 0x400000000000000, 0x800000000000000, - 0x1000000000000000, 0x2000000000000000, 0x4000000000000000, 0x8000000000000000 +static const unsigned long nbits[64] = { + 0x1, 0x2, 0x4, 0x8, + 0x10, 0x20, 0x40, 0x80, + 0x100, 0x200, 0x400, 0x800, + 0x1000, 0x2000, 0x4000, 0x8000, + 0x10000, 0x20000, 0x40000, 0x80000, + 0x100000, 0x200000, 0x400000, 0x800000, + 0x1000000, 0x2000000, 0x4000000, 0x8000000, + 0x10000000, 0x20000000, 0x40000000, 0x80000000, + 0x100000000, 0x200000000, 0x400000000, 0x800000000, + 0x1000000000, 0x2000000000, 0x4000000000, 0x8000000000, + 0x10000000000, 0x20000000000, 0x40000000000, 0x80000000000, + 0x100000000000, 0x200000000000, 0x400000000000, 0x800000000000, + 0x1000000000000, 0x2000000000000, 0x4000000000000, 0x8000000000000, + 0x10000000000000, 0x20000000000000, 0x40000000000000, 0x80000000000000, + 0x100000000000000, 0x200000000000000, 0x400000000000000, 0x800000000000000, + 0x1000000000000000, 0x2000000000000000, 0x4000000000000000, 0x8000000000000000 }; -static long number_of_bits(grib_handle*h, unsigned long x) +static long number_of_bits(grib_handle* h, unsigned long x) { - const unsigned long *n=nbits; - const int count = sizeof(nbits)/sizeof(nbits[0]); - long i=0; - while (x>=*n) { + const unsigned long* n = nbits; + const int count = sizeof(nbits) / sizeof(nbits[0]); + long i = 0; + while (x >= *n) { n++; i++; - if (i>=count) { + if (i >= count) { /*grib_dump_content(h, stdout,"debug", ~0, NULL);*/ grib_context_log(h->context, GRIB_LOG_FATAL, - "grib_accessor_class_data_g1second_order_general_extended_packing: Number out of range: %ld", x); + "grib_accessor_class_data_g1second_order_general_extended_packing: Number out of range: %ld", x); } } return i; } -static void init(grib_accessor* a,const long v, grib_arguments* args) +static void init(grib_accessor* a, const long v, grib_arguments* args) { - grib_accessor_data_g1second_order_general_extended_packing *self =(grib_accessor_data_g1second_order_general_extended_packing*)a; - grib_handle* handle = grib_handle_of_accessor(a); - - self->half_byte = grib_arguments_get_name(handle,args,self->carg++); - self->packingType = grib_arguments_get_name(handle,args,self->carg++); - self->ieee_packing = grib_arguments_get_name(handle,args,self->carg++); - self->precision = grib_arguments_get_name(handle,args,self->carg++); - self->widthOfFirstOrderValues = grib_arguments_get_name(handle,args,self->carg++); - self->firstOrderValues = grib_arguments_get_name(handle,args,self->carg++); - self->N1 = grib_arguments_get_name(handle,args,self->carg++); - self->N2 = grib_arguments_get_name(handle,args,self->carg++); - self->numberOfGroups = grib_arguments_get_name(handle,args,self->carg++); - self->codedNumberOfGroups = grib_arguments_get_name(handle,args,self->carg++); - self->numberOfSecondOrderPackedValues = grib_arguments_get_name(handle,args,self->carg++); - self->extraValues = grib_arguments_get_name(handle,args,self->carg++); - self->groupWidths = grib_arguments_get_name(handle,args,self->carg++); - self->widthOfWidths = grib_arguments_get_name(handle,args,self->carg++); - self->groupLengths = grib_arguments_get_name(handle,args,self->carg++); - self->widthOfLengths = grib_arguments_get_name(handle,args,self->carg++); - self->NL = grib_arguments_get_name(handle,args,self->carg++); - self->SPD = grib_arguments_get_name(handle,args,self->carg++); - self->widthOfSPD = grib_arguments_get_name(handle,args,self->carg++); - self->orderOfSPD = grib_arguments_get_name(handle,args,self->carg++); - self->numberOfPoints = grib_arguments_get_name(handle,args,self->carg++); - self->dataFlag = grib_arguments_get_name(handle,args,self->carg++); - self->edition=1; - self->dirty=1; - self->values=NULL; - self->size=0; + grib_accessor_data_g1second_order_general_extended_packing* self = (grib_accessor_data_g1second_order_general_extended_packing*)a; + grib_handle* handle = grib_handle_of_accessor(a); + + self->half_byte = grib_arguments_get_name(handle, args, self->carg++); + self->packingType = grib_arguments_get_name(handle, args, self->carg++); + self->ieee_packing = grib_arguments_get_name(handle, args, self->carg++); + self->precision = grib_arguments_get_name(handle, args, self->carg++); + self->widthOfFirstOrderValues = grib_arguments_get_name(handle, args, self->carg++); + self->firstOrderValues = grib_arguments_get_name(handle, args, self->carg++); + self->N1 = grib_arguments_get_name(handle, args, self->carg++); + self->N2 = grib_arguments_get_name(handle, args, self->carg++); + self->numberOfGroups = grib_arguments_get_name(handle, args, self->carg++); + self->codedNumberOfGroups = grib_arguments_get_name(handle, args, self->carg++); + self->numberOfSecondOrderPackedValues = grib_arguments_get_name(handle, args, self->carg++); + self->extraValues = grib_arguments_get_name(handle, args, self->carg++); + self->groupWidths = grib_arguments_get_name(handle, args, self->carg++); + self->widthOfWidths = grib_arguments_get_name(handle, args, self->carg++); + self->groupLengths = grib_arguments_get_name(handle, args, self->carg++); + self->widthOfLengths = grib_arguments_get_name(handle, args, self->carg++); + self->NL = grib_arguments_get_name(handle, args, self->carg++); + self->SPD = grib_arguments_get_name(handle, args, self->carg++); + self->widthOfSPD = grib_arguments_get_name(handle, args, self->carg++); + self->orderOfSPD = grib_arguments_get_name(handle, args, self->carg++); + self->numberOfPoints = grib_arguments_get_name(handle, args, self->carg++); + self->dataFlag = grib_arguments_get_name(handle, args, self->carg++); + self->edition = 1; + self->dirty = 1; + self->values = NULL; + self->size = 0; a->flags |= GRIB_ACCESSOR_FLAG_DATA; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - grib_accessor_data_g1second_order_general_extended_packing* self = (grib_accessor_data_g1second_order_general_extended_packing*)a; - long numberOfCodedValues=0; - long numberOfGroups=0; + grib_accessor_data_g1second_order_general_extended_packing* self = (grib_accessor_data_g1second_order_general_extended_packing*)a; + long numberOfCodedValues = 0; + long numberOfGroups = 0; size_t ngroups; - long *groupLengths; - long orderOfSPD=0; + long* groupLengths; + long orderOfSPD = 0; long i; - int err=0; + int err = 0; - *count=0; + *count = 0; - err=grib_get_long(grib_handle_of_accessor(a),self->numberOfGroups,&numberOfGroups); - if (err) return err; - if (numberOfGroups==0) return 0; + err = grib_get_long(grib_handle_of_accessor(a), self->numberOfGroups, &numberOfGroups); + if (err) + return err; + if (numberOfGroups == 0) + return 0; - groupLengths=(long*)grib_context_malloc_clear(a->context,sizeof(long)*numberOfGroups); - ngroups=numberOfGroups; - err=grib_get_long_array(grib_handle_of_accessor(a),self->groupLengths,groupLengths,&ngroups); - if (err) return err; + groupLengths = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfGroups); + ngroups = numberOfGroups; + err = grib_get_long_array(grib_handle_of_accessor(a), self->groupLengths, groupLengths, &ngroups); + if (err) + return err; - for (i=0;icontext,groupLengths); + grib_context_free(a->context, groupLengths); - err=grib_get_long(grib_handle_of_accessor(a),self->orderOfSPD,&orderOfSPD); + err = grib_get_long(grib_handle_of_accessor(a), self->orderOfSPD, &orderOfSPD); - *count=numberOfCodedValues+orderOfSPD; + *count = numberOfCodedValues + orderOfSPD; return err; } @@ -311,112 +316,120 @@ static int unpack_double_element(grib_accessor* a, size_t idx, double* val) { size_t size; double* values; - int err=0; + int err = 0; /* GRIB-564: The index idx relates to codedValues NOT values! */ - err=grib_get_size(grib_handle_of_accessor(a),"codedValues",&size); - if (err) return err; - if (idx >= size) return GRIB_INVALID_NEAREST; - - values=(double*)grib_context_malloc_clear(a->context,size*sizeof(double)); - err=grib_get_double_array(grib_handle_of_accessor(a),"codedValues",values,&size); - if (err) return err; - *val=values[idx]; - grib_context_free(a->context,values); + err = grib_get_size(grib_handle_of_accessor(a), "codedValues", &size); + if (err) + return err; + if (idx >= size) + return GRIB_INVALID_NEAREST; + + values = (double*)grib_context_malloc_clear(a->context, size * sizeof(double)); + err = grib_get_double_array(grib_handle_of_accessor(a), "codedValues", values, &size); + if (err) + return err; + *val = values[idx]; + grib_context_free(a->context, values); return err; } -static int unpack_double(grib_accessor* a, double* values, size_t *len) +static int unpack_double(grib_accessor* a, double* values, size_t* len) { - grib_accessor_data_g1second_order_general_extended_packing* self = (grib_accessor_data_g1second_order_general_extended_packing*)a; - int ret=0; - long numberOfGroups,numberOfSecondOrderPackedValues; - long* firstOrderValues=0; - long* X=0; - long pos=0; - grib_handle* handle = grib_handle_of_accessor(a); - unsigned char* buf = (unsigned char*)handle->buffer->data; - long i,n; + grib_accessor_data_g1second_order_general_extended_packing* self = (grib_accessor_data_g1second_order_general_extended_packing*)a; + int ret = 0; + long numberOfGroups, numberOfSecondOrderPackedValues; + long* firstOrderValues = 0; + long* X = 0; + long pos = 0; + grib_handle* handle = grib_handle_of_accessor(a); + unsigned char* buf = (unsigned char*)handle->buffer->data; + long i, n; double reference_value; long binary_scale_factor; long decimal_scale_factor; - double s,d; - long j,count=0; - long *groupWidths=NULL,*groupLengths=NULL; - long orderOfSPD=0; - long *SPD=0; - long numberOfValues=0; - long bias=0; - long y=0,z=0,w=0; - size_t k,ngroups; + double s, d; + long j, count = 0; + long *groupWidths = NULL, *groupLengths = NULL; + long orderOfSPD = 0; + long* SPD = 0; + long numberOfValues = 0; + long bias = 0; + long y = 0, z = 0, w = 0; + size_t k, ngroups; if (!self->dirty) { - if (*lensize) { + if (*len < self->size) { return GRIB_ARRAY_TOO_SMALL; } - for (k=0;ksize;k++) - values[k]=self->values[k]; + for (k = 0; k < self->size; k++) + values[k] = self->values[k]; - *len=self->size; + *len = self->size; return GRIB_SUCCESS; } - self->dirty=0; + self->dirty = 0; buf += grib_byte_offset(a); - ret=value_count(a,&numberOfValues); - if (ret) return ret; + ret = value_count(a, &numberOfValues); + if (ret) + return ret; - if((ret=grib_get_long_internal(handle,self->numberOfGroups,&numberOfGroups)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(handle, self->numberOfGroups, &numberOfGroups)) != GRIB_SUCCESS) return ret; - if((ret=grib_get_long_internal(handle,self->binary_scale_factor,&binary_scale_factor)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(handle, self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) return ret; - ngroups=numberOfGroups; - groupWidths=(long*)grib_context_malloc_clear(a->context,sizeof(long)*numberOfGroups); - ret=grib_get_long_array(handle,self->groupWidths,groupWidths,&ngroups); - if(ret != GRIB_SUCCESS) return ret; + ngroups = numberOfGroups; + groupWidths = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfGroups); + ret = grib_get_long_array(handle, self->groupWidths, groupWidths, &ngroups); + if (ret != GRIB_SUCCESS) + return ret; - groupLengths=(long*)grib_context_malloc_clear(a->context,sizeof(long)*numberOfGroups); - ret=grib_get_long_array(handle,self->groupLengths,groupLengths,&ngroups); - if(ret != GRIB_SUCCESS) return ret; + groupLengths = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfGroups); + ret = grib_get_long_array(handle, self->groupLengths, groupLengths, &ngroups); + if (ret != GRIB_SUCCESS) + return ret; - firstOrderValues=(long*)grib_context_malloc_clear(a->context,sizeof(long)*numberOfGroups); - ret=grib_get_long_array(handle,self->firstOrderValues,firstOrderValues,&ngroups); - if(ret != GRIB_SUCCESS) return ret; + firstOrderValues = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfGroups); + ret = grib_get_long_array(handle, self->firstOrderValues, firstOrderValues, &ngroups); + if (ret != GRIB_SUCCESS) + return ret; - if((ret=grib_get_long_internal(handle,self->decimal_scale_factor,&decimal_scale_factor)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(handle, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) return ret; - if((ret=grib_get_double_internal(handle,self->reference_value,&reference_value)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(handle, self->reference_value, &reference_value)) != GRIB_SUCCESS) return ret; - if((ret=grib_get_long_internal(handle,self->numberOfSecondOrderPackedValues, - &numberOfSecondOrderPackedValues)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(handle, self->numberOfSecondOrderPackedValues, + &numberOfSecondOrderPackedValues)) != GRIB_SUCCESS) return ret; - if((ret=grib_get_long_internal(handle,self->orderOfSPD,&orderOfSPD)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(handle, self->orderOfSPD, &orderOfSPD)) != GRIB_SUCCESS) return ret; if (orderOfSPD) { - size_t nSPD=orderOfSPD+1; - SPD=(long*)grib_context_malloc_clear(a->context,sizeof(long)*nSPD); - ret=grib_get_long_array(handle,self->SPD,SPD,&nSPD); - bias=SPD[orderOfSPD]; - if(ret != GRIB_SUCCESS) return ret; + size_t nSPD = orderOfSPD + 1; + SPD = (long*)grib_context_malloc_clear(a->context, sizeof(long) * nSPD); + ret = grib_get_long_array(handle, self->SPD, SPD, &nSPD); + bias = SPD[orderOfSPD]; + if (ret != GRIB_SUCCESS) + return ret; } - X=(long*)grib_context_malloc_clear(a->context,sizeof(long)*numberOfValues); + X = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfValues); - n=orderOfSPD; - for (i=0;i0) { + n = orderOfSPD; + for (i = 0; i < numberOfGroups; i++) { + if (groupWidths[i] > 0) { grib_decode_long_array(buf, &pos, groupWidths[i], groupLengths[i], - &X[n]); - for (j=0;jvalues) { - if (numberOfValues!=self->size) { - grib_context_free(a->context,self->values); - self->values=(double*)grib_context_malloc_clear(a->context,sizeof(double)*numberOfValues); + if (numberOfValues != self->size) { + grib_context_free(a->context, self->values); + self->values = (double*)grib_context_malloc_clear(a->context, sizeof(double) * numberOfValues); } - } else { - self->values=(double*)grib_context_malloc_clear(a->context,sizeof(double)*numberOfValues); + } + else { + self->values = (double*)grib_context_malloc_clear(a->context, sizeof(double) * numberOfValues); } - s = grib_power(binary_scale_factor,2); - d = grib_power(-decimal_scale_factor,10) ; - for (i=0; ivalues[i]=values[i]; + s = grib_power(binary_scale_factor, 2); + d = grib_power(-decimal_scale_factor, 10); + for (i = 0; i < numberOfValues; i++) { + values[i] = (double)(((X[i] * s) + reference_value) * d); + self->values[i] = values[i]; } - *len=numberOfValues; - self->size=numberOfValues; + *len = numberOfValues; + self->size = numberOfValues; - grib_context_free(a->context,X); - grib_context_free(a->context,groupWidths); - grib_context_free(a->context,groupLengths); - grib_context_free(a->context,firstOrderValues); + grib_context_free(a->context, X); + grib_context_free(a->context, groupWidths); + grib_context_free(a->context, groupLengths); + grib_context_free(a->context, firstOrderValues); if (orderOfSPD) - grib_context_free(a->context,SPD); + grib_context_free(a->context, SPD); return ret; } -static void grib_split_long_groups(grib_handle* hand, grib_context* c,long* numberOfGroups,long* lengthOfSecondOrderValues, - long* groupLengths,long* widthOfLengths, - long* groupWidths, long widthOfWidths, - long* firstOrderValues,long widthOfFirstOrderValues) { - - long i,j; - long newWidth,delta; - long *widthsOfLengths; - long *localWidthsOfLengths; - long *localLengths; - long *localWidths; - long *localFirstOrderValues; - int maxNumberOfGroups=*numberOfGroups*2; +static void grib_split_long_groups(grib_handle* hand, grib_context* c, long* numberOfGroups, long* lengthOfSecondOrderValues, + long* groupLengths, long* widthOfLengths, + long* groupWidths, long widthOfWidths, + long* firstOrderValues, long widthOfFirstOrderValues) +{ + long i, j; + long newWidth, delta; + long* widthsOfLengths; + long* localWidthsOfLengths; + long* localLengths; + long* localWidths; + long* localFirstOrderValues; + int maxNumberOfGroups = *numberOfGroups * 2; /* the widthOfLengths is the same for all the groupLengths and therefore if @@ -525,89 +540,93 @@ static void grib_split_long_groups(grib_handle* hand, grib_context* c,long* numb Here we try to reduce the size of the message splitting the big groups. */ - widthsOfLengths=(long*)grib_context_malloc_clear(c,sizeof(long)*maxNumberOfGroups); - j=0; + widthsOfLengths = (long*)grib_context_malloc_clear(c, sizeof(long) * maxNumberOfGroups); + j = 0; /* compute the widthOfLengths and the number of big groups */ - for (i=0;i<*numberOfGroups;i++) { - widthsOfLengths[i]=number_of_bits(hand, groupLengths[i]); - if (*widthOfLengths==widthsOfLengths[i]) { + for (i = 0; i < *numberOfGroups; i++) { + widthsOfLengths[i] = number_of_bits(hand, groupLengths[i]); + if (*widthOfLengths == widthsOfLengths[i]) { j++; } } /* variation of the size of message due to decrease of groupLengths of 1*/ - newWidth=*widthOfLengths-1; - delta=j*(widthOfWidths+widthOfFirstOrderValues+newWidth)-*numberOfGroups; + newWidth = *widthOfLengths - 1; + delta = j * (widthOfWidths + widthOfFirstOrderValues + newWidth) - *numberOfGroups; - if (delta>=0) { - grib_context_free(c,widthsOfLengths); + if (delta >= 0) { + grib_context_free(c, widthsOfLengths); return; } - localWidthsOfLengths=(long*)grib_context_malloc_clear(c,sizeof(long)*maxNumberOfGroups); - localLengths=(long*)grib_context_malloc_clear(c,sizeof(long)*maxNumberOfGroups); - localWidths=(long*)grib_context_malloc_clear(c,sizeof(long)*maxNumberOfGroups); - localFirstOrderValues=(long*)grib_context_malloc_clear(c,sizeof(long)*maxNumberOfGroups); + localWidthsOfLengths = (long*)grib_context_malloc_clear(c, sizeof(long) * maxNumberOfGroups); + localLengths = (long*)grib_context_malloc_clear(c, sizeof(long) * maxNumberOfGroups); + localWidths = (long*)grib_context_malloc_clear(c, sizeof(long) * maxNumberOfGroups); + localFirstOrderValues = (long*)grib_context_malloc_clear(c, sizeof(long) * maxNumberOfGroups); - while (newWidth>0) { + while (newWidth > 0) { /* it is worth to split big groups */ - j=0; - for (i=0;i<*numberOfGroups;i++) { - if (newWidthnewWidth) { + localLengths[j] = groupLengths[i] - localLengths[j - 1]; + localWidthsOfLengths[j] = number_of_bits(hand, localLengths[j]); + localWidths[j] = groupWidths[i]; + localFirstOrderValues[j] = firstOrderValues[i]; + if (localWidthsOfLengths[j] > newWidth) { localLengths[j]--; localWidthsOfLengths[j]--; j++; - localLengths[j]=1; - localWidthsOfLengths[j]=1; - localWidths[j]=groupWidths[i]; - localFirstOrderValues[j]=firstOrderValues[i]; + localLengths[j] = 1; + localWidthsOfLengths[j] = 1; + localWidths[j] = groupWidths[i]; + localFirstOrderValues[j] = firstOrderValues[i]; } j++; - } else { - localLengths[j]=groupLengths[i]; - localWidthsOfLengths[j]=widthsOfLengths[i]; - localWidths[j]=groupWidths[i]; - localFirstOrderValues[j]=firstOrderValues[i]; + } + else { + localLengths[j] = groupLengths[i]; + localWidthsOfLengths[j] = widthsOfLengths[i]; + localWidths[j] = groupWidths[i]; + localFirstOrderValues[j] = firstOrderValues[i]; j++; } } - if (j>maxNumberOfGroups) break; - - *numberOfGroups=j; - *widthOfLengths=newWidth; - j=0; - *lengthOfSecondOrderValues=0; - for (i=0;i<*numberOfGroups;i++) { - groupLengths[i]=localLengths[i]; - widthsOfLengths[i]=localWidthsOfLengths[i]; - groupWidths[i]=localWidths[i]; - firstOrderValues[i]=localFirstOrderValues[i]; - *lengthOfSecondOrderValues+=groupLengths[i]*groupWidths[i]; - if (*widthOfLengths==widthsOfLengths[i]) j++; + if (j > maxNumberOfGroups) + break; + + *numberOfGroups = j; + *widthOfLengths = newWidth; + j = 0; + *lengthOfSecondOrderValues = 0; + for (i = 0; i < *numberOfGroups; i++) { + groupLengths[i] = localLengths[i]; + widthsOfLengths[i] = localWidthsOfLengths[i]; + groupWidths[i] = localWidths[i]; + firstOrderValues[i] = localFirstOrderValues[i]; + *lengthOfSecondOrderValues += groupLengths[i] * groupWidths[i]; + if (*widthOfLengths == widthsOfLengths[i]) + j++; } newWidth--; - delta=j*(widthOfWidths+widthOfFirstOrderValues+newWidth)-*numberOfGroups; - if (delta>=0) break; + delta = j * (widthOfWidths + widthOfFirstOrderValues + newWidth) - *numberOfGroups; + if (delta >= 0) + break; } - grib_context_free(c,widthsOfLengths); - grib_context_free(c,localWidthsOfLengths); - grib_context_free(c,localLengths); - grib_context_free(c,localWidths); - grib_context_free(c,localFirstOrderValues); + grib_context_free(c, widthsOfLengths); + grib_context_free(c, localWidthsOfLengths); + grib_context_free(c, localLengths); + grib_context_free(c, localWidths); + grib_context_free(c, localFirstOrderValues); } #if 0 @@ -1217,210 +1236,211 @@ static int pack_double_old(grib_accessor* a, const double* val, size_t *len) } #endif -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { - grib_accessor_data_g1second_order_general_extended_packing* self = (grib_accessor_data_g1second_order_general_extended_packing*)a; - int ret=0; - int grib2=0; - long bits_per_value,orderOfSPD,binary_scale_factor; + grib_accessor_data_g1second_order_general_extended_packing* self = (grib_accessor_data_g1second_order_general_extended_packing*)a; + int ret = 0; + int grib2 = 0; + long bits_per_value, orderOfSPD, binary_scale_factor; long numberOfValues; - double max,min; - double decimal,divisor; + double max, min; + double decimal, divisor; double reference_value; - size_t size,sizebits; + size_t size, sizebits; long half_byte; long* X; long* Xp; long i; - long incrementGroupLengthA,groupWidthA,prevGroupLength,offsetD,remainingValuesB,groupLengthB; - long maxB,minB,maxAB,minAB; - long offsetBeforeData,offsetSection4; - unsigned char* buffer = NULL; - long maxWidth,maxLength,widthOfWidths,NL,widthOfLengths,N1,N2,extraValues,codedNumberOfGroups,numberOfSecondOrderPackedValues; + long incrementGroupLengthA, groupWidthA, prevGroupLength, offsetD, remainingValuesB, groupLengthB; + long maxB, minB, maxAB, minAB; + long offsetBeforeData, offsetSection4; + unsigned char* buffer = NULL; + long maxWidth, maxLength, widthOfWidths, NL, widthOfLengths, N1, N2, extraValues, codedNumberOfGroups, numberOfSecondOrderPackedValues; long pos; long numberOfGroups; - long groupLengthC,groupLengthA,remainingValues,count; - long maxA=0,minA=0; - long maxC,minC,offsetC; - long maxAC,minAC; - long range,bias=0,maxSPD; - long firstOrderValuesMax,offset,groupLength,j,groupWidth,firstOrderValue,lengthOfSecondOrderValues; - long *groupLengths,*groupWidths,*firstOrderValues; + long groupLengthC, groupLengthA, remainingValues, count; + long maxA = 0, minA = 0; + long maxC, minC, offsetC; + long maxAC, minAC; + long range, bias = 0, maxSPD; + long firstOrderValuesMax, offset, groupLength, j, groupWidth, firstOrderValue, lengthOfSecondOrderValues; + long *groupLengths, *groupWidths, *firstOrderValues; /* long groupLengths[MAX_NUMBER_OF_GROUPS],groupWidths[MAX_NUMBER_OF_GROUPS],firstOrderValues[MAX_NUMBER_OF_GROUPS]; */ /* TODO put these parameters in def file */ - long startGroupLength=15; - long incrementGroupLength=3; - long minGroupLength=3; - long widthOfSPD=0,widthOfBias=0; - long *offsets; + long startGroupLength = 15; + long incrementGroupLength = 3; + long minGroupLength = 3; + long widthOfSPD = 0, widthOfBias = 0; + long* offsets; long widthOfFirstOrderValues; - int computeGroupA=1; - long dataHeadersLength,widthsLength,lengthsLength,firstOrderValuesLength; + int computeGroupA = 1; + long dataHeadersLength, widthsLength, lengthsLength, firstOrderValuesLength; long decimal_scale_factor; - grib_handle* handle = grib_handle_of_accessor(a); + grib_handle* handle = grib_handle_of_accessor(a); long optimize_scaling_factor = 0; - self->dirty=1; + self->dirty = 1; - numberOfValues=*len; + numberOfValues = *len; min = max = val[0]; - for(i=1;i< numberOfValues;i++) { - if (val[i] > max ) max = val[i]; - else if (val[i] < min ) min = val[i]; + for (i = 1; i < numberOfValues; i++) { + if (val[i] > max) + max = val[i]; + else if (val[i] < min) + min = val[i]; } - if ((ret=grib_get_long_internal(handle,self->bits_per_value,&bits_per_value)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(handle, self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) return ret; - if ((ret = grib_get_long_internal(handle,self->optimize_scaling_factor, &optimize_scaling_factor)) - != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(handle, self->optimize_scaling_factor, &optimize_scaling_factor)) != GRIB_SUCCESS) return ret; - if (optimize_scaling_factor) - { - const int compat_gribex = handle->context->gribex_mode_on && self->edition==1; - const int compat_32bit = 1; - if((ret=grib_optimize_decimal_factor (a, self->reference_value, - max, min, bits_per_value, - compat_gribex, compat_32bit, - &decimal_scale_factor, &binary_scale_factor, &reference_value)) != GRIB_SUCCESS) + if (optimize_scaling_factor) { + const int compat_gribex = handle->context->gribex_mode_on && self->edition == 1; + const int compat_32bit = 1; + if ((ret = grib_optimize_decimal_factor(a, self->reference_value, + max, min, bits_per_value, + compat_gribex, compat_32bit, + &decimal_scale_factor, &binary_scale_factor, &reference_value)) != GRIB_SUCCESS) return ret; - decimal = grib_power(decimal_scale_factor,10); - divisor = grib_power(-binary_scale_factor,2); - min = min * decimal; - max = max * decimal; + decimal = grib_power(decimal_scale_factor, 10); + divisor = grib_power(-binary_scale_factor, 2); + min = min * decimal; + max = max * decimal; - if((ret = grib_set_long_internal(handle,self->decimal_scale_factor, decimal_scale_factor)) != - GRIB_SUCCESS) + if ((ret = grib_set_long_internal(handle, self->decimal_scale_factor, decimal_scale_factor)) != + GRIB_SUCCESS) return ret; } - else - { + else { /* For constant fields set decimal scale factor to 0 (See GRIB-165) */ - if (min==max) { - grib_set_long_internal(handle,self->decimal_scale_factor, 0); + if (min == max) { + grib_set_long_internal(handle, self->decimal_scale_factor, 0); } - if((ret = grib_get_long_internal(handle,self->decimal_scale_factor, &decimal_scale_factor)) - != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(handle, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) return ret; - decimal = grib_power(decimal_scale_factor,10); - min = min * decimal; - max = max * decimal; + decimal = grib_power(decimal_scale_factor, 10); + min = min * decimal; + max = max * decimal; - if (grib_get_nearest_smaller_value(handle,self->reference_value,min,&reference_value) - !=GRIB_SUCCESS) { - grib_context_log(a->context,GRIB_LOG_ERROR, - "unable to find nearest_smaller_value of %g for %s",min,self->reference_value); + if (grib_get_nearest_smaller_value(handle, self->reference_value, min, &reference_value) != GRIB_SUCCESS) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "unable to find nearest_smaller_value of %g for %s", min, self->reference_value); return GRIB_INTERNAL_ERROR; } - binary_scale_factor = grib_get_binary_scale_fact(max,reference_value,bits_per_value,&ret); + binary_scale_factor = grib_get_binary_scale_fact(max, reference_value, bits_per_value, &ret); - divisor = grib_power(-binary_scale_factor,2); + divisor = grib_power(-binary_scale_factor, 2); } - if((ret = grib_set_long_internal(handle,self->binary_scale_factor, binary_scale_factor)) != - GRIB_SUCCESS) + if ((ret = grib_set_long_internal(handle, self->binary_scale_factor, binary_scale_factor)) != + GRIB_SUCCESS) return ret; - if((ret = grib_set_double_internal(handle,self->reference_value, reference_value)) != - GRIB_SUCCESS) + if ((ret = grib_set_double_internal(handle, self->reference_value, reference_value)) != + GRIB_SUCCESS) return ret; - if((ret=grib_get_long_internal(handle,self->offsetdata,&offsetBeforeData)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(handle, self->offsetdata, &offsetBeforeData)) != GRIB_SUCCESS) return ret; - if((ret=grib_get_long_internal(handle,self->offsetsection,&offsetSection4)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(handle, self->offsetsection, &offsetSection4)) != GRIB_SUCCESS) return ret; - if((ret=grib_get_long_internal(handle,self->orderOfSPD,&orderOfSPD)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(handle, self->orderOfSPD, &orderOfSPD)) != GRIB_SUCCESS) return ret; - X=(long*)grib_context_malloc_clear(a->context,sizeof(long)*numberOfValues); - for(i=0;i< numberOfValues;i++){ - X[i] = (((val[i]*decimal)-reference_value)*divisor)+0.5; + X = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfValues); + for (i = 0; i < numberOfValues; i++) { + X[i] = (((val[i] * decimal) - reference_value) * divisor) + 0.5; } - groupLengths=(long*)grib_context_malloc_clear(a->context,sizeof(long)*numberOfValues); - groupWidths=(long*)grib_context_malloc_clear(a->context,sizeof(long)*numberOfValues); - firstOrderValues=(long*)grib_context_malloc_clear(a->context,sizeof(long)*numberOfValues); + groupLengths = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfValues); + groupWidths = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfValues); + firstOrderValues = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfValues); /* spatial differencing */ switch (orderOfSPD) { - case 1: - for (i=numberOfValues-1;i>0;i--) { - X[i]-=X[i-1]; - } - break; - case 2: - for (i=numberOfValues-1;i>1;i--) { - X[i]-=2*X[i-1]-X[i-2]; - } - break; - case 3: - for (i=numberOfValues-1;i>2;i--) { - X[i]-=3*(X[i-1]-X[i-2])+X[i-3]; - } - break; + case 1: + for (i = numberOfValues - 1; i > 0; i--) { + X[i] -= X[i - 1]; + } + break; + case 2: + for (i = numberOfValues - 1; i > 1; i--) { + X[i] -= 2 * X[i - 1] - X[i - 2]; + } + break; + case 3: + for (i = numberOfValues - 1; i > 2; i--) { + X[i] -= 3 * (X[i - 1] - X[i - 2]) + X[i - 3]; + } + break; } if (orderOfSPD) { - Assert(orderOfSPD >=0 && orderOfSPD < numberOfValues); - bias=X[orderOfSPD]; - for (i=orderOfSPD+1;i X[i] ) bias=X[i]; + Assert(orderOfSPD >= 0 && orderOfSPD < numberOfValues); + bias = X[orderOfSPD]; + for (i = orderOfSPD + 1; i < numberOfValues; i++) { + if (bias > X[i]) + bias = X[i]; } - for (i=orderOfSPD;iX[count+i]) minA=X[count+i]; + maxA = X[count]; + minA = X[count]; + for (i = 1; i < groupLengthA; i++) { + DebugAssertAccess(X, count + i, numberOfValues); + if (maxA < X[count + i]) + maxA = X[count + i]; + if (minA > X[count + i]) + minA = X[count + i]; } } - groupWidthA=number_of_bits(handle, maxA-minA); - range=(long)grib_power(groupWidthA,2)-1; + groupWidthA = number_of_bits(handle, maxA - minA); + range = (long)grib_power(groupWidthA, 2) - 1; - offsetC=count+groupLengthA; - if (offsetC==numberOfValues) { + offsetC = count + groupLengthA; + if (offsetC == numberOfValues) { /* no more values close group A and end loop */ - groupLengths[numberOfGroups]=groupLengthA; - groupWidths[numberOfGroups]=groupWidthA; + groupLengths[numberOfGroups] = groupLengthA; + groupWidths[numberOfGroups] = groupWidthA; /* firstOrderValues[numberOfGroups]=minA; */ /* to optimise the width of first order variable */ - firstOrderValues[numberOfGroups] = maxA-range > 0 ? maxA-range : 0; + firstOrderValues[numberOfGroups] = maxA - range > 0 ? maxA - range : 0; numberOfGroups++; break; } @@ -1428,67 +1448,72 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) /* group C created with length=incrementGroupLength (fixed) or remaining values if close to end */ - groupLengthC=incrementGroupLength; - if ( groupLengthC + offsetC > numberOfValues - startGroupLength/2) { - groupLengthC=numberOfValues-offsetC; + groupLengthC = incrementGroupLength; + if (groupLengthC + offsetC > numberOfValues - startGroupLength / 2) { + groupLengthC = numberOfValues - offsetC; } - maxC=X[offsetC]; - minC=X[offsetC]; - for (i=1;iX[offsetC+i]) minC=X[offsetC+i]; + maxC = X[offsetC]; + minC = X[offsetC]; + for (i = 1; i < groupLengthC; i++) { + DebugAssertAccess(X, offsetC + i, numberOfValues); + if (maxC < X[offsetC + i]) + maxC = X[offsetC + i]; + if (minC > X[offsetC + i]) + minC = X[offsetC + i]; } - maxAC= maxA > maxC ? maxA : maxC; - minAC= minA < minC ? minA : minC; + maxAC = maxA > maxC ? maxA : maxC; + minAC = minA < minC ? minA : minC; /* check if A+C can be represented with the same width as A*/ - if (maxAC-minAC > range) { + if (maxAC - minAC > range) { /* A could not be expanded adding C. Check if A could be expanded taking some elements from preceding group. The condition is always that width of A doesn't increase. */ - if (numberOfGroups>0 && groupWidths[numberOfGroups-1] > groupWidthA ) { - prevGroupLength=groupLengths[numberOfGroups-1]-incrementGroupLength; - offsetC=count-incrementGroupLength; + if (numberOfGroups > 0 && groupWidths[numberOfGroups - 1] > groupWidthA) { + prevGroupLength = groupLengths[numberOfGroups - 1] - incrementGroupLength; + offsetC = count - incrementGroupLength; /* preceding group length cannot be less than a minimum value */ while (prevGroupLength >= minGroupLength) { - maxAC=maxA; - minAC=minA; - for (i=0;iX[offsetC+i]) minAC=X[offsetC+i]; + maxAC = maxA; + minAC = minA; + for (i = 0; i < incrementGroupLength; i++) { + if (maxAC < X[offsetC + i]) + maxAC = X[offsetC + i]; + if (minAC > X[offsetC + i]) + minAC = X[offsetC + i]; } /* no more elements can be transfered, exit loop*/ - if (maxAC-minAC > range) break; - - maxA=maxAC; - minA=minAC; - groupLengths[numberOfGroups-1]-=incrementGroupLength; - groupLengthA+=incrementGroupLength; - count-=incrementGroupLength; - remainingValues+=incrementGroupLength; - - offsetC-=incrementGroupLength; - prevGroupLength-=incrementGroupLength; + if (maxAC - minAC > range) + break; + + maxA = maxAC; + minA = minAC; + groupLengths[numberOfGroups - 1] -= incrementGroupLength; + groupLengthA += incrementGroupLength; + count -= incrementGroupLength; + remainingValues += incrementGroupLength; + + offsetC -= incrementGroupLength; + prevGroupLength -= incrementGroupLength; } } /* close group A*/ - groupLengths[numberOfGroups]=groupLengthA; - groupWidths[numberOfGroups]=groupWidthA; + groupLengths[numberOfGroups] = groupLengthA; + groupWidths[numberOfGroups] = groupWidthA; /* firstOrderValues[numberOfGroups]=minA; */ /* to optimise the width of first order variable */ - firstOrderValues[numberOfGroups] = maxA-range > 0 ? maxA-range : 0; - count+=groupLengthA; - remainingValues-=groupLengthA; + firstOrderValues[numberOfGroups] = maxA - range > 0 ? maxA - range : 0; + count += groupLengthA; + remainingValues -= groupLengthA; numberOfGroups++; /* incrementGroupLengthA is reset to the fixed startGroupLength as it could have been changed after the A+C or A+B ok condition. */ - incrementGroupLengthA=startGroupLength; - computeGroupA=1; + incrementGroupLengthA = startGroupLength; + computeGroupA = 1; #if 0 if (numberOfGroups==MAX_NUMBER_OF_GROUPS) { groupLengthA= remainingValues ; @@ -1510,15 +1535,15 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) } /* A+C could be coded with the same width as A*/ - offsetD=offsetC+groupLengthC; - if (offsetD==numberOfValues) { - groupLengths[numberOfGroups]=groupLengthA+groupLengthC; - groupWidths[numberOfGroups]=groupWidthA; + offsetD = offsetC + groupLengthC; + if (offsetD == numberOfValues) { + groupLengths[numberOfGroups] = groupLengthA + groupLengthC; + groupWidths[numberOfGroups] = groupWidthA; /* range of AC is the same as A*/ /* firstOrderValues[numberOfGroups]=minAC; */ /* to optimise the width of first order variable */ - firstOrderValues[numberOfGroups] = maxAC-range > 0 ? maxAC-range : 0; + firstOrderValues[numberOfGroups] = maxAC - range > 0 ? maxAC - range : 0; numberOfGroups++; break; } @@ -1526,18 +1551,19 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) /* group B is created with length startGroupLength, starting at the same offset as C. */ - remainingValuesB=numberOfValues-offsetC; - groupLengthB= startGroupLength < remainingValuesB ? startGroupLength : remainingValuesB ; - maxB=maxC; - minB=minC; - for (i=groupLengthC;iX[offsetC+i]) minB=X[offsetC+i]; + remainingValuesB = numberOfValues - offsetC; + groupLengthB = startGroupLength < remainingValuesB ? startGroupLength : remainingValuesB; + maxB = maxC; + minB = minC; + for (i = groupLengthC; i < groupLengthB; i++) { + if (maxB < X[offsetC + i]) + maxB = X[offsetC + i]; + if (minB > X[offsetC + i]) + minB = X[offsetC + i]; } /* check if group B can be coded with a smaller width than A */ - if (maxB-minB <= range/2 && range>0 ) { - + if (maxB - minB <= range / 2 && range > 0) { /* TODO Add code to try if A can be expanded taking some elements from the left (preceding) group. A possible variation is to do this left check (and the previous one) @@ -1545,13 +1571,13 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) */ /* close group A and continue loop*/ - groupLengths[numberOfGroups]=groupLengthA; - groupWidths[numberOfGroups]=groupWidthA; + groupLengths[numberOfGroups] = groupLengthA; + groupWidths[numberOfGroups] = groupWidthA; /* firstOrderValues[numberOfGroups]=minA; */ /* to optimise the width of first order variable */ - firstOrderValues[numberOfGroups] = maxA-range > 0 ? maxA-range : 0; - count+=groupLengthA; - remainingValues-=groupLengthA; + firstOrderValues[numberOfGroups] = maxA - range > 0 ? maxA - range : 0; + count += groupLengthA; + remainingValues -= groupLengthA; numberOfGroups++; #if 0 if (numberOfGroups==MAX_NUMBER_OF_GROUPS) { @@ -1570,137 +1596,147 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) break; } #endif - incrementGroupLengthA=startGroupLength; - computeGroupA=1; + incrementGroupLengthA = startGroupLength; + computeGroupA = 1; continue; } /* check if A+B can be coded with same with as A */ - maxAB= maxA > maxB ? maxA : maxB; - minAB= minA < minB ? minA : minB; - if (maxAB-minAB <= range) { + maxAB = maxA > maxB ? maxA : maxB; + minAB = minA < minB ? minA : minB; + if (maxAB - minAB <= range) { /* A+B can be merged. The increment used at the beginning of the loop to build group C is increased to the size of group B */ - incrementGroupLengthA+=groupLengthB; - maxA=maxAB; - minA=minAB; - computeGroupA=0; + incrementGroupLengthA += groupLengthB; + maxA = maxAB; + minA = minAB; + computeGroupA = 0; continue; } /* A+B cannot be merged, A+C can be merged*/ - incrementGroupLengthA+=groupLengthC; - computeGroupA=1; + incrementGroupLengthA += groupLengthC; + computeGroupA = 1; } /* end of the while*/ /* computing bitsPerValue as the number of bits needed to represent the firstOrderValues. */ - max=firstOrderValues[0]; - min=firstOrderValues[0]; - for (i=1;ifirstOrderValues[i]) min=firstOrderValues[i]; + max = firstOrderValues[0]; + min = firstOrderValues[0]; + for (i = 1; i < numberOfGroups; i++) { + if (max < firstOrderValues[i]) + max = firstOrderValues[i]; + if (min > firstOrderValues[i]) + min = firstOrderValues[i]; } - widthOfFirstOrderValues=number_of_bits(handle, max-min); - firstOrderValuesMax=(long)grib_power(widthOfFirstOrderValues,2)-1; + widthOfFirstOrderValues = number_of_bits(handle, max - min); + firstOrderValuesMax = (long)grib_power(widthOfFirstOrderValues, 2) - 1; - if (numberOfGroups>2) { + if (numberOfGroups > 2) { /* loop through all the groups except the last in reverse order to check if each group width is still appropriate for the group. Focus on groups which have been shrank as left groups of an A group taking some of their elements. */ - offsets=(long*)grib_context_malloc_clear(a->context,sizeof(long)*numberOfGroups); - offsets[0]=orderOfSPD; - for (i=1;i=0;i--) { - offset=offsets[i]; - groupLength=groupLengths[i]; - - if (groupLength >= startGroupLength) continue; - - max=X[offset]; - min=X[offset]; - for (j=1;jX[offset+j]) min=X[offset+j]; + offsets = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfGroups); + offsets[0] = orderOfSPD; + for (i = 1; i < numberOfGroups; i++) + offsets[i] = offsets[i - 1] + groupLengths[i - 1]; + for (i = numberOfGroups - 2; i >= 0; i--) { + offset = offsets[i]; + groupLength = groupLengths[i]; + + if (groupLength >= startGroupLength) + continue; + + max = X[offset]; + min = X[offset]; + for (j = 1; j < groupLength; j++) { + if (max < X[offset + j]) + max = X[offset + j]; + if (min > X[offset + j]) + min = X[offset + j]; } - groupWidth=number_of_bits(handle, max-min); - range=(long)grib_power(groupWidth,2)-1; + groupWidth = number_of_bits(handle, max - min); + range = (long)grib_power(groupWidth, 2) - 1; /* width of first order values has to be unchanged.*/ - for (j=groupWidth;jrange ? max-range : 0; - if (firstOrderValue <= firstOrderValuesMax ) { - groupWidths[i]=j; - firstOrderValues[i]=firstOrderValue; + for (j = groupWidth; j < groupWidths[i]; j++) { + firstOrderValue = max > range ? max - range : 0; + if (firstOrderValue <= firstOrderValuesMax) { + groupWidths[i] = j; + firstOrderValues[i] = firstOrderValue; break; } } - offsetC=offset; + offsetC = offset; /* group width of the current group (i) can have been reduced and it is worth to try to expand the group to get some elements from the left group if it has bigger width. */ - if (i>0 && (groupWidths[i-1] > groupWidths[i]) ) { - prevGroupLength=groupLengths[i-1]-incrementGroupLength; - offsetC-=incrementGroupLength; + if (i > 0 && (groupWidths[i - 1] > groupWidths[i])) { + prevGroupLength = groupLengths[i - 1] - incrementGroupLength; + offsetC -= incrementGroupLength; while (prevGroupLength >= minGroupLength) { - for (j=0;jX[offsetC+j]) min=X[offsetC+j]; + for (j = 0; j < incrementGroupLength; j++) { + if (max < X[offsetC + j]) + max = X[offsetC + j]; + if (min > X[offsetC + j]) + min = X[offsetC + j]; } /* width of first order values has to be unchanged*/ - firstOrderValue=max>range ? max-range : 0; - if (max-min > range || firstOrderValue > firstOrderValuesMax ) break; + firstOrderValue = max > range ? max - range : 0; + if (max - min > range || firstOrderValue > firstOrderValuesMax) + break; - groupLengths[i-1]-=incrementGroupLength; - groupLengths[i]+=incrementGroupLength; - firstOrderValues[i]=firstOrderValue; + groupLengths[i - 1] -= incrementGroupLength; + groupLengths[i] += incrementGroupLength; + firstOrderValues[i] = firstOrderValue; - offsetC-=incrementGroupLength; - prevGroupLength-=incrementGroupLength; + offsetC -= incrementGroupLength; + prevGroupLength -= incrementGroupLength; } } - } - grib_context_free(a->context,offsets); + grib_context_free(a->context, offsets); } - maxWidth=groupWidths[0]; - maxLength=groupLengths[0]; - for (i=1;iparent->h->context, GRIB_LOG_ERROR, "Cannot compute parameters for second order packing."); return GRIB_ENCODING_ERROR; } - widthOfWidths=number_of_bits(handle, maxWidth); - widthOfLengths=number_of_bits(handle, maxLength); + widthOfWidths = number_of_bits(handle, maxWidth); + widthOfLengths = number_of_bits(handle, maxLength); - lengthOfSecondOrderValues=0; - for ( i=0; icontext->no_big_group_split) { - grib_split_long_groups(handle, a->context,&numberOfGroups,&lengthOfSecondOrderValues, - groupLengths,&widthOfLengths,groupWidths,widthOfWidths, - firstOrderValues,widthOfFirstOrderValues); + grib_split_long_groups(handle, a->context, &numberOfGroups, &lengthOfSecondOrderValues, + groupLengths, &widthOfLengths, groupWidths, widthOfWidths, + firstOrderValues, widthOfFirstOrderValues); } - Xp=X+orderOfSPD; - for ( i=0; iwidthOfSPD, widthOfSPD)) - != GRIB_SUCCESS) + if ((ret = grib_set_long_internal(handle, self->widthOfSPD, widthOfSPD)) != GRIB_SUCCESS) return ret; } /* end writing SPD */ - if((ret = grib_set_long_internal(handle,self->widthOfFirstOrderValues, widthOfFirstOrderValues)) - != GRIB_SUCCESS) + if ((ret = grib_set_long_internal(handle, self->widthOfFirstOrderValues, widthOfFirstOrderValues)) != GRIB_SUCCESS) return ret; - dataHeadersLength=25; - if (orderOfSPD) dataHeadersLength+=1+((orderOfSPD+1)*widthOfSPD+7)/8; - widthsLength=(widthOfWidths*numberOfGroups+7)/8; - lengthsLength=(widthOfLengths*numberOfGroups+7)/8; - firstOrderValuesLength=(widthOfFirstOrderValues*numberOfGroups+7)/8; - - NL=widthsLength+dataHeadersLength+1; - N1=NL+lengthsLength; - N2=N1+firstOrderValuesLength; - - NL= NL > 65535 ? 65535 : NL; - N2= N2 > 65535 ? 65535 : N2; - N1= N1 > 65535 ? 65535 : N1; - - grib_set_long(handle,self->NL, NL); - grib_set_long(handle,self->N1, N1); - grib_set_long(handle,self->N2, N2); - - if (numberOfGroups > 65535 ) { - extraValues=numberOfGroups/65536; - codedNumberOfGroups=numberOfGroups%65536; - } else { - extraValues=0; - codedNumberOfGroups=numberOfGroups; + dataHeadersLength = 25; + if (orderOfSPD) + dataHeadersLength += 1 + ((orderOfSPD + 1) * widthOfSPD + 7) / 8; + widthsLength = (widthOfWidths * numberOfGroups + 7) / 8; + lengthsLength = (widthOfLengths * numberOfGroups + 7) / 8; + firstOrderValuesLength = (widthOfFirstOrderValues * numberOfGroups + 7) / 8; + + NL = widthsLength + dataHeadersLength + 1; + N1 = NL + lengthsLength; + N2 = N1 + firstOrderValuesLength; + + NL = NL > 65535 ? 65535 : NL; + N2 = N2 > 65535 ? 65535 : N2; + N1 = N1 > 65535 ? 65535 : N1; + + grib_set_long(handle, self->NL, NL); + grib_set_long(handle, self->N1, N1); + grib_set_long(handle, self->N2, N2); + + if (numberOfGroups > 65535) { + extraValues = numberOfGroups / 65536; + codedNumberOfGroups = numberOfGroups % 65536; + } + else { + extraValues = 0; + codedNumberOfGroups = numberOfGroups; } /* if no extraValues key present it is a GRIB2*/ - grib2=0; - if((ret = grib_set_long(handle,self->extraValues, extraValues)) != GRIB_SUCCESS) { - codedNumberOfGroups=numberOfGroups; - grib2=1; + grib2 = 0; + if ((ret = grib_set_long(handle, self->extraValues, extraValues)) != GRIB_SUCCESS) { + codedNumberOfGroups = numberOfGroups; + grib2 = 1; } - if((ret = grib_set_long_internal(handle,self->codedNumberOfGroups, codedNumberOfGroups)) != GRIB_SUCCESS) + if ((ret = grib_set_long_internal(handle, self->codedNumberOfGroups, codedNumberOfGroups)) != GRIB_SUCCESS) return ret; - numberOfSecondOrderPackedValues=numberOfValues-orderOfSPD; - if (!grib2 && numberOfSecondOrderPackedValues > 65535 ) - numberOfSecondOrderPackedValues= 65535; + numberOfSecondOrderPackedValues = numberOfValues - orderOfSPD; + if (!grib2 && numberOfSecondOrderPackedValues > 65535) + numberOfSecondOrderPackedValues = 65535; - if((ret = grib_set_long_internal(handle,self->numberOfSecondOrderPackedValues, numberOfSecondOrderPackedValues)) - != GRIB_SUCCESS) + if ((ret = grib_set_long_internal(handle, self->numberOfSecondOrderPackedValues, numberOfSecondOrderPackedValues)) != GRIB_SUCCESS) return ret; if (grib2) { - if((ret = grib_set_long_internal(handle,self->bits_per_value, bits_per_value)) != GRIB_SUCCESS) + if ((ret = grib_set_long_internal(handle, self->bits_per_value, bits_per_value)) != GRIB_SUCCESS) return ret; - } else { - if((ret = grib_set_long_internal(handle,self->bits_per_value, 0)) != GRIB_SUCCESS) + } + else { + if ((ret = grib_set_long_internal(handle, self->bits_per_value, 0)) != GRIB_SUCCESS) return ret; } - if((ret = grib_set_long_internal(handle,self->widthOfWidths, widthOfWidths)) != GRIB_SUCCESS) + if ((ret = grib_set_long_internal(handle, self->widthOfWidths, widthOfWidths)) != GRIB_SUCCESS) return ret; - if((ret = grib_set_long_internal(handle,self->widthOfLengths, widthOfLengths)) != GRIB_SUCCESS) + if ((ret = grib_set_long_internal(handle, self->widthOfLengths, widthOfLengths)) != GRIB_SUCCESS) return ret; - lengthOfSecondOrderValues=0; - for ( i=0; ihalf_byte, half_byte)) != GRIB_SUCCESS) + size = (size + offsetBeforeData - offsetSection4) % 2 ? size + 1 : size; + half_byte = 8 * size - sizebits; + if ((ret = grib_set_long_internal(handle, self->half_byte, half_byte)) != GRIB_SUCCESS) return ret; - buffer=(unsigned char*)grib_context_malloc_clear(a->context,size); + buffer = (unsigned char*)grib_context_malloc_clear(a->context, size); - pos=0; + pos = 0; if (orderOfSPD) { - long SPD[4]={0,}; - size_t nSPD=orderOfSPD+1; - Assert(orderOfSPD<=3); - for (i=0;iSPD,SPD,nSPD); - if(ret) return ret; + long SPD[4] = {0,}; + size_t nSPD = orderOfSPD + 1; + Assert(orderOfSPD <= 3); + for (i = 0; i < orderOfSPD; i++) + SPD[i] = X[i]; + SPD[orderOfSPD] = bias; + ret = grib_set_long_array_internal(handle, self->SPD, SPD, nSPD); + if (ret) + return ret; } - ret=grib_set_long_array_internal(handle,self->groupWidths,groupWidths,(size_t)numberOfGroups); - if(ret) return ret; + ret = grib_set_long_array_internal(handle, self->groupWidths, groupWidths, (size_t)numberOfGroups); + if (ret) + return ret; - ret=grib_set_long_array_internal(handle,self->groupLengths,groupLengths,(size_t)numberOfGroups); - if(ret) return ret; + ret = grib_set_long_array_internal(handle, self->groupLengths, groupLengths, (size_t)numberOfGroups); + if (ret) + return ret; - ret=grib_set_long_array_internal(handle,self->firstOrderValues,firstOrderValues,(size_t)numberOfGroups); - if(ret) return ret; + ret = grib_set_long_array_internal(handle, self->firstOrderValues, firstOrderValues, (size_t)numberOfGroups); + if (ret) + return ret; - Xp=X+orderOfSPD; - pos=0; - count=0; - for (i=0;i0) { - for (j=0;j 0) { + for (j = 0; j < groupLengths[i]; j++) { #if EFDEBUG - printf("CXXXXX %ld %ld %ld %ld\n",count,*Xp,groupWidths[i],groupLengths[i]); + printf("CXXXXX %ld %ld %ld %ld\n", count, *Xp, groupWidths[i], groupLengths[i]); count++; #endif - grib_encode_unsigned_longb(buffer,*(Xp++),&pos,groupWidths[i]); + grib_encode_unsigned_longb(buffer, *(Xp++), &pos, groupWidths[i]); } - } else { - Xp+=groupLengths[i]; + } + else { + Xp += groupLengths[i]; #if EFDEBUG - count+=groupLengths[i]; + count += groupLengths[i]; #endif } } /* ECC-259: Set correct number of values */ - ret=grib_set_long_internal(a->parent->h,self->number_of_values, *len); - if(ret) return ret; + ret = grib_set_long_internal(a->parent->h, self->number_of_values, *len); + if (ret) + return ret; - grib_buffer_replace(a, buffer, size,1,1); + grib_buffer_replace(a, buffer, size, 1, 1); - grib_context_free(a->context,buffer); - grib_context_free(a->context,X); - grib_context_free(a->context,groupLengths); - grib_context_free(a->context,groupWidths); - grib_context_free(a->context,firstOrderValues); + grib_context_free(a->context, buffer); + grib_context_free(a->context, X); + grib_context_free(a->context, groupLengths); + grib_context_free(a->context, groupWidths); + grib_context_free(a->context, firstOrderValues); return ret; } -static void destroy(grib_context* context,grib_accessor* a) +static void destroy(grib_context* context, grib_accessor* a) { - grib_accessor_data_g1second_order_general_extended_packing *self =(grib_accessor_data_g1second_order_general_extended_packing*)a; + grib_accessor_data_g1second_order_general_extended_packing* self = (grib_accessor_data_g1second_order_general_extended_packing*)a; if (self->values != NULL) { grib_context_free(context, self->values); - self->values=NULL; + self->values = NULL; } } diff --git a/src/grib_accessor_class_data_g1second_order_general_packing.c b/src/grib_accessor_class_data_g1second_order_general_packing.c index 58a052a56..f458fbb8f 100644 --- a/src/grib_accessor_class_data_g1second_order_general_packing.c +++ b/src/grib_accessor_class_data_g1second_order_general_packing.c @@ -51,94 +51,95 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_data_g1second_order_general_packing { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in values */ - int carg; - const char* seclen; - const char* offsetdata; - const char* offsetsection; - int dirty; -/* Members defined in data_simple_packing */ - int edition; - const char* units_factor; - const char* units_bias; - const char* changing_precision; - const char* number_of_values; - const char* bits_per_value; - const char* reference_value; - const char* binary_scale_factor; - const char* decimal_scale_factor; - const char* optimize_scaling_factor; -/* Members defined in data_g1second_order_general_packing */ - const char* half_byte; - const char* packingType; - const char* ieee_packing; - const char* precision; - const char* widthOfFirstOrderValues; - const char* N1; - const char* N2; - const char* numberOfGroups; - const char* numberOfSecondOrderPackedValues; - const char* extraValues; - const char* pl; - const char* Ni; - const char* Nj; - const char* jPointsAreConsecutive; - const char* bitmap; - const char* groupWidths; +typedef struct grib_accessor_data_g1second_order_general_packing +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in values */ + int carg; + const char* seclen; + const char* offsetdata; + const char* offsetsection; + int dirty; + /* Members defined in data_simple_packing */ + int edition; + const char* units_factor; + const char* units_bias; + const char* changing_precision; + const char* number_of_values; + const char* bits_per_value; + const char* reference_value; + const char* binary_scale_factor; + const char* decimal_scale_factor; + const char* optimize_scaling_factor; + /* Members defined in data_g1second_order_general_packing */ + const char* half_byte; + const char* packingType; + const char* ieee_packing; + const char* precision; + const char* widthOfFirstOrderValues; + const char* N1; + const char* N2; + const char* numberOfGroups; + const char* numberOfSecondOrderPackedValues; + const char* extraValues; + const char* pl; + const char* Ni; + const char* Nj; + const char* jPointsAreConsecutive; + const char* bitmap; + const char* groupWidths; } grib_accessor_data_g1second_order_general_packing; extern grib_accessor_class* grib_accessor_class_data_simple_packing; static grib_accessor_class _grib_accessor_class_data_g1second_order_general_packing = { - &grib_accessor_class_data_simple_packing, /* super */ - "data_g1second_order_general_packing", /* name */ - sizeof(grib_accessor_data_g1second_order_general_packing), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_data_simple_packing, /* super */ + "data_g1second_order_general_packing", /* name */ + sizeof(grib_accessor_data_g1second_order_general_packing), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -147,181 +148,186 @@ grib_accessor_class* grib_accessor_class_data_g1second_order_general_packing = & static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long v, grib_arguments* args) +static void init(grib_accessor* a, const long v, grib_arguments* args) { - grib_accessor_data_g1second_order_general_packing *self =(grib_accessor_data_g1second_order_general_packing*)a; - grib_handle* hand = grib_handle_of_accessor(a); - - self->half_byte = grib_arguments_get_name(hand,args,self->carg++); - self->packingType = grib_arguments_get_name(hand,args,self->carg++); - self->ieee_packing = grib_arguments_get_name(hand,args,self->carg++); - self->precision = grib_arguments_get_name(hand,args,self->carg++); - self->widthOfFirstOrderValues = grib_arguments_get_name(hand,args,self->carg++); - self->N1 = grib_arguments_get_name(hand,args,self->carg++); - self->N2 = grib_arguments_get_name(hand,args,self->carg++); - self->numberOfGroups = grib_arguments_get_name(hand,args,self->carg++); - self->numberOfSecondOrderPackedValues = grib_arguments_get_name(hand,args,self->carg++); - self->extraValues = grib_arguments_get_name(hand,args,self->carg++); - self->Ni = grib_arguments_get_name(hand,args,self->carg++); - self->Nj = grib_arguments_get_name(hand,args,self->carg++); - self->pl = grib_arguments_get_name(hand,args,self->carg++); - self->jPointsAreConsecutive = grib_arguments_get_name(hand,args,self->carg++); - self->bitmap = grib_arguments_get_name(hand,args,self->carg++); - self->groupWidths = grib_arguments_get_name(hand,args,self->carg++); - self->edition=1; + grib_accessor_data_g1second_order_general_packing* self = (grib_accessor_data_g1second_order_general_packing*)a; + grib_handle* hand = grib_handle_of_accessor(a); + + self->half_byte = grib_arguments_get_name(hand, args, self->carg++); + self->packingType = grib_arguments_get_name(hand, args, self->carg++); + self->ieee_packing = grib_arguments_get_name(hand, args, self->carg++); + self->precision = grib_arguments_get_name(hand, args, self->carg++); + self->widthOfFirstOrderValues = grib_arguments_get_name(hand, args, self->carg++); + self->N1 = grib_arguments_get_name(hand, args, self->carg++); + self->N2 = grib_arguments_get_name(hand, args, self->carg++); + self->numberOfGroups = grib_arguments_get_name(hand, args, self->carg++); + self->numberOfSecondOrderPackedValues = grib_arguments_get_name(hand, args, self->carg++); + self->extraValues = grib_arguments_get_name(hand, args, self->carg++); + self->Ni = grib_arguments_get_name(hand, args, self->carg++); + self->Nj = grib_arguments_get_name(hand, args, self->carg++); + self->pl = grib_arguments_get_name(hand, args, self->carg++); + self->jPointsAreConsecutive = grib_arguments_get_name(hand, args, self->carg++); + self->bitmap = grib_arguments_get_name(hand, args, self->carg++); + self->groupWidths = grib_arguments_get_name(hand, args, self->carg++); + self->edition = 1; a->flags |= GRIB_ACCESSOR_FLAG_DATA; } -static int value_count(grib_accessor* a,long* numberOfSecondOrderPackedValues) +static int value_count(grib_accessor* a, long* numberOfSecondOrderPackedValues) { - int err=0; - grib_accessor_data_g1second_order_general_packing *self =(grib_accessor_data_g1second_order_general_packing*)a; - *numberOfSecondOrderPackedValues=0; + int err = 0; + grib_accessor_data_g1second_order_general_packing* self = (grib_accessor_data_g1second_order_general_packing*)a; + *numberOfSecondOrderPackedValues = 0; - err=grib_get_long_internal(grib_handle_of_accessor(a),self->numberOfSecondOrderPackedValues,numberOfSecondOrderPackedValues); + err = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfSecondOrderPackedValues, numberOfSecondOrderPackedValues); return err; } -static int unpack_double(grib_accessor* a, double* values, size_t *len) +static int unpack_double(grib_accessor* a, double* values, size_t* len) { - grib_accessor_data_g1second_order_general_packing* self = (grib_accessor_data_g1second_order_general_packing*)a; - int ret=0; - long numberOfGroups,numberOfSecondOrderPackedValues; - long* groupWidths=0; - long* firstOrderValues=0; - long* X=0; - long pos=0; - long widthOfFirstOrderValues=0; - unsigned char* buf = (unsigned char*)grib_handle_of_accessor(a)->buffer->data; - long i,n; + grib_accessor_data_g1second_order_general_packing* self = (grib_accessor_data_g1second_order_general_packing*)a; + int ret = 0; + long numberOfGroups, numberOfSecondOrderPackedValues; + long* groupWidths = 0; + long* firstOrderValues = 0; + long* X = 0; + long pos = 0; + long widthOfFirstOrderValues = 0; + unsigned char* buf = (unsigned char*)grib_handle_of_accessor(a)->buffer->data; + long i, n; double reference_value; long binary_scale_factor; long decimal_scale_factor; - double s,d; + double s, d; long* secondaryBitmap; - long groupLength,j; + long groupLength, j; size_t groupWidthsSize; buf += grib_byte_offset(a); - if((ret=grib_get_long_internal(grib_handle_of_accessor(a),self->numberOfGroups,&numberOfGroups)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfGroups, &numberOfGroups)) != GRIB_SUCCESS) return ret; - if((ret=grib_get_long_internal(grib_handle_of_accessor(a),self->widthOfFirstOrderValues,&widthOfFirstOrderValues)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->widthOfFirstOrderValues, &widthOfFirstOrderValues)) != GRIB_SUCCESS) return ret; - if((ret=grib_get_long_internal(grib_handle_of_accessor(a),self->binary_scale_factor,&binary_scale_factor)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) return ret; - if((ret=grib_get_long_internal(grib_handle_of_accessor(a),self->decimal_scale_factor,&decimal_scale_factor)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) return ret; - if((ret=grib_get_double_internal(grib_handle_of_accessor(a),self->reference_value,&reference_value)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(grib_handle_of_accessor(a), self->reference_value, &reference_value)) != GRIB_SUCCESS) return ret; - if((ret=grib_get_long_internal(grib_handle_of_accessor(a),self->numberOfSecondOrderPackedValues, - &numberOfSecondOrderPackedValues)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfSecondOrderPackedValues, + &numberOfSecondOrderPackedValues)) != GRIB_SUCCESS) return ret; - groupWidths=(long*)grib_context_malloc_clear(a->context,sizeof(long)*numberOfGroups); - groupWidthsSize=numberOfGroups; - if((ret=grib_get_long_array_internal(grib_handle_of_accessor(a),self->groupWidths, groupWidths,&groupWidthsSize)) != GRIB_SUCCESS) + groupWidths = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfGroups); + groupWidthsSize = numberOfGroups; + if ((ret = grib_get_long_array_internal(grib_handle_of_accessor(a), self->groupWidths, groupWidths, &groupWidthsSize)) != GRIB_SUCCESS) return ret; - secondaryBitmap=(long*)grib_context_malloc_clear(a->context,sizeof(long)*(numberOfSecondOrderPackedValues+1)); - secondaryBitmap[numberOfSecondOrderPackedValues]=1; - grib_decode_long_array(buf,&pos,1,numberOfSecondOrderPackedValues,secondaryBitmap); - pos = 8 * ( (pos + 7 ) / 8); + secondaryBitmap = (long*)grib_context_malloc_clear(a->context, sizeof(long) * (numberOfSecondOrderPackedValues + 1)); + secondaryBitmap[numberOfSecondOrderPackedValues] = 1; + grib_decode_long_array(buf, &pos, 1, numberOfSecondOrderPackedValues, secondaryBitmap); + pos = 8 * ((pos + 7) / 8); - firstOrderValues=(long*)grib_context_malloc_clear(a->context,sizeof(long)*numberOfGroups); - grib_decode_long_array(buf,&pos,widthOfFirstOrderValues,numberOfGroups,firstOrderValues); - pos = 8 * ( (pos + 7 ) / 8); + firstOrderValues = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfGroups); + grib_decode_long_array(buf, &pos, widthOfFirstOrderValues, numberOfGroups, firstOrderValues); + pos = 8 * ((pos + 7) / 8); - X=(long*)grib_context_malloc_clear(a->context,sizeof(long)*numberOfSecondOrderPackedValues); + X = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfSecondOrderPackedValues); - n=0; - i=-1; - groupLength=0; - while (n0) { - for (j=0;j 0) { + for (j = 0; j < groupLength; j++) { + X[n] = grib_decode_unsigned_long(buf, &pos, groupWidths[i]); + X[n] = firstOrderValues[i] + X[n]; n++; } - } else { - for (j=0;jcontext,secondaryBitmap); - grib_context_free(a->context,firstOrderValues); - grib_context_free(a->context,X); - grib_context_free(a->context,groupWidths); + *len = numberOfSecondOrderPackedValues; + grib_context_free(a->context, secondaryBitmap); + grib_context_free(a->context, firstOrderValues); + grib_context_free(a->context, X); + grib_context_free(a->context, groupWidths); return ret; } -static int pack_double(grib_accessor* a, const double* cval, size_t *len) +static int pack_double(grib_accessor* a, const double* cval, size_t* len) { /* return GRIB_NOT_IMPLEMENTED; */ - int err = 0; - char type[]="grid_second_order"; - size_t size=strlen(type); + int err = 0; + char type[] = "grid_second_order"; + size_t size = strlen(type); grib_handle* hand = grib_handle_of_accessor(a); - err = grib_set_string(hand,"packingType",type,&size); - if (err) return err; + err = grib_set_string(hand, "packingType", type, &size); + if (err) + return err; - return grib_set_double_array(hand,"values",cval,*len); + return grib_set_double_array(hand, "values", cval, *len); } diff --git a/src/grib_accessor_class_data_g1second_order_row_by_row_packing.c b/src/grib_accessor_class_data_g1second_order_row_by_row_packing.c index 54d6dd634..7a033cd6f 100644 --- a/src/grib_accessor_class_data_g1second_order_row_by_row_packing.c +++ b/src/grib_accessor_class_data_g1second_order_row_by_row_packing.c @@ -51,94 +51,95 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_data_g1second_order_row_by_row_packing { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in values */ - int carg; - const char* seclen; - const char* offsetdata; - const char* offsetsection; - int dirty; -/* Members defined in data_simple_packing */ - int edition; - const char* units_factor; - const char* units_bias; - const char* changing_precision; - const char* number_of_values; - const char* bits_per_value; - const char* reference_value; - const char* binary_scale_factor; - const char* decimal_scale_factor; - const char* optimize_scaling_factor; -/* Members defined in data_g1second_order_row_by_row_packing */ - const char* half_byte; - const char* packingType; - const char* ieee_packing; - const char* precision; - const char* widthOfFirstOrderValues; - const char* N1; - const char* N2; - const char* numberOfGroups; - const char* numberOfSecondOrderPackedValues; - const char* extraValues; - const char* pl; - const char* Ni; - const char* Nj; - const char* jPointsAreConsecutive; - const char* bitmap; - const char* groupWidths; +typedef struct grib_accessor_data_g1second_order_row_by_row_packing +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in values */ + int carg; + const char* seclen; + const char* offsetdata; + const char* offsetsection; + int dirty; + /* Members defined in data_simple_packing */ + int edition; + const char* units_factor; + const char* units_bias; + const char* changing_precision; + const char* number_of_values; + const char* bits_per_value; + const char* reference_value; + const char* binary_scale_factor; + const char* decimal_scale_factor; + const char* optimize_scaling_factor; + /* Members defined in data_g1second_order_row_by_row_packing */ + const char* half_byte; + const char* packingType; + const char* ieee_packing; + const char* precision; + const char* widthOfFirstOrderValues; + const char* N1; + const char* N2; + const char* numberOfGroups; + const char* numberOfSecondOrderPackedValues; + const char* extraValues; + const char* pl; + const char* Ni; + const char* Nj; + const char* jPointsAreConsecutive; + const char* bitmap; + const char* groupWidths; } grib_accessor_data_g1second_order_row_by_row_packing; extern grib_accessor_class* grib_accessor_class_data_simple_packing; static grib_accessor_class _grib_accessor_class_data_g1second_order_row_by_row_packing = { - &grib_accessor_class_data_simple_packing, /* super */ - "data_g1second_order_row_by_row_packing", /* name */ - sizeof(grib_accessor_data_g1second_order_row_by_row_packing), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_data_simple_packing, /* super */ + "data_g1second_order_row_by_row_packing", /* name */ + sizeof(grib_accessor_data_g1second_order_row_by_row_packing), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -147,291 +148,312 @@ grib_accessor_class* grib_accessor_class_data_g1second_order_row_by_row_packing static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long v, grib_arguments* args) +static void init(grib_accessor* a, const long v, grib_arguments* args) { - grib_accessor_data_g1second_order_row_by_row_packing *self =(grib_accessor_data_g1second_order_row_by_row_packing*)a; - grib_handle* gh = grib_handle_of_accessor(a); - - self->half_byte = grib_arguments_get_name(gh,args,self->carg++); - self->packingType = grib_arguments_get_name(gh,args,self->carg++); - self->ieee_packing = grib_arguments_get_name(gh,args,self->carg++); - self->precision = grib_arguments_get_name(gh,args,self->carg++); - self->widthOfFirstOrderValues = grib_arguments_get_name(gh,args,self->carg++); - self->N1 = grib_arguments_get_name(gh,args,self->carg++); - self->N2 = grib_arguments_get_name(gh,args,self->carg++); - self->numberOfGroups = grib_arguments_get_name(gh,args,self->carg++); - self->numberOfSecondOrderPackedValues = grib_arguments_get_name(gh,args,self->carg++); - self->extraValues = grib_arguments_get_name(gh,args,self->carg++); - self->Ni = grib_arguments_get_name(gh,args,self->carg++); - self->Nj = grib_arguments_get_name(gh,args,self->carg++); - self->pl = grib_arguments_get_name(gh,args,self->carg++); - self->jPointsAreConsecutive = grib_arguments_get_name(gh,args,self->carg++); - self->groupWidths = grib_arguments_get_name(gh,args,self->carg++); - self->bitmap = grib_arguments_get_name(gh,args,self->carg++); - self->edition=1; + grib_accessor_data_g1second_order_row_by_row_packing* self = (grib_accessor_data_g1second_order_row_by_row_packing*)a; + grib_handle* gh = grib_handle_of_accessor(a); + + self->half_byte = grib_arguments_get_name(gh, args, self->carg++); + self->packingType = grib_arguments_get_name(gh, args, self->carg++); + self->ieee_packing = grib_arguments_get_name(gh, args, self->carg++); + self->precision = grib_arguments_get_name(gh, args, self->carg++); + self->widthOfFirstOrderValues = grib_arguments_get_name(gh, args, self->carg++); + self->N1 = grib_arguments_get_name(gh, args, self->carg++); + self->N2 = grib_arguments_get_name(gh, args, self->carg++); + self->numberOfGroups = grib_arguments_get_name(gh, args, self->carg++); + self->numberOfSecondOrderPackedValues = grib_arguments_get_name(gh, args, self->carg++); + self->extraValues = grib_arguments_get_name(gh, args, self->carg++); + self->Ni = grib_arguments_get_name(gh, args, self->carg++); + self->Nj = grib_arguments_get_name(gh, args, self->carg++); + self->pl = grib_arguments_get_name(gh, args, self->carg++); + self->jPointsAreConsecutive = grib_arguments_get_name(gh, args, self->carg++); + self->groupWidths = grib_arguments_get_name(gh, args, self->carg++); + self->bitmap = grib_arguments_get_name(gh, args, self->carg++); + self->edition = 1; a->flags |= GRIB_ACCESSOR_FLAG_DATA; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - grib_accessor_data_g1second_order_row_by_row_packing *self =(grib_accessor_data_g1second_order_row_by_row_packing*)a; - grib_handle* gh = grib_handle_of_accessor(a); - long n=0,i=0; - long numberOfRows=0; - long jPointsAreConsecutive=0; - long Ni=0,Nj=0; - int bitmapPresent=0; - size_t plSize=0; - long* pl=0; - int ret=0; - grib_context* c=a->context; - - if (self->bitmap) bitmapPresent=1; - if((ret=grib_get_long_internal(gh,self->jPointsAreConsecutive,&jPointsAreConsecutive)) != GRIB_SUCCESS) + grib_accessor_data_g1second_order_row_by_row_packing* self = (grib_accessor_data_g1second_order_row_by_row_packing*)a; + grib_handle* gh = grib_handle_of_accessor(a); + long n = 0, i = 0; + long numberOfRows = 0; + long jPointsAreConsecutive = 0; + long Ni = 0, Nj = 0; + int bitmapPresent = 0; + size_t plSize = 0; + long* pl = 0; + int ret = 0; + grib_context* c = a->context; + + if (self->bitmap) + bitmapPresent = 1; + if ((ret = grib_get_long_internal(gh, self->jPointsAreConsecutive, &jPointsAreConsecutive)) != GRIB_SUCCESS) return ret; - if((ret=grib_get_long_internal(gh,self->Ni,&Ni)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->Ni, &Ni)) != GRIB_SUCCESS) return ret; - if((ret=grib_get_long_internal(gh,self->Nj,&Nj)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->Nj, &Nj)) != GRIB_SUCCESS) return ret; if (jPointsAreConsecutive) { - numberOfRows=Ni; - } else { - numberOfRows=Nj; + numberOfRows = Ni; + } + else { + numberOfRows = Nj; } - plSize=0; - ret=grib_get_size(gh,self->pl,&plSize); - if (ret==GRIB_SUCCESS) { - pl=(long*)grib_context_malloc_clear(a->context,sizeof(long)*plSize); - if((ret=grib_get_long_array(gh,self->pl,pl,&plSize)) != GRIB_SUCCESS) + plSize = 0; + ret = grib_get_size(gh, self->pl, &plSize); + if (ret == GRIB_SUCCESS) { + pl = (long*)grib_context_malloc_clear(a->context, sizeof(long) * plSize); + if ((ret = grib_get_long_array(gh, self->pl, pl, &plSize)) != GRIB_SUCCESS) return ret; } - ret=0; + ret = 0; - n=0; + n = 0; if (bitmapPresent) { - long *bitmap,*pbitmap; + long *bitmap, *pbitmap; size_t numberOfPoints = 0; if (plSize) { - for (i=0;icontext,sizeof(long)*numberOfPoints); - pbitmap=bitmap; - grib_get_long_array(gh,self->bitmap,bitmap,&numberOfPoints); - for (i=0;icontext, sizeof(long) * numberOfPoints); + pbitmap = bitmap; + grib_get_long_array(gh, self->bitmap, bitmap, &numberOfPoints); + for (i = 0; i < numberOfPoints; i++) + n += *(bitmap++); - grib_context_free(a->context,pbitmap); - } else { + grib_context_free(a->context, pbitmap); + } + else { if (plSize) { - for (i=0;ibuffer->data; - long k,i,j,n,Ni,Nj; + long k, i, j, n, Ni, Nj; double reference_value; long binary_scale_factor; long decimal_scale_factor; - double s,d; - size_t groupWidthsSize=0; - int bitmapPresent=0; - size_t plSize=0; - long* pl=0; + double s, d; + size_t groupWidthsSize = 0; + int bitmapPresent = 0; + size_t plSize = 0; + long* pl = 0; buf += grib_byte_offset(a); - if((ret=grib_get_long_internal(gh,self->numberOfGroups,&numberOfGroups)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->numberOfGroups, &numberOfGroups)) != GRIB_SUCCESS) return ret; - if((ret=grib_get_long_internal(gh,self->jPointsAreConsecutive,&jPointsAreConsecutive)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->jPointsAreConsecutive, &jPointsAreConsecutive)) != GRIB_SUCCESS) return ret; - if (self->bitmap) bitmapPresent=1; - ret=grib_get_size(gh,self->pl,&plSize); - if (ret==GRIB_SUCCESS) { - pl=(long*)grib_context_malloc_clear(a->context,sizeof(long)*plSize); - if((ret=grib_get_long_array(gh,self->pl,pl,&plSize)) != GRIB_SUCCESS) + if (self->bitmap) + bitmapPresent = 1; + ret = grib_get_size(gh, self->pl, &plSize); + if (ret == GRIB_SUCCESS) { + pl = (long*)grib_context_malloc_clear(a->context, sizeof(long) * plSize); + if ((ret = grib_get_long_array(gh, self->pl, pl, &plSize)) != GRIB_SUCCESS) return ret; } - if((ret=grib_get_long_internal(gh,self->Ni,&Ni)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->Ni, &Ni)) != GRIB_SUCCESS) return ret; - if((ret=grib_get_long_internal(gh,self->Nj,&Nj)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->Nj, &Nj)) != GRIB_SUCCESS) return ret; if (jPointsAreConsecutive) { - numberOfRows=Ni; - numberOfColumns=Nj; - } else { - numberOfRows=Nj; - numberOfColumns=Ni; + numberOfRows = Ni; + numberOfColumns = Nj; + } + else { + numberOfRows = Nj; + numberOfColumns = Ni; } - numbersPerRow=(long*)grib_context_malloc_clear(a->context,sizeof(long)*numberOfRows); - if(!numbersPerRow) return GRIB_OUT_OF_MEMORY; + numbersPerRow = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfRows); + if (!numbersPerRow) + return GRIB_OUT_OF_MEMORY; if (bitmapPresent) { - long *bitmap,*pbitmap; - size_t numberOfPoints=Ni*Nj; + long *bitmap, *pbitmap; + size_t numberOfPoints = Ni * Nj; if (plSize) { - numberOfPoints=0; - for (i=0;icontext,sizeof(long)*numberOfPoints); - pbitmap=bitmap; - grib_get_long_array(gh,self->bitmap,bitmap,&numberOfPoints); + bitmap = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfPoints); + pbitmap = bitmap; + grib_get_long_array(gh, self->bitmap, bitmap, &numberOfPoints); if (plSize) { - for (i=0;icontext,pbitmap); - } else { + grib_context_free(a->context, pbitmap); + } + else { if (plSize) { - for (i=0;iwidthOfFirstOrderValues,&widthOfFirstOrderValues)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->widthOfFirstOrderValues, &widthOfFirstOrderValues)) != GRIB_SUCCESS) return ret; - if((ret=grib_get_long_internal(gh,self->binary_scale_factor,&binary_scale_factor)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) return ret; - if((ret=grib_get_long_internal(gh,self->decimal_scale_factor,&decimal_scale_factor)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) return ret; - if((ret=grib_get_double_internal(gh,self->reference_value,&reference_value)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(gh, self->reference_value, &reference_value)) != GRIB_SUCCESS) return ret; - if((ret=grib_get_long_internal(gh,self->numberOfSecondOrderPackedValues, - &numberOfSecondOrderPackedValues)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->numberOfSecondOrderPackedValues, + &numberOfSecondOrderPackedValues)) != GRIB_SUCCESS) return ret; - groupWidths=(long*)grib_context_malloc_clear(a->context,sizeof(long)*numberOfGroups); - groupWidthsSize=numberOfGroups; - if((ret=grib_get_long_array_internal(gh,self->groupWidths, groupWidths,&groupWidthsSize)) != GRIB_SUCCESS) + groupWidths = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfGroups); + groupWidthsSize = numberOfGroups; + if ((ret = grib_get_long_array_internal(gh, self->groupWidths, groupWidths, &groupWidthsSize)) != GRIB_SUCCESS) return ret; - firstOrderValues=(long*)grib_context_malloc_clear(a->context,sizeof(long)*numberOfGroups); - grib_decode_long_array(buf,&pos,widthOfFirstOrderValues,numberOfGroups,firstOrderValues); - pos = 8 * ( (pos + 7 ) / 8); - - n=0; - for (i=0; icontext,sizeof(long)*n); - n=0; - k=0; - for (i=0; i0) { - for (j=0;jcontext, sizeof(long) * numberOfGroups); + grib_decode_long_array(buf, &pos, widthOfFirstOrderValues, numberOfGroups, firstOrderValues); + pos = 8 * ((pos + 7) / 8); + + n = 0; + for (i = 0; i < numberOfGroups; i++) + n += numbersPerRow[i]; + + X = (long*)grib_context_malloc_clear(a->context, sizeof(long) * n); + n = 0; + k = 0; + for (i = 0; i < numberOfGroups; i++) { + if (groupWidths[i] > 0) { + for (j = 0; j < numbersPerRow[k]; j++) { + X[n] = grib_decode_unsigned_long(buf, &pos, groupWidths[i]); + X[n] += firstOrderValues[i]; n++; } - } else { - for (j=0;jcontext,firstOrderValues); - grib_context_free(a->context,X); - grib_context_free(a->context,groupWidths); - if (plSize) grib_context_free(a->context,pl); - if (numbersPerRow) grib_context_free(a->context,numbersPerRow); + grib_context_free(a->context, firstOrderValues); + grib_context_free(a->context, X); + grib_context_free(a->context, groupWidths); + if (plSize) + grib_context_free(a->context, pl); + if (numbersPerRow) + grib_context_free(a->context, numbersPerRow); return ret; } -static int pack_double(grib_accessor* a, const double* cval, size_t *len) +static int pack_double(grib_accessor* a, const double* cval, size_t* len) { - int err = 0; + int err = 0; grib_handle* gh = grib_handle_of_accessor(a); - char type[]="grid_second_order"; - size_t size=strlen(type); + char type[] = "grid_second_order"; + size_t size = strlen(type); - err = grib_set_string(gh,"packingType",type,&size); - if (err) return err; + err = grib_set_string(gh, "packingType", type, &size); + if (err) + return err; - return grib_set_double_array(gh,"values",cval,*len); + return grib_set_double_array(gh, "values", cval, *len); } diff --git a/src/grib_accessor_class_data_g1secondary_bitmap.c b/src/grib_accessor_class_data_g1secondary_bitmap.c index ccec04802..e2df088a8 100644 --- a/src/grib_accessor_class_data_g1secondary_bitmap.c +++ b/src/grib_accessor_class_data_g1secondary_bitmap.c @@ -33,66 +33,67 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_data_g1secondary_bitmap { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in data_secondary_bitmap */ - const char* primary_bitmap; - const char* secondary_bitmap; - const char* missing_value; - const char* expand_by; -/* Members defined in data_g1secondary_bitmap */ - const char* number_of_ones; +typedef struct grib_accessor_data_g1secondary_bitmap +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in data_secondary_bitmap */ + const char* primary_bitmap; + const char* secondary_bitmap; + const char* missing_value; + const char* expand_by; + /* Members defined in data_g1secondary_bitmap */ + const char* number_of_ones; } grib_accessor_data_g1secondary_bitmap; extern grib_accessor_class* grib_accessor_class_data_secondary_bitmap; static grib_accessor_class _grib_accessor_class_data_g1secondary_bitmap = { - &grib_accessor_class_data_secondary_bitmap, /* super */ - "data_g1secondary_bitmap", /* name */ - sizeof(grib_accessor_data_g1secondary_bitmap), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_data_secondary_bitmap, /* super */ + "data_g1secondary_bitmap", /* name */ + sizeof(grib_accessor_data_g1secondary_bitmap), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -101,130 +102,132 @@ grib_accessor_class* grib_accessor_class_data_g1secondary_bitmap = &_grib_access static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long v, grib_arguments* args) +static void init(grib_accessor* a, const long v, grib_arguments* args) { - grib_accessor_data_g1secondary_bitmap *self =(grib_accessor_data_g1secondary_bitmap*)a; - self->number_of_ones = grib_arguments_get_name(grib_handle_of_accessor(a),args,4); + grib_accessor_data_g1secondary_bitmap* self = (grib_accessor_data_g1secondary_bitmap*)a; + self->number_of_ones = grib_arguments_get_name(grib_handle_of_accessor(a), args, 4); } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - grib_accessor_data_g1secondary_bitmap *self =(grib_accessor_data_g1secondary_bitmap*)a; - size_t len = 0; - int err = 0; + grib_accessor_data_g1secondary_bitmap* self = (grib_accessor_data_g1secondary_bitmap*)a; + size_t len = 0; + int err = 0; long expand_by; *count = 0; - err = grib_get_long_internal(grib_handle_of_accessor(a),self->expand_by,&expand_by); - if (err) return err; + err = grib_get_long_internal(grib_handle_of_accessor(a), self->expand_by, &expand_by); + if (err) + return err; - err = grib_get_size(grib_handle_of_accessor(a),self->primary_bitmap,&len); - if (err) return err; + err = grib_get_size(grib_handle_of_accessor(a), self->primary_bitmap, &len); + if (err) + return err; - *count=expand_by*len; + *count = expand_by * len; return err; } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { - grib_accessor_data_g1secondary_bitmap* self = (grib_accessor_data_g1secondary_bitmap*)a; + grib_accessor_data_g1secondary_bitmap* self = (grib_accessor_data_g1secondary_bitmap*)a; int err = 0; - long primary_len = 0; - long secondary_len = 0; - double* primary_bitmap = NULL; + long primary_len = 0; + long secondary_len = 0; + double* primary_bitmap = NULL; double* secondary_bitmap = NULL; - long i = 0; - long j = 0; - long on = 0; + long i = 0; + long j = 0; + long on = 0; long k; long m; double missing_value = 0; double present_value = 0; - long expand_by =0; + long expand_by = 0; - if (*len ==0) return GRIB_NO_VALUES; + if (*len == 0) + return GRIB_NO_VALUES; - if((err = grib_get_long(grib_handle_of_accessor(a),self->expand_by,&expand_by)) != GRIB_SUCCESS) + if ((err = grib_get_long(grib_handle_of_accessor(a), self->expand_by, &expand_by)) != GRIB_SUCCESS) return err; - if(expand_by <=0) + if (expand_by <= 0) return GRIB_ENCODING_ERROR; - if((err = grib_get_double_internal(grib_handle_of_accessor(a),self->missing_value,&missing_value)) != GRIB_SUCCESS) + if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->missing_value, &missing_value)) != GRIB_SUCCESS) return err; - if(*len % expand_by) - { + if (*len % expand_by) { /*TODO: issue warning */ return GRIB_ENCODING_ERROR; } - primary_len = *len / expand_by; - primary_bitmap= (double*)grib_context_malloc_clear(a->context,primary_len*sizeof(double)); - if(!primary_bitmap) return GRIB_OUT_OF_MEMORY; + primary_len = *len / expand_by; + primary_bitmap = (double*)grib_context_malloc_clear(a->context, primary_len * sizeof(double)); + if (!primary_bitmap) + return GRIB_OUT_OF_MEMORY; - secondary_len = *len ; - secondary_bitmap= (double*)grib_context_malloc_clear(a->context,secondary_len*sizeof(double)); - if(!secondary_bitmap) { - grib_context_free(a->context,primary_bitmap); + secondary_len = *len; + secondary_bitmap = (double*)grib_context_malloc_clear(a->context, secondary_len * sizeof(double)); + if (!secondary_bitmap) { + grib_context_free(a->context, primary_bitmap); return GRIB_OUT_OF_MEMORY; } - if(missing_value == 0) + if (missing_value == 0) present_value = 1; else present_value = 0; k = 0; m = 0; - for(i=0; i<*len ; i += expand_by) - { + for (i = 0; i < *len; i += expand_by) { int cnt = 0; - for(j = 0; j < expand_by; j++) - if(val[i+j] == missing_value) + for (j = 0; j < expand_by; j++) + if (val[i + j] == missing_value) cnt++; - if(cnt == expand_by) /* all expand_by values are missing */ + if (cnt == expand_by) /* all expand_by values are missing */ primary_bitmap[k++] = missing_value; else { primary_bitmap[k++] = present_value; - for(j = 0; j < expand_by; j++) - secondary_bitmap[m++] = val[i+j]; + for (j = 0; j < expand_by; j++) + secondary_bitmap[m++] = val[i + j]; on++; } } @@ -234,15 +237,15 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) /*printf("QQQQQQQ %ld %ld second=%ld\n",primary_len,on,m);*/ Assert(k == primary_len); - err = grib_set_double_array_internal(grib_handle_of_accessor(a),self->primary_bitmap,primary_bitmap,k); - if(err == GRIB_SUCCESS) - err = grib_set_double_array_internal(grib_handle_of_accessor(a),self->secondary_bitmap,secondary_bitmap,m); + err = grib_set_double_array_internal(grib_handle_of_accessor(a), self->primary_bitmap, primary_bitmap, k); + if (err == GRIB_SUCCESS) + err = grib_set_double_array_internal(grib_handle_of_accessor(a), self->secondary_bitmap, secondary_bitmap, m); - grib_context_free(a->context,primary_bitmap); - grib_context_free(a->context,secondary_bitmap); + grib_context_free(a->context, primary_bitmap); + grib_context_free(a->context, secondary_bitmap); - if(err == GRIB_SUCCESS) - err = grib_set_long_internal(grib_handle_of_accessor(a),self->number_of_ones,on); + if (err == GRIB_SUCCESS) + err = grib_set_long_internal(grib_handle_of_accessor(a), self->number_of_ones, on); return err; } diff --git a/src/grib_accessor_class_data_g1shsimple_packing.c b/src/grib_accessor_class_data_g1shsimple_packing.c index 10c4ebc89..bf5a9e2f7 100644 --- a/src/grib_accessor_class_data_g1shsimple_packing.c +++ b/src/grib_accessor_class_data_g1shsimple_packing.c @@ -31,63 +31,64 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int value_count(grib_accessor*,long*); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int value_count(grib_accessor*, long*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_data_g1shsimple_packing { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in data_shsimple_packing */ - const char* coded_values; - const char* real_part; - int dirty; -/* Members defined in data_g1shsimple_packing */ +typedef struct grib_accessor_data_g1shsimple_packing +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in data_shsimple_packing */ + const char* coded_values; + const char* real_part; + int dirty; + /* Members defined in data_g1shsimple_packing */ } grib_accessor_data_g1shsimple_packing; extern grib_accessor_class* grib_accessor_class_data_shsimple_packing; static grib_accessor_class _grib_accessor_class_data_g1shsimple_packing = { - &grib_accessor_class_data_shsimple_packing, /* super */ - "data_g1shsimple_packing", /* name */ - sizeof(grib_accessor_data_g1shsimple_packing), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_data_shsimple_packing, /* super */ + "data_g1shsimple_packing", /* name */ + sizeof(grib_accessor_data_g1shsimple_packing), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -96,86 +97,85 @@ grib_accessor_class* grib_accessor_class_data_g1shsimple_packing = &_grib_access static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - grib_accessor_data_g1shsimple_packing *self =(grib_accessor_data_g1shsimple_packing*)a; - size_t len = 0; - int err=0; + grib_accessor_data_g1shsimple_packing* self = (grib_accessor_data_g1shsimple_packing*)a; + size_t len = 0; + int err = 0; - err=grib_get_size(grib_handle_of_accessor(a),self->coded_values,&len); + err = grib_get_size(grib_handle_of_accessor(a), self->coded_values, &len); len += 1; - *count=len; + *count = len; return err; } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - grib_accessor_data_g1shsimple_packing* self = (grib_accessor_data_g1shsimple_packing*)a; - int err = GRIB_SUCCESS; + grib_accessor_data_g1shsimple_packing* self = (grib_accessor_data_g1shsimple_packing*)a; + int err = GRIB_SUCCESS; size_t coded_n_vals = 0; - size_t n_vals = 0; + size_t n_vals = 0; - if((err = grib_get_size(grib_handle_of_accessor(a),self->coded_values,&coded_n_vals)) != GRIB_SUCCESS) + if ((err = grib_get_size(grib_handle_of_accessor(a), self->coded_values, &coded_n_vals)) != GRIB_SUCCESS) return err; n_vals = coded_n_vals + 1; - if(*len < n_vals) - { + if (*len < n_vals) { *len = n_vals; return GRIB_ARRAY_TOO_SMALL; } - if((err = grib_get_double_internal(grib_handle_of_accessor(a),self->real_part,val)) != GRIB_SUCCESS) + if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->real_part, val)) != GRIB_SUCCESS) return err; val++; - if((err = grib_get_double_array_internal(grib_handle_of_accessor(a),self->coded_values,val,&coded_n_vals)) != GRIB_SUCCESS) + if ((err = grib_get_double_array_internal(grib_handle_of_accessor(a), self->coded_values, val, &coded_n_vals)) != GRIB_SUCCESS) return err; grib_context_log(a->context, GRIB_LOG_DEBUG, - "grib_accessor_data_g1shsimple_packing_bitmap : unpack_double : creating %s, %d values", - a->name, n_vals); + "grib_accessor_data_g1shsimple_packing_bitmap : unpack_double : creating %s, %d values", + a->name, n_vals); - *len = n_vals; + *len = n_vals; return err; } diff --git a/src/grib_accessor_class_data_g1simple_packing.c b/src/grib_accessor_class_data_g1simple_packing.c index 33e4def97..34c9ed15f 100644 --- a/src/grib_accessor_class_data_g1simple_packing.c +++ b/src/grib_accessor_class_data_g1simple_packing.c @@ -37,81 +37,82 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_data_g1simple_packing { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in values */ - int carg; - const char* seclen; - const char* offsetdata; - const char* offsetsection; - int dirty; -/* Members defined in data_simple_packing */ - int edition; - const char* units_factor; - const char* units_bias; - const char* changing_precision; - const char* number_of_values; - const char* bits_per_value; - const char* reference_value; - const char* binary_scale_factor; - const char* decimal_scale_factor; - const char* optimize_scaling_factor; -/* Members defined in data_g1simple_packing */ - const char* half_byte; - const char* packingType; - const char* ieee_packing; - const char* precision; +typedef struct grib_accessor_data_g1simple_packing +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in values */ + int carg; + const char* seclen; + const char* offsetdata; + const char* offsetsection; + int dirty; + /* Members defined in data_simple_packing */ + int edition; + const char* units_factor; + const char* units_bias; + const char* changing_precision; + const char* number_of_values; + const char* bits_per_value; + const char* reference_value; + const char* binary_scale_factor; + const char* decimal_scale_factor; + const char* optimize_scaling_factor; + /* Members defined in data_g1simple_packing */ + const char* half_byte; + const char* packingType; + const char* ieee_packing; + const char* precision; } grib_accessor_data_g1simple_packing; extern grib_accessor_class* grib_accessor_class_data_simple_packing; static grib_accessor_class _grib_accessor_class_data_g1simple_packing = { - &grib_accessor_class_data_simple_packing, /* super */ - "data_g1simple_packing", /* name */ - sizeof(grib_accessor_data_g1simple_packing), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_data_simple_packing, /* super */ + "data_g1simple_packing", /* name */ + sizeof(grib_accessor_data_g1simple_packing), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -120,228 +121,226 @@ grib_accessor_class* grib_accessor_class_data_g1simple_packing = &_grib_accessor static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long v, grib_arguments* args) +static void init(grib_accessor* a, const long v, grib_arguments* args) { - grib_accessor_data_g1simple_packing *self =(grib_accessor_data_g1simple_packing*)a; + grib_accessor_data_g1simple_packing* self = (grib_accessor_data_g1simple_packing*)a; - self->half_byte = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->packingType = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->ieee_packing = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->precision = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->edition=1; + self->half_byte = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->packingType = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->ieee_packing = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->precision = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->edition = 1; a->flags |= GRIB_ACCESSOR_FLAG_DATA; - } -static int value_count(grib_accessor* a,long* number_of_values) +static int value_count(grib_accessor* a, long* number_of_values) { - grib_accessor_data_g1simple_packing *self =(grib_accessor_data_g1simple_packing*)a; - *number_of_values=0; + grib_accessor_data_g1simple_packing* self = (grib_accessor_data_g1simple_packing*)a; + *number_of_values = 0; /* Special case for when values are cleared */ /*if(a->length == 0) return 0;*/ - return grib_get_long_internal(grib_handle_of_accessor(a),self->number_of_values,number_of_values); + return grib_get_long_internal(grib_handle_of_accessor(a), self->number_of_values, number_of_values); } -static int pack_double(grib_accessor* a, const double* cval, size_t *len) +static int pack_double(grib_accessor* a, const double* cval, size_t* len) { - grib_accessor_data_g1simple_packing* self = (grib_accessor_data_g1simple_packing*)a; - grib_accessor_class* super = *(a->cclass->super); - - size_t n_vals = *len; - long half_byte = 0; - int ret = 0; - long offsetdata = 0; - long offsetsection = 0; - double reference_value = 0; - long binary_scale_factor = 0; - long bits_per_value = 0; - long decimal_scale_factor = 0; - double decimal = 1; - size_t buflen = 0; - unsigned char* buf = NULL; - unsigned char* encoded = NULL; - double divisor = 1; + grib_accessor_data_g1simple_packing* self = (grib_accessor_data_g1simple_packing*)a; + grib_accessor_class* super = *(a->cclass->super); + + size_t n_vals = *len; + long half_byte = 0; + int ret = 0; + long offsetdata = 0; + long offsetsection = 0; + double reference_value = 0; + long binary_scale_factor = 0; + long bits_per_value = 0; + long decimal_scale_factor = 0; + double decimal = 1; + size_t buflen = 0; + unsigned char* buf = NULL; + unsigned char* encoded = NULL; + double divisor = 1; int i; - long off = 0; - grib_context* c=a->context; - grib_handle* h=grib_handle_of_accessor(a); - char* ieee_packing_s=NULL; - char* packingType_s=NULL; - char* precision_s=NULL; - double units_factor=1.0; - double units_bias=0.0; - double* val=(double*)cval; - double missingValue=9999.0; - long constantFieldHalfByte=0; - int err=0; - - if(*len != 0) { - if(self->units_factor && - (grib_get_double_internal(grib_handle_of_accessor(a),self->units_factor,&units_factor)== GRIB_SUCCESS)) { - grib_set_double_internal(grib_handle_of_accessor(a),self->units_factor,1.0); + long off = 0; + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); + char* ieee_packing_s = NULL; + char* packingType_s = NULL; + char* precision_s = NULL; + double units_factor = 1.0; + double units_bias = 0.0; + double* val = (double*)cval; + double missingValue = 9999.0; + long constantFieldHalfByte = 0; + int err = 0; + + if (*len != 0) { + if (self->units_factor && + (grib_get_double_internal(grib_handle_of_accessor(a), self->units_factor, &units_factor) == GRIB_SUCCESS)) { + grib_set_double_internal(grib_handle_of_accessor(a), self->units_factor, 1.0); } - if(self->units_bias && - (grib_get_double_internal(grib_handle_of_accessor(a),self->units_bias,&units_bias)== GRIB_SUCCESS)) { - grib_set_double_internal(grib_handle_of_accessor(a),self->units_bias,0.0); + if (self->units_bias && + (grib_get_double_internal(grib_handle_of_accessor(a), self->units_bias, &units_bias) == GRIB_SUCCESS)) { + grib_set_double_internal(grib_handle_of_accessor(a), self->units_bias, 0.0); } if (units_factor != 1.0) { if (units_bias != 0.0) - for (i=0;iieee_packing && self->ieee_packing) { - long precision=c->ieee_packing==32 ? 1 : 2; - size_t lenstr=strlen(self->ieee_packing); + long precision = c->ieee_packing == 32 ? 1 : 2; + size_t lenstr = strlen(self->ieee_packing); - packingType_s=grib_context_strdup(c,self->packingType); - ieee_packing_s=grib_context_strdup(c,self->ieee_packing); - precision_s=grib_context_strdup(c,self->precision); + packingType_s = grib_context_strdup(c, self->packingType); + ieee_packing_s = grib_context_strdup(c, self->ieee_packing); + precision_s = grib_context_strdup(c, self->precision); - grib_set_string(h,packingType_s,ieee_packing_s,&lenstr); - grib_set_long(h,precision_s,precision); + grib_set_string(h, packingType_s, ieee_packing_s, &lenstr); + grib_set_long(h, precision_s, precision); - grib_context_free(c,packingType_s); - grib_context_free(c,ieee_packing_s); - grib_context_free(c,precision_s); - return grib_set_double_array(h,"values",val,*len); + grib_context_free(c, packingType_s); + grib_context_free(c, ieee_packing_s); + grib_context_free(c, precision_s); + return grib_set_double_array(h, "values", val, *len); } } - ret = super->pack_double(a,val,len); + ret = super->pack_double(a, val, len); switch (ret) { - case GRIB_CONSTANT_FIELD: - ret=grib_get_long(grib_handle_of_accessor(a),"constantFieldHalfByte",&constantFieldHalfByte); - if (ret) constantFieldHalfByte=0; - if((ret = grib_set_long_internal(grib_handle_of_accessor(a),self->half_byte, constantFieldHalfByte)) - != GRIB_SUCCESS) - return ret; - grib_buffer_replace(a, NULL, 0,1,1); - return GRIB_SUCCESS; - break; - case GRIB_NO_VALUES: - ret=grib_get_long(grib_handle_of_accessor(a),"constantFieldHalfByte",&constantFieldHalfByte); - if (ret) constantFieldHalfByte=0; - /* TODO move to def file */ - grib_get_double(grib_handle_of_accessor(a),"missingValue", &missingValue); - if((err = grib_set_double_internal(grib_handle_of_accessor(a),self->reference_value, missingValue)) != + case GRIB_CONSTANT_FIELD: + ret = grib_get_long(grib_handle_of_accessor(a), "constantFieldHalfByte", &constantFieldHalfByte); + if (ret) + constantFieldHalfByte = 0; + if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->half_byte, constantFieldHalfByte)) != GRIB_SUCCESS) + return ret; + grib_buffer_replace(a, NULL, 0, 1, 1); + return GRIB_SUCCESS; + break; + case GRIB_NO_VALUES: + ret = grib_get_long(grib_handle_of_accessor(a), "constantFieldHalfByte", &constantFieldHalfByte); + if (ret) + constantFieldHalfByte = 0; + /* TODO move to def file */ + grib_get_double(grib_handle_of_accessor(a), "missingValue", &missingValue); + if ((err = grib_set_double_internal(grib_handle_of_accessor(a), self->reference_value, missingValue)) != GRIB_SUCCESS) - return err; - if((ret = grib_set_long_internal(grib_handle_of_accessor(a),self->binary_scale_factor, binary_scale_factor)) - != GRIB_SUCCESS) + return err; + if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->binary_scale_factor, binary_scale_factor)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->half_byte, constantFieldHalfByte)) != GRIB_SUCCESS) + return ret; + grib_buffer_replace(a, NULL, 0, 1, 1); + return GRIB_SUCCESS; + break; + case GRIB_INVALID_BPV: + grib_context_log(a->context, GRIB_LOG_ERROR, "unable to compute packing parameters. Invalid bits per value\n"); return ret; - if((ret = grib_set_long_internal(grib_handle_of_accessor(a),self->half_byte, constantFieldHalfByte)) - != GRIB_SUCCESS) + case GRIB_SUCCESS: + break; + default: + grib_context_log(a->context, GRIB_LOG_ERROR, "GRIB1 simple packing: unable to set values (%s)", grib_get_error_message(ret)); return ret; - grib_buffer_replace(a, NULL, 0,1,1); - return GRIB_SUCCESS; - break; - case GRIB_INVALID_BPV: - grib_context_log(a->context,GRIB_LOG_ERROR,"unable to compute packing parameters. Invalid bits per value\n"); - return ret; - case GRIB_SUCCESS: - break; - default: - grib_context_log(a->context,GRIB_LOG_ERROR,"GRIB1 simple packing: unable to set values (%s)", grib_get_error_message(ret)); - return ret; } - if((ret = grib_get_double_internal(grib_handle_of_accessor(a),self->reference_value, &reference_value)) - != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(grib_handle_of_accessor(a), self->reference_value, &reference_value)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->binary_scale_factor, &binary_scale_factor)) - != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->bits_per_value,&bits_per_value)) != - GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->bits_per_value, &bits_per_value)) != + GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->decimal_scale_factor, &decimal_scale_factor)) - != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->offsetdata,&offsetdata)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetdata, &offsetdata)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->offsetsection,&offsetsection)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetsection, &offsetsection)) != GRIB_SUCCESS) return ret; - decimal = grib_power(decimal_scale_factor,10) ; - divisor = grib_power(-binary_scale_factor,2); + decimal = grib_power(decimal_scale_factor, 10); + divisor = grib_power(-binary_scale_factor, 2); - buflen = (((bits_per_value*n_vals)+7)/8)*sizeof(unsigned char); - if((buflen + (offsetdata-offsetsection)) %2) { + buflen = (((bits_per_value * n_vals) + 7) / 8) * sizeof(unsigned char); + if ((buflen + (offsetdata - offsetsection)) % 2) { buflen++; /* a->length++; grib_handle_of_accessor(a)->buffer->ulength++; */ } - half_byte = (buflen*8)-((*len)*bits_per_value); - grib_context_log(a->context,GRIB_LOG_DEBUG, - "HALF byte: buflen=%d bits_per_value=%ld len=%d half_byte=%ld\n", - buflen,bits_per_value,*len,half_byte); + half_byte = (buflen * 8) - ((*len) * bits_per_value); + grib_context_log(a->context, GRIB_LOG_DEBUG, + "HALF byte: buflen=%d bits_per_value=%ld len=%d half_byte=%ld\n", + buflen, bits_per_value, *len, half_byte); Assert(half_byte <= 0x0f); - if((ret = grib_set_long_internal(grib_handle_of_accessor(a),self->half_byte, half_byte)) - != GRIB_SUCCESS) + if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->half_byte, half_byte)) != GRIB_SUCCESS) return ret; - buf = (unsigned char*)grib_context_buffer_malloc_clear(a->context,buflen); + buf = (unsigned char*)grib_context_buffer_malloc_clear(a->context, buflen); encoded = buf; - grib_encode_double_array(n_vals,val,bits_per_value,reference_value,decimal,divisor,encoded,&off); + grib_encode_double_array(n_vals, val, bits_per_value, reference_value, decimal, divisor, encoded, &off); grib_context_log(a->context, GRIB_LOG_DEBUG, - "grib_accessor_data_g1simple_packing : pack_double : packing %s, %d values", a->name, n_vals); + "grib_accessor_data_g1simple_packing : pack_double : packing %s, %d values", a->name, n_vals); - grib_buffer_replace(a, buf, buflen,1,1); + grib_buffer_replace(a, buf, buflen, 1, 1); - grib_context_buffer_free(a->context,buf); + grib_context_buffer_free(a->context, buf); return GRIB_SUCCESS; } diff --git a/src/grib_accessor_class_data_g22order_packing.c b/src/grib_accessor_class_data_g22order_packing.c index f0f7aca95..e0120d460 100644 --- a/src/grib_accessor_class_data_g22order_packing.c +++ b/src/grib_accessor_class_data_g22order_packing.c @@ -55,87 +55,88 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -static int unpack_double_element(grib_accessor*,size_t i, double* val); - -typedef struct grib_accessor_data_g22order_packing { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in values */ - int carg; - const char* seclen; - const char* offsetdata; - const char* offsetsection; - int dirty; -/* Members defined in data_g22order_packing */ - const char* numberOfValues; - const char* bits_per_value; - const char* reference_value; - const char* binary_scale_factor; - const char* decimal_scale_factor; - const char* typeOfOriginalFieldValues; - const char* groupSplittingMethodUsed; - const char* missingValueManagementUsed; - const char* primaryMissingValueSubstitute; - const char* secondaryMissingValueSubstitute; - const char* numberOfGroupsOfDataValues; - const char* referenceForGroupWidths; - const char* numberOfBitsUsedForTheGroupWidths; - const char* referenceForGroupLengths; - const char* lengthIncrementForTheGroupLengths; - const char* trueLengthOfLastGroup; - const char* numberOfBitsUsedForTheScaledGroupLengths; - const char* orderOfSpatialDifferencing; - const char* numberOfOctetsExtraDescriptors; +static int unpack_double_element(grib_accessor*, size_t i, double* val); + +typedef struct grib_accessor_data_g22order_packing +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in values */ + int carg; + const char* seclen; + const char* offsetdata; + const char* offsetsection; + int dirty; + /* Members defined in data_g22order_packing */ + const char* numberOfValues; + const char* bits_per_value; + const char* reference_value; + const char* binary_scale_factor; + const char* decimal_scale_factor; + const char* typeOfOriginalFieldValues; + const char* groupSplittingMethodUsed; + const char* missingValueManagementUsed; + const char* primaryMissingValueSubstitute; + const char* secondaryMissingValueSubstitute; + const char* numberOfGroupsOfDataValues; + const char* referenceForGroupWidths; + const char* numberOfBitsUsedForTheGroupWidths; + const char* referenceForGroupLengths; + const char* lengthIncrementForTheGroupLengths; + const char* trueLengthOfLastGroup; + const char* numberOfBitsUsedForTheScaledGroupLengths; + const char* orderOfSpatialDifferencing; + const char* numberOfOctetsExtraDescriptors; } grib_accessor_data_g22order_packing; extern grib_accessor_class* grib_accessor_class_values; static grib_accessor_class _grib_accessor_class_data_g22order_packing = { - &grib_accessor_class_values, /* super */ - "data_g22order_packing", /* name */ - sizeof(grib_accessor_data_g22order_packing), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - &unpack_double_element, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_values, /* super */ + "data_g22order_packing", /* name */ + sizeof(grib_accessor_data_g22order_packing), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + &unpack_double_element, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -144,66 +145,65 @@ grib_accessor_class* grib_accessor_class_data_g22order_packing = &_grib_accessor static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long v, grib_arguments* args) +static void init(grib_accessor* a, const long v, grib_arguments* args) { - grib_accessor_data_g22order_packing *self =(grib_accessor_data_g22order_packing*)a; - grib_handle* gh = grib_handle_of_accessor(a); - - self->numberOfValues = grib_arguments_get_name(gh,args,self->carg++); - self->bits_per_value = grib_arguments_get_name(gh,args,self->carg++); - self->reference_value = grib_arguments_get_name(gh,args,self->carg++); - self->binary_scale_factor = grib_arguments_get_name(gh,args,self->carg++); - self->decimal_scale_factor = grib_arguments_get_name(gh,args,self->carg++); - - self->typeOfOriginalFieldValues = grib_arguments_get_name(gh,args,self->carg++); - self->groupSplittingMethodUsed = grib_arguments_get_name(gh,args,self->carg++); - self->missingValueManagementUsed = grib_arguments_get_name(gh,args,self->carg++); - self->primaryMissingValueSubstitute = grib_arguments_get_name(gh,args,self->carg++); - self->secondaryMissingValueSubstitute = grib_arguments_get_name(gh,args,self->carg++); - self->numberOfGroupsOfDataValues = grib_arguments_get_name(gh,args,self->carg++); - self->referenceForGroupWidths = grib_arguments_get_name(gh,args,self->carg++); - self->numberOfBitsUsedForTheGroupWidths = grib_arguments_get_name(gh,args,self->carg++); - self->referenceForGroupLengths = grib_arguments_get_name(gh,args,self->carg++); - self->lengthIncrementForTheGroupLengths = grib_arguments_get_name(gh,args,self->carg++); - self->trueLengthOfLastGroup = grib_arguments_get_name(gh,args,self->carg++); - self->numberOfBitsUsedForTheScaledGroupLengths = grib_arguments_get_name(gh,args,self->carg++); - - self->orderOfSpatialDifferencing = grib_arguments_get_name(gh,args,self->carg++); - self->numberOfOctetsExtraDescriptors = grib_arguments_get_name(gh,args,self->carg++); + grib_accessor_data_g22order_packing* self = (grib_accessor_data_g22order_packing*)a; + grib_handle* gh = grib_handle_of_accessor(a); + + self->numberOfValues = grib_arguments_get_name(gh, args, self->carg++); + self->bits_per_value = grib_arguments_get_name(gh, args, self->carg++); + self->reference_value = grib_arguments_get_name(gh, args, self->carg++); + self->binary_scale_factor = grib_arguments_get_name(gh, args, self->carg++); + self->decimal_scale_factor = grib_arguments_get_name(gh, args, self->carg++); + + self->typeOfOriginalFieldValues = grib_arguments_get_name(gh, args, self->carg++); + self->groupSplittingMethodUsed = grib_arguments_get_name(gh, args, self->carg++); + self->missingValueManagementUsed = grib_arguments_get_name(gh, args, self->carg++); + self->primaryMissingValueSubstitute = grib_arguments_get_name(gh, args, self->carg++); + self->secondaryMissingValueSubstitute = grib_arguments_get_name(gh, args, self->carg++); + self->numberOfGroupsOfDataValues = grib_arguments_get_name(gh, args, self->carg++); + self->referenceForGroupWidths = grib_arguments_get_name(gh, args, self->carg++); + self->numberOfBitsUsedForTheGroupWidths = grib_arguments_get_name(gh, args, self->carg++); + self->referenceForGroupLengths = grib_arguments_get_name(gh, args, self->carg++); + self->lengthIncrementForTheGroupLengths = grib_arguments_get_name(gh, args, self->carg++); + self->trueLengthOfLastGroup = grib_arguments_get_name(gh, args, self->carg++); + self->numberOfBitsUsedForTheScaledGroupLengths = grib_arguments_get_name(gh, args, self->carg++); + + self->orderOfSpatialDifferencing = grib_arguments_get_name(gh, args, self->carg++); + self->numberOfOctetsExtraDescriptors = grib_arguments_get_name(gh, args, self->carg++); a->flags |= GRIB_ACCESSOR_FLAG_DATA; - } #if 0 @@ -241,43 +241,50 @@ static int reverse_rows (unsigned long* data, long len, long number_along_ static unsigned long calc_pow_2(unsigned long op) { unsigned long a = 1; - while(op--) a*=2; + while (op--) + a *= 2; return a; } static int calc_bits_needed(unsigned long spread) { int nbit = 0; - if (spread == 0) return nbit; - while (spread>0){ - spread/=2; + if (spread == 0) + return nbit; + while (spread > 0) { + spread /= 2; nbit++; } return nbit; } -static int find_next_group(const unsigned long* vals, size_t len, unsigned long w, unsigned long l,long* nbits, long* groupsize, long* r_val) +static int find_next_group(const unsigned long* vals, size_t len, unsigned long w, unsigned long l, long* nbits, long* groupsize, long* r_val) { unsigned long lmin = 0; unsigned long lmax = 0; size_t i = 0; - if (len == 0) return GRIB_ARRAY_TOO_SMALL; + if (len == 0) + return GRIB_ARRAY_TOO_SMALL; lmin = vals[0]; lmax = lmin; - while(i < len) { - if (vals[i] > lmax) lmax = vals[i]; - else if (vals[i] < lmin) lmin = vals[i]; + while (i < len) { + if (vals[i] > lmax) + lmax = vals[i]; + else if (vals[i] < lmin) + lmin = vals[i]; /*Assert((lmax-lmin) >= 0);*/ - *nbits = calc_bits_needed(lmax-lmin); + *nbits = calc_bits_needed(lmax - lmin); *r_val = lmin; i++; *groupsize = i; - if(*groupsize > l-2) return GRIB_SUCCESS; - if(*nbits > w-2) return GRIB_SUCCESS; + if (*groupsize > l - 2) + return GRIB_SUCCESS; + if (*nbits > w - 2) + return GRIB_SUCCESS; } return GRIB_SUCCESS; @@ -336,23 +343,27 @@ static int spatial_difference (grib_context *c, unsigned long* vals, long len, } #endif -static int post_process(grib_context *c, long* vals, long len, long order, long bias, unsigned long extras[2]) +static int post_process(grib_context* c, long* vals, long len, long order, long bias, unsigned long extras[2]) { - unsigned long last, penultimate, j=0; + unsigned long last, penultimate, j = 0; Assert(order > 0); Assert(order <= 3); - if(!vals) return GRIB_INTERNAL_ERROR; + if (!vals) + return GRIB_INTERNAL_ERROR; if (order == 1) { last = extras[0]; while (j < len) { - if (vals[j] == LONG_MAX) j++; + if (vals[j] == LONG_MAX) + j++; else { - vals[j++] = extras[0]; break; + vals[j++] = extras[0]; + break; } } while (j < len) { - if (vals[j] == LONG_MAX) j++; + if (vals[j] == LONG_MAX) + j++; else { vals[j] += last + bias; last = vals[j++]; @@ -361,16 +372,18 @@ static int post_process(grib_context *c, long* vals, long len, long order, long } else if (order == 2) { penultimate = extras[0]; - last = extras[1]; + last = extras[1]; while (j < len) { - if (vals[j] == LONG_MAX) j++; + if (vals[j] == LONG_MAX) + j++; else { vals[j++] = extras[0]; break; } } while (j < len) { - if (vals[j] == LONG_MAX) j++; + if (vals[j] == LONG_MAX) + j++; else { vals[j++] = extras[1]; break; @@ -378,9 +391,9 @@ static int post_process(grib_context *c, long* vals, long len, long order, long } for (; j < len; j++) { if (vals[j] != LONG_MAX) { - vals[j] = vals[j] + bias + last + last - penultimate; + vals[j] = vals[j] + bias + last + last - penultimate; penultimate = last; - last = vals[j]; + last = vals[j]; } } } @@ -431,38 +444,38 @@ static int de_spatial_difference (grib_context *c, unsigned long* vals, long le } #endif -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - grib_accessor_data_g22order_packing* self = (grib_accessor_data_g22order_packing*)a; + grib_accessor_data_g22order_packing* self = (grib_accessor_data_g22order_packing*)a; - size_t i = 0; - size_t j = 0; + size_t i = 0; + size_t j = 0; long n_vals = 0; - long vcount = 0; - int err = GRIB_SUCCESS; + long vcount = 0; + int err = GRIB_SUCCESS; - long* sec_val = NULL; + long* sec_val = NULL; grib_handle* gh = grib_handle_of_accessor(a); - unsigned char* buf = (unsigned char*)gh->buffer->data; - unsigned char* buf_ref = NULL; - unsigned char* buf_width = NULL; - unsigned char* buf_length = NULL; - unsigned char* buf_vals = NULL; + unsigned char* buf = (unsigned char*)gh->buffer->data; + unsigned char* buf_ref = NULL; + unsigned char* buf_width = NULL; + unsigned char* buf_length = NULL; + unsigned char* buf_vals = NULL; - long length_p = 0; - long ref_p = 0; - long width_p = 0; - long vals_p = 0; + long length_p = 0; + long ref_p = 0; + long width_p = 0; + long vals_p = 0; - long nvals_per_group = 0; - long nbits_per_group_val = 0; - long group_ref_val = 0; + long nvals_per_group = 0; + long nbits_per_group_val = 0; + long group_ref_val = 0; - long bits_per_value = 0; - double binary_s = 0; - double decimal_s = 0; - double reference_value = 0; + long bits_per_value = 0; + double binary_s = 0; + double decimal_s = 0; + double reference_value = 0; long binary_scale_factor; long decimal_scale_factor; @@ -480,132 +493,156 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len) long numberOfBitsUsedForTheScaledGroupLengths; long orderOfSpatialDifferencing; long numberOfOctetsExtraDescriptors; - double missingValue=0; - - err=grib_value_count(a,&n_vals); - if (err) return err; - - if((err = grib_get_long_internal(gh,self->bits_per_value,&bits_per_value )) != GRIB_SUCCESS) return err; - if((err = grib_get_double_internal(gh,self->reference_value,&reference_value )) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->binary_scale_factor,&binary_scale_factor )) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->decimal_scale_factor,&decimal_scale_factor )) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->typeOfOriginalFieldValues,&typeOfOriginalFieldValues )) != GRIB_SUCCESS) return err; + double missingValue = 0; + + err = grib_value_count(a, &n_vals); + if (err) + return err; + + if ((err = grib_get_long_internal(gh, self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_double_internal(gh, self->reference_value, &reference_value)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->typeOfOriginalFieldValues, &typeOfOriginalFieldValues)) != GRIB_SUCCESS) + return err; /* Don't call grib_get_long_internal to suppress error message being output */ - if((err = grib_get_long(gh,self->groupSplittingMethodUsed,&groupSplittingMethodUsed )) != GRIB_SUCCESS) return err; - - if((err = grib_get_long_internal(gh,self->missingValueManagementUsed,&missingValueManagementUsed )) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->primaryMissingValueSubstitute,&primaryMissingValueSubstitute )) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->secondaryMissingValueSubstitute,&secondaryMissingValueSubstitute )) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->numberOfGroupsOfDataValues,&numberOfGroupsOfDataValues )) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->referenceForGroupWidths,&referenceForGroupWidths )) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->numberOfBitsUsedForTheGroupWidths,&numberOfBitsUsedForTheGroupWidths )) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->referenceForGroupLengths,&referenceForGroupLengths )) != GRIB_SUCCESS) return err; - - if((err = grib_get_long_internal(gh,self->lengthIncrementForTheGroupLengths,&lengthIncrementForTheGroupLengths )) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->trueLengthOfLastGroup,&trueLengthOfLastGroup )) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->numberOfBitsUsedForTheScaledGroupLengths,&numberOfBitsUsedForTheScaledGroupLengths )) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->orderOfSpatialDifferencing,&orderOfSpatialDifferencing )) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->numberOfOctetsExtraDescriptors,&numberOfOctetsExtraDescriptors )) != GRIB_SUCCESS) return err; - if((err = grib_get_double_internal(gh,"missingValue", &missingValue)) != GRIB_SUCCESS) return err; - - self->dirty=0; - - sec_val = (long*)grib_context_malloc(a->context,(n_vals)*sizeof(long)); - if(!sec_val) return GRIB_OUT_OF_MEMORY; - memset(sec_val, 0, (n_vals)*sizeof(long)); /* See SUP-718 */ - - buf_ref = buf + a->offset ; - - ref_p = (numberOfGroupsOfDataValues*bits_per_value); - - if(orderOfSpatialDifferencing) ref_p += (1+orderOfSpatialDifferencing)*(numberOfOctetsExtraDescriptors*8); - - buf_width = buf_ref + (ref_p/8) + ((ref_p%8) ? 1 : 0); - - width_p = (numberOfGroupsOfDataValues*numberOfBitsUsedForTheGroupWidths); - buf_length = buf_width + (width_p/8) + ((width_p%8) ? 1 : 0); - - length_p = (numberOfGroupsOfDataValues*numberOfBitsUsedForTheScaledGroupLengths); - buf_vals = buf_length + (length_p/8) + ((length_p%8) ? 1 : 0); + if ((err = grib_get_long(gh, self->groupSplittingMethodUsed, &groupSplittingMethodUsed)) != GRIB_SUCCESS) + return err; + + if ((err = grib_get_long_internal(gh, self->missingValueManagementUsed, &missingValueManagementUsed)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->primaryMissingValueSubstitute, &primaryMissingValueSubstitute)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->secondaryMissingValueSubstitute, &secondaryMissingValueSubstitute)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->numberOfGroupsOfDataValues, &numberOfGroupsOfDataValues)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->referenceForGroupWidths, &referenceForGroupWidths)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->numberOfBitsUsedForTheGroupWidths, &numberOfBitsUsedForTheGroupWidths)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->referenceForGroupLengths, &referenceForGroupLengths)) != GRIB_SUCCESS) + return err; + + if ((err = grib_get_long_internal(gh, self->lengthIncrementForTheGroupLengths, &lengthIncrementForTheGroupLengths)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->trueLengthOfLastGroup, &trueLengthOfLastGroup)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->numberOfBitsUsedForTheScaledGroupLengths, &numberOfBitsUsedForTheScaledGroupLengths)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->orderOfSpatialDifferencing, &orderOfSpatialDifferencing)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->numberOfOctetsExtraDescriptors, &numberOfOctetsExtraDescriptors)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_double_internal(gh, "missingValue", &missingValue)) != GRIB_SUCCESS) + return err; + + self->dirty = 0; + + sec_val = (long*)grib_context_malloc(a->context, (n_vals) * sizeof(long)); + if (!sec_val) + return GRIB_OUT_OF_MEMORY; + memset(sec_val, 0, (n_vals) * sizeof(long)); /* See SUP-718 */ + + buf_ref = buf + a->offset; + + ref_p = (numberOfGroupsOfDataValues * bits_per_value); + + if (orderOfSpatialDifferencing) + ref_p += (1 + orderOfSpatialDifferencing) * (numberOfOctetsExtraDescriptors * 8); + + buf_width = buf_ref + (ref_p / 8) + ((ref_p % 8) ? 1 : 0); + + width_p = (numberOfGroupsOfDataValues * numberOfBitsUsedForTheGroupWidths); + buf_length = buf_width + (width_p / 8) + ((width_p % 8) ? 1 : 0); + + length_p = (numberOfGroupsOfDataValues * numberOfBitsUsedForTheScaledGroupLengths); + buf_vals = buf_length + (length_p / 8) + ((length_p % 8) ? 1 : 0); length_p = 0; - ref_p = orderOfSpatialDifferencing?(orderOfSpatialDifferencing+1)*(numberOfOctetsExtraDescriptors*8):0; + ref_p = orderOfSpatialDifferencing ? (orderOfSpatialDifferencing + 1) * (numberOfOctetsExtraDescriptors * 8) : 0; width_p = 0; vals_p = 0; vcount = 0; - for (i=0;i < numberOfGroupsOfDataValues;i++) { - group_ref_val = grib_decode_unsigned_long(buf_ref,&ref_p, bits_per_value); - nvals_per_group = grib_decode_unsigned_long(buf_length, &length_p,numberOfBitsUsedForTheScaledGroupLengths); - nbits_per_group_val = grib_decode_unsigned_long(buf_width, &width_p, numberOfBitsUsedForTheGroupWidths); + for (i = 0; i < numberOfGroupsOfDataValues; i++) { + group_ref_val = grib_decode_unsigned_long(buf_ref, &ref_p, bits_per_value); + nvals_per_group = grib_decode_unsigned_long(buf_length, &length_p, numberOfBitsUsedForTheScaledGroupLengths); + nbits_per_group_val = grib_decode_unsigned_long(buf_width, &width_p, numberOfBitsUsedForTheGroupWidths); - nvals_per_group *= lengthIncrementForTheGroupLengths; - nvals_per_group += referenceForGroupLengths; + nvals_per_group *= lengthIncrementForTheGroupLengths; + nvals_per_group += referenceForGroupLengths; nbits_per_group_val += referenceForGroupWidths; - if (i == numberOfGroupsOfDataValues-1) nvals_per_group = trueLengthOfLastGroup; - Assert (n_vals >= vcount+nvals_per_group); + if (i == numberOfGroupsOfDataValues - 1) + nvals_per_group = trueLengthOfLastGroup; + Assert(n_vals >= vcount + nvals_per_group); /*grib_decode_long_array(buf_vals, &vals_p, nbits_per_group_val, nvals_per_group, &sec_val[vcount]); */ - if (missingValueManagementUsed == 0) - { + if (missingValueManagementUsed == 0) { /* No explicit missing values included within data values */ - for(j=0; j < nvals_per_group;j++) { - DebugAssertAccess(sec_val, (long)(vcount+j), n_vals); - sec_val[vcount+j] = group_ref_val + grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); + for (j = 0; j < nvals_per_group; j++) { + DebugAssertAccess(sec_val, (long)(vcount + j), n_vals); + sec_val[vcount + j] = group_ref_val + grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); /*printf("sec_val[%ld]=%ld\n", vcount+j, sec_val[vcount+j]);*/ } } - else if (missingValueManagementUsed == 1) - { + else if (missingValueManagementUsed == 1) { /* Primary missing values included within data values */ - long maxn = 0; /* (1 << bits_per_value) - 1; */ - for (j=0; j < nvals_per_group;j++) { + long maxn = 0; /* (1 << bits_per_value) - 1; */ + for (j = 0; j < nvals_per_group; j++) { if (nbits_per_group_val == 0) { maxn = (1 << bits_per_value) - 1; if (group_ref_val == maxn) { - sec_val[vcount+j] = LONG_MAX; /* missing value */ - } else { - long temp = grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); - sec_val[vcount+j] = group_ref_val + temp; + sec_val[vcount + j] = LONG_MAX; /* missing value */ + } + else { + long temp = grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); + sec_val[vcount + j] = group_ref_val + temp; } } else { - long temp = grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); - maxn = (1 << nbits_per_group_val) - 1; + long temp = grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); + maxn = (1 << nbits_per_group_val) - 1; if (temp == maxn) { - sec_val[vcount+j] = LONG_MAX; /* missing value */ - } else { - sec_val[vcount+j] = group_ref_val + temp; + sec_val[vcount + j] = LONG_MAX; /* missing value */ + } + else { + sec_val[vcount + j] = group_ref_val + temp; } } } } - else if (missingValueManagementUsed == 2) - { + else if (missingValueManagementUsed == 2) { /* Primary and secondary missing values included within data values */ - long maxn = (1 << bits_per_value) - 1; - long maxn2 = 0; /* maxn - 1; */ - for (j=0; j < nvals_per_group;j++) { + long maxn = (1 << bits_per_value) - 1; + long maxn2 = 0; /* maxn - 1; */ + for (j = 0; j < nvals_per_group; j++) { if (nbits_per_group_val == 0) { maxn2 = maxn - 1; if (group_ref_val == maxn || group_ref_val == maxn2) { - sec_val[vcount+j] = LONG_MAX; /* missing value */ - } else { - long temp = grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); - sec_val[vcount+j] = group_ref_val + temp; + sec_val[vcount + j] = LONG_MAX; /* missing value */ + } + else { + long temp = grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); + sec_val[vcount + j] = group_ref_val + temp; } } else { - long temp = grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); - maxn = (1 << nbits_per_group_val) - 1; - maxn2 = maxn - 1; + long temp = grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); + maxn = (1 << nbits_per_group_val) - 1; + maxn2 = maxn - 1; if (temp == maxn || temp == maxn2) { - sec_val[vcount+j] = LONG_MAX; /* missing value */ - } else { - sec_val[vcount+j] = group_ref_val + temp; + sec_val[vcount + j] = LONG_MAX; /* missing value */ + } + else { + sec_val[vcount + j] = group_ref_val + temp; } } } @@ -615,83 +652,84 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len) } if (orderOfSpatialDifferencing) { - long bias = 0; + long bias = 0; unsigned long extras[2] = {0,}; - ref_p = 0; + ref_p = 0; /* For Complex packing, order == 0 */ /* For Complex packing and spatial differencing, order == 1 or 2 (code table 5.6) */ if (orderOfSpatialDifferencing != 1 && orderOfSpatialDifferencing != 2) { - grib_context_log(a->context,GRIB_LOG_ERROR, "Unsupported order of spatial differencing %ld", orderOfSpatialDifferencing); + grib_context_log(a->context, GRIB_LOG_ERROR, "Unsupported order of spatial differencing %ld", orderOfSpatialDifferencing); return GRIB_INTERNAL_ERROR; } - for(i=0;i < orderOfSpatialDifferencing;i++) { - extras[i] = grib_decode_unsigned_long(buf_ref, &ref_p, numberOfOctetsExtraDescriptors*8); + for (i = 0; i < orderOfSpatialDifferencing; i++) { + extras[i] = grib_decode_unsigned_long(buf_ref, &ref_p, numberOfOctetsExtraDescriptors * 8); } - bias = grib_decode_signed_longb(buf_ref, &ref_p, numberOfOctetsExtraDescriptors*8); + bias = grib_decode_signed_longb(buf_ref, &ref_p, numberOfOctetsExtraDescriptors * 8); post_process(a->context, sec_val, n_vals, orderOfSpatialDifferencing, bias, extras); /*de_spatial_difference (a->context, sec_val, n_vals, orderOfSpatialDifferencing, bias);*/ } - binary_s = grib_power(binary_scale_factor,2); - decimal_s = grib_power(-decimal_scale_factor,10) ; + binary_s = grib_power(binary_scale_factor, 2); + decimal_s = grib_power(-decimal_scale_factor, 10); - for (i=0; i < n_vals; i++) { + for (i = 0; i < n_vals; i++) { if (sec_val[i] == LONG_MAX) { val[i] = missingValue; - } else { - val[i] = (double) ((((double)sec_val[i])*binary_s)+reference_value)*decimal_s; + } + else { + val[i] = (double)((((double)sec_val[i]) * binary_s) + reference_value) * decimal_s; } } - grib_context_free(a->context,sec_val); + grib_context_free(a->context, sec_val); return err; } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { - grib_accessor_data_g22order_packing* self = (grib_accessor_data_g22order_packing*)a; - grib_handle* gh = grib_handle_of_accessor(a); + grib_accessor_data_g22order_packing* self = (grib_accessor_data_g22order_packing*)a; + grib_handle* gh = grib_handle_of_accessor(a); - size_t i = 0; - size_t j = 0; + size_t i = 0; + size_t j = 0; size_t n_vals = *len; - int err = 0; + int err = 0; - unsigned char* buf = NULL; - unsigned char* buf_ref = NULL; - unsigned char* buf_width = NULL; - unsigned char* buf_length = NULL; - unsigned char* buf_vals = NULL; + unsigned char* buf = NULL; + unsigned char* buf_ref = NULL; + unsigned char* buf_width = NULL; + unsigned char* buf_length = NULL; + unsigned char* buf_vals = NULL; - double d = 0; + double d = 0; double divisor = 0; - unsigned long* sec_val = NULL; - unsigned long* group_val = NULL; + unsigned long* sec_val = NULL; + unsigned long* group_val = NULL; double max; double min; - long length_p = 0; - long ref_p = 0; - long width_p = 0; - long vals_p = 0; + long length_p = 0; + long ref_p = 0; + long width_p = 0; + long vals_p = 0; - size_t nv = 0; - size_t buf_size = 0; + size_t nv = 0; + size_t buf_size = 0; - long bits_per_value = 0; + long bits_per_value = 0; - double reference_value = 0; + double reference_value = 0; - long nvals_per_group = 0; - long nbits_per_group_val = 0; - long group_ref_val = 0; + long nvals_per_group = 0; + long nbits_per_group_val = 0; + long group_ref_val = 0; long binary_scale_factor; long decimal_scale_factor; @@ -710,16 +748,20 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) long orderOfSpatialDifferencing; long numberOfOctetsExtraDescriptors; - long maxgrw ; - long maxgrl ; - char packingType[254]={0,}; - size_t slen=254; + long maxgrw; + long maxgrl; + char packingType[254] = {0,}; + size_t slen = 254; - if (*len ==0) return GRIB_NO_VALUES; + if (*len == 0) + return GRIB_NO_VALUES; - if((err = grib_get_long_internal(gh,self->bits_per_value,&bits_per_value )) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->decimal_scale_factor,&decimal_scale_factor )) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->typeOfOriginalFieldValues,&typeOfOriginalFieldValues )) != GRIB_SUCCESS) return err; + if ((err = grib_get_long_internal(gh, self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->typeOfOriginalFieldValues, &typeOfOriginalFieldValues)) != GRIB_SUCCESS) + return err; /*if((err = grib_get_long_internal(gh,self->groupSplittingMethodUsed,&groupSplittingMethodUsed )) != GRIB_SUCCESS) return err;*/ /* Key groupSplittingMethodUsed uses Code table 5.4 which has two entries: @@ -729,51 +771,60 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) */ groupSplittingMethodUsed = 1; - if((err = grib_get_long_internal(gh,self->missingValueManagementUsed,&missingValueManagementUsed )) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->primaryMissingValueSubstitute,&primaryMissingValueSubstitute )) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->secondaryMissingValueSubstitute,&secondaryMissingValueSubstitute )) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->numberOfBitsUsedForTheGroupWidths,&numberOfBitsUsedForTheGroupWidths )) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->numberOfBitsUsedForTheScaledGroupLengths,&numberOfBitsUsedForTheScaledGroupLengths )) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->orderOfSpatialDifferencing,&orderOfSpatialDifferencing)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->numberOfOctetsExtraDescriptors,&numberOfOctetsExtraDescriptors)) != GRIB_SUCCESS) return err; - - self->dirty=1; - - referenceForGroupWidths = 0; - referenceForGroupLengths =0; - lengthIncrementForTheGroupLengths = 1; - numberOfBitsUsedForTheGroupWidths = 4; + if ((err = grib_get_long_internal(gh, self->missingValueManagementUsed, &missingValueManagementUsed)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->primaryMissingValueSubstitute, &primaryMissingValueSubstitute)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->secondaryMissingValueSubstitute, &secondaryMissingValueSubstitute)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->numberOfBitsUsedForTheGroupWidths, &numberOfBitsUsedForTheGroupWidths)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->numberOfBitsUsedForTheScaledGroupLengths, &numberOfBitsUsedForTheScaledGroupLengths)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->orderOfSpatialDifferencing, &orderOfSpatialDifferencing)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->numberOfOctetsExtraDescriptors, &numberOfOctetsExtraDescriptors)) != GRIB_SUCCESS) + return err; + + self->dirty = 1; + + referenceForGroupWidths = 0; + referenceForGroupLengths = 0; + lengthIncrementForTheGroupLengths = 1; + numberOfBitsUsedForTheGroupWidths = 4; numberOfBitsUsedForTheScaledGroupLengths = 10; /* calculation of integer array */ - sec_val = (unsigned long*)grib_context_malloc(a->context,(n_vals)*sizeof(long)); - if(!sec_val) return GRIB_OUT_OF_MEMORY; + sec_val = (unsigned long*)grib_context_malloc(a->context, (n_vals) * sizeof(long)); + if (!sec_val) + return GRIB_OUT_OF_MEMORY; - d = grib_power(decimal_scale_factor,10) ; + d = grib_power(decimal_scale_factor, 10); max = val[0]; min = max; - for(i=0;i< n_vals;i++) - { - if ( val[i] > max ) max = val[i]; - else if ( val[i] < min ) min = val[i]; + for (i = 0; i < n_vals; i++) { + if (val[i] > max) + max = val[i]; + else if (val[i] < min) + min = val[i]; } min *= d; max *= d; - if (grib_get_nearest_smaller_value(gh,self->reference_value,min,&reference_value) - !=GRIB_SUCCESS) { - grib_context_log(a->context,GRIB_LOG_ERROR, - "unable to find nearest_smaller_value of %g for %s",min,self->reference_value); + if (grib_get_nearest_smaller_value(gh, self->reference_value, min, &reference_value) != GRIB_SUCCESS) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "unable to find nearest_smaller_value of %g for %s", min, self->reference_value); return GRIB_INTERNAL_ERROR; } - binary_scale_factor = grib_get_binary_scale_fact(max,reference_value,bits_per_value,&err); - if (err != GRIB_SUCCESS) return err; - divisor = grib_power(-binary_scale_factor,2); + binary_scale_factor = grib_get_binary_scale_fact(max, reference_value, bits_per_value, &err); + if (err != GRIB_SUCCESS) + return err; + divisor = grib_power(-binary_scale_factor, 2); - for(i=0;i< n_vals;i++) - sec_val[i] = (unsigned long)((((val[i]*d)-reference_value)*divisor)+0.5); + for (i = 0; i < n_vals; i++) + sec_val[i] = (unsigned long)((((val[i] * d) - reference_value) * divisor) + 0.5); group_val = sec_val; @@ -781,110 +832,135 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) maxgrl = calc_pow_2(numberOfBitsUsedForTheScaledGroupLengths); numberOfGroupsOfDataValues = 0; - nv = n_vals; - vals_p=0; + nv = n_vals; + vals_p = 0; - while(find_next_group(group_val,nv,maxgrw,maxgrl,&nbits_per_group_val,&nvals_per_group,&group_ref_val)==GRIB_SUCCESS){ + while (find_next_group(group_val, nv, maxgrw, maxgrl, &nbits_per_group_val, &nvals_per_group, &group_ref_val) == GRIB_SUCCESS) { numberOfGroupsOfDataValues++; - nv -= nvals_per_group; + nv -= nvals_per_group; group_val += nvals_per_group; - vals_p += nbits_per_group_val*nvals_per_group; + vals_p += nbits_per_group_val * nvals_per_group; } trueLengthOfLastGroup = nvals_per_group; - buf_size = (7+(numberOfGroupsOfDataValues*bits_per_value))/8; - buf_size += (7+(numberOfGroupsOfDataValues*numberOfBitsUsedForTheGroupWidths))/8; - buf_size += (7+(numberOfGroupsOfDataValues*numberOfBitsUsedForTheScaledGroupLengths))/8; + buf_size = (7 + (numberOfGroupsOfDataValues * bits_per_value)) / 8; + buf_size += (7 + (numberOfGroupsOfDataValues * numberOfBitsUsedForTheGroupWidths)) / 8; + buf_size += (7 + (numberOfGroupsOfDataValues * numberOfBitsUsedForTheScaledGroupLengths)) / 8; - buf_size += (vals_p/8) + ((vals_p%8) ? 1 : 0); + buf_size += (vals_p / 8) + ((vals_p % 8) ? 1 : 0); - buf = (unsigned char*)grib_context_malloc_clear(a->context,buf_size); + buf = (unsigned char*)grib_context_malloc_clear(a->context, buf_size); buf_ref = buf; - buf_width = buf_ref + (7+(numberOfGroupsOfDataValues*bits_per_value))/8; - buf_length = buf_width + (7+(numberOfGroupsOfDataValues*numberOfBitsUsedForTheGroupWidths))/8; - buf_vals = buf_length + (7+(numberOfGroupsOfDataValues*numberOfBitsUsedForTheScaledGroupLengths))/8; + buf_width = buf_ref + (7 + (numberOfGroupsOfDataValues * bits_per_value)) / 8; + buf_length = buf_width + (7 + (numberOfGroupsOfDataValues * numberOfBitsUsedForTheGroupWidths)) / 8; + buf_vals = buf_length + (7 + (numberOfGroupsOfDataValues * numberOfBitsUsedForTheScaledGroupLengths)) / 8; - nv = n_vals; + nv = n_vals; group_val = sec_val; - vals_p = 0; ref_p =0;width_p=0;length_p=0; - i = 0; - - while(find_next_group(group_val,nv,maxgrw,maxgrl,&nbits_per_group_val,&nvals_per_group,&group_ref_val)==GRIB_SUCCESS){ - grib_encode_unsigned_longb(buf_ref , group_ref_val , &ref_p , bits_per_value); - grib_encode_unsigned_longb(buf_width , nbits_per_group_val , &width_p , numberOfBitsUsedForTheGroupWidths); - grib_encode_unsigned_longb(buf_length, nvals_per_group , &length_p , numberOfBitsUsedForTheScaledGroupLengths); - - if(nbits_per_group_val) - for(j = 0; j < nvals_per_group; j++){ - grib_encode_unsigned_longb(buf_vals, sec_val[i+j]-group_ref_val ,&vals_p , nbits_per_group_val); + vals_p = 0; + ref_p = 0; + width_p = 0; + length_p = 0; + i = 0; + + while (find_next_group(group_val, nv, maxgrw, maxgrl, &nbits_per_group_val, &nvals_per_group, &group_ref_val) == GRIB_SUCCESS) { + grib_encode_unsigned_longb(buf_ref, group_ref_val, &ref_p, bits_per_value); + grib_encode_unsigned_longb(buf_width, nbits_per_group_val, &width_p, numberOfBitsUsedForTheGroupWidths); + grib_encode_unsigned_longb(buf_length, nvals_per_group, &length_p, numberOfBitsUsedForTheScaledGroupLengths); + + if (nbits_per_group_val) + for (j = 0; j < nvals_per_group; j++) { + grib_encode_unsigned_longb(buf_vals, sec_val[i + j] - group_ref_val, &vals_p, nbits_per_group_val); } - i+= nvals_per_group; + i += nvals_per_group; group_val += nvals_per_group; - nv-=nvals_per_group; + nv -= nvals_per_group; } /*fprintf(stdout,"spatial pack_double:: %ld bytes %lu marked\n", (ref_p+7)/8 + (width_p+7)/8 + (length_p+7)/8 + (vals_p+7)/8, buf_size);*/ - grib_buffer_replace(a, buf,buf_size,1,1); - grib_context_free (a->context,buf); - grib_context_free (a->context,sec_val); + grib_buffer_replace(a, buf, buf_size, 1, 1); + grib_context_free(a->context, buf); + grib_context_free(a->context, sec_val); - if((err = grib_set_long_internal(gh,self->bits_per_value,bits_per_value )) != GRIB_SUCCESS) return err; - if((err = grib_set_double_internal(gh,self->reference_value,reference_value )) != GRIB_SUCCESS) return err; + if ((err = grib_set_long_internal(gh, self->bits_per_value, bits_per_value)) != GRIB_SUCCESS) + return err; + if ((err = grib_set_double_internal(gh, self->reference_value, reference_value)) != GRIB_SUCCESS) + return err; { /* Make sure we can decode it again */ double ref = 1e-100; - grib_get_double_internal(gh,self->reference_value,&ref); + grib_get_double_internal(gh, self->reference_value, &ref); Assert(ref == reference_value); } - if((err = grib_set_long_internal(gh,self->binary_scale_factor,binary_scale_factor )) != GRIB_SUCCESS) return err; - if((err = grib_set_long_internal(gh,self->decimal_scale_factor,decimal_scale_factor )) != GRIB_SUCCESS) return err; - if((err = grib_set_long_internal(gh,self->typeOfOriginalFieldValues,typeOfOriginalFieldValues )) != GRIB_SUCCESS) return err; - if((err = grib_set_long_internal(gh,self->groupSplittingMethodUsed,groupSplittingMethodUsed )) != GRIB_SUCCESS) return err; - if((err = grib_set_long_internal(gh,self->missingValueManagementUsed,missingValueManagementUsed )) != GRIB_SUCCESS) return err; - if((err = grib_set_long_internal(gh,self->primaryMissingValueSubstitute,primaryMissingValueSubstitute )) != GRIB_SUCCESS) return err; - if((err = grib_set_long_internal(gh,self->secondaryMissingValueSubstitute,secondaryMissingValueSubstitute )) != GRIB_SUCCESS) return err; - if((err = grib_set_long_internal(gh,self->numberOfGroupsOfDataValues,numberOfGroupsOfDataValues )) != GRIB_SUCCESS) return err; - if((err = grib_set_long_internal(gh,self->referenceForGroupWidths,referenceForGroupWidths )) != GRIB_SUCCESS) return err; - if((err = grib_set_long_internal(gh,self->numberOfBitsUsedForTheGroupWidths,numberOfBitsUsedForTheGroupWidths )) != GRIB_SUCCESS) return err; - if((err = grib_set_long_internal(gh,self->referenceForGroupLengths,referenceForGroupLengths )) != GRIB_SUCCESS) return err; - if((err = grib_set_long_internal(gh,self->lengthIncrementForTheGroupLengths,lengthIncrementForTheGroupLengths )) != GRIB_SUCCESS) return err; - if((err = grib_set_long_internal(gh,self->trueLengthOfLastGroup,trueLengthOfLastGroup )) != GRIB_SUCCESS) return err; - if((err = grib_set_long_internal(gh,self->numberOfBitsUsedForTheScaledGroupLengths,numberOfBitsUsedForTheScaledGroupLengths )) != GRIB_SUCCESS) return err; + if ((err = grib_set_long_internal(gh, self->binary_scale_factor, binary_scale_factor)) != GRIB_SUCCESS) + return err; + if ((err = grib_set_long_internal(gh, self->decimal_scale_factor, decimal_scale_factor)) != GRIB_SUCCESS) + return err; + if ((err = grib_set_long_internal(gh, self->typeOfOriginalFieldValues, typeOfOriginalFieldValues)) != GRIB_SUCCESS) + return err; + if ((err = grib_set_long_internal(gh, self->groupSplittingMethodUsed, groupSplittingMethodUsed)) != GRIB_SUCCESS) + return err; + if ((err = grib_set_long_internal(gh, self->missingValueManagementUsed, missingValueManagementUsed)) != GRIB_SUCCESS) + return err; + if ((err = grib_set_long_internal(gh, self->primaryMissingValueSubstitute, primaryMissingValueSubstitute)) != GRIB_SUCCESS) + return err; + if ((err = grib_set_long_internal(gh, self->secondaryMissingValueSubstitute, secondaryMissingValueSubstitute)) != GRIB_SUCCESS) + return err; + if ((err = grib_set_long_internal(gh, self->numberOfGroupsOfDataValues, numberOfGroupsOfDataValues)) != GRIB_SUCCESS) + return err; + if ((err = grib_set_long_internal(gh, self->referenceForGroupWidths, referenceForGroupWidths)) != GRIB_SUCCESS) + return err; + if ((err = grib_set_long_internal(gh, self->numberOfBitsUsedForTheGroupWidths, numberOfBitsUsedForTheGroupWidths)) != GRIB_SUCCESS) + return err; + if ((err = grib_set_long_internal(gh, self->referenceForGroupLengths, referenceForGroupLengths)) != GRIB_SUCCESS) + return err; + if ((err = grib_set_long_internal(gh, self->lengthIncrementForTheGroupLengths, lengthIncrementForTheGroupLengths)) != GRIB_SUCCESS) + return err; + if ((err = grib_set_long_internal(gh, self->trueLengthOfLastGroup, trueLengthOfLastGroup)) != GRIB_SUCCESS) + return err; + if ((err = grib_set_long_internal(gh, self->numberOfBitsUsedForTheScaledGroupLengths, numberOfBitsUsedForTheScaledGroupLengths)) != GRIB_SUCCESS) + return err; err = grib_get_string(gh, "packingType", packingType, &slen); - if (!err && strcmp(packingType, "grid_complex_spatial_differencing")==0) { - if((err = grib_set_long_internal(gh,self->orderOfSpatialDifferencing,0 )) != GRIB_SUCCESS) return err; - if((err = grib_set_long_internal(gh,self->numberOfOctetsExtraDescriptors,0 )) != GRIB_SUCCESS) return err; + if (!err && strcmp(packingType, "grid_complex_spatial_differencing") == 0) { + if ((err = grib_set_long_internal(gh, self->orderOfSpatialDifferencing, 0)) != GRIB_SUCCESS) + return err; + if ((err = grib_set_long_internal(gh, self->numberOfOctetsExtraDescriptors, 0)) != GRIB_SUCCESS) + return err; } /* ECC-259: Set correct number of values */ - if((err = grib_set_long_internal(gh,self->numberOfValues,*len )) != GRIB_SUCCESS) return err; + if ((err = grib_set_long_internal(gh, self->numberOfValues, *len)) != GRIB_SUCCESS) + return err; return GRIB_SUCCESS; } static int unpack_double_element(grib_accessor* a, size_t idx, double* val) { - size_t size = 0; + size_t size = 0; double* values = NULL; - int err=grib_get_size(grib_handle_of_accessor(a),"codedValues",&size); - if (err) return err; - if (idx > size) return GRIB_INVALID_NEAREST; - - values=(double*)grib_context_malloc_clear(a->context,size*sizeof(double)); - err=grib_get_double_array(grib_handle_of_accessor(a),"codedValues",values,&size); - if (err) return err; - *val=values[idx]; - grib_context_free(a->context,values); + int err = grib_get_size(grib_handle_of_accessor(a), "codedValues", &size); + if (err) + return err; + if (idx > size) + return GRIB_INVALID_NEAREST; + + values = (double*)grib_context_malloc_clear(a->context, size * sizeof(double)); + err = grib_get_double_array(grib_handle_of_accessor(a), "codedValues", values, &size); + if (err) + return err; + *val = values[idx]; + grib_context_free(a->context, values); return err; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - grib_accessor_data_g22order_packing* self = (grib_accessor_data_g22order_packing*)a; - *count = 0; - return grib_get_long_internal(grib_handle_of_accessor(a),self->numberOfValues, count); + grib_accessor_data_g22order_packing* self = (grib_accessor_data_g22order_packing*)a; + *count = 0; + return grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfValues, count); } diff --git a/src/grib_accessor_class_data_g2bifourier_packing.c b/src/grib_accessor_class_data_g2bifourier_packing.c index 91ff4da6c..9c6ee6951 100644 --- a/src/grib_accessor_class_data_g2bifourier_packing.c +++ b/src/grib_accessor_class_data_g2bifourier_packing.c @@ -53,91 +53,92 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_data_g2bifourier_packing { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in values */ - int carg; - const char* seclen; - const char* offsetdata; - const char* offsetsection; - int dirty; -/* Members defined in data_simple_packing */ - int edition; - const char* units_factor; - const char* units_bias; - const char* changing_precision; - const char* number_of_values; - const char* bits_per_value; - const char* reference_value; - const char* binary_scale_factor; - const char* decimal_scale_factor; - const char* optimize_scaling_factor; -/* Members defined in data_g2bifourier_packing */ - const char* ieee_floats; - const char* laplacianOperatorIsSet; - const char* laplacianOperator; - const char* biFourierTruncationType; - const char* sub_i; - const char* sub_j; - const char* bif_i; - const char* bif_j; - const char* biFourierSubTruncationType; - const char* biFourierDoNotPackAxes; - const char* biFourierMakeTemplate; - const char* totalNumberOfValuesInUnpackedSubset; - const char* numberOfValues; +typedef struct grib_accessor_data_g2bifourier_packing +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in values */ + int carg; + const char* seclen; + const char* offsetdata; + const char* offsetsection; + int dirty; + /* Members defined in data_simple_packing */ + int edition; + const char* units_factor; + const char* units_bias; + const char* changing_precision; + const char* number_of_values; + const char* bits_per_value; + const char* reference_value; + const char* binary_scale_factor; + const char* decimal_scale_factor; + const char* optimize_scaling_factor; + /* Members defined in data_g2bifourier_packing */ + const char* ieee_floats; + const char* laplacianOperatorIsSet; + const char* laplacianOperator; + const char* biFourierTruncationType; + const char* sub_i; + const char* sub_j; + const char* bif_i; + const char* bif_j; + const char* biFourierSubTruncationType; + const char* biFourierDoNotPackAxes; + const char* biFourierMakeTemplate; + const char* totalNumberOfValuesInUnpackedSubset; + const char* numberOfValues; } grib_accessor_data_g2bifourier_packing; extern grib_accessor_class* grib_accessor_class_data_simple_packing; static grib_accessor_class _grib_accessor_class_data_g2bifourier_packing = { - &grib_accessor_class_data_simple_packing, /* super */ - "data_g2bifourier_packing", /* name */ - sizeof(grib_accessor_data_g2bifourier_packing), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_data_simple_packing, /* super */ + "data_g2bifourier_packing", /* name */ + sizeof(grib_accessor_data_g2bifourier_packing), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -146,81 +147,81 @@ grib_accessor_class* grib_accessor_class_data_g2bifourier_packing = &_grib_acces static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ typedef unsigned long (*encode_float_proc)(double); -typedef double (*decode_float_proc)(unsigned long); +typedef double (*decode_float_proc)(unsigned long); -static void init(grib_accessor* a,const long v, grib_arguments* args) +static void init(grib_accessor* a, const long v, grib_arguments* args) { - grib_accessor_data_g2bifourier_packing *self =(grib_accessor_data_g2bifourier_packing*)a; - grib_handle* gh = grib_handle_of_accessor(a); - - self->ieee_floats = grib_arguments_get_name(gh,args,self->carg++); - self->laplacianOperatorIsSet = grib_arguments_get_name(gh,args,self->carg++); - self->laplacianOperator = grib_arguments_get_name(gh,args,self->carg++); - self->biFourierTruncationType = grib_arguments_get_name(gh,args,self->carg++); - self->sub_i = grib_arguments_get_name(gh,args,self->carg++); - self->sub_j = grib_arguments_get_name(gh,args,self->carg++); - self->bif_i = grib_arguments_get_name(gh,args,self->carg++); - self->bif_j = grib_arguments_get_name(gh,args,self->carg++); - self->biFourierSubTruncationType = grib_arguments_get_name(gh,args,self->carg++); - self->biFourierDoNotPackAxes = grib_arguments_get_name(gh,args,self->carg++); - self->biFourierMakeTemplate = grib_arguments_get_name(gh,args,self->carg++); - self->totalNumberOfValuesInUnpackedSubset = grib_arguments_get_name(gh,args,self->carg++); + grib_accessor_data_g2bifourier_packing* self = (grib_accessor_data_g2bifourier_packing*)a; + grib_handle* gh = grib_handle_of_accessor(a); + + self->ieee_floats = grib_arguments_get_name(gh, args, self->carg++); + self->laplacianOperatorIsSet = grib_arguments_get_name(gh, args, self->carg++); + self->laplacianOperator = grib_arguments_get_name(gh, args, self->carg++); + self->biFourierTruncationType = grib_arguments_get_name(gh, args, self->carg++); + self->sub_i = grib_arguments_get_name(gh, args, self->carg++); + self->sub_j = grib_arguments_get_name(gh, args, self->carg++); + self->bif_i = grib_arguments_get_name(gh, args, self->carg++); + self->bif_j = grib_arguments_get_name(gh, args, self->carg++); + self->biFourierSubTruncationType = grib_arguments_get_name(gh, args, self->carg++); + self->biFourierDoNotPackAxes = grib_arguments_get_name(gh, args, self->carg++); + self->biFourierMakeTemplate = grib_arguments_get_name(gh, args, self->carg++); + self->totalNumberOfValuesInUnpackedSubset = grib_arguments_get_name(gh, args, self->carg++); /*self->numberOfValues = grib_arguments_get_name(gh,args,self->carg++);*/ a->flags |= GRIB_ACCESSOR_FLAG_DATA; - self->dirty=1; + self->dirty = 1; } -static int value_count(grib_accessor* a,long* numberOfValues) +static int value_count(grib_accessor* a, long* numberOfValues) { - grib_accessor_data_g2bifourier_packing* self = (grib_accessor_data_g2bifourier_packing*)a; - grib_handle* gh = grib_handle_of_accessor(a); - *numberOfValues=0; + grib_accessor_data_g2bifourier_packing* self = (grib_accessor_data_g2bifourier_packing*)a; + grib_handle* gh = grib_handle_of_accessor(a); + *numberOfValues = 0; - return grib_get_long_internal(gh,self->number_of_values,numberOfValues); + return grib_get_long_internal(gh, self->number_of_values, numberOfValues); } -#define MAX(x,y) ((x) > (y) ? (x) : (y)) -#define MIN(x,y) ((x) < (y) ? (x) : (y)) +#define MAX(x, y) ((x) > (y) ? (x) : (y)) +#define MIN(x, y) ((x) < (y) ? (x) : (y)) -static void ellipse (long ni, long nj, long itrunc[], long jtrunc[]) +static void ellipse(long ni, long nj, long itrunc[], long jtrunc[]) { - const double zeps = 1.E-10; - const double zauxil=0.; + const double zeps = 1.E-10; + const double zauxil = 0.; int i, j; double zi, zj; @@ -228,19 +229,16 @@ static void ellipse (long ni, long nj, long itrunc[], long jtrunc[]) * 1. Computing meridional limit wavenumbers along zonal wavenumbers */ - for (j = 1; j < nj; j++) - { - zi = (double)ni / (double)nj * sqrt (MAX (zauxil, (double)(nj * nj - j * j))); + for (j = 1; j < nj; j++) { + zi = (double)ni / (double)nj * sqrt(MAX(zauxil, (double)(nj * nj - j * j))); itrunc[j] = (int)(zi + zeps); } - if (nj == 0) - { + if (nj == 0) { itrunc[0] = ni; } - else - { - itrunc[0] = ni; + else { + itrunc[0] = ni; itrunc[nj] = 0; } @@ -248,24 +246,21 @@ static void ellipse (long ni, long nj, long itrunc[], long jtrunc[]) * 2. Computing zonal limit wavenumbers along meridional wavenumbers */ - for (i = 1; i < ni; i++) - { - zj = (double)nj / (double)ni * sqrt (MAX (zauxil, (double)(ni * ni - i * i))); + for (i = 1; i < ni; i++) { + zj = (double)nj / (double)ni * sqrt(MAX(zauxil, (double)(ni * ni - i * i))); jtrunc[i] = (int)(zj + zeps); } - if (ni == 0) - { + if (ni == 0) { jtrunc[0] = nj; } - else - { - jtrunc[0] = nj; + else { + jtrunc[0] = nj; jtrunc[ni] = 0; } } -static void rectangle (long ni, long nj, long itrunc[], long jtrunc[]) +static void rectangle(long ni, long nj, long itrunc[], long jtrunc[]) { int i, j; @@ -282,10 +277,9 @@ static void rectangle (long ni, long nj, long itrunc[], long jtrunc[]) for (i = 0; i <= ni; i++) jtrunc[i] = nj; - } -static void diamond (long ni, long nj, long itrunc[], long jtrunc[]) +static void diamond(long ni, long nj, long itrunc[], long jtrunc[]) { int i, j; @@ -300,28 +294,26 @@ static void diamond (long ni, long nj, long itrunc[], long jtrunc[]) else for (i = 0; i <= ni; i++) jtrunc[i] = nj - (i * nj) / ni; - } -#define scals(i,j) pow((double)((i)*(i)+(j)*(j)),bt->laplacianOperator) +#define scals(i, j) pow((double)((i) * (i) + (j) * (j)), bt->laplacianOperator) -#define for_ij() \ - for (j = 0; j <= bt->bif_j; j++) \ +#define for_ij() \ + for (j = 0; j <= bt->bif_j; j++) \ for (i = 0; i <= bt->itruncation_bif[j]; i++) -#define calc_insub() \ - do { \ - insub = (i <= bt->sub_i) && (j <= bt->sub_j); \ - if (insub) \ - { \ - int insubi = (i <= bt->itruncation_sub[j]); \ - int insubj = (j <= bt->jtruncation_sub[i]); \ - insub = insubi && insubj; \ - } \ - if (bt->keepaxes) \ - insub = insub || (i == 0) || (j == 0); \ - } while (0) +#define calc_insub() \ + do { \ + insub = (i <= bt->sub_i) && (j <= bt->sub_j); \ + if (insub) { \ + int insubi = (i <= bt->itruncation_sub[j]); \ + int insubj = (j <= bt->jtruncation_sub[i]); \ + insub = insubi && insubj; \ + } \ + if (bt->keepaxes) \ + insub = insub || (i == 0) || (j == 0); \ + } while (0) typedef struct bif_trunc_t { @@ -340,17 +332,17 @@ typedef struct bif_trunc_t decode_float_proc decode_float; encode_float_proc encode_float; int bytes; - long * itruncation_bif; - long * jtruncation_bif; - long * itruncation_sub; - long * jtruncation_sub; + long* itruncation_bif; + long* jtruncation_bif; + long* itruncation_sub; + long* jtruncation_sub; size_t n_vals_bif, n_vals_sub; } bif_trunc_t; /* * Total number of coefficients */ -static size_t size_bif (bif_trunc_t * bt) +static size_t size_bif(bif_trunc_t* bt) { size_t n_vals = 0; int j; @@ -362,15 +354,15 @@ static size_t size_bif (bif_trunc_t * bt) /* * Number of unpacked coefficients */ -static size_t size_sub (bif_trunc_t * bt) +static size_t size_sub(bif_trunc_t* bt) { size_t n_vals = 0; int i, j; - for_ij () + for_ij() { int insub; - calc_insub (); + calc_insub(); if (insub) n_vals += 4; @@ -378,21 +370,21 @@ static size_t size_sub (bif_trunc_t * bt) return n_vals; } -static double laplam (bif_trunc_t * bt, const double val[]) +static double laplam(bif_trunc_t* bt, const double val[]) { /* * For bi-Fourier spectral fields, the Laplacian operator is a multiplication by (i*i+j*j) */ const double zeps = 1E-15; - double * znorm = NULL, * zw = NULL; - int kmax = 1 + bt->bif_i * bt->bif_i + bt->bif_j * bt->bif_j, lmax; - int * itab1 = NULL, * itab2 = NULL; + double *znorm = NULL, *zw = NULL; + int kmax = 1 + bt->bif_i * bt->bif_i + bt->bif_j * bt->bif_j, lmax; + int *itab1 = NULL, *itab2 = NULL; int i, j, k, l, isp; double zxmw, zymw, zwsum, zx, zy, zsum1, zsum2, zbeta1, zp; - itab1 = (int *)malloc (sizeof (int) * kmax); - itab2 = (int *)malloc (sizeof (int) * ((1 + bt->bif_i) * (1 + bt->bif_j))); + itab1 = (int*)malloc(sizeof(int) * kmax); + itab2 = (int*)malloc(sizeof(int) * ((1 + bt->bif_i) * (1 + bt->bif_j))); for (k = 0; k < kmax; k++) itab1[k] = 0; @@ -400,23 +392,21 @@ static double laplam (bif_trunc_t * bt, const double val[]) /* * Keep record of the possible values of i**2+j**2 outside the non-packed truncation */ - for_ij () + for_ij() { int insub; - calc_insub (); + calc_insub(); - if (! insub) - { - const int kk = i*i+j*j; - itab1[kk] = 1; + if (!insub) { + const int kk = i * i + j * j; + itab1[kk] = 1; } } l = 0; for (k = 0; k < kmax; k++) - if (itab1[k]) - { + if (itab1[k]) { itab2[l] = k; itab1[k] = l; l++; @@ -427,8 +417,8 @@ static double laplam (bif_trunc_t * bt, const double val[]) * Now, itab2 contains all possible values of i*i+j*j, and itab1 contains * the rank of all i*i+j*j */ - znorm = (double *)malloc (sizeof (double) * lmax); - zw = (double *)malloc (sizeof (double) * lmax); + znorm = (double*)malloc(sizeof(double) * lmax); + zw = (double*)malloc(sizeof(double) * lmax); /* * Compute norms of input field, gathered by values of i**2+j**2; we have to @@ -438,48 +428,43 @@ static double laplam (bif_trunc_t * bt, const double val[]) znorm[l] = 0.; isp = 0; - for_ij () + for_ij() { int insub; - calc_insub (); + calc_insub(); - if (insub) - { + if (insub) { isp += 4; } - else - { - int m, ll = itab1[i*i+j*j]; + else { + int m, ll = itab1[i * i + j * j]; for (m = 0; m < 4; m++, isp++) - znorm[ll] = MAX (znorm[ll], fabs (val[isp])); + znorm[ll] = MAX(znorm[ll], fabs(val[isp])); } } /* * Compute weights, fix very small norms to avoid problems with log function */ - for (l = 0; l < lmax; l++) - { + for (l = 0; l < lmax; l++) { zw[l] = (double)lmax / (double)(l + 1); - if (znorm[l] < zeps) - { + if (znorm[l] < zeps) { znorm[l] = zeps; - zw[l] = 100. * zeps; + zw[l] = 100. * zeps; } } /* * Sum weights */ - zxmw = 0.; - zymw = 0.; + zxmw = 0.; + zymw = 0.; zwsum = 0.; - for (l = 0; l < lmax; l++) - { - zx = log (itab2[l]); - zy = log (znorm[l]); + for (l = 0; l < lmax; l++) { + zx = log(itab2[l]); + zy = log(znorm[l]); zxmw += zx * zw[l]; zymw += zy * zw[l]; zwsum += zw[l]; @@ -488,208 +473,217 @@ static double laplam (bif_trunc_t * bt, const double val[]) /* * Least square regression */ - zxmw = zxmw / zwsum; - zymw = zymw / zwsum; + zxmw = zxmw / zwsum; + zymw = zymw / zwsum; zsum1 = 0.; zsum2 = 0.; - for (l = 0; l < lmax; l++) - { - zx = log (itab2[l]); - zy = log (znorm[l]); + for (l = 0; l < lmax; l++) { + zx = log(itab2[l]); + zy = log(znorm[l]); zsum1 += zw[l] * (zy - zymw) * (zx - zxmw); zsum2 += zw[l] * (zx - zxmw) * (zx - zxmw); } zbeta1 = zsum1 / zsum2; - zp = -zbeta1; - zp = MAX (-9.999, MIN (9.999, zp)); + zp = -zbeta1; + zp = MAX(-9.999, MIN(9.999, zp)); - free (itab1); - free (itab2); + free(itab1); + free(itab2); - free (znorm); - free (zw); + free(znorm); + free(zw); /*zp = ((long)(zp * 1000.)) / 1000.; FAPULA rounds Laplacian power to 1/1000th*/ return zp; } -static void free_bif_trunc (bif_trunc_t * bt, grib_accessor * a) +static void free_bif_trunc(bif_trunc_t* bt, grib_accessor* a) { grib_handle* gh = grib_handle_of_accessor(a); if (bt == NULL) return; - if (bt->itruncation_bif != NULL) free (bt->itruncation_bif); - if (bt->jtruncation_bif != NULL) free (bt->jtruncation_bif); - if (bt->itruncation_sub != NULL) free (bt->itruncation_sub); - if (bt->jtruncation_sub != NULL) free (bt->jtruncation_sub); - memset (bt, 0, sizeof (bif_trunc_t)); - grib_context_free (gh->context, bt); + if (bt->itruncation_bif != NULL) + free(bt->itruncation_bif); + if (bt->jtruncation_bif != NULL) + free(bt->jtruncation_bif); + if (bt->itruncation_sub != NULL) + free(bt->itruncation_sub); + if (bt->jtruncation_sub != NULL) + free(bt->jtruncation_sub); + memset(bt, 0, sizeof(bif_trunc_t)); + grib_context_free(gh->context, bt); } -static bif_trunc_t * new_bif_trunc (grib_accessor * a, grib_accessor_data_g2bifourier_packing * self) +static bif_trunc_t* new_bif_trunc(grib_accessor* a, grib_accessor_data_g2bifourier_packing* self) { int ret; grib_handle* gh = grib_handle_of_accessor(a); - bif_trunc_t * bt = (bif_trunc_t *)grib_context_malloc (gh->context, sizeof (bif_trunc_t)); + bif_trunc_t* bt = (bif_trunc_t*)grib_context_malloc(gh->context, sizeof(bif_trunc_t)); - memset (bt, 0, sizeof (bif_trunc_t)); + memset(bt, 0, sizeof(bif_trunc_t)); - if ((ret = grib_get_double_internal (gh, self->reference_value, &bt->reference_value)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(gh, self->reference_value, &bt->reference_value)) != GRIB_SUCCESS) goto cleanup; - if ((ret = grib_get_long_internal (gh, self->bits_per_value, &bt->bits_per_value)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->bits_per_value, &bt->bits_per_value)) != GRIB_SUCCESS) goto cleanup; - if ((ret = grib_get_long_internal (gh, self->binary_scale_factor, &bt->binary_scale_factor)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->binary_scale_factor, &bt->binary_scale_factor)) != GRIB_SUCCESS) goto cleanup; - if ((ret = grib_get_long_internal (gh, self->decimal_scale_factor, &bt->decimal_scale_factor)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->decimal_scale_factor, &bt->decimal_scale_factor)) != GRIB_SUCCESS) goto cleanup; - if ((ret = grib_get_long_internal (gh, self->ieee_floats, &bt->ieee_floats)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->ieee_floats, &bt->ieee_floats)) != GRIB_SUCCESS) goto cleanup; - if ((ret = grib_get_long_internal (gh, self->laplacianOperatorIsSet, &bt->laplacianOperatorIsSet)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->laplacianOperatorIsSet, &bt->laplacianOperatorIsSet)) != GRIB_SUCCESS) goto cleanup; - if ((ret = grib_get_double_internal (gh, self->laplacianOperator, &bt->laplacianOperator)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(gh, self->laplacianOperator, &bt->laplacianOperator)) != GRIB_SUCCESS) goto cleanup; - if ((ret = grib_get_long_internal (gh, self->sub_i, &bt->sub_i)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->sub_i, &bt->sub_i)) != GRIB_SUCCESS) goto cleanup; - if ((ret = grib_get_long_internal (gh, self->sub_j, &bt->sub_j)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->sub_j, &bt->sub_j)) != GRIB_SUCCESS) goto cleanup; - if ((ret = grib_get_long_internal (gh, self->bif_i, &bt->bif_i)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->bif_i, &bt->bif_i)) != GRIB_SUCCESS) goto cleanup; - if ((ret = grib_get_long_internal (gh, self->bif_j, &bt->bif_j)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->bif_j, &bt->bif_j)) != GRIB_SUCCESS) goto cleanup; - if ((ret = grib_get_long_internal (gh, self->biFourierTruncationType, &bt->biFourierTruncationType)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->biFourierTruncationType, &bt->biFourierTruncationType)) != GRIB_SUCCESS) goto cleanup; - if ((ret = grib_get_long_internal (gh, self->biFourierSubTruncationType, &bt->biFourierSubTruncationType)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->biFourierSubTruncationType, &bt->biFourierSubTruncationType)) != GRIB_SUCCESS) goto cleanup; - if ((ret = grib_get_long_internal (gh, self->biFourierDoNotPackAxes, &bt->keepaxes)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->biFourierDoNotPackAxes, &bt->keepaxes)) != GRIB_SUCCESS) goto cleanup; - if ((ret = grib_get_long_internal (gh, self->biFourierMakeTemplate, &bt->maketemplate)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->biFourierMakeTemplate, &bt->maketemplate)) != GRIB_SUCCESS) goto cleanup; - switch (bt->ieee_floats) - { - case 0: - bt->decode_float = grib_long_to_ibm; - bt->encode_float = grib_ibm_to_long; - bt->bytes = 4; - break; - case 1: - bt->decode_float = grib_long_to_ieee; - bt->encode_float = grib_ieee_to_long; - bt->bytes = 4; - break; - case 2: - bt->decode_float = grib_long_to_ieee64; - bt->encode_float = grib_ieee64_to_long; - bt->bytes = 8; - break; - default: - ret = GRIB_NOT_IMPLEMENTED; - goto cleanup; + switch (bt->ieee_floats) { + case 0: + bt->decode_float = grib_long_to_ibm; + bt->encode_float = grib_ibm_to_long; + bt->bytes = 4; + break; + case 1: + bt->decode_float = grib_long_to_ieee; + bt->encode_float = grib_ieee_to_long; + bt->bytes = 4; + break; + case 2: + bt->decode_float = grib_long_to_ieee64; + bt->encode_float = grib_ieee64_to_long; + bt->bytes = 8; + break; + default: + ret = GRIB_NOT_IMPLEMENTED; + goto cleanup; } - bt->itruncation_sub = (long *)grib_context_malloc(gh->context, sizeof(long)*(1+bt->sub_j)); - bt->jtruncation_sub = (long *)grib_context_malloc(gh->context, sizeof(long)*(1+bt->sub_i)); - bt->itruncation_bif = (long *)grib_context_malloc(gh->context, sizeof(long)*(1+bt->bif_j)); - bt->jtruncation_bif = (long *)grib_context_malloc(gh->context, sizeof(long)*(1+bt->bif_i)); + bt->itruncation_sub = (long*)grib_context_malloc(gh->context, sizeof(long) * (1 + bt->sub_j)); + bt->jtruncation_sub = (long*)grib_context_malloc(gh->context, sizeof(long) * (1 + bt->sub_i)); + bt->itruncation_bif = (long*)grib_context_malloc(gh->context, sizeof(long) * (1 + bt->bif_j)); + bt->jtruncation_bif = (long*)grib_context_malloc(gh->context, sizeof(long) * (1 + bt->bif_i)); #define RECTANGLE 77 -#define ELLIPSE 88 -#define DIAMOND 99 - - switch (bt->biFourierTruncationType) - { - case RECTANGLE: rectangle (bt->bif_i, bt->bif_j, bt->itruncation_bif, bt->jtruncation_bif); break; - case ELLIPSE : ellipse (bt->bif_i, bt->bif_j, bt->itruncation_bif, bt->jtruncation_bif); break; - case DIAMOND : diamond (bt->bif_i, bt->bif_j, bt->itruncation_bif, bt->jtruncation_bif); break; - default: - ret = GRIB_INVALID_KEY_VALUE; - goto cleanup; +#define ELLIPSE 88 +#define DIAMOND 99 + + switch (bt->biFourierTruncationType) { + case RECTANGLE: + rectangle(bt->bif_i, bt->bif_j, bt->itruncation_bif, bt->jtruncation_bif); + break; + case ELLIPSE: + ellipse(bt->bif_i, bt->bif_j, bt->itruncation_bif, bt->jtruncation_bif); + break; + case DIAMOND: + diamond(bt->bif_i, bt->bif_j, bt->itruncation_bif, bt->jtruncation_bif); + break; + default: + ret = GRIB_INVALID_KEY_VALUE; + goto cleanup; } - switch (bt->biFourierSubTruncationType) - { - case RECTANGLE: rectangle (bt->sub_i, bt->sub_j, bt->itruncation_sub, bt->jtruncation_sub); break; - case ELLIPSE : ellipse (bt->sub_i, bt->sub_j, bt->itruncation_sub, bt->jtruncation_sub); break; - case DIAMOND : diamond (bt->sub_i, bt->sub_j, bt->itruncation_sub, bt->jtruncation_sub); break; - default: - ret = GRIB_INVALID_KEY_VALUE; - goto cleanup; + switch (bt->biFourierSubTruncationType) { + case RECTANGLE: + rectangle(bt->sub_i, bt->sub_j, bt->itruncation_sub, bt->jtruncation_sub); + break; + case ELLIPSE: + ellipse(bt->sub_i, bt->sub_j, bt->itruncation_sub, bt->jtruncation_sub); + break; + case DIAMOND: + diamond(bt->sub_i, bt->sub_j, bt->itruncation_sub, bt->jtruncation_sub); + break; + default: + ret = GRIB_INVALID_KEY_VALUE; + goto cleanup; } - bt->n_vals_bif = size_bif (bt); - bt->n_vals_sub = size_sub (bt); + bt->n_vals_bif = size_bif(bt); + bt->n_vals_sub = size_sub(bt); return bt; cleanup: - free_bif_trunc (bt, a); + free_bif_trunc(bt, a); return NULL; } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - grib_accessor_data_g2bifourier_packing* self = (grib_accessor_data_g2bifourier_packing*)a; - grib_handle* gh = grib_handle_of_accessor(a); + grib_accessor_data_g2bifourier_packing* self = (grib_accessor_data_g2bifourier_packing*)a; + grib_handle* gh = grib_handle_of_accessor(a); unsigned char* buf = (unsigned char*)gh->buffer->data; unsigned char* hres = NULL; unsigned char* lres = NULL; unsigned long packed_offset; - long hpos = 0; - long lpos = 0; + long hpos = 0; + long lpos = 0; int isp; - bif_trunc_t * bt = NULL; + bif_trunc_t* bt = NULL; long count = 0; - long offsetdata = 0; + long offsetdata = 0; double s = 0; double d = 0; - int ret = GRIB_SUCCESS; + int ret = GRIB_SUCCESS; int i, j, k; - if ((ret = grib_value_count (a, &count)) != GRIB_SUCCESS) + if ((ret = grib_value_count(a, &count)) != GRIB_SUCCESS) goto cleanup; - bt = new_bif_trunc (a, self); + bt = new_bif_trunc(a, self); - if (bt == NULL) - { + if (bt == NULL) { ret = GRIB_INTERNAL_ERROR; goto cleanup; } - if (bt->n_vals_bif != count) - { + if (bt->n_vals_bif != count) { ret = GRIB_INTERNAL_ERROR; goto cleanup; } - if ((ret = grib_get_long_internal (gh, self->offsetdata, &offsetdata)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->offsetdata, &offsetdata)) != GRIB_SUCCESS) goto cleanup; - if (*len < bt->n_vals_bif) - { + if (*len < bt->n_vals_bif) { *len = (long)bt->n_vals_bif; - ret = GRIB_ARRAY_TOO_SMALL; + ret = GRIB_ARRAY_TOO_SMALL; goto cleanup; } self->dirty = 0; buf = (unsigned char*)gh->buffer->data; - buf += grib_byte_offset (a); + buf += grib_byte_offset(a); - s = grib_power (bt->binary_scale_factor, 2); - d = grib_power (-bt->decimal_scale_factor, 10); + s = grib_power(bt->binary_scale_factor, 2); + d = grib_power(-bt->decimal_scale_factor, 10); /* * Decode data @@ -697,58 +691,56 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len) hres = buf; lres = buf; - packed_offset = grib_byte_offset (a) + bt->bytes * bt->n_vals_sub; + packed_offset = grib_byte_offset(a) + bt->bytes * bt->n_vals_sub; lpos = 8 * (packed_offset - offsetdata); hpos = 0; isp = 0; - for_ij () + for_ij() { int insub; - calc_insub (); + calc_insub(); if (insub) - for (k = 0; k < 4; k++) - { - val[isp+k] = bt->decode_float (grib_decode_unsigned_long (hres, &hpos, 8 * bt->bytes)); + for (k = 0; k < 4; k++) { + val[isp + k] = bt->decode_float(grib_decode_unsigned_long(hres, &hpos, 8 * bt->bytes)); } else - for (k = 0; k < 4; k++) - { - double S = scals (i, j); - long dec_val = grib_decode_unsigned_long (lres, &lpos, bt->bits_per_value); - val[isp+k] = (double)(((dec_val * s) + bt->reference_value) * d)/ S; + for (k = 0; k < 4; k++) { + double S = scals(i, j); + long dec_val = grib_decode_unsigned_long(lres, &lpos, bt->bits_per_value); + val[isp + k] = (double)(((dec_val * s) + bt->reference_value) * d) / S; } isp += 4; } - Assert (*len >= isp); + Assert(*len >= isp); *len = isp; cleanup: - free_bif_trunc (bt, a); + free_bif_trunc(bt, a); return ret; } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { - grib_accessor_data_g2bifourier_packing* self = (grib_accessor_data_g2bifourier_packing*)a; - grib_handle* gh = grib_handle_of_accessor(a); - size_t buflen = 0; - size_t hsize = 0; - size_t lsize = 0; - unsigned char* buf = NULL; - unsigned char* hres = NULL; - unsigned char* lres = NULL; - long hpos = 0; - long lpos = 0; + grib_accessor_data_g2bifourier_packing* self = (grib_accessor_data_g2bifourier_packing*)a; + grib_handle* gh = grib_handle_of_accessor(a); + size_t buflen = 0; + size_t hsize = 0; + size_t lsize = 0; + unsigned char* buf = NULL; + unsigned char* hres = NULL; + unsigned char* lres = NULL; + long hpos = 0; + long lpos = 0; int isp; - bif_trunc_t * bt = NULL; + bif_trunc_t* bt = NULL; double max = 0; double min = 0; @@ -759,27 +751,23 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) int minmax_set; double d = 0., s = 0.; - if (*len == 0) - { + if (*len == 0) { ret = GRIB_NO_VALUES; goto cleanup; } - bt = new_bif_trunc (a, self); + bt = new_bif_trunc(a, self); - if (bt == NULL) - { + if (bt == NULL) { long makeTemplate = 0; - if ((ret = grib_get_long_internal (gh, self->biFourierMakeTemplate, &makeTemplate)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(gh, self->biFourierMakeTemplate, &makeTemplate)) != GRIB_SUCCESS) goto cleanup; - if (! makeTemplate) - { + if (!makeTemplate) { ret = GRIB_INTERNAL_ERROR; goto cleanup; } - else - { - printf ("Assuming we are creating a template\n"); + else { + printf("Assuming we are creating a template\n"); ret = GRIB_SUCCESS; goto cleanup; } @@ -787,21 +775,19 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) self->dirty = 1; - if (*len != bt->n_vals_bif) - { - grib_context_log(gh->context,GRIB_LOG_ERROR,"BIFOURIER_PACKING : wrong number of values, expected %d - got %d", bt->n_vals_bif, *len); + if (*len != bt->n_vals_bif) { + grib_context_log(gh->context, GRIB_LOG_ERROR, "BIFOURIER_PACKING : wrong number of values, expected %d - got %d", bt->n_vals_bif, *len); ret = GRIB_INTERNAL_ERROR; goto cleanup; } - if (! bt->laplacianOperatorIsSet) - { - bt->laplacianOperator = laplam (bt, val); + if (!bt->laplacianOperatorIsSet) { + bt->laplacianOperator = laplam(bt, val); - if ((ret = grib_set_double_internal (gh, self->laplacianOperator, bt->laplacianOperator)) != GRIB_SUCCESS) + if ((ret = grib_set_double_internal(gh, self->laplacianOperator, bt->laplacianOperator)) != GRIB_SUCCESS) goto cleanup; - grib_get_double_internal (gh, self->laplacianOperator, &bt->laplacianOperator); + grib_get_double_internal(gh, self->laplacianOperator, &bt->laplacianOperator); } /* @@ -810,46 +796,43 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) minmax_set = 0; isp = 0; - for_ij () + for_ij() { int insub; - calc_insub (); + calc_insub(); - if (! insub) - { - for (k = 0; k < 4; k++) - { - double current_val = val[isp+k] * scals (i, j); - if (! minmax_set) - { + if (!insub) { + for (k = 0; k < 4; k++) { + double current_val = val[isp + k] * scals(i, j); + if (!minmax_set) { min = current_val; max = current_val; minmax_set++; } - if (current_val < min) min = current_val; - if (current_val > max) max = current_val; + if (current_val < min) + min = current_val; + if (current_val > max) + max = current_val; } } isp += 4; } - if (bt->n_vals_bif != bt->n_vals_sub) - { - ret = grib_optimize_decimal_factor (a, self->reference_value, - max, min, bt->bits_per_value, 0, 1, - &bt->decimal_scale_factor, - &bt->binary_scale_factor, - &bt->reference_value); + if (bt->n_vals_bif != bt->n_vals_sub) { + ret = grib_optimize_decimal_factor(a, self->reference_value, + max, min, bt->bits_per_value, 0, 1, + &bt->decimal_scale_factor, + &bt->binary_scale_factor, + &bt->reference_value); if (ret != GRIB_SUCCESS) goto cleanup; - s = grib_power (-bt->binary_scale_factor, 2); - d = grib_power (+bt->decimal_scale_factor, 10); + s = grib_power(-bt->binary_scale_factor, 2); + d = grib_power(+bt->decimal_scale_factor, 10); } - else - { + else { bt->decimal_scale_factor = 0; bt->binary_scale_factor = 0; bt->reference_value = 0.; @@ -863,7 +846,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) buflen = hsize + lsize; - buf = (unsigned char*)grib_context_malloc (gh->context, buflen); + buf = (unsigned char*)grib_context_malloc(gh->context, buflen); hres = buf; lres = buf + hsize; @@ -873,75 +856,72 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) isp = 0; - for_ij () + for_ij() { double current_val; int insub; - calc_insub (); + calc_insub(); if (insub) - for (k = 0; k < 4; k++) - { - current_val = val[isp+k]; - grib_encode_unsigned_long (hres, bt->encode_float (current_val) , &hpos, 8 * bt->bytes); + for (k = 0; k < 4; k++) { + current_val = val[isp + k]; + grib_encode_unsigned_long(hres, bt->encode_float(current_val), &hpos, 8 * bt->bytes); } else - for (k = 0; k < 4; k++) - { - double S = scals (i, j); - current_val = (((((val[isp+k] * d) * S) - bt->reference_value) * s) + 0.5); + for (k = 0; k < 4; k++) { + double S = scals(i, j); + current_val = (((((val[isp + k] * d) * S) - bt->reference_value) * s) + 0.5); if (current_val < 0) - grib_context_log (gh->context, GRIB_LOG_ERROR, "BIFOURIER_PACKING : negative coput before packing (%g)", current_val); + grib_context_log(gh->context, GRIB_LOG_ERROR, "BIFOURIER_PACKING : negative coput before packing (%g)", current_val); if (bt->bits_per_value % 8) - grib_encode_unsigned_longb (lres, current_val, &lpos, bt->bits_per_value); + grib_encode_unsigned_longb(lres, current_val, &lpos, bt->bits_per_value); else - grib_encode_unsigned_long (lres, current_val, &lpos, bt->bits_per_value); + grib_encode_unsigned_long(lres, current_val, &lpos, bt->bits_per_value); } isp += 4; } - if (((hpos / 8) != hsize) && ((lpos / 8) != lsize)) - { - grib_context_log (gh->context, GRIB_LOG_ERROR, "BIFOURIER_PACKING : Mismatch in packing between high resolution and low resolution part"); + if (((hpos / 8) != hsize) && ((lpos / 8) != lsize)) { + grib_context_log(gh->context, GRIB_LOG_ERROR, "BIFOURIER_PACKING : Mismatch in packing between high resolution and low resolution part"); ret = GRIB_INTERNAL_ERROR; goto cleanup; } - buflen = ((hpos + lpos)/8); + buflen = ((hpos + lpos) / 8); - if ((ret = grib_set_double_internal (gh, self->reference_value, bt->reference_value)) != GRIB_SUCCESS) + if ((ret = grib_set_double_internal(gh, self->reference_value, bt->reference_value)) != GRIB_SUCCESS) goto cleanup; { /* Make sure we can decode it again */ double ref = 1e-100; - grib_get_double_internal (gh,self->reference_value,&ref); - Assert (ref == bt->reference_value); + grib_get_double_internal(gh, self->reference_value, &ref); + Assert(ref == bt->reference_value); } - if ((ret = grib_set_long_internal (gh, self->binary_scale_factor, bt->binary_scale_factor)) != GRIB_SUCCESS) + if ((ret = grib_set_long_internal(gh, self->binary_scale_factor, bt->binary_scale_factor)) != GRIB_SUCCESS) goto cleanup; - if ((ret = grib_set_long_internal (gh, self->decimal_scale_factor, bt->decimal_scale_factor)) != GRIB_SUCCESS) + if ((ret = grib_set_long_internal(gh, self->decimal_scale_factor, bt->decimal_scale_factor)) != GRIB_SUCCESS) goto cleanup; - grib_buffer_replace (a, buf, buflen, 1, 1); + grib_buffer_replace(a, buf, buflen, 1, 1); - if ((ret = grib_set_long_internal (gh, self->totalNumberOfValuesInUnpackedSubset, bt->n_vals_sub)) != GRIB_SUCCESS) + if ((ret = grib_set_long_internal(gh, self->totalNumberOfValuesInUnpackedSubset, bt->n_vals_sub)) != GRIB_SUCCESS) goto cleanup; - if ((ret = grib_set_long_internal (gh, self->number_of_values, bt->n_vals_bif)) != GRIB_SUCCESS) + if ((ret = grib_set_long_internal(gh, self->number_of_values, bt->n_vals_bif)) != GRIB_SUCCESS) goto cleanup; cleanup: - free_bif_trunc (bt, a); + free_bif_trunc(bt, a); if (buf != NULL) - grib_context_free (gh->context, buf); + grib_context_free(gh->context, buf); return ret; } diff --git a/src/grib_accessor_class_data_g2complex_packing.c b/src/grib_accessor_class_data_g2complex_packing.c index bf429f9fe..7696d8513 100644 --- a/src/grib_accessor_class_data_g2complex_packing.c +++ b/src/grib_accessor_class_data_g2complex_packing.c @@ -34,89 +34,90 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_data_g2complex_packing { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in values */ - int carg; - const char* seclen; - const char* offsetdata; - const char* offsetsection; - int dirty; -/* Members defined in data_simple_packing */ - int edition; - const char* units_factor; - const char* units_bias; - const char* changing_precision; - const char* number_of_values; - const char* bits_per_value; - const char* reference_value; - const char* binary_scale_factor; - const char* decimal_scale_factor; - const char* optimize_scaling_factor; -/* Members defined in data_complex_packing */ - const char* GRIBEX_sh_bug_present; - const char* ieee_floats; - const char* laplacianOperatorIsSet; - const char* laplacianOperator; - const char* sub_j; - const char* sub_k; - const char* sub_m; - const char* pen_j; - const char* pen_k; - const char* pen_m; -/* Members defined in data_g2complex_packing */ - const char* numberOfValues; +typedef struct grib_accessor_data_g2complex_packing +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in values */ + int carg; + const char* seclen; + const char* offsetdata; + const char* offsetsection; + int dirty; + /* Members defined in data_simple_packing */ + int edition; + const char* units_factor; + const char* units_bias; + const char* changing_precision; + const char* number_of_values; + const char* bits_per_value; + const char* reference_value; + const char* binary_scale_factor; + const char* decimal_scale_factor; + const char* optimize_scaling_factor; + /* Members defined in data_complex_packing */ + const char* GRIBEX_sh_bug_present; + const char* ieee_floats; + const char* laplacianOperatorIsSet; + const char* laplacianOperator; + const char* sub_j; + const char* sub_k; + const char* sub_m; + const char* pen_j; + const char* pen_k; + const char* pen_m; + /* Members defined in data_g2complex_packing */ + const char* numberOfValues; } grib_accessor_data_g2complex_packing; extern grib_accessor_class* grib_accessor_class_data_complex_packing; static grib_accessor_class _grib_accessor_class_data_g2complex_packing = { - &grib_accessor_class_data_complex_packing, /* super */ - "data_g2complex_packing", /* name */ - sizeof(grib_accessor_data_g2complex_packing), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_data_complex_packing, /* super */ + "data_g2complex_packing", /* name */ + sizeof(grib_accessor_data_g2complex_packing), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -125,69 +126,70 @@ grib_accessor_class* grib_accessor_class_data_g2complex_packing = &_grib_accesso static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long v, grib_arguments* args) +static void init(grib_accessor* a, const long v, grib_arguments* args) { - grib_accessor_data_g2complex_packing *self =(grib_accessor_data_g2complex_packing*)a; - self->numberOfValues = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->edition=2; + grib_accessor_data_g2complex_packing* self = (grib_accessor_data_g2complex_packing*)a; + self->numberOfValues = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->edition = 2; a->flags |= GRIB_ACCESSOR_FLAG_DATA; } -static int value_count(grib_accessor* a,long* numberOfValues) +static int value_count(grib_accessor* a, long* numberOfValues) { - grib_accessor_data_g2complex_packing* self = (grib_accessor_data_g2complex_packing*)a; - *numberOfValues = 0; + grib_accessor_data_g2complex_packing* self = (grib_accessor_data_g2complex_packing*)a; + *numberOfValues = 0; - return grib_get_long(grib_handle_of_accessor(a),self->numberOfValues,numberOfValues); + return grib_get_long(grib_handle_of_accessor(a), self->numberOfValues, numberOfValues); } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { - grib_accessor_data_g2complex_packing* self = (grib_accessor_data_g2complex_packing*)a; - int ret = GRIB_SUCCESS; - grib_accessor_class* super = *(a->cclass->super); + grib_accessor_data_g2complex_packing* self = (grib_accessor_data_g2complex_packing*)a; + int ret = GRIB_SUCCESS; + grib_accessor_class* super = *(a->cclass->super); - if (*len ==0) return GRIB_NO_VALUES; + if (*len == 0) + return GRIB_NO_VALUES; - ret = super->pack_double(a,val,len); + ret = super->pack_double(a, val, len); - if(ret == GRIB_SUCCESS) - ret = grib_set_long_internal(grib_handle_of_accessor(a),self->numberOfValues,*len) ; + if (ret == GRIB_SUCCESS) + ret = grib_set_long_internal(grib_handle_of_accessor(a), self->numberOfValues, *len); return ret; } diff --git a/src/grib_accessor_class_data_g2secondary_bitmap.c b/src/grib_accessor_class_data_g2secondary_bitmap.c index 4bc538cd3..37c514807 100644 --- a/src/grib_accessor_class_data_g2secondary_bitmap.c +++ b/src/grib_accessor_class_data_g2secondary_bitmap.c @@ -33,66 +33,67 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_data_g2secondary_bitmap { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in data_secondary_bitmap */ - const char* primary_bitmap; - const char* secondary_bitmap; - const char* missing_value; - const char* expand_by; -/* Members defined in data_g2secondary_bitmap */ - const char* number_of_values; +typedef struct grib_accessor_data_g2secondary_bitmap +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in data_secondary_bitmap */ + const char* primary_bitmap; + const char* secondary_bitmap; + const char* missing_value; + const char* expand_by; + /* Members defined in data_g2secondary_bitmap */ + const char* number_of_values; } grib_accessor_data_g2secondary_bitmap; extern grib_accessor_class* grib_accessor_class_data_secondary_bitmap; static grib_accessor_class _grib_accessor_class_data_g2secondary_bitmap = { - &grib_accessor_class_data_secondary_bitmap, /* super */ - "data_g2secondary_bitmap", /* name */ - sizeof(grib_accessor_data_g2secondary_bitmap), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_data_secondary_bitmap, /* super */ + "data_g2secondary_bitmap", /* name */ + sizeof(grib_accessor_data_g2secondary_bitmap), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -101,120 +102,120 @@ grib_accessor_class* grib_accessor_class_data_g2secondary_bitmap = &_grib_access static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long v, grib_arguments* args) +static void init(grib_accessor* a, const long v, grib_arguments* args) { - grib_accessor_data_g2secondary_bitmap *self =(grib_accessor_data_g2secondary_bitmap*)a; - self->number_of_values = grib_arguments_get_name(grib_handle_of_accessor(a),args,4); + grib_accessor_data_g2secondary_bitmap* self = (grib_accessor_data_g2secondary_bitmap*)a; + self->number_of_values = grib_arguments_get_name(grib_handle_of_accessor(a), args, 4); } -static int value_count(grib_accessor* a,long* len) +static int value_count(grib_accessor* a, long* len) { - grib_accessor_data_g2secondary_bitmap *self =(grib_accessor_data_g2secondary_bitmap*)a; - *len = 0; + grib_accessor_data_g2secondary_bitmap* self = (grib_accessor_data_g2secondary_bitmap*)a; + *len = 0; - return grib_get_long_internal(grib_handle_of_accessor(a),self->number_of_values,len); + return grib_get_long_internal(grib_handle_of_accessor(a), self->number_of_values, len); } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { - grib_accessor_data_g2secondary_bitmap* self = (grib_accessor_data_g2secondary_bitmap*)a; + grib_accessor_data_g2secondary_bitmap* self = (grib_accessor_data_g2secondary_bitmap*)a; int err = 0; - long primary_len = 0; - long secondary_len = 0; - double* primary_bitmap = NULL; + long primary_len = 0; + long secondary_len = 0; + double* primary_bitmap = NULL; double* secondary_bitmap = NULL; - long i = 0; - long j = 0; - long on = 0; + long i = 0; + long j = 0; + long on = 0; long k; long m; double missing_value = 0; double present_value = 0; - long expand_by =0; + long expand_by = 0; - if (*len ==0) return GRIB_NO_VALUES; + if (*len == 0) + return GRIB_NO_VALUES; - if((err = grib_get_long(grib_handle_of_accessor(a),self->expand_by,&expand_by)) != GRIB_SUCCESS) + if ((err = grib_get_long(grib_handle_of_accessor(a), self->expand_by, &expand_by)) != GRIB_SUCCESS) return err; if (expand_by <= 0) return GRIB_ENCODING_ERROR; - if((err = grib_get_double_internal(grib_handle_of_accessor(a),self->missing_value,&missing_value)) != GRIB_SUCCESS) + if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->missing_value, &missing_value)) != GRIB_SUCCESS) return err; - if(*len % expand_by) - { + if (*len % expand_by) { /*TODO: issue warning */ return GRIB_ENCODING_ERROR; } - primary_len = *len / expand_by; - primary_bitmap= (double*)grib_context_malloc_clear(a->context,primary_len*sizeof(double)); - if(!primary_bitmap) return GRIB_OUT_OF_MEMORY; + primary_len = *len / expand_by; + primary_bitmap = (double*)grib_context_malloc_clear(a->context, primary_len * sizeof(double)); + if (!primary_bitmap) + return GRIB_OUT_OF_MEMORY; - secondary_len = *len ; - secondary_bitmap= (double*)grib_context_malloc_clear(a->context,secondary_len*sizeof(double)); - if(!secondary_bitmap) { - grib_context_free(a->context,primary_bitmap); + secondary_len = *len; + secondary_bitmap = (double*)grib_context_malloc_clear(a->context, secondary_len * sizeof(double)); + if (!secondary_bitmap) { + grib_context_free(a->context, primary_bitmap); return GRIB_OUT_OF_MEMORY; } - if(missing_value == 0) + if (missing_value == 0) present_value = 1; else present_value = 0; k = 0; m = 0; - for(i=0; i<*len ; i += expand_by) - { + for (i = 0; i < *len; i += expand_by) { int cnt = 0; - for(j = 0; j < expand_by; j++) - if(val[i+j] == missing_value) + for (j = 0; j < expand_by; j++) + if (val[i + j] == missing_value) cnt++; - if(cnt == expand_by) /* all expand_by values are missing */ + if (cnt == expand_by) /* all expand_by values are missing */ primary_bitmap[k++] = missing_value; else { primary_bitmap[k++] = present_value; - for(j = 0; j < expand_by; j++) - secondary_bitmap[m++] = val[i+j]; + for (j = 0; j < expand_by; j++) + secondary_bitmap[m++] = val[i + j]; on++; } } @@ -223,15 +224,15 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) Assert(k == primary_len); - err = grib_set_double_array_internal(grib_handle_of_accessor(a),self->primary_bitmap,primary_bitmap,k); - if(err == GRIB_SUCCESS) - err = grib_set_double_array_internal(grib_handle_of_accessor(a),self->secondary_bitmap,secondary_bitmap,m); + err = grib_set_double_array_internal(grib_handle_of_accessor(a), self->primary_bitmap, primary_bitmap, k); + if (err == GRIB_SUCCESS) + err = grib_set_double_array_internal(grib_handle_of_accessor(a), self->secondary_bitmap, secondary_bitmap, m); - grib_context_free(a->context,primary_bitmap); - grib_context_free(a->context,secondary_bitmap); + grib_context_free(a->context, primary_bitmap); + grib_context_free(a->context, secondary_bitmap); - if(err == GRIB_SUCCESS) - err = grib_set_long_internal(grib_handle_of_accessor(a),self->number_of_values,*len * expand_by); + if (err == GRIB_SUCCESS) + err = grib_set_long_internal(grib_handle_of_accessor(a), self->number_of_values, *len * expand_by); return err; } diff --git a/src/grib_accessor_class_data_g2shsimple_packing.c b/src/grib_accessor_class_data_g2shsimple_packing.c index 7105df738..679ed9670 100644 --- a/src/grib_accessor_class_data_g2shsimple_packing.c +++ b/src/grib_accessor_class_data_g2shsimple_packing.c @@ -34,66 +34,67 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_data_g2shsimple_packing { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in data_shsimple_packing */ - const char* coded_values; - const char* real_part; - int dirty; -/* Members defined in data_g2shsimple_packing */ - const char* numberOfValues; +typedef struct grib_accessor_data_g2shsimple_packing +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in data_shsimple_packing */ + const char* coded_values; + const char* real_part; + int dirty; + /* Members defined in data_g2shsimple_packing */ + const char* numberOfValues; } grib_accessor_data_g2shsimple_packing; extern grib_accessor_class* grib_accessor_class_data_shsimple_packing; static grib_accessor_class _grib_accessor_class_data_g2shsimple_packing = { - &grib_accessor_class_data_shsimple_packing, /* super */ - "data_g2shsimple_packing", /* name */ - sizeof(grib_accessor_data_g2shsimple_packing), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_data_shsimple_packing, /* super */ + "data_g2shsimple_packing", /* name */ + sizeof(grib_accessor_data_g2shsimple_packing), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -102,116 +103,116 @@ grib_accessor_class* grib_accessor_class_data_g2shsimple_packing = &_grib_access static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long v, grib_arguments* args) +static void init(grib_accessor* a, const long v, grib_arguments* args) { - grib_accessor_data_g2shsimple_packing *self =(grib_accessor_data_g2shsimple_packing*)a; + grib_accessor_data_g2shsimple_packing* self = (grib_accessor_data_g2shsimple_packing*)a; - self->numberOfValues = grib_arguments_get_name(grib_handle_of_accessor(a),args,2); + self->numberOfValues = grib_arguments_get_name(grib_handle_of_accessor(a), args, 2); a->flags |= GRIB_ACCESSOR_FLAG_DATA; } -static int value_count(grib_accessor* a,long* len) +static int value_count(grib_accessor* a, long* len) { - grib_accessor_data_g2shsimple_packing *self =(grib_accessor_data_g2shsimple_packing*)a; - *len = 0; - return grib_get_long(grib_handle_of_accessor(a),self->numberOfValues,len); + grib_accessor_data_g2shsimple_packing* self = (grib_accessor_data_g2shsimple_packing*)a; + *len = 0; + return grib_get_long(grib_handle_of_accessor(a), self->numberOfValues, len); } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - grib_accessor_data_g2shsimple_packing* self = (grib_accessor_data_g2shsimple_packing*)a; - int err = GRIB_SUCCESS; + grib_accessor_data_g2shsimple_packing* self = (grib_accessor_data_g2shsimple_packing*)a; + int err = GRIB_SUCCESS; size_t n_vals = 0; - if((err = grib_get_size(grib_handle_of_accessor(a),self->coded_values,&n_vals)) != GRIB_SUCCESS) + if ((err = grib_get_size(grib_handle_of_accessor(a), self->coded_values, &n_vals)) != GRIB_SUCCESS) return err; - self->dirty=0; + self->dirty = 0; /* n_vals = coded_n_vals+1; */ - if(*len < n_vals) - { + if (*len < n_vals) { *len = n_vals; return GRIB_ARRAY_TOO_SMALL; } - if((err = grib_get_double_internal(grib_handle_of_accessor(a),self->real_part,val)) != GRIB_SUCCESS) + if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->real_part, val)) != GRIB_SUCCESS) return err; val++; - if((err = grib_get_double_array_internal(grib_handle_of_accessor(a),self->coded_values,val,&n_vals)) != GRIB_SUCCESS) + if ((err = grib_get_double_array_internal(grib_handle_of_accessor(a), self->coded_values, val, &n_vals)) != GRIB_SUCCESS) return err; - *len = n_vals; + *len = n_vals; return err; } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { - grib_accessor_data_g2shsimple_packing* self = (grib_accessor_data_g2shsimple_packing*)a; - int err = GRIB_SUCCESS; + grib_accessor_data_g2shsimple_packing* self = (grib_accessor_data_g2shsimple_packing*)a; + int err = GRIB_SUCCESS; - size_t coded_n_vals = *len-1; - size_t n_vals = *len; + size_t coded_n_vals = *len - 1; + size_t n_vals = *len; - if (*len ==0) return GRIB_NO_VALUES; + if (*len == 0) + return GRIB_NO_VALUES; - self->dirty=1; + self->dirty = 1; - if((err = grib_set_double_internal(grib_handle_of_accessor(a),self->real_part,*val)) != GRIB_SUCCESS) + if ((err = grib_set_double_internal(grib_handle_of_accessor(a), self->real_part, *val)) != GRIB_SUCCESS) return err; { /* Make sure we can decode it again */ double ref = 1e-100; - grib_get_double_internal(grib_handle_of_accessor(a),self->real_part,&ref); + grib_get_double_internal(grib_handle_of_accessor(a), self->real_part, &ref); Assert(ref == *val); } val++; - if((err = grib_set_double_array_internal(grib_handle_of_accessor(a),self->coded_values,val,coded_n_vals)) != GRIB_SUCCESS) + if ((err = grib_set_double_array_internal(grib_handle_of_accessor(a), self->coded_values, val, coded_n_vals)) != GRIB_SUCCESS) return err; - *len = n_vals; + *len = n_vals; - if((err = grib_set_long_internal(grib_handle_of_accessor(a),self->numberOfValues,(long)n_vals)) != GRIB_SUCCESS) + if ((err = grib_set_long_internal(grib_handle_of_accessor(a), self->numberOfValues, (long)n_vals)) != GRIB_SUCCESS) return err; return err; diff --git a/src/grib_accessor_class_data_g2simple_packing.c b/src/grib_accessor_class_data_g2simple_packing.c index 80283cc5f..503ab2625 100644 --- a/src/grib_accessor_class_data_g2simple_packing.c +++ b/src/grib_accessor_class_data_g2simple_packing.c @@ -34,78 +34,79 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_bytes(grib_accessor*,const unsigned char*, size_t *len); -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_bytes(grib_accessor*, const unsigned char*, size_t* len); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_data_g2simple_packing { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in values */ - int carg; - const char* seclen; - const char* offsetdata; - const char* offsetsection; - int dirty; -/* Members defined in data_simple_packing */ - int edition; - const char* units_factor; - const char* units_bias; - const char* changing_precision; - const char* number_of_values; - const char* bits_per_value; - const char* reference_value; - const char* binary_scale_factor; - const char* decimal_scale_factor; - const char* optimize_scaling_factor; -/* Members defined in data_g2simple_packing */ +typedef struct grib_accessor_data_g2simple_packing +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in values */ + int carg; + const char* seclen; + const char* offsetdata; + const char* offsetsection; + int dirty; + /* Members defined in data_simple_packing */ + int edition; + const char* units_factor; + const char* units_bias; + const char* changing_precision; + const char* number_of_values; + const char* bits_per_value; + const char* reference_value; + const char* binary_scale_factor; + const char* decimal_scale_factor; + const char* optimize_scaling_factor; + /* Members defined in data_g2simple_packing */ } grib_accessor_data_g2simple_packing; extern grib_accessor_class* grib_accessor_class_data_simple_packing; static grib_accessor_class _grib_accessor_class_data_g2simple_packing = { - &grib_accessor_class_data_simple_packing, /* super */ - "data_g2simple_packing", /* name */ - sizeof(grib_accessor_data_g2simple_packing), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - &pack_bytes, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_data_simple_packing, /* super */ + "data_g2simple_packing", /* name */ + sizeof(grib_accessor_data_g2simple_packing), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + &pack_bytes, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -114,152 +115,154 @@ grib_accessor_class* grib_accessor_class_data_g2simple_packing = &_grib_accessor static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long v, grib_arguments* args) +static void init(grib_accessor* a, const long v, grib_arguments* args) { - grib_accessor_data_g2simple_packing *self =(grib_accessor_data_g2simple_packing*)a; + grib_accessor_data_g2simple_packing* self = (grib_accessor_data_g2simple_packing*)a; a->flags |= GRIB_ACCESSOR_FLAG_DATA; - self->edition=2; + self->edition = 2; } -static int value_count(grib_accessor* a,long* n_vals) +static int value_count(grib_accessor* a, long* n_vals) { - grib_accessor_data_g2simple_packing *self =(grib_accessor_data_g2simple_packing*)a; - *n_vals= 0; - return grib_get_long_internal(grib_handle_of_accessor(a),self->number_of_values,n_vals); + grib_accessor_data_g2simple_packing* self = (grib_accessor_data_g2simple_packing*)a; + *n_vals = 0; + return grib_get_long_internal(grib_handle_of_accessor(a), self->number_of_values, n_vals); } -static int pack_double(grib_accessor* a, const double* cval, size_t *len) +static int pack_double(grib_accessor* a, const double* cval, size_t* len) { - grib_accessor_data_g2simple_packing* self = (grib_accessor_data_g2simple_packing*)a; - grib_accessor_class* super = *(a->cclass->super); - size_t n_vals = *len; - double reference_value = 0; - long binary_scale_factor = 0; - long bits_per_value = 0; - long decimal_scale_factor = 0; - double decimal = 1; - size_t buflen = 0; - unsigned char* buf = NULL; - unsigned char* encoded = NULL; - double divisor = 1; - long off = 0; - int ret =0; - double units_factor=1.0; - double units_bias=0.0; - double* val=(double*)cval; + grib_accessor_data_g2simple_packing* self = (grib_accessor_data_g2simple_packing*)a; + grib_accessor_class* super = *(a->cclass->super); + size_t n_vals = *len; + double reference_value = 0; + long binary_scale_factor = 0; + long bits_per_value = 0; + long decimal_scale_factor = 0; + double decimal = 1; + size_t buflen = 0; + unsigned char* buf = NULL; + unsigned char* encoded = NULL; + double divisor = 1; + long off = 0; + int ret = 0; + double units_factor = 1.0; + double units_bias = 0.0; + double* val = (double*)cval; int i; - if(*len == 0) { - grib_buffer_replace(a, NULL, 0,1,1); + if (*len == 0) { + grib_buffer_replace(a, NULL, 0, 1, 1); return GRIB_SUCCESS; } - if(ret == GRIB_SUCCESS) - ret = grib_set_long_internal(grib_handle_of_accessor(a),self->number_of_values, *len); + if (ret == GRIB_SUCCESS) + ret = grib_set_long_internal(grib_handle_of_accessor(a), self->number_of_values, *len); - if (ret!=GRIB_SUCCESS) return ret; + if (ret != GRIB_SUCCESS) + return ret; - if(self->units_factor && - (grib_get_double_internal(grib_handle_of_accessor(a),self->units_factor,&units_factor)== GRIB_SUCCESS)) { - grib_set_double_internal(grib_handle_of_accessor(a),self->units_factor,1.0); + if (self->units_factor && + (grib_get_double_internal(grib_handle_of_accessor(a), self->units_factor, &units_factor) == GRIB_SUCCESS)) { + grib_set_double_internal(grib_handle_of_accessor(a), self->units_factor, 1.0); } - if(self->units_bias && - (grib_get_double_internal(grib_handle_of_accessor(a),self->units_bias,&units_bias)== GRIB_SUCCESS)) { - grib_set_double_internal(grib_handle_of_accessor(a),self->units_bias,0.0); + if (self->units_bias && + (grib_get_double_internal(grib_handle_of_accessor(a), self->units_bias, &units_bias) == GRIB_SUCCESS)) { + grib_set_double_internal(grib_handle_of_accessor(a), self->units_bias, 0.0); } if (units_factor != 1.0) { if (units_bias != 0.0) - for (i=0;ipack_double(a,val,len); + ret = super->pack_double(a, val, len); switch (ret) { - case GRIB_CONSTANT_FIELD: - grib_buffer_replace(a, NULL, 0,1,1); - return GRIB_SUCCESS; - case GRIB_SUCCESS: - break; - default: - grib_context_log(a->context,GRIB_LOG_ERROR,"GRIB2 simple packing: unable to set values (%s)", grib_get_error_message(ret)); - return ret; + case GRIB_CONSTANT_FIELD: + grib_buffer_replace(a, NULL, 0, 1, 1); + return GRIB_SUCCESS; + case GRIB_SUCCESS: + break; + default: + grib_context_log(a->context, GRIB_LOG_ERROR, "GRIB2 simple packing: unable to set values (%s)", grib_get_error_message(ret)); + return ret; } - if((ret = grib_get_double_internal(grib_handle_of_accessor(a),self->reference_value, &reference_value)) - != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(grib_handle_of_accessor(a), self->reference_value, &reference_value)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->binary_scale_factor, &binary_scale_factor)) - != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->bits_per_value,&bits_per_value)) != - GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->bits_per_value, &bits_per_value)) != + GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->decimal_scale_factor, &decimal_scale_factor)) - != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) return ret; - decimal = grib_power(decimal_scale_factor,10) ; - divisor = grib_power(-binary_scale_factor,2); + decimal = grib_power(decimal_scale_factor, 10); + divisor = grib_power(-binary_scale_factor, 2); - buflen = (((bits_per_value*n_vals)+7)/8)*sizeof(unsigned char); - buf = (unsigned char*)grib_context_buffer_malloc_clear(a->context,buflen); + buflen = (((bits_per_value * n_vals) + 7) / 8) * sizeof(unsigned char); + buf = (unsigned char*)grib_context_buffer_malloc_clear(a->context, buflen); encoded = buf; - grib_encode_double_array(n_vals,val,bits_per_value,reference_value,decimal,divisor,encoded,&off); + grib_encode_double_array(n_vals, val, bits_per_value, reference_value, decimal, divisor, encoded, &off); grib_context_log(a->context, GRIB_LOG_DEBUG, - "grib_accessor_data_g2simple_packing : pack_double : packing %s, %d values", a->name, n_vals); + "grib_accessor_data_g2simple_packing : pack_double : packing %s, %d values", a->name, n_vals); - grib_buffer_replace(a, buf, buflen,1,1); + grib_buffer_replace(a, buf, buflen, 1, 1); - grib_context_buffer_free(a->context,buf); + grib_context_buffer_free(a->context, buf); return ret; } -static int pack_bytes(grib_accessor* a, const unsigned char* val, size_t *len) +static int pack_bytes(grib_accessor* a, const unsigned char* val, size_t* len) { size_t length = *len; - grib_buffer_replace(a, val, length,1,1); + grib_buffer_replace(a, val, length, 1, 1); return GRIB_SUCCESS; } diff --git a/src/grib_accessor_class_data_g2simple_packing_with_preprocessing.c b/src/grib_accessor_class_data_g2simple_packing_with_preprocessing.c index 5c845bc4f..239b46ef5 100644 --- a/src/grib_accessor_class_data_g2simple_packing_with_preprocessing.c +++ b/src/grib_accessor_class_data_g2simple_packing_with_preprocessing.c @@ -33,8 +33,8 @@ */ -static int pre_processing_func(double* values,long length, long pre_processing, - double *pre_processing_parameter,int mode); +static int pre_processing_func(double* values, long length, long pre_processing, + double* pre_processing_parameter, int mode); /* START_CLASS_IMP */ @@ -46,81 +46,82 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_data_g2simple_packing_with_preprocessing { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in values */ - int carg; - const char* seclen; - const char* offsetdata; - const char* offsetsection; - int dirty; -/* Members defined in data_simple_packing */ - int edition; - const char* units_factor; - const char* units_bias; - const char* changing_precision; - const char* number_of_values; - const char* bits_per_value; - const char* reference_value; - const char* binary_scale_factor; - const char* decimal_scale_factor; - const char* optimize_scaling_factor; -/* Members defined in data_g2simple_packing */ -/* Members defined in data_g2simple_packing_with_preprocessing */ - const char* pre_processing; - const char* pre_processing_parameter; +typedef struct grib_accessor_data_g2simple_packing_with_preprocessing +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in values */ + int carg; + const char* seclen; + const char* offsetdata; + const char* offsetsection; + int dirty; + /* Members defined in data_simple_packing */ + int edition; + const char* units_factor; + const char* units_bias; + const char* changing_precision; + const char* number_of_values; + const char* bits_per_value; + const char* reference_value; + const char* binary_scale_factor; + const char* decimal_scale_factor; + const char* optimize_scaling_factor; + /* Members defined in data_g2simple_packing */ + /* Members defined in data_g2simple_packing_with_preprocessing */ + const char* pre_processing; + const char* pre_processing_parameter; } grib_accessor_data_g2simple_packing_with_preprocessing; extern grib_accessor_class* grib_accessor_class_data_g2simple_packing; static grib_accessor_class _grib_accessor_class_data_g2simple_packing_with_preprocessing = { - &grib_accessor_class_data_g2simple_packing, /* super */ - "data_g2simple_packing_with_preprocessing", /* name */ - sizeof(grib_accessor_data_g2simple_packing_with_preprocessing), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_data_g2simple_packing, /* super */ + "data_g2simple_packing_with_preprocessing", /* name */ + sizeof(grib_accessor_data_g2simple_packing_with_preprocessing), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -129,177 +130,187 @@ grib_accessor_class* grib_accessor_class_data_g2simple_packing_with_preprocessin static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long v, grib_arguments* args) +static void init(grib_accessor* a, const long v, grib_arguments* args) { - grib_accessor_data_g2simple_packing_with_preprocessing *self =(grib_accessor_data_g2simple_packing_with_preprocessing*)a; - self->pre_processing = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->pre_processing_parameter = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); + grib_accessor_data_g2simple_packing_with_preprocessing* self = (grib_accessor_data_g2simple_packing_with_preprocessing*)a; + self->pre_processing = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->pre_processing_parameter = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); a->flags |= GRIB_ACCESSOR_FLAG_DATA; } -static int value_count(grib_accessor* a,long* n_vals) +static int value_count(grib_accessor* a, long* n_vals) { - grib_accessor_data_g2simple_packing_with_preprocessing *self =(grib_accessor_data_g2simple_packing_with_preprocessing*)a; - *n_vals= 0; + grib_accessor_data_g2simple_packing_with_preprocessing* self = (grib_accessor_data_g2simple_packing_with_preprocessing*)a; + *n_vals = 0; - return grib_get_long_internal(grib_handle_of_accessor(a),self->number_of_values,n_vals); + return grib_get_long_internal(grib_handle_of_accessor(a), self->number_of_values, n_vals); } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - grib_accessor_data_g2simple_packing_with_preprocessing* self = (grib_accessor_data_g2simple_packing_with_preprocessing*)a; - grib_accessor_class* super = *(a->cclass->super); + grib_accessor_data_g2simple_packing_with_preprocessing* self = (grib_accessor_data_g2simple_packing_with_preprocessing*)a; + grib_accessor_class* super = *(a->cclass->super); size_t n_vals = 0; - long nn=0; - int err = 0; + long nn = 0; + int err = 0; - long pre_processing; - double pre_processing_parameter; + long pre_processing; + double pre_processing_parameter; - err=grib_value_count(a,&nn); - n_vals=nn; - if (err) return err; + err = grib_value_count(a, &nn); + n_vals = nn; + if (err) + return err; - if(n_vals==0){ + if (n_vals == 0) { *len = 0; return GRIB_SUCCESS; } - self->dirty=0; + self->dirty = 0; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->pre_processing, &pre_processing)) != GRIB_SUCCESS){ + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->pre_processing, &pre_processing)) != GRIB_SUCCESS) { grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannont gather value for %s error %d \n", a->name, self->pre_processing, err); return err; } - if((err = grib_get_double_internal(grib_handle_of_accessor(a),self->pre_processing_parameter, &pre_processing_parameter)) != GRIB_SUCCESS){ + if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->pre_processing_parameter, &pre_processing_parameter)) != GRIB_SUCCESS) { grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannont gather value for %s error %d \n", a->name, self->pre_processing_parameter, err); return err; } - err = super->unpack_double(a,val,&n_vals); - if (err!=GRIB_SUCCESS) return err; + err = super->unpack_double(a, val, &n_vals); + if (err != GRIB_SUCCESS) + return err; - err=pre_processing_func(val,n_vals,pre_processing,&pre_processing_parameter,INVERSE); - if (err != GRIB_SUCCESS) return err; + err = pre_processing_func(val, n_vals, pre_processing, &pre_processing_parameter, INVERSE); + if (err != GRIB_SUCCESS) + return err; - *len = (long) n_vals; + *len = (long)n_vals; return err; } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { - grib_accessor_data_g2simple_packing_with_preprocessing* self = (grib_accessor_data_g2simple_packing_with_preprocessing*)a; - grib_accessor_class* super = *(a->cclass->super); + grib_accessor_data_g2simple_packing_with_preprocessing* self = (grib_accessor_data_g2simple_packing_with_preprocessing*)a; + grib_accessor_class* super = *(a->cclass->super); size_t n_vals = *len; - int err = 0; + int err = 0; - long pre_processing=0; - double pre_processing_parameter=0; + long pre_processing = 0; + double pre_processing_parameter = 0; - self->dirty=1; + self->dirty = 1; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->pre_processing, &pre_processing)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->pre_processing, &pre_processing)) != GRIB_SUCCESS) return err; - err=pre_processing_func((double*)val,n_vals,pre_processing,&pre_processing_parameter,DIRECT); - if (err != GRIB_SUCCESS) return err; + err = pre_processing_func((double*)val, n_vals, pre_processing, &pre_processing_parameter, DIRECT); + if (err != GRIB_SUCCESS) + return err; - err = super->pack_double(a,val,len); - if (err!=GRIB_SUCCESS) return err; + err = super->pack_double(a, val, len); + if (err != GRIB_SUCCESS) + return err; - if((err = grib_set_double_internal(grib_handle_of_accessor(a),self->pre_processing_parameter, pre_processing_parameter)) != GRIB_SUCCESS) + if ((err = grib_set_double_internal(grib_handle_of_accessor(a), self->pre_processing_parameter, pre_processing_parameter)) != GRIB_SUCCESS) return err; - if((err = grib_set_long_internal(grib_handle_of_accessor(a),self->number_of_values, n_vals)) != GRIB_SUCCESS) + if ((err = grib_set_long_internal(grib_handle_of_accessor(a), self->number_of_values, n_vals)) != GRIB_SUCCESS) return err; return GRIB_SUCCESS; } -static int pre_processing_func(double* values,long length, long pre_processing, - double *pre_processing_parameter,int mode) { +static int pre_processing_func(double* values, long length, long pre_processing, + double* pre_processing_parameter, int mode) +{ int i; - int ret=0; - double min=values[0]; - double next_min=values[0]; + int ret = 0; + double min = values[0]; + double next_min = values[0]; switch (pre_processing) { - /* NONE */ - case 0: - break; - /* LOGARITHM */ - case 1: - if (mode == DIRECT) { - for (i=0;i next_min) - next_min=values[i]; - } - for (i=0;i min && values[i] < next_min ) - next_min=values[i]; - } - if ( min > 0 ) { - *pre_processing_parameter=0; - for (i=0;i next_min) + next_min = values[i]; + } + for (i = 0; i < length; i++) { + if (values[i] > min && values[i] < next_min) + next_min = values[i]; + } + if (min > 0) { + *pre_processing_parameter = 0; + for (i = 0; i < length; i++) + values[i] = log(values[i]); + } + else { + *pre_processing_parameter = next_min - 2 * min; + if (next_min == min) + return ret; + for (i = 0; i < length; i++) + values[i] = log(values[i] + *pre_processing_parameter); + } } - } else { - if ( *pre_processing_parameter == 0 ) { - for (i=0;idump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ @@ -171,125 +172,130 @@ static int first = 1; #define JASPER_LIB 1 #define OPENJPEG_LIB 2 -static void init(grib_accessor* a,const long v, grib_arguments* args) +static void init(grib_accessor* a, const long v, grib_arguments* args) { - const char * user_lib=NULL; - grib_accessor_data_jpeg2000_packing *self =(grib_accessor_data_jpeg2000_packing*)a; - - self->jpeg_lib = 0; - self->type_of_compression_used = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->target_compression_ratio = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->ni = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->nj = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->list_defining_points = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->number_of_data_points = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->scanning_mode = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->edition=2; + const char* user_lib = NULL; + grib_accessor_data_jpeg2000_packing* self = (grib_accessor_data_jpeg2000_packing*)a; + + self->jpeg_lib = 0; + self->type_of_compression_used = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->target_compression_ratio = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->ni = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->nj = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->list_defining_points = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->number_of_data_points = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->scanning_mode = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->edition = 2; a->flags |= GRIB_ACCESSOR_FLAG_DATA; #if HAVE_LIBJASPER - self->jpeg_lib=JASPER_LIB; + self->jpeg_lib = JASPER_LIB; #elif HAVE_LIBOPENJPEG - self->jpeg_lib=OPENJPEG_LIB; + self->jpeg_lib = OPENJPEG_LIB; #endif - if ((user_lib=codes_getenv("ECCODES_GRIB_JPEG"))!=NULL ) { - if (!strcmp(user_lib,"jasper")) { - self->jpeg_lib=JASPER_LIB; - } else if (!strcmp(user_lib,"openjpeg")) { - self->jpeg_lib=OPENJPEG_LIB; + if ((user_lib = codes_getenv("ECCODES_GRIB_JPEG")) != NULL) { + if (!strcmp(user_lib, "jasper")) { + self->jpeg_lib = JASPER_LIB; + } + else if (!strcmp(user_lib, "openjpeg")) { + self->jpeg_lib = OPENJPEG_LIB; } } - if (a->context->debug==-1) { + if (a->context->debug == -1) { switch (self->jpeg_lib) { case 0: - fprintf(stderr, "ECCODES DEBUG jpeg2000_packing: jpeg_lib not set!\n"); break; + fprintf(stderr, "ECCODES DEBUG jpeg2000_packing: jpeg_lib not set!\n"); + break; case JASPER_LIB: - fprintf(stderr, "ECCODES DEBUG jpeg2000_packing: using JASPER_LIB\n"); break; + fprintf(stderr, "ECCODES DEBUG jpeg2000_packing: using JASPER_LIB\n"); + break; case OPENJPEG_LIB: - fprintf(stderr, "ECCODES DEBUG jpeg2000_packing: using OPENJPEG_LIB\n"); break; + fprintf(stderr, "ECCODES DEBUG jpeg2000_packing: using OPENJPEG_LIB\n"); + break; default: - Assert(0); break; + Assert(0); + break; } } self->dump_jpg = codes_getenv("ECCODES_GRIB_DUMP_JPG_FILE"); - if(self->dump_jpg) { + if (self->dump_jpg) { if (first) { - printf("GRIB JPEG dumping to %s\n",self->dump_jpg); + printf("GRIB JPEG dumping to %s\n", self->dump_jpg); first = 0; } } } -static int value_count(grib_accessor* a,long* n_vals) +static int value_count(grib_accessor* a, long* n_vals) { - grib_accessor_data_jpeg2000_packing *self =(grib_accessor_data_jpeg2000_packing*)a; - *n_vals= 0; + grib_accessor_data_jpeg2000_packing* self = (grib_accessor_data_jpeg2000_packing*)a; + *n_vals = 0; - return grib_get_long_internal(grib_handle_of_accessor(a),self->number_of_values,n_vals); + return grib_get_long_internal(grib_handle_of_accessor(a), self->number_of_values, n_vals); } #define EXTRA_BUFFER_SIZE 10240 #if HAVE_JPEG -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - grib_accessor_data_jpeg2000_packing *self =(grib_accessor_data_jpeg2000_packing*)a; + grib_accessor_data_jpeg2000_packing* self = (grib_accessor_data_jpeg2000_packing*)a; int err = GRIB_SUCCESS; int i; size_t buflen = grib_byte_count(a); - double bscale = 0; - double dscale = 0; + double bscale = 0; + double dscale = 0; unsigned char* buf = NULL; - size_t n_vals = 0; - long nn=0; + size_t n_vals = 0; + long nn = 0; - long binary_scale_factor = 0; + long binary_scale_factor = 0; long decimal_scale_factor = 0; - double reference_value = 0; - long bits_per_value =0; - double units_factor=1.0; - double units_bias=0.0; + double reference_value = 0; + long bits_per_value = 0; + double units_factor = 1.0; + double units_bias = 0.0; n_vals = 0; - err=grib_value_count(a,&nn); - n_vals=nn; - if (err) return err; + err = grib_value_count(a, &nn); + n_vals = nn; + if (err) + return err; - if(self->units_factor) - grib_get_double_internal(grib_handle_of_accessor(a),self->units_factor,&units_factor); + if (self->units_factor) + grib_get_double_internal(grib_handle_of_accessor(a), self->units_factor, &units_factor); - if(self->units_bias) - grib_get_double_internal(grib_handle_of_accessor(a),self->units_bias,&units_bias); + if (self->units_bias) + grib_get_double_internal(grib_handle_of_accessor(a), self->units_bias, &units_bias); - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->bits_per_value,&bits_per_value)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) return err; - if((err = grib_get_double_internal(grib_handle_of_accessor(a),self->reference_value, &reference_value)) != GRIB_SUCCESS) + if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->reference_value, &reference_value)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) return err; - self->dirty=0; + self->dirty = 0; - bscale = grib_power(binary_scale_factor,2); - dscale = grib_power(-decimal_scale_factor,10); + bscale = grib_power(binary_scale_factor, 2); + dscale = grib_power(-decimal_scale_factor, 10); /* TODO: This should be called upstream */ - if(*len < n_vals) + if (*len < n_vals) return GRIB_ARRAY_TOO_SMALL; /* Special case */ - if(bits_per_value == 0) - { - for(i = 0; i < n_vals; i++) + if (bits_per_value == 0) { + for (i = 0; i < n_vals; i++) val[i] = reference_value; *len = n_vals; return GRIB_SUCCESS; @@ -299,17 +305,17 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len) buf += grib_byte_offset(a); switch (self->jpeg_lib) { - case OPENJPEG_LIB: - if ((err = grib_openjpeg_decode(a->context,buf,&buflen,val,&n_vals)) != GRIB_SUCCESS) - return err; - break; - case JASPER_LIB: - if ((err = grib_jasper_decode(a->context,buf,&buflen,val,&n_vals)) != GRIB_SUCCESS) - return err; - break; - default: - grib_context_log(a->context,GRIB_LOG_ERROR,"Unable to unpack. Invalid JPEG library.\n"); - return GRIB_DECODING_ERROR; + case OPENJPEG_LIB: + if ((err = grib_openjpeg_decode(a->context, buf, &buflen, val, &n_vals)) != GRIB_SUCCESS) + return err; + break; + case JASPER_LIB: + if ((err = grib_jasper_decode(a->context, buf, &buflen, val, &n_vals)) != GRIB_SUCCESS) + return err; + break; + default: + grib_context_log(a->context, GRIB_LOG_ERROR, "Unable to unpack. Invalid JPEG library.\n"); + return GRIB_DECODING_ERROR; } *len = n_vals; @@ -319,30 +325,34 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len) } if (units_factor != 1.0) { if (units_bias != 0.0) - for (i=0;icclass->super); - size_t n_vals = *len; - int err = 0; + grib_accessor_data_jpeg2000_packing* self = (grib_accessor_data_jpeg2000_packing*)a; + grib_accessor_class* super = *(a->cclass->super); + size_t n_vals = *len; + int err = 0; int i; - double reference_value = 0; - long binary_scale_factor = 0; - long bits_per_value = 0; - long decimal_scale_factor = 0; - double decimal = 1; + double reference_value = 0; + long binary_scale_factor = 0; + long bits_per_value = 0; + long decimal_scale_factor = 0; + double decimal = 1; size_t simple_packing_size = 0; - unsigned char* buf = NULL; - double divisor = 1; + unsigned char* buf = NULL; + double divisor = 1; long width; long height; long ni; @@ -352,157 +362,153 @@ static int pack_double(grib_accessor* a, const double* cval, size_t *len) long scanning_mode; long list_defining_points; long number_of_data_points; - int ret =0; + int ret = 0; j2k_encode_helper helper; - double units_factor=1.0; - double units_bias=0.0; - double* val=(double*)cval; + double units_factor = 1.0; + double units_bias = 0.0; + double* val = (double*)cval; - self->dirty=1; + self->dirty = 1; - if(*len == 0){ + if (*len == 0) { grib_buffer_replace(a, NULL, 0, 1, 1); return GRIB_SUCCESS; } - if(self->units_factor && - (grib_get_double_internal(grib_handle_of_accessor(a),self->units_factor,&units_factor)== GRIB_SUCCESS)) { - grib_set_double_internal(grib_handle_of_accessor(a),self->units_factor,1.0); + if (self->units_factor && + (grib_get_double_internal(grib_handle_of_accessor(a), self->units_factor, &units_factor) == GRIB_SUCCESS)) { + grib_set_double_internal(grib_handle_of_accessor(a), self->units_factor, 1.0); } - if(self->units_bias && - (grib_get_double_internal(grib_handle_of_accessor(a),self->units_bias,&units_bias)== GRIB_SUCCESS)) { - grib_set_double_internal(grib_handle_of_accessor(a),self->units_bias,0.0); + if (self->units_bias && + (grib_get_double_internal(grib_handle_of_accessor(a), self->units_bias, &units_bias) == GRIB_SUCCESS)) { + grib_set_double_internal(grib_handle_of_accessor(a), self->units_bias, 0.0); } if (units_factor != 1.0) { if (units_bias != 0.0) - for (i=0;ipack_double(a,val,len); + ret = super->pack_double(a, val, len); switch (ret) { - case GRIB_CONSTANT_FIELD: - grib_buffer_replace(a, NULL, 0,1,1); - err = grib_set_long_internal(grib_handle_of_accessor(a), self->number_of_values, *len); - return err; - break; - case GRIB_SUCCESS: - break; - default: - grib_context_log(a->context, GRIB_LOG_ERROR, - "grib_accessor_class_data_jpeg2000_packing pack_double: unable to compute packing parameters"); - return ret; + case GRIB_CONSTANT_FIELD: + grib_buffer_replace(a, NULL, 0, 1, 1); + err = grib_set_long_internal(grib_handle_of_accessor(a), self->number_of_values, *len); + return err; + break; + case GRIB_SUCCESS: + break; + default: + grib_context_log(a->context, GRIB_LOG_ERROR, + "grib_accessor_class_data_jpeg2000_packing pack_double: unable to compute packing parameters"); + return ret; } - if((ret = grib_get_double_internal(grib_handle_of_accessor(a),self->reference_value, &reference_value)) - != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(grib_handle_of_accessor(a), self->reference_value, &reference_value)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->binary_scale_factor, &binary_scale_factor)) - != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->bits_per_value,&bits_per_value)) != - GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->bits_per_value, &bits_per_value)) != + GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->decimal_scale_factor, &decimal_scale_factor)) - != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) return ret; - decimal = grib_power(decimal_scale_factor,10) ; - divisor = grib_power(-binary_scale_factor,2); + decimal = grib_power(decimal_scale_factor, 10); + divisor = grib_power(-binary_scale_factor, 2); - simple_packing_size = (((bits_per_value*n_vals)+7)/8)*sizeof(unsigned char); - buf = (unsigned char*)grib_context_malloc_clear(a->context,simple_packing_size+EXTRA_BUFFER_SIZE); - if(!buf) { + simple_packing_size = (((bits_per_value * n_vals) + 7) / 8) * sizeof(unsigned char); + buf = (unsigned char*)grib_context_malloc_clear(a->context, simple_packing_size + EXTRA_BUFFER_SIZE); + if (!buf) { err = GRIB_OUT_OF_MEMORY; goto cleanup; } - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->ni,&ni)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->ni, &ni)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->nj,&nj)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->nj, &nj)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->type_of_compression_used,&type_of_compression_used)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->type_of_compression_used, &type_of_compression_used)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->target_compression_ratio,&target_compression_ratio)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->target_compression_ratio, &target_compression_ratio)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->scanning_mode,&scanning_mode)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->scanning_mode, &scanning_mode)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->list_defining_points,&list_defining_points)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->list_defining_points, &list_defining_points)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->number_of_data_points,&number_of_data_points)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->number_of_data_points, &number_of_data_points)) != GRIB_SUCCESS) return err; width = ni; height = nj; - if((scanning_mode & (1<<5)) != 0) - { + if ((scanning_mode & (1 << 5)) != 0) { long tmp = width; width = height; height = tmp; } /* The grid is not regular */ - if(list_defining_points != 0) - { + if (list_defining_points != 0) { width = *len; height = 1; } /* There is a bitmap */ - if(*len != number_of_data_points) - { + if (*len != number_of_data_points) { width = *len; height = 1; } - if(width*height != *len) - { + if (width * height != *len) { grib_context_log(a->context, GRIB_LOG_ERROR, - "grib_accessor_class_data_jpeg2000_packing pack_double: width=%ld height=%ld len=%d." - " width*height should equal len!", - (long)width, (long)height, (long)*len); + "grib_accessor_class_data_jpeg2000_packing pack_double: width=%ld height=%ld len=%d." + " width*height should equal len!", + (long)width, (long)height, (long)*len); return GRIB_INTERNAL_ERROR; } - switch( type_of_compression_used) - { - case 0: - Assert(target_compression_ratio == 255); - helper.compression = 0; - break; - - case 1: - Assert(target_compression_ratio != 255); - Assert(target_compression_ratio != 0); - helper.compression = target_compression_ratio; - break; - - default: - err = GRIB_NOT_IMPLEMENTED; - goto cleanup; + switch (type_of_compression_used) { + case 0: + Assert(target_compression_ratio == 255); + helper.compression = 0; + break; + + case 1: + Assert(target_compression_ratio != 255); + Assert(target_compression_ratio != 0); + helper.compression = target_compression_ratio; + break; + + default: + err = GRIB_NOT_IMPLEMENTED; + goto cleanup; } - helper.jpeg_buffer = buf; - helper.width = width; - helper.height = height; + helper.jpeg_buffer = buf; + helper.width = width; + helper.height = height; /* See GRIB-438 */ if (bits_per_value == 0) { const long bits_per_value_adjusted = 1; grib_context_log(a->context, GRIB_LOG_DEBUG, - "grib_accessor_class_data_jpeg2000_packing(%s) : bits per value was zero, changed to %d", - self->jpeg_lib==OPENJPEG_LIB ? "openjpeg" : "jasper", bits_per_value_adjusted); + "grib_accessor_class_data_jpeg2000_packing(%s) : bits per value was zero, changed to %d", + self->jpeg_lib == OPENJPEG_LIB ? "openjpeg" : "jasper", bits_per_value_adjusted); bits_per_value = bits_per_value_adjusted; } - helper.bits_per_value = bits_per_value; + helper.bits_per_value = bits_per_value; helper.buffer_size = simple_packing_size + EXTRA_BUFFER_SIZE; helper.values = val; @@ -513,53 +519,55 @@ static int pack_double(grib_accessor* a, const double* cval, size_t *len) helper.jpeg_length = 0; switch (self->jpeg_lib) { - case OPENJPEG_LIB: - if ( (err = grib_openjpeg_encode(a->context,&helper)) != GRIB_SUCCESS ) goto cleanup; - break; - case JASPER_LIB: - if ( (err = grib_jasper_encode(a->context,&helper)) != GRIB_SUCCESS ) goto cleanup; - break; + case OPENJPEG_LIB: + if ((err = grib_openjpeg_encode(a->context, &helper)) != GRIB_SUCCESS) + goto cleanup; + break; + case JASPER_LIB: + if ((err = grib_jasper_encode(a->context, &helper)) != GRIB_SUCCESS) + goto cleanup; + break; } - if(helper.jpeg_length > simple_packing_size) + if (helper.jpeg_length > simple_packing_size) grib_context_log(a->context, GRIB_LOG_WARNING, - "grib_accessor_data_jpeg2000_packing(%s) : jpeg data (%ld) larger than input data (%ld)", - self->jpeg_lib==OPENJPEG_LIB ? "openjpeg" : "jasper", - helper.jpeg_length, simple_packing_size); + "grib_accessor_data_jpeg2000_packing(%s) : jpeg data (%ld) larger than input data (%ld)", + self->jpeg_lib == OPENJPEG_LIB ? "openjpeg" : "jasper", + helper.jpeg_length, simple_packing_size); - Assert( helper.jpeg_length <= helper.buffer_size); + Assert(helper.jpeg_length <= helper.buffer_size); - if(self->dump_jpg) { - FILE *f = fopen(self->dump_jpg,"w"); - if(f) { - if(fwrite(helper.jpeg_buffer,helper.jpeg_length,1,f) != 1) + if (self->dump_jpg) { + FILE* f = fopen(self->dump_jpg, "w"); + if (f) { + if (fwrite(helper.jpeg_buffer, helper.jpeg_length, 1, f) != 1) perror(self->dump_jpg); if (fclose(f) != 0) perror(self->dump_jpg); } - else perror(self->dump_jpg); + else + perror(self->dump_jpg); } grib_buffer_replace(a, helper.jpeg_buffer, helper.jpeg_length, 1, 1); cleanup: - grib_context_free(a->context,buf); + grib_context_free(a->context, buf); - if(err == GRIB_SUCCESS) - err = grib_set_long_internal(grib_handle_of_accessor(a),self->number_of_values, *len); + if (err == GRIB_SUCCESS) + err = grib_set_long_internal(grib_handle_of_accessor(a), self->number_of_values, *len); return err; - } #else -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { grib_context_log(a->context, GRIB_LOG_ERROR, "JPEG support not enabled."); return GRIB_FUNCTIONALITY_NOT_ENABLED; } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { grib_context_log(a->context, GRIB_LOG_ERROR, "JPEG support not enabled."); return GRIB_FUNCTIONALITY_NOT_ENABLED; @@ -571,18 +579,21 @@ static int unpack_double_element(grib_accessor* a, size_t idx, double* val) { size_t size; double* values; - int err=0; + int err = 0; /* GRIB-564: The index idx relates to codedValues NOT values! */ - err=grib_get_size(grib_handle_of_accessor(a),"codedValues",&size); - if (err) return err; - if (idx > size) return GRIB_INVALID_NEAREST; + err = grib_get_size(grib_handle_of_accessor(a), "codedValues", &size); + if (err) + return err; + if (idx > size) + return GRIB_INVALID_NEAREST; - values=(double*)grib_context_malloc_clear(a->context,size*sizeof(double)); - err=grib_get_double_array(grib_handle_of_accessor(a),"codedValues",values,&size); - if (err) return err; - *val=values[idx]; - grib_context_free(a->context,values); + values = (double*)grib_context_malloc_clear(a->context, size * sizeof(double)); + err = grib_get_double_array(grib_handle_of_accessor(a), "codedValues", values, &size); + if (err) + return err; + *val = values[idx]; + grib_context_free(a->context, values); return err; } diff --git a/src/grib_accessor_class_data_png_packing.c b/src/grib_accessor_class_data_png_packing.c index 63d5e9656..bc7c3c098 100644 --- a/src/grib_accessor_class_data_png_packing.c +++ b/src/grib_accessor_class_data_png_packing.c @@ -46,77 +46,78 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_data_png_packing { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in values */ - int carg; - const char* seclen; - const char* offsetdata; - const char* offsetsection; - int dirty; -/* Members defined in data_png_packing */ - const char* number_of_values; - const char* reference_value; - const char* binary_scale_factor; - const char* decimal_scale_factor; - const char* bits_per_value; - const char* ni; - const char* nj; - const char* list_defining_points; - const char* number_of_data_points; - const char* scanning_mode; +typedef struct grib_accessor_data_png_packing +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in values */ + int carg; + const char* seclen; + const char* offsetdata; + const char* offsetsection; + int dirty; + /* Members defined in data_png_packing */ + const char* number_of_values; + const char* reference_value; + const char* binary_scale_factor; + const char* decimal_scale_factor; + const char* bits_per_value; + const char* ni; + const char* nj; + const char* list_defining_points; + const char* number_of_data_points; + const char* scanning_mode; } grib_accessor_data_png_packing; extern grib_accessor_class* grib_accessor_class_values; static grib_accessor_class _grib_accessor_class_data_png_packing = { - &grib_accessor_class_values, /* super */ - "data_png_packing", /* name */ - sizeof(grib_accessor_data_png_packing), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_values, /* super */ + "data_png_packing", /* name */ + sizeof(grib_accessor_data_png_packing), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -125,88 +126,89 @@ grib_accessor_class* grib_accessor_class_data_png_packing = &_grib_accessor_clas static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long v, grib_arguments* args) +static void init(grib_accessor* a, const long v, grib_arguments* args) { - grib_accessor_data_png_packing *self =(grib_accessor_data_png_packing*)a; + grib_accessor_data_png_packing* self = (grib_accessor_data_png_packing*)a; - self->number_of_values = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->reference_value = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->binary_scale_factor = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->decimal_scale_factor = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->bits_per_value = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); + self->number_of_values = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->reference_value = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->binary_scale_factor = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->decimal_scale_factor = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->bits_per_value = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); - self->ni = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->nj = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); + self->ni = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->nj = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); - self->list_defining_points = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->number_of_data_points = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->scanning_mode = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); + self->list_defining_points = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->number_of_data_points = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->scanning_mode = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); a->flags |= GRIB_ACCESSOR_FLAG_DATA; } -static int value_count(grib_accessor* a,long* n_vals) +static int value_count(grib_accessor* a, long* n_vals) { - grib_accessor_data_png_packing *self =(grib_accessor_data_png_packing*)a; - *n_vals= 0; - return grib_get_long_internal(grib_handle_of_accessor(a),self->number_of_values,n_vals); + grib_accessor_data_png_packing* self = (grib_accessor_data_png_packing*)a; + *n_vals = 0; + return grib_get_long_internal(grib_handle_of_accessor(a), self->number_of_values, n_vals); } #if HAVE_LIBPNG #include "png.h" -typedef struct png_read_callback_data { +typedef struct png_read_callback_data +{ unsigned char* buffer; - size_t length; - size_t offset; + size_t length; + size_t offset; } png_read_callback_data; -static void png_read_callback(png_structp png,png_bytep data, png_size_t length) +static void png_read_callback(png_structp png, png_bytep data, png_size_t length) { png_read_callback_data* p = (png_read_callback_data*)png_get_io_ptr(png); Assert(p->offset + length <= p->length); - memcpy(data,p->buffer+p->offset,length); + memcpy(data, p->buffer + p->offset, length); p->offset += length; } -static void png_write_callback(png_structp png,png_bytep data, png_size_t length) +static void png_write_callback(png_structp png, png_bytep data, png_size_t length) { png_read_callback_data* p = (png_read_callback_data*)png_get_io_ptr(png); Assert(p->offset + length <= p->length); - memcpy(p->buffer+p->offset,data,length); + memcpy(p->buffer + p->offset, data, length); p->offset += length; } @@ -216,63 +218,63 @@ static void png_flush_callback(png_structp png) } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - grib_accessor_data_png_packing *self =(grib_accessor_data_png_packing*)a; + grib_accessor_data_png_packing* self = (grib_accessor_data_png_packing*)a; int err = GRIB_SUCCESS; - int i,j; + int i, j; size_t buflen = grib_byte_count(a); - double bscale = 0; - double dscale = 0; + double bscale = 0; + double dscale = 0; unsigned char* buf = NULL; - size_t n_vals = 0; + size_t n_vals = 0; - long binary_scale_factor = 0; + long binary_scale_factor = 0; long decimal_scale_factor = 0; - double reference_value = 0; - long bits_per_value =0; + double reference_value = 0; + long bits_per_value = 0; long bits8; - long nn=0; + long nn = 0; - png_structp png = 0; - png_infop info = 0,theEnd = 0; + png_structp png = 0; + png_infop info = 0, theEnd = 0; png_bytepp rows = 0; - int interlace = 0,colour = 0,compression = 0,filter = 0,depth = 0; + int interlace = 0, colour = 0, compression = 0, filter = 0, depth = 0; - png_uint_32 width = 0,height = 0; + png_uint_32 width = 0, height = 0; png_read_callback_data callback_data; - self->dirty=0; + self->dirty = 0; n_vals = 0; - err=grib_value_count(a,&nn); - n_vals=nn; - if (err) return err; + err = grib_value_count(a, &nn); + n_vals = nn; + if (err) + return err; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->bits_per_value,&bits_per_value)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) return err; - if((err = grib_get_double_internal(grib_handle_of_accessor(a),self->reference_value, &reference_value)) != GRIB_SUCCESS) + if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->reference_value, &reference_value)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) return err; - bscale = grib_power(binary_scale_factor,2); - dscale = grib_power(-decimal_scale_factor,10); + bscale = grib_power(binary_scale_factor, 2); + dscale = grib_power(-decimal_scale_factor, 10); /* TODO: This should be called upstream */ - if(*len < n_vals) + if (*len < n_vals) return GRIB_ARRAY_TOO_SMALL; /* Special case */ - if(bits_per_value == 0) - { - for(i = 0; i < n_vals; i++) + if (bits_per_value == 0) { + for (i = 0; i < n_vals; i++) val[i] = reference_value; *len = n_vals; return GRIB_SUCCESS; @@ -282,34 +284,30 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len) buf += grib_byte_offset(a); - if ( png_sig_cmp(buf,0,8) != 0) + if (png_sig_cmp(buf, 0, 8) != 0) return GRIB_INVALID_MESSAGE; png = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, - NULL, NULL); - if (!png) - { + NULL, NULL); + if (!png) { err = GRIB_DECODING_ERROR; goto cleanup; } info = png_create_info_struct(png); - if (!info) - { + if (!info) { err = GRIB_DECODING_ERROR; goto cleanup; } theEnd = png_create_info_struct(png); - if (!theEnd) - { + if (!theEnd) { err = GRIB_DECODING_ERROR; goto cleanup; } - if (setjmp(png_jmpbuf(png))) - { + if (setjmp(png_jmpbuf(png))) { err = GRIB_DECODING_ERROR; goto cleanup; } @@ -320,7 +318,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len) /* printf("buflen=%d\n",buflen); */ - png_set_read_fn(png,&callback_data,png_read_callback); + png_set_read_fn(png, &callback_data, png_read_callback); png_read_png(png, info, PNG_TRANSFORM_IDENTITY, NULL); Assert(callback_data.offset == callback_data.length); @@ -329,223 +327,217 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len) rows = png_get_rows(png, info); png_get_IHDR(png, info, - &width, &height, - &depth, &colour, - &interlace, - &compression, - &filter); + &width, &height, + &depth, &colour, + &interlace, + &compression, + &filter); - if (colour == PNG_COLOR_TYPE_RGB) depth=24; - if (colour == PNG_COLOR_TYPE_RGB_ALPHA) depth=32; - bits8 = ((bits_per_value+7)/8)*8; + if (colour == PNG_COLOR_TYPE_RGB) + depth = 24; + if (colour == PNG_COLOR_TYPE_RGB_ALPHA) + depth = 32; + bits8 = ((bits_per_value + 7) / 8) * 8; #ifdef PNG_ANYBITS Assert(depth == bits8); #else - Assert( bits_per_value % 8 == 0 ); + Assert(bits_per_value % 8 == 0); #endif i = 0; /* printf("bscale=%g dscale=%g reference_value=%g\n",bscale,dscale,reference_value); */ - for(j=0; jdirty=1; + self->dirty = 1; n_vals = 0; - err=grib_value_count(a,&nn); - n_vals=nn; - if (err) return err; + err = grib_value_count(a, &nn); + n_vals = nn; + if (err) + return err; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->bits_per_value,&bits_per_value)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) return err; - if((err = grib_get_double_internal(grib_handle_of_accessor(a),self->reference_value, &reference_value)) != GRIB_SUCCESS) + if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->reference_value, &reference_value)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) return err; /* Special case */ - if(*len == 0) { - grib_buffer_replace(a, NULL, 0,1,1); + if (*len == 0) { + grib_buffer_replace(a, NULL, 0, 1, 1); return GRIB_SUCCESS; } - if(bits_per_value == 0) - { + if (bits_per_value == 0) { int i; /* constant field */ - for(i = 1 ; i < n_vals; i++) + for (i = 1; i < n_vals; i++) Assert(val[i] == val[0]); - if((err = grib_set_double_internal(grib_handle_of_accessor(a),self->reference_value, val[0])) != GRIB_SUCCESS) + if ((err = grib_set_double_internal(grib_handle_of_accessor(a), self->reference_value, val[0])) != GRIB_SUCCESS) return err; { /* Make sure we can decode it again */ double ref = 1e-100; - grib_get_double_internal(grib_handle_of_accessor(a),self->reference_value,&ref); - printf("%g %g %g\n",reference_value,ref,reference_value-ref); + grib_get_double_internal(grib_handle_of_accessor(a), self->reference_value, &ref); + printf("%g %g %g\n", reference_value, ref, reference_value - ref); Assert(ref == reference_value); } - if((err = grib_set_long_internal(grib_handle_of_accessor(a),self->number_of_values, n_vals)) != GRIB_SUCCESS) + if ((err = grib_set_long_internal(grib_handle_of_accessor(a), self->number_of_values, n_vals)) != GRIB_SUCCESS) return err; - grib_buffer_replace(a, NULL, 0,1,1); + grib_buffer_replace(a, NULL, 0, 1, 1); return GRIB_SUCCESS; } - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->ni,&ni)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->ni, &ni)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->nj,&nj)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->nj, &nj)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->scanning_mode,&scanning_mode)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->scanning_mode, &scanning_mode)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->list_defining_points,&list_defining_points)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->list_defining_points, &list_defining_points)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->number_of_data_points,&number_of_data_points)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->number_of_data_points, &number_of_data_points)) != GRIB_SUCCESS) return err; width = ni; height = nj; - if((scanning_mode & (1<<5)) != 0) - { + if ((scanning_mode & (1 << 5)) != 0) { long tmp = width; width = height; height = tmp; } /* The grid is not regular */ - if(list_defining_points != 0) - { + if (list_defining_points != 0) { width = *len; height = 1; } /* There is a bitmap */ - if(*len != number_of_data_points) - { + if (*len != number_of_data_points) { width = *len; height = 1; } - if(width*height != *len) - { - fprintf(stderr,"width=%ld height=%ld len=%ld\n", (long)width, (long)height, (long)(*len) ); - Assert(width*height == *len); + if (width * height != *len) { + fprintf(stderr, "width=%ld height=%ld len=%ld\n", (long)width, (long)height, (long)(*len)); + Assert(width * height == *len); } - d = grib_power(decimal_scale_factor,10) ; + d = grib_power(decimal_scale_factor, 10); max = val[0]; min = max; - for(i=1;i< n_vals;i++) - { - if (val[i] > max) max = val[i]; - else if (val[i] < min) min = val[i]; + for (i = 1; i < n_vals; i++) { + if (val[i] > max) + max = val[i]; + else if (val[i] < min) + min = val[i]; } min *= d; max *= d; - if (grib_get_nearest_smaller_value(grib_handle_of_accessor(a),self->reference_value,min,&reference_value) - !=GRIB_SUCCESS) { - grib_context_log(a->context,GRIB_LOG_ERROR, - "unable to find nearest_smaller_value of %g for %s",min,self->reference_value); + if (grib_get_nearest_smaller_value(grib_handle_of_accessor(a), self->reference_value, min, &reference_value) != GRIB_SUCCESS) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "unable to find nearest_smaller_value of %g for %s", min, self->reference_value); return GRIB_INTERNAL_ERROR; } - if(reference_value > min) - { - fprintf(stderr,"reference_value=%g min_value=%g diff=%g\n",reference_value,min,reference_value-min); + if (reference_value > min) { + fprintf(stderr, "reference_value=%g min_value=%g diff=%g\n", reference_value, min, reference_value - min); Assert(reference_value <= min); } - binary_scale_factor = grib_get_binary_scale_fact(max,reference_value,bits_per_value,&err); - divisor = grib_power(-binary_scale_factor,2); + binary_scale_factor = grib_get_binary_scale_fact(max, reference_value, bits_per_value, &err); + divisor = grib_power(-binary_scale_factor, 2); #ifndef PNG_ANYBITS Assert(bits_per_value % 8 == 0); #endif - bits8 = (bits_per_value+7)/8*8; - encoded = grib_context_buffer_malloc_clear(a->context,bits8/8*n_vals); + bits8 = (bits_per_value + 7) / 8 * 8; + encoded = grib_context_buffer_malloc_clear(a->context, bits8 / 8 * n_vals); - if(!encoded) { + if (!encoded) { err = GRIB_OUT_OF_MEMORY; goto cleanup; } buflen = 0; - p = encoded; - for(i=0;i< n_vals;i++){ - long blen = bits8; - unsigned long unsigned_val = (unsigned long)((((val[i]*d)-(reference_value))*divisor)+0.5); - while(blen >= 8) - { - blen -= 8; + p = encoded; + for (i = 0; i < n_vals; i++) { + long blen = bits8; + unsigned long unsigned_val = (unsigned long)((((val[i] * d) - (reference_value)) * divisor) + 0.5); + while (blen >= 8) { + blen -= 8; *p = (unsigned_val >> blen); p++; buflen++; @@ -554,49 +546,46 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) /* buflen = n_vals*(bits_per_value/8);*/ grib_context_log(a->context, GRIB_LOG_DEBUG, - "grib_accessor_data_png_packing : pack_double : packing %s, %d values", a->name, n_vals); - buf = grib_context_buffer_malloc_clear(a->context,buflen); + "grib_accessor_data_png_packing : pack_double : packing %s, %d values", a->name, n_vals); + buf = grib_context_buffer_malloc_clear(a->context, buflen); - if(!buf) { + if (!buf) { err = GRIB_OUT_OF_MEMORY; goto cleanup; } - if((err = grib_set_double_internal(grib_handle_of_accessor(a),self->reference_value, reference_value)) != GRIB_SUCCESS) + if ((err = grib_set_double_internal(grib_handle_of_accessor(a), self->reference_value, reference_value)) != GRIB_SUCCESS) return err; { /* Make sure we can decode it again */ double ref = 1e-100; - grib_get_double_internal(grib_handle_of_accessor(a),self->reference_value,&ref); + grib_get_double_internal(grib_handle_of_accessor(a), self->reference_value, &ref); Assert(ref == reference_value); } - if((err = grib_set_long_internal(grib_handle_of_accessor(a),self->binary_scale_factor, binary_scale_factor)) != GRIB_SUCCESS) + if ((err = grib_set_long_internal(grib_handle_of_accessor(a), self->binary_scale_factor, binary_scale_factor)) != GRIB_SUCCESS) return err; - if((err = grib_set_long_internal(grib_handle_of_accessor(a),self->decimal_scale_factor, decimal_scale_factor)) != GRIB_SUCCESS) + if ((err = grib_set_long_internal(grib_handle_of_accessor(a), self->decimal_scale_factor, decimal_scale_factor)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->ni,&ni)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->ni, &ni)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->nj,&nj)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->nj, &nj)) != GRIB_SUCCESS) return err; png = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); - if (!png) - { + if (!png) { err = GRIB_DECODING_ERROR; goto cleanup; } info = png_create_info_struct(png); - if (!info) - { + if (!info) { err = GRIB_DECODING_ERROR; goto cleanup; } - if (setjmp(png_jmpbuf(png))) - { + if (setjmp(png_jmpbuf(png))) { err = GRIB_DECODING_ERROR; goto cleanup; } @@ -606,73 +595,71 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) callback_data.length = buflen; /* printf("buflen=%d\n",buflen); */ - png_set_write_fn(png,&callback_data,png_write_callback,png_flush_callback); + png_set_write_fn(png, &callback_data, png_write_callback, png_flush_callback); depth = bits8; colour = PNG_COLOR_TYPE_GRAY; - if (bits8 == 24) - { - depth=8; - colour=PNG_COLOR_TYPE_RGB; + if (bits8 == 24) { + depth = 8; + colour = PNG_COLOR_TYPE_RGB; } - if(bits8 == 32 ) - { - depth=8; - colour=PNG_COLOR_TYPE_RGB_ALPHA; + if (bits8 == 32) { + depth = 8; + colour = PNG_COLOR_TYPE_RGB_ALPHA; } png_set_IHDR(png, info, width, height, - depth, colour, PNG_INTERLACE_NONE, - PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); + depth, colour, PNG_INTERLACE_NONE, + PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); /*bytes=bit_depth/8;*/ - bytes = bits8/8; + bytes = bits8 / 8; - rows = grib_context_buffer_malloc_clear(a->context,sizeof(png_bytep)*height); + rows = grib_context_buffer_malloc_clear(a->context, sizeof(png_bytep) * height); /*rows = malloc(height*sizeof(png_bytep));*/ Assert(rows); - for (j=0;jcontext,buf); - grib_context_buffer_free(a->context,encoded); - grib_context_buffer_free(a->context,rows); + grib_context_buffer_free(a->context, buf); + grib_context_buffer_free(a->context, encoded); + grib_context_buffer_free(a->context, rows); - if(err == GRIB_SUCCESS) - err = grib_set_long_internal(grib_handle_of_accessor(a),self->number_of_values, *len); + if (err == GRIB_SUCCESS) + err = grib_set_long_internal(grib_handle_of_accessor(a), self->number_of_values, *len); return err; } #else -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { grib_context_log(a->context, GRIB_LOG_ERROR, - "grib_accessor_data_png_packing: PNG support not enabled. " - "Please rebuild with -DENABLE_PNG=ON"); + "grib_accessor_data_png_packing: PNG support not enabled. " + "Please rebuild with -DENABLE_PNG=ON"); return GRIB_FUNCTIONALITY_NOT_ENABLED; } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { grib_context_log(a->context, GRIB_LOG_ERROR, - "grib_accessor_data_png_packing: PNG support not enabled. " - "Please rebuild with -DENABLE_PNG=ON"); + "grib_accessor_data_png_packing: PNG support not enabled. " + "Please rebuild with -DENABLE_PNG=ON"); return GRIB_FUNCTIONALITY_NOT_ENABLED; } diff --git a/src/grib_accessor_class_data_raw_packing.c b/src/grib_accessor_class_data_raw_packing.c index dcb5e2027..0d61d6cb2 100644 --- a/src/grib_accessor_class_data_raw_packing.c +++ b/src/grib_accessor_class_data_raw_packing.c @@ -13,7 +13,7 @@ #include "grib_api_internal.h" -#define PRE_PROCESSING_NONE 0 +#define PRE_PROCESSING_NONE 0 #define PRE_PROCESSING_DIFFERENCE 1 /* This is used by make_class.pl @@ -42,70 +42,71 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -static int unpack_double_element(grib_accessor*,size_t i, double* val); - -typedef struct grib_accessor_data_raw_packing { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in values */ - int carg; - const char* seclen; - const char* offsetdata; - const char* offsetsection; - int dirty; -/* Members defined in data_raw_packing */ - const char* number_of_values; - const char* precision; +static int unpack_double_element(grib_accessor*, size_t i, double* val); + +typedef struct grib_accessor_data_raw_packing +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in values */ + int carg; + const char* seclen; + const char* offsetdata; + const char* offsetsection; + int dirty; + /* Members defined in data_raw_packing */ + const char* number_of_values; + const char* precision; } grib_accessor_data_raw_packing; extern grib_accessor_class* grib_accessor_class_values; static grib_accessor_class _grib_accessor_class_data_raw_packing = { - &grib_accessor_class_values, /* super */ - "data_raw_packing", /* name */ - sizeof(grib_accessor_data_raw_packing), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - &unpack_double_element, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_values, /* super */ + "data_raw_packing", /* name */ + sizeof(grib_accessor_data_raw_packing), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + &unpack_double_element, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -114,111 +115,109 @@ grib_accessor_class* grib_accessor_class_data_raw_packing = &_grib_accessor_clas static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long v, grib_arguments* args) +static void init(grib_accessor* a, const long v, grib_arguments* args) { - grib_accessor_data_raw_packing *self =(grib_accessor_data_raw_packing*)a; + grib_accessor_data_raw_packing* self = (grib_accessor_data_raw_packing*)a; - self->number_of_values = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); - self->precision = grib_arguments_get_name(grib_handle_of_accessor(a),args,self->carg++); + self->number_of_values = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); + self->precision = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++); a->flags |= GRIB_ACCESSOR_FLAG_DATA; } -static int value_count(grib_accessor* a,long* n_vals) +static int value_count(grib_accessor* a, long* n_vals) { - grib_accessor_data_raw_packing *self =(grib_accessor_data_raw_packing*)a; - *n_vals= 0; - return grib_get_long_internal(grib_handle_of_accessor(a),self->number_of_values,n_vals); + grib_accessor_data_raw_packing* self = (grib_accessor_data_raw_packing*)a; + *n_vals = 0; + return grib_get_long_internal(grib_handle_of_accessor(a), self->number_of_values, n_vals); } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - grib_accessor_data_raw_packing *self =(grib_accessor_data_raw_packing*)a; - unsigned char* buf = NULL; - int bytes = 0; - size_t nvals = 0; - long inlen = grib_byte_count(a); + grib_accessor_data_raw_packing* self = (grib_accessor_data_raw_packing*)a; + unsigned char* buf = NULL; + int bytes = 0; + size_t nvals = 0; + long inlen = grib_byte_count(a); long precision = 0; int code = GRIB_SUCCESS; - if((code = grib_get_long(grib_handle_of_accessor(a),self->precision,&precision)) - != GRIB_SUCCESS) + if ((code = grib_get_long(grib_handle_of_accessor(a), self->precision, &precision)) != GRIB_SUCCESS) return code; - self->dirty=0; + self->dirty = 0; - buf = (unsigned char*)grib_handle_of_accessor(a)->buffer->data; + buf = (unsigned char*)grib_handle_of_accessor(a)->buffer->data; buf += grib_byte_offset(a); - switch(precision) - { - case 1: - bytes = 4; - break; - case 2: - bytes = 8; - break; - default: - return GRIB_NOT_IMPLEMENTED; - break; + switch (precision) { + case 1: + bytes = 4; + break; + case 2: + bytes = 8; + break; + default: + return GRIB_NOT_IMPLEMENTED; + break; } nvals = inlen / bytes; - if(*len < nvals) + if (*len < nvals) return GRIB_ARRAY_TOO_SMALL; - code=grib_ieee_decode_array(a->context,buf,nvals,bytes,val); + code = grib_ieee_decode_array(a->context, buf, nvals, bytes, val); *len = nvals; return code; } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { - grib_accessor_data_raw_packing *self =(grib_accessor_data_raw_packing*)a; + grib_accessor_data_raw_packing* self = (grib_accessor_data_raw_packing*)a; - int bytes = 0; + int bytes = 0; unsigned char* buffer = NULL; long precision = 0; - double* values = (double*)val; - size_t inlen = *len; + double* values = (double*)val; + size_t inlen = *len; int free_buffer = 0; int free_values = 0; @@ -227,53 +226,54 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) size_t bufsize = 0; - if (*len ==0) return GRIB_NO_VALUES; + if (*len == 0) + return GRIB_NO_VALUES; - if((code = grib_get_long_internal(grib_handle_of_accessor(a),self->precision,&precision)) - != GRIB_SUCCESS) + if ((code = grib_get_long_internal(grib_handle_of_accessor(a), self->precision, &precision)) != GRIB_SUCCESS) return code; - self->dirty=1; + self->dirty = 1; - switch(precision) - { - case 1: - bytes = 4; - break; + switch (precision) { + case 1: + bytes = 4; + break; - case 2: - bytes = 8; - break; + case 2: + bytes = 8; + break; - default: - code = GRIB_NOT_IMPLEMENTED; - goto clean_up; - break; + default: + code = GRIB_NOT_IMPLEMENTED; + goto clean_up; + break; } - bufsize = bytes*inlen; + bufsize = bytes * inlen; buffer = (unsigned char*)grib_context_malloc(a->context, bufsize); - if(!buffer) - { + if (!buffer) { code = GRIB_OUT_OF_MEMORY; goto clean_up; } - code=grib_ieee_encode_array(a->context,values,inlen,bytes,buffer); + code = grib_ieee_encode_array(a->context, values, inlen, bytes, buffer); clean_up: - if(free_buffer) free(buffer); - if(free_values) free(values); + if (free_buffer) + free(buffer); + if (free_values) + free(values); - grib_buffer_replace(a, buffer, bufsize,1,1); + grib_buffer_replace(a, buffer, bufsize, 1, 1); - grib_context_buffer_free(a->context,buffer); + grib_context_buffer_free(a->context, buffer); if (code == GRIB_SUCCESS) { - code = grib_set_long(grib_handle_of_accessor(a),self->number_of_values, inlen); - if(code==GRIB_READ_ONLY) code=0; + code = grib_set_long(grib_handle_of_accessor(a), self->number_of_values, inlen); + if (code == GRIB_READ_ONLY) + code = 0; } return code; @@ -281,48 +281,46 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) static int unpack_double_element(grib_accessor* a, size_t idx, double* val) { - int ret=0; - grib_accessor_data_raw_packing *self =(grib_accessor_data_raw_packing*)a; - unsigned char* buf = NULL; - int bytes = 0; - size_t nvals = 0; - long inlen = grib_byte_count(a); + int ret = 0; + grib_accessor_data_raw_packing* self = (grib_accessor_data_raw_packing*)a; + unsigned char* buf = NULL; + int bytes = 0; + size_t nvals = 0; + long inlen = grib_byte_count(a); long pos; long precision = 0; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->precision,&precision)) - != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->precision, &precision)) != GRIB_SUCCESS) return ret; - self->dirty=0; + self->dirty = 0; - buf = (unsigned char*)grib_handle_of_accessor(a)->buffer->data; + buf = (unsigned char*)grib_handle_of_accessor(a)->buffer->data; buf += grib_byte_offset(a); - switch(precision) - { - case 1: - bytes = 4; - break; + switch (precision) { + case 1: + bytes = 4; + break; - case 2: - bytes = 8; - break; + case 2: + bytes = 8; + break; - default: - return GRIB_NOT_IMPLEMENTED; - break; + default: + return GRIB_NOT_IMPLEMENTED; + break; } - pos=bytes*idx; + pos = bytes * idx; - Assert(pos<=inlen); + Assert(pos <= inlen); nvals = 1; - buf+=pos; + buf += pos; - ret=grib_ieee_decode_array(a->context,buf,nvals,bytes,val); + ret = grib_ieee_decode_array(a->context, buf, nvals, bytes, val); return ret; } diff --git a/src/grib_accessor_class_data_secondary_bitmap.c b/src/grib_accessor_class_data_secondary_bitmap.c index e71ea455d..2029b68d6 100644 --- a/src/grib_accessor_class_data_secondary_bitmap.c +++ b/src/grib_accessor_class_data_secondary_bitmap.c @@ -36,65 +36,66 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int unpack_double(grib_accessor*, double* val,size_t *len); +static int get_native_type(grib_accessor*); +static int unpack_double(grib_accessor*, double* val, size_t* len); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_data_secondary_bitmap { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in data_secondary_bitmap */ - const char* primary_bitmap; - const char* secondary_bitmap; - const char* missing_value; - const char* expand_by; +typedef struct grib_accessor_data_secondary_bitmap +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in data_secondary_bitmap */ + const char* primary_bitmap; + const char* secondary_bitmap; + const char* missing_value; + const char* expand_by; } grib_accessor_data_secondary_bitmap; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_data_secondary_bitmap = { - &grib_accessor_class_gen, /* super */ - "data_secondary_bitmap", /* name */ - sizeof(grib_accessor_data_secondary_bitmap), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "data_secondary_bitmap", /* name */ + sizeof(grib_accessor_data_secondary_bitmap), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -103,127 +104,122 @@ grib_accessor_class* grib_accessor_class_data_secondary_bitmap = &_grib_accessor static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long v, grib_arguments* args) +static void init(grib_accessor* a, const long v, grib_arguments* args) { - grib_accessor_data_secondary_bitmap *self =(grib_accessor_data_secondary_bitmap*)a; - self->primary_bitmap = grib_arguments_get_name(grib_handle_of_accessor(a),args,0); - self->secondary_bitmap = grib_arguments_get_name(grib_handle_of_accessor(a),args,1); - self->missing_value = grib_arguments_get_name(grib_handle_of_accessor(a),args,2); - self->expand_by = grib_arguments_get_name(grib_handle_of_accessor(a),args,3); + grib_accessor_data_secondary_bitmap* self = (grib_accessor_data_secondary_bitmap*)a; + self->primary_bitmap = grib_arguments_get_name(grib_handle_of_accessor(a), args, 0); + self->secondary_bitmap = grib_arguments_get_name(grib_handle_of_accessor(a), args, 1); + self->missing_value = grib_arguments_get_name(grib_handle_of_accessor(a), args, 2); + self->expand_by = grib_arguments_get_name(grib_handle_of_accessor(a), args, 3); - a->length = 0; + a->length = 0; } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_values(dumper,a); + grib_dump_values(dumper, a); } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - grib_accessor_data_secondary_bitmap* self = (grib_accessor_data_secondary_bitmap*)a; - - size_t i = 0; - size_t j = 0; - size_t k = 0; - size_t m = 0; - size_t n_vals = 0; - long nn=0; - long expand_by =0; - int err = 0; + grib_accessor_data_secondary_bitmap* self = (grib_accessor_data_secondary_bitmap*)a; + + size_t i = 0; + size_t j = 0; + size_t k = 0; + size_t m = 0; + size_t n_vals = 0; + long nn = 0; + long expand_by = 0; + int err = 0; size_t primary_len; size_t secondary_len; double* primary_vals; double* secondary_vals; - err=grib_value_count(a,&nn); - n_vals=nn; - if (err) return err; + err = grib_value_count(a, &nn); + n_vals = nn; + if (err) + return err; - if(*len < n_vals) - { + if (*len < n_vals) { *len = n_vals; return GRIB_ARRAY_TOO_SMALL; } - if((err = grib_get_long(grib_handle_of_accessor(a),self->expand_by,&expand_by)) != GRIB_SUCCESS) + if ((err = grib_get_long(grib_handle_of_accessor(a), self->expand_by, &expand_by)) != GRIB_SUCCESS) return err; - if((err = grib_get_size(grib_handle_of_accessor(a),self->primary_bitmap,&primary_len)) != GRIB_SUCCESS) + if ((err = grib_get_size(grib_handle_of_accessor(a), self->primary_bitmap, &primary_len)) != GRIB_SUCCESS) return err; - if((err = grib_get_size(grib_handle_of_accessor(a),self->secondary_bitmap,&secondary_len)) != GRIB_SUCCESS) + if ((err = grib_get_size(grib_handle_of_accessor(a), self->secondary_bitmap, &secondary_len)) != GRIB_SUCCESS) return err; - primary_vals = (double*)grib_context_malloc(a->context,primary_len*sizeof(double)); - if(!primary_vals) + primary_vals = (double*)grib_context_malloc(a->context, primary_len * sizeof(double)); + if (!primary_vals) return GRIB_OUT_OF_MEMORY; - secondary_vals = (double*)grib_context_malloc(a->context,secondary_len*sizeof(double)); - if(!secondary_vals) - { - grib_context_free(a->context,primary_vals); + secondary_vals = (double*)grib_context_malloc(a->context, secondary_len * sizeof(double)); + if (!secondary_vals) { + grib_context_free(a->context, primary_vals); return GRIB_OUT_OF_MEMORY; } - if((err = grib_get_double_array_internal(grib_handle_of_accessor(a),self->primary_bitmap,primary_vals,&primary_len)) != GRIB_SUCCESS) - { - grib_context_free(a->context,secondary_vals); - grib_context_free(a->context,primary_vals); + if ((err = grib_get_double_array_internal(grib_handle_of_accessor(a), self->primary_bitmap, primary_vals, &primary_len)) != GRIB_SUCCESS) { + grib_context_free(a->context, secondary_vals); + grib_context_free(a->context, primary_vals); return err; } - if((err = grib_get_double_array_internal(grib_handle_of_accessor(a),self->secondary_bitmap,secondary_vals,&secondary_len)) != GRIB_SUCCESS) - { - grib_context_free(a->context,secondary_vals); - grib_context_free(a->context,primary_vals); + if ((err = grib_get_double_array_internal(grib_handle_of_accessor(a), self->secondary_bitmap, secondary_vals, &secondary_len)) != GRIB_SUCCESS) { + grib_context_free(a->context, secondary_vals); + grib_context_free(a->context, primary_vals); return err; } k = 0; m = 0; - for(i=0;i < primary_len;i++) - { + for (i = 0; i < primary_len; i++) { /* if(primary_vals[i]) f++; */ - if(primary_vals[i]) - { - for(j = 0; j < expand_by; j++) + if (primary_vals[i]) { + for (j = 0; j < expand_by; j++) val[k++] = secondary_vals[m++]; } else { - for(j = 0; j < expand_by; j++) + for (j = 0; j < expand_by; j++) val[k++] = 0; } } @@ -233,14 +229,14 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len) /*printf("FOOBAR %d %d %ld %d\n",f,primary_len,expand_by,n_vals);*/ - *len = n_vals; + *len = n_vals; - grib_context_free(a->context,primary_vals); - grib_context_free(a->context,secondary_vals); + grib_context_free(a->context, primary_vals); + grib_context_free(a->context, secondary_vals); return err; } -static int get_native_type(grib_accessor* a) +static int get_native_type(grib_accessor* a) { /* grib_accessor_data_secondary_bitmap* self = (grib_accessor_data_secondary_bitmap*)a; return grib_accessor_get_native_type(grib_find_accessor(grib_handle_of_accessor(a),self->coded_values));*/ diff --git a/src/grib_accessor_class_data_sh_packed.c b/src/grib_accessor_class_data_sh_packed.c index 69debd20e..9b9897981 100644 --- a/src/grib_accessor_class_data_sh_packed.c +++ b/src/grib_accessor_class_data_sh_packed.c @@ -44,87 +44,88 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_data_sh_packed { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in values */ - int carg; - const char* seclen; - const char* offsetdata; - const char* offsetsection; - int dirty; -/* Members defined in data_simple_packing */ - int edition; - const char* units_factor; - const char* units_bias; - const char* changing_precision; - const char* number_of_values; - const char* bits_per_value; - const char* reference_value; - const char* binary_scale_factor; - const char* decimal_scale_factor; - const char* optimize_scaling_factor; -/* Members defined in data_sh_packed */ - const char* GRIBEX_sh_bug_present; - const char* ieee_floats; - const char* laplacianOperatorIsSet; - const char* laplacianOperator; - const char* sub_j; - const char* sub_k; - const char* sub_m; - const char* pen_j; - const char* pen_k; - const char* pen_m; +typedef struct grib_accessor_data_sh_packed +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in values */ + int carg; + const char* seclen; + const char* offsetdata; + const char* offsetsection; + int dirty; + /* Members defined in data_simple_packing */ + int edition; + const char* units_factor; + const char* units_bias; + const char* changing_precision; + const char* number_of_values; + const char* bits_per_value; + const char* reference_value; + const char* binary_scale_factor; + const char* decimal_scale_factor; + const char* optimize_scaling_factor; + /* Members defined in data_sh_packed */ + const char* GRIBEX_sh_bug_present; + const char* ieee_floats; + const char* laplacianOperatorIsSet; + const char* laplacianOperator; + const char* sub_j; + const char* sub_k; + const char* sub_m; + const char* pen_j; + const char* pen_k; + const char* pen_m; } grib_accessor_data_sh_packed; extern grib_accessor_class* grib_accessor_class_data_simple_packing; static grib_accessor_class _grib_accessor_class_data_sh_packed = { - &grib_accessor_class_data_simple_packing, /* super */ - "data_sh_packed", /* name */ - sizeof(grib_accessor_data_sh_packed), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_data_simple_packing, /* super */ + "data_sh_packed", /* name */ + sizeof(grib_accessor_data_sh_packed), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -133,254 +134,249 @@ grib_accessor_class* grib_accessor_class_data_sh_packed = &_grib_accessor_class_ static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ typedef unsigned long (*encode_float_proc)(double); -typedef double (*decode_float_proc)(unsigned long); +typedef double (*decode_float_proc)(unsigned long); -static void init(grib_accessor* a,const long v, grib_arguments* args) +static void init(grib_accessor* a, const long v, grib_arguments* args) { - grib_accessor_data_sh_packed *self =(grib_accessor_data_sh_packed*)a; - grib_handle* hand = grib_handle_of_accessor(a); - - self->GRIBEX_sh_bug_present = grib_arguments_get_name(hand,args,self->carg++); - self->ieee_floats = grib_arguments_get_name(hand,args,self->carg++); - self->laplacianOperatorIsSet = grib_arguments_get_name(hand,args,self->carg++); - self->laplacianOperator = grib_arguments_get_name(hand,args,self->carg++); - self->sub_j = grib_arguments_get_name(hand,args,self->carg++); - self->sub_k = grib_arguments_get_name(hand,args,self->carg++); - self->sub_m = grib_arguments_get_name(hand,args,self->carg++); - self->pen_j = grib_arguments_get_name(hand,args,self->carg++); - self->pen_k = grib_arguments_get_name(hand,args,self->carg++); - self->pen_m = grib_arguments_get_name(hand,args,self->carg++); + grib_accessor_data_sh_packed* self = (grib_accessor_data_sh_packed*)a; + grib_handle* hand = grib_handle_of_accessor(a); + + self->GRIBEX_sh_bug_present = grib_arguments_get_name(hand, args, self->carg++); + self->ieee_floats = grib_arguments_get_name(hand, args, self->carg++); + self->laplacianOperatorIsSet = grib_arguments_get_name(hand, args, self->carg++); + self->laplacianOperator = grib_arguments_get_name(hand, args, self->carg++); + self->sub_j = grib_arguments_get_name(hand, args, self->carg++); + self->sub_k = grib_arguments_get_name(hand, args, self->carg++); + self->sub_m = grib_arguments_get_name(hand, args, self->carg++); + self->pen_j = grib_arguments_get_name(hand, args, self->carg++); + self->pen_k = grib_arguments_get_name(hand, args, self->carg++); + self->pen_m = grib_arguments_get_name(hand, args, self->carg++); a->flags |= GRIB_ACCESSOR_FLAG_DATA; - a->length=0; + a->length = 0; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - grib_accessor_data_sh_packed *self =(grib_accessor_data_sh_packed*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int ret = 0; - - long sub_j= 0; - long sub_k= 0; - long sub_m= 0; - long pen_j= 0; - long pen_k= 0; - long pen_m= 0; - - if((ret = grib_get_long_internal(hand,self->sub_j,&sub_j)) != GRIB_SUCCESS) + grib_accessor_data_sh_packed* self = (grib_accessor_data_sh_packed*)a; + grib_handle* hand = grib_handle_of_accessor(a); + int ret = 0; + + long sub_j = 0; + long sub_k = 0; + long sub_m = 0; + long pen_j = 0; + long pen_k = 0; + long pen_m = 0; + + if ((ret = grib_get_long_internal(hand, self->sub_j, &sub_j)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(hand,self->sub_k,&sub_k)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(hand, self->sub_k, &sub_k)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(hand,self->sub_m,&sub_m)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(hand, self->sub_m, &sub_m)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(hand,self->pen_j,&pen_j)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(hand, self->pen_j, &pen_j)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(hand,self->pen_k,&pen_k)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(hand, self->pen_k, &pen_k)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(hand,self->pen_m,&pen_m)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(hand, self->pen_m, &pen_m)) != GRIB_SUCCESS) return ret; - if (pen_j != pen_k || pen_j!=pen_m ) { - grib_context_log(a->context,GRIB_LOG_ERROR,"pen_j=%ld, pen_k=%ld, pen_m=%ld\n",pen_j,pen_k,pen_m); - Assert ((pen_j == pen_k) && (pen_j == pen_m)); + if (pen_j != pen_k || pen_j != pen_m) { + grib_context_log(a->context, GRIB_LOG_ERROR, "pen_j=%ld, pen_k=%ld, pen_m=%ld\n", pen_j, pen_k, pen_m); + Assert((pen_j == pen_k) && (pen_j == pen_m)); } - *count=(pen_j+1)*(pen_j+2)-(sub_j+1)*(sub_j+2); + *count = (pen_j + 1) * (pen_j + 2) - (sub_j + 1) * (sub_j + 2); return ret; } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - grib_accessor_data_sh_packed* self = (grib_accessor_data_sh_packed*)a; - - size_t i = 0; - int ret = GRIB_SUCCESS; - long hcount = 0; - long lcount = 0; - long hpos = 0; - long lup = 0; - long mmax = 0; - long n_vals = 0; - double *scals = NULL; + grib_accessor_data_sh_packed* self = (grib_accessor_data_sh_packed*)a; + + size_t i = 0; + int ret = GRIB_SUCCESS; + long hcount = 0; + long lcount = 0; + long hpos = 0; + long lup = 0; + long mmax = 0; + long n_vals = 0; + double* scals = NULL; /* double *pscals=NULL; */ - double dummy=0; + double dummy = 0; - double s = 0; - double d = 0; + double s = 0; + double d = 0; double laplacianOperator = 0; - unsigned char* buf = NULL; - unsigned char* hres = NULL; - unsigned char* lres = NULL; + unsigned char* buf = NULL; + unsigned char* hres = NULL; + unsigned char* lres = NULL; unsigned long packed_offset; - long lpos = 0; - - long maxv = 0; - long GRIBEX_sh_bug_present =0; - long ieee_floats = 0; - - long offsetdata = 0; - long bits_per_value = 0; - double reference_value = 0; - long binary_scale_factor = 0; - long decimal_scale_factor = 0; - - long sub_j= 0; - long sub_k= 0; - long sub_m= 0; - long pen_j= 0; - long pen_k= 0; - long pen_m= 0; - - double operat= 0; + long lpos = 0; + + long maxv = 0; + long GRIBEX_sh_bug_present = 0; + long ieee_floats = 0; + + long offsetdata = 0; + long bits_per_value = 0; + double reference_value = 0; + long binary_scale_factor = 0; + long decimal_scale_factor = 0; + + long sub_j = 0; + long sub_k = 0; + long sub_m = 0; + long pen_j = 0; + long pen_k = 0; + long pen_m = 0; + + double operat = 0; int bytes; - int err=0; + int err = 0; decode_float_proc decode_float = NULL; n_vals = 0; - err=grib_value_count(a,&n_vals); - if (err) return err; + err = grib_value_count(a, &n_vals); + if (err) + return err; - if(*len < n_vals){ + if (*len < n_vals) { *len = n_vals; return GRIB_ARRAY_TOO_SMALL; } - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->offsetdata,&offsetdata)) - != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->bits_per_value,&bits_per_value)) - != GRIB_SUCCESS) return ret; - if((ret = grib_get_double_internal(grib_handle_of_accessor(a),self->reference_value,&reference_value)) - != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->binary_scale_factor,&binary_scale_factor)) - != GRIB_SUCCESS) return ret; - - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->decimal_scale_factor,&decimal_scale_factor)) - != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetdata, &offsetdata)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_double_internal(grib_handle_of_accessor(a), self->reference_value, &reference_value)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->GRIBEX_sh_bug_present,&GRIBEX_sh_bug_present)) - != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->GRIBEX_sh_bug_present, &GRIBEX_sh_bug_present)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->ieee_floats,&ieee_floats)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->ieee_floats, &ieee_floats)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_double_internal(grib_handle_of_accessor(a),self->laplacianOperator,&laplacianOperator)) - != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(grib_handle_of_accessor(a), self->laplacianOperator, &laplacianOperator)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->sub_j,&sub_j)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->sub_j, &sub_j)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->sub_k,&sub_k)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->sub_k, &sub_k)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->sub_m,&sub_m)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->sub_m, &sub_m)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->pen_j,&pen_j)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->pen_j, &pen_j)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->pen_k,&pen_k)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->pen_k, &pen_k)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->pen_m,&pen_m)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->pen_m, &pen_m)) != GRIB_SUCCESS) return ret; - self->dirty=0; + self->dirty = 0; switch (ieee_floats) { - case 0: - decode_float=grib_long_to_ibm; - bytes=4; - break; - case 1: - decode_float=grib_long_to_ieee; - bytes=4; - break; - case 2: - decode_float=grib_long_to_ieee64; - bytes=8; - break; - default: - return GRIB_NOT_IMPLEMENTED; + case 0: + decode_float = grib_long_to_ibm; + bytes = 4; + break; + case 1: + decode_float = grib_long_to_ieee; + bytes = 4; + break; + case 2: + decode_float = grib_long_to_ieee64; + bytes = 8; + break; + default: + return GRIB_NOT_IMPLEMENTED; } - Assert (sub_j == sub_k); - Assert (sub_j == sub_m); - Assert (pen_j == pen_k); - Assert (pen_j == pen_m); + Assert(sub_j == sub_k); + Assert(sub_j == sub_m); + Assert(pen_j == pen_k); + Assert(pen_j == pen_m); buf = (unsigned char*)grib_handle_of_accessor(a)->buffer->data; - maxv = pen_j+1; + maxv = pen_j + 1; - buf += offsetdata; + buf += offsetdata; hres = buf; lres = buf; - packed_offset = offsetdata + bytes*(sub_k+1)*(sub_k+2); + packed_offset = offsetdata + bytes * (sub_k + 1) * (sub_k + 2); - lpos = 8*(packed_offset-offsetdata); + lpos = 8 * (packed_offset - offsetdata); - s = grib_power(binary_scale_factor,2); - d = grib_power(-decimal_scale_factor,10) ; + s = grib_power(binary_scale_factor, 2); + d = grib_power(-decimal_scale_factor, 10); - scals = (double*)grib_context_malloc(a->context,maxv*sizeof(double)); + scals = (double*)grib_context_malloc(a->context, maxv * sizeof(double)); Assert(scals); scals[0] = 0; - for(i=1;i0) - { - lup=mmax; - if(sub_k>=0) - { - for(hcount=0;hcount 0) { + lup = mmax; + if (sub_k >= 0) { + for (hcount = 0; hcount < sub_k + 1; hcount++) { + dummy = decode_float(grib_decode_unsigned_long(hres, &hpos, 8 * bytes)); + dummy = decode_float(grib_decode_unsigned_long(hres, &hpos, 8 * bytes)); lup++; } @@ -388,19 +384,22 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len) } /* pscals=scals+lup; */ - for(lcount=hcount; lcount < maxv ; lcount++) - { - val[i++] = d * (double) ((grib_decode_unsigned_long(lres, &lpos, - bits_per_value)*s)+reference_value); - val[i++] = d * (double) ((grib_decode_unsigned_long(lres, &lpos, - bits_per_value)*s)+reference_value); + for (lcount = hcount; lcount < maxv; lcount++) { + val[i++] = d * (double)((grib_decode_unsigned_long(lres, &lpos, + bits_per_value) * + s) + + reference_value); + val[i++] = d * (double)((grib_decode_unsigned_long(lres, &lpos, + bits_per_value) * + s) + + reference_value); if (mmax == 0) - val[i-1] = 0; + val[i - 1] = 0; lup++; } maxv--; - hcount=0; + hcount = 0; mmax++; } @@ -409,7 +408,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len) (void)dummy; /* suppress gcc warning */ - grib_context_free(a->context,scals); + grib_context_free(a->context, scals); return ret; } diff --git a/src/grib_accessor_class_data_sh_unpacked.c b/src/grib_accessor_class_data_sh_unpacked.c index 111d65d14..12bc96fd4 100644 --- a/src/grib_accessor_class_data_sh_unpacked.c +++ b/src/grib_accessor_class_data_sh_unpacked.c @@ -44,87 +44,88 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_data_sh_unpacked { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in values */ - int carg; - const char* seclen; - const char* offsetdata; - const char* offsetsection; - int dirty; -/* Members defined in data_simple_packing */ - int edition; - const char* units_factor; - const char* units_bias; - const char* changing_precision; - const char* number_of_values; - const char* bits_per_value; - const char* reference_value; - const char* binary_scale_factor; - const char* decimal_scale_factor; - const char* optimize_scaling_factor; -/* Members defined in data_sh_unpacked */ - const char* GRIBEX_sh_bug_present; - const char* ieee_floats; - const char* laplacianOperatorIsSet; - const char* laplacianOperator; - const char* sub_j; - const char* sub_k; - const char* sub_m; - const char* pen_j; - const char* pen_k; - const char* pen_m; +typedef struct grib_accessor_data_sh_unpacked +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in values */ + int carg; + const char* seclen; + const char* offsetdata; + const char* offsetsection; + int dirty; + /* Members defined in data_simple_packing */ + int edition; + const char* units_factor; + const char* units_bias; + const char* changing_precision; + const char* number_of_values; + const char* bits_per_value; + const char* reference_value; + const char* binary_scale_factor; + const char* decimal_scale_factor; + const char* optimize_scaling_factor; + /* Members defined in data_sh_unpacked */ + const char* GRIBEX_sh_bug_present; + const char* ieee_floats; + const char* laplacianOperatorIsSet; + const char* laplacianOperator; + const char* sub_j; + const char* sub_k; + const char* sub_m; + const char* pen_j; + const char* pen_k; + const char* pen_m; } grib_accessor_data_sh_unpacked; extern grib_accessor_class* grib_accessor_class_data_simple_packing; static grib_accessor_class _grib_accessor_class_data_sh_unpacked = { - &grib_accessor_class_data_simple_packing, /* super */ - "data_sh_unpacked", /* name */ - sizeof(grib_accessor_data_sh_unpacked), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_data_simple_packing, /* super */ + "data_sh_unpacked", /* name */ + sizeof(grib_accessor_data_sh_unpacked), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -133,238 +134,234 @@ grib_accessor_class* grib_accessor_class_data_sh_unpacked = &_grib_accessor_clas static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ typedef unsigned long (*encode_float_proc)(double); -typedef double (*decode_float_proc)(unsigned long); +typedef double (*decode_float_proc)(unsigned long); -static void init(grib_accessor* a,const long v, grib_arguments* args) +static void init(grib_accessor* a, const long v, grib_arguments* args) { - grib_accessor_data_sh_unpacked *self =(grib_accessor_data_sh_unpacked*)a; - grib_handle* hand = grib_handle_of_accessor(a); - - self->GRIBEX_sh_bug_present = grib_arguments_get_name(hand,args,self->carg++); - self->ieee_floats = grib_arguments_get_name(hand,args,self->carg++); - self->laplacianOperatorIsSet = grib_arguments_get_name(hand,args,self->carg++); - self->laplacianOperator = grib_arguments_get_name(hand,args,self->carg++); - self->sub_j = grib_arguments_get_name(hand,args,self->carg++); - self->sub_k = grib_arguments_get_name(hand,args,self->carg++); - self->sub_m = grib_arguments_get_name(hand,args,self->carg++); - self->pen_j = grib_arguments_get_name(hand,args,self->carg++); - self->pen_k = grib_arguments_get_name(hand,args,self->carg++); - self->pen_m = grib_arguments_get_name(hand,args,self->carg++); + grib_accessor_data_sh_unpacked* self = (grib_accessor_data_sh_unpacked*)a; + grib_handle* hand = grib_handle_of_accessor(a); + + self->GRIBEX_sh_bug_present = grib_arguments_get_name(hand, args, self->carg++); + self->ieee_floats = grib_arguments_get_name(hand, args, self->carg++); + self->laplacianOperatorIsSet = grib_arguments_get_name(hand, args, self->carg++); + self->laplacianOperator = grib_arguments_get_name(hand, args, self->carg++); + self->sub_j = grib_arguments_get_name(hand, args, self->carg++); + self->sub_k = grib_arguments_get_name(hand, args, self->carg++); + self->sub_m = grib_arguments_get_name(hand, args, self->carg++); + self->pen_j = grib_arguments_get_name(hand, args, self->carg++); + self->pen_k = grib_arguments_get_name(hand, args, self->carg++); + self->pen_m = grib_arguments_get_name(hand, args, self->carg++); a->flags |= GRIB_ACCESSOR_FLAG_DATA; - a->length=0; + a->length = 0; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - grib_accessor_data_sh_unpacked *self =(grib_accessor_data_sh_unpacked*)a; - int ret = 0; + grib_accessor_data_sh_unpacked* self = (grib_accessor_data_sh_unpacked*)a; + int ret = 0; - long sub_j= 0; - long sub_k= 0; - long sub_m= 0; + long sub_j = 0; + long sub_k = 0; + long sub_m = 0; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->sub_j,&sub_j)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->sub_j, &sub_j)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->sub_k,&sub_k)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->sub_k, &sub_k)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->sub_m,&sub_m)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->sub_m, &sub_m)) != GRIB_SUCCESS) return ret; - if (sub_j != sub_k || sub_j!=sub_m ) { - grib_context_log(a->context,GRIB_LOG_ERROR,"sub_j=%ld, sub_k=%ld, sub_m=%ld\n",sub_j,sub_k,sub_m); - Assert ((sub_j == sub_k) && (sub_j == sub_m)); + if (sub_j != sub_k || sub_j != sub_m) { + grib_context_log(a->context, GRIB_LOG_ERROR, "sub_j=%ld, sub_k=%ld, sub_m=%ld\n", sub_j, sub_k, sub_m); + Assert((sub_j == sub_k) && (sub_j == sub_m)); } - *count=(sub_j+1)*(sub_j+2); + *count = (sub_j + 1) * (sub_j + 2); return ret; } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - grib_accessor_data_sh_unpacked* self = (grib_accessor_data_sh_unpacked*)a; - - size_t i = 0; - int ret = GRIB_SUCCESS; - long hcount = 0; - long lcount = 0; - long hpos = 0; - long lup = 0; - long mmax = 0; - long n_vals = 0; - double *scals = NULL; + grib_accessor_data_sh_unpacked* self = (grib_accessor_data_sh_unpacked*)a; + + size_t i = 0; + int ret = GRIB_SUCCESS; + long hcount = 0; + long lcount = 0; + long hpos = 0; + long lup = 0; + long mmax = 0; + long n_vals = 0; + double* scals = NULL; /* double *pscals=NULL; */ - double dummy=0; + double dummy = 0; - double s = 0; - double d = 0; + double s = 0; + double d = 0; double laplacianOperator = 0; - unsigned char* buf = NULL; - unsigned char* hres = NULL; - unsigned char* lres = NULL; + unsigned char* buf = NULL; + unsigned char* hres = NULL; + unsigned char* lres = NULL; unsigned long packed_offset; - long lpos = 0; - - long maxv = 0; - long GRIBEX_sh_bug_present =0; - long ieee_floats = 0; - - long offsetdata = 0; - long bits_per_value = 0; - double reference_value = 0; - long binary_scale_factor = 0; - long decimal_scale_factor = 0; - - long sub_j= 0; - long sub_k= 0; - long sub_m= 0; - long pen_j= 0; - long pen_k= 0; - long pen_m= 0; - - double operat= 0; + long lpos = 0; + + long maxv = 0; + long GRIBEX_sh_bug_present = 0; + long ieee_floats = 0; + + long offsetdata = 0; + long bits_per_value = 0; + double reference_value = 0; + long binary_scale_factor = 0; + long decimal_scale_factor = 0; + + long sub_j = 0; + long sub_k = 0; + long sub_m = 0; + long pen_j = 0; + long pen_k = 0; + long pen_m = 0; + + double operat = 0; int bytes; - int err=0; + int err = 0; decode_float_proc decode_float = NULL; n_vals = 0; - err=grib_value_count(a,&n_vals); - if (err) return err; + err = grib_value_count(a, &n_vals); + if (err) + return err; - if(*len < n_vals){ + if (*len < n_vals) { *len = n_vals; return GRIB_ARRAY_TOO_SMALL; } - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->offsetdata,&offsetdata)) - != GRIB_SUCCESS) return ret; + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetdata, &offsetdata)) != GRIB_SUCCESS) + return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->GRIBEX_sh_bug_present,&GRIBEX_sh_bug_present)) - != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->GRIBEX_sh_bug_present, &GRIBEX_sh_bug_present)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->ieee_floats,&ieee_floats)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->ieee_floats, &ieee_floats)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->sub_j,&sub_j)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->sub_j, &sub_j)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->sub_k,&sub_k)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->sub_k, &sub_k)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->sub_m,&sub_m)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->sub_m, &sub_m)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->pen_j,&pen_j)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->pen_j, &pen_j)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->pen_k,&pen_k)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->pen_k, &pen_k)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->pen_m,&pen_m)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->pen_m, &pen_m)) != GRIB_SUCCESS) return ret; - self->dirty=0; + self->dirty = 0; switch (ieee_floats) { - case 0: - decode_float=grib_long_to_ibm; - bytes=4; - break; - case 1: - decode_float=grib_long_to_ieee; - bytes=4; - break; - case 2: - decode_float=grib_long_to_ieee64; - bytes=8; - break; - default: - return GRIB_NOT_IMPLEMENTED; + case 0: + decode_float = grib_long_to_ibm; + bytes = 4; + break; + case 1: + decode_float = grib_long_to_ieee; + bytes = 4; + break; + case 2: + decode_float = grib_long_to_ieee64; + bytes = 8; + break; + default: + return GRIB_NOT_IMPLEMENTED; } - Assert (sub_j == sub_k); - Assert (sub_j == sub_m); - Assert (pen_j == pen_k); - Assert (pen_j == pen_m); + Assert(sub_j == sub_k); + Assert(sub_j == sub_m); + Assert(pen_j == pen_k); + Assert(pen_j == pen_m); buf = (unsigned char*)grib_handle_of_accessor(a)->buffer->data; - maxv = pen_j+1; + maxv = pen_j + 1; - buf += offsetdata; + buf += offsetdata; hres = buf; lres = buf; - packed_offset = offsetdata + bytes*(sub_k+1)*(sub_k+2); + packed_offset = offsetdata + bytes * (sub_k + 1) * (sub_k + 2); - lpos = 8*(packed_offset-offsetdata); + lpos = 8 * (packed_offset - offsetdata); - s = grib_power(binary_scale_factor,2); - d = grib_power(-decimal_scale_factor,10) ; + s = grib_power(binary_scale_factor, 2); + d = grib_power(-decimal_scale_factor, 10); - scals = (double*)grib_context_malloc(a->context,maxv*sizeof(double)); + scals = (double*)grib_context_malloc(a->context, maxv * sizeof(double)); Assert(scals); - if((ret = grib_get_double_internal(grib_handle_of_accessor(a),self->laplacianOperator,&laplacianOperator)) - != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(grib_handle_of_accessor(a), self->laplacianOperator, &laplacianOperator)) != GRIB_SUCCESS) return ret; scals[0] = 0; - for(i=1;i0) - { - lup=mmax; - if(sub_k>=0) - { - for(hcount=0;hcount 0) { + lup = mmax; + if (sub_k >= 0) { + for (hcount = 0; hcount < sub_k + 1; hcount++) { + val[i++] = decode_float(grib_decode_unsigned_long(hres, &hpos, 8 * bytes)); + val[i++] = decode_float(grib_decode_unsigned_long(hres, &hpos, 8 * bytes)); - if (GRIBEX_sh_bug_present && hcount==sub_k){ + if (GRIBEX_sh_bug_present && hcount == sub_k) { /* bug in ecmwf data, last row (K+1)is scaled but should not */ - val[i-2] *= scals[lup]; - val[i-1] *= scals[lup]; + val[i - 2] *= scals[lup]; + val[i - 1] *= scals[lup]; } lup++; } @@ -372,17 +369,20 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len) } /* pscals=scals+lup; */ - for(lcount=hcount; lcount < maxv ; lcount++) - { - dummy = d * (double) ((grib_decode_unsigned_long(lres, &lpos, - bits_per_value)*s)+reference_value); - dummy = d * (double) ((grib_decode_unsigned_long(lres, &lpos, - bits_per_value)*s)+reference_value); + for (lcount = hcount; lcount < maxv; lcount++) { + dummy = d * (double)((grib_decode_unsigned_long(lres, &lpos, + bits_per_value) * + s) + + reference_value); + dummy = d * (double)((grib_decode_unsigned_long(lres, &lpos, + bits_per_value) * + s) + + reference_value); lup++; } maxv--; - hcount=0; + hcount = 0; mmax++; } @@ -391,7 +391,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len) (void)dummy; /* suppress gcc warning */ - grib_context_free(a->context,scals); + grib_context_free(a->context, scals); return ret; } diff --git a/src/grib_accessor_class_data_shsimple_packing.c b/src/grib_accessor_class_data_shsimple_packing.c index 23e22e9cd..662afe88d 100644 --- a/src/grib_accessor_class_data_shsimple_packing.c +++ b/src/grib_accessor_class_data_shsimple_packing.c @@ -35,64 +35,65 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_double(grib_accessor*, const double* val,size_t *len); +static int get_native_type(grib_accessor*); +static int pack_double(grib_accessor*, const double* val, size_t* len); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_data_shsimple_packing { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in data_shsimple_packing */ - const char* coded_values; - const char* real_part; - int dirty; +typedef struct grib_accessor_data_shsimple_packing +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in data_shsimple_packing */ + const char* coded_values; + const char* real_part; + int dirty; } grib_accessor_data_shsimple_packing; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_data_shsimple_packing = { - &grib_accessor_class_gen, /* super */ - "data_shsimple_packing", /* name */ - sizeof(grib_accessor_data_shsimple_packing), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "data_shsimple_packing", /* name */ + sizeof(grib_accessor_data_shsimple_packing), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -101,45 +102,45 @@ grib_accessor_class* grib_accessor_class_data_shsimple_packing = &_grib_accessor static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long v, grib_arguments* args) +static void init(grib_accessor* a, const long v, grib_arguments* args) { - grib_accessor_data_shsimple_packing *self =(grib_accessor_data_shsimple_packing*)a; + grib_accessor_data_shsimple_packing* self = (grib_accessor_data_shsimple_packing*)a; - self->coded_values = grib_arguments_get_name(grib_handle_of_accessor(a),args,0); - self->real_part = grib_arguments_get_name(grib_handle_of_accessor(a),args,1); + self->coded_values = grib_arguments_get_name(grib_handle_of_accessor(a), args, 0); + self->real_part = grib_arguments_get_name(grib_handle_of_accessor(a), args, 1); a->flags |= GRIB_ACCESSOR_FLAG_DATA; a->length = 0; @@ -147,35 +148,36 @@ static void init(grib_accessor* a,const long v, grib_arguments* args) static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_values(dumper,a); + grib_dump_values(dumper, a); } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { - grib_accessor_data_shsimple_packing* self = (grib_accessor_data_shsimple_packing*)a; - int err = GRIB_SUCCESS; + grib_accessor_data_shsimple_packing* self = (grib_accessor_data_shsimple_packing*)a; + int err = GRIB_SUCCESS; - size_t coded_n_vals = *len-1; - size_t n_vals = *len; + size_t coded_n_vals = *len - 1; + size_t n_vals = *len; - self->dirty=1; + self->dirty = 1; - if (*len ==0) return GRIB_NO_VALUES; + if (*len == 0) + return GRIB_NO_VALUES; - if((err = grib_set_double_internal(grib_handle_of_accessor(a),self->real_part,*val)) != GRIB_SUCCESS) + if ((err = grib_set_double_internal(grib_handle_of_accessor(a), self->real_part, *val)) != GRIB_SUCCESS) return err; val++; - if((err = grib_set_double_array_internal(grib_handle_of_accessor(a),self->coded_values,val,coded_n_vals)) != GRIB_SUCCESS) + if ((err = grib_set_double_array_internal(grib_handle_of_accessor(a), self->coded_values, val, coded_n_vals)) != GRIB_SUCCESS) return err; - *len = n_vals; + *len = n_vals; return err; } -static int get_native_type(grib_accessor* a) +static int get_native_type(grib_accessor* a) { return GRIB_TYPE_DOUBLE; } diff --git a/src/grib_accessor_class_data_simple_packing.c b/src/grib_accessor_class_data_simple_packing.c index 50e7a7695..13a9d5f46 100644 --- a/src/grib_accessor_class_data_simple_packing.c +++ b/src/grib_accessor_class_data_simple_packing.c @@ -52,79 +52,80 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -static int unpack_double_element(grib_accessor*,size_t i, double* val); -static int unpack_double_subarray(grib_accessor*, double* val,size_t start,size_t len); - -typedef struct grib_accessor_data_simple_packing { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in values */ - int carg; - const char* seclen; - const char* offsetdata; - const char* offsetsection; - int dirty; -/* Members defined in data_simple_packing */ - int edition; - const char* units_factor; - const char* units_bias; - const char* changing_precision; - const char* number_of_values; - const char* bits_per_value; - const char* reference_value; - const char* binary_scale_factor; - const char* decimal_scale_factor; - const char* optimize_scaling_factor; +static int unpack_double_element(grib_accessor*, size_t i, double* val); +static int unpack_double_subarray(grib_accessor*, double* val, size_t start, size_t len); + +typedef struct grib_accessor_data_simple_packing +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in values */ + int carg; + const char* seclen; + const char* offsetdata; + const char* offsetsection; + int dirty; + /* Members defined in data_simple_packing */ + int edition; + const char* units_factor; + const char* units_bias; + const char* changing_precision; + const char* number_of_values; + const char* bits_per_value; + const char* reference_value; + const char* binary_scale_factor; + const char* decimal_scale_factor; + const char* optimize_scaling_factor; } grib_accessor_data_simple_packing; extern grib_accessor_class* grib_accessor_class_values; static grib_accessor_class _grib_accessor_class_data_simple_packing = { - &grib_accessor_class_values, /* super */ - "data_simple_packing", /* name */ - sizeof(grib_accessor_data_simple_packing), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - &unpack_double_element, /* unpack only ith value */ - &unpack_double_subarray, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_values, /* super */ + "data_simple_packing", /* name */ + sizeof(grib_accessor_data_simple_packing), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + &unpack_double_element, /* unpack only ith value */ + &unpack_double_subarray, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -133,68 +134,68 @@ grib_accessor_class* grib_accessor_class_data_simple_packing = &_grib_accessor_c static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long v, grib_arguments* args) +static void init(grib_accessor* a, const long v, grib_arguments* args) { - grib_accessor_data_simple_packing *self =(grib_accessor_data_simple_packing*)a; - grib_handle* gh = grib_handle_of_accessor(a); - self->units_factor = grib_arguments_get_name(gh,args,self->carg++); - self->units_bias = grib_arguments_get_name(gh,args,self->carg++); - self->changing_precision = grib_arguments_get_name(gh,args,self->carg++); - self->number_of_values = grib_arguments_get_name(gh,args,self->carg++); - self->bits_per_value = grib_arguments_get_name(gh,args,self->carg++); - self->reference_value = grib_arguments_get_name(gh,args,self->carg++); - self->binary_scale_factor = grib_arguments_get_name(gh,args,self->carg++); - self->decimal_scale_factor = grib_arguments_get_name(gh,args,self->carg++); - self->optimize_scaling_factor = grib_arguments_get_name(gh,args,self->carg++); + grib_accessor_data_simple_packing* self = (grib_accessor_data_simple_packing*)a; + grib_handle* gh = grib_handle_of_accessor(a); + self->units_factor = grib_arguments_get_name(gh, args, self->carg++); + self->units_bias = grib_arguments_get_name(gh, args, self->carg++); + self->changing_precision = grib_arguments_get_name(gh, args, self->carg++); + self->number_of_values = grib_arguments_get_name(gh, args, self->carg++); + self->bits_per_value = grib_arguments_get_name(gh, args, self->carg++); + self->reference_value = grib_arguments_get_name(gh, args, self->carg++); + self->binary_scale_factor = grib_arguments_get_name(gh, args, self->carg++); + self->decimal_scale_factor = grib_arguments_get_name(gh, args, self->carg++); + self->optimize_scaling_factor = grib_arguments_get_name(gh, args, self->carg++); a->flags |= GRIB_ACCESSOR_FLAG_DATA; - self->dirty=1; + self->dirty = 1; } -static const unsigned long nbits[32]={ - 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, - 0x40, 0x80, 0x100, 0x200, 0x400, 0x800, - 0x1000, 0x2000, 0x4000, 0x8000, 0x10000, 0x20000, - 0x40000, 0x80000, 0x100000, 0x200000, 0x400000, 0x800000, - 0x1000000, 0x2000000, 0x4000000, 0x8000000, 0x10000000, 0x20000000, - 0x40000000, 0x80000000 +static const unsigned long nbits[32] = { + 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, + 0x40, 0x80, 0x100, 0x200, 0x400, 0x800, + 0x1000, 0x2000, 0x4000, 0x8000, 0x10000, 0x20000, + 0x40000, 0x80000, 0x100000, 0x200000, 0x400000, 0x800000, + 0x1000000, 0x2000000, 0x4000000, 0x8000000, 0x10000000, 0x20000000, + 0x40000000, 0x80000000 }; static int number_of_bits(unsigned long x, long* result) { - const int count = sizeof(nbits)/sizeof(nbits[0]); - const unsigned long *n=nbits; - *result=0; + const int count = sizeof(nbits) / sizeof(nbits[0]); + const unsigned long* n = nbits; + *result = 0; while (x >= *n) { n++; (*result)++; @@ -205,197 +206,192 @@ static int number_of_bits(unsigned long x, long* result) return GRIB_SUCCESS; } -static int value_count(grib_accessor* a,long* number_of_values) +static int value_count(grib_accessor* a, long* number_of_values) { - grib_accessor_data_simple_packing* self = (grib_accessor_data_simple_packing*)a; - *number_of_values=0; + grib_accessor_data_simple_packing* self = (grib_accessor_data_simple_packing*)a; + *number_of_values = 0; - return grib_get_long_internal(grib_handle_of_accessor(a),self->number_of_values,number_of_values); + return grib_get_long_internal(grib_handle_of_accessor(a), self->number_of_values, number_of_values); } static int unpack_double_element(grib_accessor* a, size_t idx, double* val) { - grib_accessor_data_simple_packing* self = (grib_accessor_data_simple_packing*)a; + grib_accessor_data_simple_packing* self = (grib_accessor_data_simple_packing*)a; long n_vals; - int err = 0; + int err = 0; grib_handle* gh = grib_handle_of_accessor(a); double reference_value; - long binary_scale_factor; - long bits_per_value; - long decimal_scale_factor; + long binary_scale_factor; + long bits_per_value; + long decimal_scale_factor; unsigned char* buf = (unsigned char*)gh->buffer->data; - double s = 0; - double d = 0; - long pos = 0; + double s = 0; + double d = 0; + long pos = 0; n_vals = 0; - err=grib_value_count(a,&n_vals); - if (err) return err; + err = grib_value_count(a, &n_vals); + if (err) + return err; - if((err = grib_get_long_internal(gh,self->bits_per_value,&bits_per_value)) != - GRIB_SUCCESS) + if ((err = grib_get_long_internal(gh, self->bits_per_value, &bits_per_value)) != + GRIB_SUCCESS) return err; - self->dirty=0; + self->dirty = 0; - if((err = grib_get_double_internal(gh,self->reference_value, &reference_value)) != - GRIB_SUCCESS) + if ((err = grib_get_double_internal(gh, self->reference_value, &reference_value)) != + GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->binary_scale_factor, &binary_scale_factor)) - != GRIB_SUCCESS) + if ((err = grib_get_long_internal(gh, self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->decimal_scale_factor, &decimal_scale_factor)) - != GRIB_SUCCESS) + if ((err = grib_get_long_internal(gh, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) return err; /* Special case */ - if (bits_per_value == 0) { - *val=reference_value; + if (bits_per_value == 0) { + *val = reference_value; return GRIB_SUCCESS; } Assert(idx < n_vals); - s = grib_power(binary_scale_factor,2); - d = grib_power(-decimal_scale_factor,10) ; + s = grib_power(binary_scale_factor, 2); + d = grib_power(-decimal_scale_factor, 10); grib_context_log(a->context, GRIB_LOG_DEBUG, - "grib_accessor_data_simple_packing: unpack_double_element: creating %s, %d values (idx=%ld)", - a->name, n_vals, idx); + "grib_accessor_data_simple_packing: unpack_double_element: creating %s, %d values (idx=%ld)", + a->name, n_vals, idx); buf += grib_byte_offset(a); - /*Assert(((bits_per_value*n_vals)/8) < (1<<29));*/ /* See GRIB-787 */ + /*Assert(((bits_per_value*n_vals)/8) < (1<<29));*/ /* See GRIB-787 */ - if(bits_per_value%8) - { + if (bits_per_value % 8) { grib_context_log(a->context, GRIB_LOG_DEBUG, - "unpack_double_element: calling outline function : bpv %d, rv : %g, sf : %d, dsf : %d ", - bits_per_value,reference_value,binary_scale_factor, decimal_scale_factor); - pos=idx*bits_per_value; - *val= (double) ((( - grib_decode_unsigned_long(buf, &pos, bits_per_value)*s)+reference_value)*d); + "unpack_double_element: calling outline function : bpv %d, rv : %g, sf : %d, dsf : %d ", + bits_per_value, reference_value, binary_scale_factor, decimal_scale_factor); + pos = idx * bits_per_value; + *val = (double)((( + grib_decode_unsigned_long(buf, &pos, bits_per_value) * s) + + reference_value) * + d); /* val[i] = grib_decode_unsigned_long(buf, &pos, bits_per_value); */ /* fprintf(stdout,"unpck uuu-o: %d vals %d bitspv buf %d by long \n", n_vals, bits_per_value, pos/8);*/ } - else - { - int bc = 0; + else { + int bc = 0; size_t octet = 0; - long lvalue = 0; - int l = bits_per_value/8; + long lvalue = 0; + int l = bits_per_value / 8; - pos=idx*l; - buf+=pos; + pos = idx * l; + buf += pos; lvalue |= buf[octet++]; - for ( bc=1; bcbits_per_value,&bits_per_value)) != - GRIB_SUCCESS) + if ((err = grib_get_long_internal(gh, self->bits_per_value, &bits_per_value)) != + GRIB_SUCCESS) return err; /* * check we don't decode bpv > max(ulong) as it is * not currently supported by the algorithm */ - if ( bits_per_value > (sizeof(long)*8) ) { + if (bits_per_value > (sizeof(long) * 8)) { return GRIB_INVALID_BPV; } - if(self->units_factor && - (grib_get_double_internal(gh,self->units_factor,&units_factor)== GRIB_SUCCESS)) { - grib_set_double_internal(gh,self->units_factor,1.0); + if (self->units_factor && + (grib_get_double_internal(gh, self->units_factor, &units_factor) == GRIB_SUCCESS)) { + grib_set_double_internal(gh, self->units_factor, 1.0); } - if(self->units_bias && - (grib_get_double_internal(gh,self->units_bias,&units_bias)== GRIB_SUCCESS)) { - grib_set_double_internal(gh,self->units_bias,0.0); + if (self->units_bias && + (grib_get_double_internal(gh, self->units_bias, &units_bias) == GRIB_SUCCESS)) { + grib_set_double_internal(gh, self->units_bias, 0.0); } - if(n_vals==0){ + if (n_vals == 0) { *len = 0; return GRIB_SUCCESS; } - self->dirty=0; + self->dirty = 0; - if((err = grib_get_double_internal(gh,self->reference_value, &reference_value)) != - GRIB_SUCCESS) + if ((err = grib_get_double_internal(gh, self->reference_value, &reference_value)) != + GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->binary_scale_factor, &binary_scale_factor)) - != GRIB_SUCCESS) + if ((err = grib_get_long_internal(gh, self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->decimal_scale_factor, &decimal_scale_factor)) - != GRIB_SUCCESS) + if ((err = grib_get_long_internal(gh, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) return err; /* Special case */ - if(bits_per_value == 0) - { - for(i = 0; i < n_vals; i++) + if (bits_per_value == 0) { + for (i = 0; i < n_vals; i++) val[i] = reference_value; *len = n_vals; return GRIB_SUCCESS; } - s = grib_power(binary_scale_factor,2); - d = grib_power(-decimal_scale_factor,10) ; + s = grib_power(binary_scale_factor, 2); + d = grib_power(-decimal_scale_factor, 10); grib_context_log(a->context, GRIB_LOG_DEBUG, - "grib_accessor_data_simple_packing: unpack_double : creating %s, %d values", - a->name, n_vals); + "grib_accessor_data_simple_packing: unpack_double : creating %s, %d values", + a->name, n_vals); offsetBeforeData = grib_byte_offset(a); buf += offsetBeforeData; - /*Assert(((bits_per_value*n_vals)/8) < (1<<29));*/ /* See GRIB-787 */ + /*Assert(((bits_per_value*n_vals)/8) < (1<<29));*/ /* See GRIB-787 */ /* ECC-941 */ { long offsetAfterData = 0; - err = grib_get_long(gh, "offsetAfterData", &offsetAfterData); + err = grib_get_long(gh, "offsetAfterData", &offsetAfterData); if (!err && offsetAfterData > offsetBeforeData) { - const long valuesSize = (bits_per_value*n_vals)/8; /*in bytes*/ + const long valuesSize = (bits_per_value * n_vals) / 8; /*in bytes*/ if (offsetBeforeData + valuesSize > offsetAfterData) { grib_context_log(a->context, GRIB_LOG_ERROR, "Data section size mismatch: offset before data=%ld, offset after data=%ld (num values=%ld, bits per value=%ld)", @@ -406,55 +402,60 @@ static int _unpack_double(grib_accessor* a, double* val, size_t *len,unsigned c } grib_context_log(a->context, GRIB_LOG_DEBUG, - "unpack_double: calling outline function : bpv %d, rv : %g, sf : %d, dsf : %d ", - bits_per_value,reference_value,binary_scale_factor, decimal_scale_factor); - grib_decode_double_array(buf,&pos,bits_per_value,reference_value,s,d,n_vals,val); + "unpack_double: calling outline function : bpv %d, rv : %g, sf : %d, dsf : %d ", + bits_per_value, reference_value, binary_scale_factor, decimal_scale_factor); + grib_decode_double_array(buf, &pos, bits_per_value, reference_value, s, d, n_vals, val); - *len = (long) n_vals; + *len = (long)n_vals; if (units_factor != 1.0) { if (units_bias != 0.0) - for (i=0;ibuffer->data; - size_t nvals = len; - size_t *plen=&len; - long bits_per_value=0; + grib_accessor_data_simple_packing* self = (grib_accessor_data_simple_packing*)a; + unsigned char* buf = (unsigned char*)grib_handle_of_accessor(a)->buffer->data; + size_t nvals = len; + size_t* plen = &len; + long bits_per_value = 0; long pos; int err; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->bits_per_value,&bits_per_value)) != - GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->bits_per_value, &bits_per_value)) != + GRIB_SUCCESS) return err; - buf+=(start*bits_per_value)/8; - pos=start*bits_per_value%8; - return _unpack_double(a,val,plen,buf,pos,nvals); + buf += (start * bits_per_value) / 8; + pos = start * bits_per_value % 8; + return _unpack_double(a, val, plen, buf, pos, nvals); } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { unsigned char* buf = (unsigned char*)grib_handle_of_accessor(a)->buffer->data; - size_t nvals=0; - long pos=0; - int err=0; - long count=0; + size_t nvals = 0; + long pos = 0; + int err = 0; + long count = 0; - err=grib_value_count(a,&count); - if (err) return err; - nvals=count; + err = grib_value_count(a, &count); + if (err) + return err; + nvals = count; - return _unpack_double(a,val,len,buf,pos,nvals); + return _unpack_double(a, val, len, buf, pos, nvals); } #if GRIB_IBMPOWER67_OPT @@ -467,15 +468,14 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len) static int producing_large_constant_fields(grib_handle* h, int edition) { /* First check if the transient key is set */ - grib_context* c = h->context; - long produceLargeConstantFields=0; - if (grib_get_long(h, "produceLargeConstantFields", &produceLargeConstantFields)==GRIB_SUCCESS && - produceLargeConstantFields != 0) - { + grib_context* c = h->context; + long produceLargeConstantFields = 0; + if (grib_get_long(h, "produceLargeConstantFields", &produceLargeConstantFields) == GRIB_SUCCESS && + produceLargeConstantFields != 0) { return 1; } - if (c->gribex_mode_on==1 && edition==1) { + if (c->gribex_mode_on == 1 && edition == 1) { return 1; } @@ -507,14 +507,14 @@ static int producing_large_constant_fields(const grib_context* c, grib_handle* h static int check_range(grib_handle* h, const double min_val, const double max_val) { - int result = GRIB_SUCCESS; + int result = GRIB_SUCCESS; grib_context* ctx = h->context; - - if ( !(min_val < DBL_MAX && min_val > -DBL_MAX) ) { + + if (!(min_val < DBL_MAX && min_val > -DBL_MAX)) { grib_context_log(ctx, GRIB_LOG_ERROR, "Minimum value out of range: %g", min_val); return GRIB_ENCODING_ERROR; } - if ( !(max_val < DBL_MAX && max_val > -DBL_MAX) ) { + if (!(max_val < DBL_MAX && max_val > -DBL_MAX)) { grib_context_log(ctx, GRIB_LOG_ERROR, "Maximum value out of range: %g", max_val); return GRIB_ENCODING_ERROR; } @@ -527,68 +527,69 @@ static int check_range(grib_handle* h, const double min_val, const double max_va return result; } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { - grib_accessor_data_simple_packing* self = (grib_accessor_data_simple_packing*)a; - grib_handle* gh = grib_handle_of_accessor(a); + grib_accessor_data_simple_packing* self = (grib_accessor_data_simple_packing*)a; + grib_handle* gh = grib_handle_of_accessor(a); size_t i; size_t n_vals = *len; - int err = 0; + int err = 0; int last; - double reference_value = 0; - long binary_scale_factor = 0; - long bits_per_value = 0; - long decimal_scale_factor = 0; - long decimal_scale_factor_get = 0; - long optimize_scaling_factor = 0; - double decimal = 1; - double max = 0; - double min = 0; - double unscaled_max = 0; - double unscaled_min = 0; - double f=0; - double range=0; - double minrange=0,maxrange=0; - long changing_precision=0; - grib_context* c=a->context; - - decimal_scale_factor=0; + double reference_value = 0; + long binary_scale_factor = 0; + long bits_per_value = 0; + long decimal_scale_factor = 0; + long decimal_scale_factor_get = 0; + long optimize_scaling_factor = 0; + double decimal = 1; + double max = 0; + double min = 0; + double unscaled_max = 0; + double unscaled_min = 0; + double f = 0; + double range = 0; + double minrange = 0, maxrange = 0; + long changing_precision = 0; + grib_context* c = a->context; + + decimal_scale_factor = 0; if (*len == 0) { return GRIB_NO_VALUES; } - if((err = grib_get_long_internal(gh,self->bits_per_value,&bits_per_value)) != - GRIB_SUCCESS) + if ((err = grib_get_long_internal(gh, self->bits_per_value, &bits_per_value)) != + GRIB_SUCCESS) return err; - if(*len == 0) return GRIB_SUCCESS; + if (*len == 0) + return GRIB_SUCCESS; - if((err = grib_get_long_internal(gh,self->decimal_scale_factor, &decimal_scale_factor_get)) - != GRIB_SUCCESS) + if ((err = grib_get_long_internal(gh, self->decimal_scale_factor, &decimal_scale_factor_get)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->optimize_scaling_factor, &optimize_scaling_factor)) - != GRIB_SUCCESS) + if ((err = grib_get_long_internal(gh, self->optimize_scaling_factor, &optimize_scaling_factor)) != GRIB_SUCCESS) return err; /* * check we don't encode bpv > max(ulong)-1 as it is * not currently supported by the algorithm */ - if ( bits_per_value > (sizeof(long)*8-1) ) { + if (bits_per_value > (sizeof(long) * 8 - 1)) { return GRIB_INVALID_BPV; } - self->dirty=1; + self->dirty = 1; max = val[0]; min = max; #if GRIB_IBMPOWER67_OPT - minmax_val(val+1, n_vals-1, &min, &max); + minmax_val(val + 1, n_vals - 1, &min, &max); #else - for(i=1;i< n_vals;i++) { - if (val[i] > max ) max = val[i]; - else if (val[i] < min ) min = val[i]; + for (i = 1; i < n_vals; i++) { + if (val[i] > max) + max = val[i]; + else if (val[i] < min) + min = val[i]; } #endif if ((err = check_range(gh, min, max)) != GRIB_SUCCESS) { @@ -596,180 +597,179 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) } /* constant field only reference_value is set and bits_per_value=0 */ - if(max==min) { + if (max == min) { int large_constant_fields = 0; - if (grib_get_nearest_smaller_value(gh,self->reference_value,val[0],&reference_value) - !=GRIB_SUCCESS) { - grib_context_log(a->context,GRIB_LOG_ERROR, - "unable to find nearest_smaller_value of %g for %s",min,self->reference_value); + if (grib_get_nearest_smaller_value(gh, self->reference_value, val[0], &reference_value) != GRIB_SUCCESS) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "unable to find nearest_smaller_value of %g for %s", min, self->reference_value); return GRIB_INTERNAL_ERROR; } - if((err = grib_set_double_internal(gh,self->reference_value, reference_value)) != - GRIB_SUCCESS) + if ((err = grib_set_double_internal(gh, self->reference_value, reference_value)) != + GRIB_SUCCESS) return err; { /* Make sure we can decode it again */ double ref = 1e-100; - grib_get_double_internal(gh,self->reference_value,&ref); + grib_get_double_internal(gh, self->reference_value, &ref); if (ref != reference_value) - printf("%.20e != %.20e",ref,reference_value); + printf("%.20e != %.20e", ref, reference_value); Assert(ref == reference_value); } large_constant_fields = producing_large_constant_fields(gh, self->edition); if (large_constant_fields) { - if((err = grib_set_long_internal(gh,self->binary_scale_factor, 0)) != - GRIB_SUCCESS) + if ((err = grib_set_long_internal(gh, self->binary_scale_factor, 0)) != + GRIB_SUCCESS) return err; - if((err = grib_set_long_internal(gh,self->decimal_scale_factor, 0)) != - GRIB_SUCCESS) + if ((err = grib_set_long_internal(gh, self->decimal_scale_factor, 0)) != + GRIB_SUCCESS) return err; - if (bits_per_value==0) { - if((err = grib_set_long_internal(gh,self->bits_per_value, 16)) != - GRIB_SUCCESS) + if (bits_per_value == 0) { + if ((err = grib_set_long_internal(gh, self->bits_per_value, 16)) != + GRIB_SUCCESS) return err; } return GRIB_SUCCESS; - } else { - bits_per_value=0; - if((err = grib_set_long_internal(gh,self->bits_per_value, bits_per_value)) != - GRIB_SUCCESS) + } + else { + bits_per_value = 0; + if ((err = grib_set_long_internal(gh, self->bits_per_value, bits_per_value)) != + GRIB_SUCCESS) return err; return GRIB_CONSTANT_FIELD; } } - if((err = grib_get_long_internal(gh,self->binary_scale_factor, &binary_scale_factor)) - != GRIB_SUCCESS) + if ((err = grib_get_long_internal(gh, self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->changing_precision, &changing_precision)) - != GRIB_SUCCESS) + if ((err = grib_get_long_internal(gh, self->changing_precision, &changing_precision)) != GRIB_SUCCESS) return err; /* the packing parameters are not properly defined this is a safe way of fixing the problem */ - if ( changing_precision==0 && bits_per_value==0 && decimal_scale_factor_get==0) { - - grib_context_log(a->context,GRIB_LOG_WARNING, - "%s==0 and %s==0 (setting %s=24)", - self->bits_per_value, - self->decimal_scale_factor, - self->bits_per_value); - - bits_per_value=24; - if((err = grib_set_long_internal(gh,self->bits_per_value, - bits_per_value))!= GRIB_SUCCESS) + if (changing_precision == 0 && bits_per_value == 0 && decimal_scale_factor_get == 0) { + grib_context_log(a->context, GRIB_LOG_WARNING, + "%s==0 and %s==0 (setting %s=24)", + self->bits_per_value, + self->decimal_scale_factor, + self->bits_per_value); + + bits_per_value = 24; + if ((err = grib_set_long_internal(gh, self->bits_per_value, + bits_per_value)) != GRIB_SUCCESS) return err; } - if ( bits_per_value == 0 || (binary_scale_factor==0 && decimal_scale_factor_get!=0) ) { + if (bits_per_value == 0 || (binary_scale_factor == 0 && decimal_scale_factor_get != 0)) { /* decimal_scale_factor is given, binary_scale_factor=0 and bits_per_value is computed */ - binary_scale_factor=0; - decimal_scale_factor=decimal_scale_factor_get; - decimal = grib_power(decimal_scale_factor,10) ; - min*=decimal; - max*=decimal; + binary_scale_factor = 0; + decimal_scale_factor = decimal_scale_factor_get; + decimal = grib_power(decimal_scale_factor, 10); + min *= decimal; + max *= decimal; /* bits_per_value=(long)ceil(log((double)(imax-imin+1))/log(2.0)); */ /* See GRIB-540 for why we use ceil */ - err = number_of_bits( (unsigned long)ceil(fabs(max-min)), &bits_per_value ); + err = number_of_bits((unsigned long)ceil(fabs(max - min)), &bits_per_value); if (err) { - grib_context_log(a->context,GRIB_LOG_ERROR, - "Range of values too large. Try a smaller value for decimal precision (less than %d)", - decimal_scale_factor); + grib_context_log(a->context, GRIB_LOG_ERROR, + "Range of values too large. Try a smaller value for decimal precision (less than %d)", + decimal_scale_factor); return err; } /*printf("bits_per_value=%ld\n",bits_per_value);*/ - if((err = grib_set_long_internal(gh,self->bits_per_value, bits_per_value)) != - GRIB_SUCCESS) + if ((err = grib_set_long_internal(gh, self->bits_per_value, bits_per_value)) != + GRIB_SUCCESS) return err; - if (grib_get_nearest_smaller_value(gh,self->reference_value,min,&reference_value) - !=GRIB_SUCCESS) { - grib_context_log(a->context,GRIB_LOG_ERROR, - "unable to find nearest_smaller_value of %g for %s",min,self->reference_value); + if (grib_get_nearest_smaller_value(gh, self->reference_value, min, &reference_value) != GRIB_SUCCESS) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "unable to find nearest_smaller_value of %g for %s", min, self->reference_value); return GRIB_INTERNAL_ERROR; } /* divisor=1; */ - } else { - last=127; - if (c->gribex_mode_on && self->edition==1) last=99; + } + else { + last = 127; + if (c->gribex_mode_on && self->edition == 1) + last = 99; /* bits_per_value is given and decimal_scale_factor and binary_scale_factor are calcualated */ if (max == min) { - binary_scale_factor=0; + binary_scale_factor = 0; /* divisor=1; */ - if (grib_get_nearest_smaller_value(gh,self->reference_value,min,&reference_value) - !=GRIB_SUCCESS) { - grib_context_log(a->context,GRIB_LOG_ERROR, - "unable to find nearest_smaller_value of %g for %s",min,self->reference_value); + if (grib_get_nearest_smaller_value(gh, self->reference_value, min, &reference_value) != GRIB_SUCCESS) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "unable to find nearest_smaller_value of %g for %s", min, self->reference_value); return GRIB_INTERNAL_ERROR; } - } else if (optimize_scaling_factor) { - int compat_gribex = c->gribex_mode_on && self->edition==1; + } + else if (optimize_scaling_factor) { + int compat_gribex = c->gribex_mode_on && self->edition == 1; - if((err = grib_optimize_decimal_factor (a, self->reference_value, - max, min, bits_per_value, - compat_gribex, 1, - &decimal_scale_factor, &binary_scale_factor, &reference_value)) != GRIB_SUCCESS) - return err; - } else { + if ((err = grib_optimize_decimal_factor(a, self->reference_value, + max, min, bits_per_value, + compat_gribex, 1, + &decimal_scale_factor, &binary_scale_factor, &reference_value)) != GRIB_SUCCESS) + return err; + } + else { /* printf("max=%g reference_value=%g grib_power(-last,2)=%g decimal_scale_factor=%ld bits_per_value=%ld\n", max,reference_value,grib_power(-last,2),decimal_scale_factor,bits_per_value);*/ /* last must be a parameter coming from the def file*/ - range=(max-min); - unscaled_min=min; - unscaled_max=max; - f=(grib_power(bits_per_value,2)-1); - minrange=grib_power(-last,2)*f; - maxrange=grib_power(last,2)*f; - - while (rangemaxrange) { - decimal_scale_factor-=1; - decimal/=10; - min=unscaled_min*decimal; - max=unscaled_max*decimal; - range=(max-min); + while (range > maxrange) { + decimal_scale_factor -= 1; + decimal /= 10; + min = unscaled_min * decimal; + max = unscaled_max * decimal; + range = (max - min); } - if (grib_get_nearest_smaller_value(gh,self->reference_value, - min,&reference_value)!=GRIB_SUCCESS) { - grib_context_log(a->context,GRIB_LOG_ERROR, - "unable to find nearest_smaller_value of %g for %s",min,self->reference_value); + if (grib_get_nearest_smaller_value(gh, self->reference_value, + min, &reference_value) != GRIB_SUCCESS) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "unable to find nearest_smaller_value of %g for %s", min, self->reference_value); return GRIB_INTERNAL_ERROR; } - binary_scale_factor = grib_get_binary_scale_fact(max,reference_value,bits_per_value,&err); - if(err) return err; + binary_scale_factor = grib_get_binary_scale_fact(max, reference_value, bits_per_value, &err); + if (err) + return err; } } - if((err = grib_set_double_internal(gh,self->reference_value, reference_value)) != - GRIB_SUCCESS) + if ((err = grib_set_double_internal(gh, self->reference_value, reference_value)) != + GRIB_SUCCESS) return err; - if((err = grib_set_long_internal(gh,self->changing_precision, 0)) != - GRIB_SUCCESS) + if ((err = grib_set_long_internal(gh, self->changing_precision, 0)) != + GRIB_SUCCESS) return err; - if((err = grib_set_long_internal(gh,self->binary_scale_factor, binary_scale_factor)) != - GRIB_SUCCESS) + if ((err = grib_set_long_internal(gh, self->binary_scale_factor, binary_scale_factor)) != + GRIB_SUCCESS) return err; - if((err = grib_set_long_internal(gh,self->decimal_scale_factor, decimal_scale_factor)) - != GRIB_SUCCESS) + if ((err = grib_set_long_internal(gh, self->decimal_scale_factor, decimal_scale_factor)) != GRIB_SUCCESS) return err; return GRIB_SUCCESS; diff --git a/src/grib_accessor_class_decimal_precision.c b/src/grib_accessor_class_decimal_precision.c index 4eb5fcbe3..aa1e59a15 100644 --- a/src/grib_accessor_class_decimal_precision.c +++ b/src/grib_accessor_class_decimal_precision.c @@ -38,65 +38,66 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_decimal_precision { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in decimal_precision */ - const char* values; - const char* bits_per_value; - const char* changing_precision; - const char* decimal_scale_factor; +typedef struct grib_accessor_decimal_precision +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in decimal_precision */ + const char* values; + const char* bits_per_value; + const char* changing_precision; + const char* decimal_scale_factor; } grib_accessor_decimal_precision; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_decimal_precision = { - &grib_accessor_class_long, /* super */ - "decimal_precision", /* name */ - sizeof(grib_accessor_decimal_precision), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "decimal_precision", /* name */ + sizeof(grib_accessor_decimal_precision), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -105,129 +106,125 @@ grib_accessor_class* grib_accessor_class_decimal_precision = &_grib_accessor_cla static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* args) +static void init(grib_accessor* a, const long l, grib_arguments* args) { - int n=0; - grib_accessor_decimal_precision* self= (grib_accessor_decimal_precision*)a; + int n = 0; + grib_accessor_decimal_precision* self = (grib_accessor_decimal_precision*)a; - self->bits_per_value=grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->decimal_scale_factor=grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->changing_precision=grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->values=grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); + self->bits_per_value = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->decimal_scale_factor = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->changing_precision = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; - a->length=0; + a->length = 0; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - int ret=0; - grib_accessor_decimal_precision* self= (grib_accessor_decimal_precision*)a; - grib_handle* h=grib_handle_of_accessor(a); + int ret = 0; + grib_accessor_decimal_precision* self = (grib_accessor_decimal_precision*)a; + grib_handle* h = grib_handle_of_accessor(a); - if((ret = grib_get_long_internal(h,self->decimal_scale_factor,val)) - != GRIB_SUCCESS) return ret; + if ((ret = grib_get_long_internal(h, self->decimal_scale_factor, val)) != GRIB_SUCCESS) + return ret; - *len =1; + *len = 1; return ret; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { - long bitsPerValue=0; - double* values=NULL; - size_t size=0; - int ret=0; - grib_accessor_decimal_precision* self= (grib_accessor_decimal_precision*)a; - grib_context* c=a->context; - grib_handle* h=grib_handle_of_accessor(a); + long bitsPerValue = 0; + double* values = NULL; + size_t size = 0; + int ret = 0; + grib_accessor_decimal_precision* self = (grib_accessor_decimal_precision*)a; + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); if (!self->values) { - if((ret = grib_set_long_internal(h, self->bits_per_value,0)) - != GRIB_SUCCESS) return ret; + if ((ret = grib_set_long_internal(h, self->bits_per_value, 0)) != GRIB_SUCCESS) + return ret; - if((ret = grib_set_long_internal(h, self->decimal_scale_factor,*val)) - != GRIB_SUCCESS) return ret; + if ((ret = grib_set_long_internal(h, self->decimal_scale_factor, *val)) != GRIB_SUCCESS) + return ret; - if((ret = grib_set_long_internal(h, self->changing_precision,1)) - != GRIB_SUCCESS) { - grib_context_free(c,values); + if ((ret = grib_set_long_internal(h, self->changing_precision, 1)) != GRIB_SUCCESS) { + grib_context_free(c, values); return ret; } return GRIB_SUCCESS; } - if ( (ret=grib_get_size(h,self->values,&size)) != GRIB_SUCCESS) return ret; + if ((ret = grib_get_size(h, self->values, &size)) != GRIB_SUCCESS) + return ret; - values=(double*)grib_context_malloc(c,size*sizeof(double)); - if (!values) return GRIB_OUT_OF_MEMORY; + values = (double*)grib_context_malloc(c, size * sizeof(double)); + if (!values) + return GRIB_OUT_OF_MEMORY; - if((ret = grib_get_double_array_internal(h,self->values,values,&size)) - != GRIB_SUCCESS) { - grib_context_buffer_free(c,values); + if ((ret = grib_get_double_array_internal(h, self->values, values, &size)) != GRIB_SUCCESS) { + grib_context_buffer_free(c, values); return ret; } - if((ret = grib_set_long_internal(h, self->decimal_scale_factor,*val)) - != GRIB_SUCCESS) { - grib_context_buffer_free(c,values); + if ((ret = grib_set_long_internal(h, self->decimal_scale_factor, *val)) != GRIB_SUCCESS) { + grib_context_buffer_free(c, values); return ret; } - if((ret = grib_set_long_internal(h, self->bits_per_value,bitsPerValue)) - != GRIB_SUCCESS) { - grib_context_free(c,values); + if ((ret = grib_set_long_internal(h, self->bits_per_value, bitsPerValue)) != GRIB_SUCCESS) { + grib_context_free(c, values); return ret; } - if((ret = grib_set_long_internal(h, self->changing_precision,1)) - != GRIB_SUCCESS) { - grib_context_free(c,values); + if ((ret = grib_set_long_internal(h, self->changing_precision, 1)) != GRIB_SUCCESS) { + grib_context_free(c, values); return ret; } - if((ret = grib_set_double_array_internal(h, self->values,values,size)) - != GRIB_SUCCESS) { - grib_context_buffer_free(c,values); + if ((ret = grib_set_double_array_internal(h, self->values, values, size)) != GRIB_SUCCESS) { + grib_context_buffer_free(c, values); return ret; } - grib_context_free(c,values); + grib_context_free(c, values); return GRIB_SUCCESS; } diff --git a/src/grib_accessor_class_dictionary.c b/src/grib_accessor_class_dictionary.c index 0278769d8..a502a5c7f 100644 --- a/src/grib_accessor_class_dictionary.c +++ b/src/grib_accessor_class_dictionary.c @@ -37,69 +37,70 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); -static int value_count(grib_accessor*,long*); +static int get_native_type(grib_accessor*); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); +static int value_count(grib_accessor*, long*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_dictionary { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in dictionary */ - const char* dictionary; - const char* key; - long column; - const char* masterDir; - const char* localDir; +typedef struct grib_accessor_dictionary +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in dictionary */ + const char* dictionary; + const char* key; + long column; + const char* masterDir; + const char* localDir; } grib_accessor_dictionary; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_dictionary = { - &grib_accessor_class_gen, /* super */ - "dictionary", /* name */ - sizeof(grib_accessor_dictionary), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "dictionary", /* name */ + sizeof(grib_accessor_dictionary), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -108,264 +109,279 @@ grib_accessor_class* grib_accessor_class_dictionary = &_grib_accessor_class_dict static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->pack_double = (*(c->super))->pack_double; - c->pack_string = (*(c->super))->pack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->pack_double = (*(c->super))->pack_double; + c->pack_string = (*(c->super))->pack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ static void init(grib_accessor* a, const long len, grib_arguments* params) { - int n=0; - grib_accessor_dictionary* self = (grib_accessor_dictionary*)a; + int n = 0; + grib_accessor_dictionary* self = (grib_accessor_dictionary*)a; - self->dictionary = grib_arguments_get_string(grib_handle_of_accessor(a),params,n++); - self->key = grib_arguments_get_name(grib_handle_of_accessor(a),params,n++); - self->column = grib_arguments_get_long(grib_handle_of_accessor(a),params,n++); - self->masterDir = grib_arguments_get_name(grib_handle_of_accessor(a),params,n++); - self->localDir = grib_arguments_get_name(grib_handle_of_accessor(a),params,n++); + self->dictionary = grib_arguments_get_string(grib_handle_of_accessor(a), params, n++); + self->key = grib_arguments_get_name(grib_handle_of_accessor(a), params, n++); + self->column = grib_arguments_get_long(grib_handle_of_accessor(a), params, n++); + self->masterDir = grib_arguments_get_name(grib_handle_of_accessor(a), params, n++); + self->localDir = grib_arguments_get_name(grib_handle_of_accessor(a), params, n++); a->length = 0; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - } -static grib_trie* load_dictionary(grib_context* c,grib_accessor* a, int* err) +static grib_trie* load_dictionary(grib_context* c, grib_accessor* a, int* err) { grib_accessor_dictionary* self = (grib_accessor_dictionary*)a; - char* filename=NULL; - char line[1024]={0,}; - char key[1024]={0,}; - char masterDir[1024]={0,}; - char localDir[1024]={0,}; - char dictName[1024]={0,}; - char *localFilename=0; - char* list=0; - size_t len=1024; - grib_trie* dictionary=NULL; - FILE* f=NULL; - int i=0; - grib_handle* h=grib_handle_of_accessor(a); - - *err=GRIB_SUCCESS; - - len=1024; - if (self->masterDir != NULL) grib_get_string(h,self->masterDir,masterDir,&len); - len=1024; - if (self->localDir != NULL) grib_get_string(h,self->localDir,localDir,&len); - - if (*masterDir!=0) { - char name[2048]={0,}; - char recomposed[2048]={0,}; - sprintf(name,"%s/%s",masterDir,self->dictionary); - grib_recompose_name(h, NULL,name, recomposed,0); - filename=grib_context_full_defs_path(c,recomposed); - } else { - filename=grib_context_full_defs_path(c,self->dictionary); + char* filename = NULL; + char line[1024] = {0,}; + char key[1024] = {0,}; + char masterDir[1024] = {0,}; + char localDir[1024] = {0,}; + char dictName[1024] = {0,}; + char* localFilename = 0; + char* list = 0; + size_t len = 1024; + grib_trie* dictionary = NULL; + FILE* f = NULL; + int i = 0; + grib_handle* h = grib_handle_of_accessor(a); + + *err = GRIB_SUCCESS; + + len = 1024; + if (self->masterDir != NULL) + grib_get_string(h, self->masterDir, masterDir, &len); + len = 1024; + if (self->localDir != NULL) + grib_get_string(h, self->localDir, localDir, &len); + + if (*masterDir != 0) { + char name[2048] = {0,}; + char recomposed[2048] = {0,}; + sprintf(name, "%s/%s", masterDir, self->dictionary); + grib_recompose_name(h, NULL, name, recomposed, 0); + filename = grib_context_full_defs_path(c, recomposed); + } + else { + filename = grib_context_full_defs_path(c, self->dictionary); } - if (*localDir!=0) { - char localName[2048]={0,}; - char localRecomposed[1024]={0,}; - sprintf(localName,"%s/%s",localDir,self->dictionary); - grib_recompose_name(h, NULL,localName, localRecomposed,0); - localFilename=grib_context_full_defs_path(c,localRecomposed); - sprintf(dictName,"%s:%s",localFilename,filename); - } else { - sprintf(dictName,"%s",filename); + if (*localDir != 0) { + char localName[2048] = {0,}; + char localRecomposed[1024] = {0,}; + sprintf(localName, "%s/%s", localDir, self->dictionary); + grib_recompose_name(h, NULL, localName, localRecomposed, 0); + localFilename = grib_context_full_defs_path(c, localRecomposed); + sprintf(dictName, "%s:%s", localFilename, filename); + } + else { + sprintf(dictName, "%s", filename); } if (!filename) { - grib_context_log(c,GRIB_LOG_ERROR,"unable to find def file %s",self->dictionary); - *err=GRIB_FILE_NOT_FOUND; + grib_context_log(c, GRIB_LOG_ERROR, "unable to find def file %s", self->dictionary); + *err = GRIB_FILE_NOT_FOUND; return NULL; - } else { - grib_context_log(c,GRIB_LOG_DEBUG,"found def file %s",filename); } - dictionary=(grib_trie*)grib_trie_get(c->lists,dictName); + else { + grib_context_log(c, GRIB_LOG_DEBUG, "found def file %s", filename); + } + dictionary = (grib_trie*)grib_trie_get(c->lists, dictName); if (dictionary) { - grib_context_log(c,GRIB_LOG_DEBUG,"using dictionary %s from cache",self->dictionary); + grib_context_log(c, GRIB_LOG_DEBUG, "using dictionary %s from cache", self->dictionary); return dictionary; - } else { - grib_context_log(c,GRIB_LOG_DEBUG,"using dictionary %s from file %s",self->dictionary,filename); + } + else { + grib_context_log(c, GRIB_LOG_DEBUG, "using dictionary %s from file %s", self->dictionary, filename); } - f=codes_fopen(filename,"r"); - if (!f) {*err=GRIB_IO_PROBLEM; return NULL;} + f = codes_fopen(filename, "r"); + if (!f) { + *err = GRIB_IO_PROBLEM; + return NULL; + } - dictionary=grib_trie_new(c); + dictionary = grib_trie_new(c); - while(fgets(line,sizeof(line)-1,f)) { - i=0; - while (line[i] != '|' && line[i] != 0) { - key[i]=line[i]; + while (fgets(line, sizeof(line) - 1, f)) { + i = 0; + while (line[i] != '|' && line[i] != 0) { + key[i] = line[i]; i++; } - key[i]=0; - list=(char*)grib_context_malloc_clear(c,strlen(line)+1); - memcpy(list,line,strlen(line)); - grib_trie_insert(dictionary,key,list); + key[i] = 0; + list = (char*)grib_context_malloc_clear(c, strlen(line) + 1); + memcpy(list, line, strlen(line)); + grib_trie_insert(dictionary, key, list); } fclose(f); - if (localFilename!=0) { - f=codes_fopen(localFilename,"r"); - if (!f) {*err=GRIB_IO_PROBLEM; return NULL;} + if (localFilename != 0) { + f = codes_fopen(localFilename, "r"); + if (!f) { + *err = GRIB_IO_PROBLEM; + return NULL; + } - while(fgets(line,sizeof(line)-1,f)) { - i=0; - while (line[i] != '|' && line[i] != 0) { - key[i]=line[i]; + while (fgets(line, sizeof(line) - 1, f)) { + i = 0; + while (line[i] != '|' && line[i] != 0) { + key[i] = line[i]; i++; } - key[i]=0; - list=(char*)grib_context_malloc_clear(c,strlen(line)+1); - memcpy(list,line,strlen(line)); - grib_trie_insert(dictionary,key,list); + key[i] = 0; + list = (char*)grib_context_malloc_clear(c, strlen(line) + 1); + memcpy(list, line, strlen(line)); + grib_trie_insert(dictionary, key, list); } fclose(f); } - grib_trie_insert(c->lists,filename,dictionary); + grib_trie_insert(c->lists, filename, dictionary); return dictionary; } static void dump(grib_accessor* a, grib_dumper* dumper) { switch (get_native_type(a)) { - case GRIB_TYPE_STRING: - grib_dump_string(dumper,a,NULL); - break; - case GRIB_TYPE_LONG: - grib_dump_long(dumper,a,NULL); - break; - case GRIB_TYPE_DOUBLE: - grib_dump_double(dumper,a,NULL); - break; + case GRIB_TYPE_STRING: + grib_dump_string(dumper, a, NULL); + break; + case GRIB_TYPE_LONG: + grib_dump_long(dumper, a, NULL); + break; + case GRIB_TYPE_DOUBLE: + grib_dump_double(dumper, a, NULL); + break; } } -static int unpack_string (grib_accessor* a, char* buffer, size_t *len) +static int unpack_string(grib_accessor* a, char* buffer, size_t* len) { grib_accessor_dictionary* self = (grib_accessor_dictionary*)a; - int err = GRIB_SUCCESS; - char key[1024]={0,}; - size_t size=1024; - char* list=NULL; - char* start=NULL; - char* end=NULL; - size_t rsize=0; - int i=0; - - grib_trie* dictionary=load_dictionary(a->context,a,&err); - if (err) return err; - - if((err=grib_get_string_internal(grib_handle_of_accessor(a),self->key,key,&size)) != GRIB_SUCCESS) { + int err = GRIB_SUCCESS; + char key[1024] = {0,}; + size_t size = 1024; + char* list = NULL; + char* start = NULL; + char* end = NULL; + size_t rsize = 0; + int i = 0; + + grib_trie* dictionary = load_dictionary(a->context, a, &err); + if (err) + return err; + + if ((err = grib_get_string_internal(grib_handle_of_accessor(a), self->key, key, &size)) != GRIB_SUCCESS) { /* grib_trie_delete(dictionary); */ return err; } - list=(char*)grib_trie_get(dictionary,key); + list = (char*)grib_trie_get(dictionary, key); if (!list) { /* grib_trie_delete(dictionary); */ return GRIB_NOT_FOUND; } - end=list; - for (i=0;i<=self->column;i++) { - start=end; - while (*end != '|' && *end!=0) end++; - if (! *end ) { + end = list; + for (i = 0; i <= self->column; i++) { + start = end; + while (*end != '|' && *end != 0) + end++; + if (!*end) { break; } end++; } end--; - rsize=end-start; + rsize = end - start; if (*len < rsize) { /* grib_trie_delete(dictionary); */ return GRIB_ARRAY_TOO_SMALL; } - *len=rsize; + *len = rsize; Assert(buffer); - memcpy(buffer,start,rsize); - buffer[rsize]=0; + memcpy(buffer, start, rsize); + buffer[rsize] = 0; /* grib_trie_delete(dictionary); */ return err; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - *count=1; + *count = 1; return 0; } static int get_native_type(grib_accessor* a) { - int type=GRIB_TYPE_DOUBLE; + int type = GRIB_TYPE_DOUBLE; if (a->flags & GRIB_ACCESSOR_FLAG_LONG_TYPE) - type=GRIB_TYPE_LONG; + type = GRIB_TYPE_LONG; if (a->flags & GRIB_ACCESSOR_FLAG_STRING_TYPE) - type=GRIB_TYPE_STRING; + type = GRIB_TYPE_STRING; return type; } -static int unpack_long (grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - int err=0; - char buffer[1024]={0,}; - size_t size=1024; + int err = 0; + char buffer[1024] = {0,}; + size_t size = 1024; - err=unpack_string (a,buffer,&size); - if (err) return err; + err = unpack_string(a, buffer, &size); + if (err) + return err; - *val=atol(buffer); - *len=1; + *val = atol(buffer); + *len = 1; return err; } -static int unpack_double (grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - int err=0; - char buffer[1024]={0,}; - size_t size=1024; + int err = 0; + char buffer[1024] = {0,}; + size_t size = 1024; - err=unpack_string (a,buffer,&size); - if (err) return err; + err = unpack_string(a, buffer, &size); + if (err) + return err; - *val=atof(buffer); - *len=1; + *val = atof(buffer); + *len = 1; return err; } diff --git a/src/grib_accessor_class_dirty.c b/src/grib_accessor_class_dirty.c index 50b3c7ecc..3d6fc9c4a 100644 --- a/src/grib_accessor_class_dirty.c +++ b/src/grib_accessor_class_dirty.c @@ -36,62 +36,63 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_dirty { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in dirty */ - const char* accessor; +typedef struct grib_accessor_dirty +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in dirty */ + const char* accessor; } grib_accessor_dirty; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_dirty = { - &grib_accessor_class_long, /* super */ - "dirty", /* name */ - sizeof(grib_accessor_dirty), /* size */ + &grib_accessor_class_long, /* super */ + "dirty", /* name */ + sizeof(grib_accessor_dirty), /* size */ 0, /* inited */ &init_class, /* init_class */ &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -100,67 +101,69 @@ grib_accessor_class* grib_accessor_class_dirty = &_grib_accessor_class_dirty; static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_dirty* self = (grib_accessor_dirty*)a; - self->accessor = grib_arguments_get_name(grib_handle_of_accessor(a),c,0); + self->accessor = grib_arguments_get_name(grib_handle_of_accessor(a), c, 0); a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; a->flags |= GRIB_ACCESSOR_FLAG_HIDDEN; - a->length=0; + a->length = 0; } -static int pack_long (grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { grib_accessor_dirty* self = (grib_accessor_dirty*)a; - grib_accessor* x=grib_find_accessor(grib_handle_of_accessor(a),self->accessor); + grib_accessor* x = grib_find_accessor(grib_handle_of_accessor(a), self->accessor); - if (x) x->dirty=*val; + if (x) + x->dirty = *val; return GRIB_SUCCESS; } -static int unpack_long (grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_dirty* self = (grib_accessor_dirty*)a; - grib_accessor* x=grib_find_accessor(grib_handle_of_accessor(a),self->accessor); + grib_accessor* x = grib_find_accessor(grib_handle_of_accessor(a), self->accessor); - if (x) x->dirty=1; + if (x) + x->dirty = 1; - *val=1; + *val = 1; return GRIB_SUCCESS; } diff --git a/src/grib_accessor_class_divdouble.c b/src/grib_accessor_class_divdouble.c index 91947da28..2c56ba767 100644 --- a/src/grib_accessor_class_divdouble.c +++ b/src/grib_accessor_class_divdouble.c @@ -37,62 +37,63 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_double(grib_accessor*, double* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_divdouble { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in double */ -/* Members defined in divdouble */ - const char* val; - double divisor; +typedef struct grib_accessor_divdouble +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in double */ + /* Members defined in divdouble */ + const char* val; + double divisor; } grib_accessor_divdouble; extern grib_accessor_class* grib_accessor_class_double; static grib_accessor_class _grib_accessor_class_divdouble = { - &grib_accessor_class_double, /* super */ - "divdouble", /* name */ - sizeof(grib_accessor_divdouble), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_double, /* super */ + "divdouble", /* name */ + sizeof(grib_accessor_divdouble), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -101,70 +102,69 @@ grib_accessor_class* grib_accessor_class_divdouble = &_grib_accessor_class_divdo static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { - grib_accessor_divdouble* self = (grib_accessor_divdouble*)a; - int n = 0; + grib_accessor_divdouble* self = (grib_accessor_divdouble*)a; + int n = 0; - self->val = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->divisor = grib_arguments_get_double(grib_handle_of_accessor(a),c,n++); + self->val = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->divisor = grib_arguments_get_double(grib_handle_of_accessor(a), c, n++); } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - grib_accessor_divdouble* self = (grib_accessor_divdouble*)a; - int ret = GRIB_SUCCESS; - double value = 0; + grib_accessor_divdouble* self = (grib_accessor_divdouble*)a; + int ret = GRIB_SUCCESS; + double value = 0; - if(*len < 1) - { + if (*len < 1) { *len = 1; return GRIB_ARRAY_TOO_SMALL; } ret = grib_get_double_internal(grib_handle_of_accessor(a), self->val, &value); - if(ret != GRIB_SUCCESS ) + if (ret != GRIB_SUCCESS) return ret; /* fprintf(stdout,"\nname %s %s %g/%g\n",a->name ,self->val,value,divisor);*/ - Assert(self->divisor!=0); - *val = value/self->divisor; + Assert(self->divisor != 0); + *val = value / self->divisor; *len = 1; return GRIB_SUCCESS; diff --git a/src/grib_accessor_class_double.c b/src/grib_accessor_class_double.c index f0f6ed0ad..40a189aee 100644 --- a/src/grib_accessor_class_double.c +++ b/src/grib_accessor_class_double.c @@ -37,62 +37,63 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); +static int get_native_type(grib_accessor*); static int pack_missing(grib_accessor*); -static int unpack_string (grib_accessor*, char*, size_t *len); +static int unpack_string(grib_accessor*, char*, size_t* len); static void dump(grib_accessor*, grib_dumper*); static void init_class(grib_accessor_class*); static int compare(grib_accessor*, grib_accessor*); -typedef struct grib_accessor_double { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in double */ +typedef struct grib_accessor_double +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in double */ } grib_accessor_double; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_double = { - &grib_accessor_class_gen, /* super */ - "double", /* name */ - sizeof(grib_accessor_double), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - &pack_missing, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "double", /* name */ + sizeof(grib_accessor_double), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + &pack_missing, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + &compare, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -101,122 +102,126 @@ grib_accessor_class* grib_accessor_class_double = &_grib_accessor_class_double; static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static int get_native_type(grib_accessor* a) +static int get_native_type(grib_accessor* a) { return GRIB_TYPE_DOUBLE; } -static int unpack_string(grib_accessor*a , char* v, size_t *len) +static int unpack_string(grib_accessor* a, char* v, size_t* len) { double val = 0; - size_t l = 1; + size_t l = 1; char repres[1024]; - grib_unpack_double (a , &val, &l); + grib_unpack_double(a, &val, &l); - if ((val == GRIB_MISSING_DOUBLE) && ((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) ) - sprintf(repres,"MISSING"); + if ((val == GRIB_MISSING_DOUBLE) && ((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0)) + sprintf(repres, "MISSING"); else - sprintf(repres,"%g", val); + sprintf(repres, "%g", val); - l = strlen(repres)+1; + l = strlen(repres) + 1; - if(l >*len ){ - grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_long : unpack_string : Buffer too small for %s ", a->name ); + if (l > *len) { + grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_long : unpack_string : Buffer too small for %s ", a->name); *len = l; return GRIB_BUFFER_TOO_SMALL; } - grib_context_log(a->context,GRIB_LOG_DEBUG, "grib_accessor_long: Casting double %s to string ", a->name); + grib_context_log(a->context, GRIB_LOG_DEBUG, "grib_accessor_long: Casting double %s to string ", a->name); *len = l; - strcpy(v,repres); + strcpy(v, repres); return GRIB_SUCCESS; } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_values(dumper,a); + grib_dump_values(dumper, a); } static int compare(grib_accessor* a, grib_accessor* b) { - int retval=0; - double *aval=0; - double *bval=0; + int retval = 0; + double* aval = 0; + double* bval = 0; size_t alen = 0; size_t blen = 0; - long count = 0; - int err=0; + long count = 0; + int err = 0; - err=grib_value_count(a,&count); - if (err) return err; - alen=count; + err = grib_value_count(a, &count); + if (err) + return err; + alen = count; - err=grib_value_count(b,&count); - if (err) return err; - blen=count; + err = grib_value_count(b, &count); + if (err) + return err; + blen = count; - if (alen != blen) return GRIB_COUNT_MISMATCH; + if (alen != blen) + return GRIB_COUNT_MISMATCH; - aval=(double*)grib_context_malloc(a->context,alen*sizeof(double)); - bval=(double*)grib_context_malloc(b->context,blen*sizeof(double)); + aval = (double*)grib_context_malloc(a->context, alen * sizeof(double)); + bval = (double*)grib_context_malloc(b->context, blen * sizeof(double)); - grib_unpack_double(a,aval,&alen); - grib_unpack_double(b,bval,&blen); + grib_unpack_double(a, aval, &alen); + grib_unpack_double(b, bval, &blen); retval = GRIB_SUCCESS; while (alen != 0) { - if (*bval != *aval) retval = GRIB_DOUBLE_VALUE_MISMATCH; + if (*bval != *aval) + retval = GRIB_DOUBLE_VALUE_MISMATCH; alen--; } - grib_context_free(a->context,aval); - grib_context_free(b->context,bval); + grib_context_free(a->context, aval); + grib_context_free(b->context, bval); return retval; } static int pack_missing(grib_accessor* a) { - size_t one = 1; + size_t one = 1; double value = GRIB_MISSING_DOUBLE; - if(a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) - return grib_pack_double(a,&value,&one); + if (a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) + return grib_pack_double(a, &value, &one); return GRIB_VALUE_CANNOT_BE_MISSING; } /* diff --git a/src/grib_accessor_class_element.c b/src/grib_accessor_class_element.c index edc097093..e00992b71 100644 --- a/src/grib_accessor_class_element.c +++ b/src/grib_accessor_class_element.c @@ -38,63 +38,64 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_element { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in element */ - const char* array; - long element; +typedef struct grib_accessor_element +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in element */ + const char* array; + long element; } grib_accessor_element; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_element = { - &grib_accessor_class_long, /* super */ - "element", /* name */ - sizeof(grib_accessor_element), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "element", /* name */ + sizeof(grib_accessor_element), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -103,112 +104,113 @@ grib_accessor_class* grib_accessor_class_element = &_grib_accessor_class_element static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_element* self = (grib_accessor_element*)a; - int n = 0; + int n = 0; - self->array = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->element = grib_arguments_get_long(grib_handle_of_accessor(a),c,n++); + self->array = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->element = grib_arguments_get_long(grib_handle_of_accessor(a), c, n++); } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_element* self = (grib_accessor_element*)a; - int ret = 0; - size_t size=0; - long* ar=NULL; - grib_context* c=a->context; + int ret = 0; + size_t size = 0; + long* ar = NULL; + grib_context* c = a->context; - if(*len < 1){ + if (*len < 1) { ret = GRIB_ARRAY_TOO_SMALL; return ret; } - if((ret = grib_get_size(grib_handle_of_accessor(a), self->array,&size)) != GRIB_SUCCESS) + if ((ret = grib_get_size(grib_handle_of_accessor(a), self->array, &size)) != GRIB_SUCCESS) return ret; - ar=(long*)grib_context_malloc_clear(c,size*sizeof(long)); + ar = (long*)grib_context_malloc_clear(c, size * sizeof(long)); if (!ar) { - grib_context_log(c,GRIB_LOG_ERROR,"unable to allocate %d bytes",size*sizeof(long)); + grib_context_log(c, GRIB_LOG_ERROR, "unable to allocate %d bytes", size * sizeof(long)); return GRIB_OUT_OF_MEMORY; } - if((ret = grib_get_long_array_internal(grib_handle_of_accessor(a), self->array,ar,&size)) != GRIB_SUCCESS) + if ((ret = grib_get_long_array_internal(grib_handle_of_accessor(a), self->array, ar, &size)) != GRIB_SUCCESS) return ret; - if (self->element>=size) return GRIB_INTERNAL_ERROR; - *val=ar[self->element]; + if (self->element >= size) + return GRIB_INTERNAL_ERROR; + *val = ar[self->element]; - grib_context_free(c,ar); + grib_context_free(c, ar); return ret; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { grib_accessor_element* self = (grib_accessor_element*)a; - int ret = 0; - size_t size=0; - long* ar=NULL; - grib_context* c=a->context; + int ret = 0; + size_t size = 0; + long* ar = NULL; + grib_context* c = a->context; - if(*len < 1){ + if (*len < 1) { ret = GRIB_ARRAY_TOO_SMALL; return ret; } - if((ret = grib_get_size(grib_handle_of_accessor(a), self->array,&size)) != GRIB_SUCCESS) + if ((ret = grib_get_size(grib_handle_of_accessor(a), self->array, &size)) != GRIB_SUCCESS) return ret; - ar=(long*)grib_context_malloc_clear(c,size*sizeof(long)); + ar = (long*)grib_context_malloc_clear(c, size * sizeof(long)); if (!ar) { - grib_context_log(c,GRIB_LOG_ERROR,"unable to allocate %d bytes",size*sizeof(long)); + grib_context_log(c, GRIB_LOG_ERROR, "unable to allocate %d bytes", size * sizeof(long)); return GRIB_OUT_OF_MEMORY; } - if((ret = grib_get_long_array_internal(grib_handle_of_accessor(a), self->array,ar,&size)) != GRIB_SUCCESS) + if ((ret = grib_get_long_array_internal(grib_handle_of_accessor(a), self->array, ar, &size)) != GRIB_SUCCESS) return ret; - ar[self->element]=*val; + ar[self->element] = *val; - if((ret = grib_set_long_array_internal(grib_handle_of_accessor(a), self->array,ar,size)) != GRIB_SUCCESS) + if ((ret = grib_set_long_array_internal(grib_handle_of_accessor(a), self->array, ar, size)) != GRIB_SUCCESS) return ret; - grib_context_free(c,ar); + grib_context_free(c, ar); return ret; } diff --git a/src/grib_accessor_class_evaluate.c b/src/grib_accessor_class_evaluate.c index e10d8e91b..1090c71e8 100644 --- a/src/grib_accessor_class_evaluate.c +++ b/src/grib_accessor_class_evaluate.c @@ -32,62 +32,63 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_evaluate { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in evaluate */ - grib_arguments* arg; +typedef struct grib_accessor_evaluate +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in evaluate */ + grib_arguments* arg; } grib_accessor_evaluate; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_evaluate = { - &grib_accessor_class_long, /* super */ - "evaluate", /* name */ - sizeof(grib_accessor_evaluate), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "evaluate", /* name */ + sizeof(grib_accessor_evaluate), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -96,59 +97,59 @@ grib_accessor_class* grib_accessor_class_evaluate = &_grib_accessor_class_evalua static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_evaluate* self = (grib_accessor_evaluate*)a; - self->arg = c; + self->arg = c; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { return GRIB_NOT_IMPLEMENTED; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - int ret=0; + int ret = 0; grib_accessor_evaluate* self = (grib_accessor_evaluate*)a; - grib_expression* e = grib_arguments_get_expression(grib_handle_of_accessor(a),self->arg,0); + grib_expression* e = grib_arguments_get_expression(grib_handle_of_accessor(a), self->arg, 0); - ret = grib_expression_evaluate_long(grib_handle_of_accessor(a),e,val); + ret = grib_expression_evaluate_long(grib_handle_of_accessor(a), e, val); *len = 1; return ret; diff --git a/src/grib_accessor_class_expanded_descriptors.c b/src/grib_accessor_class_expanded_descriptors.c index c8fa61921..d8eb2ea13 100644 --- a/src/grib_accessor_class_expanded_descriptors.c +++ b/src/grib_accessor_class_expanded_descriptors.c @@ -50,75 +50,76 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void destroy(grib_context*,grib_accessor*); +static int get_native_type(grib_accessor*); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void destroy(grib_context*, grib_accessor*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_expanded_descriptors { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in expanded_descriptors */ - const char* unexpandedDescriptors; - const char* sequence; - const char* expandedName; - const char* tablesAccessorName; - bufr_descriptors_array* expanded; - int rank; - grib_accessor* expandedAccessor; - int do_expand; - grib_accessor* tablesAccessor; +typedef struct grib_accessor_expanded_descriptors +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in expanded_descriptors */ + const char* unexpandedDescriptors; + const char* sequence; + const char* expandedName; + const char* tablesAccessorName; + bufr_descriptors_array* expanded; + int rank; + grib_accessor* expandedAccessor; + int do_expand; + grib_accessor* tablesAccessor; } grib_accessor_expanded_descriptors; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_expanded_descriptors = { - &grib_accessor_class_long, /* super */ - "expanded_descriptors", /* name */ - sizeof(grib_accessor_expanded_descriptors), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "expanded_descriptors", /* name */ + sizeof(grib_accessor_expanded_descriptors), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + &destroy, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -127,32 +128,32 @@ grib_accessor_class* grib_accessor_class_expanded_descriptors = &_grib_accessor_ static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ @@ -161,372 +162,415 @@ static void init_class(grib_accessor_class* c) #define DESC_SIZE_INIT 400 /* Initial size for grib_bufr_descriptors_array_new */ #define DESC_SIZE_INCR 400 /* Increment size for grib_bufr_descriptors_array_new */ -typedef struct change_coding_params { +typedef struct change_coding_params +{ int associatedFieldWidth; int localDescriptorWidth; int extraWidth; int extraScale; int newStringWidth; double referenceFactor; -} change_coding_params ; +} change_coding_params; /* Handy macro to catch errors. * Arguments: array is a pointer to 'bufr_descriptors_array', result is pointer to 'bufr_descriptor' */ -#define DESCRIPTORS_POP_FRONT_OR_RETURN(array,result) {\ - if(array->n == 0) { *err=GRIB_INTERNAL_ERROR; return; } \ - result=grib_bufr_descriptors_array_pop_front(array); \ +#define DESCRIPTORS_POP_FRONT_OR_RETURN(array, result) \ + { \ + if (array->n == 0) { \ + *err = GRIB_INTERNAL_ERROR; \ + return; \ + } \ + result = grib_bufr_descriptors_array_pop_front(array); \ } -static void init(grib_accessor* a, const long len , grib_arguments* args ) +static void init(grib_accessor* a, const long len, grib_arguments* args) { grib_accessor_expanded_descriptors* self = (grib_accessor_expanded_descriptors*)a; - int n=0; - grib_handle* hand=grib_handle_of_accessor(a); - self->tablesAccessorName=grib_arguments_get_name(hand,args,n++); - self->expandedName=grib_arguments_get_name(hand,args,n++); - self->rank=grib_arguments_get_long(hand,args,n++); - if (self->rank!=0) { - self->expandedAccessor=grib_find_accessor(hand,self->expandedName); - } else { - self->expandedAccessor=0; + int n = 0; + grib_handle* hand = grib_handle_of_accessor(a); + self->tablesAccessorName = grib_arguments_get_name(hand, args, n++); + self->expandedName = grib_arguments_get_name(hand, args, n++); + self->rank = grib_arguments_get_long(hand, args, n++); + if (self->rank != 0) { + self->expandedAccessor = grib_find_accessor(hand, self->expandedName); + } + else { + self->expandedAccessor = 0; } - self->unexpandedDescriptors=grib_arguments_get_name(hand,args,n++); - self->sequence=grib_arguments_get_name(hand,args,n++); - self->do_expand=1; - self->expanded=0; - a->length = 0; + self->unexpandedDescriptors = grib_arguments_get_name(hand, args, n++); + self->sequence = grib_arguments_get_name(hand, args, n++); + self->do_expand = 1; + self->expanded = 0; + a->length = 0; } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_long(dumper,a,NULL); + grib_dump_long(dumper, a, NULL); } -static bufr_descriptors_array* do_expand(grib_accessor* a,bufr_descriptors_array* unexpanded,change_coding_params* ccp,int *err); +static bufr_descriptors_array* do_expand(grib_accessor* a, bufr_descriptors_array* unexpanded, change_coding_params* ccp, int* err); #if MYDEBUG -static int global_depth=-1; +static int global_depth = -1; #endif #define BUFR_DESCRIPTORS_ARRAY_USED_SIZE(v) ((v)->n) static void __expand(grib_accessor* a, bufr_descriptors_array* unexpanded, bufr_descriptors_array* expanded, - change_coding_params* ccp, int* err) + change_coding_params* ccp, int* err) { - int k,j,i; + int k, j, i; grib_accessor_expanded_descriptors* self = (grib_accessor_expanded_descriptors*)a; - size_t size=0; - long* v=NULL; - bufr_descriptor* u=NULL; - bufr_descriptor* vv=NULL; - bufr_descriptor** ur=NULL; - bufr_descriptor* urc=NULL; + size_t size = 0; + long* v = NULL; + bufr_descriptor* u = NULL; + bufr_descriptor* vv = NULL; + bufr_descriptor** ur = NULL; + bufr_descriptor* urc = NULL; int idx; - bufr_descriptor* u0=NULL; - grib_context* c=a->context; - bufr_descriptor* us=NULL; - bufr_descriptors_array* inner_expanded=NULL; - bufr_descriptors_array* inner_unexpanded=NULL; - grib_handle* hand = grib_handle_of_accessor(a); + bufr_descriptor* u0 = NULL; + grib_context* c = a->context; + bufr_descriptor* us = NULL; + bufr_descriptors_array* inner_expanded = NULL; + bufr_descriptors_array* inner_unexpanded = NULL; + grib_handle* hand = grib_handle_of_accessor(a); #if MYDEBUG int idepth; #endif - if (BUFR_DESCRIPTORS_ARRAY_USED_SIZE(unexpanded)==0) return; + if (BUFR_DESCRIPTORS_ARRAY_USED_SIZE(unexpanded) == 0) + return; - us=grib_bufr_descriptor_clone(grib_bufr_descriptors_array_get(unexpanded,0)); + us = grib_bufr_descriptor_clone(grib_bufr_descriptors_array_get(unexpanded, 0)); us->context = c; - *err=0; + *err = 0; #if MYDEBUG - for (idepth=0;idepth %d-%02d-%03d\n",us->F,us->X,us->Y); + for (idepth = 0; idepth < global_depth; idepth++) + printf("\t"); + printf("expanding ==> %d-%02d-%03d\n", us->F, us->X, us->Y); #endif switch (us->F) { - case 3: - /* sequence */ - DESCRIPTORS_POP_FRONT_OR_RETURN(unexpanded,u); -#if MYDEBUG - for (idepth=0;idepthcode); -#endif - /*this is to get the sequence elements of the sequence unexpanded[i] */ - *err=grib_set_long(hand,self->sequence,u->code); - *err=grib_get_size(hand,self->sequence,&size); - grib_bufr_descriptor_delete(u); - if (*err) return; - v=(long*)grib_context_malloc_clear(c,sizeof(long)*size); - *err=grib_get_long_array(hand,self->sequence,v,&size); - if (*err) return; - - inner_unexpanded=grib_bufr_descriptors_array_new(c,DESC_SIZE_INIT,DESC_SIZE_INCR); - for (i=0;itablesAccessor,v[i],err); - inner_unexpanded=grib_bufr_descriptors_array_push(inner_unexpanded,vv); - } - grib_context_free(c,v); - inner_expanded=do_expand(a,inner_unexpanded,ccp,err); - if (*err) return; - grib_bufr_descriptors_array_delete(inner_unexpanded); + case 3: + /* sequence */ + DESCRIPTORS_POP_FRONT_OR_RETURN(unexpanded, u); #if MYDEBUG - for (i=0;in;i++) { - for (idepth=0;idepthv[i]->code); - } -#endif - size=BUFR_DESCRIPTORS_ARRAY_USED_SIZE(inner_expanded); - expanded=grib_bufr_descriptors_array_append(expanded,inner_expanded); - break; - - case 1: - if (us->Y==0) { - /* delayed replication */ - bufr_descriptor* uidx=0; - DESCRIPTORS_POP_FRONT_OR_RETURN(unexpanded,u); -#if MYDEBUG - for (idepth=0;idepthcode); - for (idepth=0;idepthcode); + for (idepth = 0; idepth < global_depth; idepth++) + printf("\t"); + printf("+++ pop %06ld\n", u->code); #endif - grib_bufr_descriptors_array_push(expanded,u); - idx=expanded->n-1; - size=0; - inner_unexpanded=grib_bufr_descriptors_array_new(c,DESC_SIZE_INIT,DESC_SIZE_INCR); - - /* Number of descriptors to replicate cannot be more than what's left */ - if (us->X+1 > unexpanded->n) { - grib_context_log(c, GRIB_LOG_ERROR, - "Delayed replication: %06ld: expected %d but only found %lu elements", - u->code, us->X, unexpanded->n - 1); - *err = GRIB_DECODING_ERROR; + /*this is to get the sequence elements of the sequence unexpanded[i] */ + *err = grib_set_long(hand, self->sequence, u->code); + *err = grib_get_size(hand, self->sequence, &size); + grib_bufr_descriptor_delete(u); + if (*err) return; + v = (long*)grib_context_malloc_clear(c, sizeof(long) * size); + *err = grib_get_long_array(hand, self->sequence, v, &size); + if (*err) + return; + + inner_unexpanded = grib_bufr_descriptors_array_new(c, DESC_SIZE_INIT, DESC_SIZE_INCR); + for (i = 0; i < size; i++) { + vv = grib_bufr_descriptor_new(self->tablesAccessor, v[i], err); + inner_unexpanded = grib_bufr_descriptors_array_push(inner_unexpanded, vv); } - for (j=0;jX+1;j++) { - DESCRIPTORS_POP_FRONT_OR_RETURN(unexpanded, u0); - grib_bufr_descriptors_array_push(inner_unexpanded,u0); -#if MYDEBUG - for (idepth=0;idepthcode); -#endif - } - inner_expanded=do_expand(a,inner_unexpanded,ccp,err); - if (*err) return; + grib_context_free(c, v); + inner_expanded = do_expand(a, inner_unexpanded, ccp, err); + if (*err) + return; grib_bufr_descriptors_array_delete(inner_unexpanded); - size=BUFR_DESCRIPTORS_ARRAY_USED_SIZE(inner_expanded); #if MYDEBUG - for (i=0;in;i++) { - for (idepth=0;idepthv[i]->code); + for (i = 0; i < inner_expanded->n; i++) { + for (idepth = 0; idepth < global_depth; idepth++) + printf("\t"); + printf("+++ push %06ld\n", inner_expanded->v[i]->code); } #endif - expanded=grib_bufr_descriptors_array_append(expanded,inner_expanded); - uidx=grib_bufr_descriptors_array_get(expanded,idx); - grib_bufr_descriptor_set_code(0,(size-1)*1000+100000,uidx); - size++; - } else { - DESCRIPTORS_POP_FRONT_OR_RETURN(unexpanded,u); + size = BUFR_DESCRIPTORS_ARRAY_USED_SIZE(inner_expanded); + expanded = grib_bufr_descriptors_array_append(expanded, inner_expanded); + break; + + case 1: + if (us->Y == 0) { + /* delayed replication */ + bufr_descriptor* uidx = 0; + DESCRIPTORS_POP_FRONT_OR_RETURN(unexpanded, u); #if MYDEBUG - for (idepth=0;idepthcode); + for (idepth = 0; idepth < global_depth; idepth++) + printf("\t"); + printf("+++ pop %06ld\n", u->code); + for (idepth = 0; idepth < global_depth; idepth++) + printf("\t"); + printf("+++ push %06ld\n", u->code); #endif - grib_bufr_descriptor_delete(u); - size=us->X*us->Y; - ur=(bufr_descriptor**)grib_context_malloc_clear(c,us->X*sizeof(bufr_descriptor*)); - for (j=0;jX;j++) { - DESCRIPTORS_POP_FRONT_OR_RETURN(unexpanded,ur[j]); + grib_bufr_descriptors_array_push(expanded, u); + idx = expanded->n - 1; + size = 0; + inner_unexpanded = grib_bufr_descriptors_array_new(c, DESC_SIZE_INIT, DESC_SIZE_INCR); + + /* Number of descriptors to replicate cannot be more than what's left */ + if (us->X + 1 > unexpanded->n) { + grib_context_log(c, GRIB_LOG_ERROR, + "Delayed replication: %06ld: expected %d but only found %lu elements", + u->code, us->X, unexpanded->n - 1); + *err = GRIB_DECODING_ERROR; + return; + } + for (j = 0; j < us->X + 1; j++) { + DESCRIPTORS_POP_FRONT_OR_RETURN(unexpanded, u0); + grib_bufr_descriptors_array_push(inner_unexpanded, u0); #if MYDEBUG - for (idepth=0;idepthcode); + for (idepth = 0; idepth < global_depth; idepth++) + printf("\t"); + printf("+++ pop %06ld\n", u0->code); #endif - } - inner_unexpanded=grib_bufr_descriptors_array_new(c,DESC_SIZE_INIT,DESC_SIZE_INCR); - for (j=0;jX;j++) { - urc=grib_bufr_descriptor_clone(ur[j]); - grib_bufr_descriptors_array_push(inner_unexpanded,urc); - } - for (k=1;kY;k++) { - for (j=0;jX;j++) { - urc=grib_bufr_descriptor_clone(ur[j]); - grib_bufr_descriptors_array_push(inner_unexpanded,urc); } - } - for (i=0;iX;i++) grib_bufr_descriptor_delete(ur[i]); - grib_context_free(c,ur); - inner_expanded=do_expand(a,inner_unexpanded,ccp,err); - if (*err) return; - grib_bufr_descriptors_array_delete(inner_unexpanded); + inner_expanded = do_expand(a, inner_unexpanded, ccp, err); + if (*err) + return; + grib_bufr_descriptors_array_delete(inner_unexpanded); + size = BUFR_DESCRIPTORS_ARRAY_USED_SIZE(inner_expanded); #if MYDEBUG - for (i=0;in;i++) { - for (idepth=0;idepthv[i]->code); + for (i = 0; i < inner_expanded->n; i++) { + for (idepth = 0; idepth < global_depth; idepth++) + printf("\t"); + printf("+++ push %06ld\n", inner_expanded->v[i]->code); + } +#endif + expanded = grib_bufr_descriptors_array_append(expanded, inner_expanded); + uidx = grib_bufr_descriptors_array_get(expanded, idx); + grib_bufr_descriptor_set_code(0, (size - 1) * 1000 + 100000, uidx); + size++; } + else { + DESCRIPTORS_POP_FRONT_OR_RETURN(unexpanded, u); +#if MYDEBUG + for (idepth = 0; idepth < global_depth; idepth++) + printf("\t"); + printf("+++ pop %06ld\n", u->code); #endif - size=BUFR_DESCRIPTORS_ARRAY_USED_SIZE(inner_expanded); - expanded=grib_bufr_descriptors_array_append(expanded,inner_expanded); - } - break; - - case 0: - DESCRIPTORS_POP_FRONT_OR_RETURN(unexpanded,u); - size=1; - if (ccp->associatedFieldWidth && u->X!=31) { - bufr_descriptor* au=grib_bufr_descriptor_new(self->tablesAccessor,999999,err); - au->width=ccp->associatedFieldWidth; - grib_bufr_descriptor_set_scale(au,0); - au->shortName=grib_context_strdup(c,"associatedField"); - /* au->name=grib_context_strdup(c,"associated field"); See ECC-489 */ - au->units=grib_context_strdup(c,"associated units"); + grib_bufr_descriptor_delete(u); + size = us->X * us->Y; + ur = (bufr_descriptor**)grib_context_malloc_clear(c, us->X * sizeof(bufr_descriptor*)); + for (j = 0; j < us->X; j++) { + DESCRIPTORS_POP_FRONT_OR_RETURN(unexpanded, ur[j]); #if MYDEBUG - for (idepth=0;idepthcode,au->scale,au->reference,au->width); + for (idepth = 0; idepth < global_depth; idepth++) + printf("\t"); + printf("+++ pop %06ld\n", ur[j]->code); #endif - grib_bufr_descriptors_array_push(expanded,au); - size++; - } + } + inner_unexpanded = grib_bufr_descriptors_array_new(c, DESC_SIZE_INIT, DESC_SIZE_INCR); + for (j = 0; j < us->X; j++) { + urc = grib_bufr_descriptor_clone(ur[j]); + grib_bufr_descriptors_array_push(inner_unexpanded, urc); + } + for (k = 1; k < us->Y; k++) { + for (j = 0; j < us->X; j++) { + urc = grib_bufr_descriptor_clone(ur[j]); + grib_bufr_descriptors_array_push(inner_unexpanded, urc); + } + } + for (i = 0; i < us->X; i++) + grib_bufr_descriptor_delete(ur[i]); + grib_context_free(c, ur); + inner_expanded = do_expand(a, inner_unexpanded, ccp, err); + if (*err) + return; + grib_bufr_descriptors_array_delete(inner_unexpanded); #if MYDEBUG - for (idepth=0;idepthcode); - for (idepth=0;idepthcode, - u->type,u->scale,u->reference,u->width); + for (i = 0; i < inner_expanded->n; i++) { + for (idepth = 0; idepth < global_depth; idepth++) + printf("\t"); + printf("+++ push %06ld\n", inner_expanded->v[i]->code); + } #endif - if ( u->type!=BUFR_DESCRIPTOR_TYPE_FLAG && - u->type!=BUFR_DESCRIPTOR_TYPE_TABLE && - u->type!=BUFR_DESCRIPTOR_TYPE_STRING ) { - if (ccp->localDescriptorWidth>0) { - u->width=ccp->localDescriptorWidth; - u->reference=0; - grib_bufr_descriptor_set_scale(u,0); - ccp->localDescriptorWidth=0; - } else { - u->width += ccp->extraWidth; - u->reference *= ccp->referenceFactor; - grib_bufr_descriptor_set_scale(u,u->scale+ccp->extraScale); + size = BUFR_DESCRIPTORS_ARRAY_USED_SIZE(inner_expanded); + expanded = grib_bufr_descriptors_array_append(expanded, inner_expanded); } - } else if (u->type==BUFR_DESCRIPTOR_TYPE_STRING && ccp->newStringWidth!=0) { - u->width=ccp->newStringWidth; - } + break; + + case 0: + DESCRIPTORS_POP_FRONT_OR_RETURN(unexpanded, u); + size = 1; + if (ccp->associatedFieldWidth && u->X != 31) { + bufr_descriptor* au = grib_bufr_descriptor_new(self->tablesAccessor, 999999, err); + au->width = ccp->associatedFieldWidth; + grib_bufr_descriptor_set_scale(au, 0); + au->shortName = grib_context_strdup(c, "associatedField"); + /* au->name=grib_context_strdup(c,"associated field"); See ECC-489 */ + au->units = grib_context_strdup(c, "associated units"); #if MYDEBUG - printf("->(%ld %ld %ld)\n",u->scale,u->reference,u->width); + for (idepth = 0; idepth < global_depth; idepth++) + printf("\t"); + printf("+++ push %06ld (%ld %ld %ld)", au->code, au->scale, au->reference, au->width); #endif - grib_bufr_descriptors_array_push(expanded,u); - break; - - case 2: - DESCRIPTORS_POP_FRONT_OR_RETURN(unexpanded,u); + grib_bufr_descriptors_array_push(expanded, au); + size++; + } #if MYDEBUG - for (idepth=0;idepthcode); + for (idepth = 0; idepth < global_depth; idepth++) + printf("\t"); + printf("+++ pop %06ld\n", u->code); + for (idepth = 0; idepth < global_depth; idepth++) + printf("\t"); + printf("+++ push %06ld [type=%d] (%ld %ld %ld)", u->code, + u->type, u->scale, u->reference, u->width); #endif - switch(us->X) { - case 1: - ccp->extraWidth = us->Y ? us->Y-128 : 0; - size=0; - grib_bufr_descriptor_delete(u); - break; - case 2: - ccp->extraScale = us->Y ? us->Y-128 : 0; - size=0; - grib_bufr_descriptor_delete(u); - break; - case 4: - /* associated field*/ - ccp->associatedFieldWidth=us->Y; - grib_bufr_descriptor_delete(u); - break; - case 6: - /*signify data width*/ - ccp->localDescriptorWidth=us->Y; - size=0; - grib_bufr_descriptor_delete(u); - break; - case 7: - if (us->Y) { - ccp->extraScale = us->Y; - ccp->referenceFactor=grib_power(us->Y,10); - ccp->extraWidth=((10*us->Y)+2)/3; - } else { - ccp->extraWidth=0; - ccp->extraScale=0; - ccp->referenceFactor=1; + if (u->type != BUFR_DESCRIPTOR_TYPE_FLAG && + u->type != BUFR_DESCRIPTOR_TYPE_TABLE && + u->type != BUFR_DESCRIPTOR_TYPE_STRING) { + if (ccp->localDescriptorWidth > 0) { + u->width = ccp->localDescriptorWidth; + u->reference = 0; + grib_bufr_descriptor_set_scale(u, 0); + ccp->localDescriptorWidth = 0; + } + else { + u->width += ccp->extraWidth; + u->reference *= ccp->referenceFactor; + grib_bufr_descriptor_set_scale(u, u->scale + ccp->extraScale); + } } - size=0; - grib_bufr_descriptor_delete(u); - break; - case 8: - ccp->newStringWidth = us->Y * 8 ; + else if (u->type == BUFR_DESCRIPTOR_TYPE_STRING && ccp->newStringWidth != 0) { + u->width = ccp->newStringWidth; + } +#if MYDEBUG + printf("->(%ld %ld %ld)\n", u->scale, u->reference, u->width); +#endif + grib_bufr_descriptors_array_push(expanded, u); break; - default: + + case 2: + DESCRIPTORS_POP_FRONT_OR_RETURN(unexpanded, u); #if MYDEBUG - for (idepth=0;idepthcode); + for (idepth = 0; idepth < global_depth; idepth++) + printf("\t"); + printf("+++ pop %06ld\n", u->code); #endif - grib_bufr_descriptors_array_push(expanded,u); - size=1; - } - break; + switch (us->X) { + case 1: + ccp->extraWidth = us->Y ? us->Y - 128 : 0; + size = 0; + grib_bufr_descriptor_delete(u); + break; + case 2: + ccp->extraScale = us->Y ? us->Y - 128 : 0; + size = 0; + grib_bufr_descriptor_delete(u); + break; + case 4: + /* associated field*/ + ccp->associatedFieldWidth = us->Y; + grib_bufr_descriptor_delete(u); + break; + case 6: + /*signify data width*/ + ccp->localDescriptorWidth = us->Y; + size = 0; + grib_bufr_descriptor_delete(u); + break; + case 7: + if (us->Y) { + ccp->extraScale = us->Y; + ccp->referenceFactor = grib_power(us->Y, 10); + ccp->extraWidth = ((10 * us->Y) + 2) / 3; + } + else { + ccp->extraWidth = 0; + ccp->extraScale = 0; + ccp->referenceFactor = 1; + } + size = 0; + grib_bufr_descriptor_delete(u); + break; + case 8: + ccp->newStringWidth = us->Y * 8; + break; + default: +#if MYDEBUG + for (idepth = 0; idepth < global_depth; idepth++) + printf("\t"); + printf("+++ push %06ld\n", u->code); +#endif + grib_bufr_descriptors_array_push(expanded, u); + size = 1; + } + break; default: - DESCRIPTORS_POP_FRONT_OR_RETURN(unexpanded,u); + DESCRIPTORS_POP_FRONT_OR_RETURN(unexpanded, u); #if MYDEBUG - for (idepth=0;idepthcode); - for (idepth=0;idepthcode); + for (idepth = 0; idepth < global_depth; idepth++) + printf("\t"); + printf("+++ pop %06ld\n", u->code); + for (idepth = 0; idepth < global_depth; idepth++) + printf("\t"); + printf("+++ push %06ld\n", u->code); #endif - grib_bufr_descriptors_array_push(expanded,u); - size=1; + grib_bufr_descriptors_array_push(expanded, u); + size = 1; } #if MYDEBUG - for (idepth=0;idepthF,us->X,us->Y,size); + for (idepth = 0; idepth < global_depth; idepth++) + printf("\t"); + printf("expanding <== %d-%.2d-%.3d (size=%ld)\n\n", us->F, us->X, us->Y, size); #endif - if (us) grib_bufr_descriptor_delete(us); + if (us) + grib_bufr_descriptor_delete(us); } -static bufr_descriptors_array* do_expand(grib_accessor* a,bufr_descriptors_array* unexpanded,change_coding_params* ccp,int *err) +static bufr_descriptors_array* do_expand(grib_accessor* a, bufr_descriptors_array* unexpanded, change_coding_params* ccp, int* err) { - bufr_descriptors_array* expanded=NULL; - grib_context* c=a->context; + bufr_descriptors_array* expanded = NULL; + grib_context* c = a->context; #if MYDEBUG int idepth; global_depth++; #endif - expanded=grib_bufr_descriptors_array_new(c,DESC_SIZE_INIT,DESC_SIZE_INCR); + expanded = grib_bufr_descriptors_array_new(c, DESC_SIZE_INIT, DESC_SIZE_INCR); #if MYDEBUG { int i; - for (idepth=0;idepth \n"); - for (i=0;in;i++) { - bufr_descriptor* xx=grib_bufr_descriptors_array_get(unexpanded,i); - for (idepth=0;idepthcode); + for (i = 0; i < unexpanded->n; i++) { + bufr_descriptor* xx = grib_bufr_descriptors_array_get(unexpanded, i); + for (idepth = 0; idepth < global_depth; idepth++) + printf("\t"); + printf("%06ld\n", xx->code); } - for (idepth=0;idepthn) { - __expand(a,unexpanded,expanded,ccp,err); - if (*err) return NULL; + __expand(a, unexpanded, expanded, ccp, err); + if (*err) + return NULL; } #if MYDEBUG { int i; - for (idepth=0;idepth \n"); - for (i=0;in;i++) { - bufr_descriptor* xx=grib_bufr_descriptors_array_get(expanded,i); - for (idepth=0;idepthcode); - printf("%ld %ld %ld",xx->scale,xx->reference,xx->width); + for (i = 0; i < expanded->n; i++) { + bufr_descriptor* xx = grib_bufr_descriptors_array_get(expanded, i); + for (idepth = 0; idepth < global_depth; idepth++) + printf("\t"); + printf("== %-6d== %06ld ", i, xx->code); + printf("%ld %ld %ld", xx->scale, xx->reference, xx->width); printf("\n"); } - for (idepth=0;idepthcontext; - grib_handle* h=grib_handle_of_accessor(a); - int operator206yyy_width = 0; /* width specified by operator 206YYY */ + bufr_descriptors_array* unexpanded = NULL; + bufr_descriptors_array* unexpanded_copy = NULL; + bufr_descriptors_array* expanded = NULL; + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); + int operator206yyy_width = 0; /* width specified by operator 206YYY */ if (!self->do_expand) { return err; } - self->do_expand=0; - if (self->rank!=0) { - err=expand(self->expandedAccessor); - self->expanded=((grib_accessor_expanded_descriptors*)self->expandedAccessor)->expanded; + self->do_expand = 0; + if (self->rank != 0) { + err = expand(self->expandedAccessor); + self->expanded = ((grib_accessor_expanded_descriptors*)self->expandedAccessor)->expanded; return err; } - err=grib_get_size(h,self->unexpandedDescriptors,&unexpandedSize); - if (err) return err; - if (unexpandedSize==0) { + err = grib_get_size(h, self->unexpandedDescriptors, &unexpandedSize); + if (err) + return err; + if (unexpandedSize == 0) { grib_context_log(c, GRIB_LOG_ERROR, "%s: Unexpanded size is zero!", a->name); return GRIB_DECODING_ERROR; } - u=(long*)grib_context_malloc_clear(c,sizeof(long)*unexpandedSize); - if (!u) {err=GRIB_OUT_OF_MEMORY; return err;} - err=grib_get_long_array(h,self->unexpandedDescriptors,u,&unexpandedSize); - if (err) return err; - - err=grib_get_long(h,"bufrHeaderCentre",¢re); - if (err) return err; - err=grib_get_long(h,"masterTablesVersionNumber",&masterTablesVersionNumber); - if (err) return err; - err=grib_get_long(h,"localTablesVersionNumber",&localTablesVersionNumber); - if (err) return err; - err=grib_get_long(h,"masterTableNumber",&masterTablesNumber); - if (err) return err; - - sprintf(key,"%ld_%ld_%ld_%ld_%ld",centre,masterTablesVersionNumber,localTablesVersionNumber,masterTablesNumber,u[0]); - expanded=grib_context_expanded_descriptors_list_get(c,key,u,unexpandedSize); + u = (long*)grib_context_malloc_clear(c, sizeof(long) * unexpandedSize); + if (!u) { + err = GRIB_OUT_OF_MEMORY; + return err; + } + err = grib_get_long_array(h, self->unexpandedDescriptors, u, &unexpandedSize); + if (err) + return err; + + err = grib_get_long(h, "bufrHeaderCentre", ¢re); + if (err) + return err; + err = grib_get_long(h, "masterTablesVersionNumber", &masterTablesVersionNumber); + if (err) + return err; + err = grib_get_long(h, "localTablesVersionNumber", &localTablesVersionNumber); + if (err) + return err; + err = grib_get_long(h, "masterTableNumber", &masterTablesNumber); + if (err) + return err; + + sprintf(key, "%ld_%ld_%ld_%ld_%ld", centre, masterTablesVersionNumber, localTablesVersionNumber, masterTablesNumber, u[0]); + expanded = grib_context_expanded_descriptors_list_get(c, key, u, unexpandedSize); if (expanded) { - self->expanded=expanded; - grib_context_free(c,u); - return err; + self->expanded = expanded; + grib_context_free(c, u); + return err; } if (!self->tablesAccessor) { - self->tablesAccessor=grib_find_accessor(h,self->tablesAccessorName); + self->tablesAccessor = grib_find_accessor(h, self->tablesAccessorName); Assert(self->tablesAccessor); } - unexpanded=grib_bufr_descriptors_array_new(c,unexpandedSize,DESC_SIZE_INCR); - unexpanded_copy=grib_bufr_descriptors_array_new(c,unexpandedSize,DESC_SIZE_INCR); + unexpanded = grib_bufr_descriptors_array_new(c, unexpandedSize, DESC_SIZE_INCR); + unexpanded_copy = grib_bufr_descriptors_array_new(c, unexpandedSize, DESC_SIZE_INCR); operator206yyy_width = 0; - for (i=0;itablesAccessor, u[i], &err); bufr_descriptor* aDescriptor2 = grib_bufr_descriptor_new(self->tablesAccessor, u[i], &err); @@ -612,157 +665,169 @@ static int expand(grib_accessor* a) operator206yyy_width = aDescriptor1->Y; /* Store the width for the following descriptor */ DebugAssert(operator206yyy_width > 0); } - else if (operator206yyy_width>0) { + else if (operator206yyy_width > 0) { if (err == GRIB_NOT_FOUND) { - DebugAssert( aDescriptor1->type == BUFR_DESCRIPTOR_TYPE_UNKNOWN ); - err = 0; /* Clear any error generated due to local descriptor */ - aDescriptor1->nokey = aDescriptor2->nokey = 1; /* Do not show this descriptor in dump */ + DebugAssert(aDescriptor1->type == BUFR_DESCRIPTOR_TYPE_UNKNOWN); + err = 0; /* Clear any error generated due to local descriptor */ + aDescriptor1->nokey = aDescriptor2->nokey = 1; /* Do not show this descriptor in dump */ } /* The width specified by operator takes precedence over element's own width */ aDescriptor1->width = aDescriptor2->width = operator206yyy_width; - operator206yyy_width = 0; /* Restore. Operator no longer in scope */ + operator206yyy_width = 0; /* Restore. Operator no longer in scope */ } - grib_bufr_descriptors_array_push(unexpanded, aDescriptor1); + grib_bufr_descriptors_array_push(unexpanded, aDescriptor1); grib_bufr_descriptors_array_push(unexpanded_copy, aDescriptor2); } - grib_context_free(c,u); - - ccp.extraWidth=0; - ccp.localDescriptorWidth=-1; - ccp.extraScale=0; - ccp.referenceFactor=1; - ccp.associatedFieldWidth=0; - ccp.newStringWidth=0; - self->expanded=do_expand(a,unexpanded,&ccp,&err); - if (err) return err; - grib_context_expanded_descriptors_list_push(c,key,self->expanded,unexpanded_copy); + grib_context_free(c, u); + + ccp.extraWidth = 0; + ccp.localDescriptorWidth = -1; + ccp.extraScale = 0; + ccp.referenceFactor = 1; + ccp.associatedFieldWidth = 0; + ccp.newStringWidth = 0; + self->expanded = do_expand(a, unexpanded, &ccp, &err); + if (err) + return err; + grib_context_expanded_descriptors_list_push(c, key, self->expanded, unexpanded_copy); grib_bufr_descriptors_array_delete(unexpanded); return err; } -int grib_accessor_class_expanded_descriptors_set_do_expand(grib_accessor* a,long do_expand) +int grib_accessor_class_expanded_descriptors_set_do_expand(grib_accessor* a, long do_expand) { grib_accessor_expanded_descriptors* self = (grib_accessor_expanded_descriptors*)a; - self->do_expand=do_expand; + self->do_expand = do_expand; return 0; } -bufr_descriptors_array* grib_accessor_class_expanded_descriptors_get_expanded(grib_accessor* a,int* err) +bufr_descriptors_array* grib_accessor_class_expanded_descriptors_get_expanded(grib_accessor* a, int* err) { grib_accessor_expanded_descriptors* self = (grib_accessor_expanded_descriptors*)a; - *err=expand(a); + *err = expand(a); return self->expanded; } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { grib_accessor_expanded_descriptors* self = (grib_accessor_expanded_descriptors*)a; - int ret=0; + int ret = 0; int i; size_t expandedSize; - if (self->rank!=2) { - long* lval=(long*)grib_context_malloc_clear(a->context,*len*sizeof(long)); - ret=unpack_long(a,lval,len); - if (ret) return ret; - for (i=0;i<*len;i++) val[i]=(double)lval[i]; - grib_context_free(a->context,lval); - } else { - ret=expand(a); - if (ret) return ret; - - expandedSize=BUFR_DESCRIPTORS_ARRAY_USED_SIZE(self->expanded); - if(*len < expandedSize) - { + if (self->rank != 2) { + long* lval = (long*)grib_context_malloc_clear(a->context, *len * sizeof(long)); + ret = unpack_long(a, lval, len); + if (ret) + return ret; + for (i = 0; i < *len; i++) + val[i] = (double)lval[i]; + grib_context_free(a->context, lval); + } + else { + ret = expand(a); + if (ret) + return ret; + + expandedSize = BUFR_DESCRIPTORS_ARRAY_USED_SIZE(self->expanded); + if (*len < expandedSize) { grib_context_log(a->context, GRIB_LOG_ERROR, - " wrong size (%ld) for %s it contains %d values ",*len, a->name , expandedSize); + " wrong size (%ld) for %s it contains %d values ", *len, a->name, expandedSize); *len = 0; return GRIB_ARRAY_TOO_SMALL; } *len = expandedSize; - for (i=0;i<*len;i++) val[i]=self->expanded->v[i]->reference; + for (i = 0; i < *len; i++) + val[i] = self->expanded->v[i]->reference; } return ret; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_expanded_descriptors* self = (grib_accessor_expanded_descriptors*)a; - int ret=0; - size_t rlen=0; + int ret = 0; + size_t rlen = 0; size_t i; - ret=expand(a); - if (ret) return ret; - if (!self->expanded) return GRIB_DECODING_ERROR; - rlen=BUFR_DESCRIPTORS_ARRAY_USED_SIZE(self->expanded); + ret = expand(a); + if (ret) + return ret; + if (!self->expanded) + return GRIB_DECODING_ERROR; + rlen = BUFR_DESCRIPTORS_ARRAY_USED_SIZE(self->expanded); - if(*len < rlen) - { + if (*len < rlen) { grib_context_log(a->context, GRIB_LOG_ERROR, - " wrong size (%ld) for %s it contains %d values ",*len, a->name , rlen); + " wrong size (%ld) for %s it contains %d values ", *len, a->name, rlen); *len = 0; return GRIB_ARRAY_TOO_SMALL; } *len = rlen; switch (self->rank) { - case 0: - for (i=0;i<*len;i++) val[i]=self->expanded->v[i]->code; - break; - case 1: - for (i=0;i<*len;i++) val[i]=self->expanded->v[i]->scale; - break; - case 2: - return GRIB_INVALID_TYPE; - break; - case 3: - for (i=0;i<*len;i++) val[i]=self->expanded->v[i]->width; - break; - case 4: - for (i=0;i<*len;i++) val[i]=self->expanded->v[i]->type; - break; + case 0: + for (i = 0; i < *len; i++) + val[i] = self->expanded->v[i]->code; + break; + case 1: + for (i = 0; i < *len; i++) + val[i] = self->expanded->v[i]->scale; + break; + case 2: + return GRIB_INVALID_TYPE; + break; + case 3: + for (i = 0; i < *len; i++) + val[i] = self->expanded->v[i]->width; + break; + case 4: + for (i = 0; i < *len; i++) + val[i] = self->expanded->v[i]->type; + break; } return GRIB_SUCCESS; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { grib_accessor_expanded_descriptors* self = (grib_accessor_expanded_descriptors*)a; - self->do_expand=1; + self->do_expand = 1; return GRIB_NOT_IMPLEMENTED; } -static int value_count(grib_accessor* a,long* rlen) +static int value_count(grib_accessor* a, long* rlen) { grib_accessor_expanded_descriptors* self = (grib_accessor_expanded_descriptors*)a; - int err=0; - *rlen=0; + int err = 0; + *rlen = 0; - err=expand(a); + err = expand(a); if (err) { - grib_context_log(a->context,GRIB_LOG_ERROR,"%s unable to compute size",a->name); + grib_context_log(a->context, GRIB_LOG_ERROR, "%s unable to compute size", a->name); return err; } - *rlen=BUFR_DESCRIPTORS_ARRAY_USED_SIZE(self->expanded); + *rlen = BUFR_DESCRIPTORS_ARRAY_USED_SIZE(self->expanded); return err; } -static void destroy(grib_context* c,grib_accessor* a) +static void destroy(grib_context* c, grib_accessor* a) { /* grib_accessor_expanded_descriptors* self = (grib_accessor_expanded_descriptors*)a; */ /* if (self->rank==0 && self->expanded) { */ - /* grib_bufr_descriptors_array_delete(self->expanded); */ + /* grib_bufr_descriptors_array_delete(self->expanded); */ /* } */ } -static int get_native_type(grib_accessor* a) +static int get_native_type(grib_accessor* a) { grib_accessor_expanded_descriptors* self = (grib_accessor_expanded_descriptors*)a; - if (self->rank==2) return GRIB_TYPE_DOUBLE; - else return GRIB_TYPE_LONG; + if (self->rank == 2) + return GRIB_TYPE_DOUBLE; + else + return GRIB_TYPE_LONG; } diff --git a/src/grib_accessor_class_forward.c b/src/grib_accessor_class_forward.c index c79995a50..2cb482a29 100644 --- a/src/grib_accessor_class_forward.c +++ b/src/grib_accessor_class_forward.c @@ -34,55 +34,56 @@ or edit "accessor.class" and rerun ./make_class.pl static void dump(grib_accessor*, grib_dumper*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_forward { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in forward */ +typedef struct grib_accessor_forward +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in forward */ } grib_accessor_forward; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_forward = { - &grib_accessor_class_gen, /* super */ - "forward", /* name */ - sizeof(grib_accessor_forward), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "forward", /* name */ + sizeof(grib_accessor_forward), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -91,37 +92,37 @@ grib_accessor_class* grib_accessor_class_forward = &_grib_accessor_class_forward static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ @@ -129,7 +130,6 @@ static void init_class(grib_accessor_class* c) static void dump(grib_accessor* a, grib_dumper* dumper) { - #if 0 /* grib_accessor_forward* self = (grib_accessor_forward*)a; */ grib_accessor *target = grib_find_accessor(grib_handle_of_accessor(a),a->alias); @@ -142,4 +142,3 @@ static void dump(grib_accessor* a, grib_dumper* dumper) else grib_dump_label(dumper,a," undefined "); #endif } - diff --git a/src/grib_accessor_class_from_scale_factor_scaled_value.c b/src/grib_accessor_class_from_scale_factor_scaled_value.c index 0dd144775..c658a3539 100644 --- a/src/grib_accessor_class_from_scale_factor_scaled_value.c +++ b/src/grib_accessor_class_from_scale_factor_scaled_value.c @@ -41,63 +41,64 @@ or edit "accessor.class" and rerun ./make_class.pl */ static int is_missing(grib_accessor*); -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_from_scale_factor_scaled_value { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in double */ -/* Members defined in from_scale_factor_scaled_value */ - const char* scaleFactor; - const char* scaledValue; +typedef struct grib_accessor_from_scale_factor_scaled_value +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in double */ + /* Members defined in from_scale_factor_scaled_value */ + const char* scaleFactor; + const char* scaledValue; } grib_accessor_from_scale_factor_scaled_value; extern grib_accessor_class* grib_accessor_class_double; static grib_accessor_class _grib_accessor_class_from_scale_factor_scaled_value = { - &grib_accessor_class_double, /* super */ - "from_scale_factor_scaled_value", /* name */ - sizeof(grib_accessor_from_scale_factor_scaled_value), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - &is_missing, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_double, /* super */ + "from_scale_factor_scaled_value", /* name */ + sizeof(grib_accessor_from_scale_factor_scaled_value), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + &is_missing, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -106,35 +107,35 @@ grib_accessor_class* grib_accessor_class_from_scale_factor_scaled_value = &_grib static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ @@ -142,8 +143,8 @@ static void init_class(grib_accessor_class* c) static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_from_scale_factor_scaled_value* self = (grib_accessor_from_scale_factor_scaled_value*)a; - int n = 0; - grib_handle* hand = grib_handle_of_accessor(a); + int n = 0; + grib_handle* hand = grib_handle_of_accessor(a); self->scaleFactor = grib_arguments_get_name(hand, c, n++); self->scaledValue = grib_arguments_get_name(hand, c, n++); @@ -162,7 +163,8 @@ static float float_epsilon(void) static int is_approximately_equal(double a, double b, double epsilon) { - if (a == b) return 1; + if (a == b) + return 1; if (fabs(a - b) <= epsilon) return 1; return 0; @@ -173,23 +175,25 @@ static double eval_value_factor(int64_t value, int64_t factor) return (double)value * pow(10.0, -factor); } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { /* See ECC-979 */ /* Evaluate self->scaleFactor and self->scaledValue from input double '*val' */ grib_accessor_from_scale_factor_scaled_value* self = (grib_accessor_from_scale_factor_scaled_value*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int ret = 0; - int64_t factor=0, prev_factor=0; - int64_t value=0, prev_value=0; - double exact = *val; /*the input*/ + grib_handle* hand = grib_handle_of_accessor(a); + int ret = 0; + int64_t factor = 0, prev_factor = 0; + int64_t value = 0, prev_value = 0; + double exact = *val; /*the input*/ const float epsilon = float_epsilon(); unsigned long maxval_value, maxval_factor; /*maximum allowable values*/ grib_accessor *accessor_factor, *accessor_value; if (exact == 0) { - if ((ret = grib_set_long_internal(hand, self->scaleFactor, 0)) != GRIB_SUCCESS) return ret; - if ((ret = grib_set_long_internal(hand, self->scaledValue, 0)) != GRIB_SUCCESS) return ret; + if ((ret = grib_set_long_internal(hand, self->scaleFactor, 0)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_set_long_internal(hand, self->scaledValue, 0)) != GRIB_SUCCESS) + return ret; return GRIB_SUCCESS; } @@ -199,64 +203,72 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) grib_context_log(a->context, GRIB_LOG_ERROR, "Could not access keys %s and %s", self->scaleFactor, self->scaledValue); return GRIB_ENCODING_ERROR; } - maxval_value = (1UL << (accessor_value->length*8))-2; /* exclude missing */ - maxval_factor = (1UL << (accessor_factor->length*8))-2; /* exclude missing */ + maxval_value = (1UL << (accessor_value->length * 8)) - 2; /* exclude missing */ + maxval_factor = (1UL << (accessor_factor->length * 8)) - 2; /* exclude missing */ Assert(exact > 0); /* Loop until we find a close enough approximation. Keep the last good values */ factor = prev_factor = 0; - value = prev_value = round(exact); + value = prev_value = round(exact); while (!is_approximately_equal(exact, eval_value_factor(value, factor), epsilon) && - value < maxval_value && - factor < maxval_factor) - { + value < maxval_value && + factor < maxval_factor) { value = round(exact * pow(10., ++factor)); if (value > maxval_value || factor > maxval_factor) { /* One or more maxima exceeded. So stop and use the previous values */ - value = prev_value; + value = prev_value; factor = prev_factor; break; } prev_factor = factor; - prev_value = value; + prev_value = value; } - if ((ret = grib_set_long_internal(hand, self->scaleFactor, factor)) != GRIB_SUCCESS) return ret; - if ((ret = grib_set_long_internal(hand, self->scaledValue, value)) != GRIB_SUCCESS) return ret; + if ((ret = grib_set_long_internal(hand, self->scaleFactor, factor)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_set_long_internal(hand, self->scaledValue, value)) != GRIB_SUCCESS) + return ret; return GRIB_SUCCESS; } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { grib_accessor_from_scale_factor_scaled_value* self = (grib_accessor_from_scale_factor_scaled_value*)a; - int ret = 0; - long scaleFactor=0; - long scaledValue=0; - grib_handle* hand = grib_handle_of_accessor(a); + int ret = 0; + long scaleFactor = 0; + long scaledValue = 0; + grib_handle* hand = grib_handle_of_accessor(a); - if((ret = grib_get_long_internal(hand, self->scaleFactor,&scaleFactor)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(hand, self->scaleFactor, &scaleFactor)) != GRIB_SUCCESS) return ret; /* ECC-966: If scale factor is missing, print error and treat it as zero (as a fallback) */ if (grib_is_missing(hand, self->scaleFactor, &ret) && ret == GRIB_SUCCESS) { grib_context_log(a->context, GRIB_LOG_ERROR, - "unpack_double for %s: %s is missing! Setting it to zero", a->name, self->scaleFactor); + "unpack_double for %s: %s is missing! Setting it to zero", a->name, self->scaleFactor); scaleFactor = 0; } - if((ret = grib_get_long_internal(hand, self->scaledValue,&scaledValue)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(hand, self->scaledValue, &scaledValue)) != GRIB_SUCCESS) return ret; - *val=scaledValue; + *val = scaledValue; /* The formula is: * real_value = scaled_value / pow(10, scale_factor) */ - while (scaleFactor <0) {*val*=10;scaleFactor++;} - while (scaleFactor >0) {*val/=10;scaleFactor--;} + while (scaleFactor < 0) { + *val *= 10; + scaleFactor++; + } + while (scaleFactor > 0) { + *val /= 10; + scaleFactor--; + } - if (ret == GRIB_SUCCESS) *len = 1; + if (ret == GRIB_SUCCESS) + *len = 1; return ret; } @@ -264,16 +276,14 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len) static int is_missing(grib_accessor* a) { grib_accessor_from_scale_factor_scaled_value* self = (grib_accessor_from_scale_factor_scaled_value*)a; - int ret = 0; - long scaleFactor=0; - long scaledValue=0; + int ret = 0; + long scaleFactor = 0; + long scaledValue = 0; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->scaleFactor,&scaleFactor)) - != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->scaleFactor, &scaleFactor)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->scaledValue,&scaledValue)) - != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->scaledValue, &scaledValue)) != GRIB_SUCCESS) return ret; return ((scaleFactor == GRIB_MISSING_LONG) | (scaledValue == GRIB_MISSING_LONG)); diff --git a/src/grib_accessor_class_g1_half_byte_codeflag.c b/src/grib_accessor_class_g1_half_byte_codeflag.c index acd0b6af6..11168ad77 100644 --- a/src/grib_accessor_class_g1_half_byte_codeflag.c +++ b/src/grib_accessor_class_g1_half_byte_codeflag.c @@ -34,63 +34,64 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); +static int get_native_type(grib_accessor*); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); static int compare(grib_accessor*, grib_accessor*); -typedef struct grib_accessor_g1_half_byte_codeflag { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in g1_half_byte_codeflag */ +typedef struct grib_accessor_g1_half_byte_codeflag +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in g1_half_byte_codeflag */ } grib_accessor_g1_half_byte_codeflag; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_g1_half_byte_codeflag = { - &grib_accessor_class_gen, /* super */ - "g1_half_byte_codeflag", /* name */ - sizeof(grib_accessor_g1_half_byte_codeflag), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "g1_half_byte_codeflag", /* name */ + sizeof(grib_accessor_g1_half_byte_codeflag), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + &compare, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -99,55 +100,54 @@ grib_accessor_class* grib_accessor_class_g1_half_byte_codeflag = &_grib_accessor static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len , grib_arguments* arg ) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { a->length = 0; - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_long(dumper,a,NULL); + grib_dump_long(dumper, a, NULL); } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { unsigned char dat = 0; - if(*len < 1) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name , 1 ); + if (*len < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); *len = 0; return GRIB_ARRAY_TOO_SMALL; } @@ -158,12 +158,11 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) return GRIB_SUCCESS; } -static int pack_long(grib_accessor* a, const long *val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { int ret = 0; - if(*len < 1) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name , 1 ); + if (*len < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); *len = 0; return GRIB_ARRAY_TOO_SMALL; } @@ -175,33 +174,38 @@ static int pack_long(grib_accessor* a, const long *val, size_t *len) return ret; } -static int get_native_type(grib_accessor* a) +static int get_native_type(grib_accessor* a) { return GRIB_TYPE_LONG; } -static int compare(grib_accessor* a,grib_accessor* b) { - long aval=0; - long bval=0; +static int compare(grib_accessor* a, grib_accessor* b) +{ + long aval = 0; + long bval = 0; - long count=0; + long count = 0; size_t alen = 0; size_t blen = 0; - int err=0; + int err = 0; - err=grib_value_count(a,&count); - if (err) return err; - alen=count; + err = grib_value_count(a, &count); + if (err) + return err; + alen = count; - err=grib_value_count(b,&count); - if (err) return err; - blen=count; + err = grib_value_count(b, &count); + if (err) + return err; + blen = count; - if (alen !=1 || blen != 1) return GRIB_COUNT_MISMATCH; + if (alen != 1 || blen != 1) + return GRIB_COUNT_MISMATCH; - grib_unpack_long(a,&aval,&alen); - grib_unpack_long(b,&bval,&blen); + grib_unpack_long(a, &aval, &alen); + grib_unpack_long(b, &bval, &blen); - if (bval != aval) return GRIB_VALUE_MISMATCH; + if (bval != aval) + return GRIB_VALUE_MISMATCH; return GRIB_SUCCESS; } diff --git a/src/grib_accessor_class_g1_increment.c b/src/grib_accessor_class_g1_increment.c index d7de7a695..939c4b3cf 100644 --- a/src/grib_accessor_class_g1_increment.c +++ b/src/grib_accessor_class_g1_increment.c @@ -40,66 +40,67 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_g1_increment { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in double */ -/* Members defined in g1_increment */ - const char* directionIncrementGiven; - const char* directionIncrement; - const char* first; - const char* last; - const char* numberOfPoints; +typedef struct grib_accessor_g1_increment +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in double */ + /* Members defined in g1_increment */ + const char* directionIncrementGiven; + const char* directionIncrement; + const char* first; + const char* last; + const char* numberOfPoints; } grib_accessor_g1_increment; extern grib_accessor_class* grib_accessor_class_double; static grib_accessor_class _grib_accessor_class_g1_increment = { - &grib_accessor_class_double, /* super */ - "g1_increment", /* name */ - sizeof(grib_accessor_g1_increment), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_double, /* super */ + "g1_increment", /* name */ + sizeof(grib_accessor_g1_increment), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -108,88 +109,86 @@ grib_accessor_class* grib_accessor_class_g1_increment = &_grib_accessor_class_g1 static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_g1_increment* self = (grib_accessor_g1_increment*)a; - int n = 0; + int n = 0; - self->directionIncrementGiven = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->directionIncrement = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->first = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->last = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->numberOfPoints = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); + self->directionIncrementGiven = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->directionIncrement = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->first = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->last = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->numberOfPoints = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); } -static int unpack_double (grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { grib_accessor_g1_increment* self = (grib_accessor_g1_increment*)a; - int ret = 0; + int ret = 0; - long directionIncrementGiven=0; + long directionIncrementGiven = 0; long directionIncrement; - double first = 0; - double last = 0; + double first = 0; + double last = 0; long numberOfPoints = 0; - if(*len < 1) + if (*len < 1) ret = GRIB_ARRAY_TOO_SMALL; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->directionIncrementGiven,&directionIncrementGiven)) - != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->directionIncrementGiven, &directionIncrementGiven)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->directionIncrement,&directionIncrement)) - != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->directionIncrement, &directionIncrement)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_double_internal(grib_handle_of_accessor(a), self->first,&first)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(grib_handle_of_accessor(a), self->first, &first)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_double_internal(grib_handle_of_accessor(a), self->last,&last)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(grib_handle_of_accessor(a), self->last, &last)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints,&numberOfPoints)) - != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints, &numberOfPoints)) != GRIB_SUCCESS) return ret; if (!directionIncrementGiven || directionIncrement == GRIB_MISSING_LONG) { - *val = fabs(last-first)/(double)(numberOfPoints-1); - } else { - *val = (double)directionIncrement/1000.0; + *val = fabs(last - first) / (double)(numberOfPoints - 1); + } + else { + *val = (double)directionIncrement / 1000.0; } #if 0 @@ -201,66 +200,67 @@ static int unpack_double (grib_accessor* a, double* val, size_t *len) self->numberOfPoints,numberOfPoints, a->name,*val); #endif - if (ret == GRIB_SUCCESS) *len = 1; + if (ret == GRIB_SUCCESS) + *len = 1; return ret; -} +} -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { grib_accessor_g1_increment* self = (grib_accessor_g1_increment*)a; - int ret = 0; - long codedNumberOfPoints=0; + int ret = 0; + long codedNumberOfPoints = 0; - long directionIncrementGiven=0; + long directionIncrementGiven = 0; long directionIncrement; - double first = 0; - double last = 0; + double first = 0; + double last = 0; long numberOfPoints = 0; double incrementInMillidegrees; - ret = grib_get_double_internal(grib_handle_of_accessor(a), self->first,&first); - if(ret != GRIB_SUCCESS) { + ret = grib_get_double_internal(grib_handle_of_accessor(a), self->first, &first); + if (ret != GRIB_SUCCESS) { grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannont gather value for %s error %d \n", a->name, self->first, ret); return ret; } - ret = grib_get_double_internal(grib_handle_of_accessor(a), self->last,&last); - if(ret != GRIB_SUCCESS){ + ret = grib_get_double_internal(grib_handle_of_accessor(a), self->last, &last); + if (ret != GRIB_SUCCESS) { grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannont gather value for %s error %d \n", a->name, self->last, ret); return ret; } - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->directionIncrementGiven,&directionIncrementGiven)) - != GRIB_SUCCESS){ + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->directionIncrementGiven, &directionIncrementGiven)) != GRIB_SUCCESS) { grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannont gather value for %s error %d \n", a->name, self->directionIncrementGiven, ret); return ret; } - numberOfPoints = 1+rint(fabs((last-first) / *val)); + numberOfPoints = 1 + rint(fabs((last - first) / *val)); incrementInMillidegrees = *val * 1000; - if ((int)incrementInMillidegrees == incrementInMillidegrees ) { - directionIncrement=(int)incrementInMillidegrees; - } else { - directionIncrement=0xffffff; - directionIncrementGiven=0; + if ((int)incrementInMillidegrees == incrementInMillidegrees) { + directionIncrement = (int)incrementInMillidegrees; + } + else { + directionIncrement = 0xffffff; + directionIncrementGiven = 0; } - ret = grib_set_long_internal(grib_handle_of_accessor(a), self->numberOfPoints,numberOfPoints); - if(ret ) + ret = grib_set_long_internal(grib_handle_of_accessor(a), self->numberOfPoints, numberOfPoints); + if (ret) grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannont pack value for %s error %d \n", a->name, self->numberOfPoints, ret); - grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints,&codedNumberOfPoints); + grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints, &codedNumberOfPoints); - ret = grib_set_long_internal(grib_handle_of_accessor(a), self->directionIncrement,directionIncrement); - if(ret ) + ret = grib_set_long_internal(grib_handle_of_accessor(a), self->directionIncrement, directionIncrement); + if (ret) grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannont pack value for %s error %d \n", a->name, self->directionIncrement, ret); - ret = grib_set_long_internal(grib_handle_of_accessor(a), self->directionIncrementGiven,directionIncrementGiven); - if(ret ) + ret = grib_set_long_internal(grib_handle_of_accessor(a), self->directionIncrementGiven, directionIncrementGiven); + if (ret) grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannont pack value for %s error %d \n", a->name, self->directionIncrementGiven, ret); #if 0 @@ -275,8 +275,8 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) #endif - if (ret == GRIB_SUCCESS) *len = 1; + if (ret == GRIB_SUCCESS) + *len = 1; return ret; } - diff --git a/src/grib_accessor_class_g1_message_length.c b/src/grib_accessor_class_g1_message_length.c index 1ed7495f3..7939e8880 100644 --- a/src/grib_accessor_class_g1_message_length.c +++ b/src/grib_accessor_class_g1_message_length.c @@ -31,66 +31,67 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_g1_message_length { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in unsigned */ - long nbytes; - grib_arguments* arg; -/* Members defined in section_length */ -/* Members defined in g1_message_length */ - const char *sec4_length; +typedef struct grib_accessor_g1_message_length +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in unsigned */ + long nbytes; + grib_arguments* arg; + /* Members defined in section_length */ + /* Members defined in g1_message_length */ + const char* sec4_length; } grib_accessor_g1_message_length; extern grib_accessor_class* grib_accessor_class_section_length; static grib_accessor_class _grib_accessor_class_g1_message_length = { - &grib_accessor_class_section_length, /* super */ - "g1_message_length", /* name */ - sizeof(grib_accessor_g1_message_length), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_section_length, /* super */ + "g1_message_length", /* name */ + sizeof(grib_accessor_g1_message_length), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -99,70 +100,70 @@ grib_accessor_class* grib_accessor_class_g1_message_length = &_grib_accessor_cla static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len , grib_arguments* args ) +static void init(grib_accessor* a, const long len, grib_arguments* args) { - grib_accessor_g1_message_length *self = (grib_accessor_g1_message_length*)a; - self->sec4_length = grib_arguments_get_name(grib_handle_of_accessor(a),args,0); + grib_accessor_g1_message_length* self = (grib_accessor_g1_message_length*)a; + self->sec4_length = grib_arguments_get_name(grib_handle_of_accessor(a), args, 0); } -int grib_get_g1_message_size(grib_handle* h,grib_accessor* tl,grib_accessor* s4, - long* total_length,long* sec4_len) +int grib_get_g1_message_size(grib_handle* h, grib_accessor* tl, grib_accessor* s4, + long* total_length, long* sec4_len) { - unsigned long tlen,slen; + unsigned long tlen, slen; long off; - if(!tl) return GRIB_NOT_FOUND; - if(!s4) { + if (!tl) + return GRIB_NOT_FOUND; + if (!s4) { *sec4_len = 0; - off = tl->offset * 8; + off = tl->offset * 8; *total_length = grib_decode_unsigned_long(h->buffer->data, &off, tl->length * 8); return GRIB_SUCCESS; } - off = tl->offset * 8; + off = tl->offset * 8; tlen = grib_decode_unsigned_long(h->buffer->data, &off, tl->length * 8); - off = s4->offset * 8; + off = s4->offset * 8; slen = grib_decode_unsigned_long(h->buffer->data, &off, s4->length * 8); /* printf("\nlarge grib tlen=%ld slen=%ld diff=%ld\n",tlen&0x7fffff,slen,tlen-slen); */ - if(slen < 120 && (tlen & 0x800000)) - { + if (slen < 120 && (tlen & 0x800000)) { /* printf("DECODING large grib tlen=%ld slen=%ld\n",tlen,slen); */ tlen &= 0x7fffff; @@ -170,7 +171,7 @@ int grib_get_g1_message_size(grib_handle* h,grib_accessor* tl,grib_accessor* s4, tlen -= slen; tlen += 4; - slen = tlen - s4->offset - 4; /* 4 is for 7777 */; + slen = tlen - s4->offset - 4; /* 4 is for 7777 */ /*printf("DECODING large grib total=%ld section4=%ld\n",tlen,slen);*/ } @@ -181,47 +182,47 @@ int grib_get_g1_message_size(grib_handle* h,grib_accessor* tl,grib_accessor* s4, return GRIB_SUCCESS; } -static int pack_long(grib_accessor* a, const long* val,size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { - grib_accessor_g1_message_length *self = (grib_accessor_g1_message_length*)a; + grib_accessor_g1_message_length* self = (grib_accessor_g1_message_length*)a; /*grib_accessor_class* super = *(a->cclass->super);*/ /* Here we assume that the totalLength will be coded AFTER the section4 length, and the section4 length will be overwritten by the totalLength accessor for large GRIBs */ - grib_accessor* s4 = grib_find_accessor(grib_handle_of_accessor(a),self->sec4_length); - long tlen,slen; + grib_accessor* s4 = grib_find_accessor(grib_handle_of_accessor(a), self->sec4_length); + long tlen, slen; long t120; int ret; tlen = *val; - if((tlen < 0x800000 || !a->context->gribex_mode_on) && tlen < 0xFFFFFF ) - { + if ((tlen < 0x800000 || !a->context->gribex_mode_on) && tlen < 0xFFFFFF) { /* printf("ENCODING small grib total = %ld\n",tlen); */ /*return super->pack_long(a,val,len);*/ /* Do not directly call pack_long on base class */ /* because in this special case we want to skip the checks. */ /* So we call the helper function which has an extra argument */ - return pack_long_unsigned_helper(a,val,len, /*check=*/0); + return pack_long_unsigned_helper(a, val, len, /*check=*/0); } - if(!s4) return GRIB_NOT_FOUND; + if (!s4) + return GRIB_NOT_FOUND; /* special case for large GRIBs */ tlen -= 4; - t120 = (tlen+119)/120; - slen = t120*120 - tlen; - tlen = 0x800000 | t120; + t120 = (tlen + 119) / 120; + slen = t120 * 120 - tlen; + tlen = 0x800000 | t120; /* printf("ENCODING large grib total = %ld tlen=%ld slen=%ld \n",*val,tlen,slen); */ *len = 1; - if((ret = grib_pack_long(s4,&slen,len)) != GRIB_SUCCESS) + if ((ret = grib_pack_long(s4, &slen, len)) != GRIB_SUCCESS) return ret; *len = 1; /* Do not do the length checks in this special case */ - if((ret = pack_long_unsigned_helper(a,&tlen,len,/*check=*/0)) != GRIB_SUCCESS) + if ((ret = pack_long_unsigned_helper(a, &tlen, len, /*check=*/0)) != GRIB_SUCCESS) return ret; /* if((ret = super->pack_long(a,&tlen,len)) != GRIB_SUCCESS) @@ -231,10 +232,10 @@ static int pack_long(grib_accessor* a, const long* val,size_t *len) { long total_length = -1, sec4_length = -1; grib_get_g1_message_size(grib_handle_of_accessor(a), - a, - grib_find_accessor(grib_handle_of_accessor(a),self->sec4_length), - &total_length, - &sec4_length); + a, + grib_find_accessor(grib_handle_of_accessor(a), self->sec4_length), + &total_length, + &sec4_length); Assert(total_length == *val); } @@ -242,18 +243,18 @@ static int pack_long(grib_accessor* a, const long* val,size_t *len) return GRIB_SUCCESS; } -static int unpack_long(grib_accessor* a, long* val,size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - grib_accessor_g1_message_length *self = (grib_accessor_g1_message_length*)a; + grib_accessor_g1_message_length* self = (grib_accessor_g1_message_length*)a; int ret; long total_length, sec4_length; - if((ret = grib_get_g1_message_size(grib_handle_of_accessor(a), - a, - grib_find_accessor(grib_handle_of_accessor(a),self->sec4_length), - &total_length, - &sec4_length)) != GRIB_SUCCESS) + if ((ret = grib_get_g1_message_size(grib_handle_of_accessor(a), + a, + grib_find_accessor(grib_handle_of_accessor(a), self->sec4_length), + &total_length, + &sec4_length)) != GRIB_SUCCESS) return ret; diff --git a/src/grib_accessor_class_g1_section4_length.c b/src/grib_accessor_class_g1_section4_length.c index 261d3c6d7..c38c15f1f 100644 --- a/src/grib_accessor_class_g1_section4_length.c +++ b/src/grib_accessor_class_g1_section4_length.c @@ -31,66 +31,67 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_g1_section4_length { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in unsigned */ - long nbytes; - grib_arguments* arg; -/* Members defined in section_length */ -/* Members defined in g1_section4_length */ - const char* total_length; +typedef struct grib_accessor_g1_section4_length +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in unsigned */ + long nbytes; + grib_arguments* arg; + /* Members defined in section_length */ + /* Members defined in g1_section4_length */ + const char* total_length; } grib_accessor_g1_section4_length; extern grib_accessor_class* grib_accessor_class_section_length; static grib_accessor_class _grib_accessor_class_g1_section4_length = { - &grib_accessor_class_section_length, /* super */ - "g1_section4_length", /* name */ - sizeof(grib_accessor_g1_section4_length), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_section_length, /* super */ + "g1_section4_length", /* name */ + sizeof(grib_accessor_g1_section4_length), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -99,48 +100,48 @@ grib_accessor_class* grib_accessor_class_g1_section4_length = &_grib_accessor_cl static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len , grib_arguments* args ) +static void init(grib_accessor* a, const long len, grib_arguments* args) { - grib_accessor_g1_section4_length *self = (grib_accessor_g1_section4_length*)a; - self->total_length = grib_arguments_get_name(grib_handle_of_accessor(a),args,0); + grib_accessor_g1_section4_length* self = (grib_accessor_g1_section4_length*)a; + self->total_length = grib_arguments_get_name(grib_handle_of_accessor(a), args, 0); } -static int pack_long(grib_accessor* a, const long* val,size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { #if 0 grib_accessor_class* super = *(a->cclass->super); @@ -152,28 +153,28 @@ static int pack_long(grib_accessor* a, const long* val,size_t *len) return super->pack_long(a,val,len); #endif - /* Do not directly call pack_long on base class */ - /* because in this special case we want to skip the checks. */ - /* So we call the helper function which has an extra argument */ - return pack_long_unsigned_helper(a,val,len, /*check=*/0); + /* Do not directly call pack_long on base class */ + /* because in this special case we want to skip the checks. */ + /* So we call the helper function which has an extra argument */ + return pack_long_unsigned_helper(a, val, len, /*check=*/0); } -static int unpack_long(grib_accessor* a, long* val,size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - grib_accessor_g1_section4_length *self = (grib_accessor_g1_section4_length*)a; - int ret; + grib_accessor_g1_section4_length* self = (grib_accessor_g1_section4_length*)a; + int ret; - long total_length, sec4_length; + long total_length, sec4_length; - if((ret = grib_get_g1_message_size(grib_handle_of_accessor(a), - grib_find_accessor(grib_handle_of_accessor(a),self->total_length), - a, - &total_length, - &sec4_length)) != GRIB_SUCCESS) - return ret; + if ((ret = grib_get_g1_message_size(grib_handle_of_accessor(a), + grib_find_accessor(grib_handle_of_accessor(a), self->total_length), + a, + &total_length, + &sec4_length)) != GRIB_SUCCESS) + return ret; - *val = sec4_length; + *val = sec4_length; - return GRIB_SUCCESS; + return GRIB_SUCCESS; } diff --git a/src/grib_accessor_class_g1area.c b/src/grib_accessor_class_g1area.c index 89dc9a972..720caa832 100644 --- a/src/grib_accessor_class_g1area.c +++ b/src/grib_accessor_class_g1area.c @@ -37,68 +37,69 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_g1area { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in double */ -/* Members defined in g1area */ - const char* laf; - const char* lof; - const char* lal; - const char* lol; - const char* div; +typedef struct grib_accessor_g1area +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in double */ + /* Members defined in g1area */ + const char* laf; + const char* lof; + const char* lal; + const char* lol; + const char* div; } grib_accessor_g1area; extern grib_accessor_class* grib_accessor_class_double; static grib_accessor_class _grib_accessor_class_g1area = { - &grib_accessor_class_double, /* super */ - "g1area", /* name */ - sizeof(grib_accessor_g1area), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_double, /* super */ + "g1area", /* name */ + sizeof(grib_accessor_g1area), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -107,124 +108,137 @@ grib_accessor_class* grib_accessor_class_g1area = &_grib_accessor_class_g1area; static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_g1area* self = (grib_accessor_g1area*)a; - int n = 0; + int n = 0; - self->laf = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->lof = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->lal = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->lol = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); + self->laf = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->lof = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->lal = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->lol = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { grib_accessor_g1area* self = (grib_accessor_g1area*)a; - int ret = 0; - - ret = grib_set_double_internal(grib_handle_of_accessor(a), self->laf,val[0]); - if(ret ) return ret; - ret = grib_set_double_internal(grib_handle_of_accessor(a), self->lof,val[1]); - if(ret ) return ret; - ret = grib_set_double_internal(grib_handle_of_accessor(a), self->lal,val[2]); - if(ret) return ret; - - ret = grib_set_double_internal(grib_handle_of_accessor(a), self->lol,val[3]); - if(ret ) return ret; - - if (ret == GRIB_SUCCESS) *len = 4; + int ret = 0; + + ret = grib_set_double_internal(grib_handle_of_accessor(a), self->laf, val[0]); + if (ret) + return ret; + ret = grib_set_double_internal(grib_handle_of_accessor(a), self->lof, val[1]); + if (ret) + return ret; + ret = grib_set_double_internal(grib_handle_of_accessor(a), self->lal, val[2]); + if (ret) + return ret; + + ret = grib_set_double_internal(grib_handle_of_accessor(a), self->lol, val[3]); + if (ret) + return ret; + + if (ret == GRIB_SUCCESS) + *len = 4; return ret; } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { grib_accessor_g1area* self = (grib_accessor_g1area*)a; - int ret = 0; + int ret = 0; - if(*len < 4){ + if (*len < 4) { *len = 4; return GRIB_BUFFER_TOO_SMALL; } - ret = grib_get_double_internal(grib_handle_of_accessor(a), self->laf,val++); - if(ret) return ret; + ret = grib_get_double_internal(grib_handle_of_accessor(a), self->laf, val++); + if (ret) + return ret; - ret = grib_get_double_internal(grib_handle_of_accessor(a), self->lof,val++); - if(ret) return ret; + ret = grib_get_double_internal(grib_handle_of_accessor(a), self->lof, val++); + if (ret) + return ret; - ret = grib_get_double_internal(grib_handle_of_accessor(a), self->lal,val++); - if(ret) return ret; + ret = grib_get_double_internal(grib_handle_of_accessor(a), self->lal, val++); + if (ret) + return ret; - ret = grib_get_double_internal(grib_handle_of_accessor(a), self->lol,val); - if(ret ) return ret; + ret = grib_get_double_internal(grib_handle_of_accessor(a), self->lol, val); + if (ret) + return ret; - if (ret == GRIB_SUCCESS) *len = 4; + if (ret == GRIB_SUCCESS) + *len = 4; return ret; } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_string(dumper,a,NULL); + grib_dump_string(dumper, a, NULL); } -static int unpack_string(grib_accessor* a, char* val, size_t *len) -{ +static int unpack_string(grib_accessor* a, char* val, size_t* len) +{ grib_accessor_g1area* self = (grib_accessor_g1area*)a; - int ret = 0; - - double laf,lof,lal,lol; - - ret = grib_get_double_internal(grib_handle_of_accessor(a), self->laf,&laf); - if(ret) return ret; - ret = grib_get_double_internal(grib_handle_of_accessor(a), self->lof,&lof); - if(ret) return ret; - ret = grib_get_double_internal(grib_handle_of_accessor(a), self->lal,&lal); - if(ret) return ret; - ret = grib_get_double_internal(grib_handle_of_accessor(a), self->lol,&lol); - if(ret) return ret; - if(*len < 60) - { - grib_context_log(a->context, GRIB_LOG_ERROR, " Buffer too small for %s (%d) ", a->name ,*len); + int ret = 0; + + double laf, lof, lal, lol; + + ret = grib_get_double_internal(grib_handle_of_accessor(a), self->laf, &laf); + if (ret) + return ret; + ret = grib_get_double_internal(grib_handle_of_accessor(a), self->lof, &lof); + if (ret) + return ret; + ret = grib_get_double_internal(grib_handle_of_accessor(a), self->lal, &lal); + if (ret) + return ret; + ret = grib_get_double_internal(grib_handle_of_accessor(a), self->lol, &lol); + if (ret) + return ret; + if (*len < 60) { + grib_context_log(a->context, GRIB_LOG_ERROR, " Buffer too small for %s (%d) ", a->name, *len); len = 0; return GRIB_BUFFER_TOO_SMALL; } - sprintf(val,"N:%3.5f W:%3.5f S:%3.5f E:%3.5f",((float)laf),((float)lof),((float)lal),((float)lol)); + sprintf(val, "N:%3.5f W:%3.5f S:%3.5f E:%3.5f", ((float)laf), ((float)lof), ((float)lal), ((float)lol)); len[0] = strlen(val); return GRIB_SUCCESS; diff --git a/src/grib_accessor_class_g1bitmap.c b/src/grib_accessor_class_g1bitmap.c index aa685f930..490c7abdb 100644 --- a/src/grib_accessor_class_g1bitmap.c +++ b/src/grib_accessor_class_g1bitmap.c @@ -33,68 +33,69 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int unpack_bytes (grib_accessor*,unsigned char*, size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int unpack_bytes(grib_accessor*, unsigned char*, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_g1bitmap { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in bytes */ -/* Members defined in bitmap */ - const char* tableReference; - const char* missing_value; - const char* offsetbsec; - const char* sLength; -/* Members defined in g1bitmap */ - const char* unusedBits; +typedef struct grib_accessor_g1bitmap +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in bytes */ + /* Members defined in bitmap */ + const char* tableReference; + const char* missing_value; + const char* offsetbsec; + const char* sLength; + /* Members defined in g1bitmap */ + const char* unusedBits; } grib_accessor_g1bitmap; extern grib_accessor_class* grib_accessor_class_bitmap; static grib_accessor_class _grib_accessor_class_g1bitmap = { - &grib_accessor_class_bitmap, /* super */ - "g1bitmap", /* name */ - sizeof(grib_accessor_g1bitmap), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - &unpack_bytes, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_bitmap, /* super */ + "g1bitmap", /* name */ + sizeof(grib_accessor_g1bitmap), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + &unpack_bytes, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -103,135 +104,132 @@ grib_accessor_class* grib_accessor_class_g1bitmap = &_grib_accessor_class_g1bitm static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void grib_set_bit_on( unsigned char* p, long *bitp); +static void grib_set_bit_on(unsigned char* p, long* bitp); -static void init(grib_accessor* a, const long len , grib_arguments* arg) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { grib_accessor_g1bitmap* self = (grib_accessor_g1bitmap*)a; - self->unusedBits = grib_arguments_get_name(grib_handle_of_accessor(a),arg,4); + self->unusedBits = grib_arguments_get_name(grib_handle_of_accessor(a), arg, 4); } -static int pack_double(grib_accessor* a, const double* val,size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { grib_accessor_g1bitmap* self = (grib_accessor_g1bitmap*)a; size_t tlen; unsigned char* buf = NULL; size_t i; - int err = 0; - long pos = 0; - long bmaplen = 0; + int err = 0; + long pos = 0; + long bmaplen = 0; const int bit_padding = 16; - double miss_values = 0; - tlen = ((*len+bit_padding-1)/bit_padding*bit_padding)/8; + double miss_values = 0; + tlen = ((*len + bit_padding - 1) / bit_padding * bit_padding) / 8; - if((err = grib_get_double_internal(grib_handle_of_accessor(a), self->missing_value, &miss_values)) - != GRIB_SUCCESS) + if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->missing_value, &miss_values)) != GRIB_SUCCESS) return err; - buf = (unsigned char*)grib_context_malloc_clear(a->context,tlen); - if(!buf) return GRIB_OUT_OF_MEMORY; - pos=0; - for(i=0;i<*len;i++) - { + buf = (unsigned char*)grib_context_malloc_clear(a->context, tlen); + if (!buf) + return GRIB_OUT_OF_MEMORY; + pos = 0; + for (i = 0; i < *len; i++) { if (val[i] == miss_values) pos++; - else{ + else { bmaplen++; grib_set_bit_on(buf, &pos); } } - if((err = grib_set_long_internal(grib_handle_of_accessor(a), self->unusedBits,tlen*8 - *len )) - != GRIB_SUCCESS) + if ((err = grib_set_long_internal(grib_handle_of_accessor(a), self->unusedBits, tlen * 8 - *len)) != GRIB_SUCCESS) return err; - grib_buffer_replace(a, buf, tlen,1,1); + grib_buffer_replace(a, buf, tlen, 1, 1); - grib_context_free(a->context,buf); + grib_context_free(a->context, buf); return GRIB_SUCCESS; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { grib_accessor_g1bitmap* self = (grib_accessor_g1bitmap*)a; long tlen; int err; - if ((err=grib_get_long_internal(grib_handle_of_accessor(a), self->unusedBits, &tlen)) != GRIB_SUCCESS) - grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_class_bitmap.value_count : cannot get %s err=%d",self->unusedBits,err); + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->unusedBits, &tlen)) != GRIB_SUCCESS) + grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_class_bitmap.value_count : cannot get %s err=%d", self->unusedBits, err); - *count = (a->length*8)-tlen; + *count = (a->length * 8) - tlen; return err; } -static int unpack_bytes(grib_accessor* a, unsigned char* val, size_t *len) +static int unpack_bytes(grib_accessor* a, unsigned char* val, size_t* len) { - unsigned char* buf = grib_handle_of_accessor(a)->buffer->data; + unsigned char* buf = grib_handle_of_accessor(a)->buffer->data; grib_accessor_g1bitmap* self = (grib_accessor_g1bitmap*)a; long tlen; int err; long length = grib_byte_count(a); long offset = grib_byte_offset(a); - if(*len < (size_t)length ) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it is %d bytes long\n", a->name ,length ); + if (*len < (size_t)length) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it is %d bytes long\n", a->name, length); *len = length; return GRIB_ARRAY_TOO_SMALL; } - if ((err=grib_get_long_internal(grib_handle_of_accessor(a), self->unusedBits, &tlen)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->unusedBits, &tlen)) != GRIB_SUCCESS) grib_context_log(a->context, GRIB_LOG_ERROR, - "grib_accessor_class_bitmap.unpack_bytes : cannot get %s err=%d",self->unusedBits,err); + "grib_accessor_class_bitmap.unpack_bytes : cannot get %s err=%d", self->unusedBits, err); - length-= tlen/8; - memcpy(val,buf + offset,length ); + length -= tlen / 8; + memcpy(val, buf + offset, length); *len = length; return GRIB_SUCCESS; } -static void grib_set_bit_on( unsigned char* p, long *bitp) +static void grib_set_bit_on(unsigned char* p, long* bitp) { - unsigned char o = 1; + unsigned char o = 1; p += (*bitp >> 3); - o <<= 7-((*bitp)%8); + o <<= 7 - ((*bitp) % 8); *p |= o; - (*bitp)+=1; + (*bitp) += 1; } diff --git a/src/grib_accessor_class_g1date.c b/src/grib_accessor_class_g1date.c index 8de6c42db..dea8cb176 100644 --- a/src/grib_accessor_class_g1date.c +++ b/src/grib_accessor_class_g1date.c @@ -40,68 +40,69 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); -static int value_count(grib_accessor*,long*); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); +static int value_count(grib_accessor*, long*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_g1date { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in g1date */ - const char* century; - const char* year; - const char* month; - const char* day; +typedef struct grib_accessor_g1date +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in g1date */ + const char* century; + const char* year; + const char* month; + const char* day; } grib_accessor_g1date; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_g1date = { - &grib_accessor_class_long, /* super */ - "g1date", /* name */ - sizeof(grib_accessor_g1date), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "g1date", /* name */ + sizeof(grib_accessor_g1date), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -110,198 +111,203 @@ grib_accessor_class* grib_accessor_class_g1date = &_grib_accessor_class_g1date; static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_g1date* self = (grib_accessor_g1date*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int n = 0; + grib_handle* hand = grib_handle_of_accessor(a); + int n = 0; - self->century = grib_arguments_get_name(hand,c,n++); - self->year = grib_arguments_get_name(hand,c,n++); - self->month = grib_arguments_get_name(hand,c,n++); - self->day = grib_arguments_get_name(hand,c,n++); + self->century = grib_arguments_get_name(hand, c, n++); + self->year = grib_arguments_get_name(hand, c, n++); + self->month = grib_arguments_get_name(hand, c, n++); + self->day = grib_arguments_get_name(hand, c, n++); } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_long(dumper,a,NULL); + grib_dump_long(dumper, a, NULL); } -static int unpack_long(grib_accessor* a, long* val, size_t *len) -{ - int ret=0; +static int unpack_long(grib_accessor* a, long* val, size_t* len) +{ + int ret = 0; grib_accessor_g1date* self = (grib_accessor_g1date*)a; - grib_handle* hand = grib_handle_of_accessor(a); + grib_handle* hand = grib_handle_of_accessor(a); - long year = 0; + long year = 0; long century = 0; - long month = 0; - long day = 0; + long month = 0; + long day = 0; - if ((ret=grib_get_long_internal(hand, self->century,¢ury))!=GRIB_SUCCESS) + if ((ret = grib_get_long_internal(hand, self->century, ¢ury)) != GRIB_SUCCESS) return ret; - if ((ret=grib_get_long_internal(hand, self->day,&day))!=GRIB_SUCCESS) + if ((ret = grib_get_long_internal(hand, self->day, &day)) != GRIB_SUCCESS) return ret; - if ((ret=grib_get_long_internal(hand, self->month,&month))!=GRIB_SUCCESS) + if ((ret = grib_get_long_internal(hand, self->month, &month)) != GRIB_SUCCESS) return ret; - if ((ret=grib_get_long_internal(hand, self->year,&year))!=GRIB_SUCCESS) + if ((ret = grib_get_long_internal(hand, self->year, &year)) != GRIB_SUCCESS) return ret; - if(*len < 1) + if (*len < 1) return GRIB_WRONG_ARRAY_SIZE; - *val = ((century-1)*100 + year) * 10000 + month * 100 + day; + *val = ((century - 1) * 100 + year) * 10000 + month * 100 + day; - if(year == 255 && day == 255 && month >= 1 && month <= 12) - { + if (year == 255 && day == 255 && month >= 1 && month <= 12) { *val = month; } - if(year == 255 && day != 255 && month >= 1 && month <= 12) - { - *val = month * 100 + day; + if (year == 255 && day != 255 && month >= 1 && month <= 12) { + *val = month * 100 + day; } return GRIB_SUCCESS; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { - int ret=0; - long v = val[0]; + int ret = 0; + long v = val[0]; grib_accessor_g1date* self = (grib_accessor_g1date*)a; - grib_handle* hand = grib_handle_of_accessor(a); + grib_handle* hand = grib_handle_of_accessor(a); long year = 0; long century = 0; long month = 0; long day = 0; - if(*len != 1) + if (*len != 1) return GRIB_WRONG_ARRAY_SIZE; { long d = grib_julian_to_date((long)grib_date_to_julian(v)); - if(v != d) - { - grib_context_log(a->context,GRIB_LOG_ERROR,"grib_accessor_g1date: pack_long invalid date %ld, changed to %ld",v,d); + if (v != d) { + grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_g1date: pack_long invalid date %ld, changed to %ld", v, d); return GRIB_ENCODING_ERROR; } } - century = v / 1000000; v %= 1000000; - year = v / 10000; v %= 10000; - month = v / 100; v %= 100; - day = v; + century = v / 1000000; + v %= 1000000; + year = v / 10000; + v %= 10000; + month = v / 100; + v %= 100; + day = v; - if(year == 0) + if (year == 0) year = 100; else century++; - if ((ret=grib_set_long_internal(hand,self->century,century))!=GRIB_SUCCESS) + if ((ret = grib_set_long_internal(hand, self->century, century)) != GRIB_SUCCESS) return ret; - if ((ret=grib_set_long_internal(hand,self->day,day))!=GRIB_SUCCESS) + if ((ret = grib_set_long_internal(hand, self->day, day)) != GRIB_SUCCESS) return ret; - if ((ret=grib_set_long_internal(hand,self->month,month))!=GRIB_SUCCESS) + if ((ret = grib_set_long_internal(hand, self->month, month)) != GRIB_SUCCESS) return ret; - if ((ret=grib_set_long_internal(hand,self->year,year))!=GRIB_SUCCESS) + if ((ret = grib_set_long_internal(hand, self->year, year)) != GRIB_SUCCESS) return ret; return GRIB_SUCCESS; } static const char* months[] = { - "jan","feb","mar","apr", - "may","jun","jul","aug", - "sep","oct","nov","dec", + "jan", + "feb", + "mar", + "apr", + "may", + "jun", + "jul", + "aug", + "sep", + "oct", + "nov", + "dec", }; -static int unpack_string(grib_accessor* a, char* val, size_t *len) -{ - int ret=0; +static int unpack_string(grib_accessor* a, char* val, size_t* len) +{ + int ret = 0; char tmp[1024]; grib_accessor_g1date* self = (grib_accessor_g1date*)a; - grib_handle* hand = grib_handle_of_accessor(a); - long year = 0; - long century = 0; - long month = 0; - long day = 0; + grib_handle* hand = grib_handle_of_accessor(a); + long year = 0; + long century = 0; + long month = 0; + long day = 0; size_t l; - if ((ret=grib_get_long_internal(hand, self->century,¢ury))!=GRIB_SUCCESS) + if ((ret = grib_get_long_internal(hand, self->century, ¢ury)) != GRIB_SUCCESS) return ret; - if ((ret=grib_get_long_internal(hand, self->day,&day))!=GRIB_SUCCESS) + if ((ret = grib_get_long_internal(hand, self->day, &day)) != GRIB_SUCCESS) return ret; - if ((ret=grib_get_long_internal(hand, self->month,&month))!=GRIB_SUCCESS) + if ((ret = grib_get_long_internal(hand, self->month, &month)) != GRIB_SUCCESS) return ret; - if ((ret=grib_get_long_internal(hand, self->year,&year))!=GRIB_SUCCESS) + if ((ret = grib_get_long_internal(hand, self->year, &year)) != GRIB_SUCCESS) return ret; - if(*len < 1) + if (*len < 1) return GRIB_WRONG_ARRAY_SIZE; - if(year == 255 && day == 255 && month >= 1 && month <= 12) - { - strcpy(tmp,months[month-1]); + if (year == 255 && day == 255 && month >= 1 && month <= 12) { + strcpy(tmp, months[month - 1]); } - else if(year == 255 && month >= 1 && month <= 12) - { - sprintf(tmp,"%s-%02ld",months[month-1],day); + else if (year == 255 && month >= 1 && month <= 12) { + sprintf(tmp, "%s-%02ld", months[month - 1], day); /* sprintf(tmp,"%02ld-%02ld",month,day); */ } - else - { - long x = ((century-1)*100 + year) * 10000 + month * 100 + day; - sprintf(tmp,"%ld",x); + else { + long x = ((century - 1) * 100 + year) * 10000 + month * 100 + day; + sprintf(tmp, "%ld", x); } l = strlen(tmp) + 1; - if(*len < l) - { + if (*len < l) { *len = l; return GRIB_BUFFER_TOO_SMALL; } *len = l; - strcpy(val,tmp); + strcpy(val, tmp); return GRIB_SUCCESS; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - *count=1; + *count = 1; return 0; } diff --git a/src/grib_accessor_class_g1day_of_the_year_date.c b/src/grib_accessor_class_g1day_of_the_year_date.c index e61c5b430..745795e57 100644 --- a/src/grib_accessor_class_g1day_of_the_year_date.c +++ b/src/grib_accessor_class_g1day_of_the_year_date.c @@ -33,66 +33,67 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_string (grib_accessor*, char*, size_t *len); +static int unpack_string(grib_accessor*, char*, size_t* len); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_g1day_of_the_year_date { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in g1date */ - const char* century; - const char* year; - const char* month; - const char* day; -/* Members defined in g1day_of_the_year_date */ +typedef struct grib_accessor_g1day_of_the_year_date +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in g1date */ + const char* century; + const char* year; + const char* month; + const char* day; + /* Members defined in g1day_of_the_year_date */ } grib_accessor_g1day_of_the_year_date; extern grib_accessor_class* grib_accessor_class_g1date; static grib_accessor_class _grib_accessor_class_g1day_of_the_year_date = { - &grib_accessor_class_g1date, /* super */ - "g1day_of_the_year_date", /* name */ - sizeof(grib_accessor_g1day_of_the_year_date), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_g1date, /* super */ + "g1day_of_the_year_date", /* name */ + sizeof(grib_accessor_g1day_of_the_year_date), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -101,94 +102,93 @@ grib_accessor_class* grib_accessor_class_g1day_of_the_year_date = &_grib_accesso static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_string(dumper,a,NULL); + grib_dump_string(dumper, a, NULL); } -static int unpack_string(grib_accessor* a, char* val, size_t *len) -{ - /* special clim case where each mont have 30 days.. to comply with mars*/ - grib_accessor_g1day_of_the_year_date* self = (grib_accessor_g1day_of_the_year_date*)a; +static int unpack_string(grib_accessor* a, char* val, size_t* len) +{ + /* special clim case where each mont have 30 days.. to comply with mars*/ + grib_accessor_g1day_of_the_year_date* self = (grib_accessor_g1day_of_the_year_date*)a; - char tmp[1024]; + char tmp[1024]; - long year = 0; - long century = 0; - long month = 0; - long day = 0; + long year = 0; + long century = 0; + long month = 0; + long day = 0; - long fullyear = 0; - long fake_day_of_year = 0; + long fullyear = 0; + long fake_day_of_year = 0; - size_t l; + size_t l; - grib_get_long_internal(grib_handle_of_accessor(a), self->century,¢ury); - grib_get_long_internal(grib_handle_of_accessor(a), self->day,&day); - grib_get_long_internal(grib_handle_of_accessor(a), self->month,&month); - grib_get_long_internal(grib_handle_of_accessor(a), self->year,&year); + grib_get_long_internal(grib_handle_of_accessor(a), self->century, ¢ury); + grib_get_long_internal(grib_handle_of_accessor(a), self->day, &day); + grib_get_long_internal(grib_handle_of_accessor(a), self->month, &month); + grib_get_long_internal(grib_handle_of_accessor(a), self->year, &year); - if(*len < 1) - return GRIB_BUFFER_TOO_SMALL; + if (*len < 1) + return GRIB_BUFFER_TOO_SMALL; - fullyear = ((century-1)*100 + year); - fake_day_of_year = ((month-1) * 30) + day; - sprintf(tmp,"%04ld-%03ld",fullyear,fake_day_of_year); + fullyear = ((century - 1) * 100 + year); + fake_day_of_year = ((month - 1) * 30) + day; + sprintf(tmp, "%04ld-%03ld", fullyear, fake_day_of_year); - l = strlen(tmp) + 1; - if(*len < l) - { - *len = l; - return GRIB_BUFFER_TOO_SMALL; - } + l = strlen(tmp) + 1; + if (*len < l) { + *len = l; + return GRIB_BUFFER_TOO_SMALL; + } - *len = l; - strcpy(val,tmp); + *len = l; + strcpy(val, tmp); - return GRIB_SUCCESS; + return GRIB_SUCCESS; } diff --git a/src/grib_accessor_class_g1end_of_interval_monthly.c b/src/grib_accessor_class_g1end_of_interval_monthly.c index 5d888fde8..91963856b 100644 --- a/src/grib_accessor_class_g1end_of_interval_monthly.c +++ b/src/grib_accessor_class_g1end_of_interval_monthly.c @@ -33,67 +33,68 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void destroy(grib_context*,grib_accessor*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void destroy(grib_context*, grib_accessor*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); static int compare(grib_accessor*, grib_accessor*); -typedef struct grib_accessor_g1end_of_interval_monthly { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in double */ -/* Members defined in abstract_vector */ - double* v; - int number_of_elements; -/* Members defined in g1end_of_interval_monthly */ - const char* verifyingMonth; +typedef struct grib_accessor_g1end_of_interval_monthly +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in double */ + /* Members defined in abstract_vector */ + double* v; + int number_of_elements; + /* Members defined in g1end_of_interval_monthly */ + const char* verifyingMonth; } grib_accessor_g1end_of_interval_monthly; extern grib_accessor_class* grib_accessor_class_abstract_vector; static grib_accessor_class _grib_accessor_class_g1end_of_interval_monthly = { - &grib_accessor_class_abstract_vector, /* super */ - "g1end_of_interval_monthly", /* name */ - sizeof(grib_accessor_g1end_of_interval_monthly), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_abstract_vector, /* super */ + "g1end_of_interval_monthly", /* name */ + sizeof(grib_accessor_g1end_of_interval_monthly), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + &destroy, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + &compare, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -102,150 +103,158 @@ grib_accessor_class* grib_accessor_class_g1end_of_interval_monthly = &_grib_acce static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_g1end_of_interval_monthly* self = (grib_accessor_g1end_of_interval_monthly*)a; - int n = 0; + int n = 0; - self->verifyingMonth = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + self->verifyingMonth = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; a->flags |= GRIB_ACCESSOR_FLAG_HIDDEN; - self->number_of_elements=6; - self->v=(double*)grib_context_malloc(a->context, - sizeof(double)*self->number_of_elements); + self->number_of_elements = 6; + self->v = (double*)grib_context_malloc(a->context, + sizeof(double) * self->number_of_elements); - a->length=0; - a->dirty=1; + a->length = 0; + a->dirty = 1; } -static int unpack_double (grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { grib_accessor_g1end_of_interval_monthly* self = (grib_accessor_g1end_of_interval_monthly*)a; - int ret = 0; - char verifyingMonth[7]={0,}; - size_t slen=7; - long year=0,month=0,date=0; - long mdays[]={31,28,31,30,31,30,31,31,30,31,30,31}; - long days=0; - - if (!a->dirty) return GRIB_SUCCESS; - - if((ret=grib_get_string(grib_handle_of_accessor(a),self->verifyingMonth,verifyingMonth,&slen)) - != GRIB_SUCCESS) return ret; - - date=atoi(verifyingMonth); - year=date/100; - month=date-year*100; - if ( month == 2 ) { - days=28; - if (year%400 == 0 || ( year%4 == 0 && year%100 != 0) ) days=29; - } else days=mdays[month-1]; - - self->v[0]=year; - self->v[1]=month; - - self->v[2]=days; - self->v[3]=24; - self->v[4]=00; - self->v[5]=00; - - a->dirty=0; - - val[0]=self->v[0]; - val[1]=self->v[1]; - val[2]=self->v[2]; - val[3]=self->v[3]; - val[4]=self->v[4]; - val[5]=self->v[5]; + int ret = 0; + char verifyingMonth[7] = {0,}; + size_t slen = 7; + long year = 0, month = 0, date = 0; + long mdays[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; + long days = 0; + + if (!a->dirty) + return GRIB_SUCCESS; + + if ((ret = grib_get_string(grib_handle_of_accessor(a), self->verifyingMonth, verifyingMonth, &slen)) != GRIB_SUCCESS) + return ret; + + date = atoi(verifyingMonth); + year = date / 100; + month = date - year * 100; + if (month == 2) { + days = 28; + if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) + days = 29; + } + else + days = mdays[month - 1]; + + self->v[0] = year; + self->v[1] = month; + + self->v[2] = days; + self->v[3] = 24; + self->v[4] = 00; + self->v[5] = 00; + + a->dirty = 0; + + val[0] = self->v[0]; + val[1] = self->v[1]; + val[2] = self->v[2]; + val[3] = self->v[3]; + val[4] = self->v[4]; + val[5] = self->v[5]; return ret; } -static int value_count(grib_accessor* a,long *count) +static int value_count(grib_accessor* a, long* count) { grib_accessor_g1end_of_interval_monthly* self = (grib_accessor_g1end_of_interval_monthly*)a; - *count=self->number_of_elements; + *count = self->number_of_elements; return 0; } -static void destroy(grib_context* c,grib_accessor* a) +static void destroy(grib_context* c, grib_accessor* a) { grib_accessor_g1end_of_interval_monthly* self = (grib_accessor_g1end_of_interval_monthly*)a; - grib_context_free(c,self->v); + grib_context_free(c, self->v); } static int compare(grib_accessor* a, grib_accessor* b) { - int retval = GRIB_SUCCESS; - double *aval=0; - double *bval=0; + int retval = GRIB_SUCCESS; + double* aval = 0; + double* bval = 0; - long count=0; + long count = 0; size_t alen = 0; size_t blen = 0; - int err=0; + int err = 0; - err=grib_value_count(a,&count); - if (err) return err; - alen=count; + err = grib_value_count(a, &count); + if (err) + return err; + alen = count; - err=grib_value_count(b,&count); - if (err) return err; - blen=count; + err = grib_value_count(b, &count); + if (err) + return err; + blen = count; - if (alen != blen) return GRIB_COUNT_MISMATCH; + if (alen != blen) + return GRIB_COUNT_MISMATCH; - aval=(double*)grib_context_malloc(a->context,alen*sizeof(double)); - bval=(double*)grib_context_malloc(b->context,blen*sizeof(double)); + aval = (double*)grib_context_malloc(a->context, alen * sizeof(double)); + bval = (double*)grib_context_malloc(b->context, blen * sizeof(double)); - b->dirty=1; - a->dirty=1; + b->dirty = 1; + a->dirty = 1; - grib_unpack_double(a,aval,&alen); - grib_unpack_double(b,bval,&blen); + grib_unpack_double(a, aval, &alen); + grib_unpack_double(b, bval, &blen); while (alen != 0) { - if (*bval != *aval) retval = GRIB_DOUBLE_VALUE_MISMATCH; + if (*bval != *aval) + retval = GRIB_DOUBLE_VALUE_MISMATCH; alen--; } - grib_context_free(a->context,aval); - grib_context_free(b->context,bval); + grib_context_free(a->context, aval); + grib_context_free(b->context, bval); return retval; } diff --git a/src/grib_accessor_class_g1fcperiod.c b/src/grib_accessor_class_g1fcperiod.c index dad7d2c85..7bda0cea6 100644 --- a/src/grib_accessor_class_g1fcperiod.c +++ b/src/grib_accessor_class_g1fcperiod.c @@ -30,71 +30,72 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_string (grib_accessor*, char*, size_t *len); +static int unpack_string(grib_accessor*, char*, size_t* len); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_g1fcperiod { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in abstract_long_vector */ - long* v; - long pack_index; - int number_of_elements; -/* Members defined in g1step_range */ - const char* p1; - const char* p2; - const char* timeRangeIndicator; - const char *unit; - const char *step_unit; - const char *stepType; - const char *patch_fp_precip; - int error_on_units; -/* Members defined in g1fcperiod */ +typedef struct grib_accessor_g1fcperiod +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in abstract_long_vector */ + long* v; + long pack_index; + int number_of_elements; + /* Members defined in g1step_range */ + const char* p1; + const char* p2; + const char* timeRangeIndicator; + const char* unit; + const char* step_unit; + const char* stepType; + const char* patch_fp_precip; + int error_on_units; + /* Members defined in g1fcperiod */ } grib_accessor_g1fcperiod; extern grib_accessor_class* grib_accessor_class_g1step_range; static grib_accessor_class _grib_accessor_class_g1fcperiod = { - &grib_accessor_class_g1step_range, /* super */ + &grib_accessor_class_g1step_range, /* super */ "g1fcperiod", /* name */ sizeof(grib_accessor_g1fcperiod), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -103,62 +104,62 @@ grib_accessor_class* grib_accessor_class_g1fcperiod = &_grib_accessor_class_g1fc static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static int unpack_string(grib_accessor* a, char* val, size_t *len) +static int unpack_string(grib_accessor* a, char* val, size_t* len) { long start = 0, theEnd = 0; char tmp[1024]; - int err = grib_g1_step_get_steps(a,&start,&theEnd); + int err = grib_g1_step_get_steps(a, &start, &theEnd); size_t l = 0; - if(err) return err; + if (err) + return err; - sprintf(tmp,"%ld-%ld",start/24,theEnd/24); + sprintf(tmp, "%ld-%ld", start / 24, theEnd / 24); /*printf("---- FCPERIOD %s [start:%g, end:%g]",tmp,start,end);*/ l = strlen(tmp) + 1; - if(*len < l) - { + if (*len < l) { *len = l; return GRIB_BUFFER_TOO_SMALL; } *len = l; - strcpy(val,tmp); + strcpy(val, tmp); return GRIB_SUCCESS; } diff --git a/src/grib_accessor_class_g1forecastmonth.c b/src/grib_accessor_class_g1forecastmonth.c index db1a0241c..2be767e87 100644 --- a/src/grib_accessor_class_g1forecastmonth.c +++ b/src/grib_accessor_class_g1forecastmonth.c @@ -38,68 +38,69 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_g1forecastmonth { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in g1forecastmonth */ - const char* verification_yearmonth; - const char* base_date; - const char* day; - const char* hour; - const char* fcmonth; - const char* check; +typedef struct grib_accessor_g1forecastmonth +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in g1forecastmonth */ + const char* verification_yearmonth; + const char* base_date; + const char* day; + const char* hour; + const char* fcmonth; + const char* check; } grib_accessor_g1forecastmonth; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_g1forecastmonth = { - &grib_accessor_class_long, /* super */ - "g1forecastmonth", /* name */ - sizeof(grib_accessor_g1forecastmonth), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "g1forecastmonth", /* name */ + sizeof(grib_accessor_g1forecastmonth), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -108,60 +109,60 @@ grib_accessor_class* grib_accessor_class_g1forecastmonth = &_grib_accessor_class static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_g1forecastmonth* self = (grib_accessor_g1forecastmonth*)a; - int n = 0; - - self->verification_yearmonth = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->base_date = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->day = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->hour = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->fcmonth = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->check = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); + int n = 0; + + self->verification_yearmonth = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->base_date = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->day = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->hour = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->fcmonth = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->check = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_long(dumper,a,NULL); + grib_dump_long(dumper, a, NULL); } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - int ret=0; + int ret = 0; grib_accessor_g1forecastmonth* self = (grib_accessor_g1forecastmonth*)a; long verification_yearmonth = 0; @@ -175,22 +176,22 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) long byear = 0; long bmonth = 0; - long fcmonth = 0; + long fcmonth = 0; long gribForecastMonth = 0; - long check = 0; + long check = 0; - if ((ret=grib_get_long_internal(grib_handle_of_accessor(a), - self->verification_yearmonth,&verification_yearmonth))!=GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), + self->verification_yearmonth, &verification_yearmonth)) != GRIB_SUCCESS) return ret; - if ((ret=grib_get_long_internal(grib_handle_of_accessor(a), self->base_date,&base_date))!=GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->base_date, &base_date)) != GRIB_SUCCESS) return ret; - if ((ret=grib_get_long_internal(grib_handle_of_accessor(a), self->day,&day))!=GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->day, &day)) != GRIB_SUCCESS) return ret; - if ((ret=grib_get_long_internal(grib_handle_of_accessor(a), self->hour,&hour))!=GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->hour, &hour)) != GRIB_SUCCESS) return ret; - if ((ret=grib_get_long_internal(grib_handle_of_accessor(a), self->fcmonth,&gribForecastMonth))!=GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->fcmonth, &gribForecastMonth)) != GRIB_SUCCESS) return ret; - if ((ret=grib_get_long_internal(grib_handle_of_accessor(a), self->check, &check))!=GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->check, &check)) != GRIB_SUCCESS) return ret; base_yearmonth = base_date / 100; @@ -201,15 +202,16 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) bmonth = base_yearmonth % 100; fcmonth = (vyear - byear) * 12 + (vmonth - bmonth); - if(day == 1 && hour == 0) + if (day == 1 && hour == 0) fcmonth++; - if(gribForecastMonth != 0 && gribForecastMonth!=fcmonth) { + if (gribForecastMonth != 0 && gribForecastMonth != fcmonth) { if (check) { - grib_context_log(a->context,GRIB_LOG_FATAL,"%s=%ld (%s-%s)=%ld",self->fcmonth, - gribForecastMonth,self->base_date,self->verification_yearmonth,fcmonth); + grib_context_log(a->context, GRIB_LOG_FATAL, "%s=%ld (%s-%s)=%ld", self->fcmonth, + gribForecastMonth, self->base_date, self->verification_yearmonth, fcmonth); Assert(gribForecastMonth == fcmonth); - } else { + } + else { *val = gribForecastMonth; return GRIB_SUCCESS; } @@ -221,8 +223,8 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) } /* TODO: Check for a valid date */ -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { grib_accessor_g1forecastmonth* self = (grib_accessor_g1forecastmonth*)a; - return grib_set_long_internal(grib_handle_of_accessor(a),self->fcmonth, *val); + return grib_set_long_internal(grib_handle_of_accessor(a), self->fcmonth, *val); } diff --git a/src/grib_accessor_class_g1monthlydate.c b/src/grib_accessor_class_g1monthlydate.c index df817aa7d..5524a4e18 100644 --- a/src/grib_accessor_class_g1monthlydate.c +++ b/src/grib_accessor_class_g1monthlydate.c @@ -38,62 +38,63 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_long(grib_accessor*, long* val,size_t *len); +static int unpack_long(grib_accessor*, long* val, size_t* len); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_g1monthlydate { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in g1monthlydate */ - const char* date; +typedef struct grib_accessor_g1monthlydate +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in g1monthlydate */ + const char* date; } grib_accessor_g1monthlydate; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_g1monthlydate = { - &grib_accessor_class_long, /* super */ - "g1monthlydate", /* name */ - sizeof(grib_accessor_g1monthlydate), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "g1monthlydate", /* name */ + sizeof(grib_accessor_g1monthlydate), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -102,69 +103,67 @@ grib_accessor_class* grib_accessor_class_g1monthlydate = &_grib_accessor_class_g static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { - grib_accessor_g1monthlydate* self = (grib_accessor_g1monthlydate*)a; - int n = 0; + grib_accessor_g1monthlydate* self = (grib_accessor_g1monthlydate*)a; + int n = 0; - self->date = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + self->date = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_long(dumper,a,NULL); + grib_dump_long(dumper, a, NULL); } -static int unpack_long(grib_accessor* a, long* val, size_t *len) -{ - grib_accessor_g1monthlydate* self = (grib_accessor_g1monthlydate*)a; +static int unpack_long(grib_accessor* a, long* val, size_t* len) +{ + grib_accessor_g1monthlydate* self = (grib_accessor_g1monthlydate*)a; - long date = 0; + long date = 0; - grib_get_long_internal(grib_handle_of_accessor(a), self->date,&date); + grib_get_long_internal(grib_handle_of_accessor(a), self->date, &date); - date /= 100; - date*=100; - date+=1; + date /= 100; + date *= 100; + date += 1; - *val = date; + *val = date; - return GRIB_SUCCESS; + return GRIB_SUCCESS; } - - diff --git a/src/grib_accessor_class_g1number_of_coded_values_sh_complex.c b/src/grib_accessor_class_g1number_of_coded_values_sh_complex.c index 2b9334a3c..e1d524e6b 100644 --- a/src/grib_accessor_class_g1number_of_coded_values_sh_complex.c +++ b/src/grib_accessor_class_g1number_of_coded_values_sh_complex.c @@ -42,68 +42,69 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_long(grib_accessor*, long* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_g1number_of_coded_values_sh_complex { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in g1number_of_coded_values_sh_complex */ - const char* numberOfValues; - const char* bitsPerValue; - const char* offsetBeforeData; - const char* offsetAfterData; - const char* unusedBits; - const char* JS; - const char* KS; - const char* MS; +typedef struct grib_accessor_g1number_of_coded_values_sh_complex +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in g1number_of_coded_values_sh_complex */ + const char* numberOfValues; + const char* bitsPerValue; + const char* offsetBeforeData; + const char* offsetAfterData; + const char* unusedBits; + const char* JS; + const char* KS; + const char* MS; } grib_accessor_g1number_of_coded_values_sh_complex; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_g1number_of_coded_values_sh_complex = { - &grib_accessor_class_long, /* super */ - "g1number_of_coded_values_sh_complex", /* name */ - sizeof(grib_accessor_g1number_of_coded_values_sh_complex), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "g1number_of_coded_values_sh_complex", /* name */ + sizeof(grib_accessor_g1number_of_coded_values_sh_complex), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -112,100 +113,102 @@ grib_accessor_class* grib_accessor_class_g1number_of_coded_values_sh_complex = & static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { - int n=0; + int n = 0; grib_accessor_g1number_of_coded_values_sh_complex* self = (grib_accessor_g1number_of_coded_values_sh_complex*)a; - self->bitsPerValue = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->offsetBeforeData = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->offsetAfterData = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->unusedBits = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->numberOfValues = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->JS = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->KS = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->MS = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + self->bitsPerValue = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->offsetBeforeData = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->offsetAfterData = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->unusedBits = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->numberOfValues = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->JS = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->KS = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->MS = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; - a->length=0; + a->length = 0; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - int ret=GRIB_SUCCESS; - long bpv=0; - long offsetBeforeData=0,offsetAfterData=0,unusedBits=0,numberOfValues; - long JS=0,KS=0,MS=0,NS=0; + int ret = GRIB_SUCCESS; + long bpv = 0; + long offsetBeforeData = 0, offsetAfterData = 0, unusedBits = 0, numberOfValues; + long JS = 0, KS = 0, MS = 0, NS = 0; grib_accessor_g1number_of_coded_values_sh_complex* self = (grib_accessor_g1number_of_coded_values_sh_complex*)a; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->bitsPerValue,&bpv)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->bitsPerValue, &bpv)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetBeforeData,&offsetBeforeData)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetBeforeData, &offsetBeforeData)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetAfterData,&offsetAfterData)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetAfterData, &offsetAfterData)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->unusedBits,&unusedBits)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->unusedBits, &unusedBits)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->JS,&JS)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->JS, &JS)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->KS,&KS)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->KS, &KS)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->MS,&MS)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->MS, &MS)) != GRIB_SUCCESS) return ret; - if (JS != KS || KS != MS) return GRIB_NOT_IMPLEMENTED; + if (JS != KS || KS != MS) + return GRIB_NOT_IMPLEMENTED; - NS=(MS+1)*(MS+2); + NS = (MS + 1) * (MS + 2); - if ( bpv != 0 ) { - DebugAssert( offsetAfterData > offsetBeforeData ); - *val =((offsetAfterData-offsetBeforeData)*8-unusedBits+NS*(bpv-32))/bpv; - } else { - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfValues,&numberOfValues)) != GRIB_SUCCESS) + if (bpv != 0) { + DebugAssert(offsetAfterData > offsetBeforeData); + *val = ((offsetAfterData - offsetBeforeData) * 8 - unusedBits + NS * (bpv - 32)) / bpv; + } + else { + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfValues, &numberOfValues)) != GRIB_SUCCESS) return ret; - *val=numberOfValues; + *val = numberOfValues; } return ret; diff --git a/src/grib_accessor_class_g1number_of_coded_values_sh_simple.c b/src/grib_accessor_class_g1number_of_coded_values_sh_simple.c index 2d651acd2..02a0455c1 100644 --- a/src/grib_accessor_class_g1number_of_coded_values_sh_simple.c +++ b/src/grib_accessor_class_g1number_of_coded_values_sh_simple.c @@ -39,65 +39,66 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_long(grib_accessor*, long* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_g1number_of_coded_values_sh_simple { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in g1number_of_coded_values_sh_simple */ - const char* numberOfValues; - const char* bitsPerValue; - const char* offsetBeforeData; - const char* offsetAfterData; - const char* unusedBits; +typedef struct grib_accessor_g1number_of_coded_values_sh_simple +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in g1number_of_coded_values_sh_simple */ + const char* numberOfValues; + const char* bitsPerValue; + const char* offsetBeforeData; + const char* offsetAfterData; + const char* unusedBits; } grib_accessor_g1number_of_coded_values_sh_simple; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_g1number_of_coded_values_sh_simple = { - &grib_accessor_class_long, /* super */ - "g1number_of_coded_values_sh_simple", /* name */ - sizeof(grib_accessor_g1number_of_coded_values_sh_simple), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "g1number_of_coded_values_sh_simple", /* name */ + sizeof(grib_accessor_g1number_of_coded_values_sh_simple), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -106,83 +107,84 @@ grib_accessor_class* grib_accessor_class_g1number_of_coded_values_sh_simple = &_ static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { - int n=0; + int n = 0; grib_accessor_g1number_of_coded_values_sh_simple* self = (grib_accessor_g1number_of_coded_values_sh_simple*)a; - self->bitsPerValue = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->offsetBeforeData = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->offsetAfterData = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->unusedBits = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->numberOfValues = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + self->bitsPerValue = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->offsetBeforeData = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->offsetAfterData = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->unusedBits = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->numberOfValues = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; - a->length=0; + a->length = 0; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - int ret=GRIB_SUCCESS; - long bpv=0; - long offsetBeforeData=0,offsetAfterData=0,unusedBits=0,numberOfValues; + int ret = GRIB_SUCCESS; + long bpv = 0; + long offsetBeforeData = 0, offsetAfterData = 0, unusedBits = 0, numberOfValues; grib_accessor_g1number_of_coded_values_sh_simple* self = (grib_accessor_g1number_of_coded_values_sh_simple*)a; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->bitsPerValue,&bpv)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->bitsPerValue, &bpv)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetBeforeData,&offsetBeforeData)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetBeforeData, &offsetBeforeData)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetAfterData,&offsetAfterData)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetAfterData, &offsetAfterData)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->unusedBits,&unusedBits)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->unusedBits, &unusedBits)) != GRIB_SUCCESS) return ret; - if ( bpv != 0 ) { - DebugAssert( offsetAfterData > offsetBeforeData ); - *val=((offsetAfterData-offsetBeforeData)*8-unusedBits)/bpv; - } else { - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfValues,&numberOfValues)) != GRIB_SUCCESS) + if (bpv != 0) { + DebugAssert(offsetAfterData > offsetBeforeData); + *val = ((offsetAfterData - offsetBeforeData) * 8 - unusedBits) / bpv; + } + else { + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfValues, &numberOfValues)) != GRIB_SUCCESS) return ret; - *val=numberOfValues; + *val = numberOfValues; } return ret; } diff --git a/src/grib_accessor_class_g1p1p2.c b/src/grib_accessor_class_g1p1p2.c index f819065cf..a8c5c9a16 100644 --- a/src/grib_accessor_class_g1p1p2.c +++ b/src/grib_accessor_class_g1p1p2.c @@ -36,67 +36,68 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int value_count(grib_accessor*,long*); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int value_count(grib_accessor*, long*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_g1p1p2 { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in unsigned */ - long nbytes; - grib_arguments* arg; -/* Members defined in g1p1p2 */ - const char* p1; +typedef struct grib_accessor_g1p1p2 +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in unsigned */ + long nbytes; + grib_arguments* arg; + /* Members defined in g1p1p2 */ + const char* p1; } grib_accessor_g1p1p2; extern grib_accessor_class* grib_accessor_class_unsigned; static grib_accessor_class _grib_accessor_class_g1p1p2 = { - &grib_accessor_class_unsigned, /* super */ + &grib_accessor_class_unsigned, /* super */ "g1p1p2", /* name */ sizeof(grib_accessor_g1p1p2), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -105,78 +106,78 @@ grib_accessor_class* grib_accessor_class_g1p1p2 = &_grib_accessor_class_g1p1p2; static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_g1p1p2* self = (grib_accessor_g1p1p2*)a; - int n = 0; - self->p1 = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); + int n = 0; + self->p1 = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_string(dumper,a,NULL); - + grib_dump_string(dumper, a, NULL); } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - int err=0; - long off=0; + int err = 0; + long off = 0; grib_accessor_g1p1p2* self = (grib_accessor_g1p1p2*)a; - grib_accessor* p1_accessor=grib_find_accessor( grib_handle_of_accessor(a),self->p1); - off = p1_accessor->offset*8; - *val=grib_decode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, &off, 16); + grib_accessor* p1_accessor = grib_find_accessor(grib_handle_of_accessor(a), self->p1); + off = p1_accessor->offset * 8; + *val = grib_decode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, &off, 16); return err; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { - long off=0; - int err=0; + long off = 0; + int err = 0; grib_accessor_g1p1p2* self = (grib_accessor_g1p1p2*)a; - grib_accessor* p1_accessor=grib_find_accessor( grib_handle_of_accessor(a),self->p1); - off = p1_accessor->offset*8; - err = grib_encode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, *val,&off,16); - if (err == GRIB_SUCCESS) len[0] = 1; + grib_accessor* p1_accessor = grib_find_accessor(grib_handle_of_accessor(a), self->p1); + off = p1_accessor->offset * 8; + err = grib_encode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, *val, &off, 16); + if (err == GRIB_SUCCESS) + len[0] = 1; return err; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - *count=1; + *count = 1; return 0; } diff --git a/src/grib_accessor_class_g1param.c b/src/grib_accessor_class_g1param.c index 2eac111b3..c3b0e4687 100644 --- a/src/grib_accessor_class_g1param.c +++ b/src/grib_accessor_class_g1param.c @@ -33,63 +33,64 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_g1param { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in g1param */ - const char* table; - const char* parameter; +typedef struct grib_accessor_g1param +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in g1param */ + const char* table; + const char* parameter; } grib_accessor_g1param; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_g1param = { - &grib_accessor_class_long, /* super */ - "g1param", /* name */ - sizeof(grib_accessor_g1param), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "g1param", /* name */ + sizeof(grib_accessor_g1param), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -98,90 +99,94 @@ grib_accessor_class* grib_accessor_class_g1param = &_grib_accessor_class_g1param static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { - grib_accessor_g1param* self = (grib_accessor_g1param*)a; - int n = 0; - self->parameter = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->table = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); + grib_accessor_g1param* self = (grib_accessor_g1param*)a; + int n = 0; + self->parameter = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->table = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { - grib_accessor_g1param* self = (grib_accessor_g1param*)a; - long parameter = *val % 1000; - long table = *val / 1000; - int err = 0; + grib_accessor_g1param* self = (grib_accessor_g1param*)a; + long parameter = *val % 1000; + long table = *val / 1000; + int err = 0; - if(table == 0) table = 128; + if (table == 0) + table = 128; - err = grib_set_long_internal(grib_handle_of_accessor(a),self->parameter,parameter); - if(err) return err; + err = grib_set_long_internal(grib_handle_of_accessor(a), self->parameter, parameter); + if (err) + return err; - err = grib_set_long_internal(grib_handle_of_accessor(a),self->table,table); - return err; + err = grib_set_long_internal(grib_handle_of_accessor(a), self->table, table); + return err; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) -{ - grib_accessor_g1param* self = (grib_accessor_g1param*)a; - int err = GRIB_SUCCESS; - /* size_t l = 0; */ - long parameter = 0; - long table = 0; +static int unpack_long(grib_accessor* a, long* val, size_t* len) +{ + grib_accessor_g1param* self = (grib_accessor_g1param*)a; + int err = GRIB_SUCCESS; + /* size_t l = 0; */ + long parameter = 0; + long table = 0; - err = grib_get_long_internal(grib_handle_of_accessor(a),self->parameter,¶meter); - if(err) return err; + err = grib_get_long_internal(grib_handle_of_accessor(a), self->parameter, ¶meter); + if (err) + return err; - err = grib_get_long_internal(grib_handle_of_accessor(a),self->table,&table); - if(err) return err; + err = grib_get_long_internal(grib_handle_of_accessor(a), self->table, &table); + if (err) + return err; - if(*len < 1) - return GRIB_BUFFER_TOO_SMALL; + if (*len < 1) + return GRIB_BUFFER_TOO_SMALL; - *len = 1; + *len = 1; - if(table == 128) - *val = parameter; - else - *val = table * 1000 + parameter; + if (table == 128) + *val = parameter; + else + *val = table * 1000 + parameter; - return GRIB_SUCCESS; + return GRIB_SUCCESS; } diff --git a/src/grib_accessor_class_g1step_range.c b/src/grib_accessor_class_g1step_range.c index 0e9a274f0..cd1489c90 100644 --- a/src/grib_accessor_class_g1step_range.c +++ b/src/grib_accessor_class_g1step_range.c @@ -45,79 +45,80 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int pack_string(grib_accessor*, const char*, size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); +static int get_native_type(grib_accessor*); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int pack_string(grib_accessor*, const char*, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); static size_t string_length(grib_accessor*); -static int value_count(grib_accessor*,long*); -static void destroy(grib_context*,grib_accessor*); +static int value_count(grib_accessor*, long*); +static void destroy(grib_context*, grib_accessor*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_g1step_range { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in abstract_long_vector */ - long* v; - long pack_index; - int number_of_elements; -/* Members defined in g1step_range */ - const char* p1; - const char* p2; - const char* timeRangeIndicator; - const char *unit; - const char *step_unit; - const char *stepType; - const char *patch_fp_precip; - int error_on_units; +typedef struct grib_accessor_g1step_range +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in abstract_long_vector */ + long* v; + long pack_index; + int number_of_elements; + /* Members defined in g1step_range */ + const char* p1; + const char* p2; + const char* timeRangeIndicator; + const char* unit; + const char* step_unit; + const char* stepType; + const char* patch_fp_precip; + int error_on_units; } grib_accessor_g1step_range; extern grib_accessor_class* grib_accessor_class_abstract_long_vector; static grib_accessor_class _grib_accessor_class_g1step_range = { - &grib_accessor_class_abstract_long_vector, /* super */ - "g1step_range", /* name */ - sizeof(grib_accessor_g1step_range), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - &string_length, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - &pack_string, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_abstract_long_vector, /* super */ + "g1step_range", /* name */ + sizeof(grib_accessor_g1step_range), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + &destroy, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + &string_length, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + &pack_string, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -126,484 +127,510 @@ grib_accessor_class* grib_accessor_class_g1step_range = &_grib_accessor_class_g1 static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_g1step_range* self = (grib_accessor_g1step_range*)a; - grib_handle* h=grib_handle_of_accessor(a); - int n = 0; - self->p1 = grib_arguments_get_name(h,c,n++); - self->p2 = grib_arguments_get_name(h,c,n++); - self->timeRangeIndicator = grib_arguments_get_name(h,c,n++); - self->unit = grib_arguments_get_name(h,c,n++); - self->step_unit = grib_arguments_get_name(h,c,n++); - self->stepType = grib_arguments_get_name(h,c,n++); - self->patch_fp_precip = grib_arguments_get_name(h,c,n++); - self->error_on_units = 1; - - self->number_of_elements=2; - self->v=(long*)grib_context_malloc_clear(h->context, - sizeof(long)*self->number_of_elements); - self->pack_index=-1; - a->dirty=1; - - a->length=0; + grib_handle* h = grib_handle_of_accessor(a); + int n = 0; + self->p1 = grib_arguments_get_name(h, c, n++); + self->p2 = grib_arguments_get_name(h, c, n++); + self->timeRangeIndicator = grib_arguments_get_name(h, c, n++); + self->unit = grib_arguments_get_name(h, c, n++); + self->step_unit = grib_arguments_get_name(h, c, n++); + self->stepType = grib_arguments_get_name(h, c, n++); + self->patch_fp_precip = grib_arguments_get_name(h, c, n++); + self->error_on_units = 1; + + self->number_of_elements = 2; + self->v = (long*)grib_context_malloc_clear(h->context, + sizeof(long) * self->number_of_elements); + self->pack_index = -1; + a->dirty = 1; + + a->length = 0; } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_string(dumper,a,NULL); + grib_dump_string(dumper, a, NULL); } -static const int u2s1[] = { - 60, /* (0) minutes */ - 3600, /* (1) hour */ - 86400, /* (2) day */ - 2592000, /* (3) month */ - -1, /* (4) */ - -1, /* (5) */ - -1, /* (6) */ - -1, /* (7) */ - -1, /* (8) */ - -1, /* (9) */ - 10800, /* (10) 3 hours */ - 21600, /* (11) 6 hours */ - 43200, /* (12) 12 hours */ - 900, /* (13) 15 minutes */ - 1800, /* (14) 30 minutes */ - 1 /* (15) seconds */ /* See ECC-316 */ +static const int u2s1[] = { + 60, /* (0) minutes */ + 3600, /* (1) hour */ + 86400, /* (2) day */ + 2592000, /* (3) month */ + -1, /* (4) */ + -1, /* (5) */ + -1, /* (6) */ + -1, /* (7) */ + -1, /* (8) */ + -1, /* (9) */ + 10800, /* (10) 3 hours */ + 21600, /* (11) 6 hours */ + 43200, /* (12) 12 hours */ + 900, /* (13) 15 minutes */ + 1800, /* (14) 30 minutes */ + 1 /* (15) seconds */ /* See ECC-316 */ }; static const int units_index[] = { - 1,0,10,11,12,2,0,13,14,15 + 1, 0, 10, 11, 12, 2, 0, 13, 14, 15 }; -static const int u2s[] = { - 60, /* (0) minutes */ - 3600, /* (1) hour */ - 86400, /* (2) day */ - 2592000, /* (3) month */ - -1, /* (4) */ - -1, /* (5) */ - -1, /* (6) */ - -1, /* (7) */ - -1, /* (8) */ - -1, /* (9) */ - 10800, /* (10) 3 hours */ - 21600, /* (11) 6 hours */ - 43200, /* (12) 12 hours */ - 1, /* (13) seconds */ - 900, /* (14) 15 minutes */ - 1800 /* (15) 30 minutes */ +static const int u2s[] = { + 60, /* (0) minutes */ + 3600, /* (1) hour */ + 86400, /* (2) day */ + 2592000, /* (3) month */ + -1, /* (4) */ + -1, /* (5) */ + -1, /* (6) */ + -1, /* (7) */ + -1, /* (8) */ + -1, /* (9) */ + 10800, /* (10) 3 hours */ + 21600, /* (11) 6 hours */ + 43200, /* (12) 12 hours */ + 1, /* (13) seconds */ + 900, /* (14) 15 minutes */ + 1800 /* (15) 30 minutes */ }; -int grib_g1_step_get_steps(grib_accessor* a,long* start,long* theEnd) +int grib_g1_step_get_steps(grib_accessor* a, long* start, long* theEnd) { grib_accessor_g1step_range* self = (grib_accessor_g1step_range*)a; - int err = 0; - long p1 = 0,p2 = 0,unit = 0,timeRangeIndicator=0,timeRangeIndicatorFromStepRange=0; - long step_unit=1; - char stepType[20]={0,}; - size_t stepTypeLen=20; - long newstart,newend; - int factor=1; - long u2sf,u2sf_step_unit; + int err = 0; + long p1 = 0, p2 = 0, unit = 0, timeRangeIndicator = 0, timeRangeIndicatorFromStepRange = 0; + long step_unit = 1; + char stepType[20] = {0,}; + size_t stepTypeLen = 20; + long newstart, newend; + int factor = 1; + long u2sf, u2sf_step_unit; grib_handle* hand = grib_handle_of_accessor(a); if (self->step_unit != NULL) - grib_get_long_internal(hand,self->step_unit,&step_unit); + grib_get_long_internal(hand, self->step_unit, &step_unit); - if (err!=GRIB_SUCCESS) return err; + if (err != GRIB_SUCCESS) + return err; - err = grib_get_long_internal(hand,self->unit,&unit); - if(err) return err; + err = grib_get_long_internal(hand, self->unit, &unit); + if (err) + return err; if (unit == 254) { unit = 15; /* See ECC-316: WMO says 254 is for 'seconds' but we use 15! */ } - err = grib_get_long_internal(hand,self->p1,&p1); - if(err) return err; + err = grib_get_long_internal(hand, self->p1, &p1); + if (err) + return err; - err = grib_get_long_internal(hand,self->p2,&p2); - if(err) return err; + err = grib_get_long_internal(hand, self->p2, &p2); + if (err) + return err; - err = grib_get_long_internal(hand,self->timeRangeIndicator,&timeRangeIndicator); - if(err) return err; + err = grib_get_long_internal(hand, self->timeRangeIndicator, &timeRangeIndicator); + if (err) + return err; /* TODO move to the def file */ - err = grib_get_long(hand,"timeRangeIndicatorFromStepRange",&timeRangeIndicatorFromStepRange); + err = grib_get_long(hand, "timeRangeIndicatorFromStepRange", &timeRangeIndicatorFromStepRange); - if (timeRangeIndicatorFromStepRange==10) timeRangeIndicator=timeRangeIndicatorFromStepRange; + if (timeRangeIndicatorFromStepRange == 10) + timeRangeIndicator = timeRangeIndicatorFromStepRange; if (self->stepType) { - err = grib_get_string_internal(hand,self->stepType,stepType,&stepTypeLen); - if(err) return err; - } else sprintf(stepType,"unknown"); + err = grib_get_string_internal(hand, self->stepType, stepType, &stepTypeLen); + if (err) + return err; + } + else + sprintf(stepType, "unknown"); - *start = p1; + *start = p1; *theEnd = p2; - if (timeRangeIndicator==10) *start = *theEnd = (p1<<8) | (p2<<0); - else if (!strcmp(stepType,"instant")) *start = *theEnd = p1; - else if (!strcmp(stepType,"accum") && timeRangeIndicator==0 ) {*start =0; *theEnd = p1;} + if (timeRangeIndicator == 10) + *start = *theEnd = (p1 << 8) | (p2 << 0); + else if (!strcmp(stepType, "instant")) + *start = *theEnd = p1; + else if (!strcmp(stepType, "accum") && timeRangeIndicator == 0) { + *start = 0; + *theEnd = p1; + } - if (u2s1[unit] == u2s[step_unit] || (*start==0 && *theEnd==0) ) return 0; + if (u2s1[unit] == u2s[step_unit] || (*start == 0 && *theEnd == 0)) + return 0; newstart = (*start) * u2s1[unit]; newend = (*theEnd) * u2s1[unit]; - if (newstart<0 || newend<0) { - factor=60; - u2sf=u2s1[unit]/factor; - if (u2s1[unit] % factor) return GRIB_DECODING_ERROR; - newstart = (*start) * u2sf; - newend = (*theEnd) * u2sf; - u2sf_step_unit=u2s[step_unit]/factor; - if (u2s[step_unit] % factor) return GRIB_DECODING_ERROR; - } else { - u2sf_step_unit=u2s[step_unit]; + if (newstart < 0 || newend < 0) { + factor = 60; + u2sf = u2s1[unit] / factor; + if (u2s1[unit] % factor) + return GRIB_DECODING_ERROR; + newstart = (*start) * u2sf; + newend = (*theEnd) * u2sf; + u2sf_step_unit = u2s[step_unit] / factor; + if (u2s[step_unit] % factor) + return GRIB_DECODING_ERROR; + } + else { + u2sf_step_unit = u2s[step_unit]; } if (newstart % u2sf_step_unit != 0 || newend % u2sf_step_unit != 0) { return GRIB_DECODING_ERROR; - } else { - *start = newstart/u2sf_step_unit; - *theEnd = newend/u2sf_step_unit; + } + else { + *start = newstart / u2sf_step_unit; + *theEnd = newend / u2sf_step_unit; } return 0; } -static int unpack_string(grib_accessor* a, char* val, size_t *len) +static int unpack_string(grib_accessor* a, char* val, size_t* len) { grib_accessor_g1step_range* self = (grib_accessor_g1step_range*)a; char buf[100]; - size_t size=0; - long start=0,theEnd=0; - long timeRangeIndicator=0; + size_t size = 0; + long start = 0, theEnd = 0; + long timeRangeIndicator = 0; long unit; - int err=0; - char stepType[20]={0,}; - size_t stepTypeLen=20; - grib_handle* hand = grib_handle_of_accessor(a); + int err = 0; + char stepType[20] = {0,}; + size_t stepTypeLen = 20; + grib_handle* hand = grib_handle_of_accessor(a); - if ((err=grib_g1_step_get_steps(a,&start,&theEnd))!=GRIB_SUCCESS) { - size_t step_unit_string_len=10; + if ((err = grib_g1_step_get_steps(a, &start, &theEnd)) != GRIB_SUCCESS) { + size_t step_unit_string_len = 10; char step_unit_string[10]; if (self->step_unit != NULL) - grib_get_string(hand,self->step_unit,step_unit_string,&step_unit_string_len); + grib_get_string(hand, self->step_unit, step_unit_string, &step_unit_string_len); else - sprintf(step_unit_string,"h"); + sprintf(step_unit_string, "h"); if (self->error_on_units) { - grib_get_long_internal(hand,self->unit,&unit); - if (unit==254) { - unit=15; /* See ECC-316 */ + grib_get_long_internal(hand, self->unit, &unit); + if (unit == 254) { + unit = 15; /* See ECC-316 */ } - grib_set_long_internal(hand,self->step_unit,unit); - grib_context_log(a->context,GRIB_LOG_ERROR, - "unable to represent the step in %s\n Hint: try changing the step units", - step_unit_string); + grib_set_long_internal(hand, self->step_unit, unit); + grib_context_log(a->context, GRIB_LOG_ERROR, + "unable to represent the step in %s\n Hint: try changing the step units", + step_unit_string); } return err; } - err = grib_get_long_internal(hand,self->timeRangeIndicator,&timeRangeIndicator); - if(err) return err; + err = grib_get_long_internal(hand, self->timeRangeIndicator, &timeRangeIndicator); + if (err) + return err; if (self->stepType) { - err = grib_get_string_internal(hand,self->stepType,stepType,&stepTypeLen); - if(err) return err; - } else sprintf(stepType,"unknown"); + err = grib_get_string_internal(hand, self->stepType, stepType, &stepTypeLen); + if (err) + return err; + } + else + sprintf(stepType, "unknown"); /* Patch for old forecast probabilities */ - if (self->patch_fp_precip) - { + if (self->patch_fp_precip) { start += 24; } - if (strcmp(stepType,"instant") == 0) { - sprintf(buf,"%ld",start); + if (strcmp(stepType, "instant") == 0) { + sprintf(buf, "%ld", start); } - else if ( (strcmp(stepType,"avgfc") == 0) || - (strcmp(stepType,"avgua") == 0) || - (strcmp(stepType,"avgia") == 0) || - (strcmp(stepType,"varins") == 0) ) - { - sprintf(buf,"%ld",start); + else if ((strcmp(stepType, "avgfc") == 0) || + (strcmp(stepType, "avgua") == 0) || + (strcmp(stepType, "avgia") == 0) || + (strcmp(stepType, "varins") == 0)) { + sprintf(buf, "%ld", start); } else if ( - (strcmp(stepType,"accum") == 0) || - (strcmp(stepType,"avg") == 0) || - (strcmp(stepType,"min") == 0) || - (strcmp(stepType,"max") == 0) || - (strcmp(stepType,"rms") == 0) || - (strcmp(stepType,"diff") == 0) || - (strcmp(stepType,"avgas") == 0) || - (strcmp(stepType,"avgad") == 0) || - (strcmp(stepType,"avgid") == 0) || - (strcmp(stepType,"varas") == 0) || - (strcmp(stepType,"varad") == 0) ) - { + (strcmp(stepType, "accum") == 0) || + (strcmp(stepType, "avg") == 0) || + (strcmp(stepType, "min") == 0) || + (strcmp(stepType, "max") == 0) || + (strcmp(stepType, "rms") == 0) || + (strcmp(stepType, "diff") == 0) || + (strcmp(stepType, "avgas") == 0) || + (strcmp(stepType, "avgad") == 0) || + (strcmp(stepType, "avgid") == 0) || + (strcmp(stepType, "varas") == 0) || + (strcmp(stepType, "varad") == 0)) { if (start == theEnd) { - sprintf(buf,"%ld",theEnd); + sprintf(buf, "%ld", theEnd); } - else - { - sprintf(buf,"%ld-%ld",start, theEnd); + else { + sprintf(buf, "%ld-%ld", start, theEnd); } } else { - grib_context_log(a->context,GRIB_LOG_ERROR, "Unknown stepType=[%s] timeRangeIndicator=[%ld]",stepType,timeRangeIndicator); + grib_context_log(a->context, GRIB_LOG_ERROR, "Unknown stepType=[%s] timeRangeIndicator=[%ld]", stepType, timeRangeIndicator); return GRIB_NOT_IMPLEMENTED; } - size=strlen(buf)+1; + size = strlen(buf) + 1; - if (*lenstepType) { - ret = grib_get_string_internal(grib_handle_of_accessor(a),self->stepType,stepType,&stepTypeLen); - if(ret) return ret; - } else sprintf(stepType,"unknown"); + ret = grib_get_string_internal(grib_handle_of_accessor(a), self->stepType, stepType, &stepTypeLen); + if (ret) + return ret; + } + else + sprintf(stepType, "unknown"); - if((ret = grib_set_long_internal(h,"timeRangeIndicatorFromStepRange",-1))) + if ((ret = grib_set_long_internal(h, "timeRangeIndicatorFromStepRange", -1))) return ret; /* don't change timeRangeIndicator when setting step EXCEPT IF instant*/ - if((ret = grib_get_long_internal(h,self->timeRangeIndicator,&timeRangeIndicator))) + if ((ret = grib_get_long_internal(h, self->timeRangeIndicator, &timeRangeIndicator))) return ret; - instant= ( strcmp(stepType,"instant") == 0 ) ? 1 : 0; + instant = (strcmp(stepType, "instant") == 0) ? 1 : 0; - if((ret = grib_get_long_internal(h,self->unit,&unit))) + if ((ret = grib_get_long_internal(h, self->unit, &unit))) return ret; if (unit == 254) { - unit=15; /* See ECC-316 */ + unit = 15; /* See ECC-316 */ } - if(self->step_unit!=NULL && (ret = grib_get_long_internal(h,self->step_unit,&step_unit))) + if (self->step_unit != NULL && (ret = grib_get_long_internal(h, self->step_unit, &step_unit))) return ret; - ounit=unit; + ounit = unit; - start=strtol(val, &p,10); - theEnd=start; - if ( *p!=0 ) theEnd=strtol(++p, &q,10); + start = strtol(val, &p, 10); + theEnd = start; + if (*p != 0) + theEnd = strtol(++p, &q, 10); - if (start==0 && theEnd==0) { - if((ret = grib_set_long_internal(h,self->p1,start)) != GRIB_SUCCESS) + if (start == 0 && theEnd == 0) { + if ((ret = grib_set_long_internal(h, self->p1, start)) != GRIB_SUCCESS) return ret; - ret = grib_set_long_internal(h,self->p2,theEnd); + ret = grib_set_long_internal(h, self->p2, theEnd); return ret; } - end_sec=theEnd*u2s[step_unit]; - start_sec=start*u2s[step_unit]; + end_sec = theEnd * u2s[step_unit]; + start_sec = start * u2s[step_unit]; - if ( ( end_sec > 918000 || start_sec > 918000 ) && - h->context->gribex_mode_on && instant ) { + if ((end_sec > 918000 || start_sec > 918000) && + h->context->gribex_mode_on && instant) { timeRangeIndicator = 10; - if((ret = grib_set_long_internal(h,self->timeRangeIndicator,10))) + if ((ret = grib_set_long_internal(h, self->timeRangeIndicator, 10))) return ret; /* TODO move to the def file*/ - if((ret = grib_set_long_internal(h,"timeRangeIndicatorFromStepRange",10))) + if ((ret = grib_set_long_internal(h, "timeRangeIndicatorFromStepRange", 10))) return ret; } if (timeRangeIndicator == 10) { - long off=0; - grib_accessor* p1_accessor=NULL; - if ( theEnd != start && !h->context->gribex_mode_on) { - if ( h->context->gribex_mode_on==0 ) { - grib_context_log(h->context,GRIB_LOG_ERROR, - "Unable to set %s: end must be equal to start when timeRangeIndicator=10", - a->name); + long off = 0; + grib_accessor* p1_accessor = NULL; + if (theEnd != start && !h->context->gribex_mode_on) { + if (h->context->gribex_mode_on == 0) { + grib_context_log(h->context, GRIB_LOG_ERROR, + "Unable to set %s: end must be equal to start when timeRangeIndicator=10", + a->name); return GRIB_WRONG_STEP; - } else start = theEnd; + } + else + start = theEnd; } - if ((ret=grib_g1_step_apply_units(&start,&theEnd,&step_unit,&P1,&P2,&unit,65535,instant)) - !=GRIB_SUCCESS) { - grib_context_log(h->context,GRIB_LOG_ERROR,"unable to find units to set %s=%s",a->name,val); + if ((ret = grib_g1_step_apply_units(&start, &theEnd, &step_unit, &P1, &P2, &unit, 65535, instant)) != GRIB_SUCCESS) { + grib_context_log(h->context, GRIB_LOG_ERROR, "unable to find units to set %s=%s", a->name, val); return ret; } - p1_accessor=grib_find_accessor( grib_handle_of_accessor(a),self->p1); - if (p1_accessor==NULL) { - grib_context_log(h->context,GRIB_LOG_ERROR,"unable to find accessor %s",self->p1); + p1_accessor = grib_find_accessor(grib_handle_of_accessor(a), self->p1); + if (p1_accessor == NULL) { + grib_context_log(h->context, GRIB_LOG_ERROR, "unable to find accessor %s", self->p1); return GRIB_NOT_FOUND; } - off = p1_accessor->offset*8; - ret = grib_encode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, P1,&off,16); - if (ret!=0) return ret; + off = p1_accessor->offset * 8; + ret = grib_encode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, P1, &off, 16); + if (ret != 0) + return ret; if (ounit != unit) - ret = grib_set_long_internal(h,self->unit,unit); + ret = grib_set_long_internal(h, self->unit, unit); return ret; } - if ( (ret=grib_g1_step_apply_units(&start,&theEnd,&step_unit,&P1,&P2,&unit,255,instant)) - !=GRIB_SUCCESS ) { - + if ((ret = grib_g1_step_apply_units(&start, &theEnd, &step_unit, &P1, &P2, &unit, 255, instant)) != GRIB_SUCCESS) { if (instant || h->context->gribex_mode_on) { - long off=0; - grib_accessor* p1_accessor=NULL; - if((ret = grib_set_long_internal(h,self->timeRangeIndicator,10))) + long off = 0; + grib_accessor* p1_accessor = NULL; + if ((ret = grib_set_long_internal(h, self->timeRangeIndicator, 10))) return ret; /* TODO move to the def file*/ - if((ret = grib_set_long_internal(h,"timeRangeIndicatorFromStepRange",10))) + if ((ret = grib_set_long_internal(h, "timeRangeIndicatorFromStepRange", 10))) return ret; if (theEnd != start && !h->context->gribex_mode_on) { - grib_context_log(h->context,GRIB_LOG_ERROR, - "Unable to set %s: end must be equal to start when timeRangeIndicator=10", - a->name); + grib_context_log(h->context, GRIB_LOG_ERROR, + "Unable to set %s: end must be equal to start when timeRangeIndicator=10", + a->name); return GRIB_WRONG_STEP; - } else start=theEnd; + } + else + start = theEnd; - if ((ret=grib_g1_step_apply_units(&start,&theEnd,&step_unit,&P1,&P2,&unit,65535,instant)) - !=GRIB_SUCCESS) { - grib_context_log(h->context,GRIB_LOG_ERROR,"unable to find units to set %s=%s",a->name,val); + if ((ret = grib_g1_step_apply_units(&start, &theEnd, &step_unit, &P1, &P2, &unit, 65535, instant)) != GRIB_SUCCESS) { + grib_context_log(h->context, GRIB_LOG_ERROR, "unable to find units to set %s=%s", a->name, val); return ret; } - p1_accessor=grib_find_accessor( grib_handle_of_accessor(a),self->p1); - if (p1_accessor==NULL) { - grib_context_log(h->context,GRIB_LOG_ERROR,"unable to find accessor %s",self->p1); + p1_accessor = grib_find_accessor(grib_handle_of_accessor(a), self->p1); + if (p1_accessor == NULL) { + grib_context_log(h->context, GRIB_LOG_ERROR, "unable to find accessor %s", self->p1); return GRIB_NOT_FOUND; } - off = p1_accessor->offset*8; - ret = grib_encode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, P1,&off,16); - if (ret!=0) return ret; + off = p1_accessor->offset * 8; + ret = grib_encode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, P1, &off, 16); + if (ret != 0) + return ret; if (ounit != unit) - ret = grib_set_long_internal(h,self->unit,unit); + ret = grib_set_long_internal(h, self->unit, unit); } return ret; } if (ounit != unit) - if((ret = grib_set_long_internal(h,self->unit,unit)) != GRIB_SUCCESS) + if ((ret = grib_set_long_internal(h, self->unit, unit)) != GRIB_SUCCESS) return ret; - if((ret = grib_set_long_internal(h,self->p1,P1)) != GRIB_SUCCESS) + if ((ret = grib_set_long_internal(h, self->p1, P1)) != GRIB_SUCCESS) return ret; - if((ret = grib_set_long_internal(h,self->p2,P2)) != GRIB_SUCCESS) + if ((ret = grib_set_long_internal(h, self->p2, P2)) != GRIB_SUCCESS) return ret; - self->v[0]=start; - self->v[1]=theEnd; - a->dirty=0; + self->v[0] = start; + self->v[1] = theEnd; + a->dirty = 0; return 0; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - *count=1; + *count = 1; return 0; } @@ -612,108 +639,120 @@ static size_t string_length(grib_accessor* a) return 255; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { char buff[256]; - size_t bufflen=100; - char sval[100] = {0}; - char* p=sval; - size_t svallen=100; + size_t bufflen = 100; + char sval[100] = { 0 }; + char* p = sval; + size_t svallen = 100; grib_accessor_g1step_range* self = (grib_accessor_g1step_range*)a; - char stepType[20]={0,}; - size_t stepTypeLen=20; - long step_unit=0; - int err=0; + char stepType[20] = {0,}; + size_t stepTypeLen = 20; + long step_unit = 0; + int err = 0; if (self->stepType) { - err = grib_get_string_internal(grib_handle_of_accessor(a),self->stepType,stepType,&stepTypeLen); - if(err) return err; - } else sprintf(stepType,"unknown"); + err = grib_get_string_internal(grib_handle_of_accessor(a), self->stepType, stepType, &stepTypeLen); + if (err) + return err; + } + else + sprintf(stepType, "unknown"); - if(self->step_unit!=NULL && (err = grib_get_long_internal(grib_handle_of_accessor(a),self->step_unit,&step_unit))) + if (self->step_unit != NULL && (err = grib_get_long_internal(grib_handle_of_accessor(a), self->step_unit, &step_unit))) return err; switch (self->pack_index) { - case -1 : - self->pack_index=-1; - sprintf(buff,"%ld",*val); - return pack_string( a,buff,&bufflen); - case 0 : - self->pack_index=-1; - self->error_on_units=0; - unpack_string(a,sval,&svallen); - self->error_on_units=1; - while (*p != '-' && *p != '\0' ) p++; - if (*p=='-') { - sprintf(buff,"%ld-%s",*val,++p); - } else { - if (strcmp(stepType,"instant") && strcmp(stepType,"avgd")) { - sprintf(buff,"%ld-%s",*val,sval); - } else { - sprintf(buff,"%ld",*val); + case -1: + self->pack_index = -1; + sprintf(buff, "%ld", *val); + return pack_string(a, buff, &bufflen); + case 0: + self->pack_index = -1; + self->error_on_units = 0; + unpack_string(a, sval, &svallen); + self->error_on_units = 1; + while (*p != '-' && *p != '\0') + p++; + if (*p == '-') { + sprintf(buff, "%ld-%s", *val, ++p); } - } - return pack_string( a,buff,&bufflen); - case 1 : - self->pack_index=-1; - self->error_on_units=0; - unpack_string(a,sval,&svallen); - self->error_on_units=1; - while (*p != '-' && *p != '\0' ) p++; - if (*p=='-') { - *p='\0'; - sprintf(buff,"%s-%ld",sval,*val); - } else { - if (strcmp(stepType,"instant") && strcmp(stepType,"avgd")) { - sprintf(buff,"%s-%ld",sval,*val); - } else { - sprintf(buff,"%ld",*val); + else { + if (strcmp(stepType, "instant") && strcmp(stepType, "avgd")) { + sprintf(buff, "%ld-%s", *val, sval); + } + else { + sprintf(buff, "%ld", *val); + } } - } - return pack_string( a,buff,&bufflen); - default : - Assert(self->pack_index<2); - break; + return pack_string(a, buff, &bufflen); + case 1: + self->pack_index = -1; + self->error_on_units = 0; + unpack_string(a, sval, &svallen); + self->error_on_units = 1; + while (*p != '-' && *p != '\0') + p++; + if (*p == '-') { + *p = '\0'; + sprintf(buff, "%s-%ld", sval, *val); + } + else { + if (strcmp(stepType, "instant") && strcmp(stepType, "avgd")) { + sprintf(buff, "%s-%ld", sval, *val); + } + else { + sprintf(buff, "%ld", *val); + } + } + return pack_string(a, buff, &bufflen); + default: + Assert(self->pack_index < 2); + break; } return GRIB_INTERNAL_ERROR; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_g1step_range* self = (grib_accessor_g1step_range*)a; char buff[100]; - size_t bufflen=100; - long start,theEnd; - char* p=buff; - char* q=NULL; - int err=0; + size_t bufflen = 100; + long start, theEnd; + char* p = buff; + char* q = NULL; + int err = 0; /*TODO implement dirty*/ - if ((err=unpack_string( a,buff,&bufflen))!=GRIB_SUCCESS) + if ((err = unpack_string(a, buff, &bufflen)) != GRIB_SUCCESS) return err; - start=strtol(buff, &p,10); - theEnd=start; - if ( *p!=0 ) theEnd=strtol(++p, &q,10); + start = strtol(buff, &p, 10); + theEnd = start; + if (*p != 0) + theEnd = strtol(++p, &q, 10); - if (self->pack_index==1) *val=start; - else *val=theEnd; + if (self->pack_index == 1) + *val = start; + else + *val = theEnd; - self->v[0]=start; - self->v[1]=theEnd; - a->dirty=0; + self->v[0] = start; + self->v[1] = theEnd; + a->dirty = 0; return 0; } -static int get_native_type(grib_accessor* a) +static int get_native_type(grib_accessor* a) { return GRIB_TYPE_STRING; } -static void destroy(grib_context* c,grib_accessor* a) +static void destroy(grib_context* c, grib_accessor* a) { - grib_accessor_g1step_range *self = (grib_accessor_g1step_range*)a; - grib_context_free(c,self->v); + grib_accessor_g1step_range* self = (grib_accessor_g1step_range*)a; + grib_context_free(c, self->v); } diff --git a/src/grib_accessor_class_g1verificationdate.c b/src/grib_accessor_class_g1verificationdate.c index 550f9e5f2..b5810ad8c 100644 --- a/src/grib_accessor_class_g1verificationdate.c +++ b/src/grib_accessor_class_g1verificationdate.c @@ -35,64 +35,65 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_long(grib_accessor*, long* val,size_t *len); +static int unpack_long(grib_accessor*, long* val, size_t* len); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_g1verificationdate { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in g1verificationdate */ - const char* date; - const char* time; - const char* step; +typedef struct grib_accessor_g1verificationdate +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in g1verificationdate */ + const char* date; + const char* time; + const char* step; } grib_accessor_g1verificationdate; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_g1verificationdate = { - &grib_accessor_class_long, /* super */ - "g1verificationdate", /* name */ - sizeof(grib_accessor_g1verificationdate), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "g1verificationdate", /* name */ + sizeof(grib_accessor_g1verificationdate), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -101,86 +102,89 @@ grib_accessor_class* grib_accessor_class_g1verificationdate = &_grib_accessor_cl static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_g1verificationdate* self = (grib_accessor_g1verificationdate*)a; - int n = 0; + int n = 0; - self->date = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->time = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->step = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); + self->date = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->time = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->step = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_long(dumper,a,NULL); + grib_dump_long(dumper, a, NULL); } -static int unpack_long(grib_accessor* a, long* val, size_t *len) -{ +static int unpack_long(grib_accessor* a, long* val, size_t* len) +{ grib_accessor_g1verificationdate* self = (grib_accessor_g1verificationdate*)a; - int ret=0; - long date = 0; - long time = 0; - long cdate = 0; - long step = 0; - long vtime = 0; - long vdate = 0; - long vd = 0; - - if ((ret=grib_get_long_internal(grib_handle_of_accessor(a), self->date,&date))!=GRIB_SUCCESS) return ret; - if ((ret=grib_get_long_internal(grib_handle_of_accessor(a), self->time,&time))!=GRIB_SUCCESS) return ret; - if ((ret=grib_get_long_internal(grib_handle_of_accessor(a), self->step,&step))!=GRIB_SUCCESS) return ret; + int ret = 0; + long date = 0; + long time = 0; + long cdate = 0; + long step = 0; + long vtime = 0; + long vdate = 0; + long vd = 0; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->date, &date)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->time, &time)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->step, &step)) != GRIB_SUCCESS) + return ret; time /= 100; - cdate = (long)grib_date_to_julian (date); + cdate = (long)grib_date_to_julian(date); vtime = cdate * 24 + time + step; vd = vtime / 24; - vdate = grib_julian_to_date (vd); + vdate = grib_julian_to_date(vd); /* printf("\n********\n date %d, time %d, step %d, vdate: %d, cdate %d, vd %d\n********\n", date, time, step, vdate, cdate, vd); */ - if(*len < 1) + if (*len < 1) return GRIB_ARRAY_TOO_SMALL; - *val = vdate; + *val = vdate; /* fprintf(stdout,"\n********\n %d cdate %d vd %d\n********\n", vdate, cdate, step); */ return GRIB_SUCCESS; diff --git a/src/grib_accessor_class_g2_aerosol.c b/src/grib_accessor_class_g2_aerosol.c index b92cc4f0d..8ed857602 100644 --- a/src/grib_accessor_class_g2_aerosol.c +++ b/src/grib_accessor_class_g2_aerosol.c @@ -34,68 +34,69 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_g2_aerosol { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in unsigned */ - long nbytes; - grib_arguments* arg; -/* Members defined in g2_aerosol */ - const char* productDefinitionTemplateNumber; - const char* stepType; - int optical; +typedef struct grib_accessor_g2_aerosol +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in unsigned */ + long nbytes; + grib_arguments* arg; + /* Members defined in g2_aerosol */ + const char* productDefinitionTemplateNumber; + const char* stepType; + int optical; } grib_accessor_g2_aerosol; extern grib_accessor_class* grib_accessor_class_unsigned; static grib_accessor_class _grib_accessor_class_g2_aerosol = { - &grib_accessor_class_unsigned, /* super */ - "g2_aerosol", /* name */ - sizeof(grib_accessor_g2_aerosol), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_unsigned, /* super */ + "g2_aerosol", /* name */ + sizeof(grib_accessor_g2_aerosol), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -104,81 +105,81 @@ grib_accessor_class* grib_accessor_class_g2_aerosol = &_grib_accessor_class_g2_a static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_g2_aerosol* self = (grib_accessor_g2_aerosol*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int n = 0; + grib_handle* hand = grib_handle_of_accessor(a); + int n = 0; - self->productDefinitionTemplateNumber = grib_arguments_get_name(hand,c,n++); - self->stepType = grib_arguments_get_name(hand,c,n++); - self->optical = grib_arguments_get_long(hand,c,n++); + self->productDefinitionTemplateNumber = grib_arguments_get_name(hand, c, n++); + self->stepType = grib_arguments_get_name(hand, c, n++); + self->optical = grib_arguments_get_long(hand, c, n++); } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - grib_accessor_g2_aerosol* self = (grib_accessor_g2_aerosol*)a; - long productDefinitionTemplateNumber=0; - grib_get_long(grib_handle_of_accessor(a), self->productDefinitionTemplateNumber,&productDefinitionTemplateNumber); + grib_accessor_g2_aerosol* self = (grib_accessor_g2_aerosol*)a; + long productDefinitionTemplateNumber = 0; + grib_get_long(grib_handle_of_accessor(a), self->productDefinitionTemplateNumber, &productDefinitionTemplateNumber); if (self->optical) - *val=grib2_is_PDTN_AerosolOptical(productDefinitionTemplateNumber); + *val = grib2_is_PDTN_AerosolOptical(productDefinitionTemplateNumber); else - *val=grib2_is_PDTN_Aerosol(productDefinitionTemplateNumber); + *val = grib2_is_PDTN_Aerosol(productDefinitionTemplateNumber); return GRIB_SUCCESS; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { - grib_accessor_g2_aerosol* self = (grib_accessor_g2_aerosol*)a; - grib_handle* hand = grib_handle_of_accessor(a); - long productDefinitionTemplateNumber=-1; - long productDefinitionTemplateNumberNew=-1; + grib_accessor_g2_aerosol* self = (grib_accessor_g2_aerosol*)a; + grib_handle* hand = grib_handle_of_accessor(a); + long productDefinitionTemplateNumber = -1; + long productDefinitionTemplateNumberNew = -1; /*long type=-1; long stream=-1;*/ - long eps=-1; - char stepType[15]={0,}; - size_t slen=15; + long eps = -1; + char stepType[15] = {0,}; + size_t slen = 15; /*int aerosol = *val;*/ - int isInstant=0; + int isInstant = 0; /*long derivedForecast=-1;*/ int ret = 0; - if (grib_get_long(hand, self->productDefinitionTemplateNumber,&productDefinitionTemplateNumber)!=GRIB_SUCCESS) + if (grib_get_long(hand, self->productDefinitionTemplateNumber, &productDefinitionTemplateNumber) != GRIB_SUCCESS) return GRIB_SUCCESS; /* @@ -190,26 +191,32 @@ static int pack_long(grib_accessor* a, const long* val, size_t *len) eps = grib2_is_PDTN_EPS(productDefinitionTemplateNumber); - if (!strcmp(stepType,"instant")) isInstant=1; + if (!strcmp(stepType, "instant")) + isInstant = 1; - if ( eps == 1 ) { + if (eps == 1) { if (isInstant) { - productDefinitionTemplateNumberNew=45; - } else { - productDefinitionTemplateNumberNew=47; + productDefinitionTemplateNumberNew = 45; + } + else { + productDefinitionTemplateNumberNew = 47; } - } else { + } + else { if (isInstant) { - productDefinitionTemplateNumberNew=48;/*44 is deprecated*/ - } else { - productDefinitionTemplateNumberNew=46; + productDefinitionTemplateNumberNew = 48; /*44 is deprecated*/ + } + else { + productDefinitionTemplateNumberNew = 46; } } - + if (self->optical) { /* Note: There is no interval based template for optical properties of aerosol! */ - if (eps) productDefinitionTemplateNumberNew = 49; - else productDefinitionTemplateNumberNew = 48; + if (eps) + productDefinitionTemplateNumberNew = 49; + else + productDefinitionTemplateNumberNew = 48; if (!isInstant) { grib_context_log(hand->context, GRIB_LOG_ERROR, "The product definition templates for optical properties of aerosol are for a point-in-time only"); @@ -217,15 +224,15 @@ static int pack_long(grib_accessor* a, const long* val, size_t *len) } if (productDefinitionTemplateNumber != productDefinitionTemplateNumberNew) { - grib_set_long(hand, self->productDefinitionTemplateNumber,productDefinitionTemplateNumberNew); + grib_set_long(hand, self->productDefinitionTemplateNumber, productDefinitionTemplateNumberNew); /*if (derivedForecast>=0) grib_set_long(hand, self->derivedForecast,derivedForecast);*/ } return 0; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - *count=1; + *count = 1; return 0; } diff --git a/src/grib_accessor_class_g2_chemical.c b/src/grib_accessor_class_g2_chemical.c index 72bbe3285..99be283a8 100644 --- a/src/grib_accessor_class_g2_chemical.c +++ b/src/grib_accessor_class_g2_chemical.c @@ -34,68 +34,69 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_g2_chemical { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in unsigned */ - long nbytes; - grib_arguments* arg; -/* Members defined in g2_chemical */ - const char* productDefinitionTemplateNumber; - const char* stepType; - int distribution; +typedef struct grib_accessor_g2_chemical +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in unsigned */ + long nbytes; + grib_arguments* arg; + /* Members defined in g2_chemical */ + const char* productDefinitionTemplateNumber; + const char* stepType; + int distribution; } grib_accessor_g2_chemical; extern grib_accessor_class* grib_accessor_class_unsigned; static grib_accessor_class _grib_accessor_class_g2_chemical = { - &grib_accessor_class_unsigned, /* super */ - "g2_chemical", /* name */ - sizeof(grib_accessor_g2_chemical), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_unsigned, /* super */ + "g2_chemical", /* name */ + sizeof(grib_accessor_g2_chemical), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -104,81 +105,81 @@ grib_accessor_class* grib_accessor_class_g2_chemical = &_grib_accessor_class_g2_ static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_g2_chemical* self = (grib_accessor_g2_chemical*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int n = 0; + grib_handle* hand = grib_handle_of_accessor(a); + int n = 0; - self->productDefinitionTemplateNumber = grib_arguments_get_name(hand,c,n++); - self->stepType = grib_arguments_get_name(hand,c,n++); - self->distribution = grib_arguments_get_long(hand,c,n++); + self->productDefinitionTemplateNumber = grib_arguments_get_name(hand, c, n++); + self->stepType = grib_arguments_get_name(hand, c, n++); + self->distribution = grib_arguments_get_long(hand, c, n++); } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - grib_accessor_g2_chemical* self = (grib_accessor_g2_chemical*)a; - long productDefinitionTemplateNumber=0; - grib_get_long(grib_handle_of_accessor(a), self->productDefinitionTemplateNumber,&productDefinitionTemplateNumber); + grib_accessor_g2_chemical* self = (grib_accessor_g2_chemical*)a; + long productDefinitionTemplateNumber = 0; + grib_get_long(grib_handle_of_accessor(a), self->productDefinitionTemplateNumber, &productDefinitionTemplateNumber); if (self->distribution) - *val=grib2_is_PDTN_ChemicalDistFunc(productDefinitionTemplateNumber); + *val = grib2_is_PDTN_ChemicalDistFunc(productDefinitionTemplateNumber); else - *val=grib2_is_PDTN_Chemical(productDefinitionTemplateNumber); + *val = grib2_is_PDTN_Chemical(productDefinitionTemplateNumber); return GRIB_SUCCESS; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { - grib_accessor_g2_chemical* self = (grib_accessor_g2_chemical*)a; - grib_handle* hand = grib_handle_of_accessor(a); - long productDefinitionTemplateNumber=-1; - long productDefinitionTemplateNumberNew=-1; + grib_accessor_g2_chemical* self = (grib_accessor_g2_chemical*)a; + grib_handle* hand = grib_handle_of_accessor(a); + long productDefinitionTemplateNumber = -1; + long productDefinitionTemplateNumberNew = -1; /*long type=-1; long stream=-1;*/ - long eps=-1; - char stepType[15]={0,}; - size_t slen=15; + long eps = -1; + char stepType[15] = {0,}; + size_t slen = 15; /*int chemical = *val;*/ - int isInstant=0; + int isInstant = 0; /*long derivedForecast=-1;*/ int ret = 0; - if (grib_get_long(hand, self->productDefinitionTemplateNumber,&productDefinitionTemplateNumber)!=GRIB_SUCCESS) + if (grib_get_long(hand, self->productDefinitionTemplateNumber, &productDefinitionTemplateNumber) != GRIB_SUCCESS) return GRIB_SUCCESS; /* @@ -190,32 +191,36 @@ static int pack_long(grib_accessor* a, const long* val, size_t *len) eps = grib2_is_PDTN_EPS(productDefinitionTemplateNumber); - if (!strcmp(stepType,"instant")) isInstant=1; + if (!strcmp(stepType, "instant")) + isInstant = 1; - if ( eps == 1 ) { + if (eps == 1) { if (isInstant) { - productDefinitionTemplateNumberNew = (self->distribution? 58 : 41); - } else { - productDefinitionTemplateNumberNew = (self->distribution? 68 : 43); + productDefinitionTemplateNumberNew = (self->distribution ? 58 : 41); } - } else { + else { + productDefinitionTemplateNumberNew = (self->distribution ? 68 : 43); + } + } + else { if (isInstant) { - productDefinitionTemplateNumberNew = (self->distribution? 57 : 40); - } else { - productDefinitionTemplateNumberNew = (self->distribution? 67 : 42); + productDefinitionTemplateNumberNew = (self->distribution ? 57 : 40); + } + else { + productDefinitionTemplateNumberNew = (self->distribution ? 67 : 42); } } if (productDefinitionTemplateNumber != productDefinitionTemplateNumberNew) { - grib_set_long(hand, self->productDefinitionTemplateNumber,productDefinitionTemplateNumberNew); + grib_set_long(hand, self->productDefinitionTemplateNumber, productDefinitionTemplateNumberNew); /*if (derivedForecast>=0) grib_set_long(hand, self->derivedForecast,derivedForecast);*/ } return 0; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - *count=1; + *count = 1; return 0; } diff --git a/src/grib_accessor_class_g2_eps.c b/src/grib_accessor_class_g2_eps.c index afa962e17..66bd28a54 100644 --- a/src/grib_accessor_class_g2_eps.c +++ b/src/grib_accessor_class_g2_eps.c @@ -41,70 +41,71 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_g2_eps { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in unsigned */ - long nbytes; - grib_arguments* arg; -/* Members defined in g2_eps */ - const char* productDefinitionTemplateNumber; - const char* stream; - const char* type; - const char* stepType; - const char* derivedForecast; +typedef struct grib_accessor_g2_eps +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in unsigned */ + long nbytes; + grib_arguments* arg; + /* Members defined in g2_eps */ + const char* productDefinitionTemplateNumber; + const char* stream; + const char* type; + const char* stepType; + const char* derivedForecast; } grib_accessor_g2_eps; extern grib_accessor_class* grib_accessor_class_unsigned; static grib_accessor_class _grib_accessor_class_g2_eps = { - &grib_accessor_class_unsigned, /* super */ + &grib_accessor_class_unsigned, /* super */ "g2_eps", /* name */ sizeof(grib_accessor_g2_eps), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -113,173 +114,187 @@ grib_accessor_class* grib_accessor_class_g2_eps = &_grib_accessor_class_g2_eps; static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_g2_eps* self = (grib_accessor_g2_eps*)a; - int n = 0; + int n = 0; - self->productDefinitionTemplateNumber = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->type = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->stream = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->stepType = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->derivedForecast = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); + self->productDefinitionTemplateNumber = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->type = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->stream = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->stepType = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->derivedForecast = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - grib_accessor_g2_eps* self = (grib_accessor_g2_eps*)a; - long productDefinitionTemplateNumber=0; + grib_accessor_g2_eps* self = (grib_accessor_g2_eps*)a; + long productDefinitionTemplateNumber = 0; - grib_get_long(grib_handle_of_accessor(a), self->productDefinitionTemplateNumber,&productDefinitionTemplateNumber); + grib_get_long(grib_handle_of_accessor(a), self->productDefinitionTemplateNumber, &productDefinitionTemplateNumber); - *val=0; + *val = 0; if (grib2_is_PDTN_EPS(productDefinitionTemplateNumber)) - *val=1; + *val = 1; return GRIB_SUCCESS; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { - grib_accessor_g2_eps* self = (grib_accessor_g2_eps*)a; - grib_handle* hand=grib_handle_of_accessor(a); - long productDefinitionTemplateNumber=-1; - long productDefinitionTemplateNumberNew=-1; - long type=-1; - long stream=-1; - long chemical=-1; - long aerosol=-1; - char stepType[15]={0,}; - size_t slen=15; - int eps=*val; - int isInstant=0; - long derivedForecast=-1; - - if (grib_get_long(hand, self->productDefinitionTemplateNumber,&productDefinitionTemplateNumber)!=GRIB_SUCCESS) + grib_accessor_g2_eps* self = (grib_accessor_g2_eps*)a; + grib_handle* hand = grib_handle_of_accessor(a); + long productDefinitionTemplateNumber = -1; + long productDefinitionTemplateNumberNew = -1; + long type = -1; + long stream = -1; + long chemical = -1; + long aerosol = -1; + char stepType[15] = {0,}; + size_t slen = 15; + int eps = *val; + int isInstant = 0; + long derivedForecast = -1; + + if (grib_get_long(hand, self->productDefinitionTemplateNumber, &productDefinitionTemplateNumber) != GRIB_SUCCESS) return GRIB_SUCCESS; - grib_get_long(hand, self->type,&type); - grib_get_long(hand, self->stream,&stream); - grib_get_string(hand, self->stepType,stepType,&slen); - if (!strcmp(stepType,"instant")) isInstant=1; - grib_get_long(hand, "is_chemical",&chemical); - grib_get_long(hand, "is_aerosol",&aerosol); - if (chemical==1 && aerosol==1) { - grib_context_log(a->context,GRIB_LOG_ERROR,"Parameter cannot be both chemical and aerosol!"); + grib_get_long(hand, self->type, &type); + grib_get_long(hand, self->stream, &stream); + grib_get_string(hand, self->stepType, stepType, &slen); + if (!strcmp(stepType, "instant")) + isInstant = 1; + grib_get_long(hand, "is_chemical", &chemical); + grib_get_long(hand, "is_aerosol", &aerosol); + if (chemical == 1 && aerosol == 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Parameter cannot be both chemical and aerosol!"); return GRIB_ENCODING_ERROR; } /* eps or stream=(enda or elda or ewla) */ - if ( eps || stream==1030 || stream==1249 || stream==1250 ) { + if (eps || stream == 1030 || stream == 1249 || stream == 1250) { if (isInstant) { /* type=em || type=es */ - if (type==17) { - productDefinitionTemplateNumberNew=2; - derivedForecast=0; - } else if (type==18) { - productDefinitionTemplateNumberNew=2; - derivedForecast=4; - } else { - productDefinitionTemplateNumberNew=1; + if (type == 17) { + productDefinitionTemplateNumberNew = 2; + derivedForecast = 0; + } + else if (type == 18) { + productDefinitionTemplateNumberNew = 2; + derivedForecast = 4; } - } else { + else { + productDefinitionTemplateNumberNew = 1; + } + } + else { /* type=em || type=es */ - if (type==17) { - productDefinitionTemplateNumberNew=12; - derivedForecast=0; - } else if (type==18) { - productDefinitionTemplateNumberNew=12; - derivedForecast=4; - } else { - productDefinitionTemplateNumberNew=11; + if (type == 17) { + productDefinitionTemplateNumberNew = 12; + derivedForecast = 0; + } + else if (type == 18) { + productDefinitionTemplateNumberNew = 12; + derivedForecast = 4; + } + else { + productDefinitionTemplateNumberNew = 11; } } - } else { + } + else { if (isInstant) { - productDefinitionTemplateNumberNew=0; - } else { - productDefinitionTemplateNumberNew=8; + productDefinitionTemplateNumberNew = 0; + } + else { + productDefinitionTemplateNumberNew = 8; } } /* Adjust for chemical species */ - if (chemical==1) { - if ( eps == 1 ) { + if (chemical == 1) { + if (eps == 1) { if (isInstant) { - productDefinitionTemplateNumberNew=41; - } else { - productDefinitionTemplateNumberNew=43; + productDefinitionTemplateNumberNew = 41; } - } else { + else { + productDefinitionTemplateNumberNew = 43; + } + } + else { if (isInstant) { - productDefinitionTemplateNumberNew=40; - } else { - productDefinitionTemplateNumberNew=42; + productDefinitionTemplateNumberNew = 40; + } + else { + productDefinitionTemplateNumberNew = 42; } } } /* Adjust for aerosols */ - if (aerosol==1) { - if ( eps == 1 ) { + if (aerosol == 1) { + if (eps == 1) { if (isInstant) { - productDefinitionTemplateNumberNew=45; - } else { - productDefinitionTemplateNumberNew=47; + productDefinitionTemplateNumberNew = 45; + } + else { + productDefinitionTemplateNumberNew = 47; } - } else { + } + else { if (isInstant) { - productDefinitionTemplateNumberNew=48;/*44 is deprecated*/ - } else { - productDefinitionTemplateNumberNew=46; + productDefinitionTemplateNumberNew = 48; /*44 is deprecated*/ + } + else { + productDefinitionTemplateNumberNew = 46; } } } if (productDefinitionTemplateNumber != productDefinitionTemplateNumberNew) { - grib_set_long(hand, self->productDefinitionTemplateNumber,productDefinitionTemplateNumberNew); - if (derivedForecast>=0) - grib_set_long(hand, self->derivedForecast,derivedForecast); + grib_set_long(hand, self->productDefinitionTemplateNumber, productDefinitionTemplateNumberNew); + if (derivedForecast >= 0) + grib_set_long(hand, self->derivedForecast, derivedForecast); } return 0; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - *count=1; + *count = 1; return 0; } diff --git a/src/grib_accessor_class_g2_mars_labeling.c b/src/grib_accessor_class_g2_mars_labeling.c index ff604bf02..c829751d7 100644 --- a/src/grib_accessor_class_g2_mars_labeling.c +++ b/src/grib_accessor_class_g2_mars_labeling.c @@ -48,74 +48,75 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int pack_string(grib_accessor*, const char*, size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int get_native_type(grib_accessor*); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int pack_string(grib_accessor*, const char*, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_g2_mars_labeling { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in g2_mars_labeling */ - int index; - const char* the_class; - const char* stream; - const char* type; - const char* expver; - const char* typeOfProcessedData; - const char* productDefinitionTemplateNumber; - const char* stepType; - const char* derivedForecast; - const char* typeOfGeneratingProcess; +typedef struct grib_accessor_g2_mars_labeling +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in g2_mars_labeling */ + int index; + const char* the_class; + const char* stream; + const char* type; + const char* expver; + const char* typeOfProcessedData; + const char* productDefinitionTemplateNumber; + const char* stepType; + const char* derivedForecast; + const char* typeOfGeneratingProcess; } grib_accessor_g2_mars_labeling; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_g2_mars_labeling = { - &grib_accessor_class_gen, /* super */ - "g2_mars_labeling", /* name */ - sizeof(grib_accessor_g2_mars_labeling), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - &pack_string, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "g2_mars_labeling", /* name */ + sizeof(grib_accessor_g2_mars_labeling), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + &pack_string, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -124,122 +125,122 @@ grib_accessor_class* grib_accessor_class_g2_mars_labeling = &_grib_accessor_clas static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_g2_mars_labeling* self = (grib_accessor_g2_mars_labeling*)a; - int n = 0; - grib_handle* hand=grib_handle_of_accessor(a); - - self->index = grib_arguments_get_long(hand,c,n++); - self->the_class = grib_arguments_get_name(hand,c,n++); - self->type = grib_arguments_get_name(hand,c,n++); - self->stream = grib_arguments_get_name(hand,c,n++); - self->expver = grib_arguments_get_name(hand,c,n++); - self->typeOfProcessedData = grib_arguments_get_name(hand,c,n++); - self->productDefinitionTemplateNumber = grib_arguments_get_name(hand,c,n++); - self->stepType = grib_arguments_get_name(hand,c,n++); - self->derivedForecast = grib_arguments_get_name(hand,c,n++); - self->typeOfGeneratingProcess = grib_arguments_get_name(hand,c,n++); + int n = 0; + grib_handle* hand = grib_handle_of_accessor(a); + + self->index = grib_arguments_get_long(hand, c, n++); + self->the_class = grib_arguments_get_name(hand, c, n++); + self->type = grib_arguments_get_name(hand, c, n++); + self->stream = grib_arguments_get_name(hand, c, n++); + self->expver = grib_arguments_get_name(hand, c, n++); + self->typeOfProcessedData = grib_arguments_get_name(hand, c, n++); + self->productDefinitionTemplateNumber = grib_arguments_get_name(hand, c, n++); + self->stepType = grib_arguments_get_name(hand, c, n++); + self->derivedForecast = grib_arguments_get_name(hand, c, n++); + self->typeOfGeneratingProcess = grib_arguments_get_name(hand, c, n++); } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_g2_mars_labeling* self = (grib_accessor_g2_mars_labeling*)a; - char* key=NULL; + char* key = NULL; switch (self->index) { - case 0: - key=(char*)self->the_class; - break; - case 1: - key=(char*)self->type; - break; - case 2: - key=(char*)self->stream; - break; - default : - grib_context_log(a->context,GRIB_LOG_ERROR, - "invalid first argument of g2_mars_labeling in %s",a->name); - return GRIB_INTERNAL_ERROR; - break; + case 0: + key = (char*)self->the_class; + break; + case 1: + key = (char*)self->type; + break; + case 2: + key = (char*)self->stream; + break; + default: + grib_context_log(a->context, GRIB_LOG_ERROR, + "invalid first argument of g2_mars_labeling in %s", a->name); + return GRIB_INTERNAL_ERROR; + break; } - return grib_get_long(grib_handle_of_accessor(a), key,val); + return grib_get_long(grib_handle_of_accessor(a), key, val); } -static int unpack_string(grib_accessor* a, char* val, size_t *len) +static int unpack_string(grib_accessor* a, char* val, size_t* len) { grib_accessor_g2_mars_labeling* self = (grib_accessor_g2_mars_labeling*)a; - char* key=NULL; + char* key = NULL; switch (self->index) { - case 0: - key=(char*)self->the_class; - break; - case 1: - key=(char*)self->type; - break; - case 2: - key=(char*)self->stream; - break; - default : - grib_context_log(a->context,GRIB_LOG_ERROR, - "invalid first argument of g2_mars_labeling in %s",a->name); - return GRIB_INTERNAL_ERROR; - break; + case 0: + key = (char*)self->the_class; + break; + case 1: + key = (char*)self->type; + break; + case 2: + key = (char*)self->stream; + break; + default: + grib_context_log(a->context, GRIB_LOG_ERROR, + "invalid first argument of g2_mars_labeling in %s", a->name); + return GRIB_INTERNAL_ERROR; + break; } - return grib_get_string(grib_handle_of_accessor(a), key,val,len); + return grib_get_string(grib_handle_of_accessor(a), key, val, len); } -static int extra_set(grib_accessor* a,long val) +static int extra_set(grib_accessor* a, long val) { - int ret=0; + int ret = 0; grib_accessor_g2_mars_labeling* self = (grib_accessor_g2_mars_labeling*)a; - grib_handle* hand = grib_handle_of_accessor(a); - char stepType[30]={0,}; - size_t stepTypelen=30; - long derivedForecast = -1; + grib_handle* hand = grib_handle_of_accessor(a); + char stepType[30] = {0,}; + size_t stepTypelen = 30; + long derivedForecast = -1; long productDefinitionTemplateNumberNew = -1; long productDefinitionTemplateNumber; - long typeOfProcessedData = -1; + long typeOfProcessedData = -1; long typeOfGeneratingProcess = -1; - int is_eps = -1; - int is_instant = -1; - long is_chemical = 0; - long is_chemical_distfn = 0; - long is_aerosol = 0; - long is_aerosol_optical = 0; + int is_eps = -1; + int is_instant = -1; + long is_chemical = 0; + long is_chemical_distfn = 0; + long is_aerosol = 0; + long is_aerosol_optical = 0; grib_get_long(hand, "is_chemical", &is_chemical); grib_get_long(hand, "is_chemical_distfn", &is_chemical_distfn); @@ -247,299 +248,305 @@ static int extra_set(grib_accessor* a,long val) grib_get_long(hand, "is_aerosol_optical", &is_aerosol_optical); switch (self->index) { - case 0: - /* class */ - return ret; - break; - case 1: - /* type */ - switch (val) { - case 0: /* Unknown (0) */ - typeOfProcessedData=255; - typeOfGeneratingProcess=255; - break; - case 1: /* First guess (fg) */ - case 3: /* Initialised analysis (ia) */ - typeOfProcessedData=0; - typeOfGeneratingProcess=1; + case 0: + /* class */ + return ret; break; - case 2: /* Analysis (an) */ - case 4: /* Oi analysis (oi) */ - case 5: /* 3d variational analysis (3v) */ - case 6: /* 4d variational analysis (4v) */ - case 7: /* 3d variational gradients (3g) */ - case 8: /* 4d variational gradients (4g) */ - case 90: /* Gridded analysis input (gai) */ - typeOfProcessedData=0; - typeOfGeneratingProcess=0; - break; - case 9: /* Forecast (fc) */ - typeOfProcessedData=1; - typeOfGeneratingProcess=2; - break; - case 10: /* Control forecast (cf) */ - typeOfProcessedData=3; - typeOfGeneratingProcess=4; - break; - case 11: /* Perturbed forecast (pf) */ - typeOfProcessedData=4; - typeOfGeneratingProcess=4; - break; - case 12: /* Errors in first guess (ef) */ - case 13: /* Errors in analysis (ea) */ - typeOfProcessedData=255; - typeOfGeneratingProcess=7; - break; - case 14: /* Cluster means (cm) */ - case 15: /* Cluster std deviations (cs) */ - typeOfProcessedData=255; - typeOfGeneratingProcess=4; - break; - case 16: /* Forecast probability (fp) */ - typeOfProcessedData=8; - typeOfGeneratingProcess=5; - break; - case 17: /* Ensemble mean (em) */ - derivedForecast=0; - grib_get_string(hand,self->stepType,stepType,&stepTypelen); - if (!strcmp(stepType,"instant")) { - productDefinitionTemplateNumberNew=2; - } else { - productDefinitionTemplateNumberNew=12; + case 1: + /* type */ + switch (val) { + case 0: /* Unknown (0) */ + typeOfProcessedData = 255; + typeOfGeneratingProcess = 255; + break; + case 1: /* First guess (fg) */ + case 3: /* Initialised analysis (ia) */ + typeOfProcessedData = 0; + typeOfGeneratingProcess = 1; + break; + case 2: /* Analysis (an) */ + case 4: /* Oi analysis (oi) */ + case 5: /* 3d variational analysis (3v) */ + case 6: /* 4d variational analysis (4v) */ + case 7: /* 3d variational gradients (3g) */ + case 8: /* 4d variational gradients (4g) */ + case 90: /* Gridded analysis input (gai) */ + typeOfProcessedData = 0; + typeOfGeneratingProcess = 0; + break; + case 9: /* Forecast (fc) */ + typeOfProcessedData = 1; + typeOfGeneratingProcess = 2; + break; + case 10: /* Control forecast (cf) */ + typeOfProcessedData = 3; + typeOfGeneratingProcess = 4; + break; + case 11: /* Perturbed forecast (pf) */ + typeOfProcessedData = 4; + typeOfGeneratingProcess = 4; + break; + case 12: /* Errors in first guess (ef) */ + case 13: /* Errors in analysis (ea) */ + typeOfProcessedData = 255; + typeOfGeneratingProcess = 7; + break; + case 14: /* Cluster means (cm) */ + case 15: /* Cluster std deviations (cs) */ + typeOfProcessedData = 255; + typeOfGeneratingProcess = 4; + break; + case 16: /* Forecast probability (fp) */ + typeOfProcessedData = 8; + typeOfGeneratingProcess = 5; + break; + case 17: /* Ensemble mean (em) */ + derivedForecast = 0; + grib_get_string(hand, self->stepType, stepType, &stepTypelen); + if (!strcmp(stepType, "instant")) { + productDefinitionTemplateNumberNew = 2; + } + else { + productDefinitionTemplateNumberNew = 12; + } + typeOfProcessedData = 255; + typeOfGeneratingProcess = 4; + break; + case 18: /* Ensemble standard deviation (es) */ + derivedForecast = 4; + grib_get_string(hand, self->stepType, stepType, &stepTypelen); + if (!strcmp(stepType, "instant")) { + productDefinitionTemplateNumberNew = 2; + } + else { + productDefinitionTemplateNumberNew = 12; + } + typeOfProcessedData = 255; + typeOfGeneratingProcess = 4; + break; + case 19: /* Forecast accumulation (fa) */ + case 20: /* Climatology (cl) */ + case 21: /* Climate simulation (si) */ + case 22: /* Climate 30 days simulation (s3) */ + case 23: /* Empirical distribution (ed) */ + case 24: /* Tubes (tu) */ + case 25: /* Flux forcing realtime (ff) */ + case 26: /* Ocean forward (of) */ + case 27: /* Extreme forecast index (efi) */ + case 28: /* Extreme forecast index control (efic)*/ + case 29: /* Probability boundaries (pb) */ + typeOfProcessedData = 255; + typeOfGeneratingProcess = 255; + break; + case 30: /* Event probability (ep) */ + typeOfProcessedData = 8; + typeOfGeneratingProcess = 5; + break; + case 31: /* Bias-corrected forecast (bf) */ + typeOfProcessedData = 1; + typeOfGeneratingProcess = 3; + break; + case 32: /* Climate distribution (cd) */ + case 33: /* 4D analysis increments (4i) */ + case 34: /* Gridded observations (go) */ + case 35: /* Model errors (me) */ + case 36: /* Probability distribution (pd) */ + case 37: /* Cluster information (ci) */ + case 38: /* Shift of Tail (sot) */ + case 40: /* Images (im) */ + case 42: /* Simulated images (sim) */ + typeOfProcessedData = 255; + typeOfGeneratingProcess = 255; + break; + case 43: /* Weighted ensemble mean (wem) */ + case 44: /* Weighted ensemble standard deviation (wes) */ + case 45: /* Cluster representative (cr) */ + case 46: /* Scaled ensemble standard deviation (ses) */ + case 47: /* Time average ensemble mean (taem) */ + case 48: /* Time average ensemble standard deviation (taes) */ + typeOfProcessedData = 255; + typeOfGeneratingProcess = 4; + break; + case 50: /* Sensitivity gradient (sg) */ + case 52: /* Sensitivity forecast (sf) */ + case 60: /* Perturbed analysis (pa) */ + case 61: /* Initial condition perturbation (icp) */ + case 62: /* Singular vector (sv) */ + case 63: /* Adjoint singular vector (as) */ + case 64: /* Signal variance (svar) */ + typeOfProcessedData = 255; + typeOfGeneratingProcess = 255; + break; + case 65: /* Calibration/Validation forecast (cv) */ + typeOfProcessedData = 5; + typeOfGeneratingProcess = 4; + break; + case 70: /* Ocean reanalysis (or) */ + case 71: /* Flux forcing (fx) */ + case 72: /* Fill-up (fu) */ + case 73: /* Simulation forced with observations (sfo) */ + case 80: /* Forecast mean (fcmean) */ + case 81: /* Forecast maximum (fcmax) */ + case 82: /* Forecast minimum (fcmin) */ + case 83: /* Forecast standard deviation (fcstdev) */ + case 86: /* Hindcast climate mean (hcmean) */ + case 87: /* Simulated satellite data */ + case 88: /* Gridded satellite data */ + case 89: /* GFAS analysis */ + typeOfProcessedData = 255; + typeOfGeneratingProcess = 255; + break; + case 84: /* Ensemble mean of temporal mean (emtm) */ + case 85: /* Ensemble standard deviation of temporal mean (estdtm) */ + typeOfProcessedData = 255; + typeOfGeneratingProcess = 4; + break; + default: + grib_context_log(a->context, GRIB_LOG_ERROR, "unknown mars.type %d", (int)val); + return GRIB_ENCODING_ERROR; } - typeOfProcessedData=255; - typeOfGeneratingProcess=4; break; - case 18: /* Ensemble standard deviation (es) */ - derivedForecast=4; - grib_get_string(hand,self->stepType,stepType,&stepTypelen); - if (!strcmp(stepType,"instant")) { - productDefinitionTemplateNumberNew=2; - } else { - productDefinitionTemplateNumberNew=12; + case 2: + /* stream */ + switch (val) { + case 1030: /* enda */ + case 1249: /* elda */ + case 1250: /* ewla */ + is_eps = 1; /* These streams are all for ensembles */ + grib_get_string(hand, self->stepType, stepType, &stepTypelen); + is_instant = (strcmp(stepType, "instant") == 0); + productDefinitionTemplateNumberNew = grib2_select_PDTN( + is_eps, is_instant, + is_chemical, + is_chemical_distfn, + is_aerosol, + is_aerosol_optical); + break; } - typeOfProcessedData=255; - typeOfGeneratingProcess=4; - break; - case 19: /* Forecast accumulation (fa) */ - case 20: /* Climatology (cl) */ - case 21: /* Climate simulation (si) */ - case 22: /* Climate 30 days simulation (s3) */ - case 23: /* Empirical distribution (ed) */ - case 24: /* Tubes (tu) */ - case 25: /* Flux forcing realtime (ff) */ - case 26: /* Ocean forward (of) */ - case 27: /* Extreme forecast index (efi) */ - case 28: /* Extreme forecast index control (efic)*/ - case 29: /* Probability boundaries (pb) */ - typeOfProcessedData=255; - typeOfGeneratingProcess=255; - break; - case 30: /* Event probability (ep) */ - typeOfProcessedData=8; - typeOfGeneratingProcess=5; break; - case 31: /* Bias-corrected forecast (bf) */ - typeOfProcessedData=1; - typeOfGeneratingProcess=3; + default: + grib_context_log(a->context, GRIB_LOG_ERROR, + "invalid first argument of g2_mars_labeling in %s", a->name); + return GRIB_INTERNAL_ERROR; break; - case 32: /* Climate distribution (cd) */ - case 33: /* 4D analysis increments (4i) */ - case 34: /* Gridded observations (go) */ - case 35: /* Model errors (me) */ - case 36: /* Probability distribution (pd) */ - case 37: /* Cluster information (ci) */ - case 38: /* Shift of Tail (sot) */ - case 40: /* Images (im) */ - case 42: /* Simulated images (sim) */ - typeOfProcessedData=255; - typeOfGeneratingProcess=255; - break; - case 43: /* Weighted ensemble mean (wem) */ - case 44: /* Weighted ensemble standard deviation (wes) */ - case 45: /* Cluster representative (cr) */ - case 46: /* Scaled ensemble standard deviation (ses) */ - case 47: /* Time average ensemble mean (taem) */ - case 48: /* Time average ensemble standard deviation (taes) */ - typeOfProcessedData=255; - typeOfGeneratingProcess=4; - break; - case 50: /* Sensitivity gradient (sg) */ - case 52: /* Sensitivity forecast (sf) */ - case 60: /* Perturbed analysis (pa) */ - case 61: /* Initial condition perturbation (icp) */ - case 62: /* Singular vector (sv) */ - case 63: /* Adjoint singular vector (as) */ - case 64: /* Signal variance (svar) */ - typeOfProcessedData=255; - typeOfGeneratingProcess=255; - break; - case 65: /* Calibration/Validation forecast (cv) */ - typeOfProcessedData=5; - typeOfGeneratingProcess=4; - break; - case 70: /* Ocean reanalysis (or) */ - case 71: /* Flux forcing (fx) */ - case 72: /* Fill-up (fu) */ - case 73: /* Simulation forced with observations (sfo) */ - case 80: /* Forecast mean (fcmean) */ - case 81: /* Forecast maximum (fcmax) */ - case 82: /* Forecast minimum (fcmin) */ - case 83: /* Forecast standard deviation (fcstdev) */ - case 86: /* Hindcast climate mean (hcmean) */ - case 87: /* Simulated satellite data */ - case 88: /* Gridded satellite data */ - case 89: /* GFAS analysis */ - typeOfProcessedData=255; - typeOfGeneratingProcess=255; - break; - case 84: /* Ensemble mean of temporal mean (emtm) */ - case 85: /* Ensemble standard deviation of temporal mean (estdtm) */ - typeOfProcessedData=255; - typeOfGeneratingProcess=4; - break; - default : - grib_context_log(a->context,GRIB_LOG_ERROR,"unknown mars.type %d",(int)val); - return GRIB_ENCODING_ERROR; - } - break; - case 2: - /* stream */ - switch (val) { - case 1030: /* enda */ - case 1249: /* elda */ - case 1250: /* ewla */ - is_eps = 1; /* These streams are all for ensembles */ - grib_get_string(hand,self->stepType,stepType,&stepTypelen); - is_instant = ( strcmp(stepType,"instant")==0 ); - productDefinitionTemplateNumberNew = grib2_select_PDTN( - is_eps, is_instant, - is_chemical, - is_chemical_distfn, - is_aerosol, - is_aerosol_optical); - break; - } - break; - default : - grib_context_log(a->context,GRIB_LOG_ERROR, - "invalid first argument of g2_mars_labeling in %s",a->name); - return GRIB_INTERNAL_ERROR; - break; } - if (productDefinitionTemplateNumberNew>=0) { - grib_get_long(hand,self->productDefinitionTemplateNumber,&productDefinitionTemplateNumber); - if (productDefinitionTemplateNumber!=productDefinitionTemplateNumberNew) - grib_set_long(hand,self->productDefinitionTemplateNumber,productDefinitionTemplateNumberNew); + if (productDefinitionTemplateNumberNew >= 0) { + grib_get_long(hand, self->productDefinitionTemplateNumber, &productDefinitionTemplateNumber); + if (productDefinitionTemplateNumber != productDefinitionTemplateNumberNew) + grib_set_long(hand, self->productDefinitionTemplateNumber, productDefinitionTemplateNumberNew); } - if (derivedForecast>=0) { - grib_set_long(hand,self->derivedForecast,derivedForecast); + if (derivedForecast >= 0) { + grib_set_long(hand, self->derivedForecast, derivedForecast); } - if (typeOfProcessedData>0) - grib_set_long(hand,self->typeOfProcessedData,typeOfProcessedData); - if (typeOfGeneratingProcess>0) - grib_set_long(hand,self->typeOfGeneratingProcess,typeOfGeneratingProcess); + if (typeOfProcessedData > 0) + grib_set_long(hand, self->typeOfProcessedData, typeOfProcessedData); + if (typeOfGeneratingProcess > 0) + grib_set_long(hand, self->typeOfGeneratingProcess, typeOfGeneratingProcess); return ret; } -static int pack_string(grib_accessor* a, const char* val, size_t *len) +static int pack_string(grib_accessor* a, const char* val, size_t* len) { grib_accessor_g2_mars_labeling* self = (grib_accessor_g2_mars_labeling*)a; - char* key=NULL; - int ret=0; - long lval=0; + char* key = NULL; + int ret = 0; + long lval = 0; switch (self->index) { - case 0: - key=(char*)self->the_class; - break; - case 1: - key=(char*)self->type; - break; - case 2: - key=(char*)self->stream; - break; - default : - grib_context_log(a->context,GRIB_LOG_ERROR, - "invalid first argument of g2_mars_labeling in %s",a->name); - return GRIB_INTERNAL_ERROR; - break; + case 0: + key = (char*)self->the_class; + break; + case 1: + key = (char*)self->type; + break; + case 2: + key = (char*)self->stream; + break; + default: + grib_context_log(a->context, GRIB_LOG_ERROR, + "invalid first argument of g2_mars_labeling in %s", a->name); + return GRIB_INTERNAL_ERROR; + break; } - ret=grib_set_string(grib_handle_of_accessor(a), key,val,len); - if (ret) return ret; /* failed */ + ret = grib_set_string(grib_handle_of_accessor(a), key, val, len); + if (ret) + return ret; /* failed */ - ret=grib_get_long(grib_handle_of_accessor(a), key,&lval); - if (ret) return ret; /* failed */ + ret = grib_get_long(grib_handle_of_accessor(a), key, &lval); + if (ret) + return ret; /* failed */ - return extra_set(a,lval); + return extra_set(a, lval); } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { grib_accessor_g2_mars_labeling* self = (grib_accessor_g2_mars_labeling*)a; - char* key=NULL; - int ret=0; + char* key = NULL; + int ret = 0; switch (self->index) { - case 0: - key=(char*)self->the_class; - break; - case 1: - key=(char*)self->type; - break; - case 2: - key=(char*)self->stream; - break; - default : - grib_context_log(a->context,GRIB_LOG_ERROR, - "invalid first argument of g2_mars_labeling in %s",a->name); - return GRIB_INTERNAL_ERROR; - break; + case 0: + key = (char*)self->the_class; + break; + case 1: + key = (char*)self->type; + break; + case 2: + key = (char*)self->stream; + break; + default: + grib_context_log(a->context, GRIB_LOG_ERROR, + "invalid first argument of g2_mars_labeling in %s", a->name); + return GRIB_INTERNAL_ERROR; + break; } - ret=grib_set_long(grib_handle_of_accessor(a), key,*val); - if (ret) return ret; /* failed */ + ret = grib_set_long(grib_handle_of_accessor(a), key, *val); + if (ret) + return ret; /* failed */ - return extra_set(a,*val); + return extra_set(a, *val); } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - *count=1; + *count = 1; return 0; } -static int get_native_type(grib_accessor* a) +static int get_native_type(grib_accessor* a) { grib_accessor_g2_mars_labeling* self = (grib_accessor_g2_mars_labeling*)a; - char* key=NULL; - int ret=0; - int type=0; + char* key = NULL; + int ret = 0; + int type = 0; switch (self->index) { - case 0: - key=(char*)self->the_class; - break; - case 1: - key=(char*)self->type; - break; - case 2: - key=(char*)self->stream; - break; - default : - grib_context_log(a->context,GRIB_LOG_ERROR, - "invalid first argument of g2_mars_labeling in %s",a->name); - return GRIB_INTERNAL_ERROR; - break; + case 0: + key = (char*)self->the_class; + break; + case 1: + key = (char*)self->type; + break; + case 2: + key = (char*)self->stream; + break; + default: + grib_context_log(a->context, GRIB_LOG_ERROR, + "invalid first argument of g2_mars_labeling in %s", a->name); + return GRIB_INTERNAL_ERROR; + break; } - ret=grib_get_native_type(grib_handle_of_accessor(a),key,&type); - if (ret) grib_context_log(a->context,GRIB_LOG_ERROR, - "unable to get native type for %s",key); + ret = grib_get_native_type(grib_handle_of_accessor(a), key, &type); + if (ret) + grib_context_log(a->context, GRIB_LOG_ERROR, + "unable to get native type for %s", key); return type; } diff --git a/src/grib_accessor_class_g2bitmap.c b/src/grib_accessor_class_g2bitmap.c index 218288e01..af2b9229b 100644 --- a/src/grib_accessor_class_g2bitmap.c +++ b/src/grib_accessor_class_g2bitmap.c @@ -33,67 +33,68 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_g2bitmap { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in bytes */ -/* Members defined in bitmap */ - const char* tableReference; - const char* missing_value; - const char* offsetbsec; - const char* sLength; -/* Members defined in g2bitmap */ - const char* numberOfValues; +typedef struct grib_accessor_g2bitmap +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in bytes */ + /* Members defined in bitmap */ + const char* tableReference; + const char* missing_value; + const char* offsetbsec; + const char* sLength; + /* Members defined in g2bitmap */ + const char* numberOfValues; } grib_accessor_g2bitmap; extern grib_accessor_class* grib_accessor_class_bitmap; static grib_accessor_class _grib_accessor_class_g2bitmap = { - &grib_accessor_class_bitmap, /* super */ - "g2bitmap", /* name */ - sizeof(grib_accessor_g2bitmap), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_bitmap, /* super */ + "g2bitmap", /* name */ + sizeof(grib_accessor_g2bitmap), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -102,109 +103,107 @@ grib_accessor_class* grib_accessor_class_g2bitmap = &_grib_accessor_class_g2bitm static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ - -static void init(grib_accessor* a, const long len , grib_arguments* arg ) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { + grib_accessor_g2bitmap* self = (grib_accessor_g2bitmap*)a; - grib_accessor_g2bitmap* self = (grib_accessor_g2bitmap*)a; - - self->numberOfValues = grib_arguments_get_name(grib_handle_of_accessor(a),arg,4); + self->numberOfValues = grib_arguments_get_name(grib_handle_of_accessor(a), arg, 4); } -static void grib_set_bit_on( unsigned char* p, long *bitp){ - unsigned char o = 1; - p += (*bitp >> 3); - o <<= 7-((*bitp)%8); - *p |= o; - (*bitp)+=1; +static void grib_set_bit_on(unsigned char* p, long* bitp) +{ + unsigned char o = 1; + p += (*bitp >> 3); + o <<= 7 - ((*bitp) % 8); + *p |= o; + (*bitp) += 1; } -static int pack_double(grib_accessor* a, const double* val,size_t *len){ - grib_accessor_g2bitmap* self = (grib_accessor_g2bitmap*)a; - - size_t tlen; - - unsigned char* buf = NULL; - size_t i; - int err = 0; - long pos = 0; - long bmaplen = 0; - double miss_values = 0; - tlen = (*len+7)/8; - - if((err = grib_get_double_internal(grib_handle_of_accessor(a), self->missing_value, &miss_values)) - != GRIB_SUCCESS) - return err; - - buf = (unsigned char*)grib_context_malloc_clear(a->context,tlen); - if(!buf) return GRIB_OUT_OF_MEMORY; - pos=0; - for(i=0;i<*len;i++) - { - if (val[i] == miss_values) - pos++; - else{ - bmaplen++; - grib_set_bit_on(buf, &pos); - } - } - - if((err = grib_set_long_internal(grib_handle_of_accessor(a), self->numberOfValues,*len )) != GRIB_SUCCESS) { - grib_context_free(a->context,buf); - return err; - } - - grib_buffer_replace(a, buf, tlen,1,1); - - grib_context_free(a->context,buf); - - return GRIB_SUCCESS; +static int pack_double(grib_accessor* a, const double* val, size_t* len) +{ + grib_accessor_g2bitmap* self = (grib_accessor_g2bitmap*)a; + + size_t tlen; + + unsigned char* buf = NULL; + size_t i; + int err = 0; + long pos = 0; + long bmaplen = 0; + double miss_values = 0; + tlen = (*len + 7) / 8; + + if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->missing_value, &miss_values)) != GRIB_SUCCESS) + return err; + + buf = (unsigned char*)grib_context_malloc_clear(a->context, tlen); + if (!buf) + return GRIB_OUT_OF_MEMORY; + pos = 0; + for (i = 0; i < *len; i++) { + if (val[i] == miss_values) + pos++; + else { + bmaplen++; + grib_set_bit_on(buf, &pos); + } + } + + if ((err = grib_set_long_internal(grib_handle_of_accessor(a), self->numberOfValues, *len)) != GRIB_SUCCESS) { + grib_context_free(a->context, buf); + return err; + } + + grib_buffer_replace(a, buf, tlen, 1, 1); + + grib_context_free(a->context, buf); + + return GRIB_SUCCESS; } -static int value_count(grib_accessor* a,long* tlen) +static int value_count(grib_accessor* a, long* tlen) { - grib_accessor_g2bitmap* self = (grib_accessor_g2bitmap*)a; - int err; - *tlen=0; - - err=grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfValues, tlen); - return err; -} + grib_accessor_g2bitmap* self = (grib_accessor_g2bitmap*)a; + int err; + *tlen = 0; + err = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfValues, tlen); + return err; +} diff --git a/src/grib_accessor_class_g2bitmap_present.c b/src/grib_accessor_class_g2bitmap_present.c index c7fc14bec..45eb97cc1 100644 --- a/src/grib_accessor_class_g2bitmap_present.c +++ b/src/grib_accessor_class_g2bitmap_present.c @@ -36,62 +36,63 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_g2bitmap_present { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in g2bitmap_present */ - const char* bitmapIndicator; +typedef struct grib_accessor_g2bitmap_present +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in g2bitmap_present */ + const char* bitmapIndicator; } grib_accessor_g2bitmap_present; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_g2bitmap_present = { - &grib_accessor_class_long, /* super */ - "g2bitmap_present", /* name */ - sizeof(grib_accessor_g2bitmap_present), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "g2bitmap_present", /* name */ + sizeof(grib_accessor_g2bitmap_present), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -100,77 +101,81 @@ grib_accessor_class* grib_accessor_class_g2bitmap_present = &_grib_accessor_clas static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { - int n=0; + int n = 0; grib_accessor_g2bitmap_present* self = (grib_accessor_g2bitmap_present*)a; - self->bitmapIndicator = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); + self->bitmapIndicator = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - a->length=0; + a->length = 0; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - int ret=GRIB_SUCCESS; - long bitmapIndicator=0; + int ret = GRIB_SUCCESS; + long bitmapIndicator = 0; grib_accessor_g2bitmap_present* self = (grib_accessor_g2bitmap_present*)a; - ret = grib_get_long_internal(grib_handle_of_accessor(a), self->bitmapIndicator,&bitmapIndicator); + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->bitmapIndicator, &bitmapIndicator); if (ret) { - if (ret==GRIB_NOT_FOUND) { - *val=0; + if (ret == GRIB_NOT_FOUND) { + *val = 0; return 0; - } else return ret; + } + else + return ret; } - *val=1; - if (bitmapIndicator==255) *val=0; + *val = 1; + if (bitmapIndicator == 255) + *val = 0; - *len=1; + *len = 1; return ret; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { grib_accessor_g2bitmap_present* self = (grib_accessor_g2bitmap_present*)a; - long bitmapIndicator=0; + long bitmapIndicator = 0; - if (*val==0) bitmapIndicator=255; + if (*val == 0) + bitmapIndicator = 255; - return grib_set_long(grib_handle_of_accessor(a),self->bitmapIndicator,bitmapIndicator); + return grib_set_long(grib_handle_of_accessor(a), self->bitmapIndicator, bitmapIndicator); } diff --git a/src/grib_accessor_class_g2date.c b/src/grib_accessor_class_g2date.c index 82c4894a7..00fdf5649 100644 --- a/src/grib_accessor_class_g2date.c +++ b/src/grib_accessor_class_g2date.c @@ -35,66 +35,67 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_g2date { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in g2date */ - const char* century; - const char* year; - const char* month; - const char* day; +typedef struct grib_accessor_g2date +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in g2date */ + const char* century; + const char* year; + const char* month; + const char* day; } grib_accessor_g2date; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_g2date = { - &grib_accessor_class_long, /* super */ - "g2date", /* name */ - sizeof(grib_accessor_g2date), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "g2date", /* name */ + sizeof(grib_accessor_g2date), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -103,95 +104,103 @@ grib_accessor_class* grib_accessor_class_g2date = &_grib_accessor_class_g2date; static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_g2date* self = (grib_accessor_g2date*)a; - int n = 0; + int n = 0; - self->year = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->month = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->day = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); + self->year = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->month = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->day = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_long(dumper,a,NULL); + grib_dump_long(dumper, a, NULL); } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - int ret=0; + int ret = 0; grib_accessor_g2date* self = (grib_accessor_g2date*)a; - long year = 0; + long year = 0; long month = 0; - long day = 0; + long day = 0; - if ((ret=grib_get_long_internal(grib_handle_of_accessor(a), self->day,&day))!=GRIB_SUCCESS) return ret; - if ((ret=grib_get_long_internal(grib_handle_of_accessor(a), self->month,&month))!=GRIB_SUCCESS) return ret; - if ((ret=grib_get_long_internal(grib_handle_of_accessor(a), self->year,&year))!=GRIB_SUCCESS) return ret; + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->day, &day)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->month, &month)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->year, &year)) != GRIB_SUCCESS) + return ret; - if(*len < 1) + if (*len < 1) return GRIB_WRONG_ARRAY_SIZE; - val[0] = year * 10000 + month * 100 + day; + val[0] = year * 10000 + month * 100 + day; return GRIB_SUCCESS; } /* TODO: Check for a valid date */ -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { int ret; - long v = val[0]; + long v = val[0]; grib_accessor_g2date* self = (grib_accessor_g2date*)a; - long year = 0; - long month = 0; - long day = 0; + long year = 0; + long month = 0; + long day = 0; - if(*len != 1) + if (*len != 1) return GRIB_WRONG_ARRAY_SIZE; - year = v / 10000; v %= 10000; - month = v / 100; v %= 100; - day = v; - - if ((ret=grib_set_long_internal(grib_handle_of_accessor(a),self->day,day))!=GRIB_SUCCESS) return ret; - if ((ret=grib_set_long_internal(grib_handle_of_accessor(a),self->month,month))!=GRIB_SUCCESS) return ret; - if ((ret=grib_set_long_internal(grib_handle_of_accessor(a),self->year,year))!=GRIB_SUCCESS) return ret; + year = v / 10000; + v %= 10000; + month = v / 100; + v %= 100; + day = v; + + if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->day, day)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->month, month)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->year, year)) != GRIB_SUCCESS) + return ret; return GRIB_SUCCESS; } diff --git a/src/grib_accessor_class_g2end_step.c b/src/grib_accessor_class_g2end_step.c index 2800373d4..74851f87c 100644 --- a/src/grib_accessor_class_g2end_step.c +++ b/src/grib_accessor_class_g2end_step.c @@ -53,80 +53,81 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_g2end_step { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in g2end_step */ - const char* start_step; - const char* unit; - const char* year; - const char* month; - const char* day; - const char* hour; - const char* minute; - const char* second; - const char* year_of_end_of_interval; - const char* month_of_end_of_interval; - const char* day_of_end_of_interval; - const char* hour_of_end_of_interval; - const char* minute_of_end_of_interval; - const char* second_of_end_of_interval; - const char* coded_unit; - const char* coded_time_range; - const char* typeOfTimeIncrement; - const char* numberOfTimeRange; +typedef struct grib_accessor_g2end_step +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in g2end_step */ + const char* start_step; + const char* unit; + const char* year; + const char* month; + const char* day; + const char* hour; + const char* minute; + const char* second; + const char* year_of_end_of_interval; + const char* month_of_end_of_interval; + const char* day_of_end_of_interval; + const char* hour_of_end_of_interval; + const char* minute_of_end_of_interval; + const char* second_of_end_of_interval; + const char* coded_unit; + const char* coded_time_range; + const char* typeOfTimeIncrement; + const char* numberOfTimeRange; } grib_accessor_g2end_step; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_g2end_step = { - &grib_accessor_class_long, /* super */ - "g2end_step", /* name */ - sizeof(grib_accessor_g2end_step), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "g2end_step", /* name */ + sizeof(grib_accessor_g2end_step), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -135,116 +136,116 @@ grib_accessor_class* grib_accessor_class_g2end_step = &_grib_accessor_class_g2en static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_g2end_step* self = (grib_accessor_g2end_step*)a; - int n = 0; - grib_handle* h = grib_handle_of_accessor(a); - - self->start_step = grib_arguments_get_name(h,c,n++); - self->unit = grib_arguments_get_name(h,c,n++); - - self->year = grib_arguments_get_name(h,c,n++); - self->month = grib_arguments_get_name(h,c,n++); - self->day = grib_arguments_get_name(h,c,n++); - self->hour = grib_arguments_get_name(h,c,n++); - self->minute = grib_arguments_get_name(h,c,n++); - self->second = grib_arguments_get_name(h,c,n++); - - self->year_of_end_of_interval = grib_arguments_get_name(h,c,n++); - self->month_of_end_of_interval = grib_arguments_get_name(h,c,n++); - self->day_of_end_of_interval = grib_arguments_get_name(h,c,n++); - self->hour_of_end_of_interval = grib_arguments_get_name(h,c,n++); - self->minute_of_end_of_interval = grib_arguments_get_name(h,c,n++); - self->second_of_end_of_interval = grib_arguments_get_name(h,c,n++); - - self->coded_unit = grib_arguments_get_name(h,c,n++); - self->coded_time_range = grib_arguments_get_name(h,c,n++); - self->typeOfTimeIncrement = grib_arguments_get_name(h,c,n++); - self->numberOfTimeRange = grib_arguments_get_name(h,c,n++); + int n = 0; + grib_handle* h = grib_handle_of_accessor(a); + + self->start_step = grib_arguments_get_name(h, c, n++); + self->unit = grib_arguments_get_name(h, c, n++); + + self->year = grib_arguments_get_name(h, c, n++); + self->month = grib_arguments_get_name(h, c, n++); + self->day = grib_arguments_get_name(h, c, n++); + self->hour = grib_arguments_get_name(h, c, n++); + self->minute = grib_arguments_get_name(h, c, n++); + self->second = grib_arguments_get_name(h, c, n++); + + self->year_of_end_of_interval = grib_arguments_get_name(h, c, n++); + self->month_of_end_of_interval = grib_arguments_get_name(h, c, n++); + self->day_of_end_of_interval = grib_arguments_get_name(h, c, n++); + self->hour_of_end_of_interval = grib_arguments_get_name(h, c, n++); + self->minute_of_end_of_interval = grib_arguments_get_name(h, c, n++); + self->second_of_end_of_interval = grib_arguments_get_name(h, c, n++); + + self->coded_unit = grib_arguments_get_name(h, c, n++); + self->coded_time_range = grib_arguments_get_name(h, c, n++); + self->typeOfTimeIncrement = grib_arguments_get_name(h, c, n++); + self->numberOfTimeRange = grib_arguments_get_name(h, c, n++); } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_double(dumper,a,NULL); + grib_dump_double(dumper, a, NULL); } -static const int u2s2[] = { - 60, /* (0) minutes */ - 3600, /* (1) hour */ - 86400, /* (2) day */ - 2592000, /* (3) month */ - -1, /* (4) */ - -1, /* (5) */ - -1, /* (6) */ - -1, /* (7) */ - -1, /* (8) */ - -1, /* (9) */ - 10800, /* (10) 3 hours */ - 21600, /* (11) 6 hours */ - 43200, /* (12) 12 hours */ - 1 /* (13) seconds */ +static const int u2s2[] = { + 60, /* (0) minutes */ + 3600, /* (1) hour */ + 86400, /* (2) day */ + 2592000, /* (3) month */ + -1, /* (4) */ + -1, /* (5) */ + -1, /* (6) */ + -1, /* (7) */ + -1, /* (8) */ + -1, /* (9) */ + 10800, /* (10) 3 hours */ + 21600, /* (11) 6 hours */ + 43200, /* (12) 12 hours */ + 1 /* (13) seconds */ }; -static const int u2s[] = { - 60, /* (0) minutes */ - 3600, /* (1) hour */ - 86400, /* (2) day */ - 2592000, /* (3) month */ - -1, /* (4) */ - -1, /* (5) */ - -1, /* (6) */ - -1, /* (7) */ - -1, /* (8) */ - -1, /* (9) */ - 10800, /* (10) 3 hours */ - 21600, /* (11) 6 hours */ - 43200, /* (12) 12 hours */ - 1, /* (13) seconds */ - 900, /* (14) 15 minutes */ - 1800 /* (15) 30 minutes */ +static const int u2s[] = { + 60, /* (0) minutes */ + 3600, /* (1) hour */ + 86400, /* (2) day */ + 2592000, /* (3) month */ + -1, /* (4) */ + -1, /* (5) */ + -1, /* (6) */ + -1, /* (7) */ + -1, /* (8) */ + -1, /* (9) */ + 10800, /* (10) 3 hours */ + 21600, /* (11) 6 hours */ + 43200, /* (12) 12 hours */ + 1, /* (13) seconds */ + 900, /* (14) 15 minutes */ + 1800 /* (15) 30 minutes */ }; /* See GRIB-488 */ static int is_special_expver(grib_handle* h) { - int ret = 0; - char strExpVer[50]={0,}; - size_t slen=50; - ret = grib_get_string(h, "experimentVersionNumber", strExpVer, &slen); + int ret = 0; + char strExpVer[50] = {0,}; + size_t slen = 50; + ret = grib_get_string(h, "experimentVersionNumber", strExpVer, &slen); if (ret == GRIB_SUCCESS && !strcmp(strExpVer, "1605")) { return 1; /* Special case of expVer 1605! */ } @@ -253,17 +254,17 @@ static int is_special_expver(grib_handle* h) } static int convert_time_range( - grib_handle* h, - long stepUnits, /* unit */ - long indicatorOfUnitForTimeRange, /* coded_unit */ - long* lengthOfTimeRange /* coded_time_range */ - ) + grib_handle* h, + long stepUnits, /* unit */ + long indicatorOfUnitForTimeRange, /* coded_unit */ + long* lengthOfTimeRange /* coded_time_range */ +) { Assert(lengthOfTimeRange != NULL); if (indicatorOfUnitForTimeRange != stepUnits) { long u2sf_step_unit; - long coded_time_range_sec = (*lengthOfTimeRange)*u2s2[indicatorOfUnitForTimeRange]; + long coded_time_range_sec = (*lengthOfTimeRange) * u2s2[indicatorOfUnitForTimeRange]; if (coded_time_range_sec < 0) { long u2sf; int factor = 60; @@ -271,14 +272,15 @@ static int convert_time_range( return GRIB_DECODING_ERROR; if (u2s[stepUnits] % factor) return GRIB_DECODING_ERROR; - u2sf = u2s2[indicatorOfUnitForTimeRange]/factor; - coded_time_range_sec = (*lengthOfTimeRange)*u2sf; - u2sf_step_unit = u2s[stepUnits]/factor; - } else { + u2sf = u2s2[indicatorOfUnitForTimeRange] / factor; + coded_time_range_sec = (*lengthOfTimeRange) * u2sf; + u2sf_step_unit = u2s[stepUnits] / factor; + } + else { u2sf_step_unit = u2s[stepUnits]; } if (coded_time_range_sec % u2sf_step_unit != 0) { - grib_context_log(h->context,GRIB_LOG_ERROR,"unable to convert endStep in stepUnits"); + grib_context_log(h->context, GRIB_LOG_ERROR, "unable to convert endStep in stepUnits"); return GRIB_WRONG_STEP_UNIT; } *lengthOfTimeRange = coded_time_range_sec / u2sf_step_unit; @@ -287,10 +289,10 @@ static int convert_time_range( return GRIB_SUCCESS; } -static int unpack_one_time_range(grib_accessor* a, long* val, size_t *len) +static int unpack_one_time_range(grib_accessor* a, long* val, size_t* len) { grib_accessor_g2end_step* self = (grib_accessor_g2end_step*)a; - int err = 0; + int err = 0; long start_step; long unit; long coded_unit; @@ -299,14 +301,20 @@ static int unpack_one_time_range(grib_accessor* a, long* val, size_t *len) grib_handle* h = grib_handle_of_accessor(a); - if((err = grib_get_long_internal(h,self->start_step,&start_step))) return err; - if((err = grib_get_long_internal(h,self->unit,&unit))) return err; - if((err = grib_get_long_internal(h,self->coded_unit,&coded_unit))) return err; - if((err = grib_get_long_internal(h,self->coded_time_range, &coded_time_range))) return err; - if((err = grib_get_long_internal(h,self->typeOfTimeIncrement, &typeOfTimeIncrement))) return err; + if ((err = grib_get_long_internal(h, self->start_step, &start_step))) + return err; + if ((err = grib_get_long_internal(h, self->unit, &unit))) + return err; + if ((err = grib_get_long_internal(h, self->coded_unit, &coded_unit))) + return err; + if ((err = grib_get_long_internal(h, self->coded_time_range, &coded_time_range))) + return err; + if ((err = grib_get_long_internal(h, self->typeOfTimeIncrement, &typeOfTimeIncrement))) + return err; err = convert_time_range(h, unit, coded_unit, &coded_time_range); - if (err != GRIB_SUCCESS) return err; + if (err != GRIB_SUCCESS) + return err; if (typeOfTimeIncrement == 1) { /* See GRIB-488 */ @@ -318,7 +326,8 @@ static int unpack_one_time_range(grib_accessor* a, long* val, size_t *len) } if (add_time_range) { *val = start_step + coded_time_range; - } else { + } + else { *val = start_step; } @@ -326,21 +335,24 @@ static int unpack_one_time_range(grib_accessor* a, long* val, size_t *len) } #define MAX_NUM_TIME_RANGES 16 /* maximum number of time range specifications */ -static int unpack_multiple_time_ranges(grib_accessor* a, long* val, size_t *len) +static int unpack_multiple_time_ranges(grib_accessor* a, long* val, size_t* len) { grib_accessor_g2end_step* self = (grib_accessor_g2end_step*)a; int i = 0, err = 0; - grib_handle* h = grib_handle_of_accessor(a); + grib_handle* h = grib_handle_of_accessor(a); long numberOfTimeRange = 0, unit = 0, start_step = 0; - size_t count = 0; + size_t count = 0; long arr_typeOfTimeIncrement[MAX_NUM_TIME_RANGES] = {0,}; - long arr_coded_unit[MAX_NUM_TIME_RANGES] = {0,}; - long arr_coded_time_range[MAX_NUM_TIME_RANGES] = {0,}; + long arr_coded_unit[MAX_NUM_TIME_RANGES] = {0,}; + long arr_coded_time_range[MAX_NUM_TIME_RANGES] = {0,}; - if((err = grib_get_long_internal(h,self->start_step,&start_step))) return err; - if((err = grib_get_long_internal(h,self->unit,&unit))) return err; - if((err = grib_get_long_internal(h,self->numberOfTimeRange, &numberOfTimeRange))) return err; + if ((err = grib_get_long_internal(h, self->start_step, &start_step))) + return err; + if ((err = grib_get_long_internal(h, self->unit, &unit))) + return err; + if ((err = grib_get_long_internal(h, self->numberOfTimeRange, &numberOfTimeRange))) + return err; if (numberOfTimeRange > MAX_NUM_TIME_RANGES) { grib_context_log(h->context, GRIB_LOG_ERROR, "Too many time range specifications!"); return GRIB_DECODING_ERROR; @@ -348,19 +360,23 @@ static int unpack_multiple_time_ranges(grib_accessor* a, long* val, size_t *len) count = numberOfTimeRange; /* Get the arrays for the N time ranges */ - if ((err = grib_get_long_array(h, self->typeOfTimeIncrement, arr_typeOfTimeIncrement, &count))) return err; - if ((err = grib_get_long_array(h, self->coded_unit, arr_coded_unit, &count))) return err; - if ((err = grib_get_long_array(h, self->coded_time_range, arr_coded_time_range, &count))) return err; + if ((err = grib_get_long_array(h, self->typeOfTimeIncrement, arr_typeOfTimeIncrement, &count))) + return err; + if ((err = grib_get_long_array(h, self->coded_unit, arr_coded_unit, &count))) + return err; + if ((err = grib_get_long_array(h, self->coded_time_range, arr_coded_time_range, &count))) + return err; /* Look in the array of typeOfTimeIncrements for first entry whose typeOfTimeIncrement == 2 */ - for(i=0; icontext, GRIB_LOG_ERROR, - "Cannot calculate endStep. No time range specification with typeOfTimeIncrement = 2"); + "Cannot calculate endStep. No time range specification with typeOfTimeIncrement = 2"); return GRIB_DECODING_ERROR; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_g2end_step* self = (grib_accessor_g2end_step*)a; - int err = 0; + int err = 0; long start_step; long numberOfTimeRange; - grib_handle* h=grib_handle_of_accessor(a); + grib_handle* h = grib_handle_of_accessor(a); - if((err = grib_get_long_internal(h,self->start_step,&start_step))) return err; + if ((err = grib_get_long_internal(h, self->start_step, &start_step))) + return err; /* point in time */ if (self->year == NULL) { - *val=start_step; + *val = start_step; return 0; } Assert(self->numberOfTimeRange); - if((err = grib_get_long_internal(h,self->numberOfTimeRange, &numberOfTimeRange))) return err; + if ((err = grib_get_long_internal(h, self->numberOfTimeRange, &numberOfTimeRange))) + return err; Assert(numberOfTimeRange == 1 || numberOfTimeRange == 2); if (numberOfTimeRange == 1) { - return unpack_one_time_range(a,val,len); - } else { - return unpack_multiple_time_ranges(a,val,len); + return unpack_one_time_range(a, val, len); + } + else { + return unpack_multiple_time_ranges(a, val, len); } } @@ -473,10 +492,10 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) } #endif -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { grib_accessor_g2end_step* self = (grib_accessor_g2end_step*)a; - grib_handle* h=grib_handle_of_accessor(a); + grib_handle* h = grib_handle_of_accessor(a); int err = 0; @@ -488,7 +507,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t *len) long second; long start_step; - long unit,coded_unit; + long unit, coded_unit; long year_of_end_of_interval; long month_of_end_of_interval; long day_of_end_of_interval; @@ -496,67 +515,87 @@ static int pack_long(grib_accessor* a, const long* val, size_t *len) long minute_of_end_of_interval = 0; long second_of_end_of_interval = 0; - long coded_time_range,time_range, typeOfTimeIncrement; + long coded_time_range, time_range, typeOfTimeIncrement; double dend, dstep; /*point in time */ if (self->year == NULL) { - err = grib_set_long_internal(h,self->start_step,*val); + err = grib_set_long_internal(h, self->start_step, *val); return err; } - if((err = grib_get_long_internal(h,self->coded_unit,&coded_unit))) return err; - if((err = grib_get_long_internal(h,self->unit,&unit))) return err; - if((err = grib_get_long_internal(h,self->year,&year))) return err; - if((err = grib_get_long_internal(h,self->month,&month))) return err; - if((err = grib_get_long_internal(h,self->day,&day))) return err; - if((err = grib_get_long_internal(h,self->hour,&hour))) return err; - if((err = grib_get_long_internal(h,self->minute,&minute))) return err; - if((err = grib_get_long_internal(h,self->second,&second))) return err; + if ((err = grib_get_long_internal(h, self->coded_unit, &coded_unit))) + return err; + if ((err = grib_get_long_internal(h, self->unit, &unit))) + return err; + if ((err = grib_get_long_internal(h, self->year, &year))) + return err; + if ((err = grib_get_long_internal(h, self->month, &month))) + return err; + if ((err = grib_get_long_internal(h, self->day, &day))) + return err; + if ((err = grib_get_long_internal(h, self->hour, &hour))) + return err; + if ((err = grib_get_long_internal(h, self->minute, &minute))) + return err; + if ((err = grib_get_long_internal(h, self->second, &second))) + return err; - if((err = grib_get_long_internal(h,self->start_step,&start_step))) return err; - if((err = grib_get_long_internal(h,self->typeOfTimeIncrement, &typeOfTimeIncrement))) return err; + if ((err = grib_get_long_internal(h, self->start_step, &start_step))) + return err; + if ((err = grib_get_long_internal(h, self->typeOfTimeIncrement, &typeOfTimeIncrement))) + return err; - time_range = *val-start_step; + time_range = *val - start_step; - if (time_range<0){ - grib_context_log(h->context,GRIB_LOG_ERROR, - "endStep < startStep (%ld < %ld)",*val,start_step); + if (time_range < 0) { + grib_context_log(h->context, GRIB_LOG_ERROR, + "endStep < startStep (%ld < %ld)", *val, start_step); return GRIB_WRONG_STEP; } - err=grib_datetime_to_julian(year,month,day,hour,minute,second,&dend); - if (err!=GRIB_SUCCESS) return err; + err = grib_datetime_to_julian(year, month, day, hour, minute, second, &dend); + if (err != GRIB_SUCCESS) + return err; - dstep=(((double)(*val))*u2s[unit])/u2s[2]; - dend+=dstep; + dstep = (((double)(*val)) * u2s[unit]) / u2s[2]; + dend += dstep; - err=grib_julian_to_datetime(dend,&year_of_end_of_interval,&month_of_end_of_interval, - &day_of_end_of_interval,&hour_of_end_of_interval, - &minute_of_end_of_interval,&second_of_end_of_interval); - if (err!=GRIB_SUCCESS) return err; + err = grib_julian_to_datetime(dend, &year_of_end_of_interval, &month_of_end_of_interval, + &day_of_end_of_interval, &hour_of_end_of_interval, + &minute_of_end_of_interval, &second_of_end_of_interval); + if (err != GRIB_SUCCESS) + return err; - if((err = grib_set_long_internal(h,self->year_of_end_of_interval, year_of_end_of_interval))) return err; - if((err = grib_set_long_internal(h,self->month_of_end_of_interval, month_of_end_of_interval))) return err; - if((err = grib_set_long_internal(h,self->day_of_end_of_interval, day_of_end_of_interval))) return err; - if((err = grib_set_long_internal(h,self->hour_of_end_of_interval, hour_of_end_of_interval))) return err; - if((err = grib_set_long_internal(h,self->minute_of_end_of_interval, minute_of_end_of_interval))) return err; - if((err = grib_set_long_internal(h,self->second_of_end_of_interval, second_of_end_of_interval))) return err; + if ((err = grib_set_long_internal(h, self->year_of_end_of_interval, year_of_end_of_interval))) + return err; + if ((err = grib_set_long_internal(h, self->month_of_end_of_interval, month_of_end_of_interval))) + return err; + if ((err = grib_set_long_internal(h, self->day_of_end_of_interval, day_of_end_of_interval))) + return err; + if ((err = grib_set_long_internal(h, self->hour_of_end_of_interval, hour_of_end_of_interval))) + return err; + if ((err = grib_set_long_internal(h, self->minute_of_end_of_interval, minute_of_end_of_interval))) + return err; + if ((err = grib_set_long_internal(h, self->second_of_end_of_interval, second_of_end_of_interval))) + return err; - if (time_range*u2s[unit]%u2s2[coded_unit]) { - coded_unit=unit; - if((err = grib_set_long_internal(h,self->coded_unit, coded_unit))) return err; - coded_time_range=time_range; - } else - coded_time_range=(time_range*u2s[unit])/u2s2[coded_unit]; + if (time_range * u2s[unit] % u2s2[coded_unit]) { + coded_unit = unit; + if ((err = grib_set_long_internal(h, self->coded_unit, coded_unit))) + return err; + coded_time_range = time_range; + } + else + coded_time_range = (time_range * u2s[unit]) / u2s2[coded_unit]; if (typeOfTimeIncrement != 1) { /* 1 means "Successive times processed have same forecast time, start time of forecast is incremented" */ /* Note: For this case, length of timeRange is not related to step and so should NOT be used to calculate step */ - if((err = grib_set_long_internal(h,self->coded_time_range, coded_time_range))) return err; + if ((err = grib_set_long_internal(h, self->coded_time_range, coded_time_range))) + return err; } return GRIB_SUCCESS; } - diff --git a/src/grib_accessor_class_g2grid.c b/src/grib_accessor_class_g2grid.c index 279aa33f5..4f98678f7 100644 --- a/src/grib_accessor_class_g2grid.c +++ b/src/grib_accessor_class_g2grid.c @@ -44,70 +44,71 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_g2grid { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in double */ -/* Members defined in g2grid */ - const char* latitude_first; - const char* longitude_first; - const char* latitude_last; - const char* longitude_last; - const char* i_increment; - const char* j_increment; - const char* basic_angle; - const char* sub_division; +typedef struct grib_accessor_g2grid +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in double */ + /* Members defined in g2grid */ + const char* latitude_first; + const char* longitude_first; + const char* latitude_last; + const char* longitude_last; + const char* i_increment; + const char* j_increment; + const char* basic_angle; + const char* sub_division; } grib_accessor_g2grid; extern grib_accessor_class* grib_accessor_class_double; static grib_accessor_class _grib_accessor_class_g2grid = { - &grib_accessor_class_double, /* super */ - "g2grid", /* name */ - sizeof(grib_accessor_g2grid), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_double, /* super */ + "g2grid", /* name */ + sizeof(grib_accessor_g2grid), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -116,121 +117,121 @@ grib_accessor_class* grib_accessor_class_g2grid = &_grib_accessor_class_g2grid; static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_g2grid* self = (grib_accessor_g2grid*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int n = 0; - - self->latitude_first = grib_arguments_get_name(hand,c,n++); - self->longitude_first = grib_arguments_get_name(hand,c,n++); - self->latitude_last = grib_arguments_get_name(hand,c,n++); - self->longitude_last = grib_arguments_get_name(hand,c,n++); - self->i_increment = grib_arguments_get_name(hand,c,n++); - self->j_increment = grib_arguments_get_name(hand,c,n++); - self->basic_angle = grib_arguments_get_name(hand,c,n++); - self->sub_division = grib_arguments_get_name(hand,c,n++); + grib_handle* hand = grib_handle_of_accessor(a); + int n = 0; + + self->latitude_first = grib_arguments_get_name(hand, c, n++); + self->longitude_first = grib_arguments_get_name(hand, c, n++); + self->latitude_last = grib_arguments_get_name(hand, c, n++); + self->longitude_last = grib_arguments_get_name(hand, c, n++); + self->i_increment = grib_arguments_get_name(hand, c, n++); + self->j_increment = grib_arguments_get_name(hand, c, n++); + self->basic_angle = grib_arguments_get_name(hand, c, n++); + self->sub_division = grib_arguments_get_name(hand, c, n++); a->flags |= - GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC | - GRIB_ACCESSOR_FLAG_READ_ONLY ; + GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC | + GRIB_ACCESSOR_FLAG_READ_ONLY; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - *count=6; + *count = 6; return 0; } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { grib_accessor_g2grid* self = (grib_accessor_g2grid*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int ret = 0; + grib_handle* hand = grib_handle_of_accessor(a); + int ret = 0; long basic_angle = 0; long sub_division = 0; - int n = 0; + int n = 0; long v[6]; int i; - if(*len < 6){ + if (*len < 6) { ret = GRIB_ARRAY_TOO_SMALL; return ret; } - if((ret = grib_get_long_internal(hand, self->basic_angle,&basic_angle)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(hand, self->basic_angle, &basic_angle)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(hand, self->sub_division,&sub_division)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(hand, self->sub_division, &sub_division)) != GRIB_SUCCESS) return ret; - if(sub_division == GRIB_MISSING_LONG || sub_division == 0) + if (sub_division == GRIB_MISSING_LONG || sub_division == 0) sub_division = 1000000; - if(basic_angle == 0) + if (basic_angle == 0) basic_angle = 1; n = 0; - if((ret = grib_get_long_internal(hand, self->latitude_first,&v[n++])) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(hand, self->latitude_first, &v[n++])) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(hand, self->longitude_first,&v[n++])) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(hand, self->longitude_first, &v[n++])) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(hand, self->latitude_last,&v[n++])) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(hand, self->latitude_last, &v[n++])) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(hand, self->longitude_last,&v[n++])) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(hand, self->longitude_last, &v[n++])) != GRIB_SUCCESS) return ret; - if(!self->i_increment) v[n++] = GRIB_MISSING_LONG; - else - if((ret = grib_get_long_internal(hand, self->i_increment,&v[n++])) != GRIB_SUCCESS) - return ret; + if (!self->i_increment) + v[n++] = GRIB_MISSING_LONG; + else if ((ret = grib_get_long_internal(hand, self->i_increment, &v[n++])) != GRIB_SUCCESS) + return ret; - if(!self->j_increment) v[n++] = GRIB_MISSING_LONG; - else - if(self->j_increment) - if((ret = grib_get_long_internal(hand, self->j_increment,&v[n++])) != GRIB_SUCCESS) - return ret; + if (!self->j_increment) + v[n++] = GRIB_MISSING_LONG; + else if (self->j_increment) + if ((ret = grib_get_long_internal(hand, self->j_increment, &v[n++])) != GRIB_SUCCESS) + return ret; - for(i = 0 ; i < n ; i++) - if(v[i] == GRIB_MISSING_LONG) + for (i = 0; i < n; i++) + if (v[i] == GRIB_MISSING_LONG) val[i] = GRIB_MISSING_DOUBLE; else val[i] = (double)v[i] / (double)sub_division * (double)basic_angle; @@ -238,38 +239,37 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len) return GRIB_SUCCESS; } -static long gcd(long a,long b) +static long gcd(long a, long b) { - if(b>a) return gcd(b,a); - if(b == 0) return a; - return gcd(b,a%b); + if (b > a) + return gcd(b, a); + if (b == 0) + return a; + return gcd(b, a % b); } -static long lcm(long a,long b) +static long lcm(long a, long b) { - return a*b/gcd(a,b); + return a * b / gcd(a, b); } -static int is_ok(const double* val,long v[6],double basic_angle,double sub_division) +static int is_ok(const double* val, long v[6], double basic_angle, double sub_division) { int i; int ok = 1; - for(i = 0; i < 6 ; i++) - { - if(val[i] == GRIB_MISSING_DOUBLE) + for (i = 0; i < 6; i++) { + if (val[i] == GRIB_MISSING_DOUBLE) v[i] = GRIB_MISSING_LONG; - else - { + else { double d = (val[i] * sub_division) / basic_angle; double e; - d = round(d); /* GRIB-941 */ - v[i] = d; - e = (v[i] * basic_angle) / sub_division ; + d = round(d); /* GRIB-941 */ + v[i] = d; + e = (v[i] * basic_angle) / sub_division; /* if(fabs(e - val[i]) >= 1e-6) */ - if(fabs(e - val[i]) > 0) - { + if (fabs(e - val[i]) > 0) { /* printf("e=%g val=%g diff=%g\n",e,val[i],e-val[i]); */ ok = 0; } @@ -278,105 +278,103 @@ static int is_ok(const double* val,long v[6],double basic_angle,double sub_divis return ok; } -static int trial(const double* val,long v[6],long* basic_angle,long* sub_division) +static int trial(const double* val, long v[6], long* basic_angle, long* sub_division) { int i = 0; long ni, nj; - for(i = 0; i < 6 ; i++) - if(val[i] == GRIB_MISSING_DOUBLE) + for (i = 0; i < 6; i++) + if (val[i] == GRIB_MISSING_DOUBLE) return 0; - if(val[4] == 0) return 0; - if(val[5] == 0) return 0; + if (val[4] == 0) + return 0; + if (val[5] == 0) + return 0; - ni = (long)(0.5+fabs((val[0] - val[2])/val[4])) + 1; - nj = (long)(0.5+fabs((val[1] - val[3])/val[5])) + 1; + ni = (long)(0.5 + fabs((val[0] - val[2]) / val[4])) + 1; + nj = (long)(0.5 + fabs((val[1] - val[3]) / val[5])) + 1; *basic_angle = 360; - *sub_division = lcm(ni,nj); + *sub_division = lcm(ni, nj); #if 0 printf("ni = %ld, nj = %ld , basic_angle=%ld sub_division = %ld\n", ni,nj, *basic_angle,*sub_division); #endif - if(*sub_division < 0) + if (*sub_division < 0) return 0; Assert(*sub_division >= 0); - return is_ok(val,v,*basic_angle,*sub_division); + return is_ok(val, v, *basic_angle, *sub_division); } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { grib_accessor_g2grid* self = (grib_accessor_g2grid*)a; - grib_handle* hand = grib_handle_of_accessor(a); + grib_handle* hand = grib_handle_of_accessor(a); int ret; long v[6]; int n; long basic_angle; long sub_division; - if(*len < 6){ + if (*len < 6) { ret = GRIB_ARRAY_TOO_SMALL; return ret; } /* printf("pack_double %g %g %g %g %g %g\n",val[0],val[1],val[2],val[3],val[4],val[5]);*/ - if(is_ok(val,v,1,1000000)) - { - basic_angle = 1; + if (is_ok(val, v, 1, 1000000)) { + basic_angle = 1; sub_division = 1000000; } - else if(trial(val,v,&basic_angle,&sub_division)) - { + else if (trial(val, v, &basic_angle, &sub_division)) { } - else - { + else { basic_angle = 1; sub_division = 1000000; - if(!is_ok(val,v,basic_angle,sub_division)) - grib_context_log(a->context,GRIB_LOG_DEBUG,"Grid cannot be coded with any loss of precision"); + if (!is_ok(val, v, basic_angle, sub_division)) + grib_context_log(a->context, GRIB_LOG_DEBUG, "Grid cannot be coded with any loss of precision"); } - if(basic_angle == 1 && sub_division == 1000000) - { - basic_angle = 0; + if (basic_angle == 1 && sub_division == 1000000) { + basic_angle = 0; sub_division = GRIB_MISSING_LONG; } - if((ret = grib_set_long_internal(hand, self->basic_angle,basic_angle)) != GRIB_SUCCESS) + if ((ret = grib_set_long_internal(hand, self->basic_angle, basic_angle)) != GRIB_SUCCESS) return ret; - if((ret = grib_set_long_internal(hand, self->sub_division,sub_division)) != GRIB_SUCCESS) + if ((ret = grib_set_long_internal(hand, self->sub_division, sub_division)) != GRIB_SUCCESS) return ret; n = 0; - if((ret = grib_set_long_internal(hand, self->latitude_first,v[n++])) != GRIB_SUCCESS) + if ((ret = grib_set_long_internal(hand, self->latitude_first, v[n++])) != GRIB_SUCCESS) return ret; - if((ret = grib_set_long_internal(hand, self->longitude_first,v[n++])) != GRIB_SUCCESS) + if ((ret = grib_set_long_internal(hand, self->longitude_first, v[n++])) != GRIB_SUCCESS) return ret; - if((ret = grib_set_long_internal(hand, self->latitude_last,v[n++])) != GRIB_SUCCESS) + if ((ret = grib_set_long_internal(hand, self->latitude_last, v[n++])) != GRIB_SUCCESS) return ret; - if((ret = grib_set_long_internal(hand, self->longitude_last,v[n++])) != GRIB_SUCCESS) + if ((ret = grib_set_long_internal(hand, self->longitude_last, v[n++])) != GRIB_SUCCESS) return ret; - if(!self->i_increment) n++; - else - if((ret = grib_set_long_internal(hand, self->i_increment,v[n++])) != GRIB_SUCCESS) - return ret; + if (!self->i_increment) + n++; + else if ((ret = grib_set_long_internal(hand, self->i_increment, v[n++])) != GRIB_SUCCESS) + return ret; - if(!self->j_increment) n++; - else - if((ret = grib_set_long_internal(hand, self->j_increment,v[n++])) != GRIB_SUCCESS) - return ret; + if (!self->j_increment) + n++; + else if ((ret = grib_set_long_internal(hand, self->j_increment, v[n++])) != GRIB_SUCCESS) + return ret; return GRIB_SUCCESS; } diff --git a/src/grib_accessor_class_g2latlon.c b/src/grib_accessor_class_g2latlon.c index ff7441c6f..5e62f4d43 100644 --- a/src/grib_accessor_class_g2latlon.c +++ b/src/grib_accessor_class_g2latlon.c @@ -41,64 +41,65 @@ or edit "accessor.class" and rerun ./make_class.pl static int pack_missing(grib_accessor*); static int is_missing(grib_accessor*); -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_g2latlon { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in double */ -/* Members defined in g2latlon */ - const char* grid; - int index; - const char* given; +typedef struct grib_accessor_g2latlon +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in double */ + /* Members defined in g2latlon */ + const char* grid; + int index; + const char* given; } grib_accessor_g2latlon; extern grib_accessor_class* grib_accessor_class_double; static grib_accessor_class _grib_accessor_class_g2latlon = { - &grib_accessor_class_double, /* super */ - "g2latlon", /* name */ - sizeof(grib_accessor_g2latlon), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - &pack_missing, /* grib_pack procedures long */ - &is_missing, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_double, /* super */ + "g2latlon", /* name */ + sizeof(grib_accessor_g2latlon), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + &pack_missing, /* grib_pack procedures long */ + &is_missing, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -107,73 +108,72 @@ grib_accessor_class* grib_accessor_class_g2latlon = &_grib_accessor_class_g2latl static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_g2latlon* self = (grib_accessor_g2latlon*)a; - int n = 0; + int n = 0; - self->grid = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->index = grib_arguments_get_long(grib_handle_of_accessor(a),c,n++); - self->given = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); + self->grid = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->index = grib_arguments_get_long(grib_handle_of_accessor(a), c, n++); + self->given = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { grib_accessor_g2latlon* self = (grib_accessor_g2latlon*)a; - int ret = 0; + int ret = 0; - long given = 1; + long given = 1; double grid[6]; size_t size = 6; - if(*len < 1){ + if (*len < 1) { ret = GRIB_ARRAY_TOO_SMALL; return ret; } - if(self->given) - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->given,&given)) != GRIB_SUCCESS) + if (self->given) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->given, &given)) != GRIB_SUCCESS) return ret; - if(!given) - { - *val = GRIB_MISSING_DOUBLE; + if (!given) { + *val = GRIB_MISSING_DOUBLE; return GRIB_SUCCESS; } - if((ret = grib_get_double_array_internal(grib_handle_of_accessor(a), self->grid,grid,&size)) != GRIB_SUCCESS) + if ((ret = grib_get_double_array_internal(grib_handle_of_accessor(a), self->grid, grid, &size)) != GRIB_SUCCESS) return ret; *val = grid[self->index]; @@ -184,65 +184,67 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len) static double normalise_longitude(double a_lon) { /* WMO regulation: The longitude values shall be limited to the range 0 to 360 degrees inclusive */ - while (a_lon<0) a_lon += 360; - while (a_lon>360) a_lon -= 360; + while (a_lon < 0) + a_lon += 360; + while (a_lon > 360) + a_lon -= 360; return a_lon; } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { grib_accessor_g2latlon* self = (grib_accessor_g2latlon*)a; - int ret = 0; + int ret = 0; double grid[6]; - size_t size = 6; + size_t size = 6; double new_val = *val; - if(*len < 1){ + if (*len < 1) { ret = GRIB_ARRAY_TOO_SMALL; return ret; } - if(self->given) - { + if (self->given) { long given = *val != GRIB_MISSING_DOUBLE; - if((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->given,given)) != GRIB_SUCCESS) + if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->given, given)) != GRIB_SUCCESS) return ret; } - if((ret = grib_get_double_array_internal(grib_handle_of_accessor(a), self->grid,grid,&size)) != GRIB_SUCCESS) + if ((ret = grib_get_double_array_internal(grib_handle_of_accessor(a), self->grid, grid, &size)) != GRIB_SUCCESS) return ret; /* index 1 is longitudeOfFirstGridPointInDegrees * index 3 is longitudeOfLastGridPointInDegrees */ - if ( (self->index == 1 || self->index == 3) ) { + if ((self->index == 1 || self->index == 3)) { new_val = normalise_longitude(*val); } grid[self->index] = new_val; - return grib_set_double_array_internal(grib_handle_of_accessor(a), self->grid,grid,size); + return grib_set_double_array_internal(grib_handle_of_accessor(a), self->grid, grid, size); } static int pack_missing(grib_accessor* a) { grib_accessor_g2latlon* self = (grib_accessor_g2latlon*)a; - double missing = GRIB_MISSING_DOUBLE; - size_t size = 1; + double missing = GRIB_MISSING_DOUBLE; + size_t size = 1; - if(!self->given) + if (!self->given) return GRIB_NOT_IMPLEMENTED; - return pack_double(a,&missing,&size); + return pack_double(a, &missing, &size); } static int is_missing(grib_accessor* a) { grib_accessor_g2latlon* self = (grib_accessor_g2latlon*)a; - long given = 1; + long given = 1; - if(self->given) grib_get_long_internal(grib_handle_of_accessor(a), self->given,&given); + if (self->given) + grib_get_long_internal(grib_handle_of_accessor(a), self->given, &given); return !given; diff --git a/src/grib_accessor_class_g2level.c b/src/grib_accessor_class_g2level.c index 035d4b141..9be8ed369 100644 --- a/src/grib_accessor_class_g2level.c +++ b/src/grib_accessor_class_g2level.c @@ -37,68 +37,69 @@ or edit "accessor.class" and rerun ./make_class.pl */ static int is_missing(grib_accessor*); -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_g2level { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in g2level */ - const char* type_first; - const char* scale_first; - const char* value_first; - const char* pressure_units; +typedef struct grib_accessor_g2level +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in g2level */ + const char* type_first; + const char* scale_first; + const char* value_first; + const char* pressure_units; } grib_accessor_g2level; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_g2level = { - &grib_accessor_class_long, /* super */ - "g2level", /* name */ - sizeof(grib_accessor_g2level), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - &is_missing, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "g2level", /* name */ + sizeof(grib_accessor_g2level), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + &is_missing, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -107,162 +108,162 @@ grib_accessor_class* grib_accessor_class_g2level = &_grib_accessor_class_g2level static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_g2level* self = (grib_accessor_g2level*)a; - int n = 0; + int n = 0; - self->type_first = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->scale_first = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->value_first = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->pressure_units = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); + self->type_first = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->scale_first = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->value_first = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->pressure_units = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_long(dumper,a,NULL); + grib_dump_long(dumper, a, NULL); } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - int ret=0; + int ret = 0; grib_accessor_g2level* self = (grib_accessor_g2level*)a; - long type_first = 0; - long scale_first = 0; - long value_first = 0; - char pressure_units[10]={0,}; - size_t pressure_units_len=10; + long type_first = 0; + long scale_first = 0; + long value_first = 0; + char pressure_units[10] = {0,}; + size_t pressure_units_len = 10; double v; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->type_first,&type_first)) - !=GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->scale_first,&scale_first)) - !=GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->value_first,&value_first)) - !=GRIB_SUCCESS) return ret; - if((ret = grib_get_string_internal(grib_handle_of_accessor(a), self->pressure_units,pressure_units,&pressure_units_len)) - !=GRIB_SUCCESS) return ret; + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->type_first, &type_first)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->scale_first, &scale_first)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->value_first, &value_first)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_string_internal(grib_handle_of_accessor(a), self->pressure_units, pressure_units, &pressure_units_len)) != GRIB_SUCCESS) + return ret; if (value_first == GRIB_MISSING_LONG) { - *val=0; + *val = 0; return GRIB_SUCCESS; } /* value = value_first * 10 ^ -scale_first */ - if(*len < 1) + if (*len < 1) return GRIB_WRONG_ARRAY_SIZE; v = value_first; - if(scale_first != GRIB_MISSING_LONG) - { + if (scale_first != GRIB_MISSING_LONG) { /* GRIB-637 Potential vorticity surface */ if (type_first == 109) { scale_first -= 6; } - while(scale_first<0 && v!=0) { v *= 10.0; scale_first ++; } - while(scale_first>0 && v!=0) { v /= 10.0; scale_first --; } + while (scale_first < 0 && v != 0) { + v *= 10.0; + scale_first++; + } + while (scale_first > 0 && v != 0) { + v /= 10.0; + scale_first--; + } } - switch(type_first) - { - case 100: /* Isobaric surface (Pa) */ - if (!strcmp(pressure_units,"hPa")) - { - long x= v/100.0; /* 1 hPa = 100 Pa */ - if (scale_first == 0 && x==0) - { - /* Switch to Pa instead of hPa as the value is less than a hectoPascal */ - char pa[]="Pa"; - size_t lpa=strlen(pa); - if((ret = grib_set_string_internal(grib_handle_of_accessor(a), self->pressure_units,pa,&lpa)) !=GRIB_SUCCESS) - return ret; - } - else - { - v=x; + switch (type_first) { + case 100: /* Isobaric surface (Pa) */ + if (!strcmp(pressure_units, "hPa")) { + long x = v / 100.0; /* 1 hPa = 100 Pa */ + if (scale_first == 0 && x == 0) { + /* Switch to Pa instead of hPa as the value is less than a hectoPascal */ + char pa[] = "Pa"; + size_t lpa = strlen(pa); + if ((ret = grib_set_string_internal(grib_handle_of_accessor(a), self->pressure_units, pa, &lpa)) != GRIB_SUCCESS) + return ret; + } + else { + v = x; + } } - } - break; + break; } - *val=v; + *val = v; return GRIB_SUCCESS; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { double dval = 0; - int ret = unpack_double(a, &dval, len); + int ret = unpack_double(a, &dval, len); if (ret == GRIB_SUCCESS) { - *val = (long)(dval+0.5); /* round up */ + *val = (long)(dval + 0.5); /* round up */ } return ret; } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { grib_accessor_g2level* self = (grib_accessor_g2level*)a; - int ret=0; - double value_first = *val; - long scale_first = 0; - long type_first = 0; - char pressure_units[10]={0,}; - size_t pressure_units_len=10; - - if(*len != 1) + int ret = 0; + double value_first = *val; + long scale_first = 0; + long type_first = 0; + char pressure_units[10] = {0,}; + size_t pressure_units_len = 10; + + if (*len != 1) return GRIB_WRONG_ARRAY_SIZE; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->type_first,&type_first)) - !=GRIB_SUCCESS) return ret; + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->type_first, &type_first)) != GRIB_SUCCESS) + return ret; - if((ret = grib_get_string_internal(grib_handle_of_accessor(a), self->pressure_units,pressure_units,&pressure_units_len)) - !=GRIB_SUCCESS) return ret; + if ((ret = grib_get_string_internal(grib_handle_of_accessor(a), self->pressure_units, pressure_units, &pressure_units_len)) != GRIB_SUCCESS) + return ret; - switch(type_first) - { - case 100: /* Pa */ - scale_first = 0; - if (!strcmp(pressure_units,"hPa")) - value_first *= 100; - break; + switch (type_first) { + case 100: /* Pa */ + scale_first = 0; + if (!strcmp(pressure_units, "hPa")) + value_first *= 100; + break; - default: - break; + default: + break; } /* * final = scaled_value * 10 ^ -scale_factor @@ -272,32 +273,32 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) */ scale_first = 2; value_first *= 100; - value_first = value_first+0.5; /* round up */ + value_first = value_first + 0.5; /* round up */ - if ( type_first>9 ) { - if((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->scale_first,scale_first)) - !=GRIB_SUCCESS) return ret; - if((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->value_first,(long)value_first)) - !=GRIB_SUCCESS) return ret; + if (type_first > 9) { + if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->scale_first, scale_first)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->value_first, (long)value_first)) != GRIB_SUCCESS) + return ret; } return GRIB_SUCCESS; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { - int ret=0; - long value_first = *val; - long scale_first = 0; - long type_first = 0; - char pressure_units[10]={0,}; - size_t pressure_units_len=10; + int ret = 0; + long value_first = *val; + long scale_first = 0; + long type_first = 0; + char pressure_units[10] = {0,}; + size_t pressure_units_len = 10; grib_accessor_g2level* self = (grib_accessor_g2level*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int change_scale_and_value = 1; + grib_handle* hand = grib_handle_of_accessor(a); + int change_scale_and_value = 1; - if(*len != 1) + if (*len != 1) return GRIB_WRONG_ARRAY_SIZE; /*Not sure if this is necessary @@ -310,25 +311,24 @@ static int pack_long(grib_accessor* a, const long* val, size_t *len) * } */ - if((ret = grib_get_long_internal(hand, self->type_first,&type_first)) - !=GRIB_SUCCESS) return ret; + if ((ret = grib_get_long_internal(hand, self->type_first, &type_first)) != GRIB_SUCCESS) + return ret; - if((ret = grib_get_string_internal(hand, self->pressure_units,pressure_units,&pressure_units_len)) - !=GRIB_SUCCESS) return ret; + if ((ret = grib_get_string_internal(hand, self->pressure_units, pressure_units, &pressure_units_len)) != GRIB_SUCCESS) + return ret; - switch(type_first) - { - case 100: /* Pa */ - scale_first = 0; - if (!strcmp(pressure_units,"hPa")) - value_first *= 100; - break; + switch (type_first) { + case 100: /* Pa */ + scale_first = 0; + if (!strcmp(pressure_units, "hPa")) + value_first *= 100; + break; - default: - break; + default: + break; } - /* ECC-530: + /* ECC-530: * The pack_long function can get called when key "typeOfSecondFixedSurface" is * changed (via the trigger rule in the definitions). That can have an undesired * side-effect that it sets the scale factor and scaled value keys @@ -344,24 +344,24 @@ static int pack_long(grib_accessor* a, const long* val, size_t *len) } #endif if (change_scale_and_value) { - if (type_first>9) { - if((ret = grib_set_long_internal(hand, self->scale_first,scale_first)) - !=GRIB_SUCCESS) return ret; - if((ret = grib_set_long_internal(hand, self->value_first,value_first)) - !=GRIB_SUCCESS) return ret; + if (type_first > 9) { + if ((ret = grib_set_long_internal(hand, self->scale_first, scale_first)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_set_long_internal(hand, self->value_first, value_first)) != GRIB_SUCCESS) + return ret; } } return GRIB_SUCCESS; } -static int is_missing(grib_accessor* a){ - +static int is_missing(grib_accessor* a) +{ grib_accessor_g2level* self = (grib_accessor_g2level*)a; - int err=0; - int ret=0; + int err = 0; + int ret = 0; - ret=grib_is_missing(grib_handle_of_accessor(a), self->scale_first,&err) + - grib_is_missing(grib_handle_of_accessor(a), self->value_first,&err); + ret = grib_is_missing(grib_handle_of_accessor(a), self->scale_first, &err) + + grib_is_missing(grib_handle_of_accessor(a), self->value_first, &err); return ret; } diff --git a/src/grib_accessor_class_g2lon.c b/src/grib_accessor_class_g2lon.c index bc077c06f..2b62235b3 100644 --- a/src/grib_accessor_class_g2lon.c +++ b/src/grib_accessor_class_g2lon.c @@ -36,62 +36,63 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_g2lon { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in double */ -/* Members defined in g2lon */ - const char* longitude; +typedef struct grib_accessor_g2lon +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in double */ + /* Members defined in g2lon */ + const char* longitude; } grib_accessor_g2lon; extern grib_accessor_class* grib_accessor_class_double; static grib_accessor_class _grib_accessor_class_g2lon = { - &grib_accessor_class_double, /* super */ - "g2lon", /* name */ - sizeof(grib_accessor_g2lon), /* size */ + &grib_accessor_class_double, /* super */ + "g2lon", /* name */ + sizeof(grib_accessor_g2lon), /* size */ 0, /* inited */ &init_class, /* init_class */ &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -100,78 +101,80 @@ grib_accessor_class* grib_accessor_class_g2lon = &_grib_accessor_class_g2lon; static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_g2lon* self = (grib_accessor_g2lon*)a; - int n = 0; + int n = 0; - self->longitude = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); + self->longitude = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { grib_accessor_g2lon* self = (grib_accessor_g2lon*)a; - int ret = 0; + int ret = 0; long longitude; - if((ret = grib_get_long(grib_handle_of_accessor(a), self->longitude,&longitude)) != GRIB_SUCCESS) + if ((ret = grib_get_long(grib_handle_of_accessor(a), self->longitude, &longitude)) != GRIB_SUCCESS) return ret; - if (longitude==GRIB_MISSING_LONG) { - *val=GRIB_MISSING_DOUBLE; + if (longitude == GRIB_MISSING_LONG) { + *val = GRIB_MISSING_DOUBLE; return GRIB_SUCCESS; } - *val=((double)longitude) / 1000000.0 ; + *val = ((double)longitude) / 1000000.0; return GRIB_SUCCESS; } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { grib_accessor_g2lon* self = (grib_accessor_g2lon*)a; long longitude; - double value=*val; + double value = *val; if (value == GRIB_MISSING_DOUBLE) { - longitude=GRIB_MISSING_LONG; - } else { - if (value<0) value+=360; - longitude=value * 1000000; + longitude = GRIB_MISSING_LONG; + } + else { + if (value < 0) + value += 360; + longitude = value * 1000000; } - return grib_set_long(grib_handle_of_accessor(a), self->longitude,longitude); + return grib_set_long(grib_handle_of_accessor(a), self->longitude, longitude); } diff --git a/src/grib_accessor_class_g2step.c b/src/grib_accessor_class_g2step.c index 77d7dab43..1a80256e7 100644 --- a/src/grib_accessor_class_g2step.c +++ b/src/grib_accessor_class_g2step.c @@ -33,64 +33,65 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_g2step { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in g2step */ - const char* forecast_time; - const char* unit; +typedef struct grib_accessor_g2step +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in g2step */ + const char* forecast_time; + const char* unit; } grib_accessor_g2step; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_g2step = { - &grib_accessor_class_long, /* super */ - "g2step", /* name */ - sizeof(grib_accessor_g2step), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "g2step", /* name */ + sizeof(grib_accessor_g2step), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -99,77 +100,79 @@ grib_accessor_class* grib_accessor_class_g2step = &_grib_accessor_class_g2step; static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_g2step* self = (grib_accessor_g2step*)a; - int n = 0; - self->forecast_time = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->unit = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); + int n = 0; + self->forecast_time = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->unit = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_double(dumper,a,NULL); + grib_dump_double(dumper, a, NULL); } -static const int units[] = { - 0, /* (0) minutes */ - 1, /* (1) hour */ - 24, /* (2) day */ +static const int units[] = { + 0, /* (0) minutes */ + 1, /* (1) hour */ + 24, /* (2) day */ - 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, - 3, /* (10) 3 hours */ - 6, /* (11) 6 hours */ - 12, /* (12) 12 hours */ + 3, /* (10) 3 hours */ + 6, /* (11) 6 hours */ + 12, /* (12) 12 hours */ }; -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_g2step* self = (grib_accessor_g2step*)a; - int err = 0; - long forecast_time = 0,unit = 0; + int err = 0; + long forecast_time = 0, unit = 0; - err = grib_get_long_internal(grib_handle_of_accessor(a),self->unit,&unit); - if(err) return err; + err = grib_get_long_internal(grib_handle_of_accessor(a), self->unit, &unit); + if (err) + return err; - err = grib_get_long_internal(grib_handle_of_accessor(a),self->forecast_time,&forecast_time); - if(err) return err; + err = grib_get_long_internal(grib_handle_of_accessor(a), self->forecast_time, &forecast_time); + if (err) + return err; - if(!units[unit]) + if (!units[unit]) return GRIB_NOT_IMPLEMENTED; *val = forecast_time * units[unit]; @@ -177,20 +180,22 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) return GRIB_SUCCESS; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { grib_accessor_g2step* self = (grib_accessor_g2step*)a; - int err = 0; - long forecast_time = *val; - long unit = 1; + int err = 0; + long forecast_time = *val; + long unit = 1; Assert(forecast_time >= 0); - err = grib_set_long_internal(grib_handle_of_accessor(a),self->unit,unit); - if(err) return err; + err = grib_set_long_internal(grib_handle_of_accessor(a), self->unit, unit); + if (err) + return err; - err = grib_set_long_internal(grib_handle_of_accessor(a),self->forecast_time,forecast_time); - if(err) return err; + err = grib_set_long_internal(grib_handle_of_accessor(a), self->forecast_time, forecast_time); + if (err) + return err; return GRIB_SUCCESS; } diff --git a/src/grib_accessor_class_g2step_range.c b/src/grib_accessor_class_g2step_range.c index 6d1810094..26490294c 100644 --- a/src/grib_accessor_class_g2step_range.c +++ b/src/grib_accessor_class_g2step_range.c @@ -39,68 +39,69 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int pack_string(grib_accessor*, const char*, size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); +static int get_native_type(grib_accessor*); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int pack_string(grib_accessor*, const char*, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); static size_t string_length(grib_accessor*); -static int value_count(grib_accessor*,long*); +static int value_count(grib_accessor*, long*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_g2step_range { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in g2step_range */ - const char* startStep; - const char* endStep; +typedef struct grib_accessor_g2step_range +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in g2step_range */ + const char* startStep; + const char* endStep; } grib_accessor_g2step_range; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_g2step_range = { - &grib_accessor_class_gen, /* super */ - "g2step_range", /* name */ - sizeof(grib_accessor_g2step_range), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - &string_length, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - &pack_string, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "g2step_range", /* name */ + sizeof(grib_accessor_g2step_range), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + &string_length, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + &pack_string, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -109,117 +110,122 @@ grib_accessor_class* grib_accessor_class_g2step_range = &_grib_accessor_class_g2 static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_g2step_range* self = (grib_accessor_g2step_range*)a; int n = 0; - self->startStep = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->endStep = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); + self->startStep = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->endStep = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - a->length=0; + a->length = 0; } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_string(dumper,a,NULL); + grib_dump_string(dumper, a, NULL); } -static int unpack_string(grib_accessor* a, char* val, size_t *len) +static int unpack_string(grib_accessor* a, char* val, size_t* len) { grib_accessor_g2step_range* self = (grib_accessor_g2step_range*)a; - grib_handle* h=grib_handle_of_accessor(a); + grib_handle* h = grib_handle_of_accessor(a); char buf[100]; - int ret=0; - size_t size=0; - long start=0,theEnd=0; - - ret = grib_get_long_internal(h,self->startStep,&start); - if (ret) return ret; - - if (self->endStep==NULL) { - sprintf(buf,"%ld",start); - } else { - ret = grib_get_long_internal(h,self->endStep,&theEnd); - if (ret) return ret; - - if(start == theEnd) - { - sprintf(buf,"%ld",theEnd); + int ret = 0; + size_t size = 0; + long start = 0, theEnd = 0; + + ret = grib_get_long_internal(h, self->startStep, &start); + if (ret) + return ret; + + if (self->endStep == NULL) { + sprintf(buf, "%ld", start); + } + else { + ret = grib_get_long_internal(h, self->endStep, &theEnd); + if (ret) + return ret; + + if (start == theEnd) { + sprintf(buf, "%ld", theEnd); } - else - { - sprintf(buf,"%ld-%ld",start,theEnd); + else { + sprintf(buf, "%ld-%ld", start, theEnd); } } - size=strlen(buf)+1; + size = strlen(buf) + 1; - if (*lenstartStep,start); - if (ret) return ret; + if (*p != 0) + theEnd = strtol(++p, &q, 10); + ret = grib_set_long_internal(h, self->startStep, start); + if (ret) + return ret; - if(self->endStep!=NULL) { - ret=grib_set_long_internal(h,self->endStep,theEnd); - if (ret) return ret; + if (self->endStep != NULL) { + ret = grib_set_long_internal(h, self->endStep, theEnd); + if (ret) + return ret; } return 0; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - *count=1; + *count = 1; return 0; } @@ -228,38 +234,39 @@ static size_t string_length(grib_accessor* a) return 255; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { char buff[100]; - size_t bufflen=100; + size_t bufflen = 100; - sprintf(buff,"%ld",*val); - return pack_string( a,buff,&bufflen); + sprintf(buff, "%ld", *val); + return pack_string(a, buff, &bufflen); } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { char buff[100]; - size_t bufflen=100; - long start,theEnd; - char* p=buff; - char* q=NULL; - int err=0; + size_t bufflen = 100; + long start, theEnd; + char* p = buff; + char* q = NULL; + int err = 0; - if ((err=unpack_string( a,buff,&bufflen))!=GRIB_SUCCESS) + if ((err = unpack_string(a, buff, &bufflen)) != GRIB_SUCCESS) return err; - start=strtol(buff, &p,10); - theEnd=start; - if ( *p!=0 ) theEnd=strtol(++p, &q,10); + start = strtol(buff, &p, 10); + theEnd = start; + if (*p != 0) + theEnd = strtol(++p, &q, 10); - *val=theEnd; + *val = theEnd; return 0; } -static int get_native_type(grib_accessor* a) +static int get_native_type(grib_accessor* a) { return GRIB_TYPE_STRING; } diff --git a/src/grib_accessor_class_gaussian_grid_name.c b/src/grib_accessor_class_gaussian_grid_name.c index e6502b41c..e306027d0 100644 --- a/src/grib_accessor_class_gaussian_grid_name.c +++ b/src/grib_accessor_class_gaussian_grid_name.c @@ -34,64 +34,65 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int unpack_string (grib_accessor*, char*, size_t *len); +static int get_native_type(grib_accessor*); +static int unpack_string(grib_accessor*, char*, size_t* len); static size_t string_length(grib_accessor*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_gaussian_grid_name { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in gaussian_grid_name */ - const char* N; - const char* Ni; - const char* isOctahedral; +typedef struct grib_accessor_gaussian_grid_name +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in gaussian_grid_name */ + const char* N; + const char* Ni; + const char* isOctahedral; } grib_accessor_gaussian_grid_name; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_gaussian_grid_name = { - &grib_accessor_class_gen, /* super */ - "gaussian_grid_name", /* name */ - sizeof(grib_accessor_gaussian_grid_name), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - &string_length, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "gaussian_grid_name", /* name */ + sizeof(grib_accessor_gaussian_grid_name), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + &string_length, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -100,48 +101,48 @@ grib_accessor_class* grib_accessor_class_gaussian_grid_name = &_grib_accessor_cl static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len , grib_arguments* arg ) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { grib_accessor_gaussian_grid_name* self = (grib_accessor_gaussian_grid_name*)a; - int n=0; + int n = 0; - self->N = grib_arguments_get_name(a->parent->h,arg,n++); - self->Ni = grib_arguments_get_name(a->parent->h,arg,n++); - self->isOctahedral = grib_arguments_get_name(a->parent->h,arg,n++); - a->length = 0; + self->N = grib_arguments_get_name(a->parent->h, arg, n++); + self->Ni = grib_arguments_get_name(a->parent->h, arg, n++); + self->isOctahedral = grib_arguments_get_name(a->parent->h, arg, n++); + a->length = 0; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; } @@ -153,36 +154,38 @@ static int get_native_type(grib_accessor* a) #define MAX_GRIDNAME_LEN 16 -static int unpack_string(grib_accessor*a , char* v, size_t *len) +static int unpack_string(grib_accessor* a, char* v, size_t* len) { grib_accessor_gaussian_grid_name* self = (grib_accessor_gaussian_grid_name*)a; - long N=0, Ni=0, isOctahedral=0; + long N = 0, Ni = 0, isOctahedral = 0; char tmp[MAX_GRIDNAME_LEN] = {0,}; size_t length = sizeof(tmp); - int ret = GRIB_SUCCESS; + int ret = GRIB_SUCCESS; - if ((ret = grib_get_long_internal(a->parent->h,self->N,&N)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(a->parent->h, self->N, &N)) != GRIB_SUCCESS) return ret; - if ((ret = grib_get_long_internal(a->parent->h,self->Ni,&Ni))!= GRIB_SUCCESS) + if ((ret = grib_get_long_internal(a->parent->h, self->Ni, &Ni)) != GRIB_SUCCESS) return ret; - if ((ret = grib_get_long_internal(a->parent->h,self->isOctahedral,&isOctahedral)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(a->parent->h, self->isOctahedral, &isOctahedral)) != GRIB_SUCCESS) return ret; - if (Ni == GRIB_MISSING_LONG ) { + if (Ni == GRIB_MISSING_LONG) { /* reduced gaussian grid */ if (isOctahedral == 1) { - sprintf(tmp,"O%ld", N); - } else { - sprintf(tmp,"N%ld", N); + sprintf(tmp, "O%ld", N); + } + else { + sprintf(tmp, "N%ld", N); } - } else { + } + else { /* regular gaussian grid */ - sprintf(tmp,"F%ld", N); + sprintf(tmp, "F%ld", N); } - length = strlen(tmp)+1; + length = strlen(tmp) + 1; - if(*len < length) { + if (*len < length) { *len = length; return GRIB_BUFFER_TOO_SMALL; } diff --git a/src/grib_accessor_class_gds_is_present.c b/src/grib_accessor_class_gds_is_present.c index 94cae2bc2..dab2c42c3 100644 --- a/src/grib_accessor_class_gds_is_present.c +++ b/src/grib_accessor_class_gds_is_present.c @@ -39,65 +39,66 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_gds_is_present { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in gds_is_present */ - const char* gds_present; - const char* grid_definition; - const char* bitmap_present; - const char* values; +typedef struct grib_accessor_gds_is_present +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in gds_is_present */ + const char* gds_present; + const char* grid_definition; + const char* bitmap_present; + const char* values; } grib_accessor_gds_is_present; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_gds_is_present = { - &grib_accessor_class_long, /* super */ - "gds_is_present", /* name */ - sizeof(grib_accessor_gds_is_present), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "gds_is_present", /* name */ + sizeof(grib_accessor_gds_is_present), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -106,106 +107,107 @@ grib_accessor_class* grib_accessor_class_gds_is_present = &_grib_accessor_class_ static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { - int n=0; + int n = 0; grib_accessor_gds_is_present* self = (grib_accessor_gds_is_present*)a; - self->gds_present = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->grid_definition = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->bitmap_present = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->values = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); + self->gds_present = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->grid_definition = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->bitmap_present = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->values = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; a->flags |= GRIB_ACCESSOR_FLAG_HIDDEN; - a->length=0; + a->length = 0; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { - long missing=255; - int ret=0; - size_t size=0; + long missing = 255; + int ret = 0; + size_t size = 0; double* values; - grib_context* c=a->context; - grib_handle* h=grib_handle_of_accessor(a); + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); grib_accessor_gds_is_present* self = (grib_accessor_gds_is_present*)a; - if (*val != 1) return GRIB_NOT_IMPLEMENTED; + if (*val != 1) + return GRIB_NOT_IMPLEMENTED; - if ( (ret=grib_get_size(h,self->values,&size)) != GRIB_SUCCESS) return ret; + if ((ret = grib_get_size(h, self->values, &size)) != GRIB_SUCCESS) + return ret; - values=(double*)grib_context_malloc(c,size*sizeof(double)); - if (!values) return GRIB_OUT_OF_MEMORY; + values = (double*)grib_context_malloc(c, size * sizeof(double)); + if (!values) + return GRIB_OUT_OF_MEMORY; - if((ret = grib_get_double_array_internal(h,self->values,values,&size)) - != GRIB_SUCCESS) { - grib_context_free(c,values); + if ((ret = grib_get_double_array_internal(h, self->values, values, &size)) != GRIB_SUCCESS) { + grib_context_free(c, values); return ret; } - if((ret = grib_set_long_internal(h, self->gds_present,*val)) - != GRIB_SUCCESS) return ret; - - if((ret = grib_set_long_internal(h, self->bitmap_present,*val)) - != GRIB_SUCCESS) return ret; + if ((ret = grib_set_long_internal(h, self->gds_present, *val)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_set_long_internal(h, self->bitmap_present, *val)) != GRIB_SUCCESS) + return ret; - if((ret = grib_set_long_internal(h, self->grid_definition,missing)) - != GRIB_SUCCESS) return ret; + if ((ret = grib_set_long_internal(h, self->grid_definition, missing)) != GRIB_SUCCESS) + return ret; - if((ret = grib_set_double_array_internal(h, self->values,values,size)) - != GRIB_SUCCESS) return ret; + if ((ret = grib_set_double_array_internal(h, self->values, values, size)) != GRIB_SUCCESS) + return ret; - grib_context_free(c,values); + grib_context_free(c, values); return GRIB_SUCCESS; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - int ret=0; - grib_handle* h=grib_handle_of_accessor(a); + int ret = 0; + grib_handle* h = grib_handle_of_accessor(a); grib_accessor_gds_is_present* self = (grib_accessor_gds_is_present*)a; - if((ret = grib_get_long_internal(h,self->gds_present,val)) - != GRIB_SUCCESS) return ret; + if ((ret = grib_get_long_internal(h, self->gds_present, val)) != GRIB_SUCCESS) + return ret; - *len=1; + *len = 1; return GRIB_SUCCESS; } diff --git a/src/grib_accessor_class_gds_not_present_bitmap.c b/src/grib_accessor_class_gds_not_present_bitmap.c index b5a39d824..f5abf4eb6 100644 --- a/src/grib_accessor_class_gds_not_present_bitmap.c +++ b/src/grib_accessor_class_gds_not_present_bitmap.c @@ -43,66 +43,67 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_gds_not_present_bitmap { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in gds_not_present_bitmap */ - const char* missing_value; - const char* number_of_values; - const char* number_of_points; - const char* latitude_of_first_point; - const char* ni; +typedef struct grib_accessor_gds_not_present_bitmap +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in gds_not_present_bitmap */ + const char* missing_value; + const char* number_of_values; + const char* number_of_points; + const char* latitude_of_first_point; + const char* ni; } grib_accessor_gds_not_present_bitmap; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_gds_not_present_bitmap = { - &grib_accessor_class_gen, /* super */ - "gds_not_present_bitmap", /* name */ - sizeof(grib_accessor_gds_not_present_bitmap), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "gds_not_present_bitmap", /* name */ + sizeof(grib_accessor_gds_not_present_bitmap), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -111,116 +112,120 @@ grib_accessor_class* grib_accessor_class_gds_not_present_bitmap = &_grib_accesso static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long v, grib_arguments* args) +static void init(grib_accessor* a, const long v, grib_arguments* args) { - int n=0; - grib_accessor_gds_not_present_bitmap *self =(grib_accessor_gds_not_present_bitmap*)a; - - self->missing_value = grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->number_of_values = grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->number_of_points = grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->latitude_of_first_point = grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->ni = grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - a->length = 0; + int n = 0; + grib_accessor_gds_not_present_bitmap* self = (grib_accessor_gds_not_present_bitmap*)a; + + self->missing_value = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->number_of_values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->number_of_points = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->latitude_of_first_point = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->ni = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + a->length = 0; } -static int value_count(grib_accessor* a,long* number_of_points) +static int value_count(grib_accessor* a, long* number_of_points) { grib_accessor_gds_not_present_bitmap* self = (grib_accessor_gds_not_present_bitmap*)a; - *number_of_points=0; + *number_of_points = 0; return grib_get_long_internal(grib_handle_of_accessor(a), self->number_of_points, number_of_points); } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - grib_accessor_gds_not_present_bitmap* self = (grib_accessor_gds_not_present_bitmap*)a; + grib_accessor_gds_not_present_bitmap* self = (grib_accessor_gds_not_present_bitmap*)a; - long number_of_points=0,number_of_values=0,ni=0; - long latitude_of_first_point=0; - size_t i = 0; - size_t n_vals = 0; - long nn=0; + long number_of_points = 0, number_of_values = 0, ni = 0; + long latitude_of_first_point = 0; + size_t i = 0; + size_t n_vals = 0; + long nn = 0; long missing_value; - int err = 0; + int err = 0; double* coded_vals = NULL; - err=grib_value_count(a,&nn); - n_vals=nn; - if (err) return err; + err = grib_value_count(a, &nn); + n_vals = nn; + if (err) + return err; - if((err = grib_get_long(grib_handle_of_accessor(a),self->number_of_points,&number_of_points)) - != GRIB_SUCCESS) return err; + if ((err = grib_get_long(grib_handle_of_accessor(a), self->number_of_points, &number_of_points)) != GRIB_SUCCESS) + return err; - if((err = grib_get_long(grib_handle_of_accessor(a),self->number_of_values,&number_of_values)) - != GRIB_SUCCESS) return err; + if ((err = grib_get_long(grib_handle_of_accessor(a), self->number_of_values, &number_of_values)) != GRIB_SUCCESS) + return err; - if((err = grib_get_long(grib_handle_of_accessor(a),self->latitude_of_first_point,&latitude_of_first_point)) - != GRIB_SUCCESS) return err; + if ((err = grib_get_long(grib_handle_of_accessor(a), self->latitude_of_first_point, &latitude_of_first_point)) != GRIB_SUCCESS) + return err; - if((err = grib_get_long(grib_handle_of_accessor(a),self->missing_value,&missing_value)) - != GRIB_SUCCESS) return err; + if ((err = grib_get_long(grib_handle_of_accessor(a), self->missing_value, &missing_value)) != GRIB_SUCCESS) + return err; - if((err = grib_get_long(grib_handle_of_accessor(a),self->ni,&ni)) - != GRIB_SUCCESS) return err; + if ((err = grib_get_long(grib_handle_of_accessor(a), self->ni, &ni)) != GRIB_SUCCESS) + return err; - if(*len < number_of_points) - { + if (*len < number_of_points) { *len = n_vals; return GRIB_ARRAY_TOO_SMALL; } - if(number_of_values > 0){ - coded_vals = (double*)grib_context_malloc(a->context,number_of_values*sizeof(double)); + if (number_of_values > 0) { + coded_vals = (double*)grib_context_malloc(a->context, number_of_values * sizeof(double)); - if(coded_vals == NULL) + if (coded_vals == NULL) return GRIB_OUT_OF_MEMORY; } if (latitude_of_first_point == 0) { - for (i=0;i < number_of_values;i++) val[i]=1; - for (i=number_of_values;icontext,coded_vals); + grib_context_free(a->context, coded_vals); return err; } @@ -283,7 +288,7 @@ static int pack_double(grib_accessor* a, const double* val,size_t *len){ #else -static int pack_double(grib_accessor* a, const double* val,size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { return GRIB_NOT_IMPLEMENTED; } diff --git a/src/grib_accessor_class_gen.c b/src/grib_accessor_class_gen.c index 660796c7d..eb265bc13 100644 --- a/src/grib_accessor_class_gen.c +++ b/src/grib_accessor_class_gen.c @@ -46,85 +46,86 @@ or edit "accessor.class" and rerun ./make_class.pl */ static grib_section* sub_section(grib_accessor* a); -static int get_native_type(grib_accessor*); +static int get_native_type(grib_accessor*); static int is_missing(grib_accessor*); -static int pack_bytes(grib_accessor*,const unsigned char*, size_t *len); -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int pack_string(grib_accessor*, const char*, size_t *len); -static int pack_string_array(grib_accessor*, const char**, size_t *len); +static int pack_bytes(grib_accessor*, const unsigned char*, size_t* len); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int pack_string(grib_accessor*, const char*, size_t* len); +static int pack_string_array(grib_accessor*, const char**, size_t* len); static int pack_expression(grib_accessor*, grib_expression*); -static int unpack_bytes (grib_accessor*,unsigned char*, size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); -static int unpack_string_array (grib_accessor*, char**, size_t *len); +static int unpack_bytes(grib_accessor*, unsigned char*, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); +static int unpack_string_array(grib_accessor*, char**, size_t* len); static size_t string_length(grib_accessor*); static long byte_count(grib_accessor*); static long byte_offset(grib_accessor*); static long next_offset(grib_accessor*); -static int value_count(grib_accessor*,long*); -static void destroy(grib_context*,grib_accessor*); +static int value_count(grib_accessor*, long*); +static void destroy(grib_context*, grib_accessor*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -static int notify_change(grib_accessor*,grib_accessor*); -static void update_size(grib_accessor*,size_t); -static size_t preferred_size(grib_accessor*,int); +static int notify_change(grib_accessor*, grib_accessor*); +static void update_size(grib_accessor*, size_t); +static size_t preferred_size(grib_accessor*, int); static grib_accessor* next(grib_accessor*, int); static int compare(grib_accessor*, grib_accessor*); -static int unpack_double_element(grib_accessor*,size_t i, double* val); -static int unpack_double_subarray(grib_accessor*, double* val,size_t start,size_t len); +static int unpack_double_element(grib_accessor*, size_t i, double* val); +static int unpack_double_subarray(grib_accessor*, double* val, size_t start, size_t len); static int clear(grib_accessor*); -static grib_accessor* make_clone(grib_accessor*,grib_section*,int*); +static grib_accessor* make_clone(grib_accessor*, grib_section*, int*); -typedef struct grib_accessor_gen { - grib_accessor att; -/* Members defined in gen */ +typedef struct grib_accessor_gen +{ + grib_accessor att; + /* Members defined in gen */ } grib_accessor_gen; static grib_accessor_class _grib_accessor_class_gen = { - 0, /* super */ - "gen", /* name */ - sizeof(grib_accessor_gen), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* free mem */ - &dump, /* describes himself */ - &next_offset, /* get length of section */ - &string_length, /* get length of string */ - &value_count, /* get number of values */ - &byte_count, /* get number of bytes */ - &byte_offset, /* get offset to bytes */ - &get_native_type, /* get native type */ - &sub_section, /* get sub_section */ - 0, /* grib_pack procedures long */ - &is_missing, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - &pack_string, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - &pack_string_array, /* grib_pack array procedures string */ - &unpack_string_array, /* grib_unpack array procedures string */ - &pack_bytes, /* grib_pack procedures bytes */ - &unpack_bytes, /* grib_unpack procedures bytes */ - &pack_expression, /* pack_expression */ - ¬ify_change, /* notify_change */ - &update_size, /* update_size */ - &preferred_size, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - &next, /* next accessor */ - &compare, /* compare vs. another accessor */ - &unpack_double_element, /* unpack only ith value */ - &unpack_double_subarray, /* unpack a subarray */ - &clear, /* clear */ - &make_clone, /* clone accessor */ + 0, /* super */ + "gen", /* name */ + sizeof(grib_accessor_gen), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + &destroy, /* free mem */ + &dump, /* describes himself */ + &next_offset, /* get length of section */ + &string_length, /* get length of string */ + &value_count, /* get number of values */ + &byte_count, /* get number of bytes */ + &byte_offset, /* get offset to bytes */ + &get_native_type, /* get native type */ + &sub_section, /* get sub_section */ + 0, /* grib_pack procedures long */ + &is_missing, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + &pack_string, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + &pack_string_array, /* grib_pack array procedures string */ + &unpack_string_array, /* grib_unpack array procedures string */ + &pack_bytes, /* grib_pack procedures bytes */ + &unpack_bytes, /* grib_unpack procedures bytes */ + &pack_expression, /* pack_expression */ + ¬ify_change, /* notify_change */ + &update_size, /* update_size */ + &preferred_size, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + &next, /* next accessor */ + &compare, /* compare vs. another accessor */ + &unpack_double_element, /* unpack only ith value */ + &unpack_double_subarray, /* unpack a subarray */ + &clear, /* clear */ + &make_clone, /* clone accessor */ }; @@ -137,79 +138,80 @@ static void init_class(grib_accessor_class* c) /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long len, grib_arguments* param) +static void init(grib_accessor* a, const long len, grib_arguments* param) { - grib_action* act=(grib_action*)(a->creator); + grib_action* act = (grib_action*)(a->creator); if (a->flags & GRIB_ACCESSOR_FLAG_TRANSIENT) { a->length = 0; if (!a->vvalue) - a->vvalue = (grib_virtual_value*)grib_context_malloc_clear(a->context,sizeof(grib_virtual_value)); - a->vvalue->type=grib_accessor_get_native_type(a); - a->vvalue->length=len; - if (act->default_value!=NULL) { + a->vvalue = (grib_virtual_value*)grib_context_malloc_clear(a->context, sizeof(grib_virtual_value)); + a->vvalue->type = grib_accessor_get_native_type(a); + a->vvalue->length = len; + if (act->default_value != NULL) { const char* p = 0; - size_t s_len = 1; + size_t s_len = 1; long l; - int ret=0; + int ret = 0; double d; char tmp[1024]; - grib_expression* expression=grib_arguments_get_expression(grib_handle_of_accessor(a),act->default_value,0); - int type = grib_expression_native_type(grib_handle_of_accessor(a),expression); - switch(type) { - case GRIB_TYPE_DOUBLE: - grib_expression_evaluate_double(grib_handle_of_accessor(a),expression,&d); - grib_pack_double(a,&d,&s_len); - break; - - case GRIB_TYPE_LONG: - grib_expression_evaluate_long(grib_handle_of_accessor(a),expression,&l); - grib_pack_long(a,&l,&s_len); - break; - - default: - s_len = sizeof(tmp); - p = grib_expression_evaluate_string(grib_handle_of_accessor(a),expression,tmp,&s_len,&ret); - if (ret != GRIB_SUCCESS) { - grib_context_log(a->context,GRIB_LOG_ERROR,"unable to evaluate %s as string",a->name); - Assert(0); - } - s_len = strlen(p)+1; - grib_pack_string(a,p,&s_len); - break; + grib_expression* expression = grib_arguments_get_expression(grib_handle_of_accessor(a), act->default_value, 0); + int type = grib_expression_native_type(grib_handle_of_accessor(a), expression); + switch (type) { + case GRIB_TYPE_DOUBLE: + grib_expression_evaluate_double(grib_handle_of_accessor(a), expression, &d); + grib_pack_double(a, &d, &s_len); + break; + + case GRIB_TYPE_LONG: + grib_expression_evaluate_long(grib_handle_of_accessor(a), expression, &l); + grib_pack_long(a, &l, &s_len); + break; + + default: + s_len = sizeof(tmp); + p = grib_expression_evaluate_string(grib_handle_of_accessor(a), expression, tmp, &s_len, &ret); + if (ret != GRIB_SUCCESS) { + grib_context_log(a->context, GRIB_LOG_ERROR, "unable to evaluate %s as string", a->name); + Assert(0); + } + s_len = strlen(p) + 1; + grib_pack_string(a, p, &s_len); + break; } } - } else { + } + else { a->length = len; } } static void dump(grib_accessor* a, grib_dumper* dumper) { - int type=grib_accessor_get_native_type(a); + int type = grib_accessor_get_native_type(a); switch (type) { - case GRIB_TYPE_STRING: - grib_dump_string(dumper,a,NULL); - break; - case GRIB_TYPE_DOUBLE: - grib_dump_double(dumper,a,NULL); - break; - case GRIB_TYPE_LONG: - grib_dump_long(dumper,a,NULL); - break; - default: - grib_dump_bytes(dumper,a,NULL); + case GRIB_TYPE_STRING: + grib_dump_string(dumper, a, NULL); + break; + case GRIB_TYPE_DOUBLE: + grib_dump_double(dumper, a, NULL); + break; + case GRIB_TYPE_LONG: + grib_dump_long(dumper, a, NULL); + break; + default: + grib_dump_bytes(dumper, a, NULL); } } static long next_offset(grib_accessor* a) { - return a->offset+a->length; + return a->offset + a->length; } static int value_count(grib_accessor* a, long* count) { - *count=1; + *count = 1; return 0; } @@ -223,9 +225,10 @@ static long byte_count(grib_accessor* a) return a->length; } -static int get_native_type(grib_accessor* a){ - grib_context_log(a->context,GRIB_LOG_ERROR, - "Accessor %s [%s] must implement 'get_native_type'", a->name,a->cclass->name); +static int get_native_type(grib_accessor* a) +{ + grib_context_log(a->context, GRIB_LOG_ERROR, + "Accessor %s [%s] must implement 'get_native_type'", a->name, a->cclass->name); return GRIB_TYPE_UNDEFINED; } @@ -234,22 +237,21 @@ static long byte_offset(grib_accessor* a) return a->offset; } -static int unpack_bytes(grib_accessor* a, unsigned char* val, size_t *len) +static int unpack_bytes(grib_accessor* a, unsigned char* val, size_t* len) { unsigned char* buf = grib_handle_of_accessor(a)->buffer->data; - long length = grib_byte_count(a); - long offset = grib_byte_offset(a); + long length = grib_byte_count(a); + long offset = grib_byte_offset(a); - if(*len < length ) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it is %d bytes long\n", a->name ,length ); + if (*len < length) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it is %d bytes long\n", a->name, length); *len = length; return GRIB_ARRAY_TOO_SMALL; } - memcpy(val,buf + offset,length ); + memcpy(val, buf + offset, length); *len = length; return GRIB_SUCCESS; @@ -258,278 +260,272 @@ static int unpack_bytes(grib_accessor* a, unsigned char* val, size_t *len) static int clear(grib_accessor* a) { unsigned char* buf = grib_handle_of_accessor(a)->buffer->data; - long length = grib_byte_count(a); - long offset = grib_byte_offset(a); + long length = grib_byte_count(a); + long offset = grib_byte_offset(a); - memset(buf + offset,0,length); + memset(buf + offset, 0, length); return GRIB_SUCCESS; } -static int unpack_long (grib_accessor* a, long* v, size_t *len) +static int unpack_long(grib_accessor* a, long* v, size_t* len) { int type = GRIB_TYPE_UNDEFINED; - if(a->cclass->unpack_double && a->cclass->unpack_double != &unpack_double) - { + if (a->cclass->unpack_double && a->cclass->unpack_double != &unpack_double) { double val = 0.0; - size_t l = 1; - grib_unpack_double (a , &val, &l); + size_t l = 1; + grib_unpack_double(a, &val, &l); *v = (long)val; - grib_context_log(a->context,GRIB_LOG_DEBUG, " Casting double %s to long", a->name); + grib_context_log(a->context, GRIB_LOG_DEBUG, " Casting double %s to long", a->name); return GRIB_SUCCESS; } - if(a->cclass->unpack_string && a->cclass->unpack_string != &unpack_string) - { + if (a->cclass->unpack_string && a->cclass->unpack_string != &unpack_string) { char val[1024]; - size_t l = sizeof(val); - char *last = NULL; - grib_unpack_string (a , val, &l); + size_t l = sizeof(val); + char* last = NULL; + grib_unpack_string(a, val, &l); - *v = strtol(val,&last,10); + *v = strtol(val, &last, 10); - if(*last == 0) - { - grib_context_log(a->context,GRIB_LOG_DEBUG, " Casting string %s to long", a->name); + if (*last == 0) { + grib_context_log(a->context, GRIB_LOG_DEBUG, " Casting string %s to long", a->name); return GRIB_SUCCESS; } } - grib_context_log(a->context,GRIB_LOG_ERROR,"Cannot unpack %s as long",a->name); + grib_context_log(a->context, GRIB_LOG_ERROR, "Cannot unpack %s as long", a->name); if (grib_get_native_type(grib_handle_of_accessor(a), a->name, &type) == GRIB_SUCCESS) { - grib_context_log(a->context,GRIB_LOG_ERROR,"Hint: Try unpacking as %s", grib_get_type_name(type)); + grib_context_log(a->context, GRIB_LOG_ERROR, "Hint: Try unpacking as %s", grib_get_type_name(type)); } return GRIB_NOT_IMPLEMENTED; } -static int unpack_double (grib_accessor* a, double*v, size_t *len) +static int unpack_double(grib_accessor* a, double* v, size_t* len) { int type = GRIB_TYPE_UNDEFINED; - if(a->cclass->unpack_long && a->cclass->unpack_long != &unpack_long) - { + if (a->cclass->unpack_long && a->cclass->unpack_long != &unpack_long) { long val = 0; size_t l = 1; - grib_unpack_long (a , &val, &l); + grib_unpack_long(a, &val, &l); *v = val; - grib_context_log(a->context,GRIB_LOG_DEBUG, " Casting long %s to double", a->name); + grib_context_log(a->context, GRIB_LOG_DEBUG, " Casting long %s to double", a->name); return GRIB_SUCCESS; } - if(a->cclass->unpack_string && a->cclass->unpack_string != &unpack_string) - { + if (a->cclass->unpack_string && a->cclass->unpack_string != &unpack_string) { char val[1024]; - size_t l = sizeof(val); - char *last = NULL; - grib_unpack_string (a , val, &l); + size_t l = sizeof(val); + char* last = NULL; + grib_unpack_string(a, val, &l); - *v = strtod(val,&last); + *v = strtod(val, &last); - if(*last == 0) - { - grib_context_log(a->context,GRIB_LOG_DEBUG, " Casting string %s to long", a->name); + if (*last == 0) { + grib_context_log(a->context, GRIB_LOG_DEBUG, " Casting string %s to long", a->name); return GRIB_SUCCESS; } } - grib_context_log(a->context,GRIB_LOG_ERROR,"Cannot unpack %s as double",a->name); + grib_context_log(a->context, GRIB_LOG_ERROR, "Cannot unpack %s as double", a->name); if (grib_get_native_type(grib_handle_of_accessor(a), a->name, &type) == GRIB_SUCCESS) { - grib_context_log(a->context,GRIB_LOG_ERROR,"Hint: Try unpacking as %s", grib_get_type_name(type)); + grib_context_log(a->context, GRIB_LOG_ERROR, "Hint: Try unpacking as %s", grib_get_type_name(type)); } return GRIB_NOT_IMPLEMENTED; } -static int unpack_string(grib_accessor*a , char* v, size_t *len) +static int unpack_string(grib_accessor* a, char* v, size_t* len) { - if(a->cclass->unpack_double && a->cclass->unpack_double != &unpack_double) - { + if (a->cclass->unpack_double && a->cclass->unpack_double != &unpack_double) { double val = 0.0; - size_t l = 1; - grib_unpack_double (a , &val, &l); - sprintf(v,"%g",val); + size_t l = 1; + grib_unpack_double(a, &val, &l); + sprintf(v, "%g", val); *len = strlen(v); - grib_context_log(a->context,GRIB_LOG_DEBUG, " Casting double %s to string", a->name); + grib_context_log(a->context, GRIB_LOG_DEBUG, " Casting double %s to string", a->name); return GRIB_SUCCESS; } - if(a->cclass->unpack_long && a->cclass->unpack_long != &unpack_long) - { + if (a->cclass->unpack_long && a->cclass->unpack_long != &unpack_long) { long val = 0; size_t l = 1; - grib_unpack_long (a , &val, &l); - sprintf(v,"%ld",val); + grib_unpack_long(a, &val, &l); + sprintf(v, "%ld", val); *len = strlen(v); - grib_context_log(a->context,GRIB_LOG_DEBUG, " Casting long %s to string \n", a->name); + grib_context_log(a->context, GRIB_LOG_DEBUG, " Casting long %s to string \n", a->name); return GRIB_SUCCESS; } return GRIB_NOT_IMPLEMENTED; } -static int unpack_string_array(grib_accessor*a , char** v, size_t *len) +static int unpack_string_array(grib_accessor* a, char** v, size_t* len) { - int err=0; - size_t length=0; + int err = 0; + size_t length = 0; - err= _grib_get_string_length(a,&length); - if (err) return err; - v[0]=(char*)grib_context_malloc_clear(a->context,length); - grib_unpack_string(a,v[0],&length); - *len=1; + err = _grib_get_string_length(a, &length); + if (err) + return err; + v[0] = (char*)grib_context_malloc_clear(a->context, length); + grib_unpack_string(a, v[0], &length); + *len = 1; return err; } -static int pack_expression(grib_accessor* a, grib_expression *e) +static int pack_expression(grib_accessor* a, grib_expression* e) { - size_t len = 1; - long lval=0; - double dval=0; - const char *cval=NULL; - int ret=0; + size_t len = 1; + long lval = 0; + double dval = 0; + const char* cval = NULL; + int ret = 0; grib_handle* hand = grib_handle_of_accessor(a); - switch(grib_accessor_get_native_type(a)) - { + switch (grib_accessor_get_native_type(a)) { case GRIB_TYPE_LONG: { len = 1; - ret = grib_expression_evaluate_long(hand,e,&lval); + ret = grib_expression_evaluate_long(hand, e, &lval); if (ret != GRIB_SUCCESS) { - grib_context_log(a->context,GRIB_LOG_ERROR,"unable to set %s as long",a->name); + grib_context_log(a->context, GRIB_LOG_ERROR, "unable to set %s as long", a->name); return ret; } /*if (hand->context->debug) printf("ECCODES DEBUG grib_accessor_class_gen::pack_expression %s %ld\n", a->name,lval);*/ - return grib_pack_long(a,&lval,&len); + return grib_pack_long(a, &lval, &len); } case GRIB_TYPE_DOUBLE: { len = 1; - ret = grib_expression_evaluate_double(hand,e,&dval); + ret = grib_expression_evaluate_double(hand, e, &dval); /*if (hand->context->debug) printf("ECCODES DEBUG grib_accessor_class_gen::pack_expression %s %g\n", a->name, dval);*/ - return grib_pack_double(a,&dval,&len); + return grib_pack_double(a, &dval, &len); } case GRIB_TYPE_STRING: { char tmp[1024]; - len = sizeof(tmp); - cval = grib_expression_evaluate_string(hand,e,tmp,&len,&ret); + len = sizeof(tmp); + cval = grib_expression_evaluate_string(hand, e, tmp, &len, &ret); if (ret != GRIB_SUCCESS) { - grib_context_log(a->context,GRIB_LOG_ERROR,"unable to set %s as string",a->name); + grib_context_log(a->context, GRIB_LOG_ERROR, "unable to set %s as string", a->name); return ret; } len = strlen(cval); /*if (hand->context->debug) printf("ECCODES DEBUG grib_accessor_class_gen::pack_expression %s %s\n", a->name, cval);*/ - return grib_pack_string(a,cval,&len); + return grib_pack_string(a, cval, &len); } } return GRIB_NOT_IMPLEMENTED; } -static int pack_long(grib_accessor* a, const long* v, size_t *len) +static int pack_long(grib_accessor* a, const long* v, size_t* len) { - grib_context* c=a->context; - if(a->cclass->pack_double && a->cclass->pack_double != &pack_double) - { - int i=0,ret=0; - double* val = (double*)grib_context_malloc(c,*len*(sizeof(double))) ; + grib_context* c = a->context; + if (a->cclass->pack_double && a->cclass->pack_double != &pack_double) { + int i = 0, ret = 0; + double* val = (double*)grib_context_malloc(c, *len * (sizeof(double))); if (!val) { - grib_context_log(c,GRIB_LOG_ERROR, - "unable to allocate %d bytes\n",(int)(*len*(sizeof(double)))); + grib_context_log(c, GRIB_LOG_ERROR, + "unable to allocate %d bytes\n", (int)(*len * (sizeof(double)))); return GRIB_OUT_OF_MEMORY; } - for (i=0;i<*len;i++) val[i]=(long)v[i]; - ret=grib_pack_double (a , val, len); - grib_context_free(c,val); + for (i = 0; i < *len; i++) + val[i] = (long)v[i]; + ret = grib_pack_double(a, val, len); + grib_context_free(c, val); return ret; } - grib_context_log(c,GRIB_LOG_ERROR, " Should not grib_pack %s as long", a->name); + grib_context_log(c, GRIB_LOG_ERROR, " Should not grib_pack %s as long", a->name); Assert(0); return GRIB_NOT_IMPLEMENTED; } -static int pack_double_array_as_long(grib_accessor* a, const double *v, size_t *len) +static int pack_double_array_as_long(grib_accessor* a, const double* v, size_t* len) { grib_context* c = a->context; - int ret = GRIB_SUCCESS; - size_t i = 0; + int ret = GRIB_SUCCESS; + size_t i = 0; size_t numBytes = *len * (sizeof(long)); - long* lValues = (long*)grib_context_malloc(c, numBytes); + long* lValues = (long*)grib_context_malloc(c, numBytes); if (!lValues) { - grib_context_log(c,GRIB_LOG_ERROR, "unable to allocate %ld bytes\n", numBytes); + grib_context_log(c, GRIB_LOG_ERROR, "unable to allocate %ld bytes\n", numBytes); return GRIB_OUT_OF_MEMORY; } - for (i=0;i<*len;i++) lValues[i]=(long)v[i]; /* convert from double to long */ - ret = grib_pack_long (a , lValues, len); + for (i = 0; i < *len; i++) + lValues[i] = (long)v[i]; /* convert from double to long */ + ret = grib_pack_long(a, lValues, len); grib_context_free(c, lValues); return ret; } -static int pack_double(grib_accessor* a, const double *v, size_t *len) +static int pack_double(grib_accessor* a, const double* v, size_t* len) { int do_pack_as_long = 0; - grib_context* c=a->context; - if(a->cclass->pack_long && a->cclass->pack_long != &pack_long) { + grib_context* c = a->context; + if (a->cclass->pack_long && a->cclass->pack_long != &pack_long) { do_pack_as_long = 1; - } else { + } + else { /* ECC-648: Special case of codetable */ - if (strcmp(a->cclass->name, "codetable")==0) { + if (strcmp(a->cclass->name, "codetable") == 0) { do_pack_as_long = 1; } } if (do_pack_as_long) { return pack_double_array_as_long(a, v, len); } - grib_context_log(c,GRIB_LOG_ERROR, "Should not grib_pack %s as double", a->name); + grib_context_log(c, GRIB_LOG_ERROR, "Should not grib_pack %s as double", a->name); return GRIB_NOT_IMPLEMENTED; } -static int pack_string_array(grib_accessor*a , const char** v, size_t *len) +static int pack_string_array(grib_accessor* a, const char** v, size_t* len) { long i; - int err = 0; - size_t length = 0; + int err = 0; + size_t length = 0; grib_accessor* as = 0; as = a; - i = (long)*len - 1; - while(as && i >= 0) { + i = (long)*len - 1; + while (as && i >= 0) { length = strlen(v[i]); - err = grib_pack_string(as, v[i], &length); - if (err) return err; + err = grib_pack_string(as, v[i], &length); + if (err) + return err; --i; as = as->same; } return GRIB_SUCCESS; } -static int pack_string(grib_accessor*a , const char* v, size_t *len){ - if(a->cclass->pack_double && a->cclass->pack_double != &pack_double) - { - size_t l = 1; +static int pack_string(grib_accessor* a, const char* v, size_t* len) +{ + if (a->cclass->pack_double && a->cclass->pack_double != &pack_double) { + size_t l = 1; double val = atof(v); - return grib_pack_double (a , &val, &l); + return grib_pack_double(a, &val, &l); } - if(a->cclass->pack_long && a->cclass->pack_long != &pack_long) - { + if (a->cclass->pack_long && a->cclass->pack_long != &pack_long) { size_t l = 1; long val = atof(v); - return grib_pack_long (a , &val, &l); + return grib_pack_long(a, &val, &l); } - grib_context_log(a->context,GRIB_LOG_ERROR, - " Should not grib_pack %s as string", a->name); + grib_context_log(a->context, GRIB_LOG_ERROR, + " Should not grib_pack %s as string", a->name); return GRIB_NOT_IMPLEMENTED; } -static int pack_bytes(grib_accessor* a, const unsigned char* val, size_t *len) +static int pack_bytes(grib_accessor* a, const unsigned char* val, size_t* len) { size_t length = *len; - grib_buffer_replace(a, val, length,1,1); + grib_buffer_replace(a, val, length, 1, 1); return GRIB_SUCCESS; } @@ -537,9 +533,9 @@ static void destroy(grib_context* ct, grib_accessor* a) { grib_dependency_remove_observed(a); grib_dependency_remove_observer(a); - if (a->vvalue!=NULL) { - grib_context_free(ct,a->vvalue); - a->vvalue=NULL; + if (a->vvalue != NULL) { + grib_context_free(ct, a->vvalue); + a->vvalue = NULL; } /*grib_context_log(ct,GRIB_LOG_DEBUG,"address=%p",a);*/ } @@ -549,27 +545,28 @@ static grib_section* sub_section(grib_accessor* a) return NULL; } -static int notify_change(grib_accessor* self,grib_accessor* observed) +static int notify_change(grib_accessor* self, grib_accessor* observed) { /* Default behaviour is to notify creator */ - return grib_action_notify_change(self->creator,self,observed); + return grib_action_notify_change(self->creator, self, observed); } -static void update_size(grib_accessor* a,size_t s) +static void update_size(grib_accessor* a, size_t s) { - grib_context_log(a->context,GRIB_LOG_ERROR, - "Accessor %s [%s] must implement 'update_size'", a->name,a->cclass->name); + grib_context_log(a->context, GRIB_LOG_ERROR, + "Accessor %s [%s] must implement 'update_size'", a->name, a->cclass->name); Assert(0 == 1); } static grib_accessor* next(grib_accessor* a, int mod) { - grib_accessor* next=NULL; + grib_accessor* next = NULL; if (a->next) { - next=a->next; - } else { + next = a->next; + } + else { if (a->parent->owner) - next=a->parent->owner->cclass->next(a->parent->owner,0); + next = a->parent->owner->cclass->next(a->parent->owner, 0); } return next; } @@ -581,32 +578,32 @@ static int compare(grib_accessor* a, grib_accessor* b) /* Redefined in all padding */ -static size_t preferred_size(grib_accessor* a,int from_handle) +static size_t preferred_size(grib_accessor* a, int from_handle) { return a->length; } static int is_missing(grib_accessor* a) { - int i=0; - int is_missing=1; - unsigned char ones=0xff; - unsigned char* v=NULL; + int i = 0; + int is_missing = 1; + unsigned char ones = 0xff; + unsigned char* v = NULL; if (a->flags & GRIB_ACCESSOR_FLAG_TRANSIENT) { if (a->vvalue == NULL) { - grib_context_log(a->context,GRIB_LOG_ERROR,"%s internal error (flags=0x%X)",a->name,a->flags); + grib_context_log(a->context, GRIB_LOG_ERROR, "%s internal error (flags=0x%X)", a->name, a->flags); } - Assert(a->vvalue!=NULL); + Assert(a->vvalue != NULL); return a->vvalue->missing; } - Assert(a->length>=0); + Assert(a->length >= 0); - v=grib_handle_of_accessor(a)->buffer->data+a->offset; + v = grib_handle_of_accessor(a)->buffer->data + a->offset; - for (i=0; i < a->length; i++) { + for (i = 0; i < a->length; i++) { if (*v != ones) { - is_missing=0; + is_missing = 0; break; } v++; @@ -620,13 +617,13 @@ static int unpack_double_element(grib_accessor* a, size_t i, double* val) return GRIB_NOT_IMPLEMENTED; } -static int unpack_double_subarray(grib_accessor* a, double* val,size_t start,size_t len) +static int unpack_double_subarray(grib_accessor* a, double* val, size_t start, size_t len) { return GRIB_NOT_IMPLEMENTED; } -static grib_accessor* make_clone(grib_accessor* a,grib_section* s,int* err) +static grib_accessor* make_clone(grib_accessor* a, grib_section* s, int* err) { - *err=GRIB_NOT_IMPLEMENTED; + *err = GRIB_NOT_IMPLEMENTED; return NULL; } diff --git a/src/grib_accessor_class_getenv.c b/src/grib_accessor_class_getenv.c index bfa9f5021..664192b4d 100644 --- a/src/grib_accessor_class_getenv.c +++ b/src/grib_accessor_class_getenv.c @@ -34,66 +34,67 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_string(grib_accessor*, const char*, size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); +static int pack_string(grib_accessor*, const char*, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); static size_t string_length(grib_accessor*); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_getenv { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in ascii */ -/* Members defined in getenv */ - const char* name; - char* value; - const char* default_value; +typedef struct grib_accessor_getenv +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in ascii */ + /* Members defined in getenv */ + const char* name; + char* value; + const char* default_value; } grib_accessor_getenv; extern grib_accessor_class* grib_accessor_class_ascii; static grib_accessor_class _grib_accessor_class_getenv = { - &grib_accessor_class_ascii, /* super */ - "getenv", /* name */ - sizeof(grib_accessor_getenv), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - &string_length, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - &pack_string, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_ascii, /* super */ + "getenv", /* name */ + sizeof(grib_accessor_getenv), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + &string_length, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + &pack_string, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -102,70 +103,73 @@ grib_accessor_class* grib_accessor_class_getenv = &_grib_accessor_class_getenv; static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* args) +static void init(grib_accessor* a, const long l, grib_arguments* args) { grib_accessor_getenv* self = (grib_accessor_getenv*)a; - static char undefined[]="undefined"; + static char undefined[] = "undefined"; - self->name=grib_arguments_get_string(grib_handle_of_accessor(a),args,0); - self->default_value=grib_arguments_get_string(grib_handle_of_accessor(a),args,1); - if (!self->default_value) self->default_value=undefined; - self->value=0; + self->name = grib_arguments_get_string(grib_handle_of_accessor(a), args, 0); + self->default_value = grib_arguments_get_string(grib_handle_of_accessor(a), args, 1); + if (!self->default_value) + self->default_value = undefined; + self->value = 0; } -static int pack_string(grib_accessor* a, const char* val, size_t *len) +static int pack_string(grib_accessor* a, const char* val, size_t* len) { return GRIB_NOT_IMPLEMENTED; } -static int unpack_string(grib_accessor* a, char* val, size_t *len) +static int unpack_string(grib_accessor* a, char* val, size_t* len) { grib_accessor_getenv* self = (grib_accessor_getenv*)a; - char* v=0; - size_t l=0; + char* v = 0; + size_t l = 0; if (!self->value) { - v=getenv(self->name); - if (!v) v=(char*)self->default_value; - self->value=v; + v = getenv(self->name); + if (!v) + v = (char*)self->default_value; + self->value = v; } - l=strlen(self->value); - if (*lenvalue); - *len=strlen(self->value); + l = strlen(self->value); + if (*len < l) + return GRIB_ARRAY_TOO_SMALL; + sprintf(val, "%s", self->value); + *len = strlen(self->value); return GRIB_SUCCESS; } diff --git a/src/grib_accessor_class_global_gaussian.c b/src/grib_accessor_class_global_gaussian.c index 6f7289463..fb36943c3 100644 --- a/src/grib_accessor_class_global_gaussian.c +++ b/src/grib_accessor_class_global_gaussian.c @@ -43,72 +43,73 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_global_gaussian { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in global_gaussian */ - const char* N; - const char* Ni; - const char* di; - const char* latfirst; - const char* lonfirst; - const char* latlast; - const char* lonlast; - const char* plpresent; - const char* pl; - const char* basic_angle; - const char* subdivision; +typedef struct grib_accessor_global_gaussian +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in global_gaussian */ + const char* N; + const char* Ni; + const char* di; + const char* latfirst; + const char* lonfirst; + const char* latlast; + const char* lonlast; + const char* plpresent; + const char* pl; + const char* basic_angle; + const char* subdivision; } grib_accessor_global_gaussian; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_global_gaussian = { - &grib_accessor_class_long, /* super */ - "global_gaussian", /* name */ - sizeof(grib_accessor_global_gaussian), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "global_gaussian", /* name */ + sizeof(grib_accessor_global_gaussian), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -117,259 +118,270 @@ grib_accessor_class* grib_accessor_class_global_gaussian = &_grib_accessor_class static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_global_gaussian* self = (grib_accessor_global_gaussian*)a; - int n = 0; - grib_handle* h = grib_handle_of_accessor(a); - - self->N = grib_arguments_get_name(h,c,n++); - self->Ni = grib_arguments_get_name(h,c,n++); - self->di = grib_arguments_get_name(h,c,n++); - self->latfirst = grib_arguments_get_name(h,c,n++); - self->lonfirst = grib_arguments_get_name(h,c,n++); - self->latlast = grib_arguments_get_name(h,c,n++); - self->lonlast = grib_arguments_get_name(h,c,n++); - self->plpresent = grib_arguments_get_name(h,c,n++); - self->pl = grib_arguments_get_name(h,c,n++); - self->basic_angle = grib_arguments_get_name(h,c,n++); - self->subdivision = grib_arguments_get_name(h,c,n++); + int n = 0; + grib_handle* h = grib_handle_of_accessor(a); + + self->N = grib_arguments_get_name(h, c, n++); + self->Ni = grib_arguments_get_name(h, c, n++); + self->di = grib_arguments_get_name(h, c, n++); + self->latfirst = grib_arguments_get_name(h, c, n++); + self->lonfirst = grib_arguments_get_name(h, c, n++); + self->latlast = grib_arguments_get_name(h, c, n++); + self->lonlast = grib_arguments_get_name(h, c, n++); + self->plpresent = grib_arguments_get_name(h, c, n++); + self->pl = grib_arguments_get_name(h, c, n++); + self->basic_angle = grib_arguments_get_name(h, c, n++); + self->subdivision = grib_arguments_get_name(h, c, n++); } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_global_gaussian* self = (grib_accessor_global_gaussian*)a; - int ret = GRIB_SUCCESS; - long latfirst,latlast,lonfirst,lonlast,basic_angle,subdivision,N,Ni; - double dlatfirst,dlatlast,dlonfirst,dlonlast; + int ret = GRIB_SUCCESS; + long latfirst, latlast, lonfirst, lonlast, basic_angle, subdivision, N, Ni; + double dlatfirst, dlatlast, dlonfirst, dlonlast; double angular_precision = 0; - double* lats = NULL; - long factor=1000, plpresent=0; - long max_pl=0; /* max. element of pl array */ - grib_context* c=a->context; - grib_handle* h = grib_handle_of_accessor(a); + double* lats = NULL; + long factor = 1000, plpresent = 0; + long max_pl = 0; /* max. element of pl array */ + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); if (self->basic_angle && self->subdivision) { - factor=1000000; - if((ret = grib_get_long_internal(h, self->basic_angle,&basic_angle)) != GRIB_SUCCESS) + factor = 1000000; + if ((ret = grib_get_long_internal(h, self->basic_angle, &basic_angle)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, self->subdivision,&subdivision)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, self->subdivision, &subdivision)) != GRIB_SUCCESS) return ret; - if ( (basic_angle !=0 && basic_angle != GRIB_MISSING_LONG) || - ( subdivision !=0 && subdivision != GRIB_MISSING_LONG) ) { - *val=0; + if ((basic_angle != 0 && basic_angle != GRIB_MISSING_LONG) || + (subdivision != 0 && subdivision != GRIB_MISSING_LONG)) { + *val = 0; return ret; } - } else { - factor=1000; } - angular_precision = 1.0/factor; + else { + factor = 1000; + } + angular_precision = 1.0 / factor; - if((ret = grib_get_long_internal(h, self->N,&N)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, self->N, &N)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, self->Ni,&Ni)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, self->Ni, &Ni)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, self->latfirst,&latfirst)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, self->latfirst, &latfirst)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, self->lonfirst,&lonfirst)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, self->lonfirst, &lonfirst)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, self->latlast,&latlast)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, self->latlast, &latlast)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, self->lonlast,&lonlast)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, self->lonlast, &lonlast)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, self->plpresent,&plpresent)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, self->plpresent, &plpresent)) != GRIB_SUCCESS) return ret; - dlatfirst=((double)latfirst)/factor; - dlatlast=((double)latlast)/factor; - dlonfirst=((double)lonfirst)/factor; - dlonlast=((double)lonlast)/factor; + dlatfirst = ((double)latfirst) / factor; + dlatlast = ((double)latlast) / factor; + dlonfirst = ((double)lonfirst) / factor; + dlonlast = ((double)lonlast) / factor; if (N == 0) { - grib_context_log(c,GRIB_LOG_ERROR,"global_gaussian unpack_long: N cannot be 0!"); + grib_context_log(c, GRIB_LOG_ERROR, "global_gaussian unpack_long: N cannot be 0!"); return GRIB_WRONG_GRID; } - lats=(double*)grib_context_malloc(c,sizeof(double)*N*2); + lats = (double*)grib_context_malloc(c, sizeof(double) * N * 2); if (!lats) { grib_context_log(c, GRIB_LOG_ERROR, - "global_gaussian unpack_long: Memory allocation error: %d bytes",sizeof(double)*N*2); + "global_gaussian unpack_long: Memory allocation error: %d bytes", sizeof(double) * N * 2); return GRIB_OUT_OF_MEMORY; } - if((ret = grib_get_gaussian_latitudes(N, lats)) != GRIB_SUCCESS) + if ((ret = grib_get_gaussian_latitudes(N, lats)) != GRIB_SUCCESS) return ret; /* GRIB-704: Work out the maximum element in pl array, if present */ - max_pl = 4*N; /* default */ + max_pl = 4 * N; /* default */ if (plpresent) { - size_t plsize=0, i=0; - long* pl=NULL; /* pl array */ - if((ret = grib_get_size(h,self->pl,&plsize)) != GRIB_SUCCESS) + size_t plsize = 0, i = 0; + long* pl = NULL; /* pl array */ + if ((ret = grib_get_size(h, self->pl, &plsize)) != GRIB_SUCCESS) return ret; Assert(plsize); - pl=(long*)grib_context_malloc_clear(c,sizeof(long)*plsize); - grib_get_long_array_internal(h,self->pl,pl, &plsize); + pl = (long*)grib_context_malloc_clear(c, sizeof(long) * plsize); + grib_get_long_array_internal(h, self->pl, pl, &plsize); max_pl = pl[0]; - for (i=1; i max_pl) max_pl = pl[i]; + for (i = 1; i < plsize; i++) { + if (pl[i] > max_pl) + max_pl = pl[i]; } grib_context_free(c, pl); } /* If Ni is missing, then this is a reduced gaussian grid */ - if (Ni == GRIB_MISSING_LONG ) Ni=max_pl; + if (Ni == GRIB_MISSING_LONG) + Ni = max_pl; - if (is_gaussian_global(dlatfirst,dlatlast,dlonfirst,dlonlast,Ni,lats,angular_precision)) { - *val=1; /* global */ - } else { - *val=0; /* not global */ + if (is_gaussian_global(dlatfirst, dlatlast, dlonfirst, dlonlast, Ni, lats, angular_precision)) { + *val = 1; /* global */ + } + else { + *val = 0; /* not global */ } - grib_context_free(c,lats); + grib_context_free(c, lats); return ret; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { grib_accessor_global_gaussian* self = (grib_accessor_global_gaussian*)a; - int ret=GRIB_SUCCESS; - long latfirst,latlast,lonfirst,lonlast,di,diold,basic_angle=0,N,Ni; + int ret = GRIB_SUCCESS; + long latfirst, latlast, lonfirst, lonlast, di, diold, basic_angle = 0, N, Ni; long factor; double* lats; - double ddi,dlonlast; - double dfactor,dNi; - long plpresent=0; - grib_context* c=a->context; - grib_handle* h = grib_handle_of_accessor(a); + double ddi, dlonlast; + double dfactor, dNi; + long plpresent = 0; + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); - if (*val == 0) return ret; + if (*val == 0) + return ret; - if (self->basic_angle) { - factor=1000000; - if((ret = grib_set_missing(h, self->subdivision)) != GRIB_SUCCESS) + if (self->basic_angle) { + factor = 1000000; + if ((ret = grib_set_missing(h, self->subdivision)) != GRIB_SUCCESS) return ret; - if((ret = grib_set_long_internal(h, self->basic_angle,basic_angle)) != GRIB_SUCCESS) + if ((ret = grib_set_long_internal(h, self->basic_angle, basic_angle)) != GRIB_SUCCESS) return ret; - } else factor=1000; + } + else + factor = 1000; - if((ret = grib_get_long_internal(h, self->N,&N)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, self->N, &N)) != GRIB_SUCCESS) + return ret; + if (N == 0) return ret; - if (N==0) return ret; - if((ret = grib_get_long_internal(h, self->Ni,&Ni)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, self->Ni, &Ni)) != GRIB_SUCCESS) + return ret; + if (Ni == GRIB_MISSING_LONG) + Ni = N * 4; + if (Ni == 0) return ret; - if (Ni == GRIB_MISSING_LONG ) Ni=N*4; - if (Ni==0) return ret; - if((ret = grib_get_long_internal(h, self->di,&diold)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, self->di, &diold)) != GRIB_SUCCESS) return ret; - lats=(double*)grib_context_malloc(c,sizeof(double)*N*2); + lats = (double*)grib_context_malloc(c, sizeof(double) * N * 2); if (!lats) { - grib_context_log(c,GRIB_LOG_FATAL, - "global_gaussian pack_long: Memory allocation error: %d bytes",sizeof(double)*N*2); + grib_context_log(c, GRIB_LOG_FATAL, + "global_gaussian pack_long: Memory allocation error: %d bytes", sizeof(double) * N * 2); return GRIB_OUT_OF_MEMORY; } - if((ret = grib_get_gaussian_latitudes(N, lats)) != GRIB_SUCCESS) + if ((ret = grib_get_gaussian_latitudes(N, lats)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, self->plpresent,&plpresent)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, self->plpresent, &plpresent)) != GRIB_SUCCESS) return ret; /* GRIB-854: For octahedral grids, get max of pl array */ if (plpresent) { - size_t plsize=0, i=0; - long* pl=NULL; /* pl array */ - long max_pl=0; /* max. element of pl array */ + size_t plsize = 0, i = 0; + long* pl = NULL; /* pl array */ + long max_pl = 0; /* max. element of pl array */ - if((ret = grib_get_size(h,self->pl,&plsize)) != GRIB_SUCCESS) + if ((ret = grib_get_size(h, self->pl, &plsize)) != GRIB_SUCCESS) return ret; Assert(plsize); - pl=(long*)grib_context_malloc_clear(c,sizeof(long)*plsize); - grib_get_long_array_internal(h,self->pl,pl, &plsize); + pl = (long*)grib_context_malloc_clear(c, sizeof(long) * plsize); + grib_get_long_array_internal(h, self->pl, pl, &plsize); max_pl = pl[0]; - for (i=1; i 0 ); - if (pl[i] > max_pl) max_pl = pl[i]; + for (i = 1; i < plsize; i++) { + Assert(pl[i] > 0); + if (pl[i] > max_pl) + max_pl = pl[i]; } grib_context_free(c, pl); Ni = max_pl; } /* rounding */ - latfirst=(long)(lats[0]*factor+0.5); - latlast=-latfirst; - lonfirst=0; - dfactor=(double)factor; - dNi=(double)Ni; - ddi=(360.0*dfactor)/dNi; - dlonlast=(360.0*dfactor)-ddi+0.5; - ddi=ddi+0.5; - di=ddi; - lonlast=dlonlast; - - grib_context_free(c,lats); - - if((ret = grib_set_long_internal(h, self->latfirst,latfirst)) != GRIB_SUCCESS) + latfirst = (long)(lats[0] * factor + 0.5); + latlast = -latfirst; + lonfirst = 0; + dfactor = (double)factor; + dNi = (double)Ni; + ddi = (360.0 * dfactor) / dNi; + dlonlast = (360.0 * dfactor) - ddi + 0.5; + ddi = ddi + 0.5; + di = ddi; + lonlast = dlonlast; + + grib_context_free(c, lats); + + if ((ret = grib_set_long_internal(h, self->latfirst, latfirst)) != GRIB_SUCCESS) return ret; - if((ret = grib_set_long_internal(h, self->lonfirst,lonfirst)) != GRIB_SUCCESS) + if ((ret = grib_set_long_internal(h, self->lonfirst, lonfirst)) != GRIB_SUCCESS) return ret; - if((ret = grib_set_long_internal(h, self->latlast,latlast)) != GRIB_SUCCESS) + if ((ret = grib_set_long_internal(h, self->latlast, latlast)) != GRIB_SUCCESS) return ret; - if((ret = grib_set_long_internal(h, self->lonlast,lonlast)) != GRIB_SUCCESS) + if ((ret = grib_set_long_internal(h, self->lonlast, lonlast)) != GRIB_SUCCESS) return ret; if (diold != GRIB_MISSING_LONG) - if((ret = grib_set_long_internal(h, self->di,di)) != GRIB_SUCCESS) + if ((ret = grib_set_long_internal(h, self->di, di)) != GRIB_SUCCESS) return ret; return GRIB_SUCCESS; diff --git a/src/grib_accessor_class_group.c b/src/grib_accessor_class_group.c index f1d21d2cc..3651d15dd 100644 --- a/src/grib_accessor_class_group.c +++ b/src/grib_accessor_class_group.c @@ -41,72 +41,73 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int pack_string(grib_accessor*, const char*, size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); +static int get_native_type(grib_accessor*); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int pack_string(grib_accessor*, const char*, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); static size_t string_length(grib_accessor*); static long next_offset(grib_accessor*); -static int value_count(grib_accessor*,long*); +static int value_count(grib_accessor*, long*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void post_init(grib_accessor*); static void init_class(grib_accessor_class*); static int compare(grib_accessor*, grib_accessor*); -typedef struct grib_accessor_group { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in group */ - char endCharacter; +typedef struct grib_accessor_group +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in group */ + char endCharacter; } grib_accessor_group; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_group = { - &grib_accessor_class_gen, /* super */ - "group", /* name */ - sizeof(grib_accessor_group), /* size */ + &grib_accessor_class_gen, /* super */ + "group", /* name */ + sizeof(grib_accessor_group), /* size */ 0, /* inited */ &init_class, /* init_class */ &init, /* init */ &post_init, /* post_init */ - 0, /* free mem */ + 0, /* free mem */ &dump, /* describes himself */ &next_offset, /* get length of section */ &string_length, /* get length of string */ &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ &unpack_double, /* grib_unpack procedures double */ &pack_string, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -115,65 +116,74 @@ grib_accessor_class* grib_accessor_class_group = &_grib_accessor_class_group; static void init_class(grib_accessor_class* c) { - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len , grib_arguments* arg ) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { - grib_buffer* buffer=grib_handle_of_accessor(a)->buffer; - grib_accessor_group* self=(grib_accessor_group*)a; + grib_buffer* buffer = grib_handle_of_accessor(a)->buffer; + grib_accessor_group* self = (grib_accessor_group*)a; - size_t i=0; + size_t i = 0; unsigned char* v; - const char *s=grib_arguments_get_string(grib_handle_of_accessor(a),arg,0); + const char* s = grib_arguments_get_string(grib_handle_of_accessor(a), arg, 0); if (s && strlen(s) > 1) { - grib_context_log(a->context,GRIB_LOG_WARNING, - "Using only first character as group end of %s not the string %s",a->name,s); + grib_context_log(a->context, GRIB_LOG_WARNING, + "Using only first character as group end of %s not the string %s", a->name, s); } - self->endCharacter= s ? s[0] : 0; + self->endCharacter = s ? s[0] : 0; - v=buffer->data+a->offset; - i=0; + v = buffer->data + a->offset; + i = 0; if (s) { - while (*v!=self->endCharacter && i<=buffer->ulength) { if(*v>126) *v=32; v++; i++; } - } else { - while (*v>32 && *v!=61 && *v<127 && i<=buffer->ulength) { v++; i++; } + while (*v != self->endCharacter && i <= buffer->ulength) { + if (*v > 126) + *v = 32; + v++; + i++; + } + } + else { + while (*v > 32 && *v != 61 && *v < 127 && i <= buffer->ulength) { + v++; + i++; + } } - a->length=i; + a->length = i; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } -static void post_init(grib_accessor* a ) +static void post_init(grib_accessor* a) { } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - *count=1; + *count = 1; return 0; } @@ -184,130 +194,134 @@ static size_t string_length(grib_accessor* a) static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_string(dumper,a,NULL); + grib_dump_string(dumper, a, NULL); } -static int get_native_type(grib_accessor* a) +static int get_native_type(grib_accessor* a) { return GRIB_TYPE_STRING; } -static int unpack_string(grib_accessor* a, char* val, size_t *len) +static int unpack_string(grib_accessor* a, char* val, size_t* len) { int i = 0; - if(len[0] < (a->length+1)) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%d) for %s it contains %d values ", len[0], a->name , a->length+1 ); + if (len[0] < (a->length + 1)) { + grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%d) for %s it contains %d values ", len[0], a->name, a->length + 1); len[0] = 0; return GRIB_ARRAY_TOO_SMALL; } - for ( i = 0; i < a->length; i++) - val[i] = grib_handle_of_accessor(a)->buffer->data[a->offset+i]; + for (i = 0; i < a->length; i++) + val[i] = grib_handle_of_accessor(a)->buffer->data[a->offset + i]; val[i] = 0; len[0] = i; return GRIB_SUCCESS; } -static int pack_string(grib_accessor* a, const char* val, size_t *len) +static int pack_string(grib_accessor* a, const char* val, size_t* len) { return GRIB_NOT_IMPLEMENTED; } -static int pack_long(grib_accessor* a, const long* v, size_t *len) +static int pack_long(grib_accessor* a, const long* v, size_t* len) { - grib_context_log(a->context,GRIB_LOG_ERROR, " Should not pack %s as long", a->name); + grib_context_log(a->context, GRIB_LOG_ERROR, " Should not pack %s as long", a->name); return GRIB_NOT_IMPLEMENTED; } -static int pack_double(grib_accessor* a, const double*v, size_t *len) +static int pack_double(grib_accessor* a, const double* v, size_t* len) { - grib_context_log(a->context,GRIB_LOG_ERROR, " Should not pack %s as double", a->name); + grib_context_log(a->context, GRIB_LOG_ERROR, " Should not pack %s as double", a->name); return GRIB_NOT_IMPLEMENTED; } -static int unpack_long(grib_accessor* a, long* v, size_t *len) +static int unpack_long(grib_accessor* a, long* v, size_t* len) { + char val[1024] = {0,}; + size_t l = sizeof(val); + size_t i = 0; + char* last = NULL; + int err = grib_unpack_string(a, val, &l); - char val[1024]={0,}; - size_t l = sizeof(val); - size_t i =0; - char *last = NULL; - int err=grib_unpack_string (a , val, &l); - - if (err) return err; + if (err) + return err; - i=0; - while ( val[i]==' ' && val[i]!=0 && icontext,GRIB_LOG_DEBUG, " Casting string %s to long", a->name); + grib_context_log(a->context, GRIB_LOG_DEBUG, " Casting string %s to long", a->name); return GRIB_SUCCESS; } -static int unpack_double(grib_accessor* a, double*v, size_t *len) +static int unpack_double(grib_accessor* a, double* v, size_t* len) { char val[1024]; - size_t l = sizeof(val); - char *last = NULL; - grib_unpack_string (a , val, &l); + size_t l = sizeof(val); + char* last = NULL; + grib_unpack_string(a, val, &l); - *v = strtod(val,&last); + *v = strtod(val, &last); - if(*last == 0) - { - grib_context_log(a->context,GRIB_LOG_DEBUG, " Casting string %s to long", a->name); + if (*last == 0) { + grib_context_log(a->context, GRIB_LOG_DEBUG, " Casting string %s to long", a->name); return GRIB_SUCCESS; } return GRIB_NOT_IMPLEMENTED; } -static int compare(grib_accessor* a,grib_accessor* b) +static int compare(grib_accessor* a, grib_accessor* b) { - int retval=0; - char *aval=0; - char *bval=0; - int err=0; + int retval = 0; + char* aval = 0; + char* bval = 0; + int err = 0; size_t alen = 0; size_t blen = 0; - long count=0; + long count = 0; - err=grib_value_count(a,&count); - if (err) return err; - alen=count; + err = grib_value_count(a, &count); + if (err) + return err; + alen = count; - err=grib_value_count(b,&count); - if (err) return err; - blen=count; + err = grib_value_count(b, &count); + if (err) + return err; + blen = count; - if (alen != blen) return GRIB_COUNT_MISMATCH; + if (alen != blen) + return GRIB_COUNT_MISMATCH; - aval=(char*)grib_context_malloc(a->context,alen*sizeof(char)); - bval=(char*)grib_context_malloc(b->context,blen*sizeof(char)); + aval = (char*)grib_context_malloc(a->context, alen * sizeof(char)); + bval = (char*)grib_context_malloc(b->context, blen * sizeof(char)); - grib_unpack_string(a,aval,&alen); - grib_unpack_string(b,bval,&blen); + grib_unpack_string(a, aval, &alen); + grib_unpack_string(b, bval, &blen); retval = GRIB_SUCCESS; - if (strcmp(aval,bval)) retval = GRIB_STRING_VALUE_MISMATCH; + if (strcmp(aval, bval)) + retval = GRIB_STRING_VALUE_MISMATCH; - grib_context_free(a->context,aval); - grib_context_free(b->context,bval); + grib_context_free(a->context, aval); + grib_context_free(b->context, bval); return retval; } static long next_offset(grib_accessor* a) { - return a->offset+a->length; + return a->offset + a->length; } diff --git a/src/grib_accessor_class_gts_header.c b/src/grib_accessor_class_gts_header.c index 9c735503f..21527c41f 100644 --- a/src/grib_accessor_class_gts_header.c +++ b/src/grib_accessor_class_gts_header.c @@ -33,65 +33,66 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_string(grib_accessor*, const char*, size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); +static int pack_string(grib_accessor*, const char*, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); static size_t string_length(grib_accessor*); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_gts_header { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in ascii */ -/* Members defined in gts_header */ - int gts_offset; - int gts_length; +typedef struct grib_accessor_gts_header +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in ascii */ + /* Members defined in gts_header */ + int gts_offset; + int gts_length; } grib_accessor_gts_header; extern grib_accessor_class* grib_accessor_class_ascii; static grib_accessor_class _grib_accessor_class_gts_header = { - &grib_accessor_class_ascii, /* super */ - "gts_header", /* name */ - sizeof(grib_accessor_gts_header), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - &string_length, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - &pack_string, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_ascii, /* super */ + "gts_header", /* name */ + sizeof(grib_accessor_gts_header), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + &string_length, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + &pack_string, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -100,86 +101,87 @@ grib_accessor_class* grib_accessor_class_gts_header = &_grib_accessor_class_gts_ static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { - grib_accessor_gts_header* self = (grib_accessor_gts_header*)a; - self->gts_offset = -1; - self->gts_length = -1; - self->gts_offset = grib_arguments_get_long(grib_handle_of_accessor(a),c,0); - self->gts_length = grib_arguments_get_long(grib_handle_of_accessor(a),c,1); + grib_accessor_gts_header* self = (grib_accessor_gts_header*)a; + self->gts_offset = -1; + self->gts_length = -1; + self->gts_offset = grib_arguments_get_long(grib_handle_of_accessor(a), c, 0); + self->gts_length = grib_arguments_get_long(grib_handle_of_accessor(a), c, 1); } -static int pack_string(grib_accessor* a, const char* val, size_t *len){ - - return GRIB_NOT_IMPLEMENTED; - +static int pack_string(grib_accessor* a, const char* val, size_t* len) +{ + return GRIB_NOT_IMPLEMENTED; } -static int unpack_string(grib_accessor* a, char* val, size_t *len) -{ - grib_accessor_gts_header* self=(grib_accessor_gts_header*)a; - grib_handle* h=grib_handle_of_accessor(a); - int offset=0; - int length=0; +static int unpack_string(grib_accessor* a, char* val, size_t* len) +{ + grib_accessor_gts_header* self = (grib_accessor_gts_header*)a; + grib_handle* h = grib_handle_of_accessor(a); + int offset = 0; + int length = 0; + + if (h->gts_header == NULL || h->gts_header_len < 8) { + if (*len < 8) + return GRIB_ARRAY_TOO_SMALL; + sprintf(val, "missing"); + return GRIB_SUCCESS; + } + if (*len < h->gts_header_len) + return GRIB_ARRAY_TOO_SMALL; - if (h->gts_header==NULL || h->gts_header_len<8) { - if (*len < 8) return GRIB_ARRAY_TOO_SMALL; - sprintf(val,"missing"); - return GRIB_SUCCESS; - } - if (*len < h->gts_header_len ) return GRIB_ARRAY_TOO_SMALL; + offset = self->gts_offset > 0 ? self->gts_offset : 0; + length = self->gts_length > 0 ? self->gts_length : h->gts_header_len; - offset = self->gts_offset > 0 ? self->gts_offset : 0; - length = self->gts_length > 0 ? self->gts_length : h->gts_header_len; - - memcpy(val,h->gts_header+offset , length); + memcpy(val, h->gts_header + offset, length); - *len = length; + *len = length; - return GRIB_SUCCESS; + return GRIB_SUCCESS; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - *count=1; - return 0; + *count = 1; + return 0; } static size_t string_length(grib_accessor* a) { - grib_handle* h=grib_handle_of_accessor(a); - return h->gts_header_len; + grib_handle* h = grib_handle_of_accessor(a); + return h->gts_header_len; } diff --git a/src/grib_accessor_class_hash_array.c b/src/grib_accessor_class_hash_array.c index 6fd96eb42..d5b8d57b7 100644 --- a/src/grib_accessor_class_hash_array.c +++ b/src/grib_accessor_class_hash_array.c @@ -42,72 +42,73 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int pack_string(grib_accessor*, const char*, size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); +static int get_native_type(grib_accessor*); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int pack_string(grib_accessor*, const char*, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); static size_t string_length(grib_accessor*); -static int value_count(grib_accessor*,long*); -static void destroy(grib_context*,grib_accessor*); +static int value_count(grib_accessor*, long*); +static void destroy(grib_context*, grib_accessor*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); static int compare(grib_accessor*, grib_accessor*); -typedef struct grib_accessor_hash_array { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in hash_array */ - char* key; - grib_hash_array_value* ha; +typedef struct grib_accessor_hash_array +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in hash_array */ + char* key; + grib_hash_array_value* ha; } grib_accessor_hash_array; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_hash_array = { - &grib_accessor_class_gen, /* super */ - "hash_array", /* name */ - sizeof(grib_accessor_hash_array), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - &string_length, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - &pack_string, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "hash_array", /* name */ + sizeof(grib_accessor_hash_array), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + &destroy, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + &string_length, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + &pack_string, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + &compare, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -116,142 +117,145 @@ grib_accessor_class* grib_accessor_class_hash_array = &_grib_accessor_class_hash static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ #define MAX_HASH_ARRAY_STRING_LENGTH 255 -static void init(grib_accessor* a, const long len , grib_arguments* args ) +static void init(grib_accessor* a, const long len, grib_arguments* args) { - grib_accessor_hash_array* self=(grib_accessor_hash_array*)a; - a->length = 0; - self->key=0; - self->ha=NULL; + grib_accessor_hash_array* self = (grib_accessor_hash_array*)a; + a->length = 0; + self->key = 0; + self->ha = NULL; } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_string(dumper,a,NULL); + grib_dump_string(dumper, a, NULL); } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { - grib_accessor_hash_array* self=(grib_accessor_hash_array*)a; - char s[200]={0,}; - sprintf(s,"%g",*val); - self->key=grib_context_strdup(a->context,s); - self->ha=0; + grib_accessor_hash_array* self = (grib_accessor_hash_array*)a; + char s[200] = {0,}; + sprintf(s, "%g", *val); + self->key = grib_context_strdup(a->context, s); + self->ha = 0; return GRIB_SUCCESS; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { - grib_accessor_hash_array* self=(grib_accessor_hash_array*)a; - char s[200]={0,}; - sprintf(s,"%ld",*val); - if (self->key) grib_context_free(a->context,self->key); - self->key=grib_context_strdup(a->context,s); - self->ha=0; + grib_accessor_hash_array* self = (grib_accessor_hash_array*)a; + char s[200] = {0,}; + sprintf(s, "%ld", *val); + if (self->key) + grib_context_free(a->context, self->key); + self->key = grib_context_strdup(a->context, s); + self->ha = 0; return GRIB_SUCCESS; } -static int pack_string(grib_accessor*a , const char* v, size_t *len) +static int pack_string(grib_accessor* a, const char* v, size_t* len) { - grib_accessor_hash_array* self=(grib_accessor_hash_array*)a; - self->key=grib_context_strdup(a->context,v); - self->ha=0; + grib_accessor_hash_array* self = (grib_accessor_hash_array*)a; + self->key = grib_context_strdup(a->context, v); + self->ha = 0; return GRIB_SUCCESS; } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { return GRIB_NOT_IMPLEMENTED; } -static grib_hash_array_value* find_hash_value(grib_accessor* a,int *err) +static grib_hash_array_value* find_hash_value(grib_accessor* a, int* err) { - grib_accessor_hash_array* self=(grib_accessor_hash_array*)a; - grib_hash_array_value* ha_ret=0; - grib_hash_array_value* ha=NULL; + grib_accessor_hash_array* self = (grib_accessor_hash_array*)a; + grib_hash_array_value* ha_ret = 0; + grib_hash_array_value* ha = NULL; - ha=get_hash_array(grib_handle_of_accessor(a),a->creator); + ha = get_hash_array(grib_handle_of_accessor(a), a->creator); if (!ha) { - grib_context_log(a->context,GRIB_LOG_ERROR, - "unable to get hash value for %s", a->creator->name); - *err=GRIB_HASH_ARRAY_NO_MATCH; + grib_context_log(a->context, GRIB_LOG_ERROR, + "unable to get hash value for %s", a->creator->name); + *err = GRIB_HASH_ARRAY_NO_MATCH; return NULL; } - *err=GRIB_SUCCESS; + *err = GRIB_SUCCESS; - Assert(ha!=NULL); + Assert(ha != NULL); if (!self->key) { - grib_context_log(a->context,GRIB_LOG_ERROR, - "unable to get hash value for %s, set before getting",a->creator->name); - *err=GRIB_HASH_ARRAY_NO_MATCH; + grib_context_log(a->context, GRIB_LOG_ERROR, + "unable to get hash value for %s, set before getting", a->creator->name); + *err = GRIB_HASH_ARRAY_NO_MATCH; return NULL; } - ha_ret=(grib_hash_array_value*)grib_trie_get(ha->index,self->key); - if (!ha_ret) ha_ret=(grib_hash_array_value*)grib_trie_get(ha->index,"default"); + ha_ret = (grib_hash_array_value*)grib_trie_get(ha->index, self->key); + if (!ha_ret) + ha_ret = (grib_hash_array_value*)grib_trie_get(ha->index, "default"); - if (!ha_ret) { - *err=GRIB_HASH_ARRAY_NO_MATCH; - grib_context_log(a->context,GRIB_LOG_ERROR, - "hash_array: no match for %s=%s", - a->creator->name,self->key); + if (!ha_ret) { + *err = GRIB_HASH_ARRAY_NO_MATCH; + grib_context_log(a->context, GRIB_LOG_ERROR, + "hash_array: no match for %s=%s", + a->creator->name, self->key); return NULL; } return ha_ret; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - grib_hash_array_value* ha=0; - grib_accessor_hash_array* self=(grib_accessor_hash_array*)a; - int err=0; + grib_hash_array_value* ha = 0; + grib_accessor_hash_array* self = (grib_accessor_hash_array*)a; + int err = 0; int i; if (!self->ha) { - ha=find_hash_value(a,&err); - if (err) return err; - self->ha=ha; + ha = find_hash_value(a, &err); + if (err) + return err; + self->ha = ha; } switch (self->ha->type) { - case GRIB_HASH_ARRAY_TYPE_INTEGER: - if (*lenha->iarray->n) { - return GRIB_ARRAY_TOO_SMALL; - } - *len=self->ha->iarray->n; - for (i=0;i<*len;i++) - val[i]=self->ha->iarray->v[i]; - break; - - default: - return GRIB_NOT_IMPLEMENTED; + case GRIB_HASH_ARRAY_TYPE_INTEGER: + if (*len < self->ha->iarray->n) { + return GRIB_ARRAY_TOO_SMALL; + } + *len = self->ha->iarray->n; + for (i = 0; i < *len; i++) + val[i] = self->ha->iarray->v[i]; + break; + + default: + return GRIB_NOT_IMPLEMENTED; } return GRIB_SUCCESS; @@ -259,20 +263,21 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) static int get_native_type(grib_accessor* a) { - int type=GRIB_TYPE_STRING; + int type = GRIB_TYPE_STRING; if (a->flags & GRIB_ACCESSOR_FLAG_LONG_TYPE) - type=GRIB_TYPE_LONG; + type = GRIB_TYPE_LONG; return type; } -static void destroy(grib_context* c,grib_accessor* a) +static void destroy(grib_context* c, grib_accessor* a) { - grib_accessor_hash_array *self = (grib_accessor_hash_array*)a; - if (self->key) grib_context_free(c,self->key); + grib_accessor_hash_array* self = (grib_accessor_hash_array*)a; + if (self->key) + grib_context_free(c, self->key); } -static int unpack_string (grib_accessor* a, char* val, size_t *len) +static int unpack_string(grib_accessor* a, char* val, size_t* len) { return GRIB_NOT_IMPLEMENTED; } @@ -282,23 +287,24 @@ static size_t string_length(grib_accessor* a) return MAX_HASH_ARRAY_STRING_LENGTH; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - int err=0; - grib_accessor_hash_array *self = (grib_accessor_hash_array*)a; - grib_hash_array_value* ha=0; + int err = 0; + grib_accessor_hash_array* self = (grib_accessor_hash_array*)a; + grib_hash_array_value* ha = 0; if (!self->ha) { - ha=find_hash_value(a,&err); - if (err) return err; - self->ha=ha; + ha = find_hash_value(a, &err); + if (err) + return err; + self->ha = ha; } - *count=self->ha->iarray->n; + *count = self->ha->iarray->n; return err; } -static int compare(grib_accessor* a,grib_accessor* b) +static int compare(grib_accessor* a, grib_accessor* b) { return GRIB_NOT_IMPLEMENTED; } diff --git a/src/grib_accessor_class_headers_only.c b/src/grib_accessor_class_headers_only.c index 97bdab972..8e482e3c2 100644 --- a/src/grib_accessor_class_headers_only.c +++ b/src/grib_accessor_class_headers_only.c @@ -30,60 +30,61 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int get_native_type(grib_accessor*); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_headers_only { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in headers_only */ +typedef struct grib_accessor_headers_only +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in headers_only */ } grib_accessor_headers_only; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_headers_only = { - &grib_accessor_class_gen, /* super */ - "headers_only", /* name */ - sizeof(grib_accessor_headers_only), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "headers_only", /* name */ + sizeof(grib_accessor_headers_only), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -92,55 +93,55 @@ grib_accessor_class* grib_accessor_class_headers_only = &_grib_accessor_class_he static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->flags |= GRIB_ACCESSOR_FLAG_HIDDEN; - a->length=0; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->flags |= GRIB_ACCESSOR_FLAG_HIDDEN; + a->length = 0; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { *val = grib_handle_of_accessor(a)->partial; - *len =1; + *len = 1; return 0; } -static int get_native_type(grib_accessor* a) +static int get_native_type(grib_accessor* a) { return GRIB_TYPE_LONG; } diff --git a/src/grib_accessor_class_ibmfloat.c b/src/grib_accessor_class_ibmfloat.c index 127089c74..814c23c3d 100644 --- a/src/grib_accessor_class_ibmfloat.c +++ b/src/grib_accessor_class_ibmfloat.c @@ -43,68 +43,69 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); static long byte_count(grib_accessor*); static long byte_offset(grib_accessor*); static long next_offset(grib_accessor*); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -static void update_size(grib_accessor*,size_t); -static int nearest_smaller_value (grib_accessor*, double,double*); - -typedef struct grib_accessor_ibmfloat { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in double */ -/* Members defined in ibmfloat */ - grib_arguments* arg; +static void update_size(grib_accessor*, size_t); +static int nearest_smaller_value(grib_accessor*, double, double*); + +typedef struct grib_accessor_ibmfloat +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in double */ + /* Members defined in ibmfloat */ + grib_arguments* arg; } grib_accessor_ibmfloat; extern grib_accessor_class* grib_accessor_class_double; static grib_accessor_class _grib_accessor_class_ibmfloat = { - &grib_accessor_class_double, /* super */ - "ibmfloat", /* name */ - sizeof(grib_accessor_ibmfloat), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - &next_offset, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - &byte_count, /* get number of bytes */ - &byte_offset, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - &update_size, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - &nearest_smaller_value, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_double, /* super */ + "ibmfloat", /* name */ + sizeof(grib_accessor_ibmfloat), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + &next_offset, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + &byte_count, /* get number of bytes */ + &byte_offset, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + &update_size, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + &nearest_smaller_value, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -113,117 +114,118 @@ grib_accessor_class* grib_accessor_class_ibmfloat = &_grib_accessor_class_ibmflo static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->string_length = (*(c->super))->string_length; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->string_length = (*(c->super))->string_length; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len, grib_arguments* arg) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { grib_accessor_ibmfloat* self = (grib_accessor_ibmfloat*)a; - long count=0; + long count = 0; self->arg = arg; - grib_value_count(a,&count); - a->length = 4*count; - Assert(a->length>=0); + grib_value_count(a, &count); + a->length = 4 * count; + Assert(a->length >= 0); } -static int unpack_double (grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { unsigned long rlen = 0; - long count=0; - int err=0; - unsigned long i = 0; - long bitp = a->offset*8; - - err=grib_value_count(a,&count); - if (err) return err; - rlen=count; - - if(*len < rlen) - { - grib_context_log(a->context, GRIB_LOG_ERROR, " wrong size (%ld) for %s it contains %d values ", *len,a->name , rlen); + long count = 0; + int err = 0; + unsigned long i = 0; + long bitp = a->offset * 8; + + err = grib_value_count(a, &count); + if (err) + return err; + rlen = count; + + if (*len < rlen) { + grib_context_log(a->context, GRIB_LOG_ERROR, " wrong size (%ld) for %s it contains %d values ", *len, a->name, rlen); *len = 0; return GRIB_ARRAY_TOO_SMALL; } - for(i=0; i< rlen; i++) - val[i] = grib_long_to_ibm(grib_decode_unsigned_long(grib_handle_of_accessor(a)->buffer->data,&bitp,32)); + for (i = 0; i < rlen; i++) + val[i] = grib_long_to_ibm(grib_decode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, &bitp, 32)); *len = rlen; return GRIB_SUCCESS; } -static int pack_double (grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { grib_accessor_ibmfloat* self = (grib_accessor_ibmfloat*)a; - int ret = 0; - unsigned long i = 0; - unsigned long rlen = *len; - size_t buflen = 0; - unsigned char *buf = NULL; - long off = 0; - - if(*len < 1) - { - grib_context_log(a->context, GRIB_LOG_ERROR, " wrong size for %s it pack at least 1 values ", a->name , rlen ); + int ret = 0; + unsigned long i = 0; + unsigned long rlen = *len; + size_t buflen = 0; + unsigned char* buf = NULL; + long off = 0; + + if (*len < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, " wrong size for %s it pack at least 1 values ", a->name, rlen); *len = 0; return GRIB_ARRAY_TOO_SMALL; } - if (rlen == 1){ + if (rlen == 1) { /* double x = 0; grib_nearest_smaller_ibm_float(val[0],&x); double y = grib_long_to_ibm(grib_ibm_to_long(val[0])); printf("IBMFLOAT val=%.20f nearest_smaller_ibm_float=%.20f long_to_ibm=%.20f\n",val[0],x ,y); */ - off = byte_offset(a)*8; - ret = grib_encode_unsigned_long(grib_handle_of_accessor(a)->buffer->data,grib_ibm_to_long(val[0]), &off, 32); - if (*len > 1) grib_context_log(a->context, GRIB_LOG_WARNING, "grib_accessor_unsigned : Trying to pack %d values in a scalar %s, packing first value", *len, a->name ); - if (ret == GRIB_SUCCESS) len[0] = 1; + off = byte_offset(a) * 8; + ret = grib_encode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, grib_ibm_to_long(val[0]), &off, 32); + if (*len > 1) + grib_context_log(a->context, GRIB_LOG_WARNING, "grib_accessor_unsigned : Trying to pack %d values in a scalar %s, packing first value", *len, a->name); + if (ret == GRIB_SUCCESS) + len[0] = 1; return ret; } - buflen = rlen*4; + buflen = rlen * 4; - buf = (unsigned char*)grib_context_malloc(a->context,buflen); + buf = (unsigned char*)grib_context_malloc(a->context, buflen); - for(i=0; i < rlen;i++){ - grib_encode_unsigned_longb(buf,grib_ibm_to_long(val[i]), &off, 32); + for (i = 0; i < rlen; i++) { + grib_encode_unsigned_longb(buf, grib_ibm_to_long(val[i]), &off, 32); } - ret = grib_set_long_internal(grib_handle_of_accessor(a),grib_arguments_get_name(a->parent->h,self->arg,0),rlen); + ret = grib_set_long_internal(grib_handle_of_accessor(a), grib_arguments_get_name(a->parent->h, self->arg, 0), rlen); - if(ret == GRIB_SUCCESS) - grib_buffer_replace(a, buf, buflen,1,1); + if (ret == GRIB_SUCCESS) + grib_buffer_replace(a, buf, buflen, 1, 1); else *len = 0; - grib_context_free(a->context,buf); + grib_context_free(a->context, buf); a->length = byte_count(a); @@ -235,35 +237,38 @@ static long byte_count(grib_accessor* a) return a->length; } -static int value_count(grib_accessor* a,long* len) +static int value_count(grib_accessor* a, long* len) { grib_accessor_ibmfloat* self = (grib_accessor_ibmfloat*)a; - *len = 0; - if(!self->arg) {*len=1;return 0;} - return grib_get_long_internal(grib_handle_of_accessor(a),grib_arguments_get_name(a->parent->h,self->arg,0),len); + *len = 0; + if (!self->arg) { + *len = 1; + return 0; + } + return grib_get_long_internal(grib_handle_of_accessor(a), grib_arguments_get_name(a->parent->h, self->arg, 0), len); } static long byte_offset(grib_accessor* a) { return a->offset; } -static void update_size(grib_accessor* a,size_t s) +static void update_size(grib_accessor* a, size_t s) { a->length = s; - Assert(a->length>=0); + Assert(a->length >= 0); } static long next_offset(grib_accessor* a) { - return grib_byte_offset(a)+grib_byte_count(a); + return grib_byte_offset(a) + grib_byte_count(a); } -static int nearest_smaller_value(grib_accessor* a, double val,double* nearest) +static int nearest_smaller_value(grib_accessor* a, double val, double* nearest) { - int ret=0; - if (grib_nearest_smaller_ibm_float(val,nearest)==GRIB_INTERNAL_ERROR) { - grib_context_log(a->context,GRIB_LOG_ERROR,"grib_nearest_smaller_ibm_float overflow value=%g\n",val); - grib_dump_content(grib_handle_of_accessor(a),stderr,"wmo",GRIB_DUMP_FLAG_HEXADECIMAL,0); - ret=GRIB_INTERNAL_ERROR; + int ret = 0; + if (grib_nearest_smaller_ibm_float(val, nearest) == GRIB_INTERNAL_ERROR) { + grib_context_log(a->context, GRIB_LOG_ERROR, "grib_nearest_smaller_ibm_float overflow value=%g\n", val); + grib_dump_content(grib_handle_of_accessor(a), stderr, "wmo", GRIB_DUMP_FLAG_HEXADECIMAL, 0); + ret = GRIB_INTERNAL_ERROR; } return ret; } diff --git a/src/grib_accessor_class_ieeefloat.c b/src/grib_accessor_class_ieeefloat.c index 3aa482a0d..6b88f0126 100644 --- a/src/grib_accessor_class_ieeefloat.c +++ b/src/grib_accessor_class_ieeefloat.c @@ -35,65 +35,66 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -static void update_size(grib_accessor*,size_t); -static int nearest_smaller_value (grib_accessor*, double,double*); - -typedef struct grib_accessor_ieeefloat { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in double */ -/* Members defined in ieeefloat */ - grib_arguments* arg; +static void update_size(grib_accessor*, size_t); +static int nearest_smaller_value(grib_accessor*, double, double*); + +typedef struct grib_accessor_ieeefloat +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in double */ + /* Members defined in ieeefloat */ + grib_arguments* arg; } grib_accessor_ieeefloat; extern grib_accessor_class* grib_accessor_class_double; static grib_accessor_class _grib_accessor_class_ieeefloat = { - &grib_accessor_class_double, /* super */ - "ieeefloat", /* name */ - sizeof(grib_accessor_ieeefloat), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - &update_size, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - &nearest_smaller_value, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_double, /* super */ + "ieeefloat", /* name */ + sizeof(grib_accessor_ieeefloat), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + &update_size, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + &nearest_smaller_value, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -102,130 +103,134 @@ grib_accessor_class* grib_accessor_class_ieeefloat = &_grib_accessor_class_ieeef static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len, grib_arguments* arg) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { grib_accessor_ieeefloat* self = (grib_accessor_ieeefloat*)a; - long count=0; - self->arg = arg; - grib_value_count(a,&count); - a->length = 4*count; + long count = 0; + self->arg = arg; + grib_value_count(a, &count); + a->length = 4 * count; - Assert(a->length>=0); + Assert(a->length >= 0); } -static int value_count(grib_accessor* a,long* len) +static int value_count(grib_accessor* a, long* len) { grib_accessor_ieeefloat* self = (grib_accessor_ieeefloat*)a; - *len = 0; + *len = 0; - if(!self->arg) {*len=1;return 0;} - return grib_get_long_internal(grib_handle_of_accessor(a),grib_arguments_get_name(a->parent->h,self->arg,0),len); + if (!self->arg) { + *len = 1; + return 0; + } + return grib_get_long_internal(grib_handle_of_accessor(a), grib_arguments_get_name(a->parent->h, self->arg, 0), len); } -static int pack_double (grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { grib_accessor_ieeefloat* self = (grib_accessor_ieeefloat*)a; - int ret = 0; - unsigned long i = 0; - unsigned long rlen = *len; - size_t buflen = 0; - unsigned char *buf = NULL; - long off = 0; - - if(*len < 1) - { - grib_context_log(a->context, GRIB_LOG_ERROR, " wrong size for %s it pack at least 1 values ", a->name , rlen ); + int ret = 0; + unsigned long i = 0; + unsigned long rlen = *len; + size_t buflen = 0; + unsigned char* buf = NULL; + long off = 0; + + if (*len < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, " wrong size for %s it pack at least 1 values ", a->name, rlen); *len = 0; return GRIB_ARRAY_TOO_SMALL; } - if (rlen == 1){ - off = a->offset*8; - ret = grib_encode_unsigned_long(grib_handle_of_accessor(a)->buffer->data,grib_ieee_to_long(val[0]), &off, 32); - if (*len > 1) grib_context_log(a->context, GRIB_LOG_WARNING, "grib_accessor_unsigned : Trying to pack %d values in a scalar %s, packing first value", *len, a->name ); - if (ret == GRIB_SUCCESS) len[0] = 1; + if (rlen == 1) { + off = a->offset * 8; + ret = grib_encode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, grib_ieee_to_long(val[0]), &off, 32); + if (*len > 1) + grib_context_log(a->context, GRIB_LOG_WARNING, "grib_accessor_unsigned : Trying to pack %d values in a scalar %s, packing first value", *len, a->name); + if (ret == GRIB_SUCCESS) + len[0] = 1; return ret; } - buflen = rlen*4; + buflen = rlen * 4; - buf = (unsigned char*)grib_context_malloc(a->context,buflen); + buf = (unsigned char*)grib_context_malloc(a->context, buflen); - for(i=0; i < rlen;i++){ - grib_encode_unsigned_longb(buf,grib_ieee_to_long(val[i]), &off, 32); + for (i = 0; i < rlen; i++) { + grib_encode_unsigned_longb(buf, grib_ieee_to_long(val[i]), &off, 32); } - ret = grib_set_long_internal(grib_handle_of_accessor(a),grib_arguments_get_name(a->parent->h,self->arg,0),rlen); + ret = grib_set_long_internal(grib_handle_of_accessor(a), grib_arguments_get_name(a->parent->h, self->arg, 0), rlen); - if(ret == GRIB_SUCCESS) - grib_buffer_replace(a, buf, buflen,1,1); + if (ret == GRIB_SUCCESS) + grib_buffer_replace(a, buf, buflen, 1, 1); else *len = 0; - grib_context_free(a->context,buf); + grib_context_free(a->context, buf); return ret; } -static int unpack_double (grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - long rlen = 0; - int err=0; + long rlen = 0; + int err = 0; unsigned long i = 0; - long bitp = a->offset*8; + long bitp = a->offset * 8; - err=grib_value_count(a,&rlen); - if (err) return err; + err = grib_value_count(a, &rlen); + if (err) + return err; - if(*len < rlen) - { - grib_context_log(a->context, GRIB_LOG_ERROR, " wrong size (%ld) for %s it contains %d values ", *len,a->name , rlen); + if (*len < rlen) { + grib_context_log(a->context, GRIB_LOG_ERROR, " wrong size (%ld) for %s it contains %d values ", *len, a->name, rlen); *len = 0; return GRIB_ARRAY_TOO_SMALL; } - for(i=0; i< rlen; i++) - val[i] = grib_long_to_ieee(grib_decode_unsigned_long(grib_handle_of_accessor(a)->buffer->data,&bitp,32)); + for (i = 0; i < rlen; i++) + val[i] = grib_long_to_ieee(grib_decode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, &bitp, 32)); *len = rlen; return GRIB_SUCCESS; } -static void update_size(grib_accessor* a,size_t s) +static void update_size(grib_accessor* a, size_t s) { a->length = s; - Assert(a->length>=0); + Assert(a->length >= 0); } -static int nearest_smaller_value(grib_accessor* a, double val,double* nearest) +static int nearest_smaller_value(grib_accessor* a, double val, double* nearest) { - return grib_nearest_smaller_ieee_float(val,nearest); + return grib_nearest_smaller_ieee_float(val, nearest); } diff --git a/src/grib_accessor_class_ifs_param.c b/src/grib_accessor_class_ifs_param.c index f17cf6a31..feb924c9c 100644 --- a/src/grib_accessor_class_ifs_param.c +++ b/src/grib_accessor_class_ifs_param.c @@ -38,63 +38,64 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int get_native_type(grib_accessor*); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_ifs_param { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in ifs_param */ - const char* paramId; - const char* type; +typedef struct grib_accessor_ifs_param +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in ifs_param */ + const char* paramId; + const char* type; } grib_accessor_ifs_param; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_ifs_param = { - &grib_accessor_class_gen, /* super */ - "ifs_param", /* name */ - sizeof(grib_accessor_ifs_param), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "ifs_param", /* name */ + sizeof(grib_accessor_ifs_param), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -103,62 +104,62 @@ grib_accessor_class* grib_accessor_class_ifs_param = &_grib_accessor_class_ifs_p static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_ifs_param* self = (grib_accessor_ifs_param*)a; - int n = 0; + int n = 0; - self->paramId = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->type = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); + self->paramId = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->type = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_ifs_param* self = (grib_accessor_ifs_param*)a; - int ret = 0; - long paramId = 0; + int ret = 0; + long paramId = 0; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->paramId,¶mId)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->paramId, ¶mId)) != GRIB_SUCCESS) return ret; - if (paramId > 129000 && paramId < 129999 ) + if (paramId > 129000 && paramId < 129999) *val = paramId - 129000; - else if (paramId > 200000 && paramId < 200999 ) + else if (paramId > 200000 && paramId < 200999) *val = paramId - 200000; - else if (paramId > 211000 && paramId < 211999 ) + else if (paramId > 211000 && paramId < 211999) *val = paramId - 1000; else *val = paramId; @@ -166,51 +167,52 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) return ret; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { grib_accessor_ifs_param* self = (grib_accessor_ifs_param*)a; - long type = 0; - long table=128; - long paramId = *val; + long type = 0; + long table = 128; + long paramId = *val; long param; - grib_get_long(grib_handle_of_accessor(a), self->type,&type); + grib_get_long(grib_handle_of_accessor(a), self->type, &type); - if (type==33 || type==35) { - if (paramId>1000) { - table=paramId/1000; - param=paramId-table*1000; - paramId=param; + if (type == 33 || type == 35) { + if (paramId > 1000) { + table = paramId / 1000; + param = paramId - table * 1000; + paramId = param; } switch (table) { - case 210 : - paramId+=211000; - break; - case 128: - paramId+=200000; - break; - default: - break; + case 210: + paramId += 211000; + break; + case 128: + paramId += 200000; + break; + default: + break; } } - if (type == 50 || type == 52 ) { - if (paramId>1000) { - table=paramId/1000; - param=paramId-table*1000; - paramId=param; + if (type == 50 || type == 52) { + if (paramId > 1000) { + table = paramId / 1000; + param = paramId - table * 1000; + paramId = param; } switch (table) { - case 128: - paramId+=129000; - break; - default: - break; + case 128: + paramId += 129000; + break; + default: + break; } } - return grib_set_long_internal(grib_handle_of_accessor(a),self->paramId,paramId); + return grib_set_long_internal(grib_handle_of_accessor(a), self->paramId, paramId); } -static int get_native_type(grib_accessor* a){ +static int get_native_type(grib_accessor* a) +{ return GRIB_TYPE_LONG; } diff --git a/src/grib_accessor_class_int16.c b/src/grib_accessor_class_int16.c index 9bcb10705..860cdbbaa 100644 --- a/src/grib_accessor_class_int16.c +++ b/src/grib_accessor_class_int16.c @@ -32,59 +32,60 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_int16 { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in int16 */ +typedef struct grib_accessor_int16 +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in int16 */ } grib_accessor_int16; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_int16 = { - &grib_accessor_class_gen, /* super */ - "int16", /* name */ - sizeof(grib_accessor_int16), /* size */ + &grib_accessor_class_gen, /* super */ + "int16", /* name */ + sizeof(grib_accessor_int16), /* size */ 0, /* inited */ &init_class, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ + 0, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -93,49 +94,48 @@ grib_accessor_class* grib_accessor_class_int16 = &_grib_accessor_class_int16; static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { long value = 0; /* long pos = a->offset; */ /* unsigned char* data = grib_handle_of_accessor(a)->buffer->data; */ - if(*len < 1) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name , 1 ); + if (*len < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); *len = 0; return GRIB_ARRAY_TOO_SMALL; } @@ -146,7 +146,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) } -static int pack_long(grib_accessor* a, const long* val, size_t *len) { +static int pack_long(grib_accessor* a, const long* val, size_t* len) +{ return GRIB_NOT_IMPLEMENTED; } - diff --git a/src/grib_accessor_class_int16_little_endian.c b/src/grib_accessor_class_int16_little_endian.c index 5781a875d..271dd20a8 100644 --- a/src/grib_accessor_class_int16_little_endian.c +++ b/src/grib_accessor_class_int16_little_endian.c @@ -32,59 +32,60 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_int16_little_endian { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in int16_little_endian */ +typedef struct grib_accessor_int16_little_endian +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in int16_little_endian */ } grib_accessor_int16_little_endian; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_int16_little_endian = { - &grib_accessor_class_gen, /* super */ - "int16_little_endian", /* name */ - sizeof(grib_accessor_int16_little_endian), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "int16_little_endian", /* name */ + sizeof(grib_accessor_int16_little_endian), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -93,49 +94,48 @@ grib_accessor_class* grib_accessor_class_int16_little_endian = &_grib_accessor_c static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { long value = 0; /*long pos = a->offset;*/ /*unsigned char* data = grib_handle_of_accessor(a)->buffer->data;*/ - if(*len < 1) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name , 1 ); + if (*len < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); *len = 0; return GRIB_ARRAY_TOO_SMALL; } @@ -146,7 +146,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) } -static int pack_long(grib_accessor* a, const long* val, size_t *len) { +static int pack_long(grib_accessor* a, const long* val, size_t* len) +{ return GRIB_NOT_IMPLEMENTED; } - diff --git a/src/grib_accessor_class_int32.c b/src/grib_accessor_class_int32.c index 09186f3c1..cf3309503 100644 --- a/src/grib_accessor_class_int32.c +++ b/src/grib_accessor_class_int32.c @@ -32,59 +32,60 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_int32 { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in int32 */ +typedef struct grib_accessor_int32 +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in int32 */ } grib_accessor_int32; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_int32 = { - &grib_accessor_class_gen, /* super */ - "int32", /* name */ - sizeof(grib_accessor_int32), /* size */ + &grib_accessor_class_gen, /* super */ + "int32", /* name */ + sizeof(grib_accessor_int32), /* size */ 0, /* inited */ &init_class, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ + 0, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -93,49 +94,48 @@ grib_accessor_class* grib_accessor_class_int32 = &_grib_accessor_class_int32; static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { long value = 0; /*long pos = a->offset;*/ /*unsigned char* data = grib_handle_of_accessor(a)->buffer->data;*/ - if(*len < 1) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name , 1 ); + if (*len < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); *len = 0; return GRIB_ARRAY_TOO_SMALL; } @@ -146,7 +146,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) } -static int pack_long(grib_accessor* a, const long* val, size_t *len) { +static int pack_long(grib_accessor* a, const long* val, size_t* len) +{ return GRIB_NOT_IMPLEMENTED; } - diff --git a/src/grib_accessor_class_int32_little_endian.c b/src/grib_accessor_class_int32_little_endian.c index 8e9409a8c..9dcea7523 100644 --- a/src/grib_accessor_class_int32_little_endian.c +++ b/src/grib_accessor_class_int32_little_endian.c @@ -32,59 +32,60 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_int32_little_endian { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in int32_little_endian */ +typedef struct grib_accessor_int32_little_endian +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in int32_little_endian */ } grib_accessor_int32_little_endian; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_int32_little_endian = { - &grib_accessor_class_gen, /* super */ - "int32_little_endian", /* name */ - sizeof(grib_accessor_int32_little_endian), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "int32_little_endian", /* name */ + sizeof(grib_accessor_int32_little_endian), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -93,49 +94,48 @@ grib_accessor_class* grib_accessor_class_int32_little_endian = &_grib_accessor_c static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { long value = 0; /* long pos = a->offset; */ /* unsigned char* data = grib_handle_of_accessor(a)->buffer->data; */ - if(*len < 1) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name , 1 ); + if (*len < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); *len = 0; return GRIB_ARRAY_TOO_SMALL; } @@ -146,7 +146,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) } -static int pack_long(grib_accessor* a, const long* val, size_t *len) { +static int pack_long(grib_accessor* a, const long* val, size_t* len) +{ return GRIB_NOT_IMPLEMENTED; } - diff --git a/src/grib_accessor_class_int64.c b/src/grib_accessor_class_int64.c index cc179a903..0a2e87065 100644 --- a/src/grib_accessor_class_int64.c +++ b/src/grib_accessor_class_int64.c @@ -32,59 +32,60 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_int64 { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in int64 */ +typedef struct grib_accessor_int64 +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in int64 */ } grib_accessor_int64; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_int64 = { - &grib_accessor_class_gen, /* super */ - "int64", /* name */ - sizeof(grib_accessor_int64), /* size */ + &grib_accessor_class_gen, /* super */ + "int64", /* name */ + sizeof(grib_accessor_int64), /* size */ 0, /* inited */ &init_class, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ + 0, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -93,66 +94,65 @@ grib_accessor_class* grib_accessor_class_int64 = &_grib_accessor_class_int64; static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - long value = 0; - long pos = a->offset; - unsigned char* data = grib_handle_of_accessor(a)->buffer->data; + long value = 0; + long pos = a->offset; + unsigned char* data = grib_handle_of_accessor(a)->buffer->data; unsigned long long result = 0, tmp; int i; - if(*len < 1) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name , 1 ); + if (*len < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); *len = 0; return GRIB_ARRAY_TOO_SMALL; } - for(i = 0 ; i < 8; i ++) { + for (i = 0; i < 8; i++) { result <<= 8; result |= data[pos + i]; } value = result; - tmp = value; + tmp = value; /* Result does not fit in long */ - if(tmp != result) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Value for %s cannot be decoded as a 'long' (%llu)", a->name , result ); + if (tmp != result) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Value for %s cannot be decoded as a 'long' (%llu)", a->name, result); return GRIB_DECODING_ERROR; } @@ -162,7 +162,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) } -static int pack_long(grib_accessor* a, const long* val, size_t *len) { +static int pack_long(grib_accessor* a, const long* val, size_t* len) +{ return GRIB_NOT_IMPLEMENTED; } - diff --git a/src/grib_accessor_class_int64_little_endian.c b/src/grib_accessor_class_int64_little_endian.c index 3d86069c7..ea30373c1 100644 --- a/src/grib_accessor_class_int64_little_endian.c +++ b/src/grib_accessor_class_int64_little_endian.c @@ -32,59 +32,60 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_int64_little_endian { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in int64_little_endian */ +typedef struct grib_accessor_int64_little_endian +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in int64_little_endian */ } grib_accessor_int64_little_endian; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_int64_little_endian = { - &grib_accessor_class_gen, /* super */ - "int64_little_endian", /* name */ - sizeof(grib_accessor_int64_little_endian), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "int64_little_endian", /* name */ + sizeof(grib_accessor_int64_little_endian), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -93,66 +94,65 @@ grib_accessor_class* grib_accessor_class_int64_little_endian = &_grib_accessor_c static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - long value = 0; - long pos = a->offset; - unsigned char* data = grib_handle_of_accessor(a)->buffer->data; + long value = 0; + long pos = a->offset; + unsigned char* data = grib_handle_of_accessor(a)->buffer->data; unsigned long long result = 0, tmp; int i; - if(*len < 1) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name , 1 ); + if (*len < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); *len = 0; return GRIB_ARRAY_TOO_SMALL; } - for(i = 7 ; i >= 0; i --) { + for (i = 7; i >= 0; i--) { result <<= 8; result |= data[pos + i]; } value = result; - tmp = value; + tmp = value; /* Result does not fit in long */ - if(tmp != result) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Value for %s cannot be decoded as a 'long' (%llu)", a->name , result ); + if (tmp != result) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Value for %s cannot be decoded as a 'long' (%llu)", a->name, result); return GRIB_DECODING_ERROR; } @@ -162,7 +162,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) } -static int pack_long(grib_accessor* a, const long* val, size_t *len) { +static int pack_long(grib_accessor* a, const long* val, size_t* len) +{ return GRIB_NOT_IMPLEMENTED; } - diff --git a/src/grib_accessor_class_int8.c b/src/grib_accessor_class_int8.c index d2c2df488..8c2c21441 100644 --- a/src/grib_accessor_class_int8.c +++ b/src/grib_accessor_class_int8.c @@ -32,59 +32,60 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_int8 { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in int8 */ +typedef struct grib_accessor_int8 +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in int8 */ } grib_accessor_int8; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_int8 = { - &grib_accessor_class_gen, /* super */ - "int8", /* name */ - sizeof(grib_accessor_int8), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "int8", /* name */ + sizeof(grib_accessor_int8), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -93,49 +94,48 @@ grib_accessor_class* grib_accessor_class_int8 = &_grib_accessor_class_int8; static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { long value = 0; - long pos = a->offset; + long pos = a->offset; char* data = (char*)grib_handle_of_accessor(a)->buffer->data; - if(*len < 1) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name , 1 ); + if (*len < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); *len = 0; return GRIB_ARRAY_TOO_SMALL; } @@ -148,7 +148,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) } -static int pack_long(grib_accessor* a, const long* val, size_t *len) { +static int pack_long(grib_accessor* a, const long* val, size_t* len) +{ return GRIB_NOT_IMPLEMENTED; } - diff --git a/src/grib_accessor_class_iterator.c b/src/grib_accessor_class_iterator.c index f4beabe76..36db322b7 100644 --- a/src/grib_accessor_class_iterator.c +++ b/src/grib_accessor_class_iterator.c @@ -36,59 +36,60 @@ or edit "accessor.class" and rerun ./make_class.pl */ static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_iterator { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in iterator */ - grib_arguments* args; +typedef struct grib_accessor_iterator +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in iterator */ + grib_arguments* args; } grib_accessor_iterator; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_iterator = { - &grib_accessor_class_gen, /* super */ - "iterator", /* name */ - sizeof(grib_accessor_iterator), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "iterator", /* name */ + sizeof(grib_accessor_iterator), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -97,69 +98,70 @@ grib_accessor_class* grib_accessor_class_iterator = &_grib_accessor_class_iterat static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* args) +static void init(grib_accessor* a, const long l, grib_arguments* args) { - grib_accessor_iterator* self = (grib_accessor_iterator*)a; - self->args = args; + grib_accessor_iterator* self = (grib_accessor_iterator*)a; + self->args = args; } -static void dump(grib_accessor* a,grib_dumper* dumper) +static void dump(grib_accessor* a, grib_dumper* dumper) { - /* TODO: pass args */ - grib_dump_label(dumper,a,NULL); + /* TODO: pass args */ + grib_dump_label(dumper, a, NULL); } grib_iterator* grib_iterator_new(const grib_handle* ch, unsigned long flags, int* error) { - grib_handle* h = (grib_handle*)ch; - grib_accessor* a = NULL; - grib_accessor_iterator* ita =NULL; - grib_iterator* iter =NULL; - *error=GRIB_NOT_IMPLEMENTED; - a = grib_find_accessor(h,"ITERATOR"); - ita = (grib_accessor_iterator*)a; + grib_handle* h = (grib_handle*)ch; + grib_accessor* a = NULL; + grib_accessor_iterator* ita = NULL; + grib_iterator* iter = NULL; + *error = GRIB_NOT_IMPLEMENTED; + a = grib_find_accessor(h, "ITERATOR"); + ita = (grib_accessor_iterator*)a; - if (!a) return NULL; + if (!a) + return NULL; - iter = grib_iterator_factory(h,ita->args,flags,error); + iter = grib_iterator_factory(h, ita->args, flags, error); - if (iter) *error=GRIB_SUCCESS; + if (iter) + *error = GRIB_SUCCESS; - return iter; + return iter; } - diff --git a/src/grib_accessor_class_julian_date.c b/src/grib_accessor_class_julian_date.c index b17c2daa5..fa8d40487 100644 --- a/src/grib_accessor_class_julian_date.c +++ b/src/grib_accessor_class_julian_date.c @@ -45,76 +45,77 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int pack_string(grib_accessor*, const char*, size_t *len); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int pack_string(grib_accessor*, const char*, size_t* len); static int pack_expression(grib_accessor*, grib_expression*); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_julian_date { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in double */ -/* Members defined in julian_date */ - const char *year; - const char *month; - const char *day; - const char *hour; - const char *minute; - const char *second; - const char *ymd; - const char *hms; - char sep[5]; +typedef struct grib_accessor_julian_date +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in double */ + /* Members defined in julian_date */ + const char* year; + const char* month; + const char* day; + const char* hour; + const char* minute; + const char* second; + const char* ymd; + const char* hms; + char sep[5]; } grib_accessor_julian_date; extern grib_accessor_class* grib_accessor_class_double; static grib_accessor_class _grib_accessor_class_julian_date = { - &grib_accessor_class_double, /* super */ - "julian_date", /* name */ - sizeof(grib_accessor_julian_date), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - &pack_string, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - &pack_expression, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_double, /* super */ + "julian_date", /* name */ + sizeof(grib_accessor_julian_date), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + &pack_string, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + &pack_expression, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -123,326 +124,368 @@ grib_accessor_class* grib_accessor_class_julian_date = &_grib_accessor_class_jul static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_julian_date* self = (grib_accessor_julian_date*)a; - int n=0; - grib_handle* h=grib_handle_of_accessor(a); + int n = 0; + grib_handle* h = grib_handle_of_accessor(a); - self->year = grib_arguments_get_name(h,c,n++); - self->month = grib_arguments_get_name(h,c,n++); + self->year = grib_arguments_get_name(h, c, n++); + self->month = grib_arguments_get_name(h, c, n++); - self->day = grib_arguments_get_name(h,c,n++); - if (self->day ==NULL) { - self->hour = 0; + self->day = grib_arguments_get_name(h, c, n++); + if (self->day == NULL) { + self->hour = 0; self->minute = 0; self->second = 0; - self->ymd=self->year; - self->hms=self->month; - self->year=0; - self->month=0; - } else { - self->ymd=0; - self->hms=0; - self->hour = grib_arguments_get_name(h,c,n++); - self->minute = grib_arguments_get_name(h,c,n++); - self->second = grib_arguments_get_name(h,c,n++); + self->ymd = self->year; + self->hms = self->month; + self->year = 0; + self->month = 0; + } + else { + self->ymd = 0; + self->hms = 0; + self->hour = grib_arguments_get_name(h, c, n++); + self->minute = grib_arguments_get_name(h, c, n++); + self->second = grib_arguments_get_name(h, c, n++); } - self->sep[0]=' '; - self->sep[1]=0; - self->sep[2]=0; - self->sep[3]=0; - self->sep[4]=0; + self->sep[0] = ' '; + self->sep[1] = 0; + self->sep[2] = 0; + self->sep[3] = 0; + self->sep[4] = 0; - a->length=0; + a->length = 0; } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_string(dumper,a,NULL); + grib_dump_string(dumper, a, NULL); } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - int ret=0; - long hour,minute,second; - long year,month,day,ymd,hms; - grib_handle* h=grib_handle_of_accessor(a); + int ret = 0; + long hour, minute, second; + long year, month, day, ymd, hms; + grib_handle* h = grib_handle_of_accessor(a); grib_accessor_julian_date* self = (grib_accessor_julian_date*)a; - if (self->ymd==NULL) { - ret=grib_get_long(h,self->year,&year); - if (ret!=GRIB_SUCCESS) return ret; - ret=grib_get_long(h,self->month,&month); - if (ret!=GRIB_SUCCESS) return ret; - ret=grib_get_long(h,self->day,&day); - if (ret!=GRIB_SUCCESS) return ret; - - ret=grib_get_long(h,self->hour,&hour); - if (ret!=GRIB_SUCCESS) return ret; - ret=grib_get_long(h,self->minute,&minute); - if (ret!=GRIB_SUCCESS) return ret; - ret=grib_get_long(h,self->second,&second); - if (ret!=GRIB_SUCCESS) return ret; - } else { - ret=grib_get_long(h,self->ymd,&ymd); - if (ret!=GRIB_SUCCESS) return ret; + if (self->ymd == NULL) { + ret = grib_get_long(h, self->year, &year); + if (ret != GRIB_SUCCESS) + return ret; + ret = grib_get_long(h, self->month, &month); + if (ret != GRIB_SUCCESS) + return ret; + ret = grib_get_long(h, self->day, &day); + if (ret != GRIB_SUCCESS) + return ret; + + ret = grib_get_long(h, self->hour, &hour); + if (ret != GRIB_SUCCESS) + return ret; + ret = grib_get_long(h, self->minute, &minute); + if (ret != GRIB_SUCCESS) + return ret; + ret = grib_get_long(h, self->second, &second); + if (ret != GRIB_SUCCESS) + return ret; + } + else { + ret = grib_get_long(h, self->ymd, &ymd); + if (ret != GRIB_SUCCESS) + return ret; year = ymd / 10000; ymd %= 10000; - month = ymd / 100; + month = ymd / 100; ymd %= 100; day = ymd; - ret=grib_get_long(h,self->hms,&hms); - if (ret!=GRIB_SUCCESS) return ret; + ret = grib_get_long(h, self->hms, &hms); + if (ret != GRIB_SUCCESS) + return ret; hour = hms / 10000; hms %= 10000; - minute = hms / 100; + minute = hms / 100; hms %= 100; second = hms; } - ret=grib_datetime_to_julian(year,month,day,hour,minute,second,val); + ret = grib_datetime_to_julian(year, month, day, hour, minute, second, val); return ret; } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { grib_accessor_julian_date* self = (grib_accessor_julian_date*)a; - int ret=0; - long hour=0; - long minute=0; - long second=0; - long ymd=0,hms=0; - long year,month,day; - grib_handle* h=grib_handle_of_accessor(a); - - ret=grib_julian_to_datetime(*val,&year,&month,&day,&hour,&minute,&second); - if (ret!=0) return ret; - - if (self->ymd==NULL) { - ret=grib_set_long(h,self->year,year); - if (ret!=0) return ret; - ret=grib_set_long(h,self->month,month); - if (ret!=0) return ret; - ret=grib_set_long(h,self->day,day); - if (ret!=0) return ret; - ret=grib_set_long(h,self->hour,hour); - if (ret!=0) return ret; - ret=grib_set_long(h,self->minute,minute); - if (ret!=0) return ret; - ret=grib_set_long(h,self->second,second); - if (ret!=0) return ret; - } else { - ymd=year * 10000 + month * 100 + day; - ret=grib_set_long(h,self->ymd,ymd); - if (ret!=0) return ret; - - hms=hour * 10000 + minute * 100 + second; - ret=grib_set_long(h,self->hms,hms); - if (ret!=0) return ret; + int ret = 0; + long hour = 0; + long minute = 0; + long second = 0; + long ymd = 0, hms = 0; + long year, month, day; + grib_handle* h = grib_handle_of_accessor(a); + + ret = grib_julian_to_datetime(*val, &year, &month, &day, &hour, &minute, &second); + if (ret != 0) + return ret; + + if (self->ymd == NULL) { + ret = grib_set_long(h, self->year, year); + if (ret != 0) + return ret; + ret = grib_set_long(h, self->month, month); + if (ret != 0) + return ret; + ret = grib_set_long(h, self->day, day); + if (ret != 0) + return ret; + ret = grib_set_long(h, self->hour, hour); + if (ret != 0) + return ret; + ret = grib_set_long(h, self->minute, minute); + if (ret != 0) + return ret; + ret = grib_set_long(h, self->second, second); + if (ret != 0) + return ret; + } + else { + ymd = year * 10000 + month * 100 + day; + ret = grib_set_long(h, self->ymd, ymd); + if (ret != 0) + return ret; + + hms = hour * 10000 + minute * 100 + second; + ret = grib_set_long(h, self->hms, hms); + if (ret != 0) + return ret; } return ret; } -static int unpack_string(grib_accessor* a, char* val, size_t *len) +static int unpack_string(grib_accessor* a, char* val, size_t* len) { - int ret=0; - long hour,minute,second; - long year,month,day,ymd,hms; + int ret = 0; + long hour, minute, second; + long year, month, day, ymd, hms; grib_accessor_julian_date* self = (grib_accessor_julian_date*)a; - char* sep=self->sep; - grib_handle* h=grib_handle_of_accessor(a); - - if (*len < 15) return GRIB_ARRAY_TOO_SMALL; - - if (self->ymd==NULL) { - ret=grib_get_long(h,self->year,&year); - if (ret!=GRIB_SUCCESS) return ret; - ret=grib_get_long(h,self->month,&month); - if (ret!=GRIB_SUCCESS) return ret; - ret=grib_get_long(h,self->day,&day); - if (ret!=GRIB_SUCCESS) return ret; - - ret=grib_get_long(h,self->hour,&hour); - if (ret!=GRIB_SUCCESS) return ret; - ret=grib_get_long(h,self->minute,&minute); - if (ret!=GRIB_SUCCESS) return ret; - ret=grib_get_long(h,self->second,&second); - if (ret!=GRIB_SUCCESS) return ret; - } else { - ret=grib_get_long(h,self->ymd,&ymd); - if (ret!=GRIB_SUCCESS) return ret; + char* sep = self->sep; + grib_handle* h = grib_handle_of_accessor(a); + + if (*len < 15) + return GRIB_ARRAY_TOO_SMALL; + + if (self->ymd == NULL) { + ret = grib_get_long(h, self->year, &year); + if (ret != GRIB_SUCCESS) + return ret; + ret = grib_get_long(h, self->month, &month); + if (ret != GRIB_SUCCESS) + return ret; + ret = grib_get_long(h, self->day, &day); + if (ret != GRIB_SUCCESS) + return ret; + + ret = grib_get_long(h, self->hour, &hour); + if (ret != GRIB_SUCCESS) + return ret; + ret = grib_get_long(h, self->minute, &minute); + if (ret != GRIB_SUCCESS) + return ret; + ret = grib_get_long(h, self->second, &second); + if (ret != GRIB_SUCCESS) + return ret; + } + else { + ret = grib_get_long(h, self->ymd, &ymd); + if (ret != GRIB_SUCCESS) + return ret; year = ymd / 10000; ymd %= 10000; - month = ymd / 100; + month = ymd / 100; ymd %= 100; day = ymd; - ret=grib_get_long(h,self->hms,&hms); - if (ret!=GRIB_SUCCESS) return ret; + ret = grib_get_long(h, self->hms, &hms); + if (ret != GRIB_SUCCESS) + return ret; hour = hms / 10000; hms %= 10000; - minute = hms / 100; + minute = hms / 100; hms %= 100; second = hms; } - if (sep[1]!=0 && sep[2]!=0 && sep[3]!=0 && sep[4]!=0) { - sprintf(val,"%04ld%c%02ld%c%02ld%c%02ld%c%02ld%c%02ld",year,sep[0],month,sep[1],day,sep[2],hour,sep[3],minute,sep[4],second); - } else if (sep[0]!=0) { - sprintf(val,"%04ld%02ld%02ld%c%02ld%02ld%02ld",year,month,day,sep[0],hour,minute,second); - } else { - sprintf(val,"%04ld%02ld%02ld%02ld%02ld%02ld",year,month,day,hour,minute,second); + if (sep[1] != 0 && sep[2] != 0 && sep[3] != 0 && sep[4] != 0) { + sprintf(val, "%04ld%c%02ld%c%02ld%c%02ld%c%02ld%c%02ld", year, sep[0], month, sep[1], day, sep[2], hour, sep[3], minute, sep[4], second); + } + else if (sep[0] != 0) { + sprintf(val, "%04ld%02ld%02ld%c%02ld%02ld%02ld", year, month, day, sep[0], hour, minute, second); + } + else { + sprintf(val, "%04ld%02ld%02ld%02ld%02ld%02ld", year, month, day, hour, minute, second); } return ret; } -static int pack_string(grib_accessor* a, const char* val, size_t *len) +static int pack_string(grib_accessor* a, const char* val, size_t* len) { - int ret=0; - long hour,minute,second; - long year,month,day,ymd,hms; + int ret = 0; + long hour, minute, second; + long year, month, day, ymd, hms; grib_accessor_julian_date* self = (grib_accessor_julian_date*)a; - char* sep=self->sep; - grib_handle* h=grib_handle_of_accessor(a); - - ret=sscanf(val,"%04ld%c%02ld%c%02ld%c%02ld%c%02ld%c%02ld",&year,&sep[0],&month,&sep[1],&day,&sep[2],&hour,&sep[3],&minute,&sep[4],&second); - if (ret!=11) { - if (strlen(val)==15) { - ret=sscanf(val,"%04ld%02ld%02ld%c%02ld%02ld%02ld",&year,&month,&day,&sep[0],&hour,&minute,&second); - if (ret!=7) { - grib_context_log(h->context,GRIB_LOG_ERROR," Wrong date time format. Please use \"YYYY-MM-DD hh:mm:ss\""); + char* sep = self->sep; + grib_handle* h = grib_handle_of_accessor(a); + + ret = sscanf(val, "%04ld%c%02ld%c%02ld%c%02ld%c%02ld%c%02ld", &year, &sep[0], &month, &sep[1], &day, &sep[2], &hour, &sep[3], &minute, &sep[4], &second); + if (ret != 11) { + if (strlen(val) == 15) { + ret = sscanf(val, "%04ld%02ld%02ld%c%02ld%02ld%02ld", &year, &month, &day, &sep[0], &hour, &minute, &second); + if (ret != 7) { + grib_context_log(h->context, GRIB_LOG_ERROR, " Wrong date time format. Please use \"YYYY-MM-DD hh:mm:ss\""); return GRIB_INVALID_KEY_VALUE; } - sep[1]=0; - sep[2]=0; - sep[3]=0; - sep[4]=0; - } else { - ret=sscanf(val,"%04ld%02ld%02ld%02ld%02ld%02ld",&year,&month,&day,&hour,&minute,&second); - if (ret!=6) { - grib_context_log(h->context,GRIB_LOG_ERROR," Wrong date time format. Please use \"YYYY-MM-DD hh:mm:ss\""); + sep[1] = 0; + sep[2] = 0; + sep[3] = 0; + sep[4] = 0; + } + else { + ret = sscanf(val, "%04ld%02ld%02ld%02ld%02ld%02ld", &year, &month, &day, &hour, &minute, &second); + if (ret != 6) { + grib_context_log(h->context, GRIB_LOG_ERROR, " Wrong date time format. Please use \"YYYY-MM-DD hh:mm:ss\""); return GRIB_INVALID_KEY_VALUE; } - sep[0]=0; - sep[1]=0; - sep[2]=0; - sep[3]=0; - sep[4]=0; + sep[0] = 0; + sep[1] = 0; + sep[2] = 0; + sep[3] = 0; + sep[4] = 0; } } - if (self->ymd==NULL) { - ret=grib_set_long(h,self->year,year); - if (ret!=0) return ret; - ret=grib_set_long(h,self->month,month); - if (ret!=0) return ret; - ret=grib_set_long(h,self->day,day); - if (ret!=0) return ret; - ret=grib_set_long(h,self->hour,hour); - if (ret!=0) return ret; - ret=grib_set_long(h,self->minute,minute); - if (ret!=0) return ret; - ret=grib_set_long(h,self->second,second); - if (ret!=0) return ret; - } else { - ymd=year * 10000 + month * 100 + day; - ret=grib_set_long(h,self->ymd,ymd); - if (ret!=0) return ret; - - hms=hour * 10000 + minute * 100 + second; - ret=grib_set_long(h,self->hms,hms); - if (ret!=0) return ret; + if (self->ymd == NULL) { + ret = grib_set_long(h, self->year, year); + if (ret != 0) + return ret; + ret = grib_set_long(h, self->month, month); + if (ret != 0) + return ret; + ret = grib_set_long(h, self->day, day); + if (ret != 0) + return ret; + ret = grib_set_long(h, self->hour, hour); + if (ret != 0) + return ret; + ret = grib_set_long(h, self->minute, minute); + if (ret != 0) + return ret; + ret = grib_set_long(h, self->second, second); + if (ret != 0) + return ret; + } + else { + ymd = year * 10000 + month * 100 + day; + ret = grib_set_long(h, self->ymd, ymd); + if (ret != 0) + return ret; + + hms = hour * 10000 + minute * 100 + second; + ret = grib_set_long(h, self->hms, hms); + if (ret != 0) + return ret; } return ret; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - grib_context_log(a->context,GRIB_LOG_ERROR, " Cannot unpack %s as long", a->name); + grib_context_log(a->context, GRIB_LOG_ERROR, " Cannot unpack %s as long", a->name); return GRIB_NOT_IMPLEMENTED; } -static int pack_long(grib_accessor* a, const long* v, size_t *len) +static int pack_long(grib_accessor* a, const long* v, size_t* len) { - grib_context_log(a->context,GRIB_LOG_ERROR, " Cannot pack %s as long", a->name); + grib_context_log(a->context, GRIB_LOG_ERROR, " Cannot pack %s as long", a->name); return GRIB_NOT_IMPLEMENTED; } -static int pack_expression(grib_accessor* a, grib_expression *e) +static int pack_expression(grib_accessor* a, grib_expression* e) { - size_t len = 1; - long lval=0; - double dval=0; - const char *cval=NULL; - int ret=0; + size_t len = 1; + long lval = 0; + double dval = 0; + const char* cval = NULL; + int ret = 0; grib_handle* hand = grib_handle_of_accessor(a); - switch(grib_expression_native_type(hand,e)) { + switch (grib_expression_native_type(hand, e)) { case GRIB_TYPE_LONG: { len = 1; - ret = grib_expression_evaluate_long(hand,e,&lval); + ret = grib_expression_evaluate_long(hand, e, &lval); if (ret != GRIB_SUCCESS) { - grib_context_log(a->context,GRIB_LOG_ERROR,"unable to set %s as long",a->name); + grib_context_log(a->context, GRIB_LOG_ERROR, "unable to set %s as long", a->name); return ret; } /*if (hand->context->debug) printf("ECCODES DEBUG grib_accessor_class_gen::pack_expression %s %ld\n", a->name,lval);*/ - return grib_pack_long(a,&lval,&len); + return grib_pack_long(a, &lval, &len); } case GRIB_TYPE_DOUBLE: { len = 1; - ret = grib_expression_evaluate_double(hand,e,&dval); + ret = grib_expression_evaluate_double(hand, e, &dval); /*if (hand->context->debug) printf("ECCODES DEBUG grib_accessor_class_gen::pack_expression %s %g\n", a->name, dval);*/ - return grib_pack_double(a,&dval,&len); + return grib_pack_double(a, &dval, &len); } case GRIB_TYPE_STRING: { char tmp[1024]; - len = sizeof(tmp); - cval = grib_expression_evaluate_string(hand,e,tmp,&len,&ret); + len = sizeof(tmp); + cval = grib_expression_evaluate_string(hand, e, tmp, &len, &ret); if (ret != GRIB_SUCCESS) { - grib_context_log(a->context,GRIB_LOG_ERROR,"unable to set %s as string",a->name); + grib_context_log(a->context, GRIB_LOG_ERROR, "unable to set %s as string", a->name); return ret; } len = strlen(cval); /*if (hand->context->debug) printf("ECCODES DEBUG grib_accessor_class_gen::pack_expression %s %s\n", a->name, cval);*/ - return grib_pack_string(a,cval,&len); + return grib_pack_string(a, cval, &len); } } diff --git a/src/grib_accessor_class_julian_day.c b/src/grib_accessor_class_julian_day.c index fdc5232d0..fa251cf89 100644 --- a/src/grib_accessor_class_julian_day.c +++ b/src/grib_accessor_class_julian_day.c @@ -38,68 +38,69 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_julian_day { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in double */ -/* Members defined in julian_day */ - const char *date; - const char *hour; - const char *minute; - const char *second; +typedef struct grib_accessor_julian_day +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in double */ + /* Members defined in julian_day */ + const char* date; + const char* hour; + const char* minute; + const char* second; } grib_accessor_julian_day; extern grib_accessor_class* grib_accessor_class_double; static grib_accessor_class _grib_accessor_class_julian_day = { - &grib_accessor_class_double, /* super */ - "julian_day", /* name */ - sizeof(grib_accessor_julian_day), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_double, /* super */ + "julian_day", /* name */ + sizeof(grib_accessor_julian_day), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -108,121 +109,129 @@ grib_accessor_class* grib_accessor_class_julian_day = &_grib_accessor_class_juli static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_julian_day* self = (grib_accessor_julian_day*)a; - int n=0; + int n = 0; - self->date = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->hour = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->minute = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->second = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); + self->date = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->hour = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->minute = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->second = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - a->length=0; + a->length = 0; } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_string(dumper,a,NULL); + grib_dump_string(dumper, a, NULL); } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { - const double v=*val; - return pack_double(a,&v,len); + const double v = *val; + return pack_double(a, &v, len); } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { grib_accessor_julian_day* self = (grib_accessor_julian_day*)a; - int ret=0; - long hour=0; - long minute=0; - long second=0; - long date=0; - long year,month,day; - - ret=grib_julian_to_datetime(*val,&year,&month,&day,&hour,&minute,&second); - if (ret!=0) return ret; - - date=year * 10000 + month * 100 + day; - - ret=grib_set_long_internal(grib_handle_of_accessor(a),self->date,date); - if (ret!=0) return ret; - ret=grib_set_long_internal(grib_handle_of_accessor(a),self->hour,hour); - if (ret!=0) return ret; - ret=grib_set_long_internal(grib_handle_of_accessor(a),self->minute,minute); - if (ret!=0) return ret; - ret=grib_set_long_internal(grib_handle_of_accessor(a),self->second,second); + int ret = 0; + long hour = 0; + long minute = 0; + long second = 0; + long date = 0; + long year, month, day; + + ret = grib_julian_to_datetime(*val, &year, &month, &day, &hour, &minute, &second); + if (ret != 0) + return ret; + + date = year * 10000 + month * 100 + day; + + ret = grib_set_long_internal(grib_handle_of_accessor(a), self->date, date); + if (ret != 0) + return ret; + ret = grib_set_long_internal(grib_handle_of_accessor(a), self->hour, hour); + if (ret != 0) + return ret; + ret = grib_set_long_internal(grib_handle_of_accessor(a), self->minute, minute); + if (ret != 0) + return ret; + ret = grib_set_long_internal(grib_handle_of_accessor(a), self->second, second); return ret; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - int ret=0; - double v=0; + int ret = 0; + double v = 0; - ret=unpack_double(a,&v,len); - *val=(long)v; + ret = unpack_double(a, &v, len); + *val = (long)v; return ret; } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - int ret=0; - long date,hour,minute,second; - long year,month,day; + int ret = 0; + long date, hour, minute, second; + long year, month, day; grib_accessor_julian_day* self = (grib_accessor_julian_day*)a; - ret=grib_get_long_internal(grib_handle_of_accessor(a),self->date,&date); - if (ret!=GRIB_SUCCESS) return ret; - ret=grib_get_long_internal(grib_handle_of_accessor(a),self->hour,&hour); - if (ret!=GRIB_SUCCESS) return ret; - ret=grib_get_long_internal(grib_handle_of_accessor(a),self->minute,&minute); - if (ret!=GRIB_SUCCESS) return ret; - ret=grib_get_long_internal(grib_handle_of_accessor(a),self->second,&second); - if (ret!=GRIB_SUCCESS) return ret; + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->date, &date); + if (ret != GRIB_SUCCESS) + return ret; + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->hour, &hour); + if (ret != GRIB_SUCCESS) + return ret; + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->minute, &minute); + if (ret != GRIB_SUCCESS) + return ret; + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->second, &second); + if (ret != GRIB_SUCCESS) + return ret; year = date / 10000; date %= 10000; - month = date / 100; + month = date / 100; date %= 100; day = date; - ret=grib_datetime_to_julian(year,month,day,hour,minute,second,val); + ret = grib_datetime_to_julian(year, month, day, hour, minute, second, val); return ret; } diff --git a/src/grib_accessor_class_ksec1expver.c b/src/grib_accessor_class_ksec1expver.c index b85b37b5a..c6c1f81ad 100644 --- a/src/grib_accessor_class_ksec1expver.c +++ b/src/grib_accessor_class_ksec1expver.c @@ -33,62 +33,63 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int pack_string(grib_accessor*, const char*, size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int pack_string(grib_accessor*, const char*, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_ksec1expver { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in ascii */ -/* Members defined in ksec1expver */ +typedef struct grib_accessor_ksec1expver +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in ascii */ + /* Members defined in ksec1expver */ } grib_accessor_ksec1expver; extern grib_accessor_class* grib_accessor_class_ascii; static grib_accessor_class _grib_accessor_class_ksec1expver = { - &grib_accessor_class_ascii, /* super */ - "ksec1expver", /* name */ - sizeof(grib_accessor_ksec1expver), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - &pack_string, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_ascii, /* super */ + "ksec1expver", /* name */ + sizeof(grib_accessor_ksec1expver), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + &pack_string, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -97,64 +98,63 @@ grib_accessor_class* grib_accessor_class_ksec1expver = &_grib_accessor_class_kse static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len, grib_arguments* arg ) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { a->length = len; - Assert(a->length>=0); + Assert(a->length >= 0); } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { long value = 0; - long pos = a->offset*8; - char *intc = NULL; - char expver[5]; - char refexpver[5]; - size_t llen = a->length+1; + long pos = a->offset * 8; + char* intc = NULL; + char expver[5]; + char refexpver[5]; + size_t llen = a->length + 1; Assert(a->length == 4); - if(*len < 1) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name , 1 ); + if (*len < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); *len = 0; return GRIB_ARRAY_TOO_SMALL; } - value = grib_decode_unsigned_long(grib_handle_of_accessor(a)->buffer->data , &pos, a->length*8); + value = grib_decode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, &pos, a->length * 8); - grib_unpack_string(a, refexpver , &llen); + grib_unpack_string(a, refexpver, &llen); /* test for endian */ intc = (char*)&value; @@ -166,7 +166,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) expver[4] = 0; /* if there is a difference, have to reverse*/ - if(strcmp(refexpver, expver)){ + if (strcmp(refexpver, expver)) { intc[0] = expver[3]; intc[1] = expver[2]; intc[2] = expver[1]; @@ -178,30 +178,29 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) return GRIB_SUCCESS; } -static int pack_string(grib_accessor* a, const char* val, size_t *len) +static int pack_string(grib_accessor* a, const char* val, size_t* len) { int i = 0; - if (len[0] != 4 ) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong length for %s. It has to be 4",a->name); + if (len[0] != 4) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong length for %s. It has to be 4", a->name); return GRIB_INVALID_KEY_VALUE; } - if(len[0] > (a->length)+1) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "pack_string: Wrong size (%d) for %s it contains %d values ", len[0], a->name , a->length+1 ); + if (len[0] > (a->length) + 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "pack_string: Wrong size (%d) for %s it contains %d values ", len[0], a->name, a->length + 1); len[0] = 0; return GRIB_BUFFER_TOO_SMALL; } - for ( i = 0; i < a->length; i++) - grib_handle_of_accessor(a)->buffer->data[a->offset+i] = val[i]; + for (i = 0; i < a->length; i++) + grib_handle_of_accessor(a)->buffer->data[a->offset + i] = val[i]; return GRIB_SUCCESS; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { - char sval[5]={0,}; - size_t slen=4; - sprintf(sval,"%04d",(int)(*val)); - return pack_string(a,sval,&slen); + char sval[5] = {0,}; + size_t slen = 4; + sprintf(sval, "%04d", (int)(*val)); + return pack_string(a, sval, &slen); } diff --git a/src/grib_accessor_class_label.c b/src/grib_accessor_class_label.c index 011c52302..df3362e0c 100644 --- a/src/grib_accessor_class_label.c +++ b/src/grib_accessor_class_label.c @@ -31,62 +31,63 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int unpack_string (grib_accessor*, char*, size_t *len); +static int get_native_type(grib_accessor*); +static int unpack_string(grib_accessor*, char*, size_t* len); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); static int compare(grib_accessor*, grib_accessor*); -typedef struct grib_accessor_label { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in label */ +typedef struct grib_accessor_label +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in label */ } grib_accessor_label; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_label = { - &grib_accessor_class_gen, /* super */ - "label", /* name */ - sizeof(grib_accessor_label), /* size */ + &grib_accessor_class_gen, /* super */ + "label", /* name */ + sizeof(grib_accessor_label), /* size */ 0, /* inited */ &init_class, /* init_class */ &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ + 0, /* post_init */ + 0, /* free mem */ &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -95,39 +96,39 @@ grib_accessor_class* grib_accessor_class_label = &_grib_accessor_class_label; static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len , grib_arguments* arg) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; @@ -136,7 +137,7 @@ static void init(grib_accessor* a, const long len , grib_arguments* arg) static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_label(dumper,a,NULL); + grib_dump_label(dumper, a, NULL); } static int get_native_type(grib_accessor* a) @@ -149,11 +150,12 @@ static int compare(grib_accessor* a, grib_accessor* b) return GRIB_SUCCESS; } -static int unpack_string(grib_accessor* a, char* val, size_t *len) +static int unpack_string(grib_accessor* a, char* val, size_t* len) { - size_t vlen=strlen(a->name); - if (vlen > *len) return GRIB_BUFFER_TOO_SMALL; - *len=vlen; - strcpy(val,a->name); + size_t vlen = strlen(a->name); + if (vlen > *len) + return GRIB_BUFFER_TOO_SMALL; + *len = vlen; + strcpy(val, a->name); return GRIB_SUCCESS; } diff --git a/src/grib_accessor_class_laplacian.c b/src/grib_accessor_class_laplacian.c index b9ec77561..100751990 100644 --- a/src/grib_accessor_class_laplacian.c +++ b/src/grib_accessor_class_laplacian.c @@ -43,67 +43,68 @@ or edit "accessor.class" and rerun ./make_class.pl */ static int is_missing(grib_accessor*); -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_laplacian { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in double */ -/* Members defined in laplacian */ - const char* value; - const char* multiplier; - const char* divisor; - const char* truncating; - const char* computeLaplacianOperator; +typedef struct grib_accessor_laplacian +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in double */ + /* Members defined in laplacian */ + const char* value; + const char* multiplier; + const char* divisor; + const char* truncating; + const char* computeLaplacianOperator; } grib_accessor_laplacian; extern grib_accessor_class* grib_accessor_class_double; static grib_accessor_class _grib_accessor_class_laplacian = { - &grib_accessor_class_double, /* super */ - "laplacian", /* name */ - sizeof(grib_accessor_laplacian), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - &is_missing, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_double, /* super */ + "laplacian", /* name */ + sizeof(grib_accessor_laplacian), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + &is_missing, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -112,116 +113,119 @@ grib_accessor_class* grib_accessor_class_laplacian = &_grib_accessor_class_lapla static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_laplacian* self = (grib_accessor_laplacian*)a; - int n = 0; + int n = 0; - self->value = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->multiplier = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->divisor = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->truncating = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->computeLaplacianOperator = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); + self->value = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->multiplier = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->divisor = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->truncating = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->computeLaplacianOperator = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { grib_accessor_laplacian* self = (grib_accessor_laplacian*)a; - int ret = 0; - long value = 0; - long multiplier = 0; - long divisor = 0; + int ret = 0; + long value = 0; + long multiplier = 0; + long divisor = 0; - if(*len < 1){ + if (*len < 1) { ret = GRIB_ARRAY_TOO_SMALL; grib_context_log(a->context, GRIB_LOG_ERROR, - "Accessor %s cannot gather value for %s and/or %s error %d", - a->name,self->multiplier, self->divisor, ret); + "Accessor %s cannot gather value for %s and/or %s error %d", + a->name, self->multiplier, self->divisor, ret); return ret; } - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->divisor,&divisor)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->divisor, &divisor)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->multiplier,&multiplier)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->multiplier, &multiplier)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->value,&value)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->value, &value)) != GRIB_SUCCESS) return ret; - if (value == GRIB_MISSING_LONG) *val=GRIB_MISSING_DOUBLE; - else *val = ((double)(value*multiplier))/divisor; + if (value == GRIB_MISSING_LONG) + *val = GRIB_MISSING_DOUBLE; + else + *val = ((double)(value * multiplier)) / divisor; /*printf("unpack_double: divisor=%ld multiplier=%ld long_value=%ld scaled_value=%.30f\n",(double)divisor,(double)multiplier,value,*val);*/ - if (ret == GRIB_SUCCESS) *len = 1; + if (ret == GRIB_SUCCESS) + *len = 1; return ret; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { - const double dval=(double)*val; - return pack_double(a, &dval,len); + const double dval = (double)*val; + return pack_double(a, &dval, len); } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { grib_accessor_laplacian* self = (grib_accessor_laplacian*)a; - int ret = 0; + int ret = 0; - long value = 0; - long divisor = 0; + long value = 0; + long divisor = 0; long multiplier = 0; - long truncating=0; + long truncating = 0; double x; - grib_set_long(grib_handle_of_accessor(a), self->computeLaplacianOperator,0); + grib_set_long(grib_handle_of_accessor(a), self->computeLaplacianOperator, 0); - ret = grib_get_long_internal(grib_handle_of_accessor(a), self->divisor,&divisor); - if(ret != GRIB_SUCCESS) { + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->divisor, &divisor); + if (ret != GRIB_SUCCESS) { grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannont gather value for %s error %d \n", a->name, self->divisor, ret); return ret; } - ret = grib_get_long_internal(grib_handle_of_accessor(a), self->multiplier,&multiplier); - if(ret != GRIB_SUCCESS){ + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->multiplier, &multiplier); + if (ret != GRIB_SUCCESS) { grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannont gather value for %s error %d \n", a->name, self->divisor, ret); return ret; } if (self->truncating) { - ret = grib_get_long_internal(grib_handle_of_accessor(a), self->truncating,&truncating); - if(ret != GRIB_SUCCESS){ + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->truncating, &truncating); + if (ret != GRIB_SUCCESS) { grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannont gather value for %s error %d \n", a->name, self->truncating, ret); return ret; } @@ -232,19 +236,22 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) return GRIB_ENCODING_ERROR; } - x=*val * (double)divisor / (double)multiplier; - if (*val == GRIB_MISSING_DOUBLE) value = GRIB_MISSING_LONG; + x = *val * (double)divisor / (double)multiplier; + if (*val == GRIB_MISSING_DOUBLE) + value = GRIB_MISSING_LONG; else if (truncating) { value = (long)x; - } else { - value = x > 0 ? (long) (x+0.5) : (long)(x-0.5); + } + else { + value = x > 0 ? (long)(x + 0.5) : (long)(x - 0.5); } - ret = grib_set_long_internal(grib_handle_of_accessor(a), self->value,value); - if(ret ) + ret = grib_set_long_internal(grib_handle_of_accessor(a), self->value, value); + if (ret) grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannont pack value for %s error %d \n", a->name, self->value, ret); - if (ret == GRIB_SUCCESS) *len = 1; + if (ret == GRIB_SUCCESS) + *len = 1; return ret; } @@ -252,9 +259,10 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) static int is_missing(grib_accessor* a) { grib_accessor_laplacian* self = (grib_accessor_laplacian*)a; - grib_accessor* av=grib_find_accessor(grib_handle_of_accessor(a),self->value); + grib_accessor* av = grib_find_accessor(grib_handle_of_accessor(a), self->value); - if (!av) return GRIB_NOT_FOUND; + if (!av) + return GRIB_NOT_FOUND; return grib_is_missing_internal(av); #if 0 int ret=0; diff --git a/src/grib_accessor_class_latitudes.c b/src/grib_accessor_class_latitudes.c index 48d2994d0..467deb184 100644 --- a/src/grib_accessor_class_latitudes.c +++ b/src/grib_accessor_class_latitudes.c @@ -37,66 +37,67 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_latitudes { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in double */ -/* Members defined in latitudes */ - const char* values; - long distinct; - double* lats; - long size; - int save; +typedef struct grib_accessor_latitudes +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in double */ + /* Members defined in latitudes */ + const char* values; + long distinct; + double* lats; + long size; + int save; } grib_accessor_latitudes; extern grib_accessor_class* grib_accessor_class_double; static grib_accessor_class _grib_accessor_class_latitudes = { - &grib_accessor_class_double, /* super */ - "latitudes", /* name */ - sizeof(grib_accessor_latitudes), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_double, /* super */ + "latitudes", /* name */ + sizeof(grib_accessor_latitudes), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -105,215 +106,232 @@ grib_accessor_class* grib_accessor_class_latitudes = &_grib_accessor_class_latit static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static int get_distinct(grib_accessor* a,double** val,long* len); +static int get_distinct(grib_accessor* a, double** val, long* len); -static int compare_doubles( const void* a, const void* b, int ascending ) { +static int compare_doubles(const void* a, const void* b, int ascending) +{ /* ascending is a boolean: 0 or 1 */ - double* arg1 = (double*) a; - double* arg2 = (double*) b; + double* arg1 = (double*)a; + double* arg2 = (double*)b; if (ascending) { - if( *arg1 < *arg2 ) return -1; /*Smaller values come before larger ones*/ - } else { - if( *arg1 > *arg2 ) return -1; /*Larger values come before smaller ones*/ + if (*arg1 < *arg2) + return -1; /*Smaller values come before larger ones*/ + } + else { + if (*arg1 > *arg2) + return -1; /*Larger values come before smaller ones*/ } - if( *arg1 == *arg2 ) return 0; - else return 1; + if (*arg1 == *arg2) + return 0; + else + return 1; } -static int compare_doubles_ascending( const void* a, const void* b ) { - return compare_doubles(a,b,1); +static int compare_doubles_ascending(const void* a, const void* b) +{ + return compare_doubles(a, b, 1); } -static int compare_doubles_descending( const void* a, const void* b ) { - return compare_doubles(a,b,0); +static int compare_doubles_descending(const void* a, const void* b) +{ + return compare_doubles(a, b, 0); } -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_latitudes* self = (grib_accessor_latitudes*)a; - int n = 0; + int n = 0; - self->values = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->distinct = grib_arguments_get_long(grib_handle_of_accessor(a),c,n++); - self->save=0; + self->values = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->distinct = grib_arguments_get_long(grib_handle_of_accessor(a), c, n++); + self->save = 0; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - grib_context* c=a->context; + grib_context* c = a->context; grib_accessor_latitudes* self = (grib_accessor_latitudes*)a; - int ret = 0; - double* v=val; - double dummyLon=0, dummyVal=0; - size_t size=0; - long count=0; - grib_iterator* iter=NULL; - - self->save=1; - size=0; - ret=value_count(a,&count); - if (ret) return ret; - size=count; - if (*lensave = 1; + size = 0; + ret = value_count(a, &count); + if (ret) + return ret; + size = count; + if (*len < size) { /* self->lats are computed in value_count so must free */ if (self->lats) { - grib_context_free(c,self->lats); - self->lats=NULL; + grib_context_free(c, self->lats); + self->lats = NULL; } return GRIB_ARRAY_TOO_SMALL; } - self->save=0; + self->save = 0; /* self->lats are computed in value_count*/ if (self->lats) { int i; - *len=self->size; - for (i=0;ilats[i]; - grib_context_free(c,self->lats); - self->lats=NULL; - self->size=0; + *len = self->size; + for (i = 0; i < size; i++) + val[i] = self->lats[i]; + grib_context_free(c, self->lats); + self->lats = NULL; + self->size = 0; return GRIB_SUCCESS; } - iter=grib_iterator_new(grib_handle_of_accessor(a),0,&ret); - if (ret!=GRIB_SUCCESS) { - if (iter) grib_iterator_delete(iter); - grib_context_log(c,GRIB_LOG_ERROR,"unable to create iterator"); + iter = grib_iterator_new(grib_handle_of_accessor(a), 0, &ret); + if (ret != GRIB_SUCCESS) { + if (iter) + grib_iterator_delete(iter); + grib_context_log(c, GRIB_LOG_ERROR, "unable to create iterator"); return ret; } - while(grib_iterator_next(iter,v++,&dummyLon,&dummyVal)) {} + while (grib_iterator_next(iter, v++, &dummyLon, &dummyVal)) {} grib_iterator_delete(iter); - *len=size; + *len = size; return ret; } -static int value_count(grib_accessor* a,long* len) +static int value_count(grib_accessor* a, long* len) { grib_accessor_latitudes* self = (grib_accessor_latitudes*)a; - grib_handle* h=grib_handle_of_accessor(a); - grib_context* c=a->context; - double* val=NULL; + grib_handle* h = grib_handle_of_accessor(a); + grib_context* c = a->context; + double* val = NULL; int ret; size_t size; - *len=0; - if ((ret=grib_get_size(h,self->values,&size))!=GRIB_SUCCESS) { - grib_context_log(h->context,GRIB_LOG_ERROR,"unable to get size of %s",self->values); + *len = 0; + if ((ret = grib_get_size(h, self->values, &size)) != GRIB_SUCCESS) { + grib_context_log(h->context, GRIB_LOG_ERROR, "unable to get size of %s", self->values); return ret; } - *len=size; + *len = size; if (self->distinct) { - ret=get_distinct(a,&val,len); - if (ret!=GRIB_SUCCESS) return ret; + ret = get_distinct(a, &val, len); + if (ret != GRIB_SUCCESS) + return ret; if (self->save) { - self->lats=val; - self->size=*len; - } else { - grib_context_free(c,val); + self->lats = val; + self->size = *len; + } + else { + grib_context_free(c, val); } } return ret; } -static int get_distinct(grib_accessor* a,double** val,long* len) { - long count=0; +static int get_distinct(grib_accessor* a, double** val, long* len) +{ + long count = 0; double prev; - double *v=NULL; - double *v1=NULL; - double dummyLon=0, dummyVal=0; - int ret=0; + double* v = NULL; + double* v1 = NULL; + double dummyLon = 0, dummyVal = 0; + int ret = 0; int i; - long jScansPositively=0; /*default: north to south*/ - size_t size=*len; - grib_context* c=a->context; - grib_iterator* iter=grib_iterator_new(grib_handle_of_accessor(a),0,&ret); - if (ret!=GRIB_SUCCESS) { - if (iter) grib_iterator_delete(iter); - grib_context_log(c,GRIB_LOG_ERROR,"unable to create iterator"); + long jScansPositively = 0; /*default: north to south*/ + size_t size = *len; + grib_context* c = a->context; + grib_iterator* iter = grib_iterator_new(grib_handle_of_accessor(a), 0, &ret); + if (ret != GRIB_SUCCESS) { + if (iter) + grib_iterator_delete(iter); + grib_context_log(c, GRIB_LOG_ERROR, "unable to create iterator"); return ret; } - v=(double*)grib_context_malloc_clear(c,size*sizeof(double)); + v = (double*)grib_context_malloc_clear(c, size * sizeof(double)); if (!v) { - grib_context_log(c,GRIB_LOG_ERROR, - "unable to allocate %ld bytes",(long)size*sizeof(double)); + grib_context_log(c, GRIB_LOG_ERROR, + "unable to allocate %ld bytes", (long)size * sizeof(double)); return GRIB_OUT_OF_MEMORY; } - *val=v; + *val = v; - while(grib_iterator_next(iter,v++,&dummyLon,&dummyVal)) {} + while (grib_iterator_next(iter, v++, &dummyLon, &dummyVal)) {} grib_iterator_delete(iter); - v=*val; + v = *val; /* See which direction the latitudes are to be scanned */ - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), "jScansPositively", &jScansPositively))) return ret; + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), "jScansPositively", &jScansPositively))) + return ret; if (jScansPositively) { - qsort(v,*len,sizeof(double),&compare_doubles_ascending); /*South to North*/ - } else { - qsort(v,*len,sizeof(double),&compare_doubles_descending); /*North to South*/ + qsort(v, *len, sizeof(double), &compare_doubles_ascending); /*South to North*/ + } + else { + qsort(v, *len, sizeof(double), &compare_doubles_descending); /*North to South*/ } - v1=(double*)grib_context_malloc_clear(c,size*sizeof(double)); + v1 = (double*)grib_context_malloc_clear(c, size * sizeof(double)); if (!v1) { - grib_context_log(c,GRIB_LOG_ERROR, "unable to allocate %ld bytes",(long)size*sizeof(double)); + grib_context_log(c, GRIB_LOG_ERROR, "unable to allocate %ld bytes", (long)size * sizeof(double)); return GRIB_OUT_OF_MEMORY; } /*Construct a unique set of lats by filtering out duplicates*/ - prev=v[0]; - v1[0]=prev; - count=1; - for (i=1;i<*len;i++) { - if (v[i]!=prev) { - prev=v[i]; - v1[count]=prev; /*Value different from previous so store it*/ + prev = v[0]; + v1[0] = prev; + count = 1; + for (i = 1; i < *len; i++) { + if (v[i] != prev) { + prev = v[i]; + v1[count] = prev; /*Value different from previous so store it*/ count++; } } - grib_context_free(c,v); + grib_context_free(c, v); - *val=v1; + *val = v1; - *len=count; + *len = count; return GRIB_SUCCESS; } diff --git a/src/grib_accessor_class_latlon_increment.c b/src/grib_accessor_class_latlon_increment.c index 9b5955169..1b130d05c 100644 --- a/src/grib_accessor_class_latlon_increment.c +++ b/src/grib_accessor_class_latlon_increment.c @@ -41,70 +41,71 @@ or edit "accessor.class" and rerun ./make_class.pl */ static int is_missing(grib_accessor*); -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_latlon_increment { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in double */ -/* Members defined in latlon_increment */ - const char* directionIncrementGiven; - const char* directionIncrement; - const char* scansPositively; - const char* first; - const char* last; - const char* numberOfPoints; - const char* angleMultiplier; - const char* angleDivisor; - long isLongitude; +typedef struct grib_accessor_latlon_increment +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in double */ + /* Members defined in latlon_increment */ + const char* directionIncrementGiven; + const char* directionIncrement; + const char* scansPositively; + const char* first; + const char* last; + const char* numberOfPoints; + const char* angleMultiplier; + const char* angleDivisor; + long isLongitude; } grib_accessor_latlon_increment; extern grib_accessor_class* grib_accessor_class_double; static grib_accessor_class _grib_accessor_class_latlon_increment = { - &grib_accessor_class_double, /* super */ - "latlon_increment", /* name */ - sizeof(grib_accessor_latlon_increment), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - &is_missing, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_double, /* super */ + "latlon_increment", /* name */ + sizeof(grib_accessor_latlon_increment), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + &is_missing, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -113,135 +114,133 @@ grib_accessor_class* grib_accessor_class_latlon_increment = &_grib_accessor_clas static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_latlon_increment* self = (grib_accessor_latlon_increment*)a; - int n = 0; - - self->directionIncrementGiven = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->directionIncrement = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->scansPositively = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->first = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->last = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->numberOfPoints = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->angleMultiplier = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->angleDivisor = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->isLongitude=grib_arguments_get_long(grib_handle_of_accessor(a), c,n++); + int n = 0; + + self->directionIncrementGiven = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->directionIncrement = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->scansPositively = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->first = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->last = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->numberOfPoints = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->angleMultiplier = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->angleDivisor = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->isLongitude = grib_arguments_get_long(grib_handle_of_accessor(a), c, n++); } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { grib_accessor_latlon_increment* self = (grib_accessor_latlon_increment*)a; - int ret = 0; + int ret = 0; - long directionIncrementGiven=0; - long directionIncrement=0; - long angleDivisor=1; - long angleMultiplier=1; - double first = 0; - double last = 0; - long numberOfPoints = 0; - long scansPositively = 0; + long directionIncrementGiven = 0; + long directionIncrement = 0; + long angleDivisor = 1; + long angleMultiplier = 1; + double first = 0; + double last = 0; + long numberOfPoints = 0; + long scansPositively = 0; - if(*len < 1) return GRIB_ARRAY_TOO_SMALL; + if (*len < 1) + return GRIB_ARRAY_TOO_SMALL; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->directionIncrementGiven,&directionIncrementGiven)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->directionIncrementGiven, &directionIncrementGiven)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->scansPositively,&scansPositively)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->scansPositively, &scansPositively)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->directionIncrement,&directionIncrement)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->directionIncrement, &directionIncrement)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_double_internal(grib_handle_of_accessor(a), self->first,&first)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(grib_handle_of_accessor(a), self->first, &first)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_double_internal(grib_handle_of_accessor(a), self->last,&last)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(grib_handle_of_accessor(a), self->last, &last)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints,&numberOfPoints)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints, &numberOfPoints)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->angleMultiplier,&angleMultiplier)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->angleMultiplier, &angleMultiplier)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->angleDivisor,&angleDivisor)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->angleDivisor, &angleDivisor)) != GRIB_SUCCESS) return ret; if (self->isLongitude) { - if (last < first && scansPositively) last+=360; + if (last < first && scansPositively) + last += 360; /*if (last > first && !scansPositively) first-=360;*/ } - if (!directionIncrementGiven && numberOfPoints != GRIB_MISSING_LONG) - { - if (numberOfPoints<2) { + if (!directionIncrementGiven && numberOfPoints != GRIB_MISSING_LONG) { + if (numberOfPoints < 2) { /* We cannot compute the increment if we don't have enough points! */ grib_context_log(a->parent->h->context, GRIB_LOG_ERROR, - "Cannot compute lat/lon increments. Not enough points!"); + "Cannot compute lat/lon increments. Not enough points!"); return GRIB_GEOCALCULUS_PROBLEM; } if (!scansPositively) { /* scans negatively */ - if (first > last){ - *val=(first-last)/(numberOfPoints-1); + if (first > last) { + *val = (first - last) / (numberOfPoints - 1); } else { - *val=(first+360.0-last)/(numberOfPoints-1); + *val = (first + 360.0 - last) / (numberOfPoints - 1); } } - else - { + else { /* scans positively */ - if (last > first){ - *val=(last-first)/(numberOfPoints-1); + if (last > first) { + *val = (last - first) / (numberOfPoints - 1); } else { - *val=(last+360.0-first)/(numberOfPoints-1); + *val = (last + 360.0 - first) / (numberOfPoints - 1); } } } - else if (numberOfPoints == GRIB_MISSING_LONG) - { + else if (numberOfPoints == GRIB_MISSING_LONG) { *val = GRIB_MISSING_DOUBLE; } - else - { - Assert(angleDivisor!=0); - *val = (double)directionIncrement/angleDivisor*angleMultiplier; + else { + Assert(angleDivisor != 0); + *val = (double)directionIncrement / angleDivisor * angleMultiplier; } #if 0 @@ -253,64 +252,73 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len) self->numberOfPoints,numberOfPoints, a->name,*val); #endif - if (ret == GRIB_SUCCESS) *len = 1; + if (ret == GRIB_SUCCESS) + *len = 1; return ret; } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { grib_accessor_latlon_increment* self = (grib_accessor_latlon_increment*)a; - int ret = 0; - long codedNumberOfPoints=0; - - long directionIncrementGiven=0; - long directionIncrement=0; - long angleDivisor=1; - long angleMultiplier=1; - double first = 0; - double last = 0; - long numberOfPoints = 0; + int ret = 0; + long codedNumberOfPoints = 0; + + long directionIncrementGiven = 0; + long directionIncrement = 0; + long angleDivisor = 1; + long angleMultiplier = 1; + double first = 0; + double last = 0; + long numberOfPoints = 0; /* long numberOfPointsInternal = 0; */ - long scansPositively = 0; - double directionIncrementDouble=0; + long scansPositively = 0; + double directionIncrementDouble = 0; - ret = grib_get_double_internal(grib_handle_of_accessor(a), self->first,&first); - if(ret != GRIB_SUCCESS) return ret; + ret = grib_get_double_internal(grib_handle_of_accessor(a), self->first, &first); + if (ret != GRIB_SUCCESS) + return ret; - ret = grib_get_double_internal(grib_handle_of_accessor(a), self->last,&last); - if(ret != GRIB_SUCCESS) return ret; + ret = grib_get_double_internal(grib_handle_of_accessor(a), self->last, &last); + if (ret != GRIB_SUCCESS) + return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->directionIncrementGiven,&directionIncrementGiven)) - != GRIB_SUCCESS) return ret; + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->directionIncrementGiven, &directionIncrementGiven)) != GRIB_SUCCESS) + return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints,&numberOfPoints)) != GRIB_SUCCESS) return ret; + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints, &numberOfPoints)) != GRIB_SUCCESS) + return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->scansPositively,&scansPositively)) - != GRIB_SUCCESS) return ret; + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->scansPositively, &scansPositively)) != GRIB_SUCCESS) + return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->angleMultiplier,&angleMultiplier)) != GRIB_SUCCESS) return ret; + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->angleMultiplier, &angleMultiplier)) != GRIB_SUCCESS) + return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->angleDivisor,&angleDivisor)) != GRIB_SUCCESS) return ret; + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->angleDivisor, &angleDivisor)) != GRIB_SUCCESS) + return ret; if (self->isLongitude) { - if (last < first && scansPositively) last+=360; - if (last > first && !scansPositively) first-=360; + if (last < first && scansPositively) + last += 360; + if (last > first && !scansPositively) + first -= 360; } if (*val == GRIB_MISSING_DOUBLE) { - directionIncrement=GRIB_MISSING_LONG; - directionIncrementGiven=1; - numberOfPoints=GRIB_MISSING_LONG; - } else { + directionIncrement = GRIB_MISSING_LONG; + directionIncrementGiven = 1; + numberOfPoints = GRIB_MISSING_LONG; + } + else { /* numberOfPointsInternal = 1+rint(fabs((last-first) / *val)); */ - directionIncrementDouble = rint (*val * (double)angleDivisor / (double)angleMultiplier); + directionIncrementDouble = rint(*val * (double)angleDivisor / (double)angleMultiplier); - directionIncrement=(long)directionIncrementDouble; - if (directionIncrement == 0 ) { - directionIncrement=GRIB_MISSING_LONG; - directionIncrementGiven=0; + directionIncrement = (long)directionIncrementDouble; + if (directionIncrement == 0) { + directionIncrement = GRIB_MISSING_LONG; + directionIncrementGiven = 0; } } @@ -319,13 +327,15 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannot pack value for %s error %d \n", a->name, self->numberOfPoints, ret); */ - grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints,&codedNumberOfPoints); + grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints, &codedNumberOfPoints); - ret = grib_set_long_internal(grib_handle_of_accessor(a), self->directionIncrement,directionIncrement); - if(ret ) return ret; + ret = grib_set_long_internal(grib_handle_of_accessor(a), self->directionIncrement, directionIncrement); + if (ret) + return ret; - ret = grib_set_long_internal(grib_handle_of_accessor(a), self->directionIncrementGiven,directionIncrementGiven); - if(ret )return ret; + ret = grib_set_long_internal(grib_handle_of_accessor(a), self->directionIncrementGiven, directionIncrementGiven); + if (ret) + return ret; #if 0 printf("pack -- %s=%ld %s=%ld \n ------- %s=%f %s=%f \n ------- %s=%ld codedNumberOfPoints=%ld %s=%f\n", @@ -337,15 +347,16 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) codedNumberOfPoints, a->name,*val); #endif - if (ret == GRIB_SUCCESS) *len = 1; + if (ret == GRIB_SUCCESS) + *len = 1; return ret; } static int is_missing(grib_accessor* a) { - size_t len=1; - double val=0; + size_t len = 1; + double val = 0; unpack_double(a, &val, &len); diff --git a/src/grib_accessor_class_latlonvalues.c b/src/grib_accessor_class_latlonvalues.c index 09e8787c1..07e1af845 100644 --- a/src/grib_accessor_class_latlonvalues.c +++ b/src/grib_accessor_class_latlonvalues.c @@ -38,62 +38,63 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_latlonvalues { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in double */ -/* Members defined in latlonvalues */ - const char* values; +typedef struct grib_accessor_latlonvalues +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in double */ + /* Members defined in latlonvalues */ + const char* values; } grib_accessor_latlonvalues; extern grib_accessor_class* grib_accessor_class_double; static grib_accessor_class _grib_accessor_class_latlonvalues = { - &grib_accessor_class_double, /* super */ - "latlonvalues", /* name */ - sizeof(grib_accessor_latlonvalues), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_double, /* super */ + "latlonvalues", /* name */ + sizeof(grib_accessor_latlonvalues), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -102,97 +103,102 @@ grib_accessor_class* grib_accessor_class_latlonvalues = &_grib_accessor_class_la static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_latlonvalues* self = (grib_accessor_latlonvalues*)a; - int n = 0; + int n = 0; - self->values = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); + self->values = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } -static int unpack_double (grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - grib_context* c=a->context; - int ret = 0; - double* v=val; - double lat,lon,value; - size_t size=0; - long count=0; - grib_iterator* iter=grib_iterator_new(grib_handle_of_accessor(a),0,&ret); - if (ret!=GRIB_SUCCESS) { - if (iter) grib_iterator_delete(iter); - grib_context_log(c,GRIB_LOG_ERROR,"unable to create iterator"); + grib_context* c = a->context; + int ret = 0; + double* v = val; + double lat, lon, value; + size_t size = 0; + long count = 0; + grib_iterator* iter = grib_iterator_new(grib_handle_of_accessor(a), 0, &ret); + if (ret != GRIB_SUCCESS) { + if (iter) + grib_iterator_delete(iter); + grib_context_log(c, GRIB_LOG_ERROR, "unable to create iterator"); return ret; } - size=0; - ret=value_count(a,&count); - if (ret) return ret; - size=count; + size = 0; + ret = value_count(a, &count); + if (ret) + return ret; + size = count; - if (*lenvalues,&size))!=GRIB_SUCCESS) { - grib_context_log(h->context,GRIB_LOG_ERROR,"unable to get size of %s",self->values); + if ((ret = grib_get_size(h, self->values, &size)) != GRIB_SUCCESS) { + grib_context_log(h->context, GRIB_LOG_ERROR, "unable to get size of %s", self->values); return ret; } - *count=3*size; + *count = 3 * size; return ret; } diff --git a/src/grib_accessor_class_library_version.c b/src/grib_accessor_class_library_version.c index f1f9e59c2..a2b0191e0 100644 --- a/src/grib_accessor_class_library_version.c +++ b/src/grib_accessor_class_library_version.c @@ -30,61 +30,62 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_string (grib_accessor*, char*, size_t *len); +static int unpack_string(grib_accessor*, char*, size_t* len); static size_t string_length(grib_accessor*); -static int value_count(grib_accessor*,long*); +static int value_count(grib_accessor*, long*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_library_version { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in ascii */ -/* Members defined in library_version */ +typedef struct grib_accessor_library_version +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in ascii */ + /* Members defined in library_version */ } grib_accessor_library_version; extern grib_accessor_class* grib_accessor_class_ascii; static grib_accessor_class _grib_accessor_class_library_version = { - &grib_accessor_class_ascii, /* super */ - "library_version", /* name */ - sizeof(grib_accessor_library_version), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - &string_length, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_ascii, /* super */ + "library_version", /* name */ + sizeof(grib_accessor_library_version), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + &string_length, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -93,62 +94,63 @@ grib_accessor_class* grib_accessor_class_library_version = &_grib_accessor_class static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static int unpack_string(grib_accessor* a, char* val, size_t *len) -{ - char result[30]={0,}; - size_t size; +static int unpack_string(grib_accessor* a, char* val, size_t* len) +{ + char result[30] = {0,}; + size_t size; + + int major = ECCODES_MAJOR_VERSION; + int minor = ECCODES_MINOR_VERSION; + int revision = ECCODES_REVISION_VERSION; - int major=ECCODES_MAJOR_VERSION; - int minor=ECCODES_MINOR_VERSION; - int revision=ECCODES_REVISION_VERSION; + sprintf(result, "%d.%d.%d", major, minor, revision); + size = sizeof(result); - sprintf(result,"%d.%d.%d",major,minor,revision); - size=sizeof(result); - - if ( *len < size ) return GRIB_ARRAY_TOO_SMALL; - strcpy(val,result); + if (*len < size) + return GRIB_ARRAY_TOO_SMALL; + strcpy(val, result); - *len=size; + *len = size; - return GRIB_SUCCESS; + return GRIB_SUCCESS; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - *count=1; + *count = 1; return 0; } diff --git a/src/grib_accessor_class_local_definition.c b/src/grib_accessor_class_local_definition.c index 9ef251987..c66a99ba9 100644 --- a/src/grib_accessor_class_local_definition.c +++ b/src/grib_accessor_class_local_definition.c @@ -44,74 +44,75 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_local_definition { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in unsigned */ - long nbytes; - grib_arguments* arg; -/* Members defined in local_definition */ - const char* productDefinitionTemplateNumber; - const char* productDefinitionTemplateNumberInternal; - const char* grib2LocalSectionNumber; - const char* type; - const char* stream; - const char* the_class; - const char* eps; - const char* stepType; - const char* derivedForecast; +typedef struct grib_accessor_local_definition +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in unsigned */ + long nbytes; + grib_arguments* arg; + /* Members defined in local_definition */ + const char* productDefinitionTemplateNumber; + const char* productDefinitionTemplateNumberInternal; + const char* grib2LocalSectionNumber; + const char* type; + const char* stream; + const char* the_class; + const char* eps; + const char* stepType; + const char* derivedForecast; } grib_accessor_local_definition; extern grib_accessor_class* grib_accessor_class_unsigned; static grib_accessor_class _grib_accessor_class_local_definition = { - &grib_accessor_class_unsigned, /* super */ - "local_definition", /* name */ - sizeof(grib_accessor_local_definition), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_unsigned, /* super */ + "local_definition", /* name */ + sizeof(grib_accessor_local_definition), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -120,286 +121,311 @@ grib_accessor_class* grib_accessor_class_local_definition = &_grib_accessor_clas static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_local_definition* self = (grib_accessor_local_definition*)a; - grib_handle* hand=grib_handle_of_accessor(a); - int n = 0; - - self->grib2LocalSectionNumber = grib_arguments_get_name(hand,c,n++); - self->productDefinitionTemplateNumber = grib_arguments_get_name(hand,c,n++); - self->productDefinitionTemplateNumberInternal = grib_arguments_get_name(hand,c,n++); - self->type = grib_arguments_get_name(hand,c,n++); - self->stream = grib_arguments_get_name(hand,c,n++); - self->the_class = grib_arguments_get_name(hand,c,n++); - self->eps = grib_arguments_get_name(hand,c,n++); - self->stepType = grib_arguments_get_name(hand,c,n++); - self->derivedForecast = grib_arguments_get_name(hand,c,n++); + grib_handle* hand = grib_handle_of_accessor(a); + int n = 0; + + self->grib2LocalSectionNumber = grib_arguments_get_name(hand, c, n++); + self->productDefinitionTemplateNumber = grib_arguments_get_name(hand, c, n++); + self->productDefinitionTemplateNumberInternal = grib_arguments_get_name(hand, c, n++); + self->type = grib_arguments_get_name(hand, c, n++); + self->stream = grib_arguments_get_name(hand, c, n++); + self->the_class = grib_arguments_get_name(hand, c, n++); + self->eps = grib_arguments_get_name(hand, c, n++); + self->stepType = grib_arguments_get_name(hand, c, n++); + self->derivedForecast = grib_arguments_get_name(hand, c, n++); } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_local_definition* self = (grib_accessor_local_definition*)a; - return grib_get_long(grib_handle_of_accessor(a), self->grib2LocalSectionNumber,val); + return grib_get_long(grib_handle_of_accessor(a), self->grib2LocalSectionNumber, val); } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { - grib_accessor_local_definition* self = (grib_accessor_local_definition*)a; - grib_handle* hand=grib_handle_of_accessor(a); - long productDefinitionTemplateNumber=-1; - long productDefinitionTemplateNumberInternal=-1; - long productDefinitionTemplateNumberNew=-1; - long grib2LocalSectionNumber=-1; - long type=-1; - long stream=-1; - long the_class=-1; - long eps=-1; - long chemical=-1; - long aerosol=-1; - long chemical_distfn=-1; - long aerosol_optical=-1; - char stepType[15]={0,}; - size_t slen=15; - int localDefinitionNumber=*val; - int isInstant=0; - int tooEarly=0; - long derivedForecast=-1; - long editionNumber = 0; - - if (grib_get_long(hand, "editionNumber", &editionNumber)==GRIB_SUCCESS) { + grib_accessor_local_definition* self = (grib_accessor_local_definition*)a; + grib_handle* hand = grib_handle_of_accessor(a); + long productDefinitionTemplateNumber = -1; + long productDefinitionTemplateNumberInternal = -1; + long productDefinitionTemplateNumberNew = -1; + long grib2LocalSectionNumber = -1; + long type = -1; + long stream = -1; + long the_class = -1; + long eps = -1; + long chemical = -1; + long aerosol = -1; + long chemical_distfn = -1; + long aerosol_optical = -1; + char stepType[15] = {0,}; + size_t slen = 15; + int localDefinitionNumber = *val; + int isInstant = 0; + int tooEarly = 0; + long derivedForecast = -1; + long editionNumber = 0; + + if (grib_get_long(hand, "editionNumber", &editionNumber) == GRIB_SUCCESS) { Assert(editionNumber != 1); } - if (grib_get_long(hand, self->productDefinitionTemplateNumber,&productDefinitionTemplateNumber)!=GRIB_SUCCESS) - tooEarly=1; - grib_get_long(hand, self->productDefinitionTemplateNumberInternal,&productDefinitionTemplateNumberInternal); - grib_get_long(hand, self->type,&type); - grib_get_long(hand, self->stream,&stream); - grib_get_long(hand, self->the_class,&the_class); - grib_get_long(hand, self->eps,&eps); - grib_get_string(hand, self->stepType,stepType,&slen); - if (!strcmp(stepType,"instant")) isInstant=1; - grib_get_long(hand, self->grib2LocalSectionNumber,&grib2LocalSectionNumber); - grib_get_long(hand, "is_chemical",&chemical); - grib_get_long(hand, "is_chemical_distfn",&chemical_distfn); - grib_get_long(hand, "is_aerosol",&aerosol); - grib_get_long(hand, "is_aerosol_optical",&aerosol_optical); - if (chemical==1 && aerosol==1) { - grib_context_log(a->context,GRIB_LOG_ERROR,"Parameter cannot be both chemical and aerosol!"); + if (grib_get_long(hand, self->productDefinitionTemplateNumber, &productDefinitionTemplateNumber) != GRIB_SUCCESS) + tooEarly = 1; + grib_get_long(hand, self->productDefinitionTemplateNumberInternal, &productDefinitionTemplateNumberInternal); + grib_get_long(hand, self->type, &type); + grib_get_long(hand, self->stream, &stream); + grib_get_long(hand, self->the_class, &the_class); + grib_get_long(hand, self->eps, &eps); + grib_get_string(hand, self->stepType, stepType, &slen); + if (!strcmp(stepType, "instant")) + isInstant = 1; + grib_get_long(hand, self->grib2LocalSectionNumber, &grib2LocalSectionNumber); + grib_get_long(hand, "is_chemical", &chemical); + grib_get_long(hand, "is_chemical_distfn", &chemical_distfn); + grib_get_long(hand, "is_aerosol", &aerosol); + grib_get_long(hand, "is_aerosol_optical", &aerosol_optical); + if (chemical == 1 && aerosol == 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Parameter cannot be both chemical and aerosol!"); return GRIB_ENCODING_ERROR; } if (grib2_is_PDTN_EPS(productDefinitionTemplateNumber)) - eps=1; + eps = 1; switch (localDefinitionNumber) { - case 0: - case 300: - productDefinitionTemplateNumberNew=productDefinitionTemplateNumber; - break; - - case 500: - productDefinitionTemplateNumberNew=0; - break; - - case 1: /* MARS labelling */ - case 36: /* MARS labelling for long window 4Dvar system */ - case 40: /* MARS labeling with domain and model (for LAM) */ - case 42: /* LC-WFV: Wave forecast verification */ - if (isInstant) { - /* type=em || type=es */ - if (type==17) { - productDefinitionTemplateNumberNew=2; - derivedForecast=0; - } else if (type==18) { - productDefinitionTemplateNumberNew=2; - derivedForecast=4; - /* eps or enda or elda or ewla */ - } else if (eps==1 || stream==1030 || stream==1249 || stream==1250) { - productDefinitionTemplateNumberNew=1; - } else { - productDefinitionTemplateNumberNew=0; + case 0: + case 300: + productDefinitionTemplateNumberNew = productDefinitionTemplateNumber; + break; + + case 500: + productDefinitionTemplateNumberNew = 0; + break; + + case 1: /* MARS labelling */ + case 36: /* MARS labelling for long window 4Dvar system */ + case 40: /* MARS labeling with domain and model (for LAM) */ + case 42: /* LC-WFV: Wave forecast verification */ + if (isInstant) { + /* type=em || type=es */ + if (type == 17) { + productDefinitionTemplateNumberNew = 2; + derivedForecast = 0; + } + else if (type == 18) { + productDefinitionTemplateNumberNew = 2; + derivedForecast = 4; + /* eps or enda or elda or ewla */ + } + else if (eps == 1 || stream == 1030 || stream == 1249 || stream == 1250) { + productDefinitionTemplateNumberNew = 1; + } + else { + productDefinitionTemplateNumberNew = 0; + } } - } else { - /* type=em || type=es */ - if (type==17) { - productDefinitionTemplateNumberNew=12; - derivedForecast=0; - } else if (type==18) { - productDefinitionTemplateNumberNew=12; - derivedForecast=4; - /* eps or enda or elda or ewla */ - } else if (eps==1 || stream==1030 || stream==1249 || stream==1250) { - productDefinitionTemplateNumberNew=11; - } else { - productDefinitionTemplateNumberNew=8; + else { + /* type=em || type=es */ + if (type == 17) { + productDefinitionTemplateNumberNew = 12; + derivedForecast = 0; + } + else if (type == 18) { + productDefinitionTemplateNumberNew = 12; + derivedForecast = 4; + /* eps or enda or elda or ewla */ + } + else if (eps == 1 || stream == 1030 || stream == 1249 || stream == 1250) { + productDefinitionTemplateNumberNew = 11; + } + else { + productDefinitionTemplateNumberNew = 8; + } } - } - break; - case 41: /* EFAS: uses post-processing templates */ - if (isInstant) { - if (eps==1) productDefinitionTemplateNumberNew=71; - else productDefinitionTemplateNumberNew=70; - } else { - /* non-instantaneous: accum etc */ - if (eps==1) productDefinitionTemplateNumberNew=73; - else productDefinitionTemplateNumberNew=72; - } - break; - - case 15: /* Seasonal forecast data */ - case 16: /* Seasonal forecast monthly mean data */ - case 12: /* Seasonal forecast monthly mean data for lagged systems */ - case 18: /* Multianalysis ensemble data */ - case 26: /* MARS labelling or ensemble forecast data */ - case 30: /* Forecasting Systems with Variable Resolution */ - if (isInstant) { - productDefinitionTemplateNumberNew=1; - } else { - productDefinitionTemplateNumberNew=11; - } - break; - - case 5: /* Forecast probability data */ - case 7: /* Sensitivity data */ - case 9: /* Singular vectors and ensemble perturbations */ - case 11: /* Supplementary data used by the analysis */ - case 14: /* Brightness temperature */ - case 20: /* 4D variational increments */ - case 21: /* Sensitive area predictions */ - case 23: /* Coupled atmospheric, wave and ocean means */ - case 24: /* Satellite Channel Number Data */ - case 25: - case 28: /* COSMO local area EPS */ - case 38: /* 4D variational increments for long window 4Dvar system */ - case 39: /* 4DVar model errors for long window 4Dvar system */ - case 192: /* Multiple ECMWF local definitions */ - if (isInstant) { - productDefinitionTemplateNumberNew=0; - } else { - productDefinitionTemplateNumberNew=8; - } - break; + break; + case 41: /* EFAS: uses post-processing templates */ + if (isInstant) { + if (eps == 1) + productDefinitionTemplateNumberNew = 71; + else + productDefinitionTemplateNumberNew = 70; + } + else { + /* non-instantaneous: accum etc */ + if (eps == 1) + productDefinitionTemplateNumberNew = 73; + else + productDefinitionTemplateNumberNew = 72; + } + break; + + case 15: /* Seasonal forecast data */ + case 16: /* Seasonal forecast monthly mean data */ + case 12: /* Seasonal forecast monthly mean data for lagged systems */ + case 18: /* Multianalysis ensemble data */ + case 26: /* MARS labelling or ensemble forecast data */ + case 30: /* Forecasting Systems with Variable Resolution */ + if (isInstant) { + productDefinitionTemplateNumberNew = 1; + } + else { + productDefinitionTemplateNumberNew = 11; + } + break; + + case 5: /* Forecast probability data */ + case 7: /* Sensitivity data */ + case 9: /* Singular vectors and ensemble perturbations */ + case 11: /* Supplementary data used by the analysis */ + case 14: /* Brightness temperature */ + case 20: /* 4D variational increments */ + case 21: /* Sensitive area predictions */ + case 23: /* Coupled atmospheric, wave and ocean means */ + case 24: /* Satellite Channel Number Data */ + case 25: + case 28: /* COSMO local area EPS */ + case 38: /* 4D variational increments for long window 4Dvar system */ + case 39: /* 4DVar model errors for long window 4Dvar system */ + case 192: /* Multiple ECMWF local definitions */ + if (isInstant) { + productDefinitionTemplateNumberNew = 0; + } + else { + productDefinitionTemplateNumberNew = 8; + } + break; - default: - grib_context_log(a->context,GRIB_LOG_ERROR,"Invalid localDefinitionNumber %d",localDefinitionNumber); - return GRIB_ENCODING_ERROR; - break; + default: + grib_context_log(a->context, GRIB_LOG_ERROR, "Invalid localDefinitionNumber %d", localDefinitionNumber); + return GRIB_ENCODING_ERROR; + break; } /* Adjust for atmospheric chemical constituents */ - if (chemical==1) { - if ( eps == 1 ) { + if (chemical == 1) { + if (eps == 1) { if (isInstant) { - productDefinitionTemplateNumberNew=41; - } else { - productDefinitionTemplateNumberNew=43; + productDefinitionTemplateNumberNew = 41; + } + else { + productDefinitionTemplateNumberNew = 43; } - } else { + } + else { if (isInstant) { - productDefinitionTemplateNumberNew=40; - } else { - productDefinitionTemplateNumberNew=42; + productDefinitionTemplateNumberNew = 40; + } + else { + productDefinitionTemplateNumberNew = 42; } } } /* Adjust for atmospheric chemical constituents based on a distribution function */ - if (chemical_distfn==1) { - if ( eps == 1 ) { + if (chemical_distfn == 1) { + if (eps == 1) { if (isInstant) { - productDefinitionTemplateNumberNew=58; - } else { - productDefinitionTemplateNumberNew=68; + productDefinitionTemplateNumberNew = 58; + } + else { + productDefinitionTemplateNumberNew = 68; } - } else { + } + else { if (isInstant) { - productDefinitionTemplateNumberNew=57; - } else { - productDefinitionTemplateNumberNew=67; + productDefinitionTemplateNumberNew = 57; + } + else { + productDefinitionTemplateNumberNew = 67; } } } /* Adjust for aerosols */ - if (aerosol==1) { - if ( eps == 1 ) { + if (aerosol == 1) { + if (eps == 1) { if (isInstant) { - productDefinitionTemplateNumberNew=45; - } else { - productDefinitionTemplateNumberNew=47; + productDefinitionTemplateNumberNew = 45; + } + else { + productDefinitionTemplateNumberNew = 47; } - } else { + } + else { if (isInstant) { - productDefinitionTemplateNumberNew=48;/*44 is deprecated*/ - } else { - productDefinitionTemplateNumberNew=46; + productDefinitionTemplateNumberNew = 48; /*44 is deprecated*/ + } + else { + productDefinitionTemplateNumberNew = 46; } } } /* Adjust for optical properties of aerosol */ - if (aerosol_optical==1) { - if ( eps == 1 ) { + if (aerosol_optical == 1) { + if (eps == 1) { if (isInstant) { - productDefinitionTemplateNumberNew=49; + productDefinitionTemplateNumberNew = 49; } - } else { + } + else { if (isInstant) { - productDefinitionTemplateNumberNew=48; + productDefinitionTemplateNumberNew = 48; } } } if (productDefinitionTemplateNumber != productDefinitionTemplateNumberNew) { if (tooEarly) - grib_set_long(hand, self->productDefinitionTemplateNumberInternal,productDefinitionTemplateNumberNew); + grib_set_long(hand, self->productDefinitionTemplateNumberInternal, productDefinitionTemplateNumberNew); else - grib_set_long(hand, self->productDefinitionTemplateNumber,productDefinitionTemplateNumberNew); + grib_set_long(hand, self->productDefinitionTemplateNumber, productDefinitionTemplateNumberNew); } - if (derivedForecast>=0) - grib_set_long(hand, self->derivedForecast,derivedForecast); + if (derivedForecast >= 0) + grib_set_long(hand, self->derivedForecast, derivedForecast); - grib_set_long(hand, self->grib2LocalSectionNumber,*val); + grib_set_long(hand, self->grib2LocalSectionNumber, *val); return 0; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - *count=1; + *count = 1; return 0; } diff --git a/src/grib_accessor_class_long.c b/src/grib_accessor_class_long.c index 2ddba18f7..dfc98a45d 100644 --- a/src/grib_accessor_class_long.c +++ b/src/grib_accessor_class_long.c @@ -34,64 +34,65 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); +static int get_native_type(grib_accessor*); static int pack_missing(grib_accessor*); -static int pack_string(grib_accessor*, const char*, size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); +static int pack_string(grib_accessor*, const char*, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); static void dump(grib_accessor*, grib_dumper*); static void init_class(grib_accessor_class*); static int compare(grib_accessor*, grib_accessor*); -typedef struct grib_accessor_long { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ +typedef struct grib_accessor_long +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ } grib_accessor_long; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_long = { - &grib_accessor_class_gen, /* super */ - "long", /* name */ - sizeof(grib_accessor_long), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - &pack_missing, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - &pack_string, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "long", /* name */ + sizeof(grib_accessor_long), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + &pack_missing, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + &pack_string, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + &compare, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -100,67 +101,67 @@ grib_accessor_class* grib_accessor_class_long = &_grib_accessor_class_long; static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static int get_native_type(grib_accessor* a) +static int get_native_type(grib_accessor* a) { return GRIB_TYPE_LONG; } -static void dump(grib_accessor* a,grib_dumper* dumper) +static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_long(dumper,a,NULL); + grib_dump_long(dumper, a, NULL); } -static int unpack_string(grib_accessor*a , char* v, size_t *len) +static int unpack_string(grib_accessor* a, char* v, size_t* len) { - int err = 0; + int err = 0; long val = 0; size_t l = 1; char repres[1024]; - err = grib_unpack_long (a , &val, &l); + err = grib_unpack_long(a, &val, &l); /* TODO: We should catch all errors but in this case the test ERA_Gen.sh will fail * as the output from grib_ls will be different */ /* if (err) return err; */ (void)err; - if ((val == GRIB_MISSING_LONG) && ((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) ) - sprintf(repres,"MISSING"); + if ((val == GRIB_MISSING_LONG) && ((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0)) + sprintf(repres, "MISSING"); else - sprintf(repres,"%ld", val); + sprintf(repres, "%ld", val); - l = strlen(repres)+1; + l = strlen(repres) + 1; - if(l >*len ){ - grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_long : unpack_string : Buffer too small for %s ", a->name ); + if (l > *len) { + grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_long : unpack_string : Buffer too small for %s ", a->name); *len = l; return GRIB_BUFFER_TOO_SMALL; } @@ -168,7 +169,7 @@ static int unpack_string(grib_accessor*a , char* v, size_t *len) *len = l; - strcpy(v,repres); + strcpy(v, repres); return GRIB_SUCCESS; } @@ -177,8 +178,8 @@ static int pack_missing(grib_accessor* a) size_t one = 1; long value = GRIB_MISSING_LONG; - if(a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) - return grib_pack_long(a,&value,&one); + if (a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) + return grib_pack_long(a, &value, &one); return GRIB_VALUE_CANNOT_BE_MISSING; } @@ -201,96 +202,103 @@ static int is_missing(grib_accessor* a){ } */ -static int unpack_double(grib_accessor* a, double* val,size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - size_t rlen = 0; - long count=0; + size_t rlen = 0; + long count = 0; unsigned long i = 0; - long *values = NULL; - long oneval = 0; - int ret = GRIB_SUCCESS; + long* values = NULL; + long oneval = 0; + int ret = GRIB_SUCCESS; - ret=grib_value_count(a,&count); - if (ret) return ret; - rlen=count; + ret = grib_value_count(a, &count); + if (ret) + return ret; + rlen = count; - if(*len < rlen) { - grib_context_log(a->context, GRIB_LOG_ERROR, " wrong size for %s it contains %d values ", a->name , rlen); + if (*len < rlen) { + grib_context_log(a->context, GRIB_LOG_ERROR, " wrong size for %s it contains %d values ", a->name, rlen); *len = 0; return GRIB_ARRAY_TOO_SMALL; } - if(rlen == 1){ - ret = grib_unpack_long(a,&oneval,&rlen); - if(ret != GRIB_SUCCESS) return ret; - *val = oneval; + if (rlen == 1) { + ret = grib_unpack_long(a, &oneval, &rlen); + if (ret != GRIB_SUCCESS) + return ret; + *val = oneval; *len = 1; return GRIB_SUCCESS; } - values = (long*)grib_context_malloc(a->context,rlen*sizeof(long)); - if(!values) return GRIB_INTERNAL_ERROR; + values = (long*)grib_context_malloc(a->context, rlen * sizeof(long)); + if (!values) + return GRIB_INTERNAL_ERROR; - ret = grib_unpack_long(a,values,&rlen); - if(ret != GRIB_SUCCESS){ - grib_context_free(a->context,values); + ret = grib_unpack_long(a, values, &rlen); + if (ret != GRIB_SUCCESS) { + grib_context_free(a->context, values); return ret; } - for(i=0; i< rlen;i++) + for (i = 0; i < rlen; i++) val[i] = values[i]; - grib_context_free(a->context,values); + grib_context_free(a->context, values); *len = rlen; return GRIB_SUCCESS; } -static int compare(grib_accessor* a,grib_accessor* b) +static int compare(grib_accessor* a, grib_accessor* b) { - int retval=0; - long *aval=0; - long *bval=0; - long count=0; + int retval = 0; + long* aval = 0; + long* bval = 0; + long count = 0; size_t alen = 0; size_t blen = 0; - int err=0; + int err = 0; - err=grib_value_count(a,&count); - if (err) return err; - alen=count; + err = grib_value_count(a, &count); + if (err) + return err; + alen = count; - err=grib_value_count(b,&count); - if (err) return err; - blen=count; + err = grib_value_count(b, &count); + if (err) + return err; + blen = count; - if (alen != blen) return GRIB_COUNT_MISMATCH; + if (alen != blen) + return GRIB_COUNT_MISMATCH; - aval=(long*)grib_context_malloc(a->context,alen*sizeof(long)); - bval=(long*)grib_context_malloc(b->context,blen*sizeof(long)); + aval = (long*)grib_context_malloc(a->context, alen * sizeof(long)); + bval = (long*)grib_context_malloc(b->context, blen * sizeof(long)); - grib_unpack_long(a,aval,&alen); - grib_unpack_long(b,bval,&blen); + grib_unpack_long(a, aval, &alen); + grib_unpack_long(b, bval, &blen); retval = GRIB_SUCCESS; while (alen != 0) { - if (*bval != *aval) retval = GRIB_LONG_VALUE_MISMATCH; + if (*bval != *aval) + retval = GRIB_LONG_VALUE_MISMATCH; alen--; } - grib_context_free(a->context,aval); - grib_context_free(b->context,bval); + grib_context_free(a->context, aval); + grib_context_free(b->context, bval); return retval; } -static int pack_string(grib_accessor* a, const char* val, size_t *len) +static int pack_string(grib_accessor* a, const char* val, size_t* len) { - char* theEnd=NULL; - long v=strtol(val,&theEnd,10); + char* theEnd = NULL; + long v = strtol(val, &theEnd, 10); if (theEnd) { - grib_context_log(a->context,GRIB_LOG_ERROR,"trying to pack \"%s\" as long",val); + grib_context_log(a->context, GRIB_LOG_ERROR, "trying to pack \"%s\" as long", val); return GRIB_WRONG_TYPE; } - return grib_pack_long( a,&v,len); + return grib_pack_long(a, &v, len); } diff --git a/src/grib_accessor_class_long_vector.c b/src/grib_accessor_class_long_vector.c index 7bfc49f3a..8b461ac71 100644 --- a/src/grib_accessor_class_long_vector.c +++ b/src/grib_accessor_class_long_vector.c @@ -39,68 +39,69 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int get_native_type(grib_accessor*); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_long_vector { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in abstract_long_vector */ - long* v; - long pack_index; - int number_of_elements; -/* Members defined in long_vector */ - const char* vector; - int index; +typedef struct grib_accessor_long_vector +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in abstract_long_vector */ + long* v; + long pack_index; + int number_of_elements; + /* Members defined in long_vector */ + const char* vector; + int index; } grib_accessor_long_vector; extern grib_accessor_class* grib_accessor_class_abstract_long_vector; static grib_accessor_class _grib_accessor_class_long_vector = { - &grib_accessor_class_abstract_long_vector, /* super */ - "long_vector", /* name */ - sizeof(grib_accessor_long_vector), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_abstract_long_vector, /* super */ + "long_vector", /* name */ + sizeof(grib_accessor_long_vector), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -109,40 +110,41 @@ grib_accessor_class* grib_accessor_class_long_vector = &_grib_accessor_class_lon static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -typedef struct grib_accessor_abstract_long_vector { - grib_accessor att; +typedef struct grib_accessor_abstract_long_vector +{ + grib_accessor att; /* Members defined in gen */ /* Members defined in abstract_long_vector */ long* v; @@ -150,78 +152,78 @@ typedef struct grib_accessor_abstract_long_vector { int number_of_elements; } grib_accessor_abstract_long_vector; -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { - grib_accessor_long_vector* self = (grib_accessor_long_vector*)a; - grib_accessor* va=NULL; - grib_accessor_abstract_long_vector* v =NULL; - int n = 0; + grib_accessor_long_vector* self = (grib_accessor_long_vector*)a; + grib_accessor* va = NULL; + grib_accessor_abstract_long_vector* v = NULL; + int n = 0; - self->vector = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); + self->vector = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - va=(grib_accessor*)grib_find_accessor(grib_handle_of_accessor(a),self->vector); - v=(grib_accessor_abstract_long_vector*)va; + va = (grib_accessor*)grib_find_accessor(grib_handle_of_accessor(a), self->vector); + v = (grib_accessor_abstract_long_vector*)va; - self->index = grib_arguments_get_long(grib_handle_of_accessor(a),c,n++); + self->index = grib_arguments_get_long(grib_handle_of_accessor(a), c, n++); /* check self->index on init and never change it */ - Assert(self->index < v->number_of_elements && self->index>=0); + Assert(self->index < v->number_of_elements && self->index >= 0); - a->length=0; + a->length = 0; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - size_t size=0; + size_t size = 0; long* vector; - grib_accessor_long_vector* self = (grib_accessor_long_vector*)a; - grib_accessor* va=NULL; - grib_accessor_abstract_long_vector* v =NULL; + grib_accessor_long_vector* self = (grib_accessor_long_vector*)a; + grib_accessor* va = NULL; + grib_accessor_abstract_long_vector* v = NULL; - va=(grib_accessor*)grib_find_accessor(grib_handle_of_accessor(a),self->vector); - v=(grib_accessor_abstract_long_vector*)va; + va = (grib_accessor*)grib_find_accessor(grib_handle_of_accessor(a), self->vector); + v = (grib_accessor_abstract_long_vector*)va; /*TODO implement the dirty mechanism to avoid to unpack every time */ - grib_get_size(grib_handle_of_accessor(a),self->vector,&size); - vector=(long*)grib_context_malloc(a->context,sizeof(long)*size); - grib_unpack_long(va,vector,&size); - grib_context_free(a->context,vector); + grib_get_size(grib_handle_of_accessor(a), self->vector, &size); + vector = (long*)grib_context_malloc(a->context, sizeof(long) * size); + grib_unpack_long(va, vector, &size); + grib_context_free(a->context, vector); *val = v->v[self->index]; return GRIB_SUCCESS; } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - long lval=0; - int err=0; - grib_accessor_long_vector* self = (grib_accessor_long_vector*)a; - grib_accessor* va=NULL; - grib_accessor_abstract_long_vector* v =NULL; - va=(grib_accessor*)grib_find_accessor(grib_handle_of_accessor(a),self->vector); - v=(grib_accessor_abstract_long_vector*)va; + long lval = 0; + int err = 0; + grib_accessor_long_vector* self = (grib_accessor_long_vector*)a; + grib_accessor* va = NULL; + grib_accessor_abstract_long_vector* v = NULL; + va = (grib_accessor*)grib_find_accessor(grib_handle_of_accessor(a), self->vector); + v = (grib_accessor_abstract_long_vector*)va; - err=unpack_long(a,&lval,len); + err = unpack_long(a, &lval, len); *val = (double)v->v[self->index]; return err; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { - int err=0; - grib_accessor_long_vector* self = (grib_accessor_long_vector*)a; - grib_accessor* va=NULL; - grib_accessor_abstract_long_vector* v =NULL; + int err = 0; + grib_accessor_long_vector* self = (grib_accessor_long_vector*)a; + grib_accessor* va = NULL; + grib_accessor_abstract_long_vector* v = NULL; - va=(grib_accessor*)grib_find_accessor(grib_handle_of_accessor(a),self->vector); - v=(grib_accessor_abstract_long_vector*)va; + va = (grib_accessor*)grib_find_accessor(grib_handle_of_accessor(a), self->vector); + v = (grib_accessor_abstract_long_vector*)va; - v->pack_index=self->index; + v->pack_index = self->index; - err=grib_pack_long(va,val,len); + err = grib_pack_long(va, val, len); return err; } diff --git a/src/grib_accessor_class_longitudes.c b/src/grib_accessor_class_longitudes.c index 06d593b33..0067dfbd1 100644 --- a/src/grib_accessor_class_longitudes.c +++ b/src/grib_accessor_class_longitudes.c @@ -42,66 +42,67 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_longitudes { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in double */ -/* Members defined in longitudes */ - const char* values; - long distinct; - double* lons; - long size; - int save; +typedef struct grib_accessor_longitudes +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in double */ + /* Members defined in longitudes */ + const char* values; + long distinct; + double* lons; + long size; + int save; } grib_accessor_longitudes; extern grib_accessor_class* grib_accessor_class_double; static grib_accessor_class _grib_accessor_class_longitudes = { - &grib_accessor_class_double, /* super */ - "longitudes", /* name */ - sizeof(grib_accessor_longitudes), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_double, /* super */ + "longitudes", /* name */ + sizeof(grib_accessor_longitudes), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -110,200 +111,210 @@ grib_accessor_class* grib_accessor_class_longitudes = &_grib_accessor_class_long static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static int get_distinct(grib_accessor* a,double** val,long* len); -static int compare_doubles( const void* a, const void* b ); +static int get_distinct(grib_accessor* a, double** val, long* len); +static int compare_doubles(const void* a, const void* b); -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_longitudes* self = (grib_accessor_longitudes*)a; - int n = 0; + int n = 0; - self->values = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->distinct = grib_arguments_get_long(grib_handle_of_accessor(a),c,n++); - self->save=0; - self->lons=0; + self->values = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->distinct = grib_arguments_get_long(grib_handle_of_accessor(a), c, n++); + self->save = 0; + self->lons = 0; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } -static int unpack_double (grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - grib_context* c=a->context; + grib_context* c = a->context; grib_accessor_longitudes* self = (grib_accessor_longitudes*)a; - int ret = 0; - double* v=val; - double dummyLat=0, dummyVal=0; - size_t size=0; - long count=0; - grib_iterator* iter=NULL; - - self->save=1; - size=0; - ret=value_count(a,&count); - if (ret) return ret; - size=count; - - if (*lenlons are computed in value_count*/ - if (self->lons) { - grib_context_free(c,self->lons); - self->lons=NULL; - } - return GRIB_ARRAY_TOO_SMALL; + int ret = 0; + double* v = val; + double dummyLat = 0, dummyVal = 0; + size_t size = 0; + long count = 0; + grib_iterator* iter = NULL; + + self->save = 1; + size = 0; + ret = value_count(a, &count); + if (ret) + return ret; + size = count; + + if (*len < size) { + /* self->lons are computed in value_count*/ + if (self->lons) { + grib_context_free(c, self->lons); + self->lons = NULL; + } + return GRIB_ARRAY_TOO_SMALL; } - self->save=0; + self->save = 0; /* self->lons are computed in value_count*/ if (self->lons) { int i; - *len=self->size; - for (i=0;ilons[i]; - grib_context_free(c,self->lons); - self->lons=NULL; - self->size=0; + *len = self->size; + for (i = 0; i < size; i++) + val[i] = self->lons[i]; + grib_context_free(c, self->lons); + self->lons = NULL; + self->size = 0; return GRIB_SUCCESS; } - iter=grib_iterator_new(grib_handle_of_accessor(a),0,&ret); - if (ret!=GRIB_SUCCESS) { - if (iter) grib_iterator_delete(iter); - grib_context_log(c,GRIB_LOG_ERROR,"unable to create iterator"); + iter = grib_iterator_new(grib_handle_of_accessor(a), 0, &ret); + if (ret != GRIB_SUCCESS) { + if (iter) + grib_iterator_delete(iter); + grib_context_log(c, GRIB_LOG_ERROR, "unable to create iterator"); return ret; } - while(grib_iterator_next(iter,&dummyLat,v++,&dummyVal)) {} + while (grib_iterator_next(iter, &dummyLat, v++, &dummyVal)) {} grib_iterator_delete(iter); - *len=size; + *len = size; return ret; } -static int value_count(grib_accessor* a,long* len) +static int value_count(grib_accessor* a, long* len) { grib_accessor_longitudes* self = (grib_accessor_longitudes*)a; - grib_handle* h=grib_handle_of_accessor(a); - grib_context* c=a->context; - double* val=NULL; + grib_handle* h = grib_handle_of_accessor(a); + grib_context* c = a->context; + double* val = NULL; int ret; size_t size; - *len=0; - if ((ret=grib_get_size(h,self->values,&size))!=GRIB_SUCCESS) { - grib_context_log(h->context,GRIB_LOG_ERROR,"unable to get size of %s",self->values); + *len = 0; + if ((ret = grib_get_size(h, self->values, &size)) != GRIB_SUCCESS) { + grib_context_log(h->context, GRIB_LOG_ERROR, "unable to get size of %s", self->values); return ret; } - *len=size; + *len = size; if (self->distinct) { - ret=get_distinct(a,&val,len); - if (ret!=GRIB_SUCCESS) return ret; + ret = get_distinct(a, &val, len); + if (ret != GRIB_SUCCESS) + return ret; if (self->save) { - self->lons=val; - self->size=*len; - } else { - grib_context_free(c,val); + self->lons = val; + self->size = *len; + } + else { + grib_context_free(c, val); } } return ret; } -static int get_distinct(grib_accessor* a,double** val,long* len) { - long count=0; +static int get_distinct(grib_accessor* a, double** val, long* len) +{ + long count = 0; double prev; - double *v=NULL; - double *v1=NULL; - double dummyLat=0, dummyVal=0; - int ret=0; + double* v = NULL; + double* v1 = NULL; + double dummyLat = 0, dummyVal = 0; + int ret = 0; int i; - size_t size=*len; - grib_context* c=a->context; - grib_iterator* iter=grib_iterator_new(grib_handle_of_accessor(a),0,&ret); - if (ret!=GRIB_SUCCESS) { - if (iter) grib_iterator_delete(iter); - grib_context_log(c,GRIB_LOG_ERROR,"unable to create iterator"); + size_t size = *len; + grib_context* c = a->context; + grib_iterator* iter = grib_iterator_new(grib_handle_of_accessor(a), 0, &ret); + if (ret != GRIB_SUCCESS) { + if (iter) + grib_iterator_delete(iter); + grib_context_log(c, GRIB_LOG_ERROR, "unable to create iterator"); return ret; } - v=(double*)grib_context_malloc_clear(c,size*sizeof(double)); + v = (double*)grib_context_malloc_clear(c, size * sizeof(double)); if (!v) { - grib_context_log(c,GRIB_LOG_ERROR, - "unable to allocate %ld bytes",(long)size*sizeof(double)); + grib_context_log(c, GRIB_LOG_ERROR, + "unable to allocate %ld bytes", (long)size * sizeof(double)); return GRIB_OUT_OF_MEMORY; } - *val=v; + *val = v; - while(grib_iterator_next(iter,&dummyLat,v++,&dummyVal)) {} + while (grib_iterator_next(iter, &dummyLat, v++, &dummyVal)) {} grib_iterator_delete(iter); - v=*val; + v = *val; - qsort(v,*len,sizeof(double),&compare_doubles); + qsort(v, *len, sizeof(double), &compare_doubles); - v1=(double*)grib_context_malloc_clear(c,size*sizeof(double)); + v1 = (double*)grib_context_malloc_clear(c, size * sizeof(double)); if (!v1) { - grib_context_log(c,GRIB_LOG_ERROR, - "unable to allocate %ld bytes",(long)size*sizeof(double)); + grib_context_log(c, GRIB_LOG_ERROR, + "unable to allocate %ld bytes", (long)size * sizeof(double)); return GRIB_OUT_OF_MEMORY; } - prev=v[0]; - v1[0]=prev; - count=1; - for (i=1;i<*len;i++) { - if (v[i]!=prev) { - prev=v[i]; - v1[count]=prev; + prev = v[0]; + v1[0] = prev; + count = 1; + for (i = 1; i < *len; i++) { + if (v[i] != prev) { + prev = v[i]; + v1[count] = prev; count++; } } - grib_context_free(c,v); + grib_context_free(c, v); - *val=v1; + *val = v1; - *len=count; + *len = count; return GRIB_SUCCESS; } -static int compare_doubles( const void* a, const void* b ) +static int compare_doubles(const void* a, const void* b) { - double* arg1 = (double*) a; - double* arg2 = (double*) b; - if( *arg1 < *arg2 ) return -1; - else if( *arg1 == *arg2 ) return 0; - else return 1; + double* arg1 = (double*)a; + double* arg2 = (double*)b; + if (*arg1 < *arg2) + return -1; + else if (*arg1 == *arg2) + return 0; + else + return 1; } diff --git a/src/grib_accessor_class_lookup.c b/src/grib_accessor_class_lookup.c index 7ed6b6b79..54643c513 100644 --- a/src/grib_accessor_class_lookup.c +++ b/src/grib_accessor_class_lookup.c @@ -38,70 +38,71 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); static long byte_count(grib_accessor*); static long byte_offset(grib_accessor*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void post_init(grib_accessor*); static void init_class(grib_accessor_class*); -static int notify_change(grib_accessor*,grib_accessor*); - -typedef struct grib_accessor_lookup { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in lookup */ - long llength; - long loffset; - grib_expression* real_name; +static int notify_change(grib_accessor*, grib_accessor*); + +typedef struct grib_accessor_lookup +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in lookup */ + long llength; + long loffset; + grib_expression* real_name; } grib_accessor_lookup; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_lookup = { - &grib_accessor_class_long, /* super */ - "lookup", /* name */ - sizeof(grib_accessor_lookup), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - &post_init, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - &byte_count, /* get number of bytes */ - &byte_offset, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - ¬ify_change, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "lookup", /* name */ + sizeof(grib_accessor_lookup), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + &post_init, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + &byte_count, /* get number of bytes */ + &byte_offset, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + ¬ify_change, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -110,58 +111,58 @@ grib_accessor_class* grib_accessor_class_lookup = &_grib_accessor_class_lookup; static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len, grib_arguments *arg ) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { grib_accessor_lookup* self = (grib_accessor_lookup*)a; - a->length = 0; - self->llength = len; - self->loffset = grib_arguments_get_long(grib_handle_of_accessor(a),arg,0); + a->length = 0; + self->llength = len; + self->loffset = grib_arguments_get_long(grib_handle_of_accessor(a), arg, 0); a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - self->real_name = grib_arguments_get_expression(grib_handle_of_accessor(a),arg,1); + self->real_name = grib_arguments_get_expression(grib_handle_of_accessor(a), arg, 1); } static void post_init(grib_accessor* a) { grib_accessor_lookup* self = (grib_accessor_lookup*)a; - if(self->real_name ) { - grib_dependency_observe_expression(a,self->real_name ); + if (self->real_name) { + grib_dependency_observe_expression(a, self->real_name); } } -static void dump(grib_accessor* a,grib_dumper* dumper) +static void dump(grib_accessor* a, grib_dumper* dumper) { grib_accessor_lookup* self = (grib_accessor_lookup*)a; - unsigned char bytes[1024] = {0,}; - char msg[1024]= {0,}; + unsigned char bytes[1024] = {0,}; + char msg[1024] = {0,}; char buf[2048]; int i; unsigned long v = 0; @@ -170,8 +171,7 @@ static void dump(grib_accessor* a,grib_dumper* dumper) grib_unpack_bytes(a, bytes, &llen); /* TODO: Unpack byte unpack the wrong offset */ bytes[llen] = 0; - for(i = 0; i < llen; i++) - { + for (i = 0; i < llen; i++) { msg[i] = isprint(bytes[i]) ? bytes[i] : '?'; v <<= 8; v |= bytes[i]; @@ -179,15 +179,15 @@ static void dump(grib_accessor* a,grib_dumper* dumper) msg[llen] = 0; - sprintf(buf,"%s %lu %ld-%ld", msg, v, (long)a->offset+self->loffset, (long)self->llength); + sprintf(buf, "%s %lu %ld-%ld", msg, v, (long)a->offset + self->loffset, (long)self->llength); - grib_dump_long(dumper,a,buf); + grib_dump_long(dumper, a, buf); } -static int unpack_string(grib_accessor*a , char* v, size_t *len) +static int unpack_string(grib_accessor* a, char* v, size_t* len) { grib_accessor_lookup* self = (grib_accessor_lookup*)a; - unsigned char bytes[1024] = {0,}; + unsigned char bytes[1024] = {0,}; int i; size_t llen = self->llength; @@ -195,17 +195,16 @@ static int unpack_string(grib_accessor*a , char* v, size_t *len) bytes[llen] = 0; - for(i = 0; i < llen; i++) - { + for (i = 0; i < llen; i++) { v[i] = isprint(bytes[i]) ? bytes[i] : '?'; } v[llen] = 0; - if (llen==1 && v[0] == '?') { + if (llen == 1 && v[0] == '?') { /* Try unpack as long */ size_t length = 10; - long lval = 0; - int err = unpack_long(a, &lval, &length); + long lval = 0; + int err = unpack_long(a, &lval, &length); if (!err) { char str[5]; int conv = sprintf(str, "%ld", lval); @@ -218,27 +217,26 @@ static int unpack_string(grib_accessor*a , char* v, size_t *len) return GRIB_SUCCESS; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_lookup* al = (grib_accessor_lookup*)a; - grib_handle *h = grib_handle_of_accessor(a); + grib_handle* h = grib_handle_of_accessor(a); - long pos = (a->offset+al->loffset)*8; + long pos = (a->offset + al->loffset) * 8; - if(len[0] < 1) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name , 1 ); + if (len[0] < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); len[0] = 0; return GRIB_ARRAY_TOO_SMALL; } /* This is used when reparsing or rebuilding */ - if(h->loader) { + if (h->loader) { Assert(*len == 1); - return h->loader->lookup_long(h->context,h->loader,a->name,val); + return h->loader->lookup_long(h->context, h->loader, a->name, val); } - val[0] = grib_decode_unsigned_long(h->buffer->data , &pos, al->llength*8); + val[0] = grib_decode_unsigned_long(h->buffer->data, &pos, al->llength * 8); len[0] = 1; /*printf("###########lookup unpack_long: %s %ld %ld\n",a->name, pos/8, val[0]);*/ @@ -246,7 +244,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) return GRIB_SUCCESS; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { return GRIB_NOT_IMPLEMENTED; } @@ -263,7 +261,7 @@ static long byte_offset(grib_accessor* a) return al->loffset; } -static int notify_change(grib_accessor* self,grib_accessor* changed) +static int notify_change(grib_accessor* self, grib_accessor* changed) { /* Forward changes */ return grib_dependency_notify_change(self); diff --git a/src/grib_accessor_class_mars_param.c b/src/grib_accessor_class_mars_param.c index cec7f1ad9..e764fcc42 100644 --- a/src/grib_accessor_class_mars_param.c +++ b/src/grib_accessor_class_mars_param.c @@ -34,65 +34,66 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_string(grib_accessor*, const char*, size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); +static int pack_string(grib_accessor*, const char*, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); static size_t string_length(grib_accessor*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_mars_param { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in ascii */ -/* Members defined in mars_param */ - const char* paramId; - const char* table; - const char* param; +typedef struct grib_accessor_mars_param +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in ascii */ + /* Members defined in mars_param */ + const char* paramId; + const char* table; + const char* param; } grib_accessor_mars_param; extern grib_accessor_class* grib_accessor_class_ascii; static grib_accessor_class _grib_accessor_class_mars_param = { - &grib_accessor_class_ascii, /* super */ - "mars_param", /* name */ - sizeof(grib_accessor_mars_param), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - &string_length, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - &pack_string, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_ascii, /* super */ + "mars_param", /* name */ + sizeof(grib_accessor_mars_param), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + &string_length, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + &pack_string, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -101,102 +102,109 @@ grib_accessor_class* grib_accessor_class_mars_param = &_grib_accessor_class_mars static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { - int n=0; + int n = 0; grib_accessor_mars_param* self = (grib_accessor_mars_param*)a; - self->paramId= grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->table= grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->param= grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); + self->paramId = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->table = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->param = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); } -static int pack_string(grib_accessor* a, const char* val, size_t *len){ +static int pack_string(grib_accessor* a, const char* val, size_t* len) +{ #if 1 return GRIB_NOT_IMPLEMENTED; #else grib_accessor_mars_param* self = (grib_accessor_mars_param*)a; - long paramId=0; - long param=0; - long table=0; - char* p=(char*)val; - char* q=NULL; + long paramId = 0; + long param = 0; + long table = 0; + char* p = (char*)val; + char* q = NULL; - param=strtol(val, &p,10); - if ( *p!=0 ) table=strtol(++p, &q,10); - else table=128; + param = strtol(val, &p, 10); + if (*p != 0) + table = strtol(++p, &q, 10); + else + table = 128; - paramId=table*1000+param; + paramId = table * 1000 + param; - return grib_set_long_internal(grib_handle_of_accessor(a),self->paramId,paramId); + return grib_set_long_internal(grib_handle_of_accessor(a), self->paramId, paramId); #endif } -static int unpack_string(grib_accessor* a, char* val, size_t *len) -{ +static int unpack_string(grib_accessor* a, char* val, size_t* len) +{ grib_accessor_mars_param* self = (grib_accessor_mars_param*)a; - long param=0; - long table=0; - int ret=0; + long param = 0; + long table = 0; + int ret = 0; #if 1 - if(self->table!=NULL && (ret = grib_get_long_internal(grib_handle_of_accessor(a),self->table,&table)) != GRIB_SUCCESS) return ret; - if(self->param!=NULL && (ret = grib_get_long_internal(grib_handle_of_accessor(a),self->param,¶m)) != GRIB_SUCCESS) return ret; + if (self->table != NULL && (ret = grib_get_long_internal(grib_handle_of_accessor(a), self->table, &table)) != GRIB_SUCCESS) + return ret; + if (self->param != NULL && (ret = grib_get_long_internal(grib_handle_of_accessor(a), self->param, ¶m)) != GRIB_SUCCESS) + return ret; #else { - long paramId=0; - grib_get_long(grib_handle_of_accessor(a),self->paramId,¶mId); - - if (paramId==0 || (paramId < 4000 && paramId > 1000 )) { - if(self->table!=NULL && (ret = grib_get_long_internal(grib_handle_of_accessor(a),self->table,&table)) - != GRIB_SUCCESS) return ret; - if(self->param!=NULL && (ret = grib_get_long_internal(grib_handle_of_accessor(a),self->param,¶m)) - != GRIB_SUCCESS) return ret; - } else if (paramId<1000) { - table=128; - param=paramId; - } else { - table=paramId/1000; - param=paramId-table*1000; + long paramId = 0; + grib_get_long(grib_handle_of_accessor(a), self->paramId, ¶mId); + + if (paramId == 0 || (paramId < 4000 && paramId > 1000)) { + if (self->table != NULL && (ret = grib_get_long_internal(grib_handle_of_accessor(a), self->table, &table)) != GRIB_SUCCESS) + return ret; + if (self->param != NULL && (ret = grib_get_long_internal(grib_handle_of_accessor(a), self->param, ¶m)) != GRIB_SUCCESS) + return ret; + } + else if (paramId < 1000) { + table = 128; + param = paramId; + } + else { + table = paramId / 1000; + param = paramId - table * 1000; } } #endif /*if (table==200) table=128;*/ - sprintf(val,"%ld.%ld",param,table); - *len = strlen(val)+1; + sprintf(val, "%ld.%ld", param, table); + *len = strlen(val) + 1; return GRIB_SUCCESS; } diff --git a/src/grib_accessor_class_mars_step.c b/src/grib_accessor_class_mars_step.c index 538cd6766..31ebcc0f1 100644 --- a/src/grib_accessor_class_mars_step.c +++ b/src/grib_accessor_class_mars_step.c @@ -35,68 +35,69 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int pack_string(grib_accessor*, const char*, size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); +static int get_native_type(grib_accessor*); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int pack_string(grib_accessor*, const char*, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); static size_t string_length(grib_accessor*); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_mars_step { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in ascii */ -/* Members defined in mars_step */ - const char* stepRange; - const char* stepType; +typedef struct grib_accessor_mars_step +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in ascii */ + /* Members defined in mars_step */ + const char* stepRange; + const char* stepType; } grib_accessor_mars_step; extern grib_accessor_class* grib_accessor_class_ascii; static grib_accessor_class _grib_accessor_class_mars_step = { - &grib_accessor_class_ascii, /* super */ - "mars_step", /* name */ - sizeof(grib_accessor_mars_step), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - &string_length, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - &pack_string, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_ascii, /* super */ + "mars_step", /* name */ + sizeof(grib_accessor_mars_step), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + &string_length, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + &pack_string, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -105,125 +106,129 @@ grib_accessor_class* grib_accessor_class_mars_step = &_grib_accessor_class_mars_ static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { - int n=0; + int n = 0; grib_accessor_mars_step* self = (grib_accessor_mars_step*)a; - self->stepRange = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->stepType = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); + self->stepRange = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->stepType = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); } -static int pack_string(grib_accessor* a, const char* val, size_t *len) +static int pack_string(grib_accessor* a, const char* val, size_t* len) { char stepType[100]; - size_t stepTypeLen=100; - char buf[100]={0,}; + size_t stepTypeLen = 100; + char buf[100] = {0,}; int ret; grib_accessor_mars_step* self = (grib_accessor_mars_step*)a; - grib_accessor* stepRangeAcc=grib_find_accessor(grib_handle_of_accessor(a),self->stepRange); + grib_accessor* stepRangeAcc = grib_find_accessor(grib_handle_of_accessor(a), self->stepRange); if (!stepRangeAcc) { - grib_context_log(a->context,GRIB_LOG_ERROR,"%s not found",self->stepRange); + grib_context_log(a->context, GRIB_LOG_ERROR, "%s not found", self->stepRange); return GRIB_NOT_FOUND; } - if ((ret=grib_get_string(grib_handle_of_accessor(a),self->stepType,stepType,&stepTypeLen))!=GRIB_SUCCESS) + if ((ret = grib_get_string(grib_handle_of_accessor(a), self->stepType, stepType, &stepTypeLen)) != GRIB_SUCCESS) return ret; - if (!strcmp(stepType,"instant")) sprintf(buf,"%s",val) ; - else sprintf(buf,"0-%s",val); + if (!strcmp(stepType, "instant")) + sprintf(buf, "%s", val); + else + sprintf(buf, "0-%s", val); - return grib_pack_string(stepRangeAcc,buf,len); + return grib_pack_string(stepRangeAcc, buf, len); } -static int unpack_string(grib_accessor* a, char* val, size_t *len) +static int unpack_string(grib_accessor* a, char* val, size_t* len) { - int ret=0; + int ret = 0; grib_accessor_mars_step* self = (grib_accessor_mars_step*)a; - char buf[100]={0,}; - char* p=NULL; - size_t buflen=100; + char buf[100] = {0,}; + char* p = NULL; + size_t buflen = 100; long step; - grib_accessor* stepRangeAcc=grib_find_accessor(grib_handle_of_accessor(a),self->stepRange); + grib_accessor* stepRangeAcc = grib_find_accessor(grib_handle_of_accessor(a), self->stepRange); if (!stepRangeAcc) { - grib_context_log(a->context,GRIB_LOG_ERROR,"%s not found",self->stepRange); + grib_context_log(a->context, GRIB_LOG_ERROR, "%s not found", self->stepRange); return GRIB_NOT_FOUND; } - if ((ret=grib_unpack_string(stepRangeAcc,buf,&buflen))!=GRIB_SUCCESS) + if ((ret = grib_unpack_string(stepRangeAcc, buf, &buflen)) != GRIB_SUCCESS) return ret; if (*len < buflen) { grib_context_log(a->context, GRIB_LOG_ERROR, - "grib_accessor_class_mars_step: Buffer too small for %s. It is %ld bytes long (len=%ld)\n", - a->name, buflen, *len); + "grib_accessor_class_mars_step: Buffer too small for %s. It is %ld bytes long (len=%ld)\n", + a->name, buflen, *len); *len = buflen; return GRIB_BUFFER_TOO_SMALL; } - strcpy(val,buf); - step=strtol(buf, &p,10); + strcpy(val, buf); + step = strtol(buf, &p, 10); - if ( p!=NULL && *p=='-' && step==0 ) strcpy(val,++p); + if (p != NULL && *p == '-' && step == 0) + strcpy(val, ++p); - *len=strlen(val); + *len = strlen(val); return ret; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { - char buff[100]={0,}; - size_t bufflen=100; + char buff[100] = {0,}; + size_t bufflen = 100; - sprintf(buff,"%ld",*val); + sprintf(buff, "%ld", *val); - return pack_string(a,buff,&bufflen); + return pack_string(a, buff, &bufflen); } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_mars_step* self = (grib_accessor_mars_step*)a; - grib_accessor* stepRangeAcc=grib_find_accessor(grib_handle_of_accessor(a),self->stepRange); + grib_accessor* stepRangeAcc = grib_find_accessor(grib_handle_of_accessor(a), self->stepRange); - if (!stepRangeAcc) return GRIB_NOT_FOUND; + if (!stepRangeAcc) + return GRIB_NOT_FOUND; - return grib_unpack_long(stepRangeAcc,val,len); + return grib_unpack_long(stepRangeAcc, val, len); } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - *count=1; + *count = 1; return 0; } @@ -232,7 +237,7 @@ static size_t string_length(grib_accessor* a) return 16; } -static int get_native_type(grib_accessor* a) +static int get_native_type(grib_accessor* a) { return GRIB_TYPE_LONG; } diff --git a/src/grib_accessor_class_md5.c b/src/grib_accessor_class_md5.c index 662d1f836..b876b138c 100644 --- a/src/grib_accessor_class_md5.c +++ b/src/grib_accessor_class_md5.c @@ -35,66 +35,67 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int unpack_string (grib_accessor*, char*, size_t *len); -static int value_count(grib_accessor*,long*); -static void destroy(grib_context*,grib_accessor*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int get_native_type(grib_accessor*); +static int unpack_string(grib_accessor*, char*, size_t* len); +static int value_count(grib_accessor*, long*); +static void destroy(grib_context*, grib_accessor*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); static int compare(grib_accessor*, grib_accessor*); -typedef struct grib_accessor_md5 { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in md5 */ - const char* offset; - grib_expression* length; - grib_string_list* blacklist; +typedef struct grib_accessor_md5 +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in md5 */ + const char* offset; + grib_expression* length; + grib_string_list* blacklist; } grib_accessor_md5; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_md5 = { - &grib_accessor_class_gen, /* super */ - "md5", /* name */ - sizeof(grib_accessor_md5), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "md5", /* name */ + sizeof(grib_accessor_md5), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + &destroy, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + &compare, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -103,58 +104,59 @@ grib_accessor_class* grib_accessor_class_md5 = &_grib_accessor_class_md5; static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len , grib_arguments* arg ) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { - grib_accessor_md5* self = (grib_accessor_md5*)a; - char* b=0; - int n=0; - grib_string_list* current=0; - grib_context* context=a->context; - - self->offset = grib_arguments_get_name(grib_handle_of_accessor(a),arg,n++); - self->length = grib_arguments_get_expression(grib_handle_of_accessor(a),arg,n++); - self->blacklist=0; - while ( (b=(char*)grib_arguments_get_name(grib_handle_of_accessor(a),arg,n++)) !=NULL) { - if (! self->blacklist) { - self->blacklist=(grib_string_list*)grib_context_malloc_clear(context,sizeof(grib_string_list)); - self->blacklist->value=grib_context_strdup(context,b); - current=self->blacklist; - } else { - current->next=(grib_string_list*)grib_context_malloc_clear(context,sizeof(grib_string_list)); - current->next->value=grib_context_strdup(context,b); - current=current->next; + grib_accessor_md5* self = (grib_accessor_md5*)a; + char* b = 0; + int n = 0; + grib_string_list* current = 0; + grib_context* context = a->context; + + self->offset = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); + self->length = grib_arguments_get_expression(grib_handle_of_accessor(a), arg, n++); + self->blacklist = 0; + while ((b = (char*)grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++)) != NULL) { + if (!self->blacklist) { + self->blacklist = (grib_string_list*)grib_context_malloc_clear(context, sizeof(grib_string_list)); + self->blacklist->value = grib_context_strdup(context, b); + current = self->blacklist; + } + else { + current->next = (grib_string_list*)grib_context_malloc_clear(context, sizeof(grib_string_list)); + current->next->value = grib_context_strdup(context, b); + current = current->next; } } a->length = 0; @@ -162,105 +164,108 @@ static void init(grib_accessor* a, const long len , grib_arguments* arg ) a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; } -static int get_native_type(grib_accessor* a) +static int get_native_type(grib_accessor* a) { return GRIB_TYPE_STRING; } static int compare(grib_accessor* a, grib_accessor* b) { - int retval=GRIB_SUCCESS; + int retval = GRIB_SUCCESS; size_t alen = 0; size_t blen = 0; - int err=0; - long count=0; + int err = 0; + long count = 0; - err=grib_value_count(a,&count); - if (err) return err; - alen=count; + err = grib_value_count(a, &count); + if (err) + return err; + alen = count; - err=grib_value_count(b,&count); - if (err) return err; - blen=count; + err = grib_value_count(b, &count); + if (err) + return err; + blen = count; - if (alen != blen) return GRIB_COUNT_MISMATCH; + if (alen != blen) + return GRIB_COUNT_MISMATCH; return retval; } -static int unpack_string(grib_accessor*a , char* v, size_t *len) +static int unpack_string(grib_accessor* a, char* v, size_t* len) { grib_accessor_md5* self = (grib_accessor_md5*)a; unsigned mess_len; unsigned char* mess; unsigned char* p; - long offset=0, length=0; - grib_string_list* blacklist=NULL; - grib_accessor* b=NULL; - int ret=0; - int i=0; + long offset = 0, length = 0; + grib_string_list* blacklist = NULL; + grib_accessor* b = NULL; + int ret = 0; + int i = 0; struct grib_md5_state md5c; - if (*len <32 ) { - grib_context_log(a->context,GRIB_LOG_ERROR,"md5: array too small"); + if (*len < 32) { + grib_context_log(a->context, GRIB_LOG_ERROR, "md5: array too small"); return GRIB_ARRAY_TOO_SMALL; } - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->offset,&offset)) - != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offset, &offset)) != GRIB_SUCCESS) return ret; - if((ret = grib_expression_evaluate_long(grib_handle_of_accessor(a),self->length,&length)) - != GRIB_SUCCESS) + if ((ret = grib_expression_evaluate_long(grib_handle_of_accessor(a), self->length, &length)) != GRIB_SUCCESS) return ret; - mess=(unsigned char*)grib_context_malloc(a->context,length); - memcpy(mess,grib_handle_of_accessor(a)->buffer->data+offset,length); - mess_len=length; + mess = (unsigned char*)grib_context_malloc(a->context, length); + memcpy(mess, grib_handle_of_accessor(a)->buffer->data + offset, length); + mess_len = length; - blacklist=a->context->blacklist; + blacklist = a->context->blacklist; /* passed blacklist overrides context blacklist. Consider to modify following line to extend context blacklist. */ - if (self->blacklist) blacklist=self->blacklist; + if (self->blacklist) + blacklist = self->blacklist; while (blacklist && blacklist->value) { - b=grib_find_accessor(grib_handle_of_accessor(a),blacklist->value); + b = grib_find_accessor(grib_handle_of_accessor(a), blacklist->value); if (!b) { - grib_context_free(a->context,mess); + grib_context_free(a->context, mess); return GRIB_NOT_FOUND; } - p=mess+b->offset-offset; - for (i=0;ilength;i++) *(p++)=0; + p = mess + b->offset - offset; + for (i = 0; i < b->length; i++) + *(p++) = 0; - blacklist=blacklist->next; + blacklist = blacklist->next; } grib_md5_init(&md5c); - grib_md5_add(&md5c,mess,mess_len); - grib_md5_end(&md5c,v); - grib_context_free(a->context,mess); - *len = strlen(v)+1; + grib_md5_add(&md5c, mess, mess_len); + grib_md5_end(&md5c, v); + grib_context_free(a->context, mess); + *len = strlen(v) + 1; return ret; } -static void destroy(grib_context* c,grib_accessor* a) +static void destroy(grib_context* c, grib_accessor* a) { grib_accessor_md5* self = (grib_accessor_md5*)a; if (self->blacklist) { - grib_string_list* next=self->blacklist; - grib_string_list* cur=self->blacklist; - while(next) { - cur=next; - next=next->next; - grib_context_free(c,cur->value); - grib_context_free(c,cur); + grib_string_list* next = self->blacklist; + grib_string_list* cur = self->blacklist; + while (next) { + cur = next; + next = next->next; + grib_context_free(c, cur->value); + grib_context_free(c, cur); } } } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - *count=16; + *count = 16; return 0; } diff --git a/src/grib_accessor_class_message.c b/src/grib_accessor_class_message.c index 0c03cc657..84c8d5c8d 100644 --- a/src/grib_accessor_class_message.c +++ b/src/grib_accessor_class_message.c @@ -36,65 +36,66 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_string (grib_accessor*, char*, size_t *len); +static int unpack_string(grib_accessor*, char*, size_t* len); static size_t string_length(grib_accessor*); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -static void update_size(grib_accessor*,size_t); -static void resize(grib_accessor*,size_t); +static void update_size(grib_accessor*, size_t); +static void resize(grib_accessor*, size_t); static int compare(grib_accessor*, grib_accessor*); -typedef struct grib_accessor_message { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in bytes */ -/* Members defined in message */ +typedef struct grib_accessor_message +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in bytes */ + /* Members defined in message */ } grib_accessor_message; extern grib_accessor_class* grib_accessor_class_bytes; static grib_accessor_class _grib_accessor_class_message = { - &grib_accessor_class_bytes, /* super */ - "message", /* name */ - sizeof(grib_accessor_message), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - &string_length, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - &update_size, /* update_size */ - 0, /* preferred_size */ - &resize, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_bytes, /* super */ + "message", /* name */ + sizeof(grib_accessor_message), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + &string_length, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + &update_size, /* update_size */ + 0, /* preferred_size */ + &resize, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + &compare, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -103,81 +104,85 @@ grib_accessor_class* grib_accessor_class_message = &_grib_accessor_class_message static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->preferred_size = (*(c->super))->preferred_size; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->preferred_size = (*(c->super))->preferred_size; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len, grib_arguments*arg ) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->length=grib_handle_of_accessor(a)->buffer->ulength-len-a->offset; + a->length = grib_handle_of_accessor(a)->buffer->ulength - len - a->offset; } static int compare(grib_accessor* a, grib_accessor* b) { - if (a->length != b->length) return GRIB_COUNT_MISMATCH; + if (a->length != b->length) + return GRIB_COUNT_MISMATCH; return GRIB_SUCCESS; } -static void update_size(grib_accessor* a,size_t new_size) +static void update_size(grib_accessor* a, size_t new_size) { /* printf("update_size: grib_accessor_class_message.c %ld %ld %s %s\n", (long)new_size,(long)a->length,a->cclass->name,a->name); */ a->length = new_size; } -static void resize(grib_accessor* a,size_t new_size) +static void resize(grib_accessor* a, size_t new_size) { - void* zero = grib_context_malloc_clear(a->context,new_size); + void* zero = grib_context_malloc_clear(a->context, new_size); - grib_buffer_replace(a,(const unsigned char*)zero,new_size,1,0); - grib_context_free(a->context,zero); - grib_context_log(a->context,GRIB_LOG_DEBUG,"resize: grib_accessor_class_message.c %ld %ld %s %s\n",(long)new_size,(long)a->length,a->cclass->name,a->name); + grib_buffer_replace(a, (const unsigned char*)zero, new_size, 1, 0); + grib_context_free(a->context, zero); + grib_context_log(a->context, GRIB_LOG_DEBUG, "resize: grib_accessor_class_message.c %ld %ld %s %s\n", (long)new_size, (long)a->length, a->cclass->name, a->name); Assert(new_size == a->length); } -static int value_count(grib_accessor* a,long* count){ *count=1;return 0;} +static int value_count(grib_accessor* a, long* count) +{ + *count = 1; + return 0; +} -static int unpack_string(grib_accessor* a, char* val, size_t *len) +static int unpack_string(grib_accessor* a, char* val, size_t* len) { int i = 0; - if(len[0] < (a->length+1)) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%d) for %s it contains %d values ", len[0], a->name , a->length+1 ); + if (len[0] < (a->length + 1)) { + grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%d) for %s it contains %d values ", len[0], a->name, a->length + 1); len[0] = 0; return GRIB_ARRAY_TOO_SMALL; } - for ( i = 0; i < a->length; i++) - val[i] = grib_handle_of_accessor(a)->buffer->data[a->offset+i]; + for (i = 0; i < a->length; i++) + val[i] = grib_handle_of_accessor(a)->buffer->data[a->offset + i]; val[i] = 0; len[0] = i; return GRIB_SUCCESS; diff --git a/src/grib_accessor_class_message_copy.c b/src/grib_accessor_class_message_copy.c index 76f5aaf9a..2fcf17fb5 100644 --- a/src/grib_accessor_class_message_copy.c +++ b/src/grib_accessor_class_message_copy.c @@ -33,63 +33,64 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int unpack_string (grib_accessor*, char*, size_t *len); +static int get_native_type(grib_accessor*); +static int unpack_string(grib_accessor*, char*, size_t* len); static size_t string_length(grib_accessor*); static long byte_count(grib_accessor*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_message_copy { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in message_copy */ +typedef struct grib_accessor_message_copy +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in message_copy */ } grib_accessor_message_copy; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_message_copy = { - &grib_accessor_class_gen, /* super */ - "message_copy", /* name */ - sizeof(grib_accessor_message_copy), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - &string_length, /* get length of string */ - 0, /* get number of values */ - &byte_count, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "message_copy", /* name */ + sizeof(grib_accessor_message_copy), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + &string_length, /* get length of string */ + 0, /* get number of values */ + &byte_count, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -98,46 +99,46 @@ grib_accessor_class* grib_accessor_class_message_copy = &_grib_accessor_class_me static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->value_count = (*(c->super))->value_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->value_count = (*(c->super))->value_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long length , grib_arguments* args ) +static void init(grib_accessor* a, const long length, grib_arguments* args) { a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->length=0; + a->length = 0; } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_string(dumper,a,NULL); + grib_dump_string(dumper, a, NULL); } static int get_native_type(grib_accessor* a) @@ -145,19 +146,23 @@ static int get_native_type(grib_accessor* a) return GRIB_TYPE_STRING; } -static int unpack_string(grib_accessor* a, char* val, size_t *len) +static int unpack_string(grib_accessor* a, char* val, size_t* len) { - size_t slen=grib_handle_of_accessor(a)->buffer->ulength ; + size_t slen = grib_handle_of_accessor(a)->buffer->ulength; size_t i; - unsigned char* v=0; + unsigned char* v = 0; - if (*len < slen) { return GRIB_ARRAY_TOO_SMALL; } - v=grib_handle_of_accessor(a)->buffer->data; + if (*len < slen) { + return GRIB_ARRAY_TOO_SMALL; + } + v = grib_handle_of_accessor(a)->buffer->data; /* replace unprintable characters with space */ - for (i=0;i126) v[i]=32; - memcpy(val,grib_handle_of_accessor(a)->buffer->data,slen); + for (i = 0; i < slen; i++) + if (v[i] > 126) + v[i] = 32; + memcpy(val, grib_handle_of_accessor(a)->buffer->data, slen); - *len=slen; + *len = slen; return GRIB_SUCCESS; } diff --git a/src/grib_accessor_class_missing.c b/src/grib_accessor_class_missing.c index d926e690d..ff0e30b29 100644 --- a/src/grib_accessor_class_missing.c +++ b/src/grib_accessor_class_missing.c @@ -43,74 +43,75 @@ or edit "accessor.class" and rerun ./make_class.pl */ static grib_section* sub_section(grib_accessor* a); -static int get_native_type(grib_accessor*); -static int pack_bytes(grib_accessor*,const unsigned char*, size_t *len); -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int pack_string(grib_accessor*, const char*, size_t *len); +static int get_native_type(grib_accessor*); +static int pack_bytes(grib_accessor*, const unsigned char*, size_t* len); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int pack_string(grib_accessor*, const char*, size_t* len); static int pack_expression(grib_accessor*, grib_expression*); -static int unpack_bytes (grib_accessor*,unsigned char*, size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); +static int unpack_bytes(grib_accessor*, unsigned char*, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); static long byte_count(grib_accessor*); static long byte_offset(grib_accessor*); static long next_offset(grib_accessor*); -static int value_count(grib_accessor*,long*); -static void destroy(grib_context*,grib_accessor*); +static int value_count(grib_accessor*, long*); +static void destroy(grib_context*, grib_accessor*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -static int notify_change(grib_accessor*,grib_accessor*); -static void update_size(grib_accessor*,size_t); +static int notify_change(grib_accessor*, grib_accessor*); +static void update_size(grib_accessor*, size_t); -typedef struct grib_accessor_missing { - grib_accessor att; -/* Members defined in missing */ +typedef struct grib_accessor_missing +{ + grib_accessor att; + /* Members defined in missing */ } grib_accessor_missing; static grib_accessor_class _grib_accessor_class_missing = { - 0, /* super */ - "missing", /* name */ - sizeof(grib_accessor_missing), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* free mem */ - &dump, /* describes himself */ - &next_offset, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - &byte_count, /* get number of bytes */ - &byte_offset, /* get offset to bytes */ - &get_native_type, /* get native type */ - &sub_section, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - &pack_string, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - &pack_bytes, /* grib_pack procedures bytes */ - &unpack_bytes, /* grib_unpack procedures bytes */ - &pack_expression, /* pack_expression */ - ¬ify_change, /* notify_change */ - &update_size, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + 0, /* super */ + "missing", /* name */ + sizeof(grib_accessor_missing), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + &destroy, /* free mem */ + &dump, /* describes himself */ + &next_offset, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + &byte_count, /* get number of bytes */ + &byte_offset, /* get offset to bytes */ + &get_native_type, /* get native type */ + &sub_section, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + &pack_string, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + &pack_bytes, /* grib_pack procedures bytes */ + &unpack_bytes, /* grib_unpack procedures bytes */ + &pack_expression, /* pack_expression */ + ¬ify_change, /* notify_change */ + &update_size, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -123,79 +124,86 @@ static void init_class(grib_accessor_class* c) /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long len, grib_arguments* param) +static void init(grib_accessor* a, const long len, grib_arguments* param) { - /* a->flags = GRIB_FLAG_READONLY; */ - a->length = 0; + /* a->flags = GRIB_FLAG_READONLY; */ + a->length = 0; } static void dump(grib_accessor* a, grib_dumper* dumper) { - /* grib_dump_bytes(dumper,a,NULL); */ + /* grib_dump_bytes(dumper,a,NULL); */ } static long next_offset(grib_accessor* a) { - return a->offset; + return a->offset; } -static int value_count(grib_accessor* a,long* c) +static int value_count(grib_accessor* a, long* c) { - *c=0; - return 0; + *c = 0; + return 0; } static long byte_count(grib_accessor* a) { - return 0; + return 0; } -static int get_native_type(grib_accessor* a){ - return GRIB_TYPE_UNDEFINED; +static int get_native_type(grib_accessor* a) +{ + return GRIB_TYPE_UNDEFINED; } static long byte_offset(grib_accessor* a) { - return a->offset; + return a->offset; } -static int unpack_bytes(grib_accessor* a, unsigned char* val, size_t *len) +static int unpack_bytes(grib_accessor* a, unsigned char* val, size_t* len) { - return GRIB_NOT_FOUND; + return GRIB_NOT_FOUND; } -static int unpack_long (grib_accessor* a, long* v, size_t *len){ - return GRIB_NOT_FOUND; +static int unpack_long(grib_accessor* a, long* v, size_t* len) +{ + return GRIB_NOT_FOUND; } -static int unpack_double (grib_accessor* a, double*v, size_t *len){ - - return GRIB_NOT_FOUND; +static int unpack_double(grib_accessor* a, double* v, size_t* len) +{ + return GRIB_NOT_FOUND; } -static int unpack_string(grib_accessor*a , char* v, size_t *len){ - return GRIB_NOT_FOUND; - } +static int unpack_string(grib_accessor* a, char* v, size_t* len) +{ + return GRIB_NOT_FOUND; +} -static int pack_expression(grib_accessor* a, grib_expression *e){ - return GRIB_NOT_FOUND; +static int pack_expression(grib_accessor* a, grib_expression* e) +{ + return GRIB_NOT_FOUND; } -static int pack_long(grib_accessor* a, const long* v, size_t *len){ - return GRIB_NOT_FOUND; +static int pack_long(grib_accessor* a, const long* v, size_t* len) +{ + return GRIB_NOT_FOUND; } -static int pack_double(grib_accessor* a, const double*v, size_t *len){ - return GRIB_NOT_FOUND; +static int pack_double(grib_accessor* a, const double* v, size_t* len) +{ + return GRIB_NOT_FOUND; } -static int pack_string(grib_accessor*a , const char* v, size_t *len){ - return GRIB_NOT_FOUND; +static int pack_string(grib_accessor* a, const char* v, size_t* len) +{ + return GRIB_NOT_FOUND; } -static int pack_bytes(grib_accessor* a, const unsigned char* val, size_t *len) +static int pack_bytes(grib_accessor* a, const unsigned char* val, size_t* len) { - return GRIB_NOT_FOUND; + return GRIB_NOT_FOUND; } static void destroy(grib_context* ct, grib_accessor* a) @@ -204,14 +212,14 @@ static void destroy(grib_context* ct, grib_accessor* a) static grib_section* sub_section(grib_accessor* a) { - return NULL; + return NULL; } -static int notify_change(grib_accessor* self,grib_accessor* observed) +static int notify_change(grib_accessor* self, grib_accessor* observed) { - return GRIB_NOT_FOUND; + return GRIB_NOT_FOUND; } -static void update_size(grib_accessor* a,size_t s) +static void update_size(grib_accessor* a, size_t s) { } diff --git a/src/grib_accessor_class_nearest.c b/src/grib_accessor_class_nearest.c index 45bf2ac7d..2f9006dcf 100644 --- a/src/grib_accessor_class_nearest.c +++ b/src/grib_accessor_class_nearest.c @@ -32,59 +32,60 @@ or edit "accessor.class" and rerun ./make_class.pl */ static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_nearest { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in nearest */ - grib_arguments* args; +typedef struct grib_accessor_nearest +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in nearest */ + grib_arguments* args; } grib_accessor_nearest; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_nearest = { - &grib_accessor_class_gen, /* super */ - "nearest", /* name */ - sizeof(grib_accessor_nearest), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "nearest", /* name */ + sizeof(grib_accessor_nearest), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -93,68 +94,70 @@ grib_accessor_class* grib_accessor_class_nearest = &_grib_accessor_class_nearest static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* args) +static void init(grib_accessor* a, const long l, grib_arguments* args) { grib_accessor_nearest* self = (grib_accessor_nearest*)a; - self->args = args; + self->args = args; } -static void dump(grib_accessor* a,grib_dumper* dumper) +static void dump(grib_accessor* a, grib_dumper* dumper) { /* TODO: pass args */ - grib_dump_label(dumper,a,NULL); + grib_dump_label(dumper, a, NULL); } grib_nearest* grib_nearest_new(const grib_handle* ch, int* error) { - grib_handle* h = (grib_handle*)ch; - grib_accessor* a = NULL; - grib_accessor_nearest* na =NULL; - grib_nearest* n =NULL; - *error=GRIB_NOT_IMPLEMENTED; - a = grib_find_accessor(h,"NEAREST"); - na = (grib_accessor_nearest*)a; + grib_handle* h = (grib_handle*)ch; + grib_accessor* a = NULL; + grib_accessor_nearest* na = NULL; + grib_nearest* n = NULL; + *error = GRIB_NOT_IMPLEMENTED; + a = grib_find_accessor(h, "NEAREST"); + na = (grib_accessor_nearest*)a; - if (!a) return NULL; + if (!a) + return NULL; - n = grib_nearest_factory(h,na->args); + n = grib_nearest_factory(h, na->args); - if (n) *error=GRIB_SUCCESS; + if (n) + *error = GRIB_SUCCESS; return n; } diff --git a/src/grib_accessor_class_non_alpha.c b/src/grib_accessor_class_non_alpha.c index d4e606f79..182a55f12 100644 --- a/src/grib_accessor_class_non_alpha.c +++ b/src/grib_accessor_class_non_alpha.c @@ -40,70 +40,71 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int pack_string(grib_accessor*, const char*, size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); +static int get_native_type(grib_accessor*); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int pack_string(grib_accessor*, const char*, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); static size_t string_length(grib_accessor*); static long next_offset(grib_accessor*); -static int value_count(grib_accessor*,long*); +static int value_count(grib_accessor*, long*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); static int compare(grib_accessor*, grib_accessor*); -typedef struct grib_accessor_non_alpha { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in non_alpha */ +typedef struct grib_accessor_non_alpha +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in non_alpha */ } grib_accessor_non_alpha; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_non_alpha = { - &grib_accessor_class_gen, /* super */ - "non_alpha", /* name */ - sizeof(grib_accessor_non_alpha), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - &next_offset, /* get length of section */ - &string_length, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - &pack_string, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "non_alpha", /* name */ + sizeof(grib_accessor_non_alpha), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + &next_offset, /* get length of section */ + &string_length, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + &pack_string, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + &compare, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -112,50 +113,50 @@ grib_accessor_class* grib_accessor_class_non_alpha = &_grib_accessor_class_non_a static void init_class(grib_accessor_class* c) { - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len , grib_arguments* arg ) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { - grib_buffer* buffer=grib_handle_of_accessor(a)->buffer; - size_t i=0; + grib_buffer* buffer = grib_handle_of_accessor(a)->buffer; + size_t i = 0; unsigned char* v; - v=buffer->data+a->offset; - i=0; - while (( *v<33 || *v>126) && i<=buffer->ulength) { + v = buffer->data + a->offset; + i = 0; + while ((*v < 33 || *v > 126) && i <= buffer->ulength) { v++; i++; } - a->length=i; + a->length = i; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - *count=1; + *count = 1; return 0; } @@ -166,131 +167,136 @@ static size_t string_length(grib_accessor* a) static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_string(dumper,a,NULL); + grib_dump_string(dumper, a, NULL); } -static int get_native_type(grib_accessor* a) +static int get_native_type(grib_accessor* a) { return GRIB_TYPE_STRING; } -static int unpack_string(grib_accessor* a, char* val, size_t *len) +static int unpack_string(grib_accessor* a, char* val, size_t* len) { grib_handle* hand = grib_handle_of_accessor(a); - int i = 0; + int i = 0; - if (len[0] < (a->length+1)) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%d) for %s it contains %d values ", len[0], a->name , a->length+1 ); + if (len[0] < (a->length + 1)) { + grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%d) for %s it contains %d values ", len[0], a->name, a->length + 1); len[0] = 0; return GRIB_ARRAY_TOO_SMALL; } for (i = 0; i < a->length; i++) { - val[i] = hand->buffer->data[a->offset+i]; + val[i] = hand->buffer->data[a->offset + i]; } val[i] = 0; len[0] = i; return GRIB_SUCCESS; } -static int pack_string(grib_accessor* a, const char* val, size_t *len) +static int pack_string(grib_accessor* a, const char* val, size_t* len) { return GRIB_NOT_IMPLEMENTED; } -static int pack_long(grib_accessor* a, const long* v, size_t *len) +static int pack_long(grib_accessor* a, const long* v, size_t* len) { - grib_context_log(a->context,GRIB_LOG_ERROR, " Should not pack %s as long", a->name); + grib_context_log(a->context, GRIB_LOG_ERROR, " Should not pack %s as long", a->name); return GRIB_NOT_IMPLEMENTED; } -static int pack_double(grib_accessor* a, const double*v, size_t *len) +static int pack_double(grib_accessor* a, const double* v, size_t* len) { - grib_context_log(a->context,GRIB_LOG_ERROR, " Should not pack %s as double", a->name); + grib_context_log(a->context, GRIB_LOG_ERROR, " Should not pack %s as double", a->name); return GRIB_NOT_IMPLEMENTED; } -static int unpack_long(grib_accessor* a, long* v, size_t *len) +static int unpack_long(grib_accessor* a, long* v, size_t* len) { - char val[1024]={0,}; - size_t l = sizeof(val); - size_t i =0; - char *last = NULL; - int err=grib_unpack_string (a , val, &l); + char val[1024] = {0,}; + size_t l = sizeof(val); + size_t i = 0; + char* last = NULL; + int err = grib_unpack_string(a, val, &l); - if (err) return err; + if (err) + return err; - i=0; - while ( icontext,GRIB_LOG_DEBUG, " Casting string %s to long", a->name); + grib_context_log(a->context, GRIB_LOG_DEBUG, " Casting string %s to long", a->name); return GRIB_SUCCESS; } -static int unpack_double(grib_accessor* a, double*v, size_t *len) +static int unpack_double(grib_accessor* a, double* v, size_t* len) { char val[1024]; - size_t l = sizeof(val); - char *last = NULL; - grib_unpack_string (a , val, &l); + size_t l = sizeof(val); + char* last = NULL; + grib_unpack_string(a, val, &l); - *v = strtod(val,&last); + *v = strtod(val, &last); - if(*last == 0) - { - grib_context_log(a->context,GRIB_LOG_DEBUG, " Casting string %s to long", a->name); + if (*last == 0) { + grib_context_log(a->context, GRIB_LOG_DEBUG, " Casting string %s to long", a->name); return GRIB_SUCCESS; } return GRIB_NOT_IMPLEMENTED; } -static int compare(grib_accessor* a,grib_accessor* b) +static int compare(grib_accessor* a, grib_accessor* b) { - int retval=0; - char *aval=0; - char *bval=0; - int err=0; + int retval = 0; + char* aval = 0; + char* bval = 0; + int err = 0; size_t alen = 0; size_t blen = 0; - long count=0; + long count = 0; - err=grib_value_count(a,&count); - if (err) return err; - alen=count; + err = grib_value_count(a, &count); + if (err) + return err; + alen = count; - err=grib_value_count(b,&count); - if (err) return err; - blen=count; + err = grib_value_count(b, &count); + if (err) + return err; + blen = count; - if (alen != blen) return GRIB_COUNT_MISMATCH; + if (alen != blen) + return GRIB_COUNT_MISMATCH; - aval=(char*)grib_context_malloc(a->context,alen*sizeof(char)); - bval=(char*)grib_context_malloc(b->context,blen*sizeof(char)); + aval = (char*)grib_context_malloc(a->context, alen * sizeof(char)); + bval = (char*)grib_context_malloc(b->context, blen * sizeof(char)); - grib_unpack_string(a,aval,&alen); - grib_unpack_string(b,bval,&blen); + grib_unpack_string(a, aval, &alen); + grib_unpack_string(b, bval, &blen); retval = GRIB_SUCCESS; - if (strcmp(aval,bval)) retval = GRIB_STRING_VALUE_MISMATCH; + if (strcmp(aval, bval)) + retval = GRIB_STRING_VALUE_MISMATCH; - grib_context_free(a->context,aval); - grib_context_free(b->context,bval); + grib_context_free(a->context, aval); + grib_context_free(b->context, bval); return retval; } static long next_offset(grib_accessor* a) { - return a->offset+a->length; + return a->offset + a->length; } diff --git a/src/grib_accessor_class_number_of_coded_values.c b/src/grib_accessor_class_number_of_coded_values.c index 6df2700c8..3767248b9 100644 --- a/src/grib_accessor_class_number_of_coded_values.c +++ b/src/grib_accessor_class_number_of_coded_values.c @@ -39,65 +39,66 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_long(grib_accessor*, long* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_number_of_coded_values { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in number_of_coded_values */ - const char* numberOfValues; - const char* bitsPerValue; - const char* offsetBeforeData; - const char* offsetAfterData; - const char* unusedBits; +typedef struct grib_accessor_number_of_coded_values +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in number_of_coded_values */ + const char* numberOfValues; + const char* bitsPerValue; + const char* offsetBeforeData; + const char* offsetAfterData; + const char* unusedBits; } grib_accessor_number_of_coded_values; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_number_of_coded_values = { - &grib_accessor_class_long, /* super */ - "number_of_coded_values", /* name */ - sizeof(grib_accessor_number_of_coded_values), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "number_of_coded_values", /* name */ + sizeof(grib_accessor_number_of_coded_values), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -106,86 +107,87 @@ grib_accessor_class* grib_accessor_class_number_of_coded_values = &_grib_accesso static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { - int n=0; + int n = 0; grib_accessor_number_of_coded_values* self = (grib_accessor_number_of_coded_values*)a; - self->bitsPerValue = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->offsetBeforeData = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->offsetAfterData = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->unusedBits = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->numberOfValues = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + self->bitsPerValue = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->offsetBeforeData = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->offsetAfterData = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->unusedBits = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->numberOfValues = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; - a->length=0; + a->length = 0; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - int ret=GRIB_SUCCESS; - long bpv=0; - long offsetBeforeData=0,offsetAfterData=0,unusedBits=0,numberOfValues; + int ret = GRIB_SUCCESS; + long bpv = 0; + long offsetBeforeData = 0, offsetAfterData = 0, unusedBits = 0, numberOfValues; grib_accessor_number_of_coded_values* self = (grib_accessor_number_of_coded_values*)a; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->bitsPerValue,&bpv)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->bitsPerValue, &bpv)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetBeforeData,&offsetBeforeData)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetBeforeData, &offsetBeforeData)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetAfterData,&offsetAfterData)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetAfterData, &offsetAfterData)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->unusedBits,&unusedBits)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->unusedBits, &unusedBits)) != GRIB_SUCCESS) return ret; - if ( bpv != 0 ) { - grib_context_log(a->context,GRIB_LOG_DEBUG,"grib_accessor_number_of_coded_values: offsetAfterData=%ld offsetBeforeData=%ld unusedBits=%ld bpv=%ld\n", - offsetAfterData,offsetBeforeData,unusedBits,bpv); - DebugAssert( offsetAfterData > offsetBeforeData ); - *val=((offsetAfterData-offsetBeforeData)*8-unusedBits)/bpv; - } else { - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfValues,&numberOfValues)) != GRIB_SUCCESS) + if (bpv != 0) { + grib_context_log(a->context, GRIB_LOG_DEBUG, "grib_accessor_number_of_coded_values: offsetAfterData=%ld offsetBeforeData=%ld unusedBits=%ld bpv=%ld\n", + offsetAfterData, offsetBeforeData, unusedBits, bpv); + DebugAssert(offsetAfterData > offsetBeforeData); + *val = ((offsetAfterData - offsetBeforeData) * 8 - unusedBits) / bpv; + } + else { + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfValues, &numberOfValues)) != GRIB_SUCCESS) return ret; - *val=numberOfValues; + *val = numberOfValues; } return ret; diff --git a/src/grib_accessor_class_number_of_points.c b/src/grib_accessor_class_number_of_points.c index bb2d9caf2..f6131580f 100644 --- a/src/grib_accessor_class_number_of_points.c +++ b/src/grib_accessor_class_number_of_points.c @@ -38,64 +38,65 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_long(grib_accessor*, long* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_number_of_points { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in number_of_points */ - const char* ni; - const char* nj; - const char* plpresent; - const char* pl; +typedef struct grib_accessor_number_of_points +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in number_of_points */ + const char* ni; + const char* nj; + const char* plpresent; + const char* pl; } grib_accessor_number_of_points; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_number_of_points = { - &grib_accessor_class_long, /* super */ - "number_of_points", /* name */ - sizeof(grib_accessor_number_of_points), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "number_of_points", /* name */ + sizeof(grib_accessor_number_of_points), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -104,87 +105,90 @@ grib_accessor_class* grib_accessor_class_number_of_points = &_grib_accessor_clas static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { - int n=0; + int n = 0; grib_accessor_number_of_points* self = (grib_accessor_number_of_points*)a; - self->ni = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->nj = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->plpresent = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->pl = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + self->ni = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->nj = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->plpresent = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->pl = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; - a->length=0; + a->length = 0; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - int ret=GRIB_SUCCESS; - long ni=0,nj=0,plpresent=0; - size_t plsize=0; + int ret = GRIB_SUCCESS; + long ni = 0, nj = 0, plpresent = 0; + size_t plsize = 0; long* pl; int i; grib_accessor_number_of_points* self = (grib_accessor_number_of_points*)a; - grib_context* c=a->context; + grib_context* c = a->context; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->ni,&ni)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->ni, &ni)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->nj,&nj)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->nj, &nj)) != GRIB_SUCCESS) return ret; - if(self->plpresent && - ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->plpresent,&plpresent)) != GRIB_SUCCESS) ) + if (self->plpresent && + ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->plpresent, &plpresent)) != GRIB_SUCCESS)) return ret; - if (nj == 0) return GRIB_GEOCALCULUS_PROBLEM; + if (nj == 0) + return GRIB_GEOCALCULUS_PROBLEM; if (plpresent) { /*reduced*/ - plsize=nj; - pl=(long*)grib_context_malloc(c,sizeof(long)*plsize); - grib_get_long_array_internal(grib_handle_of_accessor(a),self->pl,pl, &plsize); - *val=0; - for (i=0;ipl, pl, &plsize); + *val = 0; + for (i = 0; i < plsize; i++) + *val += pl[i]; + grib_context_free(c, pl); + } + else { /*regular*/ - *val=ni*nj; + *val = ni * nj; } return ret; diff --git a/src/grib_accessor_class_number_of_points_gaussian.c b/src/grib_accessor_class_number_of_points_gaussian.c index f2195a45e..eddd94f91 100644 --- a/src/grib_accessor_class_number_of_points_gaussian.c +++ b/src/grib_accessor_class_number_of_points_gaussian.c @@ -46,70 +46,71 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_long(grib_accessor*, long* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_number_of_points_gaussian { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in number_of_points_gaussian */ - const char* ni; - const char* nj; - const char* plpresent; - const char* pl; - const char* order; - const char* lat_first; - const char* lon_first; - const char* lat_last; - const char* lon_last; - const char* support_legacy; +typedef struct grib_accessor_number_of_points_gaussian +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in number_of_points_gaussian */ + const char* ni; + const char* nj; + const char* plpresent; + const char* pl; + const char* order; + const char* lat_first; + const char* lon_first; + const char* lat_last; + const char* lon_last; + const char* support_legacy; } grib_accessor_number_of_points_gaussian; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_number_of_points_gaussian = { - &grib_accessor_class_long, /* super */ - "number_of_points_gaussian", /* name */ - sizeof(grib_accessor_number_of_points_gaussian), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "number_of_points_gaussian", /* name */ + sizeof(grib_accessor_number_of_points_gaussian), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -118,61 +119,61 @@ grib_accessor_class* grib_accessor_class_number_of_points_gaussian = &_grib_acce static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ #define EFDEBUG 0 -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { - int n=0; - grib_handle* h = grib_handle_of_accessor(a); + int n = 0; + grib_handle* h = grib_handle_of_accessor(a); grib_accessor_number_of_points_gaussian* self = (grib_accessor_number_of_points_gaussian*)a; - self->ni = grib_arguments_get_name(h,c,n++); - self->nj = grib_arguments_get_name(h,c,n++); - self->plpresent = grib_arguments_get_name(h,c,n++); - self->pl = grib_arguments_get_name(h,c,n++); - self->order = grib_arguments_get_name(h,c,n++); - self->lat_first = grib_arguments_get_name(h,c,n++); - self->lon_first = grib_arguments_get_name(h,c,n++); - self->lat_last = grib_arguments_get_name(h,c,n++); - self->lon_last = grib_arguments_get_name(h,c,n++); - self->support_legacy = grib_arguments_get_name(h,c,n++); - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + self->ni = grib_arguments_get_name(h, c, n++); + self->nj = grib_arguments_get_name(h, c, n++); + self->plpresent = grib_arguments_get_name(h, c, n++); + self->pl = grib_arguments_get_name(h, c, n++); + self->order = grib_arguments_get_name(h, c, n++); + self->lat_first = grib_arguments_get_name(h, c, n++); + self->lon_first = grib_arguments_get_name(h, c, n++); + self->lat_last = grib_arguments_get_name(h, c, n++); + self->lon_last = grib_arguments_get_name(h, c, n++); + self->support_legacy = grib_arguments_get_name(h, c, n++); + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; - a->length=0; + a->length = 0; } #if 0 /*Legacy mode*/ @@ -244,7 +245,7 @@ static long num_points_reduced_gauss_new(grib_handle* h, long nj, long pl[], dou static int angleApproximatelyEqual(double A, double B, double angular_precision) { - return angular_precision > 0 ? (fabs(A-B)<=angular_precision) : (A == B); + return angular_precision > 0 ? (fabs(A - B) <= angular_precision) : (A == B); } static double longitude_normalise(double lon, double minimum) @@ -261,8 +262,9 @@ static double longitude_normalise(double lon, double minimum) static void correctWestEast(long max_pl, double angular_precision, double* pWest, double* pEast) { double w, e; - const double inc = 360.0/max_pl; /*smallest increment*/ - if (*pWest > *pEast) *pEast += 360; + const double inc = 360.0 / max_pl; /*smallest increment*/ + if (*pWest > *pEast) + *pEast += 360; w = *pWest; e = *pEast; @@ -271,8 +273,8 @@ static void correctWestEast(long max_pl, double angular_precision, double* pWest const int cond1 = angleApproximatelyEqual(360 - inc, e - w, angular_precision); const int cond2 = (360 - inc < e - w); const int cond3 = (e != w); - const int cond4 = longitude_normalise(e,w)==w; /* e.normalise(w) == w */ - if ( cond1 || cond2 || (cond3 && cond4) ) { + const int cond4 = longitude_normalise(e, w) == w; /* e.normalise(w) == w */ + if (cond1 || cond2 || (cond3 && cond4)) { *pWest = 0; *pEast = 360 - inc; } @@ -281,24 +283,29 @@ static void correctWestEast(long max_pl, double angular_precision, double* pWest static int get_number_of_data_values(grib_handle* h, size_t* numDataValues) { - int err = 0; - long bpv=0, bitmapPresent=0; + int err = 0; + long bpv = 0, bitmapPresent = 0; size_t bitmapLength = 0; - if ( (err = grib_get_long(h, "bitsPerValue", &bpv)) ) return err; + if ((err = grib_get_long(h, "bitsPerValue", &bpv))) + return err; if (bpv != 0) { - if (grib_get_size(h, "values", numDataValues)==GRIB_SUCCESS) { + if (grib_get_size(h, "values", numDataValues) == GRIB_SUCCESS) { return GRIB_SUCCESS; } - } else { + } + else { /* Constant field (with or without bitmap) */ - if ( (err = grib_get_long(h,"bitmapPresent", &bitmapPresent)) ) return err; + if ((err = grib_get_long(h, "bitmapPresent", &bitmapPresent))) + return err; if (bitmapPresent) { - if ( (err = grib_get_size(h,"bitmap", &bitmapLength)) ) return err; + if ((err = grib_get_size(h, "bitmap", &bitmapLength))) + return err; *numDataValues = bitmapLength; return GRIB_SUCCESS; - } else { + } + else { err = GRIB_NO_VALUES; /* Cannot determine number of values */ } } @@ -306,267 +313,291 @@ static int get_number_of_data_values(grib_handle* h, size_t* numDataValues) return err; } -static int unpack_long_with_legacy_support(grib_accessor* a, long* val, size_t *len); -static int unpack_long_new(grib_accessor* a, long* val, size_t *len); +static int unpack_long_with_legacy_support(grib_accessor* a, long* val, size_t* len); +static int unpack_long_new(grib_accessor* a, long* val, size_t* len); -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - int ret=GRIB_SUCCESS; - long support_legacy=1; + int ret = GRIB_SUCCESS; + long support_legacy = 1; grib_accessor_number_of_points_gaussian* self = (grib_accessor_number_of_points_gaussian*)a; - grib_handle* h = grib_handle_of_accessor(a); + grib_handle* h = grib_handle_of_accessor(a); - if((ret = grib_get_long_internal(h, self->support_legacy,&support_legacy)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, self->support_legacy, &support_legacy)) != GRIB_SUCCESS) return ret; - if (support_legacy==1) return unpack_long_with_legacy_support(a, val, len); - else return unpack_long_new(a, val, len); + if (support_legacy == 1) + return unpack_long_with_legacy_support(a, val, len); + else + return unpack_long_new(a, val, len); } /* New algorithm */ -static int unpack_long_new(grib_accessor* a, long* val, size_t *len) +static int unpack_long_new(grib_accessor* a, long* val, size_t* len) { - int ret=GRIB_SUCCESS; + int ret = GRIB_SUCCESS; int is_global = 0; - long ni=0,nj=0,plpresent=0,order=0; - size_t plsize=0; - double* lats={0,}; - double lat_first,lat_last,lon_first,lon_last; - long* pl=NULL; - long* plsave=NULL; + long ni = 0, nj = 0, plpresent = 0, order = 0; + size_t plsize = 0; + double* lats = {0,}; + double lat_first, lat_last, lon_first, lon_last; + long* pl = NULL; + long* plsave = NULL; long row_count; - long ilon_first=0,ilon_last=0; - double angular_precision = 1.0/1000000.0; - long editionNumber = 0; - grib_handle* h = grib_handle_of_accessor(a); + long ilon_first = 0, ilon_last = 0; + double angular_precision = 1.0 / 1000000.0; + long editionNumber = 0; + grib_handle* h = grib_handle_of_accessor(a); grib_accessor_number_of_points_gaussian* self = (grib_accessor_number_of_points_gaussian*)a; - grib_context* c=a->context; + grib_context* c = a->context; - if((ret = grib_get_long_internal(h, self->ni,&ni)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, self->ni, &ni)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, self->nj,&nj)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, self->nj, &nj)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, self->plpresent,&plpresent)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, self->plpresent, &plpresent)) != GRIB_SUCCESS) return ret; - if (nj == 0) return GRIB_GEOCALCULUS_PROBLEM; + if (nj == 0) + return GRIB_GEOCALCULUS_PROBLEM; - if (grib_get_long(h, "editionNumber", &editionNumber)==GRIB_SUCCESS) { - if (editionNumber == 1) angular_precision = 1.0/1000; + if (grib_get_long(h, "editionNumber", &editionNumber) == GRIB_SUCCESS) { + if (editionNumber == 1) + angular_precision = 1.0 / 1000; } if (plpresent) { - long max_pl=0; - float d = 0; - int j=0; - double lon_first_row=0,lon_last_row=0; + long max_pl = 0; + float d = 0; + int j = 0; + double lon_first_row = 0, lon_last_row = 0; /*reduced*/ - if((ret = grib_get_long_internal(h, self->order,&order)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, self->order, &order)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_double_internal(h, self->lat_first,&lat_first)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(h, self->lat_first, &lat_first)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_double_internal(h, self->lon_first,&lon_first)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(h, self->lon_first, &lon_first)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_double_internal(h, self->lat_last,&lat_last)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(h, self->lat_last, &lat_last)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_double_internal(h, self->lon_last,&lon_last)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(h, self->lon_last, &lon_last)) != GRIB_SUCCESS) return ret; - lats=(double*)grib_context_malloc(a->context,sizeof(double)*order*2); - if((ret = grib_get_gaussian_latitudes(order, lats)) != GRIB_SUCCESS) + lats = (double*)grib_context_malloc(a->context, sizeof(double) * order * 2); + if ((ret = grib_get_gaussian_latitudes(order, lats)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_size(h,self->pl,&plsize)) != GRIB_SUCCESS) + if ((ret = grib_get_size(h, self->pl, &plsize)) != GRIB_SUCCESS) return ret; - pl=(long*)grib_context_malloc_clear(c,sizeof(long)*plsize); - plsave=pl; - grib_get_long_array_internal(h,self->pl,pl, &plsize); + pl = (long*)grib_context_malloc_clear(c, sizeof(long) * plsize); + plsave = pl; + grib_get_long_array_internal(h, self->pl, pl, &plsize); - if (lon_last<0) lon_last+=360; - if (lon_first<0) lon_first+=360; + if (lon_last < 0) + lon_last += 360; + if (lon_first < 0) + lon_first += 360; /* Find the maximum element of "pl" array, do not assume it's 4*N! */ /* This could be an Octahedral Gaussian Grid */ max_pl = pl[0]; - for (j=1; j max_pl) max_pl = pl[j]; + for (j = 1; j < plsize; j++) { + if (pl[j] > max_pl) + max_pl = pl[j]; } - d=fabs(lats[0]-lats[1]); + d = fabs(lats[0] - lats[1]); is_global = 0; /* ECC-445 */ correctWestEast(max_pl, angular_precision, &lon_first, &lon_last); - if ( !is_global ) { + if (!is_global) { /*sub area*/ (void)d; - *val=0; - for (j=0;jcontext; + grib_context* c = a->context; - if((ret = grib_get_long_internal(h, self->ni,&ni)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, self->ni, &ni)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, self->nj,&nj)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, self->nj, &nj)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, self->plpresent,&plpresent)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, self->plpresent, &plpresent)) != GRIB_SUCCESS) return ret; - if (nj == 0) return GRIB_GEOCALCULUS_PROBLEM; + if (nj == 0) + return GRIB_GEOCALCULUS_PROBLEM; - if (grib_get_long(h, "editionNumber", &editionNumber)==GRIB_SUCCESS) { - if (editionNumber == 1) angular_precision = 1.0/1000; + if (grib_get_long(h, "editionNumber", &editionNumber) == GRIB_SUCCESS) { + if (editionNumber == 1) + angular_precision = 1.0 / 1000; } if (plpresent) { - long max_pl=0; - float d = 0; - int j=0; - double lon_first_row=0,lon_last_row=0; + long max_pl = 0; + float d = 0; + int j = 0; + double lon_first_row = 0, lon_last_row = 0; /*reduced*/ - if((ret = grib_get_long_internal(h, self->order,&order)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, self->order, &order)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_double_internal(h, self->lat_first,&lat_first)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(h, self->lat_first, &lat_first)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_double_internal(h, self->lon_first,&lon_first)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(h, self->lon_first, &lon_first)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_double_internal(h, self->lat_last,&lat_last)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(h, self->lat_last, &lat_last)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_double_internal(h, self->lon_last,&lon_last)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(h, self->lon_last, &lon_last)) != GRIB_SUCCESS) return ret; - lats=(double*)grib_context_malloc(a->context,sizeof(double)*order*2); - if((ret = grib_get_gaussian_latitudes(order, lats)) != GRIB_SUCCESS) + lats = (double*)grib_context_malloc(a->context, sizeof(double) * order * 2); + if ((ret = grib_get_gaussian_latitudes(order, lats)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_size(h,self->pl,&plsize)) != GRIB_SUCCESS) + if ((ret = grib_get_size(h, self->pl, &plsize)) != GRIB_SUCCESS) return ret; - pl=(long*)grib_context_malloc_clear(c,sizeof(long)*plsize); - plsave=pl; - grib_get_long_array_internal(h,self->pl,pl, &plsize); + pl = (long*)grib_context_malloc_clear(c, sizeof(long) * plsize); + plsave = pl; + grib_get_long_array_internal(h, self->pl, pl, &plsize); - if (lon_last<0) lon_last+=360; - if (lon_first<0) lon_first+=360; + if (lon_last < 0) + lon_last += 360; + if (lon_first < 0) + lon_first += 360; /* Find the maximum element of "pl" array, do not assume it's 4*N! */ /* This could be an Octahedral Gaussian Grid */ max_pl = pl[0]; - for (j=1; j max_pl) max_pl = pl[j]; + for (j = 1; j < plsize; j++) { + if (pl[j] > max_pl) + max_pl = pl[j]; } /*is_global=is_gaussian_global(lat_first,lat_last,lon_first,lon_last,max_pl,lats,angular_precision);*/ - d=fabs(lats[0]-lats[1]); + d = fabs(lats[0] - lats[1]); is_global = 0; /* ECC-445 */ correctWestEast(max_pl, angular_precision, &lon_first, &lon_last); - if ( !is_global ) { + if (!is_global) { /*sub area*/ (void)d; #if EFDEBUG - printf("-------- subarea fabs(lat_first-lats[0])=%g d=%g\n",fabs(lat_first-lats[0]),d); - printf("-------- subarea fabs(lat_last+lats[0])=%g d=%g\n",fabs(lat_last+lats[0]),d); + printf("-------- subarea fabs(lat_first-lats[0])=%g d=%g\n", fabs(lat_first - lats[0]), d); + printf("-------- subarea fabs(lat_last+lats[0])=%g d=%g\n", fabs(lat_last + lats[0]), d); printf("-------- subarea lon_last=%g order=%ld 360.0-90.0/order=%g\n", - lon_last,order,360.0-90.0/order); + lon_last, order, 360.0 - 90.0 / order); printf("-------- subarea lon_first=%g fabs(lon_last -( 360.0-90.0/order))=%g 90.0/order=%g\n", - lon_first,fabs(lon_last - (360.0-90.0/order)),90.0/order); + lon_first, fabs(lon_last - (360.0 - 90.0 / order)), 90.0 / order); #endif - *val=0; - for (j=0;jcontext->debug) - fprintf(stderr, "ECCODES DEBUG number_of_points_gaussian: LEGACY MODE activated. " - "Count(=%ld) changed to num values(=%ld)\n",*val,(long)numDataValues); + fprintf(stderr, + "ECCODES DEBUG number_of_points_gaussian: LEGACY MODE activated. " + "Count(=%ld) changed to num values(=%ld)\n", + *val, (long)numDataValues); *val = numDataValues; } } diff --git a/src/grib_accessor_class_number_of_values.c b/src/grib_accessor_class_number_of_values.c index 352f6421a..177db5b04 100644 --- a/src/grib_accessor_class_number_of_values.c +++ b/src/grib_accessor_class_number_of_values.c @@ -40,66 +40,67 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_long(grib_accessor*, long* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_number_of_values { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in number_of_values */ - const char* values; - const char* bitsPerValue; - const char* numberOfPoints; - const char* bitmapPresent; - const char* bitmap; - const char* numberOfCodedValues; +typedef struct grib_accessor_number_of_values +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in number_of_values */ + const char* values; + const char* bitsPerValue; + const char* numberOfPoints; + const char* bitmapPresent; + const char* bitmap; + const char* numberOfCodedValues; } grib_accessor_number_of_values; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_number_of_values = { - &grib_accessor_class_long, /* super */ - "number_of_values", /* name */ - sizeof(grib_accessor_number_of_values), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "number_of_values", /* name */ + sizeof(grib_accessor_number_of_values), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -108,87 +109,88 @@ grib_accessor_class* grib_accessor_class_number_of_values = &_grib_accessor_clas static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { - int n=0; + int n = 0; grib_accessor_number_of_values* self = (grib_accessor_number_of_values*)a; - grib_handle* hand = grib_handle_of_accessor(a); + grib_handle* hand = grib_handle_of_accessor(a); - self->values = grib_arguments_get_name(hand,c,n++); - self->bitsPerValue = grib_arguments_get_name(hand,c,n++); - self->numberOfPoints = grib_arguments_get_name(hand,c,n++); - self->bitmapPresent = grib_arguments_get_name(hand,c,n++); - self->bitmap = grib_arguments_get_name(hand,c,n++); - self->numberOfCodedValues = grib_arguments_get_name(hand,c,n++); - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + self->values = grib_arguments_get_name(hand, c, n++); + self->bitsPerValue = grib_arguments_get_name(hand, c, n++); + self->numberOfPoints = grib_arguments_get_name(hand, c, n++); + self->bitmapPresent = grib_arguments_get_name(hand, c, n++); + self->bitmap = grib_arguments_get_name(hand, c, n++); + self->numberOfCodedValues = grib_arguments_get_name(hand, c, n++); + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->length=0; + a->length = 0; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_number_of_values* self = (grib_accessor_number_of_values*)a; - int ret=GRIB_SUCCESS,i; - long npoints=0,bitmap_present=0; - size_t size=0; + int ret = GRIB_SUCCESS, i; + long npoints = 0, bitmap_present = 0; + size_t size = 0; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints,&npoints)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints, &npoints)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->bitmapPresent,&bitmap_present)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->bitmapPresent, &bitmap_present)) != GRIB_SUCCESS) return ret; if (bitmap_present) { double* bitmap; - size=npoints; - bitmap=(double*)grib_context_malloc(a->context,sizeof(double)*size); - if((ret = grib_get_double_array_internal(grib_handle_of_accessor(a),self->bitmap,bitmap,&size)) - != GRIB_SUCCESS) { - grib_context_free(a->context,bitmap); + size = npoints; + bitmap = (double*)grib_context_malloc(a->context, sizeof(double) * size); + if ((ret = grib_get_double_array_internal(grib_handle_of_accessor(a), self->bitmap, bitmap, &size)) != GRIB_SUCCESS) { + grib_context_free(a->context, bitmap); return ret; } - *val=0; - for (i=0;icontext,bitmap); - } else { - *val=npoints; + grib_context_free(a->context, bitmap); + } + else { + *val = npoints; } return ret; diff --git a/src/grib_accessor_class_number_of_values_data_raw_packing.c b/src/grib_accessor_class_number_of_values_data_raw_packing.c index f75656c97..2bb8d8968 100644 --- a/src/grib_accessor_class_number_of_values_data_raw_packing.c +++ b/src/grib_accessor_class_number_of_values_data_raw_packing.c @@ -12,14 +12,14 @@ ****************************/ #include "grib_api_internal.h" -#define PRECISION_32_IEEE 1 -#define PRECISION_64_IEEE 2 +#define PRECISION_32_IEEE 1 +#define PRECISION_64_IEEE 2 #define PRECISION_128_IEEE 3 -#define COMPRESSION_NONE 0 -#define COMPRESSION_LZW 1 +#define COMPRESSION_NONE 0 +#define COMPRESSION_LZW 1 -#define PRE_PROCESSING_NONE 0 +#define PRE_PROCESSING_NONE 0 #define PRE_PROCESSING_DIFFERENCE 1 /* This is used by make_class.pl @@ -45,61 +45,62 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_long(grib_accessor*, long* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_number_of_values_data_raw_packing { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in number_of_values_data_raw_packing */ - const char* values; - const char* precision; +typedef struct grib_accessor_number_of_values_data_raw_packing +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in number_of_values_data_raw_packing */ + const char* values; + const char* precision; } grib_accessor_number_of_values_data_raw_packing; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_number_of_values_data_raw_packing = { - &grib_accessor_class_gen, /* super */ - "number_of_values_data_raw_packing", /* name */ - sizeof(grib_accessor_number_of_values_data_raw_packing), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "number_of_values_data_raw_packing", /* name */ + sizeof(grib_accessor_number_of_values_data_raw_packing), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -108,82 +109,80 @@ grib_accessor_class* grib_accessor_class_number_of_values_data_raw_packing = &_g static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long v, grib_arguments* args) +static void init(grib_accessor* a, const long v, grib_arguments* args) { - int n=0; - grib_accessor_number_of_values_data_raw_packing *self =(grib_accessor_number_of_values_data_raw_packing*)a; + int n = 0; + grib_accessor_number_of_values_data_raw_packing* self = (grib_accessor_number_of_values_data_raw_packing*)a; - self->values = grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->precision = grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); + self->values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->precision = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->length=0; + a->length = 0; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - int err=0; - grib_accessor_number_of_values_data_raw_packing *self =(grib_accessor_number_of_values_data_raw_packing*)a; - grib_accessor* adata=NULL; - long precision = 0; - int bytes=0; - long byte_count =0; - - adata=grib_find_accessor(grib_handle_of_accessor(a),self->values); - Assert(adata!=NULL); - byte_count=grib_byte_count(adata); - - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->precision,&precision)) - != GRIB_SUCCESS) + int err = 0; + grib_accessor_number_of_values_data_raw_packing* self = (grib_accessor_number_of_values_data_raw_packing*)a; + grib_accessor* adata = NULL; + long precision = 0; + int bytes = 0; + long byte_count = 0; + + adata = grib_find_accessor(grib_handle_of_accessor(a), self->values); + Assert(adata != NULL); + byte_count = grib_byte_count(adata); + + if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->precision, &precision)) != GRIB_SUCCESS) return err; - switch(precision) - { - case 1: - bytes = 4; - break; + switch (precision) { + case 1: + bytes = 4; + break; - case 2: - bytes = 8; - break; + case 2: + bytes = 8; + break; - default: - return GRIB_NOT_IMPLEMENTED; - break; + default: + return GRIB_NOT_IMPLEMENTED; + break; } *val = byte_count / bytes; diff --git a/src/grib_accessor_class_octahedral_gaussian.c b/src/grib_accessor_class_octahedral_gaussian.c index 943504cf1..3f186583e 100644 --- a/src/grib_accessor_class_octahedral_gaussian.c +++ b/src/grib_accessor_class_octahedral_gaussian.c @@ -37,65 +37,66 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_octahedral_gaussian { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in octahedral_gaussian */ - const char* N; - const char* Ni; - const char* plpresent; - const char* pl; +typedef struct grib_accessor_octahedral_gaussian +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in octahedral_gaussian */ + const char* N; + const char* Ni; + const char* plpresent; + const char* pl; } grib_accessor_octahedral_gaussian; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_octahedral_gaussian = { - &grib_accessor_class_long, /* super */ - "octahedral_gaussian", /* name */ - sizeof(grib_accessor_octahedral_gaussian), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "octahedral_gaussian", /* name */ + sizeof(grib_accessor_octahedral_gaussian), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -104,50 +105,50 @@ grib_accessor_class* grib_accessor_class_octahedral_gaussian = &_grib_accessor_c static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_octahedral_gaussian* self = (grib_accessor_octahedral_gaussian*)a; - int n = 0; - grib_handle* hand = grib_handle_of_accessor(a); + int n = 0; + grib_handle* hand = grib_handle_of_accessor(a); - self->N = grib_arguments_get_name(hand,c,n++); - self->Ni = grib_arguments_get_name(hand,c,n++); - self->plpresent = grib_arguments_get_name(hand,c,n++); - self->pl = grib_arguments_get_name(hand,c,n++); + self->N = grib_arguments_get_name(hand, c, n++); + self->Ni = grib_arguments_get_name(hand, c, n++); + self->plpresent = grib_arguments_get_name(hand, c, n++); + self->pl = grib_arguments_get_name(hand, c, n++); } /* Returns 1 (=true) if input pl array is Octahedral, 0 otherwise. @@ -163,26 +164,27 @@ static int is_pl_octahedral(const long pl[], size_t size) { long i; long prev_diff = -1; - for(i=1; icontext; + grib_context* c = a->context; - if((ret = grib_get_long_internal(hand, self->Ni,&Ni)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(hand, self->Ni, &Ni)) != GRIB_SUCCESS) return ret; /* If Ni is not missing, then this is a plain gaussian grid and not reduced. */ /* So it cannot be an octahedral grid */ if (Ni != GRIB_MISSING_LONG) { - *val=0; + *val = 0; return GRIB_SUCCESS; } - if((ret = grib_get_long_internal(hand, self->plpresent,&plpresent)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(hand, self->plpresent, &plpresent)) != GRIB_SUCCESS) return ret; if (!plpresent) { *val = 0; /* Not octahedral */ return GRIB_SUCCESS; } - if((ret = grib_get_size(hand,self->pl,&plsize)) != GRIB_SUCCESS) + if ((ret = grib_get_size(hand, self->pl, &plsize)) != GRIB_SUCCESS) return ret; Assert(plsize); /* pl array must have at least one element */ - pl=(long*)grib_context_malloc_clear(c,sizeof(long)*plsize); + pl = (long*)grib_context_malloc_clear(c, sizeof(long) * plsize); if (!pl) { return GRIB_OUT_OF_MEMORY; } - if ((ret = grib_get_long_array_internal(hand,self->pl,pl, &plsize)) != GRIB_SUCCESS) + if ((ret = grib_get_long_array_internal(hand, self->pl, pl, &plsize)) != GRIB_SUCCESS) return ret; /* pl[0] is guaranteed to exist. Have already asserted previously */ @@ -239,7 +241,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) return ret; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { return GRIB_NOT_IMPLEMENTED; } diff --git a/src/grib_accessor_class_octect_number.c b/src/grib_accessor_class_octect_number.c index 817d18b11..e11047248 100644 --- a/src/grib_accessor_class_octect_number.c +++ b/src/grib_accessor_class_octect_number.c @@ -37,63 +37,64 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_octect_number { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in octect_number */ - const char* left; - long right; +typedef struct grib_accessor_octect_number +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in octect_number */ + const char* left; + long right; } grib_accessor_octect_number; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_octect_number = { - &grib_accessor_class_long, /* super */ - "octect_number", /* name */ - sizeof(grib_accessor_octect_number), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "octect_number", /* name */ + sizeof(grib_accessor_octect_number), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -102,71 +103,71 @@ grib_accessor_class* grib_accessor_class_octect_number = &_grib_accessor_class_o static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_octect_number* self = (grib_accessor_octect_number*)a; - int n = 0; + int n = 0; - self->left = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->right = grib_arguments_get_long(grib_handle_of_accessor(a),c,n++); + self->left = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->right = grib_arguments_get_long(grib_handle_of_accessor(a), c, n++); - a->length=0; + a->length = 0; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_octect_number* self = (grib_accessor_octect_number*)a; - int ret = 0; + int ret = 0; long offset; - offset=a->offset+self->right; + offset = a->offset + self->right; /*printf("-------- setting %s to %ld\n", self->left,offset);*/ - if((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->left,offset)) != GRIB_SUCCESS) + if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->left, offset)) != GRIB_SUCCESS) return ret; *val = offset; - *len =1; + *len = 1; return ret; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { return 0; } diff --git a/src/grib_accessor_class_offset_file.c b/src/grib_accessor_class_offset_file.c index 81aedd4e5..069430065 100644 --- a/src/grib_accessor_class_offset_file.c +++ b/src/grib_accessor_class_offset_file.c @@ -35,61 +35,62 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_offset_file { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in double */ -/* Members defined in offset_file */ +typedef struct grib_accessor_offset_file +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in double */ + /* Members defined in offset_file */ } grib_accessor_offset_file; extern grib_accessor_class* grib_accessor_class_double; static grib_accessor_class _grib_accessor_class_offset_file = { - &grib_accessor_class_double, /* super */ - "offset_file", /* name */ - sizeof(grib_accessor_offset_file), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_double, /* super */ + "offset_file", /* name */ + sizeof(grib_accessor_offset_file), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -98,75 +99,75 @@ grib_accessor_class* grib_accessor_class_offset_file = &_grib_accessor_class_off static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->pack_string = (*(c->super))->pack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->pack_string = (*(c->super))->pack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->length=0; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->length = 0; } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { *val = (double)grib_handle_of_accessor(a)->offset; - *len =1; + *len = 1; return 0; } -static int unpack_string(grib_accessor*a , char* v, size_t *len) +static int unpack_string(grib_accessor* a, char* v, size_t* len) { double val = 0; - size_t l = 1; + size_t l = 1; char repres[1024]; - grib_unpack_double (a , &val, &l); + grib_unpack_double(a, &val, &l); - sprintf(repres,"%.0f", val); + sprintf(repres, "%.0f", val); - l = strlen(repres)+1; + l = strlen(repres) + 1; - if(l >*len ){ - grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_long : unpack_string : Buffer too small for %s ", a->name ); + if (l > *len) { + grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_long : unpack_string : Buffer too small for %s ", a->name); *len = l; return GRIB_BUFFER_TOO_SMALL; } - grib_context_log(a->context,GRIB_LOG_DEBUG, "grib_accessor_long: Casting double %s to string ", a->name); + grib_context_log(a->context, GRIB_LOG_DEBUG, "grib_accessor_long: Casting double %s to string ", a->name); *len = l; - strcpy(v,repres); + strcpy(v, repres); return GRIB_SUCCESS; } diff --git a/src/grib_accessor_class_offset_values.c b/src/grib_accessor_class_offset_values.c index 08ed22e75..56df8696c 100644 --- a/src/grib_accessor_class_offset_values.c +++ b/src/grib_accessor_class_offset_values.c @@ -36,63 +36,64 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_offset_values { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in double */ -/* Members defined in offset_values */ - const char* values; - const char* missingValue; +typedef struct grib_accessor_offset_values +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in double */ + /* Members defined in offset_values */ + const char* values; + const char* missingValue; } grib_accessor_offset_values; extern grib_accessor_class* grib_accessor_class_double; static grib_accessor_class _grib_accessor_class_offset_values = { - &grib_accessor_class_double, /* super */ - "offset_values", /* name */ - sizeof(grib_accessor_offset_values), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_double, /* super */ + "offset_values", /* name */ + sizeof(grib_accessor_offset_values), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -101,99 +102,105 @@ grib_accessor_class* grib_accessor_class_offset_values = &_grib_accessor_class_o static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* args) +static void init(grib_accessor* a, const long l, grib_arguments* args) { - int n=0; - grib_accessor_offset_values* self= (grib_accessor_offset_values*)a; - self->values=grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->missingValue=grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); + int n = 0; + grib_accessor_offset_values* self = (grib_accessor_offset_values*)a; + self->values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->missingValue = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; - a->length=0; + a->length = 0; } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - int ret=0; - *val=0; - *len =1; + int ret = 0; + *val = 0; + *len = 1; return ret; } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { - double* values=NULL; - size_t size=0; - double missingValue=0; + double* values = NULL; + size_t size = 0; + double missingValue = 0; long missingValuesPresent = 0; - int ret=0,i=0; - grib_accessor_offset_values* self= (grib_accessor_offset_values*)a; - grib_context* c=a->context; - grib_handle* h=grib_handle_of_accessor(a); + int ret = 0, i = 0; + grib_accessor_offset_values* self = (grib_accessor_offset_values*)a; + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); - if (*val==0) return GRIB_SUCCESS; + if (*val == 0) + return GRIB_SUCCESS; - if((ret = grib_get_double_internal(h,self->missingValue,&missingValue)) != GRIB_SUCCESS) { + if ((ret = grib_get_double_internal(h, self->missingValue, &missingValue)) != GRIB_SUCCESS) { return ret; } - if((ret=grib_get_long_internal(h,"missingValuesPresent",&missingValuesPresent)) != GRIB_SUCCESS) { + if ((ret = grib_get_long_internal(h, "missingValuesPresent", &missingValuesPresent)) != GRIB_SUCCESS) { return ret; } - if ( (ret=grib_get_size(h,self->values,&size)) != GRIB_SUCCESS) return ret; + if ((ret = grib_get_size(h, self->values, &size)) != GRIB_SUCCESS) + return ret; - values=(double*)grib_context_malloc(c,size*sizeof(double)); - if (!values) return GRIB_OUT_OF_MEMORY; + values = (double*)grib_context_malloc(c, size * sizeof(double)); + if (!values) + return GRIB_OUT_OF_MEMORY; - if((ret = grib_get_double_array_internal(h,self->values,values,&size)) != GRIB_SUCCESS) { - grib_context_free(c,values); + if ((ret = grib_get_double_array_internal(h, self->values, values, &size)) != GRIB_SUCCESS) { + grib_context_free(c, values); return ret; } - for (i=0;ivalues,values,size)) != GRIB_SUCCESS) return ret; + if ((ret = grib_set_double_array_internal(h, self->values, values, size)) != GRIB_SUCCESS) + return ret; - grib_context_free(c,values); + grib_context_free(c, values); return GRIB_SUCCESS; } diff --git a/src/grib_accessor_class_pack_bufr_values.c b/src/grib_accessor_class_pack_bufr_values.c index d77cc61e7..932b0f3b6 100644 --- a/src/grib_accessor_class_pack_bufr_values.c +++ b/src/grib_accessor_class_pack_bufr_values.c @@ -36,69 +36,70 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); -static int unpack_string_array (grib_accessor*, char**, size_t *len); -static int value_count(grib_accessor*,long*); -static void destroy(grib_context*,grib_accessor*); +static int get_native_type(grib_accessor*); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); +static int unpack_string_array(grib_accessor*, char**, size_t* len); +static int value_count(grib_accessor*, long*); +static void destroy(grib_context*, grib_accessor*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_pack_bufr_values { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in pack_bufr_values */ - grib_accessor* data_accessor; +typedef struct grib_accessor_pack_bufr_values +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in pack_bufr_values */ + grib_accessor* data_accessor; } grib_accessor_pack_bufr_values; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_pack_bufr_values = { - &grib_accessor_class_gen, /* super */ - "pack_bufr_values", /* name */ - sizeof(grib_accessor_pack_bufr_values), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - &unpack_string_array, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "pack_bufr_values", /* name */ + sizeof(grib_accessor_pack_bufr_values), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + &destroy, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + &unpack_string_array, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -107,29 +108,29 @@ grib_accessor_class* grib_accessor_class_pack_bufr_values = &_grib_accessor_clas static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_string = (*(c->super))->pack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_string = (*(c->super))->pack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ @@ -138,8 +139,8 @@ static void init(grib_accessor* a, const long len, grib_arguments* params) { char* key; grib_accessor_pack_bufr_values* self = (grib_accessor_pack_bufr_values*)a; - key = (char*)grib_arguments_get_name(grib_handle_of_accessor(a),params,0); - self->data_accessor=grib_find_accessor(grib_handle_of_accessor(a),key); + key = (char*)grib_arguments_get_name(grib_handle_of_accessor(a), params, 0); + self->data_accessor = grib_find_accessor(grib_handle_of_accessor(a), key); a->length = 0; } @@ -148,33 +149,33 @@ static void dump(grib_accessor* a, grib_dumper* dumper) { } -static int unpack_string_array(grib_accessor* a, char** buffer, size_t *len) +static int unpack_string_array(grib_accessor* a, char** buffer, size_t* len) { return GRIB_NOT_IMPLEMENTED; } -static int unpack_string(grib_accessor* a, char* buffer, size_t *len) +static int unpack_string(grib_accessor* a, char* buffer, size_t* len) { return GRIB_NOT_IMPLEMENTED; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { return GRIB_NOT_IMPLEMENTED; } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { return GRIB_NOT_IMPLEMENTED; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - *count=1; + *count = 1; return 0; } -static void destroy(grib_context* context,grib_accessor* a) +static void destroy(grib_context* context, grib_accessor* a) { } @@ -183,18 +184,18 @@ static int get_native_type(grib_accessor* a) return GRIB_TYPE_LONG; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { grib_accessor_pack_bufr_values* self = (grib_accessor_pack_bufr_values*)a; - grib_accessor* data=(grib_accessor*)self->data_accessor; + grib_accessor* data = (grib_accessor*)self->data_accessor; - return grib_pack_double(data,0,0); + return grib_pack_double(data, 0, 0); } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { grib_accessor_pack_bufr_values* self = (grib_accessor_pack_bufr_values*)a; - grib_accessor* data=(grib_accessor*)self->data_accessor; + grib_accessor* data = (grib_accessor*)self->data_accessor; - return grib_pack_double(data,0,0); + return grib_pack_double(data, 0, 0); } diff --git a/src/grib_accessor_class_pad.c b/src/grib_accessor_class_pad.c index 3ac7299d2..8171787df 100644 --- a/src/grib_accessor_class_pad.c +++ b/src/grib_accessor_class_pad.c @@ -36,62 +36,63 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -static size_t preferred_size(grib_accessor*,int); - -typedef struct grib_accessor_pad { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in bytes */ -/* Members defined in padding */ -/* Members defined in pad */ - grib_expression* expression; +static size_t preferred_size(grib_accessor*, int); + +typedef struct grib_accessor_pad +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in bytes */ + /* Members defined in padding */ + /* Members defined in pad */ + grib_expression* expression; } grib_accessor_pad; extern grib_accessor_class* grib_accessor_class_padding; static grib_accessor_class _grib_accessor_class_pad = { - &grib_accessor_class_padding, /* super */ - "pad", /* name */ - sizeof(grib_accessor_pad), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - &preferred_size, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_padding, /* super */ + "pad", /* name */ + sizeof(grib_accessor_pad), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + &preferred_size, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -100,59 +101,58 @@ grib_accessor_class* grib_accessor_class_pad = &_grib_accessor_class_pad; static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static size_t preferred_size(grib_accessor* a,int from_handle) +static size_t preferred_size(grib_accessor* a, int from_handle) { - grib_accessor_pad* self = (grib_accessor_pad*)a; + grib_accessor_pad* self = (grib_accessor_pad*)a; - long length = 0; + long length = 0; - grib_expression_evaluate_long(grib_handle_of_accessor(a),self->expression,&length); + grib_expression_evaluate_long(grib_handle_of_accessor(a), self->expression, &length); - return length > 0 ? length : 0; + return length > 0 ? length : 0; } -static void init(grib_accessor* a, const long len, grib_arguments*arg ) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { - grib_accessor_pad* self = (grib_accessor_pad*)a; + grib_accessor_pad* self = (grib_accessor_pad*)a; - self->expression = grib_arguments_get_expression(grib_handle_of_accessor(a), arg,0); - a->length = preferred_size(a,1); + self->expression = grib_arguments_get_expression(grib_handle_of_accessor(a), arg, 0); + a->length = preferred_size(a, 1); } - diff --git a/src/grib_accessor_class_padding.c b/src/grib_accessor_class_padding.c index e391fbed2..6495ea194 100644 --- a/src/grib_accessor_class_padding.c +++ b/src/grib_accessor_class_padding.c @@ -37,63 +37,64 @@ or edit "accessor.class" and rerun ./make_class.pl static size_t string_length(grib_accessor*); static long byte_count(grib_accessor*); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -static void update_size(grib_accessor*,size_t); -static void resize(grib_accessor*,size_t); +static void update_size(grib_accessor*, size_t); +static void resize(grib_accessor*, size_t); static int compare(grib_accessor*, grib_accessor*); -typedef struct grib_accessor_padding { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in bytes */ -/* Members defined in padding */ +typedef struct grib_accessor_padding +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in bytes */ + /* Members defined in padding */ } grib_accessor_padding; extern grib_accessor_class* grib_accessor_class_bytes; static grib_accessor_class _grib_accessor_class_padding = { - &grib_accessor_class_bytes, /* super */ - "padding", /* name */ - sizeof(grib_accessor_padding), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - &string_length, /* get length of string */ - &value_count, /* get number of values */ - &byte_count, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - &update_size, /* update_size */ - 0, /* preferred_size */ - &resize, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_bytes, /* super */ + "padding", /* name */ + sizeof(grib_accessor_padding), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + &string_length, /* get length of string */ + &value_count, /* get number of values */ + &byte_count, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + &update_size, /* update_size */ + 0, /* preferred_size */ + &resize, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + &compare, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -102,37 +103,37 @@ grib_accessor_class* grib_accessor_class_padding = &_grib_accessor_class_padding static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->preferred_size = (*(c->super))->preferred_size; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->preferred_size = (*(c->super))->preferred_size; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len, grib_arguments*arg ) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; @@ -140,26 +141,37 @@ static void init(grib_accessor* a, const long len, grib_arguments*arg ) static int compare(grib_accessor* a, grib_accessor* b) { - if (a->length != b->length) return GRIB_COUNT_MISMATCH; + if (a->length != b->length) + return GRIB_COUNT_MISMATCH; return GRIB_SUCCESS; } -static void update_size(grib_accessor* a,size_t new_size) +static void update_size(grib_accessor* a, size_t new_size) { /* printf("update_size: grib_accessor_class_padding.c %ld %ld %s %s\n", (long)new_size,(long)a->length,a->cclass->name,a->name); */ a->length = new_size; } -static void resize(grib_accessor* a,size_t new_size) +static void resize(grib_accessor* a, size_t new_size) { - void* zero = grib_context_malloc_clear(a->context,new_size); + void* zero = grib_context_malloc_clear(a->context, new_size); - grib_buffer_replace(a,(const unsigned char*)zero,new_size,1,0); - grib_context_free(a->context,zero); - grib_context_log(a->context,GRIB_LOG_DEBUG,"resize: grib_accessor_class_padding.c %ld %ld %s %s\n",(long)new_size,(long)a->length,a->cclass->name,a->name); + grib_buffer_replace(a, (const unsigned char*)zero, new_size, 1, 0); + grib_context_free(a->context, zero); + grib_context_log(a->context, GRIB_LOG_DEBUG, "resize: grib_accessor_class_padding.c %ld %ld %s %s\n", (long)new_size, (long)a->length, a->cclass->name, a->name); Assert(new_size == a->length); } -static int value_count(grib_accessor* a,long *c){ *c=a->length; return 0;} -static long byte_count(grib_accessor* a){ return a->length;} -static size_t string_length(grib_accessor* a){ return (size_t)a->length;} +static int value_count(grib_accessor* a, long* c) +{ + *c = a->length; + return 0; +} +static long byte_count(grib_accessor* a) +{ + return a->length; +} +static size_t string_length(grib_accessor* a) +{ + return (size_t)a->length; +} diff --git a/src/grib_accessor_class_padto.c b/src/grib_accessor_class_padto.c index 106e88182..e7d539459 100644 --- a/src/grib_accessor_class_padto.c +++ b/src/grib_accessor_class_padto.c @@ -36,62 +36,63 @@ or edit "accessor.class" and rerun ./make_class.pl */ static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -static size_t preferred_size(grib_accessor*,int); - -typedef struct grib_accessor_padto { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in bytes */ -/* Members defined in padding */ -/* Members defined in padto */ - grib_expression* expression; +static size_t preferred_size(grib_accessor*, int); + +typedef struct grib_accessor_padto +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in bytes */ + /* Members defined in padding */ + /* Members defined in padto */ + grib_expression* expression; } grib_accessor_padto; extern grib_accessor_class* grib_accessor_class_padding; static grib_accessor_class _grib_accessor_class_padto = { - &grib_accessor_class_padding, /* super */ + &grib_accessor_class_padding, /* super */ "padto", /* name */ sizeof(grib_accessor_padto), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - &preferred_size, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + &preferred_size, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -100,68 +101,67 @@ grib_accessor_class* grib_accessor_class_padto = &_grib_accessor_class_padto; static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static size_t preferred_size(grib_accessor* a,int from_handle) +static size_t preferred_size(grib_accessor* a, int from_handle) { - grib_accessor_padto* self = (grib_accessor_padto*)a; + grib_accessor_padto* self = (grib_accessor_padto*)a; - long length=0; - long theEnd; + long length = 0; + long theEnd; - grib_expression_evaluate_long(grib_handle_of_accessor(a),self->expression,&theEnd); + grib_expression_evaluate_long(grib_handle_of_accessor(a), self->expression, &theEnd); - length = theEnd - a->offset; + length = theEnd - a->offset; - /* printf("preferred_size: prefered: %ld current:%ld %s %s %ld\n", (long)length,(long)a->length,a->cclass->name,a->name,(long)a->offset); */ + /* printf("preferred_size: prefered: %ld current:%ld %s %s %ld\n", (long)length,(long)a->length,a->cclass->name,a->name,(long)a->offset); */ - return length > 0 ? length : 0; + return length > 0 ? length : 0; } -static void init(grib_accessor* a, const long len, grib_arguments*arg ) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { - grib_accessor_padto* self = (grib_accessor_padto*)a; + grib_accessor_padto* self = (grib_accessor_padto*)a; - self->expression = grib_arguments_get_expression(grib_handle_of_accessor(a), arg,0); - a->length = preferred_size(a,1); + self->expression = grib_arguments_get_expression(grib_handle_of_accessor(a), arg, 0); + a->length = preferred_size(a, 1); } static void dump(grib_accessor* a, grib_dumper* dumper) { - /*grib_dump_string(dumper,a,NULL);*/ + /*grib_dump_string(dumper,a,NULL);*/ } - diff --git a/src/grib_accessor_class_padtoeven.c b/src/grib_accessor_class_padtoeven.c index ddcb97840..304bf7e9e 100644 --- a/src/grib_accessor_class_padtoeven.c +++ b/src/grib_accessor_class_padtoeven.c @@ -37,63 +37,64 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -static size_t preferred_size(grib_accessor*,int); - -typedef struct grib_accessor_padtoeven { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in bytes */ -/* Members defined in padding */ -/* Members defined in padtoeven */ - const char* section_offset; - const char* section_length; +static size_t preferred_size(grib_accessor*, int); + +typedef struct grib_accessor_padtoeven +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in bytes */ + /* Members defined in padding */ + /* Members defined in padtoeven */ + const char* section_offset; + const char* section_length; } grib_accessor_padtoeven; extern grib_accessor_class* grib_accessor_class_padding; static grib_accessor_class _grib_accessor_class_padtoeven = { - &grib_accessor_class_padding, /* super */ - "padtoeven", /* name */ - sizeof(grib_accessor_padtoeven), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - &preferred_size, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_padding, /* super */ + "padtoeven", /* name */ + sizeof(grib_accessor_padtoeven), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + &preferred_size, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -102,63 +103,62 @@ grib_accessor_class* grib_accessor_class_padtoeven = &_grib_accessor_class_padto static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static size_t preferred_size(grib_accessor* a,int from_handle) +static size_t preferred_size(grib_accessor* a, int from_handle) { grib_accessor_padtoeven* self = (grib_accessor_padtoeven*)a; - long offset = 0; - long length = 0; + long offset = 0; + long length = 0; long seclen; - grib_get_long_internal(grib_handle_of_accessor(a),self->section_offset,&offset); - grib_get_long_internal(grib_handle_of_accessor(a),self->section_length,&length); + grib_get_long_internal(grib_handle_of_accessor(a), self->section_offset, &offset); + grib_get_long_internal(grib_handle_of_accessor(a), self->section_length, &length); - if((length%2) && from_handle) { + if ((length % 2) && from_handle) { #if 0 grib_context_log(a->context, GRIB_LOG_ERROR,"GRIB message has an odd length section (%ld, %s)", (long)length,a->name); #endif return 0; - } /* printf("EVEN %ld %ld\n",(long) a->offset,(long) offset);*/ - seclen = a->offset - offset; + seclen = a->offset - offset; return seclen % 2 ? 1 : 0; } @@ -167,8 +167,8 @@ static void init(grib_accessor* a, const long len, grib_arguments* args) { grib_accessor_padtoeven* self = (grib_accessor_padtoeven*)a; - self->section_offset = grib_arguments_get_name(grib_handle_of_accessor(a),args,0); - self->section_length = grib_arguments_get_name(grib_handle_of_accessor(a),args,1); + self->section_offset = grib_arguments_get_name(grib_handle_of_accessor(a), args, 0); + self->section_length = grib_arguments_get_name(grib_handle_of_accessor(a), args, 1); - a->length = preferred_size(a,1); + a->length = preferred_size(a, 1); } diff --git a/src/grib_accessor_class_padtomultiple.c b/src/grib_accessor_class_padtomultiple.c index 0cecb813f..8f63d2866 100644 --- a/src/grib_accessor_class_padtomultiple.c +++ b/src/grib_accessor_class_padtomultiple.c @@ -37,63 +37,64 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -static size_t preferred_size(grib_accessor*,int); - -typedef struct grib_accessor_padtomultiple { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in bytes */ -/* Members defined in padding */ -/* Members defined in padtomultiple */ - grib_expression* begin; - grib_expression* multiple; +static size_t preferred_size(grib_accessor*, int); + +typedef struct grib_accessor_padtomultiple +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in bytes */ + /* Members defined in padding */ + /* Members defined in padtomultiple */ + grib_expression* begin; + grib_expression* multiple; } grib_accessor_padtomultiple; extern grib_accessor_class* grib_accessor_class_padding; static grib_accessor_class _grib_accessor_class_padtomultiple = { - &grib_accessor_class_padding, /* super */ - "padtomultiple", /* name */ - sizeof(grib_accessor_padtomultiple), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - &preferred_size, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_padding, /* super */ + "padtomultiple", /* name */ + sizeof(grib_accessor_padtomultiple), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + &preferred_size, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -102,63 +103,62 @@ grib_accessor_class* grib_accessor_class_padtomultiple = &_grib_accessor_class_p static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static size_t preferred_size(grib_accessor* a,int from_handle) +static size_t preferred_size(grib_accessor* a, int from_handle) { - grib_accessor_padtomultiple* self = (grib_accessor_padtomultiple*)a; - long padding=0; - long begin = 0; - long multiple = 0; - - grib_expression_evaluate_long(grib_handle_of_accessor(a),self->begin,&begin); - grib_expression_evaluate_long(grib_handle_of_accessor(a),self->multiple,&multiple); + grib_accessor_padtomultiple* self = (grib_accessor_padtomultiple*)a; + long padding = 0; + long begin = 0; + long multiple = 0; - padding = a->offset - begin; - padding = ((padding + multiple - 1)/multiple)*multiple - padding; + grib_expression_evaluate_long(grib_handle_of_accessor(a), self->begin, &begin); + grib_expression_evaluate_long(grib_handle_of_accessor(a), self->multiple, &multiple); - return padding == 0 ? multiple : padding; + padding = a->offset - begin; + padding = ((padding + multiple - 1) / multiple) * multiple - padding; + return padding == 0 ? multiple : padding; } -static void init(grib_accessor* a, const long len, grib_arguments *arg ) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { - grib_accessor_padtomultiple* self = (grib_accessor_padtomultiple*)a; + grib_accessor_padtomultiple* self = (grib_accessor_padtomultiple*)a; - self->begin = grib_arguments_get_expression(grib_handle_of_accessor(a), arg,0); - self->multiple = grib_arguments_get_expression(grib_handle_of_accessor(a), arg,1); - a->length = preferred_size(a,1); + self->begin = grib_arguments_get_expression(grib_handle_of_accessor(a), arg, 0); + self->multiple = grib_arguments_get_expression(grib_handle_of_accessor(a), arg, 1); + a->length = preferred_size(a, 1); } diff --git a/src/grib_accessor_class_position.c b/src/grib_accessor_class_position.c index cdf23da3f..b23dd178c 100644 --- a/src/grib_accessor_class_position.c +++ b/src/grib_accessor_class_position.c @@ -38,62 +38,63 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int unpack_long(grib_accessor*, long* val,size_t *len); +static int get_native_type(grib_accessor*); +static int unpack_long(grib_accessor*, long* val, size_t* len); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); static int compare(grib_accessor*, grib_accessor*); -typedef struct grib_accessor_position { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in position */ +typedef struct grib_accessor_position +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in position */ } grib_accessor_position; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_position = { - &grib_accessor_class_gen, /* super */ - "position", /* name */ - sizeof(grib_accessor_position), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "position", /* name */ + sizeof(grib_accessor_position), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + &compare, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -102,44 +103,44 @@ grib_accessor_class* grib_accessor_class_position = &_grib_accessor_class_positi static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len , grib_arguments* arg ) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { a->length = 0; - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->flags |= GRIB_ACCESSOR_FLAG_HIDDEN; - a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->flags |= GRIB_ACCESSOR_FLAG_HIDDEN; + a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; } static int get_native_type(grib_accessor* a) @@ -147,16 +148,15 @@ static int get_native_type(grib_accessor* a) return GRIB_TYPE_LONG; } -static void dump(grib_accessor* a,grib_dumper* dumper) +static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_long(dumper,a,NULL); + grib_dump_long(dumper, a, NULL); } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - if(*len < 1) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name , 1 ); + if (*len < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); *len = 0; return GRIB_ARRAY_TOO_SMALL; } @@ -167,6 +167,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) static int compare(grib_accessor* a, grib_accessor* b) { - if (a->offset != b->offset) return GRIB_OFFSET_MISMATCH; + if (a->offset != b->offset) + return GRIB_OFFSET_MISMATCH; return GRIB_SUCCESS; } diff --git a/src/grib_accessor_class_raw.c b/src/grib_accessor_class_raw.c index 7d251a509..6c77b0d5b 100644 --- a/src/grib_accessor_class_raw.c +++ b/src/grib_accessor_class_raw.c @@ -34,68 +34,69 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_bytes(grib_accessor*,const unsigned char*, size_t *len); -static int unpack_bytes (grib_accessor*,unsigned char*, size_t *len); +static int get_native_type(grib_accessor*); +static int pack_bytes(grib_accessor*, const unsigned char*, size_t* len); +static int unpack_bytes(grib_accessor*, unsigned char*, size_t* len); static long byte_count(grib_accessor*); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -static void update_size(grib_accessor*,size_t); +static void update_size(grib_accessor*, size_t); static int compare(grib_accessor*, grib_accessor*); -typedef struct grib_accessor_raw { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in raw */ - const char* totalLength; - const char* sectionLength; - long relativeOffset; +typedef struct grib_accessor_raw +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in raw */ + const char* totalLength; + const char* sectionLength; + long relativeOffset; } grib_accessor_raw; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_raw = { - &grib_accessor_class_gen, /* super */ - "raw", /* name */ - sizeof(grib_accessor_raw), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - &byte_count, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - &pack_bytes, /* grib_pack procedures bytes */ - &unpack_bytes, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - &update_size, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "raw", /* name */ + sizeof(grib_accessor_raw), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + &byte_count, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + &pack_bytes, /* grib_pack procedures bytes */ + &unpack_bytes, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + &update_size, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + &compare, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -104,86 +105,94 @@ grib_accessor_class* grib_accessor_class_raw = &_grib_accessor_class_raw; static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len , grib_arguments* arg ) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { - int n=0; - int err=0; + int n = 0; + int err = 0; long sectionLength; - grib_accessor_raw *self =(grib_accessor_raw*)a; + grib_accessor_raw* self = (grib_accessor_raw*)a; grib_expression* e; grib_handle* hand = grib_handle_of_accessor(a); - a->length=0; - self->totalLength = grib_arguments_get_name(hand,arg,n++); - self->sectionLength = grib_arguments_get_name(hand,arg,n++); + a->length = 0; + self->totalLength = grib_arguments_get_name(hand, arg, n++); + self->sectionLength = grib_arguments_get_name(hand, arg, n++); - e=grib_arguments_get_expression(hand, arg,n++); - err = grib_expression_evaluate_long(hand,e,&(self->relativeOffset)); - if (err) grib_context_log(hand->context,GRIB_LOG_ERROR,"unable to evaluate relativeOffset"); + e = grib_arguments_get_expression(hand, arg, n++); + err = grib_expression_evaluate_long(hand, e, &(self->relativeOffset)); + if (err) + grib_context_log(hand->context, GRIB_LOG_ERROR, "unable to evaluate relativeOffset"); - grib_get_long(hand,self->sectionLength,§ionLength); + grib_get_long(hand, self->sectionLength, §ionLength); - a->length=sectionLength-self->relativeOffset; - if (a->length<0) a->length=0; + a->length = sectionLength - self->relativeOffset; + if (a->length < 0) + a->length = 0; /* Assert(a->length>=0); */ } -static int get_native_type(grib_accessor* a){ +static int get_native_type(grib_accessor* a) +{ return GRIB_TYPE_BYTES; } -static int compare(grib_accessor* a, grib_accessor* b) { - int retval=GRIB_SUCCESS; +static int compare(grib_accessor* a, grib_accessor* b) +{ + int retval = GRIB_SUCCESS; size_t alen = (size_t)grib_byte_count(a); size_t blen = (size_t)grib_byte_count(b); - if (alen != blen) return GRIB_COUNT_MISMATCH; + if (alen != blen) + return GRIB_COUNT_MISMATCH; return retval; } -static long byte_count(grib_accessor* a){ +static long byte_count(grib_accessor* a) +{ return a->length; } -static int value_count(grib_accessor* a,long* len){ - *len=a->length; +static int value_count(grib_accessor* a, long* len) +{ + *len = a->length; return 0; } -static int unpack_bytes (grib_accessor* a,unsigned char* buffer, size_t *len) { +static int unpack_bytes(grib_accessor* a, unsigned char* buffer, size_t* len) +{ if (*len < a->length) { *len = a->length; return GRIB_ARRAY_TOO_SMALL; @@ -195,39 +204,41 @@ static int unpack_bytes (grib_accessor* a,unsigned char* buffer, size_t *len) { return GRIB_SUCCESS; } -static void update_size(grib_accessor* a,size_t s) +static void update_size(grib_accessor* a, size_t s) { - grib_context_log(a->context,GRIB_LOG_DEBUG,"updating size of %s old %ld new %ld",a->name,a->length,s); + grib_context_log(a->context, GRIB_LOG_DEBUG, "updating size of %s old %ld new %ld", a->name, a->length, s); a->length = s; - Assert(a->length>=0); + Assert(a->length >= 0); } -void accessor_raw_set_length(grib_accessor* a,size_t len) { - a->length=len; +void accessor_raw_set_length(grib_accessor* a, size_t len) +{ + a->length = len; } -long accessor_raw_get_offset(grib_accessor* a) { +long accessor_raw_get_offset(grib_accessor* a) +{ return a->offset; } -static int pack_bytes(grib_accessor* a, const unsigned char* val, size_t *len) +static int pack_bytes(grib_accessor* a, const unsigned char* val, size_t* len) { size_t length = *len; long totalLength; long sectionLength; - grib_handle* h=grib_handle_of_accessor(a); - grib_accessor_raw *self =(grib_accessor_raw*)a; - long dlen=length-a->length; + grib_handle* h = grib_handle_of_accessor(a); + grib_accessor_raw* self = (grib_accessor_raw*)a; + long dlen = length - a->length; - grib_get_long(h,self->totalLength,&totalLength); - totalLength+=dlen; - grib_get_long(h,self->sectionLength,§ionLength); - sectionLength+=dlen; + grib_get_long(h, self->totalLength, &totalLength); + totalLength += dlen; + grib_get_long(h, self->sectionLength, §ionLength); + sectionLength += dlen; - grib_buffer_replace(a, val, length,1,1); + grib_buffer_replace(a, val, length, 1, 1); - grib_set_long(h,self->totalLength,totalLength); - grib_set_long(h,self->sectionLength,sectionLength); + grib_set_long(h, self->totalLength, totalLength); + grib_set_long(h, self->sectionLength, sectionLength); a->length = length; return GRIB_SUCCESS; diff --git a/src/grib_accessor_class_rdbtime_guess_date.c b/src/grib_accessor_class_rdbtime_guess_date.c index acd05c1ab..d1ac64e9a 100644 --- a/src/grib_accessor_class_rdbtime_guess_date.c +++ b/src/grib_accessor_class_rdbtime_guess_date.c @@ -37,67 +37,68 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_rdbtime_guess_date { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in rdbtime_guess_date */ - const char* typicalYear; - const char* typicalMonth; - const char* typicalDay; - const char* rdbDay; - long yearOrMonth; +typedef struct grib_accessor_rdbtime_guess_date +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in rdbtime_guess_date */ + const char* typicalYear; + const char* typicalMonth; + const char* typicalDay; + const char* rdbDay; + long yearOrMonth; } grib_accessor_rdbtime_guess_date; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_rdbtime_guess_date = { - &grib_accessor_class_long, /* super */ - "rdbtime_guess_date", /* name */ - sizeof(grib_accessor_rdbtime_guess_date), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "rdbtime_guess_date", /* name */ + sizeof(grib_accessor_rdbtime_guess_date), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -106,95 +107,101 @@ grib_accessor_class* grib_accessor_class_rdbtime_guess_date = &_grib_accessor_cl static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_rdbtime_guess_date* self = (grib_accessor_rdbtime_guess_date*)a; - int n = 0; + int n = 0; - self->typicalYear = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->typicalMonth = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->typicalDay = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->rdbDay = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->yearOrMonth = grib_arguments_get_long(grib_handle_of_accessor(a),c,n++); + self->typicalYear = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->typicalMonth = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->typicalDay = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->rdbDay = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->yearOrMonth = grib_arguments_get_long(grib_handle_of_accessor(a), c, n++); /* a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; */ } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_long(dumper,a,NULL); + grib_dump_long(dumper, a, NULL); } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_rdbtime_guess_date* self = (grib_accessor_rdbtime_guess_date*)a; - grib_handle* h=grib_handle_of_accessor(a); - int ret=0; - long typicalYear,typicalMonth,typicalDay,rdbDay; - long rdbYear,rdbMonth; - - ret=grib_get_long(h,self->typicalYear,&typicalYear); - if (ret) return ret; - ret=grib_get_long(h,self->typicalMonth,&typicalMonth); - if (ret) return ret; - ret=grib_get_long(h,self->typicalDay,&typicalDay); - if (ret) return ret; - ret=grib_get_long(h,self->rdbDay,&rdbDay); - if (ret) return ret; + grib_handle* h = grib_handle_of_accessor(a); + int ret = 0; + long typicalYear, typicalMonth, typicalDay, rdbDay; + long rdbYear, rdbMonth; + + ret = grib_get_long(h, self->typicalYear, &typicalYear); + if (ret) + return ret; + ret = grib_get_long(h, self->typicalMonth, &typicalMonth); + if (ret) + return ret; + ret = grib_get_long(h, self->typicalDay, &typicalDay); + if (ret) + return ret; + ret = grib_get_long(h, self->rdbDay, &rdbDay); + if (ret) + return ret; if (rdbDay < typicalDay) { - if (typicalDay == 31 && typicalMonth==12) { - rdbYear=typicalYear+1; - rdbMonth=1; - } else { - rdbYear=typicalYear; - rdbMonth=typicalMonth+1; + if (typicalDay == 31 && typicalMonth == 12) { + rdbYear = typicalYear + 1; + rdbMonth = 1; + } + else { + rdbYear = typicalYear; + rdbMonth = typicalMonth + 1; } - } else { - rdbYear=typicalYear; - rdbMonth=typicalMonth; + } + else { + rdbYear = typicalYear; + rdbMonth = typicalMonth; } *val = self->yearOrMonth == 1 ? rdbYear : rdbMonth; - *len=1; + *len = 1; return ret; } -static int pack_long(grib_accessor* a, const long* v, size_t *len) +static int pack_long(grib_accessor* a, const long* v, size_t* len) { /* do nothing*/ return GRIB_SUCCESS; diff --git a/src/grib_accessor_class_reference_value_error.c b/src/grib_accessor_class_reference_value_error.c index fe429e471..195ad18c9 100644 --- a/src/grib_accessor_class_reference_value_error.c +++ b/src/grib_accessor_class_reference_value_error.c @@ -38,62 +38,63 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_double(grib_accessor*, double* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_reference_value_error { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in double */ -/* Members defined in reference_value_error */ - const char* referenceValue; - const char* floatType; +typedef struct grib_accessor_reference_value_error +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in double */ + /* Members defined in reference_value_error */ + const char* referenceValue; + const char* floatType; } grib_accessor_reference_value_error; extern grib_accessor_class* grib_accessor_class_double; static grib_accessor_class _grib_accessor_class_reference_value_error = { - &grib_accessor_class_double, /* super */ - "reference_value_error", /* name */ - sizeof(grib_accessor_reference_value_error), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_double, /* super */ + "reference_value_error", /* name */ + sizeof(grib_accessor_reference_value_error), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -102,69 +103,72 @@ grib_accessor_class* grib_accessor_class_reference_value_error = &_grib_accessor static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_reference_value_error* self = (grib_accessor_reference_value_error*)a; - int n = 0; + int n = 0; - self->referenceValue = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->floatType = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); + self->referenceValue = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->floatType = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->length=0; + a->length = 0; } -static int unpack_double (grib_accessor* a, double* val, size_t *len) { +static int unpack_double(grib_accessor* a, double* val, size_t* len) +{ grib_accessor_reference_value_error* self = (grib_accessor_reference_value_error*)a; - int ret = 0; - double referenceValue=0; + int ret = 0; + double referenceValue = 0; - if((ret = grib_get_double_internal(grib_handle_of_accessor(a), - self->referenceValue,&referenceValue)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(grib_handle_of_accessor(a), + self->referenceValue, &referenceValue)) != GRIB_SUCCESS) return ret; - if (!strcmp(self->floatType,"ibm")) - *val=grib_ibmfloat_error(referenceValue); - else if (!strcmp(self->floatType,"ieee")) - *val=grib_ieeefloat_error(referenceValue); - else Assert(1==0); + if (!strcmp(self->floatType, "ibm")) + *val = grib_ibmfloat_error(referenceValue); + else if (!strcmp(self->floatType, "ieee")) + *val = grib_ieeefloat_error(referenceValue); + else + Assert(1 == 0); - if (ret == GRIB_SUCCESS) *len = 1; + if (ret == GRIB_SUCCESS) + *len = 1; return ret; } diff --git a/src/grib_accessor_class_round.c b/src/grib_accessor_class_round.c index cf4d7e587..780a5ca98 100644 --- a/src/grib_accessor_class_round.c +++ b/src/grib_accessor_class_round.c @@ -31,62 +31,63 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_round { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in evaluate */ - grib_arguments* arg; -/* Members defined in round */ +typedef struct grib_accessor_round +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in evaluate */ + grib_arguments* arg; + /* Members defined in round */ } grib_accessor_round; extern grib_accessor_class* grib_accessor_class_evaluate; static grib_accessor_class _grib_accessor_class_round = { - &grib_accessor_class_evaluate, /* super */ - "round", /* name */ - sizeof(grib_accessor_round), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_evaluate, /* super */ + "round", /* name */ + sizeof(grib_accessor_round), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -95,58 +96,58 @@ grib_accessor_class* grib_accessor_class_round = &_grib_accessor_class_round; static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->pack_string = (*(c->super))->pack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->pack_string = (*(c->super))->pack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { grib_accessor_round* self = (grib_accessor_round*)a; int ret = GRIB_SUCCESS; - size_t replen = 0; + size_t replen = 0; double rounding_precision = 0; - double rounded = 0; - double toround = 0; + double rounded = 0; + double toround = 0; const char* oval = NULL; - oval = grib_arguments_get_name(grib_handle_of_accessor(a),self->arg,0); + oval = grib_arguments_get_name(grib_handle_of_accessor(a), self->arg, 0); - if( (ret = grib_get_double_internal(grib_handle_of_accessor(a), oval, &toround)) != 0) + if ((ret = grib_get_double_internal(grib_handle_of_accessor(a), oval, &toround)) != 0) return ret; - rounding_precision = grib_arguments_get_long(grib_handle_of_accessor(a),self->arg,1); + rounding_precision = grib_arguments_get_long(grib_handle_of_accessor(a), self->arg, 1); rounded = floor(rounding_precision * toround + 0.5) / rounding_precision; @@ -157,28 +158,28 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len) return ret; } -static int unpack_string(grib_accessor* a, char* val, size_t *len) +static int unpack_string(grib_accessor* a, char* val, size_t* len) { char result[1024]; - int ret = GRIB_SUCCESS; + int ret = GRIB_SUCCESS; size_t replen = 1; double value = 0; ret = unpack_double(a, &value, &replen); - sprintf(result,"%.3f",value); + sprintf(result, "%.3f", value); - replen = strlen(result)+1; + replen = strlen(result) + 1; - if(*len < replen){ + if (*len < replen) { *len = replen; return GRIB_ARRAY_TOO_SMALL; } *len = replen; - sprintf(val,"%s",result); + sprintf(val, "%s", result); return ret; } diff --git a/src/grib_accessor_class_scale.c b/src/grib_accessor_class_scale.c index 12825838e..088714cd1 100644 --- a/src/grib_accessor_class_scale.c +++ b/src/grib_accessor_class_scale.c @@ -42,66 +42,67 @@ or edit "accessor.class" and rerun ./make_class.pl */ static int is_missing(grib_accessor*); -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_scale { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in double */ -/* Members defined in scale */ - const char* value; - const char* multiplier; - const char* divisor; - const char* truncating; +typedef struct grib_accessor_scale +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in double */ + /* Members defined in scale */ + const char* value; + const char* multiplier; + const char* divisor; + const char* truncating; } grib_accessor_scale; extern grib_accessor_class* grib_accessor_class_double; static grib_accessor_class _grib_accessor_class_scale = { - &grib_accessor_class_double, /* super */ - "scale", /* name */ - sizeof(grib_accessor_scale), /* size */ + &grib_accessor_class_double, /* super */ + "scale", /* name */ + sizeof(grib_accessor_scale), /* size */ 0, /* inited */ &init_class, /* init_class */ &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ &is_missing, /* grib_pack procedures long */ &pack_long, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ + 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -110,113 +111,116 @@ grib_accessor_class* grib_accessor_class_scale = &_grib_accessor_class_scale; static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_scale* self = (grib_accessor_scale*)a; - int n = 0; + int n = 0; - self->value = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->multiplier = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->divisor = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->truncating = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); + self->value = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->multiplier = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->divisor = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->truncating = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { grib_accessor_scale* self = (grib_accessor_scale*)a; - int ret = 0; - long value = 0; - long multiplier = 0; - long divisor = 0; + int ret = 0; + long value = 0; + long multiplier = 0; + long divisor = 0; - if(*len < 1){ + if (*len < 1) { ret = GRIB_ARRAY_TOO_SMALL; grib_context_log(a->context, GRIB_LOG_ERROR, - "Accessor %s cannot gather value for %s and/or %s error %d", - a->name,self->multiplier, self->divisor, ret); + "Accessor %s cannot gather value for %s and/or %s error %d", + a->name, self->multiplier, self->divisor, ret); return ret; } - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->divisor,&divisor)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->divisor, &divisor)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->multiplier,&multiplier)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->multiplier, &multiplier)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->value,&value)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->value, &value)) != GRIB_SUCCESS) return ret; - if (value == GRIB_MISSING_LONG) *val=GRIB_MISSING_DOUBLE; - else *val = ((double)(value*multiplier))/divisor; + if (value == GRIB_MISSING_LONG) + *val = GRIB_MISSING_DOUBLE; + else + *val = ((double)(value * multiplier)) / divisor; /*printf("unpack_double: divisor=%ld multiplier=%ld long_value=%ld scaled_value=%.30f\n",(double)divisor,(double)multiplier,value,*val);*/ - if (ret == GRIB_SUCCESS) *len = 1; + if (ret == GRIB_SUCCESS) + *len = 1; return ret; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { - const double dval=(double)*val ; - return pack_double(a, &dval,len); + const double dval = (double)*val; + return pack_double(a, &dval, len); } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { grib_accessor_scale* self = (grib_accessor_scale*)a; - int ret = 0; + int ret = 0; - long value = 0; - long divisor = 0; + long value = 0; + long divisor = 0; long multiplier = 0; - long truncating=0; + long truncating = 0; double x; - ret = grib_get_long_internal(grib_handle_of_accessor(a), self->divisor,&divisor); - if(ret != GRIB_SUCCESS) { + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->divisor, &divisor); + if (ret != GRIB_SUCCESS) { grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannont gather value for %s error %d \n", a->name, self->divisor, ret); return ret; } - ret = grib_get_long_internal(grib_handle_of_accessor(a), self->multiplier,&multiplier); - if(ret != GRIB_SUCCESS){ + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->multiplier, &multiplier); + if (ret != GRIB_SUCCESS) { grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannont gather value for %s error %d \n", a->name, self->divisor, ret); return ret; } if (self->truncating) { - ret = grib_get_long_internal(grib_handle_of_accessor(a), self->truncating,&truncating); - if(ret != GRIB_SUCCESS){ + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->truncating, &truncating); + if (ret != GRIB_SUCCESS) { grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannont gather value for %s error %d \n", a->name, self->truncating, ret); return ret; } @@ -227,19 +231,22 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) return GRIB_ENCODING_ERROR; } - x=*val * (double)divisor / (double)multiplier; - if (*val == GRIB_MISSING_DOUBLE) value = GRIB_MISSING_LONG; + x = *val * (double)divisor / (double)multiplier; + if (*val == GRIB_MISSING_DOUBLE) + value = GRIB_MISSING_LONG; else if (truncating) { value = (long)x; - } else { - value = x > 0 ? (long)(x+0.5) : (long)(x-0.5) ; + } + else { + value = x > 0 ? (long)(x + 0.5) : (long)(x - 0.5); } - ret = grib_set_long_internal(grib_handle_of_accessor(a), self->value,value); - if(ret ) + ret = grib_set_long_internal(grib_handle_of_accessor(a), self->value, value); + if (ret) grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannont pack value for %s error %d \n", a->name, self->value, ret); - if (ret == GRIB_SUCCESS) *len = 1; + if (ret == GRIB_SUCCESS) + *len = 1; return ret; } @@ -247,9 +254,10 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) static int is_missing(grib_accessor* a) { grib_accessor_scale* self = (grib_accessor_scale*)a; - grib_accessor* av=grib_find_accessor(grib_handle_of_accessor(a),self->value); + grib_accessor* av = grib_find_accessor(grib_handle_of_accessor(a), self->value); - if (!av) return GRIB_NOT_FOUND; + if (!av) + return GRIB_NOT_FOUND; return grib_is_missing_internal(av); #if 0 int ret=0; diff --git a/src/grib_accessor_class_scale_values.c b/src/grib_accessor_class_scale_values.c index 2f07765b1..5cb348ea5 100644 --- a/src/grib_accessor_class_scale_values.c +++ b/src/grib_accessor_class_scale_values.c @@ -36,63 +36,64 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_scale_values { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in double */ -/* Members defined in scale_values */ - const char* values; - const char* missingValue; +typedef struct grib_accessor_scale_values +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in double */ + /* Members defined in scale_values */ + const char* values; + const char* missingValue; } grib_accessor_scale_values; extern grib_accessor_class* grib_accessor_class_double; static grib_accessor_class _grib_accessor_class_scale_values = { - &grib_accessor_class_double, /* super */ - "scale_values", /* name */ - sizeof(grib_accessor_scale_values), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_double, /* super */ + "scale_values", /* name */ + sizeof(grib_accessor_scale_values), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -101,102 +102,107 @@ grib_accessor_class* grib_accessor_class_scale_values = &_grib_accessor_class_sc static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* args) +static void init(grib_accessor* a, const long l, grib_arguments* args) { - int n=0; - grib_accessor_scale_values* self= (grib_accessor_scale_values*)a; - self->values=grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->missingValue=grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); + int n = 0; + grib_accessor_scale_values* self = (grib_accessor_scale_values*)a; + self->values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->missingValue = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; - a->length=0; + a->length = 0; } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - int ret=0; - *val=1; - *len =1; + int ret = 0; + *val = 1; + *len = 1; return ret; } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { - double* values=NULL; - double missingValue=0; + double* values = NULL; + double missingValue = 0; long missingValuesPresent = 0; - size_t size=0; - int ret=0,i=0; - grib_accessor_scale_values* self= (grib_accessor_scale_values*)a; - grib_context* c=a->context; - grib_handle* h=grib_handle_of_accessor(a); + size_t size = 0; + int ret = 0, i = 0; + grib_accessor_scale_values* self = (grib_accessor_scale_values*)a; + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); - if (*val==1) return GRIB_SUCCESS; + if (*val == 1) + return GRIB_SUCCESS; - if((ret = grib_get_double_internal(h,self->missingValue,&missingValue)) != GRIB_SUCCESS) { + if ((ret = grib_get_double_internal(h, self->missingValue, &missingValue)) != GRIB_SUCCESS) { return ret; } - if((ret=grib_get_long_internal(h,"missingValuesPresent",&missingValuesPresent)) != GRIB_SUCCESS) { + if ((ret = grib_get_long_internal(h, "missingValuesPresent", &missingValuesPresent)) != GRIB_SUCCESS) { return ret; } - if ( (ret=grib_get_size(h,self->values,&size)) != GRIB_SUCCESS) return ret; + if ((ret = grib_get_size(h, self->values, &size)) != GRIB_SUCCESS) + return ret; - values=(double*)grib_context_malloc(c,size*sizeof(double)); - if (!values) return GRIB_OUT_OF_MEMORY; + values = (double*)grib_context_malloc(c, size * sizeof(double)); + if (!values) + return GRIB_OUT_OF_MEMORY; - if((ret = grib_get_double_array_internal(h,self->values,values,&size)) != GRIB_SUCCESS) { - grib_context_free(c,values); + if ((ret = grib_get_double_array_internal(h, self->values, values, &size)) != GRIB_SUCCESS) { + grib_context_free(c, values); return ret; } - for (i=0;ivalues,values,size)) != GRIB_SUCCESS) { - grib_context_free(c,values); + if ((ret = grib_set_double_array_internal(h, self->values, values, size)) != GRIB_SUCCESS) { + grib_context_free(c, values); return ret; } - grib_context_free(c,values); + grib_context_free(c, values); return GRIB_SUCCESS; } diff --git a/src/grib_accessor_class_second_order_bits_per_value.c b/src/grib_accessor_class_second_order_bits_per_value.c index e260adce2..58eeb0db3 100644 --- a/src/grib_accessor_class_second_order_bits_per_value.c +++ b/src/grib_accessor_class_second_order_bits_per_value.c @@ -39,65 +39,66 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_second_order_bits_per_value { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in second_order_bits_per_value */ - const char* values; - const char* binaryScaleFactor; - const char* decimalScaleFactor; - long bitsPerValue; +typedef struct grib_accessor_second_order_bits_per_value +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in second_order_bits_per_value */ + const char* values; + const char* binaryScaleFactor; + const char* decimalScaleFactor; + long bitsPerValue; } grib_accessor_second_order_bits_per_value; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_second_order_bits_per_value = { - &grib_accessor_class_long, /* super */ - "second_order_bits_per_value", /* name */ - sizeof(grib_accessor_second_order_bits_per_value), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "second_order_bits_per_value", /* name */ + sizeof(grib_accessor_second_order_bits_per_value), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -106,36 +107,36 @@ grib_accessor_class* grib_accessor_class_second_order_bits_per_value = &_grib_ac static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ @@ -150,31 +151,31 @@ static const unsigned long nbits[32]={ 0x40000000, 0x80000000 }; */ -static const unsigned long nbits[64]={ - 0x1, 0x2, 0x4, 0x8, - 0x10, 0x20, 0x40, 0x80, - 0x100, 0x200, 0x400, 0x800, - 0x1000, 0x2000, 0x4000, 0x8000, - 0x10000, 0x20000, 0x40000, 0x80000, - 0x100000, 0x200000, 0x400000, 0x800000, - 0x1000000, 0x2000000, 0x4000000, 0x8000000, - 0x10000000, 0x20000000, 0x40000000, 0x80000000, - 0x100000000, 0x200000000, 0x400000000, 0x800000000, - 0x1000000000, 0x2000000000, 0x4000000000, 0x8000000000, - 0x10000000000, 0x20000000000, 0x40000000000, 0x80000000000, - 0x100000000000, 0x200000000000, 0x400000000000, 0x800000000000, - 0x1000000000000, 0x2000000000000, 0x4000000000000, 0x8000000000000, - 0x10000000000000, 0x20000000000000, 0x40000000000000, 0x80000000000000, - 0x100000000000000, 0x200000000000000, 0x400000000000000, 0x800000000000000, - 0x1000000000000000, 0x2000000000000000, 0x4000000000000000, 0x8000000000000000 +static const unsigned long nbits[64] = { + 0x1, 0x2, 0x4, 0x8, + 0x10, 0x20, 0x40, 0x80, + 0x100, 0x200, 0x400, 0x800, + 0x1000, 0x2000, 0x4000, 0x8000, + 0x10000, 0x20000, 0x40000, 0x80000, + 0x100000, 0x200000, 0x400000, 0x800000, + 0x1000000, 0x2000000, 0x4000000, 0x8000000, + 0x10000000, 0x20000000, 0x40000000, 0x80000000, + 0x100000000, 0x200000000, 0x400000000, 0x800000000, + 0x1000000000, 0x2000000000, 0x4000000000, 0x8000000000, + 0x10000000000, 0x20000000000, 0x40000000000, 0x80000000000, + 0x100000000000, 0x200000000000, 0x400000000000, 0x800000000000, + 0x1000000000000, 0x2000000000000, 0x4000000000000, 0x8000000000000, + 0x10000000000000, 0x20000000000000, 0x40000000000000, 0x80000000000000, + 0x100000000000000, 0x200000000000000, 0x400000000000000, 0x800000000000000, + 0x1000000000000000, 0x2000000000000000, 0x4000000000000000, 0x8000000000000000 }; static int number_of_bits(unsigned long x, long* result) { - const unsigned long *n=nbits; - const int count = sizeof(nbits)/sizeof(nbits[0]); - *result=0; - while (x>=*n) { + const unsigned long* n = nbits; + const int count = sizeof(nbits) / sizeof(nbits[0]); + *result = 0; + while (x >= *n) { n++; (*result)++; if (*result >= count) { @@ -184,80 +185,82 @@ static int number_of_bits(unsigned long x, long* result) return GRIB_SUCCESS; } -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { - int n=0; + int n = 0; grib_accessor_second_order_bits_per_value* self = (grib_accessor_second_order_bits_per_value*)a; - self->values = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->binaryScaleFactor = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->decimalScaleFactor = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->bitsPerValue=0; + self->values = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->binaryScaleFactor = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->decimalScaleFactor = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->bitsPerValue = 0; - a->length=0; + a->length = 0; } -static int pack_long(grib_accessor* a, const long* val,size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { grib_accessor_second_order_bits_per_value* self = (grib_accessor_second_order_bits_per_value*)a; - self->bitsPerValue=(long)*val; - *len=1; + self->bitsPerValue = (long)*val; + *len = 1; return 0; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - int ret=GRIB_SUCCESS; - size_t size=0; + int ret = GRIB_SUCCESS; + size_t size = 0; size_t i; - double max,min,d,b; - double *values=0; - long binaryScaleFactor,decimalScaleFactor; + double max, min, d, b; + double* values = 0; + long binaryScaleFactor, decimalScaleFactor; grib_accessor_second_order_bits_per_value* self = (grib_accessor_second_order_bits_per_value*)a; if (self->bitsPerValue) { - *val=self->bitsPerValue; + *val = self->bitsPerValue; return GRIB_SUCCESS; } - if((ret = grib_get_size(grib_handle_of_accessor(a), self->values,&size)) != GRIB_SUCCESS) { - *val=self->bitsPerValue; + if ((ret = grib_get_size(grib_handle_of_accessor(a), self->values, &size)) != GRIB_SUCCESS) { + *val = self->bitsPerValue; return GRIB_SUCCESS; } - if((ret = grib_get_long(grib_handle_of_accessor(a), self->binaryScaleFactor,&binaryScaleFactor)) != GRIB_SUCCESS) + if ((ret = grib_get_long(grib_handle_of_accessor(a), self->binaryScaleFactor, &binaryScaleFactor)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->decimalScaleFactor,&decimalScaleFactor)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->decimalScaleFactor, &decimalScaleFactor)) != GRIB_SUCCESS) return ret; - values=(double*)grib_context_malloc_clear(a->context,sizeof(double)*size); + values = (double*)grib_context_malloc_clear(a->context, sizeof(double) * size); if (!values) { - grib_context_log(a->context,GRIB_LOG_FATAL,"%s unable to allocate %ld bytes", - a->name,(long)size); + grib_context_log(a->context, GRIB_LOG_FATAL, "%s unable to allocate %ld bytes", + a->name, (long)size); return GRIB_OUT_OF_MEMORY; } - if((ret = grib_get_double_array_internal(grib_handle_of_accessor(a), self->values,values,&size)) != GRIB_SUCCESS) + if ((ret = grib_get_double_array_internal(grib_handle_of_accessor(a), self->values, values, &size)) != GRIB_SUCCESS) return ret; - max=values[0]; - min=max; - for (i=1;ivalues[i]) min=values[i]; + max = values[0]; + min = max; + for (i = 1; i < size; i++) { + if (max < values[i]) + max = values[i]; + else if (min > values[i]) + min = values[i]; } - d=grib_power(decimalScaleFactor,10); - b=grib_power(-binaryScaleFactor,2); + d = grib_power(decimalScaleFactor, 10); + b = grib_power(-binaryScaleFactor, 2); /* self->bitsPerValue=(long)ceil(log((double)((max-min)*d+1))/log(2.0))-binaryScaleFactor; */ /* See GRIB-540 for why we use ceil */ - ret = number_of_bits( (unsigned long)ceil((fabs(max-min)*b*d)), &(self->bitsPerValue) ); + ret = number_of_bits((unsigned long)ceil((fabs(max - min) * b * d)), &(self->bitsPerValue)); if (ret != GRIB_SUCCESS) return ret; - *val=self->bitsPerValue; + *val = self->bitsPerValue; - grib_context_free(a->context,values); + grib_context_free(a->context, values); return ret; } diff --git a/src/grib_accessor_class_section.c b/src/grib_accessor_class_section.c index ae855cd5a..227ba015b 100644 --- a/src/grib_accessor_class_section.c +++ b/src/grib_accessor_class_section.c @@ -36,65 +36,66 @@ or edit "accessor.class" and rerun ./make_class.pl */ static grib_section* sub_section(grib_accessor* a); -static int get_native_type(grib_accessor*); +static int get_native_type(grib_accessor*); static long byte_count(grib_accessor*); static long next_offset(grib_accessor*); -static void destroy(grib_context*,grib_accessor*); +static void destroy(grib_context*, grib_accessor*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -static void update_size(grib_accessor*,size_t); +static void update_size(grib_accessor*, size_t); static grib_accessor* next(grib_accessor*, int); -typedef struct grib_accessor_section { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in section */ +typedef struct grib_accessor_section +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in section */ } grib_accessor_section; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_section = { - &grib_accessor_class_gen, /* super */ - "section", /* name */ - sizeof(grib_accessor_section), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* free mem */ - &dump, /* describes himself */ - &next_offset, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - &byte_count, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - &sub_section, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - &update_size, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - &next, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "section", /* name */ + sizeof(grib_accessor_section), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + &destroy, /* free mem */ + &dump, /* describes himself */ + &next_offset, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + &byte_count, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + &sub_section, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + &update_size, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + &next, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -103,56 +104,55 @@ grib_accessor_class* grib_accessor_class_section = &_grib_accessor_class_section static void init_class(grib_accessor_class* c) { - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_offset = (*(c->super))->byte_offset; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_offset = (*(c->super))->byte_offset; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len , grib_arguments* arg ) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { - a->sub_section = grib_section_create(grib_handle_of_accessor(a),a); - a->length = 0; - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->sub_section = grib_section_create(grib_handle_of_accessor(a), a); + a->length = 0; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_section(dumper,a,a->sub_section->block); + grib_dump_section(dumper, a, a->sub_section->block); } static long byte_count(grib_accessor* a) { - - if( !a->length || grib_handle_of_accessor(a)->loader ) - { - if(a->name[1]=='_') return 0; + if (!a->length || grib_handle_of_accessor(a)->loader) { + if (a->name[1] == '_') + return 0; /* printf("adjusting sizes SECTION %s is %ld %ld\n",a->name,(long)a->offset,(long)a->length); */ - grib_section_adjust_sizes(a->sub_section,grib_handle_of_accessor(a)->loader != NULL,0); + grib_section_adjust_sizes(a->sub_section, grib_handle_of_accessor(a)->loader != NULL, 0); /* printf(" SECTION %s is %ld %ld\n",a->name,(long)a->offset,(long)a->length); */ } @@ -167,10 +167,10 @@ static long next_offset(grib_accessor* a) static void destroy(grib_context* ct, grib_accessor* a) { - grib_section_delete(ct,a->sub_section); + grib_section_delete(ct, a->sub_section); } -static int get_native_type(grib_accessor* a) +static int get_native_type(grib_accessor* a) { return GRIB_TYPE_SECTION; } @@ -181,42 +181,43 @@ static grib_section* sub_section(grib_accessor* a) return a->sub_section; } -static void update_size(grib_accessor* a,size_t length) +static void update_size(grib_accessor* a, size_t length) { size_t size = 1; - long len = length; + long len = length; Assert(length <= 0x7fffffff); - if(a->sub_section->aclength) - { - int e=grib_pack_long(a->sub_section->aclength,&len,&size); - Assert( e == GRIB_SUCCESS); - printf("update_length %s %ld %ld\n",a->sub_section->aclength->name, - (long)a->sub_section->aclength->offset, - (long)a->sub_section->aclength->length + if (a->sub_section->aclength) { + int e = grib_pack_long(a->sub_section->aclength, &len, &size); + Assert(e == GRIB_SUCCESS); + printf("update_length %s %ld %ld\n", a->sub_section->aclength->name, + (long)a->sub_section->aclength->offset, + (long)a->sub_section->aclength->length ); } a->sub_section->length = a->length = length; - a->sub_section->padding = 0; + a->sub_section->padding = 0; - printf("update_size %s %ld\n",a->name,a->length); + printf("update_size %s %ld\n", a->name, a->length); - Assert(a->length>=0); + Assert(a->length >= 0); } -static grib_accessor* next(grib_accessor* a,int explore) +static grib_accessor* next(grib_accessor* a, int explore) { - grib_accessor* next=NULL; + grib_accessor* next = NULL; if (explore) { - next=a->sub_section->block->first; - if (!next) next=a->next; - } else { - next=a->next; + next = a->sub_section->block->first; + if (!next) + next = a->next; + } + else { + next = a->next; } if (!next) { if (a->parent->owner) - next=a->parent->owner->cclass->next(a->parent->owner,0); + next = a->parent->owner->cclass->next(a->parent->owner, 0); } return next; } diff --git a/src/grib_accessor_class_section_length.c b/src/grib_accessor_class_section_length.c index f80a2f895..178471cb2 100644 --- a/src/grib_accessor_class_section_length.c +++ b/src/grib_accessor_class_section_length.c @@ -31,64 +31,65 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int value_count(grib_accessor*,long*); +static int value_count(grib_accessor*, long*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_section_length { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in unsigned */ - long nbytes; - grib_arguments* arg; -/* Members defined in section_length */ +typedef struct grib_accessor_section_length +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in unsigned */ + long nbytes; + grib_arguments* arg; + /* Members defined in section_length */ } grib_accessor_section_length; extern grib_accessor_class* grib_accessor_class_unsigned; static grib_accessor_class _grib_accessor_class_section_length = { - &grib_accessor_class_unsigned, /* super */ - "section_length", /* name */ - sizeof(grib_accessor_section_length), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_unsigned, /* super */ + "section_length", /* name */ + sizeof(grib_accessor_section_length), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -97,56 +98,56 @@ grib_accessor_class* grib_accessor_class_section_length = &_grib_accessor_class_ static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len , grib_arguments* arg ) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { a->parent->aclength = a; - a->length = len; - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; - Assert(a->length>=0); + a->length = len; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->flags |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; + Assert(a->length >= 0); } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_long(dumper,a,NULL); + grib_dump_long(dumper, a, NULL); } -static int value_count(grib_accessor* a,long* c) +static int value_count(grib_accessor* a, long* c) { - *c=1; + *c = 1; return 0; } diff --git a/src/grib_accessor_class_section_padding.c b/src/grib_accessor_class_section_padding.c index d14f9b8b5..735587ff8 100644 --- a/src/grib_accessor_class_section_padding.c +++ b/src/grib_accessor_class_section_padding.c @@ -31,62 +31,63 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -static size_t preferred_size(grib_accessor*,int); - -typedef struct grib_accessor_section_padding { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in bytes */ -/* Members defined in padding */ -/* Members defined in section_padding */ - int preserve; +static size_t preferred_size(grib_accessor*, int); + +typedef struct grib_accessor_section_padding +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in bytes */ + /* Members defined in padding */ + /* Members defined in section_padding */ + int preserve; } grib_accessor_section_padding; extern grib_accessor_class* grib_accessor_class_padding; static grib_accessor_class _grib_accessor_class_section_padding = { - &grib_accessor_class_padding, /* super */ - "section_padding", /* name */ - sizeof(grib_accessor_section_padding), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - &preferred_size, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_padding, /* super */ + "section_padding", /* name */ + sizeof(grib_accessor_section_padding), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + &preferred_size, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -95,37 +96,37 @@ grib_accessor_class* grib_accessor_class_section_padding = &_grib_accessor_class static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ @@ -133,58 +134,54 @@ static void init_class(grib_accessor_class* c) static size_t preferred_size(grib_accessor* a, int from_handle) { grib_accessor_section_padding* self = (grib_accessor_section_padding*)a; - grib_accessor *b = a; - grib_accessor* section_length = 0; - long length = 0; - size_t size = 1; + grib_accessor* b = a; + grib_accessor* section_length = 0; + long length = 0; + size_t size = 1; long alength = 0; - if(!from_handle) - { - if(self->preserve) + if (!from_handle) { + if (self->preserve) return a->length; else return 0; } /* The section length should be a parameter */ - while(section_length == NULL && b != NULL) - { + while (section_length == NULL && b != NULL) { section_length = b->parent->aclength; - b = b->parent->owner; + b = b->parent->owner; } - if(!section_length) - { + if (!section_length) { /* printf("PADDING is no !section_length\n"); */ return 0; } - if(grib_unpack_long(section_length,&length,&size) == GRIB_SUCCESS) - { - if(length) + if (grib_unpack_long(section_length, &length, &size) == GRIB_SUCCESS) { + if (length) alength = length - a->offset + section_length->parent->owner->offset; else alength = 0; /*Assert(a->length>=0);*/ - if (alength<0) alength=0; + if (alength < 0) + alength = 0; /* printf("PADDING is %ld\n",a->length); */ } - else - { + else { /* printf("PADDING unpack fails\n"); */ } return alength; } -static void init(grib_accessor* a, const long len, grib_arguments*arg ) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { grib_accessor_section_padding* self = (grib_accessor_section_padding*)a; - self->preserve = 1; /* This should be a parameter */ - a->length = preferred_size(a,1); + self->preserve = 1; /* This should be a parameter */ + a->length = preferred_size(a, 1); } diff --git a/src/grib_accessor_class_section_pointer.c b/src/grib_accessor_class_section_pointer.c index 7c5e7cd10..0226b1287 100644 --- a/src/grib_accessor_class_section_pointer.c +++ b/src/grib_accessor_class_section_pointer.c @@ -34,65 +34,66 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int unpack_string (grib_accessor*, char*, size_t *len); +static int get_native_type(grib_accessor*); +static int unpack_string(grib_accessor*, char*, size_t* len); static long byte_count(grib_accessor*); static long byte_offset(grib_accessor*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_section_pointer { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in section_pointer */ - const char* sectionOffset; - const char* sectionLength; - long sectionNumber; +typedef struct grib_accessor_section_pointer +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in section_pointer */ + const char* sectionOffset; + const char* sectionLength; + long sectionNumber; } grib_accessor_section_pointer; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_section_pointer = { - &grib_accessor_class_gen, /* super */ - "section_pointer", /* name */ - sizeof(grib_accessor_section_pointer), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - &byte_count, /* get number of bytes */ - &byte_offset, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "section_pointer", /* name */ + sizeof(grib_accessor_section_pointer), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + &byte_count, /* get number of bytes */ + &byte_offset, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -101,57 +102,57 @@ grib_accessor_class* grib_accessor_class_section_pointer = &_grib_accessor_class static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len , grib_arguments* arg) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { - int n=0; - grib_accessor_section_pointer* self=(grib_accessor_section_pointer*)a; + int n = 0; + grib_accessor_section_pointer* self = (grib_accessor_section_pointer*)a; - self->sectionOffset = grib_arguments_get_name(grib_handle_of_accessor(a),arg,n++); - self->sectionLength = grib_arguments_get_name(grib_handle_of_accessor(a),arg,n++); - self->sectionNumber = grib_arguments_get_long(grib_handle_of_accessor(a),arg,n++); + self->sectionOffset = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); + self->sectionLength = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); + self->sectionNumber = grib_arguments_get_long(grib_handle_of_accessor(a), arg, n++); - Assert (self->sectionNumber < MAX_NUM_SECTIONS ); + Assert(self->sectionNumber < MAX_NUM_SECTIONS); - grib_handle_of_accessor(a)->section_offset[self->sectionNumber]=(char*)self->sectionOffset; - grib_handle_of_accessor(a)->section_length[self->sectionNumber]=(char*)self->sectionLength; + grib_handle_of_accessor(a)->section_offset[self->sectionNumber] = (char*)self->sectionOffset; + grib_handle_of_accessor(a)->section_length[self->sectionNumber] = (char*)self->sectionLength; /* printf("++++++++++++++ GRIB_API: creating section_pointer%d %s %s\n", */ /* self->sectionNumber,self->sectionLength,self->sectionLength); */ - if( grib_handle_of_accessor(a)->sections_count < self->sectionNumber) - grib_handle_of_accessor(a)->sections_count=self->sectionNumber; + if (grib_handle_of_accessor(a)->sections_count < self->sectionNumber) + grib_handle_of_accessor(a)->sections_count = self->sectionNumber; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; a->flags |= GRIB_ACCESSOR_FLAG_HIDDEN; @@ -165,7 +166,7 @@ static int get_native_type(grib_accessor* a) return GRIB_TYPE_BYTES; } -static int unpack_string(grib_accessor *a , char* v, size_t *len) +static int unpack_string(grib_accessor* a, char* v, size_t* len) { /* unsigned char* p=NULL; @@ -183,21 +184,21 @@ static int unpack_string(grib_accessor *a , char* v, size_t *len) } *len=length; */ - sprintf(v,"%ld_%ld",grib_byte_offset(a),grib_byte_count(a)); + sprintf(v, "%ld_%ld", grib_byte_offset(a), grib_byte_count(a)); return GRIB_SUCCESS; } static long byte_count(grib_accessor* a) { - grib_accessor_section_pointer* self=(grib_accessor_section_pointer*)a; - long sectionLength=0; - int ret=0; + grib_accessor_section_pointer* self = (grib_accessor_section_pointer*)a; + long sectionLength = 0; + int ret = 0; - ret=grib_get_long(grib_handle_of_accessor(a),self->sectionLength,§ionLength); + ret = grib_get_long(grib_handle_of_accessor(a), self->sectionLength, §ionLength); if (ret) { - grib_context_log(a->context,GRIB_LOG_ERROR, - "unable to get %s %s", - self->sectionLength,grib_get_error_message(ret)); + grib_context_log(a->context, GRIB_LOG_ERROR, + "unable to get %s %s", + self->sectionLength, grib_get_error_message(ret)); return -1; } @@ -206,15 +207,15 @@ static long byte_count(grib_accessor* a) static long byte_offset(grib_accessor* a) { - grib_accessor_section_pointer* self=(grib_accessor_section_pointer*)a; - long sectionOffset=0; - int ret=0; + grib_accessor_section_pointer* self = (grib_accessor_section_pointer*)a; + long sectionOffset = 0; + int ret = 0; - ret=grib_get_long(grib_handle_of_accessor(a),self->sectionOffset,§ionOffset); + ret = grib_get_long(grib_handle_of_accessor(a), self->sectionOffset, §ionOffset); if (ret) { - grib_context_log(a->context,GRIB_LOG_ERROR, - "unable to get %s %s", - self->sectionOffset,grib_get_error_message(ret)); + grib_context_log(a->context, GRIB_LOG_ERROR, + "unable to get %s %s", + self->sectionOffset, grib_get_error_message(ret)); return -1; } diff --git a/src/grib_accessor_class_select_step_template.c b/src/grib_accessor_class_select_step_template.c index b78e75e95..4c62fe60b 100644 --- a/src/grib_accessor_class_select_step_template.c +++ b/src/grib_accessor_class_select_step_template.c @@ -38,67 +38,68 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_select_step_template { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in unsigned */ - long nbytes; - grib_arguments* arg; -/* Members defined in select_step_template */ - const char* productDefinitionTemplateNumber; - int instant; +typedef struct grib_accessor_select_step_template +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in unsigned */ + long nbytes; + grib_arguments* arg; + /* Members defined in select_step_template */ + const char* productDefinitionTemplateNumber; + int instant; } grib_accessor_select_step_template; extern grib_accessor_class* grib_accessor_class_unsigned; static grib_accessor_class _grib_accessor_class_select_step_template = { - &grib_accessor_class_unsigned, /* super */ - "select_step_template", /* name */ - sizeof(grib_accessor_select_step_template), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_unsigned, /* super */ + "select_step_template", /* name */ + sizeof(grib_accessor_select_step_template), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -107,197 +108,198 @@ grib_accessor_class* grib_accessor_class_select_step_template = &_grib_accessor_ static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_select_step_template* self = (grib_accessor_select_step_template*)a; - int n = 0; + int n = 0; - self->productDefinitionTemplateNumber = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->instant = grib_arguments_get_long(grib_handle_of_accessor(a),c,n++); + self->productDefinitionTemplateNumber = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->instant = grib_arguments_get_long(grib_handle_of_accessor(a), c, n++); } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - *val=1; + *val = 1; return GRIB_SUCCESS; } static int pack_long(grib_accessor* a, const long* val, size_t* len) { grib_accessor_select_step_template* self = (grib_accessor_select_step_template*)a; - long productDefinitionTemplateNumber=0; - long productDefinitionTemplateNumberNew=0; + long productDefinitionTemplateNumber = 0; + long productDefinitionTemplateNumberNew = 0; - grib_get_long(grib_handle_of_accessor(a), self->productDefinitionTemplateNumber,&productDefinitionTemplateNumber); + grib_get_long(grib_handle_of_accessor(a), self->productDefinitionTemplateNumber, &productDefinitionTemplateNumber); if (self->instant) { /* Going from continuous or non-continuous interval to a point-in-time (instantaneous) */ switch (productDefinitionTemplateNumber) { - case 8: - productDefinitionTemplateNumberNew=0; - break; - case 9: - productDefinitionTemplateNumberNew=5; - break; - case 10: - productDefinitionTemplateNumberNew=6; - break; - case 11: - productDefinitionTemplateNumberNew=1; - break; - case 12: - productDefinitionTemplateNumberNew=2; - break; - case 13: - productDefinitionTemplateNumberNew=3; - break; - case 14: - productDefinitionTemplateNumberNew=4; - break; - case 42: /* non-EPS chemical */ - productDefinitionTemplateNumberNew=40; - break; - case 43: /* EPS chemical */ - productDefinitionTemplateNumberNew=41; - break; - case 46: /* non-EPS aerosol */ - productDefinitionTemplateNumberNew=48;/*44 is deprecated*/ - break; - case 47: /* EPS aerosol */ - productDefinitionTemplateNumberNew=45; - break; - case 67: /* non-EPS chemical distrib func */ - productDefinitionTemplateNumberNew=57; - break; - case 68: /* EPS chemical distrib func */ - productDefinitionTemplateNumberNew=58; - break; - case 72: /* non-EPS post-processing */ - productDefinitionTemplateNumberNew=70; - break; - case 73: /* EPS post-processing */ - productDefinitionTemplateNumberNew=71; - break; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 15: - productDefinitionTemplateNumberNew=productDefinitionTemplateNumber; - break; - default: - productDefinitionTemplateNumberNew=productDefinitionTemplateNumber; - break; + case 8: + productDefinitionTemplateNumberNew = 0; + break; + case 9: + productDefinitionTemplateNumberNew = 5; + break; + case 10: + productDefinitionTemplateNumberNew = 6; + break; + case 11: + productDefinitionTemplateNumberNew = 1; + break; + case 12: + productDefinitionTemplateNumberNew = 2; + break; + case 13: + productDefinitionTemplateNumberNew = 3; + break; + case 14: + productDefinitionTemplateNumberNew = 4; + break; + case 42: /* non-EPS chemical */ + productDefinitionTemplateNumberNew = 40; + break; + case 43: /* EPS chemical */ + productDefinitionTemplateNumberNew = 41; + break; + case 46: /* non-EPS aerosol */ + productDefinitionTemplateNumberNew = 48; /*44 is deprecated*/ + break; + case 47: /* EPS aerosol */ + productDefinitionTemplateNumberNew = 45; + break; + case 67: /* non-EPS chemical distrib func */ + productDefinitionTemplateNumberNew = 57; + break; + case 68: /* EPS chemical distrib func */ + productDefinitionTemplateNumberNew = 58; + break; + case 72: /* non-EPS post-processing */ + productDefinitionTemplateNumberNew = 70; + break; + case 73: /* EPS post-processing */ + productDefinitionTemplateNumberNew = 71; + break; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 15: + productDefinitionTemplateNumberNew = productDefinitionTemplateNumber; + break; + default: + productDefinitionTemplateNumberNew = productDefinitionTemplateNumber; + break; } - } else { + } + else { /* Going from point-in-time (instantaneous) to continuous or non-continuous interval */ switch (productDefinitionTemplateNumber) { - case 0: - productDefinitionTemplateNumberNew=8; - break; - case 1: - productDefinitionTemplateNumberNew=11; - break; - case 2: - productDefinitionTemplateNumberNew=12; - break; - case 3: - productDefinitionTemplateNumberNew=13; - break; - case 4: - productDefinitionTemplateNumberNew=14; - break; - case 5: - productDefinitionTemplateNumberNew=9; - break; - case 6: - productDefinitionTemplateNumberNew=10; - break; - case 40: /* non-EPS chemical */ - productDefinitionTemplateNumberNew=42; - break; - case 41: /* EPS chemical */ - productDefinitionTemplateNumberNew=43; - break; - case 48: /* non-EPS aerosol. Note template 44 is deprecated */ - productDefinitionTemplateNumberNew=46; - break; - case 45: /* EPS aerosol */ - productDefinitionTemplateNumberNew=47; - break; - case 57: /* non-EPS chemical distrib func */ - productDefinitionTemplateNumberNew=67; - break; - case 58: /* EPS chemical distrib func */ - productDefinitionTemplateNumberNew=68; - break; - case 70: /* non-EPS post-processing */ - productDefinitionTemplateNumberNew=72; - break; - case 71: /* EPS post-processing */ - productDefinitionTemplateNumberNew=73; - break; - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - productDefinitionTemplateNumberNew=productDefinitionTemplateNumber; - break; - default: - productDefinitionTemplateNumberNew=productDefinitionTemplateNumber; - break; + case 0: + productDefinitionTemplateNumberNew = 8; + break; + case 1: + productDefinitionTemplateNumberNew = 11; + break; + case 2: + productDefinitionTemplateNumberNew = 12; + break; + case 3: + productDefinitionTemplateNumberNew = 13; + break; + case 4: + productDefinitionTemplateNumberNew = 14; + break; + case 5: + productDefinitionTemplateNumberNew = 9; + break; + case 6: + productDefinitionTemplateNumberNew = 10; + break; + case 40: /* non-EPS chemical */ + productDefinitionTemplateNumberNew = 42; + break; + case 41: /* EPS chemical */ + productDefinitionTemplateNumberNew = 43; + break; + case 48: /* non-EPS aerosol. Note template 44 is deprecated */ + productDefinitionTemplateNumberNew = 46; + break; + case 45: /* EPS aerosol */ + productDefinitionTemplateNumberNew = 47; + break; + case 57: /* non-EPS chemical distrib func */ + productDefinitionTemplateNumberNew = 67; + break; + case 58: /* EPS chemical distrib func */ + productDefinitionTemplateNumberNew = 68; + break; + case 70: /* non-EPS post-processing */ + productDefinitionTemplateNumberNew = 72; + break; + case 71: /* EPS post-processing */ + productDefinitionTemplateNumberNew = 73; + break; + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + productDefinitionTemplateNumberNew = productDefinitionTemplateNumber; + break; + default: + productDefinitionTemplateNumberNew = productDefinitionTemplateNumber; + break; } } if (productDefinitionTemplateNumber != productDefinitionTemplateNumberNew) - grib_set_long(grib_handle_of_accessor(a), self->productDefinitionTemplateNumber,productDefinitionTemplateNumberNew); + grib_set_long(grib_handle_of_accessor(a), self->productDefinitionTemplateNumber, productDefinitionTemplateNumberNew); return 0; } -static int value_count(grib_accessor* a,long* c) +static int value_count(grib_accessor* a, long* c) { - *c=1; + *c = 1; return 0; } diff --git a/src/grib_accessor_class_sexagesimal2decimal.c b/src/grib_accessor_class_sexagesimal2decimal.c index 8adc25887..495822f0c 100644 --- a/src/grib_accessor_class_sexagesimal2decimal.c +++ b/src/grib_accessor_class_sexagesimal2decimal.c @@ -35,66 +35,67 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int unpack_string (grib_accessor*, char*, size_t *len); +static int get_native_type(grib_accessor*); +static int unpack_string(grib_accessor*, char*, size_t* len); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_sexagesimal2decimal { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in to_double */ - const char* key; - long start; - size_t length; - long scale; -/* Members defined in sexagesimal2decimal */ +typedef struct grib_accessor_sexagesimal2decimal +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in to_double */ + const char* key; + long start; + size_t length; + long scale; + /* Members defined in sexagesimal2decimal */ } grib_accessor_sexagesimal2decimal; extern grib_accessor_class* grib_accessor_class_to_double; static grib_accessor_class _grib_accessor_class_sexagesimal2decimal = { - &grib_accessor_class_to_double, /* super */ - "sexagesimal2decimal", /* name */ - sizeof(grib_accessor_sexagesimal2decimal), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_to_double, /* super */ + "sexagesimal2decimal", /* name */ + sizeof(grib_accessor_sexagesimal2decimal), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -103,156 +104,166 @@ grib_accessor_class* grib_accessor_class_sexagesimal2decimal = &_grib_accessor_c static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len , grib_arguments* arg ) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_double(dumper,a,NULL); + grib_dump_double(dumper, a, NULL); } -static int get_native_type(grib_accessor* a) +static int get_native_type(grib_accessor* a) { return GRIB_TYPE_DOUBLE; } -static int unpack_string(grib_accessor* a, char* val, size_t *len) +static int unpack_string(grib_accessor* a, char* val, size_t* len) { - int err=0; - grib_accessor_sexagesimal2decimal* self=(grib_accessor_sexagesimal2decimal*)a; - char buff[512]={0,}; - size_t length=0; - size_t size=512; + int err = 0; + grib_accessor_sexagesimal2decimal* self = (grib_accessor_sexagesimal2decimal*)a; + char buff[512] = {0,}; + size_t length = 0; + size_t size = 512; char* p; char* q; - double dd,mm=0,ss=0; - int dd_sign=1; - - err=grib_get_string(grib_handle_of_accessor(a),self->key,buff,&size); - if (err) return err; - q=buff+self->start; - if (self->length) q[length]=0; - p=q; + double dd, mm = 0, ss = 0; + int dd_sign = 1; - while ( *p != '-' && *p != ':' && *p != ' ' && *p!=0 ) { p++; } + err = grib_get_string(grib_handle_of_accessor(a), self->key, buff, &size); + if (err) + return err; + q = buff + self->start; + if (self->length) + q[length] = 0; + p = q; - if (*p==0) { return GRIB_WRONG_CONVERSION;} - *p=0; + while (*p != '-' && *p != ':' && *p != ' ' && *p != 0) { + p++; + } - dd=atoi(q); - p++; q=p; - while ( *p != '-' && *p != ':' && *p != ' ' && *p != 'N' - && *p != 'S' && *p != 'E' && *p != 'W' && *p!=0 ) { p++; } - switch (*p) { - case ' ': - case '-': - case ':': - *p=0; - mm=atoi(q) / 60.0; - dd+=mm; - p++; q=p; - break; - case 'N': - case 'E': - *p=0; - dd_sign=1; - mm=atoi(q) / 60.0; - dd+=mm; - p++; q=p; - break; - case 'S': - case 'W': - *p=0; - mm=atoi(q) / 60.0; - dd+=mm; - dd_sign=-1; - p++; q=p; - break; - case 0: - break; - default: + if (*p == 0) { return GRIB_WRONG_CONVERSION; } - if (*p) { - while ( *p != '-' && *p != ':' && *p != ' ' && *p != 'N' - && *p != 'S' && *p != 'E' && *p != 'W' && *p!=0 ) { p++; } - switch (*p) { + *p = 0; + + dd = atoi(q); + p++; + q = p; + while (*p != '-' && *p != ':' && *p != ' ' && *p != 'N' && *p != 'S' && *p != 'E' && *p != 'W' && *p != 0) { + p++; + } + switch (*p) { case ' ': case '-': case ':': - *p=0; - ss=atof(q) / 60.0; - dd+=ss; + *p = 0; + mm = atoi(q) / 60.0; + dd += mm; + p++; + q = p; break; case 'N': case 'E': - *p=0; - ss=atof(q) / 60.0; - dd+=ss; - dd_sign=1; + *p = 0; + dd_sign = 1; + mm = atoi(q) / 60.0; + dd += mm; + p++; + q = p; break; case 'S': case 'W': - *p=0; - ss=atof(q) / 60.0; - dd+=ss; - dd_sign=-1; + *p = 0; + mm = atoi(q) / 60.0; + dd += mm; + dd_sign = -1; + p++; + q = p; break; case 0: break; default: return GRIB_WRONG_CONVERSION; + } + if (*p) { + while (*p != '-' && *p != ':' && *p != ' ' && *p != 'N' && *p != 'S' && *p != 'E' && *p != 'W' && *p != 0) { + p++; + } + switch (*p) { + case ' ': + case '-': + case ':': + *p = 0; + ss = atof(q) / 60.0; + dd += ss; + break; + case 'N': + case 'E': + *p = 0; + ss = atof(q) / 60.0; + dd += ss; + dd_sign = 1; + break; + case 'S': + case 'W': + *p = 0; + ss = atof(q) / 60.0; + dd += ss; + dd_sign = -1; + break; + case 0: + break; + default: + return GRIB_WRONG_CONVERSION; } } - dd *= dd_sign ; + dd *= dd_sign; - sprintf(buff,"%.2f",dd); - length=strlen(buff); + sprintf(buff, "%.2f", dd); + length = strlen(buff); - if( len[0] < length+1 ) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%d) for %s it contains %d values ", len[0], a->name , a->length+1 ); + if (len[0] < length + 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%d) for %s it contains %d values ", len[0], a->name, a->length + 1); len[0] = 0; return GRIB_ARRAY_TOO_SMALL; } - - strcpy(val,buff); + strcpy(val, buff); len[0] = length; return GRIB_SUCCESS; diff --git a/src/grib_accessor_class_signed.c b/src/grib_accessor_class_signed.c index 617f0a878..1fbcab21d 100644 --- a/src/grib_accessor_class_signed.c +++ b/src/grib_accessor_class_signed.c @@ -40,69 +40,70 @@ or edit "accessor.class" and rerun ./make_class.pl */ static int is_missing(grib_accessor*); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); static long byte_count(grib_accessor*); static long byte_offset(grib_accessor*); static long next_offset(grib_accessor*); -static int value_count(grib_accessor*,long*); +static int value_count(grib_accessor*, long*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -static void update_size(grib_accessor*,size_t); - -typedef struct grib_accessor_signed { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in signed */ - grib_arguments* arg; - int nbytes; +static void update_size(grib_accessor*, size_t); + +typedef struct grib_accessor_signed +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in signed */ + grib_arguments* arg; + int nbytes; } grib_accessor_signed; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_signed = { - &grib_accessor_class_long, /* super */ - "signed", /* name */ - sizeof(grib_accessor_signed), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - &next_offset, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - &byte_count, /* get number of bytes */ - &byte_offset, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - &is_missing, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - &update_size, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "signed", /* name */ + sizeof(grib_accessor_signed), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + &next_offset, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + &byte_count, /* get number of bytes */ + &byte_offset, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + &is_missing, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + &update_size, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -111,93 +112,94 @@ grib_accessor_class* grib_accessor_class_signed = &_grib_accessor_class_signed; static void init_class(grib_accessor_class* c) { - c->string_length = (*(c->super))->string_length; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->string_length = (*(c->super))->string_length; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len , grib_arguments* arg ) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { grib_accessor_signed* self = (grib_accessor_signed*)a; - long count=0; + long count = 0; self->arg = arg; - grib_value_count(a,&count); - a->length = len * count; + grib_value_count(a, &count); + a->length = len * count; self->nbytes = len; - Assert(a->length>=0); + Assert(a->length >= 0); } static void dump(grib_accessor* a, grib_dumper* dumper) { long rlen = 0; - grib_value_count(a,&rlen); - if(rlen == 1) - grib_dump_long(dumper,a,NULL); + grib_value_count(a, &rlen); + if (rlen == 1) + grib_dump_long(dumper, a, NULL); else - grib_dump_values(dumper,a); + grib_dump_values(dumper, a); } static const long ones[] = { - 0, - -0x7f, - -0x7fff, - -0x7fffff, - -0x7fffffff, + 0, + -0x7f, + -0x7fff, + -0x7fffff, + -0x7fffffff, }; -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_signed* self = (grib_accessor_signed*)a; - unsigned long rlen = 0; - int err=0; - long count=0; - unsigned long i = 0; - grib_handle* hand=grib_handle_of_accessor(a); - long pos = a->offset; - long missing = 0; - - err=grib_value_count(a,&count); - if (err) return err; - rlen=count; - - if(*len < rlen) { - grib_context_log(a->context, GRIB_LOG_ERROR, " wrong size for %s it contains %d values ", a->name , rlen); + unsigned long rlen = 0; + int err = 0; + long count = 0; + unsigned long i = 0; + grib_handle* hand = grib_handle_of_accessor(a); + long pos = a->offset; + long missing = 0; + + err = grib_value_count(a, &count); + if (err) + return err; + rlen = count; + + if (*len < rlen) { + grib_context_log(a->context, GRIB_LOG_ERROR, " wrong size for %s it contains %d values ", a->name, rlen); *len = 0; return GRIB_ARRAY_TOO_SMALL; } - if(a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) { + if (a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) { Assert(self->nbytes <= 4); missing = ones[self->nbytes]; } - for(i=0; i< rlen;i++){ - val[i] = (long)grib_decode_signed_long(hand->buffer->data , pos, self->nbytes); - if(missing) - if(val[i] == missing) + for (i = 0; i < rlen; i++) { + val[i] = (long)grib_decode_signed_long(hand->buffer->data, pos, self->nbytes); + if (missing) + if (val[i] == missing) val[i] = GRIB_MISSING_LONG; pos += self->nbytes; } @@ -206,66 +208,69 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) return GRIB_SUCCESS; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { grib_accessor_signed* self = (grib_accessor_signed*)a; - int ret = 0; - long off = 0; - unsigned long rlen = 0; - int err=0; - long count=0; - size_t buflen = 0; - unsigned char *buf = NULL; - unsigned long i = 0; - long missing = 0; - - err=grib_value_count(a,&count); - if (err) return err; - rlen=count; - - if(*len < 1) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name , 1 ); + int ret = 0; + long off = 0; + unsigned long rlen = 0; + int err = 0; + long count = 0; + size_t buflen = 0; + unsigned char* buf = NULL; + unsigned long i = 0; + long missing = 0; + + err = grib_value_count(a, &count); + if (err) + return err; + rlen = count; + + if (*len < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); len[0] = 0; return GRIB_ARRAY_TOO_SMALL; } - if(a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) { + if (a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) { Assert(self->nbytes <= 4); missing = ones[self->nbytes]; } if (rlen == 1) { long v = val[0]; - if(missing) - if(v == GRIB_MISSING_LONG) + if (missing) + if (v == GRIB_MISSING_LONG) v = missing; off = a->offset; - ret = grib_encode_signed_long(grib_handle_of_accessor(a)->buffer->data, v , off, a->length); - if (ret == GRIB_SUCCESS) len[0] = 1; - if (*len > 1) grib_context_log(a->context, GRIB_LOG_WARNING, "grib_accessor_signed : Trying to pack %d values in a scalar %s, packing first value", *len, a->name ); + ret = grib_encode_signed_long(grib_handle_of_accessor(a)->buffer->data, v, off, a->length); + if (ret == GRIB_SUCCESS) + len[0] = 1; + if (*len > 1) + grib_context_log(a->context, GRIB_LOG_WARNING, "grib_accessor_signed : Trying to pack %d values in a scalar %s, packing first value", *len, a->name); len[0] = 1; return ret; } /* TODO: We assume that there are no missing values if there are more that 1 value */ - buflen = *len*a->length; + buflen = *len * a->length; - buf = (unsigned char*)grib_context_malloc(a->context,buflen); + buf = (unsigned char*)grib_context_malloc(a->context, buflen); - for(i=0; i < *len;i++) { - grib_encode_signed_long(buf, val[i] , off, a->length); - off+= a->length; + for (i = 0; i < *len; i++) { + grib_encode_signed_long(buf, val[i], off, a->length); + off += a->length; } - ret = grib_set_long_internal(grib_handle_of_accessor(a),grib_arguments_get_name(a->parent->h,self->arg,0),*len); + ret = grib_set_long_internal(grib_handle_of_accessor(a), grib_arguments_get_name(a->parent->h, self->arg, 0), *len); - if(ret == GRIB_SUCCESS) - grib_buffer_replace(a, buf, buflen,1,1); + if (ret == GRIB_SUCCESS) + grib_buffer_replace(a, buf, buflen, 1, 1); else *len = 0; - grib_context_free(a->context,buf); + grib_context_free(a->context, buf); return ret; } @@ -274,12 +279,15 @@ static long byte_count(grib_accessor* a) return a->length; } -static int value_count(grib_accessor* a,long* len) +static int value_count(grib_accessor* a, long* len) { grib_accessor_signed* self = (grib_accessor_signed*)a; - *len = 0; - if(!self->arg) {*len=1;return 0;} - return grib_get_long_internal(grib_handle_of_accessor(a),grib_arguments_get_name(a->parent->h,self->arg,0),len); + *len = 0; + if (!self->arg) { + *len = 1; + return 0; + } + return grib_get_long_internal(grib_handle_of_accessor(a), grib_arguments_get_name(a->parent->h, self->arg, 0), len); } static long byte_offset(grib_accessor* a) @@ -287,31 +295,32 @@ static long byte_offset(grib_accessor* a) return a->offset; } -static void update_size(grib_accessor* a,size_t s) +static void update_size(grib_accessor* a, size_t s) { a->length = s; - Assert(a->length>=0); + Assert(a->length >= 0); } static long next_offset(grib_accessor* a) { - return grib_byte_offset(a)+grib_byte_count(a); + return grib_byte_offset(a) + grib_byte_count(a); } static int is_missing(grib_accessor* a) { - int i=0; - unsigned char ff=0xff; - unsigned long offset=a->offset; - grib_handle* hand=grib_handle_of_accessor(a); + int i = 0; + unsigned char ff = 0xff; + unsigned long offset = a->offset; + grib_handle* hand = grib_handle_of_accessor(a); - if (a->length==0) { - Assert(a->vvalue!=NULL); + if (a->length == 0) { + Assert(a->vvalue != NULL); return a->vvalue->missing; } - for (i=0;ilength;i++) { - if (hand->buffer->data[offset] != ff) return 0; + for (i = 0; i < a->length; i++) { + if (hand->buffer->data[offset] != ff) + return 0; offset++; } diff --git a/src/grib_accessor_class_signed_bits.c b/src/grib_accessor_class_signed_bits.c index 2513441ea..936ab274d 100644 --- a/src/grib_accessor_class_signed_bits.c +++ b/src/grib_accessor_class_signed_bits.c @@ -39,69 +39,70 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); static long byte_count(grib_accessor*); static long byte_offset(grib_accessor*); static long next_offset(grib_accessor*); -static int value_count(grib_accessor*,long*); +static int value_count(grib_accessor*, long*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -static void update_size(grib_accessor*,size_t); - -typedef struct grib_accessor_signed_bits { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in signed_bits */ - const char* numberOfBits; - const char* numberOfElements; +static void update_size(grib_accessor*, size_t); + +typedef struct grib_accessor_signed_bits +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in signed_bits */ + const char* numberOfBits; + const char* numberOfElements; } grib_accessor_signed_bits; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_signed_bits = { - &grib_accessor_class_long, /* super */ - "signed_bits", /* name */ - sizeof(grib_accessor_signed_bits), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - &next_offset, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - &byte_count, /* get number of bytes */ - &byte_offset, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - &update_size, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "signed_bits", /* name */ + sizeof(grib_accessor_signed_bits), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + &next_offset, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + &byte_count, /* get number of bytes */ + &byte_offset, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + &update_size, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -110,153 +111,160 @@ grib_accessor_class* grib_accessor_class_signed_bits = &_grib_accessor_class_sig static void init_class(grib_accessor_class* c) { - c->string_length = (*(c->super))->string_length; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->string_length = (*(c->super))->string_length; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static long byte_count(grib_accessor* a){ +static long byte_count(grib_accessor* a) +{ return a->length; } -static long compute_byte_count(grib_accessor* a){ +static long compute_byte_count(grib_accessor* a) +{ grib_accessor_signed_bits* self = (grib_accessor_signed_bits*)a; long numberOfBits; long numberOfElements; - int ret=0; + int ret = 0; - ret=grib_get_long(grib_handle_of_accessor(a),self->numberOfBits,&numberOfBits); + ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfBits, &numberOfBits); if (ret) { - grib_context_log(a->context,GRIB_LOG_ERROR, - "%s unable to get %s to compute size",a->name,self->numberOfBits); + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s unable to get %s to compute size", a->name, self->numberOfBits); return 0; } - ret=grib_get_long(grib_handle_of_accessor(a),self->numberOfElements,&numberOfElements); + ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfElements, &numberOfElements); if (ret) { - grib_context_log(a->context,GRIB_LOG_ERROR, - "%s unable to get %s to compute size",a->name,self->numberOfElements); + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s unable to get %s to compute size", a->name, self->numberOfElements); return 0; } - return (numberOfBits*numberOfElements+7)/8; + return (numberOfBits * numberOfElements + 7) / 8; } -static void init(grib_accessor* a, const long len , grib_arguments* args ) +static void init(grib_accessor* a, const long len, grib_arguments* args) { grib_accessor_signed_bits* self = (grib_accessor_signed_bits*)a; - int n=0; - self->numberOfBits=grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->numberOfElements=grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - a->length = compute_byte_count(a); + int n = 0; + self->numberOfBits = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->numberOfElements = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + a->length = compute_byte_count(a); } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_long(dumper,a,NULL); + grib_dump_long(dumper, a, NULL); } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_signed_bits* self = (grib_accessor_signed_bits*)a; int i; - int ret=0; - long pos = a->offset*8; - long rlen = 0; + int ret = 0; + long pos = a->offset * 8; + long rlen = 0; long numberOfBits = 0; - ret=value_count(a,&rlen); - if (ret) return ret; + ret = value_count(a, &rlen); + if (ret) + return ret; - if(*len < rlen) - { + if (*len < rlen) { grib_context_log(a->context, GRIB_LOG_ERROR, - " wrong size (%ld) for %s it contains %d values ",*len, a->name , rlen); + " wrong size (%ld) for %s it contains %d values ", *len, a->name, rlen); *len = 0; return GRIB_ARRAY_TOO_SMALL; } - ret=grib_get_long(grib_handle_of_accessor(a),self->numberOfBits,&numberOfBits); - if (ret) return ret; + ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfBits, &numberOfBits); + if (ret) + return ret; - if (numberOfBits==0) { - for (i=0;ibuffer->data, &pos, numberOfBits); + for (i = 0; i < rlen; i++) + val[i] = grib_decode_signed_longb(grib_handle_of_accessor(a)->buffer->data, &pos, numberOfBits); *len = rlen; return GRIB_SUCCESS; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { grib_accessor_signed_bits* self = (grib_accessor_signed_bits*)a; - int ret = 0; - long off = 0; - long numberOfBits=0; - size_t buflen = 0; - unsigned char *buf = NULL; - unsigned long i = 0; - unsigned long rlen = 0; - long count=0; - - ret=value_count(a,&count); - if (ret) return ret; - rlen=count; - if(*len != rlen) { - ret=grib_set_long(grib_handle_of_accessor(a),self->numberOfElements,rlen); - if (ret) return ret; + int ret = 0; + long off = 0; + long numberOfBits = 0; + size_t buflen = 0; + unsigned char* buf = NULL; + unsigned long i = 0; + unsigned long rlen = 0; + long count = 0; + + ret = value_count(a, &count); + if (ret) + return ret; + rlen = count; + if (*len != rlen) { + ret = grib_set_long(grib_handle_of_accessor(a), self->numberOfElements, rlen); + if (ret) + return ret; } - ret=grib_get_long(grib_handle_of_accessor(a),self->numberOfBits,&numberOfBits); - if (ret) return ret; + ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfBits, &numberOfBits); + if (ret) + return ret; buflen = compute_byte_count(a); - buf = (unsigned char*)grib_context_malloc_clear(a->context,buflen+sizeof(long)); + buf = (unsigned char*)grib_context_malloc_clear(a->context, buflen + sizeof(long)); - for(i=0; i < rlen;i++) - grib_encode_signed_longb(buf, val[i] , &off, numberOfBits); + for (i = 0; i < rlen; i++) + grib_encode_signed_longb(buf, val[i], &off, numberOfBits); - grib_buffer_replace(a, buf, buflen,1,1); + grib_buffer_replace(a, buf, buflen, 1, 1); - grib_context_free(a->context,buf); + grib_context_free(a->context, buf); return ret; } -static int value_count(grib_accessor* a,long* numberOfElements) +static int value_count(grib_accessor* a, long* numberOfElements) { grib_accessor_signed_bits* self = (grib_accessor_signed_bits*)a; - *numberOfElements=0; + *numberOfElements = 0; - return grib_get_long(grib_handle_of_accessor(a),self->numberOfElements,numberOfElements); + return grib_get_long(grib_handle_of_accessor(a), self->numberOfElements, numberOfElements); } static long byte_offset(grib_accessor* a) @@ -264,12 +272,12 @@ static long byte_offset(grib_accessor* a) return a->offset; } -static void update_size(grib_accessor* a,size_t s) +static void update_size(grib_accessor* a, size_t s) { a->length = s; } static long next_offset(grib_accessor* a) { - return byte_offset(a)+byte_count(a); + return byte_offset(a) + byte_count(a); } diff --git a/src/grib_accessor_class_simple_packing_error.c b/src/grib_accessor_class_simple_packing_error.c index deb1f3e08..eb9afc758 100644 --- a/src/grib_accessor_class_simple_packing_error.c +++ b/src/grib_accessor_class_simple_packing_error.c @@ -41,65 +41,66 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_double(grib_accessor*, double* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_simple_packing_error { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in double */ -/* Members defined in simple_packing_error */ - const char* binaryScaleFactor; - const char* bitsPerValue; - const char* decimalScaleFactor; - const char* referenceValue; - const char* floatType; +typedef struct grib_accessor_simple_packing_error +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in double */ + /* Members defined in simple_packing_error */ + const char* binaryScaleFactor; + const char* bitsPerValue; + const char* decimalScaleFactor; + const char* referenceValue; + const char* floatType; } grib_accessor_simple_packing_error; extern grib_accessor_class* grib_accessor_class_double; static grib_accessor_class _grib_accessor_class_simple_packing_error = { - &grib_accessor_class_double, /* super */ - "simple_packing_error", /* name */ - sizeof(grib_accessor_simple_packing_error), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_double, /* super */ + "simple_packing_error", /* name */ + sizeof(grib_accessor_simple_packing_error), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -108,90 +109,92 @@ grib_accessor_class* grib_accessor_class_simple_packing_error = &_grib_accessor_ static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_simple_packing_error* self = (grib_accessor_simple_packing_error*)a; - int n = 0; + int n = 0; - self->bitsPerValue = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->binaryScaleFactor = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->decimalScaleFactor = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->referenceValue = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->floatType = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); + self->bitsPerValue = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->binaryScaleFactor = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->decimalScaleFactor = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->referenceValue = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->floatType = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->length=0; + a->length = 0; } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { grib_accessor_simple_packing_error* self = (grib_accessor_simple_packing_error*)a; - int ret = 0; - long binaryScaleFactor=0; - long bitsPerValue=0; - long decimalScaleFactor=0; - double referenceValue=0; - - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), - self->binaryScaleFactor,&binaryScaleFactor)) != GRIB_SUCCESS) + int ret = 0; + long binaryScaleFactor = 0; + long bitsPerValue = 0; + long decimalScaleFactor = 0; + double referenceValue = 0; + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), + self->binaryScaleFactor, &binaryScaleFactor)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), - self->bitsPerValue,&bitsPerValue)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), + self->bitsPerValue, &bitsPerValue)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), - self->decimalScaleFactor,&decimalScaleFactor)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), + self->decimalScaleFactor, &decimalScaleFactor)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_double_internal(grib_handle_of_accessor(a), - self->referenceValue,&referenceValue)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(grib_handle_of_accessor(a), + self->referenceValue, &referenceValue)) != GRIB_SUCCESS) return ret; - if (!strcmp(self->floatType,"ibm")) - *val=grib_ibmfloat_error(referenceValue); - else if (!strcmp(self->floatType,"ieee")) - *val=grib_ieeefloat_error(referenceValue); - else Assert(1==0); + if (!strcmp(self->floatType, "ibm")) + *val = grib_ibmfloat_error(referenceValue); + else if (!strcmp(self->floatType, "ieee")) + *val = grib_ieeefloat_error(referenceValue); + else + Assert(1 == 0); - if (bitsPerValue!=0) - *val=(*val+grib_power(binaryScaleFactor,2))*grib_power(-decimalScaleFactor,10)*0.5; + if (bitsPerValue != 0) + *val = (*val + grib_power(binaryScaleFactor, 2)) * grib_power(-decimalScaleFactor, 10) * 0.5; - if (ret == GRIB_SUCCESS) *len = 1; + if (ret == GRIB_SUCCESS) + *len = 1; return ret; } diff --git a/src/grib_accessor_class_size.c b/src/grib_accessor_class_size.c index c495c8993..a45e18720 100644 --- a/src/grib_accessor_class_size.c +++ b/src/grib_accessor_class_size.c @@ -31,61 +31,62 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_long(grib_accessor*, long* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_size { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in size */ - const char* accessor; +typedef struct grib_accessor_size +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in size */ + const char* accessor; } grib_accessor_size; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_size = { - &grib_accessor_class_long, /* super */ - "size", /* name */ - sizeof(grib_accessor_size), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "size", /* name */ + sizeof(grib_accessor_size), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -94,57 +95,57 @@ grib_accessor_class* grib_accessor_class_size = &_grib_accessor_class_size; static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_size* self = (grib_accessor_size*)a; - self->accessor = grib_arguments_get_name(grib_handle_of_accessor(a),c,0); - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + self->accessor = grib_arguments_get_name(grib_handle_of_accessor(a), c, 0); + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; - a->length=0; + a->length = 0; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - int ret=0; - size_t size=0; + int ret = 0; + size_t size = 0; grib_accessor_size* self = (grib_accessor_size*)a; - ret=grib_get_size(grib_handle_of_accessor(a),self->accessor,&size); - *val=(long)size; - *len =1; + ret = grib_get_size(grib_handle_of_accessor(a), self->accessor, &size); + *val = (long)size; + *len = 1; return ret; } diff --git a/src/grib_accessor_class_smart_table.c b/src/grib_accessor_class_smart_table.c index 26ce44402..5addbdef8 100644 --- a/src/grib_accessor_class_smart_table.c +++ b/src/grib_accessor_class_smart_table.c @@ -48,79 +48,80 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); -static int value_count(grib_accessor*,long*); -static void destroy(grib_context*,grib_accessor*); +static int get_native_type(grib_accessor*); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); +static int value_count(grib_accessor*, long*); +static void destroy(grib_context*, grib_accessor*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_smart_table { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in unsigned */ - long nbytes; - grib_arguments* arg; -/* Members defined in smart_table */ - const char* values; - const char* tablename; - const char* masterDir; - const char* localDir; - const char* extraDir; - const char* extraTable; - int widthOfCode; - long* tableCodes; - size_t tableCodesSize; - grib_smart_table* table; - int dirty; +typedef struct grib_accessor_smart_table +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in unsigned */ + long nbytes; + grib_arguments* arg; + /* Members defined in smart_table */ + const char* values; + const char* tablename; + const char* masterDir; + const char* localDir; + const char* extraDir; + const char* extraTable; + int widthOfCode; + long* tableCodes; + size_t tableCodesSize; + grib_smart_table* table; + int dirty; } grib_accessor_smart_table; extern grib_accessor_class* grib_accessor_class_unsigned; static grib_accessor_class _grib_accessor_class_smart_table = { - &grib_accessor_class_unsigned, /* super */ - "smart_table", /* name */ - sizeof(grib_accessor_smart_table), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_unsigned, /* super */ + "smart_table", /* name */ + sizeof(grib_accessor_smart_table), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + &destroy, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -129,46 +130,47 @@ grib_accessor_class* grib_accessor_class_smart_table = &_grib_accessor_class_sma static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ #if GRIB_PTHREADS -static pthread_once_t once = PTHREAD_ONCE_INIT; +static pthread_once_t once = PTHREAD_ONCE_INIT; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; -static void thread_init() { +static void thread_init() +{ pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); - pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init(&mutex,&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&mutex, &attr); pthread_mutexattr_destroy(&attr); } #elif GRIB_OMP_THREADS @@ -179,8 +181,7 @@ static void thread_init() { GRIB_OMP_CRITICAL(lock_grib_accessor_class_smart_table_c) { - if (once == 0) - { + if (once == 0) { omp_init_nest_lock(&mutex); once = 1; } @@ -188,196 +189,206 @@ static void thread_init() } #endif -static int grib_load_smart_table(grib_context* c,const char* filename, - const char* recomposed_name,size_t size,grib_smart_table* t); +static int grib_load_smart_table(grib_context* c, const char* filename, + const char* recomposed_name, size_t size, grib_smart_table* t); static void init(grib_accessor* a, const long len, grib_arguments* params) { - int n=0; - grib_accessor_smart_table* self = (grib_accessor_smart_table*)a; - grib_handle* hand = grib_handle_of_accessor(a); - - self->values = grib_arguments_get_name(hand,params,n++); - self->tablename = grib_arguments_get_string(hand,params,n++); - self->masterDir = grib_arguments_get_name(hand,params,n++); - self->localDir = grib_arguments_get_name(hand,params,n++); - self->widthOfCode = grib_arguments_get_long(hand,params,n++); - self->extraDir = grib_arguments_get_name(hand,params,n++); - self->extraTable = grib_arguments_get_string(hand,params,n++); + int n = 0; + grib_accessor_smart_table* self = (grib_accessor_smart_table*)a; + grib_handle* hand = grib_handle_of_accessor(a); + + self->values = grib_arguments_get_name(hand, params, n++); + self->tablename = grib_arguments_get_string(hand, params, n++); + self->masterDir = grib_arguments_get_name(hand, params, n++); + self->localDir = grib_arguments_get_name(hand, params, n++); + self->widthOfCode = grib_arguments_get_long(hand, params, n++); + self->extraDir = grib_arguments_get_name(hand, params, n++); + self->extraTable = grib_arguments_get_string(hand, params, n++); a->length = 0; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - self->dirty=1; - self->tableCodesSize=0; - self->tableCodes=0; + self->dirty = 1; + self->tableCodesSize = 0; + self->tableCodes = 0; } static grib_smart_table* load_table(grib_accessor_smart_table* self) { - size_t size = 0; - grib_handle* h = ((grib_accessor*)self)->parent->h; - grib_context* c = h->context; - grib_smart_table* t = NULL; - grib_smart_table* next=NULL ; - char *filename=0; - char name[2048]={0,}; - char recomposed[1024]={0,}; - char localRecomposed[1024]={0,}; - char *localFilename=0; - char extraRecomposed[1024]={0,}; - char *extraFilename=0; - char localName[2048]={0,}; - char masterDir[1024]={0,}; - char localDir[1024]={0,}; - char extraDir[1024]={0,}; - char extraTable[2048]={0,}; - size_t len=1024; + size_t size = 0; + grib_handle* h = ((grib_accessor*)self)->parent->h; + grib_context* c = h->context; + grib_smart_table* t = NULL; + grib_smart_table* next = NULL; + char* filename = 0; + char name[2048] = {0,}; + char recomposed[1024] = {0,}; + char localRecomposed[1024] = {0,}; + char* localFilename = 0; + char extraRecomposed[1024] = {0,}; + char* extraFilename = 0; + char localName[2048] = {0,}; + char masterDir[1024] = {0,}; + char localDir[1024] = {0,}; + char extraDir[1024] = {0,}; + char extraTable[2048] = {0,}; + size_t len = 1024; if (self->masterDir != NULL) { - grib_get_string(h,self->masterDir,masterDir,&len); + grib_get_string(h, self->masterDir, masterDir, &len); } - len=1024; + len = 1024; if (self->localDir != NULL) { - grib_get_string(h,self->localDir,localDir,&len); + grib_get_string(h, self->localDir, localDir, &len); } - len=1024; - if (self->extraDir != NULL && self->extraTable!=NULL) { - grib_get_string(h,self->extraDir,extraDir,&len); + len = 1024; + if (self->extraDir != NULL && self->extraTable != NULL) { + grib_get_string(h, self->extraDir, extraDir, &len); } - if (*masterDir!=0) { - sprintf(name,"%s/%s",masterDir,self->tablename); - grib_recompose_name(h, NULL,name, recomposed,0); - filename=grib_context_full_defs_path(c,recomposed); - } else { - grib_recompose_name(h, NULL,self->tablename, recomposed,0); - filename=grib_context_full_defs_path(c,recomposed); + if (*masterDir != 0) { + sprintf(name, "%s/%s", masterDir, self->tablename); + grib_recompose_name(h, NULL, name, recomposed, 0); + filename = grib_context_full_defs_path(c, recomposed); + } + else { + grib_recompose_name(h, NULL, self->tablename, recomposed, 0); + filename = grib_context_full_defs_path(c, recomposed); } - if (*localDir!=0) { - sprintf(localName,"%s/%s",localDir,self->tablename); - grib_recompose_name(h, NULL,localName, localRecomposed,0); - localFilename=grib_context_full_defs_path(c,localRecomposed); + if (*localDir != 0) { + sprintf(localName, "%s/%s", localDir, self->tablename); + grib_recompose_name(h, NULL, localName, localRecomposed, 0); + localFilename = grib_context_full_defs_path(c, localRecomposed); } - if (*extraDir!=0) { - sprintf(extraTable,"%s/%s",extraDir,self->extraTable); - grib_recompose_name(h, NULL,extraTable, extraRecomposed,0); - extraFilename=grib_context_full_defs_path(c,extraRecomposed); + if (*extraDir != 0) { + sprintf(extraTable, "%s/%s", extraDir, self->extraTable); + grib_recompose_name(h, NULL, extraTable, extraRecomposed, 0); + extraFilename = grib_context_full_defs_path(c, extraRecomposed); } - next=c->smart_table; - while(next) { - if((filename && next->filename[0] && strcmp(filename,next->filename[0]) == 0) && - ((localFilename==0 && next->filename[1]==NULL) || - ((localFilename!=0 && next->filename[1]!=NULL) - && strcmp(localFilename,next->filename[1]) ==0)) && - ((extraFilename==0 && next->filename[2]==NULL) || - ((extraFilename!=0 && next->filename[2]!=NULL) - && strcmp(extraFilename,next->filename[2]) ==0)) ) + next = c->smart_table; + while (next) { + if ((filename && next->filename[0] && strcmp(filename, next->filename[0]) == 0) && + ((localFilename == 0 && next->filename[1] == NULL) || + ((localFilename != 0 && next->filename[1] != NULL) && strcmp(localFilename, next->filename[1]) == 0)) && + ((extraFilename == 0 && next->filename[2] == NULL) || + ((extraFilename != 0 && next->filename[2] != NULL) && strcmp(extraFilename, next->filename[2]) == 0))) return next; next = next->next; } size = (1UL << self->widthOfCode); /* 2 ^ self->widthOfCode */ - t = (grib_smart_table*)grib_context_malloc_clear_persistent(c,sizeof(grib_smart_table)); - t->entries=(grib_smart_table_entry*)grib_context_malloc_clear_persistent(c,size*sizeof(grib_smart_table_entry)); - t->numberOfEntries=size; + t = (grib_smart_table*)grib_context_malloc_clear_persistent(c, sizeof(grib_smart_table)); + t->entries = (grib_smart_table_entry*)grib_context_malloc_clear_persistent(c, size * sizeof(grib_smart_table_entry)); + t->numberOfEntries = size; - if (filename!=0) grib_load_smart_table(c,filename,recomposed,size,t); + if (filename != 0) + grib_load_smart_table(c, filename, recomposed, size, t); - if (localFilename!=0) grib_load_smart_table(c,localFilename,localRecomposed,size,t); + if (localFilename != 0) + grib_load_smart_table(c, localFilename, localRecomposed, size, t); - if (extraFilename!=0) grib_load_smart_table(c,extraFilename,extraRecomposed,size,t); + if (extraFilename != 0) + grib_load_smart_table(c, extraFilename, extraRecomposed, size, t); - if (t->filename[0]==NULL && t->filename[1]==NULL) { - grib_context_free_persistent(c,t); + if (t->filename[0] == NULL && t->filename[1] == NULL) { + grib_context_free_persistent(c, t); return NULL; } return t; } -static int grib_load_smart_table(grib_context* c,const char* filename, - const char* recomposed_name,size_t size,grib_smart_table* t) +static int grib_load_smart_table(grib_context* c, const char* filename, + const char* recomposed_name, size_t size, grib_smart_table* t) { - char line[1024]={0,}; - FILE *f = NULL; + char line[1024] = {0,}; + FILE* f = NULL; int lineNumber; int numberOfColumns; int code; - grib_context_log(c,GRIB_LOG_DEBUG,"Loading code table form %s",filename); + grib_context_log(c, GRIB_LOG_DEBUG, "Loading code table form %s", filename); - f=codes_fopen(filename, "r"); - if (!f) return GRIB_IO_PROBLEM; + f = codes_fopen(filename, "r"); + if (!f) + return GRIB_IO_PROBLEM; - Assert(t!=NULL); + Assert(t != NULL); - if (t->filename[0] == NULL ){ - t->filename[0] = grib_context_strdup_persistent(c,filename); - t->recomposed_name[0] = grib_context_strdup_persistent(c,recomposed_name); - t->next = c->smart_table; - t->numberOfEntries = size; - GRIB_MUTEX_INIT_ONCE(&once,&thread_init) + if (t->filename[0] == NULL) { + t->filename[0] = grib_context_strdup_persistent(c, filename); + t->recomposed_name[0] = grib_context_strdup_persistent(c, recomposed_name); + t->next = c->smart_table; + t->numberOfEntries = size; + GRIB_MUTEX_INIT_ONCE(&once, &thread_init) GRIB_MUTEX_LOCK(&mutex) c->smart_table = t; GRIB_MUTEX_UNLOCK(&mutex) - } else if (t->filename[1] == NULL ){ - t->filename[1] = grib_context_strdup_persistent(c,filename); - t->recomposed_name[1] = grib_context_strdup_persistent(c,recomposed_name); - } else { - t->filename[2] = grib_context_strdup_persistent(c,filename); - t->recomposed_name[2] = grib_context_strdup_persistent(c,recomposed_name); + } + else if (t->filename[1] == NULL) { + t->filename[1] = grib_context_strdup_persistent(c, filename); + t->recomposed_name[1] = grib_context_strdup_persistent(c, recomposed_name); + } + else { + t->filename[2] = grib_context_strdup_persistent(c, filename); + t->recomposed_name[2] = grib_context_strdup_persistent(c, recomposed_name); } lineNumber = 0; - while(fgets(line,sizeof(line)-1,f)) - { - char* s=line; + while (fgets(line, sizeof(line) - 1, f)) { + char* s = line; char* p; - line[strlen(line)-1]=0; + line[strlen(line) - 1] = 0; ++lineNumber; - while(*s != '\0' && isspace(*s)) s++; + while (*s != '\0' && isspace(*s)) + s++; - if(*s == '#') continue; + if (*s == '#') + continue; - p=s; - while(*p != '\0' && *p!='|' ) p++; + p = s; + while (*p != '\0' && *p != '|') + p++; if (!p) { - grib_context_log(c,GRIB_LOG_ERROR, "Invalid entry in file %s: line %d", filename, lineNumber); + grib_context_log(c, GRIB_LOG_ERROR, "Invalid entry in file %s: line %d", filename, lineNumber); continue; /* skip this line */ } - *p=0; + *p = 0; - code=atol(s); + code = atol(s); - p++; s=p; - while(*p != '\0' && *p!='|' ) p++; + p++; + s = p; + while (*p != '\0' && *p != '|') + p++; if (!p) { - grib_context_log(c,GRIB_LOG_ERROR, "Invalid entry in file %s: line %d", filename, lineNumber); + grib_context_log(c, GRIB_LOG_ERROR, "Invalid entry in file %s: line %d", filename, lineNumber); continue; /* skip this line */ } - *p=0; + *p = 0; - numberOfColumns=0; + numberOfColumns = 0; while (*s) { - - t->entries[code].column[numberOfColumns]=grib_context_strdup_persistent(c,s); + t->entries[code].column[numberOfColumns] = grib_context_strdup_persistent(c, s); numberOfColumns++; - Assert(numberOfColumnssmart_table; - while(t) - { + while (t) { grib_smart_table* s = t->next; int i; int k; - for(i = 0; i < t->numberOfEntries; i++) - { - grib_context_free_persistent(c,t->entries[i].abbreviation); - for (k=0;knumberOfEntries; i++) { + grib_context_free_persistent(c, t->entries[i].abbreviation); + for (k = 0; k < MAX_SMART_TABLE_COLUMNS; k++) { if (t->entries[i].column[k]) - grib_context_free_persistent(c,t->entries[i].column[k]); + grib_context_free_persistent(c, t->entries[i].column[k]); } - grib_context_free_persistent(c,&(t->entries[i])); + grib_context_free_persistent(c, &(t->entries[i])); } - grib_context_free_persistent(c,t->filename[0]); - if(t->filename[1]) - grib_context_free_persistent(c,t->filename[1]); - grib_context_free_persistent(c,t->recomposed_name[0]); + grib_context_free_persistent(c, t->filename[0]); + if (t->filename[1]) + grib_context_free_persistent(c, t->filename[1]); + grib_context_free_persistent(c, t->recomposed_name[0]); if (t->recomposed_name[1]) - grib_context_free_persistent(c,t->recomposed_name[1]); - grib_context_free_persistent(c,t); + grib_context_free_persistent(c, t->recomposed_name[1]); + grib_context_free_persistent(c, t); t = s; } } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_long(dumper,a,NULL); + grib_dump_long(dumper, a, NULL); } -static int unpack_string (grib_accessor* a, char* buffer, size_t *len) +static int unpack_string(grib_accessor* a, char* buffer, size_t* len) { grib_accessor_smart_table* self = (grib_accessor_smart_table*)a; - grib_smart_table* table = NULL; + grib_smart_table* table = NULL; size_t size = 1; - long value; + long value; int err = GRIB_SUCCESS; char tmp[1024]; size_t l = 0; - if( (err = grib_unpack_long(a,&value,&size)) != GRIB_SUCCESS) + if ((err = grib_unpack_long(a, &value, &size)) != GRIB_SUCCESS) return err; - if(!self->table) self->table = load_table(self); - table=self->table; + if (!self->table) + self->table = load_table(self); + table = self->table; - if(table && (value >= 0) && (value < table->numberOfEntries) && table->entries[value].abbreviation) - { - strcpy(tmp,table->entries[value].abbreviation); + if (table && (value >= 0) && (value < table->numberOfEntries) && table->entries[value].abbreviation) { + strcpy(tmp, table->entries[value].abbreviation); } - else - { - sprintf(tmp,"%d",(int)value); + else { + sprintf(tmp, "%d", (int)value); } l = strlen(tmp) + 1; - if(*len < l) - { + if (*len < l) { *len = l; return GRIB_BUFFER_TOO_SMALL; } - strcpy(buffer,tmp); - *len = l; - self->dirty=0; + strcpy(buffer, tmp); + *len = l; + self->dirty = 0; return GRIB_SUCCESS; } @@ -463,98 +470,107 @@ static int unpack_string (grib_accessor* a, char* buffer, size_t *len) static int get_table_codes(grib_accessor* a) { grib_accessor_smart_table* self = (grib_accessor_smart_table*)a; - size_t size=0; - long *v=0; - int err=0; - int count,j; + size_t size = 0; + long* v = 0; + int err = 0; + int count, j; size_t i; int table_size; - if (!self->dirty) return 0; + if (!self->dirty) + return 0; table_size = (1 << self->widthOfCode); /* 2 ^ self->widthOfCode */ - if(!self->table) + if (!self->table) self->table = load_table(self); - err=grib_get_size(grib_handle_of_accessor(a),self->values,&size); + err = grib_get_size(grib_handle_of_accessor(a), self->values, &size); if (err) { - grib_context_log(a->context,GRIB_LOG_ERROR, - "unable to get size of %s",a->name); + grib_context_log(a->context, GRIB_LOG_ERROR, + "unable to get size of %s", a->name); return err; } - v=(long*)grib_context_malloc_clear(a->context,size*sizeof(long)); + v = (long*)grib_context_malloc_clear(a->context, size * sizeof(long)); - grib_get_long_array(grib_handle_of_accessor(a),self->values,v,&size); + grib_get_long_array(grib_handle_of_accessor(a), self->values, v, &size); - count=0; - for (i=0;itableCodes) grib_context_free(a->context,self->tableCodes); - self->tableCodes=(long*)grib_context_malloc_clear(a->context,count*sizeof(long)); - j=0; - for (i=0;itableCodes[j++]=v[i]; + if (self->tableCodes) + grib_context_free(a->context, self->tableCodes); + self->tableCodes = (long*)grib_context_malloc_clear(a->context, count * sizeof(long)); + j = 0; + for (i = 0; i < size; i++) { + if (v[i] < table_size) + self->tableCodes[j++] = v[i]; } - grib_context_free(a->context,v); + grib_context_free(a->context, v); - self->tableCodesSize=count; - self->dirty=0; + self->tableCodesSize = count; + self->dirty = 0; return 0; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - int err=0; + int err = 0; grib_accessor_smart_table* self = (grib_accessor_smart_table*)a; - *count=0; + *count = 0; - if (!self->values) return 0; - err=get_table_codes(a); - if (err) return err; + if (!self->values) + return 0; + err = get_table_codes(a); + if (err) + return err; - *count=self->tableCodesSize; + *count = self->tableCodesSize; return err; } -static void destroy(grib_context* context,grib_accessor* a) +static void destroy(grib_context* context, grib_accessor* a) { grib_accessor_smart_table* self = (grib_accessor_smart_table*)a; if (a->vvalue != NULL) { grib_context_free(context, a->vvalue); - a->vvalue=NULL; + a->vvalue = NULL; } - if (self->tableCodes) grib_context_free(a->context,self->tableCodes); - + if (self->tableCodes) + grib_context_free(a->context, self->tableCodes); } -static int get_native_type(grib_accessor* a) +static int get_native_type(grib_accessor* a) { - int type=GRIB_TYPE_LONG; + int type = GRIB_TYPE_LONG; /*printf("---------- %s flags=%ld GRIB_ACCESSOR_FLAG_STRING_TYPE=%d\n", a->name,a->flags,GRIB_ACCESSOR_FLAG_STRING_TYPE);*/ if (a->flags & GRIB_ACCESSOR_FLAG_STRING_TYPE) - type=GRIB_TYPE_STRING; + type = GRIB_TYPE_STRING; return type; } -static int unpack_long (grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - int err=0; + int err = 0; grib_accessor_smart_table* self = (grib_accessor_smart_table*)a; size_t i; - if (!self->values) return 0; + if (!self->values) + return 0; - err=get_table_codes(a); - if (err) return 0; + err = get_table_codes(a); + if (err) + return 0; - for (i=0;itableCodesSize;i++) val[i]=self->tableCodes[i]; + for (i = 0; i < self->tableCodesSize; i++) + val[i] = self->tableCodes[i]; return err; } diff --git a/src/grib_accessor_class_smart_table_column.c b/src/grib_accessor_class_smart_table_column.c index 97d851aff..436b75567 100644 --- a/src/grib_accessor_class_smart_table_column.c +++ b/src/grib_accessor_class_smart_table_column.c @@ -34,66 +34,67 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int unpack_string_array (grib_accessor*, char**, size_t *len); -static int value_count(grib_accessor*,long*); -static void destroy(grib_context*,grib_accessor*); +static int get_native_type(grib_accessor*); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int unpack_string_array(grib_accessor*, char**, size_t* len); +static int value_count(grib_accessor*, long*); +static void destroy(grib_context*, grib_accessor*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_smart_table_column { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in smart_table_column */ - const char* smartTable; - int index; +typedef struct grib_accessor_smart_table_column +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in smart_table_column */ + const char* smartTable; + int index; } grib_accessor_smart_table_column; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_smart_table_column = { - &grib_accessor_class_gen, /* super */ - "smart_table_column", /* name */ - sizeof(grib_accessor_smart_table_column), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - &unpack_string_array, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "smart_table_column", /* name */ + sizeof(grib_accessor_smart_table_column), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + &destroy, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + &unpack_string_array, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -102,65 +103,66 @@ grib_accessor_class* grib_accessor_class_smart_table_column = &_grib_accessor_cl static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -typedef struct grib_accessor_smart_table { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in unsigned */ - long nbytes; - grib_arguments* arg; -/* Members defined in smart_table */ - const char* values; - const char* tablename; - const char* masterDir; - const char* localDir; - const char* extraDir; - const char* extraTable; - int widthOfCode; - long* tableCodes; - size_t tableCodesSize; - grib_smart_table* table; - int dirty; +typedef struct grib_accessor_smart_table +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in unsigned */ + long nbytes; + grib_arguments* arg; + /* Members defined in smart_table */ + const char* values; + const char* tablename; + const char* masterDir; + const char* localDir; + const char* extraDir; + const char* extraTable; + int widthOfCode; + long* tableCodes; + size_t tableCodesSize; + grib_smart_table* table; + int dirty; } grib_accessor_smart_table; static void init(grib_accessor* a, const long len, grib_arguments* params) { - int n=0; - grib_accessor_smart_table_column* self = (grib_accessor_smart_table_column*)a; + int n = 0; + grib_accessor_smart_table_column* self = (grib_accessor_smart_table_column*)a; - self->smartTable = grib_arguments_get_name(grib_handle_of_accessor(a),params,n++); - self->index = grib_arguments_get_long(grib_handle_of_accessor(a),params,n++); + self->smartTable = grib_arguments_get_name(grib_handle_of_accessor(a), params, n++); + self->index = grib_arguments_get_long(grib_handle_of_accessor(a), params, n++); a->length = 0; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; @@ -168,157 +170,156 @@ static void init(grib_accessor* a, const long len, grib_arguments* params) static void dump(grib_accessor* a, grib_dumper* dumper) { - int type=get_native_type(a); + int type = get_native_type(a); switch (type) { - case GRIB_TYPE_LONG: - grib_dump_long(dumper,a,NULL); - break; - case GRIB_TYPE_STRING: - grib_dump_string_array(dumper,a,NULL); - break; + case GRIB_TYPE_LONG: + grib_dump_long(dumper, a, NULL); + break; + case GRIB_TYPE_STRING: + grib_dump_string_array(dumper, a, NULL); + break; } } -static int unpack_string_array (grib_accessor* a, char** buffer, size_t *len) +static int unpack_string_array(grib_accessor* a, char** buffer, size_t* len) { - grib_accessor_smart_table_column* self = (grib_accessor_smart_table_column*)a; + grib_accessor_smart_table_column* self = (grib_accessor_smart_table_column*)a; grib_accessor_smart_table* tableAccessor = NULL; - grib_smart_table* table = NULL; + grib_smart_table* table = NULL; size_t size = 1; - long *code; - int err = GRIB_SUCCESS; - char tmp[1024]={0,}; - int i=0; + long* code; + int err = GRIB_SUCCESS; + char tmp[1024] = {0,}; + int i = 0; - tableAccessor=(grib_accessor_smart_table*)grib_find_accessor(grib_handle_of_accessor(a),self->smartTable); + tableAccessor = (grib_accessor_smart_table*)grib_find_accessor(grib_handle_of_accessor(a), self->smartTable); if (!tableAccessor) { - grib_context_log(a->context,GRIB_LOG_ERROR, - "unable to find accessor %s",self->smartTable); + grib_context_log(a->context, GRIB_LOG_ERROR, + "unable to find accessor %s", self->smartTable); return GRIB_NOT_FOUND; } - err=_grib_get_size(grib_handle_of_accessor(a),(grib_accessor*)tableAccessor,&size); - if (err) return err; - if (*lencontext,sizeof(long)*size); + code = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); if (!code) { - grib_context_log(a->context,GRIB_LOG_FATAL, - "unable to allocate %ld bytes",(long)size); + grib_context_log(a->context, GRIB_LOG_FATAL, + "unable to allocate %ld bytes", (long)size); return GRIB_OUT_OF_MEMORY; } - if( (err = grib_unpack_long((grib_accessor*)tableAccessor,code,&size)) != GRIB_SUCCESS) + if ((err = grib_unpack_long((grib_accessor*)tableAccessor, code, &size)) != GRIB_SUCCESS) return err; - table=tableAccessor->table; - - for (i=0;itable; - if(table && (code[i] >= 0) && - (code[i] < table->numberOfEntries) && - table->entries[code[i]].column[self->index]) - { - strcpy(tmp,table->entries[code[i]].column[self->index]); + for (i = 0; i < size; i++) { + if (table && (code[i] >= 0) && + (code[i] < table->numberOfEntries) && + table->entries[code[i]].column[self->index]) { + strcpy(tmp, table->entries[code[i]].column[self->index]); } - else - { - sprintf(tmp,"%d",(int)code[i]); + else { + sprintf(tmp, "%d", (int)code[i]); } - buffer[i]=grib_context_strdup(a->context,tmp); - + buffer[i] = grib_context_strdup(a->context, tmp); } *len = size; - grib_context_free(a->context,code); + grib_context_free(a->context, code); return GRIB_SUCCESS; } -static int unpack_long (grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - grib_accessor_smart_table_column* self = (grib_accessor_smart_table_column*)a; + grib_accessor_smart_table_column* self = (grib_accessor_smart_table_column*)a; grib_accessor_smart_table* tableAccessor = NULL; - grib_smart_table* table = NULL; + grib_smart_table* table = NULL; size_t size = 1; - long *code; + long* code; int err = GRIB_SUCCESS; - int i=0; + int i = 0; - for (i=0;i<*len;i++) val[i]=GRIB_MISSING_LONG; + for (i = 0; i < *len; i++) + val[i] = GRIB_MISSING_LONG; - tableAccessor=(grib_accessor_smart_table*)grib_find_accessor(grib_handle_of_accessor(a),self->smartTable); + tableAccessor = (grib_accessor_smart_table*)grib_find_accessor(grib_handle_of_accessor(a), self->smartTable); if (!tableAccessor) { - grib_context_log(a->context,GRIB_LOG_ERROR, - "unable to find accessor %s",self->smartTable); + grib_context_log(a->context, GRIB_LOG_ERROR, + "unable to find accessor %s", self->smartTable); return GRIB_NOT_FOUND; } - err=_grib_get_size(grib_handle_of_accessor(a),(grib_accessor*)tableAccessor,&size); - if (err) return err; - if (*lencontext,sizeof(long)*size); + code = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); if (!code) { - grib_context_log(a->context,GRIB_LOG_FATAL, - "unable to allocate %ld bytes",(long)size); + grib_context_log(a->context, GRIB_LOG_FATAL, + "unable to allocate %ld bytes", (long)size); return GRIB_OUT_OF_MEMORY; } - if( (err = grib_unpack_long((grib_accessor*)tableAccessor,code,&size)) != GRIB_SUCCESS) + if ((err = grib_unpack_long((grib_accessor*)tableAccessor, code, &size)) != GRIB_SUCCESS) return err; - table=tableAccessor->table; + table = tableAccessor->table; - for (i=0;i= 0) && - (code[i] < table->numberOfEntries) && - table->entries[code[i]].column[self->index]) - { - val[i]=atol(table->entries[code[i]].column[self->index]); + for (i = 0; i < size; i++) { + if (table && (code[i] >= 0) && + (code[i] < table->numberOfEntries) && + table->entries[code[i]].column[self->index]) { + val[i] = atol(table->entries[code[i]].column[self->index]); } } *len = size; - grib_context_free(a->context,code); + grib_context_free(a->context, code); return GRIB_SUCCESS; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { grib_accessor_smart_table_column* self = (grib_accessor_smart_table_column*)a; - size_t size=0; - int err=0; - *count=0; + size_t size = 0; + int err = 0; + *count = 0; - if (!self->smartTable) return 0; + if (!self->smartTable) + return 0; - err=grib_get_size(grib_handle_of_accessor(a),self->smartTable,&size); - *count=size; + err = grib_get_size(grib_handle_of_accessor(a), self->smartTable, &size); + *count = size; return err; } -static void destroy(grib_context* context,grib_accessor* a) +static void destroy(grib_context* context, grib_accessor* a) { if (a->vvalue != NULL) { grib_context_free(context, a->vvalue); - a->vvalue=NULL; + a->vvalue = NULL; } } -static int get_native_type(grib_accessor* a) +static int get_native_type(grib_accessor* a) { - int type=GRIB_TYPE_LONG; + int type = GRIB_TYPE_LONG; /*printf("---------- %s flags=%ld GRIB_ACCESSOR_FLAG_STRING_TYPE=%d\n", a->name,a->flags,GRIB_ACCESSOR_FLAG_STRING_TYPE);*/ if (a->flags & GRIB_ACCESSOR_FLAG_STRING_TYPE) - type=GRIB_TYPE_STRING; + type = GRIB_TYPE_STRING; return type; } diff --git a/src/grib_accessor_class_spd.c b/src/grib_accessor_class_spd.c index 9c0bb3748..b94ee7874 100644 --- a/src/grib_accessor_class_spd.c +++ b/src/grib_accessor_class_spd.c @@ -39,69 +39,70 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); static long byte_count(grib_accessor*); static long byte_offset(grib_accessor*); static long next_offset(grib_accessor*); -static int value_count(grib_accessor*,long*); +static int value_count(grib_accessor*, long*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -static void update_size(grib_accessor*,size_t); - -typedef struct grib_accessor_spd { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in spd */ - const char* numberOfBits; - const char* numberOfElements; +static void update_size(grib_accessor*, size_t); + +typedef struct grib_accessor_spd +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in spd */ + const char* numberOfBits; + const char* numberOfElements; } grib_accessor_spd; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_spd = { - &grib_accessor_class_long, /* super */ - "spd", /* name */ - sizeof(grib_accessor_spd), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - &next_offset, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - &byte_count, /* get number of bytes */ - &byte_offset, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - &update_size, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "spd", /* name */ + sizeof(grib_accessor_spd), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + &next_offset, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + &byte_count, /* get number of bytes */ + &byte_offset, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + &update_size, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -110,30 +111,30 @@ grib_accessor_class* grib_accessor_class_spd = &_grib_accessor_class_spd; static void init_class(grib_accessor_class* c) { - c->string_length = (*(c->super))->string_length; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->string_length = (*(c->super))->string_length; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ @@ -143,126 +144,129 @@ static long byte_count(grib_accessor* a) return a->length; } -static long compute_byte_count(grib_accessor* a){ +static long compute_byte_count(grib_accessor* a) +{ grib_accessor_spd* self = (grib_accessor_spd*)a; long numberOfBits; long numberOfElements; - int ret=0; + int ret = 0; - ret=grib_get_long(grib_handle_of_accessor(a),self->numberOfBits,&numberOfBits); + ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfBits, &numberOfBits); if (ret) { - grib_context_log(a->context,GRIB_LOG_ERROR, - "%s unable to get %s to compute size",a->name,self->numberOfBits); + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s unable to get %s to compute size", a->name, self->numberOfBits); return 0; } - ret=grib_get_long(grib_handle_of_accessor(a),self->numberOfElements,&numberOfElements); + ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfElements, &numberOfElements); if (ret) { - grib_context_log(a->context,GRIB_LOG_ERROR, - "%s unable to get %s to compute size",a->name,self->numberOfElements); + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s unable to get %s to compute size", a->name, self->numberOfElements); return 0; } numberOfElements++; - return (numberOfBits*numberOfElements+7)/8; + return (numberOfBits * numberOfElements + 7) / 8; } -static void init(grib_accessor* a, const long len , grib_arguments* args ) +static void init(grib_accessor* a, const long len, grib_arguments* args) { grib_accessor_spd* self = (grib_accessor_spd*)a; - int n=0; - self->numberOfBits=grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->numberOfElements=grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - a->length = compute_byte_count(a); + int n = 0; + self->numberOfBits = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->numberOfElements = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + a->length = compute_byte_count(a); } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_long(dumper,a,NULL); + grib_dump_long(dumper, a, NULL); } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_spd* self = (grib_accessor_spd*)a; int i; - int ret=0; - long pos = a->offset*8; - long rlen = 0; + int ret = 0; + long pos = a->offset * 8; + long rlen = 0; long numberOfBits = 0; - ret=value_count(a,&rlen); - if (ret) return ret; + ret = value_count(a, &rlen); + if (ret) + return ret; - if(*len < rlen) - { + if (*len < rlen) { grib_context_log(a->context, GRIB_LOG_ERROR, - " wrong size (%ld) for %s it contains %d values ",*len, a->name , rlen); + " wrong size (%ld) for %s it contains %d values ", *len, a->name, rlen); *len = 0; return GRIB_ARRAY_TOO_SMALL; } - ret=grib_get_long(grib_handle_of_accessor(a),self->numberOfBits,&numberOfBits); - if (ret) return ret; + ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfBits, &numberOfBits); + if (ret) + return ret; - for (i=0;ibuffer->data, &pos, numberOfBits); + for (i = 0; i < rlen - 1; i++) + val[i] = grib_decode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, &pos, numberOfBits); - val[rlen-1] = grib_decode_signed_longb(grib_handle_of_accessor(a)->buffer->data, &pos, numberOfBits); + val[rlen - 1] = grib_decode_signed_longb(grib_handle_of_accessor(a)->buffer->data, &pos, numberOfBits); *len = rlen; return GRIB_SUCCESS; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { grib_accessor_spd* self = (grib_accessor_spd*)a; - int ret = 0; - long off = 0; - long numberOfBits=0; - size_t buflen = 0; - unsigned char *buf = NULL; - unsigned long i = 0; - long rlen = 0; - - ret=value_count(a,&rlen); - if (ret) return ret; - - if(*len != rlen) - { - ret=grib_set_long(grib_handle_of_accessor(a),self->numberOfElements,(*len)-1); + int ret = 0; + long off = 0; + long numberOfBits = 0; + size_t buflen = 0; + unsigned char* buf = NULL; + unsigned long i = 0; + long rlen = 0; + + ret = value_count(a, &rlen); + if (ret) + return ret; + + if (*len != rlen) { + ret = grib_set_long(grib_handle_of_accessor(a), self->numberOfElements, (*len) - 1); } - ret=grib_get_long(grib_handle_of_accessor(a),self->numberOfBits,&numberOfBits); - if (ret) return ret; + ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfBits, &numberOfBits); + if (ret) + return ret; buflen = compute_byte_count(a); - buf = (unsigned char*)grib_context_malloc_clear(a->context,buflen); + buf = (unsigned char*)grib_context_malloc_clear(a->context, buflen); - for(i=0; i < rlen-1;i++) { - grib_encode_unsigned_longb(buf, val[i] , &off, numberOfBits); + for (i = 0; i < rlen - 1; i++) { + grib_encode_unsigned_longb(buf, val[i], &off, numberOfBits); } - grib_encode_signed_longb(buf, val[rlen-1] , &off, numberOfBits); + grib_encode_signed_longb(buf, val[rlen - 1], &off, numberOfBits); - grib_buffer_replace(a, buf, buflen,1,1); + grib_buffer_replace(a, buf, buflen, 1, 1); - grib_context_free(a->context,buf); + grib_context_free(a->context, buf); - *len=rlen; + *len = rlen; return ret; } -static int value_count(grib_accessor* a,long* numberOfElements) +static int value_count(grib_accessor* a, long* numberOfElements) { grib_accessor_spd* self = (grib_accessor_spd*)a; int ret; - *numberOfElements=0; + *numberOfElements = 0; - ret=grib_get_long(grib_handle_of_accessor(a),self->numberOfElements,numberOfElements); + ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfElements, numberOfElements); if (ret) { - grib_context_log(a->context,GRIB_LOG_ERROR, - "%s unable to get %s to compute size",a->name,self->numberOfElements); + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s unable to get %s to compute size", a->name, self->numberOfElements); return ret; } (*numberOfElements)++; @@ -275,12 +279,12 @@ static long byte_offset(grib_accessor* a) return a->offset; } -static void update_size(grib_accessor* a,size_t s) +static void update_size(grib_accessor* a, size_t s) { a->length = s; } static long next_offset(grib_accessor* a) { - return byte_offset(a)+a->length; + return byte_offset(a) + a->length; } diff --git a/src/grib_accessor_class_spectral_truncation.c b/src/grib_accessor_class_spectral_truncation.c index 3372a144a..a50b1300d 100644 --- a/src/grib_accessor_class_spectral_truncation.c +++ b/src/grib_accessor_class_spectral_truncation.c @@ -40,64 +40,65 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_long(grib_accessor*, long* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_spectral_truncation { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in spectral_truncation */ - const char* J; - const char* K; - const char* M; - const char* T; +typedef struct grib_accessor_spectral_truncation +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in spectral_truncation */ + const char* J; + const char* K; + const char* M; + const char* T; } grib_accessor_spectral_truncation; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_spectral_truncation = { - &grib_accessor_class_long, /* super */ - "spectral_truncation", /* name */ - sizeof(grib_accessor_spectral_truncation), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "spectral_truncation", /* name */ + sizeof(grib_accessor_spectral_truncation), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -106,104 +107,103 @@ grib_accessor_class* grib_accessor_class_spectral_truncation = &_grib_accessor_c static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_spectral_truncation* self = (grib_accessor_spectral_truncation*)a; - int n = 0; + int n = 0; - self->J = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->K = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->M = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->T = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); + self->J = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->K = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->M = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->T = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_spectral_truncation* self = (grib_accessor_spectral_truncation*)a; - int ret = 0; + int ret = 0; - long J,K,M,T,Tc; + long J, K, M, T, Tc; - if(*len < 1) return GRIB_ARRAY_TOO_SMALL; + if (*len < 1) + return GRIB_ARRAY_TOO_SMALL; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->J,&J)) - != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->J, &J)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->K,&K)) - != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->K, &K)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->M,&M)) - != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->M, &M)) != GRIB_SUCCESS) return ret; - Tc=-1; - if (J==K && K==M ) { + Tc = -1; + if (J == K && K == M) { /* Triangular truncation */ - Tc=(M+1)*(M+2); + Tc = (M + 1) * (M + 2); } - if (K==J+M ) { + if (K == J + M) { /* Rhomboidal truncation */ - Tc=2*J*M; + Tc = 2 * J * M; } - if (J==K && K > M ) { + if (J == K && K > M) { /* Trapezoidal truncation */ - Tc=M*(2*J-M); + Tc = M * (2 * J - M); } - *val=Tc; + *val = Tc; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->T,&T)) - != GRIB_SUCCESS) { + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->T, &T)) != GRIB_SUCCESS) { if (Tc == -1) grib_context_log(a->context, GRIB_LOG_ERROR, - "%s. Spectral Truncation Type Unknown: %s=%d %s=%d %s=%d \n", - a->name, self->J,J, self->K,K, self->M,M); - Tc=0; - grib_set_long(grib_handle_of_accessor(a), self->T,Tc); - - } else { - if (Tc != -1 && Tc != T ) grib_set_long(grib_handle_of_accessor(a), self->T,Tc); + "%s. Spectral Truncation Type Unknown: %s=%d %s=%d %s=%d \n", + a->name, self->J, J, self->K, K, self->M, M); + Tc = 0; + grib_set_long(grib_handle_of_accessor(a), self->T, Tc); + } + else { + if (Tc != -1 && Tc != T) + grib_set_long(grib_handle_of_accessor(a), self->T, Tc); } - if (ret == GRIB_SUCCESS) *len = 1; + if (ret == GRIB_SUCCESS) + *len = 1; return ret; } diff --git a/src/grib_accessor_class_sprintf.c b/src/grib_accessor_class_sprintf.c index bbca4eb59..68a158403 100644 --- a/src/grib_accessor_class_sprintf.c +++ b/src/grib_accessor_class_sprintf.c @@ -32,64 +32,65 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_string(grib_accessor*, const char*, size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); +static int pack_string(grib_accessor*, const char*, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); static size_t string_length(grib_accessor*); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_sprintf { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in ascii */ -/* Members defined in sprintf */ - grib_arguments* args; +typedef struct grib_accessor_sprintf +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in ascii */ + /* Members defined in sprintf */ + grib_arguments* args; } grib_accessor_sprintf; extern grib_accessor_class* grib_accessor_class_ascii; static grib_accessor_class _grib_accessor_class_sprintf = { - &grib_accessor_class_ascii, /* super */ - "sprintf", /* name */ - sizeof(grib_accessor_sprintf), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - &string_length, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - &pack_string, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_ascii, /* super */ + "sprintf", /* name */ + sizeof(grib_accessor_sprintf), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + &string_length, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + &pack_string, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -98,148 +99,149 @@ grib_accessor_class* grib_accessor_class_sprintf = &_grib_accessor_class_sprintf static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_sprintf* self = (grib_accessor_sprintf*)a; - self->args = c; + self->args = c; } -static int pack_string(grib_accessor* a, const char* val, size_t *len) +static int pack_string(grib_accessor* a, const char* val, size_t* len) { return GRIB_NOT_IMPLEMENTED; } -static int unpack_string(grib_accessor* a, char* val, size_t *len) +static int unpack_string(grib_accessor* a, char* val, size_t* len) { grib_accessor_sprintf* self = (grib_accessor_sprintf*)a; - char result[1024] ; + char result[1024]; char tempBuffer[2048]; - char sres[1024] ; - long ires = 0; - double dres= 0; - int i = 0; - size_t replen = 1024; - int ret = GRIB_SUCCESS; - int carg= 0; - int is_missing = 0; - const char* uname = NULL; + char sres[1024]; + long ires = 0; + double dres = 0; + int i = 0; + size_t replen = 1024; + int ret = GRIB_SUCCESS; + int carg = 0; + int is_missing = 0; + const char* uname = NULL; const char* tempname = NULL; - size_t uname_len = 0; + size_t uname_len = 0; - uname = grib_arguments_get_string(grib_handle_of_accessor(a),self->args,carg++); - sprintf(result,"%s",""); + uname = grib_arguments_get_string(grib_handle_of_accessor(a), self->args, carg++); + sprintf(result, "%s", ""); uname_len = strlen(uname); - for(i=0; iargs,carg++); - - if((ret = grib_get_long_internal(grib_handle_of_accessor(a),tempname,&ires)) != GRIB_SUCCESS) - return ret; - /* Bug GRIB-56: Check to see if the key is missing */ - is_missing = grib_is_missing(grib_handle_of_accessor(a),tempname,&ret); - if (ret != GRIB_SUCCESS) - return ret; - if (is_missing) { - sprintf(tempBuffer,"%sMISSING",result); - strcpy(result, tempBuffer); - } - else { - /* Not missing so print it */ - if (precision!=999) { - sprintf(tempBuffer,"%s%.*ld",result, precision, ires); - strcpy(result, tempBuffer); - } else { - sprintf(tempBuffer,"%s%ld",result, ires); + switch (uname[i]) { + case 'd': + tempname = grib_arguments_get_name(grib_handle_of_accessor(a), self->args, carg++); + + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), tempname, &ires)) != GRIB_SUCCESS) + return ret; + /* Bug GRIB-56: Check to see if the key is missing */ + is_missing = grib_is_missing(grib_handle_of_accessor(a), tempname, &ret); + if (ret != GRIB_SUCCESS) + return ret; + if (is_missing) { + sprintf(tempBuffer, "%sMISSING", result); strcpy(result, tempBuffer); } - } - break; - - case 'g': - tempname = grib_arguments_get_name(grib_handle_of_accessor(a),self->args,carg++); - if((ret = grib_get_double_internal(grib_handle_of_accessor(a),tempname,&dres)) != GRIB_SUCCESS) - return ret; - sprintf(tempBuffer,"%s%g",result, dres); - strcpy(result, tempBuffer); - - break; - - case 's': - tempname = grib_arguments_get_name(grib_handle_of_accessor(a),self->args,carg++); - if((ret = grib_get_string_internal(grib_handle_of_accessor(a),tempname,sres, &replen )) != GRIB_SUCCESS) - return ret; - sprintf(tempBuffer, "%s%s",result, sres); - strcpy(result, tempBuffer); - replen = 1024; + else { + /* Not missing so print it */ + if (precision != 999) { + sprintf(tempBuffer, "%s%.*ld", result, precision, ires); + strcpy(result, tempBuffer); + } + else { + sprintf(tempBuffer, "%s%ld", result, ires); + strcpy(result, tempBuffer); + } + } + break; + + case 'g': + tempname = grib_arguments_get_name(grib_handle_of_accessor(a), self->args, carg++); + if ((ret = grib_get_double_internal(grib_handle_of_accessor(a), tempname, &dres)) != GRIB_SUCCESS) + return ret; + sprintf(tempBuffer, "%s%g", result, dres); + strcpy(result, tempBuffer); + + break; + + case 's': + tempname = grib_arguments_get_name(grib_handle_of_accessor(a), self->args, carg++); + if ((ret = grib_get_string_internal(grib_handle_of_accessor(a), tempname, sres, &replen)) != GRIB_SUCCESS) + return ret; + sprintf(tempBuffer, "%s%s", result, sres); + strcpy(result, tempBuffer); + replen = 1024; } } else { - sprintf(tempBuffer,"%s%c",result, uname[i]); + sprintf(tempBuffer, "%s%c", result, uname[i]); strcpy(result, tempBuffer); } } - replen = strlen(result)+1; + replen = strlen(result) + 1; - if(*len < replen){ + if (*len < replen) { *len = replen; return GRIB_ARRAY_TOO_SMALL; } *len = replen; - sprintf(val,"%s",result); + sprintf(val, "%s", result); return GRIB_SUCCESS; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - *count=1; + *count = 1; return 0; } diff --git a/src/grib_accessor_class_statistics.c b/src/grib_accessor_class_statistics.c index 2a6082d95..fe5327926 100644 --- a/src/grib_accessor_class_statistics.c +++ b/src/grib_accessor_class_statistics.c @@ -40,69 +40,70 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); -static int value_count(grib_accessor*,long*); -static void destroy(grib_context*,grib_accessor*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); +static int value_count(grib_accessor*, long*); +static void destroy(grib_context*, grib_accessor*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); static int compare(grib_accessor*, grib_accessor*); -typedef struct grib_accessor_statistics { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in double */ -/* Members defined in abstract_vector */ - double* v; - int number_of_elements; -/* Members defined in statistics */ - const char* values; - const char* missing_value; +typedef struct grib_accessor_statistics +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in double */ + /* Members defined in abstract_vector */ + double* v; + int number_of_elements; + /* Members defined in statistics */ + const char* values; + const char* missing_value; } grib_accessor_statistics; extern grib_accessor_class* grib_accessor_class_abstract_vector; static grib_accessor_class _grib_accessor_class_statistics = { - &grib_accessor_class_abstract_vector, /* super */ - "statistics", /* name */ - sizeof(grib_accessor_statistics), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_abstract_vector, /* super */ + "statistics", /* name */ + sizeof(grib_accessor_statistics), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + &destroy, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + &compare, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -111,136 +112,154 @@ grib_accessor_class* grib_accessor_class_statistics = &_grib_accessor_class_stat static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->pack_string = (*(c->super))->pack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->pack_string = (*(c->super))->pack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_statistics* self = (grib_accessor_statistics*)a; - int n = 0; + int n = 0; - self->missing_value = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->values = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + self->missing_value = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->values = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; a->flags |= GRIB_ACCESSOR_FLAG_HIDDEN; - self->number_of_elements=8; - self->v=(double*)grib_context_malloc(a->context, - sizeof(double)*self->number_of_elements); + self->number_of_elements = 8; + self->v = (double*)grib_context_malloc(a->context, + sizeof(double) * self->number_of_elements); - a->length=0; - a->dirty=1; + a->length = 0; + a->dirty = 1; } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { grib_accessor_statistics* self = (grib_accessor_statistics*)a; - int ret = 0,i=0; + int ret = 0, i = 0; double* values; - size_t size=0, real_size=0; - double max,min,avg,sd,value,skew,kurt, m2=0,m3=0,m4=0; - double missing=0; + size_t size = 0, real_size = 0; + double max, min, avg, sd, value, skew, kurt, m2 = 0, m3 = 0, m4 = 0; + double missing = 0; long missingValuesPresent = 0; - size_t number_of_missing=0; - grib_context* c=a->context; - grib_handle* h=grib_handle_of_accessor(a); + size_t number_of_missing = 0; + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); - if (!a->dirty) return GRIB_SUCCESS; + if (!a->dirty) + return GRIB_SUCCESS; - if ( (ret=grib_get_size(h,self->values,&size)) != GRIB_SUCCESS) return ret; + if ((ret = grib_get_size(h, self->values, &size)) != GRIB_SUCCESS) + return ret; - grib_context_log(a->context,GRIB_LOG_DEBUG, - "grib_accessor_statistics: computing statistics for %d values",size); + grib_context_log(a->context, GRIB_LOG_DEBUG, + "grib_accessor_statistics: computing statistics for %d values", size); - if((ret=grib_get_double(h,self->missing_value,&missing)) != GRIB_SUCCESS) return ret; - if((ret=grib_get_long_internal(h,"missingValuesPresent",&missingValuesPresent)) != GRIB_SUCCESS) return ret; + if ((ret = grib_get_double(h, self->missing_value, &missing)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(h, "missingValuesPresent", &missingValuesPresent)) != GRIB_SUCCESS) + return ret; - values=(double*)grib_context_malloc_clear(c,size*sizeof(double)); - if (!values) return GRIB_OUT_OF_MEMORY; + values = (double*)grib_context_malloc_clear(c, size * sizeof(double)); + if (!values) + return GRIB_OUT_OF_MEMORY; - if((ret = grib_get_double_array_internal(h,self->values,values,&size)) != GRIB_SUCCESS) { - grib_context_free(c,values); + if ((ret = grib_get_double_array_internal(h, self->values, values, &size)) != GRIB_SUCCESS) { + grib_context_free(c, values); return ret; } - number_of_missing=0; + number_of_missing = 0; if (missingValuesPresent) { - i=0; - while (i max && value != missing) max=value; - if (value < min && value != missing) min=value; - if (value != missing) avg+=value; - else number_of_missing++; + } + else { + max = values[i]; + min = values[i]; + avg = values[i]; + for (i = number_of_missing + 1; i < size; i++) { + value = values[i]; + if (value > max && value != missing) + max = value; + if (value < min && value != missing) + min = value; + if (value != missing) + avg += value; + else + number_of_missing++; } } - } else { - max=values[0]; - min=values[0]; - avg=values[0]; - for (i=1; i max) max=value; - if (value < min) min=value; + if (value > max) + max = value; + if (value < min) + min = value; avg += value; } } /*printf("stats.......... number_of_missing=%ld\n", number_of_missing);*/ /* Don't divide by zero if all values are missing! */ if (size != number_of_missing) { - avg/=(size-number_of_missing); + avg /= (size - number_of_missing); } - sd=0; skew=0; kurt=0; - for (i=0;idirty=0; + a->dirty = 0; - grib_context_free(c,values); + grib_context_free(c, values); - self->v[0]=max; - self->v[1]=min; - self->v[2]=avg; - self->v[3]=number_of_missing; - self->v[4]=sd; - self->v[5]=skew; - self->v[6]=kurt; - self->v[7]= sd == 0 ? 1 : 0; + self->v[0] = max; + self->v[1] = min; + self->v[2] = avg; + self->v[3] = number_of_missing; + self->v[4] = sd; + self->v[5] = skew; + self->v[6] = kurt; + self->v[7] = sd == 0 ? 1 : 0; - for (i=0;inumber_of_elements;i++) - val[i]=self->v[i]; + for (i = 0; i < self->number_of_elements; i++) + val[i] = self->v[i]; return ret; } -static int value_count(grib_accessor* a,long* count) { +static int value_count(grib_accessor* a, long* count) +{ grib_accessor_statistics* self = (grib_accessor_statistics*)a; - *count=self->number_of_elements; + *count = self->number_of_elements; return 0; } -static void destroy(grib_context* c,grib_accessor* a) +static void destroy(grib_context* c, grib_accessor* a) { grib_accessor_statistics* self = (grib_accessor_statistics*)a; - grib_context_free(c,self->v); + grib_context_free(c, self->v); } static int compare(grib_accessor* a, grib_accessor* b) { - int retval = GRIB_SUCCESS; - double *aval=0; - double *bval=0; + int retval = GRIB_SUCCESS; + double* aval = 0; + double* bval = 0; size_t alen = 0; size_t blen = 0; - int err=0; - long count=0; + int err = 0; + long count = 0; - err=grib_value_count(a,&count); - if (err) return err; - alen=count; + err = grib_value_count(a, &count); + if (err) + return err; + alen = count; - err=grib_value_count(b,&count); - if (err) return err; - blen=count; + err = grib_value_count(b, &count); + if (err) + return err; + blen = count; - if (alen != blen) return GRIB_COUNT_MISMATCH; + if (alen != blen) + return GRIB_COUNT_MISMATCH; - aval=(double*)grib_context_malloc(a->context,alen*sizeof(double)); - bval=(double*)grib_context_malloc(b->context,blen*sizeof(double)); + aval = (double*)grib_context_malloc(a->context, alen * sizeof(double)); + bval = (double*)grib_context_malloc(b->context, blen * sizeof(double)); - b->dirty=1; - a->dirty=1; + b->dirty = 1; + a->dirty = 1; - grib_unpack_double(a,aval,&alen); - grib_unpack_double(b,bval,&blen); + grib_unpack_double(a, aval, &alen); + grib_unpack_double(b, bval, &blen); while (alen != 0) { - if (*bval != *aval) retval = GRIB_DOUBLE_VALUE_MISMATCH; + if (*bval != *aval) + retval = GRIB_DOUBLE_VALUE_MISMATCH; alen--; } - grib_context_free(a->context,aval); - grib_context_free(b->context,bval); + grib_context_free(a->context, aval); + grib_context_free(b->context, bval); return retval; } -static int unpack_string(grib_accessor*a , char* v, size_t *len) +static int unpack_string(grib_accessor* a, char* v, size_t* len) { return GRIB_NOT_IMPLEMENTED; } diff --git a/src/grib_accessor_class_statistics_spectral.c b/src/grib_accessor_class_statistics_spectral.c index c3327fb3e..818dd8814 100644 --- a/src/grib_accessor_class_statistics_spectral.c +++ b/src/grib_accessor_class_statistics_spectral.c @@ -42,71 +42,72 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void destroy(grib_context*,grib_accessor*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void destroy(grib_context*, grib_accessor*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); static int compare(grib_accessor*, grib_accessor*); -typedef struct grib_accessor_statistics_spectral { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in double */ -/* Members defined in abstract_vector */ - double* v; - int number_of_elements; -/* Members defined in statistics_spectral */ - const char* values; - const char* J; - const char* K; - const char* M; - const char* JS; +typedef struct grib_accessor_statistics_spectral +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in double */ + /* Members defined in abstract_vector */ + double* v; + int number_of_elements; + /* Members defined in statistics_spectral */ + const char* values; + const char* J; + const char* K; + const char* M; + const char* JS; } grib_accessor_statistics_spectral; extern grib_accessor_class* grib_accessor_class_abstract_vector; static grib_accessor_class _grib_accessor_class_statistics_spectral = { - &grib_accessor_class_abstract_vector, /* super */ - "statistics_spectral", /* name */ - sizeof(grib_accessor_statistics_spectral), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_abstract_vector, /* super */ + "statistics_spectral", /* name */ + sizeof(grib_accessor_statistics_spectral), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + &destroy, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + &compare, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -115,185 +116,192 @@ grib_accessor_class* grib_accessor_class_statistics_spectral = &_grib_accessor_c static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_statistics_spectral* self = (grib_accessor_statistics_spectral*)a; - int n = 0; + int n = 0; - self->values = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->J = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->K = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->M = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->JS = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); + self->values = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->J = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->K = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->M = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->JS = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; - self->number_of_elements=4; - self->v=(double*)grib_context_malloc(a->context, - sizeof(double)*self->number_of_elements); + self->number_of_elements = 4; + self->v = (double*)grib_context_malloc(a->context, + sizeof(double) * self->number_of_elements); - a->length=0; - a->dirty=1; + a->length = 0; + a->dirty = 1; } -static int unpack_double (grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { grib_accessor_statistics_spectral* self = (grib_accessor_statistics_spectral*)a; - int ret = 0,i=0; + int ret = 0, i = 0; double* values; - size_t size=0; - long J,K,M,N; - double avg,enorm,sd; - grib_context* c=a->context; - grib_handle* h=grib_handle_of_accessor(a); + size_t size = 0; + long J, K, M, N; + double avg, enorm, sd; + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); - if (!a->dirty) return GRIB_SUCCESS; + if (!a->dirty) + return GRIB_SUCCESS; - if ( (ret=grib_get_size(h,self->values,&size)) != GRIB_SUCCESS) return ret; + if ((ret = grib_get_size(h, self->values, &size)) != GRIB_SUCCESS) + return ret; - if((ret=grib_get_long(grib_handle_of_accessor(a),self->J,&J)) - != GRIB_SUCCESS) return ret; + if ((ret = grib_get_long(grib_handle_of_accessor(a), self->J, &J)) != GRIB_SUCCESS) + return ret; - if((ret=grib_get_long(grib_handle_of_accessor(a),self->K,&K)) - != GRIB_SUCCESS) return ret; + if ((ret = grib_get_long(grib_handle_of_accessor(a), self->K, &K)) != GRIB_SUCCESS) + return ret; - if((ret=grib_get_long(grib_handle_of_accessor(a),self->M,&M)) - != GRIB_SUCCESS) return ret; + if ((ret = grib_get_long(grib_handle_of_accessor(a), self->M, &M)) != GRIB_SUCCESS) + return ret; - if (J != M || M != K) return GRIB_NOT_IMPLEMENTED; + if (J != M || M != K) + return GRIB_NOT_IMPLEMENTED; - N=(M+1)*(M+2)/2; + N = (M + 1) * (M + 2) / 2; - if (2*N != size) { - grib_context_log(a->context,GRIB_LOG_ERROR, - "wrong number of components for spherical harmonics %ld != %ld",2*N,size); + if (2 * N != size) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "wrong number of components for spherical harmonics %ld != %ld", 2 * N, size); return GRIB_WRONG_ARRAY_SIZE; } - values=(double*)grib_context_malloc(c,size*sizeof(double)); - if (!values) return GRIB_OUT_OF_MEMORY; + values = (double*)grib_context_malloc(c, size * sizeof(double)); + if (!values) + return GRIB_OUT_OF_MEMORY; - if((ret = grib_get_double_array_internal(h,self->values,values,&size)) - != GRIB_SUCCESS) { - grib_context_free(c,values); + if ((ret = grib_get_double_array_internal(h, self->values, values, &size)) != GRIB_SUCCESS) { + grib_context_free(c, values); return ret; } - avg=values[0]; - enorm=0; - sd=0; + avg = values[0]; + enorm = 0; + sd = 0; - for (i=2; i < 2*J ; i+=2) - sd += values[i]*values[i]; + for (i = 2; i < 2 * J; i += 2) + sd += values[i] * values[i]; - for (i= 2*J; i < size; i+=2) - sd += 2*values[i]*values[i] + 2*values[i+1]*values[i+1]; + for (i = 2 * J; i < size; i += 2) + sd += 2 * values[i] * values[i] + 2 * values[i + 1] * values[i + 1]; - enorm=sd+avg*avg; + enorm = sd + avg * avg; - sd=sqrt(sd); - enorm=sqrt(enorm); + sd = sqrt(sd); + enorm = sqrt(enorm); - a->dirty=0; + a->dirty = 0; - grib_context_free(c,values); + grib_context_free(c, values); - self->v[0]=avg; - self->v[1]=enorm; - self->v[2]=sd; - self->v[3]= sd == 0 ? 1 : 0; + self->v[0] = avg; + self->v[1] = enorm; + self->v[2] = sd; + self->v[3] = sd == 0 ? 1 : 0; - for (i=0;inumber_of_elements;i++) - val[i]=self->v[i]; + for (i = 0; i < self->number_of_elements; i++) + val[i] = self->v[i]; return ret; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { grib_accessor_statistics_spectral* self = (grib_accessor_statistics_spectral*)a; - *count= self->number_of_elements; + *count = self->number_of_elements; return 0; } -static void destroy(grib_context* c,grib_accessor* a) +static void destroy(grib_context* c, grib_accessor* a) { grib_accessor_statistics_spectral* self = (grib_accessor_statistics_spectral*)a; - grib_context_free(c,self->v); + grib_context_free(c, self->v); } static int compare(grib_accessor* a, grib_accessor* b) { - int retval=GRIB_SUCCESS; - double *aval=0; - double *bval=0; + int retval = GRIB_SUCCESS; + double* aval = 0; + double* bval = 0; size_t alen = 0; size_t blen = 0; - int err=0; - long count=0; + int err = 0; + long count = 0; - err=grib_value_count(a,&count); - if (err) return err; - alen=count; + err = grib_value_count(a, &count); + if (err) + return err; + alen = count; - err=grib_value_count(b,&count); - if (err) return err; - blen=count; + err = grib_value_count(b, &count); + if (err) + return err; + blen = count; - if (alen != blen) return GRIB_COUNT_MISMATCH; + if (alen != blen) + return GRIB_COUNT_MISMATCH; - aval=(double*)grib_context_malloc(a->context,alen*sizeof(double)); - bval=(double*)grib_context_malloc(b->context,blen*sizeof(double)); + aval = (double*)grib_context_malloc(a->context, alen * sizeof(double)); + bval = (double*)grib_context_malloc(b->context, blen * sizeof(double)); - b->dirty=1; - a->dirty=1; + b->dirty = 1; + a->dirty = 1; - grib_unpack_double(a,aval,&alen); - grib_unpack_double(b,bval,&blen); + grib_unpack_double(a, aval, &alen); + grib_unpack_double(b, bval, &blen); retval = GRIB_SUCCESS; while (alen != 0) { - if (*bval != *aval) retval = GRIB_DOUBLE_VALUE_MISMATCH; + if (*bval != *aval) + retval = GRIB_DOUBLE_VALUE_MISMATCH; alen--; } - grib_context_free(a->context,aval); - grib_context_free(b->context,bval); + grib_context_free(a->context, aval); + grib_context_free(b->context, bval); return retval; } diff --git a/src/grib_accessor_class_step_in_units.c b/src/grib_accessor_class_step_in_units.c index e1c11ff5b..67489f62e 100644 --- a/src/grib_accessor_class_step_in_units.c +++ b/src/grib_accessor_class_step_in_units.c @@ -37,67 +37,68 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_step_in_units { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in step_in_units */ - const char* codedStep; - const char* codedUnits; - const char* stepUnits; - const char* indicatorOfUnitForTimeRange; - const char* lengthOfTimeRange; +typedef struct grib_accessor_step_in_units +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in step_in_units */ + const char* codedStep; + const char* codedUnits; + const char* stepUnits; + const char* indicatorOfUnitForTimeRange; + const char* lengthOfTimeRange; } grib_accessor_step_in_units; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_step_in_units = { - &grib_accessor_class_long, /* super */ - "step_in_units", /* name */ - sizeof(grib_accessor_step_in_units), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "step_in_units", /* name */ + sizeof(grib_accessor_step_in_units), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -106,175 +107,189 @@ grib_accessor_class* grib_accessor_class_step_in_units = &_grib_accessor_class_s static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { - grib_accessor_step_in_units* self = (grib_accessor_step_in_units*)a; - int n = 0; - - self->codedStep = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->codedUnits = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->stepUnits = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->indicatorOfUnitForTimeRange = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->lengthOfTimeRange = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); + grib_accessor_step_in_units* self = (grib_accessor_step_in_units*)a; + int n = 0; + + self->codedStep = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->codedUnits = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->stepUnits = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->indicatorOfUnitForTimeRange = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->lengthOfTimeRange = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_double(dumper,a,NULL); - + grib_dump_double(dumper, a, NULL); } /* Conversion of to seconds - Grib edition 2 table 4.4 */ -static const int u2s2[] = { - 60, /* (0) minutes */ - 3600, /* (1) hour */ - 86400, /* (2) day */ - 2592000, /* (3) month */ - -1, /* (4) year */ - -1, /* (5) decade */ - -1, /* (6) 30 years */ - -1, /* (7) century */ - -1, /* (8) RESERVED */ - -1, /* (9) RESERVED */ - 10800, /* (10) 3 hours */ - 21600, /* (11) 6 hours */ - 43200, /* (12) 12 hours */ - 1 /* (13) seconds */ +static const int u2s2[] = { + 60, /* (0) minutes */ + 3600, /* (1) hour */ + 86400, /* (2) day */ + 2592000, /* (3) month */ + -1, /* (4) year */ + -1, /* (5) decade */ + -1, /* (6) 30 years */ + -1, /* (7) century */ + -1, /* (8) RESERVED */ + -1, /* (9) RESERVED */ + 10800, /* (10) 3 hours */ + 21600, /* (11) 6 hours */ + 43200, /* (12) 12 hours */ + 1 /* (13) seconds */ }; /* Note: 'stepUnits' has a different table with extra entries e.g. 15 and 30 mins */ -static const int u2s[] = { - 60, /* (0) minutes */ - 3600, /* (1) hour */ - 86400, /* (2) day */ - 2592000, /* (3) month */ - -1, /* (4) year */ - -1, /* (5) decade */ - -1, /* (6) 30 years */ - -1, /* (7) century */ - -1, /* (8) */ - -1, /* (9) */ - 10800, /* (10) 3 hours */ - 21600, /* (11) 6 hours */ - 43200, /* (12) 12 hours */ - 1, /* (13) seconds */ - 900, /* (14) 15 minutes */ - 1800 /* (15) 30 minutes */ +static const int u2s[] = { + 60, /* (0) minutes */ + 3600, /* (1) hour */ + 86400, /* (2) day */ + 2592000, /* (3) month */ + -1, /* (4) year */ + -1, /* (5) decade */ + -1, /* (6) 30 years */ + -1, /* (7) century */ + -1, /* (8) */ + -1, /* (9) */ + 10800, /* (10) 3 hours */ + 21600, /* (11) 6 hours */ + 43200, /* (12) 12 hours */ + 1, /* (13) seconds */ + 900, /* (14) 15 minutes */ + 1800 /* (15) 30 minutes */ }; -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - grib_accessor_step_in_units* self = (grib_accessor_step_in_units*)a; - int err = 0; - long codedStep,codedUnits,stepUnits; - grib_handle* h=grib_handle_of_accessor(a); - int factor=0; - long u2sf,u2sf_step_unit; - - - if((err = grib_get_long_internal(h,self->codedUnits,&codedUnits))) return err; - if((err = grib_get_long_internal(h,self->stepUnits,&stepUnits))) return err; - if((err = grib_get_long_internal(h,self->codedStep,&codedStep))) return err; - - if (stepUnits!=codedUnits) { - *val=codedStep*u2s2[codedUnits]; - if (*val<0) { - factor=60; - if (u2s2[codedUnits] % factor) return GRIB_DECODING_ERROR; - if (u2s[stepUnits] % factor) return GRIB_DECODING_ERROR; - u2sf=u2s2[codedUnits]/factor; - *val=codedStep*u2sf; - u2sf_step_unit=u2s[stepUnits]/factor; - } else { - u2sf_step_unit=u2s[stepUnits]; - } - - if (*val % u2sf_step_unit!=0) { - err = grib_set_long_internal(h,self->stepUnits,codedUnits); - *val=codedStep; - return err; - } - *val = *val / u2sf_step_unit; - } else *val=codedStep; - - return GRIB_SUCCESS; + grib_accessor_step_in_units* self = (grib_accessor_step_in_units*)a; + int err = 0; + long codedStep, codedUnits, stepUnits; + grib_handle* h = grib_handle_of_accessor(a); + int factor = 0; + long u2sf, u2sf_step_unit; + + + if ((err = grib_get_long_internal(h, self->codedUnits, &codedUnits))) + return err; + if ((err = grib_get_long_internal(h, self->stepUnits, &stepUnits))) + return err; + if ((err = grib_get_long_internal(h, self->codedStep, &codedStep))) + return err; + + if (stepUnits != codedUnits) { + *val = codedStep * u2s2[codedUnits]; + if (*val < 0) { + factor = 60; + if (u2s2[codedUnits] % factor) + return GRIB_DECODING_ERROR; + if (u2s[stepUnits] % factor) + return GRIB_DECODING_ERROR; + u2sf = u2s2[codedUnits] / factor; + *val = codedStep * u2sf; + u2sf_step_unit = u2s[stepUnits] / factor; + } + else { + u2sf_step_unit = u2s[stepUnits]; + } + + if (*val % u2sf_step_unit != 0) { + err = grib_set_long_internal(h, self->stepUnits, codedUnits); + *val = codedStep; + return err; + } + *val = *val / u2sf_step_unit; + } + else + *val = codedStep; + + return GRIB_SUCCESS; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { - grib_accessor_step_in_units* self = (grib_accessor_step_in_units*)a; - grib_handle* h=grib_handle_of_accessor(a); - int err = 0; - long codedStep,codedUnits,stepUnits; - long oldStep=0; - long indicatorOfUnitForTimeRange,lengthOfTimeRange; - - if((err = grib_get_long_internal(h,self->codedUnits,&codedUnits))) return err; - if((err = grib_get_long_internal(h,self->stepUnits,&stepUnits))) return err; - - unpack_long(a,&oldStep,len); - - if (stepUnits!=codedUnits) { - codedStep=*val * u2s[stepUnits]; - if (codedStep%u2s2[codedUnits]!=0) { - codedUnits=stepUnits; - err = grib_set_long_internal(h,self->codedUnits,codedUnits); - if (err!=GRIB_SUCCESS) return err; - codedStep=*val; - } - else { - codedStep = codedStep / u2s2[codedUnits]; - } - } - else { - codedStep = *val; - } - - if (self->indicatorOfUnitForTimeRange) { - if((err = grib_get_long_internal(h, - self->indicatorOfUnitForTimeRange,&indicatorOfUnitForTimeRange))) return err; - if((err = grib_get_long_internal(h, - self->lengthOfTimeRange,&lengthOfTimeRange))) return err; - if (codedUnits == indicatorOfUnitForTimeRange ) - lengthOfTimeRange-=codedStep-oldStep; - else lengthOfTimeRange-=codedStep * u2s2[codedUnits]/u2s2[indicatorOfUnitForTimeRange]; - lengthOfTimeRange = lengthOfTimeRange > 0 ? lengthOfTimeRange : 0 ; - err = grib_set_long_internal(grib_handle_of_accessor(a),self->lengthOfTimeRange,lengthOfTimeRange); - if (err!=GRIB_SUCCESS) return err; - } - - return grib_set_long_internal(grib_handle_of_accessor(a),self->codedStep,codedStep); + grib_accessor_step_in_units* self = (grib_accessor_step_in_units*)a; + grib_handle* h = grib_handle_of_accessor(a); + int err = 0; + long codedStep, codedUnits, stepUnits; + long oldStep = 0; + long indicatorOfUnitForTimeRange, lengthOfTimeRange; + + if ((err = grib_get_long_internal(h, self->codedUnits, &codedUnits))) + return err; + if ((err = grib_get_long_internal(h, self->stepUnits, &stepUnits))) + return err; + + unpack_long(a, &oldStep, len); + + if (stepUnits != codedUnits) { + codedStep = *val * u2s[stepUnits]; + if (codedStep % u2s2[codedUnits] != 0) { + codedUnits = stepUnits; + err = grib_set_long_internal(h, self->codedUnits, codedUnits); + if (err != GRIB_SUCCESS) + return err; + codedStep = *val; + } + else { + codedStep = codedStep / u2s2[codedUnits]; + } + } + else { + codedStep = *val; + } + + if (self->indicatorOfUnitForTimeRange) { + if ((err = grib_get_long_internal(h, + self->indicatorOfUnitForTimeRange, &indicatorOfUnitForTimeRange))) + return err; + if ((err = grib_get_long_internal(h, + self->lengthOfTimeRange, &lengthOfTimeRange))) + return err; + if (codedUnits == indicatorOfUnitForTimeRange) + lengthOfTimeRange -= codedStep - oldStep; + else + lengthOfTimeRange -= codedStep * u2s2[codedUnits] / u2s2[indicatorOfUnitForTimeRange]; + lengthOfTimeRange = lengthOfTimeRange > 0 ? lengthOfTimeRange : 0; + err = grib_set_long_internal(grib_handle_of_accessor(a), self->lengthOfTimeRange, lengthOfTimeRange); + if (err != GRIB_SUCCESS) + return err; + } + + return grib_set_long_internal(grib_handle_of_accessor(a), self->codedStep, codedStep); } diff --git a/src/grib_accessor_class_sum.c b/src/grib_accessor_class_sum.c index 98e3d8291..53d6595f1 100644 --- a/src/grib_accessor_class_sum.c +++ b/src/grib_accessor_class_sum.c @@ -39,63 +39,64 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_sum { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in double */ -/* Members defined in sum */ - const char* values; +typedef struct grib_accessor_sum +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in double */ + /* Members defined in sum */ + const char* values; } grib_accessor_sum; extern grib_accessor_class* grib_accessor_class_double; static grib_accessor_class _grib_accessor_class_sum = { - &grib_accessor_class_double, /* super */ - "sum", /* name */ - sizeof(grib_accessor_sum), /* size */ + &grib_accessor_class_double, /* super */ + "sum", /* name */ + sizeof(grib_accessor_sum), /* size */ 0, /* inited */ &init_class, /* init_class */ &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures double */ &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -104,122 +105,126 @@ grib_accessor_class* grib_accessor_class_sum = &_grib_accessor_class_sum; static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->pack_double = (*(c->super))->pack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->pack_double = (*(c->super))->pack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_sum* self = (grib_accessor_sum*)a; - int n = 0; - self->values = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - a->length=0; + int n = 0; + self->values = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + a->length = 0; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } -static int unpack_long (grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_sum* self = (grib_accessor_sum*)a; - int ret = 0; - size_t size=0; - long* values=0; + int ret = 0; + size_t size = 0; + long* values = 0; long i; - long count=0; + long count = 0; - ret=value_count(a,&count); - if (ret) return ret; - size=count; + ret = value_count(a, &count); + if (ret) + return ret; + size = count; - if (size==0) { - *val=0; + if (size == 0) { + *val = 0; return ret; } - values=(long*)grib_context_malloc_clear(a->context,sizeof(long)*size); - if (!values) return GRIB_OUT_OF_MEMORY; + values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); + if (!values) + return GRIB_OUT_OF_MEMORY; - grib_get_long_array(grib_handle_of_accessor(a),self->values,values,&size); + grib_get_long_array(grib_handle_of_accessor(a), self->values, values, &size); - *val=0; - for (i=0;icontext,values); + grib_context_free(a->context, values); return ret; } -static int unpack_double (grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { grib_accessor_sum* self = (grib_accessor_sum*)a; - int ret = 0; - size_t size=0; - double* values=0; + int ret = 0; + size_t size = 0; + double* values = 0; long i; - long count=0; + long count = 0; - ret=value_count(a,&count); - if (ret) return ret; - size=count; + ret = value_count(a, &count); + if (ret) + return ret; + size = count; - if (size==0) { - *val=0; + if (size == 0) { + *val = 0; return ret; } - values=(double*)grib_context_malloc_clear(a->context,sizeof(double)*size); - if (!values) return GRIB_OUT_OF_MEMORY; + values = (double*)grib_context_malloc_clear(a->context, sizeof(double) * size); + if (!values) + return GRIB_OUT_OF_MEMORY; - grib_get_double_array(grib_handle_of_accessor(a),self->values,values,&size); + grib_get_double_array(grib_handle_of_accessor(a), self->values, values, &size); - *val=0; - for (i=0;icontext,values); + grib_context_free(a->context, values); return ret; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { grib_accessor_sum* self = (grib_accessor_sum*)a; - size_t n=0; - int ret=0; + size_t n = 0; + int ret = 0; - ret = grib_get_size(grib_handle_of_accessor(a), self->values,&n); - *count=n; + ret = grib_get_size(grib_handle_of_accessor(a), self->values, &n); + *count = n; if (ret) - grib_context_log(a->context,GRIB_LOG_ERROR, - "%s is unable to get size of %s",a->name,self->values); + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s is unable to get size of %s", a->name, self->values); return ret; } diff --git a/src/grib_accessor_class_suppressed.c b/src/grib_accessor_class_suppressed.c index 44a77cfd1..d2e1ea842 100644 --- a/src/grib_accessor_class_suppressed.c +++ b/src/grib_accessor_class_suppressed.c @@ -35,68 +35,69 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int pack_string(grib_accessor*, const char*, size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int get_native_type(grib_accessor*); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int pack_string(grib_accessor*, const char*, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_suppressed { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in suppressed */ - grib_arguments* args; +typedef struct grib_accessor_suppressed +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in suppressed */ + grib_arguments* args; } grib_accessor_suppressed; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_suppressed = { - &grib_accessor_class_long, /* super */ - "suppressed", /* name */ - sizeof(grib_accessor_suppressed), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - &pack_string, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "suppressed", /* name */ + sizeof(grib_accessor_suppressed), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + &pack_string, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -105,99 +106,99 @@ grib_accessor_class* grib_accessor_class_suppressed = &_grib_accessor_class_supp static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_suppressed* self = (grib_accessor_suppressed*)a; - self->args = c; + self->args = c; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; - a->length=0; + a->length = 0; } static void log_message(grib_accessor* a) { grib_accessor_suppressed* self = (grib_accessor_suppressed*)a; - int i=0; - - grib_context_log(a->context,GRIB_LOG_ERROR, - "key %s is unavailable in this version.",a->name); - grib_context_log(a->context,GRIB_LOG_ERROR, - "Please use the following keys:"); - while (grib_arguments_get_name(grib_handle_of_accessor(a),self->args,i)) { - grib_context_log(a->context,GRIB_LOG_ERROR, - "\t- %s", - grib_arguments_get_name(grib_handle_of_accessor(a),self->args,i)); + int i = 0; + + grib_context_log(a->context, GRIB_LOG_ERROR, + "key %s is unavailable in this version.", a->name); + grib_context_log(a->context, GRIB_LOG_ERROR, + "Please use the following keys:"); + while (grib_arguments_get_name(grib_handle_of_accessor(a), self->args, i)) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "\t- %s", + grib_arguments_get_name(grib_handle_of_accessor(a), self->args, i)); i++; } } -static int pack_string(grib_accessor* a, const char* val, size_t *len) +static int pack_string(grib_accessor* a, const char* val, size_t* len) { log_message(a); return GRIB_NOT_IMPLEMENTED; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { log_message(a); return GRIB_NOT_IMPLEMENTED; } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { log_message(a); return GRIB_NOT_IMPLEMENTED; } -static int unpack_string(grib_accessor* a, char* val, size_t *len) -{ +static int unpack_string(grib_accessor* a, char* val, size_t* len) +{ /*log_message(a);*/ return GRIB_NOT_IMPLEMENTED; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) -{ +static int unpack_long(grib_accessor* a, long* val, size_t* len) +{ log_message(a); return GRIB_NOT_IMPLEMENTED; } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { log_message(a); return GRIB_NOT_IMPLEMENTED; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - *count=1; + *count = 1; return 0; } diff --git a/src/grib_accessor_class_time.c b/src/grib_accessor_class_time.c index 788d0274b..609ebf6d4 100644 --- a/src/grib_accessor_class_time.c +++ b/src/grib_accessor_class_time.c @@ -36,66 +36,67 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_time { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in time */ - const char* hour; - const char* minute; - const char* second; +typedef struct grib_accessor_time +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in time */ + const char* hour; + const char* minute; + const char* second; } grib_accessor_time; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_time = { - &grib_accessor_class_long, /* super */ - "time", /* name */ - sizeof(grib_accessor_time), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "time", /* name */ + sizeof(grib_accessor_time), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -104,135 +105,134 @@ grib_accessor_class* grib_accessor_class_time = &_grib_accessor_class_time; static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_time* self = (grib_accessor_time*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int n = 0; + grib_handle* hand = grib_handle_of_accessor(a); + int n = 0; - self->hour = grib_arguments_get_name(hand,c,n++); - self->minute = grib_arguments_get_name(hand,c,n++); - self->second = grib_arguments_get_name(hand,c,n++); + self->hour = grib_arguments_get_name(hand, c, n++); + self->minute = grib_arguments_get_name(hand, c, n++); + self->second = grib_arguments_get_name(hand, c, n++); } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_long(dumper,a,NULL); + grib_dump_long(dumper, a, NULL); } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - int ret=0; + int ret = 0; grib_accessor_time* self = (grib_accessor_time*)a; - long hour = 0; - long minute = 0; - long second = 0; - grib_handle* hand = grib_handle_of_accessor(a); + long hour = 0; + long minute = 0; + long second = 0; + grib_handle* hand = grib_handle_of_accessor(a); - if ((ret=grib_get_long_internal(hand, self->hour,&hour))!=GRIB_SUCCESS) + if ((ret = grib_get_long_internal(hand, self->hour, &hour)) != GRIB_SUCCESS) return ret; - if ((ret=grib_get_long_internal(hand, self->minute,&minute))!=GRIB_SUCCESS) + if ((ret = grib_get_long_internal(hand, self->minute, &minute)) != GRIB_SUCCESS) return ret; - if ((ret=grib_get_long_internal(hand, self->second,&second))!=GRIB_SUCCESS) + if ((ret = grib_get_long_internal(hand, self->second, &second)) != GRIB_SUCCESS) return ret; /* We ignore the 'seconds' in our time calculation! */ if (second != 0) { grib_context_log(a->context, GRIB_LOG_ERROR, - "Truncating time: non-zero seconds(%d) ignored", second); + "Truncating time: non-zero seconds(%d) ignored", second); } - if(*len < 1) + if (*len < 1) return GRIB_WRONG_ARRAY_SIZE; - *val = hour*100 + minute; + *val = hour * 100 + minute; - if(hour == 255) - *val = 12*100; + if (hour == 255) + *val = 12 * 100; - if(hour != 255 && minute == 255) - *val = hour*100; + if (hour != 255 && minute == 255) + *val = hour * 100; return GRIB_SUCCESS; } /* TODO: Check for a valid date */ -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { - int ret=0; - long v = val[0]; + int ret = 0; + long v = val[0]; grib_accessor_time* self = (grib_accessor_time*)a; - grib_handle* hand = grib_handle_of_accessor(a); - long hour = 0; - long minute = 0; - long second = 0; + grib_handle* hand = grib_handle_of_accessor(a); + long hour = 0; + long minute = 0; + long second = 0; - if(*len != 1) + if (*len != 1) return GRIB_WRONG_ARRAY_SIZE; - hour = v / 100; - minute = v % 100; - second = 0; /* We ignore the 'seconds' in our time calculation! */ + hour = v / 100; + minute = v % 100; + second = 0; /* We ignore the 'seconds' in our time calculation! */ - if ((ret=grib_set_long_internal(hand,self->hour,hour))!=GRIB_SUCCESS) + if ((ret = grib_set_long_internal(hand, self->hour, hour)) != GRIB_SUCCESS) return ret; - if ((ret=grib_set_long_internal(hand,self->minute,minute))!=GRIB_SUCCESS) + if ((ret = grib_set_long_internal(hand, self->minute, minute)) != GRIB_SUCCESS) return ret; - if ((ret=grib_set_long_internal(hand,self->second,second))!=GRIB_SUCCESS) + if ((ret = grib_set_long_internal(hand, self->second, second)) != GRIB_SUCCESS) return ret; return GRIB_SUCCESS; } -static int unpack_string(grib_accessor* a, char* val, size_t *len) +static int unpack_string(grib_accessor* a, char* val, size_t* len) { - long v = 0; + long v = 0; size_t lsize = 1; unpack_long(a, &v, &lsize); - if(*len < 5) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_time : unpack_string : Buffer too small for %s ", a->name ); + if (*len < 5) { + grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_time : unpack_string : Buffer too small for %s ", a->name); *len = 5; return GRIB_BUFFER_TOO_SMALL; } - sprintf(val,"%04ld",v); + sprintf(val, "%04ld", v); len[0] = 5; return GRIB_SUCCESS; diff --git a/src/grib_accessor_class_times.c b/src/grib_accessor_class_times.c index e3c30ede2..ae867c2a7 100644 --- a/src/grib_accessor_class_times.c +++ b/src/grib_accessor_class_times.c @@ -34,68 +34,69 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void init(grib_accessor*,const long, grib_arguments* ); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_times { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in unsigned */ - long nbytes; - grib_arguments* arg; -/* Members defined in times */ - const char* value; - const char* factor; - const char* divisor; +typedef struct grib_accessor_times +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in unsigned */ + long nbytes; + grib_arguments* arg; + /* Members defined in times */ + const char* value; + const char* factor; + const char* divisor; } grib_accessor_times; extern grib_accessor_class* grib_accessor_class_unsigned; static grib_accessor_class _grib_accessor_class_times = { - &grib_accessor_class_unsigned, /* super */ - "times", /* name */ - sizeof(grib_accessor_times), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_unsigned, /* super */ + "times", /* name */ + sizeof(grib_accessor_times), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -104,78 +105,82 @@ grib_accessor_class* grib_accessor_class_times = &_grib_accessor_class_times; static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_times* self = (grib_accessor_times*)a; - int n = 0; + int n = 0; - self->value = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->factor = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->divisor = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - a->length=0; + self->value = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->factor = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->divisor = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + a->length = 0; } -static int unpack_long (grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_times* self = (grib_accessor_times*)a; - int ret = 0; - long factor=0; - long divisor=1; - int *err=&ret; - long value = 0; + int ret = 0; + long factor = 0; + long divisor = 1; + int* err = &ret; + long value = 0; - if(*len < 1) + if (*len < 1) return GRIB_ARRAY_TOO_SMALL; - if (grib_is_missing(grib_handle_of_accessor(a),self->value,err)!=0) { - *val=GRIB_MISSING_LONG; + if (grib_is_missing(grib_handle_of_accessor(a), self->value, err) != 0) { + *val = GRIB_MISSING_LONG; return GRIB_SUCCESS; } - if(ret ) return ret; + if (ret) + return ret; - ret = grib_get_long_internal(grib_handle_of_accessor(a), self->factor,&factor); - if(ret ) return ret; + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->factor, &factor); + if (ret) + return ret; if (self->divisor) - ret = grib_get_long_internal(grib_handle_of_accessor(a), self->divisor,&divisor); - if(ret ) return ret; - ret = grib_get_long_internal(grib_handle_of_accessor(a), self->value,&value); - if(ret ) return ret; + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->divisor, &divisor); + if (ret) + return ret; + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->value, &value); + if (ret) + return ret; /* printf("factor=%ld divisor=%ld value=%ld\n",factor,divisor,value); */ - *val =( (double)value * (double)factor) / (double)divisor; + *val = ((double)value * (double)factor) / (double)divisor; *len = 1; @@ -183,42 +188,45 @@ static int unpack_long (grib_accessor* a, long* val, size_t *len) } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { grib_accessor_times* self = (grib_accessor_times*)a; - int ret = 0; - long value = 0; - long factor,v,divisor=1; + int ret = 0; + long value = 0; + long factor, v, divisor = 1; - if (*val==GRIB_MISSING_LONG) - return grib_set_missing(grib_handle_of_accessor(a),self->value); + if (*val == GRIB_MISSING_LONG) + return grib_set_missing(grib_handle_of_accessor(a), self->value); - ret = grib_get_long_internal(grib_handle_of_accessor(a), self->factor,&factor); - if(ret ) return ret; + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->factor, &factor); + if (ret) + return ret; if (self->divisor) - ret = grib_get_long_internal(grib_handle_of_accessor(a), self->divisor,&divisor); - if(ret ) return ret; + ret = grib_get_long_internal(grib_handle_of_accessor(a), self->divisor, &divisor); + if (ret) + return ret; /*Assert((*val%self->factor)==0);*/ - v=*val*divisor; - if ((v%factor)==0) { - value = v/factor; - } else { - value = v > 0 ? ((double)v)/factor+0.5 : - ((double)v)/factor-0.5; + v = *val * divisor; + if ((v % factor) == 0) { + value = v / factor; + } + else { + value = v > 0 ? ((double)v) / factor + 0.5 : ((double)v) / factor - 0.5; /* grib_context_log(a->context,GRIB_LOG_WARNING,"%s/%ld = %ld/%ld = %ld. Rounding to convert key.",a->name,self->factor,*val,self->factor,value); */ } - ret = grib_set_long_internal(grib_handle_of_accessor(a), self->value,value); - if(ret ) return ret; + ret = grib_set_long_internal(grib_handle_of_accessor(a), self->value, value); + if (ret) + return ret; *len = 1; return ret; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - *count=1; + *count = 1; return 0; } diff --git a/src/grib_accessor_class_to_double.c b/src/grib_accessor_class_to_double.c index fbbef682b..0a0b36455 100644 --- a/src/grib_accessor_class_to_double.c +++ b/src/grib_accessor_class_to_double.c @@ -44,75 +44,76 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int pack_string(grib_accessor*, const char*, size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); +static int get_native_type(grib_accessor*); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int pack_string(grib_accessor*, const char*, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); static size_t string_length(grib_accessor*); static long next_offset(grib_accessor*); -static int value_count(grib_accessor*,long*); +static int value_count(grib_accessor*, long*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void post_init(grib_accessor*); static void init_class(grib_accessor_class*); static int compare(grib_accessor*, grib_accessor*); -typedef struct grib_accessor_to_double { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in to_double */ - const char* key; - long start; - size_t length; - long scale; +typedef struct grib_accessor_to_double +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in to_double */ + const char* key; + long start; + size_t length; + long scale; } grib_accessor_to_double; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_to_double = { - &grib_accessor_class_gen, /* super */ - "to_double", /* name */ - sizeof(grib_accessor_to_double), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - &post_init, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - &next_offset, /* get length of section */ - &string_length, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - &pack_string, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "to_double", /* name */ + sizeof(grib_accessor_to_double), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + &post_init, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + &next_offset, /* get length of section */ + &string_length, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + &pack_string, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + &compare, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -121,200 +122,212 @@ grib_accessor_class* grib_accessor_class_to_double = &_grib_accessor_class_to_do static void init_class(grib_accessor_class* c) { - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len , grib_arguments* arg ) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { - grib_accessor_to_double* self=(grib_accessor_to_double*)a; + grib_accessor_to_double* self = (grib_accessor_to_double*)a; - self->key=grib_arguments_get_name(grib_handle_of_accessor(a),arg,0); - self->start=grib_arguments_get_long(grib_handle_of_accessor(a),arg,1); - self->length=grib_arguments_get_long(grib_handle_of_accessor(a),arg,2); - self->scale=grib_arguments_get_long(grib_handle_of_accessor(a),arg,3); - if (!self->scale) self->scale=1; + self->key = grib_arguments_get_name(grib_handle_of_accessor(a), arg, 0); + self->start = grib_arguments_get_long(grib_handle_of_accessor(a), arg, 1); + self->length = grib_arguments_get_long(grib_handle_of_accessor(a), arg, 2); + self->scale = grib_arguments_get_long(grib_handle_of_accessor(a), arg, 3); + if (!self->scale) + self->scale = 1; a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->length=0; + a->length = 0; } -static void post_init(grib_accessor* a ) +static void post_init(grib_accessor* a) { return; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - grib_accessor_to_double* self=(grib_accessor_to_double*)a; - size_t size=0; + grib_accessor_to_double* self = (grib_accessor_to_double*)a; + size_t size = 0; - int err=grib_get_size(grib_handle_of_accessor(a), self->key,&size); - *count=size; + int err = grib_get_size(grib_handle_of_accessor(a), self->key, &size); + *count = size; return err; } static size_t string_length(grib_accessor* a) { - grib_accessor_to_double* self=(grib_accessor_to_double*)a; - size_t size=0; + grib_accessor_to_double* self = (grib_accessor_to_double*)a; + size_t size = 0; - if (self->length) return self->length; + if (self->length) + return self->length; - _grib_get_string_length(a,&size); + _grib_get_string_length(a, &size); return size; } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_string(dumper,a,NULL); + grib_dump_string(dumper, a, NULL); } -static int get_native_type(grib_accessor* a) +static int get_native_type(grib_accessor* a) { return GRIB_TYPE_LONG; } -static int unpack_string(grib_accessor* a, char* val, size_t *len) +static int unpack_string(grib_accessor* a, char* val, size_t* len) { - int err=0; - grib_accessor_to_double* self=(grib_accessor_to_double*)a; - char buff[512]={0,}; + int err = 0; + grib_accessor_to_double* self = (grib_accessor_to_double*)a; + char buff[512] = {0,}; size_t length; - size_t size=512; + size_t size = 512; - length=string_length(a); + length = string_length(a); - if( len[0] < length+1 ) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%d) for %s it contains %d values ", len[0], a->name , a->length+1 ); + if (len[0] < length + 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%d) for %s it contains %d values ", len[0], a->name, a->length + 1); len[0] = 0; return GRIB_ARRAY_TOO_SMALL; } - err=grib_get_string(grib_handle_of_accessor(a),self->key,buff,&size); - if (err) return err; + err = grib_get_string(grib_handle_of_accessor(a), self->key, buff, &size); + if (err) + return err; if (length > size) { - err=GRIB_STRING_TOO_SMALL; - length=size; + err = GRIB_STRING_TOO_SMALL; + length = size; } - memcpy(val,buff+self->start,length); + memcpy(val, buff + self->start, length); val[length] = 0; - len[0] = length; + len[0] = length; return GRIB_SUCCESS; } -static int pack_string(grib_accessor* a, const char* val, size_t *len) +static int pack_string(grib_accessor* a, const char* val, size_t* len) { return GRIB_NOT_IMPLEMENTED; } -static int pack_long(grib_accessor* a, const long* v, size_t *len) +static int pack_long(grib_accessor* a, const long* v, size_t* len) { - grib_context_log(a->context,GRIB_LOG_ERROR, " Should not pack %s as long", a->name); + grib_context_log(a->context, GRIB_LOG_ERROR, " Should not pack %s as long", a->name); return GRIB_NOT_IMPLEMENTED; } -static int pack_double(grib_accessor* a, const double*v, size_t *len) +static int pack_double(grib_accessor* a, const double* v, size_t* len) { - grib_context_log(a->context,GRIB_LOG_ERROR, " Should not pack %s as double", a->name); + grib_context_log(a->context, GRIB_LOG_ERROR, " Should not pack %s as double", a->name); return GRIB_NOT_IMPLEMENTED; } -static int unpack_long (grib_accessor* a, long* v, size_t *len) +static int unpack_long(grib_accessor* a, long* v, size_t* len) { - grib_accessor_to_double* self=(grib_accessor_to_double*)a; - char val[1024]={0,}; - size_t l = sizeof(val); - char *last = NULL; - int err=grib_unpack_string (a , val, &l); - - if (err) return err; - - *v = strtol(val,&last,10); - if (*last) {err=GRIB_WRONG_CONVERSION;} - *v/=self->scale; + grib_accessor_to_double* self = (grib_accessor_to_double*)a; + char val[1024] = {0,}; + size_t l = sizeof(val); + char* last = NULL; + int err = grib_unpack_string(a, val, &l); + + if (err) + return err; + + *v = strtol(val, &last, 10); + if (*last) { + err = GRIB_WRONG_CONVERSION; + } + *v /= self->scale; return err; } -static int unpack_double (grib_accessor* a, double* v, size_t *len) +static int unpack_double(grib_accessor* a, double* v, size_t* len) { - grib_accessor_to_double* self=(grib_accessor_to_double*)a; - char val[1024]={0,}; - size_t l = sizeof(val); - char *last = NULL; - int err=grib_unpack_string (a , val, &l); - - if (err) return err; - - *v = strtod(val,&last); - if (*last) {err=GRIB_WRONG_CONVERSION;} - *v/=self->scale; + grib_accessor_to_double* self = (grib_accessor_to_double*)a; + char val[1024] = {0,}; + size_t l = sizeof(val); + char* last = NULL; + int err = grib_unpack_string(a, val, &l); + + if (err) + return err; + + *v = strtod(val, &last); + if (*last) { + err = GRIB_WRONG_CONVERSION; + } + *v /= self->scale; return err; } static long next_offset(grib_accessor* a) { - return a->offset+a->length; + return a->offset + a->length; } -static int compare(grib_accessor* a,grib_accessor* b) +static int compare(grib_accessor* a, grib_accessor* b) { - int retval=0; - char *aval=0; - char *bval=0; - int err=0; + int retval = 0; + char* aval = 0; + char* bval = 0; + int err = 0; size_t alen = 0; size_t blen = 0; - long count=0; + long count = 0; - err=grib_value_count(a,&count); - if (err) return err; - alen=count; + err = grib_value_count(a, &count); + if (err) + return err; + alen = count; - err=grib_value_count(b,&count); - if (err) return err; - blen=count; + err = grib_value_count(b, &count); + if (err) + return err; + blen = count; - if (alen != blen) return GRIB_COUNT_MISMATCH; + if (alen != blen) + return GRIB_COUNT_MISMATCH; - aval=(char*)grib_context_malloc(a->context,alen*sizeof(char)); - bval=(char*)grib_context_malloc(b->context,blen*sizeof(char)); + aval = (char*)grib_context_malloc(a->context, alen * sizeof(char)); + bval = (char*)grib_context_malloc(b->context, blen * sizeof(char)); - grib_unpack_string(a,aval,&alen); - grib_unpack_string(b,bval,&blen); + grib_unpack_string(a, aval, &alen); + grib_unpack_string(b, bval, &blen); retval = GRIB_SUCCESS; - if (strcmp(aval,bval)) retval = GRIB_STRING_VALUE_MISMATCH; + if (strcmp(aval, bval)) + retval = GRIB_STRING_VALUE_MISMATCH; - grib_context_free(a->context,aval); - grib_context_free(b->context,bval); + grib_context_free(a->context, aval); + grib_context_free(b->context, bval); return retval; } diff --git a/src/grib_accessor_class_to_integer.c b/src/grib_accessor_class_to_integer.c index f87479038..867a82e7b 100644 --- a/src/grib_accessor_class_to_integer.c +++ b/src/grib_accessor_class_to_integer.c @@ -43,74 +43,75 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int pack_string(grib_accessor*, const char*, size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); +static int get_native_type(grib_accessor*); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int pack_string(grib_accessor*, const char*, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); static size_t string_length(grib_accessor*); static long next_offset(grib_accessor*); -static int value_count(grib_accessor*,long*); +static int value_count(grib_accessor*, long*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void post_init(grib_accessor*); static void init_class(grib_accessor_class*); static int compare(grib_accessor*, grib_accessor*); -typedef struct grib_accessor_to_integer { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in to_integer */ - const char* key; - long start; - size_t length; +typedef struct grib_accessor_to_integer +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in to_integer */ + const char* key; + long start; + size_t length; } grib_accessor_to_integer; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_to_integer = { - &grib_accessor_class_gen, /* super */ - "to_integer", /* name */ - sizeof(grib_accessor_to_integer), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - &post_init, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - &next_offset, /* get length of section */ - &string_length, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - &pack_string, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "to_integer", /* name */ + sizeof(grib_accessor_to_integer), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + &post_init, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + &next_offset, /* get length of section */ + &string_length, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + &pack_string, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + &compare, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -119,189 +120,195 @@ grib_accessor_class* grib_accessor_class_to_integer = &_grib_accessor_class_to_i static void init_class(grib_accessor_class* c) { - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len , grib_arguments* arg ) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { - grib_accessor_to_integer* self=(grib_accessor_to_integer*)a; + grib_accessor_to_integer* self = (grib_accessor_to_integer*)a; - self->key=grib_arguments_get_name(grib_handle_of_accessor(a),arg,0); - self->start=grib_arguments_get_long(grib_handle_of_accessor(a),arg,1); - self->length=grib_arguments_get_long(grib_handle_of_accessor(a),arg,2); + self->key = grib_arguments_get_name(grib_handle_of_accessor(a), arg, 0); + self->start = grib_arguments_get_long(grib_handle_of_accessor(a), arg, 1); + self->length = grib_arguments_get_long(grib_handle_of_accessor(a), arg, 2); a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->length=0; + a->length = 0; } -static void post_init(grib_accessor* a ) +static void post_init(grib_accessor* a) { return; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - grib_accessor_to_integer* self=(grib_accessor_to_integer*)a; - size_t size=0; + grib_accessor_to_integer* self = (grib_accessor_to_integer*)a; + size_t size = 0; - int err=grib_get_size(grib_handle_of_accessor(a), self->key,&size); - *count=size; + int err = grib_get_size(grib_handle_of_accessor(a), self->key, &size); + *count = size; return err; } static size_t string_length(grib_accessor* a) { - grib_accessor_to_integer* self=(grib_accessor_to_integer*)a; - size_t size=0; + grib_accessor_to_integer* self = (grib_accessor_to_integer*)a; + size_t size = 0; - if (self->length) return self->length; + if (self->length) + return self->length; - grib_get_string_length(grib_handle_of_accessor(a),self->key,&size); + grib_get_string_length(grib_handle_of_accessor(a), self->key, &size); return size; } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_long(dumper,a,NULL); + grib_dump_long(dumper, a, NULL); } -static int get_native_type(grib_accessor* a) +static int get_native_type(grib_accessor* a) { return GRIB_TYPE_LONG; } -static int unpack_string(grib_accessor* a, char* val, size_t *len) +static int unpack_string(grib_accessor* a, char* val, size_t* len) { - int err=0; - grib_accessor_to_integer* self=(grib_accessor_to_integer*)a; - char buff[512]={0,}; + int err = 0; + grib_accessor_to_integer* self = (grib_accessor_to_integer*)a; + char buff[512] = {0,}; size_t length; - size_t size=512; + size_t size = 512; - length=string_length(a); + length = string_length(a); - if( len[0] < length+1 ) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%d) for %s it contains %d values ", len[0], a->name , a->length+1 ); + if (len[0] < length + 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%d) for %s it contains %d values ", len[0], a->name, a->length + 1); len[0] = 0; return GRIB_ARRAY_TOO_SMALL; } - err=grib_get_string(grib_handle_of_accessor(a),self->key,buff,&size); - if (err) return err; + err = grib_get_string(grib_handle_of_accessor(a), self->key, buff, &size); + if (err) + return err; if (length > size) { /*err=GRIB_STRING_TOO_SMALL;*/ - length=size; + length = size; } - memcpy(val,buff+self->start,length); + memcpy(val, buff + self->start, length); val[length] = 0; - len[0] = length; + len[0] = length; return GRIB_SUCCESS; } -static int pack_string(grib_accessor* a, const char* val, size_t *len) +static int pack_string(grib_accessor* a, const char* val, size_t* len) { return GRIB_NOT_IMPLEMENTED; } -static int pack_long(grib_accessor* a, const long* v, size_t *len) +static int pack_long(grib_accessor* a, const long* v, size_t* len) { - grib_context_log(a->context,GRIB_LOG_ERROR, " Should not pack %s as long", a->name); + grib_context_log(a->context, GRIB_LOG_ERROR, " Should not pack %s as long", a->name); return GRIB_NOT_IMPLEMENTED; } -static int pack_double(grib_accessor* a, const double*v, size_t *len) +static int pack_double(grib_accessor* a, const double* v, size_t* len) { - grib_context_log(a->context,GRIB_LOG_ERROR, " Should not pack %s as double", a->name); + grib_context_log(a->context, GRIB_LOG_ERROR, " Should not pack %s as double", a->name); return GRIB_NOT_IMPLEMENTED; } -static int unpack_long (grib_accessor* a, long* v, size_t *len) +static int unpack_long(grib_accessor* a, long* v, size_t* len) { - char val[1024]={0,}; - size_t l = sizeof(val); - char *last = NULL; - int err=unpack_string (a , val, &l); + char val[1024] = {0,}; + size_t l = sizeof(val); + char* last = NULL; + int err = unpack_string(a, val, &l); - if (err) return err; + if (err) + return err; - *v = strtol(val,&last,10); + *v = strtol(val, &last, 10); /* if (*last) {err=GRIB_WRONG_CONVERSION;} */ return err; } -static int unpack_double (grib_accessor* a, double *v, size_t *len) +static int unpack_double(grib_accessor* a, double* v, size_t* len) { - size_t l=1; - long val=0; - int err = unpack_long (a , &val, &l); + size_t l = 1; + long val = 0; + int err = unpack_long(a, &val, &l); *v = (double)val; return err; } -static int compare(grib_accessor* a,grib_accessor* b) +static int compare(grib_accessor* a, grib_accessor* b) { - int retval=0; - char *aval=0; - char *bval=0; - int err=0; + int retval = 0; + char* aval = 0; + char* bval = 0; + int err = 0; size_t alen = 0; size_t blen = 0; - long count=0; + long count = 0; - err=grib_value_count(a,&count); - if (err) return err; - alen=count; + err = grib_value_count(a, &count); + if (err) + return err; + alen = count; - err=grib_value_count(b,&count); - if (err) return err; - blen=count; + err = grib_value_count(b, &count); + if (err) + return err; + blen = count; - if (alen != blen) return GRIB_COUNT_MISMATCH; + if (alen != blen) + return GRIB_COUNT_MISMATCH; - aval=(char*)grib_context_malloc(a->context,alen*sizeof(char)); - bval=(char*)grib_context_malloc(b->context,blen*sizeof(char)); + aval = (char*)grib_context_malloc(a->context, alen * sizeof(char)); + bval = (char*)grib_context_malloc(b->context, blen * sizeof(char)); - grib_unpack_string(a,aval,&alen); - grib_unpack_string(b,bval,&blen); + grib_unpack_string(a, aval, &alen); + grib_unpack_string(b, bval, &blen); retval = GRIB_SUCCESS; - if (strcmp(aval,bval)) retval = GRIB_STRING_VALUE_MISMATCH; + if (strcmp(aval, bval)) + retval = GRIB_STRING_VALUE_MISMATCH; - grib_context_free(a->context,aval); - grib_context_free(b->context,bval); + grib_context_free(a->context, aval); + grib_context_free(b->context, bval); return retval; } static long next_offset(grib_accessor* a) { - return a->offset+a->length; + return a->offset + a->length; } diff --git a/src/grib_accessor_class_to_string.c b/src/grib_accessor_class_to_string.c index 284b16bae..1b840be17 100644 --- a/src/grib_accessor_class_to_string.c +++ b/src/grib_accessor_class_to_string.c @@ -43,74 +43,75 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int pack_string(grib_accessor*, const char*, size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); +static int get_native_type(grib_accessor*); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int pack_string(grib_accessor*, const char*, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); static size_t string_length(grib_accessor*); static long next_offset(grib_accessor*); -static int value_count(grib_accessor*,long*); +static int value_count(grib_accessor*, long*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void post_init(grib_accessor*); static void init_class(grib_accessor_class*); static int compare(grib_accessor*, grib_accessor*); -typedef struct grib_accessor_to_string { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in to_string */ - const char* key; - long start; - size_t length; +typedef struct grib_accessor_to_string +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in to_string */ + const char* key; + long start; + size_t length; } grib_accessor_to_string; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_to_string = { - &grib_accessor_class_gen, /* super */ - "to_string", /* name */ - sizeof(grib_accessor_to_string), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - &post_init, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - &next_offset, /* get length of section */ - &string_length, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - &pack_string, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "to_string", /* name */ + sizeof(grib_accessor_to_string), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + &post_init, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + &next_offset, /* get length of section */ + &string_length, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + &pack_string, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + &compare, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -119,189 +120,197 @@ grib_accessor_class* grib_accessor_class_to_string = &_grib_accessor_class_to_st static void init_class(grib_accessor_class* c) { - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len , grib_arguments* arg ) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { - grib_accessor_to_string* self=(grib_accessor_to_string*)a; + grib_accessor_to_string* self = (grib_accessor_to_string*)a; - self->key=grib_arguments_get_name(grib_handle_of_accessor(a),arg,0); - self->start=grib_arguments_get_long(grib_handle_of_accessor(a),arg,1); - self->length=grib_arguments_get_long(grib_handle_of_accessor(a),arg,2); + self->key = grib_arguments_get_name(grib_handle_of_accessor(a), arg, 0); + self->start = grib_arguments_get_long(grib_handle_of_accessor(a), arg, 1); + self->length = grib_arguments_get_long(grib_handle_of_accessor(a), arg, 2); a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; - a->length=0; + a->length = 0; } -static void post_init(grib_accessor* a ) +static void post_init(grib_accessor* a) { return; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - grib_accessor_to_string* self=(grib_accessor_to_string*)a; - size_t size=0; + grib_accessor_to_string* self = (grib_accessor_to_string*)a; + size_t size = 0; - int err=grib_get_size(grib_handle_of_accessor(a), self->key,&size); - *count=size; + int err = grib_get_size(grib_handle_of_accessor(a), self->key, &size); + *count = size; return err; } static size_t string_length(grib_accessor* a) { - grib_accessor_to_string* self=(grib_accessor_to_string*)a; - size_t size=0; + grib_accessor_to_string* self = (grib_accessor_to_string*)a; + size_t size = 0; - if (self->length) return self->length; + if (self->length) + return self->length; - grib_get_string_length(grib_handle_of_accessor(a),self->key,&size); + grib_get_string_length(grib_handle_of_accessor(a), self->key, &size); return size; } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_string(dumper,a,NULL); + grib_dump_string(dumper, a, NULL); } -static int get_native_type(grib_accessor* a) +static int get_native_type(grib_accessor* a) { return GRIB_TYPE_STRING; } -static int unpack_string(grib_accessor* a, char* val, size_t *len) +static int unpack_string(grib_accessor* a, char* val, size_t* len) { - int err=0; - grib_accessor_to_string* self=(grib_accessor_to_string*)a; - char buff[512]={0,}; + int err = 0; + grib_accessor_to_string* self = (grib_accessor_to_string*)a; + char buff[512] = {0,}; size_t length; - size_t size=512; + size_t size = 512; - length=string_length(a); + length = string_length(a); - if( len[0] < length+1 ) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%d) for %s it contains %d values ", len[0], a->name , a->length+1 ); + if (len[0] < length + 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%d) for %s it contains %d values ", len[0], a->name, a->length + 1); len[0] = 0; return GRIB_ARRAY_TOO_SMALL; } - err=grib_get_string(grib_handle_of_accessor(a),self->key,buff,&size); - if (err) return err; + err = grib_get_string(grib_handle_of_accessor(a), self->key, buff, &size); + if (err) + return err; if (length > size) { /*err=GRIB_STRING_TOO_SMALL;*/ - length=size; + length = size; } - memcpy(val,buff+self->start,length); + memcpy(val, buff + self->start, length); val[length] = 0; - len[0] = length; + len[0] = length; return GRIB_SUCCESS; } -static int pack_string(grib_accessor* a, const char* val, size_t *len) +static int pack_string(grib_accessor* a, const char* val, size_t* len) { return GRIB_NOT_IMPLEMENTED; } -static int pack_long(grib_accessor* a, const long* v, size_t *len) +static int pack_long(grib_accessor* a, const long* v, size_t* len) { - grib_context_log(a->context,GRIB_LOG_ERROR, " Should not pack %s as long", a->name); + grib_context_log(a->context, GRIB_LOG_ERROR, " Should not pack %s as long", a->name); return GRIB_NOT_IMPLEMENTED; } -static int pack_double(grib_accessor* a, const double*v, size_t *len) +static int pack_double(grib_accessor* a, const double* v, size_t* len) { - grib_context_log(a->context,GRIB_LOG_ERROR, " Should not pack %s as double", a->name); + grib_context_log(a->context, GRIB_LOG_ERROR, " Should not pack %s as double", a->name); return GRIB_NOT_IMPLEMENTED; } -static int unpack_long (grib_accessor* a, long* v, size_t *len) +static int unpack_long(grib_accessor* a, long* v, size_t* len) { - char val[1024]={0,}; - size_t l = sizeof(val); - char *last = NULL; - int err=unpack_string (a , val, &l); + char val[1024] = {0,}; + size_t l = sizeof(val); + char* last = NULL; + int err = unpack_string(a, val, &l); - if (err) return err; + if (err) + return err; - *v = strtol(val,&last,10); - if (*last) {err=GRIB_WRONG_CONVERSION;} + *v = strtol(val, &last, 10); + if (*last) { + err = GRIB_WRONG_CONVERSION; + } return err; } -static int unpack_double (grib_accessor* a, double *v, size_t *len) +static int unpack_double(grib_accessor* a, double* v, size_t* len) { - size_t l=1; - long val=0; - int err = unpack_long (a , &val, &l); + size_t l = 1; + long val = 0; + int err = unpack_long(a, &val, &l); *v = (double)val; return err; } -static int compare(grib_accessor* a,grib_accessor* b) +static int compare(grib_accessor* a, grib_accessor* b) { - int retval=0; - char *aval=0; - char *bval=0; - int err=0; + int retval = 0; + char* aval = 0; + char* bval = 0; + int err = 0; size_t alen = 0; size_t blen = 0; - long count=0; + long count = 0; - err=grib_value_count(a,&count); - if (err) return err; - alen=count; + err = grib_value_count(a, &count); + if (err) + return err; + alen = count; - err=grib_value_count(b,&count); - if (err) return err; - blen=count; + err = grib_value_count(b, &count); + if (err) + return err; + blen = count; - if (alen != blen) return GRIB_COUNT_MISMATCH; + if (alen != blen) + return GRIB_COUNT_MISMATCH; - aval=(char*)grib_context_malloc(a->context,alen*sizeof(char)); - bval=(char*)grib_context_malloc(b->context,blen*sizeof(char)); + aval = (char*)grib_context_malloc(a->context, alen * sizeof(char)); + bval = (char*)grib_context_malloc(b->context, blen * sizeof(char)); - grib_unpack_string(a,aval,&alen); - grib_unpack_string(b,bval,&blen); + grib_unpack_string(a, aval, &alen); + grib_unpack_string(b, bval, &blen); retval = GRIB_SUCCESS; - if (strcmp(aval,bval)) retval = GRIB_STRING_VALUE_MISMATCH; + if (strcmp(aval, bval)) + retval = GRIB_STRING_VALUE_MISMATCH; - grib_context_free(a->context,aval); - grib_context_free(b->context,bval); + grib_context_free(a->context, aval); + grib_context_free(b->context, bval); return retval; } static long next_offset(grib_accessor* a) { - return a->offset+a->length; + return a->offset + a->length; } diff --git a/src/grib_accessor_class_transient.c b/src/grib_accessor_class_transient.c index b89e9b819..cce792bb0 100644 --- a/src/grib_accessor_class_transient.c +++ b/src/grib_accessor_class_transient.c @@ -32,60 +32,61 @@ or edit "accessor.class" and rerun ./make_class.pl static void init_class(grib_accessor_class*); -typedef struct grib_accessor_transient { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in variable */ - double dval; - char* cval; - char* cname; - int type; -/* Members defined in transient */ +typedef struct grib_accessor_transient +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in variable */ + double dval; + char* cval; + char* cname; + int type; + /* Members defined in transient */ } grib_accessor_transient; extern grib_accessor_class* grib_accessor_class_variable; static grib_accessor_class _grib_accessor_class_transient = { - &grib_accessor_class_variable, /* super */ - "transient", /* name */ - sizeof(grib_accessor_transient), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_variable, /* super */ + "transient", /* name */ + sizeof(grib_accessor_transient), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -94,38 +95,38 @@ grib_accessor_class* grib_accessor_class_transient = &_grib_accessor_class_trans static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ diff --git a/src/grib_accessor_class_transient_darray.c b/src/grib_accessor_class_transient_darray.c index 6e6bd5433..0e8ba5c2f 100644 --- a/src/grib_accessor_class_transient_darray.c +++ b/src/grib_accessor_class_transient_darray.c @@ -36,69 +36,70 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int value_count(grib_accessor*,long*); -static void destroy(grib_context*,grib_accessor*); +static int get_native_type(grib_accessor*); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int value_count(grib_accessor*, long*); +static void destroy(grib_context*, grib_accessor*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); static int compare(grib_accessor*, grib_accessor*); -typedef struct grib_accessor_transient_darray { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in transient_darray */ - grib_darray* arr; - int type; +typedef struct grib_accessor_transient_darray +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in transient_darray */ + grib_darray* arr; + int type; } grib_accessor_transient_darray; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_transient_darray = { - &grib_accessor_class_gen, /* super */ - "transient_darray", /* name */ - sizeof(grib_accessor_transient_darray), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "transient_darray", /* name */ + sizeof(grib_accessor_transient_darray), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + &destroy, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + &compare, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -107,178 +108,184 @@ grib_accessor_class* grib_accessor_class_transient_darray = &_grib_accessor_clas static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long length , grib_arguments* args ) +static void init(grib_accessor* a, const long length, grib_arguments* args) { - - grib_accessor_transient_darray *self = (grib_accessor_transient_darray*)a; - self->arr=NULL; - self->type=GRIB_TYPE_DOUBLE; - a->length = 0; + grib_accessor_transient_darray* self = (grib_accessor_transient_darray*)a; + self->arr = NULL; + self->type = GRIB_TYPE_DOUBLE; + a->length = 0; } static void dump(grib_accessor* a, grib_dumper* dumper) { /* grib_accessor_transient_darray *self = (grib_accessor_transient_darray*)a; */ - grib_dump_double(dumper,a,NULL); + grib_dump_double(dumper, a, NULL); } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { - grib_accessor_transient_darray *self = (grib_accessor_transient_darray*)a; + grib_accessor_transient_darray* self = (grib_accessor_transient_darray*)a; size_t i; - if (self->arr) grib_darray_delete(a->context,self->arr); - self->arr=grib_darray_new(a->context,*len,10); + if (self->arr) + grib_darray_delete(a->context, self->arr); + self->arr = grib_darray_new(a->context, *len, 10); - for (i=0;i<*len;i++) - grib_darray_push(a->context,self->arr,val[i]); + for (i = 0; i < *len; i++) + grib_darray_push(a->context, self->arr, val[i]); return GRIB_SUCCESS; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { - grib_accessor_transient_darray *self = (grib_accessor_transient_darray*)a; + grib_accessor_transient_darray* self = (grib_accessor_transient_darray*)a; size_t i; - if (self->arr) grib_darray_delete(a->context,self->arr); - self->arr=grib_darray_new(a->context,*len,10); + if (self->arr) + grib_darray_delete(a->context, self->arr); + self->arr = grib_darray_new(a->context, *len, 10); - for (i=0;i<*len;i++) - grib_darray_push(a->context,self->arr,(double)val[i]); + for (i = 0; i < *len; i++) + grib_darray_push(a->context, self->arr, (double)val[i]); return GRIB_SUCCESS; } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - grib_accessor_transient_darray *self = (grib_accessor_transient_darray*)a; - long count=0; + grib_accessor_transient_darray* self = (grib_accessor_transient_darray*)a; + long count = 0; size_t i; - value_count(a,&count); + value_count(a, &count); - if(*len < count) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s (setting %d, required %d) ", a->name , *len,count ); + if (*len < count) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s (setting %d, required %d) ", a->name, *len, count); return GRIB_ARRAY_TOO_SMALL; } - *len=count; - for (i=0;i<*len;i++) val[i]=self->arr->v[i]; + *len = count; + for (i = 0; i < *len; i++) + val[i] = self->arr->v[i]; return GRIB_SUCCESS; - } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - grib_accessor_transient_darray *self = (grib_accessor_transient_darray*)a; - long count=0; + grib_accessor_transient_darray* self = (grib_accessor_transient_darray*)a; + long count = 0; size_t i; - value_count(a,&count); + value_count(a, &count); - if(*len < count) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s (setting %d, required %d) ", a->name , *len,count ); + if (*len < count) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s (setting %d, required %d) ", a->name, *len, count); return GRIB_ARRAY_TOO_SMALL; } - *len=count; - for (i=0;i<*len;i++) val[i]=(long)self->arr->v[i]; + *len = count; + for (i = 0; i < *len; i++) + val[i] = (long)self->arr->v[i]; return GRIB_SUCCESS; - } -static void destroy(grib_context* c,grib_accessor* a) +static void destroy(grib_context* c, grib_accessor* a) { - grib_accessor_transient_darray *self = (grib_accessor_transient_darray*)a; - if (self->arr) grib_darray_delete(a->context,self->arr); + grib_accessor_transient_darray* self = (grib_accessor_transient_darray*)a; + if (self->arr) + grib_darray_delete(a->context, self->arr); } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - grib_accessor_transient_darray *self = (grib_accessor_transient_darray*)a; - if (self->arr) *count=grib_darray_used_size(self->arr); - else *count=0; + grib_accessor_transient_darray* self = (grib_accessor_transient_darray*)a; + if (self->arr) + *count = grib_darray_used_size(self->arr); + else + *count = 0; return 0; } -static int compare(grib_accessor* a, grib_accessor* b) { - int retval=0; - double *aval=0; - double *bval=0; +static int compare(grib_accessor* a, grib_accessor* b) +{ + int retval = 0; + double* aval = 0; + double* bval = 0; size_t alen = 0; size_t blen = 0; - int err=0; - long count=0; + int err = 0; + long count = 0; - err=grib_value_count(a,&count); - if (err) return err; - alen=count; + err = grib_value_count(a, &count); + if (err) + return err; + alen = count; - err=grib_value_count(b,&count); - if (err) return err; - blen=count; + err = grib_value_count(b, &count); + if (err) + return err; + blen = count; - if (alen != blen) return GRIB_COUNT_MISMATCH; + if (alen != blen) + return GRIB_COUNT_MISMATCH; - aval=(double*)grib_context_malloc(a->context,alen*sizeof(double)); - bval=(double*)grib_context_malloc(b->context,blen*sizeof(double)); + aval = (double*)grib_context_malloc(a->context, alen * sizeof(double)); + bval = (double*)grib_context_malloc(b->context, blen * sizeof(double)); - grib_unpack_double(a,aval,&alen); - grib_unpack_double(b,bval,&blen); + grib_unpack_double(a, aval, &alen); + grib_unpack_double(b, bval, &blen); retval = GRIB_SUCCESS; while (alen != 0) { - if (*bval != *aval) retval = GRIB_DOUBLE_VALUE_MISMATCH; + if (*bval != *aval) + retval = GRIB_DOUBLE_VALUE_MISMATCH; alen--; } - grib_context_free(a->context,aval); - grib_context_free(b->context,bval); + grib_context_free(a->context, aval); + grib_context_free(b->context, bval); return retval; } static int get_native_type(grib_accessor* a) { - grib_accessor_transient_darray *self = (grib_accessor_transient_darray*)a; + grib_accessor_transient_darray* self = (grib_accessor_transient_darray*)a; return self->type; } - diff --git a/src/grib_accessor_class_uint16.c b/src/grib_accessor_class_uint16.c index eb9c7c016..9b0d0262c 100644 --- a/src/grib_accessor_class_uint16.c +++ b/src/grib_accessor_class_uint16.c @@ -32,59 +32,60 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_uint16 { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in uint16 */ +typedef struct grib_accessor_uint16 +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in uint16 */ } grib_accessor_uint16; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_uint16 = { - &grib_accessor_class_gen, /* super */ - "uint16", /* name */ - sizeof(grib_accessor_uint16), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "uint16", /* name */ + sizeof(grib_accessor_uint16), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -93,49 +94,48 @@ grib_accessor_class* grib_accessor_class_uint16 = &_grib_accessor_class_uint16; static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { long value = 0; /*long pos = a->offset;*/ /*unsigned char* data = grib_handle_of_accessor(a)->buffer->data;*/ - if(*len < 1) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name , 1 ); + if (*len < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); *len = 0; return GRIB_ARRAY_TOO_SMALL; } @@ -146,7 +146,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) } -static int pack_long(grib_accessor* a, const long* val, size_t *len) { +static int pack_long(grib_accessor* a, const long* val, size_t* len) +{ return GRIB_NOT_IMPLEMENTED; } - diff --git a/src/grib_accessor_class_uint16_little_endian.c b/src/grib_accessor_class_uint16_little_endian.c index 7831d5db3..d7c49ecaf 100644 --- a/src/grib_accessor_class_uint16_little_endian.c +++ b/src/grib_accessor_class_uint16_little_endian.c @@ -32,59 +32,60 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_uint16_little_endian { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in uint16_little_endian */ +typedef struct grib_accessor_uint16_little_endian +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in uint16_little_endian */ } grib_accessor_uint16_little_endian; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_uint16_little_endian = { - &grib_accessor_class_gen, /* super */ - "uint16_little_endian", /* name */ - sizeof(grib_accessor_uint16_little_endian), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "uint16_little_endian", /* name */ + sizeof(grib_accessor_uint16_little_endian), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -93,49 +94,48 @@ grib_accessor_class* grib_accessor_class_uint16_little_endian = &_grib_accessor_ static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { long value = 0; /*long pos = a->offset;*/ /*unsigned char* data = grib_handle_of_accessor(a)->buffer->data;*/ - if(*len < 1) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name , 1 ); + if (*len < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); *len = 0; return GRIB_ARRAY_TOO_SMALL; } @@ -146,7 +146,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) } -static int pack_long(grib_accessor* a, const long* val, size_t *len) { +static int pack_long(grib_accessor* a, const long* val, size_t* len) +{ return GRIB_NOT_IMPLEMENTED; } - diff --git a/src/grib_accessor_class_uint32.c b/src/grib_accessor_class_uint32.c index 9503fcb89..608c63ed3 100644 --- a/src/grib_accessor_class_uint32.c +++ b/src/grib_accessor_class_uint32.c @@ -33,60 +33,61 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); +static int get_native_type(grib_accessor*); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_uint32 { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in uint32 */ +typedef struct grib_accessor_uint32 +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in uint32 */ } grib_accessor_uint32; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_uint32 = { - &grib_accessor_class_gen, /* super */ - "uint32", /* name */ - sizeof(grib_accessor_uint32), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "uint32", /* name */ + sizeof(grib_accessor_uint32), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -95,48 +96,47 @@ grib_accessor_class* grib_accessor_class_uint32 = &_grib_accessor_class_uint32; static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { long value = 0; /* long pos = a->offset; */ /* unsigned char* data = grib_handle_of_accessor(a)->buffer->data; */ - if(*len < 1) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name , 1 ); + if (*len < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); *len = 0; return GRIB_ARRAY_TOO_SMALL; } @@ -147,11 +147,13 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) } -static int pack_long(grib_accessor* a, const long* val, size_t *len) { +static int pack_long(grib_accessor* a, const long* val, size_t* len) +{ return GRIB_NOT_IMPLEMENTED; } -static int get_native_type(grib_accessor* a) { +static int get_native_type(grib_accessor* a) +{ return GRIB_TYPE_LONG; } diff --git a/src/grib_accessor_class_uint32_little_endian.c b/src/grib_accessor_class_uint32_little_endian.c index ba1e7227d..73558f30f 100644 --- a/src/grib_accessor_class_uint32_little_endian.c +++ b/src/grib_accessor_class_uint32_little_endian.c @@ -33,60 +33,61 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); +static int get_native_type(grib_accessor*); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_uint32_little_endian { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in uint32_little_endian */ +typedef struct grib_accessor_uint32_little_endian +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in uint32_little_endian */ } grib_accessor_uint32_little_endian; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_uint32_little_endian = { - &grib_accessor_class_gen, /* super */ - "uint32_little_endian", /* name */ - sizeof(grib_accessor_uint32_little_endian), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "uint32_little_endian", /* name */ + sizeof(grib_accessor_uint32_little_endian), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -95,48 +96,47 @@ grib_accessor_class* grib_accessor_class_uint32_little_endian = &_grib_accessor_ static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { long value = 0; /* long pos = a->offset; */ /* unsigned char* data = grib_handle_of_accessor(a)->buffer->data; */ - if(*len < 1) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name , 1 ); + if (*len < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); *len = 0; return GRIB_ARRAY_TOO_SMALL; } @@ -147,12 +147,12 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { return GRIB_NOT_IMPLEMENTED; } -static int get_native_type(grib_accessor* a) +static int get_native_type(grib_accessor* a) { return GRIB_TYPE_LONG; } diff --git a/src/grib_accessor_class_uint64.c b/src/grib_accessor_class_uint64.c index affd9dd8d..a77019bfd 100644 --- a/src/grib_accessor_class_uint64.c +++ b/src/grib_accessor_class_uint64.c @@ -33,60 +33,61 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); +static int get_native_type(grib_accessor*); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_uint64 { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in uint64 */ +typedef struct grib_accessor_uint64 +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in uint64 */ } grib_accessor_uint64; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_uint64 = { - &grib_accessor_class_gen, /* super */ - "uint64", /* name */ - sizeof(grib_accessor_uint64), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "uint64", /* name */ + sizeof(grib_accessor_uint64), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -95,65 +96,64 @@ grib_accessor_class* grib_accessor_class_uint64 = &_grib_accessor_class_uint64; static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - long value = 0; - long pos = a->offset; - unsigned char* data = grib_handle_of_accessor(a)->buffer->data; + long value = 0; + long pos = a->offset; + unsigned char* data = grib_handle_of_accessor(a)->buffer->data; unsigned long long result = 0, tmp; int i; - if(*len < 1) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name , 1 ); + if (*len < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); *len = 0; return GRIB_ARRAY_TOO_SMALL; } - for(i = 0 ; i < 8; i ++) { + for (i = 0; i < 8; i++) { result <<= 8; result |= data[pos + i]; } value = result; - tmp = value; + tmp = value; /* Result does not fit in long */ - if(tmp != result) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Value for %s cannot be decoded as a 'long' (%llu)", a->name , result ); + if (tmp != result) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Value for %s cannot be decoded as a 'long' (%llu)", a->name, result); return GRIB_DECODING_ERROR; } @@ -163,10 +163,12 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) } -static int pack_long(grib_accessor* a, const long* val, size_t *len) { +static int pack_long(grib_accessor* a, const long* val, size_t* len) +{ return GRIB_NOT_IMPLEMENTED; } -static int get_native_type(grib_accessor* a) { +static int get_native_type(grib_accessor* a) +{ return GRIB_TYPE_LONG; } diff --git a/src/grib_accessor_class_uint64_little_endian.c b/src/grib_accessor_class_uint64_little_endian.c index eb384b963..7a9358009 100644 --- a/src/grib_accessor_class_uint64_little_endian.c +++ b/src/grib_accessor_class_uint64_little_endian.c @@ -33,60 +33,61 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); +static int get_native_type(grib_accessor*); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_uint64_little_endian { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in uint64_little_endian */ +typedef struct grib_accessor_uint64_little_endian +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in uint64_little_endian */ } grib_accessor_uint64_little_endian; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_uint64_little_endian = { - &grib_accessor_class_gen, /* super */ - "uint64_little_endian", /* name */ - sizeof(grib_accessor_uint64_little_endian), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "uint64_little_endian", /* name */ + sizeof(grib_accessor_uint64_little_endian), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -95,65 +96,64 @@ grib_accessor_class* grib_accessor_class_uint64_little_endian = &_grib_accessor_ static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - long value = 0; - long pos = a->offset; - unsigned char* data = grib_handle_of_accessor(a)->buffer->data; + long value = 0; + long pos = a->offset; + unsigned char* data = grib_handle_of_accessor(a)->buffer->data; unsigned long long result = 0, tmp; int i; - if(*len < 1) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name , 1 ); + if (*len < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); *len = 0; return GRIB_ARRAY_TOO_SMALL; } - for(i = 7 ; i >= 0; i --) { + for (i = 7; i >= 0; i--) { result <<= 8; result |= data[pos + i]; } value = result; - tmp = value; + tmp = value; /* Result does not fit in long */ - if(tmp != result) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Value for %s cannot be decoded as a 'long' (%llu)", a->name , result ); + if (tmp != result) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Value for %s cannot be decoded as a 'long' (%llu)", a->name, result); return GRIB_DECODING_ERROR; } @@ -163,12 +163,12 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { return GRIB_NOT_IMPLEMENTED; } -static int get_native_type(grib_accessor* a) +static int get_native_type(grib_accessor* a) { return GRIB_TYPE_LONG; } diff --git a/src/grib_accessor_class_uint8.c b/src/grib_accessor_class_uint8.c index 729f59aa4..d9bc80e0f 100644 --- a/src/grib_accessor_class_uint8.c +++ b/src/grib_accessor_class_uint8.c @@ -33,60 +33,61 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); +static int get_native_type(grib_accessor*); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_uint8 { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in uint8 */ +typedef struct grib_accessor_uint8 +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in uint8 */ } grib_accessor_uint8; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_uint8 = { - &grib_accessor_class_gen, /* super */ - "uint8", /* name */ - sizeof(grib_accessor_uint8), /* size */ + &grib_accessor_class_gen, /* super */ + "uint8", /* name */ + sizeof(grib_accessor_uint8), /* size */ 0, /* inited */ &init_class, /* init_class */ - 0, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ + 0, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -95,48 +96,47 @@ grib_accessor_class* grib_accessor_class_uint8 = &_grib_accessor_class_uint8; static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - long value = 0; - long pos = a->offset; + long value = 0; + long pos = a->offset; unsigned char* data = grib_handle_of_accessor(a)->buffer->data; - if(*len < 1) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name , 1 ); + if (*len < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); *len = 0; return GRIB_ARRAY_TOO_SMALL; } @@ -149,10 +149,12 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) } -static int pack_long(grib_accessor* a, const long* val, size_t *len) { +static int pack_long(grib_accessor* a, const long* val, size_t* len) +{ return GRIB_NOT_IMPLEMENTED; } -static int get_native_type(grib_accessor* a) { +static int get_native_type(grib_accessor* a) +{ return GRIB_TYPE_LONG; } diff --git a/src/grib_accessor_class_unexpanded_descriptors.c b/src/grib_accessor_class_unexpanded_descriptors.c index 24fbedc83..362abf5f2 100644 --- a/src/grib_accessor_class_unexpanded_descriptors.c +++ b/src/grib_accessor_class_unexpanded_descriptors.c @@ -38,68 +38,69 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); static long byte_offset(grib_accessor*); static long next_offset(grib_accessor*); -static int value_count(grib_accessor*,long*); +static int value_count(grib_accessor*, long*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -static void update_size(grib_accessor*,size_t); - -typedef struct grib_accessor_unexpanded_descriptors { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in unexpanded_descriptors */ - grib_accessor* unexpandedDescriptorsEncoded; - const char* createNewData; +static void update_size(grib_accessor*, size_t); + +typedef struct grib_accessor_unexpanded_descriptors +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in unexpanded_descriptors */ + grib_accessor* unexpandedDescriptorsEncoded; + const char* createNewData; } grib_accessor_unexpanded_descriptors; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_unexpanded_descriptors = { - &grib_accessor_class_long, /* super */ - "unexpanded_descriptors", /* name */ - sizeof(grib_accessor_unexpanded_descriptors), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - &next_offset, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - &byte_offset, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - &update_size, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "unexpanded_descriptors", /* name */ + sizeof(grib_accessor_unexpanded_descriptors), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + &next_offset, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + &byte_offset, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + &update_size, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -108,142 +109,145 @@ grib_accessor_class* grib_accessor_class_unexpanded_descriptors = &_grib_accesso static void init_class(grib_accessor_class* c) { - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len , grib_arguments* args ) +static void init(grib_accessor* a, const long len, grib_arguments* args) { grib_accessor_unexpanded_descriptors* self = (grib_accessor_unexpanded_descriptors*)a; - int n=0; - grib_handle* hand=grib_handle_of_accessor(a); - self->unexpandedDescriptorsEncoded=grib_find_accessor(hand,grib_arguments_get_name(hand,args,n++)); - self->createNewData=grib_arguments_get_name(hand,args,n++); - a->length = 0; + int n = 0; + grib_handle* hand = grib_handle_of_accessor(a); + self->unexpandedDescriptorsEncoded = grib_find_accessor(hand, grib_arguments_get_name(hand, args, n++)); + self->createNewData = grib_arguments_get_name(hand, args, n++); + a->length = 0; } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_long(dumper,a,NULL); + grib_dump_long(dumper, a, NULL); } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_unexpanded_descriptors* self = (grib_accessor_unexpanded_descriptors*)a; - int ret=0; - long pos = 0; - long rlen =0; - long f,x,y; - long *v=val; + int ret = 0; + long pos = 0; + long rlen = 0; + long f, x, y; + long* v = val; long i; - grib_handle* hand=grib_handle_of_accessor(a); + grib_handle* hand = grib_handle_of_accessor(a); - pos=accessor_raw_get_offset(self->unexpandedDescriptorsEncoded)*8; + pos = accessor_raw_get_offset(self->unexpandedDescriptorsEncoded) * 8; - ret=value_count(a,&rlen); - if (ret) return ret; + ret = value_count(a, &rlen); + if (ret) + return ret; - if (rlen==0) { - grib_context_log(a->context,GRIB_LOG_ERROR, - "No descriptors in section 3. Malformed message."); + if (rlen == 0) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "No descriptors in section 3. Malformed message."); return GRIB_MESSAGE_MALFORMED; } - if(*len < rlen) - { + if (*len < rlen) { /* grib_context_log(a->context, GRIB_LOG_ERROR, */ - /* " wrong size (%ld) for %s it contains %d values ",*len, a->name , rlen); */ + /* " wrong size (%ld) for %s it contains %d values ",*len, a->name , rlen); */ *len = 0; return GRIB_ARRAY_TOO_SMALL; } - for (i=0;ibuffer->data,&pos,2); - x=grib_decode_unsigned_long(hand->buffer->data,&pos,6); - y=grib_decode_unsigned_long(hand->buffer->data,&pos,8); - *v++=f*100000+x*1000+y; + for (i = 0; i < rlen; i++) { + f = grib_decode_unsigned_long(hand->buffer->data, &pos, 2); + x = grib_decode_unsigned_long(hand->buffer->data, &pos, 6); + y = grib_decode_unsigned_long(hand->buffer->data, &pos, 8); + *v++ = f * 100000 + x * 1000 + y; } *len = rlen; return GRIB_SUCCESS; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { grib_accessor_unexpanded_descriptors* self = (grib_accessor_unexpanded_descriptors*)a; - int ret=0; - long pos = 0; - unsigned long f,x,y; - unsigned char* buf = NULL; - grib_accessor* expanded=NULL; - size_t buflen=*len*2; + int ret = 0; + long pos = 0; + unsigned long f, x, y; + unsigned char* buf = NULL; + grib_accessor* expanded = NULL; + size_t buflen = *len * 2; size_t i = 0, length = *len; - long createNewData=1; - grib_handle* hand=grib_handle_of_accessor(a); + long createNewData = 1; + grib_handle* hand = grib_handle_of_accessor(a); - grib_get_long(hand,self->createNewData,&createNewData); + grib_get_long(hand, self->createNewData, &createNewData); - buf=(unsigned char*)grib_context_malloc_clear(a->context,buflen); + buf = (unsigned char*)grib_context_malloc_clear(a->context, buflen); - for (i=0;iunexpandedDescriptorsEncoded,buf,&buflen); - grib_context_free(hand->context,buf); + grib_pack_bytes(self->unexpandedDescriptorsEncoded, buf, &buflen); + grib_context_free(hand->context, buf); - if (createNewData==0) return ret; + if (createNewData == 0) + return ret; - expanded=grib_find_accessor(hand,"expandedCodes"); - Assert(expanded!=NULL); - ret = grib_accessor_class_expanded_descriptors_set_do_expand(expanded,1); - if (ret != GRIB_SUCCESS) return ret; + expanded = grib_find_accessor(hand, "expandedCodes"); + Assert(expanded != NULL); + ret = grib_accessor_class_expanded_descriptors_set_do_expand(expanded, 1); + if (ret != GRIB_SUCCESS) + return ret; - ret = grib_set_long(hand,"unpack",3); /* BUFR new data */ - if (ret != GRIB_SUCCESS) return ret; + ret = grib_set_long(hand, "unpack", 3); /* BUFR new data */ + if (ret != GRIB_SUCCESS) + return ret; - ret = grib_set_long(hand,"unpack",1); /* Unpack structure */ + ret = grib_set_long(hand, "unpack", 1); /* Unpack structure */ return ret; } -static int value_count(grib_accessor* a,long* numberOfUnexpandedDescriptors) +static int value_count(grib_accessor* a, long* numberOfUnexpandedDescriptors) { grib_accessor_unexpanded_descriptors* self = (grib_accessor_unexpanded_descriptors*)a; - long n=0; + long n = 0; - grib_value_count(self->unexpandedDescriptorsEncoded,&n); - *numberOfUnexpandedDescriptors=n/2; + grib_value_count(self->unexpandedDescriptorsEncoded, &n); + *numberOfUnexpandedDescriptors = n / 2; return 0; } @@ -253,12 +257,12 @@ static long byte_offset(grib_accessor* a) return a->offset; } -static void update_size(grib_accessor* a,size_t s) +static void update_size(grib_accessor* a, size_t s) { a->length = s; } static long next_offset(grib_accessor* a) { - return byte_offset(a)+a->length; + return byte_offset(a) + a->length; } diff --git a/src/grib_accessor_class_unpack_bufr_values.c b/src/grib_accessor_class_unpack_bufr_values.c index 0c4481432..532edb9df 100644 --- a/src/grib_accessor_class_unpack_bufr_values.c +++ b/src/grib_accessor_class_unpack_bufr_values.c @@ -36,69 +36,70 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); -static int unpack_string_array (grib_accessor*, char**, size_t *len); -static int value_count(grib_accessor*,long*); -static void destroy(grib_context*,grib_accessor*); +static int get_native_type(grib_accessor*); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); +static int unpack_string_array(grib_accessor*, char**, size_t* len); +static int value_count(grib_accessor*, long*); +static void destroy(grib_context*, grib_accessor*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_unpack_bufr_values { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in unpack_bufr_values */ - grib_accessor* data_accessor; +typedef struct grib_accessor_unpack_bufr_values +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in unpack_bufr_values */ + grib_accessor* data_accessor; } grib_accessor_unpack_bufr_values; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_unpack_bufr_values = { - &grib_accessor_class_gen, /* super */ - "unpack_bufr_values", /* name */ - sizeof(grib_accessor_unpack_bufr_values), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - &unpack_string_array, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "unpack_bufr_values", /* name */ + sizeof(grib_accessor_unpack_bufr_values), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + &destroy, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + &unpack_string_array, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -107,39 +108,39 @@ grib_accessor_class* grib_accessor_class_unpack_bufr_values = &_grib_accessor_cl static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_string = (*(c->super))->pack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_string = (*(c->super))->pack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len, grib_arguments* params) { - +static void init(grib_accessor* a, const long len, grib_arguments* params) +{ char* key; grib_accessor_unpack_bufr_values* self = (grib_accessor_unpack_bufr_values*)a; - key = (char*)grib_arguments_get_name(grib_handle_of_accessor(a),params,0); - self->data_accessor=grib_find_accessor(grib_handle_of_accessor(a),key); + key = (char*)grib_arguments_get_name(grib_handle_of_accessor(a), params, 0); + self->data_accessor = grib_find_accessor(grib_handle_of_accessor(a), key); a->length = 0; } @@ -148,71 +149,73 @@ static void dump(grib_accessor* a, grib_dumper* dumper) { } -static int unpack_string_array (grib_accessor* a, char** buffer, size_t *len) +static int unpack_string_array(grib_accessor* a, char** buffer, size_t* len) { grib_accessor_unpack_bufr_values* self = (grib_accessor_unpack_bufr_values*)a; - grib_accessor* data=(grib_accessor*)self->data_accessor; + grib_accessor* data = (grib_accessor*)self->data_accessor; - return grib_unpack_double(data,0,0); + return grib_unpack_double(data, 0, 0); } -static int unpack_string (grib_accessor* a, char* buffer, size_t *len) +static int unpack_string(grib_accessor* a, char* buffer, size_t* len) { grib_accessor_unpack_bufr_values* self = (grib_accessor_unpack_bufr_values*)a; - grib_accessor* data=(grib_accessor*)self->data_accessor; + grib_accessor* data = (grib_accessor*)self->data_accessor; - return grib_unpack_double(data,0,0); + return grib_unpack_double(data, 0, 0); } -static int unpack_long (grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_unpack_bufr_values* self = (grib_accessor_unpack_bufr_values*)a; - grib_accessor* data=(grib_accessor*)self->data_accessor; + grib_accessor* data = (grib_accessor*)self->data_accessor; - return grib_unpack_double(data,0,0); + return grib_unpack_double(data, 0, 0); } -static int unpack_double (grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { grib_accessor_unpack_bufr_values* self = (grib_accessor_unpack_bufr_values*)a; - grib_accessor* data=(grib_accessor*)self->data_accessor; + grib_accessor* data = (grib_accessor*)self->data_accessor; - return grib_unpack_double(data,0,0); + return grib_unpack_double(data, 0, 0); } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - *count=1; + *count = 1; return 0; } -static void destroy(grib_context* context,grib_accessor* a) +static void destroy(grib_context* context, grib_accessor* a) { } -static int get_native_type(grib_accessor* a) +static int get_native_type(grib_accessor* a) { return GRIB_TYPE_LONG; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { - int unpackMode=CODES_BUFR_UNPACK_STRUCTURE; + int unpackMode = CODES_BUFR_UNPACK_STRUCTURE; grib_accessor_unpack_bufr_values* self = (grib_accessor_unpack_bufr_values*)a; - grib_accessor* data=(grib_accessor*)self->data_accessor; + grib_accessor* data = (grib_accessor*)self->data_accessor; - if (*val==2) unpackMode=CODES_BUFR_UNPACK_FLAT; - if (*val==3) unpackMode=CODES_BUFR_NEW_DATA; + if (*val == 2) + unpackMode = CODES_BUFR_UNPACK_FLAT; + if (*val == 3) + unpackMode = CODES_BUFR_NEW_DATA; - accessor_bufr_data_array_set_unpackMode(data,unpackMode); + accessor_bufr_data_array_set_unpackMode(data, unpackMode); - return grib_unpack_double(data,0,0); + return grib_unpack_double(data, 0, 0); } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { grib_accessor_unpack_bufr_values* self = (grib_accessor_unpack_bufr_values*)a; - grib_accessor* data=(grib_accessor*)self->data_accessor; + grib_accessor* data = (grib_accessor*)self->data_accessor; - return grib_unpack_double(data,0,0); + return grib_unpack_double(data, 0, 0); } diff --git a/src/grib_accessor_class_unsigned.c b/src/grib_accessor_class_unsigned.c index 87dd69ff3..a3a51a240 100644 --- a/src/grib_accessor_class_unsigned.c +++ b/src/grib_accessor_class_unsigned.c @@ -39,70 +39,71 @@ or edit "accessor.class" and rerun ./make_class.pl */ static int is_missing(grib_accessor*); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); static long byte_count(grib_accessor*); static long byte_offset(grib_accessor*); static long next_offset(grib_accessor*); -static int value_count(grib_accessor*,long*); -static void destroy(grib_context*,grib_accessor*); +static int value_count(grib_accessor*, long*); +static void destroy(grib_context*, grib_accessor*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -static void update_size(grib_accessor*,size_t); - -typedef struct grib_accessor_unsigned { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in unsigned */ - long nbytes; - grib_arguments* arg; +static void update_size(grib_accessor*, size_t); + +typedef struct grib_accessor_unsigned +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in unsigned */ + long nbytes; + grib_arguments* arg; } grib_accessor_unsigned; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_unsigned = { - &grib_accessor_class_long, /* super */ - "unsigned", /* name */ - sizeof(grib_accessor_unsigned), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* free mem */ - &dump, /* describes himself */ - &next_offset, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - &byte_count, /* get number of bytes */ - &byte_offset, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - &is_missing, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - &update_size, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "unsigned", /* name */ + sizeof(grib_accessor_unsigned), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + &destroy, /* free mem */ + &dump, /* describes himself */ + &next_offset, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + &byte_count, /* get number of bytes */ + &byte_offset, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + &is_missing, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + &update_size, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -111,71 +112,72 @@ grib_accessor_class* grib_accessor_class_unsigned = &_grib_accessor_class_unsign static void init_class(grib_accessor_class* c) { - c->string_length = (*(c->super))->string_length; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->string_length = (*(c->super))->string_length; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len , grib_arguments* arg ) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { grib_accessor_unsigned* self = (grib_accessor_unsigned*)a; - self->arg = NULL; - self->arg = arg; - self->nbytes = len; + self->arg = NULL; + self->arg = arg; + self->nbytes = len; if (a->flags & GRIB_ACCESSOR_FLAG_TRANSIENT) { - a->length=0; + a->length = 0; if (!a->vvalue) - a->vvalue=(grib_virtual_value*)grib_context_malloc_clear(a->context,sizeof(grib_virtual_value)); - a->vvalue->type=GRIB_TYPE_LONG; - a->vvalue->length=len; - } else { - long count=0; - grib_value_count(a,&count); - - a->length = len*count; - a->vvalue=NULL; + a->vvalue = (grib_virtual_value*)grib_context_malloc_clear(a->context, sizeof(grib_virtual_value)); + a->vvalue->type = GRIB_TYPE_LONG; + a->vvalue->length = len; + } + else { + long count = 0; + grib_value_count(a, &count); + + a->length = len * count; + a->vvalue = NULL; } } static void dump(grib_accessor* a, grib_dumper* dumper) { long rlen = 0; - grib_value_count(a,&rlen); - if(rlen == 1) - grib_dump_long(dumper,a,NULL); + grib_value_count(a, &rlen); + if (rlen == 1) + grib_dump_long(dumper, a, NULL); else - grib_dump_values(dumper,a); + grib_dump_values(dumper, a); } static const unsigned long ones[] = { - 0, - 0xff, - 0xffff, - 0xffffff, - 0xffffffff, + 0, + 0xff, + 0xffff, + 0xffffff, + 0xffffffff, }; /* See GRIB-490 */ @@ -185,42 +187,41 @@ static int value_is_missing(long val) return (val == GRIB_MISSING_LONG || val == all_ones); } -int pack_long_unsigned_helper(grib_accessor* a, const long* val, size_t *len, int check) +int pack_long_unsigned_helper(grib_accessor* a, const long* val, size_t* len, int check) { grib_accessor_unsigned* self = (grib_accessor_unsigned*)a; - int ret = 0; - long off = 0; - long rlen = 0; - int err = 0; - - size_t buflen = 0; - unsigned char *buf = NULL; - unsigned long i = 0; + int ret = 0; + long off = 0; + long rlen = 0; + int err = 0; + + size_t buflen = 0; + unsigned char* buf = NULL; + unsigned long i = 0; unsigned long missing = 0; - err=grib_value_count(a,&rlen); - if (err) return err; + err = grib_value_count(a, &rlen); + if (err) + return err; - if(a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) - { + if (a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) { Assert(self->nbytes <= 4); missing = ones[self->nbytes]; } if (a->flags & GRIB_ACCESSOR_FLAG_TRANSIENT) { - a->vvalue->lval=val[0]; + a->vvalue->lval = val[0]; - if(missing && val[0] == GRIB_MISSING_LONG) - a->vvalue->missing=1; + if (missing && val[0] == GRIB_MISSING_LONG) + a->vvalue->missing = 1; else - a->vvalue->missing=0; + a->vvalue->missing = 0; return GRIB_SUCCESS; } - if(*len < 1) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name , 1 ); + if (*len < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); len[0] = 0; return GRIB_ARRAY_TOO_SMALL; } @@ -229,96 +230,97 @@ int pack_long_unsigned_helper(grib_accessor* a, const long* val, size_t *len, in long v = val[0]; if (missing) - if(v == GRIB_MISSING_LONG) + if (v == GRIB_MISSING_LONG) v = missing; /* Check if value fits into number of bits */ if (check) { - const long nbits = self->nbytes*8; + const long nbits = self->nbytes * 8; /* See GRIB-23 and GRIB-262 */ - if (! value_is_missing(v) ) { + if (!value_is_missing(v)) { if (v < 0) { grib_context_log(a->context, GRIB_LOG_ERROR, - "Key \"%s\": Trying to encode a negative value of %ld for key of type unsigned\n", a->name, v); + "Key \"%s\": Trying to encode a negative value of %ld for key of type unsigned\n", a->name, v); return GRIB_ENCODING_ERROR; } if (nbits < 33) { - unsigned long maxval = (1UL << nbits)-1; + unsigned long maxval = (1UL << nbits) - 1; if (maxval > 0 && v > maxval) { /* See ECC-1002 */ grib_context_log(a->context, GRIB_LOG_ERROR, - "Key \"%s\": Trying to encode value of %ld but the maximum allowable value is %ld (number of bits=%ld)\n", - a->name, v, maxval, nbits); + "Key \"%s\": Trying to encode value of %ld but the maximum allowable value is %ld (number of bits=%ld)\n", + a->name, v, maxval, nbits); return GRIB_ENCODING_ERROR; } } } } - off = a->offset*8; - ret = grib_encode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, v, &off, self->nbytes*8); - if (ret == GRIB_SUCCESS) len[0] = 1; - if (*len > 1) grib_context_log(a->context, GRIB_LOG_WARNING, "grib_accessor_unsigned : Trying to pack %d values in a scalar %s, packing first value", *len, a->name ); + off = a->offset * 8; + ret = grib_encode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, v, &off, self->nbytes * 8); + if (ret == GRIB_SUCCESS) + len[0] = 1; + if (*len > 1) + grib_context_log(a->context, GRIB_LOG_WARNING, "grib_accessor_unsigned : Trying to pack %d values in a scalar %s, packing first value", *len, a->name); len[0] = 1; return ret; } /* TODO: We assume that there are no missing values if there are more that 1 value */ - buflen = *len*self->nbytes; + buflen = *len * self->nbytes; - buf = (unsigned char*)grib_context_malloc(a->context,buflen); + buf = (unsigned char*)grib_context_malloc(a->context, buflen); - for(i=0; i < *len;i++) - grib_encode_unsigned_long(buf, val[i] , &off, self->nbytes*8); + for (i = 0; i < *len; i++) + grib_encode_unsigned_long(buf, val[i], &off, self->nbytes * 8); - ret = grib_set_long_internal(grib_handle_of_accessor(a),grib_arguments_get_name(a->parent->h,self->arg,0),*len); + ret = grib_set_long_internal(grib_handle_of_accessor(a), grib_arguments_get_name(a->parent->h, self->arg, 0), *len); - if(ret == GRIB_SUCCESS) - grib_buffer_replace(a, buf, buflen,1,1); + if (ret == GRIB_SUCCESS) + grib_buffer_replace(a, buf, buflen, 1, 1); else *len = 0; - grib_context_free(a->context,buf); + grib_context_free(a->context, buf); return ret; } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_unsigned* self = (grib_accessor_unsigned*)a; - long rlen = 0; - unsigned long i = 0; - unsigned long missing = 0; - long count=0; - int err = 0; - long pos = a->offset*8; - grib_handle* hand=grib_handle_of_accessor(a); - - err=grib_value_count(a,&count); - if (err) return err; - rlen=count; - - if(*len < rlen) - { - grib_context_log(a->context, GRIB_LOG_ERROR, " wrong size (%ld) for %s it contains %d values ",*len, a->name , rlen); + long rlen = 0; + unsigned long i = 0; + unsigned long missing = 0; + long count = 0; + int err = 0; + long pos = a->offset * 8; + grib_handle* hand = grib_handle_of_accessor(a); + + err = grib_value_count(a, &count); + if (err) + return err; + rlen = count; + + if (*len < rlen) { + grib_context_log(a->context, GRIB_LOG_ERROR, " wrong size (%ld) for %s it contains %d values ", *len, a->name, rlen); *len = 0; return GRIB_ARRAY_TOO_SMALL; } if (a->flags & GRIB_ACCESSOR_FLAG_TRANSIENT) { - *val=a->vvalue->lval; - *len=1; + *val = a->vvalue->lval; + *len = 1; return GRIB_SUCCESS; } - if(a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) - { + if (a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) { Assert(self->nbytes <= 4); missing = ones[self->nbytes]; } - for(i=0; i< rlen;i++){ - val[i] = (long)grib_decode_unsigned_long(hand->buffer->data , &pos, self->nbytes*8); - if(missing) - if(val[i] == missing) + for (i = 0; i < rlen; i++) { + val[i] = (long)grib_decode_unsigned_long(hand->buffer->data, &pos, self->nbytes * 8); + if (missing) + if (val[i] == missing) val[i] = GRIB_MISSING_LONG; } @@ -326,10 +328,10 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) return GRIB_SUCCESS; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { /* See GRIB-262 as example of why we do the checks */ - return pack_long_unsigned_helper(a,val,len, /*check=*/1); + return pack_long_unsigned_helper(a, val, len, /*check=*/1); } static long byte_count(grib_accessor* a) @@ -337,11 +339,14 @@ static long byte_count(grib_accessor* a) return a->length; } -static int value_count(grib_accessor* a,long* len) +static int value_count(grib_accessor* a, long* len) { grib_accessor_unsigned* self = (grib_accessor_unsigned*)a; - if(!self->arg) {*len=1;return 0;} - return grib_get_long_internal(grib_handle_of_accessor(a),grib_arguments_get_name(a->parent->h,self->arg,0),len); + if (!self->arg) { + *len = 1; + return 0; + } + return grib_get_long_internal(grib_handle_of_accessor(a), grib_arguments_get_name(a->parent->h, self->arg, 0), len); } static long byte_offset(grib_accessor* a) @@ -349,29 +354,29 @@ static long byte_offset(grib_accessor* a) return a->offset; } -static void update_size(grib_accessor* a,size_t s) +static void update_size(grib_accessor* a, size_t s) { a->length = s; } static long next_offset(grib_accessor* a) { - return grib_byte_offset(a)+grib_byte_count(a); + return grib_byte_offset(a) + grib_byte_count(a); } static int is_missing(grib_accessor* a) { - int i=0; - unsigned char ff=0xff; - unsigned long offset=a->offset; - grib_handle* hand=grib_handle_of_accessor(a); + int i = 0; + unsigned char ff = 0xff; + unsigned long offset = a->offset; + grib_handle* hand = grib_handle_of_accessor(a); - if (a->length==0) { - Assert(a->vvalue!=NULL); + if (a->length == 0) { + Assert(a->vvalue != NULL); return a->vvalue->missing; } - for (i=0;ilength;i++) { + for (i = 0; i < a->length; i++) { if (hand->buffer->data[offset] != ff) { return 0; } @@ -380,10 +385,10 @@ static int is_missing(grib_accessor* a) return 1; } -static void destroy(grib_context* context,grib_accessor* a) +static void destroy(grib_context* context, grib_accessor* a) { if (a->vvalue != NULL) grib_context_free(context, a->vvalue); - a->vvalue=NULL; + a->vvalue = NULL; } diff --git a/src/grib_accessor_class_unsigned_bits.c b/src/grib_accessor_class_unsigned_bits.c index 4954b7a92..c34a37c58 100644 --- a/src/grib_accessor_class_unsigned_bits.c +++ b/src/grib_accessor_class_unsigned_bits.c @@ -39,69 +39,70 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); static long byte_count(grib_accessor*); static long byte_offset(grib_accessor*); static long next_offset(grib_accessor*); -static int value_count(grib_accessor*,long*); +static int value_count(grib_accessor*, long*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -static void update_size(grib_accessor*,size_t); - -typedef struct grib_accessor_unsigned_bits { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in unsigned_bits */ - const char* numberOfBits; - const char* numberOfElements; +static void update_size(grib_accessor*, size_t); + +typedef struct grib_accessor_unsigned_bits +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in unsigned_bits */ + const char* numberOfBits; + const char* numberOfElements; } grib_accessor_unsigned_bits; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_unsigned_bits = { - &grib_accessor_class_long, /* super */ - "unsigned_bits", /* name */ - sizeof(grib_accessor_unsigned_bits), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - &next_offset, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - &byte_count, /* get number of bytes */ - &byte_offset, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - &update_size, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "unsigned_bits", /* name */ + sizeof(grib_accessor_unsigned_bits), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + &next_offset, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + &byte_count, /* get number of bytes */ + &byte_offset, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + &update_size, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -110,119 +111,123 @@ grib_accessor_class* grib_accessor_class_unsigned_bits = &_grib_accessor_class_u static void init_class(grib_accessor_class* c) { - c->string_length = (*(c->super))->string_length; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->string_length = (*(c->super))->string_length; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static long compute_byte_count(grib_accessor* a){ +static long compute_byte_count(grib_accessor* a) +{ grib_accessor_unsigned_bits* self = (grib_accessor_unsigned_bits*)a; long numberOfBits; long numberOfElements; - int ret=0; + int ret = 0; - ret=grib_get_long(grib_handle_of_accessor(a),self->numberOfBits,&numberOfBits); + ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfBits, &numberOfBits); if (ret) { - grib_context_log(a->context,GRIB_LOG_ERROR, - "%s unable to get %s to compute size",a->name,self->numberOfBits); + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s unable to get %s to compute size", a->name, self->numberOfBits); return 0; } - ret=grib_get_long(grib_handle_of_accessor(a),self->numberOfElements,&numberOfElements); + ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfElements, &numberOfElements); if (ret) { - grib_context_log(a->context,GRIB_LOG_ERROR, - "%s unable to get %s to compute size",a->name,self->numberOfElements); + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s unable to get %s to compute size", a->name, self->numberOfElements); return 0; } - return (numberOfBits*numberOfElements+7)/8; + return (numberOfBits * numberOfElements + 7) / 8; } -static void init(grib_accessor* a, const long len , grib_arguments* args ) +static void init(grib_accessor* a, const long len, grib_arguments* args) { grib_accessor_unsigned_bits* self = (grib_accessor_unsigned_bits*)a; - int n=0; - self->numberOfBits=grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - self->numberOfElements=grib_arguments_get_name(grib_handle_of_accessor(a),args,n++); - a->length = compute_byte_count(a); + int n = 0; + self->numberOfBits = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->numberOfElements = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + a->length = compute_byte_count(a); } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_long(dumper,a,NULL); + grib_dump_long(dumper, a, NULL); } -static int unpack_long (grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_unsigned_bits* self = (grib_accessor_unsigned_bits*)a; - int ret=0; - long pos = a->offset*8; - long rlen = 0; - long numberOfBits = 0; + int ret = 0; + long pos = a->offset * 8; + long rlen = 0; + long numberOfBits = 0; - ret=value_count(a,&rlen); - if (ret) return ret; + ret = value_count(a, &rlen); + if (ret) + return ret; - if(*len < rlen) - { + if (*len < rlen) { grib_context_log(a->context, GRIB_LOG_ERROR, - " wrong size (%ld) for %s it contains %d values ",*len, a->name , rlen); + " wrong size (%ld) for %s it contains %d values ", *len, a->name, rlen); *len = 0; return GRIB_ARRAY_TOO_SMALL; } - ret=grib_get_long(grib_handle_of_accessor(a),self->numberOfBits,&numberOfBits); - if (ret) return ret; - if (numberOfBits==0) { + ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfBits, &numberOfBits); + if (ret) + return ret; + if (numberOfBits == 0) { int i; - for (i=0;ibuffer->data,&pos,numberOfBits,rlen,val); + grib_decode_long_array(grib_handle_of_accessor(a)->buffer->data, &pos, numberOfBits, rlen, val); *len = rlen; return GRIB_SUCCESS; } -static int pack_long (grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { grib_accessor_unsigned_bits* self = (grib_accessor_unsigned_bits*)a; - int ret = 0; - long off = 0; - long numberOfBits=0; - size_t buflen = 0; - unsigned char *buf = NULL; - unsigned long i = 0; - long rlen = 0; - ret=value_count(a,&rlen); - if (ret) return ret; + int ret = 0; + long off = 0; + long numberOfBits = 0; + size_t buflen = 0; + unsigned char* buf = NULL; + unsigned long i = 0; + long rlen = 0; + ret = value_count(a, &rlen); + if (ret) + return ret; /* if(*len < rlen) @@ -232,44 +237,45 @@ static int pack_long (grib_accessor* a, const long* val, size_t *len) return GRIB_ARRAY_TOO_SMALL; } */ - if (*len!=rlen) - ret=grib_set_long(grib_handle_of_accessor(a),self->numberOfElements,*len); - - ret=grib_get_long(grib_handle_of_accessor(a),self->numberOfBits,&numberOfBits); - if (ret) return ret; - if (numberOfBits==0) { - grib_buffer_replace(a, NULL, 0,1,1); + if (*len != rlen) + ret = grib_set_long(grib_handle_of_accessor(a), self->numberOfElements, *len); + + ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfBits, &numberOfBits); + if (ret) + return ret; + if (numberOfBits == 0) { + grib_buffer_replace(a, NULL, 0, 1, 1); return GRIB_SUCCESS; } buflen = compute_byte_count(a); - buf = (unsigned char*)grib_context_malloc_clear(a->context,buflen+sizeof(long)); + buf = (unsigned char*)grib_context_malloc_clear(a->context, buflen + sizeof(long)); - for(i=0; i < *len;i++) - grib_encode_unsigned_longb(buf, val[i] , &off, numberOfBits); + for (i = 0; i < *len; i++) + grib_encode_unsigned_longb(buf, val[i], &off, numberOfBits); - grib_buffer_replace(a, buf, buflen,1,1); + grib_buffer_replace(a, buf, buflen, 1, 1); - grib_context_free(a->context,buf); + grib_context_free(a->context, buf); return ret; - } -static long byte_count(grib_accessor* a){ +static long byte_count(grib_accessor* a) +{ return a->length; } -static int value_count(grib_accessor* a,long* numberOfElements) +static int value_count(grib_accessor* a, long* numberOfElements) { grib_accessor_unsigned_bits* self = (grib_accessor_unsigned_bits*)a; int ret; - *numberOfElements=0; + *numberOfElements = 0; - ret=grib_get_long(grib_handle_of_accessor(a),self->numberOfElements,numberOfElements); + ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfElements, numberOfElements); if (ret) { - grib_context_log(a->context,GRIB_LOG_ERROR, - "%s unable to get %s to compute size",a->name,self->numberOfElements); + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s unable to get %s to compute size", a->name, self->numberOfElements); } return ret; @@ -280,12 +286,12 @@ static long byte_offset(grib_accessor* a) return a->offset; } -static void update_size(grib_accessor* a,size_t s) +static void update_size(grib_accessor* a, size_t s) { a->length = s; } static long next_offset(grib_accessor* a) { - return byte_offset(a)+a->length; + return byte_offset(a) + a->length; } diff --git a/src/grib_accessor_class_validity_date.c b/src/grib_accessor_class_validity_date.c index a900594c7..1b323439b 100644 --- a/src/grib_accessor_class_validity_date.c +++ b/src/grib_accessor_class_validity_date.c @@ -39,68 +39,69 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_long(grib_accessor*, long* val,size_t *len); +static int unpack_long(grib_accessor*, long* val, size_t* len); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_validity_date { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in validity_date */ - const char* date; - const char* time; - const char* step; - const char* stepUnits; - const char* year; - const char* month; - const char* day; +typedef struct grib_accessor_validity_date +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in validity_date */ + const char* date; + const char* time; + const char* step; + const char* stepUnits; + const char* year; + const char* month; + const char* day; } grib_accessor_validity_date; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_validity_date = { - &grib_accessor_class_long, /* super */ - "validity_date", /* name */ - sizeof(grib_accessor_validity_date), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "validity_date", /* name */ + sizeof(grib_accessor_validity_date), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -109,145 +110,154 @@ grib_accessor_class* grib_accessor_class_validity_date = &_grib_accessor_class_v static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ /* Table of multipliers to convert step units to minutes */ -static const double u2m[] = { - 1, /* index 0: minutes */ - 60, /* index 1: hour */ - 24*60, /* index 2: day */ - 24*60*30, /* index 3: month */ - -1, /* index 4: year */ - -1, /* index 5: decade */ - -1, /* index 6: 30 years */ - -1, /* index 7: century */ - -1, /* index 8: RESERVED */ - -1, /* index 9: RESERVED */ - 3*60, /* index 10: 3 hours */ - 6*60, /* index 11: 6 hours */ - 12*60, /* index 12: 12 hours */ - 1/60.0, /* index 13: seconds */ - 15, /* index 14: 15 mins */ - 30 /* index 15: 30 mins */ +static const double u2m[] = { + 1, /* index 0: minutes */ + 60, /* index 1: hour */ + 24 * 60, /* index 2: day */ + 24 * 60 * 30, /* index 3: month */ + -1, /* index 4: year */ + -1, /* index 5: decade */ + -1, /* index 6: 30 years */ + -1, /* index 7: century */ + -1, /* index 8: RESERVED */ + -1, /* index 9: RESERVED */ + 3 * 60, /* index 10: 3 hours */ + 6 * 60, /* index 11: 6 hours */ + 12 * 60, /* index 12: 12 hours */ + 1 / 60.0, /* index 13: seconds */ + 15, /* index 14: 15 mins */ + 30 /* index 15: 30 mins */ }; static long convert_to_minutes(long step, long stepUnits) { double result = 0; - if (stepUnits == 0) return step; /* unit=minutes so no change */ - if (stepUnits == 1) return step*60; /* unit=hours */ - if (stepUnits == 13) return step/60; /* unit=seconds */ + if (stepUnits == 0) + return step; /* unit=minutes so no change */ + if (stepUnits == 1) + return step * 60; /* unit=hours */ + if (stepUnits == 13) + return step / 60; /* unit=seconds */ /* Assert( stepUnits < sizeof(u2m)/sizeof(u2m[0]) ); */ - result = step*u2m[stepUnits]; + result = step * u2m[stepUnits]; return (long)result; } -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_validity_date* self = (grib_accessor_validity_date*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int n = 0; + grib_handle* hand = grib_handle_of_accessor(a); + int n = 0; - self->date = grib_arguments_get_name(hand,c,n++); - self->time = grib_arguments_get_name(hand,c,n++); - self->step = grib_arguments_get_name(hand,c,n++); - self->stepUnits = grib_arguments_get_name(hand,c,n++); - self->year = grib_arguments_get_name(hand,c,n++); - self->month = grib_arguments_get_name(hand,c,n++); - self->day = grib_arguments_get_name(hand,c,n++); + self->date = grib_arguments_get_name(hand, c, n++); + self->time = grib_arguments_get_name(hand, c, n++); + self->step = grib_arguments_get_name(hand, c, n++); + self->stepUnits = grib_arguments_get_name(hand, c, n++); + self->year = grib_arguments_get_name(hand, c, n++); + self->month = grib_arguments_get_name(hand, c, n++); + self->day = grib_arguments_get_name(hand, c, n++); a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_long(dumper,a,NULL); + grib_dump_long(dumper, a, NULL); } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_validity_date* self = (grib_accessor_validity_date*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int ret=0; - long date = 0; - long time = 0; - long step = 0; - long stepUnits = 0; - long hours = 0, minutes=0, step_mins=0, tmp, tmp_hrs; + grib_handle* hand = grib_handle_of_accessor(a); + int ret = 0; + long date = 0; + long time = 0; + long step = 0; + long stepUnits = 0; + long hours = 0, minutes = 0, step_mins = 0, tmp, tmp_hrs; if (self->year) { - long year,month,day; - if ((ret=grib_get_long_internal(hand, self->year,&year))!=GRIB_SUCCESS) return ret; - if ((ret=grib_get_long_internal(hand, self->month,&month))!=GRIB_SUCCESS) return ret; - if ((ret=grib_get_long_internal(hand, self->day,&day))!=GRIB_SUCCESS) return ret; - *val=year*10000+month*100+day; + long year, month, day; + if ((ret = grib_get_long_internal(hand, self->year, &year)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(hand, self->month, &month)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(hand, self->day, &day)) != GRIB_SUCCESS) + return ret; + *val = year * 10000 + month * 100 + day; return GRIB_SUCCESS; } - if ((ret=grib_get_long_internal(hand, self->date,&date))!=GRIB_SUCCESS) return ret; - if ((ret=grib_get_long_internal(hand, self->time,&time))!=GRIB_SUCCESS) return ret; - if ((ret=grib_get_long(hand, self->step,&step))!=GRIB_SUCCESS) { - if ((ret=grib_get_long_internal(hand, "endStep",&step))!=GRIB_SUCCESS) { + if ((ret = grib_get_long_internal(hand, self->date, &date)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(hand, self->time, &time)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long(hand, self->step, &step)) != GRIB_SUCCESS) { + if ((ret = grib_get_long_internal(hand, "endStep", &step)) != GRIB_SUCCESS) { return ret; /* See ECC-817 */ } } if (self->stepUnits) { - if ((ret=grib_get_long_internal(hand, self->stepUnits,&stepUnits))!=GRIB_SUCCESS) return ret; + if ((ret = grib_get_long_internal(hand, self->stepUnits, &stepUnits)) != GRIB_SUCCESS) + return ret; step_mins = convert_to_minutes(step, stepUnits); } minutes = time % 100; - hours = time / 100; - tmp = minutes + step_mins; /* add the step to our minutes */ - tmp_hrs = tmp/60; /* how many hours and mins is that? */ - hours += tmp_hrs; /* increment hours */ + hours = time / 100; + tmp = minutes + step_mins; /* add the step to our minutes */ + tmp_hrs = tmp / 60; /* how many hours and mins is that? */ + hours += tmp_hrs; /* increment hours */ - date = grib_date_to_julian (date); + date = grib_date_to_julian(date); /* does the new 'hours' exceed 24? if so increment julian */ - while(hours>=24) { - date ++; + while (hours >= 24) { + date++; hours -= 24; } /* GRIB-29: Negative forecast time */ - while(hours<0) { + while (hours < 0) { date--; hours += 24; } - if(*len < 1) + if (*len < 1) return GRIB_ARRAY_TOO_SMALL; *val = grib_julian_to_date(date); diff --git a/src/grib_accessor_class_validity_time.c b/src/grib_accessor_class_validity_time.c index f38416bd2..bca308099 100644 --- a/src/grib_accessor_class_validity_time.c +++ b/src/grib_accessor_class_validity_time.c @@ -38,67 +38,68 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_long(grib_accessor*, long* val,size_t *len); +static int unpack_long(grib_accessor*, long* val, size_t* len); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_validity_time { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in long */ -/* Members defined in validity_time */ - const char* date; - const char* time; - const char* step; - const char* stepUnits; - const char* hours; - const char* minutes; +typedef struct grib_accessor_validity_time +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in long */ + /* Members defined in validity_time */ + const char* date; + const char* time; + const char* step; + const char* stepUnits; + const char* hours; + const char* minutes; } grib_accessor_validity_time; extern grib_accessor_class* grib_accessor_class_long; static grib_accessor_class _grib_accessor_class_validity_time = { - &grib_accessor_class_long, /* super */ - "validity_time", /* name */ - sizeof(grib_accessor_validity_time), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_long, /* super */ + "validity_time", /* name */ + sizeof(grib_accessor_validity_time), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -107,141 +108,150 @@ grib_accessor_class* grib_accessor_class_validity_time = &_grib_accessor_class_v static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ /* Table of multipliers to convert step units to minutes */ -static const double u2m[] = { - 1, /* index 0: minutes */ - 60, /* index 1: hour */ - 24*60, /* index 2: day */ - 24*60*30, /* index 3: month */ - -1, /* index 4: year */ - -1, /* index 5: decade */ - -1, /* index 6: 30 years */ - -1, /* index 7: century */ - -1, /* index 8: RESERVED */ - -1, /* index 9: RESERVED */ - 3*60, /* index 10: 3 hours */ - 6*60, /* index 11: 6 hours */ - 12*60, /* index 12: 12 hours */ - 1/60.0, /* index 13: seconds */ - 15, /* index 14: 15 mins */ - 30 /* index 15: 30 mins */ +static const double u2m[] = { + 1, /* index 0: minutes */ + 60, /* index 1: hour */ + 24 * 60, /* index 2: day */ + 24 * 60 * 30, /* index 3: month */ + -1, /* index 4: year */ + -1, /* index 5: decade */ + -1, /* index 6: 30 years */ + -1, /* index 7: century */ + -1, /* index 8: RESERVED */ + -1, /* index 9: RESERVED */ + 3 * 60, /* index 10: 3 hours */ + 6 * 60, /* index 11: 6 hours */ + 12 * 60, /* index 12: 12 hours */ + 1 / 60.0, /* index 13: seconds */ + 15, /* index 14: 15 mins */ + 30 /* index 15: 30 mins */ }; static long convert_to_minutes(long step, long stepUnits) { double result = 0; - if (stepUnits == 0) return step; /* unit=minutes so no change */ - if (stepUnits == 1) return step*60; /* unit=hours */ - if (stepUnits == 13) return step/60; /* unit=seconds*/ + if (stepUnits == 0) + return step; /* unit=minutes so no change */ + if (stepUnits == 1) + return step * 60; /* unit=hours */ + if (stepUnits == 13) + return step / 60; /* unit=seconds*/ /* Assert( stepUnits < sizeof(u2m)/sizeof(u2m[0]) ); */ - result = step*u2m[stepUnits]; + result = step * u2m[stepUnits]; return (long)result; } -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_validity_time* self = (grib_accessor_validity_time*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int n = 0; + grib_handle* hand = grib_handle_of_accessor(a); + int n = 0; - self->date = grib_arguments_get_name(hand,c,n++); - self->time = grib_arguments_get_name(hand,c,n++); - self->step = grib_arguments_get_name(hand,c,n++); - self->stepUnits = grib_arguments_get_name(hand,c,n++); - self->hours = grib_arguments_get_name(hand,c,n++); - self->minutes = grib_arguments_get_name(hand,c,n++); + self->date = grib_arguments_get_name(hand, c, n++); + self->time = grib_arguments_get_name(hand, c, n++); + self->step = grib_arguments_get_name(hand, c, n++); + self->stepUnits = grib_arguments_get_name(hand, c, n++); + self->hours = grib_arguments_get_name(hand, c, n++); + self->minutes = grib_arguments_get_name(hand, c, n++); a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_long(dumper,a,NULL); + grib_dump_long(dumper, a, NULL); } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_validity_time* self = (grib_accessor_validity_time*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int ret=0; - long date = 0; - long time = 0; - long step = 0; - long stepUnits = 0; - long hours = 0, minutes=0, step_mins=0, tmp, tmp_hrs, tmp_mins; + grib_handle* hand = grib_handle_of_accessor(a); + int ret = 0; + long date = 0; + long time = 0; + long step = 0; + long stepUnits = 0; + long hours = 0, minutes = 0, step_mins = 0, tmp, tmp_hrs, tmp_mins; if (self->hours) { - if ((ret=grib_get_long_internal(hand, self->hours,&hours))!=GRIB_SUCCESS) return ret; - if ((ret=grib_get_long_internal(hand, self->minutes,&minutes))!=GRIB_SUCCESS) return ret; - *val=hours*100+minutes; + if ((ret = grib_get_long_internal(hand, self->hours, &hours)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(hand, self->minutes, &minutes)) != GRIB_SUCCESS) + return ret; + *val = hours * 100 + minutes; return GRIB_SUCCESS; } - if ((ret=grib_get_long_internal(hand, self->date,&date))!=GRIB_SUCCESS) return ret; - if ((ret=grib_get_long_internal(hand, self->time,&time))!=GRIB_SUCCESS) return ret; - if ((ret=grib_get_long(hand, self->step,&step))!=GRIB_SUCCESS) { - if ((ret=grib_get_long_internal(hand, "endStep",&step))!=GRIB_SUCCESS) { + if ((ret = grib_get_long_internal(hand, self->date, &date)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(hand, self->time, &time)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long(hand, self->step, &step)) != GRIB_SUCCESS) { + if ((ret = grib_get_long_internal(hand, "endStep", &step)) != GRIB_SUCCESS) { return ret; /* See ECC-817 */ } } /* Seconds will always be zero. So convert to minutes */ if (self->stepUnits) { - if ((ret=grib_get_long_internal(hand, self->stepUnits,&stepUnits))!=GRIB_SUCCESS) return ret; + if ((ret = grib_get_long_internal(hand, self->stepUnits, &stepUnits)) != GRIB_SUCCESS) + return ret; step_mins = convert_to_minutes(step, stepUnits); } - minutes = time % 100; - hours = time / 100; - tmp = minutes + step_mins; /* add the step to our minutes */ - tmp_hrs = tmp/60; /* how many hours and mins is that? */ - tmp_mins = tmp%60; - hours += tmp_hrs; /* increment hours */ - if (hours>0) { - hours = hours % 24; /* wrap round if >= 24 */ - } else { + minutes = time % 100; + hours = time / 100; + tmp = minutes + step_mins; /* add the step to our minutes */ + tmp_hrs = tmp / 60; /* how many hours and mins is that? */ + tmp_mins = tmp % 60; + hours += tmp_hrs; /* increment hours */ + if (hours > 0) { + hours = hours % 24; /* wrap round if >= 24 */ + } + else { /* GRIB-29: Negative forecast time */ - while (hours<0) { + while (hours < 0) { hours += 24; } } time = hours * 100 + tmp_mins; - if(*len < 1) + if (*len < 1) return GRIB_ARRAY_TOO_SMALL; *val = time; diff --git a/src/grib_accessor_class_values.c b/src/grib_accessor_class_values.c index ce27f93f8..e4a3cedb6 100644 --- a/src/grib_accessor_class_values.c +++ b/src/grib_accessor_class_values.c @@ -44,71 +44,72 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_long(grib_accessor*, const long* val,size_t *len); +static int get_native_type(grib_accessor*); +static int pack_long(grib_accessor*, const long* val, size_t* len); static long byte_count(grib_accessor*); static long byte_offset(grib_accessor*); static long next_offset(grib_accessor*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -static void update_size(grib_accessor*,size_t); +static void update_size(grib_accessor*, size_t); static int compare(grib_accessor*, grib_accessor*); -typedef struct grib_accessor_values { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in values */ - int carg; - const char* seclen; - const char* offsetdata; - const char* offsetsection; - int dirty; +typedef struct grib_accessor_values +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in values */ + int carg; + const char* seclen; + const char* offsetdata; + const char* offsetsection; + int dirty; } grib_accessor_values; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_values = { - &grib_accessor_class_gen, /* super */ - "values", /* name */ - sizeof(grib_accessor_values), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - &next_offset, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - &byte_count, /* get number of bytes */ - &byte_offset, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - &update_size, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "values", /* name */ + sizeof(grib_accessor_values), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + &next_offset, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + &byte_count, /* get number of bytes */ + &byte_offset, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + &update_size, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + &compare, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -117,97 +118,94 @@ grib_accessor_class* grib_accessor_class_values = &_grib_accessor_class_values; static void init_class(grib_accessor_class* c) { - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ static long init_length(grib_accessor* a) { grib_accessor_values* self = (grib_accessor_values*)a; - int ret = 0; + int ret = 0; long seclen = 0; long offsetsection = 0; long offsetdata = 0; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->seclen,&seclen))) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->seclen, &seclen))) return ret; - if(seclen == 0) - { + if (seclen == 0) { /* printf("init_length seclen=0\n"); */ return 0; } - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetsection,&offsetsection))) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetsection, &offsetsection))) return ret; - if((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetdata,&offsetdata))) + if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->offsetdata, &offsetdata))) return ret; /* When reparsing */ - if(offsetdata < offsetsection) - { + if (offsetdata < offsetsection) { /* printf("init_length offsetdata < offsetsection=0\n"); */ Assert(grib_handle_of_accessor(a)->loader); return 0; } - return seclen-(offsetdata-offsetsection); + return seclen - (offsetdata - offsetsection); } -static void init(grib_accessor* a,const long v, grib_arguments* params) +static void init(grib_accessor* a, const long v, grib_arguments* params) { - grib_accessor_values *self =(grib_accessor_values*)a; - self->carg = 0; + grib_accessor_values* self = (grib_accessor_values*)a; + self->carg = 0; - self->seclen = grib_arguments_get_name(grib_handle_of_accessor(a),params,self->carg++); - self->offsetdata = grib_arguments_get_name(grib_handle_of_accessor(a),params,self->carg++); - self->offsetsection = grib_arguments_get_name(grib_handle_of_accessor(a),params,self->carg++); - self->dirty =1; + self->seclen = grib_arguments_get_name(grib_handle_of_accessor(a), params, self->carg++); + self->offsetdata = grib_arguments_get_name(grib_handle_of_accessor(a), params, self->carg++); + self->offsetsection = grib_arguments_get_name(grib_handle_of_accessor(a), params, self->carg++); + self->dirty = 1; a->length = init_length(a); /* Assert(a->length>=0); */ } -static int get_native_type(grib_accessor* a) +static int get_native_type(grib_accessor* a) { return GRIB_TYPE_DOUBLE; } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_dump_values(dumper,a); + grib_dump_values(dumper, a); } static long byte_count(grib_accessor* a) { - grib_context_log(a->context,GRIB_LOG_DEBUG,"byte_count of %s = %ld",a->name,a->length); + grib_context_log(a->context, GRIB_LOG_DEBUG, "byte_count of %s = %ld", a->name, a->length); return a->length; - } static long byte_offset(grib_accessor* a) @@ -217,68 +215,74 @@ static long byte_offset(grib_accessor* a) static long next_offset(grib_accessor* a) { - return a->offset+a->length; + return a->offset + a->length; } -static void update_size(grib_accessor* a,size_t s) +static void update_size(grib_accessor* a, size_t s) { - grib_context_log(a->context,GRIB_LOG_DEBUG,"updating size of %s old %ld new %ld",a->name,a->length,s); + grib_context_log(a->context, GRIB_LOG_DEBUG, "updating size of %s old %ld new %ld", a->name, a->length, s); a->length = s; - Assert(a->length>=0); + Assert(a->length >= 0); } -static int compare(grib_accessor* a, grib_accessor* b) { - int retval=0; - double *aval=0; - double *bval=0; +static int compare(grib_accessor* a, grib_accessor* b) +{ + int retval = 0; + double* aval = 0; + double* bval = 0; size_t alen = 0; size_t blen = 0; - int err=0; - long count=0; + int err = 0; + long count = 0; - err=grib_value_count(a,&count); - if (err) return err; - alen=count; + err = grib_value_count(a, &count); + if (err) + return err; + alen = count; - err=grib_value_count(b,&count); - if (err) return err; - blen=count; + err = grib_value_count(b, &count); + if (err) + return err; + blen = count; - if (alen != blen) return GRIB_COUNT_MISMATCH; + if (alen != blen) + return GRIB_COUNT_MISMATCH; - aval=(double*)grib_context_malloc(a->context,alen*sizeof(double)); - bval=(double*)grib_context_malloc(b->context,blen*sizeof(double)); + aval = (double*)grib_context_malloc(a->context, alen * sizeof(double)); + bval = (double*)grib_context_malloc(b->context, blen * sizeof(double)); - grib_unpack_double(a,aval,&alen); - grib_unpack_double(b,bval,&blen); + grib_unpack_double(a, aval, &alen); + grib_unpack_double(b, bval, &blen); retval = GRIB_SUCCESS; while (alen != 0) { - if (*bval != *aval) retval = GRIB_DOUBLE_VALUE_MISMATCH; + if (*bval != *aval) + retval = GRIB_DOUBLE_VALUE_MISMATCH; alen--; } - grib_context_free(a->context,aval); - grib_context_free(b->context,bval); + grib_context_free(a->context, aval); + grib_context_free(b->context, bval); return retval; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { - int ret=0; - grib_accessor_values *self =(grib_accessor_values*)a; + int ret = 0; + grib_accessor_values* self = (grib_accessor_values*)a; int i; - double* dval=(double*)grib_context_malloc(a->context,*len*sizeof(double)); + double* dval = (double*)grib_context_malloc(a->context, *len * sizeof(double)); - for (i=0;i<*len;i++) dval[i]=(double)val[i]; + for (i = 0; i < *len; i++) + dval[i] = (double)val[i]; - ret=grib_pack_double(a,dval,len); + ret = grib_pack_double(a, dval, len); - grib_context_free(a->context,dval); + grib_context_free(a->context, dval); - self->dirty=1; + self->dirty = 1; return ret; } diff --git a/src/grib_accessor_class_variable.c b/src/grib_accessor_class_variable.c index 19bdb6ccb..f3f353d1c 100644 --- a/src/grib_accessor_class_variable.c +++ b/src/grib_accessor_class_variable.c @@ -39,76 +39,77 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int get_native_type(grib_accessor*); -static int pack_double(grib_accessor*, const double* val,size_t *len); -static int pack_long(grib_accessor*, const long* val,size_t *len); -static int pack_string(grib_accessor*, const char*, size_t *len); -static int unpack_double(grib_accessor*, double* val,size_t *len); -static int unpack_long(grib_accessor*, long* val,size_t *len); -static int unpack_string (grib_accessor*, char*, size_t *len); +static int get_native_type(grib_accessor*); +static int pack_double(grib_accessor*, const double* val, size_t* len); +static int pack_long(grib_accessor*, const long* val, size_t* len); +static int pack_string(grib_accessor*, const char*, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); static size_t string_length(grib_accessor*); static long byte_count(grib_accessor*); -static int value_count(grib_accessor*,long*); -static void destroy(grib_context*,grib_accessor*); +static int value_count(grib_accessor*, long*); +static void destroy(grib_context*, grib_accessor*); static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); static int compare(grib_accessor*, grib_accessor*); -static grib_accessor* make_clone(grib_accessor*,grib_section*,int*); - -typedef struct grib_accessor_variable { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in variable */ - double dval; - char* cval; - char* cname; - int type; +static grib_accessor* make_clone(grib_accessor*, grib_section*, int*); + +typedef struct grib_accessor_variable +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in variable */ + double dval; + char* cval; + char* cname; + int type; } grib_accessor_variable; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_variable = { - &grib_accessor_class_gen, /* super */ - "variable", /* name */ - sizeof(grib_accessor_variable), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - &destroy, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - &string_length, /* get length of string */ - &value_count, /* get number of values */ - &byte_count, /* get number of bytes */ - 0, /* get offset to bytes */ - &get_native_type, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ - &pack_double, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - &pack_string, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - &compare, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - &make_clone, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "variable", /* name */ + sizeof(grib_accessor_variable), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + &destroy, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + &string_length, /* get length of string */ + &value_count, /* get number of values */ + &byte_count, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + &pack_long, /* grib_pack procedures long */ + &unpack_long, /* grib_unpack procedures long */ + &pack_double, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + &pack_string, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + &compare, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + &make_clone, /* clone accessor */ }; @@ -117,111 +118,110 @@ grib_accessor_class* grib_accessor_class_variable = &_grib_accessor_class_variab static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->byte_offset = (*(c->super))->byte_offset; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; + c->next_offset = (*(c->super))->next_offset; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; } /* END_CLASS_IMP */ #define MAX_VARIABLE_STRING_LENGTH 255 -static void init(grib_accessor* a, const long length , grib_arguments* args ) +static void init(grib_accessor* a, const long length, grib_arguments* args) { grib_accessor_variable* self = (grib_accessor_variable*)a; - grib_handle* hand = grib_handle_of_accessor(a); - grib_expression *expression = grib_arguments_get_expression(hand,args,0); - const char* p = 0; - size_t len = 1; + grib_handle* hand = grib_handle_of_accessor(a); + grib_expression* expression = grib_arguments_get_expression(hand, args, 0); + const char* p = 0; + size_t len = 1; long l; - int ret=0; + int ret = 0; double d; self->cname = NULL; a->length = 0; - if (self->type==GRIB_TYPE_UNDEFINED && expression) { - self->type = grib_expression_native_type(hand,expression); - - switch(self->type) - { - case GRIB_TYPE_DOUBLE: - grib_expression_evaluate_double(hand,expression,&d); - pack_double(a,&d,&len); - break; - - case GRIB_TYPE_LONG: - grib_expression_evaluate_long(hand,expression,&l); - pack_long(a,&l,&len); - break; - - default: { - char tmp[1024]; - len = sizeof(tmp); - p = grib_expression_evaluate_string(hand,expression,tmp,&len,&ret); - if (ret != GRIB_SUCCESS) { - grib_context_log(a->context,GRIB_LOG_ERROR,"unable to evaluate %s as string",a->name); - Assert(0); + if (self->type == GRIB_TYPE_UNDEFINED && expression) { + self->type = grib_expression_native_type(hand, expression); + + switch (self->type) { + case GRIB_TYPE_DOUBLE: + grib_expression_evaluate_double(hand, expression, &d); + pack_double(a, &d, &len); + break; + + case GRIB_TYPE_LONG: + grib_expression_evaluate_long(hand, expression, &l); + pack_long(a, &l, &len); + break; + + default: { + char tmp[1024]; + len = sizeof(tmp); + p = grib_expression_evaluate_string(hand, expression, tmp, &len, &ret); + if (ret != GRIB_SUCCESS) { + grib_context_log(a->context, GRIB_LOG_ERROR, "unable to evaluate %s as string", a->name); + Assert(0); + } + len = strlen(p) + 1; + pack_string(a, p, &len); + break; } - len = strlen(p)+1; - pack_string(a,p,&len); - break; - } } } } -void accessor_variable_set_type(grib_accessor* a,int type) { - grib_accessor_variable *self = (grib_accessor_variable*)a; - self->type=type; +void accessor_variable_set_type(grib_accessor* a, int type) +{ + grib_accessor_variable* self = (grib_accessor_variable*)a; + self->type = type; } static void dump(grib_accessor* a, grib_dumper* dumper) { - grib_accessor_variable *self = (grib_accessor_variable*)a; - switch(self->type) - { - case GRIB_TYPE_DOUBLE: - grib_dump_double(dumper,a,NULL); - break; - - case GRIB_TYPE_LONG: - grib_dump_long(dumper,a,NULL); - break; - - default: - grib_dump_string(dumper,a,NULL); - break; + grib_accessor_variable* self = (grib_accessor_variable*)a; + switch (self->type) { + case GRIB_TYPE_DOUBLE: + grib_dump_double(dumper, a, NULL); + break; + + case GRIB_TYPE_LONG: + grib_dump_long(dumper, a, NULL); + break; + + default: + grib_dump_string(dumper, a, NULL); + break; } } -static int pack_double(grib_accessor* a, const double* val, size_t *len) +static int pack_double(grib_accessor* a, const double* val, size_t* len) { - grib_accessor_variable *self = (grib_accessor_variable*)a; + grib_accessor_variable* self = (grib_accessor_variable*)a; - if(*len != 1) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name , 1 ); + if (*len != 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); *len = 1; return GRIB_ARRAY_TOO_SMALL; } self->dval = *val; - if ( *val < (double) LONG_MIN || *val > (double) LONG_MAX ) + if (*val < (double)LONG_MIN || *val > (double)LONG_MAX) self->type = GRIB_TYPE_DOUBLE; else self->type = ((long)*val == *val) ? GRIB_TYPE_LONG : GRIB_TYPE_DOUBLE; @@ -229,12 +229,12 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) return GRIB_SUCCESS; } -static int pack_long(grib_accessor* a, const long* val, size_t *len) +static int pack_long(grib_accessor* a, const long* val, size_t* len) { - grib_accessor_variable *self = (grib_accessor_variable*)a; + grib_accessor_variable* self = (grib_accessor_variable*)a; - if(*len != 1) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name , 1 ); + if (*len != 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); *len = 1; return GRIB_ARRAY_TOO_SMALL; } @@ -245,26 +245,25 @@ static int pack_long(grib_accessor* a, const long* val, size_t *len) return GRIB_SUCCESS; } -static int unpack_double(grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - grib_accessor_variable *ac = (grib_accessor_variable*)a; + grib_accessor_variable* ac = (grib_accessor_variable*)a; - if(*len < 1) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name , 1 ); + if (*len < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); *len = 0; return GRIB_ARRAY_TOO_SMALL; } *val = ac->dval; *len = 1; return GRIB_SUCCESS; - } -static int unpack_long(grib_accessor* a, long* val, size_t *len) +static int unpack_long(grib_accessor* a, long* val, size_t* len) { - grib_accessor_variable *ac = (grib_accessor_variable*)a; + grib_accessor_variable* ac = (grib_accessor_variable*)a; - if(*len < 1) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name , 1 ); + if (*len < 1) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); *len = 0; return GRIB_ARRAY_TOO_SMALL; } @@ -275,75 +274,77 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len) static int get_native_type(grib_accessor* a) { - grib_accessor_variable *self = (grib_accessor_variable*)a; + grib_accessor_variable* self = (grib_accessor_variable*)a; return self->type; } -static void destroy(grib_context* c,grib_accessor* a) +static void destroy(grib_context* c, grib_accessor* a) { - grib_accessor_variable *self = (grib_accessor_variable*)a; - int i=0; + grib_accessor_variable* self = (grib_accessor_variable*)a; + int i = 0; - grib_context_free(c,self->cval); - if (self->cname) grib_context_free(c,self->cname); /* ECC-765 */ + grib_context_free(c, self->cval); + if (self->cname) + grib_context_free(c, self->cname); /* ECC-765 */ /* Note: BUFR operator descriptors are variables and have attributes so need to free them */ - while (iattributes[i]) { + while (i < MAX_ACCESSOR_ATTRIBUTES && a->attributes[i]) { grib_accessor_delete(c, a->attributes[i]); - a->attributes[i]=NULL; + a->attributes[i] = NULL; ++i; } } -static int unpack_string(grib_accessor* a, char* val, size_t *len){ - grib_accessor_variable *self = (grib_accessor_variable*)a; +static int unpack_string(grib_accessor* a, char* val, size_t* len) +{ + grib_accessor_variable* self = (grib_accessor_variable*)a; char buf[80]; - char *p = buf; - size_t slen ; + char* p = buf; + size_t slen; - if(self->type == GRIB_TYPE_STRING) { + if (self->type == GRIB_TYPE_STRING) { p = self->cval; - } else { - sprintf(p,"%g",self->dval); + } + else { + sprintf(p, "%g", self->dval); } - slen = strlen(p) +1; - if(*len < slen) - { - grib_context_log(a->context, GRIB_LOG_ERROR, "Variable unpack_string Wrong size for %s it is %d bytes big (len=%d)", a->name , slen ,*len); + slen = strlen(p) + 1; + if (*len < slen) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Variable unpack_string Wrong size for %s it is %d bytes big (len=%d)", a->name, slen, *len); *len = slen; return GRIB_BUFFER_TOO_SMALL; } - strcpy(val,p); + strcpy(val, p); *len = slen; return GRIB_SUCCESS; } -static int pack_string(grib_accessor* a, const char* val, size_t *len) +static int pack_string(grib_accessor* a, const char* val, size_t* len) { - grib_accessor_variable *self = (grib_accessor_variable*)a; - grib_context *c = a->context; + grib_accessor_variable* self = (grib_accessor_variable*)a; + grib_context* c = a->context; - grib_context_free(c,self->cval); - self->cval = grib_context_strdup(c,val); + grib_context_free(c, self->cval); + self->cval = grib_context_strdup(c, val); self->dval = atof(val); self->type = GRIB_TYPE_STRING; self->cname = NULL; return GRIB_SUCCESS; } -static int value_count(grib_accessor* a,long* count) +static int value_count(grib_accessor* a, long* count) { - *count=1; + *count = 1; return 0; } static size_t string_length(grib_accessor* a) { - grib_accessor_variable *self = (grib_accessor_variable*)a; - if(self->type == GRIB_TYPE_STRING) + grib_accessor_variable* self = (grib_accessor_variable*)a; + if (self->type == GRIB_TYPE_STRING) return strlen(self->cval); else return MAX_VARIABLE_STRING_LENGTH; @@ -371,67 +372,72 @@ static long byte_count(grib_accessor* a) { static int compare(grib_accessor* a, grib_accessor* b) { - int retval=0; - double *aval=0; - double *bval=0; + int retval = 0; + double* aval = 0; + double* bval = 0; size_t alen = 0; size_t blen = 0; - int err=0; - long count=0; + int err = 0; + long count = 0; - err=grib_value_count(a,&count); - if (err) return err; - alen=count; + err = grib_value_count(a, &count); + if (err) + return err; + alen = count; - err=grib_value_count(b,&count); - if (err) return err; - blen=count; + err = grib_value_count(b, &count); + if (err) + return err; + blen = count; - if (alen != blen) return GRIB_COUNT_MISMATCH; + if (alen != blen) + return GRIB_COUNT_MISMATCH; - aval=(double*)grib_context_malloc(a->context,alen*sizeof(double)); - bval=(double*)grib_context_malloc(b->context,blen*sizeof(double)); + aval = (double*)grib_context_malloc(a->context, alen * sizeof(double)); + bval = (double*)grib_context_malloc(b->context, blen * sizeof(double)); - grib_unpack_double(a,aval,&alen); - grib_unpack_double(b,bval,&blen); + grib_unpack_double(a, aval, &alen); + grib_unpack_double(b, bval, &blen); retval = GRIB_SUCCESS; while (alen != 0) { - if (*bval != *aval) retval = GRIB_DOUBLE_VALUE_MISMATCH; + if (*bval != *aval) + retval = GRIB_DOUBLE_VALUE_MISMATCH; alen--; } - grib_context_free(a->context,aval); - grib_context_free(b->context,bval); + grib_context_free(a->context, aval); + grib_context_free(b->context, bval); return retval; } -static grib_accessor* make_clone(grib_accessor* a,grib_section* s,int* err) +static grib_accessor* make_clone(grib_accessor* a, grib_section* s, int* err) { - grib_accessor* the_clone=NULL; - grib_accessor_variable *self = (grib_accessor_variable*)a; - grib_accessor_variable* variableAccessor=NULL; - grib_action creator = {0, }; + grib_accessor* the_clone = NULL; + grib_accessor_variable* self = (grib_accessor_variable*)a; + grib_accessor_variable* variableAccessor = NULL; + grib_action creator = {0,}; creator.op = "variable"; creator.name_space = ""; creator.set = 0; - creator.name=grib_context_strdup(a->context,a->name); - the_clone=grib_accessor_factory(s, &creator, 0, NULL); - the_clone->parent=NULL; - the_clone->h=s->h; - the_clone->flags=a->flags; - variableAccessor=(grib_accessor_variable*)the_clone; - variableAccessor->cname=creator.name; /* ECC-765: Store for later freeing memory */ - - *err=0; - variableAccessor->type=self->type; - if(self->type == GRIB_TYPE_STRING && self->cval!=NULL) { - variableAccessor->cval=grib_context_strdup(a->context,self->cval); - } else { - variableAccessor->dval=self->dval; + creator.name = grib_context_strdup(a->context, a->name); + the_clone = grib_accessor_factory(s, &creator, 0, NULL); + the_clone->parent = NULL; + the_clone->h = s->h; + the_clone->flags = a->flags; + variableAccessor = (grib_accessor_variable*)the_clone; + variableAccessor->cname = creator.name; /* ECC-765: Store for later freeing memory */ + + *err = 0; + variableAccessor->type = self->type; + if (self->type == GRIB_TYPE_STRING && self->cval != NULL) { + variableAccessor->cval = grib_context_strdup(a->context, self->cval); + } + else { + variableAccessor->dval = self->dval; } return the_clone; diff --git a/src/grib_accessor_class_vector.c b/src/grib_accessor_class_vector.c index 3179eef97..f473ead56 100644 --- a/src/grib_accessor_class_vector.c +++ b/src/grib_accessor_class_vector.c @@ -38,65 +38,66 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_double(grib_accessor*, double* val,size_t *len); -static void init(grib_accessor*,const long, grib_arguments* ); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_vector { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in double */ -/* Members defined in abstract_vector */ - double* v; - int number_of_elements; -/* Members defined in vector */ - const char* vector; - int index; +typedef struct grib_accessor_vector +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in double */ + /* Members defined in abstract_vector */ + double* v; + int number_of_elements; + /* Members defined in vector */ + const char* vector; + int index; } grib_accessor_vector; extern grib_accessor_class* grib_accessor_class_abstract_vector; static grib_accessor_class _grib_accessor_class_vector = { - &grib_accessor_class_abstract_vector, /* super */ - "vector", /* name */ - sizeof(grib_accessor_vector), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_abstract_vector, /* super */ + "vector", /* name */ + sizeof(grib_accessor_vector), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -105,84 +106,86 @@ grib_accessor_class* grib_accessor_class_vector = &_grib_accessor_class_vector; static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -typedef struct grib_accessor_abstract_vector { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in double */ -/* Members defined in abstract_vector */ - double* v; - int number_of_elements; +typedef struct grib_accessor_abstract_vector +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in double */ + /* Members defined in abstract_vector */ + double* v; + int number_of_elements; } grib_accessor_abstract_vector; -static void init(grib_accessor* a,const long l, grib_arguments* c) +static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_vector* self = (grib_accessor_vector*)a; - int n = 0; + int n = 0; - self->vector = grib_arguments_get_name(grib_handle_of_accessor(a),c,n++); - self->index = grib_arguments_get_long(grib_handle_of_accessor(a),c,n++); - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + self->vector = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->index = grib_arguments_get_long(grib_handle_of_accessor(a), c, n++); + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; - a->length=0; + a->length = 0; } -static int unpack_double (grib_accessor* a, double* val, size_t *len) +static int unpack_double(grib_accessor* a, double* val, size_t* len) { - int err = 0; - size_t size=0; + int err = 0; + size_t size = 0; double* stat; - grib_accessor_vector* self = (grib_accessor_vector*)a; - grib_accessor* va=(grib_accessor*)grib_find_accessor(grib_handle_of_accessor(a),self->vector); + grib_accessor_vector* self = (grib_accessor_vector*)a; + grib_accessor* va = (grib_accessor*)grib_find_accessor(grib_handle_of_accessor(a), self->vector); grib_accessor_abstract_vector* v = (grib_accessor_abstract_vector*)va; - Assert(self->index>=0); + Assert(self->index >= 0); - if (self->index>=v->number_of_elements) { - grib_context_log(a->context,GRIB_LOG_FATAL,"index=%d number_of_elements=%d for %s",self->index,v->number_of_elements,a->name); + if (self->index >= v->number_of_elements) { + grib_context_log(a->context, GRIB_LOG_FATAL, "index=%d number_of_elements=%d for %s", self->index, v->number_of_elements, a->name); Assert(self->index < v->number_of_elements); } if (va->dirty) { - grib_get_size(grib_handle_of_accessor(a),self->vector,&size); - stat=(double*)grib_context_malloc_clear(a->context,sizeof(double)*size); - err = grib_unpack_double(va,stat,&size); - grib_context_free(a->context,stat); - if (err) return err; + grib_get_size(grib_handle_of_accessor(a), self->vector, &size); + stat = (double*)grib_context_malloc_clear(a->context, sizeof(double) * size); + err = grib_unpack_double(va, stat, &size); + grib_context_free(a->context, stat); + if (err) + return err; } *val = v->v[self->index]; diff --git a/src/grib_accessor_class_when.c b/src/grib_accessor_class_when.c index 03871ea83..a5bf209a8 100644 --- a/src/grib_accessor_class_when.c +++ b/src/grib_accessor_class_when.c @@ -37,59 +37,60 @@ or edit "accessor.class" and rerun ./make_class.pl */ static void dump(grib_accessor*, grib_dumper*); -static void init(grib_accessor*,const long, grib_arguments* ); +static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -static int notify_change(grib_accessor*,grib_accessor*); +static int notify_change(grib_accessor*, grib_accessor*); -typedef struct grib_accessor_when { - grib_accessor att; -/* Members defined in gen */ -/* Members defined in when */ +typedef struct grib_accessor_when +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in when */ } grib_accessor_when; extern grib_accessor_class* grib_accessor_class_gen; static grib_accessor_class _grib_accessor_class_when = { - &grib_accessor_class_gen, /* super */ - "when", /* name */ - sizeof(grib_accessor_when), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - &dump, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - 0, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - 0, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - ¬ify_change, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_gen, /* super */ + "when", /* name */ + sizeof(grib_accessor_when), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + &dump, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + ¬ify_change, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -98,56 +99,54 @@ grib_accessor_class* grib_accessor_class_when = &_grib_accessor_class_when; static void init_class(grib_accessor_class* c) { - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->value_count = (*(c->super))->value_count; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->unpack_double = (*(c->super))->unpack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ -static void init(grib_accessor* a, const long len , grib_arguments* arg) +static void init(grib_accessor* a, const long len, grib_arguments* arg) { - a->length = 0; - a->flags |= GRIB_ACCESSOR_FLAG_HIDDEN; - a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; + a->flags |= GRIB_ACCESSOR_FLAG_HIDDEN; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } static void dump(grib_accessor* a, grib_dumper* dumper) { - /* grib_dump_when(dumper,a,NULL); */ + /* grib_dump_when(dumper,a,NULL); */ } -static int notify_change(grib_accessor* a,grib_accessor* changed) +static int notify_change(grib_accessor* a, grib_accessor* changed) { - return grib_action_notify_change(a->creator,a,changed); + return grib_action_notify_change(a->creator, a, changed); } - diff --git a/src/grib_api_version.c b/src/grib_api_version.c index 5b9f046f5..a8adfce85 100644 --- a/src/grib_api_version.c +++ b/src/grib_api_version.c @@ -1 +1,4 @@ -const char * grib_get_git_sha1() { return ""; } +const char* grib_get_git_sha1() +{ + return ""; +} diff --git a/src/grib_bits.c b/src/grib_bits.c index 442c96a8a..19221ee40 100644 --- a/src/grib_bits.c +++ b/src/grib_bits.c @@ -18,61 +18,69 @@ #include "omp.h" #endif -#define mask1(i) (1UL << i) -#define test(n,i) !!((n) & mask1(i)) +#define mask1(i) (1UL << i) +#define test(n, i) !!((n)&mask1(i)) -long GRIB_MASK = -1; /* Mask of sword bits */ +long GRIB_MASK = -1; /* Mask of sword bits */ -# define VALUE(p,q,b) \ - (((b)==max_nbits ? GRIB_MASK : ~(GRIB_MASK<<(b))) & ((p)>>(max_nbits-((q)+(b))))) +#define VALUE(p, q, b) \ + (((b) == max_nbits ? GRIB_MASK : ~(GRIB_MASK << (b))) & ((p) >> (max_nbits - ((q) + (b))))) -# define MASKVALUE(q,b) \ - ((b)==max_nbits ? GRIB_MASK : (~(GRIB_MASK<<(b))<<(max_nbits-((q)+(b))))) +#define MASKVALUE(q, b) \ + ((b) == max_nbits ? GRIB_MASK : (~(GRIB_MASK << (b)) << (max_nbits - ((q) + (b))))) -static const unsigned long dmasks[] = { 0xFF, 0xFE, 0xFC, 0xF8, 0xF0, 0xE0, 0xC0, 0x80, 0x00, }; +static const unsigned long dmasks[] = { + 0xFF, + 0xFE, + 0xFC, + 0xF8, + 0xF0, + 0xE0, + 0xC0, + 0x80, + 0x00, +}; -static const int max_nbits = sizeof(unsigned long)*8; -static const int max_nbits_size_t = sizeof(size_t)*8; +static const int max_nbits = sizeof(unsigned long) * 8; +static const int max_nbits_size_t = sizeof(size_t) * 8; unsigned long grib_decode_unsigned_byte_long(const unsigned char* p, long o, int l) { - long accum = 0; - int i = 0; + long accum = 0; + int i = 0; unsigned char b = p[o++]; Assert(l <= max_nbits); - accum <<= 8; - accum |= b ; + accum <<= 8; + accum |= b; - for ( i=1; i> (l*8-(8*(i+1))); - p[o++] = accum ; + for (i = 0; i < l; i++) { + accum = val >> (l * 8 - (8 * (i + 1))); + p[o++] = accum; } - if (sign) p[off] |= 128; + if (sign) + p[off] |= 128; return GRIB_SUCCESS; } -static void grib_set_bit_on( unsigned char* p, long* bitp) +static void grib_set_bit_on(unsigned char* p, long* bitp) { - p += *bitp/8; - *p |= (1u << (7-((*bitp)%8))); + p += *bitp / 8; + *p |= (1u << (7 - ((*bitp) % 8))); (*bitp)++; } -void grib_set_bits_on( unsigned char* p, long* bitp,long nbits) +void grib_set_bits_on(unsigned char* p, long* bitp, long nbits) { int i; - for (i=0;i> 3); - return (*p&(1<<(7-(bitp%8)))); + return (*p & (1 << (7 - (bitp % 8)))); } -void grib_set_bit( unsigned char* p, long bitp, int val) +void grib_set_bit(unsigned char* p, long bitp, int val) { - if(val == 0) grib_set_bit_off(p,&bitp); - else grib_set_bit_on(p,&bitp); + if (val == 0) + grib_set_bit_off(p, &bitp); + else + grib_set_bit_on(p, &bitp); } -long grib_decode_signed_longb(const unsigned char* p, long *bitp, long nbits) +long grib_decode_signed_longb(const unsigned char* p, long* bitp, long nbits) { int sign = grib_get_bit(p, *bitp); long val = 0; @@ -145,35 +156,37 @@ long grib_decode_signed_longb(const unsigned char* p, long *bitp, long nbits) *bitp += 1; - val = grib_decode_unsigned_long( p, bitp, nbits-1); + val = grib_decode_unsigned_long(p, bitp, nbits - 1); - if (sign)val = -val; + if (sign) + val = -val; - return val; + return val; } -int grib_encode_signed_longb(unsigned char* p, long val ,long *bitp, long nb) +int grib_encode_signed_longb(unsigned char* p, long val, long* bitp, long nb) { - short sign = val < 0; + short sign = val < 0; Assert(nb <= max_nbits); - if(sign) val = -val; + if (sign) + val = -val; - if(sign) - grib_set_bit_on (p, bitp); + if (sign) + grib_set_bit_on(p, bitp); else grib_set_bit_off(p, bitp); - return grib_encode_unsigned_longb(p, val ,bitp, nb-1); + return grib_encode_unsigned_longb(p, val, bitp, nb - 1); } #if GRIB_IBMPOWER67_OPT - #include "grib_bits_ibmpow.c" +#include "grib_bits_ibmpow.c" +#else +#if FAST_BIG_ENDIAN +#include "grib_bits_fast_big_endian.c" #else - #if FAST_BIG_ENDIAN - #include "grib_bits_fast_big_endian.c" - #else - #include "grib_bits_any_endian.c" - #endif +#include "grib_bits_any_endian.c" +#endif #endif diff --git a/src/grib_bits_any_endian.c b/src/grib_bits_any_endian.c index 8e5c31c01..5823ea284 100644 --- a/src/grib_bits_any_endian.c +++ b/src/grib_bits_any_endian.c @@ -14,14 +14,15 @@ ***************************************************************************/ #if GRIB_PTHREADS -static pthread_once_t once = PTHREAD_ONCE_INIT; +static pthread_once_t once = PTHREAD_ONCE_INIT; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; -static void init() { +static void init() +{ pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); - pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init(&mutex,&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&mutex, &attr); pthread_mutexattr_destroy(&attr); } #elif GRIB_OMP_THREADS @@ -32,8 +33,7 @@ static void init() { GRIB_OMP_CRITICAL(lock_grib_bits_any_endian_c) { - if (once == 0) - { + if (once == 0) { omp_init_nest_lock(&mutex); once = 1; } @@ -41,123 +41,128 @@ static void init() } #endif -typedef struct bits_all_one_t { +typedef struct bits_all_one_t +{ int inited; int size; long v[128]; } bits_all_one_t; -static bits_all_one_t bits_all_one={0,0,{0,}}; +static bits_all_one_t bits_all_one = { 0, 0, {0,} }; static void init_bits_all_one() { - int size=sizeof(long)*8; - long* v=0; - unsigned long cmask=-1; - DebugAssert( !bits_all_one.inited ); - - bits_all_one.size=size; - bits_all_one.inited=1; - v=bits_all_one.v+size; + int size = sizeof(long) * 8; + long* v = 0; + unsigned long cmask = -1; + DebugAssert(!bits_all_one.inited); + + bits_all_one.size = size; + bits_all_one.inited = 1; + v = bits_all_one.v + size; /* * The result of a shift operation is undefined if the RHS is negative or * greater than or equal to the number of bits in the (promoted) shift-expression */ /* *v= cmask << size; */ *v = -1; - while (size>0) *(--v)= ~(cmask << --size); + while (size > 0) + *(--v) = ~(cmask << --size); } static void init_bits_all_one_if_needed() { - GRIB_MUTEX_INIT_ONCE(&once,&init); + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex); - if (!bits_all_one.inited) init_bits_all_one(); + if (!bits_all_one.inited) + init_bits_all_one(); GRIB_MUTEX_UNLOCK(&mutex); } int grib_is_all_bits_one(long val, long nbits) { /*if (!bits_all_one.inited) init_bits_all_one();*/ init_bits_all_one_if_needed(); - return bits_all_one.v[nbits]==val; + return bits_all_one.v[nbits] == val; } -int grib_encode_string(unsigned char *bitStream, long *bitOffset, size_t numberOfCharacters, const char *string) +int grib_encode_string(unsigned char* bitStream, long* bitOffset, size_t numberOfCharacters, const char* string) { size_t i; - int err=0; + int err = 0; long byteOffset = *bitOffset / 8; - int remainder = *bitOffset % 8; + int remainder = *bitOffset % 8; unsigned char c; unsigned char* p; - unsigned char mask[] ={ 0, 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC, 0xFE }; - int remainderComplement=8-remainder; - char str[512]={0,}; - char *s=str; + unsigned char mask[] = { 0, 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC, 0xFE }; + int remainderComplement = 8 - remainder; + char str[512] = {0,}; + char* s = str; - Assert(numberOfCharacters<512); + Assert(numberOfCharacters < 512); - if (string) memcpy(s,string,strlen(string)); + if (string) + memcpy(s, string, strlen(string)); /* if (remainder) byteOffset++; */ - if (numberOfCharacters==0) return err; + if (numberOfCharacters == 0) + return err; - p=(unsigned char*)bitStream+byteOffset; + p = (unsigned char*)bitStream + byteOffset; - if ( remainder == 0 ) { - memcpy(p,str,numberOfCharacters); - *bitOffset+=numberOfCharacters*8; + if (remainder == 0) { + memcpy(p, str, numberOfCharacters); + *bitOffset += numberOfCharacters * 8; return err; } - for (i=0;i>remainder) & ~mask[remainder]; + for (i = 0; i < numberOfCharacters; i++) { + c = ((*s) >> remainder) & ~mask[remainder]; *p |= c; p++; - *p = ((*s)<>remainderComplement ); + *s = (c | ((*p) & mask[remainder]) >> remainderComplement); s++; } - *bitOffset+=numberOfCharacters*8; + *bitOffset += numberOfCharacters * 8; return string; } /* A mask with x least-significant bits set, possibly 0 or >=32 */ /* -1UL is 1111111... in every bit in binary representation */ #define BIT_MASK(x) \ - (((x) == max_nbits) ? \ - (unsigned long) -1UL : (1UL << (x)) - 1) + (((x) == max_nbits) ? (unsigned long)-1UL : (1UL << (x)) - 1) /** * decode a value consisting of nbits from an octet-bitstream to long-representation * @@ -166,37 +171,35 @@ char* grib_decode_string(const unsigned char* bitStream, long *bitOffset, size_t * @param nbits number of bits needed to build a number (e.g. 8=byte, 16=short, 32=int, but also other sizes allowed) * @return value encoded as 32/64bit numbers */ -unsigned long grib_decode_unsigned_long(const unsigned char* p, long *bitp, long nbits) +unsigned long grib_decode_unsigned_long(const unsigned char* p, long* bitp, long nbits) { - unsigned long ret = 0; - long oc = *bitp/8; - unsigned long mask = 0; - long pi = 0; + unsigned long ret = 0; + long oc = *bitp / 8; + unsigned long mask = 0; + long pi = 0; int usefulBitsInByte = 0; - long bitsToRead = 0; + long bitsToRead = 0; - if (nbits==0) return 0; + if (nbits == 0) + return 0; - if(nbits > max_nbits) - { + if (nbits > max_nbits) { int bits = nbits; - int mod = bits % max_nbits; + int mod = bits % max_nbits; - if(mod != 0) - { - int e=grib_decode_unsigned_long(p,bitp,mod); - Assert( e == 0); + if (mod != 0) { + int e = grib_decode_unsigned_long(p, bitp, mod); + Assert(e == 0); bits -= mod; } - while(bits > max_nbits) - { - int e=grib_decode_unsigned_long(p,bitp,max_nbits); - Assert( e == 0); + while (bits > max_nbits) { + int e = grib_decode_unsigned_long(p, bitp, max_nbits); + Assert(e == 0); bits -= max_nbits; } - return grib_decode_unsigned_long(p,bitp,bits); + return grib_decode_unsigned_long(p, bitp, bits); } #if 0 long ret2 = 0; @@ -211,13 +214,13 @@ unsigned long grib_decode_unsigned_long(const unsigned char* p, long *bitp, long /* pi: position of bitp in p[]. >>3 == /8 */ pi = oc; /* number of useful bits in current byte */ - usefulBitsInByte = 8-(*bitp & 7); + usefulBitsInByte = 8 - (*bitp & 7); /* read at least enough bits (byte by byte) from input */ bitsToRead = nbits; while (bitsToRead > 0) { - ret <<= 8; + ret <<= 8; /* ret += p[pi]; */ - DebugAssert( (ret & p[pi]) == 0 ); + DebugAssert((ret & p[pi]) == 0); ret = ret | p[pi]; pi++; bitsToRead -= usefulBitsInByte; @@ -227,7 +230,7 @@ unsigned long grib_decode_unsigned_long(const unsigned char* p, long *bitp, long /* printf("%d %d %d\n", pi, ret, offset); */ /* bitsToRead might now be negative (too many bits read) */ /* remove those which are too much */ - ret >>= -1*bitsToRead; + ret >>= -1 * bitsToRead; /* remove leading bits (from previous value) */ ret &= mask; /* printf("%d %d\n", ret2, ret);*/ @@ -235,17 +238,17 @@ unsigned long grib_decode_unsigned_long(const unsigned char* p, long *bitp, long return ret; } -int grib_encode_unsigned_long(unsigned char* p, unsigned long val ,long *bitp, long nbits) +int grib_encode_unsigned_long(unsigned char* p, unsigned long val, long* bitp, long nbits) { - long len = nbits; - int s = *bitp % 8; - int n = 8 - s; + long len = nbits; + int s = *bitp % 8; + int n = 8 - s; unsigned char tmp = 0; /*for temporary results*/ if (nbits > max_nbits) { /* TODO: Do some real code here, to support long longs */ - int bits = nbits; - int mod = bits % max_nbits; + int bits = nbits; + int mod = bits % max_nbits; long zero = 0; if (mod != 0) { @@ -273,7 +276,8 @@ int grib_encode_unsigned_long(unsigned char* p, unsigned long val ,long *bitp, l len -= n; if (len < 0) { tmp = ((val << -len) | ((*p) & dmasks[n])); - } else { + } + else { tmp = ((val >> len) | ((*p) & dmasks[n])); } *p = tmp; @@ -302,34 +306,31 @@ int grib_encode_unsigned_long(unsigned char* p, unsigned long val ,long *bitp, l * Note: On x64 Micrsoft Windows a "long" is 32 bits but "size_t" is 64 bits */ #define BIT_MASK_SIZE_T(x) \ - (((x) == max_nbits_size_t) ? \ - (size_t) -1UL : (1UL << (x)) - 1) + (((x) == max_nbits_size_t) ? (size_t)-1UL : (1UL << (x)) - 1) -size_t grib_decode_size_t(const unsigned char* p, long *bitp, long nbits) +size_t grib_decode_size_t(const unsigned char* p, long* bitp, long nbits) { - size_t ret = 0; - long oc = *bitp / 8; - size_t mask = 0; - long pi = 0; + size_t ret = 0; + long oc = *bitp / 8; + size_t mask = 0; + long pi = 0; int usefulBitsInByte = 0; - long bitsToRead = 0; + long bitsToRead = 0; - if (nbits == 0) return 0; + if (nbits == 0) + return 0; - if (nbits > max_nbits_size_t) - { + if (nbits > max_nbits_size_t) { int bits = nbits; - int mod = bits % max_nbits_size_t; + int mod = bits % max_nbits_size_t; - if (mod != 0) - { + if (mod != 0) { int e = grib_decode_size_t(p, bitp, mod); Assert(e == 0); bits -= mod; } - while (bits > max_nbits_size_t) - { + while (bits > max_nbits_size_t) { int e = grib_decode_size_t(p, bitp, max_nbits_size_t); Assert(e == 0); bits -= max_nbits_size_t; @@ -365,9 +366,9 @@ size_t grib_decode_size_t(const unsigned char* p, long *bitp, long nbits) return ret; } -int grib_encode_unsigned_longb(unsigned char* p, unsigned long val ,long *bitp, long nb) +int grib_encode_unsigned_longb(unsigned char* p, unsigned long val, long* bitp, long nb) { - long i = 0; + long i = 0; if (nb > max_nbits) { fprintf(stderr, "Number of bits (%ld) exceeds maximum number of bits (%d)\n", nb, max_nbits); @@ -375,16 +376,16 @@ int grib_encode_unsigned_longb(unsigned char* p, unsigned long val ,long *bitp, } #ifdef DEBUG { - unsigned long maxV = grib_power(nb,2); + unsigned long maxV = grib_power(nb, 2); if (val > maxV) { fprintf(stderr, "grib_encode_unsigned_longb: Value=%lu, but number of bits=%ld!\n", val, nb); Assert(0); } } #endif - for(i=nb-1; i >= 0; i--){ - if(test(val,i)) - grib_set_bit_on (p, bitp); + for (i = nb - 1; i >= 0; i--) { + if (test(val, i)) + grib_set_bit_on(p, bitp); else grib_set_bit_off(p, bitp); } @@ -394,7 +395,7 @@ int grib_encode_unsigned_longb(unsigned char* p, unsigned long val ,long *bitp, /* * Note: On x64 Micrsoft Windows a "long" is 32 bits but "size_t" is 64 bits */ -int grib_encode_size_tb(unsigned char* p, size_t val ,long *bitp, long nb) +int grib_encode_size_tb(unsigned char* p, size_t val, long* bitp, long nb) { long i = 0; @@ -404,16 +405,16 @@ int grib_encode_size_tb(unsigned char* p, size_t val ,long *bitp, long nb) } #ifdef DEBUG { - size_t maxV = grib_power(nb,2); + size_t maxV = grib_power(nb, 2); if (val > maxV) { fprintf(stderr, "grib_encode_size_tb: Value=%lu, but number of bits=%ld!\n", val, nb); Assert(0); } } #endif - for(i=nb-1; i >= 0; i--){ - if(test(val,i)) - grib_set_bit_on (p, bitp); + for (i = nb - 1; i >= 0; i--) { + if (test(val, i)) + grib_set_bit_on(p, bitp); else grib_set_bit_off(p, bitp); } @@ -421,9 +422,9 @@ int grib_encode_size_tb(unsigned char* p, size_t val ,long *bitp, long nb) } #if OMP_PACKING - #include "grib_bits_any_endian_omp.c" +#include "grib_bits_any_endian_omp.c" #elif VECTOR - #include "grib_bits_any_endian_vector.c" +#include "grib_bits_any_endian_vector.c" #else - #include "grib_bits_any_endian_simple.c" +#include "grib_bits_any_endian_simple.c" #endif diff --git a/src/grib_bits_any_endian_omp.c b/src/grib_bits_any_endian_omp.c index 5ccc43d0e..618658394 100644 --- a/src/grib_bits_any_endian_omp.c +++ b/src/grib_bits_any_endian_omp.c @@ -21,8 +21,8 @@ * @param n_vals number of values to decode * @param val output, values encoded as 32/64bit numbers */ -int grib_decode_long_array(const unsigned char* p, long *bitp, long bitsPerValue, - size_t n_vals,long* val) +int grib_decode_long_array(const unsigned char* p, long* bitp, long bitsPerValue, + size_t n_vals, long* val) { unsigned long mask = BIT_MASK(bitsPerValue); @@ -30,11 +30,11 @@ int grib_decode_long_array(const unsigned char* p, long *bitp, long bitsPerValue long pi = *bitp / 8; size_t i; /* number of useful bits in current byte */ - int usefulBitsInByte = 8-(*bitp & 7); - for(i=0;i < n_vals;i++) { + int usefulBitsInByte = 8 - (*bitp & 7); + for (i = 0; i < n_vals; i++) { /* read at least enough bits (byte by byte) from input */ long bitsToRead = bitsPerValue; - long ret = 0; + long ret = 0; while (bitsToRead > 0) { ret <<= 8; /* ret += p[pi]; */ @@ -48,15 +48,16 @@ int grib_decode_long_array(const unsigned char* p, long *bitp, long bitsPerValue /*fprintf(stderr, "%d %d %d %d %d\n", bitsPerValue, *bitp, pi, ret, bitsToRead);*/ /* bitsToRead might now be negative (too many bits read) */ /* remove those which are too much */ - ret >>= -1*bitsToRead; + ret >>= -1 * bitsToRead; /* remove leading bits (from previous value) */ ret &= mask; val[i] = ret; - usefulBitsInByte = -1*bitsToRead; /* prepare for next round */ + usefulBitsInByte = -1 * bitsToRead; /* prepare for next round */ if (usefulBitsInByte > 0) { pi--; /* reread the current byte */ - } else { + } + else { usefulBitsInByte = 8; /* start with next full byte */ } } @@ -72,11 +73,11 @@ int grib_decode_long_array(const unsigned char* p, long *bitp, long bitsPerValue * @param n_vals number of values to decode * @param val output, values encoded as 32/64bit numbers */ -int grib_decode_double_array(const unsigned char* p, long *bitp, long bitsPerValue, - double reference_value,double s,double d, - size_t n_vals,double* val) +int grib_decode_double_array(const unsigned char* p, long* bitp, long bitsPerValue, + double reference_value, double s, double d, + size_t n_vals, double* val) { - long i=0; + long i = 0; unsigned long lvalue = 0; double x; @@ -101,15 +102,15 @@ int grib_decode_double_array(const unsigned char* p, long *bitp, long bitsPerVal /* some bits might of the current byte at pi might be used */ /* by the previous number usefulBitsInByte gives remaining unused bits */ /* number of useful bits in current byte */ - int usefulBitsInByte = 8-(*bitp & 7); - for(i=0;i < n_vals;i++) { + int usefulBitsInByte = 8 - (*bitp & 7); + for (i = 0; i < n_vals; i++) { /* value read as long */ long bitsToRead = 0; - lvalue = 0; - bitsToRead = bitsPerValue; + lvalue = 0; + bitsToRead = bitsPerValue; /* read one byte after the other to lvalue until >= bitsPerValue are read */ while (bitsToRead > 0) { - lvalue <<= 8; + lvalue <<= 8; lvalue += p[pi]; pi++; bitsToRead -= usefulBitsInByte; @@ -117,87 +118,88 @@ int grib_decode_double_array(const unsigned char* p, long *bitp, long bitsPerVal } *bitp += bitsPerValue; /* bitsToRead is now <= 0, remove the last bits */ - lvalue >>= -1*bitsToRead; + lvalue >>= -1 * bitsToRead; /* set leading bits to 0 - removing bits used for previous number */ lvalue &= mask; - usefulBitsInByte = -1*bitsToRead; /* prepare for next round */ + usefulBitsInByte = -1 * bitsToRead; /* prepare for next round */ if (usefulBitsInByte > 0) { pi--; /* reread the current byte */ - } else { + } + else { usefulBitsInByte = 8; /* start with next full byte */ } /* scaling and move value to output */ - x=((lvalue*s)+reference_value)*d; + x = ((lvalue * s) + reference_value) * d; val[i] = (double)x; } return 0; } -int grib_decode_double_array_complex(const unsigned char* p, long *bitp, long nbits,double reference_value,double s,double* d,size_t size,double* val) +int grib_decode_double_array_complex(const unsigned char* p, long* bitp, long nbits, double reference_value, double s, double* d, size_t size, double* val) { return GRIB_NOT_IMPLEMENTED; } -int grib_encode_long_array(size_t n_vals,const long* val,long bits_per_value,unsigned char* p,long *off) +int grib_encode_long_array(size_t n_vals, const long* val, long bits_per_value, unsigned char* p, long* off) { - size_t i=0; - unsigned long unsigned_val=0; - unsigned char *encoded=p; - if(bits_per_value%8){ - for(i=0;i< n_vals;i++){ - unsigned_val=val[i]; - grib_encode_unsigned_longb(encoded, unsigned_val, off , bits_per_value); + size_t i = 0; + unsigned long unsigned_val = 0; + unsigned char* encoded = p; + if (bits_per_value % 8) { + for (i = 0; i < n_vals; i++) { + unsigned_val = val[i]; + grib_encode_unsigned_longb(encoded, unsigned_val, off, bits_per_value); } - } else{ - for(i=0;i< n_vals;i++){ - int blen=0; - blen = bits_per_value; + } + else { + for (i = 0; i < n_vals; i++) { + int blen = 0; + blen = bits_per_value; unsigned_val = val[i]; - while(blen >= 8) - { - blen -= 8; + while (blen >= 8) { + blen -= 8; *encoded = (unsigned_val >> blen); encoded++; - *off+=8; + *off += 8; } } } return GRIB_SUCCESS; } -int grib_encode_double_array(size_t n_vals,const double* val,long bits_per_value,double reference_value,double d,double divisor,unsigned char* p,long *off) +int grib_encode_double_array(size_t n_vals, const double* val, long bits_per_value, double reference_value, double d, double divisor, unsigned char* p, long* off) { - size_t i=0; - unsigned long unsigned_val=0; - unsigned char *encoded=p; + size_t i = 0; + unsigned long unsigned_val = 0; + unsigned char* encoded = p; double x; - if(bits_per_value%8){ - for(i=0;i< n_vals;i++){ - x=(((val[i]*d)-reference_value)*divisor)+0.5; + if (bits_per_value % 8) { + for (i = 0; i < n_vals; i++) { + x = (((val[i] * d) - reference_value) * divisor) + 0.5; unsigned_val = (unsigned long)x; - grib_encode_unsigned_longb(encoded, unsigned_val, off , bits_per_value); + grib_encode_unsigned_longb(encoded, unsigned_val, off, bits_per_value); } - } else{ - for(i=0;i< n_vals;i++){ - int blen=0; - blen = bits_per_value; - x = ((((val[i]*d)-reference_value)*divisor)+0.5); + } + else { + for (i = 0; i < n_vals; i++) { + int blen = 0; + blen = bits_per_value; + x = ((((val[i] * d) - reference_value) * divisor) + 0.5); unsigned_val = (unsigned long)x; - while(blen >= 8) - { - blen -= 8; + while (blen >= 8) { + blen -= 8; *encoded = (unsigned_val >> blen); encoded++; - *off+=8; + *off += 8; } } } return GRIB_SUCCESS; } -int grib_encode_double_array_complex(size_t n_vals,double* val,long nbits,double reference_value, - double* scal,double d,double divisor,unsigned char* p,long *bitp) +int grib_encode_double_array_complex(size_t n_vals, double* val, long nbits, double reference_value, + double* scal, double d, double divisor, unsigned char* p, long* bitp) { return GRIB_NOT_IMPLEMENTED; } diff --git a/src/grib_bits_any_endian_simple.c b/src/grib_bits_any_endian_simple.c index 9e6bc816e..525ada7d3 100644 --- a/src/grib_bits_any_endian_simple.c +++ b/src/grib_bits_any_endian_simple.c @@ -16,8 +16,7 @@ /* A mask with x least-significant bits set, possibly 0 or >=32 */ /* -1UL is 1111111... in every bit in binary representation */ #define BIT_MASK1(x) \ - (((x) >= max_nbits) ? \ - (unsigned long) -1UL : (1UL << (x)) - 1) + (((x) >= max_nbits) ? (unsigned long)-1UL : (1UL << (x)) - 1) /** * decode an array of n_vals values from a octet-stream @@ -28,8 +27,8 @@ * @param n_vals number of values to decode * @param val output, values encoded as 32/64bit numbers */ -int grib_decode_long_array(const unsigned char* p, long *bitp, long bitsPerValue, - size_t n_vals,long* val) +int grib_decode_long_array(const unsigned char* p, long* bitp, long bitsPerValue, + size_t n_vals, long* val) { unsigned long mask = BIT_MASK1(bitsPerValue); @@ -37,11 +36,11 @@ int grib_decode_long_array(const unsigned char* p, long *bitp, long bitsPerValue long pi = *bitp / 8; size_t i; /* number of useful bits in current byte */ - int usefulBitsInByte = 8-(*bitp & 7); - for(i=0;i < n_vals;i++) { + int usefulBitsInByte = 8 - (*bitp & 7); + for (i = 0; i < n_vals; i++) { /* read at least enough bits (byte by byte) from input */ long bitsToRead = bitsPerValue; - long ret = 0; + long ret = 0; while (bitsToRead > 0) { ret <<= 8; /* ret += p[pi]; */ @@ -55,15 +54,16 @@ int grib_decode_long_array(const unsigned char* p, long *bitp, long bitsPerValue /*fprintf(stderr, "%d %d %d %d %d\n", bitsPerValue, *bitp, pi, ret, bitsToRead);*/ /* bitsToRead might now be negative (too many bits read) */ /* remove those which are too much */ - ret >>= -1*bitsToRead; + ret >>= -1 * bitsToRead; /* remove leading bits (from previous value) */ ret &= mask; val[i] = ret; - usefulBitsInByte = -1*bitsToRead; /* prepare for next round */ + usefulBitsInByte = -1 * bitsToRead; /* prepare for next round */ if (usefulBitsInByte > 0) { pi--; /* reread the current byte */ - } else { + } + else { usefulBitsInByte = 8; /* start with next full byte */ } } @@ -79,11 +79,11 @@ int grib_decode_long_array(const unsigned char* p, long *bitp, long bitsPerValue * @param n_vals number of values to decode * @param val output, values encoded as 32/64bit numbers */ -int grib_decode_double_array(const unsigned char* p, long *bitp, long bitsPerValue, - double reference_value,double s,double d, - size_t n_vals,double* val) +int grib_decode_double_array(const unsigned char* p, long* bitp, long bitsPerValue, + double reference_value, double s, double d, + size_t n_vals, double* val) { - long i=0; + long i = 0; unsigned long lvalue = 0; double x; @@ -101,31 +101,27 @@ int grib_decode_double_array(const unsigned char* p, long *bitp, long bitsPerVal val[i] = (double)x; } #endif - if (bitsPerValue%8 == 0) - { + if (bitsPerValue % 8 == 0) { /* See ECC-386 */ int bc; - int l = bitsPerValue/8; + int l = bitsPerValue / 8; size_t o = 0; - for(i=0;i < n_vals;i++) - { - lvalue = 0; - lvalue <<= 8; - lvalue |= p[o++] ; + for (i = 0; i < n_vals; i++) { + lvalue = 0; + lvalue <<= 8; + lvalue |= p[o++]; - for ( bc=1; bc>3 == /8 */ @@ -133,15 +129,15 @@ int grib_decode_double_array(const unsigned char* p, long *bitp, long bitsPerVal /* some bits might of the current byte at pi might be used */ /* by the previous number usefulBitsInByte gives remaining unused bits */ /* number of useful bits in current byte */ - int usefulBitsInByte = 8-(*bitp & 7); - for(i=0;i < n_vals;i++) { + int usefulBitsInByte = 8 - (*bitp & 7); + for (i = 0; i < n_vals; i++) { /* value read as long */ long bitsToRead = 0; - lvalue = 0; - bitsToRead = bitsPerValue; + lvalue = 0; + bitsToRead = bitsPerValue; /* read one byte after the other to lvalue until >= bitsPerValue are read */ while (bitsToRead > 0) { - lvalue <<= 8; + lvalue <<= 8; lvalue += p[pi]; pi++; bitsToRead -= usefulBitsInByte; @@ -149,88 +145,89 @@ int grib_decode_double_array(const unsigned char* p, long *bitp, long bitsPerVal } *bitp += bitsPerValue; /* bitsToRead is now <= 0, remove the last bits */ - lvalue >>= -1*bitsToRead; + lvalue >>= -1 * bitsToRead; /* set leading bits to 0 - removing bits used for previous number */ lvalue &= mask; - usefulBitsInByte = -1*bitsToRead; /* prepare for next round */ + usefulBitsInByte = -1 * bitsToRead; /* prepare for next round */ if (usefulBitsInByte > 0) { pi--; /* reread the current byte */ - } else { + } + else { usefulBitsInByte = 8; /* start with next full byte */ } /* scaling and move value to output */ - x=((lvalue*s)+reference_value)*d; + x = ((lvalue * s) + reference_value) * d; val[i] = (double)x; } } return 0; } -int grib_decode_double_array_complex(const unsigned char* p, long *bitp, long nbits,double reference_value,double s,double* d,size_t size,double* val) +int grib_decode_double_array_complex(const unsigned char* p, long* bitp, long nbits, double reference_value, double s, double* d, size_t size, double* val) { return GRIB_NOT_IMPLEMENTED; } -int grib_encode_long_array(size_t n_vals,const long* val,long bits_per_value,unsigned char* p,long *off) +int grib_encode_long_array(size_t n_vals, const long* val, long bits_per_value, unsigned char* p, long* off) { - size_t i=0; - unsigned long unsigned_val=0; - unsigned char *encoded=p; - if(bits_per_value%8){ - for(i=0;i< n_vals;i++){ - unsigned_val=val[i]; - grib_encode_unsigned_longb(encoded, unsigned_val, off , bits_per_value); + size_t i = 0; + unsigned long unsigned_val = 0; + unsigned char* encoded = p; + if (bits_per_value % 8) { + for (i = 0; i < n_vals; i++) { + unsigned_val = val[i]; + grib_encode_unsigned_longb(encoded, unsigned_val, off, bits_per_value); } - } else{ - for(i=0;i< n_vals;i++){ - int blen=0; - blen = bits_per_value; + } + else { + for (i = 0; i < n_vals; i++) { + int blen = 0; + blen = bits_per_value; unsigned_val = val[i]; - while(blen >= 8) - { - blen -= 8; + while (blen >= 8) { + blen -= 8; *encoded = (unsigned_val >> blen); encoded++; - *off+=8; + *off += 8; } } } return GRIB_SUCCESS; } -int grib_encode_double_array(size_t n_vals,const double* val,long bits_per_value,double reference_value,double d,double divisor,unsigned char* p,long *off) +int grib_encode_double_array(size_t n_vals, const double* val, long bits_per_value, double reference_value, double d, double divisor, unsigned char* p, long* off) { - size_t i=0; - unsigned long unsigned_val=0; - unsigned char *encoded=p; + size_t i = 0; + unsigned long unsigned_val = 0; + unsigned char* encoded = p; double x; - if(bits_per_value%8){ - for(i=0;i< n_vals;i++){ - x=(((val[i]*d)-reference_value)*divisor)+0.5; + if (bits_per_value % 8) { + for (i = 0; i < n_vals; i++) { + x = (((val[i] * d) - reference_value) * divisor) + 0.5; unsigned_val = (unsigned long)x; - grib_encode_unsigned_longb(encoded, unsigned_val, off , bits_per_value); + grib_encode_unsigned_longb(encoded, unsigned_val, off, bits_per_value); } - } else{ - for(i=0;i< n_vals;i++){ - int blen=0; - blen = bits_per_value; - x = ((((val[i]*d)-reference_value)*divisor)+0.5); + } + else { + for (i = 0; i < n_vals; i++) { + int blen = 0; + blen = bits_per_value; + x = ((((val[i] * d) - reference_value) * divisor) + 0.5); unsigned_val = (unsigned long)x; - while(blen >= 8) - { - blen -= 8; + while (blen >= 8) { + blen -= 8; *encoded = (unsigned_val >> blen); encoded++; - *off+=8; + *off += 8; } } } return GRIB_SUCCESS; } -int grib_encode_double_array_complex(size_t n_vals,double* val,long nbits,double reference_value, - double* scal,double d,double divisor,unsigned char* p,long *bitp) +int grib_encode_double_array_complex(size_t n_vals, double* val, long nbits, double reference_value, + double* scal, double d, double divisor, unsigned char* p, long* bitp) { return GRIB_NOT_IMPLEMENTED; } diff --git a/src/grib_bits_any_endian_vector.c b/src/grib_bits_any_endian_vector.c index fd6672613..1e901d99c 100644 --- a/src/grib_bits_any_endian_vector.c +++ b/src/grib_bits_any_endian_vector.c @@ -13,122 +13,123 @@ * * ***************************************************************************/ -int grib_decode_long_array(const unsigned char* p, long *bitp, long bitsPerValue, - size_t n_vals,long* val) { - long i=0; - unsigned long lvalue = 0; - - if(bitsPerValue%8) - { - int j=0; - for(i=0;i < n_vals;i++) { - lvalue=0; - for(j=0; j< bitsPerValue;j++){ - lvalue <<= 1; - if(grib_get_bit( p, *bitp)) lvalue += 1; - *bitp += 1; - } - val[i] = lvalue; +int grib_decode_long_array(const unsigned char* p, long* bitp, long bitsPerValue, + size_t n_vals, long* val) +{ + long i = 0; + unsigned long lvalue = 0; + + if (bitsPerValue % 8) { + int j = 0; + for (i = 0; i < n_vals; i++) { + lvalue = 0; + for (j = 0; j < bitsPerValue; j++) { + lvalue <<= 1; + if (grib_get_bit(p, *bitp)) + lvalue += 1; + *bitp += 1; + } + val[i] = lvalue; + } } - } else { - int bc; - int l = bitsPerValue/8; - size_t o = *bitp/8; - - for(i=0;i < n_vals;i++) - { - lvalue = 0; - lvalue <<= 8; - lvalue |= p[o++] ; - - for ( bc=1; bc= 8) - { - blen -= 8; - *encoded = (unsigned_val >> blen); - encoded++; - *off+=8; - } + else { + for (i = 0; i < n_vals; i++) { + int blen = 0; + blen = bits_per_value; + unsigned_val = (unsigned long)((((val[i] * d) - reference_value) * divisor) + 0.5); + while (blen >= 8) { + blen -= 8; + *encoded = (unsigned_val >> blen); + encoded++; + *off += 8; + } + } } - } - return GRIB_SUCCESS; + return GRIB_SUCCESS; } -int grib_encode_double_array_complex(size_t n_vals,double* val,long nbits,double reference_value, - double* scal,double d,double divisor,unsigned char* p,long *bitp) { - return GRIB_NOT_IMPLEMENTED; +int grib_encode_double_array_complex(size_t n_vals, double* val, long nbits, double reference_value, + double* scal, double d, double divisor, unsigned char* p, long* bitp) +{ + return GRIB_NOT_IMPLEMENTED; } - diff --git a/src/grib_bits_fast_big_endian.c b/src/grib_bits_fast_big_endian.c index f2d91e113..ce167c838 100644 --- a/src/grib_bits_fast_big_endian.c +++ b/src/grib_bits_fast_big_endian.c @@ -14,112 +14,117 @@ ***************************************************************************/ -typedef struct bits_all_one_t { +typedef struct bits_all_one_t +{ int inited; int size; long v[128]; } bits_all_one_t; -static bits_all_one_t bits_all_one={0,0,{0,}}; +static bits_all_one_t bits_all_one = { 0, 0, {0,} }; static void init_bits_all_one() { - int size=sizeof(long)*8; - long* v=0; - unsigned long cmask=-1; - bits_all_one.size=size; - bits_all_one.inited=1; - v=bits_all_one.v+size; + int size = sizeof(long) * 8; + long* v = 0; + unsigned long cmask = -1; + bits_all_one.size = size; + bits_all_one.inited = 1; + v = bits_all_one.v + size; /* * The result of a shift operation is undefined if the RHS is negative or * greater than or equal to the number of bits in the (promoted) shift-expression */ /* *v= cmask << size; */ *v = -1; - while (size>0) *(--v)= ~(cmask << --size); + while (size > 0) + *(--v) = ~(cmask << --size); } int grib_is_all_bits_one(long val, long nbits) { - if (!bits_all_one.inited) init_bits_all_one(); - return bits_all_one.v[nbits]==val; + if (!bits_all_one.inited) + init_bits_all_one(); + return bits_all_one.v[nbits] == val; } -int grib_encode_string(unsigned char *bitStream, long *bitOffset, size_t numberOfCharacters, const char *string) +int grib_encode_string(unsigned char* bitStream, long* bitOffset, size_t numberOfCharacters, const char* string) { size_t i; - int err=0; + int err = 0; long byteOffset = *bitOffset / 8; - int remainder = *bitOffset % 8; + int remainder = *bitOffset % 8; unsigned char* p; - int remainderComplement=8-remainder; - const char *s=string; + int remainderComplement = 8 - remainder; + const char* s = string; - Assert(numberOfCharacters<512 && (numberOfCharacters == 0 || string)); + Assert(numberOfCharacters < 512 && (numberOfCharacters == 0 || string)); /* if (remainder) byteOffset++; */ if (numberOfCharacters > 0) { - unsigned char *restrict p = bitStream+byteOffset; - if ( remainder == 0 ) { + unsigned char* restrict p = bitStream + byteOffset; + if (remainder == 0) { memcpy(p, string, numberOfCharacters); - } else { - unsigned char mask = (unsigned char)(0xFF00 >> remainder); + } + else { + unsigned char mask = (unsigned char)(0xFF00 >> remainder); unsigned char accum = p[0]; - for (size_t i=0; i < numberOfCharacters; ++i) { - accum |= (s[i] >>remainder) & ~mask; - p[i] = accum; + for (size_t i = 0; i < numberOfCharacters; ++i) { + accum |= (s[i] >> remainder) & ~mask; + p[i] = accum; accum = (s[i] << remainderComplement) & mask; } p[numberOfCharacters] = accum; } } - *bitOffset+=numberOfCharacters*8; + *bitOffset += numberOfCharacters * 8; return err; } -char* grib_decode_string(const unsigned char* bitStream, long *bitOffset, size_t numberOfCharacters,char* string) +char* grib_decode_string(const unsigned char* bitStream, long* bitOffset, size_t numberOfCharacters, char* string) { size_t i; long byteOffset = *bitOffset / 8; - int remainder = *bitOffset % 8; + int remainder = *bitOffset % 8; unsigned char c; unsigned char* p; - char* s=string; - unsigned char mask[] ={ 0, 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC, 0xFE }; - int remainderComplement=8-remainder; + char* s = string; + unsigned char mask[] = { 0, 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC, 0xFE }; + int remainderComplement = 8 - remainder; - if (numberOfCharacters==0) return string; + if (numberOfCharacters == 0) + return string; - p=(unsigned char*)bitStream+byteOffset; + p = (unsigned char*)bitStream + byteOffset; - if ( remainder == 0 ) { - memcpy(string,bitStream+byteOffset,numberOfCharacters); - *bitOffset+=numberOfCharacters*8; + if (remainder == 0) { + memcpy(string, bitStream + byteOffset, numberOfCharacters); + *bitOffset += numberOfCharacters * 8; return string; } - for (i=0;i>remainderComplement ); + *s = (c | ((*p) & mask[remainder]) >> remainderComplement); s++; } - *bitOffset+=numberOfCharacters*8; + *bitOffset += numberOfCharacters * 8; return string; } -unsigned long grib_decode_unsigned_long(const unsigned char* p, long *bitp, long nbits) +unsigned long grib_decode_unsigned_long(const unsigned char* p, long* bitp, long nbits) { - long countOfLeftmostBits=0,leftmostBits=0; - long startBit= *bitp ; + long countOfLeftmostBits = 0, leftmostBits = 0; + long startBit = *bitp; long remainingBits = nbits; - long *pp=(long*)p; - unsigned long val=0; + long* pp = (long*)p; + unsigned long val = 0; if (startBit >= max_nbits) { - pp += startBit/max_nbits; + pp += startBit / max_nbits; startBit %= max_nbits; } @@ -127,63 +132,63 @@ unsigned long grib_decode_unsigned_long(const unsigned char* p, long *bitp, long if (countOfLeftmostBits > max_nbits) { countOfLeftmostBits = max_nbits - startBit; remainingBits -= countOfLeftmostBits; - leftmostBits=(VALUE(*pp,startBit,countOfLeftmostBits)) << remainingBits; - startBit = 0; + leftmostBits = (VALUE(*pp, startBit, countOfLeftmostBits)) << remainingBits; + startBit = 0; pp++; - } else + } + else leftmostBits = 0; - val=leftmostBits+(VALUE(*pp,startBit,remainingBits)); + val = leftmostBits + (VALUE(*pp, startBit, remainingBits)); *bitp += nbits; return val; } -int grib_encode_unsigned_long(unsigned char* p, unsigned long val ,long *bitp, long nbits) +int grib_encode_unsigned_long(unsigned char* p, unsigned long val, long* bitp, long nbits) { - long* destination = (long*)p; - long countOfLeftmostBits=0,nextWord=0,startBit=0,remainingBits=0,rightmostBits=0; + long* destination = (long*)p; + long countOfLeftmostBits = 0, nextWord = 0, startBit = 0, remainingBits = 0, rightmostBits = 0; - startBit = *bitp; + startBit = *bitp; remainingBits = nbits; if (startBit >= max_nbits) { nextWord = startBit / max_nbits; startBit %= max_nbits; - } else + } + else nextWord = 0; countOfLeftmostBits = startBit + remainingBits; if (countOfLeftmostBits > max_nbits) { countOfLeftmostBits = max_nbits - startBit; - startBit = max_nbits - remainingBits; + startBit = max_nbits - remainingBits; remainingBits -= countOfLeftmostBits; destination[nextWord] = - ((destination[nextWord] >> countOfLeftmostBits) << countOfLeftmostBits) - + (VALUE(val,startBit,countOfLeftmostBits)); + ((destination[nextWord] >> countOfLeftmostBits) << countOfLeftmostBits) + (VALUE(val, startBit, countOfLeftmostBits)); startBit = 0; nextWord++; } - rightmostBits = VALUE(val,max_nbits-remainingBits,remainingBits); + rightmostBits = VALUE(val, max_nbits - remainingBits, remainingBits); destination[nextWord] = - (destination[nextWord] & ~MASKVALUE(startBit,remainingBits)) - + (rightmostBits << max_nbits-(remainingBits+startBit)); + (destination[nextWord] & ~MASKVALUE(startBit, remainingBits)) + (rightmostBits << max_nbits - (remainingBits + startBit)); - *bitp+=nbits; + *bitp += nbits; return GRIB_SUCCESS; } -int grib_encode_unsigned_longb(unsigned char* p, unsigned long val ,long *bitp, long nbits) +int grib_encode_unsigned_longb(unsigned char* p, unsigned long val, long* bitp, long nbits) { - return grib_encode_unsigned_long(p,val ,bitp, nbits); + return grib_encode_unsigned_long(p, val, bitp, nbits); } #if VECTOR - #include "grib_bits_fast_big_endian_vector.c" +#include "grib_bits_fast_big_endian_vector.c" #elif OMP - #include "grib_bits_fast_big_endian_omp.c" +#include "grib_bits_fast_big_endian_omp.c" #else - #include "grib_bits_fast_big_endian_simple.c" +#include "grib_bits_fast_big_endian_simple.c" #endif diff --git a/src/grib_bits_fast_big_endian_omp.c b/src/grib_bits_fast_big_endian_omp.c index ff75e9d6a..5d3592243 100644 --- a/src/grib_bits_fast_big_endian_omp.c +++ b/src/grib_bits_fast_big_endian_omp.c @@ -13,348 +13,328 @@ * * ***************************************************************************/ -int grib_decode_long_array(const unsigned char* p, long *bitp, long nbits,size_t size,long* val) { - long i=0; - long countOfLeftmostBits=0,leftmostBits=0; - long startBit,startByte; - long remainingBits = nbits; - long *pp=(long*)p; - int inited=0; - unsigned long uval=0; - - if ( (max_nbits%nbits == 0) && (*bitp%nbits == 0) ) { - -#pragma omp parallel for schedule(static) firstprivate(inited,pp) private(startBit,countOfLeftmostBits,remainingBits,leftmostBits) - for (i=0;i= max_nbits) { - pp+=startBit/max_nbits; - startBit %= max_nbits; +int grib_decode_long_array(const unsigned char* p, long* bitp, long nbits, size_t size, long* val) +{ + long i = 0; + long countOfLeftmostBits = 0, leftmostBits = 0; + long startBit, startByte; + long remainingBits = nbits; + long* pp = (long*)p; + int inited = 0; + unsigned long uval = 0; + + if ((max_nbits % nbits == 0) && (*bitp % nbits == 0)) { +#pragma omp parallel for schedule(static) firstprivate(inited, pp) private(startBit, countOfLeftmostBits, remainingBits, leftmostBits) + for (i = 0; i < size; i++) { + if (!inited) { + startBit = *bitp + i * nbits; + remainingBits = nbits; + if (startBit >= max_nbits) { + pp += startBit / max_nbits; + startBit %= max_nbits; + } + inited = 1; + } + + if (startBit == max_nbits) { + startBit = 0; + pp++; + } + + val[i] = VALUE(*pp, startBit, remainingBits); + startBit += remainingBits; + remainingBits = nbits; } - inited=1; - } - - if (startBit == max_nbits) { - startBit = 0; - pp++; - } - - val[i]=VALUE(*pp,startBit,remainingBits); - startBit+=remainingBits; - remainingBits=nbits; } - - } else { - -#pragma omp parallel for schedule(static) firstprivate(inited,pp) private(startBit,countOfLeftmostBits,remainingBits,leftmostBits) - for (i=0;i= max_nbits) { - pp+=startBit/max_nbits; - startBit %= max_nbits; + else { +#pragma omp parallel for schedule(static) firstprivate(inited, pp) private(startBit, countOfLeftmostBits, remainingBits, leftmostBits) + for (i = 0; i < size; i++) { + if (!inited) { + startBit = *bitp + i * nbits; + remainingBits = nbits; + if (startBit >= max_nbits) { + pp += startBit / max_nbits; + startBit %= max_nbits; + } + inited = 1; + } + + countOfLeftmostBits = startBit + remainingBits; + if (countOfLeftmostBits > max_nbits) { + countOfLeftmostBits = max_nbits - startBit; + remainingBits -= countOfLeftmostBits; + leftmostBits = (VALUE(*(pp++), startBit, countOfLeftmostBits)) << remainingBits; + startBit = 0; + } + else + leftmostBits = 0; + + val[i] = leftmostBits + (VALUE(*pp, startBit, remainingBits)); + startBit += remainingBits; + remainingBits = nbits; } - inited=1; - } - - countOfLeftmostBits = startBit + remainingBits; - if (countOfLeftmostBits > max_nbits) { - countOfLeftmostBits = max_nbits - startBit; - remainingBits -= countOfLeftmostBits; - leftmostBits=(VALUE(*(pp++),startBit,countOfLeftmostBits)) << remainingBits; - startBit = 0; - } else - leftmostBits = 0; - - val[i]=leftmostBits+(VALUE(*pp,startBit,remainingBits)); - startBit+=remainingBits; - remainingBits=nbits; } - } - - *bitp+=size*nbits; + *bitp += size * nbits; - return GRIB_SUCCESS; + return GRIB_SUCCESS; } -int grib_decode_double_array(const unsigned char* p, long *bitp, long nbits,double reference_value,double s,double d,size_t size,double* val) { - long i=0; - long countOfLeftmostBits=0,leftmostBits=0; - long startBit,startByte; - long remainingBits = nbits; - long *pp=(long*)p; - int inited=0; - unsigned long uval=0; - double fact=s*d; - double bias=reference_value*d; - - if ( (max_nbits%nbits == 0) && (*bitp%nbits == 0) ) { - -#pragma omp parallel for schedule(static) firstprivate(inited,pp) private(startBit,countOfLeftmostBits,remainingBits,leftmostBits) - for (i=0;i= max_nbits) { - pp+=startBit/max_nbits; - startBit %= max_nbits; +int grib_decode_double_array(const unsigned char* p, long* bitp, long nbits, double reference_value, double s, double d, size_t size, double* val) +{ + long i = 0; + long countOfLeftmostBits = 0, leftmostBits = 0; + long startBit, startByte; + long remainingBits = nbits; + long* pp = (long*)p; + int inited = 0; + unsigned long uval = 0; + double fact = s * d; + double bias = reference_value * d; + + if ((max_nbits % nbits == 0) && (*bitp % nbits == 0)) { +#pragma omp parallel for schedule(static) firstprivate(inited, pp) private(startBit, countOfLeftmostBits, remainingBits, leftmostBits) + for (i = 0; i < size; i++) { + if (!inited) { + startBit = *bitp + i * nbits; + remainingBits = nbits; + if (startBit >= max_nbits) { + pp += startBit / max_nbits; + startBit %= max_nbits; + } + inited = 1; + } + + if (startBit == max_nbits) { + startBit = 0; + pp++; + } + + val[i] = VALUE(*pp, startBit, remainingBits); + val[i] = val[i] * fact + bias; + startBit += remainingBits; + remainingBits = nbits; } - inited=1; - } - - if (startBit == max_nbits) { - startBit = 0; - pp++; - } - - val[i]=VALUE(*pp,startBit,remainingBits); - val[i]= val[i] * fact + bias ; - startBit+=remainingBits; - remainingBits=nbits; } - - } else { - -#pragma omp parallel for schedule(static) firstprivate(inited,pp) private(startBit,countOfLeftmostBits,remainingBits,leftmostBits) - for (i=0;i= max_nbits) { - pp+=startBit/max_nbits; - startBit %= max_nbits; + else { +#pragma omp parallel for schedule(static) firstprivate(inited, pp) private(startBit, countOfLeftmostBits, remainingBits, leftmostBits) + for (i = 0; i < size; i++) { + if (!inited) { + startBit = *bitp + i * nbits; + remainingBits = nbits; + if (startBit >= max_nbits) { + pp += startBit / max_nbits; + startBit %= max_nbits; + } + inited = 1; + } + + countOfLeftmostBits = startBit + remainingBits; + if (countOfLeftmostBits > max_nbits) { + countOfLeftmostBits = max_nbits - startBit; + remainingBits -= countOfLeftmostBits; + leftmostBits = (VALUE(*(pp++), startBit, countOfLeftmostBits)) << remainingBits; + startBit = 0; + } + else + leftmostBits = 0; + + val[i] = leftmostBits + (VALUE(*pp, startBit, remainingBits)); + val[i] = val[i] * fact + bias; + startBit += remainingBits; + remainingBits = nbits; } - inited=1; - } - - countOfLeftmostBits = startBit + remainingBits; - if (countOfLeftmostBits > max_nbits) { - countOfLeftmostBits = max_nbits - startBit; - remainingBits -= countOfLeftmostBits; - leftmostBits=(VALUE(*(pp++),startBit,countOfLeftmostBits)) << remainingBits; - startBit = 0; - } else - leftmostBits = 0; - - val[i]=leftmostBits+(VALUE(*pp,startBit,remainingBits)); - val[i]= val[i] * fact + bias ; - startBit+=remainingBits; - remainingBits=nbits; } - } + *bitp += size * nbits; - *bitp+=size*nbits; - - return GRIB_SUCCESS; + return GRIB_SUCCESS; } -int grib_decode_double_array_complex(const unsigned char* p, long *bitp, long nbits,double reference_value,double s,double* d,size_t size,double* val) { - long i=0; - long countOfLeftmostBits=0,leftmostBits=0; - long startBit; - long remainingBits = nbits; - long *pp=(long*)p; - int inited=0; - unsigned long uval=0; - - if ( (max_nbits%nbits == 0) && (*bitp%nbits == 0) ) { - -#pragma omp parallel for schedule(static) firstprivate(inited,pp) private(startBit,countOfLeftmostBits,remainingBits,leftmostBits) - for (i=0;i= max_nbits) { - pp+=startBit/max_nbits; - startBit %= max_nbits; +int grib_decode_double_array_complex(const unsigned char* p, long* bitp, long nbits, double reference_value, double s, double* d, size_t size, double* val) +{ + long i = 0; + long countOfLeftmostBits = 0, leftmostBits = 0; + long startBit; + long remainingBits = nbits; + long* pp = (long*)p; + int inited = 0; + unsigned long uval = 0; + + if ((max_nbits % nbits == 0) && (*bitp % nbits == 0)) { +#pragma omp parallel for schedule(static) firstprivate(inited, pp) private(startBit, countOfLeftmostBits, remainingBits, leftmostBits) + for (i = 0; i < size; i++) { + if (!inited) { + startBit = *bitp + i * nbits; + remainingBits = nbits; + if (startBit >= max_nbits) { + pp += startBit / max_nbits; + startBit %= max_nbits; + } + inited = 1; + } + + if (startBit == max_nbits) { + startBit = 0; + pp++; + } + + val[i] = VALUE(*pp, startBit, remainingBits); + val[i] = ((((val[i]) * s) + reference_value) * d[i / 2]); + startBit += remainingBits; + remainingBits = nbits; } - inited=1; - } - - if (startBit == max_nbits) { - startBit = 0; - pp++; - } - - val[i]=VALUE(*pp,startBit,remainingBits); - val[i]= ((( (val[i]) * s)+reference_value)*d[i/2]); - startBit+=remainingBits; - remainingBits=nbits; } - - } else { - -#pragma omp parallel for schedule(static) firstprivate(inited,pp) private(startBit,countOfLeftmostBits,remainingBits,leftmostBits) - for (i=0;i= max_nbits) { - pp+=startBit/max_nbits; - startBit %= max_nbits; + else { +#pragma omp parallel for schedule(static) firstprivate(inited, pp) private(startBit, countOfLeftmostBits, remainingBits, leftmostBits) + for (i = 0; i < size; i++) { + if (!inited) { + startBit = *bitp + i * nbits; + remainingBits = nbits; + if (startBit >= max_nbits) { + pp += startBit / max_nbits; + startBit %= max_nbits; + } + inited = 1; + } + + countOfLeftmostBits = startBit + remainingBits; + if (countOfLeftmostBits > max_nbits) { + countOfLeftmostBits = max_nbits - startBit; + remainingBits -= countOfLeftmostBits; + leftmostBits = (VALUE(*pp, startBit, countOfLeftmostBits)) << remainingBits; + startBit = 0; + pp++; + } + else + leftmostBits = 0; + + val[i] = leftmostBits + (VALUE(*pp, startBit, remainingBits)); + val[i] = ((((val[i]) * s) + reference_value) * d[i / 2]); + startBit += remainingBits; + remainingBits = nbits; } - inited=1; - } - - countOfLeftmostBits = startBit + remainingBits; - if (countOfLeftmostBits > max_nbits) { - countOfLeftmostBits = max_nbits - startBit; - remainingBits -= countOfLeftmostBits; - leftmostBits=(VALUE(*pp,startBit,countOfLeftmostBits)) << remainingBits; - startBit = 0; - pp++; - } else - leftmostBits = 0; - - val[i]=leftmostBits+(VALUE(*pp,startBit,remainingBits)); - val[i]= ((( (val[i]) * s)+reference_value)*d[i/2]); - startBit+=remainingBits; - remainingBits=nbits; } - } - *bitp+=size*nbits; + *bitp += size * nbits; - return GRIB_SUCCESS; + return GRIB_SUCCESS; } -int grib_encode_double_array(size_t n_vals,const double* val,long nbits,double reference_value,double d,double divisor,unsigned char* p,long *bitp) +int grib_encode_double_array(size_t n_vals, const double* val, long nbits, double reference_value, double d, double divisor, unsigned char* p, long* bitp) { - long* destination = (long*)p; - double* v=(double*)val; - long countOfLeftmostBits=0,startBit=0,remainingBits=0,rightmostBits=0; - unsigned long uval=0; - size_t i=0; - - startBit=*bitp; - remainingBits = nbits; - - if (startBit >= max_nbits) { - destination += startBit / max_nbits; - startBit %= max_nbits; - } - - if ( (max_nbits%nbits == 0) && (*bitp%nbits == 0) ) { - - for(i=0;i< n_vals;i++){ - uval = (unsigned long)(((((*v)*d)-reference_value)*divisor)+0.5); - if (startBit == max_nbits) { - startBit = 0; - destination++; - } - - rightmostBits = VALUE(uval,max_nbits-remainingBits,remainingBits); - *destination = ((*destination) & ~MASKVALUE(startBit,remainingBits)) - + (rightmostBits << max_nbits-(remainingBits+startBit)); - startBit+=remainingBits; - remainingBits=nbits; - v++; + long* destination = (long*)p; + double* v = (double*)val; + long countOfLeftmostBits = 0, startBit = 0, remainingBits = 0, rightmostBits = 0; + unsigned long uval = 0; + size_t i = 0; + + startBit = *bitp; + remainingBits = nbits; + + if (startBit >= max_nbits) { + destination += startBit / max_nbits; + startBit %= max_nbits; } - } else { - - for(i=0;i< n_vals;i++){ - countOfLeftmostBits = startBit + remainingBits; - uval = (unsigned long)(((((*v)*d)-reference_value)*divisor)+0.5); - if (countOfLeftmostBits > max_nbits) { - countOfLeftmostBits = max_nbits - startBit; - startBit = max_nbits - remainingBits; - remainingBits -= countOfLeftmostBits; - *destination = (((*destination) >> countOfLeftmostBits) << countOfLeftmostBits) - + (VALUE(uval,startBit,countOfLeftmostBits)); - startBit = 0; - destination++; - } - - rightmostBits = VALUE(uval,max_nbits-remainingBits,remainingBits); - *destination = ((*destination) & ~MASKVALUE(startBit,remainingBits)) - + (rightmostBits << max_nbits-(remainingBits+startBit)); - startBit+=remainingBits; - remainingBits=nbits; - v++; + if ((max_nbits % nbits == 0) && (*bitp % nbits == 0)) { + for (i = 0; i < n_vals; i++) { + uval = (unsigned long)(((((*v) * d) - reference_value) * divisor) + 0.5); + if (startBit == max_nbits) { + startBit = 0; + destination++; + } + + rightmostBits = VALUE(uval, max_nbits - remainingBits, remainingBits); + *destination = ((*destination) & ~MASKVALUE(startBit, remainingBits)) + (rightmostBits << max_nbits - (remainingBits + startBit)); + startBit += remainingBits; + remainingBits = nbits; + v++; + } + } + else { + for (i = 0; i < n_vals; i++) { + countOfLeftmostBits = startBit + remainingBits; + uval = (unsigned long)(((((*v) * d) - reference_value) * divisor) + 0.5); + if (countOfLeftmostBits > max_nbits) { + countOfLeftmostBits = max_nbits - startBit; + startBit = max_nbits - remainingBits; + remainingBits -= countOfLeftmostBits; + *destination = (((*destination) >> countOfLeftmostBits) << countOfLeftmostBits) + (VALUE(uval, startBit, countOfLeftmostBits)); + startBit = 0; + destination++; + } + + rightmostBits = VALUE(uval, max_nbits - remainingBits, remainingBits); + *destination = ((*destination) & ~MASKVALUE(startBit, remainingBits)) + (rightmostBits << max_nbits - (remainingBits + startBit)); + startBit += remainingBits; + remainingBits = nbits; + v++; + } } - } - - *bitp+=n_vals*nbits; + *bitp += n_vals * nbits; - return GRIB_SUCCESS; + return GRIB_SUCCESS; } -int grib_encode_double_array_complex(size_t n_vals,double* val,long nbits,double reference_value, - double* scal,double d,double divisor,unsigned char* p,long *bitp) { - long* destination = (long*)p; - double* v=val; - long countOfLeftmostBits=0,startBit=0,remainingBits=0,rightmostBits=0; - unsigned long uval=0; - size_t i=0; - - startBit=*bitp; - remainingBits = nbits; - - if (startBit >= max_nbits) { - destination += startBit / max_nbits; - startBit %= max_nbits; - } - - if ( (max_nbits%nbits == 0) && (*bitp%nbits == 0) ) { - - for(i=0;i< n_vals;i++) { - uval = (unsigned long)(((((*v)*d*scal[i/2])-reference_value)*divisor)+0.5); - if (startBit == max_nbits) { - startBit = 0; - destination++; - } - - rightmostBits = VALUE(uval,max_nbits-remainingBits,remainingBits); - *destination = ((*destination) & ~MASKVALUE(startBit,remainingBits)) - + (rightmostBits << max_nbits-(remainingBits+startBit)); - startBit+=remainingBits; - remainingBits=nbits; - - v++; +int grib_encode_double_array_complex(size_t n_vals, double* val, long nbits, double reference_value, + double* scal, double d, double divisor, unsigned char* p, long* bitp) +{ + long* destination = (long*)p; + double* v = val; + long countOfLeftmostBits = 0, startBit = 0, remainingBits = 0, rightmostBits = 0; + unsigned long uval = 0; + size_t i = 0; + + startBit = *bitp; + remainingBits = nbits; + + if (startBit >= max_nbits) { + destination += startBit / max_nbits; + startBit %= max_nbits; } - } else { - - for(i=0;i< n_vals;i++) { - countOfLeftmostBits = startBit + remainingBits; - uval = (unsigned long)(((((*v)*d*scal[i/2])-reference_value)*divisor)+0.5); - if (countOfLeftmostBits > max_nbits) { - countOfLeftmostBits = max_nbits - startBit; - startBit = max_nbits - remainingBits; - remainingBits -= countOfLeftmostBits; - *destination = (((*destination) >> countOfLeftmostBits) << countOfLeftmostBits) - + (VALUE(uval,startBit,countOfLeftmostBits)); - startBit = 0; - destination++; - } - - rightmostBits = VALUE(uval,max_nbits-remainingBits,remainingBits); - *destination = ((*destination) & ~MASKVALUE(startBit,remainingBits)) - + (rightmostBits << max_nbits-(remainingBits+startBit)); - startBit+=remainingBits; - remainingBits=nbits; - - v++; - } + if ((max_nbits % nbits == 0) && (*bitp % nbits == 0)) { + for (i = 0; i < n_vals; i++) { + uval = (unsigned long)(((((*v) * d * scal[i / 2]) - reference_value) * divisor) + 0.5); + if (startBit == max_nbits) { + startBit = 0; + destination++; + } - } + rightmostBits = VALUE(uval, max_nbits - remainingBits, remainingBits); + *destination = ((*destination) & ~MASKVALUE(startBit, remainingBits)) + (rightmostBits << max_nbits - (remainingBits + startBit)); + startBit += remainingBits; + remainingBits = nbits; - *bitp+=n_vals*nbits; + v++; + } + } + else { + for (i = 0; i < n_vals; i++) { + countOfLeftmostBits = startBit + remainingBits; + uval = (unsigned long)(((((*v) * d * scal[i / 2]) - reference_value) * divisor) + 0.5); + if (countOfLeftmostBits > max_nbits) { + countOfLeftmostBits = max_nbits - startBit; + startBit = max_nbits - remainingBits; + remainingBits -= countOfLeftmostBits; + *destination = (((*destination) >> countOfLeftmostBits) << countOfLeftmostBits) + (VALUE(uval, startBit, countOfLeftmostBits)); + startBit = 0; + destination++; + } + + rightmostBits = VALUE(uval, max_nbits - remainingBits, remainingBits); + *destination = ((*destination) & ~MASKVALUE(startBit, remainingBits)) + (rightmostBits << max_nbits - (remainingBits + startBit)); + startBit += remainingBits; + remainingBits = nbits; + + v++; + } + } - return 0; -} + *bitp += n_vals * nbits; + return 0; +} diff --git a/src/grib_bits_fast_big_endian_simple.c b/src/grib_bits_fast_big_endian_simple.c index 46358c22b..fbea5a94f 100644 --- a/src/grib_bits_fast_big_endian_simple.c +++ b/src/grib_bits_fast_big_endian_simple.c @@ -13,294 +13,283 @@ * * ***************************************************************************/ -int grib_decode_long_array(const unsigned char* p, long *bitp, long nbits,size_t size,long* val) { - long i=0; - long countOfLeftmostBits=0,leftmostBits=0; - long startBit,startByte; - long remainingBits = nbits; - long *pp=(long*)p; - int inited=0; - unsigned long uval=0; - - startBit=*bitp; - remainingBits = nbits; - if (startBit >= max_nbits) { - pp+=startBit/max_nbits; - startBit %= max_nbits; - } - - if ( (max_nbits%nbits == 0) && (*bitp%nbits == 0) ) { - - for (i=0;i= max_nbits) { + pp += startBit / max_nbits; + startBit %= max_nbits; } - } else { - for (i=0;i max_nbits) { - countOfLeftmostBits = max_nbits - startBit; - remainingBits -= countOfLeftmostBits; - leftmostBits=(VALUE(*(pp++),startBit,countOfLeftmostBits)) << remainingBits; - startBit = 0; - } else - leftmostBits = 0; - - val[i]=leftmostBits+(VALUE(*pp,startBit,remainingBits)); - startBit+=remainingBits; - remainingBits=nbits; + if ((max_nbits % nbits == 0) && (*bitp % nbits == 0)) { + for (i = 0; i < size; i++) { + if (startBit == max_nbits) { + startBit = 0; + pp++; + } + + val[i] = VALUE(*pp, startBit, remainingBits); + startBit += remainingBits; + remainingBits = nbits; + } + } + else { + for (i = 0; i < size; i++) { + countOfLeftmostBits = startBit + remainingBits; + if (countOfLeftmostBits > max_nbits) { + countOfLeftmostBits = max_nbits - startBit; + remainingBits -= countOfLeftmostBits; + leftmostBits = (VALUE(*(pp++), startBit, countOfLeftmostBits)) << remainingBits; + startBit = 0; + } + else + leftmostBits = 0; + + val[i] = leftmostBits + (VALUE(*pp, startBit, remainingBits)); + startBit += remainingBits; + remainingBits = nbits; + } } - } - - *bitp+=size*nbits; + *bitp += size * nbits; - return GRIB_SUCCESS; + return GRIB_SUCCESS; } -int grib_decode_double_array(const unsigned char* p, long *bitp, long nbits,double reference_value,double s,double d,size_t size,double* val) { - long i=0; - long countOfLeftmostBits=0,leftmostBits=0; - long startBit,startByte; - long remainingBits = nbits; - long *pp=(long*)p; - int inited=0; - unsigned long uval=0; - double fact=s*d; - double bias=reference_value*d; - - startBit=*bitp; - remainingBits = nbits; - if (startBit >= max_nbits) { - pp+=startBit/max_nbits; - startBit %= max_nbits; - } - - if ( (max_nbits%nbits == 0) && (*bitp%nbits == 0) ) { - - for (i=0;i= max_nbits) { + pp += startBit / max_nbits; + startBit %= max_nbits; } - } else { - for (i=0;i max_nbits) { - countOfLeftmostBits = max_nbits - startBit; - remainingBits -= countOfLeftmostBits; - leftmostBits=(VALUE(*(pp++),startBit,countOfLeftmostBits)) << remainingBits; - startBit = 0; - } else - leftmostBits = 0; - - val[i]=leftmostBits+(VALUE(*pp,startBit,remainingBits)); - val[i]= val[i] * fact + bias ; - startBit+=remainingBits; - remainingBits=nbits; + if ((max_nbits % nbits == 0) && (*bitp % nbits == 0)) { + for (i = 0; i < size; i++) { + if (startBit == max_nbits) { + startBit = 0; + pp++; + } + + val[i] = VALUE(*pp, startBit, remainingBits); + val[i] = val[i] * fact + bias; + startBit += remainingBits; + remainingBits = nbits; + } + } + else { + for (i = 0; i < size; i++) { + countOfLeftmostBits = startBit + remainingBits; + if (countOfLeftmostBits > max_nbits) { + countOfLeftmostBits = max_nbits - startBit; + remainingBits -= countOfLeftmostBits; + leftmostBits = (VALUE(*(pp++), startBit, countOfLeftmostBits)) << remainingBits; + startBit = 0; + } + else + leftmostBits = 0; + + val[i] = leftmostBits + (VALUE(*pp, startBit, remainingBits)); + val[i] = val[i] * fact + bias; + startBit += remainingBits; + remainingBits = nbits; + } } - } - - *bitp+=size*nbits; + *bitp += size * nbits; - return GRIB_SUCCESS; + return GRIB_SUCCESS; } -int grib_decode_double_array_complex(const unsigned char* p, long *bitp, long nbits,double reference_value,double s,double* d,size_t size,double* val) { - long i=0; - long countOfLeftmostBits=0,leftmostBits=0; - long startBit; - long remainingBits = nbits; - long *pp=(long*)p; - int inited=0; - unsigned long uval=0; - - startBit=*bitp; - remainingBits = nbits; - if (startBit >= max_nbits) { - pp+=startBit/max_nbits; - startBit %= max_nbits; - } - - if ( (max_nbits%nbits == 0) && (*bitp%nbits == 0) ) { - for (i=0;i= max_nbits) { + pp += startBit / max_nbits; + startBit %= max_nbits; } - } else { - - for (i=0;i max_nbits) { - countOfLeftmostBits = max_nbits - startBit; - remainingBits -= countOfLeftmostBits; - leftmostBits=(VALUE(*pp,startBit,countOfLeftmostBits)) << remainingBits; - startBit = 0; - pp++; - } else - leftmostBits = 0; - - val[i]=leftmostBits+(VALUE(*pp,startBit,remainingBits)); - val[i]= ((( (val[i]) * s)+reference_value)*d[i/2]); - startBit+=remainingBits; - remainingBits=nbits; + if ((max_nbits % nbits == 0) && (*bitp % nbits == 0)) { + for (i = 0; i < size; i++) { + if (startBit == max_nbits) { + startBit = 0; + pp++; + } + + val[i] = VALUE(*pp, startBit, remainingBits); + val[i] = ((((val[i]) * s) + reference_value) * d[i / 2]); + startBit += remainingBits; + remainingBits = nbits; + } + } + else { + for (i = 0; i < size; i++) { + countOfLeftmostBits = startBit + remainingBits; + if (countOfLeftmostBits > max_nbits) { + countOfLeftmostBits = max_nbits - startBit; + remainingBits -= countOfLeftmostBits; + leftmostBits = (VALUE(*pp, startBit, countOfLeftmostBits)) << remainingBits; + startBit = 0; + pp++; + } + else + leftmostBits = 0; + + val[i] = leftmostBits + (VALUE(*pp, startBit, remainingBits)); + val[i] = ((((val[i]) * s) + reference_value) * d[i / 2]); + startBit += remainingBits; + remainingBits = nbits; + } } - } - *bitp+=size*nbits; + *bitp += size * nbits; - return GRIB_SUCCESS; + return GRIB_SUCCESS; } -int grib_encode_double_array(size_t n_vals,const double* val,long nbits,double reference_value,double d,double divisor,unsigned char* p,long *bitp) +int grib_encode_double_array(size_t n_vals, const double* val, long nbits, double reference_value, double d, double divisor, unsigned char* p, long* bitp) { - long* destination = (long*)p; - double* v=(double*)val; - long countOfLeftmostBits=0,startBit=0,remainingBits=0,rightmostBits=0; - unsigned long uval=0; - size_t i=0; - - startBit=*bitp; - remainingBits = nbits; - - if (startBit >= max_nbits) { - destination += startBit / max_nbits; - startBit %= max_nbits; - } - - if ( (max_nbits%nbits == 0) && (*bitp%nbits == 0) ) { - - for(i=0;i< n_vals;i++){ - uval = (unsigned long)(((((*v)*d)-reference_value)*divisor)+0.5); - if (startBit == max_nbits) { - startBit = 0; - destination++; - } - - rightmostBits = VALUE(uval,max_nbits-remainingBits,remainingBits); - *destination = ((*destination) & ~MASKVALUE(startBit,remainingBits)) - + (rightmostBits << max_nbits-(remainingBits+startBit)); - startBit+=remainingBits; - remainingBits=nbits; - v++; + long* destination = (long*)p; + double* v = (double*)val; + long countOfLeftmostBits = 0, startBit = 0, remainingBits = 0, rightmostBits = 0; + unsigned long uval = 0; + size_t i = 0; + + startBit = *bitp; + remainingBits = nbits; + + if (startBit >= max_nbits) { + destination += startBit / max_nbits; + startBit %= max_nbits; } - } else { - - for(i=0;i< n_vals;i++){ - countOfLeftmostBits = startBit + remainingBits; - uval = (unsigned long)(((((*v)*d)-reference_value)*divisor)+0.5); - if (countOfLeftmostBits > max_nbits) { - countOfLeftmostBits = max_nbits - startBit; - startBit = max_nbits - remainingBits; - remainingBits -= countOfLeftmostBits; - *destination = (((*destination) >> countOfLeftmostBits) << countOfLeftmostBits) - + (VALUE(uval,startBit,countOfLeftmostBits)); - startBit = 0; - destination++; - } - - rightmostBits = VALUE(uval,max_nbits-remainingBits,remainingBits); - *destination = ((*destination) & ~MASKVALUE(startBit,remainingBits)) - + (rightmostBits << max_nbits-(remainingBits+startBit)); - startBit+=remainingBits; - remainingBits=nbits; - v++; + if ((max_nbits % nbits == 0) && (*bitp % nbits == 0)) { + for (i = 0; i < n_vals; i++) { + uval = (unsigned long)(((((*v) * d) - reference_value) * divisor) + 0.5); + if (startBit == max_nbits) { + startBit = 0; + destination++; + } + + rightmostBits = VALUE(uval, max_nbits - remainingBits, remainingBits); + *destination = ((*destination) & ~MASKVALUE(startBit, remainingBits)) + (rightmostBits << max_nbits - (remainingBits + startBit)); + startBit += remainingBits; + remainingBits = nbits; + v++; + } + } + else { + for (i = 0; i < n_vals; i++) { + countOfLeftmostBits = startBit + remainingBits; + uval = (unsigned long)(((((*v) * d) - reference_value) * divisor) + 0.5); + if (countOfLeftmostBits > max_nbits) { + countOfLeftmostBits = max_nbits - startBit; + startBit = max_nbits - remainingBits; + remainingBits -= countOfLeftmostBits; + *destination = (((*destination) >> countOfLeftmostBits) << countOfLeftmostBits) + (VALUE(uval, startBit, countOfLeftmostBits)); + startBit = 0; + destination++; + } + + rightmostBits = VALUE(uval, max_nbits - remainingBits, remainingBits); + *destination = ((*destination) & ~MASKVALUE(startBit, remainingBits)) + (rightmostBits << max_nbits - (remainingBits + startBit)); + startBit += remainingBits; + remainingBits = nbits; + v++; + } } - } - - *bitp+=n_vals*nbits; + *bitp += n_vals * nbits; - return GRIB_SUCCESS; + return GRIB_SUCCESS; } -int grib_encode_double_array_complex(size_t n_vals,double* val,long nbits,double reference_value, - double* scal,double d,double divisor,unsigned char* p,long *bitp) { - long* destination = (long*)p; - double* v=val; - long countOfLeftmostBits=0,startBit=0,remainingBits=0,rightmostBits=0; - unsigned long uval=0; - size_t i=0; - - startBit=*bitp; - remainingBits = nbits; - - if (startBit >= max_nbits) { - destination += startBit / max_nbits; - startBit %= max_nbits; - } - - if ( (max_nbits%nbits == 0) && (*bitp%nbits == 0) ) { - - for(i=0;i< n_vals;i++) { - uval = (unsigned long)(((((*v)*d*scal[i/2])-reference_value)*divisor)+0.5); - if (startBit == max_nbits) { - startBit = 0; - destination++; - } - - rightmostBits = VALUE(uval,max_nbits-remainingBits,remainingBits); - *destination = ((*destination) & ~MASKVALUE(startBit,remainingBits)) - + (rightmostBits << max_nbits-(remainingBits+startBit)); - startBit+=remainingBits; - remainingBits=nbits; - - v++; +int grib_encode_double_array_complex(size_t n_vals, double* val, long nbits, double reference_value, + double* scal, double d, double divisor, unsigned char* p, long* bitp) +{ + long* destination = (long*)p; + double* v = val; + long countOfLeftmostBits = 0, startBit = 0, remainingBits = 0, rightmostBits = 0; + unsigned long uval = 0; + size_t i = 0; + + startBit = *bitp; + remainingBits = nbits; + + if (startBit >= max_nbits) { + destination += startBit / max_nbits; + startBit %= max_nbits; } - } else { - - for(i=0;i< n_vals;i++) { - countOfLeftmostBits = startBit + remainingBits; - uval = (unsigned long)(((((*v)*d*scal[i/2])-reference_value)*divisor)+0.5); - if (countOfLeftmostBits > max_nbits) { - countOfLeftmostBits = max_nbits - startBit; - startBit = max_nbits - remainingBits; - remainingBits -= countOfLeftmostBits; - *destination = (((*destination) >> countOfLeftmostBits) << countOfLeftmostBits) - + (VALUE(uval,startBit,countOfLeftmostBits)); - startBit = 0; - destination++; - } - - rightmostBits = VALUE(uval,max_nbits-remainingBits,remainingBits); - *destination = ((*destination) & ~MASKVALUE(startBit,remainingBits)) - + (rightmostBits << max_nbits-(remainingBits+startBit)); - startBit+=remainingBits; - remainingBits=nbits; - - v++; + if ((max_nbits % nbits == 0) && (*bitp % nbits == 0)) { + for (i = 0; i < n_vals; i++) { + uval = (unsigned long)(((((*v) * d * scal[i / 2]) - reference_value) * divisor) + 0.5); + if (startBit == max_nbits) { + startBit = 0; + destination++; + } + + rightmostBits = VALUE(uval, max_nbits - remainingBits, remainingBits); + *destination = ((*destination) & ~MASKVALUE(startBit, remainingBits)) + (rightmostBits << max_nbits - (remainingBits + startBit)); + startBit += remainingBits; + remainingBits = nbits; + + v++; + } + } + else { + for (i = 0; i < n_vals; i++) { + countOfLeftmostBits = startBit + remainingBits; + uval = (unsigned long)(((((*v) * d * scal[i / 2]) - reference_value) * divisor) + 0.5); + if (countOfLeftmostBits > max_nbits) { + countOfLeftmostBits = max_nbits - startBit; + startBit = max_nbits - remainingBits; + remainingBits -= countOfLeftmostBits; + *destination = (((*destination) >> countOfLeftmostBits) << countOfLeftmostBits) + (VALUE(uval, startBit, countOfLeftmostBits)); + startBit = 0; + destination++; + } + + rightmostBits = VALUE(uval, max_nbits - remainingBits, remainingBits); + *destination = ((*destination) & ~MASKVALUE(startBit, remainingBits)) + (rightmostBits << max_nbits - (remainingBits + startBit)); + startBit += remainingBits; + remainingBits = nbits; + + v++; + } } - } - - *bitp+=n_vals*nbits; + *bitp += n_vals * nbits; - return 0; + return 0; } - diff --git a/src/grib_bits_fast_big_endian_vector.c b/src/grib_bits_fast_big_endian_vector.c index 4d2d08226..78453d7fe 100644 --- a/src/grib_bits_fast_big_endian_vector.c +++ b/src/grib_bits_fast_big_endian_vector.c @@ -13,31 +13,32 @@ * * ***************************************************************************/ -int grib_decode_long_array(const unsigned char* p, long *bitp, long nbits,size_t size,long* val) { - long countOfLeftmostBits=0,leftmostBits=0; - long startBit[size],startByte,off; - long remainingBits = nbits; - long bitpv=*bitp; - int inited=0; - unsigned long uval=0; - long i=0,n; - unsigned long *pp=(unsigned long*)p; - unsigned long *x; - size_t sizel =(size*nbits)/max_nbits; - long vaux[size],vaux2[size],vaux3[size]; - long imax,j; - -/* (void) ftrace_region_begin("gdda-1"); */ - if (size*nbits%max_nbits) sizel++; - - x=malloc(sizel*sizeof(unsigned long)); - Assert(x); - memcpy(x,p+bitpv/8,sizel*sizeof(*x)); -/* (void) ftrace_region_end ("gdda-1"); */ - - if ( (max_nbits%nbits == 0) && (bitpv%nbits == 0) ) { - -/* long GRIB_MASK = -1; Mask of sword bits +int grib_decode_long_array(const unsigned char* p, long* bitp, long nbits, size_t size, long* val) +{ + long countOfLeftmostBits = 0, leftmostBits = 0; + long startBit[size], startByte, off; + long remainingBits = nbits; + long bitpv = *bitp; + int inited = 0; + unsigned long uval = 0; + long i = 0, n; + unsigned long* pp = (unsigned long*)p; + unsigned long* x; + size_t sizel = (size * nbits) / max_nbits; + long vaux[size], vaux2[size], vaux3[size]; + long imax, j; + + /* (void) ftrace_region_begin("gdda-1"); */ + if (size * nbits % max_nbits) + sizel++; + + x = malloc(sizel * sizeof(unsigned long)); + Assert(x); + memcpy(x, p + bitpv / 8, sizel * sizeof(*x)); + /* (void) ftrace_region_end ("gdda-1"); */ + + if ((max_nbits % nbits == 0) && (bitpv % nbits == 0)) { + /* long GRIB_MASK = -1; Mask of sword bits p:x[startBit/max_nbits] q:startBit%max_nbits @@ -45,98 +46,98 @@ b:nbits define VALUE(p,q,b) \ (((b)==max_nbits ? GRIB_MASK : ~(GRIB_MASK<<(b))) & ((p)>>(max_nbits-((q)+(b))))) */ -/* (void) ftrace_region_begin("gdda-2"); */ - for (i=0;iimax) - imax=vaux3[i]; - } - for (j=1;j<=imax;j++) { - for (i=0;i>1; -/* vaux2[i]=vaux5[i]>>vaux3[i]; + if (nbits == max_nbits) + vaux[i] = GRIB_MASK; + else + vaux[i] = ~(GRIB_MASK << nbits); + startBit[i] = i * nbits; + vaux3[i] = max_nbits - (startBit[i] % max_nbits + nbits); + vaux2[i] = x[startBit[i] / max_nbits]; + } + imax = 0; + for (i = 0; i < size; i++) { + if (vaux3[i] > imax) + imax = vaux3[i]; + } + for (j = 1; j <= imax; j++) { + for (i = 0; i < size; i++) { + if (j <= vaux3[i]) + vaux2[i] = vaux2[i] >> 1; + /* vaux2[i]=vaux5[i]>>vaux3[i]; vaux2[i]=x[startBit[i]/max_nbits]>>(max_nbits-(startBit[i]%max_nbits+nbits)); */ - } + } + } + for (i = 0; i < size; i++) { + val[i] = vaux[i] & vaux2[i]; + } + /* (void) ftrace_region_end ("gdda-2"); */ } - for (i=0;i max_nbits) { + countOfLeftmostBits = max_nbits - startBit[i]; + remainingBits -= countOfLeftmostBits; + leftmostBits = (VALUE(x[off], startBit[i], countOfLeftmostBits)) << remainingBits; + off++; + startBit[i] = 0; + } + else + leftmostBits = 0; + + val[i] = (leftmostBits + (VALUE(x[off], startBit[i], remainingBits))); + } + /* (void) ftrace_region_end ("gdda-3"); */ } -/* (void) ftrace_region_end ("gdda-2"); */ - - } else { - -/* (void) ftrace_region_begin("gdda-3"); */ - for (i=0;i max_nbits) { - countOfLeftmostBits = max_nbits - startBit[i]; - remainingBits -= countOfLeftmostBits; - leftmostBits=(VALUE(x[off],startBit[i],countOfLeftmostBits)) << remainingBits; - off++; - startBit[i] = 0; - } else - leftmostBits = 0; - - val[i]=(leftmostBits+(VALUE(x[off],startBit[i],remainingBits)) ); - } -/* (void) ftrace_region_end ("gdda-3"); */ - } -/* (void) ftrace_region_begin("gdda-4"); */ - free(x); + /* (void) ftrace_region_begin("gdda-4"); */ + free(x); - *bitp+=size*nbits; -/* (void) ftrace_region_end ("gdda-4"); */ + *bitp += size * nbits; + /* (void) ftrace_region_end ("gdda-4"); */ - return GRIB_SUCCESS; + return GRIB_SUCCESS; } -int grib_decode_double_array(const unsigned char* p, long *bitp, long nbits,double reference_value,double s,double d,size_t size,double* val) { - long countOfLeftmostBits=0,leftmostBits=0; - long startBit[size],startByte,off; - long remainingBits = nbits; - long bitpv=*bitp; - int inited=0; - unsigned long uval=0; - double fact=s*d; - double bias=reference_value*d; - long i=0,n; - unsigned long *pp=(unsigned long*)p; - unsigned long *x; - size_t sizel =(size*nbits)/max_nbits; - long vaux[size],vaux2[size],vaux3[size]; - long imax,j; - -/* (void) ftrace_region_begin("gdda-1"); */ - if (size*nbits%max_nbits) sizel++; - - x=malloc(sizel*sizeof(unsigned long)); - Assert(x); - memcpy(x,p+bitpv/8,sizel*sizeof(*x)); -/* (void) ftrace_region_end ("gdda-1"); */ - - if ( (max_nbits%nbits == 0) && (bitpv%nbits == 0) ) { - -/* long GRIB_MASK = -1; Mask of sword bits +int grib_decode_double_array(const unsigned char* p, long* bitp, long nbits, double reference_value, double s, double d, size_t size, double* val) +{ + long countOfLeftmostBits = 0, leftmostBits = 0; + long startBit[size], startByte, off; + long remainingBits = nbits; + long bitpv = *bitp; + int inited = 0; + unsigned long uval = 0; + double fact = s * d; + double bias = reference_value * d; + long i = 0, n; + unsigned long* pp = (unsigned long*)p; + unsigned long* x; + size_t sizel = (size * nbits) / max_nbits; + long vaux[size], vaux2[size], vaux3[size]; + long imax, j; + + /* (void) ftrace_region_begin("gdda-1"); */ + if (size * nbits % max_nbits) + sizel++; + + x = malloc(sizel * sizeof(unsigned long)); + Assert(x); + memcpy(x, p + bitpv / 8, sizel * sizeof(*x)); + /* (void) ftrace_region_end ("gdda-1"); */ + + if ((max_nbits % nbits == 0) && (bitpv % nbits == 0)) { + /* long GRIB_MASK = -1; Mask of sword bits p:x[startBit/max_nbits] q:startBit%max_nbits @@ -144,256 +145,246 @@ b:nbits define VALUE(p,q,b) \ (((b)==max_nbits ? GRIB_MASK : ~(GRIB_MASK<<(b))) & ((p)>>(max_nbits-((q)+(b))))) */ -/* (void) ftrace_region_begin("gdda-2"); */ - for (i=0;iimax) - imax=vaux3[i]; - } - for (j=1;j<=imax;j++) { - for (i=0;i>1; -/* vaux2[i]=vaux5[i]>>vaux3[i]; + if (nbits == max_nbits) + vaux[i] = GRIB_MASK; + else + vaux[i] = ~(GRIB_MASK << nbits); + startBit[i] = i * nbits; + vaux3[i] = max_nbits - (startBit[i] % max_nbits + nbits); + vaux2[i] = x[startBit[i] / max_nbits]; + } + imax = 0; + for (i = 0; i < size; i++) { + if (vaux3[i] > imax) + imax = vaux3[i]; + } + for (j = 1; j <= imax; j++) { + for (i = 0; i < size; i++) { + if (j <= vaux3[i]) + vaux2[i] = vaux2[i] >> 1; + /* vaux2[i]=vaux5[i]>>vaux3[i]; vaux2[i]=x[startBit[i]/max_nbits]>>(max_nbits-(startBit[i]%max_nbits+nbits)); */ - } - } - for (i=0;i max_nbits) { - countOfLeftmostBits = max_nbits - startBit[i]; - remainingBits -= countOfLeftmostBits; - leftmostBits=(VALUE(x[off],startBit[i],countOfLeftmostBits)) << remainingBits; - off++; - startBit[i] = 0; - } else - leftmostBits = 0; - - val[i]=(leftmostBits+(VALUE(x[off],startBit[i],remainingBits)) ) * fact + bias; + else { + /* (void) ftrace_region_begin("gdda-3"); */ + for (i = 0; i < size; i++) { + startBit[i] = i * nbits; + + off = startBit[i] / max_nbits; + startBit[i] %= max_nbits; + + remainingBits = nbits; + countOfLeftmostBits = startBit[i] + nbits; + if (countOfLeftmostBits > max_nbits) { + countOfLeftmostBits = max_nbits - startBit[i]; + remainingBits -= countOfLeftmostBits; + leftmostBits = (VALUE(x[off], startBit[i], countOfLeftmostBits)) << remainingBits; + off++; + startBit[i] = 0; + } + else + leftmostBits = 0; + + val[i] = (leftmostBits + (VALUE(x[off], startBit[i], remainingBits))) * fact + bias; + } + /* (void) ftrace_region_end ("gdda-3"); */ } -/* (void) ftrace_region_end ("gdda-3"); */ - } -/* (void) ftrace_region_begin("gdda-4"); */ - free(x); + /* (void) ftrace_region_begin("gdda-4"); */ + free(x); - *bitp+=size*nbits; -/* (void) ftrace_region_end ("gdda-4"); */ + *bitp += size * nbits; + /* (void) ftrace_region_end ("gdda-4"); */ - return GRIB_SUCCESS; + return GRIB_SUCCESS; } -int grib_decode_double_array_complex(const unsigned char* p, long *bitp, long nbits,double reference_value,double s,double* restrict d,size_t size,double* restrict val) { - long i=0; - long countOfLeftmostBits=0,leftmostBits=0; - long startBit,off; - long remainingBits = nbits; - unsigned long *pp=(unsigned long *)p; - unsigned long bitpv=*bitp; - unsigned long uval=0; - unsigned long *x; - size_t sizel =(size*nbits)/max_nbits; - if (size*nbits%max_nbits) sizel++; - - x=malloc(sizel*sizeof(unsigned long)); - Assert(x); - memcpy(x,p+bitpv/8,sizel*sizeof(*x)); - - if ( (max_nbits%nbits == 0) && (bitpv%nbits == 0) ) { - - for (i=0;i max_nbits) { - countOfLeftmostBits = max_nbits - startBit; - remainingBits -= countOfLeftmostBits; - leftmostBits=(VALUE(x[off],startBit,countOfLeftmostBits)) << remainingBits; - off++; - startBit = 0; - } else - leftmostBits = 0; - - val[i]= ((( (leftmostBits+(VALUE(x[off],startBit,remainingBits))) * s)+ - reference_value)*d[i/2]); + else { + for (i = 0; i < size; i++) { + startBit = i * nbits; + + off = startBit / max_nbits; + startBit %= max_nbits; + + remainingBits = nbits; + countOfLeftmostBits = startBit + nbits; + if (countOfLeftmostBits > max_nbits) { + countOfLeftmostBits = max_nbits - startBit; + remainingBits -= countOfLeftmostBits; + leftmostBits = (VALUE(x[off], startBit, countOfLeftmostBits)) << remainingBits; + off++; + startBit = 0; + } + else + leftmostBits = 0; + + val[i] = ((((leftmostBits + (VALUE(x[off], startBit, remainingBits))) * s) + + reference_value) * + d[i / 2]); + } } + free(x); - } - free(x); - - *bitp+=size*nbits; + *bitp += size * nbits; - return GRIB_SUCCESS; + return GRIB_SUCCESS; } -int grib_encode_double_array(size_t size,const double* val,long nbits,double reference_value,double d,double divisor,unsigned char* p,long *bitp) +int grib_encode_double_array(size_t size, const double* val, long nbits, double reference_value, double d, double divisor, unsigned char* p, long* bitp) { - unsigned long* restrict destination; - long countOfLeftmostBits=0,startBit=0,remainingBits=0,rightmostBits=0; - long off; - size_t nbytes; - unsigned long uval=0; - size_t i=0; - size_t sizel =(size*nbits)/max_nbits; - if (size*nbits%max_nbits) sizel++; - - destination=malloc(sizel*sizeof(unsigned long)); - Assert(destination); - - if ( (max_nbits%nbits == 0)) { - - for (i=0;i max_nbits) { - countOfLeftmostBits = max_nbits - startBit; - startBit = max_nbits - remainingBits; - remainingBits -= countOfLeftmostBits; - destination[off] = (((destination[off]) >> countOfLeftmostBits) - << countOfLeftmostBits) - + (VALUE(uval,startBit,countOfLeftmostBits)); - startBit = 0; - off++; - } - - rightmostBits = VALUE(uval,max_nbits-remainingBits,remainingBits); - destination[off] = ((destination[off]) & ~MASKVALUE(startBit,remainingBits)) - + (rightmostBits << max_nbits-(remainingBits+startBit)); + else { + for (i = 0; i < size; i++) { + startBit = i * nbits; + off = startBit / max_nbits; + startBit %= max_nbits; + remainingBits = nbits; + + countOfLeftmostBits = startBit + remainingBits; + uval = (unsigned long)((((val[i] * d) - reference_value) * divisor) + 0.5); + if (countOfLeftmostBits > max_nbits) { + countOfLeftmostBits = max_nbits - startBit; + startBit = max_nbits - remainingBits; + remainingBits -= countOfLeftmostBits; + destination[off] = (((destination[off]) >> countOfLeftmostBits) + << countOfLeftmostBits) + + (VALUE(uval, startBit, countOfLeftmostBits)); + startBit = 0; + off++; + } + + rightmostBits = VALUE(uval, max_nbits - remainingBits, remainingBits); + destination[off] = ((destination[off]) & ~MASKVALUE(startBit, remainingBits)) + (rightmostBits << max_nbits - (remainingBits + startBit)); + } } - } - - nbytes=(size*nbits)/8; - if ((size*nbits)%8) nbytes++; - memcpy(p+*bitp,destination,nbytes); - free(destination); + nbytes = (size * nbits) / 8; + if ((size * nbits) % 8) + nbytes++; + memcpy(p + *bitp, destination, nbytes); + free(destination); - *bitp+=size*nbits; + *bitp += size * nbits; - return GRIB_SUCCESS; + return GRIB_SUCCESS; } -int grib_encode_double_array_complex(size_t size,double* restrict val,long nbits,double reference_value, - double* restrict scal,double d,double divisor,unsigned char* p,long *bitp) { - unsigned long* restrict destination; - double* v=val; - long countOfLeftmostBits=0,startBit=0,remainingBits=0,rightmostBits=0,off=0; - unsigned long uval=0; - size_t i=0; - size_t nbytes; - size_t sizel =(size*nbits)/max_nbits; - if (size*nbits%max_nbits) sizel++; - - destination=malloc(sizel*sizeof(unsigned long)); - Assert(destination); - - if ( (max_nbits%nbits == 0)) { - - for (i=0;i max_nbits) { - countOfLeftmostBits = max_nbits - startBit; - startBit = max_nbits - remainingBits; - remainingBits -= countOfLeftmostBits; - destination[off] = (((destination[off]) >> countOfLeftmostBits) - << countOfLeftmostBits) - + (VALUE(uval,startBit,countOfLeftmostBits)); - startBit = 0; - off++; - } - - rightmostBits = VALUE(uval,max_nbits-remainingBits,remainingBits); - destination[off] = ((destination[off]) & ~MASKVALUE(startBit,remainingBits)) - + (rightmostBits << max_nbits-(remainingBits+startBit)); + else { + for (i = 0; i < size; i++) { + startBit = i * nbits; + off = startBit / max_nbits; + startBit %= max_nbits; + remainingBits = nbits; + + countOfLeftmostBits = startBit + remainingBits; + uval = (unsigned long)((((val[i] * d * scal[i / 2]) - reference_value) * divisor) + 0.5); + if (countOfLeftmostBits > max_nbits) { + countOfLeftmostBits = max_nbits - startBit; + startBit = max_nbits - remainingBits; + remainingBits -= countOfLeftmostBits; + destination[off] = (((destination[off]) >> countOfLeftmostBits) + << countOfLeftmostBits) + + (VALUE(uval, startBit, countOfLeftmostBits)); + startBit = 0; + off++; + } + + rightmostBits = VALUE(uval, max_nbits - remainingBits, remainingBits); + destination[off] = ((destination[off]) & ~MASKVALUE(startBit, remainingBits)) + (rightmostBits << max_nbits - (remainingBits + startBit)); + } } + nbytes = (size * nbits) / 8; + if ((size * nbits) % 8) + nbytes++; + memcpy(p + *bitp, destination, nbytes); + free(destination); - } - nbytes=(size*nbits)/8; - if ((size*nbits)%8) nbytes++; - memcpy(p+*bitp,destination,nbytes); - free(destination); + *bitp += size * nbits; - *bitp+=size*nbits; - - return 0; + return 0; } - diff --git a/src/grib_bits_ibmpow.c b/src/grib_bits_ibmpow.c index 04b773ae5..cc1682cc1 100644 --- a/src/grib_bits_ibmpow.c +++ b/src/grib_bits_ibmpow.c @@ -9,106 +9,102 @@ */ -unsigned long grib_decode_unsigned_long(const unsigned char* p, long *bitp, long nbits) +unsigned long grib_decode_unsigned_long(const unsigned char* p, long* bitp, long nbits) { int i; long ret = 0; - long o = *bitp/8; - int l = nbits/8; + long o = *bitp / 8; + int l = nbits / 8; - if (nbits==0) return 0; + if (nbits == 0) + return 0; - if(nbits > max_nbits) - { + if (nbits > max_nbits) { int bits = nbits; - int mod = bits % max_nbits; + int mod = bits % max_nbits; - if(mod != 0) - { - int e=grib_decode_unsigned_long(p,bitp,mod); - Assert( e == 0); + if (mod != 0) { + int e = grib_decode_unsigned_long(p, bitp, mod); + Assert(e == 0); bits -= mod; } - while(bits > max_nbits) - { - int e=grib_decode_unsigned_long(p,bitp,max_nbits); - Assert( e == 0); + while (bits > max_nbits) { + int e = grib_decode_unsigned_long(p, bitp, max_nbits); + Assert(e == 0); bits -= max_nbits; } - return grib_decode_unsigned_long(p,bitp,bits); + return grib_decode_unsigned_long(p, bitp, bits); } - if((nbits%8 > 0)||(*bitp%8 > 0)) { - for(i=0; i< nbits;i++){ + if ((nbits % 8 > 0) || (*bitp % 8 > 0)) { + for (i = 0; i < nbits; i++) { ret <<= 1; - if(grib_get_bit( p, *bitp)) ret += 1; + if (grib_get_bit(p, *bitp)) + ret += 1; *bitp += 1; } return ret; } - ret <<= 8; - ret |= p[o++] ; + ret <<= 8; + ret |= p[o++]; - for ( i=1; i max_nbits) - { + if (nbits > max_nbits) { /* TODO: Do some real code here, to support long longs */ - int bits = nbits; - int mod = bits % max_nbits; + int bits = nbits; + int mod = bits % max_nbits; long zero = 0; /* printf("Warning: encoding %ld bits=%ld %ld\n",val,nbits,*bitp); */ - if(mod != 0) - { - int e=grib_encode_unsigned_long(p,zero,bitp,mod); + if (mod != 0) { + int e = grib_encode_unsigned_long(p, zero, bitp, mod); /* printf(" -> : encoding %ld bits=%ld %ld\n",zero,(long)mod,*bitp); */ - Assert( e == 0); + Assert(e == 0); bits -= mod; } - while(bits > max_nbits) - { - int e=grib_encode_unsigned_long(p,zero,bitp,max_nbits); + while (bits > max_nbits) { + int e = grib_encode_unsigned_long(p, zero, bitp, max_nbits); /* printf(" -> : encoding %ld bits=%ld %ld\n",zero,(long)max_nbits,*bitp); */ Assert(e == 0); bits -= max_nbits; } /* printf(" -> : encoding %ld bits=%ld %ld\n",val,(long)bits,*bitp); */ - return grib_encode_unsigned_long(p,val,bitp,bits); + return grib_encode_unsigned_long(p, val, bitp, bits); } - if(s) + if (s) p += (*bitp >> 3); /* skip the bytes */ else p += (*bitp >> 3); /* skip the bytes */ /* head */ - if(s) { + if (s) { len -= n; if (len < 0) { tmp = ((val << -len) | ((*p) & dmasks[n])); - } else { + } + else { tmp = ((val >> len) | ((*p) & dmasks[n])); } *p = tmp; @@ -116,28 +112,28 @@ int grib_encode_unsigned_long(unsigned char* p, unsigned long val ,long *bitp, l } /* write the middle words */ - while(len >= 8) - { - len -= 8; + while (len >= 8) { + len -= 8; *p++ = (val >> len); } /* write the end bits */ - if(len) *p = (val << (8-len)); + if (len) + *p = (val << (8 - len)); *bitp += nbits; return GRIB_SUCCESS; } -int grib_encode_unsigned_longb(unsigned char* p, unsigned long val ,long *bitp, long nb) +int grib_encode_unsigned_longb(unsigned char* p, unsigned long val, long* bitp, long nb) { - long i = 0; + long i = 0; Assert(nb <= max_nbits); - for(i=nb-1; i >= 0; i--){ - if(test(val,i)) - grib_set_bit_on (p, bitp); + for (i = nb - 1; i >= 0; i--) { + if (test(val, i)) + grib_set_bit_on(p, bitp); else grib_set_bit_off(p, bitp); } @@ -145,4 +141,3 @@ int grib_encode_unsigned_longb(unsigned char* p, unsigned long val ,long *bitp, } #include "grib_bits_ibmpow_opt.c" - diff --git a/src/grib_bits_ibmpow_opt.c b/src/grib_bits_ibmpow_opt.c index c4f4bc8cb..5578daee1 100644 --- a/src/grib_bits_ibmpow_opt.c +++ b/src/grib_bits_ibmpow_opt.c @@ -8,84 +8,84 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -int grib_decode_long_array(const unsigned char* p, long *bitp, long bitsPerValue, - size_t n_vals,long* val) { - long i=0; +int grib_decode_long_array(const unsigned char* p, long* bitp, long bitsPerValue, + size_t n_vals, long* val) +{ + long i = 0; unsigned long lvalue = 0; - if(bitsPerValue%8) - { - int j=0; - for(i=0;i < n_vals;i++) { - lvalue=0; - for(j=0; j< bitsPerValue;j++){ + if (bitsPerValue % 8) { + int j = 0; + for (i = 0; i < n_vals; i++) { + lvalue = 0; + for (j = 0; j < bitsPerValue; j++) { lvalue <<= 1; - if(grib_get_bit( p, *bitp)) lvalue += 1; + if (grib_get_bit(p, *bitp)) + lvalue += 1; *bitp += 1; } val[i] = lvalue; } - } else { + } + else { int bc; - int l = bitsPerValue/8; - size_t o = *bitp/8; + int l = bitsPerValue / 8; + size_t o = *bitp / 8; - for(i=0;i < n_vals;i++) - { - lvalue = 0; - lvalue <<= 8; - lvalue |= p[o++] ; + for (i = 0; i < n_vals; i++) { + lvalue = 0; + lvalue <<= 8; + lvalue |= p[o++]; - for ( bc=1; bc= max_nbits) { - pp+=startBit/max_nbits; + pp += startBit / max_nbits; startBit %= max_nbits; } - if ( (max_nbits%nbits == 0) && (*bitp%nbits == 0) ) { - for (i=0;i max_nbits) { countOfLeftmostBits = max_nbits - startBit; remainingBits -= countOfLeftmostBits; - leftmostBits=(VALUE(*pp,startBit,countOfLeftmostBits)) << remainingBits; - startBit = 0; + leftmostBits = (VALUE(*pp, startBit, countOfLeftmostBits)) << remainingBits; + startBit = 0; pp++; - } else + } + else leftmostBits = 0; - val[i]=leftmostBits+(VALUE(*pp,startBit,remainingBits)); - val[i]= ((( (val[i]) * s)+reference_value)*d[i/2]); - startBit+=remainingBits; - remainingBits=nbits; + val[i] = leftmostBits + (VALUE(*pp, startBit, remainingBits)); + val[i] = ((((val[i]) * s) + reference_value) * d[i / 2]); + startBit += remainingBits; + remainingBits = nbits; } } - *bitp+=size*nbits; + *bitp += size * nbits; return GRIB_SUCCESS; } -int grib_encode_long_array(size_t n_vals,const long* val,long bits_per_value,unsigned char* p,long *off) +int grib_encode_long_array(size_t n_vals, const long* val, long bits_per_value, unsigned char* p, long* off) { - size_t i=0; - unsigned long unsigned_val=0; - unsigned char *encoded=p; - if(bits_per_value%8){ - for(i=0;i< n_vals;i++){ - unsigned_val=val[i]; - grib_encode_unsigned_longb(encoded, unsigned_val, off , bits_per_value); + size_t i = 0; + unsigned long unsigned_val = 0; + unsigned char* encoded = p; + if (bits_per_value % 8) { + for (i = 0; i < n_vals; i++) { + unsigned_val = val[i]; + grib_encode_unsigned_longb(encoded, unsigned_val, off, bits_per_value); } - } else{ - for(i=0;i< n_vals;i++){ - int blen=0; - blen = bits_per_value; + } + else { + for (i = 0; i < n_vals; i++) { + int blen = 0; + blen = bits_per_value; unsigned_val = val[i]; - while(blen >= 8) - { - blen -= 8; + while (blen >= 8) { + blen -= 8; *encoded = (unsigned_val >> blen); encoded++; - *off+=8; + *off += 8; } } } return GRIB_SUCCESS; } -#define U_BYTEORDER static union {unsigned long l; unsigned char c[sizeof(long)];} u_byteorder = {1} -#define IS_BIGENDIAN() (u_byteorder.c[sizeof(long) - 1]) -#define GRIBPACK unsigned char -#define Error(x, y) fprintf(stderr, x, y) -#define restrict +#define U_BYTEORDER \ + static union \ + { \ + unsigned long l; \ + unsigned char c[sizeof(long)]; \ + } u_byteorder = { 1 } +#define IS_BIGENDIAN() (u_byteorder.c[sizeof(long) - 1]) +#define GRIBPACK unsigned char +#define Error(x, y) fprintf(stderr, x, y) +#define restrict #include "encode_double_array.c" -#undef U_BYTEORDER -#undef IS_BIGENDIAN -#undef GRIBPACK -#undef Error -#undef restrict +#undef U_BYTEORDER +#undef IS_BIGENDIAN +#undef GRIBPACK +#undef Error +#undef restrict -int grib_encode_double_array(size_t n_vals,const double* val,long bits_per_value,double reference_value,double d,double divisor,unsigned char* p,long *off) +int grib_encode_double_array(size_t n_vals, const double* val, long bits_per_value, double reference_value, double d, double divisor, unsigned char* p, long* off) { - if ( fabs(d - 1) > 0 ) /* d != 1 */ + if (fabs(d - 1) > 0) /* d != 1 */ { - size_t i=0; - unsigned long unsigned_val=0; - unsigned char *encoded=p; + size_t i = 0; + unsigned long unsigned_val = 0; + unsigned char* encoded = p; double x; - if(bits_per_value%8){ - for(i=0;i< n_vals;i++){ - x=(((val[i]*d)-reference_value)*divisor)+0.5; + if (bits_per_value % 8) { + for (i = 0; i < n_vals; i++) { + x = (((val[i] * d) - reference_value) * divisor) + 0.5; unsigned_val = (unsigned long)x; - grib_encode_unsigned_longb(encoded, unsigned_val, off , bits_per_value); + grib_encode_unsigned_longb(encoded, unsigned_val, off, bits_per_value); } - } else{ - for(i=0;i< n_vals;i++){ - int blen=0; - blen = bits_per_value; - x = ((((val[i]*d)-reference_value)*divisor)+0.5); + } + else { + for (i = 0; i < n_vals; i++) { + int blen = 0; + blen = bits_per_value; + x = ((((val[i] * d) - reference_value) * divisor) + 0.5); unsigned_val = (unsigned long)x; - while(blen >= 8) - { - blen -= 8; + while (blen >= 8) { + blen -= 8; *encoded = (unsigned_val >> blen); encoded++; - *off+=8; + *off += 8; } } } } - else - { -#if defined (_ARCH_PWR6) + else { +#if defined(_ARCH_PWR6) encode_double_array_unrolled(bits_per_value, 0, n_vals, p, val, reference_value, divisor, off); #else - encode_double_array_byte (bits_per_value, 0, n_vals, p, val, reference_value, divisor, off); + encode_double_array_byte(bits_per_value, 0, n_vals, p, val, reference_value, divisor, off); #endif } @@ -233,15 +238,16 @@ int grib_encode_double_array(size_t n_vals,const double* val,long bits_per_value } /* code from grib_bits_fast_big_endian_simple.c */ -int grib_encode_double_array_complex(size_t n_vals,double* val,long nbits,double reference_value, - double* scal,double d,double divisor,unsigned char* p,long *bitp) { - long* destination = (long*)p; - double* v=val; - long countOfLeftmostBits=0,startBit=0,remainingBits=0,rightmostBits=0; - unsigned long uval=0; - size_t i=0; - - startBit=*bitp; +int grib_encode_double_array_complex(size_t n_vals, double* val, long nbits, double reference_value, + double* scal, double d, double divisor, unsigned char* p, long* bitp) +{ + long* destination = (long*)p; + double* v = val; + long countOfLeftmostBits = 0, startBit = 0, remainingBits = 0, rightmostBits = 0; + unsigned long uval = 0; + size_t i = 0; + + startBit = *bitp; remainingBits = nbits; if (startBit >= max_nbits) { @@ -249,50 +255,45 @@ int grib_encode_double_array_complex(size_t n_vals,double* val,long nbits,double startBit %= max_nbits; } - if ( (max_nbits%nbits == 0) && (*bitp%nbits == 0) ) { - - for(i=0;i< n_vals;i++) { - uval = (unsigned long)(((((*v)*d*scal[i/2])-reference_value)*divisor)+0.5); + if ((max_nbits % nbits == 0) && (*bitp % nbits == 0)) { + for (i = 0; i < n_vals; i++) { + uval = (unsigned long)(((((*v) * d * scal[i / 2]) - reference_value) * divisor) + 0.5); if (startBit == max_nbits) { startBit = 0; destination++; } - rightmostBits = VALUE(uval,max_nbits-remainingBits,remainingBits); - *destination = ((*destination) & ~MASKVALUE(startBit,remainingBits)) - + (rightmostBits << max_nbits-(remainingBits+startBit)); - startBit+=remainingBits; - remainingBits=nbits; + rightmostBits = VALUE(uval, max_nbits - remainingBits, remainingBits); + *destination = ((*destination) & ~MASKVALUE(startBit, remainingBits)) + (rightmostBits << max_nbits - (remainingBits + startBit)); + startBit += remainingBits; + remainingBits = nbits; v++; } - - } else { - - for(i=0;i< n_vals;i++) { + } + else { + for (i = 0; i < n_vals; i++) { countOfLeftmostBits = startBit + remainingBits; - uval = (unsigned long)(((((*v)*d*scal[i/2])-reference_value)*divisor)+0.5); + uval = (unsigned long)(((((*v) * d * scal[i / 2]) - reference_value) * divisor) + 0.5); if (countOfLeftmostBits > max_nbits) { countOfLeftmostBits = max_nbits - startBit; - startBit = max_nbits - remainingBits; + startBit = max_nbits - remainingBits; remainingBits -= countOfLeftmostBits; - *destination = (((*destination) >> countOfLeftmostBits) << countOfLeftmostBits) - + (VALUE(uval,startBit,countOfLeftmostBits)); - startBit = 0; + *destination = (((*destination) >> countOfLeftmostBits) << countOfLeftmostBits) + (VALUE(uval, startBit, countOfLeftmostBits)); + startBit = 0; destination++; } - rightmostBits = VALUE(uval,max_nbits-remainingBits,remainingBits); - *destination = ((*destination) & ~MASKVALUE(startBit,remainingBits)) - + (rightmostBits << max_nbits-(remainingBits+startBit)); - startBit+=remainingBits; - remainingBits=nbits; + rightmostBits = VALUE(uval, max_nbits - remainingBits, remainingBits); + *destination = ((*destination) & ~MASKVALUE(startBit, remainingBits)) + (rightmostBits << max_nbits - (remainingBits + startBit)); + startBit += remainingBits; + remainingBits = nbits; v++; } } - *bitp+=n_vals*nbits; + *bitp += n_vals * nbits; return 0; } diff --git a/src/grib_box.c b/src/grib_box.c index 3d5f2721d..5fd942a8d 100644 --- a/src/grib_box.c +++ b/src/grib_box.c @@ -17,88 +17,90 @@ #include "grib_api_internal.h" -grib_points* grib_box_get_points(grib_box *box,double north, double west,double south,double east, int *err) +grib_points* grib_box_get_points(grib_box* box, double north, double west, double south, double east, int* err) { - grib_box_class *c = box->cclass; - while(c) - { - grib_box_class *s = c->super ? *(c->super) : NULL; - if(c->get_points) { - return c->get_points(box,north,west,south,east,err); - } - c = s; - } - Assert(0); - return 0; + grib_box_class* c = box->cclass; + while (c) { + grib_box_class* s = c->super ? *(c->super) : NULL; + if (c->get_points) { + return c->get_points(box, north, west, south, east, err); + } + c = s; + } + Assert(0); + return 0; } /* For this one, ALL init are called */ -static int init_box(grib_box_class* c,grib_box* i, grib_handle *h, grib_arguments* args) +static int init_box(grib_box_class* c, grib_box* i, grib_handle* h, grib_arguments* args) { - - if(c) { - int ret = GRIB_SUCCESS; - grib_box_class *s = c->super ? *(c->super) : NULL; - if(!c->inited) - { - if(c->init_class) c->init_class(c); - c->inited = 1; + if (c) { + int ret = GRIB_SUCCESS; + grib_box_class* s = c->super ? *(c->super) : NULL; + if (!c->inited) { + if (c->init_class) + c->init_class(c); + c->inited = 1; + } + if (s) + ret = init_box(s, i, h, args); + + if (ret != GRIB_SUCCESS) + return ret; + + if (c->init) + return c->init(i, h, args); } - if(s) ret = init_box(s,i,h,args); - - if(ret != GRIB_SUCCESS) return ret; - - if(c->init) return c->init(i,h, args); - } - return GRIB_INTERNAL_ERROR; + return GRIB_INTERNAL_ERROR; } -int grib_box_init(grib_box* box, grib_handle *h, grib_arguments* args) +int grib_box_init(grib_box* box, grib_handle* h, grib_arguments* args) { - return init_box(box->cclass,box,h,args); + return init_box(box->cclass, box, h, args); } /* For this one, ALL destroy are called */ -int grib_box_delete(grib_box *box) +int grib_box_delete(grib_box* box) { - grib_box_class *c = box->cclass; - while(c) - { - grib_box_class *s = c->super ? *(c->super) : NULL; - if(c->destroy) c->destroy(box); - c = s; - } - return 0; + grib_box_class* c = box->cclass; + while (c) { + grib_box_class* s = c->super ? *(c->super) : NULL; + if (c->destroy) + c->destroy(box); + c = s; + } + return 0; } -grib_points* grib_points_new(grib_context* c,size_t size) { - grib_points* points=(grib_points*)grib_context_malloc_clear(c,sizeof(grib_points)); +grib_points* grib_points_new(grib_context* c, size_t size) +{ + grib_points* points = (grib_points*)grib_context_malloc_clear(c, sizeof(grib_points)); - points->latitudes =(double*)grib_context_malloc_clear(c,sizeof(double)*size); - points->longitudes =(double*)grib_context_malloc_clear(c,sizeof(double)*size); - points->indexes =(size_t*)grib_context_malloc_clear(c,sizeof(double)*size); - points->group_start=(size_t*)grib_context_malloc_clear(c,sizeof(double)*size); - points->group_len =(size_t*)grib_context_malloc_clear(c,sizeof(double)*size); - points->size=size; - points->context=c; + points->latitudes = (double*)grib_context_malloc_clear(c, sizeof(double) * size); + points->longitudes = (double*)grib_context_malloc_clear(c, sizeof(double) * size); + points->indexes = (size_t*)grib_context_malloc_clear(c, sizeof(double) * size); + points->group_start = (size_t*)grib_context_malloc_clear(c, sizeof(double) * size); + points->group_len = (size_t*)grib_context_malloc_clear(c, sizeof(double) * size); + points->size = size; + points->context = c; - return points; + return points; } -void grib_points_delete(grib_points *points) { - - grib_context* c; - if (!points) return; - - c=points->context; - grib_context_free(c,points->latitudes); - grib_context_free(c,points->longitudes); - grib_context_free(c,points->indexes); - grib_context_free(c,points->group_start); - grib_context_free(c,points->group_len); - grib_context_free(c,points); - +void grib_points_delete(grib_points* points) +{ + grib_context* c; + if (!points) + return; + + c = points->context; + grib_context_free(c, points->latitudes); + grib_context_free(c, points->longitudes); + grib_context_free(c, points->indexes); + grib_context_free(c, points->group_start); + grib_context_free(c, points->group_len); + grib_context_free(c, points); } diff --git a/src/grib_box_class.c b/src/grib_box_class.c index fcd4c2f76..c0238bb80 100644 --- a/src/grib_box_class.c +++ b/src/grib_box_class.c @@ -10,44 +10,43 @@ #include "grib_api_internal.h" -#define NUMBER(x) (sizeof(x)/sizeof(x[0])) +#define NUMBER(x) (sizeof(x) / sizeof(x[0])) /* This file is generated by ./make_class.pl */ #include "grib_box_class.h" struct table_entry { - char *type; - grib_box_class **cclass; + char* type; + grib_box_class** cclass; }; -static const struct table_entry table[] = -{ - /* This file is generated by ./make_class.pl */ +static const struct table_entry table[] = { +/* This file is generated by ./make_class.pl */ #include "grib_box_factory.h" }; -grib_box* grib_box_factory( grib_handle* h, grib_arguments* args) +grib_box* grib_box_factory(grib_handle* h, grib_arguments* args) { - int i; - int ret = GRIB_SUCCESS; - char* type = (char*)grib_arguments_get_name(h,args,0); - - for(i = 0; i < NUMBER(table) ; i++) - if(strcmp(type,table[i].type) == 0) - { - grib_box_class* c = *(table[i].cclass); - grib_box* it = (grib_box*) grib_context_malloc_clear(h->context,c->size); - it->cclass = c; - ret = GRIB_SUCCESS; - ret = grib_box_init(it,h,args); - if(ret == GRIB_SUCCESS) return it; - grib_context_log(h->context,GRIB_LOG_ERROR,"grib_box_factory: error %d instantiating box %s", ret, table[i].type); - grib_box_delete(it); - return NULL; - } - - grib_context_log(h->context,GRIB_LOG_ERROR,"grib_box_factory : Unknown type : %s for box", type); - - return NULL; + int i; + int ret = GRIB_SUCCESS; + char* type = (char*)grib_arguments_get_name(h, args, 0); + + for (i = 0; i < NUMBER(table); i++) + if (strcmp(type, table[i].type) == 0) { + grib_box_class* c = *(table[i].cclass); + grib_box* it = (grib_box*)grib_context_malloc_clear(h->context, c->size); + it->cclass = c; + ret = GRIB_SUCCESS; + ret = grib_box_init(it, h, args); + if (ret == GRIB_SUCCESS) + return it; + grib_context_log(h->context, GRIB_LOG_ERROR, "grib_box_factory: error %d instantiating box %s", ret, table[i].type); + grib_box_delete(it); + return NULL; + } + + grib_context_log(h->context, GRIB_LOG_ERROR, "grib_box_factory : Unknown type : %s for box", type); + + return NULL; } diff --git a/src/grib_box_class_gen.c b/src/grib_box_class_gen.c index 735851277..cccb62042 100644 --- a/src/grib_box_class_gen.c +++ b/src/grib_box_class_gen.c @@ -35,27 +35,28 @@ or edit "box.class" and rerun ./make_class.pl */ -static void init_class (grib_box_class*); +static void init_class(grib_box_class*); -static int init (grib_box* box,grib_handle* h,grib_arguments* args); -static grib_points* get_points(grib_box* box, double north, double west, double south,double east,int *err); -static int destroy (grib_box* box); +static int init(grib_box* box, grib_handle* h, grib_arguments* args); +static grib_points* get_points(grib_box* box, double north, double west, double south, double east, int* err); +static int destroy(grib_box* box); -typedef struct grib_box_gen{ - grib_box box; -/* Members defined in gen */ +typedef struct grib_box_gen +{ + grib_box box; + /* Members defined in gen */ } grib_box_gen; static grib_box_class _grib_box_class_gen = { - 0, /* super */ - "gen", /* name */ - sizeof(grib_box_gen), /* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* constructor */ - &destroy, /* destructor */ - &get_points, /* get points */ + 0, /* super */ + "gen", /* name */ + sizeof(grib_box_gen), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* constructor */ + &destroy, /* destructor */ + &get_points, /* get points */ }; grib_box_class* grib_box_class_gen = &_grib_box_class_gen; @@ -66,21 +67,20 @@ static void init_class(grib_box_class* c) } /* END_CLASS_IMP */ -static int init(grib_box* box,grib_handle* h,grib_arguments* args) +static int init(grib_box* box, grib_handle* h, grib_arguments* args) { - return 0; + return 0; } -static int destroy(grib_box* box) { - grib_points_delete(box->points); - box->points=0; - return GRIB_SUCCESS; +static int destroy(grib_box* box) +{ + grib_points_delete(box->points); + box->points = 0; + return GRIB_SUCCESS; } -static grib_points* get_points(grib_box* box, double north, double west, double south,double east, int *err) { - *err=GRIB_NOT_IMPLEMENTED; - return NULL; +static grib_points* get_points(grib_box* box, double north, double west, double south, double east, int* err) +{ + *err = GRIB_NOT_IMPLEMENTED; + return NULL; } - - - diff --git a/src/grib_box_class_reduced_gaussian.c b/src/grib_box_class_reduced_gaussian.c index 7aa31227d..af4cf8ee2 100644 --- a/src/grib_box_class_reduced_gaussian.c +++ b/src/grib_box_class_reduced_gaussian.c @@ -40,34 +40,35 @@ or edit "box.class" and rerun ./make_class.pl */ -static void init_class (grib_box_class*); - -static int init (grib_box* box,grib_handle* h,grib_arguments* args); -static grib_points* get_points(grib_box* box, double north, double west, double south,double east,int *err); -static int destroy (grib_box* box); - -typedef struct grib_box_reduced_gaussian{ - grib_box box; -/* Members defined in gen */ -/* Members defined in reduced_gaussian */ - double* lats; - size_t nlats; - double** lons; - long* nlons; - size_t size; +static void init_class(grib_box_class*); + +static int init(grib_box* box, grib_handle* h, grib_arguments* args); +static grib_points* get_points(grib_box* box, double north, double west, double south, double east, int* err); +static int destroy(grib_box* box); + +typedef struct grib_box_reduced_gaussian +{ + grib_box box; + /* Members defined in gen */ + /* Members defined in reduced_gaussian */ + double* lats; + size_t nlats; + double** lons; + long* nlons; + size_t size; } grib_box_reduced_gaussian; extern grib_box_class* grib_box_class_gen; static grib_box_class _grib_box_class_reduced_gaussian = { - &grib_box_class_gen, /* super */ - "reduced_gaussian", /* name */ - sizeof(grib_box_reduced_gaussian), /* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* constructor */ - &destroy, /* destructor */ - &get_points, /* get points */ + &grib_box_class_gen, /* super */ + "reduced_gaussian", /* name */ + sizeof(grib_box_reduced_gaussian), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* constructor */ + &destroy, /* destructor */ + &get_points, /* get points */ }; grib_box_class* grib_box_class_reduced_gaussian = &_grib_box_class_reduced_gaussian; @@ -78,162 +79,175 @@ static void init_class(grib_box_class* c) } /* END_CLASS_IMP */ -static int init(grib_box* box,grib_handle* h,grib_arguments* args) +static int init(grib_box* box, grib_handle* h, grib_arguments* args) { - grib_box_reduced_gaussian* self=(grib_box_reduced_gaussian*)box; - int n=1; - int ret=0; - char* key; - long* pl; - double lat_first,lat_last,lon_first,lon_last; - long order; - double *lats; - long j,l,ilon_first,ilon_last,i; - long row_count; - grib_context* c=box->context; - - key = (char*)grib_arguments_get_name(h,args,n++); - ret=grib_get_double(h,key,&lat_first); - if (ret) return ret; - - key = (char*)grib_arguments_get_name(h,args,n++); - ret=grib_get_double(h,key,&lon_first); - if (ret) return ret; - - key = (char*)grib_arguments_get_name(h,args,n++); - ret=grib_get_double(h,key,&lat_last); - if (ret) return ret; - - key = (char*)grib_arguments_get_name(h,args,n++); - ret=grib_get_double(h,key,&lon_last); - if (ret) return ret; - - key = (char*)grib_arguments_get_name(h,args,n++); - ret=grib_get_long(h,key,&order); - if (ret) return ret; - - key = (char*)grib_arguments_get_name(h,args,n++); - ret=grib_get_size(h,key,&self->nlats); - if (ret) return ret; - pl=(long*)grib_context_malloc(h->context,self->nlats*sizeof(long)); - ret=grib_get_long_array(h,key,pl,&self->nlats); - if (ret) return ret; - - lats=(double*)grib_context_malloc(h->context,sizeof(double)*order*2); - if((ret = grib_get_gaussian_latitudes(order, lats)) != GRIB_SUCCESS) - return ret; - - if (self->nlats==order*2) { - /*global (latitudes)*/ - self->lats=lats; - } else { - /*sub area (latitudes)*/ - int ll=0; - double d=fabs(lats[0]-lats[1]); - while (fabs(lat_first-lats[ll]) > d ) {ll++;} - self->lats=(double*)grib_context_malloc(h->context,sizeof(double)*self->nlats); - for (i=0;inlats;i++) self->lats[i]=lats[ll++]; - grib_context_free(box->context,lats); - } - - self->lons=(double**)grib_context_malloc_clear(box->context,sizeof(double*)*self->nlats); - self->size=0; - if (lon_first != 0 || - fabs(lon_last - (360.0-90.0/order)) > 90.0/order) { - /* sub area (longitudes) */ - for (j=0;jnlats;j++) { - row_count=0; - grib_get_reduced_row_wrapper(h, pl[j],lon_first,lon_last, - &row_count,&ilon_first,&ilon_last); - self->size+=row_count; - if (ilon_first>ilon_last) ilon_first-=pl[j]; - l=0; - self->lons[j]=(double*)grib_context_malloc_clear(c,sizeof(double)*row_count); - for (i=ilon_first;i<=ilon_last;i++) - self->lons[j][l++]=((i)*360.0)/pl[j]; - pl[j]=row_count; - } - } else { - /* global (longitudes) */ - for (j=0;jnlats;j++) { - self->lons[j]=(double*)grib_context_malloc_clear(c,sizeof(double)*pl[j]); - self->size+=pl[j]; - for (i=0;ilons[j][i]=(i*360.0)/pl[j]; - } - - } - self->nlons=pl; - - return 0; + grib_box_reduced_gaussian* self = (grib_box_reduced_gaussian*)box; + int n = 1; + int ret = 0; + char* key; + long* pl; + double lat_first, lat_last, lon_first, lon_last; + long order; + double* lats; + long j, l, ilon_first, ilon_last, i; + long row_count; + grib_context* c = box->context; + + key = (char*)grib_arguments_get_name(h, args, n++); + ret = grib_get_double(h, key, &lat_first); + if (ret) + return ret; + + key = (char*)grib_arguments_get_name(h, args, n++); + ret = grib_get_double(h, key, &lon_first); + if (ret) + return ret; + + key = (char*)grib_arguments_get_name(h, args, n++); + ret = grib_get_double(h, key, &lat_last); + if (ret) + return ret; + + key = (char*)grib_arguments_get_name(h, args, n++); + ret = grib_get_double(h, key, &lon_last); + if (ret) + return ret; + + key = (char*)grib_arguments_get_name(h, args, n++); + ret = grib_get_long(h, key, &order); + if (ret) + return ret; + + key = (char*)grib_arguments_get_name(h, args, n++); + ret = grib_get_size(h, key, &self->nlats); + if (ret) + return ret; + pl = (long*)grib_context_malloc(h->context, self->nlats * sizeof(long)); + ret = grib_get_long_array(h, key, pl, &self->nlats); + if (ret) + return ret; + + lats = (double*)grib_context_malloc(h->context, sizeof(double) * order * 2); + if ((ret = grib_get_gaussian_latitudes(order, lats)) != GRIB_SUCCESS) + return ret; + + if (self->nlats == order * 2) { + /*global (latitudes)*/ + self->lats = lats; + } + else { + /*sub area (latitudes)*/ + int ll = 0; + double d = fabs(lats[0] - lats[1]); + while (fabs(lat_first - lats[ll]) > d) { + ll++; + } + self->lats = (double*)grib_context_malloc(h->context, sizeof(double) * self->nlats); + for (i = 0; i < self->nlats; i++) + self->lats[i] = lats[ll++]; + grib_context_free(box->context, lats); + } + + self->lons = (double**)grib_context_malloc_clear(box->context, sizeof(double*) * self->nlats); + self->size = 0; + if (lon_first != 0 || + fabs(lon_last - (360.0 - 90.0 / order)) > 90.0 / order) { + /* sub area (longitudes) */ + for (j = 0; j < self->nlats; j++) { + row_count = 0; + grib_get_reduced_row_wrapper(h, pl[j], lon_first, lon_last, + &row_count, &ilon_first, &ilon_last); + self->size += row_count; + if (ilon_first > ilon_last) + ilon_first -= pl[j]; + l = 0; + self->lons[j] = (double*)grib_context_malloc_clear(c, sizeof(double) * row_count); + for (i = ilon_first; i <= ilon_last; i++) + self->lons[j][l++] = ((i)*360.0) / pl[j]; + pl[j] = row_count; + } + } + else { + /* global (longitudes) */ + for (j = 0; j < self->nlats; j++) { + self->lons[j] = (double*)grib_context_malloc_clear(c, sizeof(double) * pl[j]); + self->size += pl[j]; + for (i = 0; i < pl[j]; i++) + self->lons[j][i] = (i * 360.0) / pl[j]; + } + } + self->nlons = pl; + + return 0; } -static int destroy(grib_box* box) { - grib_box_reduced_gaussian* self=(grib_box_reduced_gaussian*)box; - grib_context* c=box->context; - int i; +static int destroy(grib_box* box) +{ + grib_box_reduced_gaussian* self = (grib_box_reduced_gaussian*)box; + grib_context* c = box->context; + int i; - grib_points_delete(box->points); + grib_points_delete(box->points); - grib_context_free(c,self->lats); - for (i=0;inlats;i++) - grib_context_free(c,self->lons[i]); - grib_context_free(c,self->lons); - - return GRIB_SUCCESS; -} + grib_context_free(c, self->lats); + for (i = 0; i < self->nlats; i++) + grib_context_free(c, self->lons[i]); + grib_context_free(c, self->lons); -static grib_points* get_points(grib_box* box, double north, double west, double south,double east, int *err) { - long j,i,index,l; - double lat,lon; - size_t group_count; - int first=1; - grib_box_reduced_gaussian* self=(grib_box_reduced_gaussian*)box; - grib_points* points=NULL; - - grib_context* c=box->context; - points=grib_points_new(c,self->size); - if (!points) - grib_context_log(c,GRIB_LOG_FATAL,"unable to create grib_points\n"); - - index=0; - l=0; - group_count=0; - for (j=0;jnlats;j++) { - lat=self->lats[j]; - for (i=0;inlons[j];i++) { - lon=self->lons[j][i]; - if (latsouth && lon>west && lonlatitudes[l]=lat; - points->longitudes[l]=lon; - points->indexes[l]=index; - points->group_len[group_count]++; - if (first) { - points->group_start[group_count]=index; - points->group_len[group_count]=0; - first=0; - } else { - if (index!=points->group_start[group_count]+points->group_len[group_count]) { - group_count++; - points->group_start[group_count]=index; - points->group_len[group_count]=0; - points->n_groups=group_count+1; - } - } - l++; - } - index++; - } - } - points->group_len[group_count]++; - points->n=l; - if (box->points) grib_points_delete(box->points); - box->points=points; - - *err=0; - - return points; + return GRIB_SUCCESS; } - - +static grib_points* get_points(grib_box* box, double north, double west, double south, double east, int* err) +{ + long j, i, index, l; + double lat, lon; + size_t group_count; + int first = 1; + grib_box_reduced_gaussian* self = (grib_box_reduced_gaussian*)box; + grib_points* points = NULL; + + grib_context* c = box->context; + points = grib_points_new(c, self->size); + if (!points) + grib_context_log(c, GRIB_LOG_FATAL, "unable to create grib_points\n"); + + index = 0; + l = 0; + group_count = 0; + for (j = 0; j < self->nlats; j++) { + lat = self->lats[j]; + for (i = 0; i < self->nlons[j]; i++) { + lon = self->lons[j][i]; + if (lat < north && lat > south && lon > west && lon < east) { + points->latitudes[l] = lat; + points->longitudes[l] = lon; + points->indexes[l] = index; + points->group_len[group_count]++; + if (first) { + points->group_start[group_count] = index; + points->group_len[group_count] = 0; + first = 0; + } + else { + if (index != points->group_start[group_count] + points->group_len[group_count]) { + group_count++; + points->group_start[group_count] = index; + points->group_len[group_count] = 0; + points->n_groups = group_count + 1; + } + } + l++; + } + index++; + } + } + points->group_len[group_count]++; + points->n = l; + if (box->points) + grib_points_delete(box->points); + box->points = points; + + *err = 0; + + return points; +} diff --git a/src/grib_box_class_regular_gaussian.c b/src/grib_box_class_regular_gaussian.c index 51255f6d9..9924d589c 100644 --- a/src/grib_box_class_regular_gaussian.c +++ b/src/grib_box_class_regular_gaussian.c @@ -34,29 +34,30 @@ or edit "box.class" and rerun ./make_class.pl */ -static void init_class (grib_box_class*); +static void init_class(grib_box_class*); -static int init (grib_box* box,grib_handle* h,grib_arguments* args); -static grib_points* get_points(grib_box* box, double north, double west, double south,double east,int *err); -static int destroy (grib_box* box); +static int init(grib_box* box, grib_handle* h, grib_arguments* args); +static grib_points* get_points(grib_box* box, double north, double west, double south, double east, int* err); +static int destroy(grib_box* box); -typedef struct grib_box_regular_gaussian{ - grib_box box; -/* Members defined in gen */ -/* Members defined in regular_gaussian */ +typedef struct grib_box_regular_gaussian +{ + grib_box box; + /* Members defined in gen */ + /* Members defined in regular_gaussian */ } grib_box_regular_gaussian; extern grib_box_class* grib_box_class_gen; static grib_box_class _grib_box_class_regular_gaussian = { - &grib_box_class_gen, /* super */ - "regular_gaussian", /* name */ - sizeof(grib_box_regular_gaussian), /* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* constructor */ - &destroy, /* destructor */ - &get_points, /* get points */ + &grib_box_class_gen, /* super */ + "regular_gaussian", /* name */ + sizeof(grib_box_regular_gaussian), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* constructor */ + &destroy, /* destructor */ + &get_points, /* get points */ }; grib_box_class* grib_box_class_regular_gaussian = &_grib_box_class_regular_gaussian; @@ -67,19 +68,18 @@ static void init_class(grib_box_class* c) } /* END_CLASS_IMP */ -static int init(grib_box* box,grib_handle* h,grib_arguments* args) +static int init(grib_box* box, grib_handle* h, grib_arguments* args) { - return 0; + return 0; } -static int destroy(grib_box* box) { - return GRIB_SUCCESS; +static int destroy(grib_box* box) +{ + return GRIB_SUCCESS; } -static grib_points* get_points(grib_box* box, double north, double west, double south,double east, int *err) { - *err=GRIB_NOT_IMPLEMENTED; - return NULL; +static grib_points* get_points(grib_box* box, double north, double west, double south, double east, int* err) +{ + *err = GRIB_NOT_IMPLEMENTED; + return NULL; } - - - diff --git a/src/grib_buffer.c b/src/grib_buffer.c index d6c052e2b..ee2e49f07 100644 --- a/src/grib_buffer.c +++ b/src/grib_buffer.c @@ -14,38 +14,36 @@ ***************************************************************************/ #include "grib_api_internal.h" -void grib_get_buffer_ownership(const grib_context *c, grib_buffer *b) +void grib_get_buffer_ownership(const grib_context* c, grib_buffer* b) { unsigned char* newdata; - if(b->property == GRIB_MY_BUFFER) + if (b->property == GRIB_MY_BUFFER) return; newdata = (unsigned char*)grib_context_malloc(c, b->length); memcpy(newdata, b->data, b->length); - b->data = newdata; + b->data = newdata; b->property = GRIB_MY_BUFFER; } grib_buffer* grib_create_growable_buffer(const grib_context* c) { - grib_buffer *b = (grib_buffer*)grib_context_malloc_clear(c,sizeof(grib_buffer)); + grib_buffer* b = (grib_buffer*)grib_context_malloc_clear(c, sizeof(grib_buffer)); - if(b == NULL) - { - grib_context_log(c,GRIB_LOG_ERROR,"grib_new_buffer: cannot allocate buffer"); + if (b == NULL) { + grib_context_log(c, GRIB_LOG_ERROR, "grib_new_buffer: cannot allocate buffer"); return NULL; } b->property = GRIB_MY_BUFFER; b->length = 10240; b->ulength = 0; - b->data = (unsigned char*)grib_context_malloc_clear(c,b->length); + b->data = (unsigned char*)grib_context_malloc_clear(c, b->length); b->growable = 1; - if(!b->data) - { - grib_context_log(c,GRIB_LOG_ERROR,"grib_new_buffer: cannot allocate buffer"); - grib_context_free(c,b); + if (!b->data) { + grib_context_log(c, GRIB_LOG_ERROR, "grib_new_buffer: cannot allocate buffer"); + grib_context_free(c, b); return NULL; } @@ -54,90 +52,88 @@ grib_buffer* grib_create_growable_buffer(const grib_context* c) grib_buffer* grib_new_buffer(const grib_context* c, const unsigned char* data, size_t buflen) { - grib_buffer *b = (grib_buffer*)grib_context_malloc_clear(c,sizeof(grib_buffer)); + grib_buffer* b = (grib_buffer*)grib_context_malloc_clear(c, sizeof(grib_buffer)); - if(b == NULL) - { - grib_context_log(c,GRIB_LOG_ERROR,"grib_new_buffer: cannot allocate buffer"); + if (b == NULL) { + grib_context_log(c, GRIB_LOG_ERROR, "grib_new_buffer: cannot allocate buffer"); return NULL; } - b->property = GRIB_USER_BUFFER; - b->length = buflen; - b->ulength = buflen; - b->ulength_bits = buflen*8; - b->data = (unsigned char*)data; + b->property = GRIB_USER_BUFFER; + b->length = buflen; + b->ulength = buflen; + b->ulength_bits = buflen * 8; + b->data = (unsigned char*)data; return b; } -void grib_buffer_delete(const grib_context *c, grib_buffer *b) +void grib_buffer_delete(const grib_context* c, grib_buffer* b) { - if(b->property == GRIB_MY_BUFFER) - grib_context_free(c,b->data); - b->length = 0; + if (b->property == GRIB_MY_BUFFER) + grib_context_free(c, b->data); + b->length = 0; b->ulength = 0; - grib_context_free(c,b); + grib_context_free(c, b); } -static void grib_grow_buffer_to(const grib_context *c, grib_buffer *b, size_t ns) +static void grib_grow_buffer_to(const grib_context* c, grib_buffer* b, size_t ns) { unsigned char* newdata; - if(ns>b->length) - { + if (ns > b->length) { grib_get_buffer_ownership(c, b); newdata = (unsigned char*)grib_context_malloc_clear(c, ns); memcpy(newdata, b->data, b->length); - grib_context_free(c,b->data); - b->data = newdata; + grib_context_free(c, b->data); + b->data = newdata; b->length = ns; } } -void grib_grow_buffer(const grib_context *c, grib_buffer *b, size_t new_size) +void grib_grow_buffer(const grib_context* c, grib_buffer* b, size_t new_size) { if (new_size > b->length) { size_t len = 0; - size_t inc= b->length > 2048 ? b->length : 2048; - len = ((new_size + 2*inc)/1024) * 1024; - grib_grow_buffer_to(c,b,len); + size_t inc = b->length > 2048 ? b->length : 2048; + len = ((new_size + 2 * inc) / 1024) * 1024; + grib_grow_buffer_to(c, b, len); } } -void grib_buffer_set_ulength_bits(const grib_context *c, grib_buffer *b, size_t length_bits) +void grib_buffer_set_ulength_bits(const grib_context* c, grib_buffer* b, size_t length_bits) { - size_t length=length_bits/8; - if (length_bits%8) length++; - grib_grow_buffer(c,b,length); + size_t length = length_bits / 8; + if (length_bits % 8) + length++; + grib_grow_buffer(c, b, length); b->ulength_bits = length_bits; - b->ulength = length; + b->ulength = length; } -void grib_buffer_set_ulength(const grib_context *c, grib_buffer *b, size_t length) +void grib_buffer_set_ulength(const grib_context* c, grib_buffer* b, size_t length) { - grib_grow_buffer(c,b,length); - b->ulength = length; - b->ulength_bits = length*8; + grib_grow_buffer(c, b, length); + b->ulength = length; + b->ulength_bits = length * 8; } -static void update_offsets(grib_accessor* a,long len) +static void update_offsets(grib_accessor* a, long len) { - while(a) - { + while (a) { grib_section* s = a->sub_section; a->offset += len; - grib_context_log(a->context,GRIB_LOG_DEBUG, "::::: grib_buffer : accessor %s is moving by %d bytes to %ld",a->name ,len, a->offset); - if(s) update_offsets(s->block->first,len); + grib_context_log(a->context, GRIB_LOG_DEBUG, "::::: grib_buffer : accessor %s is moving by %d bytes to %ld", a->name, len, a->offset); + if (s) + update_offsets(s->block->first, len); a = a->next; } } -static void update_offsets_after(grib_accessor* a,long len) +static void update_offsets_after(grib_accessor* a, long len) { - while(a) - { - update_offsets(a->next,len); + while (a) { + update_offsets(a->next, len); a = a->parent->owner; } } @@ -224,47 +220,45 @@ static void update_sections_lengths(grib_section* s) #endif -void grib_buffer_replace( grib_accessor *a, const unsigned char* data, - size_t newsize,int update_lengths,int update_paddings) +void grib_buffer_replace(grib_accessor* a, const unsigned char* data, + size_t newsize, int update_lengths, int update_paddings) { - size_t offset = a->offset; - long oldsize = grib_get_next_position_offset(a)-offset; - long increase = (long)newsize - (long)oldsize; + size_t offset = a->offset; + long oldsize = grib_get_next_position_offset(a) - offset; + long increase = (long)newsize - (long)oldsize; - grib_buffer *buffer = grib_handle_of_accessor(a)->buffer; - size_t message_length = buffer->ulength; + grib_buffer* buffer = grib_handle_of_accessor(a)->buffer; + size_t message_length = buffer->ulength; - grib_context_log(a->context,GRIB_LOG_DEBUG, - "grib_buffer_replace %s offset=%ld oldsize=%ld newsize=%ld message_length=%ld update_paddings=%d", - a->name,(long)offset,oldsize,(long)newsize,(long)message_length,update_paddings); + grib_context_log(a->context, GRIB_LOG_DEBUG, + "grib_buffer_replace %s offset=%ld oldsize=%ld newsize=%ld message_length=%ld update_paddings=%d", + a->name, (long)offset, oldsize, (long)newsize, (long)message_length, update_paddings); grib_buffer_set_ulength(a->context, - buffer, - buffer->ulength+increase); + buffer, + buffer->ulength + increase); /* move the end */ - if(increase) + if (increase) memmove( - buffer->data + offset + newsize, - buffer->data + offset + oldsize, - message_length - offset - oldsize); + buffer->data + offset + newsize, + buffer->data + offset + oldsize, + message_length - offset - oldsize); /* copy new data */ - DebugAssert( buffer->data + offset ); - DebugAssert( data || (newsize==0) );/* if data==NULL then newsize must be 0 */ + DebugAssert(buffer->data + offset); + DebugAssert(data || (newsize == 0)); /* if data==NULL then newsize must be 0 */ if (data) { /* Note: memcpy behaviour is undefined if either dest or src is NULL */ memcpy(buffer->data + offset, data, newsize); } - if(increase) - { - update_offsets_after(a,increase); - if(update_lengths) - { - grib_update_size(a,newsize); - grib_section_adjust_sizes(grib_handle_of_accessor(a)->root,1,0); - if(update_paddings) + if (increase) { + update_offsets_after(a, increase); + if (update_lengths) { + grib_update_size(a, newsize); + grib_section_adjust_sizes(grib_handle_of_accessor(a)->root, 1, 0); + if (update_paddings) grib_update_paddings(grib_handle_of_accessor(a)->root); } } @@ -272,6 +266,6 @@ void grib_buffer_replace( grib_accessor *a, const unsigned char* data, void grib_update_sections_lengths(grib_handle* h) { - grib_section_adjust_sizes(h->root,2,0); + grib_section_adjust_sizes(h->root, 2, 0); grib_update_paddings(h->root); } diff --git a/src/grib_bufr_descriptor.c b/src/grib_bufr_descriptor.c index 729d3a02f..07d49642f 100644 --- a/src/grib_bufr_descriptor.c +++ b/src/grib_bufr_descriptor.c @@ -11,11 +11,12 @@ #include "grib_api_internal.h" -bufr_descriptor* grib_bufr_descriptor_new(grib_accessor* tables_accessor,int code,int *err) +bufr_descriptor* grib_bufr_descriptor_new(grib_accessor* tables_accessor, int code, int* err) { - bufr_descriptor* ret=accessor_bufr_elements_table_get_descriptor(tables_accessor,code,err); - if (*err) grib_context_log(tables_accessor->context,GRIB_LOG_ERROR, - "unable to get descriptor %06d from table",code); + bufr_descriptor* ret = accessor_bufr_elements_table_get_descriptor(tables_accessor, code, err); + if (*err) + grib_context_log(tables_accessor->context, GRIB_LOG_ERROR, + "unable to get descriptor %06d from table", code); return ret; } @@ -23,102 +24,113 @@ bufr_descriptor* grib_bufr_descriptor_clone(bufr_descriptor* d) { bufr_descriptor* cd; - if (!d) return NULL; + if (!d) + return NULL; - cd=(bufr_descriptor*)grib_context_malloc_clear(d->context,sizeof(bufr_descriptor)); + cd = (bufr_descriptor*)grib_context_malloc_clear(d->context, sizeof(bufr_descriptor)); - cd->context=d->context; - cd->code=d->code; - cd->F=d->F; - cd->X=d->X; - cd->Y=d->Y; + cd->context = d->context; + cd->code = d->code; + cd->F = d->F; + cd->X = d->X; + cd->Y = d->Y; /* cd->name=grib_context_strdup(d->context,d->name); See ECC-489 */ - cd->shortName=grib_context_strdup(d->context,d->shortName); - cd->units=grib_context_strdup(d->context,d->units); - cd->scale=d->scale; - cd->factor=d->factor; - cd->width=d->width; - cd->reference=d->reference; - cd->type=d->type; - cd->nokey=d->nokey; + cd->shortName = grib_context_strdup(d->context, d->shortName); + cd->units = grib_context_strdup(d->context, d->units); + cd->scale = d->scale; + cd->factor = d->factor; + cd->width = d->width; + cd->reference = d->reference; + cd->type = d->type; + cd->nokey = d->nokey; return cd; } -int grib_bufr_descriptor_set_code(grib_accessor* tables_accessor,int code,bufr_descriptor* v) +int grib_bufr_descriptor_set_code(grib_accessor* tables_accessor, int code, bufr_descriptor* v) { - int err=0; + int err = 0; grib_context* c; bufr_descriptor* d; - if (!v) return GRIB_NULL_POINTER; - - c=v->context; - - if (v->type==BUFR_DESCRIPTOR_TYPE_REPLICATION || v->type==BUFR_DESCRIPTOR_TYPE_OPERATOR) { - v->code=code; - v->F=code/100000; - v->X=(code-v->F*100000)/1000; - v->Y=(code-v->F*100000)%1000; - } else { - if (tables_accessor==NULL) return GRIB_NULL_POINTER; - d=accessor_bufr_elements_table_get_descriptor(tables_accessor,code,&err); - v->code=d->code; - v->F=d->F; - v->X=d->X; - v->Y=d->Y; + if (!v) + return GRIB_NULL_POINTER; + + c = v->context; + + if (v->type == BUFR_DESCRIPTOR_TYPE_REPLICATION || v->type == BUFR_DESCRIPTOR_TYPE_OPERATOR) { + v->code = code; + v->F = code / 100000; + v->X = (code - v->F * 100000) / 1000; + v->Y = (code - v->F * 100000) % 1000; + } + else { + if (tables_accessor == NULL) + return GRIB_NULL_POINTER; + d = accessor_bufr_elements_table_get_descriptor(tables_accessor, code, &err); + v->code = d->code; + v->F = d->F; + v->X = d->X; + v->Y = d->Y; /* grib_context_free(c,v->name); See ECC-489 */ /* v->name=grib_context_strdup(c,d->name); See ECC-489 */ - grib_context_free(c,v->shortName); - v->shortName=grib_context_strdup(c,d->shortName); - grib_context_free(c,v->units); - v->units=grib_context_strdup(c,d->units); - v->scale=d->scale; - v->factor=d->factor; - v->width=d->width; - v->reference=d->reference; - v->type=d->type; - v->nokey=d->nokey; + grib_context_free(c, v->shortName); + v->shortName = grib_context_strdup(c, d->shortName); + grib_context_free(c, v->units); + v->units = grib_context_strdup(c, d->units); + v->scale = d->scale; + v->factor = d->factor; + v->width = d->width; + v->reference = d->reference; + v->type = d->type; + v->nokey = d->nokey; grib_bufr_descriptor_delete(d); } return err; } -void grib_bufr_descriptor_set_reference(bufr_descriptor* v,long reference) +void grib_bufr_descriptor_set_reference(bufr_descriptor* v, long reference) { - if (!v) return; - v->reference=reference; + if (!v) + return; + v->reference = reference; } -void grib_bufr_descriptor_set_width(bufr_descriptor* v,long width) +void grib_bufr_descriptor_set_width(bufr_descriptor* v, long width) { - if (!v) return; - v->width=width; + if (!v) + return; + v->width = width; } -void grib_bufr_descriptor_set_scale(bufr_descriptor* v,long scale) +void grib_bufr_descriptor_set_scale(bufr_descriptor* v, long scale) { - if (!v) return; - v->scale=scale; - if (scale!=0) v->type=BUFR_DESCRIPTOR_TYPE_DOUBLE; - v->factor=grib_power(-scale,10); + if (!v) + return; + v->scale = scale; + if (scale != 0) + v->type = BUFR_DESCRIPTOR_TYPE_DOUBLE; + v->factor = grib_power(-scale, 10); } int grib_bufr_descriptor_can_be_missing(bufr_descriptor* v) { - if (v->code==31031 || v->code==999999 ) return 0; - if (v->width == 1) return 0; + if (v->code == 31031 || v->code == 999999) + return 0; + if (v->width == 1) + return 0; return 1; } void grib_bufr_descriptor_delete(bufr_descriptor* v) { - grib_context* c=NULL; - if (!v) return; - c=v->context; + grib_context* c = NULL; + if (!v) + return; + c = v->context; /* grib_context_free(c,v->name); See ECC-489 */ - grib_context_free(c,v->shortName); - grib_context_free(c,v->units); - grib_context_free(c,v); + grib_context_free(c, v->shortName); + grib_context_free(c, v->units); + grib_context_free(c, v); } diff --git a/src/grib_bufr_descriptors_array.c b/src/grib_bufr_descriptors_array.c index 7df7ba115..09efe88fd 100644 --- a/src/grib_bufr_descriptors_array.c +++ b/src/grib_bufr_descriptors_array.c @@ -13,27 +13,28 @@ #define DYN_ARRAY_SIZE_INIT 200 /* Initial size for grib_bufr_descriptors_array_new */ #define DYN_ARRAY_SIZE_INCR 400 /* Increment size for the above */ -bufr_descriptors_array* grib_bufr_descriptors_array_new(grib_context* c,size_t size,size_t incsize) +bufr_descriptors_array* grib_bufr_descriptors_array_new(grib_context* c, size_t size, size_t incsize) { - bufr_descriptors_array* v=NULL; + bufr_descriptors_array* v = NULL; - if (!c) c=grib_context_get_default(); + if (!c) + c = grib_context_get_default(); - v=(bufr_descriptors_array*)grib_context_malloc(c,sizeof(bufr_descriptors_array)); + v = (bufr_descriptors_array*)grib_context_malloc(c, sizeof(bufr_descriptors_array)); if (!v) { - grib_context_log(c,GRIB_LOG_ERROR, - "bufr_descriptors_array_new unable to allocate %d bytes\n",sizeof(bufr_descriptors_array)); + grib_context_log(c, GRIB_LOG_ERROR, + "bufr_descriptors_array_new unable to allocate %d bytes\n", sizeof(bufr_descriptors_array)); return NULL; } - v->context=c; - v->size=size; - v->n=0; - v->incsize=incsize; - v->v=(bufr_descriptor**)grib_context_malloc(c,sizeof(bufr_descriptor*)*size); - v->number_of_pop_front=0; + v->context = c; + v->size = size; + v->n = 0; + v->incsize = incsize; + v->v = (bufr_descriptor**)grib_context_malloc(c, sizeof(bufr_descriptor*) * size); + v->number_of_pop_front = 0; if (!v->v) { - grib_context_log(c,GRIB_LOG_ERROR, - "grib_bufr_descriptors_array_new unable to allocate %d bytes\n",sizeof(bufr_descriptor)*size); + grib_context_log(c, GRIB_LOG_ERROR, + "grib_bufr_descriptors_array_new unable to allocate %d bytes\n", sizeof(bufr_descriptor) * size); return NULL; } return v; @@ -41,14 +42,14 @@ bufr_descriptors_array* grib_bufr_descriptors_array_new(grib_context* c,size_t s bufr_descriptor* grib_bufr_descriptors_array_pop(bufr_descriptors_array* a) { - a->n-=1; + a->n -= 1; return a->v[a->n]; } bufr_descriptor* grib_bufr_descriptors_array_pop_front(bufr_descriptors_array* a) { - bufr_descriptor* v=a->v[0]; - if (a->n==0) { + bufr_descriptor* v = a->v[0]; + if (a->n == 0) { DebugAssert(0); } a->n--; @@ -58,140 +59,148 @@ bufr_descriptor* grib_bufr_descriptors_array_pop_front(bufr_descriptors_array* a return v; } -bufr_descriptors_array* grib_bufr_descriptors_array_resize_to(bufr_descriptors_array* v,size_t newsize) +bufr_descriptors_array* grib_bufr_descriptors_array_resize_to(bufr_descriptors_array* v, size_t newsize) { bufr_descriptor** newv; size_t i; - grib_context* c=v->context; + grib_context* c = v->context; - if (newsizesize) return v; + if (newsize < v->size) + return v; - if (!c) c=grib_context_get_default(); + if (!c) + c = grib_context_get_default(); - newv=(bufr_descriptor**)grib_context_malloc_clear(c,newsize*sizeof(bufr_descriptor*)); + newv = (bufr_descriptor**)grib_context_malloc_clear(c, newsize * sizeof(bufr_descriptor*)); if (!newv) { - grib_context_log(c,GRIB_LOG_ERROR, - "grib_bufr_descriptors_array_resize unable to allocate %d bytes\n",sizeof(bufr_descriptor*)*newsize); + grib_context_log(c, GRIB_LOG_ERROR, + "grib_bufr_descriptors_array_resize unable to allocate %d bytes\n", sizeof(bufr_descriptor*) * newsize); return NULL; } - for (i=0;in;i++) newv[i]=v->v[i]; + for (i = 0; i < v->n; i++) + newv[i] = v->v[i]; - v->v-=v->number_of_pop_front; - grib_context_free(c,v->v); + v->v -= v->number_of_pop_front; + grib_context_free(c, v->v); - v->v=newv; - v->size=newsize; - v->number_of_pop_front=0; + v->v = newv; + v->size = newsize; + v->number_of_pop_front = 0; return v; } bufr_descriptors_array* grib_bufr_descriptors_array_resize(bufr_descriptors_array* v) { - int newsize=v->incsize+v->size; + int newsize = v->incsize + v->size; - return grib_bufr_descriptors_array_resize_to(v,newsize); + return grib_bufr_descriptors_array_resize_to(v, newsize); } -bufr_descriptors_array* grib_bufr_descriptors_array_push(bufr_descriptors_array* v,bufr_descriptor* val) +bufr_descriptors_array* grib_bufr_descriptors_array_push(bufr_descriptors_array* v, bufr_descriptor* val) { if (!v) { - size_t start_size=DYN_ARRAY_SIZE_INIT; - size_t start_incsize=DYN_ARRAY_SIZE_INCR; - v=grib_bufr_descriptors_array_new(0,start_size,start_incsize); + size_t start_size = DYN_ARRAY_SIZE_INIT; + size_t start_incsize = DYN_ARRAY_SIZE_INCR; + v = grib_bufr_descriptors_array_new(0, start_size, start_incsize); } - if (v->n >= v->size-v->number_of_pop_front) - v=grib_bufr_descriptors_array_resize(v); + if (v->n >= v->size - v->number_of_pop_front) + v = grib_bufr_descriptors_array_resize(v); - v->v[v->n]=val; + v->v[v->n] = val; v->n++; return v; } -bufr_descriptors_array* grib_bufr_descriptors_array_append(bufr_descriptors_array* v,bufr_descriptors_array* ar) +bufr_descriptors_array* grib_bufr_descriptors_array_append(bufr_descriptors_array* v, bufr_descriptors_array* ar) { size_t i; - bufr_descriptor* vv=0; + bufr_descriptor* vv = 0; if (!v) { - size_t start_size=DYN_ARRAY_SIZE_INIT; - size_t start_incsize=DYN_ARRAY_SIZE_INCR; - v=grib_bufr_descriptors_array_new(0,start_size,start_incsize); + size_t start_size = DYN_ARRAY_SIZE_INIT; + size_t start_incsize = DYN_ARRAY_SIZE_INCR; + v = grib_bufr_descriptors_array_new(0, start_size, start_incsize); } - for (i=0;in;i++) { - vv=grib_bufr_descriptor_clone(ar->v[i]); - grib_bufr_descriptors_array_push(v,vv); + for (i = 0; i < ar->n; i++) { + vv = grib_bufr_descriptor_clone(ar->v[i]); + grib_bufr_descriptors_array_push(v, vv); } grib_bufr_descriptors_array_delete(ar); - ar=0; + ar = 0; return v; } -bufr_descriptors_array* grib_bufr_descriptors_array_push_front(bufr_descriptors_array* v,bufr_descriptor* val) +bufr_descriptors_array* grib_bufr_descriptors_array_push_front(bufr_descriptors_array* v, bufr_descriptor* val) { int i; if (!v) { - size_t start_size=DYN_ARRAY_SIZE_INIT; - size_t start_incsize=DYN_ARRAY_SIZE_INCR; - v=grib_bufr_descriptors_array_new(0,start_size,start_incsize); + size_t start_size = DYN_ARRAY_SIZE_INIT; + size_t start_incsize = DYN_ARRAY_SIZE_INCR; + v = grib_bufr_descriptors_array_new(0, start_size, start_incsize); } if (v->number_of_pop_front) { v->v--; v->number_of_pop_front--; - } else { - if (v->n >= v->size) v=grib_bufr_descriptors_array_resize(v); - for (i=v->n;i>0;i--) v[i]=v[i-1]; } - v->v[0]=val; + else { + if (v->n >= v->size) + v = grib_bufr_descriptors_array_resize(v); + for (i = v->n; i > 0; i--) + v[i] = v[i - 1]; + } + v->v[0] = val; v->n++; return v; } -bufr_descriptor* grib_bufr_descriptors_array_get(bufr_descriptors_array* a,size_t i) +bufr_descriptor* grib_bufr_descriptors_array_get(bufr_descriptors_array* a, size_t i) { return a->v[i]; } -void grib_bufr_descriptors_array_set(bufr_descriptors_array* a,size_t i,bufr_descriptor* v) +void grib_bufr_descriptors_array_set(bufr_descriptors_array* a, size_t i, bufr_descriptor* v) { - a->v[i]=v; + a->v[i] = v; } void grib_bufr_descriptors_array_delete(bufr_descriptors_array* v) { grib_context* c; - if (!v) return; - c=v->context; + if (!v) + return; + c = v->context; grib_bufr_descriptors_array_delete_array(v); - grib_context_free(c,v); + grib_context_free(c, v); } void grib_bufr_descriptors_array_delete_array(bufr_descriptors_array* v) { grib_context* c; int i; - bufr_descriptor** vv=NULL; + bufr_descriptor** vv = NULL; - if (!v) return; - c=v->context; + if (!v) + return; + c = v->context; if (v->v) { - vv=v->v; - for (i=0;in;i++) { + vv = v->v; + for (i = 0; i < v->n; i++) { grib_bufr_descriptor_delete(vv[i]); } vv = v->v - v->number_of_pop_front; - grib_context_free(c,vv); + grib_context_free(c, vv); } } @@ -199,13 +208,16 @@ bufr_descriptor** grib_bufr_descriptors_array_get_array(bufr_descriptors_array* { bufr_descriptor** vv; size_t i; - grib_context* c=grib_context_get_default(); + grib_context* c = grib_context_get_default(); - vv=(bufr_descriptor**)grib_context_malloc_clear(c,sizeof(bufr_descriptor*)*v->n); - for (i=0;in;i++) vv[i]=grib_bufr_descriptor_clone(v->v[i]); + vv = (bufr_descriptor**)grib_context_malloc_clear(c, sizeof(bufr_descriptor*) * v->n); + for (i = 0; i < v->n; i++) + vv[i] = grib_bufr_descriptor_clone(v->v[i]); return vv; } -size_t grib_bufr_descriptors_array_used_size(bufr_descriptors_array* v) {return v->n;} - +size_t grib_bufr_descriptors_array_used_size(bufr_descriptors_array* v) +{ + return v->n; +} diff --git a/src/grib_compressor.c b/src/grib_compressor.c index 1ea22324e..e165e4f70 100644 --- a/src/grib_compressor.c +++ b/src/grib_compressor.c @@ -14,72 +14,72 @@ ***************************************************************************/ #include "grib_api_internal.h" -int grib_compressor_pack (grib_compressor* cmp, const double* vals, size_t valslen, void* buf, size_t* buflen){ - grib_compressor_class *c = cmp->cclass; - while(c) - { - grib_compressor_class *s = c->super ? *(c->super) : NULL; - if(c->pack) return c->pack(cmp,vals,valslen,buf,buflen); - c = s; - } - Assert(0); - return 0; +int grib_compressor_pack(grib_compressor* cmp, const double* vals, size_t valslen, void* buf, size_t* buflen) +{ + grib_compressor_class* c = cmp->cclass; + while (c) { + grib_compressor_class* s = c->super ? *(c->super) : NULL; + if (c->pack) + return c->pack(cmp, vals, valslen, buf, buflen); + c = s; + } + Assert(0); + return 0; } -int grib_compressor_unpack(grib_compressor* cmp, const void* buf, size_t buflen, double* vals, size_t* valslen){ - - grib_compressor_class *c = cmp->cclass; - while(c) - { - grib_compressor_class *s = c->super ? *(c->super) : NULL; - if(c->unpack) return c->unpack(cmp,buf,buflen,vals,valslen); - c = s; - } - Assert(0); - return 0; - +int grib_compressor_unpack(grib_compressor* cmp, const void* buf, size_t buflen, double* vals, size_t* valslen) +{ + grib_compressor_class* c = cmp->cclass; + while (c) { + grib_compressor_class* s = c->super ? *(c->super) : NULL; + if (c->unpack) + return c->unpack(cmp, buf, buflen, vals, valslen); + c = s; + } + Assert(0); + return 0; } /* For this one, ALL init are called */ -static int init_compressor(grib_compressor_class* c,grib_compressor* cmp, grib_handle *h, grib_arguments* args) +static int init_compressor(grib_compressor_class* c, grib_compressor* cmp, grib_handle* h, grib_arguments* args) { + if (c) { + int ret = GRIB_SUCCESS; + grib_compressor_class* s = c->super ? *(c->super) : NULL; + if (!c->inited) { + if (c->init_class) + c->init_class(c); + c->inited = 1; + } + if (s) + ret = init_compressor(s, cmp, h, args); - if(c) { - int ret = GRIB_SUCCESS; - grib_compressor_class *s = c->super ? *(c->super) : NULL; - if(!c->inited) - { - if(c->init_class) c->init_class(c); - c->inited = 1; - } - if(s) ret = init_compressor(s,cmp,h,args); - - if(ret != GRIB_SUCCESS) return ret; + if (ret != GRIB_SUCCESS) + return ret; - if(c->init) return c->init(cmp,h, args); - } - return GRIB_INTERNAL_ERROR; + if (c->init) + return c->init(cmp, h, args); + } + return GRIB_INTERNAL_ERROR; } -int grib_compressor_init(grib_compressor* i, grib_handle *h, grib_arguments* args) +int grib_compressor_init(grib_compressor* i, grib_handle* h, grib_arguments* args) { - return init_compressor(i->cclass,i,h,args); + return init_compressor(i->cclass, i, h, args); } /* For this one, ALL destroy are called */ -int grib_compressor_delete(grib_compressor *cmp) +int grib_compressor_delete(grib_compressor* cmp) { - grib_compressor_class *c = cmp->cclass; - while(c) - { - grib_compressor_class *s = c->super ? *(c->super) : NULL; - if(c->destroy) c->destroy(cmp); - c = s; - } - /* This should go in a top class */ - grib_context_free(cmp->h->context,cmp); - return 0; + grib_compressor_class* c = cmp->cclass; + while (c) { + grib_compressor_class* s = c->super ? *(c->super) : NULL; + if (c->destroy) + c->destroy(cmp); + c = s; + } + /* This should go in a top class */ + grib_context_free(cmp->h->context, cmp); + return 0; } - - diff --git a/src/grib_concept.c b/src/grib_concept.c index d87ffb507..5e29f2719 100644 --- a/src/grib_concept.c +++ b/src/grib_concept.c @@ -10,39 +10,38 @@ #include "grib_api_internal.h" -grib_concept_value* grib_concept_value_new(grib_context* c, const char* name,grib_concept_condition* conditions) +grib_concept_value* grib_concept_value_new(grib_context* c, const char* name, grib_concept_condition* conditions) { - grib_concept_value* v = (grib_concept_value*)grib_context_malloc_clear_persistent(c,sizeof(grib_concept_value)); - v->name = grib_context_strdup_persistent(c,name); - v->conditions = conditions; + grib_concept_value* v = (grib_concept_value*)grib_context_malloc_clear_persistent(c, sizeof(grib_concept_value)); + v->name = grib_context_strdup_persistent(c, name); + v->conditions = conditions; return v; } -void grib_concept_value_delete(grib_context* c,grib_concept_value* v) +void grib_concept_value_delete(grib_context* c, grib_concept_value* v) { grib_concept_condition* e = v->conditions; - while(e) - { + while (e) { grib_concept_condition* n = e->next; - grib_concept_condition_delete(c,e); + grib_concept_condition_delete(c, e); e = n; } - grib_context_free_persistent(c,v->name); - grib_context_free_persistent(c,v); + grib_context_free_persistent(c, v->name); + grib_context_free_persistent(c, v); } -grib_concept_condition* grib_concept_condition_new(grib_context* c,const char* name,grib_expression* expression, grib_iarray* iarray) +grib_concept_condition* grib_concept_condition_new(grib_context* c, const char* name, grib_expression* expression, grib_iarray* iarray) { - grib_concept_condition* v = (grib_concept_condition*)grib_context_malloc_clear_persistent(c,sizeof(grib_concept_condition)); - v->name = grib_context_strdup_persistent(c,name); - v->expression = expression; - v->iarray=iarray; + grib_concept_condition* v = (grib_concept_condition*)grib_context_malloc_clear_persistent(c, sizeof(grib_concept_condition)); + v->name = grib_context_strdup_persistent(c, name); + v->expression = expression; + v->iarray = iarray; return v; } -void grib_concept_condition_delete(grib_context* c,grib_concept_condition* v) +void grib_concept_condition_delete(grib_context* c, grib_concept_condition* v) { - grib_expression_free(c,v->expression); - grib_context_free_persistent(c,v->name); - grib_context_free_persistent(c,v); + grib_expression_free(c, v->expression); + grib_context_free_persistent(c, v->name); + grib_context_free_persistent(c, v); } diff --git a/src/grib_concept_index.c b/src/grib_concept_index.c index 63d15299d..40dbd3a40 100644 --- a/src/grib_concept_index.c +++ b/src/grib_concept_index.c @@ -15,154 +15,158 @@ #include "grib_api_internal.h" -static grib_concept_index_entry* index_entry_new(grib_context* c,grib_concept_index_keys* keys) { - grib_concept_index_entry* entry=NULL; +static grib_concept_index_entry* index_entry_new(grib_context* c, grib_concept_index_keys* keys) +{ + grib_concept_index_entry* entry = NULL; - Assert(keys); + Assert(keys); - if (!c) c=grib_context_get_default(); + if (!c) + c = grib_context_get_default(); - entry=grib_context_malloc_clear(c,sizeof(grib_concept_index_entry)); - if (!entry) - grib_context_log(c,GRIB_LOG_FATAL,"grib_concept_index_entry unable to allocate"); - e=entry; + entry = grib_context_malloc_clear(c, sizeof(grib_concept_index_entry)); + if (!entry) + grib_context_log(c, GRIB_LOG_FATAL, "grib_concept_index_entry unable to allocate"); + e = entry; - while (keys && keys->name) { - e->name=grib_context_strdup(c,keys->name); - e->type=keys->type; - e->next=grib_context_malloc_clear(c,sizeof(grib_concept_index_entry)); - if (!e->next) - grib_context_log(c,GRIB_LOG_FATAL,"grib_concept_index_entry unable to allocate"); + while (keys && keys->name) { + e->name = grib_context_strdup(c, keys->name); + e->type = keys->type; + e->next = grib_context_malloc_clear(c, sizeof(grib_concept_index_entry)); + if (!e->next) + grib_context_log(c, GRIB_LOG_FATAL, "grib_concept_index_entry unable to allocate"); - e=e->next; - keys=keys->next; - } - - return entry; + e = e->next; + keys = keys->next; + } + return entry; } -static void index_entry_delete(grib_context* c,grib_concept_index_entry* entry) { - grib_concept_index_entry* e; - while (entry) { - e=entry; - entry=entry->next; - grib_context_free(c,e->name); - grib_context_free(c,e->value); - grib_context_free(c,e); - } +static void index_entry_delete(grib_context* c, grib_concept_index_entry* entry) +{ + grib_concept_index_entry* e; + while (entry) { + e = entry; + entry = entry->next; + grib_context_free(c, e->name); + grib_context_free(c, e->value); + grib_context_free(c, e); + } } -static int index_insert_entry(grib_concept_index* index,grib_concept_index_entry* entry,void* object) { - - int err=0; - int found=0; - grib_conditions_tree* cur=index->conditions; - grib_conditions_tree* prev=index->conditions; - grib_concept_index_keys* keys=index->keys; - - while (keys->name) { - - if (!cur) { - cur=grib_context_malloc_clear_persistent(index->context,sizeof(grib_conditions_tree)); - if (!cur) - grib_context_log(index->context,GRIB_LOG_FATAL,"index_insert_entry unable to allocate"); - prev->next=cur; - } - value = entry->value ? entry->value : "*"; - while (cur && (!cur->value || (found=!strcmp(cur->value,value))==0) ) cur=cur->next; - - if (!found) { - cur->next=grib_context_malloc_clear_persistent(index->context,sizeof(grib_conditions_tree)); - if (!cur->next) - grib_context_log(index->context,GRIB_LOG_FATAL,"index_insert_entry unable to allocate"); - cur=cur->next; - } - - cur->value=grib_context_strdup(index->context,value); - entry=entry->next; - keys=keys->next; - prev=cur; - cur=cur->next_key; - } - - while (cur) { - prev=cur; - cur=cur->next_key; - } - - prev->object=object; - - return err; +static int index_insert_entry(grib_concept_index* index, grib_concept_index_entry* entry, void* object) +{ + int err = 0; + int found = 0; + grib_conditions_tree* cur = index->conditions; + grib_conditions_tree* prev = index->conditions; + grib_concept_index_keys* keys = index->keys; + + while (keys->name) { + if (!cur) { + cur = grib_context_malloc_clear_persistent(index->context, sizeof(grib_conditions_tree)); + if (!cur) + grib_context_log(index->context, GRIB_LOG_FATAL, "index_insert_entry unable to allocate"); + prev->next = cur; + } + value = entry->value ? entry->value : "*"; + while (cur && (!cur->value || (found = !strcmp(cur->value, value)) == 0)) + cur = cur->next; + + if (!found) { + cur->next = grib_context_malloc_clear_persistent(index->context, sizeof(grib_conditions_tree)); + if (!cur->next) + grib_context_log(index->context, GRIB_LOG_FATAL, "index_insert_entry unable to allocate"); + cur = cur->next; + } + + cur->value = grib_context_strdup(index->context, value); + entry = entry->next; + keys = keys->next; + prev = cur; + cur = cur->next_key; + } + + while (cur) { + prev = cur; + cur = cur->next_key; + } + + prev->object = object; + + return err; } -static void index_add_conditions(grib_concept_index* index,grib_concept_condition* condition) { - grib_concept_condition* c=condition; - char s[512]={0,}; - grib_concept_index_entry* e;; - grib_concept_index_entry* entry=index_entry_new(index->context,index->keys);; - - while (c) { - size_t size=512; - int type; - e=entry; - type = grib_expression_native_type(0,c->expression); - switch(type) - { - case GRIB_TYPE_LONG: - grib_expression_evaluate_long(0,c->expression,&lres); - sprintf(s,"%ld",lres); - break; - - case GRIB_TYPE_DOUBLE: - grib_expression_evaluate_double(0,c->expression,&dres); - sprintf(s,"%g",dres); - break; - - case GRIB_TYPE_STRING: - grib_expression_evaluate_string(0,c->expression,s,&size,&err); - break; - - default: - Assert(0); - break; - } - - while (e->name && strcmp(e->name,c->name)) - e=e->next; - - e->type=type; - e->value=grib_context_strdup(index->context,s); - if (!e->name) { - e->name=grib_context_strdup(index->context,c->name); - e->next=grib_context_malloc_clear_persistent(index->context,sizeof(grib_concept_index_entry)); - if (!e->next) - grib_context_log(index->context,GRIB_LOG_FATAL,"index_add_conditions unable to allocate"); - } - - c=c->next; - } - - index_insert_entry(index,entry,condition->name); - - index_entry_delete(index->context,entry); +static void index_add_conditions(grib_concept_index* index, grib_concept_condition* condition) +{ + grib_concept_condition* c = condition; + char s[512] = {0,}; + grib_concept_index_entry* e; + grib_concept_index_entry* entry = index_entry_new(index->context, index->keys); + + while (c) { + size_t size = 512; + int type; + e = entry; + type = grib_expression_native_type(0, c->expression); + switch (type) { + case GRIB_TYPE_LONG: + grib_expression_evaluate_long(0, c->expression, &lres); + sprintf(s, "%ld", lres); + break; + + case GRIB_TYPE_DOUBLE: + grib_expression_evaluate_double(0, c->expression, &dres); + sprintf(s, "%g", dres); + break; + + case GRIB_TYPE_STRING: + grib_expression_evaluate_string(0, c->expression, s, &size, &err); + break; + + default: + Assert(0); + break; + } + + while (e->name && strcmp(e->name, c->name)) + e = e->next; + + e->type = type; + e->value = grib_context_strdup(index->context, s); + if (!e->name) { + e->name = grib_context_strdup(index->context, c->name); + e->next = grib_context_malloc_clear_persistent(index->context, sizeof(grib_concept_index_entry)); + if (!e->next) + grib_context_log(index->context, GRIB_LOG_FATAL, "index_add_conditions unable to allocate"); + } + + c = c->next; + } + + index_insert_entry(index, entry, condition->name); + + index_entry_delete(index->context, entry); } -grib_concept_index* grib_concept_index_new_from_concept(grib_context* c,grib_concept_value* concept,int *err) { - grib_concept_index* index; +grib_concept_index* grib_concept_index_new_from_concept(grib_context* c, grib_concept_value* concept, int* err) +{ + grib_concept_index* index; - if (!c) c=grib_context_get_default(); + if (!c) + c = grib_context_get_default(); - index=grib_context_malloc_clear_persistent(c,sizeof(grib_concept_index)); - index->keys=grib_context_malloc_clear_persistent(c,sizeof(grib_concept_index_key)); - index->conditions=grib_context_malloc_clear_persistent(c,sizeof(grib_conditions_tree)); - index->conditions=grib_context_malloc_clear_persistent(c,sizeof(grib_conditions_tree)); - index->context=c; + index = grib_context_malloc_clear_persistent(c, sizeof(grib_concept_index)); + index->keys = grib_context_malloc_clear_persistent(c, sizeof(grib_concept_index_key)); + index->conditions = grib_context_malloc_clear_persistent(c, sizeof(grib_conditions_tree)); + index->conditions = grib_context_malloc_clear_persistent(c, sizeof(grib_conditions_tree)); + index->context = c; - while (concept) { - index_add_conditions(index,concept->conditions,err); - concept=concept->next; - } + while (concept) { + index_add_conditions(index, concept->conditions, err); + concept = concept->next; + } - return index; + return index; } diff --git a/src/grib_context.c b/src/grib_context.c index 629142c22..f19a41b9a 100644 --- a/src/grib_context.c +++ b/src/grib_context.c @@ -29,26 +29,26 @@ grib_string_list grib_file_not_found; /* Windows always has a colon in pathnames e.g. C:\temp\file. So instead we use semi-colons as delimiter */ /* in order to have multiple definitions directories */ #ifdef ECCODES_ON_WINDOWS -# define DEFS_PATH_DELIMITER_CHAR ';' -# define DEFS_PATH_DELIMITER_STR ";" +#define DEFS_PATH_DELIMITER_CHAR ';' +#define DEFS_PATH_DELIMITER_STR ";" #else -# define DEFS_PATH_DELIMITER_CHAR ':' -# define DEFS_PATH_DELIMITER_STR ":" +#define DEFS_PATH_DELIMITER_CHAR ':' +#define DEFS_PATH_DELIMITER_STR ":" #endif #if GRIB_PTHREADS -static pthread_once_t once = PTHREAD_ONCE_INIT; +static pthread_once_t once = PTHREAD_ONCE_INIT; static pthread_mutex_t mutex_mem = PTHREAD_MUTEX_INITIALIZER; -static pthread_mutex_t mutex_c = PTHREAD_MUTEX_INITIALIZER; +static pthread_mutex_t mutex_c = PTHREAD_MUTEX_INITIALIZER; static void init() { pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); - pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init(&mutex_c,&attr); - pthread_mutex_init(&mutex_mem,&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&mutex_c, &attr); + pthread_mutex_init(&mutex_mem, &attr); pthread_mutexattr_destroy(&attr); } #elif GRIB_OMP_THREADS @@ -60,8 +60,7 @@ static void init() { GRIB_OMP_CRITICAL(lock_grib_context_c) { - if (once == 0) - { + if (once == 0) { omp_init_nest_lock(&mutex_mem); omp_init_nest_lock(&mutex_c); once = 1; @@ -83,9 +82,9 @@ static void default_long_lasting_free(const grib_context* c, void* p) static void* default_long_lasting_malloc(const grib_context* c, size_t size) { void* ret; - ret=malloc(size); + ret = malloc(size); if (!ret) { - grib_context_log(c,GRIB_LOG_FATAL,"default_long_lasting_malloc: error allocating %lu bytes",(unsigned long)size); + grib_context_log(c, GRIB_LOG_FATAL, "default_long_lasting_malloc: error allocating %lu bytes", (unsigned long)size); Assert(0); } return ret; @@ -99,9 +98,9 @@ static void default_buffer_free(const grib_context* c, void* p) static void* default_buffer_malloc(const grib_context* c, size_t size) { void* ret; - ret=malloc(size); + ret = malloc(size); if (!ret) { - grib_context_log(c,GRIB_LOG_FATAL,"default_buffer_malloc: error allocating %lu bytes",(unsigned long)size); + grib_context_log(c, GRIB_LOG_FATAL, "default_buffer_malloc: error allocating %lu bytes", (unsigned long)size); Assert(0); } return ret; @@ -110,9 +109,9 @@ static void* default_buffer_malloc(const grib_context* c, size_t size) static void* default_buffer_realloc(const grib_context* c, void* p, size_t size) { void* ret; - ret=realloc(p,size); + ret = realloc(p, size); if (!ret) { - grib_context_log(c,GRIB_LOG_FATAL,"default_buffer_realloc: error allocating %lu bytes",(unsigned long)size); + grib_context_log(c, GRIB_LOG_FATAL, "default_buffer_realloc: error allocating %lu bytes", (unsigned long)size); Assert(0); } return ret; @@ -126,9 +125,9 @@ static void default_free(const grib_context* c, void* p) static void* default_malloc(const grib_context* c, size_t size) { void* ret; - ret=malloc(size); + ret = malloc(size); if (!ret) { - grib_context_log(c,GRIB_LOG_FATAL,"default_malloc: error allocating %lu bytes",(unsigned long)size); + grib_context_log(c, GRIB_LOG_FATAL, "default_malloc: error allocating %lu bytes", (unsigned long)size); Assert(0); } return ret; @@ -137,89 +136,102 @@ static void* default_malloc(const grib_context* c, size_t size) static void* default_realloc(const grib_context* c, void* p, size_t size) { void* ret; - ret=realloc(p,size); + ret = realloc(p, size); if (!ret) { - grib_context_log(c,GRIB_LOG_FATAL,"default_realloc: error allocating %lu bytes",(unsigned long)size); + grib_context_log(c, GRIB_LOG_FATAL, "default_realloc: error allocating %lu bytes", (unsigned long)size); Assert(0); } return ret; } #endif -static size_t default_read(const grib_context* c, void *ptr, size_t size, void *stream) +static size_t default_read(const grib_context* c, void* ptr, size_t size, void* stream) { - return fread(ptr, 1, size, (FILE*)stream); + return fread(ptr, 1, size, (FILE*)stream); } -static off_t default_tell(const grib_context* c, void *stream) +static off_t default_tell(const grib_context* c, void* stream) { return ftello((FILE*)stream); } -static off_t default_seek(const grib_context* c, off_t offset,int whence, void *stream) +static off_t default_seek(const grib_context* c, off_t offset, int whence, void* stream) { - return fseeko((FILE*)stream,offset,whence); + return fseeko((FILE*)stream, offset, whence); } -static int default_feof(const grib_context* c, void *stream) +static int default_feof(const grib_context* c, void* stream) { return feof((FILE*)stream); } -static size_t default_write(const grib_context* c,const void *ptr, size_t size, void *stream) +static size_t default_write(const grib_context* c, const void* ptr, size_t size, void* stream) { - return fwrite(ptr, 1, size, (FILE*)stream); + return fwrite(ptr, 1, size, (FILE*)stream); } -size_t grib_context_read(const grib_context* c, void *ptr, size_t size, void *stream) +size_t grib_context_read(const grib_context* c, void* ptr, size_t size, void* stream) { - if (!c) c=grib_context_get_default(); - return c->read(c,ptr, size, stream); + if (!c) + c = grib_context_get_default(); + return c->read(c, ptr, size, stream); } -off_t grib_context_tell(const grib_context* c, void *stream) +off_t grib_context_tell(const grib_context* c, void* stream) { - if (!c) c=grib_context_get_default(); - return c->tell(c,stream); + if (!c) + c = grib_context_get_default(); + return c->tell(c, stream); } -int grib_context_seek(const grib_context* c, off_t offset ,int whence , void *stream) +int grib_context_seek(const grib_context* c, off_t offset, int whence, void* stream) { - if (!c) c=grib_context_get_default(); - return c->seek(c,offset,whence,stream); + if (!c) + c = grib_context_get_default(); + return c->seek(c, offset, whence, stream); } -int grib_context_eof(const grib_context* c, void *stream) +int grib_context_eof(const grib_context* c, void* stream) { - if (!c) c=grib_context_get_default(); - return c->eof(c,stream); + if (!c) + c = grib_context_get_default(); + return c->eof(c, stream); } -size_t grib_context_write(const grib_context* c,const void *ptr, size_t size, void *stream) +size_t grib_context_write(const grib_context* c, const void* ptr, size_t size, void* stream) { - if (!c) c=grib_context_get_default(); - return c->write(c,ptr, size, stream); + if (!c) + c = grib_context_get_default(); + return c->write(c, ptr, size, stream); } static void default_log(const grib_context* c, int level, const char* mess) { - if (!c) c=grib_context_get_default(); - if(level == GRIB_LOG_ERROR) { + if (!c) + c = grib_context_get_default(); + if (level == GRIB_LOG_ERROR) { fprintf(c->log_stream, "ECCODES ERROR : %s\n", mess); /*Assert(1==0);*/ } - if(level == GRIB_LOG_FATAL) fprintf(c->log_stream, "ECCODES ERROR : %s\n", mess); - if(level == GRIB_LOG_DEBUG && c->debug>0) fprintf(c->log_stream, "ECCODES DEBUG : %s\n", mess); - if(level == GRIB_LOG_WARNING) fprintf(c->log_stream, "ECCODES WARNING : %s\n", mess); - if(level == GRIB_LOG_INFO) fprintf(c->log_stream, "ECCODES INFO : %s\n", mess); - - if(level == GRIB_LOG_FATAL) { Assert(0);} + if (level == GRIB_LOG_FATAL) + fprintf(c->log_stream, "ECCODES ERROR : %s\n", mess); + if (level == GRIB_LOG_DEBUG && c->debug > 0) + fprintf(c->log_stream, "ECCODES DEBUG : %s\n", mess); + if (level == GRIB_LOG_WARNING) + fprintf(c->log_stream, "ECCODES WARNING : %s\n", mess); + if (level == GRIB_LOG_INFO) + fprintf(c->log_stream, "ECCODES INFO : %s\n", mess); + + if (level == GRIB_LOG_FATAL) { + Assert(0); + } - if(getenv("ECCODES_FAIL_IF_LOG_MESSAGE")) - { + if (getenv("ECCODES_FAIL_IF_LOG_MESSAGE")) { long n = atol(getenv("ECCODES_FAIL_IF_LOG_MESSAGE")); - if(n >= 1 && level == GRIB_LOG_ERROR) Assert(0); - if(n >= 2 && level == GRIB_LOG_WARNING) Assert(0); + if (n >= 1 && level == GRIB_LOG_ERROR) + Assert(0); + if (n >= 2 && level == GRIB_LOG_WARNING) + Assert(0); } } @@ -230,19 +242,19 @@ static void default_print(const grib_context* c, void* descriptor, const char* m void grib_context_set_print_proc(grib_context* c, grib_print_proc p) { - c = c ? c : grib_context_get_default(); + c = c ? c : grib_context_get_default(); c->print = p; } void grib_context_set_debug(grib_context* c, int mode) { - c = c ? c : grib_context_get_default(); + c = c ? c : grib_context_get_default(); c->debug = mode; } void grib_context_set_logging_proc(grib_context* c, grib_log_proc p) { - c = c ? c : grib_context_get_default(); + c = c ? c : grib_context_get_default(); c->output_log = p; } @@ -253,7 +265,7 @@ long grib_get_api_version() void grib_print_api_version(FILE* out) { - fprintf(out,"%d.%d.%d", + fprintf(out, "%d.%d.%d", ECCODES_MAJOR_VERSION, ECCODES_MINOR_VERSION, ECCODES_REVISION_VERSION); @@ -271,90 +283,91 @@ const char* grib_get_package_name() #define DEFAULT_FILE_POOL_MAX_OPENED_FILES 200 static grib_context default_grib_context = { - 0, /* inited */ - 0, /* debug */ - 0, /* write_on_fail */ - 0, /* no_abort */ - 0, /* io_buffer_size */ - 0, /* no_big_group_split */ - 0, /* no_spd */ - 0, /* keep_matrix */ - 0, /* grib_definition_files_path */ - 0, /* grib_samples_path */ - 0, /* grib_concept_path */ - 0, /* grib_reader */ - 0, /* user data */ - GRIB_REAL_MODE8, /* real mode for fortran */ + 0, /* inited */ + 0, /* debug */ + 0, /* write_on_fail */ + 0, /* no_abort */ + 0, /* io_buffer_size */ + 0, /* no_big_group_split */ + 0, /* no_spd */ + 0, /* keep_matrix */ + 0, /* grib_definition_files_path */ + 0, /* grib_samples_path */ + 0, /* grib_concept_path */ + 0, /* grib_reader */ + 0, /* user data */ + GRIB_REAL_MODE8, /* real mode for fortran */ #if MANAGE_MEM - &grib_transient_free, /* free_mem */ - &grib_transient_malloc, /* alloc_mem */ - &grib_transient_realloc, /* realloc_mem */ + &grib_transient_free, /* free_mem */ + &grib_transient_malloc, /* alloc_mem */ + &grib_transient_realloc, /* realloc_mem */ - &grib_permanent_free, /* free_persistant_mem */ - &grib_permanent_malloc, /* alloc_persistant_mem */ + &grib_permanent_free, /* free_persistant_mem */ + &grib_permanent_malloc, /* alloc_persistant_mem */ - &grib_buffer_free, /* buffer_free_mem */ - &grib_buffer_malloc, /* buffer_alloc_mem */ - &grib_buffer_realloc, /* buffer_realloc_mem */ + &grib_buffer_free, /* buffer_free_mem */ + &grib_buffer_malloc, /* buffer_alloc_mem */ + &grib_buffer_realloc, /* buffer_realloc_mem */ #else - &default_free, /* free_mem */ - &default_malloc, /* alloc_mem */ - &default_realloc, /* realloc_mem */ + &default_free, /* free_mem */ + &default_malloc, /* alloc_mem */ + &default_realloc, /* realloc_mem */ - &default_long_lasting_free, /* free_persistant_mem */ - &default_long_lasting_malloc, /* alloc_persistant_mem */ + &default_long_lasting_free, /* free_persistant_mem */ + &default_long_lasting_malloc, /* alloc_persistant_mem */ - &default_buffer_free, /* free_buffer_mem */ - &default_buffer_malloc, /* alloc_buffer_mem */ - &default_buffer_realloc, /* realloc_buffer_mem */ + &default_buffer_free, /* free_buffer_mem */ + &default_buffer_malloc, /* alloc_buffer_mem */ + &default_buffer_realloc, /* realloc_buffer_mem */ #endif - &default_read, /* file read procedure */ - &default_write, /* file write procedure */ - &default_tell, /* lfile tell procedure */ - &default_seek, /* lfile seek procedure */ - &default_feof, /* file feof procedure */ - - &default_log, /* output_log */ - &default_print, /* print */ - 0, /* codetable */ - 0, /* smart_table */ - 0, /* outfilename */ - 0, /* multi_support_on */ - 0, /* multi_support */ - 0, /* grib_definition_files_dir */ - 0, /* handle_file_count */ - 0, /* handle_total_count */ - 0, /* message_file_offset */ - 0, /* no_fail_on_wrong_length */ - 0, /* gts_header_on */ - 0, /* gribex_mode_on */ - 0, /* large_constant_fields */ - 0, /* keys */ - 0, /* keys_count */ - 0, /* concepts_index */ - 0, /* concepts_count */ - {0,}, /* concepts */ - 0, /* hash_array_index */ - 0, /* hash_array_count */ - {0,}, /* hash_array */ - 0, /* def_files */ - 0, /* blacklist */ - 0, /* ieee_packing */ - 0, /* bufrdc_mode */ - 0, /* bufr_set_to_missing_if_out_of_range */ - 0, /* bufr_multi_element_constant_arrays */ - 0, /* grib_data_quality_checks */ - 0, /* log_stream */ - 0, /* classes */ - 0, /* lists */ - 0, /* expanded_descriptors */ - DEFAULT_FILE_POOL_MAX_OPENED_FILES /* file_pool_max_opened_files */ + &default_read, /* file read procedure */ + &default_write, /* file write procedure */ + &default_tell, /* lfile tell procedure */ + &default_seek, /* lfile seek procedure */ + &default_feof, /* file feof procedure */ + + &default_log, /* output_log */ + &default_print, /* print */ + 0, /* codetable */ + 0, /* smart_table */ + 0, /* outfilename */ + 0, /* multi_support_on */ + 0, /* multi_support */ + 0, /* grib_definition_files_dir */ + 0, /* handle_file_count */ + 0, /* handle_total_count */ + 0, /* message_file_offset */ + 0, /* no_fail_on_wrong_length */ + 0, /* gts_header_on */ + 0, /* gribex_mode_on */ + 0, /* large_constant_fields */ + 0, /* keys */ + 0, /* keys_count */ + 0, /* concepts_index */ + 0, /* concepts_count */ + {0,}, /* concepts */ + 0, /* hash_array_index */ + 0, /* hash_array_count */ + {0,}, /* hash_array */ + 0, /* def_files */ + 0, /* blacklist */ + 0, /* ieee_packing */ + 0, /* bufrdc_mode */ + 0, /* bufr_set_to_missing_if_out_of_range */ + 0, /* bufr_multi_element_constant_arrays */ + 0, /* grib_data_quality_checks */ + 0, /* log_stream */ + 0, /* classes */ + 0, /* lists */ + 0, /* expanded_descriptors */ + DEFAULT_FILE_POOL_MAX_OPENED_FILES /* file_pool_max_opened_files */ #if GRIB_PTHREADS - ,PTHREAD_MUTEX_INITIALIZER /* mutex */ + , + PTHREAD_MUTEX_INITIALIZER /* mutex */ #endif }; @@ -363,48 +376,47 @@ static grib_context default_grib_context = { grib_context* grib_context_get_default() { - GRIB_MUTEX_INIT_ONCE(&once,&init); + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex_c); - if(!default_grib_context.inited) - { - const char* write_on_fail = NULL; - const char* large_constant_fields = NULL; - const char* no_abort = NULL; - const char* debug = NULL; - const char* gribex = NULL; - const char* ieee_packing = NULL; - const char* io_buffer_size = NULL; - const char* log_stream = NULL; - const char* no_big_group_split = NULL; - const char* no_spd = NULL; - const char* keep_matrix = NULL; - const char* bufrdc_mode = NULL; + if (!default_grib_context.inited) { + const char* write_on_fail = NULL; + const char* large_constant_fields = NULL; + const char* no_abort = NULL; + const char* debug = NULL; + const char* gribex = NULL; + const char* ieee_packing = NULL; + const char* io_buffer_size = NULL; + const char* log_stream = NULL; + const char* no_big_group_split = NULL; + const char* no_spd = NULL; + const char* keep_matrix = NULL; + const char* bufrdc_mode = NULL; const char* bufr_set_to_missing_if_out_of_range = NULL; - const char* bufr_multi_element_constant_arrays = NULL; - const char* grib_data_quality_checks = NULL; - const char* file_pool_max_opened_files = NULL; + const char* bufr_multi_element_constant_arrays = NULL; + const char* grib_data_quality_checks = NULL; + const char* file_pool_max_opened_files = NULL; #ifdef ENABLE_FLOATING_POINT_EXCEPTIONS feenableexcept(FE_ALL_EXCEPT & ~FE_INEXACT); #endif - write_on_fail = codes_getenv("ECCODES_GRIB_WRITE_ON_FAIL"); - bufrdc_mode = getenv("ECCODES_BUFRDC_MODE_ON"); + write_on_fail = codes_getenv("ECCODES_GRIB_WRITE_ON_FAIL"); + bufrdc_mode = getenv("ECCODES_BUFRDC_MODE_ON"); bufr_set_to_missing_if_out_of_range = getenv("ECCODES_BUFR_SET_TO_MISSING_IF_OUT_OF_RANGE"); - bufr_multi_element_constant_arrays = getenv("ECCODES_BUFR_MULTI_ELEMENT_CONSTANT_ARRAYS"); - grib_data_quality_checks = getenv("ECCODES_GRIB_DATA_QUALITY_CHECKS"); - large_constant_fields = codes_getenv("ECCODES_GRIB_LARGE_CONSTANT_FIELDS"); - no_abort = codes_getenv("ECCODES_NO_ABORT"); - debug = codes_getenv("ECCODES_DEBUG"); - gribex = codes_getenv("ECCODES_GRIBEX_MODE_ON"); - ieee_packing = codes_getenv("ECCODES_GRIB_IEEE_PACKING"); - io_buffer_size = codes_getenv("ECCODES_IO_BUFFER_SIZE"); - log_stream = codes_getenv("ECCODES_LOG_STREAM"); - no_big_group_split = codes_getenv("ECCODES_GRIB_NO_BIG_GROUP_SPLIT"); - no_spd = codes_getenv("ECCODES_GRIB_NO_SPD"); - keep_matrix = codes_getenv("ECCODES_GRIB_KEEP_MATRIX"); - file_pool_max_opened_files = getenv("ECCODES_FILE_POOL_MAX_OPENED_FILES"); + bufr_multi_element_constant_arrays = getenv("ECCODES_BUFR_MULTI_ELEMENT_CONSTANT_ARRAYS"); + grib_data_quality_checks = getenv("ECCODES_GRIB_DATA_QUALITY_CHECKS"); + large_constant_fields = codes_getenv("ECCODES_GRIB_LARGE_CONSTANT_FIELDS"); + no_abort = codes_getenv("ECCODES_NO_ABORT"); + debug = codes_getenv("ECCODES_DEBUG"); + gribex = codes_getenv("ECCODES_GRIBEX_MODE_ON"); + ieee_packing = codes_getenv("ECCODES_GRIB_IEEE_PACKING"); + io_buffer_size = codes_getenv("ECCODES_IO_BUFFER_SIZE"); + log_stream = codes_getenv("ECCODES_LOG_STREAM"); + no_big_group_split = codes_getenv("ECCODES_GRIB_NO_BIG_GROUP_SPLIT"); + no_spd = codes_getenv("ECCODES_GRIB_NO_SPD"); + keep_matrix = codes_getenv("ECCODES_GRIB_KEEP_MATRIX"); + file_pool_max_opened_files = getenv("ECCODES_FILE_POOL_MAX_OPENED_FILES"); /* On UNIX, when we read from a file we get exactly what is in the file on disk. * But on Windows a file can be opened in binary or text mode. In binary mode the system behaves exactly as in UNIX. @@ -413,36 +425,38 @@ grib_context* grib_context_get_default() _set_fmode(_O_BINARY); #endif - default_grib_context.inited = 1; - default_grib_context.io_buffer_size = io_buffer_size ? atoi(io_buffer_size) : 0; - default_grib_context.no_big_group_split = no_big_group_split ? atoi(no_big_group_split) : 0; - default_grib_context.no_spd = no_spd ? atoi(no_spd) : 0; - default_grib_context.keep_matrix = keep_matrix ? atoi(keep_matrix) : 1; - default_grib_context.write_on_fail = write_on_fail ? atoi(write_on_fail) : 0; - default_grib_context.no_abort = no_abort ? atoi(no_abort) : 0; - default_grib_context.debug = debug ? atoi(debug) : 0; - default_grib_context.gribex_mode_on=gribex ? atoi(gribex) : 0; + default_grib_context.inited = 1; + default_grib_context.io_buffer_size = io_buffer_size ? atoi(io_buffer_size) : 0; + default_grib_context.no_big_group_split = no_big_group_split ? atoi(no_big_group_split) : 0; + default_grib_context.no_spd = no_spd ? atoi(no_spd) : 0; + default_grib_context.keep_matrix = keep_matrix ? atoi(keep_matrix) : 1; + default_grib_context.write_on_fail = write_on_fail ? atoi(write_on_fail) : 0; + default_grib_context.no_abort = no_abort ? atoi(no_abort) : 0; + default_grib_context.debug = debug ? atoi(debug) : 0; + default_grib_context.gribex_mode_on = gribex ? atoi(gribex) : 0; default_grib_context.large_constant_fields = large_constant_fields ? atoi(large_constant_fields) : 0; - default_grib_context.ieee_packing=ieee_packing ? atoi(ieee_packing) : 0; - default_grib_context.grib_samples_path = codes_getenv("ECCODES_SAMPLES_PATH"); - default_grib_context.log_stream=stderr; + default_grib_context.ieee_packing = ieee_packing ? atoi(ieee_packing) : 0; + default_grib_context.grib_samples_path = codes_getenv("ECCODES_SAMPLES_PATH"); + default_grib_context.log_stream = stderr; if (!log_stream) { - default_grib_context.log_stream=stderr; - } else if (!strcmp(log_stream,"stderr") ) { - default_grib_context.log_stream=stderr; - } else if (!strcmp(log_stream,"stdout") ) { - default_grib_context.log_stream=stdout; + default_grib_context.log_stream = stderr; + } + else if (!strcmp(log_stream, "stderr")) { + default_grib_context.log_stream = stderr; + } + else if (!strcmp(log_stream, "stdout")) { + default_grib_context.log_stream = stdout; } #ifdef ECCODES_SAMPLES_PATH - if(!default_grib_context.grib_samples_path) - default_grib_context.grib_samples_path = ECCODES_SAMPLES_PATH ; + if (!default_grib_context.grib_samples_path) + default_grib_context.grib_samples_path = ECCODES_SAMPLES_PATH; #endif default_grib_context.grib_definition_files_path = codes_getenv("ECCODES_DEFINITION_PATH"); #ifdef ECCODES_DEFINITION_PATH - if(!default_grib_context.grib_definition_files_path) { - default_grib_context.grib_definition_files_path = ECCODES_DEFINITION_PATH ; + if (!default_grib_context.grib_definition_files_path) { + default_grib_context.grib_definition_files_path = ECCODES_DEFINITION_PATH; } else { /* Temp bug fix when putenv() is called from program that moves getenv() stuff around */ @@ -482,37 +496,33 @@ grib_context* grib_context_get_default() } grib_context_log(&default_grib_context, GRIB_LOG_DEBUG, "Definitions path: %s", - default_grib_context.grib_definition_files_path); + default_grib_context.grib_definition_files_path); grib_context_log(&default_grib_context, GRIB_LOG_DEBUG, "Samples path: %s", - default_grib_context.grib_samples_path); - - default_grib_context.keys_count=0; - default_grib_context.keys=grib_hash_keys_new(&(default_grib_context), - &(default_grib_context.keys_count)); - - default_grib_context.concepts_index=grib_itrie_new(&(default_grib_context), - &(default_grib_context.concepts_count)); - default_grib_context.hash_array_index=grib_itrie_new(&(default_grib_context), - &(default_grib_context.hash_array_count)); - default_grib_context.def_files=grib_trie_new(&(default_grib_context)); - default_grib_context.lists=grib_trie_new(&(default_grib_context)); - default_grib_context.classes=grib_trie_new(&(default_grib_context)); - default_grib_context.bufrdc_mode = bufrdc_mode ? atoi(bufrdc_mode) : 0; - default_grib_context.bufr_set_to_missing_if_out_of_range = bufr_set_to_missing_if_out_of_range ? - atoi(bufr_set_to_missing_if_out_of_range) : 0; - default_grib_context.bufr_multi_element_constant_arrays = bufr_multi_element_constant_arrays ? - atoi(bufr_multi_element_constant_arrays) : 0; - default_grib_context.grib_data_quality_checks = grib_data_quality_checks ? - atoi(grib_data_quality_checks) : 0; - default_grib_context.file_pool_max_opened_files = file_pool_max_opened_files ? - atoi(file_pool_max_opened_files) : DEFAULT_FILE_POOL_MAX_OPENED_FILES; + default_grib_context.grib_samples_path); + + default_grib_context.keys_count = 0; + default_grib_context.keys = grib_hash_keys_new(&(default_grib_context), + &(default_grib_context.keys_count)); + + default_grib_context.concepts_index = grib_itrie_new(&(default_grib_context), + &(default_grib_context.concepts_count)); + default_grib_context.hash_array_index = grib_itrie_new(&(default_grib_context), + &(default_grib_context.hash_array_count)); + default_grib_context.def_files = grib_trie_new(&(default_grib_context)); + default_grib_context.lists = grib_trie_new(&(default_grib_context)); + default_grib_context.classes = grib_trie_new(&(default_grib_context)); + default_grib_context.bufrdc_mode = bufrdc_mode ? atoi(bufrdc_mode) : 0; + default_grib_context.bufr_set_to_missing_if_out_of_range = bufr_set_to_missing_if_out_of_range ? atoi(bufr_set_to_missing_if_out_of_range) : 0; + default_grib_context.bufr_multi_element_constant_arrays = bufr_multi_element_constant_arrays ? atoi(bufr_multi_element_constant_arrays) : 0; + default_grib_context.grib_data_quality_checks = grib_data_quality_checks ? atoi(grib_data_quality_checks) : 0; + default_grib_context.file_pool_max_opened_files = file_pool_max_opened_files ? atoi(file_pool_max_opened_files) : DEFAULT_FILE_POOL_MAX_OPENED_FILES; } GRIB_MUTEX_UNLOCK(&mutex_c); return &default_grib_context; } -#if 0 /* function removed */ +#if 0 /* function removed */ grib_context* grib_context_new(grib_context* parent) { grib_context* c; @@ -566,10 +576,11 @@ static char* resolve_path(grib_context* c, char* path) #ifdef ECCODES_ON_WINDOWS result = grib_context_strdup(c, path); #else - char resolved[DEF_PATH_MAXLEN+1]; + char resolved[DEF_PATH_MAXLEN + 1]; if (!realpath(path, resolved)) { result = grib_context_strdup(c, path); /* Failed to resolve. Use original path */ - } else { + } + else { result = grib_context_strdup(c, resolved); } #endif @@ -578,45 +589,51 @@ static char* resolve_path(grib_context* c, char* path) static int init_definition_files_dir(grib_context* c) { - int err=0; + int err = 0; char path[DEF_PATH_MAXLEN]; - char* p=NULL; - grib_string_list* next=NULL; + char* p = NULL; + grib_string_list* next = NULL; - if (!c) c=grib_context_get_default(); + if (!c) + c = grib_context_get_default(); - if (c->grib_definition_files_dir) return 0; - if (!c->grib_definition_files_path) return GRIB_NO_DEFINITIONS; + if (c->grib_definition_files_dir) + return 0; + if (!c->grib_definition_files_path) + return GRIB_NO_DEFINITIONS; /* Note: strtok modifies its first argument so we copy */ strncpy(path, c->grib_definition_files_path, DEF_PATH_MAXLEN); - GRIB_MUTEX_INIT_ONCE(&once,&init); + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex_c); - p=path; + p = path; - while(*p!=DEFS_PATH_DELIMITER_CHAR && *p!='\0') p++; + while (*p != DEFS_PATH_DELIMITER_CHAR && *p != '\0') + p++; if (*p != DEFS_PATH_DELIMITER_CHAR) { /* No delimiter found so this is a single directory */ - c->grib_definition_files_dir=(grib_string_list*)grib_context_malloc_clear_persistent(c,sizeof(grib_string_list)); + c->grib_definition_files_dir = (grib_string_list*)grib_context_malloc_clear_persistent(c, sizeof(grib_string_list)); c->grib_definition_files_dir->value = resolve_path(c, path); - } else { + } + else { /* Definitions path contains multiple directories */ - char* dir=NULL; - dir=strtok(path, DEFS_PATH_DELIMITER_STR); + char* dir = NULL; + dir = strtok(path, DEFS_PATH_DELIMITER_STR); while (dir != NULL) { if (next) { - next->next=(grib_string_list*)grib_context_malloc_clear_persistent(c,sizeof(grib_string_list)); - next=next->next; - } else { - c->grib_definition_files_dir=(grib_string_list*)grib_context_malloc_clear_persistent(c,sizeof(grib_string_list)); - next=c->grib_definition_files_dir; + next->next = (grib_string_list*)grib_context_malloc_clear_persistent(c, sizeof(grib_string_list)); + next = next->next; + } + else { + c->grib_definition_files_dir = (grib_string_list*)grib_context_malloc_clear_persistent(c, sizeof(grib_string_list)); + next = c->grib_definition_files_dir; } next->value = resolve_path(c, dir); - dir=strtok(NULL, DEFS_PATH_DELIMITER_STR); + dir = strtok(NULL, DEFS_PATH_DELIMITER_STR); } } @@ -625,103 +642,110 @@ static int init_definition_files_dir(grib_context* c) return err; } -char *grib_context_full_defs_path(grib_context* c,const char* basename) +char* grib_context_full_defs_path(grib_context* c, const char* basename) { - int err=0; - char full[1024]={0,}; - grib_string_list* dir=NULL; - grib_string_list* fullpath=0; - if (!c) c=grib_context_get_default(); + int err = 0; + char full[1024] = {0,}; + grib_string_list* dir = NULL; + grib_string_list* fullpath = 0; + if (!c) + c = grib_context_get_default(); - GRIB_MUTEX_INIT_ONCE(&once,&init); + GRIB_MUTEX_INIT_ONCE(&once, &init); - if(*basename == '/' || *basename == '.') { + if (*basename == '/' || *basename == '.') { return (char*)basename; - } else { - GRIB_MUTEX_LOCK(&mutex_c); /* See ECC-604 */ - fullpath=(grib_string_list*)grib_trie_get(c->def_files,basename); + } + else { + GRIB_MUTEX_LOCK(&mutex_c); /* See ECC-604 */ + fullpath = (grib_string_list*)grib_trie_get(c->def_files, basename); GRIB_MUTEX_UNLOCK(&mutex_c); - if (fullpath!=NULL) { + if (fullpath != NULL) { return fullpath->value; } if (!c->grib_definition_files_dir) { - err=init_definition_files_dir(c); + err = init_definition_files_dir(c); } if (err != GRIB_SUCCESS) { - grib_context_log(c,GRIB_LOG_ERROR, - "Unable to find definition files directory"); + grib_context_log(c, GRIB_LOG_ERROR, + "Unable to find definition files directory"); return NULL; } - dir=c->grib_definition_files_dir; + dir = c->grib_definition_files_dir; while (dir) { - sprintf(full,"%s/%s",dir->value,basename); - if (!codes_access(full,F_OK)) { - fullpath=(grib_string_list*)grib_context_malloc_clear_persistent(c,sizeof(grib_string_list)); + sprintf(full, "%s/%s", dir->value, basename); + if (!codes_access(full, F_OK)) { + fullpath = (grib_string_list*)grib_context_malloc_clear_persistent(c, sizeof(grib_string_list)); Assert(fullpath); - fullpath->value=grib_context_strdup(c,full); + fullpath->value = grib_context_strdup(c, full); GRIB_MUTEX_LOCK(&mutex_c); - grib_trie_insert(c->def_files,basename,fullpath); - grib_context_log(c,GRIB_LOG_DEBUG,"Found def file %s",full); + grib_trie_insert(c->def_files, basename, fullpath); + grib_context_log(c, GRIB_LOG_DEBUG, "Found def file %s", full); GRIB_MUTEX_UNLOCK(&mutex_c); return fullpath->value; } - dir=dir->next; + dir = dir->next; } } GRIB_MUTEX_LOCK(&mutex_c); /* Store missing files so we don't check for them again and again */ - grib_trie_insert(c->def_files,basename,&grib_file_not_found); + grib_trie_insert(c->def_files, basename, &grib_file_not_found); /*grib_context_log(c,GRIB_LOG_ERROR,"Def file \"%s\" not found",basename);*/ GRIB_MUTEX_UNLOCK(&mutex_c); - full[0]=0; + full[0] = 0; return NULL; } -char* grib_samples_path(const grib_context *c) +char* grib_samples_path(const grib_context* c) { - if (!c) c=grib_context_get_default(); + if (!c) + c = grib_context_get_default(); return c->grib_samples_path; } -char* grib_definition_path(const grib_context *c) +char* grib_definition_path(const grib_context* c) { - if (!c) c=grib_context_get_default(); + if (!c) + c = grib_context_get_default(); return c->grib_definition_files_path; } void grib_context_free(const grib_context* c, void* p) { - if (!c) c=grib_context_get_default(); - if(p) c->free_mem(c,p); + if (!c) + c = grib_context_get_default(); + if (p) + c->free_mem(c, p); } void grib_context_free_persistent(const grib_context* c, void* p) { - if (!c) c=grib_context_get_default(); - if(p) c->free_persistent_mem(c,p); + if (!c) + c = grib_context_get_default(); + if (p) + c->free_persistent_mem(c, p); } void grib_context_reset(grib_context* c) { - if (!c) c=grib_context_get_default(); + if (!c) + c = grib_context_get_default(); - if(c->grib_reader) - { - grib_action_file *fr = c->grib_reader->first; - grib_action_file *fn = fr; + if (c->grib_reader) { + grib_action_file* fr = c->grib_reader->first; + grib_action_file* fn = fr; grib_action* a; - while(fn){ + while (fn) { fr = fn; fn = fn->next; a = fr->root; - while(a) - { - grib_action *na = a->next; + while (a) { + grib_action* na = a->next; grib_action_delete(c, a); a = na; } @@ -729,45 +753,48 @@ void grib_context_reset(grib_context* c) grib_context_free_persistent(c, fr); } grib_context_free_persistent(c, c->grib_reader); - } c->grib_reader = NULL; - if(c->codetable) grib_codetable_delete(c); + if (c->codetable) + grib_codetable_delete(c); c->codetable = NULL; - if(c->smart_table) grib_smart_table_delete(c); + if (c->smart_table) + grib_smart_table_delete(c); c->smart_table = NULL; - if(c->grib_definition_files_dir) - grib_context_free(c,c->grib_definition_files_dir); + if (c->grib_definition_files_dir) + grib_context_free(c, c->grib_definition_files_dir); - if(c->multi_support_on) + if (c->multi_support_on) grib_multi_support_reset(c); - } -void grib_context_delete( grib_context* c) +void grib_context_delete(grib_context* c) { - if (!c) c=grib_context_get_default(); + if (!c) + c = grib_context_get_default(); - grib_hash_keys_delete( c->keys); + grib_hash_keys_delete(c->keys); grib_trie_delete(c->def_files); - grib_context_reset( c ); - if(c != &default_grib_context) - grib_context_free_persistent(&default_grib_context,c); + grib_context_reset(c); + if (c != &default_grib_context) + grib_context_free_persistent(&default_grib_context, c); } void codes_bufr_multi_element_constant_arrays_on(grib_context* c) { - if ( !c ) c=grib_context_get_default(); + if (!c) + c = grib_context_get_default(); c->bufr_multi_element_constant_arrays = 1; } void codes_bufr_multi_element_constant_arrays_off(grib_context* c) { - if ( !c ) c=grib_context_get_default(); + if (!c) + c = grib_context_get_default(); c->bufr_multi_element_constant_arrays = 0; } /*int codes_get_bufr_multi_element_constant_arrays(grib_context* c);*/ @@ -775,8 +802,9 @@ void codes_bufr_multi_element_constant_arrays_off(grib_context* c) void grib_context_set_definitions_path(grib_context* c, const char* path) { - if (!c) c=grib_context_get_default(); - GRIB_MUTEX_INIT_ONCE(&once,&init); + if (!c) + c = grib_context_get_default(); + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex_c); c->grib_definition_files_path = strdup(path); @@ -786,91 +814,103 @@ void grib_context_set_definitions_path(grib_context* c, const char* path) } void grib_context_set_samples_path(grib_context* c, const char* path) { - if (!c) c=grib_context_get_default(); - GRIB_MUTEX_INIT_ONCE(&once,&init); + if (!c) + c = grib_context_get_default(); + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex_c); c->grib_samples_path = strdup(path); - grib_context_log(c, GRIB_LOG_DEBUG, "Samples path changed to: %s", c->grib_samples_path); + grib_context_log(c, GRIB_LOG_DEBUG, "Samples path changed to: %s", c->grib_samples_path); GRIB_MUTEX_UNLOCK(&mutex_c); } void* grib_context_malloc_persistent(const grib_context* c, size_t size) { - void* p = c->alloc_persistent_mem(c,size); - if(!p) { - grib_context_log(c,GRIB_LOG_FATAL, - "grib_context_malloc_persistent: error allocating %lu bytes",(unsigned long)size); + void* p = c->alloc_persistent_mem(c, size); + if (!p) { + grib_context_log(c, GRIB_LOG_FATAL, + "grib_context_malloc_persistent: error allocating %lu bytes", (unsigned long)size); Assert(0); } return p; } -char* grib_context_strdup_persistent(const grib_context* c,const char* s) +char* grib_context_strdup_persistent(const grib_context* c, const char* s) { - char *dup = (char*)grib_context_malloc_persistent(c,(strlen(s)*sizeof(char))+1); - if(dup) strcpy(dup,s); + char* dup = (char*)grib_context_malloc_persistent(c, (strlen(s) * sizeof(char)) + 1); + if (dup) + strcpy(dup, s); return dup; } void* grib_context_malloc_clear_persistent(const grib_context* c, size_t size) { - void *p = grib_context_malloc_persistent(c,size); - if(p) memset(p,0,size); + void* p = grib_context_malloc_persistent(c, size); + if (p) + memset(p, 0, size); return p; } void* grib_context_malloc(const grib_context* c, size_t size) { void* p = NULL; - if (!c) c=grib_context_get_default(); - if(size == 0) return p; - else p=c->alloc_mem(c,size); - if(!p) { - grib_context_log(c,GRIB_LOG_FATAL,"grib_context_malloc: error allocating %lu bytes",(unsigned long)size); + if (!c) + c = grib_context_get_default(); + if (size == 0) + return p; + else + p = c->alloc_mem(c, size); + if (!p) { + grib_context_log(c, GRIB_LOG_FATAL, "grib_context_malloc: error allocating %lu bytes", (unsigned long)size); Assert(0); } return p; } -void* grib_context_realloc(const grib_context* c, void *p,size_t size) +void* grib_context_realloc(const grib_context* c, void* p, size_t size) { void* q; - if (!c) c=grib_context_get_default(); - q=c->realloc_mem(c,p,size); - if(!q) { - grib_context_log(c,GRIB_LOG_FATAL,"grib_context_realloc: error allocating %lu bytes",(unsigned long)size); + if (!c) + c = grib_context_get_default(); + q = c->realloc_mem(c, p, size); + if (!q) { + grib_context_log(c, GRIB_LOG_FATAL, "grib_context_realloc: error allocating %lu bytes", (unsigned long)size); return NULL; } return q; } -char* grib_context_strdup(const grib_context* c,const char* s) +char* grib_context_strdup(const grib_context* c, const char* s) { - char *dup=0; + char* dup = 0; if (s) { - dup = (char*)grib_context_malloc(c,(strlen(s)*sizeof(char))+1); - if(dup) strcpy(dup,s); + dup = (char*)grib_context_malloc(c, (strlen(s) * sizeof(char)) + 1); + if (dup) + strcpy(dup, s); } return dup; } void* grib_context_malloc_clear(const grib_context* c, size_t size) { - void *p = grib_context_malloc(c,size); - if(p) memset(p,0,size); + void* p = grib_context_malloc(c, size); + if (p) + memset(p, 0, size); return p; } void* grib_context_buffer_malloc(const grib_context* c, size_t size) { void* p = NULL; - if (!c) c=grib_context_get_default(); - if(size == 0) return p; - else p=c->alloc_buffer_mem(c,size); - if(!p) { - grib_context_log(c,GRIB_LOG_FATAL,"grib_context_buffer_malloc: error allocating %lu bytes",(unsigned long)size); + if (!c) + c = grib_context_get_default(); + if (size == 0) + return p; + else + p = c->alloc_buffer_mem(c, size); + if (!p) { + grib_context_log(c, GRIB_LOG_FATAL, "grib_context_buffer_malloc: error allocating %lu bytes", (unsigned long)size); return NULL; } return p; @@ -878,15 +918,17 @@ void* grib_context_buffer_malloc(const grib_context* c, size_t size) void grib_context_buffer_free(const grib_context* c, void* p) { - if (!c) c=grib_context_get_default(); - if(p) c->free_buffer_mem(c,p); + if (!c) + c = grib_context_get_default(); + if (p) + c->free_buffer_mem(c, p); } -void* grib_context_buffer_realloc(const grib_context* c, void *p,size_t size) +void* grib_context_buffer_realloc(const grib_context* c, void* p, size_t size) { - void* q=c->realloc_buffer_mem(c,p,size); - if(!q) { - grib_context_log(c,GRIB_LOG_FATAL,"grib_context_buffer_realloc: error allocating %lu bytes",(unsigned long)size); + void* q = c->realloc_buffer_mem(c, p, size); + if (!q) { + grib_context_log(c, GRIB_LOG_FATAL, "grib_context_buffer_realloc: error allocating %lu bytes", (unsigned long)size); return NULL; } return q; @@ -894,32 +936,33 @@ void* grib_context_buffer_realloc(const grib_context* c, void *p,size_t size) void* grib_context_buffer_malloc_clear(const grib_context* c, size_t size) { - void *p = grib_context_buffer_malloc(c,size); - if(p) memset(p,0,size); + void* p = grib_context_buffer_malloc(c, size); + if (p) + memset(p, 0, size); return p; } -void grib_context_set_memory_proc(grib_context* c, grib_malloc_proc m, grib_free_proc f,grib_realloc_proc r) +void grib_context_set_memory_proc(grib_context* c, grib_malloc_proc m, grib_free_proc f, grib_realloc_proc r) { - c->free_mem = f; - c->alloc_mem = m; + c->free_mem = f; + c->alloc_mem = m; c->realloc_mem = r; } void grib_context_set_persistent_memory_proc(grib_context* c, grib_malloc_proc m, grib_free_proc f) { - c->free_persistent_mem = f; + c->free_persistent_mem = f; c->alloc_persistent_mem = m; } -void grib_context_set_buffer_memory_proc(grib_context* c, grib_malloc_proc m, grib_free_proc f,grib_realloc_proc r) +void grib_context_set_buffer_memory_proc(grib_context* c, grib_malloc_proc m, grib_free_proc f, grib_realloc_proc r) { - c->free_buffer_mem = f; - c->alloc_buffer_mem = m; + c->free_buffer_mem = f; + c->alloc_buffer_mem = m; c->realloc_buffer_mem = r; } -void grib_context_set_data_accessing_proc(grib_context* c, grib_data_read_proc read, grib_data_write_proc write, grib_data_tell_proc tell) +void grib_context_set_data_accessing_proc(grib_context* c, grib_data_read_proc read, grib_data_write_proc write, grib_data_tell_proc tell) { c->read = read; c->write = write; @@ -927,137 +970,140 @@ void grib_context_set_data_accessing_proc(grib_context* c, grib_data_read_proc r } /* Logging procedure */ -void grib_context_log(const grib_context *c,int level, const char* fmt, ...) +void grib_context_log(const grib_context* c, int level, const char* fmt, ...) { /* Save some CPU */ - if( (level == GRIB_LOG_DEBUG && c->debug<1) || - (level == GRIB_LOG_WARNING && c->debug<2) ) - { + if ((level == GRIB_LOG_DEBUG && c->debug < 1) || + (level == GRIB_LOG_WARNING && c->debug < 2)) { return; } - else - { + else { char msg[1024]; va_list list; - va_start(list,fmt); + va_start(list, fmt); vsprintf(msg, fmt, list); va_end(list); - if(level & GRIB_LOG_PERROR) - { + if (level & GRIB_LOG_PERROR) { level = level & ~GRIB_LOG_PERROR; /* #if HAS_STRERROR */ #if 1 - strcat(msg," ("); - strcat(msg,strerror(errno)); - strcat(msg,")"); + strcat(msg, " ("); + strcat(msg, strerror(errno)); + strcat(msg, ")"); #else - if(errno > 0 && errno < sys_nerr) - { - strcat(msg," ("); - strcat(msg,sys_errlist[errno]); - strcat(msg," )"); + if (errno > 0 && errno < sys_nerr) { + strcat(msg, " ("); + strcat(msg, sys_errlist[errno]); + strcat(msg, " )"); } #endif } - if(c->output_log) - c->output_log(c,level,msg); + if (c->output_log) + c->output_log(c, level, msg); } } /* Logging procedure */ -void grib_context_print(const grib_context *c, void* descriptor,const char* fmt, ...) +void grib_context_print(const grib_context* c, void* descriptor, const char* fmt, ...) { char msg[1024]; va_list list; - va_start(list,fmt); + va_start(list, fmt); vsprintf(msg, fmt, list); va_end(list); - c->print(c,descriptor,msg); + c->print(c, descriptor, msg); } -int grib_context_get_handle_file_count(grib_context *c) +int grib_context_get_handle_file_count(grib_context* c) { int r = 0; - if (!c) c=grib_context_get_default(); - GRIB_MUTEX_INIT_ONCE(&once,&init); + if (!c) + c = grib_context_get_default(); + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex_c); r = c->handle_file_count; GRIB_MUTEX_UNLOCK(&mutex_c); return r; } -int grib_context_get_handle_total_count(grib_context *c) +int grib_context_get_handle_total_count(grib_context* c) { int r = 0; - if (!c) c=grib_context_get_default(); - GRIB_MUTEX_INIT_ONCE(&once,&init); + if (!c) + c = grib_context_get_default(); + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex_c); - r=c->handle_total_count; + r = c->handle_total_count; GRIB_MUTEX_UNLOCK(&mutex_c); return r; } -void grib_context_set_handle_file_count(grib_context *c, int new_count) +void grib_context_set_handle_file_count(grib_context* c, int new_count) { - if (!c) c=grib_context_get_default(); - GRIB_MUTEX_INIT_ONCE(&once,&init); + if (!c) + c = grib_context_get_default(); + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex_c); c->handle_file_count = new_count; GRIB_MUTEX_UNLOCK(&mutex_c); } -void grib_context_set_handle_total_count(grib_context *c, int new_count) +void grib_context_set_handle_total_count(grib_context* c, int new_count) { - if (!c) c=grib_context_get_default(); - GRIB_MUTEX_INIT_ONCE(&once,&init); + if (!c) + c = grib_context_get_default(); + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex_c); c->handle_total_count = new_count; GRIB_MUTEX_UNLOCK(&mutex_c); } -void grib_context_increment_handle_file_count(grib_context *c) +void grib_context_increment_handle_file_count(grib_context* c) { - if (!c) c=grib_context_get_default(); - GRIB_MUTEX_INIT_ONCE(&once,&init); + if (!c) + c = grib_context_get_default(); + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex_c); c->handle_file_count++; GRIB_MUTEX_UNLOCK(&mutex_c); } -void grib_context_increment_handle_total_count(grib_context *c) +void grib_context_increment_handle_total_count(grib_context* c) { - if (!c) c=grib_context_get_default(); - GRIB_MUTEX_INIT_ONCE(&once,&init); + if (!c) + c = grib_context_get_default(); + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex_c); c->handle_total_count++; GRIB_MUTEX_UNLOCK(&mutex_c); } -bufr_descriptors_array* grib_context_expanded_descriptors_list_get(grib_context* c,const char* key,long* u,size_t size) +bufr_descriptors_array* grib_context_expanded_descriptors_list_get(grib_context* c, const char* key, long* u, size_t size) { - bufr_descriptors_map_list* expandedUnexpandedMapList; - size_t i=0; - int found=0; + bufr_descriptors_map_list* expandedUnexpandedMapList; + size_t i = 0; + int found = 0; bufr_descriptors_array* result = NULL; - if (!c) c=grib_context_get_default(); + if (!c) + c = grib_context_get_default(); - GRIB_MUTEX_INIT_ONCE(&once,&init); + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex_c); if (!c->expanded_descriptors) { - c->expanded_descriptors=(grib_trie*)grib_trie_new(c); - result = NULL; + c->expanded_descriptors = (grib_trie*)grib_trie_new(c); + result = NULL; goto the_end; } - expandedUnexpandedMapList=(bufr_descriptors_map_list*)grib_trie_get(c->expanded_descriptors,key); - found=0; + expandedUnexpandedMapList = (bufr_descriptors_map_list*)grib_trie_get(c->expanded_descriptors, key); + found = 0; while (expandedUnexpandedMapList) { - if (expandedUnexpandedMapList->unexpanded->n==size) { - found=1; - for (i=0;iunexpanded->v[i]->code!=u[i]) { - found=0; + if (expandedUnexpandedMapList->unexpanded->n == size) { + found = 1; + for (i = 0; i < size; i++) { + if (expandedUnexpandedMapList->unexpanded->v[i]->code != u[i]) { + found = 0; break; } } @@ -1066,7 +1112,7 @@ bufr_descriptors_array* grib_context_expanded_descriptors_list_get(grib_context* result = expandedUnexpandedMapList->expanded; goto the_end; } - expandedUnexpandedMapList=expandedUnexpandedMapList->next; + expandedUnexpandedMapList = expandedUnexpandedMapList->next; } the_end: GRIB_MUTEX_UNLOCK(&mutex_c); @@ -1074,29 +1120,31 @@ bufr_descriptors_array* grib_context_expanded_descriptors_list_get(grib_context* } void grib_context_expanded_descriptors_list_push(grib_context* c, - const char* key,bufr_descriptors_array* expanded,bufr_descriptors_array* unexpanded) + const char* key, bufr_descriptors_array* expanded, bufr_descriptors_array* unexpanded) { - bufr_descriptors_map_list* descriptorsList=NULL; - bufr_descriptors_map_list* next=NULL; - bufr_descriptors_map_list* newdescriptorsList=NULL; - if (!c) c=grib_context_get_default(); + bufr_descriptors_map_list* descriptorsList = NULL; + bufr_descriptors_map_list* next = NULL; + bufr_descriptors_map_list* newdescriptorsList = NULL; + if (!c) + c = grib_context_get_default(); - GRIB_MUTEX_INIT_ONCE(&once,&init); + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex_c); - newdescriptorsList=(bufr_descriptors_map_list*)grib_context_malloc_clear(c,sizeof(bufr_descriptors_map_list)); - newdescriptorsList->expanded=expanded; - newdescriptorsList->unexpanded=unexpanded; + newdescriptorsList = (bufr_descriptors_map_list*)grib_context_malloc_clear(c, sizeof(bufr_descriptors_map_list)); + newdescriptorsList->expanded = expanded; + newdescriptorsList->unexpanded = unexpanded; - descriptorsList=(bufr_descriptors_map_list*)grib_trie_get(c->expanded_descriptors,key); + descriptorsList = (bufr_descriptors_map_list*)grib_trie_get(c->expanded_descriptors, key); if (descriptorsList) { - next=descriptorsList; - while(next->next) { - next=next->next; + next = descriptorsList; + while (next->next) { + next = next->next; } - next->next=newdescriptorsList; - } else { - grib_trie_insert(c->expanded_descriptors,key,newdescriptorsList); + next->next = newdescriptorsList; + } + else { + grib_trie_insert(c->expanded_descriptors, key, newdescriptorsList); } GRIB_MUTEX_UNLOCK(&mutex_c); } @@ -1113,7 +1161,7 @@ void codes_assertion_failed(const char* message, const char* file, int line) /* Default behaviour is to abort * unless user has supplied his own assertion routine */ if (assertion == NULL) { - grib_context *c = grib_context_get_default(); + grib_context* c = grib_context_get_default(); fprintf(stderr, "ecCodes assertion failed: `%s' in %s:%d\n", message, file, line); if (!c->no_abort) { abort(); @@ -1128,38 +1176,45 @@ void codes_assertion_failed(const char* message, const char* file, int line) int grib_get_gribex_mode(grib_context* c) { - if ( !c ) c=grib_context_get_default(); + if (!c) + c = grib_context_get_default(); return c->gribex_mode_on; } void grib_gribex_mode_on(grib_context* c) { - if ( !c ) c=grib_context_get_default(); - c->gribex_mode_on=1; + if (!c) + c = grib_context_get_default(); + c->gribex_mode_on = 1; } void grib_gribex_mode_off(grib_context* c) { - if ( !c ) c=grib_context_get_default(); - c->gribex_mode_on=0; + if (!c) + c = grib_context_get_default(); + c->gribex_mode_on = 0; } void grib_gts_header_on(grib_context* c) { - if ( !c ) c=grib_context_get_default(); - c->gts_header_on=1; + if (!c) + c = grib_context_get_default(); + c->gts_header_on = 1; } void grib_gts_header_off(grib_context* c) { - if ( !c ) c=grib_context_get_default(); - c->gts_header_on=0; + if (!c) + c = grib_context_get_default(); + c->gts_header_on = 0; } void grib_multi_support_on(grib_context* c) { - if ( !c ) c=grib_context_get_default(); - c->multi_support_on=1; + if (!c) + c = grib_context_get_default(); + c->multi_support_on = 1; } void grib_multi_support_off(grib_context* c) { - if ( !c ) c=grib_context_get_default(); - c->multi_support_on=0; + if (!c) + c = grib_context_get_default(); + c->multi_support_on = 0; } diff --git a/src/grib_darray.c b/src/grib_darray.c index 21f09023d..40f579ddd 100644 --- a/src/grib_darray.c +++ b/src/grib_darray.c @@ -22,99 +22,121 @@ void grib_darray_print(const char* title, const grib_darray* darray) size_t i; Assert(darray); printf("%s: darray.n=%lu \t", title, (unsigned long)darray->n); - for (i=0; in; i++) { + for (i = 0; i < darray->n; i++) { printf("darray[%lu]=%g\t", (unsigned long)i, darray->v[i]); } printf("\n"); } -grib_darray* grib_darray_new_from_array(grib_context* c,double* a,size_t size) +grib_darray* grib_darray_new_from_array(grib_context* c, double* a, size_t size) { size_t i; grib_darray* v; - if (!c) c=grib_context_get_default(); + if (!c) + c = grib_context_get_default(); - v=grib_darray_new(c,size,100); - for (i=0;iv[i]=a[i]; - v->n=size; - v->context=c; + v = grib_darray_new(c, size, 100); + for (i = 0; i < size; i++) + v->v[i] = a[i]; + v->n = size; + v->context = c; return v; } -grib_darray* grib_darray_new(grib_context* c,size_t size,size_t incsize) { - grib_darray* v=NULL; - if (!c) c=grib_context_get_default(); - v=(grib_darray*)grib_context_malloc_clear(c,sizeof(grib_darray)); +grib_darray* grib_darray_new(grib_context* c, size_t size, size_t incsize) +{ + grib_darray* v = NULL; + if (!c) + c = grib_context_get_default(); + v = (grib_darray*)grib_context_malloc_clear(c, sizeof(grib_darray)); if (!v) { - grib_context_log(c,GRIB_LOG_ERROR, - "grib_darray_new unable to allocate %d bytes\n",sizeof(grib_darray)); + grib_context_log(c, GRIB_LOG_ERROR, + "grib_darray_new unable to allocate %d bytes\n", sizeof(grib_darray)); return NULL; } - v->size=size; - v->n=0; - v->incsize=incsize; - v->v=(double*)grib_context_malloc_clear(c,sizeof(double)*size); + v->size = size; + v->n = 0; + v->incsize = incsize; + v->v = (double*)grib_context_malloc_clear(c, sizeof(double) * size); if (!v->v) { - grib_context_log(c,GRIB_LOG_ERROR, - "grib_darray_new unable to allocate %d bytes\n",sizeof(double)*size); + grib_context_log(c, GRIB_LOG_ERROR, + "grib_darray_new unable to allocate %d bytes\n", sizeof(double) * size); return NULL; } return v; } -grib_darray* grib_darray_resize(grib_context* c,grib_darray* v) { - int newsize=v->incsize+v->size; +grib_darray* grib_darray_resize(grib_context* c, grib_darray* v) +{ + int newsize = v->incsize + v->size; - if (!c) c=grib_context_get_default(); + if (!c) + c = grib_context_get_default(); - v->v = (double*)grib_context_realloc(c,v->v,newsize*sizeof(double)); - v->size=newsize; + v->v = (double*)grib_context_realloc(c, v->v, newsize * sizeof(double)); + v->size = newsize; if (!v->v) { - grib_context_log(c,GRIB_LOG_ERROR, - "grib_darray_resize unable to allocate %d bytes\n",sizeof(double)*newsize); + grib_context_log(c, GRIB_LOG_ERROR, + "grib_darray_resize unable to allocate %d bytes\n", sizeof(double) * newsize); return NULL; } return v; } -grib_darray* grib_darray_push(grib_context* c,grib_darray* v,double val) { - size_t start_size=100; - size_t start_incsize=100; - if (!v) v=grib_darray_new(c,start_size,start_incsize); - - if (v->n >= v->size) v=grib_darray_resize(c,v); - v->v[v->n]=val; +grib_darray* grib_darray_push(grib_context* c, grib_darray* v, double val) +{ + size_t start_size = 100; + size_t start_incsize = 100; + if (!v) + v = grib_darray_new(c, start_size, start_incsize); + + if (v->n >= v->size) + v = grib_darray_resize(c, v); + v->v[v->n] = val; v->n++; return v; } -void grib_darray_delete(grib_context* c,grib_darray* v) { - if (!v) return; - if (!c) grib_context_get_default(); - if (v->v) grib_context_free(c,v->v); - grib_context_free(c,v); +void grib_darray_delete(grib_context* c, grib_darray* v) +{ + if (!v) + return; + if (!c) + grib_context_get_default(); + if (v->v) + grib_context_free(c, v->v); + grib_context_free(c, v); } -double* grib_darray_get_array(grib_context* c,grib_darray* v) { +double* grib_darray_get_array(grib_context* c, grib_darray* v) +{ double* ret; int i; - if (!v) return NULL; - ret=(double*)grib_context_malloc_clear(c,sizeof(double)*v->n); - for (i=0;in;i++) ret[i]=v->v[i]; + if (!v) + return NULL; + ret = (double*)grib_context_malloc_clear(c, sizeof(double) * v->n); + for (i = 0; i < v->n; i++) + ret[i] = v->v[i]; return ret; } -int grib_darray_is_constant(grib_darray* v,double eps) { +int grib_darray_is_constant(grib_darray* v, double eps) +{ int i; double val; - if (v->n == 1) return 1; + if (v->n == 1) + return 1; - val=v->v[0]; - for (i=1;in;i++) { - if (fabs(val-v->v[i]) > eps) return 0; + val = v->v[0]; + for (i = 1; i < v->n; i++) { + if (fabs(val - v->v[i]) > eps) + return 0; } return 1; } -size_t grib_darray_used_size(grib_darray* v) { return v->n;} +size_t grib_darray_used_size(grib_darray* v) +{ + return v->n; +} diff --git a/src/grib_date.c b/src/grib_date.c index f7c5441b6..223cf917c 100644 --- a/src/grib_date.c +++ b/src/grib_date.c @@ -14,103 +14,115 @@ ***************************************************************************/ #include "grib_api_internal.h" -#define ROUND(a) ((a) >=0 ? (long)((a)+0.5) : (long) ((a)-0.5)) -int grib_julian_to_datetime(double jd,long *year,long* month,long* day, - long *hour,long *minute,long *second) +#define ROUND(a) ((a) >= 0 ? (long)((a) + 0.5) : (long)((a)-0.5)) +int grib_julian_to_datetime(double jd, long* year, long* month, long* day, + long* hour, long* minute, long* second) { - long z,a,alpha,b,c,d,e; + long z, a, alpha, b, c, d, e; double dday; double f; long s; - jd+=0.5; - z=(long)jd; - f=jd-z; + jd += 0.5; + z = (long)jd; + f = jd - z; - if (z < 2299161) a=z; + if (z < 2299161) + a = z; else { - alpha=(long)((z-1867216.25)/36524.25); - a=z+1+alpha-(long)(((double)alpha)/4); + alpha = (long)((z - 1867216.25) / 36524.25); + a = z + 1 + alpha - (long)(((double)alpha) / 4); } - b=a+1524; - c=(long)((b-122.1)/365.25); - d=(long)(365.25*c); - e=(long)(((double)(b-d))/30.6001); + b = a + 1524; + c = (long)((b - 122.1) / 365.25); + d = (long)(365.25 * c); + e = (long)(((double)(b - d)) / 30.6001); - dday=b-d-(long)(30.6001*e)+f; - *day=(long)dday; - dday-=*day; + dday = b - d - (long)(30.6001 * e) + f; + *day = (long)dday; + dday -= *day; #if 1 /* ANF-CG 02.03.2012 */ - s=ROUND((double)(dday*86400)); /* total in sec , no msec*/ - *hour=(long)s/3600; - *minute=(long)((s % 3600)/60); + s = ROUND((double)(dday * 86400)); /* total in sec , no msec*/ + *hour = (long)s / 3600; + *minute = (long)((s % 3600) / 60); *second = (long)(s % 60); #else /* Old algorithm, now replaced by above. See GRIB-180 */ - dhour=dday*24; - *hour=(long)dhour; - dhour-=*hour; - dminute=dhour*60; - *minute=(long)dminute; - *second=(long)((dminute-*minute)*60); + dhour = dday * 24; + *hour = (long)dhour; + dhour -= *hour; + dminute = dhour * 60; + *minute = (long)dminute; + *second = (long)((dminute - *minute) * 60); #endif - if (e<14) *month=e-1; - else *month=e-13; + if (e < 14) + *month = e - 1; + else + *month = e - 13; - if (*month>2) *year=c-4716; - else *year=c-4715; + if (*month > 2) + *year = c - 4716; + else + *year = c - 4715; return GRIB_SUCCESS; } -int grib_datetime_to_julian(long year,long month,long day, - long hour,long minute,long second,double* jd) +int grib_datetime_to_julian(long year, long month, long day, + long hour, long minute, long second, double* jd) { - return grib_datetime_to_julian_d(year,month,day,hour,minute,second,jd); + return grib_datetime_to_julian_d(year, month, day, hour, minute, second, jd); } /* This version can deal with seconds provided as a double. Supporting milliseconds etc */ int grib_datetime_to_julian_d( - long year,long month,long day,long hour,long minute, - double second, double* jd) + long year, long month, long day, long hour, long minute, + double second, double* jd) { - double a,b,dday; - long y,m; + double a, b, dday; + long y, m; - dday=(double)(hour*3600+minute*60+second)/86400.0+day; + dday = (double)(hour * 3600 + minute * 60 + second) / 86400.0 + day; - if ( month < 3) { - y=year-1; - m=month+12; - } else { - y=year; - m=month; + if (month < 3) { + y = year - 1; + m = month + 12; + } + else { + y = year; + m = month; } - a=(long)(((double)y)/100); + a = (long)(((double)y) / 100); - if ( y > 1582 ) b=2-a+(long)(a/4); + if (y > 1582) + b = 2 - a + (long)(a / 4); else if (y == 1582) { - if (m > 10) b=2-a+(long)(a/4); + if (m > 10) + b = 2 - a + (long)(a / 4); else if (m == 10) { - if (day >14) b=2-a+(long)(a/4); - else b=0; + if (day > 14) + b = 2 - a + (long)(a / 4); + else + b = 0; } - else b=0; + else + b = 0; } - else b=0; + else + b = 0; - *jd=(long)(365.25*(y+4716))+ (long)(30.6001*(m+1))+dday+b-1524.5; + *jd = (long)(365.25 * (y + 4716)) + (long)(30.6001 * (m + 1)) + dday + b - 1524.5; return GRIB_SUCCESS; } long grib_julian_to_date(long jdate) { - long x,y,d,m,e; - long day,month,year; + long x, y, d, m, e; + long day, month, year; x = 4 * jdate - 6884477; y = (x / 146097) * 100; @@ -127,12 +139,12 @@ long grib_julian_to_date(long jdate) e = x % 153; d = e / 5 + 1; - if( m < 11 ) + if (m < 11) month = m + 2; else month = m - 10; - day = d; + day = d; year = y + m / 11; return year * 10000 + month * 100 + day; @@ -140,37 +152,35 @@ long grib_julian_to_date(long jdate) long grib_date_to_julian(long ddate) { - long m1,y1,a,b,c,d,j1; + long m1, y1, a, b, c, d, j1; - long month,day,year; + long month, day, year; /*Asserts(ddate > 0);*/ year = ddate / 10000; ddate %= 10000; - month = ddate / 100; + month = ddate / 100; ddate %= 100; day = ddate; /* if (year < 100) year = year + 1900; */ - if (month > 2) - { + if (month > 2) { m1 = month - 3; y1 = year; } - else - { + else { m1 = month + 9; y1 = year - 1; } - a = 146097*(y1/100)/4; - d = y1 % 100; - b = 1461*d/4; - c = (153*m1+2)/5+day+1721119; - j1 = a+b+c; + a = 146097 * (y1 / 100) / 4; + d = y1 % 100; + b = 1461 * d / 4; + c = (153 * m1 + 2) / 5 + day + 1721119; + j1 = a + b + c; - return(j1); + return (j1); } /* diff --git a/src/grib_db.c b/src/grib_db.c index 5931522d7..ebba058ab 100644 --- a/src/grib_db.c +++ b/src/grib_db.c @@ -17,821 +17,928 @@ #define GRIB_START_ARRAY_SIZE 5000 #define GRIB_ARRAY_INCREMENT 1000 -#define SWAP(a,b) temp=(a);(a)=(b);(b)=temp; +#define SWAP(a, b) \ + temp = (a); \ + (a) = (b); \ + (b) = temp; -#define GRIB_ORDER_BY_ASC 1 -#define GRIB_ORDER_BY_DESC -1 +#define GRIB_ORDER_BY_ASC 1 +#define GRIB_ORDER_BY_DESC -1 /* Note: A fast cut-down version of strcmp which does NOT return -1 */ /* 0 means input strings are equal and 1 means not equal */ -GRIB_INLINE static int grib_inline_strcmp(const char* a,const char* b) { - if (*a != *b) return 1; - while((*a!=0 && *b!=0) && *(a) == *(b) ) {a++;b++;} - return (*a==0 && *b==0) ? 0 : 1; +GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b) +{ + if (*a != *b) + return 1; + while ((*a != 0 && *b != 0) && *(a) == *(b)) { + a++; + b++; + } + return (*a == 0 && *b == 0) ? 0 : 1; } -static int grib_db_new_column(grib_db* db,int id,char* key,int type); +static int grib_db_new_column(grib_db* db, int id, char* key, int type); static void grib_db_delete_columns(grib_db* db); -static int grib_db_columns_resize(grib_db* db,size_t newsize); -static int grib_db_column_copy_from_handle(grib_handle* h,grib_db* db,int i); -static grib_db* grib_db_create_from_keys(grib_context* c,char** keys,int nkeys,int* err); +static int grib_db_columns_resize(grib_db* db, size_t newsize); +static int grib_db_column_copy_from_handle(grib_handle* h, grib_db* db, int i); +static grib_db* grib_db_create_from_keys(grib_context* c, char** keys, int nkeys, int* err); static void grib_fieldset* grib_db_fieldset_create(grib_db* db, int* err); -static int grib_fieldset_compare(grib_fieldset* set,int* i,int* j); +static int grib_fieldset_compare(grib_fieldset* set, int* i, int* j); static void grib_db_sort(grib_set* set, int beg, int theEnd); -static grib_order_by* grib_db_new_order_by(grib_context* c,char* obstr); -static void grib_db_delete_order_by(grib_context* c,grib_order_by* order_by); -static int grib_db_resize(grib_db* db,size_t newsize); -static int grib_db_resize_fields(grib_db* db,size_t newsize); +static grib_order_by* grib_db_new_order_by(grib_context* c, char* obstr); +static void grib_db_delete_order_by(grib_context* c, grib_order_by* order_by); +static int grib_db_resize(grib_db* db, size_t newsize); +static int grib_db_resize_fields(grib_db* db, size_t newsize); /* --------------- grib_column functions ------------------*/ -static int grib_db_new_column(grib_db* db,int id,char* key,int type) { - grib_column* column=0; - grib_context* c; - int err=0; - - if (!db) return GRIB_INVALID_ARGUMENT; - - c=db->context; +static int grib_db_new_column(grib_db* db, int id, char* key, int type) +{ + grib_column* column = 0; + grib_context* c; + int err = 0; + + if (!db) + return GRIB_INVALID_ARGUMENT; + + c = db->context; + + db->columns[id].errors = (int*)grib_context_malloc(c, + sizeof(int) * GRIB_START_ARRAY_SIZE); + + switch (type) { + case GRIB_TYPE_LONG: + db->columns[id].long_values = (long*)grib_context_malloc(c, + sizeof(long) * GRIB_START_ARRAY_SIZE); + if (!db->columns[id].long_values) { + grib_context_log(c, GRIB_LOG_ERROR, + "grib_db_new_column : Cannot malloc %d bytes", + sizeof(long) * GRIB_START_ARRAY_SIZE); + err = GRIB_OUT_OF_MEMORY; + return err; + } + break; + case GRIB_TYPE_DOUBLE: + db->columns[id].double_values = (double*)grib_context_malloc(c, + sizeof(double) * GRIB_START_ARRAY_SIZE); + if (!db->columns[id].double_values) { + grib_context_log(c, GRIB_LOG_ERROR, + "grib_db_new_column : Cannot malloc %d bytes", + sizeof(double) * GRIB_START_ARRAY_SIZE); + err = GRIB_OUT_OF_MEMORY; + return err; + } + break; + case GRIB_TYPE_STRING: + db->columns[id].string_values = (char**)grib_context_malloc(c, + sizeof(char*) * GRIB_START_ARRAY_SIZE); + if (!db->columns[id].string_values) { + grib_context_log(c, GRIB_LOG_ERROR, + "grib_db_new_column : Cannot malloc %d bytes", + sizeof(char*) * GRIB_START_ARRAY_SIZE); + err = GRIB_OUT_OF_MEMORY; + return err; + } + break; + default: + grib_context_log(c, GRIB_LOG_ERROR, + "grib_db_new_column : unknown column type %d", type); + grib_context_free(c, column); + return err; + } - db->columns[id].errors=(int*)grib_context_malloc(c, - sizeof(int)*GRIB_START_ARRAY_SIZE); + db->columns[id].context = c; + db->columns[id].name = strdup(key); + db->columns[id].type = type; + db->columns[id].values_array_size = GRIB_START_ARRAY_SIZE; + db->columns[id].size = 0; + return err; +} - switch (type) { - case GRIB_TYPE_LONG: - db->columns[id].long_values=(long*)grib_context_malloc(c, - sizeof(long)*GRIB_START_ARRAY_SIZE); - if (!db->columns[id].long_values) { - grib_context_log(c, GRIB_LOG_ERROR, - "grib_db_new_column : Cannot malloc %d bytes", - sizeof(long)*GRIB_START_ARRAY_SIZE); - err=GRIB_OUT_OF_MEMORY; - return err; - } - break; - case GRIB_TYPE_DOUBLE: - db->columns[id].double_values=(double*)grib_context_malloc(c, - sizeof(double)*GRIB_START_ARRAY_SIZE); - if (!db->columns[id].double_values) { - grib_context_log(c, GRIB_LOG_ERROR, - "grib_db_new_column : Cannot malloc %d bytes", - sizeof(double)*GRIB_START_ARRAY_SIZE); - err=GRIB_OUT_OF_MEMORY; - return err; - } - break; - case GRIB_TYPE_STRING: - db->columns[id].string_values=(char**)grib_context_malloc(c, - sizeof(char*)*GRIB_START_ARRAY_SIZE); - if (!db->columns[id].string_values) { - grib_context_log(c, GRIB_LOG_ERROR, - "grib_db_new_column : Cannot malloc %d bytes", - sizeof(char*)*GRIB_START_ARRAY_SIZE); - err=GRIB_OUT_OF_MEMORY; - return err; - } - break; - default: - grib_context_log(c, GRIB_LOG_ERROR, - "grib_db_new_column : unknown column type %d",type); - grib_context_free(c,column); - return err; - } - - db->columns[id].context=c; - db->columns[id].name=strdup(key); - db->columns[id].type=type; - db->columns[id].values_array_size=GRIB_START_ARRAY_SIZE; - db->columns[id].size=0; - return err; -} - -static void grib_db_delete_columns(grib_db* db) { - int i=0; - grib_context* c; - - if (!set) return; - c=db->context; - - for (i=0;icolumns_size;i++) { - switch (db->columns[i].type) { - case GRIB_TYPE_LONG: - grib_context_free(c,db->columns[i].long_values); - break; - case GRIB_TYPE_DOUBLE: - grib_context_free(c,db->columns[i].double_values); - break; - case GRIB_TYPE_STRING: - for (i=0;icolumns[i].size;i++) - grib_context_free(c,db->columns[i].string_values[i]); - grib_context_free(c,db->columns[i].string_values); - break; - default: - grib_context_log(c, GRIB_LOG_ERROR, - "grib_db_new_column : unknown column type %d",db->columns[i].type); +static void grib_db_delete_columns(grib_db* db) +{ + int i = 0; + grib_context* c; + + if (!set) + return; + c = db->context; + + for (i = 0; i < db->columns_size; i++) { + switch (db->columns[i].type) { + case GRIB_TYPE_LONG: + grib_context_free(c, db->columns[i].long_values); + break; + case GRIB_TYPE_DOUBLE: + grib_context_free(c, db->columns[i].double_values); + break; + case GRIB_TYPE_STRING: + for (i = 0; i < db->columns[i].size; i++) + grib_context_free(c, db->columns[i].string_values[i]); + grib_context_free(c, db->columns[i].string_values); + break; + default: + grib_context_log(c, GRIB_LOG_ERROR, + "grib_db_new_column : unknown column type %d", db->columns[i].type); + } + grib_context_free(c, db->columns[i].errors); + free(db->columns[i].name); } - grib_context_free(c,db->columns[i].errors); - free(db->columns[i].name); - } - grib_context_free(c,db->columns); + grib_context_free(c, db->columns); } -static int grib_db_columns_resize(grib_db* db,size_t newsize) { - double* newdoubles; - long* newlongs; - char** newstrings; - int* newerrors; - int i=0; - grib_context* c; - - if (!db || !db->columns) return GRIB_INVALID_ARGUMENT; +static int grib_db_columns_resize(grib_db* db, size_t newsize) +{ + double* newdoubles; + long* newlongs; + char** newstrings; + int* newerrors; + int i = 0; + grib_context* c; + + if (!db || !db->columns) + return GRIB_INVALID_ARGUMENT; + + c = db->context; + + if (newsize <= db->columns[0].values_array_size) + return 0; + + for (i = 0; i < db->columns_size; i++) { + switch (db->columns[i].type) { + case GRIB_TYPE_LONG: + newlongs = (long*)grib_context_realloc(c, db->columns[i].long_values, + newsize * sizeof(long)); + if (!newlongs) { + grib_context_log(c, GRIB_LOG_ERROR, + "grib_db_columns_resize : Cannot malloc %d bytes", newsize - db->columns[i].values_array_size); + return GRIB_OUT_OF_MEMORY; + } + else + db->columns[i].long_values = newlongs; + break; + case GRIB_TYPE_DOUBLE: + newdoubles = (double*)grib_context_realloc(c, db->columns[i].double_values, + newsize * sizeof(double)); + if (!newdoubles) { + grib_context_log(c, GRIB_LOG_ERROR, + "grib_db_columns_resize : Cannot malloc %d bytes", newsize - db->columns[i].values_array_size); + return GRIB_OUT_OF_MEMORY; + } + else + db->columns[i].double_values = newdoubles; + break; + case GRIB_TYPE_STRING: + newstrings = (char**)grib_context_realloc(c, db->columns[i].string_values, + newsize * sizeof(char*)); + if (!newstrings) { + grib_context_log(c, GRIB_LOG_ERROR, + "grib_db_columns_resize : Cannot malloc %d bytes", newsize - db->columns[i].values_array_size); + return GRIB_OUT_OF_MEMORY; + } + else + db->columns[i].string_values = newstrings; + break; + } + newerrors = (int*)grib_context_realloc(c, db->columns[i].errors, newsize * sizeof(int)); + if (!newerrors) { + grib_context_log(c, GRIB_LOG_ERROR, + "grib_db_columns_resize : Cannot malloc %d bytes", + db->columns[i].errors, newsize * sizeof(int)); + return GRIB_OUT_OF_MEMORY; + } + else + db->columns[i].errors = newerrors; + + db->columns[i].values_array_size = newsize; + } - c=db->context; + return GRIB_SUCCESS; +} - if (newsize <= db->columns[0].values_array_size) return 0; +static int grib_db_column_copy_from_handle(grib_handle* h, grib_db* db, int i) +{ + int err = 0; + long lval = 0; + double dval = 0; + char sval[1024]; + size_t slen = 1024; + if (!db || !h || db->columns[i].type == 0) + return GRIB_INVALID_ARGUMENT; - for (i=0;icolumns_size;i++) { + if (db->columns[i].size >= db->columns[i].values_array_size) + grib_db_columns_resize(db, db->columns[i].values_array_size + GRIB_ARRAY_INCREMENT); switch (db->columns[i].type) { - case GRIB_TYPE_LONG: - newlongs=(long*)grib_context_realloc(c,db->columns[i].long_values, - newsize*sizeof(long)); - if (!newlongs ) { - grib_context_log(c, GRIB_LOG_ERROR, - "grib_db_columns_resize : Cannot malloc %d bytes",newsize-db->columns[i].values_array_size); - return GRIB_OUT_OF_MEMORY; - } else db->columns[i].long_values=newlongs; - break; - case GRIB_TYPE_DOUBLE: - newdoubles=(double*)grib_context_realloc(c,db->columns[i].double_values, - newsize*sizeof(double)); - if (!newdoubles) { - grib_context_log(c, GRIB_LOG_ERROR, - "grib_db_columns_resize : Cannot malloc %d bytes",newsize-db->columns[i].values_array_size); - return GRIB_OUT_OF_MEMORY; - } else db->columns[i].double_values=newdoubles; - break; - case GRIB_TYPE_STRING: - newstrings=(char**)grib_context_realloc(c,db->columns[i].string_values, - newsize*sizeof(char*)); - if (!newstrings) { - grib_context_log(c, GRIB_LOG_ERROR, - "grib_db_columns_resize : Cannot malloc %d bytes",newsize-db->columns[i].values_array_size); - return GRIB_OUT_OF_MEMORY; - } else db->columns[i].string_values=newstrings; - break; + case GRIB_TYPE_LONG: + err = grib_get_long(h, db->columns[i].name, &lval); + db->columns[i].long_values[db->columns[i].size] = lval; + break; + case GRIB_TYPE_DOUBLE: + err = grib_get_double(h, db->columns[i].name, &dval); + db->columns[i].double_values[db->columns[i].size] = dval; + break; + case GRIB_TYPE_STRING: + err = grib_get_string(h, db->columns[i].name, sval, &slen); + db->columns[i].string_values[db->columns[i].size] = strdup(sval); + break; } - newerrors=(int*)grib_context_realloc(c,db->columns[i].errors,newsize*sizeof(int)); - if (!newerrors) { - grib_context_log(c, GRIB_LOG_ERROR, - "grib_db_columns_resize : Cannot malloc %d bytes", - db->columns[i].errors,newsize*sizeof(int)); - return GRIB_OUT_OF_MEMORY; - } else db->columns[i].errors=newerrors; - - db->columns[i].values_array_size=newsize; - - } - - return GRIB_SUCCESS; -} - -static int grib_db_column_copy_from_handle(grib_handle* h,grib_db* db,int i) { - int err=0; - long lval=0; - double dval=0; - char sval[1024]; - size_t slen=1024; - if (!db || !h || db->columns[i].type == 0) - return GRIB_INVALID_ARGUMENT; - - if (db->columns[i].size >= db->columns[i].values_array_size) - grib_db_columns_resize(db,db->columns[i].values_array_size+GRIB_ARRAY_INCREMENT); - - switch (db->columns[i].type) { - case GRIB_TYPE_LONG: - err=grib_get_long(h,db->columns[i].name,&lval); - db->columns[i].long_values[db->columns[i].size]=lval; - break; - case GRIB_TYPE_DOUBLE: - err=grib_get_double(h,db->columns[i].name,&dval); - db->columns[i].double_values[db->columns[i].size]=dval; - break; - case GRIB_TYPE_STRING: - err=grib_get_string(h,db->columns[i].name,sval,&slen); - db->columns[i].string_values[db->columns[i].size]=strdup(sval); - break; - } - - db->columns[i].errors[db->columns[i].size]=err; - db->columns[i].size++; - - return err; + + db->columns[i].errors[db->columns[i].size] = err; + db->columns[i].size++; + + return err; } /* --------------- grib_db functions ------------------*/ -grib_db* grib_db_new_from_files(grib_context* c,char* filenames[], -int nfiles, char** keys,int nkeys,int* err) { - int i=0; - int ret=GRIB_SUCCESS; +grib_db* grib_db_new_from_files(grib_context* c, char* filenames[], + int nfiles, char** keys, int nkeys, int* err) +{ + int i = 0; + int ret = GRIB_SUCCESS; - grib_db* db=0; + grib_db* db = 0; - if (!c) c=grib_context_get_default( ); + if (!c) + c = grib_context_get_default(); - if (( (!keys || nkeys==0) ) || !filenames ) { - *err=GRIB_INVALID_ARGUMENT; - return NULL; - } + if (((!keys || nkeys == 0)) || !filenames) { + *err = GRIB_INVALID_ARGUMENT; + return NULL; + } - db=grib_db_new_from_file(c,filenames[0],keys,nkeys,err); - if (!db || err != GRIB_SUCCESS) return db; + db = grib_db_new_from_file(c, filenames[0], keys, nkeys, err); + if (!db || err != GRIB_SUCCESS) + return db; - *err=GRIB_SUCCESS; - for (i=1;icontext=c; - db->size=0; - db->fields_array_size=size; - db->fields=0; - db->columns=0; + db->context = c; + db->size = 0; + db->fields_array_size = size; + db->fields = 0; + db->columns = 0; - db->fields=grib_db_create_fields(db->context,size); + db->fields = grib_db_create_fields(db->context, size); - db->columns=(grib_column*)grib_context_malloc(c,sizeof(grib_column)*nkeys); - if (!set->columns) { - grib_context_log(c,GRIB_LOG_ERROR,"grib_db_new_query: memory allocation error"); - *err=GRIB_OUT_OF_MEMORY; - return NULL; - } - for (i=0;icolumns = (grib_column*)grib_context_malloc(c, sizeof(grib_column) * nkeys); + if (!set->columns) { + grib_context_log(c, GRIB_LOG_ERROR, "grib_db_new_query: memory allocation error"); + *err = GRIB_OUT_OF_MEMORY; + return NULL; + } + for (i = 0; i < nkeys; i++) { + char* key = strdup(keys[i]); + char* p = key; + while (*p != ':' && *p != '\0') + p++; + if (*p == ':') { + type = grib_type_to_int(*(p + 1)); + *p = '\0'; + } + else { + type = default_type; + } + *err = grib_db_new_column(db, i, key, type); + free(key); + } - db->columns_size=nkeys; + db->columns_size = nkeys; - return db; + return db; } -void grib_db_delete(grib_db* db) { - grib_context* c=0; - if (!db) return; +void grib_db_delete(grib_db* db) +{ + grib_context* c = 0; + if (!db) + return; - c=set->context; + c = set->context; - grib_db_delete_columns(db); + grib_db_delete_columns(db); - grib_db_delete_fields(db); + grib_db_delete_fields(db); - grib_context_free( c, db); + grib_context_free(c, db); } -grib_query* grib_db_new_query(grib_context* c,const char* where_string, - const char* order_by_string) { - grib_query* q=0; +grib_query* grib_db_new_query(grib_context* c, const char* where_string, + const char* order_by_string) +{ + grib_query* q = 0; - if (!c) grib_context_get_default( ); + if (!c) + grib_context_get_default(); - q=(grib_query*)grib_context_malloc(c,sizeof(grib_query)); + q = (grib_query*)grib_context_malloc(c, sizeof(grib_query)); - q->where_string=0; - q->order_by=0; + q->where_string = 0; + q->order_by = 0; - if (where_string) q->where_string=strdup(where_string); + if (where_string) + q->where_string = strdup(where_string); - if (order_by_string) { - q->order_by=grib_db_new_order_by(set->context,(char*)order_by_string); - if ((err=grib_db_set_order_by(set,ob)) != GRIB_SUCCESS) - return q; - } + if (order_by_string) { + q->order_by = grib_db_new_order_by(set->context, (char*)order_by_string); + if ((err = grib_db_set_order_by(set, ob)) != GRIB_SUCCESS) + return q; + } - return q; + return q; } -grib_fieldset* grib_db_execute(grib_db* db,grib_query* query,int* err) { - grib_fieldset* set=NULL; - - if (!db) { - *err=GRIB_INVALID_ARGUMENT; - return NULL; - } - set= grib_db_fieldset_create(db,err); - if (*err!=GRIB_SUCCESS) return set; +grib_fieldset* grib_db_execute(grib_db* db, grib_query* query, int* err) +{ + grib_fieldset* set = NULL; - set->query=query; + if (!db) { + *err = GRIB_INVALID_ARGUMENT; + return NULL; + } + set = grib_db_fieldset_create(db, err); + if (*err != GRIB_SUCCESS) + return set; - *err=grib_db_apply_where(set,query->where_string); - if (*err!=GRIB_SUCCESS) return set; + set->query = query; - *err=grib_db_apply_order_by(set,query->order_by); - if (*err!=GRIB_SUCCESS) return set; + *err = grib_db_apply_where(set, query->where_string); + if (*err != GRIB_SUCCESS) + return set; - return set; + *err = grib_db_apply_order_by(set, query->order_by); + if (*err != GRIB_SUCCESS) + return set; + return set; } -static void grib_fieldset* grib_db_fieldset_create(grib_db* db, int* err) { - grib_fieldset* set=(grib_fieldset*)grib_context_malloc(db->context, - sizeof(grib_fieldset)); +static void grib_fieldset* grib_db_fieldset_create(grib_db* db, int* err) +{ + grib_fieldset* set = (grib_fieldset*)grib_context_malloc(db->context, + sizeof(grib_fieldset)); - if (!set) { - *err=GRIB_OUT_OF_MEMORY; - return NULL; - } + if (!set) { + *err = GRIB_OUT_OF_MEMORY; + return NULL; + } - set->db=db; - set->context=db->context; - set->grib_query=NULL; - set->size=0; - set->filter=NULL; - set->order=NULL; + set->db = db; + set->context = db->context; + set->grib_query = NULL; + set->size = 0; + set->filter = NULL; + set->order = NULL; - return set; + return set; } -int grib_db_apply_where(grib_fieldset* set) { - int err=GRIB_SUCCESS; - grib_math* m=0; +int grib_db_apply_where(grib_fieldset* set) +{ + int err = GRIB_SUCCESS; + grib_math* m = 0; - if (!set) return GRIB_INVALID_ARGUMENT; + if (!set) + return GRIB_INVALID_ARGUMENT; - /* + /* m=grib_math_new(set->context,where_string,&err); print_math(m); printf("\n"); */ - if (set->filter) grib_db_delete_int_array(set->filter); - set->filter=grib_db_create_int_array(set->context,db->size); + if (set->filter) + grib_db_delete_int_array(set->filter); + set->filter = grib_db_create_int_array(set->context, db->size); - if (set->order) grib_db_delete_int_array(set->order); - set->order=grib_db_create_int_array(set->context,db->size); + if (set->order) + grib_db_delete_int_array(set->order); + set->order = grib_db_create_int_array(set->context, db->size); - for (i=0;isize;i++) set->filter[i]=i; + for (i = 0; i < db->size; i++) + set->filter[i] = i; - return err; + return err; } -int grib_db_apply_order_by(grib_fieldset* set) { - int err=0; - grib_order_by* ob=NULL; +int grib_db_apply_order_by(grib_fieldset* set) +{ + int err = 0; + grib_order_by* ob = NULL; - if (!set || !set->query) return GRIB_INVALID_ARGUMENT; + if (!set || !set->query) + return GRIB_INVALID_ARGUMENT; - if (set->query->order_by) grib_db_sort(set,0,set->size-1); + if (set->query->order_by) + grib_db_sort(set, 0, set->size - 1); - grib_db_rewind(set); + grib_db_rewind(set); - return err; + return err; } -static int grib_fieldset_compare(grib_fieldset* set,int* i,int* j) { - int ret=0; - double d=0; - int idkey=0; - grib_order_by* ob=0; - int ii=0,jj=0; - int *order=0,*filter=0; +static int grib_fieldset_compare(grib_fieldset* set, int* i, int* j) +{ + int ret = 0; + double d = 0; + int idkey = 0; + grib_order_by* ob = 0; + int ii = 0, jj = 0; + int *order = 0, *filter = 0; + + if (!set || !set->order_by) + return GRIB_INVALID_ARGUMENT; + ob = set->query->order_by; + order = set->order->el; + filter = set->filter->el; + + ii = *(set->filter->el + *(order + *i)); + jj = *(set->filter->el + *(order + *j)); + + while (ob) { + idkey = ob->idkey; + switch (set->db->columns[idkey].type) { + case GRIB_TYPE_STRING: + ret = grib_inline_strcmp(set->db->columns[idkey].string_values[ii], + set->db->columns[idkey].string_values[jj]); + break; + + case GRIB_TYPE_DOUBLE: + d = set->db->columns[idkey].double_values[ii] - + set->db->columns[idkey].double_values[jj]; + if (d > 0) + ret = 1; + else if (d == 0) + ret = 0; + else + ret = -1; + break; + + case GRIB_TYPE_LONG: + ret = set->db->columns[idkey].long_values[ii] - + set->db->columns[idkey].long_values[jj]; + break; + default: + return GRIB_INVALID_TYPE; + } + if (ret != 0) { + ret *= ob->mode; + break; + } + ob = ob->next; + } - if (!set || !set->order_by) return GRIB_INVALID_ARGUMENT; - ob=set->query->order_by; - order=set->order->el; - filter=set->filter->el; + return ret; +} - ii=*(set->filter->el+*(order+*i)); - jj=*(set->filter->el+*(order+*j)); +static void grib_db_sort(grib_set* set, int beg, int theEnd) +{ + double temp; + int l = 0, r = 0; + if (theEnd > beg) { + l = beg + 1; + r = theEnd; + while (l < r) { + if (grib_db_compare(set, &l, &beg) <= 0) { + l++; + } + else if (grib_db_compare(set, &r, &beg) >= 0) { + r--; + } + else { + SWAP(set->order->el[l], set->order->el[r]) + } + } + + if (grib_db_compare(set, &l, &beg) < 0) { + SWAP(set->order->el[l], set->order->el[beg]) + l--; + } + else { + l--; + SWAP(set->order->el[l], set->order->el[beg]) + } + + grib_db_sort(set, beg, l); + grib_db_sort(set, r, theEnd); + } +} - while (ob) { - idkey=ob->idkey; - switch (set->db->columns[idkey].type) { - case GRIB_TYPE_STRING: - ret=grib_inline_strcmp(set->db->columns[idkey].string_values[ii], - set->db->columns[idkey].string_values[jj]); - break; +static void grib_db_delete_order_by(grib_context* c, grib_order_by* order_by) +{ + grib_order_by* ob = order_by; - case GRIB_TYPE_DOUBLE: - d=set->db->columns[idkey].double_values[ii]- - set->db->columns[idkey].double_values[jj]; - if (d > 0 ) ret=1; - else if ( d == 0) ret=0; - else ret=-1; - break; + if (!c) + c = grib_context_get_default(); - case GRIB_TYPE_LONG: - ret=set->db->columns[idkey].long_values[ii]- - set->db->columns[idkey].long_values[jj]; - break; - default: - return GRIB_INVALID_TYPE; - } - if (ret!=0) { - ret*=ob->mode; - break; - } - ob=ob->next; - } - - return ret; -} - -static void grib_db_sort(grib_set* set, int beg, int theEnd) { - double temp; - int l=0,r=0; - if (theEnd > beg) { - l = beg + 1; - r = theEnd; - while (l < r) { - if ( grib_db_compare(set,&l,&beg) <= 0 ) { - l++; - } else if(grib_db_compare(set,&r,&beg) >= 0 ) { - r--; - } else { - SWAP(set->order->el[l],set->order->el[r]) - } - } - - if (grib_db_compare(set,&l,&beg) < 0) { - SWAP(set->order->el[l],set->order->el[beg]) - l--; - } else { - l--; - SWAP(set->order->el[l],set->order->el[beg]) - } - - grib_db_sort(set, beg, l); - grib_db_sort(set, r, theEnd); - } -} - -static void grib_db_delete_order_by(grib_context* c,grib_order_by* order_by) { - grib_order_by* ob=order_by; - - if (!c) c=grib_context_get_default(); - - while (order_by) { - if (order_by->key) free(order_by->key); - ob=order_by; - order_by=order_by->next; - grib_context_free( c,ob); - } - - return; -} - -static grib_order_by* grib_db_new_order_by(grib_context* c,char* obstr) { - char *t1=0,*t2=0,*p=0; - int id=0; - char *z=0,*zs=0; - int mode,mode_default=GRIB_ORDER_BY_ASC; - grib_order_by *ob,*sob; - - if (!obstr) return NULL; - - z=strdup(obstr); - zs=z; - grib_trim(&z); - - if (strlen(z)==0) {return 0;} - - ob=(grib_order_by*)grib_context_malloc(c,sizeof(grib_order_by)); - sob=ob; - ob->key=0; - ob->idkey=0; - ob->mode=0; - ob->next=0; - - if (z) t1=strtok(z,","); - - while (t1) { - grib_trim(&t1); - t2=strdup(t1); - p=t2; - while ( *p != ' ' && *p != '\0' ) p++; - mode=mode_default; - if (p != t2) { - while ( *p == ' ' && *p != '\0' ) p++; - if (*p != '\0') { - *(p-1)='\0'; - if (!grib_inline_strcmp(p,"asc")) mode=GRIB_ORDER_BY_ASC; - if (!grib_inline_strcmp(p,"desc")) mode=GRIB_ORDER_BY_DESC; - } - grib_trim(&p); + while (order_by) { + if (order_by->key) + free(order_by->key); + ob = order_by; + order_by = order_by->next; + grib_context_free(c, ob); } - grib_trim(&t2); - id=-1; - t1=strtok(NULL,","); - - if (ob->key) { - ob->next=(grib_order_by*)grib_context_malloc(c,sizeof(grib_order_by)); - ob=ob->next; - ob->key=0; - ob->next=0; - } - ob->mode=mode; - ob->key=t2; - ob->idkey=id; - } - - free(zs); - return sob; -} - -int grib_db_load(grib_db* db,char* filename) { - int ret=GRIB_SUCCESS; - int err=0; - int i=0; - grib_handle* h=0; - int nkeys; - grib_file* file; - double offset=0; - long length=0; - grib_context* c=0; - if (!db || !filename ) return GRIB_INVALID_ARGUMENT; - c=db->context; + return; +} + +static grib_order_by* grib_db_new_order_by(grib_context* c, char* obstr) +{ + char *t1 = 0, *t2 = 0, *p = 0; + int id = 0; + char *z = 0, *zs = 0; + int mode, mode_default = GRIB_ORDER_BY_ASC; + grib_order_by *ob, *sob; + + if (!obstr) + return NULL; + + z = strdup(obstr); + zs = z; + grib_trim(&z); - nkeys=db->columns_size; + if (strlen(z) == 0) { + return 0; + } + + ob = (grib_order_by*)grib_context_malloc(c, sizeof(grib_order_by)); + sob = ob; + ob->key = 0; + ob->idkey = 0; + ob->mode = 0; + ob->next = 0; + + if (z) + t1 = strtok(z, ","); + + while (t1) { + grib_trim(&t1); + t2 = strdup(t1); + p = t2; + while (*p != ' ' && *p != '\0') + p++; + mode = mode_default; + if (p != t2) { + while (*p == ' ' && *p != '\0') + p++; + if (*p != '\0') { + *(p - 1) = '\0'; + if (!grib_inline_strcmp(p, "asc")) + mode = GRIB_ORDER_BY_ASC; + if (!grib_inline_strcmp(p, "desc")) + mode = GRIB_ORDER_BY_DESC; + } + grib_trim(&p); + } + grib_trim(&t2); + id = -1; + t1 = strtok(NULL, ","); + + if (ob->key) { + ob->next = (grib_order_by*)grib_context_malloc(c, sizeof(grib_order_by)); + ob = ob->next; + ob->key = 0; + ob->next = 0; + } + ob->mode = mode; + ob->key = t2; + ob->idkey = id; + } - file=grib_file_open(filename,"r",&err); - if (!file || !file->handle) return err; + free(zs); + return sob; +} - while((h = grib_handle_new_from_file(c,file->handle,&err)) - != NULL || ret != GRIB_SUCCESS ) { - if (!h) return ret; +int grib_db_load(grib_db* db, char* filename) +{ + int ret = GRIB_SUCCESS; + int err = 0; + int i = 0; + grib_handle* h = 0; + int nkeys; + grib_file* file; + double offset = 0; + long length = 0; + grib_context* c = 0; + + if (!db || !filename) + return GRIB_INVALID_ARGUMENT; + c = db->context; + + nkeys = db->columns_size; + + file = grib_file_open(filename, "r", &err); + if (!file || !file->handle) + return err; - err=GRIB_SUCCESS; - for (i=0;icolumns_size;i++) { - err=grib_db_column_copy_from_handle(h,db,i); - if (err != GRIB_SUCCESS) ret=err; - } - if (err==GRIB_SUCCESS || err==GRIB_NOT_FOUND) { - if (db->fields_array_size < db->columns[0].values_array_size) { - ret=grib_db_resize(db,db->columns[0].values_array_size); - if (ret!=GRIB_SUCCESS) return ret; - } - offset=0; - ret=grib_get_double(h,"offset",&offset); - db->fields[db->size]=(grib_field*)grib_context_malloc(c,sizeof(grib_field)); - db->fields[db->size]->file=file; - file->refcount++; - db->fields[db->size]->offset=(off_t)offset; - ret=grib_get_long(h,"totalLength",&length); - db->fields[db->size]->length=length; - db->size=set->columns[0].size; - } - grib_handle_delete(h); - } - if (h) grib_handle_delete(h); + while ((h = grib_handle_new_from_file(c, file->handle, &err)) != NULL || ret != GRIB_SUCCESS) { + if (!h) + return ret; + + err = GRIB_SUCCESS; + for (i = 0; i < db->columns_size; i++) { + err = grib_db_column_copy_from_handle(h, db, i); + if (err != GRIB_SUCCESS) + ret = err; + } + if (err == GRIB_SUCCESS || err == GRIB_NOT_FOUND) { + if (db->fields_array_size < db->columns[0].values_array_size) { + ret = grib_db_resize(db, db->columns[0].values_array_size); + if (ret != GRIB_SUCCESS) + return ret; + } + offset = 0; + ret = grib_get_double(h, "offset", &offset); + db->fields[db->size] = (grib_field*)grib_context_malloc(c, sizeof(grib_field)); + db->fields[db->size]->file = file; + file->refcount++; + db->fields[db->size]->offset = (off_t)offset; + ret = grib_get_long(h, "totalLength", &length); + db->fields[db->size]->length = length; + db->size = set->columns[0].size; + } + grib_handle_delete(h); + } + if (h) + grib_handle_delete(h); - grib_file_close(file->name, 0, &err); + grib_file_close(file->name, 0, &err); - return ret; + return ret; } -static int grib_db_resize(grib_db* db,size_t newsize) { - int err=0; +static int grib_db_resize(grib_db* db, size_t newsize) +{ + int err = 0; - err=grib_db_resize_fields(db,newsize); - if (err != 0) return err; + err = grib_db_resize_fields(db, newsize); + if (err != 0) + return err; - set->fields_array_size=newsize; + set->fields_array_size = newsize; - return GRIB_SUCCESS; + return GRIB_SUCCESS; } -void grib_db_rewind(grib_fieldset* set) { - if (set) set->current=0; +void grib_db_rewind(grib_fieldset* set) +{ + if (set) + set->current = 0; } -grib_handle* grib_db_next_handle(grib_fieldset* set,int* err) { - grib_handle* h; - *err=GRIB_SUCCESS; - h=grib_db_retrieve(set,set->current,err); - if (*err==GRIB_SUCCESS) { - set->current++; - } - return h; +grib_handle* grib_db_next_handle(grib_fieldset* set, int* err) +{ + grib_handle* h; + *err = GRIB_SUCCESS; + h = grib_db_retrieve(set, set->current, err); + if (*err == GRIB_SUCCESS) { + set->current++; + } + return h; } -int grib_db_count(grib_fieldset* set) { - return set->size; +int grib_db_count(grib_fieldset* set) +{ + return set->size; } -grib_handle* grib_db_retrieve(grib_fieldset* set,int i,int* err) { - grib_handle* h=0; - grib_field* field=0; - *err=GRIB_SUCCESS; - if ( !set ) { - *err=GRIB_INVALID_ARGUMENT; - return NULL; - } - if (i >= set->size) return NULL; +grib_handle* grib_db_retrieve(grib_fieldset* set, int i, int* err) +{ + grib_handle* h = 0; + grib_field* field = 0; + *err = GRIB_SUCCESS; + if (!set) { + *err = GRIB_INVALID_ARGUMENT; + return NULL; + } + if (i >= set->size) + return NULL; - field=set->db->fields[set->filter->el[set->order->el[i]]]; - grib_file_open(field->file->name,"r",err); - if (*err!=GRIB_SUCCESS) return NULL; + field = set->db->fields[set->filter->el[set->order->el[i]]]; + grib_file_open(field->file->name, "r", err); + if (*err != GRIB_SUCCESS) + return NULL; - fseeko(field->file->handle,field->offset,SEEK_SET); - h=grib_handle_new_from_file(set->context,field->file->handle,err); - if (*err!=GRIB_SUCCESS) return NULL; + fseeko(field->file->handle, field->offset, SEEK_SET); + h = grib_handle_new_from_file(set->context, field->file->handle, err); + if (*err != GRIB_SUCCESS) + return NULL; - grib_file_close(field->file->name, 0, err); + grib_file_close(field->file->name, 0, err); - return h; + return h; } -static grib_int_array* grib_db_create_int_array(grib_context* c,size_t size) { - grib_int_array* a; - int i=0; +static grib_int_array* grib_db_create_int_array(grib_context* c, size_t size) +{ + grib_int_array* a; + int i = 0; - if (!c) c=grib_context_get_default(); + if (!c) + c = grib_context_get_default(); - a=(grib_int_array*)grib_context_malloc(c,sizeof(grib_int_array)); + a = (grib_int_array*)grib_context_malloc(c, sizeof(grib_int_array)); - if (!a) { - grib_context_log(c, GRIB_LOG_ERROR, - "grib_db_create_int_array : Cannot malloc %d bytes", - sizeof(grib_int_array)); - return NULL; - } + if (!a) { + grib_context_log(c, GRIB_LOG_ERROR, + "grib_db_create_int_array : Cannot malloc %d bytes", + sizeof(grib_int_array)); + return NULL; + } - a->el=(int*)grib_context_malloc(c,sizeof(int)*size); - if (!a->el) { - grib_context_log(c, GRIB_LOG_ERROR, - "grib_db_create_int_array : Cannot malloc %d bytes", - sizeof(int)*size); - return NULL; - } + a->el = (int*)grib_context_malloc(c, sizeof(int) * size); + if (!a->el) { + grib_context_log(c, GRIB_LOG_ERROR, + "grib_db_create_int_array : Cannot malloc %d bytes", + sizeof(int) * size); + return NULL; + } - a->size=size; - a->context=c; - for (i=0;iel[i]=i; + a->size = size; + a->context = c; + for (i = 0; i < size; i++) + a->el[i] = i; - return a; + return a; } -static int grib_db_resize_int_array(grib_int_array* a,size_t newsize) { - int* el; - int err=0; - if (!a) return GRIB_INVALID_ARGUMENT; - - newsize=newsize*sizeof(int); - - el=(int*)grib_context_realloc(a->context,a->el,newsize); - if (!el) { - grib_context_log(a->context, GRIB_LOG_ERROR, - "grib_db_resize_int_array : Cannot malloc %d bytes", - newsize); - return GRIB_OUT_OF_MEMORY; - } else a->el=el; - a->size=newsize; - return err; +static int grib_db_resize_int_array(grib_int_array* a, size_t newsize) +{ + int* el; + int err = 0; + if (!a) + return GRIB_INVALID_ARGUMENT; + + newsize = newsize * sizeof(int); + + el = (int*)grib_context_realloc(a->context, a->el, newsize); + if (!el) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "grib_db_resize_int_array : Cannot malloc %d bytes", + newsize); + return GRIB_OUT_OF_MEMORY; + } + else + a->el = el; + a->size = newsize; + return err; } static void grib_db_delete_int_array(grib_int_array* f) { - grib_context* c = NULL; + grib_context* c = NULL; - if (!f) return; - c = f->context; - - grib_context_free(c,f->el); - grib_context_free(c,f); + if (!f) + return; + c = f->context; + grib_context_free(c, f->el); + grib_context_free(c, f); } -static grib_field** grib_db_create_fields(grib_context* c,size_t size) { - int i=0; - grib_field** fields=(grib_field**)grib_context_malloc(c,size*sizeof(grib_field*)); - if (!fields) return NULL; - for (i=0;icontext,set->fields,newsize*sizeof(grib_field*)); - if (!fields) { - grib_context_log(set->context, GRIB_LOG_ERROR, - "grib_db_resize_fields : Cannot malloc %d bytes", - newsize*sizeof(grib_field*)); - return GRIB_OUT_OF_MEMORY; - } else db->fields=fields; +static int grib_db_resize_fields(grib_db* db, size_t newsize) +{ + int err = 0; + int i; + grib_field** fields; + if (!db) + return GRIB_INVALID_ARGUMENT; + + fields = (grib_field**)grib_context_realloc(set->context, set->fields, newsize * sizeof(grib_field*)); + if (!fields) { + grib_context_log(set->context, GRIB_LOG_ERROR, + "grib_db_resize_fields : Cannot malloc %d bytes", + newsize * sizeof(grib_field*)); + return GRIB_OUT_OF_MEMORY; + } + else + db->fields = fields; - for (i=set->fields_array_size;ifields[i]=0; + for (i = set->fields_array_size; i < newsize; i++) + db->fields[i] = 0; - db->fields_array_size=newsize; - return err; + db->fields_array_size = newsize; + return err; } -static void grib_db_delete_fields(grib_fieldset* set) { - int i; - for (i=0;isize;i++) { - if (!set->fields[i]) continue; - set->fields[i]->file->refcount--; - grib_context_free(set->context,set->fields[i]); - } - grib_context_free(set->context,set->fields); - +static void grib_db_delete_fields(grib_fieldset* set) +{ + int i; + for (i = 0; i < set->size; i++) { + if (!set->fields[i]) + continue; + set->fields[i]->file->refcount--; + grib_context_free(set->context, set->fields[i]); + } + grib_context_free(set->context, set->fields); } -static void grib_trim(char** x) { - char* p=0; - while (**x == ' ' && **x != '\0' ) (*x)++; - if (**x == '\0') return; - p=(*x)+strlen(*x)-1; - while ( *p == ' ' ) {*p='\0';p--;} - if ( *p == ' ' ) *p='\0'; +static void grib_trim(char** x) +{ + char* p = 0; + while (**x == ' ' && **x != '\0') + (*x)++; + if (**x == '\0') + return; + p = (*x) + strlen(*x) - 1; + while (*p == ' ') { + *p = '\0'; + p--; + } + if (*p == ' ') + *p = '\0'; } -static int grib_db_set_order_by(grib_fieldset* set,grib_order_by* ob) { - grib_order_by* next=ob; - int i=0; - - while(next) { - next->idkey=-1; - for (i=0;icolumns_size; i++) { - if (!grib_inline_strcmp(next->key,set->columns[i].name)) { - next->idkey=i; - break; - } - } - if (next->idkey == -1) { - grib_context_log(set->context,GRIB_LOG_ERROR, - "Unable to apply the order by. Key missing from the fieldset.\n"); - return GRIB_MISSING_KEY; +static int grib_db_set_order_by(grib_fieldset* set, grib_order_by* ob) +{ + grib_order_by* next = ob; + int i = 0; + + while (next) { + next->idkey = -1; + for (i = 0; i < set->columns_size; i++) { + if (!grib_inline_strcmp(next->key, set->columns[i].name)) { + next->idkey = i; + break; + } + } + if (next->idkey == -1) { + grib_context_log(set->context, GRIB_LOG_ERROR, + "Unable to apply the order by. Key missing from the fieldset.\n"); + return GRIB_MISSING_KEY; + } + next = next->next; } - next=next->next; - } - - set->order_by=ob; - return GRIB_SUCCESS; + set->order_by = ob; + return GRIB_SUCCESS; } - diff --git a/src/grib_dependency.c b/src/grib_dependency.c index 736fbf4be..45fc6f4ec 100644 --- a/src/grib_dependency.c +++ b/src/grib_dependency.c @@ -17,52 +17,52 @@ grib_handle* grib_handle_of_accessor(grib_accessor* a) { - if (a->parent==NULL) { + if (a->parent == NULL) { return a->h; - } else { + } + else { return a->parent->h; } } static grib_handle* handle_of(grib_accessor* observed) { - grib_handle *h=NULL; + grib_handle* h = NULL; DebugAssert(observed); /* printf("+++++ %s->parent = %p\n",observed->name,observed->parent); */ /* printf("+++++ %s = %p\n",observed->name,observed); */ /* printf("+++++ h=%p\n",observed->h); */ /* special case for BUFR attributes parentless */ - if (observed->parent==NULL) { + if (observed->parent == NULL) { return observed->h; } h = observed->parent->h; - while(h->main) h = h->main; + while (h->main) + h = h->main; return h; } -void grib_dependency_add(grib_accessor* observer,grib_accessor* observed) +void grib_dependency_add(grib_accessor* observer, grib_accessor* observed) { - grib_handle *h = handle_of(observed); - grib_dependency *d = h->dependencies; - grib_dependency *last = 0; + grib_handle* h = handle_of(observed); + grib_dependency* d = h->dependencies; + grib_dependency* last = 0; /*printf("observe %p %p %s %s\n",(void*)observed,(void*)observer, observed?observed->name:"NULL", observer?observer->name:"NULL");*/ - if(!observer || !observed) - { + if (!observer || !observed) { return; } /* Assert(h == handle_of(observer)); */ /* Check if already in list */ - while(d) - { - if(d->observer == observer && d->observed == observed) + while (d) { + if (d->observer == observer && d->observed == observed) return; last = d; - d = d->next; + d = d->next; } #if 0 @@ -75,7 +75,7 @@ void grib_dependency_add(grib_accessor* observer,grib_accessor* observed) #endif - d = (grib_dependency*)grib_context_malloc_clear(h->context,sizeof(grib_dependency)); + d = (grib_dependency*)grib_context_malloc_clear(h->context, sizeof(grib_dependency)); Assert(d); d->observed = observed; @@ -88,25 +88,22 @@ void grib_dependency_add(grib_accessor* observer,grib_accessor* observed) h->dependencies = d; #endif - if(last) + if (last) last->next = d; else h->dependencies = d; - } void grib_dependency_remove_observed(grib_accessor* observed) { - grib_handle *h = handle_of(observed); - grib_dependency *d = h->dependencies; + grib_handle* h = handle_of(observed); + grib_dependency* d = h->dependencies; /* printf("%s\n",observed->name); */ - while(d) - { - if(d->observed == observed) - { + while (d) { + if (d->observed == observed) { /* TODO: Notify observer...*/ - d->observed = 0;/*printf("grib_dependency_remove_observed %s\n",observed->name); */ + d->observed = 0; /*printf("grib_dependency_remove_observed %s\n",observed->name); */ } d = d->next; } @@ -116,25 +113,22 @@ void grib_dependency_remove_observed(grib_accessor* observed) int grib_dependency_notify_change(grib_accessor* observed) { - grib_handle *h = handle_of(observed); - grib_dependency *d = h->dependencies; - int ret = GRIB_SUCCESS; + grib_handle* h = handle_of(observed); + grib_dependency* d = h->dependencies; + int ret = GRIB_SUCCESS; /*Do a two pass mark&sweep, in case some dependencies are added while we notify*/ - while(d) - { + while (d) { d->run = (d->observed == observed && d->observer != 0); - d = d->next; + d = d->next; } d = h->dependencies; - while(d) - { - if(d->run) - { + while (d) { + if (d->run) { /*printf("grib_dependency_notify_change %s %s %p\n",observed->name,d->observer ? d->observer->name : "?", (void*)d->observer);*/ - if( d->observer && (ret = grib_accessor_notify_change(d->observer,observed)) - != GRIB_SUCCESS) return ret; + if (d->observer && (ret = grib_accessor_notify_change(d->observer, observed)) != GRIB_SUCCESS) + return ret; } d = d->next; } @@ -145,24 +139,21 @@ int grib_dependency_notify_change(grib_accessor* observed) /* See ECC-778 */ int _grib_dependency_notify_change(grib_handle* h, grib_accessor* observed) { - grib_dependency *d = h->dependencies; - int ret = GRIB_SUCCESS; + grib_dependency* d = h->dependencies; + int ret = GRIB_SUCCESS; /*Do a two pass mark&sweep, in case some dependencies are added while we notify*/ - while(d) - { + while (d) { d->run = (d->observed == observed && d->observer != 0); - d = d->next; + d = d->next; } d = h->dependencies; - while(d) - { - if(d->run) - { + while (d) { + if (d->run) { /*printf("grib_dependency_notify_change %s %s %p\n",observed->name,d->observer ? d->observer->name : "?", (void*)d->observer);*/ - if( d->observer && (ret = grib_accessor_notify_change(d->observer,observed)) - != GRIB_SUCCESS) return ret; + if (d->observer && (ret = grib_accessor_notify_change(d->observer, observed)) != GRIB_SUCCESS) + return ret; } d = d->next; } @@ -171,31 +162,29 @@ int _grib_dependency_notify_change(grib_handle* h, grib_accessor* observed) void grib_dependency_remove_observer(grib_accessor* observer) { - grib_handle *h = handle_of(observer); - grib_dependency *d = h->dependencies; + grib_handle* h = handle_of(observer); + grib_dependency* d = h->dependencies; - if (!observer) return; + if (!observer) + return; - while(d) - { - if(d->observer == observer) - { + while (d) { + if (d->observer == observer) { d->observer = 0; } d = d->next; } } -void grib_dependency_observe_expression(grib_accessor* observer,grib_expression* e) +void grib_dependency_observe_expression(grib_accessor* observer, grib_expression* e) { - grib_expression_add_dependency(e,observer); + grib_expression_add_dependency(e, observer); } -void grib_dependency_observe_arguments(grib_accessor* observer,grib_arguments* a) +void grib_dependency_observe_arguments(grib_accessor* observer, grib_arguments* a) { - while(a) - { - grib_dependency_observe_expression(observer,a->expression); + while (a) { + grib_dependency_observe_expression(observer, a->expression); a = a->next; } } diff --git a/src/grib_dumper.c b/src/grib_dumper.c index ebe36bef1..7f7593fd3 100644 --- a/src/grib_dumper.c +++ b/src/grib_dumper.c @@ -14,14 +14,15 @@ #include "grib_api_internal.h" #if GRIB_PTHREADS -static pthread_once_t once = PTHREAD_ONCE_INIT; +static pthread_once_t once = PTHREAD_ONCE_INIT; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; -static void init_mutex() { +static void init_mutex() +{ pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); - pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init(&mutex,&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&mutex, &attr); pthread_mutexattr_destroy(&attr); } #elif GRIB_OMP_THREADS @@ -32,8 +33,7 @@ static void init_mutex() { GRIB_OMP_CRITICAL(lock_dumper_c) { - if (once == 0) - { + if (once == 0) { omp_init_nest_lock(&mutex); once = 1; } @@ -41,48 +41,47 @@ static void init_mutex() } #endif -static void init_dumpers(grib_dumper_class* c,grib_dumper* d) +static void init_dumpers(grib_dumper_class* c, grib_dumper* d) { - GRIB_MUTEX_INIT_ONCE(&once,&init_mutex); + GRIB_MUTEX_INIT_ONCE(&once, &init_mutex); GRIB_MUTEX_LOCK(&mutex); - if(c) { - grib_dumper_class *s = c->super ? *(c->super) : NULL; - if(!c->inited) - { - if(c->init_class) c->init_class(c); + if (c) { + grib_dumper_class* s = c->super ? *(c->super) : NULL; + if (!c->inited) { + if (c->init_class) + c->init_class(c); c->inited = 1; } - init_dumpers(s,d); - if(c->init) c->init(d); + init_dumpers(s, d); + if (c->init) + c->init(d); } GRIB_MUTEX_UNLOCK(&mutex); } void grib_init_dumper(grib_dumper* d) { - init_dumpers(d->cclass,d); + init_dumpers(d->cclass, d); } void grib_dumper_delete(grib_dumper* d) { - grib_dumper_class *c = d->cclass; - grib_context *ctx = d->handle->context; - while(c) - { - grib_dumper_class *s = c->super ? *(c->super) : NULL; - if(c->destroy) c->destroy(d); + grib_dumper_class* c = d->cclass; + grib_context* ctx = d->handle->context; + while (c) { + grib_dumper_class* s = c->super ? *(c->super) : NULL; + if (c->destroy) + c->destroy(d); c = s; } - grib_context_free(ctx,d); + grib_context_free(ctx, d); } -void grib_dump_long(grib_dumper* d, grib_accessor* a, const char* comment) +void grib_dump_long(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_class *c = d->cclass; - while(c) - { - if(c->dump_long) - { + grib_dumper_class* c = d->cclass; + while (c) { + if (c->dump_long) { c->dump_long(d, a, comment); return; } @@ -91,13 +90,11 @@ void grib_dump_long(grib_dumper* d, grib_accessor* a, const char* comment) Assert(0); } -void grib_dump_double(grib_dumper* d,grib_accessor* a,const char* comment) +void grib_dump_double(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_class *c = d->cclass; - while(c) - { - if(c->dump_double) - { + grib_dumper_class* c = d->cclass; + while (c) { + if (c->dump_double) { c->dump_double(d, a, comment); return; } @@ -106,13 +103,11 @@ void grib_dump_double(grib_dumper* d,grib_accessor* a,const char* comment) Assert(0); } -void grib_dump_string(grib_dumper* d,grib_accessor* a,const char* comment) +void grib_dump_string(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_class *c = d->cclass; - while(c) - { - if(c->dump_string) - { + grib_dumper_class* c = d->cclass; + while (c) { + if (c->dump_string) { c->dump_string(d, a, comment); return; } @@ -121,13 +116,11 @@ void grib_dump_string(grib_dumper* d,grib_accessor* a,const char* comment) Assert(0); } -void grib_dump_string_array(grib_dumper* d,grib_accessor* a,const char* comment) +void grib_dump_string_array(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_class *c = d->cclass; - while(c) - { - if(c->dump_string_array) - { + grib_dumper_class* c = d->cclass; + while (c) { + if (c->dump_string_array) { c->dump_string_array(d, a, comment); return; } @@ -136,13 +129,11 @@ void grib_dump_string_array(grib_dumper* d,grib_accessor* a,const char* comment Assert(0); } -void grib_dump_label(grib_dumper* d,grib_accessor* a,const char* comment) +void grib_dump_label(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_class *c = d->cclass; - while(c) - { - if(c->dump_label) - { + grib_dumper_class* c = d->cclass; + while (c) { + if (c->dump_label) { c->dump_label(d, a, comment); return; } @@ -151,13 +142,11 @@ void grib_dump_label(grib_dumper* d,grib_accessor* a,const char* comment) Assert(0); } -void grib_dump_bytes(grib_dumper* d,grib_accessor* a,const char* comment) +void grib_dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_class *c = d->cclass; - while(c) - { - if(c->dump_bytes) - { + grib_dumper_class* c = d->cclass; + while (c) { + if (c->dump_bytes) { c->dump_bytes(d, a, comment); return; } @@ -166,13 +155,11 @@ void grib_dump_bytes(grib_dumper* d,grib_accessor* a,const char* comment) Assert(0); } -void grib_dump_bits(grib_dumper* d,grib_accessor* a,const char* comment) +void grib_dump_bits(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_class *c = d->cclass; - while(c) - { - if(c->dump_bits) - { + grib_dumper_class* c = d->cclass; + while (c) { + if (c->dump_bits) { c->dump_bits(d, a, comment); return; } @@ -181,13 +168,11 @@ void grib_dump_bits(grib_dumper* d,grib_accessor* a,const char* comment) Assert(0); } -void grib_dump_section(grib_dumper* d,grib_accessor* a,grib_block_of_accessors* block) +void grib_dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block) { - grib_dumper_class *c = d->cclass; - while(c) - { - if(c->dump_section) - { + grib_dumper_class* c = d->cclass; + while (c) { + if (c->dump_section) { c->dump_section(d, a, block); return; } @@ -196,13 +181,11 @@ void grib_dump_section(grib_dumper* d,grib_accessor* a,grib_block_of_accessors* Assert(0); } -void grib_dump_values(grib_dumper* d,grib_accessor* a) +void grib_dump_values(grib_dumper* d, grib_accessor* a) { - grib_dumper_class *c = d->cclass; - while(c) - { - if(c->dump_values) - { + grib_dumper_class* c = d->cclass; + while (c) { + if (c->dump_values) { c->dump_values(d, a); return; } @@ -211,30 +194,26 @@ void grib_dump_values(grib_dumper* d,grib_accessor* a) Assert(0); } -void grib_dump_header(grib_dumper* d, const grib_handle* ch) +void grib_dump_header(grib_dumper* d, const grib_handle* ch) { - grib_handle* h = (grib_handle*)ch; - grib_dumper_class *c = d->cclass; - while(c) - { - if(c->header) - { - c->header(d,h); + grib_handle* h = (grib_handle*)ch; + grib_dumper_class* c = d->cclass; + while (c) { + if (c->header) { + c->header(d, h); return; } c = c->super ? *(c->super) : NULL; } } -void grib_dump_footer(grib_dumper* d, const grib_handle* ch) +void grib_dump_footer(grib_dumper* d, const grib_handle* ch) { - grib_handle* h = (grib_handle*)ch; - grib_dumper_class *c = d->cclass; - while(c) - { - if(c->footer) - { - c->footer(d,h); + grib_handle* h = (grib_handle*)ch; + grib_dumper_class* c = d->cclass; + while (c) { + if (c->footer) { + c->footer(d, h); return; } c = c->super ? *(c->super) : NULL; diff --git a/src/grib_dumper_class.c b/src/grib_dumper_class.c index c71754735..e97f0f456 100644 --- a/src/grib_dumper_class.c +++ b/src/grib_dumper_class.c @@ -16,27 +16,25 @@ struct table_entry { - char *type; - grib_dumper_class **cclass; + char* type; + grib_dumper_class** cclass; }; -static struct table_entry table[] = -{ - /* This file is generated by ./make_class.pl */ +static struct table_entry table[] = { +/* This file is generated by ./make_class.pl */ #include "grib_dumper_factory.h" }; -#define NUMBER(x) (sizeof(x)/sizeof(x[0])) +#define NUMBER(x) (sizeof(x) / sizeof(x[0])) -grib_dumper* grib_dumper_factory(const char* op, const grib_handle* h, FILE* out, unsigned long option_flags,void* arg) +grib_dumper* grib_dumper_factory(const char* op, const grib_handle* h, FILE* out, unsigned long option_flags, void* arg) { int i; - for(i = 0; i < NUMBER(table) ; i++) - if(strcmp(op,table[i].type) == 0) - { + for (i = 0; i < NUMBER(table); i++) + if (strcmp(op, table[i].type) == 0) { grib_dumper_class* c = *(table[i].cclass); - grib_dumper* d = (grib_dumper*) grib_context_malloc_clear(h->context,c->size); + grib_dumper* d = (grib_dumper*)grib_context_malloc_clear(h->context, c->size); d->depth = 0; d->handle = (grib_handle*)h; d->cclass = c; @@ -44,88 +42,89 @@ grib_dumper* grib_dumper_factory(const char* op, const grib_handle* h, FILE* out d->arg = arg; d->out = out; grib_init_dumper(d); - grib_context_log(h->context,GRIB_LOG_DEBUG,"Creating dumper of type : %s ", op); + grib_context_log(h->context, GRIB_LOG_DEBUG, "Creating dumper of type : %s ", op); return d; } - grib_context_log(h->context,GRIB_LOG_ERROR,"Unknown type : '%s' for dumper", op); + grib_context_log(h->context, GRIB_LOG_ERROR, "Unknown type : '%s' for dumper", op); return NULL; } -void grib_dump_accessors_block(grib_dumper* dumper,grib_block_of_accessors* block) +void grib_dump_accessors_block(grib_dumper* dumper, grib_block_of_accessors* block) { grib_accessor* a = block->first; - while(a) - { - grib_accessor_dump(a,dumper); + while (a) { + grib_accessor_dump(a, dumper); a = a->next; } } -void grib_dump_accessors_list(grib_dumper* dumper,grib_accessors_list* al) +void grib_dump_accessors_list(grib_dumper* dumper, grib_accessors_list* al) { - grib_accessors_list* cur=al; - while(cur) { - grib_accessor_dump(cur->accessor,dumper); + grib_accessors_list* cur = al; + while (cur) { + grib_accessor_dump(cur->accessor, dumper); cur = cur->next; } } -int grib_print(grib_handle* h, const char* name, grib_dumper *d ){ - +int grib_print(grib_handle* h, const char* name, grib_dumper* d) +{ grib_accessor* act = grib_find_accessor(h, name); - if(act){ - grib_accessor_dump(act, d ); - return GRIB_SUCCESS; + if (act) { + grib_accessor_dump(act, d); + return GRIB_SUCCESS; } return GRIB_NOT_FOUND; } -void grib_dump_content(const grib_handle* h, FILE* f,const char* mode,unsigned long flags,void *data) +void grib_dump_content(const grib_handle* h, FILE* f, const char* mode, unsigned long flags, void* data) { - grib_dumper *dumper; - dumper = grib_dumper_factory(mode?mode:"serialize", h, f, flags, data); - grib_dump_header(dumper,h); - grib_dump_accessors_block(dumper,h->root->block); - grib_dump_footer(dumper,h); + grib_dumper* dumper; + dumper = grib_dumper_factory(mode ? mode : "serialize", h, f, flags, data); + grib_dump_header(dumper, h); + grib_dump_accessors_block(dumper, h->root->block); + grib_dump_footer(dumper, h); grib_dumper_delete(dumper); } -void grib_dump_keys(grib_handle* h, FILE* f, const char* mode, unsigned long flags, void *data, const char **keys, size_t num_keys) +void grib_dump_keys(grib_handle* h, FILE* f, const char* mode, unsigned long flags, void* data, const char** keys, size_t num_keys) { size_t i; - grib_accessor* acc = NULL; - grib_dumper* dumper = grib_dumper_factory(mode?mode:"serialize", h, f, flags, data); - for(i=0; icount; - count++; + long count = 1; + if (dumper != NULL) { + count = dumper->count; + count++; } - dumper = grib_dumper_factory(mode?mode:"serialize", h, f, flags, data); - if (!dumper) return NULL; - dumper->count=count; - - grib_dump_header(dumper,h); - grib_dump_accessors_block(dumper,h->root->block); - grib_dump_footer(dumper,h); + dumper = grib_dumper_factory(mode ? mode : "serialize", h, f, flags, data); + if (!dumper) + return NULL; + dumper->count = count; + + grib_dump_header(dumper, h); + grib_dump_accessors_block(dumper, h->root->block); + grib_dump_footer(dumper, h); return dumper; } -void codes_dump_bufr_flat(grib_accessors_list* al,grib_handle* h, FILE* f,const char* mode,unsigned long flags,void *data) +void codes_dump_bufr_flat(grib_accessors_list* al, grib_handle* h, FILE* f, const char* mode, unsigned long flags, void* data) { grib_dumper* dumper = NULL; Assert(h->product_kind == PRODUCT_BUFR); - dumper = grib_dumper_factory(mode?mode:"serialize", h, f, flags, data); - grib_dump_header(dumper,h); - grib_dump_accessors_list(dumper,al); - grib_dump_footer(dumper,h); + dumper = grib_dumper_factory(mode ? mode : "serialize", h, f, flags, data); + grib_dump_header(dumper, h); + grib_dump_accessors_list(dumper, al); + grib_dump_footer(dumper, h); grib_dumper_delete(dumper); } diff --git a/src/grib_dumper_class_bufr_decode_C.c b/src/grib_dumper_class_bufr_decode_C.c index 1bbbac69f..53efe48a9 100644 --- a/src/grib_dumper_class_bufr_decode_C.c +++ b/src/grib_dumper_class_bufr_decode_C.c @@ -42,52 +42,53 @@ or edit "dumper.class" and rerun ./make_class.pl */ -static void init_class (grib_dumper_class*); -static int init (grib_dumper* d); -static int destroy (grib_dumper*); -static void dump_long (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_bits (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_double (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_string (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_string_array (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_bytes (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_values (grib_dumper* d, grib_accessor* a); -static void dump_label (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_section (grib_dumper* d, grib_accessor* a,grib_block_of_accessors* block); -static void header (grib_dumper*,grib_handle*); -static void footer (grib_dumper*,grib_handle*); - -typedef struct grib_dumper_bufr_decode_C { - grib_dumper dumper; -/* Members defined in bufr_decode_C */ - long section_offset; - long empty; - long end; - long isLeaf; - long isAttribute; - grib_string_list* keys; +static void init_class(grib_dumper_class*); +static int init(grib_dumper* d); +static int destroy(grib_dumper*); +static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_bits(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_values(grib_dumper* d, grib_accessor* a); +static void dump_label(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block); +static void header(grib_dumper*, grib_handle*); +static void footer(grib_dumper*, grib_handle*); + +typedef struct grib_dumper_bufr_decode_C +{ + grib_dumper dumper; + /* Members defined in bufr_decode_C */ + long section_offset; + long empty; + long end; + long isLeaf; + long isAttribute; + grib_string_list* keys; } grib_dumper_bufr_decode_C; static grib_dumper_class _grib_dumper_class_bufr_decode_C = { - 0, /* super */ - "bufr_decode_C", /* name */ - sizeof(grib_dumper_bufr_decode_C), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - &destroy, /* free mem */ - &dump_long, /* dump long */ - &dump_double, /* dump double */ - &dump_string, /* dump string */ - &dump_string_array, /* dump string array */ - &dump_label, /* dump labels */ - &dump_bytes, /* dump bytes */ - &dump_bits, /* dump bits */ - &dump_section, /* dump section */ - &dump_values, /* dump values */ - &header, /* header */ - &footer, /* footer */ + 0, /* super */ + "bufr_decode_C", /* name */ + sizeof(grib_dumper_bufr_decode_C), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + &destroy, /* free mem */ + &dump_long, /* dump long */ + &dump_double, /* dump double */ + &dump_string, /* dump string */ + &dump_string_array, /* dump string array */ + &dump_label, /* dump labels */ + &dump_bytes, /* dump bytes */ + &dump_bits, /* dump bits */ + &dump_section, /* dump section */ + &dump_values, /* dump values */ + &header, /* header */ + &footer, /* footer */ }; grib_dumper_class* grib_dumper_class_bufr_decode_C = &_grib_dumper_class_bufr_decode_C; @@ -99,121 +100,130 @@ static void dump_attributes(grib_dumper* d, grib_accessor* a, const char* prefix /* 0 means input strings are equal and 1 means not equal */ GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b) { - if (*a != *b) return 1; - while((*a!=0 && *b!=0) && *(a) == *(b) ) {a++;b++;} - return (*a==0 && *b==0) ? 0 : 1; + if (*a != *b) + return 1; + while ((*a != 0 && *b != 0) && *(a) == *(b)) { + a++; + b++; + } + return (*a == 0 && *b == 0) ? 0 : 1; } typedef struct string_count string_count; -struct string_count { +struct string_count +{ char* value; int count; string_count* next; }; -static int depth=0; +static int depth = 0; -static void init_class (grib_dumper_class* c){} +static void init_class(grib_dumper_class* c) {} static int init(grib_dumper* d) { - grib_dumper_bufr_decode_C *self = (grib_dumper_bufr_decode_C*)d; - grib_context* c=d->handle->context; - self->section_offset=0; - self->empty=1; - d->count=1; - self->isLeaf=0; - self->isAttribute=0; - self->keys=(grib_string_list*)grib_context_malloc_clear(c,sizeof(grib_string_list)); + grib_dumper_bufr_decode_C* self = (grib_dumper_bufr_decode_C*)d; + grib_context* c = d->handle->context; + self->section_offset = 0; + self->empty = 1; + d->count = 1; + self->isLeaf = 0; + self->isAttribute = 0; + self->keys = (grib_string_list*)grib_context_malloc_clear(c, sizeof(grib_string_list)); return GRIB_SUCCESS; } static int destroy(grib_dumper* d) { - grib_dumper_bufr_decode_C *self = (grib_dumper_bufr_decode_C*)d; - grib_string_list* next=self->keys; - grib_string_list* cur=self->keys; - grib_context* c=d->handle->context; - while(next) { - cur=next; - next=next->next; - grib_context_free(c,cur->value); - grib_context_free(c,cur); + grib_dumper_bufr_decode_C* self = (grib_dumper_bufr_decode_C*)d; + grib_string_list* next = self->keys; + grib_string_list* cur = self->keys; + grib_context* c = d->handle->context; + while (next) { + cur = next; + next = next->next; + grib_context_free(c, cur->value); + grib_context_free(c, cur); } return GRIB_SUCCESS; } static char* dval_to_string(grib_context* c, double v) { - char* sval=(char*)grib_context_malloc_clear(c,sizeof(char)*40); - sprintf(sval,"%.18e",v); + char* sval = (char*)grib_context_malloc_clear(c, sizeof(char) * 40); + sprintf(sval, "%.18e", v); return sval; } static void dump_values(grib_dumper* d, grib_accessor* a) { - grib_dumper_bufr_decode_C *self = (grib_dumper_bufr_decode_C*)d; - double value=0; size_t size = 0; - int err = 0; - int r=0; - long count=0; + grib_dumper_bufr_decode_C* self = (grib_dumper_bufr_decode_C*)d; + double value = 0; + size_t size = 0; + int err = 0; + int r = 0; + long count = 0; char* sval; - grib_context* c=a->context; - grib_handle* h=grib_handle_of_accessor(a); + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) !=0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; if (size <= 1) { - err=grib_unpack_double(a,&value,&size); + err = grib_unpack_double(a, &value, &size); } - self->empty=0; + self->empty = 0; - if (size>1) { - fprintf(self->dumper.out,"\n"); - fprintf(self->dumper.out," free(dValues);\n"); - fprintf(self->dumper.out," dValues = (double*)malloc(%lu*sizeof(double));\n", (unsigned long)size); - fprintf(self->dumper.out," if (!dValues) { fprintf(stderr, \"Failed to allocate memory (dValues).\\n\"); return 1; }\n"); - fprintf(self->dumper.out," size = %lu;\n", (unsigned long)size); + if (size > 1) { + fprintf(self->dumper.out, "\n"); + fprintf(self->dumper.out, " free(dValues);\n"); + fprintf(self->dumper.out, " dValues = (double*)malloc(%lu*sizeof(double));\n", (unsigned long)size); + fprintf(self->dumper.out, " if (!dValues) { fprintf(stderr, \"Failed to allocate memory (dValues).\\n\"); return 1; }\n"); + fprintf(self->dumper.out, " size = %lu;\n", (unsigned long)size); - depth-=2; + depth -= 2; - if ((r=compute_bufr_key_rank(h,self->keys,a->name))!=0) - fprintf(self->dumper.out," CODES_CHECK(codes_get_double_array(h, \"#%d#%s\",dValues, &size), 0);\n", r, a->name); + if ((r = compute_bufr_key_rank(h, self->keys, a->name)) != 0) + fprintf(self->dumper.out, " CODES_CHECK(codes_get_double_array(h, \"#%d#%s\",dValues, &size), 0);\n", r, a->name); else - fprintf(self->dumper.out," CODES_CHECK(codes_get_double_array(h, \"%s\", dValues, &size), 0);\n",a->name); - } else { - r=compute_bufr_key_rank(h,self->keys,a->name); - if( !grib_is_missing_double(a,value) ) { - - sval=dval_to_string(c,value); - if (r!=0) - fprintf(self->dumper.out," CODES_CHECK(codes_get_double(h, \"#%d#%s\", &dVal), 0);\n", r, a->name); + fprintf(self->dumper.out, " CODES_CHECK(codes_get_double_array(h, \"%s\", dValues, &size), 0);\n", a->name); + } + else { + r = compute_bufr_key_rank(h, self->keys, a->name); + if (!grib_is_missing_double(a, value)) { + sval = dval_to_string(c, value); + if (r != 0) + fprintf(self->dumper.out, " CODES_CHECK(codes_get_double(h, \"#%d#%s\", &dVal), 0);\n", r, a->name); else - fprintf(self->dumper.out," CODES_CHECK(codes_get_double(h, \"%s\", &dVal), 0);\n", a->name); + fprintf(self->dumper.out, " CODES_CHECK(codes_get_double(h, \"%s\", &dVal), 0);\n", a->name); - grib_context_free(c,sval); + grib_context_free(c, sval); } } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } (void)err; /* TODO */ @@ -221,192 +231,200 @@ static void dump_values(grib_dumper* d, grib_accessor* a) static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* prefix) { - grib_dumper_bufr_decode_C *self = (grib_dumper_bufr_decode_C*)d; - double value=0; size_t size = 0; - int err = 0; - long count=0; + grib_dumper_bufr_decode_C* self = (grib_dumper_bufr_decode_C*)d; + double value = 0; + size_t size = 0; + int err = 0; + long count = 0; char* sval; - grib_context* c=a->context; + grib_context* c = a->context; - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) !=0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; if (size <= 1) { - err=grib_unpack_double(a,&value,&size); + err = grib_unpack_double(a, &value, &size); } - self->empty=0; + self->empty = 0; - if (size>1) { - fprintf(self->dumper.out,"\n"); - fprintf(self->dumper.out," free(dValues);\n"); - fprintf(self->dumper.out," dValues = (double*)malloc(%lu*sizeof(double));\n", (unsigned long)size); - fprintf(self->dumper.out," if (!dValues) { fprintf(stderr, \"Failed to allocate memory (dValues).\\n\"); return 1; }\n"); - fprintf(self->dumper.out," size = %lu\n;", (unsigned long)size); + if (size > 1) { + fprintf(self->dumper.out, "\n"); + fprintf(self->dumper.out, " free(dValues);\n"); + fprintf(self->dumper.out, " dValues = (double*)malloc(%lu*sizeof(double));\n", (unsigned long)size); + fprintf(self->dumper.out, " if (!dValues) { fprintf(stderr, \"Failed to allocate memory (dValues).\\n\"); return 1; }\n"); + fprintf(self->dumper.out, " size = %lu\n;", (unsigned long)size); - depth-=2; + depth -= 2; - fprintf(self->dumper.out," CODES_CHECK(codes_get_double_array(h, \"%s->%s\", dValues, &size), 0);\n", prefix,a->name); - } else { + fprintf(self->dumper.out, " CODES_CHECK(codes_get_double_array(h, \"%s->%s\", dValues, &size), 0);\n", prefix, a->name); + } + else { /* int r=compute_bufr_key_rank(h,self->keys,a->name); */ - if( !grib_is_missing_double(a,value) ) { - - sval=dval_to_string(c,value); - fprintf(self->dumper.out," CODES_CHECK(codes_get_double(h, \"%s->%s\", &dVal), 0);\n", prefix,a->name); - - grib_context_free(c,sval); + if (!grib_is_missing_double(a, value)) { + sval = dval_to_string(c, value); + fprintf(self->dumper.out, " CODES_CHECK(codes_get_double(h, \"%s->%s\", &dVal), 0);\n", prefix, a->name); + grib_context_free(c, sval); } } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix1; - prefix1=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+strlen(prefix)+5)); - sprintf(prefix1,"%s->%s",prefix,a->name); + prefix1 = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + strlen(prefix) + 5)); + sprintf(prefix1, "%s->%s", prefix, a->name); - dump_attributes(d,a,prefix1); + dump_attributes(d, a, prefix1); - grib_context_free(c,prefix1); - depth-=2; + grib_context_free(c, prefix1); + depth -= 2; } (void)err; /* TODO */ } -static void dump_long(grib_dumper* d,grib_accessor* a, const char* comment) +static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_decode_C *self = (grib_dumper_bufr_decode_C*)d; - long value=0; size_t size = 0; - int err = 0; - int r=0; - long count=0; - grib_context* c=a->context; - grib_handle* h=grib_handle_of_accessor(a); - - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 ) + grib_dumper_bufr_decode_C* self = (grib_dumper_bufr_decode_C*)d; + long value = 0; + size_t size = 0; + int err = 0; + int r = 0; + long count = 0; + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); + + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; - if ( (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { - if (self->isLeaf==0) { + if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; - - r=compute_bufr_key_rank(h,self->keys,a->name); - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; - - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + int dofree = 0; + + r = compute_bufr_key_rank(h, self->keys, a->name); + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; + + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } return; } if (size <= 1) { - err=grib_unpack_long(a,&value,&size); + err = grib_unpack_long(a, &value, &size); } - self->empty=0; + self->empty = 0; - if (size>1) { - fprintf(self->dumper.out,"\n"); - fprintf(self->dumper.out," free(iValues);\n"); - fprintf(self->dumper.out," iValues = (long*)malloc(%lu*sizeof(long));\n", (unsigned long)size); - fprintf(self->dumper.out," if (!iValues) { fprintf(stderr, \"Failed to allocate memory (iValues).\\n\"); return 1; }\n"); - fprintf(self->dumper.out," size = %lu;\n", (unsigned long)size); + if (size > 1) { + fprintf(self->dumper.out, "\n"); + fprintf(self->dumper.out, " free(iValues);\n"); + fprintf(self->dumper.out, " iValues = (long*)malloc(%lu*sizeof(long));\n", (unsigned long)size); + fprintf(self->dumper.out, " if (!iValues) { fprintf(stderr, \"Failed to allocate memory (iValues).\\n\"); return 1; }\n"); + fprintf(self->dumper.out, " size = %lu;\n", (unsigned long)size); - depth-=2; + depth -= 2; - if ((r=compute_bufr_key_rank(h,self->keys,a->name))!=0) - fprintf(self->dumper.out," CODES_CHECK(codes_get_long_array(h, \"#%d#%s\", iValues, &size), 0);\n",r,a->name); + if ((r = compute_bufr_key_rank(h, self->keys, a->name)) != 0) + fprintf(self->dumper.out, " CODES_CHECK(codes_get_long_array(h, \"#%d#%s\", iValues, &size), 0);\n", r, a->name); else - fprintf(self->dumper.out," CODES_CHECK(codes_get_long_array(h, \"%s\", iValues, &size), 0);\n",a->name); - - } else { - r=compute_bufr_key_rank(h,self->keys,a->name); - if( !grib_is_missing_long(a,value) ) { - if (r!=0) - fprintf(self->dumper.out," CODES_CHECK(codes_get_long(h, \"#%d#%s\", &iVal), 0);\n", r,a->name); + fprintf(self->dumper.out, " CODES_CHECK(codes_get_long_array(h, \"%s\", iValues, &size), 0);\n", a->name); + } + else { + r = compute_bufr_key_rank(h, self->keys, a->name); + if (!grib_is_missing_long(a, value)) { + if (r != 0) + fprintf(self->dumper.out, " CODES_CHECK(codes_get_long(h, \"#%d#%s\", &iVal), 0);\n", r, a->name); else - fprintf(self->dumper.out," CODES_CHECK(codes_get_long(h, \"%s\", &iVal), 0);\n", a->name); + fprintf(self->dumper.out, " CODES_CHECK(codes_get_long(h, \"%s\", &iVal), 0);\n", a->name); } } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } (void)err; /* TODO */ } static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* prefix) { - grib_dumper_bufr_decode_C *self = (grib_dumper_bufr_decode_C*)d; - long value=0; size_t size = 0; - int err = 0; - long count=0; - grib_context* c=a->context; - - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + grib_dumper_bufr_decode_C* self = (grib_dumper_bufr_decode_C*)d; + long value = 0; + size_t size = 0; + int err = 0; + long count = 0; + grib_context* c = a->context; + + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; if (size <= 1) { - err=grib_unpack_long(a,&value,&size); + err = grib_unpack_long(a, &value, &size); } - self->empty=0; - - if (size>1) { - fprintf(self->dumper.out,"\n"); - fprintf(self->dumper.out," free(iValues);\n"); - fprintf(self->dumper.out," iValues = (long*)malloc(%lu*sizeof(long));\n", (unsigned long)size); - fprintf(self->dumper.out," if (!iValues) { fprintf(stderr, \"Failed to allocate memory (iValues).\\n\"); return 1; }\n"); - fprintf(self->dumper.out," size = %lu;\n", (unsigned long)size); + self->empty = 0; - depth-=2; + if (size > 1) { + fprintf(self->dumper.out, "\n"); + fprintf(self->dumper.out, " free(iValues);\n"); + fprintf(self->dumper.out, " iValues = (long*)malloc(%lu*sizeof(long));\n", (unsigned long)size); + fprintf(self->dumper.out, " if (!iValues) { fprintf(stderr, \"Failed to allocate memory (iValues).\\n\"); return 1; }\n"); + fprintf(self->dumper.out, " size = %lu;\n", (unsigned long)size); - fprintf(self->dumper.out," CODES_CHECK(codes_get_long_array(h, \"%s->%s\", iValues, &size), 0);\n", prefix,a->name); + depth -= 2; - } else { + fprintf(self->dumper.out, " CODES_CHECK(codes_get_long_array(h, \"%s->%s\", iValues, &size), 0);\n", prefix, a->name); + } + else { /* int r=compute_bufr_key_rank(h,self->keys,a->name); */ - if( !grib_is_missing_long(a,value) ) { - fprintf(self->dumper.out," CODES_CHECK(codes_get_long(h, \"%s->%s\", &iVal), 0);\n", prefix,a->name); + if (!grib_is_missing_long(a, value)) { + fprintf(self->dumper.out, " CODES_CHECK(codes_get_long(h, \"%s->%s\", &iVal), 0);\n", prefix, a->name); } } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix1; - prefix1=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+strlen(prefix)+5)); - sprintf(prefix1,"%s->%s",prefix,a->name); + prefix1 = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + strlen(prefix) + 5)); + sprintf(prefix1, "%s->%s", prefix, a->name); - dump_attributes(d,a,prefix1); + dump_attributes(d, a, prefix1); - grib_context_free(c,prefix1); - depth-=2; + grib_context_free(c, prefix1); + depth -= 2; } (void)err; /* TODO */ } @@ -417,168 +435,183 @@ static void dump_bits(grib_dumper* d, grib_accessor* a, const char* comment) static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_decode_C *self = (grib_dumper_bufr_decode_C*)d; - double value=0; size_t size = 1; + grib_dumper_bufr_decode_C* self = (grib_dumper_bufr_decode_C*)d; + double value = 0; + size_t size = 1; int r; char* sval; - grib_handle* h=grib_handle_of_accessor(a); - grib_context* c=h->context; + grib_handle* h = grib_handle_of_accessor(a); + grib_context* c = h->context; - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_unpack_double(a,&value,&size); - self->empty=0; + grib_unpack_double(a, &value, &size); + self->empty = 0; - r=compute_bufr_key_rank(h,self->keys,a->name); - if( !grib_is_missing_double(a,value) ) { - sval=dval_to_string(c,value); - if (r!=0) - fprintf(self->dumper.out," CODES_CHECK(codes_get_double(h, \"#%d#%s\", &dVal), 0);\n", r,a->name); + r = compute_bufr_key_rank(h, self->keys, a->name); + if (!grib_is_missing_double(a, value)) { + sval = dval_to_string(c, value); + if (r != 0) + fprintf(self->dumper.out, " CODES_CHECK(codes_get_double(h, \"#%d#%s\", &dVal), 0);\n", r, a->name); else - fprintf(self->dumper.out," CODES_CHECK(codes_get_double(h, \"%s\", &dVal), 0);\n", a->name); + fprintf(self->dumper.out, " CODES_CHECK(codes_get_double(h, \"%s\", &dVal), 0);\n", a->name); - grib_context_free(c,sval); + grib_context_free(c, sval); } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } } static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_decode_C *self = (grib_dumper_bufr_decode_C*)d; - char **values = NULL; - size_t size = 0; - grib_context* c=NULL; - int err = 0; - long count=0; - int r=0; - grib_handle* h=grib_handle_of_accessor(a); - - c=a->context; - - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + grib_dumper_bufr_decode_C* self = (grib_dumper_bufr_decode_C*)d; + char** values = NULL; + size_t size = 0; + grib_context* c = NULL; + int err = 0; + long count = 0; + int r = 0; + grib_handle* h = grib_handle_of_accessor(a); + + c = a->context; + + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a,&count); - size=count; - if (size==1) { - dump_string(d,a,comment); + grib_value_count(a, &count); + size = count; + if (size == 1) { + dump_string(d, a, comment); return; } - fprintf(self->dumper.out,"\n"); - fprintf(self->dumper.out," free(sValues);\n"); - fprintf(self->dumper.out," sValues = (char**)malloc(%lu * sizeof(char*));\n", (unsigned long)size); - fprintf(self->dumper.out," if (!sValues) { fprintf(stderr, \"Failed to allocate memory (sValues).\\n\"); return 1; }\n"); - fprintf(self->dumper.out," size = %lu;\n", (unsigned long)size); + fprintf(self->dumper.out, "\n"); + fprintf(self->dumper.out, " free(sValues);\n"); + fprintf(self->dumper.out, " sValues = (char**)malloc(%lu * sizeof(char*));\n", (unsigned long)size); + fprintf(self->dumper.out, " if (!sValues) { fprintf(stderr, \"Failed to allocate memory (sValues).\\n\"); return 1; }\n"); + fprintf(self->dumper.out, " size = %lu;\n", (unsigned long)size); - self->empty=0; - values=(char**)grib_context_malloc_clear(c,size*sizeof(char*)); + self->empty = 0; + values = (char**)grib_context_malloc_clear(c, size * sizeof(char*)); if (!values) { - grib_context_log(c,GRIB_LOG_FATAL,"unable to allocate %d bytes",(int)size); + grib_context_log(c, GRIB_LOG_FATAL, "unable to allocate %d bytes", (int)size); return; } - err = grib_unpack_string_array(a,values,&size); + err = grib_unpack_string_array(a, values, &size); - if (self->isLeaf==0) { - if ((r=compute_bufr_key_rank(h,self->keys,a->name))!=0) - fprintf(self->dumper.out," codes_get_string_array(h, \"#%d#%s\", sValues, &size);\n",r,a->name); + if (self->isLeaf == 0) { + if ((r = compute_bufr_key_rank(h, self->keys, a->name)) != 0) + fprintf(self->dumper.out, " codes_get_string_array(h, \"#%d#%s\", sValues, &size);\n", r, a->name); else - fprintf(self->dumper.out," codes_get_string_array(h, \"%s\", sValues, &size);\n",a->name); + fprintf(self->dumper.out, " codes_get_string_array(h, \"%s\", sValues, &size);\n", a->name); } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } - grib_context_free(c,values); + grib_context_free(c, values); (void)err; /* TODO */ } static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_decode_C *self = (grib_dumper_bufr_decode_C*)d; - char *value=NULL; - char *p = NULL; - size_t size = 0; - grib_context* c=NULL; + grib_dumper_bufr_decode_C* self = (grib_dumper_bufr_decode_C*)d; + char* value = NULL; + char* p = NULL; + size_t size = 0; + grib_context* c = NULL; int r; - int err = _grib_get_string_length(a,&size); - grib_handle* h=grib_handle_of_accessor(a); + int err = _grib_get_string_length(a, &size); + grib_handle* h = grib_handle_of_accessor(a); - c=a->context; - if (size==0) return; + c = a->context; + if (size == 0) + return; - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - value=(char*)grib_context_malloc_clear(c,size); + value = (char*)grib_context_malloc_clear(c, size); if (!value) { - grib_context_log(c,GRIB_LOG_FATAL,"unable to allocate %d bytes",(int)size); + grib_context_log(c, GRIB_LOG_FATAL, "unable to allocate %d bytes", (int)size); return; } - self->empty=0; + self->empty = 0; - err = grib_unpack_string(a,value,&size); - p=value; - r=compute_bufr_key_rank(h,self->keys,a->name); - if (grib_is_missing_string(a,(unsigned char *)value,size)) + err = grib_unpack_string(a, value, &size); + p = value; + r = compute_bufr_key_rank(h, self->keys, a->name); + if (grib_is_missing_string(a, (unsigned char*)value, size)) return; - while(*p) { if(!isprint(*p)) *p = '.'; p++; } + while (*p) { + if (!isprint(*p)) + *p = '.'; + p++; + } - fprintf(self->dumper.out," size = 1024;\n"); /* TODO */ - if (self->isLeaf==0) { - depth+=2; - if (r!=0) - fprintf(self->dumper.out," CODES_CHECK(codes_get_string(h, \"#%d#%s\", sVal, &size), 0);\n", r, a->name); + fprintf(self->dumper.out, " size = 1024;\n"); /* TODO */ + if (self->isLeaf == 0) { + depth += 2; + if (r != 0) + fprintf(self->dumper.out, " CODES_CHECK(codes_get_string(h, \"#%d#%s\", sVal, &size), 0);\n", r, a->name); else - fprintf(self->dumper.out," CODES_CHECK(codes_get_string(h, \"%s\", sVal, &size), 0);\n", a->name); + fprintf(self->dumper.out, " CODES_CHECK(codes_get_string(h, \"%s\", sVal, &size), 0);\n", a->name); } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } - grib_context_free(c,value); + grib_context_free(c, value); (void)err; /* TODO */ } @@ -592,130 +625,130 @@ static void dump_label(grib_dumper* d, grib_accessor* a, const char* comment) static void _dump_long_array(grib_handle* h, FILE* f, const char* key) { - size_t size=0; - if (grib_get_size(h,key,&size)==GRIB_NOT_FOUND) return; + size_t size = 0; + if (grib_get_size(h, key, &size) == GRIB_NOT_FOUND) + return; - fprintf(f," free(iValues);\n"); - fprintf(f," iValues = (long*)malloc(%lu*sizeof(long));\n", (unsigned long)size); - fprintf(f," if (!iValues) { fprintf(stderr, \"Failed to allocate memory (iValues).\\n\"); return 1; }\n"); - fprintf(f," size = %lu;", (unsigned long)size); + fprintf(f, " free(iValues);\n"); + fprintf(f, " iValues = (long*)malloc(%lu*sizeof(long));\n", (unsigned long)size); + fprintf(f, " if (!iValues) { fprintf(stderr, \"Failed to allocate memory (iValues).\\n\"); return 1; }\n"); + fprintf(f, " size = %lu;", (unsigned long)size); - fprintf(f," CODES_CHECK(codes_get_long_array(h, \"%s\", iValues, &size), 0);\n",key); + fprintf(f, " CODES_CHECK(codes_get_long_array(h, \"%s\", iValues, &size), 0);\n", key); } static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block) { - grib_dumper_bufr_decode_C *self = (grib_dumper_bufr_decode_C*)d; - if (!grib_inline_strcmp(a->name,"BUFR") || - !grib_inline_strcmp(a->name,"GRIB") || - !grib_inline_strcmp(a->name,"META") - ) { - grib_handle* h=grib_handle_of_accessor(a); - depth=2; - self->empty=1; - depth+=2; - _dump_long_array(h,self->dumper.out,"dataPresentIndicator"); - _dump_long_array(h,self->dumper.out,"delayedDescriptorReplicationFactor"); - _dump_long_array(h,self->dumper.out,"shortDelayedDescriptorReplicationFactor"); - _dump_long_array(h,self->dumper.out,"extendedDelayedDescriptorReplicationFactor"); + grib_dumper_bufr_decode_C* self = (grib_dumper_bufr_decode_C*)d; + if (!grib_inline_strcmp(a->name, "BUFR") || + !grib_inline_strcmp(a->name, "GRIB") || + !grib_inline_strcmp(a->name, "META")) { + grib_handle* h = grib_handle_of_accessor(a); + depth = 2; + self->empty = 1; + depth += 2; + _dump_long_array(h, self->dumper.out, "dataPresentIndicator"); + _dump_long_array(h, self->dumper.out, "delayedDescriptorReplicationFactor"); + _dump_long_array(h, self->dumper.out, "shortDelayedDescriptorReplicationFactor"); + _dump_long_array(h, self->dumper.out, "extendedDelayedDescriptorReplicationFactor"); /* Do not show the inputOverriddenReferenceValues array. That's more for ENCODING */ /*_dump_long_array(h,self->dumper.out,"inputOverriddenReferenceValues","inputOverriddenReferenceValues");*/ - grib_dump_accessors_block(d,block); - depth-=2; - } else if (!grib_inline_strcmp(a->name,"groupNumber")) { - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) + grib_dump_accessors_block(d, block); + depth -= 2; + } + else if (!grib_inline_strcmp(a->name, "groupNumber")) { + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - self->empty=1; - depth+=2; - grib_dump_accessors_block(d,block); - depth-=2; - } else { - grib_dump_accessors_block(d,block); + self->empty = 1; + depth += 2; + grib_dump_accessors_block(d, block); + depth -= 2; + } + else { + grib_dump_accessors_block(d, block); } } -static void dump_attributes(grib_dumper* d,grib_accessor* a, const char* prefix) +static void dump_attributes(grib_dumper* d, grib_accessor* a, const char* prefix) { - int i=0; - grib_dumper_bufr_decode_C *self = (grib_dumper_bufr_decode_C*)d; + int i = 0; + grib_dumper_bufr_decode_C* self = (grib_dumper_bufr_decode_C*)d; unsigned long flags; while (i < MAX_ACCESSOR_ATTRIBUTES && a->attributes[i]) { - self->isAttribute=1; - if ( (d->option_flags & GRIB_DUMP_FLAG_ALL_ATTRIBUTES ) == 0 - && (a->attributes[i]->flags & GRIB_ACCESSOR_FLAG_DUMP)== 0 ) - { + self->isAttribute = 1; + if ((d->option_flags & GRIB_DUMP_FLAG_ALL_ATTRIBUTES) == 0 && (a->attributes[i]->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) { i++; continue; } - self->isLeaf=a->attributes[i]->attributes[0]==NULL ? 1 : 0; - flags=a->attributes[i]->flags; + self->isLeaf = a->attributes[i]->attributes[0] == NULL ? 1 : 0; + flags = a->attributes[i]->flags; a->attributes[i]->flags |= GRIB_ACCESSOR_FLAG_DUMP; switch (grib_accessor_get_native_type(a->attributes[i])) { - case GRIB_TYPE_LONG: - dump_long_attribute(d,a->attributes[i],prefix); - break; - case GRIB_TYPE_DOUBLE: - dump_values_attribute(d,a->attributes[i],prefix); - break; - case GRIB_TYPE_STRING: - break; + case GRIB_TYPE_LONG: + dump_long_attribute(d, a->attributes[i], prefix); + break; + case GRIB_TYPE_DOUBLE: + dump_values_attribute(d, a->attributes[i], prefix); + break; + case GRIB_TYPE_STRING: + break; } - a->attributes[i]->flags=flags; + a->attributes[i]->flags = flags; i++; } - self->isLeaf=0; - self->isAttribute=0; + self->isLeaf = 0; + self->isAttribute = 0; } static void header(grib_dumper* d, grib_handle* h) { - grib_dumper_bufr_decode_C *self = (grib_dumper_bufr_decode_C*)d; + grib_dumper_bufr_decode_C* self = (grib_dumper_bufr_decode_C*)d; Assert(h->product_kind == PRODUCT_BUFR); - if (d->count<2) { + if (d->count < 2) { /* This is the first message being processed */ - fprintf(self->dumper.out,"/* This program was automatically generated with bufr_dump -DC */\n"); - fprintf(self->dumper.out,"/* Using ecCodes version: "); + fprintf(self->dumper.out, "/* This program was automatically generated with bufr_dump -DC */\n"); + fprintf(self->dumper.out, "/* Using ecCodes version: "); grib_print_api_version(self->dumper.out); fprintf(self->dumper.out, " */\n\n"); - fprintf(self->dumper.out,"#include \"eccodes.h\"\n"); - fprintf(self->dumper.out,"int main(int argc, char* argv[])\n"); - fprintf(self->dumper.out,"{\n"); - fprintf(self->dumper.out," size_t size = 0;\n"); - fprintf(self->dumper.out," int err = 0;\n"); - fprintf(self->dumper.out," FILE* fin = NULL;\n"); - fprintf(self->dumper.out," codes_handle* h = NULL;\n"); - fprintf(self->dumper.out," long iVal = 0;\n"); - fprintf(self->dumper.out," double dVal = 0.0;\n"); - fprintf(self->dumper.out," char sVal[1024] = {0,};\n"); - fprintf(self->dumper.out," long* iValues = NULL;\n"); - fprintf(self->dumper.out," char** sValues = NULL;\n"); - fprintf(self->dumper.out," double* dValues = NULL;\n"); - fprintf(self->dumper.out," const char* infile_name = NULL;\n\n"); - - fprintf(self->dumper.out," if (argc != 2) {\n"); - fprintf(self->dumper.out," fprintf(stderr, \"Usage: %%s BUFR_file\\n\", argv[0]);\n"); - fprintf(self->dumper.out," return 1;\n"); - fprintf(self->dumper.out," }\n"); - fprintf(self->dumper.out," infile_name = argv[1];\n"); - fprintf(self->dumper.out," fin = fopen(infile_name, \"r\");\n"); - fprintf(self->dumper.out," if (!fin) {\n"); - fprintf(self->dumper.out," fprintf(stderr,\"ERROR: Unable to open input BUFR file %%s\\n\", infile_name);\n"); - fprintf(self->dumper.out," return 1;\n"); - fprintf(self->dumper.out," }\n\n"); - } - - fprintf(self->dumper.out," h = codes_handle_new_from_file(NULL, fin, PRODUCT_BUFR, &err);\n"); - fprintf(self->dumper.out," if (h == NULL) {\n"); - fprintf(self->dumper.out," fprintf(stderr, \"ERROR: cannot create BUFR handle\\n\");\n"); - fprintf(self->dumper.out," return 1;\n"); - fprintf(self->dumper.out," }\n"); - fprintf(self->dumper.out," CODES_CHECK(codes_set_long(h, \"unpack\", 1),0);\n\n"); + fprintf(self->dumper.out, "#include \"eccodes.h\"\n"); + fprintf(self->dumper.out, "int main(int argc, char* argv[])\n"); + fprintf(self->dumper.out, "{\n"); + fprintf(self->dumper.out, " size_t size = 0;\n"); + fprintf(self->dumper.out, " int err = 0;\n"); + fprintf(self->dumper.out, " FILE* fin = NULL;\n"); + fprintf(self->dumper.out, " codes_handle* h = NULL;\n"); + fprintf(self->dumper.out, " long iVal = 0;\n"); + fprintf(self->dumper.out, " double dVal = 0.0;\n"); + fprintf(self->dumper.out, " char sVal[1024] = {0,};\n"); + fprintf(self->dumper.out, " long* iValues = NULL;\n"); + fprintf(self->dumper.out, " char** sValues = NULL;\n"); + fprintf(self->dumper.out, " double* dValues = NULL;\n"); + fprintf(self->dumper.out, " const char* infile_name = NULL;\n\n"); + + fprintf(self->dumper.out, " if (argc != 2) {\n"); + fprintf(self->dumper.out, " fprintf(stderr, \"Usage: %%s BUFR_file\\n\", argv[0]);\n"); + fprintf(self->dumper.out, " return 1;\n"); + fprintf(self->dumper.out, " }\n"); + fprintf(self->dumper.out, " infile_name = argv[1];\n"); + fprintf(self->dumper.out, " fin = fopen(infile_name, \"r\");\n"); + fprintf(self->dumper.out, " if (!fin) {\n"); + fprintf(self->dumper.out, " fprintf(stderr,\"ERROR: Unable to open input BUFR file %%s\\n\", infile_name);\n"); + fprintf(self->dumper.out, " return 1;\n"); + fprintf(self->dumper.out, " }\n\n"); + } + + fprintf(self->dumper.out, " h = codes_handle_new_from_file(NULL, fin, PRODUCT_BUFR, &err);\n"); + fprintf(self->dumper.out, " if (h == NULL) {\n"); + fprintf(self->dumper.out, " fprintf(stderr, \"ERROR: cannot create BUFR handle\\n\");\n"); + fprintf(self->dumper.out, " return 1;\n"); + fprintf(self->dumper.out, " }\n"); + fprintf(self->dumper.out, " CODES_CHECK(codes_set_long(h, \"unpack\", 1),0);\n\n"); } static void footer(grib_dumper* d, grib_handle* h) { - grib_dumper_bufr_decode_C *self = (grib_dumper_bufr_decode_C*)d; + grib_dumper_bufr_decode_C* self = (grib_dumper_bufr_decode_C*)d; /*fprintf(self->dumper.out," fout = fopen(\"outfile.bufr\", \"w\");");*/ /*fprintf(self->dumper.out," if (fclose(fout)) {\n"); @@ -723,9 +756,9 @@ static void footer(grib_dumper* d, grib_handle* h) fprintf(self->dumper.out," return 1;\n"); fprintf(self->dumper.out," }\n"); */ - fprintf(self->dumper.out,"\n"); - fprintf(self->dumper.out," codes_handle_delete(h);\n"); - fprintf(self->dumper.out," free(iValues); iValues = NULL;\n"); - fprintf(self->dumper.out," free(dValues); dValues = NULL;\n"); - fprintf(self->dumper.out," free(sValues); sValues = NULL;\n\n"); + fprintf(self->dumper.out, "\n"); + fprintf(self->dumper.out, " codes_handle_delete(h);\n"); + fprintf(self->dumper.out, " free(iValues); iValues = NULL;\n"); + fprintf(self->dumper.out, " free(dValues); dValues = NULL;\n"); + fprintf(self->dumper.out, " free(sValues); sValues = NULL;\n\n"); } diff --git a/src/grib_dumper_class_bufr_decode_filter.c b/src/grib_dumper_class_bufr_decode_filter.c index bf24dfadb..4037e5b15 100644 --- a/src/grib_dumper_class_bufr_decode_filter.c +++ b/src/grib_dumper_class_bufr_decode_filter.c @@ -42,200 +42,211 @@ or edit "dumper.class" and rerun ./make_class.pl */ -static void init_class (grib_dumper_class*); -static int init (grib_dumper* d); -static int destroy (grib_dumper*); -static void dump_long (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_bits (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_double (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_string (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_string_array (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_bytes (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_values (grib_dumper* d, grib_accessor* a); -static void dump_label (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_section (grib_dumper* d, grib_accessor* a,grib_block_of_accessors* block); - -typedef struct grib_dumper_bufr_decode_filter { - grib_dumper dumper; -/* Members defined in bufr_decode_filter */ - long section_offset; - long begin; - long empty; - long end; - long isLeaf; - long isAttribute; - grib_string_list* keys; +static void init_class(grib_dumper_class*); +static int init(grib_dumper* d); +static int destroy(grib_dumper*); +static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_bits(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_values(grib_dumper* d, grib_accessor* a); +static void dump_label(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block); + +typedef struct grib_dumper_bufr_decode_filter +{ + grib_dumper dumper; + /* Members defined in bufr_decode_filter */ + long section_offset; + long begin; + long empty; + long end; + long isLeaf; + long isAttribute; + grib_string_list* keys; } grib_dumper_bufr_decode_filter; static grib_dumper_class _grib_dumper_class_bufr_decode_filter = { - 0, /* super */ - "bufr_decode_filter", /* name */ - sizeof(grib_dumper_bufr_decode_filter), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - &destroy, /* free mem */ - &dump_long, /* dump long */ - &dump_double, /* dump double */ - &dump_string, /* dump string */ - &dump_string_array, /* dump string array */ - &dump_label, /* dump labels */ - &dump_bytes, /* dump bytes */ - &dump_bits, /* dump bits */ - &dump_section, /* dump section */ - &dump_values, /* dump values */ - 0, /* header */ - 0, /* footer */ + 0, /* super */ + "bufr_decode_filter", /* name */ + sizeof(grib_dumper_bufr_decode_filter), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + &destroy, /* free mem */ + &dump_long, /* dump long */ + &dump_double, /* dump double */ + &dump_string, /* dump string */ + &dump_string_array, /* dump string array */ + &dump_label, /* dump labels */ + &dump_bytes, /* dump bytes */ + &dump_bits, /* dump bits */ + &dump_section, /* dump section */ + &dump_values, /* dump values */ + 0, /* header */ + 0, /* footer */ }; grib_dumper_class* grib_dumper_class_bufr_decode_filter = &_grib_dumper_class_bufr_decode_filter; /* END_CLASS_IMP */ -static void dump_attributes(grib_dumper* d,grib_accessor* a, const char* prefix); +static void dump_attributes(grib_dumper* d, grib_accessor* a, const char* prefix); /* Note: A fast cut-down version of strcmp which does NOT return -1 */ /* 0 means input strings are equal and 1 means not equal */ GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b) { - if (*a != *b) return 1; - while((*a!=0 && *b!=0) && *(a) == *(b) ) {a++;b++;} - return (*a==0 && *b==0) ? 0 : 1; + if (*a != *b) + return 1; + while ((*a != 0 && *b != 0) && *(a) == *(b)) { + a++; + b++; + } + return (*a == 0 && *b == 0) ? 0 : 1; } typedef struct string_count string_count; -struct string_count { +struct string_count +{ char* value; int count; string_count* next; }; -static int depth=0; +static int depth = 0; -static void init_class (grib_dumper_class* c){} +static void init_class(grib_dumper_class* c) {} static int init(grib_dumper* d) { - grib_dumper_bufr_decode_filter *self = (grib_dumper_bufr_decode_filter*)d; - grib_context* c=d->handle->context; - self->section_offset=0; - self->empty=1; - self->isLeaf=0; - self->isAttribute=0; - self->keys=(grib_string_list*)grib_context_malloc_clear(c,sizeof(grib_string_list)); + grib_dumper_bufr_decode_filter* self = (grib_dumper_bufr_decode_filter*)d; + grib_context* c = d->handle->context; + self->section_offset = 0; + self->empty = 1; + self->isLeaf = 0; + self->isAttribute = 0; + self->keys = (grib_string_list*)grib_context_malloc_clear(c, sizeof(grib_string_list)); return GRIB_SUCCESS; } static int destroy(grib_dumper* d) { - grib_dumper_bufr_decode_filter *self = (grib_dumper_bufr_decode_filter*)d; - grib_string_list* next=self->keys; - grib_string_list* cur=self->keys; - grib_context* c=d->handle->context; - while(next) { - cur=next; - next=next->next; - grib_context_free(c,cur->value); - grib_context_free(c,cur); + grib_dumper_bufr_decode_filter* self = (grib_dumper_bufr_decode_filter*)d; + grib_string_list* next = self->keys; + grib_string_list* cur = self->keys; + grib_context* c = d->handle->context; + while (next) { + cur = next; + next = next->next; + grib_context_free(c, cur->value); + grib_context_free(c, cur); } return GRIB_SUCCESS; } static void dump_values(grib_dumper* d, grib_accessor* a) { - grib_dumper_bufr_decode_filter *self = (grib_dumper_bufr_decode_filter*)d; - double value=0; size_t size = 0; - int err = 0; + grib_dumper_bufr_decode_filter* self = (grib_dumper_bufr_decode_filter*)d; + double value = 0; + size_t size = 0; + int err = 0; int r; - long count=0; - grib_context* c=a->context; - grib_handle* h=grib_handle_of_accessor(a); + long count = 0; + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) !=0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; - if (size<=1) { - err=grib_unpack_double(a,&value,&size); + if (size <= 1) { + err = grib_unpack_double(a, &value, &size); } - self->begin=0; - self->empty=0; + self->begin = 0; + self->empty = 0; - if (size>1) { - if ((r=compute_bufr_key_rank(h,self->keys,a->name))!=0) - fprintf(self->dumper.out,"print \"#%d#%s=[#%d#%s]\";\n", r, a->name, r, a->name); + if (size > 1) { + if ((r = compute_bufr_key_rank(h, self->keys, a->name)) != 0) + fprintf(self->dumper.out, "print \"#%d#%s=[#%d#%s]\";\n", r, a->name, r, a->name); else - fprintf(self->dumper.out,"print \"%s=[%s]\";\n", a->name, a->name); - - } else { - r=compute_bufr_key_rank(h,self->keys,a->name); - if( !grib_is_missing_double(a,value) ) { - - if (r!=0) - fprintf(self->dumper.out,"print \"#%d#%s=[#%d#%s]\";\n", r, a->name, r, a->name); + fprintf(self->dumper.out, "print \"%s=[%s]\";\n", a->name, a->name); + } + else { + r = compute_bufr_key_rank(h, self->keys, a->name); + if (!grib_is_missing_double(a, value)) { + if (r != 0) + fprintf(self->dumper.out, "print \"#%d#%s=[#%d#%s]\";\n", r, a->name, r, a->name); else - fprintf(self->dumper.out,"print \"%s=[%s]\";\n",a->name, a->name); + fprintf(self->dumper.out, "print \"%s=[%s]\";\n", a->name, a->name); } } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } (void)err; /* TODO */ } -static void dump_values_attribute(grib_dumper* d,grib_accessor* a, const char* prefix) +static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* prefix) { - grib_dumper_bufr_decode_filter *self = (grib_dumper_bufr_decode_filter*)d; - double value=0; size_t size = 0; - int err = 0; - long count=0; - grib_context* c=a->context; - - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) !=0) + grib_dumper_bufr_decode_filter* self = (grib_dumper_bufr_decode_filter*)d; + double value = 0; + size_t size = 0; + int err = 0; + long count = 0; + grib_context* c = a->context; + + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; - if (size<=1) { - err=grib_unpack_double(a,&value,&size); + if (size <= 1) { + err = grib_unpack_double(a, &value, &size); } - self->empty=0; + self->empty = 0; - if (size>1) { - fprintf(self->dumper.out,"print \"%s->%s = [%s->%s]\";\n", prefix, a->name, prefix, a->name); - } else { - if( !grib_is_missing_double(a,value) ) { - fprintf(self->dumper.out,"print \"%s->%s = [%s->%s]\";\n", prefix, a->name, prefix, a->name); + if (size > 1) { + fprintf(self->dumper.out, "print \"%s->%s = [%s->%s]\";\n", prefix, a->name, prefix, a->name); + } + else { + if (!grib_is_missing_double(a, value)) { + fprintf(self->dumper.out, "print \"%s->%s = [%s->%s]\";\n", prefix, a->name, prefix, a->name); } } - if (self->isLeaf==0) { - char* prefix1 = (char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+strlen(prefix)+5)); - sprintf(prefix1,"%s->%s",prefix,a->name); + if (self->isLeaf == 0) { + char* prefix1 = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + strlen(prefix) + 5)); + sprintf(prefix1, "%s->%s", prefix, a->name); - dump_attributes(d,a,prefix1); + dump_attributes(d, a, prefix1); - grib_context_free(c,prefix1); - depth-=2; + grib_context_free(c, prefix1); + depth -= 2; } (void)err; /* TODO */ @@ -243,98 +254,106 @@ static void dump_values_attribute(grib_dumper* d,grib_accessor* a, const char* p static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_decode_filter *self = (grib_dumper_bufr_decode_filter*)d; - long value=0; size_t size = 0; - int err = 0; - int r=0; - long count=0; - grib_context* c=a->context; - grib_handle* h=grib_handle_of_accessor(a); - - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 ) return; + grib_dumper_bufr_decode_filter* self = (grib_dumper_bufr_decode_filter*)d; + long value = 0; + size_t size = 0; + int err = 0; + int r = 0; + long count = 0; + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); + + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) + return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; - if ( (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { - if (self->isLeaf==0) { + if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; - - r=compute_bufr_key_rank(h,self->keys,a->name); - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; - - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + int dofree = 0; + + r = compute_bufr_key_rank(h, self->keys, a->name); + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; + + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } return; } - if (size<=1) { - err=grib_unpack_long(a,&value,&size); + if (size <= 1) { + err = grib_unpack_long(a, &value, &size); } - self->begin=0; - self->empty=0; + self->begin = 0; + self->empty = 0; - if (size>1) { - if ((r=compute_bufr_key_rank(h,self->keys,a->name))!=0) - fprintf(self->dumper.out,"print \"#%d#%s=[#%d#%s]\";\n", r,a->name, r,a->name); + if (size > 1) { + if ((r = compute_bufr_key_rank(h, self->keys, a->name)) != 0) + fprintf(self->dumper.out, "print \"#%d#%s=[#%d#%s]\";\n", r, a->name, r, a->name); else - fprintf(self->dumper.out,"print \"%s=[%s]\";\n", a->name, a->name); - - } else { - r=compute_bufr_key_rank(h,self->keys,a->name); - if( !grib_is_missing_long(a,value) ) { - if (r!=0) - fprintf(self->dumper.out,"print \"#%d#%s=[#%d#%s]\";\n", r,a->name, r,a->name); + fprintf(self->dumper.out, "print \"%s=[%s]\";\n", a->name, a->name); + } + else { + r = compute_bufr_key_rank(h, self->keys, a->name); + if (!grib_is_missing_long(a, value)) { + if (r != 0) + fprintf(self->dumper.out, "print \"#%d#%s=[#%d#%s]\";\n", r, a->name, r, a->name); else - fprintf(self->dumper.out,"print \"%s=[%s]\";\n",a->name, a->name); + fprintf(self->dumper.out, "print \"%s=[%s]\";\n", a->name, a->name); } } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } (void)err; /* TODO */ } static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* prefix) { - grib_dumper_bufr_decode_filter *self = (grib_dumper_bufr_decode_filter*)d; - int err = 0; - grib_context* c=a->context; + grib_dumper_bufr_decode_filter* self = (grib_dumper_bufr_decode_filter*)d; + int err = 0; + grib_context* c = a->context; - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - self->empty=0; - fprintf(self->dumper.out,"print \"%s->%s = [%s->%s]\";\n", prefix, a->name, prefix, a->name); + self->empty = 0; + fprintf(self->dumper.out, "print \"%s->%s = [%s->%s]\";\n", prefix, a->name, prefix, a->name); - if (self->isLeaf==0) { - char* prefix1 = (char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+strlen(prefix)+5)); - sprintf(prefix1,"%s->%s",prefix,a->name); + if (self->isLeaf == 0) { + char* prefix1 = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + strlen(prefix) + 5)); + sprintf(prefix1, "%s->%s", prefix, a->name); - dump_attributes(d,a,prefix1); + dump_attributes(d, a, prefix1); - grib_context_free(c,prefix1); - depth-=2; + grib_context_free(c, prefix1); + depth -= 2; } (void)err; /* TODO */ } @@ -345,90 +364,97 @@ static void dump_bits(grib_dumper* d, grib_accessor* a, const char* comment) static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_decode_filter *self = (grib_dumper_bufr_decode_filter*)d; - double value=0; size_t size = 1; + grib_dumper_bufr_decode_filter* self = (grib_dumper_bufr_decode_filter*)d; + double value = 0; + size_t size = 1; int r; - grib_handle* h=grib_handle_of_accessor(a); - grib_context* c=h->context; + grib_handle* h = grib_handle_of_accessor(a); + grib_context* c = h->context; - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_unpack_double(a,&value,&size); - self->begin=0; - self->empty=0; + grib_unpack_double(a, &value, &size); + self->begin = 0; + self->empty = 0; - r=compute_bufr_key_rank(h,self->keys,a->name); - if( !grib_is_missing_double(a,value) ) { - if (r!=0) - fprintf(self->dumper.out,"print \"#%d#%s=[#%d#%s]\";\n", r,a->name, r,a->name); + r = compute_bufr_key_rank(h, self->keys, a->name); + if (!grib_is_missing_double(a, value)) { + if (r != 0) + fprintf(self->dumper.out, "print \"#%d#%s=[#%d#%s]\";\n", r, a->name, r, a->name); else - fprintf(self->dumper.out,"print \"%s=[%s]\";\n", a->name, a->name); + fprintf(self->dumper.out, "print \"%s=[%s]\";\n", a->name, a->name); } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } } static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_decode_filter *self = (grib_dumper_bufr_decode_filter*)d; - size_t size = 0; - grib_context* c=NULL; - int err = 0; - long count=0; - int r=0; - grib_handle* h=grib_handle_of_accessor(a); + grib_dumper_bufr_decode_filter* self = (grib_dumper_bufr_decode_filter*)d; + size_t size = 0; + grib_context* c = NULL; + int err = 0; + long count = 0; + int r = 0; + grib_handle* h = grib_handle_of_accessor(a); - c=a->context; + c = a->context; - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a,&count); - size=count; - if (size==1) { - dump_string(d,a,comment); + grib_value_count(a, &count); + size = count; + if (size == 1) { + dump_string(d, a, comment); return; } - self->begin=0; + self->begin = 0; - if (self->isLeaf==0) { - depth+=2; - if ((r=compute_bufr_key_rank(h,self->keys,a->name))!=0) - fprintf(self->dumper.out,"print \"#%d#%s=[#%d#%s]\";\n", r,a->name, r,a->name); + if (self->isLeaf == 0) { + depth += 2; + if ((r = compute_bufr_key_rank(h, self->keys, a->name)) != 0) + fprintf(self->dumper.out, "print \"#%d#%s=[#%d#%s]\";\n", r, a->name, r, a->name); else - fprintf(self->dumper.out,"print \"%s=[%s]\";\n", a->name, a->name); + fprintf(self->dumper.out, "print \"%s=[%s]\";\n", a->name, a->name); } - self->empty=0; + self->empty = 0; - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } (void)err; /* TODO */ @@ -436,63 +462,72 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_decode_filter *self = (grib_dumper_bufr_decode_filter*)d; - char *value=NULL; - char *p = NULL; - size_t size = 0; - grib_context* c=NULL; + grib_dumper_bufr_decode_filter* self = (grib_dumper_bufr_decode_filter*)d; + char* value = NULL; + char* p = NULL; + size_t size = 0; + grib_context* c = NULL; int r; - int err = _grib_get_string_length(a,&size); - grib_handle* h=grib_handle_of_accessor(a); + int err = _grib_get_string_length(a, &size); + grib_handle* h = grib_handle_of_accessor(a); - c=a->context; - if (size==0) return; + c = a->context; + if (size == 0) + return; - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - value=(char*)grib_context_malloc_clear(c,size); + value = (char*)grib_context_malloc_clear(c, size); if (!value) { - grib_context_log(c,GRIB_LOG_FATAL,"unable to allocate %d bytes",(int)size); + grib_context_log(c, GRIB_LOG_FATAL, "unable to allocate %d bytes", (int)size); return; } - else self->begin=0; + else + self->begin = 0; - self->empty=0; + self->empty = 0; - err = grib_unpack_string(a,value,&size); - p=value; - r=compute_bufr_key_rank(h,self->keys,a->name); - if (grib_is_missing_string(a,(unsigned char *)value,size)) + err = grib_unpack_string(a, value, &size); + p = value; + r = compute_bufr_key_rank(h, self->keys, a->name); + if (grib_is_missing_string(a, (unsigned char*)value, size)) return; - while(*p) { if(!isprint(*p)) *p = '.'; p++; } + while (*p) { + if (!isprint(*p)) + *p = '.'; + p++; + } - if (self->isLeaf==0) { - depth+=2; - if (r!=0) - fprintf(self->dumper.out,"print \"#%d#%s=[#%d#%s]\";\n", r,a->name, r,a->name); + if (self->isLeaf == 0) { + depth += 2; + if (r != 0) + fprintf(self->dumper.out, "print \"#%d#%s=[#%d#%s]\";\n", r, a->name, r, a->name); else - fprintf(self->dumper.out,"print \"%s=[%s]\";\n", a->name, a->name); + fprintf(self->dumper.out, "print \"%s=[%s]\";\n", a->name, a->name); } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } - grib_context_free(c,value); + grib_context_free(c, value); (void)err; /* TODO */ } @@ -506,78 +541,79 @@ static void dump_label(grib_dumper* d, grib_accessor* a, const char* comment) static void _dump_long_array(grib_handle* h, FILE* f, const char* key) { - size_t size=0; - if (grib_get_size(h,key,&size)==GRIB_NOT_FOUND) return; - if (size==0) return; + size_t size = 0; + if (grib_get_size(h, key, &size) == GRIB_NOT_FOUND) + return; + if (size == 0) + return; - fprintf(f,"print \"%s=[%s]\";\n", key, key); + fprintf(f, "print \"%s=[%s]\";\n", key, key); } static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block) { - grib_dumper_bufr_decode_filter *self = (grib_dumper_bufr_decode_filter*)d; - if (!grib_inline_strcmp(a->name,"BUFR") || - !grib_inline_strcmp(a->name,"GRIB") || - !grib_inline_strcmp(a->name,"META") - ) { - grib_handle* h=grib_handle_of_accessor(a); - depth=2; - self->begin=1; - self->empty=1; - depth+=2; - _dump_long_array(h,self->dumper.out,"dataPresentIndicator"); - _dump_long_array(h,self->dumper.out,"delayedDescriptorReplicationFactor"); - _dump_long_array(h,self->dumper.out,"shortDelayedDescriptorReplicationFactor"); - _dump_long_array(h,self->dumper.out,"extendedDelayedDescriptorReplicationFactor"); + grib_dumper_bufr_decode_filter* self = (grib_dumper_bufr_decode_filter*)d; + if (!grib_inline_strcmp(a->name, "BUFR") || + !grib_inline_strcmp(a->name, "GRIB") || + !grib_inline_strcmp(a->name, "META")) { + grib_handle* h = grib_handle_of_accessor(a); + depth = 2; + self->begin = 1; + self->empty = 1; + depth += 2; + _dump_long_array(h, self->dumper.out, "dataPresentIndicator"); + _dump_long_array(h, self->dumper.out, "delayedDescriptorReplicationFactor"); + _dump_long_array(h, self->dumper.out, "shortDelayedDescriptorReplicationFactor"); + _dump_long_array(h, self->dumper.out, "extendedDelayedDescriptorReplicationFactor"); /* Do not show the inputOverriddenReferenceValues array. That's more for ENCODING */ /*_dump_long_array(h,self->dumper.out,"inputOverriddenReferenceValues","inputOverriddenReferenceValues");*/ - grib_dump_accessors_block(d,block); - depth-=2; - } else if (!grib_inline_strcmp(a->name,"groupNumber")) { - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) + grib_dump_accessors_block(d, block); + depth -= 2; + } + else if (!grib_inline_strcmp(a->name, "groupNumber")) { + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - self->begin=1; - self->empty=1; - depth+=2; - grib_dump_accessors_block(d,block); - depth-=2; - } else { - grib_dump_accessors_block(d,block); + self->begin = 1; + self->empty = 1; + depth += 2; + grib_dump_accessors_block(d, block); + depth -= 2; + } + else { + grib_dump_accessors_block(d, block); } } -static void dump_attributes(grib_dumper* d,grib_accessor* a, const char* prefix) +static void dump_attributes(grib_dumper* d, grib_accessor* a, const char* prefix) { - int i=0; - grib_dumper_bufr_decode_filter *self = (grib_dumper_bufr_decode_filter*)d; + int i = 0; + grib_dumper_bufr_decode_filter* self = (grib_dumper_bufr_decode_filter*)d; unsigned long flags; while (i < MAX_ACCESSOR_ATTRIBUTES && a->attributes[i]) { - self->isAttribute=1; - if ( (d->option_flags & GRIB_DUMP_FLAG_ALL_ATTRIBUTES ) == 0 - && (a->attributes[i]->flags & GRIB_ACCESSOR_FLAG_DUMP)== 0 ) - { + self->isAttribute = 1; + if ((d->option_flags & GRIB_DUMP_FLAG_ALL_ATTRIBUTES) == 0 && (a->attributes[i]->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) { i++; continue; } - self->isLeaf=a->attributes[i]->attributes[0]==NULL ? 1 : 0; + self->isLeaf = a->attributes[i]->attributes[0] == NULL ? 1 : 0; /* fprintf(self->dumper.out,","); */ /* fprintf(self->dumper.out,"\n%-*s",depth," "); */ /* fprintf(out,"\"%s\" : ",a->attributes[i]->name); */ - flags=a->attributes[i]->flags; + flags = a->attributes[i]->flags; a->attributes[i]->flags |= GRIB_ACCESSOR_FLAG_DUMP; switch (grib_accessor_get_native_type(a->attributes[i])) { - case GRIB_TYPE_LONG: - dump_long_attribute(d,a->attributes[i],prefix); - break; - case GRIB_TYPE_DOUBLE: - dump_values_attribute(d,a->attributes[i],prefix); - break; - case GRIB_TYPE_STRING: - break; + case GRIB_TYPE_LONG: + dump_long_attribute(d, a->attributes[i], prefix); + break; + case GRIB_TYPE_DOUBLE: + dump_values_attribute(d, a->attributes[i], prefix); + break; + case GRIB_TYPE_STRING: + break; } - a->attributes[i]->flags=flags; + a->attributes[i]->flags = flags; i++; } - self->isLeaf=0; - self->isAttribute=0; + self->isLeaf = 0; + self->isAttribute = 0; } diff --git a/src/grib_dumper_class_bufr_decode_fortran.c b/src/grib_dumper_class_bufr_decode_fortran.c index 592f04327..5c1b2e41a 100644 --- a/src/grib_dumper_class_bufr_decode_fortran.c +++ b/src/grib_dumper_class_bufr_decode_fortran.c @@ -42,52 +42,53 @@ or edit "dumper.class" and rerun ./make_class.pl */ -static void init_class (grib_dumper_class*); -static int init (grib_dumper* d); -static int destroy (grib_dumper*); -static void dump_long (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_bits (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_double (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_string (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_string_array (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_bytes (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_values (grib_dumper* d, grib_accessor* a); -static void dump_label (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_section (grib_dumper* d, grib_accessor* a,grib_block_of_accessors* block); -static void header (grib_dumper*,grib_handle*); -static void footer (grib_dumper*,grib_handle*); - -typedef struct grib_dumper_bufr_decode_fortran { - grib_dumper dumper; -/* Members defined in bufr_decode_fortran */ - long section_offset; - long empty; - long end; - long isLeaf; - long isAttribute; - grib_string_list* keys; +static void init_class(grib_dumper_class*); +static int init(grib_dumper* d); +static int destroy(grib_dumper*); +static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_bits(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_values(grib_dumper* d, grib_accessor* a); +static void dump_label(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block); +static void header(grib_dumper*, grib_handle*); +static void footer(grib_dumper*, grib_handle*); + +typedef struct grib_dumper_bufr_decode_fortran +{ + grib_dumper dumper; + /* Members defined in bufr_decode_fortran */ + long section_offset; + long empty; + long end; + long isLeaf; + long isAttribute; + grib_string_list* keys; } grib_dumper_bufr_decode_fortran; static grib_dumper_class _grib_dumper_class_bufr_decode_fortran = { - 0, /* super */ - "bufr_decode_fortran", /* name */ - sizeof(grib_dumper_bufr_decode_fortran), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - &destroy, /* free mem */ - &dump_long, /* dump long */ - &dump_double, /* dump double */ - &dump_string, /* dump string */ - &dump_string_array, /* dump string array */ - &dump_label, /* dump labels */ - &dump_bytes, /* dump bytes */ - &dump_bits, /* dump bits */ - &dump_section, /* dump section */ - &dump_values, /* dump values */ - &header, /* header */ - &footer, /* footer */ + 0, /* super */ + "bufr_decode_fortran", /* name */ + sizeof(grib_dumper_bufr_decode_fortran), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + &destroy, /* free mem */ + &dump_long, /* dump long */ + &dump_double, /* dump double */ + &dump_string, /* dump string */ + &dump_string_array, /* dump string array */ + &dump_label, /* dump labels */ + &dump_bytes, /* dump bytes */ + &dump_bits, /* dump bits */ + &dump_section, /* dump section */ + &dump_values, /* dump values */ + &header, /* header */ + &footer, /* footer */ }; grib_dumper_class* grib_dumper_class_bufr_decode_fortran = &_grib_dumper_class_bufr_decode_fortran; @@ -99,103 +100,113 @@ static void dump_attributes(grib_dumper* d, grib_accessor* a, const char* prefix /* 0 means input strings are equal and 1 means not equal */ GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b) { - if (*a != *b) return 1; - while((*a!=0 && *b!=0) && *(a) == *(b) ) {a++;b++;} - return (*a==0 && *b==0) ? 0 : 1; + if (*a != *b) + return 1; + while ((*a != 0 && *b != 0) && *(a) == *(b)) { + a++; + b++; + } + return (*a == 0 && *b == 0) ? 0 : 1; } typedef struct string_count string_count; -struct string_count { +struct string_count +{ char* value; int count; string_count* next; }; -static int depth=0; +static int depth = 0; -static void init_class (grib_dumper_class* c){} +static void init_class(grib_dumper_class* c) {} static int init(grib_dumper* d) { - grib_dumper_bufr_decode_fortran *self = (grib_dumper_bufr_decode_fortran*)d; - grib_context* c=d->handle->context; - self->section_offset=0; - self->empty=1; - d->count=1; - self->isLeaf=0; - self->isAttribute=0; - self->keys=(grib_string_list*)grib_context_malloc_clear(c,sizeof(grib_string_list)); + grib_dumper_bufr_decode_fortran* self = (grib_dumper_bufr_decode_fortran*)d; + grib_context* c = d->handle->context; + self->section_offset = 0; + self->empty = 1; + d->count = 1; + self->isLeaf = 0; + self->isAttribute = 0; + self->keys = (grib_string_list*)grib_context_malloc_clear(c, sizeof(grib_string_list)); return GRIB_SUCCESS; } static int destroy(grib_dumper* d) { - grib_dumper_bufr_decode_fortran *self = (grib_dumper_bufr_decode_fortran*)d; - grib_string_list* next=self->keys; - grib_string_list* cur=self->keys; - grib_context* c=d->handle->context; - while(next) { - cur=next; - next=next->next; - grib_context_free(c,cur->value); - grib_context_free(c,cur); + grib_dumper_bufr_decode_fortran* self = (grib_dumper_bufr_decode_fortran*)d; + grib_string_list* next = self->keys; + grib_string_list* cur = self->keys; + grib_context* c = d->handle->context; + while (next) { + cur = next; + next = next->next; + grib_context_free(c, cur->value); + grib_context_free(c, cur); } return GRIB_SUCCESS; } static void dump_values(grib_dumper* d, grib_accessor* a) { - grib_dumper_bufr_decode_fortran *self = (grib_dumper_bufr_decode_fortran*)d; - double value=0; size_t size = 0; - int err = 0; - int r=0; - long count=0; - grib_context* c=a->context; - grib_handle* h=grib_handle_of_accessor(a); - - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) !=0) + grib_dumper_bufr_decode_fortran* self = (grib_dumper_bufr_decode_fortran*)d; + double value = 0; + size_t size = 0; + int err = 0; + int r = 0; + long count = 0; + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); + + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; - if (size<=1) { - err=grib_unpack_double(a,&value,&size); + if (size <= 1) { + err = grib_unpack_double(a, &value, &size); } - self->empty=0; + self->empty = 0; - if (size>1) { - depth-=2; + if (size > 1) { + depth -= 2; - if ((r=compute_bufr_key_rank(h,self->keys,a->name))!=0) - fprintf(self->dumper.out," call codes_get(ibufr, '#%d#%s', rValues)\n",r,a->name); + if ((r = compute_bufr_key_rank(h, self->keys, a->name)) != 0) + fprintf(self->dumper.out, " call codes_get(ibufr, '#%d#%s', rValues)\n", r, a->name); else - fprintf(self->dumper.out," call codes_get(ibufr, '%s', rValues)\n",a->name); - } else { - r=compute_bufr_key_rank(h,self->keys,a->name); - if( !grib_is_missing_double(a,value) ) { - if (r!=0) - fprintf(self->dumper.out," call codes_get(ibufr, '#%d#%s', rVal)\n", r, a->name); + fprintf(self->dumper.out, " call codes_get(ibufr, '%s', rValues)\n", a->name); + } + else { + r = compute_bufr_key_rank(h, self->keys, a->name); + if (!grib_is_missing_double(a, value)) { + if (r != 0) + fprintf(self->dumper.out, " call codes_get(ibufr, '#%d#%s', rVal)\n", r, a->name); else - fprintf(self->dumper.out," call codes_get(ibufr, '%s', rVal)\n", a->name); + fprintf(self->dumper.out, " call codes_get(ibufr, '%s', rVal)\n", a->name); } } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } (void)err; /* TODO */ @@ -203,166 +214,176 @@ static void dump_values(grib_dumper* d, grib_accessor* a) static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* prefix) { - grib_dumper_bufr_decode_fortran *self = (grib_dumper_bufr_decode_fortran*)d; - double value=0; size_t size = 0; - int err = 0; - long count=0; - grib_context* c=a->context; - - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) !=0) + grib_dumper_bufr_decode_fortran* self = (grib_dumper_bufr_decode_fortran*)d; + double value = 0; + size_t size = 0; + int err = 0; + long count = 0; + grib_context* c = a->context; + + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; if (size <= 1) { - err=grib_unpack_double(a,&value,&size); + err = grib_unpack_double(a, &value, &size); } - self->empty=0; + self->empty = 0; - if (size>1) { - fprintf(self->dumper.out," call codes_get(ibufr, '%s->%s', rValues)\n",prefix,a->name); - } else { - if( !grib_is_missing_double(a,value) ) { - fprintf(self->dumper.out," call codes_get(ibufr, '%s->%s', rVal)\n", prefix, a->name); + if (size > 1) { + fprintf(self->dumper.out, " call codes_get(ibufr, '%s->%s', rValues)\n", prefix, a->name); + } + else { + if (!grib_is_missing_double(a, value)) { + fprintf(self->dumper.out, " call codes_get(ibufr, '%s->%s', rVal)\n", prefix, a->name); } } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix1; - prefix1=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+strlen(prefix)+5)); - sprintf(prefix1,"%s->%s",prefix,a->name); + prefix1 = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + strlen(prefix) + 5)); + sprintf(prefix1, "%s->%s", prefix, a->name); - dump_attributes(d,a,prefix1); + dump_attributes(d, a, prefix1); - grib_context_free(c,prefix1); - depth-=2; + grib_context_free(c, prefix1); + depth -= 2; } (void)err; /* TODO */ } -static void dump_long(grib_dumper* d,grib_accessor* a, const char* comment) +static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_decode_fortran *self = (grib_dumper_bufr_decode_fortran*)d; - long value=0; size_t size = 0; - int err = 0; - int r=0; - long count=0; - grib_context* c=a->context; - grib_handle* h=grib_handle_of_accessor(a); - - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 ) + grib_dumper_bufr_decode_fortran* self = (grib_dumper_bufr_decode_fortran*)d; + long value = 0; + size_t size = 0; + int err = 0; + int r = 0; + long count = 0; + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); + + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; - if ( (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { - if (self->isLeaf==0) { + if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; - - r=compute_bufr_key_rank(h,self->keys,a->name); - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; - - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + int dofree = 0; + + r = compute_bufr_key_rank(h, self->keys, a->name); + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; + + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } return; } if (size <= 1) { - err=grib_unpack_long(a,&value,&size); + err = grib_unpack_long(a, &value, &size); } - self->empty=0; + self->empty = 0; - if (size>1) { - depth-=2; - fprintf(self->dumper.out," if(allocated(iValues)) deallocate(iValues)\n"); + if (size > 1) { + depth -= 2; + fprintf(self->dumper.out, " if(allocated(iValues)) deallocate(iValues)\n"); - if ((r=compute_bufr_key_rank(h,self->keys,a->name))!=0) - fprintf(self->dumper.out," call codes_get(ibufr, '#%d#%s', iValues)\n", r,a->name); + if ((r = compute_bufr_key_rank(h, self->keys, a->name)) != 0) + fprintf(self->dumper.out, " call codes_get(ibufr, '#%d#%s', iValues)\n", r, a->name); else - fprintf(self->dumper.out," call codes_get(ibufr, '%s', iValues)\n", a->name); - - } else { - r=compute_bufr_key_rank(h,self->keys,a->name); - if( !grib_is_missing_long(a,value) ) { - if (r!=0) - fprintf(self->dumper.out," call codes_get(ibufr, '#%d#%s', iVal)\n", r, a->name); + fprintf(self->dumper.out, " call codes_get(ibufr, '%s', iValues)\n", a->name); + } + else { + r = compute_bufr_key_rank(h, self->keys, a->name); + if (!grib_is_missing_long(a, value)) { + if (r != 0) + fprintf(self->dumper.out, " call codes_get(ibufr, '#%d#%s', iVal)\n", r, a->name); else - fprintf(self->dumper.out," call codes_get(ibufr, '%s', iVal)\n", a->name); + fprintf(self->dumper.out, " call codes_get(ibufr, '%s', iVal)\n", a->name); } } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } (void)err; /* TODO */ } static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* prefix) { - grib_dumper_bufr_decode_fortran *self = (grib_dumper_bufr_decode_fortran*)d; - long value=0; size_t size = 0; - int err = 0; - long count=0; - grib_context* c=a->context; - - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + grib_dumper_bufr_decode_fortran* self = (grib_dumper_bufr_decode_fortran*)d; + long value = 0; + size_t size = 0; + int err = 0; + long count = 0; + grib_context* c = a->context; + + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; if (size <= 1) { - err=grib_unpack_long(a,&value,&size); + err = grib_unpack_long(a, &value, &size); } - self->empty=0; - - if (size>1) { - depth-=2; - fprintf(self->dumper.out," if(allocated(iValues)) deallocate(iValues)\n"); + self->empty = 0; - fprintf(self->dumper.out," call codes_get(ibufr, '%s->%s', iValues)\n", prefix, a->name); + if (size > 1) { + depth -= 2; + fprintf(self->dumper.out, " if(allocated(iValues)) deallocate(iValues)\n"); - } else { - if( !grib_is_missing_long(a,value) ) { - fprintf(self->dumper.out," call codes_get(ibufr, '%s->%s', iVal)\n", prefix, a->name); + fprintf(self->dumper.out, " call codes_get(ibufr, '%s->%s', iValues)\n", prefix, a->name); + } + else { + if (!grib_is_missing_long(a, value)) { + fprintf(self->dumper.out, " call codes_get(ibufr, '%s->%s', iVal)\n", prefix, a->name); } } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix1; - prefix1=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+strlen(prefix)+5)); - sprintf(prefix1,"%s->%s",prefix,a->name); + prefix1 = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + strlen(prefix) + 5)); + sprintf(prefix1, "%s->%s", prefix, a->name); - dump_attributes(d,a,prefix1); + dump_attributes(d, a, prefix1); - grib_context_free(c,prefix1); - depth-=2; + grib_context_free(c, prefix1); + depth -= 2; } (void)err; /* TODO */ } @@ -373,89 +394,96 @@ static void dump_bits(grib_dumper* d, grib_accessor* a, const char* comment) static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_decode_fortran *self = (grib_dumper_bufr_decode_fortran*)d; - double value; size_t size = 1; + grib_dumper_bufr_decode_fortran* self = (grib_dumper_bufr_decode_fortran*)d; + double value; + size_t size = 1; int r; - grib_handle* h=grib_handle_of_accessor(a); - grib_context* c=h->context; + grib_handle* h = grib_handle_of_accessor(a); + grib_context* c = h->context; - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_unpack_double(a,&value,&size); - self->empty=0; + grib_unpack_double(a, &value, &size); + self->empty = 0; - r=compute_bufr_key_rank(h,self->keys,a->name); - if( !grib_is_missing_double(a,value) ) { - if (r!=0) - fprintf(self->dumper.out," call codes_get(ibufr,'#%d#%s', rVal)\n",r,a->name); + r = compute_bufr_key_rank(h, self->keys, a->name); + if (!grib_is_missing_double(a, value)) { + if (r != 0) + fprintf(self->dumper.out, " call codes_get(ibufr,'#%d#%s', rVal)\n", r, a->name); else - fprintf(self->dumper.out," call codes_get(ibufr,'%s', rVal)\n",a->name); + fprintf(self->dumper.out, " call codes_get(ibufr,'%s', rVal)\n", a->name); } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } } static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_decode_fortran *self = (grib_dumper_bufr_decode_fortran*)d; - size_t size = 0; - grib_context* c=NULL; - int err = 0; - long count=0; - int r=0; - grib_handle* h=grib_handle_of_accessor(a); + grib_dumper_bufr_decode_fortran* self = (grib_dumper_bufr_decode_fortran*)d; + size_t size = 0; + grib_context* c = NULL; + int err = 0; + long count = 0; + int r = 0; + grib_handle* h = grib_handle_of_accessor(a); - c=a->context; + c = a->context; - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a,&count); - size=count; - if (size==1) { - dump_string(d,a,comment); + grib_value_count(a, &count); + size = count; + if (size == 1) { + dump_string(d, a, comment); return; } - fprintf(self->dumper.out," if(allocated(sValues)) deallocate(sValues)\n"); - fprintf(self->dumper.out," allocate(sValues(%lu))\n", (unsigned long)size); + fprintf(self->dumper.out, " if(allocated(sValues)) deallocate(sValues)\n"); + fprintf(self->dumper.out, " allocate(sValues(%lu))\n", (unsigned long)size); - self->empty=0; + self->empty = 0; - if (self->isLeaf==0) { - if ((r=compute_bufr_key_rank(h,self->keys,a->name))!=0) - fprintf(self->dumper.out," call codes_get_string_array(ibufr,'#%d#%s',sValues)\n",r,a->name); + if (self->isLeaf == 0) { + if ((r = compute_bufr_key_rank(h, self->keys, a->name)) != 0) + fprintf(self->dumper.out, " call codes_get_string_array(ibufr,'#%d#%s',sValues)\n", r, a->name); else - fprintf(self->dumper.out," call codes_get_string_array(ibufr,'%s',sValues)\n",a->name); + fprintf(self->dumper.out, " call codes_get_string_array(ibufr,'%s',sValues)\n", a->name); } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } (void)err; /* TODO */ @@ -463,63 +491,71 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_decode_fortran *self = (grib_dumper_bufr_decode_fortran*)d; - char *value=NULL; - char *p = NULL; - size_t size = 0; - grib_context* c=NULL; + grib_dumper_bufr_decode_fortran* self = (grib_dumper_bufr_decode_fortran*)d; + char* value = NULL; + char* p = NULL; + size_t size = 0; + grib_context* c = NULL; int r; - int err = _grib_get_string_length(a,&size); - grib_handle* h=grib_handle_of_accessor(a); + int err = _grib_get_string_length(a, &size); + grib_handle* h = grib_handle_of_accessor(a); - c=a->context; - if (size==0) return; + c = a->context; + if (size == 0) + return; - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - value=(char*)grib_context_malloc_clear(c,size); + value = (char*)grib_context_malloc_clear(c, size); if (!value) { - grib_context_log(c,GRIB_LOG_FATAL,"unable to allocate %d bytes",(int)size); + grib_context_log(c, GRIB_LOG_FATAL, "unable to allocate %d bytes", (int)size); return; } - self->empty=0; + self->empty = 0; - err = grib_unpack_string(a,value,&size); - p=value; - r=compute_bufr_key_rank(h,self->keys,a->name); - if (grib_is_missing_string(a,(unsigned char *)value,size)) + err = grib_unpack_string(a, value, &size); + p = value; + r = compute_bufr_key_rank(h, self->keys, a->name); + if (grib_is_missing_string(a, (unsigned char*)value, size)) return; - while(*p) { if(!isprint(*p)) *p = '.'; p++; } + while (*p) { + if (!isprint(*p)) + *p = '.'; + p++; + } - if (self->isLeaf==0) { - depth+=2; - if (r!=0) - fprintf(self->dumper.out," call codes_get(ibufr, '#%d#%s', sVal)\n", r,a->name); + if (self->isLeaf == 0) { + depth += 2; + if (r != 0) + fprintf(self->dumper.out, " call codes_get(ibufr, '#%d#%s', sVal)\n", r, a->name); else - fprintf(self->dumper.out," call codes_get(ibufr, '%s', sVal)\n", a->name); + fprintf(self->dumper.out, " call codes_get(ibufr, '%s', sVal)\n", a->name); } /*fprintf(self->dumper.out,"\'%s\')\n",value);*/ - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } - grib_context_free(c,value); + grib_context_free(c, value); (void)err; /* TODO */ } @@ -533,114 +569,115 @@ static void dump_label(grib_dumper* d, grib_accessor* a, const char* comment) static void _dump_long_array(grib_handle* h, FILE* f, const char* key) { - size_t size=0; - if (grib_get_size(h,key,&size)==GRIB_NOT_FOUND) return; - if (size==0) return; + size_t size = 0; + if (grib_get_size(h, key, &size) == GRIB_NOT_FOUND) + return; + if (size == 0) + return; - fprintf(f," if(allocated(iValues)) deallocate(iValues)\n"); - fprintf(f," call codes_get(ibufr, '%s', iValues)\n",key); + fprintf(f, " if(allocated(iValues)) deallocate(iValues)\n"); + fprintf(f, " call codes_get(ibufr, '%s', iValues)\n", key); } static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block) { - grib_dumper_bufr_decode_fortran *self = (grib_dumper_bufr_decode_fortran*)d; - if (!grib_inline_strcmp(a->name,"BUFR") || - !grib_inline_strcmp(a->name,"GRIB") || - !grib_inline_strcmp(a->name,"META") - ) { - grib_handle* h=grib_handle_of_accessor(a); - depth=2; - self->empty=1; - depth+=2; - _dump_long_array(h,self->dumper.out,"dataPresentIndicator"); - _dump_long_array(h,self->dumper.out,"delayedDescriptorReplicationFactor"); - _dump_long_array(h,self->dumper.out,"shortDelayedDescriptorReplicationFactor"); - _dump_long_array(h,self->dumper.out,"extendedDelayedDescriptorReplicationFactor"); + grib_dumper_bufr_decode_fortran* self = (grib_dumper_bufr_decode_fortran*)d; + if (!grib_inline_strcmp(a->name, "BUFR") || + !grib_inline_strcmp(a->name, "GRIB") || + !grib_inline_strcmp(a->name, "META")) { + grib_handle* h = grib_handle_of_accessor(a); + depth = 2; + self->empty = 1; + depth += 2; + _dump_long_array(h, self->dumper.out, "dataPresentIndicator"); + _dump_long_array(h, self->dumper.out, "delayedDescriptorReplicationFactor"); + _dump_long_array(h, self->dumper.out, "shortDelayedDescriptorReplicationFactor"); + _dump_long_array(h, self->dumper.out, "extendedDelayedDescriptorReplicationFactor"); /* Do not show the inputOverriddenReferenceValues array. That's more for ENCODING */ /* _dump_long_array(h,self->dumper.out,"inputOverriddenReferenceValues","inputOverriddenReferenceValues"); */ - grib_dump_accessors_block(d,block); - depth-=2; - } else if (!grib_inline_strcmp(a->name,"groupNumber")) { - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) + grib_dump_accessors_block(d, block); + depth -= 2; + } + else if (!grib_inline_strcmp(a->name, "groupNumber")) { + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - self->empty=1; - depth+=2; - grib_dump_accessors_block(d,block); - depth-=2; - } else { - grib_dump_accessors_block(d,block); + self->empty = 1; + depth += 2; + grib_dump_accessors_block(d, block); + depth -= 2; + } + else { + grib_dump_accessors_block(d, block); } } -static void dump_attributes(grib_dumper* d,grib_accessor* a, const char* prefix) +static void dump_attributes(grib_dumper* d, grib_accessor* a, const char* prefix) { - int i=0; - grib_dumper_bufr_decode_fortran *self = (grib_dumper_bufr_decode_fortran*)d; + int i = 0; + grib_dumper_bufr_decode_fortran* self = (grib_dumper_bufr_decode_fortran*)d; unsigned long flags; while (i < MAX_ACCESSOR_ATTRIBUTES && a->attributes[i]) { - self->isAttribute=1; - if ( (d->option_flags & GRIB_DUMP_FLAG_ALL_ATTRIBUTES ) == 0 - && (a->attributes[i]->flags & GRIB_ACCESSOR_FLAG_DUMP)== 0 ) - { + self->isAttribute = 1; + if ((d->option_flags & GRIB_DUMP_FLAG_ALL_ATTRIBUTES) == 0 && (a->attributes[i]->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) { i++; continue; } - self->isLeaf=a->attributes[i]->attributes[0]==NULL ? 1 : 0; - flags=a->attributes[i]->flags; + self->isLeaf = a->attributes[i]->attributes[0] == NULL ? 1 : 0; + flags = a->attributes[i]->flags; a->attributes[i]->flags |= GRIB_ACCESSOR_FLAG_DUMP; switch (grib_accessor_get_native_type(a->attributes[i])) { - case GRIB_TYPE_LONG: - dump_long_attribute(d,a->attributes[i],prefix); - break; - case GRIB_TYPE_DOUBLE: - dump_values_attribute(d,a->attributes[i],prefix); - break; - case GRIB_TYPE_STRING: - break; + case GRIB_TYPE_LONG: + dump_long_attribute(d, a->attributes[i], prefix); + break; + case GRIB_TYPE_DOUBLE: + dump_values_attribute(d, a->attributes[i], prefix); + break; + case GRIB_TYPE_STRING: + break; } - a->attributes[i]->flags=flags; + a->attributes[i]->flags = flags; i++; } - self->isLeaf=0; - self->isAttribute=0; + self->isLeaf = 0; + self->isAttribute = 0; } static void header(grib_dumper* d, grib_handle* h) { - grib_dumper_bufr_decode_fortran *self = (grib_dumper_bufr_decode_fortran*)d; + grib_dumper_bufr_decode_fortran* self = (grib_dumper_bufr_decode_fortran*)d; - if (d->count<2) { + if (d->count < 2) { /* This is the first message being processed */ - fprintf(self->dumper.out,"! This program was automatically generated with bufr_dump -Dfortran\n"); - fprintf(self->dumper.out,"! Using ecCodes version: "); + fprintf(self->dumper.out, "! This program was automatically generated with bufr_dump -Dfortran\n"); + fprintf(self->dumper.out, "! Using ecCodes version: "); grib_print_api_version(self->dumper.out); fprintf(self->dumper.out, "\n\n"); - fprintf(self->dumper.out,"program bufr_decode\n"); - fprintf(self->dumper.out," use eccodes\n"); - fprintf(self->dumper.out," implicit none\n"); - fprintf(self->dumper.out," integer, parameter :: max_strsize = 200\n"); - fprintf(self->dumper.out," integer :: iret\n"); - fprintf(self->dumper.out," integer :: ifile\n"); - fprintf(self->dumper.out," integer :: ibufr\n"); - fprintf(self->dumper.out," integer(kind=4) :: iVal\n"); - fprintf(self->dumper.out," real(kind=8) :: rVal\n"); - fprintf(self->dumper.out," character(len=max_strsize) :: sVal\n"); - fprintf(self->dumper.out," integer(kind=4), dimension(:), allocatable :: iValues\n"); - fprintf(self->dumper.out," character(len=max_strsize) , dimension(:),allocatable :: sValues\n"); - fprintf(self->dumper.out," real(kind=8), dimension(:), allocatable :: rValues\n\n"); - fprintf(self->dumper.out," character(len=max_strsize) :: infile_name\n"); - fprintf(self->dumper.out," call getarg(1, infile_name)\n"); - fprintf(self->dumper.out," call codes_open_file(ifile, infile_name, 'r')\n\n"); - } - fprintf(self->dumper.out," ! Message number %ld\n ! -----------------\n", d->count); - fprintf(self->dumper.out," write(*,*) 'Decoding message number %ld'\n", d->count); - fprintf(self->dumper.out," call codes_bufr_new_from_file(ifile, ibufr)\n"); - fprintf(self->dumper.out," call codes_set(ibufr, 'unpack', 1)\n"); + fprintf(self->dumper.out, "program bufr_decode\n"); + fprintf(self->dumper.out, " use eccodes\n"); + fprintf(self->dumper.out, " implicit none\n"); + fprintf(self->dumper.out, " integer, parameter :: max_strsize = 200\n"); + fprintf(self->dumper.out, " integer :: iret\n"); + fprintf(self->dumper.out, " integer :: ifile\n"); + fprintf(self->dumper.out, " integer :: ibufr\n"); + fprintf(self->dumper.out, " integer(kind=4) :: iVal\n"); + fprintf(self->dumper.out, " real(kind=8) :: rVal\n"); + fprintf(self->dumper.out, " character(len=max_strsize) :: sVal\n"); + fprintf(self->dumper.out, " integer(kind=4), dimension(:), allocatable :: iValues\n"); + fprintf(self->dumper.out, " character(len=max_strsize) , dimension(:),allocatable :: sValues\n"); + fprintf(self->dumper.out, " real(kind=8), dimension(:), allocatable :: rValues\n\n"); + fprintf(self->dumper.out, " character(len=max_strsize) :: infile_name\n"); + fprintf(self->dumper.out, " call getarg(1, infile_name)\n"); + fprintf(self->dumper.out, " call codes_open_file(ifile, infile_name, 'r')\n\n"); + } + fprintf(self->dumper.out, " ! Message number %ld\n ! -----------------\n", d->count); + fprintf(self->dumper.out, " write(*,*) 'Decoding message number %ld'\n", d->count); + fprintf(self->dumper.out, " call codes_bufr_new_from_file(ifile, ibufr)\n"); + fprintf(self->dumper.out, " call codes_set(ibufr, 'unpack', 1)\n"); } static void footer(grib_dumper* d, grib_handle* h) { - grib_dumper_bufr_decode_fortran *self = (grib_dumper_bufr_decode_fortran*)d; + grib_dumper_bufr_decode_fortran* self = (grib_dumper_bufr_decode_fortran*)d; /*fprintf(self->dumper.out," call codes_close_file(ifile)\n");*/ - fprintf(self->dumper.out," call codes_release(ibufr)\n"); + fprintf(self->dumper.out, " call codes_release(ibufr)\n"); } diff --git a/src/grib_dumper_class_bufr_decode_python.c b/src/grib_dumper_class_bufr_decode_python.c index 0bf477f4b..a92ec1f7f 100644 --- a/src/grib_dumper_class_bufr_decode_python.c +++ b/src/grib_dumper_class_bufr_decode_python.c @@ -42,221 +42,232 @@ or edit "dumper.class" and rerun ./make_class.pl */ -static void init_class (grib_dumper_class*); -static int init (grib_dumper* d); -static int destroy (grib_dumper*); -static void dump_long (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_bits (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_double (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_string (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_string_array (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_bytes (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_values (grib_dumper* d, grib_accessor* a); -static void dump_label (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_section (grib_dumper* d, grib_accessor* a,grib_block_of_accessors* block); -static void header (grib_dumper*,grib_handle*); -static void footer (grib_dumper*,grib_handle*); - -typedef struct grib_dumper_bufr_decode_python { - grib_dumper dumper; -/* Members defined in bufr_decode_python */ - long section_offset; - long empty; - long end; - long isLeaf; - long isAttribute; - grib_string_list* keys; +static void init_class(grib_dumper_class*); +static int init(grib_dumper* d); +static int destroy(grib_dumper*); +static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_bits(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_values(grib_dumper* d, grib_accessor* a); +static void dump_label(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block); +static void header(grib_dumper*, grib_handle*); +static void footer(grib_dumper*, grib_handle*); + +typedef struct grib_dumper_bufr_decode_python +{ + grib_dumper dumper; + /* Members defined in bufr_decode_python */ + long section_offset; + long empty; + long end; + long isLeaf; + long isAttribute; + grib_string_list* keys; } grib_dumper_bufr_decode_python; static grib_dumper_class _grib_dumper_class_bufr_decode_python = { - 0, /* super */ - "bufr_decode_python", /* name */ - sizeof(grib_dumper_bufr_decode_python), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - &destroy, /* free mem */ - &dump_long, /* dump long */ - &dump_double, /* dump double */ - &dump_string, /* dump string */ - &dump_string_array, /* dump string array */ - &dump_label, /* dump labels */ - &dump_bytes, /* dump bytes */ - &dump_bits, /* dump bits */ - &dump_section, /* dump section */ - &dump_values, /* dump values */ - &header, /* header */ - &footer, /* footer */ + 0, /* super */ + "bufr_decode_python", /* name */ + sizeof(grib_dumper_bufr_decode_python), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + &destroy, /* free mem */ + &dump_long, /* dump long */ + &dump_double, /* dump double */ + &dump_string, /* dump string */ + &dump_string_array, /* dump string array */ + &dump_label, /* dump labels */ + &dump_bytes, /* dump bytes */ + &dump_bits, /* dump bits */ + &dump_section, /* dump section */ + &dump_values, /* dump values */ + &header, /* header */ + &footer, /* footer */ }; grib_dumper_class* grib_dumper_class_bufr_decode_python = &_grib_dumper_class_bufr_decode_python; /* END_CLASS_IMP */ -static void dump_attributes(grib_dumper* d,grib_accessor* a, const char* prefix); +static void dump_attributes(grib_dumper* d, grib_accessor* a, const char* prefix); /* Note: A fast cut-down version of strcmp which does NOT return -1 */ /* 0 means input strings are equal and 1 means not equal */ GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b) { - if (*a != *b) return 1; - while((*a!=0 && *b!=0) && *(a) == *(b) ) {a++;b++;} - return (*a==0 && *b==0) ? 0 : 1; + if (*a != *b) + return 1; + while ((*a != 0 && *b != 0) && *(a) == *(b)) { + a++; + b++; + } + return (*a == 0 && *b == 0) ? 0 : 1; } typedef struct string_count string_count; -struct string_count { +struct string_count +{ char* value; int count; string_count* next; }; -static int depth=0; +static int depth = 0; -static void init_class (grib_dumper_class* c){} +static void init_class(grib_dumper_class* c) {} static int init(grib_dumper* d) { - grib_dumper_bufr_decode_python *self = (grib_dumper_bufr_decode_python*)d; - grib_context* c=d->handle->context; - self->section_offset=0; - self->empty=1; - d->count=1; - self->isLeaf=0; - self->isAttribute=0; - self->keys=(grib_string_list*)grib_context_malloc_clear(c,sizeof(grib_string_list)); + grib_dumper_bufr_decode_python* self = (grib_dumper_bufr_decode_python*)d; + grib_context* c = d->handle->context; + self->section_offset = 0; + self->empty = 1; + d->count = 1; + self->isLeaf = 0; + self->isAttribute = 0; + self->keys = (grib_string_list*)grib_context_malloc_clear(c, sizeof(grib_string_list)); return GRIB_SUCCESS; } static int destroy(grib_dumper* d) { - grib_dumper_bufr_decode_python *self = (grib_dumper_bufr_decode_python*)d; - grib_string_list* next=self->keys; - grib_string_list* cur=self->keys; - grib_context* c=d->handle->context; - while(next) { - cur=next; - next=next->next; - grib_context_free(c,cur->value); - grib_context_free(c,cur); + grib_dumper_bufr_decode_python* self = (grib_dumper_bufr_decode_python*)d; + grib_string_list* next = self->keys; + grib_string_list* cur = self->keys; + grib_context* c = d->handle->context; + while (next) { + cur = next; + next = next->next; + grib_context_free(c, cur->value); + grib_context_free(c, cur); } return GRIB_SUCCESS; } -static char* dval_to_string(const grib_context* c,double v) +static char* dval_to_string(const grib_context* c, double v) { - char* sval=(char*)grib_context_malloc_clear(c,sizeof(char)*40); - sprintf(sval,"%.18e",v); + char* sval = (char*)grib_context_malloc_clear(c, sizeof(char) * 40); + sprintf(sval, "%.18e", v); return sval; } -static void dump_values(grib_dumper* d,grib_accessor* a) +static void dump_values(grib_dumper* d, grib_accessor* a) { - grib_dumper_bufr_decode_python *self = (grib_dumper_bufr_decode_python*)d; - double value = 0; size_t size = 0; - int err = 0; - int r=0; - long count=0; - char* sval = NULL; - grib_context* c=a->context; - grib_handle* h=grib_handle_of_accessor(a); - - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) !=0) + grib_dumper_bufr_decode_python* self = (grib_dumper_bufr_decode_python*)d; + double value = 0; + size_t size = 0; + int err = 0; + int r = 0; + long count = 0; + char* sval = NULL; + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); + + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; if (size <= 1) { - err=grib_unpack_double(a,&value,&size); + err = grib_unpack_double(a, &value, &size); } - self->empty=0; + self->empty = 0; - if (size>1) { - depth-=2; - if ((r=compute_bufr_key_rank(h,self->keys,a->name))!=0) - fprintf(self->dumper.out," dVals = codes_get_array(ibufr, '#%d#%s')\n",r,a->name); + if (size > 1) { + depth -= 2; + if ((r = compute_bufr_key_rank(h, self->keys, a->name)) != 0) + fprintf(self->dumper.out, " dVals = codes_get_array(ibufr, '#%d#%s')\n", r, a->name); else - fprintf(self->dumper.out," dVals = codes_get_array(ibufr, '%s')\n",a->name); - } else { - r=compute_bufr_key_rank(h,self->keys,a->name); - if( !grib_is_missing_double(a,value) ) { - - sval=dval_to_string(c,value); - if (r!=0) - fprintf(self->dumper.out," dVal = codes_get(ibufr, '#%d#%s')\n",r,a->name); + fprintf(self->dumper.out, " dVals = codes_get_array(ibufr, '%s')\n", a->name); + } + else { + r = compute_bufr_key_rank(h, self->keys, a->name); + if (!grib_is_missing_double(a, value)) { + sval = dval_to_string(c, value); + if (r != 0) + fprintf(self->dumper.out, " dVal = codes_get(ibufr, '#%d#%s')\n", r, a->name); else - fprintf(self->dumper.out," dVal = codes_get(ibufr, '%s')\n",a->name); + fprintf(self->dumper.out, " dVal = codes_get(ibufr, '%s')\n", a->name); - grib_context_free(c,sval); + grib_context_free(c, sval); } } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } (void)err; /* TODO */ } -static void dump_values_attribute(grib_dumper* d,grib_accessor* a, const char* prefix) +static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* prefix) { - grib_dumper_bufr_decode_python *self = (grib_dumper_bufr_decode_python*)d; - double value=0; size_t size = 0; - int err = 0; - long count=0; + grib_dumper_bufr_decode_python* self = (grib_dumper_bufr_decode_python*)d; + double value = 0; + size_t size = 0; + int err = 0; + long count = 0; char* sval; - grib_context* c=a->context; + grib_context* c = a->context; - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) !=0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; if (size <= 1) { - err=grib_unpack_double(a,&value,&size); + err = grib_unpack_double(a, &value, &size); } - self->empty=0; + self->empty = 0; - if (size>1) { - depth-=2; - fprintf(self->dumper.out," dVals = codes_get_array(ibufr, '%s->%s')\n", prefix,a->name); - } else { + if (size > 1) { + depth -= 2; + fprintf(self->dumper.out, " dVals = codes_get_array(ibufr, '%s->%s')\n", prefix, a->name); + } + else { /* int r=compute_bufr_key_rank(h,self->keys,a->name); */ - if( !grib_is_missing_double(a,value) ) { + if (!grib_is_missing_double(a, value)) { + sval = dval_to_string(c, value); + fprintf(self->dumper.out, " dVal = codes_get(ibufr, '%s->%s')\n", prefix, a->name); - sval=dval_to_string(c,value); - fprintf(self->dumper.out," dVal = codes_get(ibufr, '%s->%s')\n", prefix,a->name); - - grib_context_free(c,sval); + grib_context_free(c, sval); } } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix1; - prefix1=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+strlen(prefix)+5)); - sprintf(prefix1,"%s->%s",prefix,a->name); + prefix1 = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + strlen(prefix) + 5)); + sprintf(prefix1, "%s->%s", prefix, a->name); - dump_attributes(d,a,prefix1); + dump_attributes(d, a, prefix1); - grib_context_free(c,prefix1); - depth-=2; + grib_context_free(c, prefix1); + depth -= 2; } (void)err; /* TODO */ @@ -264,384 +275,408 @@ static void dump_values_attribute(grib_dumper* d,grib_accessor* a, const char* p static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_decode_python *self = (grib_dumper_bufr_decode_python*)d; - long value=0; size_t size = 0; - int err = 0; - int r=0; - long count=0; - grib_context* c=a->context; - grib_handle* h=grib_handle_of_accessor(a); - - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 ) + grib_dumper_bufr_decode_python* self = (grib_dumper_bufr_decode_python*)d; + long value = 0; + size_t size = 0; + int err = 0; + int r = 0; + long count = 0; + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); + + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; - if ( (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { - if (self->isLeaf==0) { + if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; - - r=compute_bufr_key_rank(h,self->keys,a->name); - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; - - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + int dofree = 0; + + r = compute_bufr_key_rank(h, self->keys, a->name); + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; + + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } return; } if (size <= 1) { - err=grib_unpack_long(a,&value,&size); + err = grib_unpack_long(a, &value, &size); } - self->empty=0; + self->empty = 0; - if (size>1) { - depth-=2; - if ((r=compute_bufr_key_rank(h,self->keys,a->name))!=0) - fprintf(self->dumper.out," iValues = codes_get_array(ibufr, '#%d#%s')\n",r,a->name); + if (size > 1) { + depth -= 2; + if ((r = compute_bufr_key_rank(h, self->keys, a->name)) != 0) + fprintf(self->dumper.out, " iValues = codes_get_array(ibufr, '#%d#%s')\n", r, a->name); else - fprintf(self->dumper.out," iValues = codes_get_array(ibufr, '%s')\n",a->name); - - } else { - r=compute_bufr_key_rank(h,self->keys,a->name); - if( !grib_is_missing_long(a,value) ) { - if (r!=0) - fprintf(self->dumper.out," iVal = codes_get(ibufr, '#%d#%s')\n",r,a->name); + fprintf(self->dumper.out, " iValues = codes_get_array(ibufr, '%s')\n", a->name); + } + else { + r = compute_bufr_key_rank(h, self->keys, a->name); + if (!grib_is_missing_long(a, value)) { + if (r != 0) + fprintf(self->dumper.out, " iVal = codes_get(ibufr, '#%d#%s')\n", r, a->name); else - fprintf(self->dumper.out," iVal = codes_get(ibufr, '%s')\n",a->name); + fprintf(self->dumper.out, " iVal = codes_get(ibufr, '%s')\n", a->name); } } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } (void)err; /* TODO */ } static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* prefix) { - grib_dumper_bufr_decode_python *self = (grib_dumper_bufr_decode_python*)d; - long value=0; size_t size = 0; - int err = 0; - long count=0; - grib_context* c=a->context; - - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + grib_dumper_bufr_decode_python* self = (grib_dumper_bufr_decode_python*)d; + long value = 0; + size_t size = 0; + int err = 0; + long count = 0; + grib_context* c = a->context; + + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; if (size <= 1) { - err=grib_unpack_long(a,&value,&size); + err = grib_unpack_long(a, &value, &size); } - self->empty=0; + self->empty = 0; - if (size>1) { - depth-=2; - fprintf(self->dumper.out," iVals = codes_get_array(ibufr, '%s->%s')\n",prefix,a->name); - } else { - if( !grib_is_missing_long(a,value) ) { - fprintf(self->dumper.out," iVal = codes_get(ibufr, '%s->%s')\n",prefix,a->name); + if (size > 1) { + depth -= 2; + fprintf(self->dumper.out, " iVals = codes_get_array(ibufr, '%s->%s')\n", prefix, a->name); + } + else { + if (!grib_is_missing_long(a, value)) { + fprintf(self->dumper.out, " iVal = codes_get(ibufr, '%s->%s')\n", prefix, a->name); } } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix1; - prefix1=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+strlen(prefix)+5)); - sprintf(prefix1,"%s->%s",prefix,a->name); + prefix1 = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + strlen(prefix) + 5)); + sprintf(prefix1, "%s->%s", prefix, a->name); - dump_attributes(d,a,prefix1); + dump_attributes(d, a, prefix1); - grib_context_free(c,prefix1); - depth-=2; + grib_context_free(c, prefix1); + depth -= 2; } (void)err; /* TODO */ } -static void dump_bits(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_bits(grib_dumper* d, grib_accessor* a, const char* comment) { } -static void dump_double(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_decode_python *self = (grib_dumper_bufr_decode_python*)d; - double value=0; size_t size = 1; + grib_dumper_bufr_decode_python* self = (grib_dumper_bufr_decode_python*)d; + double value = 0; + size_t size = 1; int r; - char* sval = NULL; - grib_handle* h=grib_handle_of_accessor(a); - grib_context* c=h->context; + char* sval = NULL; + grib_handle* h = grib_handle_of_accessor(a); + grib_context* c = h->context; - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_unpack_double(a,&value,&size); - self->empty=0; + grib_unpack_double(a, &value, &size); + self->empty = 0; - r=compute_bufr_key_rank(h,self->keys,a->name); - if( !grib_is_missing_double(a,value) ) { - sval=dval_to_string(c,value); - if (r!=0) - fprintf(self->dumper.out," dVal = codes_get(ibufr, '#%d#%s')\n",r,a->name); + r = compute_bufr_key_rank(h, self->keys, a->name); + if (!grib_is_missing_double(a, value)) { + sval = dval_to_string(c, value); + if (r != 0) + fprintf(self->dumper.out, " dVal = codes_get(ibufr, '#%d#%s')\n", r, a->name); else - fprintf(self->dumper.out," dVal = codes_get(ibufr, '%s')\n",a->name); + fprintf(self->dumper.out, " dVal = codes_get(ibufr, '%s')\n", a->name); - grib_context_free(c,sval); + grib_context_free(c, sval); } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } } -static void dump_string_array(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_decode_python *self = (grib_dumper_bufr_decode_python*)d; - size_t size = 0; - grib_context* c=NULL; - int err = 0; - long count=0; - int r=0; - grib_handle* h=grib_handle_of_accessor(a); + grib_dumper_bufr_decode_python* self = (grib_dumper_bufr_decode_python*)d; + size_t size = 0; + grib_context* c = NULL; + int err = 0; + long count = 0; + int r = 0; + grib_handle* h = grib_handle_of_accessor(a); - c=a->context; + c = a->context; - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a,&count); - size=count; - if (size==1) { - dump_string(d,a,comment); + grib_value_count(a, &count); + size = count; + if (size == 1) { + dump_string(d, a, comment); return; } - self->empty=0; + self->empty = 0; - if (self->isLeaf==0) { - if ((r=compute_bufr_key_rank(h,self->keys,a->name))!=0) - fprintf(self->dumper.out," sVals = codes_get_string_array(ibufr, '#%d#%s')\n",r,a->name); + if (self->isLeaf == 0) { + if ((r = compute_bufr_key_rank(h, self->keys, a->name)) != 0) + fprintf(self->dumper.out, " sVals = codes_get_string_array(ibufr, '#%d#%s')\n", r, a->name); else - fprintf(self->dumper.out," sVals = codes_get_string_array(ibufr, '%s')\n",a->name); + fprintf(self->dumper.out, " sVals = codes_get_string_array(ibufr, '%s')\n", a->name); } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } (void)err; /* TODO */ } -static void dump_string(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_decode_python *self = (grib_dumper_bufr_decode_python*)d; - char *value=NULL; - char *p = NULL; - size_t size = 0; - grib_context* c=NULL; + grib_dumper_bufr_decode_python* self = (grib_dumper_bufr_decode_python*)d; + char* value = NULL; + char* p = NULL; + size_t size = 0; + grib_context* c = NULL; int r; - int err = _grib_get_string_length(a,&size); - grib_handle* h=grib_handle_of_accessor(a); + int err = _grib_get_string_length(a, &size); + grib_handle* h = grib_handle_of_accessor(a); - c=a->context; - if (size==0) return; + c = a->context; + if (size == 0) + return; - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - value=(char*)grib_context_malloc_clear(c,size); + value = (char*)grib_context_malloc_clear(c, size); if (!value) { - grib_context_log(c,GRIB_LOG_FATAL,"unable to allocate %d bytes",(int)size); + grib_context_log(c, GRIB_LOG_FATAL, "unable to allocate %d bytes", (int)size); return; } - self->empty=0; + self->empty = 0; - err = grib_unpack_string(a,value,&size); - p=value; - r=compute_bufr_key_rank(h,self->keys,a->name); - if (grib_is_missing_string(a,(unsigned char *)value,size)) + err = grib_unpack_string(a, value, &size); + p = value; + r = compute_bufr_key_rank(h, self->keys, a->name); + if (grib_is_missing_string(a, (unsigned char*)value, size)) return; - while(*p) { if(!isprint(*p)) *p = '.'; p++; } + while (*p) { + if (!isprint(*p)) + *p = '.'; + p++; + } - if (self->isLeaf==0) { - depth+=2; - if (r!=0) - fprintf(self->dumper.out," sVal = codes_get(ibufr, '#%d#%s')\n", r,a->name); + if (self->isLeaf == 0) { + depth += 2; + if (r != 0) + fprintf(self->dumper.out, " sVal = codes_get(ibufr, '#%d#%s')\n", r, a->name); else - fprintf(self->dumper.out," sVal = codes_get(ibufr, '%s')\n", a->name); + fprintf(self->dumper.out, " sVal = codes_get(ibufr, '%s')\n", a->name); } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } - grib_context_free(c,value); + grib_context_free(c, value); (void)err; /* TODO */ } -static void dump_bytes(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment) { } -static void dump_label(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_label(grib_dumper* d, grib_accessor* a, const char* comment) { } static void _dump_long_array(grib_handle* h, FILE* f, const char* key) { - size_t size=0; - if (grib_get_size(h,key,&size)==GRIB_NOT_FOUND) return; - if (size==0) return; + size_t size = 0; + if (grib_get_size(h, key, &size) == GRIB_NOT_FOUND) + return; + if (size == 0) + return; - fprintf(f," iVals = codes_get_array(ibufr, '%s')\n", key); + fprintf(f, " iVals = codes_get_array(ibufr, '%s')\n", key); } static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block) { - grib_dumper_bufr_decode_python *self = (grib_dumper_bufr_decode_python*)d; - if (!grib_inline_strcmp(a->name,"BUFR") || - !grib_inline_strcmp(a->name,"GRIB") || - !grib_inline_strcmp(a->name,"META") - ) { - grib_handle* h=grib_handle_of_accessor(a); - depth=2; - self->empty=1; - depth+=2; - _dump_long_array(h,self->dumper.out,"dataPresentIndicator"); - _dump_long_array(h,self->dumper.out,"delayedDescriptorReplicationFactor"); - _dump_long_array(h,self->dumper.out,"shortDelayedDescriptorReplicationFactor"); - _dump_long_array(h,self->dumper.out,"extendedDelayedDescriptorReplicationFactor"); + grib_dumper_bufr_decode_python* self = (grib_dumper_bufr_decode_python*)d; + if (!grib_inline_strcmp(a->name, "BUFR") || + !grib_inline_strcmp(a->name, "GRIB") || + !grib_inline_strcmp(a->name, "META")) { + grib_handle* h = grib_handle_of_accessor(a); + depth = 2; + self->empty = 1; + depth += 2; + _dump_long_array(h, self->dumper.out, "dataPresentIndicator"); + _dump_long_array(h, self->dumper.out, "delayedDescriptorReplicationFactor"); + _dump_long_array(h, self->dumper.out, "shortDelayedDescriptorReplicationFactor"); + _dump_long_array(h, self->dumper.out, "extendedDelayedDescriptorReplicationFactor"); /* Do not show the inputOverriddenReferenceValues array. That's more for ENCODING */ /* _dump_long_array(h,self->dumper.out,"inputOverriddenReferenceValues","inputOverriddenReferenceValues"); */ - grib_dump_accessors_block(d,block); - depth-=2; - } else if (!grib_inline_strcmp(a->name,"groupNumber")) { - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) + grib_dump_accessors_block(d, block); + depth -= 2; + } + else if (!grib_inline_strcmp(a->name, "groupNumber")) { + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - self->empty=1; - depth+=2; - grib_dump_accessors_block(d,block); - depth-=2; - } else { - grib_dump_accessors_block(d,block); + self->empty = 1; + depth += 2; + grib_dump_accessors_block(d, block); + depth -= 2; + } + else { + grib_dump_accessors_block(d, block); } } -static void dump_attributes(grib_dumper* d,grib_accessor* a, const char* prefix) +static void dump_attributes(grib_dumper* d, grib_accessor* a, const char* prefix) { - int i=0; - grib_dumper_bufr_decode_python *self = (grib_dumper_bufr_decode_python*)d; + int i = 0; + grib_dumper_bufr_decode_python* self = (grib_dumper_bufr_decode_python*)d; unsigned long flags; while (i < MAX_ACCESSOR_ATTRIBUTES && a->attributes[i]) { - self->isAttribute=1; - if ( (d->option_flags & GRIB_DUMP_FLAG_ALL_ATTRIBUTES ) == 0 - && (a->attributes[i]->flags & GRIB_ACCESSOR_FLAG_DUMP)== 0 ) - { + self->isAttribute = 1; + if ((d->option_flags & GRIB_DUMP_FLAG_ALL_ATTRIBUTES) == 0 && (a->attributes[i]->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) { i++; continue; } - self->isLeaf=a->attributes[i]->attributes[0]==NULL ? 1 : 0; - flags=a->attributes[i]->flags; + self->isLeaf = a->attributes[i]->attributes[0] == NULL ? 1 : 0; + flags = a->attributes[i]->flags; a->attributes[i]->flags |= GRIB_ACCESSOR_FLAG_DUMP; switch (grib_accessor_get_native_type(a->attributes[i])) { - case GRIB_TYPE_LONG: - dump_long_attribute(d,a->attributes[i],prefix); - break; - case GRIB_TYPE_DOUBLE: - dump_values_attribute(d,a->attributes[i],prefix); - break; - case GRIB_TYPE_STRING: - break; + case GRIB_TYPE_LONG: + dump_long_attribute(d, a->attributes[i], prefix); + break; + case GRIB_TYPE_DOUBLE: + dump_values_attribute(d, a->attributes[i], prefix); + break; + case GRIB_TYPE_STRING: + break; } - a->attributes[i]->flags=flags; + a->attributes[i]->flags = flags; i++; } - self->isLeaf=0; - self->isAttribute=0; + self->isLeaf = 0; + self->isAttribute = 0; } static void header(grib_dumper* d, grib_handle* h) { - grib_dumper_bufr_decode_python *self = (grib_dumper_bufr_decode_python*)d; + grib_dumper_bufr_decode_python* self = (grib_dumper_bufr_decode_python*)d; - if (d->count<2) { + if (d->count < 2) { /* This is the first message being processed */ fprintf(self->dumper.out, "# This program was automatically generated with bufr_dump -Dpython\n"); fprintf(self->dumper.out, "# Using ecCodes version: "); grib_print_api_version(self->dumper.out); fprintf(self->dumper.out, "\n\n"); - fprintf(self->dumper.out,"from __future__ import print_function\n"); - fprintf(self->dumper.out,"import traceback\n"); - fprintf(self->dumper.out,"import sys\n"); - fprintf(self->dumper.out,"from eccodes import *\n\n\n"); - fprintf(self->dumper.out,"def bufr_decode(input_file):\n"); - fprintf(self->dumper.out," f = open(input_file, 'rb')\n"); - } - fprintf(self->dumper.out," # Message number %ld\n # -----------------\n", d->count); - fprintf(self->dumper.out," print ('Decoding message number %ld')\n", d->count); - fprintf(self->dumper.out," ibufr = codes_bufr_new_from_file(f)\n"); - fprintf(self->dumper.out," codes_set(ibufr, 'unpack', 1)\n"); - + fprintf(self->dumper.out, "from __future__ import print_function\n"); + fprintf(self->dumper.out, "import traceback\n"); + fprintf(self->dumper.out, "import sys\n"); + fprintf(self->dumper.out, "from eccodes import *\n\n\n"); + fprintf(self->dumper.out, "def bufr_decode(input_file):\n"); + fprintf(self->dumper.out, " f = open(input_file, 'rb')\n"); + } + fprintf(self->dumper.out, " # Message number %ld\n # -----------------\n", d->count); + fprintf(self->dumper.out, " print ('Decoding message number %ld')\n", d->count); + fprintf(self->dumper.out, " ibufr = codes_bufr_new_from_file(f)\n"); + fprintf(self->dumper.out, " codes_set(ibufr, 'unpack', 1)\n"); } static void footer(grib_dumper* d, grib_handle* h) { - grib_dumper_bufr_decode_python *self = (grib_dumper_bufr_decode_python*)d; - fprintf(self->dumper.out," codes_release(ibufr)\n"); + grib_dumper_bufr_decode_python* self = (grib_dumper_bufr_decode_python*)d; + fprintf(self->dumper.out, " codes_release(ibufr)\n"); } diff --git a/src/grib_dumper_class_bufr_encode_C.c b/src/grib_dumper_class_bufr_encode_C.c index e9cccca63..d4dd72751 100644 --- a/src/grib_dumper_class_bufr_encode_C.c +++ b/src/grib_dumper_class_bufr_encode_C.c @@ -42,52 +42,53 @@ or edit "dumper.class" and rerun ./make_class.pl */ -static void init_class (grib_dumper_class*); -static int init (grib_dumper* d); -static int destroy (grib_dumper*); -static void dump_long (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_bits (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_double (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_string (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_string_array (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_bytes (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_values (grib_dumper* d, grib_accessor* a); -static void dump_label (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_section (grib_dumper* d, grib_accessor* a,grib_block_of_accessors* block); -static void header (grib_dumper*,grib_handle*); -static void footer (grib_dumper*,grib_handle*); - -typedef struct grib_dumper_bufr_encode_C { - grib_dumper dumper; -/* Members defined in bufr_encode_C */ - long section_offset; - long empty; - long end; - long isLeaf; - long isAttribute; - grib_string_list* keys; +static void init_class(grib_dumper_class*); +static int init(grib_dumper* d); +static int destroy(grib_dumper*); +static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_bits(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_values(grib_dumper* d, grib_accessor* a); +static void dump_label(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block); +static void header(grib_dumper*, grib_handle*); +static void footer(grib_dumper*, grib_handle*); + +typedef struct grib_dumper_bufr_encode_C +{ + grib_dumper dumper; + /* Members defined in bufr_encode_C */ + long section_offset; + long empty; + long end; + long isLeaf; + long isAttribute; + grib_string_list* keys; } grib_dumper_bufr_encode_C; static grib_dumper_class _grib_dumper_class_bufr_encode_C = { - 0, /* super */ - "bufr_encode_C", /* name */ - sizeof(grib_dumper_bufr_encode_C), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - &destroy, /* free mem */ - &dump_long, /* dump long */ - &dump_double, /* dump double */ - &dump_string, /* dump string */ - &dump_string_array, /* dump string array */ - &dump_label, /* dump labels */ - &dump_bytes, /* dump bytes */ - &dump_bits, /* dump bits */ - &dump_section, /* dump section */ - &dump_values, /* dump values */ - &header, /* header */ - &footer, /* footer */ + 0, /* super */ + "bufr_encode_C", /* name */ + sizeof(grib_dumper_bufr_encode_C), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + &destroy, /* free mem */ + &dump_long, /* dump long */ + &dump_double, /* dump double */ + &dump_string, /* dump string */ + &dump_string_array, /* dump string array */ + &dump_label, /* dump labels */ + &dump_bytes, /* dump bytes */ + &dump_bits, /* dump bits */ + &dump_section, /* dump section */ + &dump_values, /* dump values */ + &header, /* header */ + &footer, /* footer */ }; grib_dumper_class* grib_dumper_class_bufr_encode_C = &_grib_dumper_class_bufr_encode_C; @@ -99,144 +100,165 @@ static void dump_attributes(grib_dumper* d, grib_accessor* a, const char* prefix /* 0 means input strings are equal and 1 means not equal */ GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b) { - if (*a != *b) return 1; - while((*a!=0 && *b!=0) && *(a) == *(b) ) {a++;b++;} - return (*a==0 && *b==0) ? 0 : 1; + if (*a != *b) + return 1; + while ((*a != 0 && *b != 0) && *(a) == *(b)) { + a++; + b++; + } + return (*a == 0 && *b == 0) ? 0 : 1; } typedef struct string_count string_count; -struct string_count { +struct string_count +{ char* value; int count; string_count* next; }; -static int depth=0; +static int depth = 0; -static void init_class (grib_dumper_class* c){} +static void init_class(grib_dumper_class* c) {} static int init(grib_dumper* d) { - grib_dumper_bufr_encode_C *self = (grib_dumper_bufr_encode_C*)d; - grib_context* c=d->handle->context; - self->section_offset=0; - self->empty=1; - d->count=1; - self->isLeaf=0; - self->isAttribute=0; - self->keys=(grib_string_list*)grib_context_malloc_clear(c,sizeof(grib_string_list)); + grib_dumper_bufr_encode_C* self = (grib_dumper_bufr_encode_C*)d; + grib_context* c = d->handle->context; + self->section_offset = 0; + self->empty = 1; + d->count = 1; + self->isLeaf = 0; + self->isAttribute = 0; + self->keys = (grib_string_list*)grib_context_malloc_clear(c, sizeof(grib_string_list)); return GRIB_SUCCESS; } static int destroy(grib_dumper* d) { - grib_dumper_bufr_encode_C *self = (grib_dumper_bufr_encode_C*)d; - grib_string_list* next=self->keys; - grib_string_list* cur=self->keys; - grib_context* c=d->handle->context; - while(next) { - cur=next; - next=next->next; - grib_context_free(c,cur->value); - grib_context_free(c,cur); + grib_dumper_bufr_encode_C* self = (grib_dumper_bufr_encode_C*)d; + grib_string_list* next = self->keys; + grib_string_list* cur = self->keys; + grib_context* c = d->handle->context; + while (next) { + cur = next; + next = next->next; + grib_context_free(c, cur->value); + grib_context_free(c, cur); } return GRIB_SUCCESS; } static char* lval_to_string(grib_context* c, long v) { - char* sval=(char*)grib_context_malloc_clear(c,sizeof(char)*40); - if (v == GRIB_MISSING_LONG) sprintf(sval,"CODES_MISSING_LONG"); - else sprintf(sval,"%ld",v); + char* sval = (char*)grib_context_malloc_clear(c, sizeof(char) * 40); + if (v == GRIB_MISSING_LONG) + sprintf(sval, "CODES_MISSING_LONG"); + else + sprintf(sval, "%ld", v); return sval; } static char* dval_to_string(grib_context* c, double v) { - char* sval=(char*)grib_context_malloc_clear(c,sizeof(char)*40); - if (v == GRIB_MISSING_DOUBLE) sprintf(sval,"CODES_MISSING_DOUBLE"); - else sprintf(sval,"%.18e",v); + char* sval = (char*)grib_context_malloc_clear(c, sizeof(char) * 40); + if (v == GRIB_MISSING_DOUBLE) + sprintf(sval, "CODES_MISSING_DOUBLE"); + else + sprintf(sval, "%.18e", v); return sval; } static void dump_values(grib_dumper* d, grib_accessor* a) { - grib_dumper_bufr_encode_C *self = (grib_dumper_bufr_encode_C*)d; - double value=0; size_t size = 0; - double *values=NULL; - int err = 0; - int i,r,icount; - int cols=2; - long count=0; + grib_dumper_bufr_encode_C* self = (grib_dumper_bufr_encode_C*)d; + double value = 0; + size_t size = 0; + double* values = NULL; + int err = 0; + int i, r, icount; + int cols = 2; + long count = 0; char* sval; - grib_context* c=a->context; - grib_handle* h=grib_handle_of_accessor(a); + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) !=0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; - if (size>1) { - values=(double*)grib_context_malloc_clear(c,sizeof(double)*size); - err=grib_unpack_double(a,values,&size); - } else { - err=grib_unpack_double(a,&value,&size); + if (size > 1) { + values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); + err = grib_unpack_double(a, values, &size); + } + else { + err = grib_unpack_double(a, &value, &size); } - self->empty=0; + self->empty = 0; - if (size>1) { - fprintf(self->dumper.out," free(rvalues); rvalues = NULL;\n\n"); - fprintf(self->dumper.out," size = %lu;\n", (unsigned long)size); - fprintf(self->dumper.out," rvalues = (double*)malloc(size * sizeof(double));\n"); - fprintf(self->dumper.out," if (!rvalues) { fprintf(stderr, \"Failed to allocate memory (%s).\\n\"); return 1; }",a->name); + if (size > 1) { + fprintf(self->dumper.out, " free(rvalues); rvalues = NULL;\n\n"); + fprintf(self->dumper.out, " size = %lu;\n", (unsigned long)size); + fprintf(self->dumper.out, " rvalues = (double*)malloc(size * sizeof(double));\n"); + fprintf(self->dumper.out, " if (!rvalues) { fprintf(stderr, \"Failed to allocate memory (%s).\\n\"); return 1; }", a->name); - icount=0; - for (i=0; icols || i==0) {fprintf(self->dumper.out,"\n ");icount=0;} - sval=dval_to_string(c,values[i]); - fprintf(self->dumper.out,"rvalues[%d]=%s; ", i, sval); - grib_context_free(c,sval); + icount = 0; + for (i = 0; i < size - 1; ++i) { + if (icount > cols || i == 0) { + fprintf(self->dumper.out, "\n "); + icount = 0; + } + sval = dval_to_string(c, values[i]); + fprintf(self->dumper.out, "rvalues[%d]=%s; ", i, sval); + grib_context_free(c, sval); icount++; } - if (icount>cols || i==0) {fprintf(self->dumper.out,"\n ");icount=0;} - sval=dval_to_string(c,values[i]); - fprintf(self->dumper.out,"rvalues[%d]=%s;", i,sval); - grib_context_free(c,sval); + if (icount > cols || i == 0) { + fprintf(self->dumper.out, "\n "); + icount = 0; + } + sval = dval_to_string(c, values[i]); + fprintf(self->dumper.out, "rvalues[%d]=%s;", i, sval); + grib_context_free(c, sval); - depth-=2; - fprintf(self->dumper.out,"\n"); - grib_context_free(c,values); + depth -= 2; + fprintf(self->dumper.out, "\n"); + grib_context_free(c, values); - if ((r=compute_bufr_key_rank(h,self->keys,a->name))!=0) - fprintf(self->dumper.out," CODES_CHECK(codes_set_double_array(h, \"#%d#%s\",rvalues, size), 0);\n", r, a->name); + if ((r = compute_bufr_key_rank(h, self->keys, a->name)) != 0) + fprintf(self->dumper.out, " CODES_CHECK(codes_set_double_array(h, \"#%d#%s\",rvalues, size), 0);\n", r, a->name); else - fprintf(self->dumper.out," CODES_CHECK(codes_set_double_array(h, \"%s\", rvalues, size), 0);\n",a->name); - } else { - r=compute_bufr_key_rank(h,self->keys,a->name); - sval=dval_to_string(c,value); - if (r!=0) - fprintf(self->dumper.out," CODES_CHECK(codes_set_double(h, \"#%d#%s\", %s), 0);\n", r, a->name, sval); + fprintf(self->dumper.out, " CODES_CHECK(codes_set_double_array(h, \"%s\", rvalues, size), 0);\n", a->name); + } + else { + r = compute_bufr_key_rank(h, self->keys, a->name); + sval = dval_to_string(c, value); + if (r != 0) + fprintf(self->dumper.out, " CODES_CHECK(codes_set_double(h, \"#%d#%s\", %s), 0);\n", r, a->name, sval); else - fprintf(self->dumper.out," CODES_CHECK(codes_set_double(h, \"%s\", %s), 0);\n", a->name, sval); - grib_context_free(c,sval); + fprintf(self->dumper.out, " CODES_CHECK(codes_set_double(h, \"%s\", %s), 0);\n", a->name, sval); + grib_context_free(c, sval); } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } (void)err; /* TODO */ @@ -244,254 +266,289 @@ static void dump_values(grib_dumper* d, grib_accessor* a) static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* prefix) { - grib_dumper_bufr_encode_C *self = (grib_dumper_bufr_encode_C*)d; - double value=0; size_t size = 0; - double *values=NULL; - int err = 0; - int i,icount; - int cols=2; - long count=0; + grib_dumper_bufr_encode_C* self = (grib_dumper_bufr_encode_C*)d; + double value = 0; + size_t size = 0; + double* values = NULL; + int err = 0; + int i, icount; + int cols = 2; + long count = 0; char* sval; - grib_context* c=a->context; + grib_context* c = a->context; - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) !=0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; - if (size>1) { - values=(double*)grib_context_malloc_clear(c,sizeof(double)*size); - err=grib_unpack_double(a,values,&size); - } else { - err=grib_unpack_double(a,&value,&size); + if (size > 1) { + values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); + err = grib_unpack_double(a, values, &size); + } + else { + err = grib_unpack_double(a, &value, &size); } - self->empty=0; + self->empty = 0; - if (size>1) { - fprintf(self->dumper.out," free(rvalues); rvalues = NULL;\n"); - fprintf(self->dumper.out," size = %lu;\n", (unsigned long)size); - fprintf(self->dumper.out," rvalues = (double*)malloc(size * sizeof(double));\n"); - fprintf(self->dumper.out," if (!rvalues) { fprintf(stderr, \"Failed to allocate memory (%s).\\n\"); return 1; }",a->name); + if (size > 1) { + fprintf(self->dumper.out, " free(rvalues); rvalues = NULL;\n"); + fprintf(self->dumper.out, " size = %lu;\n", (unsigned long)size); + fprintf(self->dumper.out, " rvalues = (double*)malloc(size * sizeof(double));\n"); + fprintf(self->dumper.out, " if (!rvalues) { fprintf(stderr, \"Failed to allocate memory (%s).\\n\"); return 1; }", a->name); - icount=0; - for (i=0; icols || i==0) {fprintf(self->dumper.out,"\n ");icount=0;} - sval=dval_to_string(c,values[i]); - fprintf(self->dumper.out,"rvalues[%d]=%s; ", i, sval); - grib_context_free(c,sval); + icount = 0; + for (i = 0; i < size - 1; ++i) { + if (icount > cols || i == 0) { + fprintf(self->dumper.out, "\n "); + icount = 0; + } + sval = dval_to_string(c, values[i]); + fprintf(self->dumper.out, "rvalues[%d]=%s; ", i, sval); + grib_context_free(c, sval); icount++; } - if (icount>cols || i==0) {fprintf(self->dumper.out,"\n ");icount=0;} - sval=dval_to_string(c,values[i]); - fprintf(self->dumper.out,"rvalues[%d]=%s;", i,sval); - grib_context_free(c,sval); + if (icount > cols || i == 0) { + fprintf(self->dumper.out, "\n "); + icount = 0; + } + sval = dval_to_string(c, values[i]); + fprintf(self->dumper.out, "rvalues[%d]=%s;", i, sval); + grib_context_free(c, sval); - depth-=2; - fprintf(self->dumper.out,"\n"); - grib_context_free(c,values); + depth -= 2; + fprintf(self->dumper.out, "\n"); + grib_context_free(c, values); - fprintf(self->dumper.out," CODES_CHECK(codes_set_double_array(h, \"%s->%s\", rvalues, size), 0);\n", prefix,a->name); - } else { - sval=dval_to_string(c,value); - fprintf(self->dumper.out," CODES_CHECK(codes_set_double(h, \"%s->%s\", %s), 0);\n", prefix,a->name, sval); - grib_context_free(c,sval); + fprintf(self->dumper.out, " CODES_CHECK(codes_set_double_array(h, \"%s->%s\", rvalues, size), 0);\n", prefix, a->name); + } + else { + sval = dval_to_string(c, value); + fprintf(self->dumper.out, " CODES_CHECK(codes_set_double(h, \"%s->%s\", %s), 0);\n", prefix, a->name, sval); + grib_context_free(c, sval); } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix1; - prefix1=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+strlen(prefix)+5)); - sprintf(prefix1,"%s->%s",prefix,a->name); + prefix1 = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + strlen(prefix) + 5)); + sprintf(prefix1, "%s->%s", prefix, a->name); - dump_attributes(d,a,prefix1); + dump_attributes(d, a, prefix1); - grib_context_free(c,prefix1); - depth-=2; + grib_context_free(c, prefix1); + depth -= 2; } (void)err; /* TODO */ } -static void dump_long(grib_dumper* d,grib_accessor* a, const char* comment) +static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_encode_C *self = (grib_dumper_bufr_encode_C*)d; - long value=0; size_t size = 0; - long *values=NULL; - int err = 0; - int i,r,icount; - int cols=4; - long count=0; - char* sval = NULL; - grib_context* c=a->context; - grib_handle* h=grib_handle_of_accessor(a); - int doing_unexpandedDescriptors=0; - - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 ) + grib_dumper_bufr_encode_C* self = (grib_dumper_bufr_encode_C*)d; + long value = 0; + size_t size = 0; + long* values = NULL; + int err = 0; + int i, r, icount; + int cols = 4; + long count = 0; + char* sval = NULL; + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); + int doing_unexpandedDescriptors = 0; + + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - doing_unexpandedDescriptors = (strcmp(a->name, "unexpandedDescriptors")==0); - grib_value_count(a,&count); - size=count; + doing_unexpandedDescriptors = (strcmp(a->name, "unexpandedDescriptors") == 0); + grib_value_count(a, &count); + size = count; - if ( (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { - if (self->isLeaf==0) { + if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; - - r=compute_bufr_key_rank(h,self->keys,a->name); - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; - - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + int dofree = 0; + + r = compute_bufr_key_rank(h, self->keys, a->name); + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; + + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } return; } - if (size>1) { - values=(long*)grib_context_malloc_clear(a->context,sizeof(long)*size); - err=grib_unpack_long(a,values,&size); - } else { - err=grib_unpack_long(a,&value,&size); + if (size > 1) { + values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); + err = grib_unpack_long(a, values, &size); + } + else { + err = grib_unpack_long(a, &value, &size); } - self->empty=0; + self->empty = 0; - if (size>1) { - fprintf(self->dumper.out," free(ivalues); ivalues = NULL;\n\n"); - fprintf(self->dumper.out," size = %lu;\n", (unsigned long)size); - fprintf(self->dumper.out," ivalues = (long*)malloc(size * sizeof(long));\n"); - fprintf(self->dumper.out," if (!ivalues) { fprintf(stderr, \"Failed to allocate memory (%s).\\n\"); return 1; }",a->name); + if (size > 1) { + fprintf(self->dumper.out, " free(ivalues); ivalues = NULL;\n\n"); + fprintf(self->dumper.out, " size = %lu;\n", (unsigned long)size); + fprintf(self->dumper.out, " ivalues = (long*)malloc(size * sizeof(long));\n"); + fprintf(self->dumper.out, " if (!ivalues) { fprintf(stderr, \"Failed to allocate memory (%s).\\n\"); return 1; }", a->name); - icount=0; - for (i=0;icols || i==0) {fprintf(self->dumper.out,"\n ");icount=0;} - fprintf(self->dumper.out,"ivalues[%d]=%ld; ", i, values[i]); + icount = 0; + for (i = 0; i < size - 1; i++) { + if (icount > cols || i == 0) { + fprintf(self->dumper.out, "\n "); + icount = 0; + } + fprintf(self->dumper.out, "ivalues[%d]=%ld; ", i, values[i]); icount++; } - if (icount>cols || i==0) {fprintf(self->dumper.out,"\n ");icount=0;} - fprintf(self->dumper.out,"ivalues[%d]=%ld;", i, values[i]); + if (icount > cols || i == 0) { + fprintf(self->dumper.out, "\n "); + icount = 0; + } + fprintf(self->dumper.out, "ivalues[%d]=%ld;", i, values[i]); - depth-=2; - fprintf(self->dumper.out,"\n"); - grib_context_free(a->context,values); + depth -= 2; + fprintf(self->dumper.out, "\n"); + grib_context_free(a->context, values); - if ((r=compute_bufr_key_rank(h,self->keys,a->name))!=0) { - fprintf(self->dumper.out," CODES_CHECK(codes_set_long_array(h, \"#%d#%s\", ivalues, size), 0);\n",r,a->name); - } else { + if ((r = compute_bufr_key_rank(h, self->keys, a->name)) != 0) { + fprintf(self->dumper.out, " CODES_CHECK(codes_set_long_array(h, \"#%d#%s\", ivalues, size), 0);\n", r, a->name); + } + else { if (doing_unexpandedDescriptors) { - fprintf(self->dumper.out,"\n /* Create the structure of the data section */\n"); + fprintf(self->dumper.out, "\n /* Create the structure of the data section */\n"); /* fprintf(self->dumper.out," CODES_CHECK(codes_set_long(h, \"skipExtraKeyAttributes\", 1), 0);\n"); */ } - fprintf(self->dumper.out," CODES_CHECK(codes_set_long_array(h, \"%s\", ivalues, size), 0);\n",a->name); - if (doing_unexpandedDescriptors) fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out, " CODES_CHECK(codes_set_long_array(h, \"%s\", ivalues, size), 0);\n", a->name); + if (doing_unexpandedDescriptors) + fprintf(self->dumper.out, "\n"); } - - } else { - r=compute_bufr_key_rank(h,self->keys,a->name); - sval=lval_to_string(c,value); - if (r!=0) { - fprintf(self->dumper.out," CODES_CHECK(codes_set_long(h, \"#%d#%s\", ", r,a->name); - } else { + } + else { + r = compute_bufr_key_rank(h, self->keys, a->name); + sval = lval_to_string(c, value); + if (r != 0) { + fprintf(self->dumper.out, " CODES_CHECK(codes_set_long(h, \"#%d#%s\", ", r, a->name); + } + else { if (doing_unexpandedDescriptors) { - fprintf(self->dumper.out,"\n /* Create the structure of the data section */\n"); + fprintf(self->dumper.out, "\n /* Create the structure of the data section */\n"); /* fprintf(self->dumper.out," CODES_CHECK(codes_set_long(h, \"skipExtraKeyAttributes\", 1), 0);\n"); */ } - fprintf(self->dumper.out," CODES_CHECK(codes_set_long(h, \"%s\", ", a->name); + fprintf(self->dumper.out, " CODES_CHECK(codes_set_long(h, \"%s\", ", a->name); } - fprintf(self->dumper.out,"%s), 0);\n",sval); - grib_context_free(c,sval); - if (doing_unexpandedDescriptors) fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out, "%s), 0);\n", sval); + grib_context_free(c, sval); + if (doing_unexpandedDescriptors) + fprintf(self->dumper.out, "\n"); } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } (void)err; /* TODO */ } static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* prefix) { - grib_dumper_bufr_encode_C *self = (grib_dumper_bufr_encode_C*)d; - long value=0; size_t size = 0; - long *values=NULL; - int err = 0; - int i,icount; - int cols=4; - long count=0; - grib_context* c=a->context; - - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0 ) + grib_dumper_bufr_encode_C* self = (grib_dumper_bufr_encode_C*)d; + long value = 0; + size_t size = 0; + long* values = NULL; + int err = 0; + int i, icount; + int cols = 4; + long count = 0; + grib_context* c = a->context; + + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; - if (size>1) { - values=(long*)grib_context_malloc_clear(a->context,sizeof(long)*size); - err=grib_unpack_long(a,values,&size); - } else { - err=grib_unpack_long(a,&value,&size); + if (size > 1) { + values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); + err = grib_unpack_long(a, values, &size); + } + else { + err = grib_unpack_long(a, &value, &size); } - self->empty=0; + self->empty = 0; - if (size>1) { - fprintf(self->dumper.out," free(ivalues); ivalues = NULL;\n"); - fprintf(self->dumper.out," size = %lu;\n", (unsigned long)size); - fprintf(self->dumper.out," ivalues = (long*)malloc(size * sizeof(long));\n"); - fprintf(self->dumper.out," if (!ivalues) { fprintf(stderr, \"Failed to allocate memory (%s).\\n\"); return 1; }", a->name); + if (size > 1) { + fprintf(self->dumper.out, " free(ivalues); ivalues = NULL;\n"); + fprintf(self->dumper.out, " size = %lu;\n", (unsigned long)size); + fprintf(self->dumper.out, " ivalues = (long*)malloc(size * sizeof(long));\n"); + fprintf(self->dumper.out, " if (!ivalues) { fprintf(stderr, \"Failed to allocate memory (%s).\\n\"); return 1; }", a->name); - icount=0; - for (i=0;icols || i==0) {fprintf(self->dumper.out,"\n ");icount=0;} - fprintf(self->dumper.out,"ivalues[%d]=%ld; ", i, values[i]); + icount = 0; + for (i = 0; i < size - 1; i++) { + if (icount > cols || i == 0) { + fprintf(self->dumper.out, "\n "); + icount = 0; + } + fprintf(self->dumper.out, "ivalues[%d]=%ld; ", i, values[i]); icount++; } - if (icount>cols || i==0) {fprintf(self->dumper.out,"\n ");icount=0;} - fprintf(self->dumper.out,"ivalues[%d]=%ld;", i, values[i]); - - depth-=2; - fprintf(self->dumper.out,"\n"); - grib_context_free(a->context,values); + if (icount > cols || i == 0) { + fprintf(self->dumper.out, "\n "); + icount = 0; + } + fprintf(self->dumper.out, "ivalues[%d]=%ld;", i, values[i]); - fprintf(self->dumper.out," CODES_CHECK(codes_set_long_array(h, \"%s->%s\", ivalues, size), 0);\n", prefix,a->name); + depth -= 2; + fprintf(self->dumper.out, "\n"); + grib_context_free(a->context, values); - } else { - char* sval=lval_to_string(c,value); - fprintf(self->dumper.out," CODES_CHECK(codes_set_long(h, \"%s->%s\", ", prefix,a->name); - fprintf(self->dumper.out,"%s), 0);\n",sval); - grib_context_free(c,sval); + fprintf(self->dumper.out, " CODES_CHECK(codes_set_long_array(h, \"%s->%s\", ivalues, size), 0);\n", prefix, a->name); + } + else { + char* sval = lval_to_string(c, value); + fprintf(self->dumper.out, " CODES_CHECK(codes_set_long(h, \"%s->%s\", ", prefix, a->name); + fprintf(self->dumper.out, "%s), 0);\n", sval); + grib_context_free(c, sval); } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix1; - prefix1=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+strlen(prefix)+5)); - sprintf(prefix1,"%s->%s",prefix,a->name); + prefix1 = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + strlen(prefix) + 5)); + sprintf(prefix1, "%s->%s", prefix, a->name); - dump_attributes(d,a,prefix1); + dump_attributes(d, a, prefix1); - grib_context_free(c,prefix1); - depth-=2; + grib_context_free(c, prefix1); + depth -= 2; } (void)err; /* TODO */ } @@ -502,178 +559,194 @@ static void dump_bits(grib_dumper* d, grib_accessor* a, const char* comment) static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_encode_C *self = (grib_dumper_bufr_encode_C*)d; - double value=0; size_t size = 1; + grib_dumper_bufr_encode_C* self = (grib_dumper_bufr_encode_C*)d; + double value = 0; + size_t size = 1; int r; char* sval; - grib_handle* h=grib_handle_of_accessor(a); - grib_context* c=h->context; + grib_handle* h = grib_handle_of_accessor(a); + grib_context* c = h->context; - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_unpack_double(a,&value,&size); - self->empty=0; + grib_unpack_double(a, &value, &size); + self->empty = 0; - r=compute_bufr_key_rank(h,self->keys,a->name); + r = compute_bufr_key_rank(h, self->keys, a->name); - sval=dval_to_string(c,value); - if (r!=0) - fprintf(self->dumper.out," CODES_CHECK(codes_set_double(h, \"#%d#%s\", %s), 0);\n", r,a->name, sval); + sval = dval_to_string(c, value); + if (r != 0) + fprintf(self->dumper.out, " CODES_CHECK(codes_set_double(h, \"#%d#%s\", %s), 0);\n", r, a->name, sval); else - fprintf(self->dumper.out," CODES_CHECK(codes_set_double(h, \"%s\", %s), 0);\n", a->name, sval); - grib_context_free(c,sval); + fprintf(self->dumper.out, " CODES_CHECK(codes_set_double(h, \"%s\", %s), 0);\n", a->name, sval); + grib_context_free(c, sval); - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } } static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_encode_C *self = (grib_dumper_bufr_encode_C*)d; - char **values; - size_t size = 0,i=0; - grib_context* c=a->context; - int err = 0; - long count=0; - int r=0; - grib_handle* h=grib_handle_of_accessor(a); - - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + grib_dumper_bufr_encode_C* self = (grib_dumper_bufr_encode_C*)d; + char** values; + size_t size = 0, i = 0; + grib_context* c = a->context; + int err = 0; + long count = 0; + int r = 0; + grib_handle* h = grib_handle_of_accessor(a); + + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a,&count); - size=count; - if (size==1) { - dump_string(d,a,comment); + grib_value_count(a, &count); + size = count; + if (size == 1) { + dump_string(d, a, comment); return; } - fprintf(self->dumper.out," free(svalues);\n"); - fprintf(self->dumper.out," size = %lu;\n", (unsigned long)size); - fprintf(self->dumper.out," svalues = (char**)malloc(size * sizeof(char*));\n"); - fprintf(self->dumper.out," if (!svalues) { fprintf(stderr, \"Failed to allocate memory (%s).\\n\"); return 1; }\n",a->name); + fprintf(self->dumper.out, " free(svalues);\n"); + fprintf(self->dumper.out, " size = %lu;\n", (unsigned long)size); + fprintf(self->dumper.out, " svalues = (char**)malloc(size * sizeof(char*));\n"); + fprintf(self->dumper.out, " if (!svalues) { fprintf(stderr, \"Failed to allocate memory (%s).\\n\"); return 1; }\n", a->name); - self->empty=0; - values=(char**)grib_context_malloc_clear(c,size*sizeof(char*)); + self->empty = 0; + values = (char**)grib_context_malloc_clear(c, size * sizeof(char*)); if (!values) { - grib_context_log(c,GRIB_LOG_FATAL,"unable to allocate %d bytes",(int)size); + grib_context_log(c, GRIB_LOG_FATAL, "unable to allocate %d bytes", (int)size); return; } - err = grib_unpack_string_array(a,values,&size); - for (i=0;idumper.out," svalues[%lu]=\"%s\"; \n", (unsigned long)i, values[i]); + err = grib_unpack_string_array(a, values, &size); + for (i = 0; i < size - 1; i++) { + fprintf(self->dumper.out, " svalues[%lu]=\"%s\"; \n", (unsigned long)i, values[i]); } - fprintf(self->dumper.out," svalues[%lu]=\"%s\";\n", (unsigned long)i, values[i]); + fprintf(self->dumper.out, " svalues[%lu]=\"%s\";\n", (unsigned long)i, values[i]); - if (self->isLeaf==0) { - if ((r=compute_bufr_key_rank(h,self->keys,a->name))!=0) - fprintf(self->dumper.out," codes_set_string_array(h, \"#%d#%s\", (const char **)svalues, size);\n",r,a->name); + if (self->isLeaf == 0) { + if ((r = compute_bufr_key_rank(h, self->keys, a->name)) != 0) + fprintf(self->dumper.out, " codes_set_string_array(h, \"#%d#%s\", (const char **)svalues, size);\n", r, a->name); else - fprintf(self->dumper.out," codes_set_string_array(h, \"%s\", (const char **)svalues, size);\n",a->name); + fprintf(self->dumper.out, " codes_set_string_array(h, \"%s\", (const char **)svalues, size);\n", a->name); } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } - grib_context_free(c,values); + grib_context_free(c, values); (void)err; /* TODO */ } static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_encode_C *self = (grib_dumper_bufr_encode_C*)d; - char *value=NULL; - char *p = NULL; - size_t size = 0; - grib_context* c = a->context; + grib_dumper_bufr_encode_C* self = (grib_dumper_bufr_encode_C*)d; + char* value = NULL; + char* p = NULL; + size_t size = 0; + grib_context* c = a->context; int r; - int err = _grib_get_string_length(a,&size); - grib_handle* h=grib_handle_of_accessor(a); + int err = _grib_get_string_length(a, &size); + grib_handle* h = grib_handle_of_accessor(a); const char* acc_name = a->name; - if (size==0) return; + if (size == 0) + return; - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { /* ECC-356: Solution for the special local section key 'keyMore' and its alias 'ident' */ int skip = 1; - if ( (a->flags & GRIB_ACCESSOR_FLAG_HIDDEN)!=0 ) { - if ( strcmp(a->name, "keyMore")==0 && grib_is_defined(h, "ls.ident") ) { - skip = 0; + if ((a->flags & GRIB_ACCESSOR_FLAG_HIDDEN) != 0) { + if (strcmp(a->name, "keyMore") == 0 && grib_is_defined(h, "ls.ident")) { + skip = 0; acc_name = "ident"; } } - if (skip) return; + if (skip) + return; } - value=(char*)grib_context_malloc_clear(c,size); + value = (char*)grib_context_malloc_clear(c, size); if (!value) { - grib_context_log(c,GRIB_LOG_FATAL,"unable to allocate %d bytes",(int)size); + grib_context_log(c, GRIB_LOG_FATAL, "unable to allocate %d bytes", (int)size); return; } - self->empty=0; + self->empty = 0; - err = grib_unpack_string(a,value,&size); - p=value; - r=compute_bufr_key_rank(h,self->keys,acc_name); - if (grib_is_missing_string(a,(unsigned char *)value,size)) { + err = grib_unpack_string(a, value, &size); + p = value; + r = compute_bufr_key_rank(h, self->keys, acc_name); + if (grib_is_missing_string(a, (unsigned char*)value, size)) { strcpy(value, ""); /* Empty string means MISSING string */ } - while(*p) { if(!isprint(*p)) *p = '.'; p++; } + while (*p) { + if (!isprint(*p)) + *p = '.'; + p++; + } - fprintf(self->dumper.out," size = %lu;\n", (unsigned long)size); - if (self->isLeaf==0) { - depth+=2; - if (r!=0) - fprintf(self->dumper.out," codes_set_string(h, \"#%d#%s\", ", r, acc_name); + fprintf(self->dumper.out, " size = %lu;\n", (unsigned long)size); + if (self->isLeaf == 0) { + depth += 2; + if (r != 0) + fprintf(self->dumper.out, " codes_set_string(h, \"#%d#%s\", ", r, acc_name); else - fprintf(self->dumper.out," codes_set_string(h, \"%s\", ", acc_name); + fprintf(self->dumper.out, " codes_set_string(h, \"%s\", ", acc_name); } - fprintf(self->dumper.out,"\"%s\", &size);\n",value); + fprintf(self->dumper.out, "\"%s\", &size);\n", value); - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(acc_name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,acc_name); - } else prefix=(char*)acc_name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(acc_name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, acc_name); + } + else + prefix = (char*)acc_name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } - grib_context_free(c,value); + grib_context_free(c, value); (void)err; /* TODO */ } @@ -688,170 +761,177 @@ static void dump_label(grib_dumper* d, grib_accessor* a, const char* comment) static void _dump_long_array(grib_handle* h, FILE* f, const char* key, const char* print_key) { long* val; - size_t size=0,i; - int cols=9,icount=0; - - if (grib_get_size(h,key,&size)==GRIB_NOT_FOUND) return; - if (size==0) return; - - fprintf(f," free(ivalues); ivalues = NULL;\n"); - fprintf(f," size = %lu;\n", (unsigned long)size); - fprintf(f," ivalues = (long*)malloc(size * sizeof(long));\n"); - fprintf(f," if (!ivalues) { fprintf(stderr, \"Failed to allocate memory (%s).\\n\"); return 1; }",key); - - val=(long*)grib_context_malloc_clear(h->context,sizeof(long)*size); - grib_get_long_array(h,key,val,&size); - for (i=0;icols || i==0) {fprintf(f,"\n ");icount=0;} - fprintf(f,"ivalues[%lu]=%ld; ", (unsigned long)i, val[i]); + size_t size = 0, i; + int cols = 9, icount = 0; + + if (grib_get_size(h, key, &size) == GRIB_NOT_FOUND) + return; + if (size == 0) + return; + + fprintf(f, " free(ivalues); ivalues = NULL;\n"); + fprintf(f, " size = %lu;\n", (unsigned long)size); + fprintf(f, " ivalues = (long*)malloc(size * sizeof(long));\n"); + fprintf(f, " if (!ivalues) { fprintf(stderr, \"Failed to allocate memory (%s).\\n\"); return 1; }", key); + + val = (long*)grib_context_malloc_clear(h->context, sizeof(long) * size); + grib_get_long_array(h, key, val, &size); + for (i = 0; i < size - 1; i++) { + if (icount > cols || i == 0) { + fprintf(f, "\n "); + icount = 0; + } + fprintf(f, "ivalues[%lu]=%ld; ", (unsigned long)i, val[i]); icount++; } - if (icount>cols) {fprintf(f,"\n ");} - fprintf(f,"ivalues[%lu]=%ld;\n", (unsigned long)(size-1), val[size-1]); + if (icount > cols) { + fprintf(f, "\n "); + } + fprintf(f, "ivalues[%lu]=%ld;\n", (unsigned long)(size - 1), val[size - 1]); - grib_context_free(h->context,val); - fprintf(f," CODES_CHECK(codes_set_long_array(h, \"%s\", ivalues, size), 0);\n",print_key); + grib_context_free(h->context, val); + fprintf(f, " CODES_CHECK(codes_set_long_array(h, \"%s\", ivalues, size), 0);\n", print_key); } static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block) { - grib_dumper_bufr_encode_C *self = (grib_dumper_bufr_encode_C*)d; - if (!grib_inline_strcmp(a->name,"BUFR") || - !grib_inline_strcmp(a->name,"GRIB") || - !grib_inline_strcmp(a->name,"META") - ) { - grib_handle* h=grib_handle_of_accessor(a); - depth=2; - self->empty=1; - depth+=2; - _dump_long_array(h,self->dumper.out,"dataPresentIndicator","inputDataPresentIndicator"); - _dump_long_array(h,self->dumper.out,"delayedDescriptorReplicationFactor","inputDelayedDescriptorReplicationFactor"); - _dump_long_array(h,self->dumper.out,"shortDelayedDescriptorReplicationFactor","inputShortDelayedDescriptorReplicationFactor"); - _dump_long_array(h,self->dumper.out,"extendedDelayedDescriptorReplicationFactor","inputExtendedDelayedDescriptorReplicationFactor"); - _dump_long_array(h,self->dumper.out,"inputOverriddenReferenceValues","inputOverriddenReferenceValues"); - grib_dump_accessors_block(d,block); - depth-=2; - } else if (!grib_inline_strcmp(a->name,"groupNumber")) { - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) + grib_dumper_bufr_encode_C* self = (grib_dumper_bufr_encode_C*)d; + if (!grib_inline_strcmp(a->name, "BUFR") || + !grib_inline_strcmp(a->name, "GRIB") || + !grib_inline_strcmp(a->name, "META")) { + grib_handle* h = grib_handle_of_accessor(a); + depth = 2; + self->empty = 1; + depth += 2; + _dump_long_array(h, self->dumper.out, "dataPresentIndicator", "inputDataPresentIndicator"); + _dump_long_array(h, self->dumper.out, "delayedDescriptorReplicationFactor", "inputDelayedDescriptorReplicationFactor"); + _dump_long_array(h, self->dumper.out, "shortDelayedDescriptorReplicationFactor", "inputShortDelayedDescriptorReplicationFactor"); + _dump_long_array(h, self->dumper.out, "extendedDelayedDescriptorReplicationFactor", "inputExtendedDelayedDescriptorReplicationFactor"); + _dump_long_array(h, self->dumper.out, "inputOverriddenReferenceValues", "inputOverriddenReferenceValues"); + grib_dump_accessors_block(d, block); + depth -= 2; + } + else if (!grib_inline_strcmp(a->name, "groupNumber")) { + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - self->empty=1; - depth+=2; - grib_dump_accessors_block(d,block); - depth-=2; - } else { - grib_dump_accessors_block(d,block); + self->empty = 1; + depth += 2; + grib_dump_accessors_block(d, block); + depth -= 2; + } + else { + grib_dump_accessors_block(d, block); } } -static void dump_attributes(grib_dumper* d,grib_accessor* a, const char* prefix) +static void dump_attributes(grib_dumper* d, grib_accessor* a, const char* prefix) { - int i=0; - grib_dumper_bufr_encode_C *self = (grib_dumper_bufr_encode_C*)d; + int i = 0; + grib_dumper_bufr_encode_C* self = (grib_dumper_bufr_encode_C*)d; unsigned long flags; while (i < MAX_ACCESSOR_ATTRIBUTES && a->attributes[i]) { - self->isAttribute=1; - if ( (d->option_flags & GRIB_DUMP_FLAG_ALL_ATTRIBUTES ) == 0 - && (a->attributes[i]->flags & GRIB_ACCESSOR_FLAG_DUMP)== 0 ) - { + self->isAttribute = 1; + if ((d->option_flags & GRIB_DUMP_FLAG_ALL_ATTRIBUTES) == 0 && (a->attributes[i]->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) { i++; continue; } - self->isLeaf=a->attributes[i]->attributes[0]==NULL ? 1 : 0; - flags=a->attributes[i]->flags; + self->isLeaf = a->attributes[i]->attributes[0] == NULL ? 1 : 0; + flags = a->attributes[i]->flags; a->attributes[i]->flags |= GRIB_ACCESSOR_FLAG_DUMP; switch (grib_accessor_get_native_type(a->attributes[i])) { - case GRIB_TYPE_LONG: - dump_long_attribute(d,a->attributes[i],prefix); - break; - case GRIB_TYPE_DOUBLE: - dump_values_attribute(d,a->attributes[i],prefix); - break; - case GRIB_TYPE_STRING: - break; + case GRIB_TYPE_LONG: + dump_long_attribute(d, a->attributes[i], prefix); + break; + case GRIB_TYPE_DOUBLE: + dump_values_attribute(d, a->attributes[i], prefix); + break; + case GRIB_TYPE_STRING: + break; } - a->attributes[i]->flags=flags; + a->attributes[i]->flags = flags; i++; } - self->isLeaf=0; - self->isAttribute=0; + self->isLeaf = 0; + self->isAttribute = 0; } static void header(grib_dumper* d, grib_handle* h) { - grib_dumper_bufr_encode_C *self = (grib_dumper_bufr_encode_C*)d; - char sampleName[200]={0}; - long localSectionPresent,edition,bufrHeaderCentre,isSatellite; + grib_dumper_bufr_encode_C* self = (grib_dumper_bufr_encode_C*)d; + char sampleName[200] = { 0 }; + long localSectionPresent, edition, bufrHeaderCentre, isSatellite; Assert(h->product_kind == PRODUCT_BUFR); - grib_get_long(h,"localSectionPresent",&localSectionPresent); - grib_get_long(h,"bufrHeaderCentre",&bufrHeaderCentre); - grib_get_long(h,"edition",&edition); + grib_get_long(h, "localSectionPresent", &localSectionPresent); + grib_get_long(h, "bufrHeaderCentre", &bufrHeaderCentre); + grib_get_long(h, "edition", &edition); - if (localSectionPresent && bufrHeaderCentre==98 ) { - grib_get_long(h,"isSatellite",&isSatellite); + if (localSectionPresent && bufrHeaderCentre == 98) { + grib_get_long(h, "isSatellite", &isSatellite); if (isSatellite) - sprintf(sampleName,"BUFR%ld_local_satellite",edition); + sprintf(sampleName, "BUFR%ld_local_satellite", edition); else - sprintf(sampleName,"BUFR%ld_local",edition); - } else { - sprintf(sampleName,"BUFR%ld",edition); + sprintf(sampleName, "BUFR%ld_local", edition); + } + else { + sprintf(sampleName, "BUFR%ld", edition); } - if (d->count<2) { - fprintf(self->dumper.out,"/* This program was automatically generated with bufr_dump -EC */\n"); - fprintf(self->dumper.out,"/* Using ecCodes version: "); + if (d->count < 2) { + fprintf(self->dumper.out, "/* This program was automatically generated with bufr_dump -EC */\n"); + fprintf(self->dumper.out, "/* Using ecCodes version: "); grib_print_api_version(self->dumper.out); fprintf(self->dumper.out, " */\n\n"); - fprintf(self->dumper.out,"#include \"eccodes.h\"\n"); - fprintf(self->dumper.out,"int main()\n"); - fprintf(self->dumper.out,"{\n"); - fprintf(self->dumper.out," size_t size=0;\n"); - fprintf(self->dumper.out," const void* buffer = NULL;\n"); - fprintf(self->dumper.out," FILE* fout = NULL;\n"); - fprintf(self->dumper.out," codes_handle* h = NULL;\n"); - fprintf(self->dumper.out," long* ivalues = NULL;\n"); - fprintf(self->dumper.out," char** svalues = NULL;\n"); - fprintf(self->dumper.out," double* rvalues = NULL;\n"); - fprintf(self->dumper.out," const char* sampleName = \"%s\";\n\n", sampleName); - } - - fprintf(self->dumper.out," h = codes_bufr_handle_new_from_samples(NULL, sampleName);\n"); - fprintf(self->dumper.out," if (h == NULL) {\n"); - fprintf(self->dumper.out," fprintf(stderr, \"ERROR creating BUFR from %%s\\n\", sampleName);\n"); - fprintf(self->dumper.out," return 1;\n"); - fprintf(self->dumper.out," }\n"); + fprintf(self->dumper.out, "#include \"eccodes.h\"\n"); + fprintf(self->dumper.out, "int main()\n"); + fprintf(self->dumper.out, "{\n"); + fprintf(self->dumper.out, " size_t size=0;\n"); + fprintf(self->dumper.out, " const void* buffer = NULL;\n"); + fprintf(self->dumper.out, " FILE* fout = NULL;\n"); + fprintf(self->dumper.out, " codes_handle* h = NULL;\n"); + fprintf(self->dumper.out, " long* ivalues = NULL;\n"); + fprintf(self->dumper.out, " char** svalues = NULL;\n"); + fprintf(self->dumper.out, " double* rvalues = NULL;\n"); + fprintf(self->dumper.out, " const char* sampleName = \"%s\";\n\n", sampleName); + } + + fprintf(self->dumper.out, " h = codes_bufr_handle_new_from_samples(NULL, sampleName);\n"); + fprintf(self->dumper.out, " if (h == NULL) {\n"); + fprintf(self->dumper.out, " fprintf(stderr, \"ERROR creating BUFR from %%s\\n\", sampleName);\n"); + fprintf(self->dumper.out, " return 1;\n"); + fprintf(self->dumper.out, " }\n"); } static void footer(grib_dumper* d, grib_handle* h) { - grib_dumper_bufr_encode_C *self = (grib_dumper_bufr_encode_C*)d; - fprintf(self->dumper.out,"\n /* Encode the keys back in the data section */\n"); - fprintf(self->dumper.out," CODES_CHECK(codes_set_long(h, \"pack\", 1), 0);\n\n"); - if (d->count==1) - fprintf(self->dumper.out," fout = fopen(\"outfile.bufr\", \"w\");\n"); + grib_dumper_bufr_encode_C* self = (grib_dumper_bufr_encode_C*)d; + fprintf(self->dumper.out, "\n /* Encode the keys back in the data section */\n"); + fprintf(self->dumper.out, " CODES_CHECK(codes_set_long(h, \"pack\", 1), 0);\n\n"); + if (d->count == 1) + fprintf(self->dumper.out, " fout = fopen(\"outfile.bufr\", \"w\");\n"); else - fprintf(self->dumper.out," fout = fopen(\"outfile.bufr\", \"a\");\n"); + fprintf(self->dumper.out, " fout = fopen(\"outfile.bufr\", \"a\");\n"); /*fprintf(self->dumper.out," fout = fopen(\"outfile.bufr\", \"w\");");*/ - fprintf(self->dumper.out," if (!fout) {\n"); - fprintf(self->dumper.out," fprintf(stderr, \"Failed to open (%s) output file.\\n\");\n", (d->count==1?"create":"append")); - fprintf(self->dumper.out," return 1;\n"); - fprintf(self->dumper.out," }\n"); - fprintf(self->dumper.out," CODES_CHECK(codes_get_message(h,&buffer,&size),0);\n"); - fprintf(self->dumper.out," if (fwrite(buffer,1,size,fout) != size) {\n"); - fprintf(self->dumper.out," fprintf(stderr, \"Failed to write data.\\n\");\n"); - fprintf(self->dumper.out," return 1;\n"); - fprintf(self->dumper.out," }\n"); - fprintf(self->dumper.out," if (fclose(fout)!=0) {\n"); - fprintf(self->dumper.out," fprintf(stderr, \"Failed to close file handle.\\n\");\n"); - fprintf(self->dumper.out," return 1;\n"); - fprintf(self->dumper.out," }\n"); - fprintf(self->dumper.out," \n"); - fprintf(self->dumper.out," codes_handle_delete(h);\n"); - if (d->count==1) - fprintf(self->dumper.out," printf(\"Created output BUFR file 'outfile.bufr'.\\n\");\n"); - fprintf(self->dumper.out," free(ivalues); ivalues = NULL;\n"); - fprintf(self->dumper.out," free(rvalues); rvalues = NULL;\n"); - fprintf(self->dumper.out," free(svalues); svalues = NULL;\n\n"); + fprintf(self->dumper.out, " if (!fout) {\n"); + fprintf(self->dumper.out, " fprintf(stderr, \"Failed to open (%s) output file.\\n\");\n", (d->count == 1 ? "create" : "append")); + fprintf(self->dumper.out, " return 1;\n"); + fprintf(self->dumper.out, " }\n"); + fprintf(self->dumper.out, " CODES_CHECK(codes_get_message(h,&buffer,&size),0);\n"); + fprintf(self->dumper.out, " if (fwrite(buffer,1,size,fout) != size) {\n"); + fprintf(self->dumper.out, " fprintf(stderr, \"Failed to write data.\\n\");\n"); + fprintf(self->dumper.out, " return 1;\n"); + fprintf(self->dumper.out, " }\n"); + fprintf(self->dumper.out, " if (fclose(fout)!=0) {\n"); + fprintf(self->dumper.out, " fprintf(stderr, \"Failed to close file handle.\\n\");\n"); + fprintf(self->dumper.out, " return 1;\n"); + fprintf(self->dumper.out, " }\n"); + fprintf(self->dumper.out, " \n"); + fprintf(self->dumper.out, " codes_handle_delete(h);\n"); + if (d->count == 1) + fprintf(self->dumper.out, " printf(\"Created output BUFR file 'outfile.bufr'.\\n\");\n"); + fprintf(self->dumper.out, " free(ivalues); ivalues = NULL;\n"); + fprintf(self->dumper.out, " free(rvalues); rvalues = NULL;\n"); + fprintf(self->dumper.out, " free(svalues); svalues = NULL;\n\n"); } diff --git a/src/grib_dumper_class_bufr_encode_filter.c b/src/grib_dumper_class_bufr_encode_filter.c index dfe65b260..3a23ffe1b 100644 --- a/src/grib_dumper_class_bufr_encode_filter.c +++ b/src/grib_dumper_class_bufr_encode_filter.c @@ -43,244 +43,270 @@ or edit "dumper.class" and rerun ./make_class.pl */ -static void init_class (grib_dumper_class*); -static int init (grib_dumper* d); -static int destroy (grib_dumper*); -static void dump_long (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_bits (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_double (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_string (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_string_array (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_bytes (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_values (grib_dumper* d, grib_accessor* a); -static void dump_label (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_section (grib_dumper* d, grib_accessor* a,grib_block_of_accessors* block); -static void header (grib_dumper*,grib_handle*); - -typedef struct grib_dumper_bufr_encode_filter { - grib_dumper dumper; -/* Members defined in bufr_encode_filter */ - long section_offset; - long begin; - long empty; - long end; - long isLeaf; - long isAttribute; - grib_string_list* keys; +static void init_class(grib_dumper_class*); +static int init(grib_dumper* d); +static int destroy(grib_dumper*); +static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_bits(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_values(grib_dumper* d, grib_accessor* a); +static void dump_label(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block); +static void header(grib_dumper*, grib_handle*); + +typedef struct grib_dumper_bufr_encode_filter +{ + grib_dumper dumper; + /* Members defined in bufr_encode_filter */ + long section_offset; + long begin; + long empty; + long end; + long isLeaf; + long isAttribute; + grib_string_list* keys; } grib_dumper_bufr_encode_filter; static grib_dumper_class _grib_dumper_class_bufr_encode_filter = { - 0, /* super */ - "bufr_encode_filter", /* name */ - sizeof(grib_dumper_bufr_encode_filter), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - &destroy, /* free mem */ - &dump_long, /* dump long */ - &dump_double, /* dump double */ - &dump_string, /* dump string */ - &dump_string_array, /* dump string array */ - &dump_label, /* dump labels */ - &dump_bytes, /* dump bytes */ - &dump_bits, /* dump bits */ - &dump_section, /* dump section */ - &dump_values, /* dump values */ - &header, /* header */ - 0, /* footer */ + 0, /* super */ + "bufr_encode_filter", /* name */ + sizeof(grib_dumper_bufr_encode_filter), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + &destroy, /* free mem */ + &dump_long, /* dump long */ + &dump_double, /* dump double */ + &dump_string, /* dump string */ + &dump_string_array, /* dump string array */ + &dump_label, /* dump labels */ + &dump_bytes, /* dump bytes */ + &dump_bits, /* dump bits */ + &dump_section, /* dump section */ + &dump_values, /* dump values */ + &header, /* header */ + 0, /* footer */ }; grib_dumper_class* grib_dumper_class_bufr_encode_filter = &_grib_dumper_class_bufr_encode_filter; /* END_CLASS_IMP */ -static void dump_attributes(grib_dumper* d,grib_accessor* a, const char* prefix); +static void dump_attributes(grib_dumper* d, grib_accessor* a, const char* prefix); /* Note: A fast cut-down version of strcmp which does NOT return -1 */ /* 0 means input strings are equal and 1 means not equal */ GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b) { - if (*a != *b) return 1; - while((*a!=0 && *b!=0) && *(a) == *(b) ) {a++;b++;} - return (*a==0 && *b==0) ? 0 : 1; + if (*a != *b) + return 1; + while ((*a != 0 && *b != 0) && *(a) == *(b)) { + a++; + b++; + } + return (*a == 0 && *b == 0) ? 0 : 1; } typedef struct string_count string_count; -struct string_count { +struct string_count +{ char* value; int count; string_count* next; }; -static int depth=0; +static int depth = 0; -static void init_class (grib_dumper_class* c){} +static void init_class(grib_dumper_class* c) {} static int init(grib_dumper* d) { - grib_dumper_bufr_encode_filter *self = (grib_dumper_bufr_encode_filter*)d; - grib_context* c=d->handle->context; - self->section_offset=0; - self->empty=1; - self->isLeaf=0; - self->isAttribute=0; - self->keys=(grib_string_list*)grib_context_malloc_clear(c,sizeof(grib_string_list)); + grib_dumper_bufr_encode_filter* self = (grib_dumper_bufr_encode_filter*)d; + grib_context* c = d->handle->context; + self->section_offset = 0; + self->empty = 1; + self->isLeaf = 0; + self->isAttribute = 0; + self->keys = (grib_string_list*)grib_context_malloc_clear(c, sizeof(grib_string_list)); return GRIB_SUCCESS; } static int destroy(grib_dumper* d) { - grib_dumper_bufr_encode_filter *self = (grib_dumper_bufr_encode_filter*)d; - grib_string_list* next=self->keys; - grib_string_list* cur=self->keys; - grib_context* c=d->handle->context; - while(next) { - cur=next; - next=next->next; - grib_context_free(c,cur->value); - grib_context_free(c,cur); + grib_dumper_bufr_encode_filter* self = (grib_dumper_bufr_encode_filter*)d; + grib_string_list* next = self->keys; + grib_string_list* cur = self->keys; + grib_context* c = d->handle->context; + while (next) { + cur = next; + next = next->next; + grib_context_free(c, cur->value); + grib_context_free(c, cur); } return GRIB_SUCCESS; } static void dump_values(grib_dumper* d, grib_accessor* a) { - grib_dumper_bufr_encode_filter *self = (grib_dumper_bufr_encode_filter*)d; - double value=0; size_t size = 0; - double *values=NULL; - int err = 0; - int i,r; - int cols=9; - long count=0; - grib_context* c=a->context; - grib_handle* h=grib_handle_of_accessor(a); - - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) !=0) + grib_dumper_bufr_encode_filter* self = (grib_dumper_bufr_encode_filter*)d; + double value = 0; + size_t size = 0; + double* values = NULL; + int err = 0; + int i, r; + int cols = 9; + long count = 0; + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); + + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; - if (size>1) { - values=(double*)grib_context_malloc_clear(c,sizeof(double)*size); - err=grib_unpack_double(a,values,&size); - } else { - err=grib_unpack_double(a,&value,&size); + if (size > 1) { + values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); + err = grib_unpack_double(a, values, &size); + } + else { + err = grib_unpack_double(a, &value, &size); } - self->begin=0; - self->empty=0; + self->begin = 0; + self->empty = 0; - if (size>1) { - int icount=0; + if (size > 1) { + int icount = 0; - if ((r=compute_bufr_key_rank(h,self->keys,a->name))!=0) - fprintf(self->dumper.out,"set #%d#%s=",r,a->name); + if ((r = compute_bufr_key_rank(h, self->keys, a->name)) != 0) + fprintf(self->dumper.out, "set #%d#%s=", r, a->name); else - fprintf(self->dumper.out,"set %s=",a->name); + fprintf(self->dumper.out, "set %s=", a->name); - fprintf(self->dumper.out,"{"); + fprintf(self->dumper.out, "{"); - for (i=0; icols || i==0) {fprintf(self->dumper.out,"\n ");icount=0;} - fprintf(self->dumper.out,"%.18e, ", values[i]); + for (i = 0; i < size - 1; ++i) { + if (icount > cols || i == 0) { + fprintf(self->dumper.out, "\n "); + icount = 0; + } + fprintf(self->dumper.out, "%.18e, ", values[i]); icount++; } - if (icount>cols || i==0) {fprintf(self->dumper.out,"\n ");icount=0;} - fprintf(self->dumper.out, "%.18e",values[i]); - - depth-=2; - fprintf(self->dumper.out,"};\n"); - grib_context_free(c,values); - } else { - r=compute_bufr_key_rank(h,self->keys,a->name); - if( !grib_is_missing_double(a,value) ) { - - if (r!=0) - fprintf(self->dumper.out,"set #%d#%s=",r,a->name); + if (icount > cols || i == 0) { + fprintf(self->dumper.out, "\n "); + icount = 0; + } + fprintf(self->dumper.out, "%.18e", values[i]); + + depth -= 2; + fprintf(self->dumper.out, "};\n"); + grib_context_free(c, values); + } + else { + r = compute_bufr_key_rank(h, self->keys, a->name); + if (!grib_is_missing_double(a, value)) { + if (r != 0) + fprintf(self->dumper.out, "set #%d#%s=", r, a->name); else - fprintf(self->dumper.out,"set %s=",a->name); + fprintf(self->dumper.out, "set %s=", a->name); - fprintf(self->dumper.out,"%.18e;\n",value); + fprintf(self->dumper.out, "%.18e;\n", value); } } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } (void)err; /* TODO */ } -static void dump_values_attribute(grib_dumper* d,grib_accessor* a, const char* prefix) +static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* prefix) { - grib_dumper_bufr_encode_filter *self = (grib_dumper_bufr_encode_filter*)d; - double value=0; size_t size = 0; - double *values=NULL; - int err = 0; - int i,icount; - int cols=2; - long count=0; - grib_context* c=a->context; - - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) !=0) + grib_dumper_bufr_encode_filter* self = (grib_dumper_bufr_encode_filter*)d; + double value = 0; + size_t size = 0; + double* values = NULL; + int err = 0; + int i, icount; + int cols = 2; + long count = 0; + grib_context* c = a->context; + + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; - if (size>1) { - values=(double*)grib_context_malloc_clear(c,sizeof(double)*size); - err=grib_unpack_double(a,values,&size); - } else { - err=grib_unpack_double(a,&value,&size); + if (size > 1) { + values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); + err = grib_unpack_double(a, values, &size); + } + else { + err = grib_unpack_double(a, &value, &size); } - self->empty=0; - - if (size>1) { - fprintf(self->dumper.out,"set %s->%s = {", prefix, a->name); - icount=0; - for (i=0; icols || i==0) {fprintf(self->dumper.out,"\n ");icount=0;} - fprintf(self->dumper.out,"%.18e, ", values[i]); + self->empty = 0; + + if (size > 1) { + fprintf(self->dumper.out, "set %s->%s = {", prefix, a->name); + icount = 0; + for (i = 0; i < size - 1; ++i) { + if (icount > cols || i == 0) { + fprintf(self->dumper.out, "\n "); + icount = 0; + } + fprintf(self->dumper.out, "%.18e, ", values[i]); icount++; } - if (icount>cols || i==0) {fprintf(self->dumper.out,"\n ");icount=0;} - fprintf(self->dumper.out,"%.18e", values[i]); + if (icount > cols || i == 0) { + fprintf(self->dumper.out, "\n "); + icount = 0; + } + fprintf(self->dumper.out, "%.18e", values[i]); - depth-=2; - fprintf(self->dumper.out,"};\n"); - grib_context_free(c,values); - } else { + depth -= 2; + fprintf(self->dumper.out, "};\n"); + grib_context_free(c, values); + } + else { /* int r=compute_bufr_key_rank(h,self->keys,a->name); */ - if( !grib_is_missing_double(a,value) ) { - fprintf(self->dumper.out,"set %s->%s = %.18e;\n", prefix, a->name, value); + if (!grib_is_missing_double(a, value)) { + fprintf(self->dumper.out, "set %s->%s = %.18e;\n", prefix, a->name, value); } } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix1; - prefix1=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+strlen(prefix)+5)); - sprintf(prefix1,"%s->%s",prefix,a->name); + prefix1 = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + strlen(prefix) + 5)); + sprintf(prefix1, "%s->%s", prefix, a->name); - dump_attributes(d,a,prefix1); + dump_attributes(d, a, prefix1); - grib_context_free(c,prefix1); - depth-=2; + grib_context_free(c, prefix1); + depth -= 2; } (void)err; /* TODO */ @@ -288,158 +314,181 @@ static void dump_values_attribute(grib_dumper* d,grib_accessor* a, const char* p static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_encode_filter *self = (grib_dumper_bufr_encode_filter*)d; - long value=0; size_t size = 0; - long *values=NULL; - int err = 0; - int i,r,icount; - int cols=9; - long count=0; - grib_context* c=a->context; - grib_handle* h=grib_handle_of_accessor(a); - - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 ) + grib_dumper_bufr_encode_filter* self = (grib_dumper_bufr_encode_filter*)d; + long value = 0; + size_t size = 0; + long* values = NULL; + int err = 0; + int i, r, icount; + int cols = 9; + long count = 0; + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); + + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; - if ( (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { - if (self->isLeaf==0) { + if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; - - r=compute_bufr_key_rank(h,self->keys,a->name); - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; - - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + int dofree = 0; + + r = compute_bufr_key_rank(h, self->keys, a->name); + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; + + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } return; } - if (size>1) { - values=(long*)grib_context_malloc_clear(a->context,sizeof(long)*size); - err=grib_unpack_long(a,values,&size); - } else { - err=grib_unpack_long(a,&value,&size); + if (size > 1) { + values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); + err = grib_unpack_long(a, values, &size); + } + else { + err = grib_unpack_long(a, &value, &size); } - self->begin=0; - self->empty=0; + self->begin = 0; + self->empty = 0; - if (size>1) { - icount=0; - if ((r=compute_bufr_key_rank(h,self->keys,a->name))!=0) - fprintf(self->dumper.out,"set #%d#%s=",r,a->name); + if (size > 1) { + icount = 0; + if ((r = compute_bufr_key_rank(h, self->keys, a->name)) != 0) + fprintf(self->dumper.out, "set #%d#%s=", r, a->name); else - fprintf(self->dumper.out,"set %s=",a->name); + fprintf(self->dumper.out, "set %s=", a->name); - fprintf(self->dumper.out,"{"); + fprintf(self->dumper.out, "{"); - for (i=0;icols || i==0) {fprintf(self->dumper.out,"\n ");icount=0;} - fprintf(self->dumper.out,"%ld, ",values[i]); + for (i = 0; i < size - 1; i++) { + if (icount > cols || i == 0) { + fprintf(self->dumper.out, "\n "); + icount = 0; + } + fprintf(self->dumper.out, "%ld, ", values[i]); icount++; } - if (icount>cols || i==0) {fprintf(self->dumper.out,"\n ");icount=0;} - fprintf(self->dumper.out,"%ld ",values[i]); - - depth-=2; - fprintf(self->dumper.out,"};\n"); - grib_context_free(a->context,values); - } else { - r=compute_bufr_key_rank(h,self->keys,a->name); - if( !grib_is_missing_long(a,value) ) { - if (r!=0) - fprintf(self->dumper.out,"set #%d#%s=",r,a->name); + if (icount > cols || i == 0) { + fprintf(self->dumper.out, "\n "); + icount = 0; + } + fprintf(self->dumper.out, "%ld ", values[i]); + + depth -= 2; + fprintf(self->dumper.out, "};\n"); + grib_context_free(a->context, values); + } + else { + r = compute_bufr_key_rank(h, self->keys, a->name); + if (!grib_is_missing_long(a, value)) { + if (r != 0) + fprintf(self->dumper.out, "set #%d#%s=", r, a->name); else - fprintf(self->dumper.out,"set %s=",a->name); + fprintf(self->dumper.out, "set %s=", a->name); - fprintf(self->dumper.out,"%ld;\n",value); + fprintf(self->dumper.out, "%ld;\n", value); } } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } (void)err; /* TODO */ } static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* prefix) { - grib_dumper_bufr_encode_filter *self = (grib_dumper_bufr_encode_filter*)d; - long value=0; size_t size = 0; - long *values=NULL; - int err = 0; - int i,icount; - int cols=4; - long count=0; - grib_context* c=a->context; - - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + grib_dumper_bufr_encode_filter* self = (grib_dumper_bufr_encode_filter*)d; + long value = 0; + size_t size = 0; + long* values = NULL; + int err = 0; + int i, icount; + int cols = 4; + long count = 0; + grib_context* c = a->context; + + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; - if (size>1) { - values=(long*)grib_context_malloc_clear(a->context,sizeof(long)*size); - err=grib_unpack_long(a,values,&size); - } else { - err=grib_unpack_long(a,&value,&size); + if (size > 1) { + values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); + err = grib_unpack_long(a, values, &size); + } + else { + err = grib_unpack_long(a, &value, &size); } - self->empty=0; - - if (size>1) { - fprintf(self->dumper.out,"set %s->%s = {", prefix, a->name); - icount=0; - for (i=0;icols || i==0) {fprintf(self->dumper.out,"\n ");icount=0;} - fprintf(self->dumper.out,"%ld, ",values[i]); + self->empty = 0; + + if (size > 1) { + fprintf(self->dumper.out, "set %s->%s = {", prefix, a->name); + icount = 0; + for (i = 0; i < size - 1; i++) { + if (icount > cols || i == 0) { + fprintf(self->dumper.out, "\n "); + icount = 0; + } + fprintf(self->dumper.out, "%ld, ", values[i]); icount++; } - if (icount>cols || i==0) {fprintf(self->dumper.out,"\n ");icount=0;} - fprintf(self->dumper.out,"%ld ",values[i]); - depth-=2; - fprintf(self->dumper.out,"};\n"); - grib_context_free(a->context,values); - - } else { + if (icount > cols || i == 0) { + fprintf(self->dumper.out, "\n "); + icount = 0; + } + fprintf(self->dumper.out, "%ld ", values[i]); + depth -= 2; + fprintf(self->dumper.out, "};\n"); + grib_context_free(a->context, values); + } + else { /* int r=compute_bufr_key_rank(h,self->keys,a->name); */ - if( !grib_is_missing_long(a,value) ) { - fprintf(self->dumper.out,"set %s->%s = ",prefix,a->name); - fprintf(self->dumper.out,"%ld ;\n",value); + if (!grib_is_missing_long(a, value)) { + fprintf(self->dumper.out, "set %s->%s = ", prefix, a->name); + fprintf(self->dumper.out, "%ld ;\n", value); } } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix1; - prefix1=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+strlen(prefix)+5)); - sprintf(prefix1,"%s->%s",prefix,a->name); + prefix1 = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + strlen(prefix) + 5)); + sprintf(prefix1, "%s->%s", prefix, a->name); - dump_attributes(d,a,prefix1); + dump_attributes(d, a, prefix1); - grib_context_free(c,prefix1); - depth-=2; + grib_context_free(c, prefix1); + depth -= 2; } (void)err; /* TODO */ } @@ -450,180 +499,196 @@ static void dump_bits(grib_dumper* d, grib_accessor* a, const char* comment) static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_encode_filter *self = (grib_dumper_bufr_encode_filter*)d; - double value=0; size_t size = 1; + grib_dumper_bufr_encode_filter* self = (grib_dumper_bufr_encode_filter*)d; + double value = 0; + size_t size = 1; int r; - grib_handle* h=grib_handle_of_accessor(a); - grib_context* c=h->context; + grib_handle* h = grib_handle_of_accessor(a); + grib_context* c = h->context; - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_unpack_double(a,&value,&size); - self->begin=0; - self->empty=0; + grib_unpack_double(a, &value, &size); + self->begin = 0; + self->empty = 0; - r=compute_bufr_key_rank(h,self->keys,a->name); - if( !grib_is_missing_double(a,value) ) { - if (r!=0) - fprintf(self->dumper.out,"set #%d#%s=",r,a->name); + r = compute_bufr_key_rank(h, self->keys, a->name); + if (!grib_is_missing_double(a, value)) { + if (r != 0) + fprintf(self->dumper.out, "set #%d#%s=", r, a->name); else - fprintf(self->dumper.out,"set %s=",a->name); + fprintf(self->dumper.out, "set %s=", a->name); - fprintf(self->dumper.out,"%.18e;\n",value); + fprintf(self->dumper.out, "%.18e;\n", value); } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } } static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_encode_filter *self = (grib_dumper_bufr_encode_filter*)d; - char **values=NULL; - size_t size = 0,i=0; - grib_context* c=NULL; - int err = 0; - long count=0; - int r=0; - grib_handle* h=grib_handle_of_accessor(a); - - c=a->context; - - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + grib_dumper_bufr_encode_filter* self = (grib_dumper_bufr_encode_filter*)d; + char** values = NULL; + size_t size = 0, i = 0; + grib_context* c = NULL; + int err = 0; + long count = 0; + int r = 0; + grib_handle* h = grib_handle_of_accessor(a); + + c = a->context; + + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a,&count); - size=count; - if (size==1) { - dump_string(d,a,comment); + grib_value_count(a, &count); + size = count; + if (size == 1) { + dump_string(d, a, comment); return; } - self->begin=0; + self->begin = 0; - if (self->isLeaf==0) { - depth+=2; - if ((r=compute_bufr_key_rank(h,self->keys,a->name))!=0) - fprintf(self->dumper.out,"set #%d#%s=",r,a->name); + if (self->isLeaf == 0) { + depth += 2; + if ((r = compute_bufr_key_rank(h, self->keys, a->name)) != 0) + fprintf(self->dumper.out, "set #%d#%s=", r, a->name); else - fprintf(self->dumper.out,"set %s=",a->name); + fprintf(self->dumper.out, "set %s=", a->name); } - self->empty=0; + self->empty = 0; - values=(char**)grib_context_malloc_clear(c,size*sizeof(char*)); + values = (char**)grib_context_malloc_clear(c, size * sizeof(char*)); if (!values) { - grib_context_log(c,GRIB_LOG_FATAL,"unable to allocate %d bytes",(int)size); + grib_context_log(c, GRIB_LOG_FATAL, "unable to allocate %d bytes", (int)size); return; } - err = grib_unpack_string_array(a,values,&size); + err = grib_unpack_string_array(a, values, &size); fprintf(self->dumper.out, "{"); - depth+=2; - for (i=0;idumper.out," \"%s\",\n",values[i]); + depth += 2; + for (i = 0; i < size - 1; i++) { + fprintf(self->dumper.out, " \"%s\",\n", values[i]); } - fprintf(self->dumper.out," \"%s\"\n",values[i]); + fprintf(self->dumper.out, " \"%s\"\n", values[i]); - depth-=2; + depth -= 2; fprintf(self->dumper.out, "};\n"); - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } - grib_context_free(c,values); + grib_context_free(c, values); (void)err; /* TODO */ } static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_encode_filter *self = (grib_dumper_bufr_encode_filter*)d; - char *value=NULL; - char *p = NULL; - size_t size = 0; - grib_context* c=NULL; + grib_dumper_bufr_encode_filter* self = (grib_dumper_bufr_encode_filter*)d; + char* value = NULL; + char* p = NULL; + size_t size = 0; + grib_context* c = NULL; int r; - int err = _grib_get_string_length(a,&size); - grib_handle* h=grib_handle_of_accessor(a); + int err = _grib_get_string_length(a, &size); + grib_handle* h = grib_handle_of_accessor(a); - c=a->context; - if (size==0) return; + c = a->context; + if (size == 0) + return; - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - value=(char*)grib_context_malloc_clear(c,size); + value = (char*)grib_context_malloc_clear(c, size); if (!value) { - grib_context_log(c,GRIB_LOG_FATAL,"unable to allocate %d bytes",(int)size); + grib_context_log(c, GRIB_LOG_FATAL, "unable to allocate %d bytes", (int)size); return; } - else self->begin=0; + else + self->begin = 0; - self->empty=0; + self->empty = 0; - err = grib_unpack_string(a,value,&size); - p=value; - r=compute_bufr_key_rank(h,self->keys,a->name); - if (grib_is_missing_string(a,(unsigned char *)value,size)) { + err = grib_unpack_string(a, value, &size); + p = value; + r = compute_bufr_key_rank(h, self->keys, a->name); + if (grib_is_missing_string(a, (unsigned char*)value, size)) { strcpy(value, ""); /* Empty string means MISSING string */ } - while(*p) { if(!isprint(*p)) *p = '.'; p++; } + while (*p) { + if (!isprint(*p)) + *p = '.'; + p++; + } - if (self->isLeaf==0) { - depth+=2; - if (r!=0) - fprintf(self->dumper.out,"set #%d#%s=",r,a->name); + if (self->isLeaf == 0) { + depth += 2; + if (r != 0) + fprintf(self->dumper.out, "set #%d#%s=", r, a->name); else - fprintf(self->dumper.out,"set %s=",a->name); + fprintf(self->dumper.out, "set %s=", a->name); } - fprintf(self->dumper.out,"\"%s\";\n",value); + fprintf(self->dumper.out, "\"%s\";\n", value); - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } - grib_context_free(c,value); + grib_context_free(c, value); (void)err; /* TODO */ } @@ -638,98 +703,104 @@ static void dump_label(grib_dumper* d, grib_accessor* a, const char* comment) static void _dump_long_array(grib_handle* h, FILE* f, const char* key, const char* print_key) { long* val; - size_t size=0,i; - int cols=9,icount=0; - - if (grib_get_size(h,key,&size)==GRIB_NOT_FOUND) return; - if (size==0) return; - - val=(long*)grib_context_malloc_clear(h->context,sizeof(long)*size); - grib_get_long_array(h,key,val,&size); - fprintf(f,"set %s= {",print_key); - for (i=0;icols || i==0) {fprintf(f,"\n ");icount=0;} - fprintf(f,"%ld, ",val[i]); + size_t size = 0, i; + int cols = 9, icount = 0; + + if (grib_get_size(h, key, &size) == GRIB_NOT_FOUND) + return; + if (size == 0) + return; + + val = (long*)grib_context_malloc_clear(h->context, sizeof(long) * size); + grib_get_long_array(h, key, val, &size); + fprintf(f, "set %s= {", print_key); + for (i = 0; i < size - 1; i++) { + if (icount > cols || i == 0) { + fprintf(f, "\n "); + icount = 0; + } + fprintf(f, "%ld, ", val[i]); icount++; } - if (icount>cols) {fprintf(f,"\n ");} - fprintf(f,"%ld};\n",val[size-1]); + if (icount > cols) { + fprintf(f, "\n "); + } + fprintf(f, "%ld};\n", val[size - 1]); - grib_context_free(h->context,val); + grib_context_free(h->context, val); } static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block) { - grib_dumper_bufr_encode_filter *self = (grib_dumper_bufr_encode_filter*)d; - if (!grib_inline_strcmp(a->name,"BUFR") || - !grib_inline_strcmp(a->name,"GRIB") || - !grib_inline_strcmp(a->name,"META") - ) { - grib_handle* h=grib_handle_of_accessor(a); - depth=2; - self->begin=1; - self->empty=1; - depth+=2; - _dump_long_array(h,self->dumper.out,"dataPresentIndicator","inputDataPresentIndicator"); - _dump_long_array(h,self->dumper.out,"delayedDescriptorReplicationFactor","inputDelayedDescriptorReplicationFactor"); - _dump_long_array(h,self->dumper.out,"shortDelayedDescriptorReplicationFactor","inputShortDelayedDescriptorReplicationFactor"); - _dump_long_array(h,self->dumper.out,"extendedDelayedDescriptorReplicationFactor","inputExtendedDelayedDescriptorReplicationFactor"); - _dump_long_array(h,self->dumper.out,"inputOverriddenReferenceValues","inputOverriddenReferenceValues"); - grib_dump_accessors_block(d,block); - depth-=2; - } else if (!grib_inline_strcmp(a->name,"groupNumber")) { - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) + grib_dumper_bufr_encode_filter* self = (grib_dumper_bufr_encode_filter*)d; + if (!grib_inline_strcmp(a->name, "BUFR") || + !grib_inline_strcmp(a->name, "GRIB") || + !grib_inline_strcmp(a->name, "META")) { + grib_handle* h = grib_handle_of_accessor(a); + depth = 2; + self->begin = 1; + self->empty = 1; + depth += 2; + _dump_long_array(h, self->dumper.out, "dataPresentIndicator", "inputDataPresentIndicator"); + _dump_long_array(h, self->dumper.out, "delayedDescriptorReplicationFactor", "inputDelayedDescriptorReplicationFactor"); + _dump_long_array(h, self->dumper.out, "shortDelayedDescriptorReplicationFactor", "inputShortDelayedDescriptorReplicationFactor"); + _dump_long_array(h, self->dumper.out, "extendedDelayedDescriptorReplicationFactor", "inputExtendedDelayedDescriptorReplicationFactor"); + _dump_long_array(h, self->dumper.out, "inputOverriddenReferenceValues", "inputOverriddenReferenceValues"); + grib_dump_accessors_block(d, block); + depth -= 2; + } + else if (!grib_inline_strcmp(a->name, "groupNumber")) { + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - self->begin=1; - self->empty=1; - depth+=2; - grib_dump_accessors_block(d,block); - depth-=2; - } else { - grib_dump_accessors_block(d,block); + self->begin = 1; + self->empty = 1; + depth += 2; + grib_dump_accessors_block(d, block); + depth -= 2; + } + else { + grib_dump_accessors_block(d, block); } } -static void dump_attributes(grib_dumper* d,grib_accessor* a, const char* prefix) +static void dump_attributes(grib_dumper* d, grib_accessor* a, const char* prefix) { - int i=0; - grib_dumper_bufr_encode_filter *self = (grib_dumper_bufr_encode_filter*)d; + int i = 0; + grib_dumper_bufr_encode_filter* self = (grib_dumper_bufr_encode_filter*)d; unsigned long flags; while (i < MAX_ACCESSOR_ATTRIBUTES && a->attributes[i]) { - self->isAttribute=1; - if ( (d->option_flags & GRIB_DUMP_FLAG_ALL_ATTRIBUTES ) == 0 - && (a->attributes[i]->flags & GRIB_ACCESSOR_FLAG_DUMP)== 0 ) - { + self->isAttribute = 1; + if ((d->option_flags & GRIB_DUMP_FLAG_ALL_ATTRIBUTES) == 0 && (a->attributes[i]->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) { i++; continue; } - self->isLeaf=a->attributes[i]->attributes[0]==NULL ? 1 : 0; + self->isLeaf = a->attributes[i]->attributes[0] == NULL ? 1 : 0; /* fprintf(self->dumper.out,","); */ /* fprintf(self->dumper.out,"\n%-*s",depth," "); */ /* fprintf(out,"\"%s\" : ",a->attributes[i]->name); */ - flags=a->attributes[i]->flags; + flags = a->attributes[i]->flags; a->attributes[i]->flags |= GRIB_ACCESSOR_FLAG_DUMP; switch (grib_accessor_get_native_type(a->attributes[i])) { - case GRIB_TYPE_LONG: - dump_long_attribute(d,a->attributes[i],prefix); - break; - case GRIB_TYPE_DOUBLE: - dump_values_attribute(d,a->attributes[i],prefix); - break; - case GRIB_TYPE_STRING: - break; + case GRIB_TYPE_LONG: + dump_long_attribute(d, a->attributes[i], prefix); + break; + case GRIB_TYPE_DOUBLE: + dump_values_attribute(d, a->attributes[i], prefix); + break; + case GRIB_TYPE_STRING: + break; } - a->attributes[i]->flags=flags; + a->attributes[i]->flags = flags; i++; } - self->isLeaf = 0; + self->isLeaf = 0; self->isAttribute = 0; } static void header(grib_dumper* d, grib_handle* h) { - grib_dumper_bufr_encode_filter *self = (grib_dumper_bufr_encode_filter*)d; - char sampleName[128]={0}; + grib_dumper_bufr_encode_filter* self = (grib_dumper_bufr_encode_filter*)d; + char sampleName[128] = { 0 }; long localSectionPresent, edition, bufrHeaderCentre, isSatellite; Assert(h->product_kind == PRODUCT_BUFR); @@ -744,7 +815,8 @@ static void header(grib_dumper* d, grib_handle* h) sprintf(sampleName, "BUFR%ld_local_satellite", edition); else sprintf(sampleName, "BUFR%ld_local", edition); - } else { + } + else { sprintf(sampleName, "BUFR%ld", edition); } diff --git a/src/grib_dumper_class_bufr_encode_fortran.c b/src/grib_dumper_class_bufr_encode_fortran.c index d5c88da95..10f7c5902 100644 --- a/src/grib_dumper_class_bufr_encode_fortran.c +++ b/src/grib_dumper_class_bufr_encode_fortran.c @@ -42,52 +42,53 @@ or edit "dumper.class" and rerun ./make_class.pl */ -static void init_class (grib_dumper_class*); -static int init (grib_dumper* d); -static int destroy (grib_dumper*); -static void dump_long (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_bits (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_double (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_string (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_string_array (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_bytes (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_values (grib_dumper* d, grib_accessor* a); -static void dump_label (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_section (grib_dumper* d, grib_accessor* a,grib_block_of_accessors* block); -static void header (grib_dumper*,grib_handle*); -static void footer (grib_dumper*,grib_handle*); - -typedef struct grib_dumper_bufr_encode_fortran { - grib_dumper dumper; -/* Members defined in bufr_encode_fortran */ - long section_offset; - long empty; - long end; - long isLeaf; - long isAttribute; - grib_string_list* keys; +static void init_class(grib_dumper_class*); +static int init(grib_dumper* d); +static int destroy(grib_dumper*); +static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_bits(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_values(grib_dumper* d, grib_accessor* a); +static void dump_label(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block); +static void header(grib_dumper*, grib_handle*); +static void footer(grib_dumper*, grib_handle*); + +typedef struct grib_dumper_bufr_encode_fortran +{ + grib_dumper dumper; + /* Members defined in bufr_encode_fortran */ + long section_offset; + long empty; + long end; + long isLeaf; + long isAttribute; + grib_string_list* keys; } grib_dumper_bufr_encode_fortran; static grib_dumper_class _grib_dumper_class_bufr_encode_fortran = { - 0, /* super */ - "bufr_encode_fortran", /* name */ - sizeof(grib_dumper_bufr_encode_fortran), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - &destroy, /* free mem */ - &dump_long, /* dump long */ - &dump_double, /* dump double */ - &dump_string, /* dump string */ - &dump_string_array, /* dump string array */ - &dump_label, /* dump labels */ - &dump_bytes, /* dump bytes */ - &dump_bits, /* dump bits */ - &dump_section, /* dump section */ - &dump_values, /* dump values */ - &header, /* header */ - &footer, /* footer */ + 0, /* super */ + "bufr_encode_fortran", /* name */ + sizeof(grib_dumper_bufr_encode_fortran), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + &destroy, /* free mem */ + &dump_long, /* dump long */ + &dump_double, /* dump double */ + &dump_string, /* dump string */ + &dump_string_array, /* dump string array */ + &dump_label, /* dump labels */ + &dump_bytes, /* dump bytes */ + &dump_bits, /* dump bits */ + &dump_section, /* dump section */ + &dump_values, /* dump values */ + &header, /* header */ + &footer, /* footer */ }; grib_dumper_class* grib_dumper_class_bufr_encode_fortran = &_grib_dumper_class_bufr_encode_fortran; @@ -99,69 +100,78 @@ static void dump_attributes(grib_dumper* d, grib_accessor* a, const char* prefix /* 0 means input strings are equal and 1 means not equal */ GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b) { - if (*a != *b) return 1; - while((*a!=0 && *b!=0) && *(a) == *(b) ) {a++;b++;} - return (*a==0 && *b==0) ? 0 : 1; + if (*a != *b) + return 1; + while ((*a != 0 && *b != 0) && *(a) == *(b)) { + a++; + b++; + } + return (*a == 0 && *b == 0) ? 0 : 1; } typedef struct string_count string_count; -struct string_count { +struct string_count +{ char* value; int count; string_count* next; }; -static int depth=0; +static int depth = 0; -static void init_class (grib_dumper_class* c){} +static void init_class(grib_dumper_class* c) {} static int init(grib_dumper* d) { - grib_dumper_bufr_encode_fortran *self = (grib_dumper_bufr_encode_fortran*)d; - grib_context* c=d->handle->context; - self->section_offset=0; - self->empty=1; - d->count=1; - self->isLeaf=0; - self->isAttribute=0; - self->keys=(grib_string_list*)grib_context_malloc_clear(c,sizeof(grib_string_list)); + grib_dumper_bufr_encode_fortran* self = (grib_dumper_bufr_encode_fortran*)d; + grib_context* c = d->handle->context; + self->section_offset = 0; + self->empty = 1; + d->count = 1; + self->isLeaf = 0; + self->isAttribute = 0; + self->keys = (grib_string_list*)grib_context_malloc_clear(c, sizeof(grib_string_list)); return GRIB_SUCCESS; } static int destroy(grib_dumper* d) { - grib_dumper_bufr_encode_fortran *self = (grib_dumper_bufr_encode_fortran*)d; - grib_string_list* next=self->keys; - grib_string_list* cur=self->keys; - grib_context* c=d->handle->context; - while(next) { - cur=next; - next=next->next; - grib_context_free(c,cur->value); - grib_context_free(c,cur); + grib_dumper_bufr_encode_fortran* self = (grib_dumper_bufr_encode_fortran*)d; + grib_string_list* next = self->keys; + grib_string_list* cur = self->keys; + grib_context* c = d->handle->context; + while (next) { + cur = next; + next = next->next; + grib_context_free(c, cur->value); + grib_context_free(c, cur); } return GRIB_SUCCESS; } static char* lval_to_string(grib_context* c, long v) { - char* sval=(char*)grib_context_malloc_clear(c,sizeof(char)*40); - if (v == GRIB_MISSING_LONG) sprintf(sval,"CODES_MISSING_LONG"); - else sprintf(sval,"%ld",v); + char* sval = (char*)grib_context_malloc_clear(c, sizeof(char) * 40); + if (v == GRIB_MISSING_LONG) + sprintf(sval, "CODES_MISSING_LONG"); + else + sprintf(sval, "%ld", v); return sval; } static char* dval_to_string(grib_context* c, double v) { - char* sval=(char*)grib_context_malloc_clear(c,sizeof(char)*40); + char* sval = (char*)grib_context_malloc_clear(c, sizeof(char) * 40); if (v == GRIB_MISSING_DOUBLE) { - sprintf(sval,"CODES_MISSING_DOUBLE"); - } else { + sprintf(sval, "CODES_MISSING_DOUBLE"); + } + else { char* p; - sprintf(sval,"%.18e",v); - p=sval; - while (*p !=0 ) { - if (*p == 'e') *p='d'; + sprintf(sval, "%.18e", v); + p = sval; + while (*p != 0) { + if (*p == 'e') + *p = 'd'; p++; } } @@ -174,11 +184,11 @@ static char* dval_to_string(grib_context* c, double v) static char* break_line(grib_context* c, const char* input) { /* Break a long line using Fortran continuation characters */ - char* a_token = NULL; - int first = 1; + char* a_token = NULL; + int first = 1; const size_t len = strlen(input); /* Add a bit more for inserted newlines and continuation characters */ - char* result = (char*)grib_context_malloc_clear(c,sizeof(char)*len+100); + char* result = (char*)grib_context_malloc_clear(c, sizeof(char) * len + 100); /* No need to alter input which is already too short or has newlines */ if (len < 70 || strchr(input, '\n')) { @@ -195,7 +205,8 @@ static char* break_line(grib_context* c, const char* input) if (first) { first = 0; strcat(result, a_token); - } else { + } + else { char tmp[256] = {0,}; sprintf(tmp, "->&\n &%s", a_token); strcat(result, tmp); @@ -208,83 +219,94 @@ static char* break_line(grib_context* c, const char* input) static void dump_values(grib_dumper* d, grib_accessor* a) { - grib_dumper_bufr_encode_fortran *self = (grib_dumper_bufr_encode_fortran*)d; - double value=0; size_t size = 0; - double *values=NULL; - int err = 0; - int i,r,icount; - int cols=2; - long count=0; + grib_dumper_bufr_encode_fortran* self = (grib_dumper_bufr_encode_fortran*)d; + double value = 0; + size_t size = 0; + double* values = NULL; + int err = 0; + int i, r, icount; + int cols = 2; + long count = 0; char* sval; - grib_context* c=a->context; - grib_handle* h=grib_handle_of_accessor(a); + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) !=0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; - if (size>1) { - values=(double*)grib_context_malloc_clear(c,sizeof(double)*size); - err=grib_unpack_double(a,values,&size); - } else { - err=grib_unpack_double(a,&value,&size); + if (size > 1) { + values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); + err = grib_unpack_double(a, values, &size); + } + else { + err = grib_unpack_double(a, &value, &size); } - self->empty=0; - - if (size>1) { + self->empty = 0; - fprintf(self->dumper.out," if(allocated(rvalues)) deallocate(rvalues)\n"); - fprintf(self->dumper.out," allocate(rvalues(%lu))\n", (unsigned long)size); + if (size > 1) { + fprintf(self->dumper.out, " if(allocated(rvalues)) deallocate(rvalues)\n"); + fprintf(self->dumper.out, " allocate(rvalues(%lu))\n", (unsigned long)size); - fprintf(self->dumper.out," rvalues=(/"); + fprintf(self->dumper.out, " rvalues=(/"); - icount=0; - for (i=0; icols || i==0) {fprintf(self->dumper.out," &\n ");icount=0;} - sval=dval_to_string(c,values[i]); - fprintf(self->dumper.out,"%s, ", sval); - grib_context_free(c,sval); + icount = 0; + for (i = 0; i < size - 1; ++i) { + if (icount > cols || i == 0) { + fprintf(self->dumper.out, " &\n "); + icount = 0; + } + sval = dval_to_string(c, values[i]); + fprintf(self->dumper.out, "%s, ", sval); + grib_context_free(c, sval); icount++; } - if (icount>cols || i==0) {fprintf(self->dumper.out," &\n ");icount=0;} - sval=dval_to_string(c,values[i]); - fprintf(self->dumper.out,"%s", sval); - grib_context_free(c,sval); + if (icount > cols || i == 0) { + fprintf(self->dumper.out, " &\n "); + icount = 0; + } + sval = dval_to_string(c, values[i]); + fprintf(self->dumper.out, "%s", sval); + grib_context_free(c, sval); - depth-=2; - fprintf(self->dumper.out,"/)\n"); - grib_context_free(c,values); + depth -= 2; + fprintf(self->dumper.out, "/)\n"); + grib_context_free(c, values); - if ((r=compute_bufr_key_rank(h,self->keys,a->name))!=0) - fprintf(self->dumper.out," call codes_set(ibufr,'#%d#%s',rvalues)\n",r,a->name); + if ((r = compute_bufr_key_rank(h, self->keys, a->name)) != 0) + fprintf(self->dumper.out, " call codes_set(ibufr,'#%d#%s',rvalues)\n", r, a->name); else - fprintf(self->dumper.out," call codes_set(ibufr,'%s',rvalues)\n",a->name); - } else { - r=compute_bufr_key_rank(h,self->keys,a->name); - sval=dval_to_string(c,value); - if (r!=0) - fprintf(self->dumper.out," call codes_set(ibufr,'#%d#%s',%s)\n",r,a->name,sval); + fprintf(self->dumper.out, " call codes_set(ibufr,'%s',rvalues)\n", a->name); + } + else { + r = compute_bufr_key_rank(h, self->keys, a->name); + sval = dval_to_string(c, value); + if (r != 0) + fprintf(self->dumper.out, " call codes_set(ibufr,'#%d#%s',%s)\n", r, a->name, sval); else - fprintf(self->dumper.out," call codes_set(ibufr,'%s',%s)\n",a->name,sval); - grib_context_free(c,sval); + fprintf(self->dumper.out, " call codes_set(ibufr,'%s',%s)\n", a->name, sval); + grib_context_free(c, sval); } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } (void)err; /* TODO */ @@ -292,259 +314,294 @@ static void dump_values(grib_dumper* d, grib_accessor* a) static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* prefix) { - grib_dumper_bufr_encode_fortran *self = (grib_dumper_bufr_encode_fortran*)d; - double value=0; size_t size = 0; - double *values=NULL; - int err = 0; - int i,icount; - int cols=2; - long count=0; + grib_dumper_bufr_encode_fortran* self = (grib_dumper_bufr_encode_fortran*)d; + double value = 0; + size_t size = 0; + double* values = NULL; + int err = 0; + int i, icount; + int cols = 2; + long count = 0; char* sval; - grib_context* c=a->context; + grib_context* c = a->context; - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) !=0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; - if (size>1) { - values=(double*)grib_context_malloc_clear(c,sizeof(double)*size); - err=grib_unpack_double(a,values,&size); - } else { - err=grib_unpack_double(a,&value,&size); + if (size > 1) { + values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); + err = grib_unpack_double(a, values, &size); + } + else { + err = grib_unpack_double(a, &value, &size); } - self->empty=0; - - if (size>1) { + self->empty = 0; - fprintf(self->dumper.out," if(allocated(rvalues)) deallocate(rvalues)\n"); - fprintf(self->dumper.out," allocate(rvalues(%lu))\n", (unsigned long)size); + if (size > 1) { + fprintf(self->dumper.out, " if(allocated(rvalues)) deallocate(rvalues)\n"); + fprintf(self->dumper.out, " allocate(rvalues(%lu))\n", (unsigned long)size); - fprintf(self->dumper.out," rvalues=(/"); + fprintf(self->dumper.out, " rvalues=(/"); - icount=0; - for (i=0; icols || i==0) {fprintf(self->dumper.out," &\n ");icount=0;} - sval=dval_to_string(c,values[i]); - fprintf(self->dumper.out,"%s, ", sval); - grib_context_free(c,sval); + icount = 0; + for (i = 0; i < size - 1; ++i) { + if (icount > cols || i == 0) { + fprintf(self->dumper.out, " &\n "); + icount = 0; + } + sval = dval_to_string(c, values[i]); + fprintf(self->dumper.out, "%s, ", sval); + grib_context_free(c, sval); icount++; } - if (icount>cols || i==0) {fprintf(self->dumper.out," &\n ");icount=0;} - sval=dval_to_string(c,values[i]); - fprintf(self->dumper.out,"%s", sval); - grib_context_free(c,sval); + if (icount > cols || i == 0) { + fprintf(self->dumper.out, " &\n "); + icount = 0; + } + sval = dval_to_string(c, values[i]); + fprintf(self->dumper.out, "%s", sval); + grib_context_free(c, sval); - depth-=2; - fprintf(self->dumper.out,"/)\n"); - grib_context_free(c,values); + depth -= 2; + fprintf(self->dumper.out, "/)\n"); + grib_context_free(c, values); - fprintf(self->dumper.out," call codes_set(ibufr,'%s->%s' &\n,rvalues)\n",prefix,a->name); - } else { - sval=dval_to_string(c,value); - fprintf(self->dumper.out," call codes_set(ibufr,'%s->%s' &\n,%s)\n",prefix,a->name,sval); - grib_context_free(c,sval); + fprintf(self->dumper.out, " call codes_set(ibufr,'%s->%s' &\n,rvalues)\n", prefix, a->name); + } + else { + sval = dval_to_string(c, value); + fprintf(self->dumper.out, " call codes_set(ibufr,'%s->%s' &\n,%s)\n", prefix, a->name, sval); + grib_context_free(c, sval); } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix1; - prefix1=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+strlen(prefix)+5)); - sprintf(prefix1,"%s->%s",prefix,a->name); + prefix1 = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + strlen(prefix) + 5)); + sprintf(prefix1, "%s->%s", prefix, a->name); - dump_attributes(d,a,prefix1); + dump_attributes(d, a, prefix1); - grib_context_free(c,prefix1); - depth-=2; + grib_context_free(c, prefix1); + depth -= 2; } (void)err; /* TODO */ } -static void dump_long(grib_dumper* d,grib_accessor* a, const char* comment) +static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_encode_fortran *self = (grib_dumper_bufr_encode_fortran*)d; - long value=0; size_t size = 0; - long *values=NULL; - int err = 0; - int i,r,icount; - int cols=4; - long count=0; - char* sval = NULL; - grib_context* c=a->context; - grib_handle* h=grib_handle_of_accessor(a); - int doing_unexpandedDescriptors=0; - - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 ) return; - - doing_unexpandedDescriptors = (strcmp(a->name, "unexpandedDescriptors")==0); - grib_value_count(a,&count); - size=count; - - if ( (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { - if (self->isLeaf==0) { + grib_dumper_bufr_encode_fortran* self = (grib_dumper_bufr_encode_fortran*)d; + long value = 0; + size_t size = 0; + long* values = NULL; + int err = 0; + int i, r, icount; + int cols = 4; + long count = 0; + char* sval = NULL; + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); + int doing_unexpandedDescriptors = 0; + + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) + return; + + doing_unexpandedDescriptors = (strcmp(a->name, "unexpandedDescriptors") == 0); + grib_value_count(a, &count); + size = count; + + if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; - - r=compute_bufr_key_rank(h,self->keys,a->name); - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; - - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + int dofree = 0; + + r = compute_bufr_key_rank(h, self->keys, a->name); + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; + + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } return; } - if (size>1) { - values=(long*)grib_context_malloc_clear(a->context,sizeof(long)*size); - err=grib_unpack_long(a,values,&size); - } else { - err=grib_unpack_long(a,&value,&size); + if (size > 1) { + values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); + err = grib_unpack_long(a, values, &size); + } + else { + err = grib_unpack_long(a, &value, &size); } - self->empty=0; + self->empty = 0; - if (size>1) { - fprintf(self->dumper.out," if(allocated(ivalues)) deallocate(ivalues)\n"); - fprintf(self->dumper.out," allocate(ivalues(%lu))\n", (unsigned long)size); + if (size > 1) { + fprintf(self->dumper.out, " if(allocated(ivalues)) deallocate(ivalues)\n"); + fprintf(self->dumper.out, " allocate(ivalues(%lu))\n", (unsigned long)size); - fprintf(self->dumper.out," ivalues=(/"); - icount=0; - for (i=0;icols || i==0) {fprintf(self->dumper.out," &\n ");icount=0;} - fprintf(self->dumper.out,"%ld, ",values[i]); + fprintf(self->dumper.out, " ivalues=(/"); + icount = 0; + for (i = 0; i < size - 1; i++) { + if (icount > cols || i == 0) { + fprintf(self->dumper.out, " &\n "); + icount = 0; + } + fprintf(self->dumper.out, "%ld, ", values[i]); icount++; } - if (icount>cols || i==0) {fprintf(self->dumper.out," &\n ");icount=0;} - fprintf(self->dumper.out,"%ld ",values[i]); + if (icount > cols || i == 0) { + fprintf(self->dumper.out, " &\n "); + icount = 0; + } + fprintf(self->dumper.out, "%ld ", values[i]); - depth-=2; - fprintf(self->dumper.out,"/)\n"); - grib_context_free(a->context,values); + depth -= 2; + fprintf(self->dumper.out, "/)\n"); + grib_context_free(a->context, values); - if ((r=compute_bufr_key_rank(h,self->keys,a->name))!=0) { - fprintf(self->dumper.out," call codes_set(ibufr,'#%d#%s',ivalues)\n",r,a->name); - } else { + if ((r = compute_bufr_key_rank(h, self->keys, a->name)) != 0) { + fprintf(self->dumper.out, " call codes_set(ibufr,'#%d#%s',ivalues)\n", r, a->name); + } + else { if (doing_unexpandedDescriptors) { - fprintf(self->dumper.out,"\n ! Create the structure of the data section\n"); + fprintf(self->dumper.out, "\n ! Create the structure of the data section\n"); /* fprintf(self->dumper.out," call codes_set(ibufr,'skipExtraKeyAttributes',1)\n"); */ } - fprintf(self->dumper.out," call codes_set(ibufr,'%s',ivalues)\n",a->name); - if (doing_unexpandedDescriptors) fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out, " call codes_set(ibufr,'%s',ivalues)\n", a->name); + if (doing_unexpandedDescriptors) + fprintf(self->dumper.out, "\n"); } - - } else { - r=compute_bufr_key_rank(h,self->keys,a->name); - sval=lval_to_string(c,value); - if (r!=0) { - fprintf(self->dumper.out," call codes_set(ibufr,'#%d#%s',",r,a->name); - } else { + } + else { + r = compute_bufr_key_rank(h, self->keys, a->name); + sval = lval_to_string(c, value); + if (r != 0) { + fprintf(self->dumper.out, " call codes_set(ibufr,'#%d#%s',", r, a->name); + } + else { if (doing_unexpandedDescriptors) { - fprintf(self->dumper.out,"\n ! Create the structure of the data section\n"); + fprintf(self->dumper.out, "\n ! Create the structure of the data section\n"); /* fprintf(self->dumper.out," call codes_set(ibufr,'skipExtraKeyAttributes',1)\n"); */ } - fprintf(self->dumper.out," call codes_set(ibufr,'%s',",a->name); + fprintf(self->dumper.out, " call codes_set(ibufr,'%s',", a->name); } - fprintf(self->dumper.out,"%s)\n",sval); - grib_context_free(c,sval); - if (doing_unexpandedDescriptors) fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out, "%s)\n", sval); + grib_context_free(c, sval); + if (doing_unexpandedDescriptors) + fprintf(self->dumper.out, "\n"); } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } (void)err; /* TODO */ } static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* prefix) { - grib_dumper_bufr_encode_fortran *self = (grib_dumper_bufr_encode_fortran*)d; - long value=0; size_t size = 0; - long *values=NULL; - int err = 0; - int i,icount; - int cols=4; - long count=0; - char* pref = NULL; - grib_context* c=a->context; - - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + grib_dumper_bufr_encode_fortran* self = (grib_dumper_bufr_encode_fortran*)d; + long value = 0; + size_t size = 0; + long* values = NULL; + int err = 0; + int i, icount; + int cols = 4; + long count = 0; + char* pref = NULL; + grib_context* c = a->context; + + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; - if (size>1) { - values=(long*)grib_context_malloc_clear(a->context,sizeof(long)*size); - err=grib_unpack_long(a,values,&size); - } else { - err=grib_unpack_long(a,&value,&size); + if (size > 1) { + values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); + err = grib_unpack_long(a, values, &size); + } + else { + err = grib_unpack_long(a, &value, &size); } - self->empty=0; + self->empty = 0; /* Fortran standard specifies the maximum length of a free-form source line is 132 characters */ /* Break long prefix string into multiple lines to avoid compiler error */ pref = break_line(c, prefix); - if (size>1) { - fprintf(self->dumper.out," if(allocated(ivalues)) deallocate(ivalues)\n"); - fprintf(self->dumper.out," allocate(ivalues(%lu))\n", (unsigned long)size); + if (size > 1) { + fprintf(self->dumper.out, " if(allocated(ivalues)) deallocate(ivalues)\n"); + fprintf(self->dumper.out, " allocate(ivalues(%lu))\n", (unsigned long)size); - fprintf(self->dumper.out," ivalues=(/"); - icount=0; - for (i=0;icols || i==0) {fprintf(self->dumper.out," &\n ");icount=0;} - fprintf(self->dumper.out,"%ld, ",values[i]); + fprintf(self->dumper.out, " ivalues=(/"); + icount = 0; + for (i = 0; i < size - 1; i++) { + if (icount > cols || i == 0) { + fprintf(self->dumper.out, " &\n "); + icount = 0; + } + fprintf(self->dumper.out, "%ld, ", values[i]); icount++; } - if (icount>cols || i==0) {fprintf(self->dumper.out," &\n ");icount=0;} - fprintf(self->dumper.out,"%ld ",values[i]); - - depth-=2; - fprintf(self->dumper.out,"/)\n"); - grib_context_free(a->context,values); + if (icount > cols || i == 0) { + fprintf(self->dumper.out, " &\n "); + icount = 0; + } + fprintf(self->dumper.out, "%ld ", values[i]); - fprintf(self->dumper.out," call codes_set(ibufr,'%s->%s' &\n,ivalues)\n",pref,a->name); + depth -= 2; + fprintf(self->dumper.out, "/)\n"); + grib_context_free(a->context, values); - } else { - char* sval=lval_to_string(c,value); - fprintf(self->dumper.out," call codes_set(ibufr,'%s->%s'&\n,",pref,a->name); - fprintf(self->dumper.out,"%s)\n",sval); - grib_context_free(c,sval); + fprintf(self->dumper.out, " call codes_set(ibufr,'%s->%s' &\n,ivalues)\n", pref, a->name); + } + else { + char* sval = lval_to_string(c, value); + fprintf(self->dumper.out, " call codes_set(ibufr,'%s->%s'&\n,", pref, a->name); + fprintf(self->dumper.out, "%s)\n", sval); + grib_context_free(c, sval); } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix1; - prefix1=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+strlen(pref)+5)); - sprintf(prefix1,"%s->%s",pref,a->name); + prefix1 = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + strlen(pref) + 5)); + sprintf(prefix1, "%s->%s", pref, a->name); - dump_attributes(d,a,prefix1); + dump_attributes(d, a, prefix1); - grib_context_free(c,prefix1); - depth-=2; + grib_context_free(c, prefix1); + depth -= 2; } - grib_context_free(c,pref); + grib_context_free(c, pref); (void)err; /* TODO */ } @@ -554,180 +611,196 @@ static void dump_bits(grib_dumper* d, grib_accessor* a, const char* comment) static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_encode_fortran *self = (grib_dumper_bufr_encode_fortran*)d; - double value=0; size_t size = 1; + grib_dumper_bufr_encode_fortran* self = (grib_dumper_bufr_encode_fortran*)d; + double value = 0; + size_t size = 1; int r; char* sval; - grib_handle* h=grib_handle_of_accessor(a); - grib_context* c=h->context; + grib_handle* h = grib_handle_of_accessor(a); + grib_context* c = h->context; - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_unpack_double(a,&value,&size); - self->empty=0; + grib_unpack_double(a, &value, &size); + self->empty = 0; - r=compute_bufr_key_rank(h,self->keys,a->name); + r = compute_bufr_key_rank(h, self->keys, a->name); - sval=dval_to_string(c,value); - if (r!=0) - fprintf(self->dumper.out," call codes_set(ibufr,'#%d#%s',%s)\n",r,a->name,sval); + sval = dval_to_string(c, value); + if (r != 0) + fprintf(self->dumper.out, " call codes_set(ibufr,'#%d#%s',%s)\n", r, a->name, sval); else - fprintf(self->dumper.out," call codes_set(ibufr,'%s',%s)\n",a->name,sval); - grib_context_free(c,sval); + fprintf(self->dumper.out, " call codes_set(ibufr,'%s',%s)\n", a->name, sval); + grib_context_free(c, sval); - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } } static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_encode_fortran *self = (grib_dumper_bufr_encode_fortran*)d; - char **values; - size_t size = 0,i=0; - grib_context* c=a->context; - int err = 0; - long count=0; - int r = 0; - grib_handle* h=grib_handle_of_accessor(a); - - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + grib_dumper_bufr_encode_fortran* self = (grib_dumper_bufr_encode_fortran*)d; + char** values; + size_t size = 0, i = 0; + grib_context* c = a->context; + int err = 0; + long count = 0; + int r = 0; + grib_handle* h = grib_handle_of_accessor(a); + + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a,&count); - size=count; - if (size==1) { - dump_string(d,a,comment); + grib_value_count(a, &count); + size = count; + if (size == 1) { + dump_string(d, a, comment); return; } - fprintf(self->dumper.out," if(allocated(svalues)) deallocate(svalues)\n"); - fprintf(self->dumper.out," allocate(svalues(%lu))\n", (unsigned long)size); + fprintf(self->dumper.out, " if(allocated(svalues)) deallocate(svalues)\n"); + fprintf(self->dumper.out, " allocate(svalues(%lu))\n", (unsigned long)size); - fprintf(self->dumper.out," svalues=(/"); + fprintf(self->dumper.out, " svalues=(/"); - self->empty=0; + self->empty = 0; - values=(char**)grib_context_malloc_clear(c,size*sizeof(char*)); + values = (char**)grib_context_malloc_clear(c, size * sizeof(char*)); if (!values) { - grib_context_log(c,GRIB_LOG_FATAL,"unable to allocate %d bytes",(int)size); + grib_context_log(c, GRIB_LOG_FATAL, "unable to allocate %d bytes", (int)size); return; } - err = grib_unpack_string_array(a,values,&size); + err = grib_unpack_string_array(a, values, &size); - for (i=0;idumper.out," \"%s\", &\n",values[i]); + for (i = 0; i < size - 1; i++) { + fprintf(self->dumper.out, " \"%s\", &\n", values[i]); } - fprintf(self->dumper.out," \"%s\" /)\n",values[i]); + fprintf(self->dumper.out, " \"%s\" /)\n", values[i]); - if (self->isLeaf==0) { - if ((r=compute_bufr_key_rank(h,self->keys,a->name))!=0) - fprintf(self->dumper.out," call codes_set_string_array(ibufr,'#%d#%s',svalues)\n",r,a->name); + if (self->isLeaf == 0) { + if ((r = compute_bufr_key_rank(h, self->keys, a->name)) != 0) + fprintf(self->dumper.out, " call codes_set_string_array(ibufr,'#%d#%s',svalues)\n", r, a->name); else - fprintf(self->dumper.out," call codes_set_string_array(ibufr,'%s',svalues)\n",a->name); + fprintf(self->dumper.out, " call codes_set_string_array(ibufr,'%s',svalues)\n", a->name); } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } - grib_context_free(c,values); + grib_context_free(c, values); (void)err; /* TODO */ } static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_encode_fortran *self = (grib_dumper_bufr_encode_fortran*)d; - char *value=NULL; - char *p = NULL; - size_t size = 0; - grib_context* c=a->context; + grib_dumper_bufr_encode_fortran* self = (grib_dumper_bufr_encode_fortran*)d; + char* value = NULL; + char* p = NULL; + size_t size = 0; + grib_context* c = a->context; int r; - int err = _grib_get_string_length(a,&size); - grib_handle* h=grib_handle_of_accessor(a); + int err = _grib_get_string_length(a, &size); + grib_handle* h = grib_handle_of_accessor(a); const char* acc_name = a->name; - if (size==0) return; + if (size == 0) + return; - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { /* ECC-356: Solution for the special local section key 'keyMore' and its alias 'ident' */ int skip = 1; - if ( (a->flags & GRIB_ACCESSOR_FLAG_HIDDEN)!=0 ) { - if ( strcmp(a->name, "keyMore")==0 && grib_is_defined(h, "ls.ident") ) { - skip = 0; + if ((a->flags & GRIB_ACCESSOR_FLAG_HIDDEN) != 0) { + if (strcmp(a->name, "keyMore") == 0 && grib_is_defined(h, "ls.ident")) { + skip = 0; acc_name = "ident"; } } - if (skip) return; + if (skip) + return; } - value=(char*)grib_context_malloc_clear(c,size); + value = (char*)grib_context_malloc_clear(c, size); if (!value) { - grib_context_log(c,GRIB_LOG_FATAL,"unable to allocate %d bytes",(int)size); + grib_context_log(c, GRIB_LOG_FATAL, "unable to allocate %d bytes", (int)size); return; } - self->empty=0; + self->empty = 0; - err = grib_unpack_string(a,value,&size); - p=value; - r=compute_bufr_key_rank(h,self->keys,acc_name); - if (grib_is_missing_string(a,(unsigned char *)value,size)) { + err = grib_unpack_string(a, value, &size); + p = value; + r = compute_bufr_key_rank(h, self->keys, acc_name); + if (grib_is_missing_string(a, (unsigned char*)value, size)) { strcpy(value, ""); /* Empty string means MISSING string */ } - while(*p) { if(!isprint(*p)) *p = '.'; p++; } + while (*p) { + if (!isprint(*p)) + *p = '.'; + p++; + } - if (self->isLeaf==0) { - depth+=2; - if (r!=0) - fprintf(self->dumper.out," call codes_set(ibufr,'#%d#%s',",r,acc_name); + if (self->isLeaf == 0) { + depth += 2; + if (r != 0) + fprintf(self->dumper.out, " call codes_set(ibufr,'#%d#%s',", r, acc_name); else - fprintf(self->dumper.out," call codes_set(ibufr,'%s',",acc_name); + fprintf(self->dumper.out, " call codes_set(ibufr,'%s',", acc_name); } - fprintf(self->dumper.out,"\'%s\')\n",value); + fprintf(self->dumper.out, "\'%s\')\n", value); - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(acc_name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,acc_name); - } else prefix=(char*)acc_name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(acc_name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, acc_name); + } + else + prefix = (char*)acc_name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } - grib_context_free(c,value); + grib_context_free(c, value); (void)err; /* TODO */ } @@ -742,153 +815,160 @@ static void dump_label(grib_dumper* d, grib_accessor* a, const char* comment) static void _dump_long_array(grib_handle* h, FILE* f, const char* key, const char* print_key) { long* val; - size_t size=0,i; - int cols=9,icount=0; + size_t size = 0, i; + int cols = 9, icount = 0; - if (grib_get_size(h,key,&size)==GRIB_NOT_FOUND) return; - if (size==0) return; + if (grib_get_size(h, key, &size) == GRIB_NOT_FOUND) + return; + if (size == 0) + return; - fprintf(f," if(allocated(ivalues)) deallocate(ivalues)\n"); - fprintf(f," allocate(ivalues(%lu))\n", (unsigned long)size); + fprintf(f, " if(allocated(ivalues)) deallocate(ivalues)\n"); + fprintf(f, " allocate(ivalues(%lu))\n", (unsigned long)size); - fprintf(f," ivalues=(/ "); + fprintf(f, " ivalues=(/ "); - val=(long*)grib_context_malloc_clear(h->context,sizeof(long)*size); - grib_get_long_array(h,key,val,&size); - for (i=0;icols || i==0) {fprintf(f," &\n ");icount=0;} - fprintf(f,"%ld, ",val[i]); + val = (long*)grib_context_malloc_clear(h->context, sizeof(long) * size); + grib_get_long_array(h, key, val, &size); + for (i = 0; i < size - 1; i++) { + if (icount > cols || i == 0) { + fprintf(f, " &\n "); + icount = 0; + } + fprintf(f, "%ld, ", val[i]); icount++; } - if (icount>cols) {fprintf(f," &\n ");} - fprintf(f,"%ld /)\n",val[size-1]); + if (icount > cols) { + fprintf(f, " &\n "); + } + fprintf(f, "%ld /)\n", val[size - 1]); - grib_context_free(h->context,val); - fprintf(f," call codes_set(ibufr,'%s',ivalues)\n",print_key); + grib_context_free(h->context, val); + fprintf(f, " call codes_set(ibufr,'%s',ivalues)\n", print_key); } static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block) { - grib_dumper_bufr_encode_fortran *self = (grib_dumper_bufr_encode_fortran*)d; - if (!grib_inline_strcmp(a->name,"BUFR") || - !grib_inline_strcmp(a->name,"GRIB") || - !grib_inline_strcmp(a->name,"META") - ) { - grib_handle* h=grib_handle_of_accessor(a); - depth=2; - self->empty=1; - depth+=2; - _dump_long_array(h,self->dumper.out,"dataPresentIndicator","inputDataPresentIndicator"); - _dump_long_array(h,self->dumper.out,"delayedDescriptorReplicationFactor","inputDelayedDescriptorReplicationFactor"); - _dump_long_array(h,self->dumper.out,"shortDelayedDescriptorReplicationFactor","inputShortDelayedDescriptorReplicationFactor"); - _dump_long_array(h,self->dumper.out,"extendedDelayedDescriptorReplicationFactor","inputExtendedDelayedDescriptorReplicationFactor"); - _dump_long_array(h,self->dumper.out,"inputOverriddenReferenceValues","inputOverriddenReferenceValues"); - grib_dump_accessors_block(d,block); - depth-=2; - } else if (!grib_inline_strcmp(a->name,"groupNumber")) { - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) + grib_dumper_bufr_encode_fortran* self = (grib_dumper_bufr_encode_fortran*)d; + if (!grib_inline_strcmp(a->name, "BUFR") || + !grib_inline_strcmp(a->name, "GRIB") || + !grib_inline_strcmp(a->name, "META")) { + grib_handle* h = grib_handle_of_accessor(a); + depth = 2; + self->empty = 1; + depth += 2; + _dump_long_array(h, self->dumper.out, "dataPresentIndicator", "inputDataPresentIndicator"); + _dump_long_array(h, self->dumper.out, "delayedDescriptorReplicationFactor", "inputDelayedDescriptorReplicationFactor"); + _dump_long_array(h, self->dumper.out, "shortDelayedDescriptorReplicationFactor", "inputShortDelayedDescriptorReplicationFactor"); + _dump_long_array(h, self->dumper.out, "extendedDelayedDescriptorReplicationFactor", "inputExtendedDelayedDescriptorReplicationFactor"); + _dump_long_array(h, self->dumper.out, "inputOverriddenReferenceValues", "inputOverriddenReferenceValues"); + grib_dump_accessors_block(d, block); + depth -= 2; + } + else if (!grib_inline_strcmp(a->name, "groupNumber")) { + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - self->empty=1; - depth+=2; - grib_dump_accessors_block(d,block); - depth-=2; - } else { - grib_dump_accessors_block(d,block); + self->empty = 1; + depth += 2; + grib_dump_accessors_block(d, block); + depth -= 2; + } + else { + grib_dump_accessors_block(d, block); } } -static void dump_attributes(grib_dumper* d,grib_accessor* a, const char* prefix) +static void dump_attributes(grib_dumper* d, grib_accessor* a, const char* prefix) { - int i=0; - grib_dumper_bufr_encode_fortran *self = (grib_dumper_bufr_encode_fortran*)d; + int i = 0; + grib_dumper_bufr_encode_fortran* self = (grib_dumper_bufr_encode_fortran*)d; unsigned long flags; while (i < MAX_ACCESSOR_ATTRIBUTES && a->attributes[i]) { - self->isAttribute=1; - if ( (d->option_flags & GRIB_DUMP_FLAG_ALL_ATTRIBUTES ) == 0 - && (a->attributes[i]->flags & GRIB_ACCESSOR_FLAG_DUMP)== 0 ) - { + self->isAttribute = 1; + if ((d->option_flags & GRIB_DUMP_FLAG_ALL_ATTRIBUTES) == 0 && (a->attributes[i]->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) { i++; continue; } - self->isLeaf=a->attributes[i]->attributes[0]==NULL ? 1 : 0; - flags=a->attributes[i]->flags; + self->isLeaf = a->attributes[i]->attributes[0] == NULL ? 1 : 0; + flags = a->attributes[i]->flags; a->attributes[i]->flags |= GRIB_ACCESSOR_FLAG_DUMP; switch (grib_accessor_get_native_type(a->attributes[i])) { - case GRIB_TYPE_LONG: - dump_long_attribute(d,a->attributes[i],prefix); - break; - case GRIB_TYPE_DOUBLE: - dump_values_attribute(d,a->attributes[i],prefix); - break; - case GRIB_TYPE_STRING: - break; + case GRIB_TYPE_LONG: + dump_long_attribute(d, a->attributes[i], prefix); + break; + case GRIB_TYPE_DOUBLE: + dump_values_attribute(d, a->attributes[i], prefix); + break; + case GRIB_TYPE_STRING: + break; } - a->attributes[i]->flags=flags; + a->attributes[i]->flags = flags; i++; } - self->isLeaf=0; - self->isAttribute=0; + self->isLeaf = 0; + self->isAttribute = 0; } static void header(grib_dumper* d, grib_handle* h) { - grib_dumper_bufr_encode_fortran *self = (grib_dumper_bufr_encode_fortran*)d; - char sampleName[200]={0}; - long localSectionPresent,edition,bufrHeaderCentre,isSatellite; + grib_dumper_bufr_encode_fortran* self = (grib_dumper_bufr_encode_fortran*)d; + char sampleName[200] = { 0 }; + long localSectionPresent, edition, bufrHeaderCentre, isSatellite; - grib_get_long(h,"localSectionPresent",&localSectionPresent); - grib_get_long(h,"bufrHeaderCentre",&bufrHeaderCentre); - grib_get_long(h,"edition",&edition); + grib_get_long(h, "localSectionPresent", &localSectionPresent); + grib_get_long(h, "bufrHeaderCentre", &bufrHeaderCentre); + grib_get_long(h, "edition", &edition); - if (localSectionPresent && bufrHeaderCentre==98 ) { - grib_get_long(h,"isSatellite",&isSatellite); + if (localSectionPresent && bufrHeaderCentre == 98) { + grib_get_long(h, "isSatellite", &isSatellite); if (isSatellite) - sprintf(sampleName,"BUFR%ld_local_satellite",edition); + sprintf(sampleName, "BUFR%ld_local_satellite", edition); else - sprintf(sampleName,"BUFR%ld_local",edition); - } else { - sprintf(sampleName,"BUFR%ld",edition); + sprintf(sampleName, "BUFR%ld_local", edition); + } + else { + sprintf(sampleName, "BUFR%ld", edition); } - if (d->count<2) { - fprintf(self->dumper.out,"! This program was automatically generated with bufr_dump -Efortran\n"); - fprintf(self->dumper.out,"! Using ecCodes version: "); + if (d->count < 2) { + fprintf(self->dumper.out, "! This program was automatically generated with bufr_dump -Efortran\n"); + fprintf(self->dumper.out, "! Using ecCodes version: "); grib_print_api_version(self->dumper.out); fprintf(self->dumper.out, "\n\n"); - fprintf(self->dumper.out,"program bufr_encode\n"); - fprintf(self->dumper.out," use eccodes\n"); - fprintf(self->dumper.out," implicit none\n"); - fprintf(self->dumper.out," integer :: iret\n"); - fprintf(self->dumper.out," integer :: outfile\n"); - fprintf(self->dumper.out," integer :: ibufr\n"); - fprintf(self->dumper.out," integer(kind=4), dimension(:), allocatable :: ivalues\n"); - fprintf(self->dumper.out," integer, parameter :: max_strsize = 100\n"); - fprintf(self->dumper.out," character(len=max_strsize) , dimension(:),allocatable :: svalues\n"); - fprintf(self->dumper.out," real(kind=8), dimension(:), allocatable :: rvalues\n"); - } - fprintf(self->dumper.out," call codes_bufr_new_from_samples(ibufr,'%s',iret)\n",sampleName); - fprintf(self->dumper.out," if (iret/=CODES_SUCCESS) then\n"); - fprintf(self->dumper.out," print *,'ERROR creating BUFR from %s'\n",sampleName); - fprintf(self->dumper.out," stop 1\n"); - fprintf(self->dumper.out," endif\n"); + fprintf(self->dumper.out, "program bufr_encode\n"); + fprintf(self->dumper.out, " use eccodes\n"); + fprintf(self->dumper.out, " implicit none\n"); + fprintf(self->dumper.out, " integer :: iret\n"); + fprintf(self->dumper.out, " integer :: outfile\n"); + fprintf(self->dumper.out, " integer :: ibufr\n"); + fprintf(self->dumper.out, " integer(kind=4), dimension(:), allocatable :: ivalues\n"); + fprintf(self->dumper.out, " integer, parameter :: max_strsize = 100\n"); + fprintf(self->dumper.out, " character(len=max_strsize) , dimension(:),allocatable :: svalues\n"); + fprintf(self->dumper.out, " real(kind=8), dimension(:), allocatable :: rvalues\n"); + } + fprintf(self->dumper.out, " call codes_bufr_new_from_samples(ibufr,'%s',iret)\n", sampleName); + fprintf(self->dumper.out, " if (iret/=CODES_SUCCESS) then\n"); + fprintf(self->dumper.out, " print *,'ERROR creating BUFR from %s'\n", sampleName); + fprintf(self->dumper.out, " stop 1\n"); + fprintf(self->dumper.out, " endif\n"); } static void footer(grib_dumper* d, grib_handle* h) { - grib_dumper_bufr_encode_fortran *self = (grib_dumper_bufr_encode_fortran*)d; - fprintf(self->dumper.out,"\n ! Encode the keys back in the data section\n"); - fprintf(self->dumper.out," call codes_set(ibufr,'pack',1)\n\n"); - if (d->count==1) - fprintf(self->dumper.out," call codes_open_file(outfile,'outfile.bufr','w')\n"); + grib_dumper_bufr_encode_fortran* self = (grib_dumper_bufr_encode_fortran*)d; + fprintf(self->dumper.out, "\n ! Encode the keys back in the data section\n"); + fprintf(self->dumper.out, " call codes_set(ibufr,'pack',1)\n\n"); + if (d->count == 1) + fprintf(self->dumper.out, " call codes_open_file(outfile,'outfile.bufr','w')\n"); else - fprintf(self->dumper.out," call codes_open_file(outfile,'outfile.bufr','a')\n"); - - fprintf(self->dumper.out," call codes_write(ibufr,outfile)\n"); - fprintf(self->dumper.out," call codes_close_file(outfile)\n"); - fprintf(self->dumper.out," call codes_release(ibufr)\n"); - if (d->count==1) - fprintf(self->dumper.out," print *, \"Created output BUFR file 'outfile.bufr'\"\n"); - fprintf(self->dumper.out," if(allocated(ivalues)) deallocate(ivalues)\n"); - fprintf(self->dumper.out," if(allocated(rvalues)) deallocate(rvalues)\n"); - fprintf(self->dumper.out," if(allocated(svalues)) deallocate(svalues)\n"); + fprintf(self->dumper.out, " call codes_open_file(outfile,'outfile.bufr','a')\n"); + + fprintf(self->dumper.out, " call codes_write(ibufr,outfile)\n"); + fprintf(self->dumper.out, " call codes_close_file(outfile)\n"); + fprintf(self->dumper.out, " call codes_release(ibufr)\n"); + if (d->count == 1) + fprintf(self->dumper.out, " print *, \"Created output BUFR file 'outfile.bufr'\"\n"); + fprintf(self->dumper.out, " if(allocated(ivalues)) deallocate(ivalues)\n"); + fprintf(self->dumper.out, " if(allocated(rvalues)) deallocate(rvalues)\n"); + fprintf(self->dumper.out, " if(allocated(svalues)) deallocate(svalues)\n"); } diff --git a/src/grib_dumper_class_bufr_encode_python.c b/src/grib_dumper_class_bufr_encode_python.c index c9919c582..aa6ad4a80 100644 --- a/src/grib_dumper_class_bufr_encode_python.c +++ b/src/grib_dumper_class_bufr_encode_python.c @@ -42,272 +42,306 @@ or edit "dumper.class" and rerun ./make_class.pl */ -static void init_class (grib_dumper_class*); -static int init (grib_dumper* d); -static int destroy (grib_dumper*); -static void dump_long (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_bits (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_double (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_string (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_string_array (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_bytes (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_values (grib_dumper* d, grib_accessor* a); -static void dump_label (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_section (grib_dumper* d, grib_accessor* a,grib_block_of_accessors* block); -static void header (grib_dumper*,grib_handle*); -static void footer (grib_dumper*,grib_handle*); - -typedef struct grib_dumper_bufr_encode_python { - grib_dumper dumper; -/* Members defined in bufr_encode_python */ - long section_offset; - long empty; - long end; - long isLeaf; - long isAttribute; - grib_string_list* keys; +static void init_class(grib_dumper_class*); +static int init(grib_dumper* d); +static int destroy(grib_dumper*); +static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_bits(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_values(grib_dumper* d, grib_accessor* a); +static void dump_label(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block); +static void header(grib_dumper*, grib_handle*); +static void footer(grib_dumper*, grib_handle*); + +typedef struct grib_dumper_bufr_encode_python +{ + grib_dumper dumper; + /* Members defined in bufr_encode_python */ + long section_offset; + long empty; + long end; + long isLeaf; + long isAttribute; + grib_string_list* keys; } grib_dumper_bufr_encode_python; static grib_dumper_class _grib_dumper_class_bufr_encode_python = { - 0, /* super */ - "bufr_encode_python", /* name */ - sizeof(grib_dumper_bufr_encode_python), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - &destroy, /* free mem */ - &dump_long, /* dump long */ - &dump_double, /* dump double */ - &dump_string, /* dump string */ - &dump_string_array, /* dump string array */ - &dump_label, /* dump labels */ - &dump_bytes, /* dump bytes */ - &dump_bits, /* dump bits */ - &dump_section, /* dump section */ - &dump_values, /* dump values */ - &header, /* header */ - &footer, /* footer */ + 0, /* super */ + "bufr_encode_python", /* name */ + sizeof(grib_dumper_bufr_encode_python), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + &destroy, /* free mem */ + &dump_long, /* dump long */ + &dump_double, /* dump double */ + &dump_string, /* dump string */ + &dump_string_array, /* dump string array */ + &dump_label, /* dump labels */ + &dump_bytes, /* dump bytes */ + &dump_bits, /* dump bits */ + &dump_section, /* dump section */ + &dump_values, /* dump values */ + &header, /* header */ + &footer, /* footer */ }; grib_dumper_class* grib_dumper_class_bufr_encode_python = &_grib_dumper_class_bufr_encode_python; /* END_CLASS_IMP */ -static void dump_attributes(grib_dumper* d,grib_accessor* a, const char* prefix); +static void dump_attributes(grib_dumper* d, grib_accessor* a, const char* prefix); /* Note: A fast cut-down version of strcmp which does NOT return -1 */ /* 0 means input strings are equal and 1 means not equal */ GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b) { - if (*a != *b) return 1; - while((*a!=0 && *b!=0) && *(a) == *(b) ) {a++;b++;} - return (*a==0 && *b==0) ? 0 : 1; + if (*a != *b) + return 1; + while ((*a != 0 && *b != 0) && *(a) == *(b)) { + a++; + b++; + } + return (*a == 0 && *b == 0) ? 0 : 1; } typedef struct string_count string_count; -struct string_count { +struct string_count +{ char* value; int count; string_count* next; }; -static int depth=0; +static int depth = 0; -static void init_class (grib_dumper_class* c){} +static void init_class(grib_dumper_class* c) {} static int init(grib_dumper* d) { - grib_dumper_bufr_encode_python *self = (grib_dumper_bufr_encode_python*)d; - grib_context* c=d->handle->context; - self->section_offset=0; - self->empty=1; - d->count=1; - self->isLeaf=0; - self->isAttribute=0; - self->keys=(grib_string_list*)grib_context_malloc_clear(c,sizeof(grib_string_list)); + grib_dumper_bufr_encode_python* self = (grib_dumper_bufr_encode_python*)d; + grib_context* c = d->handle->context; + self->section_offset = 0; + self->empty = 1; + d->count = 1; + self->isLeaf = 0; + self->isAttribute = 0; + self->keys = (grib_string_list*)grib_context_malloc_clear(c, sizeof(grib_string_list)); return GRIB_SUCCESS; } static int destroy(grib_dumper* d) { - grib_dumper_bufr_encode_python *self = (grib_dumper_bufr_encode_python*)d; - grib_string_list* next=self->keys; - grib_string_list* cur=self->keys; - grib_context* c=d->handle->context; - while(next) { - cur=next; - next=next->next; - grib_context_free(c,cur->value); - grib_context_free(c,cur); + grib_dumper_bufr_encode_python* self = (grib_dumper_bufr_encode_python*)d; + grib_string_list* next = self->keys; + grib_string_list* cur = self->keys; + grib_context* c = d->handle->context; + while (next) { + cur = next; + next = next->next; + grib_context_free(c, cur->value); + grib_context_free(c, cur); } return GRIB_SUCCESS; } static char* lval_to_string(grib_context* c, long v) { - char* sval=(char*)grib_context_malloc_clear(c,sizeof(char)*40); - if (v == GRIB_MISSING_LONG) sprintf(sval,"CODES_MISSING_LONG"); - else sprintf(sval,"%ld",v); + char* sval = (char*)grib_context_malloc_clear(c, sizeof(char) * 40); + if (v == GRIB_MISSING_LONG) + sprintf(sval, "CODES_MISSING_LONG"); + else + sprintf(sval, "%ld", v); return sval; } -static char* dval_to_string(const grib_context* c,double v) +static char* dval_to_string(const grib_context* c, double v) { - char* sval=(char*)grib_context_malloc_clear(c,sizeof(char)*40); - if (v == GRIB_MISSING_DOUBLE) sprintf(sval,"CODES_MISSING_DOUBLE"); - else sprintf(sval,"%.18e",v); + char* sval = (char*)grib_context_malloc_clear(c, sizeof(char) * 40); + if (v == GRIB_MISSING_DOUBLE) + sprintf(sval, "CODES_MISSING_DOUBLE"); + else + sprintf(sval, "%.18e", v); return sval; } -static void dump_values(grib_dumper* d,grib_accessor* a) +static void dump_values(grib_dumper* d, grib_accessor* a) { - grib_dumper_bufr_encode_python *self = (grib_dumper_bufr_encode_python*)d; - double value=0; size_t size = 0; - double *values=NULL; - int err = 0; - int i,r,icount; - int cols=2; - long count=0; + grib_dumper_bufr_encode_python* self = (grib_dumper_bufr_encode_python*)d; + double value = 0; + size_t size = 0; + double* values = NULL; + int err = 0; + int i, r, icount; + int cols = 2; + long count = 0; char* sval; - grib_context* c=a->context; - grib_handle* h=grib_handle_of_accessor(a); + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) !=0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; - if (size>1) { - values=(double*)grib_context_malloc_clear(c,sizeof(double)*size); - err=grib_unpack_double(a,values,&size); - } else { - err=grib_unpack_double(a,&value,&size); + if (size > 1) { + values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); + err = grib_unpack_double(a, values, &size); + } + else { + err = grib_unpack_double(a, &value, &size); } - self->empty=0; + self->empty = 0; - if (size>1) { - fprintf(self->dumper.out," rvalues = ("); + if (size > 1) { + fprintf(self->dumper.out, " rvalues = ("); - icount=0; - for (i=0; icols || i==0) {fprintf(self->dumper.out,"\n ");icount=0;} - sval=dval_to_string(c,values[i]); - fprintf(self->dumper.out,"%s, ", sval); - grib_context_free(c,sval); + icount = 0; + for (i = 0; i < size - 1; ++i) { + if (icount > cols || i == 0) { + fprintf(self->dumper.out, "\n "); + icount = 0; + } + sval = dval_to_string(c, values[i]); + fprintf(self->dumper.out, "%s, ", sval); + grib_context_free(c, sval); icount++; } - if (icount>cols || i==0) {fprintf(self->dumper.out,"\n ");icount=0;} - sval=dval_to_string(c,values[i]); - fprintf(self->dumper.out,"%s", sval); - grib_context_free(c,sval); + if (icount > cols || i == 0) { + fprintf(self->dumper.out, "\n "); + icount = 0; + } + sval = dval_to_string(c, values[i]); + fprintf(self->dumper.out, "%s", sval); + grib_context_free(c, sval); - depth-=2; + depth -= 2; /* Note: In Python to make a tuple with one element, you need the trailing comma */ - if (size > 4) fprintf(self->dumper.out,",) # %lu values\n", (unsigned long)size); - else fprintf(self->dumper.out,",)\n"); - grib_context_free(c,values); + if (size > 4) + fprintf(self->dumper.out, ",) # %lu values\n", (unsigned long)size); + else + fprintf(self->dumper.out, ",)\n"); + grib_context_free(c, values); - if ((r=compute_bufr_key_rank(h,self->keys,a->name))!=0) - fprintf(self->dumper.out," codes_set_array(ibufr, '#%d#%s', rvalues)\n",r,a->name); + if ((r = compute_bufr_key_rank(h, self->keys, a->name)) != 0) + fprintf(self->dumper.out, " codes_set_array(ibufr, '#%d#%s', rvalues)\n", r, a->name); else - fprintf(self->dumper.out," codes_set_array(ibufr, '%s', rvalues)\n",a->name); - } else { - r=compute_bufr_key_rank(h,self->keys,a->name); - sval=dval_to_string(c,value); - if (r!=0) - fprintf(self->dumper.out," codes_set(ibufr, '#%d#%s', %s)\n",r,a->name,sval); + fprintf(self->dumper.out, " codes_set_array(ibufr, '%s', rvalues)\n", a->name); + } + else { + r = compute_bufr_key_rank(h, self->keys, a->name); + sval = dval_to_string(c, value); + if (r != 0) + fprintf(self->dumper.out, " codes_set(ibufr, '#%d#%s', %s)\n", r, a->name, sval); else - fprintf(self->dumper.out," codes_set(ibufr, '%s', %s)\n",a->name,sval); - grib_context_free(c,sval); + fprintf(self->dumper.out, " codes_set(ibufr, '%s', %s)\n", a->name, sval); + grib_context_free(c, sval); } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } (void)err; /* TODO */ } -static void dump_values_attribute(grib_dumper* d,grib_accessor* a, const char* prefix) +static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* prefix) { - grib_dumper_bufr_encode_python *self = (grib_dumper_bufr_encode_python*)d; - double value=0; size_t size = 0; - double *values=NULL; - int err = 0; - int i,icount; - int cols=2; - long count=0; + grib_dumper_bufr_encode_python* self = (grib_dumper_bufr_encode_python*)d; + double value = 0; + size_t size = 0; + double* values = NULL; + int err = 0; + int i, icount; + int cols = 2; + long count = 0; char* sval; - grib_context* c=a->context; + grib_context* c = a->context; - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) !=0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; - if (size>1) { - values=(double*)grib_context_malloc_clear(c,sizeof(double)*size); - err=grib_unpack_double(a,values,&size); - } else { - err=grib_unpack_double(a,&value,&size); + if (size > 1) { + values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); + err = grib_unpack_double(a, values, &size); + } + else { + err = grib_unpack_double(a, &value, &size); } - self->empty=0; - - if (size>1) { + self->empty = 0; - fprintf(self->dumper.out," rvalues = ("); + if (size > 1) { + fprintf(self->dumper.out, " rvalues = ("); - icount=0; - for (i=0; icols || i==0) {fprintf(self->dumper.out,"\n ");icount=0;} - sval=dval_to_string(c,values[i]); - fprintf(self->dumper.out,"%s, ", sval); - grib_context_free(c,sval); + icount = 0; + for (i = 0; i < size - 1; ++i) { + if (icount > cols || i == 0) { + fprintf(self->dumper.out, "\n "); + icount = 0; + } + sval = dval_to_string(c, values[i]); + fprintf(self->dumper.out, "%s, ", sval); + grib_context_free(c, sval); icount++; } - if (icount>cols || i==0) {fprintf(self->dumper.out,"\n ");icount=0;} - sval=dval_to_string(c,values[i]); - fprintf(self->dumper.out,"%s", sval); - grib_context_free(c,sval); + if (icount > cols || i == 0) { + fprintf(self->dumper.out, "\n "); + icount = 0; + } + sval = dval_to_string(c, values[i]); + fprintf(self->dumper.out, "%s", sval); + grib_context_free(c, sval); - depth-=2; + depth -= 2; /* Note: In python to make a tuple with one element, you need the trailing comma */ - if (size > 4) fprintf(self->dumper.out,",) # %lu values\n", (unsigned long)size); - else fprintf(self->dumper.out,",)\n"); - grib_context_free(c,values); + if (size > 4) + fprintf(self->dumper.out, ",) # %lu values\n", (unsigned long)size); + else + fprintf(self->dumper.out, ",)\n"); + grib_context_free(c, values); - fprintf(self->dumper.out," codes_set_array(ibufr, '%s->%s' \n, rvalues)\n",prefix,a->name); - } else { - sval=dval_to_string(c,value); - fprintf(self->dumper.out," codes_set(ibufr, '%s->%s' \n,%s)\n",prefix,a->name,sval); - grib_context_free(c,sval); + fprintf(self->dumper.out, " codes_set_array(ibufr, '%s->%s' \n, rvalues)\n", prefix, a->name); + } + else { + sval = dval_to_string(c, value); + fprintf(self->dumper.out, " codes_set(ibufr, '%s->%s' \n,%s)\n", prefix, a->name, sval); + grib_context_free(c, sval); } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix1; - prefix1=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+strlen(prefix)+5)); - sprintf(prefix1,"%s->%s",prefix,a->name); + prefix1 = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + strlen(prefix) + 5)); + sprintf(prefix1, "%s->%s", prefix, a->name); - dump_attributes(d,a,prefix1); + dump_attributes(d, a, prefix1); - grib_context_free(c,prefix1); - depth-=2; + grib_context_free(c, prefix1); + depth -= 2; } (void)err; /* TODO */ @@ -315,506 +349,563 @@ static void dump_values_attribute(grib_dumper* d,grib_accessor* a, const char* p static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_encode_python *self = (grib_dumper_bufr_encode_python*)d; - long value=0; size_t size = 0; - long *values=NULL; - int err = 0; - int i,r,icount; - int cols=4; - long count=0; - char* sval = NULL; - grib_context* c=a->context; - grib_handle* h=grib_handle_of_accessor(a); - int doing_unexpandedDescriptors=0; - - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 ) return; - - doing_unexpandedDescriptors = (strcmp(a->name, "unexpandedDescriptors")==0); - grib_value_count(a,&count); - size=count; - - if ( (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { - if (self->isLeaf==0) { + grib_dumper_bufr_encode_python* self = (grib_dumper_bufr_encode_python*)d; + long value = 0; + size_t size = 0; + long* values = NULL; + int err = 0; + int i, r, icount; + int cols = 4; + long count = 0; + char* sval = NULL; + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); + int doing_unexpandedDescriptors = 0; + + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) + return; + + doing_unexpandedDescriptors = (strcmp(a->name, "unexpandedDescriptors") == 0); + grib_value_count(a, &count); + size = count; + + if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; - - r=compute_bufr_key_rank(h,self->keys,a->name); - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; - - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + int dofree = 0; + + r = compute_bufr_key_rank(h, self->keys, a->name); + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; + + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } return; } - if (size>1) { - values=(long*)grib_context_malloc_clear(a->context,sizeof(long)*size); - err=grib_unpack_long(a,values,&size); - } else { - err=grib_unpack_long(a,&value,&size); + if (size > 1) { + values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); + err = grib_unpack_long(a, values, &size); + } + else { + err = grib_unpack_long(a, &value, &size); } - self->empty=0; + self->empty = 0; - if (size>1) { - fprintf(self->dumper.out," ivalues = ("); - icount=0; - for (i=0;icols || i==0) {fprintf(self->dumper.out,"\n ");icount=0;} - fprintf(self->dumper.out,"%ld, ",values[i]); + if (size > 1) { + fprintf(self->dumper.out, " ivalues = ("); + icount = 0; + for (i = 0; i < size - 1; i++) { + if (icount > cols || i == 0) { + fprintf(self->dumper.out, "\n "); + icount = 0; + } + fprintf(self->dumper.out, "%ld, ", values[i]); icount++; } - if (icount>cols || i==0) {fprintf(self->dumper.out,"\n ");icount=0;} - fprintf(self->dumper.out,"%ld",values[i]); + if (icount > cols || i == 0) { + fprintf(self->dumper.out, "\n "); + icount = 0; + } + fprintf(self->dumper.out, "%ld", values[i]); - depth-=2; + depth -= 2; /* Note: In python to make a tuple with one element, you need the trailing comma */ - if (size > 4) fprintf(self->dumper.out,",) # %lu values\n", (unsigned long)size); - else fprintf(self->dumper.out,",)\n"); - grib_context_free(a->context,values); + if (size > 4) + fprintf(self->dumper.out, ",) # %lu values\n", (unsigned long)size); + else + fprintf(self->dumper.out, ",)\n"); + grib_context_free(a->context, values); - if ((r=compute_bufr_key_rank(h,self->keys,a->name))!=0) { - fprintf(self->dumper.out," codes_set_array(ibufr, '#%d#%s', ivalues)\n",r,a->name); - } else { + if ((r = compute_bufr_key_rank(h, self->keys, a->name)) != 0) { + fprintf(self->dumper.out, " codes_set_array(ibufr, '#%d#%s', ivalues)\n", r, a->name); + } + else { if (doing_unexpandedDescriptors) { - fprintf(self->dumper.out,"\n # Create the structure of the data section\n"); + fprintf(self->dumper.out, "\n # Create the structure of the data section\n"); /* fprintf(self->dumper.out," codes_set(ibufr, 'skipExtraKeyAttributes', 1)\n"); */ } - fprintf(self->dumper.out," codes_set_array(ibufr, '%s', ivalues)\n",a->name); - if (doing_unexpandedDescriptors) fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out, " codes_set_array(ibufr, '%s', ivalues)\n", a->name); + if (doing_unexpandedDescriptors) + fprintf(self->dumper.out, "\n"); + } + } + else { + r = compute_bufr_key_rank(h, self->keys, a->name); + sval = lval_to_string(c, value); + if (r != 0) { + fprintf(self->dumper.out, " codes_set(ibufr, '#%d#%s', ", r, a->name); } - } else { - r=compute_bufr_key_rank(h,self->keys,a->name); - sval=lval_to_string(c,value); - if (r!=0) { - fprintf(self->dumper.out," codes_set(ibufr, '#%d#%s', ",r,a->name); - } else { + else { if (doing_unexpandedDescriptors) { - fprintf(self->dumper.out,"\n # Create the structure of the data section\n"); + fprintf(self->dumper.out, "\n # Create the structure of the data section\n"); /* fprintf(self->dumper.out," codes_set(ibufr, 'skipExtraKeyAttributes', 1)\n"); */ } - fprintf(self->dumper.out," codes_set(ibufr, '%s', ",a->name); + fprintf(self->dumper.out, " codes_set(ibufr, '%s', ", a->name); } - fprintf(self->dumper.out,"%s)\n",sval); - grib_context_free(c,sval); - if (doing_unexpandedDescriptors) fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out, "%s)\n", sval); + grib_context_free(c, sval); + if (doing_unexpandedDescriptors) + fprintf(self->dumper.out, "\n"); } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } (void)err; /* TODO */ } static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* prefix) { - grib_dumper_bufr_encode_python *self = (grib_dumper_bufr_encode_python*)d; - long value=0; size_t size = 0; - long *values=NULL; - int err = 0; - int i,icount; - int cols=4; - long count=0; - grib_context* c=a->context; - - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + grib_dumper_bufr_encode_python* self = (grib_dumper_bufr_encode_python*)d; + long value = 0; + size_t size = 0; + long* values = NULL; + int err = 0; + int i, icount; + int cols = 4; + long count = 0; + grib_context* c = a->context; + + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; - if (size>1) { - values=(long*)grib_context_malloc_clear(a->context,sizeof(long)*size); - err=grib_unpack_long(a,values,&size); - } else { - err=grib_unpack_long(a,&value,&size); + if (size > 1) { + values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); + err = grib_unpack_long(a, values, &size); + } + else { + err = grib_unpack_long(a, &value, &size); } - self->empty=0; + self->empty = 0; - if (size>1) { - fprintf(self->dumper.out," ivalues = ("); - icount=0; - for (i=0;icols || i==0) {fprintf(self->dumper.out," \n ");icount=0;} - fprintf(self->dumper.out,"%ld, ",values[i]); + if (size > 1) { + fprintf(self->dumper.out, " ivalues = ("); + icount = 0; + for (i = 0; i < size - 1; i++) { + if (icount > cols || i == 0) { + fprintf(self->dumper.out, " \n "); + icount = 0; + } + fprintf(self->dumper.out, "%ld, ", values[i]); icount++; } - if (icount>cols || i==0) {fprintf(self->dumper.out," \n ");icount=0;} - fprintf(self->dumper.out,"%ld ",values[i]); + if (icount > cols || i == 0) { + fprintf(self->dumper.out, " \n "); + icount = 0; + } + fprintf(self->dumper.out, "%ld ", values[i]); - depth-=2; + depth -= 2; /* Note: In python to make a tuple with one element, you need the trailing comma */ - if (size > 4) fprintf(self->dumper.out,",) # %lu values\n", (unsigned long)size); - else fprintf(self->dumper.out,",)\n"); - grib_context_free(a->context,values); - - fprintf(self->dumper.out," codes_set_array(ibufr, '%s->%s', ivalues)\n",prefix,a->name); + if (size > 4) + fprintf(self->dumper.out, ",) # %lu values\n", (unsigned long)size); + else + fprintf(self->dumper.out, ",)\n"); + grib_context_free(a->context, values); - } else { - char* sval=lval_to_string(c,value); - fprintf(self->dumper.out," codes_set(ibufr, '%s->%s', ",prefix,a->name); - fprintf(self->dumper.out,"%s)\n",sval); - grib_context_free(c,sval); + fprintf(self->dumper.out, " codes_set_array(ibufr, '%s->%s', ivalues)\n", prefix, a->name); + } + else { + char* sval = lval_to_string(c, value); + fprintf(self->dumper.out, " codes_set(ibufr, '%s->%s', ", prefix, a->name); + fprintf(self->dumper.out, "%s)\n", sval); + grib_context_free(c, sval); } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix1; - prefix1=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+strlen(prefix)+5)); - sprintf(prefix1,"%s->%s",prefix,a->name); + prefix1 = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + strlen(prefix) + 5)); + sprintf(prefix1, "%s->%s", prefix, a->name); - dump_attributes(d,a,prefix1); + dump_attributes(d, a, prefix1); - grib_context_free(c,prefix1); - depth-=2; + grib_context_free(c, prefix1); + depth -= 2; } (void)err; /* TODO */ } -static void dump_bits(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_bits(grib_dumper* d, grib_accessor* a, const char* comment) { } -static void dump_double(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_encode_python *self = (grib_dumper_bufr_encode_python*)d; - double value; size_t size = 1; + grib_dumper_bufr_encode_python* self = (grib_dumper_bufr_encode_python*)d; + double value; + size_t size = 1; int r; char* sval; - grib_handle* h=grib_handle_of_accessor(a); - grib_context* c=h->context; + grib_handle* h = grib_handle_of_accessor(a); + grib_context* c = h->context; - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0 ) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_unpack_double(a,&value,&size); - self->empty=0; + grib_unpack_double(a, &value, &size); + self->empty = 0; - r=compute_bufr_key_rank(h,self->keys,a->name); + r = compute_bufr_key_rank(h, self->keys, a->name); - sval=dval_to_string(c,value); - if (r!=0) - fprintf(self->dumper.out," codes_set(ibufr, '#%d#%s', %s)\n",r,a->name,sval); + sval = dval_to_string(c, value); + if (r != 0) + fprintf(self->dumper.out, " codes_set(ibufr, '#%d#%s', %s)\n", r, a->name, sval); else - fprintf(self->dumper.out," codes_set(ibufr, '%s', %s)\n",a->name,sval); - grib_context_free(c,sval); + fprintf(self->dumper.out, " codes_set(ibufr, '%s', %s)\n", a->name, sval); + grib_context_free(c, sval); - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } } -static void dump_string_array(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_encode_python *self = (grib_dumper_bufr_encode_python*)d; - char **values; - size_t size = 0,i=0; - grib_context* c=a->context; - int err = 0; - long count=0; - int r=0; - grib_handle* h=grib_handle_of_accessor(a); - - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0 ) + grib_dumper_bufr_encode_python* self = (grib_dumper_bufr_encode_python*)d; + char** values; + size_t size = 0, i = 0; + grib_context* c = a->context; + int err = 0; + long count = 0; + int r = 0; + grib_handle* h = grib_handle_of_accessor(a); + + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a,&count); - size=count; - if (size==1) { - dump_string(d,a,comment); + grib_value_count(a, &count); + size = count; + if (size == 1) { + dump_string(d, a, comment); return; } - fprintf(self->dumper.out," svalues = ("); + fprintf(self->dumper.out, " svalues = ("); - self->empty=0; + self->empty = 0; - values=(char**)grib_context_malloc_clear(c,size*sizeof(char*)); + values = (char**)grib_context_malloc_clear(c, size * sizeof(char*)); if (!values) { - grib_context_log(c,GRIB_LOG_FATAL,"unable to allocate %d bytes",(int)size); + grib_context_log(c, GRIB_LOG_FATAL, "unable to allocate %d bytes", (int)size); return; } - err = grib_unpack_string_array(a,values,&size); + err = grib_unpack_string_array(a, values, &size); - for (i=0;idumper.out," \"%s\", \n",values[i]); + for (i = 0; i < size - 1; i++) { + fprintf(self->dumper.out, " \"%s\", \n", values[i]); } - fprintf(self->dumper.out," \"%s\", )\n",values[i]); + fprintf(self->dumper.out, " \"%s\", )\n", values[i]); - if (self->isLeaf==0) { - if ((r=compute_bufr_key_rank(h,self->keys,a->name))!=0) - fprintf(self->dumper.out," codes_set_array(ibufr, '#%d#%s', svalues)\n",r,a->name); + if (self->isLeaf == 0) { + if ((r = compute_bufr_key_rank(h, self->keys, a->name)) != 0) + fprintf(self->dumper.out, " codes_set_array(ibufr, '#%d#%s', svalues)\n", r, a->name); else - fprintf(self->dumper.out," codes_set_array(ibufr, '%s', svalues)\n",a->name); + fprintf(self->dumper.out, " codes_set_array(ibufr, '%s', svalues)\n", a->name); } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } - grib_context_free(c,values); + grib_context_free(c, values); (void)err; /* TODO */ } -static void dump_string(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_encode_python *self = (grib_dumper_bufr_encode_python*)d; - char *value=NULL; - char *p = NULL; - size_t size = 0; - grib_context* c=a->context; + grib_dumper_bufr_encode_python* self = (grib_dumper_bufr_encode_python*)d; + char* value = NULL; + char* p = NULL; + size_t size = 0; + grib_context* c = a->context; int r; - int err = _grib_get_string_length(a,&size); - grib_handle* h=grib_handle_of_accessor(a); + int err = _grib_get_string_length(a, &size); + grib_handle* h = grib_handle_of_accessor(a); const char* acc_name = a->name; - if (size==0) return; + if (size == 0) + return; - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { /* ECC-356: Solution for the special local section key 'keyMore' and its alias 'ident' */ int skip = 1; - if ( (a->flags & GRIB_ACCESSOR_FLAG_HIDDEN)!=0 ) { - if ( strcmp(acc_name, "keyMore")==0 && grib_is_defined(h, "ls.ident") ) { - skip = 0; + if ((a->flags & GRIB_ACCESSOR_FLAG_HIDDEN) != 0) { + if (strcmp(acc_name, "keyMore") == 0 && grib_is_defined(h, "ls.ident")) { + skip = 0; acc_name = "ident"; } } - if (skip) return; + if (skip) + return; } - value=(char*)grib_context_malloc_clear(c,size); + value = (char*)grib_context_malloc_clear(c, size); if (!value) { - grib_context_log(c,GRIB_LOG_FATAL,"unable to allocate %d bytes",(int)size); + grib_context_log(c, GRIB_LOG_FATAL, "unable to allocate %d bytes", (int)size); return; } - self->empty=0; + self->empty = 0; - err = grib_unpack_string(a,value,&size); - p=value; - r=compute_bufr_key_rank(h,self->keys,acc_name); - if (grib_is_missing_string(a,(unsigned char *)value,size)) { + err = grib_unpack_string(a, value, &size); + p = value; + r = compute_bufr_key_rank(h, self->keys, acc_name); + if (grib_is_missing_string(a, (unsigned char*)value, size)) { strcpy(value, ""); /* Empty string means MISSING string */ } - while(*p) { if(!isprint(*p)) *p = '.'; p++; } + while (*p) { + if (!isprint(*p)) + *p = '.'; + p++; + } - if (self->isLeaf==0) { - depth+=2; - if (r!=0) - fprintf(self->dumper.out," codes_set(ibufr, '#%d#%s',",r,acc_name); + if (self->isLeaf == 0) { + depth += 2; + if (r != 0) + fprintf(self->dumper.out, " codes_set(ibufr, '#%d#%s',", r, acc_name); else - fprintf(self->dumper.out," codes_set(ibufr, '%s',",acc_name); + fprintf(self->dumper.out, " codes_set(ibufr, '%s',", acc_name); } - fprintf(self->dumper.out,"\'%s\')\n",value); + fprintf(self->dumper.out, "\'%s\')\n", value); - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(acc_name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,acc_name); - } else prefix=(char*)acc_name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(acc_name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, acc_name); + } + else + prefix = (char*)acc_name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); - depth-=2; + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); + depth -= 2; } - grib_context_free(c,value); + grib_context_free(c, value); (void)err; /* TODO */ } -static void dump_bytes(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment) { } -static void dump_label(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_label(grib_dumper* d, grib_accessor* a, const char* comment) { } static void _dump_long_array(grib_handle* h, FILE* f, const char* key, const char* print_key) { long* val; - size_t size=0,i; - int cols=9,icount=0; + size_t size = 0, i; + int cols = 9, icount = 0; - if (grib_get_size(h,key,&size)==GRIB_NOT_FOUND) return; - if (size==0) return; + if (grib_get_size(h, key, &size) == GRIB_NOT_FOUND) + return; + if (size == 0) + return; - fprintf(f," ivalues = ("); + fprintf(f, " ivalues = ("); - val=(long*)grib_context_malloc_clear(h->context,sizeof(long)*size); - grib_get_long_array(h,key,val,&size); - for (i=0;icols || i==0) {fprintf(f," \n ");icount=0;} - fprintf(f,"%ld, ",val[i]); + val = (long*)grib_context_malloc_clear(h->context, sizeof(long) * size); + grib_get_long_array(h, key, val, &size); + for (i = 0; i < size - 1; i++) { + if (icount > cols || i == 0) { + fprintf(f, " \n "); + icount = 0; + } + fprintf(f, "%ld, ", val[i]); icount++; } - if (icount>cols) {fprintf(f," \n ");} + if (icount > cols) { + fprintf(f, " \n "); + } /* Note: In python to make a tuple with one element, you need the trailing comma */ - if (size > 4) fprintf(f,"%ld ,) # %lu values\n",val[size-1], (unsigned long)size); - else fprintf(f,"%ld ,)\n",val[size-1]); + if (size > 4) + fprintf(f, "%ld ,) # %lu values\n", val[size - 1], (unsigned long)size); + else + fprintf(f, "%ld ,)\n", val[size - 1]); - grib_context_free(h->context,val); - fprintf(f," codes_set_array(ibufr, '%s', ivalues)\n",print_key); + grib_context_free(h->context, val); + fprintf(f, " codes_set_array(ibufr, '%s', ivalues)\n", print_key); } static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block) { - grib_dumper_bufr_encode_python *self = (grib_dumper_bufr_encode_python*)d; - if (!grib_inline_strcmp(a->name,"BUFR") || - !grib_inline_strcmp(a->name,"GRIB") || - !grib_inline_strcmp(a->name,"META") - ) { - grib_handle* h=grib_handle_of_accessor(a); - depth=2; - self->empty=1; - depth+=2; - _dump_long_array(h,self->dumper.out,"dataPresentIndicator","inputDataPresentIndicator"); - _dump_long_array(h,self->dumper.out,"delayedDescriptorReplicationFactor","inputDelayedDescriptorReplicationFactor"); - _dump_long_array(h,self->dumper.out,"shortDelayedDescriptorReplicationFactor","inputShortDelayedDescriptorReplicationFactor"); - _dump_long_array(h,self->dumper.out,"extendedDelayedDescriptorReplicationFactor","inputExtendedDelayedDescriptorReplicationFactor"); - _dump_long_array(h,self->dumper.out,"inputOverriddenReferenceValues","inputOverriddenReferenceValues"); - grib_dump_accessors_block(d,block); - depth-=2; - } else if (!grib_inline_strcmp(a->name,"groupNumber")) { - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) + grib_dumper_bufr_encode_python* self = (grib_dumper_bufr_encode_python*)d; + if (!grib_inline_strcmp(a->name, "BUFR") || + !grib_inline_strcmp(a->name, "GRIB") || + !grib_inline_strcmp(a->name, "META")) { + grib_handle* h = grib_handle_of_accessor(a); + depth = 2; + self->empty = 1; + depth += 2; + _dump_long_array(h, self->dumper.out, "dataPresentIndicator", "inputDataPresentIndicator"); + _dump_long_array(h, self->dumper.out, "delayedDescriptorReplicationFactor", "inputDelayedDescriptorReplicationFactor"); + _dump_long_array(h, self->dumper.out, "shortDelayedDescriptorReplicationFactor", "inputShortDelayedDescriptorReplicationFactor"); + _dump_long_array(h, self->dumper.out, "extendedDelayedDescriptorReplicationFactor", "inputExtendedDelayedDescriptorReplicationFactor"); + _dump_long_array(h, self->dumper.out, "inputOverriddenReferenceValues", "inputOverriddenReferenceValues"); + grib_dump_accessors_block(d, block); + depth -= 2; + } + else if (!grib_inline_strcmp(a->name, "groupNumber")) { + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - self->empty=1; - depth+=2; - grib_dump_accessors_block(d,block); - depth-=2; - } else { - grib_dump_accessors_block(d,block); + self->empty = 1; + depth += 2; + grib_dump_accessors_block(d, block); + depth -= 2; + } + else { + grib_dump_accessors_block(d, block); } } -static void dump_attributes(grib_dumper* d,grib_accessor* a, const char* prefix) +static void dump_attributes(grib_dumper* d, grib_accessor* a, const char* prefix) { - int i=0; - grib_dumper_bufr_encode_python *self = (grib_dumper_bufr_encode_python*)d; + int i = 0; + grib_dumper_bufr_encode_python* self = (grib_dumper_bufr_encode_python*)d; unsigned long flags; while (i < MAX_ACCESSOR_ATTRIBUTES && a->attributes[i]) { - self->isAttribute=1; - if ( (d->option_flags & GRIB_DUMP_FLAG_ALL_ATTRIBUTES ) == 0 - && (a->attributes[i]->flags & GRIB_ACCESSOR_FLAG_DUMP)== 0 ) - { + self->isAttribute = 1; + if ((d->option_flags & GRIB_DUMP_FLAG_ALL_ATTRIBUTES) == 0 && (a->attributes[i]->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) { i++; continue; } - self->isLeaf=a->attributes[i]->attributes[0]==NULL ? 1 : 0; - flags=a->attributes[i]->flags; + self->isLeaf = a->attributes[i]->attributes[0] == NULL ? 1 : 0; + flags = a->attributes[i]->flags; a->attributes[i]->flags |= GRIB_ACCESSOR_FLAG_DUMP; switch (grib_accessor_get_native_type(a->attributes[i])) { - case GRIB_TYPE_LONG: - dump_long_attribute(d,a->attributes[i],prefix); - break; - case GRIB_TYPE_DOUBLE: - dump_values_attribute(d,a->attributes[i],prefix); - break; - case GRIB_TYPE_STRING: - break; + case GRIB_TYPE_LONG: + dump_long_attribute(d, a->attributes[i], prefix); + break; + case GRIB_TYPE_DOUBLE: + dump_values_attribute(d, a->attributes[i], prefix); + break; + case GRIB_TYPE_STRING: + break; } - a->attributes[i]->flags=flags; + a->attributes[i]->flags = flags; i++; } - self->isLeaf=0; - self->isAttribute=0; + self->isLeaf = 0; + self->isAttribute = 0; } static void header(grib_dumper* d, grib_handle* h) { - grib_dumper_bufr_encode_python *self = (grib_dumper_bufr_encode_python*)d; - char sampleName[200]={0}; - long localSectionPresent,edition,bufrHeaderCentre,isSatellite; + grib_dumper_bufr_encode_python* self = (grib_dumper_bufr_encode_python*)d; + char sampleName[200] = { 0 }; + long localSectionPresent, edition, bufrHeaderCentre, isSatellite; - grib_get_long(h,"localSectionPresent",&localSectionPresent); - grib_get_long(h,"bufrHeaderCentre",&bufrHeaderCentre); - grib_get_long(h,"edition",&edition); + grib_get_long(h, "localSectionPresent", &localSectionPresent); + grib_get_long(h, "bufrHeaderCentre", &bufrHeaderCentre); + grib_get_long(h, "edition", &edition); - if (localSectionPresent && bufrHeaderCentre==98 ) { - grib_get_long(h,"isSatellite",&isSatellite); + if (localSectionPresent && bufrHeaderCentre == 98) { + grib_get_long(h, "isSatellite", &isSatellite); if (isSatellite) - sprintf(sampleName,"BUFR%ld_local_satellite",edition); + sprintf(sampleName, "BUFR%ld_local_satellite", edition); else - sprintf(sampleName,"BUFR%ld_local",edition); - } else { - sprintf(sampleName,"BUFR%ld",edition); + sprintf(sampleName, "BUFR%ld_local", edition); + } + else { + sprintf(sampleName, "BUFR%ld", edition); } - if (d->count<2) { + if (d->count < 2) { /* This is the first message being processed */ fprintf(self->dumper.out, "# This program was automatically generated with bufr_dump -Epython\n"); fprintf(self->dumper.out, "# Using ecCodes version: "); grib_print_api_version(self->dumper.out); fprintf(self->dumper.out, "\n\n"); - fprintf(self->dumper.out,"from __future__ import print_function\n"); - fprintf(self->dumper.out,"import traceback\n"); - fprintf(self->dumper.out,"import sys\n"); - fprintf(self->dumper.out,"from eccodes import *\n\n\n"); - fprintf(self->dumper.out,"def bufr_encode():\n"); + fprintf(self->dumper.out, "from __future__ import print_function\n"); + fprintf(self->dumper.out, "import traceback\n"); + fprintf(self->dumper.out, "import sys\n"); + fprintf(self->dumper.out, "from eccodes import *\n\n\n"); + fprintf(self->dumper.out, "def bufr_encode():\n"); } - fprintf(self->dumper.out," ibufr = codes_bufr_new_from_samples('%s')\n",sampleName); + fprintf(self->dumper.out, " ibufr = codes_bufr_new_from_samples('%s')\n", sampleName); } static void footer(grib_dumper* d, grib_handle* h) { - grib_dumper_bufr_encode_python *self = (grib_dumper_bufr_encode_python*)d; - fprintf(self->dumper.out,"\n # Encode the keys back in the data section\n"); - fprintf(self->dumper.out," codes_set(ibufr, 'pack', 1)\n\n"); - if (d->count==1) - fprintf(self->dumper.out," outfile = open('outfile.bufr', 'wb')\n"); + grib_dumper_bufr_encode_python* self = (grib_dumper_bufr_encode_python*)d; + fprintf(self->dumper.out, "\n # Encode the keys back in the data section\n"); + fprintf(self->dumper.out, " codes_set(ibufr, 'pack', 1)\n\n"); + if (d->count == 1) + fprintf(self->dumper.out, " outfile = open('outfile.bufr', 'wb')\n"); else - fprintf(self->dumper.out," outfile = open('outfile.bufr', 'ab')\n"); + fprintf(self->dumper.out, " outfile = open('outfile.bufr', 'ab')\n"); - fprintf(self->dumper.out," codes_write(ibufr, outfile)\n"); - if (d->count==1) - fprintf(self->dumper.out," print (\"Created output BUFR file 'outfile.bufr'\")\n"); + fprintf(self->dumper.out, " codes_write(ibufr, outfile)\n"); + if (d->count == 1) + fprintf(self->dumper.out, " print (\"Created output BUFR file 'outfile.bufr'\")\n"); /*fprintf(self->dumper.out," codes_close_file(outfile)\n");*/ - fprintf(self->dumper.out," codes_release(ibufr)\n"); + fprintf(self->dumper.out, " codes_release(ibufr)\n"); } diff --git a/src/grib_dumper_class_bufr_simple.c b/src/grib_dumper_class_bufr_simple.c index 702429b0d..97e043e23 100644 --- a/src/grib_dumper_class_bufr_simple.c +++ b/src/grib_dumper_class_bufr_simple.c @@ -43,242 +43,271 @@ or edit "dumper.class" and rerun ./make_class.pl */ -static void init_class (grib_dumper_class*); -static int init (grib_dumper* d); -static int destroy (grib_dumper*); -static void dump_long (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_bits (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_double (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_string (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_string_array (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_bytes (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_values (grib_dumper* d, grib_accessor* a); -static void dump_label (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_section (grib_dumper* d, grib_accessor* a,grib_block_of_accessors* block); - -typedef struct grib_dumper_bufr_simple { - grib_dumper dumper; -/* Members defined in bufr_simple */ - long section_offset; - long begin; - long empty; - long end; - long isLeaf; - long isAttribute; - long numberOfSubsets; - grib_string_list* keys; +static void init_class(grib_dumper_class*); +static int init(grib_dumper* d); +static int destroy(grib_dumper*); +static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_bits(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_values(grib_dumper* d, grib_accessor* a); +static void dump_label(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block); + +typedef struct grib_dumper_bufr_simple +{ + grib_dumper dumper; + /* Members defined in bufr_simple */ + long section_offset; + long begin; + long empty; + long end; + long isLeaf; + long isAttribute; + long numberOfSubsets; + grib_string_list* keys; } grib_dumper_bufr_simple; static grib_dumper_class _grib_dumper_class_bufr_simple = { - 0, /* super */ - "bufr_simple", /* name */ - sizeof(grib_dumper_bufr_simple), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - &destroy, /* free mem */ - &dump_long, /* dump long */ - &dump_double, /* dump double */ - &dump_string, /* dump string */ - &dump_string_array, /* dump string array */ - &dump_label, /* dump labels */ - &dump_bytes, /* dump bytes */ - &dump_bits, /* dump bits */ - &dump_section, /* dump section */ - &dump_values, /* dump values */ - 0, /* header */ - 0, /* footer */ + 0, /* super */ + "bufr_simple", /* name */ + sizeof(grib_dumper_bufr_simple), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + &destroy, /* free mem */ + &dump_long, /* dump long */ + &dump_double, /* dump double */ + &dump_string, /* dump string */ + &dump_string_array, /* dump string array */ + &dump_label, /* dump labels */ + &dump_bytes, /* dump bytes */ + &dump_bits, /* dump bits */ + &dump_section, /* dump section */ + &dump_values, /* dump values */ + 0, /* header */ + 0, /* footer */ }; grib_dumper_class* grib_dumper_class_bufr_simple = &_grib_dumper_class_bufr_simple; /* END_CLASS_IMP */ -static void dump_attributes(grib_dumper* d,grib_accessor* a, const char* prefix); +static void dump_attributes(grib_dumper* d, grib_accessor* a, const char* prefix); /* Note: A fast cut-down version of strcmp which does NOT return -1 */ /* 0 means input strings are equal and 1 means not equal */ GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b) { - if (*a != *b) return 1; - while((*a!=0 && *b!=0) && *(a) == *(b) ) {a++;b++;} - return (*a==0 && *b==0) ? 0 : 1; + if (*a != *b) + return 1; + while ((*a != 0 && *b != 0) && *(a) == *(b)) { + a++; + b++; + } + return (*a == 0 && *b == 0) ? 0 : 1; } typedef struct string_count string_count; -struct string_count { +struct string_count +{ char* value; int count; string_count* next; }; -static void init_class (grib_dumper_class* c){} +static void init_class(grib_dumper_class* c) {} static int init(grib_dumper* d) { - grib_dumper_bufr_simple *self = (grib_dumper_bufr_simple*)d; - grib_context* c=d->handle->context; - self->section_offset=0; - self->empty=1; - self->isLeaf=0; - self->isAttribute=0; - self->numberOfSubsets=0; - self->keys=(grib_string_list*)grib_context_malloc_clear(c,sizeof(grib_string_list)); + grib_dumper_bufr_simple* self = (grib_dumper_bufr_simple*)d; + grib_context* c = d->handle->context; + self->section_offset = 0; + self->empty = 1; + self->isLeaf = 0; + self->isAttribute = 0; + self->numberOfSubsets = 0; + self->keys = (grib_string_list*)grib_context_malloc_clear(c, sizeof(grib_string_list)); return GRIB_SUCCESS; } static int destroy(grib_dumper* d) { - grib_dumper_bufr_simple *self = (grib_dumper_bufr_simple*)d; - grib_string_list* next=self->keys; - grib_string_list* cur=self->keys; - grib_context* c=d->handle->context; - while(next) { - cur=next; - next=next->next; - grib_context_free(c,cur->value); - grib_context_free(c,cur); + grib_dumper_bufr_simple* self = (grib_dumper_bufr_simple*)d; + grib_string_list* next = self->keys; + grib_string_list* cur = self->keys; + grib_context* c = d->handle->context; + while (next) { + cur = next; + next = next->next; + grib_context_free(c, cur->value); + grib_context_free(c, cur); } return GRIB_SUCCESS; } static void dump_values(grib_dumper* d, grib_accessor* a) { - grib_dumper_bufr_simple *self = (grib_dumper_bufr_simple*)d; - double value=0; size_t size = 0; - double *values=NULL; - int err = 0; - int i,r; - int cols=9; - long count=0; - grib_context* c=a->context; - grib_handle* h=grib_handle_of_accessor(a); - - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) !=0) + grib_dumper_bufr_simple* self = (grib_dumper_bufr_simple*)d; + double value = 0; + size_t size = 0; + double* values = NULL; + int err = 0; + int i, r; + int cols = 9; + long count = 0; + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); + + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; - if (size>1) { - values=(double*)grib_context_malloc_clear(c,sizeof(double)*size); - err=grib_unpack_double(a,values,&size); - } else { - err=grib_unpack_double(a,&value,&size); + if (size > 1) { + values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); + err = grib_unpack_double(a, values, &size); + } + else { + err = grib_unpack_double(a, &value, &size); } - self->begin=0; - self->empty=0; + self->begin = 0; + self->empty = 0; - if (size>1) { - int icount=0; + if (size > 1) { + int icount = 0; - if ((r=compute_bufr_key_rank(h,self->keys,a->name))!=0) - fprintf(self->dumper.out,"#%d#%s=",r,a->name); + if ((r = compute_bufr_key_rank(h, self->keys, a->name)) != 0) + fprintf(self->dumper.out, "#%d#%s=", r, a->name); else - fprintf(self->dumper.out,"%s=",a->name); + fprintf(self->dumper.out, "%s=", a->name); - fprintf(self->dumper.out,"{"); + fprintf(self->dumper.out, "{"); - for (i=0; icols || i==0) {fprintf(self->dumper.out,"\n ");icount=0;} - fprintf(self->dumper.out,"%g, ", values[i]); + for (i = 0; i < size - 1; ++i) { + if (icount > cols || i == 0) { + fprintf(self->dumper.out, "\n "); + icount = 0; + } + fprintf(self->dumper.out, "%g, ", values[i]); icount++; } - if (icount>cols || i==0) {fprintf(self->dumper.out,"\n ");icount=0;} - fprintf(self->dumper.out, "%g",values[i]); - - fprintf(self->dumper.out,"}\n"); - grib_context_free(c,values); - } else { - r=compute_bufr_key_rank(h,self->keys,a->name); - if (r!=0) - fprintf(self->dumper.out,"#%d#%s=",r,a->name); + if (icount > cols || i == 0) { + fprintf(self->dumper.out, "\n "); + icount = 0; + } + fprintf(self->dumper.out, "%g", values[i]); + + fprintf(self->dumper.out, "}\n"); + grib_context_free(c, values); + } + else { + r = compute_bufr_key_rank(h, self->keys, a->name); + if (r != 0) + fprintf(self->dumper.out, "#%d#%s=", r, a->name); else - fprintf(self->dumper.out,"%s=",a->name); + fprintf(self->dumper.out, "%s=", a->name); - if (!grib_is_missing_double(a,value)) { - fprintf(self->dumper.out,"%g\n",value); - } else { - fprintf(self->dumper.out,"MISSING\n"); + if (!grib_is_missing_double(a, value)) { + fprintf(self->dumper.out, "%g\n", value); + } + else { + fprintf(self->dumper.out, "MISSING\n"); } } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); } (void)err; /* TODO */ } -static void dump_values_attribute(grib_dumper* d,grib_accessor* a, const char* prefix) +static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* prefix) { - grib_dumper_bufr_simple *self = (grib_dumper_bufr_simple*)d; - double value=0; size_t size = 0; - double *values=NULL; - int err = 0; - int i,icount; - int cols=9; - long count=0; - grib_context* c=a->context; - - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) !=0) + grib_dumper_bufr_simple* self = (grib_dumper_bufr_simple*)d; + double value = 0; + size_t size = 0; + double* values = NULL; + int err = 0; + int i, icount; + int cols = 9; + long count = 0; + grib_context* c = a->context; + + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; - if (size>1) { - values=(double*)grib_context_malloc_clear(c,sizeof(double)*size); - err=grib_unpack_double(a,values,&size); - } else { - err=grib_unpack_double(a,&value,&size); + if (size > 1) { + values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); + err = grib_unpack_double(a, values, &size); + } + else { + err = grib_unpack_double(a, &value, &size); } - self->empty=0; + self->empty = 0; - if (size>1) { - fprintf(self->dumper.out,"%s->%s = {", prefix, a->name); - icount=0; - for (i=0; icols || i==0) {fprintf(self->dumper.out,"\n ");icount=0;} - fprintf(self->dumper.out,"%g, ", values[i]); + if (size > 1) { + fprintf(self->dumper.out, "%s->%s = {", prefix, a->name); + icount = 0; + for (i = 0; i < size - 1; ++i) { + if (icount > cols || i == 0) { + fprintf(self->dumper.out, "\n "); + icount = 0; + } + fprintf(self->dumper.out, "%g, ", values[i]); icount++; } - if (icount>cols || i==0) {fprintf(self->dumper.out,"\n ");icount=0;} - fprintf(self->dumper.out,"%g", values[i]); + if (icount > cols || i == 0) { + fprintf(self->dumper.out, "\n "); + icount = 0; + } + fprintf(self->dumper.out, "%g", values[i]); - fprintf(self->dumper.out,"}\n"); - grib_context_free(c,values); - } else { + fprintf(self->dumper.out, "}\n"); + grib_context_free(c, values); + } + else { /* int r=compute_bufr_key_rank(h,self->keys,a->name); */ - if( !grib_is_missing_double(a,value) ) { - fprintf(self->dumper.out,"%s->%s = %g\n", prefix, a->name, value); - } else { - fprintf(self->dumper.out,"%s->%s = MISSING\n", prefix, a->name); + if (!grib_is_missing_double(a, value)) { + fprintf(self->dumper.out, "%s->%s = %g\n", prefix, a->name, value); + } + else { + fprintf(self->dumper.out, "%s->%s = MISSING\n", prefix, a->name); } } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix1; - prefix1=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+strlen(prefix)+5)); - sprintf(prefix1,"%s->%s",prefix,a->name); + prefix1 = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + strlen(prefix) + 5)); + sprintf(prefix1, "%s->%s", prefix, a->name); - dump_attributes(d,a,prefix1); + dump_attributes(d, a, prefix1); - grib_context_free(c,prefix1); + grib_context_free(c, prefix1); } (void)err; /* TODO */ @@ -286,175 +315,200 @@ static void dump_values_attribute(grib_dumper* d,grib_accessor* a, const char* p static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_simple *self = (grib_dumper_bufr_simple*)d; - long value=0; size_t size = 0; - long *values=NULL; - int err = 0; - int i,r,icount; - int cols=9; - long count=0; - grib_context* c=a->context; - grib_handle* h=grib_handle_of_accessor(a); - - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 ) + grib_dumper_bufr_simple* self = (grib_dumper_bufr_simple*)d; + long value = 0; + size_t size = 0; + long* values = NULL; + int err = 0; + int i, r, icount; + int cols = 9; + long count = 0; + grib_context* c = a->context; + grib_handle* h = grib_handle_of_accessor(a); + + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; - if ( (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { - if (self->isLeaf==0) { + if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; /* Note: the "subsetNumber" key is only there for UNCOMPRESSED BUFR messages */ - if (self->numberOfSubsets > 1 && strcmp(a->name,"subsetNumber")==0) { - err = grib_unpack_long(a,&value,&size); + if (self->numberOfSubsets > 1 && strcmp(a->name, "subsetNumber") == 0) { + err = grib_unpack_long(a, &value, &size); DebugAssert(!err); - fprintf(self->dumper.out,"%s=%ld\n",a->name,value); - DebugAssert( !grib_is_missing_long(a,value) ); + fprintf(self->dumper.out, "%s=%ld\n", a->name, value); + DebugAssert(!grib_is_missing_long(a, value)); return; } - r=compute_bufr_key_rank(h,self->keys,a->name); - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; - - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); + r = compute_bufr_key_rank(h, self->keys, a->name); + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; + + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); } return; } - if (size>1) { - values=(long*)grib_context_malloc_clear(a->context,sizeof(long)*size); - err=grib_unpack_long(a,values,&size); - } else { - err=grib_unpack_long(a,&value,&size); + if (size > 1) { + values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); + err = grib_unpack_long(a, values, &size); + } + else { + err = grib_unpack_long(a, &value, &size); } - self->begin=0; - self->empty=0; + self->begin = 0; + self->empty = 0; - if (size>1) { - int doing_unexpandedDescriptors=0; - icount=0; - if ((r=compute_bufr_key_rank(h,self->keys,a->name))!=0) - fprintf(self->dumper.out,"#%d#%s=",r,a->name); + if (size > 1) { + int doing_unexpandedDescriptors = 0; + icount = 0; + if ((r = compute_bufr_key_rank(h, self->keys, a->name)) != 0) + fprintf(self->dumper.out, "#%d#%s=", r, a->name); else - fprintf(self->dumper.out,"%s=",a->name); + fprintf(self->dumper.out, "%s=", a->name); - fprintf(self->dumper.out,"{"); - if (strcmp(a->name, "unexpandedDescriptors")==0) + fprintf(self->dumper.out, "{"); + if (strcmp(a->name, "unexpandedDescriptors") == 0) doing_unexpandedDescriptors = 1; - for (i=0;icols || i==0) {fprintf(self->dumper.out,"\n ");icount=0;} + for (i = 0; i < size - 1; i++) { + if (icount > cols || i == 0) { + fprintf(self->dumper.out, "\n "); + icount = 0; + } if (doing_unexpandedDescriptors) - fprintf(self->dumper.out,"%06ld, ",values[i]); + fprintf(self->dumper.out, "%06ld, ", values[i]); else - fprintf(self->dumper.out,"%ld, ",values[i]); + fprintf(self->dumper.out, "%ld, ", values[i]); icount++; } - if (icount>cols || i==0) {fprintf(self->dumper.out,"\n ");icount=0;} + if (icount > cols || i == 0) { + fprintf(self->dumper.out, "\n "); + icount = 0; + } if (doing_unexpandedDescriptors) - fprintf(self->dumper.out,"%06ld ",values[i]); + fprintf(self->dumper.out, "%06ld ", values[i]); else - fprintf(self->dumper.out,"%ld ",values[i]); - - fprintf(self->dumper.out,"}\n"); - grib_context_free(a->context,values); - } else { - r=compute_bufr_key_rank(h,self->keys,a->name); - if (r!=0) - fprintf(self->dumper.out,"#%d#%s=",r,a->name); + fprintf(self->dumper.out, "%ld ", values[i]); + + fprintf(self->dumper.out, "}\n"); + grib_context_free(a->context, values); + } + else { + r = compute_bufr_key_rank(h, self->keys, a->name); + if (r != 0) + fprintf(self->dumper.out, "#%d#%s=", r, a->name); else - fprintf(self->dumper.out,"%s=",a->name); + fprintf(self->dumper.out, "%s=", a->name); - if( !grib_is_missing_long(a,value) ) { - fprintf(self->dumper.out,"%ld\n",value); - } else { - fprintf(self->dumper.out,"MISSING\n"); + if (!grib_is_missing_long(a, value)) { + fprintf(self->dumper.out, "%ld\n", value); + } + else { + fprintf(self->dumper.out, "MISSING\n"); } } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); } (void)err; /* TODO */ } static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* prefix) { - grib_dumper_bufr_simple *self = (grib_dumper_bufr_simple*)d; - long value=0; size_t size = 0; - long *values=NULL; - int err = 0; - int i,icount; - int cols=9; - long count=0; - grib_context* c=a->context; - - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + grib_dumper_bufr_simple* self = (grib_dumper_bufr_simple*)d; + long value = 0; + size_t size = 0; + long* values = NULL; + int err = 0; + int i, icount; + int cols = 9; + long count = 0; + grib_context* c = a->context; + + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; - if (size>1) { - values=(long*)grib_context_malloc_clear(a->context,sizeof(long)*size); - err=grib_unpack_long(a,values,&size); - } else { - err=grib_unpack_long(a,&value,&size); + if (size > 1) { + values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); + err = grib_unpack_long(a, values, &size); + } + else { + err = grib_unpack_long(a, &value, &size); } - self->empty=0; + self->empty = 0; - if (size>1) { - fprintf(self->dumper.out,"%s->%s = {", prefix, a->name); - icount=0; - for (i=0;icols || i==0) {fprintf(self->dumper.out,"\n ");icount=0;} - fprintf(self->dumper.out,"%ld, ",values[i]); + if (size > 1) { + fprintf(self->dumper.out, "%s->%s = {", prefix, a->name); + icount = 0; + for (i = 0; i < size - 1; i++) { + if (icount > cols || i == 0) { + fprintf(self->dumper.out, "\n "); + icount = 0; + } + fprintf(self->dumper.out, "%ld, ", values[i]); icount++; } - if (icount>cols || i==0) {fprintf(self->dumper.out,"\n ");icount=0;} - fprintf(self->dumper.out,"%ld ",values[i]); - fprintf(self->dumper.out,"}\n"); - grib_context_free(a->context,values); - - } else { + if (icount > cols || i == 0) { + fprintf(self->dumper.out, "\n "); + icount = 0; + } + fprintf(self->dumper.out, "%ld ", values[i]); + fprintf(self->dumper.out, "}\n"); + grib_context_free(a->context, values); + } + else { /* int r=compute_bufr_key_rank(h,self->keys,a->name); */ - if( !grib_is_missing_long(a,value) ) { - fprintf(self->dumper.out,"%s->%s = ",prefix,a->name); - fprintf(self->dumper.out,"%ld\n",value); - } else { - fprintf(self->dumper.out,"%s->%s = MISSING\n",prefix,a->name); + if (!grib_is_missing_long(a, value)) { + fprintf(self->dumper.out, "%s->%s = ", prefix, a->name); + fprintf(self->dumper.out, "%ld\n", value); + } + else { + fprintf(self->dumper.out, "%s->%s = MISSING\n", prefix, a->name); } } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix1; - prefix1=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+strlen(prefix)+5)); - sprintf(prefix1,"%s->%s",prefix,a->name); + prefix1 = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + strlen(prefix) + 5)); + sprintf(prefix1, "%s->%s", prefix, a->name); - dump_attributes(d,a,prefix1); + dump_attributes(d, a, prefix1); - grib_context_free(c,prefix1); + grib_context_free(c, prefix1); } (void)err; /* TODO */ } @@ -465,184 +519,204 @@ static void dump_bits(grib_dumper* d, grib_accessor* a, const char* comment) static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_simple *self = (grib_dumper_bufr_simple*)d; - double value=0; size_t size = 1; + grib_dumper_bufr_simple* self = (grib_dumper_bufr_simple*)d; + double value = 0; + size_t size = 1; int r; - grib_handle* h=grib_handle_of_accessor(a); - grib_context* c=h->context; + grib_handle* h = grib_handle_of_accessor(a); + grib_context* c = h->context; - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_unpack_double(a,&value,&size); + grib_unpack_double(a, &value, &size); - self->begin=0; - self->empty=0; + self->begin = 0; + self->empty = 0; - r=compute_bufr_key_rank(h,self->keys,a->name); - if (r!=0) - fprintf(self->dumper.out,"#%d#%s=",r,a->name); + r = compute_bufr_key_rank(h, self->keys, a->name); + if (r != 0) + fprintf(self->dumper.out, "#%d#%s=", r, a->name); else - fprintf(self->dumper.out,"%s=",a->name); + fprintf(self->dumper.out, "%s=", a->name); - if( !grib_is_missing_double(a,value) ) { - fprintf(self->dumper.out,"%g\n",value); - } else { - fprintf(self->dumper.out,"MISSING\n"); + if (!grib_is_missing_double(a, value)) { + fprintf(self->dumper.out, "%g\n", value); + } + else { + fprintf(self->dumper.out, "MISSING\n"); } - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); } } static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_simple *self = (grib_dumper_bufr_simple*)d; - char **values=NULL; - size_t size=0, i=0; - grib_context* c=a->context; - int err = 0; - long count=0; - int r=0; - grib_handle* h=grib_handle_of_accessor(a); - - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + grib_dumper_bufr_simple* self = (grib_dumper_bufr_simple*)d; + char** values = NULL; + size_t size = 0, i = 0; + grib_context* c = a->context; + int err = 0; + long count = 0; + int r = 0; + grib_handle* h = grib_handle_of_accessor(a); + + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - grib_value_count(a,&count); - size=count; - if (size==1) { - dump_string(d,a,comment); + grib_value_count(a, &count); + size = count; + if (size == 1) { + dump_string(d, a, comment); return; } - self->begin=0; + self->begin = 0; - if (self->isLeaf==0) { - if ((r=compute_bufr_key_rank(h,self->keys,a->name))!=0) - fprintf(self->dumper.out,"#%d#%s=",r,a->name); + if (self->isLeaf == 0) { + if ((r = compute_bufr_key_rank(h, self->keys, a->name)) != 0) + fprintf(self->dumper.out, "#%d#%s=", r, a->name); else - fprintf(self->dumper.out,"%s=",a->name); + fprintf(self->dumper.out, "%s=", a->name); } - self->empty=0; + self->empty = 0; - values=(char**)grib_context_malloc_clear(c,size*sizeof(char*)); + values = (char**)grib_context_malloc_clear(c, size * sizeof(char*)); if (!values) { - grib_context_log(c,GRIB_LOG_FATAL,"unable to allocate %d bytes",(int)size); + grib_context_log(c, GRIB_LOG_FATAL, "unable to allocate %d bytes", (int)size); return; } - err = grib_unpack_string_array(a,values,&size); + err = grib_unpack_string_array(a, values, &size); fprintf(self->dumper.out, "{"); - for (i=0;idumper.out," \"%s\",\n",values[i]); + for (i = 0; i < size - 1; i++) { + fprintf(self->dumper.out, " \"%s\",\n", values[i]); } - fprintf(self->dumper.out," \"%s\"\n",values[i]); + fprintf(self->dumper.out, " \"%s\"\n", values[i]); fprintf(self->dumper.out, "}\n"); - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(a->name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,a->name); - } else prefix=(char*)a->name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, a->name); + } + else + prefix = (char*)a->name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); } - grib_context_free(c,values); + grib_context_free(c, values); (void)err; /* TODO */ } static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_bufr_simple *self = (grib_dumper_bufr_simple*)d; - char *value=NULL; - char *p = NULL; - size_t size = 0; - grib_context* c=NULL; - int r = 0; - int is_missing = 0; - int err = _grib_get_string_length(a,&size); - grib_handle* h=grib_handle_of_accessor(a); - const char* acc_name = a->name; - - c=a->context; - if (size==0) return; - - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { + grib_dumper_bufr_simple* self = (grib_dumper_bufr_simple*)d; + char* value = NULL; + char* p = NULL; + size_t size = 0; + grib_context* c = NULL; + int r = 0; + int is_missing = 0; + int err = _grib_get_string_length(a, &size); + grib_handle* h = grib_handle_of_accessor(a); + const char* acc_name = a->name; + + c = a->context; + if (size == 0) + return; + + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { /* ECC-356: Solution for the special local section key 'keyMore' and its alias 'ident' */ int skip = 1; - if ( (a->flags & GRIB_ACCESSOR_FLAG_HIDDEN)!=0 ) { - if ( strcmp(a->name, "keyMore")==0 && grib_is_defined(h, "ls.ident") ) { - skip = 0; + if ((a->flags & GRIB_ACCESSOR_FLAG_HIDDEN) != 0) { + if (strcmp(a->name, "keyMore") == 0 && grib_is_defined(h, "ls.ident")) { + skip = 0; acc_name = "ident"; } } - if (skip) return; + if (skip) + return; } - value=(char*)grib_context_malloc_clear(c,size); + value = (char*)grib_context_malloc_clear(c, size); if (!value) { - grib_context_log(c,GRIB_LOG_FATAL,"unable to allocate %d bytes",(int)size); + grib_context_log(c, GRIB_LOG_FATAL, "unable to allocate %d bytes", (int)size); return; } - else self->begin=0; + else + self->begin = 0; - self->empty=0; + self->empty = 0; - err = grib_unpack_string(a,value,&size); - p=value; - r=compute_bufr_key_rank(h,self->keys,acc_name); - if (grib_is_missing_string(a,(unsigned char *)value,size)) { + err = grib_unpack_string(a, value, &size); + p = value; + r = compute_bufr_key_rank(h, self->keys, acc_name); + if (grib_is_missing_string(a, (unsigned char*)value, size)) { is_missing = 1; } - while(*p) { if(!isprint(*p)) *p = '.'; p++; } + while (*p) { + if (!isprint(*p)) + *p = '.'; + p++; + } - if (self->isLeaf==0) { - if (r!=0) - fprintf(self->dumper.out,"#%d#%s=",r,acc_name); + if (self->isLeaf == 0) { + if (r != 0) + fprintf(self->dumper.out, "#%d#%s=", r, acc_name); else - fprintf(self->dumper.out,"%s=",acc_name); + fprintf(self->dumper.out, "%s=", acc_name); } - if (is_missing) fprintf(self->dumper.out,"%s\n", "MISSING"); - else fprintf(self->dumper.out,"\"%s\"\n",value); + if (is_missing) + fprintf(self->dumper.out, "%s\n", "MISSING"); + else + fprintf(self->dumper.out, "\"%s\"\n", value); - if (self->isLeaf==0) { + if (self->isLeaf == 0) { char* prefix; - int dofree=0; + int dofree = 0; - if (r!=0) { - prefix=(char*)grib_context_malloc_clear(c,sizeof(char)*(strlen(acc_name)+10)); - dofree=1; - sprintf(prefix,"#%d#%s",r,acc_name); - } else prefix=(char*)acc_name; + if (r != 0) { + prefix = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(acc_name) + 10)); + dofree = 1; + sprintf(prefix, "#%d#%s", r, acc_name); + } + else + prefix = (char*)acc_name; - dump_attributes(d,a,prefix); - if (dofree) grib_context_free(c,prefix); + dump_attributes(d, a, prefix); + if (dofree) + grib_context_free(c, prefix); } - grib_context_free(c,value); + grib_context_free(c, value); (void)err; /* TODO */ } @@ -657,90 +731,96 @@ static void dump_label(grib_dumper* d, grib_accessor* a, const char* comment) static void _dump_long_array(grib_handle* h, FILE* f, const char* key) { long* val; - size_t size=0,i; - int cols=9,icount=0; - - if (grib_get_size(h,key,&size)==GRIB_NOT_FOUND) return; - if (size==0) return; - - val=(long*)grib_context_malloc_clear(h->context,sizeof(long)*size); - grib_get_long_array(h,key,val,&size); - fprintf(f,"%s= {", key); - for (i=0;icols || i==0) {fprintf(f,"\n ");icount=0;} - fprintf(f,"%ld, ",val[i]); + size_t size = 0, i; + int cols = 9, icount = 0; + + if (grib_get_size(h, key, &size) == GRIB_NOT_FOUND) + return; + if (size == 0) + return; + + val = (long*)grib_context_malloc_clear(h->context, sizeof(long) * size); + grib_get_long_array(h, key, val, &size); + fprintf(f, "%s= {", key); + for (i = 0; i < size - 1; i++) { + if (icount > cols || i == 0) { + fprintf(f, "\n "); + icount = 0; + } + fprintf(f, "%ld, ", val[i]); icount++; } - if (icount>cols) {fprintf(f,"\n ");} - fprintf(f,"%ld}\n",val[size-1]); + if (icount > cols) { + fprintf(f, "\n "); + } + fprintf(f, "%ld}\n", val[size - 1]); - grib_context_free(h->context,val); + grib_context_free(h->context, val); } static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block) { - grib_dumper_bufr_simple *self = (grib_dumper_bufr_simple*)d; - if (!grib_inline_strcmp(a->name,"BUFR") || - !grib_inline_strcmp(a->name,"GRIB") || - !grib_inline_strcmp(a->name,"META") - ) { - int err = 0; - grib_handle* h=grib_handle_of_accessor(a); - self->begin=1; - self->empty=1; + grib_dumper_bufr_simple* self = (grib_dumper_bufr_simple*)d; + if (!grib_inline_strcmp(a->name, "BUFR") || + !grib_inline_strcmp(a->name, "GRIB") || + !grib_inline_strcmp(a->name, "META")) { + int err = 0; + grib_handle* h = grib_handle_of_accessor(a); + self->begin = 1; + self->empty = 1; err = grib_get_long(h, "numberOfSubsets", &(self->numberOfSubsets)); Assert(!err); - _dump_long_array(h,self->dumper.out,"dataPresentIndicator"); - _dump_long_array(h,self->dumper.out,"delayedDescriptorReplicationFactor"); - _dump_long_array(h,self->dumper.out,"shortDelayedDescriptorReplicationFactor"); - _dump_long_array(h,self->dumper.out,"extendedDelayedDescriptorReplicationFactor"); + _dump_long_array(h, self->dumper.out, "dataPresentIndicator"); + _dump_long_array(h, self->dumper.out, "delayedDescriptorReplicationFactor"); + _dump_long_array(h, self->dumper.out, "shortDelayedDescriptorReplicationFactor"); + _dump_long_array(h, self->dumper.out, "extendedDelayedDescriptorReplicationFactor"); /* Do not show the inputOverriddenReferenceValues array. That's more for ENCODING */ /*_dump_long_array(h,self->dumper.out,"inputOverriddenReferenceValues","inputOverriddenReferenceValues");*/ - grib_dump_accessors_block(d,block); - } else if (!grib_inline_strcmp(a->name,"groupNumber")) { - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) + grib_dump_accessors_block(d, block); + } + else if (!grib_inline_strcmp(a->name, "groupNumber")) { + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - self->begin=1; - self->empty=1; - grib_dump_accessors_block(d,block); - } else { - grib_dump_accessors_block(d,block); + self->begin = 1; + self->empty = 1; + grib_dump_accessors_block(d, block); + } + else { + grib_dump_accessors_block(d, block); } } -static void dump_attributes(grib_dumper* d,grib_accessor* a, const char* prefix) +static void dump_attributes(grib_dumper* d, grib_accessor* a, const char* prefix) { - int i=0; - grib_dumper_bufr_simple *self = (grib_dumper_bufr_simple*)d; + int i = 0; + grib_dumper_bufr_simple* self = (grib_dumper_bufr_simple*)d; unsigned long flags; while (i < MAX_ACCESSOR_ATTRIBUTES && a->attributes[i]) { - self->isAttribute=1; - if ( (d->option_flags & GRIB_DUMP_FLAG_ALL_ATTRIBUTES ) == 0 - && (a->attributes[i]->flags & GRIB_ACCESSOR_FLAG_DUMP)== 0 ) - { + self->isAttribute = 1; + if ((d->option_flags & GRIB_DUMP_FLAG_ALL_ATTRIBUTES) == 0 && (a->attributes[i]->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) { i++; continue; } - self->isLeaf=a->attributes[i]->attributes[0]==NULL ? 1 : 0; + self->isLeaf = a->attributes[i]->attributes[0] == NULL ? 1 : 0; /* fprintf(self->dumper.out,","); */ /* fprintf(self->dumper.out,"\n%-*s",depth," "); */ /* fprintf(out,"\"%s\" : ",a->attributes[i]->name); */ - flags=a->attributes[i]->flags; + flags = a->attributes[i]->flags; a->attributes[i]->flags |= GRIB_ACCESSOR_FLAG_DUMP; switch (grib_accessor_get_native_type(a->attributes[i])) { - case GRIB_TYPE_LONG: - dump_long_attribute(d,a->attributes[i],prefix); - break; - case GRIB_TYPE_DOUBLE: - dump_values_attribute(d,a->attributes[i],prefix); - break; - case GRIB_TYPE_STRING: - break; + case GRIB_TYPE_LONG: + dump_long_attribute(d, a->attributes[i], prefix); + break; + case GRIB_TYPE_DOUBLE: + dump_values_attribute(d, a->attributes[i], prefix); + break; + case GRIB_TYPE_STRING: + break; } - a->attributes[i]->flags=flags; + a->attributes[i]->flags = flags; i++; } - self->isLeaf=0; - self->isAttribute=0; + self->isLeaf = 0; + self->isAttribute = 0; } diff --git a/src/grib_dumper_class_debug.c b/src/grib_dumper_class_debug.c index bb3126418..a210459a1 100644 --- a/src/grib_dumper_class_debug.c +++ b/src/grib_dumper_class_debug.c @@ -38,457 +38,487 @@ or edit "dumper.class" and rerun ./make_class.pl */ -static void init_class (grib_dumper_class*); -static int init (grib_dumper* d); -static int destroy (grib_dumper*); -static void dump_long (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_bits (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_double (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_string (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_bytes (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_values (grib_dumper* d, grib_accessor* a); -static void dump_label (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_section (grib_dumper* d, grib_accessor* a,grib_block_of_accessors* block); - -typedef struct grib_dumper_debug { - grib_dumper dumper; -/* Members defined in debug */ - long section_offset; - long begin; - long theEnd; +static void init_class(grib_dumper_class*); +static int init(grib_dumper* d); +static int destroy(grib_dumper*); +static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_bits(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_values(grib_dumper* d, grib_accessor* a); +static void dump_label(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block); + +typedef struct grib_dumper_debug +{ + grib_dumper dumper; + /* Members defined in debug */ + long section_offset; + long begin; + long theEnd; } grib_dumper_debug; static grib_dumper_class _grib_dumper_class_debug = { - 0, /* super */ - "debug", /* name */ - sizeof(grib_dumper_debug), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - &destroy, /* free mem */ - &dump_long, /* dump long */ - &dump_double, /* dump double */ - &dump_string, /* dump string */ - 0, /* dump string array */ - &dump_label, /* dump labels */ - &dump_bytes, /* dump bytes */ - &dump_bits, /* dump bits */ - &dump_section, /* dump section */ - &dump_values, /* dump values */ - 0, /* header */ - 0, /* footer */ + 0, /* super */ + "debug", /* name */ + sizeof(grib_dumper_debug), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + &destroy, /* free mem */ + &dump_long, /* dump long */ + &dump_double, /* dump double */ + &dump_string, /* dump string */ + 0, /* dump string array */ + &dump_label, /* dump labels */ + &dump_bytes, /* dump bytes */ + &dump_bits, /* dump bits */ + &dump_section, /* dump section */ + &dump_values, /* dump values */ + 0, /* header */ + 0, /* footer */ }; grib_dumper_class* grib_dumper_class_debug = &_grib_dumper_class_debug; /* END_CLASS_IMP */ -static void set_begin_end(grib_dumper* d,grib_accessor* a); +static void set_begin_end(grib_dumper* d, grib_accessor* a); -static void init_class (grib_dumper_class* c){} +static void init_class(grib_dumper_class* c) {} -static int init(grib_dumper* d) +static int init(grib_dumper* d) { - grib_dumper_debug *self = (grib_dumper_debug*)d; - self->section_offset=0; + grib_dumper_debug* self = (grib_dumper_debug*)d; + self->section_offset = 0; return GRIB_SUCCESS; } -static int destroy (grib_dumper* d) +static int destroy(grib_dumper* d) { return GRIB_SUCCESS; } -static void aliases(grib_dumper* d,grib_accessor* a) +static void aliases(grib_dumper* d, grib_accessor* a) { int i; - grib_dumper_debug *self = (grib_dumper_debug*)d; - - if(a->all_names[1]) - { - char *sep = ""; - fprintf(self->dumper.out," ["); - - for(i = 1; i < MAX_ACCESSOR_NAMES; i++) - { - if(a->all_names[i]) - { - if(a->all_name_spaces[i]) - fprintf(self->dumper.out,"%s%s.%s", sep,a->all_name_spaces[i],a->all_names[i]); + grib_dumper_debug* self = (grib_dumper_debug*)d; + + if (a->all_names[1]) { + char* sep = ""; + fprintf(self->dumper.out, " ["); + + for (i = 1; i < MAX_ACCESSOR_NAMES; i++) { + if (a->all_names[i]) { + if (a->all_name_spaces[i]) + fprintf(self->dumper.out, "%s%s.%s", sep, a->all_name_spaces[i], a->all_names[i]); else - fprintf(self->dumper.out,"%s%s", sep,a->all_names[i]); + fprintf(self->dumper.out, "%s%s", sep, a->all_names[i]); } sep = ", "; } - fprintf(self->dumper.out,"]"); + fprintf(self->dumper.out, "]"); } } -static void dump_long(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_debug *self = (grib_dumper_debug*)d; - long value=0; size_t size = 0; - long *values=NULL; /* array of long */ - long count = 0; + grib_dumper_debug* self = (grib_dumper_debug*)d; + long value = 0; + size_t size = 0; + long* values = NULL; /* array of long */ + long count = 0; int err = 0, i = 0, more = 0; - grib_value_count(a,&count);size=count; + grib_value_count(a, &count); + size = count; if (a->length == 0 && (d->option_flags & GRIB_DUMP_FLAG_CODED) != 0) return; if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0 && - (d->option_flags & GRIB_DUMP_FLAG_READ_ONLY) == 0) + (d->option_flags & GRIB_DUMP_FLAG_READ_ONLY) == 0) return; - if (size>1) { - values=(long*)grib_context_malloc_clear(a->context,sizeof(long)*size); - err=grib_unpack_long(a,values,&size); - } else { - err=grib_unpack_long(a,&value,&size); + if (size > 1) { + values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); + err = grib_unpack_long(a, values, &size); + } + else { + err = grib_unpack_long(a, &value, &size); } - set_begin_end(d,a); + set_begin_end(d, a); - for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," "); + for (i = 0; i < d->depth; i++) + fprintf(self->dumper.out, " "); - if (size>1) { - fprintf(self->dumper.out,"%ld-%ld %s %s = {\n",self->begin,self->theEnd,a->creator->op,a->name); + if (size > 1) { + fprintf(self->dumper.out, "%ld-%ld %s %s = {\n", self->begin, self->theEnd, a->creator->op, a->name); if (values) { int k = 0; - if(size > 100) { + if (size > 100) { more = size - 100; size = 100; } - while(k < size) { + while (k < size) { int j; - for(i = 0; i < d->depth + 3 ; i++) fprintf(self->dumper.out," "); - for(j = 0; j < 8 && k < size; j++, k++) { - fprintf(self->dumper.out,"%ld",values[k]); - if(k != size-1) fprintf(self->dumper.out,", "); + for (i = 0; i < d->depth + 3; i++) + fprintf(self->dumper.out, " "); + for (j = 0; j < 8 && k < size; j++, k++) { + fprintf(self->dumper.out, "%ld", values[k]); + if (k != size - 1) + fprintf(self->dumper.out, ", "); } - fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out, "\n"); } - if(more) { - for(i = 0; i < d->depth + 3 ; i++) fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"... %d more values\n",more); + if (more) { + for (i = 0; i < d->depth + 3; i++) + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "... %d more values\n", more); } - for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"} # %s %s \n",a->creator->op, a->name); - grib_context_free(a->context,values); + for (i = 0; i < d->depth; i++) + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "} # %s %s \n", a->creator->op, a->name); + grib_context_free(a->context, values); } - } else { - if( ((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && grib_is_missing_internal(a)) - fprintf(self->dumper.out,"%ld-%ld %s %s = MISSING",self->begin,self->theEnd,a->creator->op, a->name); + } + else { + if (((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && grib_is_missing_internal(a)) + fprintf(self->dumper.out, "%ld-%ld %s %s = MISSING", self->begin, self->theEnd, a->creator->op, a->name); else - fprintf(self->dumper.out,"%ld-%ld %s %s = %ld",self->begin,self->theEnd,a->creator->op, a->name,value); - if(comment) fprintf(self->dumper.out," [%s]",comment); + fprintf(self->dumper.out, "%ld-%ld %s %s = %ld", self->begin, self->theEnd, a->creator->op, a->name, value); + if (comment) + fprintf(self->dumper.out, " [%s]", comment); } - if(err) - fprintf(self->dumper.out," *** ERR=%d (%s) [grib_dumper_debug::dump_long]",err,grib_get_error_message(err)); + if (err) + fprintf(self->dumper.out, " *** ERR=%d (%s) [grib_dumper_debug::dump_long]", err, grib_get_error_message(err)); - aliases(d,a); + aliases(d, a); - fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out, "\n"); } -static int test_bit(long a, long b) {return a&(1<length == 0 && - (d->option_flags & GRIB_DUMP_FLAG_CODED) != 0) + if (a->length == 0 && + (d->option_flags & GRIB_DUMP_FLAG_CODED) != 0) return; - set_begin_end(d,a); + set_begin_end(d, a); - for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"%ld-%ld %s %s = %ld [",self->begin,self->theEnd, a->creator->op,a->name,value); + for (i = 0; i < d->depth; i++) + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "%ld-%ld %s %s = %ld [", self->begin, self->theEnd, a->creator->op, a->name, value); - for(i=0;i<(a->length*8);i++) { - if(test_bit(value,a->length*8-i-1)) - fprintf(self->dumper.out,"1"); + for (i = 0; i < (a->length * 8); i++) { + if (test_bit(value, a->length * 8 - i - 1)) + fprintf(self->dumper.out, "1"); else - fprintf(self->dumper.out,"0"); + fprintf(self->dumper.out, "0"); } - if(comment) - fprintf(self->dumper.out,":%s]",comment); + if (comment) + fprintf(self->dumper.out, ":%s]", comment); else - fprintf(self->dumper.out,"]"); + fprintf(self->dumper.out, "]"); - if(err) - fprintf(self->dumper.out," *** ERR=%d (%s) [grib_dumper_debug::dump_bits]",err,grib_get_error_message(err)); + if (err) + fprintf(self->dumper.out, " *** ERR=%d (%s) [grib_dumper_debug::dump_bits]", err, grib_get_error_message(err)); - aliases(d,a); - fprintf(self->dumper.out,"\n"); + aliases(d, a); + fprintf(self->dumper.out, "\n"); } -static void dump_double(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_debug *self = (grib_dumper_debug*)d; - double value=0; size_t size = 1; - int err = grib_unpack_double(a,&value,&size); + grib_dumper_debug* self = (grib_dumper_debug*)d; + double value = 0; + size_t size = 1; + int err = grib_unpack_double(a, &value, &size); int i; - if( a->length == 0 && - (d->option_flags & GRIB_DUMP_FLAG_CODED) != 0) + if (a->length == 0 && + (d->option_flags & GRIB_DUMP_FLAG_CODED) != 0) return; - set_begin_end(d,a); + set_begin_end(d, a); - for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," "); + for (i = 0; i < d->depth; i++) + fprintf(self->dumper.out, " "); - if( ((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && grib_is_missing_internal(a)) - fprintf(self->dumper.out,"%ld-%ld %s %s = MISSING",self->begin,self->theEnd,a->creator->op, a->name); + if (((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && grib_is_missing_internal(a)) + fprintf(self->dumper.out, "%ld-%ld %s %s = MISSING", self->begin, self->theEnd, a->creator->op, a->name); else - fprintf(self->dumper.out,"%ld-%ld %s %s = %g",self->begin,self->theEnd,a->creator->op, a->name,value); - if(comment) fprintf(self->dumper.out," [%s]",comment); - if(err) - fprintf(self->dumper.out," *** ERR=%d (%s) [grib_dumper_debug::dump_double]",err,grib_get_error_message(err)); - aliases(d,a); - fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out, "%ld-%ld %s %s = %g", self->begin, self->theEnd, a->creator->op, a->name, value); + if (comment) + fprintf(self->dumper.out, " [%s]", comment); + if (err) + fprintf(self->dumper.out, " *** ERR=%d (%s) [grib_dumper_debug::dump_double]", err, grib_get_error_message(err)); + aliases(d, a); + fprintf(self->dumper.out, "\n"); } -static void dump_string(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_debug *self = (grib_dumper_debug*)d; - int err=0; + grib_dumper_debug* self = (grib_dumper_debug*)d; + int err = 0; int i; - size_t size=0; - char *value=NULL; - char *p=NULL ; + size_t size = 0; + char* value = NULL; + char* p = NULL; - err = _grib_get_string_length(a,&size); - if ( (size < 2) && grib_is_missing_internal(a) ) { + err = _grib_get_string_length(a, &size); + if ((size < 2) && grib_is_missing_internal(a)) { /* GRIB-302: transients and missing keys. Need to re-adjust the size */ size = 10; /* big enough to hold the string "missing" */ } - value=(char*)grib_context_malloc_clear(a->context,size); - if (!value) return; - err=grib_unpack_string(a,value,&size); + value = (char*)grib_context_malloc_clear(a->context, size); + if (!value) + return; + err = grib_unpack_string(a, value, &size); - if(err) strcpy(value,""); + if (err) + strcpy(value, ""); - p=value; + p = value; - if( a->length == 0 && (d->option_flags & GRIB_DUMP_FLAG_CODED) != 0) + if (a->length == 0 && (d->option_flags & GRIB_DUMP_FLAG_CODED) != 0) return; - set_begin_end(d,a); + set_begin_end(d, a); - while(*p) { if(!isprint(*p)) *p = '.'; p++; } + while (*p) { + if (!isprint(*p)) + *p = '.'; + p++; + } - for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"%ld-%ld %s %s = %s",self->begin,self->theEnd,a->creator->op, a->name,value); + for (i = 0; i < d->depth; i++) + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "%ld-%ld %s %s = %s", self->begin, self->theEnd, a->creator->op, a->name, value); - if(comment) fprintf(self->dumper.out," [%s]",comment); - if(err) - fprintf(self->dumper.out," *** ERR=%d (%s) [grib_dumper_debug::dump_string]",err,grib_get_error_message(err)); - aliases(d,a); - fprintf(self->dumper.out,"\n"); + if (comment) + fprintf(self->dumper.out, " [%s]", comment); + if (err) + fprintf(self->dumper.out, " *** ERR=%d (%s) [grib_dumper_debug::dump_string]", err, grib_get_error_message(err)); + aliases(d, a); + fprintf(self->dumper.out, "\n"); - grib_context_free(a->context,value); + grib_context_free(a->context, value); } -static void dump_bytes(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_debug *self = (grib_dumper_debug*)d; - int i,k,err =0; - int more = 0; - size_t size = a->length; - unsigned char* buf = (unsigned char*)grib_context_malloc(d->handle->context,size); - - if( a->length == 0 && - (d->option_flags & GRIB_DUMP_FLAG_CODED) != 0) + grib_dumper_debug* self = (grib_dumper_debug*)d; + int i, k, err = 0; + int more = 0; + size_t size = a->length; + unsigned char* buf = (unsigned char*)grib_context_malloc(d->handle->context, size); + + if (a->length == 0 && + (d->option_flags & GRIB_DUMP_FLAG_CODED) != 0) return; - set_begin_end(d,a); + set_begin_end(d, a); - for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"%ld-%ld %s %s = %ld",self->begin,self->theEnd,a->creator->op, a->name,a->length); - aliases(d,a); - fprintf(self->dumper.out," {"); + for (i = 0; i < d->depth; i++) + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "%ld-%ld %s %s = %ld", self->begin, self->theEnd, a->creator->op, a->name, a->length); + aliases(d, a); + fprintf(self->dumper.out, " {"); - if(!buf) - { - if(size == 0) - fprintf(self->dumper.out,"}\n"); + if (!buf) { + if (size == 0) + fprintf(self->dumper.out, "}\n"); else - fprintf(self->dumper.out," *** ERR cannot malloc(%ld) }\n",(long)size); + fprintf(self->dumper.out, " *** ERR cannot malloc(%ld) }\n", (long)size); return; } - fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out, "\n"); - err = grib_unpack_bytes(a,buf,&size); - if(err){ - grib_context_free(d->handle->context,buf); - fprintf(self->dumper.out," *** ERR=%d (%s) [grib_dumper_debug::dump_bytes]\n}",err,grib_get_error_message(err)); - return ; + err = grib_unpack_bytes(a, buf, &size); + if (err) { + grib_context_free(d->handle->context, buf); + fprintf(self->dumper.out, " *** ERR=%d (%s) [grib_dumper_debug::dump_bytes]\n}", err, grib_get_error_message(err)); + return; } - if(size > 100) { + if (size > 100) { more = size - 100; size = 100; } k = 0; /* if(size > 100) size = 100; */ - while(k < size) - { + while (k < size) { int j; - for(i = 0; i < d->depth + 3 ; i++) fprintf(self->dumper.out," "); - for(j = 0; j < 16 && k < size; j++, k++) - { - fprintf(self->dumper.out,"%02x",buf[k]); - if(k != size-1) - fprintf(self->dumper.out,", "); + for (i = 0; i < d->depth + 3; i++) + fprintf(self->dumper.out, " "); + for (j = 0; j < 16 && k < size; j++, k++) { + fprintf(self->dumper.out, "%02x", buf[k]); + if (k != size - 1) + fprintf(self->dumper.out, ", "); } - fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out, "\n"); } - if(more) - { - for(i = 0; i < d->depth + 3 ; i++) fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"... %d more values\n",more); + if (more) { + for (i = 0; i < d->depth + 3; i++) + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "... %d more values\n", more); } - for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"} # %s %s \n",a->creator->op, a->name); - grib_context_free(d->handle->context,buf); + for (i = 0; i < d->depth; i++) + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "} # %s %s \n", a->creator->op, a->name); + grib_context_free(d->handle->context, buf); } -static void dump_values(grib_dumper* d,grib_accessor* a) +static void dump_values(grib_dumper* d, grib_accessor* a) { - grib_dumper_debug *self = (grib_dumper_debug*)d; - int i,k,err =0; - int more = 0; - double* buf = NULL; - size_t size=0; - long count=0; - - if( a->length == 0 && - (d->option_flags & GRIB_DUMP_FLAG_CODED) != 0) + grib_dumper_debug* self = (grib_dumper_debug*)d; + int i, k, err = 0; + int more = 0; + double* buf = NULL; + size_t size = 0; + long count = 0; + + if (a->length == 0 && + (d->option_flags & GRIB_DUMP_FLAG_CODED) != 0) return; - grib_value_count(a,&count); - size=count; - if(size == 1){ - dump_double(d,a,NULL); - return ; + grib_value_count(a, &count); + size = count; + if (size == 1) { + dump_double(d, a, NULL); + return; } - buf = (double*)grib_context_malloc_clear(d->handle->context,size * sizeof(double)); + buf = (double*)grib_context_malloc_clear(d->handle->context, size * sizeof(double)); - set_begin_end(d,a); + set_begin_end(d, a); - for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"%ld-%ld %s %s = (%ld,%ld)",self->begin,self->theEnd,a->creator->op, a->name,(long)size,a->length); - aliases(d,a); - fprintf(self->dumper.out," {"); + for (i = 0; i < d->depth; i++) + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "%ld-%ld %s %s = (%ld,%ld)", self->begin, self->theEnd, a->creator->op, a->name, (long)size, a->length); + aliases(d, a); + fprintf(self->dumper.out, " {"); - if(!buf) { - if(size == 0) - fprintf(self->dumper.out,"}\n"); + if (!buf) { + if (size == 0) + fprintf(self->dumper.out, "}\n"); else - fprintf(self->dumper.out," *** ERR cannot malloc(%ld) }\n",(long)size); + fprintf(self->dumper.out, " *** ERR cannot malloc(%ld) }\n", (long)size); return; } - fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out, "\n"); - err = grib_unpack_double(a,buf,&size); - if(err){ - grib_context_free(d->handle->context,buf); - fprintf(self->dumper.out," *** ERR=%d (%s) [grib_dumper_debug::dump_values]\n}",err,grib_get_error_message(err)); - return ; + err = grib_unpack_double(a, buf, &size); + if (err) { + grib_context_free(d->handle->context, buf); + fprintf(self->dumper.out, " *** ERR=%d (%s) [grib_dumper_debug::dump_values]\n}", err, grib_get_error_message(err)); + return; } - if(size > 100) { + if (size > 100) { more = size - 100; size = 100; } k = 0; - while(k < size) - { + while (k < size) { #if 1 int j; - for(i = 0; i < d->depth + 3 ; i++) fprintf(self->dumper.out," "); - for(j = 0; j < 8 && k < size; j++, k++) - { - fprintf(self->dumper.out,"%10g",buf[k]); - if(k != size-1) - fprintf(self->dumper.out,", "); + for (i = 0; i < d->depth + 3; i++) + fprintf(self->dumper.out, " "); + for (j = 0; j < 8 && k < size; j++, k++) { + fprintf(self->dumper.out, "%10g", buf[k]); + if (k != size - 1) + fprintf(self->dumper.out, ", "); } - fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out, "\n"); #else - fprintf(self->dumper.out,"%d %g\n",k,buf[k]); + fprintf(self->dumper.out, "%d %g\n", k, buf[k]); #endif } - if(more) { - for(i = 0; i < d->depth + 3 ; i++) fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"... %d more values\n",more); + if (more) { + for (i = 0; i < d->depth + 3; i++) + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "... %d more values\n", more); } - for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"} # %s %s \n",a->creator->op, a->name); - grib_context_free(d->handle->context,buf); + for (i = 0; i < d->depth; i++) + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "} # %s %s \n", a->creator->op, a->name); + grib_context_free(d->handle->context, buf); } -static void dump_label(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_label(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_debug *self = (grib_dumper_debug*)d; + grib_dumper_debug* self = (grib_dumper_debug*)d; int i; - for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"----> %s %s %s\n",a->creator->op, a->name,comment?comment:""); + for (i = 0; i < d->depth; i++) + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "----> %s %s %s\n", a->creator->op, a->name, comment ? comment : ""); } -static void dump_section(grib_dumper* d,grib_accessor* a,grib_block_of_accessors* block) +static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block) { - grib_dumper_debug *self = (grib_dumper_debug*)d; + grib_dumper_debug* self = (grib_dumper_debug*)d; int i; /* grib_section* s = grib_get_sub_section(a); */ grib_section* s = a->sub_section; #if 1 - if(a->name[0] == '_'){ - grib_dump_accessors_block(d,block); + if (a->name[0] == '_') { + grib_dump_accessors_block(d, block); return; } #endif - for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"======> %s %s (%ld,%ld,%ld)\n",a->creator->op, - a->name,a->length,(long)s->length,(long)s->padding); - if (!strncmp(a->name,"section",7)) self->section_offset=a->offset; + for (i = 0; i < d->depth; i++) + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "======> %s %s (%ld,%ld,%ld)\n", a->creator->op, + a->name, a->length, (long)s->length, (long)s->padding); + if (!strncmp(a->name, "section", 7)) + self->section_offset = a->offset; /*printf("------------- section_offset = %ld\n",self->section_offset);*/ d->depth += 3; - grib_dump_accessors_block(d,block); + grib_dump_accessors_block(d, block); d->depth -= 3; - for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"<===== %s %s\n",a->creator->op, a->name); + for (i = 0; i < d->depth; i++) + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "<===== %s %s\n", a->creator->op, a->name); } -static void set_begin_end(grib_dumper* d,grib_accessor* a) +static void set_begin_end(grib_dumper* d, grib_accessor* a) { - grib_dumper_debug *self = (grib_dumper_debug*)d; + grib_dumper_debug* self = (grib_dumper_debug*)d; if ((d->option_flags & GRIB_DUMP_FLAG_OCTECT) != 0) { - - self->begin=a->offset-self->section_offset+1; - self->theEnd=grib_get_next_position_offset(a)-self->section_offset; - } else { - self->begin=a->offset; - self->theEnd=grib_get_next_position_offset(a); + self->begin = a->offset - self->section_offset + 1; + self->theEnd = grib_get_next_position_offset(a) - self->section_offset; + } + else { + self->begin = a->offset; + self->theEnd = grib_get_next_position_offset(a); } } diff --git a/src/grib_dumper_class_default.c b/src/grib_dumper_class_default.c index 44a8b0233..4030d503e 100644 --- a/src/grib_dumper_class_default.c +++ b/src/grib_dumper_class_default.c @@ -43,413 +43,431 @@ or edit "dumper.class" and rerun ./make_class.pl */ -static void init_class (grib_dumper_class*); -static int init (grib_dumper* d); -static int destroy (grib_dumper*); -static void dump_long (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_bits (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_double (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_string (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_string_array (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_bytes (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_values (grib_dumper* d, grib_accessor* a); -static void dump_label (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_section (grib_dumper* d, grib_accessor* a,grib_block_of_accessors* block); - -typedef struct grib_dumper_default { - grib_dumper dumper; -/* Members defined in default */ - long section_offset; - long begin; - long theEnd; +static void init_class(grib_dumper_class*); +static int init(grib_dumper* d); +static int destroy(grib_dumper*); +static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_bits(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_values(grib_dumper* d, grib_accessor* a); +static void dump_label(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block); + +typedef struct grib_dumper_default +{ + grib_dumper dumper; + /* Members defined in default */ + long section_offset; + long begin; + long theEnd; } grib_dumper_default; static grib_dumper_class _grib_dumper_class_default = { - 0, /* super */ - "default", /* name */ - sizeof(grib_dumper_default), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - &destroy, /* free mem */ - &dump_long, /* dump long */ - &dump_double, /* dump double */ - &dump_string, /* dump string */ - &dump_string_array, /* dump string array */ - &dump_label, /* dump labels */ - &dump_bytes, /* dump bytes */ - &dump_bits, /* dump bits */ - &dump_section, /* dump section */ - &dump_values, /* dump values */ - 0, /* header */ - 0, /* footer */ + 0, /* super */ + "default", /* name */ + sizeof(grib_dumper_default), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + &destroy, /* free mem */ + &dump_long, /* dump long */ + &dump_double, /* dump double */ + &dump_string, /* dump string */ + &dump_string_array, /* dump string array */ + &dump_label, /* dump labels */ + &dump_bytes, /* dump bytes */ + &dump_bits, /* dump bits */ + &dump_section, /* dump section */ + &dump_values, /* dump values */ + 0, /* header */ + 0, /* footer */ }; grib_dumper_class* grib_dumper_class_default = &_grib_dumper_class_default; /* END_CLASS_IMP */ -static void print_offset(FILE* out,grib_dumper* d,grib_accessor* a); +static void print_offset(FILE* out, grib_dumper* d, grib_accessor* a); -static void init_class (grib_dumper_class* c){} +static void init_class(grib_dumper_class* c) {} -static int init(grib_dumper* d) +static int init(grib_dumper* d) { - grib_dumper_default *self = (grib_dumper_default*)d; - self->section_offset=0; + grib_dumper_default* self = (grib_dumper_default*)d; + self->section_offset = 0; return GRIB_SUCCESS; } -static int destroy (grib_dumper* d){ +static int destroy(grib_dumper* d) +{ return GRIB_SUCCESS; } -static void aliases(grib_dumper* d,grib_accessor* a) +static void aliases(grib_dumper* d, grib_accessor* a) { int i; - grib_dumper_default *self = (grib_dumper_default*)d; + grib_dumper_default* self = (grib_dumper_default*)d; - if( (d->option_flags & GRIB_DUMP_FLAG_ALIASES) == 0) + if ((d->option_flags & GRIB_DUMP_FLAG_ALIASES) == 0) return; - if(a->all_names[1]) - { - char *sep = ""; - fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"# ALIASES: "); + if (a->all_names[1]) { + char* sep = ""; + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "# ALIASES: "); - for(i = 1; i < MAX_ACCESSOR_NAMES; i++) - { - if(a->all_names[i]) - { - if(a->all_name_spaces[i]) - fprintf(self->dumper.out,"%s%s.%s", sep,a->all_name_spaces[i],a->all_names[i]); + for (i = 1; i < MAX_ACCESSOR_NAMES; i++) { + if (a->all_names[i]) { + if (a->all_name_spaces[i]) + fprintf(self->dumper.out, "%s%s.%s", sep, a->all_name_spaces[i], a->all_names[i]); else - fprintf(self->dumper.out,"%s%s", sep,a->all_names[i]); + fprintf(self->dumper.out, "%s%s", sep, a->all_names[i]); } sep = ", "; } - fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out, "\n"); } } -static void dump_long(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_default *self = (grib_dumper_default*)d; - long value=0; size_t size = 1; - long *values=NULL; - int err = 0; + grib_dumper_default* self = (grib_dumper_default*)d; + long value = 0; + size_t size = 1; + long* values = NULL; + int err = 0; int i; - long count=0; + long count = 0; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - print_offset(self->dumper.out,d,a); + print_offset(self->dumper.out, d, a); - if ((d->option_flags & GRIB_DUMP_FLAG_TYPE) != 0){ - fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"# type %s (int)\n",a->creator->op); + if ((d->option_flags & GRIB_DUMP_FLAG_TYPE) != 0) { + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "# type %s (int)\n", a->creator->op); } - if (size>1) { - values=(long *)grib_context_malloc_clear(a->context,sizeof(long)*size); - err=grib_unpack_long(a,values,&size); - } else { - err=grib_unpack_long(a,&value,&size); + if (size > 1) { + values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); + err = grib_unpack_long(a, values, &size); + } + else { + err = grib_unpack_long(a, &value, &size); } - aliases(d,a); - if(comment) { - fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"# %s \n",comment); + aliases(d, a); + if (comment) { + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "# %s \n", comment); } if (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) { - fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"#-READ ONLY- "); - } else - fprintf(self->dumper.out," "); - - if (size>1) { - int cols=19; - int icount=0; - fprintf(self->dumper.out,"%s = { \t",a->name); - for (i=0;icols) {fprintf(self->dumper.out,"\n\t\t\t\t");icount=0;} - fprintf(self->dumper.out,"%ld ",values[i]); + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "#-READ ONLY- "); + } + else + fprintf(self->dumper.out, " "); + + if (size > 1) { + int cols = 19; + int icount = 0; + fprintf(self->dumper.out, "%s = { \t", a->name); + for (i = 0; i < size; i++) { + if (icount > cols) { + fprintf(self->dumper.out, "\n\t\t\t\t"); + icount = 0; + } + fprintf(self->dumper.out, "%ld ", values[i]); icount++; } - fprintf(self->dumper.out,"}\n"); - grib_context_free(a->context,values); - } else { - if( ((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && grib_is_missing_internal(a) ) - fprintf(self->dumper.out,"%s = MISSING;",a->name); + fprintf(self->dumper.out, "}\n"); + grib_context_free(a->context, values); + } + else { + if (((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && grib_is_missing_internal(a)) + fprintf(self->dumper.out, "%s = MISSING;", a->name); else - fprintf(self->dumper.out,"%s = %ld;",a->name,value); + fprintf(self->dumper.out, "%s = %ld;", a->name, value); } - if(err) { - fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"# *** ERR=%d (%s) [grib_dumper_default::dump_long]",err,grib_get_error_message(err)); + if (err) { + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "# *** ERR=%d (%s) [grib_dumper_default::dump_long]", err, grib_get_error_message(err)); } - fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out, "\n"); } -static int test_bit(long a, long b) {return a&(1<flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) + case GRIB_TYPE_LONG: + grib_unpack_long(a, &lvalue, &size); + break; + case GRIB_TYPE_DOUBLE: + grib_unpack_double(a, &dvalue, &size); + isDouble = 1; + break; + default: + break; + } + + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - print_offset(self->dumper.out,d,a); + print_offset(self->dumper.out, d, a); if ((d->option_flags & GRIB_DUMP_FLAG_TYPE) != 0) { - fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"# type %s \n",a->creator->op); + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "# type %s \n", a->creator->op); } - aliases(d,a); - if(comment) { - fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"# %s \n",comment); + aliases(d, a); + if (comment) { + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "# %s \n", comment); } - fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"# flags: "); - for(i=0;i<(a->length*8);i++) { - if(test_bit(lvalue,a->length*8-i-1)) - fprintf(self->dumper.out,"1"); + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "# flags: "); + for (i = 0; i < (a->length * 8); i++) { + if (test_bit(lvalue, a->length * 8 - i - 1)) + fprintf(self->dumper.out, "1"); else - fprintf(self->dumper.out,"0"); + fprintf(self->dumper.out, "0"); } - fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out, "\n"); if (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) { - fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"#-READ ONLY- "); - } else - fprintf(self->dumper.out," "); + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "#-READ ONLY- "); + } + else + fprintf(self->dumper.out, " "); - if( ((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && grib_is_missing_internal(a) ) - fprintf(self->dumper.out,"%s = MISSING;",a->name); + if (((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && grib_is_missing_internal(a)) + fprintf(self->dumper.out, "%s = MISSING;", a->name); else { if (isDouble) - fprintf(self->dumper.out,"%s = %g;",a->name,dvalue); + fprintf(self->dumper.out, "%s = %g;", a->name, dvalue); else - fprintf(self->dumper.out,"%s = %ld;",a->name,lvalue); + fprintf(self->dumper.out, "%s = %ld;", a->name, lvalue); } - if(err) { - fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"# *** ERR=%d (%s) [grib_dumper_default::dump_bits]",err,grib_get_error_message(err)); + if (err) { + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "# *** ERR=%d (%s) [grib_dumper_default::dump_bits]", err, grib_get_error_message(err)); } - fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out, "\n"); } -static void dump_double(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_default *self = (grib_dumper_default*)d; - double value=0; size_t size = 1; - int err = grib_unpack_double(a,&value,&size); + grib_dumper_default* self = (grib_dumper_default*)d; + double value = 0; + size_t size = 1; + int err = grib_unpack_double(a, &value, &size); - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - print_offset(self->dumper.out,d,a); + print_offset(self->dumper.out, d, a); if ((d->option_flags & GRIB_DUMP_FLAG_TYPE) != 0) { - fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"# type %s (double)\n",a->creator->op); + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "# type %s (double)\n", a->creator->op); } - aliases(d,a); - if(comment) { - fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"# %s \n",comment); + aliases(d, a); + if (comment) { + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "# %s \n", comment); } if (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) { - fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"#-READ ONLY- "); - } else - fprintf(self->dumper.out," "); + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "#-READ ONLY- "); + } + else + fprintf(self->dumper.out, " "); - if( ((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && grib_is_missing_internal(a) ) - fprintf(self->dumper.out,"%s = MISSING;",a->name); + if (((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && grib_is_missing_internal(a)) + fprintf(self->dumper.out, "%s = MISSING;", a->name); else - fprintf(self->dumper.out,"%s = %g;",a->name,value); + fprintf(self->dumper.out, "%s = %g;", a->name, value); - if(err) { - fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"# *** ERR=%d (%s) [grib_dumper_default::dump_double]",err,grib_get_error_message(err)); + if (err) { + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "# *** ERR=%d (%s) [grib_dumper_default::dump_double]", err, grib_get_error_message(err)); } - fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out, "\n"); } -static void dump_string_array(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_default *self = (grib_dumper_default*)d; - char **values; - size_t size = 0,i=0; - grib_context* c=NULL; - int err = 0; - int tab=0; - long count=0; - - c=a->context; - - grib_value_count(a,&count); - size=count; - if (size==1) { - dump_string(d,a,comment); + grib_dumper_default* self = (grib_dumper_default*)d; + char** values; + size_t size = 0, i = 0; + grib_context* c = NULL; + int err = 0; + int tab = 0; + long count = 0; + + c = a->context; + + grib_value_count(a, &count); + size = count; + if (size == 1) { + dump_string(d, a, comment); return; } - values=(char**)grib_context_malloc_clear(c,size*sizeof(char*)); + values = (char**)grib_context_malloc_clear(c, size * sizeof(char*)); if (!values) { - grib_context_log(c,GRIB_LOG_FATAL,"unable to allocate %d bytes",(int)size); + grib_context_log(c, GRIB_LOG_FATAL, "unable to allocate %d bytes", (int)size); return; } - err = grib_unpack_string_array(a,values,&size); + err = grib_unpack_string_array(a, values, &size); - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - print_offset(self->dumper.out,d,a); + print_offset(self->dumper.out, d, a); if ((d->option_flags & GRIB_DUMP_FLAG_TYPE) != 0) { - fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"# type %s (str)\n",a->creator->op); + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "# type %s (str)\n", a->creator->op); } - aliases(d,a); - if(comment) { - fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"# %s \n",comment); + aliases(d, a); + if (comment) { + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "# %s \n", comment); } if (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) { - fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"#-READ ONLY- "); - tab=13; - } else - fprintf(self->dumper.out," "); + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "#-READ ONLY- "); + tab = 13; + } + else + fprintf(self->dumper.out, " "); tab++; - fprintf(self->dumper.out,"%s = {\n",a->name); - for (i=0;idumper.out,"%-*s\"%s\",\n",(int)(tab+strlen(a->name)+4)," ",values[i]); + fprintf(self->dumper.out, "%s = {\n", a->name); + for (i = 0; i < size; i++) { + fprintf(self->dumper.out, "%-*s\"%s\",\n", (int)(tab + strlen(a->name) + 4), " ", values[i]); } - fprintf(self->dumper.out," }"); + fprintf(self->dumper.out, " }"); - if(err) { - fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"# *** ERR=%d (%s)",err,grib_get_error_message(err)); + if (err) { + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "# *** ERR=%d (%s)", err, grib_get_error_message(err)); } - fprintf(self->dumper.out,"\n"); - grib_context_free(c,values); + fprintf(self->dumper.out, "\n"); + grib_context_free(c, values); } -static void dump_string(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_default *self = (grib_dumper_default*)d; - char *value=NULL; - char *p = NULL; - size_t size = 0; - grib_context* c=NULL; - int err = _grib_get_string_length(a,&size); - - c=a->context; - if (size==0) return; + grib_dumper_default* self = (grib_dumper_default*)d; + char* value = NULL; + char* p = NULL; + size_t size = 0; + grib_context* c = NULL; + int err = _grib_get_string_length(a, &size); + + c = a->context; + if (size == 0) + return; - value=(char*)grib_context_malloc_clear(c,size); + value = (char*)grib_context_malloc_clear(c, size); if (!value) { - grib_context_log(c,GRIB_LOG_FATAL,"unable to allocate %d bytes",(int)size); + grib_context_log(c, GRIB_LOG_FATAL, "unable to allocate %d bytes", (int)size); return; } - err = grib_unpack_string(a,value,&size); - p=value; + err = grib_unpack_string(a, value, &size); + p = value; - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) { - grib_context_free(c,value); + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) { + grib_context_free(c, value); return; } - while(*p) { if(!isprint(*p)) *p = '.'; p++; } + while (*p) { + if (!isprint(*p)) + *p = '.'; + p++; + } - print_offset(self->dumper.out,d,a); + print_offset(self->dumper.out, d, a); if ((d->option_flags & GRIB_DUMP_FLAG_TYPE) != 0) { - fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"# type %s (str)\n",a->creator->op); + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "# type %s (str)\n", a->creator->op); } - aliases(d,a); - if(comment) { - fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"# %s \n",comment); + aliases(d, a); + if (comment) { + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "# %s \n", comment); } if (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) { - fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"#-READ ONLY- "); - } else - fprintf(self->dumper.out," "); + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "#-READ ONLY- "); + } + else + fprintf(self->dumper.out, " "); - if( ((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && grib_is_missing_internal(a) ) - fprintf(self->dumper.out,"%s = MISSING;",a->name); + if (((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && grib_is_missing_internal(a)) + fprintf(self->dumper.out, "%s = MISSING;", a->name); else - fprintf(self->dumper.out,"%s = %s;",a->name,value); + fprintf(self->dumper.out, "%s = %s;", a->name, value); - if(err) { - fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"# *** ERR=%d (%s) [grib_dumper_default::dump_string]",err,grib_get_error_message(err)); + if (err) { + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "# *** ERR=%d (%s) [grib_dumper_default::dump_string]", err, grib_get_error_message(err)); } - fprintf(self->dumper.out,"\n"); - grib_context_free(c,value); + fprintf(self->dumper.out, "\n"); + grib_context_free(c, value); } -static void dump_bytes(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment) { - #if 0 grib_dumper_default *self = (grib_dumper_default*)d; int i,k,err =0; @@ -523,103 +541,106 @@ static void dump_bytes(grib_dumper* d,grib_accessor* a,const char* comment) #endif } -static void dump_values(grib_dumper* d,grib_accessor* a) +static void dump_values(grib_dumper* d, grib_accessor* a) { - grib_dumper_default *self = (grib_dumper_default*)d; - int k,err =0; - int more = 0; + grib_dumper_default* self = (grib_dumper_default*)d; + int k, err = 0; + int more = 0; double* buf = NULL; - size_t size=0; - long count=0; + size_t size = 0; + long count = 0; - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - grib_value_count(a,&count); - size=count; - if(size == 1){ - dump_double(d,a,NULL); - return ; + grib_value_count(a, &count); + size = count; + if (size == 1) { + dump_double(d, a, NULL); + return; } - buf = (double*)grib_context_malloc(d->handle->context,size * sizeof(double)); + buf = (double*)grib_context_malloc(d->handle->context, size * sizeof(double)); - print_offset(self->dumper.out,d,a); + print_offset(self->dumper.out, d, a); if ((d->option_flags & GRIB_DUMP_FLAG_TYPE) != 0) { - char type_name[32]=""; + char type_name[32] = ""; const long native_type = grib_accessor_get_native_type(a); - if (native_type == GRIB_TYPE_LONG) strcpy(type_name, "(int)"); - else if (native_type == GRIB_TYPE_DOUBLE) strcpy(type_name, "(double)"); - else if (native_type == GRIB_TYPE_STRING) strcpy(type_name, "(str)"); - fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"# type %s %s\n",a->creator->op, type_name); + if (native_type == GRIB_TYPE_LONG) + strcpy(type_name, "(int)"); + else if (native_type == GRIB_TYPE_DOUBLE) + strcpy(type_name, "(double)"); + else if (native_type == GRIB_TYPE_STRING) + strcpy(type_name, "(str)"); + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "# type %s %s\n", a->creator->op, type_name); } - aliases(d,a); + aliases(d, a); if (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) { - fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"#-READ ONLY- "); - } else - fprintf(self->dumper.out," "); + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "#-READ ONLY- "); + } + else + fprintf(self->dumper.out, " "); - fprintf(self->dumper.out,"%s(%ld) = ",a->name,(long)size); - aliases(d,a); - fprintf(self->dumper.out," {"); + fprintf(self->dumper.out, "%s(%ld) = ", a->name, (long)size); + aliases(d, a); + fprintf(self->dumper.out, " {"); - if(!buf) - { - if(size == 0) - fprintf(self->dumper.out,"}\n"); + if (!buf) { + if (size == 0) + fprintf(self->dumper.out, "}\n"); else - fprintf(self->dumper.out," *** ERR cannot malloc(%ld) }\n",(long)size); + fprintf(self->dumper.out, " *** ERR cannot malloc(%ld) }\n", (long)size); return; } - fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out, "\n"); - err = grib_unpack_double(a,buf,&size); + err = grib_unpack_double(a, buf, &size); - if(err){ - grib_context_free(d->handle->context,buf); - fprintf(self->dumper.out," *** ERR=%d (%s) [grib_dumper_default::dump_values]\n}",err,grib_get_error_message(err)); - return ; + if (err) { + grib_context_free(d->handle->context, buf); + fprintf(self->dumper.out, " *** ERR=%d (%s) [grib_dumper_default::dump_values]\n}", err, grib_get_error_message(err)); + return; } - if(!(d->option_flags & GRIB_DUMP_FLAG_ALL_DATA) && size > 100) { + if (!(d->option_flags & GRIB_DUMP_FLAG_ALL_DATA) && size > 100) { more = size - 100; size = 100; } k = 0; - while(k < size) { + while (k < size) { #if 1 int j; - fprintf(self->dumper.out," "); - for(j = 0; j < 5 && k < size; j++, k++) { - fprintf(self->dumper.out,"%g",buf[k]); - if(k != size-1) - fprintf(self->dumper.out,", "); + fprintf(self->dumper.out, " "); + for (j = 0; j < 5 && k < size; j++, k++) { + fprintf(self->dumper.out, "%g", buf[k]); + if (k != size - 1) + fprintf(self->dumper.out, ", "); } - fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out, "\n"); #else - fprintf(self->dumper.out,"%d %g\n",k,buf[k]); + fprintf(self->dumper.out, "%d %g\n", k, buf[k]); #endif - - } if(more) { - fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"... %d more values\n",more); + } + if (more) { + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "... %d more values\n", more); } - fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"} \n"); - grib_context_free(d->handle->context,buf); + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "} \n"); + grib_context_free(d->handle->context, buf); } -static void dump_label(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_label(grib_dumper* d, grib_accessor* a, const char* comment) { /*grib_dumper_default *self = (grib_dumper_default*)d; @@ -627,87 +648,92 @@ static void dump_label(grib_dumper* d,grib_accessor* a,const char* comment) fprintf(self->dumper.out,"----> %s %s %s\n",a->creator->op, a->name,comment?comment:"");*/ } -static void dump_section(grib_dumper* d,grib_accessor* a,grib_block_of_accessors* block) +static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block) { - grib_dumper_default *self = (grib_dumper_default*)d; - grib_section* s = a->sub_section; - int is_default_section=0; - char* upper=NULL; + grib_dumper_default* self = (grib_dumper_default*)d; + grib_section* s = a->sub_section; + int is_default_section = 0; + char* upper = NULL; char tmp[512]; - char *p=NULL,*q=NULL; - if (!strncmp(a->name,"section",7)) is_default_section=1; - if (!strcmp(a->creator->op,"bufr_group")) { dump_long(d,a,NULL); } + char *p = NULL, *q = NULL; + if (!strncmp(a->name, "section", 7)) + is_default_section = 1; + if (!strcmp(a->creator->op, "bufr_group")) { + dump_long(d, a, NULL); + } /*for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," ");*/ if (is_default_section) { - upper=(char*)malloc(strlen(a->name)+1); + upper = (char*)malloc(strlen(a->name) + 1); Assert(upper); - p=(char*)a->name; - q=upper; + p = (char*)a->name; + q = upper; while (*p != '\0') { - *q=toupper(*p); + *q = toupper(*p); q++; p++; } - *q='\0'; + *q = '\0'; - sprintf(tmp,"%s ( length=%ld, padding=%ld )",upper,(long)s->length,(long)s->padding); + sprintf(tmp, "%s ( length=%ld, padding=%ld )", upper, (long)s->length, (long)s->padding); /* fprintf(self->dumper.out,"#============== %-38s ==============\n",tmp); */ free(upper); - self->section_offset=a->offset; + self->section_offset = a->offset; } /*printf("------------- section_offset = %ld\n",self->section_offset);*/ d->depth += 3; - grib_dump_accessors_block(d,block); + grib_dump_accessors_block(d, block); d->depth -= 3; /*for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," ");*/ /*fprintf(self->dumper.out,"<===== %s %s\n",a->creator->op, a->name);*/ } -static void print_offset(FILE* out,grib_dumper* d,grib_accessor* a) { - int i,k; +static void print_offset(FILE* out, grib_dumper* d, grib_accessor* a) +{ + int i, k; long offset; - long theBegin=0,theEnd=0; - size_t size=0,more=0; - grib_dumper_default *self = (grib_dumper_default*)d; - grib_handle* h=grib_handle_of_accessor(a); + long theBegin = 0, theEnd = 0; + size_t size = 0, more = 0; + grib_dumper_default* self = (grib_dumper_default*)d; + grib_handle* h = grib_handle_of_accessor(a); - theBegin=a->offset-self->section_offset+1;; - theEnd =grib_get_next_position_offset(a)-self->section_offset; + theBegin = a->offset - self->section_offset + 1; + theEnd = grib_get_next_position_offset(a) - self->section_offset; if ((d->option_flags & GRIB_DUMP_FLAG_HEXADECIMAL) != 0 && a->length != 0) { if (theBegin == theEnd) { - fprintf(self->dumper.out," "); - fprintf(out,"# Octet: "); - fprintf(out,"%ld" ,theBegin); + fprintf(self->dumper.out, " "); + fprintf(out, "# Octet: "); + fprintf(out, "%ld", theBegin); } else { - fprintf(self->dumper.out," "); - fprintf(out,"# Octets: "); - fprintf(out,"%ld-%ld" ,theBegin,theEnd); + fprintf(self->dumper.out, " "); + fprintf(out, "# Octets: "); + fprintf(out, "%ld-%ld", theBegin, theEnd); } - fprintf(out," = "); - size=a->length; + fprintf(out, " = "); + size = a->length; - if(!(d->option_flags & GRIB_DUMP_FLAG_ALL_DATA) && size > 112) { + if (!(d->option_flags & GRIB_DUMP_FLAG_ALL_DATA) && size > 112) { more = size - 112; size = 112; } k = 0; - while(k < size) { - offset=a->offset; - for (i=0;i<14 && kbuffer->data[offset]); + while (k < size) { + offset = a->offset; + for (i = 0; i < 14 && k < size; i++, k++) { + fprintf(out, " 0x%.2X", h->buffer->data[offset]); offset++; } - if (kdumper.out,"\n #"); - } if(more) { - fprintf(self->dumper.out,"\n #... %d more values\n",(int)more); + if (k < size) + fprintf(self->dumper.out, "\n #"); } - fprintf(self->dumper.out,"\n"); - + if (more) { + fprintf(self->dumper.out, "\n #... %d more values\n", (int)more); + } + fprintf(self->dumper.out, "\n"); } } diff --git a/src/grib_dumper_class_grib_encode_C.c b/src/grib_dumper_class_grib_encode_C.c index 110cf74ae..e8f88d8ba 100644 --- a/src/grib_dumper_class_grib_encode_C.c +++ b/src/grib_dumper_class_grib_encode_C.c @@ -37,236 +37,243 @@ or edit "dumper.class" and rerun ./make_class.pl */ -static void init_class (grib_dumper_class*); -static int init (grib_dumper* d); -static int destroy (grib_dumper*); -static void dump_long (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_bits (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_double (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_string (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_bytes (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_values (grib_dumper* d, grib_accessor* a); -static void dump_label (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_section (grib_dumper* d, grib_accessor* a,grib_block_of_accessors* block); -static void header (grib_dumper*,grib_handle*); -static void footer (grib_dumper*,grib_handle*); - -typedef struct grib_dumper_grib_encode_C { - grib_dumper dumper; -/* Members defined in grib_encode_C */ - int cr; +static void init_class(grib_dumper_class*); +static int init(grib_dumper* d); +static int destroy(grib_dumper*); +static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_bits(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_values(grib_dumper* d, grib_accessor* a); +static void dump_label(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block); +static void header(grib_dumper*, grib_handle*); +static void footer(grib_dumper*, grib_handle*); + +typedef struct grib_dumper_grib_encode_C +{ + grib_dumper dumper; + /* Members defined in grib_encode_C */ + int cr; } grib_dumper_grib_encode_C; static grib_dumper_class _grib_dumper_class_grib_encode_C = { - 0, /* super */ - "grib_encode_C", /* name */ - sizeof(grib_dumper_grib_encode_C), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - &destroy, /* free mem */ - &dump_long, /* dump long */ - &dump_double, /* dump double */ - &dump_string, /* dump string */ - 0, /* dump string array */ - &dump_label, /* dump labels */ - &dump_bytes, /* dump bytes */ - &dump_bits, /* dump bits */ - &dump_section, /* dump section */ - &dump_values, /* dump values */ - &header, /* header */ - &footer, /* footer */ + 0, /* super */ + "grib_encode_C", /* name */ + sizeof(grib_dumper_grib_encode_C), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + &destroy, /* free mem */ + &dump_long, /* dump long */ + &dump_double, /* dump double */ + &dump_string, /* dump string */ + 0, /* dump string array */ + &dump_label, /* dump labels */ + &dump_bytes, /* dump bytes */ + &dump_bits, /* dump bits */ + &dump_section, /* dump section */ + &dump_values, /* dump values */ + &header, /* header */ + &footer, /* footer */ }; grib_dumper_class* grib_dumper_class_grib_encode_C = &_grib_dumper_class_grib_encode_C; /* END_CLASS_IMP */ -static void init_class (grib_dumper_class* c){} +static void init_class(grib_dumper_class* c) {} -static int init(grib_dumper* d) +static int init(grib_dumper* d) { /* grib_dumper_grib_encode_C *self = (grib_dumper_grib_encode_C*)d; */ return GRIB_SUCCESS; } -static int destroy (grib_dumper* d){ +static int destroy(grib_dumper* d) +{ return GRIB_SUCCESS; } -static void pcomment(FILE* f,long value,const char* p) +static void pcomment(FILE* f, long value, const char* p) { int cr = 0; - fprintf(f,"\n /* %ld = ",value); - - while(*p) - { - switch(*p) - { - case ';': - fprintf(f,"\n "); - cr = 1; - break; - - case ':': - if(cr) - fprintf(f,"\n See "); - else - fprintf(f,". See "); - break; - - default: - fputc(*p,f); - break; + fprintf(f, "\n /* %ld = ", value); + + while (*p) { + switch (*p) { + case ';': + fprintf(f, "\n "); + cr = 1; + break; + + case ':': + if (cr) + fprintf(f, "\n See "); + else + fprintf(f, ". See "); + break; + + default: + fputc(*p, f); + break; } p++; } - fprintf(f," */\n"); - + fprintf(f, " */\n"); } -static void dump_long(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_grib_encode_C *self = (grib_dumper_grib_encode_C*)d; - long value; size_t size = 1; - int err = grib_unpack_long(a,&value,&size); + grib_dumper_grib_encode_C* self = (grib_dumper_grib_encode_C*)d; + long value; + size_t size = 1; + int err = grib_unpack_long(a, &value, &size); - if((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY)) + if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY)) return; #if 1 - if(comment) pcomment(self->dumper.out,value,comment); + if (comment) + pcomment(self->dumper.out, value, comment); #endif - if( ((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && (value == GRIB_MISSING_LONG)) - fprintf(self->dumper.out," GRIB_CHECK(grib_set_missing(h,\"%s\"),%d);\n",a->name,0); + if (((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && (value == GRIB_MISSING_LONG)) + fprintf(self->dumper.out, " GRIB_CHECK(grib_set_missing(h,\"%s\"),%d);\n", a->name, 0); else - fprintf(self->dumper.out," GRIB_CHECK(grib_set_long(h,\"%s\",%ld),%d);\n",a->name,value,0); + fprintf(self->dumper.out, " GRIB_CHECK(grib_set_long(h,\"%s\",%ld),%d);\n", a->name, value, 0); - if(err) - fprintf(self->dumper.out," /* Error accessing %s (%s) */",a->name,grib_get_error_message(err)); - - if(comment) fprintf(self->dumper.out,"\n"); + if (err) + fprintf(self->dumper.out, " /* Error accessing %s (%s) */", a->name, grib_get_error_message(err)); + if (comment) + fprintf(self->dumper.out, "\n"); } -static int test_bit(long a, long b) {return a&(1<flags & GRIB_ACCESSOR_FLAG_READ_ONLY) + if (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) return; - if(a->length == 0) + if (a->length == 0) return; buf[0] = 0; - for(i=0;i<(a->length*8);i++) { - if(test_bit(value,a->length*8-i-1)) - strcat(buf,"1"); + for (i = 0; i < (a->length * 8); i++) { + if (test_bit(value, a->length * 8 - i - 1)) + strcat(buf, "1"); else - strcat(buf,"0"); + strcat(buf, "0"); } - if(comment) { - strcat(buf,";"); - strcat(buf,comment); + if (comment) { + strcat(buf, ";"); + strcat(buf, comment); } - pcomment(self->dumper.out,value,buf); + pcomment(self->dumper.out, value, buf); - if(err) - fprintf(self->dumper.out," /* Error accessing %s (%s) */",a->name,grib_get_error_message(err)); + if (err) + fprintf(self->dumper.out, " /* Error accessing %s (%s) */", a->name, grib_get_error_message(err)); else - fprintf(self->dumper.out," GRIB_CHECK(grib_set_long(h,\"%s\",%ld),%d);\n",a->name,value,0); + fprintf(self->dumper.out, " GRIB_CHECK(grib_set_long(h,\"%s\",%ld),%d);\n", a->name, value, 0); - fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out, "\n"); } -static void dump_double(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_grib_encode_C *self = (grib_dumper_grib_encode_C*)d; - double value; size_t size = 1; - int err = grib_unpack_double(a,&value,&size); - if(a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) + grib_dumper_grib_encode_C* self = (grib_dumper_grib_encode_C*)d; + double value; + size_t size = 1; + int err = grib_unpack_double(a, &value, &size); + if (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) return; - if(a->length == 0) + if (a->length == 0) return; #if 0 if(comment) fprintf(self->dumper.out,"/* %s */\n",comment); #endif - fprintf(self->dumper.out," GRIB_CHECK(grib_set_double(h,\"%s\",%g),%d);\n",a->name,value,0); + fprintf(self->dumper.out, " GRIB_CHECK(grib_set_double(h,\"%s\",%g),%d);\n", a->name, value, 0); - if(err) - fprintf(self->dumper.out," /* Error accessing %s (%s) */",a->name,grib_get_error_message(err)); + if (err) + fprintf(self->dumper.out, " /* Error accessing %s (%s) */", a->name, grib_get_error_message(err)); } -static void dump_string(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_grib_encode_C *self = (grib_dumper_grib_encode_C*)d; - char value[1024]; size_t size = sizeof(value); - int err = grib_unpack_string(a,value,&size); + grib_dumper_grib_encode_C* self = (grib_dumper_grib_encode_C*)d; + char value[1024]; + size_t size = sizeof(value); + int err = grib_unpack_string(a, value, &size); if (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) return; - if(a->length == 0) + if (a->length == 0) return; #if 1 - if(comment) fprintf(self->dumper.out,"/* %s */\n",comment); + if (comment) + fprintf(self->dumper.out, "/* %s */\n", comment); #endif - fprintf(self->dumper.out," p = \"%s\";\n",value); - fprintf(self->dumper.out," size = strlen(p);\n"); - fprintf(self->dumper.out," GRIB_CHECK(grib_set_string(h,\"%s\",p,&size),%d);\n",a->name,0); + fprintf(self->dumper.out, " p = \"%s\";\n", value); + fprintf(self->dumper.out, " size = strlen(p);\n"); + fprintf(self->dumper.out, " GRIB_CHECK(grib_set_string(h,\"%s\",p,&size),%d);\n", a->name, 0); - if(err) - fprintf(self->dumper.out," /* Error accessing %s (%s) */",a->name,grib_get_error_message(err)); + if (err) + fprintf(self->dumper.out, " /* Error accessing %s (%s) */", a->name, grib_get_error_message(err)); } -static void dump_bytes(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_grib_encode_C *self = (grib_dumper_grib_encode_C*)d; - int err =0; - size_t size = a->length; + grib_dumper_grib_encode_C* self = (grib_dumper_grib_encode_C*)d; + int err = 0; + size_t size = a->length; unsigned char* buf; if (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) return; - if(size == 0) + if (size == 0) return; - buf = (unsigned char*)grib_context_malloc(d->handle->context,size); + buf = (unsigned char*)grib_context_malloc(d->handle->context, size); - if(!buf) - { - fprintf(self->dumper.out,"/* %s: cannot malloc(%ld) */\n",a->name,(long)size); + if (!buf) { + fprintf(self->dumper.out, "/* %s: cannot malloc(%ld) */\n", a->name, (long)size); return; } - err = grib_unpack_bytes(a,buf,&size); - if(err){ - grib_context_free(d->handle->context,buf); - fprintf(self->dumper.out," *** ERR=%d (%s) [grib_dumper_grib_encode_C::dump_bytes]\n}",err,grib_get_error_message(err)); - return ; + err = grib_unpack_bytes(a, buf, &size); + if (err) { + grib_context_free(d->handle->context, buf); + fprintf(self->dumper.out, " *** ERR=%d (%s) [grib_dumper_grib_encode_C::dump_bytes]\n}", err, grib_get_error_message(err)); + return; } #if 0 @@ -290,106 +297,103 @@ static void dump_bytes(grib_dumper* d,grib_accessor* a,const char* comment) fprintf(self->dumper.out,"\n"); } #endif - grib_context_free(d->handle->context,buf); + grib_context_free(d->handle->context, buf); } -static void dump_values(grib_dumper* d,grib_accessor* a) +static void dump_values(grib_dumper* d, grib_accessor* a) { - grib_dumper_grib_encode_C *self = (grib_dumper_grib_encode_C*)d; - int k,err =0; - double* buf = NULL; - int type=0; + grib_dumper_grib_encode_C* self = (grib_dumper_grib_encode_C*)d; + int k, err = 0; + double* buf = NULL; + int type = 0; char stype[10]; - size_t size=0; - long count=0; + size_t size = 0; + long count = 0; - stype[0]='\0'; + stype[0] = '\0'; - if((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) - || ((a->flags & GRIB_ACCESSOR_FLAG_DATA) - && (d->option_flags & GRIB_DUMP_FLAG_NO_DATA) ) ) + if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) || ((a->flags & GRIB_ACCESSOR_FLAG_DATA) && (d->option_flags & GRIB_DUMP_FLAG_NO_DATA))) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; - if(size == 1){ - dump_double(d,a,NULL); - return ; + if (size == 1) { + dump_double(d, a, NULL); + return; } - type=grib_accessor_get_native_type(a); + type = grib_accessor_get_native_type(a); switch (type) { - case GRIB_TYPE_LONG: - sprintf(stype,"%s","long"); - break; - case GRIB_TYPE_DOUBLE: - sprintf(stype,"%s","double"); - break; - default: - return; + case GRIB_TYPE_LONG: + sprintf(stype, "%s", "long"); + break; + case GRIB_TYPE_DOUBLE: + sprintf(stype, "%s", "double"); + break; + default: + return; } - buf = (double*)grib_context_malloc(d->handle->context,size * sizeof(double)); - if(!buf) - { - fprintf(self->dumper.out,"/* %s: cannot malloc(%ld) */\n",a->name,(long)size); + buf = (double*)grib_context_malloc(d->handle->context, size * sizeof(double)); + if (!buf) { + fprintf(self->dumper.out, "/* %s: cannot malloc(%ld) */\n", a->name, (long)size); return; } - err = grib_unpack_double(a,buf,&size); + err = grib_unpack_double(a, buf, &size); - if(err){ - grib_context_free(d->handle->context,buf); - fprintf(self->dumper.out," /* Error accessing %s (%s) */",a->name,grib_get_error_message(err)); - return ; + if (err) { + grib_context_free(d->handle->context, buf); + fprintf(self->dumper.out, " /* Error accessing %s (%s) */", a->name, grib_get_error_message(err)); + return; } - fprintf(self->dumper.out," size = %ld;\n",(long)size); - fprintf(self->dumper.out," v%s = (%s*)calloc(size,sizeof(%s));\n",stype,stype,stype); - fprintf(self->dumper.out," if(!v%s) {\n",stype); - fprintf(self->dumper.out," fprintf(stderr,\"failed to allocate %%d bytes\\n\",size*sizeof(%s));\n",stype); - fprintf(self->dumper.out," exit(1);\n"); - fprintf(self->dumper.out," }\n"); + fprintf(self->dumper.out, " size = %ld;\n", (long)size); + fprintf(self->dumper.out, " v%s = (%s*)calloc(size,sizeof(%s));\n", stype, stype, stype); + fprintf(self->dumper.out, " if(!v%s) {\n", stype); + fprintf(self->dumper.out, " fprintf(stderr,\"failed to allocate %%d bytes\\n\",size*sizeof(%s));\n", stype); + fprintf(self->dumper.out, " exit(1);\n"); + fprintf(self->dumper.out, " }\n"); - fprintf(self->dumper.out,"\n "); + fprintf(self->dumper.out, "\n "); k = 0; - while(k < size) - { - fprintf(self->dumper.out," v%s[%4d] = %7g;",stype,k,buf[k]); + while (k < size) { + fprintf(self->dumper.out, " v%s[%4d] = %7g;", stype, k, buf[k]); k++; - if(k%4 == 0) fprintf(self->dumper.out,"\n "); - + if (k % 4 == 0) + fprintf(self->dumper.out, "\n "); } - if(size%4) fprintf(self->dumper.out,"\n"); - fprintf(self->dumper.out,"\n"); - fprintf(self->dumper.out," GRIB_CHECK(grib_set_%s_array(h,\"%s\",v%s,size),%d);\n",stype,a->name,stype,0); - fprintf(self->dumper.out," free(v%s);\n",stype); + if (size % 4) + fprintf(self->dumper.out, "\n"); + fprintf(self->dumper.out, "\n"); + fprintf(self->dumper.out, " GRIB_CHECK(grib_set_%s_array(h,\"%s\",v%s,size),%d);\n", stype, a->name, stype, 0); + fprintf(self->dumper.out, " free(v%s);\n", stype); - grib_context_free(d->handle->context,buf); + grib_context_free(d->handle->context, buf); } -static void dump_label(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_label(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_grib_encode_C *self = (grib_dumper_grib_encode_C*)d; - fprintf(self->dumper.out,"\n /* %s */\n\n",a->name); + grib_dumper_grib_encode_C* self = (grib_dumper_grib_encode_C*)d; + fprintf(self->dumper.out, "\n /* %s */\n\n", a->name); } -static void dump_section(grib_dumper* d,grib_accessor* a,grib_block_of_accessors* block) +static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block) { /*grib_dumper_grib_encode_C *self = (grib_dumper_grib_encode_C*)d;*/ - grib_dump_accessors_block(d,block); + grib_dump_accessors_block(d, block); } -static void header(grib_dumper* d,grib_handle* h) +static void header(grib_dumper* d, grib_handle* h) { - long edition=0; - int ret=0; - grib_dumper_grib_encode_C *self = (grib_dumper_grib_encode_C*)d; - ret=grib_get_long(h,"editionNumber",&edition); + long edition = 0; + int ret = 0; + grib_dumper_grib_encode_C* self = (grib_dumper_grib_encode_C*)d; + ret = grib_get_long(h, "editionNumber", &edition); if (ret != GRIB_SUCCESS) { - grib_context_log(h->context,GRIB_LOG_ERROR,"Unable to get edition number."); + grib_context_log(h->context, GRIB_LOG_ERROR, "Unable to get edition number."); Assert(0); } @@ -421,13 +425,13 @@ static void header(grib_dumper* d,grib_handle* h) " fprintf(stderr,\"Cannot create grib handle\\n\");\n" " exit(1);\n" " }\n" - "\n",(long)edition - ); + "\n", + (long)edition); } -static void footer(grib_dumper* d,grib_handle* h) +static void footer(grib_dumper* d, grib_handle* h) { - grib_dumper_grib_encode_C *self = (grib_dumper_grib_encode_C*)d; + grib_dumper_grib_encode_C* self = (grib_dumper_grib_encode_C*)d; fprintf(self->dumper.out, "/* Save the message */\n" @@ -452,6 +456,5 @@ static void footer(grib_dumper* d,grib_handle* h) "\n" " grib_handle_delete(h);\n" " return 0;\n" - "}\n" - ); + "}\n"); } diff --git a/src/grib_dumper_class_json.c b/src/grib_dumper_class_json.c index 8fd8b05ee..b20224441 100644 --- a/src/grib_dumper_class_json.c +++ b/src/grib_dumper_class_json.c @@ -41,77 +41,82 @@ or edit "dumper.class" and rerun ./make_class.pl */ -static void init_class (grib_dumper_class*); -static int init (grib_dumper* d); -static int destroy (grib_dumper*); -static void dump_long (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_bits (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_double (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_string (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_string_array (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_bytes (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_values (grib_dumper* d, grib_accessor* a); -static void dump_label (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_section (grib_dumper* d, grib_accessor* a,grib_block_of_accessors* block); - -typedef struct grib_dumper_json { - grib_dumper dumper; -/* Members defined in json */ - long section_offset; - long begin; - long empty; - long end; - long isLeaf; - long isAttribute; +static void init_class(grib_dumper_class*); +static int init(grib_dumper* d); +static int destroy(grib_dumper*); +static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_bits(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_values(grib_dumper* d, grib_accessor* a); +static void dump_label(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block); + +typedef struct grib_dumper_json +{ + grib_dumper dumper; + /* Members defined in json */ + long section_offset; + long begin; + long empty; + long end; + long isLeaf; + long isAttribute; } grib_dumper_json; static grib_dumper_class _grib_dumper_class_json = { - 0, /* super */ - "json", /* name */ - sizeof(grib_dumper_json), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - &destroy, /* free mem */ - &dump_long, /* dump long */ - &dump_double, /* dump double */ - &dump_string, /* dump string */ - &dump_string_array, /* dump string array */ - &dump_label, /* dump labels */ - &dump_bytes, /* dump bytes */ - &dump_bits, /* dump bits */ - &dump_section, /* dump section */ - &dump_values, /* dump values */ - 0, /* header */ - 0, /* footer */ + 0, /* super */ + "json", /* name */ + sizeof(grib_dumper_json), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + &destroy, /* free mem */ + &dump_long, /* dump long */ + &dump_double, /* dump double */ + &dump_string, /* dump string */ + &dump_string_array, /* dump string array */ + &dump_label, /* dump labels */ + &dump_bytes, /* dump bytes */ + &dump_bits, /* dump bits */ + &dump_section, /* dump section */ + &dump_values, /* dump values */ + 0, /* header */ + 0, /* footer */ }; grib_dumper_class* grib_dumper_class_json = &_grib_dumper_class_json; /* END_CLASS_IMP */ -static void dump_attributes(grib_dumper* d,grib_accessor* a); +static void dump_attributes(grib_dumper* d, grib_accessor* a); /* Note: A fast cut-down version of strcmp which does NOT return -1 */ /* 0 means input strings are equal and 1 means not equal */ -GRIB_INLINE static int grib_inline_strcmp(const char* a,const char* b) +GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b) { - if (*a != *b) return 1; - while((*a!=0 && *b!=0) && *(a) == *(b) ) {a++;b++;} - return (*a==0 && *b==0) ? 0 : 1; + if (*a != *b) + return 1; + while ((*a != 0 && *b != 0) && *(a) == *(b)) { + a++; + b++; + } + return (*a == 0 && *b == 0) ? 0 : 1; } -static int depth=0; +static int depth = 0; -static void init_class (grib_dumper_class* c){} +static void init_class(grib_dumper_class* c) {} static int init(grib_dumper* d) { - grib_dumper_json *self = (grib_dumper_json*)d; - self->section_offset=0; - self->empty=1; - self->isLeaf=0; - self->isAttribute=0; + grib_dumper_json* self = (grib_dumper_json*)d; + self->section_offset = 0; + self->empty = 1; + self->isLeaf = 0; + self->isAttribute = 0; return GRIB_SUCCESS; } @@ -121,318 +126,341 @@ static int destroy(grib_dumper* d) return GRIB_SUCCESS; } -static void dump_values(grib_dumper* d,grib_accessor* a) +static void dump_values(grib_dumper* d, grib_accessor* a) { - grib_dumper_json *self = (grib_dumper_json*)d; - double value=0; size_t size = 1; - double *values = NULL; - int err = 0; + grib_dumper_json* self = (grib_dumper_json*)d; + double value = 0; + size_t size = 1; + double* values = NULL; + int err = 0; int i; - int cols = 9; - long count = 0; + int cols = 9; + long count = 0; double missing_value = GRIB_MISSING_DOUBLE; - grib_handle* h = NULL; + grib_handle* h = NULL; - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 ) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; h = grib_handle_of_accessor(a); - grib_value_count(a,&count); - size=count; - - if (size>1) { - values=(double*)grib_context_malloc_clear(a->context,sizeof(double)*size); - err=grib_unpack_double(a,values,&size); - } else { - err=grib_unpack_double(a,&value,&size); + grib_value_count(a, &count); + size = count; + + if (size > 1) { + values = (double*)grib_context_malloc_clear(a->context, sizeof(double) * size); + err = grib_unpack_double(a, values, &size); + } + else { + err = grib_unpack_double(a, &value, &size); } - if (self->begin==0 && self->empty==0 && self->isAttribute==0) fprintf(self->dumper.out,","); - else self->begin=0; + if (self->begin == 0 && self->empty == 0 && self->isAttribute == 0) + fprintf(self->dumper.out, ","); + else + self->begin = 0; - self->empty=0; + self->empty = 0; - if (self->isLeaf==0) { - fprintf(self->dumper.out,"\n%-*s{\n",depth," "); - depth+=2; - fprintf(self->dumper.out,"%-*s",depth," "); - fprintf(self->dumper.out,"\"key\" : \"%s\",\n",a->name); + if (self->isLeaf == 0) { + fprintf(self->dumper.out, "\n%-*s{\n", depth, " "); + depth += 2; + fprintf(self->dumper.out, "%-*s", depth, " "); + fprintf(self->dumper.out, "\"key\" : \"%s\",\n", a->name); } err = grib_set_double(h, "missingValue", missing_value); - if (size>1) { - int icount=0; - if (self->isLeaf==0) { - fprintf(self->dumper.out,"%-*s",depth," "); - fprintf(self->dumper.out,"\"value\" :\n"); + if (size > 1) { + int icount = 0; + if (self->isLeaf == 0) { + fprintf(self->dumper.out, "%-*s", depth, " "); + fprintf(self->dumper.out, "\"value\" :\n"); } - fprintf(self->dumper.out,"%-*s[",depth," "); - depth+=2; - for (i=0; icols || i==0) {fprintf(self->dumper.out,"\n%-*s",depth," ");icount=0;} + fprintf(self->dumper.out, "%-*s[", depth, " "); + depth += 2; + for (i = 0; i < size - 1; ++i) { + if (icount > cols || i == 0) { + fprintf(self->dumper.out, "\n%-*s", depth, " "); + icount = 0; + } if (values[i] == missing_value) - fprintf(self->dumper.out,"null, "); + fprintf(self->dumper.out, "null, "); else - fprintf(self->dumper.out,"%g, ", values[i]); + fprintf(self->dumper.out, "%g, ", values[i]); icount++; } - if (icount>cols) fprintf(self->dumper.out,"\n%-*s",depth," "); - if (grib_is_missing_double(a,values[i])) - fprintf(self->dumper.out, "%s ","null"); + if (icount > cols) + fprintf(self->dumper.out, "\n%-*s", depth, " "); + if (grib_is_missing_double(a, values[i])) + fprintf(self->dumper.out, "%s ", "null"); else - fprintf(self->dumper.out, "%g ",values[i]); + fprintf(self->dumper.out, "%g ", values[i]); - depth-=2; - fprintf(self->dumper.out,"\n%-*s]",depth," "); + depth -= 2; + fprintf(self->dumper.out, "\n%-*s]", depth, " "); /* if (a->attributes[0]) fprintf(self->dumper.out,","); */ - grib_context_free(a->context,values); - } else { - if (self->isLeaf==0) { - fprintf(self->dumper.out,"%-*s",depth," "); - fprintf(self->dumper.out,"\"value\" : "); + grib_context_free(a->context, values); + } + else { + if (self->isLeaf == 0) { + fprintf(self->dumper.out, "%-*s", depth, " "); + fprintf(self->dumper.out, "\"value\" : "); } - if( grib_is_missing_double(a,value) ) - fprintf(self->dumper.out,"null"); + if (grib_is_missing_double(a, value)) + fprintf(self->dumper.out, "null"); else - fprintf(self->dumper.out,"%g",value); + fprintf(self->dumper.out, "%g", value); } - if (self->isLeaf==0) { - dump_attributes(d,a); - depth-=2; - fprintf(self->dumper.out,"\n%-*s}",depth," "); + if (self->isLeaf == 0) { + dump_attributes(d, a); + depth -= 2; + fprintf(self->dumper.out, "\n%-*s}", depth, " "); } (void)err; /* TODO */ } -static void dump_long(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_json *self = (grib_dumper_json*)d; - long value = 0; - size_t size = 1; - long *values = NULL; - int err = 0; + grib_dumper_json* self = (grib_dumper_json*)d; + long value = 0; + size_t size = 1; + long* values = NULL; + int err = 0; int i; - int cols = 9; + int cols = 9; long count = 0; - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 ) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; - if (size>1) { - values=(long*)grib_context_malloc_clear(a->context,sizeof(long)*size); - err=grib_unpack_long(a,values,&size); - } else { - err=grib_unpack_long(a,&value,&size); + if (size > 1) { + values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); + err = grib_unpack_long(a, values, &size); + } + else { + err = grib_unpack_long(a, &value, &size); } - if (self->begin==0 && self->empty==0 && self->isAttribute==0) fprintf(self->dumper.out,","); - else self->begin=0; + if (self->begin == 0 && self->empty == 0 && self->isAttribute == 0) + fprintf(self->dumper.out, ","); + else + self->begin = 0; - self->empty=0; + self->empty = 0; - if (self->isLeaf==0) { - fprintf(self->dumper.out,"\n%-*s{\n",depth," "); - depth+=2; - fprintf(self->dumper.out,"%-*s",depth," "); - fprintf(self->dumper.out,"\"key\" : \"%s\",\n",a->name); + if (self->isLeaf == 0) { + fprintf(self->dumper.out, "\n%-*s{\n", depth, " "); + depth += 2; + fprintf(self->dumper.out, "%-*s", depth, " "); + fprintf(self->dumper.out, "\"key\" : \"%s\",\n", a->name); } - if (size>1) { - int doing_unexpandedDescriptors=0; - int icount=0; - if (self->isLeaf==0) { - fprintf(self->dumper.out,"%-*s",depth," "); - fprintf(self->dumper.out,"\"value\" :\n"); + if (size > 1) { + int doing_unexpandedDescriptors = 0; + int icount = 0; + if (self->isLeaf == 0) { + fprintf(self->dumper.out, "%-*s", depth, " "); + fprintf(self->dumper.out, "\"value\" :\n"); } - fprintf(self->dumper.out,"%-*s[",depth," "); + fprintf(self->dumper.out, "%-*s[", depth, " "); /* See ECC-637: unfortunately json_xs says: * malformed number (leading zero must not be followed by another digit if (strcmp(a->name, "unexpandedDescriptors")==0) doing_unexpandedDescriptors = 1; */ - depth+=2; - for (i=0;icols || i==0) {fprintf(self->dumper.out,"\n%-*s",depth," ");icount=0;} - if (grib_is_missing_long(a,values[i])) { - fprintf(self->dumper.out,"null, "); - } else { + depth += 2; + for (i = 0; i < size - 1; i++) { + if (icount > cols || i == 0) { + fprintf(self->dumper.out, "\n%-*s", depth, " "); + icount = 0; + } + if (grib_is_missing_long(a, values[i])) { + fprintf(self->dumper.out, "null, "); + } + else { if (doing_unexpandedDescriptors) - fprintf(self->dumper.out,"%06ld, ",values[i]); + fprintf(self->dumper.out, "%06ld, ", values[i]); else - fprintf(self->dumper.out,"%ld, ",values[i]); + fprintf(self->dumper.out, "%ld, ", values[i]); } icount++; } - if (icount>cols) fprintf(self->dumper.out,"\n%-*s",depth," "); + if (icount > cols) + fprintf(self->dumper.out, "\n%-*s", depth, " "); if (doing_unexpandedDescriptors) - fprintf(self->dumper.out,"%06ld ",values[i]); + fprintf(self->dumper.out, "%06ld ", values[i]); else - fprintf(self->dumper.out,"%ld ",values[i]); + fprintf(self->dumper.out, "%ld ", values[i]); - depth-=2; - fprintf(self->dumper.out,"\n%-*s]",depth," "); + depth -= 2; + fprintf(self->dumper.out, "\n%-*s]", depth, " "); /* if (a->attributes[0]) fprintf(self->dumper.out,","); */ - grib_context_free(a->context,values); - } else { - if (self->isLeaf==0) { - fprintf(self->dumper.out,"%-*s",depth," "); - fprintf(self->dumper.out,"\"value\" : "); + grib_context_free(a->context, values); + } + else { + if (self->isLeaf == 0) { + fprintf(self->dumper.out, "%-*s", depth, " "); + fprintf(self->dumper.out, "\"value\" : "); } - if( grib_is_missing_long(a,value) ) - fprintf(self->dumper.out,"null"); + if (grib_is_missing_long(a, value)) + fprintf(self->dumper.out, "null"); else - fprintf(self->dumper.out,"%ld",value); + fprintf(self->dumper.out, "%ld", value); /* if (a->attributes[0]) fprintf(self->dumper.out,","); */ } - if (self->isLeaf==0) { - dump_attributes(d,a); - depth-=2; - fprintf(self->dumper.out,"\n%-*s}",depth," "); + if (self->isLeaf == 0) { + dump_attributes(d, a); + depth -= 2; + fprintf(self->dumper.out, "\n%-*s}", depth, " "); } (void)err; /* TODO */ } -static void dump_bits(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_bits(grib_dumper* d, grib_accessor* a, const char* comment) { } -static void dump_double(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_json *self = (grib_dumper_json*)d; - double value = 0; - size_t size = 1; + grib_dumper_json* self = (grib_dumper_json*)d; + double value = 0; + size_t size = 1; - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - grib_unpack_double(a,&value,&size); + grib_unpack_double(a, &value, &size); - if (self->begin==0 && self->empty==0 && self->isAttribute==0) fprintf(self->dumper.out,",\n"); - else self->begin=0; + if (self->begin == 0 && self->empty == 0 && self->isAttribute == 0) + fprintf(self->dumper.out, ",\n"); + else + self->begin = 0; - self->empty=0; + self->empty = 0; - if (self->isLeaf==0) { - fprintf(self->dumper.out,"%-*s{\n",depth," "); - depth+=2; - fprintf(self->dumper.out,"%-*s",depth," "); - fprintf(self->dumper.out,"\"key\" : \"%s\",\n",a->name); + if (self->isLeaf == 0) { + fprintf(self->dumper.out, "%-*s{\n", depth, " "); + depth += 2; + fprintf(self->dumper.out, "%-*s", depth, " "); + fprintf(self->dumper.out, "\"key\" : \"%s\",\n", a->name); - fprintf(self->dumper.out,"%-*s",depth," "); - fprintf(self->dumper.out,"\"value\" : "); + fprintf(self->dumper.out, "%-*s", depth, " "); + fprintf(self->dumper.out, "\"value\" : "); } - if( grib_is_missing_double(a,value) ) - fprintf(self->dumper.out,"null"); + if (grib_is_missing_double(a, value)) + fprintf(self->dumper.out, "null"); else - fprintf(self->dumper.out,"%g",value); + fprintf(self->dumper.out, "%g", value); /* if (a->attributes[0]) fprintf(self->dumper.out,","); */ - if (self->isLeaf==0) { - dump_attributes(d,a); - depth-=2; - fprintf(self->dumper.out,"\n%-*s}",depth," "); + if (self->isLeaf == 0) { + dump_attributes(d, a); + depth -= 2; + fprintf(self->dumper.out, "\n%-*s}", depth, " "); } } -static void dump_string_array(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_json *self = (grib_dumper_json*)d; - char **values = NULL; + grib_dumper_json* self = (grib_dumper_json*)d; + char** values = NULL; size_t size = 0, i = 0; grib_context* c = NULL; - int err = 0; - long count = 0; - c=a->context; + int err = 0; + long count = 0; + c = a->context; - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 ) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - grib_value_count(a,&count); - size=count; - if (size==1) { - dump_string(d,a,comment); + grib_value_count(a, &count); + size = count; + if (size == 1) { + dump_string(d, a, comment); return; } - if (self->begin==0 && self->empty==0 && self->isAttribute==0) fprintf(self->dumper.out,","); - else self->begin=0; + if (self->begin == 0 && self->empty == 0 && self->isAttribute == 0) + fprintf(self->dumper.out, ","); + else + self->begin = 0; - if (self->isLeaf==0) { - fprintf(self->dumper.out,"\n%-*s{\n",depth," "); - depth+=2; - fprintf(self->dumper.out,"%-*s",depth," "); - fprintf(self->dumper.out,"\"key\" : \"%s\",\n",a->name); + if (self->isLeaf == 0) { + fprintf(self->dumper.out, "\n%-*s{\n", depth, " "); + depth += 2; + fprintf(self->dumper.out, "%-*s", depth, " "); + fprintf(self->dumper.out, "\"key\" : \"%s\",\n", a->name); } - self->empty=0; + self->empty = 0; - values=(char**)grib_context_malloc_clear(c,size*sizeof(char*)); + values = (char**)grib_context_malloc_clear(c, size * sizeof(char*)); if (!values) { - grib_context_log(c,GRIB_LOG_FATAL,"unable to allocate %d bytes",(int)size); + grib_context_log(c, GRIB_LOG_FATAL, "unable to allocate %d bytes", (int)size); return; } - err = grib_unpack_string_array(a,values,&size); + err = grib_unpack_string_array(a, values, &size); - if (self->isLeaf==0) { - fprintf(self->dumper.out,"%-*s",depth," "); - fprintf(self->dumper.out,"\"value\" : "); + if (self->isLeaf == 0) { + fprintf(self->dumper.out, "%-*s", depth, " "); + fprintf(self->dumper.out, "\"value\" : "); } - fprintf(self->dumper.out,"\n%-*s[",depth," "); - depth+=2; - for (i=0;idumper.out,"%-*s\"%s\",\n",depth," ",values[i]); + fprintf(self->dumper.out, "\n%-*s[", depth, " "); + depth += 2; + for (i = 0; i < size - 1; i++) { + fprintf(self->dumper.out, "%-*s\"%s\",\n", depth, " ", values[i]); } - fprintf(self->dumper.out,"%-*s\"%s\"\n",depth," ",values[i]); + fprintf(self->dumper.out, "%-*s\"%s\"\n", depth, " ", values[i]); - depth-=2; - fprintf(self->dumper.out,"\n%-*s]",depth," "); + depth -= 2; + fprintf(self->dumper.out, "\n%-*s]", depth, " "); /* if (a->attributes[0]) fprintf(self->dumper.out,","); */ - if (self->isLeaf==0) { - dump_attributes(d,a); - depth-=2; - fprintf(self->dumper.out,"\n%-*s}",depth," "); + if (self->isLeaf == 0) { + dump_attributes(d, a); + depth -= 2; + fprintf(self->dumper.out, "\n%-*s}", depth, " "); } - for (i=0;iname; - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) { + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) { /* ECC-356: Solution for the special local section key 'keyMore' and its alias 'ident' */ int skip = 1; - if ( (a->flags & GRIB_ACCESSOR_FLAG_HIDDEN)!=0 ) { + if ((a->flags & GRIB_ACCESSOR_FLAG_HIDDEN) != 0) { grib_handle* h = grib_handle_of_accessor(a); - if ( strcmp(a->name, "keyMore")==0 && grib_is_defined(h, "ls.ident") ) { - skip = 0; + if (strcmp(a->name, "keyMore") == 0 && grib_is_defined(h, "ls.ident")) { + skip = 0; acc_name = "ident"; } } - if (skip) return; + if (skip) + return; } /* ECC-710: It is MUCH slower determining the string length here @@ -446,124 +474,132 @@ static void dump_string(grib_dumper* d,grib_accessor* a,const char* comment) return; }*/ - if (self->begin==0 && self->empty==0 && self->isAttribute==0) fprintf(self->dumper.out,","); - else self->begin=0; + if (self->begin == 0 && self->empty == 0 && self->isAttribute == 0) + fprintf(self->dumper.out, ","); + else + self->begin = 0; - self->empty=0; + self->empty = 0; - err = grib_unpack_string(a,value,&size); + err = grib_unpack_string(a, value, &size); Assert(size < MAX_STRING_SIZE); - p=value; - if (grib_is_missing_string(a,(unsigned char *)value,size)) { + p = value; + if (grib_is_missing_string(a, (unsigned char*)value, size)) { is_missing = 1; } - while(*p) { if(!isprint(*p)) *p = '.'; p++; } + while (*p) { + if (!isprint(*p)) + *p = '.'; + p++; + } - if (self->isLeaf==0) { - fprintf(self->dumper.out,"\n%-*s{",depth," "); - depth+=2; - fprintf(self->dumper.out,"\n%-*s",depth," "); - fprintf(self->dumper.out,"\"key\" : \"%s\",",acc_name); - fprintf(self->dumper.out,"\n%-*s",depth," "); - fprintf(self->dumper.out,"\"value\" : "); + if (self->isLeaf == 0) { + fprintf(self->dumper.out, "\n%-*s{", depth, " "); + depth += 2; + fprintf(self->dumper.out, "\n%-*s", depth, " "); + fprintf(self->dumper.out, "\"key\" : \"%s\",", acc_name); + fprintf(self->dumper.out, "\n%-*s", depth, " "); + fprintf(self->dumper.out, "\"value\" : "); } - if (is_missing) fprintf(self->dumper.out,"%s", "null"); - else fprintf(self->dumper.out,"\"%s\"",value); + if (is_missing) + fprintf(self->dumper.out, "%s", "null"); + else + fprintf(self->dumper.out, "\"%s\"", value); /* if (a->attributes[0]) fprintf(self->dumper.out,","); */ - if (self->isLeaf==0) { - dump_attributes(d,a); - depth-=2; - fprintf(self->dumper.out,"\n%-*s}",depth," "); + if (self->isLeaf == 0) { + dump_attributes(d, a); + depth -= 2; + fprintf(self->dumper.out, "\n%-*s}", depth, " "); } /*grib_context_free(a->context,value);*/ (void)err; /* TODO */ } -static void dump_bytes(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment) { } -static void dump_label(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_label(grib_dumper* d, grib_accessor* a, const char* comment) { } -static void dump_section(grib_dumper* d,grib_accessor* a,grib_block_of_accessors* block) +static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block) { - grib_dumper_json *self = (grib_dumper_json*)d; - if (!grib_inline_strcmp(a->name,"BUFR") || - !grib_inline_strcmp(a->name,"GRIB") || - !grib_inline_strcmp(a->name,"META") - ) { - depth=2; - fprintf(self->dumper.out,"%-*s",depth," "); - fprintf(self->dumper.out,"[\n"); - self->begin=1; - self->empty=1; - depth+=2; - grib_dump_accessors_block(d,block); - depth-=2; - fprintf(self->dumper.out,"\n]\n"); - } else if (!grib_inline_strcmp(a->name,"groupNumber")) { - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) + grib_dumper_json* self = (grib_dumper_json*)d; + if (!grib_inline_strcmp(a->name, "BUFR") || + !grib_inline_strcmp(a->name, "GRIB") || + !grib_inline_strcmp(a->name, "META")) { + depth = 2; + fprintf(self->dumper.out, "%-*s", depth, " "); + fprintf(self->dumper.out, "[\n"); + self->begin = 1; + self->empty = 1; + depth += 2; + grib_dump_accessors_block(d, block); + depth -= 2; + fprintf(self->dumper.out, "\n]\n"); + } + else if (!grib_inline_strcmp(a->name, "groupNumber")) { + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - if (!self->empty) fprintf(self->dumper.out,",\n"); - fprintf(self->dumper.out,"%-*s",depth," "); + if (!self->empty) + fprintf(self->dumper.out, ",\n"); + fprintf(self->dumper.out, "%-*s", depth, " "); - fprintf(self->dumper.out,"["); + fprintf(self->dumper.out, "["); - fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out, "\n"); /* fprintf(self->dumper.out,"%-*s",depth," "); */ - self->begin=1; - self->empty=1; - depth+=2; - grib_dump_accessors_block(d,block); - depth-=2; - fprintf(self->dumper.out,"\n"); - fprintf(self->dumper.out,"%-*s",depth," "); - fprintf(self->dumper.out,"]"); - } else { - grib_dump_accessors_block(d,block); + self->begin = 1; + self->empty = 1; + depth += 2; + grib_dump_accessors_block(d, block); + depth -= 2; + fprintf(self->dumper.out, "\n"); + fprintf(self->dumper.out, "%-*s", depth, " "); + fprintf(self->dumper.out, "]"); + } + else { + grib_dump_accessors_block(d, block); } } -static void dump_attributes(grib_dumper* d,grib_accessor* a) +static void dump_attributes(grib_dumper* d, grib_accessor* a) { - int i=0; - grib_dumper_json *self = (grib_dumper_json*)d; - FILE* out=self->dumper.out; + int i = 0; + grib_dumper_json* self = (grib_dumper_json*)d; + FILE* out = self->dumper.out; unsigned long flags; while (i < MAX_ACCESSOR_ATTRIBUTES && a->attributes[i]) { - self->isAttribute=1; - if ( (d->option_flags & GRIB_DUMP_FLAG_ALL_ATTRIBUTES ) == 0 - && (a->attributes[i]->flags & GRIB_ACCESSOR_FLAG_DUMP)== 0 ) - { + self->isAttribute = 1; + if ((d->option_flags & GRIB_DUMP_FLAG_ALL_ATTRIBUTES) == 0 && (a->attributes[i]->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) { i++; continue; } - self->isLeaf=a->attributes[i]->attributes[0]==NULL ? 1 : 0; - fprintf(self->dumper.out,","); - fprintf(self->dumper.out,"\n%-*s",depth," "); - fprintf(out,"\"%s\" : ",a->attributes[i]->name); - flags=a->attributes[i]->flags; + self->isLeaf = a->attributes[i]->attributes[0] == NULL ? 1 : 0; + fprintf(self->dumper.out, ","); + fprintf(self->dumper.out, "\n%-*s", depth, " "); + fprintf(out, "\"%s\" : ", a->attributes[i]->name); + flags = a->attributes[i]->flags; a->attributes[i]->flags |= GRIB_ACCESSOR_FLAG_DUMP; switch (grib_accessor_get_native_type(a->attributes[i])) { - case GRIB_TYPE_LONG: - dump_long(d,a->attributes[i],0); - break; - case GRIB_TYPE_DOUBLE: - dump_values(d,a->attributes[i]); - break; - case GRIB_TYPE_STRING: - dump_string_array(d,a->attributes[i],0); - break; + case GRIB_TYPE_LONG: + dump_long(d, a->attributes[i], 0); + break; + case GRIB_TYPE_DOUBLE: + dump_values(d, a->attributes[i]); + break; + case GRIB_TYPE_STRING: + dump_string_array(d, a->attributes[i], 0); + break; } - a->attributes[i]->flags=flags; + a->attributes[i]->flags = flags; i++; } - self->isLeaf=0; - self->isAttribute=0; + self->isLeaf = 0; + self->isAttribute = 0; } diff --git a/src/grib_dumper_class_keys.c b/src/grib_dumper_class_keys.c index e11347552..c7b9da197 100644 --- a/src/grib_dumper_class_keys.c +++ b/src/grib_dumper_class_keys.c @@ -43,151 +43,150 @@ or edit "dumper.class" and rerun ./make_class.pl */ -static void init_class (grib_dumper_class*); -static int init (grib_dumper* d); -static int destroy (grib_dumper*); -static void dump_long (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_bits (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_double (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_string (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_bytes (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_values (grib_dumper* d, grib_accessor* a); -static void dump_label (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_section (grib_dumper* d, grib_accessor* a,grib_block_of_accessors* block); - -typedef struct grib_dumper_keys { - grib_dumper dumper; -/* Members defined in keys */ - long section_offset; - long begin; - long theEnd; +static void init_class(grib_dumper_class*); +static int init(grib_dumper* d); +static int destroy(grib_dumper*); +static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_bits(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_values(grib_dumper* d, grib_accessor* a); +static void dump_label(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block); + +typedef struct grib_dumper_keys +{ + grib_dumper dumper; + /* Members defined in keys */ + long section_offset; + long begin; + long theEnd; } grib_dumper_keys; static grib_dumper_class _grib_dumper_class_keys = { - 0, /* super */ - "keys", /* name */ - sizeof(grib_dumper_keys), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - &destroy, /* free mem */ - &dump_long, /* dump long */ - &dump_double, /* dump double */ - &dump_string, /* dump string */ + 0, /* super */ + "keys", /* name */ + sizeof(grib_dumper_keys), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + &destroy, /* free mem */ + &dump_long, /* dump long */ + &dump_double, /* dump double */ + &dump_string, /* dump string */ 0, /* dump string array */ - &dump_label, /* dump labels */ - &dump_bytes, /* dump bytes */ - &dump_bits, /* dump bits */ - &dump_section, /* dump section */ - &dump_values, /* dump values */ - 0, /* header */ - 0, /* footer */ + &dump_label, /* dump labels */ + &dump_bytes, /* dump bytes */ + &dump_bits, /* dump bits */ + &dump_section, /* dump section */ + &dump_values, /* dump values */ + 0, /* header */ + 0, /* footer */ }; grib_dumper_class* grib_dumper_class_keys = &_grib_dumper_class_keys; /* END_CLASS_IMP */ -static void print_offset(FILE* out,grib_dumper* d,grib_accessor* a); +static void print_offset(FILE* out, grib_dumper* d, grib_accessor* a); -static void init_class (grib_dumper_class* c){} +static void init_class(grib_dumper_class* c) {} -static int init(grib_dumper* d) +static int init(grib_dumper* d) { - grib_dumper_keys *self = (grib_dumper_keys*)d; - self->section_offset=0; + grib_dumper_keys* self = (grib_dumper_keys*)d; + self->section_offset = 0; - return GRIB_SUCCESS; + return GRIB_SUCCESS; } -static int destroy (grib_dumper* d){ - return GRIB_SUCCESS; +static int destroy(grib_dumper* d) +{ + return GRIB_SUCCESS; } -static void aliases(grib_dumper* d,grib_accessor* a) +static void aliases(grib_dumper* d, grib_accessor* a) { -int i; - grib_dumper_keys *self = (grib_dumper_keys*)d; - - if( (d->option_flags & GRIB_DUMP_FLAG_ALIASES) == 0) - return; - - if(a->all_names[1]) - { - char *sep = ""; - fprintf(self->dumper.out," ( ALIASES: "); - - for(i = 1; i < MAX_ACCESSOR_NAMES; i++) - { - if(a->all_names[i]) - { - if(a->all_name_spaces[i]) - fprintf(self->dumper.out,"%s%s.%s", sep,a->all_name_spaces[i],a->all_names[i]); - else - fprintf(self->dumper.out,"%s%s", sep,a->all_names[i]); - } - sep = ", "; + int i; + grib_dumper_keys* self = (grib_dumper_keys*)d; + + if ((d->option_flags & GRIB_DUMP_FLAG_ALIASES) == 0) + return; + + if (a->all_names[1]) { + char* sep = ""; + fprintf(self->dumper.out, " ( ALIASES: "); + + for (i = 1; i < MAX_ACCESSOR_NAMES; i++) { + if (a->all_names[i]) { + if (a->all_name_spaces[i]) + fprintf(self->dumper.out, "%s%s.%s", sep, a->all_name_spaces[i], a->all_names[i]); + else + fprintf(self->dumper.out, "%s%s", sep, a->all_names[i]); + } + sep = ", "; + } + printf(") "); } - printf(") "); - } } -static void dump_name_only(grib_dumper* d,grib_accessor* a,const char* comment) { - grib_dumper_keys *self = (grib_dumper_keys*)d; +static void dump_name_only(grib_dumper* d, grib_accessor* a, const char* comment) +{ + grib_dumper_keys* self = (grib_dumper_keys*)d; - print_offset(self->dumper.out,d,a); + print_offset(self->dumper.out, d, a); - if (a->flags & GRIB_ACCESSOR_FLAG_HIDDEN) { - return; - } + if (a->flags & GRIB_ACCESSOR_FLAG_HIDDEN) { + return; + } - if( a->length == 0 && - (d->option_flags & GRIB_DUMP_FLAG_CODED) != 0) - return; + if (a->length == 0 && + (d->option_flags & GRIB_DUMP_FLAG_CODED) != 0) + return; - if( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 && - (d->option_flags & GRIB_DUMP_FLAG_DUMP_OK) != 0) - return; + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 && + (d->option_flags & GRIB_DUMP_FLAG_DUMP_OK) != 0) + return; - fprintf(self->dumper.out,"%s",a->name); + fprintf(self->dumper.out, "%s", a->name); - if (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) { - fprintf(self->dumper.out," (read only)"); - } - if ((d->option_flags & GRIB_DUMP_FLAG_TYPE) != 0){ - fprintf(self->dumper.out," (type %s) ",a->creator->op); - } + if (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) { + fprintf(self->dumper.out, " (read only)"); + } + if ((d->option_flags & GRIB_DUMP_FLAG_TYPE) != 0) { + fprintf(self->dumper.out, " (type %s) ", a->creator->op); + } - aliases(d,a); + aliases(d, a); - fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out, "\n"); } -static void dump_long(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) { - dump_name_only(d,a,comment); + dump_name_only(d, a, comment); } -static void dump_bits(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_bits(grib_dumper* d, grib_accessor* a, const char* comment) { - dump_name_only(d,a,comment); + dump_name_only(d, a, comment); } -static void dump_double(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) { - dump_name_only(d,a,comment); + dump_name_only(d, a, comment); } -static void dump_string(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) { - dump_name_only(d,a,comment); + dump_name_only(d, a, comment); } -static void dump_bytes(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment) { - #if 0 grib_dumper_keys *self = (grib_dumper_keys*)d; int i,k,err =0; @@ -261,62 +260,63 @@ static void dump_bytes(grib_dumper* d,grib_accessor* a,const char* comment) #endif } -static void dump_values(grib_dumper* d,grib_accessor* a) +static void dump_values(grib_dumper* d, grib_accessor* a) { - dump_name_only(d,a,0); + dump_name_only(d, a, 0); } -static void dump_label(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_label(grib_dumper* d, grib_accessor* a, const char* comment) { - /*grib_dumper_keys *self = (grib_dumper_keys*)d; + /*grib_dumper_keys *self = (grib_dumper_keys*)d; for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," "); fprintf(self->dumper.out,"----> %s %s %s\n",a->creator->op, a->name,comment?comment:"");*/ } -static void dump_section(grib_dumper* d,grib_accessor* a,grib_block_of_accessors* block) +static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block) { - grib_dumper_keys *self = (grib_dumper_keys*)d; - /*grib_section* s = grib_get_sub_section(a);*/ - int is_default_section=0; - char* upper=NULL; - char *p=NULL,*q=NULL; - if (!strncmp(a->name,"section",7)) is_default_section=1; - - /*for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," ");*/ - if (is_default_section) { - upper=(char*)malloc(strlen(a->name)+1); - Assert(upper); - p=(char*)a->name; - q=upper; - while (*p != '\0') { - *q=toupper(*p); - if (*q == '_' ) *q=' '; - q++; - p++; + grib_dumper_keys* self = (grib_dumper_keys*)d; + /*grib_section* s = grib_get_sub_section(a);*/ + int is_default_section = 0; + char* upper = NULL; + char *p = NULL, *q = NULL; + if (!strncmp(a->name, "section", 7)) + is_default_section = 1; + + /*for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," ");*/ + if (is_default_section) { + upper = (char*)malloc(strlen(a->name) + 1); + Assert(upper); + p = (char*)a->name; + q = upper; + while (*p != '\0') { + *q = toupper(*p); + if (*q == '_') + *q = ' '; + q++; + p++; + } + *q = '\0'; + + /*sprintf(tmp,"%s ",upper,(long)s->length,(long)s->padding);*/ + + fprintf(self->dumper.out, "====> %s <==== \n", upper); + + free(upper); + self->section_offset = a->offset; + } + else { } - *q='\0'; - - /*sprintf(tmp,"%s ",upper,(long)s->length,(long)s->padding);*/ - - fprintf(self->dumper.out,"====> %s <==== \n",upper); - - free(upper); - self->section_offset=a->offset; - } else { - - } - /*printf("------------- section_offset = %ld\n",self->section_offset);*/ - d->depth += 3; - grib_dump_accessors_block(d,block); - d->depth -= 3; + /*printf("------------- section_offset = %ld\n",self->section_offset);*/ + d->depth += 3; + grib_dump_accessors_block(d, block); + d->depth -= 3; - /*for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," ");*/ - /*fprintf(self->dumper.out,"<===== %s %s\n",a->creator->op, a->name);*/ + /*for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," ");*/ + /*fprintf(self->dumper.out,"<===== %s %s\n",a->creator->op, a->name);*/ } -static void print_offset(FILE* out,grib_dumper* d,grib_accessor* a) { - +static void print_offset(FILE* out, grib_dumper* d, grib_accessor* a) +{ } - diff --git a/src/grib_dumper_class_serialize.c b/src/grib_dumper_class_serialize.c index 809d547e7..6964fc285 100644 --- a/src/grib_dumper_class_serialize.c +++ b/src/grib_dumper_class_serialize.c @@ -40,42 +40,43 @@ or edit "dumper.class" and rerun ./make_class.pl */ -static void init_class (grib_dumper_class*); -static int init (grib_dumper* d); -static int destroy (grib_dumper*); -static void dump_long (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_bits (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_double (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_string (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_bytes (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_values (grib_dumper* d, grib_accessor* a); -static void dump_label (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_section (grib_dumper* d, grib_accessor* a,grib_block_of_accessors* block); - -typedef struct grib_dumper_serialize { - grib_dumper dumper; -/* Members defined in serialize */ - char* format; +static void init_class(grib_dumper_class*); +static int init(grib_dumper* d); +static int destroy(grib_dumper*); +static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_bits(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_values(grib_dumper* d, grib_accessor* a); +static void dump_label(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block); + +typedef struct grib_dumper_serialize +{ + grib_dumper dumper; + /* Members defined in serialize */ + char* format; } grib_dumper_serialize; static grib_dumper_class _grib_dumper_class_serialize = { - 0, /* super */ - "serialize", /* name */ - sizeof(grib_dumper_serialize), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - &destroy, /* free mem */ - &dump_long, /* dump long */ - &dump_double, /* dump double */ - &dump_string, /* dump string */ - 0, /* dump string array */ - &dump_label, /* dump labels */ - &dump_bytes, /* dump bytes */ - &dump_bits, /* dump bits */ - &dump_section, /* dump section */ - &dump_values, /* dump values */ + 0, /* super */ + "serialize", /* name */ + sizeof(grib_dumper_serialize), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + &destroy, /* free mem */ + &dump_long, /* dump long */ + &dump_double, /* dump double */ + &dump_string, /* dump string */ + 0, /* dump string array */ + &dump_label, /* dump labels */ + &dump_bytes, /* dump bytes */ + &dump_bits, /* dump bits */ + &dump_section, /* dump section */ + &dump_values, /* dump values */ 0, /* header */ 0, /* footer */ }; @@ -83,70 +84,72 @@ static grib_dumper_class _grib_dumper_class_serialize = { grib_dumper_class* grib_dumper_class_serialize = &_grib_dumper_class_serialize; /* END_CLASS_IMP */ -static void init_class (grib_dumper_class* c){} +static void init_class(grib_dumper_class* c) {} -static int init(grib_dumper* d) +static int init(grib_dumper* d) { - grib_dumper_serialize *self = (grib_dumper_serialize*)d; - self->format = (char*)d->arg; + grib_dumper_serialize* self = (grib_dumper_serialize*)d; + self->format = (char*)d->arg; return GRIB_SUCCESS; } -static int destroy (grib_dumper* d) +static int destroy(grib_dumper* d) { return GRIB_SUCCESS; } -static void dump_long(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_serialize *self = (grib_dumper_serialize*)d; - long value=0; size_t size = 1; - int err = grib_unpack_long(a,&value,&size); + grib_dumper_serialize* self = (grib_dumper_serialize*)d; + long value = 0; + size_t size = 1; + int err = grib_unpack_long(a, &value, &size); - if( (a->flags & GRIB_ACCESSOR_FLAG_HIDDEN) != 0 ) + if ((a->flags & GRIB_ACCESSOR_FLAG_HIDDEN) != 0) return; - if( (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0 && - (d->option_flags & GRIB_DUMP_FLAG_READ_ONLY) == 0 && - (strcmp(a->cclass->name,"lookup") != 0) ) + if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0 && + (d->option_flags & GRIB_DUMP_FLAG_READ_ONLY) == 0 && + (strcmp(a->cclass->name, "lookup") != 0)) return; - if( ((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && (value == GRIB_MISSING_LONG)) - fprintf(self->dumper.out,"%s = MISSING", a->name); + if (((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && (value == GRIB_MISSING_LONG)) + fprintf(self->dumper.out, "%s = MISSING", a->name); else - fprintf(self->dumper.out,"%s = %ld", a->name,value); + fprintf(self->dumper.out, "%s = %ld", a->name, value); - if ( ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) && - (strcmp(a->cclass->name,"lookup") != 0) ) - fprintf(self->dumper.out," (read_only)"); + if (((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) && + (strcmp(a->cclass->name, "lookup") != 0)) + fprintf(self->dumper.out, " (read_only)"); #if 0 if(comment) fprintf(self->dumper.out," [%s]",comment); #endif - if(err) - fprintf(self->dumper.out," *** ERR=%d (%s) [grib_dumper_serialize::dump_long]",err,grib_get_error_message(err)); + if (err) + fprintf(self->dumper.out, " *** ERR=%d (%s) [grib_dumper_serialize::dump_long]", err, grib_get_error_message(err)); - fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out, "\n"); } #if 0 static int test_bit(long a, long b) {return a&(1<flags & GRIB_ACCESSOR_FLAG_HIDDEN) != 0 ) + if ((a->flags & GRIB_ACCESSOR_FLAG_HIDDEN) != 0) return; - if( (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0 && - (d->option_flags & GRIB_DUMP_FLAG_READ_ONLY) == 0) + if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0 && + (d->option_flags & GRIB_DUMP_FLAG_READ_ONLY) == 0) return; - fprintf(self->dumper.out,"%s = %ld ", a->name,value); + fprintf(self->dumper.out, "%s = %ld ", a->name, value); #if 0 @@ -163,236 +166,247 @@ static void dump_bits(grib_dumper* d,grib_accessor* a,const char* comment) else fprintf(self->dumper.out,"]"); #endif - if(err) - fprintf(self->dumper.out," *** ERR=%d (%s)",err,grib_get_error_message(err)); + if (err) + fprintf(self->dumper.out, " *** ERR=%d (%s)", err, grib_get_error_message(err)); - fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out, "\n"); } -static void dump_double(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_serialize *self = (grib_dumper_serialize*)d; - double value; size_t size = 1; - int err = grib_unpack_double(a,&value,&size); + grib_dumper_serialize* self = (grib_dumper_serialize*)d; + double value; + size_t size = 1; + int err = grib_unpack_double(a, &value, &size); - if( (a->flags & GRIB_ACCESSOR_FLAG_HIDDEN) != 0 ) + if ((a->flags & GRIB_ACCESSOR_FLAG_HIDDEN) != 0) return; - if( (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0 && - (d->option_flags & GRIB_DUMP_FLAG_READ_ONLY) == 0) + if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0 && + (d->option_flags & GRIB_DUMP_FLAG_READ_ONLY) == 0) return; - if( ((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && (value == GRIB_MISSING_DOUBLE)) - fprintf(self->dumper.out,"%s = MISSING", a->name); + if (((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && (value == GRIB_MISSING_DOUBLE)) + fprintf(self->dumper.out, "%s = MISSING", a->name); else - fprintf(self->dumper.out,"%s = %g",a->name,value); + fprintf(self->dumper.out, "%s = %g", a->name, value); - if ( (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0 ) fprintf(self->dumper.out," (read_only)"); + if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + fprintf(self->dumper.out, " (read_only)"); #if 0 if(comment) fprintf(self->dumper.out," [%s]",comment); #endif - if(err) - fprintf(self->dumper.out," *** ERR=%d (%s) [grib_dumper_serialize::dump_double]",err,grib_get_error_message(err)); - fprintf(self->dumper.out,"\n"); + if (err) + fprintf(self->dumper.out, " *** ERR=%d (%s) [grib_dumper_serialize::dump_double]", err, grib_get_error_message(err)); + fprintf(self->dumper.out, "\n"); } -static void dump_string(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_serialize *self = (grib_dumper_serialize*)d; - char value[1024]={0,}; size_t size = sizeof(value); - int err = grib_unpack_string(a,value,&size); + grib_dumper_serialize* self = (grib_dumper_serialize*)d; + char value[1024] = {0,}; + size_t size = sizeof(value); + int err = grib_unpack_string(a, value, &size); int i; - char *p = value; + char* p = value; - if( (a->flags & GRIB_ACCESSOR_FLAG_HIDDEN) != 0 ) + if ((a->flags & GRIB_ACCESSOR_FLAG_HIDDEN) != 0) return; - if( (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0 && - (d->option_flags & GRIB_DUMP_FLAG_READ_ONLY) == 0) + if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0 && + (d->option_flags & GRIB_DUMP_FLAG_READ_ONLY) == 0) return; - while(*p) { if(!isprint(*p)) *p = '.'; p++; } + while (*p) { + if (!isprint(*p)) + *p = '.'; + p++; + } - for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," "); + for (i = 0; i < d->depth; i++) + fprintf(self->dumper.out, " "); - fprintf(self->dumper.out,"%s = %s", a->name,value); - if ( (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0 ) fprintf(self->dumper.out," (read_only)"); + fprintf(self->dumper.out, "%s = %s", a->name, value); + if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + fprintf(self->dumper.out, " (read_only)"); #if 0 if(comment) fprintf(self->dumper.out," [%s]",comment); #endif - if(err) - fprintf(self->dumper.out," *** ERR=%d (%s) [grib_dumper_serialize::dump_string]",err,grib_get_error_message(err)); - fprintf(self->dumper.out,"\n"); - + if (err) + fprintf(self->dumper.out, " *** ERR=%d (%s) [grib_dumper_serialize::dump_string]", err, grib_get_error_message(err)); + fprintf(self->dumper.out, "\n"); } -static void dump_bytes(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_serialize *self = (grib_dumper_serialize*)d; - int i,k,err =0; - int more = 0; - size_t size = a->length; - unsigned char* buf = (unsigned char*)grib_context_malloc(d->handle->context,size); + grib_dumper_serialize* self = (grib_dumper_serialize*)d; + int i, k, err = 0; + int more = 0; + size_t size = a->length; + unsigned char* buf = (unsigned char*)grib_context_malloc(d->handle->context, size); - if( (a->flags & GRIB_ACCESSOR_FLAG_HIDDEN) != 0 ) + if ((a->flags & GRIB_ACCESSOR_FLAG_HIDDEN) != 0) return; - if( (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0 && - (d->option_flags & GRIB_DUMP_FLAG_READ_ONLY) == 0) + if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0 && + (d->option_flags & GRIB_DUMP_FLAG_READ_ONLY) == 0) return; - for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"%s = (%ld) {", a->name,a->length); + for (i = 0; i < d->depth; i++) + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "%s = (%ld) {", a->name, a->length); - if(!buf) - { - if(size == 0) - fprintf(self->dumper.out,"}\n"); + if (!buf) { + if (size == 0) + fprintf(self->dumper.out, "}\n"); else - fprintf(self->dumper.out," *** ERR cannot malloc(%ld) }\n",(long)size); + fprintf(self->dumper.out, " *** ERR cannot malloc(%ld) }\n", (long)size); return; } - fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out, "\n"); - err = grib_unpack_bytes(a,buf,&size); - if(err){ - grib_context_free(d->handle->context,buf); - fprintf(self->dumper.out," *** ERR=%d (%s) [grib_dumper_serialize::dump_bytes]\n}",err,grib_get_error_message(err)); - return ; + err = grib_unpack_bytes(a, buf, &size); + if (err) { + grib_context_free(d->handle->context, buf); + fprintf(self->dumper.out, " *** ERR=%d (%s) [grib_dumper_serialize::dump_bytes]\n}", err, grib_get_error_message(err)); + return; } - if(size > 100) { + if (size > 100) { more = size - 100; size = 100; } k = 0; /* if(size > 100) size = 100; */ - while(k < size) - { + while (k < size) { int j; - for(i = 0; i < d->depth + 3 ; i++) fprintf(self->dumper.out," "); - for(j = 0; j < 16 && k < size; j++, k++) - { - fprintf(self->dumper.out,"%02x",buf[k]); - if(k != size-1) - fprintf(self->dumper.out,", "); + for (i = 0; i < d->depth + 3; i++) + fprintf(self->dumper.out, " "); + for (j = 0; j < 16 && k < size; j++, k++) { + fprintf(self->dumper.out, "%02x", buf[k]); + if (k != size - 1) + fprintf(self->dumper.out, ", "); } - fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out, "\n"); } - if(more) - { - for(i = 0; i < d->depth + 3 ; i++) fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"... %d more values\n",more); + if (more) { + for (i = 0; i < d->depth + 3; i++) + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "... %d more values\n", more); } - for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"} # %s %s \n",a->creator->op, a->name); - grib_context_free(d->handle->context,buf); + for (i = 0; i < d->depth; i++) + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "} # %s %s \n", a->creator->op, a->name); + grib_context_free(d->handle->context, buf); } -static void dump_values(grib_dumper* d,grib_accessor* a) +static void dump_values(grib_dumper* d, grib_accessor* a) { - grib_dumper_serialize *self = (grib_dumper_serialize*)d; - int k,err =0; - double* buf = NULL; - int last=0; - int columns=4; - char* values_format=NULL; - char* default_format="%.16e"; - char* columns_str=NULL; - size_t len=0; - char* pc=NULL; - char* pcf=NULL; - size_t size=0; - long count=0; - values_format=default_format; - - if((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY)) + grib_dumper_serialize* self = (grib_dumper_serialize*)d; + int k, err = 0; + double* buf = NULL; + int last = 0; + int columns = 4; + char* values_format = NULL; + char* default_format = "%.16e"; + char* columns_str = NULL; + size_t len = 0; + char* pc = NULL; + char* pcf = NULL; + size_t size = 0; + long count = 0; + values_format = default_format; + + if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY)) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; if (self->format) { - if (self->format[0]=='\"') values_format=self->format+1; - else values_format=self->format; - last=strlen(values_format)-1; - if (values_format[last]=='\"') values_format[last]='\0'; + if (self->format[0] == '\"') + values_format = self->format + 1; + else + values_format = self->format; + last = strlen(values_format) - 1; + if (values_format[last] == '\"') + values_format[last] = '\0'; } - pc = values_format; + pc = values_format; pcf = values_format; - while( *pc!='\0' && *pc != '%') pc++; - if (strlen(pc) > 1 ) { - values_format=pc; - len=pc-pcf; - } else { - values_format=default_format; - len=0; + while (*pc != '\0' && *pc != '%') + pc++; + if (strlen(pc) > 1) { + values_format = pc; + len = pc - pcf; + } + else { + values_format = default_format; + len = 0; } - if (len>0) { - columns_str=(char*)malloc((len+1)*sizeof(char)); + if (len > 0) { + columns_str = (char*)malloc((len + 1) * sizeof(char)); Assert(columns_str); - columns_str=(char*)memcpy(columns_str,pcf,len); - columns_str[len]='\0'; - columns=atoi(columns_str); + columns_str = (char*)memcpy(columns_str, pcf, len); + columns_str[len] = '\0'; + columns = atoi(columns_str); free(columns_str); } - if(size == 1){ - dump_double(d,a,NULL); - return ; + if (size == 1) { + dump_double(d, a, NULL); + return; } - if ((d->option_flags & GRIB_DUMP_FLAG_VALUES) == 0 ) return; + if ((d->option_flags & GRIB_DUMP_FLAG_VALUES) == 0) + return; - buf = (double*)grib_context_malloc(d->handle->context,size * sizeof(double)); + buf = (double*)grib_context_malloc(d->handle->context, size * sizeof(double)); - fprintf(self->dumper.out,"%s (%ld) {",a->name,(long)size); + fprintf(self->dumper.out, "%s (%ld) {", a->name, (long)size); - if(!buf) - { - if(size == 0) - fprintf(self->dumper.out,"}\n"); + if (!buf) { + if (size == 0) + fprintf(self->dumper.out, "}\n"); else - fprintf(self->dumper.out," *** ERR cannot malloc(%ld) }\n",(long)size); + fprintf(self->dumper.out, " *** ERR cannot malloc(%ld) }\n", (long)size); return; } - fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out, "\n"); - err = grib_unpack_double(a,buf,&size); + err = grib_unpack_double(a, buf, &size); - if(err){ - grib_context_free(d->handle->context,buf); - fprintf(self->dumper.out," *** ERR=%d (%s) [grib_dumper_serialize::dump_values]\n}",err,grib_get_error_message(err)); - return ; + if (err) { + grib_context_free(d->handle->context, buf); + fprintf(self->dumper.out, " *** ERR=%d (%s) [grib_dumper_serialize::dump_values]\n}", err, grib_get_error_message(err)); + return; } k = 0; - while(k < size) - { + while (k < size) { int j; - for(j = 0; j < columns && k < size; j++, k++) - { - fprintf(self->dumper.out,values_format,buf[k]); - if(k != size-1) - fprintf(self->dumper.out,", "); + for (j = 0; j < columns && k < size; j++, k++) { + fprintf(self->dumper.out, values_format, buf[k]); + if (k != size - 1) + fprintf(self->dumper.out, ", "); } - fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out, "\n"); } - fprintf(self->dumper.out,"}\n"); - grib_context_free(d->handle->context,buf); + fprintf(self->dumper.out, "}\n"); + grib_context_free(d->handle->context, buf); } -static void dump_label(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_label(grib_dumper* d, grib_accessor* a, const char* comment) { #if 0 grib_dumper_serialize *self = (grib_dumper_serialize*)d; @@ -402,23 +416,23 @@ static void dump_label(grib_dumper* d,grib_accessor* a,const char* comment) #endif } -static void dump_section(grib_dumper* d,grib_accessor* a,grib_block_of_accessors* block) +static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block) { - const char* secstr="section"; - int len=0; - grib_dumper_serialize *self = (grib_dumper_serialize*)d; + const char* secstr = "section"; + int len = 0; + grib_dumper_serialize* self = (grib_dumper_serialize*)d; - len=strlen(secstr); + len = strlen(secstr); - if(a->name[0] == '_'){ - grib_dump_accessors_block(d,block); + if (a->name[0] == '_') { + grib_dump_accessors_block(d, block); return; } - if (strncmp(secstr,a->name,len)==0) - fprintf(self->dumper.out,"#------ %s -------\n",a->name); + if (strncmp(secstr, a->name, len) == 0) + fprintf(self->dumper.out, "#------ %s -------\n", a->name); - grib_dump_accessors_block(d,block); + grib_dump_accessors_block(d, block); #if 0 fprintf(self->dumper.out,"<------ %s %s\n",a->creator->op, a->name); diff --git a/src/grib_dumper_class_wmo.c b/src/grib_dumper_class_wmo.c index feb08475f..275c94a5b 100644 --- a/src/grib_dumper_class_wmo.c +++ b/src/grib_dumper_class_wmo.c @@ -43,456 +43,471 @@ or edit "dumper.class" and rerun ./make_class.pl */ -static void init_class (grib_dumper_class*); -static int init (grib_dumper* d); -static int destroy (grib_dumper*); -static void dump_long (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_bits (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_double (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_string (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_string_array (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_bytes (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_values (grib_dumper* d, grib_accessor* a); -static void dump_label (grib_dumper* d, grib_accessor* a,const char* comment); -static void dump_section (grib_dumper* d, grib_accessor* a,grib_block_of_accessors* block); - -typedef struct grib_dumper_wmo { - grib_dumper dumper; -/* Members defined in wmo */ - long section_offset; - long begin; - long theEnd; +static void init_class(grib_dumper_class*); +static int init(grib_dumper* d); +static int destroy(grib_dumper*); +static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_bits(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_values(grib_dumper* d, grib_accessor* a); +static void dump_label(grib_dumper* d, grib_accessor* a, const char* comment); +static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block); + +typedef struct grib_dumper_wmo +{ + grib_dumper dumper; + /* Members defined in wmo */ + long section_offset; + long begin; + long theEnd; } grib_dumper_wmo; static grib_dumper_class _grib_dumper_class_wmo = { - 0, /* super */ - "wmo", /* name */ - sizeof(grib_dumper_wmo), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - &destroy, /* free mem */ - &dump_long, /* dump long */ - &dump_double, /* dump double */ - &dump_string, /* dump string */ - &dump_string_array, /* dump string array */ - &dump_label, /* dump labels */ - &dump_bytes, /* dump bytes */ - &dump_bits, /* dump bits */ - &dump_section, /* dump section */ - &dump_values, /* dump values */ - 0, /* header */ - 0, /* footer */ + 0, /* super */ + "wmo", /* name */ + sizeof(grib_dumper_wmo), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + &destroy, /* free mem */ + &dump_long, /* dump long */ + &dump_double, /* dump double */ + &dump_string, /* dump string */ + &dump_string_array, /* dump string array */ + &dump_label, /* dump labels */ + &dump_bytes, /* dump bytes */ + &dump_bits, /* dump bits */ + &dump_section, /* dump section */ + &dump_values, /* dump values */ + 0, /* header */ + 0, /* footer */ }; grib_dumper_class* grib_dumper_class_wmo = &_grib_dumper_class_wmo; /* END_CLASS_IMP */ -static void set_begin_end(grib_dumper* d,grib_accessor* a); -static void print_offset(FILE* out,long begin,long theEnd); -static void print_hexadecimal(FILE* out,unsigned long flags,grib_accessor* a); +static void set_begin_end(grib_dumper* d, grib_accessor* a); +static void print_offset(FILE* out, long begin, long theEnd); +static void print_hexadecimal(FILE* out, unsigned long flags, grib_accessor* a); -static void init_class (grib_dumper_class* c){} +static void init_class(grib_dumper_class* c) {} -static int init(grib_dumper* d) +static int init(grib_dumper* d) { - grib_dumper_wmo *self = (grib_dumper_wmo*)d; - self->section_offset=0; + grib_dumper_wmo* self = (grib_dumper_wmo*)d; + self->section_offset = 0; return GRIB_SUCCESS; } -static int destroy (grib_dumper* d) +static int destroy(grib_dumper* d) { return GRIB_SUCCESS; } -static void aliases(grib_dumper* d,grib_accessor* a) +static void aliases(grib_dumper* d, grib_accessor* a) { int i; - grib_dumper_wmo *self = (grib_dumper_wmo*)d; + grib_dumper_wmo* self = (grib_dumper_wmo*)d; - if( (d->option_flags & GRIB_DUMP_FLAG_ALIASES) == 0) + if ((d->option_flags & GRIB_DUMP_FLAG_ALIASES) == 0) return; - if(a->all_names[1]) - { - char *sep = ""; - fprintf(self->dumper.out," ["); - - for(i = 1; i < MAX_ACCESSOR_NAMES; i++) - { - if(a->all_names[i]) - { - if(a->all_name_spaces[i]) - fprintf(self->dumper.out,"%s%s.%s", sep,a->all_name_spaces[i],a->all_names[i]); + if (a->all_names[1]) { + char* sep = ""; + fprintf(self->dumper.out, " ["); + + for (i = 1; i < MAX_ACCESSOR_NAMES; i++) { + if (a->all_names[i]) { + if (a->all_name_spaces[i]) + fprintf(self->dumper.out, "%s%s.%s", sep, a->all_name_spaces[i], a->all_names[i]); else - fprintf(self->dumper.out,"%s%s", sep,a->all_names[i]); + fprintf(self->dumper.out, "%s%s", sep, a->all_names[i]); } sep = ", "; } - fprintf(self->dumper.out,"]"); + fprintf(self->dumper.out, "]"); } } -static void dump_long(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_wmo *self = (grib_dumper_wmo*)d; - long value = 0; size_t size = 0; - long *values=NULL; + grib_dumper_wmo* self = (grib_dumper_wmo*)d; + long value = 0; + size_t size = 0; + long* values = NULL; int err = 0, i = 0; long count = 0; - if( a->length == 0 && - (d->option_flags & GRIB_DUMP_FLAG_CODED) != 0) + if (a->length == 0 && + (d->option_flags & GRIB_DUMP_FLAG_CODED) != 0) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; - if (size>1) { - values=(long*)grib_context_malloc_clear(a->context,sizeof(long)*size); - err=grib_unpack_long(a,values,&size); - } else { - err=grib_unpack_long(a,&value,&size); + if (size > 1) { + values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); + err = grib_unpack_long(a, values, &size); + } + else { + err = grib_unpack_long(a, &value, &size); } - if( (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0 && - (d->option_flags & GRIB_DUMP_FLAG_READ_ONLY) == 0) + if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0 && + (d->option_flags & GRIB_DUMP_FLAG_READ_ONLY) == 0) return; - set_begin_end(d,a); + set_begin_end(d, a); - print_offset(self->dumper.out,self->begin,self->theEnd); + print_offset(self->dumper.out, self->begin, self->theEnd); if ((d->option_flags & GRIB_DUMP_FLAG_TYPE) != 0) - fprintf(self->dumper.out,"%s ",a->creator->op); + fprintf(self->dumper.out, "%s ", a->creator->op); - if (size>1) { - int cols=19; - int icount=0; - fprintf(self->dumper.out,"%s = { \t",a->name); + if (size > 1) { + int cols = 19; + int icount = 0; + fprintf(self->dumper.out, "%s = { \t", a->name); if (values) { - for (i=0;icols) {fprintf(self->dumper.out,"\n\t\t\t\t");icount=0;} - fprintf(self->dumper.out,"%ld ",values[i]); + for (i = 0; i < size; i++) { + if (icount > cols) { + fprintf(self->dumper.out, "\n\t\t\t\t"); + icount = 0; + } + fprintf(self->dumper.out, "%ld ", values[i]); icount++; } - fprintf(self->dumper.out,"}\n"); - grib_context_free(a->context,values); + fprintf(self->dumper.out, "}\n"); + grib_context_free(a->context, values); } - } else { - if( ((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && grib_is_missing_internal(a) ) - fprintf(self->dumper.out,"%s = MISSING",a->name); + } + else { + if (((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && grib_is_missing_internal(a)) + fprintf(self->dumper.out, "%s = MISSING", a->name); else - fprintf(self->dumper.out,"%s = %ld",a->name,value); + fprintf(self->dumper.out, "%s = %ld", a->name, value); - print_hexadecimal(self->dumper.out,d->option_flags,a); + print_hexadecimal(self->dumper.out, d->option_flags, a); - if(comment) fprintf(self->dumper.out," [%s]",comment); + if (comment) + fprintf(self->dumper.out, " [%s]", comment); } - if(err) - fprintf(self->dumper.out," *** ERR=%d (%s) [grib_dumper_wmo::dump_long]",err,grib_get_error_message(err)); + if (err) + fprintf(self->dumper.out, " *** ERR=%d (%s) [grib_dumper_wmo::dump_long]", err, grib_get_error_message(err)); - aliases(d,a); + aliases(d, a); - fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out, "\n"); } -static int test_bit(long a, long b) {return a&(1<length == 0 && - (d->option_flags & GRIB_DUMP_FLAG_CODED) != 0) + if (a->length == 0 && + (d->option_flags & GRIB_DUMP_FLAG_CODED) != 0) return; - err = grib_unpack_long(a,&value,&size); - set_begin_end(d,a); + err = grib_unpack_long(a, &value, &size); + set_begin_end(d, a); /*for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," ");*/ - print_offset(self->dumper.out,self->begin,self->theEnd); + print_offset(self->dumper.out, self->begin, self->theEnd); if ((d->option_flags & GRIB_DUMP_FLAG_TYPE) != 0) - fprintf(self->dumper.out,"%s ",a->creator->op); + fprintf(self->dumper.out, "%s ", a->creator->op); - fprintf(self->dumper.out,"%s = %ld [",a->name,value); + fprintf(self->dumper.out, "%s = %ld [", a->name, value); - for(i=0;i<(a->length*8);i++) { - if(test_bit(value,a->length*8-i-1)) - fprintf(self->dumper.out,"1"); + for (i = 0; i < (a->length * 8); i++) { + if (test_bit(value, a->length * 8 - i - 1)) + fprintf(self->dumper.out, "1"); else - fprintf(self->dumper.out,"0"); + fprintf(self->dumper.out, "0"); } /* if(comment) fprintf(self->dumper.out,":%s]",comment); else */ - fprintf(self->dumper.out,"]"); + fprintf(self->dumper.out, "]"); - if (err==0) print_hexadecimal(self->dumper.out,d->option_flags,a); + if (err == 0) + print_hexadecimal(self->dumper.out, d->option_flags, a); - if(err) - fprintf(self->dumper.out," *** ERR=%d (%s) [grib_dumper_wmo::dump_bits]",err,grib_get_error_message(err)); + if (err) + fprintf(self->dumper.out, " *** ERR=%d (%s) [grib_dumper_wmo::dump_bits]", err, grib_get_error_message(err)); - aliases(d,a); - fprintf(self->dumper.out,"\n"); + aliases(d, a); + fprintf(self->dumper.out, "\n"); } -static void dump_double(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_wmo *self = (grib_dumper_wmo*)d; - double value=0; size_t size = 1; - int err = 0; + grib_dumper_wmo* self = (grib_dumper_wmo*)d; + double value = 0; + size_t size = 1; + int err = 0; - if( a->length == 0 && - (d->option_flags & GRIB_DUMP_FLAG_CODED) != 0) + if (a->length == 0 && + (d->option_flags & GRIB_DUMP_FLAG_CODED) != 0) return; - err = grib_unpack_double(a,&value,&size); - set_begin_end(d,a); + err = grib_unpack_double(a, &value, &size); + set_begin_end(d, a); /*for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," ");*/ - print_offset(self->dumper.out,self->begin,self->theEnd); + print_offset(self->dumper.out, self->begin, self->theEnd); if ((d->option_flags & GRIB_DUMP_FLAG_TYPE) != 0) - fprintf(self->dumper.out,"%s ",a->creator->op); + fprintf(self->dumper.out, "%s ", a->creator->op); - if( ((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && grib_is_missing_internal(a)) - fprintf(self->dumper.out,"%s = MISSING",a->name); + if (((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && grib_is_missing_internal(a)) + fprintf(self->dumper.out, "%s = MISSING", a->name); else - fprintf(self->dumper.out,"%s = %g",a->name,value); + fprintf(self->dumper.out, "%s = %g", a->name, value); /*if(comment) fprintf(self->dumper.out," [%s]",comment);*/ - if (err==0) print_hexadecimal(self->dumper.out,d->option_flags,a); + if (err == 0) + print_hexadecimal(self->dumper.out, d->option_flags, a); - if(err) - fprintf(self->dumper.out," *** ERR=%d (%s) [grib_dumper_wmo::dump_double]",err,grib_get_error_message(err)); - aliases(d,a); - fprintf(self->dumper.out,"\n"); + if (err) + fprintf(self->dumper.out, " *** ERR=%d (%s) [grib_dumper_wmo::dump_double]", err, grib_get_error_message(err)); + aliases(d, a); + fprintf(self->dumper.out, "\n"); } -static void dump_string(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_wmo *self = (grib_dumper_wmo*)d; - size_t size=0; - char *value=NULL; - char *p=NULL; - int err = 0; - - if( a->length == 0 && - (d->option_flags & GRIB_DUMP_FLAG_CODED) != 0) { + grib_dumper_wmo* self = (grib_dumper_wmo*)d; + size_t size = 0; + char* value = NULL; + char* p = NULL; + int err = 0; + + if (a->length == 0 && + (d->option_flags & GRIB_DUMP_FLAG_CODED) != 0) { return; } - err = _grib_get_string_length(a,&size); - value=(char*)grib_context_malloc_clear(a->context,size); + err = _grib_get_string_length(a, &size); + value = (char*)grib_context_malloc_clear(a->context, size); if (!value) { - grib_context_log(a->context,GRIB_LOG_FATAL,"unable to allocate %d bytes",(int)size); + grib_context_log(a->context, GRIB_LOG_FATAL, "unable to allocate %d bytes", (int)size); return; } - err=grib_unpack_string(a,value,&size); - p=value; + err = grib_unpack_string(a, value, &size); + p = value; - set_begin_end(d,a); + set_begin_end(d, a); - while(*p) { if(!isprint(*p)) *p = '.'; p++; } + while (*p) { + if (!isprint(*p)) + *p = '.'; + p++; + } /*for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," ");*/ - print_offset(self->dumper.out,self->begin,self->theEnd); + print_offset(self->dumper.out, self->begin, self->theEnd); if ((d->option_flags & GRIB_DUMP_FLAG_TYPE) != 0) - fprintf(self->dumper.out,"%s ",a->creator->op); + fprintf(self->dumper.out, "%s ", a->creator->op); - fprintf(self->dumper.out,"%s = %s",a->name,value); + fprintf(self->dumper.out, "%s = %s", a->name, value); - if (err==0) print_hexadecimal(self->dumper.out,d->option_flags,a); + if (err == 0) + print_hexadecimal(self->dumper.out, d->option_flags, a); /*if(comment) fprintf(self->dumper.out," [%s]",comment);*/ - if(err) - fprintf(self->dumper.out," *** ERR=%d (%s) [grib_dumper_wmo::dump_string]",err,grib_get_error_message(err)); - aliases(d,a); - fprintf(self->dumper.out,"\n"); - grib_context_free(a->context,value); + if (err) + fprintf(self->dumper.out, " *** ERR=%d (%s) [grib_dumper_wmo::dump_string]", err, grib_get_error_message(err)); + aliases(d, a); + fprintf(self->dumper.out, "\n"); + grib_context_free(a->context, value); } -static void dump_bytes(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_wmo *self = (grib_dumper_wmo*)d; - int i,k,err =0; - int more = 0; - size_t size = a->length; - unsigned char* buf = (unsigned char*)grib_context_malloc(d->handle->context,size); - - if( a->length == 0 && - (d->option_flags & GRIB_DUMP_FLAG_CODED) != 0) + grib_dumper_wmo* self = (grib_dumper_wmo*)d; + int i, k, err = 0; + int more = 0; + size_t size = a->length; + unsigned char* buf = (unsigned char*)grib_context_malloc(d->handle->context, size); + + if (a->length == 0 && + (d->option_flags & GRIB_DUMP_FLAG_CODED) != 0) return; - set_begin_end(d,a); + set_begin_end(d, a); /*for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," ");*/ - print_offset(self->dumper.out,self->begin,self->theEnd); + print_offset(self->dumper.out, self->begin, self->theEnd); if ((d->option_flags & GRIB_DUMP_FLAG_TYPE) != 0) - fprintf(self->dumper.out,"%s ",a->creator->op); + fprintf(self->dumper.out, "%s ", a->creator->op); - fprintf(self->dumper.out,"%s = %ld",a->name,a->length); - aliases(d,a); - fprintf(self->dumper.out," {"); + fprintf(self->dumper.out, "%s = %ld", a->name, a->length); + aliases(d, a); + fprintf(self->dumper.out, " {"); - if(!buf) - { - if(size == 0) - fprintf(self->dumper.out,"}\n"); + if (!buf) { + if (size == 0) + fprintf(self->dumper.out, "}\n"); else - fprintf(self->dumper.out," *** ERR cannot malloc(%ld) }\n",(long)size); + fprintf(self->dumper.out, " *** ERR cannot malloc(%ld) }\n", (long)size); return; } - print_hexadecimal(self->dumper.out,d->option_flags,a); + print_hexadecimal(self->dumper.out, d->option_flags, a); - fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out, "\n"); - err = grib_unpack_bytes(a,buf,&size); - if(err){ - grib_context_free(d->handle->context,buf); - fprintf(self->dumper.out," *** ERR=%d (%s) [grib_dumper_wmo::dump_bytes]\n}",err,grib_get_error_message(err)); - return ; + err = grib_unpack_bytes(a, buf, &size); + if (err) { + grib_context_free(d->handle->context, buf); + fprintf(self->dumper.out, " *** ERR=%d (%s) [grib_dumper_wmo::dump_bytes]\n}", err, grib_get_error_message(err)); + return; } - if(size > 100) { + if (size > 100) { more = size - 100; size = 100; } k = 0; /* if(size > 100) size = 100; */ - while(k < size) - { + while (k < size) { int j; - for(i = 0; i < d->depth + 3 ; i++) fprintf(self->dumper.out," "); - for(j = 0; j < 16 && k < size; j++, k++) - { - fprintf(self->dumper.out,"%02x",buf[k]); - if(k != size-1) - fprintf(self->dumper.out,", "); + for (i = 0; i < d->depth + 3; i++) + fprintf(self->dumper.out, " "); + for (j = 0; j < 16 && k < size; j++, k++) { + fprintf(self->dumper.out, "%02x", buf[k]); + if (k != size - 1) + fprintf(self->dumper.out, ", "); } - fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out, "\n"); } - if(more) - { - for(i = 0; i < d->depth + 3 ; i++) fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"... %d more values\n",more); + if (more) { + for (i = 0; i < d->depth + 3; i++) + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "... %d more values\n", more); } - for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"} # %s %s \n",a->creator->op, a->name); - grib_context_free(d->handle->context,buf); + for (i = 0; i < d->depth; i++) + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "} # %s %s \n", a->creator->op, a->name); + grib_context_free(d->handle->context, buf); } -static void dump_values(grib_dumper* d,grib_accessor* a) +static void dump_values(grib_dumper* d, grib_accessor* a) { - grib_dumper_wmo *self = (grib_dumper_wmo*)d; - int k,err =0; - int more = 0; - double* buf = NULL; - size_t size=0; - long count=0; + grib_dumper_wmo* self = (grib_dumper_wmo*)d; + int k, err = 0; + int more = 0; + double* buf = NULL; + size_t size = 0; + long count = 0; int is_char = 0; - if( a->length == 0 && - (d->option_flags & GRIB_DUMP_FLAG_CODED) != 0) + if (a->length == 0 && + (d->option_flags & GRIB_DUMP_FLAG_CODED) != 0) return; - grib_value_count(a,&count); - size=count; + grib_value_count(a, &count); + size = count; - if(size == 1){ - dump_double(d,a,NULL); - return ; + if (size == 1) { + dump_double(d, a, NULL); + return; } - buf = (double*)grib_context_malloc(d->handle->context,size * sizeof(double)); + buf = (double*)grib_context_malloc(d->handle->context, size * sizeof(double)); - set_begin_end(d,a); + set_begin_end(d, a); /* For the DIAG pseudo GRIBs. Key charValues uses 1-byte integers to represent a character */ - if ( a->flags & GRIB_ACCESSOR_FLAG_STRING_TYPE ) { + if (a->flags & GRIB_ACCESSOR_FLAG_STRING_TYPE) { is_char = 1; } /*for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," ");*/ - print_offset(self->dumper.out,self->begin,self->theEnd); + print_offset(self->dumper.out, self->begin, self->theEnd); if ((d->option_flags & GRIB_DUMP_FLAG_TYPE) != 0) - fprintf(self->dumper.out,"%s ",a->creator->op); + fprintf(self->dumper.out, "%s ", a->creator->op); - fprintf(self->dumper.out,"%s = (%ld,%ld)",a->name,(long)size,a->length); - aliases(d,a); - fprintf(self->dumper.out," {"); + fprintf(self->dumper.out, "%s = (%ld,%ld)", a->name, (long)size, a->length); + aliases(d, a); + fprintf(self->dumper.out, " {"); - if(!buf) - { - if(size == 0) - fprintf(self->dumper.out,"}\n"); + if (!buf) { + if (size == 0) + fprintf(self->dumper.out, "}\n"); else - fprintf(self->dumper.out," *** ERR cannot malloc(%ld) }\n",(long)size); + fprintf(self->dumper.out, " *** ERR cannot malloc(%ld) }\n", (long)size); return; } - fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out, "\n"); - err = grib_unpack_double(a,buf,&size); + err = grib_unpack_double(a, buf, &size); - if(err){ - grib_context_free(d->handle->context,buf); - fprintf(self->dumper.out," *** ERR=%d (%s) [grib_dumper_wmo::dump_values]\n}",err,grib_get_error_message(err)); - return ; + if (err) { + grib_context_free(d->handle->context, buf); + fprintf(self->dumper.out, " *** ERR=%d (%s) [grib_dumper_wmo::dump_values]\n}", err, grib_get_error_message(err)); + return; } - if(size > 100) { + if (size > 100) { more = size - 100; size = 100; } k = 0; - while(k < size) - { + while (k < size) { #if 1 int j; /*for(i = 0; i < d->depth + 3 ; i++) fprintf(self->dumper.out," ");*/ - for(j = 0; j < 8 && k < size; j++, k++) - { - if (is_char) fprintf(self->dumper.out,"'%c'",(char)buf[k]); - else fprintf(self->dumper.out,"%.10e",buf[k]); - if(k != size-1) - fprintf(self->dumper.out,", "); + for (j = 0; j < 8 && k < size; j++, k++) { + if (is_char) + fprintf(self->dumper.out, "'%c'", (char)buf[k]); + else + fprintf(self->dumper.out, "%.10e", buf[k]); + if (k != size - 1) + fprintf(self->dumper.out, ", "); } - fprintf(self->dumper.out,"\n"); + fprintf(self->dumper.out, "\n"); #else - if(is_char) fprintf(self->dumper.out,"%d '%c'\n",k,(char)buf[k]); - else fprintf(self->dumper.out,"%d %g\n",k,buf[k]); + if (is_char) + fprintf(self->dumper.out, "%d '%c'\n", k, (char)buf[k]); + else + fprintf(self->dumper.out, "%d %g\n", k, buf[k]); #endif - } - if(more) - { + if (more) { /*for(i = 0; i < d->depth + 3 ; i++) fprintf(self->dumper.out," ");*/ - fprintf(self->dumper.out,"... %d more values\n",more); + fprintf(self->dumper.out, "... %d more values\n", more); } /*for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," ");*/ - fprintf(self->dumper.out,"} # %s %s \n",a->creator->op, a->name); - grib_context_free(d->handle->context,buf); + fprintf(self->dumper.out, "} # %s %s \n", a->creator->op, a->name); + grib_context_free(d->handle->context, buf); } -static void dump_label(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_label(grib_dumper* d, grib_accessor* a, const char* comment) { /*grib_dumper_wmo *self = (grib_dumper_wmo*)d; @@ -500,149 +515,152 @@ static void dump_label(grib_dumper* d,grib_accessor* a,const char* comment) fprintf(self->dumper.out,"----> %s %s %s\n",a->creator->op, a->name,comment?comment:"");*/ } -static void dump_section(grib_dumper* d,grib_accessor* a,grib_block_of_accessors* block) +static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block) { - grib_dumper_wmo *self = (grib_dumper_wmo*)d; - grib_section* s = a->sub_section; - int is_wmo_section=0; - char* upper=NULL; + grib_dumper_wmo* self = (grib_dumper_wmo*)d; + grib_section* s = a->sub_section; + int is_wmo_section = 0; + char* upper = NULL; char tmp[512]; - char *p=NULL,*q=NULL; - if (!strncmp(a->name,"section",7)) is_wmo_section=1; + char *p = NULL, *q = NULL; + if (!strncmp(a->name, "section", 7)) + is_wmo_section = 1; /*for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," ");*/ if (is_wmo_section) { - upper=(char*)malloc(strlen(a->name)+1); + upper = (char*)malloc(strlen(a->name) + 1); Assert(upper); - p=(char*)a->name; - q=upper; + p = (char*)a->name; + q = upper; while (*p != '\0') { - *q=toupper(*p); + *q = toupper(*p); q++; p++; } - *q='\0'; - sprintf(tmp,"%s ( length=%ld, padding=%ld )",upper,(long)s->length,(long)s->padding); - fprintf(self->dumper.out,"====================== %-35s ======================\n",tmp); + *q = '\0'; + sprintf(tmp, "%s ( length=%ld, padding=%ld )", upper, (long)s->length, (long)s->padding); + fprintf(self->dumper.out, "====================== %-35s ======================\n", tmp); free(upper); - self->section_offset=a->offset; - } else { - + self->section_offset = a->offset; + } + else { } /*printf("------------- section_offset = %ld\n",self->section_offset);*/ d->depth += 3; - grib_dump_accessors_block(d,block); + grib_dump_accessors_block(d, block); d->depth -= 3; /*for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," ");*/ /*fprintf(self->dumper.out,"<===== %s %s\n",a->creator->op, a->name);*/ } -static void set_begin_end(grib_dumper* d,grib_accessor* a) +static void set_begin_end(grib_dumper* d, grib_accessor* a) { - grib_dumper_wmo *self = (grib_dumper_wmo*)d; + grib_dumper_wmo* self = (grib_dumper_wmo*)d; if ((d->option_flags & GRIB_DUMP_FLAG_OCTECT) != 0) { - - self->begin=a->offset-self->section_offset+1; - self->theEnd=grib_get_next_position_offset(a)-self->section_offset; - } else { - self->begin=a->offset; - self->theEnd=grib_get_next_position_offset(a); + self->begin = a->offset - self->section_offset + 1; + self->theEnd = grib_get_next_position_offset(a) - self->section_offset; + } + else { + self->begin = a->offset; + self->theEnd = grib_get_next_position_offset(a); } } -static void print_offset(FILE* out,long begin,long theEnd) +static void print_offset(FILE* out, long begin, long theEnd) { char tmp[50]; if (begin == theEnd) - fprintf(out,"%-10ld" ,begin); + fprintf(out, "%-10ld", begin); else { - sprintf(tmp,"%ld-%ld" ,begin,theEnd); - fprintf(out,"%-10s",tmp); + sprintf(tmp, "%ld-%ld", begin, theEnd); + fprintf(out, "%-10s", tmp); } } -static void print_hexadecimal(FILE* out,unsigned long flags,grib_accessor* a) +static void print_hexadecimal(FILE* out, unsigned long flags, grib_accessor* a) { - int i=0; - unsigned long offset=0; - grib_handle* h=grib_handle_of_accessor(a); + int i = 0; + unsigned long offset = 0; + grib_handle* h = grib_handle_of_accessor(a); if ((flags & GRIB_DUMP_FLAG_HEXADECIMAL) != 0 && a->length != 0) { - fprintf(out," ("); - offset=a->offset; - for (i=0;ilength;i++) { - fprintf(out," 0x%.2X",h->buffer->data[offset]); + fprintf(out, " ("); + offset = a->offset; + for (i = 0; i < a->length; i++) { + fprintf(out, " 0x%.2X", h->buffer->data[offset]); offset++; } - fprintf(out," )"); + fprintf(out, " )"); } } -static void dump_string_array(grib_dumper* d,grib_accessor* a,const char* comment) +static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comment) { - grib_dumper_wmo *self = (grib_dumper_wmo*)d; - char **values; - size_t size = 0,i=0; - grib_context* c=NULL; - int err = 0; - int tab=0; - long count=0; - - c=a->context; - - grib_value_count(a,&count); - if (count==0) return; - size=count; - if (size==1) { - dump_string(d,a,comment); + grib_dumper_wmo* self = (grib_dumper_wmo*)d; + char** values; + size_t size = 0, i = 0; + grib_context* c = NULL; + int err = 0; + int tab = 0; + long count = 0; + + c = a->context; + + grib_value_count(a, &count); + if (count == 0) + return; + size = count; + if (size == 1) { + dump_string(d, a, comment); return; } - values=(char**)grib_context_malloc_clear(c,size*sizeof(char*)); + values = (char**)grib_context_malloc_clear(c, size * sizeof(char*)); if (!values) { - grib_context_log(c,GRIB_LOG_FATAL,"unable to allocate %d bytes",(int)size); + grib_context_log(c, GRIB_LOG_FATAL, "unable to allocate %d bytes", (int)size); return; } - err = grib_unpack_string_array(a,values,&size); + err = grib_unpack_string_array(a, values, &size); - if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; /* print_offset(self->dumper.out,d,a); */ - print_offset(self->dumper.out,self->begin,self->theEnd); + print_offset(self->dumper.out, self->begin, self->theEnd); if ((d->option_flags & GRIB_DUMP_FLAG_TYPE) != 0) { - fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"# type %s \n",a->creator->op); + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "# type %s \n", a->creator->op); } - aliases(d,a); - if(comment) { - fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"# %s \n",comment); + aliases(d, a); + if (comment) { + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "# %s \n", comment); } if (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) { - fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"#-READ ONLY- "); - tab=13; - } else - fprintf(self->dumper.out," "); + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "#-READ ONLY- "); + tab = 13; + } + else + fprintf(self->dumper.out, " "); tab++; - fprintf(self->dumper.out,"%s = {\n",a->name); - for (i=0;idumper.out,"%-*s\"%s\",\n",(int)(tab+strlen(a->name)+4)," ",values[i]); + fprintf(self->dumper.out, "%s = {\n", a->name); + for (i = 0; i < size; i++) { + fprintf(self->dumper.out, "%-*s\"%s\",\n", (int)(tab + strlen(a->name) + 4), " ", values[i]); } - fprintf(self->dumper.out," }"); + fprintf(self->dumper.out, " }"); - if(err) { - fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"# *** ERR=%d (%s)",err,grib_get_error_message(err)); + if (err) { + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "# *** ERR=%d (%s)", err, grib_get_error_message(err)); } - fprintf(self->dumper.out,"\n"); - grib_context_free(c,values); + fprintf(self->dumper.out, "\n"); + grib_context_free(c, values); } diff --git a/src/grib_expression.c b/src/grib_expression.c index 63eeaf80c..21ad00044 100644 --- a/src/grib_expression.c +++ b/src/grib_expression.c @@ -10,241 +10,244 @@ #include "grib_api_internal.h" -int grib_expression_native_type(grib_handle* h,grib_expression* g) +int grib_expression_native_type(grib_handle* h, grib_expression* g) { - grib_expression_class *c = g->cclass; - while(c) - { - if(c->native_type) - return c->native_type(g,h); + grib_expression_class* c = g->cclass; + while (c) { + if (c->native_type) + return c->native_type(g, h); c = c->super ? *(c->super) : NULL; } - grib_context_log(h->context,GRIB_LOG_ERROR, "No native_type() in %s\n",g->cclass->name); - Assert(1==0); + grib_context_log(h->context, GRIB_LOG_ERROR, "No native_type() in %s\n", g->cclass->name); + Assert(1 == 0); return 0; } -int grib_expression_evaluate_long(grib_handle* h,grib_expression* g,long* result) +int grib_expression_evaluate_long(grib_handle* h, grib_expression* g, long* result) { - grib_expression_class *c = g->cclass; - while(c) - { - if(c->evaluate_long) - return c->evaluate_long(g,h,result); + grib_expression_class* c = g->cclass; + while (c) { + if (c->evaluate_long) + return c->evaluate_long(g, h, result); c = c->super ? *(c->super) : NULL; } return GRIB_INVALID_TYPE; } -int grib_expression_evaluate_double(grib_handle* h,grib_expression* g,double* result) +int grib_expression_evaluate_double(grib_handle* h, grib_expression* g, double* result) { - grib_expression_class *c = g->cclass; - while(c) - { - if(c->evaluate_double) - return c->evaluate_double(g,h,result); + grib_expression_class* c = g->cclass; + while (c) { + if (c->evaluate_double) + return c->evaluate_double(g, h, result); c = c->super ? *(c->super) : NULL; } return GRIB_INVALID_TYPE; } -const char* grib_expression_evaluate_string(grib_handle* h,grib_expression* g,char* buf, size_t* size, int *err) +const char* grib_expression_evaluate_string(grib_handle* h, grib_expression* g, char* buf, size_t* size, int* err) { - grib_expression_class *c = g->cclass; - while(c) - { - if(c->evaluate_string) - return c->evaluate_string(g,h,buf,size,err); + grib_expression_class* c = g->cclass; + while (c) { + if (c->evaluate_string) + return c->evaluate_string(g, h, buf, size, err); c = c->super ? *(c->super) : NULL; } - grib_context_log(h->context,GRIB_LOG_ERROR, "No evaluate_string() in %s\n",g->cclass->name); - *err=GRIB_INVALID_TYPE; + grib_context_log(h->context, GRIB_LOG_ERROR, "No evaluate_string() in %s\n", g->cclass->name); + *err = GRIB_INVALID_TYPE; return 0; } const char* grib_expression_get_name(grib_expression* g) { - grib_expression_class *c = g->cclass; - while(c) - { - if(c->get_name) + grib_expression_class* c = g->cclass; + while (c) { + if (c->get_name) return c->get_name(g); c = c->super ? *(c->super) : NULL; } - printf("No expression_get_name() in %s\n",g->cclass->name); - Assert(1==0); + printf("No expression_get_name() in %s\n", g->cclass->name); + Assert(1 == 0); return 0; } -void grib_expression_print(grib_context* ctx,grib_expression* g,grib_handle* f) +void grib_expression_print(grib_context* ctx, grib_expression* g, grib_handle* f) { - grib_expression_class *c = g->cclass; - while(c) - { - if(c->print) - { - c->print(ctx,g,f); + grib_expression_class* c = g->cclass; + while (c) { + if (c->print) { + c->print(ctx, g, f); return; } c = c->super ? *(c->super) : NULL; } - Assert(1==0); + Assert(1 == 0); } -void grib_expression_free(grib_context* ctx,grib_expression* g) +void grib_expression_free(grib_context* ctx, grib_expression* g) { - grib_expression_class *c = g->cclass; - while(c) - { - if(c->destroy) - c->destroy(ctx,g); + grib_expression_class* c = g->cclass; + while (c) { + if (c->destroy) + c->destroy(ctx, g); c = c->super ? *(c->super) : NULL; } - grib_context_free_persistent(ctx,g); + grib_context_free_persistent(ctx, g); } void grib_expression_add_dependency(grib_expression* e, grib_accessor* observer) { - grib_expression_class *c = e->cclass; - while(c) - { - if(c->add_dependency) - { - c->add_dependency(e,observer); - return ; + grib_expression_class* c = e->cclass; + while (c) { + if (c->add_dependency) { + c->add_dependency(e, observer); + return; } c = c->super ? *(c->super) : NULL; } - Assert(1==0); + Assert(1 == 0); } /*----------------------------------------*/ -int grib_expression_set_value(grib_handle* h,grib_expression* g,grib_values* v) +int grib_expression_set_value(grib_handle* h, grib_expression* g, grib_values* v) { char buffer[1024]; - int ret=0; + int ret = 0; size_t size = sizeof(buffer); - switch(v->type = grib_expression_native_type(h,g)) - { - case GRIB_TYPE_LONG: - return grib_expression_evaluate_long(h,g,&v->long_value); - break; - - case GRIB_TYPE_DOUBLE: - return grib_expression_evaluate_double(h,g,&v->double_value); - break; - - case GRIB_TYPE_STRING: - v->string_value = grib_expression_evaluate_string(h,g,buffer,&size,&ret); - if (ret != GRIB_SUCCESS) { - grib_context_log(h->context,GRIB_LOG_ERROR, - "grib_expression_set_value: unable to evaluate %s as string", - grib_expression_get_name( g)); - return ret; - } - Assert(v->string_value != buffer); - Assert(v->string_value); - break; - - default: - Assert(1 == 0); - break; + switch (v->type = grib_expression_native_type(h, g)) { + case GRIB_TYPE_LONG: + return grib_expression_evaluate_long(h, g, &v->long_value); + break; + + case GRIB_TYPE_DOUBLE: + return grib_expression_evaluate_double(h, g, &v->double_value); + break; + + case GRIB_TYPE_STRING: + v->string_value = grib_expression_evaluate_string(h, g, buffer, &size, &ret); + if (ret != GRIB_SUCCESS) { + grib_context_log(h->context, GRIB_LOG_ERROR, + "grib_expression_set_value: unable to evaluate %s as string", + grib_expression_get_name(g)); + return ret; + } + Assert(v->string_value != buffer); + Assert(v->string_value); + break; + + default: + Assert(1 == 0); + break; } return 0; } /*----------------------------------------*/ -grib_arguments *grib_arguments_new(grib_context* c,grib_expression* g, grib_arguments* n) +grib_arguments* grib_arguments_new(grib_context* c, grib_expression* g, grib_arguments* n) { - grib_arguments* l = (grib_arguments*)grib_context_malloc_clear_persistent(c,sizeof(grib_arguments)); - l->expression = g; - l->next = n; + grib_arguments* l = (grib_arguments*)grib_context_malloc_clear_persistent(c, sizeof(grib_arguments)); + l->expression = g; + l->next = n; return l; } -void grib_arguments_free(grib_context* c,grib_arguments* g) +void grib_arguments_free(grib_context* c, grib_arguments* g) { - if(g) { - grib_arguments_free(c,g->next); - grib_expression_free(c,g->expression); - grib_context_free_persistent(c,g); + if (g) { + grib_arguments_free(c, g->next); + grib_expression_free(c, g->expression); + grib_context_free_persistent(c, g); } } -void grib_arguments_print(grib_context* c,grib_arguments* g,grib_handle* f) +void grib_arguments_print(grib_context* c, grib_arguments* g, grib_handle* f) { - if(g) { - if(g->expression) - grib_expression_print(c,g->expression,f); - if(g->next) - { + if (g) { + if (g->expression) + grib_expression_print(c, g->expression, f); + if (g->next) { printf(","); - grib_arguments_print(c,g->next,f); + grib_arguments_print(c, g->next, f); } } } -const char *grib_arguments_get_name(grib_handle *h, grib_arguments *args, int n) +const char* grib_arguments_get_name(grib_handle* h, grib_arguments* args, int n) { - grib_expression *e = NULL; - while(args && n-->0) {args = args->next;} + grib_expression* e = NULL; + while (args && n-- > 0) { + args = args->next; + } - if(!args) return NULL; + if (!args) + return NULL; e = args->expression; return e ? grib_expression_get_name(e) : NULL; } -const char* grib_arguments_get_string(grib_handle* h,grib_arguments* args,int n) +const char* grib_arguments_get_string(grib_handle* h, grib_arguments* args, int n) { - grib_expression *e = NULL; - int ret=0; - while(args && n-->0) {args = args->next;} + grib_expression* e = NULL; + int ret = 0; + while (args && n-- > 0) { + args = args->next; + } - if(!args) return NULL; + if (!args) + return NULL; e = args->expression; - return grib_expression_evaluate_string(h,e,NULL,NULL,&ret); + return grib_expression_evaluate_string(h, e, NULL, NULL, &ret); } -long grib_arguments_get_long(grib_handle* h,grib_arguments* args,int n) +long grib_arguments_get_long(grib_handle* h, grib_arguments* args, int n) { - int ret=0; - long lres=0; - grib_expression *e = NULL; - while(args && n-->0) {args = args->next;} + int ret = 0; + long lres = 0; + grib_expression* e = NULL; + while (args && n-- > 0) { + args = args->next; + } - if(!args) return 0; + if (!args) + return 0; - e = args->expression; - ret = grib_expression_evaluate_long(h,e,&lres); + e = args->expression; + ret = grib_expression_evaluate_long(h, e, &lres); (void)ret; return lres; } -double grib_arguments_get_double(grib_handle* h,grib_arguments* args,int n) +double grib_arguments_get_double(grib_handle* h, grib_arguments* args, int n) { - int ret=0; - double dres=0.0; + int ret = 0; + double dres = 0.0; - grib_expression *e = NULL; - while(args && n-->0) {args = args->next;} + grib_expression* e = NULL; + while (args && n-- > 0) { + args = args->next; + } - if(!args) return 0; + if (!args) + return 0; - e = args->expression; - ret = grib_expression_evaluate_double(h,e,&dres); + e = args->expression; + ret = grib_expression_evaluate_double(h, e, &dres); (void)ret; return dres; } -grib_expression* grib_arguments_get_expression(grib_handle* h,grib_arguments* args,int n) +grib_expression* grib_arguments_get_expression(grib_handle* h, grib_arguments* args, int n) { - while(args && n-->0) {args = args->next;} + while (args && n-- > 0) { + args = args->next; + } - if(!args) return 0; + if (!args) + return 0; return args->expression; } diff --git a/src/grib_expression_class_accessor.c b/src/grib_expression_class_accessor.c index ce7922b86..98b2f4d6f 100644 --- a/src/grib_expression_class_accessor.c +++ b/src/grib_expression_class_accessor.c @@ -42,46 +42,47 @@ or edit "expression.class" and rerun ./make_class.pl typedef const char* string; /* to keep make_class.pl happy */ -static void init_class (grib_expression_class*); +static void init_class(grib_expression_class*); -static void destroy(grib_context*,grib_expression* e); +static void destroy(grib_context*, grib_expression* e); -static void print(grib_context*,grib_expression*,grib_handle*); -static void add_dependency(grib_expression* e, grib_accessor* observer); +static void print(grib_context*, grib_expression*, grib_handle*); +static void add_dependency(grib_expression* e, grib_accessor* observer); static string get_name(grib_expression* e); -static int native_type(grib_expression*,grib_handle*); +static int native_type(grib_expression*, grib_handle*); -static int evaluate_long(grib_expression*,grib_handle*,long*); -static int evaluate_double(grib_expression*,grib_handle*,double*); -static string evaluate_string(grib_expression*,grib_handle*,char*,size_t*,int*); +static int evaluate_long(grib_expression*, grib_handle*, long*); +static int evaluate_double(grib_expression*, grib_handle*, double*); +static string evaluate_string(grib_expression*, grib_handle*, char*, size_t*, int*); -typedef struct grib_expression_accessor{ - grib_expression base; -/* Members defined in accessor */ - char *name; - long start; - size_t length; +typedef struct grib_expression_accessor +{ + grib_expression base; + /* Members defined in accessor */ + char* name; + long start; + size_t length; } grib_expression_accessor; static grib_expression_class _grib_expression_class_accessor = { - 0, /* super */ - "accessor", /* name */ - sizeof(grib_expression_accessor),/* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* constructor */ - &destroy, /* destructor */ - &print, - &add_dependency, - - &native_type, - &get_name, - - &evaluate_long, - &evaluate_double, - &evaluate_string, + 0, /* super */ + "accessor", /* name */ + sizeof(grib_expression_accessor), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* constructor */ + &destroy, /* destructor */ + &print, + &add_dependency, + + &native_type, + &get_name, + + &evaluate_long, + &evaluate_double, + &evaluate_string, }; grib_expression_class* grib_expression_class_accessor = &_grib_expression_class_accessor; @@ -98,92 +99,94 @@ static const char* get_name(grib_expression* g) return e->name; } -static int evaluate_long(grib_expression* g,grib_handle *h,long* result) +static int evaluate_long(grib_expression* g, grib_handle* h, long* result) { grib_expression_accessor* e = (grib_expression_accessor*)g; - return grib_get_long_internal(h,e->name,result); + return grib_get_long_internal(h, e->name, result); } -static int evaluate_double(grib_expression *g,grib_handle *h,double* result) +static int evaluate_double(grib_expression* g, grib_handle* h, double* result) { grib_expression_accessor* e = (grib_expression_accessor*)g; - return grib_get_double_internal(h,e->name,result); + return grib_get_double_internal(h, e->name, result); } -static string evaluate_string(grib_expression* g,grib_handle* h,char* buf,size_t* size,int* err) +static string evaluate_string(grib_expression* g, grib_handle* h, char* buf, size_t* size, int* err) { grib_expression_accessor* e = (grib_expression_accessor*)g; - char mybuf[1024]={0,}; - long start=e->start; + char mybuf[1024] = {0,}; + long start = e->start; Assert(buf); - if((*err=grib_get_string_internal(h,e->name,mybuf,size)) != GRIB_SUCCESS) + if ((*err = grib_get_string_internal(h, e->name, mybuf, size)) != GRIB_SUCCESS) return NULL; - if (e->start<0) start+=*size; + if (e->start < 0) + start += *size; if (e->length != 0) { - memcpy(buf,mybuf+start,e->length); - buf[e->length]=0; - } else { - memcpy(buf,mybuf,*size); - if (*size==1024) *size = *size - 1; /* ECC-336 */ - buf[*size]=0; + memcpy(buf, mybuf + start, e->length); + buf[e->length] = 0; + } + else { + memcpy(buf, mybuf, *size); + if (*size == 1024) + *size = *size - 1; /* ECC-336 */ + buf[*size] = 0; } return buf; } -static void print(grib_context* c,grib_expression* g,grib_handle* f) +static void print(grib_context* c, grib_expression* g, grib_handle* f) { grib_expression_accessor* e = (grib_expression_accessor*)g; - printf("access('%s",e->name); - if(f) - { + printf("access('%s", e->name); + if (f) { long s = 0; - grib_get_long(f,e->name,&s); - printf("=%ld",s); + grib_get_long(f, e->name, &s); + printf("=%ld", s); } printf("')"); } -static void destroy(grib_context* c,grib_expression* g) +static void destroy(grib_context* c, grib_expression* g) { grib_expression_accessor* e = (grib_expression_accessor*)g; - grib_context_free_persistent(c,e->name); + grib_context_free_persistent(c, e->name); } -static void add_dependency(grib_expression* g, grib_accessor* observer){ +static void add_dependency(grib_expression* g, grib_accessor* observer) +{ grib_expression_accessor* e = (grib_expression_accessor*)g; - grib_accessor *observed = grib_find_accessor(grib_handle_of_accessor(observer),e->name); + grib_accessor* observed = grib_find_accessor(grib_handle_of_accessor(observer), e->name); - if(!observed) - { + if (!observed) { /* grib_context_log(observer->context, GRIB_LOG_ERROR, */ /* "Error in accessor_add_dependency: cannot find [%s]", e->name); */ /* Assert(observed); */ return; } - grib_dependency_add(observer,observed); + grib_dependency_add(observer, observed); } -grib_expression* new_accessor_expression(grib_context* c,const char *name,long start, size_t length) +grib_expression* new_accessor_expression(grib_context* c, const char* name, long start, size_t length) { - grib_expression_accessor* e = (grib_expression_accessor*)grib_context_malloc_clear_persistent(c,sizeof(grib_expression_accessor)); - e->base.cclass = grib_expression_class_accessor; - e->name = grib_context_strdup_persistent(c,name); - e->start = start; - e->length = length; + grib_expression_accessor* e = (grib_expression_accessor*)grib_context_malloc_clear_persistent(c, sizeof(grib_expression_accessor)); + e->base.cclass = grib_expression_class_accessor; + e->name = grib_context_strdup_persistent(c, name); + e->start = start; + e->length = length; return (grib_expression*)e; } -static int native_type(grib_expression* g,grib_handle *h) +static int native_type(grib_expression* g, grib_handle* h) { grib_expression_accessor* e = (grib_expression_accessor*)g; - int type = 0; + int type = 0; int err; - if((err=grib_get_native_type(h,e->name,&type)) != GRIB_SUCCESS) + if ((err = grib_get_native_type(h, e->name, &type)) != GRIB_SUCCESS) grib_context_log(h->context, GRIB_LOG_ERROR, - "Error in native_type %s : %s", e->name,grib_get_error_message(err)); + "Error in native_type %s : %s", e->name, grib_get_error_message(err)); return type; } diff --git a/src/grib_expression_class_binop.c b/src/grib_expression_class_binop.c index 0ae71145c..341831c46 100644 --- a/src/grib_expression_class_binop.c +++ b/src/grib_expression_class_binop.c @@ -42,46 +42,47 @@ or edit "expression.class" and rerun ./make_class.pl typedef const char* string; /* to keep make_class.pl happy */ -static void init_class (grib_expression_class*); +static void init_class(grib_expression_class*); -static void destroy(grib_context*,grib_expression* e); +static void destroy(grib_context*, grib_expression* e); -static void print(grib_context*,grib_expression*,grib_handle*); -static void add_dependency(grib_expression* e, grib_accessor* observer); +static void print(grib_context*, grib_expression*, grib_handle*); +static void add_dependency(grib_expression* e, grib_accessor* observer); -static int native_type(grib_expression*,grib_handle*); +static int native_type(grib_expression*, grib_handle*); -static int evaluate_long(grib_expression*,grib_handle*,long*); -static int evaluate_double(grib_expression*,grib_handle*,double*); +static int evaluate_long(grib_expression*, grib_handle*, long*); +static int evaluate_double(grib_expression*, grib_handle*, double*); -typedef struct grib_expression_binop{ - grib_expression base; -/* Members defined in binop */ - grib_expression *left; - grib_expression *right; - grib_binop_long_proc long_func; - grib_binop_double_proc double_func; - grib_binop_string_proc string_func; +typedef struct grib_expression_binop +{ + grib_expression base; + /* Members defined in binop */ + grib_expression* left; + grib_expression* right; + grib_binop_long_proc long_func; + grib_binop_double_proc double_func; + grib_binop_string_proc string_func; } grib_expression_binop; static grib_expression_class _grib_expression_class_binop = { - 0, /* super */ - "binop", /* name */ - sizeof(grib_expression_binop),/* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* constructor */ - &destroy, /* destructor */ - &print, - &add_dependency, - - &native_type, - 0, - - &evaluate_long, - &evaluate_double, - 0, + 0, /* super */ + "binop", /* name */ + sizeof(grib_expression_binop), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* constructor */ + &destroy, /* destructor */ + &print, + &add_dependency, + + &native_type, + 0, + + &evaluate_long, + &evaluate_double, + 0, }; grib_expression_class* grib_expression_class_binop = &_grib_expression_class_binop; @@ -92,10 +93,10 @@ static void init_class(grib_expression_class* c) } /* END_CLASS_IMP */ -static int evaluate_long(grib_expression *g,grib_handle* h,long* lres) +static int evaluate_long(grib_expression* g, grib_handle* h, long* lres) { - long v1=0; - long v2=0; + long v1 = 0; + long v2 = 0; int ret; grib_expression_binop* e = (grib_expression_binop*)g; @@ -114,20 +115,22 @@ static int evaluate_long(grib_expression *g,grib_handle* h,long* lres) } #endif - ret = grib_expression_evaluate_long(h,e->left,&v1); - if (ret != GRIB_SUCCESS) return ret; + ret = grib_expression_evaluate_long(h, e->left, &v1); + if (ret != GRIB_SUCCESS) + return ret; - ret = grib_expression_evaluate_long(h,e->right,&v2); - if (ret != GRIB_SUCCESS) return ret; + ret = grib_expression_evaluate_long(h, e->right, &v2); + if (ret != GRIB_SUCCESS) + return ret; - *lres=e->long_func(v1,v2); + *lres = e->long_func(v1, v2); return GRIB_SUCCESS; } -static int evaluate_double(grib_expression *g,grib_handle* h,double* dres) +static int evaluate_double(grib_expression* g, grib_handle* h, double* dres) { - double v1=0.0; - double v2=0.0; + double v1 = 0.0; + double v2 = 0.0; int ret; grib_expression_binop* e = (grib_expression_binop*)g; @@ -147,62 +150,63 @@ static int evaluate_double(grib_expression *g,grib_handle* h,double* dres) } #endif - ret = grib_expression_evaluate_double(h,e->left,&v1); - if (ret != GRIB_SUCCESS) return ret; + ret = grib_expression_evaluate_double(h, e->left, &v1); + if (ret != GRIB_SUCCESS) + return ret; - ret = grib_expression_evaluate_double(h,e->right,&v2); - if (ret != GRIB_SUCCESS) return ret; + ret = grib_expression_evaluate_double(h, e->right, &v2); + if (ret != GRIB_SUCCESS) + return ret; - *dres = e->double_func ? e->double_func(v1,v2) : e->long_func(v1,v2); + *dres = e->double_func ? e->double_func(v1, v2) : e->long_func(v1, v2); return GRIB_SUCCESS; } -static void print(grib_context* c,grib_expression* g,grib_handle* f) +static void print(grib_context* c, grib_expression* g, grib_handle* f) { grib_expression_binop* e = (grib_expression_binop*)g; printf("binop("); - grib_expression_print(c,e->left,f); + grib_expression_print(c, e->left, f); printf(","); - grib_expression_print(c,e->right,f); + grib_expression_print(c, e->right, f); printf(")"); } -static void destroy(grib_context* c,grib_expression* g) +static void destroy(grib_context* c, grib_expression* g) { grib_expression_binop* e = (grib_expression_binop*)g; - grib_expression_free(c,e->left); - grib_expression_free(c,e->right); + grib_expression_free(c, e->left); + grib_expression_free(c, e->right); } -static void add_dependency(grib_expression* g, grib_accessor* observer) +static void add_dependency(grib_expression* g, grib_accessor* observer) { grib_expression_binop* e = (grib_expression_binop*)g; - grib_dependency_observe_expression(observer,e->left); - grib_dependency_observe_expression(observer,e->right); + grib_dependency_observe_expression(observer, e->left); + grib_dependency_observe_expression(observer, e->right); } grib_expression* new_binop_expression(grib_context* c, - grib_binop_long_proc long_func, - grib_binop_double_proc double_func, - grib_expression* left,grib_expression* right) + grib_binop_long_proc long_func, + grib_binop_double_proc double_func, + grib_expression* left, grib_expression* right) { - grib_expression_binop* e = (grib_expression_binop*)grib_context_malloc_clear_persistent(c,sizeof(grib_expression_binop)); - e->base.cclass = grib_expression_class_binop; - e->left = left; - e->right = right; - e->long_func = long_func; - e->double_func = double_func; + grib_expression_binop* e = (grib_expression_binop*)grib_context_malloc_clear_persistent(c, sizeof(grib_expression_binop)); + e->base.cclass = grib_expression_class_binop; + e->left = left; + e->right = right; + e->long_func = long_func; + e->double_func = double_func; return (grib_expression*)e; } -static int native_type(grib_expression* g,grib_handle *h) +static int native_type(grib_expression* g, grib_handle* h) { grib_expression_binop* e = (grib_expression_binop*)g; /* See GRIB-394 : The type of this binary expression will be double if any of its operands are double */ - if (grib_expression_native_type(h, e->left) == GRIB_TYPE_DOUBLE || - grib_expression_native_type(h, e->right) == GRIB_TYPE_DOUBLE) - { + if (grib_expression_native_type(h, e->left) == GRIB_TYPE_DOUBLE || + grib_expression_native_type(h, e->right) == GRIB_TYPE_DOUBLE) { return GRIB_TYPE_DOUBLE; } return e->long_func ? GRIB_TYPE_LONG : GRIB_TYPE_DOUBLE; diff --git a/src/grib_expression_class_column.c b/src/grib_expression_class_column.c index f69c45baa..edff52f67 100644 --- a/src/grib_expression_class_column.c +++ b/src/grib_expression_class_column.c @@ -43,42 +43,43 @@ or edit "expression.class" and rerun ./make_class.pl typedef const char* string; /* to keep make_class.pl happy */ -static void init_class (grib_expression_class*); +static void init_class(grib_expression_class*); -static void destroy(grib_context*,grib_expression* e); +static void destroy(grib_context*, grib_expression* e); static string get_name(grib_expression* e); -static int native_type(grib_expression*,grib_handle*); +static int native_type(grib_expression*, grib_handle*); -static int evaluate_long(grib_expression*,grib_handle*,long*); -static int evaluate_double(grib_expression*,grib_handle*,double*); -static string evaluate_string(grib_expression*,grib_handle*,char*,size_t*,int*); +static int evaluate_long(grib_expression*, grib_handle*, long*); +static int evaluate_double(grib_expression*, grib_handle*, double*); +static string evaluate_string(grib_expression*, grib_handle*, char*, size_t*, int*); -typedef struct grib_expression_column{ - grib_expression base; -/* Members defined in column */ - grib_column* column; +typedef struct grib_expression_column +{ + grib_expression base; + /* Members defined in column */ + grib_column* column; } grib_expression_column; static grib_expression_class _grib_expression_class_column = { - 0, /* super */ - "column", /* name */ - sizeof(grib_expression_column),/* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* constructor */ - &destroy, /* destructor */ - 0, - 0, - - &native_type, - &get_name, - - &evaluate_long, - &evaluate_double, - &evaluate_string, + 0, /* super */ + "column", /* name */ + sizeof(grib_expression_column), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* constructor */ + &destroy, /* destructor */ + 0, + 0, + + &native_type, + &get_name, + + &evaluate_long, + &evaluate_double, + &evaluate_string, }; grib_expression_class* grib_expression_class_column = &_grib_expression_class_column; @@ -91,60 +92,59 @@ static void init_class(grib_expression_class* c) static const char* get_name(grib_expression* g) { - grib_expression_column* e = (grib_expression_column*)g; - return e->name; + grib_expression_column* e = (grib_expression_column*)g; + return e->name; } -static int evaluate_long(grib_expression* g,grib_handle *h,long* result) +static int evaluate_long(grib_expression* g, grib_handle* h, long* result) { - grib_expression_column* e = (grib_expression_column*)g; - int err; - if((err=grib_get_long_internal(h,e->name,result)) != GRIB_SUCCESS) - grib_context_log(h->context, GRIB_LOG_DEBUG, - "Error in evaluate_long %s : %s", e->name,grib_get_error_message(err)); - return err; + grib_expression_column* e = (grib_expression_column*)g; + int err; + if ((err = grib_get_long_internal(h, e->name, result)) != GRIB_SUCCESS) + grib_context_log(h->context, GRIB_LOG_DEBUG, + "Error in evaluate_long %s : %s", e->name, grib_get_error_message(err)); + return err; } -static int evaluate_double(grib_expression *g,grib_handle *h,double* result) +static int evaluate_double(grib_expression* g, grib_handle* h, double* result) { - grib_expression_column* e = (grib_expression_column*)g; - int err; - if((err=grib_get_double_internal(h,e->name,result)) != GRIB_SUCCESS) - grib_context_log(h->context, GRIB_LOG_DEBUG, - "Error in evaluate_double %s : %s", e->name,grib_get_error_message(err)); - return err; + grib_expression_column* e = (grib_expression_column*)g; + int err; + if ((err = grib_get_double_internal(h, e->name, result)) != GRIB_SUCCESS) + grib_context_log(h->context, GRIB_LOG_DEBUG, + "Error in evaluate_double %s : %s", e->name, grib_get_error_message(err)); + return err; } -static string evaluate_string(grib_expression* g,grib_handle* h,char* buf,size_t* size,int* err) +static string evaluate_string(grib_expression* g, grib_handle* h, char* buf, size_t* size, int* err) { - grib_expression_column* e = (grib_expression_column*)g; - Assert(buf); - if((*err=grib_get_string_internal(h,e->name,buf,size)) != GRIB_SUCCESS) - { - grib_context_log(h->context, GRIB_LOG_DEBUG, - "Error in evaluate_string %s : %s", e->name,grib_get_error_message(err)); - return NULL; + grib_expression_column* e = (grib_expression_column*)g; + Assert(buf); + if ((*err = grib_get_string_internal(h, e->name, buf, size)) != GRIB_SUCCESS) { + grib_context_log(h->context, GRIB_LOG_DEBUG, + "Error in evaluate_string %s : %s", e->name, grib_get_error_message(err)); + return NULL; } - return buf; + return buf; } -static void destroy(grib_context* c,grib_expression* g) +static void destroy(grib_context* c, grib_expression* g) { - grib_expression_column* e = (grib_expression_column*)g; - grib_context_free_persistent(c,e->name); + grib_expression_column* e = (grib_expression_column*)g; + grib_context_free_persistent(c, e->name); } -grib_expression* new_column_expression(grib_context* c,const char *name) +grib_expression* new_column_expression(grib_context* c, const char* name) { - grib_expression_column* e = grib_context_malloc_clear_persistent(c,sizeof(grib_expression_column)); - e->base.cclass = grib_expression_class_column; - e->name = grib_context_strdup_persistent(c,name); - return (grib_expression*)e; + grib_expression_column* e = grib_context_malloc_clear_persistent(c, sizeof(grib_expression_column)); + e->base.cclass = grib_expression_class_column; + e->name = grib_context_strdup_persistent(c, name); + return (grib_expression*)e; } -static int native_type(grib_expression* g,grib_handle *h) { - grib_expression_column* e = (grib_expression_column*)g; - return e->column->type; +static int native_type(grib_expression* g, grib_handle* h) +{ + grib_expression_column* e = (grib_expression_column*)g; + return e->column->type; } - diff --git a/src/grib_expression_class_constant.c b/src/grib_expression_class_constant.c index 44775ce98..7bb648da3 100644 --- a/src/grib_expression_class_constant.c +++ b/src/grib_expression_class_constant.c @@ -41,40 +41,41 @@ or edit "expression.class" and rerun ./make_class.pl typedef const char* string; /* to keep make_class.pl happy */ -static void init_class (grib_expression_class*); +static void init_class(grib_expression_class*); -static void destroy(grib_context*,grib_expression* e); +static void destroy(grib_context*, grib_expression* e); -static void print(grib_context*,grib_expression*,grib_handle*); -static void add_dependency(grib_expression* e, grib_accessor* observer); +static void print(grib_context*, grib_expression*, grib_handle*); +static void add_dependency(grib_expression* e, grib_accessor* observer); -static int native_type(grib_expression*,grib_handle*); +static int native_type(grib_expression*, grib_handle*); -typedef struct grib_expression_constant{ - grib_expression base; -/* Members defined in constant */ - long value; +typedef struct grib_expression_constant +{ + grib_expression base; + /* Members defined in constant */ + long value; } grib_expression_constant; static grib_expression_class _grib_expression_class_constant = { - 0, /* super */ - "constant", /* name */ - sizeof(grib_expression_constant),/* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* constructor */ - &destroy, /* destructor */ - &print, - &add_dependency, - - &native_type, - 0, - - 0, - 0, - 0, + 0, /* super */ + "constant", /* name */ + sizeof(grib_expression_constant), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* constructor */ + &destroy, /* destructor */ + &print, + &add_dependency, + + &native_type, + 0, + + 0, + 0, + 0, }; grib_expression_class* grib_expression_class_constant = &_grib_expression_class_constant; @@ -85,26 +86,25 @@ static void init_class(grib_expression_class* c) } /* END_CLASS_IMP */ -static long evaluate(grib_expression* g,grib_handle *h) +static long evaluate(grib_expression* g, grib_handle* h) { - grib_expression_constant* e = (grib_expression_constant*)g; - return e->value; + grib_expression_constant* e = (grib_expression_constant*)g; + return e->value; } -static void print(grib_context* c,grib_expression* g,grib_handle* f) +static void print(grib_context* c, grib_expression* g, grib_handle* f) { - grib_expression_constant* e = (grib_expression_constant*)g; - printf("constant(%ld)",e->value); + grib_expression_constant* e = (grib_expression_constant*)g; + printf("constant(%ld)", e->value); } -static void destroy(grib_context* c,grib_expression* g) +static void destroy(grib_context* c, grib_expression* g) { - /* grib_expression_constant* e = (grib_expression_constant*)g; */ + /* grib_expression_constant* e = (grib_expression_constant*)g; */ } -static void add_dependency(grib_expression* g, grib_accessor* observer){ - /* grib_expression_constant* e = (grib_expression_constant*)g; */ +static void add_dependency(grib_expression* g, grib_accessor* observer) +{ + /* grib_expression_constant* e = (grib_expression_constant*)g; */ } - - diff --git a/src/grib_expression_class_double.c b/src/grib_expression_class_double.c index 64dd36407..7aa53785c 100644 --- a/src/grib_expression_class_double.c +++ b/src/grib_expression_class_double.c @@ -38,42 +38,43 @@ or edit "expression.class" and rerun ./make_class.pl typedef const char* string; /* to keep make_class.pl happy */ -static void init_class (grib_expression_class*); +static void init_class(grib_expression_class*); -static void destroy(grib_context*,grib_expression* e); +static void destroy(grib_context*, grib_expression* e); -static void print(grib_context*,grib_expression*,grib_handle*); -static void add_dependency(grib_expression* e, grib_accessor* observer); +static void print(grib_context*, grib_expression*, grib_handle*); +static void add_dependency(grib_expression* e, grib_accessor* observer); -static int native_type(grib_expression*,grib_handle*); +static int native_type(grib_expression*, grib_handle*); -static int evaluate_long(grib_expression*,grib_handle*,long*); -static int evaluate_double(grib_expression*,grib_handle*,double*); +static int evaluate_long(grib_expression*, grib_handle*, long*); +static int evaluate_double(grib_expression*, grib_handle*, double*); -typedef struct grib_expression_double{ - grib_expression base; -/* Members defined in double */ - double value; +typedef struct grib_expression_double +{ + grib_expression base; + /* Members defined in double */ + double value; } grib_expression_double; static grib_expression_class _grib_expression_class_double = { - 0, /* super */ - "double", /* name */ - sizeof(grib_expression_double),/* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* constructor */ - &destroy, /* destructor */ - &print, - &add_dependency, - - &native_type, - 0, - - &evaluate_long, - &evaluate_double, - 0, + 0, /* super */ + "double", /* name */ + sizeof(grib_expression_double), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* constructor */ + &destroy, /* destructor */ + &print, + &add_dependency, + + &native_type, + 0, + + &evaluate_long, + &evaluate_double, + 0, }; grib_expression_class* grib_expression_class_double = &_grib_expression_class_double; @@ -84,44 +85,45 @@ static void init_class(grib_expression_class* c) } /* END_CLASS_IMP */ -static int evaluate_long(grib_expression* g,grib_handle *h,long* lres) +static int evaluate_long(grib_expression* g, grib_handle* h, long* lres) { - grib_expression_double* e = (grib_expression_double*)g; - *lres=e->value; - return GRIB_SUCCESS; + grib_expression_double* e = (grib_expression_double*)g; + *lres = e->value; + return GRIB_SUCCESS; } -static int evaluate_double(grib_expression* g,grib_handle *h,double* dres) +static int evaluate_double(grib_expression* g, grib_handle* h, double* dres) { - grib_expression_double* e = (grib_expression_double*)g; - *dres=e->value; - return GRIB_SUCCESS; + grib_expression_double* e = (grib_expression_double*)g; + *dres = e->value; + return GRIB_SUCCESS; } -static void print(grib_context* c,grib_expression* g,grib_handle* f) +static void print(grib_context* c, grib_expression* g, grib_handle* f) { - grib_expression_double* e = (grib_expression_double*)g; - printf("double(%g)",e->value); + grib_expression_double* e = (grib_expression_double*)g; + printf("double(%g)", e->value); } -static void destroy(grib_context* c,grib_expression* g) +static void destroy(grib_context* c, grib_expression* g) { - /* grib_expression_double* e = (grib_expression_double*)g; */ + /* grib_expression_double* e = (grib_expression_double*)g; */ } -static void add_dependency(grib_expression* g, grib_accessor* observer){ - /* grib_expression_double* e = (grib_expression_double*)g; */ +static void add_dependency(grib_expression* g, grib_accessor* observer) +{ + /* grib_expression_double* e = (grib_expression_double*)g; */ } -grib_expression* new_double_expression(grib_context* c,double value) +grib_expression* new_double_expression(grib_context* c, double value) { - grib_expression_double* e = (grib_expression_double*)grib_context_malloc_clear_persistent(c,sizeof(grib_expression_double)); - e->base.cclass = grib_expression_class_double; - e->value = value; - return (grib_expression*)e; + grib_expression_double* e = (grib_expression_double*)grib_context_malloc_clear_persistent(c, sizeof(grib_expression_double)); + e->base.cclass = grib_expression_class_double; + e->value = value; + return (grib_expression*)e; } -static int native_type(grib_expression* g,grib_handle *h) +static int native_type(grib_expression* g, grib_handle* h) { - return GRIB_TYPE_DOUBLE; + return GRIB_TYPE_DOUBLE; } diff --git a/src/grib_expression_class_functor.c b/src/grib_expression_class_functor.c index 365c85ea0..7a21344c4 100644 --- a/src/grib_expression_class_functor.c +++ b/src/grib_expression_class_functor.c @@ -38,42 +38,43 @@ or edit "expression.class" and rerun ./make_class.pl typedef const char* string; /* to keep make_class.pl happy */ -static void init_class (grib_expression_class*); +static void init_class(grib_expression_class*); -static void destroy(grib_context*,grib_expression* e); +static void destroy(grib_context*, grib_expression* e); -static void print(grib_context*,grib_expression*,grib_handle*); -static void add_dependency(grib_expression* e, grib_accessor* observer); +static void print(grib_context*, grib_expression*, grib_handle*); +static void add_dependency(grib_expression* e, grib_accessor* observer); -static int native_type(grib_expression*,grib_handle*); +static int native_type(grib_expression*, grib_handle*); -static int evaluate_long(grib_expression*,grib_handle*,long*); +static int evaluate_long(grib_expression*, grib_handle*, long*); -typedef struct grib_expression_functor{ - grib_expression base; -/* Members defined in functor */ - char *name; - grib_arguments *args; +typedef struct grib_expression_functor +{ + grib_expression base; + /* Members defined in functor */ + char* name; + grib_arguments* args; } grib_expression_functor; static grib_expression_class _grib_expression_class_functor = { - 0, /* super */ - "functor", /* name */ - sizeof(grib_expression_functor),/* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* constructor */ - &destroy, /* destructor */ - &print, - &add_dependency, - - &native_type, - 0, - - &evaluate_long, - 0, - 0, + 0, /* super */ + "functor", /* name */ + sizeof(grib_expression_functor), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* constructor */ + &destroy, /* destructor */ + &print, + &add_dependency, + + &native_type, + 0, + + &evaluate_long, + 0, + 0, }; grib_expression_class* grib_expression_class_functor = &_grib_expression_class_functor; @@ -84,31 +85,30 @@ static void init_class(grib_expression_class* c) } /* END_CLASS_IMP */ -static int evaluate_long(grib_expression* g,grib_handle* h,long* lres) +static int evaluate_long(grib_expression* g, grib_handle* h, long* lres) { grib_expression_functor* e = (grib_expression_functor*)g; /* TODO: needs OO code here */ - if(strcmp(e->name,"lookup") == 0) { + if (strcmp(e->name, "lookup") == 0) { return GRIB_SUCCESS; } - if(strcmp(e->name,"new") == 0) { - *lres=h->loader != NULL; + if (strcmp(e->name, "new") == 0) { + *lres = h->loader != NULL; return GRIB_SUCCESS; } - if(strcmp(e->name,"missing") == 0) - { - const char *p = grib_arguments_get_name(h,e->args,0); - if(p) - { + if (strcmp(e->name, "missing") == 0) { + const char* p = grib_arguments_get_name(h, e->args, 0); + if (p) { long val = 0; - int err = 0; - err = grib_get_long_internal(h,p,&val); - if (err) return err; + int err = 0; + err = grib_get_long_internal(h, p, &val); + if (err) + return err; /* Note: This does not cope with keys like typeOfSecondFixedSurface * which are codetable entries with values like 255: this value is * not classed as 'missing'! @@ -118,70 +118,67 @@ static int evaluate_long(grib_expression* g,grib_handle* h,long* lres) return GRIB_SUCCESS; } else - *lres=GRIB_MISSING_LONG; + *lres = GRIB_MISSING_LONG; return GRIB_SUCCESS; } - if(strcmp(e->name,"defined") == 0) - { - const char *p = grib_arguments_get_name(h,e->args,0); + if (strcmp(e->name, "defined") == 0) { + const char* p = grib_arguments_get_name(h, e->args, 0); - if(p) { - grib_accessor* a=grib_find_accessor(h,p); - *lres=a!=NULL ? 1 : 0; + if (p) { + grib_accessor* a = grib_find_accessor(h, p); + *lres = a != NULL ? 1 : 0; return GRIB_SUCCESS; } - *lres=0; + *lres = 0; return GRIB_SUCCESS; } - if(strcmp(e->name,"changed") == 0) - { - *lres=1; + if (strcmp(e->name, "changed") == 0) { + *lres = 1; return GRIB_SUCCESS; } - if(strcmp(e->name,"gribex_mode_on") == 0) - { - *lres= h->context->gribex_mode_on ? 1 : 0; + if (strcmp(e->name, "gribex_mode_on") == 0) { + *lres = h->context->gribex_mode_on ? 1 : 0; return GRIB_SUCCESS; } return GRIB_NOT_IMPLEMENTED; } -static void print(grib_context* c,grib_expression* g,grib_handle* f) +static void print(grib_context* c, grib_expression* g, grib_handle* f) { grib_expression_functor* e = (grib_expression_functor*)g; - printf("%s(",e->name); + printf("%s(", e->name); /*grib_expression_print(c,e->args,f);*/ printf(")"); } -static void destroy(grib_context* c,grib_expression* g) +static void destroy(grib_context* c, grib_expression* g) { grib_expression_functor* e = (grib_expression_functor*)g; - grib_context_free_persistent(c,e->name); - grib_arguments_free(c,e->args); + grib_context_free_persistent(c, e->name); + grib_arguments_free(c, e->args); } -static void add_dependency(grib_expression* g, grib_accessor* observer) +static void add_dependency(grib_expression* g, grib_accessor* observer) { grib_expression_functor* e = (grib_expression_functor*)g; - if (strcmp(e->name,"defined")) - grib_dependency_observe_arguments(observer,e->args); + if (strcmp(e->name, "defined")) + grib_dependency_observe_arguments(observer, e->args); } -grib_expression* new_func_expression(grib_context* c,const char *name,grib_arguments* args) +grib_expression* new_func_expression(grib_context* c, const char* name, grib_arguments* args) { - grib_expression_functor* e = (grib_expression_functor*)grib_context_malloc_clear_persistent(c,sizeof(grib_expression_functor)); - e->base.cclass = grib_expression_class_functor; - e->name = grib_context_strdup_persistent(c,name); - e->args = args; + grib_expression_functor* e = (grib_expression_functor*)grib_context_malloc_clear_persistent(c, sizeof(grib_expression_functor)); + e->base.cclass = grib_expression_class_functor; + e->name = grib_context_strdup_persistent(c, name); + e->args = args; return (grib_expression*)e; } -static int native_type(grib_expression* g,grib_handle *h) +static int native_type(grib_expression* g, grib_handle* h) { return GRIB_TYPE_LONG; } diff --git a/src/grib_expression_class_is_in_dict.c b/src/grib_expression_class_is_in_dict.c index d568b9477..36427045a 100644 --- a/src/grib_expression_class_is_in_dict.c +++ b/src/grib_expression_class_is_in_dict.c @@ -40,44 +40,45 @@ or edit "expression.class" and rerun ./make_class.pl typedef const char* string; /* to keep make_class.pl happy */ -static void init_class (grib_expression_class*); +static void init_class(grib_expression_class*); -static void print(grib_context*,grib_expression*,grib_handle*); -static void add_dependency(grib_expression* e, grib_accessor* observer); +static void print(grib_context*, grib_expression*, grib_handle*); +static void add_dependency(grib_expression* e, grib_accessor* observer); static string get_name(grib_expression* e); -static int native_type(grib_expression*,grib_handle*); +static int native_type(grib_expression*, grib_handle*); -static int evaluate_long(grib_expression*,grib_handle*,long*); -static int evaluate_double(grib_expression*,grib_handle*,double*); -static string evaluate_string(grib_expression*,grib_handle*,char*,size_t*,int*); +static int evaluate_long(grib_expression*, grib_handle*, long*); +static int evaluate_double(grib_expression*, grib_handle*, double*); +static string evaluate_string(grib_expression*, grib_handle*, char*, size_t*, int*); -typedef struct grib_expression_is_in_dict{ - grib_expression base; -/* Members defined in is_in_dict */ - const char *key; - const char *dictionary; +typedef struct grib_expression_is_in_dict +{ + grib_expression base; + /* Members defined in is_in_dict */ + const char* key; + const char* dictionary; } grib_expression_is_in_dict; static grib_expression_class _grib_expression_class_is_in_dict = { - 0, /* super */ - "is_in_dict", /* name */ - sizeof(grib_expression_is_in_dict),/* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* constructor */ - 0, /* destructor */ - &print, - &add_dependency, - - &native_type, - &get_name, - - &evaluate_long, - &evaluate_double, - &evaluate_string, + 0, /* super */ + "is_in_dict", /* name */ + sizeof(grib_expression_is_in_dict), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* constructor */ + 0, /* destructor */ + &print, + &add_dependency, + + &native_type, + &get_name, + + &evaluate_long, + &evaluate_double, + &evaluate_string, }; grib_expression_class* grib_expression_class_is_in_dict = &_grib_expression_class_is_in_dict; @@ -89,164 +90,170 @@ static void init_class(grib_expression_class* c) /* END_CLASS_IMP */ -static grib_trie* load_dictionary(grib_context* c,grib_expression* e, int* err) { - - grib_expression_is_in_dict* self = (grib_expression_is_in_dict*)e; - - char* filename=NULL; - char line[1024]={0,}; - char key[1024]={0,}; - char* list=0; - grib_trie* dictionary=NULL; - FILE* f=NULL; - int i=0; - - *err=GRIB_SUCCESS; - - filename=grib_context_full_defs_path(c,self->dictionary); - if (!filename) { - grib_context_log(c,GRIB_LOG_ERROR,"unable to find def file %s",self->dictionary); - *err=GRIB_FILE_NOT_FOUND; - return NULL; - } else { - grib_context_log(c,GRIB_LOG_DEBUG,"found def file %s",filename); - } - dictionary=(grib_trie*)grib_trie_get(c->lists,filename); - if (dictionary) { - grib_context_log(c,GRIB_LOG_DEBUG,"using dictionary %s from cache",self->dictionary); +static grib_trie* load_dictionary(grib_context* c, grib_expression* e, int* err) +{ + grib_expression_is_in_dict* self = (grib_expression_is_in_dict*)e; + + char* filename = NULL; + char line[1024] = {0,}; + char key[1024] = {0,}; + char* list = 0; + grib_trie* dictionary = NULL; + FILE* f = NULL; + int i = 0; + + *err = GRIB_SUCCESS; + + filename = grib_context_full_defs_path(c, self->dictionary); + if (!filename) { + grib_context_log(c, GRIB_LOG_ERROR, "unable to find def file %s", self->dictionary); + *err = GRIB_FILE_NOT_FOUND; + return NULL; + } + else { + grib_context_log(c, GRIB_LOG_DEBUG, "found def file %s", filename); + } + dictionary = (grib_trie*)grib_trie_get(c->lists, filename); + if (dictionary) { + grib_context_log(c, GRIB_LOG_DEBUG, "using dictionary %s from cache", self->dictionary); return dictionary; - } else { - grib_context_log(c,GRIB_LOG_DEBUG,"using dictionary %s from file %s",self->dictionary,filename); - } - - f=codes_fopen(filename,"r"); - if (!f) {*err=GRIB_IO_PROBLEM; return NULL;} - - dictionary=grib_trie_new(c); - - while(fgets(line,sizeof(line)-1,f)) { - i=0; - while (line[i] != '|' && line[i] != 0) { - key[i]=line[i]; - i++; + } + else { + grib_context_log(c, GRIB_LOG_DEBUG, "using dictionary %s from file %s", self->dictionary, filename); + } + + f = codes_fopen(filename, "r"); + if (!f) { + *err = GRIB_IO_PROBLEM; + return NULL; + } + + dictionary = grib_trie_new(c); + + while (fgets(line, sizeof(line) - 1, f)) { + i = 0; + while (line[i] != '|' && line[i] != 0) { + key[i] = line[i]; + i++; } - key[i]=0; - list=(char*)grib_context_malloc_clear(c,strlen(line)+1); - memcpy(list,line,strlen(line)); - grib_trie_insert(dictionary,key,list); - } + key[i] = 0; + list = (char*)grib_context_malloc_clear(c, strlen(line) + 1); + memcpy(list, line, strlen(line)); + grib_trie_insert(dictionary, key, list); + } - grib_trie_insert(c->lists,filename,dictionary); + grib_trie_insert(c->lists, filename, dictionary); - fclose(f); - - return dictionary; + fclose(f); + return dictionary; } - static const char* get_name(grib_expression* g) { - grib_expression_is_in_dict* e = (grib_expression_is_in_dict*)g; - return e->key; + grib_expression_is_in_dict* e = (grib_expression_is_in_dict*)g; + return e->key; } -static int evaluate_long(grib_expression* g,grib_handle *h,long* result) +static int evaluate_long(grib_expression* g, grib_handle* h, long* result) { - grib_expression_is_in_dict* e = (grib_expression_is_in_dict*)g; - int err=0; - char mybuf[1024]={0,}; - size_t size=1024; + grib_expression_is_in_dict* e = (grib_expression_is_in_dict*)g; + int err = 0; + char mybuf[1024] = {0,}; + size_t size = 1024; - grib_trie* dict=load_dictionary(h->context,g,&err); + grib_trie* dict = load_dictionary(h->context, g, &err); - if((err=grib_get_string_internal(h,e->key,mybuf,&size)) != GRIB_SUCCESS) - return err; + if ((err = grib_get_string_internal(h, e->key, mybuf, &size)) != GRIB_SUCCESS) + return err; - if (grib_trie_get(dict,mybuf)) *result=1; - else *result=0; + if (grib_trie_get(dict, mybuf)) + *result = 1; + else + *result = 0; - return err; + return err; } -static int evaluate_double(grib_expression *g,grib_handle *h,double* result) +static int evaluate_double(grib_expression* g, grib_handle* h, double* result) { - grib_expression_is_in_dict* e = (grib_expression_is_in_dict*)g; - int err=0; - char mybuf[1024]={0,}; - size_t size=1024; + grib_expression_is_in_dict* e = (grib_expression_is_in_dict*)g; + int err = 0; + char mybuf[1024] = {0,}; + size_t size = 1024; - grib_trie* list=load_dictionary(h->context,g,&err); + grib_trie* list = load_dictionary(h->context, g, &err); - if((err=grib_get_string_internal(h,e->key,mybuf,&size)) != GRIB_SUCCESS) - return err; + if ((err = grib_get_string_internal(h, e->key, mybuf, &size)) != GRIB_SUCCESS) + return err; - if (grib_trie_get(list,mybuf)) *result=1; - else *result=0; + if (grib_trie_get(list, mybuf)) + *result = 1; + else + *result = 0; - return err; + return err; } -static string evaluate_string(grib_expression* g,grib_handle* h,char* buf,size_t* size,int* err) +static string evaluate_string(grib_expression* g, grib_handle* h, char* buf, size_t* size, int* err) { - grib_expression_is_in_dict* e = (grib_expression_is_in_dict*)g; - char mybuf[1024]={0,}; - size_t sizebuf=1024; - long result; + grib_expression_is_in_dict* e = (grib_expression_is_in_dict*)g; + char mybuf[1024] = {0,}; + size_t sizebuf = 1024; + long result; - grib_trie* list=load_dictionary(h->context,g,err); + grib_trie* list = load_dictionary(h->context, g, err); - if((*err=grib_get_string_internal(h,e->key,mybuf,&sizebuf)) != GRIB_SUCCESS) - return NULL; + if ((*err = grib_get_string_internal(h, e->key, mybuf, &sizebuf)) != GRIB_SUCCESS) + return NULL; - if (grib_trie_get(list,mybuf)) result=1; - else result=0; + if (grib_trie_get(list, mybuf)) + result = 1; + else + result = 0; - sprintf(buf,"%ld",result); - *size=strlen(buf); - return buf; + sprintf(buf, "%ld", result); + *size = strlen(buf); + return buf; } -static void print(grib_context* c,grib_expression* g,grib_handle* f) +static void print(grib_context* c, grib_expression* g, grib_handle* f) { - grib_expression_is_in_dict* e = (grib_expression_is_in_dict*)g; - printf("access('%s",e->key); - if(f) - { - long s = 0; - grib_get_long(f,e->key,&s); - printf("=%ld",s); - } - printf("')"); + grib_expression_is_in_dict* e = (grib_expression_is_in_dict*)g; + printf("access('%s", e->key); + if (f) { + long s = 0; + grib_get_long(f, e->key, &s); + printf("=%ld", s); + } + printf("')"); } - -grib_expression* new_is_in_dict_expression(grib_context* c,const char* name,const char* list) +grib_expression* new_is_in_dict_expression(grib_context* c, const char* name, const char* list) { - grib_expression_is_in_dict* e = (grib_expression_is_in_dict*)grib_context_malloc_clear_persistent(c,sizeof(grib_expression_is_in_dict)); - e->base.cclass = grib_expression_class_is_in_dict; - e->key = grib_context_strdup_persistent(c,name); - e->dictionary = grib_context_strdup_persistent(c,list); - return (grib_expression*)e; + grib_expression_is_in_dict* e = (grib_expression_is_in_dict*)grib_context_malloc_clear_persistent(c, sizeof(grib_expression_is_in_dict)); + e->base.cclass = grib_expression_class_is_in_dict; + e->key = grib_context_strdup_persistent(c, name); + e->dictionary = grib_context_strdup_persistent(c, list); + return (grib_expression*)e; } -static int native_type(grib_expression* g,grib_handle *h) +static int native_type(grib_expression* g, grib_handle* h) { - return GRIB_TYPE_LONG; + return GRIB_TYPE_LONG; } -static void add_dependency(grib_expression* g, grib_accessor* observer){ - grib_expression_is_in_dict* e = (grib_expression_is_in_dict*)g; - grib_accessor *observed = grib_find_accessor(grib_handle_of_accessor(observer),e->key); +static void add_dependency(grib_expression* g, grib_accessor* observer) +{ + grib_expression_is_in_dict* e = (grib_expression_is_in_dict*)g; + grib_accessor* observed = grib_find_accessor(grib_handle_of_accessor(observer), e->key); - if(!observed) - { - /* grib_context_log(observer->context, GRIB_LOG_ERROR, */ - /* "Error in accessor_add_dependency: cannot find [%s]", e->name); */ - /* Assert(observed); */ - return; - } + if (!observed) { + /* grib_context_log(observer->context, GRIB_LOG_ERROR, */ + /* "Error in accessor_add_dependency: cannot find [%s]", e->name); */ + /* Assert(observed); */ + return; + } - grib_dependency_add(observer,observed); + grib_dependency_add(observer, observed); } - diff --git a/src/grib_expression_class_is_in_list.c b/src/grib_expression_class_is_in_list.c index 0fb44b4fb..ab4a90e10 100644 --- a/src/grib_expression_class_is_in_list.c +++ b/src/grib_expression_class_is_in_list.c @@ -41,45 +41,46 @@ or edit "expression.class" and rerun ./make_class.pl typedef const char* string; /* to keep make_class.pl happy */ -static void init_class (grib_expression_class*); +static void init_class(grib_expression_class*); -static void destroy(grib_context*,grib_expression* e); +static void destroy(grib_context*, grib_expression* e); -static void print(grib_context*,grib_expression*,grib_handle*); -static void add_dependency(grib_expression* e, grib_accessor* observer); +static void print(grib_context*, grib_expression*, grib_handle*); +static void add_dependency(grib_expression* e, grib_accessor* observer); static string get_name(grib_expression* e); -static int native_type(grib_expression*,grib_handle*); +static int native_type(grib_expression*, grib_handle*); -static int evaluate_long(grib_expression*,grib_handle*,long*); -static int evaluate_double(grib_expression*,grib_handle*,double*); -static string evaluate_string(grib_expression*,grib_handle*,char*,size_t*,int*); +static int evaluate_long(grib_expression*, grib_handle*, long*); +static int evaluate_double(grib_expression*, grib_handle*, double*); +static string evaluate_string(grib_expression*, grib_handle*, char*, size_t*, int*); -typedef struct grib_expression_is_in_list{ - grib_expression base; -/* Members defined in is_in_list */ - const char *name; - const char *list; +typedef struct grib_expression_is_in_list +{ + grib_expression base; + /* Members defined in is_in_list */ + const char* name; + const char* list; } grib_expression_is_in_list; static grib_expression_class _grib_expression_class_is_in_list = { - 0, /* super */ - "is_in_list", /* name */ - sizeof(grib_expression_is_in_list),/* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* constructor */ - &destroy, /* destructor */ - &print, - &add_dependency, - - &native_type, - &get_name, - - &evaluate_long, - &evaluate_double, - &evaluate_string, + 0, /* super */ + "is_in_list", /* name */ + sizeof(grib_expression_is_in_list), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* constructor */ + &destroy, /* destructor */ + &print, + &add_dependency, + + &native_type, + &get_name, + + &evaluate_long, + &evaluate_double, + &evaluate_string, }; grib_expression_class* grib_expression_class_is_in_list = &_grib_expression_class_is_in_list; @@ -91,48 +92,56 @@ static void init_class(grib_expression_class* c) /* END_CLASS_IMP */ -static grib_trie* load_list(grib_context* c,grib_expression* e, int* err) +static grib_trie* load_list(grib_context* c, grib_expression* e, int* err) { grib_expression_is_in_list* self = (grib_expression_is_in_list*)e; - char* filename=NULL; - char line[1024]={0,}; - grib_trie* list=NULL; - FILE* f=NULL; + char* filename = NULL; + char line[1024] = {0,}; + grib_trie* list = NULL; + FILE* f = NULL; - *err=GRIB_SUCCESS; + *err = GRIB_SUCCESS; - filename=grib_context_full_defs_path(c,self->list); + filename = grib_context_full_defs_path(c, self->list); if (!filename) { - grib_context_log(c,GRIB_LOG_ERROR,"unable to find def file %s",self->list); - *err=GRIB_FILE_NOT_FOUND; + grib_context_log(c, GRIB_LOG_ERROR, "unable to find def file %s", self->list); + *err = GRIB_FILE_NOT_FOUND; return NULL; - } else { - grib_context_log(c,GRIB_LOG_DEBUG,"found def file %s",filename); } - list=(grib_trie*)grib_trie_get(c->lists,filename); + else { + grib_context_log(c, GRIB_LOG_DEBUG, "found def file %s", filename); + } + list = (grib_trie*)grib_trie_get(c->lists, filename); if (list) { - grib_context_log(c,GRIB_LOG_DEBUG,"using list %s from cache",self->list); + grib_context_log(c, GRIB_LOG_DEBUG, "using list %s from cache", self->list); return list; - } else { - grib_context_log(c,GRIB_LOG_DEBUG,"using list %s from file %s",self->list,filename); + } + else { + grib_context_log(c, GRIB_LOG_DEBUG, "using list %s from file %s", self->list, filename); } - f=codes_fopen(filename,"r"); - if (!f) {*err=GRIB_IO_PROBLEM; return NULL;} + f = codes_fopen(filename, "r"); + if (!f) { + *err = GRIB_IO_PROBLEM; + return NULL; + } - list=grib_trie_new(c); + list = grib_trie_new(c); - while(fgets(line,sizeof(line)-1,f)) { - unsigned char* p=(unsigned char*)line; - while (*p!=0) { - if (*p<33) {*p=0; break;} + while (fgets(line, sizeof(line) - 1, f)) { + unsigned char* p = (unsigned char*)line; + while (*p != 0) { + if (*p < 33) { + *p = 0; + break; + } p++; } - grib_trie_insert(list,line,line); + grib_trie_insert(list, line, line); } - grib_trie_insert(c->lists,filename,list); + grib_trie_insert(c->lists, filename, list); fclose(f); @@ -145,110 +154,115 @@ static const char* get_name(grib_expression* g) return e->name; } -static int evaluate_long(grib_expression* g,grib_handle *h,long* result) +static int evaluate_long(grib_expression* g, grib_handle* h, long* result) { grib_expression_is_in_list* e = (grib_expression_is_in_list*)g; - int err=0; - char mybuf[1024]={0,}; - size_t size=1024; + int err = 0; + char mybuf[1024] = {0,}; + size_t size = 1024; - grib_trie* list=load_list(h->context,g,&err); + grib_trie* list = load_list(h->context, g, &err); - if((err=grib_get_string_internal(h,e->name,mybuf,&size)) != GRIB_SUCCESS) + if ((err = grib_get_string_internal(h, e->name, mybuf, &size)) != GRIB_SUCCESS) return err; - if (grib_trie_get(list,mybuf)) *result=1; - else *result=0; + if (grib_trie_get(list, mybuf)) + *result = 1; + else + *result = 0; return err; } -static int evaluate_double(grib_expression *g,grib_handle *h,double* result) +static int evaluate_double(grib_expression* g, grib_handle* h, double* result) { grib_expression_is_in_list* e = (grib_expression_is_in_list*)g; - int err=0; - char mybuf[1024]={0,}; - size_t size=1024; + int err = 0; + char mybuf[1024] = {0,}; + size_t size = 1024; - grib_trie* list=load_list(h->context,g,&err); + grib_trie* list = load_list(h->context, g, &err); - if((err=grib_get_string_internal(h,e->name,mybuf,&size)) != GRIB_SUCCESS) + if ((err = grib_get_string_internal(h, e->name, mybuf, &size)) != GRIB_SUCCESS) return err; - if (grib_trie_get(list,mybuf)) *result=1; - else *result=0; + if (grib_trie_get(list, mybuf)) + *result = 1; + else + *result = 0; return err; } -static string evaluate_string(grib_expression* g,grib_handle* h,char* buf,size_t* size,int* err) +static string evaluate_string(grib_expression* g, grib_handle* h, char* buf, size_t* size, int* err) { grib_expression_is_in_list* e = (grib_expression_is_in_list*)g; - char mybuf[1024]={0,}; - size_t sizebuf=1024; + char mybuf[1024] = {0,}; + size_t sizebuf = 1024; long result; - grib_trie* list=load_list(h->context,g,err); + grib_trie* list = load_list(h->context, g, err); - if((*err=grib_get_string_internal(h,e->name,mybuf,&sizebuf)) != GRIB_SUCCESS) + if ((*err = grib_get_string_internal(h, e->name, mybuf, &sizebuf)) != GRIB_SUCCESS) return NULL; - if (grib_trie_get(list,mybuf)) result=1; - else result=0; + if (grib_trie_get(list, mybuf)) + result = 1; + else + result = 0; - sprintf(buf,"%ld",result); - *size=strlen(buf); + sprintf(buf, "%ld", result); + *size = strlen(buf); return buf; } -static void print(grib_context* c,grib_expression* g,grib_handle* f) +static void print(grib_context* c, grib_expression* g, grib_handle* f) { grib_expression_is_in_list* e = (grib_expression_is_in_list*)g; - printf("access('%s",e->name); - if(f) - { + printf("access('%s", e->name); + if (f) { long s = 0; - grib_get_long(f,e->name,&s); - printf("=%ld",s); + grib_get_long(f, e->name, &s); + printf("=%ld", s); } printf("')"); } -static void destroy(grib_context* c,grib_expression* g) +static void destroy(grib_context* c, grib_expression* g) { } -static void add_dependency(grib_expression* g, grib_accessor* observer){ +static void add_dependency(grib_expression* g, grib_accessor* observer) +{ grib_expression_is_in_list* e = (grib_expression_is_in_list*)g; - grib_accessor *observed = grib_find_accessor(grib_handle_of_accessor(observer),e->name); + grib_accessor* observed = grib_find_accessor(grib_handle_of_accessor(observer), e->name); - if(!observed) - { + if (!observed) { /* grib_context_log(observer->context, GRIB_LOG_ERROR, */ /* "Error in accessor_add_dependency: cannot find [%s]", e->name); */ /* Assert(observed); */ return; } - grib_dependency_add(observer,observed); + grib_dependency_add(observer, observed); } -grib_expression* new_is_in_list_expression(grib_context* c,const char* name,const char* list) +grib_expression* new_is_in_list_expression(grib_context* c, const char* name, const char* list) { - grib_expression_is_in_list* e = (grib_expression_is_in_list*)grib_context_malloc_clear_persistent(c,sizeof(grib_expression_is_in_list)); - e->base.cclass = grib_expression_class_is_in_list; - e->name = grib_context_strdup_persistent(c,name); - e->list = grib_context_strdup_persistent(c,list); + grib_expression_is_in_list* e = (grib_expression_is_in_list*)grib_context_malloc_clear_persistent(c, sizeof(grib_expression_is_in_list)); + e->base.cclass = grib_expression_class_is_in_list; + e->name = grib_context_strdup_persistent(c, name); + e->list = grib_context_strdup_persistent(c, list); return (grib_expression*)e; } -static int native_type(grib_expression* g,grib_handle *h) +static int native_type(grib_expression* g, grib_handle* h) { grib_expression_is_in_list* e = (grib_expression_is_in_list*)g; - int type = 0; + int type = 0; int err; - if((err=grib_get_native_type(h,e->name,&type)) != GRIB_SUCCESS) + if ((err = grib_get_native_type(h, e->name, &type)) != GRIB_SUCCESS) grib_context_log(h->context, GRIB_LOG_ERROR, - "Error in native_type %s : %s", e->name,grib_get_error_message(err)); + "Error in native_type %s : %s", e->name, grib_get_error_message(err)); return type; } diff --git a/src/grib_expression_class_is_integer.c b/src/grib_expression_class_is_integer.c index 1eed17568..60e76e7ed 100644 --- a/src/grib_expression_class_is_integer.c +++ b/src/grib_expression_class_is_integer.c @@ -42,46 +42,47 @@ or edit "expression.class" and rerun ./make_class.pl typedef const char* string; /* to keep make_class.pl happy */ -static void init_class (grib_expression_class*); +static void init_class(grib_expression_class*); -static void destroy(grib_context*,grib_expression* e); +static void destroy(grib_context*, grib_expression* e); -static void print(grib_context*,grib_expression*,grib_handle*); -static void add_dependency(grib_expression* e, grib_accessor* observer); +static void print(grib_context*, grib_expression*, grib_handle*); +static void add_dependency(grib_expression* e, grib_accessor* observer); static string get_name(grib_expression* e); -static int native_type(grib_expression*,grib_handle*); +static int native_type(grib_expression*, grib_handle*); -static int evaluate_long(grib_expression*,grib_handle*,long*); -static int evaluate_double(grib_expression*,grib_handle*,double*); -static string evaluate_string(grib_expression*,grib_handle*,char*,size_t*,int*); +static int evaluate_long(grib_expression*, grib_handle*, long*); +static int evaluate_double(grib_expression*, grib_handle*, double*); +static string evaluate_string(grib_expression*, grib_handle*, char*, size_t*, int*); -typedef struct grib_expression_is_integer{ - grib_expression base; -/* Members defined in is_integer */ - char *name; - size_t start; - size_t length; +typedef struct grib_expression_is_integer +{ + grib_expression base; + /* Members defined in is_integer */ + char* name; + size_t start; + size_t length; } grib_expression_is_integer; static grib_expression_class _grib_expression_class_is_integer = { - 0, /* super */ - "is_integer", /* name */ - sizeof(grib_expression_is_integer),/* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* constructor */ - &destroy, /* destructor */ - &print, - &add_dependency, - - &native_type, - &get_name, - - &evaluate_long, - &evaluate_double, - &evaluate_string, + 0, /* super */ + "is_integer", /* name */ + sizeof(grib_expression_is_integer), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* constructor */ + &destroy, /* destructor */ + &print, + &add_dependency, + + &native_type, + &get_name, + + &evaluate_long, + &evaluate_double, + &evaluate_string, }; grib_expression_class* grib_expression_class_is_integer = &_grib_expression_class_is_integer; @@ -98,108 +99,108 @@ static const char* get_name(grib_expression* g) return e->name; } -static int evaluate_long(grib_expression* g,grib_handle *h,long* result) +static int evaluate_long(grib_expression* g, grib_handle* h, long* result) { grib_expression_is_integer* e = (grib_expression_is_integer*)g; - int err=0; - char mybuf[1024]={0,}; - size_t size=1024; - char *p=0; - long val=0; - char* start=0; - - if((err=grib_get_string_internal(h,e->name,mybuf,&size)) != GRIB_SUCCESS) + int err = 0; + char mybuf[1024] = {0,}; + size_t size = 1024; + char* p = 0; + long val = 0; + char* start = 0; + + if ((err = grib_get_string_internal(h, e->name, mybuf, &size)) != GRIB_SUCCESS) return err; - start=mybuf+e->start; + start = mybuf + e->start; - if (e->length > 0 ) start[e->length]=0; + if (e->length > 0) + start[e->length] = 0; - val=strtol(start,&p,10); + val = strtol(start, &p, 10); - if (*p!=0) - *result=0; + if (*p != 0) + *result = 0; else - *result=1; + *result = 1; (void)val; return err; } -static int evaluate_double(grib_expression *g,grib_handle *h,double* result) +static int evaluate_double(grib_expression* g, grib_handle* h, double* result) { - int err=0; - long lresult=0; + int err = 0; + long lresult = 0; - err=evaluate_long(g,h,&lresult); - *result=lresult; + err = evaluate_long(g, h, &lresult); + *result = lresult; return err; } -static string evaluate_string(grib_expression* g,grib_handle* h,char* buf,size_t* size,int* err) +static string evaluate_string(grib_expression* g, grib_handle* h, char* buf, size_t* size, int* err) { - long lresult=0; - double dresult=0.0; + long lresult = 0; + double dresult = 0.0; switch (grib_expression_native_type(h, g)) { - case GRIB_TYPE_LONG: - *err=evaluate_long(g,h,&lresult); - sprintf(buf,"%ld",lresult); - break; - case GRIB_TYPE_DOUBLE: - *err=evaluate_double(g,h,&dresult); - sprintf(buf,"%g",dresult); - break; + case GRIB_TYPE_LONG: + *err = evaluate_long(g, h, &lresult); + sprintf(buf, "%ld", lresult); + break; + case GRIB_TYPE_DOUBLE: + *err = evaluate_double(g, h, &dresult); + sprintf(buf, "%g", dresult); + break; } return buf; } -static void print(grib_context* c,grib_expression* g,grib_handle* f) +static void print(grib_context* c, grib_expression* g, grib_handle* f) { grib_expression_is_integer* e = (grib_expression_is_integer*)g; - printf("access('%s",e->name); - if(f) - { + printf("access('%s", e->name); + if (f) { long s = 0; - grib_get_long(f,e->name,&s); - printf("=%ld",s); + grib_get_long(f, e->name, &s); + printf("=%ld", s); } printf("')"); } -static void destroy(grib_context* c,grib_expression* g) +static void destroy(grib_context* c, grib_expression* g) { grib_expression_is_integer* e = (grib_expression_is_integer*)g; - grib_context_free_persistent(c,e->name); + grib_context_free_persistent(c, e->name); } -static void add_dependency(grib_expression* g, grib_accessor* observer){ +static void add_dependency(grib_expression* g, grib_accessor* observer) +{ grib_expression_is_integer* e = (grib_expression_is_integer*)g; - grib_accessor *observed = grib_find_accessor(grib_handle_of_accessor(observer),e->name); + grib_accessor* observed = grib_find_accessor(grib_handle_of_accessor(observer), e->name); - if(!observed) - { + if (!observed) { /* grib_context_log(observer->context, GRIB_LOG_ERROR, */ /* "Error in accessor_add_dependency: cannot find [%s]", e->name); */ /* Assert(observed); */ return; } - grib_dependency_add(observer,observed); + grib_dependency_add(observer, observed); } -grib_expression* new_is_integer_expression(grib_context* c,const char *name,int start,int length) +grib_expression* new_is_integer_expression(grib_context* c, const char* name, int start, int length) { - grib_expression_is_integer* e = (grib_expression_is_integer*)grib_context_malloc_clear_persistent(c,sizeof(grib_expression_is_integer)); - e->base.cclass = grib_expression_class_is_integer; - e->name = grib_context_strdup_persistent(c,name); - e->start = start; - e->length = length; + grib_expression_is_integer* e = (grib_expression_is_integer*)grib_context_malloc_clear_persistent(c, sizeof(grib_expression_is_integer)); + e->base.cclass = grib_expression_class_is_integer; + e->name = grib_context_strdup_persistent(c, name); + e->start = start; + e->length = length; return (grib_expression*)e; } -static int native_type(grib_expression* g,grib_handle *h) +static int native_type(grib_expression* g, grib_handle* h) { return GRIB_TYPE_LONG; } diff --git a/src/grib_expression_class_length.c b/src/grib_expression_class_length.c index c5c48a667..4de5b8c2b 100644 --- a/src/grib_expression_class_length.c +++ b/src/grib_expression_class_length.c @@ -42,46 +42,47 @@ or edit "expression.class" and rerun ./make_class.pl typedef const char* string; /* to keep make_class.pl happy */ -static void init_class (grib_expression_class*); +static void init_class(grib_expression_class*); -static void destroy(grib_context*,grib_expression* e); +static void destroy(grib_context*, grib_expression* e); -static void print(grib_context*,grib_expression*,grib_handle*); -static void add_dependency(grib_expression* e, grib_accessor* observer); +static void print(grib_context*, grib_expression*, grib_handle*); +static void add_dependency(grib_expression* e, grib_accessor* observer); static string get_name(grib_expression* e); -static int native_type(grib_expression*,grib_handle*); +static int native_type(grib_expression*, grib_handle*); -static int evaluate_long(grib_expression*,grib_handle*,long*); -static int evaluate_double(grib_expression*,grib_handle*,double*); -static string evaluate_string(grib_expression*,grib_handle*,char*,size_t*,int*); +static int evaluate_long(grib_expression*, grib_handle*, long*); +static int evaluate_double(grib_expression*, grib_handle*, double*); +static string evaluate_string(grib_expression*, grib_handle*, char*, size_t*, int*); -typedef struct grib_expression_length{ - grib_expression base; -/* Members defined in length */ - char *name; - size_t start; - size_t length; +typedef struct grib_expression_length +{ + grib_expression base; + /* Members defined in length */ + char* name; + size_t start; + size_t length; } grib_expression_length; static grib_expression_class _grib_expression_class_length = { - 0, /* super */ - "length", /* name */ - sizeof(grib_expression_length),/* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* constructor */ - &destroy, /* destructor */ - &print, - &add_dependency, - - &native_type, - &get_name, - - &evaluate_long, - &evaluate_double, - &evaluate_string, + 0, /* super */ + "length", /* name */ + sizeof(grib_expression_length), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* constructor */ + &destroy, /* destructor */ + &print, + &add_dependency, + + &native_type, + &get_name, + + &evaluate_long, + &evaluate_double, + &evaluate_string, }; grib_expression_class* grib_expression_class_length = &_grib_expression_class_length; @@ -98,88 +99,86 @@ static const char* get_name(grib_expression* g) return e->name; } -static int evaluate_long(grib_expression* g,grib_handle *h,long* result) +static int evaluate_long(grib_expression* g, grib_handle* h, long* result) { grib_expression_length* e = (grib_expression_length*)g; - int err=0; - char mybuf[1024]={0,}; - size_t size=1024; - if((err=grib_get_string_internal(h,e->name,mybuf,&size)) != GRIB_SUCCESS) + int err = 0; + char mybuf[1024] = {0,}; + size_t size = 1024; + if ((err = grib_get_string_internal(h, e->name, mybuf, &size)) != GRIB_SUCCESS) return err; - *result=strlen(mybuf); + *result = strlen(mybuf); return err; } -static int evaluate_double(grib_expression *g,grib_handle *h,double* result) +static int evaluate_double(grib_expression* g, grib_handle* h, double* result) { grib_expression_length* e = (grib_expression_length*)g; - char mybuf[1024]={0,}; - size_t size=1024; - int err=0; - if((err=grib_get_string_internal(h,e->name,mybuf,&size)) != GRIB_SUCCESS) + char mybuf[1024] = {0,}; + size_t size = 1024; + int err = 0; + if ((err = grib_get_string_internal(h, e->name, mybuf, &size)) != GRIB_SUCCESS) return err; - *result=strlen(mybuf); + *result = strlen(mybuf); return err; } -static string evaluate_string(grib_expression* g,grib_handle* h,char* buf,size_t* size,int* err) +static string evaluate_string(grib_expression* g, grib_handle* h, char* buf, size_t* size, int* err) { grib_expression_length* e = (grib_expression_length*)g; - char mybuf[1024]={0,}; + char mybuf[1024] = {0,}; Assert(buf); - if((*err=grib_get_string_internal(h,e->name,mybuf,size)) != GRIB_SUCCESS) + if ((*err = grib_get_string_internal(h, e->name, mybuf, size)) != GRIB_SUCCESS) return NULL; - sprintf(buf,"%ld",(long)strlen(mybuf)); + sprintf(buf, "%ld", (long)strlen(mybuf)); return buf; } -static void print(grib_context* c,grib_expression* g,grib_handle* f) +static void print(grib_context* c, grib_expression* g, grib_handle* f) { grib_expression_length* e = (grib_expression_length*)g; - printf("access('%s",e->name); - if(f) - { + printf("access('%s", e->name); + if (f) { long s = 0; - grib_get_long(f,e->name,&s); - printf("=%ld",s); + grib_get_long(f, e->name, &s); + printf("=%ld", s); } printf("')"); } -static void destroy(grib_context* c,grib_expression* g) +static void destroy(grib_context* c, grib_expression* g) { grib_expression_length* e = (grib_expression_length*)g; - grib_context_free_persistent(c,e->name); + grib_context_free_persistent(c, e->name); } -static void add_dependency(grib_expression* g, grib_accessor* observer) +static void add_dependency(grib_expression* g, grib_accessor* observer) { grib_expression_length* e = (grib_expression_length*)g; - grib_accessor *observed = grib_find_accessor(grib_handle_of_accessor(observer),e->name); + grib_accessor* observed = grib_find_accessor(grib_handle_of_accessor(observer), e->name); - if(!observed) - { + if (!observed) { /* grib_context_log(observer->context, GRIB_LOG_ERROR, */ /* "Error in accessor_add_dependency: cannot find [%s]", e->name); */ /* Assert(observed); */ return; } - grib_dependency_add(observer,observed); + grib_dependency_add(observer, observed); } -grib_expression* new_length_expression(grib_context* c,const char *name) +grib_expression* new_length_expression(grib_context* c, const char* name) { - grib_expression_length* e = (grib_expression_length*)grib_context_malloc_clear_persistent(c,sizeof(grib_expression_length)); + grib_expression_length* e = (grib_expression_length*)grib_context_malloc_clear_persistent(c, sizeof(grib_expression_length)); e->base.cclass = grib_expression_class_length; - e->name = grib_context_strdup_persistent(c,name); + e->name = grib_context_strdup_persistent(c, name); return (grib_expression*)e; } -static int native_type(grib_expression* g,grib_handle *h) +static int native_type(grib_expression* g, grib_handle* h) { return GRIB_TYPE_LONG; } diff --git a/src/grib_expression_class_logical_and.c b/src/grib_expression_class_logical_and.c index 99c29c132..5dd1ee504 100644 --- a/src/grib_expression_class_logical_and.c +++ b/src/grib_expression_class_logical_and.c @@ -40,43 +40,44 @@ or edit "expression.class" and rerun ./make_class.pl typedef const char* string; /* to keep make_class.pl happy */ -static void init_class (grib_expression_class*); +static void init_class(grib_expression_class*); -static void destroy(grib_context*,grib_expression* e); +static void destroy(grib_context*, grib_expression* e); -static void print(grib_context*,grib_expression*,grib_handle*); -static void add_dependency(grib_expression* e, grib_accessor* observer); +static void print(grib_context*, grib_expression*, grib_handle*); +static void add_dependency(grib_expression* e, grib_accessor* observer); -static int native_type(grib_expression*,grib_handle*); +static int native_type(grib_expression*, grib_handle*); -static int evaluate_long(grib_expression*,grib_handle*,long*); -static int evaluate_double(grib_expression*,grib_handle*,double*); +static int evaluate_long(grib_expression*, grib_handle*, long*); +static int evaluate_double(grib_expression*, grib_handle*, double*); -typedef struct grib_expression_logical_and{ - grib_expression base; -/* Members defined in logical_and */ - grib_expression *left; - grib_expression *right; +typedef struct grib_expression_logical_and +{ + grib_expression base; + /* Members defined in logical_and */ + grib_expression* left; + grib_expression* right; } grib_expression_logical_and; static grib_expression_class _grib_expression_class_logical_and = { - 0, /* super */ - "logical_and", /* name */ - sizeof(grib_expression_logical_and),/* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* constructor */ - &destroy, /* destructor */ - &print, - &add_dependency, - - &native_type, - 0, - - &evaluate_long, - &evaluate_double, - 0, + 0, /* super */ + "logical_and", /* name */ + sizeof(grib_expression_logical_and), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* constructor */ + &destroy, /* destructor */ + &print, + &add_dependency, + + &native_type, + 0, + + &evaluate_long, + &evaluate_double, + 0, }; grib_expression_class* grib_expression_class_logical_and = &_grib_expression_class_logical_and; @@ -87,100 +88,104 @@ static void init_class(grib_expression_class* c) } /* END_CLASS_IMP */ -static int evaluate_long(grib_expression *g,grib_handle* h,long* lres) +static int evaluate_long(grib_expression* g, grib_handle* h, long* lres) { - long v1=0; - long v2=0; - double dv1=0; - double dv2=0; + long v1 = 0; + long v2 = 0; + double dv1 = 0; + double dv2 = 0; int ret; grib_expression_logical_and* e = (grib_expression_logical_and*)g; switch (grib_expression_native_type(h, e->left)) { - case GRIB_TYPE_LONG: - ret = grib_expression_evaluate_long(h,e->left,&v1); - if (ret != GRIB_SUCCESS) return ret; - if (v1 == 0) { - *lres=0; - return ret; - } - break; - case GRIB_TYPE_DOUBLE: - ret = grib_expression_evaluate_double(h,e->left,&dv1); - if (ret != GRIB_SUCCESS) return ret; - if (dv1 == 0) { - *lres=0; - return ret; - } - break; - default : - return GRIB_INVALID_TYPE; + case GRIB_TYPE_LONG: + ret = grib_expression_evaluate_long(h, e->left, &v1); + if (ret != GRIB_SUCCESS) + return ret; + if (v1 == 0) { + *lres = 0; + return ret; + } + break; + case GRIB_TYPE_DOUBLE: + ret = grib_expression_evaluate_double(h, e->left, &dv1); + if (ret != GRIB_SUCCESS) + return ret; + if (dv1 == 0) { + *lres = 0; + return ret; + } + break; + default: + return GRIB_INVALID_TYPE; } switch (grib_expression_native_type(h, e->right)) { - case GRIB_TYPE_LONG: - ret = grib_expression_evaluate_long(h,e->right,&v2); - if (ret != GRIB_SUCCESS) return ret; - *lres = v2 ? 1 : 0; - break; - case GRIB_TYPE_DOUBLE: - ret = grib_expression_evaluate_double(h,e->right,&dv2); - if (ret != GRIB_SUCCESS) return ret; - *lres = dv2 ? 1 : 0; - break; - default : - return GRIB_INVALID_TYPE; + case GRIB_TYPE_LONG: + ret = grib_expression_evaluate_long(h, e->right, &v2); + if (ret != GRIB_SUCCESS) + return ret; + *lres = v2 ? 1 : 0; + break; + case GRIB_TYPE_DOUBLE: + ret = grib_expression_evaluate_double(h, e->right, &dv2); + if (ret != GRIB_SUCCESS) + return ret; + *lres = dv2 ? 1 : 0; + break; + default: + return GRIB_INVALID_TYPE; } return GRIB_SUCCESS; } -static int evaluate_double(grib_expression *g,grib_handle* h,double* dres) +static int evaluate_double(grib_expression* g, grib_handle* h, double* dres) { - long lres=0; - int ret=0; + long lres = 0; + int ret = 0; - ret=evaluate_long(g,h,&lres); - *dres=(double)lres; + ret = evaluate_long(g, h, &lres); + *dres = (double)lres; return ret; } -static void print(grib_context* c,grib_expression* g,grib_handle* f) +static void print(grib_context* c, grib_expression* g, grib_handle* f) { grib_expression_logical_and* e = (grib_expression_logical_and*)g; printf("("); - grib_expression_print(c,e->left,f); + grib_expression_print(c, e->left, f); printf(" && "); - grib_expression_print(c,e->right,f); + grib_expression_print(c, e->right, f); printf(")"); } -static void destroy(grib_context* c,grib_expression* g) +static void destroy(grib_context* c, grib_expression* g) { grib_expression_logical_and* e = (grib_expression_logical_and*)g; - grib_expression_free(c,e->left); - grib_expression_free(c,e->right); + grib_expression_free(c, e->left); + grib_expression_free(c, e->right); } -static void add_dependency(grib_expression* g, grib_accessor* observer) +static void add_dependency(grib_expression* g, grib_accessor* observer) { grib_expression_logical_and* e = (grib_expression_logical_and*)g; - grib_dependency_observe_expression(observer,e->left); - grib_dependency_observe_expression(observer,e->right); + grib_dependency_observe_expression(observer, e->left); + grib_dependency_observe_expression(observer, e->right); } -grib_expression* new_logical_and_expression(grib_context* c, grib_expression* left,grib_expression* right) +grib_expression* new_logical_and_expression(grib_context* c, grib_expression* left, grib_expression* right) { - grib_expression_logical_and* e = (grib_expression_logical_and*)grib_context_malloc_clear_persistent(c,sizeof(grib_expression_logical_and)); + grib_expression_logical_and* e = (grib_expression_logical_and*)grib_context_malloc_clear_persistent(c, sizeof(grib_expression_logical_and)); e->base.cclass = grib_expression_class_logical_and; - e->left = left; - e->right = right; + e->left = left; + e->right = right; return (grib_expression*)e; } -static int native_type(grib_expression* g,grib_handle *h) +static int native_type(grib_expression* g, grib_handle* h) { return GRIB_TYPE_LONG; } diff --git a/src/grib_expression_class_logical_or.c b/src/grib_expression_class_logical_or.c index ce60481b0..47a7bcdd1 100644 --- a/src/grib_expression_class_logical_or.c +++ b/src/grib_expression_class_logical_or.c @@ -40,43 +40,44 @@ or edit "expression.class" and rerun ./make_class.pl typedef const char* string; /* to keep make_class.pl happy */ -static void init_class (grib_expression_class*); +static void init_class(grib_expression_class*); -static void destroy(grib_context*,grib_expression* e); +static void destroy(grib_context*, grib_expression* e); -static void print(grib_context*,grib_expression*,grib_handle*); -static void add_dependency(grib_expression* e, grib_accessor* observer); +static void print(grib_context*, grib_expression*, grib_handle*); +static void add_dependency(grib_expression* e, grib_accessor* observer); -static int native_type(grib_expression*,grib_handle*); +static int native_type(grib_expression*, grib_handle*); -static int evaluate_long(grib_expression*,grib_handle*,long*); -static int evaluate_double(grib_expression*,grib_handle*,double*); +static int evaluate_long(grib_expression*, grib_handle*, long*); +static int evaluate_double(grib_expression*, grib_handle*, double*); -typedef struct grib_expression_logical_or{ - grib_expression base; -/* Members defined in logical_or */ - grib_expression *left; - grib_expression *right; +typedef struct grib_expression_logical_or +{ + grib_expression base; + /* Members defined in logical_or */ + grib_expression* left; + grib_expression* right; } grib_expression_logical_or; static grib_expression_class _grib_expression_class_logical_or = { - 0, /* super */ - "logical_or", /* name */ - sizeof(grib_expression_logical_or),/* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* constructor */ - &destroy, /* destructor */ - &print, - &add_dependency, - - &native_type, - 0, - - &evaluate_long, - &evaluate_double, - 0, + 0, /* super */ + "logical_or", /* name */ + sizeof(grib_expression_logical_or), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* constructor */ + &destroy, /* destructor */ + &print, + &add_dependency, + + &native_type, + 0, + + &evaluate_long, + &evaluate_double, + 0, }; grib_expression_class* grib_expression_class_logical_or = &_grib_expression_class_logical_or; @@ -87,100 +88,104 @@ static void init_class(grib_expression_class* c) } /* END_CLASS_IMP */ -static int evaluate_long(grib_expression *g,grib_handle* h,long* lres) +static int evaluate_long(grib_expression* g, grib_handle* h, long* lres) { - long v1=0; - long v2=0; - double dv1=0; - double dv2=0; + long v1 = 0; + long v2 = 0; + double dv1 = 0; + double dv2 = 0; int ret; grib_expression_logical_or* e = (grib_expression_logical_or*)g; switch (grib_expression_native_type(h, e->left)) { - case GRIB_TYPE_LONG: - ret = grib_expression_evaluate_long(h,e->left,&v1); - if (ret != GRIB_SUCCESS) return ret; - if (v1 != 0) { - *lres=1; - return ret; - } - break; - case GRIB_TYPE_DOUBLE: - ret = grib_expression_evaluate_double(h,e->left,&dv1); - if (ret != GRIB_SUCCESS) return ret; - if (dv1 != 0) { - *lres=1; - return ret; - } - break; - default : - return GRIB_INVALID_TYPE; + case GRIB_TYPE_LONG: + ret = grib_expression_evaluate_long(h, e->left, &v1); + if (ret != GRIB_SUCCESS) + return ret; + if (v1 != 0) { + *lres = 1; + return ret; + } + break; + case GRIB_TYPE_DOUBLE: + ret = grib_expression_evaluate_double(h, e->left, &dv1); + if (ret != GRIB_SUCCESS) + return ret; + if (dv1 != 0) { + *lres = 1; + return ret; + } + break; + default: + return GRIB_INVALID_TYPE; } switch (grib_expression_native_type(h, e->right)) { - case GRIB_TYPE_LONG: - ret = grib_expression_evaluate_long(h,e->right,&v2); - if (ret != GRIB_SUCCESS) return ret; - *lres = v2 ? 1 : 0; - break; - case GRIB_TYPE_DOUBLE: - ret = grib_expression_evaluate_double(h,e->right,&dv2); - if (ret != GRIB_SUCCESS) return ret; - *lres = dv2 ? 1 : 0; - break; - default : - return GRIB_INVALID_TYPE; + case GRIB_TYPE_LONG: + ret = grib_expression_evaluate_long(h, e->right, &v2); + if (ret != GRIB_SUCCESS) + return ret; + *lres = v2 ? 1 : 0; + break; + case GRIB_TYPE_DOUBLE: + ret = grib_expression_evaluate_double(h, e->right, &dv2); + if (ret != GRIB_SUCCESS) + return ret; + *lres = dv2 ? 1 : 0; + break; + default: + return GRIB_INVALID_TYPE; } return GRIB_SUCCESS; } -static int evaluate_double(grib_expression *g,grib_handle* h,double* dres) +static int evaluate_double(grib_expression* g, grib_handle* h, double* dres) { - long lres=0; - int ret=0; + long lres = 0; + int ret = 0; - ret=evaluate_long(g,h,&lres); - *dres=(double)lres; + ret = evaluate_long(g, h, &lres); + *dres = (double)lres; return ret; } -static void print(grib_context* c,grib_expression* g,grib_handle* f) +static void print(grib_context* c, grib_expression* g, grib_handle* f) { grib_expression_logical_or* e = (grib_expression_logical_or*)g; printf("("); - grib_expression_print(c,e->left,f); + grib_expression_print(c, e->left, f); printf(" && "); - grib_expression_print(c,e->right,f); + grib_expression_print(c, e->right, f); printf(")"); } -static void destroy(grib_context* c,grib_expression* g) +static void destroy(grib_context* c, grib_expression* g) { grib_expression_logical_or* e = (grib_expression_logical_or*)g; - grib_expression_free(c,e->left); - grib_expression_free(c,e->right); + grib_expression_free(c, e->left); + grib_expression_free(c, e->right); } -static void add_dependency(grib_expression* g, grib_accessor* observer) +static void add_dependency(grib_expression* g, grib_accessor* observer) { grib_expression_logical_or* e = (grib_expression_logical_or*)g; - grib_dependency_observe_expression(observer,e->left); - grib_dependency_observe_expression(observer,e->right); + grib_dependency_observe_expression(observer, e->left); + grib_dependency_observe_expression(observer, e->right); } -grib_expression* new_logical_or_expression(grib_context* c, grib_expression* left,grib_expression* right) +grib_expression* new_logical_or_expression(grib_context* c, grib_expression* left, grib_expression* right) { - grib_expression_logical_or* e = (grib_expression_logical_or*)grib_context_malloc_clear_persistent(c,sizeof(grib_expression_logical_or)); - e->base.cclass = grib_expression_class_logical_or; - e->left = left; - e->right = right; + grib_expression_logical_or* e = (grib_expression_logical_or*)grib_context_malloc_clear_persistent(c, sizeof(grib_expression_logical_or)); + e->base.cclass = grib_expression_class_logical_or; + e->left = left; + e->right = right; return (grib_expression*)e; } -static int native_type(grib_expression* g,grib_handle *h) +static int native_type(grib_expression* g, grib_handle* h) { return GRIB_TYPE_LONG; } diff --git a/src/grib_expression_class_long.c b/src/grib_expression_class_long.c index 3968cc177..c51b5b3fe 100644 --- a/src/grib_expression_class_long.c +++ b/src/grib_expression_class_long.c @@ -38,42 +38,43 @@ or edit "expression.class" and rerun ./make_class.pl typedef const char* string; /* to keep make_class.pl happy */ -static void init_class (grib_expression_class*); +static void init_class(grib_expression_class*); -static void destroy(grib_context*,grib_expression* e); +static void destroy(grib_context*, grib_expression* e); -static void print(grib_context*,grib_expression*,grib_handle*); -static void add_dependency(grib_expression* e, grib_accessor* observer); +static void print(grib_context*, grib_expression*, grib_handle*); +static void add_dependency(grib_expression* e, grib_accessor* observer); -static int native_type(grib_expression*,grib_handle*); +static int native_type(grib_expression*, grib_handle*); -static int evaluate_long(grib_expression*,grib_handle*,long*); -static int evaluate_double(grib_expression*,grib_handle*,double*); +static int evaluate_long(grib_expression*, grib_handle*, long*); +static int evaluate_double(grib_expression*, grib_handle*, double*); -typedef struct grib_expression_long{ - grib_expression base; -/* Members defined in long */ - long value; +typedef struct grib_expression_long +{ + grib_expression base; + /* Members defined in long */ + long value; } grib_expression_long; static grib_expression_class _grib_expression_class_long = { - 0, /* super */ - "long", /* name */ - sizeof(grib_expression_long),/* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* constructor */ - &destroy, /* destructor */ - &print, - &add_dependency, - - &native_type, - 0, - - &evaluate_long, - &evaluate_double, - 0, + 0, /* super */ + "long", /* name */ + sizeof(grib_expression_long), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* constructor */ + &destroy, /* destructor */ + &print, + &add_dependency, + + &native_type, + 0, + + &evaluate_long, + &evaluate_double, + 0, }; grib_expression_class* grib_expression_class_long = &_grib_expression_class_long; @@ -84,44 +85,45 @@ static void init_class(grib_expression_class* c) } /* END_CLASS_IMP */ -static int evaluate_long(grib_expression* g,grib_handle* h,long* lres) +static int evaluate_long(grib_expression* g, grib_handle* h, long* lres) { - grib_expression_long* e = (grib_expression_long*)g; - *lres = e->value; - return GRIB_SUCCESS; + grib_expression_long* e = (grib_expression_long*)g; + *lres = e->value; + return GRIB_SUCCESS; } -static int evaluate_double(grib_expression* g,grib_handle *h,double* dres) +static int evaluate_double(grib_expression* g, grib_handle* h, double* dres) { - grib_expression_long* e = (grib_expression_long*)g; - *dres=e->value; - return GRIB_SUCCESS; + grib_expression_long* e = (grib_expression_long*)g; + *dres = e->value; + return GRIB_SUCCESS; } -static void print(grib_context* c,grib_expression* g,grib_handle* f) +static void print(grib_context* c, grib_expression* g, grib_handle* f) { - grib_expression_long* e = (grib_expression_long*)g; - printf("long(%ld)",e->value); + grib_expression_long* e = (grib_expression_long*)g; + printf("long(%ld)", e->value); } -static void destroy(grib_context* c,grib_expression* g) +static void destroy(grib_context* c, grib_expression* g) { - /* grib_expression_long* e = (grib_expression_long*)g; */ + /* grib_expression_long* e = (grib_expression_long*)g; */ } -static void add_dependency(grib_expression* g, grib_accessor* observer){ - /* grib_expression_long* e = (grib_expression_long*)g; */ +static void add_dependency(grib_expression* g, grib_accessor* observer) +{ + /* grib_expression_long* e = (grib_expression_long*)g; */ } -grib_expression* new_long_expression(grib_context* c,long value) +grib_expression* new_long_expression(grib_context* c, long value) { - grib_expression_long* e = (grib_expression_long*)grib_context_malloc_clear_persistent(c,sizeof(grib_expression_long)); - e->base.cclass = grib_expression_class_long; - e->value = value; - return (grib_expression*)e; + grib_expression_long* e = (grib_expression_long*)grib_context_malloc_clear_persistent(c, sizeof(grib_expression_long)); + e->base.cclass = grib_expression_class_long; + e->value = value; + return (grib_expression*)e; } -static int native_type(grib_expression* g,grib_handle *h) +static int native_type(grib_expression* g, grib_handle* h) { - return GRIB_TYPE_LONG; + return GRIB_TYPE_LONG; } diff --git a/src/grib_expression_class_string.c b/src/grib_expression_class_string.c index 31e7b8642..369aa4607 100644 --- a/src/grib_expression_class_string.c +++ b/src/grib_expression_class_string.c @@ -37,41 +37,42 @@ or edit "expression.class" and rerun ./make_class.pl typedef const char* string; /* to keep make_class.pl happy */ -static void init_class (grib_expression_class*); +static void init_class(grib_expression_class*); -static void destroy(grib_context*,grib_expression* e); +static void destroy(grib_context*, grib_expression* e); -static void print(grib_context*,grib_expression*,grib_handle*); -static void add_dependency(grib_expression* e, grib_accessor* observer); +static void print(grib_context*, grib_expression*, grib_handle*); +static void add_dependency(grib_expression* e, grib_accessor* observer); -static int native_type(grib_expression*,grib_handle*); +static int native_type(grib_expression*, grib_handle*); -static string evaluate_string(grib_expression*,grib_handle*,char*,size_t*,int*); +static string evaluate_string(grib_expression*, grib_handle*, char*, size_t*, int*); -typedef struct grib_expression_string{ - grib_expression base; -/* Members defined in string */ - char* value; +typedef struct grib_expression_string +{ + grib_expression base; + /* Members defined in string */ + char* value; } grib_expression_string; static grib_expression_class _grib_expression_class_string = { - 0, /* super */ - "string", /* name */ - sizeof(grib_expression_string),/* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* constructor */ - &destroy, /* destructor */ - &print, - &add_dependency, - - &native_type, - 0, - - 0, - 0, - &evaluate_string, + 0, /* super */ + "string", /* name */ + sizeof(grib_expression_string), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* constructor */ + &destroy, /* destructor */ + &print, + &add_dependency, + + &native_type, + 0, + + 0, + 0, + &evaluate_string, }; grib_expression_class* grib_expression_class_string = &_grib_expression_class_string; @@ -82,38 +83,39 @@ static void init_class(grib_expression_class* c) } /* END_CLASS_IMP */ -static const char* evaluate_string(grib_expression* g,grib_handle *h,char* buf,size_t* size,int* err) +static const char* evaluate_string(grib_expression* g, grib_handle* h, char* buf, size_t* size, int* err) { - grib_expression_string* e = (grib_expression_string*)g; - *err=0; - return e->value; + grib_expression_string* e = (grib_expression_string*)g; + *err = 0; + return e->value; } -static void print(grib_context* c,grib_expression* g,grib_handle* f) +static void print(grib_context* c, grib_expression* g, grib_handle* f) { - grib_expression_string* e = (grib_expression_string*)g; - printf("string('%s')",e->value); + grib_expression_string* e = (grib_expression_string*)g; + printf("string('%s')", e->value); } -static void destroy(grib_context* c,grib_expression* g) +static void destroy(grib_context* c, grib_expression* g) { - grib_expression_string* e = (grib_expression_string*)g; - grib_context_free_persistent(c,e->value); + grib_expression_string* e = (grib_expression_string*)g; + grib_context_free_persistent(c, e->value); } -static void add_dependency(grib_expression* g, grib_accessor* observer){ - /* grib_expression_string* e = (grib_expression_string*)g; */ +static void add_dependency(grib_expression* g, grib_accessor* observer) +{ + /* grib_expression_string* e = (grib_expression_string*)g; */ } -grib_expression* new_string_expression(grib_context* c,const char* value) +grib_expression* new_string_expression(grib_context* c, const char* value) { - grib_expression_string* e = (grib_expression_string*)grib_context_malloc_clear_persistent(c,sizeof(grib_expression_string)); - e->base.cclass = grib_expression_class_string; - e->value = grib_context_strdup_persistent(c,value); - return (grib_expression*)e; + grib_expression_string* e = (grib_expression_string*)grib_context_malloc_clear_persistent(c, sizeof(grib_expression_string)); + e->base.cclass = grib_expression_class_string; + e->value = grib_context_strdup_persistent(c, value); + return (grib_expression*)e; } -static int native_type(grib_expression* g,grib_handle *h) +static int native_type(grib_expression* g, grib_handle* h) { - return GRIB_TYPE_STRING; + return GRIB_TYPE_STRING; } diff --git a/src/grib_expression_class_string_compare.c b/src/grib_expression_class_string_compare.c index ee123b387..0199b3394 100644 --- a/src/grib_expression_class_string_compare.c +++ b/src/grib_expression_class_string_compare.c @@ -39,43 +39,44 @@ or edit "expression.class" and rerun ./make_class.pl typedef const char* string; /* to keep make_class.pl happy */ -static void init_class (grib_expression_class*); +static void init_class(grib_expression_class*); -static void destroy(grib_context*,grib_expression* e); +static void destroy(grib_context*, grib_expression* e); -static void print(grib_context*,grib_expression*,grib_handle*); -static void add_dependency(grib_expression* e, grib_accessor* observer); +static void print(grib_context*, grib_expression*, grib_handle*); +static void add_dependency(grib_expression* e, grib_accessor* observer); -static int native_type(grib_expression*,grib_handle*); +static int native_type(grib_expression*, grib_handle*); -static int evaluate_long(grib_expression*,grib_handle*,long*); -static int evaluate_double(grib_expression*,grib_handle*,double*); +static int evaluate_long(grib_expression*, grib_handle*, long*); +static int evaluate_double(grib_expression*, grib_handle*, double*); -typedef struct grib_expression_string_compare{ - grib_expression base; -/* Members defined in string_compare */ - grib_expression *left; - grib_expression *right; +typedef struct grib_expression_string_compare +{ + grib_expression base; + /* Members defined in string_compare */ + grib_expression* left; + grib_expression* right; } grib_expression_string_compare; static grib_expression_class _grib_expression_class_string_compare = { - 0, /* super */ - "string_compare", /* name */ - sizeof(grib_expression_string_compare),/* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* constructor */ - &destroy, /* destructor */ - &print, - &add_dependency, - - &native_type, - 0, - - &evaluate_long, - &evaluate_double, - 0, + 0, /* super */ + "string_compare", /* name */ + sizeof(grib_expression_string_compare), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* constructor */ + &destroy, /* destructor */ + &print, + &add_dependency, + + &native_type, + 0, + + &evaluate_long, + &evaluate_double, + 0, }; grib_expression_class* grib_expression_class_string_compare = &_grib_expression_class_string_compare; @@ -88,76 +89,88 @@ static void init_class(grib_expression_class* c) /* Note: A fast cut-down version of strcmp which does NOT return -1 */ /* 0 means input strings are equal and 1 means not equal */ -GRIB_INLINE static int grib_inline_strcmp(const char* a,const char* b) +GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b) { - if (*a != *b) return 1; - while((*a!=0 && *b!=0) && *(a) == *(b) ) {a++;b++;} - return (*a==0 && *b==0) ? 0 : 1; + if (*a != *b) + return 1; + while ((*a != 0 && *b != 0) && *(a) == *(b)) { + a++; + b++; + } + return (*a == 0 && *b == 0) ? 0 : 1; } -static int evaluate_long(grib_expression *g,grib_handle* h,long* lres) +static int evaluate_long(grib_expression* g, grib_handle* h, long* lres) { - int ret=0; - char b1[1024]; size_t l1 = sizeof(b1); - char b2[1024]; size_t l2 = sizeof(b2); - const char *v1; - const char *v2; + int ret = 0; + char b1[1024]; + size_t l1 = sizeof(b1); + char b2[1024]; + size_t l2 = sizeof(b2); + const char* v1; + const char* v2; grib_expression_string_compare* e = (grib_expression_string_compare*)g; - v1 = grib_expression_evaluate_string(h,e->left,b1,&l1,&ret); - if(!v1) {*lres=0;return ret;} + v1 = grib_expression_evaluate_string(h, e->left, b1, &l1, &ret); + if (!v1) { + *lres = 0; + return ret; + } - v2 = grib_expression_evaluate_string(h,e->right,b2,&l2,&ret); - if(!v2) {*lres=0;return ret;} + v2 = grib_expression_evaluate_string(h, e->right, b2, &l2, &ret); + if (!v2) { + *lres = 0; + return ret; + } - *lres = (grib_inline_strcmp(v1,v2) == 0); + *lres = (grib_inline_strcmp(v1, v2) == 0); return GRIB_SUCCESS; } -static int evaluate_double(grib_expression *g,grib_handle* h,double* dres) +static int evaluate_double(grib_expression* g, grib_handle* h, double* dres) { long n; - int ret = evaluate_long(g,h,&n); - *dres = n; + int ret = evaluate_long(g, h, &n); + *dres = n; return ret; } -static void print(grib_context* c,grib_expression* g,grib_handle* f) +static void print(grib_context* c, grib_expression* g, grib_handle* f) { grib_expression_string_compare* e = (grib_expression_string_compare*)g; printf("string_compare("); - grib_expression_print(c,e->left,f); + grib_expression_print(c, e->left, f); printf(","); - grib_expression_print(c,e->right,f); + grib_expression_print(c, e->right, f); printf(")"); } -static void destroy(grib_context* c,grib_expression* g) +static void destroy(grib_context* c, grib_expression* g) { grib_expression_string_compare* e = (grib_expression_string_compare*)g; - grib_expression_free(c,e->left); - grib_expression_free(c,e->right); + grib_expression_free(c, e->left); + grib_expression_free(c, e->right); } -static void add_dependency(grib_expression* g, grib_accessor* observer) +static void add_dependency(grib_expression* g, grib_accessor* observer) { grib_expression_string_compare* e = (grib_expression_string_compare*)g; - grib_dependency_observe_expression(observer,e->left); - grib_dependency_observe_expression(observer,e->right); + grib_dependency_observe_expression(observer, e->left); + grib_dependency_observe_expression(observer, e->right); } grib_expression* new_string_compare_expression(grib_context* c, - grib_expression* left,grib_expression* right) + grib_expression* left, grib_expression* right) { - grib_expression_string_compare* e = (grib_expression_string_compare*)grib_context_malloc_clear_persistent(c,sizeof(grib_expression_string_compare)); - e->base.cclass = grib_expression_class_string_compare; - e->left = left; - e->right = right; + grib_expression_string_compare* e = (grib_expression_string_compare*)grib_context_malloc_clear_persistent(c, sizeof(grib_expression_string_compare)); + e->base.cclass = grib_expression_class_string_compare; + e->left = left; + e->right = right; return (grib_expression*)e; } -static int native_type(grib_expression* g,grib_handle *h) +static int native_type(grib_expression* g, grib_handle* h) { - return GRIB_TYPE_LONG ; + return GRIB_TYPE_LONG; } diff --git a/src/grib_expression_class_sub_string.c b/src/grib_expression_class_sub_string.c index 13e201b7f..60e0d03ab 100644 --- a/src/grib_expression_class_sub_string.c +++ b/src/grib_expression_class_sub_string.c @@ -37,41 +37,42 @@ or edit "expression.class" and rerun ./make_class.pl typedef const char* string; /* to keep make_class.pl happy */ -static void init_class (grib_expression_class*); +static void init_class(grib_expression_class*); -static void destroy(grib_context*,grib_expression* e); +static void destroy(grib_context*, grib_expression* e); -static void print(grib_context*,grib_expression*,grib_handle*); -static void add_dependency(grib_expression* e, grib_accessor* observer); +static void print(grib_context*, grib_expression*, grib_handle*); +static void add_dependency(grib_expression* e, grib_accessor* observer); -static int native_type(grib_expression*,grib_handle*); +static int native_type(grib_expression*, grib_handle*); -static string evaluate_string(grib_expression*,grib_handle*,char*,size_t*,int*); +static string evaluate_string(grib_expression*, grib_handle*, char*, size_t*, int*); -typedef struct grib_expression_sub_string{ - grib_expression base; -/* Members defined in sub_string */ - char* value; +typedef struct grib_expression_sub_string +{ + grib_expression base; + /* Members defined in sub_string */ + char* value; } grib_expression_sub_string; static grib_expression_class _grib_expression_class_sub_string = { - 0, /* super */ - "sub_string", /* name */ - sizeof(grib_expression_sub_string),/* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* constructor */ - &destroy, /* destructor */ - &print, - &add_dependency, - - &native_type, - 0, - - 0, - 0, - &evaluate_string, + 0, /* super */ + "sub_string", /* name */ + sizeof(grib_expression_sub_string), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* constructor */ + &destroy, /* destructor */ + &print, + &add_dependency, + + &native_type, + 0, + + 0, + 0, + &evaluate_string, }; grib_expression_class* grib_expression_class_sub_string = &_grib_expression_class_sub_string; @@ -82,45 +83,44 @@ static void init_class(grib_expression_class* c) } /* END_CLASS_IMP */ -static const char* evaluate_string(grib_expression* g,grib_handle *h,char* buf,size_t* size,int* err) +static const char* evaluate_string(grib_expression* g, grib_handle* h, char* buf, size_t* size, int* err) { - grib_expression_sub_string* e = (grib_expression_sub_string*)g; - *err=0; - return e->value; + grib_expression_sub_string* e = (grib_expression_sub_string*)g; + *err = 0; + return e->value; } -static void print(grib_context* c,grib_expression* g,grib_handle* f) +static void print(grib_context* c, grib_expression* g, grib_handle* f) { - grib_expression_sub_string* e = (grib_expression_sub_string*)g; - printf("string('%s')",e->value); + grib_expression_sub_string* e = (grib_expression_sub_string*)g; + printf("string('%s')", e->value); } -static void destroy(grib_context* c,grib_expression* g) +static void destroy(grib_context* c, grib_expression* g) { - grib_expression_sub_string* e = (grib_expression_sub_string*)g; - grib_context_free_persistent(c,e->value); + grib_expression_sub_string* e = (grib_expression_sub_string*)g; + grib_context_free_persistent(c, e->value); } - -static void add_dependency(grib_expression* g, grib_accessor* observer){ - /* grib_expression_sub_string* e = (grib_expression_sub_string*)g; */ +static void add_dependency(grib_expression* g, grib_accessor* observer) +{ + /* grib_expression_sub_string* e = (grib_expression_sub_string*)g; */ } - -grib_expression* new_sub_string_expression(grib_context* c,const char* value,size_t start,size_t length) +grib_expression* new_sub_string_expression(grib_context* c, const char* value, size_t start, size_t length) { - char v[1024]={0,}; - grib_expression_sub_string* e = (grib_expression_sub_string*)grib_context_malloc_clear_persistent(c,sizeof(grib_expression_sub_string)); + char v[1024] = {0,}; + grib_expression_sub_string* e = (grib_expression_sub_string*)grib_context_malloc_clear_persistent(c, sizeof(grib_expression_sub_string)); -/* if (start<0) start+=strlen(value); */ + /* if (start<0) start+=strlen(value); */ - memcpy(v,value+start,length); - e->base.cclass = grib_expression_class_sub_string; - e->value = grib_context_strdup_persistent(c,v); - return (grib_expression*)e; + memcpy(v, value + start, length); + e->base.cclass = grib_expression_class_sub_string; + e->value = grib_context_strdup_persistent(c, v); + return (grib_expression*)e; } -static int native_type(grib_expression* g,grib_handle *h) +static int native_type(grib_expression* g, grib_handle* h) { - return GRIB_TYPE_STRING; + return GRIB_TYPE_STRING; } diff --git a/src/grib_expression_class_true.c b/src/grib_expression_class_true.c index bde3869cc..9bd79e4fd 100644 --- a/src/grib_expression_class_true.c +++ b/src/grib_expression_class_true.c @@ -37,41 +37,42 @@ or edit "expression.class" and rerun ./make_class.pl typedef const char* string; /* to keep make_class.pl happy */ -static void init_class (grib_expression_class*); +static void init_class(grib_expression_class*); -static void destroy(grib_context*,grib_expression* e); +static void destroy(grib_context*, grib_expression* e); -static void print(grib_context*,grib_expression*,grib_handle*); -static void add_dependency(grib_expression* e, grib_accessor* observer); +static void print(grib_context*, grib_expression*, grib_handle*); +static void add_dependency(grib_expression* e, grib_accessor* observer); -static int native_type(grib_expression*,grib_handle*); +static int native_type(grib_expression*, grib_handle*); -static int evaluate_long(grib_expression*,grib_handle*,long*); -static int evaluate_double(grib_expression*,grib_handle*,double*); +static int evaluate_long(grib_expression*, grib_handle*, long*); +static int evaluate_double(grib_expression*, grib_handle*, double*); -typedef struct grib_expression_true{ - grib_expression base; -/* Members defined in true */ +typedef struct grib_expression_true +{ + grib_expression base; + /* Members defined in true */ } grib_expression_true; static grib_expression_class _grib_expression_class_true = { - 0, /* super */ - "true", /* name */ - sizeof(grib_expression_true),/* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* constructor */ - &destroy, /* destructor */ - &print, - &add_dependency, - - &native_type, - 0, - - &evaluate_long, - &evaluate_double, - 0, + 0, /* super */ + "true", /* name */ + sizeof(grib_expression_true), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* constructor */ + &destroy, /* destructor */ + &print, + &add_dependency, + + &native_type, + 0, + + &evaluate_long, + &evaluate_double, + 0, }; grib_expression_class* grib_expression_class_true = &_grib_expression_class_true; @@ -82,43 +83,42 @@ static void init_class(grib_expression_class* c) } /* END_CLASS_IMP */ -static int evaluate_long(grib_expression* g,grib_handle* h,long* lres) +static int evaluate_long(grib_expression* g, grib_handle* h, long* lres) { - *lres=1; - return GRIB_SUCCESS; + *lres = 1; + return GRIB_SUCCESS; } -static int evaluate_double(grib_expression* g,grib_handle* h,double* dres) +static int evaluate_double(grib_expression* g, grib_handle* h, double* dres) { - *dres = 1; - return GRIB_SUCCESS; - + *dres = 1; + return GRIB_SUCCESS; } -static void print(grib_context* c,grib_expression* g,grib_handle* f) +static void print(grib_context* c, grib_expression* g, grib_handle* f) { - printf("true("); - printf(")"); + printf("true("); + printf(")"); } -static void destroy(grib_context* c,grib_expression* g) +static void destroy(grib_context* c, grib_expression* g) { } -static void add_dependency(grib_expression* g, grib_accessor* observer){ +static void add_dependency(grib_expression* g, grib_accessor* observer) +{ } grib_expression* new_true_expression(grib_context* c) { - grib_expression_true* e = (grib_expression_true*)grib_context_malloc_clear_persistent(c,sizeof(grib_expression_true)); - e->base.cclass = grib_expression_class_true; - return (grib_expression*)e; + grib_expression_true* e = (grib_expression_true*)grib_context_malloc_clear_persistent(c, sizeof(grib_expression_true)); + e->base.cclass = grib_expression_class_true; + return (grib_expression*)e; } -static int native_type(grib_expression* g,grib_handle *h) +static int native_type(grib_expression* g, grib_handle* h) { - return GRIB_TYPE_LONG; + return GRIB_TYPE_LONG; } - diff --git a/src/grib_expression_class_unop.c b/src/grib_expression_class_unop.c index d3c19af8a..b02812dc6 100644 --- a/src/grib_expression_class_unop.c +++ b/src/grib_expression_class_unop.c @@ -40,44 +40,45 @@ or edit "expression.class" and rerun ./make_class.pl typedef const char* string; /* to keep make_class.pl happy */ -static void init_class (grib_expression_class*); +static void init_class(grib_expression_class*); -static void destroy(grib_context*,grib_expression* e); +static void destroy(grib_context*, grib_expression* e); -static void print(grib_context*,grib_expression*,grib_handle*); -static void add_dependency(grib_expression* e, grib_accessor* observer); +static void print(grib_context*, grib_expression*, grib_handle*); +static void add_dependency(grib_expression* e, grib_accessor* observer); -static int native_type(grib_expression*,grib_handle*); +static int native_type(grib_expression*, grib_handle*); -static int evaluate_long(grib_expression*,grib_handle*,long*); -static int evaluate_double(grib_expression*,grib_handle*,double*); +static int evaluate_long(grib_expression*, grib_handle*, long*); +static int evaluate_double(grib_expression*, grib_handle*, double*); -typedef struct grib_expression_unop{ - grib_expression base; -/* Members defined in unop */ - grib_expression *exp; - grib_unop_long_proc long_func; - grib_unop_double_proc double_func; +typedef struct grib_expression_unop +{ + grib_expression base; + /* Members defined in unop */ + grib_expression* exp; + grib_unop_long_proc long_func; + grib_unop_double_proc double_func; } grib_expression_unop; static grib_expression_class _grib_expression_class_unop = { - 0, /* super */ - "unop", /* name */ - sizeof(grib_expression_unop),/* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - 0, /* constructor */ - &destroy, /* destructor */ - &print, - &add_dependency, - - &native_type, - 0, - - &evaluate_long, - &evaluate_double, - 0, + 0, /* super */ + "unop", /* name */ + sizeof(grib_expression_unop), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + 0, /* constructor */ + &destroy, /* destructor */ + &print, + &add_dependency, + + &native_type, + 0, + + &evaluate_long, + &evaluate_double, + 0, }; grib_expression_class* grib_expression_class_unop = &_grib_expression_class_unop; @@ -88,63 +89,65 @@ static void init_class(grib_expression_class* c) } /* END_CLASS_IMP */ -static int evaluate_long(grib_expression* g,grib_handle* h,long* lres) +static int evaluate_long(grib_expression* g, grib_handle* h, long* lres) { int ret; - long v=0; + long v = 0; grib_expression_unop* e = (grib_expression_unop*)g; - ret = grib_expression_evaluate_long(h,e->exp,&v); - if (ret != GRIB_SUCCESS) return ret; - *lres=e->long_func(v); + ret = grib_expression_evaluate_long(h, e->exp, &v); + if (ret != GRIB_SUCCESS) + return ret; + *lres = e->long_func(v); return GRIB_SUCCESS; } -static int evaluate_double(grib_expression* g,grib_handle* h,double* dres) +static int evaluate_double(grib_expression* g, grib_handle* h, double* dres) { int ret; - double v=0; + double v = 0; grib_expression_unop* e = (grib_expression_unop*)g; - ret = grib_expression_evaluate_double(h,e->exp,&v); - if (ret != GRIB_SUCCESS) return ret; - *dres = e->double_func ? e->double_func(v) : e->long_func(v); + ret = grib_expression_evaluate_double(h, e->exp, &v); + if (ret != GRIB_SUCCESS) + return ret; + *dres = e->double_func ? e->double_func(v) : e->long_func(v); return GRIB_SUCCESS; - } -static void print(grib_context* c,grib_expression* g,grib_handle* f) +static void print(grib_context* c, grib_expression* g, grib_handle* f) { grib_expression_unop* e = (grib_expression_unop*)g; printf("unop("); - grib_expression_print(c,e->exp,f); + grib_expression_print(c, e->exp, f); printf(")"); } -static void destroy(grib_context* c,grib_expression* g) +static void destroy(grib_context* c, grib_expression* g) { grib_expression_unop* e = (grib_expression_unop*)g; - grib_expression_free(c,e->exp); + grib_expression_free(c, e->exp); } -static void add_dependency(grib_expression* g, grib_accessor* observer){ +static void add_dependency(grib_expression* g, grib_accessor* observer) +{ grib_expression_unop* e = (grib_expression_unop*)g; - grib_dependency_observe_expression(observer,e->exp); + grib_dependency_observe_expression(observer, e->exp); } grib_expression* new_unop_expression(grib_context* c, - grib_unop_long_proc long_func, - grib_unop_double_proc double_func, - grib_expression* exp) + grib_unop_long_proc long_func, + grib_unop_double_proc double_func, + grib_expression* exp) { - grib_expression_unop* e = (grib_expression_unop*)grib_context_malloc_clear_persistent(c,sizeof(grib_expression_unop)); - e->base.cclass = grib_expression_class_unop; - e->exp = exp; - e->long_func = long_func; - e->double_func = double_func; + grib_expression_unop* e = (grib_expression_unop*)grib_context_malloc_clear_persistent(c, sizeof(grib_expression_unop)); + e->base.cclass = grib_expression_class_unop; + e->exp = exp; + e->long_func = long_func; + e->double_func = double_func; return (grib_expression*)e; } -static int native_type(grib_expression* g,grib_handle *h) +static int native_type(grib_expression* g, grib_handle* h) { grib_expression_unop* e = (grib_expression_unop*)g; return e->long_func ? GRIB_TYPE_LONG : GRIB_TYPE_DOUBLE; diff --git a/src/grib_fieldset.c b/src/grib_fieldset.c index 85fbfe3b3..e99acb7d7 100644 --- a/src/grib_fieldset.c +++ b/src/grib_fieldset.c @@ -17,449 +17,487 @@ #define GRIB_START_ARRAY_SIZE 5000 #define GRIB_ARRAY_INCREMENT 1000 -#define SWAP(a,b) temp=(a);(a)=(b);(b)=temp; +#define SWAP(a, b) \ + temp = (a); \ + (a) = (b); \ + (b) = temp; -#define GRIB_ORDER_BY_ASC 1 -#define GRIB_ORDER_BY_DESC -1 +#define GRIB_ORDER_BY_ASC 1 +#define GRIB_ORDER_BY_DESC -1 /* Note: A fast cut-down version of strcmp which does NOT return -1 */ /* 0 means input strings are equal and 1 means not equal */ -GRIB_INLINE static int grib_inline_strcmp(const char* a,const char* b) { - if (*a != *b) return 1; - while((*a!=0 && *b!=0) && *(a) == *(b) ) {a++;b++;} - return (*a==0 && *b==0) ? 0 : 1; +GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b) +{ + if (*a != *b) + return 1; + while ((*a != 0 && *b != 0) && *(a) == *(b)) { + a++; + b++; + } + return (*a == 0 && *b == 0) ? 0 : 1; } -static grib_fieldset* grib_fieldset_create_from_keys(grib_context* c,char** keys,int nkeys,int* err); -static grib_fieldset* grib_fieldset_create_from_order_by(grib_context* c,grib_order_by* ob, - int* err); -static int grib_fieldset_resize(grib_fieldset* set,size_t newsize); +static grib_fieldset* grib_fieldset_create_from_keys(grib_context* c, char** keys, int nkeys, int* err); +static grib_fieldset* grib_fieldset_create_from_order_by(grib_context* c, grib_order_by* ob, + int* err); +static int grib_fieldset_resize(grib_fieldset* set, size_t newsize); static void grib_trim(char** x); static grib_order_by* grib_fieldset_new_order_by(grib_context* c, const char* z); -static int grib_fieldset_compare(grib_fieldset* set,int* i,int* j); +static int grib_fieldset_compare(grib_fieldset* set, int* i, int* j); static void grib_fieldset_sort(grib_fieldset* set, int beg, int theEnd); -static int grib_fieldset_columns_resize(grib_fieldset* set,size_t newsize); -static grib_int_array* grib_fieldset_create_int_array(grib_context* c,size_t size); -static int grib_fieldset_resize_int_array(grib_int_array* a,size_t newsize); +static int grib_fieldset_columns_resize(grib_fieldset* set, size_t newsize); +static grib_int_array* grib_fieldset_create_int_array(grib_context* c, size_t size); +static int grib_fieldset_resize_int_array(grib_int_array* a, size_t newsize); static void grib_fieldset_delete_int_array(grib_int_array* f); static void grib_fieldset_delete_columns(grib_fieldset* set); -static grib_field** grib_fieldset_create_fields(grib_context* c,size_t size); +static grib_field** grib_fieldset_create_fields(grib_context* c, size_t size); static void grib_fieldset_delete_fields(grib_fieldset* set); -static int grib_fieldset_resize_fields(grib_fieldset* set,size_t newsize); -static int grib_fieldset_set_order_by(grib_fieldset* set,grib_order_by* ob); +static int grib_fieldset_resize_fields(grib_fieldset* set, size_t newsize); +static int grib_fieldset_set_order_by(grib_fieldset* set, grib_order_by* ob); /* --------------- grib_column functions ------------------*/ -int grib_fieldset_new_column(grib_fieldset* set,int id,char* key,int type) +int grib_fieldset_new_column(grib_fieldset* set, int id, char* key, int type) { - grib_column* column=0; + grib_column* column = 0; grib_context* c; - int err=0; + int err = 0; - if (!set) return GRIB_INVALID_ARGUMENT; + if (!set) + return GRIB_INVALID_ARGUMENT; - c=set->context; + c = set->context; - set->columns[id].errors=(int*)grib_context_malloc_clear(c, - sizeof(int)*GRIB_START_ARRAY_SIZE); + set->columns[id].errors = (int*)grib_context_malloc_clear(c, + sizeof(int) * GRIB_START_ARRAY_SIZE); switch (type) { - case GRIB_TYPE_LONG: - set->columns[id].long_values=(long*)grib_context_malloc_clear(c, - sizeof(long)*GRIB_START_ARRAY_SIZE); - if (!set->columns[id].long_values) { - grib_context_log(c, GRIB_LOG_ERROR, - "grib_fieldset_new_column : Cannot malloc %d bytes", - sizeof(long)*GRIB_START_ARRAY_SIZE); - err=GRIB_OUT_OF_MEMORY; - return err; - } - break; - case GRIB_TYPE_DOUBLE: - set->columns[id].double_values=(double*)grib_context_malloc_clear(c, - sizeof(double)*GRIB_START_ARRAY_SIZE); - if (!set->columns[id].double_values) { - grib_context_log(c, GRIB_LOG_ERROR, - "grib_fieldset_new_column : Cannot malloc %d bytes", - sizeof(double)*GRIB_START_ARRAY_SIZE); - err=GRIB_OUT_OF_MEMORY; - return err; - } - break; - case GRIB_TYPE_STRING: - set->columns[id].string_values=(char**)grib_context_malloc_clear(c, - sizeof(char*)*GRIB_START_ARRAY_SIZE); - if (!set->columns[id].string_values) { + case GRIB_TYPE_LONG: + set->columns[id].long_values = (long*)grib_context_malloc_clear(c, + sizeof(long) * GRIB_START_ARRAY_SIZE); + if (!set->columns[id].long_values) { + grib_context_log(c, GRIB_LOG_ERROR, + "grib_fieldset_new_column : Cannot malloc %d bytes", + sizeof(long) * GRIB_START_ARRAY_SIZE); + err = GRIB_OUT_OF_MEMORY; + return err; + } + break; + case GRIB_TYPE_DOUBLE: + set->columns[id].double_values = (double*)grib_context_malloc_clear(c, + sizeof(double) * GRIB_START_ARRAY_SIZE); + if (!set->columns[id].double_values) { + grib_context_log(c, GRIB_LOG_ERROR, + "grib_fieldset_new_column : Cannot malloc %d bytes", + sizeof(double) * GRIB_START_ARRAY_SIZE); + err = GRIB_OUT_OF_MEMORY; + return err; + } + break; + case GRIB_TYPE_STRING: + set->columns[id].string_values = (char**)grib_context_malloc_clear(c, + sizeof(char*) * GRIB_START_ARRAY_SIZE); + if (!set->columns[id].string_values) { + grib_context_log(c, GRIB_LOG_ERROR, + "grib_fieldset_new_column : Cannot malloc %d bytes", + sizeof(char*) * GRIB_START_ARRAY_SIZE); + err = GRIB_OUT_OF_MEMORY; + return err; + } + break; + default: grib_context_log(c, GRIB_LOG_ERROR, - "grib_fieldset_new_column : Cannot malloc %d bytes", - sizeof(char*)*GRIB_START_ARRAY_SIZE); - err=GRIB_OUT_OF_MEMORY; + "grib_fieldset_new_column : unknown column type %d", type); + grib_context_free(c, column); return err; - } - break; - default: - grib_context_log(c, GRIB_LOG_ERROR, - "grib_fieldset_new_column : unknown column type %d",type); - grib_context_free(c,column); - return err; } - set->columns[id].context=c; - set->columns[id].name=grib_context_strdup(c,key); - set->columns[id].type=type; - set->columns[id].values_array_size=GRIB_START_ARRAY_SIZE; - set->columns[id].size=0; + set->columns[id].context = c; + set->columns[id].name = grib_context_strdup(c, key); + set->columns[id].type = type; + set->columns[id].values_array_size = GRIB_START_ARRAY_SIZE; + set->columns[id].size = 0; return err; } static void grib_fieldset_delete_columns(grib_fieldset* set) { - int i=0; + int i = 0; grib_context* c; - if (!set) return; - c=set->context; + if (!set) + return; + c = set->context; - for (i=0;icolumns_size;i++) { - int j=0; + for (i = 0; i < set->columns_size; i++) { + int j = 0; switch (set->columns[i].type) { - case GRIB_TYPE_LONG: - grib_context_free(c,set->columns[i].long_values); - break; - case GRIB_TYPE_DOUBLE: - grib_context_free(c,set->columns[i].double_values); - break; - case GRIB_TYPE_STRING: - for (j=0;jcolumns[i].size;j++) - grib_context_free(c,set->columns[i].string_values[j]); - break; - default: - grib_context_log(c, GRIB_LOG_ERROR, - "grib_fieldset_new_column : unknown column type %d",set->columns[i].type); + case GRIB_TYPE_LONG: + grib_context_free(c, set->columns[i].long_values); + break; + case GRIB_TYPE_DOUBLE: + grib_context_free(c, set->columns[i].double_values); + break; + case GRIB_TYPE_STRING: + for (j = 0; j < set->columns[i].size; j++) + grib_context_free(c, set->columns[i].string_values[j]); + break; + default: + grib_context_log(c, GRIB_LOG_ERROR, + "grib_fieldset_new_column : unknown column type %d", set->columns[i].type); } - grib_context_free(c,set->columns[i].errors); - grib_context_free(c,set->columns[i].name); + grib_context_free(c, set->columns[i].errors); + grib_context_free(c, set->columns[i].name); } - grib_context_free(c,set->columns); + grib_context_free(c, set->columns); } -static int grib_fieldset_columns_resize(grib_fieldset* set,size_t newsize) +static int grib_fieldset_columns_resize(grib_fieldset* set, size_t newsize) { double* newdoubles; long* newlongs; char** newstrings; int* newerrors; - int i=0; + int i = 0; grib_context* c; - if (!set || !set->columns) return GRIB_INVALID_ARGUMENT; - - c=set->context; + if (!set || !set->columns) + return GRIB_INVALID_ARGUMENT; - if (newsize <= set->columns[0].values_array_size) return 0; + c = set->context; - for (i=0;icolumns_size;i++) { + if (newsize <= set->columns[0].values_array_size) + return 0; + for (i = 0; i < set->columns_size; i++) { switch (set->columns[i].type) { - case GRIB_TYPE_LONG: - newlongs=(long*)grib_context_realloc(c,set->columns[i].long_values, - newsize*sizeof(long)); - if (!newlongs ) { - grib_context_log(c, GRIB_LOG_ERROR, - "grib_fieldset_columns_resize : Cannot malloc %d bytes",newsize-set->columns[i].values_array_size); - return GRIB_OUT_OF_MEMORY; - } else set->columns[i].long_values=newlongs; - break; - case GRIB_TYPE_DOUBLE: - newdoubles=(double*)grib_context_realloc(c,set->columns[i].double_values, - newsize*sizeof(double)); - if (!newdoubles) { - grib_context_log(c, GRIB_LOG_ERROR, - "grib_fieldset_columns_resize : Cannot malloc %d bytes",newsize-set->columns[i].values_array_size); - return GRIB_OUT_OF_MEMORY; - } else set->columns[i].double_values=newdoubles; - break; - case GRIB_TYPE_STRING: - newstrings=(char**)grib_context_realloc(c,set->columns[i].string_values, - newsize*sizeof(char*)); - if (!newstrings) { - grib_context_log(c, GRIB_LOG_ERROR, - "grib_fieldset_columns_resize : Cannot malloc %d bytes",newsize-set->columns[i].values_array_size); - return GRIB_OUT_OF_MEMORY; - } else set->columns[i].string_values=newstrings; - break; + case GRIB_TYPE_LONG: + newlongs = (long*)grib_context_realloc(c, set->columns[i].long_values, + newsize * sizeof(long)); + if (!newlongs) { + grib_context_log(c, GRIB_LOG_ERROR, + "grib_fieldset_columns_resize : Cannot malloc %d bytes", newsize - set->columns[i].values_array_size); + return GRIB_OUT_OF_MEMORY; + } + else + set->columns[i].long_values = newlongs; + break; + case GRIB_TYPE_DOUBLE: + newdoubles = (double*)grib_context_realloc(c, set->columns[i].double_values, + newsize * sizeof(double)); + if (!newdoubles) { + grib_context_log(c, GRIB_LOG_ERROR, + "grib_fieldset_columns_resize : Cannot malloc %d bytes", newsize - set->columns[i].values_array_size); + return GRIB_OUT_OF_MEMORY; + } + else + set->columns[i].double_values = newdoubles; + break; + case GRIB_TYPE_STRING: + newstrings = (char**)grib_context_realloc(c, set->columns[i].string_values, + newsize * sizeof(char*)); + if (!newstrings) { + grib_context_log(c, GRIB_LOG_ERROR, + "grib_fieldset_columns_resize : Cannot malloc %d bytes", newsize - set->columns[i].values_array_size); + return GRIB_OUT_OF_MEMORY; + } + else + set->columns[i].string_values = newstrings; + break; } - newerrors=(int*)grib_context_realloc(c,set->columns[i].errors,newsize*sizeof(int)); + newerrors = (int*)grib_context_realloc(c, set->columns[i].errors, newsize * sizeof(int)); if (!newerrors) { grib_context_log(c, GRIB_LOG_ERROR, - "grib_fieldset_columns_resize : Cannot malloc %d bytes", - set->columns[i].errors,newsize*sizeof(int)); + "grib_fieldset_columns_resize : Cannot malloc %d bytes", + set->columns[i].errors, newsize * sizeof(int)); return GRIB_OUT_OF_MEMORY; - } else set->columns[i].errors=newerrors; - - set->columns[i].values_array_size=newsize; + } + else + set->columns[i].errors = newerrors; + set->columns[i].values_array_size = newsize; } return GRIB_SUCCESS; } -int grib_fieldset_column_copy_from_handle(grib_handle* h,grib_fieldset* set,int i) +int grib_fieldset_column_copy_from_handle(grib_handle* h, grib_fieldset* set, int i) { - int err=0; - long lval=0; - double dval=0; + int err = 0; + long lval = 0; + double dval = 0; char sval[1024]; - size_t slen=1024; + size_t slen = 1024; if (!set || !h || set->columns[i].type == 0) return GRIB_INVALID_ARGUMENT; if (set->columns[i].size >= set->columns[i].values_array_size) - grib_fieldset_columns_resize(set,set->columns[i].values_array_size+GRIB_ARRAY_INCREMENT); + grib_fieldset_columns_resize(set, set->columns[i].values_array_size + GRIB_ARRAY_INCREMENT); switch (set->columns[i].type) { - case GRIB_TYPE_LONG: - err=grib_get_long(h,set->columns[i].name,&lval); - set->columns[i].long_values[set->columns[i].size]=lval; - break; - case GRIB_TYPE_DOUBLE: - err=grib_get_double(h,set->columns[i].name,&dval); - set->columns[i].double_values[set->columns[i].size]=dval; - break; - case GRIB_TYPE_STRING: - err=grib_get_string(h,set->columns[i].name,sval,&slen); - set->columns[i].string_values[set->columns[i].size]=grib_context_strdup(h->context,sval); - break; - } - - set->columns[i].errors[set->columns[i].size]=err; + case GRIB_TYPE_LONG: + err = grib_get_long(h, set->columns[i].name, &lval); + set->columns[i].long_values[set->columns[i].size] = lval; + break; + case GRIB_TYPE_DOUBLE: + err = grib_get_double(h, set->columns[i].name, &dval); + set->columns[i].double_values[set->columns[i].size] = dval; + break; + case GRIB_TYPE_STRING: + err = grib_get_string(h, set->columns[i].name, sval, &slen); + set->columns[i].string_values[set->columns[i].size] = grib_context_strdup(h->context, sval); + break; + } + + set->columns[i].errors[set->columns[i].size] = err; set->columns[i].size++; return err; } /* --------------- grib_fieldset functions ------------------*/ -grib_fieldset* grib_fieldset_new_from_files(grib_context* c,char* filenames[], - int nfiles, char** keys, int nkeys, - const char* where_string, const char* order_by_string, int* err) +grib_fieldset* grib_fieldset_new_from_files(grib_context* c, char* filenames[], + int nfiles, char** keys, int nkeys, + const char* where_string, const char* order_by_string, int* err) { - int i=0; - int ret=GRIB_SUCCESS; - grib_order_by* ob=NULL; + int i = 0; + int ret = GRIB_SUCCESS; + grib_order_by* ob = NULL; - grib_fieldset* set=0; + grib_fieldset* set = 0; - if (!c) c=grib_context_get_default( ); + if (!c) + c = grib_context_get_default(); - if (( (!keys || nkeys==0) && !order_by_string ) - || !filenames ) { - *err=GRIB_INVALID_ARGUMENT; + if (((!keys || nkeys == 0) && !order_by_string) || !filenames) { + *err = GRIB_INVALID_ARGUMENT; return NULL; } if (order_by_string) { - ob=grib_fieldset_new_order_by(c,order_by_string); + ob = grib_fieldset_new_order_by(c, order_by_string); if (!ob) { - *err=GRIB_INVALID_ORDERBY; + *err = GRIB_INVALID_ORDERBY; return NULL; } } - if ( !keys || nkeys==0 ) { - set=grib_fieldset_create_from_order_by(c,ob,err); - } else { - set=grib_fieldset_create_from_keys(c,keys,nkeys,err); + if (!keys || nkeys == 0) { + set = grib_fieldset_create_from_order_by(c, ob, err); + } + else { + set = grib_fieldset_create_from_keys(c, keys, nkeys, err); } - *err=GRIB_SUCCESS; - for (i=0;iorder_by && ob) *err=grib_fieldset_set_order_by(set,ob); - if (*err!=GRIB_SUCCESS) return NULL; - grib_fieldset_sort(set,0,set->size-1); + if (!set->order_by && ob) + *err = grib_fieldset_set_order_by(set, ob); + if (*err != GRIB_SUCCESS) + return NULL; + grib_fieldset_sort(set, 0, set->size - 1); grib_fieldset_rewind(set); } return set; } -static grib_fieldset* grib_fieldset_create_from_keys(grib_context* c,char** keys,int nkeys, - int* err) +static grib_fieldset* grib_fieldset_create_from_keys(grib_context* c, char** keys, int nkeys, + int* err) { - grib_fieldset* set=0; - size_t msize=0,size=0; - int i=0; - int type=0; - int default_type=GRIB_TYPE_STRING; + grib_fieldset* set = 0; + size_t msize = 0, size = 0; + int i = 0; + int type = 0; + int default_type = GRIB_TYPE_STRING; - if (!c) c=grib_context_get_default( ); + if (!c) + c = grib_context_get_default(); - size=GRIB_START_ARRAY_SIZE; + size = GRIB_START_ARRAY_SIZE; - msize=sizeof(grib_fieldset); - set=(grib_fieldset*)grib_context_malloc_clear(c,msize); + msize = sizeof(grib_fieldset); + set = (grib_fieldset*)grib_context_malloc_clear(c, msize); if (!set) { grib_context_log(c, GRIB_LOG_ERROR, - "grib_fieldset_create : Cannot malloc %d bytes",msize); + "grib_fieldset_create : Cannot malloc %d bytes", msize); return NULL; } - set->context=c; - set->fields_array_size=size; - set->size=0; - set->current=-1; - set->fields=0; - set->filter=0; - set->order=0; - set->columns=0; - set->where=0; - set->order_by=0; - - set->fields=grib_fieldset_create_fields(set->context,size); - - set->order=grib_fieldset_create_int_array(c,size); - set->filter=grib_fieldset_create_int_array(c,size); - for (i=0;ifilter->size;i++) - set->filter->el[i]=i; - - set->columns=(grib_column*)grib_context_malloc_clear(c,sizeof(grib_column)*nkeys); + set->context = c; + set->fields_array_size = size; + set->size = 0; + set->current = -1; + set->fields = 0; + set->filter = 0; + set->order = 0; + set->columns = 0; + set->where = 0; + set->order_by = 0; + + set->fields = grib_fieldset_create_fields(set->context, size); + + set->order = grib_fieldset_create_int_array(c, size); + set->filter = grib_fieldset_create_int_array(c, size); + for (i = 0; i < set->filter->size; i++) + set->filter->el[i] = i; + + set->columns = (grib_column*)grib_context_malloc_clear(c, sizeof(grib_column) * nkeys); if (!set->columns) { - grib_context_log(c,GRIB_LOG_ERROR,"grib_fieldset_new_query: memory allocation error"); - *err=GRIB_OUT_OF_MEMORY; + grib_context_log(c, GRIB_LOG_ERROR, "grib_fieldset_new_query: memory allocation error"); + *err = GRIB_OUT_OF_MEMORY; return NULL; } - for (i=0;icolumns_size=nkeys; + set->columns_size = nkeys; return set; } -static grib_fieldset* grib_fieldset_create_from_order_by(grib_context* c,grib_order_by* ob, - int* err) +static grib_fieldset* grib_fieldset_create_from_order_by(grib_context* c, grib_order_by* ob, + int* err) { - char** keys=NULL; - size_t nkeys=0; - int i=0; - grib_fieldset* set=NULL; - grib_order_by* next=ob; - - while(next) {nkeys++;next=next->next;} + char** keys = NULL; + size_t nkeys = 0; + int i = 0; + grib_fieldset* set = NULL; + grib_order_by* next = ob; + + while (next) { + nkeys++; + next = next->next; + } - keys=(char**)grib_context_malloc_clear( c,nkeys*sizeof(char*)); + keys = (char**)grib_context_malloc_clear(c, nkeys * sizeof(char*)); - next=ob; - i=0; - while(next) {keys[i++]=next->key;next=next->next;} + next = ob; + i = 0; + while (next) { + keys[i++] = next->key; + next = next->next; + } - set=grib_fieldset_create_from_keys(c,keys,nkeys,err); - grib_context_free(c,keys); + set = grib_fieldset_create_from_keys(c, keys, nkeys, err); + grib_context_free(c, keys); return set; } -int grib_fieldset_apply_where(grib_fieldset* set,const char* where_string) +int grib_fieldset_apply_where(grib_fieldset* set, const char* where_string) { - int err=GRIB_NOT_IMPLEMENTED; - grib_math* m=0; + int err = GRIB_NOT_IMPLEMENTED; + grib_math* m = 0; - if (!set) return GRIB_INVALID_ARGUMENT; + if (!set) + return GRIB_INVALID_ARGUMENT; - m=grib_math_new(set->context,where_string,&err); + m = grib_math_new(set->context, where_string, &err); print_math(m); printf("\n"); return err; } -int grib_fieldset_apply_order_by(grib_fieldset* set,const char* order_by_string) +int grib_fieldset_apply_order_by(grib_fieldset* set, const char* order_by_string) { - int err=0; - grib_order_by* ob=NULL; + int err = 0; + grib_order_by* ob = NULL; - if (!set) return GRIB_INVALID_ARGUMENT; + if (!set) + return GRIB_INVALID_ARGUMENT; if (set->order_by) { - grib_fieldset_delete_order_by(set->context,set->order_by); - set->order_by=0; + grib_fieldset_delete_order_by(set->context, set->order_by); + set->order_by = 0; } - ob=grib_fieldset_new_order_by(set->context, order_by_string); - if ((err=grib_fieldset_set_order_by(set,ob)) != GRIB_SUCCESS) + ob = grib_fieldset_new_order_by(set->context, order_by_string); + if ((err = grib_fieldset_set_order_by(set, ob)) != GRIB_SUCCESS) return err; - if (set->order_by) grib_fieldset_sort(set,0,set->size-1); + if (set->order_by) + grib_fieldset_sort(set, 0, set->size - 1); grib_fieldset_rewind(set); return err; } -static int grib_fieldset_compare(grib_fieldset* set,int* i,int* j) +static int grib_fieldset_compare(grib_fieldset* set, int* i, int* j) { - int ret=0; - double d=0; - int idkey=0; - grib_order_by* ob=0; - int ii=0,jj=0; - int *order=0; - - if (!set || !set->order_by) return GRIB_INVALID_ARGUMENT; - ob=set->order_by; - order=set->order->el; + int ret = 0; + double d = 0; + int idkey = 0; + grib_order_by* ob = 0; + int ii = 0, jj = 0; + int* order = 0; + + if (!set || !set->order_by) + return GRIB_INVALID_ARGUMENT; + ob = set->order_by; + order = set->order->el; - ii=*(set->filter->el+*(order+*i)); - jj=*(set->filter->el+*(order+*j)); + ii = *(set->filter->el + *(order + *i)); + jj = *(set->filter->el + *(order + *j)); while (ob) { - idkey=ob->idkey; + idkey = ob->idkey; switch (set->columns[idkey].type) { - case GRIB_TYPE_STRING: - ret=strcmp(set->columns[idkey].string_values[ii], - set->columns[idkey].string_values[jj]); - break; + case GRIB_TYPE_STRING: + ret = strcmp(set->columns[idkey].string_values[ii], + set->columns[idkey].string_values[jj]); + break; - case GRIB_TYPE_DOUBLE: - d=set->columns[idkey].double_values[ii]- - set->columns[idkey].double_values[jj]; - if (d > 0 ) ret=1; - else if ( d == 0) ret=0; - else ret=-1; - break; + case GRIB_TYPE_DOUBLE: + d = set->columns[idkey].double_values[ii] - + set->columns[idkey].double_values[jj]; + if (d > 0) + ret = 1; + else if (d == 0) + ret = 0; + else + ret = -1; + break; - case GRIB_TYPE_LONG: - ret=set->columns[idkey].long_values[ii]- - set->columns[idkey].long_values[jj]; - break; - default: - return GRIB_INVALID_TYPE; + case GRIB_TYPE_LONG: + ret = set->columns[idkey].long_values[ii] - + set->columns[idkey].long_values[jj]; + break; + default: + return GRIB_INVALID_TYPE; } - if (ret!=0) { - ret*=ob->mode; + if (ret != 0) { + ret *= ob->mode; break; } - ob=ob->next; + ob = ob->next; } return ret; @@ -468,26 +506,29 @@ static int grib_fieldset_compare(grib_fieldset* set,int* i,int* j) static void grib_fieldset_sort(grib_fieldset* set, int beg, int theEnd) { double temp; - int l=0,r=0; + int l = 0, r = 0; if (theEnd > beg) { l = beg + 1; r = theEnd; while (l < r) { - if ( grib_fieldset_compare(set,&l,&beg) <= 0 ) { + if (grib_fieldset_compare(set, &l, &beg) <= 0) { l++; - } else if(grib_fieldset_compare(set,&r,&beg) >= 0 ) { + } + else if (grib_fieldset_compare(set, &r, &beg) >= 0) { r--; - } else { - SWAP(set->order->el[l],set->order->el[r]) + } + else { + SWAP(set->order->el[l], set->order->el[r]) } } - if (grib_fieldset_compare(set,&l,&beg) < 0) { - SWAP(set->order->el[l],set->order->el[beg]) - l--; - } else { + if (grib_fieldset_compare(set, &l, &beg) < 0) { + SWAP(set->order->el[l], set->order->el[beg]) l--; - SWAP(set->order->el[l],set->order->el[beg]) + } + else { + l--; + SWAP(set->order->el[l], set->order->el[beg]) } grib_fieldset_sort(set, beg, l); @@ -495,17 +536,19 @@ static void grib_fieldset_sort(grib_fieldset* set, int beg, int theEnd) } } -void grib_fieldset_delete_order_by(grib_context* c,grib_order_by* order_by) +void grib_fieldset_delete_order_by(grib_context* c, grib_order_by* order_by) { - grib_order_by* ob=order_by; + grib_order_by* ob = order_by; - if (!c) c=grib_context_get_default(); + if (!c) + c = grib_context_get_default(); while (order_by) { - if (order_by->key) free(order_by->key); - ob=order_by; - order_by=order_by->next; - grib_context_free( c,ob); + if (order_by->key) + free(order_by->key); + ob = order_by; + order_by = order_by->next; + grib_context_free(c, ob); } return; @@ -513,129 +556,146 @@ void grib_fieldset_delete_order_by(grib_context* c,grib_order_by* order_by) static grib_order_by* grib_fieldset_new_order_by(grib_context* c, const char* obstr) { - char *t1=0,*t2=0,*p=0; - int id=0; - char *z=0; - int mode,mode_default=GRIB_ORDER_BY_ASC; - grib_order_by *ob,*sob; + char *t1 = 0, *t2 = 0, *p = 0; + int id = 0; + char* z = 0; + int mode, mode_default = GRIB_ORDER_BY_ASC; + grib_order_by *ob, *sob; - if (!obstr) return NULL; + if (!obstr) + return NULL; - z=grib_context_strdup(c,obstr); - if(!z) return 0; + z = grib_context_strdup(c, obstr); + if (!z) + return 0; grib_trim(&z); - if (strlen(z)==0) {return 0;} + if (strlen(z) == 0) { + return 0; + } - ob=(grib_order_by*)grib_context_malloc_clear(c,sizeof(grib_order_by)); - sob=ob; - ob->key=0; - ob->idkey=0; - ob->mode=0; - ob->next=0; + ob = (grib_order_by*)grib_context_malloc_clear(c, sizeof(grib_order_by)); + sob = ob; + ob->key = 0; + ob->idkey = 0; + ob->mode = 0; + ob->next = 0; - t1=strtok(z,","); + t1 = strtok(z, ","); while (t1) { grib_trim(&t1); - t2=grib_context_strdup(c,t1); - p=t2; - while ( *p != ' ' && *p != '\0' ) p++; - mode=mode_default; + t2 = grib_context_strdup(c, t1); + p = t2; + while (*p != ' ' && *p != '\0') + p++; + mode = mode_default; if (p != t2) { - while ( *p == ' ' && *p != '\0' ) p++; + while (*p == ' ' && *p != '\0') + p++; if (*p != '\0') { - *(p-1)='\0'; - if (strncmp(p,"asc",3)==0) mode=GRIB_ORDER_BY_ASC; - else if (strncmp(p,"desc",4)==0) mode=GRIB_ORDER_BY_DESC; - else grib_context_log(c, GRIB_LOG_ERROR,"Invalid sort specifier: %s", p); + *(p - 1) = '\0'; + if (strncmp(p, "asc", 3) == 0) + mode = GRIB_ORDER_BY_ASC; + else if (strncmp(p, "desc", 4) == 0) + mode = GRIB_ORDER_BY_DESC; + else + grib_context_log(c, GRIB_LOG_ERROR, "Invalid sort specifier: %s", p); } grib_trim(&p); } grib_trim(&t2); - id=-1; - t1=strtok(NULL,","); + id = -1; + t1 = strtok(NULL, ","); if (ob->key) { - ob->next=(grib_order_by*)grib_context_malloc_clear(c,sizeof(grib_order_by)); - ob=ob->next; - ob->key=0; - ob->next=0; + ob->next = (grib_order_by*)grib_context_malloc_clear(c, sizeof(grib_order_by)); + ob = ob->next; + ob->key = 0; + ob->next = 0; } - ob->mode=mode; - ob->key=t2; - ob->idkey=id; + ob->mode = mode; + ob->key = t2; + ob->idkey = id; } - if (z) grib_context_free(c,z); + if (z) + grib_context_free(c, z); return sob; } void grib_fieldset_delete(grib_fieldset* set) { - grib_context* c=0; - if (!set) return; + grib_context* c = 0; + if (!set) + return; - c=set->context; + c = set->context; grib_fieldset_delete_columns(set); grib_fieldset_delete_fields(set); grib_fieldset_delete_int_array(set->order); grib_fieldset_delete_int_array(set->filter); + grib_fieldset_delete_order_by(c, set->order_by); - grib_context_free( c, set); + grib_context_free(c, set); } -int grib_fieldset_add(grib_fieldset* set,char* filename) +int grib_fieldset_add(grib_fieldset* set, char* filename) { - int ret=GRIB_SUCCESS; - int err=0; - int i=0; - grib_handle* h=0; + int ret = GRIB_SUCCESS; + int err = 0; + int i = 0; + grib_handle* h = 0; /* int nkeys; */ grib_file* file; - double offset=0; - long length=0; - grib_context* c=0; + double offset = 0; + long length = 0; + grib_context* c = 0; - if (!set || !filename ) return GRIB_INVALID_ARGUMENT; - c=set->context; + if (!set || !filename) + return GRIB_INVALID_ARGUMENT; + c = set->context; /* nkeys=set->columns_size; */ - file=grib_file_open(filename,"r",&err); - if (!file || !file->handle) return err; + file = grib_file_open(filename, "r", &err); + if (!file || !file->handle) + return err; - while((h = grib_handle_new_from_file(c,file->handle,&ret)) - != NULL || ret != GRIB_SUCCESS ) { - if (!h) return ret; + while ((h = grib_handle_new_from_file(c, file->handle, &ret)) != NULL || ret != GRIB_SUCCESS) { + if (!h) + return ret; - err=GRIB_SUCCESS; - for (i=0;icolumns_size;i++) { - err=grib_fieldset_column_copy_from_handle(h,set,i); - if (err != GRIB_SUCCESS) ret=err; + err = GRIB_SUCCESS; + for (i = 0; i < set->columns_size; i++) { + err = grib_fieldset_column_copy_from_handle(h, set, i); + if (err != GRIB_SUCCESS) + ret = err; } - if (err==GRIB_SUCCESS || err==GRIB_NOT_FOUND) { + if (err == GRIB_SUCCESS || err == GRIB_NOT_FOUND) { if (set->fields_array_size < set->columns[0].values_array_size) { - ret=grib_fieldset_resize(set,set->columns[0].values_array_size); - if (ret!=GRIB_SUCCESS) return ret; + ret = grib_fieldset_resize(set, set->columns[0].values_array_size); + if (ret != GRIB_SUCCESS) + return ret; } - offset=0; - ret=grib_get_double(h,"offset",&offset); - set->fields[set->size]=(grib_field*)grib_context_malloc_clear(c,sizeof(grib_field)); - set->fields[set->size]->file=file; + offset = 0; + ret = grib_get_double(h, "offset", &offset); + set->fields[set->size] = (grib_field*)grib_context_malloc_clear(c, sizeof(grib_field)); + set->fields[set->size]->file = file; file->refcount++; - set->fields[set->size]->offset=(off_t)offset; - ret=grib_get_long(h,"totalLength",&length); - set->fields[set->size]->length=length; - set->filter->el[set->size]=set->size; - set->order->el[set->size]=set->size; - set->size=set->columns[0].size; + set->fields[set->size]->offset = (off_t)offset; + ret = grib_get_long(h, "totalLength", &length); + set->fields[set->size]->length = length; + set->filter->el[set->size] = set->size; + set->order->el[set->size] = set->size; + set->size = set->columns[0].size; } grib_handle_delete(h); } - if (h) grib_handle_delete(h); + if (h) + grib_handle_delete(h); grib_file_close(file->name, 0, &err); @@ -644,33 +704,37 @@ int grib_fieldset_add(grib_fieldset* set,char* filename) return ret; } -static int grib_fieldset_resize(grib_fieldset* set,size_t newsize) +static int grib_fieldset_resize(grib_fieldset* set, size_t newsize) { - int err=0; + int err = 0; - err=grib_fieldset_resize_fields(set,newsize); - if (err != 0) return err; - grib_fieldset_resize_int_array(set->order,newsize); - if (err != 0) return err; - grib_fieldset_resize_int_array(set->filter,newsize); - if (err != 0) return err; + err = grib_fieldset_resize_fields(set, newsize); + if (err != 0) + return err; + grib_fieldset_resize_int_array(set->order, newsize); + if (err != 0) + return err; + grib_fieldset_resize_int_array(set->filter, newsize); + if (err != 0) + return err; - set->fields_array_size=newsize; + set->fields_array_size = newsize; return GRIB_SUCCESS; } void grib_fieldset_rewind(grib_fieldset* set) { - if (set) set->current=0; + if (set) + set->current = 0; } -grib_handle* grib_fieldset_next_handle(grib_fieldset* set,int* err) +grib_handle* grib_fieldset_next_handle(grib_fieldset* set, int* err) { grib_handle* h; - *err=GRIB_SUCCESS; - h=grib_fieldset_retrieve(set,set->current,err); - if (*err==GRIB_SUCCESS) { + *err = GRIB_SUCCESS; + h = grib_fieldset_retrieve(set, set->current, err); + if (*err == GRIB_SUCCESS) { set->current++; } return h; @@ -681,77 +745,85 @@ int grib_fieldset_count(grib_fieldset* set) return set->size; } -grib_handle* grib_fieldset_retrieve(grib_fieldset* set,int i,int* err) +grib_handle* grib_fieldset_retrieve(grib_fieldset* set, int i, int* err) { - grib_handle* h=0; - grib_field* field=0; - *err=GRIB_SUCCESS; - if ( !set ) { - *err=GRIB_INVALID_ARGUMENT; + grib_handle* h = 0; + grib_field* field = 0; + *err = GRIB_SUCCESS; + if (!set) { + *err = GRIB_INVALID_ARGUMENT; return NULL; } - if (i >= set->size) return NULL; + if (i >= set->size) + return NULL; - field=set->fields[set->filter->el[set->order->el[i]]]; - grib_file_open(field->file->name,"r",err); - if (*err!=GRIB_SUCCESS) return NULL; + field = set->fields[set->filter->el[set->order->el[i]]]; + grib_file_open(field->file->name, "r", err); + if (*err != GRIB_SUCCESS) + return NULL; - fseeko(field->file->handle,field->offset,SEEK_SET); - h=grib_handle_new_from_file(set->context,field->file->handle,err); - if (*err!=GRIB_SUCCESS) return NULL; + fseeko(field->file->handle, field->offset, SEEK_SET); + h = grib_handle_new_from_file(set->context, field->file->handle, err); + if (*err != GRIB_SUCCESS) + return NULL; grib_file_close(field->file->name, 0, err); return h; } -static grib_int_array* grib_fieldset_create_int_array(grib_context* c,size_t size) +static grib_int_array* grib_fieldset_create_int_array(grib_context* c, size_t size) { grib_int_array* a; - int i=0; + int i = 0; - if (!c) c=grib_context_get_default(); + if (!c) + c = grib_context_get_default(); - a=(grib_int_array*)grib_context_malloc_clear(c,sizeof(grib_int_array)); + a = (grib_int_array*)grib_context_malloc_clear(c, sizeof(grib_int_array)); if (!a) { grib_context_log(c, GRIB_LOG_ERROR, - "grib_fieldset_create_int_array : Cannot malloc %d bytes", - sizeof(grib_int_array)); + "grib_fieldset_create_int_array : Cannot malloc %d bytes", + sizeof(grib_int_array)); return NULL; } - a->el=(int*)grib_context_malloc_clear(c,sizeof(int)*size); + a->el = (int*)grib_context_malloc_clear(c, sizeof(int) * size); if (!a->el) { grib_context_log(c, GRIB_LOG_ERROR, - "grib_fieldset_create_int_array : Cannot malloc %d bytes", - sizeof(int)*size); + "grib_fieldset_create_int_array : Cannot malloc %d bytes", + sizeof(int) * size); return NULL; } - a->size=size; - a->context=c; - for (i=0;iel[i]=i; + a->size = size; + a->context = c; + for (i = 0; i < size; i++) + a->el[i] = i; return a; } -static int grib_fieldset_resize_int_array(grib_int_array* a,size_t newsize) +static int grib_fieldset_resize_int_array(grib_int_array* a, size_t newsize) { int* el; - int err=0; - if (!a) return GRIB_INVALID_ARGUMENT; + int err = 0; + if (!a) + return GRIB_INVALID_ARGUMENT; - newsize=newsize*sizeof(int); + newsize = newsize * sizeof(int); - el=(int*)grib_context_realloc(a->context,a->el,newsize); + el = (int*)grib_context_realloc(a->context, a->el, newsize); if (!el) { grib_context_log(a->context, GRIB_LOG_ERROR, - "grib_fieldset_resize_int_array : Cannot malloc %d bytes", - newsize); + "grib_fieldset_resize_int_array : Cannot malloc %d bytes", + newsize); return GRIB_OUT_OF_MEMORY; - } else a->el=el; - a->size=newsize; + } + else + a->el = el; + a->size = newsize; return err; } @@ -759,96 +831,111 @@ static void grib_fieldset_delete_int_array(grib_int_array* f) { grib_context* c = NULL; - if (!f) return; + if (!f) + return; c = f->context; - grib_context_free(c,f->el); - grib_context_free(c,f); + grib_context_free(c, f->el); + grib_context_free(c, f); } -static grib_field** grib_fieldset_create_fields(grib_context* c,size_t size) +static grib_field** grib_fieldset_create_fields(grib_context* c, size_t size) { int i; - grib_field** fields=(grib_field**)grib_context_malloc_clear(c,size*sizeof(grib_field*)); - if (!fields) return NULL; - for (i=0;icontext,set->fields,newsize*sizeof(grib_field*)); + fields = (grib_field**)grib_context_realloc(set->context, set->fields, newsize * sizeof(grib_field*)); if (!fields) { grib_context_log(set->context, GRIB_LOG_ERROR, - "grib_fieldset_resize_fields : Cannot malloc %d bytes", - newsize*sizeof(grib_field*)); + "grib_fieldset_resize_fields : Cannot malloc %d bytes", + newsize * sizeof(grib_field*)); return GRIB_OUT_OF_MEMORY; - } else set->fields=fields; + } + else + set->fields = fields; - for (i=set->fields_array_size;ifields[i]=0; + for (i = set->fields_array_size; i < newsize; i++) + set->fields[i] = 0; - set->fields_array_size=newsize; + set->fields_array_size = newsize; return err; } static void grib_fieldset_delete_fields(grib_fieldset* set) { int i; - for (i=0;isize;i++) { - if (!set->fields[i]) continue; + for (i = 0; i < set->size; i++) { + if (!set->fields[i]) + continue; set->fields[i]->file->refcount--; /* See GRIB-1010: force file close */ { /* int err = 0; */ /* grib_file_close(set->fields[i]->file->name, 1, &err); */ } - grib_context_free(set->context,set->fields[i]); + grib_context_free(set->context, set->fields[i]); } - grib_context_free(set->context,set->fields); + grib_context_free(set->context, set->fields); } static void grib_trim(char** x) { - char* p=0; - while (**x == ' ' && **x != '\0' ) (*x)++; - if (**x == '\0') return; - p=(*x)+strlen(*x)-1; - while ( *p == ' ' ) {*p='\0';p--;} - if ( *p == ' ' ) *p='\0'; + char* p = 0; + while (**x == ' ' && **x != '\0') + (*x)++; + if (**x == '\0') + return; + p = (*x) + strlen(*x) - 1; + while (*p == ' ') { + *p = '\0'; + p--; + } + if (*p == ' ') + *p = '\0'; } -static int grib_fieldset_set_order_by(grib_fieldset* set,grib_order_by* ob) +static int grib_fieldset_set_order_by(grib_fieldset* set, grib_order_by* ob) { - grib_order_by* next=ob; - char* p=NULL; - int i=0; - - while(next) { - next->idkey=-1; - p=next->key; - while (*p!= 0 && *p != ':') p++; - if (*p ==':') *p=0; - for (i=0;icolumns_size; i++) { - if (!grib_inline_strcmp(next->key,set->columns[i].name)) { - next->idkey=i; + grib_order_by* next = ob; + char* p = NULL; + int i = 0; + + while (next) { + next->idkey = -1; + p = next->key; + while (*p != 0 && *p != ':') + p++; + if (*p == ':') + *p = 0; + for (i = 0; i < set->columns_size; i++) { + if (!grib_inline_strcmp(next->key, set->columns[i].name)) { + next->idkey = i; break; } } if (next->idkey == -1) { - grib_context_log(set->context,GRIB_LOG_ERROR, - "Unable to apply the order by. Key missing from the fieldset.\n"); + grib_context_log(set->context, GRIB_LOG_ERROR, + "Unable to apply the order by. Key missing from the fieldset.\n"); return GRIB_MISSING_KEY; } - next=next->next; + next = next->next; } - set->order_by=ob; + set->order_by = ob; return GRIB_SUCCESS; } diff --git a/src/grib_filepool.c b/src/grib_filepool.c index 39f129797..96faf8cf2 100644 --- a/src/grib_filepool.c +++ b/src/grib_filepool.c @@ -18,16 +18,16 @@ #define GRIB_MAX_OPENED_FILES 200 #if GRIB_PTHREADS -static pthread_once_t once = PTHREAD_ONCE_INIT; +static pthread_once_t once = PTHREAD_ONCE_INIT; static pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER; -static void init() { +static void init() +{ pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); - pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init(&mutex1,&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&mutex1, &attr); pthread_mutexattr_destroy(&attr); - } #elif GRIB_OMP_THREADS static int once = 0; @@ -37,8 +37,7 @@ static void init() { GRIB_OMP_CRITICAL(lock_grib_filepool_c) { - if (once == 0) - { + if (once == 0) { omp_init_nest_lock(&mutex1); once = 1; } @@ -46,93 +45,106 @@ static void init() } #endif -static short next_id=0; +static short next_id = 0; /* Note: A fast cut-down version of strcmp which does NOT return -1 */ /* 0 means input strings are equal and 1 means not equal */ -GRIB_INLINE static int grib_inline_strcmp(const char* a,const char* b) +GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b) { - if (*a != *b) return 1; - while((*a!=0 && *b!=0) && *(a) == *(b) ) {a++;b++;} - return (*a==0 && *b==0) ? 0 : 1; + if (*a != *b) + return 1; + while ((*a != 0 && *b != 0) && *(a) == *(b)) { + a++; + b++; + } + return (*a == 0 && *b == 0) ? 0 : 1; } -static grib_file_pool file_pool= { - 0, /* grib_context* context;*/ - 0, /* grib_file* first;*/ - 0, /* grib_file* current; */ - 0, /* size_t size;*/ - 0, /* int number_of_opened_files;*/ - GRIB_MAX_OPENED_FILES /* int max_opened_files; */ +static grib_file_pool file_pool = { + 0, /* grib_context* context;*/ + 0, /* grib_file* first;*/ + 0, /* grib_file* current; */ + 0, /* size_t size;*/ + 0, /* int number_of_opened_files;*/ + GRIB_MAX_OPENED_FILES /* int max_opened_files; */ }; void grib_file_pool_clean() { - grib_file *file,*next; + grib_file *file, *next; - if (!file_pool.first) return; + if (!file_pool.first) + return; - file=file_pool.first; - while(file) { - next=file->next; + file = file_pool.first; + while (file) { + next = file->next; grib_file_delete(file); - file=next; + file = next; } } static void grib_file_pool_change_id() { - grib_file *file; + grib_file* file; - if (!file_pool.first) return; + if (!file_pool.first) + return; - file=file_pool.first; - while(file) { - file->id+=1000; - file=file->next; + file = file_pool.first; + while (file) { + file->id += 1000; + file = file->next; } } -static grib_file* grib_read_file(grib_context *c,FILE* fh,int *err) +static grib_file* grib_read_file(grib_context* c, FILE* fh, int* err) { - short marker=0; - short id=0; + short marker = 0; + short id = 0; grib_file* file; - *err = grib_read_short(fh,&marker); - if(!marker) return NULL; + *err = grib_read_short(fh, &marker); + if (!marker) + return NULL; - file=(grib_file*)grib_context_malloc_clear(c,sizeof(grib_file)); - file->buffer=0; - file->name=grib_read_string(c,fh,err); - if (*err) return NULL; + file = (grib_file*)grib_context_malloc_clear(c, sizeof(grib_file)); + file->buffer = 0; + file->name = grib_read_string(c, fh, err); + if (*err) + return NULL; - *err=grib_read_short(fh,&id); - file->id=id; - if (*err) return NULL; + *err = grib_read_short(fh, &id); + file->id = id; + if (*err) + return NULL; - file->next=grib_read_file(c,fh,err); - if (*err) return NULL; + file->next = grib_read_file(c, fh, err); + if (*err) + return NULL; return file; } -static int grib_write_file(FILE *fh,grib_file* file) +static int grib_write_file(FILE* fh, grib_file* file) { - int err=0; + int err = 0; if (!file) return grib_write_null_marker(fh); - err=grib_write_not_null_marker(fh); - if (err) return err; + err = grib_write_not_null_marker(fh); + if (err) + return err; - err=grib_write_string(fh,file->name); - if (err) return err; + err = grib_write_string(fh, file->name); + if (err) + return err; - err=grib_write_short(fh,(short)file->id); - if (err) return err; + err = grib_write_short(fh, (short)file->id); + if (err) + return err; - return grib_write_file(fh,file->next); + return grib_write_file(fh, file->next); } grib_file* grib_file_pool_get_files() @@ -140,78 +152,87 @@ grib_file* grib_file_pool_get_files() return file_pool.first; } -int grib_file_pool_read(grib_context* c,FILE* fh) +int grib_file_pool_read(grib_context* c, FILE* fh) { - int err=0; - short marker=0; + int err = 0; + short marker = 0; grib_file* file; - if (!c) c=grib_context_get_default(); + if (!c) + c = grib_context_get_default(); - err = grib_read_short(fh,&marker); - if(!marker) { - grib_context_log(c,GRIB_LOG_ERROR, - "Unable to find file information in index file\n"); + err = grib_read_short(fh, &marker); + if (!marker) { + grib_context_log(c, GRIB_LOG_ERROR, + "Unable to find file information in index file\n"); return GRIB_INVALID_FILE; } grib_file_pool_change_id(); - file=file_pool.first; + file = file_pool.first; while (file->next) - file=file->next; + file = file->next; - file->next=grib_read_file(c,fh,&err); - if (err) return err; + file->next = grib_read_file(c, fh, &err); + if (err) + return err; return GRIB_SUCCESS; } int grib_file_pool_write(FILE* fh) { - int err=0; + int err = 0; if (!file_pool.first) return grib_write_null_marker(fh); - err=grib_write_not_null_marker(fh); - if (err) return err; + err = grib_write_not_null_marker(fh); + if (err) + return err; - return grib_write_file(fh,file_pool.first); + return grib_write_file(fh, file_pool.first); } -grib_file* grib_file_open(const char* filename, const char* mode,int* err) +grib_file* grib_file_open(const char* filename, const char* mode, int* err) { - grib_file *file=0,*prev=0; - int same_mode=0; - int is_new=0; - GRIB_MUTEX_INIT_ONCE(&once,&init); + grib_file *file = 0, *prev = 0; + int same_mode = 0; + int is_new = 0; + GRIB_MUTEX_INIT_ONCE(&once, &init); - if (!file_pool.context) file_pool.context=grib_context_get_default(); + if (!file_pool.context) + file_pool.context = grib_context_get_default(); - if (file_pool.current && !grib_inline_strcmp(filename,file_pool.current->name)) { - file=file_pool.current; - } else { + if (file_pool.current && !grib_inline_strcmp(filename, file_pool.current->name)) { + file = file_pool.current; + } + else { GRIB_MUTEX_LOCK(&mutex1); - file=file_pool.first; + file = file_pool.first; while (file) { - if (!grib_inline_strcmp(filename,file->name)) break; - prev=file; - file=file->next; + if (!grib_inline_strcmp(filename, file->name)) + break; + prev = file; + file = file->next; } if (!file) { - is_new=1; - file=grib_file_new(file_pool.context,filename,err); - if (prev) prev->next=file; - file_pool.current=file; - if (!prev) file_pool.first=file; + is_new = 1; + file = grib_file_new(file_pool.context, filename, err); + if (prev) + prev->next = file; + file_pool.current = file; + if (!prev) + file_pool.first = file; file_pool.size++; } GRIB_MUTEX_UNLOCK(&mutex1); } - if (file->mode) same_mode=grib_inline_strcmp(mode,file->mode) ? 0 : 1; + if (file->mode) + same_mode = grib_inline_strcmp(mode, file->mode) ? 0 : 1; if (file->handle && same_mode) { - *err=0; + *err = 0; return file; } @@ -225,31 +246,32 @@ grib_file* grib_file_open(const char* filename, const char* mode,int* err) /*printf("-- opening file %s %s\n",file->name,mode);*/ if (!is_new && *mode == 'w') { /* fprintf(stderr,"++++ opening %s as append\n",file->name); */ - file->handle = fopen(file->name,"a"); - } else { - file->handle = fopen(file->name,mode); + file->handle = fopen(file->name, "a"); + } + else { + file->handle = fopen(file->name, mode); /* fprintf(stderr,"++++ opening %s as mode\n",file->name); */ } - file->mode=strdup(mode); + file->mode = strdup(mode); if (!file->handle) { - grib_context_log(file->context,GRIB_LOG_PERROR,"grib_file_open: cannot open file %s",file->name); - *err=GRIB_IO_PROBLEM; + grib_context_log(file->context, GRIB_LOG_PERROR, "grib_file_open: cannot open file %s", file->name); + *err = GRIB_IO_PROBLEM; GRIB_MUTEX_UNLOCK(&mutex1); return NULL; } if (file_pool.context->io_buffer_size) { #ifdef POSIX_MEMALIGN - if (posix_memalign((void**)&(file->buffer),sysconf(_SC_PAGESIZE),file_pool.context->io_buffer_size) ) { - grib_context_log(file->context,GRIB_LOG_FATAL,"posix_memalign unable to allocate io_buffer\n"); + if (posix_memalign((void**)&(file->buffer), sysconf(_SC_PAGESIZE), file_pool.context->io_buffer_size)) { + grib_context_log(file->context, GRIB_LOG_FATAL, "posix_memalign unable to allocate io_buffer\n"); } #else file->buffer = (void*)malloc(file_pool.context->io_buffer_size); if (!file->buffer) { - grib_context_log(file->context,GRIB_LOG_FATAL,"Unable to allocate io_buffer\n"); + grib_context_log(file->context, GRIB_LOG_FATAL, "Unable to allocate io_buffer\n"); } #endif - setvbuf(file->handle,file->buffer,_IOFBF,file_pool.context->io_buffer_size); + setvbuf(file->handle, file->buffer, _IOFBF, file_pool.context->io_buffer_size); } file_pool.number_of_opened_files++; @@ -259,25 +281,27 @@ grib_file* grib_file_open(const char* filename, const char* mode,int* err) return file; } -void grib_file_pool_delete_file(grib_file* file) { - grib_file* prev=NULL; - GRIB_MUTEX_INIT_ONCE(&once,&init); +void grib_file_pool_delete_file(grib_file* file) +{ + grib_file* prev = NULL; + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex1); - if (file==file_pool.first) { - file_pool.first=file->next; - file_pool.current=file->next; - } else { - - prev=file_pool.first; - file_pool.current=file_pool.first; + if (file == file_pool.first) { + file_pool.first = file->next; + file_pool.current = file->next; + } + else { + prev = file_pool.first; + file_pool.current = file_pool.first; while (prev) { - if (prev->next==file) break; - prev=prev->next; + if (prev->next == file) + break; + prev = prev->next; } DebugAssert(prev); if (prev) { - prev->next=file->next; + prev->next = file->next; } } @@ -286,55 +310,56 @@ void grib_file_pool_delete_file(grib_file* file) { } grib_file_delete(file); GRIB_MUTEX_UNLOCK(&mutex1); - } void grib_file_close(const char* filename, int force, int* err) { - grib_file* file=NULL; + grib_file* file = NULL; grib_context* context = grib_context_get_default(); /* Performance: keep the files open to avoid opening and closing files when writing the output. */ /* So only call fclose() when too many files are open. */ /* Also see ECC-411 */ int do_close = (file_pool.number_of_opened_files > context->file_pool_max_opened_files); - if (force == 1) do_close=1; /* Can be overridden with the force argument */ + if (force == 1) + do_close = 1; /* Can be overridden with the force argument */ - if ( do_close ) { + if (do_close) { /*printf("+++++++++++++ closing file %s (n=%d)\n",filename, file_pool.number_of_opened_files);*/ - GRIB_MUTEX_INIT_ONCE(&once,&init); + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex1); - file=grib_get_file(filename,err); + file = grib_get_file(filename, err); if (file->handle) { if (fclose(file->handle) != 0) { - *err=GRIB_IO_PROBLEM; + *err = GRIB_IO_PROBLEM; } if (file->buffer) { free(file->buffer); - file->buffer=0; + file->buffer = 0; } - file->handle=NULL; + file->handle = NULL; file_pool.number_of_opened_files--; } GRIB_MUTEX_UNLOCK(&mutex1); } } -void grib_file_close_all(int *err) +void grib_file_close_all(int* err) { grib_file* file = NULL; - if (!file_pool.first) return; + if (!file_pool.first) + return; - GRIB_MUTEX_INIT_ONCE(&once,&init); + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex1); file = file_pool.first; while (file) { if (file->handle) { if (fclose(file->handle) != 0) { - *err=GRIB_IO_PROBLEM; + *err = GRIB_IO_PROBLEM; } - file->handle=NULL; + file->handle = NULL; } file = file->next; } @@ -342,36 +367,39 @@ void grib_file_close_all(int *err) GRIB_MUTEX_UNLOCK(&mutex1); } -grib_file* grib_get_file(const char* filename,int* err) +grib_file* grib_get_file(const char* filename, int* err) { - grib_file* file=NULL; + grib_file* file = NULL; - if (file_pool.current->name && !grib_inline_strcmp(filename,file_pool.current->name)) { + if (file_pool.current->name && !grib_inline_strcmp(filename, file_pool.current->name)) { return file_pool.current; } - file=file_pool.first; + file = file_pool.first; while (file) { - if (!grib_inline_strcmp(filename,file->name)) break; - file=file->next; + if (!grib_inline_strcmp(filename, file->name)) + break; + file = file->next; } - if (!file) file=grib_file_new(0,filename,err); + if (!file) + file = grib_file_new(0, filename, err); return file; } grib_file* grib_find_file(short id) { - grib_file* file=NULL; + grib_file* file = NULL; - if (file_pool.current->name && id==file_pool.current->id) { + if (file_pool.current->name && id == file_pool.current->id) { return file_pool.current; } - file=file_pool.first; + file = file_pool.first; while (file) { - if (id==file->id) break; - file=file->next; + if (id == file->id) + break; + file = file->next; } return file; @@ -381,39 +409,41 @@ grib_file* grib_file_new(grib_context* c, const char* name, int* err) { grib_file* file; - if (!c) c=grib_context_get_default( ); + if (!c) + c = grib_context_get_default(); - file=(grib_file*)grib_context_malloc_clear( c,sizeof(grib_file)); + file = (grib_file*)grib_context_malloc_clear(c, sizeof(grib_file)); if (!file) { - grib_context_log(c,GRIB_LOG_ERROR,"grib_file_new: unable to allocate memory"); - *err=GRIB_OUT_OF_MEMORY; + grib_context_log(c, GRIB_LOG_ERROR, "grib_file_new: unable to allocate memory"); + *err = GRIB_OUT_OF_MEMORY; return NULL; } - GRIB_MUTEX_INIT_ONCE(&once,&init); + GRIB_MUTEX_INIT_ONCE(&once, &init); - file->name=strdup(name); - file->id=next_id; + file->name = strdup(name); + file->id = next_id; GRIB_MUTEX_LOCK(&mutex1); next_id++; GRIB_MUTEX_UNLOCK(&mutex1); - file->mode=0; - file->handle=0; - file->refcount=0; - file->context=c; - file->next=0; - file->buffer=0; + file->mode = 0; + file->handle = 0; + file->refcount = 0; + file->context = c; + file->next = 0; + file->buffer = 0; return file; } void grib_file_delete(grib_file* file) { { - if (!file) return; + if (!file) + return; } - GRIB_MUTEX_INIT_ONCE(&once,&init); + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex1); /* GRIB-803: cannot call fclose yet! Causes crash */ /* TODO: Set handle to NULL in filepool too */ @@ -424,13 +454,15 @@ void grib_file_delete(grib_file* file) } } #endif - if (file->name) free(file->name); - if (file->mode) free(file->mode); + if (file->name) + free(file->name); + if (file->mode) + free(file->mode); if (file->buffer) { free(file->buffer); } - grib_context_free(file->context,file); - file=NULL; + grib_context_free(file->context, file); + file = NULL; GRIB_MUTEX_UNLOCK(&mutex1); } diff --git a/src/grib_gaussian_reduced.c b/src/grib_gaussian_reduced.c index 2d4b0a27e..bc4ab9731 100644 --- a/src/grib_gaussian_reduced.c +++ b/src/grib_gaussian_reduced.c @@ -31,7 +31,8 @@ typedef long long Fraction_value_type; -typedef struct Fraction_type { +typedef struct Fraction_type +{ Fraction_value_type top_; Fraction_value_type bottom_; } Fraction_type; @@ -40,11 +41,10 @@ const Fraction_value_type MAX_DENOM = 3037000499; /* sqrt(LLONG_MAX) */ static Fraction_value_type fraction_gcd(Fraction_value_type a, Fraction_value_type b) { - while (b != 0) - { + while (b != 0) { Fraction_value_type r = a % b; - a = b; - b = r; + a = b; + b = r; } return a; } @@ -61,22 +61,22 @@ static Fraction_type fraction_construct(Fraction_value_type top, Fraction_value_ Fraction_value_type sign = 1; Assert(bottom != 0); if (top < 0) { - top = -top; + top = -top; sign = -sign; } if (bottom < 0) { bottom = -bottom; - sign = -sign; + sign = -sign; } g = fraction_gcd(top, bottom); if (g != 0) { - top = top / g; + top = top / g; bottom = bottom / g; } - result.top_ = sign * top; + result.top_ = sign * top; result.bottom_ = bottom; return result; } @@ -84,7 +84,7 @@ static Fraction_type fraction_construct(Fraction_value_type top, Fraction_value_ static Fraction_type fraction_construct_from_double(double x) { Fraction_type result; - double value = x; + double value = x; Fraction_value_type sign = 1; Fraction_value_type m00 = 1, m11 = 1, m01 = 0, m10 = 0; Fraction_value_type a = x; @@ -96,15 +96,15 @@ static Fraction_type fraction_construct_from_double(double x) if (x < 0) { sign = -sign; - x = -x; + x = -x; } t2 = m10 * a + m11; while (t2 <= MAX_DENOM) { - Fraction_value_type t1 = m00 * a + m01; - m01 = m00; - m00 = t1; + Fraction_value_type t1 = m00 * a + m01; + m01 = m00; + m00 = t1; m11 = m10; m10 = t2; @@ -119,7 +119,7 @@ static Fraction_type fraction_construct_from_double(double x) break; } - a = x; + a = x; t2 = m10 * a + m11; if (cnt++ > 10000) { @@ -132,14 +132,14 @@ static Fraction_type fraction_construct_from_double(double x) m10 >>= 1; } - top = m00; + top = m00; bottom = m10; - g = fraction_gcd(top, bottom); - top = top / g; + g = fraction_gcd(top, bottom); + top = top / g; bottom = bottom / g; - result.top_ = sign * top; + result.top_ = sign * top; result.bottom_ = bottom; return result; } @@ -161,7 +161,9 @@ static double fraction_operator_double(Fraction_type self) static Fraction_value_type fraction_mul(int* overflow, Fraction_value_type a, Fraction_value_type b) { - if(*overflow) { return 0; } + if (*overflow) { + return 0; + } if (b != 0) { *overflow = llabs(a) > (ULLONG_MAX / llabs(b)); @@ -179,12 +181,13 @@ static Fraction_type fraction_operator_divide(Fraction_type self, Fraction_type if (!overflow) { return fraction_construct(top, bottom); - } else { + } + else { /*Fallback option*/ /*return Fraction(double(*this) / double(other));*/ - double d1 = fraction_operator_double(self); - double d2 = fraction_operator_double(other); - Fraction_type f1 = fraction_construct_from_double(d1/d2); + double d1 = fraction_operator_double(self); + double d2 = fraction_operator_double(other); + Fraction_type f1 = fraction_construct_from_double(d1 / d2); return f1; } } @@ -199,37 +202,40 @@ static Fraction_type fraction_operator_multiply(Fraction_type self, Fraction_typ if (!overflow) { return fraction_construct(top, bottom); - } else { + } + else { /* Fallback option */ /*return Fraction(double(*this) * double(other));*/ - double d1 = fraction_operator_double(self); - double d2 = fraction_operator_double(other); - Fraction_type f1 = fraction_construct_from_double(d1*d2); + double d1 = fraction_operator_double(self); + double d2 = fraction_operator_double(other); + Fraction_type f1 = fraction_construct_from_double(d1 * d2); return f1; } } /* bool Fraction::operator<(const Fraction& other) */ -static int fraction_operator_less_than(Fraction_type self, Fraction_type other) { +static int fraction_operator_less_than(Fraction_type self, Fraction_type other) +{ int overflow = 0; - int result = fraction_mul(&overflow, self.top_, other.bottom_) < fraction_mul(&overflow, other.top_, self.bottom_); + int result = fraction_mul(&overflow, self.top_, other.bottom_) < fraction_mul(&overflow, other.top_, self.bottom_); if (overflow) { double d1 = fraction_operator_double(self); double d2 = fraction_operator_double(other); - return (d1(const Fraction& other) */ -static int fraction_operator_greater_than(Fraction_type self, Fraction_type other) { +static int fraction_operator_greater_than(Fraction_type self, Fraction_type other) +{ int overflow = 0; - int result = fraction_mul(&overflow, self.top_, other.bottom_) > fraction_mul(&overflow, other.top_, self.bottom_); + int result = fraction_mul(&overflow, self.top_, other.bottom_) > fraction_mul(&overflow, other.top_, self.bottom_); if (overflow) { double d1 = fraction_operator_double(self); double d2 = fraction_operator_double(other); - return (d1>d2); + return (d1 > d2); /* return double(*this) > double(other);*/ } return result; @@ -247,7 +253,7 @@ static Fraction_type fraction_construct_from_long_long(long long n) /*templateFraction operator*(T n, const Fraction& f){ return Fraction(n) * f; }*/ static Fraction_type fraction_operator_multiply_n_Frac(Fraction_value_type n, Fraction_type f) { - Fraction_type ft = fraction_construct_from_long_long(n); + Fraction_type ft = fraction_construct_from_long_long(n); Fraction_type result = fraction_operator_multiply(ft, f); return result; /*return Fraction(n) * f;*/ @@ -259,19 +265,19 @@ static Fraction_value_type get_min(Fraction_value_type a, Fraction_value_type b) } static void gaussian_reduced_row( - long long Ni_globe, /*plj*/ - const Fraction_type w, /*lon_first*/ - const Fraction_type e, /*lon_last*/ - long long* pNi, /*npoints*/ - double* pLon1, - double* pLon2) + long long Ni_globe, /*plj*/ + const Fraction_type w, /*lon_first*/ + const Fraction_type e, /*lon_last*/ + long long* pNi, /*npoints*/ + double* pLon1, + double* pLon2) { Fraction_value_type Nw, Ne; Fraction_type inc, Nw_inc, Ne_inc; inc = fraction_construct(360ll, Ni_globe); /* auto Nw = (w / inc).integralPart(); */ - Nw = fraction_integralPart( fraction_operator_divide(w, inc) ); + Nw = fraction_integralPart(fraction_operator_divide(w, inc)); Nw_inc = fraction_operator_multiply_n_Frac(Nw, inc); Assert(Ni_globe > 1); @@ -281,17 +287,18 @@ static void gaussian_reduced_row( } /*auto Ne = (e / inc).integralPart();*/ - Ne = fraction_integralPart( fraction_operator_divide(e, inc) ); + Ne = fraction_integralPart(fraction_operator_divide(e, inc)); Ne_inc = fraction_operator_multiply_n_Frac(Ne, inc); /* if (Ne * inc > e) */ if (fraction_operator_greater_than(Ne_inc, e)) { Ne -= 1; } if (Nw > Ne) { - *pNi = 0; /* no points on this latitude */ + *pNi = 0; /* no points on this latitude */ *pLon1 = *pLon2 = 0; /* dummy - unused */ - } else { - *pNi = get_min(Ni_globe, Ne - Nw + 1); + } + else { + *pNi = get_min(Ni_globe, Ne - Nw + 1); Nw_inc = fraction_operator_multiply_n_Frac(Nw, inc); *pLon1 = fraction_operator_double(Nw_inc); @@ -314,65 +321,80 @@ void grib_get_reduced_row_wrapper(grib_handle* h, long pl, double lon_first, dou In the days of Prodgen/libemos */ void grib_get_reduced_row_legacy(long pl, double lon_first, double lon_last, long* npoints, long* ilon_first, long* ilon_last) { - double range=0,dlon_first=0,dlon_last=0; + double range = 0, dlon_first = 0, dlon_last = 0; long irange; - range=lon_last-lon_first; - if (range<0) {range+=360;lon_first-=360;} + range = lon_last - lon_first; + if (range < 0) { + range += 360; + lon_first -= 360; + } /* computing integer number of points and coordinates without using floating point resolution*/ - *npoints=(range*pl)/360.0+1; - *ilon_first=(lon_first*pl)/360.0; - *ilon_last=(lon_last*pl)/360.0; + *npoints = (range * pl) / 360.0 + 1; + *ilon_first = (lon_first * pl) / 360.0; + *ilon_last = (lon_last * pl) / 360.0; - irange=*ilon_last-*ilon_first+1; + irange = *ilon_last - *ilon_first + 1; #if EFDEBUG printf(" pl=%ld npoints=%ld range=%.10e ilon_first=%ld ilon_last=%ld irange=%ld\n", - pl,*npoints,range,*ilon_first,*ilon_last,irange); + pl, *npoints, range, *ilon_first, *ilon_last, irange); #endif if (irange != *npoints) { #if EFDEBUG - printf(" ---> (irange=%ld) != (npoints=%ld) ",irange,*npoints); + printf(" ---> (irange=%ld) != (npoints=%ld) ", irange, *npoints); #endif if (irange > *npoints) { /* checking if the first point is out of range*/ - dlon_first=((*ilon_first)*360.0)/pl; - if (dlon_first < lon_first) {(*ilon_first)++;irange--; + dlon_first = ((*ilon_first) * 360.0) / pl; + if (dlon_first < lon_first) { + (*ilon_first)++; + irange--; #if EFDEBUG - printf(" dlon_first=%.10e < lon_first=%.10e\n",dlon_first,lon_first ); + printf(" dlon_first=%.10e < lon_first=%.10e\n", dlon_first, lon_first); #endif } /* checking if the last point is out of range*/ - dlon_last=((*ilon_last)*360.0)/pl; - if (dlon_last > lon_last) {(*ilon_last)--;irange--; + dlon_last = ((*ilon_last) * 360.0) / pl; + if (dlon_last > lon_last) { + (*ilon_last)--; + irange--; #if EFDEBUG - printf(" dlon_last=%.10e < lon_last=%.10e\n",dlon_last,lon_last ); + printf(" dlon_last=%.10e < lon_last=%.10e\n", dlon_last, lon_last); #endif } - } else { - int ok=0; + } + else { + int ok = 0; /* checking if the point before the first is in the range*/ - dlon_first=((*ilon_first-1)*360.0)/pl; - if (dlon_first > lon_first) {(*ilon_first)--;irange++;ok=1; + dlon_first = ((*ilon_first - 1) * 360.0) / pl; + if (dlon_first > lon_first) { + (*ilon_first)--; + irange++; + ok = 1; #if EFDEBUG - printf(" dlon_first1=%.10e > lon_first=%.10e\n",dlon_first,lon_first ); + printf(" dlon_first1=%.10e > lon_first=%.10e\n", dlon_first, lon_first); #endif } /* checking if the point after the last is in the range*/ - dlon_last=((*ilon_last+1)*360.0)/pl; - if (dlon_last < lon_last) {(*ilon_last)++;irange++;ok=1; + dlon_last = ((*ilon_last + 1) * 360.0) / pl; + if (dlon_last < lon_last) { + (*ilon_last)++; + irange++; + ok = 1; #if EFDEBUG - printf(" dlon_last1=%.10e > lon_last=%.10e\n",dlon_last,lon_first ); + printf(" dlon_last1=%.10e > lon_last=%.10e\n", dlon_last, lon_first); #endif } /* if neither of the two are triggered then npoints is too large */ - if (!ok) {(*npoints)--; + if (!ok) { + (*npoints)--; #if EFDEBUG - printf(" (*npoints)--=%ld\n",*npoints); + printf(" (*npoints)--=%ld\n", *npoints); #endif } } @@ -380,28 +402,31 @@ void grib_get_reduced_row_legacy(long pl, double lon_first, double lon_last, lon /*Assert(*npoints==irange);*/ #if EFDEBUG printf("-- pl=%ld npoints=%ld range=%.10e ilon_first=%ld ilon_last=%ld irange=%ld\n", - pl,*npoints,range,*ilon_first,*ilon_last,irange); + pl, *npoints, range, *ilon_first, *ilon_last, irange); #endif - } else { + } + else { /* checking if the first point is out of range*/ - dlon_first=((*ilon_first)*360.0)/pl; + dlon_first = ((*ilon_first) * 360.0) / pl; if (dlon_first < lon_first) { - (*ilon_first)++;(*ilon_last)++; + (*ilon_first)++; + (*ilon_last)++; #if EFDEBUG - printf(" ---> dlon_first=%.10e < lon_first=%.10e\n",dlon_first,lon_first ); + printf(" ---> dlon_first=%.10e < lon_first=%.10e\n", dlon_first, lon_first); printf("-- pl=%ld npoints=%ld range=%.10e ilon_first=%ld ilon_last=%ld irange=%ld\n", - pl,*npoints,range,*ilon_first,*ilon_last,irange); + pl, *npoints, range, *ilon_first, *ilon_last, irange); #endif } } - if (*ilon_first<0) *ilon_first+=pl; + if (*ilon_first < 0) + *ilon_first += pl; return; } /* New method based on eckit Fractions and matching MIR count */ -void grib_get_reduced_row(long pl, double lon_first, double lon_last, long* npoints, long* ilon_first, long* ilon_last ) +void grib_get_reduced_row(long pl, double lon_first, double lon_last, long* npoints, long* ilon_first, long* ilon_last) { long long Ni_globe = pl; Fraction_type west; @@ -409,24 +434,25 @@ void grib_get_reduced_row(long pl, double lon_first, double lon_last, long* npoi long long the_count; double the_lon1, the_lon2; - while (lon_last < lon_first) lon_last += 360; + while (lon_last < lon_first) + lon_last += 360; west = fraction_construct_from_double(lon_first); east = fraction_construct_from_double(lon_last); gaussian_reduced_row( - Ni_globe, /*plj*/ - west, /*lon_first*/ - east, /*lon_last*/ - &the_count, - &the_lon1, - &the_lon2); + Ni_globe, /*plj*/ + west, /*lon_first*/ + east, /*lon_last*/ + &the_count, + &the_lon1, + &the_lon2); *npoints = (long)the_count; - *ilon_first = (the_lon1*pl)/360.0; - *ilon_last = (the_lon2*pl)/360.0; + *ilon_first = (the_lon1 * pl) / 360.0; + *ilon_last = (the_lon2 * pl) / 360.0; } /* This version returns the actual first and last longitudes rather than indexes */ -void grib_get_reduced_row_p(long pl, double lon_first, double lon_last, long *npoints, double *olon_first, double *olon_last) +void grib_get_reduced_row_p(long pl, double lon_first, double lon_last, long* npoints, double* olon_first, double* olon_last) { long long Ni_globe = pl; Fraction_type west; @@ -434,17 +460,18 @@ void grib_get_reduced_row_p(long pl, double lon_first, double lon_last, long *np long long the_count; double the_lon1, the_lon2; - while (lon_last < lon_first) lon_last += 360; + while (lon_last < lon_first) + lon_last += 360; west = fraction_construct_from_double(lon_first); east = fraction_construct_from_double(lon_last); gaussian_reduced_row( - Ni_globe, /*plj*/ - west, /*lon_first*/ - east, /*lon_last*/ - &the_count, - &the_lon1, - &the_lon2); + Ni_globe, /*plj*/ + west, /*lon_first*/ + east, /*lon_last*/ + &the_count, + &the_lon1, + &the_lon2); *npoints = (long)the_count; *olon_first = the_lon1; *olon_last = the_lon2; diff --git a/src/grib_geography.c b/src/grib_geography.c index 84155de05..e373f1f56 100644 --- a/src/grib_geography.c +++ b/src/grib_geography.c @@ -16,17 +16,17 @@ #include -#define NUMBER(x) (sizeof(x)/sizeof(x[0])) -#define MAXITER 10 +#define NUMBER(x) (sizeof(x) / sizeof(x[0])) +#define MAXITER 10 -#define RAD2DEG 57.29577951308232087684 /* 180 over pi */ -#define DEG2RAD 0.01745329251994329576 /* pi over 180 */ +#define RAD2DEG 57.29577951308232087684 /* 180 over pi */ +#define DEG2RAD 0.01745329251994329576 /* pi over 180 */ #ifndef MAX -#define MAX(a,b) (((a)>(b))?(a):(b)) +#define MAX(a, b) (((a) > (b)) ? (a) : (b)) #endif #ifndef MIN -#define MIN(a,b) (((a)<(b))?(a):(b)) +#define MIN(a, b) (((a) < (b)) ? (a) : (b)) #endif #ifndef M_PI @@ -36,111 +36,141 @@ static void gauss_first_guess(long trunc, double* vals) { - long i = 0, numVals; - static double gvals[] = { 2.4048255577E0, 5.5200781103E0, - 8.6537279129E0, 11.7915344391E0, 14.9309177086E0, - 18.0710639679E0, 21.2116366299E0, 24.3524715308E0, - 27.4934791320E0, 30.6346064684E0, 33.7758202136E0, - 36.9170983537E0, 40.0584257646E0, 43.1997917132E0, - 46.3411883717E0, 49.4826098974E0, 52.6240518411E0, - 55.7655107550E0, 58.9069839261E0, 62.0484691902E0, - 65.1899648002E0, 68.3314693299E0, 71.4729816036E0, - 74.6145006437E0, 77.7560256304E0, 80.8975558711E0, - 84.0390907769E0, 87.1806298436E0, 90.3221726372E0, - 93.4637187819E0, 96.6052679510E0, 99.7468198587E0, - 102.8883742542E0, 106.0299309165E0, 109.1714896498E0, - 112.3130502805E0, 115.4546126537E0, 118.5961766309E0, - 121.7377420880E0, 124.8793089132E0, 128.0208770059E0, - 131.1624462752E0, 134.3040166383E0, 137.4455880203E0, - 140.5871603528E0, 143.7287335737E0, 146.8703076258E0, - 150.0118824570E0, 153.1534580192E0, 156.2950342685E0, }; + long i = 0, numVals; + static double gvals[] = { + 2.4048255577E0, + 5.5200781103E0, + 8.6537279129E0, + 11.7915344391E0, + 14.9309177086E0, + 18.0710639679E0, + 21.2116366299E0, + 24.3524715308E0, + 27.4934791320E0, + 30.6346064684E0, + 33.7758202136E0, + 36.9170983537E0, + 40.0584257646E0, + 43.1997917132E0, + 46.3411883717E0, + 49.4826098974E0, + 52.6240518411E0, + 55.7655107550E0, + 58.9069839261E0, + 62.0484691902E0, + 65.1899648002E0, + 68.3314693299E0, + 71.4729816036E0, + 74.6145006437E0, + 77.7560256304E0, + 80.8975558711E0, + 84.0390907769E0, + 87.1806298436E0, + 90.3221726372E0, + 93.4637187819E0, + 96.6052679510E0, + 99.7468198587E0, + 102.8883742542E0, + 106.0299309165E0, + 109.1714896498E0, + 112.3130502805E0, + 115.4546126537E0, + 118.5961766309E0, + 121.7377420880E0, + 124.8793089132E0, + 128.0208770059E0, + 131.1624462752E0, + 134.3040166383E0, + 137.4455880203E0, + 140.5871603528E0, + 143.7287335737E0, + 146.8703076258E0, + 150.0118824570E0, + 153.1534580192E0, + 156.2950342685E0, + }; numVals = NUMBER(gvals); - for( i = 0; i < trunc; i++) - { - if(i < numVals) + for (i = 0; i < trunc; i++) { + if (i < numVals) vals[i] = gvals[i]; else - vals[i] = vals[i-1] + M_PI; + vals[i] = vals[i - 1] + M_PI; } } /* 'trunc' is the Gaussian number (or order) */ /* i.e. Number of parallels between a pole and the equator */ -int grib_get_gaussian_latitudes(long trunc, double *lats) +int grib_get_gaussian_latitudes(long trunc, double* lats) { long jlat, iter, legi; double rad2deg, convval, root, legfonc = 0; double mem1, mem2, conv; - double denom = 0.0; + double denom = 0.0; double precision = 1.0E-14; - long nlat = trunc*2; + long nlat = trunc * 2; - rad2deg = 180.0/M_PI; + rad2deg = 180.0 / M_PI; - convval = (1.0 - ((2.0 / M_PI)*(2.0 / M_PI)) * 0.25); + convval = (1.0 - ((2.0 / M_PI) * (2.0 / M_PI)) * 0.25); gauss_first_guess(trunc, lats); - denom = sqrt( ((((double)nlat)+0.5)*(((double)nlat)+0.5)) + convval ); + denom = sqrt(((((double)nlat) + 0.5) * (((double)nlat) + 0.5)) + convval); - for (jlat = 0; jlat < trunc; jlat++) - { + for (jlat = 0; jlat < trunc; jlat++) { /* First approximation for root */ - root = cos( lats[jlat] / denom ); + root = cos(lats[jlat] / denom); /* Perform loop of Newton iterations */ iter = 0; conv = 1; - while(fabs(conv) >= precision ) - { + while (fabs(conv) >= precision) { mem2 = 1.0; mem1 = root; /* Compute Legendre polynomial */ - for(legi = 0; legi < nlat; legi++) - { - legfonc = ( (2.0 * (legi+1) - 1.0) * root * mem1 - legi * mem2) / ((double)(legi+1)); - mem2 = mem1; - mem1 = legfonc; + for (legi = 0; legi < nlat; legi++) { + legfonc = ((2.0 * (legi + 1) - 1.0) * root * mem1 - legi * mem2) / ((double)(legi + 1)); + mem2 = mem1; + mem1 = legfonc; } /* Perform Newton iteration */ - conv = legfonc / ((((double)nlat) * (mem2 - root * legfonc) ) / (1.0 - (root *root))); + conv = legfonc / ((((double)nlat) * (mem2 - root * legfonc)) / (1.0 - (root * root))); root -= conv; /* Routine fails if no convergence after MAXITER iterations */ - if( iter++ > MAXITER ) - { + if (iter++ > MAXITER) { return GRIB_GEOCALCULUS_PROBLEM; } } /* Set North and South values using symmetry */ - lats[jlat] = asin(root) * rad2deg; - lats[nlat-1-jlat] = -lats[jlat]; + lats[jlat] = asin(root) * rad2deg; + lats[nlat - 1 - jlat] = -lats[jlat]; } - if( nlat != (trunc*2) ) + if (nlat != (trunc * 2)) lats[trunc + 1] = 0.0; return GRIB_SUCCESS; } /* Boolean return type: 1 if the reduced gaussian field is global, 0 for sub area */ int is_gaussian_global( - double lat1, double lat2, double lon1, double lon2,/* bounding box*/ - long num_points_equator, /* num points on latitude at equator */ - const double* latitudes, /* array of Gaussian latitudes (size 2*N) */ - double angular_precision /* tolerance for angle comparison */ + double lat1, double lat2, double lon1, double lon2, /* bounding box*/ + long num_points_equator, /* num points on latitude at equator */ + const double* latitudes, /* array of Gaussian latitudes (size 2*N) */ + double angular_precision /* tolerance for angle comparison */ ) { - int global = 1; - const double d = fabs(latitudes[0] - latitudes[1]); - const double delta = 360.0/num_points_equator; + int global = 1; + const double d = fabs(latitudes[0] - latitudes[1]); + const double delta = 360.0 / num_points_equator; /* Compute the expected last longitude for a global field */ const double lon2_global = 360.0 - delta; /* Compute difference between expected longitude and actual one */ - const double lon2_diff = fabs( lon2 - lon2_global ) - delta; + const double lon2_diff = fabs(lon2 - lon2_global) - delta; /* { @@ -153,12 +183,10 @@ int is_gaussian_global( */ /* Note: final gaussian latitude = -first latitude */ - if ( (fabs(lat1 - latitudes[0]) >= d ) || - (fabs(lat2 + latitudes[0]) >= d ) || - lon1 != 0 || - lon2_diff > angular_precision - ) - { + if ((fabs(lat1 - latitudes[0]) >= d) || + (fabs(lat2 + latitudes[0]) >= d) || + lon1 != 0 || + lon2_diff > angular_precision) { global = 0; /* sub area */ } return global; @@ -177,7 +205,7 @@ void rotate(const double inlat, const double inlon, const double ZCXMXC = cos(ZXMXC); const double ZSYREG = sin(DEG2RAD * inlat); const double ZCYREG = cos(DEG2RAD * inlat); - double ZSYROT = ZCYCEN * ZSYREG - ZSYCEN * ZCYREG * ZCXMXC; + double ZSYROT = ZCYCEN * ZSYREG - ZSYCEN * ZCYREG * ZCXMXC; ZSYROT = MAX(MIN(ZSYROT, +1.0), -1.0); @@ -207,9 +235,9 @@ void unrotate(const double inlat, const double inlon, /* First convert the data point from spherical lat lon to (x',y',z') */ double latr = lat_y * DEG2RAD; double lonr = lon_x * DEG2RAD; - double xd = cos(lonr)*cos(latr); - double yd = sin(lonr)*cos(latr); - double zd = sin(latr); + double xd = cos(lonr) * cos(latr); + double yd = sin(lonr) * cos(latr); + double zd = sin(latr); double t = -(90.0 + southPoleLat); double o = -southPoleLon; @@ -219,24 +247,26 @@ void unrotate(const double inlat, const double inlon, double sin_o = sin(DEG2RAD * o); double cos_o = cos(DEG2RAD * o); - double x = cos_t*cos_o*xd + sin_o*yd + sin_t*cos_o*zd; - double y = -cos_t*sin_o*xd + cos_o*yd - sin_t*sin_o*zd; - double z = -sin_t*xd + cos_t*zd; + double x = cos_t * cos_o * xd + sin_o * yd + sin_t * cos_o * zd; + double y = -cos_t * sin_o * xd + cos_o * yd - sin_t * sin_o * zd; + double z = -sin_t * xd + cos_t * zd; - double ret_lat=0, ret_lon=0; + double ret_lat = 0, ret_lon = 0; /* Then convert back to 'normal' (lat,lon) * Uses arcsin, to convert back to degrees, put in range -1 to 1 in case of slight rounding error * avoid error on calculating e.g. asin(1.00000001) */ - if (z > 1.0) z = 1.0; - if (z < -1.0) z = -1.0; + if (z > 1.0) + z = 1.0; + if (z < -1.0) + z = -1.0; ret_lat = asin(z) * RAD2DEG; ret_lon = atan2(y, x) * RAD2DEG; /* Still get a very small rounding error, round to 6 decimal places */ - ret_lat = roundf( ret_lat * 1000000.0 )/1000000.0; - ret_lon = roundf( ret_lon * 1000000.0 )/1000000.0; + ret_lat = roundf(ret_lat * 1000000.0) / 1000000.0; + ret_lon = roundf(ret_lon * 1000000.0) / 1000000.0; ret_lon -= angleOfRot; diff --git a/src/grib_handle.c b/src/grib_handle.c index c13a1ec6b..40c7227fe 100644 --- a/src/grib_handle.c +++ b/src/grib_handle.c @@ -46,48 +46,52 @@ } #endif -static grib_handle* grib_handle_new_from_file_no_multi ( grib_context* c, FILE* f,int headers_only,int *error ); -static grib_handle* grib_handle_new_from_file_multi ( grib_context* c, FILE* f,int *error ); -static int grib2_get_next_section ( unsigned char* msgbegin,size_t msglen,unsigned char** secbegin,size_t* seclen,int* secnum,int* err ); -static int grib2_has_next_section ( unsigned char* msgbegin,size_t msglen,unsigned char* secbegin,size_t seclen,int* err ); -static void grib2_build_message ( grib_context* context,unsigned char* sections[],size_t sections_len[],void** data,size_t* msglen ); -static grib_multi_support* grib_get_multi_support ( grib_context* c, FILE* f ); -static grib_multi_support* grib_multi_support_new ( grib_context* c ); -static grib_handle* grib_handle_new_multi ( grib_context* c,unsigned char** idata, size_t *buflen,int* error ); +static grib_handle* grib_handle_new_from_file_no_multi(grib_context* c, FILE* f, int headers_only, int* error); +static grib_handle* grib_handle_new_from_file_multi(grib_context* c, FILE* f, int* error); +static int grib2_get_next_section(unsigned char* msgbegin, size_t msglen, unsigned char** secbegin, size_t* seclen, int* secnum, int* err); +static int grib2_has_next_section(unsigned char* msgbegin, size_t msglen, unsigned char* secbegin, size_t seclen, int* err); +static void grib2_build_message(grib_context* context, unsigned char* sections[], size_t sections_len[], void** data, size_t* msglen); +static grib_multi_support* grib_get_multi_support(grib_context* c, FILE* f); +static grib_multi_support* grib_multi_support_new(grib_context* c); +static grib_handle* grib_handle_new_multi(grib_context* c, unsigned char** idata, size_t* buflen, int* error); /* Note: A fast cut-down version of strcmp which does NOT return -1 */ /* 0 means input strings are equal and 1 means not equal */ -static GRIB_INLINE int grib_inline_strcmp(const char* a,const char* b) +static GRIB_INLINE int grib_inline_strcmp(const char* a, const char* b) { - if (*a != *b) return 1; - while((*a!=0 && *b!=0) && *(a) == *(b) ) {a++;b++;} - return (*a==0 && *b==0) ? 0 : 1; + if (*a != *b) + return 1; + while ((*a != 0 && *b != 0) && *(a) == *(b)) { + a++; + b++; + } + return (*a == 0 && *b == 0) ? 0 : 1; } -grib_section* grib_section_create ( grib_handle* h,grib_accessor* owner ) +grib_section* grib_section_create(grib_handle* h, grib_accessor* owner) { - grib_section* s = ( grib_section* ) grib_context_malloc_clear ( h->context,sizeof ( grib_section ) ); - s->owner = owner; - s->aclength = NULL; - s->h = h; - s->block = ( grib_block_of_accessors* ) grib_context_malloc_clear ( h->context, sizeof ( grib_block_of_accessors ) ); + grib_section* s = (grib_section*)grib_context_malloc_clear(h->context, sizeof(grib_section)); + s->owner = owner; + s->aclength = NULL; + s->h = h; + s->block = (grib_block_of_accessors*)grib_context_malloc_clear(h->context, sizeof(grib_block_of_accessors)); return s; } -static void update_sections ( grib_section *s,grib_handle* h,long offset ) +static void update_sections(grib_section* s, grib_handle* h, long offset) { - grib_accessor *a = s?s->block->first:NULL; - if ( s ) s->h = h; - while ( a ) - { + grib_accessor* a = s ? s->block->first : NULL; + if (s) + s->h = h; + while (a) { a->offset += offset; /* update_sections ( grib_get_sub_section ( a ),h,offset ); */ - update_sections ( a->sub_section,h,offset ); + update_sections(a->sub_section, h, offset); a = a->next; } } -void grib_swap_sections ( grib_section* the_old, grib_section *the_new ) +void grib_swap_sections(grib_section* the_old, grib_section* the_new) { grib_accessor* a; grib_block_of_accessors* b = the_old->block; @@ -96,165 +100,160 @@ void grib_swap_sections ( grib_section* the_old, grib_section *the_new ) the_old->block = the_new->block; the_new->block = b; - a = the_old->aclength; + a = the_old->aclength; the_old->aclength = the_new->aclength; the_new->aclength = a; a = the_old->block->first; - while ( a ) - { + while (a) { a->parent = the_old; - a = a->next; + a = a->next; } - update_sections ( the_old, the_old->h, the_old->owner->offset ); + update_sections(the_old, the_old->h, the_old->owner->offset); /* update_sections(new,new->h,new->owner->offset); */ /* printf("SWAPPING -----\n"); grib_dump_section_content(old,stdout); */ - } -void grib_empty_section ( grib_context *c,grib_section* b ) +void grib_empty_section(grib_context* c, grib_section* b) { grib_accessor* current = NULL; - if ( !b ) return; + if (!b) + return; b->aclength = NULL; current = b->block->first; - while ( current ) - { + while (current) { grib_accessor* next = current->next; if (current->sub_section) { - grib_section_delete(c,current->sub_section); - current->sub_section=0; + grib_section_delete(c, current->sub_section); + current->sub_section = 0; } - grib_accessor_delete ( c,current ); + grib_accessor_delete(c, current); current = next; } b->block->first = b->block->last = 0; } -void grib_section_delete ( grib_context *c, grib_section* b ) +void grib_section_delete(grib_context* c, grib_section* b) { - if ( !b ) return; + if (!b) + return; - grib_empty_section ( c,b ); - grib_context_free ( c,b->block ); + grib_empty_section(c, b); + grib_context_free(c, b->block); /* printf("++++ deleted %p\n",b); */ - grib_context_free ( c,b ); + grib_context_free(c, b); } -int grib_handle_delete ( grib_handle* h ) +int grib_handle_delete(grib_handle* h) { - if ( h != NULL ) - { - grib_context *ct =h->context; - grib_dependency *d = h->dependencies; - grib_dependency *n; + if (h != NULL) { + grib_context* ct = h->context; + grib_dependency* d = h->dependencies; + grib_dependency* n; - if ( h->kid != NULL ) + if (h->kid != NULL) return GRIB_INTERNAL_ERROR; - while ( d ) - { + while (d) { n = d->next; - grib_context_free ( ct,d ); + grib_context_free(ct, d); d = n; } - h->dependencies=0; + h->dependencies = 0; - grib_buffer_delete ( ct,h->buffer ); - grib_section_delete ( ct,h->root ); + grib_buffer_delete(ct, h->buffer); + grib_section_delete(ct, h->root); - grib_context_log ( ct,GRIB_LOG_DEBUG,"grib_handle_delete: deleting handle %p",h ); - grib_context_free ( ct,h ); - h=NULL; + grib_context_log(ct, GRIB_LOG_DEBUG, "grib_handle_delete: deleting handle %p", h); + grib_context_free(ct, h); + h = NULL; } return GRIB_SUCCESS; } -grib_handle* grib_new_handle ( grib_context* c ) +grib_handle* grib_new_handle(grib_context* c) { - grib_handle *g = NULL; - if ( c == NULL ) c = grib_context_get_default(); - g = ( grib_handle* ) grib_context_malloc_clear ( c,sizeof ( grib_handle ) ); - - if ( g == NULL ) { - grib_context_log ( c,GRIB_LOG_ERROR,"grib_new_handle: cannot allocate handle" ); - } else { - g->context = c; + grib_handle* g = NULL; + if (c == NULL) + c = grib_context_get_default(); + g = (grib_handle*)grib_context_malloc_clear(c, sizeof(grib_handle)); + + if (g == NULL) { + grib_context_log(c, GRIB_LOG_ERROR, "grib_new_handle: cannot allocate handle"); + } + else { + g->context = c; g->product_kind = PRODUCT_ANY; /* Default. Will later be set to a specific product */ } - grib_context_log ( c,GRIB_LOG_DEBUG,"grib_new_handle: allocated handle %p",g ); + grib_context_log(c, GRIB_LOG_DEBUG, "grib_new_handle: allocated handle %p", g); return g; } -static grib_handle* grib_handle_create ( grib_handle *gl, grib_context* c, const void* data, size_t buflen ) +static grib_handle* grib_handle_create(grib_handle* gl, grib_context* c, const void* data, size_t buflen) { grib_action* next = NULL; - int err = 0; + int err = 0; - if ( gl == NULL ) + if (gl == NULL) return NULL; - gl->use_trie = 1; - gl->trie_invalid=0; - gl->buffer = grib_new_buffer ( gl->context, (const unsigned char*)data, buflen ); + gl->use_trie = 1; + gl->trie_invalid = 0; + gl->buffer = grib_new_buffer(gl->context, (const unsigned char*)data, buflen); - if ( gl->buffer == NULL ) - { - grib_handle_delete ( gl ); + if (gl->buffer == NULL) { + grib_handle_delete(gl); return NULL; } - gl->root = grib_create_root_section ( gl->context,gl ); + gl->root = grib_create_root_section(gl->context, gl); - if ( !gl->root ) - { - grib_context_log ( c, GRIB_LOG_ERROR, "grib_handle_create: cannot create root section" ); - grib_handle_delete ( gl ); + if (!gl->root) { + grib_context_log(c, GRIB_LOG_ERROR, "grib_handle_create: cannot create root section"); + grib_handle_delete(gl); return NULL; } - if ( !gl->context->grib_reader || !gl->context->grib_reader->first ) - { - grib_context_log ( c, GRIB_LOG_ERROR, "grib_handle_create: cannot create handle, no definitions found" ); - grib_handle_delete ( gl ); + if (!gl->context->grib_reader || !gl->context->grib_reader->first) { + grib_context_log(c, GRIB_LOG_ERROR, "grib_handle_create: cannot create handle, no definitions found"); + grib_handle_delete(gl); return NULL; } gl->buffer->property = GRIB_USER_BUFFER; next = gl->context->grib_reader->first->root; - while ( next ) - { - if ( grib_create_accessor ( gl->root, next, NULL ) != GRIB_SUCCESS ) + while (next) { + if (grib_create_accessor(gl->root, next, NULL) != GRIB_SUCCESS) break; next = next->next; } - err = grib_section_adjust_sizes ( gl->root,0,0 ); - if (err) - { - grib_handle_delete ( gl ); + err = grib_section_adjust_sizes(gl->root, 0, 0); + if (err) { + grib_handle_delete(gl); return NULL; } - grib_section_post_init ( gl->root ); + grib_section_post_init(gl->root); return gl; } -grib_handle* grib_handle_new_from_samples( grib_context* c, const char* name ) +grib_handle* grib_handle_new_from_samples(grib_context* c, const char* name) { grib_handle* g = 0; - if ( c == NULL ) c = grib_context_get_default(); - grib_context_set_handle_file_count(c,0); - grib_context_set_handle_total_count(c,0); + if (c == NULL) + c = grib_context_get_default(); + grib_context_set_handle_file_count(c, 0); + grib_context_set_handle_total_count(c, 0); /* * g = grib_internal_sample(c,name); @@ -264,20 +263,21 @@ grib_handle* grib_handle_new_from_samples( grib_context* c, const char* name ) fprintf(stderr, "ECCODES DEBUG: grib_handle_new_from_samples '%s'\n", name); } - g = grib_external_template( c,name ); - if ( !g ) - grib_context_log ( c,GRIB_LOG_ERROR,"Unable to load sample file %s.tmpl\n in %s", - name, c->grib_samples_path ); + g = grib_external_template(c, name); + if (!g) + grib_context_log(c, GRIB_LOG_ERROR, "Unable to load sample file %s.tmpl\n in %s", + name, c->grib_samples_path); return g; } -grib_handle* codes_bufr_handle_new_from_samples ( grib_context* c, const char* name ) +grib_handle* codes_bufr_handle_new_from_samples(grib_context* c, const char* name) { grib_handle* g = 0; - if ( c == NULL ) c = grib_context_get_default(); - grib_context_set_handle_file_count(c,0); - grib_context_set_handle_total_count(c,0); + if (c == NULL) + c = grib_context_get_default(); + grib_context_set_handle_file_count(c, 0); + grib_context_set_handle_total_count(c, 0); /* * g = grib_internal_sample(c,name); @@ -287,32 +287,33 @@ grib_handle* codes_bufr_handle_new_from_samples ( grib_context* c, const char* n fprintf(stderr, "ECCODES DEBUG: grib_handle_new_from_samples '%s'\n", name); } - g=bufr_external_template ( c,name ); - if ( !g ) - grib_context_log ( c,GRIB_LOG_ERROR,"Unable to load sample file %s.tmpl\n in %s", - name, c->grib_samples_path ); + g = bufr_external_template(c, name); + if (!g) + grib_context_log(c, GRIB_LOG_ERROR, "Unable to load sample file %s.tmpl\n in %s", + name, c->grib_samples_path); return g; } -int grib_write_message(const grib_handle* h,const char* file,const char* mode) +int grib_write_message(const grib_handle* h, const char* file, const char* mode) { - FILE* fh=0; + FILE* fh = 0; int err; - const void *buffer; size_t size; + const void* buffer; + size_t size; - fh=fopen(file,mode); + fh = fopen(file, mode); if (!fh) { perror(file); return GRIB_IO_PROBLEM; } - err=grib_get_message(h,&buffer,&size); + err = grib_get_message(h, &buffer, &size); if (err) { fclose(fh); return err; } - if(fwrite(buffer,1,size,fh) != size) { + if (fwrite(buffer, 1, size, fh) != size) { perror(file); fclose(fh); return GRIB_IO_PROBLEM; @@ -326,7 +327,7 @@ int grib_write_message(const grib_handle* h,const char* file,const char* mode) grib_handle* grib_handle_clone(const grib_handle* h) { - grib_handle* result = grib_handle_new_from_message_copy(h->context, h->buffer->data, h->buffer->ulength ); + grib_handle* result = grib_handle_new_from_message_copy(h->context, h->buffer->data, h->buffer->ulength); result->product_kind = h->product_kind; return result; } @@ -367,82 +368,92 @@ grib_handle* codes_gts_handle_new_from_file(grib_context* c, FILE* f, int* error static int determine_product_kind(grib_handle* h, ProductKind* prod_kind) { - int err = 0; + int err = 0; size_t len = 0; - err = grib_get_length(h, "identifier", &len); + err = grib_get_length(h, "identifier", &len); if (!err) { - char id_str[64]={0,}; + char id_str[64] = {0,}; err = grib_get_string(h, "identifier", id_str, &len); - if (grib_inline_strcmp(id_str, "GRIB")==0) *prod_kind = PRODUCT_GRIB; - else if (grib_inline_strcmp(id_str, "BUFR")==0) *prod_kind = PRODUCT_BUFR; - else if (grib_inline_strcmp(id_str, "METAR")==0) *prod_kind = PRODUCT_METAR; - else if (grib_inline_strcmp(id_str, "GTS")==0) *prod_kind = PRODUCT_GTS; - else if (grib_inline_strcmp(id_str, "TAF")==0) *prod_kind = PRODUCT_TAF; - else *prod_kind = PRODUCT_ANY; + if (grib_inline_strcmp(id_str, "GRIB") == 0) + *prod_kind = PRODUCT_GRIB; + else if (grib_inline_strcmp(id_str, "BUFR") == 0) + *prod_kind = PRODUCT_BUFR; + else if (grib_inline_strcmp(id_str, "METAR") == 0) + *prod_kind = PRODUCT_METAR; + else if (grib_inline_strcmp(id_str, "GTS") == 0) + *prod_kind = PRODUCT_GTS; + else if (grib_inline_strcmp(id_str, "TAF") == 0) + *prod_kind = PRODUCT_TAF; + else + *prod_kind = PRODUCT_ANY; } return err; } -grib_handle* grib_handle_new_from_message_copy ( grib_context* c, const void* data, size_t size ) +grib_handle* grib_handle_new_from_message_copy(grib_context* c, const void* data, size_t size) { - grib_handle *g = NULL; - void* copy =NULL; - if ( c == NULL ) c = grib_context_get_default(); - - grib_context_set_handle_file_count(c,0); - grib_context_set_handle_total_count(c,0); - copy = grib_context_malloc ( c,size ); - if ( !copy ) { + grib_handle* g = NULL; + void* copy = NULL; + if (c == NULL) + c = grib_context_get_default(); + + grib_context_set_handle_file_count(c, 0); + grib_context_set_handle_total_count(c, 0); + copy = grib_context_malloc(c, size); + if (!copy) { return NULL; } - memcpy ( copy,data,size ); + memcpy(copy, data, size); - g = grib_handle_new_from_message ( c,copy, size ); + g = grib_handle_new_from_message(c, copy, size); g->buffer->property = GRIB_MY_BUFFER; return g; } -grib_handle* grib_handle_new_from_partial_message_copy ( grib_context* c, const void* data, size_t size ) +grib_handle* grib_handle_new_from_partial_message_copy(grib_context* c, const void* data, size_t size) { - grib_handle *g = NULL; - void* copy =NULL; - if ( c == NULL ) c = grib_context_get_default(); - grib_context_set_handle_file_count(c,0); - grib_context_set_handle_total_count(c,0); - copy = grib_context_malloc ( c,size ); - if ( !copy ) + grib_handle* g = NULL; + void* copy = NULL; + if (c == NULL) + c = grib_context_get_default(); + grib_context_set_handle_file_count(c, 0); + grib_context_set_handle_total_count(c, 0); + copy = grib_context_malloc(c, size); + if (!copy) return NULL; - memcpy ( copy,data,size ); + memcpy(copy, data, size); - g = grib_handle_new_from_partial_message ( c,copy, size ); + g = grib_handle_new_from_partial_message(c, copy, size); g->buffer->property = GRIB_MY_BUFFER; return g; } -grib_handle* grib_handle_new_from_partial_message ( grib_context* c, const void* data, size_t buflen ) +grib_handle* grib_handle_new_from_partial_message(grib_context* c, const void* data, size_t buflen) { - grib_handle *gl = NULL; - if ( c == NULL ) c = grib_context_get_default(); - grib_context_set_handle_file_count(c,0); - grib_context_set_handle_total_count(c,0); - gl = grib_new_handle ( c ); + grib_handle* gl = NULL; + if (c == NULL) + c = grib_context_get_default(); + grib_context_set_handle_file_count(c, 0); + grib_context_set_handle_total_count(c, 0); + gl = grib_new_handle(c); gl->partial = 1; - return grib_handle_create ( gl, c, data, buflen ); + return grib_handle_create(gl, c, data, buflen); } -grib_handle* grib_handle_new_from_message ( grib_context* c, const void* data, size_t buflen ) +grib_handle* grib_handle_new_from_message(grib_context* c, const void* data, size_t buflen) { - grib_handle *gl = NULL; - grib_handle *h = NULL; + grib_handle* gl = NULL; + grib_handle* h = NULL; ProductKind product_kind = PRODUCT_ANY; - if ( c == NULL ) c = grib_context_get_default(); - gl = grib_new_handle ( c ); + if (c == NULL) + c = grib_context_get_default(); + gl = grib_new_handle(c); gl->product_kind = PRODUCT_GRIB; /* See ECC-480 */ - h=grib_handle_create ( gl, c, data, buflen ); + h = grib_handle_create(gl, c, data, buflen); /* See ECC-448 */ if (determine_product_kind(h, &product_kind) == GRIB_SUCCESS) { @@ -450,8 +461,8 @@ grib_handle* grib_handle_new_from_message ( grib_context* c, const void* data, s } if (h->product_kind == PRODUCT_GRIB) { - if (!grib_is_defined(h,"7777")) { - grib_context_log (c,GRIB_LOG_ERROR,"grib_handle_new_from_message: No final 7777 in message!"); + if (!grib_is_defined(h, "7777")) { + grib_context_log(c, GRIB_LOG_ERROR, "grib_handle_new_from_message: No final 7777 in message!"); /* TODO: Return NULL. An incomplete message is no use to anyone. * But first check the MARS Client and other applications */ @@ -460,157 +471,144 @@ grib_handle* grib_handle_new_from_message ( grib_context* c, const void* data, s return h; } -grib_handle* grib_handle_new_from_multi_message ( grib_context* c,void** data, - size_t *buflen,int* error ) +grib_handle* grib_handle_new_from_multi_message(grib_context* c, void** data, + size_t* buflen, int* error) { - grib_handle *h = NULL; - unsigned char** d= ( unsigned char** ) data; - if ( c == NULL ) c = grib_context_get_default(); + grib_handle* h = NULL; + unsigned char** d = (unsigned char**)data; + if (c == NULL) + c = grib_context_get_default(); - if ( c->multi_support_on ) h=grib_handle_new_multi ( c,d, buflen,error ); - else - { - size_t olen=0; - void * message=NULL; - *error = grib_read_any_from_memory_alloc ( c, d,buflen,&message, &olen ); - if ( message==NULL ) return NULL; - h = grib_new_handle ( c ); - grib_handle_create ( h, c, message, olen ); + if (c->multi_support_on) + h = grib_handle_new_multi(c, d, buflen, error); + else { + size_t olen = 0; + void* message = NULL; + *error = grib_read_any_from_memory_alloc(c, d, buflen, &message, &olen); + if (message == NULL) + return NULL; + h = grib_new_handle(c); + grib_handle_create(h, c, message, olen); } return h; } -grib_handle* grib_handle_new_from_file ( grib_context* c, FILE* f,int *error ) +grib_handle* grib_handle_new_from_file(grib_context* c, FILE* f, int* error) { - return grib_new_from_file(c,f,0,error); + return grib_new_from_file(c, f, 0, error); } -static grib_handle* grib_handle_new_multi ( grib_context* c,unsigned char** data, - size_t *buflen,int* error ) +static grib_handle* grib_handle_new_multi(grib_context* c, unsigned char** data, + size_t* buflen, int* error) { - void * message=NULL; - size_t olen = 0,len=0; - grib_handle *gl = NULL; - long edition=0; - size_t seclen=0; - unsigned char* secbegin=0; - int secnum=0,seccount=0; - int err=0,i=0; - grib_multi_support* gm=NULL; + void* message = NULL; + size_t olen = 0, len = 0; + grib_handle* gl = NULL; + long edition = 0; + size_t seclen = 0; + unsigned char* secbegin = 0; + int secnum = 0, seccount = 0; + int err = 0, i = 0; + grib_multi_support* gm = NULL; - if ( c == NULL ) c = grib_context_get_default(); + if (c == NULL) + c = grib_context_get_default(); - gm=grib_get_multi_support ( c,0 ); + gm = grib_get_multi_support(c, 0); - if ( !gm->message ) - { - *error = grib_read_any_from_memory_alloc ( c, data,buflen,&message, &olen ); - gm->message_length=olen; - gm->message=(unsigned char*)message; - if ( *error != GRIB_SUCCESS || !message ) - { - if ( *error == GRIB_END_OF_FILE ) *error = GRIB_SUCCESS; + if (!gm->message) { + *error = grib_read_any_from_memory_alloc(c, data, buflen, &message, &olen); + gm->message_length = olen; + gm->message = (unsigned char*)message; + if (*error != GRIB_SUCCESS || !message) { + if (*error == GRIB_END_OF_FILE) + *error = GRIB_SUCCESS; gm->message_length = 0; return NULL; } } - else - { - message=gm->message; + else { + message = gm->message; } - edition=grib_decode_unsigned_byte_long ( (const unsigned char*)message,7,1 ); + edition = grib_decode_unsigned_byte_long((const unsigned char*)message, 7, 1); - if ( edition == 2 ) - { - olen=gm->message_length; - if ( gm->section_number == 0 ) - { - gm->sections[0]=(unsigned char*)message; + if (edition == 2) { + olen = gm->message_length; + if (gm->section_number == 0) { + gm->sections[0] = (unsigned char*)message; } - secbegin=gm->sections[gm->section_number]; - seclen=gm->sections_length[gm->section_number]; - secnum=gm->section_number; - seccount=0; - while ( grib2_get_next_section ( (unsigned char*)message,olen,&secbegin,&seclen,&secnum,&err ) ) - { + secbegin = gm->sections[gm->section_number]; + seclen = gm->sections_length[gm->section_number]; + secnum = gm->section_number; + seccount = 0; + while (grib2_get_next_section((unsigned char*)message, olen, &secbegin, &seclen, &secnum, &err)) { seccount++; /*printf(" - %d - section %d length=%d\n",(int)seccount,(int)secnum,(int)seclen);*/ - gm->sections[secnum]=secbegin; - gm->sections_length[secnum]=seclen; + gm->sections[secnum] = secbegin; + gm->sections_length[secnum] = seclen; - if ( secnum == 6 ) - { + if (secnum == 6) { /* Special case for inherited bitmaps */ - if ( grib_decode_unsigned_byte_long ( secbegin,5,1 ) == 254 ) - { - if ( !gm->bitmap_section ) - { - grib_context_log ( c, GRIB_LOG_ERROR, - "grib_handle_new_multi : cannot create handle, missing bitmap\n" ); + if (grib_decode_unsigned_byte_long(secbegin, 5, 1) == 254) { + if (!gm->bitmap_section) { + grib_context_log(c, GRIB_LOG_ERROR, + "grib_handle_new_multi : cannot create handle, missing bitmap\n"); return NULL; } - gm->sections[secnum]= gm->bitmap_section; - gm->sections_length[secnum]=gm->bitmap_section_length; + gm->sections[secnum] = gm->bitmap_section; + gm->sections_length[secnum] = gm->bitmap_section_length; } - else - { - if ( gm->bitmap_section ) - { - grib_context_free ( c,gm->bitmap_section ); - gm->bitmap_section=NULL; + else { + if (gm->bitmap_section) { + grib_context_free(c, gm->bitmap_section); + gm->bitmap_section = NULL; } - gm->bitmap_section = ( unsigned char* ) grib_context_malloc ( c,seclen ); - gm->bitmap_section = (unsigned char*)memcpy ( gm->bitmap_section,secbegin,seclen ); - gm->bitmap_section_length=seclen; + gm->bitmap_section = (unsigned char*)grib_context_malloc(c, seclen); + gm->bitmap_section = (unsigned char*)memcpy(gm->bitmap_section, secbegin, seclen); + gm->bitmap_section_length = seclen; } } - if ( secnum == 7 ) - { - void* p=message; - len=olen; - grib2_build_message ( c,gm->sections,gm->sections_length,&message,&len ); - - if ( grib2_has_next_section ( (unsigned char*)p,olen,secbegin,seclen,&err ) ) - { - gm->message=(unsigned char*)p; - gm->section_number=secnum; - olen=len; + if (secnum == 7) { + void* p = message; + len = olen; + grib2_build_message(c, gm->sections, gm->sections_length, &message, &len); + + if (grib2_has_next_section((unsigned char*)p, olen, secbegin, seclen, &err)) { + gm->message = (unsigned char*)p; + gm->section_number = secnum; + olen = len; } - else - { - grib_context_free ( c,gm->message ); - gm->message=NULL; - for ( i=0;i<8;i++ ) gm->sections[i]=NULL; - gm->section_number=0; - gm->message_length=0; - olen=len; + else { + grib_context_free(c, gm->message); + gm->message = NULL; + for (i = 0; i < 8; i++) + gm->sections[i] = NULL; + gm->section_number = 0; + gm->message_length = 0; + olen = len; } break; } } - } - else if (edition == 3) - { + else if (edition == 3) { *error = GRIB_UNSUPPORTED_EDITION; return NULL; } - else - { - gm->message_length=0; - gm->message=NULL; + else { + gm->message_length = 0; + gm->message = NULL; } - gl = grib_handle_new_from_message ( c, message, olen ); - if ( !gl ) - { + gl = grib_handle_new_from_message(c, message, olen); + if (!gl) { *error = GRIB_DECODING_ERROR; - grib_context_log ( c, GRIB_LOG_ERROR, "grib_handle_new_multi: cannot create handle \n" ); + grib_context_log(c, GRIB_LOG_ERROR, "grib_handle_new_multi: cannot create handle \n"); return NULL; } @@ -621,667 +619,687 @@ static grib_handle* grib_handle_new_multi ( grib_context* c,unsigned char** data return gl; } -static grib_handle* grib_handle_new_from_file_multi ( grib_context* c, FILE* f,int *error ) +static grib_handle* grib_handle_new_from_file_multi(grib_context* c, FILE* f, int* error) { - void* data = NULL,*old_data=NULL; - size_t olen = 0,len=0; - grib_handle *gl = NULL; - long edition=0; - size_t seclen=0; - unsigned char* secbegin=0; - int secnum=0,seccount=0; - int err=0,i=0; - grib_multi_support* gm=NULL; - off_t gts_header_offset=0; - off_t end_msg_offset=0,offset=0; - char *gts_header=0,*save_gts_header=0; - int gtslen=0; - - if ( c == NULL ) c = grib_context_get_default(); - - gm=grib_get_multi_support ( c,f ); - - if ( !gm->message ) - { - gts_header_offset=grib_context_tell( c,f); - data = wmo_read_grib_from_file_malloc ( f,0, &olen,&offset,error ); - end_msg_offset=grib_context_tell ( c,f ); - - gm->message_length=olen; - gm->message=(unsigned char*)data; - gm->offset=offset; - if ( *error != GRIB_SUCCESS || !data ) - { - if ( data ) grib_context_free ( c,data ); - - if ( *error == GRIB_END_OF_FILE ) *error = GRIB_SUCCESS; + void *data = NULL, *old_data = NULL; + size_t olen = 0, len = 0; + grib_handle* gl = NULL; + long edition = 0; + size_t seclen = 0; + unsigned char* secbegin = 0; + int secnum = 0, seccount = 0; + int err = 0, i = 0; + grib_multi_support* gm = NULL; + off_t gts_header_offset = 0; + off_t end_msg_offset = 0, offset = 0; + char *gts_header = 0, *save_gts_header = 0; + int gtslen = 0; + + if (c == NULL) + c = grib_context_get_default(); + + gm = grib_get_multi_support(c, f); + + if (!gm->message) { + gts_header_offset = grib_context_tell(c, f); + data = wmo_read_grib_from_file_malloc(f, 0, &olen, &offset, error); + end_msg_offset = grib_context_tell(c, f); + + gm->message_length = olen; + gm->message = (unsigned char*)data; + gm->offset = offset; + if (*error != GRIB_SUCCESS || !data) { + if (data) + grib_context_free(c, data); + + if (*error == GRIB_END_OF_FILE) + *error = GRIB_SUCCESS; gm->message_length = 0; - gm->message=NULL; + gm->message = NULL; return NULL; } - if ( c->gts_header_on ) - { - int g=0; - grib_context_seek ( c,gts_header_offset,SEEK_SET,f ); - gtslen=offset-gts_header_offset; - gts_header=(char*)grib_context_malloc_clear ( c,sizeof ( unsigned char ) *gtslen ); - save_gts_header=gts_header; - grib_context_read ( c,gts_header,gtslen,f ); - g=gtslen; - while ( gts_header!=NULL && g != 0 && *gts_header != '\03' ) - { + if (c->gts_header_on) { + int g = 0; + grib_context_seek(c, gts_header_offset, SEEK_SET, f); + gtslen = offset - gts_header_offset; + gts_header = (char*)grib_context_malloc_clear(c, sizeof(unsigned char) * gtslen); + save_gts_header = gts_header; + grib_context_read(c, gts_header, gtslen, f); + g = gtslen; + while (gts_header != NULL && g != 0 && *gts_header != '\03') { /*printf("--------%d %X \n",gtslen,*gts_header);*/ gts_header++; g--; } - if ( g>8 ) {gts_header++;gtslen=g-1;} - else gts_header=save_gts_header; - grib_context_seek ( c,end_msg_offset,SEEK_SET,f ); + if (g > 8) { + gts_header++; + gtslen = g - 1; + } + else + gts_header = save_gts_header; + grib_context_seek(c, end_msg_offset, SEEK_SET, f); } - } else - data=gm->message; + data = gm->message; - edition=grib_decode_unsigned_byte_long ( (const unsigned char*)data,7,1 ); + edition = grib_decode_unsigned_byte_long((const unsigned char*)data, 7, 1); - if ( edition == 2 ) - { - olen=gm->message_length; - if ( gm->section_number == 0 ) - { - gm->sections[0]=(unsigned char*)data; + if (edition == 2) { + olen = gm->message_length; + if (gm->section_number == 0) { + gm->sections[0] = (unsigned char*)data; } - secbegin=gm->sections[gm->section_number]; - seclen=gm->sections_length[gm->section_number]; - secnum=gm->section_number; - seccount=0; - while ( grib2_get_next_section ( (unsigned char*)data,olen,&secbegin,&seclen,&secnum,&err ) ) - { + secbegin = gm->sections[gm->section_number]; + seclen = gm->sections_length[gm->section_number]; + secnum = gm->section_number; + seccount = 0; + while (grib2_get_next_section((unsigned char*)data, olen, &secbegin, &seclen, &secnum, &err)) { seccount++; /*printf(" - %d - section %d length=%d\n",(int)seccount,(int)secnum,(int)seclen);*/ - gm->sections[secnum]=secbegin; - gm->sections_length[secnum]=seclen; + gm->sections[secnum] = secbegin; + gm->sections_length[secnum] = seclen; - if ( secnum == 6 ) - { + if (secnum == 6) { /* Special case for inherited bitmaps */ - if ( grib_decode_unsigned_byte_long ( secbegin,5,1 ) == 254 ) - { - if ( !gm->bitmap_section ) - { - grib_context_log ( c, GRIB_LOG_ERROR, "grib_handle_new_from_file_multi: cannot create handle, missing bitmap\n" ); - grib_context_free ( c,data ); + if (grib_decode_unsigned_byte_long(secbegin, 5, 1) == 254) { + if (!gm->bitmap_section) { + grib_context_log(c, GRIB_LOG_ERROR, "grib_handle_new_from_file_multi: cannot create handle, missing bitmap\n"); + grib_context_free(c, data); return NULL; } - gm->sections[secnum]= gm->bitmap_section; - gm->sections_length[secnum]=gm->bitmap_section_length; + gm->sections[secnum] = gm->bitmap_section; + gm->sections_length[secnum] = gm->bitmap_section_length; } - else - { - if ( gm->bitmap_section ) - { - grib_context_free ( c,gm->bitmap_section ); - gm->bitmap_section=NULL; + else { + if (gm->bitmap_section) { + grib_context_free(c, gm->bitmap_section); + gm->bitmap_section = NULL; } - gm->bitmap_section = ( unsigned char* ) grib_context_malloc ( c,seclen ); - gm->bitmap_section = (unsigned char*)memcpy ( gm->bitmap_section,secbegin,seclen ); - gm->bitmap_section_length=seclen; + gm->bitmap_section = (unsigned char*)grib_context_malloc(c, seclen); + gm->bitmap_section = (unsigned char*)memcpy(gm->bitmap_section, secbegin, seclen); + gm->bitmap_section_length = seclen; } } - if ( secnum == 7 ) - { - old_data=data; - len=olen; - grib2_build_message ( c,gm->sections,gm->sections_length,&data,&len ); - - if ( grib2_has_next_section ( (unsigned char*)old_data,olen,secbegin,seclen,&err ) ) - { - gm->message=(unsigned char*)old_data; - gm->section_number=secnum; - olen=len; + if (secnum == 7) { + old_data = data; + len = olen; + grib2_build_message(c, gm->sections, gm->sections_length, &data, &len); + + if (grib2_has_next_section((unsigned char*)old_data, olen, secbegin, seclen, &err)) { + gm->message = (unsigned char*)old_data; + gm->section_number = secnum; + olen = len; } - else - { - if ( gm->message ) grib_context_free ( c,gm->message ); - gm->message=NULL; - for ( i=0;i<8;i++ ) gm->sections[i]=NULL; - gm->section_number=0; - gm->message_length=0; - olen=len; + else { + if (gm->message) + grib_context_free(c, gm->message); + gm->message = NULL; + for (i = 0; i < 8; i++) + gm->sections[i] = NULL; + gm->section_number = 0; + gm->message_length = 0; + olen = len; } break; } } - } - else if (edition == 3) - { + else if (edition == 3) { /* GRIB3: Multi-field mode not yet supported */ printf("WARNING: %s\n", "grib_handle_new_from_file_multi: GRIB3 multi-field mode not yet implemented! Reverting to single-field mode"); - gm->message_length=0; - gm->message=NULL; + gm->message_length = 0; + gm->message = NULL; } - else - { - gm->message_length=0; - gm->message=NULL; + else { + gm->message_length = 0; + gm->message = NULL; } - gl = grib_handle_new_from_message ( c, data, olen ); - if ( !gl ) - { + gl = grib_handle_new_from_message(c, data, olen); + if (!gl) { *error = GRIB_DECODING_ERROR; - grib_context_log ( c, GRIB_LOG_ERROR, "grib_handle_new_from_file_multi: cannot create handle \n" ); - grib_context_free ( c,data ); + grib_context_log(c, GRIB_LOG_ERROR, "grib_handle_new_from_file_multi: cannot create handle \n"); + grib_context_free(c, data); return NULL; } - gl->offset=gm->offset; + gl->offset = gm->offset; gl->buffer->property = GRIB_MY_BUFFER; grib_context_increment_handle_file_count(c); grib_context_increment_handle_total_count(c); - if ( c->gts_header_on && gtslen >=8 ) - { - gl->gts_header=(char*)grib_context_malloc_clear ( c,sizeof ( unsigned char ) *gtslen ); - memcpy ( gl->gts_header,gts_header,gtslen ); - gl->gts_header_len=gtslen; - grib_context_free ( c,save_gts_header ); - gtslen=0; - } else { - gl->gts_header=NULL; + if (c->gts_header_on && gtslen >= 8) { + gl->gts_header = (char*)grib_context_malloc_clear(c, sizeof(unsigned char) * gtslen); + memcpy(gl->gts_header, gts_header, gtslen); + gl->gts_header_len = gtslen; + grib_context_free(c, save_gts_header); + gtslen = 0; + } + else { + gl->gts_header = NULL; } return gl; } -grib_handle* grib_new_from_file ( grib_context* c, FILE* f,int headers_only,int *error ) +grib_handle* grib_new_from_file(grib_context* c, FILE* f, int headers_only, int* error) { - grib_handle* h=0; - if (!f) {*error=GRIB_IO_PROBLEM; return NULL;} + grib_handle* h = 0; + if (!f) { + *error = GRIB_IO_PROBLEM; + return NULL; + } - if ( c == NULL ) c = grib_context_get_default(); + if (c == NULL) + c = grib_context_get_default(); - if ( c->multi_support_on ) h=grib_handle_new_from_file_multi ( c,f,error ); - else h=grib_handle_new_from_file_no_multi ( c,f,headers_only,error ); + if (c->multi_support_on) + h = grib_handle_new_from_file_multi(c, f, error); + else + h = grib_handle_new_from_file_no_multi(c, f, headers_only, error); - if ( h && h->offset == 0 ) grib_context_set_handle_file_count(c,1); + if (h && h->offset == 0) + grib_context_set_handle_file_count(c, 1); if (h) { h->product_kind = PRODUCT_GRIB; } - if ( !c->no_fail_on_wrong_length && *error == GRIB_WRONG_LENGTH ) - { - grib_handle_delete ( h ); - h=NULL; + if (!c->no_fail_on_wrong_length && *error == GRIB_WRONG_LENGTH) { + grib_handle_delete(h); + h = NULL; } return h; } -grib_handle* gts_new_from_file( grib_context* c, FILE* f,int *error ) +grib_handle* gts_new_from_file(grib_context* c, FILE* f, int* error) { - void *data = NULL; - size_t olen = 0; - grib_handle *gl = NULL; - off_t offset=0; + void* data = NULL; + size_t olen = 0; + grib_handle* gl = NULL; + off_t offset = 0; - if ( c == NULL ) c = grib_context_get_default(); + if (c == NULL) + c = grib_context_get_default(); - data = wmo_read_gts_from_file_malloc ( f, 0,&olen,&offset,error ); + data = wmo_read_gts_from_file_malloc(f, 0, &olen, &offset, error); - if ( *error != GRIB_SUCCESS ) - { - if ( data ) grib_context_free ( c,data ); + if (*error != GRIB_SUCCESS) { + if (data) + grib_context_free(c, data); - if ( *error == GRIB_END_OF_FILE ) *error = GRIB_SUCCESS; + if (*error == GRIB_END_OF_FILE) + *error = GRIB_SUCCESS; return NULL; } - gl = grib_handle_new_from_message ( c, data, olen ); + gl = grib_handle_new_from_message(c, data, olen); - if ( !gl ) - { + if (!gl) { *error = GRIB_DECODING_ERROR; - grib_context_log ( c, GRIB_LOG_ERROR, "gts_new_from_file: cannot create handle \n" ); - grib_context_free ( c,data ); + grib_context_log(c, GRIB_LOG_ERROR, "gts_new_from_file: cannot create handle \n"); + grib_context_free(c, data); return NULL; } - gl->offset=offset; + gl->offset = offset; gl->buffer->property = GRIB_MY_BUFFER; - gl->product_kind = PRODUCT_GTS; + gl->product_kind = PRODUCT_GTS; grib_context_increment_handle_file_count(c); grib_context_increment_handle_total_count(c); - if (gl->offset == 0) grib_context_set_handle_file_count(c,1); + if (gl->offset == 0) + grib_context_set_handle_file_count(c, 1); return gl; } -grib_handle* taf_new_from_file( grib_context* c, FILE* f,int *error ) +grib_handle* taf_new_from_file(grib_context* c, FILE* f, int* error) { - void *data = NULL; - size_t olen = 0; - grib_handle *gl = NULL; - off_t offset=0; + void* data = NULL; + size_t olen = 0; + grib_handle* gl = NULL; + off_t offset = 0; - if ( c == NULL ) c = grib_context_get_default(); + if (c == NULL) + c = grib_context_get_default(); - data = wmo_read_taf_from_file_malloc ( f, 0,&olen,&offset,error ); + data = wmo_read_taf_from_file_malloc(f, 0, &olen, &offset, error); - if ( *error != GRIB_SUCCESS ) - { - if ( data ) grib_context_free ( c,data ); + if (*error != GRIB_SUCCESS) { + if (data) + grib_context_free(c, data); - if ( *error == GRIB_END_OF_FILE ) *error = GRIB_SUCCESS; + if (*error == GRIB_END_OF_FILE) + *error = GRIB_SUCCESS; return NULL; } - gl = grib_handle_new_from_message ( c, data, olen ); + gl = grib_handle_new_from_message(c, data, olen); - if ( !gl ) - { + if (!gl) { *error = GRIB_DECODING_ERROR; - grib_context_log ( c, GRIB_LOG_ERROR, "taf_new_from_file: cannot create handle \n" ); - grib_context_free ( c,data ); + grib_context_log(c, GRIB_LOG_ERROR, "taf_new_from_file: cannot create handle \n"); + grib_context_free(c, data); return NULL; } - gl->offset=offset; + gl->offset = offset; gl->buffer->property = GRIB_MY_BUFFER; - gl->product_kind = PRODUCT_TAF; + gl->product_kind = PRODUCT_TAF; grib_context_increment_handle_file_count(c); grib_context_increment_handle_total_count(c); - if (gl->offset == 0) grib_context_set_handle_file_count(c,1); + if (gl->offset == 0) + grib_context_set_handle_file_count(c, 1); return gl; } -grib_handle* metar_new_from_file( grib_context* c, FILE* f,int *error ) +grib_handle* metar_new_from_file(grib_context* c, FILE* f, int* error) { - void *data = NULL; - size_t olen = 0; - grib_handle *gl = NULL; - off_t offset=0; + void* data = NULL; + size_t olen = 0; + grib_handle* gl = NULL; + off_t offset = 0; - if ( c == NULL ) c = grib_context_get_default(); + if (c == NULL) + c = grib_context_get_default(); - data = wmo_read_metar_from_file_malloc ( f, 0,&olen,&offset,error ); + data = wmo_read_metar_from_file_malloc(f, 0, &olen, &offset, error); - if ( *error != GRIB_SUCCESS ) - { - if ( data ) grib_context_free ( c,data ); + if (*error != GRIB_SUCCESS) { + if (data) + grib_context_free(c, data); - if ( *error == GRIB_END_OF_FILE ) *error = GRIB_SUCCESS; + if (*error == GRIB_END_OF_FILE) + *error = GRIB_SUCCESS; return NULL; } - gl = grib_handle_new_from_message ( c, data, olen ); + gl = grib_handle_new_from_message(c, data, olen); - if ( !gl ) - { + if (!gl) { *error = GRIB_DECODING_ERROR; - grib_context_log ( c, GRIB_LOG_ERROR, "metar_new_from_file: cannot create handle \n" ); - grib_context_free ( c,data ); + grib_context_log(c, GRIB_LOG_ERROR, "metar_new_from_file: cannot create handle \n"); + grib_context_free(c, data); return NULL; } - gl->offset=offset; + gl->offset = offset; gl->buffer->property = GRIB_MY_BUFFER; - gl->product_kind = PRODUCT_METAR; + gl->product_kind = PRODUCT_METAR; grib_context_increment_handle_file_count(c); grib_context_increment_handle_total_count(c); - if (gl->offset == 0) grib_context_set_handle_file_count(c,1); + if (gl->offset == 0) + grib_context_set_handle_file_count(c, 1); return gl; } -grib_handle* bufr_new_from_file( grib_context* c, FILE* f,int *error ) +grib_handle* bufr_new_from_file(grib_context* c, FILE* f, int* error) { - void *data = NULL; - size_t olen = 0; - grib_handle *gl = NULL; - off_t gts_header_offset=0; - off_t offset=0, end_msg_offset=0; - char *gts_header=0,*save_gts_header=0; - int gtslen=0; - - if ( c == NULL ) c = grib_context_get_default(); - - gts_header_offset=grib_context_tell( c,f); - data = wmo_read_bufr_from_file_malloc ( f, 0,&olen,&offset,error ); - end_msg_offset=grib_context_tell ( c,f ); - - if ( *error != GRIB_SUCCESS ) - { - if ( data ) grib_context_free ( c,data ); - - if ( *error == GRIB_END_OF_FILE ) *error = GRIB_SUCCESS; + void* data = NULL; + size_t olen = 0; + grib_handle* gl = NULL; + off_t gts_header_offset = 0; + off_t offset = 0, end_msg_offset = 0; + char *gts_header = 0, *save_gts_header = 0; + int gtslen = 0; + + if (c == NULL) + c = grib_context_get_default(); + + gts_header_offset = grib_context_tell(c, f); + data = wmo_read_bufr_from_file_malloc(f, 0, &olen, &offset, error); + end_msg_offset = grib_context_tell(c, f); + + if (*error != GRIB_SUCCESS) { + if (data) + grib_context_free(c, data); + + if (*error == GRIB_END_OF_FILE) + *error = GRIB_SUCCESS; return NULL; } - if ( c->gts_header_on ) - { - int g=0; - grib_context_seek ( c,gts_header_offset,SEEK_SET,f ); - gtslen=offset-gts_header_offset; - gts_header=(char*)grib_context_malloc ( c,sizeof ( unsigned char ) *gtslen ); - save_gts_header=gts_header; - grib_context_read ( c,gts_header,gtslen,f ); - g=gtslen; - while ( gts_header!=NULL && g != 0 && *gts_header != '\03' ) - { + if (c->gts_header_on) { + int g = 0; + grib_context_seek(c, gts_header_offset, SEEK_SET, f); + gtslen = offset - gts_header_offset; + gts_header = (char*)grib_context_malloc(c, sizeof(unsigned char) * gtslen); + save_gts_header = gts_header; + grib_context_read(c, gts_header, gtslen, f); + g = gtslen; + while (gts_header != NULL && g != 0 && *gts_header != '\03') { /*printf("--------%d %X \n",gtslen,*gts_header);*/ gts_header++; g--; } - if ( g>8 ) {gts_header++;gtslen=g-1;} - else gts_header=save_gts_header; - grib_context_seek ( c,end_msg_offset,SEEK_SET,f ); + if (g > 8) { + gts_header++; + gtslen = g - 1; + } + else + gts_header = save_gts_header; + grib_context_seek(c, end_msg_offset, SEEK_SET, f); } - gl = grib_handle_new_from_message ( c, data, olen ); + gl = grib_handle_new_from_message(c, data, olen); - if ( !gl ) - { + if (!gl) { *error = GRIB_DECODING_ERROR; - grib_context_log ( c, GRIB_LOG_ERROR, "bufr_new_from_file: cannot create handle \n" ); - grib_context_free ( c,data ); + grib_context_log(c, GRIB_LOG_ERROR, "bufr_new_from_file: cannot create handle \n"); + grib_context_free(c, data); return NULL; } - gl->offset=offset; + gl->offset = offset; gl->buffer->property = GRIB_MY_BUFFER; - gl->product_kind = PRODUCT_BUFR; + gl->product_kind = PRODUCT_BUFR; grib_context_increment_handle_file_count(c); grib_context_increment_handle_total_count(c); - if (gl->offset == 0) grib_context_set_handle_file_count(c,1); + if (gl->offset == 0) + grib_context_set_handle_file_count(c, 1); - if ( c->gts_header_on && gtslen >=8 ) - { - gl->gts_header=(char*)grib_context_malloc ( c,sizeof ( unsigned char ) *gtslen ); - memcpy ( gl->gts_header,gts_header,gtslen ); - gl->gts_header_len=gtslen; - grib_context_free ( c,save_gts_header ); - gtslen=0; - } else { - gl->gts_header=NULL; + if (c->gts_header_on && gtslen >= 8) { + gl->gts_header = (char*)grib_context_malloc(c, sizeof(unsigned char) * gtslen); + memcpy(gl->gts_header, gts_header, gtslen); + gl->gts_header_len = gtslen; + grib_context_free(c, save_gts_header); + gtslen = 0; + } + else { + gl->gts_header = NULL; } return gl; } -grib_handle* any_new_from_file( grib_context* c, FILE* f,int *error ) +grib_handle* any_new_from_file(grib_context* c, FILE* f, int* error) { - void *data = NULL; - size_t olen = 0; - grib_handle *gl = NULL; - off_t offset=0; + void* data = NULL; + size_t olen = 0; + grib_handle* gl = NULL; + off_t offset = 0; - if ( c == NULL ) c = grib_context_get_default(); + if (c == NULL) + c = grib_context_get_default(); - data = wmo_read_any_from_file_malloc ( f, 0,&olen,&offset,error ); + data = wmo_read_any_from_file_malloc(f, 0, &olen, &offset, error); - if ( *error != GRIB_SUCCESS ) - { - if ( data ) grib_context_free ( c,data ); + if (*error != GRIB_SUCCESS) { + if (data) + grib_context_free(c, data); - if ( *error == GRIB_END_OF_FILE ) *error = GRIB_SUCCESS; + if (*error == GRIB_END_OF_FILE) + *error = GRIB_SUCCESS; return NULL; } - gl = grib_handle_new_from_message ( c, data, olen ); + gl = grib_handle_new_from_message(c, data, olen); - if ( !gl ) - { + if (!gl) { *error = GRIB_DECODING_ERROR; - grib_context_log ( c, GRIB_LOG_ERROR, "any_new_from_file : cannot create handle\n" ); - grib_context_free ( c,data ); + grib_context_log(c, GRIB_LOG_ERROR, "any_new_from_file : cannot create handle\n"); + grib_context_free(c, data); return NULL; } - gl->offset=offset; + gl->offset = offset; gl->buffer->property = GRIB_MY_BUFFER; - gl->product_kind = PRODUCT_ANY; + gl->product_kind = PRODUCT_ANY; grib_context_increment_handle_file_count(c); grib_context_increment_handle_total_count(c); - if (gl->offset == 0) grib_context_set_handle_file_count(c,1); + if (gl->offset == 0) + grib_context_set_handle_file_count(c, 1); return gl; } -static grib_handle* grib_handle_new_from_file_no_multi ( grib_context* c,FILE* f,int headers_only,int *error ) +static grib_handle* grib_handle_new_from_file_no_multi(grib_context* c, FILE* f, int headers_only, int* error) { - void *data = NULL; - size_t olen = 0; - grib_handle *gl = NULL; - off_t gts_header_offset=0; - off_t offset=0,end_msg_offset=0; - char *gts_header=0,*save_gts_header=0; - int gtslen=0; - - if ( c == NULL ) c = grib_context_get_default(); - - gts_header_offset=grib_context_tell( c,f); - data = wmo_read_grib_from_file_malloc ( f, headers_only,&olen,&offset,error ); - end_msg_offset=grib_context_tell ( c,f ); - - if ( *error != GRIB_SUCCESS ) - { - if ( data ) grib_context_free ( c,data ); - - if ( *error == GRIB_END_OF_FILE ) *error = GRIB_SUCCESS; + void* data = NULL; + size_t olen = 0; + grib_handle* gl = NULL; + off_t gts_header_offset = 0; + off_t offset = 0, end_msg_offset = 0; + char *gts_header = 0, *save_gts_header = 0; + int gtslen = 0; + + if (c == NULL) + c = grib_context_get_default(); + + gts_header_offset = grib_context_tell(c, f); + data = wmo_read_grib_from_file_malloc(f, headers_only, &olen, &offset, error); + end_msg_offset = grib_context_tell(c, f); + + if (*error != GRIB_SUCCESS) { + if (data) + grib_context_free(c, data); + + if (*error == GRIB_END_OF_FILE) + *error = GRIB_SUCCESS; return NULL; } - if ( c->gts_header_on ) - { - int g=0; - grib_context_seek ( c,gts_header_offset,SEEK_SET,f ); - gtslen=offset-gts_header_offset; - gts_header=(char*)grib_context_malloc ( c,sizeof ( unsigned char ) *gtslen ); - save_gts_header=gts_header; - grib_context_read ( c,gts_header,gtslen,f ); - g=gtslen; - while ( gts_header!=NULL && g != 0 && *gts_header != '\03' ) - { + if (c->gts_header_on) { + int g = 0; + grib_context_seek(c, gts_header_offset, SEEK_SET, f); + gtslen = offset - gts_header_offset; + gts_header = (char*)grib_context_malloc(c, sizeof(unsigned char) * gtslen); + save_gts_header = gts_header; + grib_context_read(c, gts_header, gtslen, f); + g = gtslen; + while (gts_header != NULL && g != 0 && *gts_header != '\03') { /*printf("--------%d %X \n",gtslen,*gts_header);*/ gts_header++; g--; } - if ( g>8 ) {gts_header++;gtslen=g-1;} - else gts_header=save_gts_header; - grib_context_seek ( c,end_msg_offset,SEEK_SET,f ); + if (g > 8) { + gts_header++; + gtslen = g - 1; + } + else + gts_header = save_gts_header; + grib_context_seek(c, end_msg_offset, SEEK_SET, f); } if (headers_only) { - gl = grib_handle_new_from_partial_message ( c, data, olen ); - } else { - gl = grib_handle_new_from_message ( c, data, olen ); + gl = grib_handle_new_from_partial_message(c, data, olen); + } + else { + gl = grib_handle_new_from_message(c, data, olen); } - if ( !gl ) - { + if (!gl) { *error = GRIB_DECODING_ERROR; - grib_context_log ( c, GRIB_LOG_ERROR, "grib_handle_new_from_file_no_multi: cannot create handle\n" ); - grib_context_free ( c,data ); + grib_context_log(c, GRIB_LOG_ERROR, "grib_handle_new_from_file_no_multi: cannot create handle\n"); + grib_context_free(c, data); return NULL; } - gl->offset=offset; + gl->offset = offset; gl->buffer->property = GRIB_MY_BUFFER; grib_context_increment_handle_file_count(c); grib_context_increment_handle_total_count(c); - if ( c->gts_header_on && gtslen >=8 ) - { - gl->gts_header=(char*)grib_context_malloc ( c,sizeof ( unsigned char ) *gtslen ); - memcpy ( gl->gts_header,gts_header,gtslen ); - gl->gts_header_len=gtslen; - grib_context_free ( c,save_gts_header ); - gtslen=0; - } else { - gl->gts_header=NULL; + if (c->gts_header_on && gtslen >= 8) { + gl->gts_header = (char*)grib_context_malloc(c, sizeof(unsigned char) * gtslen); + memcpy(gl->gts_header, gts_header, gtslen); + gl->gts_header_len = gtslen; + grib_context_free(c, save_gts_header); + gtslen = 0; + } + else { + gl->gts_header = NULL; } return gl; } -grib_multi_handle* grib_multi_handle_new ( grib_context* c ) +grib_multi_handle* grib_multi_handle_new(grib_context* c) { grib_multi_handle* h; - if ( c==NULL ) c=grib_context_get_default(); - if ( !c->multi_support_on ) c->multi_support_on=1; - - h= ( grib_multi_handle* ) grib_context_malloc_clear ( c,sizeof ( grib_multi_handle ) ); - if ( h==NULL ) - { - grib_context_log ( c,GRIB_LOG_ERROR, - "grib_multi_handle_new: unable to allocate memory. %s", - grib_get_error_message ( GRIB_OUT_OF_MEMORY ) ); + if (c == NULL) + c = grib_context_get_default(); + if (!c->multi_support_on) + c->multi_support_on = 1; + + h = (grib_multi_handle*)grib_context_malloc_clear(c, sizeof(grib_multi_handle)); + if (h == NULL) { + grib_context_log(c, GRIB_LOG_ERROR, + "grib_multi_handle_new: unable to allocate memory. %s", + grib_get_error_message(GRIB_OUT_OF_MEMORY)); return NULL; } - h->buffer = grib_create_growable_buffer ( c ); - h->buffer->ulength=0; - h->context=c; + h->buffer = grib_create_growable_buffer(c); + h->buffer->ulength = 0; + h->context = c; return h; } -int grib_multi_handle_delete ( grib_multi_handle* h ) +int grib_multi_handle_delete(grib_multi_handle* h) { - if ( h==NULL ) return GRIB_SUCCESS; + if (h == NULL) + return GRIB_SUCCESS; - grib_buffer_delete ( h->context,h->buffer ); - grib_context_free ( h->context,h ); + grib_buffer_delete(h->context, h->buffer); + grib_context_free(h->context, h); return GRIB_SUCCESS; } -int grib_multi_handle_append ( grib_handle* h,int start_section,grib_multi_handle* mh ) +int grib_multi_handle_append(grib_handle* h, int start_section, grib_multi_handle* mh) { - const void* mess=NULL; - unsigned char* p=NULL; - int err=0; - size_t mess_len = 0; - size_t total_len=0; - - if ( !h ) return GRIB_NULL_HANDLE; - if ( !mh ) return GRIB_NULL_HANDLE; - - if ( start_section==0 || mh->buffer->ulength==0 ) - { - err=grib_get_message ( h,&mess,&mess_len ); - if ( err!=0 ) return err; - total_len=mh->buffer->ulength+mess_len; - - if ( total_len > mh->buffer->length ) - grib_grow_buffer ( h->context,mh->buffer,total_len ); + const void* mess = NULL; + unsigned char* p = NULL; + int err = 0; + size_t mess_len = 0; + size_t total_len = 0; + + if (!h) + return GRIB_NULL_HANDLE; + if (!mh) + return GRIB_NULL_HANDLE; + + if (start_section == 0 || mh->buffer->ulength == 0) { + err = grib_get_message(h, &mess, &mess_len); + if (err != 0) + return err; + total_len = mh->buffer->ulength + mess_len; - p=mh->buffer->data+mh->buffer->ulength; - memcpy ( p,mess,mess_len ); - mh->offset=mh->buffer->ulength; - mh->buffer->ulength=total_len; - mh->length=mess_len; + if (total_len > mh->buffer->length) + grib_grow_buffer(h->context, mh->buffer, total_len); + p = mh->buffer->data + mh->buffer->ulength; + memcpy(p, mess, mess_len); + mh->offset = mh->buffer->ulength; + mh->buffer->ulength = total_len; + mh->length = mess_len; } - else - { - long off=0; - err=grib_get_partial_message ( h,&mess,&mess_len,start_section ); - if ( err!=0 ) return err; - total_len=mh->buffer->ulength+mess_len-4; + else { + long off = 0; + err = grib_get_partial_message(h, &mess, &mess_len, start_section); + if (err != 0) + return err; + total_len = mh->buffer->ulength + mess_len - 4; - while ( total_len > mh->buffer->length ) - grib_grow_buffer ( h->context,mh->buffer,total_len ); + while (total_len > mh->buffer->length) + grib_grow_buffer(h->context, mh->buffer, total_len); - p=mh->buffer->data+mh->buffer->ulength-4; - memcpy ( p,mess,mess_len ); - mh->length+=mess_len-4; + p = mh->buffer->data + mh->buffer->ulength - 4; + memcpy(p, mess, mess_len); + mh->length += mess_len - 4; - off=mh->offset+64; + off = mh->offset + 64; - grib_encode_unsigned_long ( mh->buffer->data, mh->length, &off, 64 ); - mh->buffer->ulength=total_len; + grib_encode_unsigned_long(mh->buffer->data, mh->length, &off, 64); + mh->buffer->ulength = total_len; } return err; } -int grib_multi_handle_write ( grib_multi_handle* h,FILE* f ) +int grib_multi_handle_write(grib_multi_handle* h, FILE* f) { - if ( f==NULL ) return GRIB_INVALID_FILE; - if ( h==NULL ) return GRIB_INVALID_GRIB; + if (f == NULL) + return GRIB_INVALID_FILE; + if (h == NULL) + return GRIB_INVALID_GRIB; - if ( fwrite ( h->buffer->data,1,h->buffer->ulength,f ) != h->buffer->ulength ) - { - grib_context_log ( h->context,GRIB_LOG_PERROR,"grib_multi_handle_write writing on file" ); + if (fwrite(h->buffer->data, 1, h->buffer->ulength, f) != h->buffer->ulength) { + grib_context_log(h->context, GRIB_LOG_PERROR, "grib_multi_handle_write writing on file"); return GRIB_IO_PROBLEM; } return 0; } -int grib_get_partial_message ( grib_handle* h,const void** msg,size_t* len,int start_section ) +int grib_get_partial_message(grib_handle* h, const void** msg, size_t* len, int start_section) { - size_t partial_len=0; - long section_offset=0; - if ( !h ) return GRIB_NULL_HANDLE; + size_t partial_len = 0; + long section_offset = 0; + if (!h) + return GRIB_NULL_HANDLE; - if ( start_section>h->sections_count ) + if (start_section > h->sections_count) return GRIB_INVALID_SECTION_NUMBER; - grib_get_long ( h,h->section_offset[start_section],§ion_offset ); - partial_len=h->buffer->ulength-section_offset; + grib_get_long(h, h->section_offset[start_section], §ion_offset); + partial_len = h->buffer->ulength - section_offset; - *len=partial_len; - *msg = h->buffer->data+section_offset; + *len = partial_len; + *msg = h->buffer->data + section_offset; return GRIB_SUCCESS; } -int grib_get_partial_message_copy ( grib_handle* h , void* message,size_t *len, - int start_section ) +int grib_get_partial_message_copy(grib_handle* h, void* message, size_t* len, + int start_section) { - size_t partial_len=0; - long section_offset=0; - if ( !h ) return GRIB_NULL_HANDLE; + size_t partial_len = 0; + long section_offset = 0; + if (!h) + return GRIB_NULL_HANDLE; - if ( start_section>h->sections_count ) + if (start_section > h->sections_count) return GRIB_INVALID_SECTION_NUMBER; - grib_get_long ( h,h->section_offset[start_section],§ion_offset ); - partial_len=h->buffer->ulength-section_offset; + grib_get_long(h, h->section_offset[start_section], §ion_offset); + partial_len = h->buffer->ulength - section_offset; - if ( *len < partial_len ) return GRIB_BUFFER_TOO_SMALL; + if (*len < partial_len) + return GRIB_BUFFER_TOO_SMALL; - *len=partial_len; + *len = partial_len; - memcpy ( message,h->buffer->data+section_offset,*len ); + memcpy(message, h->buffer->data + section_offset, *len); return GRIB_SUCCESS; } -int grib_get_message_copy(const grib_handle* h, void* message,size_t *len) +int grib_get_message_copy(const grib_handle* h, void* message, size_t* len) { - if ( !h ) + if (!h) return GRIB_NOT_FOUND; - if ( *len < h->buffer->ulength ) + if (*len < h->buffer->ulength) return GRIB_BUFFER_TOO_SMALL; - *len=h->buffer->ulength; + *len = h->buffer->ulength; - memcpy ( message,h->buffer->data,*len ); + memcpy(message, h->buffer->data, *len); return GRIB_SUCCESS; } -int grib_get_message_offset(const grib_handle* h,off_t* offset) +int grib_get_message_offset(const grib_handle* h, off_t* offset) { - if (h) *offset=h->offset; - else return GRIB_INTERNAL_ERROR; + if (h) + *offset = h->offset; + else + return GRIB_INTERNAL_ERROR; return 0; } @@ -1297,7 +1315,7 @@ int codes_get_product_kind(const grib_handle* h, ProductKind* product_kind) int codes_check_message_header(const void* bytes, size_t length, ProductKind product) { - const char *p = ((const char*)bytes); + const char* p = ((const char*)bytes); Assert(p); Assert(product == PRODUCT_GRIB || product == PRODUCT_BUFR); /* Others not yet implemented */ Assert(length > 4); @@ -1317,302 +1335,310 @@ int codes_check_message_header(const void* bytes, size_t length, ProductKind pro } int codes_check_message_footer(const void* bytes, size_t length, ProductKind product) { - const char *p = ((const char*)bytes); + const char* p = ((const char*)bytes); Assert(p); Assert(product == PRODUCT_GRIB || product == PRODUCT_BUFR); /* Others not yet implemented */ - if (p[length-4] != '7' || p[length-3] != '7' || p[length-2] != '7' || p[length-1] != '7') { + if (p[length - 4] != '7' || p[length - 3] != '7' || p[length - 2] != '7' || p[length - 1] != '7') { return GRIB_7777_NOT_FOUND; } return GRIB_SUCCESS; } -int grib_get_message_size(const grib_handle* ch,size_t* size) +int grib_get_message_size(const grib_handle* ch, size_t* size) { - long totalLength=0; - int ret=0; - grib_handle* h = (grib_handle*)ch; - *size = h->buffer->ulength; - ret=grib_get_long(h,"totalLength",&totalLength); - if (!ret) *size=totalLength; + long totalLength = 0; + int ret = 0; + grib_handle* h = (grib_handle*)ch; + *size = h->buffer->ulength; + ret = grib_get_long(h, "totalLength", &totalLength); + if (!ret) + *size = totalLength; return ret; } int grib_get_message(const grib_handle* ch, const void** msg, size_t* size) { - long totalLength=0; - int ret=0; - grib_handle* h = (grib_handle*)ch; - *msg = h->buffer->data; - *size = h->buffer->ulength; + long totalLength = 0; + int ret = 0; + grib_handle* h = (grib_handle*)ch; + *msg = h->buffer->data; + *size = h->buffer->ulength; - ret=grib_get_long(h,"totalLength",&totalLength); - if (!ret) *size=totalLength; + ret = grib_get_long(h, "totalLength", &totalLength); + if (!ret) + *size = totalLength; - if ( h->context->gts_header_on && h->gts_header ) - { + if (h->context->gts_header_on && h->gts_header) { char strbuf[10]; - sprintf ( strbuf,"%.8d", ( int ) ( h->buffer->ulength+h->gts_header_len-6 ) ); - memcpy ( h->gts_header,strbuf,8 ); + sprintf(strbuf, "%.8d", (int)(h->buffer->ulength + h->gts_header_len - 6)); + memcpy(h->gts_header, strbuf, 8); } return 0; } -int grib_get_message_headers ( grib_handle* h,const void** msg,size_t* size ) +int grib_get_message_headers(grib_handle* h, const void** msg, size_t* size) { - int ret=0; + int ret = 0; size_t endOfHeadersMarker; - *msg = h->buffer->data; - *size = h->buffer->ulength; + *msg = h->buffer->data; + *size = h->buffer->ulength; - if ((ret=grib_get_offset(h,"endOfHeadersMarker",&endOfHeadersMarker))!=GRIB_SUCCESS) { - grib_context_log(h->context,GRIB_LOG_FATAL, - "grib_get_message_headers unable to get offset of endOfHeadersMarker"); + if ((ret = grib_get_offset(h, "endOfHeadersMarker", &endOfHeadersMarker)) != GRIB_SUCCESS) { + grib_context_log(h->context, GRIB_LOG_FATAL, + "grib_get_message_headers unable to get offset of endOfHeadersMarker"); return ret; } - *size=endOfHeadersMarker; + *size = endOfHeadersMarker; return ret; } -grib_handle *grib_handle_new ( grib_context* c ) +grib_handle* grib_handle_new(grib_context* c) { grib_handle* h; - if ( !c ) c = grib_context_get_default(); - h = grib_new_handle ( c ); - h->buffer = grib_create_growable_buffer ( c ); - if ( h->buffer == NULL ) - { - grib_handle_delete ( h ); + if (!c) + c = grib_context_get_default(); + h = grib_new_handle(c); + h->buffer = grib_create_growable_buffer(c); + if (h->buffer == NULL) { + grib_handle_delete(h); return NULL; } - h->root = grib_create_root_section ( h->context,h ); + h->root = grib_create_root_section(h->context, h); - if ( !h->root ) - { - grib_context_log ( c, GRIB_LOG_ERROR, "grib_handle_new: cannot create root section" ); - grib_handle_delete ( h ); + if (!h->root) { + grib_context_log(c, GRIB_LOG_ERROR, "grib_handle_new: cannot create root section"); + grib_handle_delete(h); return NULL; } - if ( !h->context->grib_reader || !h->context->grib_reader->first ) - { - grib_context_log ( c, GRIB_LOG_ERROR, "grib_handle_new: cannot create handle, no definitions found" ); - grib_handle_delete ( h ); + if (!h->context->grib_reader || !h->context->grib_reader->first) { + grib_context_log(c, GRIB_LOG_ERROR, "grib_handle_new: cannot create handle, no definitions found"); + grib_handle_delete(h); return NULL; } h->buffer->property = GRIB_USER_BUFFER; - h->header_mode=1; + h->header_mode = 1; return h; } -grib_action* grib_action_from_filter ( const char* filter ) +grib_action* grib_action_from_filter(const char* filter) { - grib_action* a = NULL; - grib_context* context=grib_context_get_default(); - a = grib_parse_file ( context, filter ); - context->grib_reader=NULL; + grib_action* a = NULL; + grib_context* context = grib_context_get_default(); + a = grib_parse_file(context, filter); + context->grib_reader = NULL; return a; } -int grib_handle_apply_action ( grib_handle* h,grib_action* a ) +int grib_handle_apply_action(grib_handle* h, grib_action* a) { int err; grib_action* ao = a; - if ( !a ) return GRIB_SUCCESS; /* TODO: return error */ + if (!a) + return GRIB_SUCCESS; /* TODO: return error */ - while ( a ) - { - err = grib_action_execute ( a,h ); - if ( err != GRIB_SUCCESS ) + while (a) { + err = grib_action_execute(a, h); + if (err != GRIB_SUCCESS) return err; a = a->next; } - a=ao; + a = ao; return GRIB_SUCCESS; } -int grib_handle_prepare_action ( grib_handle* h,grib_action* a ) +int grib_handle_prepare_action(grib_handle* h, grib_action* a) { int err; grib_action* ao = a; - if ( !a ) return GRIB_SUCCESS; /* TODO: return error */ + if (!a) + return GRIB_SUCCESS; /* TODO: return error */ - while ( a ) - { - err = grib_action_execute ( a,h ); - if ( err != GRIB_SUCCESS ) + while (a) { + err = grib_action_execute(a, h); + if (err != GRIB_SUCCESS) return err; a = a->next; } - a=ao; + a = ao; return GRIB_SUCCESS; } -static int grib2_get_next_section ( unsigned char* msgbegin,size_t msglen,unsigned char** secbegin,size_t* seclen,int* secnum,int* err ) +static int grib2_get_next_section(unsigned char* msgbegin, size_t msglen, unsigned char** secbegin, size_t* seclen, int* secnum, int* err) { - if ( !grib2_has_next_section ( msgbegin,msglen,*secbegin,*seclen,err ) ) + if (!grib2_has_next_section(msgbegin, msglen, *secbegin, *seclen, err)) return 0; - *secbegin+=*seclen; - *seclen=grib_decode_unsigned_byte_long ( *secbegin,0,4 ); - *secnum=grib_decode_unsigned_byte_long ( *secbegin,4,1 ); + *secbegin += *seclen; + *seclen = grib_decode_unsigned_byte_long(*secbegin, 0, 4); + *secnum = grib_decode_unsigned_byte_long(*secbegin, 4, 1); - if ( *secnum < 1 || *secnum > 7 ) - { - *err=GRIB_INVALID_SECTION_NUMBER; + if (*secnum < 1 || *secnum > 7) { + *err = GRIB_INVALID_SECTION_NUMBER; return 0; } return 1; } -static int grib2_has_next_section ( unsigned char* msgbegin,size_t msglen,unsigned char* secbegin,size_t seclen,int* err ) +static int grib2_has_next_section(unsigned char* msgbegin, size_t msglen, unsigned char* secbegin, size_t seclen, int* err) { long next_seclen; - *err=0; + *err = 0; - next_seclen= ( msgbegin+msglen )- ( secbegin+seclen ); + next_seclen = (msgbegin + msglen) - (secbegin + seclen); - if ( next_seclen < 5 ) - { - if ( ( next_seclen > 3 ) && !strncmp ( ( char* ) secbegin,"7777",4 ) ) - *err=GRIB_SUCCESS; - else *err=GRIB_7777_NOT_FOUND; + if (next_seclen < 5) { + if ((next_seclen > 3) && !strncmp((char*)secbegin, "7777", 4)) + *err = GRIB_SUCCESS; + else + *err = GRIB_7777_NOT_FOUND; return 0; } - secbegin+=seclen; + secbegin += seclen; return 1; } -static void grib2_build_message ( grib_context* context,unsigned char* sections[],size_t sections_len[],void** data,size_t* len ) +static void grib2_build_message(grib_context* context, unsigned char* sections[], size_t sections_len[], void** data, size_t* len) { - int i=0; - char* theEnd="7777"; - unsigned char* p=0; - size_t msglen=0; - long bitp=64; - if ( !sections[0] ) - { - *data=NULL; + int i = 0; + char* theEnd = "7777"; + unsigned char* p = 0; + size_t msglen = 0; + long bitp = 64; + if (!sections[0]) { + *data = NULL; return; } - for ( i=0;i<8;i++ ) msglen+= sections_len[i]; - msglen+=4; - if ( *lenmulti_support; - while ( gm ) { - if ( gm->file == f ) { + while (gm) { + if (gm->file == f) { gm->file = NULL; } - gm=gm->next; + gm = gm->next; } } -static grib_multi_support* grib_get_multi_support ( grib_context* c, FILE* f ) +static grib_multi_support* grib_get_multi_support(grib_context* c, FILE* f) { - int i=0; - grib_multi_support* gm=c->multi_support; - grib_multi_support* prev=NULL; + int i = 0; + grib_multi_support* gm = c->multi_support; + grib_multi_support* prev = NULL; - while ( gm ) - { - if ( gm->file == f ) return gm; - prev=gm; - gm=gm->next; + while (gm) { + if (gm->file == f) + return gm; + prev = gm; + gm = gm->next; } - if ( !gm ) - { - gm=grib_multi_support_new ( c ); - if ( !c->multi_support ) { c->multi_support=gm; } - else { if (prev) prev->next=gm; } + if (!gm) { + gm = grib_multi_support_new(c); + if (!c->multi_support) { + c->multi_support = gm; + } + else { + if (prev) + prev->next = gm; + } } - gm->next=0; - if ( gm->message ) grib_context_free ( c,gm->message ); - gm->message=NULL; - gm->section_number=0; - gm->sections_length[0]=16; - for ( i=1;i<8;i++ ) gm->sections_length[i]=0; - gm->sections_length[8]=4; - gm->file=f; + gm->next = 0; + if (gm->message) + grib_context_free(c, gm->message); + gm->message = NULL; + gm->section_number = 0; + gm->sections_length[0] = 16; + for (i = 1; i < 8; i++) + gm->sections_length[i] = 0; + gm->sections_length[8] = 4; + gm->file = f; return gm; } -void grib_multi_support_reset ( grib_context* c ) +void grib_multi_support_reset(grib_context* c) { - grib_multi_support* gm=c->multi_support; - grib_multi_support* next=NULL; - int i=0; - while ( next ) - { - next=gm->next; - if ( gm->file ) fclose ( gm->file ); - if ( gm->message ) grib_context_free ( c,gm->message ); - gm->message=NULL; - for ( i=0;i<8;i++ ) gm->sections[i]=0; - if ( gm->bitmap_section ) grib_context_free ( c,gm->bitmap_section ); - gm->bitmap_section=NULL; - grib_context_free ( c,gm ); - gm=NULL; + grib_multi_support* gm = c->multi_support; + grib_multi_support* next = NULL; + int i = 0; + while (next) { + next = gm->next; + if (gm->file) + fclose(gm->file); + if (gm->message) + grib_context_free(c, gm->message); + gm->message = NULL; + for (i = 0; i < 8; i++) + gm->sections[i] = 0; + if (gm->bitmap_section) + grib_context_free(c, gm->bitmap_section); + gm->bitmap_section = NULL; + grib_context_free(c, gm); + gm = NULL; } } -static grib_multi_support* grib_multi_support_new ( grib_context* c ) +static grib_multi_support* grib_multi_support_new(grib_context* c) { - int i=0; - grib_multi_support* gm= - ( grib_multi_support* ) grib_context_malloc_clear ( c,sizeof ( grib_multi_support ) ); - gm->file=NULL; - gm->message=NULL; - gm->message_length=0; - gm->bitmap_section=NULL; - gm->bitmap_section_length=0; - gm->section_number=0; - gm->next=0; - gm->sections_length[0]=16; - for ( i=1;i<8;i++ ) gm->sections_length[i]=0; - gm->sections_length[8]=4; + int i = 0; + grib_multi_support* gm = + (grib_multi_support*)grib_context_malloc_clear(c, sizeof(grib_multi_support)); + gm->file = NULL; + gm->message = NULL; + gm->message_length = 0; + gm->bitmap_section = NULL; + gm->bitmap_section_length = 0; + gm->section_number = 0; + gm->next = 0; + gm->sections_length[0] = 16; + for (i = 1; i < 8; i++) + gm->sections_length[i] = 0; + gm->sections_length[8] = 4; return gm; } diff --git a/src/grib_hash_array.c b/src/grib_hash_array.c index fd294b200..308c58243 100644 --- a/src/grib_hash_array.c +++ b/src/grib_hash_array.c @@ -11,40 +11,39 @@ #include "grib_api_internal.h" -grib_hash_array_value* grib_integer_hash_array_value_new(grib_context* c, const char* name,grib_iarray* array) +grib_hash_array_value* grib_integer_hash_array_value_new(grib_context* c, const char* name, grib_iarray* array) { - grib_hash_array_value* v = (grib_hash_array_value*)grib_context_malloc_clear_persistent(c,sizeof(grib_hash_array_value)); + grib_hash_array_value* v = (grib_hash_array_value*)grib_context_malloc_clear_persistent(c, sizeof(grib_hash_array_value)); - v->name = grib_context_strdup_persistent(c,name); - v->type=GRIB_HASH_ARRAY_TYPE_INTEGER; - v->iarray=array; - return v; + v->name = grib_context_strdup_persistent(c, name); + v->type = GRIB_HASH_ARRAY_TYPE_INTEGER; + v->iarray = array; + return v; } -grib_hash_array_value* grib_double_hash_array_value_new(grib_context* c,const char* name,grib_darray* array) +grib_hash_array_value* grib_double_hash_array_value_new(grib_context* c, const char* name, grib_darray* array) { - grib_hash_array_value* v = (grib_hash_array_value*)grib_context_malloc_clear_persistent(c,sizeof(grib_hash_array_value)); + grib_hash_array_value* v = (grib_hash_array_value*)grib_context_malloc_clear_persistent(c, sizeof(grib_hash_array_value)); - v->name = grib_context_strdup_persistent(c,name); - v->type=GRIB_HASH_ARRAY_TYPE_DOUBLE; - v->darray=array; - return v; + v->name = grib_context_strdup_persistent(c, name); + v->type = GRIB_HASH_ARRAY_TYPE_DOUBLE; + v->darray = array; + return v; } -void grib_hash_array_value_delete(grib_context* c,grib_hash_array_value* v) +void grib_hash_array_value_delete(grib_context* c, grib_hash_array_value* v) { - switch (v->type) { - case GRIB_HASH_ARRAY_TYPE_INTEGER: - grib_iarray_delete(v->iarray); - break; - case GRIB_HASH_ARRAY_TYPE_DOUBLE: - grib_darray_delete(c,v->darray); - break; - default: - grib_context_log(c,GRIB_LOG_ERROR, - "wrong type in grib_hash_array_value_delete"); - } - grib_context_free_persistent(c,v->name); - grib_context_free_persistent(c,v); + switch (v->type) { + case GRIB_HASH_ARRAY_TYPE_INTEGER: + grib_iarray_delete(v->iarray); + break; + case GRIB_HASH_ARRAY_TYPE_DOUBLE: + grib_darray_delete(c, v->darray); + break; + default: + grib_context_log(c, GRIB_LOG_ERROR, + "wrong type in grib_hash_array_value_delete"); + } + grib_context_free_persistent(c, v->name); + grib_context_free_persistent(c, v); } - diff --git a/src/grib_header_compute.c b/src/grib_header_compute.c index 6ac1e3121..816f3e8f8 100644 --- a/src/grib_header_compute.c +++ b/src/grib_header_compute.c @@ -29,30 +29,30 @@ GRIB_INLINE static int strcmp(const char* a,const char* b) { #endif #ifndef NUMBER -#define NUMBER(a) (sizeof(a)/sizeof(a[0])) /* number of elem. of an array */ +#define NUMBER(a) (sizeof(a) / sizeof(a[0])) /* number of elem. of an array */ #endif #ifndef MAX -#define MAX(a,b) (((a)>(b))?(a):(b)) +#define MAX(a, b) (((a) > (b)) ? (a) : (b)) #endif #ifndef MIN -#define MIN(a,b) (((a)<(b))?(a):(b)) +#define MIN(a, b) (((a) < (b)) ? (a) : (b)) #endif -#define ABS(a) ((a)<0?-(a):(a)) -#define ROUND(a) ((long)((a)+0.5)) -#define EQ(a,b) ((*(a) == *(b)) && (strcmp(a,b) == 0)) -#define LT(a,b) ((*(a) < *(b)) || (strcmp(a,b) < 0)) - - -static grib_math *readpower(grib_context* c,char** form,int *err); -static grib_math *readatom(grib_context* c,char** form,int *err); -static grib_math *readfactor(grib_context* c,char** form,int *err); -static grib_math *readterm(grib_context* c,char** form,int *err); -static grib_math *readtest(grib_context* c,char** form,int *err); -static grib_math *readlist(grib_context* c,char** form,int* n,int *err); -static grib_math *readand(grib_context* c,char** form,int* err); -static grib_math *reador(grib_context* c,char** form,int* err); +#define ABS(a) ((a) < 0 ? -(a) : (a)) +#define ROUND(a) ((long)((a) + 0.5)) +#define EQ(a, b) ((*(a) == *(b)) && (strcmp(a, b) == 0)) +#define LT(a, b) ((*(a) < *(b)) || (strcmp(a, b) < 0)) + + +static grib_math* readpower(grib_context* c, char** form, int* err); +static grib_math* readatom(grib_context* c, char** form, int* err); +static grib_math* readfactor(grib_context* c, char** form, int* err); +static grib_math* readterm(grib_context* c, char** form, int* err); +static grib_math* readtest(grib_context* c, char** form, int* err); +static grib_math* readlist(grib_context* c, char** form, int* n, int* err); +static grib_math* readand(grib_context* c, char** form, int* err); +static grib_math* reador(grib_context* c, char** form, int* err); static void advance(char** form); -static char *opname(char *p,int n); +static char* opname(char* p, int n); /* static long op_eq(long a, long b) {return a == b;} static long op_ne(long a, long b) {return a != b;} @@ -120,348 +120,352 @@ typedef double real; typedef int boolean; typedef int err; typedef real (*fop1)(real); -typedef real (*fop2)(real,real); +typedef real (*fop2)(real, real); static void advance(char** form) { (*form)++; - while(isspace(**form)) (*form)++; + while (isspace(**form)) + (*form)++; } -static grib_math *readatom(grib_context* c,char** form,int *err) +static grib_math* readatom(grib_context* c, char** form, int* err) { - grib_math *p; + grib_math* p; int i; char buf[1024]; - switch(**form) - { - case '(': - advance(form); - p = reador(c,form,err); - if(**form != ')') { - grib_context_log(c, GRIB_LOG_ERROR,"Formula: missing )"); - *err = GRIB_INTERNAL_ERROR; - } - advance(form); - break; - - case '-': - p = (grib_math*)grib_context_malloc(c,sizeof(grib_math)); - p->arity = 1; - p->name = strdup("neg"); - Assert(p->name); - advance(form); - p->left = readatom(c,form,err); - break; - - case '!': - p = (grib_math*)grib_context_malloc(c,sizeof(grib_math)); - p->arity = 1; - p->name = strdup("neg"); - Assert(p->name); - advance(form); - p->left = readatom(c,form,err); - break; - - case '\0': - grib_context_log(c, GRIB_LOG_ERROR,"Formula: syntax error"); - *err = GRIB_INTERNAL_ERROR; - return NULL; - /*NOTREACHED*/ - break; - - default: - i = 0; - - if(**form == '\'' || **form == '"') - { - char achar = *((*form)++); - while(**form && **form != achar) - buf[i++] = *((*form)++); - if(**form) (*form)++; - } else - while(isalpha(**form)||isdigit(**form) - || **form =='.' || **form == '_') - buf[i++] = *((*form)++); - - buf[i] = 0; - if(isspace(**form)) advance(form); - - p = (grib_math*)grib_context_malloc(c,sizeof(grib_math)); - p->name = strdup(buf); - Assert(p->name); - p->left=0; - - switch(**form) - { + switch (**form) { case '(': advance(form); - p->arity = 0; - p->left = readlist(c,form,&p->arity,err); - if(**form != ')') - { - grib_context_log(c, GRIB_LOG_ERROR,"Formula: missing )"); + p = reador(c, form, err); + if (**form != ')') { + grib_context_log(c, GRIB_LOG_ERROR, "Formula: missing )"); *err = GRIB_INTERNAL_ERROR; } advance(form); break; - case '[': + case '-': + p = (grib_math*)grib_context_malloc(c, sizeof(grib_math)); + p->arity = 1; + p->name = strdup("neg"); + Assert(p->name); advance(form); - p->arity = 0; - p->left = readlist(c,form,&p->arity,err); - if(**form != ']') { - grib_context_log(c, GRIB_LOG_ERROR,"Formula: missing ]"); - *err = GRIB_INTERNAL_ERROR; - } - p->arity = -p->arity; + p->left = readatom(c, form, err); + break; + + case '!': + p = (grib_math*)grib_context_malloc(c, sizeof(grib_math)); + p->arity = 1; + p->name = strdup("neg"); + Assert(p->name); advance(form); + p->left = readatom(c, form, err); break; - default: - p->arity = 0; + case '\0': + grib_context_log(c, GRIB_LOG_ERROR, "Formula: syntax error"); + *err = GRIB_INTERNAL_ERROR; + return NULL; + /*NOTREACHED*/ break; - } - break; + default: + i = 0; + + if (**form == '\'' || **form == '"') { + char achar = *((*form)++); + while (**form && **form != achar) + buf[i++] = *((*form)++); + if (**form) + (*form)++; + } + else + while (isalpha(**form) || isdigit(**form) || **form == '.' || **form == '_') + buf[i++] = *((*form)++); + + buf[i] = 0; + if (isspace(**form)) + advance(form); + + p = (grib_math*)grib_context_malloc(c, sizeof(grib_math)); + p->name = strdup(buf); + Assert(p->name); + p->left = 0; + + switch (**form) { + case '(': + advance(form); + p->arity = 0; + p->left = readlist(c, form, &p->arity, err); + if (**form != ')') { + grib_context_log(c, GRIB_LOG_ERROR, "Formula: missing )"); + *err = GRIB_INTERNAL_ERROR; + } + advance(form); + break; + + case '[': + advance(form); + p->arity = 0; + p->left = readlist(c, form, &p->arity, err); + if (**form != ']') { + grib_context_log(c, GRIB_LOG_ERROR, "Formula: missing ]"); + *err = GRIB_INTERNAL_ERROR; + } + p->arity = -p->arity; + advance(form); + break; + + default: + p->arity = 0; + break; + } + + break; } return p; } -static char *opname(char *p,int n) +static char* opname(char* p, int n) { char buf[5]; - strncpy(buf,p,n); + strncpy(buf, p, n); buf[n] = 0; return strdup(buf); } -void print_math(grib_math *m) +void print_math(grib_math* m) { - if(m) - { + if (m) { putchar('('); print_math(m->left); - printf("%s",m->name); + printf("%s", m->name); print_math(m->right); putchar(')'); } } -static grib_math *readpower(grib_context* c,char** form,int *err) +static grib_math* readpower(grib_context* c, char** form, int* err) { - grib_math *p = readatom(c,form,err); + grib_math* p = readatom(c, form, err); - while(**form == '^' || (**form == '*' && *(*form + 1) == '*') ) - { - grib_math *q = (grib_math*)grib_context_malloc(c,sizeof(grib_math)); - q->left = p; - q->arity = 2; + while (**form == '^' || (**form == '*' && *(*form + 1) == '*')) { + grib_math* q = (grib_math*)grib_context_malloc(c, sizeof(grib_math)); + q->left = p; + q->arity = 2; - if(**form == '*') { advance(form); **form = '^'; } + if (**form == '*') { + advance(form); + **form = '^'; + } - q->name = opname(*form,1); + q->name = opname(*form, 1); advance(form); - q->right = readatom(c,form,err); - p = q; + q->right = readatom(c, form, err); + p = q; } return p; } -static grib_math *readlist(grib_context* c,char** form,int *n,int * err) +static grib_math* readlist(grib_context* c, char** form, int* n, int* err) { - grib_math *p; + grib_math* p; - if(**form == ')') return NULL; + if (**form == ')') + return NULL; - p = readtest(c,form,err); + p = readtest(c, form, err); *n = 1; - while(**form == ',') { - grib_math *q = (grib_math*)grib_context_malloc(c,sizeof(grib_math)); + while (**form == ',') { + grib_math* q = (grib_math*)grib_context_malloc(c, sizeof(grib_math)); (*n)++; - q->left = p; + q->left = p; advance(form); - q->right = readtest(c,form,err); + q->right = readtest(c, form, err); p = q; } return p; } -static grib_math *readfactor(grib_context* c,char** form,int* err) +static grib_math* readfactor(grib_context* c, char** form, int* err) { - grib_math *p = readpower(c,form,err); + grib_math* p = readpower(c, form, err); - while(**form == '*' || **form == '/') { - grib_math *q = (grib_math*)grib_context_malloc(c,sizeof(grib_math)); + while (**form == '*' || **form == '/') { + grib_math* q = (grib_math*)grib_context_malloc(c, sizeof(grib_math)); - q->arity = 2; - q->left = p; - q->name = opname(*form,1); + q->arity = 2; + q->left = p; + q->name = opname(*form, 1); advance(form); - q->right = readpower(c,form,err); + q->right = readpower(c, form, err); p = q; } return p; } -static grib_math *readterm(grib_context* c,char** form,int* err) +static grib_math* readterm(grib_context* c, char** form, int* err) { - grib_math *p = readfactor(c,form,err); - while(**form == '+' || **form == '-' ) { - grib_math *q = (grib_math*)grib_context_malloc(c,sizeof(grib_math)); + grib_math* p = readfactor(c, form, err); + while (**form == '+' || **form == '-') { + grib_math* q = (grib_math*)grib_context_malloc(c, sizeof(grib_math)); - q->arity = 2; - q->left = p; - q->name = opname(*form,1); + q->arity = 2; + q->left = p; + q->name = opname(*form, 1); advance(form); - q->right = readfactor(c,form,err); + q->right = readfactor(c, form, err); p = q; - } return p; } -static grib_math *readtest(grib_context* c,char** form,int* err) +static grib_math* readtest(grib_context* c, char** form, int* err) { - grib_math *p = readterm(c,form,err); - while(**form == '<' || **form == '>' || **form == '=') { - grib_math *q = (grib_math*)grib_context_malloc(c,sizeof(grib_math)); - char *x = *form; - int n = 1; + grib_math* p = readterm(c, form, err); + while (**form == '<' || **form == '>' || **form == '=') { + grib_math* q = (grib_math*)grib_context_malloc(c, sizeof(grib_math)); + char* x = *form; + int n = 1; - q->arity = 2; - q->left = p; + q->arity = 2; + q->left = p; advance(form); - if(**form == '=' || **form == '>') { + if (**form == '=' || **form == '>') { n = 2; advance(form); } - q->name = opname(x,n); + q->name = opname(x, n); - q->right = readterm(c,form,err); + q->right = readterm(c, form, err); p = q; - } return p; } -static grib_math *readand(grib_context* c,char** form,int* err) +static grib_math* readand(grib_context* c, char** form, int* err) { - grib_math *p = readtest(c,form,err); - while(**form == '&' ) { - grib_math *q = (grib_math*)grib_context_malloc(c,sizeof(grib_math)); - char *x = *form; - int n = 1; + grib_math* p = readtest(c, form, err); + while (**form == '&') { + grib_math* q = (grib_math*)grib_context_malloc(c, sizeof(grib_math)); + char* x = *form; + int n = 1; - q->arity = 2; - q->left = p; + q->arity = 2; + q->left = p; advance(form); - if(**form == '&') { + if (**form == '&') { n = 2; advance(form); } - q->name = opname(x,n); + q->name = opname(x, n); - q->right = readtest(c,form,err); + q->right = readtest(c, form, err); p = q; - } return p; } -static grib_math *reador(grib_context* c,char** form,int* err) +static grib_math* reador(grib_context* c, char** form, int* err) { - grib_math *p = readand(c,form,err); - while(**form == '|' ) { - grib_math *q = (grib_math*)grib_context_malloc(c,sizeof(grib_math)); - char *x = *form; - int n = 1; + grib_math* p = readand(c, form, err); + while (**form == '|') { + grib_math* q = (grib_math*)grib_context_malloc(c, sizeof(grib_math)); + char* x = *form; + int n = 1; - q->arity = 2; - q->left = p; + q->arity = 2; + q->left = p; advance(form); - if(**form == '|' ) { + if (**form == '|') { n = 2; advance(form); } - q->name = opname(x,n); + q->name = opname(x, n); - q->right = readand(c,form,err); + q->right = readand(c, form, err); p = q; - } return p; } -grib_math *grib_math_clone(grib_context* c,grib_math *m) +grib_math* grib_math_clone(grib_context* c, grib_math* m) { - grib_math *n = NULL; - if(m) { - n = (grib_math*)grib_context_malloc(c,sizeof(grib_math)); + grib_math* n = NULL; + if (m) { + n = (grib_math*)grib_context_malloc(c, sizeof(grib_math)); n->arity = m->arity; n->name = strdup(m->name); Assert(n->name); - n->left = grib_math_clone(c,m->left); - n->right = grib_math_clone(c,m->right); + n->left = grib_math_clone(c, m->left); + n->right = grib_math_clone(c, m->right); } return n; } -void grib_math_delete (grib_context* c,grib_math* m) +void grib_math_delete(grib_context* c, grib_math* m) { - grib_math *left=0,*right=0; - left=m->left; - right=m->right; - if (m->name) free(m->name); - grib_context_free(c,m); - if (left) grib_math_delete(c,left); - if (right) grib_math_delete(c,right); + grib_math *left = 0, *right = 0; + left = m->left; + right = m->right; + if (m->name) + free(m->name); + grib_context_free(c, m); + if (left) + grib_math_delete(c, left); + if (right) + grib_math_delete(c, right); } -grib_math *grib_math_new(grib_context* c,const char* formula,int *err) +grib_math* grib_math_new(grib_context* c, const char* formula, int* err) { - grib_math *x; - char* f=0; - char* fsave=0; + grib_math* x; + char* f = 0; + char* fsave = 0; - *err=0; + *err = 0; - if (!formula) {*err=GRIB_INVALID_ARGUMENT;return NULL;} + if (!formula) { + *err = GRIB_INVALID_ARGUMENT; + return NULL; + } - f=strdup(formula); + f = strdup(formula); Assert(f); - fsave=f; + fsave = f; - x = reador(c,&f,err); - if(*err!=GRIB_SUCCESS) return NULL; + x = reador(c, &f, err); + if (*err != GRIB_SUCCESS) + return NULL; - if(*f) { + if (*f) { grib_context_log(c, GRIB_LOG_ERROR, - "grib_math_new : Part of the formula was not processed: '%s'",f); + "grib_math_new : Part of the formula was not processed: '%s'", f); return NULL; } diff --git a/src/grib_iarray.c b/src/grib_iarray.c index 09f798f09..1303cff5e 100644 --- a/src/grib_iarray.c +++ b/src/grib_iarray.c @@ -22,48 +22,51 @@ void grib_iarray_print(const char* title, const grib_iarray* iarray) size_t i; Assert(iarray); printf("%s: iarray.n=%lu \t", title, (unsigned long)iarray->n); - for (i=0; in; i++) { + for (i = 0; i < iarray->n; i++) { printf("iarray[%lu]=%ld\t", (unsigned long)i, iarray->v[i]); } printf("\n"); } -grib_iarray* grib_iarray_new_from_array(grib_context* c,long* a,size_t size) +grib_iarray* grib_iarray_new_from_array(grib_context* c, long* a, size_t size) { size_t i; grib_iarray* v; - if (!c) c=grib_context_get_default(); + if (!c) + c = grib_context_get_default(); - v=grib_iarray_new(c,size,100); - for (i=0;iv[i]=a[i]; - v->n=size; - v->number_of_pop_front=0; - v->context=c; + v = grib_iarray_new(c, size, 100); + for (i = 0; i < size; i++) + v->v[i] = a[i]; + v->n = size; + v->number_of_pop_front = 0; + v->context = c; return v; } -grib_iarray* grib_iarray_new(grib_context* c,size_t size,size_t incsize) +grib_iarray* grib_iarray_new(grib_context* c, size_t size, size_t incsize) { - grib_iarray* v=NULL; + grib_iarray* v = NULL; - if (!c) c=grib_context_get_default(); + if (!c) + c = grib_context_get_default(); - v=(grib_iarray*)grib_context_malloc(c,sizeof(grib_iarray)); + v = (grib_iarray*)grib_context_malloc(c, sizeof(grib_iarray)); if (!v) { - grib_context_log(c,GRIB_LOG_ERROR, - "grib_iarray_new unable to allocate %d bytes\n",sizeof(grib_iarray)); + grib_context_log(c, GRIB_LOG_ERROR, + "grib_iarray_new unable to allocate %d bytes\n", sizeof(grib_iarray)); return NULL; } - v->context=c; - v->size=size; - v->n=0; - v->incsize=incsize; - v->v=(long*)grib_context_malloc(c,sizeof(long)*size); - v->number_of_pop_front=0; + v->context = c; + v->size = size; + v->n = 0; + v->incsize = incsize; + v->v = (long*)grib_context_malloc(c, sizeof(long) * size); + v->number_of_pop_front = 0; if (!v->v) { - grib_context_log(c,GRIB_LOG_ERROR, - "grib_iarray_new unable to allocate %d bytes\n",sizeof(long)*size); + grib_context_log(c, GRIB_LOG_ERROR, + "grib_iarray_new unable to allocate %d bytes\n", sizeof(long) * size); return NULL; } return v; @@ -71,15 +74,16 @@ grib_iarray* grib_iarray_new(grib_context* c,size_t size,size_t incsize) long grib_iarray_pop(grib_iarray* a) { - a->n-=1; + a->n -= 1; return a->v[a->n]; } long grib_iarray_pop_front(grib_iarray* a) { - long v=a->v[0]; + long v = a->v[0]; /* size_t i=0; */ - if (a->n==0) Assert(0); + if (a->n == 0) + Assert(0); a->n--; a->v++; a->number_of_pop_front++; @@ -88,127 +92,138 @@ long grib_iarray_pop_front(grib_iarray* a) return v; } -grib_iarray* grib_iarray_resize_to(grib_iarray* v,size_t newsize) +grib_iarray* grib_iarray_resize_to(grib_iarray* v, size_t newsize) { long* newv; size_t i; - grib_context* c=v->context; + grib_context* c = v->context; - if (newsizesize) return v; + if (newsize < v->size) + return v; - if (!c) c=grib_context_get_default(); + if (!c) + c = grib_context_get_default(); - newv=(long*)grib_context_malloc_clear(c,newsize*sizeof(long)); + newv = (long*)grib_context_malloc_clear(c, newsize * sizeof(long)); if (!newv) { - grib_context_log(c,GRIB_LOG_ERROR, - "grib_iarray_resize unable to allocate %d bytes\n",sizeof(long)*newsize); + grib_context_log(c, GRIB_LOG_ERROR, + "grib_iarray_resize unable to allocate %d bytes\n", sizeof(long) * newsize); return NULL; } - for (i=0;in;i++) newv[i]=v->v[i]; + for (i = 0; i < v->n; i++) + newv[i] = v->v[i]; - v->v-=v->number_of_pop_front; - grib_context_free(c,v->v); + v->v -= v->number_of_pop_front; + grib_context_free(c, v->v); - v->v=newv; - v->size=newsize; - v->number_of_pop_front=0; + v->v = newv; + v->size = newsize; + v->number_of_pop_front = 0; return v; } grib_iarray* grib_iarray_resize(grib_iarray* v) { - int newsize=v->incsize+v->size; + int newsize = v->incsize + v->size; - return grib_iarray_resize_to(v,newsize); + return grib_iarray_resize_to(v, newsize); } -grib_iarray* grib_iarray_push(grib_iarray* v,long val) +grib_iarray* grib_iarray_push(grib_iarray* v, long val) { - size_t start_size=100; - size_t start_incsize=100; + size_t start_size = 100; + size_t start_incsize = 100; - if (!v) v=grib_iarray_new(0,start_size,start_incsize); + if (!v) + v = grib_iarray_new(0, start_size, start_incsize); - if (v->n >= v->size-v->number_of_pop_front) - v=grib_iarray_resize(v); + if (v->n >= v->size - v->number_of_pop_front) + v = grib_iarray_resize(v); - v->v[v->n]=val; + v->v[v->n] = val; v->n++; return v; } -grib_iarray* grib_iarray_push_front(grib_iarray* v,long val) +grib_iarray* grib_iarray_push_front(grib_iarray* v, long val) { - size_t start_size=100; - size_t start_incsize=100; + size_t start_size = 100; + size_t start_incsize = 100; int i; - if (!v) v=grib_iarray_new(0,start_size,start_incsize); + if (!v) + v = grib_iarray_new(0, start_size, start_incsize); if (v->number_of_pop_front) { v->v--; v->number_of_pop_front--; - } else { - if (v->n >= v->size) v=grib_iarray_resize(v); - for (i=v->n;i>0;i--) v[i]=v[i-1]; } - v->v[0]=val; + else { + if (v->n >= v->size) + v = grib_iarray_resize(v); + for (i = v->n; i > 0; i--) + v[i] = v[i - 1]; + } + v->v[0] = val; v->n++; return v; } -grib_iarray* grib_iarray_push_array(grib_iarray* v,long *val,size_t size) +grib_iarray* grib_iarray_push_array(grib_iarray* v, long* val, size_t size) { - size_t start_size=size; - size_t start_incsize=100; - long* vp=0; - long* valp=val; - if (!v) v=grib_iarray_new(0,start_size,start_incsize); - - v=grib_iarray_resize_to(v,size+v->n); - vp=v->v+v->n+v->number_of_pop_front; - v->n+=size; + size_t start_size = size; + size_t start_incsize = 100; + long* vp = 0; + long* valp = val; + if (!v) + v = grib_iarray_new(0, start_size, start_incsize); + + v = grib_iarray_resize_to(v, size + v->n); + vp = v->v + v->n + v->number_of_pop_front; + v->n += size; while (size) { - *(vp++)=*(valp++); + *(vp++) = *(valp++); size--; } return v; } -long grib_iarray_get(grib_iarray* a,size_t i) +long grib_iarray_get(grib_iarray* a, size_t i) { return a->v[i]; } -void grib_iarray_set(grib_iarray* a,size_t i,long v) +void grib_iarray_set(grib_iarray* a, size_t i, long v) { - a->v[i]=v; + a->v[i] = v; } void grib_iarray_delete(grib_iarray* v) { grib_context* c; - if (!v) return; - c=v->context; + if (!v) + return; + c = v->context; grib_iarray_delete_array(v); - grib_context_free(c,v); + grib_context_free(c, v); } void grib_iarray_delete_array(grib_iarray* v) { grib_context* c; - if (!v) return; - c=v->context; + if (!v) + return; + c = v->context; if (v->v) { long* vv = v->v - v->number_of_pop_front; - grib_context_free(c,vv); + grib_context_free(c, vv); } } @@ -216,24 +231,31 @@ long* grib_iarray_get_array(grib_iarray* v) { long* vv; size_t i; - grib_context* c=grib_context_get_default(); + grib_context* c = grib_context_get_default(); - vv=(long*)grib_context_malloc_clear(c,sizeof(long)*v->n); - for (i=0;in;i++) vv[i]=v->v[i]; + vv = (long*)grib_context_malloc_clear(c, sizeof(long) * v->n); + for (i = 0; i < v->n; i++) + vv[i] = v->v[i]; return vv; } -size_t grib_iarray_used_size(grib_iarray* v) {return v==NULL ? 0 : v->n;} +size_t grib_iarray_used_size(grib_iarray* v) +{ + return v == NULL ? 0 : v->n; +} -int grib_iarray_is_constant(grib_iarray* v) { +int grib_iarray_is_constant(grib_iarray* v) +{ int i; long val; - if (v->n == 1) return 1; + if (v->n == 1) + return 1; - val=v->v[0]; - for (i=1;in;i++) { - if (val!=v->v[i]) return 0; + val = v->v[0]; + for (i = 1; i < v->n; i++) { + if (val != v->v[i]) + return 0; } return 1; } diff --git a/src/grib_ibmfloat.c b/src/grib_ibmfloat.c index 030f9c2c5..bdd192ef5 100644 --- a/src/grib_ibmfloat.c +++ b/src/grib_ibmfloat.c @@ -11,14 +11,15 @@ #include "grib_api_internal.h" #if GRIB_PTHREADS -static pthread_once_t once = PTHREAD_ONCE_INIT; +static pthread_once_t once = PTHREAD_ONCE_INIT; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; -static void init() { +static void init() +{ pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); - pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init(&mutex,&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&mutex, &attr); pthread_mutexattr_destroy(&attr); } #elif GRIB_OMP_THREADS @@ -29,8 +30,7 @@ static void init() { GRIB_OMP_CRITICAL(lock_grib_ibmfloat_c) { - if (once == 0) - { + if (once == 0) { omp_init_nest_lock(&mutex); once = 1; } @@ -40,74 +40,89 @@ static void init() typedef struct ibm_table_t ibm_table_t; -struct ibm_table_t { - int inited; +struct ibm_table_t +{ + int inited; double e[128]; double v[128]; double vmin; double vmax; }; -static ibm_table_t ibm_table={ 0, {0,}, {0,}, 0, 0 }; +static ibm_table_t ibm_table = { 0, {0,}, {0,}, 0, 0 }; static void init_ibm_table() { if (!ibm_table.inited) { unsigned long i; - unsigned long mmin=0x100000; - unsigned long mmax=0xffffff; - double e=1; - for (i=1; i<=57;i++) { e*=16; ibm_table.e[i+70]=e;ibm_table.v[i+70]=e*mmin;} - ibm_table.e[70]=1; - ibm_table.v[70]=mmin; - e=1; - for (i=1; i<=70;i++) { e/=16; ibm_table.e[70-i]=e;ibm_table.v[70-i]=e*mmin;} - ibm_table.vmin=ibm_table.v[0]; - ibm_table.vmax=ibm_table.e[127]*mmax; - ibm_table.inited=1; + unsigned long mmin = 0x100000; + unsigned long mmax = 0xffffff; + double e = 1; + for (i = 1; i <= 57; i++) { + e *= 16; + ibm_table.e[i + 70] = e; + ibm_table.v[i + 70] = e * mmin; + } + ibm_table.e[70] = 1; + ibm_table.v[70] = mmin; + e = 1; + for (i = 1; i <= 70; i++) { + e /= 16; + ibm_table.e[70 - i] = e; + ibm_table.v[70 - i] = e * mmin; + } + ibm_table.vmin = ibm_table.v[0]; + ibm_table.vmax = ibm_table.e[127] * mmax; + ibm_table.inited = 1; /*for (i=0;i<128;i++) printf("++++ ibm_table.v[%d]=%g\n",i,ibm_table.v[i]);*/ } } static void init_table_if_needed() { - GRIB_MUTEX_INIT_ONCE(&once,&init) + GRIB_MUTEX_INIT_ONCE(&once, &init) GRIB_MUTEX_LOCK(&mutex) - if (!ibm_table.inited) init_ibm_table(); + if (!ibm_table.inited) + init_ibm_table(); GRIB_MUTEX_UNLOCK(&mutex) } -static void binary_search(double xx[], const unsigned long n, double x, unsigned long *j) +static void binary_search(double xx[], const unsigned long n, double x, unsigned long* j) { /*These routine works only on ascending ordered arrays*/ - unsigned long ju,jm,jl; - jl=0; - ju=n; - while (ju-jl > 1) { - jm=(ju+jl) >> 1; + unsigned long ju, jm, jl; + jl = 0; + ju = n; + while (ju - jl > 1) { + jm = (ju + jl) >> 1; /* printf("jl=%lu jm=%lu ju=%lu\n",jl,jm,ju); */ /* printf("xx[jl]=%.10e xx[jm]=%.10e xx[ju]=%.10e\n",xx[jl],xx[jm],xx[ju]); */ - if (x >= xx[jm]) jl=jm; - else ju=jm; + if (x >= xx[jm]) + jl = jm; + else + ju = jm; } - *j=jl; + *j = jl; } unsigned long grib_ibm_to_long(double x) { - unsigned long s = 0; + unsigned long s = 0; unsigned long mmax = 0xffffff; unsigned long mmin = 0x800000; - unsigned long m = mmax; - unsigned long e=0; - double rmmax=mmax+0.5; + unsigned long m = mmax; + unsigned long e = 0; + double rmmax = mmax + 0.5; init_table_if_needed(); /* printf("\ngrib_ibm_to_long: x=%.20e\n",x); */ - if (x < 0) { s = 1; x = -x; } + if (x < 0) { + s = 1; + x = -x; + } /* Underflow */ if (x < ibm_table.vmin) { @@ -126,39 +141,47 @@ unsigned long grib_ibm_to_long(double x) /* printf("grib_ibm_to_long: e=%ld\n",e); */ - x/=ibm_table.e[e]; + x /= ibm_table.e[e]; /* printf("grib_ibm_to_long: x=%.20e\n",x); */ - while(x < mmin ) { x *= 16; e--; - /* printf("grib_ibm_to_long (e--): x=%.20e e=%ld \n",x,e); */ + while (x < mmin) { + x *= 16; + e--; + /* printf("grib_ibm_to_long (e--): x=%.20e e=%ld \n",x,e); */ } - while(x > rmmax ) { x /= 16; e++; - /* printf("grib_ibm_to_long (e++): x=%.20e e=%ld \n",x,e); */ + while (x > rmmax) { + x /= 16; + e++; + /* printf("grib_ibm_to_long (e++): x=%.20e e=%ld \n",x,e); */ } - m=x+0.5; + m = x + 0.5; /* printf("grib_ibm_to_long: m=0x%lX (%lu) x=%.10e \n",m,m,x ); */ - if ( m > mmax ) { e++; m=0x800000; - /* printf("grib_ibm_to_long: ( m > mmax ) m=0x%lX (%lu) x=%.10e \n",m,m,x ); */ + if (m > mmax) { + e++; + m = 0x800000; + /* printf("grib_ibm_to_long: ( m > mmax ) m=0x%lX (%lu) x=%.10e \n",m,m,x ); */ } /* printf("grib_ibm_to_long: s=%lu c=%lu (0x%lX) m=%lu (0x%lX)\n",s,e,e,m,m ); */ - return (s << 31) | ( e << 24 ) | m; + return (s << 31) | (e << 24) | m; } double grib_ibmfloat_error(double x) { - unsigned long e=0; + unsigned long e = 0; init_table_if_needed(); - if (x < 0) x = -x; + if (x < 0) + x = -x; /* Underflow */ - if (x <= ibm_table.vmin) return ibm_table.vmin; + if (x <= ibm_table.vmin) + return ibm_table.vmin; /* Overflow */ if (x > ibm_table.vmax) { @@ -169,12 +192,12 @@ double grib_ibmfloat_error(double x) binary_search(ibm_table.v, 127, x, &e); - return ibm_table.e[e] ; + return ibm_table.e[e]; } double grib_long_to_ibm(unsigned long x) { - unsigned long s = x & 0x80000000; + unsigned long s = x & 0x80000000; unsigned long c = (x & 0x7f000000) >> 24; unsigned long m = (x & 0x00ffffff); @@ -183,11 +206,13 @@ double grib_long_to_ibm(unsigned long x) init_table_if_needed(); /*if(x == 0) return 0;*/ - if (c==0 && m <= 1 ) return 0; + if (c == 0 && m <= 1) + return 0; - val*=ibm_table.e[c]; + val *= ibm_table.e[c]; - if(s) val = -val; + if (s) + val = -val; return val; } @@ -208,46 +233,49 @@ unsigned long grib_ibm_nearest_smaller_to_long(double x) { unsigned long l; unsigned long e; - unsigned long m ; + unsigned long m; unsigned long s; unsigned long mmin = 0x100000; - double y, eps=0; + double y, eps = 0; - if(x == 0) return 0; + if (x == 0) + return 0; init_table_if_needed(); - l=grib_ibm_to_long(x); - y=grib_long_to_ibm(l); + l = grib_ibm_to_long(x); + y = grib_long_to_ibm(l); - if ( x < y ) { - if ( x < 0 && -x < ibm_table.vmin ) { - l=0x80100000; - } else { + if (x < y) { + if (x < 0 && -x < ibm_table.vmin) { + l = 0x80100000; + } + else { e = (l & 0x7f000000) >> 24; m = (l & 0x00ffffff); - s = l & 0x80000000; + s = l & 0x80000000; - if ( m == mmin ) { + if (m == mmin) { /* printf("grib_ibm_nearest_smaller_to_long: m == mmin (0x%lX) e=%lu\n",m,e); */ - e = s ? e : e-1; + e = s ? e : e - 1; /*if (e<0) e=0; this condition is always FALSE -- 'e' is unsigned long */ - if (e>127) e=127; + if (e > 127) + e = 127; /* printf("grib_ibm_nearest_smaller_to_long: e=%lu \n",e); */ } - eps=ibm_table.e[e]; + eps = ibm_table.e[e]; /* printf("grib_ibm_nearest_smaller_to_long: x= grib_long_to_ibm(l)); } } @@ -255,15 +283,16 @@ unsigned long grib_ibm_nearest_smaller_to_long(double x) return l; } -int grib_nearest_smaller_ibm_float(double a,double* ret) +int grib_nearest_smaller_ibm_float(double a, double* ret) { - unsigned long l=0; + unsigned long l = 0; init_table_if_needed(); - if (a>ibm_table.vmax) return GRIB_INTERNAL_ERROR; + if (a > ibm_table.vmax) + return GRIB_INTERNAL_ERROR; - l=grib_ibm_nearest_smaller_to_long(a); - *ret=grib_long_to_ibm(l); + l = grib_ibm_nearest_smaller_to_long(a); + *ret = grib_long_to_ibm(l); return GRIB_SUCCESS; } diff --git a/src/grib_ieeefloat.c b/src/grib_ieeefloat.c index d2e1224cd..33a246df3 100644 --- a/src/grib_ieeefloat.c +++ b/src/grib_ieeefloat.c @@ -15,14 +15,15 @@ #include "grib_api_internal.h" #if GRIB_PTHREADS -static pthread_once_t once = PTHREAD_ONCE_INIT; +static pthread_once_t once = PTHREAD_ONCE_INIT; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; -static void init() { +static void init() +{ pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); - pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init(&mutex,&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&mutex, &attr); pthread_mutexattr_destroy(&attr); } #elif GRIB_OMP_THREADS @@ -33,8 +34,7 @@ static void init() { GRIB_OMP_CRITICAL(lock_grib_ieeefloat_c) { - if (once == 0) - { + if (once == 0) { omp_init_nest_lock(&mutex); once = 1; } @@ -46,67 +46,71 @@ static void init() typedef struct ieee_table_t ieee_table_t; -struct ieee_table_t { - int inited; +struct ieee_table_t +{ + int inited; double e[255]; double v[255]; double vmin; double vmax; }; -static ieee_table_t ieee_table={ 0,{0,},{0,}, 0, 0 }; +static ieee_table_t ieee_table = { 0, {0,}, {0,}, 0, 0 }; static void init_ieee_table() { if (!ieee_table.inited) { unsigned long i; - unsigned long mmin=0x800000; - unsigned long mmax=0xffffff; - double e=1; - for (i=1; i<=104;i++) { - e*=2; - ieee_table.e[i+150]=e; - ieee_table.v[i+150]=e*mmin; + unsigned long mmin = 0x800000; + unsigned long mmax = 0xffffff; + double e = 1; + for (i = 1; i <= 104; i++) { + e *= 2; + ieee_table.e[i + 150] = e; + ieee_table.v[i + 150] = e * mmin; } - ieee_table.e[150]=1; - ieee_table.v[150]=mmin; - e=1; - for (i=1; i<150;i++) { - e/=2; - ieee_table.e[150-i]=e; - ieee_table.v[150-i]=e*mmin; + ieee_table.e[150] = 1; + ieee_table.v[150] = mmin; + e = 1; + for (i = 1; i < 150; i++) { + e /= 2; + ieee_table.e[150 - i] = e; + ieee_table.v[150 - i] = e * mmin; } - ieee_table.vmin=ieee_table.v[1]; - ieee_table.vmax=ieee_table.e[254]*mmax; - ieee_table.inited=1; + ieee_table.vmin = ieee_table.v[1]; + ieee_table.vmax = ieee_table.e[254] * mmax; + ieee_table.inited = 1; /*for (i=0;i<128;i++) printf("++++ ieee_table.v[%d]=%g\n",i,ieee_table.v[i]);*/ } } static void init_table_if_needed() { - GRIB_MUTEX_INIT_ONCE(&once,&init) + GRIB_MUTEX_INIT_ONCE(&once, &init) GRIB_MUTEX_LOCK(&mutex) - if (!ieee_table.inited) init_ieee_table(); + if (!ieee_table.inited) + init_ieee_table(); GRIB_MUTEX_UNLOCK(&mutex) } -static void binary_search(double xx[], const unsigned long n, double x, unsigned long *j) +static void binary_search(double xx[], const unsigned long n, double x, unsigned long* j) { /*These routine works only on ascending ordered arrays*/ - unsigned long ju,jm,jl; - jl=0; - ju=n; - while (ju-jl > 1) { - jm=(ju+jl) >> 1; + unsigned long ju, jm, jl; + jl = 0; + ju = n; + while (ju - jl > 1) { + jm = (ju + jl) >> 1; /* printf("jl=%lu jm=%lu ju=%lu\n",jl,jm,ju); */ /* printf("xx[jl]=%.10e xx[jm]=%.10e xx[ju]=%.10e\n",xx[jl],xx[jm],xx[ju]); */ - if (x >= xx[jm]) jl=jm; - else ju=jm; + if (x >= xx[jm]) + jl = jm; + else + ju = jm; } - *j=jl; + *j = jl; } double grib_ieee_table_e(unsigned long e) @@ -123,17 +127,20 @@ double grib_ieee_table_v(unsigned long e) unsigned long grib_ieee_to_long(double x) { - unsigned long s = 0; + unsigned long s = 0; unsigned long mmax = 0xffffff; unsigned long mmin = 0x800000; - unsigned long m = mmax; - unsigned long e=0; - double rmmax=mmax+0.5; + unsigned long m = mmax; + unsigned long e = 0; + double rmmax = mmax + 0.5; init_table_if_needed(); /* printf("\ngrib_ieee_to_long: x=%.20e\n",x); */ - if (x < 0) { s = 1; x = -x; } + if (x < 0) { + s = 1; + x = -x; + } /* Underflow */ if (x < ieee_table.vmin) { @@ -152,39 +159,47 @@ unsigned long grib_ieee_to_long(double x) /* printf("grib_ieee_to_long: e=%ld\n",e); */ - x/=ieee_table.e[e]; + x /= ieee_table.e[e]; /* printf("grib_ieee_to_long: x=%.20e\n",x); */ - while(x < mmin ) { x *= 2; e--; - /* printf("grib_ieee_to_long (e--): x=%.20e e=%ld \n",x,e); */ + while (x < mmin) { + x *= 2; + e--; + /* printf("grib_ieee_to_long (e--): x=%.20e e=%ld \n",x,e); */ } - while(x > rmmax ) { x /= 2; e++; - /* printf("grib_ieee_to_long (e++): x=%.20e e=%ld \n",x,e); */ + while (x > rmmax) { + x /= 2; + e++; + /* printf("grib_ieee_to_long (e++): x=%.20e e=%ld \n",x,e); */ } - m=x+0.5; + m = x + 0.5; /* printf("grib_ieee_to_long: m=0x%lX (%lu) x=%.10e \n",m,m,x ); */ - if ( m > mmax ) { e++; m=0x800000; - /* printf("grib_ieee_to_long: ( m > mmax ) m=0x%lX (%lu) x=%.10e \n",m,m,x ); */ + if (m > mmax) { + e++; + m = 0x800000; + /* printf("grib_ieee_to_long: ( m > mmax ) m=0x%lX (%lu) x=%.10e \n",m,m,x ); */ } /* printf("grib_ieee_to_long: s=%lu c=%lu (0x%lX) m=%lu (0x%lX)\n",s,e,e,m,m ); */ - return (s << 31) | ( e << 23 ) | ( m & 0x7fffff ); + return (s << 31) | (e << 23) | (m & 0x7fffff); } double grib_ieeefloat_error(double x) { - unsigned long e=0; + unsigned long e = 0; init_table_if_needed(); - if (x < 0) x = -x; + if (x < 0) + x = -x; /* Underflow */ - if (x < ieee_table.vmin) return ieee_table.vmin; + if (x < ieee_table.vmin) + return ieee_table.vmin; /* Overflow */ if (x > ieee_table.vmax) { @@ -195,34 +210,38 @@ double grib_ieeefloat_error(double x) binary_search(ieee_table.v, 254, x, &e); - return ieee_table.e[e] ; + return ieee_table.e[e]; } double grib_long_to_ieee(unsigned long x) { - unsigned long s = x & 0x80000000; + unsigned long s = x & 0x80000000; unsigned long c = (x & 0x7f800000) >> 23; unsigned long m = (x & 0x007fffff); double val; #ifdef DEBUG - if ( x > 0 && x < 0x800000 ) { + if (x > 0 && x < 0x800000) { fprintf(stderr, "grib_long_to_ieee: Invalid input %lu\n", x); Assert(0); } #endif init_table_if_needed(); - if (c == 0 && m==0) return 0; + if (c == 0 && m == 0) + return 0; - if (c == 0) { + if (c == 0) { + m |= 0x800000; + c = 1; + } + else m |= 0x800000; - c=1; - } else m |= 0x800000; - val=m*ieee_table.e[c]; - if(s) val = -val; + val = m * ieee_table.e[c]; + if (s) + val = -val; return val; } @@ -231,115 +250,137 @@ unsigned long grib_ieee_nearest_smaller_to_long(double x) { unsigned long l; unsigned long e; - unsigned long m ; + unsigned long m; unsigned long s; unsigned long mmin = 0x800000; - double y,eps; + double y, eps; - if(x == 0) return 0; + if (x == 0) + return 0; init_table_if_needed(); - l=grib_ieee_to_long(x); - y=grib_long_to_ieee(l); + l = grib_ieee_to_long(x); + y = grib_long_to_ieee(l); - if ( x < y ) { - if ( x < 0 && -x < ieee_table.vmin ) { - l=0x80800000; - } else { + if (x < y) { + if (x < 0 && -x < ieee_table.vmin) { + l = 0x80800000; + } + else { e = (l & 0x7f800000) >> 23; m = (l & 0x007fffff) | 0x800000; - s = l & 0x80000000; + s = l & 0x80000000; - if ( m == mmin ) { + if (m == mmin) { /* printf("grib_ieee_nearest_smaller_to_long: m == mmin (0x%lX) e=%lu\n",m,e); */ - e = s ? e : e-1; - if (e<1) e=1; - if (e>254) e=254; + e = s ? e : e - 1; + if (e < 1) + e = 1; + if (e > 254) + e = 254; /* printf("grib_ieee_nearest_smaller_to_long: e=%lu \n",e); */ } - eps=ieee_table.e[e]; + eps = ieee_table.e[e]; /* printf("grib_ieee_nearest_smaller_to_long: x= grib_long_to_ieee(l)); } return l; } -int grib_nearest_smaller_ieee_float(double a,double* ret) +int grib_nearest_smaller_ieee_float(double a, double* ret) { - unsigned long l=0; + unsigned long l = 0; init_table_if_needed(); - if (a>ieee_table.vmax) return GRIB_INTERNAL_ERROR; + if (a > ieee_table.vmax) + return GRIB_INTERNAL_ERROR; - l=grib_ieee_nearest_smaller_to_long(a); - *ret=grib_long_to_ieee(l); + l = grib_ieee_nearest_smaller_to_long(a); + *ret = grib_long_to_ieee(l); return GRIB_SUCCESS; } #else /* old code to be deleted */ -double grib_ieeefloat_error(double x) {return 0;} +double grib_ieeefloat_error(double x) +{ + return 0; +} double grib_long_to_ieee(unsigned long x) { - unsigned long s = x & 0x80000000; + unsigned long s = x & 0x80000000; unsigned long c = (x & 0x7f800000) >> 23; unsigned long m; double val; long e; - if(x == 0) return 0; + if (x == 0) + return 0; Assert(c != 255); - if(c == 0) { m = x & 0x007fffff; e = -126 - 23; } - else { m = (x & 0x007fffff) | (1<<23); e = c - 127 - 23; } + if (c == 0) { + m = x & 0x007fffff; + e = -126 - 23; + } + else { + m = (x & 0x007fffff) | (1 << 23); + e = c - 127 - 23; + } val = m; - while(e < 0) { val /= 2.0; e++; } - while(e > 0) { val *= 2.0; e--; } + while (e < 0) { + val /= 2.0; + e++; + } + while (e > 0) { + val *= 2.0; + e--; + } - if(s) val = -val; + if (s) + val = -val; return val; } -int grib_nearest_smaller_ieee_float(double a,double* x) +int grib_nearest_smaller_ieee_float(double a, double* x) { - double e = grib_long_to_ieee(grib_ieee_to_long(a)); + double e = grib_long_to_ieee(grib_ieee_to_long(a)); double b = a; /* printf("----> a=%g e=%g e-a=%g\n",a,e,e-a); */ - if( e > b ) - { + if (e > b) { unsigned long ub = grib_ieee_to_long(b); unsigned long ue; - while(e>b) - { + while (e > b) { /* printf("a=%g e=%g e-a=%g\n",a,e,e-a); */ - a -= (e-a); + a -= (e - a); e = grib_long_to_ieee(grib_ieee_to_long(a)); } ue = grib_ieee_to_long(e); - Assert((ue-ub) == 1); + Assert((ue - ub) == 1); } Assert(b >= e); - *x=e; + *x = e; return GRIB_SUCCESS; } @@ -348,34 +389,44 @@ unsigned long grib_ieee_to_long(double x) /* double y = x; */ unsigned long s = 0; unsigned long m; - long p = 0; + long p = 0; unsigned long e = 0; - if(x == 0) return 0; + if (x == 0) + return 0; - if(x < 0) { s = 1; x = -x; } - while(x < 2) { x *= 2; p--; } + if (x < 0) { + s = 1; + x = -x; + } + while (x < 2) { + x *= 2; + p--; + } - while(x >= 2) { x /= 2; p++; } + while (x >= 2) { + x /= 2; + p++; + } - if(p > 127 ) { + if (p > 127) { /* Overflow */ e = 255; m = 0; } - else if(p < -126) { + else if (p < -126) { /* int i; */ e = 0; /* printf("p=%ld x=%g %ld\n",p,x,p+126+23); */ - m = x * grib_power(p+126+23,2); + m = x * grib_power(p + 126 + 23, 2); } else { e = p + 127; - m = x * ( 1 << 23); + m = x * (1 << 23); m &= 0x007fffff; } - m = (s << 31) | ( e << 23 ) | m; + m = (s << 31) | (e << 23) | m; return m; } @@ -395,56 +446,56 @@ unsigned long grib_ieee_to_long(double x) unsigned long grib_ieee64_to_long(double x) { unsigned long lval; - memcpy(&lval,&x,8); + memcpy(&lval, &x, 8); return lval; } -double grib_long_to_ieee64 (unsigned long x) +double grib_long_to_ieee64(unsigned long x) { double dval; - memcpy(&dval,&x,8); + memcpy(&dval, &x, 8); return dval; } -int grib_ieee_decode_array(grib_context* c,unsigned char* buf,size_t nvals,int bytes,double* val) +int grib_ieee_decode_array(grib_context* c, unsigned char* buf, size_t nvals, int bytes, double* val) { - int err=0,i=0,j=0; - unsigned char s[8]={0,}; + int err = 0, i = 0, j = 0; + unsigned char s[8] = {0,}; float fval; - double* pval=val; + double* pval = val; switch (bytes) { - case 4: - for (i=0;i=0;j--) - s[j]=*(buf++); - memcpy(&fval,s,4); - val[i]=(double)fval; + for (j = 3; j >= 0; j--) + s[j] = *(buf++); + memcpy(&fval, s, 4); + val[i] = (double)fval; #elif IEEE_BE - memcpy(&fval,buf,4); - val[i]=(double)fval; - buf+=4; + memcpy(&fval, buf, 4); + val[i] = (double)fval; + buf += 4; #endif - } - break; - case 8: - for (i=0;i=0;j--) - s[j]=*(buf++); - memcpy(pval++,s,8); + for (j = 7; j >= 0; j--) + s[j] = *(buf++); + memcpy(pval++, s, 8); #elif IEEE_BE - memcpy(pval++,buf,8); - buf+=8; + memcpy(pval++, buf, 8); + buf += 8; #endif - } - break; - default: - grib_context_log(c,GRIB_LOG_ERROR, - "grib_ieee_decode_array: %d bits not implemented",bytes*8); - return GRIB_NOT_IMPLEMENTED; + } + break; + default: + grib_context_log(c, GRIB_LOG_ERROR, + "grib_ieee_decode_array: %d bits not implemented", bytes * 8); + return GRIB_NOT_IMPLEMENTED; } return err; @@ -452,13 +503,13 @@ int grib_ieee_decode_array(grib_context* c,unsigned char* buf,size_t nvals,int b #else -int grib_ieee_decode_array(grib_context* c,unsigned char* buf,size_t nvals,int bytes,double* val) +int grib_ieee_decode_array(grib_context* c, unsigned char* buf, size_t nvals, int bytes, double* val) { - int err=0,i=0; - long bitr=0; + int err = 0, i = 0; + long bitr = 0; - for(i=0;i< nvals;i++) - val[i] = grib_long_to_ieee(grib_decode_unsigned_long(buf,&bitr,bytes*8)); + for (i = 0; i < nvals; i++) + val[i] = grib_long_to_ieee(grib_decode_unsigned_long(buf, &bitr, bytes * 8)); return err; } @@ -467,45 +518,46 @@ int grib_ieee_decode_array(grib_context* c,unsigned char* buf,size_t nvals,int b #ifdef IEEE -int grib_ieee_encode_array(grib_context* c,double* val,size_t nvals,int bytes, - unsigned char* buf) { - int err=0,i=0,j=0; +int grib_ieee_encode_array(grib_context* c, double* val, size_t nvals, int bytes, + unsigned char* buf) +{ + int err = 0, i = 0, j = 0; unsigned char s4[4]; unsigned char s8[8]; - float fval=0; - double *pval=val; + float fval = 0; + double* pval = val; switch (bytes) { - case 4: - for (i=0;i=0;j--) - *(buf++)=s4[j]; + memcpy(s4, &(fval), 4); + for (j = 3; j >= 0; j--) + *(buf++) = s4[j]; #elif IEEE_BE - memcpy(buf,&(fval),4); - buf+=4; + memcpy(buf, &(fval), 4); + buf += 4; #endif - } - break; - case 8: - for (i=0;i=0;j--) - *(buf++)=s8[j]; + memcpy(s8, pval++, 8); + for (j = 7; j >= 0; j--) + *(buf++) = s8[j]; #elif IEEE_BE - memcpy(buf,pval++,8); - buf+=8; + memcpy(buf, pval++, 8); + buf += 8; #endif - } - break; - default: - grib_context_log(c,GRIB_LOG_ERROR, - "grib_ieee_encode_array: %d bits not implemented",bytes*8); - return GRIB_NOT_IMPLEMENTED; + } + break; + default: + grib_context_log(c, GRIB_LOG_ERROR, + "grib_ieee_encode_array: %d bits not implemented", bytes * 8); + return GRIB_NOT_IMPLEMENTED; } return err; @@ -515,11 +567,11 @@ int grib_ieee_encode_array(grib_context* c,double* val,size_t nvals,int bytes, int grib_ieee_encode_array(grib_context* c, double* val, size_t nvals, int bytes, unsigned char* buf) { - int err=0,i=0; - long bitr=0; + int err = 0, i = 0; + long bitr = 0; - for(i=0;i< nvals;i++) - grib_encode_unsigned_long(buf, grib_ieee_to_long(val[i]), &bitr, bytes*8); + for (i = 0; i < nvals; i++) + grib_encode_unsigned_long(buf, grib_ieee_to_long(val[i]), &bitr, bytes * 8); return err; } diff --git a/src/grib_index.c b/src/grib_index.c index 74edbb8f9..d2febf8db 100644 --- a/src/grib_index.c +++ b/src/grib_index.c @@ -60,134 +60,157 @@ static void init() static const char* mars_keys = "mars.date,mars.time,mars.expver,mars.stream,mars.class,mars.type," - "mars.step,mars.param,mars.levtype,mars.levelist,mars.number,mars.iteration," - "mars.domain,mars.fcmonth,mars.fcperiod,mars.hdate,mars.method," - "mars.model,mars.origin,mars.quantile,mars.range,mars.refdate,mars.direction,mars.frequency"; + "mars.step,mars.param,mars.levtype,mars.levelist,mars.number,mars.iteration," + "mars.domain,mars.fcmonth,mars.fcperiod,mars.hdate,mars.method," + "mars.model,mars.origin,mars.quantile,mars.range,mars.refdate,mars.direction,mars.frequency"; /* See GRIB-32: start off ID with -1 as it is incremented before being used */ -static int grib_filesid=-1; +static int grib_filesid = -1; static int index_count; -static char* get_key(char** keys,int *type) +static char* get_key(char** keys, int* type) { - char* key=NULL; - char* p=NULL; + char* key = NULL; + char* p = NULL; - if (keys==NULL || *keys == 0) return NULL; - *type=GRIB_TYPE_UNDEFINED; - p=*keys; - while (*p == ' ') p++; + if (keys == NULL || *keys == 0) + return NULL; + *type = GRIB_TYPE_UNDEFINED; + p = *keys; + while (*p == ' ') + p++; - while (*p != 0 && *p != ':' && *p != ',') p++; - if ( *p == ':' ) { - *type=grib_type_to_int(*(p+1)); - *p=0; + while (*p != 0 && *p != ':' && *p != ',') + p++; + if (*p == ':') { + *type = grib_type_to_int(*(p + 1)); + *p = 0; p++; - while (*p != 0 && *p != ',') {*(p++)=0;} - } else *type=GRIB_TYPE_UNDEFINED; - if (*p) {*p=0;p++;} - key=*keys; - *keys= *p==0 ? NULL : p; + while (*p != 0 && *p != ',') { + *(p++) = 0; + } + } + else + *type = GRIB_TYPE_UNDEFINED; + if (*p) { + *p = 0; + p++; + } + key = *keys; + *keys = *p == 0 ? NULL : p; return key; } -static int compare_long(const void* a,const void* b) +static int compare_long(const void* a, const void* b) { - long* arg1 = (long*) a; - long* arg2 = (long*) b; - if( *arg1 == *arg2 ) return 0; + long* arg1 = (long*)a; + long* arg2 = (long*)b; + if (*arg1 == *arg2) + return 0; return *arg1 < *arg2 ? -1 : 1; } -static int compare_double(const void* a,const void* b) +static int compare_double(const void* a, const void* b) { - double* arg1 = (double*) a; - double* arg2 = (double*) b; - if( *arg1 == *arg2 ) return 0; + double* arg1 = (double*)a; + double* arg2 = (double*)b; + if (*arg1 == *arg2) + return 0; return *arg1 < *arg2 ? -1 : 1; } -static int compare_string(const void* a,const void* b) +static int compare_string(const void* a, const void* b) { - char* arg1 = *(char* const*) a; - char* arg2 = *(char* const*) b; + char* arg1 = *(char* const*)a; + char* arg2 = *(char* const*)b; - while (*arg1 != 0 && *arg2 != 0 && *arg1 == *arg2 ) {arg1++;arg2++;} + while (*arg1 != 0 && *arg2 != 0 && *arg1 == *arg2) { + arg1++; + arg2++; + } - if( *arg1 == *arg2 ) return 0; + if (*arg1 == *arg2) + return 0; return *arg1 < *arg2 ? -1 : 1; } -static int grib_index_keys_compress(grib_context* c,grib_index* index,int* compress) +static int grib_index_keys_compress(grib_context* c, grib_index* index, int* compress) { - grib_index_key *keys=index->keys->next; - grib_index_key *prev=index->keys; - int level=0; + grib_index_key* keys = index->keys->next; + grib_index_key* prev = index->keys; + int level = 0; - if (!keys) return 0; + if (!keys) + return 0; - level=1; + level = 1; while (keys) { - if (keys->values_count==1) { - prev->next=keys->next; - grib_context_free(c,keys->name); - grib_context_free(c,keys); - keys=prev->next; - compress[level]=1; + if (keys->values_count == 1) { + prev->next = keys->next; + grib_context_free(c, keys->name); + grib_context_free(c, keys); + keys = prev->next; + compress[level] = 1; level++; - } else { - prev=keys; - keys=keys->next; - compress[level]=0; + } + else { + prev = keys; + keys = keys->next; + compress[level] = 0; level++; } } - if (index->keys->values_count==1) { - keys=index->keys; - index->keys=index->keys->next; - grib_context_free(c,keys->name); - grib_context_free(c,keys); - compress[0]=1; - } else compress[0]=0; + if (index->keys->values_count == 1) { + keys = index->keys; + index->keys = index->keys->next; + grib_context_free(c, keys->name); + grib_context_free(c, keys); + compress[0] = 1; + } + else + compress[0] = 0; return 0; } static int grib_index_fields_compress(grib_context* c, - grib_field_tree* fields,grib_field_tree* prev,int level,int* compress) + grib_field_tree* fields, grib_field_tree* prev, int level, int* compress) { - if (!fields) return 0; + if (!fields) + return 0; if (!prev) { if (fields->next) - grib_index_fields_compress(c,fields->next,0,level,compress); + grib_index_fields_compress(c, fields->next, 0, level, compress); level++; - return grib_index_fields_compress(c,fields->next_level,fields,level,compress); + return grib_index_fields_compress(c, fields->next_level, fields, level, compress); } if (compress[level]) { - if (!fields->next_level) prev->field=fields->field; + if (!fields->next_level) + prev->field = fields->field; - prev->next_level=fields->next_level; - grib_context_free(c,fields->value); - grib_context_free(c,fields); + prev->next_level = fields->next_level; + grib_context_free(c, fields->value); + grib_context_free(c, fields); level++; - grib_index_fields_compress(c,prev->next_level,prev,level,compress); - } else { + grib_index_fields_compress(c, prev->next_level, prev, level, compress); + } + else { grib_field_tree* next; - next=fields->next; + next = fields->next; level++; while (next) { - grib_index_fields_compress(c,next->next_level,next,level,compress); - next=next->next; + grib_index_fields_compress(c, next->next_level, next, level, compress); + next = next->next; } - grib_index_fields_compress(c,fields->next_level,fields,level,compress); + grib_index_fields_compress(c, fields->next_level, fields, level, compress); } return 0; @@ -195,169 +218,183 @@ static int grib_index_fields_compress(grib_context* c, int grib_index_compress(grib_index* index) { - int err=0; - grib_context* c=index->context; - int compress[200]={0,}; + int err = 0; + grib_context* c = index->context; + int compress[200] = {0,}; - if (!index->keys->next) return 0; + if (!index->keys->next) + return 0; - err=grib_index_keys_compress(c,index,compress); - if (err) return err; + err = grib_index_keys_compress(c, index, compress); + if (err) + return err; - grib_index_fields_compress(c,index->fields,0,0,compress); + grib_index_fields_compress(c, index->fields, 0, 0, compress); if (!index->fields->next) { - grib_field_tree* next_level=index->fields->next_level; - grib_context_free(c,index->fields->value); - grib_context_free(c,index->fields); - index->fields=next_level; + grib_field_tree* next_level = index->fields->next_level; + grib_context_free(c, index->fields->value); + grib_context_free(c, index->fields); + index->fields = next_level; } return 0; } -static grib_index_key* grib_index_new_key(grib_context* c,grib_index_key* keys, - const char* key,int type,int *err) +static grib_index_key* grib_index_new_key(grib_context* c, grib_index_key* keys, + const char* key, int type, int* err) { - grib_index_key *next=NULL,*current=NULL; - grib_string_list* values=NULL; + grib_index_key *next = NULL, *current = NULL; + grib_string_list* values = NULL; - next=(grib_index_key*)grib_context_malloc_clear(c,sizeof(grib_index_key)); + next = (grib_index_key*)grib_context_malloc_clear(c, sizeof(grib_index_key)); if (!next) { - grib_context_log(c,GRIB_LOG_ERROR, - "unable to allocate %d bytes", - sizeof(grib_index_key)); - *err=GRIB_OUT_OF_MEMORY; + grib_context_log(c, GRIB_LOG_ERROR, + "unable to allocate %d bytes", + sizeof(grib_index_key)); + *err = GRIB_OUT_OF_MEMORY; return NULL; } - values=(grib_string_list*)grib_context_malloc_clear(c,sizeof(grib_string_list)); + values = (grib_string_list*)grib_context_malloc_clear(c, sizeof(grib_string_list)); if (!values) { - grib_context_log(c,GRIB_LOG_ERROR, - "unable to allocate %d bytes", - sizeof(grib_string_list)); - *err=GRIB_OUT_OF_MEMORY; + grib_context_log(c, GRIB_LOG_ERROR, + "unable to allocate %d bytes", + sizeof(grib_string_list)); + *err = GRIB_OUT_OF_MEMORY; return NULL; } - next->values=values; + next->values = values; if (!keys) { - keys=next; - current=keys; - } else { - current=keys; - while (current->next) current=current->next; - current->next=next; - current=current->next; + keys = next; + current = keys; + } + else { + current = keys; + while (current->next) + current = current->next; + current->next = next; + current = current->next; } - current->type=type; - current->name=grib_context_strdup(c,key); + current->type = type; + current->name = grib_context_strdup(c, key); return keys; } -int grib_read_uchar(FILE* fh,unsigned char *val) +int grib_read_uchar(FILE* fh, unsigned char* val) { - if (fread(val,sizeof(unsigned char),1,fh) <1) { - if (feof(fh)) return GRIB_END_OF_FILE; - else return GRIB_IO_PROBLEM; + if (fread(val, sizeof(unsigned char), 1, fh) < 1) { + if (feof(fh)) + return GRIB_END_OF_FILE; + else + return GRIB_IO_PROBLEM; } return GRIB_SUCCESS; } -int grib_read_short( FILE* fh,short *val) +int grib_read_short(FILE* fh, short* val) { - if (fread(val,sizeof(short),1,fh) <1) { - if (feof(fh)) return GRIB_END_OF_FILE; - else return GRIB_IO_PROBLEM; + if (fread(val, sizeof(short), 1, fh) < 1) { + if (feof(fh)) + return GRIB_END_OF_FILE; + else + return GRIB_IO_PROBLEM; } return GRIB_SUCCESS; } -int grib_read_long( FILE* fh,long *val) +int grib_read_long(FILE* fh, long* val) { - if (fread(val,sizeof(long),1,fh) <1) { - if (feof(fh)) return GRIB_END_OF_FILE; - else return GRIB_IO_PROBLEM; + if (fread(val, sizeof(long), 1, fh) < 1) { + if (feof(fh)) + return GRIB_END_OF_FILE; + else + return GRIB_IO_PROBLEM; } return GRIB_SUCCESS; } -int grib_read_unsigned_long( FILE* fh,unsigned long *val) +int grib_read_unsigned_long(FILE* fh, unsigned long* val) { - if (fread(val,sizeof(long),1,fh) <1) { - if (feof(fh)) return GRIB_END_OF_FILE; - else return GRIB_IO_PROBLEM; + if (fread(val, sizeof(long), 1, fh) < 1) { + if (feof(fh)) + return GRIB_END_OF_FILE; + else + return GRIB_IO_PROBLEM; } return GRIB_SUCCESS; } -int grib_write_uchar(FILE* fh,unsigned char val) +int grib_write_uchar(FILE* fh, unsigned char val) { - if (fwrite(&val,sizeof(unsigned char),1,fh)<1) + if (fwrite(&val, sizeof(unsigned char), 1, fh) < 1) return GRIB_IO_PROBLEM; return GRIB_SUCCESS; } -int grib_write_short(FILE* fh,short val) +int grib_write_short(FILE* fh, short val) { - if (fwrite(&val,sizeof(short),1,fh)<1) + if (fwrite(&val, sizeof(short), 1, fh) < 1) return GRIB_IO_PROBLEM; return GRIB_SUCCESS; } -int grib_write_long(FILE* fh,long val) +int grib_write_long(FILE* fh, long val) { - if (fwrite(&val,sizeof(long),1,fh)<1) + if (fwrite(&val, sizeof(long), 1, fh) < 1) return GRIB_IO_PROBLEM; return GRIB_SUCCESS; } -int grib_write_unsigned_long(FILE* fh,unsigned long val) +int grib_write_unsigned_long(FILE* fh, unsigned long val) { - if (fwrite(&val,sizeof(long),1,fh)<1) + if (fwrite(&val, sizeof(long), 1, fh) < 1) return GRIB_IO_PROBLEM; return GRIB_SUCCESS; } -int grib_write_string(FILE* fh,const char* s) +int grib_write_string(FILE* fh, const char* s) { size_t len = 0; if (s == NULL) return GRIB_IO_PROBLEM; len = strlen(s); - grib_write_uchar(fh,(unsigned char)len); - if (fwrite(s,1,len,fh)file->id); - if (err) return err; + err = grib_write_short(fh, field->file->id); + if (err) + return err; - err=grib_write_unsigned_long(fh,field->offset); - if (err) return err; + err = grib_write_unsigned_long(fh, field->offset); + if (err) + return err; - err=grib_write_unsigned_long(fh,field->length); - if (err) return err; + err = grib_write_unsigned_long(fh, field->length); + if (err) + return err; - err=grib_write_field(fh,field->next); - if (err) return err; + err = grib_write_field(fh, field->next); + if (err) + return err; return GRIB_SUCCESS; } -static grib_field* grib_read_field(grib_context* c, FILE* fh, grib_file** files, int *err) +static grib_field* grib_read_field(grib_context* c, FILE* fh, grib_file** files, int* err) { - grib_field* field=NULL; + grib_field* field = NULL; short file_id; - unsigned char marker=0; - unsigned long offset=0; - unsigned long length=0; + unsigned char marker = 0; + unsigned long offset = 0; + unsigned long length = 0; - *err = grib_read_uchar(fh,&marker); - if(marker == NULL_MARKER) return NULL; - if(marker != NOT_NULL_MARKER) {*err=GRIB_CORRUPTED_INDEX;return NULL;} + *err = grib_read_uchar(fh, &marker); + if (marker == NULL_MARKER) + return NULL; + if (marker != NOT_NULL_MARKER) { + *err = GRIB_CORRUPTED_INDEX; + return NULL; + } index_count++; - field=(grib_field*)grib_context_malloc(c,sizeof(grib_field)); - *err=grib_read_short(fh,&file_id); - if (*err) return NULL; + field = (grib_field*)grib_context_malloc(c, sizeof(grib_field)); + *err = grib_read_short(fh, &file_id); + if (*err) + return NULL; - field->file=files[file_id]; + field->file = files[file_id]; - *err=grib_read_unsigned_long(fh,&offset); - field->offset=offset; - if (*err) return NULL; + *err = grib_read_unsigned_long(fh, &offset); + field->offset = offset; + if (*err) + return NULL; - *err=grib_read_unsigned_long(fh,&length); - field->length=length; - if (*err) return NULL; + *err = grib_read_unsigned_long(fh, &length); + field->length = length; + if (*err) + return NULL; - field->next=grib_read_field(c,fh,files,err); + field->next = grib_read_field(c, fh, files, err); return field; } -static int grib_write_field_tree(FILE* fh,grib_field_tree* tree) +static int grib_write_field_tree(FILE* fh, grib_field_tree* tree) { - int err=0; + int err = 0; - if(!tree) + if (!tree) return grib_write_null_marker(fh); - err=grib_write_not_null_marker(fh); - if (err) return err; + err = grib_write_not_null_marker(fh); + if (err) + return err; - err=grib_write_field(fh,tree->field); - if (err) return err; + err = grib_write_field(fh, tree->field); + if (err) + return err; - err=grib_write_string(fh,tree->value); - if (err) return err; + err = grib_write_string(fh, tree->value); + if (err) + return err; - err=grib_write_field_tree(fh,tree->next_level); - if (err) return err; + err = grib_write_field_tree(fh, tree->next_level); + if (err) + return err; - err=grib_write_field_tree(fh,tree->next); - if (err) return err; + err = grib_write_field_tree(fh, tree->next); + if (err) + return err; return GRIB_SUCCESS; } -grib_field_tree* grib_read_field_tree(grib_context* c, FILE* fh, grib_file** files, int *err) +grib_field_tree* grib_read_field_tree(grib_context* c, FILE* fh, grib_file** files, int* err) { - grib_field_tree* tree=NULL; - unsigned char marker=0; - *err = grib_read_uchar(fh,&marker); + grib_field_tree* tree = NULL; + unsigned char marker = 0; + *err = grib_read_uchar(fh, &marker); - if(marker == NULL_MARKER) return NULL; - if(marker != NOT_NULL_MARKER) {*err=GRIB_CORRUPTED_INDEX;return NULL;} + if (marker == NULL_MARKER) + return NULL; + if (marker != NOT_NULL_MARKER) { + *err = GRIB_CORRUPTED_INDEX; + return NULL; + } - tree = (grib_field_tree*)grib_context_malloc(c, sizeof(grib_field_tree)); - tree->field = grib_read_field(c,fh,files,err); - if (*err) return NULL; + tree = (grib_field_tree*)grib_context_malloc(c, sizeof(grib_field_tree)); + tree->field = grib_read_field(c, fh, files, err); + if (*err) + return NULL; - tree->value = grib_read_string(c,fh,err); - if (*err) return NULL; + tree->value = grib_read_string(c, fh, err); + if (*err) + return NULL; - tree->next_level = grib_read_field_tree(c,fh,files,err); - if (*err) return NULL; + tree->next_level = grib_read_field_tree(c, fh, files, err); + if (*err) + return NULL; - tree->next = grib_read_field_tree(c,fh,files,err); - if (*err) return NULL; + tree->next = grib_read_field_tree(c, fh, files, err); + if (*err) + return NULL; return tree; } -grib_index* grib_index_new(grib_context* c,const char* key,int *err) +grib_index* grib_index_new(grib_context* c, const char* key, int* err) { grib_index* index; - grib_index_key* keys=NULL; + grib_index_key* keys = NULL; char* q; int type; char* p; - if (!strcmp(key,"mars")) - return grib_index_new(c,mars_keys,err); + if (!strcmp(key, "mars")) + return grib_index_new(c, mars_keys, err); - p= grib_context_strdup(c,key); - q=p; + p = grib_context_strdup(c, key); + q = p; - *err=0; - if (!c) c=grib_context_get_default(); + *err = 0; + if (!c) + c = grib_context_get_default(); - index=(grib_index*)grib_context_malloc_clear(c,sizeof(grib_index)); + index = (grib_index*)grib_context_malloc_clear(c, sizeof(grib_index)); if (!index) { - grib_context_log(c,GRIB_LOG_ERROR,"unable to create index"); - *err=GRIB_OUT_OF_MEMORY; + grib_context_log(c, GRIB_LOG_ERROR, "unable to create index"); + *err = GRIB_OUT_OF_MEMORY; return NULL; } - index->context=c; + index->context = c; - while ((key=get_key(&p,&type))!=NULL) { - keys=grib_index_new_key(c,keys,key,type,err); - if (*err) return NULL; + while ((key = get_key(&p, &type)) != NULL) { + keys = grib_index_new_key(c, keys, key, type, err); + if (*err) + return NULL; + } + index->keys = keys; + index->fields = (grib_field_tree*)grib_context_malloc_clear(c, + sizeof(grib_field_tree)); + if (!index->fields) { + *err = GRIB_OUT_OF_MEMORY; + return NULL; } - index->keys=keys; - index->fields=(grib_field_tree*)grib_context_malloc_clear(c, - sizeof(grib_field_tree)); - if (!index->fields) {*err=GRIB_OUT_OF_MEMORY;return NULL;} - grib_context_free(c,q); + grib_context_free(c, q); return index; } -static void grib_index_values_delete(grib_context* c,grib_string_list* values) +static void grib_index_values_delete(grib_context* c, grib_string_list* values) { - if (!values) return; + if (!values) + return; - grib_index_values_delete(c,values->next); - grib_context_free(c,values->value); - grib_context_free(c,values); + grib_index_values_delete(c, values->next); + grib_context_free(c, values->value); + grib_context_free(c, values); - return ; + return; } -static void grib_index_key_delete(grib_context* c,grib_index_key* keys) +static void grib_index_key_delete(grib_context* c, grib_index_key* keys) { - if (!keys) return; - - grib_index_key_delete(c,keys->next); + if (!keys) + return; - grib_index_values_delete(c,keys->values); - grib_index_values_delete(c,keys->current); - grib_context_free(c,keys->name); - grib_context_free(c,keys); + grib_index_key_delete(c, keys->next); + grib_index_values_delete(c, keys->values); + grib_index_values_delete(c, keys->current); + grib_context_free(c, keys->name); + grib_context_free(c, keys); } -static long values_count=0; -static grib_string_list* grib_read_key_values(grib_context* c,FILE* fh,int *err) +static long values_count = 0; +static grib_string_list* grib_read_key_values(grib_context* c, FILE* fh, int* err) { grib_string_list* values; - unsigned char marker=0; + unsigned char marker = 0; - *err = grib_read_uchar(fh,&marker); - if(marker == NULL_MARKER) return NULL; - if(marker != NOT_NULL_MARKER) {*err=GRIB_CORRUPTED_INDEX;return NULL;} + *err = grib_read_uchar(fh, &marker); + if (marker == NULL_MARKER) + return NULL; + if (marker != NOT_NULL_MARKER) { + *err = GRIB_CORRUPTED_INDEX; + return NULL; + } values_count++; - values=(grib_string_list*)grib_context_malloc_clear(c,sizeof(grib_string_list)); - values->value=grib_read_string(c,fh,err); - if (*err) return NULL; + values = (grib_string_list*)grib_context_malloc_clear(c, sizeof(grib_string_list)); + values->value = grib_read_string(c, fh, err); + if (*err) + return NULL; - values->next=grib_read_key_values(c,fh,err); - if (*err) return NULL; + values->next = grib_read_key_values(c, fh, err); + if (*err) + return NULL; return values; } -static int grib_write_key_values(FILE* fh,grib_string_list* values) +static int grib_write_key_values(FILE* fh, grib_string_list* values) { - int err=0; + int err = 0; if (!values) return grib_write_null_marker(fh); - err=grib_write_not_null_marker(fh); - if (err) return err; + err = grib_write_not_null_marker(fh); + if (err) + return err; - err=grib_write_string(fh,values->value); - if (err) return err; + err = grib_write_string(fh, values->value); + if (err) + return err; - err=grib_write_key_values(fh,values->next); - if (err) return err; + err = grib_write_key_values(fh, values->next); + if (err) + return err; return GRIB_SUCCESS; } -static grib_index_key* grib_read_index_keys(grib_context* c,FILE* fh,int *err) +static grib_index_key* grib_read_index_keys(grib_context* c, FILE* fh, int* err) { - grib_index_key* keys=NULL; - unsigned char marker=0; - unsigned char type=0; + grib_index_key* keys = NULL; + unsigned char marker = 0; + unsigned char type = 0; - if (!c) c=grib_context_get_default(); + if (!c) + c = grib_context_get_default(); - *err = grib_read_uchar(fh,&marker); - if(marker == NULL_MARKER) return NULL; - if(marker != NOT_NULL_MARKER) {*err=GRIB_CORRUPTED_INDEX;return NULL;} + *err = grib_read_uchar(fh, &marker); + if (marker == NULL_MARKER) + return NULL; + if (marker != NOT_NULL_MARKER) { + *err = GRIB_CORRUPTED_INDEX; + return NULL; + } - keys= (grib_index_key*)grib_context_malloc_clear(c,sizeof(grib_index_key)); - keys->name = grib_read_string(c,fh,err); - if (*err) return NULL; + keys = (grib_index_key*)grib_context_malloc_clear(c, sizeof(grib_index_key)); + keys->name = grib_read_string(c, fh, err); + if (*err) + return NULL; - *err = grib_read_uchar(fh,&type); - keys->type=type; - if (*err) return NULL; + *err = grib_read_uchar(fh, &type); + keys->type = type; + if (*err) + return NULL; - values_count=0; - keys->values=grib_read_key_values(c,fh,err); - if (*err) return NULL; + values_count = 0; + keys->values = grib_read_key_values(c, fh, err); + if (*err) + return NULL; - keys->values_count=values_count; + keys->values_count = values_count; - keys->next=grib_read_index_keys(c,fh,err); - if (*err) return NULL; + keys->next = grib_read_index_keys(c, fh, err); + if (*err) + return NULL; return keys; } -static int grib_write_index_keys(FILE* fh,grib_index_key* keys) +static int grib_write_index_keys(FILE* fh, grib_index_key* keys) { - int err=0; + int err = 0; if (!keys) return grib_write_null_marker(fh); - err=grib_write_not_null_marker(fh); - if (err) return err; + err = grib_write_not_null_marker(fh); + if (err) + return err; - err=grib_write_string(fh,keys->name); - if (err) return err; + err = grib_write_string(fh, keys->name); + if (err) + return err; - err=grib_write_uchar(fh,(unsigned char)keys->type); - if (err) return err; + err = grib_write_uchar(fh, (unsigned char)keys->type); + if (err) + return err; - err=grib_write_key_values(fh,keys->values); - if (err) return err; + err = grib_write_key_values(fh, keys->values); + if (err) + return err; - err=grib_write_index_keys(fh,keys->next); - if (err) return err; + err = grib_write_index_keys(fh, keys->next); + if (err) + return err; return GRIB_SUCCESS; } -static void grib_field_delete(grib_context* c,grib_field* field) +static void grib_field_delete(grib_context* c, grib_field* field) { - int err=0; + int err = 0; - if (!field) return; + if (!field) + return; - grib_field_delete(c,field->next); + grib_field_delete(c, field->next); if (field->file) { grib_file_close(field->file->name, 0, &err); - field->file=NULL; + field->file = NULL; } - grib_context_free(c,field); + grib_context_free(c, field); } -static void grib_field_tree_delete(grib_context* c,grib_field_tree* tree) +static void grib_field_tree_delete(grib_context* c, grib_field_tree* tree) { - if(!tree) return; - - grib_field_delete(c,tree->field); - grib_context_free(c,tree->value); + if (!tree) + return; - grib_field_tree_delete(c,tree->next_level); + grib_field_delete(c, tree->field); + grib_context_free(c, tree->value); - grib_field_tree_delete(c,tree->next); + grib_field_tree_delete(c, tree->next_level); - grib_context_free(c,tree); + grib_field_tree_delete(c, tree->next); + grib_context_free(c, tree); } static void grib_field_list_delete(grib_context* c, grib_field_list* field_list) { grib_field_list* p = field_list; - if (!field_list) return; + if (!field_list) + return; while (p) { - grib_field_list* q=p; - p = p->next; - grib_context_free(c,q); + grib_field_list* q = p; + p = p->next; + grib_context_free(c, q); } } void grib_index_delete(grib_index* index) { - grib_file* file=index->files; - grib_index_key_delete(index->context,index->keys); - grib_field_tree_delete(index->context,index->fields); - grib_field_list_delete(index->context,index->fieldset); + grib_file* file = index->files; + grib_index_key_delete(index->context, index->keys); + grib_field_tree_delete(index->context, index->fields); + grib_field_list_delete(index->context, index->fieldset); while (file) { - grib_file* f=file; - file=file->next; + grib_file* f = file; + file = file->next; grib_file_delete(f); } - grib_context_free(index->context,index); + grib_context_free(index->context, index); } -static int grib_write_files(FILE* fh,grib_file* files) +static int grib_write_files(FILE* fh, grib_file* files) { int err; if (!files) return grib_write_null_marker(fh); - err=grib_write_not_null_marker(fh); - if (err) return err; + err = grib_write_not_null_marker(fh); + if (err) + return err; - err=grib_write_string(fh,files->name); - if (err) return err; + err = grib_write_string(fh, files->name); + if (err) + return err; - err=grib_write_short(fh,(short)files->id); - if (err) return err; + err = grib_write_short(fh, (short)files->id); + if (err) + return err; - return grib_write_files(fh,files->next); + return grib_write_files(fh, files->next); } -static grib_file* grib_read_files(grib_context *c, FILE* fh, int *err) +static grib_file* grib_read_files(grib_context* c, FILE* fh, int* err) { - unsigned char marker=0; - short id=0; + unsigned char marker = 0; + short id = 0; grib_file* file; - *err = grib_read_uchar(fh,&marker); - if(marker == NULL_MARKER) return NULL; - if(marker != NOT_NULL_MARKER) {*err=GRIB_CORRUPTED_INDEX;return NULL;} + *err = grib_read_uchar(fh, &marker); + if (marker == NULL_MARKER) + return NULL; + if (marker != NOT_NULL_MARKER) { + *err = GRIB_CORRUPTED_INDEX; + return NULL; + } - file=(grib_file*)grib_context_malloc(c,sizeof(grib_file)); - file->name=grib_read_string(c,fh,err); - if (*err) return NULL; + file = (grib_file*)grib_context_malloc(c, sizeof(grib_file)); + file->name = grib_read_string(c, fh, err); + if (*err) + return NULL; - *err=grib_read_short(fh,&id); - file->id=id; - if (*err) return NULL; + *err = grib_read_short(fh, &id); + file->id = id; + if (*err) + return NULL; - file->next=grib_read_files(c,fh,err); - if (*err) return NULL; + file->next = grib_read_files(c, fh, err); + if (*err) + return NULL; return file; } -int grib_index_write(grib_index* index,const char* filename) +int grib_index_write(grib_index* index, const char* filename) { - int err=0; + int err = 0; FILE* fh; grib_file* files; - fh=fopen(filename,"w"); + fh = fopen(filename, "w"); if (!fh) { - grib_context_log(index->context,(GRIB_LOG_ERROR)|(GRIB_LOG_PERROR), - "Unable to write in file %s",filename); + grib_context_log(index->context, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), + "Unable to write in file %s", filename); perror(filename); return GRIB_IO_PROBLEM; } - err=grib_write_identifier(fh); + err = grib_write_identifier(fh); if (err) { - grib_context_log(index->context,(GRIB_LOG_ERROR)|(GRIB_LOG_PERROR), - "Unable to write in file %s",filename); + grib_context_log(index->context, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), + "Unable to write in file %s", filename); perror(filename); return err; } - if (!index) return grib_write_null_marker(fh); + if (!index) + return grib_write_null_marker(fh); - err=grib_write_not_null_marker(fh); - if (err) return err; + err = grib_write_not_null_marker(fh); + if (err) + return err; /* See GRIB-32: Do not use the file pool */ /* files=grib_file_pool_get_files(); */ - files=index->files; - err=grib_write_files(fh,files); + files = index->files; + err = grib_write_files(fh, files); if (err) { - grib_context_log(index->context,(GRIB_LOG_ERROR)|(GRIB_LOG_PERROR), - "Unable to write in file %s",filename); + grib_context_log(index->context, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), + "Unable to write in file %s", filename); perror(filename); return err; } - err=grib_write_index_keys(fh,index->keys); + err = grib_write_index_keys(fh, index->keys); if (err) { - grib_context_log(index->context,(GRIB_LOG_ERROR)|(GRIB_LOG_PERROR), - "Unable to write in file %s",filename); + grib_context_log(index->context, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), + "Unable to write in file %s", filename); perror(filename); return err; } - err=grib_write_field_tree(fh,index->fields); + err = grib_write_field_tree(fh, index->fields); if (err) { - grib_context_log(index->context,(GRIB_LOG_ERROR)|(GRIB_LOG_PERROR), - "Unable to write in file %s",filename); + grib_context_log(index->context, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), + "Unable to write in file %s", filename); perror(filename); return err; } if (fclose(fh) != 0) { - grib_context_log(index->context,(GRIB_LOG_ERROR)|(GRIB_LOG_PERROR), - "Unable to write in file %s",filename); + grib_context_log(index->context, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), + "Unable to write in file %s", filename); perror(filename); return GRIB_IO_PROBLEM; } @@ -791,82 +896,88 @@ int grib_index_write(grib_index* index,const char* filename) return err; } -grib_index* grib_index_read(grib_context* c, const char* filename, int *err) +grib_index* grib_index_read(grib_context* c, const char* filename, int* err) { - grib_file *file,*f; + grib_file *file, *f; grib_file** files; - grib_index* index=NULL; - unsigned char marker=0; - char* identifier=NULL; - int max=0; - FILE* fh = NULL; + grib_index* index = NULL; + unsigned char marker = 0; + char* identifier = NULL; + int max = 0; + FILE* fh = NULL; - if (!c) c=grib_context_get_default(); + if (!c) + c = grib_context_get_default(); - fh=fopen(filename,"r"); + fh = fopen(filename, "r"); if (!fh) { - grib_context_log(c,(GRIB_LOG_ERROR)|(GRIB_LOG_PERROR), - "Unable to read file %s",filename); + grib_context_log(c, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), + "Unable to read file %s", filename); perror(filename); - *err=GRIB_IO_PROBLEM; + *err = GRIB_IO_PROBLEM; return NULL; } - identifier=grib_read_string(c,fh,err); + identifier = grib_read_string(c, fh, err); if (!identifier) { fclose(fh); return NULL; } - grib_context_free(c,identifier); + grib_context_free(c, identifier); - *err = grib_read_uchar(fh,&marker); - if(marker == NULL_MARKER) { + *err = grib_read_uchar(fh, &marker); + if (marker == NULL_MARKER) { fclose(fh); return NULL; } - if(marker != NOT_NULL_MARKER) { - *err=GRIB_CORRUPTED_INDEX; + if (marker != NOT_NULL_MARKER) { + *err = GRIB_CORRUPTED_INDEX; fclose(fh); return NULL; } - file = grib_read_files(c,fh,err); - if (*err) return NULL; + file = grib_read_files(c, fh, err); + if (*err) + return NULL; - f=file; + f = file; while (f) { - if (maxid) max=f->id; - f=f->next; + if (max < f->id) + max = f->id; + f = f->next; } - files=(grib_file**)grib_context_malloc_clear(c,sizeof(grib_file)*(max+1)); + files = (grib_file**)grib_context_malloc_clear(c, sizeof(grib_file) * (max + 1)); - f=file; + f = file; while (f) { - grib_file_open(f->name,"r",err); - if (*err) return NULL; - files[f->id]=grib_get_file(f->name,err); /* fetch from pool */ - f=f->next; + grib_file_open(f->name, "r", err); + if (*err) + return NULL; + files[f->id] = grib_get_file(f->name, err); /* fetch from pool */ + f = f->next; } while (file) { - f=file; - file=file->next; - grib_context_free(c,f->name); - grib_context_free(c,f); + f = file; + file = file->next; + grib_context_free(c, f->name); + grib_context_free(c, f); } - index=(grib_index*)grib_context_malloc_clear(c,sizeof(grib_index)); - index->context=c; + index = (grib_index*)grib_context_malloc_clear(c, sizeof(grib_index)); + index->context = c; - index->keys=grib_read_index_keys(c,fh,err); - if (*err) return NULL; + index->keys = grib_read_index_keys(c, fh, err); + if (*err) + return NULL; - index_count=0; - index->fields=grib_read_field_tree(c,fh,files,err); - if (*err) return NULL; + index_count = 0; + index->fields = grib_read_field_tree(c, fh, files, err); + if (*err) + return NULL; - index->count=index_count; + index->count = index_count; fclose(fh); return index; @@ -874,62 +985,70 @@ grib_index* grib_index_read(grib_context* c, const char* filename, int *err) int grib_index_search_same(grib_index* index, grib_handle* h) { - int err=0; - char buf[1024]={0,}; - size_t buflen=1024; + int err = 0; + char buf[1024] = {0,}; + size_t buflen = 1024; grib_index_key* keys; - long lval=0; - double dval=0.0; + long lval = 0; + double dval = 0.0; grib_context* c; - if (!index) return GRIB_NULL_INDEX; - c=index->context; + if (!index) + return GRIB_NULL_INDEX; + c = index->context; - keys=index->keys; + keys = index->keys; while (keys) { - if (keys->type==GRIB_TYPE_UNDEFINED) { - err=grib_get_native_type(h,keys->name,&(keys->type)); - if (err) keys->type=GRIB_TYPE_STRING; + if (keys->type == GRIB_TYPE_UNDEFINED) { + err = grib_get_native_type(h, keys->name, &(keys->type)); + if (err) + keys->type = GRIB_TYPE_STRING; } - buflen=1024; + buflen = 1024; switch (keys->type) { - case GRIB_TYPE_STRING: - err=grib_get_string(h,keys->name,buf,&buflen); - if (err==GRIB_NOT_FOUND) sprintf(buf,GRIB_KEY_UNDEF); - break; - case GRIB_TYPE_LONG: - err=grib_get_long(h,keys->name,&lval); - if (err==GRIB_NOT_FOUND) sprintf(buf,GRIB_KEY_UNDEF); - else sprintf(buf,"%ld",lval); - break; - case GRIB_TYPE_DOUBLE: - err=grib_get_double(h,keys->name,&dval); - if (err==GRIB_NOT_FOUND) sprintf(buf,GRIB_KEY_UNDEF); - else sprintf(buf,"%g",dval); - break; - default : - err=GRIB_WRONG_TYPE; - return err; + case GRIB_TYPE_STRING: + err = grib_get_string(h, keys->name, buf, &buflen); + if (err == GRIB_NOT_FOUND) + sprintf(buf, GRIB_KEY_UNDEF); + break; + case GRIB_TYPE_LONG: + err = grib_get_long(h, keys->name, &lval); + if (err == GRIB_NOT_FOUND) + sprintf(buf, GRIB_KEY_UNDEF); + else + sprintf(buf, "%ld", lval); + break; + case GRIB_TYPE_DOUBLE: + err = grib_get_double(h, keys->name, &dval); + if (err == GRIB_NOT_FOUND) + sprintf(buf, GRIB_KEY_UNDEF); + else + sprintf(buf, "%g", dval); + break; + default: + err = GRIB_WRONG_TYPE; + return err; } if (err && err != GRIB_NOT_FOUND) { - grib_context_log(c,GRIB_LOG_ERROR, - "unable to create index. \"%s\": %s", - keys->name,grib_get_error_message(err)); + grib_context_log(c, GRIB_LOG_ERROR, + "unable to create index. \"%s\": %s", + keys->name, grib_get_error_message(err)); return err; } - sprintf(keys->value,"%s",buf); - keys=keys->next; + sprintf(keys->value, "%s", buf); + keys = keys->next; } grib_index_rewind(index); return 0; } -int grib_index_add_file(grib_index* index,const char* filename) { - return _codes_index_add_file(index,filename,CODES_GRIB); +int grib_index_add_file(grib_index* index, const char* filename) +{ + return _codes_index_add_file(index, filename, CODES_GRIB); } -grib_handle* new_message_from_file(int message_type, grib_context *c, FILE *f, int *error) +grib_handle* new_message_from_file(int message_type, grib_context* c, FILE* f, int* error) { if (message_type == CODES_GRIB) return grib_new_from_file(c, f, 0, error); /* headers_only=0 */ @@ -939,159 +1058,178 @@ grib_handle* new_message_from_file(int message_type, grib_context *c, FILE *f, i return NULL; } -int _codes_index_add_file(grib_index* index,const char* filename,int message_type) +int _codes_index_add_file(grib_index* index, const char* filename, int message_type) { double dval; size_t svallen; size_t message_count = 0; - long length,lval; - char buf[1024]={0,}; - int err=0; + long length, lval; + char buf[1024] = {0,}; + int err = 0; grib_file* indfile; grib_file* newfile; - grib_index_key* index_key=NULL; - grib_handle* h=NULL; + grib_index_key* index_key = NULL; + grib_handle* h = NULL; grib_field* field; grib_field_tree* field_tree; - grib_file* file=NULL; + grib_file* file = NULL; grib_context* c; - if (!index) return GRIB_NULL_INDEX; - c=index->context; + if (!index) + return GRIB_NULL_INDEX; + c = index->context; - file=grib_file_open(filename,"r",&err); + file = grib_file_open(filename, "r", &err); - if (!file || !file->handle) return err; + if (!file || !file->handle) + return err; if (!index->files) { grib_filesid++; - newfile=(grib_file*)grib_context_malloc_clear(c,sizeof(grib_file)); - newfile->id=grib_filesid; - newfile->name=strdup(file->name); + newfile = (grib_file*)grib_context_malloc_clear(c, sizeof(grib_file)); + newfile->id = grib_filesid; + newfile->name = strdup(file->name); newfile->handle = file->handle; - index->files=newfile; - } else { - indfile=index->files; - while(indfile) { - if (!strcmp(indfile->name,file->name)) return 0; - indfile=indfile->next; + index->files = newfile; + } + else { + indfile = index->files; + while (indfile) { + if (!strcmp(indfile->name, file->name)) + return 0; + indfile = indfile->next; } - indfile=index->files; - while(indfile->next) indfile=indfile->next; + indfile = index->files; + while (indfile->next) + indfile = indfile->next; grib_filesid++; - newfile=(grib_file*)grib_context_malloc_clear(c,sizeof(grib_file)); - newfile->id=grib_filesid; - newfile->name=strdup(file->name); + newfile = (grib_file*)grib_context_malloc_clear(c, sizeof(grib_file)); + newfile->id = grib_filesid; + newfile->name = strdup(file->name); newfile->handle = file->handle; - indfile->next=newfile; + indfile->next = newfile; } - fseeko(file->handle,0,SEEK_SET); + fseeko(file->handle, 0, SEEK_SET); - while ((h=new_message_from_file(message_type, c, file->handle, &err))!=NULL) { - grib_string_list* v=0; - index_key=index->keys; - field_tree=index->fields; - index_key->value[0]=0; + while ((h = new_message_from_file(message_type, c, file->handle, &err)) != NULL) { + grib_string_list* v = 0; + index_key = index->keys; + field_tree = index->fields; + index_key->value[0] = 0; message_count++; while (index_key) { - if (index_key->type==GRIB_TYPE_UNDEFINED) { - err=grib_get_native_type(h,index_key->name,&(index_key->type)); - if (err) index_key->type=GRIB_TYPE_STRING; + if (index_key->type == GRIB_TYPE_UNDEFINED) { + err = grib_get_native_type(h, index_key->name, &(index_key->type)); + if (err) + index_key->type = GRIB_TYPE_STRING; } - svallen=1024; + svallen = 1024; switch (index_key->type) { - case GRIB_TYPE_STRING: - err=grib_get_string(h,index_key->name,buf,&svallen); - if (err==GRIB_NOT_FOUND) sprintf(buf,GRIB_KEY_UNDEF); - break; - case GRIB_TYPE_LONG: - err=grib_get_long(h,index_key->name,&lval); - if (err==GRIB_NOT_FOUND) sprintf(buf,GRIB_KEY_UNDEF); - else sprintf(buf,"%ld",lval); - break; - case GRIB_TYPE_DOUBLE: - err=grib_get_double(h,index_key->name,&dval); - if (err==GRIB_NOT_FOUND) sprintf(buf,GRIB_KEY_UNDEF); - else sprintf(buf,"%g",dval); - break; - default : - err=GRIB_WRONG_TYPE; - return err; + case GRIB_TYPE_STRING: + err = grib_get_string(h, index_key->name, buf, &svallen); + if (err == GRIB_NOT_FOUND) + sprintf(buf, GRIB_KEY_UNDEF); + break; + case GRIB_TYPE_LONG: + err = grib_get_long(h, index_key->name, &lval); + if (err == GRIB_NOT_FOUND) + sprintf(buf, GRIB_KEY_UNDEF); + else + sprintf(buf, "%ld", lval); + break; + case GRIB_TYPE_DOUBLE: + err = grib_get_double(h, index_key->name, &dval); + if (err == GRIB_NOT_FOUND) + sprintf(buf, GRIB_KEY_UNDEF); + else + sprintf(buf, "%g", dval); + break; + default: + err = GRIB_WRONG_TYPE; + return err; } if (err && err != GRIB_NOT_FOUND) { - grib_context_log(c,GRIB_LOG_ERROR,"unable to create index. \"%s\": %s",index_key->name,grib_get_error_message(err)); + grib_context_log(c, GRIB_LOG_ERROR, "unable to create index. \"%s\": %s", index_key->name, grib_get_error_message(err)); return err; } if (!index_key->values->value) { - index_key->values->value=grib_context_strdup(c,buf); + index_key->values->value = grib_context_strdup(c, buf); index_key->values_count++; - } else { - v=index_key->values; - while (v->next && strcmp(v->value,buf)) v=v->next; - if (strcmp(v->value,buf)) { + } + else { + v = index_key->values; + while (v->next && strcmp(v->value, buf)) + v = v->next; + if (strcmp(v->value, buf)) { index_key->values_count++; - if (v->next) v=v->next; - v->next=(grib_string_list*)grib_context_malloc_clear(c,sizeof(grib_string_list)); - v->next->value=grib_context_strdup(c,buf); + if (v->next) + v = v->next; + v->next = (grib_string_list*)grib_context_malloc_clear(c, sizeof(grib_string_list)); + v->next->value = grib_context_strdup(c, buf); } } if (!field_tree->value) { - field_tree->value=grib_context_strdup(c,buf); - } else { + field_tree->value = grib_context_strdup(c, buf); + } + else { while (field_tree->next && - (field_tree->value==NULL || - strcmp(field_tree->value,buf))) - field_tree=field_tree->next; - - if (!field_tree->value || strcmp(field_tree->value,buf)){ - field_tree->next= - (grib_field_tree*)grib_context_malloc_clear(c, - sizeof(grib_field_tree)); - field_tree=field_tree->next; - field_tree->value=grib_context_strdup(c,buf); + (field_tree->value == NULL || + strcmp(field_tree->value, buf))) + field_tree = field_tree->next; + + if (!field_tree->value || strcmp(field_tree->value, buf)) { + field_tree->next = + (grib_field_tree*)grib_context_malloc_clear(c, + sizeof(grib_field_tree)); + field_tree = field_tree->next; + field_tree->value = grib_context_strdup(c, buf); } } if (index_key->next) { if (!field_tree->next_level) { - field_tree->next_level= - (grib_field_tree*)grib_context_malloc_clear(c,sizeof(grib_field_tree)); + field_tree->next_level = + (grib_field_tree*)grib_context_malloc_clear(c, sizeof(grib_field_tree)); } - field_tree=field_tree->next_level; + field_tree = field_tree->next_level; } - index_key=index_key->next; + index_key = index_key->next; } - field=(grib_field*)grib_context_malloc_clear(c,sizeof(grib_field)); - field->file=file; + field = (grib_field*)grib_context_malloc_clear(c, sizeof(grib_field)); + field->file = file; index->count++; - field->offset=h->offset;; + field->offset = h->offset; - err=grib_get_long(h,"totalLength",&length); - if (err) return err; - field->length=length; + err = grib_get_long(h, "totalLength", &length); + if (err) + return err; + field->length = length; if (field_tree->field) { - grib_field* pfield=field_tree->field; - while (pfield->next) pfield=pfield->next; - pfield->next=field; - } else - field_tree->field=field; + grib_field* pfield = field_tree->field; + while (pfield->next) + pfield = pfield->next; + pfield->next = field; + } + else + field_tree->field = field; grib_handle_delete(h); } grib_file_close(file->name, 0, &err); - if (err) return err; - index->rewind=1; + if (err) + return err; + index->rewind = 1; if (message_count == 0) { - grib_context_log(c,GRIB_LOG_ERROR,"File %s contains no messages", filename); + grib_context_log(c, GRIB_LOG_ERROR, "File %s contains no messages", filename); return GRIB_END_OF_FILE; } return GRIB_SUCCESS; @@ -1235,7 +1373,7 @@ int grib_index_add_file(grib_index* index, const char* filename) field=(grib_field*)grib_context_malloc_clear(c,sizeof(grib_field)); field->file=file; index->count++; - field->offset=h->offset;; + field->offset=h->offset; err=grib_get_long(h,"totalLength",&length); if (err) return err; @@ -1261,15 +1399,16 @@ int grib_index_add_file(grib_index* index, const char* filename) } #endif -grib_index* grib_index_new_from_file(grib_context* c, char* filename, const char* keys, int *err) +grib_index* grib_index_new_from_file(grib_context* c, char* filename, const char* keys, int* err) { - grib_index* index=NULL; + grib_index* index = NULL; - if(!c) c=grib_context_get_default(); + if (!c) + c = grib_context_get_default(); - index=grib_index_new(c,keys,err); + index = grib_index_new(c, keys, err); - *err=grib_index_add_file(index,filename); + *err = grib_index_add_file(index, filename); if (*err) { grib_index_delete(index); return NULL; @@ -1278,214 +1417,227 @@ grib_index* grib_index_new_from_file(grib_context* c, char* filename, const char return index; } -int grib_index_get_size(const grib_index* index,const char* key,size_t* size) +int grib_index_get_size(const grib_index* index, const char* key, size_t* size) { - grib_index_key* k=index->keys; - while (k && strcmp(k->name,key)) k=k->next; - if (!k) return GRIB_NOT_FOUND; - *size=k->values_count; + grib_index_key* k = index->keys; + while (k && strcmp(k->name, key)) + k = k->next; + if (!k) + return GRIB_NOT_FOUND; + *size = k->values_count; return 0; } -int grib_index_get_string(const grib_index* index, const char* key, char** values, size_t *size) +int grib_index_get_string(const grib_index* index, const char* key, char** values, size_t* size) { - grib_index_key* k=index->keys; + grib_index_key* k = index->keys; grib_string_list* kv; - int i=0; - while (k && strcmp(k->name,key)) k=k->next; - if (!k) return GRIB_NOT_FOUND; - if (k->values_count>*size) return GRIB_ARRAY_TOO_SMALL; - kv=k->values; + int i = 0; + while (k && strcmp(k->name, key)) + k = k->next; + if (!k) + return GRIB_NOT_FOUND; + if (k->values_count > *size) + return GRIB_ARRAY_TOO_SMALL; + kv = k->values; while (kv) { if (kv->value == NULL) return GRIB_IO_PROBLEM; - values[i++]=grib_context_strdup(index->context,kv->value); - kv=kv->next; + values[i++] = grib_context_strdup(index->context, kv->value); + kv = kv->next; } - *size=k->values_count; - qsort(values,*size,sizeof(char*),&compare_string); + *size = k->values_count; + qsort(values, *size, sizeof(char*), &compare_string); return GRIB_SUCCESS; } -int grib_index_get_long(const grib_index* index, const char* key, long* values, size_t *size) +int grib_index_get_long(const grib_index* index, const char* key, long* values, size_t* size) { - grib_index_key* k=index->keys; + grib_index_key* k = index->keys; grib_string_list* kv; - int i=0; - while (k && strcmp(k->name,key)) k=k->next; - if (!k) return GRIB_NOT_FOUND; + int i = 0; + while (k && strcmp(k->name, key)) + k = k->next; + if (!k) + return GRIB_NOT_FOUND; if (k->type != GRIB_TYPE_LONG) { - grib_context_log(index->context,GRIB_LOG_ERROR, "unable to get index %s as long", key); + grib_context_log(index->context, GRIB_LOG_ERROR, "unable to get index %s as long", key); return GRIB_WRONG_TYPE; } - if (k->values_count > *size) return GRIB_ARRAY_TOO_SMALL; - kv=k->values; + if (k->values_count > *size) + return GRIB_ARRAY_TOO_SMALL; + kv = k->values; while (kv) { - if (strcmp(kv->value,GRIB_KEY_UNDEF) ) - values[i++]=atol(kv->value); + if (strcmp(kv->value, GRIB_KEY_UNDEF)) + values[i++] = atol(kv->value); else - values[i++]=UNDEF_LONG; - kv=kv->next; + values[i++] = UNDEF_LONG; + kv = kv->next; } - *size=k->values_count; - qsort(values,*size,sizeof(long),&compare_long); + *size = k->values_count; + qsort(values, *size, sizeof(long), &compare_long); return GRIB_SUCCESS; } -int grib_index_get_double(const grib_index* index,const char* key, double* values,size_t *size) +int grib_index_get_double(const grib_index* index, const char* key, double* values, size_t* size) { - grib_index_key* k=index->keys; + grib_index_key* k = index->keys; grib_string_list* kv; - int i=0; - while (k && strcmp(k->name,key)) k=k->next; - if (!k) return GRIB_NOT_FOUND; + int i = 0; + while (k && strcmp(k->name, key)) + k = k->next; + if (!k) + return GRIB_NOT_FOUND; if (k->type != GRIB_TYPE_DOUBLE) { - grib_context_log(index->context,GRIB_LOG_ERROR, "unable to get index %s as double", key); + grib_context_log(index->context, GRIB_LOG_ERROR, "unable to get index %s as double", key); return GRIB_WRONG_TYPE; } - if (k->values_count>*size) return GRIB_ARRAY_TOO_SMALL; - kv=k->values; + if (k->values_count > *size) + return GRIB_ARRAY_TOO_SMALL; + kv = k->values; while (kv) { - if (strcmp(kv->value,GRIB_KEY_UNDEF) ) - values[i++]=atof(kv->value); + if (strcmp(kv->value, GRIB_KEY_UNDEF)) + values[i++] = atof(kv->value); else - values[i++]=UNDEF_DOUBLE; + values[i++] = UNDEF_DOUBLE; - kv=kv->next; + kv = kv->next; } - *size=k->values_count; - qsort(values,*size,sizeof(double),&compare_double); + *size = k->values_count; + qsort(values, *size, sizeof(double), &compare_double); return GRIB_SUCCESS; } -int grib_index_select_long(grib_index* index,const char* skey,long value) +int grib_index_select_long(grib_index* index, const char* skey, long value) { - grib_index_key* key=NULL; - int err=GRIB_NOT_FOUND; + grib_index_key* key = NULL; + int err = GRIB_NOT_FOUND; if (!index) { - grib_context* c=grib_context_get_default(); - grib_context_log(c,GRIB_LOG_ERROR,"null index pointer"); + grib_context* c = grib_context_get_default(); + grib_context_log(c, GRIB_LOG_ERROR, "null index pointer"); return GRIB_INTERNAL_ERROR; } - index->orderby=0; - key=index->keys; + index->orderby = 0; + key = index->keys; while (key) { - if (!strcmp(key->name,skey)) { - err=0; + if (!strcmp(key->name, skey)) { + err = 0; break; } - key=key->next; + key = key->next; } if (err) { - grib_context_log(index->context,GRIB_LOG_ERROR, - "key \"%s\" not found in index",skey); + grib_context_log(index->context, GRIB_LOG_ERROR, + "key \"%s\" not found in index", skey); return err; } Assert(key); - sprintf(key->value,"%ld",value); + sprintf(key->value, "%ld", value); grib_index_rewind(index); return 0; } -int grib_index_select_double(grib_index* index,const char* skey,double value) +int grib_index_select_double(grib_index* index, const char* skey, double value) { - grib_index_key* key=NULL; - int err=GRIB_NOT_FOUND; + grib_index_key* key = NULL; + int err = GRIB_NOT_FOUND; if (!index) { - grib_context* c=grib_context_get_default(); - grib_context_log(c,GRIB_LOG_ERROR,"null index pointer"); + grib_context* c = grib_context_get_default(); + grib_context_log(c, GRIB_LOG_ERROR, "null index pointer"); return GRIB_INTERNAL_ERROR; } - index->orderby=0; - key=index->keys; + index->orderby = 0; + key = index->keys; - while (key ) { - if (!strcmp(key->name,skey)) { - err=0; + while (key) { + if (!strcmp(key->name, skey)) { + err = 0; break; } - key=key->next; + key = key->next; } if (err) { - grib_context_log(index->context,GRIB_LOG_ERROR, - "key \"%s\" not found in index",skey); + grib_context_log(index->context, GRIB_LOG_ERROR, + "key \"%s\" not found in index", skey); return err; } Assert(key); - sprintf(key->value,"%g",value); + sprintf(key->value, "%g", value); grib_index_rewind(index); return 0; } -int grib_index_select_string(grib_index* index,const char* skey,char* value) +int grib_index_select_string(grib_index* index, const char* skey, char* value) { - grib_index_key* key=NULL; - int err=GRIB_NOT_FOUND; + grib_index_key* key = NULL; + int err = GRIB_NOT_FOUND; if (!index) { - grib_context* c=grib_context_get_default(); - grib_context_log(c,GRIB_LOG_ERROR,"null index pointer"); + grib_context* c = grib_context_get_default(); + grib_context_log(c, GRIB_LOG_ERROR, "null index pointer"); return GRIB_INTERNAL_ERROR; } - index->orderby=0; - key=index->keys; + index->orderby = 0; + key = index->keys; - while (key ) { - if (!strcmp(key->name,skey)) { - err=0; + while (key) { + if (!strcmp(key->name, skey)) { + err = 0; break; } - key=key->next; + key = key->next; } if (err) { - grib_context_log(index->context,GRIB_LOG_ERROR, - "key \"%s\" not found in index",skey); + grib_context_log(index->context, GRIB_LOG_ERROR, + "key \"%s\" not found in index", skey); return err; } Assert(key); - sprintf(key->value,"%s",value); + sprintf(key->value, "%s", value); grib_index_rewind(index); return 0; } -grib_handle* grib_index_get_handle(grib_field* field,int *err) +grib_handle* grib_index_get_handle(grib_field* field, int* err) { - return codes_index_get_handle(field,CODES_GRIB,err); + return codes_index_get_handle(field, CODES_GRIB, err); } -grib_handle* codes_index_get_handle(grib_field* field,int message_type,int *err) +grib_handle* codes_index_get_handle(grib_field* field, int message_type, int* err) { - grib_handle* h=NULL; - typedef grib_handle* (*message_new_proc) ( grib_context*,FILE*,int,int* ); - message_new_proc message_new=NULL; + grib_handle* h = NULL; + typedef grib_handle* (*message_new_proc)(grib_context*, FILE*, int, int*); + message_new_proc message_new = NULL; Assert(field->file); - grib_file_open(field->file->name,"r",err); + grib_file_open(field->file->name, "r", err); - if (*err!=GRIB_SUCCESS) return NULL; + if (*err != GRIB_SUCCESS) + return NULL; switch (message_type) { - case CODES_GRIB: - message_new=grib_new_from_file; - break; - case CODES_BUFR: - Assert(!"_codes_index_add_file for BUFR: not yet implemented"); - /* message_new=bufr_new_from_file; */ - break; - default : - Assert(0); + case CODES_GRIB: + message_new = grib_new_from_file; + break; + case CODES_BUFR: + Assert(!"_codes_index_add_file for BUFR: not yet implemented"); + /* message_new=bufr_new_from_file; */ + break; + default: + Assert(0); } - fseeko(field->file->handle,field->offset,SEEK_SET); - h=message_new(0,field->file->handle,0,err); - if (*err!=GRIB_SUCCESS) return NULL; + fseeko(field->file->handle, field->offset, SEEK_SET); + h = message_new(0, field->file->handle, 0, err); + if (*err != GRIB_SUCCESS) + return NULL; grib_file_close(field->file->name, 0, err); return h; @@ -1496,35 +1648,41 @@ static int grib_index_execute(grib_index* index) grib_index_key* keys = NULL; grib_field_tree* fields; - if (!index) return GRIB_INTERNAL_ERROR; + if (!index) + return GRIB_INTERNAL_ERROR; keys = index->keys; - fields=index->fields; - index->rewind=0; + fields = index->fields; + index->rewind = 0; while (keys) { char* value; - if (keys->value[0]) value=keys->value; + if (keys->value[0]) + value = keys->value; else { - grib_context_log(index->context,GRIB_LOG_ERROR, - "please select a value for index key \"%s\"", - keys->name); + grib_context_log(index->context, GRIB_LOG_ERROR, + "please select a value for index key \"%s\"", + keys->name); return GRIB_NOT_FOUND; } - while (fields && strcmp(fields->value,value)) - fields=fields->next; - if (fields && !strcmp(fields->value,value)) { + while (fields && strcmp(fields->value, value)) + fields = fields->next; + if (fields && !strcmp(fields->value, value)) { if (fields->next_level) { - keys=keys->next; - fields=fields->next_level; - } else { - index->current=index->fieldset; - while(index->current->next) index->current=index->current->next; - index->current->field=fields->field; + keys = keys->next; + fields = fields->next_level; + } + else { + index->current = index->fieldset; + while (index->current->next) + index->current = index->current->next; + index->current->field = fields->field; return 0; } - } else return GRIB_END_OF_INDEX; + } + else + return GRIB_END_OF_INDEX; } return 0; @@ -1533,7 +1691,7 @@ static int grib_index_execute(grib_index* index) static void grib_dump_key_values(FILE* fout, grib_string_list* values) { grib_string_list* sl = values; - int first = 1; /* boolean for commas */ + int first = 1; /* boolean for commas */ fprintf(fout, "values = "); while (sl) { if (!first) { @@ -1541,13 +1699,14 @@ static void grib_dump_key_values(FILE* fout, grib_string_list* values) } fprintf(fout, "%s", sl->value); first = 0; - sl = sl->next; + sl = sl->next; } fprintf(fout, "\n"); } static void grib_dump_index_keys(FILE* fout, grib_index_key* keys) { - if (!keys) return; + if (!keys) + return; fprintf(fout, "key name = %s\n", keys->name); /* fprintf(fout, "key type = %d\n", keys->type); */ @@ -1587,33 +1746,37 @@ static void grib_dump_field_tree(FILE* fout, grib_field_tree* tree) int grib_index_dump_file(FILE* fout, const char* filename) { - int err = 0; + int err = 0; grib_index* index = NULL; - grib_context* c = grib_context_get_default(); - FILE* fh = NULL; + grib_context* c = grib_context_get_default(); + FILE* fh = NULL; Assert(fout); Assert(filename); index = grib_index_read(c, filename, &err); - if (err) return err; + if (err) + return err; /* To get the GRIB files referenced we have */ /* to resort to low level reading of the index file! */ - fh=fopen(filename,"r"); + fh = fopen(filename, "r"); if (fh) { - grib_file *file,*f; - unsigned char marker=0; - char* identifier = grib_read_string(c,fh,&err); - if (err) return err; - grib_context_free(c,identifier); - err = grib_read_uchar(fh,&marker); - if (err) return err; - file = grib_read_files(c,fh,&err); - if (err) return err; - f=file; + grib_file *file, *f; + unsigned char marker = 0; + char* identifier = grib_read_string(c, fh, &err); + if (err) + return err; + grib_context_free(c, identifier); + err = grib_read_uchar(fh, &marker); + if (err) + return err; + file = grib_read_files(c, fh, &err); + if (err) + return err; + f = file; while (f) { fprintf(fout, "GRIB File: %s\n", f->name); - f=f->next; + f = f->next; } fclose(fh); } @@ -1626,7 +1789,8 @@ int grib_index_dump_file(FILE* fout, const char* filename) void grib_index_dump(FILE* fout, grib_index* index) { - if (!index) return; + if (!index) + return; Assert(fout); /* The grib_dump_files does not print anything as */ @@ -1644,106 +1808,115 @@ void grib_index_dump(FILE* fout, grib_index* index) fprintf(fout, "Index count = %d\n", index->count); } -char* grib_get_field_file(grib_index* index,off_t *offset) +char* grib_get_field_file(grib_index* index, off_t* offset) { - char* file=NULL; + char* file = NULL; if (index && index->current && index->current->field) { - file=index->current->field->file->name; - *offset=index->current->field->offset; + file = index->current->field->file->name; + *offset = index->current->field->offset; } return file; } -grib_handle* grib_handle_new_from_index(grib_index* index,int *err) +grib_handle* grib_handle_new_from_index(grib_index* index, int* err) { - return codes_new_from_index(index,CODES_GRIB,err); + return codes_new_from_index(index, CODES_GRIB, err); } -grib_handle* codes_new_from_index(grib_index* index,int message_type,int *err) +grib_handle* codes_new_from_index(grib_index* index, int message_type, int* err) { /*grib_index_key* keys;*/ - grib_field_list *fieldset,*next; - grib_handle* h=NULL; - grib_context* c=NULL; + grib_field_list *fieldset, *next; + grib_handle* h = NULL; + grib_context* c = NULL; - if (!index) return NULL; - c=index->context; + if (!index) + return NULL; + c = index->context; if (!index->rewind) { if (!index->current) { - *err=GRIB_END_OF_INDEX; + *err = GRIB_END_OF_INDEX; return NULL; } if (index->current->field->next) - index->current->field=index->current->field->next; - else if(index->current->next) - index->current=index->current->next; - else {*err=GRIB_END_OF_INDEX;return NULL;} + index->current->field = index->current->field->next; + else if (index->current->next) + index->current = index->current->next; + else { + *err = GRIB_END_OF_INDEX; + return NULL; + } - h=codes_index_get_handle(index->current->field,message_type,err); + h = codes_index_get_handle(index->current->field, message_type, err); return h; } if (!index->fieldset) { - index->fieldset=(grib_field_list*)grib_context_malloc_clear(index->context, - sizeof(grib_field_list)); + index->fieldset = (grib_field_list*)grib_context_malloc_clear(index->context, + sizeof(grib_field_list)); if (!index->fieldset) { - grib_context_log(index->context,GRIB_LOG_ERROR, - "unable to allocate %d bytes", - sizeof(grib_field_list)); + grib_context_log(index->context, GRIB_LOG_ERROR, + "unable to allocate %d bytes", + sizeof(grib_field_list)); return NULL; } - index->current=index->fieldset; - } else { - fieldset=index->fieldset; - while(fieldset->next) { - next=fieldset->next; - grib_context_free(c,fieldset); - fieldset=next; + index->current = index->fieldset; + } + else { + fieldset = index->fieldset; + while (fieldset->next) { + next = fieldset->next; + grib_context_free(c, fieldset); + fieldset = next; } - fieldset->field=NULL; - fieldset->next=NULL; - index->fieldset=fieldset; - index->current=fieldset; + fieldset->field = NULL; + fieldset->next = NULL; + index->fieldset = fieldset; + index->current = fieldset; } - *err=GRIB_END_OF_INDEX; - h=NULL; + *err = GRIB_END_OF_INDEX; + h = NULL; /*keys=index->keys;*/ - if ((*err=grib_index_execute(index))==GRIB_SUCCESS) { - - if (!index->fieldset) {*err=GRIB_END_OF_INDEX;return NULL;} - index->current=index->fieldset; - h=codes_index_get_handle(index->current->field,message_type,err); + if ((*err = grib_index_execute(index)) == GRIB_SUCCESS) { + if (!index->fieldset) { + *err = GRIB_END_OF_INDEX; + return NULL; + } + index->current = index->fieldset; + h = codes_index_get_handle(index->current->field, message_type, err); } return h; } void grib_index_rewind(grib_index* index) { - index->rewind=1; + index->rewind = 1; } -static grib_index_key* search_key(grib_index_key* keys,grib_index_key* to_search) +static grib_index_key* search_key(grib_index_key* keys, grib_index_key* to_search) { - if (!keys || !strcmp(keys->name,to_search->name)) return keys; - return search_key(keys->next,to_search); + if (!keys || !strcmp(keys->name, to_search->name)) + return keys; + return search_key(keys->next, to_search); } -int grib_index_search(grib_index* index,grib_index_key* keys) +int grib_index_search(grib_index* index, grib_index_key* keys) { - grib_index_key* ki=index->keys; - grib_index_key* ks=keys; + grib_index_key* ki = index->keys; + grib_index_key* ks = keys; while (ks) { - ki=search_key(ki,ks); + ki = search_key(ki, ks); if (!ki) { - ki=index->keys; - ki=search_key(ki,ks); + ki = index->keys; + ki = search_key(ki, ks); } - if (ki) sprintf(ki->value,"%s",ks->value); - ks=ks->next; + if (ki) + sprintf(ki->value, "%s", ks->value); + ks = ks->next; } grib_index_rewind(index); diff --git a/src/grib_io.c b/src/grib_io.c index e87f6ed34..9748f9aba 100644 --- a/src/grib_io.c +++ b/src/grib_io.c @@ -11,65 +11,67 @@ #include "grib_api_internal.h" #if GRIB_PTHREADS - static pthread_once_t once = PTHREAD_ONCE_INIT; - static pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER; - static pthread_mutex_t mutex2 = PTHREAD_MUTEX_INITIALIZER; - static void init() { - pthread_mutexattr_t attr; - pthread_mutexattr_init(&attr); - pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init(&mutex1,&attr); - pthread_mutex_init(&mutex2,&attr); - pthread_mutexattr_destroy(&attr); - } +static pthread_once_t once = PTHREAD_ONCE_INIT; +static pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER; +static pthread_mutex_t mutex2 = PTHREAD_MUTEX_INITIALIZER; +static void init() +{ + pthread_mutexattr_t attr; + pthread_mutexattr_init(&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&mutex1, &attr); + pthread_mutex_init(&mutex2, &attr); + pthread_mutexattr_destroy(&attr); +} #elif GRIB_OMP_THREADS - static int once = 0; - static omp_nest_lock_t mutex1; - static omp_nest_lock_t mutex2; - static void init() - { +static int once = 0; +static omp_nest_lock_t mutex1; +static omp_nest_lock_t mutex2; +static void init() +{ GRIB_OMP_CRITICAL(lock_grib_io_c) { - if (once == 0) - { + if (once == 0) { omp_init_nest_lock(&mutex1); omp_init_nest_lock(&mutex2); once = 1; } } - } +} #endif -#define GRIB 0x47524942 -#define BUDG 0x42554447 -#define DIAG 0x44494147 -#define TIDE 0x54494445 -#define BUFR 0x42554652 -#define HDF5 0x89484446 -#define WRAP 0x57524150 +#define GRIB 0x47524942 +#define BUDG 0x42554447 +#define DIAG 0x44494147 +#define TIDE 0x54494445 +#define BUFR 0x42554652 +#define HDF5 0x89484446 +#define WRAP 0x57524150 #define GRIB_API_READS_BUFR 1 #define GRIB_API_READS_HDF5 1 #define GRIB_API_READS_WRAP 1 -typedef struct alloc_buffer { +typedef struct alloc_buffer +{ size_t size; void* buffer; } alloc_buffer; -typedef size_t (*readproc)(void*,void*,size_t,int*); -typedef int (*seekproc)(void*,off_t); -typedef off_t (*tellproc)(void*); -typedef void* (*allocproc)(void*,size_t*,int*); +typedef size_t (*readproc)(void*, void*, size_t, int*); +typedef int (*seekproc)(void*, off_t); +typedef off_t (*tellproc)(void*); +typedef void* (*allocproc)(void*, size_t*, int*); -typedef struct reader { - void *read_data; +typedef struct reader +{ + void* read_data; readproc read; - void *alloc_data; + void* alloc_data; allocproc alloc; int headers_only; @@ -82,38 +84,35 @@ typedef struct reader { } reader; -static int read_the_rest(reader* r,size_t message_length,unsigned char* tmp, int already_read, int check7777) +static int read_the_rest(reader* r, size_t message_length, unsigned char* tmp, int already_read, int check7777) { int err = GRIB_SUCCESS; size_t buffer_size; size_t rest; unsigned char* buffer; - if (message_length==0) + if (message_length == 0) return GRIB_BUFFER_TOO_SMALL; - buffer_size = message_length; - rest=message_length-already_read; - r->message_size=message_length; - buffer = (unsigned char*)r->alloc(r->alloc_data,&buffer_size,&err); - if(err) return err; + buffer_size = message_length; + rest = message_length - already_read; + r->message_size = message_length; + buffer = (unsigned char*)r->alloc(r->alloc_data, &buffer_size, &err); + if (err) + return err; if (buffer == NULL || (buffer_size < message_length)) { return GRIB_BUFFER_TOO_SMALL; } - memcpy(buffer,tmp,already_read); + memcpy(buffer, tmp, already_read); - if((r->read(r->read_data,buffer+already_read,rest,&err) != rest) || err) { + if ((r->read(r->read_data, buffer + already_read, rest, &err) != rest) || err) { /*fprintf(stderr, "read_the_rest: r->read failed: %s\n", grib_get_error_message(err));*/ return err; } - if(check7777 && !r->headers_only && (buffer[message_length-4] != '7' || - buffer[message_length-3] != '7' || - buffer[message_length-2] != '7' || - buffer[message_length-1] != '7')) - { + if (check7777 && !r->headers_only && (buffer[message_length - 4] != '7' || buffer[message_length - 3] != '7' || buffer[message_length - 2] != '7' || buffer[message_length - 1] != '7')) { grib_context* c = grib_context_get_default(); grib_context_log(c, GRIB_LOG_DEBUG, "read_the_rest: No final 7777 at expected location (Coded length=%lu)", message_length); return GRIB_WRONG_LENGTH; @@ -122,35 +121,43 @@ static int read_the_rest(reader* r,size_t message_length,unsigned char* tmp, int return GRIB_SUCCESS; } -#define CHECK_TMP_SIZE(a) if(sizeof(tmp)<(a)) { fprintf(stderr,"%s:%d sizeof(tmp)<%s %d<%d\n", __FILE__,__LINE__,#a,(int)sizeof(tmp),(int)(a)); return GRIB_INTERNAL_ARRAY_TOO_SMALL; } +#define CHECK_TMP_SIZE(a) \ + if (sizeof(tmp) < (a)) { \ + fprintf(stderr, "%s:%d sizeof(tmp)<%s %d<%d\n", __FILE__, __LINE__, #a, (int)sizeof(tmp), (int)(a)); \ + return GRIB_INTERNAL_ARRAY_TOO_SMALL; \ + } -#define GROW_BUF_IF_REQUIRED(desired_length) if(buf->length<(desired_length)) { grib_grow_buffer(c, buf, desired_length);tmp=buf->data; } +#define GROW_BUF_IF_REQUIRED(desired_length) \ + if (buf->length < (desired_length)) { \ + grib_grow_buffer(c, buf, desired_length); \ + tmp = buf->data; \ + } -#define UINT3(a,b,c) (size_t)((a<<16) + (b<<8) + c); +#define UINT3(a, b, c) (size_t)((a << 16) + (b << 8) + c); static int read_GRIB(reader* r) { - unsigned char *tmp=NULL; - size_t length = 0; + unsigned char* tmp = NULL; + size_t length = 0; size_t total_length = 0; - long edition = 0; - int err = 0; - int i = 0 ,j; - size_t sec1len = 0; - size_t sec2len = 0; - size_t sec3len = 0; - size_t sec4len = 0; + long edition = 0; + int err = 0; + int i = 0, j; + size_t sec1len = 0; + size_t sec2len = 0; + size_t sec3len = 0; + size_t sec4len = 0; unsigned long flags; - size_t buflen = 32768; /* See ECC-515: was 16368 */ + size_t buflen = 32768; /* See ECC-515: was 16368 */ grib_context* c; grib_buffer* buf; /*TODO proper context*/ - c=grib_context_get_default(); - tmp=(unsigned char*)malloc(buflen); + c = grib_context_get_default(); + tmp = (unsigned char*)malloc(buflen); if (!tmp) return GRIB_OUT_OF_MEMORY; - buf=grib_new_buffer(c,tmp,buflen); + buf = grib_new_buffer(c, tmp, buflen); buf->property = GRIB_MY_BUFFER; tmp[i++] = 'G'; @@ -158,286 +165,270 @@ static int read_GRIB(reader* r) tmp[i++] = 'I'; tmp[i++] = 'B'; - r->offset=r->tell(r->read_data)-4; + r->offset = r->tell(r->read_data) - 4; - if(r->read(r->read_data,&tmp[i],3,&err) != 3 || err) + if (r->read(r->read_data, &tmp[i], 3, &err) != 3 || err) return err; - length= UINT3(tmp[i],tmp[i+1],tmp[i+2]); - i+=3; + length = UINT3(tmp[i], tmp[i + 1], tmp[i + 2]); + i += 3; /* Edition number */ - if(r->read(r->read_data,&tmp[i],1,&err) != 1 || err) + if (r->read(r->read_data, &tmp[i], 1, &err) != 1 || err) return err; edition = tmp[i++]; - switch(edition) - { - case 1: - if (r->headers_only) { - /* Read section 1 length */ - if(r->read(r->read_data,&tmp[i],3,&err) != 3 || err) - return err; + switch (edition) { + case 1: + if (r->headers_only) { + /* Read section 1 length */ + if (r->read(r->read_data, &tmp[i], 3, &err) != 3 || err) + return err; - sec1len=UINT3(tmp[i],tmp[i+1],tmp[i+2]); - i+=3; - /* Read section 1. 3 = length */ - if((r->read(r->read_data,tmp+i,sec1len-3,&err) != sec1len-3) || err) - return err; - flags = tmp[15]; + sec1len = UINT3(tmp[i], tmp[i + 1], tmp[i + 2]); + i += 3; + /* Read section 1. 3 = length */ + if ((r->read(r->read_data, tmp + i, sec1len - 3, &err) != sec1len - 3) || err) + return err; + flags = tmp[15]; - i += sec1len-3; + i += sec1len - 3; - GROW_BUF_IF_REQUIRED(i+3); + GROW_BUF_IF_REQUIRED(i + 3); - if(flags & (1<<7)) { - /* Section 2 */ - if(r->read(r->read_data,&tmp[i],3,&err) != 3 || err) - return err; + if (flags & (1 << 7)) { + /* Section 2 */ + if (r->read(r->read_data, &tmp[i], 3, &err) != 3 || err) + return err; + + sec2len = UINT3(tmp[i], tmp[i + 1], tmp[i + 2]); + GROW_BUF_IF_REQUIRED(i + sec2len); + i += 3; + /* Read section 2 */ + if ((r->read(r->read_data, tmp + i, sec2len - 3, &err) != sec2len - 3) || err) + return err; + i += sec2len - 3; + } - sec2len=UINT3(tmp[i],tmp[i+1],tmp[i+2]); - GROW_BUF_IF_REQUIRED(i+sec2len); - i+=3; - /* Read section 2 */ - if((r->read(r->read_data,tmp+i,sec2len-3,&err) != sec2len-3) || err) - return err; - i += sec2len-3; - } + if (flags & (1 << 6)) { + /* Section 3 */ + GROW_BUF_IF_REQUIRED(i + 3); + for (j = 0; j < 3; j++) { + if (r->read(r->read_data, &tmp[i], 1, &err) != 1 || err) + return err; + + sec3len <<= 8; + sec3len |= tmp[i]; + i++; + } + + /* Read section 3 */ + GROW_BUF_IF_REQUIRED(i + sec3len); + if ((r->read(r->read_data, tmp + i, sec3len - 3, &err) != sec3len - 3) || err) + return err; + i += sec3len - 3; + } - if(flags & (1<<6)) { + GROW_BUF_IF_REQUIRED(i + 11); - /* Section 3 */ - GROW_BUF_IF_REQUIRED(i+3); - for(j=0;j<3;j++) - { - if(r->read(r->read_data,&tmp[i],1,&err) != 1 || err) + /* Section 4 */ + for (j = 0; j < 3; j++) { + if (r->read(r->read_data, &tmp[i], 1, &err) != 1 || err) return err; - sec3len <<= 8; - sec3len |= tmp[i]; + sec4len <<= 8; + sec4len |= tmp[i]; i++; } - /* Read section 3 */ - GROW_BUF_IF_REQUIRED(i + sec3len); - if((r->read(r->read_data,tmp+i,sec3len-3,&err) != sec3len-3) || err) + /* we don't read the data, only headers */ + if ((r->read(r->read_data, tmp + i, 8, &err) != 8) || err) return err; - i += sec3len-3; - } - GROW_BUF_IF_REQUIRED(i + 11); - - /* Section 4 */ - for(j=0;j<3;j++) - { - if(r->read(r->read_data,&tmp[i],1,&err) != 1 || err) - return err; + i += 8; - sec4len <<= 8; - sec4len |= tmp[i]; - i++; + total_length = length; + /* length=8+sec1len + sec2len+sec3len+11; */ + length = i; + err = r->seek(r->read_data, total_length - length - 1); } + else if (length & 0x800000) { + /* Large GRIBs */ - /* we don't read the data, only headers */ - if((r->read(r->read_data,tmp+i,8,&err) != 8) || err) - return err; + /* Read section 1 length */ + for (j = 0; j < 3; j++) { + if (r->read(r->read_data, &tmp[i], 1, &err) != 1 || err) + return err; - i+=8; + sec1len <<= 8; + sec1len |= tmp[i]; + i++; + } - total_length=length; - /* length=8+sec1len + sec2len+sec3len+11; */ - length=i; - err=r->seek(r->read_data,total_length-length-1); + /* table version */ + if (r->read(r->read_data, &tmp[i++], 1, &err) != 1 || err) + return err; + /* center */ + if (r->read(r->read_data, &tmp[i++], 1, &err) != 1 || err) + return err; + /* process */ + if (r->read(r->read_data, &tmp[i++], 1, &err) != 1 || err) + return err; + /* grid */ + if (r->read(r->read_data, &tmp[i++], 1, &err) != 1 || err) + return err; + /* flags */ + if (r->read(r->read_data, &tmp[i], 1, &err) != 1 || err) + return err; + flags = tmp[i++]; - } - else if(length & 0x800000) - { + /* fprintf(stderr," sec1len=%d i=%d flags=%x\n",sec1len,i,flags); */ - /* Large GRIBs */ + GROW_BUF_IF_REQUIRED(8 + sec1len + 4 + 3); - /* Read section 1 length */ - for(j=0;j<3;j++) - { - if(r->read(r->read_data,&tmp[i],1,&err) != 1 || err) + /* Read section 1. 3 = length, 5 = table,center,process,grid,flags */ + if ((r->read(r->read_data, tmp + i, sec1len - 3 - 5, &err) != sec1len - 3 - 5) || err) return err; - sec1len <<= 8; - sec1len |= tmp[i]; - i++; - } + i += sec1len - 3 - 5; - /* table version */ - if(r->read(r->read_data,&tmp[i++],1,&err) != 1 || err) return err; - /* center */ - if(r->read(r->read_data,&tmp[i++],1,&err) != 1 || err) return err; - /* process */ - if(r->read(r->read_data,&tmp[i++],1,&err) != 1 || err) return err; - /* grid */ - if(r->read(r->read_data,&tmp[i++],1,&err) != 1 || err) return err; - /* flags */ - if(r->read(r->read_data,&tmp[i],1,&err) != 1 || err) return err; - flags = tmp[i++]; + if (flags & (1 << 7)) { + /* Section 2 */ + for (j = 0; j < 3; j++) { + if (r->read(r->read_data, &tmp[i], 1, &err) != 1 || err) + return err; - /* fprintf(stderr," sec1len=%d i=%d flags=%x\n",sec1len,i,flags); */ + sec2len <<= 8; + sec2len |= tmp[i]; + i++; + } + /* Read section 2 */ + GROW_BUF_IF_REQUIRED(i + sec2len); + if ((r->read(r->read_data, tmp + i, sec2len - 3, &err) != sec2len - 3) || err) + return err; + i += sec2len - 3; + } - GROW_BUF_IF_REQUIRED(8+sec1len + 4 + 3); + GROW_BUF_IF_REQUIRED(sec1len + sec2len + 4 + 3); - /* Read section 1. 3 = length, 5 = table,center,process,grid,flags */ - if((r->read(r->read_data,tmp+i,sec1len-3-5,&err) != sec1len-3-5) || err) - return err; + if (flags & (1 << 6)) { + /* Section 3 */ + for (j = 0; j < 3; j++) { + if (r->read(r->read_data, &tmp[i], 1, &err) != 1 || err) + return err; - i += sec1len-3-5; + sec3len <<= 8; + sec3len |= tmp[i]; + i++; + } - if(flags & (1<<7)) { - /* Section 2 */ - for(j=0;j<3;j++) - { - if(r->read(r->read_data,&tmp[i],1,&err) != 1 || err) + /* Read section 3 */ + GROW_BUF_IF_REQUIRED(sec1len + sec2len + sec3len + 4 + 3); + if ((r->read(r->read_data, tmp + i, sec3len - 3, &err) != sec3len - 3) || err) return err; - - sec2len <<= 8; - sec2len |= tmp[i]; - i++; + i += sec3len - 3; } - /* Read section 2 */ - GROW_BUF_IF_REQUIRED(i+sec2len); - if((r->read(r->read_data,tmp+i,sec2len-3,&err) != sec2len-3) || err) - return err; - i += sec2len-3; - } - GROW_BUF_IF_REQUIRED(sec1len + sec2len + 4 + 3); + /* fprintf(stderr,"%s sec1len=%d i=%d\n",type,sec1len,i); */ + + GROW_BUF_IF_REQUIRED(sec1len + sec2len + sec3len + 4 + 3); - if(flags & (1<<6)) { - /* Section 3 */ - for(j=0;j<3;j++) - { - if(r->read(r->read_data,&tmp[i],1,&err) != 1 || err) + for (j = 0; j < 3; j++) { + if (r->read(r->read_data, &tmp[i], 1, &err) != 1 || err) return err; - sec3len <<= 8; - sec3len |= tmp[i]; + sec4len <<= 8; + sec4len |= tmp[i]; i++; } - /* Read section 3 */ - GROW_BUF_IF_REQUIRED(sec1len + sec2len + sec3len + 4 + 3); - if((r->read(r->read_data,tmp+i,sec3len-3,&err) != sec3len-3) || err) - return err; - i += sec3len-3; - } - - /* fprintf(stderr,"%s sec1len=%d i=%d\n",type,sec1len,i); */ - - GROW_BUF_IF_REQUIRED(sec1len + sec2len + sec3len + 4 + 3); - - - for(j=0;j<3;j++) - { - if(r->read(r->read_data,&tmp[i],1,&err) != 1 || err) - return err; - - sec4len <<= 8; - sec4len |= tmp[i]; - i++; - } - - if(sec4len < 120) - { - /* Special coding */ - length &= 0x7fffff; - length *= 120; - length -= sec4len; - length += 4; - } - else - { - /* length is already set to the right value */ + if (sec4len < 120) { + /* Special coding */ + length &= 0x7fffff; + length *= 120; + length -= sec4len; + length += 4; + } + else { + /* length is already set to the right value */ + } } + break; - } - break; - - case 2: - case 3: - length = 0; + case 2: + case 3: + length = 0; - if(sizeof(long) >= 8) { - for(j=0;j<8;j++) - { - if(r->read(r->read_data,&tmp[i],1,&err) != 1 || err) - return err; + if (sizeof(long) >= 8) { + for (j = 0; j < 8; j++) { + if (r->read(r->read_data, &tmp[i], 1, &err) != 1 || err) + return err; - length <<= 8; - length |= tmp[i]; - i++; + length <<= 8; + length |= tmp[i]; + i++; + } } - } - else - { - /* Check if the length fits in a long */ - for(j=0;j<4;j++) - { - if(r->read(r->read_data,&tmp[i],1,&err) != 1 || err) - return err; + else { + /* Check if the length fits in a long */ + for (j = 0; j < 4; j++) { + if (r->read(r->read_data, &tmp[i], 1, &err) != 1 || err) + return err; - length <<= 8; - length |= tmp[i]; - i++; - } + length <<= 8; + length |= tmp[i]; + i++; + } - if(length) - return GRIB_MESSAGE_TOO_LARGE; /* Message too large */ + if (length) + return GRIB_MESSAGE_TOO_LARGE; /* Message too large */ - for(j=0;j<4;j++) - { - if(r->read(r->read_data,&tmp[i],1,&err) != 1 || err) - return err; + for (j = 0; j < 4; j++) { + if (r->read(r->read_data, &tmp[i], 1, &err) != 1 || err) + return err; - length <<= 8; - length |= tmp[i]; - i++; + length <<= 8; + length |= tmp[i]; + i++; + } } - } - break; + break; - default: - r->seek_from_start(r->read_data,r->offset+4); - return GRIB_UNSUPPORTED_EDITION; - break; + default: + r->seek_from_start(r->read_data, r->offset + 4); + return GRIB_UNSUPPORTED_EDITION; + break; } /* Assert(i <= buf->length); */ - err=read_the_rest(r, length, tmp, i, 1); + err = read_the_rest(r, length, tmp, i, 1); if (err) - r->seek_from_start(r->read_data,r->offset+4); + r->seek_from_start(r->read_data, r->offset + 4); - grib_buffer_delete(c,buf); + grib_buffer_delete(c, buf); return err; } -static int read_PSEUDO(reader *r,const char* type) +static int read_PSEUDO(reader* r, const char* type) { unsigned char tmp[32]; /* Should be enough */ size_t sec1len = 0; size_t sec4len = 0; - int err = 0; + int err = 0; int i = 0, j = 0; - Assert( strlen(type) == 4 ); - for(j = 0; j < 4; j++) - { + Assert(strlen(type) == 4); + for (j = 0; j < 4; j++) { tmp[i] = type[i]; i++; } - for(j=0;j<3;j++) - { - if(r->read(r->read_data,&tmp[i],1,&err) != 1 || err) + for (j = 0; j < 3; j++) { + if (r->read(r->read_data, &tmp[i], 1, &err) != 1 || err) return err; sec1len <<= 8; @@ -446,17 +437,16 @@ static int read_PSEUDO(reader *r,const char* type) } /* fprintf(stderr,"%s sec1len=%d i=%d\n",type,sec1len,i); */ - CHECK_TMP_SIZE(sec1len + 4 + 3 ); + CHECK_TMP_SIZE(sec1len + 4 + 3); /* Read sectoin1 */ - if((r->read(r->read_data,tmp+i,sec1len-3,&err) != sec1len-3) || err) + if ((r->read(r->read_data, tmp + i, sec1len - 3, &err) != sec1len - 3) || err) return err; - i += sec1len-3; + i += sec1len - 3; - for(j=0;j<3;j++) - { - if(r->read(r->read_data,&tmp[i],1,&err) != 1 || err) + for (j = 0; j < 3; j++) { + if (r->read(r->read_data, &tmp[i], 1, &err) != 1 || err) return err; sec4len <<= 8; @@ -467,28 +457,29 @@ static int read_PSEUDO(reader *r,const char* type) /* fprintf(stderr,"%s sec4len=%d i=%d l=%d\n",type,sec4len,i,4+sec1len+sec4len+4); */ Assert(i <= sizeof(tmp)); - return read_the_rest(r,4+sec1len+sec4len+4,tmp,i, 1); + return read_the_rest(r, 4 + sec1len + sec4len + 4, tmp, i, 1); } -static int read_HDF5_offset(reader *r, int length, unsigned long* v, unsigned char *tmp, int* i) { +static int read_HDF5_offset(reader* r, int length, unsigned long* v, unsigned char* tmp, int* i) +{ unsigned char buf[8]; int j, k; int err = 0; - if( (r->read(r->read_data, buf, length, &err) != length) || err) { + if ((r->read(r->read_data, buf, length, &err) != length) || err) { return err; } k = *i; - for(j = 0; j < length; j++) { + for (j = 0; j < length; j++) { tmp[k++] = buf[j]; } *i = k; *v = 0; - for(j = length-1; j >= 0; j--) { + for (j = length - 1; j >= 0; j--) { *v <<= 8; *v |= buf[j]; } @@ -496,7 +487,7 @@ static int read_HDF5_offset(reader *r, int length, unsigned long* v, unsigned ch return 0; } -static int read_HDF5(reader *r) +static int read_HDF5(reader* r) { /* * See: http://www.hdfgroup.org/HDF5/doc/H5.format.html#Superblock @@ -504,11 +495,11 @@ static int read_HDF5(reader *r) unsigned char tmp[49]; /* Should be enough */ unsigned char buf[4]; - unsigned char version_of_superblock, size_of_offsets, size_of_lengths, consistency_flags; + unsigned char version_of_superblock, size_of_offsets, size_of_lengths, consistency_flags; unsigned long base_address, superblock_extension_address, end_of_file_address; - int i = 0, j; - int err = 0; + int i = 0, j; + int err = 0; grib_context* c = grib_context_get_default(); tmp[i++] = 137; @@ -516,116 +507,140 @@ static int read_HDF5(reader *r) tmp[i++] = 'D'; tmp[i++] = 'F'; - if( (r->read(r->read_data, buf, 4, &err) != 4) || err) { + if ((r->read(r->read_data, buf, 4, &err) != 4) || err) { return err; } - if( !(buf[0] == '\r' && buf[1] == '\n' && buf[2] == 26 && buf[3] == '\n')) { + if (!(buf[0] == '\r' && buf[1] == '\n' && buf[2] == 26 && buf[3] == '\n')) { /* Invalid magic, we should not use grib_context_log without a context */ - grib_context_log(c, GRIB_LOG_ERROR,"read_HDF5: invalid signature"); + grib_context_log(c, GRIB_LOG_ERROR, "read_HDF5: invalid signature"); return GRIB_INVALID_MESSAGE; } - for(j = 0; j < 4; j++) { + for (j = 0; j < 4; j++) { tmp[i++] = buf[j]; } - if( (r->read(r->read_data, &version_of_superblock, 1, &err) != 1) || err) { + if ((r->read(r->read_data, &version_of_superblock, 1, &err) != 1) || err) { return err; } tmp[i++] = version_of_superblock; if (version_of_superblock == 2 || version_of_superblock == 3) { - if( (r->read(r->read_data, &size_of_offsets, 1, &err) != 1) || err) { + if ((r->read(r->read_data, &size_of_offsets, 1, &err) != 1) || err) { return err; } tmp[i++] = size_of_offsets; - if(size_of_offsets > 8) { - grib_context_log(c, GRIB_LOG_ERROR,"read_HDF5: invalid size_of_offsets: %ld, only <= 8 is supported", (long)size_of_offsets); + if (size_of_offsets > 8) { + grib_context_log(c, GRIB_LOG_ERROR, "read_HDF5: invalid size_of_offsets: %ld, only <= 8 is supported", (long)size_of_offsets); return GRIB_NOT_IMPLEMENTED; } - if( (r->read(r->read_data, &size_of_lengths, 1, &err) != 1) || err) { + if ((r->read(r->read_data, &size_of_lengths, 1, &err) != 1) || err) { return err; } tmp[i++] = size_of_lengths; - if( (r->read(r->read_data, &consistency_flags, 1, &err) != 1) || err) { + if ((r->read(r->read_data, &consistency_flags, 1, &err) != 1) || err) { return err; } tmp[i++] = consistency_flags; err = read_HDF5_offset(r, size_of_offsets, &base_address, tmp, &i); - if(err) { + if (err) { return err; } err = read_HDF5_offset(r, size_of_offsets, &superblock_extension_address, tmp, &i); - if(err) { + if (err) { return err; } err = read_HDF5_offset(r, size_of_offsets, &end_of_file_address, tmp, &i); - if(err) { + if (err) { return err; } - } else if (version_of_superblock == 0 || version_of_superblock == 1) { + } + else if (version_of_superblock == 0 || version_of_superblock == 1) { char skip[4]; unsigned long file_free_space_info; unsigned char version_of_file_free_space, version_of_root_group_symbol_table, version_number_shared_header, ch; - if( (r->read(r->read_data, &version_of_file_free_space, 1, &err) != 1) || err) return err; + if ((r->read(r->read_data, &version_of_file_free_space, 1, &err) != 1) || err) + return err; tmp[i++] = version_of_file_free_space; - if( (r->read(r->read_data, &version_of_root_group_symbol_table, 1, &err) != 1) || err) return err; + if ((r->read(r->read_data, &version_of_root_group_symbol_table, 1, &err) != 1) || err) + return err; tmp[i++] = version_of_root_group_symbol_table; - if( (r->read(r->read_data, &ch, 1, &err) != 1) || err) return err; /* reserved */ + if ((r->read(r->read_data, &ch, 1, &err) != 1) || err) + return err; /* reserved */ tmp[i++] = ch; - if( (r->read(r->read_data, &version_number_shared_header, 1, &err) != 1) || err) return err; + if ((r->read(r->read_data, &version_number_shared_header, 1, &err) != 1) || err) + return err; tmp[i++] = version_number_shared_header; - if( (r->read(r->read_data, &size_of_offsets, 1, &err) != 1) || err) return err; + if ((r->read(r->read_data, &size_of_offsets, 1, &err) != 1) || err) + return err; tmp[i++] = size_of_offsets; if (size_of_offsets > 8) { - grib_context_log(c, GRIB_LOG_ERROR,"read_HDF5: invalid size_of_offsets: %ld, only <= 8 is supported", (long)size_of_offsets); + grib_context_log(c, GRIB_LOG_ERROR, "read_HDF5: invalid size_of_offsets: %ld, only <= 8 is supported", (long)size_of_offsets); return GRIB_NOT_IMPLEMENTED; } - if( (r->read(r->read_data, &size_of_lengths, 1, &err) != 1) || err) return err; + if ((r->read(r->read_data, &size_of_lengths, 1, &err) != 1) || err) + return err; tmp[i++] = size_of_lengths; - if( (r->read(r->read_data, &ch, 1, &err) != 1) || err) return err; /*reserved*/ + if ((r->read(r->read_data, &ch, 1, &err) != 1) || err) + return err; /*reserved*/ tmp[i++] = ch; - if( (r->read(r->read_data, &skip, 4, &err) != 4) || err) return err; /* Group Leaf/Internal Node K: 4 bytes */ - tmp[i++] = skip[0]; tmp[i++] = skip[1]; tmp[i++] = skip[2]; tmp[i++] = skip[3]; + if ((r->read(r->read_data, &skip, 4, &err) != 4) || err) + return err; /* Group Leaf/Internal Node K: 4 bytes */ + tmp[i++] = skip[0]; + tmp[i++] = skip[1]; + tmp[i++] = skip[2]; + tmp[i++] = skip[3]; - if( (r->read(r->read_data, &skip, 4, &err) != 4) || err) return err; /* consistency_flags: 4 bytes */ - tmp[i++] = skip[0]; tmp[i++] = skip[1]; tmp[i++] = skip[2]; tmp[i++] = skip[3]; + if ((r->read(r->read_data, &skip, 4, &err) != 4) || err) + return err; /* consistency_flags: 4 bytes */ + tmp[i++] = skip[0]; + tmp[i++] = skip[1]; + tmp[i++] = skip[2]; + tmp[i++] = skip[3]; if (version_of_superblock == 1) { /* Indexed storage internal node K and reserved: only in version 1 of superblock */ - if( (r->read(r->read_data, &skip, 4, &err) != 4) || err) return err; - tmp[i++] = skip[0]; tmp[i++] = skip[1]; tmp[i++] = skip[2]; tmp[i++] = skip[3]; + if ((r->read(r->read_data, &skip, 4, &err) != 4) || err) + return err; + tmp[i++] = skip[0]; + tmp[i++] = skip[1]; + tmp[i++] = skip[2]; + tmp[i++] = skip[3]; } err = read_HDF5_offset(r, size_of_offsets, &base_address, tmp, &i); - if (err) return err; + if (err) + return err; err = read_HDF5_offset(r, size_of_offsets, &file_free_space_info, tmp, &i); - if (err) return err; + if (err) + return err; err = read_HDF5_offset(r, size_of_offsets, &end_of_file_address, tmp, &i); - if (err) return err; - } else { - grib_context_log(c, GRIB_LOG_ERROR,"read_HDF5: invalid version of superblock: %ld", (long)version_of_superblock); + if (err) + return err; + } + else { + grib_context_log(c, GRIB_LOG_ERROR, "read_HDF5: invalid version of superblock: %ld", (long)version_of_superblock); return GRIB_NOT_IMPLEMENTED; } @@ -633,7 +648,7 @@ static int read_HDF5(reader *r) return read_the_rest(r, end_of_file_address, tmp, i, 0); } -static int read_WRAP(reader *r) +static int read_WRAP(reader* r) { /* * See: http://www.hdfgroup.org/HDF5/doc/H5.format.html#Superblock @@ -643,7 +658,7 @@ static int read_WRAP(reader *r) unsigned long long length = 0; - int i = 0, j; + int i = 0, j; int err = 0; tmp[i++] = 'W'; @@ -651,12 +666,12 @@ static int read_WRAP(reader *r) tmp[i++] = 'A'; tmp[i++] = 'P'; - if( (r->read(r->read_data, buf, 8, &err) != 8) || err) { + if ((r->read(r->read_data, buf, 8, &err) != 8) || err) { printf("error\n"); return err; } - for(j = 0; j < 8; j++) { + for (j = 0; j < 8; j++) { length <<= 8; length |= buf[j]; tmp[i++] = buf[j]; @@ -666,35 +681,34 @@ static int read_WRAP(reader *r) return read_the_rest(r, length, tmp, i, 1); } -static int read_BUFR(reader *r) +static int read_BUFR(reader* r) { /* unsigned char tmp[65536];*/ /* Should be enough */ - size_t length = 0; - long edition = 0; - int err = 0; - int i = 0 ,j; - size_t buflen=2048; - unsigned char *tmp=NULL; - grib_context *c=NULL; - grib_buffer* buf=NULL; + size_t length = 0; + long edition = 0; + int err = 0; + int i = 0, j; + size_t buflen = 2048; + unsigned char* tmp = NULL; + grib_context* c = NULL; + grib_buffer* buf = NULL; /*TODO proper context*/ - c=grib_context_get_default(); - tmp=(unsigned char*)malloc(buflen); + c = grib_context_get_default(); + tmp = (unsigned char*)malloc(buflen); if (!tmp) return GRIB_OUT_OF_MEMORY; - buf=grib_new_buffer(c,tmp,buflen); + buf = grib_new_buffer(c, tmp, buflen); buf->property = GRIB_MY_BUFFER; - r->offset=r->tell(r->read_data)-4; + r->offset = r->tell(r->read_data) - 4; tmp[i++] = 'B'; tmp[i++] = 'U'; tmp[i++] = 'F'; tmp[i++] = 'R'; - for(j=0;j<3;j++) - { - if(r->read(r->read_data,&tmp[i],1,&err) != 1 || err) + for (j = 0; j < 3; j++) { + if (r->read(r->read_data, &tmp[i], 1, &err) != 1 || err) return err; length <<= 8; @@ -702,13 +716,13 @@ static int read_BUFR(reader *r) i++; } - if(length==0) { - grib_buffer_delete(c,buf); + if (length == 0) { + grib_buffer_delete(c, buf); return GRIB_INVALID_MESSAGE; } /* Edition number */ - if(r->read(r->read_data,&tmp[i],1,&err) != 1 || err) + if (r->read(r->read_data, &tmp[i], 1, &err) != 1 || err) return err; edition = tmp[i++]; @@ -716,244 +730,235 @@ static int read_BUFR(reader *r) /* Assert(edition != 1); */ switch (edition) { - case 0: - case 1: - { - int n; - size_t sec1len = 0; - size_t sec2len = 0; - size_t sec3len = 0; - size_t sec4len = 0; - unsigned long flags; - - sec1len = length; - - /* table version */ - if(r->read(r->read_data,&tmp[i++],1,&err) != 1 || err) return err; - /* center */ - if(r->read(r->read_data,&tmp[i++],1,&err) != 1 || err) return err; - /* update */ - if(r->read(r->read_data,&tmp[i++],1,&err) != 1 || err) return err; - /* flags */ - if(r->read(r->read_data,&tmp[i],1,&err) != 1 || err) return err; - flags = tmp[i++]; - - - GROW_BUF_IF_REQUIRED(sec1len + 4 + 3); - - /* Read section 1. 3 = length, 5 = table,center,process,flags */ - - n = sec1len - 8; /* Just a guess */ - if((r->read(r->read_data,tmp+i,n,&err) != n) || err) - return err; + case 0: + case 1: { + int n; + size_t sec1len = 0; + size_t sec2len = 0; + size_t sec3len = 0; + size_t sec4len = 0; + unsigned long flags; - i += n; + sec1len = length; - if(flags & (1<<7)) { - /* Section 2 */ - for(j=0;j<3;j++) - { - if(r->read(r->read_data,&tmp[i],1,&err) != 1 || err) - return err; + /* table version */ + if (r->read(r->read_data, &tmp[i++], 1, &err) != 1 || err) + return err; + /* center */ + if (r->read(r->read_data, &tmp[i++], 1, &err) != 1 || err) + return err; + /* update */ + if (r->read(r->read_data, &tmp[i++], 1, &err) != 1 || err) + return err; + /* flags */ + if (r->read(r->read_data, &tmp[i], 1, &err) != 1 || err) + return err; + flags = tmp[i++]; - sec2len <<= 8; - sec2len |= tmp[i]; - i++; - } - GROW_BUF_IF_REQUIRED(sec1len + sec2len + 4 + 3); + GROW_BUF_IF_REQUIRED(sec1len + 4 + 3); - /* Read section 2 */ - if((r->read(r->read_data,tmp+i,sec2len-3,&err) != sec2len-3) || err) + /* Read section 1. 3 = length, 5 = table,center,process,flags */ + + n = sec1len - 8; /* Just a guess */ + if ((r->read(r->read_data, tmp + i, n, &err) != n) || err) return err; - i += sec2len-3; - } + i += n; - /* Section 3 */ - for(j=0;j<3;j++) - { - if(r->read(r->read_data,&tmp[i],1,&err) != 1 || err) - return err; + if (flags & (1 << 7)) { + /* Section 2 */ + for (j = 0; j < 3; j++) { + if (r->read(r->read_data, &tmp[i], 1, &err) != 1 || err) + return err; - sec3len <<= 8; - sec3len |= tmp[i]; - i++; - } + sec2len <<= 8; + sec2len |= tmp[i]; + i++; + } - GROW_BUF_IF_REQUIRED(sec1len + sec2len + sec3len + 4 + 3); + GROW_BUF_IF_REQUIRED(sec1len + sec2len + 4 + 3); - /* Read section 3 */ - if((r->read(r->read_data,tmp+i,sec3len-3,&err) != sec3len-3) || err) - return err; - i += sec3len-3; + /* Read section 2 */ + if ((r->read(r->read_data, tmp + i, sec2len - 3, &err) != sec2len - 3) || err) + return err; + i += sec2len - 3; + } + + + /* Section 3 */ + for (j = 0; j < 3; j++) { + if (r->read(r->read_data, &tmp[i], 1, &err) != 1 || err) + return err; + + sec3len <<= 8; + sec3len |= tmp[i]; + i++; + } + + GROW_BUF_IF_REQUIRED(sec1len + sec2len + sec3len + 4 + 3); - for(j=0;j<3;j++) - { - if(r->read(r->read_data,&tmp[i],1,&err) != 1 || err) + /* Read section 3 */ + if ((r->read(r->read_data, tmp + i, sec3len - 3, &err) != sec3len - 3) || err) return err; + i += sec3len - 3; - sec4len <<= 8; - sec4len |= tmp[i]; - i++; - } + for (j = 0; j < 3; j++) { + if (r->read(r->read_data, &tmp[i], 1, &err) != 1 || err) + return err; - /* fprintf(stderr," sec1len=%d sec2len=%d sec3len=%d sec4len=%d\n",sec1len, sec2len,sec3len,sec4len); */ - length = 4 + sec1len + sec2len + sec3len + sec4len + 4; - /* fprintf(stderr,"length = %d i = %d\n",length,i); */ - } - break; - case 2: - case 3: - case 4: - break; - default : - r->seek_from_start(r->read_data,r->offset+4); - grib_buffer_delete(c,buf); - return GRIB_UNSUPPORTED_EDITION; + sec4len <<= 8; + sec4len |= tmp[i]; + i++; + } + + /* fprintf(stderr," sec1len=%d sec2len=%d sec3len=%d sec4len=%d\n",sec1len, sec2len,sec3len,sec4len); */ + length = 4 + sec1len + sec2len + sec3len + sec4len + 4; + /* fprintf(stderr,"length = %d i = %d\n",length,i); */ + } break; + case 2: + case 3: + case 4: + break; + default: + r->seek_from_start(r->read_data, r->offset + 4); + grib_buffer_delete(c, buf); + return GRIB_UNSUPPORTED_EDITION; } /* Assert(i <= sizeof(tmp)); */ - err=read_the_rest(r, length, tmp, i, 1); + err = read_the_rest(r, length, tmp, i, 1); if (err) - r->seek_from_start(r->read_data,r->offset+4); + r->seek_from_start(r->read_data, r->offset + 4); - grib_buffer_delete(c,buf); + grib_buffer_delete(c, buf); return err; } -static int _read_any(reader *r, int grib_ok, int bufr_ok, int hdf5_ok, int wrap_ok) +static int _read_any(reader* r, int grib_ok, int bufr_ok, int hdf5_ok, int wrap_ok) { unsigned char c; - int err = 0; + int err = 0; unsigned long magic = 0; - while(r->read(r->read_data,&c,1,&err) == 1 && err == 0) - { + while (r->read(r->read_data, &c, 1, &err) == 1 && err == 0) { magic <<= 8; magic |= c; - switch(magic & 0xffffffff) - { - case GRIB: - if(grib_ok) - { - err = read_GRIB(r); - return err == GRIB_END_OF_FILE ? GRIB_PREMATURE_END_OF_FILE : err; /* Premature EOF */ - } - break; + switch (magic & 0xffffffff) { + case GRIB: + if (grib_ok) { + err = read_GRIB(r); + return err == GRIB_END_OF_FILE ? GRIB_PREMATURE_END_OF_FILE : err; /* Premature EOF */ + } + break; - case BUFR: - if(bufr_ok) - { - err = read_BUFR(r); - return err == GRIB_END_OF_FILE ? GRIB_PREMATURE_END_OF_FILE : err; /* Premature EOF */ - } - break; + case BUFR: + if (bufr_ok) { + err = read_BUFR(r); + return err == GRIB_END_OF_FILE ? GRIB_PREMATURE_END_OF_FILE : err; /* Premature EOF */ + } + break; - case HDF5: - if(hdf5_ok) - { - err = read_HDF5(r); - return err == GRIB_END_OF_FILE ? GRIB_PREMATURE_END_OF_FILE : err; /* Premature EOF */ - } - break; + case HDF5: + if (hdf5_ok) { + err = read_HDF5(r); + return err == GRIB_END_OF_FILE ? GRIB_PREMATURE_END_OF_FILE : err; /* Premature EOF */ + } + break; - case WRAP: - if(wrap_ok) - { - err = read_WRAP(r); - return err == GRIB_END_OF_FILE ? GRIB_PREMATURE_END_OF_FILE : err; /* Premature EOF */ - } - break; + case WRAP: + if (wrap_ok) { + err = read_WRAP(r); + return err == GRIB_END_OF_FILE ? GRIB_PREMATURE_END_OF_FILE : err; /* Premature EOF */ + } + break; - case BUDG: - if(grib_ok) - { - err = read_PSEUDO(r,"BUDG"); - return err == GRIB_END_OF_FILE ? GRIB_PREMATURE_END_OF_FILE : err; /* Premature EOF */ - } - break; - case DIAG: - if(grib_ok) - { - err = read_PSEUDO(r,"DIAG"); - return err == GRIB_END_OF_FILE ? GRIB_PREMATURE_END_OF_FILE : err; /* Premature EOF */ - } - break; - case TIDE: - if(grib_ok) - { - err = read_PSEUDO(r,"TIDE"); - return err == GRIB_END_OF_FILE ? GRIB_PREMATURE_END_OF_FILE : err; /* Premature EOF */ - } - break; + case BUDG: + if (grib_ok) { + err = read_PSEUDO(r, "BUDG"); + return err == GRIB_END_OF_FILE ? GRIB_PREMATURE_END_OF_FILE : err; /* Premature EOF */ + } + break; + case DIAG: + if (grib_ok) { + err = read_PSEUDO(r, "DIAG"); + return err == GRIB_END_OF_FILE ? GRIB_PREMATURE_END_OF_FILE : err; /* Premature EOF */ + } + break; + case TIDE: + if (grib_ok) { + err = read_PSEUDO(r, "TIDE"); + return err == GRIB_END_OF_FILE ? GRIB_PREMATURE_END_OF_FILE : err; /* Premature EOF */ + } + break; } } return err; } -static int read_any(reader *r, int grib_ok, int bufr_ok, int hdf5_ok, int wrap_ok) +static int read_any(reader* r, int grib_ok, int bufr_ok, int hdf5_ok, int wrap_ok) { int result = 0; - GRIB_MUTEX_INIT_ONCE(&once,&init); + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex1); result = _read_any(r, grib_ok, bufr_ok, hdf5_ok, wrap_ok); GRIB_MUTEX_UNLOCK(&mutex1); return result; } -static int read_any_gts(reader *r) +static int read_any_gts(reader* r) { unsigned char c; - int err = 0; - unsigned char* buffer=NULL; - unsigned long magic = 0; - unsigned long start = 0x010d0d0a; /* SOH CR CR LF */ - unsigned long theEnd = 0x0d0d0a03; /* CR CR LF ETX */ - unsigned char tmp[1024]={0,}; /* See ECC-735 */ - size_t message_size=0; - size_t already_read=0; - int i=0; - - while(r->read(r->read_data,&c,1,&err) == 1 && err == 0) - { + int err = 0; + unsigned char* buffer = NULL; + unsigned long magic = 0; + unsigned long start = 0x010d0d0a; /* SOH CR CR LF */ + unsigned long theEnd = 0x0d0d0a03; /* CR CR LF ETX */ + unsigned char tmp[1024] = {0,}; /* See ECC-735 */ + size_t message_size = 0; + size_t already_read = 0; + int i = 0; + + while (r->read(r->read_data, &c, 1, &err) == 1 && err == 0) { magic <<= 8; magic |= c; magic &= 0xffffffff; if (magic == start) { - tmp[i++]=0x01; - tmp[i++]=0x0d; - tmp[i++]=0x0d; - tmp[i++]=0x0a; + tmp[i++] = 0x01; + tmp[i++] = 0x0d; + tmp[i++] = 0x0d; + tmp[i++] = 0x0a; - r->offset=r->tell(r->read_data)-4; + r->offset = r->tell(r->read_data) - 4; - if(r->read(r->read_data,&tmp[i],6,&err) != 6 || err) + if (r->read(r->read_data, &tmp[i], 6, &err) != 6 || err) return err == GRIB_END_OF_FILE ? GRIB_PREMATURE_END_OF_FILE : err; /* Premature EOF */ - if (tmp[7] != 0x0d || tmp[8]!= 0x0d || tmp[9]!=0x0a) { - r->seek(r->read_data,-6); + if (tmp[7] != 0x0d || tmp[8] != 0x0d || tmp[9] != 0x0a) { + r->seek(r->read_data, -6); continue; } - magic=0; - already_read=10; - message_size=already_read; - while(r->read(r->read_data,&c,1,&err) == 1 && err == 0) { + magic = 0; + already_read = 10; + message_size = already_read; + while (r->read(r->read_data, &c, 1, &err) == 1 && err == 0) { message_size++; magic <<= 8; magic |= c; magic &= 0xffffffff; if (magic == theEnd) { - r->seek(r->read_data,already_read-message_size); - buffer = (unsigned char*)r->alloc(r->alloc_data,&message_size,&err); - if (!buffer) return GRIB_OUT_OF_MEMORY; - if (err) return err; - memcpy(buffer,tmp,already_read); - r->read(r->read_data,buffer+already_read,message_size-already_read,&err); - r->message_size=message_size; + r->seek(r->read_data, already_read - message_size); + buffer = (unsigned char*)r->alloc(r->alloc_data, &message_size, &err); + if (!buffer) + return GRIB_OUT_OF_MEMORY; + if (err) + return err; + memcpy(buffer, tmp, already_read); + r->read(r->read_data, buffer + already_read, message_size - already_read, &err); + r->message_size = message_size; return err; } } @@ -963,44 +968,45 @@ static int read_any_gts(reader *r) return err; } -static int read_any_taf(reader *r) +static int read_any_taf(reader* r) { unsigned char c; - int err = 0; - unsigned char* buffer=NULL; - unsigned long magic = 0; - unsigned long start = 0x54414620; - unsigned char tmp[1000]={0,}; /* Should be enough */ - size_t message_size=0; - size_t already_read=0; - int i=0; - - while(r->read(r->read_data,&c,1,&err) == 1 && err == 0) - { + int err = 0; + unsigned char* buffer = NULL; + unsigned long magic = 0; + unsigned long start = 0x54414620; + unsigned char tmp[1000] = {0,}; /* Should be enough */ + size_t message_size = 0; + size_t already_read = 0; + int i = 0; + + while (r->read(r->read_data, &c, 1, &err) == 1 && err == 0) { magic <<= 8; magic |= c; magic &= 0xffffffff; if (magic == start) { - tmp[i++]=0x54; - tmp[i++]=0x41; - tmp[i++]=0x46; - tmp[i++]=0x20; + tmp[i++] = 0x54; + tmp[i++] = 0x41; + tmp[i++] = 0x46; + tmp[i++] = 0x20; - r->offset=r->tell(r->read_data)-4; + r->offset = r->tell(r->read_data) - 4; - already_read=4; - message_size=already_read; - while(r->read(r->read_data,&c,1,&err) == 1 && err == 0) { + already_read = 4; + message_size = already_read; + while (r->read(r->read_data, &c, 1, &err) == 1 && err == 0) { message_size++; if (c == '=') { - r->seek(r->read_data,already_read-message_size); - buffer = (unsigned char*)r->alloc(r->alloc_data,&message_size,&err); - if (!buffer) return GRIB_OUT_OF_MEMORY; - if (err) return err; - memcpy(buffer,tmp,already_read); - r->read(r->read_data,buffer+already_read,message_size-already_read,&err); - r->message_size=message_size; + r->seek(r->read_data, already_read - message_size); + buffer = (unsigned char*)r->alloc(r->alloc_data, &message_size, &err); + if (!buffer) + return GRIB_OUT_OF_MEMORY; + if (err) + return err; + memcpy(buffer, tmp, already_read); + r->read(r->read_data, buffer + already_read, message_size - already_read, &err); + r->message_size = message_size; return err; } } @@ -1010,48 +1016,49 @@ static int read_any_taf(reader *r) return err; } -static int read_any_metar(reader *r) +static int read_any_metar(reader* r) { unsigned char c; - int err = 0; - unsigned char* buffer=NULL; - unsigned long magic = 0; - unsigned long start = 0x4d455441; - unsigned char tmp[32]={0,}; /* Should be enough */ - size_t message_size=0; - size_t already_read=0; - int i=0; - - while(r->read(r->read_data,&c,1,&err) == 1 && err == 0) - { + int err = 0; + unsigned char* buffer = NULL; + unsigned long magic = 0; + unsigned long start = 0x4d455441; + unsigned char tmp[32] = {0,}; /* Should be enough */ + size_t message_size = 0; + size_t already_read = 0; + int i = 0; + + while (r->read(r->read_data, &c, 1, &err) == 1 && err == 0) { magic <<= 8; magic |= c; magic &= 0xffffffff; if (magic == start) { - if (r->read(r->read_data,&c,1,&err) != 1 || err!=0) + if (r->read(r->read_data, &c, 1, &err) != 1 || err != 0) break; - if (c == 'R' ) { - tmp[i++]=0x4d; - tmp[i++]=0x45; - tmp[i++]=0x54; - tmp[i++]=0x41; - tmp[i++]='R'; - - r->offset=r->tell(r->read_data)-4; - - already_read=5; - message_size=already_read; - while(r->read(r->read_data,&c,1,&err) == 1 && err == 0) { + if (c == 'R') { + tmp[i++] = 0x4d; + tmp[i++] = 0x45; + tmp[i++] = 0x54; + tmp[i++] = 0x41; + tmp[i++] = 'R'; + + r->offset = r->tell(r->read_data) - 4; + + already_read = 5; + message_size = already_read; + while (r->read(r->read_data, &c, 1, &err) == 1 && err == 0) { message_size++; if (c == '=') { - r->seek(r->read_data,already_read-message_size); - buffer = (unsigned char*)r->alloc(r->alloc_data,&message_size,&err); - if (!buffer) return GRIB_OUT_OF_MEMORY; - if (err) return err; - memcpy(buffer,tmp,already_read); - r->read(r->read_data,buffer+already_read,message_size-already_read,&err); - r->message_size=message_size; + r->seek(r->read_data, already_read - message_size); + buffer = (unsigned char*)r->alloc(r->alloc_data, &message_size, &err); + if (!buffer) + return GRIB_OUT_OF_MEMORY; + if (err) + return err; + memcpy(buffer, tmp, already_read); + r->read(r->read_data, buffer + already_read, message_size - already_read, &err); + r->message_size = message_size; return err; } } @@ -1068,64 +1075,69 @@ off_t stdio_tell(void* data) return ftello(f); } -int stdio_seek(void* data,off_t len) +int stdio_seek(void* data, off_t len) { FILE* f = (FILE*)data; - int err=0; - if (fseeko(f,len,SEEK_CUR)) err=GRIB_IO_PROBLEM; + int err = 0; + if (fseeko(f, len, SEEK_CUR)) + err = GRIB_IO_PROBLEM; return err; } -int stdio_seek_from_start(void* data,off_t len) +int stdio_seek_from_start(void* data, off_t len) { FILE* f = (FILE*)data; - int err=0; - if (fseeko(f,len,SEEK_SET)) err=GRIB_IO_PROBLEM; + int err = 0; + if (fseeko(f, len, SEEK_SET)) + err = GRIB_IO_PROBLEM; return err; } -size_t stdio_read(void* data,void* buf,size_t len,int* err) +size_t stdio_read(void* data, void* buf, size_t len, int* err) { FILE* f = (FILE*)data; size_t n; /* char iobuf[1024*1024]; */ - if (len==0) return 0; + if (len == 0) + return 0; /* setvbuf(f,iobuf,_IOFBF,sizeof(iobuf)); */ - n = fread(buf,1,len,f); + n = fread(buf, 1, len, f); /* fprintf(stderr,"read %d = %x %c\n",1,(int)buf[0],buf[0]); */ - if(n != len) { + if (n != len) { /* fprintf(stderr,"Failed to read %d, only got %d\n",len,n); */ - *err = GRIB_IO_PROBLEM; - if(feof(f)) *err = GRIB_END_OF_FILE; - if(ferror(f)) *err = GRIB_IO_PROBLEM; + *err = GRIB_IO_PROBLEM; + if (feof(f)) + *err = GRIB_END_OF_FILE; + if (ferror(f)) + *err = GRIB_IO_PROBLEM; } return n; } /*================== */ -typedef struct user_buffer { - void* user_buffer; - size_t buffer_size; +typedef struct user_buffer +{ + void* user_buffer; + size_t buffer_size; } user_buffer; -static void* user_provider_buffer(void *data,size_t* length,int *err) +static void* user_provider_buffer(void* data, size_t* length, int* err) { - user_buffer *u = (user_buffer*)data; - *length = u->buffer_size; + user_buffer* u = (user_buffer*)data; + *length = u->buffer_size; return u->user_buffer; } -static -int _wmo_read_any_from_file(FILE* f,void* buffer,size_t* len,int grib_ok,int bufr_ok, int hdf5_ok, int wrap_ok) +static int _wmo_read_any_from_file(FILE* f, void* buffer, size_t* len, int grib_ok, int bufr_ok, int hdf5_ok, int wrap_ok) { - int err; + int err; user_buffer u; - reader r; + reader r; - u.user_buffer = buffer; - u.buffer_size = *len; + u.user_buffer = buffer; + u.buffer_size = *len; r.message_size = 0; r.read_data = f; @@ -1137,35 +1149,35 @@ int _wmo_read_any_from_file(FILE* f,void* buffer,size_t* len,int grib_ok,int buf r.alloc = &user_provider_buffer; r.headers_only = 0; - err = read_any(&r, grib_ok, bufr_ok, hdf5_ok, wrap_ok); - *len = r.message_size; + err = read_any(&r, grib_ok, bufr_ok, hdf5_ok, wrap_ok); + *len = r.message_size; return err; } -int wmo_read_any_from_file(FILE* f,void* buffer,size_t* len) +int wmo_read_any_from_file(FILE* f, void* buffer, size_t* len) { return _wmo_read_any_from_file(f, buffer, len, 1, 1, 1, 1); } -int wmo_read_grib_from_file(FILE* f,void* buffer,size_t* len) +int wmo_read_grib_from_file(FILE* f, void* buffer, size_t* len) { return _wmo_read_any_from_file(f, buffer, len, 1, 0, 0, 0); } -int wmo_read_bufr_from_file(FILE* f,void* buffer,size_t* len) +int wmo_read_bufr_from_file(FILE* f, void* buffer, size_t* len) { return _wmo_read_any_from_file(f, buffer, len, 0, 1, 0, 0); } -int wmo_read_gts_from_file(FILE* f,void* buffer,size_t* len) +int wmo_read_gts_from_file(FILE* f, void* buffer, size_t* len) { - int err; + int err; user_buffer u; - reader r; + reader r; - u.user_buffer = buffer; - u.buffer_size = *len; + u.user_buffer = buffer; + u.buffer_size = *len; r.message_size = 0; r.read_data = f; @@ -1177,20 +1189,20 @@ int wmo_read_gts_from_file(FILE* f,void* buffer,size_t* len) r.alloc = &user_provider_buffer; r.headers_only = 0; - err = read_any_gts(&r); - *len = r.message_size; + err = read_any_gts(&r); + *len = r.message_size; return err; } -int wmo_read_taf_from_file(FILE* f,void* buffer,size_t* len) +int wmo_read_taf_from_file(FILE* f, void* buffer, size_t* len) { - int err; + int err; user_buffer u; - reader r; + reader r; - u.user_buffer = buffer; - u.buffer_size = *len; + u.user_buffer = buffer; + u.buffer_size = *len; r.read_data = f; r.read = &stdio_read; @@ -1201,20 +1213,20 @@ int wmo_read_taf_from_file(FILE* f,void* buffer,size_t* len) r.alloc = &user_provider_buffer; r.headers_only = 0; - err = read_any_taf(&r); - *len = r.message_size; + err = read_any_taf(&r); + *len = r.message_size; return err; } -int wmo_read_metar_from_file(FILE* f,void* buffer,size_t* len) +int wmo_read_metar_from_file(FILE* f, void* buffer, size_t* len) { - int err; + int err; user_buffer u; - reader r; + reader r; - u.user_buffer = buffer; - u.buffer_size = *len; + u.user_buffer = buffer; + u.buffer_size = *len; r.read_data = f; r.read = &stdio_read; @@ -1225,18 +1237,18 @@ int wmo_read_metar_from_file(FILE* f,void* buffer,size_t* len) r.alloc = &user_provider_buffer; r.headers_only = 0; - err = read_any_metar(&r); - *len = r.message_size; + err = read_any_metar(&r); + *len = r.message_size; return err; } /*================== */ -typedef struct stream_struct { - +typedef struct stream_struct +{ void* stream_data; - long (*stream_proc)(void*,void* buffer,long len); + long (*stream_proc)(void*, void* buffer, long len); } stream_struct; @@ -1245,25 +1257,26 @@ static off_t stream_tell(void* data) return 0; } -static int stream_seek(void* data,off_t len) +static int stream_seek(void* data, off_t len) { return 0; } -static size_t stream_read(void* data,void* buffer,size_t len,int* err) +static size_t stream_read(void* data, void* buffer, size_t len, int* err) { - stream_struct *s = (stream_struct*)data; - long n = len; + stream_struct* s = (stream_struct*)data; + long n = len; - if(n != len) { + if (n != len) { /* size_t cannot be coded into long */ - *err = GRIB_INTERNAL_ERROR; + *err = GRIB_INTERNAL_ERROR; return -1; } - n = s->stream_proc(s->stream_data,buffer,len); - if(n != len) { - *err = GRIB_IO_PROBLEM; - if(n == -1) *err = GRIB_END_OF_FILE; + n = s->stream_proc(s->stream_data, buffer, len); + if (n != len) { + *err = GRIB_IO_PROBLEM; + if (n == -1) + *err = GRIB_END_OF_FILE; } return n; } @@ -1271,28 +1284,28 @@ static size_t stream_read(void* data,void* buffer,size_t len,int* err) /*================== */ -static void* allocate_buffer(void *data,size_t* length,int *err) +static void* allocate_buffer(void* data, size_t* length, int* err) { - alloc_buffer *u = (alloc_buffer*)data; - u->buffer = malloc(*length); - u->size=*length; - if(u->buffer == NULL) + alloc_buffer* u = (alloc_buffer*)data; + u->buffer = malloc(*length); + u->size = *length; + if (u->buffer == NULL) *err = GRIB_OUT_OF_MEMORY; /* Cannot allocate buffer */ return u->buffer; } -int wmo_read_any_from_stream(void* stream_data,long (*stream_proc)(void*,void* buffer,long len) ,void* buffer,size_t* len) +int wmo_read_any_from_stream(void* stream_data, long (*stream_proc)(void*, void* buffer, long len), void* buffer, size_t* len) { - int err; + int err; stream_struct s; - user_buffer u; - reader r; + user_buffer u; + reader r; s.stream_data = stream_data; s.stream_proc = stream_proc; - u.user_buffer = buffer; - u.buffer_size = *len; + u.user_buffer = buffer; + u.buffer_size = *len; r.message_size = 0; r.offset = 0; @@ -1305,18 +1318,18 @@ int wmo_read_any_from_stream(void* stream_data,long (*stream_proc)(void*,void* b r.alloc = &user_provider_buffer; r.headers_only = 0; - err = read_any(&r, 1, 1, 1, 1); - *len = r.message_size; + err = read_any(&r, 1, 1, 1, 1); + *len = r.message_size; return err; } /* This function allocates memory for the result so the user is responsible for freeing it */ -void* wmo_read_any_from_stream_malloc(void* stream_data,long (*stream_proc)(void*,void* buffer,long len) ,size_t *size, int* err) +void* wmo_read_any_from_stream_malloc(void* stream_data, long (*stream_proc)(void*, void* buffer, long len), size_t* size, int* err) { - alloc_buffer u; + alloc_buffer u; stream_struct s; - reader r; + reader r; u.buffer = NULL; @@ -1334,8 +1347,8 @@ void* wmo_read_any_from_stream_malloc(void* stream_data,long (*stream_proc)(void r.alloc = &allocate_buffer; r.headers_only = 0; - *err = read_any(&r, 1, 1, 1, 1); - *size = r.message_size; + *err = read_any(&r, 1, 1, 1, 1); + *size = r.message_size; return u.buffer; } @@ -1343,13 +1356,13 @@ void* wmo_read_any_from_stream_malloc(void* stream_data,long (*stream_proc)(void /*================== */ /* This function allocates memory for the result so the user is responsible for freeing it */ -void *wmo_read_gts_from_file_malloc(FILE* f,int headers_only,size_t *size,off_t *offset,int* err) +void* wmo_read_gts_from_file_malloc(FILE* f, int headers_only, size_t* size, off_t* offset, int* err) { alloc_buffer u; - reader r; + reader r; - u.buffer = NULL; - r.offset = 0; + u.buffer = NULL; + r.offset = 0; r.message_size = 0; r.read_data = f; @@ -1361,20 +1374,20 @@ void *wmo_read_gts_from_file_malloc(FILE* f,int headers_only,size_t *size,off_t r.alloc = &allocate_buffer; r.headers_only = headers_only; - *err = read_any_gts(&r); - *size = r.message_size; - *offset = r.offset; + *err = read_any_gts(&r); + *size = r.message_size; + *offset = r.offset; return u.buffer; } /* This function allocates memory for the result so the user is responsible for freeing it */ -void *wmo_read_taf_from_file_malloc(FILE* f,int headers_only,size_t *size,off_t *offset,int* err) +void* wmo_read_taf_from_file_malloc(FILE* f, int headers_only, size_t* size, off_t* offset, int* err) { alloc_buffer u; - reader r; + reader r; - u.buffer = NULL; + u.buffer = NULL; r.offset = 0; r.message_size = 0; @@ -1387,20 +1400,20 @@ void *wmo_read_taf_from_file_malloc(FILE* f,int headers_only,size_t *size,off_t r.alloc = &allocate_buffer; r.headers_only = headers_only; - *err = read_any_taf(&r); - *size = r.message_size; - *offset = r.offset; + *err = read_any_taf(&r); + *size = r.message_size; + *offset = r.offset; return u.buffer; } /* This function allocates memory for the result so the user is responsible for freeing it */ -void *wmo_read_metar_from_file_malloc(FILE* f,int headers_only,size_t *size,off_t *offset,int* err) +void* wmo_read_metar_from_file_malloc(FILE* f, int headers_only, size_t* size, off_t* offset, int* err) { alloc_buffer u; - reader r; + reader r; - u.buffer = NULL; + u.buffer = NULL; r.message_size = 0; r.read_data = f; @@ -1413,22 +1426,22 @@ void *wmo_read_metar_from_file_malloc(FILE* f,int headers_only,size_t *size,off_ r.alloc = &allocate_buffer; r.headers_only = headers_only; - *err = read_any_metar(&r); - *size = r.message_size; - *offset = r.offset; + *err = read_any_metar(&r); + *size = r.message_size; + *offset = r.offset; return u.buffer; } /* This function allocates memory for the result so the user is responsible for freeing it */ -static void *_wmo_read_any_from_file_malloc(FILE* f,int* err,size_t *size,off_t *offset, - int grib_ok,int bufr_ok, int hdf5_ok, int wrap_ok, int headers_only) +static void* _wmo_read_any_from_file_malloc(FILE* f, int* err, size_t* size, off_t* offset, + int grib_ok, int bufr_ok, int hdf5_ok, int wrap_ok, int headers_only) { alloc_buffer u; - reader r; + reader r; - u.buffer = NULL; - u.size = 0; + u.buffer = NULL; + u.size = 0; r.message_size = 0; r.read_data = f; @@ -1441,57 +1454,58 @@ static void *_wmo_read_any_from_file_malloc(FILE* f,int* err,size_t *size,off_t r.headers_only = headers_only; r.offset = 0; - *err = read_any(&r, grib_ok, bufr_ok, hdf5_ok, wrap_ok); + *err = read_any(&r, grib_ok, bufr_ok, hdf5_ok, wrap_ok); - *size = r.message_size; - *offset = r.offset; + *size = r.message_size; + *offset = r.offset; return u.buffer; } /* This function allocates memory for the result so the user is responsible for freeing it */ -void *wmo_read_any_from_file_malloc(FILE* f,int headers_only,size_t *size,off_t *offset,int* err) +void* wmo_read_any_from_file_malloc(FILE* f, int headers_only, size_t* size, off_t* offset, int* err) { - return _wmo_read_any_from_file_malloc(f,err,size,offset, 1, 1, 1, 1, headers_only); + return _wmo_read_any_from_file_malloc(f, err, size, offset, 1, 1, 1, 1, headers_only); } /* This function allocates memory for the result so the user is responsible for freeing it */ -void *wmo_read_grib_from_file_malloc(FILE* f,int headers_only,size_t *size,off_t *offset,int* err) +void* wmo_read_grib_from_file_malloc(FILE* f, int headers_only, size_t* size, off_t* offset, int* err) { - return _wmo_read_any_from_file_malloc(f,err,size,offset, 1, 0, 0, 0, headers_only); + return _wmo_read_any_from_file_malloc(f, err, size, offset, 1, 0, 0, 0, headers_only); } /* This function allocates memory for the result so the user is responsible for freeing it */ -void *wmo_read_bufr_from_file_malloc(FILE* f,int headers_only,size_t *size,off_t *offset,int* err) +void* wmo_read_bufr_from_file_malloc(FILE* f, int headers_only, size_t* size, off_t* offset, int* err) { - return _wmo_read_any_from_file_malloc(f,err,size,offset, 0, 1, 0, 0, headers_only); + return _wmo_read_any_from_file_malloc(f, err, size, offset, 0, 1, 0, 0, headers_only); } /* ======================================= */ -typedef struct context_alloc_buffer { - grib_context* ctx; - void* buffer; - size_t length; +typedef struct context_alloc_buffer +{ + grib_context* ctx; + void* buffer; + size_t length; } context_alloc_buffer; -static void* context_allocate_buffer(void *data,size_t* length,int *err) +static void* context_allocate_buffer(void* data, size_t* length, int* err) { - context_alloc_buffer *u = (context_alloc_buffer*)data; - u->buffer = grib_context_malloc(u->ctx,*length); - u->length = *length; + context_alloc_buffer* u = (context_alloc_buffer*)data; + u->buffer = grib_context_malloc(u->ctx, *length); + u->length = *length; - if(u->buffer == NULL) + if (u->buffer == NULL) *err = GRIB_OUT_OF_MEMORY; /* Cannot allocate buffer */ return u->buffer; } -int grib_read_any_headers_only_from_file(grib_context* ctx,FILE* f,void* buffer,size_t* len) +int grib_read_any_headers_only_from_file(grib_context* ctx, FILE* f, void* buffer, size_t* len) { - int err; + int err; user_buffer u; - reader r; + reader r; - u.user_buffer = buffer; - u.buffer_size = *len; + u.user_buffer = buffer; + u.buffer_size = *len; r.message_size = 0; r.read_data = f; @@ -1503,22 +1517,22 @@ int grib_read_any_headers_only_from_file(grib_context* ctx,FILE* f,void* buffer, r.alloc = &user_provider_buffer; r.headers_only = 1; - err = read_any(&r, 1, GRIB_API_READS_BUFR, GRIB_API_READS_HDF5, GRIB_API_READS_WRAP); + err = read_any(&r, 1, GRIB_API_READS_BUFR, GRIB_API_READS_HDF5, GRIB_API_READS_WRAP); - *len = r.message_size; + *len = r.message_size; return err; } -int grib_read_any_from_file(grib_context* ctx,FILE* f,void* buffer,size_t* len) +int grib_read_any_from_file(grib_context* ctx, FILE* f, void* buffer, size_t* len) { - int err; + int err; user_buffer u; - reader r; - off_t offset; + reader r; + off_t offset; - u.user_buffer = buffer; - u.buffer_size = *len; + u.user_buffer = buffer; + u.buffer_size = *len; r.message_size = 0; r.read_data = f; @@ -1530,24 +1544,25 @@ int grib_read_any_from_file(grib_context* ctx,FILE* f,void* buffer,size_t* len) r.alloc = &user_provider_buffer; r.headers_only = 0; - offset=ftello(f); + offset = ftello(f); - err = read_any(&r, 1, GRIB_API_READS_BUFR, GRIB_API_READS_HDF5, GRIB_API_READS_WRAP); + err = read_any(&r, 1, GRIB_API_READS_BUFR, GRIB_API_READS_HDF5, GRIB_API_READS_WRAP); - if (err==GRIB_BUFFER_TOO_SMALL) { - if (fseeko(f,offset,SEEK_SET)) - err=GRIB_IO_PROBLEM; + if (err == GRIB_BUFFER_TOO_SMALL) { + if (fseeko(f, offset, SEEK_SET)) + err = GRIB_IO_PROBLEM; } - *len = r.message_size; + *len = r.message_size; return err; } /* ======================================= */ -typedef struct memory_read_data { - unsigned char *data; - size_t data_len; +typedef struct memory_read_data +{ + unsigned char* data; + size_t data_len; } memory_read_data; static off_t memory_tell(void* data) @@ -1555,42 +1570,41 @@ static off_t memory_tell(void* data) return 0; } -static int memory_seek(void* data,off_t len) +static int memory_seek(void* data, off_t len) { return 0; } -static size_t memory_read(void* data,void* buf,size_t len,int* err) +static size_t memory_read(void* data, void* buf, size_t len, int* err) { - memory_read_data *m = (memory_read_data*)data; + memory_read_data* m = (memory_read_data*)data; - if(len == 0) - { + if (len == 0) { *err = GRIB_END_OF_FILE; return 0; } else { size_t l = len > m->data_len ? m->data_len : len; - memcpy(buf,m->data,l); + memcpy(buf, m->data, l); m->data_len -= l; - m->data += l; + m->data += l; return l; } } -int grib_read_any_from_memory_alloc(grib_context* ctx,unsigned char** data,size_t* data_length,void **buffer,size_t* length) +int grib_read_any_from_memory_alloc(grib_context* ctx, unsigned char** data, size_t* data_length, void** buffer, size_t* length) { int err; - memory_read_data m; + memory_read_data m; context_alloc_buffer u; - reader r; + reader r; - m.data = *data; - m.data_len = *data_length; + m.data = *data; + m.data_len = *data_length; - u.buffer = NULL; - u.length = 0; - u.ctx = ctx ? ctx : grib_context_get_default(); + u.buffer = NULL; + u.length = 0; + u.ctx = ctx ? ctx : grib_context_get_default(); r.message_size = 0; r.read_data = &m; @@ -1602,28 +1616,28 @@ int grib_read_any_from_memory_alloc(grib_context* ctx,unsigned char** data,size_ r.alloc = &context_allocate_buffer; r.headers_only = 0; - err = read_any(&r, 1, GRIB_API_READS_BUFR, GRIB_API_READS_HDF5, GRIB_API_READS_WRAP); - *buffer = u.buffer; - *length = u.length; + err = read_any(&r, 1, GRIB_API_READS_BUFR, GRIB_API_READS_HDF5, GRIB_API_READS_WRAP); + *buffer = u.buffer; + *length = u.length; - *data_length = m.data_len; - *data = m.data; + *data_length = m.data_len; + *data = m.data; return err; } -int grib_read_any_from_memory(grib_context* ctx,unsigned char** data,size_t* data_length,void* buffer,size_t* len) +int grib_read_any_from_memory(grib_context* ctx, unsigned char** data, size_t* data_length, void* buffer, size_t* len) { - int err; - memory_read_data m; + int err; + memory_read_data m; user_buffer u; - reader r; + reader r; - m.data = *data; - m.data_len = *data_length; + m.data = *data; + m.data_len = *data_length; - u.user_buffer = buffer; - u.buffer_size = *len; + u.user_buffer = buffer; + u.buffer_size = *len; r.message_size = 0; r.read_data = &m; @@ -1635,51 +1649,51 @@ int grib_read_any_from_memory(grib_context* ctx,unsigned char** data,size_t* dat r.alloc = &user_provider_buffer; r.headers_only = 0; - err = read_any(&r, 1, GRIB_API_READS_BUFR, GRIB_API_READS_HDF5, GRIB_API_READS_WRAP); - *len = r.message_size; + err = read_any(&r, 1, GRIB_API_READS_BUFR, GRIB_API_READS_HDF5, GRIB_API_READS_WRAP); + *len = r.message_size; - *data_length = m.data_len; - *data = m.data; + *data_length = m.data_len; + *data = m.data; return err; } -int grib_count_in_file(grib_context* c, FILE* f,int* n) +int grib_count_in_file(grib_context* c, FILE* f, int* n) { - int err=0; - *n=0; - if (!c) c=grib_context_get_default(); + int err = 0; + *n = 0; + if (!c) + c = grib_context_get_default(); - if ( c->multi_support_on ) - { + if (c->multi_support_on) { /* GRIB-395 */ - grib_handle* h=NULL; - while ((h=grib_handle_new_from_file(c, f , &err))!=NULL) { + grib_handle* h = NULL; + while ((h = grib_handle_new_from_file(c, f, &err)) != NULL) { grib_handle_delete(h); (*n)++; } } - else - { - void* mesg=NULL; - size_t size=0; - off_t offset=0; - while ( (mesg=wmo_read_any_from_file_malloc ( f,0, &size,&offset,&err))!=NULL && err==GRIB_SUCCESS) { - grib_context_free(c,mesg); + else { + void* mesg = NULL; + size_t size = 0; + off_t offset = 0; + while ((mesg = wmo_read_any_from_file_malloc(f, 0, &size, &offset, &err)) != NULL && err == GRIB_SUCCESS) { + grib_context_free(c, mesg); (*n)++; } } rewind(f); - return err==GRIB_END_OF_FILE ? 0 : err; + return err == GRIB_END_OF_FILE ? 0 : err; } int grib_count_in_filename(grib_context* c, const char* filename, int* n) { - int err = 0; + int err = 0; FILE* fp = NULL; - if (!c) c=grib_context_get_default(); + if (!c) + c = grib_context_get_default(); fp = fopen(filename, "rb"); if (!fp) { grib_context_log(c, GRIB_LOG_ERROR, "grib_count_in_filename: Unable to read file \"%s\"", filename); diff --git a/src/grib_iterator.c b/src/grib_iterator.c index 7193ec4c5..2a256a704 100644 --- a/src/grib_iterator.c +++ b/src/grib_iterator.c @@ -16,14 +16,15 @@ #include "grib_api_internal.h" #if GRIB_PTHREADS -static pthread_once_t once = PTHREAD_ONCE_INIT; +static pthread_once_t once = PTHREAD_ONCE_INIT; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; -static void init_mutex() { +static void init_mutex() +{ pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); - pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init(&mutex,&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&mutex, &attr); pthread_mutexattr_destroy(&attr); } #elif GRIB_OMP_THREADS @@ -34,8 +35,7 @@ static void init_mutex() { GRIB_OMP_CRITICAL(lock_iterator_c) { - if (once == 0) - { + if (once == 0) { omp_init_nest_lock(&mutex); once = 1; } @@ -44,69 +44,72 @@ static void init_mutex() #endif -int grib_get_data(const grib_handle* h,double* lats, double* lons,double* values) +int grib_get_data(const grib_handle* h, double* lats, double* lons, double* values) { - int err=0; - grib_iterator* iter=NULL; - double *lat,*lon,*val; + int err = 0; + grib_iterator* iter = NULL; + double *lat, *lon, *val; - iter=grib_iterator_new(h,0,&err); - if (!iter || err!=GRIB_SUCCESS) return err; + iter = grib_iterator_new(h, 0, &err); + if (!iter || err != GRIB_SUCCESS) + return err; - lat=lats; lon=lons; val=values; - while(grib_iterator_next(iter,lat++,lon++,val++)) {} + lat = lats; + lon = lons; + val = values; + while (grib_iterator_next(iter, lat++, lon++, val++)) {} - grib_iterator_delete( iter); + grib_iterator_delete(iter); return err; } -int grib_iterator_next(grib_iterator *i,double* lat,double* lon,double* value) +int grib_iterator_next(grib_iterator* i, double* lat, double* lon, double* value) { - grib_iterator_class *c = i->cclass; - while(c) - { - grib_iterator_class *s = c->super ? *(c->super) : NULL; - if(c->next) return c->next(i, lat, lon, value); + grib_iterator_class* c = i->cclass; + while (c) { + grib_iterator_class* s = c->super ? *(c->super) : NULL; + if (c->next) + return c->next(i, lat, lon, value); c = s; } Assert(0); return 0; } -int grib_iterator_has_next(grib_iterator *i) +int grib_iterator_has_next(grib_iterator* i) { - grib_iterator_class *c = i->cclass; - while(c) - { - grib_iterator_class *s = c->super ? *(c->super) : NULL; - if(c->has_next) return c->has_next(i); + grib_iterator_class* c = i->cclass; + while (c) { + grib_iterator_class* s = c->super ? *(c->super) : NULL; + if (c->has_next) + return c->has_next(i); c = s; } Assert(0); return 0; } -int grib_iterator_previous(grib_iterator *i,double* lat,double* lon,double* value) +int grib_iterator_previous(grib_iterator* i, double* lat, double* lon, double* value) { - grib_iterator_class *c = i->cclass; - while(c) - { - grib_iterator_class *s = c->super ? *(c->super) : NULL; - if(c->previous) return c->previous(i, lat, lon, value); + grib_iterator_class* c = i->cclass; + while (c) { + grib_iterator_class* s = c->super ? *(c->super) : NULL; + if (c->previous) + return c->previous(i, lat, lon, value); c = s; } Assert(0); return 0; } -int grib_iterator_reset(grib_iterator *i) +int grib_iterator_reset(grib_iterator* i) { - grib_iterator_class *c = i->cclass; - while(c) - { - grib_iterator_class *s = c->super ? *(c->super) : NULL; - if(c->reset) return c->reset(i); + grib_iterator_class* c = i->cclass; + while (c) { + grib_iterator_class* s = c->super ? *(c->super) : NULL; + if (c->reset) + return c->reset(i); c = s; } Assert(0); @@ -114,49 +117,53 @@ int grib_iterator_reset(grib_iterator *i) } /* For this one, ALL init are called */ -static int init_iterator(grib_iterator_class* c,grib_iterator* i, grib_handle *h, grib_arguments* args) +static int init_iterator(grib_iterator_class* c, grib_iterator* i, grib_handle* h, grib_arguments* args) { - if(c) { - int ret = GRIB_SUCCESS; - grib_iterator_class *s = c->super ? *(c->super) : NULL; - if(!c->inited) - { - if(c->init_class) c->init_class(c); + if (c) { + int ret = GRIB_SUCCESS; + grib_iterator_class* s = c->super ? *(c->super) : NULL; + if (!c->inited) { + if (c->init_class) + c->init_class(c); c->inited = 1; } - if(s) ret = init_iterator(s,i,h,args); + if (s) + ret = init_iterator(s, i, h, args); - if(ret != GRIB_SUCCESS) return ret; + if (ret != GRIB_SUCCESS) + return ret; - if(c->init) return c->init(i,h, args); + if (c->init) + return c->init(i, h, args); } return GRIB_INTERNAL_ERROR; } -int grib_iterator_init(grib_iterator* i, grib_handle *h, grib_arguments* args) +int grib_iterator_init(grib_iterator* i, grib_handle* h, grib_arguments* args) { int r = 0; - GRIB_MUTEX_INIT_ONCE(&once,&init_mutex); + GRIB_MUTEX_INIT_ONCE(&once, &init_mutex); GRIB_MUTEX_LOCK(&mutex); - r = init_iterator(i->cclass,i,h,args); + r = init_iterator(i->cclass, i, h, args); GRIB_MUTEX_UNLOCK(&mutex); return r; } /* For this one, ALL destroy are called */ -int grib_iterator_delete(grib_iterator *i) +int grib_iterator_delete(grib_iterator* i) { if (i) { - grib_iterator_class *c = i->cclass; - while(c) - { - grib_iterator_class *s = c->super ? *(c->super) : NULL; - if(c->destroy) c->destroy(i); + grib_iterator_class* c = i->cclass; + while (c) { + grib_iterator_class* s = c->super ? *(c->super) : NULL; + if (c->destroy) + c->destroy(i); c = s; } /* This should go in a top class */ - grib_context_free(i->h->context,i); - } else { + grib_context_free(i->h->context, i); + } + else { return GRIB_INVALID_ARGUMENT; } return 0; diff --git a/src/grib_iterator_class.c b/src/grib_iterator_class.c index a81c03cf3..8fcfc764b 100644 --- a/src/grib_iterator_class.c +++ b/src/grib_iterator_class.c @@ -16,44 +16,43 @@ #include "grib_api_internal.h" -#define NUMBER(x) (sizeof(x)/sizeof(x[0])) +#define NUMBER(x) (sizeof(x) / sizeof(x[0])) /* This file is generated by ./make_class.pl */ #include "grib_iterator_class.h" struct table_entry { - char *type; - grib_iterator_class **cclass; + char* type; + grib_iterator_class** cclass; }; -static const struct table_entry table[] = -{ - /* This file is generated by ./make_class.pl */ +static const struct table_entry table[] = { +/* This file is generated by ./make_class.pl */ #include "grib_iterator_factory.h" }; -grib_iterator* grib_iterator_factory( grib_handle* h, grib_arguments* args, unsigned long flags,int *ret) +grib_iterator* grib_iterator_factory(grib_handle* h, grib_arguments* args, unsigned long flags, int* ret) { - int i; - char* type = (char*)grib_arguments_get_name(h,args,0); - - for(i = 0; i < NUMBER(table) ; i++) - if(strcmp(type,table[i].type) == 0) - { - grib_iterator_class* c = *(table[i].cclass); - grib_iterator* it = (grib_iterator*) grib_context_malloc_clear(h->context,c->size); - it->cclass = c; - it->flags = flags; - *ret = GRIB_SUCCESS; - *ret = grib_iterator_init(it,h,args); - if(*ret == GRIB_SUCCESS) return it; - grib_context_log(h->context,GRIB_LOG_DEBUG,"grib_iterator_factory: error %d instantiating iterator %s", *ret, table[i].type); - grib_iterator_delete(it); - return NULL; - } - - grib_context_log(h->context,GRIB_LOG_ERROR,"grib_iterator_factory : Unknown type : %s for iterator", type); - - return NULL; + int i; + char* type = (char*)grib_arguments_get_name(h, args, 0); + + for (i = 0; i < NUMBER(table); i++) + if (strcmp(type, table[i].type) == 0) { + grib_iterator_class* c = *(table[i].cclass); + grib_iterator* it = (grib_iterator*)grib_context_malloc_clear(h->context, c->size); + it->cclass = c; + it->flags = flags; + *ret = GRIB_SUCCESS; + *ret = grib_iterator_init(it, h, args); + if (*ret == GRIB_SUCCESS) + return it; + grib_context_log(h->context, GRIB_LOG_DEBUG, "grib_iterator_factory: error %d instantiating iterator %s", *ret, table[i].type); + grib_iterator_delete(it); + return NULL; + } + + grib_context_log(h->context, GRIB_LOG_ERROR, "grib_iterator_factory : Unknown type : %s for iterator", type); + + return NULL; } diff --git a/src/grib_iterator_class_gaussian.c b/src/grib_iterator_class_gaussian.c index a6ed423ce..dd358dad9 100644 --- a/src/grib_iterator_class_gaussian.c +++ b/src/grib_iterator_class_gaussian.c @@ -37,45 +37,46 @@ or edit "iterator.class" and rerun ./make_class.pl */ -static void init_class (grib_iterator_class*); - -static int init (grib_iterator* i,grib_handle*,grib_arguments*); - - -typedef struct grib_iterator_gaussian{ - grib_iterator it; -/* Members defined in gen */ - long carg; - const char* missingValue; -/* Members defined in regular */ - double *las; - double *los; - long nap; - long nam; - long iScansNegatively; - long isRotated; - double angleOfRotation; - double southPoleLat; - double southPoleLon; - long jPointsAreConsecutive; - long disableUnrotate; -/* Members defined in gaussian */ +static void init_class(grib_iterator_class*); + +static int init(grib_iterator* i, grib_handle*, grib_arguments*); + + +typedef struct grib_iterator_gaussian +{ + grib_iterator it; + /* Members defined in gen */ + long carg; + const char* missingValue; + /* Members defined in regular */ + double* las; + double* los; + long nap; + long nam; + long iScansNegatively; + long isRotated; + double angleOfRotation; + double southPoleLat; + double southPoleLon; + long jPointsAreConsecutive; + long disableUnrotate; + /* Members defined in gaussian */ } grib_iterator_gaussian; extern grib_iterator_class* grib_iterator_class_regular; static grib_iterator_class _grib_iterator_class_gaussian = { - &grib_iterator_class_regular, /* super */ - "gaussian", /* name */ - sizeof(grib_iterator_gaussian),/* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* constructor */ - 0, /* destructor */ - 0, /* Next Value */ - 0, /* Previous Value */ - 0, /* Reset the counter */ - 0, /* has next values */ + &grib_iterator_class_regular, /* super */ + "gaussian", /* name */ + sizeof(grib_iterator_gaussian), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* constructor */ + 0, /* destructor */ + 0, /* Next Value */ + 0, /* Previous Value */ + 0, /* Reset the counter */ + 0, /* has next values */ }; grib_iterator_class* grib_iterator_class_gaussian = &_grib_iterator_class_gaussian; @@ -83,50 +84,54 @@ grib_iterator_class* grib_iterator_class_gaussian = &_grib_iterator_class_gaussi static void init_class(grib_iterator_class* c) { - c->next = (*(c->super))->next; - c->previous = (*(c->super))->previous; - c->reset = (*(c->super))->reset; - c->has_next = (*(c->super))->has_next; + c->next = (*(c->super))->next; + c->previous = (*(c->super))->previous; + c->reset = (*(c->super))->reset; + c->has_next = (*(c->super))->has_next; } /* END_CLASS_IMP */ -static void binary_search(double xx[], const unsigned long n, double x, unsigned long *j); +static void binary_search(double xx[], const unsigned long n, double x, unsigned long* j); -static int init(grib_iterator* i,grib_handle* h,grib_arguments *args){ +static int init(grib_iterator* i, grib_handle* h, grib_arguments* args) +{ grib_iterator_gaussian* self = (grib_iterator_gaussian*)i; - double *lats; + double* lats; double laf; /* latitude of first point in degrees */ double lal; /* latitude of last point in degrees */ long trunc; /* number of parallels between a pole and the equator */ long lai; - long jScansPositively=0; + long jScansPositively = 0; int size; double start; - unsigned long istart=0; - int ret = GRIB_SUCCESS; - - const char* latofirst = grib_arguments_get_name(h,args,self->carg++); - const char* latoflast = grib_arguments_get_name(h,args,self->carg++); - const char* numtrunc = grib_arguments_get_name(h,args,self->carg++); - const char* s_jScansPositively = grib_arguments_get_name(h,args,self->carg++); - - if((ret = grib_get_double_internal(h,latofirst, &laf))) return ret; - if((ret = grib_get_double_internal(h,latoflast, &lal))) return ret; - if((ret = grib_get_long_internal(h,numtrunc,&trunc))) return ret; - if((ret = grib_get_long_internal(h,s_jScansPositively,&jScansPositively))) + unsigned long istart = 0; + int ret = GRIB_SUCCESS; + + const char* latofirst = grib_arguments_get_name(h, args, self->carg++); + const char* latoflast = grib_arguments_get_name(h, args, self->carg++); + const char* numtrunc = grib_arguments_get_name(h, args, self->carg++); + const char* s_jScansPositively = grib_arguments_get_name(h, args, self->carg++); + + if ((ret = grib_get_double_internal(h, latofirst, &laf))) + return ret; + if ((ret = grib_get_double_internal(h, latoflast, &lal))) + return ret; + if ((ret = grib_get_long_internal(h, numtrunc, &trunc))) + return ret; + if ((ret = grib_get_long_internal(h, s_jScansPositively, &jScansPositively))) return ret; - start=laf; + start = laf; - size=trunc*2; + size = trunc * 2; - lats = (double*)grib_context_malloc(h->context,size*sizeof(double)); + lats = (double*)grib_context_malloc(h->context, size * sizeof(double)); ret = grib_get_gaussian_latitudes(trunc, lats); - if(ret != GRIB_SUCCESS) { - grib_context_log(h->context, GRIB_LOG_ERROR,"error %d calculating gaussian points",ret); + if (ret != GRIB_SUCCESS) { + grib_context_log(h->context, GRIB_LOG_ERROR, "error %d calculating gaussian points", ret); return ret; } /* @@ -137,43 +142,47 @@ static int init(grib_iterator* i,grib_handle* h,grib_arguments *args){ } */ - binary_search(lats,size-1,start,&istart); + binary_search(lats, size - 1, start, &istart); Assert(istart < size); if (jScansPositively) { - for(lai=0;lainam;lai++) { + for (lai = 0; lai < self->nam; lai++) { self->las[lai] = lats[istart--]; /*if (istart<0) istart=size-1; this condition is always FALSE -- 'istart' is unsigned long */ } - } else { - for(lai=0;lainam;lai++) { + } + else { + for (lai = 0; lai < self->nam; lai++) { self->las[lai] = lats[istart++]; - if (istart>size-1) istart=0; + if (istart > size - 1) + istart = 0; } } - grib_context_free(h->context,lats); + grib_context_free(h->context, lats); return ret; } -static void binary_search(double xx[], const unsigned long n, double x, unsigned long *j) +static void binary_search(double xx[], const unsigned long n, double x, unsigned long* j) { /*This routine works only on descending ordered arrays*/ #define EPSILON 1e-3 - unsigned long ju,jm,jl; - jl=0; - ju=n; - while (ju-jl > 1) { - jm=(ju+jl) >> 1; - if (fabs(x-xx[jm]) < EPSILON) { + unsigned long ju, jm, jl; + jl = 0; + ju = n; + while (ju - jl > 1) { + jm = (ju + jl) >> 1; + if (fabs(x - xx[jm]) < EPSILON) { /* found something close enough. We're done */ - *j=jm; + *j = jm; return; } - if (x < xx[jm]) jl=jm; - else ju=jm; + if (x < xx[jm]) + jl = jm; + else + ju = jm; } - *j=jl; + *j = jl; } diff --git a/src/grib_iterator_class_gaussian_reduced.c b/src/grib_iterator_class_gaussian_reduced.c index e76c1b522..7ec3d2326 100644 --- a/src/grib_iterator_class_gaussian_reduced.c +++ b/src/grib_iterator_class_gaussian_reduced.c @@ -42,38 +42,39 @@ or edit "iterator.class" and rerun ./make_class.pl */ -static void init_class (grib_iterator_class*); - -static int init (grib_iterator* i,grib_handle*,grib_arguments*); -static int next (grib_iterator* i, double *lat, double *lon, double *val); -static int destroy (grib_iterator* i); - - -typedef struct grib_iterator_gaussian_reduced{ - grib_iterator it; -/* Members defined in gen */ - long carg; - const char* missingValue; -/* Members defined in gaussian_reduced */ - double *las; - double *los; - long nam; +static void init_class(grib_iterator_class*); + +static int init(grib_iterator* i, grib_handle*, grib_arguments*); +static int next(grib_iterator* i, double* lat, double* lon, double* val); +static int destroy(grib_iterator* i); + + +typedef struct grib_iterator_gaussian_reduced +{ + grib_iterator it; + /* Members defined in gen */ + long carg; + const char* missingValue; + /* Members defined in gaussian_reduced */ + double* las; + double* los; + long nam; } grib_iterator_gaussian_reduced; extern grib_iterator_class* grib_iterator_class_gen; static grib_iterator_class _grib_iterator_class_gaussian_reduced = { - &grib_iterator_class_gen, /* super */ - "gaussian_reduced", /* name */ - sizeof(grib_iterator_gaussian_reduced),/* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* constructor */ - &destroy, /* destructor */ - &next, /* Next Value */ - 0, /* Previous Value */ - 0, /* Reset the counter */ - 0, /* has next values */ + &grib_iterator_class_gen, /* super */ + "gaussian_reduced", /* name */ + sizeof(grib_iterator_gaussian_reduced), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* constructor */ + &destroy, /* destructor */ + &next, /* Next Value */ + 0, /* Previous Value */ + 0, /* Reset the counter */ + 0, /* has next values */ }; grib_iterator_class* grib_iterator_class_gaussian_reduced = &_grib_iterator_class_gaussian_reduced; @@ -81,17 +82,17 @@ grib_iterator_class* grib_iterator_class_gaussian_reduced = &_grib_iterator_clas static void init_class(grib_iterator_class* c) { - c->previous = (*(c->super))->previous; - c->reset = (*(c->super))->reset; - c->has_next = (*(c->super))->has_next; + c->previous = (*(c->super))->previous; + c->reset = (*(c->super))->reset; + c->has_next = (*(c->super))->has_next; } /* END_CLASS_IMP */ -static int next(grib_iterator* i, double *lat, double *lon, double *val) +static int next(grib_iterator* i, double* lat, double* lon, double* val) { grib_iterator_gaussian_reduced* self = (grib_iterator_gaussian_reduced*)i; - if((long)i->e >= (long)(i->nv-1)) + if ((long)i->e >= (long)(i->nv - 1)) return 0; i->e++; @@ -114,83 +115,87 @@ static size_t count_subarea_points(grib_handle* h, get_reduced_row_proc get_redu long* pl, size_t plsize, double lon_first, double lon_last) { size_t j = 0, result = 0; - long row_count = 0; - long ilon_first=0,ilon_last=0;/*unused*/ + long row_count = 0; + long ilon_first = 0, ilon_last = 0; /*unused*/ long Nj = 0; grib_get_long_internal(h, "Nj", &Nj); - for (j=0;j 1) { - jm=(ju+jl) >> 1; - if (fabs(x-xx[jm]) < EPSILON) { + unsigned long ju, jm, jl; + jl = 0; + ju = n; + while (ju - jl > 1) { + jm = (ju + jl) >> 1; + if (fabs(x - xx[jm]) < EPSILON) { /* found something close enough. We're done */ - *j=jm; + *j = jm; return; } - if (x < xx[jm]) jl=jm; - else ju=jm; + if (x < xx[jm]) + jl = jm; + else + ju = jm; } - *j=jl; + *j = jl; } /* Use legacy way to compute the iterator latitude/longitude values */ static int iterate_reduced_gaussian_subarea_legacy(grib_iterator* iter, grib_handle* h, - double lat_first, double lon_first, - double lat_last, double lon_last, - double* lats, long* pl, size_t plsize) + double lat_first, double lon_first, + double lat_last, double lon_last, + double* lats, long* pl, size_t plsize) { - int err = 0; - int l = 0; - size_t j = 0; - long row_count=0; - double d=0; + int err = 0; + int l = 0; + size_t j = 0; + long row_count = 0; + double d = 0; long ilon_first, ilon_last, i; grib_iterator_gaussian_reduced* self = (grib_iterator_gaussian_reduced*)iter; get_reduced_row_proc get_reduced_row = &grib_get_reduced_row; - get_reduced_row = &grib_get_reduced_row_legacy; /* legacy algorithm */ + get_reduced_row = &grib_get_reduced_row_legacy; /* legacy algorithm */ if (h->context->debug) { const size_t np = count_subarea_points(h, get_reduced_row, pl, plsize, lon_first, lon_last); - fprintf(stderr,"ECCODES DEBUG grib_iterator_class_gaussian_reduced: Legacy sub-area num points=%ld\n", (long)np); + fprintf(stderr, "ECCODES DEBUG grib_iterator_class_gaussian_reduced: Legacy sub-area num points=%ld\n", (long)np); } /*find starting latitude */ d = fabs(lats[0] - lats[1]); - while (fabs(lat_first-lats[l]) > d ) {l++;} + while (fabs(lat_first - lats[l]) > d) { + l++; + } - iter->e=0; - for (j=0;je = 0; + for (j = 0; j < plsize; j++) { + long k = 0; + row_count = 0; + get_reduced_row(pl[j], lon_first, lon_last, &row_count, &ilon_first, &ilon_last); /*printf("iterate_reduced_gaussian_subarea %ld %g %g count=%ld, (i1=%ld, i2=%ld)\n",pl[j],lon_first,lon_last, row_count, ilon_first,ilon_last);*/ - if (ilon_first>ilon_last) ilon_first-=pl[j]; - for (i=ilon_first;i<=ilon_last;i++) { - - if(iter->e >= iter->nv){ + if (ilon_first > ilon_last) + ilon_first -= pl[j]; + for (i = ilon_first; i <= ilon_last; i++) { + if (iter->e >= iter->nv) { size_t np = count_subarea_points(h, get_reduced_row, pl, plsize, lon_first, lon_last); - grib_context_log(h->context,GRIB_LOG_ERROR, + grib_context_log(h->context, GRIB_LOG_ERROR, "Reduced Gaussian iterator (sub-area legacy). Num points=%ld, size(values)=%ld", np, iter->nv); return GRIB_WRONG_GRID; } - self->los[iter->e]=((i)*360.0)/pl[j]; - self->las[iter->e]=lats[j+l]; + self->los[iter->e] = ((i)*360.0) / pl[j]; + self->las[iter->e] = lats[j + l]; iter->e++; k++; if (k >= row_count) { @@ -204,14 +209,14 @@ static int iterate_reduced_gaussian_subarea_legacy(grib_iterator* iter, grib_han /* ECC-747 */ static int iterate_reduced_gaussian_subarea_algorithm2(grib_iterator* iter, grib_handle* h, - double lat_first, double lon_first, - double lat_last, double lon_last, - double* lats, long* pl, size_t plsize, size_t numlats) + double lat_first, double lon_first, + double lat_last, double lon_last, + double* lats, long* pl, size_t plsize, size_t numlats) { - int err = 0; - long l = 0; - size_t j = 0; - long row_count=0, i=0; + int err = 0; + long l = 0; + size_t j = 0; + long row_count = 0, i = 0; double olon_first, olon_last; grib_iterator_gaussian_reduced* self = (grib_iterator_gaussian_reduced*)iter; get_reduced_row_proc get_reduced_row = &grib_get_reduced_row; @@ -222,7 +227,7 @@ static int iterate_reduced_gaussian_subarea_algorithm2(grib_iterator* iter, grib } /* Find starting latitude */ - binary_search(lats, numlats-1, lat_first, &l); + binary_search(lats, numlats - 1, lat_first, &l); Assert(l < numlats); #if 0 @@ -235,23 +240,23 @@ static int iterate_reduced_gaussian_subarea_algorithm2(grib_iterator* iter, grib } #endif - iter->e=0; - for (j=0;je = 0; + for (j = 0; j < plsize; j++) { + const double delta = 360.0 / pl[j]; + row_count = 0; + grib_get_reduced_row_p(pl[j], lon_first, lon_last, &row_count, &olon_first, &olon_last); + for (i = 0; i < row_count; ++i) { double lon2 = olon_first + i * delta; - if(iter->e >= iter->nv){ + if (iter->e >= iter->nv) { /* Only print error message on the second pass */ size_t np = count_subarea_points(h, get_reduced_row, pl, plsize, lon_first, lon_last); - grib_context_log(h->context,GRIB_LOG_ERROR, + grib_context_log(h->context, GRIB_LOG_ERROR, "Reduced Gaussian iterator (sub-area). Num points=%ld, size(values)=%ld", np, iter->nv); return GRIB_WRONG_GRID; } - self->los[iter->e]=lon2; - DebugAssert(j+l < numlats); - self->las[iter->e]=lats[j+l]; + self->los[iter->e] = lon2; + DebugAssert(j + l < numlats); + self->las[iter->e] = lats[j + l]; iter->e++; } } @@ -262,7 +267,8 @@ static int iterate_reduced_gaussian_subarea_algorithm2(grib_iterator* iter, grib if (iter->nv == legacy_count) { /* Legacy (produced by PRODGEN/LIBEMOS) */ return iterate_reduced_gaussian_subarea_legacy(iter, h, lat_first, lon_first, lat_last, lon_last, lats, pl, plsize); - } else { + } + else { /* TODO: A gap exists! Not all values can be mapped. Inconsistent grid or error in calculating num. points! */ } } @@ -270,9 +276,9 @@ static int iterate_reduced_gaussian_subarea_algorithm2(grib_iterator* iter, grib } static int iterate_reduced_gaussian_subarea_wrapper(grib_iterator* iter, grib_handle* h, - double lat_first, double lon_first, - double lat_last, double lon_last, - double* lats, long* pl, size_t plsize, size_t numlats) + double lat_first, double lon_first, + double lat_last, double lon_last, + double* lats, long* pl, size_t plsize, size_t numlats) { return iterate_reduced_gaussian_subarea_algorithm2(iter, h, lat_first, lon_first, lat_last, lon_last, lats, pl, plsize, numlats); @@ -289,102 +295,111 @@ static int iterate_reduced_gaussian_subarea_wrapper(grib_iterator* iter, grib_ha static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) { - int ret=GRIB_SUCCESS, j, is_global=0; - double lat_first=0,lon_first=0,lat_last=0,lon_last=0; - double angular_precision = 1.0/1000000.0; + int ret = GRIB_SUCCESS, j, is_global = 0; + double lat_first = 0, lon_first = 0, lat_last = 0, lon_last = 0; + double angular_precision = 1.0 / 1000000.0; double* lats; - size_t plsize=0; - size_t numlats=0; + size_t plsize = 0; + size_t numlats = 0; long* pl; - long max_pl=0; - long nj=0,order=0,i; - long row_count=0; - long editionNumber = 0; - grib_context* c=h->context; + long max_pl = 0; + long nj = 0, order = 0, i; + long row_count = 0; + long editionNumber = 0; + grib_context* c = h->context; grib_iterator_gaussian_reduced* self = (grib_iterator_gaussian_reduced*)iter; - const char* slat_first = grib_arguments_get_name(h,args,self->carg++); - const char* slon_first = grib_arguments_get_name(h,args,self->carg++); - const char* slat_last = grib_arguments_get_name(h,args,self->carg++); - const char* slon_last = grib_arguments_get_name(h,args,self->carg++); - const char* sorder = grib_arguments_get_name(h,args,self->carg++); - const char* spl = grib_arguments_get_name(h,args,self->carg++); - const char* snj = grib_arguments_get_name(h,args,self->carg++); - - if((ret = grib_get_double_internal(h, slat_first,&lat_first)) != GRIB_SUCCESS) + const char* slat_first = grib_arguments_get_name(h, args, self->carg++); + const char* slon_first = grib_arguments_get_name(h, args, self->carg++); + const char* slat_last = grib_arguments_get_name(h, args, self->carg++); + const char* slon_last = grib_arguments_get_name(h, args, self->carg++); + const char* sorder = grib_arguments_get_name(h, args, self->carg++); + const char* spl = grib_arguments_get_name(h, args, self->carg++); + const char* snj = grib_arguments_get_name(h, args, self->carg++); + + if ((ret = grib_get_double_internal(h, slat_first, &lat_first)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_double_internal(h, slon_first,&lon_first)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(h, slon_first, &lon_first)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_double_internal(h, slat_last,&lat_last)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(h, slat_last, &lat_last)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_double_internal(h, slon_last,&lon_last)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(h, slon_last, &lon_last)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, sorder,&order)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, sorder, &order)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, snj,&nj)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, snj, &nj)) != GRIB_SUCCESS) return ret; - if (grib_get_long(h, "editionNumber", &editionNumber)==GRIB_SUCCESS) { - if (editionNumber == 1) angular_precision = 1.0/1000; + if (grib_get_long(h, "editionNumber", &editionNumber) == GRIB_SUCCESS) { + if (editionNumber == 1) + angular_precision = 1.0 / 1000; } - numlats = order*2; - lats=(double*)grib_context_malloc(h->context,sizeof(double)*numlats); - if (!lats) return GRIB_OUT_OF_MEMORY; - if((ret = grib_get_gaussian_latitudes(order, lats)) != GRIB_SUCCESS) + numlats = order * 2; + lats = (double*)grib_context_malloc(h->context, sizeof(double) * numlats); + if (!lats) + return GRIB_OUT_OF_MEMORY; + if ((ret = grib_get_gaussian_latitudes(order, lats)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_size(h,spl,&plsize)) != GRIB_SUCCESS) + if ((ret = grib_get_size(h, spl, &plsize)) != GRIB_SUCCESS) return ret; Assert(plsize); - pl=(long*)grib_context_malloc(c,sizeof(long)*plsize); - if (!pl) return GRIB_OUT_OF_MEMORY; + pl = (long*)grib_context_malloc(c, sizeof(long) * plsize); + if (!pl) + return GRIB_OUT_OF_MEMORY; - grib_get_long_array_internal(h,spl,pl, &plsize); + grib_get_long_array_internal(h, spl, pl, &plsize); - self->las = (double*)grib_context_malloc(h->context,iter->nv*sizeof(double)); - if (!self->las) return GRIB_OUT_OF_MEMORY; - self->los = (double*)grib_context_malloc(h->context,iter->nv*sizeof(double)); - if (!self->los) return GRIB_OUT_OF_MEMORY; + self->las = (double*)grib_context_malloc(h->context, iter->nv * sizeof(double)); + if (!self->las) + return GRIB_OUT_OF_MEMORY; + self->los = (double*)grib_context_malloc(h->context, iter->nv * sizeof(double)); + if (!self->los) + return GRIB_OUT_OF_MEMORY; - while (lon_last<0) lon_last+=360; - while (lon_first<0) lon_first+=360; + while (lon_last < 0) + lon_last += 360; + while (lon_first < 0) + lon_first += 360; /* Find the maximum element of "pl" array, do not assume it's 4*N! */ /* This could be an Octahedral Gaussian Grid */ max_pl = pl[0]; - for (j=1; j max_pl) max_pl = pl[j]; + for (j = 1; j < plsize; j++) { + if (pl[j] > max_pl) + max_pl = pl[j]; } is_global = is_gaussian_global(lat_first, lat_last, lon_first, lon_last, max_pl, lats, angular_precision); - if ( !is_global ) { + if (!is_global) { /*sub area*/ ret = iterate_reduced_gaussian_subarea_wrapper(iter, h, lat_first, lon_first, lat_last, lon_last, lats, pl, plsize, numlats); - } else { + } + else { /*global*/ - iter->e=0; + iter->e = 0; if (h->context->debug) { const size_t np = count_global_points(pl, plsize); fprintf(stderr, "ECCODES DEBUG grib_iterator_class_gaussian_reduced: global num points=%ld\n", (long)np); } - for (j=0;je >= iter->nv){ + for (j = 0; j < plsize; j++) { + row_count = pl[j]; + for (i = 0; i < row_count; i++) { + if (iter->e >= iter->nv) { /*grib_context_log(h->context,GRIB_LOG_ERROR, "Failed to initialise reduced Gaussian iterator (global)");*/ /*return GRIB_WRONG_GRID;*/ /*Try now as NON-global*/ ret = iterate_reduced_gaussian_subarea_wrapper(iter, h, lat_first, lon_first, lat_last, lon_last, lats, pl, plsize, numlats); - if (ret !=GRIB_SUCCESS) grib_context_log(h->context,GRIB_LOG_ERROR, "Failed to initialise reduced Gaussian iterator (global)"); + if (ret != GRIB_SUCCESS) + grib_context_log(h->context, GRIB_LOG_ERROR, "Failed to initialise reduced Gaussian iterator (global)"); goto finalise; } - self->los[iter->e]=(i*360.0)/row_count; - self->las[iter->e]=lats[j]; + self->los[iter->e] = (i * 360.0) / row_count; + self->las[iter->e] = lats[j]; iter->e++; } } @@ -392,8 +407,8 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) finalise: iter->e = -1; - grib_context_free(h->context,lats); - grib_context_free(h->context,pl); + grib_context_free(h->context, lats); + grib_context_free(h->context, pl); return ret; } @@ -401,9 +416,9 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) static int destroy(grib_iterator* i) { grib_iterator_gaussian_reduced* self = (grib_iterator_gaussian_reduced*)i; - const grib_context *c = i->h->context; + const grib_context* c = i->h->context; - grib_context_free(c,self->las); - grib_context_free(c,self->los); + grib_context_free(c, self->las); + grib_context_free(c, self->los); return 1; } diff --git a/src/grib_iterator_class_gen.c b/src/grib_iterator_class_gen.c index ea346be32..e002bacbf 100644 --- a/src/grib_iterator_class_gen.c +++ b/src/grib_iterator_class_gen.c @@ -36,32 +36,33 @@ or edit "iterator.class" and rerun ./make_class.pl */ -static void init_class (grib_iterator_class*); +static void init_class(grib_iterator_class*); -static int init (grib_iterator* i,grib_handle*,grib_arguments*); -static int destroy (grib_iterator* i); -static int reset (grib_iterator* i); -static long has_next (grib_iterator* i); +static int init(grib_iterator* i, grib_handle*, grib_arguments*); +static int destroy(grib_iterator* i); +static int reset(grib_iterator* i); +static long has_next(grib_iterator* i); -typedef struct grib_iterator_gen{ - grib_iterator it; -/* Members defined in gen */ - long carg; - const char* missingValue; +typedef struct grib_iterator_gen +{ + grib_iterator it; + /* Members defined in gen */ + long carg; + const char* missingValue; } grib_iterator_gen; static grib_iterator_class _grib_iterator_class_gen = { - 0, /* super */ - "gen", /* name */ - sizeof(grib_iterator_gen),/* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ + 0, /* super */ + "gen", /* name */ + sizeof(grib_iterator_gen), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ &init, /* constructor */ &destroy, /* destructor */ - 0, /* Next Value */ - 0, /* Previous Value */ + 0, /* Next Value */ + 0, /* Previous Value */ &reset, /* Reset the counter */ &has_next, /* has next values */ }; @@ -78,17 +79,18 @@ static void init_class(grib_iterator_class* c) * Return pointer to data at (i,j) (Fortran convention) */ static double* pointer_to_data(unsigned int i, unsigned int j, - long iScansNegatively, long jScansPositively, long jPointsAreConsecutive, long alternativeRowScanning, - unsigned int nx, unsigned int ny, double *data) + long iScansNegatively, long jScansPositively, long jPointsAreConsecutive, long alternativeRowScanning, + unsigned int nx, unsigned int ny, double* data) { /* Regular grid */ if (nx > 0 && ny > 0) { - if (i >= nx || j >= ny) return NULL; + if (i >= nx || j >= ny) + return NULL; j = (jScansPositively) ? j : ny - 1 - j; - i = ((alternativeRowScanning) && (j % 2 == 1)) ? nx - 1 - i : i; + i = ((alternativeRowScanning) && (j % 2 == 1)) ? nx - 1 - i : i; i = (iScansNegatively) ? nx - 1 - i : i; - return (jPointsAreConsecutive) ? data + j + i*ny : data + i + nx*j; + return (jPointsAreConsecutive) ? data + j + i * ny : data + i + nx * j; } /* Reduced or other data not on a grid */ @@ -98,54 +100,54 @@ static double* pointer_to_data(unsigned int i, unsigned int j, /* Apply the scanning mode flags which may require data array to be transformed */ /* to standard west-to-east south-to-north mode */ int transform_iterator_data(grib_handle* h, double* data, - long iScansNegatively, long jScansPositively, long jPointsAreConsecutive, long alternativeRowScanning, - size_t numPoints, long nx, long ny) + long iScansNegatively, long jScansPositively, long jPointsAreConsecutive, long alternativeRowScanning, + size_t numPoints, long nx, long ny) { double* data2; double *pData0, *pData1, *pData2; unsigned long ix, iy; - if ( !iScansNegatively && jScansPositively && !jPointsAreConsecutive && !alternativeRowScanning ) - { + if (!iScansNegatively && jScansPositively && !jPointsAreConsecutive && !alternativeRowScanning) { /* Already +i and +j. No need to change */ return GRIB_SUCCESS; } - if ( !iScansNegatively && !jScansPositively && !jPointsAreConsecutive && !alternativeRowScanning && - nx > 0 && ny > 0) - { + if (!iScansNegatively && !jScansPositively && !jPointsAreConsecutive && !alternativeRowScanning && + nx > 0 && ny > 0) { /* regular grid +i -j: convert from we:ns to we:sn */ - size_t row_size = ((size_t) nx) * sizeof(double); - data2 = (double*)grib_context_malloc(h->context, row_size); + size_t row_size = ((size_t)nx) * sizeof(double); + data2 = (double*)grib_context_malloc(h->context, row_size); if (!data2) { - grib_context_log(h->context,GRIB_LOG_ERROR, "Unable to allocate %ld bytes", row_size); + grib_context_log(h->context, GRIB_LOG_ERROR, "Unable to allocate %ld bytes", row_size); return GRIB_OUT_OF_MEMORY; } - for (iy = 0; iy < ny/2; iy++) { - memcpy(data2, data + ((size_t) iy) * nx, row_size); - memcpy(data + iy*nx, data + (ny-1-iy) * ((size_t) nx), row_size); - memcpy(data + (ny-1-iy) * ((size_t) nx), data2, row_size); + for (iy = 0; iy < ny / 2; iy++) { + memcpy(data2, data + ((size_t)iy) * nx, row_size); + memcpy(data + iy * nx, data + (ny - 1 - iy) * ((size_t)nx), row_size); + memcpy(data + (ny - 1 - iy) * ((size_t)nx), data2, row_size); } grib_context_free(h->context, data2); return GRIB_SUCCESS; } if (nx < 1 || ny < 1) { - grib_context_log(h->context,GRIB_LOG_ERROR, "Invalid values for Nx and/or Ny"); + grib_context_log(h->context, GRIB_LOG_ERROR, "Invalid values for Nx and/or Ny"); return GRIB_GEOCALCULUS_PROBLEM; } - data2 = (double*)grib_context_malloc(h->context, numPoints*sizeof(double)); + data2 = (double*)grib_context_malloc(h->context, numPoints * sizeof(double)); if (!data2) { - grib_context_log(h->context,GRIB_LOG_ERROR, "Unable to allocate %ld bytes",numPoints*sizeof(double)); + grib_context_log(h->context, GRIB_LOG_ERROR, "Unable to allocate %ld bytes", numPoints * sizeof(double)); return GRIB_OUT_OF_MEMORY; } pData0 = data2; for (iy = 0; iy < ny; iy++) { long deltaX = 0; - pData1 = pointer_to_data(0, iy, iScansNegatively, jScansPositively, jPointsAreConsecutive, alternativeRowScanning, nx,ny, data); - if (!pData1) return GRIB_GEOCALCULUS_PROBLEM; - pData2 = pointer_to_data(1, iy, iScansNegatively, jScansPositively, jPointsAreConsecutive, alternativeRowScanning, nx,ny, data); - if (!pData2) return GRIB_GEOCALCULUS_PROBLEM; + pData1 = pointer_to_data(0, iy, iScansNegatively, jScansPositively, jPointsAreConsecutive, alternativeRowScanning, nx, ny, data); + if (!pData1) + return GRIB_GEOCALCULUS_PROBLEM; + pData2 = pointer_to_data(1, iy, iScansNegatively, jScansPositively, jPointsAreConsecutive, alternativeRowScanning, nx, ny, data); + if (!pData2) + return GRIB_GEOCALCULUS_PROBLEM; deltaX = pData2 - pData1; for (ix = 0; ix < nx; ix++) { *pData0++ = *pData1; @@ -158,41 +160,41 @@ int transform_iterator_data(grib_handle* h, double* data, return GRIB_SUCCESS; } -static int init(grib_iterator* iter, grib_handle *h, grib_arguments* args) +static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) { - grib_iterator_gen* self = (grib_iterator_gen*) iter; - size_t dli=0; - int err = GRIB_SUCCESS; - const char* s_rawData = NULL; - const char* s_numPoints=NULL; - long numberOfPoints=0; - self->carg = 1; - - s_numPoints = grib_arguments_get_name(h,args,self->carg++); - self->missingValue = grib_arguments_get_name(h,args,self->carg++); - s_rawData = grib_arguments_get_name(h,args,self->carg++); + grib_iterator_gen* self = (grib_iterator_gen*)iter; + size_t dli = 0; + int err = GRIB_SUCCESS; + const char* s_rawData = NULL; + const char* s_numPoints = NULL; + long numberOfPoints = 0; + self->carg = 1; + + s_numPoints = grib_arguments_get_name(h, args, self->carg++); + self->missingValue = grib_arguments_get_name(h, args, self->carg++); + s_rawData = grib_arguments_get_name(h, args, self->carg++); iter->h = h; /* We may not need to keep them */ iter->args = args; - if( (err = grib_get_size(h,s_rawData,&dli))!= GRIB_SUCCESS) return err; + if ((err = grib_get_size(h, s_rawData, &dli)) != GRIB_SUCCESS) + return err; - if( (err = grib_get_long_internal(h,s_numPoints,&numberOfPoints)) - != GRIB_SUCCESS) + if ((err = grib_get_long_internal(h, s_numPoints, &numberOfPoints)) != GRIB_SUCCESS) return err; - if (numberOfPoints!=dli) { - grib_context_log(h->context,GRIB_LOG_ERROR,"%s != size(%s) (%ld!=%ld)", - s_numPoints,s_rawData,numberOfPoints,dli); + if (numberOfPoints != dli) { + grib_context_log(h->context, GRIB_LOG_ERROR, "%s != size(%s) (%ld!=%ld)", + s_numPoints, s_rawData, numberOfPoints, dli); return GRIB_WRONG_GRID; } iter->nv = dli; - if (iter->nv==0) { - grib_context_log(h->context,GRIB_LOG_ERROR,"size(%s) is %ld", s_rawData, dli); + if (iter->nv == 0) { + grib_context_log(h->context, GRIB_LOG_ERROR, "size(%s) is %ld", s_rawData, dli); return GRIB_WRONG_GRID; } - iter->data = (double*)grib_context_malloc(h->context,(iter->nv)*sizeof(double)); + iter->data = (double*)grib_context_malloc(h->context, (iter->nv) * sizeof(double)); - if( (err = grib_get_double_array_internal(h,s_rawData,iter->data ,&(iter->nv)))) + if ((err = grib_get_double_array_internal(h, s_rawData, iter->data, &(iter->nv)))) return err; iter->e = -1; @@ -208,13 +210,14 @@ static int reset(grib_iterator* iter) static int destroy(grib_iterator* iter) { - const grib_context *c = iter->h->context; + const grib_context* c = iter->h->context; grib_context_free(c, iter->data); return 1; } static long has_next(grib_iterator* iter) { - if(iter->data == NULL) return 0; - return iter->nv - iter->e; + if (iter->data == NULL) + return 0; + return iter->nv - iter->e; } diff --git a/src/grib_iterator_class_lambert_azimuthal_equal_area.c b/src/grib_iterator_class_lambert_azimuthal_equal_area.c index 26af32179..7566b7c2a 100644 --- a/src/grib_iterator_class_lambert_azimuthal_equal_area.c +++ b/src/grib_iterator_class_lambert_azimuthal_equal_area.c @@ -41,38 +41,39 @@ or edit "iterator.class" and rerun ./make_class.pl */ -static void init_class (grib_iterator_class*); - -static int init (grib_iterator* i,grib_handle*,grib_arguments*); -static int next (grib_iterator* i, double *lat, double *lon, double *val); -static int destroy (grib_iterator* i); - - -typedef struct grib_iterator_lambert_azimuthal_equal_area{ - grib_iterator it; -/* Members defined in gen */ - long carg; - const char* missingValue; -/* Members defined in lambert_azimuthal_equal_area */ - double *lats; - double *lons; - long nam; +static void init_class(grib_iterator_class*); + +static int init(grib_iterator* i, grib_handle*, grib_arguments*); +static int next(grib_iterator* i, double* lat, double* lon, double* val); +static int destroy(grib_iterator* i); + + +typedef struct grib_iterator_lambert_azimuthal_equal_area +{ + grib_iterator it; + /* Members defined in gen */ + long carg; + const char* missingValue; + /* Members defined in lambert_azimuthal_equal_area */ + double* lats; + double* lons; + long nam; } grib_iterator_lambert_azimuthal_equal_area; extern grib_iterator_class* grib_iterator_class_gen; static grib_iterator_class _grib_iterator_class_lambert_azimuthal_equal_area = { - &grib_iterator_class_gen, /* super */ - "lambert_azimuthal_equal_area", /* name */ - sizeof(grib_iterator_lambert_azimuthal_equal_area),/* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* constructor */ - &destroy, /* destructor */ - &next, /* Next Value */ - 0, /* Previous Value */ - 0, /* Reset the counter */ - 0, /* has next values */ + &grib_iterator_class_gen, /* super */ + "lambert_azimuthal_equal_area", /* name */ + sizeof(grib_iterator_lambert_azimuthal_equal_area), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* constructor */ + &destroy, /* destructor */ + &next, /* Next Value */ + 0, /* Previous Value */ + 0, /* Reset the counter */ + 0, /* has next values */ }; grib_iterator_class* grib_iterator_class_lambert_azimuthal_equal_area = &_grib_iterator_class_lambert_azimuthal_equal_area; @@ -80,18 +81,17 @@ grib_iterator_class* grib_iterator_class_lambert_azimuthal_equal_area = &_grib_i static void init_class(grib_iterator_class* c) { - c->previous = (*(c->super))->previous; - c->reset = (*(c->super))->reset; - c->has_next = (*(c->super))->has_next; + c->previous = (*(c->super))->previous; + c->reset = (*(c->super))->reset; + c->has_next = (*(c->super))->has_next; } /* END_CLASS_IMP */ -static int next(grib_iterator* i, double *lat, double *lon, double *val) +static int next(grib_iterator* i, double* lat, double* lon, double* val) { - grib_iterator_lambert_azimuthal_equal_area* self = (grib_iterator_lambert_azimuthal_equal_area*)i; - if((long)i->e >= (long)(i->nv-1)) + if ((long)i->e >= (long)(i->nv - 1)) return 0; i->e++; @@ -102,175 +102,169 @@ static int next(grib_iterator* i, double *lat, double *lon, double *val) return 1; } -static int init(grib_iterator* iter,grib_handle* h,grib_arguments* args) +static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) { - int ret=0; - double *lats,*lons; - double lonFirstInDegrees,latFirstInDegrees,lonFirst,latFirst,radius=0; - long nx,ny,standardParallel,centralLongitude; - double phi1,lambda0,xFirst,yFirst,x,y,Dx,Dy; - double kp,sinphi1,cosphi1; - long alternativeRowScanning,iScansNegatively; - long jScansPositively,jPointsAreConsecutive; - double sinphi,cosphi,cosdlambda,sindlambda; - double cosc,sinc; - long i,j; + int ret = 0; + double *lats, *lons; + double lonFirstInDegrees, latFirstInDegrees, lonFirst, latFirst, radius = 0; + long nx, ny, standardParallel, centralLongitude; + double phi1, lambda0, xFirst, yFirst, x, y, Dx, Dy; + double kp, sinphi1, cosphi1; + long alternativeRowScanning, iScansNegatively; + long jScansPositively, jPointsAreConsecutive; + double sinphi, cosphi, cosdlambda, sindlambda; + double cosc, sinc; + long i, j; grib_iterator_lambert_azimuthal_equal_area* self = - (grib_iterator_lambert_azimuthal_equal_area*)iter; - - const char* sradius = grib_arguments_get_name(h,args,self->carg++); - const char* snx = grib_arguments_get_name(h,args,self->carg++); - const char* sny = grib_arguments_get_name(h,args,self->carg++); - const char* slatFirstInDegrees = grib_arguments_get_name(h,args,self->carg++); - const char* slonFirstInDegrees = grib_arguments_get_name(h,args,self->carg++); - const char* sstandardParallel = grib_arguments_get_name(h,args,self->carg++); - const char* scentralLongitude = grib_arguments_get_name(h,args,self->carg++); - const char* sDx = grib_arguments_get_name(h,args,self->carg++); - const char* sDy = grib_arguments_get_name(h,args,self->carg++); - const char* siScansNegatively = grib_arguments_get_name(h,args,self->carg++); - const char* sjScansPositively = grib_arguments_get_name(h,args,self->carg++); - const char* sjPointsAreConsecutive = grib_arguments_get_name(h,args,self->carg++); - const char* salternativeRowScanning = grib_arguments_get_name(h,args,self->carg++); - double c,rho; - double epsilon=1.0e-20; - double d2r=acos(0.0)/90.0; - - if((ret = grib_get_double_internal(h, sradius,&radius)) != GRIB_SUCCESS) { + (grib_iterator_lambert_azimuthal_equal_area*)iter; + + const char* sradius = grib_arguments_get_name(h, args, self->carg++); + const char* snx = grib_arguments_get_name(h, args, self->carg++); + const char* sny = grib_arguments_get_name(h, args, self->carg++); + const char* slatFirstInDegrees = grib_arguments_get_name(h, args, self->carg++); + const char* slonFirstInDegrees = grib_arguments_get_name(h, args, self->carg++); + const char* sstandardParallel = grib_arguments_get_name(h, args, self->carg++); + const char* scentralLongitude = grib_arguments_get_name(h, args, self->carg++); + const char* sDx = grib_arguments_get_name(h, args, self->carg++); + const char* sDy = grib_arguments_get_name(h, args, self->carg++); + const char* siScansNegatively = grib_arguments_get_name(h, args, self->carg++); + const char* sjScansPositively = grib_arguments_get_name(h, args, self->carg++); + const char* sjPointsAreConsecutive = grib_arguments_get_name(h, args, self->carg++); + const char* salternativeRowScanning = grib_arguments_get_name(h, args, self->carg++); + double c, rho; + double epsilon = 1.0e-20; + double d2r = acos(0.0) / 90.0; + + if ((ret = grib_get_double_internal(h, sradius, &radius)) != GRIB_SUCCESS) { /* Check if it's an oblate spheroid */ if (grib_is_earth_oblate(h)) - grib_context_log(h->context,GRIB_LOG_ERROR,"Lambert Azimuthal Equal Area only supported for spherical earth."); + grib_context_log(h->context, GRIB_LOG_ERROR, "Lambert Azimuthal Equal Area only supported for spherical earth."); return ret; } - if((ret = grib_get_long_internal(h, snx,&nx)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, snx, &nx)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, sny,&ny)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, sny, &ny)) != GRIB_SUCCESS) return ret; - if (iter->nv!=nx*ny) { - grib_context_log(h->context,GRIB_LOG_ERROR, - "Wrong number of points (%ld!=%ldx%ld)", - iter->nv,nx,ny); + if (iter->nv != nx * ny) { + grib_context_log(h->context, GRIB_LOG_ERROR, + "Wrong number of points (%ld!=%ldx%ld)", + iter->nv, nx, ny); return GRIB_WRONG_GRID; } - if((ret = grib_get_double_internal(h, slatFirstInDegrees,&latFirstInDegrees)) - != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(h, slatFirstInDegrees, &latFirstInDegrees)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_double_internal(h, slonFirstInDegrees,&lonFirstInDegrees)) - != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(h, slonFirstInDegrees, &lonFirstInDegrees)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, sstandardParallel,&standardParallel)) - != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, sstandardParallel, &standardParallel)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, scentralLongitude,¢ralLongitude)) - != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, scentralLongitude, ¢ralLongitude)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_double_internal(h, sDx,&Dx)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(h, sDx, &Dx)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_double_internal(h, sDy,&Dy)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(h, sDy, &Dy)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, - sjPointsAreConsecutive,&jPointsAreConsecutive)) - != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, + sjPointsAreConsecutive, &jPointsAreConsecutive)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, sjScansPositively,&jScansPositively)) - != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, sjScansPositively, &jScansPositively)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, siScansNegatively,&iScansNegatively)) - != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, siScansNegatively, &iScansNegatively)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, - salternativeRowScanning,&alternativeRowScanning)) - != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, + salternativeRowScanning, &alternativeRowScanning)) != GRIB_SUCCESS) return ret; - lambda0=d2r*centralLongitude/1000000; - phi1=d2r*standardParallel/1000000; - latFirst=latFirstInDegrees*d2r; - lonFirst=lonFirstInDegrees*d2r; + lambda0 = d2r * centralLongitude / 1000000; + phi1 = d2r * standardParallel / 1000000; + latFirst = latFirstInDegrees * d2r; + lonFirst = lonFirstInDegrees * d2r; - cosphi1=cos(phi1); - sinphi1=sin(phi1); + cosphi1 = cos(phi1); + sinphi1 = sin(phi1); - Dx = iScansNegatively == 0 ? Dx/1000 : -Dx/1000; - Dy = jScansPositively == 1 ? Dy/1000 : -Dy/1000; - self->lats = (double*)grib_context_malloc(h->context,iter->nv*sizeof(double)); + Dx = iScansNegatively == 0 ? Dx / 1000 : -Dx / 1000; + Dy = jScansPositively == 1 ? Dy / 1000 : -Dy / 1000; + self->lats = (double*)grib_context_malloc(h->context, iter->nv * sizeof(double)); if (!self->lats) { - grib_context_log(h->context,GRIB_LOG_ERROR, - "unable to allocate %ld bytes",iter->nv*sizeof(double)); + grib_context_log(h->context, GRIB_LOG_ERROR, + "unable to allocate %ld bytes", iter->nv * sizeof(double)); return GRIB_OUT_OF_MEMORY; } - self->lons = (double*)grib_context_malloc(h->context,iter->nv*sizeof(double)); + self->lons = (double*)grib_context_malloc(h->context, iter->nv * sizeof(double)); if (!self->lats) { - grib_context_log(h->context,GRIB_LOG_ERROR, - "unable to allocate %ld bytes",iter->nv*sizeof(double)); + grib_context_log(h->context, GRIB_LOG_ERROR, + "unable to allocate %ld bytes", iter->nv * sizeof(double)); return GRIB_OUT_OF_MEMORY; } - lats=self->lats; - lons=self->lons; + lats = self->lats; + lons = self->lons; /* compute xFirst,yFirst in metres */ - sinphi=sin(latFirst); - cosphi=cos(latFirst); - cosdlambda=cos(lonFirst-lambda0); - sindlambda=sin(lonFirst-lambda0); - kp=radius*sqrt(2.0/(1+sinphi1*sinphi+cosphi1*cosphi*cosdlambda)); - xFirst=kp*cosphi*sindlambda; - yFirst=kp*(cosphi1*sinphi-sinphi1*cosphi*cosdlambda); + sinphi = sin(latFirst); + cosphi = cos(latFirst); + cosdlambda = cos(lonFirst - lambda0); + sindlambda = sin(lonFirst - lambda0); + kp = radius * sqrt(2.0 / (1 + sinphi1 * sinphi + cosphi1 * cosphi * cosdlambda)); + xFirst = kp * cosphi * sindlambda; + yFirst = kp * (cosphi1 * sinphi - sinphi1 * cosphi * cosdlambda); if (jPointsAreConsecutive) { - - x=xFirst; - for (i=0;iepsilon) { - c=2*asin(rho/(2.0*radius)); - cosc=cos(c); - sinc=sin(c); - *lats=asin(cosc*sinphi1+y*sinc*cosphi1/rho)/d2r; - *lons=(lambda0+atan2(x*sinc,rho*cosphi1*cosc-y*sinphi1*sinc))/d2r; - } else { - *lats=phi1/d2r; - *lons=lambda0/d2r; + x = xFirst; + for (i = 0; i < nx; i++) { + double xsq = x * x; + y = yFirst; + for (j = 0; j < ny; j++) { + rho = sqrt(xsq + y * y); + if (rho > epsilon) { + c = 2 * asin(rho / (2.0 * radius)); + cosc = cos(c); + sinc = sin(c); + *lats = asin(cosc * sinphi1 + y * sinc * cosphi1 / rho) / d2r; + *lons = (lambda0 + atan2(x * sinc, rho * cosphi1 * cosc - y * sinphi1 * sinc)) / d2r; + } + else { + *lats = phi1 / d2r; + *lons = lambda0 / d2r; } - if (*lons<0) *lons+=360; + if (*lons < 0) + *lons += 360; lons++; lats++; - y+=Dy; + y += Dy; } - x+=Dx; + x += Dx; } - - } else { - - y=yFirst; - for (j=0;jepsilon) { - c=2*asin(rho/(2.0*radius)); - cosc=cos(c); - sinc=sin(c); - *lats=asin(cosc*sinphi1+y*sinc*cosphi1/rho)/d2r; - *lons=(lambda0+atan2(x*sinc,rho*cosphi1*cosc-y*sinphi1*sinc))/d2r; - } else { - *lats=phi1/d2r; - *lons=lambda0/d2r; + } + else { + y = yFirst; + for (j = 0; j < ny; j++) { + double ysq = y * y; + x = xFirst; + for (i = 0; i < nx; i++) { + rho = sqrt(x * x + ysq); + if (rho > epsilon) { + c = 2 * asin(rho / (2.0 * radius)); + cosc = cos(c); + sinc = sin(c); + *lats = asin(cosc * sinphi1 + y * sinc * cosphi1 / rho) / d2r; + *lons = (lambda0 + atan2(x * sinc, rho * cosphi1 * cosc - y * sinphi1 * sinc)) / d2r; + } + else { + *lats = phi1 / d2r; + *lons = lambda0 / d2r; } - if (*lons<0) *lons+=360; + if (*lons < 0) + *lons += 360; lons++; lats++; - x+=Dx; + x += Dx; } - y+=Dy; + y += Dy; } } @@ -282,9 +276,9 @@ static int init(grib_iterator* iter,grib_handle* h,grib_arguments* args) static int destroy(grib_iterator* i) { grib_iterator_lambert_azimuthal_equal_area* self = (grib_iterator_lambert_azimuthal_equal_area*)i; - const grib_context *c = i->h->context; + const grib_context* c = i->h->context; - grib_context_free(c,self->lats); - grib_context_free(c,self->lons); + grib_context_free(c, self->lats); + grib_context_free(c, self->lons); return 1; } diff --git a/src/grib_iterator_class_lambert_conformal.c b/src/grib_iterator_class_lambert_conformal.c index c3e5e245c..6bae1d000 100644 --- a/src/grib_iterator_class_lambert_conformal.c +++ b/src/grib_iterator_class_lambert_conformal.c @@ -36,38 +36,39 @@ or edit "iterator.class" and rerun ./make_class.pl */ -static void init_class (grib_iterator_class*); - -static int init (grib_iterator* i,grib_handle*,grib_arguments*); -static int next (grib_iterator* i, double *lat, double *lon, double *val); -static int destroy (grib_iterator* i); - - -typedef struct grib_iterator_lambert_conformal{ - grib_iterator it; -/* Members defined in gen */ - long carg; - const char* missingValue; -/* Members defined in lambert_conformal */ - double *lats; - double *lons; - long nam; +static void init_class(grib_iterator_class*); + +static int init(grib_iterator* i, grib_handle*, grib_arguments*); +static int next(grib_iterator* i, double* lat, double* lon, double* val); +static int destroy(grib_iterator* i); + + +typedef struct grib_iterator_lambert_conformal +{ + grib_iterator it; + /* Members defined in gen */ + long carg; + const char* missingValue; + /* Members defined in lambert_conformal */ + double* lats; + double* lons; + long nam; } grib_iterator_lambert_conformal; extern grib_iterator_class* grib_iterator_class_gen; static grib_iterator_class _grib_iterator_class_lambert_conformal = { - &grib_iterator_class_gen, /* super */ - "lambert_conformal", /* name */ - sizeof(grib_iterator_lambert_conformal),/* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* constructor */ - &destroy, /* destructor */ - &next, /* Next Value */ - 0, /* Previous Value */ - 0, /* Reset the counter */ - 0, /* has next values */ + &grib_iterator_class_gen, /* super */ + "lambert_conformal", /* name */ + sizeof(grib_iterator_lambert_conformal), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* constructor */ + &destroy, /* destructor */ + &next, /* Next Value */ + 0, /* Previous Value */ + 0, /* Reset the counter */ + 0, /* has next values */ }; grib_iterator_class* grib_iterator_class_lambert_conformal = &_grib_iterator_class_lambert_conformal; @@ -75,17 +76,17 @@ grib_iterator_class* grib_iterator_class_lambert_conformal = &_grib_iterator_cla static void init_class(grib_iterator_class* c) { - c->previous = (*(c->super))->previous; - c->reset = (*(c->super))->reset; - c->has_next = (*(c->super))->has_next; + c->previous = (*(c->super))->previous; + c->reset = (*(c->super))->reset; + c->has_next = (*(c->super))->has_next; } /* END_CLASS_IMP */ -static int next(grib_iterator* i, double *lat, double *lon, double *val) +static int next(grib_iterator* i, double* lat, double* lon, double* val) { grib_iterator_lambert_conformal* self = (grib_iterator_lambert_conformal*)i; - if((long)i->e >= (long)(i->nv-1)) + if ((long)i->e >= (long)(i->nv - 1)) return 0; i->e++; @@ -97,89 +98,89 @@ static int next(grib_iterator* i, double *lat, double *lon, double *val) } #ifndef M_PI -#define M_PI 3.14159265358979323846 /* Whole pie */ +#define M_PI 3.14159265358979323846 /* Whole pie */ #endif #ifndef M_PI_2 -#define M_PI_2 1.57079632679489661923 /* Half a pie */ +#define M_PI_2 1.57079632679489661923 /* Half a pie */ #endif #ifndef M_PI_4 -#define M_PI_4 0.78539816339744830962 /* Quarter of a pie */ +#define M_PI_4 0.78539816339744830962 /* Quarter of a pie */ #endif -#define RAD2DEG 57.29577951308232087684 /* 180 over pi */ -#define DEG2RAD 0.01745329251994329576 /* pi over 180 */ +#define RAD2DEG 57.29577951308232087684 /* 180 over pi */ +#define DEG2RAD 0.01745329251994329576 /* pi over 180 */ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) { - int i, j, err=0; + int i, j, err = 0; double *lats, *lons; /* the lat/lon arrays to be populated */ - long nx,ny,iScansNegatively,jScansPositively,jPointsAreConsecutive,alternativeRowScanning; - double LoVInDegrees,LaDInDegrees,Latin1InDegrees,Latin2InDegrees,latFirstInDegrees, - lonFirstInDegrees, Dx, Dy, radius=0; + long nx, ny, iScansNegatively, jScansPositively, jPointsAreConsecutive, alternativeRowScanning; + double LoVInDegrees, LaDInDegrees, Latin1InDegrees, Latin2InDegrees, latFirstInDegrees, + lonFirstInDegrees, Dx, Dy, radius = 0; double latFirstInRadians, lonFirstInRadians, LoVInRadians, Latin1InRadians, Latin2InRadians, - LaDInRadians, lonDiff, lonDeg, latDeg; + LaDInRadians, lonDiff, lonDeg, latDeg; double f, n, rho, rho0, angle, x0, y0, x, y, tmp, tmp2; grib_iterator_lambert_conformal* self = (grib_iterator_lambert_conformal*)iter; - const char* sradius = grib_arguments_get_name(h,args,self->carg++); - const char* snx = grib_arguments_get_name(h,args,self->carg++); - const char* sny = grib_arguments_get_name(h,args,self->carg++); - const char* sLoVInDegrees = grib_arguments_get_name(h,args,self->carg++); - const char* sLaDInDegrees = grib_arguments_get_name(h,args,self->carg++); - const char* sLatin1InDegrees = grib_arguments_get_name(h,args,self->carg++); - const char* sLatin2InDegrees = grib_arguments_get_name(h,args,self->carg++); - const char* slatFirstInDegrees = grib_arguments_get_name(h,args,self->carg++); - const char* slonFirstInDegrees = grib_arguments_get_name(h,args,self->carg++); + const char* sradius = grib_arguments_get_name(h, args, self->carg++); + const char* snx = grib_arguments_get_name(h, args, self->carg++); + const char* sny = grib_arguments_get_name(h, args, self->carg++); + const char* sLoVInDegrees = grib_arguments_get_name(h, args, self->carg++); + const char* sLaDInDegrees = grib_arguments_get_name(h, args, self->carg++); + const char* sLatin1InDegrees = grib_arguments_get_name(h, args, self->carg++); + const char* sLatin2InDegrees = grib_arguments_get_name(h, args, self->carg++); + const char* slatFirstInDegrees = grib_arguments_get_name(h, args, self->carg++); + const char* slonFirstInDegrees = grib_arguments_get_name(h, args, self->carg++); /* Dx and Dy are in Metres */ - const char* sDx = grib_arguments_get_name(h,args,self->carg++); - const char* sDy = grib_arguments_get_name(h,args,self->carg++); - const char* siScansNegatively = grib_arguments_get_name(h,args,self->carg++); - const char* sjScansPositively = grib_arguments_get_name(h,args,self->carg++); - const char* sjPointsAreConsecutive = grib_arguments_get_name(h,args,self->carg++); - const char* salternativeRowScanning = grib_arguments_get_name(h,args,self->carg++); - - if((err = grib_get_long_internal(h, snx,&nx)) != GRIB_SUCCESS) + const char* sDx = grib_arguments_get_name(h, args, self->carg++); + const char* sDy = grib_arguments_get_name(h, args, self->carg++); + const char* siScansNegatively = grib_arguments_get_name(h, args, self->carg++); + const char* sjScansPositively = grib_arguments_get_name(h, args, self->carg++); + const char* sjPointsAreConsecutive = grib_arguments_get_name(h, args, self->carg++); + const char* salternativeRowScanning = grib_arguments_get_name(h, args, self->carg++); + + if ((err = grib_get_long_internal(h, snx, &nx)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(h, sny,&ny)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(h, sny, &ny)) != GRIB_SUCCESS) return err; if (grib_is_earth_oblate(h)) { - grib_context_log(h->context,GRIB_LOG_ERROR,"Lambert Conformal only supported for spherical earth."); + grib_context_log(h->context, GRIB_LOG_ERROR, "Lambert Conformal only supported for spherical earth."); return GRIB_GEOCALCULUS_PROBLEM; } - if (iter->nv!=nx*ny) { - grib_context_log(h->context,GRIB_LOG_ERROR,"Wrong number of points (%ld!=%ldx%ld)",iter->nv,nx,ny); + if (iter->nv != nx * ny) { + grib_context_log(h->context, GRIB_LOG_ERROR, "Wrong number of points (%ld!=%ldx%ld)", iter->nv, nx, ny); return GRIB_WRONG_GRID; } - if((err = grib_get_double_internal(h, sradius,&radius)) != GRIB_SUCCESS) + if ((err = grib_get_double_internal(h, sradius, &radius)) != GRIB_SUCCESS) return err; - if((err = grib_get_double_internal(h, sLoVInDegrees, &LoVInDegrees))!=GRIB_SUCCESS) + if ((err = grib_get_double_internal(h, sLoVInDegrees, &LoVInDegrees)) != GRIB_SUCCESS) return err; - if((err = grib_get_double_internal(h, sLaDInDegrees, &LaDInDegrees))!=GRIB_SUCCESS) + if ((err = grib_get_double_internal(h, sLaDInDegrees, &LaDInDegrees)) != GRIB_SUCCESS) return err; - if((err = grib_get_double_internal(h, sLatin1InDegrees, &Latin1InDegrees))!=GRIB_SUCCESS) + if ((err = grib_get_double_internal(h, sLatin1InDegrees, &Latin1InDegrees)) != GRIB_SUCCESS) return err; - if((err = grib_get_double_internal(h, sLatin2InDegrees, &Latin2InDegrees))!=GRIB_SUCCESS) + if ((err = grib_get_double_internal(h, sLatin2InDegrees, &Latin2InDegrees)) != GRIB_SUCCESS) return err; - if((err = grib_get_double_internal(h, slatFirstInDegrees,&latFirstInDegrees)) !=GRIB_SUCCESS) + if ((err = grib_get_double_internal(h, slatFirstInDegrees, &latFirstInDegrees)) != GRIB_SUCCESS) return err; - if((err = grib_get_double_internal(h, slonFirstInDegrees,&lonFirstInDegrees)) !=GRIB_SUCCESS) + if ((err = grib_get_double_internal(h, slonFirstInDegrees, &lonFirstInDegrees)) != GRIB_SUCCESS) return err; - if((err = grib_get_double_internal(h, sDx,&Dx)) !=GRIB_SUCCESS) + if ((err = grib_get_double_internal(h, sDx, &Dx)) != GRIB_SUCCESS) return err; - if((err = grib_get_double_internal(h, sDy,&Dy)) !=GRIB_SUCCESS) + if ((err = grib_get_double_internal(h, sDy, &Dy)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(h, sjPointsAreConsecutive,&jPointsAreConsecutive)) !=GRIB_SUCCESS) + if ((err = grib_get_long_internal(h, sjPointsAreConsecutive, &jPointsAreConsecutive)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(h, sjScansPositively,&jScansPositively)) !=GRIB_SUCCESS) + if ((err = grib_get_long_internal(h, sjScansPositively, &jScansPositively)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(h, siScansNegatively,&iScansNegatively)) !=GRIB_SUCCESS) + if ((err = grib_get_long_internal(h, siScansNegatively, &iScansNegatively)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(h, salternativeRowScanning,&alternativeRowScanning)) !=GRIB_SUCCESS) + if ((err = grib_get_long_internal(h, salternativeRowScanning, &alternativeRowScanning)) != GRIB_SUCCESS) return err; /* @@ -192,67 +193,72 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) LaDInRadians = LaDInDegrees * DEG2RAD; LoVInRadians = LoVInDegrees * DEG2RAD; - if ( fabs(Latin1InRadians - Latin2InRadians) < 1E-09 ) { + if (fabs(Latin1InRadians - Latin2InRadians) < 1E-09) { n = sin(Latin1InRadians); } else { - n = log(cos(Latin1InRadians)/cos(Latin2InRadians)) / - log(tan(M_PI_4 + Latin2InRadians/2.0) / tan(M_PI_4 + Latin1InRadians/2.0)); + n = log(cos(Latin1InRadians) / cos(Latin2InRadians)) / + log(tan(M_PI_4 + Latin2InRadians / 2.0) / tan(M_PI_4 + Latin1InRadians / 2.0)); } - f = (cos(Latin1InRadians) * pow(tan(M_PI_4 + Latin1InRadians/2.0), n)) / n; - rho = radius * f * pow(tan(M_PI_4 + latFirstInRadians/2.0), -n); - rho0 = radius * f * pow(tan(M_PI_4 + LaDInRadians/2.0), -n); - if ( n < 0 ) /* adjustment for southern hemisphere */ + f = (cos(Latin1InRadians) * pow(tan(M_PI_4 + Latin1InRadians / 2.0), n)) / n; + rho = radius * f * pow(tan(M_PI_4 + latFirstInRadians / 2.0), -n); + rho0 = radius * f * pow(tan(M_PI_4 + LaDInRadians / 2.0), -n); + if (n < 0) /* adjustment for southern hemisphere */ rho0 = -rho0; lonDiff = lonFirstInRadians - LoVInRadians; /* Adjust longitude to range -180 to 180 */ - if (lonDiff > M_PI) lonDiff -= 2*M_PI; - if (lonDiff < -M_PI) lonDiff += 2*M_PI; + if (lonDiff > M_PI) + lonDiff -= 2 * M_PI; + if (lonDiff < -M_PI) + lonDiff += 2 * M_PI; angle = n * lonDiff; - x0 = rho * sin(angle); - y0 = rho0 - rho * cos(angle); + x0 = rho * sin(angle); + y0 = rho0 - rho * cos(angle); /*Dx = iScansNegatively == 0 ? Dx : -Dx;*/ /* GRIB-405: Don't change sign of Dy. Latitudes ALWAYS increase from latitudeOfFirstGridPoint */ /*Dy = jScansPositively == 1 ? Dy : -Dy;*/ /* Allocate latitude and longitude arrays */ - self->lats = (double*)grib_context_malloc(h->context,iter->nv*sizeof(double)); + self->lats = (double*)grib_context_malloc(h->context, iter->nv * sizeof(double)); if (!self->lats) { - grib_context_log(h->context,GRIB_LOG_ERROR, "Unable to allocate %ld bytes",iter->nv*sizeof(double)); + grib_context_log(h->context, GRIB_LOG_ERROR, "Unable to allocate %ld bytes", iter->nv * sizeof(double)); return GRIB_OUT_OF_MEMORY; } - self->lons = (double*)grib_context_malloc(h->context,iter->nv*sizeof(double)); + self->lons = (double*)grib_context_malloc(h->context, iter->nv * sizeof(double)); if (!self->lats) { - grib_context_log(h->context,GRIB_LOG_ERROR, "Unable to allocate %ld bytes",iter->nv*sizeof(double)); + grib_context_log(h->context, GRIB_LOG_ERROR, "Unable to allocate %ld bytes", iter->nv * sizeof(double)); return GRIB_OUT_OF_MEMORY; } - lats=self->lats; - lons=self->lons; + lats = self->lats; + lons = self->lons; /* Populate our arrays */ for (j = 0; j < ny; j++) { - y = y0 + j*Dy; - if ( n < 0 ) { /* adjustment for southern hemisphere */ + y = y0 + j * Dy; + if (n < 0) { /* adjustment for southern hemisphere */ y = -y; } - tmp = rho0 - y; - tmp2 = tmp*tmp; + tmp = rho0 - y; + tmp2 = tmp * tmp; for (i = 0; i < nx; i++) { - int index =i+j*nx; - x = x0 + i*Dx; - if ( n < 0 ) { /* adjustment for southern hemisphere */ + int index = i + j * nx; + x = x0 + i * Dx; + if (n < 0) { /* adjustment for southern hemisphere */ x = -x; } angle = atan2(x, tmp); /* See ECC-524 */ - rho = sqrt(x*x + tmp2); - if (n <= 0) rho = -rho; - lonDeg = LoVInDegrees + (angle/n) * RAD2DEG; - latDeg = (2.0 * atan(pow(radius * f/rho, 1.0/n)) - M_PI_2) * RAD2DEG; - while ( lonDeg >= 360.0) lonDeg -= 360.0; - while ( lonDeg < 0.0) lonDeg += 360.0; + rho = sqrt(x * x + tmp2); + if (n <= 0) + rho = -rho; + lonDeg = LoVInDegrees + (angle / n) * RAD2DEG; + latDeg = (2.0 * atan(pow(radius * f / rho, 1.0 / n)) - M_PI_2) * RAD2DEG; + while (lonDeg >= 360.0) + lonDeg -= 360.0; + while (lonDeg < 0.0) + lonDeg += 360.0; lons[index] = lonDeg; lats[index] = latDeg; /*printf("DBK: llat[%d] = %g \t llon[%d] = %g\n", index,lats[index], index,lons[index]);*/ @@ -263,9 +269,10 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) /* Apply the scanning mode flags which may require data array to be transformed */ err = transform_iterator_data(h, iter->data, - iScansNegatively, jScansPositively, jPointsAreConsecutive, alternativeRowScanning, - iter->nv, nx, ny); - if (err) return err; + iScansNegatively, jScansPositively, jPointsAreConsecutive, alternativeRowScanning, + iter->nv, nx, ny); + if (err) + return err; return err; } @@ -273,9 +280,9 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) static int destroy(grib_iterator* i) { grib_iterator_lambert_conformal* self = (grib_iterator_lambert_conformal*)i; - const grib_context *c = i->h->context; + const grib_context* c = i->h->context; - grib_context_free(c,self->lats); - grib_context_free(c,self->lons); + grib_context_free(c, self->lats); + grib_context_free(c, self->lons); return 1; } diff --git a/src/grib_iterator_class_latlon.c b/src/grib_iterator_class_latlon.c index db0591099..571b908d3 100644 --- a/src/grib_iterator_class_latlon.c +++ b/src/grib_iterator_class_latlon.c @@ -32,46 +32,47 @@ or edit "iterator.class" and rerun ./make_class.pl */ -static void init_class (grib_iterator_class*); - -static int init (grib_iterator* i,grib_handle*,grib_arguments*); -static int next (grib_iterator* i, double *lat, double *lon, double *val); - - -typedef struct grib_iterator_latlon{ - grib_iterator it; -/* Members defined in gen */ - long carg; - const char* missingValue; -/* Members defined in regular */ - double *las; - double *los; - long nap; - long nam; - long iScansNegatively; - long isRotated; - double angleOfRotation; - double southPoleLat; - double southPoleLon; - long jPointsAreConsecutive; - long disableUnrotate; -/* Members defined in latlon */ +static void init_class(grib_iterator_class*); + +static int init(grib_iterator* i, grib_handle*, grib_arguments*); +static int next(grib_iterator* i, double* lat, double* lon, double* val); + + +typedef struct grib_iterator_latlon +{ + grib_iterator it; + /* Members defined in gen */ + long carg; + const char* missingValue; + /* Members defined in regular */ + double* las; + double* los; + long nap; + long nam; + long iScansNegatively; + long isRotated; + double angleOfRotation; + double southPoleLat; + double southPoleLon; + long jPointsAreConsecutive; + long disableUnrotate; + /* Members defined in latlon */ } grib_iterator_latlon; extern grib_iterator_class* grib_iterator_class_regular; static grib_iterator_class _grib_iterator_class_latlon = { - &grib_iterator_class_regular, /* super */ - "latlon", /* name */ - sizeof(grib_iterator_latlon),/* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* constructor */ - 0, /* destructor */ - &next, /* Next Value */ - 0, /* Previous Value */ - 0, /* Reset the counter */ - 0, /* has next values */ + &grib_iterator_class_regular, /* super */ + "latlon", /* name */ + sizeof(grib_iterator_latlon), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* constructor */ + 0, /* destructor */ + &next, /* Next Value */ + 0, /* Previous Value */ + 0, /* Reset the counter */ + 0, /* has next values */ }; grib_iterator_class* grib_iterator_class_latlon = &_grib_iterator_class_latlon; @@ -79,19 +80,20 @@ grib_iterator_class* grib_iterator_class_latlon = &_grib_iterator_class_latlon; static void init_class(grib_iterator_class* c) { - c->previous = (*(c->super))->previous; - c->reset = (*(c->super))->reset; - c->has_next = (*(c->super))->has_next; + c->previous = (*(c->super))->previous; + c->reset = (*(c->super))->reset; + c->has_next = (*(c->super))->has_next; } /* END_CLASS_IMP */ -static int next(grib_iterator* iter, double *lat, double *lon, double *val) +static int next(grib_iterator* iter, double* lat, double* lon, double* val) { /* GRIB-238: Support rotated lat/lon grids */ double ret_lat, ret_lon, ret_val; grib_iterator_latlon* self = (grib_iterator_latlon*)iter; - if((long)iter->e >= (long)(iter->nv-1)) return 0; + if ((long)iter->e >= (long)(iter->nv - 1)) + return 0; iter->e++; @@ -100,23 +102,23 @@ static int next(grib_iterator* iter, double *lat, double *lon, double *val) */ if (!self->jPointsAreConsecutive) { /* Adjacent points in i (x) direction are consecutive */ - ret_lat = self->las[(long)floor(iter->e/self->nap)]; - ret_lon = self->los[(long)iter->e%self->nap]; + ret_lat = self->las[(long)floor(iter->e / self->nap)]; + ret_lon = self->los[(long)iter->e % self->nap]; ret_val = iter->data[iter->e]; - } else { + } + else { /* Adjacent points in j (y) direction is consecutive */ - ret_lon = self->los[(long)iter->e/self->nam]; - ret_lat = self->las[(long)floor(iter->e%self->nam)]; + ret_lon = self->los[(long)iter->e / self->nam]; + ret_lat = self->las[(long)floor(iter->e % self->nam)]; ret_val = iter->data[iter->e]; } /* See ECC-808: Some users want to disable the unrotate */ - if (self->isRotated && !self->disableUnrotate) - { + if (self->isRotated && !self->disableUnrotate) { double new_lat = 0, new_lon = 0; unrotate(ret_lat, ret_lon, - self->angleOfRotation, self->southPoleLat, self->southPoleLon, - &new_lat, &new_lon); + self->angleOfRotation, self->southPoleLat, self->southPoleLon, + &new_lat, &new_lon); ret_lat = new_lat; ret_lon = new_lon; } @@ -127,59 +129,70 @@ static int next(grib_iterator* iter, double *lat, double *lon, double *val) return 1; } -static int init(grib_iterator* iter, grib_handle* h,grib_arguments* args) +static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) { grib_iterator_latlon* self = (grib_iterator_latlon*)iter; - int err = 0; + int err = 0; double jdir; double lat1; long jScansPositively; long lai; - const char* s_lat1 = grib_arguments_get_name(h,args,self->carg++); - const char* s_jdir = grib_arguments_get_name(h,args,self->carg++); - const char* s_jScansPos = grib_arguments_get_name(h,args,self->carg++); - const char* s_jPtsConsec = grib_arguments_get_name(h,args,self->carg++); - self->angleOfRotation = 0; - self->isRotated = 0; - self->southPoleLat = 0; - self->southPoleLon = 0; - self->disableUnrotate = 0; /* unrotate enabled by default */ - - if ((err = grib_get_long(h, "is_rotated_grid", &self->isRotated))) return err; + const char* s_lat1 = grib_arguments_get_name(h, args, self->carg++); + const char* s_jdir = grib_arguments_get_name(h, args, self->carg++); + const char* s_jScansPos = grib_arguments_get_name(h, args, self->carg++); + const char* s_jPtsConsec = grib_arguments_get_name(h, args, self->carg++); + self->angleOfRotation = 0; + self->isRotated = 0; + self->southPoleLat = 0; + self->southPoleLon = 0; + self->disableUnrotate = 0; /* unrotate enabled by default */ + + if ((err = grib_get_long(h, "is_rotated_grid", &self->isRotated))) + return err; if (self->isRotated) { - if ((err = grib_get_double_internal(h,"angleOfRotation", &self->angleOfRotation))) return err; - if ((err = grib_get_double_internal(h,"latitudeOfSouthernPoleInDegrees", &self->southPoleLat))) return err; - if ((err = grib_get_double_internal(h,"longitudeOfSouthernPoleInDegrees", &self->southPoleLon))) return err; + if ((err = grib_get_double_internal(h, "angleOfRotation", &self->angleOfRotation))) + return err; + if ((err = grib_get_double_internal(h, "latitudeOfSouthernPoleInDegrees", &self->southPoleLat))) + return err; + if ((err = grib_get_double_internal(h, "longitudeOfSouthernPoleInDegrees", &self->southPoleLon))) + return err; } - if((err = grib_get_double_internal(h, s_lat1, &lat1))) return err; - if((err = grib_get_double_internal(h, s_jdir, &jdir))) return err; - if((err = grib_get_long_internal(h, s_jScansPos, &jScansPositively))) return err; - if((err = grib_get_long_internal(h, s_jPtsConsec, &self->jPointsAreConsecutive))) return err; - if((err = grib_get_long(h, "iteratorDisableUnrotate", &self->disableUnrotate))) return err; + if ((err = grib_get_double_internal(h, s_lat1, &lat1))) + return err; + if ((err = grib_get_double_internal(h, s_jdir, &jdir))) + return err; + if ((err = grib_get_long_internal(h, s_jScansPos, &jScansPositively))) + return err; + if ((err = grib_get_long_internal(h, s_jPtsConsec, &self->jPointsAreConsecutive))) + return err; + if ((err = grib_get_long(h, "iteratorDisableUnrotate", &self->disableUnrotate))) + return err; /* ECC-984: If jDirectionIncrement is missing, then we cannot use it (See jDirectionIncrementGiven) */ /* So try to compute the increment */ if (grib_is_missing(h, s_jdir, &err) && err == GRIB_SUCCESS) { double lat2; - if ((err = grib_get_double_internal(h, "latitudeLastInDegrees", &lat2)) == GRIB_SUCCESS) { + if ((err = grib_get_double_internal(h, "latitudeLastInDegrees", &lat2)) == GRIB_SUCCESS) { const long Nj = self->nam; - Assert(Nj>1); + Assert(Nj > 1); if (lat1 > lat2) { - jdir=(lat1-lat2)/(Nj-1); - } else { - jdir=(lat1+360.0-lat2)/(Nj-1); + jdir = (lat1 - lat2) / (Nj - 1); + } + else { + jdir = (lat1 + 360.0 - lat2) / (Nj - 1); } grib_context_log(h->context, GRIB_LOG_INFO, - "%s is missing (See jDirectionIncrementGiven). Using value of %.6f obtained from La1, La2 and Nj",s_jdir,jdir); + "%s is missing (See jDirectionIncrementGiven). Using value of %.6f obtained from La1, La2 and Nj", s_jdir, jdir); } } - if (jScansPositively) jdir=-jdir; + if (jScansPositively) + jdir = -jdir; - for( lai = 0; lai < self->nam; lai++ ) { + for (lai = 0; lai < self->nam; lai++) { self->las[lai] = lat1; - lat1 -= jdir ; + lat1 -= jdir; } iter->e = -1; diff --git a/src/grib_iterator_class_latlon_reduced.c b/src/grib_iterator_class_latlon_reduced.c index 911e539ef..b7eba9cc5 100644 --- a/src/grib_iterator_class_latlon_reduced.c +++ b/src/grib_iterator_class_latlon_reduced.c @@ -41,37 +41,38 @@ or edit "iterator.class" and rerun ./make_class.pl */ -static void init_class (grib_iterator_class*); +static void init_class(grib_iterator_class*); -static int init (grib_iterator* i,grib_handle*,grib_arguments*); -static int next (grib_iterator* i, double *lat, double *lon, double *val); -static int destroy (grib_iterator* i); +static int init(grib_iterator* i, grib_handle*, grib_arguments*); +static int next(grib_iterator* i, double* lat, double* lon, double* val); +static int destroy(grib_iterator* i); -typedef struct grib_iterator_latlon_reduced{ - grib_iterator it; -/* Members defined in gen */ - long carg; - const char* missingValue; -/* Members defined in latlon_reduced */ - double *las; - double *los; +typedef struct grib_iterator_latlon_reduced +{ + grib_iterator it; + /* Members defined in gen */ + long carg; + const char* missingValue; + /* Members defined in latlon_reduced */ + double* las; + double* los; } grib_iterator_latlon_reduced; extern grib_iterator_class* grib_iterator_class_gen; static grib_iterator_class _grib_iterator_class_latlon_reduced = { - &grib_iterator_class_gen, /* super */ - "latlon_reduced", /* name */ - sizeof(grib_iterator_latlon_reduced),/* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* constructor */ - &destroy, /* destructor */ - &next, /* Next Value */ - 0, /* Previous Value */ - 0, /* Reset the counter */ - 0, /* has next values */ + &grib_iterator_class_gen, /* super */ + "latlon_reduced", /* name */ + sizeof(grib_iterator_latlon_reduced), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* constructor */ + &destroy, /* destructor */ + &next, /* Next Value */ + 0, /* Previous Value */ + 0, /* Reset the counter */ + 0, /* has next values */ }; grib_iterator_class* grib_iterator_class_latlon_reduced = &_grib_iterator_class_latlon_reduced; @@ -79,115 +80,131 @@ grib_iterator_class* grib_iterator_class_latlon_reduced = &_grib_iterator_class_ static void init_class(grib_iterator_class* c) { - c->previous = (*(c->super))->previous; - c->reset = (*(c->super))->reset; - c->has_next = (*(c->super))->has_next; + c->previous = (*(c->super))->previous; + c->reset = (*(c->super))->reset; + c->has_next = (*(c->super))->has_next; } /* END_CLASS_IMP */ -static int next(grib_iterator* i, double *lat, double *lon, double *val) +static int next(grib_iterator* i, double* lat, double* lon, double* val) { - grib_iterator_latlon_reduced* self = (grib_iterator_latlon_reduced*)i; + grib_iterator_latlon_reduced* self = (grib_iterator_latlon_reduced*)i; - if((long)i->e >= (long)(i->nv-1)) - return 0; - i->e++; + if ((long)i->e >= (long)(i->nv - 1)) + return 0; + i->e++; - *lat = self->las[i->e]; - *lon = self->los[i->e]; - *val = i->data[i->e]; + *lat = self->las[i->e]; + *lon = self->los[i->e]; + *val = i->data[i->e]; - return 1; + return 1; } -static int init(grib_iterator* i,grib_handle* h,grib_arguments* args) +static int init(grib_iterator* i, grib_handle* h, grib_arguments* args) { - grib_iterator_latlon_reduced* self = (grib_iterator_latlon_reduced*)i; - - int ret = GRIB_SUCCESS; - double laf; - double lal; - long nlats; - double lof,tlof; - double lol,dimin; - long *pl; - size_t plsize =0 ; - long k,j,ii; - long nlons,plmax; - double jdirinc = 0; - double idirinc = 0; - double dlon=0; - int islocal=0; - long nlons2 =0; /* adjusted num of longitudes */ - - const char* latofirst = grib_arguments_get_name(h,args,self->carg++); - const char* longoffirst = grib_arguments_get_name(h,args,self->carg++); - const char* latoflast = grib_arguments_get_name(h,args,self->carg++); - const char* longoflast = grib_arguments_get_name(h,args,self->carg++); - const char* nlats_name = grib_arguments_get_name(h,args,self->carg++); - const char* jdirec = grib_arguments_get_name(h,args,self->carg++); - const char* plac = grib_arguments_get_name(h,args,self->carg++); - - if(( ret = grib_get_double_internal(h,latofirst, &laf))) return ret; - if(( ret = grib_get_double_internal(h,longoffirst, &lof))) return ret; - - if(( ret = grib_get_double_internal(h,latoflast, &lal))) return ret; - if(( ret = grib_get_double_internal(h,longoflast, &lol))) return ret; - - if(( ret = grib_get_long_internal(h,nlats_name,&nlats))) return ret; - - if(( ret = grib_get_double_internal(h,jdirec,&jdirinc))) return ret; - - plsize = nlats; - pl = (long*)grib_context_malloc(h->context,plsize*sizeof(long)); - grib_get_long_array_internal(h,plac,pl, &plsize); - - self->las = (double*)grib_context_malloc(h->context,i->nv*sizeof(double)); - self->los = (double*)grib_context_malloc(h->context,i->nv*sizeof(double)); - - plmax=pl[0]; - for (j=0;jlal) jdirinc=-jdirinc; - k=0; - for (j=0;jlas[k]=laf; - self->los[k]=tlof; - tlof+=idirinc; - k++; - } - laf+=jdirinc; - } - - i->e = -1; - grib_context_free(h->context,pl); - - return ret; + grib_iterator_latlon_reduced* self = (grib_iterator_latlon_reduced*)i; + + int ret = GRIB_SUCCESS; + double laf; + double lal; + long nlats; + double lof, tlof; + double lol, dimin; + long* pl; + size_t plsize = 0; + long k, j, ii; + long nlons, plmax; + double jdirinc = 0; + double idirinc = 0; + double dlon = 0; + int islocal = 0; + long nlons2 = 0; /* adjusted num of longitudes */ + + const char* latofirst = grib_arguments_get_name(h, args, self->carg++); + const char* longoffirst = grib_arguments_get_name(h, args, self->carg++); + const char* latoflast = grib_arguments_get_name(h, args, self->carg++); + const char* longoflast = grib_arguments_get_name(h, args, self->carg++); + const char* nlats_name = grib_arguments_get_name(h, args, self->carg++); + const char* jdirec = grib_arguments_get_name(h, args, self->carg++); + const char* plac = grib_arguments_get_name(h, args, self->carg++); + + if ((ret = grib_get_double_internal(h, latofirst, &laf))) + return ret; + if ((ret = grib_get_double_internal(h, longoffirst, &lof))) + return ret; + + if ((ret = grib_get_double_internal(h, latoflast, &lal))) + return ret; + if ((ret = grib_get_double_internal(h, longoflast, &lol))) + return ret; + + if ((ret = grib_get_long_internal(h, nlats_name, &nlats))) + return ret; + + if ((ret = grib_get_double_internal(h, jdirec, &jdirinc))) + return ret; + + plsize = nlats; + pl = (long*)grib_context_malloc(h->context, plsize * sizeof(long)); + grib_get_long_array_internal(h, plac, pl, &plsize); + + self->las = (double*)grib_context_malloc(h->context, i->nv * sizeof(double)); + self->los = (double*)grib_context_malloc(h->context, i->nv * sizeof(double)); + + plmax = pl[0]; + for (j = 0; j < nlats; j++) + if (plmax < pl[j]) + plmax = pl[j]; + dimin = 360.0 / plmax; + + if (360 - fabs(lol - lof) < 2 * dimin) { + dlon = 360; + islocal = 0; + } + else if (lol < lof) { + /* handle something like 150 to -120 to treat as 150 to 240 */ + /* so that dlon is 90 (not -270) */ + dlon = lol + 360.0 - lof; + islocal = 1; + } + else { + dlon = lol - lof; + islocal = 1; + } + + if (laf > lal) + jdirinc = -jdirinc; + k = 0; + for (j = 0; j < nlats; j++) { + nlons = pl[j]; + tlof = lof; + nlons2 = nlons - islocal; + /*Sometimes there are no points on a latitude! Protect against div by zero*/ + if (nlons2 < 1) + nlons2 = 1; + idirinc = dlon / nlons2; + for (ii = 0; ii < nlons; ii++) { + self->las[k] = laf; + self->los[k] = tlof; + tlof += idirinc; + k++; + } + laf += jdirinc; + } + + i->e = -1; + grib_context_free(h->context, pl); + + return ret; } static int destroy(grib_iterator* i) { - grib_iterator_latlon_reduced* self = (grib_iterator_latlon_reduced*)i; - const grib_context *c = i->h->context; + grib_iterator_latlon_reduced* self = (grib_iterator_latlon_reduced*)i; + const grib_context* c = i->h->context; - grib_context_free(c,self->las); - grib_context_free(c,self->los); - return 1; + grib_context_free(c, self->las); + grib_context_free(c, self->los); + return 1; } diff --git a/src/grib_iterator_class_polar_stereographic.c b/src/grib_iterator_class_polar_stereographic.c index de2af4f7b..7f2b8876d 100644 --- a/src/grib_iterator_class_polar_stereographic.c +++ b/src/grib_iterator_class_polar_stereographic.c @@ -36,38 +36,39 @@ or edit "iterator.class" and rerun ./make_class.pl */ -static void init_class (grib_iterator_class*); - -static int init (grib_iterator* i,grib_handle*,grib_arguments*); -static int next (grib_iterator* i, double *lat, double *lon, double *val); -static int destroy (grib_iterator* i); - - -typedef struct grib_iterator_polar_stereographic{ - grib_iterator it; -/* Members defined in gen */ - long carg; - const char* missingValue; -/* Members defined in polar_stereographic */ - double *lats; - double *lons; - long nam; +static void init_class(grib_iterator_class*); + +static int init(grib_iterator* i, grib_handle*, grib_arguments*); +static int next(grib_iterator* i, double* lat, double* lon, double* val); +static int destroy(grib_iterator* i); + + +typedef struct grib_iterator_polar_stereographic +{ + grib_iterator it; + /* Members defined in gen */ + long carg; + const char* missingValue; + /* Members defined in polar_stereographic */ + double* lats; + double* lons; + long nam; } grib_iterator_polar_stereographic; extern grib_iterator_class* grib_iterator_class_gen; static grib_iterator_class _grib_iterator_class_polar_stereographic = { - &grib_iterator_class_gen, /* super */ - "polar_stereographic", /* name */ - sizeof(grib_iterator_polar_stereographic),/* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* constructor */ - &destroy, /* destructor */ - &next, /* Next Value */ - 0, /* Previous Value */ - 0, /* Reset the counter */ - 0, /* has next values */ + &grib_iterator_class_gen, /* super */ + "polar_stereographic", /* name */ + sizeof(grib_iterator_polar_stereographic), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* constructor */ + &destroy, /* destructor */ + &next, /* Next Value */ + 0, /* Previous Value */ + 0, /* Reset the counter */ + 0, /* has next values */ }; grib_iterator_class* grib_iterator_class_polar_stereographic = &_grib_iterator_class_polar_stereographic; @@ -75,17 +76,17 @@ grib_iterator_class* grib_iterator_class_polar_stereographic = &_grib_iterator_c static void init_class(grib_iterator_class* c) { - c->previous = (*(c->super))->previous; - c->reset = (*(c->super))->reset; - c->has_next = (*(c->super))->has_next; + c->previous = (*(c->super))->previous; + c->reset = (*(c->super))->reset; + c->has_next = (*(c->super))->has_next; } /* END_CLASS_IMP */ -static int next(grib_iterator* i, double *lat, double *lon, double *val) +static int next(grib_iterator* i, double* lat, double* lon, double* val) { grib_iterator_polar_stereographic* self = (grib_iterator_polar_stereographic*)i; - if((long)i->e >= (long)(i->nv-1)) + if ((long)i->e >= (long)(i->nv - 1)) return 0; i->e++; @@ -97,25 +98,26 @@ static int next(grib_iterator* i, double *lat, double *lon, double *val) } /* Data struct for Forward and Inverse Projections */ -typedef struct proj_data_t { - double centre_lon; /* central longitude */ - double centre_lat; /* central latitude */ - double sign; /* sign variable */ - double ind; /* flag variable */ - double mcs; /* small m */ - double tcs; /* small t */ +typedef struct proj_data_t +{ + double centre_lon; /* central longitude */ + double centre_lat; /* central latitude */ + double sign; /* sign variable */ + double ind; /* flag variable */ + double mcs; /* small m */ + double tcs; /* small t */ double false_northing; /* y offset in meters */ double false_easting; /* x offset in meters */ } proj_data_t; -#define RAD2DEG 57.29577951308232087684 /* 180 over pi */ -#define DEG2RAD 0.01745329251994329576 /* pi over 180 */ -#define PI_OVER_2 1.5707963267948966 /* half pi */ -#define EPSILON 1.0e-10 +#define RAD2DEG 57.29577951308232087684 /* 180 over pi */ +#define DEG2RAD 0.01745329251994329576 /* pi over 180 */ +#define PI_OVER_2 1.5707963267948966 /* half pi */ +#define EPSILON 1.0e-10 -static int init(grib_iterator* iter,grib_handle* h,grib_arguments* args) +static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) { - int ret=0; + int ret = 0; double *lats, *lons; /* arrays for latitudes and longitudes */ double lonFirstInDegrees, latFirstInDegrees, radius; double x, y, Dx, Dy; @@ -123,153 +125,163 @@ static int init(grib_iterator* iter,grib_handle* h,grib_arguments* args) long alternativeRowScanning, iScansNegatively, i, j; long jScansPositively, jPointsAreConsecutive, southPoleOnPlane; double centralLongitude, centralLatitude; /* in radians */ - double con1; /* temporary angle */ - double ts; /* value of small t */ - double height; /* height above ellipsoid */ + double con1; /* temporary angle */ + double ts; /* value of small t */ + double height; /* height above ellipsoid */ double x0, y0, lonFirst, latFirst; proj_data_t fwd_proj_data = {0,}; proj_data_t inv_proj_data = {0,}; grib_iterator_polar_stereographic* self = (grib_iterator_polar_stereographic*)iter; - const char* sradius = grib_arguments_get_name(h,args,self->carg++); - const char* snx = grib_arguments_get_name(h,args,self->carg++); - const char* sny = grib_arguments_get_name(h,args,self->carg++); - const char* slatFirstInDegrees = grib_arguments_get_name(h,args,self->carg++); - const char* slonFirstInDegrees = grib_arguments_get_name(h,args,self->carg++); - const char* ssouthPoleOnPlane = grib_arguments_get_name(h,args,self->carg++); - const char* scentralLongitude = grib_arguments_get_name(h,args,self->carg++); - const char* scentralLatitude = grib_arguments_get_name(h,args,self->carg++); - const char* sDx = grib_arguments_get_name(h,args,self->carg++); - const char* sDy = grib_arguments_get_name(h,args,self->carg++); - const char* siScansNegatively = grib_arguments_get_name(h,args,self->carg++); - const char* sjScansPositively = grib_arguments_get_name(h,args,self->carg++); - const char* sjPointsAreConsecutive = grib_arguments_get_name(h,args,self->carg++); - const char* salternativeRowScanning = grib_arguments_get_name(h,args,self->carg++); - - if((ret = grib_get_double_internal(h, sradius,&radius)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, snx,&nx)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, sny,&ny)) != GRIB_SUCCESS) return ret; + const char* sradius = grib_arguments_get_name(h, args, self->carg++); + const char* snx = grib_arguments_get_name(h, args, self->carg++); + const char* sny = grib_arguments_get_name(h, args, self->carg++); + const char* slatFirstInDegrees = grib_arguments_get_name(h, args, self->carg++); + const char* slonFirstInDegrees = grib_arguments_get_name(h, args, self->carg++); + const char* ssouthPoleOnPlane = grib_arguments_get_name(h, args, self->carg++); + const char* scentralLongitude = grib_arguments_get_name(h, args, self->carg++); + const char* scentralLatitude = grib_arguments_get_name(h, args, self->carg++); + const char* sDx = grib_arguments_get_name(h, args, self->carg++); + const char* sDy = grib_arguments_get_name(h, args, self->carg++); + const char* siScansNegatively = grib_arguments_get_name(h, args, self->carg++); + const char* sjScansPositively = grib_arguments_get_name(h, args, self->carg++); + const char* sjPointsAreConsecutive = grib_arguments_get_name(h, args, self->carg++); + const char* salternativeRowScanning = grib_arguments_get_name(h, args, self->carg++); + + if ((ret = grib_get_double_internal(h, sradius, &radius)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(h, snx, &nx)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(h, sny, &ny)) != GRIB_SUCCESS) + return ret; if (grib_is_earth_oblate(h)) { - grib_context_log(h->context,GRIB_LOG_ERROR,"Polar stereographic only supported for spherical earth."); + grib_context_log(h->context, GRIB_LOG_ERROR, "Polar stereographic only supported for spherical earth."); return GRIB_GEOCALCULUS_PROBLEM; } - if (iter->nv!=nx*ny) { - grib_context_log(h->context,GRIB_LOG_ERROR, "Wrong number of points (%ld!=%ldx%ld)", iter->nv,nx,ny); + if (iter->nv != nx * ny) { + grib_context_log(h->context, GRIB_LOG_ERROR, "Wrong number of points (%ld!=%ldx%ld)", iter->nv, nx, ny); return GRIB_WRONG_GRID; } - if((ret = grib_get_double_internal(h, slatFirstInDegrees,&latFirstInDegrees)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(h, slatFirstInDegrees, &latFirstInDegrees)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_double_internal(h, slonFirstInDegrees,&lonFirstInDegrees)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(h, slonFirstInDegrees, &lonFirstInDegrees)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, ssouthPoleOnPlane,&southPoleOnPlane)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, ssouthPoleOnPlane, &southPoleOnPlane)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, scentralLongitude,¢ralLongitudeInDegrees)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, scentralLongitude, ¢ralLongitudeInDegrees)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, scentralLatitude,¢ralLatitudeInDegrees)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, scentralLatitude, ¢ralLatitudeInDegrees)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_double_internal(h, sDx,&Dx)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(h, sDx, &Dx)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_double_internal(h, sDy,&Dy)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(h, sDy, &Dy)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, sjPointsAreConsecutive,&jPointsAreConsecutive)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, sjPointsAreConsecutive, &jPointsAreConsecutive)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, sjScansPositively,&jScansPositively)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, sjScansPositively, &jScansPositively)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, siScansNegatively,&iScansNegatively)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, siScansNegatively, &iScansNegatively)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, salternativeRowScanning,&alternativeRowScanning)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, salternativeRowScanning, &alternativeRowScanning)) != GRIB_SUCCESS) return ret; centralLongitude = centralLongitudeInDegrees * DEG2RAD; - centralLatitude = centralLatitudeInDegrees * DEG2RAD; - lonFirst = lonFirstInDegrees * DEG2RAD; - latFirst = latFirstInDegrees*DEG2RAD; + centralLatitude = centralLatitudeInDegrees * DEG2RAD; + lonFirst = lonFirstInDegrees * DEG2RAD; + latFirst = latFirstInDegrees * DEG2RAD; /* Forward projection initialisation */ fwd_proj_data.false_northing = 0; - fwd_proj_data.false_easting = 0; - fwd_proj_data.centre_lon = centralLongitude; - fwd_proj_data.centre_lat = centralLatitude; - if (centralLatitude < 0) fwd_proj_data.sign = -1.0; - else fwd_proj_data.sign = +1.0; + fwd_proj_data.false_easting = 0; + fwd_proj_data.centre_lon = centralLongitude; + fwd_proj_data.centre_lat = centralLatitude; + if (centralLatitude < 0) + fwd_proj_data.sign = -1.0; + else + fwd_proj_data.sign = +1.0; fwd_proj_data.ind = 0; if (fabs(fabs(centralLatitude) - PI_OVER_2) > EPSILON) { /* central latitude different from 90 i.e. not north/south polar */ fwd_proj_data.ind = 1; - con1 = fwd_proj_data.sign * centralLatitude; + con1 = fwd_proj_data.sign * centralLatitude; fwd_proj_data.mcs = cos(con1); fwd_proj_data.tcs = tan(0.5 * (PI_OVER_2 - con1)); } /* Forward projection from initial lat,lon to initial x,y */ con1 = fwd_proj_data.sign * (lonFirst - fwd_proj_data.centre_lon); - ts = tan(0.5 * (PI_OVER_2 - fwd_proj_data.sign * latFirst)); + ts = tan(0.5 * (PI_OVER_2 - fwd_proj_data.sign * latFirst)); if (fwd_proj_data.ind) height = radius * fwd_proj_data.mcs * ts / fwd_proj_data.tcs; else height = 2.0 * radius * ts; x0 = fwd_proj_data.sign * height * sin(con1) + fwd_proj_data.false_easting; y0 = -fwd_proj_data.sign * height * cos(con1) + fwd_proj_data.false_northing; - + x0 = -x0; y0 = -y0; /* Inverse projection initialisation */ - inv_proj_data.false_easting = x0; - inv_proj_data.false_northing= y0; - inv_proj_data.centre_lon = centralLongitude; - inv_proj_data.centre_lat = centralLatitude; - if (centralLatitude < 0) inv_proj_data.sign = -1.0; - else inv_proj_data.sign = +1.0; + inv_proj_data.false_easting = x0; + inv_proj_data.false_northing = y0; + inv_proj_data.centre_lon = centralLongitude; + inv_proj_data.centre_lat = centralLatitude; + if (centralLatitude < 0) + inv_proj_data.sign = -1.0; + else + inv_proj_data.sign = +1.0; inv_proj_data.ind = 0; if (fabs(fabs(centralLatitude) - PI_OVER_2) > EPSILON) { inv_proj_data.ind = 1; - con1 = inv_proj_data.sign * inv_proj_data.centre_lat; + con1 = inv_proj_data.sign * inv_proj_data.centre_lat; inv_proj_data.mcs = cos(con1); inv_proj_data.tcs = tan(0.5 * (PI_OVER_2 - con1)); } - self->lats = (double*)grib_context_malloc(h->context,iter->nv*sizeof(double)); + self->lats = (double*)grib_context_malloc(h->context, iter->nv * sizeof(double)); if (!self->lats) { - grib_context_log(h->context,GRIB_LOG_ERROR, "unable to allocate %ld bytes",iter->nv*sizeof(double)); + grib_context_log(h->context, GRIB_LOG_ERROR, "unable to allocate %ld bytes", iter->nv * sizeof(double)); return GRIB_OUT_OF_MEMORY; } - self->lons = (double*)grib_context_malloc(h->context,iter->nv*sizeof(double)); + self->lons = (double*)grib_context_malloc(h->context, iter->nv * sizeof(double)); if (!self->lats) { - grib_context_log(h->context,GRIB_LOG_ERROR, "unable to allocate %ld bytes",iter->nv*sizeof(double)); + grib_context_log(h->context, GRIB_LOG_ERROR, "unable to allocate %ld bytes", iter->nv * sizeof(double)); return GRIB_OUT_OF_MEMORY; } - lats=self->lats; - lons=self->lons; - Dx = iScansNegatively == 0 ? Dx : -Dx; - Dy = jScansPositively == 1 ? Dy : -Dy; + lats = self->lats; + lons = self->lons; + Dx = iScansNegatively == 0 ? Dx : -Dx; + Dy = jScansPositively == 1 ? Dy : -Dy; y = 0; - for (j=0;j360) *lons -= 360; + while (*lons < 0) + *lons += 360; + while (*lons > 360) + *lons -= 360; lons++; lats++; @@ -347,9 +359,9 @@ static int init(grib_iterator* iter,grib_handle* h,grib_arguments* args) static int destroy(grib_iterator* i) { grib_iterator_polar_stereographic* self = (grib_iterator_polar_stereographic*)i; - const grib_context *c = i->h->context; + const grib_context* c = i->h->context; - grib_context_free(c,self->lats); - grib_context_free(c,self->lons); + grib_context_free(c, self->lats); + grib_context_free(c, self->lons); return 1; } diff --git a/src/grib_iterator_class_regular.c b/src/grib_iterator_class_regular.c index 68d8403d6..7e766f874 100644 --- a/src/grib_iterator_class_regular.c +++ b/src/grib_iterator_class_regular.c @@ -45,47 +45,48 @@ or edit "iterator.class" and rerun ./make_class.pl */ -static void init_class (grib_iterator_class*); - -static int init (grib_iterator* i,grib_handle*,grib_arguments*); -static int next (grib_iterator* i, double *lat, double *lon, double *val); -static int previous (grib_iterator* ei, double *lat, double *lon, double *val); -static int destroy (grib_iterator* i); - - -typedef struct grib_iterator_regular{ - grib_iterator it; -/* Members defined in gen */ - long carg; - const char* missingValue; -/* Members defined in regular */ - double *las; - double *los; - long nap; - long nam; - long iScansNegatively; - long isRotated; - double angleOfRotation; - double southPoleLat; - double southPoleLon; - long jPointsAreConsecutive; - long disableUnrotate; +static void init_class(grib_iterator_class*); + +static int init(grib_iterator* i, grib_handle*, grib_arguments*); +static int next(grib_iterator* i, double* lat, double* lon, double* val); +static int previous(grib_iterator* ei, double* lat, double* lon, double* val); +static int destroy(grib_iterator* i); + + +typedef struct grib_iterator_regular +{ + grib_iterator it; + /* Members defined in gen */ + long carg; + const char* missingValue; + /* Members defined in regular */ + double* las; + double* los; + long nap; + long nam; + long iScansNegatively; + long isRotated; + double angleOfRotation; + double southPoleLat; + double southPoleLon; + long jPointsAreConsecutive; + long disableUnrotate; } grib_iterator_regular; extern grib_iterator_class* grib_iterator_class_gen; static grib_iterator_class _grib_iterator_class_regular = { - &grib_iterator_class_gen, /* super */ - "regular", /* name */ - sizeof(grib_iterator_regular),/* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* constructor */ - &destroy, /* destructor */ - &next, /* Next Value */ - &previous, /* Previous Value */ - 0, /* Reset the counter */ - 0, /* has next values */ + &grib_iterator_class_gen, /* super */ + "regular", /* name */ + sizeof(grib_iterator_regular), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* constructor */ + &destroy, /* destructor */ + &next, /* Next Value */ + &previous, /* Previous Value */ + 0, /* Reset the counter */ + 0, /* has next values */ }; grib_iterator_class* grib_iterator_class_regular = &_grib_iterator_class_regular; @@ -93,96 +94,106 @@ grib_iterator_class* grib_iterator_class_regular = &_grib_iterator_class_regular static void init_class(grib_iterator_class* c) { - c->reset = (*(c->super))->reset; - c->has_next = (*(c->super))->has_next; + c->reset = (*(c->super))->reset; + c->has_next = (*(c->super))->has_next; } /* END_CLASS_IMP */ -static int next(grib_iterator* i, double *lat, double *lon, double *val) +static int next(grib_iterator* i, double* lat, double* lon, double* val) { grib_iterator_regular* self = (grib_iterator_regular*)i; - if((long)i->e >= (long)(i->nv-1)) return 0; + if ((long)i->e >= (long)(i->nv - 1)) + return 0; i->e++; - *lat = self->las[(long)floor(i->e/self->nap)]; - *lon = self->los[(long)i->e%self->nap]; + *lat = self->las[(long)floor(i->e / self->nap)]; + *lon = self->los[(long)i->e % self->nap]; *val = i->data[i->e]; return 1; } -static int previous(grib_iterator* i, double *lat, double *lon, double *val) +static int previous(grib_iterator* i, double* lat, double* lon, double* val) { grib_iterator_regular* self = (grib_iterator_regular*)i; - if(i->e < 0) return 0; - *lat = self->las[(long)floor(i->e/self->nap)]; - *lon = self->los[i->e%self->nap]; + if (i->e < 0) + return 0; + *lat = self->las[(long)floor(i->e / self->nap)]; + *lon = self->los[i->e % self->nap]; *val = i->data[i->e]; i->e--; return 1; } -static int destroy(grib_iterator* i){ +static int destroy(grib_iterator* i) +{ grib_iterator_regular* self = (grib_iterator_regular*)i; - const grib_context *c = i->h->context; - grib_context_free(c,self->las); - grib_context_free(c,self->los); + const grib_context* c = i->h->context; + grib_context_free(c, self->las); + grib_context_free(c, self->los); return GRIB_SUCCESS; } -static int init(grib_iterator* i,grib_handle* h,grib_arguments* args) +static int init(grib_iterator* i, grib_handle* h, grib_arguments* args) { grib_iterator_regular* self = (grib_iterator_regular*)i; - int ret = GRIB_SUCCESS; + int ret = GRIB_SUCCESS; long Ni; /* Number of points along a parallel = Nx */ long Nj; /* Number of points along a meridian = Ny */ - double idir, lon1,lon2; + double idir, lon1, lon2; long loi; - const char* s_lon1 = grib_arguments_get_name(h,args,self->carg++); - const char* s_idir = grib_arguments_get_name(h,args,self->carg++); - const char* s_Ni = grib_arguments_get_name(h,args,self->carg++); - const char* s_Nj = grib_arguments_get_name(h,args,self->carg++); - const char* s_iScansNeg = grib_arguments_get_name(h,args,self->carg++); - - if((ret = grib_get_double_internal(h, s_lon1, &lon1))) return ret; - if((ret = grib_get_double_internal(h, "longitudeOfLastGridPointInDegrees", &lon2))) return ret; - if((ret = grib_get_double_internal(h, s_idir, &idir))) return ret; - if((ret = grib_get_long_internal(h, s_Ni, &Ni))) return ret; - if((ret = grib_get_long_internal(h, s_Nj, &Nj))) return ret; - if((ret = grib_get_long_internal(h, s_iScansNeg, &self->iScansNegatively))) + const char* s_lon1 = grib_arguments_get_name(h, args, self->carg++); + const char* s_idir = grib_arguments_get_name(h, args, self->carg++); + const char* s_Ni = grib_arguments_get_name(h, args, self->carg++); + const char* s_Nj = grib_arguments_get_name(h, args, self->carg++); + const char* s_iScansNeg = grib_arguments_get_name(h, args, self->carg++); + + if ((ret = grib_get_double_internal(h, s_lon1, &lon1))) + return ret; + if ((ret = grib_get_double_internal(h, "longitudeOfLastGridPointInDegrees", &lon2))) + return ret; + if ((ret = grib_get_double_internal(h, s_idir, &idir))) + return ret; + if ((ret = grib_get_long_internal(h, s_Ni, &Ni))) + return ret; + if ((ret = grib_get_long_internal(h, s_Nj, &Nj))) + return ret; + if ((ret = grib_get_long_internal(h, s_iScansNeg, &self->iScansNegatively))) return ret; /* GRIB-801: Careful of case with a single point! nap==1 */ if (Ni > 1) { /* Note: If first and last longitudes are equal I assume you wanna go round the globe */ if (self->iScansNegatively) { - if (lon1 > lon2){ - idir=(lon1-lon2)/(Ni-1); + if (lon1 > lon2) { + idir = (lon1 - lon2) / (Ni - 1); } else { - idir=(lon1+360.0-lon2)/(Ni-1); + idir = (lon1 + 360.0 - lon2) / (Ni - 1); } } else { - if (lon2 > lon1){ - idir=(lon2-lon1)/(Ni-1); + if (lon2 > lon1) { + idir = (lon2 - lon1) / (Ni - 1); } else { - idir=(lon2+360.0-lon1)/(Ni-1); + idir = (lon2 + 360.0 - lon1) / (Ni - 1); } } } if (self->iScansNegatively) { - idir=-idir; - } else { - if (lon1+(Ni-2)*idir>360) lon1-=360; + idir = -idir; + } + else { + if (lon1 + (Ni - 2) * idir > 360) + lon1 -= 360; /*See ECC-704, GRIB-396*/ /*else if ( (lon1+(Ni-1)*idir)-360 > epsilon ){ idir=360.0/(float)Ni; @@ -192,12 +203,12 @@ static int init(grib_iterator* i,grib_handle* h,grib_arguments* args) self->nap = Ni; self->nam = Nj; - self->las = (double*)grib_context_malloc(h->context,Nj*sizeof(double)); - self->los = (double*)grib_context_malloc(h->context,Ni*sizeof(double)); + self->las = (double*)grib_context_malloc(h->context, Nj * sizeof(double)); + self->los = (double*)grib_context_malloc(h->context, Ni * sizeof(double)); - for( loi = 0; loi < Ni; loi++ ) { + for (loi = 0; loi < Ni; loi++) { self->los[loi] = lon1; - lon1 += idir ; + lon1 += idir; } return ret; diff --git a/src/grib_iterator_class_space_view.c b/src/grib_iterator_class_space_view.c index caf21f9ed..73a663771 100644 --- a/src/grib_iterator_class_space_view.c +++ b/src/grib_iterator_class_space_view.c @@ -36,38 +36,39 @@ or edit "iterator.class" and rerun ./make_class.pl */ -static void init_class (grib_iterator_class*); - -static int init (grib_iterator* i,grib_handle*,grib_arguments*); -static int next (grib_iterator* i, double *lat, double *lon, double *val); -static int destroy (grib_iterator* i); - - -typedef struct grib_iterator_space_view{ - grib_iterator it; -/* Members defined in gen */ - long carg; - const char* missingValue; -/* Members defined in space_view */ - double *lats; - double *lons; - long nam; +static void init_class(grib_iterator_class*); + +static int init(grib_iterator* i, grib_handle*, grib_arguments*); +static int next(grib_iterator* i, double* lat, double* lon, double* val); +static int destroy(grib_iterator* i); + + +typedef struct grib_iterator_space_view +{ + grib_iterator it; + /* Members defined in gen */ + long carg; + const char* missingValue; + /* Members defined in space_view */ + double* lats; + double* lons; + long nam; } grib_iterator_space_view; extern grib_iterator_class* grib_iterator_class_gen; static grib_iterator_class _grib_iterator_class_space_view = { - &grib_iterator_class_gen, /* super */ - "space_view", /* name */ - sizeof(grib_iterator_space_view),/* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* constructor */ - &destroy, /* destructor */ - &next, /* Next Value */ - 0, /* Previous Value */ - 0, /* Reset the counter */ - 0, /* has next values */ + &grib_iterator_class_gen, /* super */ + "space_view", /* name */ + sizeof(grib_iterator_space_view), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* constructor */ + &destroy, /* destructor */ + &next, /* Next Value */ + 0, /* Previous Value */ + 0, /* Reset the counter */ + 0, /* has next values */ }; grib_iterator_class* grib_iterator_class_space_view = &_grib_iterator_class_space_view; @@ -75,17 +76,17 @@ grib_iterator_class* grib_iterator_class_space_view = &_grib_iterator_class_spac static void init_class(grib_iterator_class* c) { - c->previous = (*(c->super))->previous; - c->reset = (*(c->super))->reset; - c->has_next = (*(c->super))->has_next; + c->previous = (*(c->super))->previous; + c->reset = (*(c->super))->reset; + c->has_next = (*(c->super))->has_next; } /* END_CLASS_IMP */ -static int next(grib_iterator* i, double *lat, double *lon, double *val) +static int next(grib_iterator* i, double* lat, double* lon, double* val) { grib_iterator_space_view* self = (grib_iterator_space_view*)i; - if((long)i->e >= (long)(i->nv-1)) + if ((long)i->e >= (long)(i->nv - 1)) return 0; i->e++; @@ -96,8 +97,8 @@ static int next(grib_iterator* i, double *lat, double *lon, double *val) return 1; } -#define RAD2DEG 57.29577951308232087684 /* 180 over pi */ -#define DEG2RAD 0.01745329251994329576 /* pi over 180 */ +#define RAD2DEG 57.29577951308232087684 /* 180 over pi */ +#define DEG2RAD 0.01745329251994329576 /* pi over 180 */ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) { @@ -105,15 +106,15 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) * LRIT/HRIT Global Specification (CGMS 03, Issue 2.6, 12.08.1999) */ int ret = GRIB_SUCCESS; - double *lats,*lons; /* arrays of latitudes and longitudes */ - double latOfSubSatellitePointInDegrees,lonOfSubSatellitePointInDegrees; + double *lats, *lons; /* arrays of latitudes and longitudes */ + double latOfSubSatellitePointInDegrees, lonOfSubSatellitePointInDegrees; double orientationInDegrees, nrInRadiusOfEarth; - double radius=0,xpInGridLengths=0,ypInGridLengths=0; - long nx, ny, earthIsOblate=0; - long alternativeRowScanning,iScansNegatively; - long Xo, Yo, jScansPositively,jPointsAreConsecutive, i; + double radius = 0, xpInGridLengths = 0, ypInGridLengths = 0; + long nx, ny, earthIsOblate = 0; + long alternativeRowScanning, iScansNegatively; + long Xo, Yo, jScansPositively, jPointsAreConsecutive, i; - double major=0, minor=0, r_eq, r_pol, height; + double major = 0, minor = 0, r_eq, r_pol, height; double lap, lop, orient_angle, angular_size; double xp, yp, dx, dy, rx, ry, x, y; double cos_x, cos_y, sin_x, sin_y; @@ -121,107 +122,111 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) int x0, y0, ix, iy; double *s_x, *c_x; /* arrays storing sin and cos values */ size_t array_size = (iter->nv * sizeof(double)); - + grib_iterator_space_view* self = (grib_iterator_space_view*)iter; - const char* sradius = grib_arguments_get_name(h,args,self->carg++); - const char* sEarthIsOblate = grib_arguments_get_name(h,args,self->carg++); - const char* sMajorAxisInMetres = grib_arguments_get_name(h,args,self->carg++); - const char* sMinorAxisInMetres = grib_arguments_get_name(h,args,self->carg++); - const char* snx = grib_arguments_get_name(h,args,self->carg++); - const char* sny = grib_arguments_get_name(h,args,self->carg++); - const char* sLatOfSubSatellitePointInDegrees = grib_arguments_get_name(h,args,self->carg++); - const char* sLonOfSubSatellitePointInDegrees = grib_arguments_get_name(h,args,self->carg++); - const char* sDx = grib_arguments_get_name(h,args,self->carg++); - const char* sDy = grib_arguments_get_name(h,args,self->carg++); - const char* sXpInGridLengths = grib_arguments_get_name(h,args,self->carg++); - const char* sYpInGridLengths = grib_arguments_get_name(h,args,self->carg++); - const char* sOrientationInDegrees = grib_arguments_get_name(h,args,self->carg++); - const char* sNrInRadiusOfEarth = grib_arguments_get_name(h,args,self->carg++); - const char* sXo = grib_arguments_get_name(h,args,self->carg++); - const char* sYo = grib_arguments_get_name(h,args,self->carg++); - - const char* siScansNegatively = grib_arguments_get_name(h,args,self->carg++); - const char* sjScansPositively = grib_arguments_get_name(h,args,self->carg++); - const char* sjPointsAreConsecutive = grib_arguments_get_name(h,args,self->carg++); - const char* sAlternativeRowScanning = grib_arguments_get_name(h,args,self->carg++); - - if((ret = grib_get_long_internal(h, snx,&nx)) != GRIB_SUCCESS) + const char* sradius = grib_arguments_get_name(h, args, self->carg++); + const char* sEarthIsOblate = grib_arguments_get_name(h, args, self->carg++); + const char* sMajorAxisInMetres = grib_arguments_get_name(h, args, self->carg++); + const char* sMinorAxisInMetres = grib_arguments_get_name(h, args, self->carg++); + const char* snx = grib_arguments_get_name(h, args, self->carg++); + const char* sny = grib_arguments_get_name(h, args, self->carg++); + const char* sLatOfSubSatellitePointInDegrees = grib_arguments_get_name(h, args, self->carg++); + const char* sLonOfSubSatellitePointInDegrees = grib_arguments_get_name(h, args, self->carg++); + const char* sDx = grib_arguments_get_name(h, args, self->carg++); + const char* sDy = grib_arguments_get_name(h, args, self->carg++); + const char* sXpInGridLengths = grib_arguments_get_name(h, args, self->carg++); + const char* sYpInGridLengths = grib_arguments_get_name(h, args, self->carg++); + const char* sOrientationInDegrees = grib_arguments_get_name(h, args, self->carg++); + const char* sNrInRadiusOfEarth = grib_arguments_get_name(h, args, self->carg++); + const char* sXo = grib_arguments_get_name(h, args, self->carg++); + const char* sYo = grib_arguments_get_name(h, args, self->carg++); + + const char* siScansNegatively = grib_arguments_get_name(h, args, self->carg++); + const char* sjScansPositively = grib_arguments_get_name(h, args, self->carg++); + const char* sjPointsAreConsecutive = grib_arguments_get_name(h, args, self->carg++); + const char* sAlternativeRowScanning = grib_arguments_get_name(h, args, self->carg++); + + if ((ret = grib_get_long_internal(h, snx, &nx)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, sny,&ny)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, sny, &ny)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, sEarthIsOblate, &earthIsOblate)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, sEarthIsOblate, &earthIsOblate)) != GRIB_SUCCESS) return ret; if (earthIsOblate) { - if((ret = grib_get_double_internal(h, sMajorAxisInMetres, &major)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(h, sMajorAxisInMetres, &major)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_double_internal(h, sMinorAxisInMetres, &minor)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(h, sMinorAxisInMetres, &minor)) != GRIB_SUCCESS) return ret; - } else { - if((ret = grib_get_double_internal(h, sradius, &radius)) != GRIB_SUCCESS) + } + else { + if ((ret = grib_get_double_internal(h, sradius, &radius)) != GRIB_SUCCESS) return ret; } - - if (iter->nv!=nx*ny) { - grib_context_log(h->context,GRIB_LOG_ERROR, "Wrong number of points (%ld!=%ldx%ld)", iter->nv,nx,ny); + + if (iter->nv != nx * ny) { + grib_context_log(h->context, GRIB_LOG_ERROR, "Wrong number of points (%ld!=%ldx%ld)", iter->nv, nx, ny); return GRIB_WRONG_GRID; } - if((ret = grib_get_double_internal(h, sLatOfSubSatellitePointInDegrees,&latOfSubSatellitePointInDegrees)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(h, sLatOfSubSatellitePointInDegrees, &latOfSubSatellitePointInDegrees)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_double_internal(h, sLonOfSubSatellitePointInDegrees,&lonOfSubSatellitePointInDegrees)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(h, sLonOfSubSatellitePointInDegrees, &lonOfSubSatellitePointInDegrees)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_double_internal(h, sDx, &dx)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(h, sDx, &dx)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_double_internal(h, sDy, &dy)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(h, sDy, &dy)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_double_internal(h, sXpInGridLengths,&xpInGridLengths)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(h, sXpInGridLengths, &xpInGridLengths)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_double_internal(h, sYpInGridLengths,&ypInGridLengths)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(h, sYpInGridLengths, &ypInGridLengths)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_double_internal(h, sOrientationInDegrees,&orientationInDegrees)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(h, sOrientationInDegrees, &orientationInDegrees)) != GRIB_SUCCESS) return ret; /* Orthographic not supported. This happens when Nr (camera altitude) is missing */ if (grib_is_missing(h, sNrInRadiusOfEarth, &ret)) { - grib_context_log(h->context,GRIB_LOG_ERROR, "Orthographic view (Nr missing) not supported"); + grib_context_log(h->context, GRIB_LOG_ERROR, "Orthographic view (Nr missing) not supported"); return GRIB_NOT_IMPLEMENTED; } - if((ret = grib_get_double_internal(h, sNrInRadiusOfEarth,&nrInRadiusOfEarth)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(h, sNrInRadiusOfEarth, &nrInRadiusOfEarth)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, sXo,&Xo)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, sXo, &Xo)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, sYo,&Yo)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, sYo, &Yo)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, sjPointsAreConsecutive,&jPointsAreConsecutive)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, sjPointsAreConsecutive, &jPointsAreConsecutive)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, sjScansPositively,&jScansPositively)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, sjScansPositively, &jScansPositively)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, siScansNegatively,&iScansNegatively)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, siScansNegatively, &iScansNegatively)) != GRIB_SUCCESS) return ret; - if((ret = grib_get_long_internal(h, sAlternativeRowScanning,&alternativeRowScanning)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, sAlternativeRowScanning, &alternativeRowScanning)) != GRIB_SUCCESS) return ret; if (earthIsOblate) { - r_eq = major; /* In km */ + r_eq = major; /* In km */ r_pol = minor; - } else { - r_eq = r_pol = radius * 0.001;/*conv to km*/ + } + else { + r_eq = r_pol = radius * 0.001; /*conv to km*/ } angular_size = 2.0 * asin(1.0 / nrInRadiusOfEarth); - height = nrInRadiusOfEarth * r_eq; + height = nrInRadiusOfEarth * r_eq; lap = latOfSubSatellitePointInDegrees; lop = lonOfSubSatellitePointInDegrees; lap *= 1e-6; /* default scaling factor */ lop *= 1e-6; - if (lap != 0.0) return GRIB_NOT_IMPLEMENTED; + if (lap != 0.0) + return GRIB_NOT_IMPLEMENTED; lap *= DEG2RAD; lop *= DEG2RAD; orient_angle = orientationInDegrees; - if (orient_angle != 0.0) return GRIB_NOT_IMPLEMENTED; + if (orient_angle != 0.0) + return GRIB_NOT_IMPLEMENTED; xp = xpInGridLengths; yp = ypInGridLengths; @@ -229,85 +234,89 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) y0 = Yo; rx = angular_size / dx; - ry = (r_pol/r_eq) * angular_size / dy; + ry = (r_pol / r_eq) * angular_size / dy; self->lats = (double*)grib_context_malloc(h->context, array_size); if (!self->lats) { - grib_context_log(h->context,GRIB_LOG_ERROR, "unable to allocate %ld bytes", array_size); + grib_context_log(h->context, GRIB_LOG_ERROR, "unable to allocate %ld bytes", array_size); return GRIB_OUT_OF_MEMORY; } self->lons = (double*)grib_context_malloc(h->context, array_size); if (!self->lats) { - grib_context_log(h->context,GRIB_LOG_ERROR, "unable to allocate %ld bytes", array_size); + grib_context_log(h->context, GRIB_LOG_ERROR, "unable to allocate %ld bytes", array_size); return GRIB_OUT_OF_MEMORY; } - lats=self->lats; - lons=self->lons; + lats = self->lats; + lons = self->lons; if (!iScansNegatively) { xp = xp - x0; - } else { - xp = (nx-1) - (xp - x0); + } + else { + xp = (nx - 1) - (xp - x0); } if (jScansPositively) { yp = yp - y0; } else { - yp = (ny-1) - (yp - y0); + yp = (ny - 1) - (yp - y0); } - i = 0; - factor_2 = (r_eq/r_pol)*(r_eq/r_pol); + i = 0; + factor_2 = (r_eq / r_pol) * (r_eq / r_pol); factor_1 = height * height - r_eq * r_eq; /* Store array of sin and cosine values to avoid recalculation */ - s_x = (double *) grib_context_malloc(h->context, nx*sizeof(double)); + s_x = (double*)grib_context_malloc(h->context, nx * sizeof(double)); if (!s_x) { - grib_context_log(h->context,GRIB_LOG_ERROR, "unable to allocate %ld bytes",nx*sizeof(double)); + grib_context_log(h->context, GRIB_LOG_ERROR, "unable to allocate %ld bytes", nx * sizeof(double)); return GRIB_OUT_OF_MEMORY; } - c_x = (double *) grib_context_malloc(h->context, nx*sizeof(double)); + c_x = (double*)grib_context_malloc(h->context, nx * sizeof(double)); if (!c_x) { - grib_context_log(h->context,GRIB_LOG_ERROR, "unable to allocate %ld bytes",nx*sizeof(double)); + grib_context_log(h->context, GRIB_LOG_ERROR, "unable to allocate %ld bytes", nx * sizeof(double)); return GRIB_OUT_OF_MEMORY; } for (ix = 0; ix < nx; ix++) { - x = (ix - xp) * rx; + x = (ix - xp) * rx; s_x[ix] = sin(x); - c_x[ix] = sqrt(1.0 - s_x[ix]*s_x[ix]); + c_x[ix] = sqrt(1.0 - s_x[ix] * s_x[ix]); } /*for (iy = 0; iy < ny; iy++) {*/ - for (iy = ny-1; iy >= 0; --iy) { - y = (iy - yp) * ry; + for (iy = ny - 1; iy >= 0; --iy) { + y = (iy - yp) * ry; sin_y = sin(y); - cos_y = sqrt(1.0 - sin_y*sin_y); + cos_y = sqrt(1.0 - sin_y * sin_y); + + tmp1 = (1 + (factor_2 - 1.0) * sin_y * sin_y); - tmp1 = (1 + (factor_2-1.0)*sin_y*sin_y); - for (ix = 0; ix < nx; ix++, i++) { /*x = (ix - xp) * rx;*/ /* Use sin/cos previously computed */ - sin_x = s_x[ix]; cos_x = c_x[ix]; - + sin_x = s_x[ix]; + cos_x = c_x[ix]; + Sd = height * cos_x * cos_y; - Sd = Sd * Sd - tmp1*factor_1; - if (Sd <= 0.0) { /* outside of view */ + Sd = Sd * Sd - tmp1 * factor_1; + if (Sd <= 0.0) { /* outside of view */ lats[i] = lons[i] = 0; /* TODO: error? */ } else { - Sd = sqrt(Sd); - Sn = (height*cos_x*cos_y - Sd) / tmp1; - S1 = height - Sn * cos_x * cos_y; - S2 = Sn * sin_x * cos_y; - S3 = Sn * sin_y; - Sxy = sqrt(S1*S1 + S2*S2); - lons[i] = atan(S2/S1)*(RAD2DEG) + lop; - lats[i] = atan(factor_2*S3/Sxy)*(RAD2DEG); + Sd = sqrt(Sd); + Sn = (height * cos_x * cos_y - Sd) / tmp1; + S1 = height - Sn * cos_x * cos_y; + S2 = Sn * sin_x * cos_y; + S3 = Sn * sin_y; + Sxy = sqrt(S1 * S1 + S2 * S2); + lons[i] = atan(S2 / S1) * (RAD2DEG) + lop; + lats[i] = atan(factor_2 * S3 / Sxy) * (RAD2DEG); /*fprintf(stderr, "lat=%g lon=%g\n", lats[i], lons[i]);*/ } - while (lons[i]<0) lons[i] += 360; - while (lons[i]>360) lons[i] -= 360; + while (lons[i] < 0) + lons[i] += 360; + while (lons[i] > 360) + lons[i] -= 360; } } grib_context_free(h->context, s_x); @@ -320,9 +329,9 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) static int destroy(grib_iterator* i) { grib_iterator_space_view* self = (grib_iterator_space_view*)i; - const grib_context *c = i->h->context; + const grib_context* c = i->h->context; - grib_context_free(c,self->lats); - grib_context_free(c,self->lons); + grib_context_free(c, self->lats); + grib_context_free(c, self->lons); return 1; } diff --git a/src/grib_itrie.c b/src/grib_itrie.c index 3f40bfbc5..20842bc59 100644 --- a/src/grib_itrie.c +++ b/src/grib_itrie.c @@ -12,277 +12,277 @@ /* Note: all non-alpha are mapped to 0 */ static const int mapping[] = { -0, /* 00 */ -0, /* 01 */ -0, /* 02 */ -0, /* 03 */ -0, /* 04 */ -0, /* 05 */ -0, /* 06 */ -0, /* 07 */ -0, /* 08 */ -0, /* 09 */ -0, /* 0a */ -0, /* 0b */ -0, /* 0c */ -0, /* 0d */ -0, /* 0e */ -0, /* 0f */ -0, /* 10 */ -0, /* 11 */ -0, /* 12 */ -0, /* 13 */ -0, /* 14 */ -0, /* 15 */ -0, /* 16 */ -0, /* 17 */ -0, /* 18 */ -0, /* 19 */ -0, /* 1a */ -0, /* 1b */ -0, /* 1c */ -0, /* 1d */ -0, /* 1e */ -0, /* 1f */ -0, /* 20 */ -0, /* 21 */ -0, /* 22 */ -0, /* 23 */ -0, /* 24 */ -0, /* 25 */ -0, /* 26 */ -0, /* 27 */ -0, /* 28 */ -0, /* 29 */ -0, /* 2a */ -0, /* 2b */ -0, /* 2c */ -0, /* 2d */ -38, /* 2e */ -39, /* 2f */ -1, /* 0 */ -2, /* 1 */ -3, /* 2 */ -4, /* 3 */ -5, /* 4 */ -6, /* 5 */ -7, /* 6 */ -8, /* 7 */ -9, /* 8 */ -10, /* 9 */ -0, /* 3a */ -0, /* 3b */ -0, /* 3c */ -0, /* 3d */ -0, /* 3e */ -0, /* 3f */ -0, /* 40 */ -11, /* A */ -12, /* B */ -13, /* C */ -14, /* D */ -15, /* E */ -16, /* F */ -17, /* G */ -18, /* H */ -19, /* I */ -20, /* J */ -21, /* K */ -22, /* L */ -23, /* M */ -24, /* N */ -25, /* O */ -26, /* P */ -27, /* Q */ -28, /* R */ -29, /* S */ -30, /* T */ -31, /* U */ -32, /* V */ -33, /* W */ -34, /* X */ -35, /* Y */ -36, /* Z */ -0, /* 5b */ -0, /* 5c */ -0, /* 5d */ -0, /* 5e */ -37, /* _ */ -0, /* 60 */ -11, /* a */ -12, /* b */ -13, /* c */ -14, /* d */ -15, /* e */ -16, /* f */ -17, /* g */ -18, /* h */ -19, /* i */ -20, /* j */ -21, /* k */ -22, /* l */ -23, /* m */ -24, /* n */ -25, /* o */ -26, /* p */ -27, /* q */ -28, /* r */ -29, /* s */ -30, /* t */ -31, /* u */ -32, /* v */ -33, /* w */ -34, /* x */ -35, /* y */ -36, /* z */ -0, /* 7b */ -0, /* 7c */ -0, /* 7d */ -0, /* 7e */ -0, /* 7f */ -0, /* 80 */ -0, /* 81 */ -0, /* 82 */ -0, /* 83 */ -0, /* 84 */ -0, /* 85 */ -0, /* 86 */ -0, /* 87 */ -0, /* 88 */ -0, /* 89 */ -0, /* 8a */ -0, /* 8b */ -0, /* 8c */ -0, /* 8d */ -0, /* 8e */ -0, /* 8f */ -0, /* 90 */ -0, /* 91 */ -0, /* 92 */ -0, /* 93 */ -0, /* 94 */ -0, /* 95 */ -0, /* 96 */ -0, /* 97 */ -0, /* 98 */ -0, /* 99 */ -0, /* 9a */ -0, /* 9b */ -0, /* 9c */ -0, /* 9d */ -0, /* 9e */ -0, /* 9f */ -0, /* a0 */ -0, /* a1 */ -0, /* a2 */ -0, /* a3 */ -0, /* a4 */ -0, /* a5 */ -0, /* a6 */ -0, /* a7 */ -0, /* a8 */ -0, /* a9 */ -0, /* aa */ -0, /* ab */ -0, /* ac */ -0, /* ad */ -0, /* ae */ -0, /* af */ -0, /* b0 */ -0, /* b1 */ -0, /* b2 */ -0, /* b3 */ -0, /* b4 */ -0, /* b5 */ -0, /* b6 */ -0, /* b7 */ -0, /* b8 */ -0, /* b9 */ -0, /* ba */ -0, /* bb */ -0, /* bc */ -0, /* bd */ -0, /* be */ -0, /* bf */ -0, /* c0 */ -0, /* c1 */ -0, /* c2 */ -0, /* c3 */ -0, /* c4 */ -0, /* c5 */ -0, /* c6 */ -0, /* c7 */ -0, /* c8 */ -0, /* c9 */ -0, /* ca */ -0, /* cb */ -0, /* cc */ -0, /* cd */ -0, /* ce */ -0, /* cf */ -0, /* d0 */ -0, /* d1 */ -0, /* d2 */ -0, /* d3 */ -0, /* d4 */ -0, /* d5 */ -0, /* d6 */ -0, /* d7 */ -0, /* d8 */ -0, /* d9 */ -0, /* da */ -0, /* db */ -0, /* dc */ -0, /* dd */ -0, /* de */ -0, /* df */ -0, /* e0 */ -0, /* e1 */ -0, /* e2 */ -0, /* e3 */ -0, /* e4 */ -0, /* e5 */ -0, /* e6 */ -0, /* e7 */ -0, /* e8 */ -0, /* e9 */ -0, /* ea */ -0, /* eb */ -0, /* ec */ -0, /* ed */ -0, /* ee */ -0, /* ef */ -0, /* f0 */ -0, /* f1 */ -0, /* f2 */ -0, /* f3 */ -0, /* f4 */ -0, /* f5 */ -0, /* f6 */ -0, /* f7 */ -0, /* f8 */ -0, /* f9 */ -0, /* fa */ -0, /* fb */ -0, /* fc */ -0, /* fd */ -0, /* fe */ -0, /* ff */ + 0, /* 00 */ + 0, /* 01 */ + 0, /* 02 */ + 0, /* 03 */ + 0, /* 04 */ + 0, /* 05 */ + 0, /* 06 */ + 0, /* 07 */ + 0, /* 08 */ + 0, /* 09 */ + 0, /* 0a */ + 0, /* 0b */ + 0, /* 0c */ + 0, /* 0d */ + 0, /* 0e */ + 0, /* 0f */ + 0, /* 10 */ + 0, /* 11 */ + 0, /* 12 */ + 0, /* 13 */ + 0, /* 14 */ + 0, /* 15 */ + 0, /* 16 */ + 0, /* 17 */ + 0, /* 18 */ + 0, /* 19 */ + 0, /* 1a */ + 0, /* 1b */ + 0, /* 1c */ + 0, /* 1d */ + 0, /* 1e */ + 0, /* 1f */ + 0, /* 20 */ + 0, /* 21 */ + 0, /* 22 */ + 0, /* 23 */ + 0, /* 24 */ + 0, /* 25 */ + 0, /* 26 */ + 0, /* 27 */ + 0, /* 28 */ + 0, /* 29 */ + 0, /* 2a */ + 0, /* 2b */ + 0, /* 2c */ + 0, /* 2d */ + 38, /* 2e */ + 39, /* 2f */ + 1, /* 0 */ + 2, /* 1 */ + 3, /* 2 */ + 4, /* 3 */ + 5, /* 4 */ + 6, /* 5 */ + 7, /* 6 */ + 8, /* 7 */ + 9, /* 8 */ + 10, /* 9 */ + 0, /* 3a */ + 0, /* 3b */ + 0, /* 3c */ + 0, /* 3d */ + 0, /* 3e */ + 0, /* 3f */ + 0, /* 40 */ + 11, /* A */ + 12, /* B */ + 13, /* C */ + 14, /* D */ + 15, /* E */ + 16, /* F */ + 17, /* G */ + 18, /* H */ + 19, /* I */ + 20, /* J */ + 21, /* K */ + 22, /* L */ + 23, /* M */ + 24, /* N */ + 25, /* O */ + 26, /* P */ + 27, /* Q */ + 28, /* R */ + 29, /* S */ + 30, /* T */ + 31, /* U */ + 32, /* V */ + 33, /* W */ + 34, /* X */ + 35, /* Y */ + 36, /* Z */ + 0, /* 5b */ + 0, /* 5c */ + 0, /* 5d */ + 0, /* 5e */ + 37, /* _ */ + 0, /* 60 */ + 11, /* a */ + 12, /* b */ + 13, /* c */ + 14, /* d */ + 15, /* e */ + 16, /* f */ + 17, /* g */ + 18, /* h */ + 19, /* i */ + 20, /* j */ + 21, /* k */ + 22, /* l */ + 23, /* m */ + 24, /* n */ + 25, /* o */ + 26, /* p */ + 27, /* q */ + 28, /* r */ + 29, /* s */ + 30, /* t */ + 31, /* u */ + 32, /* v */ + 33, /* w */ + 34, /* x */ + 35, /* y */ + 36, /* z */ + 0, /* 7b */ + 0, /* 7c */ + 0, /* 7d */ + 0, /* 7e */ + 0, /* 7f */ + 0, /* 80 */ + 0, /* 81 */ + 0, /* 82 */ + 0, /* 83 */ + 0, /* 84 */ + 0, /* 85 */ + 0, /* 86 */ + 0, /* 87 */ + 0, /* 88 */ + 0, /* 89 */ + 0, /* 8a */ + 0, /* 8b */ + 0, /* 8c */ + 0, /* 8d */ + 0, /* 8e */ + 0, /* 8f */ + 0, /* 90 */ + 0, /* 91 */ + 0, /* 92 */ + 0, /* 93 */ + 0, /* 94 */ + 0, /* 95 */ + 0, /* 96 */ + 0, /* 97 */ + 0, /* 98 */ + 0, /* 99 */ + 0, /* 9a */ + 0, /* 9b */ + 0, /* 9c */ + 0, /* 9d */ + 0, /* 9e */ + 0, /* 9f */ + 0, /* a0 */ + 0, /* a1 */ + 0, /* a2 */ + 0, /* a3 */ + 0, /* a4 */ + 0, /* a5 */ + 0, /* a6 */ + 0, /* a7 */ + 0, /* a8 */ + 0, /* a9 */ + 0, /* aa */ + 0, /* ab */ + 0, /* ac */ + 0, /* ad */ + 0, /* ae */ + 0, /* af */ + 0, /* b0 */ + 0, /* b1 */ + 0, /* b2 */ + 0, /* b3 */ + 0, /* b4 */ + 0, /* b5 */ + 0, /* b6 */ + 0, /* b7 */ + 0, /* b8 */ + 0, /* b9 */ + 0, /* ba */ + 0, /* bb */ + 0, /* bc */ + 0, /* bd */ + 0, /* be */ + 0, /* bf */ + 0, /* c0 */ + 0, /* c1 */ + 0, /* c2 */ + 0, /* c3 */ + 0, /* c4 */ + 0, /* c5 */ + 0, /* c6 */ + 0, /* c7 */ + 0, /* c8 */ + 0, /* c9 */ + 0, /* ca */ + 0, /* cb */ + 0, /* cc */ + 0, /* cd */ + 0, /* ce */ + 0, /* cf */ + 0, /* d0 */ + 0, /* d1 */ + 0, /* d2 */ + 0, /* d3 */ + 0, /* d4 */ + 0, /* d5 */ + 0, /* d6 */ + 0, /* d7 */ + 0, /* d8 */ + 0, /* d9 */ + 0, /* da */ + 0, /* db */ + 0, /* dc */ + 0, /* dd */ + 0, /* de */ + 0, /* df */ + 0, /* e0 */ + 0, /* e1 */ + 0, /* e2 */ + 0, /* e3 */ + 0, /* e4 */ + 0, /* e5 */ + 0, /* e6 */ + 0, /* e7 */ + 0, /* e8 */ + 0, /* e9 */ + 0, /* ea */ + 0, /* eb */ + 0, /* ec */ + 0, /* ed */ + 0, /* ee */ + 0, /* ef */ + 0, /* f0 */ + 0, /* f1 */ + 0, /* f2 */ + 0, /* f3 */ + 0, /* f4 */ + 0, /* f5 */ + 0, /* f6 */ + 0, /* f7 */ + 0, /* f8 */ + 0, /* f9 */ + 0, /* fa */ + 0, /* fb */ + 0, /* fc */ + 0, /* fd */ + 0, /* fe */ + 0, /* ff */ }; #define SIZE 40 #if GRIB_PTHREADS -static pthread_once_t once = PTHREAD_ONCE_INIT; +static pthread_once_t once = PTHREAD_ONCE_INIT; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; -static void init() { - pthread_mutexattr_t attr; - pthread_mutexattr_init(&attr); - pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init(&mutex,&attr); - pthread_mutexattr_destroy(&attr); - +static void init() +{ + pthread_mutexattr_t attr; + pthread_mutexattr_init(&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&mutex, &attr); + pthread_mutexattr_destroy(&attr); } #elif GRIB_OMP_THREADS static int once = 0; @@ -292,101 +292,104 @@ static void init() { GRIB_OMP_CRITICAL(lock_grib_itrie_c) { - if (once == 0) - { + if (once == 0) { omp_init_nest_lock(&mutex); once = 1; } } } #endif -struct grib_itrie { - grib_itrie* next[SIZE]; - grib_context *context; - int id; - int* count; +struct grib_itrie +{ + grib_itrie* next[SIZE]; + grib_context* context; + int id; + int* count; }; -grib_itrie *grib_itrie_new(grib_context* c,int* count) +grib_itrie* grib_itrie_new(grib_context* c, int* count) { - grib_itrie* t = (grib_itrie*)grib_context_malloc_clear(c,sizeof(grib_itrie)); - t->context = c; - t->id=-1; - t->count=count; + grib_itrie* t = (grib_itrie*)grib_context_malloc_clear(c, sizeof(grib_itrie)); + t->context = c; + t->id = -1; + t->count = count; return t; } -void grib_itrie_delete(grib_itrie *t) +void grib_itrie_delete(grib_itrie* t) { - GRIB_MUTEX_INIT_ONCE(&once,&init) - GRIB_MUTEX_LOCK(&mutex) - - if(t) { - int i; - for(i = 0; i < SIZE; i++) - if (t->next[i]) - grib_itrie_delete(t->next[i]); + GRIB_MUTEX_INIT_ONCE(&once, &init) + GRIB_MUTEX_LOCK(&mutex) - grib_context_free(t->context,t); + if (t) { + int i; + for (i = 0; i < SIZE; i++) + if (t->next[i]) + grib_itrie_delete(t->next[i]); - } + grib_context_free(t->context, t); + } GRIB_MUTEX_UNLOCK(&mutex) } -int grib_itrie_get_id(grib_itrie* t,const char* key) +int grib_itrie_get_id(grib_itrie* t, const char* key) { - const char *k=key; - grib_itrie* last=t; + const char* k = key; + grib_itrie* last = t; - GRIB_MUTEX_INIT_ONCE(&once,&init) + GRIB_MUTEX_INIT_ONCE(&once, &init) GRIB_MUTEX_LOCK(&mutex) - while(*k && t) t = t->next[mapping[(int)*k++]]; + while (*k && t) + t = t->next[mapping[(int)*k++]]; - if(t != NULL && t->id != -1) { + if (t != NULL && t->id != -1) { GRIB_MUTEX_UNLOCK(&mutex) - return t->id; - } else { - int ret=grib_itrie_insert(last,key); + return t->id; + } + else { + int ret = grib_itrie_insert(last, key); GRIB_MUTEX_UNLOCK(&mutex) return ret; } } -int grib_itrie_insert(grib_itrie* t,const char* key) +int grib_itrie_insert(grib_itrie* t, const char* key) { - const char *k = key; - grib_itrie *last = t; + const char* k = key; + grib_itrie* last = t; int* count; - GRIB_MUTEX_INIT_ONCE(&once,&init) + GRIB_MUTEX_INIT_ONCE(&once, &init) GRIB_MUTEX_LOCK(&mutex) - count=t->count; + count = t->count; - while(*k && t) { + while (*k && t) { last = t; - t = t->next[mapping[(int)*k]]; - if(t) k++; + t = t->next[mapping[(int)*k]]; + if (t) + k++; } - if (*k!=0) { - t=last; - while(*k) { - int j = mapping[(int)*k++]; - t->next[j] = grib_itrie_new(t->context,count); - t = t->next[j]; + if (*k != 0) { + t = last; + while (*k) { + int j = mapping[(int)*k++]; + t->next[j] = grib_itrie_new(t->context, count); + t = t->next[j]; } } if (*(t->count) < MAX_NUM_CONCEPTS) { - t->id=*(t->count); + t->id = *(t->count); (*(t->count))++; - } else { - grib_context_log(t->context,GRIB_LOG_ERROR, - "grib_itrie_insert: too many accessors, increase MAX_NUM_CONCEPTS\n"); + } + else { + grib_context_log(t->context, GRIB_LOG_ERROR, + "grib_itrie_insert: too many accessors, increase MAX_NUM_CONCEPTS\n"); Assert(*(t->count) < MAX_NUM_CONCEPTS); } @@ -397,5 +400,7 @@ int grib_itrie_insert(grib_itrie* t,const char* key) return t->id; } -int grib_itrie_get_size(grib_itrie* t) {return *(t->count);} - +int grib_itrie_get_size(grib_itrie* t) +{ + return *(t->count); +} diff --git a/src/grib_itrie_keys.c b/src/grib_itrie_keys.c index 5f66aa113..c54329198 100644 --- a/src/grib_itrie_keys.c +++ b/src/grib_itrie_keys.c @@ -13,277 +13,277 @@ **************************************/ static const int mapping[] = { -0, /* 00 */ -0, /* 01 */ -0, /* 02 */ -0, /* 03 */ -0, /* 04 */ -0, /* 05 */ -0, /* 06 */ -0, /* 07 */ -0, /* 08 */ -0, /* 09 */ -0, /* 0a */ -0, /* 0b */ -0, /* 0c */ -0, /* 0d */ -0, /* 0e */ -0, /* 0f */ -0, /* 10 */ -0, /* 11 */ -0, /* 12 */ -0, /* 13 */ -0, /* 14 */ -0, /* 15 */ -0, /* 16 */ -0, /* 17 */ -0, /* 18 */ -0, /* 19 */ -0, /* 1a */ -0, /* 1b */ -0, /* 1c */ -0, /* 1d */ -0, /* 1e */ -0, /* 1f */ -0, /* 20 */ -0, /* 21 */ -0, /* 22 */ -0, /* 23 */ -0, /* 24 */ -0, /* 25 */ -0, /* 26 */ -0, /* 27 */ -0, /* 28 */ -0, /* 29 */ -0, /* 2a */ -0, /* 2b */ -0, /* 2c */ -0, /* 2d */ -38, /* . */ -39, /* / */ -1, /* 0 */ -2, /* 1 */ -3, /* 2 */ -4, /* 3 */ -5, /* 4 */ -6, /* 5 */ -7, /* 6 */ -8, /* 7 */ -9, /* 8 */ -10, /* 9 */ -0, /* 3a */ -0, /* 3b */ -0, /* 3c */ -0, /* 3d */ -0, /* 3e */ -0, /* 3f */ -0, /* 40 */ -11, /* A */ -12, /* B */ -13, /* C */ -14, /* D */ -15, /* E */ -16, /* F */ -17, /* G */ -18, /* H */ -19, /* I */ -20, /* J */ -21, /* K */ -22, /* L */ -23, /* M */ -24, /* N */ -25, /* O */ -26, /* P */ -27, /* Q */ -28, /* R */ -29, /* S */ -30, /* T */ -31, /* U */ -32, /* V */ -33, /* W */ -34, /* X */ -35, /* Y */ -36, /* Z */ -0, /* 5b */ -0, /* 5c */ -0, /* 5d */ -0, /* 5e */ -37, /* _ */ -0, /* 60 */ -38, /* a */ -39, /* b */ -40, /* c */ -41, /* d */ -42, /* e */ -43, /* f */ -44, /* g */ -45, /* h */ -46, /* i */ -47, /* j */ -48, /* k */ -49, /* l */ -50, /* m */ -51, /* n */ -52, /* o */ -53, /* p */ -54, /* q */ -55, /* r */ -56, /* s */ -57, /* t */ -58, /* u */ -59, /* v */ -60, /* w */ -61, /* x */ -62, /* y */ -63, /* z */ -0, /* 7b */ -0, /* 7c */ -0, /* 7d */ -0, /* 7e */ -0, /* 7f */ -0, /* 80 */ -0, /* 81 */ -0, /* 82 */ -0, /* 83 */ -0, /* 84 */ -0, /* 85 */ -0, /* 86 */ -0, /* 87 */ -0, /* 88 */ -0, /* 89 */ -0, /* 8a */ -0, /* 8b */ -0, /* 8c */ -0, /* 8d */ -0, /* 8e */ -0, /* 8f */ -0, /* 90 */ -0, /* 91 */ -0, /* 92 */ -0, /* 93 */ -0, /* 94 */ -0, /* 95 */ -0, /* 96 */ -0, /* 97 */ -0, /* 98 */ -0, /* 99 */ -0, /* 9a */ -0, /* 9b */ -0, /* 9c */ -0, /* 9d */ -0, /* 9e */ -0, /* 9f */ -0, /* a0 */ -0, /* a1 */ -0, /* a2 */ -0, /* a3 */ -0, /* a4 */ -0, /* a5 */ -0, /* a6 */ -0, /* a7 */ -0, /* a8 */ -0, /* a9 */ -0, /* aa */ -0, /* ab */ -0, /* ac */ -0, /* ad */ -0, /* ae */ -0, /* af */ -0, /* b0 */ -0, /* b1 */ -0, /* b2 */ -0, /* b3 */ -0, /* b4 */ -0, /* b5 */ -0, /* b6 */ -0, /* b7 */ -0, /* b8 */ -0, /* b9 */ -0, /* ba */ -0, /* bb */ -0, /* bc */ -0, /* bd */ -0, /* be */ -0, /* bf */ -0, /* c0 */ -0, /* c1 */ -0, /* c2 */ -0, /* c3 */ -0, /* c4 */ -0, /* c5 */ -0, /* c6 */ -0, /* c7 */ -0, /* c8 */ -0, /* c9 */ -0, /* ca */ -0, /* cb */ -0, /* cc */ -0, /* cd */ -0, /* ce */ -0, /* cf */ -0, /* d0 */ -0, /* d1 */ -0, /* d2 */ -0, /* d3 */ -0, /* d4 */ -0, /* d5 */ -0, /* d6 */ -0, /* d7 */ -0, /* d8 */ -0, /* d9 */ -0, /* da */ -0, /* db */ -0, /* dc */ -0, /* dd */ -0, /* de */ -0, /* df */ -0, /* e0 */ -0, /* e1 */ -0, /* e2 */ -0, /* e3 */ -0, /* e4 */ -0, /* e5 */ -0, /* e6 */ -0, /* e7 */ -0, /* e8 */ -0, /* e9 */ -0, /* ea */ -0, /* eb */ -0, /* ec */ -0, /* ed */ -0, /* ee */ -0, /* ef */ -0, /* f0 */ -0, /* f1 */ -0, /* f2 */ -0, /* f3 */ -0, /* f4 */ -0, /* f5 */ -0, /* f6 */ -0, /* f7 */ -0, /* f8 */ -0, /* f9 */ -0, /* fa */ -0, /* fb */ -0, /* fc */ -0, /* fd */ -0, /* fe */ -0, /* ff */ + 0, /* 00 */ + 0, /* 01 */ + 0, /* 02 */ + 0, /* 03 */ + 0, /* 04 */ + 0, /* 05 */ + 0, /* 06 */ + 0, /* 07 */ + 0, /* 08 */ + 0, /* 09 */ + 0, /* 0a */ + 0, /* 0b */ + 0, /* 0c */ + 0, /* 0d */ + 0, /* 0e */ + 0, /* 0f */ + 0, /* 10 */ + 0, /* 11 */ + 0, /* 12 */ + 0, /* 13 */ + 0, /* 14 */ + 0, /* 15 */ + 0, /* 16 */ + 0, /* 17 */ + 0, /* 18 */ + 0, /* 19 */ + 0, /* 1a */ + 0, /* 1b */ + 0, /* 1c */ + 0, /* 1d */ + 0, /* 1e */ + 0, /* 1f */ + 0, /* 20 */ + 0, /* 21 */ + 0, /* 22 */ + 0, /* 23 */ + 0, /* 24 */ + 0, /* 25 */ + 0, /* 26 */ + 0, /* 27 */ + 0, /* 28 */ + 0, /* 29 */ + 0, /* 2a */ + 0, /* 2b */ + 0, /* 2c */ + 0, /* 2d */ + 38, /* . */ + 39, /* / */ + 1, /* 0 */ + 2, /* 1 */ + 3, /* 2 */ + 4, /* 3 */ + 5, /* 4 */ + 6, /* 5 */ + 7, /* 6 */ + 8, /* 7 */ + 9, /* 8 */ + 10, /* 9 */ + 0, /* 3a */ + 0, /* 3b */ + 0, /* 3c */ + 0, /* 3d */ + 0, /* 3e */ + 0, /* 3f */ + 0, /* 40 */ + 11, /* A */ + 12, /* B */ + 13, /* C */ + 14, /* D */ + 15, /* E */ + 16, /* F */ + 17, /* G */ + 18, /* H */ + 19, /* I */ + 20, /* J */ + 21, /* K */ + 22, /* L */ + 23, /* M */ + 24, /* N */ + 25, /* O */ + 26, /* P */ + 27, /* Q */ + 28, /* R */ + 29, /* S */ + 30, /* T */ + 31, /* U */ + 32, /* V */ + 33, /* W */ + 34, /* X */ + 35, /* Y */ + 36, /* Z */ + 0, /* 5b */ + 0, /* 5c */ + 0, /* 5d */ + 0, /* 5e */ + 37, /* _ */ + 0, /* 60 */ + 38, /* a */ + 39, /* b */ + 40, /* c */ + 41, /* d */ + 42, /* e */ + 43, /* f */ + 44, /* g */ + 45, /* h */ + 46, /* i */ + 47, /* j */ + 48, /* k */ + 49, /* l */ + 50, /* m */ + 51, /* n */ + 52, /* o */ + 53, /* p */ + 54, /* q */ + 55, /* r */ + 56, /* s */ + 57, /* t */ + 58, /* u */ + 59, /* v */ + 60, /* w */ + 61, /* x */ + 62, /* y */ + 63, /* z */ + 0, /* 7b */ + 0, /* 7c */ + 0, /* 7d */ + 0, /* 7e */ + 0, /* 7f */ + 0, /* 80 */ + 0, /* 81 */ + 0, /* 82 */ + 0, /* 83 */ + 0, /* 84 */ + 0, /* 85 */ + 0, /* 86 */ + 0, /* 87 */ + 0, /* 88 */ + 0, /* 89 */ + 0, /* 8a */ + 0, /* 8b */ + 0, /* 8c */ + 0, /* 8d */ + 0, /* 8e */ + 0, /* 8f */ + 0, /* 90 */ + 0, /* 91 */ + 0, /* 92 */ + 0, /* 93 */ + 0, /* 94 */ + 0, /* 95 */ + 0, /* 96 */ + 0, /* 97 */ + 0, /* 98 */ + 0, /* 99 */ + 0, /* 9a */ + 0, /* 9b */ + 0, /* 9c */ + 0, /* 9d */ + 0, /* 9e */ + 0, /* 9f */ + 0, /* a0 */ + 0, /* a1 */ + 0, /* a2 */ + 0, /* a3 */ + 0, /* a4 */ + 0, /* a5 */ + 0, /* a6 */ + 0, /* a7 */ + 0, /* a8 */ + 0, /* a9 */ + 0, /* aa */ + 0, /* ab */ + 0, /* ac */ + 0, /* ad */ + 0, /* ae */ + 0, /* af */ + 0, /* b0 */ + 0, /* b1 */ + 0, /* b2 */ + 0, /* b3 */ + 0, /* b4 */ + 0, /* b5 */ + 0, /* b6 */ + 0, /* b7 */ + 0, /* b8 */ + 0, /* b9 */ + 0, /* ba */ + 0, /* bb */ + 0, /* bc */ + 0, /* bd */ + 0, /* be */ + 0, /* bf */ + 0, /* c0 */ + 0, /* c1 */ + 0, /* c2 */ + 0, /* c3 */ + 0, /* c4 */ + 0, /* c5 */ + 0, /* c6 */ + 0, /* c7 */ + 0, /* c8 */ + 0, /* c9 */ + 0, /* ca */ + 0, /* cb */ + 0, /* cc */ + 0, /* cd */ + 0, /* ce */ + 0, /* cf */ + 0, /* d0 */ + 0, /* d1 */ + 0, /* d2 */ + 0, /* d3 */ + 0, /* d4 */ + 0, /* d5 */ + 0, /* d6 */ + 0, /* d7 */ + 0, /* d8 */ + 0, /* d9 */ + 0, /* da */ + 0, /* db */ + 0, /* dc */ + 0, /* dd */ + 0, /* de */ + 0, /* df */ + 0, /* e0 */ + 0, /* e1 */ + 0, /* e2 */ + 0, /* e3 */ + 0, /* e4 */ + 0, /* e5 */ + 0, /* e6 */ + 0, /* e7 */ + 0, /* e8 */ + 0, /* e9 */ + 0, /* ea */ + 0, /* eb */ + 0, /* ec */ + 0, /* ed */ + 0, /* ee */ + 0, /* ef */ + 0, /* f0 */ + 0, /* f1 */ + 0, /* f2 */ + 0, /* f3 */ + 0, /* f4 */ + 0, /* f5 */ + 0, /* f6 */ + 0, /* f7 */ + 0, /* f8 */ + 0, /* f9 */ + 0, /* fa */ + 0, /* fb */ + 0, /* fc */ + 0, /* fd */ + 0, /* fe */ + 0, /* ff */ }; #define SIZE 64 #if GRIB_PTHREADS -static pthread_once_t once = PTHREAD_ONCE_INIT; +static pthread_once_t once = PTHREAD_ONCE_INIT; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; -static void init() { - pthread_mutexattr_t attr; - pthread_mutexattr_init(&attr); - pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init(&mutex,&attr); - pthread_mutexattr_destroy(&attr); - +static void init() +{ + pthread_mutexattr_t attr; + pthread_mutexattr_init(&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&mutex, &attr); + pthread_mutexattr_destroy(&attr); } #elif GRIB_OMP_THREADS static int once = 0; @@ -293,8 +293,7 @@ static void init() { GRIB_OMP_CRITICAL(lock_grib_itrie_keys_c) { - if (once == 0) - { + if (once == 0) { omp_init_nest_lock(&mutex); once = 1; } @@ -302,44 +301,44 @@ static void init() } #endif -struct grib_itrie { - grib_itrie* next[SIZE]; - grib_context *context; - int id; - int* count; +struct grib_itrie +{ + grib_itrie* next[SIZE]; + grib_context* context; + int id; + int* count; }; -grib_itrie *grib_hash_keys_new(grib_context* c,int* count) +grib_itrie* grib_hash_keys_new(grib_context* c, int* count) { - grib_itrie* t = (grib_itrie*)grib_context_malloc_clear(c,sizeof(grib_itrie)); - t->context = c; - t->id=-1; - t->count=count; + grib_itrie* t = (grib_itrie*)grib_context_malloc_clear(c, sizeof(grib_itrie)); + t->context = c; + t->id = -1; + t->count = count; return t; } -void grib_hash_keys_delete(grib_itrie *t) +void grib_hash_keys_delete(grib_itrie* t) { - GRIB_MUTEX_INIT_ONCE(&once,&init); + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex); - if(t) { + if (t) { int i; - for(i = 0; i < SIZE; i++) + for (i = 0; i < SIZE; i++) if (t->next[i]) grib_hash_keys_delete(t->next[i]); - grib_context_free(t->context,t); - + grib_context_free(t->context, t); } GRIB_MUTEX_UNLOCK(&mutex); } -int grib_hash_keys_get_id(grib_itrie* t,const char* key) +int grib_hash_keys_get_id(grib_itrie* t, const char* key) { - const struct grib_keys_hash* hash=grib_keys_hash_get(key,strlen(key)); + const struct grib_keys_hash* hash = grib_keys_hash_get(key, strlen(key)); if (hash) { /* printf("%s found %s (%d)\n",key,hash->name,hash->id); */ @@ -348,58 +347,62 @@ int grib_hash_keys_get_id(grib_itrie* t,const char* key) /* printf("+++ \"%s\"\n",key); */ { - const char *k=key; - grib_itrie* last=t; + const char* k = key; + grib_itrie* last = t; - GRIB_MUTEX_INIT_ONCE(&once,&init); + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex); - while(*k && t) t = t->next[mapping[(int)*k++]]; + while (*k && t) + t = t->next[mapping[(int)*k++]]; - if(t != NULL && t->id != -1) { + if (t != NULL && t->id != -1) { GRIB_MUTEX_UNLOCK(&mutex); - return t->id+TOTAL_KEYWORDS+1; - } else { - int ret=grib_hash_keys_insert(last,key); + return t->id + TOTAL_KEYWORDS + 1; + } + else { + int ret = grib_hash_keys_insert(last, key); GRIB_MUTEX_UNLOCK(&mutex); - return ret+TOTAL_KEYWORDS+1; + return ret + TOTAL_KEYWORDS + 1; } } } -int grib_hash_keys_insert(grib_itrie* t,const char* key) +int grib_hash_keys_insert(grib_itrie* t, const char* key) { - const char *k = key; - grib_itrie *last = t; + const char* k = key; + grib_itrie* last = t; int* count; - GRIB_MUTEX_INIT_ONCE(&once,&init) + GRIB_MUTEX_INIT_ONCE(&once, &init) GRIB_MUTEX_LOCK(&mutex) - count=t->count; + count = t->count; - while(*k && t) { + while (*k && t) { last = t; - t = t->next[mapping[(int)*k]]; - if(t) k++; + t = t->next[mapping[(int)*k]]; + if (t) + k++; } - if (*k!=0) { - t=last; - while(*k) { - int j = mapping[(int)*k++]; - t->next[j] = grib_hash_keys_new(t->context,count); - t = t->next[j]; + if (*k != 0) { + t = last; + while (*k) { + int j = mapping[(int)*k++]; + t->next[j] = grib_hash_keys_new(t->context, count); + t = t->next[j]; } } - if (*(t->count)+TOTAL_KEYWORDS < ACCESSORS_ARRAY_SIZE) { - t->id=*(t->count); + if (*(t->count) + TOTAL_KEYWORDS < ACCESSORS_ARRAY_SIZE) { + t->id = *(t->count); (*(t->count))++; - } else { - grib_context_log(t->context,GRIB_LOG_ERROR, - "grib_hash_keys_insert: too many accessors, increase ACCESSORS_ARRAY_SIZE\n"); - Assert(*(t->count)+TOTAL_KEYWORDS < ACCESSORS_ARRAY_SIZE); + } + else { + grib_context_log(t->context, GRIB_LOG_ERROR, + "grib_hash_keys_insert: too many accessors, increase ACCESSORS_ARRAY_SIZE\n"); + Assert(*(t->count) + TOTAL_KEYWORDS < ACCESSORS_ARRAY_SIZE); } GRIB_MUTEX_UNLOCK(&mutex) @@ -409,5 +412,7 @@ int grib_hash_keys_insert(grib_itrie* t,const char* key) return t->id; } -int grib_hash_keys_get_size(grib_itrie* t) {return *(t->count);} - +int grib_hash_keys_get_size(grib_itrie* t) +{ + return *(t->count); +} diff --git a/src/grib_jasper_encoding.c b/src/grib_jasper_encoding.c index 45a2d2ba0..97e31534a 100644 --- a/src/grib_jasper_encoding.c +++ b/src/grib_jasper_encoding.c @@ -21,33 +21,33 @@ #define MAXOPTSSIZE 1024 -int grib_jasper_decode(grib_context *c,unsigned char *buf, size_t *buflen, double *values, size_t *no_values) +int grib_jasper_decode(grib_context* c, unsigned char* buf, size_t* buflen, double* values, size_t* no_values) { /*jas_setdbglevel(99999);*/ - jas_image_t *image = NULL; - jas_stream_t *jpeg = NULL; - int code = GRIB_SUCCESS; - jas_matrix_t *matrix = NULL; - jas_image_cmpt_t *p; - int i,j,k; - - jpeg = jas_stream_memopen((char*)buf,*buflen); - if(!jpeg) { + jas_image_t* image = NULL; + jas_stream_t* jpeg = NULL; + int code = GRIB_SUCCESS; + jas_matrix_t* matrix = NULL; + jas_image_cmpt_t* p; + int i, j, k; + + jpeg = jas_stream_memopen((char*)buf, *buflen); + if (!jpeg) { code = GRIB_DECODING_ERROR; goto cleanup; } grib_context_log(c, GRIB_LOG_DEBUG, "grib_jasper_decode: Jasper version %s", jas_getversion()); - image = jpc_decode(jpeg,NULL); - if(!image) { + image = jpc_decode(jpeg, NULL); + if (!image) { code = GRIB_DECODING_ERROR; goto cleanup; } p = image->cmpts_[0]; - if (image->numcmpts_ != 1 ) { + if (image->numcmpts_ != 1) { /* Image not gray scale */ code = GRIB_DECODING_ERROR; goto cleanup; @@ -55,52 +55,55 @@ int grib_jasper_decode(grib_context *c,unsigned char *buf, size_t *buflen, doubl matrix = jas_matrix_create(jas_image_height(image), jas_image_width(image)); - if(!matrix) { + if (!matrix) { code = GRIB_DECODING_ERROR; goto cleanup; } - jas_image_readcmpt(image,0,0,0,jas_image_width(image), jas_image_height(image),matrix); + jas_image_readcmpt(image, 0, 0, 0, jas_image_width(image), jas_image_height(image), matrix); Assert(p->height_ * p->width_ == *no_values); - k=0; - for (i=0;iheight_;i++) - for (j=0;jwidth_;j++) { + k = 0; + for (i = 0; i < p->height_; i++) + for (j = 0; j < p->width_; j++) { values[k++] = matrix->rows_[i][j]; } cleanup: - if(matrix) jas_matrix_destroy(matrix); - if(image) jas_image_destroy(image); - if(jpeg) jas_stream_close(jpeg); + if (matrix) + jas_matrix_destroy(matrix); + if (image) + jas_image_destroy(image); + if (jpeg) + jas_stream_close(jpeg); return code; } -int grib_jasper_encode(grib_context *c, j2k_encode_helper *helper) +int grib_jasper_encode(grib_context* c, j2k_encode_helper* helper) { int code = GRIB_SUCCESS; int jaserr; char opts[MAXOPTSSIZE]; double reference_value = helper->reference_value; - double decimal = helper->decimal; - double divisor = helper->divisor; - const double* values = helper->values; - long no_values = helper->no_values; + double decimal = helper->decimal; + double divisor = helper->divisor; + const double* values = helper->values; + long no_values = helper->no_values; long bits8; int i; - size_t buflen = 0; - unsigned char *encoded = NULL; - unsigned char *p = NULL; + size_t buflen = 0; + unsigned char* encoded = NULL; + unsigned char* p = NULL; - jas_image_t image = {0}; - jas_stream_t *jpcstream = 0; - jas_stream_t *istream = 0; - jas_image_cmpt_t cmpt = {0,}; - jas_image_cmpt_t *pcmpt = 0; + jas_image_t image = { 0 }; + jas_stream_t* jpcstream = 0; + jas_stream_t* istream = 0; + jas_image_cmpt_t cmpt = {0,}; + jas_image_cmpt_t* pcmpt = 0; image.tlx_ = 0; image.tly_ = 0; @@ -115,26 +118,26 @@ int grib_jasper_encode(grib_context *c, j2k_encode_helper *helper) /* ECC-396: Support for Jasper 2.0 * Jasper version 1 had the 'inmem_' data member but * version 2 removed it from the interface */ - image.inmem_ = 1; + image.inmem_ = 1; #endif - cmpt.tlx_ = 0; - cmpt.tly_ = 0; - cmpt.hstep_ = 1; - cmpt.vstep_ = 1; - cmpt.width_ = helper->width; - cmpt.height_ = helper->height; - cmpt.type_ = JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_GRAY_Y); - cmpt.prec_ = helper->bits_per_value; - cmpt.sgnd_ = 0; - cmpt.cps_ = (helper->bits_per_value+7)/8; + cmpt.tlx_ = 0; + cmpt.tly_ = 0; + cmpt.hstep_ = 1; + cmpt.vstep_ = 1; + cmpt.width_ = helper->width; + cmpt.height_ = helper->height; + cmpt.type_ = JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_GRAY_Y); + cmpt.prec_ = helper->bits_per_value; + cmpt.sgnd_ = 0; + cmpt.cps_ = (helper->bits_per_value + 7) / 8; /* Simple packing encoding */ - bits8 = (helper->bits_per_value+7)/8*8; + bits8 = (helper->bits_per_value + 7) / 8 * 8; Assert(bits8 > 0); - encoded = (unsigned char*)grib_context_malloc_clear(c,bits8/8*no_values); + encoded = (unsigned char*)grib_context_malloc_clear(c, bits8 / 8 * no_values); - if(!encoded) { + if (!encoded) { code = GRIB_OUT_OF_MEMORY; goto cleanup; } @@ -142,12 +145,11 @@ int grib_jasper_encode(grib_context *c, j2k_encode_helper *helper) buflen = 0; p = encoded; - for(i=0;i< no_values;i++){ - long blen = bits8; - unsigned long unsigned_val = (unsigned long)((((values[i]*decimal)-(reference_value))*divisor)+0.5); - while(blen >= 8) - { - blen -= 8; + for (i = 0; i < no_values; i++) { + long blen = bits8; + unsigned long unsigned_val = (unsigned long)((((values[i] * decimal) - (reference_value)) * divisor) + 0.5); + while (blen >= 8) { + blen -= 8; *p = (unsigned_val >> blen); p++; buflen++; @@ -158,68 +160,73 @@ int grib_jasper_encode(grib_context *c, j2k_encode_helper *helper) opts[0] = 0; - if( helper->compression != 0) - { + if (helper->compression != 0) { /* Lossy */ - ecc_snprintf(opts, MAXOPTSSIZE, "mode=real\nrate=%f", 1.0/helper->compression); + ecc_snprintf(opts, MAXOPTSSIZE, "mode=real\nrate=%f", 1.0 / helper->compression); } Assert(cmpt.width_ * cmpt.height_ * cmpt.cps_ == buflen); grib_context_log(c, GRIB_LOG_DEBUG, "grib_jasper_encode: Jasper version %s", jas_getversion()); - pcmpt = &cmpt; - image.cmpts_ = &pcmpt; + pcmpt = &cmpt; + image.cmpts_ = &pcmpt; - istream = jas_stream_memopen((char *)encoded,buflen); - cmpt.stream_ = istream; + istream = jas_stream_memopen((char*)encoded, buflen); + cmpt.stream_ = istream; - jpcstream = jas_stream_memopen((char*)helper->jpeg_buffer,helper->buffer_size); - jaserr = jpc_encode(&image,jpcstream,opts); + jpcstream = jas_stream_memopen((char*)helper->jpeg_buffer, helper->buffer_size); + jaserr = jpc_encode(&image, jpcstream, opts); - if(jaserr != 0) { + if (jaserr != 0) { /* increase the number of guard bits */ - strcat(opts,"\nnumgbits=4"); + strcat(opts, "\nnumgbits=4"); grib_context_log(c, GRIB_LOG_ERROR, "JASPER: error %d, increasing the number of guard bits", jaserr); - jas_stream_close(istream); istream = 0; - jas_stream_close(jpcstream); jpcstream = 0; - - istream = jas_stream_memopen((char *)encoded,buflen); - cmpt.stream_ = istream; - jpcstream = jas_stream_memopen((char*)helper->jpeg_buffer,helper->buffer_size); - jaserr = jpc_encode(&image,jpcstream,opts); + jas_stream_close(istream); + istream = 0; + jas_stream_close(jpcstream); + jpcstream = 0; + + istream = jas_stream_memopen((char*)encoded, buflen); + cmpt.stream_ = istream; + jpcstream = jas_stream_memopen((char*)helper->jpeg_buffer, helper->buffer_size); + jaserr = jpc_encode(&image, jpcstream, opts); } - if ( jaserr != 0 ) { + if (jaserr != 0) { grib_context_log(c, GRIB_LOG_ERROR, "JASPER: error %d", jaserr); code = GRIB_ENCODING_ERROR; goto cleanup; } helper->jpeg_length = jpcstream->rwcnt_; - jaserr=jas_stream_close(istream); istream = 0; - jaserr=jas_stream_close(jpcstream);jpcstream = 0; + jaserr = jas_stream_close(istream); + istream = 0; + jaserr = jas_stream_close(jpcstream); + jpcstream = 0; cleanup: - grib_context_free(c,encoded); - if(istream) jas_stream_close(istream); - if(jpcstream) jas_stream_close(jpcstream); + grib_context_free(c, encoded); + if (istream) + jas_stream_close(istream); + if (jpcstream) + jas_stream_close(jpcstream); return code; } #else -int grib_jasper_decode(grib_context *c, unsigned char *buf, size_t *buflen, double *val, size_t *n_vals) +int grib_jasper_decode(grib_context* c, unsigned char* buf, size_t* buflen, double* val, size_t* n_vals) { grib_context_log(c, GRIB_LOG_ERROR, - "grib_accessor_data_jpeg2000_packing: Jasper JPEG support not enabled."); + "grib_accessor_data_jpeg2000_packing: Jasper JPEG support not enabled."); return GRIB_FUNCTIONALITY_NOT_ENABLED; } -int grib_jasper_encode(grib_context *c, j2k_encode_helper *helper) +int grib_jasper_encode(grib_context* c, j2k_encode_helper* helper) { grib_context_log(c, GRIB_LOG_ERROR, - "grib_accessor_data_jpeg2000_packing: Jasper JPEG support not enabled."); + "grib_accessor_data_jpeg2000_packing: Jasper JPEG support not enabled."); return GRIB_FUNCTIONALITY_NOT_ENABLED; } diff --git a/src/grib_keys_iterator.c b/src/grib_keys_iterator.c index 0f87a58b8..1b6d342d6 100644 --- a/src/grib_keys_iterator.c +++ b/src/grib_keys_iterator.c @@ -12,18 +12,23 @@ /* Note: A fast cut-down version of strcmp which does NOT return -1 */ /* 0 means input strings are equal and 1 means not equal */ -GRIB_INLINE static int grib_inline_strcmp(const char* a,const char* b) +GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b) { - if (*a != *b) return 1; - while((*a!=0 && *b!=0) && *(a) == *(b) ) {a++;b++;} - return (*a==0 && *b==0) ? 0 : 1; + if (*a != *b) + return 1; + while ((*a != 0 && *b != 0) && *(a) == *(b)) { + a++; + b++; + } + return (*a == 0 && *b == 0) ? 0 : 1; } -grib_keys_iterator* grib_keys_iterator_new(grib_handle* h,unsigned long filter_flags, const char* name_space) +grib_keys_iterator* grib_keys_iterator_new(grib_handle* h, unsigned long filter_flags, const char* name_space) { - grib_keys_iterator* ki=NULL; + grib_keys_iterator* ki = NULL; - if (!h) return NULL; + if (!h) + return NULL; /*if (h->product_kind == PRODUCT_BUFR) { grib_context_log(h->context, GRIB_LOG_ERROR, @@ -31,64 +36,68 @@ grib_keys_iterator* grib_keys_iterator_new(grib_handle* h,unsigned long filter_f return NULL; }*/ - ki= (grib_keys_iterator*)grib_context_malloc_clear(h->context,sizeof(grib_keys_iterator)); - if (!ki) return NULL; + ki = (grib_keys_iterator*)grib_context_malloc_clear(h->context, sizeof(grib_keys_iterator)); + if (!ki) + return NULL; ki->filter_flags = filter_flags; ki->handle = h; ki->name_space = NULL; if (name_space != NULL && strlen(name_space) > 0) - ki->name_space = grib_context_strdup(h->context,name_space); + ki->name_space = grib_context_strdup(h->context, name_space); - ki->at_start = 1; - ki->match = 0; + ki->at_start = 1; + ki->match = 0; - grib_keys_iterator_set_flags(ki,filter_flags); + grib_keys_iterator_set_flags(ki, filter_flags); return ki; } -int grib_keys_iterator_set_flags(grib_keys_iterator* ki,unsigned long flags) +int grib_keys_iterator_set_flags(grib_keys_iterator* ki, unsigned long flags) { - int ret=0; + int ret = 0; grib_handle* h; - if (!ki) return GRIB_INTERNAL_ERROR; + if (!ki) + return GRIB_INTERNAL_ERROR; - h=ki->handle; + h = ki->handle; - if((flags & GRIB_KEYS_ITERATOR_SKIP_DUPLICATES) && ki->seen==NULL ) + if ((flags & GRIB_KEYS_ITERATOR_SKIP_DUPLICATES) && ki->seen == NULL) ki->seen = grib_trie_new(h->context); /* GRIB-566 */ - if(flags & GRIB_KEYS_ITERATOR_SKIP_COMPUTED) ki->filter_flags |= GRIB_KEYS_ITERATOR_SKIP_COMPUTED; - if(flags & GRIB_KEYS_ITERATOR_SKIP_CODED) ki->filter_flags |= GRIB_KEYS_ITERATOR_SKIP_CODED; + if (flags & GRIB_KEYS_ITERATOR_SKIP_COMPUTED) + ki->filter_flags |= GRIB_KEYS_ITERATOR_SKIP_COMPUTED; + if (flags & GRIB_KEYS_ITERATOR_SKIP_CODED) + ki->filter_flags |= GRIB_KEYS_ITERATOR_SKIP_CODED; - if(flags & GRIB_KEYS_ITERATOR_SKIP_FUNCTION) + if (flags & GRIB_KEYS_ITERATOR_SKIP_FUNCTION) ki->accessor_flags_skip |= GRIB_ACCESSOR_FLAG_FUNCTION; - if(flags & GRIB_KEYS_ITERATOR_SKIP_READ_ONLY) + if (flags & GRIB_KEYS_ITERATOR_SKIP_READ_ONLY) ki->accessor_flags_skip |= GRIB_ACCESSOR_FLAG_READ_ONLY; - if(flags & GRIB_KEYS_ITERATOR_SKIP_EDITION_SPECIFIC) + if (flags & GRIB_KEYS_ITERATOR_SKIP_EDITION_SPECIFIC) ki->accessor_flags_skip |= GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; return ret; } -static void mark_seen(grib_keys_iterator* ki,const char* name) +static void mark_seen(grib_keys_iterator* ki, const char* name) { /* See GRIB-932 */ char* tmp = grib_context_strdup(ki->handle->context, name); - grib_trie_insert(ki->seen, tmp,(void*)tmp); + grib_trie_insert(ki->seen, tmp, (void*)tmp); /* grib_trie_insert(ki->seen,name,(void*)name); */ } -static int was_seen(grib_keys_iterator* ki,const char* name) +static int was_seen(grib_keys_iterator* ki, const char* name) { - return grib_trie_get(ki->seen,name) != NULL; + return grib_trie_get(ki->seen, name) != NULL; } int grib_keys_iterator_rewind(grib_keys_iterator* ki) @@ -101,35 +110,31 @@ static int skip(grib_keys_iterator* kiter) { /* TODO: set the section to hidden, to speed up that */ /* if(grib_get_sub_section(kiter->current)) */ - if(kiter->current->sub_section) + if (kiter->current->sub_section) return 1; - if(kiter->current->flags & GRIB_ACCESSOR_FLAG_HIDDEN) + if (kiter->current->flags & GRIB_ACCESSOR_FLAG_HIDDEN) return 1; - if(kiter->current->flags & kiter->accessor_flags_skip) + if (kiter->current->flags & kiter->accessor_flags_skip) return 1; - if((kiter->filter_flags & GRIB_KEYS_ITERATOR_SKIP_COMPUTED) && kiter->current->length == 0) + if ((kiter->filter_flags & GRIB_KEYS_ITERATOR_SKIP_COMPUTED) && kiter->current->length == 0) return 1; - if((kiter->filter_flags & GRIB_KEYS_ITERATOR_SKIP_CODED) && kiter->current->length != 0) + if ((kiter->filter_flags & GRIB_KEYS_ITERATOR_SKIP_CODED) && kiter->current->length != 0) return 1; - if(kiter->name_space) - { + if (kiter->name_space) { kiter->match = 0; - while(kiter->match < MAX_ACCESSOR_NAMES) - { - if(kiter->current->all_name_spaces[kiter->match] != NULL) { - if(grib_inline_strcmp(kiter->current->all_name_spaces[kiter->match],kiter->name_space) == 0) - { - if(kiter->seen) - { - if(was_seen(kiter,kiter->current->all_names[kiter->match])) + while (kiter->match < MAX_ACCESSOR_NAMES) { + if (kiter->current->all_name_spaces[kiter->match] != NULL) { + if (grib_inline_strcmp(kiter->current->all_name_spaces[kiter->match], kiter->name_space) == 0) { + if (kiter->seen) { + if (was_seen(kiter, kiter->current->all_names[kiter->match])) return 1; - mark_seen(kiter,kiter->current->all_names[kiter->match]); + mark_seen(kiter, kiter->current->all_names[kiter->match]); } return 0; } @@ -140,11 +145,10 @@ static int skip(grib_keys_iterator* kiter) return 1; } - if(kiter->seen) - { - if(was_seen(kiter,kiter->current->name)) + if (kiter->seen) { + if (was_seen(kiter, kiter->current->name)) return 1; - mark_seen(kiter,kiter->current->name); + mark_seen(kiter, kiter->current->name); } return 0; @@ -152,17 +156,15 @@ static int skip(grib_keys_iterator* kiter) int grib_keys_iterator_next(grib_keys_iterator* kiter) { - if(kiter->at_start) - { + if (kiter->at_start) { kiter->current = kiter->handle->root->block->first; kiter->at_start = 0; } - else - { + else { kiter->current = grib_next_accessor(kiter->current); } - while(kiter->current && skip(kiter)) + while (kiter->current && skip(kiter)) kiter->current = grib_next_accessor(kiter->current); return kiter->current != NULL; @@ -180,36 +182,36 @@ grib_accessor* grib_keys_iterator_get_accessor(grib_keys_iterator* kiter) return kiter->current; } -int grib_keys_iterator_delete( grib_keys_iterator* kiter) +int grib_keys_iterator_delete(grib_keys_iterator* kiter) { if (kiter) { - if(kiter->seen) + if (kiter->seen) grib_trie_delete(kiter->seen); if (kiter->name_space) - grib_context_free(kiter->handle->context,kiter->name_space); - grib_context_free(kiter->handle->context,kiter); + grib_context_free(kiter->handle->context, kiter->name_space); + grib_context_free(kiter->handle->context, kiter); } return 0; } int grib_keys_iterator_get_long(const grib_keys_iterator* kiter, long* v, size_t* len) { - return grib_unpack_long( kiter->current,v,len); + return grib_unpack_long(kiter->current, v, len); } -int grib_keys_iterator_get_double(const grib_keys_iterator* kiter,double* v,size_t* len) +int grib_keys_iterator_get_double(const grib_keys_iterator* kiter, double* v, size_t* len) { - return grib_unpack_double( kiter->current,v,len); + return grib_unpack_double(kiter->current, v, len); } -int grib_keys_iterator_get_string(const grib_keys_iterator* kiter,char* v,size_t* len) +int grib_keys_iterator_get_string(const grib_keys_iterator* kiter, char* v, size_t* len) { - return grib_unpack_string( kiter->current,v,len); + return grib_unpack_string(kiter->current, v, len); } -int grib_keys_iterator_get_bytes(const grib_keys_iterator* kiter,unsigned char* v,size_t* len) +int grib_keys_iterator_get_bytes(const grib_keys_iterator* kiter, unsigned char* v, size_t* len) { - return grib_unpack_bytes( kiter->current,v,len); + return grib_unpack_bytes(kiter->current, v, len); } int grib_keys_iterator_get_native_type(const grib_keys_iterator* kiter) diff --git a/src/grib_loader_from_array.c b/src/grib_loader_from_array.c index fe5bacfbb..9d5101b14 100644 --- a/src/grib_loader_from_array.c +++ b/src/grib_loader_from_array.c @@ -15,163 +15,162 @@ #include "grib_api_internal.h" #include -int grib_lookup_long_from_array(grib_context* gc,grib_loader* loader,const char* name,long* lvalue) +int grib_lookup_long_from_array(grib_context* gc, grib_loader* loader, const char* name, long* lvalue) { - char* strvalue=0; - size_t size=0; - char* pstr=NULL; + char* strvalue = 0; + size_t size = 0; + char* pstr = NULL; int retval; grib_associative_array* ar; - grib_runtime_type* rt=grib_runtimetype_new(gc); - int type=0; + grib_runtime_type* rt = grib_runtimetype_new(gc); + int type = 0; - ar=(grib_associative_array*)loader->data; + ar = (grib_associative_array*)loader->data; - if ((retval=grib_associative_array_get(ar,(char*)name,&rt)) != GRIB_ARRAY_SUCCESS) + if ((retval = grib_associative_array_get(ar, (char*)name, &rt)) != GRIB_ARRAY_SUCCESS) return GRIB_NOT_FOUND; - grib_runtimetype_get_type(rt,&type); + grib_runtimetype_get_type(rt, &type); switch (type) { - case GRIB_RUNTIMETYPE_LONG: - grib_runtimetype_get_long(rt,&lvalue,&size); - printf("lookup: getting long %ld\n",*lvalue); - break; - case GRIB_RUNTIMETYPE_CHAR: - *lvalue = 0; - grib_runtimetype_get_char(rt,&strvalue,&size); - printf("lookup: getting char %s\n",strvalue); - pstr=strvalue; - while(*pstr) - { - *lvalue <<= 8; - *lvalue |= *pstr++; - } - break; - default: - printf("lookup: wrong type (%d)\n",type); - return GRIB_NOT_FOUND; - break; + case GRIB_RUNTIMETYPE_LONG: + grib_runtimetype_get_long(rt, &lvalue, &size); + printf("lookup: getting long %ld\n", *lvalue); + break; + case GRIB_RUNTIMETYPE_CHAR: + *lvalue = 0; + grib_runtimetype_get_char(rt, &strvalue, &size); + printf("lookup: getting char %s\n", strvalue); + pstr = strvalue; + while (*pstr) { + *lvalue <<= 8; + *lvalue |= *pstr++; + } + break; + default: + printf("lookup: wrong type (%d)\n", type); + return GRIB_NOT_FOUND; + break; } return GRIB_SUCCESS; } -int grib_init_accessor_from_array(grib_loader* loader,grib_accessor* ga,grib_arguments* default_value) +int grib_init_accessor_from_array(grib_loader* loader, grib_accessor* ga, grib_arguments* default_value) { grib_handle* h = grib_handle_of_accessor(ga); - int retval =GRIB_SUCCESS; + int retval = GRIB_SUCCESS; char* strvalue; - size_t len=0; - int type=0; - double* dvalue=0; - long* lvalue=0; - long lval=0; - double dval=0; - int i=0; - grib_associative_array* ar=NULL; - grib_runtime_type* value=NULL; + size_t len = 0; + int type = 0; + double* dvalue = 0; + long* lvalue = 0; + long lval = 0; + double dval = 0; + int i = 0; + grib_associative_array* ar = NULL; + grib_runtime_type* value = NULL; - ar=(grib_associative_array*)loader->data; + ar = (grib_associative_array*)loader->data; - grib_context_log(h->context,GRIB_LOG_DEBUG, "Initialize %s", ga->name); + grib_context_log(h->context, GRIB_LOG_DEBUG, "Initialize %s", ga->name); - retval= grib_associative_array_get(ar,ga->name,&value); + retval = grib_associative_array_get(ar, ga->name, &value); - if((retval != GRIB_ARRAY_SUCCESS) && default_value) { - grib_context_log(h->context,GRIB_LOG_DEBUG, "Setting %s to default value", ga->name); - grib_pack_expression(ga,grib_arguments_get_expression(h,default_value,0)); + if ((retval != GRIB_ARRAY_SUCCESS) && default_value) { + grib_context_log(h->context, GRIB_LOG_DEBUG, "Setting %s to default value", ga->name); + grib_pack_expression(ga, grib_arguments_get_expression(h, default_value, 0)); return GRIB_SUCCESS; } - if(ga->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) - { - grib_context_log(h->context,GRIB_LOG_DEBUG, "Setting %s ignored (read only)", ga->name); + if (ga->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) { + grib_context_log(h->context, GRIB_LOG_DEBUG, "Setting %s ignored (read only)", ga->name); return GRIB_SUCCESS; } if (retval != GRIB_ARRAY_SUCCESS) { - grib_context_log(h->context,GRIB_LOG_DEBUG, - "Grib array error %d",retval); + grib_context_log(h->context, GRIB_LOG_DEBUG, + "Grib array error %d", retval); if ((ga->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING)) { - grib_context_log(h->context,GRIB_LOG_DEBUG, - "Setting %s ignored (optional or can be missing)", ga->name); + grib_context_log(h->context, GRIB_LOG_DEBUG, + "Setting %s ignored (optional or can be missing)", ga->name); return GRIB_SUCCESS; - } else { - grib_context_log(h->context,GRIB_LOG_ERROR, "%s required", ga->name); + } + else { + grib_context_log(h->context, GRIB_LOG_ERROR, "%s required", ga->name); return retval; } } - if (value && grib_runtimetype_get_type(value,&type) == GRIB_RUNTIMETYPE_SUCCESS) { - if (type == GRIB_RUNTIMETYPE_CHAR ) { - grib_runtimetype_get_char(value,&strvalue,&len); - switch(grib_accessor_get_native_type(ga)) { - - case GRIB_TYPE_STRING: - grib_context_log(h->context,GRIB_LOG_DEBUG, "Setting %s to string %s", - ga->name, strvalue); - grib_set_string_internal(h,ga->name,strvalue,&len); - break; - - case GRIB_TYPE_LONG: - if (!strcmp(strvalue,"MISSING")) lval=GRIB_MISSING_LONG; - else lval=atol(strvalue); - grib_context_log(h->context,GRIB_LOG_DEBUG, "Setting %s to long %d", ga->name, lval); - grib_set_long_internal(h,ga->name,lval); - break; - - case GRIB_TYPE_DOUBLE: - if (!strcmp(strvalue,"MISSING")) dval=GRIB_MISSING_DOUBLE; - else if (sscanf(strvalue,"%lg",&dval)!=1) { - grib_context_log(h->context,GRIB_LOG_ERROR, "Unable to set %s wrong value format", ga->name); - } - grib_context_log(h->context,GRIB_LOG_DEBUG, "Setting %s to double %lg (%s)", ga->name, dval,strvalue); - grib_set_double_internal(h,ga->name,dval); - break; - - case GRIB_TYPE_BYTES: - grib_context_log(h->context,GRIB_LOG_DEBUG, "Setting %s to string %s", - ga->name, strvalue); - grib_set_bytes_internal(h,ga->name,(unsigned char*)strvalue,&len); - break; - - case GRIB_TYPE_LABEL: - break; - - default: - grib_context_log(h->context,GRIB_LOG_ERROR, "Setting %s, cannot establish type %d [%s]" - , ga->name,grib_accessor_get_native_type(ga),ga->creator->cclass->name); - break; - } - } else { - - if (grib_runtimetype_get_double(value,&dvalue,&len) == GRIB_RUNTIMETYPE_SUCCESS) { - switch(grib_accessor_get_native_type(ga)) { + if (value && grib_runtimetype_get_type(value, &type) == GRIB_RUNTIMETYPE_SUCCESS) { + if (type == GRIB_RUNTIMETYPE_CHAR) { + grib_runtimetype_get_char(value, &strvalue, &len); + switch (grib_accessor_get_native_type(ga)) { + case GRIB_TYPE_STRING: + grib_context_log(h->context, GRIB_LOG_DEBUG, "Setting %s to string %s", + ga->name, strvalue); + grib_set_string_internal(h, ga->name, strvalue, &len); + break; case GRIB_TYPE_LONG: - lvalue=(long*)malloc(sizeof(long)*len); - Assert(lvalue); - for (i=0;icontext,GRIB_LOG_DEBUG, "Setting long array %s",ga->name); - grib_set_long_array(h,ga->name,lvalue,len); - free(lvalue); + if (!strcmp(strvalue, "MISSING")) + lval = GRIB_MISSING_LONG; + else + lval = atol(strvalue); + grib_context_log(h->context, GRIB_LOG_DEBUG, "Setting %s to long %d", ga->name, lval); + grib_set_long_internal(h, ga->name, lval); break; case GRIB_TYPE_DOUBLE: - grib_context_log(h->context,GRIB_LOG_DEBUG, "Setting double array %s",ga->name); - grib_set_double_array(h,ga->name,dvalue,len); + if (!strcmp(strvalue, "MISSING")) + dval = GRIB_MISSING_DOUBLE; + else if (sscanf(strvalue, "%lg", &dval) != 1) { + grib_context_log(h->context, GRIB_LOG_ERROR, "Unable to set %s wrong value format", ga->name); + } + grib_context_log(h->context, GRIB_LOG_DEBUG, "Setting %s to double %lg (%s)", ga->name, dval, strvalue); + grib_set_double_internal(h, ga->name, dval); + break; + + case GRIB_TYPE_BYTES: + grib_context_log(h->context, GRIB_LOG_DEBUG, "Setting %s to string %s", + ga->name, strvalue); + grib_set_bytes_internal(h, ga->name, (unsigned char*)strvalue, &len); + break; + + case GRIB_TYPE_LABEL: break; default: - grib_context_log(h->context,GRIB_LOG_ERROR, "Setting array %s, wrong type [%d]" - , ga->name,grib_accessor_get_native_type(ga)); + grib_context_log(h->context, GRIB_LOG_ERROR, "Setting %s, cannot establish type %d [%s]", ga->name, grib_accessor_get_native_type(ga), ga->creator->cclass->name); break; + } + } + else { + if (grib_runtimetype_get_double(value, &dvalue, &len) == GRIB_RUNTIMETYPE_SUCCESS) { + switch (grib_accessor_get_native_type(ga)) { + case GRIB_TYPE_LONG: + lvalue = (long*)malloc(sizeof(long) * len); + Assert(lvalue); + for (i = 0; i < len; i++) + lvalue[i] = (long)dvalue[i]; + grib_context_log(h->context, GRIB_LOG_DEBUG, "Setting long array %s", ga->name); + grib_set_long_array(h, ga->name, lvalue, len); + free(lvalue); + break; + + case GRIB_TYPE_DOUBLE: + grib_context_log(h->context, GRIB_LOG_DEBUG, "Setting double array %s", ga->name); + grib_set_double_array(h, ga->name, dvalue, len); + break; + + default: + grib_context_log(h->context, GRIB_LOG_ERROR, "Setting array %s, wrong type [%d]", ga->name, grib_accessor_get_native_type(ga)); + break; } - - } else - grib_context_log(h->context,GRIB_LOG_ERROR, "Unable to set %s to double, wrong type (%d)", - ga->name,type); + } + else + grib_context_log(h->context, GRIB_LOG_ERROR, "Unable to set %s to double, wrong type (%d)", + ga->name, type); } #if 0 switch(grib_accessor_get_native_type(ga)) @@ -224,7 +223,6 @@ int grib_init_accessor_from_array(grib_loader* loader,grib_accessor* ga,grib_arg break; } #endif - } return retval; diff --git a/src/grib_loader_from_file.c b/src/grib_loader_from_file.c index f5f50c1fe..045c59009 100644 --- a/src/grib_loader_from_file.c +++ b/src/grib_loader_from_file.c @@ -16,150 +16,138 @@ #include "grib_api_internal.h" #include -static int parse_in(grib_context* gc,FILE *in,const char* name,char** strvalue); +static int parse_in(grib_context* gc, FILE* in, const char* name, char** strvalue); -int grib_lookup_long_from_file(grib_context* gc,grib_loader* loader,const char* name,long* value) +int grib_lookup_long_from_file(grib_context* gc, grib_loader* loader, const char* name, long* value) { - FILE *in = (FILE*)loader->data; - char* strvalue=0; - int retval; - - if ((retval=parse_in(gc,in,name,&strvalue)) != GRIB_SUCCESS) - return retval; - - if(isdigit(*strvalue)) - { - *value = atol(strvalue); - grib_context_log(gc,GRIB_LOG_DEBUG, "One digit string %s converted to %ld (long)", strvalue, *value); - } - else - { - - *value = 0; - - while(*strvalue) - { - *value <<= 8; - *value |= *strvalue++; - } - grib_context_log(gc,GRIB_LOG_DEBUG, "Value %s converted to %ld (long)", strvalue, *value); - } - /* TO DO free strvalue */ - return retval; + FILE* in = (FILE*)loader->data; + char* strvalue = 0; + int retval; + + if ((retval = parse_in(gc, in, name, &strvalue)) != GRIB_SUCCESS) + return retval; + + if (isdigit(*strvalue)) { + *value = atol(strvalue); + grib_context_log(gc, GRIB_LOG_DEBUG, "One digit string %s converted to %ld (long)", strvalue, *value); + } + else { + *value = 0; + + while (*strvalue) { + *value <<= 8; + *value |= *strvalue++; + } + grib_context_log(gc, GRIB_LOG_DEBUG, "Value %s converted to %ld (long)", strvalue, *value); + } + /* TO DO free strvalue */ + return retval; } -int grib_init_accessor_from_file(grib_loader* loader,grib_accessor* ga,grib_arguments* default_value) +int grib_init_accessor_from_file(grib_loader* loader, grib_accessor* ga, grib_arguments* default_value) { - grib_handle* h = grib_handle_of_accessor(ga); - - FILE *in = (FILE*)loader->data; - int retval =GRIB_SUCCESS; - char* strvalue=0; - size_t len=0; - long lval; - double dval; - - grib_context_log(h->context,GRIB_LOG_INFO, "Initialize %s", ga->name); - - if(default_value) - { - grib_context_log(h->context,GRIB_LOG_INFO, "Setting %s to default value", ga->name); - grib_pack_expression(ga,grib_arguments_get_expression(h,default_value,0)); - return GRIB_SUCCESS; - } - - if(ga->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) - { - grib_context_log(h->context,GRIB_LOG_INFO, "Setting %s ignored (read only)", ga->name); - return GRIB_SUCCESS; - } - - if ((retval=parse_in(h->context,in,ga->name,&strvalue)) != GRIB_SUCCESS) - return retval; - - if (strvalue) { - len=strlen(strvalue); - - switch(grib_accessor_get_native_type(ga)) - { - case GRIB_TYPE_STRING: - grib_context_log(h->context,GRIB_LOG_DEBUG, "Setting %s to string %s", ga->name, strvalue); - grib_set_string_internal(h,ga->name,strvalue,&len); - break; - - case GRIB_TYPE_LONG: - lval = strtol(strvalue,NULL,10); - grib_context_log(h->context,GRIB_LOG_DEBUG, "Setting %s to long %d", ga->name, lval); - grib_set_long_internal(h,ga->name,lval); - break; - - case GRIB_TYPE_DOUBLE: - dval = atof(strvalue); - grib_context_log(h->context,GRIB_LOG_DEBUG, "Setting %s to double %e", ga->name, dval); - grib_set_double_internal(h,ga->name,dval); - break; - - case GRIB_TYPE_BYTES: - len=strlen(strvalue); - grib_set_bytes_internal(h,ga->name,(unsigned char*)strvalue,&len); - break; - - case GRIB_TYPE_LABEL: - break; - - default: - grib_context_log(h->context,GRIB_LOG_ERROR, "Setting %s, cannot establish type %d [%s]" - , ga->name,grib_accessor_get_native_type(ga),ga->creator->cclass->name); - break; - } - - - } - /* TO DO free strvalue */ - return retval; - + grib_handle* h = grib_handle_of_accessor(ga); + + FILE* in = (FILE*)loader->data; + int retval = GRIB_SUCCESS; + char* strvalue = 0; + size_t len = 0; + long lval; + double dval; + + grib_context_log(h->context, GRIB_LOG_INFO, "Initialize %s", ga->name); + + if (default_value) { + grib_context_log(h->context, GRIB_LOG_INFO, "Setting %s to default value", ga->name); + grib_pack_expression(ga, grib_arguments_get_expression(h, default_value, 0)); + return GRIB_SUCCESS; + } + + if (ga->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) { + grib_context_log(h->context, GRIB_LOG_INFO, "Setting %s ignored (read only)", ga->name); + return GRIB_SUCCESS; + } + + if ((retval = parse_in(h->context, in, ga->name, &strvalue)) != GRIB_SUCCESS) + return retval; + + if (strvalue) { + len = strlen(strvalue); + + switch (grib_accessor_get_native_type(ga)) { + case GRIB_TYPE_STRING: + grib_context_log(h->context, GRIB_LOG_DEBUG, "Setting %s to string %s", ga->name, strvalue); + grib_set_string_internal(h, ga->name, strvalue, &len); + break; + + case GRIB_TYPE_LONG: + lval = strtol(strvalue, NULL, 10); + grib_context_log(h->context, GRIB_LOG_DEBUG, "Setting %s to long %d", ga->name, lval); + grib_set_long_internal(h, ga->name, lval); + break; + + case GRIB_TYPE_DOUBLE: + dval = atof(strvalue); + grib_context_log(h->context, GRIB_LOG_DEBUG, "Setting %s to double %e", ga->name, dval); + grib_set_double_internal(h, ga->name, dval); + break; + + case GRIB_TYPE_BYTES: + len = strlen(strvalue); + grib_set_bytes_internal(h, ga->name, (unsigned char*)strvalue, &len); + break; + + case GRIB_TYPE_LABEL: + break; + + default: + grib_context_log(h->context, GRIB_LOG_ERROR, "Setting %s, cannot establish type %d [%s]", ga->name, grib_accessor_get_native_type(ga), ga->creator->cclass->name); + break; + } + } + /* TO DO free strvalue */ + return retval; } -static int parse_in(grib_context* gc,FILE *in,const char* name,char** strvalue) { - - char line[1024]; - char *tok=NULL; - char escape[]="!!!"; - - printf("Please enter [%s]\n",name); - - if (!fgets(line,sizeof(line)-1,in)) { - grib_context_log(gc,GRIB_LOG_DEBUG, "End of file reached"); - return GRIB_END_OF_FILE; - } - - line[strlen(line)-1] = 0; - grib_context_log(gc,GRIB_LOG_DEBUG, "Parsing: \"%s\"",line); - - if (strncmp(line,escape,strlen(escape))==0) { - grib_context_log(gc,GRIB_LOG_DEBUG, "Escape %s matched",escape); - return GRIB_END_OF_FILE; - } - - if (*line) { - tok=strtok(line," ="); - } - - if (!tok || *tok == '#' || strcmp(tok,name)!=0) { - parse_in(gc,in,name,strvalue); - } - else - { - tok=strtok(NULL," =["); - - if (!tok) { - parse_in(gc,in,name,strvalue); - } else { - *strvalue=tok; - grib_context_log(gc,GRIB_LOG_DEBUG, "Value parsed as string: \"%s\"",tok); - } - - } - - return GRIB_SUCCESS; +static int parse_in(grib_context* gc, FILE* in, const char* name, char** strvalue) +{ + char line[1024]; + char* tok = NULL; + char escape[] = "!!!"; + + printf("Please enter [%s]\n", name); + + if (!fgets(line, sizeof(line) - 1, in)) { + grib_context_log(gc, GRIB_LOG_DEBUG, "End of file reached"); + return GRIB_END_OF_FILE; + } + + line[strlen(line) - 1] = 0; + grib_context_log(gc, GRIB_LOG_DEBUG, "Parsing: \"%s\"", line); + + if (strncmp(line, escape, strlen(escape)) == 0) { + grib_context_log(gc, GRIB_LOG_DEBUG, "Escape %s matched", escape); + return GRIB_END_OF_FILE; + } + + if (*line) { + tok = strtok(line, " ="); + } + + if (!tok || *tok == '#' || strcmp(tok, name) != 0) { + parse_in(gc, in, name, strvalue); + } + else { + tok = strtok(NULL, " =["); + + if (!tok) { + parse_in(gc, in, name, strvalue); + } + else { + *strvalue = tok; + grib_context_log(gc, GRIB_LOG_DEBUG, "Value parsed as string: \"%s\"", tok); + } + } + + return GRIB_SUCCESS; } diff --git a/src/grib_loader_from_handle.c b/src/grib_loader_from_handle.c index ae27d5793..1b251ba6e 100644 --- a/src/grib_loader_from_handle.c +++ b/src/grib_loader_from_handle.c @@ -10,35 +10,30 @@ #include "grib_api_internal.h" -static int copy_values(grib_handle* h,grib_accessor* ga) +static int copy_values(grib_handle* h, grib_accessor* ga) { - int i,j,k; + int i, j, k; /* printf("copy_values stack is %ld\n",(long)h->values_stack);*/ - for(j = 0; j < h->values_stack; j++) - { - for(i = 0; i < h->values_count[j]; i++) - { - for(k = 0; (k < MAX_ACCESSOR_NAMES) && (ga->all_names[k] != NULL); k++) - { + for (j = 0; j < h->values_stack; j++) { + for (i = 0; i < h->values_count[j]; i++) { + for (k = 0; (k < MAX_ACCESSOR_NAMES) && (ga->all_names[k] != NULL); k++) { /*printf("copy_values: %s %s\n",h->values[j][i].name,ga->all_names[k]);*/ - if(strcmp(h->values[j][i].name,ga->all_names[k]) == 0) - { + if (strcmp(h->values[j][i].name, ga->all_names[k]) == 0) { size_t len = 1; /*printf("SET VALUES %s\n",h->values[j][i].name);*/ - switch(h->values[j][i].type) - { - case GRIB_TYPE_LONG: - return grib_pack_long(ga,&h->values[j][i].long_value,&len); - break; - - case GRIB_TYPE_DOUBLE: - return grib_pack_double(ga,&h->values[j][i].double_value,&len); - break; - - case GRIB_TYPE_STRING: - len = strlen(h->values[j][i].string_value); - return grib_pack_string(ga,h->values[j][i].string_value,&len); - break; + switch (h->values[j][i].type) { + case GRIB_TYPE_LONG: + return grib_pack_long(ga, &h->values[j][i].long_value, &len); + break; + + case GRIB_TYPE_DOUBLE: + return grib_pack_double(ga, &h->values[j][i].double_value, &len); + break; + + case GRIB_TYPE_STRING: + len = strlen(h->values[j][i].string_value); + return grib_pack_string(ga, h->values[j][i].string_value, &len); + break; } } } @@ -48,14 +43,15 @@ static int copy_values(grib_handle* h,grib_accessor* ga) return GRIB_NOT_FOUND; } -int grib_lookup_long_from_handle(grib_context* gc,grib_loader* loader,const char* name,long* value) +int grib_lookup_long_from_handle(grib_context* gc, grib_loader* loader, const char* name, long* value) { - grib_handle* h = (grib_handle*)loader->data; - grib_accessor *b = grib_find_accessor(h,name); - size_t len = 1; - if(b) return grib_unpack_long(b,value,&len); + grib_handle* h = (grib_handle*)loader->data; + grib_accessor* b = grib_find_accessor(h, name); + size_t len = 1; + if (b) + return grib_unpack_long(b, value, &len); - /* TODO: fix me. For now, we don't fail on a lookup. */ + /* TODO: fix me. For now, we don't fail on a lookup. */ #if 1 *value = -1; return GRIB_SUCCESS; @@ -64,41 +60,39 @@ int grib_lookup_long_from_handle(grib_context* gc,grib_loader* loader,const char #endif } -int grib_init_accessor_from_handle(grib_loader* loader,grib_accessor* ga,grib_arguments* default_value) +int grib_init_accessor_from_handle(grib_loader* loader, grib_accessor* ga, grib_arguments* default_value) { - grib_handle* h = (grib_handle*)loader->data; - int ret = GRIB_SUCCESS; - size_t len = 0; - char* sval = NULL; - unsigned char* uval = NULL; - long* lval = NULL; - double* dval = NULL; + grib_handle* h = (grib_handle*)loader->data; + int ret = GRIB_SUCCESS; + size_t len = 0; + char* sval = NULL; + unsigned char* uval = NULL; + long* lval = NULL; + double* dval = NULL; #ifdef DEBUG - static int first = 1; + static int first = 1; static const char* missing = 0; #endif const char* name = NULL; - int k = 0; - grib_handle *g; - grib_accessor* ao=NULL; + int k = 0; + grib_handle* g; + grib_accessor* ao = NULL; int e, pack_missing = 0; - grib_context_log(h->context,GRIB_LOG_DEBUG, "XXXXX Copying %s", ga->name); + grib_context_log(h->context, GRIB_LOG_DEBUG, "XXXXX Copying %s", ga->name); - if(default_value) - { - grib_context_log(h->context,GRIB_LOG_DEBUG, "Copying: setting %s to default value", - ga->name); - grib_pack_expression(ga,grib_arguments_get_expression(h,default_value,0)); + if (default_value) { + grib_context_log(h->context, GRIB_LOG_DEBUG, "Copying: setting %s to default value", + ga->name); + grib_pack_expression(ga, grib_arguments_get_expression(h, default_value, 0)); } - if( (ga->flags & GRIB_ACCESSOR_FLAG_NO_COPY) || - ((ga->flags & GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC) && - loader->changing_edition ) || - (ga->flags & GRIB_ACCESSOR_FLAG_FUNCTION) || - ( (ga->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) && - !(ga->flags & GRIB_ACCESSOR_FLAG_COPY_OK) ) ) - { - grib_context_log(h->context,GRIB_LOG_DEBUG, "Copying %s ignored", ga->name); + if ((ga->flags & GRIB_ACCESSOR_FLAG_NO_COPY) || + ((ga->flags & GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC) && + loader->changing_edition) || + (ga->flags & GRIB_ACCESSOR_FLAG_FUNCTION) || + ((ga->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) && + !(ga->flags & GRIB_ACCESSOR_FLAG_COPY_OK))) { + grib_context_log(h->context, GRIB_LOG_DEBUG, "Copying %s ignored", ga->name); return GRIB_SUCCESS; } @@ -120,10 +114,9 @@ int grib_init_accessor_from_handle(grib_loader* loader,grib_accessor* ga,grib_ar */ g = h; - while(g) - { - if(copy_values(g,ga) == GRIB_SUCCESS) { - grib_context_log(h->context,GRIB_LOG_DEBUG, "Copying: setting %s to multi-set-value", ga->name); + while (g) { + if (copy_values(g, ga) == GRIB_SUCCESS) { + grib_context_log(h->context, GRIB_LOG_DEBUG, "Copying: setting %s to multi-set-value", ga->name); return GRIB_SUCCESS; } g = g->main; @@ -132,145 +125,131 @@ int grib_init_accessor_from_handle(grib_loader* loader,grib_accessor* ga,grib_ar /* Check if the same name exists in the original message ... */ k = 0; - while( (k < MAX_ACCESSOR_NAMES) && - ((name = ga->all_names[k]) != NULL) && - ((ret = grib_get_size(h,name,&len)) != GRIB_SUCCESS)) k++; + while ((k < MAX_ACCESSOR_NAMES) && + ((name = ga->all_names[k]) != NULL) && + ((ret = grib_get_size(h, name, &len)) != GRIB_SUCCESS)) + k++; - if(ret != GRIB_SUCCESS) - { + if (ret != GRIB_SUCCESS) { name = ga->name; #ifdef DEBUG - if(first) - { + if (first) { missing = codes_getenv("ECCODES_PRINT_MISSING"); - first = 0; + first = 0; } #endif - grib_context_log(h->context,GRIB_LOG_DEBUG, "Copying [%s] failed: %s", - name,grib_get_error_message(ret)); + grib_context_log(h->context, GRIB_LOG_DEBUG, "Copying [%s] failed: %s", + name, grib_get_error_message(ret)); #ifdef DEBUG - if(missing) - { - fprintf(stdout,"REPARSE: no value for %s",name); - if(default_value) - fprintf(stdout," (default value)"); - fprintf(stdout,"\n"); + if (missing) { + fprintf(stdout, "REPARSE: no value for %s", name); + if (default_value) + fprintf(stdout, " (default value)"); + fprintf(stdout, "\n"); } #endif return GRIB_SUCCESS; } /* we copy also virtual keys*/ - if(len == 0) { - grib_context_log(h->context,GRIB_LOG_DEBUG, "Copying %s failed, length is 0", name); + if (len == 0) { + grib_context_log(h->context, GRIB_LOG_DEBUG, "Copying %s failed, length is 0", name); return GRIB_SUCCESS; } - if((ga->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) && grib_is_missing(h,name,&e) && e == GRIB_SUCCESS && len == 1) - { + if ((ga->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) && grib_is_missing(h, name, &e) && e == GRIB_SUCCESS && len == 1) { grib_pack_missing(ga); pack_missing = 1; } - switch(grib_accessor_get_native_type(ga)) - { - case GRIB_TYPE_STRING: + switch (grib_accessor_get_native_type(ga)) { + case GRIB_TYPE_STRING: - /*_grib_get_string_length(ga,&len); See ECC-490 */ - grib_get_string_length(h,name,&len); - sval = (char*)grib_context_malloc(h->context,len); - ret = grib_get_string_internal(h,name,sval,&len); - if(ret == GRIB_SUCCESS) - { - grib_context_log(h->context,GRIB_LOG_DEBUG, "Copying string %s to %s", sval, name); - ret = grib_pack_string(ga,sval,&len); - } - grib_context_free(h->context,sval); + /*_grib_get_string_length(ga,&len); See ECC-490 */ + grib_get_string_length(h, name, &len); + sval = (char*)grib_context_malloc(h->context, len); + ret = grib_get_string_internal(h, name, sval, &len); + if (ret == GRIB_SUCCESS) { + grib_context_log(h->context, GRIB_LOG_DEBUG, "Copying string %s to %s", sval, name); + ret = grib_pack_string(ga, sval, &len); + } + grib_context_free(h->context, sval); - break; + break; - case GRIB_TYPE_LONG: - lval = (long*)grib_context_malloc(h->context,len*sizeof(long)); - ret = grib_get_long_array_internal(h,name,lval,&len); - if(ret == GRIB_SUCCESS) - { - grib_context_log(h->context,GRIB_LOG_DEBUG, "Copying %d long(s) %d to %s", len, lval[0], name); - if(ga->same) - { - ret = grib_set_long_array(grib_handle_of_accessor(ga),ga->name,lval,len); - - /* Allow for lists to be resized */ - if((ret == GRIB_WRONG_ARRAY_SIZE || ret == GRIB_ARRAY_TOO_SMALL) && loader->list_is_resized) - ret = GRIB_SUCCESS; - } - else - { - /* See GRIB-492. This is NOT an ideal solution! */ - if (*lval == GRIB_MISSING_LONG || pack_missing) - { - ; /* No checks needed */ + case GRIB_TYPE_LONG: + lval = (long*)grib_context_malloc(h->context, len * sizeof(long)); + ret = grib_get_long_array_internal(h, name, lval, &len); + if (ret == GRIB_SUCCESS) { + grib_context_log(h->context, GRIB_LOG_DEBUG, "Copying %d long(s) %d to %s", len, lval[0], name); + if (ga->same) { + ret = grib_set_long_array(grib_handle_of_accessor(ga), ga->name, lval, len); + + /* Allow for lists to be resized */ + if ((ret == GRIB_WRONG_ARRAY_SIZE || ret == GRIB_ARRAY_TOO_SMALL) && loader->list_is_resized) + ret = GRIB_SUCCESS; } - else - { - /* If we have just one key of type long which has one octet, then do not exceed maximum value */ - const long num_octets = ga->length; - if (len == 1 && num_octets == 1 && *lval > 255) - { - *lval = 0; /* Reset to a reasonable value */ + else { + /* See GRIB-492. This is NOT an ideal solution! */ + if (*lval == GRIB_MISSING_LONG || pack_missing) { + ; /* No checks needed */ } + else { + /* If we have just one key of type long which has one octet, then do not exceed maximum value */ + const long num_octets = ga->length; + if (len == 1 && num_octets == 1 && *lval > 255) { + *lval = 0; /* Reset to a reasonable value */ + } + } + ret = grib_pack_long(ga, lval, &len); } - ret = grib_pack_long(ga,lval,&len); } - } - grib_context_free(h->context,lval); + grib_context_free(h->context, lval); - break; + break; - case GRIB_TYPE_DOUBLE: - dval = (double*)grib_context_malloc(h->context,len*sizeof(double)); - ret = grib_get_double_array(h,name,dval,&len); /* GRIB-898 */ - if(ret == GRIB_SUCCESS) - { - grib_context_log(h->context,GRIB_LOG_DEBUG, "Copying %d double(s) %g to %s", len, dval[0], name); - if(ga->same) - { - ret = grib_set_double_array(grib_handle_of_accessor(ga),ga->name,dval,len); - - /* Allow for lists to be resized */ - if((ret == GRIB_WRONG_ARRAY_SIZE || ret == GRIB_ARRAY_TOO_SMALL) && loader->list_is_resized) - ret = GRIB_SUCCESS; + case GRIB_TYPE_DOUBLE: + dval = (double*)grib_context_malloc(h->context, len * sizeof(double)); + ret = grib_get_double_array(h, name, dval, &len); /* GRIB-898 */ + if (ret == GRIB_SUCCESS) { + grib_context_log(h->context, GRIB_LOG_DEBUG, "Copying %d double(s) %g to %s", len, dval[0], name); + if (ga->same) { + ret = grib_set_double_array(grib_handle_of_accessor(ga), ga->name, dval, len); + + /* Allow for lists to be resized */ + if ((ret == GRIB_WRONG_ARRAY_SIZE || ret == GRIB_ARRAY_TOO_SMALL) && loader->list_is_resized) + ret = GRIB_SUCCESS; + } + else + ret = grib_pack_double(ga, dval, &len); } - else ret = grib_pack_double(ga,dval,&len); - } - grib_context_free(h->context,dval); - break; + grib_context_free(h->context, dval); + break; - case GRIB_TYPE_BYTES: + case GRIB_TYPE_BYTES: - ao=grib_find_accessor(h,name); - len=grib_byte_count(ao); - uval = (unsigned char*)grib_context_malloc(h->context,len*sizeof(char)); - ret=grib_unpack_bytes(ao,uval,&len); - /* ret = grib_get_bytes_internal(h,name,uval,&len); */ - if(ret == GRIB_SUCCESS) - { - grib_context_log(h->context,GRIB_LOG_DEBUG, "Copying %d byte(s) to %s", len, name); - ret = grib_pack_bytes(ga,uval,&len); - } + ao = grib_find_accessor(h, name); + len = grib_byte_count(ao); + uval = (unsigned char*)grib_context_malloc(h->context, len * sizeof(char)); + ret = grib_unpack_bytes(ao, uval, &len); + /* ret = grib_get_bytes_internal(h,name,uval,&len); */ + if (ret == GRIB_SUCCESS) { + grib_context_log(h->context, GRIB_LOG_DEBUG, "Copying %d byte(s) to %s", len, name); + ret = grib_pack_bytes(ga, uval, &len); + } - grib_context_free(h->context,uval); + grib_context_free(h->context, uval); - break; + break; - case GRIB_TYPE_LABEL: - break; + case GRIB_TYPE_LABEL: + break; - default: - grib_context_log(h->context,GRIB_LOG_ERROR, "Copying %s, cannot establish type %d [%s]" - , name,grib_accessor_get_native_type(ga),ga->creator->cclass->name); - break; + default: + grib_context_log(h->context, GRIB_LOG_ERROR, "Copying %s, cannot establish type %d [%s]", name, grib_accessor_get_native_type(ga), ga->creator->cclass->name); + break; } return ret; diff --git a/src/grib_memory.c b/src/grib_memory.c index 43ef41dbd..6de8059f3 100644 --- a/src/grib_memory.c +++ b/src/grib_memory.c @@ -15,28 +15,27 @@ #if MANAGE_MEM #if GRIB_PTHREADS -static pthread_once_t once = PTHREAD_ONCE_INIT; +static pthread_once_t once = PTHREAD_ONCE_INIT; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; -static void init() { - pthread_mutexattr_t attr; - - pthread_mutexattr_init(&attr); - pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init(&mutex,&attr); - pthread_mutexattr_destroy(&attr); +static void init() +{ + pthread_mutexattr_t attr; + pthread_mutexattr_init(&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&mutex, &attr); + pthread_mutexattr_destroy(&attr); } #elif GRIB_OMP_THREADS -static int once = 0; +static int once = 0; static omp_nest_lock_t mutex; static void init() { GRIB_OMP_CRITICAL(lock_grib_memory_c) { - if (once == 0) - { + if (once == 0) { omp_init_nest_lock(&mutex); once = 1; } @@ -44,34 +43,37 @@ static void init() } #endif -union align { - double d; - int n; - void * p; - long l; +union align +{ + double d; + int n; + void* p; + long l; }; #define WORD sizeof(union align) static size_t page_size = 0; -typedef struct { - int pages; /* Number of pages to allocate */ - int clear; /* clear newly allocated memory */ - int first; /* Allocate in first only */ - void *priv; +typedef struct +{ + int pages; /* Number of pages to allocate */ + int clear; /* clear newly allocated memory */ + int first; /* Allocate in first only */ + void* priv; } mempool; -typedef struct memblk { - struct memblk *next; - long cnt; - size_t left; - size_t size; - char buffer[WORD]; +typedef struct memblk +{ + struct memblk* next; + long cnt; + size_t left; + size_t size; + char buffer[WORD]; } memblk; -static memblk *reserve = NULL; +static memblk* reserve = NULL; /* typedef struct memprocs { @@ -83,130 +85,127 @@ static memblk *reserve = NULL; static memprocs *mprocs = NULL; */ -#define HEADER_SIZE (sizeof(memblk) - WORD) +#define HEADER_SIZE (sizeof(memblk) - WORD) static mempool _transient_mem = { - 10, - 0, - 1, + 10, + 0, + 1, }; -static mempool *transient_mem = &_transient_mem; +static mempool* transient_mem = &_transient_mem; static mempool _permanent_mem = { - 10, - 0, - 1, + 10, + 0, + 1, }; -static mempool *permanent_mem = &_permanent_mem; +static mempool* permanent_mem = &_permanent_mem; -static void *fast_new(size_t s,mempool *pool) +static void* fast_new(size_t s, mempool* pool) { - char *p; - memblk *m; + char* p; + memblk* m; + + GRIB_MUTEX_INIT_ONCE(&once, &init) + GRIB_MUTEX_LOCK(&mutex) - GRIB_MUTEX_INIT_ONCE(&once,&init) - GRIB_MUTEX_LOCK(&mutex) + m = (memblk*)pool->priv; - m = (memblk*)pool->priv; + /* align */ - /* align */ + s = ((s + WORD - 1) / WORD) * WORD; - s = ((s+WORD-1)/WORD)*WORD; + if (pool->first) { + if (m && (m->left < s)) + m = NULL; + } - if(pool->first) - { - if(m && (m->left < s)) - m = NULL; - } + while (m && (m->left < s)) + m = m->next; - while(m && (m->left < s)) - m = m->next; + if (m == NULL) { + memblk* p; + size_t size; + if (!page_size) + page_size = getpagesize(); - if(m == NULL) - { - memblk *p; - size_t size; - if(!page_size) page_size = getpagesize(); + size = page_size * pool->pages; - size = page_size*pool->pages; + if (s > size - HEADER_SIZE) { + /* marslog(LOG_WARN,"Object of %d bytes is too big for grib_fast_new",s); */ + /* marslog(LOG_WARN,"Block size if %d bytes", size - HEADER_SIZE); */ + size = ((s + HEADER_SIZE + (page_size - 1)) / page_size) * page_size; + } - if(s > size - HEADER_SIZE) - { - /* marslog(LOG_WARN,"Object of %d bytes is too big for grib_fast_new",s); */ - /* marslog(LOG_WARN,"Block size if %d bytes", size - HEADER_SIZE); */ - size = ((s + HEADER_SIZE + (page_size-1)) / page_size) * page_size; - } + p = (memblk*)(pool->clear ? calloc(size, 1) : malloc(size)); + if (!p) { + GRIB_MUTEX_UNLOCK(&mutex) + return NULL; + } - p = (memblk*)(pool->clear?calloc(size,1):malloc(size)); - if(!p) { - GRIB_MUTEX_UNLOCK(&mutex) - return NULL; + p->next = (memblk*)pool->priv; + p->cnt = 0; + p->size = p->left = size - HEADER_SIZE; + m = p; + pool->priv = (void*)p; } - p->next = (memblk*)pool->priv; - p->cnt = 0; - p->size = p->left = size-HEADER_SIZE; - m = p; - pool->priv = (void*)p; - } - - p = &m->buffer[m->size - m->left]; - m->left -= s; - m->cnt++; + p = &m->buffer[m->size - m->left]; + m->left -= s; + m->cnt++; - GRIB_MUTEX_UNLOCK(&mutex) + GRIB_MUTEX_UNLOCK(&mutex) - return p; + return p; } - -static void fast_delete(void *p,mempool *pool) +static void fast_delete(void* p, mempool* pool) { - memblk *m ; - memblk *n = NULL; - - GRIB_MUTEX_INIT_ONCE(&once,&init) - GRIB_MUTEX_LOCK(&mutex) - - m = (memblk*)pool->priv; + memblk* m; + memblk* n = NULL; + + GRIB_MUTEX_INIT_ONCE(&once, &init) + GRIB_MUTEX_LOCK(&mutex) + + m = (memblk*)pool->priv; + + while (m) { + if (((char*)p >= (char*)&m->buffer[0]) && + ((char*)p < (char*)&m->buffer[m->size])) { + m->cnt--; + if (m->cnt == 0) { + if (n) + n->next = m->next; + else + pool->priv = (void*)m->next; + free((void*)m); + } + GRIB_MUTEX_UNLOCK(&mutex) + return; + } - while(m) - { - if( ((char*)p >= (char*)&m->buffer[0]) && - ((char*)p < (char*)&m->buffer[m->size])) - { - m->cnt--; - if(m->cnt == 0) - { - if(n) n->next = m->next; - else pool->priv = (void*)m->next; - free((void*)m); - } - GRIB_MUTEX_UNLOCK(&mutex) - return; + n = m; + m = m->next; } - - n = m; - m = m->next; - } - Assert(1==0); + Assert(1 == 0); } -static void *fast_realloc(void *p,size_t s,mempool *pool) +static void* fast_realloc(void* p, size_t s, mempool* pool) { - void *q; + void* q; - /* I'll come back here later... */ + /* I'll come back here later... */ - if((q = fast_new(s,pool)) == NULL) return NULL; - memcpy(q,p,s); + if ((q = fast_new(s, pool)) == NULL) + return NULL; + memcpy(q, p, s); - fast_delete(p,pool); + fast_delete(p, pool); - return q; + return q; } #if 0 @@ -246,102 +245,99 @@ static void *fast_realloc(void *p,size_t s,mempool *pool) */ #endif -void *grib_transient_malloc(const grib_context* c,size_t s) +void* grib_transient_malloc(const grib_context* c, size_t s) { - return fast_new(s,transient_mem); + return fast_new(s, transient_mem); } -void *grib_transient_realloc(const grib_context* c,void *p,size_t s) +void* grib_transient_realloc(const grib_context* c, void* p, size_t s) { - return fast_realloc(p,s,transient_mem); + return fast_realloc(p, s, transient_mem); } -void grib_transient_free(const grib_context* c,void* p) +void grib_transient_free(const grib_context* c, void* p) { - fast_delete(p,transient_mem); + fast_delete(p, transient_mem); } -void *grib_permanent_malloc(const grib_context* c,size_t s) +void* grib_permanent_malloc(const grib_context* c, size_t s) { - return fast_new(s,permanent_mem); + return fast_new(s, permanent_mem); } -void *grib_permanent_realloc(const grib_context* c,void *p,size_t s) +void* grib_permanent_realloc(const grib_context* c, void* p, size_t s) { - return fast_realloc(p,s,permanent_mem); + return fast_realloc(p, s, permanent_mem); } -void grib_permanent_free(const grib_context* c,void* p) +void grib_permanent_free(const grib_context* c, void* p) { - fast_delete(p,permanent_mem); + fast_delete(p, permanent_mem); } -void *grib_buffer_malloc(const grib_context* c,size_t s) +void* grib_buffer_malloc(const grib_context* c, size_t s) { - memblk *r; - - GRIB_MUTEX_INIT_ONCE(&once,&init) - GRIB_MUTEX_LOCK(&mutex) - - s = ((s+WORD-1)/WORD)*WORD; - r = reserve; - while(r) - { - if(r->cnt == 0 && r->size == s) - break; - r = r->next; - } - - if(r) - { - /* marslog(LOG_DBUG,"Reusing %ld bytes %d",s,r->size); */ - } - else - { - size_t size = s + HEADER_SIZE; - /* marslog(LOG_DBUG,"Allocating %d (%d)bytes",s,size); */ - r = (memblk*)malloc(size); - if(!r) return NULL; - r->next = reserve; - reserve = r; - } - r->size = s; - r->cnt = 1; - - GRIB_MUTEX_UNLOCK(&mutex) - - return &r->buffer[0]; + memblk* r; + + GRIB_MUTEX_INIT_ONCE(&once, &init) + GRIB_MUTEX_LOCK(&mutex) + + s = ((s + WORD - 1) / WORD) * WORD; + r = reserve; + while (r) { + if (r->cnt == 0 && r->size == s) + break; + r = r->next; + } + + if (r) { + /* marslog(LOG_DBUG,"Reusing %ld bytes %d",s,r->size); */ + } + else { + size_t size = s + HEADER_SIZE; + /* marslog(LOG_DBUG,"Allocating %d (%d)bytes",s,size); */ + r = (memblk*)malloc(size); + if (!r) + return NULL; + r->next = reserve; + reserve = r; + } + r->size = s; + r->cnt = 1; + GRIB_MUTEX_UNLOCK(&mutex) + + return &r->buffer[0]; } -void grib_buffer_free(const grib_context* c,void *p) +void grib_buffer_free(const grib_context* c, void* p) { - memblk *r; - memblk *s; - - GRIB_MUTEX_INIT_ONCE(&once,&init) - GRIB_MUTEX_LOCK(&mutex) - - r = (memblk*)(((char*)p) - HEADER_SIZE); - s = reserve; - while(s && (s!=r)) s = s->next; - if(s == NULL) - ; /* marslog(LOG_WARN,"release_mem: invalid pointer"); */ - else - { - s->cnt = 0; - } - - GRIB_MUTEX_UNLOCK(&mutex) + memblk* r; + memblk* s; + + GRIB_MUTEX_INIT_ONCE(&once, &init) + GRIB_MUTEX_LOCK(&mutex) + + r = (memblk*)(((char*)p) - HEADER_SIZE); + s = reserve; + while (s && (s != r)) + s = s->next; + if (s == NULL) + ; /* marslog(LOG_WARN,"release_mem: invalid pointer"); */ + else { + s->cnt = 0; + } + + GRIB_MUTEX_UNLOCK(&mutex) } -void *grib_buffer_realloc(const grib_context* c,void *p,size_t s) +void* grib_buffer_realloc(const grib_context* c, void* p, size_t s) { - memblk *r = (memblk*)(((char*)p) - HEADER_SIZE); - void * n = grib_buffer_malloc(c,s); - memcpy(n,p,r->size < s? r->size:s); - grib_buffer_free(c,p); - return n; + memblk* r = (memblk*)(((char*)p) - HEADER_SIZE); + void* n = grib_buffer_malloc(c, s); + memcpy(n, p, r->size < s ? r->size : s); + grib_buffer_free(c, p); + return n; } /* diff --git a/src/grib_nearest.c b/src/grib_nearest.c index 7f8fd9b18..a26afc23c 100644 --- a/src/grib_nearest.c +++ b/src/grib_nearest.c @@ -20,27 +20,29 @@ * See ECC-499 */ int grib_nearest_find( - grib_nearest *nearest, const grib_handle* ch, - double inlat, double inlon, - unsigned long flags, - double* outlats,double* outlons, - double* values, double* distances, int* indexes, size_t *len) + grib_nearest* nearest, const grib_handle* ch, + double inlat, double inlon, + unsigned long flags, + double* outlats, double* outlons, + double* values, double* distances, int* indexes, size_t* len) { - grib_handle* h = (grib_handle*)ch; - grib_nearest_class *c = NULL; - if (!nearest) return GRIB_INVALID_ARGUMENT; + grib_handle* h = (grib_handle*)ch; + grib_nearest_class* c = NULL; + if (!nearest) + return GRIB_INVALID_ARGUMENT; c = nearest->cclass; - Assert( flags <= (GRIB_NEAREST_SAME_GRID|GRIB_NEAREST_SAME_DATA|GRIB_NEAREST_SAME_POINT) ); - - while(c) - { - grib_nearest_class *s = c->super ? *(c->super) : NULL; - if(c->find) { - int ret=c->find(nearest,h,inlat,inlon,flags,outlats,outlons,values,distances,indexes,len); - if (ret!=GRIB_SUCCESS) { - if (inlon>0) inlon-=360; - else inlon+=360; - ret=c->find(nearest,h,inlat,inlon,flags,outlats,outlons,values,distances,indexes,len); + Assert(flags <= (GRIB_NEAREST_SAME_GRID | GRIB_NEAREST_SAME_DATA | GRIB_NEAREST_SAME_POINT)); + + while (c) { + grib_nearest_class* s = c->super ? *(c->super) : NULL; + if (c->find) { + int ret = c->find(nearest, h, inlat, inlon, flags, outlats, outlons, values, distances, indexes, len); + if (ret != GRIB_SUCCESS) { + if (inlon > 0) + inlon -= 360; + else + inlon += 360; + ret = c->find(nearest, h, inlat, inlon, flags, outlats, outlons, values, distances, indexes, len); } return ret; } @@ -51,162 +53,187 @@ int grib_nearest_find( } /* For this one, ALL init are called */ -static int init_nearest(grib_nearest_class* c,grib_nearest* i, grib_handle *h, grib_arguments* args) +static int init_nearest(grib_nearest_class* c, grib_nearest* i, grib_handle* h, grib_arguments* args) { - if(c) { - int ret = GRIB_SUCCESS; - grib_nearest_class *s = c->super ? *(c->super) : NULL; - if(!c->inited) - { - if(c->init_class) c->init_class(c); + if (c) { + int ret = GRIB_SUCCESS; + grib_nearest_class* s = c->super ? *(c->super) : NULL; + if (!c->inited) { + if (c->init_class) + c->init_class(c); c->inited = 1; } - if(s) ret = init_nearest(s,i,h,args); + if (s) + ret = init_nearest(s, i, h, args); - if(ret != GRIB_SUCCESS) return ret; + if (ret != GRIB_SUCCESS) + return ret; - if(c->init) return c->init(i,h, args); + if (c->init) + return c->init(i, h, args); } return GRIB_INTERNAL_ERROR; } -int grib_nearest_init(grib_nearest* i, grib_handle *h, grib_arguments* args) +int grib_nearest_init(grib_nearest* i, grib_handle* h, grib_arguments* args) { - return init_nearest(i->cclass,i,h,args); + return init_nearest(i->cclass, i, h, args); } /* For this one, ALL destroy are called */ -int grib_nearest_delete(grib_nearest *i) +int grib_nearest_delete(grib_nearest* i) { - grib_nearest_class *c = NULL; - if (!i) return GRIB_INVALID_ARGUMENT; + grib_nearest_class* c = NULL; + if (!i) + return GRIB_INVALID_ARGUMENT; c = i->cclass; - while(c) - { - grib_nearest_class *s = c->super ? *(c->super) : NULL; - if(c->destroy) c->destroy(i); + while (c) { + grib_nearest_class* s = c->super ? *(c->super) : NULL; + if (c->destroy) + c->destroy(i); c = s; } return 0; } void grib_binary_search(double xx[], const unsigned long n, double x, - int *ju,int *jl) + int* ju, int* jl) { - size_t jm=0; - int ascending=0; - *jl=0; - *ju=n; - ascending=(xx[n] >= xx[0]); - while (*ju-*jl > 1) { - jm=(*ju+*jl) >> 1; - if ((x >= xx[jm]) == ascending) *jl=jm; - else *ju=jm; + size_t jm = 0; + int ascending = 0; + *jl = 0; + *ju = n; + ascending = (xx[n] >= xx[0]); + while (*ju - *jl > 1) { + jm = (*ju + *jl) >> 1; + if ((x >= xx[jm]) == ascending) + *jl = jm; + else + *ju = jm; } } -#define RADIAN(x) ((x) * acos(0.0) / 90.0) +#define RADIAN(x) ((x)*acos(0.0) / 90.0) -double grib_nearest_distance(double radius,double lon1, double lat1, double lon2, double lat2) +double grib_nearest_distance(double radius, double lon1, double lat1, double lon2, double lat2) { - double rlat1=RADIAN(lat1); - double rlat2=RADIAN(lat2); - double rlon1=lon1; - double rlon2=lon2; + double rlat1 = RADIAN(lat1); + double rlat2 = RADIAN(lat2); + double rlon1 = lon1; + double rlon2 = lon2; double a; if (lat1 == lat2 && lon1 == lon2) { return 0.0; /* the two points are identical */ } - if (rlon1 >=360) rlon1-=360.0; - rlon1=RADIAN(rlon1); - if (rlon2 >=360) rlon2-=360.0; - rlon2=RADIAN(rlon2); + if (rlon1 >= 360) + rlon1 -= 360.0; + rlon1 = RADIAN(rlon1); + if (rlon2 >= 360) + rlon2 -= 360.0; + rlon2 = RADIAN(rlon2); - a = sin(rlat1)*sin(rlat2)+ cos(rlat1)*cos(rlat2)*cos(rlon2-rlon1); + a = sin(rlat1) * sin(rlat2) + cos(rlat1) * cos(rlat2) * cos(rlon2 - rlon1); - if (a > 1 || a < -1 ) a=(int)a; + if (a > 1 || a < -1) + a = (int)a; - return radius*acos(a); + return radius * acos(a); } int grib_nearest_find_multiple( - const grib_handle* h, int is_lsm, - const double* inlats, const double* inlons, long npoints, - double* outlats, double* outlons, - double* values, double* distances, int* indexes) + const grib_handle* h, int is_lsm, + const double* inlats, const double* inlons, long npoints, + double* outlats, double* outlons, + double* values, double* distances, int* indexes) { - grib_nearest* nearest=0; - double* pdistances=distances; - double* poutlats=outlats; - double* poutlons=outlons; - double* pvalues=values; - int* pindexes=indexes; - int idx=0,ii=0; - double max,min; - double qdistances[4]={0,}; - double qoutlats[4]={0,}; - double qoutlons[4]={0,}; - double qvalues[4]={0,}; + grib_nearest* nearest = 0; + double* pdistances = distances; + double* poutlats = outlats; + double* poutlons = outlons; + double* pvalues = values; + int* pindexes = indexes; + int idx = 0, ii = 0; + double max, min; + double qdistances[4] = {0,}; + double qoutlats[4] = {0,}; + double qoutlons[4] = {0,}; + double qvalues[4] = {0,}; double* rvalues = NULL; - int qindexes[4]={0,}; - int ret=0; - long i=0; - size_t len=4; - int flags=GRIB_NEAREST_SAME_GRID | GRIB_NEAREST_SAME_DATA; + int qindexes[4] = {0,}; + int ret = 0; + long i = 0; + size_t len = 4; + int flags = GRIB_NEAREST_SAME_GRID | GRIB_NEAREST_SAME_DATA; - if (values) rvalues = qvalues; + if (values) + rvalues = qvalues; - nearest=grib_nearest_new(h,&ret); - if (ret!=GRIB_SUCCESS) return ret; + nearest = grib_nearest_new(h, &ret); + if (ret != GRIB_SUCCESS) + return ret; if (is_lsm) { - int noland=1; + int noland = 1; /* ECC-499: In land-sea mask mode, 'values' cannot be NULL because we need to query whether >= 0.5 */ Assert(values); - for (i=0;i= 0.5) noland=0; + for (i = 0; i < npoints; i++) { + ret = grib_nearest_find(nearest, h, inlats[i], inlons[i], flags, qoutlats, qoutlons, + qvalues, qdistances, qindexes, &len); + max = qdistances[0]; + for (ii = 0; ii < 4; ii++) { + if (max < qdistances[ii]) { + max = qdistances[ii]; + idx = ii; + } + if (qvalues[ii] >= 0.5) + noland = 0; } - min=max; - for (ii=0;ii<4;ii++) { - if ((min >= qdistances[ii]) && ( noland || (qvalues[ii] >= 0.5)) ) { + min = max; + for (ii = 0; ii < 4; ii++) { + if ((min >= qdistances[ii]) && (noland || (qvalues[ii] >= 0.5))) { min = qdistances[ii]; - idx=ii; + idx = ii; } } - *poutlats=qoutlats[idx];poutlats++; - *poutlons=qoutlons[idx];poutlons++; - *pvalues=qvalues[idx];pvalues++; - *pdistances=qdistances[idx];pdistances++; - *pindexes=qindexes[idx];pindexes++; - + *poutlats = qoutlats[idx]; + poutlats++; + *poutlons = qoutlons[idx]; + poutlons++; + *pvalues = qvalues[idx]; + pvalues++; + *pdistances = qdistances[idx]; + pdistances++; + *pindexes = qindexes[idx]; + pindexes++; } - } else { + } + else { /* ECC-499: 'values' can be NULL */ - for (i=0;i= qdistances[ii])) { min = qdistances[ii]; - idx=ii; + idx = ii; } } - *poutlats=qoutlats[idx];poutlats++; - *poutlons=qoutlons[idx];poutlons++; + *poutlats = qoutlats[idx]; + poutlats++; + *poutlons = qoutlons[idx]; + poutlons++; if (values) { - *pvalues=qvalues[idx];pvalues++; + *pvalues = qvalues[idx]; + pvalues++; } - *pdistances=qdistances[idx];pdistances++; - *pindexes=qindexes[idx];pindexes++; + *pdistances = qdistances[idx]; + pdistances++; + *pindexes = qindexes[idx]; + pindexes++; } } diff --git a/src/grib_nearest_class.c b/src/grib_nearest_class.c index d1715b3ec..a90977009 100644 --- a/src/grib_nearest_class.c +++ b/src/grib_nearest_class.c @@ -15,43 +15,42 @@ #include "grib_api_internal.h" -#define NUMBER(x) (sizeof(x)/sizeof(x[0])) +#define NUMBER(x) (sizeof(x) / sizeof(x[0])) /* This file is generated by ./make_class.pl */ #include "grib_nearest_class.h" struct table_entry { - char *type; - grib_nearest_class **cclass; + char* type; + grib_nearest_class** cclass; }; -static const struct table_entry table[] = -{ - /* This file is generated by ./make_class.pl */ +static const struct table_entry table[] = { +/* This file is generated by ./make_class.pl */ #include "grib_nearest_factory.h" }; -grib_nearest* grib_nearest_factory( grib_handle* h, grib_arguments* args) +grib_nearest* grib_nearest_factory(grib_handle* h, grib_arguments* args) { - int i; - int ret = GRIB_SUCCESS; - char* type = (char*)grib_arguments_get_name(h,args,0); - - for(i = 0; i < NUMBER(table) ; i++) - if(strcmp(type,table[i].type) == 0) - { - grib_nearest_class* c = *(table[i].cclass); - grib_nearest* it = (grib_nearest*) grib_context_malloc_clear(h->context,c->size); - it->cclass = c; - ret = grib_nearest_init(it,h,args); - if(ret == GRIB_SUCCESS) return it; - grib_context_log(h->context,GRIB_LOG_ERROR,"grib_nearest_factory: error %d instantiating nearest %s", ret, table[i].type); - grib_nearest_delete(it); - return NULL; - } - - grib_context_log(h->context,GRIB_LOG_ERROR,"grib_nearest_factory : Unknown type : %s for nearest", type); - - return NULL; + int i; + int ret = GRIB_SUCCESS; + char* type = (char*)grib_arguments_get_name(h, args, 0); + + for (i = 0; i < NUMBER(table); i++) + if (strcmp(type, table[i].type) == 0) { + grib_nearest_class* c = *(table[i].cclass); + grib_nearest* it = (grib_nearest*)grib_context_malloc_clear(h->context, c->size); + it->cclass = c; + ret = grib_nearest_init(it, h, args); + if (ret == GRIB_SUCCESS) + return it; + grib_context_log(h->context, GRIB_LOG_ERROR, "grib_nearest_factory: error %d instantiating nearest %s", ret, table[i].type); + grib_nearest_delete(it); + return NULL; + } + + grib_context_log(h->context, GRIB_LOG_ERROR, "grib_nearest_factory : Unknown type : %s for nearest", type); + + return NULL; } diff --git a/src/grib_nearest_class_gen.c b/src/grib_nearest_class_gen.c index 3b86f4d87..61917825e 100644 --- a/src/grib_nearest_class_gen.c +++ b/src/grib_nearest_class_gen.c @@ -36,30 +36,31 @@ or edit "nearest.class" and rerun ./make_class.pl */ -static void init_class (grib_nearest_class*); - -static int init (grib_nearest* nearest,grib_handle* h,grib_arguments* args); -static int find(grib_nearest* nearest, grib_handle* h,double inlat, double inlon, unsigned long flags, double* outlats,double* outlons, double *values,double *distances, int *indexes,size_t *len); -static int destroy (grib_nearest* nearest); - -typedef struct grib_nearest_gen{ - grib_nearest nearest; -/* Members defined in gen */ - const char* values_key; - const char* radius; - int cargs; +static void init_class(grib_nearest_class*); + +static int init(grib_nearest* nearest, grib_handle* h, grib_arguments* args); +static int find(grib_nearest* nearest, grib_handle* h, double inlat, double inlon, unsigned long flags, double* outlats, double* outlons, double* values, double* distances, int* indexes, size_t* len); +static int destroy(grib_nearest* nearest); + +typedef struct grib_nearest_gen +{ + grib_nearest nearest; + /* Members defined in gen */ + const char* values_key; + const char* radius; + int cargs; } grib_nearest_gen; static grib_nearest_class _grib_nearest_class_gen = { - 0, /* super */ - "gen", /* name */ - sizeof(grib_nearest_gen), /* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* constructor */ - &destroy, /* destructor */ - &find, /* find nearest */ + 0, /* super */ + "gen", /* name */ + sizeof(grib_nearest_gen), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* constructor */ + &destroy, /* destructor */ + &find, /* find nearest */ }; grib_nearest_class* grib_nearest_class_gen = &_grib_nearest_class_gen; @@ -70,33 +71,34 @@ static void init_class(grib_nearest_class* c) } /* END_CLASS_IMP */ -static int init(grib_nearest* nearest,grib_handle* h,grib_arguments* args) +static int init(grib_nearest* nearest, grib_handle* h, grib_arguments* args) { - grib_nearest_gen* self = (grib_nearest_gen*) nearest; - int ret = GRIB_SUCCESS; + grib_nearest_gen* self = (grib_nearest_gen*)nearest; + int ret = GRIB_SUCCESS; self->cargs = 1; - self->values_key = grib_arguments_get_name(h,args,self->cargs++); - self->radius = grib_arguments_get_name(h,args,self->cargs++); - nearest->values=NULL; + self->values_key = grib_arguments_get_name(h, args, self->cargs++); + self->radius = grib_arguments_get_name(h, args, self->cargs++); + nearest->values = NULL; - nearest->context=h->context; + nearest->context = h->context; return ret; } static int destroy(grib_nearest* nearest) { - if (nearest->values) grib_context_free(nearest->context,nearest->values); - grib_context_free(nearest->context,nearest); + if (nearest->values) + grib_context_free(nearest->context, nearest->values); + grib_context_free(nearest->context, nearest); return GRIB_SUCCESS; } static int find(grib_nearest* nearest, grib_handle* h, - double inlat, double inlon,unsigned long flags, - double* outlats,double* outlons, double *values, - double *distances,int *indexes, size_t *len) + double inlat, double inlon, unsigned long flags, + double* outlats, double* outlons, double* values, + double* distances, int* indexes, size_t* len) { return GRIB_NOT_IMPLEMENTED; } diff --git a/src/grib_nearest_class_lambert_conformal.c b/src/grib_nearest_class_lambert_conformal.c index d75d0cd3a..82e80daa4 100644 --- a/src/grib_nearest_class_lambert_conformal.c +++ b/src/grib_nearest_class_lambert_conformal.c @@ -43,42 +43,43 @@ or edit "nearest.class" and rerun ./make_class.pl */ -static void init_class (grib_nearest_class*); - -static int init (grib_nearest* nearest,grib_handle* h,grib_arguments* args); -static int find(grib_nearest* nearest, grib_handle* h,double inlat, double inlon, unsigned long flags, double* outlats,double* outlons, double *values,double *distances, int *indexes,size_t *len); -static int destroy (grib_nearest* nearest); - -typedef struct grib_nearest_lambert_conformal{ - grib_nearest nearest; -/* Members defined in gen */ - const char* values_key; - const char* radius; - int cargs; -/* Members defined in lambert_conformal */ - double* lats; - int lats_count; - double* lons; - int lons_count; - double* distances; - int* k; - int* i; - int* j; - const char* Ni; - const char* Nj; +static void init_class(grib_nearest_class*); + +static int init(grib_nearest* nearest, grib_handle* h, grib_arguments* args); +static int find(grib_nearest* nearest, grib_handle* h, double inlat, double inlon, unsigned long flags, double* outlats, double* outlons, double* values, double* distances, int* indexes, size_t* len); +static int destroy(grib_nearest* nearest); + +typedef struct grib_nearest_lambert_conformal +{ + grib_nearest nearest; + /* Members defined in gen */ + const char* values_key; + const char* radius; + int cargs; + /* Members defined in lambert_conformal */ + double* lats; + int lats_count; + double* lons; + int lons_count; + double* distances; + int* k; + int* i; + int* j; + const char* Ni; + const char* Nj; } grib_nearest_lambert_conformal; extern grib_nearest_class* grib_nearest_class_gen; static grib_nearest_class _grib_nearest_class_lambert_conformal = { - &grib_nearest_class_gen, /* super */ - "lambert_conformal", /* name */ - sizeof(grib_nearest_lambert_conformal), /* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* constructor */ - &destroy, /* destructor */ - &find, /* find nearest */ + &grib_nearest_class_gen, /* super */ + "lambert_conformal", /* name */ + sizeof(grib_nearest_lambert_conformal), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* constructor */ + &destroy, /* destructor */ + &find, /* find nearest */ }; grib_nearest_class* grib_nearest_class_lambert_conformal = &_grib_nearest_class_lambert_conformal; @@ -89,158 +90,172 @@ static void init_class(grib_nearest_class* c) } /* END_CLASS_IMP */ -static int init(grib_nearest* nearest,grib_handle* h,grib_arguments* args) +static int init(grib_nearest* nearest, grib_handle* h, grib_arguments* args) { - grib_nearest_lambert_conformal* self = (grib_nearest_lambert_conformal*) nearest; - self->Ni = grib_arguments_get_name(h,args,self->cargs++); - self->Nj = grib_arguments_get_name(h,args,self->cargs++); - self->i=(int*)grib_context_malloc(h->context,2*sizeof(int)); - self->j=(int*)grib_context_malloc(h->context,2*sizeof(int)); + grib_nearest_lambert_conformal* self = (grib_nearest_lambert_conformal*)nearest; + self->Ni = grib_arguments_get_name(h, args, self->cargs++); + self->Nj = grib_arguments_get_name(h, args, self->cargs++); + self->i = (int*)grib_context_malloc(h->context, 2 * sizeof(int)); + self->j = (int*)grib_context_malloc(h->context, 2 * sizeof(int)); return 0; } -static int compare_doubles( const void* a, const void* b, int ascending ) +static int compare_doubles(const void* a, const void* b, int ascending) { /* ascending is a boolean: 0 or 1 */ - double* arg1 = (double*) a; - double* arg2 = (double*) b; + double* arg1 = (double*)a; + double* arg2 = (double*)b; if (ascending) { - if( *arg1 < *arg2 ) return -1; /*Smaller values come before larger ones*/ - } else { - if( *arg1 > *arg2 ) return -1; /*Larger values come before smaller ones*/ + if (*arg1 < *arg2) + return -1; /*Smaller values come before larger ones*/ } - if( *arg1 == *arg2 ) return 0; - else return 1; + else { + if (*arg1 > *arg2) + return -1; /*Larger values come before smaller ones*/ + } + if (*arg1 == *arg2) + return 0; + else + return 1; } -static int compare_doubles_ascending( const void* a, const void* b ) +static int compare_doubles_ascending(const void* a, const void* b) { - return compare_doubles(a,b,1); + return compare_doubles(a, b, 1); } -typedef struct PointStore { +typedef struct PointStore +{ double m_lat; double m_lon; double m_dist; double m_value; - int m_index; -} PointStore ; + int m_index; +} PointStore; /* Comparison function to sort points by distance */ static int compare_points(const void* a, const void* b) { - PointStore *pA = (PointStore*)a; - PointStore *pB = (PointStore*)b; + PointStore* pA = (PointStore*)a; + PointStore* pB = (PointStore*)b; - if (pA->m_dist < pB->m_dist) return -1; - if (pA->m_dist > pB->m_dist) return 1; + if (pA->m_dist < pB->m_dist) + return -1; + if (pA->m_dist > pB->m_dist) + return 1; return 0; } static int find(grib_nearest* nearest, grib_handle* h, - double inlat, double inlon,unsigned long flags, - double* outlats,double* outlons, - double *values,double *distances,int* indexes, size_t *len) + double inlat, double inlon, unsigned long flags, + double* outlats, double* outlons, + double* values, double* distances, int* indexes, size_t* len) { - grib_nearest_lambert_conformal* self = (grib_nearest_lambert_conformal*) nearest; - int ret=0, i=0; - size_t nvalues=0; + grib_nearest_lambert_conformal* self = (grib_nearest_lambert_conformal*)nearest; + int ret = 0, i = 0; + size_t nvalues = 0; long iradius; double radius; - grib_iterator* iter=NULL; - double lat=0,lon=0; + grib_iterator* iter = NULL; + double lat = 0, lon = 0; /* array of candidates for nearest neighbours */ PointStore* neighbours = NULL; - while (inlon<0) inlon+=360; - while (inlon>360) inlon-=360; + while (inlon < 0) + inlon += 360; + while (inlon > 360) + inlon -= 360; - if( (ret = grib_get_size(h,self->values_key,&nvalues))!= GRIB_SUCCESS) + if ((ret = grib_get_size(h, self->values_key, &nvalues)) != GRIB_SUCCESS) return ret; nearest->values_count = nvalues; - if (grib_is_missing(h,self->radius,&ret)) { - grib_context_log(h->context, GRIB_LOG_DEBUG,"Key '%s' is missing", self->radius); + if (grib_is_missing(h, self->radius, &ret)) { + grib_context_log(h->context, GRIB_LOG_DEBUG, "Key '%s' is missing", self->radius); return ret ? ret : GRIB_GEOCALCULUS_PROBLEM; } - if( (ret = grib_get_long(h,self->radius,&iradius))!= GRIB_SUCCESS) + if ((ret = grib_get_long(h, self->radius, &iradius)) != GRIB_SUCCESS) return ret; - radius=((double)iradius)/1000.0; - - neighbours = (PointStore*)grib_context_malloc( nearest->context, nvalues*sizeof(PointStore) ); - for(i=0; icontext, nvalues * sizeof(PointStore)); + for (i = 0; i < nvalues; ++i) { + neighbours[i].m_dist = 1e10; /* set all distances to large number to begin with */ + neighbours[i].m_lat = 0; + neighbours[i].m_lon = 0; + neighbours[i].m_value = 0; + neighbours[i].m_index = 0; } /* GRIB_NEAREST_SAME_GRID not yet implemented */ { double the_value = 0; - double min_dist = 1e10; + double min_dist = 1e10; size_t the_index = 0; - int ilat=0, ilon=0; - int idx_upper=0, idx_lower=0; - double lat1=0, lat2=0; /* inlat will be between these */ - double dist=0; + int ilat = 0, ilon = 0; + int idx_upper = 0, idx_lower = 0; + double lat1 = 0, lat2 = 0; /* inlat will be between these */ + double dist = 0; const double LAT_DELTA = 10.0; /* in degrees */ - if (grib_is_missing(h,self->Ni,&ret)) { - grib_context_log(h->context, GRIB_LOG_DEBUG,"Key '%s' is missing", self->Ni); + if (grib_is_missing(h, self->Ni, &ret)) { + grib_context_log(h->context, GRIB_LOG_DEBUG, "Key '%s' is missing", self->Ni); return ret ? ret : GRIB_GEOCALCULUS_PROBLEM; } - if (grib_is_missing(h,self->Nj,&ret)) { - grib_context_log(h->context, GRIB_LOG_DEBUG,"Key '%s' is missing", self->Nj); + if (grib_is_missing(h, self->Nj, &ret)) { + grib_context_log(h->context, GRIB_LOG_DEBUG, "Key '%s' is missing", self->Nj); return ret ? ret : GRIB_GEOCALCULUS_PROBLEM; } - self->lons_count=nvalues; /* Maybe overestimate but safe */ - self->lats_count=nvalues; + self->lons_count = nvalues; /* Maybe overestimate but safe */ + self->lats_count = nvalues; - if (self->lats) grib_context_free(nearest->context,self->lats); - self->lats=(double*)grib_context_malloc( nearest->context, nvalues* sizeof(double)); - if (!self->lats) return GRIB_OUT_OF_MEMORY; + if (self->lats) + grib_context_free(nearest->context, self->lats); + self->lats = (double*)grib_context_malloc(nearest->context, nvalues * sizeof(double)); + if (!self->lats) + return GRIB_OUT_OF_MEMORY; - if (self->lons) grib_context_free(nearest->context,self->lons); - self->lons=(double*)grib_context_malloc( nearest->context, nvalues*sizeof(double)); - if (!self->lons) return GRIB_OUT_OF_MEMORY; + if (self->lons) + grib_context_free(nearest->context, self->lons); + self->lons = (double*)grib_context_malloc(nearest->context, nvalues * sizeof(double)); + if (!self->lons) + return GRIB_OUT_OF_MEMORY; - iter=grib_iterator_new(h,0,&ret); - if (ret) return ret; + iter = grib_iterator_new(h, 0, &ret); + if (ret) + return ret; /* First pass: collect all latitudes and longitudes */ - while(grib_iterator_next(iter,&lat,&lon,&the_value)) - { + while (grib_iterator_next(iter, &lat, &lon, &the_value)) { ++the_index; Assert(ilat < self->lats_count); Assert(ilon < self->lons_count); - self->lats[ilat++]=lat; - self->lons[ilon++]=lon; + self->lats[ilat++] = lat; + self->lons[ilon++] = lon; } /* See between which 2 latitudes our point lies */ qsort(self->lats, nvalues, sizeof(double), &compare_doubles_ascending); - grib_binary_search(self->lats, self->lats_count-1, inlat, &idx_upper, &idx_lower); + grib_binary_search(self->lats, self->lats_count - 1, inlat, &idx_upper, &idx_lower); lat2 = self->lats[idx_upper]; lat1 = self->lats[idx_lower]; - Assert(lat1<=lat2); + Assert(lat1 <= lat2); /* Second pass: Iterate again and collect candidate neighbours */ grib_iterator_reset(iter); - the_index=0; - i = 0; - while(grib_iterator_next(iter,&lat,&lon,&the_value)) - { - if (lat > lat2+LAT_DELTA || lat < lat1-LAT_DELTA) { + the_index = 0; + i = 0; + while (grib_iterator_next(iter, &lat, &lon, &the_value)) { + if (lat > lat2 + LAT_DELTA || lat < lat1 - LAT_DELTA) { /* Ignore latitudes too far from our point */ } else { dist = grib_nearest_distance(radius, inlon, inlat, lon, lat); - if (dist < min_dist) min_dist = dist; + if (dist < min_dist) + min_dist = dist; /*printf("Candidate: lat=%.5f lon=%.5f dist=%f Idx=%ld Val=%f\n",lat,lon,dist,the_index,the_value);*/ /* store this candidate point */ neighbours[i].m_dist = dist; @@ -258,26 +273,25 @@ static int find(grib_nearest* nearest, grib_handle* h, grib_iterator_delete(iter); } - nearest->h=h; + nearest->h = h; /* Sanity check for sorting */ #ifdef DEBUG - for(i=0; idistances) { - self->distances=(double*)grib_context_malloc( nearest->context,4*sizeof(double)); + self->distances = (double*)grib_context_malloc(nearest->context, 4 * sizeof(double)); } self->distances[0] = neighbours[0].m_dist; self->distances[1] = neighbours[1].m_dist; self->distances[2] = neighbours[2].m_dist; self->distances[3] = neighbours[3].m_dist; - for(i=0; i <4; ++i) - { + for (i = 0; i < 4; ++i) { distances[i] = neighbours[i].m_dist; outlats[i] = neighbours[i].m_lat; outlons[i] = neighbours[i].m_lon; @@ -292,12 +306,18 @@ static int find(grib_nearest* nearest, grib_handle* h, static int destroy(grib_nearest* nearest) { - grib_nearest_lambert_conformal* self = (grib_nearest_lambert_conformal*) nearest; - if (self->lats) grib_context_free(nearest->context,self->lats); - if (self->lons) grib_context_free(nearest->context,self->lons); - if (self->i) grib_context_free(nearest->context,self->i); - if (self->j) grib_context_free(nearest->context,self->j); - if (self->k) grib_context_free(nearest->context,self->k); - if (self->distances) grib_context_free(nearest->context,self->distances); + grib_nearest_lambert_conformal* self = (grib_nearest_lambert_conformal*)nearest; + if (self->lats) + grib_context_free(nearest->context, self->lats); + if (self->lons) + grib_context_free(nearest->context, self->lons); + if (self->i) + grib_context_free(nearest->context, self->i); + if (self->j) + grib_context_free(nearest->context, self->j); + if (self->k) + grib_context_free(nearest->context, self->k); + if (self->distances) + grib_context_free(nearest->context, self->distances); return GRIB_SUCCESS; } diff --git a/src/grib_nearest_class_latlon_reduced.c b/src/grib_nearest_class_latlon_reduced.c index ab9a9d9a6..2f8da78c0 100644 --- a/src/grib_nearest_class_latlon_reduced.c +++ b/src/grib_nearest_class_latlon_reduced.c @@ -42,42 +42,43 @@ or edit "nearest.class" and rerun ./make_class.pl */ -static void init_class (grib_nearest_class*); - -static int init (grib_nearest* nearest,grib_handle* h,grib_arguments* args); -static int find(grib_nearest* nearest, grib_handle* h,double inlat, double inlon, unsigned long flags, double* outlats,double* outlons, double *values,double *distances, int *indexes,size_t *len); -static int destroy (grib_nearest* nearest); - -typedef struct grib_nearest_latlon_reduced{ - grib_nearest nearest; -/* Members defined in gen */ - const char* values_key; - const char* radius; - int cargs; -/* Members defined in latlon_reduced */ - double* lats; - int lats_count; - double* lons; - double* distances; - int* k; - int* j; - const char* Nj; - const char* pl; - const char* lonFirst; - const char* lonLast; +static void init_class(grib_nearest_class*); + +static int init(grib_nearest* nearest, grib_handle* h, grib_arguments* args); +static int find(grib_nearest* nearest, grib_handle* h, double inlat, double inlon, unsigned long flags, double* outlats, double* outlons, double* values, double* distances, int* indexes, size_t* len); +static int destroy(grib_nearest* nearest); + +typedef struct grib_nearest_latlon_reduced +{ + grib_nearest nearest; + /* Members defined in gen */ + const char* values_key; + const char* radius; + int cargs; + /* Members defined in latlon_reduced */ + double* lats; + int lats_count; + double* lons; + double* distances; + int* k; + int* j; + const char* Nj; + const char* pl; + const char* lonFirst; + const char* lonLast; } grib_nearest_latlon_reduced; extern grib_nearest_class* grib_nearest_class_gen; static grib_nearest_class _grib_nearest_class_latlon_reduced = { - &grib_nearest_class_gen, /* super */ - "latlon_reduced", /* name */ - sizeof(grib_nearest_latlon_reduced), /* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* constructor */ - &destroy, /* destructor */ - &find, /* find nearest */ + &grib_nearest_class_gen, /* super */ + "latlon_reduced", /* name */ + sizeof(grib_nearest_latlon_reduced), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* constructor */ + &destroy, /* destructor */ + &find, /* find nearest */ }; grib_nearest_class* grib_nearest_class_latlon_reduced = &_grib_nearest_class_latlon_reduced; @@ -88,250 +89,282 @@ static void init_class(grib_nearest_class* c) } /* END_CLASS_IMP */ -static int init(grib_nearest* nearest,grib_handle* h,grib_arguments* args) +static int init(grib_nearest* nearest, grib_handle* h, grib_arguments* args) { - grib_nearest_latlon_reduced* self = (grib_nearest_latlon_reduced*) nearest; - self->Nj = grib_arguments_get_name(h,args,self->cargs++); - self->pl = grib_arguments_get_name(h,args,self->cargs++); - self->lonFirst = grib_arguments_get_name(h,args,self->cargs++); - self->lonLast = grib_arguments_get_name(h,args,self->cargs++); - self->j=(int*)grib_context_malloc(h->context,2*sizeof(int)); - if (!self->j) return GRIB_OUT_OF_MEMORY; - self->k=(int*)grib_context_malloc( nearest->context,4*sizeof(int)); - if (!self->k) return GRIB_OUT_OF_MEMORY; + grib_nearest_latlon_reduced* self = (grib_nearest_latlon_reduced*)nearest; + self->Nj = grib_arguments_get_name(h, args, self->cargs++); + self->pl = grib_arguments_get_name(h, args, self->cargs++); + self->lonFirst = grib_arguments_get_name(h, args, self->cargs++); + self->lonLast = grib_arguments_get_name(h, args, self->cargs++); + self->j = (int*)grib_context_malloc(h->context, 2 * sizeof(int)); + if (!self->j) + return GRIB_OUT_OF_MEMORY; + self->k = (int*)grib_context_malloc(nearest->context, 4 * sizeof(int)); + if (!self->k) + return GRIB_OUT_OF_MEMORY; return 0; } static int find(grib_nearest* nearest, grib_handle* h, - double inlat, double inlon,unsigned long flags, - double* outlats,double* outlons, double *values, - double *distances,int *indexes, size_t *len) { - grib_nearest_latlon_reduced* self = (grib_nearest_latlon_reduced*) nearest; - int ret=0,kk=0,ii=0,jj=0; - int j=0; - long* pla=NULL; - long* pl=NULL; - size_t nvalues=0; - grib_iterator* iter=NULL; - double lat=0,lon=0; + double inlat, double inlon, unsigned long flags, + double* outlats, double* outlons, double* values, + double* distances, int* indexes, size_t* len) +{ + grib_nearest_latlon_reduced* self = (grib_nearest_latlon_reduced*)nearest; + int ret = 0, kk = 0, ii = 0, jj = 0; + int j = 0; + long* pla = NULL; + long* pl = NULL; + size_t nvalues = 0; + grib_iterator* iter = NULL; + double lat = 0, lon = 0; long iradius; double radius; - int ilat=0,ilon=0; + int ilat = 0, ilon = 0; - if( (ret = grib_get_size(h,self->values_key,&nvalues))!= GRIB_SUCCESS) + if ((ret = grib_get_size(h, self->values_key, &nvalues)) != GRIB_SUCCESS) return ret; nearest->values_count = nvalues; - if (grib_is_missing(h,self->radius,&ret)) { - grib_context_log(h->context, GRIB_LOG_DEBUG,"Key '%s' is missing", self->radius); + if (grib_is_missing(h, self->radius, &ret)) { + grib_context_log(h->context, GRIB_LOG_DEBUG, "Key '%s' is missing", self->radius); return ret ? ret : GRIB_GEOCALCULUS_PROBLEM; } - if( (ret = grib_get_long(h,self->radius,&iradius))!= GRIB_SUCCESS) + if ((ret = grib_get_long(h, self->radius, &iradius)) != GRIB_SUCCESS) return ret; - radius=((double)iradius)/1000.0; + radius = ((double)iradius) / 1000.0; - if (!nearest->h || (flags & GRIB_NEAREST_SAME_GRID)==0) { - double dummy=0; - double olat=1.e10; - long n=0; + if (!nearest->h || (flags & GRIB_NEAREST_SAME_GRID) == 0) { + double dummy = 0; + double olat = 1.e10; + long n = 0; - ilat=0; ilon=0; - if (grib_is_missing(h,self->Nj,&ret)) { - grib_context_log(h->context, GRIB_LOG_DEBUG,"Key '%s' is missing", self->Nj); + ilat = 0; + ilon = 0; + if (grib_is_missing(h, self->Nj, &ret)) { + grib_context_log(h->context, GRIB_LOG_DEBUG, "Key '%s' is missing", self->Nj); return ret ? ret : GRIB_GEOCALCULUS_PROBLEM; } - if ( (ret = grib_get_long(h,self->Nj,&n))!= GRIB_SUCCESS) + if ((ret = grib_get_long(h, self->Nj, &n)) != GRIB_SUCCESS) return ret; - self->lats_count=n; - - if (self->lats) grib_context_free(nearest->context,self->lats); - self->lats=(double*)grib_context_malloc( nearest->context, - self->lats_count* sizeof(double)); - if (!self->lats) return GRIB_OUT_OF_MEMORY; - - if (self->lons) grib_context_free(nearest->context,self->lons); - self->lons=(double*)grib_context_malloc( nearest->context, - nearest->values_count*sizeof(double)); - if (!self->lons) return GRIB_OUT_OF_MEMORY; - - iter=grib_iterator_new(h,0,&ret); + self->lats_count = n; + + if (self->lats) + grib_context_free(nearest->context, self->lats); + self->lats = (double*)grib_context_malloc(nearest->context, + self->lats_count * sizeof(double)); + if (!self->lats) + return GRIB_OUT_OF_MEMORY; + + if (self->lons) + grib_context_free(nearest->context, self->lons); + self->lons = (double*)grib_context_malloc(nearest->context, + nearest->values_count * sizeof(double)); + if (!self->lons) + return GRIB_OUT_OF_MEMORY; + + iter = grib_iterator_new(h, 0, &ret); if (ret) { - grib_context_log(h->context,GRIB_LOG_ERROR,"unable to create iterator"); + grib_context_log(h->context, GRIB_LOG_ERROR, "unable to create iterator"); return ret; } - while(grib_iterator_next(iter,&lat,&lon,&dummy)) { - if (olat!=lat) { - self->lats[ilat++]=lat; - olat=lat; + while (grib_iterator_next(iter, &lat, &lon, &dummy)) { + if (olat != lat) { + self->lats[ilat++] = lat; + olat = lat; } - self->lons[ilon++]=lon; + self->lons[ilon++] = lon; } - self->lats_count=ilat; + self->lats_count = ilat; grib_iterator_delete(iter); - } - nearest->h=h; - - if (!self->distances || (flags & GRIB_NEAREST_SAME_POINT)==0 - || (flags & GRIB_NEAREST_SAME_GRID)==0) { - double* lons=NULL; - int nlon=0; - size_t plsize=0; - long nplm1=0; - int nearest_lons_found=0; - double lon_first,lon_last; - int islocal=0; + nearest->h = h; + + if (!self->distances || (flags & GRIB_NEAREST_SAME_POINT) == 0 || (flags & GRIB_NEAREST_SAME_GRID) == 0) { + double* lons = NULL; + int nlon = 0; + size_t plsize = 0; + long nplm1 = 0; + int nearest_lons_found = 0; + double lon_first, lon_last; + int islocal = 0; long plmax; double dimin; - if ((ret=grib_get_double(h,self->lonFirst,&lon_first))!=GRIB_SUCCESS) { - grib_context_log(h->context,GRIB_LOG_ERROR, - "grib_nearest_latlon_reduced.find(): unable to get %s %s\n",self->lonFirst, - grib_get_error_message(ret)); + if ((ret = grib_get_double(h, self->lonFirst, &lon_first)) != GRIB_SUCCESS) { + grib_context_log(h->context, GRIB_LOG_ERROR, + "grib_nearest_latlon_reduced.find(): unable to get %s %s\n", self->lonFirst, + grib_get_error_message(ret)); return ret; } - if ((ret=grib_get_double(h,self->lonLast,&lon_last))!=GRIB_SUCCESS) { - grib_context_log(h->context,GRIB_LOG_ERROR, - "grib_nearest_latlon_reduced.find(): unable to get %s %s\n",self->lonLast, - grib_get_error_message(ret)); + if ((ret = grib_get_double(h, self->lonLast, &lon_last)) != GRIB_SUCCESS) { + grib_context_log(h->context, GRIB_LOG_ERROR, + "grib_nearest_latlon_reduced.find(): unable to get %s %s\n", self->lonLast, + grib_get_error_message(ret)); return ret; } - plsize=self->lats_count; - if( (ret=grib_get_size(h,self->pl,&plsize))!= GRIB_SUCCESS) + plsize = self->lats_count; + if ((ret = grib_get_size(h, self->pl, &plsize)) != GRIB_SUCCESS) return ret; - pla=(long*)grib_context_malloc(h->context,plsize*sizeof(long)); - if (!pla) return GRIB_OUT_OF_MEMORY; - if( (ret=grib_get_long_array(h,self->pl,pla,&plsize))!= GRIB_SUCCESS) + pla = (long*)grib_context_malloc(h->context, plsize * sizeof(long)); + if (!pla) + return GRIB_OUT_OF_MEMORY; + if ((ret = grib_get_long_array(h, self->pl, pla, &plsize)) != GRIB_SUCCESS) return ret; - pl=pla; - while ((*pl)==0) {pl++;} + pl = pla; + while ((*pl) == 0) { + pl++; + } - plmax=pla[0]; - for (j=0;j360) inlon-=360; - - ilat=self->lats_count; - if (self->lats[ilat-1] > self->lats[0]) { - if (inlat < self->lats[0] || inlat > self->lats[ilat-1]) + while (inlon < 0) + inlon += 360; + while (inlon > 360) + inlon -= 360; + + ilat = self->lats_count; + if (self->lats[ilat - 1] > self->lats[0]) { + if (inlat < self->lats[0] || inlat > self->lats[ilat - 1]) return GRIB_OUT_OF_AREA; - } else { - if (inlat > self->lats[0] || inlat < self->lats[ilat-1]) + } + else { + if (inlat > self->lats[0] || inlat < self->lats[ilat - 1]) return GRIB_OUT_OF_AREA; } if (!self->distances) - self->distances=(double*)grib_context_malloc( nearest->context,4*sizeof(double)); - if (!self->distances) return GRIB_OUT_OF_MEMORY; - - grib_binary_search(self->lats,ilat-1,inlat, - &(self->j[0]),&(self->j[1])); - - nlon=0; - for (jj=0;jjj[0];jj++) nlon+=pl[jj]; - nplm1=pl[self->j[0]]-1; - - lons=self->lons+nlon; - - nearest_lons_found=0; - if (lons[nplm1]>lons[0]) { - if (inlon< lons[0] || inlon > lons[nplm1]) { - if (lons[nplm1]-lons[0]-360 <= - lons[nplm1]-lons[nplm1-1]) { - self->k[0]=0; - self->k[1]=nplm1; - nearest_lons_found=1; - } else return GRIB_OUT_OF_AREA; + self->distances = (double*)grib_context_malloc(nearest->context, 4 * sizeof(double)); + if (!self->distances) + return GRIB_OUT_OF_MEMORY; + + grib_binary_search(self->lats, ilat - 1, inlat, + &(self->j[0]), &(self->j[1])); + + nlon = 0; + for (jj = 0; jj < self->j[0]; jj++) + nlon += pl[jj]; + nplm1 = pl[self->j[0]] - 1; + + lons = self->lons + nlon; + + nearest_lons_found = 0; + if (lons[nplm1] > lons[0]) { + if (inlon < lons[0] || inlon > lons[nplm1]) { + if (lons[nplm1] - lons[0] - 360 <= + lons[nplm1] - lons[nplm1 - 1]) { + self->k[0] = 0; + self->k[1] = nplm1; + nearest_lons_found = 1; + } + else + return GRIB_OUT_OF_AREA; } - } else { - if (inlon >lons[0] || inlon< lons[nplm1]) { - if (lons[0]-lons[nplm1]-360 <= - lons[0]-lons[1]) { - self->k[0]=0; - self->k[1]=nplm1; - nearest_lons_found=1; - } else return GRIB_OUT_OF_AREA; + } + else { + if (inlon > lons[0] || inlon < lons[nplm1]) { + if (lons[0] - lons[nplm1] - 360 <= + lons[0] - lons[1]) { + self->k[0] = 0; + self->k[1] = nplm1; + nearest_lons_found = 1; + } + else + return GRIB_OUT_OF_AREA; } } if (!nearest_lons_found) { - grib_binary_search(lons,pl[self->j[0]]-1,inlon, - &(self->k[0]),&(self->k[1])); + grib_binary_search(lons, pl[self->j[0]] - 1, inlon, + &(self->k[0]), &(self->k[1])); } - self->k[0]+=nlon; - self->k[1]+=nlon; - - nlon=0; - for (jj=0;jjj[1];jj++) nlon+=pl[jj]; - nplm1=pl[self->j[1]]-1; - - lons=self->lons+nlon; - - nearest_lons_found=0; - if (lons[nplm1]>lons[0]) { - if (inlonlons[nplm1]) { - if (lons[nplm1]-lons[0]-360 <= - lons[nplm1]-lons[nplm1-1]) { - self->k[2]=0; - self->k[3]=nplm1; - nearest_lons_found=1; - } else return GRIB_OUT_OF_AREA; + self->k[0] += nlon; + self->k[1] += nlon; + + nlon = 0; + for (jj = 0; jj < self->j[1]; jj++) + nlon += pl[jj]; + nplm1 = pl[self->j[1]] - 1; + + lons = self->lons + nlon; + + nearest_lons_found = 0; + if (lons[nplm1] > lons[0]) { + if (inlon < lons[0] || inlon > lons[nplm1]) { + if (lons[nplm1] - lons[0] - 360 <= + lons[nplm1] - lons[nplm1 - 1]) { + self->k[2] = 0; + self->k[3] = nplm1; + nearest_lons_found = 1; + } + else + return GRIB_OUT_OF_AREA; } - } else { - if (inlon>lons[0] || inlonk[2]=0; - self->k[3]=nplm1; - nearest_lons_found=1; - } else return GRIB_OUT_OF_AREA; + } + else { + if (inlon > lons[0] || inlon < lons[nplm1]) { + if (lons[0] - lons[nplm1] - 360 <= + lons[0] - lons[1]) { + self->k[2] = 0; + self->k[3] = nplm1; + nearest_lons_found = 1; + } + else + return GRIB_OUT_OF_AREA; } } if (!nearest_lons_found) { - grib_binary_search(lons,pl[self->j[1]]-1,inlon, - &(self->k[2]),&(self->k[3])); + grib_binary_search(lons, pl[self->j[1]] - 1, inlon, + &(self->k[2]), &(self->k[3])); } - self->k[2]+=nlon; - self->k[3]+=nlon; + self->k[2] += nlon; + self->k[3] += nlon; - kk=0; - for (jj=0;jj<2;jj++) { - for (ii=0;ii<2;ii++) { - self->distances[kk]=grib_nearest_distance(radius,inlon,inlat, - self->lons[self->k[kk]],self->lats[self->j[jj]]); + kk = 0; + for (jj = 0; jj < 2; jj++) { + for (ii = 0; ii < 2; ii++) { + self->distances[kk] = grib_nearest_distance(radius, inlon, inlat, + self->lons[self->k[kk]], self->lats[self->j[jj]]); kk++; } } - grib_context_free(h->context,pla); + grib_context_free(h->context, pla); } - kk=0; - for (jj=0;jj<2;jj++) { - for (ii=0;ii<2;ii++) { - distances[kk]=self->distances[kk]; - outlats[kk]=self->lats[self->j[jj]]; - outlons[kk]=self->lons[self->k[kk]]; + kk = 0; + for (jj = 0; jj < 2; jj++) { + for (ii = 0; ii < 2; ii++) { + distances[kk] = self->distances[kk]; + outlats[kk] = self->lats[self->j[jj]]; + outlons[kk] = self->lons[self->k[kk]]; if (values) { /* ECC-499 */ - grib_get_double_element_internal(h,self->values_key,self->k[kk],&(values[kk])); + grib_get_double_element_internal(h, self->values_key, self->k[kk], &(values[kk])); } - indexes[kk]=self->k[kk]; + indexes[kk] = self->k[kk]; kk++; } } @@ -339,13 +372,19 @@ static int find(grib_nearest* nearest, grib_handle* h, return GRIB_SUCCESS; } -static int destroy(grib_nearest* nearest) { - grib_nearest_latlon_reduced* self = (grib_nearest_latlon_reduced*) nearest; - if (self->lats) grib_context_free(nearest->context,self->lats); - if (self->lons) grib_context_free(nearest->context,self->lons); - if (self->j) grib_context_free(nearest->context,self->j); - if (self->k) grib_context_free(nearest->context,self->k); - if (self->distances) grib_context_free(nearest->context,self->distances); +static int destroy(grib_nearest* nearest) +{ + grib_nearest_latlon_reduced* self = (grib_nearest_latlon_reduced*)nearest; + if (self->lats) + grib_context_free(nearest->context, self->lats); + if (self->lons) + grib_context_free(nearest->context, self->lons); + if (self->j) + grib_context_free(nearest->context, self->j); + if (self->k) + grib_context_free(nearest->context, self->k); + if (self->distances) + grib_context_free(nearest->context, self->distances); return GRIB_SUCCESS; } diff --git a/src/grib_nearest_class_polar_stereographic.c b/src/grib_nearest_class_polar_stereographic.c index a4d26c077..b41711a64 100644 --- a/src/grib_nearest_class_polar_stereographic.c +++ b/src/grib_nearest_class_polar_stereographic.c @@ -43,42 +43,43 @@ or edit "nearest.class" and rerun ./make_class.pl */ -static void init_class (grib_nearest_class*); - -static int init (grib_nearest* nearest,grib_handle* h,grib_arguments* args); -static int find(grib_nearest* nearest, grib_handle* h,double inlat, double inlon, unsigned long flags, double* outlats,double* outlons, double *values,double *distances, int *indexes,size_t *len); -static int destroy (grib_nearest* nearest); - -typedef struct grib_nearest_polar_stereographic{ - grib_nearest nearest; -/* Members defined in gen */ - const char* values_key; - const char* radius; - int cargs; -/* Members defined in polar_stereographic */ - double* lats; - int lats_count; - double* lons; - int lons_count; - double* distances; - int* k; - int* i; - int* j; - const char* Ni; - const char* Nj; +static void init_class(grib_nearest_class*); + +static int init(grib_nearest* nearest, grib_handle* h, grib_arguments* args); +static int find(grib_nearest* nearest, grib_handle* h, double inlat, double inlon, unsigned long flags, double* outlats, double* outlons, double* values, double* distances, int* indexes, size_t* len); +static int destroy(grib_nearest* nearest); + +typedef struct grib_nearest_polar_stereographic +{ + grib_nearest nearest; + /* Members defined in gen */ + const char* values_key; + const char* radius; + int cargs; + /* Members defined in polar_stereographic */ + double* lats; + int lats_count; + double* lons; + int lons_count; + double* distances; + int* k; + int* i; + int* j; + const char* Ni; + const char* Nj; } grib_nearest_polar_stereographic; extern grib_nearest_class* grib_nearest_class_gen; static grib_nearest_class _grib_nearest_class_polar_stereographic = { - &grib_nearest_class_gen, /* super */ - "polar_stereographic", /* name */ - sizeof(grib_nearest_polar_stereographic), /* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* constructor */ - &destroy, /* destructor */ - &find, /* find nearest */ + &grib_nearest_class_gen, /* super */ + "polar_stereographic", /* name */ + sizeof(grib_nearest_polar_stereographic), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* constructor */ + &destroy, /* destructor */ + &find, /* find nearest */ }; grib_nearest_class* grib_nearest_class_polar_stereographic = &_grib_nearest_class_polar_stereographic; @@ -89,158 +90,172 @@ static void init_class(grib_nearest_class* c) } /* END_CLASS_IMP */ -static int init(grib_nearest* nearest,grib_handle* h,grib_arguments* args) +static int init(grib_nearest* nearest, grib_handle* h, grib_arguments* args) { - grib_nearest_polar_stereographic* self = (grib_nearest_polar_stereographic*) nearest; - self->Ni = grib_arguments_get_name(h,args,self->cargs++); - self->Nj = grib_arguments_get_name(h,args,self->cargs++); - self->i=(int*)grib_context_malloc(h->context,2*sizeof(int)); - self->j=(int*)grib_context_malloc(h->context,2*sizeof(int)); + grib_nearest_polar_stereographic* self = (grib_nearest_polar_stereographic*)nearest; + self->Ni = grib_arguments_get_name(h, args, self->cargs++); + self->Nj = grib_arguments_get_name(h, args, self->cargs++); + self->i = (int*)grib_context_malloc(h->context, 2 * sizeof(int)); + self->j = (int*)grib_context_malloc(h->context, 2 * sizeof(int)); return 0; } -static int compare_doubles( const void* a, const void* b, int ascending ) +static int compare_doubles(const void* a, const void* b, int ascending) { /* ascending is a boolean: 0 or 1 */ - double* arg1 = (double*) a; - double* arg2 = (double*) b; + double* arg1 = (double*)a; + double* arg2 = (double*)b; if (ascending) { - if( *arg1 < *arg2 ) return -1; /*Smaller values come before larger ones*/ - } else { - if( *arg1 > *arg2 ) return -1; /*Larger values come before smaller ones*/ + if (*arg1 < *arg2) + return -1; /*Smaller values come before larger ones*/ } - if( *arg1 == *arg2 ) return 0; - else return 1; + else { + if (*arg1 > *arg2) + return -1; /*Larger values come before smaller ones*/ + } + if (*arg1 == *arg2) + return 0; + else + return 1; } -static int compare_doubles_ascending( const void* a, const void* b ) +static int compare_doubles_ascending(const void* a, const void* b) { - return compare_doubles(a,b,1); + return compare_doubles(a, b, 1); } -typedef struct PointStore { +typedef struct PointStore +{ double m_lat; double m_lon; double m_dist; double m_value; - int m_index; -} PointStore ; + int m_index; +} PointStore; /* Comparison function to sort points by distance */ static int compare_points(const void* a, const void* b) { - PointStore *pA = (PointStore*)a; - PointStore *pB = (PointStore*)b; + PointStore* pA = (PointStore*)a; + PointStore* pB = (PointStore*)b; - if (pA->m_dist < pB->m_dist) return -1; - if (pA->m_dist > pB->m_dist) return 1; + if (pA->m_dist < pB->m_dist) + return -1; + if (pA->m_dist > pB->m_dist) + return 1; return 0; } static int find(grib_nearest* nearest, grib_handle* h, - double inlat, double inlon,unsigned long flags, - double* outlats,double* outlons, - double *values,double *distances,int* indexes, size_t *len) + double inlat, double inlon, unsigned long flags, + double* outlats, double* outlons, + double* values, double* distances, int* indexes, size_t* len) { - grib_nearest_polar_stereographic* self = (grib_nearest_polar_stereographic*) nearest; - int ret=0, i=0; - size_t nvalues=0; + grib_nearest_polar_stereographic* self = (grib_nearest_polar_stereographic*)nearest; + int ret = 0, i = 0; + size_t nvalues = 0; long iradius; double radius; - grib_iterator* iter=NULL; - double lat=0,lon=0; + grib_iterator* iter = NULL; + double lat = 0, lon = 0; /* array of candidates for nearest neighbours */ PointStore* neighbours = NULL; - while (inlon<0) inlon+=360; - while (inlon>360) inlon-=360; + while (inlon < 0) + inlon += 360; + while (inlon > 360) + inlon -= 360; - if( (ret = grib_get_size(h,self->values_key,&nvalues))!= GRIB_SUCCESS) + if ((ret = grib_get_size(h, self->values_key, &nvalues)) != GRIB_SUCCESS) return ret; nearest->values_count = nvalues; - if (grib_is_missing(h,self->radius,&ret)) { - grib_context_log(h->context, GRIB_LOG_DEBUG,"Key '%s' is missing", self->radius); + if (grib_is_missing(h, self->radius, &ret)) { + grib_context_log(h->context, GRIB_LOG_DEBUG, "Key '%s' is missing", self->radius); return ret ? ret : GRIB_GEOCALCULUS_PROBLEM; } - if( (ret = grib_get_long(h,self->radius,&iradius))!= GRIB_SUCCESS) + if ((ret = grib_get_long(h, self->radius, &iradius)) != GRIB_SUCCESS) return ret; - radius=((double)iradius)/1000.0; - - neighbours = (PointStore*)grib_context_malloc( nearest->context, nvalues*sizeof(PointStore) ); - for(i=0; icontext, nvalues * sizeof(PointStore)); + for (i = 0; i < nvalues; ++i) { + neighbours[i].m_dist = 1e10; /* set all distances to large number to begin with */ + neighbours[i].m_lat = 0; + neighbours[i].m_lon = 0; + neighbours[i].m_value = 0; + neighbours[i].m_index = 0; } /* GRIB_NEAREST_SAME_GRID not yet implemented */ { double the_value = 0; - double min_dist = 1e10; + double min_dist = 1e10; size_t the_index = 0; - int ilat=0, ilon=0; - int idx_upper=0, idx_lower=0; - double lat1=0, lat2=0; /* inlat will be between these */ - double dist=0; + int ilat = 0, ilon = 0; + int idx_upper = 0, idx_lower = 0; + double lat1 = 0, lat2 = 0; /* inlat will be between these */ + double dist = 0; const double LAT_DELTA = 10.0; /* in degrees */ - if (grib_is_missing(h,self->Ni,&ret)) { - grib_context_log(h->context, GRIB_LOG_DEBUG,"Key '%s' is missing", self->Ni); + if (grib_is_missing(h, self->Ni, &ret)) { + grib_context_log(h->context, GRIB_LOG_DEBUG, "Key '%s' is missing", self->Ni); return ret ? ret : GRIB_GEOCALCULUS_PROBLEM; } - if (grib_is_missing(h,self->Nj,&ret)) { - grib_context_log(h->context, GRIB_LOG_DEBUG,"Key '%s' is missing", self->Nj); + if (grib_is_missing(h, self->Nj, &ret)) { + grib_context_log(h->context, GRIB_LOG_DEBUG, "Key '%s' is missing", self->Nj); return ret ? ret : GRIB_GEOCALCULUS_PROBLEM; } - self->lons_count=nvalues; /* Maybe overestimate but safe */ - self->lats_count=nvalues; + self->lons_count = nvalues; /* Maybe overestimate but safe */ + self->lats_count = nvalues; - if (self->lats) grib_context_free(nearest->context,self->lats); - self->lats=(double*)grib_context_malloc( nearest->context, nvalues* sizeof(double)); - if (!self->lats) return GRIB_OUT_OF_MEMORY; + if (self->lats) + grib_context_free(nearest->context, self->lats); + self->lats = (double*)grib_context_malloc(nearest->context, nvalues * sizeof(double)); + if (!self->lats) + return GRIB_OUT_OF_MEMORY; - if (self->lons) grib_context_free(nearest->context,self->lons); - self->lons=(double*)grib_context_malloc( nearest->context, nvalues*sizeof(double)); - if (!self->lons) return GRIB_OUT_OF_MEMORY; + if (self->lons) + grib_context_free(nearest->context, self->lons); + self->lons = (double*)grib_context_malloc(nearest->context, nvalues * sizeof(double)); + if (!self->lons) + return GRIB_OUT_OF_MEMORY; - iter=grib_iterator_new(h,0,&ret); - if (ret) return ret; + iter = grib_iterator_new(h, 0, &ret); + if (ret) + return ret; /* First pass: collect all latitudes and longitudes */ - while(grib_iterator_next(iter,&lat,&lon,&the_value)) - { + while (grib_iterator_next(iter, &lat, &lon, &the_value)) { ++the_index; Assert(ilat < self->lats_count); Assert(ilon < self->lons_count); - self->lats[ilat++]=lat; - self->lons[ilon++]=lon; + self->lats[ilat++] = lat; + self->lons[ilon++] = lon; } /* See between which 2 latitudes our point lies */ qsort(self->lats, nvalues, sizeof(double), &compare_doubles_ascending); - grib_binary_search(self->lats, self->lats_count-1, inlat, &idx_upper, &idx_lower); + grib_binary_search(self->lats, self->lats_count - 1, inlat, &idx_upper, &idx_lower); lat2 = self->lats[idx_upper]; lat1 = self->lats[idx_lower]; - Assert(lat1<=lat2); + Assert(lat1 <= lat2); /* Second pass: Iterate again and collect candidate neighbours */ grib_iterator_reset(iter); - the_index=0; - i = 0; - while(grib_iterator_next(iter,&lat,&lon,&the_value)) - { - if (lat > lat2+LAT_DELTA || lat < lat1-LAT_DELTA) { + the_index = 0; + i = 0; + while (grib_iterator_next(iter, &lat, &lon, &the_value)) { + if (lat > lat2 + LAT_DELTA || lat < lat1 - LAT_DELTA) { /* Ignore latitudes too far from our point */ } else { dist = grib_nearest_distance(radius, inlon, inlat, lon, lat); - if (dist < min_dist) min_dist = dist; + if (dist < min_dist) + min_dist = dist; /*printf("Candidate: lat=%.5f lon=%.5f dist=%f Idx=%ld Val=%f\n",lat,lon,dist,the_index,the_value);*/ /* store this candidate point */ neighbours[i].m_dist = dist; @@ -258,26 +273,25 @@ static int find(grib_nearest* nearest, grib_handle* h, grib_iterator_delete(iter); } - nearest->h=h; + nearest->h = h; /* Sanity check for sorting */ #ifdef DEBUG - for(i=0; idistances) { - self->distances=(double*)grib_context_malloc( nearest->context,4*sizeof(double)); + self->distances = (double*)grib_context_malloc(nearest->context, 4 * sizeof(double)); } self->distances[0] = neighbours[0].m_dist; self->distances[1] = neighbours[1].m_dist; self->distances[2] = neighbours[2].m_dist; self->distances[3] = neighbours[3].m_dist; - for(i=0; i <4; ++i) - { + for (i = 0; i < 4; ++i) { distances[i] = neighbours[i].m_dist; outlats[i] = neighbours[i].m_lat; outlons[i] = neighbours[i].m_lon; @@ -292,12 +306,18 @@ static int find(grib_nearest* nearest, grib_handle* h, static int destroy(grib_nearest* nearest) { - grib_nearest_polar_stereographic* self = (grib_nearest_polar_stereographic*) nearest; - if (self->lats) grib_context_free(nearest->context,self->lats); - if (self->lons) grib_context_free(nearest->context,self->lons); - if (self->i) grib_context_free(nearest->context,self->i); - if (self->j) grib_context_free(nearest->context,self->j); - if (self->k) grib_context_free(nearest->context,self->k); - if (self->distances) grib_context_free(nearest->context,self->distances); + grib_nearest_polar_stereographic* self = (grib_nearest_polar_stereographic*)nearest; + if (self->lats) + grib_context_free(nearest->context, self->lats); + if (self->lons) + grib_context_free(nearest->context, self->lons); + if (self->i) + grib_context_free(nearest->context, self->i); + if (self->j) + grib_context_free(nearest->context, self->j); + if (self->k) + grib_context_free(nearest->context, self->k); + if (self->distances) + grib_context_free(nearest->context, self->distances); return GRIB_SUCCESS; } diff --git a/src/grib_nearest_class_reduced.c b/src/grib_nearest_class_reduced.c index c56af6799..40cc92e55 100644 --- a/src/grib_nearest_class_reduced.c +++ b/src/grib_nearest_class_reduced.c @@ -43,43 +43,44 @@ or edit "nearest.class" and rerun ./make_class.pl */ -static void init_class (grib_nearest_class*); - -static int init (grib_nearest* nearest,grib_handle* h,grib_arguments* args); -static int find(grib_nearest* nearest, grib_handle* h,double inlat, double inlon, unsigned long flags, double* outlats,double* outlons, double *values,double *distances, int *indexes,size_t *len); -static int destroy (grib_nearest* nearest); - -typedef struct grib_nearest_reduced{ - grib_nearest nearest; -/* Members defined in gen */ - const char* values_key; - const char* radius; - int cargs; -/* Members defined in reduced */ - double* lats; - int lats_count; - double* lons; - double* distances; - int* k; - int* j; - const char* Nj; - const char* pl; - long global; - double lon_first; - double lon_last; +static void init_class(grib_nearest_class*); + +static int init(grib_nearest* nearest, grib_handle* h, grib_arguments* args); +static int find(grib_nearest* nearest, grib_handle* h, double inlat, double inlon, unsigned long flags, double* outlats, double* outlons, double* values, double* distances, int* indexes, size_t* len); +static int destroy(grib_nearest* nearest); + +typedef struct grib_nearest_reduced +{ + grib_nearest nearest; + /* Members defined in gen */ + const char* values_key; + const char* radius; + int cargs; + /* Members defined in reduced */ + double* lats; + int lats_count; + double* lons; + double* distances; + int* k; + int* j; + const char* Nj; + const char* pl; + long global; + double lon_first; + double lon_last; } grib_nearest_reduced; extern grib_nearest_class* grib_nearest_class_gen; static grib_nearest_class _grib_nearest_class_reduced = { - &grib_nearest_class_gen, /* super */ - "reduced", /* name */ - sizeof(grib_nearest_reduced), /* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* constructor */ - &destroy, /* destructor */ - &find, /* find nearest */ + &grib_nearest_class_gen, /* super */ + "reduced", /* name */ + sizeof(grib_nearest_reduced), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* constructor */ + &destroy, /* destructor */ + &find, /* find nearest */ }; grib_nearest_class* grib_nearest_class_reduced = &_grib_nearest_class_reduced; @@ -90,31 +91,32 @@ static void init_class(grib_nearest_class* c) } /* END_CLASS_IMP */ -static int init(grib_nearest* nearest,grib_handle* h,grib_arguments* args) +static int init(grib_nearest* nearest, grib_handle* h, grib_arguments* args) { - grib_nearest_reduced* self = (grib_nearest_reduced*) nearest; - self->Nj = grib_arguments_get_name(h,args,self->cargs++); - self->pl = grib_arguments_get_name(h,args,self->cargs++); - self->j=(int*)grib_context_malloc(h->context,2*sizeof(int)); - if (!self->j) return GRIB_OUT_OF_MEMORY; - self->k=(int*)grib_context_malloc( nearest->context,4*sizeof(int)); - if (!self->k) return GRIB_OUT_OF_MEMORY; - grib_get_long(h,"global",&self->global); - if (!self->global) - { + grib_nearest_reduced* self = (grib_nearest_reduced*)nearest; + self->Nj = grib_arguments_get_name(h, args, self->cargs++); + self->pl = grib_arguments_get_name(h, args, self->cargs++); + self->j = (int*)grib_context_malloc(h->context, 2 * sizeof(int)); + if (!self->j) + return GRIB_OUT_OF_MEMORY; + self->k = (int*)grib_context_malloc(nearest->context, 4 * sizeof(int)); + if (!self->k) + return GRIB_OUT_OF_MEMORY; + grib_get_long(h, "global", &self->global); + if (!self->global) { int ret; /*TODO longitudeOfFirstGridPointInDegrees from the def file*/ - if ((ret=grib_get_double(h,"longitudeOfFirstGridPointInDegrees",&self->lon_first))!=GRIB_SUCCESS) { - grib_context_log(h->context,GRIB_LOG_ERROR, - "grib_nearest_reduced.find(): unable to get longitudeOfFirstGridPointInDegrees %s\n", - grib_get_error_message(ret)); + if ((ret = grib_get_double(h, "longitudeOfFirstGridPointInDegrees", &self->lon_first)) != GRIB_SUCCESS) { + grib_context_log(h->context, GRIB_LOG_ERROR, + "grib_nearest_reduced.find(): unable to get longitudeOfFirstGridPointInDegrees %s\n", + grib_get_error_message(ret)); return ret; } /*TODO longitudeOfLastGridPointInDegrees from the def file*/ - if ((ret=grib_get_double(h,"longitudeOfLastGridPointInDegrees",&self->lon_last))!=GRIB_SUCCESS) { - grib_context_log(h->context,GRIB_LOG_ERROR, - "grib_nearest_reduced.find(): unable to get longitudeOfLastGridPointInDegrees %s\n", - grib_get_error_message(ret)); + if ((ret = grib_get_double(h, "longitudeOfLastGridPointInDegrees", &self->lon_last)) != GRIB_SUCCESS) { + grib_context_log(h->context, GRIB_LOG_ERROR, + "grib_nearest_reduced.find(): unable to get longitudeOfLastGridPointInDegrees %s\n", + grib_get_error_message(ret)); return ret; } } @@ -127,265 +129,308 @@ typedef void (*get_reduced_row_proc)(long pl, double lon_first, double lon_last, static int is_legacy(grib_handle* h) { long is_legacy = 0; - return (grib_get_long(h, "legacyGaussSubarea", &is_legacy)==GRIB_SUCCESS && is_legacy==1); + return (grib_get_long(h, "legacyGaussSubarea", &is_legacy) == GRIB_SUCCESS && is_legacy == 1); } #if 1 static int find(grib_nearest* nearest, grib_handle* h, - double inlat, double inlon,unsigned long flags, - double* outlats,double* outlons, double *values, - double *distances,int *indexes, size_t *len) { - grib_nearest_reduced* self = (grib_nearest_reduced*) nearest; - int ret=0,kk=0,ii=0,jj=0; - long* pla=NULL; - long* pl=NULL; - size_t nvalues=0; - grib_iterator* iter=NULL; - double lat=0,lon=0; + double inlat, double inlon, unsigned long flags, + double* outlats, double* outlons, double* values, + double* distances, int* indexes, size_t* len) +{ + grib_nearest_reduced* self = (grib_nearest_reduced*)nearest; + int ret = 0, kk = 0, ii = 0, jj = 0; + long* pla = NULL; + long* pl = NULL; + size_t nvalues = 0; + grib_iterator* iter = NULL; + double lat = 0, lon = 0; long iradius; double radius; - int ilat=0,ilon=0; - const int is_legacy_grib = is_legacy(h); + int ilat = 0, ilon = 0; + const int is_legacy_grib = is_legacy(h); get_reduced_row_proc get_reduced_row_func = &grib_get_reduced_row; if (is_legacy_grib) { get_reduced_row_func = &grib_get_reduced_row_legacy; } - if( (ret = grib_get_size(h,self->values_key,&nvalues))!= GRIB_SUCCESS) + if ((ret = grib_get_size(h, self->values_key, &nvalues)) != GRIB_SUCCESS) return ret; nearest->values_count = nvalues; - if (grib_is_missing(h,self->radius,&ret)) { - grib_context_log(h->context, GRIB_LOG_DEBUG,"Key '%s' is missing", self->radius); + if (grib_is_missing(h, self->radius, &ret)) { + grib_context_log(h->context, GRIB_LOG_DEBUG, "Key '%s' is missing", self->radius); return ret ? ret : GRIB_GEOCALCULUS_PROBLEM; } - if( (ret = grib_get_long(h,self->radius,&iradius))!= GRIB_SUCCESS) + if ((ret = grib_get_long(h, self->radius, &iradius)) != GRIB_SUCCESS) return ret; - radius=((double)iradius)/1000.0; + radius = ((double)iradius) / 1000.0; - if (!nearest->h || (flags & GRIB_NEAREST_SAME_GRID)==0) { - double dummy=0; - double olat=1.e10; - long n=0; + if (!nearest->h || (flags & GRIB_NEAREST_SAME_GRID) == 0) { + double dummy = 0; + double olat = 1.e10; + long n = 0; - ilat=0; ilon=0; - if (grib_is_missing(h,self->Nj,&ret)) { - grib_context_log(h->context, GRIB_LOG_DEBUG,"Key '%s' is missing", self->Nj); + ilat = 0; + ilon = 0; + if (grib_is_missing(h, self->Nj, &ret)) { + grib_context_log(h->context, GRIB_LOG_DEBUG, "Key '%s' is missing", self->Nj); return ret ? ret : GRIB_GEOCALCULUS_PROBLEM; } - if( (ret = grib_get_long(h,self->Nj,&n))!= GRIB_SUCCESS) + if ((ret = grib_get_long(h, self->Nj, &n)) != GRIB_SUCCESS) return ret; - self->lats_count=n; - - if (self->lats) grib_context_free(nearest->context,self->lats); - self->lats=(double*)grib_context_malloc( nearest->context, - self->lats_count* sizeof(double)); - if (!self->lats) return GRIB_OUT_OF_MEMORY; - - if (self->lons) grib_context_free(nearest->context,self->lons); - self->lons=(double*)grib_context_malloc( nearest->context, - nearest->values_count*sizeof(double)); - if (!self->lons) return GRIB_OUT_OF_MEMORY; - - iter=grib_iterator_new(h,0,&ret); + self->lats_count = n; + + if (self->lats) + grib_context_free(nearest->context, self->lats); + self->lats = (double*)grib_context_malloc(nearest->context, + self->lats_count * sizeof(double)); + if (!self->lats) + return GRIB_OUT_OF_MEMORY; + + if (self->lons) + grib_context_free(nearest->context, self->lons); + self->lons = (double*)grib_context_malloc(nearest->context, + nearest->values_count * sizeof(double)); + if (!self->lons) + return GRIB_OUT_OF_MEMORY; + + iter = grib_iterator_new(h, 0, &ret); if (ret != GRIB_SUCCESS) { - grib_context_log(h->context,GRIB_LOG_ERROR,"Unable to create lat/lon iterator"); + grib_context_log(h->context, GRIB_LOG_ERROR, "Unable to create lat/lon iterator"); return ret; } - while(grib_iterator_next(iter,&lat,&lon,&dummy)) { - if (olat!=lat) { - self->lats[ilat++]=lat; - olat=lat; + while (grib_iterator_next(iter, &lat, &lon, &dummy)) { + if (olat != lat) { + self->lats[ilat++] = lat; + olat = lat; } - while(lon>360) lon-=360; - if(!self->global) { /* ECC-756 */ + while (lon > 360) + lon -= 360; + if (!self->global) { /* ECC-756 */ if (!is_legacy_grib) /*TODO*/ - if (lon>180 && lon<360) lon-=360; + if (lon > 180 && lon < 360) + lon -= 360; } - self->lons[ilon++]=lon; + self->lons[ilon++] = lon; } - self->lats_count=ilat; + self->lats_count = ilat; grib_iterator_delete(iter); - } - nearest->h=h; + nearest->h = h; - if (!self->distances || (flags & GRIB_NEAREST_SAME_POINT)==0 - || (flags & GRIB_NEAREST_SAME_GRID)==0) { - double* lons=NULL; - int nlon=0; - size_t plsize=0; - long nplm1=0; - int nearest_lons_found=0; - long row_count,ilon_first,ilon_last; + if (!self->distances || (flags & GRIB_NEAREST_SAME_POINT) == 0 || (flags & GRIB_NEAREST_SAME_GRID) == 0) { + double* lons = NULL; + int nlon = 0; + size_t plsize = 0; + long nplm1 = 0; + int nearest_lons_found = 0; + long row_count, ilon_first, ilon_last; if (self->global) { - while (inlon<0) inlon+=360; - while (inlon>360) inlon-=360; - } else { + while (inlon < 0) + inlon += 360; + while (inlon > 360) + inlon -= 360; + } + else { /* TODO: Experimental */ if (!is_legacy_grib) - if (inlon>180 && inlon<360) inlon-=360; + if (inlon > 180 && inlon < 360) + inlon -= 360; } - ilat=self->lats_count; - if (self->lats[ilat-1] > self->lats[0]) { - if (inlat < self->lats[0] || inlat > self->lats[ilat-1]) + ilat = self->lats_count; + if (self->lats[ilat - 1] > self->lats[0]) { + if (inlat < self->lats[0] || inlat > self->lats[ilat - 1]) return GRIB_OUT_OF_AREA; - } else { - if (inlat > self->lats[0] || inlat < self->lats[ilat-1]) + } + else { + if (inlat > self->lats[0] || inlat < self->lats[ilat - 1]) return GRIB_OUT_OF_AREA; } if (!self->distances) - self->distances=(double*)grib_context_malloc( nearest->context,4*sizeof(double)); - if (!self->distances) return GRIB_OUT_OF_MEMORY; + self->distances = (double*)grib_context_malloc(nearest->context, 4 * sizeof(double)); + if (!self->distances) + return GRIB_OUT_OF_MEMORY; - grib_binary_search(self->lats,ilat-1,inlat, - &(self->j[0]),&(self->j[1])); + grib_binary_search(self->lats, ilat - 1, inlat, + &(self->j[0]), &(self->j[1])); - plsize=self->lats_count; - if( (ret=grib_get_size(h,self->pl,&plsize))!= GRIB_SUCCESS) + plsize = self->lats_count; + if ((ret = grib_get_size(h, self->pl, &plsize)) != GRIB_SUCCESS) return ret; - pla=(long*)grib_context_malloc(h->context,plsize*sizeof(long)); - if (!pla) return GRIB_OUT_OF_MEMORY; - if( (ret=grib_get_long_array(h,self->pl,pla,&plsize))!= GRIB_SUCCESS) + pla = (long*)grib_context_malloc(h->context, plsize * sizeof(long)); + if (!pla) + return GRIB_OUT_OF_MEMORY; + if ((ret = grib_get_long_array(h, self->pl, pla, &plsize)) != GRIB_SUCCESS) return ret; - pl=pla; - while ((*pl)==0) {pl++;} + pl = pla; + while ((*pl) == 0) { + pl++; + } - nlon=0; + nlon = 0; if (self->global) { - for (jj=0;jjj[0];jj++) nlon+=pl[jj]; - nplm1=pl[self->j[0]]-1; - } else { - nlon=0; - for (jj=0;jjj[0];jj++) { - row_count=0;ilon_first=0;ilon_last=0; - get_reduced_row_func(pl[jj],self->lon_first,self->lon_last,&row_count,&ilon_first,&ilon_last); - nlon+=row_count; + for (jj = 0; jj < self->j[0]; jj++) + nlon += pl[jj]; + nplm1 = pl[self->j[0]] - 1; + } + else { + nlon = 0; + for (jj = 0; jj < self->j[0]; jj++) { + row_count = 0; + ilon_first = 0; + ilon_last = 0; + get_reduced_row_func(pl[jj], self->lon_first, self->lon_last, &row_count, &ilon_first, &ilon_last); + nlon += row_count; } - row_count=0;ilon_first=0;ilon_last=0; - get_reduced_row_func(pl[self->j[0]],self->lon_first,self->lon_last,&row_count,&ilon_first,&ilon_last); - nplm1=row_count-1; + row_count = 0; + ilon_first = 0; + ilon_last = 0; + get_reduced_row_func(pl[self->j[0]], self->lon_first, self->lon_last, &row_count, &ilon_first, &ilon_last); + nplm1 = row_count - 1; } - lons=self->lons+nlon; + lons = self->lons + nlon; - nearest_lons_found=0; + nearest_lons_found = 0; /* ECC-756: The comparisons of longitudes here depends on the longitude values * from the point iterator. The old values could be -ve but the new algorithm * generates +ve values which break this test: * lons[nplm1]>lons[0] */ - if (lons[nplm1]>lons[0]) { - if (inlon< lons[0] || inlon > lons[nplm1]) { - if (lons[nplm1]-lons[0]-360 <= lons[nplm1]-lons[nplm1-1]) { - self->k[0]=0; - self->k[1]=nplm1; - nearest_lons_found=1; - } else return GRIB_OUT_OF_AREA; + if (lons[nplm1] > lons[0]) { + if (inlon < lons[0] || inlon > lons[nplm1]) { + if (lons[nplm1] - lons[0] - 360 <= lons[nplm1] - lons[nplm1 - 1]) { + self->k[0] = 0; + self->k[1] = nplm1; + nearest_lons_found = 1; + } + else + return GRIB_OUT_OF_AREA; } - } else { - if (inlon >lons[0] || inlon< lons[nplm1]) { - if (lons[0]-lons[nplm1]-360 <= lons[0]-lons[1]) { - self->k[0]=0; - self->k[1]=nplm1; - nearest_lons_found=1; - } else return GRIB_OUT_OF_AREA; + } + else { + if (inlon > lons[0] || inlon < lons[nplm1]) { + if (lons[0] - lons[nplm1] - 360 <= lons[0] - lons[1]) { + self->k[0] = 0; + self->k[1] = nplm1; + nearest_lons_found = 1; + } + else + return GRIB_OUT_OF_AREA; } } if (!nearest_lons_found) { if (!self->global) { - row_count=0;ilon_first=0;ilon_last=0; - get_reduced_row_func(pl[self->j[0]],self->lon_first,self->lon_last,&row_count,&ilon_first,&ilon_last); - } else { - row_count=pl[self->j[0]]; + row_count = 0; + ilon_first = 0; + ilon_last = 0; + get_reduced_row_func(pl[self->j[0]], self->lon_first, self->lon_last, &row_count, &ilon_first, &ilon_last); + } + else { + row_count = pl[self->j[0]]; } - grib_binary_search(lons,row_count-1,inlon, - &(self->k[0]),&(self->k[1])); + grib_binary_search(lons, row_count - 1, inlon, + &(self->k[0]), &(self->k[1])); } - self->k[0]+=nlon; - self->k[1]+=nlon; + self->k[0] += nlon; + self->k[1] += nlon; - nlon=0; + nlon = 0; if (self->global) { - for (jj=0;jjj[1];jj++) nlon+=pl[jj]; - nplm1=pl[self->j[1]]-1; - } else { - for (jj=0;jjj[1];jj++) { - row_count=0;ilon_first=0;ilon_last=0; - get_reduced_row_func(pl[jj],self->lon_first,self->lon_last,&row_count,&ilon_first,&ilon_last); - nlon+=row_count; + for (jj = 0; jj < self->j[1]; jj++) + nlon += pl[jj]; + nplm1 = pl[self->j[1]] - 1; + } + else { + for (jj = 0; jj < self->j[1]; jj++) { + row_count = 0; + ilon_first = 0; + ilon_last = 0; + get_reduced_row_func(pl[jj], self->lon_first, self->lon_last, &row_count, &ilon_first, &ilon_last); + nlon += row_count; } - row_count=0;ilon_first=0;ilon_last=0; - get_reduced_row_func(pl[self->j[1]],self->lon_first,self->lon_last,&nplm1,&ilon_first,&ilon_last); + row_count = 0; + ilon_first = 0; + ilon_last = 0; + get_reduced_row_func(pl[self->j[1]], self->lon_first, self->lon_last, &nplm1, &ilon_first, &ilon_last); nplm1--; } - lons=self->lons+nlon; - - nearest_lons_found=0; - if (lons[nplm1]>lons[0]) { - if (inlonlons[nplm1]) { - if (lons[nplm1]-lons[0]-360 <= - lons[nplm1]-lons[nplm1-1]) { - self->k[2]=0; - self->k[3]=nplm1; - nearest_lons_found=1; - } else return GRIB_OUT_OF_AREA; + lons = self->lons + nlon; + + nearest_lons_found = 0; + if (lons[nplm1] > lons[0]) { + if (inlon < lons[0] || inlon > lons[nplm1]) { + if (lons[nplm1] - lons[0] - 360 <= + lons[nplm1] - lons[nplm1 - 1]) { + self->k[2] = 0; + self->k[3] = nplm1; + nearest_lons_found = 1; + } + else + return GRIB_OUT_OF_AREA; } - } else { - if (inlon>lons[0] || inlonk[2]=0; - self->k[3]=nplm1; - nearest_lons_found=1; - } else return GRIB_OUT_OF_AREA; + } + else { + if (inlon > lons[0] || inlon < lons[nplm1]) { + if (lons[0] - lons[nplm1] - 360 <= + lons[0] - lons[1]) { + self->k[2] = 0; + self->k[3] = nplm1; + nearest_lons_found = 1; + } + else + return GRIB_OUT_OF_AREA; } } if (!nearest_lons_found) { if (!self->global) { - row_count=0;ilon_first=0;ilon_last=0; - get_reduced_row_func(pl[self->j[1]],self->lon_first,self->lon_last,&row_count,&ilon_first,&ilon_last); - } else { - row_count=pl[self->j[1]]; + row_count = 0; + ilon_first = 0; + ilon_last = 0; + get_reduced_row_func(pl[self->j[1]], self->lon_first, self->lon_last, &row_count, &ilon_first, &ilon_last); + } + else { + row_count = pl[self->j[1]]; } - grib_binary_search(lons,row_count-1,inlon, - &(self->k[2]),&(self->k[3])); + grib_binary_search(lons, row_count - 1, inlon, + &(self->k[2]), &(self->k[3])); } - self->k[2]+=nlon; - self->k[3]+=nlon; + self->k[2] += nlon; + self->k[3] += nlon; - kk=0; - for (jj=0;jj<2;jj++) { - for (ii=0;ii<2;ii++) { - self->distances[kk]=grib_nearest_distance(radius,inlon,inlat, - self->lons[self->k[kk]],self->lats[self->j[jj]]); + kk = 0; + for (jj = 0; jj < 2; jj++) { + for (ii = 0; ii < 2; ii++) { + self->distances[kk] = grib_nearest_distance(radius, inlon, inlat, + self->lons[self->k[kk]], self->lats[self->j[jj]]); kk++; } } - grib_context_free(h->context,pla); + grib_context_free(h->context, pla); } - kk=0; - for (jj=0;jj<2;jj++) { - for (ii=0;ii<2;ii++) { - distances[kk]=self->distances[kk]; - outlats[kk]=self->lats[self->j[jj]]; - outlons[kk]=self->lons[self->k[kk]]; + kk = 0; + for (jj = 0; jj < 2; jj++) { + for (ii = 0; ii < 2; ii++) { + distances[kk] = self->distances[kk]; + outlats[kk] = self->lats[self->j[jj]]; + outlons[kk] = self->lons[self->k[kk]]; if (values) { /* ECC-499 */ - grib_get_double_element_internal(h,self->values_key,self->k[kk],&(values[kk])); + grib_get_double_element_internal(h, self->values_key, self->k[kk], &(values[kk])); } - indexes[kk]=self->k[kk]; + indexes[kk] = self->k[kk]; kk++; } } @@ -394,124 +439,135 @@ static int find(grib_nearest* nearest, grib_handle* h, } #else static int find(grib_nearest* nearest, grib_handle* h, - double inlat, double inlon,unsigned long flags, - double* outlats,double* outlons, double *values, - double *distances,double *distances,int *indexes,size_t *len) { - grib_nearest_reduced* self = (grib_nearest_reduced*) nearest; - int ret=0,kk=0,ii=0,jj=0; - double* pl=NULL; + double inlat, double inlon, unsigned long flags, + double* outlats, double* outlons, double* values, + double* distances, double* distances, int* indexes, size_t* len) +{ + grib_nearest_reduced* self = (grib_nearest_reduced*)nearest; + int ret = 0, kk = 0, ii = 0, jj = 0; + double* pl = NULL; int ilat; - size_t nvalues=0; - if (!nearest->h || (flags & GRIB_NEAREST_SAME_DATA)==0 || nearest->h!=h) { - grib_iterator* iter=NULL; - double lat=0,lon=0; + size_t nvalues = 0; + if (!nearest->h || (flags & GRIB_NEAREST_SAME_DATA) == 0 || nearest->h != h) { + grib_iterator* iter = NULL; + double lat = 0, lon = 0; - if( (ret = grib_get_size(h,self->values_key,&nvalues))!= GRIB_SUCCESS) + if ((ret = grib_get_size(h, self->values_key, &nvalues)) != GRIB_SUCCESS) return ret; nearest->values_count = nvalues; - if (nearest->values) grib_context_free(nearest->context,nearest->values); - nearest->values = grib_context_malloc(h->context,nvalues*sizeof(double)); - if (!nearest->values) return GRIB_OUT_OF_MEMORY; - - ret=grib_get_double_array_internal( h,self->values_key, - nearest->values,&(nearest->values_count)); - if (ret!=GRIB_SUCCESS) grib_context_log(nearest->context,GRIB_LOG_ERROR, - "nearest: unable to get values array"); - - if (!nearest->h || (flags & GRIB_NEAREST_SAME_GRID)==0) { - double dummy=0; - double olat=1.e10; - ilat=0,ilon=0; - long n=0; - - if (grib_is_missing(h,self->Nj,&ret)) { - grib_context_log(h->context, GRIB_LOG_DEBUG,"Key '%s' is missing", self->Nj); + if (nearest->values) + grib_context_free(nearest->context, nearest->values); + nearest->values = grib_context_malloc(h->context, nvalues * sizeof(double)); + if (!nearest->values) + return GRIB_OUT_OF_MEMORY; + + ret = grib_get_double_array_internal(h, self->values_key, + nearest->values, &(nearest->values_count)); + if (ret != GRIB_SUCCESS) + grib_context_log(nearest->context, GRIB_LOG_ERROR, + "nearest: unable to get values array"); + + if (!nearest->h || (flags & GRIB_NEAREST_SAME_GRID) == 0) { + double dummy = 0; + double olat = 1.e10; + ilat = 0, ilon = 0; + long n = 0; + + if (grib_is_missing(h, self->Nj, &ret)) { + grib_context_log(h->context, GRIB_LOG_DEBUG, "Key '%s' is missing", self->Nj); return ret ? ret : GRIB_GEOCALCULUS_PROBLEM; } - if( (ret = grib_get_long(h,self->Nj,&n))!= GRIB_SUCCESS) + if ((ret = grib_get_long(h, self->Nj, &n)) != GRIB_SUCCESS) return ret; - self->lats_count=n; - - if (self->lats) grib_context_free(nearest->context,self->lats); - self->lats=grib_context_malloc( nearest->context, - self->lats_count* sizeof(double)); - if (!self->lats) return GRIB_OUT_OF_MEMORY; - - if (self->lons) grib_context_free(nearest->context,self->lons); - self->lons=grib_context_malloc( nearest->context, - nearest->values_count*sizeof(double)); - if (!self->lons) return GRIB_OUT_OF_MEMORY; - - iter=grib_iterator_new(h,0,&ret); - while(grib_iterator_next(iter,&lat,&lon,&dummy)) { - if (olat!=lat) {self->lats[ilat++]=lat;olat=lat;} - self->lons[ilon++]=lon; + self->lats_count = n; + + if (self->lats) + grib_context_free(nearest->context, self->lats); + self->lats = grib_context_malloc(nearest->context, + self->lats_count * sizeof(double)); + if (!self->lats) + return GRIB_OUT_OF_MEMORY; + + if (self->lons) + grib_context_free(nearest->context, self->lons); + self->lons = grib_context_malloc(nearest->context, + nearest->values_count * sizeof(double)); + if (!self->lons) + return GRIB_OUT_OF_MEMORY; + + iter = grib_iterator_new(h, 0, &ret); + while (grib_iterator_next(iter, &lat, &lon, &dummy)) { + if (olat != lat) { + self->lats[ilat++] = lat; + olat = lat; + } + self->lons[ilon++] = lon; } grib_iterator_delete(iter); } - nearest->h=h; - + nearest->h = h; } - if (!self->distances || (flags & GRIB_NEAREST_SAME_POINT)==0 - || (flags & GRIB_NEAREST_SAME_GRID)==0) { - double* lons=NULL; - int nlon=0; - int plsize=0; + if (!self->distances || (flags & GRIB_NEAREST_SAME_POINT) == 0 || (flags & GRIB_NEAREST_SAME_GRID) == 0) { + double* lons = NULL; + int nlon = 0; + int plsize = 0; - self->distances=(double*)grib_context_malloc( nearest->context,4*sizeof(double)); - if (!self->distances) return GRIB_OUT_OF_MEMORY; + self->distances = (double*)grib_context_malloc(nearest->context, 4 * sizeof(double)); + if (!self->distances) + return GRIB_OUT_OF_MEMORY; - grib_binary_search(self->lats,self->lats_count-1,inlat, - &(self->j[0]),&(self->j[1])); + grib_binary_search(self->lats, self->lats_count - 1, inlat, + &(self->j[0]), &(self->j[1])); - plsize=self->lats_count; - pl=(double*)grib_context_malloc(h->context,plsize*sizeof(double)); - if (!pl) return GRIB_OUT_OF_MEMORY; - if( (ret=grib_get_double_array(h,"pl",pl,&plsize))!= GRIB_SUCCESS) + plsize = self->lats_count; + pl = (double*)grib_context_malloc(h->context, plsize * sizeof(double)); + if (!pl) + return GRIB_OUT_OF_MEMORY; + if ((ret = grib_get_double_array(h, "pl", pl, &plsize)) != GRIB_SUCCESS) return ret; - nlon=0; - for (jj=0;jjj[0];jj++) { - nlon+=pl[jj]; + nlon = 0; + for (jj = 0; jj < self->j[0]; jj++) { + nlon += pl[jj]; } - lons=self->lons+nlon; - grib_binary_search(lons,pl[self->j[0]]-1,inlon, - &(self->k[0]),&(self->k[1])); - self->k[0]+=nlon; - self->k[1]+=nlon; - - nlon=0; - for (jj=0;jjj[1];jj++) { - nlon+=pl[jj]; + lons = self->lons + nlon; + grib_binary_search(lons, pl[self->j[0]] - 1, inlon, + &(self->k[0]), &(self->k[1])); + self->k[0] += nlon; + self->k[1] += nlon; + + nlon = 0; + for (jj = 0; jj < self->j[1]; jj++) { + nlon += pl[jj]; } - lons=self->lons+nlon; - grib_binary_search(lons,pl[self->j[1]]-1,inlon, - &(self->k[2]),&(self->k[3])); - self->k[2]+=nlon; - self->k[3]+=nlon; - - kk=0; - for (ii=0;ii<2;ii++) { - for (jj=0;jj<2;jj++) { - self->distances[kk]=grib_nearest_distance(radius,inlon,inlat, - self->lons[self->k[kk]],self->lats[self->j[jj]]); + lons = self->lons + nlon; + grib_binary_search(lons, pl[self->j[1]] - 1, inlon, + &(self->k[2]), &(self->k[3])); + self->k[2] += nlon; + self->k[3] += nlon; + + kk = 0; + for (ii = 0; ii < 2; ii++) { + for (jj = 0; jj < 2; jj++) { + self->distances[kk] = grib_nearest_distance(radius, inlon, inlat, + self->lons[self->k[kk]], self->lats[self->j[jj]]); kk++; } } - grib_context_free(h->context,pl); + grib_context_free(h->context, pl); } - kk=0; - for (ii=0;ii<2;ii++) { - for (jj=0;jj<2;jj++) { - distances[kk]=self->distances[kk]; - outlats[kk]=self->lats[self->j[jj]]; - outlons[kk]=self->lons[self->k[kk]]; - values[kk]=nearest->values[self->k[kk]]; - indexes[kk]=self->k[kk]; + kk = 0; + for (ii = 0; ii < 2; ii++) { + for (jj = 0; jj < 2; jj++) { + distances[kk] = self->distances[kk]; + outlats[kk] = self->lats[self->j[jj]]; + outlons[kk] = self->lons[self->k[kk]]; + values[kk] = nearest->values[self->k[kk]]; + indexes[kk] = self->k[kk]; kk++; } } @@ -520,13 +576,19 @@ static int find(grib_nearest* nearest, grib_handle* h, } #endif -static int destroy(grib_nearest* nearest) { - grib_nearest_reduced* self = (grib_nearest_reduced*) nearest; - if (self->lats) grib_context_free(nearest->context,self->lats); - if (self->lons) grib_context_free(nearest->context,self->lons); - if (self->j) grib_context_free(nearest->context,self->j); - if (self->k) grib_context_free(nearest->context,self->k); - if (self->distances) grib_context_free(nearest->context,self->distances); +static int destroy(grib_nearest* nearest) +{ + grib_nearest_reduced* self = (grib_nearest_reduced*)nearest; + if (self->lats) + grib_context_free(nearest->context, self->lats); + if (self->lons) + grib_context_free(nearest->context, self->lons); + if (self->j) + grib_context_free(nearest->context, self->j); + if (self->k) + grib_context_free(nearest->context, self->k); + if (self->distances) + grib_context_free(nearest->context, self->distances); return GRIB_SUCCESS; } diff --git a/src/grib_nearest_class_regular.c b/src/grib_nearest_class_regular.c index 1e6612b7d..bebcd7411 100644 --- a/src/grib_nearest_class_regular.c +++ b/src/grib_nearest_class_regular.c @@ -43,42 +43,43 @@ or edit "nearest.class" and rerun ./make_class.pl */ -static void init_class (grib_nearest_class*); - -static int init (grib_nearest* nearest,grib_handle* h,grib_arguments* args); -static int find(grib_nearest* nearest, grib_handle* h,double inlat, double inlon, unsigned long flags, double* outlats,double* outlons, double *values,double *distances, int *indexes,size_t *len); -static int destroy (grib_nearest* nearest); - -typedef struct grib_nearest_regular{ - grib_nearest nearest; -/* Members defined in gen */ - const char* values_key; - const char* radius; - int cargs; -/* Members defined in regular */ - double* lats; - int lats_count; - double* lons; - int lons_count; - double* distances; - int* k; - int* i; - int* j; - const char* Ni; - const char* Nj; +static void init_class(grib_nearest_class*); + +static int init(grib_nearest* nearest, grib_handle* h, grib_arguments* args); +static int find(grib_nearest* nearest, grib_handle* h, double inlat, double inlon, unsigned long flags, double* outlats, double* outlons, double* values, double* distances, int* indexes, size_t* len); +static int destroy(grib_nearest* nearest); + +typedef struct grib_nearest_regular +{ + grib_nearest nearest; + /* Members defined in gen */ + const char* values_key; + const char* radius; + int cargs; + /* Members defined in regular */ + double* lats; + int lats_count; + double* lons; + int lons_count; + double* distances; + int* k; + int* i; + int* j; + const char* Ni; + const char* Nj; } grib_nearest_regular; extern grib_nearest_class* grib_nearest_class_gen; static grib_nearest_class _grib_nearest_class_regular = { - &grib_nearest_class_gen, /* super */ - "regular", /* name */ - sizeof(grib_nearest_regular), /* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* constructor */ - &destroy, /* destructor */ - &find, /* find nearest */ + &grib_nearest_class_gen, /* super */ + "regular", /* name */ + sizeof(grib_nearest_regular), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* constructor */ + &destroy, /* destructor */ + &find, /* find nearest */ }; grib_nearest_class* grib_nearest_class_regular = &_grib_nearest_class_regular; @@ -89,13 +90,13 @@ static void init_class(grib_nearest_class* c) } /* END_CLASS_IMP */ -static int init(grib_nearest* nearest,grib_handle* h,grib_arguments* args) +static int init(grib_nearest* nearest, grib_handle* h, grib_arguments* args) { - grib_nearest_regular* self = (grib_nearest_regular*) nearest; - self->Ni = grib_arguments_get_name(h,args,self->cargs++); - self->Nj = grib_arguments_get_name(h,args,self->cargs++); - self->i=(int*)grib_context_malloc(h->context,2*sizeof(int)); - self->j=(int*)grib_context_malloc(h->context,2*sizeof(int)); + grib_nearest_regular* self = (grib_nearest_regular*)nearest; + self->Ni = grib_arguments_get_name(h, args, self->cargs++); + self->Nj = grib_arguments_get_name(h, args, self->cargs++); + self->i = (int*)grib_context_malloc(h->context, 2 * sizeof(int)); + self->j = (int*)grib_context_malloc(h->context, 2 * sizeof(int)); return 0; } @@ -217,56 +218,59 @@ static int find(grib_nearest* nearest, grib_handle* h, static int is_rotated_grid(grib_handle* h) { long is_rotated = 0; - int err = grib_get_long(h, "is_rotated_grid", &is_rotated); - if (!err && is_rotated ) return 1; + int err = grib_get_long(h, "is_rotated_grid", &is_rotated); + if (!err && is_rotated) + return 1; return 0; } static int find(grib_nearest* nearest, grib_handle* h, - double inlat, double inlon,unsigned long flags, - double* outlats,double* outlons, - double *values,double *distances,int* indexes, size_t *len) + double inlat, double inlon, unsigned long flags, + double* outlats, double* outlons, + double* values, double* distances, int* indexes, size_t* len) { - grib_nearest_regular* self = (grib_nearest_regular*) nearest; - int ret=0,kk=0,ii=0,jj=0; - size_t nvalues=0; + grib_nearest_regular* self = (grib_nearest_regular*)nearest; + int ret = 0, kk = 0, ii = 0, jj = 0; + size_t nvalues = 0; long iradius; double radius; - grib_iterator* iter=NULL; - double lat=0,lon=0; - const int is_rotated = is_rotated_grid(h); - double angleOfRotation=0, southPoleLat=0, southPoleLon=0; + grib_iterator* iter = NULL; + double lat = 0, lon = 0; + const int is_rotated = is_rotated_grid(h); + double angleOfRotation = 0, southPoleLat = 0, southPoleLon = 0; - while (inlon<0) inlon+=360; - while (inlon>360) inlon-=360; + while (inlon < 0) + inlon += 360; + while (inlon > 360) + inlon -= 360; - if( (ret = grib_get_size(h,self->values_key,&nvalues))!= GRIB_SUCCESS) + if ((ret = grib_get_size(h, self->values_key, &nvalues)) != GRIB_SUCCESS) return ret; nearest->values_count = nvalues; - if (grib_is_missing(h,self->radius,&ret)) { - grib_context_log(h->context, GRIB_LOG_DEBUG,"Key '%s' is missing", self->radius); + if (grib_is_missing(h, self->radius, &ret)) { + grib_context_log(h->context, GRIB_LOG_DEBUG, "Key '%s' is missing", self->radius); return ret ? ret : GRIB_GEOCALCULUS_PROBLEM; } - if( (ret = grib_get_long(h,self->radius,&iradius))!= GRIB_SUCCESS) + if ((ret = grib_get_long(h, self->radius, &iradius)) != GRIB_SUCCESS) return ret; - radius=((double)iradius)/1000.0; + radius = ((double)iradius) / 1000.0; - if (!nearest->h || (flags & GRIB_NEAREST_SAME_GRID)==0) { - double dummy=0; - double olat=1.e10, olon=1.e10; - int ilat=0,ilon=0; - long n=0; + if (!nearest->h || (flags & GRIB_NEAREST_SAME_GRID) == 0) { + double dummy = 0; + double olat = 1.e10, olon = 1.e10; + int ilat = 0, ilon = 0; + long n = 0; - if (grib_is_missing(h,self->Ni,&ret)) { - grib_context_log(h->context, GRIB_LOG_DEBUG,"Key '%s' is missing", self->Ni); + if (grib_is_missing(h, self->Ni, &ret)) { + grib_context_log(h->context, GRIB_LOG_DEBUG, "Key '%s' is missing", self->Ni); return ret ? ret : GRIB_GEOCALCULUS_PROBLEM; } - if (grib_is_missing(h,self->Nj,&ret)) { - grib_context_log(h->context, GRIB_LOG_DEBUG,"Key '%s' is missing", self->Nj); + if (grib_is_missing(h, self->Nj, &ret)) { + grib_context_log(h->context, GRIB_LOG_DEBUG, "Key '%s' is missing", self->Nj); return ret ? ret : GRIB_GEOCALCULUS_PROBLEM; } @@ -277,10 +281,18 @@ static int find(grib_nearest* nearest, grib_handle* h, */ if (is_rotated) { double new_lat = 0, new_lon = 0; - ret = grib_get_double_internal(h,"angleOfRotation", &angleOfRotation); if (ret) return ret; - ret = grib_get_double_internal(h,"latitudeOfSouthernPoleInDegrees", &southPoleLat); if (ret) return ret; - ret = grib_get_double_internal(h,"longitudeOfSouthernPoleInDegrees", &southPoleLon); if (ret) return ret; - ret = grib_set_long(h, "iteratorDisableUnrotate", 1); if (ret) return ret; + ret = grib_get_double_internal(h, "angleOfRotation", &angleOfRotation); + if (ret) + return ret; + ret = grib_get_double_internal(h, "latitudeOfSouthernPoleInDegrees", &southPoleLat); + if (ret) + return ret; + ret = grib_get_double_internal(h, "longitudeOfSouthernPoleInDegrees", &southPoleLon); + if (ret) + return ret; + ret = grib_set_long(h, "iteratorDisableUnrotate", 1); + if (ret) + return ret; /* Rotate the inlat, inlon */ rotate(inlat, inlon, angleOfRotation, southPoleLat, southPoleLon, &new_lat, &new_lon); inlat = new_lat; @@ -288,113 +300,123 @@ static int find(grib_nearest* nearest, grib_handle* h, /*if(h->context->debug) printf("nearest find: rotated grid: new point=(%g,%g)\n",new_lat,new_lon);*/ } - if ((ret = grib_get_long(h,self->Ni,&n))!= GRIB_SUCCESS) + if ((ret = grib_get_long(h, self->Ni, &n)) != GRIB_SUCCESS) return ret; - self->lons_count=n; + self->lons_count = n; - if ((ret = grib_get_long(h,self->Nj,&n))!= GRIB_SUCCESS) + if ((ret = grib_get_long(h, self->Nj, &n)) != GRIB_SUCCESS) return ret; - self->lats_count=n; - - if (self->lats) grib_context_free(nearest->context,self->lats); - self->lats=(double*)grib_context_malloc( nearest->context, - self->lats_count* sizeof(double)); - if (!self->lats) return GRIB_OUT_OF_MEMORY; - - if (self->lons) grib_context_free(nearest->context,self->lons); - self->lons=(double*)grib_context_malloc( nearest->context, - self->lons_count*sizeof(double)); - if (!self->lons) return GRIB_OUT_OF_MEMORY; - - iter=grib_iterator_new(h,0,&ret); + self->lats_count = n; + + if (self->lats) + grib_context_free(nearest->context, self->lats); + self->lats = (double*)grib_context_malloc(nearest->context, + self->lats_count * sizeof(double)); + if (!self->lats) + return GRIB_OUT_OF_MEMORY; + + if (self->lons) + grib_context_free(nearest->context, self->lons); + self->lons = (double*)grib_context_malloc(nearest->context, + self->lons_count * sizeof(double)); + if (!self->lons) + return GRIB_OUT_OF_MEMORY; + + iter = grib_iterator_new(h, 0, &ret); if (ret != GRIB_SUCCESS) { - grib_context_log(h->context,GRIB_LOG_ERROR,"Unable to create lat/lon iterator"); + grib_context_log(h->context, GRIB_LOG_ERROR, "Unable to create lat/lon iterator"); return ret; } - while(grib_iterator_next(iter,&lat,&lon,&dummy)) { + while (grib_iterator_next(iter, &lat, &lon, &dummy)) { if (olat != lat) { - Assert( ilat < self->lats_count ); - self->lats[ilat++]=lat; - olat=lat; + Assert(ilat < self->lats_count); + self->lats[ilat++] = lat; + olat = lat; } - if (ilonlons_count && olon != lon) { - self->lons[ilon++]=lon ; - olon=lon; + if (ilon < self->lons_count && olon != lon) { + self->lons[ilon++] = lon; + olon = lon; } } grib_iterator_delete(iter); - } - nearest->h=h; + nearest->h = h; - if (!self->distances || (flags & GRIB_NEAREST_SAME_POINT)==0 - || (flags & GRIB_NEAREST_SAME_GRID)==0) { - int nearest_lons_found=0; + if (!self->distances || (flags & GRIB_NEAREST_SAME_POINT) == 0 || (flags & GRIB_NEAREST_SAME_GRID) == 0) { + int nearest_lons_found = 0; - if (self->lats[self->lats_count-1] > self->lats[0]) { - if (inlatlats[0] || inlat>self->lats[self->lats_count-1]) + if (self->lats[self->lats_count - 1] > self->lats[0]) { + if (inlat < self->lats[0] || inlat > self->lats[self->lats_count - 1]) return GRIB_OUT_OF_AREA; - } else { - if (inlat > self->lats[0] || inlat < self->lats[self->lats_count-1]) + } + else { + if (inlat > self->lats[0] || inlat < self->lats[self->lats_count - 1]) return GRIB_OUT_OF_AREA; } - if (self->lons[self->lons_count-1] > self->lons[0]) { - if (inlonlons[0] || inlon>self->lons[self->lons_count-1]) { + if (self->lons[self->lons_count - 1] > self->lons[0]) { + if (inlon < self->lons[0] || inlon > self->lons[self->lons_count - 1]) { /* try to scale*/ - if (inlon>0) inlon-=360; - else inlon+=360; - - if (inlonlons[0] || inlon>self->lons[self->lons_count-1]) { - if ( self->lons[0]+360-self->lons[self->lons_count-1]<= - self->lons[1]-self->lons[0]) { + if (inlon > 0) + inlon -= 360; + else + inlon += 360; + + if (inlon < self->lons[0] || inlon > self->lons[self->lons_count - 1]) { + if (self->lons[0] + 360 - self->lons[self->lons_count - 1] <= + self->lons[1] - self->lons[0]) { /*it's a global field in longitude*/ - self->i[0]=0; - self->i[1]=self->lons_count-1; - nearest_lons_found=1; - } else + self->i[0] = 0; + self->i[1] = self->lons_count - 1; + nearest_lons_found = 1; + } + else return GRIB_OUT_OF_AREA; } } - } else { - if (inlon>self->lons[0] || inlonlons[self->lons_count-1]) { + } + else { + if (inlon > self->lons[0] || inlon < self->lons[self->lons_count - 1]) { /* try to scale*/ - if (inlon>0) inlon-=360; - else inlon+=360; - if (self->lons[0]-self->lons[self->lons_count-1]-360 <= - self->lons[0]-self->lons[1]) { + if (inlon > 0) + inlon -= 360; + else + inlon += 360; + if (self->lons[0] - self->lons[self->lons_count - 1] - 360 <= + self->lons[0] - self->lons[1]) { /*it's a global field in longitude*/ - self->i[0]=0; - self->i[1]=self->lons_count-1; - nearest_lons_found=1; - } else if (inlon>self->lons[0] || inlonlons[self->lons_count-1]) + self->i[0] = 0; + self->i[1] = self->lons_count - 1; + nearest_lons_found = 1; + } + else if (inlon > self->lons[0] || inlon < self->lons[self->lons_count - 1]) return GRIB_OUT_OF_AREA; } } - grib_binary_search(self->lats,self->lats_count-1,inlat, - &(self->j[0]),&(self->j[1])); + grib_binary_search(self->lats, self->lats_count - 1, inlat, + &(self->j[0]), &(self->j[1])); if (!nearest_lons_found) - grib_binary_search(self->lons,self->lons_count-1,inlon, - &(self->i[0]),&(self->i[1])); + grib_binary_search(self->lons, self->lons_count - 1, inlon, + &(self->i[0]), &(self->i[1])); if (!self->distances) - self->distances=(double*)grib_context_malloc( nearest->context,4*sizeof(double)); + self->distances = (double*)grib_context_malloc(nearest->context, 4 * sizeof(double)); if (!self->k) - self->k=(int*)grib_context_malloc( nearest->context,4*sizeof(int)); - kk=0; - for (jj=0;jj<2;jj++) { - for (ii=0;ii<2;ii++) { - self->k[kk]=self->i[ii]+self->lons_count*self->j[jj]; - self->distances[kk]=grib_nearest_distance(radius,inlon,inlat, - self->lons[self->i[ii]],self->lats[self->j[jj]]); + self->k = (int*)grib_context_malloc(nearest->context, 4 * sizeof(int)); + kk = 0; + for (jj = 0; jj < 2; jj++) { + for (ii = 0; ii < 2; ii++) { + self->k[kk] = self->i[ii] + self->lons_count * self->j[jj]; + self->distances[kk] = grib_nearest_distance(radius, inlon, inlat, + self->lons[self->i[ii]], self->lats[self->j[jj]]); kk++; } } } - kk=0; + kk = 0; /* * Brute force algorithm: @@ -408,11 +430,11 @@ static int find(grib_nearest* nearest, grib_handle* h, * if (ret) return ret; */ - for (jj=0;jj<2;jj++) { - for (ii=0;ii<2;ii++) { - distances[kk]=self->distances[kk]; - outlats[kk]=self->lats[self->j[jj]]; - outlons[kk]=self->lons[self->i[ii]]; + for (jj = 0; jj < 2; jj++) { + for (ii = 0; ii < 2; ii++) { + distances[kk] = self->distances[kk]; + outlats[kk] = self->lats[self->j[jj]]; + outlons[kk] = self->lons[self->i[ii]]; if (is_rotated) { /* Unrotate resulting lat/lon */ double new_lat = 0, new_lon = 0; @@ -421,13 +443,13 @@ static int find(grib_nearest* nearest, grib_handle* h, outlons[kk] = new_lon; } if (values) { /* ECC-499 */ - grib_get_double_element_internal(h,self->values_key,self->k[kk],&(values[kk])); + grib_get_double_element_internal(h, self->values_key, self->k[kk], &(values[kk])); } /* Using the brute force approach described above */ /* Assert(self->k[kk] < nvalues); */ /* values[kk]=nearest->values[self->k[kk]]; */ - indexes[kk]=self->k[kk]; + indexes[kk] = self->k[kk]; kk++; } } @@ -436,13 +458,20 @@ static int find(grib_nearest* nearest, grib_handle* h, } #endif -static int destroy(grib_nearest* nearest) { - grib_nearest_regular* self = (grib_nearest_regular*) nearest; - if (self->lats) grib_context_free(nearest->context,self->lats); - if (self->lons) grib_context_free(nearest->context,self->lons); - if (self->i) grib_context_free(nearest->context,self->i); - if (self->j) grib_context_free(nearest->context,self->j); - if (self->k) grib_context_free(nearest->context,self->k); - if (self->distances) grib_context_free(nearest->context,self->distances); +static int destroy(grib_nearest* nearest) +{ + grib_nearest_regular* self = (grib_nearest_regular*)nearest; + if (self->lats) + grib_context_free(nearest->context, self->lats); + if (self->lons) + grib_context_free(nearest->context, self->lons); + if (self->i) + grib_context_free(nearest->context, self->i); + if (self->j) + grib_context_free(nearest->context, self->j); + if (self->k) + grib_context_free(nearest->context, self->k); + if (self->distances) + grib_context_free(nearest->context, self->distances); return GRIB_SUCCESS; } diff --git a/src/grib_nearest_class_sh.c b/src/grib_nearest_class_sh.c index e409f6160..3ccc7d65f 100644 --- a/src/grib_nearest_class_sh.c +++ b/src/grib_nearest_class_sh.c @@ -36,35 +36,36 @@ or edit "nearest.class" and rerun ./make_class.pl */ -static void init_class (grib_nearest_class*); - -static int init (grib_nearest* nearest,grib_handle* h,grib_arguments* args); -static int find(grib_nearest* nearest, grib_handle* h,double inlat, double inlon, unsigned long flags, double* outlats,double* outlons, double *values,double *distances, int *indexes,size_t *len); -static int destroy (grib_nearest* nearest); - -typedef struct grib_nearest_sh{ - grib_nearest nearest; -/* Members defined in gen */ - const char* values_key; - const char* radius; - int cargs; -/* Members defined in sh */ - const char* J; - const char* K; - const char* M; +static void init_class(grib_nearest_class*); + +static int init(grib_nearest* nearest, grib_handle* h, grib_arguments* args); +static int find(grib_nearest* nearest, grib_handle* h, double inlat, double inlon, unsigned long flags, double* outlats, double* outlons, double* values, double* distances, int* indexes, size_t* len); +static int destroy(grib_nearest* nearest); + +typedef struct grib_nearest_sh +{ + grib_nearest nearest; + /* Members defined in gen */ + const char* values_key; + const char* radius; + int cargs; + /* Members defined in sh */ + const char* J; + const char* K; + const char* M; } grib_nearest_sh; extern grib_nearest_class* grib_nearest_class_gen; static grib_nearest_class _grib_nearest_class_sh = { - &grib_nearest_class_gen, /* super */ - "sh", /* name */ - sizeof(grib_nearest_sh), /* size of instance */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* constructor */ - &destroy, /* destructor */ - &find, /* find nearest */ + &grib_nearest_class_gen, /* super */ + "sh", /* name */ + sizeof(grib_nearest_sh), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* constructor */ + &destroy, /* destructor */ + &find, /* find nearest */ }; grib_nearest_class* grib_nearest_class_sh = &_grib_nearest_class_sh; @@ -75,68 +76,68 @@ static void init_class(grib_nearest_class* c) } /* END_CLASS_IMP */ -#define LEGENDRE_SIZE(L) (L+1)*(L+2)/2 +#define LEGENDRE_SIZE(L) (L + 1) * (L + 2) / 2 -static void grib_trigs(int m,double lambda,double* c,double* s); -static int grib_invtrans_legendre(int L,double x, double* RI,double* TR,double* TI); -static double grib_invtrans_trig(int L,double* TR,double* TI, - double *c,double *s); -static int grib_invtrans(grib_context *c,int L,double latdeg,double londeg,double* values, double* result); +static void grib_trigs(int m, double lambda, double* c, double* s); +static int grib_invtrans_legendre(int L, double x, double* RI, double* TR, double* TI); +static double grib_invtrans_trig(int L, double* TR, double* TI, + double* c, double* s); +static int grib_invtrans(grib_context* c, int L, double latdeg, double londeg, double* values, double* result); -static int init(grib_nearest* nearest,grib_handle* h,grib_arguments* args) +static int init(grib_nearest* nearest, grib_handle* h, grib_arguments* args) { - grib_nearest_sh* self = (grib_nearest_sh*) nearest; - self->J = grib_arguments_get_name(h,args,self->cargs++); - self->K = grib_arguments_get_name(h,args,self->cargs++); - self->M = grib_arguments_get_name(h,args,self->cargs++); + grib_nearest_sh* self = (grib_nearest_sh*)nearest; + self->J = grib_arguments_get_name(h, args, self->cargs++); + self->K = grib_arguments_get_name(h, args, self->cargs++); + self->M = grib_arguments_get_name(h, args, self->cargs++); return 0; } static int find(grib_nearest* nearest, grib_handle* h, - double inlat, double inlon,unsigned long flags, - double* outlats,double* outlons, - double *outvalues,double *distances,int* indexes, size_t *len) + double inlat, double inlon, unsigned long flags, + double* outlats, double* outlons, + double* outvalues, double* distances, int* indexes, size_t* len) { - grib_nearest_sh* self = (grib_nearest_sh*) nearest; - long J,K,M; - double *values; - int size,i,ret; - size_t vsize=0; + grib_nearest_sh* self = (grib_nearest_sh*)nearest; + long J, K, M; + double* values; + int size, i, ret; + size_t vsize = 0; double val; - if( (ret = grib_get_long(h,self->J,&J))!= GRIB_SUCCESS) + if ((ret = grib_get_long(h, self->J, &J)) != GRIB_SUCCESS) return ret; - if( (ret = grib_get_long(h,self->K,&K))!= GRIB_SUCCESS) + if ((ret = grib_get_long(h, self->K, &K)) != GRIB_SUCCESS) return ret; - if( (ret = grib_get_long(h,self->M,&M))!= GRIB_SUCCESS) + if ((ret = grib_get_long(h, self->M, &M)) != GRIB_SUCCESS) return ret; - size=2*LEGENDRE_SIZE(J); - vsize=size; - values=(double*)grib_context_malloc_clear(h->context,sizeof(double)*size); + size = 2 * LEGENDRE_SIZE(J); + vsize = size; + values = (double*)grib_context_malloc_clear(h->context, sizeof(double) * size); if (!values) { - grib_context_log(h->context,GRIB_LOG_ERROR, - "nearest_sh: unable to allocate %d bytes", - sizeof(double)*size); + grib_context_log(h->context, GRIB_LOG_ERROR, + "nearest_sh: unable to allocate %d bytes", + sizeof(double) * size); return GRIB_OUT_OF_MEMORY; } - if( (ret = grib_get_double_array(h,self->values_key,values,&vsize)) - != GRIB_SUCCESS) + if ((ret = grib_get_double_array(h, self->values_key, values, &vsize)) != GRIB_SUCCESS) return ret; - Assert(vsize==size); + Assert(vsize == size); - ret=grib_invtrans(h->context,J,inlat,inlon,values, &val); - if (ret != GRIB_SUCCESS) return ret; + ret = grib_invtrans(h->context, J, inlat, inlon, values, &val); + if (ret != GRIB_SUCCESS) + return ret; - grib_context_free(h->context,values); + grib_context_free(h->context, values); - for (i=0;i<4;i++) { - outlats[i]=inlat; - outlons[i]=inlon; - outvalues[i]=val; - indexes[i]=-1; + for (i = 0; i < 4; i++) { + outlats[i] = inlat; + outlons[i] = inlon; + outvalues[i] = val; + indexes[i] = -1; } return GRIB_SUCCESS; @@ -147,146 +148,153 @@ static int destroy(grib_nearest* nearest) return GRIB_SUCCESS; } -static void grib_trigs(int m,double lambda,double* c,double* s) +static void grib_trigs(int m, double lambda, double* c, double* s) { int i; - double a,b; + double a, b; - b=sin(lambda); - a=1-2*sin(lambda/2.0)*sin(lambda/2.0); - c[0]=1.0; s[0]=0.0; + b = sin(lambda); + a = 1 - 2 * sin(lambda / 2.0) * sin(lambda / 2.0); + c[0] = 1.0; + s[0] = 0.0; - for (i=1;i<=m;i++) { - c[i]=a*c[i-1]-b*s[i-1]; - s[i]=a*s[i-1]+b*c[i-1]; + for (i = 1; i <= m; i++) { + c[i] = a * c[i - 1] - b * s[i - 1]; + s[i] = a * s[i - 1] + b * c[i - 1]; } - } -static double grib_invtrans_trig(int L,double* TR,double* TI,double *c,double *s) +static double grib_invtrans_trig(int L, double* TR, double* TI, double* c, double* s) { - double ret=0; - int m=0; - - for (m=1;m<=L;m++) { - ret+= TR[m] * c[m]; - printf("++ %d ++ %.20e %g %g\n",m,ret,TR[m],c[m]); - ret-= TI[m] * s[m]; - printf("+- %d ++ %.20e %g %g\n",m,ret,TI[m],s[m]); + double ret = 0; + int m = 0; + + for (m = 1; m <= L; m++) { + ret += TR[m] * c[m]; + printf("++ %d ++ %.20e %g %g\n", m, ret, TR[m], c[m]); + ret -= TI[m] * s[m]; + printf("+- %d ++ %.20e %g %g\n", m, ret, TI[m], s[m]); } - ret=2*ret+TR[0]; + ret = 2 * ret + TR[0]; return ret; } -static int grib_invtrans_legendre(int L,double x, - double* RI,double* TR,double* TI) +static int grib_invtrans_legendre(int L, double x, + double* RI, double* TR, double* TI) { - int l,m; + int l, m; double y2; - double f,of,fx,p0; - double *pP,*oP,*pRI; + double f, of, fx, p0; + double *pP, *oP, *pRI; if (fabs(x) > 1.0) { - printf("grib_legendreP: invalid x=%g must be abs(x)>0\n",x); + printf("grib_legendreP: invalid x=%g must be abs(x)>0\n", x); return GRIB_INVALID_ARGUMENT; } - if (L<0) { - printf("grib_legendreP: invalid L=%d must be >0\n",L); + if (L < 0) { + printf("grib_legendreP: invalid L=%d must be >0\n", L); return GRIB_INVALID_ARGUMENT; } - pP=(double*)malloc(sizeof(double)*(L+1)); + pP = (double*)malloc(sizeof(double) * (L + 1)); if (!pP) { - printf("unable to allocate %d bytes\n",(int)sizeof(double)*(L+1)); + printf("unable to allocate %d bytes\n", (int)sizeof(double) * (L + 1)); return GRIB_OUT_OF_MEMORY; } - y2=(1.0-x*x); fx=1; p0=1; oP=pP; pRI=RI; - for (m=0;msize=size; - v->n=0; - v->incsize=incsize; - v->v=(void**)grib_context_malloc_clear(c,sizeof(char*)*size); + v->size = size; + v->n = 0; + v->incsize = incsize; + v->v = (void**)grib_context_malloc_clear(c, sizeof(char*) * size); if (!v->v) { - grib_context_log(c,GRIB_LOG_ERROR, - "grib_oarray_new unable to allocate %d bytes\n",sizeof(char*)*size); + grib_context_log(c, GRIB_LOG_ERROR, + "grib_oarray_new unable to allocate %d bytes\n", sizeof(char*) * size); return NULL; } return v; } -grib_oarray* grib_oarray_resize(grib_context* c,grib_oarray* v) +grib_oarray* grib_oarray_resize(grib_context* c, grib_oarray* v) { - int newsize=v->incsize+v->size; + int newsize = v->incsize + v->size; - if (!c) c=grib_context_get_default(); + if (!c) + c = grib_context_get_default(); - v->v=(void**)grib_context_realloc(c,v->v,newsize*sizeof(char*)); - v->size=newsize; + v->v = (void**)grib_context_realloc(c, v->v, newsize * sizeof(char*)); + v->size = newsize; if (!v->v) { - grib_context_log(c,GRIB_LOG_ERROR, - "grib_oarray_resize unable to allocate %d bytes\n",sizeof(char*)*newsize); + grib_context_log(c, GRIB_LOG_ERROR, + "grib_oarray_resize unable to allocate %d bytes\n", sizeof(char*) * newsize); return NULL; } return v; } -grib_oarray* grib_oarray_push(grib_context* c,grib_oarray* v,void* val) +grib_oarray* grib_oarray_push(grib_context* c, grib_oarray* v, void* val) { - size_t start_size=100; - size_t start_incsize=100; - if (!v) v=grib_oarray_new(c,start_size,start_incsize); + size_t start_size = 100; + size_t start_incsize = 100; + if (!v) + v = grib_oarray_new(c, start_size, start_incsize); - if (v->n >= v->size) v=grib_oarray_resize(c,v); - v->v[v->n]=val; + if (v->n >= v->size) + v = grib_oarray_resize(c, v); + v->v[v->n] = val; v->n++; return v; } -void grib_oarray_delete(grib_context* c,grib_oarray* v) +void grib_oarray_delete(grib_context* c, grib_oarray* v) { - if (!v) return; - if (!c) grib_context_get_default(); - if (v->v) grib_context_free(c,v->v); - grib_context_free(c,v); + if (!v) + return; + if (!c) + grib_context_get_default(); + if (v->v) + grib_context_free(c, v->v); + grib_context_free(c, v); } -void grib_oarray_delete_content(grib_context* c,grib_oarray* v) +void grib_oarray_delete_content(grib_context* c, grib_oarray* v) { int i; - if (!v || !v->v) return; - if (!c) grib_context_get_default(); - for (i=0;in;i++) { - if (v->v[i]) grib_context_free(c,v->v[i]); - v->v[i]=0; + if (!v || !v->v) + return; + if (!c) + grib_context_get_default(); + for (i = 0; i < v->n; i++) { + if (v->v[i]) + grib_context_free(c, v->v[i]); + v->v[i] = 0; } - v->n=0; + v->n = 0; } -void** grib_oarray_get_array(grib_context* c,grib_oarray* v) +void** grib_oarray_get_array(grib_context* c, grib_oarray* v) { void** ret; int i; - if (!v) return NULL; - ret=(void**)grib_context_malloc_clear(c,sizeof(char*)*v->n); - for (i=0;in;i++) ret[i]=v->v[i]; + if (!v) + return NULL; + ret = (void**)grib_context_malloc_clear(c, sizeof(char*) * v->n); + for (i = 0; i < v->n; i++) + ret[i] = v->v[i]; return ret; } -void* grib_oarray_get(grib_oarray* v,int i) +void* grib_oarray_get(grib_oarray* v, int i) { - if (v==NULL || i>v->n-1) return NULL; + if (v == NULL || i > v->n - 1) + return NULL; return v->v[i]; } diff --git a/src/grib_openjpeg_encoding.c b/src/grib_openjpeg_encoding.c index 40c4c7edc..efae107d1 100644 --- a/src/grib_openjpeg_encoding.c +++ b/src/grib_openjpeg_encoding.c @@ -14,44 +14,44 @@ #include "openjpeg.h" -static void openjpeg_warning(const char *msg, void *client_data) +static void openjpeg_warning(const char* msg, void* client_data) { - grib_context_log((grib_context*)client_data,GRIB_LOG_WARNING,"openjpeg: %s",msg); + grib_context_log((grib_context*)client_data, GRIB_LOG_WARNING, "openjpeg: %s", msg); } -static void openjpeg_error(const char *msg, void *client_data) +static void openjpeg_error(const char* msg, void* client_data) { - grib_context_log((grib_context*)client_data,GRIB_LOG_ERROR,"openjpeg: %s",msg); + grib_context_log((grib_context*)client_data, GRIB_LOG_ERROR, "openjpeg: %s", msg); } -static void openjpeg_info(const char *msg, void *client_data) +static void openjpeg_info(const char* msg, void* client_data) { /* grib_context_log((grib_context*)client_data,GRIB_LOG_INFO,"openjpeg: %s",msg); */ } /* Note: The old OpenJPEG versions (e.g. v1.5.2) did not have this macro. * From OpenJPEG v2.1.0 onwards there is the macro OPJ_VERSION_MAJOR */ -#if !defined(OPJ_VERSION_MAJOR) /* The old interface */ +#if !defined(OPJ_VERSION_MAJOR) /* The old interface */ -int grib_openjpeg_encode(grib_context *c, j2k_encode_helper *helper) +int grib_openjpeg_encode(grib_context* c, j2k_encode_helper* helper) { - int err = GRIB_SUCCESS; + int err = GRIB_SUCCESS; const int numcomps = 1; int i; - const double * values = helper->values; - long no_values = helper->no_values; + const double* values = helper->values; + long no_values = helper->no_values; double reference_value = helper->reference_value; double divisor = helper->divisor; double decimal = helper->decimal; - int* data; + int* data; - opj_cparameters_t parameters = {0,}; /* compression parameters */ - opj_event_mgr_t event_mgr = {0,}; /* event manager */ - opj_image_t *image = NULL; + opj_cparameters_t parameters = {0,}; /* compression parameters */ + opj_event_mgr_t event_mgr = {0,}; /* event manager */ + opj_image_t* image = NULL; opj_image_cmptparm_t cmptparm = {0,}; - opj_cio_t *cio = NULL; + opj_cio_t* cio = NULL; opj_cinfo_t* cinfo = NULL; @@ -76,7 +76,7 @@ int grib_openjpeg_encode(grib_context *c, j2k_encode_helper *helper) /* create the image */ image = opj_image_create(numcomps, &cmptparm, CLRSPC_GRAY); - if(!image) { + if (!image) { err = GRIB_ENCODING_ERROR; goto cleanup; } @@ -86,15 +86,15 @@ int grib_openjpeg_encode(grib_context *c, j2k_encode_helper *helper) image->x1 = helper->width; image->y1 = helper->height; - Assert(cmptparm.prec <= sizeof(image->comps[0].data[0])*8 - 1); /* BR: -1 because I don't know what happens if the sign bit is set */ + Assert(cmptparm.prec <= sizeof(image->comps[0].data[0]) * 8 - 1); /* BR: -1 because I don't know what happens if the sign bit is set */ - Assert(helper->no_values == image->comps[0].h * image->comps[0].w); + Assert(helper->no_values == image->comps[0].h * image->comps[0].w); /* Simple packing */ data = image->comps[0].data; - for(i=0;i< no_values;i++){ - unsigned long unsigned_val = (unsigned long)((((values[i]*decimal)-(reference_value))*divisor)+0.5); - data[i] = unsigned_val; + for (i = 0; i < no_values; i++) { + unsigned long unsigned_val = (unsigned long)((((values[i] * decimal) - (reference_value)) * divisor) + 0.5); + data[i] = unsigned_val; } /* get a J2K compressor handle */ @@ -120,29 +120,32 @@ int grib_openjpeg_encode(grib_context *c, j2k_encode_helper *helper) } helper->jpeg_length = cio_tell(cio); - memcpy(helper->jpeg_buffer,cio->buffer,helper->jpeg_length); + memcpy(helper->jpeg_buffer, cio->buffer, helper->jpeg_length); cleanup: - if (cio) opj_cio_close(cio); - if (cinfo) opj_destroy_compress(cinfo); - if (image) opj_image_destroy(image); + if (cio) + opj_cio_close(cio); + if (cinfo) + opj_destroy_compress(cinfo); + if (image) + opj_image_destroy(image); return err; } -int grib_openjpeg_decode(grib_context *c, unsigned char *buf, size_t *buflen, double *val, size_t *n_vals) { - +int grib_openjpeg_decode(grib_context* c, unsigned char* buf, size_t* buflen, double* val, size_t* n_vals) +{ int err = GRIB_SUCCESS; int i; - unsigned long mask; - int *data; + unsigned long mask; + int* data; size_t count; - opj_dparameters_t parameters = {0,}; /* decompression parameters */ - opj_dinfo_t* dinfo = NULL; /* handle to a decompressor */ - opj_event_mgr_t event_mgr = {0,}; /* event manager */ - opj_cio_t *cio = NULL; - opj_image_t *image = NULL; + opj_dparameters_t parameters = {0,}; /* decompression parameters */ + opj_dinfo_t* dinfo = NULL; /* handle to a decompressor */ + opj_event_mgr_t event_mgr = {0,}; /* event manager */ + opj_cio_t* cio = NULL; + opj_image_t* image = NULL; opj_image_comp_t comp = {0,}; /* set decoding parameters to default values */ @@ -169,40 +172,43 @@ int grib_openjpeg_decode(grib_context *c, unsigned char *buf, size_t *buflen, do image = opj_decode(dinfo, cio); - if(!image) { + if (!image) { grib_context_log(c, GRIB_LOG_ERROR, "openjpeg: failed to decode image"); err = GRIB_DECODING_ERROR; goto cleanup; } - if ( !(*n_vals <= image->comps[0].w * image->comps[0].h) ) { + if (!(*n_vals <= image->comps[0].w * image->comps[0].h)) { err = GRIB_DECODING_ERROR; goto cleanup; } - if ( (image->numcomps != 1) || !(image->x1 * image->y1) ) { + if ((image->numcomps != 1) || !(image->x1 * image->y1)) { err = GRIB_DECODING_ERROR; goto cleanup; } Assert(image->comps[0].sgnd == 0); - Assert(comp.prec <= sizeof(image->comps[0].data[0])*8 - 1); /* BR: -1 because I don't know what happens if the sign bit is set */ + Assert(comp.prec <= sizeof(image->comps[0].data[0]) * 8 - 1); /* BR: -1 because I don't know what happens if the sign bit is set */ - Assert(image->comps[0].prec < sizeof(mask)*8-1); + Assert(image->comps[0].prec < sizeof(mask) * 8 - 1); data = image->comps[0].data; mask = (1 << image->comps[0].prec) - 1; count = image->comps[0].w * image->comps[0].h; - for(i = 0; i offset >= mstream->dataSize) - return (OPJ_SIZE_T) -1; + return (OPJ_SIZE_T)-1; /* Check if we are reading more than we have */ if (nb_bytes > (mstream->dataSize - mstream->offset)) @@ -244,10 +250,10 @@ static OPJ_SIZE_T opj_memory_stream_read(void *buffer, OPJ_SIZE_T nb_bytes, void } /* Write from the buffer to our memory */ -static OPJ_SIZE_T opj_memory_stream_write(void *buffer, OPJ_SIZE_T nb_bytes, void *user_data) +static OPJ_SIZE_T opj_memory_stream_write(void* buffer, OPJ_SIZE_T nb_bytes, void* user_data) { - opj_memory_stream* mstream = (opj_memory_stream*) user_data; /* our data */ - OPJ_SIZE_T nb_bytes_write = nb_bytes; /* Amount to move to buffer */ + opj_memory_stream* mstream = (opj_memory_stream*)user_data; /* our data */ + OPJ_SIZE_T nb_bytes_write = nb_bytes; /* Amount to move to buffer */ /* Check if the current offset is outside our data buffer */ if (mstream->offset >= mstream->dataSize) @@ -264,14 +270,14 @@ static OPJ_SIZE_T opj_memory_stream_write(void *buffer, OPJ_SIZE_T nb_bytes, voi } /* Moves the pointer forward, but never more than we have */ -static OPJ_OFF_T opj_memory_stream_skip(OPJ_OFF_T nb_bytes, void *user_data) +static OPJ_OFF_T opj_memory_stream_skip(OPJ_OFF_T nb_bytes, void* user_data) { - opj_memory_stream* mstream = (opj_memory_stream*) user_data; + opj_memory_stream* mstream = (opj_memory_stream*)user_data; OPJ_SIZE_T l_nb_bytes; if (nb_bytes < 0) - return -1; /* No skipping backwards */ - l_nb_bytes = (OPJ_SIZE_T) nb_bytes; /* Allowed because it is positive */ + return -1; /* No skipping backwards */ + l_nb_bytes = (OPJ_SIZE_T)nb_bytes; /* Allowed because it is positive */ /* Do not allow jumping past the end */ if (l_nb_bytes > mstream->dataSize - mstream->offset) nb_bytes = mstream->dataSize - mstream->offset; @@ -280,19 +286,19 @@ static OPJ_OFF_T opj_memory_stream_skip(OPJ_OFF_T nb_bytes, void *user_data) } /* Sets the pointer to anywhere in the memory */ -static OPJ_BOOL opj_memory_stream_seek(OPJ_OFF_T nb_bytes, void * user_data) +static OPJ_BOOL opj_memory_stream_seek(OPJ_OFF_T nb_bytes, void* user_data) { - opj_memory_stream* mstream = (opj_memory_stream*) user_data; + opj_memory_stream* mstream = (opj_memory_stream*)user_data; if (nb_bytes < 0) return OPJ_FALSE; /* Not before the buffer */ - if (nb_bytes >(OPJ_OFF_T) mstream->dataSize) - return OPJ_FALSE; /* Not after the buffer */ - mstream->offset = (OPJ_SIZE_T) nb_bytes; /* Move to new position */ + if (nb_bytes > (OPJ_OFF_T)mstream->dataSize) + return OPJ_FALSE; /* Not after the buffer */ + mstream->offset = (OPJ_SIZE_T)nb_bytes; /* Move to new position */ return OPJ_TRUE; } -static void opj_memory_stream_do_nothing(void * p_user_data) +static void opj_memory_stream_do_nothing(void* p_user_data) { OPJ_ARG_NOT_USED(p_user_data); } @@ -300,41 +306,41 @@ static void opj_memory_stream_do_nothing(void * p_user_data) /* Create a stream to use memory as the input or output */ static opj_stream_t* opj_stream_create_default_memory_stream(opj_memory_stream* memoryStream, OPJ_BOOL is_read_stream) { - opj_stream_t* stream; + opj_stream_t* stream; - if (!(stream = opj_stream_default_create(is_read_stream))) - return (NULL); + if (!(stream = opj_stream_default_create(is_read_stream))) + return (NULL); /* Set how to work with the frame buffer */ - if (is_read_stream) - opj_stream_set_read_function(stream, opj_memory_stream_read); - else - opj_stream_set_write_function(stream, opj_memory_stream_write); - - opj_stream_set_seek_function(stream, opj_memory_stream_seek); - opj_stream_set_skip_function(stream, opj_memory_stream_skip); - opj_stream_set_user_data(stream, memoryStream, opj_memory_stream_do_nothing); - opj_stream_set_user_data_length(stream, memoryStream->dataSize); - return stream; + if (is_read_stream) + opj_stream_set_read_function(stream, opj_memory_stream_read); + else + opj_stream_set_write_function(stream, opj_memory_stream_write); + + opj_stream_set_seek_function(stream, opj_memory_stream_seek); + opj_stream_set_skip_function(stream, opj_memory_stream_skip); + opj_stream_set_user_data(stream, memoryStream, opj_memory_stream_do_nothing); + opj_stream_set_user_data_length(stream, memoryStream->dataSize); + return stream; } -int grib_openjpeg_encode(grib_context *c, j2k_encode_helper *helper) +int grib_openjpeg_encode(grib_context* c, j2k_encode_helper* helper) { - int err = GRIB_SUCCESS; + int err = GRIB_SUCCESS; const int numcomps = 1; int i; - const double * values = helper->values; - long no_values = helper->no_values; + const double* values = helper->values; + long no_values = helper->no_values; double reference_value = helper->reference_value; double divisor = helper->divisor; double decimal = helper->decimal; - int* data; + int* data; - opj_cparameters_t parameters = {0,}; /* compression parameters */ - opj_codec_t *codec = NULL; - opj_image_t *image = NULL; + opj_cparameters_t parameters = {0,}; /* compression parameters */ + opj_codec_t* codec = NULL; + opj_image_t* image = NULL; opj_image_cmptparm_t cmptparm = {0,}; - opj_stream_t *stream = NULL; + opj_stream_t* stream = NULL; opj_memory_stream mstream; /* set encoding parameters to default values */ @@ -345,15 +351,14 @@ int grib_openjpeg_encode(grib_context *c, j2k_encode_helper *helper) parameters.tcp_numlayers = 1; parameters.cp_disto_alloc = 1; /* parameters.numresolution = 1; */ - parameters.tcp_rates[0] = helper->compression; + parameters.tcp_rates[0] = helper->compression; /* By default numresolution = 6 (must be between 1 and 32) * This may be too large for some of our datasets, eg. 1xn, so adjust ... */ parameters.numresolution = 6; - while ( (helper->width < (OPJ_UINT32) (1 << (parameters.numresolution - 1U)) ) || - (helper->height < (OPJ_UINT32) (1 << (parameters.numresolution - 1U)) )) - { + while ((helper->width < (OPJ_UINT32)(1 << (parameters.numresolution - 1U))) || + (helper->height < (OPJ_UINT32)(1 << (parameters.numresolution - 1U)))) { parameters.numresolution--; } @@ -368,7 +373,7 @@ int grib_openjpeg_encode(grib_context *c, j2k_encode_helper *helper) /* create the image */ image = opj_image_create(numcomps, &cmptparm, OPJ_CLRSPC_GRAY); - if(!image) { + if (!image) { err = GRIB_ENCODING_ERROR; goto cleanup; } @@ -377,14 +382,14 @@ int grib_openjpeg_encode(grib_context *c, j2k_encode_helper *helper) image->x1 = helper->width; image->y1 = helper->height; - Assert(cmptparm.prec <= sizeof(image->comps[0].data[0])*8 - 1); /* BR: -1 because I don't know what happens if the sign bit is set */ - Assert(helper->no_values == image->comps[0].h * image->comps[0].w); + Assert(cmptparm.prec <= sizeof(image->comps[0].data[0]) * 8 - 1); /* BR: -1 because I don't know what happens if the sign bit is set */ + Assert(helper->no_values == image->comps[0].h * image->comps[0].w); /* Simple packing */ data = image->comps[0].data; - for(i=0;i< no_values;i++){ - unsigned long unsigned_val = (unsigned long)((((values[i]*decimal)-(reference_value))*divisor)+0.5); - data[i] = unsigned_val; + for (i = 0; i < no_values; i++) { + unsigned long unsigned_val = (unsigned long)((((values[i] * decimal) - (reference_value)) * divisor) + 0.5); + data[i] = unsigned_val; } /* get a J2K compressor handle */ @@ -392,7 +397,7 @@ int grib_openjpeg_encode(grib_context *c, j2k_encode_helper *helper) opj_set_info_handler(codec, openjpeg_info, c); opj_set_warning_handler(codec, openjpeg_warning, c); - opj_set_error_handler(codec, openjpeg_error,c); + opj_set_error_handler(codec, openjpeg_error, c); /* setup the encoder parameters using the current image and user parameters */ if (!opj_setup_encoder(codec, ¶meters, image)) { @@ -402,11 +407,11 @@ int grib_openjpeg_encode(grib_context *c, j2k_encode_helper *helper) } /* open a byte stream for writing */ - mstream.helper = helper; - mstream.pData = (OPJ_UINT8*) helper->jpeg_buffer; - mstream.offset = 0; + mstream.helper = helper; + mstream.pData = (OPJ_UINT8*)helper->jpeg_buffer; + mstream.offset = 0; mstream.dataSize = helper->buffer_size; - stream = opj_stream_create_default_memory_stream( &mstream, OPJ_STREAM_WRITE); + stream = opj_stream_create_default_memory_stream(&mstream, OPJ_STREAM_WRITE); if (stream == NULL) { grib_context_log(c, GRIB_LOG_ERROR, "openjpeg: failed create default memory stream"); err = GRIB_ENCODING_ERROR; @@ -433,26 +438,29 @@ int grib_openjpeg_encode(grib_context *c, j2k_encode_helper *helper) helper->jpeg_length = mstream.offset; cleanup: - if (codec) opj_destroy_codec(codec); - if (stream) opj_stream_destroy(stream); - if (image) opj_image_destroy(image); + if (codec) + opj_destroy_codec(codec); + if (stream) + opj_stream_destroy(stream); + if (image) + opj_image_destroy(image); return err; } -int grib_openjpeg_decode(grib_context *c, unsigned char *buf, size_t *buflen, double *val, size_t *n_vals) +int grib_openjpeg_decode(grib_context* c, unsigned char* buf, size_t* buflen, double* val, size_t* n_vals) { int err = GRIB_SUCCESS; int i; - unsigned long mask; - int *data; + unsigned long mask; + int* data; size_t count; - opj_dparameters_t parameters = {0,}; /* decompression parameters */ - opj_stream_t *stream = NULL; + opj_dparameters_t parameters = {0,}; /* decompression parameters */ + opj_stream_t* stream = NULL; opj_memory_stream mstream; - opj_image_t *image = NULL; - opj_codec_t *codec = NULL; + opj_image_t* image = NULL; + opj_codec_t* codec = NULL; opj_image_comp_t comp = {0,}; /* set decoding parameters to default values */ @@ -468,14 +476,14 @@ int grib_openjpeg_decode(grib_context *c, unsigned char *buf, size_t *buflen, do /* catch events using our callbacks and give a local context */ opj_set_info_handler(codec, openjpeg_info, c); opj_set_warning_handler(codec, openjpeg_warning, c); - opj_set_error_handler(codec, openjpeg_error,c); + opj_set_error_handler(codec, openjpeg_error, c); /* initialize our memory stream */ - mstream.pData = buf; + mstream.pData = buf; mstream.dataSize = *buflen; - mstream.offset = 0; + mstream.offset = 0; /* open a byte stream from memory stream */ - stream = opj_stream_create_default_memory_stream( &mstream, OPJ_STREAM_READ); + stream = opj_stream_create_default_memory_stream(&mstream, OPJ_STREAM_READ); /* setup the decoder decoding parameters using user parameters */ if (!opj_setup_decoder(codec, ¶meters)) { @@ -483,7 +491,7 @@ int grib_openjpeg_decode(grib_context *c, unsigned char *buf, size_t *buflen, do err = GRIB_DECODING_ERROR; goto cleanup; } - if (!opj_read_header(stream, codec, &image)) { + if (!opj_read_header(stream, codec, &image)) { grib_context_log(c, GRIB_LOG_ERROR, "openjpeg: failed to read the header"); err = GRIB_DECODING_ERROR; goto cleanup; @@ -494,26 +502,26 @@ int grib_openjpeg_decode(grib_context *c, unsigned char *buf, size_t *buflen, do goto cleanup; } - if ( !(*n_vals <= image->comps[0].w * image->comps[0].h) ) { + if (!(*n_vals <= image->comps[0].w * image->comps[0].h)) { err = GRIB_DECODING_ERROR; goto cleanup; } - if ( (image->numcomps != 1) || (image->x1 * image->y1)==0 ) { + if ((image->numcomps != 1) || (image->x1 * image->y1) == 0) { err = GRIB_DECODING_ERROR; goto cleanup; } Assert(image->comps[0].sgnd == 0); - Assert(comp.prec <= sizeof(image->comps[0].data[0])*8 - 1); /* BR: -1 because I don't know what happens if the sign bit is set */ + Assert(comp.prec <= sizeof(image->comps[0].data[0]) * 8 - 1); /* BR: -1 because I don't know what happens if the sign bit is set */ - Assert(image->comps[0].prec < sizeof(mask)*8-1); + Assert(image->comps[0].prec < sizeof(mask) * 8 - 1); data = image->comps[0].data; mask = (1 << image->comps[0].prec) - 1; count = image->comps[0].w * image->comps[0].h; - for(i = 0; i = range)) - { + if ((fabs(log10(fabs(pa)) + (double)kdec) >= range)) { *krep = 1; goto end; } /* Binary scale factor associated to kdec */ - *ke = floor (log2 ((pa * grib_power (kdec, 10)) / (grib_power (knbit, 2) - 0.5))) + 1; + *ke = floor(log2((pa * grib_power(kdec, 10)) / (grib_power(knbit, 2) - 0.5))) + 1; /* Encoded value for pa = max - min */ - *knutil = floor (0.5 + pa * grib_power ( kdec, 10) * grib_power (-*ke, 2)); + *knutil = floor(0.5 + pa * grib_power(kdec, 10) * grib_power(-*ke, 2)); end: return; } -int grib_optimize_decimal_factor (grib_accessor * a, const char * reference_value, - const double pmax, const double pmin, const int knbit, - const int compat_gribex, const int compat_32bit, - long * kdec, long * kbin, double * ref) +int grib_optimize_decimal_factor(grib_accessor* a, const char* reference_value, + const double pmax, const double pmin, const int knbit, + const int compat_gribex, const int compat_32bit, + long* kdec, long* kbin, double* ref) { grib_handle* gh = grib_handle_of_accessor(a); - int idecmin = -15; - int idecmax = 5; + int idecmin = -15; + int idecmax = 5; long inbint; double xtinyr4, xhuger4, xnbint; int inumax, inutil; long jdec, ie; int irep; - int RANGE = range (); - double EPSILON = epsilon (); - double pa = pmax-pmin; + int RANGE = range(); + double EPSILON = epsilon(); + double pa = pmax - pmin; - if (pa == 0) - { + if (pa == 0) { *kdec = 0; *kbin = 0; *ref = 0.; return GRIB_SUCCESS; } - inumax = 0; + inumax = 0; - if (fabs (pa) <= EPSILON) - { - *kdec = 0; + if (fabs(pa) <= EPSILON) { + *kdec = 0; idecmin = 1; idecmax = 0; } - else if (pmin != 0. && fabs (pmin) < EPSILON) - { - *kdec = 0; + else if (pmin != 0. && fabs(pmin) < EPSILON) { + *kdec = 0; idecmin = 1; idecmax = 0; } @@ -104,35 +98,34 @@ int grib_optimize_decimal_factor (grib_accessor * a, const char * reference_valu xtinyr4 = FLT_MIN; xhuger4 = FLT_MAX; - inbint = grib_power (knbit, 2) - 1; - xnbint = (double)inbint; + inbint = grib_power(knbit, 2) - 1; + xnbint = (double)inbint; /* Test decimal scale factors; keep the most suitable */ - for (jdec = idecmin; jdec <= idecmax; jdec++) - { + for (jdec = idecmin; jdec <= idecmax; jdec++) { /* Fix a problem in GRIBEX */ if (compat_gribex) - if (pa * grib_power (jdec, 10) <= 1.E-12) + if (pa * grib_power(jdec, 10) <= 1.E-12) continue; /* Check it will be possible to decode reference value with 32bit floats */ if (compat_32bit) - if (fabs (pmin) > DBL_MIN) - if (log10 (fabs (pmin)) + (double)jdec <= log10 (xtinyr4)) + if (fabs(pmin) > DBL_MIN) + if (log10(fabs(pmin)) + (double)jdec <= log10(xtinyr4)) continue; /* Check if encoding will not cause an overflow */ - if (fabs (log10 (fabs (pa)) + (double)jdec) >= (double)RANGE) + if (fabs(log10(fabs(pa)) + (double)jdec) >= (double)RANGE) continue; - factec (&irep, pa, knbit, jdec, RANGE, &ie, &inutil); + factec(&irep, pa, knbit, jdec, RANGE, &ie, &inutil); if (irep != 0) continue; /* Check it will be possible to decode the maximum value of the fields using 32bit floats */ if (compat_32bit) - if (pmin * grib_power (jdec, 10) + xnbint * grib_power (ie, 2) >= xhuger4) + if (pmin * grib_power(jdec, 10) + xnbint * grib_power(ie, 2) >= xhuger4) continue; /* GRIB1 demands that the binary scale factor be encoded in a single byte */ @@ -140,8 +133,7 @@ int grib_optimize_decimal_factor (grib_accessor * a, const char * reference_valu if ((ie < -126) || (ie > 127)) continue; - if (inutil > inumax) - { + if (inutil > inumax) { inumax = inutil; *kdec = jdec; *kbin = ie; @@ -149,68 +141,62 @@ int grib_optimize_decimal_factor (grib_accessor * a, const char * reference_valu } if (inumax > 0) { - double decimal = grib_power (+*kdec, 10); - double divisor = grib_power (-*kbin, 2); - double min = pmin * decimal; + double decimal = grib_power(+*kdec, 10); + double divisor = grib_power(-*kbin, 2); + double min = pmin * decimal; long vmin, vmax; - if (grib_get_nearest_smaller_value (gh, reference_value, min, ref) != GRIB_SUCCESS) { - grib_context_log (gh->context, GRIB_LOG_ERROR, - "unable to find nearest_smaller_value of %g for %s", min, reference_value); + if (grib_get_nearest_smaller_value(gh, reference_value, min, ref) != GRIB_SUCCESS) { + grib_context_log(gh->context, GRIB_LOG_ERROR, + "unable to find nearest_smaller_value of %g for %s", min, reference_value); return GRIB_INTERNAL_ERROR; } - vmax = (((pmax*decimal)-*ref)*divisor) + 0.5; - vmin = (((pmin*decimal)-*ref)*divisor) + 0.5; + vmax = (((pmax * decimal) - *ref) * divisor) + 0.5; + vmin = (((pmin * decimal) - *ref) * divisor) + 0.5; /* This may happen if pmin*decimal-*ref is too large */ if ((vmin != 0) || (vmax > inbint)) inumax = 0; - } /* If seeking for an optimal decimal scale factor fails, fall back to a basic method */ - if (inumax == 0) - { - int last = compat_gribex ? 99 : 127; + if (inumax == 0) { + int last = compat_gribex ? 99 : 127; double min = pmin, max = pmax; - double range = max - min; - double f = grib_power (knbit, 2) - 1; - double minrange = grib_power (-last, 2) * f; - double maxrange = grib_power (+last, 2) * f; - double decimal = 1; + double range = max - min; + double f = grib_power(knbit, 2) - 1; + double minrange = grib_power(-last, 2) * f; + double maxrange = grib_power(+last, 2) * f; + double decimal = 1; int err; *kdec = 0; - while (range < minrange) - { + while (range < minrange) { *kdec += 1; decimal *= 10; - min = pmin * decimal; - max = pmax * decimal; + min = pmin * decimal; + max = pmax * decimal; range = max - min; } - while (range > maxrange) - { + while (range > maxrange) { *kdec -= 1; decimal /= 10; - min = pmin * decimal; - max = pmax * decimal; + min = pmin * decimal; + max = pmax * decimal; range = max - min; } - if (grib_get_nearest_smaller_value (gh, reference_value, min, ref) != GRIB_SUCCESS) - { - grib_context_log (gh->context, GRIB_LOG_ERROR, - "unable to find nearest_smaller_value of %g for %s", min, reference_value); + if (grib_get_nearest_smaller_value(gh, reference_value, min, ref) != GRIB_SUCCESS) { + grib_context_log(gh->context, GRIB_LOG_ERROR, + "unable to find nearest_smaller_value of %g for %s", min, reference_value); return GRIB_INTERNAL_ERROR; } - *kbin = grib_get_binary_scale_fact (max, *ref, knbit, &err); + *kbin = grib_get_binary_scale_fact(max, *ref, knbit, &err); - if (err == GRIB_UNDERFLOW) - { + if (err == GRIB_UNDERFLOW) { *kbin = 0; *kdec = 0; *ref = 0; diff --git a/src/grib_parse_utils.c b/src/grib_parse_utils.c index a0719f883..0b2e46701 100644 --- a/src/grib_parse_utils.c +++ b/src/grib_parse_utils.c @@ -15,11 +15,11 @@ ***************************************************************************/ #include "grib_api_internal.h" -grib_action* grib_parser_all_actions = 0; -grib_context* grib_parser_context = 0; -grib_concept_value* grib_parser_concept = 0; -grib_hash_array_value* grib_parser_hash_array = 0; -grib_rule* grib_parser_rules = 0; +grib_action* grib_parser_all_actions = 0; +grib_context* grib_parser_context = 0; +grib_concept_value* grib_parser_concept = 0; +grib_hash_array_value* grib_parser_hash_array = 0; +grib_rule* grib_parser_rules = 0; extern FILE* grib_yyin; extern int grib_yydebug; @@ -27,25 +27,25 @@ extern int grib_yydebug; static const char* parse_file = 0; #if GRIB_PTHREADS -static pthread_once_t once = PTHREAD_ONCE_INIT; -static pthread_mutex_t mutex_file = PTHREAD_MUTEX_INITIALIZER; -static pthread_mutex_t mutex_rules = PTHREAD_MUTEX_INITIALIZER; -static pthread_mutex_t mutex_concept = PTHREAD_MUTEX_INITIALIZER; +static pthread_once_t once = PTHREAD_ONCE_INIT; +static pthread_mutex_t mutex_file = PTHREAD_MUTEX_INITIALIZER; +static pthread_mutex_t mutex_rules = PTHREAD_MUTEX_INITIALIZER; +static pthread_mutex_t mutex_concept = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t mutex_hash_array = PTHREAD_MUTEX_INITIALIZER; -static pthread_mutex_t mutex_stream = PTHREAD_MUTEX_INITIALIZER; -static pthread_mutex_t mutex_parse = PTHREAD_MUTEX_INITIALIZER; +static pthread_mutex_t mutex_stream = PTHREAD_MUTEX_INITIALIZER; +static pthread_mutex_t mutex_parse = PTHREAD_MUTEX_INITIALIZER; static void init() { pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); - pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init(&mutex_file,&attr); - pthread_mutex_init(&mutex_rules,&attr); - pthread_mutex_init(&mutex_concept,&attr); - pthread_mutex_init(&mutex_hash_array,&attr); - pthread_mutex_init(&mutex_stream,&attr); - pthread_mutex_init(&mutex_parse,&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&mutex_file, &attr); + pthread_mutex_init(&mutex_rules, &attr); + pthread_mutex_init(&mutex_concept, &attr); + pthread_mutex_init(&mutex_hash_array, &attr); + pthread_mutex_init(&mutex_stream, &attr); + pthread_mutex_init(&mutex_parse, &attr); pthread_mutexattr_destroy(&attr); } #elif GRIB_OMP_THREADS @@ -61,8 +61,7 @@ static void init() { GRIB_OMP_CRITICAL(lock_grib_parse_utils_c) { - if (once == 0) - { + if (once == 0) { omp_init_nest_lock(&mutex_file); omp_init_nest_lock(&mutex_rules); omp_init_nest_lock(&mutex_concept); @@ -75,86 +74,86 @@ static void init() } #endif -int grib_recompose_name(grib_handle* h, grib_accessor *observer, const char* uname, char* fname, int fail) +int grib_recompose_name(grib_handle* h, grib_accessor* observer, const char* uname, char* fname, int fail) { grib_accessor* a; - char loc[1024]={0,}; - int i = 0; - int ret = 0; - int mode = -1; - char val[1024]={0,}; - double dval=0; - long lval=0; - int type=GRIB_TYPE_STRING; - size_t replen = 0; + char loc[1024] = {0,}; + int i = 0; + int ret = 0; + int mode = -1; + char val[1024] = {0,}; + double dval = 0; + long lval = 0; + int type = GRIB_TYPE_STRING; + size_t replen = 0; char* ptrEnd_fname = NULL; /* Maintain ptr to end of fname string */ - loc[0] = 0 ; - fname[0] = 0 ; + loc[0] = 0; + fname[0] = 0; ptrEnd_fname = fname; /* uname is a string like "grib[GRIBEditionNumber:l]/boot.def". The result fname will be grib2/boot.def */ - while (uname[i]!='\0') - { - if(mode > -1) - { - if(uname[i] == ':') { - type=grib_type_to_int(uname[i+1]); + while (uname[i] != '\0') { + if (mode > -1) { + if (uname[i] == ':') { + type = grib_type_to_int(uname[i + 1]); i++; - } else if(uname[i] == ']') - { + } + else if (uname[i] == ']') { loc[mode] = 0; - mode = -1; - a = grib_find_accessor(h,loc); - if(!a){ + mode = -1; + a = grib_find_accessor(h, loc); + if (!a) { if (!fail) { - sprintf(val,"undef"); - } else { - grib_context_log(h->context, GRIB_LOG_WARNING,"grib_recompose_name: Problem to recompose filename with : %s ( %s no accessor found)", uname,loc); + sprintf(val, "undef"); + } + else { + grib_context_log(h->context, GRIB_LOG_WARNING, "grib_recompose_name: Problem to recompose filename with : %s ( %s no accessor found)", uname, loc); return GRIB_NOT_FOUND; } - } else { + } + else { switch (type) { - case GRIB_TYPE_STRING: - replen = 1024; - ret = grib_unpack_string(a,val,&replen); - break; - case GRIB_TYPE_DOUBLE: - replen=1; - ret = grib_unpack_double(a,&dval,&replen); - sprintf(val,"%.12g",dval); - break; - case GRIB_TYPE_LONG: - replen=1; - ret = grib_unpack_long(a,&lval,&replen); - sprintf(val,"%d",(int)lval); - break; - default: - grib_context_log(h->context, GRIB_LOG_WARNING,"grib_recompose_name: Problem to recompose filename with : %s, invalid type %d", loc,type); - break; + case GRIB_TYPE_STRING: + replen = 1024; + ret = grib_unpack_string(a, val, &replen); + break; + case GRIB_TYPE_DOUBLE: + replen = 1; + ret = grib_unpack_double(a, &dval, &replen); + sprintf(val, "%.12g", dval); + break; + case GRIB_TYPE_LONG: + replen = 1; + ret = grib_unpack_long(a, &lval, &replen); + sprintf(val, "%d", (int)lval); + break; + default: + grib_context_log(h->context, GRIB_LOG_WARNING, "grib_recompose_name: Problem to recompose filename with : %s, invalid type %d", loc, type); + break; } - grib_dependency_add(observer,a); + grib_dependency_add(observer, a); - if((ret != GRIB_SUCCESS)) - { - grib_context_log(h->context, GRIB_LOG_ERROR,"grib_recompose_name: Could not recompose filename : %s", uname); + if ((ret != GRIB_SUCCESS)) { + grib_context_log(h->context, GRIB_LOG_ERROR, "grib_recompose_name: Could not recompose filename : %s", uname); return ret; } } { - char* pc=fname; - while (*pc != '\0') pc++; - strcpy(pc,val); + char* pc = fname; + while (*pc != '\0') + pc++; + strcpy(pc, val); ptrEnd_fname = pc + strlen(val); /* Update ptr to end of fname */ } - loc[0] = 0 ; + loc[0] = 0; } else - loc[mode++]=uname[i]; + loc[mode++] = uname[i]; } - else if(uname[i]=='[') + else if (uname[i] == '[') mode = 0; else { #if 0 @@ -164,9 +163,9 @@ int grib_recompose_name(grib_handle* h, grib_accessor *observer, const char* una #else /* Performance: faster to avoid call to strlen. Append to end */ *ptrEnd_fname++ = uname[i]; - *ptrEnd_fname = '\0'; + *ptrEnd_fname = '\0'; #endif - type=GRIB_TYPE_STRING; + type = GRIB_TYPE_STRING; } i++; } @@ -174,343 +173,374 @@ int grib_recompose_name(grib_handle* h, grib_accessor *observer, const char* una return GRIB_SUCCESS; } -int grib_accessor_print(grib_accessor* a,const char* name,int type,const char* format, - const char* separator,int maxcols,int* newline,FILE* out) +int grib_accessor_print(grib_accessor* a, const char* name, int type, const char* format, + const char* separator, int maxcols, int* newline, FILE* out) { - size_t size=0; - char* sval=NULL; - char* p=NULL; - double* dval=0; - long* lval=0; - char sbuf[1024]={0,}; - size_t replen = 0; - int ret=0; - char* myformat=NULL; - char* myseparator=NULL; - char double_format[]="%.12g"; /* default format for printing double keys */ - char long_format[]="%ld"; /* default format for printing integer keys */ - char default_separator[]=" "; - grib_handle* h=grib_handle_of_accessor(a); - - if (type==-1) type=grib_accessor_get_native_type(a); + size_t size = 0; + char* sval = NULL; + char* p = NULL; + double* dval = 0; + long* lval = 0; + char sbuf[1024] = {0,}; + size_t replen = 0; + int ret = 0; + char* myformat = NULL; + char* myseparator = NULL; + char double_format[] = "%.12g"; /* default format for printing double keys */ + char long_format[] = "%ld"; /* default format for printing integer keys */ + char default_separator[] = " "; + grib_handle* h = grib_handle_of_accessor(a); + + if (type == -1) + type = grib_accessor_get_native_type(a); switch (type) { - case GRIB_TYPE_STRING: - replen=sizeof(sbuf)/sizeof(*sbuf); - ret = grib_unpack_string(a,sbuf,&replen); - fprintf(out,"%s",sbuf); - break; - case GRIB_TYPE_DOUBLE: - myformat= format ? (char*)format : double_format; - myseparator= separator ? (char*)separator : default_separator; - if (name[0]=='/' || name[0]=='#') { - long count; - ret=grib_value_count(a,&count); - size=count; - } else { - ret=_grib_get_size(h,a,&size); - } - dval=(double*)grib_context_malloc_clear(h->context,sizeof(double)*size); - if (name[0]=='/' || name[0]=='#') { - replen=size; - ret=grib_unpack_double(a,dval,&replen); - } else { - replen=0; - ret=_grib_get_double_array_internal(h,a,dval,size,&replen); - } - if (replen==1) fprintf(out,myformat,dval[0]); - else { - int i=0; - int cols=0; - for (i=0;i=maxcols) { - fprintf(out,"\n"); - *newline=1; - cols=0; + case GRIB_TYPE_STRING: + replen = sizeof(sbuf) / sizeof(*sbuf); + ret = grib_unpack_string(a, sbuf, &replen); + fprintf(out, "%s", sbuf); + break; + case GRIB_TYPE_DOUBLE: + myformat = format ? (char*)format : double_format; + myseparator = separator ? (char*)separator : default_separator; + if (name[0] == '/' || name[0] == '#') { + long count; + ret = grib_value_count(a, &count); + size = count; + } + else { + ret = _grib_get_size(h, a, &size); + } + dval = (double*)grib_context_malloc_clear(h->context, sizeof(double) * size); + if (name[0] == '/' || name[0] == '#') { + replen = size; + ret = grib_unpack_double(a, dval, &replen); + } + else { + replen = 0; + ret = _grib_get_double_array_internal(h, a, dval, size, &replen); + } + if (replen == 1) + fprintf(out, myformat, dval[0]); + else { + int i = 0; + int cols = 0; + for (i = 0; i < replen; i++) { + *newline = 1; + fprintf(out, myformat, dval[i]); + if (i < replen - 1) + fprintf(out, "%s", myseparator); + cols++; + if (cols >= maxcols) { + fprintf(out, "\n"); + *newline = 1; + cols = 0; + } } } - } - grib_context_free( h->context,dval); - break; - case GRIB_TYPE_LONG: - myformat= format ? (char*)format : long_format; - myseparator= separator ? (char*)separator : default_separator; - if (name[0]=='/' || name[0]=='#') { - long count; - ret=grib_value_count(a,&count); - size=count; - } else { - ret=_grib_get_size(h,a,&size); - } - lval=(long*)grib_context_malloc_clear(h->context,sizeof(long)*size); - if (name[0]=='/' || name[0]=='#') { - replen=size; - ret=grib_unpack_long(a,lval,&replen); - } else { - replen=0; - ret=_grib_get_long_array_internal(h,a,lval,size,&replen); - } - if (replen==1) fprintf(out, myformat, lval[0]); - else { - int i=0; - int cols=0; - for (i=0;i=maxcols) { - fprintf(out,"\n"); - *newline=1; - cols=0; + grib_context_free(h->context, dval); + break; + case GRIB_TYPE_LONG: + myformat = format ? (char*)format : long_format; + myseparator = separator ? (char*)separator : default_separator; + if (name[0] == '/' || name[0] == '#') { + long count; + ret = grib_value_count(a, &count); + size = count; + } + else { + ret = _grib_get_size(h, a, &size); + } + lval = (long*)grib_context_malloc_clear(h->context, sizeof(long) * size); + if (name[0] == '/' || name[0] == '#') { + replen = size; + ret = grib_unpack_long(a, lval, &replen); + } + else { + replen = 0; + ret = _grib_get_long_array_internal(h, a, lval, size, &replen); + } + if (replen == 1) + fprintf(out, myformat, lval[0]); + else { + int i = 0; + int cols = 0; + for (i = 0; i < replen; i++) { + *newline = 1; + fprintf(out, myformat, lval[i]); + if (i < replen - 1) + fprintf(out, "%s", myseparator); + cols++; + if (cols >= maxcols) { + fprintf(out, "\n"); + *newline = 1; + cols = 0; + } } } - } - grib_context_free( h->context,lval); - break; - case GRIB_TYPE_BYTES: - replen=a->length; - sval=(char*)grib_context_malloc( h->context,replen*sizeof(char)); - ret = grib_unpack_string(a,sval,&replen); - p=sval; - while ((replen--) > 0) fprintf(out,"%c",*(p++)); - grib_context_free(h->context,sval); - *newline=0; - break; - default: - grib_context_log(h->context, GRIB_LOG_WARNING,"grib_accessor_print: Problem to print \"%s\", invalid type %d", a->name,type); + grib_context_free(h->context, lval); + break; + case GRIB_TYPE_BYTES: + replen = a->length; + sval = (char*)grib_context_malloc(h->context, replen * sizeof(char)); + ret = grib_unpack_string(a, sval, &replen); + p = sval; + while ((replen--) > 0) + fprintf(out, "%c", *(p++)); + grib_context_free(h->context, sval); + *newline = 0; + break; + default: + grib_context_log(h->context, GRIB_LOG_WARNING, "grib_accessor_print: Problem to print \"%s\", invalid type %d", a->name, type); } return ret; } int grib_accessors_list_print(grib_handle* h, grib_accessors_list* al, const char* name, - int type,const char* format,const char* separator,int maxcols,int* newline,FILE* out) + int type, const char* format, const char* separator, int maxcols, int* newline, FILE* out) { - size_t size=0,len=0,replen=0; - char* sval=NULL; - char* p=NULL; - double* dval=0; - long* lval=0; - char** cvals=NULL; - int ret=0; - char* myformat=NULL; - char* myseparator=NULL; - char double_format[]="%.12g"; /* default format for printing double keys */ - char long_format[]="%ld"; /* default format for printing integer keys */ - char default_separator[]=" "; - grib_accessor* a=al->accessor; + size_t size = 0, len = 0, replen = 0; + char* sval = NULL; + char* p = NULL; + double* dval = 0; + long* lval = 0; + char** cvals = NULL; + int ret = 0; + char* myformat = NULL; + char* myseparator = NULL; + char double_format[] = "%.12g"; /* default format for printing double keys */ + char long_format[] = "%ld"; /* default format for printing integer keys */ + char default_separator[] = " "; + grib_accessor* a = al->accessor; /* Number of columns specified as 0 means print on ONE line i.e. num cols = infinity */ - if (maxcols == 0) maxcols = INT_MAX; + if (maxcols == 0) + maxcols = INT_MAX; - if (type==-1) type=grib_accessor_get_native_type(al->accessor); - grib_accessors_list_value_count(al,&size); + if (type == -1) + type = grib_accessor_get_native_type(al->accessor); + grib_accessors_list_value_count(al, &size); switch (type) { - case GRIB_TYPE_STRING: - myseparator= separator ? (char*)separator : default_separator; - if (size==1) { - char sbuf[1024]={0,}; - len = sizeof(sbuf); - ret = grib_unpack_string(al->accessor,sbuf,&len); - if (grib_is_missing_string(al->accessor,(unsigned char *)sbuf,len)) { - fprintf(out,"%s","MISSING"); - } else { - fprintf(out,"%s",sbuf); + case GRIB_TYPE_STRING: + myseparator = separator ? (char*)separator : default_separator; + if (size == 1) { + char sbuf[1024] = {0,}; + len = sizeof(sbuf); + ret = grib_unpack_string(al->accessor, sbuf, &len); + if (grib_is_missing_string(al->accessor, (unsigned char*)sbuf, len)) { + fprintf(out, "%s", "MISSING"); + } + else { + fprintf(out, "%s", sbuf); + } } - } else { - int i=0; - int cols=0; - cvals=(char**)grib_context_malloc_clear(h->context,sizeof(char*)*size); - grib_accessors_list_unpack_string(al,cvals,&size); - for (i=0;i=maxcols) { - fprintf(out,"\n"); - *newline=1; - cols=0; + else { + int i = 0; + int cols = 0; + cvals = (char**)grib_context_malloc_clear(h->context, sizeof(char*) * size); + grib_accessors_list_unpack_string(al, cvals, &size); + for (i = 0; i < size; i++) { + *newline = 1; + fprintf(out, "%s", cvals[i]); + if (i < size - 1) + fprintf(out, "%s", myseparator); + cols++; + if (cols >= maxcols) { + fprintf(out, "\n"); + *newline = 1; + cols = 0; + } } } - } - grib_context_free( h->context,cvals); - break; - case GRIB_TYPE_DOUBLE: - myformat= format ? (char*)format : double_format; - myseparator= separator ? (char*)separator : default_separator; - dval=(double*)grib_context_malloc_clear(h->context,sizeof(double)*size); - ret = grib_accessors_list_unpack_double(al,dval,&size); - if (size==1) fprintf(out,myformat,dval[0]); - else { - int i=0; - int cols=0; - for (i=0;i=maxcols) { - fprintf(out,"\n"); - *newline=1; - cols=0; + grib_context_free(h->context, cvals); + break; + case GRIB_TYPE_DOUBLE: + myformat = format ? (char*)format : double_format; + myseparator = separator ? (char*)separator : default_separator; + dval = (double*)grib_context_malloc_clear(h->context, sizeof(double) * size); + ret = grib_accessors_list_unpack_double(al, dval, &size); + if (size == 1) + fprintf(out, myformat, dval[0]); + else { + int i = 0; + int cols = 0; + for (i = 0; i < size; i++) { + *newline = 1; + fprintf(out, myformat, dval[i]); + if (i < size - 1) + fprintf(out, "%s", myseparator); + cols++; + if (cols >= maxcols) { + fprintf(out, "\n"); + *newline = 1; + cols = 0; + } } } - } - grib_context_free( h->context,dval); - break; - case GRIB_TYPE_LONG: - myformat= format ? (char*)format : long_format; - myseparator= separator ? (char*)separator : default_separator; - lval=(long*)grib_context_malloc_clear(h->context,sizeof(long)*size); - ret = grib_accessors_list_unpack_long(al,lval,&size); - if (size==1) fprintf(out, myformat, lval[0]); - else { - int i=0; - int cols=0; - for (i=0;i=maxcols) { - fprintf(out,"\n"); - *newline=1; - cols=0; + grib_context_free(h->context, dval); + break; + case GRIB_TYPE_LONG: + myformat = format ? (char*)format : long_format; + myseparator = separator ? (char*)separator : default_separator; + lval = (long*)grib_context_malloc_clear(h->context, sizeof(long) * size); + ret = grib_accessors_list_unpack_long(al, lval, &size); + if (size == 1) + fprintf(out, myformat, lval[0]); + else { + int i = 0; + int cols = 0; + for (i = 0; i < size; i++) { + *newline = 1; + fprintf(out, myformat, lval[i]); + if (i < size - 1) + fprintf(out, "%s", myseparator); + cols++; + if (cols >= maxcols) { + fprintf(out, "\n"); + *newline = 1; + cols = 0; + } } } - } - grib_context_free( h->context,lval); - break; - case GRIB_TYPE_BYTES: - replen=a->length; - sval=(char*)grib_context_malloc( h->context,replen*sizeof(char)); - ret = grib_unpack_string(al->accessor,sval,&replen); - p=sval; - while ((replen--) > 0) fprintf(out,"%c",*(p++)); - grib_context_free(h->context,sval); - *newline=0; - break; - default: - grib_context_log(h->context, GRIB_LOG_WARNING, - "grib_accessor_print: Problem printing \"%s\", invalid type %d", a->name, grib_get_type_name(type)); + grib_context_free(h->context, lval); + break; + case GRIB_TYPE_BYTES: + replen = a->length; + sval = (char*)grib_context_malloc(h->context, replen * sizeof(char)); + ret = grib_unpack_string(al->accessor, sval, &replen); + p = sval; + while ((replen--) > 0) + fprintf(out, "%c", *(p++)); + grib_context_free(h->context, sval); + *newline = 0; + break; + default: + grib_context_log(h->context, GRIB_LOG_WARNING, + "grib_accessor_print: Problem printing \"%s\", invalid type %d", a->name, grib_get_type_name(type)); } return ret; } -int grib_recompose_print(grib_handle* h, grib_accessor *observer, const char* uname, int fail,FILE* out) +int grib_recompose_print(grib_handle* h, grib_accessor* observer, const char* uname, int fail, FILE* out) { - grib_accessors_list* al=NULL; + grib_accessors_list* al = NULL; char loc[1024]; - int i = 0; - int ret=0; - int mode = -1; - char* pp=NULL; - char* format=NULL; - int type=-1; - char* separator=NULL; + int i = 0; + int ret = 0; + int mode = -1; + char* pp = NULL; + char* format = NULL; + int type = -1; + char* separator = NULL; int l; - char buff[10]={0,}; - char buff1[1024]={0,}; - int maxcolsd=8; + char buff[10] = {0,}; + char buff1[1024] = {0,}; + int maxcolsd = 8; int maxcols; - long numcols = 0; - int newline=1; + long numcols = 0; + int newline = 1; const size_t uname_len = strlen(uname); - maxcols=maxcolsd; - loc[0] = 0 ; - for(i=0; i -1) - { + maxcols = maxcolsd; + loc[0] = 0; + for (i = 0; i < uname_len; i++) { + if (mode > -1) { switch (uname[i]) { - case ':': - type=grib_type_to_int(uname[i+1]); - i++; - break; - case '\'': - pp=(char*)(uname+i+1); - while(*pp!='%' && *pp!='!' && *pp!=']' && *pp!=':' && *pp!='\'') pp++; - l=pp-uname-i; - if (*pp == '\'') separator=strncpy(buff1,uname+i+1,l-1); - i+=l; - break; - case '%': - pp=(char*)(uname+i+1); - while(*pp!='%' && *pp!='!' && *pp!=']' && *pp!=':' && *pp!='\'') pp++; - l=pp-uname-i; - format=strncpy(buff,uname+i,l); - i+=l-1; - break; - case '!': - pp=(char*)uname; - if (string_to_long(uname+i+1, &numcols)==GRIB_SUCCESS) { - maxcols=(int)numcols; - } else { - /* Columns specification is invalid integer */ - maxcols=maxcolsd; - } - strtol(uname+i+1,&pp,10); - while(pp && *pp!='%' && *pp!='!' && *pp!=']' && *pp!=':' && *pp!='\'' ) pp++; - i+=pp-uname-i-1; - break; - case ']': - loc[mode] = 0; - mode = -1; - al = grib_find_accessors_list(h,loc); - if(!al){ - if (!fail) { - fprintf(out,"undef"); - ret=GRIB_NOT_FOUND; - } else { - grib_context_log(h->context, GRIB_LOG_WARNING,"grib_recompose_print: Problem to recompose print with : %s, no accessor found", loc); - return GRIB_NOT_FOUND; + case ':': + type = grib_type_to_int(uname[i + 1]); + i++; + break; + case '\'': + pp = (char*)(uname + i + 1); + while (*pp != '%' && *pp != '!' && *pp != ']' && *pp != ':' && *pp != '\'') + pp++; + l = pp - uname - i; + if (*pp == '\'') + separator = strncpy(buff1, uname + i + 1, l - 1); + i += l; + break; + case '%': + pp = (char*)(uname + i + 1); + while (*pp != '%' && *pp != '!' && *pp != ']' && *pp != ':' && *pp != '\'') + pp++; + l = pp - uname - i; + format = strncpy(buff, uname + i, l); + i += l - 1; + break; + case '!': + pp = (char*)uname; + if (string_to_long(uname + i + 1, &numcols) == GRIB_SUCCESS) { + maxcols = (int)numcols; + } + else { + /* Columns specification is invalid integer */ + maxcols = maxcolsd; } - } else { - ret=grib_accessors_list_print(h,al,loc,type,format,separator,maxcols,&newline,out); + strtol(uname + i + 1, &pp, 10); + while (pp && *pp != '%' && *pp != '!' && *pp != ']' && *pp != ':' && *pp != '\'') + pp++; + i += pp - uname - i - 1; + break; + case ']': + loc[mode] = 0; + mode = -1; + al = grib_find_accessors_list(h, loc); + if (!al) { + if (!fail) { + fprintf(out, "undef"); + ret = GRIB_NOT_FOUND; + } + else { + grib_context_log(h->context, GRIB_LOG_WARNING, "grib_recompose_print: Problem to recompose print with : %s, no accessor found", loc); + return GRIB_NOT_FOUND; + } + } + else { + ret = grib_accessors_list_print(h, al, loc, type, format, separator, maxcols, &newline, out); - if(ret != GRIB_SUCCESS) - { - /* grib_context_log(h->context, GRIB_LOG_ERROR,"grib_recompose_print: Could not recompose print : %s", uname); */ - return ret; + if (ret != GRIB_SUCCESS) { + /* grib_context_log(h->context, GRIB_LOG_ERROR,"grib_recompose_print: Could not recompose print : %s", uname); */ + return ret; + } } - } - loc[0] = 0 ; - break; - default: - loc[mode++]=uname[i]; - break; + loc[0] = 0; + break; + default: + loc[mode++] = uname[i]; + break; } - } else if(uname[i]=='[') { + } + else if (uname[i] == '[') { mode = 0; - } else { - fprintf(out,"%c",uname[i]); - type=-1; + } + else { + fprintf(out, "%c", uname[i]); + type = -1; } } - if (newline) fprintf(out,"\n"); + if (newline) + fprintf(out, "\n"); return ret; } /* Note: A fast cut-down version of strcmp which does NOT return -1 */ /* 0 means input strings are equal and 1 means not equal */ -GRIB_INLINE static int grib_inline_strcmp(const char* a,const char* b) { - if (*a != *b) return 1; - while((*a!=0 && *b!=0) && *(a) == *(b) ) {a++;b++;} - return (*a==0 && *b==0) ? 0 : 1; +GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b) +{ + if (*a != *b) + return 1; + while ((*a != 0 && *b != 0) && *(a) == *(b)) { + a++; + b++; + } + return (*a == 0 && *b == 0) ? 0 : 1; } -grib_action_file* grib_find_action_file(const char* fname , grib_action_file_list* afl) +grib_action_file* grib_find_action_file(const char* fname, grib_action_file_list* afl) { grib_action_file* act = afl->first; - while(act) - { - if(grib_inline_strcmp(act->filename,fname)==0) + while (act) { + if (grib_inline_strcmp(act->filename, fname) == 0) return act; act = act->next; } @@ -528,16 +558,17 @@ void grib_push_action_file(grib_action_file* af, grib_action_file_list* afl) #define MAXINCLUDE 10 -typedef struct { - char *name; - FILE *file; - char *io_buffer; - int line; +typedef struct +{ + char* name; + FILE* file; + char* io_buffer; + int line; } context; static context stack[MAXINCLUDE]; -static int top = 0; -extern FILE *grib_yyin; +static int top = 0; +extern FILE* grib_yyin; extern int grib_yylineno; extern void grib_yyrestart(FILE*); static int error = 0; @@ -555,10 +586,9 @@ int grib_yywrap() grib_yylineno = stack[top].line; - if(top) - { - parse_file = stack[top-1].name; - grib_yyin = stack[top-1].file; + if (top) { + parse_file = stack[top - 1].name; + grib_yyin = stack[top - 1].file; Assert(parse_file); Assert(grib_yyin); /* grib_yyrestart(grib_yyin); */ @@ -566,13 +596,13 @@ int grib_yywrap() /* for(i = 0; i < top ; i++) printf(" "); */ /* printf("BACK TO %s\n",parse_file); */ - grib_context_free(grib_parser_context,stack[top].name); + grib_context_free(grib_parser_context, stack[top].name); return 0; } else { - grib_context_free(grib_parser_context,stack[top].name); + grib_context_free(grib_parser_context, stack[top].name); parse_file = 0; - grib_yyin = NULL; + grib_yyin = NULL; return 1; } } @@ -585,29 +615,28 @@ char* file_being_parsed() int grib_yyerror(const char* msg) { grib_context_log(grib_parser_context, GRIB_LOG_ERROR, - "grib_parser: %s at line %d of %s", msg, grib_yylineno + 1,parse_file); + "grib_parser: %s at line %d of %s", msg, grib_yylineno + 1, parse_file); grib_context_log(grib_parser_context, GRIB_LOG_ERROR, - "ecCodes Version: %s", ECCODES_VERSION_STR); + "ecCodes Version: %s", ECCODES_VERSION_STR); error = 1; return 1; } void grib_parser_include(const char* included_fname) { - FILE *f = NULL; - char* io_buffer=0; + FILE* f = NULL; + char* io_buffer = 0; /* int i; */ Assert(top < MAXINCLUDE); Assert(included_fname); - if (!included_fname) return; + if (!included_fname) + return; - if(parse_file == 0) - { + if (parse_file == 0) { parse_file = included_fname; Assert(top == 0); } - else - { + else { /* When parse_file is not NULL, it's the path of the parent file (includer) */ /* and 'included_fname' is the name of the file being included (includee) */ @@ -621,32 +650,31 @@ void grib_parser_include(const char* included_fname) grib_parser_context->grib_definition_files_path); grib_context_log(grib_parser_context, GRIB_LOG_FATAL, - "grib_parser_include: Could not resolve '%s' (included in %s)", included_fname, parse_file); + "grib_parser_include: Could not resolve '%s' (included in %s)", included_fname, parse_file); return; } parse_file = new_path; } - if (strcmp(parse_file,"-")==0) { - grib_context_log(grib_parser_context,GRIB_LOG_DEBUG,"parsing standard input"); - f = stdin; /* read from std input */ - } else { - grib_context_log(grib_parser_context,GRIB_LOG_DEBUG,"parsing include file %s",parse_file); - f = codes_fopen(parse_file,"r"); + if (strcmp(parse_file, "-") == 0) { + grib_context_log(grib_parser_context, GRIB_LOG_DEBUG, "parsing standard input"); + f = stdin; /* read from std input */ + } + else { + grib_context_log(grib_parser_context, GRIB_LOG_DEBUG, "parsing include file %s", parse_file); + f = codes_fopen(parse_file, "r"); } /* for(i = 0; i < top ; i++) printf(" "); */ /* printf("PARSING %s\n",parse_file); */ - if(f == NULL) - { + if (f == NULL) { char buffer[1024]; - grib_context_log(grib_parser_context, (GRIB_LOG_ERROR)|(GRIB_LOG_PERROR),"grib_parser_include: cannot open: '%s'", parse_file); - sprintf(buffer,"Cannot include file: '%s'",parse_file); + grib_context_log(grib_parser_context, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), "grib_parser_include: cannot open: '%s'", parse_file); + sprintf(buffer, "Cannot include file: '%s'", parse_file); grib_yyerror(buffer); } - else - { + else { /* c=grib_context_get_default(); if (c->io_buffer_size) { @@ -656,13 +684,13 @@ void grib_parser_include(const char* included_fname) setvbuf(f,io_buffer,_IOFBF,c->io_buffer_size); } */ - grib_yyin = f; - stack[top].file = f; + grib_yyin = f; + stack[top].file = f; stack[top].io_buffer = io_buffer; - stack[top].name = grib_context_strdup(grib_parser_context,parse_file); - parse_file = stack[top].name; - stack[top].line = grib_yylineno; - grib_yylineno = 0; + stack[top].name = grib_context_strdup(grib_parser_context, parse_file); + parse_file = stack[top].name; + stack[top].line = grib_yylineno; + grib_yylineno = 0; top++; /* grib_yyrestart(f); */ } @@ -673,7 +701,7 @@ extern int grib_yyparse(void); static int parse(grib_context* gc, const char* filename) { int err = 0; - GRIB_MUTEX_INIT_ONCE(&once,&init); + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex_parse); #ifdef YYDEBUG @@ -685,8 +713,8 @@ static int parse(grib_context* gc, const char* filename) gc = gc ? gc : grib_context_get_default(); - grib_yyin = NULL; - top = 0; + grib_yyin = NULL; + top = 0; parse_file = 0; grib_parser_include(filename); if (!grib_yyin) { @@ -695,10 +723,11 @@ static int parse(grib_context* gc, const char* filename) GRIB_MUTEX_UNLOCK(&mutex_parse); return GRIB_FILE_NOT_FOUND; } - err = grib_yyparse(); + err = grib_yyparse(); parse_file = 0; - if (err) grib_context_log(gc,GRIB_LOG_ERROR,"Parsing error %d > %s\n",err, filename); + if (err) + grib_context_log(gc, GRIB_LOG_ERROR, "Parsing error %d > %s\n", err, filename); GRIB_MUTEX_UNLOCK(&mutex_parse); return err; @@ -706,120 +735,126 @@ static int parse(grib_context* gc, const char* filename) static grib_action* grib_parse_stream(grib_context* gc, const char* filename) { - GRIB_MUTEX_INIT_ONCE(&once,&init); + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex_stream); grib_parser_all_actions = 0; - if (parse(gc,filename) == 0) { + if (parse(gc, filename) == 0) { if (grib_parser_all_actions) { GRIB_MUTEX_UNLOCK(&mutex_stream) return grib_parser_all_actions; - } else { - grib_action* ret=grib_action_create_noop(gc,filename); + } + else { + grib_action* ret = grib_action_create_noop(gc, filename); GRIB_MUTEX_UNLOCK(&mutex_stream) return ret; } - } else { + } + else { GRIB_MUTEX_UNLOCK(&mutex_stream); return NULL; } } -grib_concept_value* grib_parse_concept_file( grib_context* gc,const char* filename) +grib_concept_value* grib_parse_concept_file(grib_context* gc, const char* filename) { - GRIB_MUTEX_INIT_ONCE(&once,&init); + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex_file); - gc = gc ? gc : grib_context_get_default(); + gc = gc ? gc : grib_context_get_default(); grib_parser_context = gc; - if(parse(gc,filename) == 0) { + if (parse(gc, filename) == 0) { GRIB_MUTEX_UNLOCK(&mutex_file); return grib_parser_concept; - } else { + } + else { GRIB_MUTEX_UNLOCK(&mutex_file); return NULL; } } -grib_hash_array_value* grib_parse_hash_array_file( grib_context* gc,const char* filename) +grib_hash_array_value* grib_parse_hash_array_file(grib_context* gc, const char* filename) { - GRIB_MUTEX_INIT_ONCE(&once,&init); + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex_file); - gc = gc ? gc : grib_context_get_default(); + gc = gc ? gc : grib_context_get_default(); grib_parser_context = gc; - if(parse(gc,filename) == 0) { + if (parse(gc, filename) == 0) { GRIB_MUTEX_UNLOCK(&mutex_file); return grib_parser_hash_array; - } else { + } + else { GRIB_MUTEX_UNLOCK(&mutex_file); return NULL; } } -grib_rule* grib_parse_rules_file( grib_context* gc,const char* filename) +grib_rule* grib_parse_rules_file(grib_context* gc, const char* filename) { - if (!gc) gc=grib_context_get_default(); + if (!gc) + gc = grib_context_get_default(); - GRIB_MUTEX_INIT_ONCE(&once,&init); + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex_rules); - gc = gc ? gc : grib_context_get_default(); + gc = gc ? gc : grib_context_get_default(); grib_parser_context = gc; - if(parse(gc,filename) == 0) { + if (parse(gc, filename) == 0) { GRIB_MUTEX_UNLOCK(&mutex_rules); return grib_parser_rules; - } else { + } + else { GRIB_MUTEX_UNLOCK(&mutex_rules); return NULL; } } -grib_action* grib_parse_file( grib_context* gc,const char* filename) +grib_action* grib_parse_file(grib_context* gc, const char* filename) { grib_action_file* af; - GRIB_MUTEX_INIT_ONCE(&once,&init); + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex_file); - af =0; + af = 0; gc = gc ? gc : grib_context_get_default(); grib_parser_context = gc; - if(!gc->grib_reader) - gc->grib_reader =(grib_action_file_list*)grib_context_malloc_clear_persistent(gc,sizeof(grib_action_file_list)); + if (!gc->grib_reader) + gc->grib_reader = (grib_action_file_list*)grib_context_malloc_clear_persistent(gc, sizeof(grib_action_file_list)); else { af = grib_find_action_file(filename, gc->grib_reader); } - if(!af) - { - grib_action *a; - grib_context_log(gc,GRIB_LOG_DEBUG,"Loading %s",filename); + if (!af) { + grib_action* a; + grib_context_log(gc, GRIB_LOG_DEBUG, "Loading %s", filename); - a = grib_parse_stream(gc,filename); + a = grib_parse_stream(gc, filename); - if(error) - { - if (a) grib_action_delete(gc,a); + if (error) { + if (a) + grib_action_delete(gc, a); GRIB_MUTEX_UNLOCK(&mutex_file); return NULL; } - af =(grib_action_file*)grib_context_malloc_clear_persistent(gc,sizeof(grib_action_file)); + af = (grib_action_file*)grib_context_malloc_clear_persistent(gc, sizeof(grib_action_file)); af->root = a; - af->filename=grib_context_strdup_persistent(gc,filename); - grib_push_action_file(af,gc->grib_reader); + af->filename = grib_context_strdup_persistent(gc, filename); + grib_push_action_file(af, gc->grib_reader); } - else grib_context_log(gc,GRIB_LOG_DEBUG,"Using cached version of %s",filename); + else + grib_context_log(gc, GRIB_LOG_DEBUG, "Using cached version of %s", filename); GRIB_MUTEX_UNLOCK(&mutex_file); return af->root; @@ -828,21 +863,21 @@ grib_action* grib_parse_file( grib_context* gc,const char* filename) int grib_type_to_int(char id) { switch (id) { - case 'd': - return GRIB_TYPE_DOUBLE; - break; - case 'f': - return GRIB_TYPE_DOUBLE; - break; - case 'l': - return GRIB_TYPE_LONG; - break; - case 'i': - return GRIB_TYPE_LONG; - break; - case 's': - return GRIB_TYPE_STRING; - break; + case 'd': + return GRIB_TYPE_DOUBLE; + break; + case 'f': + return GRIB_TYPE_DOUBLE; + break; + case 'l': + return GRIB_TYPE_LONG; + break; + case 'i': + return GRIB_TYPE_LONG; + break; + case 's': + return GRIB_TYPE_STRING; + break; } return GRIB_TYPE_UNDEFINED; } diff --git a/src/grib_query.c b/src/grib_query.c index 1d81fc443..1fd736ecd 100644 --- a/src/grib_query.c +++ b/src/grib_query.c @@ -17,46 +17,50 @@ /* Note: A fast cut-down version of strcmp which does NOT return -1 */ /* 0 means input strings are equal and 1 means not equal */ -GRIB_INLINE static int grib_inline_strcmp(const char* a,const char* b) { - if (*a != *b) return 1; - while((*a!=0 && *b!=0) && *(a) == *(b) ) {a++;b++;} - return (*a==0 && *b==0) ? 0 : 1; +GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b) +{ + if (*a != *b) + return 1; + while ((*a != 0 && *b != 0) && *(a) == *(b)) { + a++; + b++; + } + return (*a == 0 && *b == 0) ? 0 : 1; } -static int matching(grib_accessor* a,const char* name,const char* name_space) +static int matching(grib_accessor* a, const char* name, const char* name_space) { int i = 0; - while(i < MAX_ACCESSOR_NAMES) - { - if(a->all_names[i] == 0) return 0; - - if((grib_inline_strcmp(name,a->all_names[i]) == 0) && - ((name_space == NULL) || (a->all_name_spaces[i] != NULL && - grib_inline_strcmp(a->all_name_spaces[i],name_space) == 0)) - ) + while (i < MAX_ACCESSOR_NAMES) { + if (a->all_names[i] == 0) + return 0; + + if ((grib_inline_strcmp(name, a->all_names[i]) == 0) && + ((name_space == NULL) || (a->all_name_spaces[i] != NULL && + grib_inline_strcmp(a->all_name_spaces[i], name_space) == 0))) return 1; i++; } return 0; } -static grib_accessor* search(grib_section* s,const char* name,const char* name_space) +static grib_accessor* search(grib_section* s, const char* name, const char* name_space) { grib_accessor* match = NULL; grib_accessor* a = s ? s->block->first : NULL; - grib_accessor* b=NULL; + grib_accessor* b = NULL; - if(!a || !s) return NULL; + if (!a || !s) + return NULL; - while(a) - { + while (a) { grib_section* sub = a->sub_section; - if(matching(a,name,name_space)) + if (matching(a, name, name_space)) match = a; - if((b = search(sub,name,name_space) ) != NULL ) + if ((b = search(sub, name, name_space)) != NULL) match = b; a = a->next; @@ -65,147 +69,152 @@ static grib_accessor* search(grib_section* s,const char* name,const char* name_s return match; } -static void rebuild_hash_keys (grib_handle* h,grib_section* s) +static void rebuild_hash_keys(grib_handle* h, grib_section* s) { grib_accessor* a = s ? s->block->first : NULL; - while(a) - { + while (a) { grib_section* sub = a->sub_section; - int i=0; - int id=-1; - const char *p; + int i = 0; + int id = -1; + const char* p; DebugAssert(h == grib_handle_of_accessor(a)); - while(iall_names[i]) != NULL)) { - if(*p != '_') { - id=grib_hash_keys_get_id(a->context->keys,p); + while (i < MAX_ACCESSOR_NAMES && ((p = a->all_names[i]) != NULL)) { + if (*p != '_') { + id = grib_hash_keys_get_id(a->context->keys, p); - if (a->same != a && i==0) { - grib_handle* hand = grib_handle_of_accessor(a); - a->same=hand->accessors[id]; - hand->accessors[id]=a; + if (a->same != a && i == 0) { + grib_handle* hand = grib_handle_of_accessor(a); + a->same = hand->accessors[id]; + hand->accessors[id] = a; DebugAssert(a->same != a); } - } i++; } - rebuild_hash_keys(h,sub); + rebuild_hash_keys(h, sub); a = a->next; } } -static grib_accessor* search_and_cache(grib_handle* h, const char* name,const char *the_namespace); +static grib_accessor* search_and_cache(grib_handle* h, const char* name, const char* the_namespace); -static grib_accessor* _search_and_cache(grib_handle* h, const char* name,const char *the_namespace) +static grib_accessor* _search_and_cache(grib_handle* h, const char* name, const char* the_namespace) { - if (h->use_trie) - { + if (h->use_trie) { grib_accessor* a = NULL; - int id=-1; + int id = -1; - if (h->trie_invalid && h->kid == NULL) - { - int i=0; - for (i=0;iaccessors[i]=NULL; + if (h->trie_invalid && h->kid == NULL) { + int i = 0; + for (i = 0; i < ACCESSORS_ARRAY_SIZE; i++) + h->accessors[i] = NULL; if (h->root) - rebuild_hash_keys(h,h->root); - - h->trie_invalid=0; - id = grib_hash_keys_get_id(h->context->keys,name); + rebuild_hash_keys(h, h->root); - } else { - id = grib_hash_keys_get_id(h->context->keys,name); + h->trie_invalid = 0; + id = grib_hash_keys_get_id(h->context->keys, name); + } + else { + id = grib_hash_keys_get_id(h->context->keys, name); - if ((a=h->accessors[id])!=NULL && - (the_namespace==NULL || matching(a,name,the_namespace) )) + if ((a = h->accessors[id]) != NULL && + (the_namespace == NULL || matching(a, name, the_namespace))) return a; } - a = search(h->root,name,the_namespace); + a = search(h->root, name, the_namespace); h->accessors[id] = a; return a; - } else { - return search(h->root,name,the_namespace); + } + else { + return search(h->root, name, the_namespace); } } -static char* get_rank(grib_context* c, const char* name,int *rank) { - char* p=(char*)name; - char* end=p; - char* ret=NULL; +static char* get_rank(grib_context* c, const char* name, int* rank) +{ + char* p = (char*)name; + char* end = p; + char* ret = NULL; - *rank=-1; + *rank = -1; - if (*p=='#') { - *rank=strtol(++p,&end,10); - if ( *end != '#') { - *rank=-1; - } else { + if (*p == '#') { + *rank = strtol(++p, &end, 10); + if (*end != '#') { + *rank = -1; + } + else { DebugAssert(c); end++; - ret=grib_context_strdup(c,end); + ret = grib_context_strdup(c, end); } } return ret; } -static char* get_condition(const char* name,codes_condition* condition) +static char* get_condition(const char* name, codes_condition* condition) { - char* equal=(char*)name; - char* endCondition=NULL; - char* str=NULL; - char* end=NULL; + char* equal = (char*)name; + char* endCondition = NULL; + char* str = NULL; + char* end = NULL; long lval; - grib_context* c=grib_context_get_default(); + grib_context* c = grib_context_get_default(); - condition->rightType=GRIB_TYPE_UNDEFINED; + condition->rightType = GRIB_TYPE_UNDEFINED; - Assert(name[0]=='/'); + Assert(name[0] == '/'); - while (*equal!=0 && *equal!='=') equal++; - if (*equal==0) return NULL; + while (*equal != 0 && *equal != '=') + equal++; + if (*equal == 0) + return NULL; - endCondition=equal; - while (*endCondition!=0 && *endCondition!='/') endCondition++; - if (*endCondition==0) return NULL; + endCondition = equal; + while (*endCondition != 0 && *endCondition != '/') + endCondition++; + if (*endCondition == 0) + return NULL; - str=(char*)grib_context_malloc_clear(c,strlen(name)); - memcpy(str,equal+1,endCondition-equal-1); + str = (char*)grib_context_malloc_clear(c, strlen(name)); + memcpy(str, equal + 1, endCondition - equal - 1); - end=NULL; - lval=strtol(str,&end,10); + end = NULL; + lval = strtol(str, &end, 10); if (*end != 0) { /* strtol failed. Not an integer */ double dval; - dval=strtod(str,&end); + dval = strtod(str, &end); if (*end == 0) { /* strtod passed. So a double */ - condition->rightType=GRIB_TYPE_DOUBLE; - condition->rightDouble=dval; + condition->rightType = GRIB_TYPE_DOUBLE; + condition->rightDouble = dval; } - } else { - condition->rightType=GRIB_TYPE_LONG; - condition->rightLong=lval; + } + else { + condition->rightType = GRIB_TYPE_LONG; + condition->rightLong = lval; } - if (condition->rightType!=GRIB_TYPE_UNDEFINED) { - strcpy(str,endCondition+1); - condition->left=(char*)grib_context_malloc_clear(c,equal-name); - memcpy(condition->left,name+1,equal-name-1); - } else { - grib_context_free(c,str); - str=NULL; + if (condition->rightType != GRIB_TYPE_UNDEFINED) { + strcpy(str, endCondition + 1); + condition->left = (char*)grib_context_malloc_clear(c, equal - name); + memcpy(condition->left, name + 1, equal - name - 1); + } + else { + grib_context_free(c, str); + str = NULL; } return str; } -static grib_accessor* _search_by_rank(grib_accessor* a,const char* name,int rank) +static grib_accessor* _search_by_rank(grib_accessor* a, const char* name, int rank) { - grib_trie_with_rank* t=accessor_bufr_data_array_get_dataAccessorsTrie(a); - grib_accessor* ret=(grib_accessor*)grib_trie_with_rank_get(t,name,rank); + grib_trie_with_rank* t = accessor_bufr_data_array_get_dataAccessorsTrie(a); + grib_accessor* ret = (grib_accessor*)grib_trie_with_rank_get(t, name, rank); return ret; } @@ -226,16 +235,17 @@ static grib_accessor* _search_by_rank(grib_accessor* a,const char* name,long ran } */ -static grib_accessor* search_by_rank(grib_handle* h, const char* name,int rank,const char *the_namespace) +static grib_accessor* search_by_rank(grib_handle* h, const char* name, int rank, const char* the_namespace) { - grib_accessor* data=search_and_cache(h,"dataAccessors",the_namespace); + grib_accessor* data = search_and_cache(h, "dataAccessors", the_namespace); if (data) { - return _search_by_rank(data,name,rank); - } else { + return _search_by_rank(data, name, rank); + } + else { int rank2; - char* str=get_rank(h->context, name, &rank2); - grib_accessor* ret=_search_and_cache(h,str,the_namespace); - grib_context_free(h->context,str); + char* str = get_rank(h->context, name, &rank2); + grib_accessor* ret = _search_and_cache(h, str, the_namespace); + grib_context_free(h->context, str); return ret; } } @@ -243,76 +253,88 @@ static grib_accessor* search_by_rank(grib_handle* h, const char* name,int rank,c static int get_single_long_val(grib_accessor* a, long* result) { grib_context* c = a->context; - int err = 0; - size_t size = 1; + int err = 0; + size_t size = 1; if (c->bufr_multi_element_constant_arrays) { - long count=0; - grib_value_count(a,&count); - if(count>1) { - size_t i = 0; - long val0 = 0; - int is_constant=1; - long* values=(long*)grib_context_malloc_clear(c,sizeof(long)*count); - size = count; - err=grib_unpack_long(a,values,&size); - val0 = values[0]; - for (i=0;i 1) { + size_t i = 0; + long val0 = 0; + int is_constant = 1; + long* values = (long*)grib_context_malloc_clear(c, sizeof(long) * count); + size = count; + err = grib_unpack_long(a, values, &size); + val0 = values[0]; + for (i = 0; i < size; i++) { + if (val0 != values[i]) { + is_constant = 0; + break; + } } if (is_constant) { *result = val0; grib_context_free(c, values); - } else { + } + else { return GRIB_ARRAY_TOO_SMALL; } - } else { - err = grib_unpack_long(a,result,&size); } - } else { - err = grib_unpack_long(a,result,&size); + else { + err = grib_unpack_long(a, result, &size); + } + } + else { + err = grib_unpack_long(a, result, &size); } return err; } static int get_single_double_val(grib_accessor* a, double* result) { grib_context* c = a->context; - int err = 0; - size_t size = 1; + int err = 0; + size_t size = 1; if (c->bufr_multi_element_constant_arrays) { - long count=0; - grib_value_count(a,&count); - if(count>1) { - size_t i = 0; - double val0 = 0; - int is_constant=1; - double* values=(double*)grib_context_malloc_clear(c,sizeof(double)*count); - size = count; - err=grib_unpack_double(a,values,&size); - val0 = values[0]; - for (i=0;i 1) { + size_t i = 0; + double val0 = 0; + int is_constant = 1; + double* values = (double*)grib_context_malloc_clear(c, sizeof(double) * count); + size = count; + err = grib_unpack_double(a, values, &size); + val0 = values[0]; + for (i = 0; i < size; i++) { + if (val0 != values[i]) { + is_constant = 0; + break; + } } if (is_constant) { *result = val0; grib_context_free(c, values); - } else { + } + else { return GRIB_ARRAY_TOO_SMALL; } - } else { - err = grib_unpack_double(a,result,&size); } - } else { - err = grib_unpack_double(a,result,&size); + else { + err = grib_unpack_double(a, result, &size); + } + } + else { + err = grib_unpack_double(a, result, &size); } return err; } -static int condition_true(grib_accessor* a,codes_condition* condition) +static int condition_true(grib_accessor* a, codes_condition* condition) { - int ret=0, err=0; - long lval=0; - double dval=0; - + int ret = 0, err = 0; + long lval = 0; + double dval = 0; + /* The condition has to be of the form: * key=value * and the value has to be a single scalar (integer or double). @@ -321,156 +343,170 @@ static int condition_true(grib_accessor* a,codes_condition* condition) */ switch (condition->rightType) { - case GRIB_TYPE_LONG: - err = get_single_long_val(a, &lval); - if (err) ret = 0; - else ret = lval==condition->rightLong ? 1 : 0; - break; - case GRIB_TYPE_DOUBLE: - err = get_single_double_val(a,&dval); - if (err) ret = 0; - else ret = dval==condition->rightDouble ? 1 : 0; - break; - default : - ret=0; - break; + case GRIB_TYPE_LONG: + err = get_single_long_val(a, &lval); + if (err) + ret = 0; + else + ret = lval == condition->rightLong ? 1 : 0; + break; + case GRIB_TYPE_DOUBLE: + err = get_single_double_val(a, &dval); + if (err) + ret = 0; + else + ret = dval == condition->rightDouble ? 1 : 0; + break; + default: + ret = 0; + break; } return ret; } -static void search_from_accessors_list(grib_accessors_list* al,grib_accessors_list* end,const char* name,grib_accessors_list* result) +static void search_from_accessors_list(grib_accessors_list* al, grib_accessors_list* end, const char* name, grib_accessors_list* result) { - char attribute_name[200]={0,}; - grib_accessor* accessor_result=0; + char attribute_name[200] = {0,}; + grib_accessor* accessor_result = 0; - char* accessor_name=grib_split_name_attribute(al->accessor->context,name,attribute_name); + char* accessor_name = grib_split_name_attribute(al->accessor->context, name, attribute_name); - while (al && al!=end && al->accessor) { - if (grib_inline_strcmp(al->accessor->name,accessor_name)==0) { + while (al && al != end && al->accessor) { + if (grib_inline_strcmp(al->accessor->name, accessor_name) == 0) { if (attribute_name[0]) { - accessor_result=grib_accessor_get_attribute(al->accessor,attribute_name); - } else { - accessor_result=al->accessor; + accessor_result = grib_accessor_get_attribute(al->accessor, attribute_name); + } + else { + accessor_result = al->accessor; } if (accessor_result) { - grib_accessors_list_push(result,accessor_result,al->rank); + grib_accessors_list_push(result, accessor_result, al->rank); } } - al=al->next; + al = al->next; } - if (al==end && al->accessor) { - if (grib_inline_strcmp(al->accessor->name,accessor_name)==0) { + if (al == end && al->accessor) { + if (grib_inline_strcmp(al->accessor->name, accessor_name) == 0) { if (attribute_name[0]) { - accessor_result=grib_accessor_get_attribute(al->accessor,attribute_name); - } else { - accessor_result=al->accessor; + accessor_result = grib_accessor_get_attribute(al->accessor, attribute_name); + } + else { + accessor_result = al->accessor; } if (accessor_result) { - grib_accessors_list_push(result,accessor_result,al->rank); + grib_accessors_list_push(result, accessor_result, al->rank); } } } - } -static void search_accessors_list_by_condition(grib_accessors_list* al,const char* name,codes_condition* condition,grib_accessors_list* result) +static void search_accessors_list_by_condition(grib_accessors_list* al, const char* name, codes_condition* condition, grib_accessors_list* result) { - grib_accessors_list* start=NULL; - grib_accessors_list* end=NULL; + grib_accessors_list* start = NULL; + grib_accessors_list* end = NULL; while (al) { - if (!grib_inline_strcmp(al->accessor->name,condition->left)) { - if (start==NULL && condition_true(al->accessor,condition)) start=al; - if (start && !condition_true(al->accessor,condition)) end=al; + if (!grib_inline_strcmp(al->accessor->name, condition->left)) { + if (start == NULL && condition_true(al->accessor, condition)) + start = al; + if (start && !condition_true(al->accessor, condition)) + end = al; } - if (start!=NULL && ( end!=NULL || al->next==NULL) ) { - if (end==NULL) end=al; - search_from_accessors_list(start,end,name,result); - al=end; - start=NULL; - end=NULL; + if (start != NULL && (end != NULL || al->next == NULL)) { + if (end == NULL) + end = al; + search_from_accessors_list(start, end, name, result); + al = end; + start = NULL; + end = NULL; } - al=al->next; + al = al->next; } } -static grib_accessors_list* search_by_condition(grib_handle* h,const char* name,codes_condition* condition) +static grib_accessors_list* search_by_condition(grib_handle* h, const char* name, codes_condition* condition) { grib_accessors_list* al; - grib_accessors_list* result=NULL; - grib_accessor* data=search_and_cache(h,"dataAccessors",0); + grib_accessors_list* result = NULL; + grib_accessor* data = search_and_cache(h, "dataAccessors", 0); if (data && condition->left) { - al=accessor_bufr_data_array_get_dataAccessors(data); - if (!al) return NULL; - result=(grib_accessors_list*)grib_context_malloc_clear(al->accessor->context,sizeof(grib_accessors_list)); - search_accessors_list_by_condition(al,name,condition,result); + al = accessor_bufr_data_array_get_dataAccessors(data); + if (!al) + return NULL; + result = (grib_accessors_list*)grib_context_malloc_clear(al->accessor->context, sizeof(grib_accessors_list)); + search_accessors_list_by_condition(al, name, condition, result); if (!result->accessor) { - grib_accessors_list_delete(h->context,result); - result=NULL; + grib_accessors_list_delete(h->context, result); + result = NULL; } } return result; } -static void grib_find_same_and_push(grib_accessors_list* al,grib_accessor* a) +static void grib_find_same_and_push(grib_accessors_list* al, grib_accessor* a) { if (a) { - grib_find_same_and_push(al,a->same); - grib_accessors_list_push(al,a,al->rank); + grib_find_same_and_push(al, a->same); + grib_accessors_list_push(al, a, al->rank); } } -grib_accessors_list* grib_find_accessors_list(const grib_handle* ch,const char* name) +grib_accessors_list* grib_find_accessors_list(const grib_handle* ch, const char* name) { - char* str=NULL; - grib_accessors_list* al=NULL; - codes_condition* condition=NULL; - grib_accessor* a=NULL; - grib_handle* h = (grib_handle*)ch; - - if (name[0]=='/') { - condition=(codes_condition*)grib_context_malloc_clear(h->context,sizeof(codes_condition)); - str=get_condition(name,condition); + char* str = NULL; + grib_accessors_list* al = NULL; + codes_condition* condition = NULL; + grib_accessor* a = NULL; + grib_handle* h = (grib_handle*)ch; + + if (name[0] == '/') { + condition = (codes_condition*)grib_context_malloc_clear(h->context, sizeof(codes_condition)); + str = get_condition(name, condition); if (str) { - al=search_by_condition(h,str,condition); - grib_context_free(h->context,str); - if (condition->left) grib_context_free(h->context,condition->left); - if (condition->rightString) grib_context_free(h->context,condition->rightString); + al = search_by_condition(h, str, condition); + grib_context_free(h->context, str); + if (condition->left) + grib_context_free(h->context, condition->left); + if (condition->rightString) + grib_context_free(h->context, condition->rightString); } - grib_context_free(h->context,condition); - } else if (name[0]=='#') { - a=grib_find_accessor(h, name); + grib_context_free(h->context, condition); + } + else if (name[0] == '#') { + a = grib_find_accessor(h, name); if (a) { char* str2; int r; - al=(grib_accessors_list*)grib_context_malloc_clear(h->context,sizeof(grib_accessors_list)); - str2=get_rank(h->context, name, &r); - grib_accessors_list_push(al,a,r); - grib_context_free(h->context,str2); + al = (grib_accessors_list*)grib_context_malloc_clear(h->context, sizeof(grib_accessors_list)); + str2 = get_rank(h->context, name, &r); + grib_accessors_list_push(al, a, r); + grib_context_free(h->context, str2); } - } else { - a=grib_find_accessor(h, name); + } + else { + a = grib_find_accessor(h, name); if (a) { - al=(grib_accessors_list*)grib_context_malloc_clear(h->context,sizeof(grib_accessors_list)); - grib_find_same_and_push(al,a); + al = (grib_accessors_list*)grib_context_malloc_clear(h->context, sizeof(grib_accessors_list)); + grib_find_same_and_push(al, a); } } return al; } -static grib_accessor* search_and_cache(grib_handle* h, const char* name,const char *the_namespace) +static grib_accessor* search_and_cache(grib_handle* h, const char* name, const char* the_namespace) { - grib_accessor* a=NULL; + grib_accessor* a = NULL; - if (name[0]=='#') { - int rank=-1; - char* basename=get_rank(h->context, name, &rank); - a=search_by_rank(h,basename,rank,the_namespace); - grib_context_free(h->context,basename); - } else { - a=_search_and_cache(h,name,the_namespace); + if (name[0] == '#') { + int rank = -1; + char* basename = get_rank(h->context, name, &rank); + a = search_by_rank(h, basename, rank, the_namespace); + grib_context_free(h->context, basename); + } + else { + a = _search_and_cache(h, name, the_namespace); } return a; @@ -478,50 +514,52 @@ static grib_accessor* search_and_cache(grib_handle* h, const char* name,const ch static grib_accessor* _grib_find_accessor(const grib_handle* ch, const char* name) { - grib_handle* h = (grib_handle*)ch; + grib_handle* h = (grib_handle*)ch; grib_accessor* a = NULL; - char* p = NULL; + char* p = NULL; DebugAssert(name); p = strchr((char*)name, '.'); - if ( p ) { - int i=0,len=0; + if (p) { + int i = 0, len = 0; char name_space[MAX_NAMESPACE_LEN]; - char* basename=p+1; + char* basename = p + 1; p--; - i=0; - len=p-name+1; + i = 0; + len = p - name + 1; - for ( i=0;imain) - a = grib_find_accessor(h->main,name); + if (a == NULL && h->main) + a = grib_find_accessor(h->main, name); return a; } -char* grib_split_name_attribute(grib_context* c,const char* name,char* attribute_name) +char* grib_split_name_attribute(grib_context* c, const char* name, char* attribute_name) { /*returns accessor name and attribute*/ - size_t size=0; - char* accessor_name=NULL; - char* p = strstr((char*)name, "->"); + size_t size = 0; + char* accessor_name = NULL; + char* p = strstr((char*)name, "->"); if (!p) { - *attribute_name=0; + *attribute_name = 0; return (char*)name; } - size=p-name; - accessor_name=(char*)grib_context_malloc_clear(c,size+1); - accessor_name=(char*)memcpy(accessor_name,name,size); - p+=2; - strcpy(attribute_name,p); + size = p - name; + accessor_name = (char*)grib_context_malloc_clear(c, size + 1); + accessor_name = (char*)memcpy(accessor_name, name, size); + p += 2; + strcpy(attribute_name, p); return accessor_name; } @@ -533,35 +571,36 @@ grib_accessor* grib_find_accessor(const grib_handle* h, const char* name) aret = _grib_find_accessor(h, name); /* ECC-144: Performance */ } else { - char attribute_name[512]={0,}; - grib_accessor* a=NULL; + char attribute_name[512] = {0,}; + grib_accessor* a = NULL; - char* accessor_name=grib_split_name_attribute(h->context,name,attribute_name); + char* accessor_name = grib_split_name_attribute(h->context, name, attribute_name); - a=_grib_find_accessor(h,accessor_name); + a = _grib_find_accessor(h, accessor_name); - if (*attribute_name==0) { - aret=a; - } else if (a) { - aret=grib_accessor_get_attribute(a,attribute_name); - grib_context_free(h->context,accessor_name); + if (*attribute_name == 0) { + aret = a; + } + else if (a) { + aret = grib_accessor_get_attribute(a, attribute_name); + grib_context_free(h->context, accessor_name); } } return aret; } -grib_accessor* grib_find_attribute(grib_handle* h, const char* name,const char* attr_name, int* err) +grib_accessor* grib_find_attribute(grib_handle* h, const char* name, const char* attr_name, int* err) { - grib_accessor* a = NULL; + grib_accessor* a = NULL; grib_accessor* act = NULL; - if ((a = grib_find_accessor(h, name))==NULL) { - *err=GRIB_NOT_FOUND; + if ((a = grib_find_accessor(h, name)) == NULL) { + *err = GRIB_NOT_FOUND; return NULL; } - if((act=grib_accessor_get_attribute(a,attr_name))==NULL) { - *err=GRIB_ATTRIBUTE_NOT_FOUND; + if ((act = grib_accessor_get_attribute(a, attr_name)) == NULL) { + *err = GRIB_ATTRIBUTE_NOT_FOUND; return NULL; } return act; @@ -571,31 +610,32 @@ grib_accessor* grib_find_attribute(grib_handle* h, const char* name,const char* grib_accessor* grib_find_accessor_fast(grib_handle* h, const char* name) { grib_accessor* a = NULL; - char* p = NULL; + char* p = NULL; DebugAssert(name); p = strchr((char*)name, '.'); - if ( p ) { - int i=0,len=0; + if (p) { + int i = 0, len = 0; char name_space[MAX_NAMESPACE_LEN]; p--; - i=0; - len=p-name+1; + i = 0; + len = p - name + 1; - for ( i=0;iaccessors[grib_hash_keys_get_id(h->context->keys,name)]; - if(a && !matching(a,name,name_space)) + a = h->accessors[grib_hash_keys_get_id(h->context->keys, name)]; + if (a && !matching(a, name, name_space)) a = NULL; - - } else { - a = h->accessors[grib_hash_keys_get_id(h->context->keys,name)]; + } + else { + a = h->accessors[grib_hash_keys_get_id(h->context->keys, name)]; } - if(a == NULL && h->main) - a = grib_find_accessor_fast(h->main,name); + if (a == NULL && h->main) + a = grib_find_accessor_fast(h->main, name); return a; } diff --git a/src/grib_rules.c b/src/grib_rules.c index f426566a8..78c5c3d56 100644 --- a/src/grib_rules.c +++ b/src/grib_rules.c @@ -10,12 +10,12 @@ #include "grib_api_internal.h" -grib_rule_entry *grib_new_rule_entry(grib_context* c,const char* name,grib_expression* expression) +grib_rule_entry* grib_new_rule_entry(grib_context* c, const char* name, grib_expression* expression) { - grib_rule_entry* e = (grib_rule_entry*)grib_context_malloc_clear_persistent(c,sizeof(grib_rule_entry)); - e->name = grib_context_strdup_persistent(c,name); - e->value = expression; - return e; + grib_rule_entry* e = (grib_rule_entry*)grib_context_malloc_clear_persistent(c, sizeof(grib_rule_entry)); + e->name = grib_context_strdup_persistent(c, name); + e->value = expression; + return e; } #if 0 @@ -32,10 +32,10 @@ static void grib_rule_entry_delete(grib_context* c,grib_rule_entry* e) } #endif -grib_rule* grib_new_rule(grib_context* c,grib_expression* condition,grib_rule_entry* entries) +grib_rule* grib_new_rule(grib_context* c, grib_expression* condition, grib_rule_entry* entries) { - grib_rule* r = (grib_rule*)grib_context_malloc_clear_persistent(c,sizeof(grib_rule)); - r->condition = condition; - r->entries = entries; - return r; + grib_rule* r = (grib_rule*)grib_context_malloc_clear_persistent(c, sizeof(grib_rule)); + r->condition = condition; + r->entries = entries; + return r; } diff --git a/src/grib_sarray.c b/src/grib_sarray.c index d343fa954..0de574c6e 100644 --- a/src/grib_sarray.c +++ b/src/grib_sarray.c @@ -16,84 +16,99 @@ #include "grib_api_internal.h" -grib_sarray* grib_sarray_new(grib_context* c,size_t size,size_t incsize) +grib_sarray* grib_sarray_new(grib_context* c, size_t size, size_t incsize) { - grib_sarray* v=NULL; - if (!c) c=grib_context_get_default(); - v=(grib_sarray*)grib_context_malloc_clear(c,sizeof(grib_sarray)); + grib_sarray* v = NULL; + if (!c) + c = grib_context_get_default(); + v = (grib_sarray*)grib_context_malloc_clear(c, sizeof(grib_sarray)); if (!v) { - grib_context_log(c,GRIB_LOG_ERROR, - "grib_sarray_new unable to allocate %d bytes\n",sizeof(grib_sarray)); + grib_context_log(c, GRIB_LOG_ERROR, + "grib_sarray_new unable to allocate %d bytes\n", sizeof(grib_sarray)); return NULL; } - v->size=size; - v->n=0; - v->incsize=incsize; - v->v=(char**)grib_context_malloc_clear(c,sizeof(char*)*size); + v->size = size; + v->n = 0; + v->incsize = incsize; + v->v = (char**)grib_context_malloc_clear(c, sizeof(char*) * size); if (!v->v) { - grib_context_log(c,GRIB_LOG_ERROR, - "grib_sarray_new unable to allocate %d bytes\n",sizeof(char*)*size); + grib_context_log(c, GRIB_LOG_ERROR, + "grib_sarray_new unable to allocate %d bytes\n", sizeof(char*) * size); return NULL; } return v; } -grib_sarray* grib_sarray_resize(grib_context* c,grib_sarray* v) +grib_sarray* grib_sarray_resize(grib_context* c, grib_sarray* v) { - int newsize=v->incsize+v->size; + int newsize = v->incsize + v->size; - if (!c) c=grib_context_get_default(); + if (!c) + c = grib_context_get_default(); - v->v=(char**)grib_context_realloc(c,v->v,newsize*sizeof(char*)); - v->size=newsize; + v->v = (char**)grib_context_realloc(c, v->v, newsize * sizeof(char*)); + v->size = newsize; if (!v->v) { - grib_context_log(c,GRIB_LOG_ERROR, - "grib_sarray_resize unable to allocate %d bytes\n",sizeof(char*)*newsize); + grib_context_log(c, GRIB_LOG_ERROR, + "grib_sarray_resize unable to allocate %d bytes\n", sizeof(char*) * newsize); return NULL; } return v; } -grib_sarray* grib_sarray_push(grib_context* c,grib_sarray* v,char* val) +grib_sarray* grib_sarray_push(grib_context* c, grib_sarray* v, char* val) { - size_t start_size=100; - size_t start_incsize=100; - if (!v) v=grib_sarray_new(c,start_size,start_incsize); + size_t start_size = 100; + size_t start_incsize = 100; + if (!v) + v = grib_sarray_new(c, start_size, start_incsize); - if (v->n >= v->size) v=grib_sarray_resize(c,v); - v->v[v->n]=val; + if (v->n >= v->size) + v = grib_sarray_resize(c, v); + v->v[v->n] = val; v->n++; return v; } -void grib_sarray_delete(grib_context* c,grib_sarray* v) +void grib_sarray_delete(grib_context* c, grib_sarray* v) { - if (!v) return; - if (!c) grib_context_get_default(); - if (v->v) grib_context_free(c,v->v); - grib_context_free(c,v); + if (!v) + return; + if (!c) + grib_context_get_default(); + if (v->v) + grib_context_free(c, v->v); + grib_context_free(c, v); } -void grib_sarray_delete_content(grib_context* c,grib_sarray* v) +void grib_sarray_delete_content(grib_context* c, grib_sarray* v) { int i; - if (!v || !v->v) return; - if (!c) grib_context_get_default(); - for (i=0;in;i++) { - if (v->v[i]) grib_context_free(c,v->v[i]); - v->v[i]=0; + if (!v || !v->v) + return; + if (!c) + grib_context_get_default(); + for (i = 0; i < v->n; i++) { + if (v->v[i]) + grib_context_free(c, v->v[i]); + v->v[i] = 0; } - v->n=0; + v->n = 0; } -char** grib_sarray_get_array(grib_context* c,grib_sarray* v) +char** grib_sarray_get_array(grib_context* c, grib_sarray* v) { char** ret; int i; - if (!v) return NULL; - ret=(char**)grib_context_malloc_clear(c,sizeof(char*)*v->n); - for (i=0;in;i++) ret[i]=v->v[i]; + if (!v) + return NULL; + ret = (char**)grib_context_malloc_clear(c, sizeof(char*) * v->n); + for (i = 0; i < v->n; i++) + ret[i] = v->v[i]; return ret; } -size_t grib_sarray_used_size(grib_sarray* v) { return v->n;} +size_t grib_sarray_used_size(grib_sarray* v) +{ + return v->n; +} diff --git a/src/grib_scaling.c b/src/grib_scaling.c index a6f898074..13bfa4725 100644 --- a/src/grib_scaling.c +++ b/src/grib_scaling.c @@ -15,77 +15,77 @@ #include "grib_api_internal.h" /* Return n to the power of s */ -double grib_power(long s,long n) +double grib_power(long s, long n) { double divisor = 1.0; - if (s==0) return 1.0; - if (s==1) return n; - while(s < 0) - { + if (s == 0) + return 1.0; + if (s == 1) + return n; + while (s < 0) { divisor /= n; s++; } - while(s > 0) - { + while (s > 0) { divisor *= n; s--; } return divisor; } -long grib_get_binary_scale_fact(double max, double min, long bpval,int *ret) +long grib_get_binary_scale_fact(double max, double min, long bpval, int* ret) { - double range = max - min; - double zs = 1; - long scale = 0; - const long last = 127; /* Depends on edition, should be parameter */ + double range = max - min; + double zs = 1; + long scale = 0; + const long last = 127; /* Depends on edition, should be parameter */ unsigned long maxint = 0; /* See ECC-246 unsigned long maxint = grib_power(bpval,2) - 1; double dmaxint=(double)maxint; */ - const double dmaxint = grib_power(bpval,2) - 1; + const double dmaxint = grib_power(bpval, 2) - 1; if (dmaxint >= ULONG_MAX) { *ret = GRIB_OUT_OF_RANGE; /*overflow*/ return 0; } maxint = (unsigned long)dmaxint; /* Now it's safe to cast */ - *ret=0; + *ret = 0; if (bpval < 1) { *ret = GRIB_ENCODING_ERROR; /* constant field */ return 0; } - Assert (bpval >= 1); + Assert(bpval >= 1); /* printf("---- Maxint %ld range=%g\n",maxint,range); */ - if(range == 0) + if (range == 0) return 0; /* range -= 1e-10; */ - while( (range * zs) <= dmaxint) { + while ((range * zs) <= dmaxint) { scale--; zs *= 2; } - while( (range * zs ) > dmaxint) { + while ((range * zs) > dmaxint) { scale++; zs /= 2; } - while( (unsigned long)(range * zs + 0.5) <= maxint) { + while ((unsigned long)(range * zs + 0.5) <= maxint) { scale--; zs *= 2; } - while( (unsigned long)(range * zs + 0.5) > maxint) { + while ((unsigned long)(range * zs + 0.5) > maxint) { scale++; zs /= 2; } if (scale < -last) { - *ret=GRIB_UNDERFLOW; + *ret = GRIB_UNDERFLOW; /*printf("grib_get_binary_scale_fact: max=%g min=%g\n",max,min);*/ scale = -last; } @@ -95,31 +95,38 @@ long grib_get_binary_scale_fact(double max, double min, long bpval,int *ret) long grib_get_bits_per_value(double max, double min, long binary_scale_factor) { - double range = max - min; - double zs = 1; - long scale = 0; + double range = max - min; + double zs = 1; + long scale = 0; const long last = 127; /* Depends on edition, should be parameter */ - unsigned long maxint = grib_power(binary_scale_factor,2) - 1; - double dmaxint=(double)maxint; + unsigned long maxint = grib_power(binary_scale_factor, 2) - 1; + double dmaxint = (double)maxint; - if (maxint==0) maxint=1; + if (maxint == 0) + maxint = 1; /* printf("---- Maxint %ld range=%g\n",maxint,range); */ - if(range == 0) + if (range == 0) return 0; /* range -= 1e-10; */ - while( (range * zs) <= dmaxint) { scale--;zs *= 2;} + while ((range * zs) <= dmaxint) { + scale--; + zs *= 2; + } - while( (range * zs ) > dmaxint) {scale++;zs /= 2;} + while ((range * zs) > dmaxint) { + scale++; + zs /= 2; + } - while( (unsigned long)(range * zs + 0.5) <= maxint) { + while ((unsigned long)(range * zs + 0.5) <= maxint) { scale--; zs *= 2; } - while( (unsigned long)(range * zs + 0.5) > maxint) { + while ((unsigned long)(range * zs + 0.5) > maxint) { scale++; zs /= 2; } @@ -130,36 +137,36 @@ long grib_get_bits_per_value(double max, double min, long binary_scale_factor) return scale; } -long grib_get_decimal_scale_fact(double max, double min, long bpval,long binary_scale) +long grib_get_decimal_scale_fact(double max, double min, long bpval, long binary_scale) { - double range = max - min; - double zs = 1; - long scale = 0; + double range = max - min; + double zs = 1; + long scale = 0; const long last = 127; /* Depends on edition, should be parameter */ - unsigned long maxint = grib_power(bpval,2) - 1; - double dmaxint=(double)maxint; + unsigned long maxint = grib_power(bpval, 2) - 1; + double dmaxint = (double)maxint; - range*=grib_power(-binary_scale,2); + range *= grib_power(-binary_scale, 2); - Assert (bpval >= 1); - if(range == 0) + Assert(bpval >= 1); + if (range == 0) return 0; - while( (range * zs ) > dmaxint) { + while ((range * zs) > dmaxint) { scale--; zs /= 10; } - while( (range * zs) <= dmaxint) { + while ((range * zs) <= dmaxint) { scale++; zs *= 10; } - while( (unsigned long)(range * zs + 0.5) > maxint) { + while ((unsigned long)(range * zs + 0.5) > maxint) { scale--; zs /= 10; } - while( (unsigned long)(range * zs + 0.5) <= maxint) { + while ((unsigned long)(range * zs + 0.5) <= maxint) { scale++; zs *= 10; } diff --git a/src/grib_templates.c b/src/grib_templates.c index b50c1b090..fddb988ff 100644 --- a/src/grib_templates.c +++ b/src/grib_templates.c @@ -11,7 +11,7 @@ #include "grib_api_internal.h" #if HAVE_UNISTD_H -# include +#include #endif #if 0 @@ -28,7 +28,7 @@ typedef struct grib_templates { #include "grib_templates.h" -#define NUMBER(x) (sizeof(x)/sizeof(x[0])) +#define NUMBER(x) (sizeof(x) / sizeof(x[0])) grib_handle* grib_internal_sample(grib_context* c,const char* name) { @@ -42,29 +42,27 @@ grib_handle* grib_internal_sample(grib_context* c,const char* name) } #endif -static grib_handle* try_template(grib_context* c,const char* dir,const char* name) +static grib_handle* try_template(grib_context* c, const char* dir, const char* name) { char path[1024]; - grib_handle *g = NULL; - int err = 0; + grib_handle* g = NULL; + int err = 0; - sprintf(path,"%s/%s.tmpl",dir,name); + sprintf(path, "%s/%s.tmpl", dir, name); - if (c->debug==-1) { + if (c->debug == -1) { fprintf(stderr, "ECCODES DEBUG: try_template path='%s'\n", path); } - if(codes_access(path,F_OK) == 0) - { - FILE* f = codes_fopen(path,"r"); - if(!f) - { - grib_context_log(c,GRIB_LOG_PERROR,"cannot open %s",path); + if (codes_access(path, F_OK) == 0) { + FILE* f = codes_fopen(path, "r"); + if (!f) { + grib_context_log(c, GRIB_LOG_PERROR, "cannot open %s", path); return NULL; } - g = grib_handle_new_from_file(c,f,&err); + g = grib_handle_new_from_file(c, f, &err); if (!g) { - grib_context_log(c,GRIB_LOG_ERROR,"cannot create GRIB handle from %s",path); + grib_context_log(c, GRIB_LOG_ERROR, "cannot create GRIB handle from %s", path); } fclose(f); } @@ -72,29 +70,27 @@ static grib_handle* try_template(grib_context* c,const char* dir,const char* nam return g; } -static grib_handle* try_bufr_template(grib_context* c,const char* dir,const char* name) +static grib_handle* try_bufr_template(grib_context* c, const char* dir, const char* name) { char path[1024]; - grib_handle *g = NULL; - int err = 0; + grib_handle* g = NULL; + int err = 0; - sprintf(path,"%s/%s.tmpl",dir,name); + sprintf(path, "%s/%s.tmpl", dir, name); - if (c->debug==-1) { + if (c->debug == -1) { fprintf(stderr, "ECCODES DEBUG: try_template path='%s'\n", path); } - if(codes_access(path,F_OK) == 0) - { - FILE* f = codes_fopen(path,"r"); - if(!f) - { - grib_context_log(c,GRIB_LOG_PERROR,"cannot open %s",path); + if (codes_access(path, F_OK) == 0) { + FILE* f = codes_fopen(path, "r"); + if (!f) { + grib_context_log(c, GRIB_LOG_PERROR, "cannot open %s", path); return NULL; } - g = codes_bufr_handle_new_from_file(c,f,&err); + g = codes_bufr_handle_new_from_file(c, f, &err); if (!g) { - grib_context_log(c,GRIB_LOG_ERROR,"cannot create BUFR handle from %s",path); + grib_context_log(c, GRIB_LOG_ERROR, "cannot create BUFR handle from %s", path); } fclose(f); } @@ -102,62 +98,61 @@ static grib_handle* try_bufr_template(grib_context* c,const char* dir,const char return g; } -static char* try_template_path(grib_context* c,const char* dir,const char* name) +static char* try_template_path(grib_context* c, const char* dir, const char* name) { char path[1024]; - sprintf(path,"%s/%s.tmpl",dir,name); + sprintf(path, "%s/%s.tmpl", dir, name); - if(codes_access(path,R_OK) == 0) - { - return grib_context_strdup(c,path); + if (codes_access(path, R_OK) == 0) { + return grib_context_strdup(c, path); } return NULL; } -grib_handle* grib_external_template(grib_context* c,const char* name) +grib_handle* grib_external_template(grib_context* c, const char* name) { - const char *base = c->grib_samples_path; + const char* base = c->grib_samples_path; char buffer[1024]; - char *p = buffer; - grib_handle *g = NULL; + char* p = buffer; + grib_handle* g = NULL; - if(!base) return NULL; + if (!base) + return NULL; - while(*base) - { - if(*base == ':') - { + while (*base) { + if (*base == ':') { *p = 0; - g = try_template(c,buffer,name); - if(g) return g; + g = try_template(c, buffer, name); + if (g) + return g; p = buffer; base++; /*advance past delimiter*/ } *p++ = *base++; } - *p = 0; - return g = try_template(c,buffer,name); + *p = 0; + return g = try_template(c, buffer, name); } -grib_handle* bufr_external_template(grib_context* c,const char* name) +grib_handle* bufr_external_template(grib_context* c, const char* name) { - const char *base = c->grib_samples_path; + const char* base = c->grib_samples_path; char buffer[1024]; - char *p = buffer; - grib_handle *g = NULL; + char* p = buffer; + grib_handle* g = NULL; - if(!base) return NULL; + if (!base) + return NULL; - while(*base) - { - if(*base == ':') - { + while (*base) { + if (*base == ':') { *p = 0; - g = try_bufr_template(c,buffer,name); - if(g) return g; + g = try_bufr_template(c, buffer, name); + if (g) + return g; p = buffer; base++; /*advance past delimiter*/ } @@ -165,32 +160,32 @@ grib_handle* bufr_external_template(grib_context* c,const char* name) } *p = 0; - g = try_bufr_template(c,buffer,name); + g = try_bufr_template(c, buffer, name); return g; } -char* grib_external_template_path(grib_context* c,const char* name) +char* grib_external_template_path(grib_context* c, const char* name) { - const char *base = c->grib_samples_path; + const char* base = c->grib_samples_path; char buffer[1024]; - char *p = buffer; - char *g = NULL; + char* p = buffer; + char* g = NULL; - if(!base) return NULL; + if (!base) + return NULL; - while(*base) - { - if(*base == ':') - { + while (*base) { + if (*base == ':') { *p = 0; - g = try_template_path(c,buffer,name); - if(g) return g; + g = try_template_path(c, buffer, name); + if (g) + return g; p = buffer; base++; } *p++ = *base++; } - *p = 0; - return g = try_template_path(c,buffer,name); + *p = 0; + return g = try_template_path(c, buffer, name); } diff --git a/src/grib_timer.c b/src/grib_timer.c index 42ea49fa8..f3ed813ee 100644 --- a/src/grib_timer.c +++ b/src/grib_timer.c @@ -13,31 +13,30 @@ #if GRIB_TIMER #ifndef ECCODES_ON_WINDOWS -# include -# include -# include +#include +#include +#include #endif -static grib_timer *timers = NULL; -int value_false=0; -int value_true=1; +static grib_timer* timers = NULL; +int value_false = 0; +int value_true = 1; #define long64 long -#define ROUND(a) ((long)((a)+0.5)) +#define ROUND(a) ((long)((a) + 0.5)) double proc_cpu() { struct rusage rup; - if(getrusage(RUSAGE_SELF,&rup) != -1) - { + if (getrusage(RUSAGE_SELF, &rup) != -1) { return (rup.ru_utime.tv_sec + rup.ru_utime.tv_usec / 1000000.0 + rup.ru_stime.tv_sec + rup.ru_stime.tv_usec / 1000000.0); } - return clock()/(double)CLOCKS_PER_SEC; + return clock() / (double)CLOCKS_PER_SEC; } -static char *timetext(char *pfx,double ds,char *text) +static char* timetext(char* pfx, double ds, char* text) { long s = ROUND(ds); long x = s; @@ -48,69 +47,70 @@ static char *timetext(char *pfx,double ds,char *text) char day[20]; *text = *sec = *min = *hou = *day = 0; - if(s) - { - - if((n = x % 60) != 0) sprintf(sec,"%ld sec ",n); + if (s) { + if ((n = x % 60) != 0) + sprintf(sec, "%ld sec ", n); x /= 60; - if((n = x % 60) != 0) sprintf(min,"%ld min ",n); + if ((n = x % 60) != 0) + sprintf(min, "%ld min ", n); x /= 60; - if((n = x % 24) != 0) sprintf(hou,"%ld hour ",n); + if ((n = x % 24) != 0) + sprintf(hou, "%ld hour ", n); x /= 24; - if((n = x) != 0) sprintf(day,"%ld day ",n); + if ((n = x) != 0) + sprintf(day, "%ld day ", n); - sprintf(text,"%s%s%s%s%s",pfx,day,hou,min,sec); + sprintf(text, "%s%s%s%s%s", pfx, day, hou, min, sec); } return text; - } -char *timename(double t) +char* timename(double t) { static char buf[80]; - return timetext("",t,buf); + return timetext("", t, buf); } -grib_timer *grib_get_timer(grib_context* c,const char* name, const char *statname, int elapsed) +grib_timer* grib_get_timer(grib_context* c, const char* name, const char* statname, int elapsed) { - grib_timer *t = timers; - if (!c) c=grib_context_get_default( ); + grib_timer* t = timers; + if (!c) + c = grib_context_get_default(); - while(t) - { - if(strcmp(name,t->name_) == 0) + while (t) { + if (strcmp(name, t->name_) == 0) return t; t = t->next_; } - t = (grib_timer*)grib_context_malloc_clear(c,sizeof(grib_timer)); - t->name_ = (char*) name; - t->context =c; - t->active_ = value_false; - t->count_ = 0; - t->timer_ = 0; - t->total_ = 0; + t = (grib_timer*)grib_context_malloc_clear(c, sizeof(grib_timer)); + t->name_ = (char*)name; + t->context = c; + t->active_ = value_false; + t->count_ = 0; + t->timer_ = 0; + t->total_ = 0; - t->elapsed_ = elapsed; /* Whether to print CPU usage */ - t->cpu_ = 0; - t->total_cpu_ = 0; + t->elapsed_ = elapsed; /* Whether to print CPU usage */ + t->cpu_ = 0; + t->total_cpu_ = 0; t->statname_ = 0; - if(statname) + if (statname) t->statname_ = (char*)statname; - t->next_ = timers; - timers = t; + t->next_ = timers; + timers = t; return t; } int grib_timer_start(grib_timer* t) { - int e = gettimeofday(&t->start_,NULL); - if(e != 0) - grib_context_log(t->context,GRIB_LOG_WARNING|GRIB_LOG_PERROR,"Error starting timer '%s'",t->name_?t->name_:"unnamed"); + int e = gettimeofday(&t->start_, NULL); + if (e != 0) + grib_context_log(t->context, GRIB_LOG_WARNING | GRIB_LOG_PERROR, "Error starting timer '%s'", t->name_ ? t->name_ : "unnamed"); t->active_ = value_true; t->cpu_ = proc_cpu(); return e; @@ -118,24 +118,21 @@ int grib_timer_start(grib_timer* t) int grib_timer_stop(grib_timer* t, long total) { - struct timeval stop, diff; - int e = gettimeofday(&stop,NULL); + int e = gettimeofday(&stop, NULL); double c = proc_cpu(); - if(e != 0) - grib_context_log(t->context,GRIB_LOG_WARNING|GRIB_LOG_PERROR,"Error stopping timer '%s'",t->name_?t->name_:"unnamed"); + if (e != 0) + grib_context_log(t->context, GRIB_LOG_WARNING | GRIB_LOG_PERROR, "Error stopping timer '%s'", t->name_ ? t->name_ : "unnamed"); - if(!t->active_) - { - grib_context_log(t->context,GRIB_LOG_WARNING,"Stopping non-started timer '%s'",t->name_?t->name_:"unnamed"); + if (!t->active_) { + grib_context_log(t->context, GRIB_LOG_WARNING, "Stopping non-started timer '%s'", t->name_ ? t->name_ : "unnamed"); return 1; } - diff.tv_sec = stop.tv_sec - t->start_.tv_sec; + diff.tv_sec = stop.tv_sec - t->start_.tv_sec; diff.tv_usec = stop.tv_usec - t->start_.tv_usec; - if (diff.tv_usec < 0) - { + if (diff.tv_usec < 0) { diff.tv_sec--; diff.tv_usec += 1000000; } @@ -144,55 +141,54 @@ int grib_timer_stop(grib_timer* t, long total) t->total_ += total; t->total_cpu_ += (c - t->cpu_); - t->active_=value_false; + t->active_ = value_false; t->count_++; return e; } -double grib_timer_value(grib_timer *t) +double grib_timer_value(grib_timer* t) { return t->timer_; } -const char *bytename(double bytes) +const char* bytename(double bytes) { - static char *names[] = { - "","K","M","G","T" }; + static char* names[] = { + "", "K", "M", "G", "T" + }; double x = bytes; - int n = 0; + int n = 0; static char buf[20]; - while(x>=1024.0) - { + while (x >= 1024.0) { x /= 1024.0; n++; } - sprintf(buf,"%.2f %s",x,names[n]); + sprintf(buf, "%.2f %s", x, names[n]); return buf; } void grib_timer_print(grib_timer* t) { - char cpu[1024] = ""; - const char *name = t->name_ ? t->name_ : ""; - if(t->timer_>=1) { - if(! t->elapsed_ && t->total_cpu_ >= 1.0) - sprintf(cpu,"cpu: %s",timename(t->total_cpu_)); - - if(t->total_ != 0) - { - double rate = (double)t->total_/t->timer_; + char cpu[1024] = ""; + const char* name = t->name_ ? t->name_ : ""; + if (t->timer_ >= 1) { + if (!t->elapsed_ && t->total_cpu_ >= 1.0) + sprintf(cpu, "cpu: %s", timename(t->total_cpu_)); + + if (t->total_ != 0) { + double rate = (double)t->total_ / t->timer_; char bytes[80]; - sprintf(bytes,"%sbyte(s)",bytename(t->total_)); - grib_context_print(t->context,stdout," %s: %s in %s [%sbyte/sec] %s\n", - name,bytes,timename(t->timer_),bytename(rate),cpu); + sprintf(bytes, "%sbyte(s)", bytename(t->total_)); + grib_context_print(t->context, stdout, " %s: %s in %s [%sbyte/sec] %s\n", + name, bytes, timename(t->timer_), bytename(rate), cpu); } else { - char* ctimename=timename(t->timer_); - grib_context_print(t->context,stdout," %s: wall: %s%s\n",name,ctimename,cpu); + char* ctimename = timename(t->timer_); + grib_context_print(t->context, stdout, " %s: wall: %s%s\n", name, ctimename, cpu); } /* if(t->statname_) @@ -201,26 +197,24 @@ void grib_timer_print(grib_timer* t) } } -void grib_timer_partial_rate(grib_timer *t, double start, long total) +void grib_timer_partial_rate(grib_timer* t, double start, long total) { - double ptime = t->timer_ - start; - long ptotal = total; - const char *name = t->name_?t->name_:""; - if(ptime>=1) - { - double rate = (double)ptotal/ptime; + double ptime = t->timer_ - start; + long ptotal = total; + const char* name = t->name_ ? t->name_ : ""; + if (ptime >= 1) { + double rate = (double)ptotal / ptime; char bytes[80]; - sprintf(bytes,"%sbyte(s)",bytename(ptotal)); - grib_context_log(t->context,GRIB_LOG_INFO," %s: %s in %s [%sbyte/sec]", - name,bytes,timename(ptime),bytename(rate)); + sprintf(bytes, "%sbyte(s)", bytename(ptotal)); + grib_context_log(t->context, GRIB_LOG_INFO, " %s: %s in %s [%sbyte/sec]", + name, bytes, timename(ptime), bytename(rate)); } } void grib_print_all_timers() { - grib_timer *t = timers; - while(t) - { + grib_timer* t = timers; + while (t) { grib_timer_print(t); t = t->next_; } @@ -228,15 +222,14 @@ void grib_print_all_timers() void grib_reset_all_timers() { - grib_timer *t = timers; - while(t) - { - t->count_ = 0; - t->timer_ = 0; - t->active_ = 0; - t->total_ = 0; - t->total_cpu_ = 0; - t = t->next_; + grib_timer* t = timers; + while (t) { + t->count_ = 0; + t->timer_ = 0; + t->active_ = 0; + t->total_ = 0; + t->total_cpu_ = 0; + t = t->next_; } } @@ -341,12 +334,13 @@ int timed_readany(FILE *f, char *buffer, long *length, grib_timer *t) #else -grib_timer *grib_get_timer(grib_context* c,const char* name, const char *statname, int elapsed) +grib_timer* grib_get_timer(grib_context* c, const char* name, const char* statname, int elapsed) { - if (!c) c=grib_context_get_default(); - grib_context_log(c,GRIB_LOG_FATAL,"grib_get_timer function not available"); + if (!c) + c = grib_context_get_default(); + grib_context_log(c, GRIB_LOG_FATAL, "grib_get_timer function not available"); return NULL; -} +} int grib_timer_start(grib_timer* t) { @@ -354,25 +348,35 @@ int grib_timer_start(grib_timer* t) } int grib_timer_stop(grib_timer* t, long total) -{return 0;} +{ + return 0; +} -double grib_timer_value(grib_timer *t) +double grib_timer_value(grib_timer* t) { return 0; } void grib_timer_print(grib_timer* t) -{return;} +{ + return; +} -void grib_timer_partial_rate(grib_timer *t, double start, long total) -{ return; } +void grib_timer_partial_rate(grib_timer* t, double start, long total) +{ + return; +} void grib_print_all_timers() -{return;} +{ + return; +} void grib_reset_all_timers() -{return;} +{ + return; +} #endif diff --git a/src/grib_trie.c b/src/grib_trie.c index 8d31819c1..53c6e879e 100644 --- a/src/grib_trie.c +++ b/src/grib_trie.c @@ -12,289 +12,293 @@ /* Note: all non-alpha are mapped to 0 */ static const int mapping[] = { -0, /* 00 */ -0, /* 01 */ -0, /* 02 */ -0, /* 03 */ -0, /* 04 */ -0, /* 05 */ -0, /* 06 */ -0, /* 07 */ -0, /* 08 */ -0, /* 09 */ -0, /* 0a */ -0, /* 0b */ -0, /* 0c */ -0, /* 0d */ -0, /* 0e */ -0, /* 0f */ -0, /* 10 */ -0, /* 11 */ -0, /* 12 */ -0, /* 13 */ -0, /* 14 */ -0, /* 15 */ -0, /* 16 */ -0, /* 17 */ -0, /* 18 */ -0, /* 19 */ -0, /* 1a */ -0, /* 1b */ -0, /* 1c */ -0, /* 1d */ -0, /* 1e */ -0, /* 1f */ -0, /* 20 */ -0, /* 21 */ -0, /* 22 */ -38, /* # */ -0, /* 24 */ -0, /* 25 */ -0, /* 26 */ -0, /* 27 */ -0, /* 28 */ -0, /* 29 */ -0, /* 2a */ -0, /* 2b */ -0, /* 2c */ -0, /* 2d */ -0, /* 2e */ -0, /* 2f */ -1, /* 0 */ -2, /* 1 */ -3, /* 2 */ -4, /* 3 */ -5, /* 4 */ -6, /* 5 */ -7, /* 6 */ -8, /* 7 */ -9, /* 8 */ -10, /* 9 */ -0, /* 3a */ -0, /* 3b */ -0, /* 3c */ -0, /* 3d */ -0, /* 3e */ -0, /* 3f */ -0, /* 40 */ -11, /* A */ -12, /* B */ -13, /* C */ -14, /* D */ -15, /* E */ -16, /* F */ -17, /* G */ -18, /* H */ -19, /* I */ -20, /* J */ -21, /* K */ -22, /* L */ -23, /* M */ -24, /* N */ -25, /* O */ -26, /* P */ -27, /* Q */ -28, /* R */ -29, /* S */ -30, /* T */ -31, /* U */ -32, /* V */ -33, /* W */ -34, /* X */ -35, /* Y */ -36, /* Z */ -0, /* 5b */ -0, /* 5c */ -0, /* 5d */ -0, /* 5e */ -37, /* _ */ -0, /* 60 */ -11, /* a */ -12, /* b */ -13, /* c */ -14, /* d */ -15, /* e */ -16, /* f */ -17, /* g */ -18, /* h */ -19, /* i */ -20, /* j */ -21, /* k */ -22, /* l */ -23, /* m */ -24, /* n */ -25, /* o */ -26, /* p */ -27, /* q */ -28, /* r */ -29, /* s */ -30, /* t */ -31, /* u */ -32, /* v */ -33, /* w */ -34, /* x */ -35, /* y */ -36, /* z */ -0, /* 7b */ -0, /* 7c */ -0, /* 7d */ -0, /* 7e */ -0, /* 7f */ -0, /* 80 */ -0, /* 81 */ -0, /* 82 */ -0, /* 83 */ -0, /* 84 */ -0, /* 85 */ -0, /* 86 */ -0, /* 87 */ -0, /* 88 */ -0, /* 89 */ -0, /* 8a */ -0, /* 8b */ -0, /* 8c */ -0, /* 8d */ -0, /* 8e */ -0, /* 8f */ -0, /* 90 */ -0, /* 91 */ -0, /* 92 */ -0, /* 93 */ -0, /* 94 */ -0, /* 95 */ -0, /* 96 */ -0, /* 97 */ -0, /* 98 */ -0, /* 99 */ -0, /* 9a */ -0, /* 9b */ -0, /* 9c */ -0, /* 9d */ -0, /* 9e */ -0, /* 9f */ -0, /* a0 */ -0, /* a1 */ -0, /* a2 */ -0, /* a3 */ -0, /* a4 */ -0, /* a5 */ -0, /* a6 */ -0, /* a7 */ -0, /* a8 */ -0, /* a9 */ -0, /* aa */ -0, /* ab */ -0, /* ac */ -0, /* ad */ -0, /* ae */ -0, /* af */ -0, /* b0 */ -0, /* b1 */ -0, /* b2 */ -0, /* b3 */ -0, /* b4 */ -0, /* b5 */ -0, /* b6 */ -0, /* b7 */ -0, /* b8 */ -0, /* b9 */ -0, /* ba */ -0, /* bb */ -0, /* bc */ -0, /* bd */ -0, /* be */ -0, /* bf */ -0, /* c0 */ -0, /* c1 */ -0, /* c2 */ -0, /* c3 */ -0, /* c4 */ -0, /* c5 */ -0, /* c6 */ -0, /* c7 */ -0, /* c8 */ -0, /* c9 */ -0, /* ca */ -0, /* cb */ -0, /* cc */ -0, /* cd */ -0, /* ce */ -0, /* cf */ -0, /* d0 */ -0, /* d1 */ -0, /* d2 */ -0, /* d3 */ -0, /* d4 */ -0, /* d5 */ -0, /* d6 */ -0, /* d7 */ -0, /* d8 */ -0, /* d9 */ -0, /* da */ -0, /* db */ -0, /* dc */ -0, /* dd */ -0, /* de */ -0, /* df */ -0, /* e0 */ -0, /* e1 */ -0, /* e2 */ -0, /* e3 */ -0, /* e4 */ -0, /* e5 */ -0, /* e6 */ -0, /* e7 */ -0, /* e8 */ -0, /* e9 */ -0, /* ea */ -0, /* eb */ -0, /* ec */ -0, /* ed */ -0, /* ee */ -0, /* ef */ -0, /* f0 */ -0, /* f1 */ -0, /* f2 */ -0, /* f3 */ -0, /* f4 */ -0, /* f5 */ -0, /* f6 */ -0, /* f7 */ -0, /* f8 */ -0, /* f9 */ -0, /* fa */ -0, /* fb */ -0, /* fc */ -0, /* fd */ -0, /* fe */ -0, /* ff */ + 0, /* 00 */ + 0, /* 01 */ + 0, /* 02 */ + 0, /* 03 */ + 0, /* 04 */ + 0, /* 05 */ + 0, /* 06 */ + 0, /* 07 */ + 0, /* 08 */ + 0, /* 09 */ + 0, /* 0a */ + 0, /* 0b */ + 0, /* 0c */ + 0, /* 0d */ + 0, /* 0e */ + 0, /* 0f */ + 0, /* 10 */ + 0, /* 11 */ + 0, /* 12 */ + 0, /* 13 */ + 0, /* 14 */ + 0, /* 15 */ + 0, /* 16 */ + 0, /* 17 */ + 0, /* 18 */ + 0, /* 19 */ + 0, /* 1a */ + 0, /* 1b */ + 0, /* 1c */ + 0, /* 1d */ + 0, /* 1e */ + 0, /* 1f */ + 0, /* 20 */ + 0, /* 21 */ + 0, /* 22 */ + 38, /* # */ + 0, /* 24 */ + 0, /* 25 */ + 0, /* 26 */ + 0, /* 27 */ + 0, /* 28 */ + 0, /* 29 */ + 0, /* 2a */ + 0, /* 2b */ + 0, /* 2c */ + 0, /* 2d */ + 0, /* 2e */ + 0, /* 2f */ + 1, /* 0 */ + 2, /* 1 */ + 3, /* 2 */ + 4, /* 3 */ + 5, /* 4 */ + 6, /* 5 */ + 7, /* 6 */ + 8, /* 7 */ + 9, /* 8 */ + 10, /* 9 */ + 0, /* 3a */ + 0, /* 3b */ + 0, /* 3c */ + 0, /* 3d */ + 0, /* 3e */ + 0, /* 3f */ + 0, /* 40 */ + 11, /* A */ + 12, /* B */ + 13, /* C */ + 14, /* D */ + 15, /* E */ + 16, /* F */ + 17, /* G */ + 18, /* H */ + 19, /* I */ + 20, /* J */ + 21, /* K */ + 22, /* L */ + 23, /* M */ + 24, /* N */ + 25, /* O */ + 26, /* P */ + 27, /* Q */ + 28, /* R */ + 29, /* S */ + 30, /* T */ + 31, /* U */ + 32, /* V */ + 33, /* W */ + 34, /* X */ + 35, /* Y */ + 36, /* Z */ + 0, /* 5b */ + 0, /* 5c */ + 0, /* 5d */ + 0, /* 5e */ + 37, /* _ */ + 0, /* 60 */ + 11, /* a */ + 12, /* b */ + 13, /* c */ + 14, /* d */ + 15, /* e */ + 16, /* f */ + 17, /* g */ + 18, /* h */ + 19, /* i */ + 20, /* j */ + 21, /* k */ + 22, /* l */ + 23, /* m */ + 24, /* n */ + 25, /* o */ + 26, /* p */ + 27, /* q */ + 28, /* r */ + 29, /* s */ + 30, /* t */ + 31, /* u */ + 32, /* v */ + 33, /* w */ + 34, /* x */ + 35, /* y */ + 36, /* z */ + 0, /* 7b */ + 0, /* 7c */ + 0, /* 7d */ + 0, /* 7e */ + 0, /* 7f */ + 0, /* 80 */ + 0, /* 81 */ + 0, /* 82 */ + 0, /* 83 */ + 0, /* 84 */ + 0, /* 85 */ + 0, /* 86 */ + 0, /* 87 */ + 0, /* 88 */ + 0, /* 89 */ + 0, /* 8a */ + 0, /* 8b */ + 0, /* 8c */ + 0, /* 8d */ + 0, /* 8e */ + 0, /* 8f */ + 0, /* 90 */ + 0, /* 91 */ + 0, /* 92 */ + 0, /* 93 */ + 0, /* 94 */ + 0, /* 95 */ + 0, /* 96 */ + 0, /* 97 */ + 0, /* 98 */ + 0, /* 99 */ + 0, /* 9a */ + 0, /* 9b */ + 0, /* 9c */ + 0, /* 9d */ + 0, /* 9e */ + 0, /* 9f */ + 0, /* a0 */ + 0, /* a1 */ + 0, /* a2 */ + 0, /* a3 */ + 0, /* a4 */ + 0, /* a5 */ + 0, /* a6 */ + 0, /* a7 */ + 0, /* a8 */ + 0, /* a9 */ + 0, /* aa */ + 0, /* ab */ + 0, /* ac */ + 0, /* ad */ + 0, /* ae */ + 0, /* af */ + 0, /* b0 */ + 0, /* b1 */ + 0, /* b2 */ + 0, /* b3 */ + 0, /* b4 */ + 0, /* b5 */ + 0, /* b6 */ + 0, /* b7 */ + 0, /* b8 */ + 0, /* b9 */ + 0, /* ba */ + 0, /* bb */ + 0, /* bc */ + 0, /* bd */ + 0, /* be */ + 0, /* bf */ + 0, /* c0 */ + 0, /* c1 */ + 0, /* c2 */ + 0, /* c3 */ + 0, /* c4 */ + 0, /* c5 */ + 0, /* c6 */ + 0, /* c7 */ + 0, /* c8 */ + 0, /* c9 */ + 0, /* ca */ + 0, /* cb */ + 0, /* cc */ + 0, /* cd */ + 0, /* ce */ + 0, /* cf */ + 0, /* d0 */ + 0, /* d1 */ + 0, /* d2 */ + 0, /* d3 */ + 0, /* d4 */ + 0, /* d5 */ + 0, /* d6 */ + 0, /* d7 */ + 0, /* d8 */ + 0, /* d9 */ + 0, /* da */ + 0, /* db */ + 0, /* dc */ + 0, /* dd */ + 0, /* de */ + 0, /* df */ + 0, /* e0 */ + 0, /* e1 */ + 0, /* e2 */ + 0, /* e3 */ + 0, /* e4 */ + 0, /* e5 */ + 0, /* e6 */ + 0, /* e7 */ + 0, /* e8 */ + 0, /* e9 */ + 0, /* ea */ + 0, /* eb */ + 0, /* ec */ + 0, /* ed */ + 0, /* ee */ + 0, /* ef */ + 0, /* f0 */ + 0, /* f1 */ + 0, /* f2 */ + 0, /* f3 */ + 0, /* f4 */ + 0, /* f5 */ + 0, /* f6 */ + 0, /* f7 */ + 0, /* f8 */ + 0, /* f9 */ + 0, /* fa */ + 0, /* fb */ + 0, /* fc */ + 0, /* fd */ + 0, /* fe */ + 0, /* ff */ }; /* ECC-388 */ #ifdef DEBUG - static const size_t NUM_MAPPINGS = sizeof(mapping)/sizeof(mapping[0]); +static const size_t NUM_MAPPINGS = sizeof(mapping) / sizeof(mapping[0]); - #define DebugCheckBounds(index, value) \ - do { \ - if (!((index) >= 0 && (index) < NUM_MAPPINGS) ) {printf("ERROR: string='%s' index=%ld @ %s +%d \n", value, (long)index, __FILE__, __LINE__); abort();} \ - } while(0) +#define DebugCheckBounds(index, value) \ + do { \ + if (!((index) >= 0 && (index) < NUM_MAPPINGS)) { \ + printf("ERROR: string='%s' index=%ld @ %s +%d \n", value, (long)index, __FILE__, __LINE__); \ + abort(); \ + } \ + } while (0) #else - #define DebugCheckBounds(index, value) +#define DebugCheckBounds(index, value) #endif #define SIZE 39 #if GRIB_PTHREADS -static pthread_once_t once = PTHREAD_ONCE_INIT; +static pthread_once_t once = PTHREAD_ONCE_INIT; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; -static void init() { - pthread_mutexattr_t attr; - pthread_mutexattr_init(&attr); - pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init(&mutex,&attr); - pthread_mutexattr_destroy(&attr); +static void init() +{ + pthread_mutexattr_t attr; + pthread_mutexattr_init(&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&mutex, &attr); + pthread_mutexattr_destroy(&attr); } #elif GRIB_OMP_THREADS static int once = 0; @@ -304,8 +308,7 @@ static void init() { GRIB_OMP_CRITICAL(lock_grib_trie_c) { - if (once == 0) - { + if (once == 0) { omp_init_nest_lock(&mutex); once = 1; } @@ -313,154 +316,163 @@ static void init() } #endif -struct grib_trie { +struct grib_trie +{ grib_trie* next[SIZE]; - grib_context *context; + grib_context* context; int first; int last; void* data; }; -grib_trie *grib_trie_new(grib_context* c) +grib_trie* grib_trie_new(grib_context* c) { #ifdef RECYCLE_TRIE - grib_trie* t = grib_context_malloc_clear_persistent(c,sizeof(grib_trie)); + grib_trie* t = grib_context_malloc_clear_persistent(c, sizeof(grib_trie)); #else - grib_trie* t = (grib_trie*)grib_context_malloc_clear(c,sizeof(grib_trie)); + grib_trie* t = (grib_trie*)grib_context_malloc_clear(c, sizeof(grib_trie)); #endif t->context = c; - t->first=SIZE; - t->last=-1; + t->first = SIZE; + t->last = -1; return t; } -void grib_trie_delete_container(grib_trie *t) +void grib_trie_delete_container(grib_trie* t) { - GRIB_MUTEX_INIT_ONCE(&once,&init); + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex); - if(t) { + if (t) { int i; - for(i = t->first; i <= t->last; i++) + for (i = t->first; i <= t->last; i++) if (t->next[i]) { grib_trie_delete_container(t->next[i]); } #ifdef RECYCLE_TRIE - grib_context_free_persistent(t->context,t); + grib_context_free_persistent(t->context, t); #else - grib_context_free(t->context,t); + grib_context_free(t->context, t); #endif } GRIB_MUTEX_UNLOCK(&mutex); } -void grib_trie_delete(grib_trie *t) +void grib_trie_delete(grib_trie* t) { - GRIB_MUTEX_INIT_ONCE(&once,&init); + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex); - if(t) { + if (t) { int i; - for(i = t->first; i <= t->last; i++) + for (i = t->first; i <= t->last; i++) if (t->next[i]) { - grib_context_free( t->context, t->next[i]->data ); + grib_context_free(t->context, t->next[i]->data); grib_trie_delete(t->next[i]); } #ifdef RECYCLE_TRIE - grib_context_free_persistent(t->context,t); + grib_context_free_persistent(t->context, t); #else - grib_context_free(t->context,t); + grib_context_free(t->context, t); #endif } GRIB_MUTEX_UNLOCK(&mutex); } -void grib_trie_clear(grib_trie *t) +void grib_trie_clear(grib_trie* t) { - if(t) { + if (t) { int i; - t->data=NULL; - for(i = t->first; i <= t->last; i++) + t->data = NULL; + for (i = t->first; i <= t->last; i++) if (t->next[i]) grib_trie_clear(t->next[i]); } } -void* grib_trie_insert(grib_trie* t,const char* key,void* data) +void* grib_trie_insert(grib_trie* t, const char* key, void* data) { - grib_trie *last = t; - const char *k = key; - void* old = NULL; + grib_trie* last = t; + const char* k = key; + void* old = NULL; - GRIB_MUTEX_INIT_ONCE(&once,&init); + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex); - while(*k && t) { + while (*k && t) { last = t; DebugCheckBounds((int)*k, key); t = t->next[mapping[(int)*k]]; - if(t) k++; + if (t) + k++; } - if(*k == 0) { - old = t->data; - t->data=data; - } else { + if (*k == 0) { + old = t->data; + t->data = data; + } + else { t = last; - while(*k) { + while (*k) { int j = 0; DebugCheckBounds((int)*k, key); j = mapping[(int)*k++]; - if(j < t->first) t->first = j; - if(j > t->last) t->last = j; - t = t->next[j] =grib_trie_new(t->context); + if (j < t->first) + t->first = j; + if (j > t->last) + t->last = j; + t = t->next[j] = grib_trie_new(t->context); } - old = t->data; - t->data=data; + old = t->data; + t->data = data; } GRIB_MUTEX_UNLOCK(&mutex); return data == old ? NULL : old; } -void* grib_trie_insert_no_replace(grib_trie* t,const char* key,void* data) +void* grib_trie_insert_no_replace(grib_trie* t, const char* key, void* data) { - grib_trie *last = t; - const char *k = key; + grib_trie* last = t; + const char* k = key; - while(*k && t) { + while (*k && t) { last = t; DebugCheckBounds((int)*k, key); t = t->next[mapping[(int)*k]]; - if(t) k++; + if (t) + k++; } - if(*k != 0) { + if (*k != 0) { t = last; - while(*k) { + while (*k) { int j = 0; DebugCheckBounds((int)*k, key); j = mapping[(int)*k++]; - if(j < t->first) t->first = j; - if(j > t->last) t->last = j; - t = t->next[j] =grib_trie_new(t->context); + if (j < t->first) + t->first = j; + if (j > t->last) + t->last = j; + t = t->next[j] = grib_trie_new(t->context); } } - if (!t->data) t->data=data; + if (!t->data) + t->data = data; return t->data; } -void *grib_trie_get(grib_trie* t,const char* key) +void* grib_trie_get(grib_trie* t, const char* key) { - const char *k = key; - GRIB_MUTEX_INIT_ONCE(&once,&init); + const char* k = key; + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex); - while(*k && t) { + while (*k && t) { DebugCheckBounds((int)*k, key); t = t->next[mapping[(int)*k++]]; } - if(*k == 0 && t != NULL && t->data!=NULL) { + if (*k == 0 && t != NULL && t->data != NULL) { GRIB_MUTEX_UNLOCK(&mutex); return t->data; } diff --git a/src/grib_trie_with_rank.c b/src/grib_trie_with_rank.c index 28bb1910f..d4dd278a2 100644 --- a/src/grib_trie_with_rank.c +++ b/src/grib_trie_with_rank.c @@ -12,289 +12,293 @@ /* Note: all non-alpha are mapped to 0 */ static const int mapping[] = { -0, /* 00 */ -0, /* 01 */ -0, /* 02 */ -0, /* 03 */ -0, /* 04 */ -0, /* 05 */ -0, /* 06 */ -0, /* 07 */ -0, /* 08 */ -0, /* 09 */ -0, /* 0a */ -0, /* 0b */ -0, /* 0c */ -0, /* 0d */ -0, /* 0e */ -0, /* 0f */ -0, /* 10 */ -0, /* 11 */ -0, /* 12 */ -0, /* 13 */ -0, /* 14 */ -0, /* 15 */ -0, /* 16 */ -0, /* 17 */ -0, /* 18 */ -0, /* 19 */ -0, /* 1a */ -0, /* 1b */ -0, /* 1c */ -0, /* 1d */ -0, /* 1e */ -0, /* 1f */ -0, /* 20 */ -0, /* 21 */ -0, /* 22 */ -38, /* # */ -0, /* 24 */ -0, /* 25 */ -0, /* 26 */ -0, /* 27 */ -0, /* 28 */ -0, /* 29 */ -0, /* 2a */ -0, /* 2b */ -0, /* 2c */ -0, /* 2d */ -0, /* 2e */ -0, /* 2f */ -1, /* 0 */ -2, /* 1 */ -3, /* 2 */ -4, /* 3 */ -5, /* 4 */ -6, /* 5 */ -7, /* 6 */ -8, /* 7 */ -9, /* 8 */ -10, /* 9 */ -0, /* 3a */ -0, /* 3b */ -0, /* 3c */ -0, /* 3d */ -0, /* 3e */ -0, /* 3f */ -0, /* 40 */ -11, /* A */ -12, /* B */ -13, /* C */ -14, /* D */ -15, /* E */ -16, /* F */ -17, /* G */ -18, /* H */ -19, /* I */ -20, /* J */ -21, /* K */ -22, /* L */ -23, /* M */ -24, /* N */ -25, /* O */ -26, /* P */ -27, /* Q */ -28, /* R */ -29, /* S */ -30, /* T */ -31, /* U */ -32, /* V */ -33, /* W */ -34, /* X */ -35, /* Y */ -36, /* Z */ -0, /* 5b */ -0, /* 5c */ -0, /* 5d */ -0, /* 5e */ -37, /* _ */ -0, /* 60 */ -11, /* a */ -12, /* b */ -13, /* c */ -14, /* d */ -15, /* e */ -16, /* f */ -17, /* g */ -18, /* h */ -19, /* i */ -20, /* j */ -21, /* k */ -22, /* l */ -23, /* m */ -24, /* n */ -25, /* o */ -26, /* p */ -27, /* q */ -28, /* r */ -29, /* s */ -30, /* t */ -31, /* u */ -32, /* v */ -33, /* w */ -34, /* x */ -35, /* y */ -36, /* z */ -0, /* 7b */ -0, /* 7c */ -0, /* 7d */ -0, /* 7e */ -0, /* 7f */ -0, /* 80 */ -0, /* 81 */ -0, /* 82 */ -0, /* 83 */ -0, /* 84 */ -0, /* 85 */ -0, /* 86 */ -0, /* 87 */ -0, /* 88 */ -0, /* 89 */ -0, /* 8a */ -0, /* 8b */ -0, /* 8c */ -0, /* 8d */ -0, /* 8e */ -0, /* 8f */ -0, /* 90 */ -0, /* 91 */ -0, /* 92 */ -0, /* 93 */ -0, /* 94 */ -0, /* 95 */ -0, /* 96 */ -0, /* 97 */ -0, /* 98 */ -0, /* 99 */ -0, /* 9a */ -0, /* 9b */ -0, /* 9c */ -0, /* 9d */ -0, /* 9e */ -0, /* 9f */ -0, /* a0 */ -0, /* a1 */ -0, /* a2 */ -0, /* a3 */ -0, /* a4 */ -0, /* a5 */ -0, /* a6 */ -0, /* a7 */ -0, /* a8 */ -0, /* a9 */ -0, /* aa */ -0, /* ab */ -0, /* ac */ -0, /* ad */ -0, /* ae */ -0, /* af */ -0, /* b0 */ -0, /* b1 */ -0, /* b2 */ -0, /* b3 */ -0, /* b4 */ -0, /* b5 */ -0, /* b6 */ -0, /* b7 */ -0, /* b8 */ -0, /* b9 */ -0, /* ba */ -0, /* bb */ -0, /* bc */ -0, /* bd */ -0, /* be */ -0, /* bf */ -0, /* c0 */ -0, /* c1 */ -0, /* c2 */ -0, /* c3 */ -0, /* c4 */ -0, /* c5 */ -0, /* c6 */ -0, /* c7 */ -0, /* c8 */ -0, /* c9 */ -0, /* ca */ -0, /* cb */ -0, /* cc */ -0, /* cd */ -0, /* ce */ -0, /* cf */ -0, /* d0 */ -0, /* d1 */ -0, /* d2 */ -0, /* d3 */ -0, /* d4 */ -0, /* d5 */ -0, /* d6 */ -0, /* d7 */ -0, /* d8 */ -0, /* d9 */ -0, /* da */ -0, /* db */ -0, /* dc */ -0, /* dd */ -0, /* de */ -0, /* df */ -0, /* e0 */ -0, /* e1 */ -0, /* e2 */ -0, /* e3 */ -0, /* e4 */ -0, /* e5 */ -0, /* e6 */ -0, /* e7 */ -0, /* e8 */ -0, /* e9 */ -0, /* ea */ -0, /* eb */ -0, /* ec */ -0, /* ed */ -0, /* ee */ -0, /* ef */ -0, /* f0 */ -0, /* f1 */ -0, /* f2 */ -0, /* f3 */ -0, /* f4 */ -0, /* f5 */ -0, /* f6 */ -0, /* f7 */ -0, /* f8 */ -0, /* f9 */ -0, /* fa */ -0, /* fb */ -0, /* fc */ -0, /* fd */ -0, /* fe */ -0, /* ff */ + 0, /* 00 */ + 0, /* 01 */ + 0, /* 02 */ + 0, /* 03 */ + 0, /* 04 */ + 0, /* 05 */ + 0, /* 06 */ + 0, /* 07 */ + 0, /* 08 */ + 0, /* 09 */ + 0, /* 0a */ + 0, /* 0b */ + 0, /* 0c */ + 0, /* 0d */ + 0, /* 0e */ + 0, /* 0f */ + 0, /* 10 */ + 0, /* 11 */ + 0, /* 12 */ + 0, /* 13 */ + 0, /* 14 */ + 0, /* 15 */ + 0, /* 16 */ + 0, /* 17 */ + 0, /* 18 */ + 0, /* 19 */ + 0, /* 1a */ + 0, /* 1b */ + 0, /* 1c */ + 0, /* 1d */ + 0, /* 1e */ + 0, /* 1f */ + 0, /* 20 */ + 0, /* 21 */ + 0, /* 22 */ + 38, /* # */ + 0, /* 24 */ + 0, /* 25 */ + 0, /* 26 */ + 0, /* 27 */ + 0, /* 28 */ + 0, /* 29 */ + 0, /* 2a */ + 0, /* 2b */ + 0, /* 2c */ + 0, /* 2d */ + 0, /* 2e */ + 0, /* 2f */ + 1, /* 0 */ + 2, /* 1 */ + 3, /* 2 */ + 4, /* 3 */ + 5, /* 4 */ + 6, /* 5 */ + 7, /* 6 */ + 8, /* 7 */ + 9, /* 8 */ + 10, /* 9 */ + 0, /* 3a */ + 0, /* 3b */ + 0, /* 3c */ + 0, /* 3d */ + 0, /* 3e */ + 0, /* 3f */ + 0, /* 40 */ + 11, /* A */ + 12, /* B */ + 13, /* C */ + 14, /* D */ + 15, /* E */ + 16, /* F */ + 17, /* G */ + 18, /* H */ + 19, /* I */ + 20, /* J */ + 21, /* K */ + 22, /* L */ + 23, /* M */ + 24, /* N */ + 25, /* O */ + 26, /* P */ + 27, /* Q */ + 28, /* R */ + 29, /* S */ + 30, /* T */ + 31, /* U */ + 32, /* V */ + 33, /* W */ + 34, /* X */ + 35, /* Y */ + 36, /* Z */ + 0, /* 5b */ + 0, /* 5c */ + 0, /* 5d */ + 0, /* 5e */ + 37, /* _ */ + 0, /* 60 */ + 11, /* a */ + 12, /* b */ + 13, /* c */ + 14, /* d */ + 15, /* e */ + 16, /* f */ + 17, /* g */ + 18, /* h */ + 19, /* i */ + 20, /* j */ + 21, /* k */ + 22, /* l */ + 23, /* m */ + 24, /* n */ + 25, /* o */ + 26, /* p */ + 27, /* q */ + 28, /* r */ + 29, /* s */ + 30, /* t */ + 31, /* u */ + 32, /* v */ + 33, /* w */ + 34, /* x */ + 35, /* y */ + 36, /* z */ + 0, /* 7b */ + 0, /* 7c */ + 0, /* 7d */ + 0, /* 7e */ + 0, /* 7f */ + 0, /* 80 */ + 0, /* 81 */ + 0, /* 82 */ + 0, /* 83 */ + 0, /* 84 */ + 0, /* 85 */ + 0, /* 86 */ + 0, /* 87 */ + 0, /* 88 */ + 0, /* 89 */ + 0, /* 8a */ + 0, /* 8b */ + 0, /* 8c */ + 0, /* 8d */ + 0, /* 8e */ + 0, /* 8f */ + 0, /* 90 */ + 0, /* 91 */ + 0, /* 92 */ + 0, /* 93 */ + 0, /* 94 */ + 0, /* 95 */ + 0, /* 96 */ + 0, /* 97 */ + 0, /* 98 */ + 0, /* 99 */ + 0, /* 9a */ + 0, /* 9b */ + 0, /* 9c */ + 0, /* 9d */ + 0, /* 9e */ + 0, /* 9f */ + 0, /* a0 */ + 0, /* a1 */ + 0, /* a2 */ + 0, /* a3 */ + 0, /* a4 */ + 0, /* a5 */ + 0, /* a6 */ + 0, /* a7 */ + 0, /* a8 */ + 0, /* a9 */ + 0, /* aa */ + 0, /* ab */ + 0, /* ac */ + 0, /* ad */ + 0, /* ae */ + 0, /* af */ + 0, /* b0 */ + 0, /* b1 */ + 0, /* b2 */ + 0, /* b3 */ + 0, /* b4 */ + 0, /* b5 */ + 0, /* b6 */ + 0, /* b7 */ + 0, /* b8 */ + 0, /* b9 */ + 0, /* ba */ + 0, /* bb */ + 0, /* bc */ + 0, /* bd */ + 0, /* be */ + 0, /* bf */ + 0, /* c0 */ + 0, /* c1 */ + 0, /* c2 */ + 0, /* c3 */ + 0, /* c4 */ + 0, /* c5 */ + 0, /* c6 */ + 0, /* c7 */ + 0, /* c8 */ + 0, /* c9 */ + 0, /* ca */ + 0, /* cb */ + 0, /* cc */ + 0, /* cd */ + 0, /* ce */ + 0, /* cf */ + 0, /* d0 */ + 0, /* d1 */ + 0, /* d2 */ + 0, /* d3 */ + 0, /* d4 */ + 0, /* d5 */ + 0, /* d6 */ + 0, /* d7 */ + 0, /* d8 */ + 0, /* d9 */ + 0, /* da */ + 0, /* db */ + 0, /* dc */ + 0, /* dd */ + 0, /* de */ + 0, /* df */ + 0, /* e0 */ + 0, /* e1 */ + 0, /* e2 */ + 0, /* e3 */ + 0, /* e4 */ + 0, /* e5 */ + 0, /* e6 */ + 0, /* e7 */ + 0, /* e8 */ + 0, /* e9 */ + 0, /* ea */ + 0, /* eb */ + 0, /* ec */ + 0, /* ed */ + 0, /* ee */ + 0, /* ef */ + 0, /* f0 */ + 0, /* f1 */ + 0, /* f2 */ + 0, /* f3 */ + 0, /* f4 */ + 0, /* f5 */ + 0, /* f6 */ + 0, /* f7 */ + 0, /* f8 */ + 0, /* f9 */ + 0, /* fa */ + 0, /* fb */ + 0, /* fc */ + 0, /* fd */ + 0, /* fe */ + 0, /* ff */ }; /* ECC-388 */ #ifdef DEBUG - static const size_t NUM_MAPPINGS = sizeof(mapping)/sizeof(mapping[0]); +static const size_t NUM_MAPPINGS = sizeof(mapping) / sizeof(mapping[0]); - #define DebugCheckBounds(index, value) \ - do { \ - if (!((index) >= 0 && (index) < NUM_MAPPINGS) ) {printf("ERROR: string='%s' index=%ld @ %s +%d \n", value, (long)index, __FILE__, __LINE__); abort();} \ - } while(0) +#define DebugCheckBounds(index, value) \ + do { \ + if (!((index) >= 0 && (index) < NUM_MAPPINGS)) { \ + printf("ERROR: string='%s' index=%ld @ %s +%d \n", value, (long)index, __FILE__, __LINE__); \ + abort(); \ + } \ + } while (0) #else - #define DebugCheckBounds(index, value) +#define DebugCheckBounds(index, value) #endif #define SIZE 39 #if GRIB_PTHREADS -static pthread_once_t once = PTHREAD_ONCE_INIT; +static pthread_once_t once = PTHREAD_ONCE_INIT; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; -static void init() { - pthread_mutexattr_t attr; - pthread_mutexattr_init(&attr); - pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init(&mutex,&attr); - pthread_mutexattr_destroy(&attr); +static void init() +{ + pthread_mutexattr_t attr; + pthread_mutexattr_init(&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&mutex, &attr); + pthread_mutexattr_destroy(&attr); } #elif GRIB_OMP_THREADS static int once = 0; @@ -304,8 +308,7 @@ static void init() { GRIB_OMP_CRITICAL(lock_grib_trie_with_rank_c) { - if (once == 0) - { + if (once == 0) { omp_init_nest_lock(&mutex); once = 1; } @@ -321,24 +324,25 @@ struct grib_trie_with_rank_list { }; */ -struct grib_trie_with_rank { +struct grib_trie_with_rank +{ grib_trie_with_rank* next[SIZE]; - grib_context *context; + grib_context* context; int first; int last; grib_oarray* objs; }; -grib_trie_with_rank *grib_trie_with_rank_new(grib_context* c) +grib_trie_with_rank* grib_trie_with_rank_new(grib_context* c) { #ifdef RECYCLE_TRIE - grib_trie_with_rank* t = grib_context_malloc_clear_persistent(c,sizeof(grib_trie_with_rank)); + grib_trie_with_rank* t = grib_context_malloc_clear_persistent(c, sizeof(grib_trie_with_rank)); #else - grib_trie_with_rank* t = (grib_trie_with_rank*)grib_context_malloc_clear(c,sizeof(grib_trie_with_rank)); + grib_trie_with_rank* t = (grib_trie_with_rank*)grib_context_malloc_clear(c, sizeof(grib_trie_with_rank)); #endif t->context = c; - t->first=SIZE; - t->last=-1; + t->first = SIZE; + t->last = -1; return t; } @@ -354,23 +358,23 @@ static void grib_trie_with_rank_delete_container_list(grib_context* c,grib_trie_ } */ -void grib_trie_with_rank_delete_container(grib_trie_with_rank *t) +void grib_trie_with_rank_delete_container(grib_trie_with_rank* t) { - GRIB_MUTEX_INIT_ONCE(&once,&init); + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex); DebugAssert(t); { int i; - for(i = t->first; i <= t->last; i++) + for (i = t->first; i <= t->last; i++) if (t->next[i]) { grib_trie_with_rank_delete_container(t->next[i]); } - grib_oarray_delete(t->context,t->objs); + grib_oarray_delete(t->context, t->objs); /* grib_trie_with_rank_delete_container_list(t->context,t->list); */ #ifdef RECYCLE_TRIE - grib_context_free_persistent(t->context,t); + grib_context_free_persistent(t->context, t); #else - grib_context_free(t->context,t); + grib_context_free(t->context, t); #endif } GRIB_MUTEX_UNLOCK(&mutex); @@ -389,43 +393,43 @@ static void grib_trie_with_rank_delete_list(grib_context* c,grib_trie_with_rank_ } */ -void grib_trie_with_rank_delete(grib_trie_with_rank *t) +void grib_trie_with_rank_delete(grib_trie_with_rank* t) { - GRIB_MUTEX_INIT_ONCE(&once,&init); + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex); - if(t) { + if (t) { int i; - for(i = t->first; i <= t->last; i++) + for (i = t->first; i <= t->last; i++) if (t->next[i]) { if (t->objs) { - grib_oarray_delete_content(t->context,t->objs); - grib_oarray_delete(t->context,t->objs); + grib_oarray_delete_content(t->context, t->objs); + grib_oarray_delete(t->context, t->objs); } /* grib_trie_with_rank_delete_list(t->context, t->next[i]->list ); */ grib_trie_with_rank_delete(t->next[i]); } #ifdef RECYCLE_TRIE - grib_context_free_persistent(t->context,t); + grib_context_free_persistent(t->context, t); #else - grib_context_free(t->context,t); + grib_context_free(t->context, t); #endif } GRIB_MUTEX_UNLOCK(&mutex); } -void grib_trie_with_rank_clear(grib_trie_with_rank *t) +void grib_trie_with_rank_clear(grib_trie_with_rank* t) { - if(t) { - int i; - if (t->objs) { - grib_oarray_delete_content(t->context,t->objs); - grib_oarray_delete(t->context,t->objs); - } + if (t) { + int i; + if (t->objs) { + grib_oarray_delete_content(t->context, t->objs); + grib_oarray_delete(t->context, t->objs); + } - for(i = t->first; i <= t->last; i++) - if (t->next[i]) - grib_trie_with_rank_clear(t->next[i]); - } + for (i = t->first; i <= t->last; i++) + if (t->next[i]) + grib_trie_with_rank_clear(t->next[i]); + } } /* @@ -444,34 +448,38 @@ static void grib_trie_with_rank_insert_in_list(grib_trie_with_rank* t,void* data } */ -int grib_trie_with_rank_insert(grib_trie_with_rank* t,const char* key,void* data) +int grib_trie_with_rank_insert(grib_trie_with_rank* t, const char* key, void* data) { - grib_trie_with_rank *last = t; - const char *k = key; + grib_trie_with_rank* last = t; + const char* k = key; - GRIB_MUTEX_INIT_ONCE(&once,&init); + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex); - while(*k && t) { + while (*k && t) { last = t; DebugCheckBounds((int)*k, key); t = t->next[mapping[(int)*k]]; - if(t) k++; + if (t) + k++; } - if(*k != 0) { + if (*k != 0) { t = last; - while(*k) { + while (*k) { int j = 0; DebugCheckBounds((int)*k, key); j = mapping[(int)*k++]; - if(j < t->first) t->first = j; - if(j > t->last) t->last = j; - t = t->next[j] =grib_trie_with_rank_new(t->context); + if (j < t->first) + t->first = j; + if (j > t->last) + t->last = j; + t = t->next[j] = grib_trie_with_rank_new(t->context); } } - if (t->objs==NULL) t->objs=grib_oarray_new(t->context,100,1000); - grib_oarray_push(t->context,t->objs,data); + if (t->objs == NULL) + t->objs = grib_oarray_new(t->context, 100, 1000); + grib_oarray_push(t->context, t->objs, data); /* grib_trie_with_rank_insert_in_list(t,data); */ GRIB_MUTEX_UNLOCK(&mutex); return grib_oarray_used_size(t->objs); @@ -491,23 +499,24 @@ static void *grib_trie_with_rank_get_from_list(grib_trie_with_rank_list* list,in } */ -void *grib_trie_with_rank_get(grib_trie_with_rank* t,const char* key,int rank) +void* grib_trie_with_rank_get(grib_trie_with_rank* t, const char* key, int rank) { - const char *k = key; + const char* k = key; void* data; - GRIB_MUTEX_INIT_ONCE(&once,&init); + GRIB_MUTEX_INIT_ONCE(&once, &init); - if (rank<0) return NULL; + if (rank < 0) + return NULL; GRIB_MUTEX_LOCK(&mutex); - while(*k && t) { + while (*k && t) { DebugCheckBounds((int)*k, key); t = t->next[mapping[(int)*k++]]; } - if(*k == 0 && t != NULL ) { - data=grib_oarray_get(t->objs,rank-1); + if (*k == 0 && t != NULL) { + data = grib_oarray_get(t->objs, rank - 1); GRIB_MUTEX_UNLOCK(&mutex); return data; } diff --git a/src/grib_util.c b/src/grib_util.c index cb06d5e1d..f0e9efa11 100644 --- a/src/grib_util.c +++ b/src/grib_util.c @@ -12,303 +12,323 @@ #include -typedef enum {eROUND_ANGLE_UP, eROUND_ANGLE_DOWN} RoundingPolicy; +typedef enum +{ + eROUND_ANGLE_UP, + eROUND_ANGLE_DOWN +} RoundingPolicy; -static void set_total_length(unsigned char* buffer,long *section_length,long *section_offset,int edition,size_t totalLength) +static void set_total_length(unsigned char* buffer, long* section_length, long* section_offset, int edition, size_t totalLength) { long off; switch (edition) { - case 1: - if(totalLength < 0x800000 ) { - off=32; - grib_encode_unsigned_long(buffer, (unsigned long)totalLength , &off, 24); - } else { - long s4len,t120; - totalLength -= 4; - t120 = (totalLength+119)/120; - s4len = t120*120 - totalLength; - totalLength = 0x800000 | t120; - off=32; - grib_encode_unsigned_long(buffer, (unsigned long)totalLength , &off, 24); - off=section_offset[4]*8; - grib_encode_unsigned_long(buffer, (unsigned long)s4len , &off, 24); - } - break; - case 2: - off=64; - grib_encode_unsigned_long(buffer, (unsigned long)totalLength , &off, 64); - break; + case 1: + if (totalLength < 0x800000) { + off = 32; + grib_encode_unsigned_long(buffer, (unsigned long)totalLength, &off, 24); + } + else { + long s4len, t120; + totalLength -= 4; + t120 = (totalLength + 119) / 120; + s4len = t120 * 120 - totalLength; + totalLength = 0x800000 | t120; + off = 32; + grib_encode_unsigned_long(buffer, (unsigned long)totalLength, &off, 24); + off = section_offset[4] * 8; + grib_encode_unsigned_long(buffer, (unsigned long)s4len, &off, 24); + } + break; + case 2: + off = 64; + grib_encode_unsigned_long(buffer, (unsigned long)totalLength, &off, 64); + break; } } -static grib_handle* grib_sections_copy_internal(grib_handle* hfrom,grib_handle* hto,int sections[],int *err) +static grib_handle* grib_sections_copy_internal(grib_handle* hfrom, grib_handle* hto, int sections[], int* err) { int i; - size_t totalLength=0; + size_t totalLength = 0; unsigned char* buffer; - unsigned char *p; - long edition=0; - long section_length[MAX_NUM_SECTIONS]={0,}; - long section_offset[MAX_NUM_SECTIONS]={0,}; - long off=0; + unsigned char* p; + long edition = 0; + long section_length[MAX_NUM_SECTIONS] = {0,}; + long section_offset[MAX_NUM_SECTIONS] = {0,}; + long off = 0; grib_handle* h; - char section_length_str[64]="section0Length"; - char section_offset_str[64]="offsetSection0"; - long length,offset; - - *err=grib_get_long(hfrom,"edition",&edition); - if (*err) return NULL; - - for (i=0;i<=hfrom->sections_count;i++) { + char section_length_str[64] = "section0Length"; + char section_offset_str[64] = "offsetSection0"; + long length, offset; - if (sections[i]) {h=hfrom;} - else {h=hto;} + *err = grib_get_long(hfrom, "edition", &edition); + if (*err) + return NULL; - sprintf(section_length_str,"section%dLength",i); - if (grib_get_long(h,section_length_str,&length)) continue; - section_length[i]=length; + for (i = 0; i <= hfrom->sections_count; i++) { + if (sections[i]) { + h = hfrom; + } + else { + h = hto; + } - sprintf(section_offset_str,"offsetSection%d",i); - if (grib_get_long(h,section_offset_str,&offset)) continue; - section_offset[i]=offset; + sprintf(section_length_str, "section%dLength", i); + if (grib_get_long(h, section_length_str, &length)) + continue; + section_length[i] = length; - totalLength+=section_length[i]; + sprintf(section_offset_str, "offsetSection%d", i); + if (grib_get_long(h, section_offset_str, &offset)) + continue; + section_offset[i] = offset; + totalLength += section_length[i]; } - buffer=(unsigned char*)grib_context_malloc_clear(hfrom->context,totalLength*sizeof(char)); + buffer = (unsigned char*)grib_context_malloc_clear(hfrom->context, totalLength * sizeof(char)); - p=buffer; - off=0; - for (i=0;i<=hfrom->sections_count;i++) { + p = buffer; + off = 0; + for (i = 0; i <= hfrom->sections_count; i++) { grib_handle* hand = NULL; - if (sections[i]) hand=hfrom; - else hand=hto; - p=(unsigned char*)memcpy(p,hand->buffer->data+section_offset[i],section_length[i]); - section_offset[i]=off; - off+=section_length[i]; - p+=section_length[i]; + if (sections[i]) + hand = hfrom; + else + hand = hto; + p = (unsigned char*)memcpy(p, hand->buffer->data + section_offset[i], section_length[i]); + section_offset[i] = off; + off += section_length[i]; + p += section_length[i]; } /* copy section 3 present flag*/ - if (edition==1) { - const void* buffer_to=NULL; - size_t size_to=0; - grib_get_message(hto,&buffer_to,&size_to); - memcpy(buffer+15,((unsigned char*)buffer_to)+15,1); + if (edition == 1) { + const void* buffer_to = NULL; + size_t size_to = 0; + grib_get_message(hto, &buffer_to, &size_to); + memcpy(buffer + 15, ((unsigned char*)buffer_to) + 15, 1); } - set_total_length(buffer,section_length,section_offset,edition,totalLength); + set_total_length(buffer, section_length, section_offset, edition, totalLength); - h=grib_handle_new_from_message(hfrom->context,buffer,totalLength); + h = grib_handle_new_from_message(hfrom->context, buffer, totalLength); /*to allow free of buffer*/ h->buffer->property = GRIB_MY_BUFFER; switch (edition) { - case 1: - if (sections[1] && sections[2]) break; - - if (sections[1]) { - long PVPresent; - grib_get_long(hfrom,"PVPresent",&PVPresent); - if (PVPresent) { - double *pv; - long numberOfVerticalCoordinateValues; - size_t size=0; - - grib_get_long(hfrom,"numberOfVerticalCoordinateValues",&numberOfVerticalCoordinateValues); - size=numberOfVerticalCoordinateValues; - pv=(double*)grib_context_malloc_clear(hfrom->context,numberOfVerticalCoordinateValues*sizeof(double)); - grib_get_double_array(hfrom,"pv",pv,&size); - grib_set_long(h,"PVPresent",1); - grib_set_double_array(h,"pv",pv,size); - - grib_context_free(hfrom->context,pv); - - } else { - grib_set_long(h,"PVPresent",0); + case 1: + if (sections[1] && sections[2]) + break; + + if (sections[1]) { + long PVPresent; + grib_get_long(hfrom, "PVPresent", &PVPresent); + if (PVPresent) { + double* pv; + long numberOfVerticalCoordinateValues; + size_t size = 0; + + grib_get_long(hfrom, "numberOfVerticalCoordinateValues", &numberOfVerticalCoordinateValues); + size = numberOfVerticalCoordinateValues; + pv = (double*)grib_context_malloc_clear(hfrom->context, numberOfVerticalCoordinateValues * sizeof(double)); + grib_get_double_array(hfrom, "pv", pv, &size); + grib_set_long(h, "PVPresent", 1); + grib_set_double_array(h, "pv", pv, size); + + grib_context_free(hfrom->context, pv); + } + else { + grib_set_long(h, "PVPresent", 0); + } } - } - if (sections[2]) { - long PVPresent; - grib_get_long(hto,"PVPresent",&PVPresent); - if (PVPresent) { - double *pv; - long numberOfVerticalCoordinateValues; - size_t size=0; - - grib_get_long(hto,"numberOfVerticalCoordinateValues",&numberOfVerticalCoordinateValues); - size=numberOfVerticalCoordinateValues; - pv=(double*)grib_context_malloc_clear(hto->context,numberOfVerticalCoordinateValues*sizeof(double)); - grib_get_double_array(hto,"pv",pv,&size); - grib_set_long(h,"PVPresent",1); - grib_set_double_array(h,"pv",pv,size); - - grib_context_free(hto->context,pv); - - } else { - grib_set_long(h,"PVPresent",0); + if (sections[2]) { + long PVPresent; + grib_get_long(hto, "PVPresent", &PVPresent); + if (PVPresent) { + double* pv; + long numberOfVerticalCoordinateValues; + size_t size = 0; + + grib_get_long(hto, "numberOfVerticalCoordinateValues", &numberOfVerticalCoordinateValues); + size = numberOfVerticalCoordinateValues; + pv = (double*)grib_context_malloc_clear(hto->context, numberOfVerticalCoordinateValues * sizeof(double)); + grib_get_double_array(hto, "pv", pv, &size); + grib_set_long(h, "PVPresent", 1); + grib_set_double_array(h, "pv", pv, size); + + grib_context_free(hto->context, pv); + } + else { + grib_set_long(h, "PVPresent", 0); + } } - } - break; - case 2: - if (sections[1]) { - long discipline; - grib_get_long(hfrom,"discipline",&discipline); - grib_set_long(h,"discipline",discipline); - } - break; + break; + case 2: + if (sections[1]) { + long discipline; + grib_get_long(hfrom, "discipline", &discipline); + grib_set_long(h, "discipline", discipline); + } + break; } return h; } -grib_handle* grib_util_sections_copy(grib_handle* hfrom,grib_handle* hto,int what,int *err) +grib_handle* grib_util_sections_copy(grib_handle* hfrom, grib_handle* hto, int what, int* err) { - long edition_from=0; - long edition_to=0; - long localDefinitionNumber=-1; - int sections_to_copy[MAX_NUM_SECTIONS]={0,}; - - *err=grib_get_long(hfrom,"edition",&edition_from); - if (*err) return NULL; - *err=grib_get_long(hto,"edition",&edition_to); - if (*err) return NULL; - - if (edition_to != 1 && edition_to != 2 ) { - *err=GRIB_NOT_IMPLEMENTED; + long edition_from = 0; + long edition_to = 0; + long localDefinitionNumber = -1; + int sections_to_copy[MAX_NUM_SECTIONS] = {0,}; + + *err = grib_get_long(hfrom, "edition", &edition_from); + if (*err) + return NULL; + *err = grib_get_long(hto, "edition", &edition_to); + if (*err) + return NULL; + + if (edition_to != 1 && edition_to != 2) { + *err = GRIB_NOT_IMPLEMENTED; return NULL; } - if (edition_from!=edition_to) { - *err=GRIB_DIFFERENT_EDITION; + if (edition_from != edition_to) { + *err = GRIB_DIFFERENT_EDITION; return NULL; } if (what & GRIB_SECTION_GRID) { switch (edition_from) { - case 1: - sections_to_copy[2]=1; - break; - case 2: - sections_to_copy[3]=1; - break; + case 1: + sections_to_copy[2] = 1; + break; + case 2: + sections_to_copy[3] = 1; + break; } } if (what & GRIB_SECTION_DATA) { switch (edition_from) { - case 1: - sections_to_copy[3]=1; - sections_to_copy[4]=1; - break; - case 2: - sections_to_copy[5]=1; - sections_to_copy[6]=1; - sections_to_copy[7]=1; - break; + case 1: + sections_to_copy[3] = 1; + sections_to_copy[4] = 1; + break; + case 2: + sections_to_copy[5] = 1; + sections_to_copy[6] = 1; + sections_to_copy[7] = 1; + break; } } if (what & GRIB_SECTION_LOCAL) { switch (edition_from) { - case 1: - sections_to_copy[1]=1; - break; - case 2: - sections_to_copy[2]=1; - break; + case 1: + sections_to_copy[1] = 1; + break; + case 2: + sections_to_copy[2] = 1; + break; } } if (what & GRIB_SECTION_PRODUCT) { switch (edition_from) { - case 1: - grib_get_long(hfrom,"localDefinitionNumber",&localDefinitionNumber); - if (localDefinitionNumber==13) { - sections_to_copy[4]=1; - } - sections_to_copy[1]=1; - break; - case 2: - sections_to_copy[1]=1; - sections_to_copy[4]=1; - break; + case 1: + grib_get_long(hfrom, "localDefinitionNumber", &localDefinitionNumber); + if (localDefinitionNumber == 13) { + sections_to_copy[4] = 1; + } + sections_to_copy[1] = 1; + break; + case 2: + sections_to_copy[1] = 1; + sections_to_copy[4] = 1; + break; } } if (what & GRIB_SECTION_BITMAP) { switch (edition_from) { - case 1: - sections_to_copy[3]=1; - break; - case 2: - sections_to_copy[6]=1; - break; + case 1: + sections_to_copy[3] = 1; + break; + case 2: + sections_to_copy[6] = 1; + break; } } - return grib_sections_copy_internal(hfrom,hto,sections_to_copy,err); + return grib_sections_copy_internal(hfrom, hto, sections_to_copy, err); } static grib_trie* init_list(const char* name); -static grib_trie* param_id_list = NULL; +static grib_trie* param_id_list = NULL; static grib_trie* mars_param_list = NULL; /* TODO thread safe */ grib_string_list* grib_util_get_param_id(const char* mars_param) { - if (!mars_param_list && (mars_param_list=init_list("mars_param.table"))==NULL) return NULL; - return (grib_string_list*)grib_trie_get(mars_param_list,mars_param); + if (!mars_param_list && (mars_param_list = init_list("mars_param.table")) == NULL) + return NULL; + return (grib_string_list*)grib_trie_get(mars_param_list, mars_param); } grib_string_list* grib_util_get_mars_param(const char* param_id) { - if (!param_id_list && (param_id_list=init_list("param_id.table"))==NULL) return NULL; - return (grib_string_list*)grib_trie_get(param_id_list,param_id); + if (!param_id_list && (param_id_list = init_list("param_id.table")) == NULL) + return NULL; + return (grib_string_list*)grib_trie_get(param_id_list, param_id); } static grib_trie* init_list(const char* name) { - char *full_path=0; + char* full_path = 0; FILE* fh; char s[101]; char param[101]; - grib_string_list* list=0; - grib_string_list* next=0; + grib_string_list* list = 0; + grib_string_list* next = 0; grib_trie* trie_list; - grib_context* c=grib_context_get_default(); - full_path=grib_context_full_defs_path(c,name); + grib_context* c = grib_context_get_default(); + full_path = grib_context_full_defs_path(c, name); - fh=codes_fopen(full_path,"r"); + fh = codes_fopen(full_path, "r"); if (!fh) { - grib_context_log(c,GRIB_LOG_PERROR,"unable to read %s",full_path); + grib_context_log(c, GRIB_LOG_PERROR, "unable to read %s", full_path); return NULL; } - list=(grib_string_list*)grib_context_malloc_clear(c,sizeof(grib_string_list)); - trie_list=grib_trie_new(c); - if (fscanf(fh,"%100s",param)==EOF) { + list = (grib_string_list*)grib_context_malloc_clear(c, sizeof(grib_string_list)); + trie_list = grib_trie_new(c); + if (fscanf(fh, "%100s", param) == EOF) { fclose(fh); return NULL; } - while (fscanf(fh,"%100s",s)!=EOF) { - if (!strcmp(s,"|")) { - grib_trie_insert(trie_list, param,list); - if (fscanf(fh,"%100s",param)==EOF) { + while (fscanf(fh, "%100s", s) != EOF) { + if (!strcmp(s, "|")) { + grib_trie_insert(trie_list, param, list); + if (fscanf(fh, "%100s", param) == EOF) { fclose(fh); return trie_list; } - list=NULL; - } else { + list = NULL; + } + else { if (!list) { - list=(grib_string_list*)grib_context_malloc_clear(c,sizeof(grib_string_list)); - list->value=grib_context_strdup(c,s); - } else { - next=list; - while(next->next) next=next->next; - next->next=(grib_string_list*)grib_context_malloc_clear(c,sizeof(grib_string_list)); - next->next->value=grib_context_strdup(c,s); + list = (grib_string_list*)grib_context_malloc_clear(c, sizeof(grib_string_list)); + list->value = grib_context_strdup(c, s); + } + else { + next = list; + while (next->next) + next = next->next; + next->next = (grib_string_list*)grib_context_malloc_clear(c, sizeof(grib_string_list)); + next->next->value = grib_context_strdup(c, s); } } } @@ -319,50 +339,56 @@ static grib_trie* init_list(const char* name) /* For debugging purposes */ static void print_values(grib_context* c, const grib_util_grid_spec2* spec, - const double* data_values, const size_t data_values_count, /* the data pay load */ - const grib_values *keyval_pairs, const size_t count) /* keys and their values */ + const double* data_values, const size_t data_values_count, /* the data pay load */ + const grib_values* keyval_pairs, const size_t count) /* keys and their values */ { - size_t i=0; + size_t i = 0; int isConstant = 1; - double v = 0, minVal=DBL_MAX, maxVal=-DBL_MAX; - fprintf(stderr, "ECCODES DEBUG grib_util grib_set_values: setting %lu key/value pairs\n",(unsigned long)count); + double v = 0, minVal = DBL_MAX, maxVal = -DBL_MAX; + fprintf(stderr, "ECCODES DEBUG grib_util grib_set_values: setting %lu key/value pairs\n", (unsigned long)count); - for(i=0; i %s = %ld;\n" - ,keyval_pairs[i].name,(long)keyval_pairs[i].long_value); break; - case GRIB_TYPE_DOUBLE: fprintf(stderr, "ECCODES DEBUG grib_util: => %s = %.16e;\n" - ,keyval_pairs[i].name,keyval_pairs[i].double_value); break; - case GRIB_TYPE_STRING: fprintf(stderr, "ECCODES DEBUG grib_util: => %s = \"%s\";\n" - ,keyval_pairs[i].name,keyval_pairs[i].string_value); break; + for (i = 0; i < count; i++) { + switch (keyval_pairs[i].type) { + case GRIB_TYPE_LONG: + fprintf(stderr, "ECCODES DEBUG grib_util: => %s = %ld;\n", keyval_pairs[i].name, (long)keyval_pairs[i].long_value); + break; + case GRIB_TYPE_DOUBLE: + fprintf(stderr, "ECCODES DEBUG grib_util: => %s = %.16e;\n", keyval_pairs[i].name, keyval_pairs[i].double_value); + break; + case GRIB_TYPE_STRING: + fprintf(stderr, "ECCODES DEBUG grib_util: => %s = \"%s\";\n", keyval_pairs[i].name, keyval_pairs[i].string_value); + break; } } fprintf(stderr, "ECCODES DEBUG grib_util: data_values_count=%lu;\n", (unsigned long)data_values_count); - for (i=0; imissingValue) { if (v == spec->missingValue) { v = data_values[i]; - } else if (v != data_values[i]) { - isConstant=0; + } + else if (v != data_values[i]) { + isConstant = 0; break; } } } - - for (i=0; imissingValue) { - if (v < minVal) minVal=v; - if (v > maxVal) maxVal=v; + if (v != spec->missingValue) { + if (v < minVal) + minVal = v; + if (v > maxVal) + maxVal = v; } } fprintf(stderr, "ECCODES DEBUG grib_util: data_values are CONSTANT? %d\t(min=%.16e, max=%.16e)\n", - isConstant, minVal, maxVal); - if (c->gribex_mode_on) fprintf(stderr, "ECCODES DEBUG grib_util: GRIBEX mode is turned on!\n"); + isConstant, minVal, maxVal); + if (c->gribex_mode_on) + fprintf(stderr, "ECCODES DEBUG grib_util: GRIBEX mode is turned on!\n"); #if 0 if (spec->bitmapPresent) { @@ -420,27 +446,31 @@ static int angle_can_be_encoded(const double angle, const double angular_precisi /* Returns a boolean: 1 if angle can be encoded, 0 otherwise */ static int angle_can_be_encoded(grib_handle* h, const double angle) { - int ret = 0; - int retval = 1; - grib_handle* h2 = NULL; + int ret = 0; + int retval = 1; + grib_handle* h2 = NULL; char sample_name[16] = {0,}; long angle_subdivisions = 0; /* e.g. 1e3 for grib1 and 1e6 for grib2 */ long edition = 0, coded = 0; double expanded, diff; - if((ret = grib_get_long(h,"edition",&edition)) != 0) return ret; - if((ret = grib_get_long(h, "angleSubdivisions", &angle_subdivisions)) != 0) return ret; + if ((ret = grib_get_long(h, "edition", &edition)) != 0) + return ret; + if ((ret = grib_get_long(h, "angleSubdivisions", &angle_subdivisions)) != 0) + return ret; Assert(angle_subdivisions > 0); sprintf(sample_name, "GRIB%ld", edition); h2 = grib_handle_new_from_samples(0, sample_name); - if((ret = grib_set_double(h2, "latitudeOfFirstGridPointInDegrees", angle)) != 0) return ret; - if((ret = grib_get_long(h2, "latitudeOfFirstGridPoint", &coded)) != 0) return ret; + if ((ret = grib_set_double(h2, "latitudeOfFirstGridPointInDegrees", angle)) != 0) + return ret; + if ((ret = grib_get_long(h2, "latitudeOfFirstGridPoint", &coded)) != 0) + return ret; grib_handle_delete(h2); - expanded = angle*angle_subdivisions; - diff = fabs(expanded - coded); - if (diff < 1.0/angle_subdivisions) + expanded = angle * angle_subdivisions; + diff = fabs(expanded - coded); + if (diff < 1.0 / angle_subdivisions) retval = 1; else retval = 0; @@ -454,9 +484,9 @@ static double adjust_angle(const double angle, const RoundingPolicy policy, cons Assert(angle_subdivisions > 0); result = angle * angle_subdivisions; if (policy == eROUND_ANGLE_UP) - result = round(result+0.5); + result = round(result + 0.5); else - result = round(result-0.5); + result = round(result - 0.5); result = result / angle_subdivisions; return result; } @@ -468,41 +498,41 @@ static double adjust_angle(const double angle, const RoundingPolicy policy, cons * longitudeOfLastGridPointInDegrees * and change their values to expand the bounding box */ -static int expand_bounding_box(grib_handle* h, grib_values *values, const size_t count) +static int expand_bounding_box(grib_handle* h, grib_values* values, const size_t count) { - int ret = GRIB_SUCCESS; - size_t i=0; - double new_angle = 0; + int ret = GRIB_SUCCESS; + size_t i = 0; + double new_angle = 0; RoundingPolicy roundingPolicy = eROUND_ANGLE_UP; - long angle_subdivisions = 0; /* e.g. 1e3 for grib1 and 1e6 for grib2 */ - if((ret = grib_get_long(h, "angleSubdivisions", &angle_subdivisions)) != 0) + long angle_subdivisions = 0; /* e.g. 1e3 for grib1 and 1e6 for grib2 */ + if ((ret = grib_get_long(h, "angleSubdivisions", &angle_subdivisions)) != 0) return ret; - for(i=0; icontext->debug) { fprintf(stderr, "ECCODES DEBUG grib_util EXPAND_BOUNDING_BOX %s: old=%.15e new=%.15e (%s)\n", - values[i].name, values[i].double_value, new_angle, - (roundingPolicy==eROUND_ANGLE_UP?"Up":"Down")); + values[i].name, values[i].double_value, new_angle, + (roundingPolicy == eROUND_ANGLE_UP ? "Up" : "Down")); } values[i].double_value = new_angle; } @@ -546,8 +576,7 @@ static int check_geometry(grib_handle* handle, const grib_util_grid_spec2* spec, int err = 0; if (spec->pl && spec->pl_size != 0 && - (spec->grid_type==GRIB_UTIL_GRID_SPEC_REDUCED_GG || spec->grid_type==GRIB_UTIL_GRID_SPEC_REDUCED_ROTATED_GG)) - { + (spec->grid_type == GRIB_UTIL_GRID_SPEC_REDUCED_GG || spec->grid_type == GRIB_UTIL_GRID_SPEC_REDUCED_ROTATED_GG)) { if (specified_as_global) { char msg[100] = {0,}; size_t sum = 0; @@ -734,17 +763,18 @@ static const char* get_grid_type_name(const int spec_grid_type) static int is_constant_field(const double missingValue, const double* data_values, size_t data_values_count) { - int ii=0; - int constant=1; + int ii = 0; + int constant = 1; double value = missingValue; - for (ii=0;iigrid_type; - spec2.Ni=spec->Ni; - spec2.Nj=spec->Nj; - spec2.iDirectionIncrementInDegrees=spec->iDirectionIncrementInDegrees; - spec2.jDirectionIncrementInDegrees=spec->jDirectionIncrementInDegrees; - spec2.longitudeOfFirstGridPointInDegrees=spec->longitudeOfFirstGridPointInDegrees; - spec2.longitudeOfLastGridPointInDegrees=spec->longitudeOfLastGridPointInDegrees; - spec2.latitudeOfFirstGridPointInDegrees=spec->latitudeOfFirstGridPointInDegrees; - spec2.latitudeOfLastGridPointInDegrees=spec->latitudeOfLastGridPointInDegrees; - spec2.uvRelativeToGrid=spec->uvRelativeToGrid; - spec2.latitudeOfSouthernPoleInDegrees=spec->latitudeOfSouthernPoleInDegrees; - spec2.longitudeOfSouthernPoleInDegrees=spec->longitudeOfSouthernPoleInDegrees; - spec2.iScansNegatively=spec->iScansNegatively; - spec2.jScansPositively=spec->jScansPositively; - spec2.N=spec->N; - spec2.bitmapPresent=spec->bitmapPresent; - spec2.missingValue=spec->missingValue; - spec2.pl=spec->pl; - spec2.pl_size=spec->pl_size; - spec2.truncation=spec->truncation; - spec2.orientationOfTheGridInDegrees=spec->orientationOfTheGridInDegrees; - spec2.DyInMetres=spec->DyInMetres; - spec2.DxInMetres=spec->DxInMetres; + spec2.grid_type = spec->grid_type; + spec2.Ni = spec->Ni; + spec2.Nj = spec->Nj; + spec2.iDirectionIncrementInDegrees = spec->iDirectionIncrementInDegrees; + spec2.jDirectionIncrementInDegrees = spec->jDirectionIncrementInDegrees; + spec2.longitudeOfFirstGridPointInDegrees = spec->longitudeOfFirstGridPointInDegrees; + spec2.longitudeOfLastGridPointInDegrees = spec->longitudeOfLastGridPointInDegrees; + spec2.latitudeOfFirstGridPointInDegrees = spec->latitudeOfFirstGridPointInDegrees; + spec2.latitudeOfLastGridPointInDegrees = spec->latitudeOfLastGridPointInDegrees; + spec2.uvRelativeToGrid = spec->uvRelativeToGrid; + spec2.latitudeOfSouthernPoleInDegrees = spec->latitudeOfSouthernPoleInDegrees; + spec2.longitudeOfSouthernPoleInDegrees = spec->longitudeOfSouthernPoleInDegrees; + spec2.iScansNegatively = spec->iScansNegatively; + spec2.jScansPositively = spec->jScansPositively; + spec2.N = spec->N; + spec2.bitmapPresent = spec->bitmapPresent; + spec2.missingValue = spec->missingValue; + spec2.pl = spec->pl; + spec2.pl_size = spec->pl_size; + spec2.truncation = spec->truncation; + spec2.orientationOfTheGridInDegrees = spec->orientationOfTheGridInDegrees; + spec2.DyInMetres = spec->DyInMetres; + spec2.DxInMetres = spec->DxInMetres; /* New data members of spec2 take default values */ spec2.angleOfRotationInDegrees = 0; - spec2.grid_name= NULL; + spec2.grid_name = NULL; return grib_util_set_spec2( - h, - &spec2, - packing_spec, - flags, - data_values, - data_values_count, - err); + h, + &spec2, + packing_spec, + flags, + data_values, + data_values_count, + err); } grib_handle* grib_util_set_spec2(grib_handle* h, - const grib_util_grid_spec2 *spec, - const grib_util_packing_spec *packing_spec, - int flags, - const double* data_values, - size_t data_values_count, - int* err) + const grib_util_grid_spec2* spec, + const grib_util_packing_spec* packing_spec, + int flags, + const double* data_values, + size_t data_values_count, + int* err) { - -#define SET_LONG_VALUE(n,v) do { Assert(count<1024); values[count].name = n; values[count].type = GRIB_TYPE_LONG; values[count].long_value = v; count++; } while(0) -#define SET_DOUBLE_VALUE(n,v) do { Assert(count<1024); values[count].name = n; values[count].type = GRIB_TYPE_DOUBLE; values[count].double_value = v; count++; } while(0) -#define SET_STRING_VALUE(n,v) do { Assert(count<1024); values[count].name = n; values[count].type = GRIB_TYPE_STRING; values[count].string_value = v; count++; } while(0) - -#define COPY_SPEC_LONG(x) do { Assert(count<1024); values[count].name = #x; values[count].type = GRIB_TYPE_LONG; values[count].long_value = spec->x; count++; } while(0) -#define COPY_SPEC_DOUBLE(x) do { Assert(count<1024); values[count].name = #x; values[count].type = GRIB_TYPE_DOUBLE; values[count].double_value = spec->x; count++; } while(0) - - grib_values values[1024]={{0,},}; - size_t count = 0; +#define SET_LONG_VALUE(n, v) \ + do { \ + Assert(count < 1024); \ + values[count].name = n; \ + values[count].type = GRIB_TYPE_LONG; \ + values[count].long_value = v; \ + count++; \ + } while (0) +#define SET_DOUBLE_VALUE(n, v) \ + do { \ + Assert(count < 1024); \ + values[count].name = n; \ + values[count].type = GRIB_TYPE_DOUBLE; \ + values[count].double_value = v; \ + count++; \ + } while (0) +#define SET_STRING_VALUE(n, v) \ + do { \ + Assert(count < 1024); \ + values[count].name = n; \ + values[count].type = GRIB_TYPE_STRING; \ + values[count].string_value = v; \ + count++; \ + } while (0) + +#define COPY_SPEC_LONG(x) \ + do { \ + Assert(count < 1024); \ + values[count].name = #x; \ + values[count].type = GRIB_TYPE_LONG; \ + values[count].long_value = spec->x; \ + count++; \ + } while (0) +#define COPY_SPEC_DOUBLE(x) \ + do { \ + Assert(count < 1024); \ + values[count].name = #x; \ + values[count].type = GRIB_TYPE_DOUBLE; \ + values[count].double_value = spec->x; \ + count++; \ + } while (0) + + grib_values values[1024] = {{0,},}; + size_t count = 0; int i; long editionNumber; - grib_handle* outh = NULL; - grib_handle* tmp = NULL; - const char* grid_type = NULL; + grib_handle* outh = NULL; + grib_handle* tmp = NULL; + const char* grid_type = NULL; char name[1024]; char input_grid_type[100]; char input_packing_type[100]; - long input_bits_per_value=0; - long input_decimal_scale_factor=0; - size_t len=100; - size_t input_grid_type_len=100; + long input_bits_per_value = 0; + long input_decimal_scale_factor = 0; + size_t len = 100; + size_t input_grid_type_len = 100; double laplacianOperator; - int packingTypeIsSet=0; - int setSecondOrder=0; - int setJpegPacking=0; - int setCcsdsPacking=0; - int convertEditionEarlier=0;/* For cases when we cannot set some keys without converting */ - size_t slen=17; + int packingTypeIsSet = 0; + int setSecondOrder = 0; + int setJpegPacking = 0; + int setCcsdsPacking = 0; + int convertEditionEarlier = 0; /* For cases when we cannot set some keys without converting */ + size_t slen = 17; int grib1_high_resolution_fix = 0; /* boolean: See GRIB-863 */ - int global_grid = 0; /* boolean */ - int expandBoundingBox = 0; + int global_grid = 0; /* boolean */ + int expandBoundingBox = 0; - static grib_util_packing_spec default_packing_spec = {0, }; + static grib_util_packing_spec default_packing_spec = {0,}; Assert(h); - if(!packing_spec) { + if (!packing_spec) { packing_spec = &default_packing_spec; } /* Get edition number from input handle */ - if((*err = grib_get_long(h,"edition",&editionNumber)) != 0) - { - grib_context* c=grib_context_get_default(); + if ((*err = grib_get_long(h, "edition", &editionNumber)) != 0) { + grib_context* c = grib_context_get_default(); if (c->write_on_fail) - grib_write_message(h,"error.grib","w"); + grib_write_message(h, "error.grib", "w"); return NULL; } if (packing_spec->deleteLocalDefinition) { - SET_LONG_VALUE("deleteLocalDefinition",1); + SET_LONG_VALUE("deleteLocalDefinition", 1); } - len=100; - grib_get_string(h,"packingType",input_packing_type,&len); - grib_get_long(h,"bitsPerValue",&input_bits_per_value); - grib_get_long(h,"decimalScaleFactor",&input_decimal_scale_factor); - if (h->context->debug==-1) { - fprintf(stderr, "ECCODES DEBUG grib_util: input_packing_type = %s\n",input_packing_type); - fprintf(stderr, "ECCODES DEBUG grib_util: input_bits_per_value = %ld\n",input_bits_per_value); - fprintf(stderr, "ECCODES DEBUG grib_util: input_decimal_scale_factor = %ld\n",input_decimal_scale_factor); + len = 100; + grib_get_string(h, "packingType", input_packing_type, &len); + grib_get_long(h, "bitsPerValue", &input_bits_per_value); + grib_get_long(h, "decimalScaleFactor", &input_decimal_scale_factor); + if (h->context->debug == -1) { + fprintf(stderr, "ECCODES DEBUG grib_util: input_packing_type = %s\n", input_packing_type); + fprintf(stderr, "ECCODES DEBUG grib_util: input_bits_per_value = %ld\n", input_bits_per_value); + fprintf(stderr, "ECCODES DEBUG grib_util: input_decimal_scale_factor = %ld\n", input_decimal_scale_factor); } /*if ( (*err=check_values(data_values, data_values_count))!=GRIB_SUCCESS ) { @@ -881,142 +944,143 @@ grib_handle* grib_util_set_spec2(grib_handle* h, if (flags & GRIB_UTIL_SET_SPEC_FLAGS_ONLY_PACKING) { if (packing_spec->packing == GRIB_UTIL_PACKING_USE_PROVIDED && - strcmp(input_packing_type,"grid_simple_matrix")) { + strcmp(input_packing_type, "grid_simple_matrix")) { switch (packing_spec->packing_type) { - case GRIB_UTIL_PACKING_TYPE_SPECTRAL_COMPLEX: - if (strcmp(input_packing_type,"spectral_complex") && !strcmp(input_packing_type,"spectral_simple")) - SET_STRING_VALUE("packingType","spectral_complex"); - break; - case GRIB_UTIL_PACKING_TYPE_SPECTRAL_SIMPLE: - if (strcmp(input_packing_type,"spectral_simple") && !strcmp(input_packing_type,"spectral_complex")) - SET_STRING_VALUE("packingType","spectral_simple"); - break; - case GRIB_UTIL_PACKING_TYPE_GRID_SIMPLE: - if (strcmp(input_packing_type,"grid_simple") && !strcmp(input_packing_type,"grid_complex") ) - SET_STRING_VALUE("packingType","grid_simple"); - break; - case GRIB_UTIL_PACKING_TYPE_GRID_SIMPLE_MATRIX: - SET_STRING_VALUE("packingType","grid_simple_matrix"); - break; - case GRIB_UTIL_PACKING_TYPE_GRID_COMPLEX: - if (strcmp(input_packing_type,"grid_complex") && !strcmp(input_packing_type,"grid_simple")) - SET_STRING_VALUE("packingType","grid_complex"); - break; - case GRIB_UTIL_PACKING_TYPE_JPEG: - if (strcmp(input_packing_type,"grid_jpeg") && !strcmp(input_packing_type,"grid_simple")) - SET_STRING_VALUE("packingType","grid_jpeg"); - break; - case GRIB_UTIL_PACKING_TYPE_CCSDS: - if (strcmp(input_packing_type,"grid_ccsds") && !strcmp(input_packing_type,"grid_simple")) - SET_STRING_VALUE("packingType","grid_ccsds"); - break; - case GRIB_UTIL_PACKING_TYPE_GRID_SECOND_ORDER: - /* we delay the set of grid_second_order because we don't want + case GRIB_UTIL_PACKING_TYPE_SPECTRAL_COMPLEX: + if (strcmp(input_packing_type, "spectral_complex") && !strcmp(input_packing_type, "spectral_simple")) + SET_STRING_VALUE("packingType", "spectral_complex"); + break; + case GRIB_UTIL_PACKING_TYPE_SPECTRAL_SIMPLE: + if (strcmp(input_packing_type, "spectral_simple") && !strcmp(input_packing_type, "spectral_complex")) + SET_STRING_VALUE("packingType", "spectral_simple"); + break; + case GRIB_UTIL_PACKING_TYPE_GRID_SIMPLE: + if (strcmp(input_packing_type, "grid_simple") && !strcmp(input_packing_type, "grid_complex")) + SET_STRING_VALUE("packingType", "grid_simple"); + break; + case GRIB_UTIL_PACKING_TYPE_GRID_SIMPLE_MATRIX: + SET_STRING_VALUE("packingType", "grid_simple_matrix"); + break; + case GRIB_UTIL_PACKING_TYPE_GRID_COMPLEX: + if (strcmp(input_packing_type, "grid_complex") && !strcmp(input_packing_type, "grid_simple")) + SET_STRING_VALUE("packingType", "grid_complex"); + break; + case GRIB_UTIL_PACKING_TYPE_JPEG: + if (strcmp(input_packing_type, "grid_jpeg") && !strcmp(input_packing_type, "grid_simple")) + SET_STRING_VALUE("packingType", "grid_jpeg"); + break; + case GRIB_UTIL_PACKING_TYPE_CCSDS: + if (strcmp(input_packing_type, "grid_ccsds") && !strcmp(input_packing_type, "grid_simple")) + SET_STRING_VALUE("packingType", "grid_ccsds"); + break; + case GRIB_UTIL_PACKING_TYPE_GRID_SECOND_ORDER: + /* we delay the set of grid_second_order because we don't want to do it on a field with bitsPerValue=0 */ - setSecondOrder=1; - break; - default : - fprintf(stderr, "invalid packing_spec->packing_type = %ld\n",(long)packing_spec->packing_type); - *err = GRIB_INTERNAL_ERROR; - goto cleanup; - break; + setSecondOrder = 1; + break; + default: + fprintf(stderr, "invalid packing_spec->packing_type = %ld\n", (long)packing_spec->packing_type); + *err = GRIB_INTERNAL_ERROR; + goto cleanup; + break; } - packingTypeIsSet=1; + packingTypeIsSet = 1; } - switch(packing_spec->accuracy) { - - case GRIB_UTIL_ACCURACY_SAME_BITS_PER_VALUES_AS_INPUT: - break; + switch (packing_spec->accuracy) { + case GRIB_UTIL_ACCURACY_SAME_BITS_PER_VALUES_AS_INPUT: + break; - case GRIB_UTIL_ACCURACY_USE_PROVIDED_BITS_PER_VALUES: - if (input_bits_per_value!=packing_spec->bitsPerValue) - SET_LONG_VALUE("bitsPerValue", packing_spec->bitsPerValue); - break; + case GRIB_UTIL_ACCURACY_USE_PROVIDED_BITS_PER_VALUES: + if (input_bits_per_value != packing_spec->bitsPerValue) + SET_LONG_VALUE("bitsPerValue", packing_spec->bitsPerValue); + break; - case GRIB_UTIL_ACCURACY_SAME_DECIMAL_SCALE_FACTOR_AS_INPUT: - break; + case GRIB_UTIL_ACCURACY_SAME_DECIMAL_SCALE_FACTOR_AS_INPUT: + break; - case GRIB_UTIL_ACCURACY_USE_PROVIDED_DECIMAL_SCALE_FACTOR: - if (input_decimal_scale_factor!=packing_spec->decimalScaleFactor) - SET_LONG_VALUE("decimalScaleFactor", packing_spec->decimalScaleFactor); - break; + case GRIB_UTIL_ACCURACY_USE_PROVIDED_DECIMAL_SCALE_FACTOR: + if (input_decimal_scale_factor != packing_spec->decimalScaleFactor) + SET_LONG_VALUE("decimalScaleFactor", packing_spec->decimalScaleFactor); + break; - default: - fprintf(stderr, "invalid packing_spec->accuracy = %ld\n",(long)packing_spec->accuracy); - *err = GRIB_INTERNAL_ERROR; - goto cleanup; - break; + default: + fprintf(stderr, "invalid packing_spec->accuracy = %ld\n", (long)packing_spec->accuracy); + *err = GRIB_INTERNAL_ERROR; + goto cleanup; + break; } /*nothing to be changed*/ - if (count==0) { + if (count == 0) { *err = -1; return h; } - if (h->context->debug==-1) { - print_values(h->context,spec,data_values,data_values_count,values,count); + if (h->context->debug == -1) { + print_values(h->context, spec, data_values, data_values_count, values, count); } - if((*err = grib_set_values(h,values,count)) != 0) - { - fprintf(stderr,"GRIB_UTIL_SET_SPEC: Cannot set values %s\n",grib_get_error_message(*err)); + if ((*err = grib_set_values(h, values, count)) != 0) { + fprintf(stderr, "GRIB_UTIL_SET_SPEC: Cannot set values %s\n", grib_get_error_message(*err)); - for(i = 0; i < count; i++) - if(values[i].error) - fprintf(stderr," %s %s\n",values[i].name,grib_get_error_message(values[i].error)); + for (i = 0; i < count; i++) + if (values[i].error) + fprintf(stderr, " %s %s\n", values[i].name, grib_get_error_message(values[i].error)); goto cleanup; } - if (h->context->debug==-1) { - int j=0; + if (h->context->debug == -1) { + int j = 0; fprintf(stderr, "ECCODES DEBUG grib_util: grib_set_double_array\n"); - for (j=0;j<20;j++) fprintf(stderr, "ECCODES DEBUG grib_util %g\n",data_values[j]); - fprintf(stderr, "ECCODES DEBUG grib_util: data_values_count=%d \n",(int)data_values_count); + for (j = 0; j < 20; j++) + fprintf(stderr, "ECCODES DEBUG grib_util %g\n", data_values[j]); + fprintf(stderr, "ECCODES DEBUG grib_util: data_values_count=%d \n", (int)data_values_count); } - if((*err = grib_set_double_array(h,"values",data_values,data_values_count)) != 0) - { + if ((*err = grib_set_double_array(h, "values", data_values, data_values_count)) != 0) { goto cleanup; } - if (h->context->debug==-1) + if (h->context->debug == -1) fprintf(stderr, "ECCODES DEBUG grib_util: done grib_set_double_array \n"); /* convert to second_order if not constant field */ - if (setSecondOrder ) { - int constant=0; - double missingValue=0; - grib_get_double(h,"missingValue",&missingValue); - constant=is_constant_field(missingValue, data_values, data_values_count); + if (setSecondOrder) { + int constant = 0; + double missingValue = 0; + grib_get_double(h, "missingValue", &missingValue); + constant = is_constant_field(missingValue, data_values, data_values_count); if (!constant) { size_t packTypeLen; - if (editionNumber == 1 ) { + if (editionNumber == 1) { long numberOfGroups; - grib_handle* htmp=grib_handle_clone(h); + grib_handle* htmp = grib_handle_clone(h); - packTypeLen=17; - grib_set_string(htmp,"packingType","grid_second_order",&packTypeLen); - grib_get_long(htmp,"numberOfGroups",&numberOfGroups); + packTypeLen = 17; + grib_set_string(htmp, "packingType", "grid_second_order", &packTypeLen); + grib_get_long(htmp, "numberOfGroups", &numberOfGroups); /* GRIBEX is not able to decode overflown numberOfGroups with SPD */ - if (numberOfGroups>65534 && h->context->no_spd ) { - packTypeLen=24; - grib_set_string(h,"packingType","grid_second_order_no_SPD",&packTypeLen); + if (numberOfGroups > 65534 && h->context->no_spd) { + packTypeLen = 24; + grib_set_string(h, "packingType", "grid_second_order_no_SPD", &packTypeLen); grib_handle_delete(htmp); - } else { + } + else { grib_handle_delete(h); - h=htmp; + h = htmp; } - } else { - packTypeLen=17; - grib_set_string(h,"packingType","grid_second_order",&packTypeLen); - grib_set_double_array(h,"values",data_values,data_values_count); } - } else { + else { + packTypeLen = 17; + grib_set_string(h, "packingType", "grid_second_order", &packTypeLen); + grib_set_double_array(h, "values", data_values, data_values_count); + } + } + else { if (h->context->gribex_mode_on) { - h->context->gribex_mode_on=0; - grib_set_double_array(h,"values",data_values,data_values_count); - h->context->gribex_mode_on=1; + h->context->gribex_mode_on = 0; + grib_set_double_array(h, "values", data_values, data_values_count); + h->context->gribex_mode_on = 1; } } } @@ -1026,7 +1090,7 @@ grib_handle* grib_util_set_spec2(grib_handle* h, grid_type = get_grid_type_name(spec->grid_type); if (grid_type == NULL) { - fprintf(stderr,"GRIB_UTIL_SET_SPEC: Unknown grid type: %d\n", spec->grid_type); + fprintf(stderr, "GRIB_UTIL_SET_SPEC: Unknown grid type: %d\n", spec->grid_type); *err = GRIB_NOT_IMPLEMENTED; return NULL; } @@ -1040,7 +1104,7 @@ grib_handle* grib_util_set_spec2(grib_handle* h, case GRIB_UTIL_GRID_SPEC_REDUCED_GG: case GRIB_UTIL_GRID_SPEC_REDUCED_ROTATED_GG: /* Choose a sample with the right Gaussian number and edition */ - sprintf(name, "%s_pl_%ld_grib%ld", grid_type,spec->N, editionNumber); + sprintf(name, "%s_pl_%ld_grib%ld", grid_type, spec->N, editionNumber); if (spec->pl && spec->pl_size) { /* GRIB-834: pl is given so can use any of the reduced_gg_pl samples */ sprintf(name, "%s_pl_grib%ld", grid_type, editionNumber); @@ -1048,24 +1112,26 @@ grib_handle* grib_util_set_spec2(grib_handle* h, break; case GRIB_UTIL_GRID_SPEC_LAMBERT_AZIMUTHAL_EQUAL_AREA: case GRIB_UTIL_GRID_SPEC_UNSTRUCTURED: - if (editionNumber==1) { /* This grid type is not available in edition 1 */ - if (h->context->debug==-1) - fprintf(stderr,"ECCODES DEBUG grib_util: '%s' specified " - "but input is GRIB1. Output must be a higher edition!\n", grid_type); - convertEditionEarlier=1; + if (editionNumber == 1) { /* This grid type is not available in edition 1 */ + if (h->context->debug == -1) + fprintf(stderr, + "ECCODES DEBUG grib_util: '%s' specified " + "but input is GRIB1. Output must be a higher edition!\n", + grid_type); + convertEditionEarlier = 1; } sprintf(name, "GRIB%ld", editionNumber); break; case GRIB_UTIL_GRID_SPEC_LAMBERT_CONFORMAL: sprintf(name, "GRIB%ld", editionNumber); break; - default : + default: sprintf(name, "%s_pl_grib%ld", grid_type, editionNumber); } if (spec->pl && spec->grid_name) { /* Cannot have BOTH pl and grid name specified */ - fprintf(stderr,"GRIB_UTIL_SET_SPEC: Cannot set BOTH pl and grid_name.\n"); + fprintf(stderr, "GRIB_UTIL_SET_SPEC: Cannot set BOTH pl and grid_name.\n"); goto cleanup; } if (spec->grid_name) { @@ -1075,120 +1141,124 @@ grib_handle* grib_util_set_spec2(grib_handle* h, /* TODO: recycle tmp handle */ tmp = grib_handle_new_from_samples(NULL, name); - if(!tmp) { + if (!tmp) { *err = GRIB_INVALID_FILE; return NULL; } /* Set grid */ - switch(spec->grid_type) { - case GRIB_UTIL_GRID_SPEC_REGULAR_LL: - case GRIB_UTIL_GRID_SPEC_ROTATED_LL: - - COPY_SPEC_LONG (bitmapPresent); - if (spec->missingValue) COPY_SPEC_DOUBLE(missingValue); - - SET_LONG_VALUE ("ijDirectionIncrementGiven", 1); - if (editionNumber == 1) { - /* GRIB-863: GRIB1 cannot represent increments less than a millidegree */ - if (!angle_can_be_encoded(h, spec->iDirectionIncrementInDegrees) || - !angle_can_be_encoded(h, spec->jDirectionIncrementInDegrees)) - { - grib1_high_resolution_fix = 1; - /* Set flag to compute the increments */ - SET_LONG_VALUE("ijDirectionIncrementGiven", 0); + switch (spec->grid_type) { + case GRIB_UTIL_GRID_SPEC_REGULAR_LL: + case GRIB_UTIL_GRID_SPEC_ROTATED_LL: + + COPY_SPEC_LONG(bitmapPresent); + if (spec->missingValue) + COPY_SPEC_DOUBLE(missingValue); + + SET_LONG_VALUE("ijDirectionIncrementGiven", 1); + if (editionNumber == 1) { + /* GRIB-863: GRIB1 cannot represent increments less than a millidegree */ + if (!angle_can_be_encoded(h, spec->iDirectionIncrementInDegrees) || + !angle_can_be_encoded(h, spec->jDirectionIncrementInDegrees)) { + grib1_high_resolution_fix = 1; + /* Set flag to compute the increments */ + SET_LONG_VALUE("ijDirectionIncrementGiven", 0); + } } - } - /* default iScansNegatively=0 jScansPositively=0 is ok */ - COPY_SPEC_LONG(iScansNegatively); - COPY_SPEC_LONG(jScansPositively); + /* default iScansNegatively=0 jScansPositively=0 is ok */ + COPY_SPEC_LONG(iScansNegatively); + COPY_SPEC_LONG(jScansPositively); - COPY_SPEC_LONG(Ni); - COPY_SPEC_LONG(Nj); + COPY_SPEC_LONG(Ni); + COPY_SPEC_LONG(Nj); - COPY_SPEC_DOUBLE(iDirectionIncrementInDegrees); - COPY_SPEC_DOUBLE(jDirectionIncrementInDegrees); + COPY_SPEC_DOUBLE(iDirectionIncrementInDegrees); + COPY_SPEC_DOUBLE(jDirectionIncrementInDegrees); - COPY_SPEC_DOUBLE(longitudeOfFirstGridPointInDegrees); - COPY_SPEC_DOUBLE(longitudeOfLastGridPointInDegrees); + COPY_SPEC_DOUBLE(longitudeOfFirstGridPointInDegrees); + COPY_SPEC_DOUBLE(longitudeOfLastGridPointInDegrees); - COPY_SPEC_DOUBLE(latitudeOfFirstGridPointInDegrees); - COPY_SPEC_DOUBLE(latitudeOfLastGridPointInDegrees); + COPY_SPEC_DOUBLE(latitudeOfFirstGridPointInDegrees); + COPY_SPEC_DOUBLE(latitudeOfLastGridPointInDegrees); - break; + break; - case GRIB_UTIL_GRID_SPEC_REGULAR_GG: - case GRIB_UTIL_GRID_SPEC_ROTATED_GG: + case GRIB_UTIL_GRID_SPEC_REGULAR_GG: + case GRIB_UTIL_GRID_SPEC_ROTATED_GG: - COPY_SPEC_LONG (bitmapPresent); - if (spec->missingValue) COPY_SPEC_DOUBLE(missingValue); - SET_LONG_VALUE("ijDirectionIncrementGiven", 1); + COPY_SPEC_LONG(bitmapPresent); + if (spec->missingValue) + COPY_SPEC_DOUBLE(missingValue); + SET_LONG_VALUE("ijDirectionIncrementGiven", 1); - /* TODO: add Assert */ + /* TODO: add Assert */ - COPY_SPEC_LONG(Ni); - COPY_SPEC_DOUBLE(iDirectionIncrementInDegrees); + COPY_SPEC_LONG(Ni); + COPY_SPEC_DOUBLE(iDirectionIncrementInDegrees); - COPY_SPEC_LONG(Nj); - COPY_SPEC_LONG(N); + COPY_SPEC_LONG(Nj); + COPY_SPEC_LONG(N); - /* TODO: Compute here ... */ - COPY_SPEC_DOUBLE(longitudeOfFirstGridPointInDegrees); - COPY_SPEC_DOUBLE(longitudeOfLastGridPointInDegrees); + /* TODO: Compute here ... */ + COPY_SPEC_DOUBLE(longitudeOfFirstGridPointInDegrees); + COPY_SPEC_DOUBLE(longitudeOfLastGridPointInDegrees); - COPY_SPEC_DOUBLE(latitudeOfFirstGridPointInDegrees); - COPY_SPEC_DOUBLE(latitudeOfLastGridPointInDegrees); - break; + COPY_SPEC_DOUBLE(latitudeOfFirstGridPointInDegrees); + COPY_SPEC_DOUBLE(latitudeOfLastGridPointInDegrees); + break; - case GRIB_UTIL_GRID_SPEC_REDUCED_LL: - COPY_SPEC_LONG (bitmapPresent); - if (spec->missingValue) COPY_SPEC_DOUBLE(missingValue); - SET_LONG_VALUE("ijDirectionIncrementGiven", 0); + case GRIB_UTIL_GRID_SPEC_REDUCED_LL: + COPY_SPEC_LONG(bitmapPresent); + if (spec->missingValue) + COPY_SPEC_DOUBLE(missingValue); + SET_LONG_VALUE("ijDirectionIncrementGiven", 0); - COPY_SPEC_LONG(Nj); + COPY_SPEC_LONG(Nj); - COPY_SPEC_DOUBLE(longitudeOfFirstGridPointInDegrees); - COPY_SPEC_DOUBLE(longitudeOfLastGridPointInDegrees); + COPY_SPEC_DOUBLE(longitudeOfFirstGridPointInDegrees); + COPY_SPEC_DOUBLE(longitudeOfLastGridPointInDegrees); - COPY_SPEC_DOUBLE(latitudeOfFirstGridPointInDegrees); - COPY_SPEC_DOUBLE(latitudeOfLastGridPointInDegrees); - break; + COPY_SPEC_DOUBLE(latitudeOfFirstGridPointInDegrees); + COPY_SPEC_DOUBLE(latitudeOfLastGridPointInDegrees); + break; - case GRIB_UTIL_GRID_SPEC_POLAR_STEREOGRAPHIC: - COPY_SPEC_LONG (bitmapPresent); - if (spec->missingValue) COPY_SPEC_DOUBLE(missingValue); + case GRIB_UTIL_GRID_SPEC_POLAR_STEREOGRAPHIC: + COPY_SPEC_LONG(bitmapPresent); + if (spec->missingValue) + COPY_SPEC_DOUBLE(missingValue); - COPY_SPEC_DOUBLE(longitudeOfFirstGridPointInDegrees); - COPY_SPEC_DOUBLE(latitudeOfFirstGridPointInDegrees); - COPY_SPEC_LONG(Ni); - COPY_SPEC_LONG(Nj); + COPY_SPEC_DOUBLE(longitudeOfFirstGridPointInDegrees); + COPY_SPEC_DOUBLE(latitudeOfFirstGridPointInDegrees); + COPY_SPEC_LONG(Ni); + COPY_SPEC_LONG(Nj); - /* default iScansNegatively=0 jScansPositively=0 is ok */ - COPY_SPEC_LONG(iScansNegatively); - COPY_SPEC_LONG(jScansPositively); + /* default iScansNegatively=0 jScansPositively=0 is ok */ + COPY_SPEC_LONG(iScansNegatively); + COPY_SPEC_LONG(jScansPositively); - COPY_SPEC_DOUBLE(orientationOfTheGridInDegrees); + COPY_SPEC_DOUBLE(orientationOfTheGridInDegrees); - COPY_SPEC_LONG(DxInMetres); - COPY_SPEC_LONG(DyInMetres); + COPY_SPEC_LONG(DxInMetres); + COPY_SPEC_LONG(DyInMetres); - break; + break; - case GRIB_UTIL_GRID_SPEC_LAMBERT_AZIMUTHAL_EQUAL_AREA: - COPY_SPEC_LONG (bitmapPresent); - if (spec->missingValue) COPY_SPEC_DOUBLE(missingValue); + case GRIB_UTIL_GRID_SPEC_LAMBERT_AZIMUTHAL_EQUAL_AREA: + COPY_SPEC_LONG(bitmapPresent); + if (spec->missingValue) + COPY_SPEC_DOUBLE(missingValue); - COPY_SPEC_DOUBLE(longitudeOfFirstGridPointInDegrees); - COPY_SPEC_DOUBLE(latitudeOfFirstGridPointInDegrees); - COPY_SPEC_LONG(Ni); /* same as Nx */ - COPY_SPEC_LONG(Nj); /* same as Ny */ - /* TODO + COPY_SPEC_DOUBLE(longitudeOfFirstGridPointInDegrees); + COPY_SPEC_DOUBLE(latitudeOfFirstGridPointInDegrees); + COPY_SPEC_LONG(Ni); /* same as Nx */ + COPY_SPEC_LONG(Nj); /* same as Ny */ + /* TODO * pass in extra keys e.g. Dx, Dy, standardParallel and centralLongitude */ - /* + /* COPY_SPEC_LONG(DxInMetres); COPY_SPEC_LONG(DyInMetres); @@ -1198,23 +1268,25 @@ grib_handle* grib_util_set_spec2(grib_handle* h, COPY_SPEC_LONG(centralLongitudeInMicrodegrees); */ - break; - case GRIB_UTIL_GRID_SPEC_UNSTRUCTURED: - COPY_SPEC_LONG (bitmapPresent); - if (spec->missingValue) COPY_SPEC_DOUBLE(missingValue); - /* + break; + case GRIB_UTIL_GRID_SPEC_UNSTRUCTURED: + COPY_SPEC_LONG(bitmapPresent); + if (spec->missingValue) + COPY_SPEC_DOUBLE(missingValue); + /* * TODO: Other keys */ - break; - case GRIB_UTIL_GRID_SPEC_LAMBERT_CONFORMAL: - COPY_SPEC_LONG (bitmapPresent); - if (spec->missingValue) COPY_SPEC_DOUBLE(missingValue); - COPY_SPEC_DOUBLE(longitudeOfFirstGridPointInDegrees); - COPY_SPEC_DOUBLE(latitudeOfFirstGridPointInDegrees); - COPY_SPEC_LONG(Ni); /* same as Nx */ - COPY_SPEC_LONG(Nj); /* same as Ny */ - - /* + break; + case GRIB_UTIL_GRID_SPEC_LAMBERT_CONFORMAL: + COPY_SPEC_LONG(bitmapPresent); + if (spec->missingValue) + COPY_SPEC_DOUBLE(missingValue); + COPY_SPEC_DOUBLE(longitudeOfFirstGridPointInDegrees); + COPY_SPEC_DOUBLE(latitudeOfFirstGridPointInDegrees); + COPY_SPEC_LONG(Ni); /* same as Nx */ + COPY_SPEC_LONG(Nj); /* same as Ny */ + + /* * Note: DxInMetres and DyInMetres * should be 'double' and not integer. WMO GRIB2 uses millimetres! * TODO: @@ -1223,197 +1295,193 @@ grib_handle* grib_util_set_spec2(grib_handle* h, *err = GRIB_NOT_IMPLEMENTED; goto cleanup; */ - break; - - case GRIB_UTIL_GRID_SPEC_REDUCED_GG: - case GRIB_UTIL_GRID_SPEC_REDUCED_ROTATED_GG: - - COPY_SPEC_LONG (bitmapPresent); - if (spec->missingValue) COPY_SPEC_DOUBLE(missingValue); - SET_LONG_VALUE("ijDirectionIncrementGiven", 0); + break; - COPY_SPEC_LONG(Nj); - COPY_SPEC_LONG(N); + case GRIB_UTIL_GRID_SPEC_REDUCED_GG: + case GRIB_UTIL_GRID_SPEC_REDUCED_ROTATED_GG: - COPY_SPEC_DOUBLE(longitudeOfFirstGridPointInDegrees); - COPY_SPEC_DOUBLE(longitudeOfLastGridPointInDegrees); + COPY_SPEC_LONG(bitmapPresent); + if (spec->missingValue) + COPY_SPEC_DOUBLE(missingValue); + SET_LONG_VALUE("ijDirectionIncrementGiven", 0); - COPY_SPEC_DOUBLE(latitudeOfFirstGridPointInDegrees); - COPY_SPEC_DOUBLE(latitudeOfLastGridPointInDegrees); + COPY_SPEC_LONG(Nj); + COPY_SPEC_LONG(N); - break; + COPY_SPEC_DOUBLE(longitudeOfFirstGridPointInDegrees); + COPY_SPEC_DOUBLE(longitudeOfLastGridPointInDegrees); - case GRIB_UTIL_GRID_SPEC_SH: - *err=grib_get_string(h,"gridType",input_grid_type,&input_grid_type_len); + COPY_SPEC_DOUBLE(latitudeOfFirstGridPointInDegrees); + COPY_SPEC_DOUBLE(latitudeOfLastGridPointInDegrees); - SET_LONG_VALUE("J", spec->truncation); - SET_LONG_VALUE("K", spec->truncation); - SET_LONG_VALUE("M", spec->truncation); + break; - if(packing_spec->packing_type == GRIB_UTIL_PACKING_TYPE_SPECTRAL_COMPLEX) - { - const long JS = spec->truncation < 20 ? spec->truncation : 20; - SET_STRING_VALUE("packingType", "spectral_complex"); - packingTypeIsSet=1; - SET_LONG_VALUE("JS", JS); - SET_LONG_VALUE("KS", JS); - SET_LONG_VALUE("MS", JS); - if (packing_spec->packing == GRIB_UTIL_PACKING_USE_PROVIDED && editionNumber==2 ) { - SET_LONG_VALUE("computeLaplacianOperator", 1); - } else if ((!(*err) && strcmp(input_grid_type,"sh")) || packing_spec->computeLaplacianOperator ) { - SET_LONG_VALUE("computeLaplacianOperator", 1); - if (packing_spec->truncateLaplacian) - SET_LONG_VALUE("truncateLaplacian",1); - } else { - SET_LONG_VALUE("computeLaplacianOperator", 0); - *err=grib_get_double(h,"laplacianOperator",&laplacianOperator); - if (packing_spec->truncateLaplacian) SET_LONG_VALUE("truncateLaplacian",1); - SET_DOUBLE_VALUE("laplacianOperator", packing_spec->laplacianOperator); - if (laplacianOperator) { - SET_DOUBLE_VALUE("laplacianOperator", laplacianOperator); + case GRIB_UTIL_GRID_SPEC_SH: + *err = grib_get_string(h, "gridType", input_grid_type, &input_grid_type_len); + + SET_LONG_VALUE("J", spec->truncation); + SET_LONG_VALUE("K", spec->truncation); + SET_LONG_VALUE("M", spec->truncation); + + if (packing_spec->packing_type == GRIB_UTIL_PACKING_TYPE_SPECTRAL_COMPLEX) { + const long JS = spec->truncation < 20 ? spec->truncation : 20; + SET_STRING_VALUE("packingType", "spectral_complex"); + packingTypeIsSet = 1; + SET_LONG_VALUE("JS", JS); + SET_LONG_VALUE("KS", JS); + SET_LONG_VALUE("MS", JS); + if (packing_spec->packing == GRIB_UTIL_PACKING_USE_PROVIDED && editionNumber == 2) { + SET_LONG_VALUE("computeLaplacianOperator", 1); + } + else if ((!(*err) && strcmp(input_grid_type, "sh")) || packing_spec->computeLaplacianOperator) { + SET_LONG_VALUE("computeLaplacianOperator", 1); + if (packing_spec->truncateLaplacian) + SET_LONG_VALUE("truncateLaplacian", 1); + } + else { + SET_LONG_VALUE("computeLaplacianOperator", 0); + *err = grib_get_double(h, "laplacianOperator", &laplacianOperator); + if (packing_spec->truncateLaplacian) + SET_LONG_VALUE("truncateLaplacian", 1); + SET_DOUBLE_VALUE("laplacianOperator", packing_spec->laplacianOperator); + if (laplacianOperator) { + SET_DOUBLE_VALUE("laplacianOperator", laplacianOperator); + } } } - } - break; + break; } /* Set rotation */ - switch(spec->grid_type) { - case GRIB_UTIL_GRID_SPEC_ROTATED_LL: - case GRIB_UTIL_GRID_SPEC_ROTATED_GG: - case GRIB_UTIL_GRID_SPEC_REDUCED_ROTATED_GG: - COPY_SPEC_LONG(uvRelativeToGrid); - COPY_SPEC_DOUBLE(latitudeOfSouthernPoleInDegrees); - COPY_SPEC_DOUBLE(longitudeOfSouthernPoleInDegrees); - COPY_SPEC_DOUBLE(angleOfRotationInDegrees); - break; + switch (spec->grid_type) { + case GRIB_UTIL_GRID_SPEC_ROTATED_LL: + case GRIB_UTIL_GRID_SPEC_ROTATED_GG: + case GRIB_UTIL_GRID_SPEC_REDUCED_ROTATED_GG: + COPY_SPEC_LONG(uvRelativeToGrid); + COPY_SPEC_DOUBLE(latitudeOfSouthernPoleInDegrees); + COPY_SPEC_DOUBLE(longitudeOfSouthernPoleInDegrees); + COPY_SPEC_DOUBLE(angleOfRotationInDegrees); + break; } /* process packing options */ if (!packingTypeIsSet && - packing_spec->packing == GRIB_UTIL_PACKING_USE_PROVIDED && - strcmp(input_packing_type,"grid_simple_matrix")) { - + packing_spec->packing == GRIB_UTIL_PACKING_USE_PROVIDED && + strcmp(input_packing_type, "grid_simple_matrix")) { switch (packing_spec->packing_type) { - case GRIB_UTIL_PACKING_TYPE_SPECTRAL_COMPLEX: - if (strcmp(input_packing_type,"spectral_complex") && !strcmp(input_packing_type,"spectral_simple")) - SET_STRING_VALUE("packingType","spectral_complex"); - break; - case GRIB_UTIL_PACKING_TYPE_SPECTRAL_SIMPLE: - if (strcmp(input_packing_type,"spectral_simple") && !strcmp(input_packing_type,"spectral_complex")) - SET_STRING_VALUE("packingType","spectral_simple"); - break; - case GRIB_UTIL_PACKING_TYPE_GRID_SIMPLE: - if (strcmp(input_packing_type,"grid_simple") && !strcmp(input_packing_type,"grid_complex")) - SET_STRING_VALUE("packingType","grid_simple"); - break; - case GRIB_UTIL_PACKING_TYPE_GRID_COMPLEX: - if (strcmp(input_packing_type,"grid_complex") && !strcmp(input_packing_type,"grid_simple")) - SET_STRING_VALUE("packingType","grid_complex"); - break; - case GRIB_UTIL_PACKING_TYPE_JPEG: - /* Have to delay JPEG packing: + case GRIB_UTIL_PACKING_TYPE_SPECTRAL_COMPLEX: + if (strcmp(input_packing_type, "spectral_complex") && !strcmp(input_packing_type, "spectral_simple")) + SET_STRING_VALUE("packingType", "spectral_complex"); + break; + case GRIB_UTIL_PACKING_TYPE_SPECTRAL_SIMPLE: + if (strcmp(input_packing_type, "spectral_simple") && !strcmp(input_packing_type, "spectral_complex")) + SET_STRING_VALUE("packingType", "spectral_simple"); + break; + case GRIB_UTIL_PACKING_TYPE_GRID_SIMPLE: + if (strcmp(input_packing_type, "grid_simple") && !strcmp(input_packing_type, "grid_complex")) + SET_STRING_VALUE("packingType", "grid_simple"); + break; + case GRIB_UTIL_PACKING_TYPE_GRID_COMPLEX: + if (strcmp(input_packing_type, "grid_complex") && !strcmp(input_packing_type, "grid_simple")) + SET_STRING_VALUE("packingType", "grid_complex"); + break; + case GRIB_UTIL_PACKING_TYPE_JPEG: + /* Have to delay JPEG packing: * Reason 1: It is not available in GRIB1 and so we have to wait until we change edition * Reason 2: It has to be done AFTER we set the data values */ - if (strcmp(input_packing_type,"grid_jpeg") && !strcmp(input_packing_type,"grid_simple")) - setJpegPacking = 1; - break; - case GRIB_UTIL_PACKING_TYPE_CCSDS: - /* Have to delay CCSDS packing: + if (strcmp(input_packing_type, "grid_jpeg") && !strcmp(input_packing_type, "grid_simple")) + setJpegPacking = 1; + break; + case GRIB_UTIL_PACKING_TYPE_CCSDS: + /* Have to delay CCSDS packing: * Reason 1: It is not available in GRIB1 and so we have to wait until we change edition * Reason 2: It has to be done AFTER we set the data values */ - if (strcmp(input_packing_type,"grid_ccsds") && !strcmp(input_packing_type,"grid_simple")) - setCcsdsPacking = 1; - break; - case GRIB_UTIL_PACKING_TYPE_GRID_SECOND_ORDER: - /* we delay the set of grid_second_order because we don't want + if (strcmp(input_packing_type, "grid_ccsds") && !strcmp(input_packing_type, "grid_simple")) + setCcsdsPacking = 1; + break; + case GRIB_UTIL_PACKING_TYPE_GRID_SECOND_ORDER: + /* we delay the set of grid_second_order because we don't want to do it on a field with bitsPerValue=0 */ - setSecondOrder=1; - break; - default : - fprintf(stderr,"invalid packing_spec->packing_type = %ld\n",(long)packing_spec->packing_type); - *err = GRIB_INTERNAL_ERROR; - goto cleanup; - break; + setSecondOrder = 1; + break; + default: + fprintf(stderr, "invalid packing_spec->packing_type = %ld\n", (long)packing_spec->packing_type); + *err = GRIB_INTERNAL_ERROR; + goto cleanup; + break; } } - if (strcmp(input_packing_type,"grid_simple_matrix")==0) { - long numberOfDirections,numberOfFrequencies; + if (strcmp(input_packing_type, "grid_simple_matrix") == 0) { + long numberOfDirections, numberOfFrequencies; int keep_matrix = h->context->keep_matrix; if (packing_spec->packing_type == GRIB_UTIL_PACKING_TYPE_GRID_SIMPLE) { keep_matrix = 0; /* ECC-911 */ } if (keep_matrix) { int ret; - SET_STRING_VALUE("packingType","grid_simple_matrix"); - ret=grib_get_long(h,"numberOfDirections",&numberOfDirections); + SET_STRING_VALUE("packingType", "grid_simple_matrix"); + ret = grib_get_long(h, "numberOfDirections", &numberOfDirections); if (!ret) { - ret=grib_get_long(h,"numberOfDirections",&numberOfDirections); - SET_LONG_VALUE("NC1",numberOfDirections); - ret=grib_get_long(h,"numberOfFrequencies",&numberOfFrequencies); - SET_LONG_VALUE("NC2",numberOfFrequencies); - SET_LONG_VALUE("physicalFlag1",1); - SET_LONG_VALUE("physicalFlag2",2); - SET_LONG_VALUE("NR",1); - SET_LONG_VALUE("NC",1); + ret = grib_get_long(h, "numberOfDirections", &numberOfDirections); + SET_LONG_VALUE("NC1", numberOfDirections); + ret = grib_get_long(h, "numberOfFrequencies", &numberOfFrequencies); + SET_LONG_VALUE("NC2", numberOfFrequencies); + SET_LONG_VALUE("physicalFlag1", 1); + SET_LONG_VALUE("physicalFlag2", 2); + SET_LONG_VALUE("NR", 1); + SET_LONG_VALUE("NC", 1); } - } else { - SET_STRING_VALUE("packingType","grid_simple"); + } + else { + SET_STRING_VALUE("packingType", "grid_simple"); } } - switch(packing_spec->accuracy) { - case GRIB_UTIL_ACCURACY_SAME_BITS_PER_VALUES_AS_INPUT: - { - long bitsPerValue = 0; - Assert(grib_get_long(h, "bitsPerValue", &bitsPerValue) == 0); - SET_LONG_VALUE("bitsPerValue", bitsPerValue); - } - break; + switch (packing_spec->accuracy) { + case GRIB_UTIL_ACCURACY_SAME_BITS_PER_VALUES_AS_INPUT: { + long bitsPerValue = 0; + Assert(grib_get_long(h, "bitsPerValue", &bitsPerValue) == 0); + SET_LONG_VALUE("bitsPerValue", bitsPerValue); + } break; - case GRIB_UTIL_ACCURACY_USE_PROVIDED_BITS_PER_VALUES: - SET_LONG_VALUE("bitsPerValue", packing_spec->bitsPerValue); - break; + case GRIB_UTIL_ACCURACY_USE_PROVIDED_BITS_PER_VALUES: + SET_LONG_VALUE("bitsPerValue", packing_spec->bitsPerValue); + break; - case GRIB_UTIL_ACCURACY_SAME_DECIMAL_SCALE_FACTOR_AS_INPUT: - { - long decimalScaleFactor = 0; - Assert(grib_get_long(h, "decimalScaleFactor", &decimalScaleFactor) == 0); - SET_LONG_VALUE("decimalScaleFactor", decimalScaleFactor); - } - break; + case GRIB_UTIL_ACCURACY_SAME_DECIMAL_SCALE_FACTOR_AS_INPUT: { + long decimalScaleFactor = 0; + Assert(grib_get_long(h, "decimalScaleFactor", &decimalScaleFactor) == 0); + SET_LONG_VALUE("decimalScaleFactor", decimalScaleFactor); + } break; - case GRIB_UTIL_ACCURACY_USE_PROVIDED_DECIMAL_SCALE_FACTOR: - SET_LONG_VALUE("decimalScaleFactor", packing_spec->decimalScaleFactor); - break; + case GRIB_UTIL_ACCURACY_USE_PROVIDED_DECIMAL_SCALE_FACTOR: + SET_LONG_VALUE("decimalScaleFactor", packing_spec->decimalScaleFactor); + break; - default: - fprintf(stderr, "invalid packing_spec->accuracy = %ld\n",(long)packing_spec->accuracy); - *err = GRIB_INTERNAL_ERROR; - goto cleanup; - break; + default: + fprintf(stderr, "invalid packing_spec->accuracy = %ld\n", (long)packing_spec->accuracy); + *err = GRIB_INTERNAL_ERROR; + goto cleanup; + break; } - if(packing_spec->extra_settings_count) { - for(i = 0; i < packing_spec->extra_settings_count; i++) { + if (packing_spec->extra_settings_count) { + for (i = 0; i < packing_spec->extra_settings_count; i++) { Assert(count < 1024); - if (strcmp(packing_spec->extra_settings[i].name, "expandBoundingBox")==0) - { + if (strcmp(packing_spec->extra_settings[i].name, "expandBoundingBox") == 0) { if (packing_spec->extra_settings[i].long_value == 1) { /* ECC-625: Request is for expansion of bounding box (sub-area). * This is also called the "snap-out" policy */ expandBoundingBox = 1; } } - else - { + else { values[count++] = packing_spec->extra_settings[i]; - if (strcmp(packing_spec->extra_settings[i].name, "global")==0 && - packing_spec->extra_settings[i].long_value == 1) - { + if (strcmp(packing_spec->extra_settings[i].name, "global") == 0 && + packing_spec->extra_settings[i].long_value == 1) { /* GRIB-922: Request is for a global grid. Setting this key will * calculate the lat/lon values. So the spec's lat/lon can be ignored */ global_grid = 1; @@ -1424,8 +1492,7 @@ grib_handle* grib_util_set_spec2(grib_handle* h, /* grib_write_message(h,"input.grib","w"); */ /* grib_write_message(tmp,"geo.grib","w"); */ /* copy product and local sections from h to tmp handle and store in outh */ - if((outh = grib_util_sections_copy(h, tmp, GRIB_SECTION_PRODUCT | GRIB_SECTION_LOCAL,err)) == NULL) - { + if ((outh = grib_util_sections_copy(h, tmp, GRIB_SECTION_PRODUCT | GRIB_SECTION_LOCAL, err)) == NULL) { goto cleanup; } @@ -1444,11 +1511,10 @@ grib_handle* grib_util_set_spec2(grib_handle* h, goto cleanup; } - if (spec->pl_size!=0 && (spec->grid_type==GRIB_UTIL_GRID_SPEC_REDUCED_GG || spec->grid_type==GRIB_UTIL_GRID_SPEC_REDUCED_ROTATED_GG)) - { - *err=grib_set_long_array(outh,"pl",spec->pl,spec->pl_size); + if (spec->pl_size != 0 && (spec->grid_type == GRIB_UTIL_GRID_SPEC_REDUCED_GG || spec->grid_type == GRIB_UTIL_GRID_SPEC_REDUCED_ROTATED_GG)) { + *err = grib_set_long_array(outh, "pl", spec->pl, spec->pl_size); if (*err) { - fprintf(stderr,"SET_GRID_DATA_DESCRIPTION: Cannot set pl %s\n",grib_get_error_message(*err)); + fprintf(stderr, "SET_GRID_DATA_DESCRIPTION: Cannot set pl %s\n", grib_get_error_message(*err)); goto cleanup; } if (global_grid) { @@ -1462,59 +1528,60 @@ grib_handle* grib_util_set_spec2(grib_handle* h, } } - if (h->context->debug==-1) { + if (h->context->debug == -1) { fprintf(stderr, "ECCODES DEBUG grib_util: global_grid = %d\n", global_grid); fprintf(stderr, "ECCODES DEBUG grib_util: expandBoundingBox = %d\n", expandBoundingBox); - print_values(h->context,spec,data_values,data_values_count,values,count); + print_values(h->context, spec, data_values, data_values_count, values, count); } /* Apply adjustments to bounding box if needed */ if (expandBoundingBox) { - if ((*err=expand_bounding_box(outh, values, count)) != 0) - { - fprintf(stderr,"SET_GRID_DATA_DESCRIPTION: Cannot expand bounding box: %s\n",grib_get_error_message(*err)); - if (h->context->write_on_fail) grib_write_message(outh,"error.grib","w"); + if ((*err = expand_bounding_box(outh, values, count)) != 0) { + fprintf(stderr, "SET_GRID_DATA_DESCRIPTION: Cannot expand bounding box: %s\n", grib_get_error_message(*err)); + if (h->context->write_on_fail) + grib_write_message(outh, "error.grib", "w"); goto cleanup; } } - if (convertEditionEarlier && packing_spec->editionNumber>1) { - *err = grib_set_long(outh,"edition", packing_spec->editionNumber); - if(*err) { - fprintf(stderr,"SET_GRID_DATA_DESCRIPTION: Cannot convert to edition %ld.\n",packing_spec->editionNumber); + if (convertEditionEarlier && packing_spec->editionNumber > 1) { + *err = grib_set_long(outh, "edition", packing_spec->editionNumber); + if (*err) { + fprintf(stderr, "SET_GRID_DATA_DESCRIPTION: Cannot convert to edition %ld.\n", packing_spec->editionNumber); goto cleanup; } } - if((*err = grib_set_values(outh,values,count)) != 0) - { - fprintf(stderr,"SET_GRID_DATA_DESCRIPTION: Cannot set key values: %s\n",grib_get_error_message(*err)); + if ((*err = grib_set_values(outh, values, count)) != 0) { + fprintf(stderr, "SET_GRID_DATA_DESCRIPTION: Cannot set key values: %s\n", grib_get_error_message(*err)); - for(i = 0; i < count; i++) - if(values[i].error) - fprintf(stderr," %s %s\n",values[i].name,grib_get_error_message(values[i].error)); + for (i = 0; i < count; i++) + if (values[i].error) + fprintf(stderr, " %s %s\n", values[i].name, grib_get_error_message(values[i].error)); goto cleanup; } - if((*err = grib_set_double_array(outh,"values",data_values,data_values_count)) != 0) - { + if ((*err = grib_set_double_array(outh, "values", data_values, data_values_count)) != 0) { FILE* ferror; - size_t ii,lcount; - grib_context* c=grib_context_get_default(); - - ferror=fopen("error.data","w"); - lcount=0; - fprintf(ferror,"# data_values_count=%ld\n",(long)data_values_count); - fprintf(ferror,"set values={ "); - for (ii=0;ii10) {fprintf(ferror,"\n");lcount=0;} + size_t ii, lcount; + grib_context* c = grib_context_get_default(); + + ferror = fopen("error.data", "w"); + lcount = 0; + fprintf(ferror, "# data_values_count=%ld\n", (long)data_values_count); + fprintf(ferror, "set values={ "); + for (ii = 0; ii < data_values_count - 1; ii++) { + fprintf(ferror, "%g, ", data_values[ii]); + if (lcount > 10) { + fprintf(ferror, "\n"); + lcount = 0; + } lcount++; } - fprintf(ferror,"%g }",data_values[data_values_count-1]); + fprintf(ferror, "%g }", data_values[data_values_count - 1]); fclose(ferror); if (c->write_on_fail) - grib_write_message(outh,"error.grib","w"); + grib_write_message(outh, "error.grib", "w"); goto cleanup; } @@ -1532,12 +1599,12 @@ grib_handle* grib_util_set_spec2(grib_handle* h, if (grib1_high_resolution_fix) { /* GRIB-863: must set increments to MISSING */ /* increments are not coded in message but computed */ - if ( (*err = grib_set_missing(outh, "iDirectionIncrement"))!=0 ) { - fprintf(stderr,"GRIB_UTIL_SET_SPEC: Cannot set Di to missing: %s\n",grib_get_error_message(*err)); + if ((*err = grib_set_missing(outh, "iDirectionIncrement")) != 0) { + fprintf(stderr, "GRIB_UTIL_SET_SPEC: Cannot set Di to missing: %s\n", grib_get_error_message(*err)); goto cleanup; } - if ( (*err = grib_set_missing(outh, "jDirectionIncrement"))!=0 ){ - fprintf(stderr,"GRIB_UTIL_SET_SPEC: Cannot set Dj to missing: %s\n",grib_get_error_message(*err)); + if ((*err = grib_set_missing(outh, "jDirectionIncrement")) != 0) { + fprintf(stderr, "GRIB_UTIL_SET_SPEC: Cannot set Dj to missing: %s\n", grib_get_error_message(*err)); goto cleanup; } } @@ -1545,53 +1612,57 @@ grib_handle* grib_util_set_spec2(grib_handle* h, /*grib_dump_content(outh, stdout,"debug", ~0, NULL);*/ /* convert to second_order if not constant field. (Also see ECC-326) */ - if (setSecondOrder ) { - int constant = 0; - double missingValue=0; - grib_get_double(outh,"missingValue",&missingValue); + if (setSecondOrder) { + int constant = 0; + double missingValue = 0; + grib_get_double(outh, "missingValue", &missingValue); constant = is_constant_field(missingValue, data_values, data_values_count); if (!constant) { - if (editionNumber == 1 ) { - long numberOfGroups=0; - grib_handle* htmp=grib_handle_clone(outh); + if (editionNumber == 1) { + long numberOfGroups = 0; + grib_handle* htmp = grib_handle_clone(outh); - slen=17; - grib_set_string(htmp,"packingType","grid_second_order",&slen); - grib_get_long(htmp,"numberOfGroups",&numberOfGroups); + slen = 17; + grib_set_string(htmp, "packingType", "grid_second_order", &slen); + grib_get_long(htmp, "numberOfGroups", &numberOfGroups); /* GRIBEX is not able to decode overflown numberOfGroups with SPD */ - if (numberOfGroups>65534 && outh->context->no_spd) { - slen=24; - grib_set_string(outh,"packingType","grid_second_order_no_SPD",&slen); + if (numberOfGroups > 65534 && outh->context->no_spd) { + slen = 24; + grib_set_string(outh, "packingType", "grid_second_order_no_SPD", &slen); grib_handle_delete(htmp); - } else { + } + else { grib_handle_delete(outh); - outh=htmp; + outh = htmp; } - } else { - slen=17; - grib_set_string(outh,"packingType","grid_second_order",&slen); - *err = grib_set_double_array(outh,"values", data_values, data_values_count); + } + else { + slen = 17; + grib_set_string(outh, "packingType", "grid_second_order", &slen); + *err = grib_set_double_array(outh, "values", data_values, data_values_count); if (*err != GRIB_SUCCESS) { - fprintf(stderr,"GRIB_UTIL_SET_SPEC: setting data values failed! %s\n", grib_get_error_message(*err)); + fprintf(stderr, "GRIB_UTIL_SET_SPEC: setting data values failed! %s\n", grib_get_error_message(*err)); goto cleanup; } } - } else { + } + else { if (outh->context->gribex_mode_on) { - outh->context->gribex_mode_on=0; - grib_set_double_array(outh,"values", data_values, data_values_count); - outh->context->gribex_mode_on=1; + outh->context->gribex_mode_on = 0; + grib_set_double_array(outh, "values", data_values, data_values_count); + outh->context->gribex_mode_on = 1; } } } - if (packing_spec->editionNumber && packing_spec->editionNumber!=editionNumber) { - *err = grib_set_long(outh,"edition", packing_spec->editionNumber); + if (packing_spec->editionNumber && packing_spec->editionNumber != editionNumber) { + *err = grib_set_long(outh, "edition", packing_spec->editionNumber); if (*err != GRIB_SUCCESS) { - fprintf(stderr,"GRIB_UTIL_SET_SPEC: Failed to change edition to %ld: %s\n", + fprintf(stderr, "GRIB_UTIL_SET_SPEC: Failed to change edition to %ld: %s\n", packing_spec->editionNumber, grib_get_error_message(*err)); - if (h->context->write_on_fail) grib_write_message(outh,"error.grib","w"); + if (h->context->write_on_fail) + grib_write_message(outh, "error.grib", "w"); goto cleanup; } } @@ -1602,7 +1673,7 @@ grib_handle* grib_util_set_spec2(grib_handle* h, if (setJpegPacking == 1) { *err = grib_set_string(outh, "packingType", "grid_jpeg", &slen); if (*err != GRIB_SUCCESS) { - fprintf(stderr,"GRIB_UTIL_SET_SPEC: Failed to change packingType to JPEG: %s\n", + fprintf(stderr, "GRIB_UTIL_SET_SPEC: Failed to change packingType to JPEG: %s\n", grib_get_error_message(*err)); goto cleanup; } @@ -1610,7 +1681,7 @@ grib_handle* grib_util_set_spec2(grib_handle* h, if (setCcsdsPacking == 1) { *err = grib_set_string(outh, "packingType", "grid_ccsds", &slen); if (*err != GRIB_SUCCESS) { - fprintf(stderr,"GRIB_UTIL_SET_SPEC: Failed to change packingType to CCSDS: %s\n", + fprintf(stderr, "GRIB_UTIL_SET_SPEC: Failed to change packingType to CCSDS: %s\n", grib_get_error_message(*err)); goto cleanup; } @@ -1618,7 +1689,7 @@ grib_handle* grib_util_set_spec2(grib_handle* h, } if (packing_spec->deleteLocalDefinition) { - grib_set_long(outh,"deleteLocalDefinition", 1); + grib_set_long(outh, "deleteLocalDefinition", 1); } /* ECC-445 */ @@ -1626,11 +1697,10 @@ grib_handle* grib_util_set_spec2(grib_handle* h, Assert(!global_grid); /* ECC-576: "global" should not be set */ } - if ( (*err = check_geometry(outh, spec, data_values_count, global_grid)) != GRIB_SUCCESS) - { - fprintf(stderr,"GRIB_UTIL_SET_SPEC: Geometry check failed! %s\n", grib_get_error_message(*err)); + if ((*err = check_geometry(outh, spec, data_values_count, global_grid)) != GRIB_SUCCESS) { + fprintf(stderr, "GRIB_UTIL_SET_SPEC: Geometry check failed! %s\n", grib_get_error_message(*err)); if (h->context->write_on_fail) - grib_write_message(outh,"error.grib","w"); + grib_write_message(outh, "error.grib", "w"); goto cleanup; } @@ -1649,176 +1719,187 @@ grib_handle* grib_util_set_spec2(grib_handle* h, goto cleanup; } #endif - if (h->context->debug==-1) + if (h->context->debug == -1) fprintf(stderr, "ECCODES DEBUG: grib_util_set_spec end\n"); return outh; cleanup: - if(outh) grib_handle_delete(outh); + if (outh) + grib_handle_delete(outh); return NULL; } -int grib_moments(grib_handle* h,double east,double north,double west,double south,int order,double* moments,long *count) +int grib_moments(grib_handle* h, double east, double north, double west, double south, int order, double* moments, long* count) { - grib_iterator* iter=NULL; - int ret=0,i,j,l; - size_t n=0,numberOfPoints=0; - double *lat,*lon,*values; - double vlat,vlon,val; - double dx,dy,ddx,ddy; - double mass,centroidX,centroidY; + grib_iterator* iter = NULL; + int ret = 0, i, j, l; + size_t n = 0, numberOfPoints = 0; + double *lat, *lon, *values; + double vlat, vlon, val; + double dx, dy, ddx, ddy; + double mass, centroidX, centroidY; double missingValue; - grib_context* c=grib_context_get_default(); - - ret=grib_get_size(h,"values",&n); - if (ret) return ret; - - lat=(double*)grib_context_malloc_clear(c,sizeof(double)*n); - lon=(double*)grib_context_malloc_clear(c,sizeof(double)*n); - values=(double*)grib_context_malloc_clear(c,sizeof(double)*n); - - iter=grib_iterator_new(h,0,&ret); - numberOfPoints=0; - while(grib_iterator_next(iter,&vlat,&vlon,&val)) { - if (vlon>=east && vlon<=west && vlat>=south && vlat<=north) { - lat[numberOfPoints]=vlat; - lon[numberOfPoints]=vlon; - values[numberOfPoints]=val; + grib_context* c = grib_context_get_default(); + + ret = grib_get_size(h, "values", &n); + if (ret) + return ret; + + lat = (double*)grib_context_malloc_clear(c, sizeof(double) * n); + lon = (double*)grib_context_malloc_clear(c, sizeof(double) * n); + values = (double*)grib_context_malloc_clear(c, sizeof(double) * n); + + iter = grib_iterator_new(h, 0, &ret); + numberOfPoints = 0; + while (grib_iterator_next(iter, &vlat, &vlon, &val)) { + if (vlon >= east && vlon <= west && vlat >= south && vlat <= north) { + lat[numberOfPoints] = vlat; + lon[numberOfPoints] = vlon; + values[numberOfPoints] = val; numberOfPoints++; } } grib_iterator_delete(iter); - ret=grib_get_double(h,"missingValue",&missingValue); - - centroidX=0; - centroidY=0; - mass=0; - *count=0; - for (i=0;i1) { - moments[j*order+l]=pow(fabs(moments[j*order+l]),1.0/(j+l)) / *count ; - } else { - moments[j*order+l]/=*count ; + for (j = 0; j < order; j++) { + for (l = 0; l < order; l++) { + if (j + l > 1) { + moments[j * order + l] = pow(fabs(moments[j * order + l]), 1.0 / (j + l)) / *count; + } + else { + moments[j * order + l] /= *count; } } } - grib_context_free(c,lat); - grib_context_free(c,lon); - grib_context_free(c,values); + grib_context_free(c, lat); + grib_context_free(c, lon); + grib_context_free(c, values); (void)mass; return ret; } /* Helper function for 'parse_keyval_string' */ -static void set_value(grib_values* value,char* str,int equal) +static void set_value(grib_values* value, char* str, int equal) { - char *p=0,*q=0,*s=0; - char buf[1000]={0,}; - grib_context* c=grib_context_get_default(); + char *p = 0, *q = 0, *s = 0; + char buf[1000] = {0,}; + grib_context* c = grib_context_get_default(); - value->equal=equal; - q=str; + value->equal = equal; + q = str; - while (*q != '/' && *q!=0 ) q++; - if (*q=='/') { - s=grib_context_strdup(c,q+1); - value->next=(grib_values*)grib_context_malloc_clear(c,sizeof(grib_values)); - value->next->type=value->type; - value->next->name=grib_context_strdup(c,value->name); - set_value(value->next,s,equal); - grib_context_free(c,s); + while (*q != '/' && *q != 0) + q++; + if (*q == '/') { + s = grib_context_strdup(c, q + 1); + value->next = (grib_values*)grib_context_malloc_clear(c, sizeof(grib_values)); + value->next->type = value->type; + value->next->name = grib_context_strdup(c, value->name); + set_value(value->next, s, equal); + grib_context_free(c, s); } - memcpy(buf,str,q-str); + memcpy(buf, str, q - str); switch (value->type) { - case GRIB_TYPE_DOUBLE: - value->double_value = strtod(buf,&p); - if(*p != 0) value->has_value=1; - else if (!strcmp(str,"missing") || - !strcmp(str,"MISSING") || - !strcmp(str,"Missing") ) { - value->type=GRIB_TYPE_MISSING; - value->has_value=1; - } - break; - case GRIB_TYPE_LONG: - value->long_value = strtol(buf,&p,10); - if(*p != 0) value->has_value=1; - else if (!strcmp(buf,"missing") || - !strcmp(buf,"MISSING") || - !strcmp(buf,"Missing") ) { - value->type=GRIB_TYPE_MISSING; - value->has_value=1; - } - break; - case GRIB_TYPE_STRING: - if ( !strcmp(buf,"missing") || - !strcmp(buf,"MISSING") || - !strcmp(buf,"Missing") ) { - value->type=GRIB_TYPE_MISSING; - value->has_value=1; - } else { - value->string_value = grib_context_strdup(c,buf); - value->has_value=1; - } - break; - case GRIB_TYPE_UNDEFINED: - value->long_value = strtol(buf,&p,10); - if(*p == 0) { - value->type = GRIB_TYPE_LONG; - value->has_value=1; - } else { - value->double_value = strtod(buf,&p); - if(*p == 0) { - value->type = GRIB_TYPE_DOUBLE; - value->has_value=1; - } else if ( !strcmp(buf,"missing") || - !strcmp(buf,"MISSING") || - !strcmp(buf,"Missing") ) { - value->type=GRIB_TYPE_MISSING; - value->has_value=1; - } else { - value->string_value = grib_context_strdup(c,buf); - value->type = GRIB_TYPE_STRING; - value->has_value=1; + case GRIB_TYPE_DOUBLE: + value->double_value = strtod(buf, &p); + if (*p != 0) + value->has_value = 1; + else if (!strcmp(str, "missing") || + !strcmp(str, "MISSING") || + !strcmp(str, "Missing")) { + value->type = GRIB_TYPE_MISSING; + value->has_value = 1; } - } - break; + break; + case GRIB_TYPE_LONG: + value->long_value = strtol(buf, &p, 10); + if (*p != 0) + value->has_value = 1; + else if (!strcmp(buf, "missing") || + !strcmp(buf, "MISSING") || + !strcmp(buf, "Missing")) { + value->type = GRIB_TYPE_MISSING; + value->has_value = 1; + } + break; + case GRIB_TYPE_STRING: + if (!strcmp(buf, "missing") || + !strcmp(buf, "MISSING") || + !strcmp(buf, "Missing")) { + value->type = GRIB_TYPE_MISSING; + value->has_value = 1; + } + else { + value->string_value = grib_context_strdup(c, buf); + value->has_value = 1; + } + break; + case GRIB_TYPE_UNDEFINED: + value->long_value = strtol(buf, &p, 10); + if (*p == 0) { + value->type = GRIB_TYPE_LONG; + value->has_value = 1; + } + else { + value->double_value = strtod(buf, &p); + if (*p == 0) { + value->type = GRIB_TYPE_DOUBLE; + value->has_value = 1; + } + else if (!strcmp(buf, "missing") || + !strcmp(buf, "MISSING") || + !strcmp(buf, "Missing")) { + value->type = GRIB_TYPE_MISSING; + value->has_value = 1; + } + else { + value->string_value = grib_context_strdup(c, buf); + value->type = GRIB_TYPE_STRING; + value->has_value = 1; + } + } + break; } } @@ -1833,63 +1914,70 @@ static void set_value(grib_values* value,char* str,int equal) int parse_keyval_string(const char* grib_tool, char* arg, int values_required, int default_type, grib_values values[], int* count) { char* p; - int i=0; + int i = 0; if (arg == NULL) { - *count=0; + *count = 0; return GRIB_SUCCESS; } - p=strtok(arg,","); + p = strtok(arg, ","); while (p != NULL) { - values[i].name=(char*)calloc(1,strlen(p)+1); + values[i].name = (char*)calloc(1, strlen(p) + 1); Assert(values[i].name); - strcpy((char*)values[i].name,p); - p=strtok(NULL,","); + strcpy((char*)values[i].name, p); + p = strtok(NULL, ","); i++; - if (i > *count) return GRIB_ARRAY_TOO_SMALL; + if (i > *count) + return GRIB_ARRAY_TOO_SMALL; } - *count=i; + *count = i; - for (i=0;i<*count;i++) { - int equal=1; - char* value=NULL; + for (i = 0; i < *count; i++) { + int equal = 1; + char* value = NULL; if (values_required) { /* Can be either k=v or k!=v */ - p=(char*)values[i].name; - while( *p != '=' && *p != '!' && *p != '\0') p++; + p = (char*)values[i].name; + while (*p != '=' && *p != '!' && *p != '\0') + p++; if (*p == '=') { - *p='\0'; + *p = '\0'; p++; - value=p; - equal=1; - } else if (*p == '!' && *(++p) == '=' ) { - *p='\0'; - *(p-1)='\0'; + value = p; + equal = 1; + } + else if (*p == '!' && *(++p) == '=') { + *p = '\0'; + *(p - 1) = '\0'; p++; - value=p; - equal=0; - } else { + value = p; + equal = 0; + } + else { return GRIB_INVALID_ARGUMENT; } } - p=(char*)values[i].name; - while(*p != ':' && *p != '\0') p++; - if ( *p == ':' ) { - values[i].type = grib_type_to_int(*(p+1)); - if (*(p+1)=='n') values[i].type = GRIB_NAMESPACE; - *p='\0'; + p = (char*)values[i].name; + while (*p != ':' && *p != '\0') p++; - } else { + if (*p == ':') { + values[i].type = grib_type_to_int(*(p + 1)); + if (*(p + 1) == 'n') + values[i].type = GRIB_NAMESPACE; + *p = '\0'; + p++; + } + else { values[i].type = default_type; } if (values_required) { - if (strlen(value)==0) { + if (strlen(value) == 0) { if (grib_tool) printf("%s error: no value provided for key \"%s\"\n", grib_tool, values[i].name); else printf("Error: no value provided for key \"%s\"\n", values[i].name); return GRIB_INVALID_ARGUMENT; } - set_value(&values[i],value,equal); + set_value(&values[i], value, equal); } } return GRIB_SUCCESS; @@ -1899,10 +1987,10 @@ int parse_keyval_string(const char* grib_tool, char* arg, int values_required, i int grib2_is_PDTN_EPS(long productDefinitionTemplateNumber) { return ( - productDefinitionTemplateNumber == 1 || productDefinitionTemplateNumber == 11 || - productDefinitionTemplateNumber ==33 || productDefinitionTemplateNumber == 34 || /*simulated (synthetic) satellite data*/ - productDefinitionTemplateNumber ==41 || productDefinitionTemplateNumber == 43 || /*atmospheric chemical constituents*/ - productDefinitionTemplateNumber ==45 || productDefinitionTemplateNumber == 47 /*aerosols*/ + productDefinitionTemplateNumber == 1 || productDefinitionTemplateNumber == 11 || + productDefinitionTemplateNumber == 33 || productDefinitionTemplateNumber == 34 || /*simulated (synthetic) satellite data*/ + productDefinitionTemplateNumber == 41 || productDefinitionTemplateNumber == 43 || /*atmospheric chemical constituents*/ + productDefinitionTemplateNumber == 45 || productDefinitionTemplateNumber == 47 /*aerosols*/ ); } @@ -1910,10 +1998,10 @@ int grib2_is_PDTN_EPS(long productDefinitionTemplateNumber) int grib2_is_PDTN_Chemical(long productDefinitionTemplateNumber) { return ( - productDefinitionTemplateNumber == 40 || - productDefinitionTemplateNumber == 41 || - productDefinitionTemplateNumber == 42 || - productDefinitionTemplateNumber == 43); + productDefinitionTemplateNumber == 40 || + productDefinitionTemplateNumber == 41 || + productDefinitionTemplateNumber == 42 || + productDefinitionTemplateNumber == 43); } /* Return 1 if the productDefinitionTemplateNumber (GRIB2) is for @@ -1921,22 +2009,22 @@ int grib2_is_PDTN_Chemical(long productDefinitionTemplateNumber) int grib2_is_PDTN_ChemicalDistFunc(long productDefinitionTemplateNumber) { return ( - productDefinitionTemplateNumber == 57 || - productDefinitionTemplateNumber == 58 || - productDefinitionTemplateNumber == 67 || - productDefinitionTemplateNumber == 68); + productDefinitionTemplateNumber == 57 || + productDefinitionTemplateNumber == 58 || + productDefinitionTemplateNumber == 67 || + productDefinitionTemplateNumber == 68); } /* Return 1 if the productDefinitionTemplateNumber (GRIB2) is for aerosols */ int grib2_is_PDTN_Aerosol(long productDefinitionTemplateNumber) { return ( - productDefinitionTemplateNumber == 44 || /* Note: PDT 44 is deprecated. Use 48 instead */ - productDefinitionTemplateNumber == 48 || - productDefinitionTemplateNumber == 49 || - productDefinitionTemplateNumber == 45 || - productDefinitionTemplateNumber == 46 || - productDefinitionTemplateNumber == 47); + productDefinitionTemplateNumber == 44 || /* Note: PDT 44 is deprecated. Use 48 instead */ + productDefinitionTemplateNumber == 48 || + productDefinitionTemplateNumber == 49 || + productDefinitionTemplateNumber == 45 || + productDefinitionTemplateNumber == 46 || + productDefinitionTemplateNumber == 47); } /* Return 1 if the productDefinitionTemplateNumber (GRIB2) is for optical properties of aerosol */ @@ -1946,8 +2034,8 @@ int grib2_is_PDTN_AerosolOptical(long productDefinitionTemplateNumber) * For the former user must set the optical wavelength range to missing. */ return ( - productDefinitionTemplateNumber == 48 || - productDefinitionTemplateNumber == 49); + productDefinitionTemplateNumber == 48 || + productDefinitionTemplateNumber == 49); } /* Given some information about the type of grib2 parameter, return the productDefinitionTemplateNumber to use. @@ -1965,75 +2053,105 @@ int grib2_select_PDTN(int is_eps, int is_instant, /* At most one has to be set. All could be 0 */ /* Unfortunately if PDTN=48 then both aerosol and aerosol_optical can be 1! */ const int sum = is_chemical + is_chemical_distfn + is_aerosol + is_aerosol_optical; - Assert( sum == 0 || sum == 1 || sum == 2 ); + Assert(sum == 0 || sum == 1 || sum == 2); if (is_chemical) { if (is_eps) { - if (is_instant) return 41; - else return 43; - } else { - if (is_instant) return 40; - else return 42; + if (is_instant) + return 41; + else + return 43; + } + else { + if (is_instant) + return 40; + else + return 42; } } if (is_chemical_distfn) { if (is_eps) { - if (is_instant) return 58; - else return 68; - } else { - if (is_instant) return 57; - else return 67; + if (is_instant) + return 58; + else + return 68; + } + else { + if (is_instant) + return 57; + else + return 67; } } if (is_aerosol_optical) { if (is_eps) { - if (is_instant) return 49; + if (is_instant) + return 49; /* WMO does not have a non-instantaneous case here! */ - } else { - if (is_instant) return 48; + } + else { + if (is_instant) + return 48; /* WMO does not have a non-instantaneous case here! */ } } if (is_aerosol) { if (is_eps) { - if (is_instant) return 45; - else return 47; - } else { - if (is_instant) return 48;/*44 is deprecated*/ - else return 46; + if (is_instant) + return 45; + else + return 47; + } + else { + if (is_instant) + return 48; /*44 is deprecated*/ + else + return 46; } } /* Fallthru case: default */ if (is_eps) { - if (is_instant) return 1; - else return 11; - } else { - if (is_instant) return 0; - else return 8; + if (is_instant) + return 1; + else + return 11; + } + else { + if (is_instant) + return 0; + else + return 8; } } int is_grib_index_file(const char* filename) { FILE* fh; - char buf[8]={0,}; - const char* str="GRBIDX"; - int ret=0; - size_t size = 0; + char buf[8] = {0,}; + const char* str = "GRBIDX"; + int ret = 0; + size_t size = 0; - fh=fopen(filename,"r"); - if (!fh) return 0; + fh = fopen(filename, "r"); + if (!fh) + return 0; - size=fread(buf,1,1,fh); - if (size != 1) {fclose(fh); return 0;} - size=fread(buf,6,1,fh); - if (size != 1) {fclose(fh); return 0;} + size = fread(buf, 1, 1, fh); + if (size != 1) { + fclose(fh); + return 0; + } + size = fread(buf, 6, 1, fh); + if (size != 1) { + fclose(fh); + return 0; + } - ret=!strcmp(buf,str); + ret = !strcmp(buf, str); fclose(fh); @@ -2042,8 +2160,8 @@ int is_grib_index_file(const char* filename) size_t sum_of_pl_array(const long* pl, size_t plsize) { - long i, count=0; - for (i=0;icontext; - int is_error = 1; + int is_error = 1; /* * If grib_data_quality_checks == 1, limits failure results in an error * If grib_data_quality_checks == 2, limits failure results in a warning */ - Assert( ctx->grib_data_quality_checks == 1 || ctx->grib_data_quality_checks == 2 ); + Assert(ctx->grib_data_quality_checks == 1 || ctx->grib_data_quality_checks == 2); is_error = (ctx->grib_data_quality_checks == 1); /* The limit keys must exist if we are here */ err = grib_get_long(h, "param_value_min", &min_field_value_allowed); if (err) { - grib_context_log(ctx, GRIB_LOG_ERROR,"grib_data_quality_check: Could not get param_value_min"); + grib_context_log(ctx, GRIB_LOG_ERROR, "grib_data_quality_check: Could not get param_value_min"); return err; } err = grib_get_long(h, "param_value_max", &max_field_value_allowed); if (err) { - grib_context_log(ctx, GRIB_LOG_ERROR,"grib_data_quality_check: Could not get param_value_max"); + grib_context_log(ctx, GRIB_LOG_ERROR, "grib_data_quality_check: Could not get param_value_max"); return err; } @@ -2091,13 +2209,14 @@ int grib_util_grib_data_quality_check(grib_handle* h, double min_val, double max if (min_val < dmin_allowed) { char description[1024] = {0,}; - if (get_concept_condition_string(h, "param_value_min", NULL, description)==GRIB_SUCCESS) { + if (get_concept_condition_string(h, "param_value_min", NULL, description) == GRIB_SUCCESS) { fprintf(stderr, "ECCODES %s : (%s): minimum (%g) is less than the allowable limit (%g)\n", - (is_error? "ERROR":"WARNING"), description, min_val, dmin_allowed); - } else { + (is_error ? "ERROR" : "WARNING"), description, min_val, dmin_allowed); + } + else { if (grib_get_long(h, "paramId", ¶mId) == GRIB_SUCCESS) { fprintf(stderr, "ECCODES %s : (paramId=%ld): minimum (%g) is less than the default allowable limit (%g)\n", - (is_error? "ERROR":"WARNING"), paramId, min_val, dmin_allowed); + (is_error ? "ERROR" : "WARNING"), paramId, min_val, dmin_allowed); } } if (is_error) { @@ -2106,13 +2225,14 @@ int grib_util_grib_data_quality_check(grib_handle* h, double min_val, double max } if (max_val > dmax_allowed) { char description[1024] = {0,}; - if (get_concept_condition_string(h, "param_value_max", NULL, description)==GRIB_SUCCESS) { + if (get_concept_condition_string(h, "param_value_max", NULL, description) == GRIB_SUCCESS) { fprintf(stderr, "ECCODES %s : (%s): maximum (%g) is more than the allowable limit (%g)\n", - (is_error? "ERROR":"WARNING"), description, max_val, dmax_allowed); - } else { + (is_error ? "ERROR" : "WARNING"), description, max_val, dmax_allowed); + } + else { if (grib_get_long(h, "paramId", ¶mId) == GRIB_SUCCESS) { fprintf(stderr, "ECCODES %s : (paramId=%ld): maximum (%g) is more than the default allowable limit (%g)\n", - (is_error? "ERROR":"WARNING"), paramId, max_val, dmax_allowed); + (is_error ? "ERROR" : "WARNING"), paramId, max_val, dmax_allowed); } } if (is_error) { diff --git a/src/grib_value.c b/src/grib_value.c index 2f2e6307d..45b735d33 100644 --- a/src/grib_value.c +++ b/src/grib_value.c @@ -15,25 +15,28 @@ /* Note: A fast cut-down version of strcmp which does NOT return -1 */ /* 0 means input strings are equal and 1 means not equal */ -GRIB_INLINE static int grib_inline_strcmp(const char* a,const char* b) +GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b) { - if (*a != *b) return 1; - while((*a!=0 && *b!=0) && *(a) == *(b) ) {a++;b++;} - return (*a==0 && *b==0) ? 0 : 1; + if (*a != *b) + return 1; + while ((*a != 0 && *b != 0) && *(a) == *(b)) { + a++; + b++; + } + return (*a == 0 && *b == 0) ? 0 : 1; } -int grib_set_expression(grib_handle* h, const char* name,grib_expression* e) +int grib_set_expression(grib_handle* h, const char* name, grib_expression* e) { grib_accessor* a = grib_find_accessor(h, name); - int ret = GRIB_SUCCESS; + int ret = GRIB_SUCCESS; - if(a){ - - if(a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) + if (a) { + if (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) return GRIB_READ_ONLY; ret = grib_pack_expression(a, e); - if(ret == GRIB_SUCCESS){ + if (ret == GRIB_SUCCESS) { return grib_dependency_notify_change(a); } return ret; @@ -41,14 +44,14 @@ int grib_set_expression(grib_handle* h, const char* name,grib_expression* e) return GRIB_NOT_FOUND; } -int grib_set_expression_internal(grib_handle* h, const char* name,grib_expression* e) +int grib_set_expression_internal(grib_handle* h, const char* name, grib_expression* e) { grib_accessor* a = grib_find_accessor(h, name); int ret = GRIB_SUCCESS; - if(a){ + if (a) { ret = grib_pack_expression(a, e); - if(ret == GRIB_SUCCESS){ + if (ret == GRIB_SUCCESS) { return grib_dependency_notify_change(a); } return ret; @@ -58,48 +61,48 @@ int grib_set_expression_internal(grib_handle* h, const char* name,grib_expressio int grib_set_long_internal(grib_handle* h, const char* name, long val) { - grib_context* c=h->context; - int ret = GRIB_SUCCESS; - grib_accessor* a =NULL; - size_t l = 1; + grib_context* c = h->context; + int ret = GRIB_SUCCESS; + grib_accessor* a = NULL; + size_t l = 1; a = grib_find_accessor(h, name); if (h->context->debug) - fprintf(stderr, "ECCODES DEBUG grib_set_long_internal %s=%ld\n",name,(long)val); + fprintf(stderr, "ECCODES DEBUG grib_set_long_internal %s=%ld\n", name, (long)val); - if(a){ + if (a) { ret = grib_pack_long(a, &val, &l); - if(ret == GRIB_SUCCESS){ + if (ret == GRIB_SUCCESS) { return grib_dependency_notify_change(a); } - grib_context_log(c,GRIB_LOG_ERROR,"unable to set %s=%ld as long (%s)", - name,val,grib_get_error_message(ret)); + grib_context_log(c, GRIB_LOG_ERROR, "unable to set %s=%ld as long (%s)", + name, val, grib_get_error_message(ret)); return ret; } - grib_context_log(c,GRIB_LOG_ERROR,"unable to find accessor %s",name); + grib_context_log(c, GRIB_LOG_ERROR, "unable to find accessor %s", name); return GRIB_NOT_FOUND; } int grib_set_long(grib_handle* h, const char* name, long val) { - int ret = GRIB_SUCCESS; - grib_accessor* a =NULL; - size_t l = 1; + int ret = GRIB_SUCCESS; + grib_accessor* a = NULL; + size_t l = 1; a = grib_find_accessor(h, name); if (h->context->debug) - fprintf(stderr, "ECCODES DEBUG grib_set_long %s=%ld\n",name,(long)val); + fprintf(stderr, "ECCODES DEBUG grib_set_long %s=%ld\n", name, (long)val); - if(a){ - if(a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) + if (a) { + if (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) return GRIB_READ_ONLY; ret = grib_pack_long(a, &val, &l); - if(ret == GRIB_SUCCESS) + if (ret == GRIB_SUCCESS) return grib_dependency_notify_change(a); return ret; @@ -109,32 +112,33 @@ int grib_set_long(grib_handle* h, const char* name, long val) int grib_set_double_internal(grib_handle* h, const char* name, double val) { - int ret = GRIB_SUCCESS; - grib_accessor* a =NULL; - size_t l = 1; + int ret = GRIB_SUCCESS; + grib_accessor* a = NULL; + size_t l = 1; a = grib_find_accessor(h, name); if (h->context->debug) - fprintf(stderr, "ECCODES DEBUG grib_set_double_internal %s=%g\n",name,val); + fprintf(stderr, "ECCODES DEBUG grib_set_double_internal %s=%g\n", name, val); - if(a){ + if (a) { ret = grib_pack_double(a, &val, &l); - if(ret == GRIB_SUCCESS){ + if (ret == GRIB_SUCCESS) { return grib_dependency_notify_change(a); } - grib_context_log(h->context,GRIB_LOG_ERROR,"unable to set %s=%g as double (%s)", - name,val,grib_get_error_message(ret)); + grib_context_log(h->context, GRIB_LOG_ERROR, "unable to set %s=%g as double (%s)", + name, val, grib_get_error_message(ret)); return ret; } - grib_context_log(h->context,GRIB_LOG_ERROR,"unable to find accessor %s",name); + grib_context_log(h->context, GRIB_LOG_ERROR, "unable to find accessor %s", name); return GRIB_NOT_FOUND; } typedef struct grib_key_err grib_key_err; -struct grib_key_err { +struct grib_key_err +{ char* name; int err; grib_key_err* next; @@ -142,159 +146,164 @@ struct grib_key_err { int grib_copy_namespace(grib_handle* dest, const char* name, grib_handle* src) { - int *err=NULL; - int type, error_code=0; + int* err = NULL; + int type, error_code = 0; size_t len; - char *sval = NULL; - unsigned char *uval = NULL; - double *dval = NULL; - long *lval = NULL; - grib_key_err* key_err=NULL; - grib_key_err* first=NULL; - int todo=1,count=0; + char* sval = NULL; + unsigned char* uval = NULL; + double* dval = NULL; + long* lval = NULL; + grib_key_err* key_err = NULL; + grib_key_err* first = NULL; + int todo = 1, count = 0; - grib_keys_iterator* iter=NULL; + grib_keys_iterator* iter = NULL; - if (!dest || !src) return GRIB_NULL_HANDLE; + if (!dest || !src) + return GRIB_NULL_HANDLE; - iter=grib_keys_iterator_new(src,0,name); + iter = grib_keys_iterator_new(src, 0, name); if (!iter) { - grib_context_log(src->context,GRIB_LOG_ERROR,"grib_copy_namespace: unable to get iterator for %s",name ); + grib_context_log(src->context, GRIB_LOG_ERROR, "grib_copy_namespace: unable to get iterator for %s", name); return GRIB_INTERNAL_ERROR; } - while(grib_keys_iterator_next(iter)) { - grib_key_err* k=(grib_key_err*)grib_context_malloc_clear(src->context,sizeof(grib_key_err)); - k->err=GRIB_NOT_FOUND; - k->name=grib_context_strdup(src->context,grib_keys_iterator_get_name(iter)); - if (key_err==NULL) { - key_err=k; - first=k; - } else { - key_err->next=k; - key_err=key_err->next; + while (grib_keys_iterator_next(iter)) { + grib_key_err* k = (grib_key_err*)grib_context_malloc_clear(src->context, sizeof(grib_key_err)); + k->err = GRIB_NOT_FOUND; + k->name = grib_context_strdup(src->context, grib_keys_iterator_get_name(iter)); + if (key_err == NULL) { + key_err = k; + first = k; + } + else { + key_err->next = k; + key_err = key_err->next; } } - count=0; - todo=1; - while (todo && count<4) { - grib_accessor* a=NULL; - key_err=first; - while(key_err) { - char* key=key_err->name; - err=&(key_err->err); + count = 0; + todo = 1; + while (todo && count < 4) { + grib_accessor* a = NULL; + key_err = first; + while (key_err) { + char* key = key_err->name; + err = &(key_err->err); - if (*err==GRIB_SUCCESS) { - key_err=key_err->next; + if (*err == GRIB_SUCCESS) { + key_err = key_err->next; continue; } - if ((a=grib_find_accessor(dest,key))==NULL) { - key_err->err=GRIB_NOT_FOUND; - key_err=key_err->next; + if ((a = grib_find_accessor(dest, key)) == NULL) { + key_err->err = GRIB_NOT_FOUND; + key_err = key_err->next; continue; } if (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) { - key_err->err=GRIB_SUCCESS; - key_err=key_err->next; + key_err->err = GRIB_SUCCESS; + key_err = key_err->next; continue; } - if ( grib_is_missing(src,key,err) && *err == 0 && (*err=grib_set_missing(dest,key))) { - if ( *err!=GRIB_SUCCESS && *err!=GRIB_NOT_FOUND) return *err; - key_err=key_err->next; + if (grib_is_missing(src, key, err) && *err == 0 && (*err = grib_set_missing(dest, key))) { + if (*err != GRIB_SUCCESS && *err != GRIB_NOT_FOUND) + return *err; + key_err = key_err->next; continue; } - if ((*err=grib_get_native_type(dest,key,&type))!=GRIB_SUCCESS) { - if ( *err!=GRIB_SUCCESS && *err!=GRIB_NOT_FOUND) return *err; - key_err=key_err->next; + if ((*err = grib_get_native_type(dest, key, &type)) != GRIB_SUCCESS) { + if (*err != GRIB_SUCCESS && *err != GRIB_NOT_FOUND) + return *err; + key_err = key_err->next; continue; } - if((*err = grib_get_size(src,key,&len)) != GRIB_SUCCESS) return *err; + if ((*err = grib_get_size(src, key, &len)) != GRIB_SUCCESS) + return *err; switch (type) { - case GRIB_TYPE_STRING: - len=512; - sval = (char*)grib_context_malloc(src->context,len*sizeof(char)); + case GRIB_TYPE_STRING: + len = 512; + sval = (char*)grib_context_malloc(src->context, len * sizeof(char)); - if((*err = grib_get_string(src,key,sval,&len)) != GRIB_SUCCESS) - return *err; + if ((*err = grib_get_string(src, key, sval, &len)) != GRIB_SUCCESS) + return *err; - if((*err = grib_set_string(dest,key,sval,&len)) != GRIB_SUCCESS) - return *err; + if ((*err = grib_set_string(dest, key, sval, &len)) != GRIB_SUCCESS) + return *err; - grib_context_free(src->context,sval); - break; + grib_context_free(src->context, sval); + break; - case GRIB_TYPE_LONG: - lval = (long*)grib_context_malloc(src->context,len*sizeof(long)); + case GRIB_TYPE_LONG: + lval = (long*)grib_context_malloc(src->context, len * sizeof(long)); - if((*err = grib_get_long_array(src,key,lval,&len)) != GRIB_SUCCESS) - return *err; + if ((*err = grib_get_long_array(src, key, lval, &len)) != GRIB_SUCCESS) + return *err; - if((*err = grib_set_long_array(dest,key,lval,len)) != GRIB_SUCCESS) - return *err; + if ((*err = grib_set_long_array(dest, key, lval, len)) != GRIB_SUCCESS) + return *err; - grib_context_free(src->context,lval); - break; + grib_context_free(src->context, lval); + break; - case GRIB_TYPE_DOUBLE: - dval = (double*)grib_context_malloc(src->context,len*sizeof(double)); + case GRIB_TYPE_DOUBLE: + dval = (double*)grib_context_malloc(src->context, len * sizeof(double)); - if((*err = grib_get_double_array(src,key,dval,&len)) != GRIB_SUCCESS) - return *err; + if ((*err = grib_get_double_array(src, key, dval, &len)) != GRIB_SUCCESS) + return *err; - if((*err = grib_set_double_array(dest,key,dval,len)) != GRIB_SUCCESS) - return *err; + if ((*err = grib_set_double_array(dest, key, dval, len)) != GRIB_SUCCESS) + return *err; - grib_context_free(src->context,dval); - break; + grib_context_free(src->context, dval); + break; - case GRIB_TYPE_BYTES: - if (len==0) len=512; - uval = (unsigned char *)grib_context_malloc(src->context,len*sizeof(unsigned char)); + case GRIB_TYPE_BYTES: + if (len == 0) + len = 512; + uval = (unsigned char*)grib_context_malloc(src->context, len * sizeof(unsigned char)); - if((*err = grib_get_bytes(src,key,uval,&len)) != GRIB_SUCCESS) - return *err; + if ((*err = grib_get_bytes(src, key, uval, &len)) != GRIB_SUCCESS) + return *err; - if((*err = grib_get_bytes(dest,key,uval,&len)) != GRIB_SUCCESS) - return *err; + if ((*err = grib_get_bytes(dest, key, uval, &len)) != GRIB_SUCCESS) + return *err; - grib_context_free(src->context,uval); + grib_context_free(src->context, uval); - break; + break; - default: - break; + default: + break; } - key_err=key_err->next; - + key_err = key_err->next; } count++; - key_err=first; - todo=0; - while(key_err) { - if (key_err->err==GRIB_NOT_FOUND) { - todo=1; + key_err = first; + todo = 0; + while (key_err) { + if (key_err->err == GRIB_NOT_FOUND) { + todo = 1; break; } - key_err=key_err->next; + key_err = key_err->next; } } if (err) error_code = *err; /* copy the error code before cleanup */ grib_keys_iterator_delete(iter); - key_err=first; + key_err = first; while (key_err) { - grib_key_err* next=key_err->next; - grib_context_free(src->context,key_err->name); - grib_context_free(src->context,key_err); - key_err=next; + grib_key_err* next = key_err->next; + grib_context_free(src->context, key_err->name); + grib_context_free(src->context, key_err); + key_err = next; } return error_code; @@ -302,22 +311,21 @@ int grib_copy_namespace(grib_handle* dest, const char* name, grib_handle* src) int grib_set_double(grib_handle* h, const char* name, double val) { - int ret = GRIB_SUCCESS; - grib_accessor* a =NULL; - size_t l = 1; + int ret = GRIB_SUCCESS; + grib_accessor* a = NULL; + size_t l = 1; a = grib_find_accessor(h, name); if (h->context->debug) - fprintf(stderr, "ECCODES DEBUG grib_set_double %s=%g\n",name,val); - - if(a){ + fprintf(stderr, "ECCODES DEBUG grib_set_double %s=%g\n", name, val); - if(a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) + if (a) { + if (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) return GRIB_READ_ONLY; ret = grib_pack_double(a, &val, &l); - if(ret == GRIB_SUCCESS) + if (ret == GRIB_SUCCESS) return grib_dependency_notify_change(a); return ret; @@ -326,45 +334,45 @@ int grib_set_double(grib_handle* h, const char* name, double val) } int grib_set_string_internal(grib_handle* h, const char* name, - const char* val, size_t *length) + const char* val, size_t* length) { - int ret = GRIB_SUCCESS; - grib_accessor* a =NULL; + int ret = GRIB_SUCCESS; + grib_accessor* a = NULL; a = grib_find_accessor(h, name); if (h->context->debug) - fprintf(stderr, "ECCODES DEBUG grib_set_string_internal %s=%s\n",name,val); + fprintf(stderr, "ECCODES DEBUG grib_set_string_internal %s=%s\n", name, val); - if(a){ + if (a) { ret = grib_pack_string(a, val, length); - if(ret == GRIB_SUCCESS){ + if (ret == GRIB_SUCCESS) { return grib_dependency_notify_change(a); } - grib_context_log(h->context,GRIB_LOG_ERROR,"unable to set %s=%s as string (%s)", - name,val,grib_get_error_message(ret)); + grib_context_log(h->context, GRIB_LOG_ERROR, "unable to set %s=%s as string (%s)", + name, val, grib_get_error_message(ret)); return ret; } - grib_context_log(h->context,GRIB_LOG_ERROR,"unable to find accessor %s",name); + grib_context_log(h->context, GRIB_LOG_ERROR, "unable to find accessor %s", name); return GRIB_NOT_FOUND; } -int grib_set_string(grib_handle* h, const char* name, const char* val, size_t *length) +int grib_set_string(grib_handle* h, const char* name, const char* val, size_t* length) { - int ret=0; + int ret = 0; grib_accessor* a = NULL; /* Second order doesn't have a proper representation for constant fields. So best not to do the change of packing type. Use strncmp to catch all flavours of second order packing e.g. grid_second_order_boustrophedonic */ - if (!grib_inline_strcmp(name,"packingType") && !strncmp(val,"grid_second_order", 17)) { - long bitsPerValue=0; + if (!grib_inline_strcmp(name, "packingType") && !strncmp(val, "grid_second_order", 17)) { + long bitsPerValue = 0; size_t numCodedVals = 0; - grib_get_long(h,"bitsPerValue",&bitsPerValue); - if (bitsPerValue==0) { + grib_get_long(h, "bitsPerValue", &bitsPerValue); + if (bitsPerValue == 0) { if (h->context->debug) { fprintf(stderr, "ECCODES DEBUG grib_set_string packingType: Constant field cannot be encoded in second order. Packing not changed\n"); } @@ -384,15 +392,14 @@ int grib_set_string(grib_handle* h, const char* name, const char* val, size_t *l a = grib_find_accessor(h, name); if (h->context->debug) - fprintf(stderr, "ECCODES DEBUG grib_set_string %s=|%s|\n",name,val); + fprintf(stderr, "ECCODES DEBUG grib_set_string %s=|%s|\n", name, val); - if(a) - { - if(a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) + if (a) { + if (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) return GRIB_READ_ONLY; - ret=grib_pack_string(a, val, length); - if(ret == GRIB_SUCCESS){ + ret = grib_pack_string(a, val, length); + if (ret == GRIB_SUCCESS) { return grib_dependency_notify_change(a); } return ret; @@ -402,22 +409,21 @@ int grib_set_string(grib_handle* h, const char* name, const char* val, size_t *l int grib_set_string_array(grib_handle* h, const char* name, const char** val, size_t length) { - int ret=0; + int ret = 0; grib_accessor* a; a = grib_find_accessor(h, name); if (h->context->debug) { - fprintf(stderr, "ECCODES DEBUG grib_set_string_array key=%s %ld values\n",name,(long)length); + fprintf(stderr, "ECCODES DEBUG grib_set_string_array key=%s %ld values\n", name, (long)length); } - if(a) - { - if(a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) + if (a) { + if (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) return GRIB_READ_ONLY; - ret=grib_pack_string_array(a, val, &length); - if(ret == GRIB_SUCCESS){ + ret = grib_pack_string_array(a, val, &length); + if (ret == GRIB_SUCCESS) { return grib_dependency_notify_change(a); } return ret; @@ -425,40 +431,39 @@ int grib_set_string_array(grib_handle* h, const char* name, const char** val, si return GRIB_NOT_FOUND; } -int grib_set_bytes_internal(grib_handle* h, const char* name, const unsigned char* val, size_t *length) +int grib_set_bytes_internal(grib_handle* h, const char* name, const unsigned char* val, size_t* length) { - int ret = GRIB_SUCCESS; - grib_accessor* a =NULL; + int ret = GRIB_SUCCESS; + grib_accessor* a = NULL; a = grib_find_accessor(h, name); - if(a){ + if (a) { ret = grib_pack_bytes(a, val, length); - if(ret == GRIB_SUCCESS){ + if (ret == GRIB_SUCCESS) { return grib_dependency_notify_change(a); } - grib_context_log(h->context,GRIB_LOG_ERROR,"unable to set %s=%ld as bytes (%s)", - name,val,grib_get_error_message(ret)); + grib_context_log(h->context, GRIB_LOG_ERROR, "unable to set %s=%ld as bytes (%s)", + name, val, grib_get_error_message(ret)); return ret; } - grib_context_log(h->context,GRIB_LOG_ERROR,"unable to find accessor %s",name); + grib_context_log(h->context, GRIB_LOG_ERROR, "unable to find accessor %s", name); return GRIB_NOT_FOUND; } -int grib_set_bytes(grib_handle* h, const char* name, const unsigned char* val, size_t *length) +int grib_set_bytes(grib_handle* h, const char* name, const unsigned char* val, size_t* length) { - int ret=0; + int ret = 0; grib_accessor* a = grib_find_accessor(h, name); - if(a) - { + if (a) { /* if(a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) */ /* return GRIB_READ_ONLY; */ - ret=grib_pack_bytes(a, val, length); - if(ret == GRIB_SUCCESS){ + ret = grib_pack_bytes(a, val, length); + if (ret == GRIB_SUCCESS) { return grib_dependency_notify_change(a); } return ret; @@ -468,16 +473,17 @@ int grib_set_bytes(grib_handle* h, const char* name, const unsigned char* val, s int grib_clear(grib_handle* h, const char* name) { - int ret=0; - grib_accessor* a =NULL; + int ret = 0; + grib_accessor* a = NULL; a = grib_find_accessor(h, name); - if(a) { - if (a->length ==0) return 0; - if ((ret=grib_pack_zero(a)) != GRIB_SUCCESS) - grib_context_log(h->context,GRIB_LOG_ERROR,"unable to clear %s (%s)", - name,grib_get_error_message(ret)); + if (a) { + if (a->length == 0) + return 0; + if ((ret = grib_pack_zero(a)) != GRIB_SUCCESS) + grib_context_log(h->context, GRIB_LOG_ERROR, "unable to clear %s (%s)", + name, grib_get_error_message(ret)); return ret; } @@ -487,64 +493,68 @@ int grib_clear(grib_handle* h, const char* name) int grib_set_missing_internal(grib_handle* h, const char* name) { - int ret=0; - grib_accessor* a =NULL; + int ret = 0; + grib_accessor* a = NULL; a = grib_find_accessor(h, name); - if(a) { - if(a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) { - ret=grib_pack_missing(a); - if(ret == GRIB_SUCCESS) + if (a) { + if (a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) { + ret = grib_pack_missing(a); + if (ret == GRIB_SUCCESS) return grib_dependency_notify_change(a); - } else - ret=GRIB_VALUE_CANNOT_BE_MISSING; + } + else + ret = GRIB_VALUE_CANNOT_BE_MISSING; - grib_context_log(h->context,GRIB_LOG_ERROR,"unable to set %s=missing (%s)", - name,grib_get_error_message(ret)); + grib_context_log(h->context, GRIB_LOG_ERROR, "unable to set %s=missing (%s)", + name, grib_get_error_message(ret)); return ret; } - grib_context_log(h->context,GRIB_LOG_ERROR,"unable to find accessor %s",name); + grib_context_log(h->context, GRIB_LOG_ERROR, "unable to find accessor %s", name); return GRIB_NOT_FOUND; } int grib_set_missing(grib_handle* h, const char* name) { - int ret=0; - grib_accessor* a =NULL; + int ret = 0; + grib_accessor* a = NULL; a = grib_find_accessor(h, name); - if(a) { - if(a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) + if (a) { + if (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) return GRIB_READ_ONLY; - if(a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) { - if (h->context->debug) fprintf(stderr, "ECCODES DEBUG grib_set_missing %s\n",name); + if (a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) { + if (h->context->debug) + fprintf(stderr, "ECCODES DEBUG grib_set_missing %s\n", name); - ret=grib_pack_missing(a); - if(ret == GRIB_SUCCESS) + ret = grib_pack_missing(a); + if (ret == GRIB_SUCCESS) return grib_dependency_notify_change(a); - } else ret=GRIB_VALUE_CANNOT_BE_MISSING; + } + else + ret = GRIB_VALUE_CANNOT_BE_MISSING; - grib_context_log(h->context,GRIB_LOG_ERROR,"unable to set %s=missing (%s)", - name,grib_get_error_message(ret)); + grib_context_log(h->context, GRIB_LOG_ERROR, "unable to set %s=missing (%s)", + name, grib_get_error_message(ret)); return ret; } - grib_context_log(h->context,GRIB_LOG_ERROR,"unable to find accessor %s",name); + grib_context_log(h->context, GRIB_LOG_ERROR, "unable to find accessor %s", name); return GRIB_NOT_FOUND; } -int grib_is_missing_long(grib_accessor* a,long x) +int grib_is_missing_long(grib_accessor* a, long x) { - int ret = ( a==NULL || (a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING)) && (x==GRIB_MISSING_LONG) ? 1 : 0; + int ret = (a == NULL || (a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING)) && (x == GRIB_MISSING_LONG) ? 1 : 0; return ret; } -int grib_is_missing_double(grib_accessor* a,double x) +int grib_is_missing_double(grib_accessor* a, double x) { - int ret = ( a==NULL || (a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING)) && (x==GRIB_MISSING_DOUBLE) ? 1 : 0; + int ret = (a == NULL || (a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING)) && (x == GRIB_MISSING_DOUBLE) ? 1 : 0; return ret; } @@ -554,42 +564,41 @@ int grib_is_missing_string(grib_accessor* a, unsigned char* x, size_t len) /* all 1's (i.e. 0xFF) */ /* Note: An empty string is also classified as missing */ int ret; - size_t i=0; - - if (len==0) return 1; /* empty string */ - ret=1; - for (i=0;iflags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) && ret==1 )) ? 1 : 0; + ret = (a == NULL || ((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) && ret == 1)) ? 1 : 0; return ret; } -int grib_accessor_is_missing(grib_accessor* a,int* err) +int grib_accessor_is_missing(grib_accessor* a, int* err) { - *err=GRIB_SUCCESS; - if(a) - { - if(a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) + *err = GRIB_SUCCESS; + if (a) { + if (a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) return grib_is_missing_internal(a); else return 0; } - else - { - *err=GRIB_NOT_FOUND; + else { + *err = GRIB_NOT_FOUND; return 1; } } -int grib_is_missing(const grib_handle* h, const char* name,int* err) +int grib_is_missing(const grib_handle* h, const char* name, int* err) { grib_accessor* a = grib_find_accessor(h, name); - return grib_accessor_is_missing(a,err); + return grib_accessor_is_missing(a, err); } /* Return true if the given key exists (is defined) in our grib message */ @@ -599,45 +608,44 @@ int grib_is_defined(const grib_handle* h, const char* name) return (a ? 1 : 0); } -int grib_set_flag(grib_handle *h,const char* name,unsigned long flag) +int grib_set_flag(grib_handle* h, const char* name, unsigned long flag) { - grib_accessor* a=grib_find_accessor(h,name); + grib_accessor* a = grib_find_accessor(h, name); - if (!a) return GRIB_NOT_FOUND; + if (!a) + return GRIB_NOT_FOUND; - a->flags|=flag; + a->flags |= flag; return GRIB_SUCCESS; } -static int _grib_set_double_array_internal(grib_handle* h,grib_accessor* a, - const double* val, size_t buffer_len,size_t *encoded_length,int check) +static int _grib_set_double_array_internal(grib_handle* h, grib_accessor* a, + const double* val, size_t buffer_len, size_t* encoded_length, int check) { - if(a) { - int err = _grib_set_double_array_internal(h,a->same,val,buffer_len,encoded_length,check); + if (a) { + int err = _grib_set_double_array_internal(h, a->same, val, buffer_len, encoded_length, check); - if(check && (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY)) + if (check && (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY)) return GRIB_READ_ONLY; - if(err == GRIB_SUCCESS) - { + if (err == GRIB_SUCCESS) { size_t len = buffer_len - *encoded_length; - if(len) { - err = grib_pack_double(a, val + *encoded_length, &len); + if (len) { + err = grib_pack_double(a, val + *encoded_length, &len); *encoded_length += len; - if(err == GRIB_SUCCESS){ + if (err == GRIB_SUCCESS) { /* See ECC-778 */ return _grib_dependency_notify_change(h, a); } } else { - grib_get_size(h,a->name,encoded_length); + grib_get_size(h, a->name, encoded_length); err = GRIB_WRONG_ARRAY_SIZE; } } return err; - } else { return GRIB_SUCCESS; @@ -645,108 +653,117 @@ static int _grib_set_double_array_internal(grib_handle* h,grib_accessor* a, } static int _grib_set_double_array(grib_handle* h, const char* name, - const double* val, size_t length,int check) + const double* val, size_t length, int check) { - size_t encoded = 0; + size_t encoded = 0; grib_accessor* a = grib_find_accessor(h, name); - int err=0; + int err = 0; - if (!a) return GRIB_NOT_FOUND ; - if (name[0]=='/' || name[0]=='#' ) { - if(check && (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY)) + if (!a) + return GRIB_NOT_FOUND; + if (name[0] == '/' || name[0] == '#') { + if (check && (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY)) return GRIB_READ_ONLY; - err=grib_pack_double(a, val, &length); - encoded=length; - } else err=_grib_set_double_array_internal(h,a,val,length,&encoded,check); + err = grib_pack_double(a, val, &length); + encoded = length; + } + else + err = _grib_set_double_array_internal(h, a, val, length, &encoded, check); - if(err == GRIB_SUCCESS && length > encoded) + if (err == GRIB_SUCCESS && length > encoded) err = GRIB_ARRAY_TOO_SMALL; - if(err == GRIB_SUCCESS) - return _grib_dependency_notify_change(h,a); /* See ECC-778 */ + if (err == GRIB_SUCCESS) + return _grib_dependency_notify_change(h, a); /* See ECC-778 */ return err; } int grib_set_double_array_internal(grib_handle* h, const char* name, const double* val, size_t length) { - int ret=0; + int ret = 0; if (h->context->debug) - fprintf(stderr, "ECCODES DEBUG grib_set_double_array_internal key=%s %ld values\n",name,(long)length); + fprintf(stderr, "ECCODES DEBUG grib_set_double_array_internal key=%s %ld values\n", name, (long)length); - if (length==0) { + if (length == 0) { grib_accessor* a = grib_find_accessor(h, name); - ret=grib_pack_double(a, val , &length); - } else { - ret=_grib_set_double_array(h,name,val,length,0); + ret = grib_pack_double(a, val, &length); + } + else { + ret = _grib_set_double_array(h, name, val, length, 0); } - if (ret!=GRIB_SUCCESS) - grib_context_log(h->context,GRIB_LOG_ERROR,"unable to set double array %s (%s)", - name,grib_get_error_message(ret)); + if (ret != GRIB_SUCCESS) + grib_context_log(h->context, GRIB_LOG_ERROR, "unable to set double array %s (%s)", + name, grib_get_error_message(ret)); /*if (h->context->debug) fprintf(stderr,"ECCODES DEBUG grib_set_double_array_internal key=%s --DONE\n",name);*/ return ret; } static int __grib_set_double_array(grib_handle* h, const char* name, const double* val, size_t length, int check) { - double v=0; - size_t i=0; + double v = 0; + size_t i = 0; if (h->context->debug) { - size_t N=5; - if (length<=N) N=length; - fprintf(stderr, "ECCODES DEBUG grib_set_double_array key=%s %ld values (",name,(long)length); - for(i=0; i= length) fprintf(stderr, " )\n"); - else fprintf(stderr, " ... )\n"); + size_t N = 5; + if (length <= N) + N = length; + fprintf(stderr, "ECCODES DEBUG grib_set_double_array key=%s %ld values (", name, (long)length); + for (i = 0; i < N; ++i) + fprintf(stderr, " %g,", val[i]); + if (N >= length) + fprintf(stderr, " )\n"); + else + fprintf(stderr, " ... )\n"); } - if (length==0) { + if (length == 0) { grib_accessor* a = grib_find_accessor(h, name); - return grib_pack_double(a, val , &length); + return grib_pack_double(a, val, &length); } /*second order doesn't have a proper representation for constant fields the best is not to do the change of packing type if the field is constant */ - if (!strcmp(name,"values") || !strcmp(name,"codedValues")) { + if (!strcmp(name, "values") || !strcmp(name, "codedValues")) { double missingValue; - int ret=0; - int constant=0; - - ret=grib_get_double(h,"missingValue",&missingValue); - if (ret) missingValue=9999; - - v=missingValue; - constant=1; - for (i=0;icontext->debug) { fprintf(stderr, "ECCODES DEBUG __grib_set_double_array: Cannot use second order packing for constant fields. Using simple packing\n"); } - ret = grib_set_string(h,"packingType","grid_simple",&slen); + ret = grib_set_string(h, "packingType", "grid_simple", &slen); if (ret != GRIB_SUCCESS) { if (h->context->debug) { fprintf(stderr, "ECCODES DEBUG __grib_set_double_array: could not switch to simple packing!\n"); @@ -756,7 +773,7 @@ static int __grib_set_double_array(grib_handle* h, const char* name, const doubl } } - return _grib_set_double_array(h,name,val,length,check); + return _grib_set_double_array(h, name, val, length, check); } int grib_set_force_double_array(grib_handle* h, const char* name, const double* val, size_t length) @@ -771,64 +788,69 @@ int grib_set_double_array(grib_handle* h, const char* name, const double* val, s return __grib_set_double_array(h, name, val, length, /*check=*/1); } -static int _grib_set_long_array_internal(grib_handle* h,grib_accessor* a,const long* val, size_t buffer_len,size_t *encoded_length,int check) +static int _grib_set_long_array_internal(grib_handle* h, grib_accessor* a, const long* val, size_t buffer_len, size_t* encoded_length, int check) { - if(a) { - int err = _grib_set_long_array_internal(h,a->same,val,buffer_len,encoded_length,check); + if (a) { + int err = _grib_set_long_array_internal(h, a->same, val, buffer_len, encoded_length, check); - if(check && (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY)) + if (check && (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY)) return GRIB_READ_ONLY; - if(err == GRIB_SUCCESS) - { + if (err == GRIB_SUCCESS) { size_t len = buffer_len - *encoded_length; - if(len) { - err = grib_pack_long(a, val + *encoded_length, &len); + if (len) { + err = grib_pack_long(a, val + *encoded_length, &len); *encoded_length += len; } else { - grib_get_size(h,a->name,encoded_length); + grib_get_size(h, a->name, encoded_length); err = GRIB_WRONG_ARRAY_SIZE; } } return err; - } else { return GRIB_SUCCESS; } } -static int _grib_set_long_array(grib_handle* h, const char* name, const long* val, size_t length,int check) +static int _grib_set_long_array(grib_handle* h, const char* name, const long* val, size_t length, int check) { - size_t encoded = 0; + size_t encoded = 0; grib_accessor* a = grib_find_accessor(h, name); - int err =0; + int err = 0; - if (!a) return GRIB_NOT_FOUND ; + if (!a) + return GRIB_NOT_FOUND; if (h->context->debug) { - size_t i=0; - size_t N=5; - if (length<=N) N=length; - fprintf(stderr, "ECCODES DEBUG _grib_set_long_array key=%s %ld values (",name,(long)length); - for(i=0; i= length) fprintf(stderr, " )\n"); - else fprintf(stderr, " ... )\n"); + size_t i = 0; + size_t N = 5; + if (length <= N) + N = length; + fprintf(stderr, "ECCODES DEBUG _grib_set_long_array key=%s %ld values (", name, (long)length); + for (i = 0; i < N; ++i) + fprintf(stderr, " %ld,", val[i]); + if (N >= length) + fprintf(stderr, " )\n"); + else + fprintf(stderr, " ... )\n"); } - if (name[0]=='/' || name[0]=='#' ) { - if(check && (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY)) + if (name[0] == '/' || name[0] == '#') { + if (check && (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY)) return GRIB_READ_ONLY; - err=grib_pack_long(a, val, &length); - encoded=length; - } else err=_grib_set_long_array_internal(h,a,val,length,&encoded,check); + err = grib_pack_long(a, val, &length); + encoded = length; + } + else + err = _grib_set_long_array_internal(h, a, val, length, &encoded, check); - if(err == GRIB_SUCCESS && length > encoded) + if (err == GRIB_SUCCESS && length > encoded) err = GRIB_ARRAY_TOO_SMALL; - if(err == GRIB_SUCCESS) + if (err == GRIB_SUCCESS) return grib_dependency_notify_change(a); return err; @@ -836,26 +858,26 @@ static int _grib_set_long_array(grib_handle* h, const char* name, const long* va int grib_set_long_array_internal(grib_handle* h, const char* name, const long* val, size_t length) { - int ret=_grib_set_long_array(h,name,val,length,0); - if (ret!=GRIB_SUCCESS) - grib_context_log(h->context,GRIB_LOG_ERROR,"unable to set long array %s (%s)", - name,grib_get_error_message(ret)); + int ret = _grib_set_long_array(h, name, val, length, 0); + if (ret != GRIB_SUCCESS) + grib_context_log(h->context, GRIB_LOG_ERROR, "unable to set long array %s (%s)", + name, grib_get_error_message(ret)); return ret; } int grib_set_long_array(grib_handle* h, const char* name, const long* val, size_t length) { - return _grib_set_long_array(h,name,val,length,1); + return _grib_set_long_array(h, name, val, length, 1); } int grib_get_long_internal(grib_handle* h, const char* name, long* val) { - int ret = grib_get_long(h,name,val); + int ret = grib_get_long(h, name, val); - if(ret!=GRIB_SUCCESS) { - grib_context_log(h->context,GRIB_LOG_ERROR, - "unable to get %s as long (%s)", - name, grib_get_error_message(ret)); + if (ret != GRIB_SUCCESS) { + grib_context_log(h->context, GRIB_LOG_ERROR, + "unable to get %s as long (%s)", + name, grib_get_error_message(ret)); } return ret; @@ -863,8 +885,8 @@ int grib_get_long_internal(grib_handle* h, const char* name, long* val) int grib_is_in_dump(grib_handle* h, const char* name) { - grib_accessor* a=grib_find_accessor(h, name); - if (a!=NULL && (a->flags & GRIB_ACCESSOR_FLAG_DUMP)) + grib_accessor* a = grib_find_accessor(h, name); + if (a != NULL && (a->flags & GRIB_ACCESSOR_FLAG_DUMP)) return 1; else return 0; @@ -873,8 +895,10 @@ int grib_is_in_dump(grib_handle* h, const char* name) int grib_attributes_count(grib_accessor* a, size_t* size) { if (a) { - *size=0; - while (a->attributes[*size]!=NULL) {(*size)++;} + *size = 0; + while (a->attributes[*size] != NULL) { + (*size)++; + } return GRIB_SUCCESS; } @@ -883,64 +907,70 @@ int grib_attributes_count(grib_accessor* a, size_t* size) int grib_get_long(const grib_handle* h, const char* name, long* val) { - size_t length = 1; - grib_accessor* a = NULL; - grib_accessors_list* al=NULL; - int ret=0; - - if (name[0] == '/' ) { - al=grib_find_accessors_list(h,name); - if (!al) return GRIB_NOT_FOUND; - ret=grib_unpack_long(al->accessor, val , &length); - grib_context_free(h->context,al); - } else { - a=grib_find_accessor(h, name); - if(!a) return GRIB_NOT_FOUND; - ret=grib_unpack_long(a, val , &length); + size_t length = 1; + grib_accessor* a = NULL; + grib_accessors_list* al = NULL; + int ret = 0; + + if (name[0] == '/') { + al = grib_find_accessors_list(h, name); + if (!al) + return GRIB_NOT_FOUND; + ret = grib_unpack_long(al->accessor, val, &length); + grib_context_free(h->context, al); + } + else { + a = grib_find_accessor(h, name); + if (!a) + return GRIB_NOT_FOUND; + ret = grib_unpack_long(a, val, &length); } return ret; } int grib_get_double_internal(grib_handle* h, const char* name, double* val) { - int ret = grib_get_double(h,name,val); + int ret = grib_get_double(h, name, val); - if(ret!=GRIB_SUCCESS) - grib_context_log(h->context,GRIB_LOG_ERROR, - "unable to get %s as double (%s)", - name, grib_get_error_message(ret)); + if (ret != GRIB_SUCCESS) + grib_context_log(h->context, GRIB_LOG_ERROR, + "unable to get %s as double (%s)", + name, grib_get_error_message(ret)); return ret; } int grib_get_double(const grib_handle* h, const char* name, double* val) { - size_t length = 1; - grib_accessor* a = NULL; - grib_accessors_list* al=NULL; - int ret=0; - - if (name[0] == '/' ) { - al=grib_find_accessors_list(h,name); - if (!al) return GRIB_NOT_FOUND; - ret=grib_unpack_double(al->accessor, val , &length); - grib_context_free(h->context,al); - } else { - a=grib_find_accessor(h, name); - if(!a) return GRIB_NOT_FOUND; - ret=grib_unpack_double(a, val , &length); + size_t length = 1; + grib_accessor* a = NULL; + grib_accessors_list* al = NULL; + int ret = 0; + + if (name[0] == '/') { + al = grib_find_accessors_list(h, name); + if (!al) + return GRIB_NOT_FOUND; + ret = grib_unpack_double(al->accessor, val, &length); + grib_context_free(h->context, al); + } + else { + a = grib_find_accessor(h, name); + if (!a) + return GRIB_NOT_FOUND; + ret = grib_unpack_double(a, val, &length); } return ret; } -int grib_get_double_element_internal(grib_handle* h, const char* name, int i,double* val) +int grib_get_double_element_internal(grib_handle* h, const char* name, int i, double* val) { - int ret = grib_get_double_element(h,name,i,val); + int ret = grib_get_double_element(h, name, i, val); - if(ret!=GRIB_SUCCESS) - grib_context_log(h->context,GRIB_LOG_ERROR, - "unable to get %s as double element (%s)", - name, grib_get_error_message(ret)); + if (ret != GRIB_SUCCESS) + grib_context_log(h->context, GRIB_LOG_ERROR, + "unable to get %s as double element (%s)", + name, grib_get_error_message(ret)); return ret; } @@ -950,142 +980,151 @@ int grib_get_double_element(const grib_handle* h, const char* name, int i, doubl grib_accessor* act = grib_find_accessor(h, name); if (act) { - return grib_unpack_double_element(act, i,val); + return grib_unpack_double_element(act, i, val); } return GRIB_NOT_FOUND; } int grib_points_get_values(grib_handle* h, grib_points* points, double* val) { - int i,ret; - grib_accessor* a=NULL; + int i, ret; + grib_accessor* a = NULL; - a=grib_find_accessor(h,"values"); + a = grib_find_accessor(h, "values"); - for (i=0;in_groups;i++) { - ret=grib_unpack_double_subarray(a,val,points->group_start[i],points->group_len[i]); - if (ret) return ret; - val+=points->group_len[i]; + for (i = 0; i < points->n_groups; i++) { + ret = grib_unpack_double_subarray(a, val, points->group_start[i], points->group_len[i]); + if (ret) + return ret; + val += points->group_len[i]; } return GRIB_SUCCESS; } int grib_get_double_elements(const grib_handle* h, const char* name, int* index_array, long len, double* val_array) { - double* values=0; - int err=0; - size_t size=0, num_bytes = 0; - long j = 0; - grib_accessor* act =NULL; + double* values = 0; + int err = 0; + size_t size = 0, num_bytes = 0; + long j = 0; + grib_accessor* act = NULL; - act= grib_find_accessor(h, name); - if (!act) return GRIB_NOT_FOUND; + act = grib_find_accessor(h, name); + if (!act) + return GRIB_NOT_FOUND; - err=_grib_get_size(h,act,&size); + err = _grib_get_size(h, act, &size); - if (err!=GRIB_SUCCESS) { - grib_context_log(h->context,GRIB_LOG_ERROR,"grib_get_double_elements: cannot get size of %s\n",name); + if (err != GRIB_SUCCESS) { + grib_context_log(h->context, GRIB_LOG_ERROR, "grib_get_double_elements: cannot get size of %s\n", name); return err; } /* Check index array has valid values */ - for (j=0;j= size) { - grib_context_log(h->context,GRIB_LOG_ERROR, - "grib_get_double_elements: index out of range: %d (should be between 0 and %ld)", anIndex, size-1); + grib_context_log(h->context, GRIB_LOG_ERROR, + "grib_get_double_elements: index out of range: %d (should be between 0 and %ld)", anIndex, size - 1); return GRIB_INVALID_ARGUMENT; } } num_bytes = size * sizeof(double); - values=(double*)grib_context_malloc(h->context, num_bytes); + values = (double*)grib_context_malloc(h->context, num_bytes); if (!values) { - grib_context_log(h->context,GRIB_LOG_ERROR,"grib_get_double_elements: unable to allocate %ld bytes\n", num_bytes); + grib_context_log(h->context, GRIB_LOG_ERROR, "grib_get_double_elements: unable to allocate %ld bytes\n", num_bytes); return GRIB_OUT_OF_MEMORY; } err = grib_unpack_double(act, values, &size); if (!err) { - for (j=0;jcontext,values); + grib_context_free(h->context, values); return err; } -int grib_get_string_internal(grib_handle* h, const char* name, char* val, size_t *length) +int grib_get_string_internal(grib_handle* h, const char* name, char* val, size_t* length) { - int ret = grib_get_string(h,name,val,length); + int ret = grib_get_string(h, name, val, length); - if(ret!=GRIB_SUCCESS) - grib_context_log(h->context,GRIB_LOG_ERROR, - "unable to get %s as string (%s)", - name, grib_get_error_message(ret)); + if (ret != GRIB_SUCCESS) + grib_context_log(h->context, GRIB_LOG_ERROR, + "unable to get %s as string (%s)", + name, grib_get_error_message(ret)); return ret; } -int grib_get_string(const grib_handle* h, const char* name, char* val, size_t *length) +int grib_get_string(const grib_handle* h, const char* name, char* val, size_t* length) { - grib_accessor* a = NULL; - grib_accessors_list* al=NULL; - int ret=0; - - if (name[0] == '/' ) { - al=grib_find_accessors_list(h,name); - if (!al) return GRIB_NOT_FOUND; - ret=grib_unpack_string(al->accessor, val, length); - grib_context_free(h->context,al); + grib_accessor* a = NULL; + grib_accessors_list* al = NULL; + int ret = 0; + + if (name[0] == '/') { + al = grib_find_accessors_list(h, name); + if (!al) + return GRIB_NOT_FOUND; + ret = grib_unpack_string(al->accessor, val, length); + grib_context_free(h->context, al); return ret; - } else { - a=grib_find_accessor(h, name); - if(!a) return GRIB_NOT_FOUND; - return grib_unpack_string(a, val , length); + } + else { + a = grib_find_accessor(h, name); + if (!a) + return GRIB_NOT_FOUND; + return grib_unpack_string(a, val, length); } } -int grib_get_bytes_internal(const grib_handle* h, const char* name, unsigned char* val, size_t *length) +int grib_get_bytes_internal(const grib_handle* h, const char* name, unsigned char* val, size_t* length) { - int ret = grib_get_bytes(h,name,val,length); + int ret = grib_get_bytes(h, name, val, length); - if(ret!=GRIB_SUCCESS) - grib_context_log(h->context,GRIB_LOG_ERROR, - "unable to get %s as bytes (%s)", - name, grib_get_error_message(ret)); + if (ret != GRIB_SUCCESS) + grib_context_log(h->context, GRIB_LOG_ERROR, + "unable to get %s as bytes (%s)", + name, grib_get_error_message(ret)); return ret; } -int grib_get_bytes(const grib_handle* h, const char* name, unsigned char* val, size_t *length) +int grib_get_bytes(const grib_handle* h, const char* name, unsigned char* val, size_t* length) { - int err=0; + int err = 0; grib_accessor* act = grib_find_accessor(h, name); - err = act? grib_unpack_bytes(act, val, length) : GRIB_NOT_FOUND; - if(err) grib_context_log(h->context,GRIB_LOG_ERROR, - "grib_get_bytes %s failed %s", name, grib_get_error_message(err)); + err = act ? grib_unpack_bytes(act, val, length) : GRIB_NOT_FOUND; + if (err) + grib_context_log(h->context, GRIB_LOG_ERROR, + "grib_get_bytes %s failed %s", name, grib_get_error_message(err)); return err; } -int grib_get_native_type(const grib_handle* h, const char* name,int* type) +int grib_get_native_type(const grib_handle* h, const char* name, int* type) { - grib_accessors_list* al=NULL; - grib_accessor* a =NULL; - *type = GRIB_TYPE_UNDEFINED; + grib_accessors_list* al = NULL; + grib_accessor* a = NULL; + *type = GRIB_TYPE_UNDEFINED; - DebugAssert( name != NULL && strlen(name) > 0 ); + DebugAssert(name != NULL && strlen(name) > 0); - if (name[0] == '/' ) { - al=grib_find_accessors_list(h,name); - if (!al) return GRIB_NOT_FOUND; + if (name[0] == '/') { + al = grib_find_accessors_list(h, name); + if (!al) + return GRIB_NOT_FOUND; *type = grib_accessor_get_native_type(al->accessor); - grib_context_free(h->context,al); - } else { - a=grib_find_accessor(h, name); - if(!a) return GRIB_NOT_FOUND; + grib_context_free(h->context, al); + } + else { + a = grib_find_accessor(h, name); + if (!a) + return GRIB_NOT_FOUND; *type = grib_accessor_get_native_type(a); } @@ -1095,18 +1134,17 @@ int grib_get_native_type(const grib_handle* h, const char* name,int* type) const char* grib_get_accessor_class_name(grib_handle* h, const char* name) { grib_accessor* act = grib_find_accessor(h, name); - return act?act->cclass->name:NULL; + return act ? act->cclass->name : NULL; } -int _grib_get_double_array_internal(const grib_handle* h,grib_accessor* a,double* val, size_t buffer_len,size_t *decoded_length) +int _grib_get_double_array_internal(const grib_handle* h, grib_accessor* a, double* val, size_t buffer_len, size_t* decoded_length) { - if(a) { - int err = _grib_get_double_array_internal(h,a->same,val,buffer_len,decoded_length); + if (a) { + int err = _grib_get_double_array_internal(h, a->same, val, buffer_len, decoded_length); - if ( err == GRIB_SUCCESS ) - { + if (err == GRIB_SUCCESS) { size_t len = buffer_len - *decoded_length; - err = grib_unpack_double(a, val + *decoded_length, &len); + err = grib_unpack_double(a, val + *decoded_length, &len); *decoded_length += len; } @@ -1117,90 +1155,99 @@ int _grib_get_double_array_internal(const grib_handle* h,grib_accessor* a,double } } -int grib_get_double_array_internal(const grib_handle* h, const char* name, double* val, size_t *length) +int grib_get_double_array_internal(const grib_handle* h, const char* name, double* val, size_t* length) { - int ret = grib_get_double_array(h,name,val,length); + int ret = grib_get_double_array(h, name, val, length); - if(ret!=GRIB_SUCCESS) - grib_context_log(h->context,GRIB_LOG_ERROR, - "unable to get %s as double array (%s)", - name, grib_get_error_message(ret)); + if (ret != GRIB_SUCCESS) + grib_context_log(h->context, GRIB_LOG_ERROR, + "unable to get %s as double array (%s)", + name, grib_get_error_message(ret)); return ret; } -int grib_get_double_array(const grib_handle* h, const char* name, double* val, size_t *length) +int grib_get_double_array(const grib_handle* h, const char* name, double* val, size_t* length) { - size_t len = *length; - grib_accessor* a = NULL; - grib_accessors_list* al=NULL; - int ret=0; - - if (name[0] == '/' ) { - al=grib_find_accessors_list(h,name); - if (!al) return GRIB_NOT_FOUND; - ret=grib_accessors_list_unpack_double(al,val,length); - grib_context_free(h->context,al); + size_t len = *length; + grib_accessor* a = NULL; + grib_accessors_list* al = NULL; + int ret = 0; + + if (name[0] == '/') { + al = grib_find_accessors_list(h, name); + if (!al) + return GRIB_NOT_FOUND; + ret = grib_accessors_list_unpack_double(al, val, length); + grib_accessors_list_delete(h->context, al); return ret; - } else { - a=grib_find_accessor(h, name); - if(!a) return GRIB_NOT_FOUND; + } + else { + a = grib_find_accessor(h, name); + if (!a) + return GRIB_NOT_FOUND; if (name[0] == '#') { - return grib_unpack_double(a, val , length); - } else { + return grib_unpack_double(a, val, length); + } + else { *length = 0; - return _grib_get_double_array_internal(h,a,val,len,length); + return _grib_get_double_array_internal(h, a, val, len, length); } } } int _grib_get_string_length(grib_accessor* a, size_t* size) { - size_t s=0; + size_t s = 0; *size = 0; - while(a) { + while (a) { s = grib_string_length(a); - if (s > *size) *size=s; + if (s > *size) + *size = s; a = a->same; } - (*size)+=1; + (*size) += 1; return GRIB_SUCCESS; } -int grib_get_string_length(const grib_handle* h, const char* name,size_t* size) +int grib_get_string_length(const grib_handle* h, const char* name, size_t* size) { - grib_accessor* a = NULL; - grib_accessors_list* al=NULL; - int ret=0; - - if (name[0] == '/' ) { - al=grib_find_accessors_list(h,name); - if (!al) return GRIB_NOT_FOUND; - ret=_grib_get_string_length(al->accessor,size); - grib_context_free(h->context,al); + grib_accessor* a = NULL; + grib_accessors_list* al = NULL; + int ret = 0; + + if (name[0] == '/') { + al = grib_find_accessors_list(h, name); + if (!al) + return GRIB_NOT_FOUND; + ret = _grib_get_string_length(al->accessor, size); + grib_context_free(h->context, al); return ret; - } else { + } + else { a = grib_find_accessor(h, name); - if(!a) return GRIB_NOT_FOUND; - return _grib_get_string_length(a,size); + if (!a) + return GRIB_NOT_FOUND; + return _grib_get_string_length(a, size); } } -int _grib_get_size(const grib_handle* h, grib_accessor* a,size_t* size) +int _grib_get_size(const grib_handle* h, grib_accessor* a, size_t* size) { - long count=0; - int err=0; + long count = 0; + int err = 0; - if(!a) return GRIB_NOT_FOUND; + if (!a) + return GRIB_NOT_FOUND; *size = 0; - while(a) { - if (err==0) - { - err=grib_value_count(a,&count); - if (err) return err; + while (a) { + if (err == 0) { + err = grib_value_count(a, &count); + if (err) + return err; *size += count; } a = a->same; @@ -1208,29 +1255,34 @@ int _grib_get_size(const grib_handle* h, grib_accessor* a,size_t* size) return GRIB_SUCCESS; } -int grib_get_size(const grib_handle* ch, const char* name,size_t* size) +int grib_get_size(const grib_handle* ch, const char* name, size_t* size) { - grib_handle* h = (grib_handle*)ch; - grib_accessor* a =NULL; - grib_accessors_list* al=NULL; - int ret=0; - *size=0; + grib_handle* h = (grib_handle*)ch; + grib_accessor* a = NULL; + grib_accessors_list* al = NULL; + int ret = 0; + *size = 0; if (name[0] == '/') { - al=grib_find_accessors_list(h,name); - if (!al) return GRIB_NOT_FOUND; - ret=grib_accessors_list_value_count(al,size); - grib_context_free(h->context,al); + al = grib_find_accessors_list(h, name); + if (!al) + return GRIB_NOT_FOUND; + ret = grib_accessors_list_value_count(al, size); + grib_accessors_list_delete(h->context, al); return ret; - } else { - a=grib_find_accessor(h, name); - if(!a) return GRIB_NOT_FOUND; - if (name[0]=='#') { - long count=*size; - ret=grib_value_count(a,&count); - *size=count; + } + else { + a = grib_find_accessor(h, name); + if (!a) + return GRIB_NOT_FOUND; + if (name[0] == '#') { + long count = *size; + ret = grib_value_count(a, &count); + *size = count; return ret; - } else return _grib_get_size(h, a,size); + } + else + return _grib_get_size(h, a, size); } } @@ -1239,300 +1291,323 @@ int grib_get_length(const grib_handle* h, const char* name, size_t* length) return grib_get_string_length(h, name, length); } -int grib_get_count(grib_handle* h, const char* name,size_t* size) +int grib_get_count(grib_handle* h, const char* name, size_t* size) { grib_accessor* a = grib_find_accessor(h, name); - if(!a) return GRIB_NOT_FOUND; + if (!a) + return GRIB_NOT_FOUND; *size = 0; - while(a) { + while (a) { (*size)++; a = a->same; } return GRIB_SUCCESS; } -int grib_get_offset(const grib_handle* ch, const char* key,size_t* val) +int grib_get_offset(const grib_handle* ch, const char* key, size_t* val) { - grib_handle* h = (grib_handle*)ch; + grib_handle* h = (grib_handle*)ch; grib_accessor* act = grib_find_accessor(h, key); - if(act) { + if (act) { *val = (size_t)grib_byte_offset(act); return GRIB_SUCCESS; } return GRIB_NOT_FOUND; } -int _grib_get_string_array_internal(const grib_handle* h,grib_accessor* a,char** val, size_t buffer_len,size_t *decoded_length) +int _grib_get_string_array_internal(const grib_handle* h, grib_accessor* a, char** val, size_t buffer_len, size_t* decoded_length) { - if(a) { - int err = _grib_get_string_array_internal(h,a->same,val,buffer_len,decoded_length); + if (a) { + int err = _grib_get_string_array_internal(h, a->same, val, buffer_len, decoded_length); - if(err == GRIB_SUCCESS) - { + if (err == GRIB_SUCCESS) { size_t len = buffer_len - *decoded_length; - err = grib_unpack_string_array(a, val + *decoded_length, &len); + err = grib_unpack_string_array(a, val + *decoded_length, &len); *decoded_length += len; } return err; - - } else { + } + else { return GRIB_SUCCESS; } } -int grib_get_string_array(const grib_handle* h, const char* name, char** val, size_t *length) +int grib_get_string_array(const grib_handle* h, const char* name, char** val, size_t* length) { - size_t len = *length; - grib_accessor* a = NULL; - grib_accessors_list* al=NULL; - int ret=0; - - if (name[0] == '/' ) { - al=grib_find_accessors_list(h,name); - if (!al) return GRIB_NOT_FOUND; - ret=grib_accessors_list_unpack_string(al,val,length); - grib_context_free(h->context,al); + size_t len = *length; + grib_accessor* a = NULL; + grib_accessors_list* al = NULL; + int ret = 0; + + if (name[0] == '/') { + al = grib_find_accessors_list(h, name); + if (!al) + return GRIB_NOT_FOUND; + ret = grib_accessors_list_unpack_string(al, val, length); + grib_context_free(h->context, al); return ret; - } else { - a=grib_find_accessor(h, name); - if(!a) return GRIB_NOT_FOUND; - if (name[0]=='#') { - return grib_unpack_string_array(a, val , length); - } else { + } + else { + a = grib_find_accessor(h, name); + if (!a) + return GRIB_NOT_FOUND; + if (name[0] == '#') { + return grib_unpack_string_array(a, val, length); + } + else { *length = 0; - return _grib_get_string_array_internal(h,a,val,len,length); + return _grib_get_string_array_internal(h, a, val, len, length); } } } -int _grib_get_long_array_internal(const grib_handle* h,grib_accessor* a,long* val, size_t buffer_len,size_t *decoded_length) +int _grib_get_long_array_internal(const grib_handle* h, grib_accessor* a, long* val, size_t buffer_len, size_t* decoded_length) { - if(a) { - int err = _grib_get_long_array_internal(h,a->same,val,buffer_len,decoded_length); + if (a) { + int err = _grib_get_long_array_internal(h, a->same, val, buffer_len, decoded_length); - if(err == GRIB_SUCCESS) - { + if (err == GRIB_SUCCESS) { size_t len = buffer_len - *decoded_length; - err = grib_unpack_long(a, val + *decoded_length, &len); + err = grib_unpack_long(a, val + *decoded_length, &len); *decoded_length += len; } return err; - - } else { + } + else { return GRIB_SUCCESS; } } -int grib_get_long_array_internal(grib_handle* h, const char* name, long* val, size_t *length) +int grib_get_long_array_internal(grib_handle* h, const char* name, long* val, size_t* length) { - int ret = grib_get_long_array(h,name,val,length); + int ret = grib_get_long_array(h, name, val, length); - if(ret!=GRIB_SUCCESS) - grib_context_log(h->context,GRIB_LOG_ERROR, - "unable to get %s as long array (%s)", - name, grib_get_error_message(ret)); + if (ret != GRIB_SUCCESS) + grib_context_log(h->context, GRIB_LOG_ERROR, + "unable to get %s as long array (%s)", + name, grib_get_error_message(ret)); return ret; } -int grib_get_long_array(const grib_handle* h, const char* name, long* val, size_t *length) +int grib_get_long_array(const grib_handle* h, const char* name, long* val, size_t* length) { - size_t len = *length; - grib_accessor* a = NULL; - grib_accessors_list* al=NULL; - int ret=0; - - if (name[0] == '/' ) { - al=grib_find_accessors_list(h,name); - if (!al) return GRIB_NOT_FOUND; - ret=grib_accessors_list_unpack_long(al,val,length); - grib_context_free(h->context,al); - } else { - a=grib_find_accessor(h, name); - if(!a) return GRIB_NOT_FOUND; - if (name[0]=='#') { - return grib_unpack_long(a, val , length); - } else { + size_t len = *length; + grib_accessor* a = NULL; + grib_accessors_list* al = NULL; + int ret = 0; + + if (name[0] == '/') { + al = grib_find_accessors_list(h, name); + if (!al) + return GRIB_NOT_FOUND; + ret = grib_accessors_list_unpack_long(al, val, length); + grib_context_free(h->context, al); + } + else { + a = grib_find_accessor(h, name); + if (!a) + return GRIB_NOT_FOUND; + if (name[0] == '#') { + return grib_unpack_long(a, val, length); + } + else { *length = 0; - return _grib_get_long_array_internal(h,a,val,len,length); + return _grib_get_long_array_internal(h, a, val, len, length); } } return ret; } -static void grib_clean_key_value(grib_context* c,grib_key_value_list* kv) +static void grib_clean_key_value(grib_context* c, grib_key_value_list* kv) { - if (kv->long_value) grib_context_free(c,kv->long_value); - kv->long_value=NULL; - if (kv->double_value) grib_context_free(c,kv->double_value); - kv->double_value=NULL; - if (kv->string_value) grib_context_free(c,kv->string_value); - kv->string_value=NULL; - if (kv->namespace_value) grib_key_value_list_delete(c,kv->namespace_value); - kv->namespace_value=NULL; - kv->error=0; - kv->has_value=0; - kv->size=0; + if (kv->long_value) + grib_context_free(c, kv->long_value); + kv->long_value = NULL; + if (kv->double_value) + grib_context_free(c, kv->double_value); + kv->double_value = NULL; + if (kv->string_value) + grib_context_free(c, kv->string_value); + kv->string_value = NULL; + if (kv->namespace_value) + grib_key_value_list_delete(c, kv->namespace_value); + kv->namespace_value = NULL; + kv->error = 0; + kv->has_value = 0; + kv->size = 0; } -static int grib_get_key_value(grib_handle* h,grib_key_value_list* kv) +static int grib_get_key_value(grib_handle* h, grib_key_value_list* kv) { - int err=0; - size_t size=0; - grib_keys_iterator* iter=NULL; - grib_key_value_list* list=NULL; + int err = 0; + size_t size = 0; + grib_keys_iterator* iter = NULL; + grib_key_value_list* list = NULL; - if (kv->has_value) grib_clean_key_value(h->context,kv); + if (kv->has_value) + grib_clean_key_value(h->context, kv); - err=grib_get_size(h,kv->name,&size); + err = grib_get_size(h, kv->name, &size); if (err) { - kv->error=err; + kv->error = err; return err; } - if (size==0) size=512; + if (size == 0) + size = 512; switch (kv->type) { - case GRIB_TYPE_LONG: - kv->long_value=(long*)grib_context_malloc_clear(h->context,size*sizeof(long)); - err=grib_get_long_array(h,kv->name,kv->long_value,&size); - kv->error=err; - break; - case GRIB_TYPE_DOUBLE: - kv->double_value=(double*)grib_context_malloc_clear(h->context,size*sizeof(double)); - err=grib_get_double_array(h,kv->name,kv->double_value,&size); - kv->error=err; - break; - case GRIB_TYPE_STRING: - grib_get_string_length(h,kv->name,&size); - kv->string_value=(char*)grib_context_malloc_clear(h->context,size*sizeof(char)); - err=grib_get_string(h,kv->name,kv->string_value,&size); - kv->error=err; - break; - case GRIB_TYPE_BYTES: - kv->string_value=(char*)grib_context_malloc_clear(h->context,size*sizeof(char)); - err=grib_get_bytes(h,kv->name,(unsigned char*)kv->string_value,&size); - kv->error=err; - break; - case GRIB_NAMESPACE: - iter=grib_keys_iterator_new(h,0,kv->name); - list=(grib_key_value_list*)grib_context_malloc_clear(h->context,sizeof(grib_key_value_list)); - kv->namespace_value=list; - while(grib_keys_iterator_next(iter)) - { - list->name=grib_keys_iterator_get_name(iter); - err=grib_get_native_type(h,list->name,&(list->type)); - if (err) return err; - err=grib_get_key_value(h,list); - if (err) return err; - list->next=(grib_key_value_list*)grib_context_malloc_clear(h->context,sizeof(grib_key_value_list)); - list=list->next; - } - grib_keys_iterator_delete(iter); - break; + case GRIB_TYPE_LONG: + kv->long_value = (long*)grib_context_malloc_clear(h->context, size * sizeof(long)); + err = grib_get_long_array(h, kv->name, kv->long_value, &size); + kv->error = err; + break; + case GRIB_TYPE_DOUBLE: + kv->double_value = (double*)grib_context_malloc_clear(h->context, size * sizeof(double)); + err = grib_get_double_array(h, kv->name, kv->double_value, &size); + kv->error = err; + break; + case GRIB_TYPE_STRING: + grib_get_string_length(h, kv->name, &size); + kv->string_value = (char*)grib_context_malloc_clear(h->context, size * sizeof(char)); + err = grib_get_string(h, kv->name, kv->string_value, &size); + kv->error = err; + break; + case GRIB_TYPE_BYTES: + kv->string_value = (char*)grib_context_malloc_clear(h->context, size * sizeof(char)); + err = grib_get_bytes(h, kv->name, (unsigned char*)kv->string_value, &size); + kv->error = err; + break; + case GRIB_NAMESPACE: + iter = grib_keys_iterator_new(h, 0, kv->name); + list = (grib_key_value_list*)grib_context_malloc_clear(h->context, sizeof(grib_key_value_list)); + kv->namespace_value = list; + while (grib_keys_iterator_next(iter)) { + list->name = grib_keys_iterator_get_name(iter); + err = grib_get_native_type(h, list->name, &(list->type)); + if (err) + return err; + err = grib_get_key_value(h, list); + if (err) + return err; + list->next = (grib_key_value_list*)grib_context_malloc_clear(h->context, sizeof(grib_key_value_list)); + list = list->next; + } + grib_keys_iterator_delete(iter); + break; - default: - err=grib_get_native_type(h,kv->name,&(kv->type)); - if (err) return err; - err=grib_get_key_value(h,kv); - break; + default: + err = grib_get_native_type(h, kv->name, &(kv->type)); + if (err) + return err; + err = grib_get_key_value(h, kv); + break; } - kv->has_value=1; + kv->has_value = 1; return err; } -grib_key_value_list* grib_key_value_list_clone(grib_context* c,grib_key_value_list* list) +grib_key_value_list* grib_key_value_list_clone(grib_context* c, grib_key_value_list* list) { - grib_key_value_list* next=list; - grib_key_value_list* the_clone=(grib_key_value_list*)grib_context_malloc_clear(c,sizeof(grib_key_value_list)); - grib_key_value_list* p=the_clone; + grib_key_value_list* next = list; + grib_key_value_list* the_clone = (grib_key_value_list*)grib_context_malloc_clear(c, sizeof(grib_key_value_list)); + grib_key_value_list* p = the_clone; while (next && next->name) { - p->name=grib_context_strdup(c,next->name); - p->type=next->type; - next=next->next; + p->name = grib_context_strdup(c, next->name); + p->type = next->type; + next = next->next; } return the_clone; } -void grib_key_value_list_delete(grib_context* c,grib_key_value_list* kvl) +void grib_key_value_list_delete(grib_context* c, grib_key_value_list* kvl) { - grib_key_value_list* next=kvl; - grib_key_value_list* p=NULL; + grib_key_value_list* next = kvl; + grib_key_value_list* p = NULL; while (next) { - p=next->next; + p = next->next; if (next->type == GRIB_NAMESPACE) - grib_key_value_list_delete(c,next->namespace_value); + grib_key_value_list_delete(c, next->namespace_value); - grib_clean_key_value(c,next); - grib_context_free(c,next); - next=p; + grib_clean_key_value(c, next); + grib_context_free(c, next); + next = p; } } -int grib_get_key_value_list(grib_handle* h,grib_key_value_list* list) +int grib_get_key_value_list(grib_handle* h, grib_key_value_list* list) { - int ret=0; - grib_key_value_list* kvl=list; + int ret = 0; + grib_key_value_list* kvl = list; while (kvl) { - ret=grib_get_key_value(h,kvl); - kvl=kvl->next; + ret = grib_get_key_value(h, kvl); + kvl = kvl->next; } return ret; } -int grib_get_values(grib_handle* h,grib_values* args,size_t count) +int grib_get_values(grib_handle* h, grib_values* args, size_t count) { - int ret=0; - int i=0; + int ret = 0; + int i = 0; - for (i=0; ivalues_stack++; Assert(h->values_stack < MAX_SET_VALUES - 1); @@ -1540,45 +1615,46 @@ int grib_set_values(grib_handle* h,grib_values* args,size_t count) h->values[stack] = args; h->values_count[stack] = count; - for(i = 0; i < count ; i++) + for (i = 0; i < count; i++) args[i].error = GRIB_NOT_FOUND; - while(more) - { + while (more) { more = 0; - for(i = 0; i < count ; i++) - { - if(args[i].error != GRIB_NOT_FOUND) + for (i = 0; i < count; i++) { + if (args[i].error != GRIB_NOT_FOUND) continue; - switch(args[i].type) - { - case GRIB_TYPE_LONG: - error = grib_set_long(h,args[i].name,args[i].long_value); - args[i].error=error; - if(args[i].error == GRIB_SUCCESS) more = 1; - break; + switch (args[i].type) { + case GRIB_TYPE_LONG: + error = grib_set_long(h, args[i].name, args[i].long_value); + args[i].error = error; + if (args[i].error == GRIB_SUCCESS) + more = 1; + break; - case GRIB_TYPE_DOUBLE: - args[i].error = grib_set_double(h,args[i].name,args[i].double_value); - if(args[i].error == GRIB_SUCCESS) more = 1; - break; + case GRIB_TYPE_DOUBLE: + args[i].error = grib_set_double(h, args[i].name, args[i].double_value); + if (args[i].error == GRIB_SUCCESS) + more = 1; + break; - case GRIB_TYPE_STRING: - len = strlen(args[i].string_value); - args[i].error = grib_set_string(h,args[i].name,args[i].string_value,&len); - if(args[i].error == GRIB_SUCCESS) more = 1; - break; + case GRIB_TYPE_STRING: + len = strlen(args[i].string_value); + args[i].error = grib_set_string(h, args[i].name, args[i].string_value, &len); + if (args[i].error == GRIB_SUCCESS) + more = 1; + break; - case GRIB_TYPE_MISSING: - args[i].error = grib_set_missing(h,args[i].name); - if(args[i].error == GRIB_SUCCESS) more = 1; - break; + case GRIB_TYPE_MISSING: + args[i].error = grib_set_missing(h, args[i].name); + if (args[i].error == GRIB_SUCCESS) + more = 1; + break; - default: - grib_context_log(h->context,GRIB_LOG_ERROR, "grib_set_values[%d] %s invalid type %d", i, args[i].name, args[i].type); - args[i].error = GRIB_INVALID_ARGUMENT; - break; + default: + grib_context_log(h->context, GRIB_LOG_ERROR, "grib_set_values[%d] %s invalid type %d", i, args[i].name, args[i].type); + args[i].error = GRIB_INVALID_ARGUMENT; + break; } /*if (args[i].error != GRIB_SUCCESS) grib_context_log(h->context,GRIB_LOG_ERROR,"unable to set %s (%s)", @@ -1591,14 +1667,13 @@ int grib_set_values(grib_handle* h,grib_values* args,size_t count) h->values_stack--; - for(i = 0; i < count ; i++) { - if(args[i].error != GRIB_SUCCESS) - { - grib_context_log(h->context,GRIB_LOG_ERROR, - "grib_set_values[%d] %s (type=%s) failed: %s", - i, args[i].name, grib_get_type_name(args[i].type), - grib_get_error_message(args[i].error)); - err= err==GRIB_SUCCESS ? args[i].error : err; + for (i = 0; i < count; i++) { + if (args[i].error != GRIB_SUCCESS) { + grib_context_log(h->context, GRIB_LOG_ERROR, + "grib_set_values[%d] %s (type=%s) failed: %s", + i, args[i].name, grib_get_type_name(args[i].type), + grib_get_error_message(args[i].error)); + err = err == GRIB_SUCCESS ? args[i].error : err; } } @@ -1606,24 +1681,28 @@ int grib_set_values(grib_handle* h,grib_values* args,size_t count) } int grib_get_nearest_smaller_value(grib_handle* h, const char* name, - double val,double* nearest) + double val, double* nearest) { grib_accessor* act = grib_find_accessor(h, name); Assert(act); - return grib_nearest_smaller_value(act,val,nearest); + return grib_nearest_smaller_value(act, val, nearest); } -void grib_print_values(grib_values* values,int count) +void grib_print_values(grib_values* values, int count) { int i; - for(i = 0; i < count ; i++) - { - printf("%s = ",values[i].name); - switch(values[i].type) - { - case GRIB_TYPE_LONG: printf("%ld",values[i].long_value); break; - case GRIB_TYPE_DOUBLE: printf("%g",values[i].double_value); break; - case GRIB_TYPE_STRING: printf("%s",values[i].string_value); break; + for (i = 0; i < count; i++) { + printf("%s = ", values[i].name); + switch (values[i].type) { + case GRIB_TYPE_LONG: + printf("%ld", values[i].long_value); + break; + case GRIB_TYPE_DOUBLE: + printf("%g", values[i].double_value); + break; + case GRIB_TYPE_STRING: + printf("%s", values[i].string_value); + break; } printf("\n"); } @@ -1631,176 +1710,193 @@ void grib_print_values(grib_values* values,int count) int grib_values_check(grib_handle* h, grib_values* values, int count) { - int i=0; + int i = 0; long long_value; double double_value; - unsigned char ubuff[1024]={0,}; - char buff[1024]={0,}; - size_t len=1024; - - for (i=0; icontext,GRIB_LOG_DEBUG,"codes_copy_key double: %s=%g\n",key,d); - err=grib_set_double(h2,key,d); - return err; - } else { - ad=(double*)grib_context_malloc_clear(h1->context,len1*sizeof(double)); - err=grib_get_double_array(h1,key,ad,&len1); - if (err) return err; - err=grib_set_double_array(h2,key,ad,len1); - grib_context_free(h1->context,ad); - return err; - } - break; - case GRIB_TYPE_LONG: - if (len1==1) { - err=grib_get_long(h1,key,&l); - if (err) return err; - grib_context_log(h1->context,GRIB_LOG_DEBUG,"codes_copy_key long: %s=%ld\n",key,l); - err=grib_set_long(h2,key,l); - return err; - } else { - al=(long*)grib_context_malloc_clear(h1->context,len1*sizeof(long)); - err=grib_get_long_array(h1,key,al,&len1); - if (err) return err; - err=grib_set_long_array(h2,key,al,len1); - grib_context_free(h1->context,al); - return err; - } - break; - case GRIB_TYPE_STRING: - err=grib_get_string_length(h1,key,&len); - if (err) return err; - if (len1==1) { - s=(char*)grib_context_malloc_clear(h1->context,len); - err=grib_get_string(h1,key,s,&len); - if (err) return err; - grib_context_log(h1->context,GRIB_LOG_DEBUG,"codes_copy_key str: %s=%s\n",key,s); - err=grib_set_string(h2,key,s,&len); - grib_context_free(h1->context,s); - return err; - } else { - as=(char**)grib_context_malloc_clear(h1->context,len1*sizeof(char*)); - err=grib_get_string_array(h1,key,as,&len1); - if (err) return err; - err=grib_set_string_array(h2,key,(const char **)as,len1); - return err; - } - break; - default: - return GRIB_INVALID_TYPE; + case GRIB_TYPE_DOUBLE: + if (len1 == 1) { + err = grib_get_double(h1, key, &d); + if (err) + return err; + grib_context_log(h1->context, GRIB_LOG_DEBUG, "codes_copy_key double: %s=%g\n", key, d); + err = grib_set_double(h2, key, d); + return err; + } + else { + ad = (double*)grib_context_malloc_clear(h1->context, len1 * sizeof(double)); + err = grib_get_double_array(h1, key, ad, &len1); + if (err) + return err; + err = grib_set_double_array(h2, key, ad, len1); + grib_context_free(h1->context, ad); + return err; + } + break; + case GRIB_TYPE_LONG: + if (len1 == 1) { + err = grib_get_long(h1, key, &l); + if (err) + return err; + grib_context_log(h1->context, GRIB_LOG_DEBUG, "codes_copy_key long: %s=%ld\n", key, l); + err = grib_set_long(h2, key, l); + return err; + } + else { + al = (long*)grib_context_malloc_clear(h1->context, len1 * sizeof(long)); + err = grib_get_long_array(h1, key, al, &len1); + if (err) + return err; + err = grib_set_long_array(h2, key, al, len1); + grib_context_free(h1->context, al); + return err; + } + break; + case GRIB_TYPE_STRING: + err = grib_get_string_length(h1, key, &len); + if (err) + return err; + if (len1 == 1) { + s = (char*)grib_context_malloc_clear(h1->context, len); + err = grib_get_string(h1, key, s, &len); + if (err) + return err; + grib_context_log(h1->context, GRIB_LOG_DEBUG, "codes_copy_key str: %s=%s\n", key, s); + err = grib_set_string(h2, key, s, &len); + grib_context_free(h1->context, s); + return err; + } + else { + as = (char**)grib_context_malloc_clear(h1->context, len1 * sizeof(char*)); + err = grib_get_string_array(h1, key, as, &len1); + if (err) + return err; + err = grib_set_string_array(h2, key, (const char**)as, len1); + return err; + } + break; + default: + return GRIB_INVALID_TYPE; } } diff --git a/src/grib_vdarray.c b/src/grib_vdarray.c index 50f16034c..e3c037401 100644 --- a/src/grib_vdarray.c +++ b/src/grib_vdarray.c @@ -20,94 +20,108 @@ void grib_vdarray_print(const char* title, const grib_vdarray* vdarray) { size_t i; - char text[100]={0,}; + char text[100] = {0,}; Assert(vdarray); printf("%s: vdarray.n=%lu\n", title, (unsigned long)vdarray->n); - for (i=0; in; i++) { + for (i = 0; i < vdarray->n; i++) { sprintf(text, " vdarray->v[%lu]", (unsigned long)i); grib_darray_print(text, vdarray->v[i]); } printf("\n"); } -grib_vdarray* grib_vdarray_new(grib_context* c,size_t size,size_t incsize) +grib_vdarray* grib_vdarray_new(grib_context* c, size_t size, size_t incsize) { - grib_vdarray* v=NULL; - if (!c) c=grib_context_get_default(); - v=(grib_vdarray*)grib_context_malloc_clear(c,sizeof(grib_vdarray)); + grib_vdarray* v = NULL; + if (!c) + c = grib_context_get_default(); + v = (grib_vdarray*)grib_context_malloc_clear(c, sizeof(grib_vdarray)); if (!v) { - grib_context_log(c,GRIB_LOG_ERROR, - "grib_vdarray_new unable to allocate %d bytes\n",sizeof(grib_vdarray)); + grib_context_log(c, GRIB_LOG_ERROR, + "grib_vdarray_new unable to allocate %d bytes\n", sizeof(grib_vdarray)); return NULL; } - v->size=size; - v->n=0; - v->incsize=incsize; - v->v=(grib_darray**)grib_context_malloc_clear(c,sizeof(grib_darray*)*size); + v->size = size; + v->n = 0; + v->incsize = incsize; + v->v = (grib_darray**)grib_context_malloc_clear(c, sizeof(grib_darray*) * size); if (!v->v) { - grib_context_log(c,GRIB_LOG_ERROR, - "grib_vdarray_new unable to allocate %d bytes\n",sizeof(grib_darray*)*size); + grib_context_log(c, GRIB_LOG_ERROR, + "grib_vdarray_new unable to allocate %d bytes\n", sizeof(grib_darray*) * size); return NULL; } return v; } -grib_vdarray* grib_vdarray_resize(grib_context* c,grib_vdarray* v) +grib_vdarray* grib_vdarray_resize(grib_context* c, grib_vdarray* v) { - int newsize=v->incsize+v->size; + int newsize = v->incsize + v->size; - if (!c) c=grib_context_get_default(); + if (!c) + c = grib_context_get_default(); - v->v=(grib_darray**)grib_context_realloc(c,v->v,newsize*sizeof(grib_darray*)); - v->size=newsize; + v->v = (grib_darray**)grib_context_realloc(c, v->v, newsize * sizeof(grib_darray*)); + v->size = newsize; if (!v->v) { - grib_context_log(c,GRIB_LOG_ERROR, - "grib_vdarray_resize unable to allocate %d bytes\n",sizeof(grib_darray*)*newsize); + grib_context_log(c, GRIB_LOG_ERROR, + "grib_vdarray_resize unable to allocate %d bytes\n", sizeof(grib_darray*) * newsize); return NULL; } return v; } -grib_vdarray* grib_vdarray_push(grib_context* c,grib_vdarray* v,grib_darray* val) +grib_vdarray* grib_vdarray_push(grib_context* c, grib_vdarray* v, grib_darray* val) { - size_t start_size=100; - size_t start_incsize=100; - if (!v) v=grib_vdarray_new(c,start_size,start_incsize); + size_t start_size = 100; + size_t start_incsize = 100; + if (!v) + v = grib_vdarray_new(c, start_size, start_incsize); - if (v->n >= v->size) v=grib_vdarray_resize(c,v); - v->v[v->n]=val; + if (v->n >= v->size) + v = grib_vdarray_resize(c, v); + v->v[v->n] = val; v->n++; return v; } -void grib_vdarray_delete(grib_context* c,grib_vdarray* v) +void grib_vdarray_delete(grib_context* c, grib_vdarray* v) { - if (!v) return; - if (!c) grib_context_get_default(); - if (v->v) grib_context_free(c,v->v); - grib_context_free(c,v); + if (!v) + return; + if (!c) + grib_context_get_default(); + if (v->v) + grib_context_free(c, v->v); + grib_context_free(c, v); } -void grib_vdarray_delete_content(grib_context* c,grib_vdarray* v) +void grib_vdarray_delete_content(grib_context* c, grib_vdarray* v) { int i; - if (!v || !v->v) return; - if (!c) grib_context_get_default(); - for (i=0;in;i++) { - grib_darray_delete(c,v->v[i]); - v->v[i]=0; + if (!v || !v->v) + return; + if (!c) + grib_context_get_default(); + for (i = 0; i < v->n; i++) { + grib_darray_delete(c, v->v[i]); + v->v[i] = 0; } - v->n=0; + v->n = 0; } -grib_darray** grib_vdarray_get_array(grib_context* c,grib_vdarray* v) +grib_darray** grib_vdarray_get_array(grib_context* c, grib_vdarray* v) { grib_darray** ret; int i; - if (!v) return NULL; - ret=(grib_darray**)grib_context_malloc_clear(c,sizeof(grib_darray*)*v->n); - for (i=0;in;i++) ret[i]=v->v[i]; + if (!v) + return NULL; + ret = (grib_darray**)grib_context_malloc_clear(c, sizeof(grib_darray*) * v->n); + for (i = 0; i < v->n; i++) + ret[i] = v->v[i]; return ret; } -size_t grib_vdarray_used_size(grib_vdarray* v) { return v->n;} +size_t grib_vdarray_used_size(grib_vdarray* v) +{ + return v->n; +} diff --git a/src/grib_viarray.c b/src/grib_viarray.c index b54ea1c07..31a5fcc20 100644 --- a/src/grib_viarray.c +++ b/src/grib_viarray.c @@ -16,84 +16,98 @@ #include "grib_api_internal.h" -grib_viarray* grib_viarray_new(grib_context* c,size_t size,size_t incsize) +grib_viarray* grib_viarray_new(grib_context* c, size_t size, size_t incsize) { - grib_viarray* v=NULL; - if (!c) c=grib_context_get_default(); - v=(grib_viarray*)grib_context_malloc_clear(c,sizeof(grib_viarray)); + grib_viarray* v = NULL; + if (!c) + c = grib_context_get_default(); + v = (grib_viarray*)grib_context_malloc_clear(c, sizeof(grib_viarray)); if (!v) { - grib_context_log(c,GRIB_LOG_ERROR, - "grib_viarray_new unable to allocate %d bytes\n",sizeof(grib_viarray)); + grib_context_log(c, GRIB_LOG_ERROR, + "grib_viarray_new unable to allocate %d bytes\n", sizeof(grib_viarray)); return NULL; } - v->size=size; - v->n=0; - v->incsize=incsize; - v->v=(grib_iarray**)grib_context_malloc_clear(c,sizeof(grib_iarray*)*size); + v->size = size; + v->n = 0; + v->incsize = incsize; + v->v = (grib_iarray**)grib_context_malloc_clear(c, sizeof(grib_iarray*) * size); if (!v->v) { - grib_context_log(c,GRIB_LOG_ERROR, - "grib_viarray_new unable to allocate %d bytes\n",sizeof(grib_iarray*)*size); + grib_context_log(c, GRIB_LOG_ERROR, + "grib_viarray_new unable to allocate %d bytes\n", sizeof(grib_iarray*) * size); return NULL; } return v; } -grib_viarray* grib_viarray_resize(grib_context* c,grib_viarray* v) +grib_viarray* grib_viarray_resize(grib_context* c, grib_viarray* v) { - int newsize=v->incsize+v->size; + int newsize = v->incsize + v->size; - if (!c) c=grib_context_get_default(); + if (!c) + c = grib_context_get_default(); - v->v=(grib_iarray**)grib_context_realloc(c,v->v,newsize*sizeof(grib_iarray*)); - v->size=newsize; + v->v = (grib_iarray**)grib_context_realloc(c, v->v, newsize * sizeof(grib_iarray*)); + v->size = newsize; if (!v->v) { - grib_context_log(c,GRIB_LOG_ERROR, - "grib_viarray_resize unable to allocate %d bytes\n",sizeof(grib_iarray*)*newsize); + grib_context_log(c, GRIB_LOG_ERROR, + "grib_viarray_resize unable to allocate %d bytes\n", sizeof(grib_iarray*) * newsize); return NULL; } return v; } -grib_viarray* grib_viarray_push(grib_context* c,grib_viarray* v,grib_iarray* val) +grib_viarray* grib_viarray_push(grib_context* c, grib_viarray* v, grib_iarray* val) { - size_t start_size=100; - size_t start_incsize=100; - if (!v) v=grib_viarray_new(c,start_size,start_incsize); + size_t start_size = 100; + size_t start_incsize = 100; + if (!v) + v = grib_viarray_new(c, start_size, start_incsize); - if (v->n >= v->size) v=grib_viarray_resize(c,v); - v->v[v->n]=val; + if (v->n >= v->size) + v = grib_viarray_resize(c, v); + v->v[v->n] = val; v->n++; return v; } -void grib_viarray_delete(grib_context* c,grib_viarray* v) +void grib_viarray_delete(grib_context* c, grib_viarray* v) { - if (!v) return; - if (!c) grib_context_get_default(); - if (v->v) grib_context_free(c,v->v); - grib_context_free(c,v); + if (!v) + return; + if (!c) + grib_context_get_default(); + if (v->v) + grib_context_free(c, v->v); + grib_context_free(c, v); } -void grib_viarray_delete_content(grib_context* c,grib_viarray* v) +void grib_viarray_delete_content(grib_context* c, grib_viarray* v) { int i; - if (!v || !v->v) return; - if (!c) grib_context_get_default(); - for (i=0;in;i++) { + if (!v || !v->v) + return; + if (!c) + grib_context_get_default(); + for (i = 0; i < v->n; i++) { grib_iarray_delete(v->v[i]); - v->v[i]=0; + v->v[i] = 0; } - v->n=0; + v->n = 0; } -grib_iarray** grib_viarray_get_array(grib_context* c,grib_viarray* v) +grib_iarray** grib_viarray_get_array(grib_context* c, grib_viarray* v) { grib_iarray** ret; int i; - if (!v) return NULL; - ret=(grib_iarray**)grib_context_malloc_clear(c,sizeof(grib_iarray*)*v->n); - for (i=0;in;i++) ret[i]=v->v[i]; + if (!v) + return NULL; + ret = (grib_iarray**)grib_context_malloc_clear(c, sizeof(grib_iarray*) * v->n); + for (i = 0; i < v->n; i++) + ret[i] = v->v[i]; return ret; } -size_t grib_viarray_used_size(grib_viarray* v) { return v->n;} +size_t grib_viarray_used_size(grib_viarray* v) +{ + return v->n; +} diff --git a/src/grib_vsarray.c b/src/grib_vsarray.c index e1ceef83c..5c8d3e2db 100644 --- a/src/grib_vsarray.c +++ b/src/grib_vsarray.c @@ -16,85 +16,99 @@ #include "grib_api_internal.h" -grib_vsarray* grib_vsarray_new(grib_context* c,size_t size,size_t incsize) +grib_vsarray* grib_vsarray_new(grib_context* c, size_t size, size_t incsize) { - grib_vsarray* v=NULL; - if (!c) c=grib_context_get_default(); - v=(grib_vsarray*)grib_context_malloc_clear(c,sizeof(grib_vsarray)); + grib_vsarray* v = NULL; + if (!c) + c = grib_context_get_default(); + v = (grib_vsarray*)grib_context_malloc_clear(c, sizeof(grib_vsarray)); if (!v) { - grib_context_log(c,GRIB_LOG_ERROR, - "grib_vsarray_new unable to allocate %d bytes\n",sizeof(grib_vsarray)); + grib_context_log(c, GRIB_LOG_ERROR, + "grib_vsarray_new unable to allocate %d bytes\n", sizeof(grib_vsarray)); return NULL; } - v->size=size; - v->n=0; - v->incsize=incsize; - v->v=(grib_sarray**)grib_context_malloc_clear(c,sizeof(grib_sarray*)*size); + v->size = size; + v->n = 0; + v->incsize = incsize; + v->v = (grib_sarray**)grib_context_malloc_clear(c, sizeof(grib_sarray*) * size); if (!v->v) { - grib_context_log(c,GRIB_LOG_ERROR, - "grib_vsarray_new unable to allocate %d bytes\n",sizeof(grib_sarray*)*size); + grib_context_log(c, GRIB_LOG_ERROR, + "grib_vsarray_new unable to allocate %d bytes\n", sizeof(grib_sarray*) * size); return NULL; } return v; } -grib_vsarray* grib_vsarray_resize(grib_context* c,grib_vsarray* v) +grib_vsarray* grib_vsarray_resize(grib_context* c, grib_vsarray* v) { - int newsize=v->incsize+v->size; + int newsize = v->incsize + v->size; - if (!c) c=grib_context_get_default(); + if (!c) + c = grib_context_get_default(); - v->v=(grib_sarray**)grib_context_realloc(c,v->v,newsize*sizeof(grib_sarray*)); - v->size=newsize; + v->v = (grib_sarray**)grib_context_realloc(c, v->v, newsize * sizeof(grib_sarray*)); + v->size = newsize; if (!v->v) { - grib_context_log(c,GRIB_LOG_ERROR, - "grib_vsarray_resize unable to allocate %d bytes\n",sizeof(grib_sarray*)*newsize); + grib_context_log(c, GRIB_LOG_ERROR, + "grib_vsarray_resize unable to allocate %d bytes\n", sizeof(grib_sarray*) * newsize); return NULL; } return v; } -grib_vsarray* grib_vsarray_push(grib_context* c,grib_vsarray* v,grib_sarray* val) +grib_vsarray* grib_vsarray_push(grib_context* c, grib_vsarray* v, grib_sarray* val) { - size_t start_size=100; - size_t start_incsize=100; - if (!v) v=grib_vsarray_new(c,start_size,start_incsize); + size_t start_size = 100; + size_t start_incsize = 100; + if (!v) + v = grib_vsarray_new(c, start_size, start_incsize); - if (v->n >= v->size) v=grib_vsarray_resize(c,v); - v->v[v->n]=val; + if (v->n >= v->size) + v = grib_vsarray_resize(c, v); + v->v[v->n] = val; v->n++; return v; } -void grib_vsarray_delete(grib_context* c,grib_vsarray* v) +void grib_vsarray_delete(grib_context* c, grib_vsarray* v) { - if (!v) return; - if (!c) grib_context_get_default(); - if (v->v) grib_context_free(c,v->v); - grib_context_free(c,v); + if (!v) + return; + if (!c) + grib_context_get_default(); + if (v->v) + grib_context_free(c, v->v); + grib_context_free(c, v); } -void grib_vsarray_delete_content(grib_context* c,grib_vsarray* v) +void grib_vsarray_delete_content(grib_context* c, grib_vsarray* v) { int i; - if (!v || !v->v) return; - if (!c) grib_context_get_default(); - for (i=0;in;i++) { - grib_sarray_delete_content(c,v->v[i]); - grib_sarray_delete(c,v->v[i]); - v->v[i]=0; + if (!v || !v->v) + return; + if (!c) + grib_context_get_default(); + for (i = 0; i < v->n; i++) { + grib_sarray_delete_content(c, v->v[i]); + grib_sarray_delete(c, v->v[i]); + v->v[i] = 0; } - v->n=0; + v->n = 0; } -grib_sarray** grib_vsarray_get_array(grib_context* c,grib_vsarray* v) +grib_sarray** grib_vsarray_get_array(grib_context* c, grib_vsarray* v) { grib_sarray** ret; int i; - if (!v) return NULL; - ret=(grib_sarray**)grib_context_malloc_clear(c,sizeof(grib_sarray*)*v->n); - for (i=0;in;i++) ret[i]=v->v[i]; + if (!v) + return NULL; + ret = (grib_sarray**)grib_context_malloc_clear(c, sizeof(grib_sarray*) * v->n); + for (i = 0; i < v->n; i++) + ret[i] = v->v[i]; return ret; } -size_t grib_vsarray_used_size(grib_vsarray* v) { return v->n;} +size_t grib_vsarray_used_size(grib_vsarray* v) +{ + return v->n; +} diff --git a/src/make_class.pl b/src/make_class.pl index fc8a79f76..b7abb2937 100755 --- a/src/make_class.pl +++ b/src/make_class.pl @@ -100,7 +100,7 @@ sub super_members { my $class = cleanup($s->{NAME}); my @members = map { cleanup($_);} split(";",$s->{MEMBERS}); - unshift @members, "/* Members defined in $class */"; + unshift @members, " /* Members defined in $class */"; unshift @{$list}, @members; @@ -117,7 +117,7 @@ sub output { my $name = cleanup($args->{NAME}); my @members = map { cleanup($_);} split(";",$args->{MEMBERS}); - unshift @members, "/* Members defined in $name */"; + unshift @members, " /* Members defined in $name */"; my @implements = map { cleanup($_);} split(";",$args->{IMPLEMENTS}); @@ -190,7 +190,7 @@ sub output { } else { - print OUT "\t$m;\n"; + print OUT " $m;\n"; } } next; @@ -241,7 +241,7 @@ sub output { foreach my $c ( grep { !$implements{$_} } grep { ! /\binit\b|\bdestroy\b|\bpost_init\b/ } @procs ) { - print OUT "\tc->$c\t=\t(*(c->super))->$c;\n"; + print OUT " c->$c = (*(c->super))->$c;\n"; } next; } @@ -255,10 +255,10 @@ sub output { foreach my $proc ( grep { /clone/ } @procs ) { my $done=0; print OUT "static grib_$class* clone(grib_$class* s) {\n"; - print OUT "\tgrib_${class}_$name* c=grib_context_alloc_clear(a->parent->h,sizeof(grib_${class}_$name));\n"; + print OUT " grib_${class}_$name* c=grib_context_alloc_clear(a->parent->h,sizeof(grib_${class}_$name));\n"; foreach my $m ( @members ) { if ( $m =~ /\/\*/ ) {next;} - print OUT "\n\tgrib_${class}_$name* self=(grib_${class}_$name*)s;\n\n" unless ($done); + print OUT "\n grib_${class}_$name* self=(grib_${class}_$name*)s;\n\n" unless ($done); $done=1; my $is_pointer=0; my @ma=split(/ /,$m); @@ -269,18 +269,18 @@ sub output { if ($is_pointer) { if ($mtype =~ "\bchar\b") { - print OUT "\tif (self->$mname) \n\t\tc->$mname=grib_context_strdup(a->parent->h,self->$mname);\n\n"; + print OUT " if (self->$mname) \n c->$mname=grib_context_strdup(a->parent->h,self->$mname);\n\n"; } if ($mtype =~ "\b(double|long|int|float)\b") { - print OUT "\tif (self->".$mname."_size) {\n"; - print OUT "\tint i=0;\n"; - print OUT "\tc->$mname=grib_context_alloc_clear(a->parent->h,self->".$mname."_size*sizeof($mtype));"; - print OUT "\tfor (i=0;i${mname}_size;i++) c->".$mname."[i]=self->".$mname."[i];"; + print OUT " if (self->".$mname."_size) {\n"; + print OUT " int i=0;\n"; + print OUT " c->$mname=grib_context_alloc_clear(a->parent->h,self->".$mname."_size*sizeof($mtype));"; + print OUT " for (i=0;i${mname}_size;i++) c->".$mname."[i]=self->".$mname."[i];"; print OUT "}\n"; } - } else { print OUT "\tc->$mname=self->$mname;\n\n"; } + } else { print OUT " c->$mname=self->$mname;\n\n"; } } - print OUT "\treturn (grib_$class*)c;\n}\n\n" + print OUT " return (grib_$class*)c;\n}\n\n" } } diff --git a/src/md5.c b/src/md5.c index 9a2f52c67..2bdb55fed 100644 --- a/src/md5.c +++ b/src/md5.c @@ -16,14 +16,15 @@ /* On CRAY, disable all automatic optimisations for this module */ #if _CRAYC - #pragma _CRI noopt +#pragma _CRI noopt #endif static const unsigned long r[] = { 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, - 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, + 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, - 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21}; + 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21 +}; static const unsigned long k[] = { 0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee, 0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501, @@ -33,7 +34,8 @@ static const unsigned long k[] = { 0xfffa3942, 0x8771f681, 0x6d9d6122, 0xfde5380c, 0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70, 0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x04881d05, 0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665, 0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039, 0x655b59c3, 0x8f0ccc92, 0xffeff47d, 0x85845dd1, - 0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1, 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391}; + 0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1, 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391 +}; #if 0 static const unsigned long t = 32; @@ -48,108 +50,122 @@ static unsigned long I(unsigned long x,unsigned long y,unsigned long z) { return #endif -#define ROT(x,c) ((x << c) | (x >> (32-c))) - -#define _F(x,y,z) ((x&y)|((~x)&z)) -#define _G(x,y,z) ((x&z)|(y&(~z))) -#define _H(x,y,z) (x^y^z) -#define _I(x,y,z) (y^(x|(~z))) - -#define F_(A,B,C,D,g,i) A += _F(B,C,D)+w[g]+k[i]; A &= 0xffffffff; A = ROT(A, r[i]); A+=B; -#define G_(A,B,C,D,g,i) A += _G(B,C,D)+w[g]+k[i]; A &= 0xffffffff; A = ROT(A, r[i]); A+=B; -#define H_(A,B,C,D,g,i) A += _H(B,C,D)+w[g]+k[i]; A &= 0xffffffff; A = ROT(A, r[i]); A+=B; -#define I_(A,B,C,D,g,i) A += _I(B,C,D)+w[g]+k[i]; A &= 0xffffffff; A = ROT(A, r[i]); A+=B; +#define ROT(x, c) ((x << c) | (x >> (32 - c))) + +#define _F(x, y, z) ((x & y) | ((~x) & z)) +#define _G(x, y, z) ((x & z) | (y & (~z))) +#define _H(x, y, z) (x ^ y ^ z) +#define _I(x, y, z) (y ^ (x | (~z))) + +#define F_(A, B, C, D, g, i) \ + A += _F(B, C, D) + w[g] + k[i]; \ + A &= 0xffffffff; \ + A = ROT(A, r[i]); \ + A += B; +#define G_(A, B, C, D, g, i) \ + A += _G(B, C, D) + w[g] + k[i]; \ + A &= 0xffffffff; \ + A = ROT(A, r[i]); \ + A += B; +#define H_(A, B, C, D, g, i) \ + A += _H(B, C, D) + w[g] + k[i]; \ + A &= 0xffffffff; \ + A = ROT(A, r[i]); \ + A += B; +#define I_(A, B, C, D, g, i) \ + A += _I(B, C, D) + w[g] + k[i]; \ + A &= 0xffffffff; \ + A = ROT(A, r[i]); \ + A += B; static void grib_md5_flush(grib_md5_state* s) { - - #if 1 - unsigned long a = s->h0; - unsigned long b = s->h1; - unsigned long c = s->h2; - unsigned long d = s->h3; - unsigned long *w = &s->words[0]; - - F_(a,b,c,d, 0, 0); - F_(d,a,b,c, 1, 1); - F_(c,d,a,b, 2, 2); - F_(b,c,d,a, 3, 3); - - F_(a,b,c,d, 4, 4); - F_(d,a,b,c, 5, 5); - F_(c,d,a,b, 6, 6); - F_(b,c,d,a, 7, 7); - - F_(a,b,c,d, 8, 8); - F_(d,a,b,c, 9, 9); - F_(c,d,a,b,10,10); - F_(b,c,d,a,11,11); - - F_(a,b,c,d,12,12); - F_(d,a,b,c,13,13); - F_(c,d,a,b,14,14); - F_(b,c,d,a,15,15); - - G_(a,b,c,d, 1,16); - G_(d,a,b,c, 6,17); - G_(c,d,a,b,11,18); - G_(b,c,d,a, 0,19); - - G_(a,b,c,d, 5,20); - G_(d,a,b,c,10,21); - G_(c,d,a,b,15,22); - G_(b,c,d,a, 4,23); - - G_(a,b,c,d, 9,24); - G_(d,a,b,c,14,25); - G_(c,d,a,b, 3,26); - G_(b,c,d,a, 8,27); - - G_(a,b,c,d,13,28); - G_(d,a,b,c, 2,29); - G_(c,d,a,b, 7,30); - G_(b,c,d,a,12,31); - - H_(a,b,c,d, 5,32); - H_(d,a,b,c, 8,33); - H_(c,d,a,b,11,34); - H_(b,c,d,a,14,35); - - H_(a,b,c,d, 1,36); - H_(d,a,b,c, 4,37); - H_(c,d,a,b, 7,38); - H_(b,c,d,a,10,39); - - H_(a,b,c,d,13,40); - H_(d,a,b,c, 0,41); - H_(c,d,a,b, 3,42); - H_(b,c,d,a, 6,43); - - H_(a,b,c,d, 9,44); - H_(d,a,b,c,12,45); - H_(c,d,a,b,15,46); - H_(b,c,d,a, 2,47); - - I_(a,b,c,d, 0,48); - I_(d,a,b,c, 7,49); - I_(c,d,a,b,14,50); - I_(b,c,d,a, 5,51); - - I_(a,b,c,d,12,52); - I_(d,a,b,c, 3,53); - I_(c,d,a,b,10,54); - I_(b,c,d,a, 1,55); - - I_(a,b,c,d, 8,56); - I_(d,a,b,c,15,57); - I_(c,d,a,b, 6,58); - I_(b,c,d,a,13,59); - - I_(a,b,c,d, 4,60); - I_(d,a,b,c,11,61); - I_(c,d,a,b, 2,62); - I_(b,c,d,a, 9,63); + unsigned long a = s->h0; + unsigned long b = s->h1; + unsigned long c = s->h2; + unsigned long d = s->h3; + unsigned long* w = &s->words[0]; + + F_(a, b, c, d, 0, 0); + F_(d, a, b, c, 1, 1); + F_(c, d, a, b, 2, 2); + F_(b, c, d, a, 3, 3); + + F_(a, b, c, d, 4, 4); + F_(d, a, b, c, 5, 5); + F_(c, d, a, b, 6, 6); + F_(b, c, d, a, 7, 7); + + F_(a, b, c, d, 8, 8); + F_(d, a, b, c, 9, 9); + F_(c, d, a, b, 10, 10); + F_(b, c, d, a, 11, 11); + + F_(a, b, c, d, 12, 12); + F_(d, a, b, c, 13, 13); + F_(c, d, a, b, 14, 14); + F_(b, c, d, a, 15, 15); + + G_(a, b, c, d, 1, 16); + G_(d, a, b, c, 6, 17); + G_(c, d, a, b, 11, 18); + G_(b, c, d, a, 0, 19); + + G_(a, b, c, d, 5, 20); + G_(d, a, b, c, 10, 21); + G_(c, d, a, b, 15, 22); + G_(b, c, d, a, 4, 23); + + G_(a, b, c, d, 9, 24); + G_(d, a, b, c, 14, 25); + G_(c, d, a, b, 3, 26); + G_(b, c, d, a, 8, 27); + + G_(a, b, c, d, 13, 28); + G_(d, a, b, c, 2, 29); + G_(c, d, a, b, 7, 30); + G_(b, c, d, a, 12, 31); + + H_(a, b, c, d, 5, 32); + H_(d, a, b, c, 8, 33); + H_(c, d, a, b, 11, 34); + H_(b, c, d, a, 14, 35); + + H_(a, b, c, d, 1, 36); + H_(d, a, b, c, 4, 37); + H_(c, d, a, b, 7, 38); + H_(b, c, d, a, 10, 39); + + H_(a, b, c, d, 13, 40); + H_(d, a, b, c, 0, 41); + H_(c, d, a, b, 3, 42); + H_(b, c, d, a, 6, 43); + + H_(a, b, c, d, 9, 44); + H_(d, a, b, c, 12, 45); + H_(c, d, a, b, 15, 46); + H_(b, c, d, a, 2, 47); + + I_(a, b, c, d, 0, 48); + I_(d, a, b, c, 7, 49); + I_(c, d, a, b, 14, 50); + I_(b, c, d, a, 5, 51); + + I_(a, b, c, d, 12, 52); + I_(d, a, b, c, 3, 53); + I_(c, d, a, b, 10, 54); + I_(b, c, d, a, 1, 55); + + I_(a, b, c, d, 8, 56); + I_(d, a, b, c, 15, 57); + I_(c, d, a, b, 6, 58); + I_(b, c, d, a, 13, 59); + + I_(a, b, c, d, 4, 60); + I_(d, a, b, c, 11, 61); + I_(c, d, a, b, 2, 62); + I_(b, c, d, a, 9, 63); #else unsigned long i, g; @@ -159,48 +175,48 @@ static void grib_md5_flush(grib_md5_state* s) unsigned long d = s->h3; unsigned long f; unsigned long temp; - unsigned long *w = &s->words[0]; + unsigned long* w = &s->words[0]; unsigned long h; - for(i=0; i< 16; i++) { - f = F(b,c,d); - g = i; + for (i = 0; i < 16; i++) { + f = F(b, c, d); + g = i; temp = d; - d = c; - c = b; - h = a + f + k[i] + w[g]; - b = b + rotate(h , r[i]); - a = temp; + d = c; + c = b; + h = a + f + k[i] + w[g]; + b = b + rotate(h, r[i]); + a = temp; } - for(i=16; i< 32; i++) { - f = G(b,c,d); - g = (5*i + 1) % 16; + for (i = 16; i < 32; i++) { + f = G(b, c, d); + g = (5 * i + 1) % 16; temp = d; - d = c; - c = b; - h = a + f + k[i] + w[g]; - b = b + rotate(h , r[i]); - a = temp; + d = c; + c = b; + h = a + f + k[i] + w[g]; + b = b + rotate(h, r[i]); + a = temp; } - for(i=32; i< 48; i++) { - f = H(b,c,d); - g = (3*i + 5) % 16; + for (i = 32; i < 48; i++) { + f = H(b, c, d); + g = (3 * i + 5) % 16; temp = d; - d = c; - c = b; - h = a + f + k[i] + w[g]; - b = b + rotate(h , r[i]); - a = temp; + d = c; + c = b; + h = a + f + k[i] + w[g]; + b = b + rotate(h, r[i]); + a = temp; } - for(i=48; i< 64; i++) { - f = I(b,c,d); - g = (7*i) % 16; + for (i = 48; i < 64; i++) { + f = I(b, c, d); + g = (7 * i) % 16; temp = d; - d = c; - c = b; - h = a + f + k[i] + w[g]; - b = b + rotate(h, r[i]); - a = temp; + d = c; + c = b; + h = a + f + k[i] + w[g]; + b = b + rotate(h, r[i]); + a = temp; } #endif @@ -215,53 +231,52 @@ static void grib_md5_flush(grib_md5_state* s) void grib_md5_init(grib_md5_state* s) { - Assert( sizeof(uint64_t) == 8 ); - memset(s,0,sizeof(grib_md5_state)); + Assert(sizeof(uint64_t) == 8); + memset(s, 0, sizeof(grib_md5_state)); s->h0 = 0x67452301; s->h1 = 0xefcdab89; s->h2 = 0x98badcfe; s->h3 = 0x10325476; } -void grib_md5_add(grib_md5_state* s,const void* data,size_t len) +void grib_md5_add(grib_md5_state* s, const void* data, size_t len) { unsigned char* p = (unsigned char*)data; s->size += len; - while(len-- > 0) { + while (len-- > 0) { s->bytes[s->byte_count++] = *p++; - if(s->byte_count == 4) { - s->words[s->word_count++] = (s->bytes[3]<<24)|(s->bytes[2]<<16)|(s->bytes[1]<<8)|(s->bytes[0]); - s->byte_count = 0; + if (s->byte_count == 4) { + s->words[s->word_count++] = (s->bytes[3] << 24) | (s->bytes[2] << 16) | (s->bytes[1] << 8) | (s->bytes[0]); + s->byte_count = 0; - if(s->word_count == 16) + if (s->word_count == 16) grib_md5_flush(s); } } } -void grib_md5_end(grib_md5_state* s, char *digest) +void grib_md5_end(grib_md5_state* s, char* digest) { uint64_t h = 8; uint64_t bits, leng = s->size * h; unsigned char c = 0x80; int i; - grib_md5_add(s,&c,1); + grib_md5_add(s, &c, 1); bits = s->size * h; - c = 0; - while( (bits % 512) != 448) - { - grib_md5_add(s,&c,1); + c = 0; + while ((bits % 512) != 448) { + grib_md5_add(s, &c, 1); bits = s->size * h; } - for(i = 0; i < 8 ; i++) { - c = leng & 0xff; + for (i = 0; i < 8; i++) { + c = leng & 0xff; leng >>= 8; - grib_md5_add(s,&c,1); + grib_md5_add(s, &c, 1); } #define U(x) ((unsigned int)(x)) diff --git a/src/minmax_val.c b/src/minmax_val.c index 1609de9a2..5cd578fbd 100644 --- a/src/minmax_val.c +++ b/src/minmax_val.c @@ -41,8 +41,7 @@ #ifdef __AVX__ -static -void avx_minmax_val(const double *restrict buf, long nframes, double *min, double *max) +static void avx_minmax_val(const double* restrict buf, long nframes, double* min, double* max) { __m256d current_max, current_min, work; @@ -51,10 +50,9 @@ void avx_minmax_val(const double *restrict buf, long nframes, double *min, doubl current_max = _mm256_set1_pd(*max); /* Work input until "buf" reaches 32 byte alignment */ - while ( ((unsigned long)buf) % 32 != 0 && nframes > 0) { - + while (((unsigned long)buf) % 32 != 0 && nframes > 0) { /* Load the next double into the work buffer */ - work = _mm256_set1_pd(*buf); + work = _mm256_set1_pd(*buf); current_min = _mm256_min_pd(current_min, work); current_max = _mm256_max_pd(current_max, work); buf++; @@ -63,24 +61,24 @@ void avx_minmax_val(const double *restrict buf, long nframes, double *min, doubl while (nframes >= 16) { /* use 64 byte prefetch? */ - __builtin_prefetch(buf+64,0,0); /* for GCC 4.3.2+ */ + __builtin_prefetch(buf + 64, 0, 0); /* for GCC 4.3.2+ */ - work = _mm256_load_pd(buf); + work = _mm256_load_pd(buf); current_min = _mm256_min_pd(current_min, work); current_max = _mm256_max_pd(current_max, work); buf += 4; - __builtin_prefetch(buf+64,0,0); /* for GCC 4.3.2+ */ - work = _mm256_load_pd(buf); + __builtin_prefetch(buf + 64, 0, 0); /* for GCC 4.3.2+ */ + work = _mm256_load_pd(buf); current_min = _mm256_min_pd(current_min, work); current_max = _mm256_max_pd(current_max, work); buf += 4; - __builtin_prefetch(buf+64,0,0); /* for GCC 4.3.2+ */ - work = _mm256_load_pd(buf); + __builtin_prefetch(buf + 64, 0, 0); /* for GCC 4.3.2+ */ + work = _mm256_load_pd(buf); current_min = _mm256_min_pd(current_min, work); current_max = _mm256_max_pd(current_max, work); buf += 4; - __builtin_prefetch(buf+64,0,0); /* for GCC 4.3.2+ */ - work = _mm256_load_pd(buf); + __builtin_prefetch(buf + 64, 0, 0); /* for GCC 4.3.2+ */ + work = _mm256_load_pd(buf); current_min = _mm256_min_pd(current_min, work); current_max = _mm256_max_pd(current_max, work); buf += 4; @@ -89,7 +87,7 @@ void avx_minmax_val(const double *restrict buf, long nframes, double *min, doubl /* work through aligned buffers */ while (nframes >= 4) { - work = _mm256_load_pd(buf); + work = _mm256_load_pd(buf); current_min = _mm256_min_pd(current_min, work); current_max = _mm256_max_pd(current_max, work); buf += 4; @@ -97,8 +95,8 @@ void avx_minmax_val(const double *restrict buf, long nframes, double *min, doubl } /* work through the remainung values */ - while ( nframes > 0) { - work = _mm256_set1_pd(*buf); + while (nframes > 0) { + work = _mm256_set1_pd(*buf); current_min = _mm256_min_pd(current_min, work); current_max = _mm256_max_pd(current_max, work); buf++; @@ -107,19 +105,19 @@ void avx_minmax_val(const double *restrict buf, long nframes, double *min, doubl /* find min & max value through shuffle tricks */ - work = current_min; - work = _mm256_shuffle_pd(work, work, _MM_SHUFFLE(2, 3, 0, 1)); - work = _mm256_min_pd (work, current_min); + work = current_min; + work = _mm256_shuffle_pd(work, work, _MM_SHUFFLE(2, 3, 0, 1)); + work = _mm256_min_pd(work, current_min); current_min = work; - work = _mm256_shuffle_pd(work, work, _MM_SHUFFLE(1, 0, 3, 2)); - work = _mm256_min_pd (work, current_min); + work = _mm256_shuffle_pd(work, work, _MM_SHUFFLE(1, 0, 3, 2)); + work = _mm256_min_pd(work, current_min); _mm256_store_pd(min, work); - work = current_max; - work = _mm256_shuffle_pd(work, work, _MM_SHUFFLE(2, 3, 0, 1)); - work = _mm256_max_pd (work, current_max); + work = current_max; + work = _mm256_shuffle_pd(work, work, _MM_SHUFFLE(2, 3, 0, 1)); + work = _mm256_max_pd(work, current_max); current_max = work; - work = _mm256_shuffle_pd(work, work, _MM_SHUFFLE(1, 0, 3, 2)); - work = _mm256_max_pd (work, current_max); + work = _mm256_shuffle_pd(work, work, _MM_SHUFFLE(1, 0, 3, 2)); + work = _mm256_max_pd(work, current_max); _mm256_store_pd(max, work); return; @@ -128,8 +126,7 @@ void avx_minmax_val(const double *restrict buf, long nframes, double *min, doubl #else #ifdef __SSE2__ -static -void sse2_minmax_val(const double *restrict buf, long nframes, double *min, double *max) +static void sse2_minmax_val(const double* restrict buf, long nframes, double* min, double* max) { __m128d current_max, current_min, work; @@ -138,10 +135,9 @@ void sse2_minmax_val(const double *restrict buf, long nframes, double *min, doub current_max = _mm_set1_pd(*max); /* work on input until buf reaches 16 byte alignment */ - while ( ((unsigned long)buf) % 16 != 0 && nframes > 0) { - + while (((unsigned long)buf) % 16 != 0 && nframes > 0) { /* load one double and replicate */ - work = _mm_set1_pd(*buf); + work = _mm_set1_pd(*buf); current_min = _mm_min_pd(current_min, work); current_max = _mm_max_pd(current_max, work); buf++; @@ -150,21 +146,21 @@ void sse2_minmax_val(const double *restrict buf, long nframes, double *min, doub while (nframes >= 8) { /* use 64 byte prefetch for double octetts */ - __builtin_prefetch(buf+64,0,0); /* for GCC 4.3.2 + */ + __builtin_prefetch(buf + 64, 0, 0); /* for GCC 4.3.2 + */ - work = _mm_load_pd(buf); + work = _mm_load_pd(buf); current_min = _mm_min_pd(current_min, work); current_max = _mm_max_pd(current_max, work); buf += 2; - work = _mm_load_pd(buf); + work = _mm_load_pd(buf); current_min = _mm_min_pd(current_min, work); current_max = _mm_max_pd(current_max, work); buf += 2; - work = _mm_load_pd(buf); + work = _mm_load_pd(buf); current_min = _mm_min_pd(current_min, work); current_max = _mm_max_pd(current_max, work); buf += 2; - work = _mm_load_pd(buf); + work = _mm_load_pd(buf); current_min = _mm_min_pd(current_min, work); current_max = _mm_max_pd(current_max, work); buf += 2; @@ -173,7 +169,7 @@ void sse2_minmax_val(const double *restrict buf, long nframes, double *min, doub /* work through smaller chunks of aligned buffers without prefetching */ while (nframes >= 2) { - work = _mm_load_pd(buf); + work = _mm_load_pd(buf); current_min = _mm_min_pd(current_min, work); current_max = _mm_max_pd(current_max, work); buf += 2; @@ -181,9 +177,9 @@ void sse2_minmax_val(const double *restrict buf, long nframes, double *min, doub } /* work through the remaining value */ - while ( nframes > 0) { + while (nframes > 0) { /* load the last double and replicate */ - work = _mm_set1_pd(*buf); + work = _mm_set1_pd(*buf); current_min = _mm_min_pd(current_min, work); current_max = _mm_max_pd(current_max, work); buf++; @@ -193,11 +189,11 @@ void sse2_minmax_val(const double *restrict buf, long nframes, double *min, doub /* find final min and max value through shuffle tricks */ work = current_min; work = _mm_shuffle_pd(work, work, _MM_SHUFFLE2(0, 1)); - work = _mm_min_pd (work, current_min); + work = _mm_min_pd(work, current_min); _mm_store_sd(min, work); work = current_max; work = _mm_shuffle_pd(work, work, _MM_SHUFFLE2(0, 1)); - work = _mm_max_pd (work, current_max); + work = _mm_max_pd(work, current_max); _mm_store_sd(max, work); return; @@ -206,16 +202,16 @@ void sse2_minmax_val(const double *restrict buf, long nframes, double *min, doub #endif -static -void minmax_val(const double *restrict data, long datasize, double *fmin, double *fmax) +static void minmax_val(const double* restrict data, long datasize, double* fmin, double* fmax) { -#ifdef _GET_X86_COUNTER +#ifdef _GET_X86_COUNTER uint64_t start_minmax, end_minmax; #endif - if ( datasize < 1 ) return; + if (datasize < 1) + return; -#ifdef _GET_X86_COUNTER +#ifdef _GET_X86_COUNTER start_minmax = _rdtsc(); #endif @@ -235,76 +231,72 @@ void minmax_val(const double *restrict data, long datasize, double *fmin, double #ifdef _ARCH_PWR6 #define __UNROLL_DEPTH_1 6 - /* to allow pipelining we have to unroll */ + /* to allow pipelining we have to unroll */ -#ifdef _GET_IBM_COUNTER +#ifdef _GET_IBM_COUNTER hpmStart(1, "minmax fsel"); #endif { long i, j; - long residual = datasize % __UNROLL_DEPTH_1; + long residual = datasize % __UNROLL_DEPTH_1; long ofs = datasize - residual; double register dmin[__UNROLL_DEPTH_1]; double register dmax[__UNROLL_DEPTH_1]; - for ( j = 0; j < __UNROLL_DEPTH_1; j++) - { + for (j = 0; j < __UNROLL_DEPTH_1; j++) { dmin[j] = data[0]; dmax[j] = data[0]; } - for ( i = 0; i < datasize - residual; i += __UNROLL_DEPTH_1 ) - { - for (j = 0; j < __UNROLL_DEPTH_1; j++) - { - dmin[j] = __fsel(dmin[j] - data[i+j], data[i+j], dmin[j]); - dmax[j] = __fsel(data[i+j] - dmax[j], data[i+j], dmax[j]); + for (i = 0; i < datasize - residual; i += __UNROLL_DEPTH_1) { + for (j = 0; j < __UNROLL_DEPTH_1; j++) { + dmin[j] = __fsel(dmin[j] - data[i + j], data[i + j], dmin[j]); + dmax[j] = __fsel(data[i + j] - dmax[j], data[i + j], dmax[j]); } } - for (j = 0; j < residual; j++) - { - dmin[j] = __fsel(dmin[j] - data[ofs+j], data[ofs+j], dmin[j]); - dmax[j] = __fsel(data[ofs+j] - dmax[j], data[ofs+j], dmax[j]); + for (j = 0; j < residual; j++) { + dmin[j] = __fsel(dmin[j] - data[ofs + j], data[ofs + j], dmin[j]); + dmax[j] = __fsel(data[ofs + j] - dmax[j], data[ofs + j], dmax[j]); } - for ( j = 0; j < __UNROLL_DEPTH_1; j++) - { + for (j = 0; j < __UNROLL_DEPTH_1; j++) { *fmin = __fsel(*fmin - dmin[j], dmin[j], *fmin); *fmax = __fsel(dmax[j] - *fmax, dmax[j], *fmax); } } -#ifdef _GET_IBM_COUNTER +#ifdef _GET_IBM_COUNTER hpmStop(1); #endif #undef __UNROLL_DEPTH_1 #else -#ifdef _GET_IBM_COUNTER +#ifdef _GET_IBM_COUNTER hpmStart(1, "minmax base"); #endif { long i; -#if defined (CRAY) +#if defined(CRAY) #pragma _CRI ivdep -#elif defined (SX) +#elif defined(SX) #pragma vdir nodep -#elif defined (__uxp__) +#elif defined(__uxp__) #pragma loop novrec #endif - for ( i = 0; i < datasize; ++i ) - { - if ( *fmin > data[i] ) *fmin = data[i]; - if ( *fmax < data[i] ) *fmax = data[i]; + for (i = 0; i < datasize; ++i) { + if (*fmin > data[i]) + *fmin = data[i]; + if (*fmax < data[i]) + *fmax = data[i]; /* *fmin = *fmin < data[i] ? *fmin : data[i]; *fmax = *fmax > data[i] ? *fmax : data[i]; */ } } -#ifdef _GET_IBM_COUNTER +#ifdef _GET_IBM_COUNTER hpmStop(1); #endif @@ -312,19 +304,19 @@ void minmax_val(const double *restrict data, long datasize, double *fmin, double #endif #endif -#ifdef _GET_X86_COUNTER +#ifdef _GET_X86_COUNTER end_minmax = _rdtsc(); #ifdef __AVX__ printf("AVX cycles:: %" PRIu64 "\n", - end_minmax-start_minmax); + end_minmax - start_minmax); #else #ifdef __SSE2__ printf("SSE2 cycles:: %" PRIu64 "\n", - end_minmax-start_minmax); + end_minmax - start_minmax); #else printf("loop cycles:: %" PRIu64 "\n", - end_minmax-start_minmax); -#endif + end_minmax - start_minmax); +#endif #endif #endif diff --git a/src/string_util.c b/src/string_util.c index 344aa8a03..7b55c624a 100644 --- a/src/string_util.c +++ b/src/string_util.c @@ -14,10 +14,10 @@ * strcasecmp is not in the C standard. However, it's defined by * 4.4BSD, POSIX.1-2001. So we use our own */ -int strcmp_nocase(const char *s1, const char *s2) +int strcmp_nocase(const char* s1, const char* s2) { - const unsigned char *us1 = (const unsigned char *)s1, - *us2 = (const unsigned char *)s2; + const unsigned char *us1 = (const unsigned char*)s1, + *us2 = (const unsigned char*)s2; while (tolower(*us1) == tolower(*us2++)) { if (*us1++ == '\0') @@ -30,7 +30,8 @@ int strcmp_nocase(const char *s1, const char *s2) void rtrim(char* s) { size_t len = 0; - if (!s) return; + if (!s) + return; len = strlen(s); while (len > 0 && isspace((unsigned char)s[len - 1])) len--; @@ -46,9 +47,12 @@ const char* extract_filename(const char* filepath) * so have to check both separators */ const char* s = strrchr(filepath, '/'); - if (!s) s = strrchr(filepath, '\\'); - if (!s) return filepath; - else return s + 1; + if (!s) + s = strrchr(filepath, '\\'); + if (!s) + return filepath; + else + return s + 1; } /* Returns an array of strings the last of which is NULL. @@ -57,17 +61,17 @@ const char* extract_filename(const char* filepath) */ char** string_split(char* inputString, const char* delimiter) { - char** result = NULL; - char* p = inputString; + char** result = NULL; + char* p = inputString; char* lastDelimiter = NULL; - char* aToken = NULL; - size_t numTokens = 0; - size_t strLength = 0; - size_t index = 0; - char delimiterChar = 0; + char* aToken = NULL; + size_t numTokens = 0; + size_t strLength = 0; + size_t index = 0; + char delimiterChar = 0; DebugAssert(inputString); - DebugAssert( delimiter && (strlen(delimiter)==1) ); + DebugAssert(delimiter && (strlen(delimiter) == 1)); delimiterChar = delimiter[0]; while (*p) { const char ctmp = *p; @@ -91,7 +95,7 @@ char** string_split(char* inputString, const char* delimiter) while (aToken) { Assert(index < numTokens); *(result + index++) = strdup(aToken); - aToken = strtok(NULL, delimiter); + aToken = strtok(NULL, delimiter); } Assert(index == numTokens - 1); *(result + index) = NULL; @@ -103,16 +107,16 @@ char** string_split(char* inputString, const char* delimiter) int string_to_long(const char* input, long* output) { const int base = 10; - char *endptr; + char* endptr; long val = 0; - if (!input) return GRIB_INVALID_ARGUMENT; + if (!input) + return GRIB_INVALID_ARGUMENT; errno = 0; - val = strtol(input, &endptr, base); - if ( (errno == ERANGE && (val == LONG_MAX || val == LONG_MIN)) || - (errno != 0 && val == 0) ) - { + val = strtol(input, &endptr, base); + if ((errno == ERANGE && (val == LONG_MAX || val == LONG_MIN)) || + (errno != 0 && val == 0)) { /*perror("strtol");*/ return GRIB_INVALID_ARGUMENT; } @@ -132,7 +136,7 @@ int string_ends_with(const char* str1, const char* str2) if (len2 > len1) return 0; - if (strcmp(&str1[len1-len2], str2) == 0) + if (strcmp(&str1[len1 - len2], str2) == 0) return 1; return 0; } diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index bb4efaf3b..dbbf752f4 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -58,6 +58,7 @@ list( APPEND tests_no_data_reqd grib_2nd_order_numValues grib_ecc-136 grib_ecc-967 + grib_ecc-1065 julian bufr_dump_samples bufr_json_samples diff --git a/tests/grib_ecc-1065.sh b/tests/grib_ecc-1065.sh new file mode 100755 index 000000000..de3557f56 --- /dev/null +++ b/tests/grib_ecc-1065.sh @@ -0,0 +1,28 @@ +#!/bin/sh +# 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. +# + +. ./include.sh +set -u +# --------------------------------------------------------- +# This is the test for the JIRA issue ECC-1065 +# It tests the power operator +# --------------------------------------------------------- +label="grib_ecc-1065-test" +tempRules=temp.${label}.filter + +cat > $tempRules </dev/null 2>&1; then NC_DUMPER="ncdump" fi -# ECC-1041: One parameter with different expvers +echo "Test ECC-1041: One parameter with different expvers" +# -------------------------------------------------------- # This has 5 messages, all 'tp'. Change the first message to have a different expver input=${data_dir}/tp_ecmwf.grib ${tools_dir}/grib_set -w stepRange=12 -s experimentVersionNumber=0005 $input $tempGrib @@ -71,7 +72,8 @@ for dt in $ncf_types; do done done -# Try creating different kinds; netcdf3 classic and large +echo "Test creating different kinds; netcdf3 classic and large" +# ------------------------------------------------------------- # TODO: enable tests for netcdf4 formats too input=${data_dir}/regular_latlon_surface.grib2 ${tools_dir}/grib_to_netcdf -k 1 -o $tempNetcdf $input >/dev/null @@ -79,5 +81,14 @@ ${tools_dir}/grib_to_netcdf -k 2 -o $tempNetcdf $input >/dev/null #${tools_dir}/grib_to_netcdf -k 3 -o $tempNetcdf $input >/dev/null #${tools_dir}/grib_to_netcdf -k 4 -o $tempNetcdf $input >/dev/null +echo "Test for ECC-1060" +# ----------------------- +sample2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl +${tools_dir}/grib_set -s productDefinitionTemplateNumber=30 $sample2 $tempGrib +${tools_dir}/grib_to_netcdf -o $tempNetcdf $tempGrib +${tools_dir}/grib_set -s productDefinitionTemplateNumber=31 $sample2 $tempGrib +${tools_dir}/grib_to_netcdf -o $tempNetcdf $tempGrib + +# Clean up rm -f $tempNetcdf $tempGrib $tempText diff --git a/tests/unit_tests.c b/tests/unit_tests.c index 45bb6c2f9..1da84d60d 100644 --- a/tests/unit_tests.c +++ b/tests/unit_tests.c @@ -1381,6 +1381,8 @@ static void test_string_splitting() if ( strcmp(list[2], "Be") !=0 ) assert(0); if ( strcmp(list[3], "Wild")!=0 ) assert(0); assert( list[4] == NULL ); + for(i=0; list[i] != NULL; ++i) free(list[i]); + free(list); strcpy(input, "12345|a gap|"); list = string_split(input, "|"); @@ -1389,6 +1391,8 @@ static void test_string_splitting() if ( strcmp(list[0], "12345")!=0 ) assert(0); if ( strcmp(list[1], "a gap")!=0 ) assert(0); assert( list[2] == NULL ); + for(i=0; list[i] != NULL; ++i) free(list[i]); + free(list); strcpy(input, "Steppenwolf"); list = string_split(input, ","); @@ -1396,6 +1400,8 @@ static void test_string_splitting() assert(i == 1); if ( strcmp(list[0], "Steppenwolf")!=0 ) assert(0); assert( list[1] == NULL ); + for(i=0; list[i] != NULL; ++i) free(list[i]); + free(list); /* Note: currently cannot cope with */ /* input being NULL */ @@ -1405,24 +1411,29 @@ static void test_string_splitting() static void my_assertion_proc(const char* message) { - printf("Caught it: %s\n", message); + printf("It's OK. I caught the assertion: %s\n", message); assertion_caught = 1; } static void test_assertion_catching() { char empty[]=""; + char** list=0; + int i = 0; assert(assertion_caught == 0); codes_set_codes_assertion_failed_proc(&my_assertion_proc); /* Do something illegal */ - string_split(empty, " "); + list = string_split(empty, " "); assert(assertion_caught == 1); /* Restore everything */ codes_set_codes_assertion_failed_proc(NULL); assertion_caught = 0; + + for(i=0; list[i] != NULL; ++i) free(list[i]); + free(list); } static void test_concept_condition_strings() @@ -1448,6 +1459,7 @@ static void test_concept_condition_strings() assert ( !err ); assert( strcmp(result, "selectStepTemplateInstant=1,stepTypeInternal=instant")==0 ); + grib_handle_delete(h); } int main(int argc, char** argv) diff --git a/tools/big2gribex.c b/tools/big2gribex.c index 37d479d8b..ceb32d98a 100644 --- a/tools/big2gribex.c +++ b/tools/big2gribex.c @@ -21,59 +21,61 @@ #include "grib_api.h" void usage(char*); -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - grib_handle* h = NULL; - FILE* inf = NULL; - FILE* ouf = NULL; - char* infile=0; - char* oufile=0; - int err = 0; - size_t size; - const void* buffer=NULL; + grib_handle* h = NULL; + FILE* inf = NULL; + FILE* ouf = NULL; + char* infile = 0; + char* oufile = 0; + int err = 0; + size_t size; + const void* buffer = NULL; - if (argc < 3) usage(argv[0]); - infile=argv[1]; - oufile=argv[2]; + if (argc < 3) + usage(argv[0]); + infile = argv[1]; + oufile = argv[2]; - inf = fopen(infile,"r"); - if(!inf) { - perror(infile); - exit(1); - } + inf = fopen(infile, "r"); + if (!inf) { + perror(infile); + exit(1); + } - ouf = fopen(oufile,"w"); - if(!ouf) { - perror(oufile); - exit(1); - } - - while((h = grib_handle_new_from_file(0,inf,&err)) != NULL) { - grib_update_sections_lengths(h); - GRIB_CHECK(grib_get_message(h,&buffer,&size),0); - if(fwrite(buffer,1,size,ouf) != size) { + ouf = fopen(oufile, "w"); + if (!ouf) { perror(oufile); - exit(1); - } - } + exit(1); + } + + while ((h = grib_handle_new_from_file(0, inf, &err)) != NULL) { + grib_update_sections_lengths(h); + GRIB_CHECK(grib_get_message(h, &buffer, &size), 0); + if (fwrite(buffer, 1, size, ouf) != size) { + perror(oufile); + exit(1); + } + } - grib_handle_delete(h); + grib_handle_delete(h); - if(fclose(inf)) { - perror(infile); - exit(1); - } + if (fclose(inf)) { + perror(infile); + exit(1); + } - if(fclose(ouf)) { - perror(oufile); - exit(1); - } + if (fclose(ouf)) { + perror(oufile); + exit(1); + } - return 0; + return 0; } -void usage(char* progname) { - printf("\nUsage: %s grib_in grib_out\n",progname); - exit(1); +void usage(char* progname) +{ + printf("\nUsage: %s grib_in grib_out\n", progname); + exit(1); } diff --git a/tools/bufr_3to4.c b/tools/bufr_3to4.c index b2bbd6968..3168e610f 100644 --- a/tools/bufr_3to4.c +++ b/tools/bufr_3to4.c @@ -10,88 +10,95 @@ #include "ecCodes_internal.h" -void usage(char* prog) { - printf("usage: %s infile outfile \n",prog); - exit(1); +void usage(char* prog) +{ + printf("usage: %s infile outfile \n", prog); + exit(1); } -int main(int argc,char* argv[]) { +int main(int argc, char* argv[]) +{ + FILE* infh; + FILE* outfh; + char* filename; + char* ofilename; + void* mesg = NULL; + void* mesgo = NULL; + size_t size = 0; + size_t osize = 0; + off_t offset = 0; + int write; + int err = 0; + int error = 0; + int count = 0; + int edition = 0; + grib_context* c = grib_context_get_default(); - FILE* infh; - FILE* outfh; - char* filename; - char* ofilename; - void* mesg=NULL; - void* mesgo=NULL; - size_t size=0; - size_t osize=0; - off_t offset=0; - int write; - int err=0; - int error=0; - int count=0; - int edition=0; - grib_context* c=grib_context_get_default(); + if (argc != 3) + usage(argv[0]); - if (argc !=3) usage(argv[0]); + n = 0; + filename = argv[1]; + infh = fopen(filename, "r"); + if (!infh) { + perror(filename); + exit(1); + } - n=0; - filename=argv[1]; - infh=fopen(filename,"r"); - if (!infh) { - perror(filename); - exit(1); - } + ofilename = argv[1]; + outfh = fopen(ofilename, "w"); + if (!outfh) { + perror(ofilename); + exit(1); + } - ofilename=argv[1]; - outfh=fopen(ofilename,"w"); - if (!outfh) { - perror(ofilename); - exit(1); - } + count = 0; + while ((mesg = wmo_read_bufr_from_file_malloc(infh, 0, &size, &offset, &err)) != NULL) { + if (err && err != GRIB_END_OF_FILE) { + grib_context_log(c, GRIB_LOG_ERROR, + "unable to decode message: %s \n", grib_get_error_message(err)); + error = err; + } + edition = mesg[7]; + write = 1; + switch (edition) { + case 3: + omesg = grib_context_malloc_clear(c, size + 4); + memcpy(omesg, mesg, 7); + omesg[7] = 4; + osize = 8; + break; + case 4: + omesg = mesg; + break; + default: + error = 1; + write = 0; + grib_context_log(c, GRIB_LOG_ERROR, + "wrong edition %d, skipping message", edition); + } + if (write) { + if (fwrite(omesg, 1, osize, outfh) != osize) { + perror(ofilename); + exit(1); + } + } + if (mesg) { + grib_context_free(c, mesg); + mesg = NULL; + } + if (omesg) { + grib_context_free(c, omesg); + omesg = NULL; + } + count++; + } - count=0; - while ( (mesg=wmo_read_bufr_from_file_malloc ( infh,0, &size,&offset,&err))!=NULL ) { - if (err && err!=GRIB_END_OF_FILE) { - grib_context_log(c,GRIB_LOG_ERROR, - "unable to decode message: %s \n",grib_get_error_message(err)); - error=err; - } - edition=mesg[7]; - write=1; - switch (edition ) { - case 3: - omesg=grib_context_malloc_clear(c,size+4); - memcpy(omesg,mesg,7); - omesg[7]=4; - osize=8; - break; - case 4: - omesg=mesg; - break; - default : - error=1; - write=0; - grib_context_log(c,GRIB_LOG_ERROR, - "wrong edition %d, skipping message",edition); - } - if (write) { - if(fwrite(omesg,1,osize,outfh) != osize) { - perror(ofilename); - exit(1); - } - } - if (mesg) {grib_context_free(c,mesg);mesg=NULL;} - if (omesg) {grib_context_free(c,omesg);omesg=NULL;} - count++; - } + fclose(infh); + fclose(outfh); - - fclose(infh); - fclose(outfh); - - return error; + return error; } diff --git a/tools/bufr_compare.c b/tools/bufr_compare.c index 302277ae1..706169755 100644 --- a/tools/bufr_compare.c +++ b/tools/bufr_compare.c @@ -10,29 +10,41 @@ #include "grib_tools.h" -GRIB_INLINE static int grib_inline_strcmp(const char* a,const char* b) +GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b) { - if (*a != *b) return 1; - while((*a!=0 && *b!=0) && *(a) == *(b) ) {a++;b++;} - return (*a==0 && *b==0) ? 0 : 1; + if (*a != *b) + return 1; + while ((*a != 0 && *b != 0) && *(a) == *(b)) { + a++; + b++; + } + return (*a == 0 && *b == 0) ? 0 : 1; } -GRIB_INLINE static int grib_inline_rstrcmp(const char* a,const char* b) +GRIB_INLINE static int grib_inline_rstrcmp(const char* a, const char* b) { - const char* p=a; - const char* q=b; - while (*p != 0) p++; - while (*q != 0) q++; - q--;p--; - if (*q != *p) return 1; - while((p!=a && q!=b) && *(p) == *(q) ) {p--;q--;} - return (q==b) ? 0 : 1; + const char* p = a; + const char* q = b; + while (*p != 0) + p++; + while (*q != 0) + q++; + q--; + p--; + if (*q != *p) + return 1; + while ((p != a && q != b) && *(p) == *(q)) { + p--; + q--; + } + return (q == b) ? 0 : 1; } -typedef double (*compare_double_proc) (double*,double*,double*); +typedef double (*compare_double_proc)(double*, double*, double*); typedef struct grib_error grib_error; -struct grib_error { +struct grib_error +{ char* key; int count; grib_error* next; @@ -40,48 +52,48 @@ struct grib_error { static grib_error* error_summary; static compare_double_proc compare_double; -static double global_tolerance=0; -static int packingCompare=0; -static grib_string_list* blacklist=0; +static double global_tolerance = 0; +static int packingCompare = 0; +static grib_string_list* blacklist = 0; static grib_string_list* keys_list = NULL; /* Used to determine rank of key */ -static int isLeafKey = 0; /* 0 if key is top-level, 1 if key has no children attributes */ -static int compareAbsolute=1; +static int isLeafKey = 0; /* 0 if key is top-level, 1 if key has no children attributes */ +static int compareAbsolute = 1; static int compare_handles(grib_handle* handle1, grib_handle* handle2, grib_runtime_options* options); -static int compare_values(grib_runtime_options* options, grib_handle* handle1, grib_handle *handle2, const char *name, int type); +static int compare_values(grib_runtime_options* options, grib_handle* handle1, grib_handle* handle2, const char* name, int type); static int compare_attributes(grib_handle* handle1, grib_handle* handle2, grib_runtime_options* options, - grib_accessor* a, const char* prefix, int* err); + grib_accessor* a, const char* prefix, int* err); static int compare_attribute(grib_handle* handle1, grib_handle* handle2, grib_runtime_options* options, - grib_accessor* a, const char* prefix, int* err); + grib_accessor* a, const char* prefix, int* err); -static int error=0; -static int count=0; -static int lastPrint=0; -static int force=0; +static int error = 0; +static int count = 0; +static int lastPrint = 0; +static int force = 0; /* ECC-651: Boolean 'two_way' set to 1 when '-2' option used */ -static int two_way=0; +static int two_way = 0; /* Boolean 'handles_swapped' relevant in 'two_way' mode: * 0 means: h1 is first file, h2 is second file * 1 means: h1 is second file, h2 is first file */ -static int handles_swapped=0; +static int handles_swapped = 0; static double maxAbsoluteError = 1e-19; -static int onlyListed=1; -static int headerMode=0; -static int morein1=0; -static int morein2=0; +static int onlyListed = 1; +static int headerMode = 0; +static int morein1 = 0; +static int morein2 = 0; static int listFromCommandLine; -static int verbose=0; -static int tolerance_factor=1; -static int write_error=0; +static int verbose = 0; +static int tolerance_factor = 1; +static int write_error = 0; /* Create the list of keys (global variable keys_list) */ static void new_keys_list() { grib_context* c = grib_context_get_default(); - keys_list=(grib_string_list*)grib_context_malloc_clear(c, sizeof(grib_string_list)); + keys_list = (grib_string_list*)grib_context_malloc_clear(c, sizeof(grib_string_list)); if (!keys_list) { fprintf(stderr, "Failed to allocate memory for keys list"); exit(1); @@ -91,49 +103,50 @@ static void new_keys_list() /* Free the keys list (global variable keys_list) */ static void release_keys_list() { - grib_string_list* next=keys_list; - grib_string_list* cur=keys_list; - grib_context* c = grib_context_get_default(); - while(next) { - cur=next; - next=next->next; - grib_context_free(c,cur->value); - grib_context_free(c,cur); + grib_string_list* next = keys_list; + grib_string_list* cur = keys_list; + grib_context* c = grib_context_get_default(); + while (next) { + cur = next; + next = next->next; + grib_context_free(c, cur->value); + grib_context_free(c, cur); } } -GRIB_INLINE static double compare_double_absolute(double *a,double *b,double *err) +GRIB_INLINE static double compare_double_absolute(double* a, double* b, double* err) { - double ret=0; - double d=fabs(*a-*b); + double ret = 0; + double d = fabs(*a - *b); if (d > *err) { - ret=d; + ret = d; } return ret; /* return fabs(*a-*b) > *err ? fabs(*a-*b) : 0; */ } -static int write_count=0; +static int write_count = 0; -static void write_message(grib_handle* h,const char* str) +static void write_message(grib_handle* h, const char* str) { - const void *m; size_t s; - char fname[1024]={0,}; + const void* m; + size_t s; + char fname[1024] = {0,}; FILE* fh; - grib_get_message(h,&m,&s); - sprintf(fname,"%s_%d.bufr",str,write_count); + grib_get_message(h, &m, &s); + sprintf(fname, "%s_%d.bufr", str, write_count); - fh= fopen(fname,"w"); - if(!fh) { - grib_context_log(h->context,(GRIB_LOG_ERROR)|(GRIB_LOG_PERROR), - "Error opening %s",fname); + fh = fopen(fname, "w"); + if (!fh) { + grib_context_log(h->context, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), + "Error opening %s", fname); exit(GRIB_IO_PROBLEM); } - if(fwrite(m,1,s,fh) != s) { - grib_context_log(h->context,(GRIB_LOG_ERROR)|(GRIB_LOG_PERROR), - "Error writing to %s",fname); + if (fwrite(m, 1, s, fh) != s) { + grib_context_log(h->context, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), + "Error writing to %s", fname); exit(GRIB_IO_PROBLEM); } @@ -142,100 +155,100 @@ static void write_message(grib_handle* h,const char* str) static void write_messages(grib_handle* handle1, grib_handle* handle2) { - if (!write_error) return; + if (!write_error) + return; write_count++; - write_message(handle1,"error1"); - write_message(handle2,"error2"); + write_message(handle1, "error1"); + write_message(handle2, "error2"); } -static double compare_double_relative(double *a,double *b,double *err) +static double compare_double_relative(double* a, double* b, double* err) { double relativeError; - if(fabs(*a) <= maxAbsoluteError || fabs(*b) <= maxAbsoluteError) - relativeError = fabs(*a-*b); + if (fabs(*a) <= maxAbsoluteError || fabs(*b) <= maxAbsoluteError) + relativeError = fabs(*a - *b); else if (fabs(*b) > fabs(*a)) - relativeError = fabs((*a-*b) / *b); + relativeError = fabs((*a - *b) / *b); else - relativeError = fabs((*a-*b) / *a); + relativeError = fabs((*a - *b) / *a); return relativeError > *err ? relativeError : 0; } static int blacklisted(const char* name) { - grib_string_list* b=blacklist; + grib_string_list* b = blacklist; while (b) { Assert(b->value); - if (!strcmp(name,b->value)) + if (!strcmp(name, b->value)) return 1; - b=b->next; + b = b->next; } return 0; } -static double relative_error(double a,double b,double err) +static double relative_error(double a, double b, double err) { double relativeError; - if(fabs(a) <= maxAbsoluteError || fabs(b) <= maxAbsoluteError) - relativeError = fabs(a-b); + if (fabs(a) <= maxAbsoluteError || fabs(b) <= maxAbsoluteError) + relativeError = fabs(a - b); else if (fabs(b) > fabs(a)) - relativeError = fabs((a-b) / b); + relativeError = fabs((a - b) / b); else - relativeError = fabs((a-b) / a); + relativeError = fabs((a - b) / a); - return relativeError ; + return relativeError; } -grib_option grib_options[]={ +grib_option grib_options[] = { /* {id, args, help}, on, command_line, value*/ /*{"r",0,"Compare files in which the messages are not in the same order. This option is time expensive.\n",0,1,0},*/ - {"b:",0,0,0,1,0}, - {"d",0,"Write different messages on files.\n",0,1,0}, - {"2",0,"Enable two-way comparison.\n",0,1,0}, - {"T:",0,0,1,0,"B"}, - {"c:",0,0,0,1,0}, - {"S:","start","First field to be processed.\n",0,1,0}, - {"E:","end","Last field to be processed.\n",0,1,0}, - {"a",0,"-c option modifier. The keys listed with the option -c will be added to the list of keys compared without -c.\n" - ,0,1,0}, - {"H",0,"Compare only message headers. Bit-by-bit compare on. Incompatible with -c option.\n",0,1,0}, - {"R:",0,0,0,1,0}, - {"A:",0,0,0,1,0}, -/* {"P",0,"Compare data values using the packing error as tolerance.\n",0,1,0},*/ - {"t:","factor","Compare data values using factor multiplied by the tolerance specified in options -P -R -A.\n",0,1,0}, - {"w:",0,0,0,1,0}, - {"f",0,0,0,1,0}, - {"F",0,0,1,0,0}, - {"q",0,0,1,0,0}, - {"M",0,0,1,0,0}, - {"I",0,0,1,0,0}, - {"V",0,0,0,1,0}, - {"7",0,0,0,1,0}, - {"v",0,0,0,1,0} + { "b:", 0, 0, 0, 1, 0 }, + { "d", 0, "Write different messages on files.\n", 0, 1, 0 }, + { "2", 0, "Enable two-way comparison.\n", 0, 1, 0 }, + { "T:", 0, 0, 1, 0, "B" }, + { "c:", 0, 0, 0, 1, 0 }, + { "S:", "start", "First field to be processed.\n", 0, 1, 0 }, + { "E:", "end", "Last field to be processed.\n", 0, 1, 0 }, + { "a", 0, "-c option modifier. The keys listed with the option -c will be added to the list of keys compared without -c.\n", 0, 1, 0 }, + { "H", 0, "Compare only message headers. Bit-by-bit compare on. Incompatible with -c option.\n", 0, 1, 0 }, + { "R:", 0, 0, 0, 1, 0 }, + { "A:", 0, 0, 0, 1, 0 }, + /* {"P",0,"Compare data values using the packing error as tolerance.\n",0,1,0},*/ + { "t:", "factor", "Compare data values using factor multiplied by the tolerance specified in options -P -R -A.\n", 0, 1, 0 }, + { "w:", 0, 0, 0, 1, 0 }, + { "f", 0, 0, 0, 1, 0 }, + { "F", 0, 0, 1, 0, 0 }, + { "q", 0, 0, 1, 0, 0 }, + { "M", 0, 0, 1, 0, 0 }, + { "I", 0, 0, 1, 0, 0 }, + { "V", 0, 0, 0, 1, 0 }, + { "7", 0, 0, 0, 1, 0 }, + { "v", 0, 0, 0, 1, 0 } }; -static grib_handle* global_handle=NULL; -static int counter=0; -static int start=-1; -static int end=-1; +static grib_handle* global_handle = NULL; +static int counter = 0; +static int start = -1; +static int end = -1; -const char* grib_tool_description= +const char* grib_tool_description = "Compare BUFR messages contained in two files." "\n\tIf some differences are found it fails returning an error code." "\n\tFloating-point values are compared exactly by default, different tolerance can be defined see -P -A -R." "\n\tDefault behaviour: absolute error=0, bit-by-bit compare, same order in files."; -const char* grib_tool_name="bufr_compare"; -const char* grib_tool_usage="[options] bufr_file1 bufr_file2"; +const char* grib_tool_name = "bufr_compare"; +const char* grib_tool_usage = "[options] bufr_file1 bufr_file2"; -int grib_options_count=sizeof(grib_options)/sizeof(grib_option); +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - return grib_tool(argc,argv); + return grib_tool(argc, argv); } int grib_tool_before_getopt(grib_runtime_options* options) @@ -245,60 +258,70 @@ int grib_tool_before_getopt(grib_runtime_options* options) int grib_tool_init(grib_runtime_options* options) { - int ret=0,i; - int nfiles=1; - char orderby[]="md5Headers"; - grib_context* context=grib_context_get_default(); + int ret = 0, i; + int nfiles = 1; + char orderby[] = "md5Headers"; + grib_context* context = grib_context_get_default(); - options->strict=1; + options->strict = 1; if (grib_options_on("S:")) - start=atoi(grib_options_get_option("S:")); + start = atoi(grib_options_get_option("S:")); if (grib_options_on("E:")) - end=atoi(grib_options_get_option("E:")); + end = atoi(grib_options_get_option("E:")); - if (grib_options_on("f")) force=1; - else force=0; + if (grib_options_on("f")) + force = 1; + else + force = 0; - if (grib_options_on("2")) two_way=1; - else two_way=0; + if (grib_options_on("2")) + two_way = 1; + else + two_way = 0; - if (grib_options_on("d")) write_error=1; - else write_error=0; + if (grib_options_on("d")) + write_error = 1; + else + write_error = 0; verbose = grib_options_on("v"); - listFromCommandLine=0; + listFromCommandLine = 0; if (grib_options_on("c:") || grib_options_on("e")) - listFromCommandLine=1; + listFromCommandLine = 1; - if (grib_options_on("a")) onlyListed=0; - else onlyListed=1; + if (grib_options_on("a")) + onlyListed = 0; + else + onlyListed = 1; - if (grib_options_on("H")) headerMode=1; - else headerMode=0; + if (grib_options_on("H")) + headerMode = 1; + else + headerMode = 0; if (grib_options_on("H") && grib_options_on("c:")) { - fprintf(stderr,"Error: -H and -c options are incompatible. Choose one of the two please.\n"); + fprintf(stderr, "Error: -H and -c options are incompatible. Choose one of the two please.\n"); exit(1); } if (grib_options_on("a") && !grib_options_on("c:")) { - fprintf(stderr,"Error: -a option requires -c option. Please define a list of keys with the -c option.\n"); + fprintf(stderr, "Error: -a option requires -c option. Please define a list of keys with the -c option.\n"); exit(1); } if (grib_options_on("b:")) { - grib_string_list *next=0; - int ii=0; - blacklist=(grib_string_list*)grib_context_malloc_clear(context,sizeof(grib_string_list)); - blacklist->value=grib_context_strdup(context,options->set_values[0].name); - next=blacklist; - for (ii=1;iiset_values_count;ii++) { - next->next=(grib_string_list*)grib_context_malloc_clear(context,sizeof(grib_string_list)); - next->next->value=grib_context_strdup(context,options->set_values[ii].name); - next=next->next; + grib_string_list* next = 0; + int ii = 0; + blacklist = (grib_string_list*)grib_context_malloc_clear(context, sizeof(grib_string_list)); + blacklist->value = grib_context_strdup(context, options->set_values[0].name); + next = blacklist; + for (ii = 1; ii < options->set_values_count; ii++) { + next->next = (grib_string_list*)grib_context_malloc_clear(context, sizeof(grib_string_list)); + next->next->value = grib_context_strdup(context, options->set_values[ii].name); + next = next->next; } - context->blacklist=blacklist; + context->blacklist = blacklist; } /* Check 1st file is not a directory */ @@ -306,19 +329,20 @@ int grib_tool_init(grib_runtime_options* options) if (grib_options_on("r")) { char* filename[1]; - filename[0]=options->infile_extra->name; - options->random=1; - options->orderby=strdup(orderby); - options->idx=grib_fieldset_new_from_files(context,filename, - nfiles,0,0,0,orderby,&ret); + filename[0] = options->infile_extra->name; + options->random = 1; + options->orderby = strdup(orderby); + options->idx = grib_fieldset_new_from_files(context, filename, + nfiles, 0, 0, 0, orderby, &ret); if (ret) { - fprintf(stderr,"unable to create index for input file %s (%s)", + fprintf(stderr, "unable to create index for input file %s (%s)", options->infile_extra->name, grib_get_error_message(ret)); exit(ret); } - } else { - options->random=0; - options->infile_extra->file=fopen(options->infile_extra->name,"r"); + } + else { + options->random = 0; + options->infile_extra->file = fopen(options->infile_extra->name, "r"); if (!options->infile_extra->file) { perror(options->infile_extra->name); @@ -326,43 +350,44 @@ int grib_tool_init(grib_runtime_options* options) } } - global_tolerance=0; - compare_double= &compare_double_absolute; + global_tolerance = 0; + compare_double = &compare_double_absolute; if (grib_options_on("R:")) { - global_tolerance=0; - for (i=0;itolerance_count;i++) { - if (!strcmp((options->tolerance[i]).name,"all")) { - global_tolerance=(options->tolerance[i]).double_value; + global_tolerance = 0; + for (i = 0; i < options->tolerance_count; i++) { + if (!strcmp((options->tolerance[i]).name, "all")) { + global_tolerance = (options->tolerance[i]).double_value; break; } - if (!strcmp((options->tolerance[i]).name,"global")) { - global_tolerance=(options->tolerance[i]).double_value; + if (!strcmp((options->tolerance[i]).name, "global")) { + global_tolerance = (options->tolerance[i]).double_value; break; } } - compare_double= &compare_double_relative; - compareAbsolute=0; + compare_double = &compare_double_relative; + compareAbsolute = 0; } - if (grib_options_on("A:")){ + if (grib_options_on("A:")) { if (grib_options_on("R:")) { maxAbsoluteError = atof(grib_options_get_option("A:")); - } else { - compare_double= &compare_double_absolute; + } + else { + compare_double = &compare_double_absolute; global_tolerance = atof(grib_options_get_option("A:")); } } if (grib_options_on("P")) { - packingCompare=1; - compare_double= &compare_double_absolute; + packingCompare = 1; + compare_double = &compare_double_absolute; } if (grib_options_on("t:")) - tolerance_factor=atof(grib_options_get_option("t:")); + tolerance_factor = atof(grib_options_get_option("t:")); if (grib_options_on("R:")) { - char* sarg=grib_options_get_option("R:"); - options->tolerance_count=MAX_KEYS; - ret=parse_keyval_string(grib_tool_name, sarg,1,GRIB_TYPE_DOUBLE,options->tolerance,&(options->tolerance_count)); + char* sarg = grib_options_get_option("R:"); + options->tolerance_count = MAX_KEYS; + ret = parse_keyval_string(grib_tool_name, sarg, 1, GRIB_TYPE_DOUBLE, options->tolerance, &(options->tolerance_count)); if (ret == GRIB_INVALID_ARGUMENT) { usage(); exit(1); @@ -393,12 +418,12 @@ int grib_tool_init(grib_runtime_options* options) return 0; } -int grib_tool_new_filename_action(grib_runtime_options* options,const char* file) +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) { return 0; } -int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file) +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { exit_if_input_is_directory(grib_tool_name, file->name); return 0; @@ -406,104 +431,114 @@ int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* fil static void printInfo(grib_handle* h) { - printf("== %d == DIFFERENCE == ",count); - lastPrint=count; + printf("== %d == DIFFERENCE == ", count); + lastPrint = count; } -static void print_index_key_values(grib_index* index,int icounter,const char* error_message) +static void print_index_key_values(grib_index* index, int icounter, const char* error_message) { - grib_index_key* keys=index->keys; - printf("== %d == ",icounter); - if (error_message) printf("%s == ",error_message); + grib_index_key* keys = index->keys; + printf("== %d == ", icounter); + if (error_message) + printf("%s == ", error_message); while (keys) { - printf("%s=%s ",keys->name,keys->value); - keys=keys->next; + printf("%s=%s ", keys->name, keys->value); + keys = keys->next; } printf("\n"); } static grib_handle* bufr_handle_new_from_file_x( - grib_context* c,FILE* f,int mode,int headers_only,int *err) + grib_context* c, FILE* f, int mode, int headers_only, int* err) { - return codes_handle_new_from_file(c,f,PRODUCT_BUFR,err); + return codes_handle_new_from_file(c, f, PRODUCT_BUFR, err); } int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) { - int err=0; + int err = 0; count++; if (options->through_index) { - grib_index* idx1=options->index1; - verbose=0; + grib_index* idx1 = options->index1; + verbose = 0; counter++; - if ( start>0 && counter < start ) return 0; - if ( end>0 && counter > end ) { - options->stop=1; + if (start > 0 && counter < start) + return 0; + if (end > 0 && counter > end) { + options->stop = 1; return 0; } - grib_index_search_same(idx1,h); - global_handle=codes_new_from_index(idx1,CODES_BUFR,&err); + grib_index_search_same(idx1, h); + global_handle = codes_new_from_index(idx1, CODES_BUFR, &err); if (options->verbose) { - off_t offset=0; - char* filename=grib_get_field_file(options->index2,&offset); - printf("file1=\"%s\" ",filename); - filename=grib_get_field_file(options->index1,&offset); - printf("file2=\"%s\" \n",filename); - print_index_key_values(options->index1,counter,NULL); + off_t offset = 0; + char* filename = grib_get_field_file(options->index2, &offset); + printf("file1=\"%s\" ", filename); + filename = grib_get_field_file(options->index1, &offset); + printf("file2=\"%s\" \n", filename); + print_index_key_values(options->index1, counter, NULL); } if (!global_handle) { if (!options->verbose) - print_index_key_values(idx1,counter,"NOT FOUND "); + print_index_key_values(idx1, counter, "NOT FOUND "); } - if (!global_handle || err!= GRIB_SUCCESS ) { + if (!global_handle || err != GRIB_SUCCESS) { morein1++; - if (global_handle) grib_handle_delete(global_handle); + if (global_handle) + grib_handle_delete(global_handle); return 0; } - if(compare_handles(h,global_handle,options)) { + if (compare_handles(h, global_handle, options)) { error++; - if (!force) exit(1); + if (!force) + exit(1); } grib_handle_delete(global_handle); return 0; - - } else if (options->random) - global_handle = grib_fieldset_next_handle(options->idx,&err); + } + else if (options->random) + global_handle = grib_fieldset_next_handle(options->idx, &err); else - global_handle=bufr_handle_new_from_file_x(h->context,options->infile_extra->file,options->mode,0,&err); + global_handle = bufr_handle_new_from_file_x(h->context, options->infile_extra->file, options->mode, 0, &err); - if (!global_handle || err!= GRIB_SUCCESS ) { + if (!global_handle || err != GRIB_SUCCESS) { morein2++; - if (global_handle) grib_handle_delete(global_handle); + if (global_handle) + grib_handle_delete(global_handle); return 0; } - if(compare_handles(global_handle,h,options)) { + if (compare_handles(global_handle, h, options)) { error++; if (!two_way) { /* If two_way mode: Don't exit yet. Show further differences */ - if (!force) exit(1); + if (!force) + exit(1); } } if (two_way) { /* ECC-651 and ECC-431 */ handles_swapped = 1; - if (verbose) printf(" Swapping handles (two-way mode)\n"); - if(compare_handles(h, global_handle, options)) { + if (verbose) + printf(" Swapping handles (two-way mode)\n"); + if (compare_handles(h, global_handle, options)) { error++; - if (!force) exit(1); - } else { + if (!force) + exit(1); + } + else { if (error) { /* Error from first pass */ - if (!force) exit(1); + if (!force) + exit(1); } } } @@ -515,11 +550,11 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) { - int err=0; - if (!options->through_index && !options->random) { - global_handle=codes_bufr_handle_new_from_file(h->context,options->infile_extra->file,&err); + int err = 0; + if (!options->through_index && !options->random) { + global_handle = codes_bufr_handle_new_from_file(h->context, options->infile_extra->file, &err); - if (!global_handle || err!= GRIB_SUCCESS) + if (!global_handle || err != GRIB_SUCCESS) morein2++; grib_handle_delete(global_handle); @@ -531,168 +566,171 @@ int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) return 0; } -void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h) +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) { - grib_print_key_values(options,h); + grib_print_key_values(options, h); } int grib_tool_finalise_action(grib_runtime_options* options) { - grib_error* e = error_summary; - int err=0; - grib_context* c=grib_context_get_default(); + grib_error* e = error_summary; + int err = 0; + grib_context* c = grib_context_get_default(); /*if (grib_options_on("w:")) return 0;*/ - while ((global_handle=codes_bufr_handle_new_from_file(c,options->infile_extra->file,&err))) { + while ((global_handle = codes_bufr_handle_new_from_file(c, options->infile_extra->file, &err))) { morein1++; - if (global_handle) grib_handle_delete(global_handle); + if (global_handle) + grib_handle_delete(global_handle); } - error += morein1+morein2; + error += morein1 + morein2; if (error) { printf("\n## ERRORS SUMMARY #######\n"); } - if (morein1>0) { + if (morein1 > 0) { printf("##\n## Different number of messages \n"); - printf("## %d more messages in %s than in %s\n",morein1, - options->infile_extra->name,options->infile->name); + printf("## %d more messages in %s than in %s\n", morein1, + options->infile_extra->name, options->infile->name); } - if (morein2>0) { + if (morein2 > 0) { printf("##\n## Different number of messages \n"); - printf("## %d more messages in %s than in %s\n",morein2, - options->infile->name,options->infile_extra->name); + printf("## %d more messages in %s than in %s\n", morein2, + options->infile->name, options->infile_extra->name); } if (error) { printf("##\n## Summary of different key values \n"); while (e) { - printf ("## %s ( %d different )\n",e->key,e->count); - e=e->next; + printf("## %s ( %d different )\n", e->key, e->count); + e = e->next; } - printf("##\n## %d different messages out of %d\n\n",error,count); + printf("##\n## %d different messages out of %d\n\n", error, count); } if (options->through_index) { grib_index_delete(options->index1); grib_index_delete(options->index2); } release_keys_list(); - if (error != 0) exit(1); + if (error != 0) + exit(1); return 0; } -static void save_error(grib_context* c,const char* key) +static void save_error(grib_context* c, const char* key) { - grib_error* e=0; - grib_error* next=0; - int saved=0; + grib_error* e = 0; + grib_error* next = 0; + int saved = 0; if (!error_summary) { - error_summary=(grib_error*)grib_context_malloc_clear(c,sizeof(grib_error)); - error_summary->count=1; - error_summary->key=grib_context_strdup(c,key); + error_summary = (grib_error*)grib_context_malloc_clear(c, sizeof(grib_error)); + error_summary->count = 1; + error_summary->key = grib_context_strdup(c, key); return; } - e=error_summary; - next=e; + e = error_summary; + next = e; while (next) { - if (!strcmp(next->key,key)) { + if (!strcmp(next->key, key)) { next->count++; - saved=1; + saved = 1; break; } - e=next; - next=next->next; + e = next; + next = next->next; } if (!saved) { - e->next=(grib_error*)grib_context_malloc_clear(c,sizeof(grib_error)); - e->next->count=1; - e->next->key=grib_context_strdup(c,key); + e->next = (grib_error*)grib_context_malloc_clear(c, sizeof(grib_error)); + e->next->count = 1; + e->next->key = grib_context_strdup(c, key); } } static char* double_as_string(grib_context* c, double v) { - char* sval=(char*)grib_context_malloc_clear(c, sizeof(char)*40); - if (v == GRIB_MISSING_DOUBLE) sprintf(sval,"MISSING"); - else sprintf(sval,"%.20e",v); + char* sval = (char*)grib_context_malloc_clear(c, sizeof(char) * 40); + if (v == GRIB_MISSING_DOUBLE) + sprintf(sval, "MISSING"); + else + sprintf(sval, "%.20e", v); return sval; } /* Return the part of the key name without the '#rank#' part */ static char* get_keyname_without_rank(const char* name) { - const char* p=name; + const char* p = name; char* pEnd; - char* ret=NULL; + char* ret = NULL; - if (*p=='#') { - strtol(++p,&pEnd,10); - if ( *pEnd != '#') { + if (*p == '#') { + strtol(++p, &pEnd, 10); + if (*pEnd != '#') { DebugAssert(!"Badly formed rank in key"); - } else { + } + else { /* Take everything after 2nd '#' */ - grib_context* c=grib_context_get_default(); + grib_context* c = grib_context_get_default(); pEnd++; - ret=grib_context_strdup(c,pEnd); + ret = grib_context_strdup(c, pEnd); } } return ret; } -static int compare_values(grib_runtime_options* options, grib_handle* handle1, grib_handle *handle2, const char *name, int type) +static int compare_values(grib_runtime_options* options, grib_handle* handle1, grib_handle* handle2, const char* name, int type) { size_t len1 = 0; size_t len2 = 0; - int err=0,i=0; + int err = 0, i = 0; int err1; int err2; - int type1,type2; + int type1, type2; int countdiff; - int isangle=0; - int isMissing1=0,isMissing2=0; + int isangle = 0; + int isMissing1 = 0, isMissing2 = 0; - char *sval1 = NULL,*sval2 = NULL; - unsigned char *uval1 = NULL,*uval2 = NULL; + char *sval1 = NULL, *sval2 = NULL; + unsigned char *uval1 = NULL, *uval2 = NULL; double *dval1 = NULL, *dval2 = NULL; long *lval1 = NULL, *lval2 = NULL; - double maxdiff=0; - double packingError1=0,packingError2=0; - double value_tolerance=0; - grib_context* c=handle1->context; - const char* first_str = (handles_swapped==0? "1st" : "2nd"); - const char* second_str = (handles_swapped==0? "2nd" : "1st"); - - type1=type; - type2=type; - if (verbose && !handles_swapped) printf(" comparing %s",name); - - if( type1==GRIB_TYPE_UNDEFINED && (err = grib_get_native_type(handle1,name,&type1)) != GRIB_SUCCESS) - { + double maxdiff = 0; + double packingError1 = 0, packingError2 = 0; + double value_tolerance = 0; + grib_context* c = handle1->context; + const char* first_str = (handles_swapped == 0 ? "1st" : "2nd"); + const char* second_str = (handles_swapped == 0 ? "2nd" : "1st"); + + type1 = type; + type2 = type; + if (verbose && !handles_swapped) + printf(" comparing %s", name); + + if (type1 == GRIB_TYPE_UNDEFINED && (err = grib_get_native_type(handle1, name, &type1)) != GRIB_SUCCESS) { printInfo(handle1); - printf("Oops... cannot get type of [%s] in %s field: %s\n",name, first_str, grib_get_error_message(err)); - save_error(c,name); + printf("Oops... cannot get type of [%s] in %s field: %s\n", name, first_str, grib_get_error_message(err)); + save_error(c, name); return err; } - if(type2==GRIB_TYPE_UNDEFINED && (err = grib_get_native_type(handle2,name,&type2)) != GRIB_SUCCESS) - { - if(err == GRIB_NOT_FOUND) - { + if (type2 == GRIB_TYPE_UNDEFINED && (err = grib_get_native_type(handle2, name, &type2)) != GRIB_SUCCESS) { + if (err == GRIB_NOT_FOUND) { printInfo(handle1); - printf("[%s] not found in %s field\n",name, second_str); - save_error(c,name); + printf("[%s] not found in %s field\n", name, second_str); + save_error(c, name); return err; } printInfo(handle1); - printf("Oops... cannot get type of [%s] in %s field: %s\n",name, second_str, grib_get_error_message(err)); - save_error(c,name); + printf("Oops... cannot get type of [%s] in %s field: %s\n", name, second_str, grib_get_error_message(err)); + save_error(c, name); return err; } @@ -703,36 +741,33 @@ static int compare_values(grib_runtime_options* options, grib_handle* handle1, g return GRIB_TYPE_MISMATCH; } */ - if(type1 == GRIB_TYPE_LABEL) + if (type1 == GRIB_TYPE_LABEL) return err; - if(type1 == GRIB_TYPE_SECTION) + if (type1 == GRIB_TYPE_SECTION) return err; - if((err = grib_get_size(handle1,name,&len1)) != GRIB_SUCCESS) - { + if ((err = grib_get_size(handle1, name, &len1)) != GRIB_SUCCESS) { printInfo(handle1); - printf("Oops... cannot get size of [%s] in %s field: %s\n",name, first_str, grib_get_error_message(err)); - save_error(c,name); + printf("Oops... cannot get size of [%s] in %s field: %s\n", name, first_str, grib_get_error_message(err)); + save_error(c, name); return err; } - if((err = grib_get_size(handle2,name,&len2)) != GRIB_SUCCESS) - { - if(err == GRIB_NOT_FOUND) - { + if ((err = grib_get_size(handle2, name, &len2)) != GRIB_SUCCESS) { + if (err == GRIB_NOT_FOUND) { printInfo(handle1); - printf("[%s] not found in %s field\n",name,second_str); - save_error(c,name); + printf("[%s] not found in %s field\n", name, second_str); + save_error(c, name); return err; } printInfo(handle1); - printf("Oops... cannot get size of [%s] in %s field: %s\n",name, second_str, grib_get_error_message(err)); - save_error(c,name); + printf("Oops... cannot get size of [%s] in %s field: %s\n", name, second_str, grib_get_error_message(err)); + save_error(c, name); return err; } - + if (handles_swapped) { /* Comparing a second time with handles swapped. Do not compare keys common to both handles */ return GRIB_SUCCESS; @@ -746,400 +781,420 @@ static int compare_values(grib_runtime_options* options, grib_handle* handle1, g if (options->mode != MODE_BUFR) { /* TODO: Ignore missing values for keys in BUFR. Not yet implemented */ - isMissing1= ( (grib_is_missing(handle1,name,&err1)==1) && (err1 == 0) ) ? 1 : 0; - isMissing2= ( (grib_is_missing(handle2,name,&err2)==1) && (err2 == 0) ) ? 1 : 0; + isMissing1 = ((grib_is_missing(handle1, name, &err1) == 1) && (err1 == 0)) ? 1 : 0; + isMissing2 = ((grib_is_missing(handle2, name, &err2) == 1) && (err2 == 0)) ? 1 : 0; } - if ((isMissing1==1) && (isMissing2==1)) { - if (verbose) printf(" is set to missing in both fields\n"); + if ((isMissing1 == 1) && (isMissing2 == 1)) { + if (verbose) + printf(" is set to missing in both fields\n"); return GRIB_SUCCESS; } - if (isMissing1==1) { - if (verbose) printf(" is set to missing in %s field\n", first_str); + if (isMissing1 == 1) { + if (verbose) + printf(" is set to missing in %s field\n", first_str); printInfo(handle1); - printf("%s is set to missing in %s field is not missing in %s field\n",name,first_str,second_str); + printf("%s is set to missing in %s field is not missing in %s field\n", name, first_str, second_str); err1 = GRIB_VALUE_MISMATCH; - save_error(c,name); + save_error(c, name); return GRIB_VALUE_MISMATCH; } - if (isMissing2==1) { - if (verbose) printf(" is set to missing in %s field\n", first_str); + if (isMissing2 == 1) { + if (verbose) + printf(" is set to missing in %s field\n", first_str); printInfo(handle1); - printf("%s is set to missing in %s field is not missing in %s field\n",name, second_str, first_str); + printf("%s is set to missing in %s field is not missing in %s field\n", name, second_str, first_str); err1 = GRIB_VALUE_MISMATCH; - save_error(c,name); + save_error(c, name); return GRIB_VALUE_MISMATCH; } - switch(type1) - { - case GRIB_TYPE_STRING: - if (verbose) printf(" as string\n"); - /* See ECC-710: It is very slow getting the key length this way */ - /*grib_get_string_length(handle1,name,&len1);*/ - /*grib_get_string_length(handle2,name,&len2);*/ - len1 = len2 = 4096; /* Significantly faster to use an upper bound */ - sval1 = (char*)grib_context_malloc(handle1->context,len1*sizeof(char)); - sval2 = (char*)grib_context_malloc(handle2->context,len2*sizeof(char)); - - if((err1 = grib_get_string(handle1,name,sval1,&len1)) != GRIB_SUCCESS) - { - printInfo(handle1); - printf("Oops... cannot get string value of [%s] in %s field: %s\n", - name, first_str, grib_get_error_message(err1)); - save_error(c,name); - } + switch (type1) { + case GRIB_TYPE_STRING: + if (verbose) + printf(" as string\n"); + /* See ECC-710: It is very slow getting the key length this way */ + /*grib_get_string_length(handle1,name,&len1);*/ + /*grib_get_string_length(handle2,name,&len2);*/ + len1 = len2 = 4096; /* Significantly faster to use an upper bound */ + sval1 = (char*)grib_context_malloc(handle1->context, len1 * sizeof(char)); + sval2 = (char*)grib_context_malloc(handle2->context, len2 * sizeof(char)); + + if ((err1 = grib_get_string(handle1, name, sval1, &len1)) != GRIB_SUCCESS) { + printInfo(handle1); + printf("Oops... cannot get string value of [%s] in %s field: %s\n", + name, first_str, grib_get_error_message(err1)); + save_error(c, name); + } - if((err2 = grib_get_string(handle2,name,sval2,&len2)) != GRIB_SUCCESS) - { - printInfo(handle1); - printf("Oops... cannot get string value of [%s] in %s field: %s\n", - name, second_str, grib_get_error_message(err2)); - save_error(c,name); - } + if ((err2 = grib_get_string(handle2, name, sval2, &len2)) != GRIB_SUCCESS) { + printInfo(handle1); + printf("Oops... cannot get string value of [%s] in %s field: %s\n", + name, second_str, grib_get_error_message(err2)); + save_error(c, name); + } - if(err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS) - { - if(grib_inline_strcmp(sval1,sval2) != 0) - { - /* Check if strings are 'missing'. + if (err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS) { + if (grib_inline_strcmp(sval1, sval2) != 0) { + /* Check if strings are 'missing'. * Note: one string could have all its bits=1 and the other empty */ - int equal = 0; - grib_accessor* a1 = grib_find_accessor(handle1, name); - grib_accessor* a2 = grib_find_accessor(handle2, name); - int is_miss_1 = grib_is_missing_string(a1, (unsigned char *)sval1, len1); - int is_miss_2 = grib_is_missing_string(a2, (unsigned char *)sval2, len2); - if ( is_miss_1 && is_miss_2 ) { - equal = 1; - } - if (!equal) { - printInfo(handle1); - printf("string [%s]: [%s] != [%s]\n", name, sval1, sval2); - err1 = GRIB_VALUE_MISMATCH; - save_error(c,name); + int equal = 0; + grib_accessor* a1 = grib_find_accessor(handle1, name); + grib_accessor* a2 = grib_find_accessor(handle2, name); + int is_miss_1 = grib_is_missing_string(a1, (unsigned char*)sval1, len1); + int is_miss_2 = grib_is_missing_string(a2, (unsigned char*)sval2, len2); + if (is_miss_1 && is_miss_2) { + equal = 1; + } + if (!equal) { + printInfo(handle1); + printf("string [%s]: [%s] != [%s]\n", name, sval1, sval2); + err1 = GRIB_VALUE_MISMATCH; + save_error(c, name); + } } } - } - grib_context_free(handle1->context,sval1); - grib_context_free(handle2->context,sval2); + grib_context_free(handle1->context, sval1); + grib_context_free(handle2->context, sval2); - if(err1) return err1; - if(err2) return err2; + if (err1) + return err1; + if (err2) + return err2; - break; + break; - case GRIB_TYPE_LONG: - if (verbose) printf(" as long\n"); + case GRIB_TYPE_LONG: + if (verbose) + printf(" as long\n"); - lval1 = (long*)grib_context_malloc(handle1->context,len1*sizeof(long)); - lval2 = (long*)grib_context_malloc(handle2->context,len2*sizeof(long)); + lval1 = (long*)grib_context_malloc(handle1->context, len1 * sizeof(long)); + lval2 = (long*)grib_context_malloc(handle2->context, len2 * sizeof(long)); - if((err1 = grib_get_long_array(handle1,name,lval1,&len1)) != GRIB_SUCCESS) - { - printInfo(handle1); - printf("Oops... cannot get long value of [%s] in %s field: %s\n", - name, first_str, grib_get_error_message(err1)); - save_error(c,name); - } + if ((err1 = grib_get_long_array(handle1, name, lval1, &len1)) != GRIB_SUCCESS) { + printInfo(handle1); + printf("Oops... cannot get long value of [%s] in %s field: %s\n", + name, first_str, grib_get_error_message(err1)); + save_error(c, name); + } - if((err2 = grib_get_long_array(handle2,name,lval2,&len2)) != GRIB_SUCCESS) - { - printInfo(handle1); - printf("Oops... cannot get long value of [%s] in %s field: %s\n", - name,second_str,grib_get_error_message(err2)); - save_error(c,name); - } + if ((err2 = grib_get_long_array(handle2, name, lval2, &len2)) != GRIB_SUCCESS) { + printInfo(handle1); + printf("Oops... cannot get long value of [%s] in %s field: %s\n", + name, second_str, grib_get_error_message(err2)); + save_error(c, name); + } - if(err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS && len1!=len2) - { - printInfo(handle1); - printf("Different size for \"%s\" [%ld] [%ld]\n",name,(long)len1,(long)len2); - err1=GRIB_INTERNAL_ERROR; - save_error(c,name); - } - if(err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS && len1==len2) - { - int ii; - countdiff=0; - for(ii = 0; ii < len1; ii++) - if(lval1[ii] != lval2[ii]) countdiff++; - - if (countdiff) { + if (err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS && len1 != len2) { printInfo(handle1); - save_error(c,name); - err1 = GRIB_VALUE_MISMATCH; - if(len1 == 1) - printf("long [%s]: [%ld] != [%ld]\n", name, *lval1, *lval2); - else - printf("long [%s] %d out of %ld different\n", name, countdiff, (long)len1); + printf("Different size for \"%s\" [%ld] [%ld]\n", name, (long)len1, (long)len2); + err1 = GRIB_INTERNAL_ERROR; + save_error(c, name); + } + if (err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS && len1 == len2) { + int ii; + countdiff = 0; + for (ii = 0; ii < len1; ii++) + if (lval1[ii] != lval2[ii]) + countdiff++; + + if (countdiff) { + printInfo(handle1); + save_error(c, name); + err1 = GRIB_VALUE_MISMATCH; + if (len1 == 1) + printf("long [%s]: [%ld] != [%ld]\n", name, *lval1, *lval2); + else + printf("long [%s] %d out of %ld different\n", name, countdiff, (long)len1); + } } - } - grib_context_free(handle1->context,lval1); - grib_context_free(handle2->context,lval2); - - if(err1) return err1; - if(err2) return err2; - break; - - case GRIB_TYPE_DOUBLE: - if (verbose) printf(" as double\n"); - dval1 = (double*)grib_context_malloc(handle1->context,len1*sizeof(double)); - dval2 = (double*)grib_context_malloc(handle2->context,len2*sizeof(double)); - - isangle=0; - value_tolerance=global_tolerance; - if (!grib_inline_strcmp(name,"packedValues") || !grib_inline_strcmp(name,"values") - || !grib_inline_strcmp(name,"codedValues")) { - packingError1=0; - packingError2=0; - err1=grib_get_double(handle1,"packingError",&packingError1); - err2=grib_get_double(handle2,"packingError",&packingError2); - if (packingCompare) + grib_context_free(handle1->context, lval1); + grib_context_free(handle2->context, lval2); + + if (err1) + return err1; + if (err2) + return err2; + break; + + case GRIB_TYPE_DOUBLE: + if (verbose) + printf(" as double\n"); + dval1 = (double*)grib_context_malloc(handle1->context, len1 * sizeof(double)); + dval2 = (double*)grib_context_malloc(handle2->context, len2 * sizeof(double)); + + isangle = 0; + value_tolerance = global_tolerance; + if (!grib_inline_strcmp(name, "packedValues") || !grib_inline_strcmp(name, "values") || !grib_inline_strcmp(name, "codedValues")) { + packingError1 = 0; + packingError2 = 0; + err1 = grib_get_double(handle1, "packingError", &packingError1); + err2 = grib_get_double(handle2, "packingError", &packingError2); + if (packingCompare) + value_tolerance = packingError1 > packingError2 ? packingError1 : packingError2; + } + else if (!grib_inline_strcmp(name, "unpackedValues")) { + packingError1 = 0; + packingError2 = 0; + err1 = grib_get_double(handle1, "unpackedError", &packingError1); + err2 = grib_get_double(handle2, "unpackedError", &packingError2); + if (packingCompare) + value_tolerance = packingError1 > packingError2 ? packingError1 : packingError2; + } + else if (!grib_inline_rstrcmp(name, "InDegrees")) { + packingError1 = 0.0005; + packingError2 = 0.0005; + isangle = 1; value_tolerance = packingError1 > packingError2 ? packingError1 : packingError2; - } else if (!grib_inline_strcmp(name,"unpackedValues") ) { - packingError1=0; - packingError2=0; - err1=grib_get_double(handle1,"unpackedError",&packingError1); - err2=grib_get_double(handle2,"unpackedError",&packingError2); - if (packingCompare) + } + else if (!grib_inline_strcmp(name, "referenceValue")) { + packingError1 = 0; + packingError2 = 0; + err1 = grib_get_double(handle1, "referenceValueError", &packingError1); + err2 = grib_get_double(handle2, "referenceValueError", &packingError2); value_tolerance = packingError1 > packingError2 ? packingError1 : packingError2; - } else if ( !grib_inline_rstrcmp(name,"InDegrees")) { - packingError1=0.0005; - packingError2=0.0005; - isangle=1; - value_tolerance = packingError1 > packingError2 ? packingError1 : packingError2; - } else if (!grib_inline_strcmp(name,"referenceValue") ) { - packingError1=0; - packingError2=0; - err1=grib_get_double(handle1,"referenceValueError",&packingError1); - err2=grib_get_double(handle2,"referenceValueError",&packingError2); - value_tolerance = packingError1 > packingError2 ? packingError1 : packingError2; - } - - if (!compareAbsolute) { - int all_specified = 0; /* =1 if relative comparison with "all" specified */ - for (i=0;itolerance_count;i++) { - if (!strcmp((options->tolerance[i]).name, "all")) { - all_specified = 1; - value_tolerance=(options->tolerance[i]).double_value; - break; - } } - if (!all_specified) { - char* basename = NULL; - for (i=0;itolerance_count;i++) { - if ( strcmp( (options->tolerance[i]).name, name)==0 ) { - value_tolerance=(options->tolerance[i]).double_value; + + if (!compareAbsolute) { + int all_specified = 0; /* =1 if relative comparison with "all" specified */ + for (i = 0; i < options->tolerance_count; i++) { + if (!strcmp((options->tolerance[i]).name, "all")) { + all_specified = 1; + value_tolerance = (options->tolerance[i]).double_value; break; - } else { - /* Check if the key without its rank has a relative tolerance */ - basename = get_keyname_without_rank(name); - if ( basename && strcmp( (options->tolerance[i]).name, basename)==0 ) { - value_tolerance=(options->tolerance[i]).double_value; + } + } + if (!all_specified) { + char* basename = NULL; + for (i = 0; i < options->tolerance_count; i++) { + if (strcmp((options->tolerance[i]).name, name) == 0) { + value_tolerance = (options->tolerance[i]).double_value; break; } + else { + /* Check if the key without its rank has a relative tolerance */ + basename = get_keyname_without_rank(name); + if (basename && strcmp((options->tolerance[i]).name, basename) == 0) { + value_tolerance = (options->tolerance[i]).double_value; + break; + } + } } + if (basename) + grib_context_free(handle1->context, basename); } - if (basename) grib_context_free(handle1->context, basename); } - } - if((err1 = grib_get_double_array(handle1,name,dval1,&len1)) != GRIB_SUCCESS) - { - printInfo(handle1); - printf("Oops... cannot get double value of [%s] in %s field: %s\n", - name, first_str, grib_get_error_message(err1)); - save_error(c,name); - } - - if((err2 = grib_get_double_array(handle2,name,dval2,&len2)) != GRIB_SUCCESS) - { - printInfo(handle1); - printf("Oops... cannot get double value of [%s] in %s field: %s\n", - name,second_str,grib_get_error_message(err2)); - save_error(c,name); - } - - if(err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS && len1!=len2) - { - printInfo(handle1); - printf("Different size for \"%s\" [%ld] [%ld]\n",name,(long)len1,(long)len2); - save_error(c,name); - } - if(err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS && len1==len2) - { - int imaxdiff; - double diff; - double *pv1,*pv2,dnew1,dnew2; - maxdiff=0; - imaxdiff=0; - countdiff=0; - pv1=dval1; - pv2=dval2; - if (isangle) { - dnew1=*dval1; dnew2=*dval2; - pv1=&dnew1; pv2=&dnew2; - if (*dval1 < 0 ) dnew1 += 360.0 ; - if (*dval2 < 0 ) dnew2 += 360.0 ; - if (*dval1 > 360 ) dnew1 -= 360.0 ; - if (*dval2 > 360 ) dnew2 -= 360.0 ; + if ((err1 = grib_get_double_array(handle1, name, dval1, &len1)) != GRIB_SUCCESS) { + printInfo(handle1); + printf("Oops... cannot get double value of [%s] in %s field: %s\n", + name, first_str, grib_get_error_message(err1)); + save_error(c, name); } - value_tolerance*=tolerance_factor; - if (verbose) printf(" (%d values) tolerance=%g\n",(int)len1,value_tolerance); - for(i = 0; i < len1; i++) { - if((diff=compare_double(pv1++,pv2++,&value_tolerance))!=0) { - countdiff++; - if (maxdiff < diff) {maxdiff=diff;imaxdiff=i;} - err1 = GRIB_VALUE_MISMATCH; - } + + if ((err2 = grib_get_double_array(handle2, name, dval2, &len2)) != GRIB_SUCCESS) { + printInfo(handle1); + printf("Oops... cannot get double value of [%s] in %s field: %s\n", + name, second_str, grib_get_error_message(err2)); + save_error(c, name); } - if (countdiff) { + if (err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS && len1 != len2) { printInfo(handle1); - save_error(c,name); - if (len1>1) { - printf("double [%s]: %d out of %ld different\n",name,countdiff,(long)len1); - if (dval1[imaxdiff] != GRIB_MISSING_DOUBLE && dval2[imaxdiff] != GRIB_MISSING_DOUBLE) { - if (compareAbsolute) printf(" max"); - printf(" absolute diff. = %.16e,",fabs(dval1[imaxdiff]-dval2[imaxdiff])); - if (!compareAbsolute) printf(" max"); - printf(" relative diff. = %g",relative_error(dval1[imaxdiff],dval2[imaxdiff],value_tolerance)); - printf("\n\tmax diff. element %d: %.20e %.20e", - imaxdiff,dval1[imaxdiff],dval2[imaxdiff]); - printf("\n\ttolerance=%.16e",value_tolerance); - } else { - /* One or both values are missing */ - char* svalA = double_as_string(c, dval1[imaxdiff]); - char* svalB = double_as_string(c, dval2[imaxdiff]); - printf("\tdiff. element %d: %s %s", imaxdiff, svalA, svalB); - grib_context_free(c,svalA); - grib_context_free(c,svalB); + printf("Different size for \"%s\" [%ld] [%ld]\n", name, (long)len1, (long)len2); + save_error(c, name); + } + if (err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS && len1 == len2) { + int imaxdiff; + double diff; + double *pv1, *pv2, dnew1, dnew2; + maxdiff = 0; + imaxdiff = 0; + countdiff = 0; + pv1 = dval1; + pv2 = dval2; + if (isangle) { + dnew1 = *dval1; + dnew2 = *dval2; + pv1 = &dnew1; + pv2 = &dnew2; + if (*dval1 < 0) + dnew1 += 360.0; + if (*dval2 < 0) + dnew2 += 360.0; + if (*dval1 > 360) + dnew1 -= 360.0; + if (*dval2 > 360) + dnew2 -= 360.0; + } + value_tolerance *= tolerance_factor; + if (verbose) + printf(" (%d values) tolerance=%g\n", (int)len1, value_tolerance); + for (i = 0; i < len1; i++) { + if ((diff = compare_double(pv1++, pv2++, &value_tolerance)) != 0) { + countdiff++; + if (maxdiff < diff) { + maxdiff = diff; + imaxdiff = i; + } + err1 = GRIB_VALUE_MISMATCH; } - if (packingError2!=0 || packingError1!=0) - printf(" packingError: [%g] [%g]",packingError1,packingError2); - - if (!grib_inline_strcmp(name,"packedValues") || !grib_inline_strcmp(name,"values") - || !grib_inline_strcmp(name,"codedValues")) { - double max1,min1,max2,min2; - grib_get_double(handle1,"max",&max1); - grib_get_double(handle1,"min",&min1); - grib_get_double(handle2,"max",&max2); - grib_get_double(handle2,"min",&min2); - printf("\n\tvalues max= [%g] [%g] min= [%g] [%g]",max1,max2,min1,min2); + } + + if (countdiff) { + printInfo(handle1); + save_error(c, name); + if (len1 > 1) { + printf("double [%s]: %d out of %ld different\n", name, countdiff, (long)len1); + if (dval1[imaxdiff] != GRIB_MISSING_DOUBLE && dval2[imaxdiff] != GRIB_MISSING_DOUBLE) { + if (compareAbsolute) + printf(" max"); + printf(" absolute diff. = %.16e,", fabs(dval1[imaxdiff] - dval2[imaxdiff])); + if (!compareAbsolute) + printf(" max"); + printf(" relative diff. = %g", relative_error(dval1[imaxdiff], dval2[imaxdiff], value_tolerance)); + printf("\n\tmax diff. element %d: %.20e %.20e", + imaxdiff, dval1[imaxdiff], dval2[imaxdiff]); + printf("\n\ttolerance=%.16e", value_tolerance); + } + else { + /* One or both values are missing */ + char* svalA = double_as_string(c, dval1[imaxdiff]); + char* svalB = double_as_string(c, dval2[imaxdiff]); + printf("\tdiff. element %d: %s %s", imaxdiff, svalA, svalB); + grib_context_free(c, svalA); + grib_context_free(c, svalB); + } + if (packingError2 != 0 || packingError1 != 0) + printf(" packingError: [%g] [%g]", packingError1, packingError2); + + if (!grib_inline_strcmp(name, "packedValues") || !grib_inline_strcmp(name, "values") || !grib_inline_strcmp(name, "codedValues")) { + double max1, min1, max2, min2; + grib_get_double(handle1, "max", &max1); + grib_get_double(handle1, "min", &min1); + grib_get_double(handle2, "max", &max2); + grib_get_double(handle2, "min", &min2); + printf("\n\tvalues max= [%g] [%g] min= [%g] [%g]", max1, max2, min1, min2); + } + printf("\n"); } - printf("\n"); - } else { - if (dval1[0] != GRIB_MISSING_DOUBLE && dval2[0] != GRIB_MISSING_DOUBLE) { - printf("double [%s]: [%.20e] != [%.20e]\n", name, dval1[0], dval2[0]); - printf("\tabsolute diff. = %g,",fabs(dval1[0]-dval2[0])); - printf(" relative diff. = %g\n",relative_error(dval1[0],dval2[0],value_tolerance)); - printf("\ttolerance=%g\n",value_tolerance); - } else { - /* One or both values are missing */ - char* svalA = double_as_string(c, dval1[0]); - char* svalB = double_as_string(c, dval2[0]); - printf("double [%s]: [%s] != [%s]\n", name, svalA, svalB); - grib_context_free(c,svalA); - grib_context_free(c,svalB); + else { + if (dval1[0] != GRIB_MISSING_DOUBLE && dval2[0] != GRIB_MISSING_DOUBLE) { + printf("double [%s]: [%.20e] != [%.20e]\n", name, dval1[0], dval2[0]); + printf("\tabsolute diff. = %g,", fabs(dval1[0] - dval2[0])); + printf(" relative diff. = %g\n", relative_error(dval1[0], dval2[0], value_tolerance)); + printf("\ttolerance=%g\n", value_tolerance); + } + else { + /* One or both values are missing */ + char* svalA = double_as_string(c, dval1[0]); + char* svalB = double_as_string(c, dval2[0]); + printf("double [%s]: [%s] != [%s]\n", name, svalA, svalB); + grib_context_free(c, svalA); + grib_context_free(c, svalB); + } } } } - } - - grib_context_free(handle1->context,dval1); - grib_context_free(handle2->context,dval2); - if(err1) return err1; - if(err2) return err2; - break; + grib_context_free(handle1->context, dval1); + grib_context_free(handle2->context, dval2); - case GRIB_TYPE_BYTES: - if (verbose) printf(" as bytes\n"); - if (options->mode==MODE_BUFR) return 0; - if (len1<2) len1=512; - if (len2<2) len2=512; - uval1 = (unsigned char*)grib_context_malloc(handle1->context,len1*sizeof(unsigned char)); - uval2 = (unsigned char*)grib_context_malloc(handle2->context,len2*sizeof(unsigned char)); - - if((err1 = grib_get_bytes(handle1,name,uval1,&len1)) != GRIB_SUCCESS) - { - printInfo(handle1); - save_error(c,name); - printf("Oops... cannot get bytes value of [%s] in %s field: %s\n", - name,first_str,grib_get_error_message(err1)); - } + if (err1) + return err1; + if (err2) + return err2; + break; - if((err2 = grib_get_bytes(handle2,name,uval2,&len2)) != GRIB_SUCCESS) - { - printInfo(handle1); - save_error(c,name); - printf("Oops... cannot get bytes value of [%s] in %s field: %s\n", - name,second_str,grib_get_error_message(err2)); - } + case GRIB_TYPE_BYTES: + if (verbose) + printf(" as bytes\n"); + if (options->mode == MODE_BUFR) + return 0; + if (len1 < 2) + len1 = 512; + if (len2 < 2) + len2 = 512; + uval1 = (unsigned char*)grib_context_malloc(handle1->context, len1 * sizeof(unsigned char)); + uval2 = (unsigned char*)grib_context_malloc(handle2->context, len2 * sizeof(unsigned char)); + + if ((err1 = grib_get_bytes(handle1, name, uval1, &len1)) != GRIB_SUCCESS) { + printInfo(handle1); + save_error(c, name); + printf("Oops... cannot get bytes value of [%s] in %s field: %s\n", + name, first_str, grib_get_error_message(err1)); + } - if(err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS) - { - if(memcmp(uval1,uval2,len1) != 0) - { - for(i = 0; i < len1; i++) { - if(uval1[i] != uval2[i]) - { - printInfo(handle1); - save_error(c,name); - if(len1 == 1) - printf("[%s] byte values are different: [%02x] and [%02x]\n", - name,uval1[i],uval2[i]); - else - printf("[%s] byte value %d of %ld are different: [%02x] and [%02x]\n", - name,i,(long)len1,uval1[i],uval2[i]); + if ((err2 = grib_get_bytes(handle2, name, uval2, &len2)) != GRIB_SUCCESS) { + printInfo(handle1); + save_error(c, name); + printf("Oops... cannot get bytes value of [%s] in %s field: %s\n", + name, second_str, grib_get_error_message(err2)); + } - err1 = GRIB_VALUE_MISMATCH; - break; + if (err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS) { + if (memcmp(uval1, uval2, len1) != 0) { + for (i = 0; i < len1; i++) { + if (uval1[i] != uval2[i]) { + printInfo(handle1); + save_error(c, name); + if (len1 == 1) + printf("[%s] byte values are different: [%02x] and [%02x]\n", + name, uval1[i], uval2[i]); + else + printf("[%s] byte value %d of %ld are different: [%02x] and [%02x]\n", + name, i, (long)len1, uval1[i], uval2[i]); + + err1 = GRIB_VALUE_MISMATCH; + break; + } } + err1 = GRIB_VALUE_MISMATCH; } - err1 = GRIB_VALUE_MISMATCH; } - } - grib_context_free(handle1->context,uval1); - grib_context_free(handle2->context,uval2); + grib_context_free(handle1->context, uval1); + grib_context_free(handle2->context, uval2); - if(err1) return err1; - if(err2) return err2; - break; + if (err1) + return err1; + if (err2) + return err2; + break; - case GRIB_TYPE_LABEL: - if (verbose) printf(" as label\n"); - break; + case GRIB_TYPE_LABEL: + if (verbose) + printf(" as label\n"); + break; - default: - if (verbose) printf("\n"); - printInfo(handle1); - save_error(c,name); - printf("Cannot compare [%s], unsupported type %d\n",name,type1); - return GRIB_UNABLE_TO_COMPARE_ACCESSORS; + default: + if (verbose) + printf("\n"); + printInfo(handle1); + save_error(c, name); + printf("Cannot compare [%s], unsupported type %d\n", name, type1); + return GRIB_UNABLE_TO_COMPARE_ACCESSORS; } return GRIB_SUCCESS; } static int compare_attributes(grib_handle* handle1, grib_handle* handle2, grib_runtime_options* options, - grib_accessor* a, const char* prefix, int* err) + grib_accessor* a, const char* prefix, int* err) { - int i=0, ret=0; - while (i < MAX_ACCESSOR_ATTRIBUTES && a->attributes[i]) - { + int i = 0, ret = 0; + while (i < MAX_ACCESSOR_ATTRIBUTES && a->attributes[i]) { /*long native_type = 0;*/ grib_accessor* aa = NULL; - if ( (a->attributes[i]->flags & GRIB_ACCESSOR_FLAG_DUMP)== 0 ) { + if ((a->attributes[i]->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) { ++i; /* next attribute if accessor is not for dumping */ continue; } - if ( (a->attributes[i]->flags & GRIB_ACCESSOR_FLAG_READ_ONLY)!= 0 ) { + if ((a->attributes[i]->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { ++i; /* next attribute if accessor is read-only */ continue; } @@ -1147,7 +1202,7 @@ static int compare_attributes(grib_handle* handle1, grib_handle* handle2, grib_r aa = a->attributes[i]; /*native_type = grib_accessor_get_native_type(aa); TODO: read only check? */ - isLeafKey = aa->attributes[0]==NULL ? 1 : 0; /* update global variable */ + isLeafKey = aa->attributes[0] == NULL ? 1 : 0; /* update global variable */ if (compare_attribute(handle1, handle2, options, aa, prefix, err)) { (*err)++; @@ -1162,51 +1217,51 @@ static int compare_attributes(grib_handle* handle1, grib_handle* handle2, grib_r } static int compare_attribute(grib_handle* handle1, grib_handle* handle2, grib_runtime_options* options, - grib_accessor* a, const char* prefix, int* err) + grib_accessor* a, const char* prefix, int* err) { - int ret = 0; + int ret = 0; grib_context* c = handle1->context; - char* fullname = (char*)grib_context_malloc_clear( c, sizeof(char)*(strlen(a->name)+strlen(prefix)+5) ); + char* fullname = (char*)grib_context_malloc_clear(c, sizeof(char) * (strlen(a->name) + strlen(prefix) + 5)); sprintf(fullname, "%s->%s", prefix, a->name); if (compare_values(options, handle1, handle2, fullname, GRIB_TYPE_UNDEFINED)) { (*err)++; write_messages(handle1, handle2); - ret=1; + ret = 1; } /* Recurse if this key has children */ if (!isLeafKey) { if (compare_attributes(handle1, handle2, options, a, fullname, err)) { - ret=1; + ret = 1; } } grib_context_free(c, fullname); return ret; } -static int compare_all_dump_keys(grib_handle* handle1, grib_handle* handle2, grib_runtime_options* options, int *pErr) +static int compare_all_dump_keys(grib_handle* handle1, grib_handle* handle2, grib_runtime_options* options, int* pErr) { - int ret=0; - const char* name=NULL; - grib_keys_iterator* iter = NULL; - grib_context* context=handle1->context; + int ret = 0; + const char* name = NULL; + grib_keys_iterator* iter = NULL; + grib_context* context = handle1->context; if (!headerMode) { /* See ECC-333: By setting unpack we get ALL the bufr keys. */ /* In headerMode we want just the header ones */ - grib_set_long(handle1,"skipExtraKeyAttributes",1); /* See ECC-745 */ - ret = grib_set_long(handle1,"unpack",1); + grib_set_long(handle1, "skipExtraKeyAttributes", 1); /* See ECC-745 */ + ret = grib_set_long(handle1, "unpack", 1); if (ret != GRIB_SUCCESS) { grib_context_log(context, GRIB_LOG_ERROR, "Failed to unpack 1st message: %s", grib_get_error_message(ret)); exit(1); } - grib_set_long(handle2,"skipExtraKeyAttributes",1); /* See ECC-745 */ - ret = grib_set_long(handle2,"unpack",1); + grib_set_long(handle2, "skipExtraKeyAttributes", 1); /* See ECC-745 */ + ret = grib_set_long(handle2, "unpack", 1); if (ret != GRIB_SUCCESS) { grib_context_log(context, GRIB_LOG_ERROR, "Failed to unpack 2nd message: %s", grib_get_error_message(ret)); exit(1); } } - iter=grib_keys_iterator_new(handle1,0,NULL); + iter = grib_keys_iterator_new(handle1, 0, NULL); if (!iter) { grib_context_log(context, GRIB_LOG_ERROR, "unable to create keys iterator"); @@ -1216,43 +1271,47 @@ static int compare_all_dump_keys(grib_handle* handle1, grib_handle* handle2, gri release_keys_list(); /* The keys list is used to determine the rank */ new_keys_list(); - while(grib_keys_iterator_next(iter)) - { - int rank = 0; - int dofree = 0; - char* prefix = NULL; - grib_accessor* xa=grib_keys_iterator_get_accessor(iter); + while (grib_keys_iterator_next(iter)) { + int rank = 0; + int dofree = 0; + char* prefix = NULL; + grib_accessor* xa = grib_keys_iterator_get_accessor(iter); isLeafKey = 0; /* clear global variable for each key */ - name=grib_keys_iterator_get_name(iter); - if (blacklisted(name)) continue; - if (xa==NULL || ( xa->flags & GRIB_ACCESSOR_FLAG_DUMP )==0 ) continue; + name = grib_keys_iterator_get_name(iter); + if (blacklisted(name)) + continue; + if (xa == NULL || (xa->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) + continue; /* Get full name of key, e.g. '#2#windSpeed' or 'blockNumber' */ rank = compute_bufr_key_rank(handle1, keys_list, xa->name); if (rank != 0) { - prefix=(char*)grib_context_malloc_clear(context,sizeof(char)*(strlen(xa->name)+10)); + prefix = (char*)grib_context_malloc_clear(context, sizeof(char) * (strlen(xa->name) + 10)); dofree = 1; - sprintf(prefix,"#%d#%s", rank, xa->name); - } else { + sprintf(prefix, "#%d#%s", rank, xa->name); + } + else { prefix = (char*)xa->name; } - if (blacklisted(prefix)) continue; + if (blacklisted(prefix)) + continue; /* Compare the key itself */ if (compare_values(options, handle1, handle2, prefix, GRIB_TYPE_UNDEFINED)) { (*pErr)++; write_messages(handle1, handle2); - ret=1; + ret = 1; } /* Now compare the key attributes (if any) */ if (compare_attributes(handle1, handle2, options, xa, prefix, pErr)) { (*pErr)++; write_messages(handle1, handle2); - ret=1; + ret = 1; } - if (dofree) grib_context_free(context, prefix); + if (dofree) + grib_context_free(context, prefix); } grib_keys_iterator_delete(iter); @@ -1263,7 +1322,7 @@ static int compare_all_dump_keys(grib_handle* handle1, grib_handle* handle2, gri if (compare_values(options, handle1, handle2, "ident", GRIB_TYPE_STRING)) { (*pErr)++; write_messages(handle1, handle2); - ret=1; + ret = 1; } } @@ -1272,13 +1331,13 @@ static int compare_all_dump_keys(grib_handle* handle1, grib_handle* handle2, gri static int compare_handles(grib_handle* handle1, grib_handle* handle2, grib_runtime_options* options) { - int err = 0; - int i=0; - grib_keys_iterator* iter = NULL; - const char* name=NULL; + int err = 0; + int i = 0; + grib_keys_iterator* iter = NULL; + const char* name = NULL; /* mask only if no -c option or headerMode (-H)*/ - if (blacklist && ( !listFromCommandLine || headerMode )) { + if (blacklist && (!listFromCommandLine || headerMode)) { /* See ECC-245, GRIB-573, GRIB-915: Do not change handles in memory */ /* grib_string_list* nextb=blacklist; @@ -1289,43 +1348,46 @@ static int compare_handles(grib_handle* handle1, grib_handle* handle2, grib_runt }*/ } - if ( listFromCommandLine && onlyListed ) { - for (i=0; i< options->compare_count; i++) { - if (blacklisted(options->compare[i].name)) continue; + if (listFromCommandLine && onlyListed) { + for (i = 0; i < options->compare_count; i++) { + if (blacklisted(options->compare[i].name)) + continue; if (options->compare[i].type == GRIB_NAMESPACE) { - iter=grib_keys_iterator_new(handle1,0,options->compare[i].name); + iter = grib_keys_iterator_new(handle1, 0, options->compare[i].name); if (!iter) { grib_context_log(handle1->context, GRIB_LOG_ERROR, "unable to get iterator"); exit(1); } - while(grib_keys_iterator_next(iter)) - { - name=grib_keys_iterator_get_name(iter); + while (grib_keys_iterator_next(iter)) { + name = grib_keys_iterator_get_name(iter); /*printf("----- comparing %s\n",name);*/ - if (blacklisted(name)) continue; - if(compare_values(options,handle1,handle2,name,GRIB_TYPE_UNDEFINED)) { + if (blacklisted(name)) + continue; + if (compare_values(options, handle1, handle2, name, GRIB_TYPE_UNDEFINED)) { err++; - write_messages(handle1,handle2); + write_messages(handle1, handle2); } } grib_keys_iterator_delete(iter); - } else { - if( compare_values(options,handle1,handle2,options->compare[i].name,options->compare[i].type)) + } + else { + if (compare_values(options, handle1, handle2, options->compare[i].name, options->compare[i].type)) err++; - write_messages(handle1,handle2); + write_messages(handle1, handle2); } } - } else { - const void *msg1=NULL,*msg2=NULL; - size_t size1=0,size2=0; - int memcmp_ret=0; + } + else { + const void *msg1 = NULL, *msg2 = NULL; + size_t size1 = 0, size2 = 0; + int memcmp_ret = 0; /* int ii=0; */ - GRIB_CHECK_NOLINE(grib_get_message(handle1,&msg1,&size1),0); - GRIB_CHECK_NOLINE(grib_get_message(handle2,&msg2,&size2),0); - if (size1==size2 && !(memcmp_ret=memcmp(msg1,msg2,size1))) { + GRIB_CHECK_NOLINE(grib_get_message(handle1, &msg1, &size1), 0); + GRIB_CHECK_NOLINE(grib_get_message(handle2, &msg2, &size2), 0); + if (size1 == size2 && !(memcmp_ret = memcmp(msg1, msg2, size1))) { return 0; - } + } #if 0 else { int lcount=count,ii; @@ -1348,53 +1410,55 @@ static int compare_handles(grib_handle* handle1, grib_handle* handle2, grib_runt } #endif - if ( listFromCommandLine ) { - for (i=0; i< options->compare_count; i++) { - if (blacklisted(name)) continue; + if (listFromCommandLine) { + for (i = 0; i < options->compare_count; i++) { + if (blacklisted(name)) + continue; if (options->compare[i].type == GRIB_NAMESPACE) { - iter=grib_keys_iterator_new(handle1,0,options->compare[i].name); + iter = grib_keys_iterator_new(handle1, 0, options->compare[i].name); if (!iter) { grib_context_log(handle1->context, GRIB_LOG_ERROR, - "ERROR: unable to get keys iterator for %s",options->compare[i].name); + "ERROR: unable to get keys iterator for %s", options->compare[i].name); exit(1); } - while(grib_keys_iterator_next(iter)) - { - name=grib_keys_iterator_get_name(iter); + while (grib_keys_iterator_next(iter)) { + name = grib_keys_iterator_get_name(iter); /*printf("----- comparing %s\n",name);*/ - if (blacklisted(name)) continue; - if(compare_values(options,handle1,handle2,name,GRIB_TYPE_UNDEFINED)) { + if (blacklisted(name)) + continue; + if (compare_values(options, handle1, handle2, name, GRIB_TYPE_UNDEFINED)) { err++; - write_messages(handle1,handle2); - if (compare_all_dump_keys(handle1,handle2,options,&err)) { + write_messages(handle1, handle2); + if (compare_all_dump_keys(handle1, handle2, options, &err)) { err++; } } } grib_keys_iterator_delete(iter); - } else { - if( compare_values(options,handle1,handle2,options->compare[i].name,options->compare[i].type)) { + } + else { + if (compare_values(options, handle1, handle2, options->compare[i].name, options->compare[i].type)) { err++; - write_messages(handle1,handle2); - if (compare_all_dump_keys(handle1,handle2,options,&err)) { + write_messages(handle1, handle2); + if (compare_all_dump_keys(handle1, handle2, options, &err)) { err++; } } } } - } else { - if (compare_all_dump_keys(handle1,handle2,options,&err)) { + } + else { + if (compare_all_dump_keys(handle1, handle2, options, &err)) { err++; } } - } return err; } int grib_no_handle_action(grib_runtime_options* options, int err) { - fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\t\t\"ERROR: unreadable message\"\n"); return 0; } diff --git a/tools/bufr_copy.c b/tools/bufr_copy.c index 66440991a..2926e8716 100644 --- a/tools/bufr_copy.c +++ b/tools/bufr_copy.c @@ -15,45 +15,47 @@ #include "grib_tools.h" -const char* grib_tool_description="Copies the content of BUFR files printing" - " values of some keys." - "\n\tIf the name of the output_bufr_file contains a key enclosed in square brackets, its value will be used."; -const char* grib_tool_name="bufr_copy"; -const char* grib_tool_usage="[options] bufr_file bufr_file ... output_bufr_file"; - -grib_option grib_options[]={ - /* {id, args, help}, on, command_line, value */ - {"f",0,0,0,1,0}, - {"c",0,0,1,0,0}, - /* {"r",0,0,0,1,0}, */ - {"q",0,0,1,0,0}, - {"p:",0,0,1,1,0}, - {"s:",0,0,0,1,0}, - {"P:",0,0,0,1,0}, - {"w:","key[:{s|d|i}]=value,key[:{s|d|i}]=value,...","\n\t\tWhere clause." - "\n\t\tOnly BUFR messages matching the key/value constraints are " - "copied to the output_bufr_file.\n\t\tFor each key a string (key:s), a " - "double (key:d) or an integer (key:i)\n\t\ttype can be defined. Default type is string." - "\n\t\tNote: only one -w clause is allowed.\n", 0,1,0}, -/* {"B:",0,0,0,1,0}, */ - {"V",0,0,0,1,0}, - {"W:",0,0,0,1,0}, - {"U",0,0,1,0,0}, - {"H",0,0,1,0,0}, - {"T:",0,0,1,0,"B"}, - {"S",0,0,1,0,0}, - {"g",0,0,0,1,0}, - {"7",0,0,0,1,0}, - {"X:",0,0,0,1,0}, - {"v",0,0,0,1,0} +const char* grib_tool_description = + "Copies the content of BUFR files printing" + " values of some keys." + "\n\tIf the name of the output_bufr_file contains a key enclosed in square brackets, its value will be used."; +const char* grib_tool_name = "bufr_copy"; +const char* grib_tool_usage = "[options] bufr_file bufr_file ... output_bufr_file"; + +grib_option grib_options[] = { + /* {id, args, help}, on, command_line, value */ + { "f", 0, 0, 0, 1, 0 }, + { "c", 0, 0, 1, 0, 0 }, + /* {"r",0,0,0,1,0}, */ + { "q", 0, 0, 1, 0, 0 }, + { "p:", 0, 0, 1, 1, 0 }, + { "s:", 0, 0, 0, 1, 0 }, + { "P:", 0, 0, 0, 1, 0 }, + { "w:", "key[:{s|d|i}]=value,key[:{s|d|i}]=value,...", + "\n\t\tWhere clause." + "\n\t\tOnly BUFR messages matching the key/value constraints are " + "copied to the output_bufr_file.\n\t\tFor each key a string (key:s), a " + "double (key:d) or an integer (key:i)\n\t\ttype can be defined. Default type is string." + "\n\t\tNote: only one -w clause is allowed.\n", + 0, 1, 0 }, + /* {"B:",0,0,0,1,0}, */ + { "V", 0, 0, 0, 1, 0 }, + { "W:", 0, 0, 0, 1, 0 }, + { "U", 0, 0, 1, 0, 0 }, + { "H", 0, 0, 1, 0, 0 }, + { "T:", 0, 0, 1, 0, "B" }, + { "S", 0, 0, 1, 0, 0 }, + { "g", 0, 0, 0, 1, 0 }, + { "7", 0, 0, 0, 1, 0 }, + { "X:", 0, 0, 0, 1, 0 }, + { "v", 0, 0, 0, 1, 0 } }; -int grib_options_count=sizeof(grib_options)/sizeof(grib_option); +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - int ret=grib_tool(argc,argv); - return ret; + return grib_tool(argc, argv); } int grib_tool_before_getopt(grib_runtime_options* options) @@ -81,12 +83,12 @@ int grib_tool_init(grib_runtime_options* options) return 0; } -int grib_tool_new_filename_action(grib_runtime_options* options,const char* file) +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) { return 0; } -int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file) +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { exit_if_input_is_directory(grib_tool_name, file->name); return 0; @@ -94,15 +96,16 @@ int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* fil int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) { - int err=0; + int err = 0; if (!options->skip) { if (options->set_values_count != 0) - err=grib_set_values(h,options->set_values,options->set_values_count); + err = grib_set_values(h, options->set_values, options->set_values_count); - if( err != GRIB_SUCCESS && options->fail) exit(err); + if (err != GRIB_SUCCESS && options->fail) + exit(err); } - grib_tools_write_message(options,h); + grib_tools_write_message(options, h); return 0; } @@ -112,9 +115,9 @@ int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) return 0; } -void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h) +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) { - grib_print_key_values(options,h); + grib_print_key_values(options, h); } int grib_tool_finalise_action(grib_runtime_options* options) @@ -126,6 +129,6 @@ int grib_tool_finalise_action(grib_runtime_options* options) int grib_no_handle_action(grib_runtime_options* options, int err) { - fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\t\t\"ERROR: unreadable message\"\n"); return 0; } diff --git a/tools/bufr_dump.c b/tools/bufr_dump.c index 77cffe9f0..54c16f819 100644 --- a/tools/bufr_dump.c +++ b/tools/bufr_dump.c @@ -15,69 +15,72 @@ #include "grib_tools.h" -grib_option grib_options[]={ - /* {id, args, help}, on, command_line, value*/ - {"j:","s|f|a","\n\t\tJSON mode (JavaScript Object Notation)." - "\n\t\tOptions: s->structure, f->flat (only data), a->all attributes" - "\n\t\tDefault mode is structure.\n", - 1,1,"s"}, - {"D:","filter|fortran|python|C","\n\t\tDecoding dump. Provides instructions to decode the input message." - "\n\t\tOptions: filter -> filter instructions file to decode input BUFR (for bufr_filter)" - "\n\t\t fortran -> fortran program to decode the input BUFR" - "\n\t\t python -> python script to decode the input BUFR" - "\n\t\t C -> C program to decode the input BUFR" - "\n\t\tDefault mode is filter.\n", - 0,1,"filter"}, - {"E:","filter|fortran|python|C","\n\t\tEncoding dump. Provides instructions to create the input message." - "\n\t\tOptions: filter -> filter instructions file to encode input BUFR (for bufr_filter)" - "\n\t\t fortran -> fortran program to encode the input BUFR" - "\n\t\t python -> python script to encode the input BUFR" - "\n\t\t C -> C program to encode the input BUFR" - "\n\t\tDefault mode is filter.\n", - 0,1,"filter"}, - - /*{"S",0,0,1,0,0},*/ - {"O",0,"Octet mode. WMO documentation style dump.\n",0,1,0}, - {"p",0,"Plain dump (key=value format).\n",0,1,0}, - /* {"D",0,0,0,1,0}, */ /* See ECC-215 */ - {"d",0,"Dump the expanded descriptors.\n",0,1,0}, - /*{"u",0,"Print only some values.\n",0,1,0},*/ - /* {"C",0,0,0,1,0}, */ - {"t",0,0,0,1,0}, - {"f",0,0,0,1,0}, - {"H",0,0,0,1,0}, - {"a",0,0,0,1,0}, - {"w:",0,0,0,1,0}, - {"s:",0,0,0,1,0}, - /* {"M",0,0,0,1,0}, */ - {"T:",0,0,1,0,"B"}, - {"7",0,0,0,1,0}, - {"V",0,0,0,1,0}, - {"q",0,0,1,0,0}, - {"S:","subset_number","\n\t\tDump the given subset\n",0,1,0}, - {"X:",0,0,0,1,0} - /* {"x",0,0,0,1,0} */ +grib_option grib_options[] = { + /* {id, args, help}, on, command_line, value*/ + { "j:", "s|f|a", + "\n\t\tJSON mode (JavaScript Object Notation)." + "\n\t\tOptions: s->structure, f->flat (only data), a->all attributes" + "\n\t\tDefault mode is structure.\n", + 1, 1, "s" }, + { "D:", "filter|fortran|python|C", + "\n\t\tDecoding dump. Provides instructions to decode the input message." + "\n\t\tOptions: filter -> filter instructions file to decode input BUFR (for bufr_filter)" + "\n\t\t fortran -> fortran program to decode the input BUFR" + "\n\t\t python -> python script to decode the input BUFR" + "\n\t\t C -> C program to decode the input BUFR" + "\n\t\tDefault mode is filter.\n", + 0, 1, "filter" }, + { "E:", "filter|fortran|python|C", + "\n\t\tEncoding dump. Provides instructions to create the input message." + "\n\t\tOptions: filter -> filter instructions file to encode input BUFR (for bufr_filter)" + "\n\t\t fortran -> fortran program to encode the input BUFR" + "\n\t\t python -> python script to encode the input BUFR" + "\n\t\t C -> C program to encode the input BUFR" + "\n\t\tDefault mode is filter.\n", + 0, 1, "filter" }, + + /*{"S",0,0,1,0,0},*/ + { "O", 0, "Octet mode. WMO documentation style dump.\n", 0, 1, 0 }, + { "p", 0, "Plain dump (key=value format).\n", 0, 1, 0 }, + /* {"D",0,0,0,1,0}, */ /* See ECC-215 */ + { "d", 0, "Dump the expanded descriptors.\n", 0, 1, 0 }, + /*{"u",0,"Print only some values.\n",0,1,0},*/ + /* {"C",0,0,0,1,0}, */ + { "t", 0, 0, 0, 1, 0 }, + { "f", 0, 0, 0, 1, 0 }, + { "H", 0, 0, 0, 1, 0 }, + { "a", 0, 0, 0, 1, 0 }, + { "w:", 0, 0, 0, 1, 0 }, + { "s:", 0, 0, 0, 1, 0 }, + /* {"M",0,0,0,1,0}, */ + { "T:", 0, 0, 1, 0, "B" }, + { "7", 0, 0, 0, 1, 0 }, + { "V", 0, 0, 0, 1, 0 }, + { "q", 0, 0, 1, 0, 0 }, + { "S:", "subset_number", "\n\t\tDump the given subset\n", 0, 1, 0 }, + { "X:", 0, 0, 0, 1, 0 } + /* {"x",0,0,0,1,0} */ }; -const char* grib_tool_description="Dump the content of a BUFR file in different formats."; -const char* grib_tool_name="bufr_dump"; -const char* grib_tool_usage="[options] bufr_file bufr_file ..."; -static int json=0; -static int dump_descriptors=0; -static char* json_option=0; -static int first_handle=1; -static grib_dumper* dumper=0; +const char* grib_tool_description = "Dump the content of a BUFR file in different formats."; +const char* grib_tool_name = "bufr_dump"; +const char* grib_tool_usage = "[options] bufr_file bufr_file ..."; +static int json = 0; +static int dump_descriptors = 0; +static char* json_option = 0; +static int first_handle = 1; +static grib_dumper* dumper = 0; -int grib_options_count=sizeof(grib_options)/sizeof(grib_option); +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); /** * bufr_dump * Dump the content of a BUFR file * */ -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - return grib_tool(argc,argv); + return grib_tool(argc, argv); } int grib_tool_before_getopt(grib_runtime_options* options) @@ -87,11 +90,11 @@ int grib_tool_before_getopt(grib_runtime_options* options) static void check_code_gen_dump_mode(const char* language) { - grib_context *c = grib_context_get_default(); - const int ok = (strcmp(language, "C")==0 || - strcmp(language, "fortran")==0 || - strcmp(language, "python")==0 || - strcmp(language, "filter")==0); + grib_context* c = grib_context_get_default(); + const int ok = (strcmp(language, "C") == 0 || + strcmp(language, "fortran") == 0 || + strcmp(language, "python") == 0 || + strcmp(language, "filter") == 0); if (!ok) { grib_context_log(c, GRIB_LOG_ERROR, "Invalid language specified. Select one of: filter, fortran, python or C"); } @@ -99,54 +102,51 @@ static void check_code_gen_dump_mode(const char* language) int grib_tool_init(grib_runtime_options* options) { - int opt=grib_options_on("C")+grib_options_on("O"); + int opt = grib_options_on("C") + grib_options_on("O"); options->dump_mode = "default"; - options->strict=1; /* Must set here as bufr_dump has its own -S option */ + options->strict = 1; /* Must set here as bufr_dump has its own -S option */ if (opt > 1) { - printf("%s: simultaneous j/C/O options not allowed\n",grib_tool_name); + printf("%s: simultaneous j/C/O options not allowed\n", grib_tool_name); exit(1); } if (grib_options_on("j:")) { options->dump_mode = "json"; - json_option=grib_options_get_option("j:"); - if (strlen(json_option)>1 || ( json_option[0] != 's' && json_option[0]!= 'f' && json_option[0]!= 'a')) { + json_option = grib_options_get_option("j:"); + if (strlen(json_option) > 1 || (json_option[0] != 's' && json_option[0] != 'f' && json_option[0] != 'a')) { printf("%s: Invalid JSON option %s\n", grib_tool_name, json_option); exit(1); } - json=1; + json = 1; } - if (grib_options_on("O")) { - options->dump_mode = "wmo"; - json=0; - options->dump_flags = GRIB_DUMP_FLAG_CODED - | GRIB_DUMP_FLAG_OCTECT - | GRIB_DUMP_FLAG_VALUES - | GRIB_DUMP_FLAG_READ_ONLY; + if (grib_options_on("O")) { + options->dump_mode = "wmo"; + json = 0; + options->dump_flags = GRIB_DUMP_FLAG_CODED | GRIB_DUMP_FLAG_OCTECT | GRIB_DUMP_FLAG_VALUES | GRIB_DUMP_FLAG_READ_ONLY; } - if (grib_options_on("p")) { + if (grib_options_on("p")) { options->dump_mode = "bufr_simple"; - json=0; + json = 0; } if (grib_options_on("D:")) { options->dump_mode = grib_options_get_option("D:"); check_code_gen_dump_mode(options->dump_mode); - json=0; + json = 0; } if (grib_options_on("E:")) { - grib_context *c = grib_context_get_default(); + grib_context* c = grib_context_get_default(); if (c->bufr_multi_element_constant_arrays) { grib_context_log(c, GRIB_LOG_ERROR, "Code generation for encoding is not implemented when ECCODES_BUFR_MULTI_ELEMENT_CONSTANT_ARRAYS is enabled"); exit(1); } options->dump_mode = grib_options_get_option("E:"); check_code_gen_dump_mode(options->dump_mode); - json=0; + json = 0; } /* See ECC-215 @@ -168,7 +168,7 @@ int grib_tool_init(grib_runtime_options* options) if (grib_options_on("d") && !grib_options_on("u")) { options->dump_flags |= GRIB_DUMP_FLAG_ALL_DATA; dump_descriptors = 1; - json=0; + json = 0; } /* Turn off GRIB multi-field support mode. Not relevant for BUFR */ @@ -177,35 +177,37 @@ int grib_tool_init(grib_runtime_options* options) return 0; } -int grib_tool_new_filename_action(grib_runtime_options* options,const char* file) +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) { return 0; } -int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file) +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { - if (!options->current_infile->name) return 0; - if (json) return 0; + if (!options->current_infile->name) + return 0; + if (json) + return 0; if (grib_options_on("E:") || grib_options_on("D:")) { if (!strcmp(options->dump_mode, "filter")) { /* Dump filter for one message only. Multi-message BUFR files will not work! */ - int err = 0, numMessages=0; - grib_context *c = grib_context_get_default(); - err = grib_count_in_file(c, options->current_infile->file, &numMessages); + int err = 0, numMessages = 0; + grib_context* c = grib_context_get_default(); + err = grib_count_in_file(c, options->current_infile->file, &numMessages); if (!err && numMessages > 1) { - fprintf(stderr,"\nERROR: Cannot dump filter for multi-message BUFR files.\n"); - fprintf(stderr," (The input file \"%s\" has %d messages)\n", options->current_infile->name, numMessages); - fprintf(stderr," Please split the input file and dump filter for each message separately.\n"); + fprintf(stderr, "\nERROR: Cannot dump filter for multi-message BUFR files.\n"); + fprintf(stderr, " (The input file \"%s\" has %d messages)\n", options->current_infile->name, numMessages); + fprintf(stderr, " Please split the input file and dump filter for each message separately.\n"); exit(1); } } } else { char tmp[1024]; - sprintf(tmp,"FILE: %s ",options->current_infile->name); + sprintf(tmp, "FILE: %s ", options->current_infile->name); if (!grib_options_on("p")) - fprintf(stdout,"***** %s\n",tmp); + fprintf(stdout, "***** %s\n", tmp); } return 0; @@ -215,31 +217,31 @@ static char* get_dumper_name(grib_runtime_options* options) { if (grib_options_on("E:")) { /* Dumper for ENCODING */ - if (strcmp(options->dump_mode,"filter")==0) { + if (strcmp(options->dump_mode, "filter") == 0) { return "bufr_encode_filter"; } - if (strcmp(options->dump_mode,"fortran")==0) { + if (strcmp(options->dump_mode, "fortran") == 0) { return "bufr_encode_fortran"; } - if (strcmp(options->dump_mode,"C")==0) { + if (strcmp(options->dump_mode, "C") == 0) { return "bufr_encode_C"; } - if (strcmp(options->dump_mode,"python")==0) { + if (strcmp(options->dump_mode, "python") == 0) { return "bufr_encode_python"; } } else if (grib_options_on("D:")) { /* Dumper for DECODING */ - if (strcmp(options->dump_mode,"filter")==0) { + if (strcmp(options->dump_mode, "filter") == 0) { return "bufr_decode_filter"; } - if (strcmp(options->dump_mode,"fortran")==0) { + if (strcmp(options->dump_mode, "fortran") == 0) { return "bufr_decode_fortran"; } - if (strcmp(options->dump_mode,"C")==0) { + if (strcmp(options->dump_mode, "C") == 0) { return "bufr_decode_C"; } - if (strcmp(options->dump_mode,"python")==0) { + if (strcmp(options->dump_mode, "python") == 0) { return "bufr_decode_python"; } } @@ -248,8 +250,8 @@ static char* get_dumper_name(grib_runtime_options* options) static void print_header(grib_runtime_options* options) { - if (strcmp(options->dump_mode,"filter")==0) { - int print_unpack=0; + if (strcmp(options->dump_mode, "filter") == 0) { + int print_unpack = 0; char generator_name[32]; if (grib_options_on("D:")) { @@ -260,80 +262,83 @@ static void print_header(grib_runtime_options* options) strcpy(generator_name, "-Efilter"); } - fprintf(stdout,"# This filter was automatically generated with bufr_dump %s\n", generator_name); - fprintf(stdout,"# Using ecCodes version: "); + fprintf(stdout, "# This filter was automatically generated with bufr_dump %s\n", generator_name); + fprintf(stdout, "# Using ecCodes version: "); grib_print_api_version(stdout); fprintf(stdout, "\n\n"); - if (print_unpack) fprintf(stdout,"set unpack=1;\n"); + if (print_unpack) + fprintf(stdout, "set unpack=1;\n"); } } static void bufr_dump_descriptors(grib_handle* h) { - size_t size_desc=0, size_names=0, size_abbrevs=0, size_units=0; - size_t i=0, j=0, size_proper=0; - long* array_descriptors = NULL; - char** array_names = NULL; - char** array_abbrevs = NULL; - char** array_units = NULL; - char* the_key = "expandedDescriptors"; - - GRIB_CHECK_NOLINE( grib_get_size(h, the_key, &size_desc), 0); - array_descriptors = (long*)malloc(size_desc*sizeof(long)); + size_t size_desc = 0, size_names = 0, size_abbrevs = 0, size_units = 0; + size_t i = 0, j = 0, size_proper = 0; + long* array_descriptors = NULL; + char** array_names = NULL; + char** array_abbrevs = NULL; + char** array_units = NULL; + char* the_key = "expandedDescriptors"; + + GRIB_CHECK_NOLINE(grib_get_size(h, the_key, &size_desc), 0); + array_descriptors = (long*)malloc(size_desc * sizeof(long)); if (!array_descriptors) { fprintf(stderr, "%s: Memory allocation error", the_key); exit(GRIB_OUT_OF_MEMORY); } - GRIB_CHECK_NOLINE( grib_get_long_array(h, the_key, array_descriptors, &size_desc), 0); + GRIB_CHECK_NOLINE(grib_get_long_array(h, the_key, array_descriptors, &size_desc), 0); size_proper = size_desc; /* Exclude the pesky 999999 descriptors as they don't * have equivalents in the name, abbreviation and units arrays! */ - for(i=0; iskip) { if (options->set_values_count != 0) - err=grib_set_values(h,options->set_values,options->set_values_count); - if (err != GRIB_SUCCESS && options->fail) exit(err); + err = grib_set_values(h, options->set_values, options->set_values_count); + if (err != GRIB_SUCCESS && options->fail) + exit(err); } - for (i=0;iprint_keys_count;i++) - grib_set_flag(h,options->print_keys[i].name,GRIB_ACCESSOR_FLAG_DUMP); + for (i = 0; i < options->print_keys_count; i++) + grib_set_flag(h, options->print_keys[i].name, GRIB_ACCESSOR_FLAG_DUMP); if (grib_options_on("S:")) { - long numberOfSubsets=0, subsetNumber=0; - char *str = grib_options_get_option("S:"); - err = grib_get_long(h,"numberOfSubsets",&numberOfSubsets); + long numberOfSubsets = 0, subsetNumber = 0; + char* str = grib_options_get_option("S:"); + err = grib_get_long(h, "numberOfSubsets", &numberOfSubsets); if (err) { fprintf(stderr, "ERROR: Failed to get numberOfSubsets.\n"); exit(1); @@ -400,143 +406,146 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) if (check_subset_number(str, numberOfSubsets, &subsetNumber) == GRIB_SUCCESS) { if (numberOfSubsets > 1) { grib_handle* new_handle = 0; - grib_handle *h2; - size_t size = 0; - const void *buffer = NULL; + grib_handle* h2; + size_t size = 0; + const void* buffer = NULL; /* Clone, unpack and extract that particular subset */ h2 = grib_handle_clone(h); Assert(h2); - GRIB_CHECK_NOLINE(grib_set_long(h2,"unpack", 1), 0); - GRIB_CHECK_NOLINE(grib_set_long(h2,"extractSubset", subsetNumber), 0); - GRIB_CHECK_NOLINE(grib_set_long(h2,"doExtractSubsets",1), 0); + GRIB_CHECK_NOLINE(grib_set_long(h2, "unpack", 1), 0); + GRIB_CHECK_NOLINE(grib_set_long(h2, "extractSubset", subsetNumber), 0); + GRIB_CHECK_NOLINE(grib_set_long(h2, "doExtractSubsets", 1), 0); /* Put result into buffer then form new handle from it */ - GRIB_CHECK_NOLINE(grib_get_message(h2, &buffer, &size),0); + GRIB_CHECK_NOLINE(grib_get_message(h2, &buffer, &size), 0); new_handle = grib_handle_new_from_message(0, buffer, size); Assert(new_handle); /* Replace handle with the new one which has only one subset */ h = new_handle; /*TODO: possible leak!*/ } - } else { - fprintf(stderr, "ERROR: -S option: Please specify a subset number > 0 and < %ld\n", numberOfSubsets+1); + } + else { + fprintf(stderr, "ERROR: -S option: Please specify a subset number > 0 and < %ld\n", numberOfSubsets + 1); exit(1); } } - if (json) - { + if (json) { /* ECC-233: print comma as separator between messages */ - if (!first_handle && options->handle_count>1) { - fprintf(stdout,",\n"); + if (!first_handle && options->handle_count > 1) { + fprintf(stdout, ",\n"); } if (json && first_handle) { - fprintf(stdout,"{ \"messages\" : [ \n"); - first_handle=0; + fprintf(stdout, "{ \"messages\" : [ \n"); + first_handle = 0; } switch (json_option[0]) { - case 'f': - err=grib_set_long(h,"unpack",2); - if (err) { - if (options->fail) { - fprintf(stderr, "ERROR: unable to unpack data section: %s (message=%d)\n", - grib_get_error_message(err), options->handle_count); - exit(err); - } else { - fprintf(stdout,"\"ERROR: unable to unpack data section\""); - options->error=err; - /*return err; See ECC-723*/ + case 'f': + err = grib_set_long(h, "unpack", 2); + if (err) { + if (options->fail) { + fprintf(stderr, "ERROR: unable to unpack data section: %s (message=%d)\n", + grib_get_error_message(err), options->handle_count); + exit(err); + } + else { + fprintf(stdout, "\"ERROR: unable to unpack data section\""); + options->error = err; + /*return err; See ECC-723*/ + } } - } - a=grib_find_accessor(h,"numericValues"); - al=accessor_bufr_data_array_get_dataAccessors(a); - options->dump_flags=GRIB_DUMP_FLAG_ALL_ATTRIBUTES; - codes_dump_bufr_flat(al,h,stdout,options->dump_mode,options->dump_flags,0); - break; - case 's': - err=grib_set_long(h,"unpack",1); - if (err) { - if (options->fail) { - fprintf(stderr, "ERROR: unable to unpack data section: %s (message=%d)\n", - grib_get_error_message(err), options->handle_count); - exit(err); - } else { - fprintf(stdout,"\"ERROR: unable to unpack data section\""); - options->error=err; - /*return err; See ECC-723*/ + a = grib_find_accessor(h, "numericValues"); + al = accessor_bufr_data_array_get_dataAccessors(a); + options->dump_flags = GRIB_DUMP_FLAG_ALL_ATTRIBUTES; + codes_dump_bufr_flat(al, h, stdout, options->dump_mode, options->dump_flags, 0); + break; + case 's': + err = grib_set_long(h, "unpack", 1); + if (err) { + if (options->fail) { + fprintf(stderr, "ERROR: unable to unpack data section: %s (message=%d)\n", + grib_get_error_message(err), options->handle_count); + exit(err); + } + else { + fprintf(stdout, "\"ERROR: unable to unpack data section\""); + options->error = err; + /*return err; See ECC-723*/ + } } - } - grib_dump_content(h,stdout,options->dump_mode,options->dump_flags,0); - break; - case 'a': - err=grib_set_long(h,"unpack",1); - if (err) { - if (options->fail) { - fprintf(stderr, "ERROR: unable to unpack data section: %s (message=%d)\n", - grib_get_error_message(err), options->handle_count); - exit(err); - } else { - fprintf(stdout,"\"ERROR: unable to unpack data section\""); - options->error=err; - /*return err; See ECC-723*/ + grib_dump_content(h, stdout, options->dump_mode, options->dump_flags, 0); + break; + case 'a': + err = grib_set_long(h, "unpack", 1); + if (err) { + if (options->fail) { + fprintf(stderr, "ERROR: unable to unpack data section: %s (message=%d)\n", + grib_get_error_message(err), options->handle_count); + exit(err); + } + else { + fprintf(stdout, "\"ERROR: unable to unpack data section\""); + options->error = err; + /*return err; See ECC-723*/ + } } - } - options->dump_flags=GRIB_DUMP_FLAG_ALL_ATTRIBUTES; - grib_dump_content(h,stdout,options->dump_mode,options->dump_flags,0); - break; - default : - printf("Unknown JSON option %s\n",json_option); - exit(1); + options->dump_flags = GRIB_DUMP_FLAG_ALL_ATTRIBUTES; + grib_dump_content(h, stdout, options->dump_mode, options->dump_flags, 0); + break; + default: + printf("Unknown JSON option %s\n", json_option); + exit(1); } - if (!strcmp(options->dump_mode,"default")) { + if (!strcmp(options->dump_mode, "default")) { printf("}\n"); } } - else if (grib_options_on("O")) - { + else if (grib_options_on("O")) { char tmp[1024]; - sprintf(tmp,"MESSAGE %d ( length=%ld )",options->handle_count,length); + sprintf(tmp, "MESSAGE %d ( length=%ld )", options->handle_count, length); if (!grib_options_on("C")) - fprintf(stdout,"#============== %-38s ==============\n",tmp); - err=grib_set_long(h,"unpack",1); + fprintf(stdout, "#============== %-38s ==============\n", tmp); + err = grib_set_long(h, "unpack", 1); if (err) { if (options->fail) { - fprintf(stderr, "ERROR: unable to unpack data section: %s\n",grib_get_error_message(err)); + fprintf(stderr, "ERROR: unable to unpack data section: %s\n", grib_get_error_message(err)); exit(err); - } else { - fprintf(stdout,"ERROR: unable to unpack data section\n"); - options->error=err; + } + else { + fprintf(stdout, "ERROR: unable to unpack data section\n"); + options->error = err; /*return err; See ECC-723*/ } } - grib_dump_content(h,stdout,options->dump_mode,options->dump_flags,0); + grib_dump_content(h, stdout, options->dump_mode, options->dump_flags, 0); } - else if (dump_descriptors) - { + else if (dump_descriptors) { /* Dump out the section 3 descriptors, their keys/units etc */ bufr_dump_descriptors(h); } - else - { + else { const char* dumper_name = get_dumper_name(options); - if (strcmp(dumper_name, "bufr_simple")==0) { + if (strcmp(dumper_name, "bufr_simple") == 0) { /* This speeds up the unpack by skipping attribute keys not used in the dump */ grib_set_long(h, "skipExtraKeyAttributes", 1); } - err=grib_set_long(h,"unpack",1); + err = grib_set_long(h, "unpack", 1); if (err) { if (options->fail) { - fprintf(stderr, "ERROR: unable to unpack data section: %s\n",grib_get_error_message(err)); + fprintf(stderr, "ERROR: unable to unpack data section: %s\n", grib_get_error_message(err)); exit(err); - } else { - fprintf(stdout,"\"ERROR: unable to unpack data section\""); - options->error=err; + } + else { + fprintf(stdout, "\"ERROR: unable to unpack data section\""); + options->error = err; /*return err; See ECC-723*/ } } print_header(options); - dumper=grib_dump_content_with_dumper(h,dumper,stdout,dumper_name,options->dump_flags,0); - if (!dumper) exit(1); + dumper = grib_dump_content_with_dumper(h, dumper, stdout, dumper_name, options->dump_flags, 0); + if (!dumper) + exit(1); if (grib_options_on("p")) { printf("\n"); /* One blank line to separate the messages */ } @@ -551,72 +560,72 @@ int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) return 0; } -void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h) +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) { - grib_print_key_values(options,h); + grib_print_key_values(options, h); } int grib_tool_finalise_action(grib_runtime_options* options) { - if (json) fprintf(stdout,"\n]}\n"); + if (json) + fprintf(stdout, "\n]}\n"); if (grib_options_on("E:")) { /* Code for ENCODING */ - if (!strcmp(options->dump_mode,"filter")) { - fprintf(stdout,"set pack=1;\nwrite;\n"); + if (!strcmp(options->dump_mode, "filter")) { + fprintf(stdout, "set pack=1;\nwrite;\n"); } - if (!strcmp(options->dump_mode,"fortran")) { - fprintf(stdout,"end program bufr_encode\n"); + if (!strcmp(options->dump_mode, "fortran")) { + fprintf(stdout, "end program bufr_encode\n"); } - if (!strcmp(options->dump_mode,"C")) { - fprintf(stdout," return 0;\n"); - fprintf(stdout,"}\n"); + if (!strcmp(options->dump_mode, "C")) { + fprintf(stdout, " return 0;\n"); + fprintf(stdout, "}\n"); } - if (!strcmp(options->dump_mode,"python")) { - fprintf(stdout,"\n\n"); - fprintf(stdout,"def main():\n"); - fprintf(stdout," try:\n"); - fprintf(stdout," bufr_encode()\n"); - fprintf(stdout," except CodesInternalError as err:\n"); - fprintf(stdout," traceback.print_exc(file=sys.stderr)\n"); - fprintf(stdout," return 1\n"); - fprintf(stdout,"\n\n"); - fprintf(stdout,"if __name__ == \"__main__\":\n"); - fprintf(stdout," sys.exit(main())\n"); + if (!strcmp(options->dump_mode, "python")) { + fprintf(stdout, "\n\n"); + fprintf(stdout, "def main():\n"); + fprintf(stdout, " try:\n"); + fprintf(stdout, " bufr_encode()\n"); + fprintf(stdout, " except CodesInternalError as err:\n"); + fprintf(stdout, " traceback.print_exc(file=sys.stderr)\n"); + fprintf(stdout, " return 1\n"); + fprintf(stdout, "\n\n"); + fprintf(stdout, "if __name__ == \"__main__\":\n"); + fprintf(stdout, " sys.exit(main())\n"); } } else if (grib_options_on("D:")) { /* Code for DECODING */ - if (!strcmp(options->dump_mode,"filter")) { - - } - if (!strcmp(options->dump_mode,"fortran")) { - fprintf(stdout,"\n call codes_close_file(ifile)\n"); - fprintf(stdout,"end program bufr_decode\n"); - } - if (!strcmp(options->dump_mode,"C")) { - fprintf(stdout," if (fclose(fin)!=0) {\n"); - fprintf(stdout," fprintf(stderr, \"Failed to close file handle.\\n\");\n"); - fprintf(stdout," return 1;\n"); - fprintf(stdout," }\n"); - fprintf(stdout," return 0;\n"); - fprintf(stdout,"}\n"); - } - if (!strcmp(options->dump_mode,"python")) { - fprintf(stdout,"\n\n"); - fprintf(stdout," f.close()\n\n"); - fprintf(stdout,"def main():\n"); - fprintf(stdout," if len(sys.argv) < 2:\n"); - fprintf(stdout," print('Usage: ', sys.argv[0], ' BUFR_file', file=sys.stderr)\n"); - fprintf(stdout," sys.exit(1)\n\n"); - fprintf(stdout," try:\n"); - fprintf(stdout," bufr_decode(sys.argv[1])\n"); - fprintf(stdout," except CodesInternalError as err:\n"); - fprintf(stdout," traceback.print_exc(file=sys.stderr)\n"); - fprintf(stdout," return 1\n"); - fprintf(stdout,"\n\n"); - fprintf(stdout,"if __name__ == \"__main__\":\n"); - fprintf(stdout," sys.exit(main())\n"); + if (!strcmp(options->dump_mode, "filter")) { + } + if (!strcmp(options->dump_mode, "fortran")) { + fprintf(stdout, "\n call codes_close_file(ifile)\n"); + fprintf(stdout, "end program bufr_decode\n"); + } + if (!strcmp(options->dump_mode, "C")) { + fprintf(stdout, " if (fclose(fin)!=0) {\n"); + fprintf(stdout, " fprintf(stderr, \"Failed to close file handle.\\n\");\n"); + fprintf(stdout, " return 1;\n"); + fprintf(stdout, " }\n"); + fprintf(stdout, " return 0;\n"); + fprintf(stdout, "}\n"); + } + if (!strcmp(options->dump_mode, "python")) { + fprintf(stdout, "\n\n"); + fprintf(stdout, " f.close()\n\n"); + fprintf(stdout, "def main():\n"); + fprintf(stdout, " if len(sys.argv) < 2:\n"); + fprintf(stdout, " print('Usage: ', sys.argv[0], ' BUFR_file', file=sys.stderr)\n"); + fprintf(stdout, " sys.exit(1)\n\n"); + fprintf(stdout, " try:\n"); + fprintf(stdout, " bufr_decode(sys.argv[1])\n"); + fprintf(stdout, " except CodesInternalError as err:\n"); + fprintf(stdout, " traceback.print_exc(file=sys.stderr)\n"); + fprintf(stdout, " return 1\n"); + fprintf(stdout, "\n\n"); + fprintf(stdout, "if __name__ == \"__main__\":\n"); + fprintf(stdout, " sys.exit(main())\n"); } } return 0; @@ -624,15 +633,16 @@ int grib_tool_finalise_action(grib_runtime_options* options) int grib_no_handle_action(grib_runtime_options* options, int err) { - if (json ){ + if (json) { if (first_handle) { - fprintf(dump_file,"{ \"messages\" : [ \n"); - first_handle=0; - } else { - fprintf(dump_file,",\n"); + fprintf(dump_file, "{ \"messages\" : [ \n"); + first_handle = 0; + } + else { + fprintf(dump_file, ",\n"); } } - fprintf(dump_file,"\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\"ERROR: unreadable message\"\n"); if (options->fail) { exit(1); } diff --git a/tools/bufr_filter.c b/tools/bufr_filter.c index d50930953..b659ee895 100644 --- a/tools/bufr_filter.c +++ b/tools/bufr_filter.c @@ -15,33 +15,35 @@ #include "grib_tools.h" -grib_option grib_options[]={ - /* {id, args, help}, on, command_line, value */ - {"f",0,0,0,1,0}, - {"f",0,0,1,0,0}, - {"F",0,0,1,0,0}, - {"o:",0,0,1,1,"filter.out"}, - {"q",0,0,1,0,0}, - {"I",0,0,1,0,0}, - {"V",0,0,0,1,0}, - {"g",0,0,0,1,0}, -/* {"G",0,0,0,1,0}, */ - {"T:",0,0,1,0,"B"}, - {"7",0,0,0,1,0}, - {"v",0,0,0,1,0} +grib_option grib_options[] = { + /* {id, args, help}, on, command_line, value */ + { "f", 0, 0, 0, 1, 0 }, + { "f", 0, 0, 1, 0, 0 }, + { "F", 0, 0, 1, 0, 0 }, + { "o:", 0, 0, 1, 1, "filter.out" }, + { "q", 0, 0, 1, 0, 0 }, + { "I", 0, 0, 1, 0, 0 }, + { "V", 0, 0, 0, 1, 0 }, + { "g", 0, 0, 0, 1, 0 }, + /* {"G",0,0,0,1,0}, */ + { "T:", 0, 0, 1, 0, "B" }, + { "7", 0, 0, 0, 1, 0 }, + { "v", 0, 0, 0, 1, 0 } }; -const char* grib_tool_description="Apply the rules defined in rules_file to each BUFR " - "message\n\tin the BUFR files provided as arguments.\n\t" - "If you specify '-' (a single dash) for the rules_file, the rules will be read from standard input."; -const char* grib_tool_name="bufr_filter"; -const char* grib_tool_usage="[options] rules_file " - "bufr_file bufr_file ..."; - -int grib_options_count=sizeof(grib_options)/sizeof(grib_option); - -int main(int argc, char *argv[]) +const char* grib_tool_description = + "Apply the rules defined in rules_file to each BUFR " + "message\n\tin the BUFR files provided as arguments.\n\t" + "If you specify '-' (a single dash) for the rules_file, the rules will be read from standard input."; +const char* grib_tool_name = "bufr_filter"; +const char* grib_tool_usage = + "[options] rules_file " + "bufr_file bufr_file ..."; + +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); + +int main(int argc, char* argv[]) { - return grib_tool(argc,argv); + return grib_tool(argc, argv); } int grib_tool_before_getopt(grib_runtime_options* options) @@ -53,12 +55,12 @@ int grib_tool_init(grib_runtime_options* options) { options->action = grib_action_from_filter(options->infile_extra->name); if (!options->action) { - fprintf(stderr,"%s: error unable to create action\n",options->infile_extra->name); + fprintf(stderr, "%s: error unable to create action\n", options->infile_extra->name); exit(1); } - if ( options->outfile && options->outfile->name ) - options->action->context->outfilename=options->outfile->name; + if (options->outfile && options->outfile->name) + options->action->context->outfilename = options->outfile->name; /* Turn off GRIB multi-field support mode. Not relevant for BUFR */ grib_multi_support_off(grib_context_get_default()); @@ -66,12 +68,12 @@ int grib_tool_init(grib_runtime_options* options) return 0; } -int grib_tool_new_filename_action(grib_runtime_options* options,const char* file) +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) { return 0; -} +} -int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file) +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { exit_if_input_is_directory(grib_tool_name, file->name); return 0; @@ -79,16 +81,16 @@ int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* fil int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) { - int err=0; + int err = 0; if (options->current_infile->name) { - size_t len=strlen(options->current_infile->name); - grib_set_string(h,"file",options->current_infile->name,&len); + size_t len = strlen(options->current_infile->name); + grib_set_string(h, "file", options->current_infile->name, &len); } - err=grib_handle_apply_action(h,options->action); + err = grib_handle_apply_action(h, options->action); if (err != GRIB_SUCCESS && options->fail) { - printf("ERROR: %s\n",grib_get_error_message(err)); + printf("ERROR: %s\n", grib_get_error_message(err)); exit(err); } return 0; @@ -100,14 +102,14 @@ int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) return 0; } -void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h) +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) { - grib_print_key_values(options,h); + grib_print_key_values(options, h); } int grib_tool_finalise_action(grib_runtime_options* options) { - int err=0; + int err = 0; grib_file_close_all(&err); if (err != GRIB_SUCCESS) { perror(grib_tool_name); @@ -120,6 +122,6 @@ int grib_tool_finalise_action(grib_runtime_options* options) int grib_no_handle_action(grib_runtime_options* options, int err) { - fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\t\t\"ERROR: unreadable message\"\n"); return 0; } diff --git a/tools/bufr_get.c b/tools/bufr_get.c index a2ff00a19..d393785bd 100644 --- a/tools/bufr_get.c +++ b/tools/bufr_get.c @@ -15,75 +15,77 @@ #include "grib_tools.h" -grib_option grib_options[]={ - /* {id, args, help}, on, command_line, value*/ - {"f",0,0,0,1,0}, - {"p:",0,0,0,1,0}, - {"F:",0,0,1,1,"%g"}, - {"P:",0,0,0,1,0}, - {"w:",0,0,0,1,0}, - {"n:",0,0,1,1,0}, - {"s:",0,0,0,1,0}, - {"V",0,0,0,1,0}, - {"W:",0,0,1,1,"8"}, - {"m",0,0,0,1,0}, - {"S",0,0,1,0,0}, - {"g",0,0,0,1,0}, -/* {"G",0,0,0,1,0}, */ - {"T:",0,0,1,0,"B"}, - {"7",0,0,0,1,0}, - {"v",0,0,1,0,0} +grib_option grib_options[] = { + /* {id, args, help}, on, command_line, value*/ + { "f", 0, 0, 0, 1, 0 }, + { "p:", 0, 0, 0, 1, 0 }, + { "F:", 0, 0, 1, 1, "%g" }, + { "P:", 0, 0, 0, 1, 0 }, + { "w:", 0, 0, 0, 1, 0 }, + { "n:", 0, 0, 1, 1, 0 }, + { "s:", 0, 0, 0, 1, 0 }, + { "V", 0, 0, 0, 1, 0 }, + { "W:", 0, 0, 1, 1, "8" }, + { "m", 0, 0, 0, 1, 0 }, + { "S", 0, 0, 1, 0, 0 }, + { "g", 0, 0, 0, 1, 0 }, + /* {"G",0,0,0,1,0}, */ + { "T:", 0, 0, 1, 0, "B" }, + { "7", 0, 0, 0, 1, 0 }, + { "v", 0, 0, 1, 0, 0 } }; -const char* grib_tool_description="Get values of some header keys from a BUFR file." - "\n\tIt is similar to bufr_ls, but fails returning an error code " - "\n\twhen an error occurs (e.g. key not found)."; -const char* grib_tool_name="bufr_get"; -const char* grib_tool_usage="[options] file file ..."; +const char* grib_tool_description = + "Get values of some header keys from a BUFR file." + "\n\tIt is similar to bufr_ls, but fails returning an error code " + "\n\twhen an error occurs (e.g. key not found)."; +const char* grib_tool_name = "bufr_get"; +const char* grib_tool_usage = "[options] file file ..."; -int grib_options_count=sizeof(grib_options)/sizeof(grib_option); +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - return grib_tool(argc,argv); + return grib_tool(argc, argv); } int grib_tool_before_getopt(grib_runtime_options* options) { - options->print_keys_count=-1; + options->print_keys_count = -1; return 0; } int grib_tool_init(grib_runtime_options* options) { - options->print_header=0; - options->print_statistics=0; - options->default_print_width=-1; + options->print_header = 0; + options->print_statistics = 0; + options->default_print_width = -1; return 0; } -int grib_tool_new_filename_action(grib_runtime_options* options,const char* file) +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) { return 0; } -int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file) +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { exit_if_input_is_directory(grib_tool_name, file->name); return 0; } -int grib_tool_new_handle_action(grib_runtime_options* options,grib_handle* h) +int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) { int err = 0; if (!options->skip) { if (options->set_values_count != 0) { - err=grib_set_values(h,options->set_values,options->set_values_count); + err = grib_set_values(h, options->set_values, options->set_values_count); } - if (err != GRIB_SUCCESS && options->fail) exit(err); + if (err != GRIB_SUCCESS && options->fail) + exit(err); } return 0; @@ -95,9 +97,9 @@ int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) return 0; } -void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h) +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) { - grib_print_key_values(options,h); + grib_print_key_values(options, h); } int grib_tool_finalise_action(grib_runtime_options* options) @@ -107,6 +109,6 @@ int grib_tool_finalise_action(grib_runtime_options* options) int grib_no_handle_action(grib_runtime_options* options, int err) { - fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\t\t\"ERROR: unreadable message\"\n"); return 0; } diff --git a/tools/bufr_index_build.c b/tools/bufr_index_build.c index de73d474a..835efaa32 100644 --- a/tools/bufr_index_build.c +++ b/tools/bufr_index_build.c @@ -15,37 +15,39 @@ #include "grib_tools.h" -const char* grib_tool_description="Build an index file for a set of input BUFR files.\n" - "\tWarning: THIS TOOL IS NOT YET IMPLEMENTED"; -const char* grib_tool_name="bufr_index_build"; -const char* grib_tool_usage="[options] file file ... "; -grib_index* idx=NULL; +const char* grib_tool_description = + "Build an index file for a set of input BUFR files.\n" + "\tWarning: THIS TOOL IS NOT YET IMPLEMENTED"; +const char* grib_tool_name = "bufr_index_build"; +const char* grib_tool_usage = "[options] file file ... "; +grib_index* idx = NULL; char* keys; char* default_keys = "mars"; -grib_option grib_options[]={ - /* {id, args, help}, on, command_line, value */ - {"f",0,0,0,1,0}, - {"o:","output_index_file", - "\n\t\tOutput is written to output_index_file." - "\n\t\tIf an output index file is required and -o is not used, the" - " output index is written to bufridx\n", - 1,1,"bufridx"}, - {"k:",0,0,0,1,0}, - {"V",0,0,0,1,0}, - {"T:",0,0,1,0,"B"}, - {"N",0,"Do not compress index." - "\n\t\tBy default the index is compressed to remove keys with only one value.\n",0,1,0} +grib_option grib_options[] = { + /* {id, args, help}, on, command_line, value */ + { "f", 0, 0, 0, 1, 0 }, + { "o:", "output_index_file", + "\n\t\tOutput is written to output_index_file." + "\n\t\tIf an output index file is required and -o is not used, the" + " output index is written to bufridx\n", + 1, 1, "bufridx" }, + { "k:", 0, 0, 0, 1, 0 }, + { "V", 0, 0, 0, 1, 0 }, + { "T:", 0, 0, 1, 0, "B" }, + { "N", 0, + "Do not compress index." + "\n\t\tBy default the index is compressed to remove keys with only one value.\n", + 0, 1, 0 } }; int compress_index; -int grib_options_count=sizeof(grib_options)/sizeof(grib_option); +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - int ret=grib_tool(argc,argv); - return ret; + return grib_tool(argc, argv); } int grib_tool_before_getopt(grib_runtime_options* options) @@ -55,38 +57,43 @@ int grib_tool_before_getopt(grib_runtime_options* options) int grib_tool_init(grib_runtime_options* options) { - int ret=0; - grib_context* c=grib_context_get_default(); + int ret = 0; + grib_context* c = grib_context_get_default(); - if (grib_options_on("N")) compress_index=0; - else compress_index=1; + if (grib_options_on("N")) + compress_index = 0; + else + compress_index = 1; if (grib_options_on("k:")) - keys=grib_options_get_option("k:"); + keys = grib_options_get_option("k:"); else - keys=default_keys; + keys = default_keys; - options->onlyfiles=1; + options->onlyfiles = 1; - idx=grib_index_new(c,keys,&ret); + idx = grib_index_new(c, keys, &ret); if (!idx || ret) - grib_context_log(c,GRIB_LOG_FATAL, - "Unable to create index %s",grib_get_error_message(ret)); + grib_context_log(c, GRIB_LOG_FATAL, + "Unable to create index %s", grib_get_error_message(ret)); return 0; } -int grib_tool_new_filename_action(grib_runtime_options* options,const char* file) +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) { - int ret=0; - printf("--- %s: processing %s\n",grib_tool_name,file); - ret=_codes_index_add_file(idx,file,CODES_BUFR); - if (ret) {printf("error: %s\n",grib_get_error_message(ret)); exit(ret);} + int ret = 0; + printf("--- %s: processing %s\n", grib_tool_name, file); + ret = _codes_index_add_file(idx, file, CODES_BUFR); + if (ret) { + printf("error: %s\n", grib_get_error_message(ret)); + exit(ret); + } return 0; } -int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file) +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { return 0; } @@ -101,7 +108,7 @@ int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) return 0; } -void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h) +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) { } @@ -115,41 +122,43 @@ int grib_tool_finalise_action(grib_runtime_options* options) grib_index_compress(idx); } printf("--- %s: keys included in the index file %s:\n", - grib_tool_name,options->outfile->name); + grib_tool_name, options->outfile->name); printf("--- "); - first=1; - the_keys=idx->keys; + first = 1; + the_keys = idx->keys; while (the_keys) { - if (!first) printf(", "); - printf("%s",the_keys->name); - the_keys=the_keys->next; - first=0; + if (!first) + printf(", "); + printf("%s", the_keys->name); + the_keys = the_keys->next; + first = 0; } printf("\n"); - the_keys=idx->keys; + the_keys = idx->keys; while (the_keys) { - printf("--- %s = { ",the_keys->name); - values=the_keys->values; - first=1; + printf("--- %s = { ", the_keys->name); + values = the_keys->values; + first = 1; while (values) { - if (!first) printf(", "); - printf("%s",values->value); - first=0; - values=values->next; + if (!first) + printf(", "); + printf("%s", values->value); + first = 0; + values = values->next; } printf(" }\n"); - the_keys=the_keys->next; + the_keys = the_keys->next; } - printf("--- %d messages indexed\n",idx->count); + printf("--- %d messages indexed\n", idx->count); if (idx->count) - grib_index_write(idx,options->outfile->name); + grib_index_write(idx, options->outfile->name); grib_index_delete(idx); return 0; } int grib_no_handle_action(grib_runtime_options* options, int err) { - fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\t\t\"ERROR: unreadable message\"\n"); return 0; } diff --git a/tools/bufr_ls.c b/tools/bufr_ls.c index 75a40c76e..8b685caf8 100644 --- a/tools/bufr_ls.c +++ b/tools/bufr_ls.c @@ -14,41 +14,42 @@ */ #include "grib_tools.h" -grib_option grib_options[]={ - /* {id, args, help}, on, command_line, value*/ - {"f",0,0,1,0,0}, - {"p:",0,0,0,1,0}, - {"F:",0,0,1,1,"%g"}, - {"P:",0,0,0,1,0}, - {"w:",0,0,0,1,0}, - {"j",0,"JSON output\n",0,1,0}, -/* {"B:",0,0,0,1,0}, */ - {"s:",0,0,0,1,0}, - {"n:",0,0,1,1,"ls"}, - {"m",0,0,0,1,0}, - {"V",0,0,0,1,0}, - {"W:",0,0,1,1,"10"}, - {"S",0,0,1,0,0}, - {"H",0,0,1,0,0}, - {"g",0,0,0,1,0}, - {"P",0,0,1,0,0}, - {"T:",0,0,1,0,"B"}, - {"7",0,0,0,1,0}, - {"v",0,0,1,0,0} +grib_option grib_options[] = { + /* {id, args, help}, on, command_line, value*/ + { "f", 0, 0, 1, 0, 0 }, + { "p:", 0, 0, 0, 1, 0 }, + { "F:", 0, 0, 1, 1, "%g" }, + { "P:", 0, 0, 0, 1, 0 }, + { "w:", 0, 0, 0, 1, 0 }, + { "j", 0, "JSON output\n", 0, 1, 0 }, + /* {"B:",0,0,0,1,0}, */ + { "s:", 0, 0, 0, 1, 0 }, + { "n:", 0, 0, 1, 1, "ls" }, + { "m", 0, 0, 0, 1, 0 }, + { "V", 0, 0, 0, 1, 0 }, + { "W:", 0, 0, 1, 1, "10" }, + { "S", 0, 0, 1, 0, 0 }, + { "H", 0, 0, 1, 0, 0 }, + { "g", 0, 0, 0, 1, 0 }, + { "P", 0, 0, 1, 0, 0 }, + { "T:", 0, 0, 1, 0, "B" }, + { "7", 0, 0, 0, 1, 0 }, + { "v", 0, 0, 1, 0, 0 } }; -const char* grib_tool_description="List content of BUFR files printing values of " - "some header keys.\n\tOnly scalar keys can be printed." - "\n\tIt does not fail when a key is not found."; -const char* grib_tool_name="bufr_ls"; -const char* grib_tool_usage="[options] bufr_file bufr_file ..."; -static int first_handle=1; +const char* grib_tool_description = + "List content of BUFR files printing values of " + "some header keys.\n\tOnly scalar keys can be printed." + "\n\tIt does not fail when a key is not found."; +const char* grib_tool_name = "bufr_ls"; +const char* grib_tool_usage = "[options] bufr_file bufr_file ..."; +static int first_handle = 1; -int grib_options_count=sizeof(grib_options)/sizeof(grib_option); +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - return grib_tool(argc,argv); + return grib_tool(argc, argv); } /* @@ -76,12 +77,12 @@ int grib_tool_init(grib_runtime_options* options) A new file is being parsed. The file name is file. This function is called every time a new input file name is processed, before opening the file. */ -int grib_tool_new_filename_action(grib_runtime_options* options,const char* file) +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) { return 0; } -int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file) +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { exit_if_input_is_directory(grib_tool_name, file->name); return 0; @@ -94,21 +95,22 @@ int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* fil */ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) { - int err=0; + int err = 0; if (!options->skip) { if (options->set_values_count != 0) - err=grib_set_values(h,options->set_values,options->set_values_count); + err = grib_set_values(h, options->set_values, options->set_values_count); - if( err != GRIB_SUCCESS && options->fail) exit(err); + if (err != GRIB_SUCCESS && options->fail) + exit(err); } if (options->json_output) { - if (!first_handle && options->handle_count>1) { - fprintf(stdout,",\n"); + if (!first_handle && options->handle_count > 1) { + fprintf(stdout, ",\n"); } if (options->json_output && first_handle) { - fprintf(stdout,"{ \"messages\" : [ \n"); - first_handle=0; + fprintf(stdout, "{ \"messages\" : [ \n"); + first_handle = 0; } } @@ -126,28 +128,30 @@ int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) } /* key values can be printed here. Headers are already printed if requested */ -void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h) +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) { - grib_print_key_values(options,h); + grib_print_key_values(options, h); } /* This is executed after the last message in the last file is processed */ int grib_tool_finalise_action(grib_runtime_options* options) { - if (options->json_output) fprintf(stdout,"\n]}\n"); + if (options->json_output) + fprintf(stdout, "\n]}\n"); return 0; } int grib_no_handle_action(grib_runtime_options* options, int err) { - if (options->json_output){ + if (options->json_output) { if (first_handle) { - fprintf(dump_file,"{ \"messages\" : [ \n"); - first_handle=0; - } else { - fprintf(dump_file,",\n"); + fprintf(dump_file, "{ \"messages\" : [ \n"); + first_handle = 0; + } + else { + fprintf(dump_file, ",\n"); } } - fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\t\t\"ERROR: unreadable message\"\n"); return 0; } diff --git a/tools/bufr_set.c b/tools/bufr_set.c index dc83e36d7..04d57f596 100644 --- a/tools/bufr_set.c +++ b/tools/bufr_set.c @@ -14,44 +14,46 @@ */ #include "grib_tools.h" -grib_option grib_options[]={ - /* {id, args, help}, on, command_line, value*/ - {"s:",0,0,1,1,0}, -/* {"r",0,0,0,1,0}, */ -/* {"d:",0,0,0,1,0},*/ -/* {"n:","noise percentage","\n\t\tAdd noise to the data values. The noise added is the given percentage of the data value.\n",0,1,0},*/ - {"p:",0,0,1,1,0}, - {"P:",0,0,0,1,0}, - {"w:","key[:{s|d|i}]=value,key[:{s|d|i}]=value,...", - "\n\t\tWhere clause.\n\t\tSet is only executed for BUFR messages matching all the " - "key/value constraints.\n\t\tIf a BUFR message does not match the constraints it is" - " copied unchanged\n\t\tto the output_bufr_file. This behaviour can be changed " - "setting the option -S.\n\t\tFor each key a string (key:s), a double (key:d) or" - " an integer (key:i)\n\t\ttype can be defined. Default type is string." - "\n\t\tNote: only one -w clause is allowed.\n", 0,1,0}, - {"q",0,0,1,0,0}, - {"7",0,0,0,1,0}, - {"S",0,0,0,1,0}, - {"U",0,0,1,0,0}, - {"V",0,0,0,1,0}, - {"g",0,0,0,1,0}, -/* {"G",0,0,0,1,0}, */ - {"T:",0,0,1,0,"B"}, - {"f",0,0,0,1,0}, - {"v",0,0,0,1,0} +grib_option grib_options[] = { + /* {id, args, help}, on, command_line, value*/ + { "s:", 0, 0, 1, 1, 0 }, + /* {"r",0,0,0,1,0}, */ + /* {"d:",0,0,0,1,0},*/ + /* {"n:","noise percentage","\n\t\tAdd noise to the data values. The noise added is the given percentage of the data value.\n",0,1,0},*/ + { "p:", 0, 0, 1, 1, 0 }, + { "P:", 0, 0, 0, 1, 0 }, + { "w:", "key[:{s|d|i}]=value,key[:{s|d|i}]=value,...", + "\n\t\tWhere clause.\n\t\tSet is only executed for BUFR messages matching all the " + "key/value constraints.\n\t\tIf a BUFR message does not match the constraints it is" + " copied unchanged\n\t\tto the output_bufr_file. This behaviour can be changed " + "setting the option -S.\n\t\tFor each key a string (key:s), a double (key:d) or" + " an integer (key:i)\n\t\ttype can be defined. Default type is string." + "\n\t\tNote: only one -w clause is allowed.\n", + 0, 1, 0 }, + { "q", 0, 0, 1, 0, 0 }, + { "7", 0, 0, 0, 1, 0 }, + { "S", 0, 0, 0, 1, 0 }, + { "U", 0, 0, 1, 0, 0 }, + { "V", 0, 0, 0, 1, 0 }, + { "g", 0, 0, 0, 1, 0 }, + /* {"G",0,0,0,1,0}, */ + { "T:", 0, 0, 1, 0, "B" }, + { "f", 0, 0, 0, 1, 0 }, + { "v", 0, 0, 0, 1, 0 } }; -const char* grib_tool_description="Sets key/value pairs in the input BUFR file and writes" - "\n\teach message to the output_bufr_file." - "\n\tIt fails when an error occurs (e.g. key not found)."; -const char* grib_tool_name="bufr_set"; -const char* grib_tool_usage="[options] file file ... output_file"; +const char* grib_tool_description = + "Sets key/value pairs in the input BUFR file and writes" + "\n\teach message to the output_bufr_file." + "\n\tIt fails when an error occurs (e.g. key not found)."; +const char* grib_tool_name = "bufr_set"; +const char* grib_tool_usage = "[options] file file ... output_file"; -int grib_options_count=sizeof(grib_options)/sizeof(grib_option); +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - return grib_tool(argc,argv); + return grib_tool(argc, argv); } int grib_tool_before_getopt(grib_runtime_options* options) @@ -65,7 +67,8 @@ int grib_tool_init(grib_runtime_options* options) printf("ERROR: please provide some keys to set through the -s option or use the -r/-d options\n"); exit(1); } - if (options->verbose) options->print_header=1; + if (options->verbose) + options->print_header = 1; /*if (grib_options_on("n:")) { noise=atof(grib_options_get_option("n:")); options->repack=1; @@ -88,44 +91,43 @@ int grib_tool_init(grib_runtime_options* options) return 0; } -int grib_tool_new_filename_action(grib_runtime_options* options,const char* file) +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) { return 0; } -int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file) +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { return 0; } int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) { - int i=0; - int err=0; + int i = 0; + int err = 0; if (!options->skip) { - double* v=NULL; - size_t size=0; - if ( options->repack ) { - GRIB_CHECK_NOLINE(grib_get_size(h,"values",&size),0); - - v = (double*)calloc(size,sizeof(double)); - if(!v) { - fprintf(stderr,"failed to allocate %d bytes\n",(int)(size*sizeof(double))); + double* v = NULL; + size_t size = 0; + if (options->repack) { + GRIB_CHECK_NOLINE(grib_get_size(h, "values", &size), 0); + + v = (double*)calloc(size, sizeof(double)); + if (!v) { + fprintf(stderr, "failed to allocate %d bytes\n", (int)(size * sizeof(double))); exit(1); } - GRIB_CHECK_NOLINE(grib_get_double_array(h,"values",v,&size),0); + GRIB_CHECK_NOLINE(grib_get_double_array(h, "values", v, &size), 0); } if (options->set_values_count != 0) - err=grib_set_values(h,options->set_values,options->set_values_count); - - if ( options->repack ) { + err = grib_set_values(h, options->set_values, options->set_values_count); + if (options->repack) { if (grib_options_on("d:")) { - for(i = 0; i< size; i++) - v[i] = options->constant; + for (i = 0; i < size; i++) + v[i] = options->constant; } #if 0 if (grib_options_on("n:")) { @@ -134,14 +136,16 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) } #endif - GRIB_CHECK_NOLINE(grib_set_double_array(h,"values",v,size),0); + GRIB_CHECK_NOLINE(grib_set_double_array(h, "values", v, size), 0); free(v); } - if( err != GRIB_SUCCESS && options->fail) exit(err); + if (err != GRIB_SUCCESS && options->fail) + exit(err); } - if (!options->skip || !options->strict) grib_tools_write_message(options,h); + if (!options->skip || !options->strict) + grib_tools_write_message(options, h); return 0; } @@ -152,14 +156,14 @@ int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) return 0; } -void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h) +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) { - grib_print_key_values(options,h); + grib_print_key_values(options, h); } int grib_tool_finalise_action(grib_runtime_options* options) { - int err=0; + int err = 0; grib_file_close_all(&err); if (err != GRIB_SUCCESS) { perror(grib_tool_name); @@ -171,6 +175,6 @@ int grib_tool_finalise_action(grib_runtime_options* options) int grib_no_handle_action(grib_runtime_options* options, int err) { - fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\t\t\"ERROR: unreadable message\"\n"); return 0; } diff --git a/tools/bufr_split_by_rdbSubtype.c b/tools/bufr_split_by_rdbSubtype.c index 0f49f15c0..ffcb4c79c 100644 --- a/tools/bufr_split_by_rdbSubtype.c +++ b/tools/bufr_split_by_rdbSubtype.c @@ -18,181 +18,192 @@ #include "grib_api_internal.h" -static int verbose = 0; +static int verbose = 0; static const char* OUTPUT_FILENAME_DEFAULT = "split_rdbSubtype.undef.bufr"; static const char* OUTPUT_FILENAME_SUBTYPE = "split_rdbSubtype.%ld.bufr"; static void usage(const char* prog) { - printf("Usage: %s [-v] infile\n",prog); + printf("Usage: %s [-v] infile\n", prog); exit(1); } static int file_exists(const char* path) { struct stat s; - int stat_val = stat(path,&s); - if (stat_val != 0) return 0; /*error doing stat*/ - return S_ISREG( s.st_mode ); + int stat_val = stat(path, &s); + if (stat_val != 0) + return 0; /*error doing stat*/ + return S_ISREG(s.st_mode); } /* If rdbSubtype can be extracted, return GRIB_SUCCESS otherwise error code. */ /* If BUFR message does not have an ECMWF local section, set rdbSubtype to -1 */ static int decode_rdbSubtype(const void* message, long* rdbSubtype) { - int err = GRIB_SUCCESS; - long edition = 0; - long pos_edition = 7*8; - const long nbits_edition = 8; - long section1Flags=0; - long nbits_section1Flags=1*8; - long pos_section1Flags=17*8; - long section1Length = 0; + int err = GRIB_SUCCESS; + long edition = 0; + long pos_edition = 7 * 8; + const long nbits_edition = 8; + long section1Flags = 0; + long nbits_section1Flags = 1 * 8; + long pos_section1Flags = 17 * 8; + long section1Length = 0; const long nbits_section1Length = 24; - long bufrHeaderCentre = 0; - long nbits_bufrHeaderCentre=2*8; - long pos_bufrHeaderCentre=12*8; + long bufrHeaderCentre = 0; + long nbits_bufrHeaderCentre = 2 * 8; + long pos_bufrHeaderCentre = 12 * 8; - long pos_section1Length = 8*8; + long pos_section1Length = 8 * 8; int ecmwfLocalSectionPresent = 0; Assert(message); *rdbSubtype = -1; /* default */ edition = (long)grib_decode_unsigned_long(message, &pos_edition, nbits_edition); - if (edition!=2 && edition!=3 && edition!=4) { + if (edition != 2 && edition != 3 && edition != 4) { fprintf(stderr, "ERROR: Unsupported BUFR edition: %ld", edition); return GRIB_DECODING_ERROR; } - section1Length=(long)grib_decode_unsigned_long(message, &pos_section1Length, nbits_section1Length); - if (edition==3) { - pos_section1Flags=15*8; - nbits_bufrHeaderCentre=1*8; - pos_bufrHeaderCentre=13*8; + section1Length = (long)grib_decode_unsigned_long(message, &pos_section1Length, nbits_section1Length); + if (edition == 3) { + pos_section1Flags = 15 * 8; + nbits_bufrHeaderCentre = 1 * 8; + pos_bufrHeaderCentre = 13 * 8; } - if (edition==2) { - pos_section1Flags=15*8; + if (edition == 2) { + pos_section1Flags = 15 * 8; } bufrHeaderCentre = (long)grib_decode_unsigned_long(message, &pos_bufrHeaderCentre, nbits_bufrHeaderCentre); - section1Flags=(long)grib_decode_unsigned_long(message, &pos_section1Flags, nbits_section1Flags); + section1Flags = (long)grib_decode_unsigned_long(message, &pos_section1Flags, nbits_section1Flags); if (section1Flags != 0 && section1Flags != 128) { fprintf(stderr, "ERROR: Invalid BUFR section1 flags: %ld", section1Flags); return GRIB_DECODING_ERROR; } - ecmwfLocalSectionPresent = (bufrHeaderCentre==98 && section1Flags!=0); + ecmwfLocalSectionPresent = (bufrHeaderCentre == 98 && section1Flags != 0); /*printf("SPLT: edition=%ld section1Length=%ld bufrHeaderCentre=%ld section1Flags=%ld", edition,section1Length,bufrHeaderCentre,section1Flags);*/ - if ( ecmwfLocalSectionPresent ) { - long oldSubtype=0; - long newSubtype=0; - long nbits_oldSubtype = 1*8; - long nbits_newSubtype = 2*8; + if (ecmwfLocalSectionPresent) { + long oldSubtype = 0; + long newSubtype = 0; + long nbits_oldSubtype = 1 * 8; + long nbits_newSubtype = 2 * 8; const long section0Length = 8; - long pos_oldSubtype = (section0Length + section1Length + 5)*8; - long pos_newSubtype = (section0Length + section1Length + 49)*8; + long pos_oldSubtype = (section0Length + section1Length + 5) * 8; + long pos_newSubtype = (section0Length + section1Length + 49) * 8; - oldSubtype=(long)grib_decode_unsigned_long(message, &pos_oldSubtype, nbits_oldSubtype); - newSubtype=(long)grib_decode_unsigned_long(message, &pos_newSubtype, nbits_newSubtype); + oldSubtype = (long)grib_decode_unsigned_long(message, &pos_oldSubtype, nbits_oldSubtype); + newSubtype = (long)grib_decode_unsigned_long(message, &pos_newSubtype, nbits_newSubtype); /*printf(" oldSubtype=%ld newSubtype=%ld\n", oldSubtype, newSubtype);*/ - if (oldSubtype<255) *rdbSubtype=oldSubtype; - else *rdbSubtype=newSubtype; + if (oldSubtype < 255) + *rdbSubtype = oldSubtype; + else + *rdbSubtype = newSubtype; } /*else printf(" oldSubtype=undef newSubtype=undef\n");*/ return err; } -static int split_file_by_subtype(FILE* in, const char* filename, unsigned long *count) +static int split_file_by_subtype(FILE* in, const char* filename, unsigned long* count) { - void* mesg=NULL; + void* mesg = NULL; FILE* out; - size_t size=0; - off_t offset=0; - int err=GRIB_SUCCESS; - char ofilename[2048]={0,}; - grib_context* c=grib_context_get_default(); + size_t size = 0; + off_t offset = 0; + int err = GRIB_SUCCESS; + char ofilename[2048] = {0,}; + grib_context* c = grib_context_get_default(); - if (!in) return 1; + if (!in) + return 1; sprintf(ofilename, "%s", OUTPUT_FILENAME_DEFAULT); /*default name*/ - while ( err!=GRIB_END_OF_FILE ) { - mesg=wmo_read_bufr_from_file_malloc(in, 0, &size, &offset, &err); - if (mesg!=NULL && err==0) { + while (err != GRIB_END_OF_FILE) { + mesg = wmo_read_bufr_from_file_malloc(in, 0, &size, &offset, &err); + if (mesg != NULL && err == 0) { /* Decode subtype from mesg */ - long rdbSubtype=0; - int status = decode_rdbSubtype(mesg, &rdbSubtype); + long rdbSubtype = 0; + int status = decode_rdbSubtype(mesg, &rdbSubtype); if (status != GRIB_SUCCESS) { - fprintf(stderr,"ERROR: Failed to decode rdbSubtype from message %lu\n", *count); + fprintf(stderr, "ERROR: Failed to decode rdbSubtype from message %lu\n", *count); return status; } sprintf(ofilename, "%s", OUTPUT_FILENAME_DEFAULT); - if (rdbSubtype != -1) sprintf(ofilename, OUTPUT_FILENAME_SUBTYPE, rdbSubtype); + if (rdbSubtype != -1) + sprintf(ofilename, OUTPUT_FILENAME_SUBTYPE, rdbSubtype); if (verbose) { - if (!file_exists(ofilename)) printf("Writing output to %s\n", ofilename); + if (!file_exists(ofilename)) + printf("Writing output to %s\n", ofilename); } - out=fopen(ofilename,"ab"); + out = fopen(ofilename, "ab"); if (!out) { - fprintf(stderr,"ERROR: Failed to open output file '%s'\n", ofilename); + fprintf(stderr, "ERROR: Failed to open output file '%s'\n", ofilename); perror(ofilename); return GRIB_IO_PROBLEM; } - if (fwrite(mesg,1,size,out)!=size) { - fprintf(stderr,"ERROR: Failed to append to file '%s'\n", ofilename); + if (fwrite(mesg, 1, size, out) != size) { + fprintf(stderr, "ERROR: Failed to append to file '%s'\n", ofilename); perror(ofilename); fclose(out); return GRIB_IO_PROBLEM; } - grib_context_free(c,mesg); + grib_context_free(c, mesg); fclose(out); (*count)++; } } - if (err==GRIB_END_OF_FILE) err=GRIB_SUCCESS; + if (err == GRIB_END_OF_FILE) + err = GRIB_SUCCESS; return err; } -int main(int argc,char* argv[]) +int main(int argc, char* argv[]) { FILE* infh = NULL; char* filename; - int i, status=0; - int err=0; - unsigned long count=0; + int i, status = 0; + int err = 0; + unsigned long count = 0; - if (argc!=2 && argc!=3) usage(argv[0]); + if (argc != 2 && argc != 3) + usage(argv[0]); - i=1; - if (strcmp(argv[i], "-v")==0) { + i = 1; + if (strcmp(argv[i], "-v") == 0) { i++; verbose = 1; - if (argc !=3) usage(argv[0]); + if (argc != 3) + usage(argv[0]); } - filename=argv[i]; + filename = argv[i]; if (path_is_directory(filename)) { fprintf(stderr, "ERROR: %s: Is a directory\n", filename); return 1; } - infh=fopen(filename,"rb"); + infh = fopen(filename, "rb"); if (!infh) { perror(filename); return 1; } - count=0; - err=split_file_by_subtype(infh, filename, &count); + count = 0; + err = split_file_by_subtype(infh, filename, &count); if (err) { - fprintf(stderr,"ERROR: Failed to split BUFR file %s", filename); - fprintf(stderr,"\n"); + fprintf(stderr, "ERROR: Failed to split BUFR file %s", filename); + fprintf(stderr, "\n"); status = 1; - } else { - if (verbose) printf ("%7lu %s\n", count, filename); + } + else { + if (verbose) + printf("%7lu %s\n", count, filename); } fclose(infh); diff --git a/tools/codes_count.c b/tools/codes_count.c index bde85af3c..24a423030 100644 --- a/tools/codes_count.c +++ b/tools/codes_count.c @@ -10,43 +10,46 @@ #include "grib_api_internal.h" -static int fail_on_error = 1; +static int fail_on_error = 1; static const char* tool_name = NULL; static void usage(const char* prog) { - printf("Usage: %s [-v] [-f] infile1 infile2 ... \n",prog); + printf("Usage: %s [-v] [-f] infile1 infile2 ... \n", prog); exit(1); } -static int count_messages(FILE* in, int message_type, unsigned long *count) +static int count_messages(FILE* in, int message_type, unsigned long* count) { - void* mesg=NULL; - size_t size=0; - off_t offset=0; - int err=GRIB_SUCCESS; - typedef void* (*wmo_read_proc)(FILE *, int, size_t *, off_t *, int *); + void* mesg = NULL; + size_t size = 0; + off_t offset = 0; + int err = GRIB_SUCCESS; + typedef void* (*wmo_read_proc)(FILE*, int, size_t*, off_t*, int*); wmo_read_proc wmo_read = NULL; - grib_context* c=grib_context_get_default(); + grib_context* c = grib_context_get_default(); - if (!in) return 1; + if (!in) + return 1; /* printf("message_type=%d\n", message_type); */ - if (message_type == CODES_GRIB) wmo_read=wmo_read_grib_from_file_malloc; - else if (message_type == CODES_BUFR) wmo_read=wmo_read_bufr_from_file_malloc; - else if (message_type == CODES_GTS) wmo_read=wmo_read_gts_from_file_malloc; - else wmo_read=wmo_read_any_from_file_malloc; - - if (fail_on_error) - { - while ( (mesg=wmo_read(in,0, &size,&offset,&err))!=NULL && err==GRIB_SUCCESS) { - grib_context_free(c,mesg); + if (message_type == CODES_GRIB) + wmo_read = wmo_read_grib_from_file_malloc; + else if (message_type == CODES_BUFR) + wmo_read = wmo_read_bufr_from_file_malloc; + else if (message_type == CODES_GTS) + wmo_read = wmo_read_gts_from_file_malloc; + else + wmo_read = wmo_read_any_from_file_malloc; + + if (fail_on_error) { + while ((mesg = wmo_read(in, 0, &size, &offset, &err)) != NULL && err == GRIB_SUCCESS) { + grib_context_free(c, mesg); (*count)++; } } - else - { + else { int done = 0; - while(!done) { + while (!done) { mesg = wmo_read(in, 0, &size, &offset, &err); /*printf("Count so far=%ld, mesg=%x, err=%d (%s)\n", *count, mesg, err, grib_get_error_message(err));*/ if (!mesg) { @@ -55,64 +58,70 @@ static int count_messages(FILE* in, int message_type, unsigned long *count) } } if (mesg && !err) { - grib_context_free(c,mesg); + grib_context_free(c, mesg); (*count)++; } } } - if (err==GRIB_END_OF_FILE) err=GRIB_SUCCESS; + if (err == GRIB_END_OF_FILE) + err = GRIB_SUCCESS; return err; } -int main(int argc,char* argv[]) +int main(int argc, char* argv[]) { FILE* infh = NULL; char* filename; - int i, verbose=0; - int err=0, files_processed=0; - unsigned long count_total=0, count_curr=0; + int i, verbose = 0; + int err = 0, files_processed = 0; + unsigned long count_total = 0, count_curr = 0; int message_type = 0; /* GRIB, BUFR etc */ tool_name = argv[0]; - if (argc <2) usage(tool_name); + if (argc < 2) + usage(tool_name); - if (strstr(tool_name, "grib_count")) message_type = CODES_GRIB; - if (strstr(tool_name, "bufr_count")) message_type = CODES_BUFR; - if (strstr(tool_name, "gts_count")) message_type = CODES_GTS; + if (strstr(tool_name, "grib_count")) + message_type = CODES_GRIB; + if (strstr(tool_name, "bufr_count")) + message_type = CODES_BUFR; + if (strstr(tool_name, "gts_count")) + message_type = CODES_GTS; - count_total=0; - for (i=1;i0) fprintf(stderr," (got as far as %lu)", count_curr); - fprintf(stderr,"\n"); + fprintf(stderr, "Invalid message(s) found in %s", filename); + if (count_curr > 0) + fprintf(stderr, " (got as far as %lu)", count_curr); + fprintf(stderr, "\n"); exit(err); #ifdef DONT_EXIT_ON_BAD_APPLE /* If we did not want to fail but warn and continue */ @@ -120,16 +129,19 @@ int main(int argc,char* argv[]) continue; #endif } - if (verbose) printf ("%7lu %s\n", count_curr, filename); + if (verbose) + printf("%7lu %s\n", count_curr, filename); count_total += count_curr; fclose(infh); } - if (!files_processed) usage(argv[0]); + if (!files_processed) + usage(argv[0]); if (verbose) { printf("%7lu %s\n", count_total, "total"); - } else { + } + else { printf("%lu\n", count_total); } diff --git a/tools/codes_info.c b/tools/codes_info.c index 9e916fdc3..d6933bbb8 100644 --- a/tools/codes_info.c +++ b/tools/codes_info.c @@ -10,67 +10,70 @@ #include "grib_tools.h" -extern char *optarg; +extern char* optarg; extern int optind; #ifdef ECCODES_ON_WINDOWS #include "wingetopt.h" #endif -static void usage_and_exit(const char* progname) { - printf("\nUsage: %s [-v] [-d] [-s]\n",progname); +static void usage_and_exit(const char* progname) +{ + printf("\nUsage: %s [-v] [-d] [-s]\n", progname); exit(1); } -#define INFO_PRINT_ALL 0 -#define INFO_PRINT_VERSION (1<<0) -#define INFO_PRINT_DEFINITION_PATH (1<<1) -#define INFO_PRINT_SAMPLES_PATH (1<<2) +#define INFO_PRINT_ALL 0 +#define INFO_PRINT_VERSION (1 << 0) +#define INFO_PRINT_DEFINITION_PATH (1 << 1) +#define INFO_PRINT_SAMPLES_PATH (1 << 2) -int main( int argc,char* argv[]) +int main(int argc, char* argv[]) { - char* path=NULL; - int nfiles=0; - unsigned long print_flags=0; - int major=ECCODES_MAJOR_VERSION; - int minor=ECCODES_MINOR_VERSION; - int revision=ECCODES_REVISION_VERSION; - grib_context* context = grib_context_get_default(); + char* path = NULL; + int nfiles = 0; + unsigned long print_flags = 0; + int major = ECCODES_MAJOR_VERSION; + int minor = ECCODES_MINOR_VERSION; + int revision = ECCODES_REVISION_VERSION; + grib_context* context = grib_context_get_default(); while (1) { - int c = getopt (argc, argv, "vds"); + int c = getopt(argc, argv, "vds"); if (c == -1) break; switch (c) { - case 'v': - print_flags|=INFO_PRINT_VERSION; - break; - case 'd': - print_flags|=INFO_PRINT_DEFINITION_PATH; - break; - case 's': - print_flags|=INFO_PRINT_SAMPLES_PATH; - break; - default: - usage_and_exit(argv[0]); + case 'v': + print_flags |= INFO_PRINT_VERSION; + break; + case 'd': + print_flags |= INFO_PRINT_DEFINITION_PATH; + break; + case 's': + print_flags |= INFO_PRINT_SAMPLES_PATH; + break; + default: + usage_and_exit(argv[0]); } } - nfiles=argc-optind; - if (nfiles != 0) usage_and_exit(argv[0]); + nfiles = argc - optind; + if (nfiles != 0) + usage_and_exit(argv[0]); - if (print_flags == INFO_PRINT_ALL) { + if (print_flags == INFO_PRINT_ALL) { printf("\n"); printf("%s Version %d.%d.%d", - grib_get_package_name(), major,minor,revision); + grib_get_package_name(), major, minor, revision); - if (ECCODES_MAJOR_VERSION < 1) printf(" PRE-RELEASE"); + if (ECCODES_MAJOR_VERSION < 1) + printf(" PRE-RELEASE"); printf("\n"); printf("\n"); - if(context->debug) { + if (context->debug) { grib_context_log(context, GRIB_LOG_DEBUG, "Git SHA1=%s", grib_get_git_sha1()); } #if GRIB_PTHREADS @@ -81,30 +84,36 @@ int main( int argc,char* argv[]) #ifdef HAVE_MEMFS grib_context_log(context, GRIB_LOG_DEBUG, "MEMFS enabled"); #endif - if ((path=getenv("ECCODES_DEFINITION_PATH")) != NULL) { + if ((path = getenv("ECCODES_DEFINITION_PATH")) != NULL) { printf("Definition files path from environment variable"); - printf(" ECCODES_DEFINITION_PATH=%s\n",path); - } else if ((path=getenv("GRIB_DEFINITION_PATH")) != NULL) { + printf(" ECCODES_DEFINITION_PATH=%s\n", path); + } + else if ((path = getenv("GRIB_DEFINITION_PATH")) != NULL) { printf("Definition files path from environment variable"); - printf(" GRIB_DEFINITION_PATH=%s\n",path); - printf("(This is for backward compatibility. " - "It is recommended you use ECCODES_DEFINITION_PATH instead!)\n"); - } else { - printf("Default definition files path is used: %s\n",context->grib_definition_files_path); + printf(" GRIB_DEFINITION_PATH=%s\n", path); + printf( + "(This is for backward compatibility. " + "It is recommended you use ECCODES_DEFINITION_PATH instead!)\n"); + } + else { + printf("Default definition files path is used: %s\n", context->grib_definition_files_path); printf("Definition files path can be changed by setting ECCODES_DEFINITION_PATH environment variable\n"); } printf("\n"); - if ((path=getenv("ECCODES_SAMPLES_PATH")) != NULL) { + if ((path = getenv("ECCODES_SAMPLES_PATH")) != NULL) { printf("SAMPLES path from environment variable"); - printf(" ECCODES_SAMPLES_PATH=%s\n",path); - } else if ((path=getenv("GRIB_SAMPLES_PATH")) != NULL) { + printf(" ECCODES_SAMPLES_PATH=%s\n", path); + } + else if ((path = getenv("GRIB_SAMPLES_PATH")) != NULL) { printf("SAMPLES path from environment variable"); - printf(" GRIB_SAMPLES_PATH=%s\n",path); - printf("(This is for backward compatibility. " - "It is recommended you use ECCODES_SAMPLES_PATH instead!)\n"); - } else { - printf("Default SAMPLES path is used: %s\n",ECCODES_SAMPLES_PATH); + printf(" GRIB_SAMPLES_PATH=%s\n", path); + printf( + "(This is for backward compatibility. " + "It is recommended you use ECCODES_SAMPLES_PATH instead!)\n"); + } + else { + printf("Default SAMPLES path is used: %s\n", ECCODES_SAMPLES_PATH); printf("SAMPLES path can be changed by setting ECCODES_SAMPLES_PATH environment variable\n"); } printf("\n"); @@ -112,21 +121,23 @@ int main( int argc,char* argv[]) } if (print_flags & INFO_PRINT_VERSION) - printf("%d.%d.%d ",major,minor,revision); + printf("%d.%d.%d ", major, minor, revision); if (print_flags & INFO_PRINT_DEFINITION_PATH) { - if ((path=codes_getenv("ECCODES_DEFINITION_PATH")) != NULL) { - printf("%s",path); - } else { - printf("%s",context->grib_definition_files_path); + if ((path = codes_getenv("ECCODES_DEFINITION_PATH")) != NULL) { + printf("%s", path); + } + else { + printf("%s", context->grib_definition_files_path); } } if (print_flags & INFO_PRINT_SAMPLES_PATH) { - if ((path=codes_getenv("ECCODES_SAMPLES_PATH")) != NULL) { - printf("%s",path); - } else { - printf("%s",ECCODES_SAMPLES_PATH); + if ((path = codes_getenv("ECCODES_SAMPLES_PATH")) != NULL) { + printf("%s", path); + } + else { + printf("%s", ECCODES_SAMPLES_PATH); } } diff --git a/tools/codes_parser.c b/tools/codes_parser.c old mode 100755 new mode 100644 index 7845ce246..92dca5711 --- a/tools/codes_parser.c +++ b/tools/codes_parser.c @@ -10,26 +10,25 @@ #include "grib_api_internal.h" -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - int i = 0; - int fail = 0; + int i = 0; + int fail = 0; - grib_context* c = grib_context_get_default(); - grib_action* a=NULL; + grib_context* c = grib_context_get_default(); + grib_action* a = NULL; - for(i = 1; i < argc; i++){ - printf("%s ... ",argv[i]);fflush(stdout); - if(!(a=grib_parse_file(c,argv[i]))) - { - fail++; - printf("FAILED\n"); - exit(1); + for (i = 1; i < argc; i++) { + printf("%s ... ", argv[i]); + fflush(stdout); + if (!(a = grib_parse_file(c, argv[i]))) { + fail++; + printf("FAILED\n"); + exit(1); + } + else { + printf("OK\n"); + } } - else - { - printf("OK\n"); - } - } - return fail; + return fail; } diff --git a/tools/codes_split_file.c b/tools/codes_split_file.c index 3248861ab..fc52df8d4 100644 --- a/tools/codes_split_file.c +++ b/tools/codes_split_file.c @@ -20,136 +20,145 @@ #include "grib_api_internal.h" #include -static int verbose = 0; +static int verbose = 0; static const char* OUTPUT_FILENAME_FORMAT = "%s_%03d"; /* x_001, x_002 etc */ static void usage(const char* prog) { - printf("Usage: %s [-v] nchunks infile\n",prog); + printf("Usage: %s [-v] nchunks infile\n", prog); printf("Setting nchunks=-1 splits infile into individual messages\n"); exit(1); } -static int split_file(FILE* in, const char* filename, const int nchunks, unsigned long *count) +static int split_file(FILE* in, const char* filename, const int nchunks, unsigned long* count) { - void* mesg=NULL; + void* mesg = NULL; FILE* out; - size_t size=0,read_size=0,insize=0,chunk_size, msg_size=0, num_msg=0; - off_t offset=0; - int err=GRIB_SUCCESS; + size_t size = 0, read_size = 0, insize = 0, chunk_size, msg_size = 0, num_msg = 0; + off_t offset = 0; + int err = GRIB_SUCCESS; int i; char* ofilename; - grib_context* c=grib_context_get_default(); + grib_context* c = grib_context_get_default(); - if (!in) return 1; + if (!in) + return 1; /* name of output file */ - ofilename=(char*)calloc(1,strlen(filename)+10); + ofilename = (char*)calloc(1, strlen(filename) + 10); fseeko(in, 0, SEEK_END); insize = ftello(in); fseeko(in, 0, SEEK_SET); if (nchunks == -1) { chunk_size = size; - } else { + } + else { assert(nchunks > 0); - chunk_size=insize/nchunks; + chunk_size = insize / nchunks; } - i=1; + i = 1; sprintf(ofilename, OUTPUT_FILENAME_FORMAT, filename, i); - out=fopen(ofilename,"w"); + out = fopen(ofilename, "w"); if (!out) { perror(ofilename); free(ofilename); return GRIB_IO_PROBLEM; } - while ( err!=GRIB_END_OF_FILE ) { - mesg=wmo_read_any_from_file_malloc(in, 0, &size, &offset, &err); + while (err != GRIB_END_OF_FILE) { + mesg = wmo_read_any_from_file_malloc(in, 0, &size, &offset, &err); num_msg++; /*printf("=1=%d\t%d\t%d\n",*count,size,insize);*/ - if ( mesg!=NULL && err==0 ) { - if (fwrite(mesg,1,size,out)!=size ) { + if (mesg != NULL && err == 0) { + if (fwrite(mesg, 1, size, out) != size) { perror(ofilename); free(ofilename); fclose(out); return GRIB_IO_PROBLEM; } - grib_context_free(c,mesg); - read_size+=size; - msg_size+=size; - if (read_size>chunk_size && msg_size < insize) { - if (verbose) printf("Wrote output file %s (%lu msgs)\n", ofilename, (unsigned long)num_msg); + grib_context_free(c, mesg); + read_size += size; + msg_size += size; + if (read_size > chunk_size && msg_size < insize) { + if (verbose) + printf("Wrote output file %s (%lu msgs)\n", ofilename, (unsigned long)num_msg); fclose(out); i++; /* Start writing to the next file */ /*printf("=2=%d\t%d\n",*count,msg_size);*/ sprintf(ofilename, OUTPUT_FILENAME_FORMAT, filename, i); - out=fopen(ofilename,"w"); + out = fopen(ofilename, "w"); if (!out) { perror(ofilename); free(ofilename); return GRIB_IO_PROBLEM; } - read_size=0; - num_msg=0; + read_size = 0; + num_msg = 0; } (*count)++; } } - if (verbose) printf("Wrote output file %s (%lu msgs)\n", ofilename, (unsigned long)num_msg-1); + if (verbose) + printf("Wrote output file %s (%lu msgs)\n", ofilename, (unsigned long)num_msg - 1); fclose(out); free(ofilename); - if (err==GRIB_END_OF_FILE) err=GRIB_SUCCESS; + if (err == GRIB_END_OF_FILE) + err = GRIB_SUCCESS; return err; } -int main(int argc,char* argv[]) +int main(int argc, char* argv[]) { FILE* infh = NULL; char* filename; - int i, status=0; - int err=0,nchunks=0; - unsigned long count=0; + int i, status = 0; + int err = 0, nchunks = 0; + unsigned long count = 0; - if (argc <3) usage(argv[0]); + if (argc < 3) + usage(argv[0]); - i=1; - if (strcmp(argv[i], "-v")==0) { + i = 1; + if (strcmp(argv[i], "-v") == 0) { i++; verbose = 1; - if (argc !=4) usage(argv[0]); + if (argc != 4) + usage(argv[0]); } /* add some error checking */ - nchunks=atoi(argv[i]); - if (nchunks<1 && nchunks!=-1) { - fprintf(stderr,"ERROR: Invalid number %d. Please specify a positive integer or -1\n", nchunks); + nchunks = atoi(argv[i]); + if (nchunks < 1 && nchunks != -1) { + fprintf(stderr, "ERROR: Invalid number %d. Please specify a positive integer or -1\n", nchunks); return 1; } i++; - filename=argv[i]; + filename = argv[i]; if (path_is_directory(filename)) { fprintf(stderr, "ERROR: %s: Is a directory\n", filename); return 1; } - infh=fopen(filename,"rb"); + infh = fopen(filename, "rb"); if (!infh) { perror(filename); return 1; } - count=0; - err=split_file(infh, filename, nchunks, &count); + count = 0; + err = split_file(infh, filename, nchunks, &count); if (err) { - fprintf(stderr,"ERROR: Failed to split file %s", filename); - fprintf(stderr,"\n"); + fprintf(stderr, "ERROR: Failed to split file %s", filename); + fprintf(stderr, "\n"); status = 1; - } else { - if (verbose) printf ("%7lu %s\n", count, filename); + } + else { + if (verbose) + printf("%7lu %s\n", count, filename); } fclose(infh); diff --git a/tools/compile.c b/tools/compile.c old mode 100755 new mode 100644 index bd6cfa54f..2a65fd010 --- a/tools/compile.c +++ b/tools/compile.c @@ -12,46 +12,49 @@ #include "grib_api_internal.h" -typedef struct list { +typedef struct list +{ char path[1024]; char name[1024]; struct list* next; } list; -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - int i = 0; - int j = 0; - int fail = 0; - grib_compiler compiler = {0,}; + int i = 0; + int j = 0; + int fail = 0; + grib_compiler compiler = { + 0, + }; grib_context* c = grib_context_get_default(); - grib_action *a; + grib_action* a; - list *first = NULL; - list *l = NULL; + list* first = NULL; + list* l = NULL; compiler.out = stdout; compiler.max = 4096; printf("#include \"grib_api_internal.h\"\n\n"); - for(i = 1; i < argc; i++){ - + for (i = 1; i < argc; i++) { char name[1024]; const char* p = argv[i]; const char* path; - while(*p && strncmp(p,"definitions",strlen("definitions"))) p++; + while (*p && strncmp(p, "definitions", strlen("definitions"))) + p++; path = p; - if(!p) { - fprintf(stderr,"Invalid name %s\n",argv[i]); + if (!p) { + fprintf(stderr, "Invalid name %s\n", argv[i]); exit(1); } - strcpy(name,"grib_"); + strcpy(name, "grib_"); j = strlen(name); - while(*p) { - if(isalnum(*p)) { + while (*p) { + if (isalnum(*p)) { name[j++] = *p; } else { @@ -61,53 +64,48 @@ int main(int argc, char *argv[]) } name[j++] = 0; - printf("static grib_action* %s(grib_context *ctx) {\n",name); - printf("grib_action* a[%d] = {0,};\n\n",compiler.max); - printf("grib_action* b[%d] = {0,};\n\n",compiler.max); + printf("static grib_action* %s(grib_context *ctx) {\n", name); + printf("grib_action* a[%d] = {0,};\n\n", compiler.max); + printf("grib_action* b[%d] = {0,};\n\n", compiler.max); compiler.cnt = 0; printf("/* %s */\n", path); - if(!(a = grib_parse_file(c,argv[i]))) - { + if (!(a = grib_parse_file(c, argv[i]))) { fail++; exit(1); } - else - { - grib_compile_action_branch(a,&compiler,NULL); - + else { + grib_compile_action_branch(a, &compiler, NULL); } printf("return a[0];\n"); printf("}\n"); - l = calloc(sizeof(list),1); + l = calloc(sizeof(list), 1); l->next = first; - strcpy(l->name,name); - strcpy(l->path,path); + strcpy(l->name, name); + strcpy(l->path, path); first = l; - - } printf("void grib_load_compiled_definitions(grib_context* ctx){\n"); printf("grib_action_file* af;\n"); printf("ctx = ctx ? ctx : grib_context_get_default();\n\n"); - printf("if(!ctx->grib_reader)\n"); - printf(" ctx->grib_reader =(grib_action_file_list*)grib_context_malloc_clear_persistent(ctx,sizeof(grib_action_file_list));"); + printf("if(!ctx->grib_reader)\n"); + printf(" ctx->grib_reader =(grib_action_file_list*)grib_context_malloc_clear_persistent(ctx,sizeof(grib_action_file_list));"); - while(l) { + while (l) { printf("af =(grib_action_file*)grib_context_malloc_clear_persistent(ctx,sizeof(grib_action_file));\n"); - printf("af->root = %s(ctx);\n",l->name); - printf("af->filename = grib_context_strdup_persistent(ctx,\"COMPILED/%s\");\n",l->path); + printf("af->root = %s(ctx);\n", l->name); + printf("af->filename = grib_context_strdup_persistent(ctx,\"COMPILED/%s\");\n", l->path); printf("grib_push_action_file(af,ctx->grib_reader);\n\n"); l = l->next; } printf("}\n"); - printf("int main(int argc,char* argv[]) {grib_load_compiled_definitions(0);return 0 ;}\n"); + printf("int main(int argc,char* argv[]) {grib_load_compiled_definitions(0);return 0 ;}\n"); return fail; } diff --git a/tools/gaussian.c b/tools/gaussian.c index 9c712ce7f..9647bbcfc 100644 --- a/tools/gaussian.c +++ b/tools/gaussian.c @@ -14,30 +14,31 @@ #include "grib_api.h" -static void usage(const char *prog) +static void usage(const char* prog) { - fprintf(stderr,"%s: N\n",prog); - exit(1); + fprintf(stderr, "%s: N\n", prog); + exit(1); } -int main(int argc, const char *argv[]) +int main(int argc, const char* argv[]) { - double *latitudes; - int count = 0; - int n,i; + double* latitudes; + int count = 0; + int n, i; - if(argc != 2) usage(argv[0]); + if (argc != 2) + usage(argv[0]); - n = atol(argv[1]); - count = n*2; + n = atol(argv[1]); + count = n * 2; - latitudes = (double*)malloc(count*sizeof(double)); - assert(latitudes); + latitudes = (double*)malloc(count * sizeof(double)); + assert(latitudes); - assert(grib_get_gaussian_latitudes(n,latitudes) == 0); + assert(grib_get_gaussian_latitudes(n, latitudes) == 0); - for(i = 0; i < count ; i++) - printf("%g\n",latitudes[i]); + for (i = 0; i < count; i++) + printf("%g\n", latitudes[i]); - return 0; + return 0; } diff --git a/tools/gg_sub_area_check.c b/tools/gg_sub_area_check.c index a5e60cbb8..c17f87c9a 100644 --- a/tools/gg_sub_area_check.c +++ b/tools/gg_sub_area_check.c @@ -10,131 +10,174 @@ #include "grib_api.h" -static void usage(char* prog) { - printf("Usage: %s file1.grib file2.grib\n",prog); - printf("Input files must be gaussian reduced global and sub-area.\n"); - printf("Performs consistency check between global and sub-area.\n"); +static void usage(char* prog) +{ + printf("Usage: %s file1.grib file2.grib\n", prog); + printf("Input files must be gaussian reduced global and sub-area.\n"); + printf("Performs consistency check between global and sub-area.\n"); - exit(1); + exit(1); } -int main(int argc, char* argv[]) { - grib_handle *h1,*h2; - int ret=0; - FILE *f1,*f2; - char* infile1; - char* infile2; - double *v1,*v2,*v,*gv; - double *lon1,*lon2,*lon,*glon; - double *lat1,*lat2,*lat,*glat; - size_t size1,size2,size,gsize; - double err1,err2,err; - int i,j; - grib_context* c; - grib_iterator *iter1,*iter2; - - c=grib_context_get_default(); - - if (argc < 3) usage(argv[0]); - - infile1=argv[1]; - infile2=argv[2]; - - f1=fopen(infile1,"r"); - if (!f1) { - perror(infile1); - exit(1); - } - - f2=fopen(infile2,"r"); - if (!f2) { - perror(infile2); - exit(1); - } - - while ((h1=grib_handle_new_from_file(0,f1,&ret))!=NULL) { - if ((h2=grib_handle_new_from_file(c,f2,&ret))==NULL) { - printf("unable to create handle from file %s\n",infile2); - GRIB_CHECK(ret,0); - exit(1); - } - GRIB_CHECK(grib_get_size(h1,"values",&size1),0); - v1=(double*)malloc(size1*sizeof(double)); - if (!v1) {printf("unable to allocate v1\n");exit(1);} - lat1=(double*)malloc(size1*sizeof(double)); - if (!lat1) {printf("unable to allocate lat1\n");exit(1);} - lon1=(double*)malloc(size1*sizeof(double)); - if (!lon1) {printf("unable to allocate lon1\n");exit(1);} - GRIB_CHECK(grib_get_double(h1,"packingError",&err1),0); - - iter1=grib_iterator_new(h1,0,&ret); - GRIB_CHECK(ret,0); - - GRIB_CHECK(grib_get_size(h2,"values",&size2),0); - v2=(double*)malloc(size2*sizeof(double)); - if (!v2) {printf("unable to allocate v2\n");exit(1);} - lat2=(double*)malloc(size2*sizeof(double)); - if (!lat2) {printf("unable to allocate lat2\n");exit(1);} - lon2=(double*)malloc(size2*sizeof(double)); - if (!lon2) {printf("unable to allocate lon2\n");exit(1);} - GRIB_CHECK(grib_get_double(h2,"packingError",&err2),0); - - iter2=grib_iterator_new(h2,0,&ret); - GRIB_CHECK(ret,0); - - lat=lat1; lon=lon1; v=v1; - while(grib_iterator_next(iter1,lat,lon,v)) { - lat++; - if (*lon < 0 ) *lon+=360; - lon++; - v++; - } - lat=lat2; lon=lon2; v=v2; - while(grib_iterator_next(iter2,lat,lon,v)) { - lat++; - if (*lon < 0 ) *lon+=360; - lon++; - v++; - } - - if (size1 > size2) { - lat=lat2;lon=lon2;v=v2; - size=size2; - glat=lat1;glon=lon1;gv=v1; - gsize=size1; - } else { - lat=lat1;lon=lon1;v=v1; - size=size1; - glat=lat2;glon=lon2;gv=v2; - gsize=size2; - } - if (err1>err2) err=err1; - else err=err2; - - j=0; - for (i=0;ierr) { - ret=1; - printf("lat=%g lon=%g sub area value=%g global value=%g\n", - lat[i],lon[i],v[i],gv[j]); - } - - } - free(v);free(gv);free(lat);free(glat);free(lon);free(glon); - - } - - fclose(f1); - fclose(f2); - - return ret; +int main(int argc, char* argv[]) +{ + grib_handle *h1, *h2; + int ret = 0; + FILE *f1, *f2; + char* infile1; + char* infile2; + double *v1, *v2, *v, *gv; + double *lon1, *lon2, *lon, *glon; + double *lat1, *lat2, *lat, *glat; + size_t size1, size2, size, gsize; + double err1, err2, err; + int i, j; + grib_context* c; + grib_iterator *iter1, *iter2; + + c = grib_context_get_default(); + + if (argc < 3) + usage(argv[0]); + + infile1 = argv[1]; + infile2 = argv[2]; + + f1 = fopen(infile1, "r"); + if (!f1) { + perror(infile1); + exit(1); + } + + f2 = fopen(infile2, "r"); + if (!f2) { + perror(infile2); + exit(1); + } + + while ((h1 = grib_handle_new_from_file(0, f1, &ret)) != NULL) { + if ((h2 = grib_handle_new_from_file(c, f2, &ret)) == NULL) { + printf("unable to create handle from file %s\n", infile2); + GRIB_CHECK(ret, 0); + exit(1); + } + GRIB_CHECK(grib_get_size(h1, "values", &size1), 0); + v1 = (double*)malloc(size1 * sizeof(double)); + if (!v1) { + printf("unable to allocate v1\n"); + exit(1); + } + lat1 = (double*)malloc(size1 * sizeof(double)); + if (!lat1) { + printf("unable to allocate lat1\n"); + exit(1); + } + lon1 = (double*)malloc(size1 * sizeof(double)); + if (!lon1) { + printf("unable to allocate lon1\n"); + exit(1); + } + GRIB_CHECK(grib_get_double(h1, "packingError", &err1), 0); + + iter1 = grib_iterator_new(h1, 0, &ret); + GRIB_CHECK(ret, 0); + + GRIB_CHECK(grib_get_size(h2, "values", &size2), 0); + v2 = (double*)malloc(size2 * sizeof(double)); + if (!v2) { + printf("unable to allocate v2\n"); + exit(1); + } + lat2 = (double*)malloc(size2 * sizeof(double)); + if (!lat2) { + printf("unable to allocate lat2\n"); + exit(1); + } + lon2 = (double*)malloc(size2 * sizeof(double)); + if (!lon2) { + printf("unable to allocate lon2\n"); + exit(1); + } + GRIB_CHECK(grib_get_double(h2, "packingError", &err2), 0); + + iter2 = grib_iterator_new(h2, 0, &ret); + GRIB_CHECK(ret, 0); + + lat = lat1; + lon = lon1; + v = v1; + while (grib_iterator_next(iter1, lat, lon, v)) { + lat++; + if (*lon < 0) + *lon += 360; + lon++; + v++; + } + lat = lat2; + lon = lon2; + v = v2; + while (grib_iterator_next(iter2, lat, lon, v)) { + lat++; + if (*lon < 0) + *lon += 360; + lon++; + v++; + } + + if (size1 > size2) { + lat = lat2; + lon = lon2; + v = v2; + size = size2; + glat = lat1; + glon = lon1; + gv = v1; + gsize = size1; + } + else { + lat = lat1; + lon = lon1; + v = v1; + size = size1; + glat = lat2; + glon = lon2; + gv = v2; + gsize = size2; + } + if (err1 > err2) + err = err1; + else + err = err2; + + j = 0; + for (i = 0; i < size; i++) { + while (j < gsize && (lat[i] != glat[j] || lon[i] != glon[j])) + j++; + if (j == gsize) { + j = 0; + while (j < gsize && (lat[i] != glat[j] || lon[i] != glon[j])) + j++; + } + if (j == gsize) { + printf("lat=%g lon=%g not found in global\n", lat[i], lon[i]); + exit(1); + } + if (fabs(v[i] - gv[j]) > err) { + ret = 1; + printf("lat=%g lon=%g sub area value=%g global value=%g\n", + lat[i], lon[i], v[i], gv[j]); + } + } + free(v); + free(gv); + free(lat); + free(glat); + free(lon); + free(glon); + } + + fclose(f1); + fclose(f2); + + return ret; } diff --git a/tools/grib2ppm.c b/tools/grib2ppm.c index 9c931a3f4..f3190a4fa 100644 --- a/tools/grib2ppm.c +++ b/tools/grib2ppm.c @@ -38,22 +38,18 @@ unsigned char unused(char c) } */ -static int next(FILE *f, char *buf) +static int next(FILE* f, char* buf) { int c; int i = 0; - while ((c = fgetc(f)) != EOF) - { - if (c == ' ' || c == '\n') - { - if (i) - { + while ((c = fgetc(f)) != EOF) { + if (c == ' ' || c == '\n') { + if (i) { break; } i++; } - else - { + else { buf[i++] = c; } } @@ -61,13 +57,13 @@ static int next(FILE *f, char *buf) return i; } -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - grib_handle *h = NULL; - FILE *f = NULL; - int i = 0; - int err = 0; - int centred = 0; + grib_handle* h = NULL; + FILE* f = NULL; + int i = 0; + int err = 0; + int centred = 0; unsigned r, g, b; int cmap_entries = 0; double min0, max0; @@ -75,85 +71,83 @@ int main(int argc, char *argv[]) char buf[1024]; double lcap = -1e+100, ucap = 1e+100; - for (i = 1; i < argc; i++) - { - if (argv[i][0] == '-') - { - switch (argv[i][1]) - { - - case 'c': - centred = 1; - break; - - case 'u': - ucap = atof(argv[i + 1]); - i++; - break; - - case 'l': - lcap = atof(argv[i + 1]); - i++; - break; - - case 'm': - f = fopen(argv[i + 1], "r"); - if (!f) - { - perror(argv[i + 1]); - exit(1); - } - while (next(f, buf)) - { - min0 = atof(buf); - next(f, buf); - max0 = atof(buf); - next(f, buf); - r = atol(buf); - next(f, buf); - g = atol(buf); next(f, buf); - b = atol(buf); - - if (cmap_entries >= CMAP_MAX) - { - fprintf(stderr, "%s\n", "colour map is too large"); + for (i = 1; i < argc; i++) { + if (argv[i][0] == '-') { + switch (argv[i][1]) { + case 'c': + centred = 1; + break; + + case 'u': + ucap = atof(argv[i + 1]); + i++; + break; + + case 'l': + lcap = atof(argv[i + 1]); + i++; + break; + + case 'm': + f = fopen(argv[i + 1], "r"); + if (!f) { + perror(argv[i + 1]); exit(1); } - cmap[cmap_entries].min = min0; - cmap[cmap_entries].max = max0; - cmap[cmap_entries].r = r; - cmap[cmap_entries].g = g; - cmap[cmap_entries].b = b; - cmap_entries++; - } - fclose(f); - i++; - fprintf(stderr, "Number of colours: %d\n", cmap_entries); + while (next(f, buf)) { + min0 = atof(buf); + next(f, buf); + max0 = atof(buf); + next(f, buf); + r = atol(buf); + next(f, buf); + g = atol(buf); + next(f, buf); + b = atol(buf); + + if (cmap_entries >= CMAP_MAX) { + fprintf(stderr, "%s\n", "colour map is too large"); + exit(1); + } + cmap[cmap_entries].min = min0; + cmap[cmap_entries].max = max0; + cmap[cmap_entries].r = r; + cmap[cmap_entries].g = g; + cmap[cmap_entries].b = b; + cmap_entries++; + } + fclose(f); + i++; + fprintf(stderr, "Number of colours: %d\n", cmap_entries); } continue; } f = fopen(argv[i], "r"); - if (!f) - { + if (!f) { perror(argv[i]); exit(1); } - while ((h = grib_handle_new_from_file(0, f, &err)) != NULL) - { + while ((h = grib_handle_new_from_file(0, f, &err)) != NULL) { long width; long height; double max, min; - double *values = NULL; - unsigned long *indices; + double* values = NULL; + unsigned long* indices; size_t count; GRIB_CHECK(grib_get_size(h, "values", &count), 0); - values = (double *)malloc(sizeof(double) * count); - if (!values) { fprintf(stderr, "Failed to allocate memory for values\n"); exit(1); } - indices = (unsigned long *)malloc(sizeof(unsigned long) * count); - if (!indices) { fprintf(stderr, "Failed to allocate memory for indices\n"); exit(1); } + values = (double*)malloc(sizeof(double) * count); + if (!values) { + fprintf(stderr, "Failed to allocate memory for values\n"); + exit(1); + } + indices = (unsigned long*)malloc(sizeof(unsigned long) * count); + if (!indices) { + fprintf(stderr, "Failed to allocate memory for indices\n"); + exit(1); + } if (grib_is_missing(h, "Ni", &err)) { fprintf(stderr, "Key Ni cannot be missing. Reduced grids are not supported\n"); @@ -163,11 +157,10 @@ int main(int argc, char *argv[]) GRIB_CHECK(grib_get_long(h, "Nj", &height), 0); GRIB_CHECK(grib_get_double_array(h, "values", values, &count), 0); - max = values[0]; - min = values[0]; + max = values[0]; + min = values[0]; indices[0] = 0; - for (i = 1; i < count; ++i) - { + for (i = 1; i < count; ++i) { if (values[i] > max) max = values[i]; if (values[i] < min) @@ -175,48 +168,39 @@ int main(int argc, char *argv[]) indices[i] = i; } - if (max > ucap) - { + if (max > ucap) { max = ucap; } - if (min < lcap) - { + if (min < lcap) { min = lcap; } fprintf(stderr, "width=%ld, height=%ld, min=%g, max=%g\n", width, height, min, max); - if (centred) - { + if (centred) { /* assume first column in Greenwich meridian assume scanning mode */ int k = 0, jj; - for (jj = 0; jj < height; jj++) - { - for (i = 0; i < width; i++) - { + for (jj = 0; jj < height; jj++) { + for (i = 0; i < width; i++) { int m = (i + width / 2) % width + jj * width; - assert(k= cmap[m].min && v < cmap[m].max) - { + if (v >= cmap[m].min && v < cmap[m].max) { last[p] = m; printf("%c", cmap[m].r); printf("%c", cmap[m].g); @@ -224,34 +208,28 @@ int main(int argc, char *argv[]) break; } } - if (j == cmap_entries) - { + if (j == cmap_entries) { fprintf(stderr, "Cannot find colour for %g\n", v); exit(1); } - } } - else - { + else { /* PPM header */ printf("P5\n%ld %ld\n65535\n", width, height); - for (i = 0; i < count; ++i) - { + for (i = 0; i < count; ++i) { unsigned long c; unsigned char hh, l; double v = values[indices[i]]; - if (v < lcap) - { + if (v < lcap) { v = lcap; } - if (v > ucap) - { + if (v > ucap) { v = ucap; } - c = ( v - min) * 65535 / (max - min); + c = (v - min) * 65535 / (max - min); hh = c >> 8; - l = c & 0xff; + l = c & 0xff; printf("%c", hh); printf("%c", l); } @@ -263,8 +241,7 @@ int main(int argc, char *argv[]) break; } fclose(f); - if (err) - { + if (err) { fprintf(stderr, "%s\n", grib_get_error_message(err)); exit(1); } diff --git a/tools/grib_2_request.c b/tools/grib_2_request.c index eb03b89d5..1fc32afa2 100644 --- a/tools/grib_2_request.c +++ b/tools/grib_2_request.c @@ -15,68 +15,60 @@ #include "grib_api_internal.h" -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - grib_handle* h = NULL; - FILE* f = NULL; - int i = 0; - int err = 0; - char *mode = "file"; - char name[80]; - char value[80]; - - - for(i = 1; i < argc; i++) - { - - if(argv[i][0] == '-') - { - mode = argv[i]+1; - continue; - } - - f = fopen(argv[i],"r"); - if(!f) { - perror(argv[i]); - exit(1); - } - - while((h = grib_handle_new_from_file(0,f,&err)) != NULL) - { - - grib_keys_iterator* ks = grib_keys_iterator_new(h,GRIB_KEYS_ITERATOR_ALL_KEYS,"mars"); - while(grib_keys_iterator_next(ks)) - { - size_t len = sizeof(value); - char tmp[100]; - - strcpy(name,grib_keys_iterator_get_name(ks)); - - sprintf(tmp,"mars.%s",name); - - if((err = grib_keys_iterator_get_string(ks,value,&len)) != GRIB_SUCCESS) - /* if(err = grib_get_string(h,tmp,value,&len)) */ - { - fprintf(stderr,"Cannot get %s as string %d (%s)\n",name,err, - grib_get_error_message(err)); - exit(err); - } - - printf("%s=%s\n",name,value); - } - grib_keys_iterator_delete(ks); - printf("\n"); - - - - grib_handle_delete(h); - } - fclose(f); - if(err) - { - fprintf(stderr,"%s\n",grib_get_error_message(err)); - exit(1); - } - } - return 0; + grib_handle* h = NULL; + FILE* f = NULL; + int i = 0; + int err = 0; + char* mode = "file"; + char name[80]; + char value[80]; + + + for (i = 1; i < argc; i++) { + if (argv[i][0] == '-') { + mode = argv[i] + 1; + continue; + } + + f = fopen(argv[i], "r"); + if (!f) { + perror(argv[i]); + exit(1); + } + + while ((h = grib_handle_new_from_file(0, f, &err)) != NULL) { + grib_keys_iterator* ks = grib_keys_iterator_new(h, GRIB_KEYS_ITERATOR_ALL_KEYS, "mars"); + while (grib_keys_iterator_next(ks)) { + size_t len = sizeof(value); + char tmp[100]; + + strcpy(name, grib_keys_iterator_get_name(ks)); + + sprintf(tmp, "mars.%s", name); + + if ((err = grib_keys_iterator_get_string(ks, value, &len)) != GRIB_SUCCESS) + /* if(err = grib_get_string(h,tmp,value,&len)) */ + { + fprintf(stderr, "Cannot get %s as string %d (%s)\n", name, err, + grib_get_error_message(err)); + exit(err); + } + + printf("%s=%s\n", name, value); + } + grib_keys_iterator_delete(ks); + printf("\n"); + + + grib_handle_delete(h); + } + fclose(f); + if (err) { + fprintf(stderr, "%s\n", grib_get_error_message(err)); + exit(1); + } + } + return 0; } diff --git a/tools/grib_check_gaussian_grid.c b/tools/grib_check_gaussian_grid.c index 59936d05d..abcbdf60a 100644 --- a/tools/grib_check_gaussian_grid.c +++ b/tools/grib_check_gaussian_grid.c @@ -24,17 +24,17 @@ #define STR_EQUAL(s1, s2) (strcmp((s1), (s2)) == 0) int exit_on_error = 1; /* By default exit if any check fails */ -int verbose = 0; /* By default quiet unless errors */ -int error_count = 0; +int verbose = 0; /* By default quiet unless errors */ +int error_count = 0; int DBL_EQUAL(double d1, double d2, double tolerance) { - return fabs(d1-d2) <= tolerance; + return fabs(d1 - d2) <= tolerance; } static void usage(const char* prog) { - printf("Usage: %s [-f] [-v] grib_file grib_file ...\n\n",prog); + printf("Usage: %s [-f] [-v] grib_file grib_file ...\n\n", prog); printf("Check geometry of GRIB fields with a Gaussian Grid.\n"); printf("(The grid is assumed to be GLOBAL)\n\n"); printf("Options:\n"); @@ -49,8 +49,8 @@ void error(const char* filename, int msg_num, const char* fmt, ...) { char buf[1024] = {0,}; va_list list; - va_start(list,fmt); - if(verbose) + va_start(list, fmt); + if (verbose) sprintf(buf, " Error: %s", fmt); /* indent a bit */ else sprintf(buf, "Error: %s #%d: %s", filename, msg_num, fmt); @@ -65,8 +65,10 @@ void error(const char* filename, int msg_num, const char* fmt, ...) double get_precision(long edition) { - if (edition == 1) return 1.0/1000.0; /* milli degrees */ - if (edition == 2) return 1.0/1000000.0; /* micro degrees */ + if (edition == 1) + return 1.0 / 1000.0; /* milli degrees */ + if (edition == 2) + return 1.0 / 1000000.0; /* micro degrees */ assert(!"Invalid edition"); return 0.0; } @@ -74,103 +76,108 @@ double get_precision(long edition) static int is_regular_file(const char* path) { struct stat s; - int stat_val = stat(path,&s); - if (stat_val != 0) return 0; /*error doing stat*/ - return S_ISREG( s.st_mode ); + int stat_val = stat(path, &s); + if (stat_val != 0) + return 0; /*error doing stat*/ + return S_ISREG(s.st_mode); } int process_file(const char* filename) { int err = 0, msg_num = 0; - codes_handle *h = NULL; - FILE* in = NULL; - + codes_handle* h = NULL; + FILE* in = NULL; + if (!is_regular_file(filename)) { - if(verbose) printf(" WARNING: '%s' not a regular file! Ignoring\n", filename); + if (verbose) + printf(" WARNING: '%s' not a regular file! Ignoring\n", filename); return GRIB_IO_PROBLEM; } in = fopen(filename, "r"); - if(!in) { - fprintf(stderr, "ERROR: unable to open input file %s\n",filename); + if (!in) { + fprintf(stderr, "ERROR: unable to open input file %s\n", filename); exit(1); } - if(verbose) printf("Checking file %s\n", filename); + if (verbose) + printf("Checking file %s\n", filename); - while ((h = codes_handle_new_from_file(0, in, PRODUCT_GRIB, &err)) != NULL ) - { + while ((h = codes_handle_new_from_file(0, in, PRODUCT_GRIB, &err)) != NULL) { int is_reduced = 0, is_regular = 0, grid_ok = 0; long edition = 0, N = 0, Nj = 0, numberOfDataPoints; size_t len = 0, sizeOfValuesArray = 0; - double *lats = NULL; - long *pl = NULL; + double* lats = NULL; + long* pl = NULL; char gridType[128] = {0,}; double angular_tolerance, lat1, lon1, lat2, lon2, expected_lon2; double iDirectionIncrementInDegrees; - if (err != CODES_SUCCESS) CODES_CHECK(err,0); + if (err != CODES_SUCCESS) + CODES_CHECK(err, 0); ++msg_num; - CODES_CHECK(codes_get_long(h,"edition",&edition),0); - if(verbose) printf(" Processing GRIB message #%d (edition=%ld)\n", msg_num, edition); + CODES_CHECK(codes_get_long(h, "edition", &edition), 0); + if (verbose) + printf(" Processing GRIB message #%d (edition=%ld)\n", msg_num, edition); len = 32; - CODES_CHECK(codes_get_string(h,"gridType",gridType,&len),0); + CODES_CHECK(codes_get_string(h, "gridType", gridType, &len), 0); is_regular = STR_EQUAL(gridType, "regular_gg"); is_reduced = STR_EQUAL(gridType, "reduced_gg"); - grid_ok = is_regular || is_reduced; - if( !grid_ok ) { + grid_ok = is_regular || is_reduced; + if (!grid_ok) { /*error("ERROR: gridType should be Reduced or Regular Gaussian Grid!\n");*/ - if(verbose) printf(" WARNING: gridType should be Reduced or Regular Gaussian Grid! Ignoring\n"); + if (verbose) + printf(" WARNING: gridType should be Reduced or Regular Gaussian Grid! Ignoring\n"); codes_handle_delete(h); continue; } - CODES_CHECK(codes_get_long(h,"N",&N),0); - CODES_CHECK(codes_get_long(h,"Nj",&Nj),0); - CODES_CHECK(codes_get_long(h,"numberOfDataPoints",&numberOfDataPoints),0); - CODES_CHECK(codes_get_double(h,"latitudeOfFirstGridPointInDegrees", &lat1),0); - CODES_CHECK(codes_get_double(h,"longitudeOfFirstGridPointInDegrees",&lon1),0); - CODES_CHECK(codes_get_double(h,"latitudeOfLastGridPointInDegrees", &lat2),0); - CODES_CHECK(codes_get_double(h,"longitudeOfLastGridPointInDegrees", &lon2),0); - CODES_CHECK(codes_get_double(h,"iDirectionIncrementInDegrees",&iDirectionIncrementInDegrees),0); + CODES_CHECK(codes_get_long(h, "N", &N), 0); + CODES_CHECK(codes_get_long(h, "Nj", &Nj), 0); + CODES_CHECK(codes_get_long(h, "numberOfDataPoints", &numberOfDataPoints), 0); + CODES_CHECK(codes_get_double(h, "latitudeOfFirstGridPointInDegrees", &lat1), 0); + CODES_CHECK(codes_get_double(h, "longitudeOfFirstGridPointInDegrees", &lon1), 0); + CODES_CHECK(codes_get_double(h, "latitudeOfLastGridPointInDegrees", &lat2), 0); + CODES_CHECK(codes_get_double(h, "longitudeOfLastGridPointInDegrees", &lon2), 0); + CODES_CHECK(codes_get_double(h, "iDirectionIncrementInDegrees", &iDirectionIncrementInDegrees), 0); angular_tolerance = get_precision(edition); if (N <= 0) { error(filename, msg_num, "N should be > 0\n", N); } - if ( Nj != 2*N ) { - error(filename, msg_num, "Nj is %ld but should be 2*N (%ld)\n", Nj, 2*N); + if (Nj != 2 * N) { + error(filename, msg_num, "Nj is %ld but should be 2*N (%ld)\n", Nj, 2 * N); } if (lon1 != 0) { error(filename, msg_num, "latitudeOfFirstGridPointInDegrees=%f but should be 0\n", lon1); } - expected_lon2 = 360.0 - 360.0/(4*N); + expected_lon2 = 360.0 - 360.0 / (4 * N); /* Check first and last latitudes */ if (lat1 != -lat2) { error(filename, msg_num, "First latitude must be = last latitude but opposite in sign: lat1=%f, lat2=%f\n", - lat1, lat2); + lat1, lat2); } /* Note: grib_get_gaussian_latitudes() assumes the 'lats' array has 2N elements! */ /* So do not allocate Nj */ - lats = (double*)malloc(sizeof(double)* 2*N); - CODES_CHECK(codes_get_gaussian_latitudes(N,lats), 0); + lats = (double*)malloc(sizeof(double) * 2 * N); + CODES_CHECK(codes_get_gaussian_latitudes(N, lats), 0); if (!DBL_EQUAL(lats[0], lat1, angular_tolerance)) { error(filename, msg_num, "latitudeOfFirstGridPointInDegrees=%f but should be %f\n", lat1, lats[0]); } - if (!DBL_EQUAL(lats[Nj-1], lat2, angular_tolerance)) { - error(filename, msg_num, "latitudeOfLastGridPointInDegrees=%f but should be %f\n", lat2, lats[Nj-1]); + if (!DBL_EQUAL(lats[Nj - 1], lat2, angular_tolerance)) { + error(filename, msg_num, "latitudeOfLastGridPointInDegrees=%f but should be %f\n", lat2, lats[Nj - 1]); } if (is_reduced) { int pl_sum = 0, max_pl = 0, is_missing_Ni = 0, is_missing_Di = 0; size_t i = 0, pl_len = 0; long is_octahedral = 0; - is_missing_Ni = codes_is_missing(h, "Ni", &err); + is_missing_Ni = codes_is_missing(h, "Ni", &err); assert(err == CODES_SUCCESS); is_missing_Di = codes_is_missing(h, "iDirectionIncrement", &err); assert(err == CODES_SUCCESS); @@ -181,38 +188,40 @@ int process_file(const char* filename) error(filename, msg_num, "For a reduced gaussian grid iDirectionIncrement should be missing\n"); } - CODES_CHECK(codes_get_size(h, "pl", &pl_len),0); - assert(pl_len>0); - if (pl_len != 2*N) { - error(filename, msg_num, "Length of pl array is %ld but should be 2*N (%ld)\n", pl_len, 2*N); + CODES_CHECK(codes_get_size(h, "pl", &pl_len), 0); + assert(pl_len > 0); + if (pl_len != 2 * N) { + error(filename, msg_num, "Length of pl array is %ld but should be 2*N (%ld)\n", pl_len, 2 * N); } - pl = (long*)malloc(pl_len*sizeof(long)); + pl = (long*)malloc(pl_len * sizeof(long)); assert(pl); - CODES_CHECK(codes_get_long_array(h, "pl", pl, &pl_len),0); + CODES_CHECK(codes_get_long_array(h, "pl", pl, &pl_len), 0); max_pl = pl[0]; /* Check pl is symmetric */ - for(i=0; i max_pl) max_pl = pl[i]; + if (pl[i] > max_pl) + max_pl = pl[i]; } if (pl_sum != numberOfDataPoints) { error(filename, msg_num, "Sum of pl array %ld does not match numberOfDataPoints %ld\n", pl_sum, numberOfDataPoints); } - CODES_CHECK(codes_get_long(h,"isOctahedral",&is_octahedral),0); + CODES_CHECK(codes_get_long(h, "isOctahedral", &is_octahedral), 0); if (is_octahedral) { - if(verbose) printf(" This is an Octahedral Gaussian grid\n"); - expected_lon2 = 360.0 - 360.0/max_pl; + if (verbose) + printf(" This is an Octahedral Gaussian grid\n"); + expected_lon2 = 360.0 - 360.0 / max_pl; } free(pl); } @@ -221,7 +230,7 @@ int process_file(const char* filename) error(filename, msg_num, "longitudeOfLastGridPointInDegrees=%f but should be %f\n", lon2, expected_lon2); } - CODES_CHECK(codes_get_size(h, "values", &sizeOfValuesArray),0); + CODES_CHECK(codes_get_size(h, "values", &sizeOfValuesArray), 0); if (sizeOfValuesArray != numberOfDataPoints) { error(filename, msg_num, "Number of data points %d different from size of values array %d\n", numberOfDataPoints, sizeOfValuesArray); @@ -231,7 +240,8 @@ int process_file(const char* filename) codes_handle_delete(h); } fclose(in); - if(verbose) printf("\n"); + if (verbose) + printf("\n"); return GRIB_SUCCESS; } @@ -239,45 +249,40 @@ int main(int argc, char** argv) { int i = 0; - if (argc < 2) - { + if (argc < 2) { usage(argv[0]); return 1; } - for(i=1; i tolerance) { - ret=d; + ret = d; } return ret; /* return fabs(*a-*b) > *err ? fabs(*a-*b) : 0; */ } /* Returns 0 when the values are considered the same */ -static double compare_double_relative(double *a, double *b, double tolerance) +static double compare_double_relative(double* a, double* b, double tolerance) { double relativeError; - if(fabs(*a) <= maxAbsoluteError || fabs(*b) <= maxAbsoluteError) - relativeError = fabs(*a-*b); + if (fabs(*a) <= maxAbsoluteError || fabs(*b) <= maxAbsoluteError) + relativeError = fabs(*a - *b); else if (fabs(*b) > fabs(*a)) - relativeError = fabs((*a-*b) / *b); + relativeError = fabs((*a - *b) / *b); else - relativeError = fabs((*a-*b) / *a); + relativeError = fabs((*a - *b) / *a); return relativeError > tolerance ? relativeError : 0; } static int blacklisted(const char* name) { - grib_string_list* b=blacklist; + grib_string_list* b = blacklist; while (b) { Assert(b->value); - if (!strcmp(name,b->value)) + if (!strcmp(name, b->value)) return 1; - b=b->next; + b = b->next; } return 0; } -static double relative_error(double a,double b,double err) +static double relative_error(double a, double b, double err) { double relativeError; - if(fabs(a) <= maxAbsoluteError || fabs(b) <= maxAbsoluteError) - relativeError = fabs(a-b); + if (fabs(a) <= maxAbsoluteError || fabs(b) <= maxAbsoluteError) + relativeError = fabs(a - b); else if (fabs(b) > fabs(a)) - relativeError = fabs((a-b) / b); + relativeError = fabs((a - b) / b); else - relativeError = fabs((a-b) / a); + relativeError = fabs((a - b) / a); - return relativeError ; + return relativeError; } -grib_option grib_options[]={ +grib_option grib_options[] = { /* {id, args, help}, on, command_line, value*/ - {"r",0,"Compare files in which the messages are not in the same order. This option is time expensive.\n",0,1,0}, - {"b:",0,0,0,1,0}, - {"e",0,"Edition independent compare. It is used to compare GRIB edition 1 and 2.\n",0,1,0}, - {"2",0,"Enable two-way comparison.\n",0,1,0}, - {"c:",0,0,0,1,0}, - {"S:","start","First field to be processed.\n",0,1,0}, - {"E:","end","Last field to be processed.\n",0,1,0}, - {"a",0,"-c option modifier. The keys listed with the option -c will be added to the list of keys compared without -c.\n" - ,0,1,0}, - {"H",0,"Compare only message headers (everything except data and bitmap). Bit-by-bit compare on. Incompatible with -c option.\n",0,1,0}, - {"R:",0,0,0,1,0}, - {"A:",0,0,0,1,0}, - {"P",0,"Compare data values using the packing error as tolerance.\n",0,1,0}, - {"T:","factor","Compare data values using factor multiplied by the tolerance specified in options -P -R -A.\n",0,1,0}, - {"w:",0,0,0,1,0}, - {"f",0,0,0,1,0}, - {"F",0,0,1,0,0}, - {"q",0,0,1,0,0}, - {"M",0,0,1,0,0}, - {"I",0,0,1,0,0}, - {"V",0,0,0,1,0}, - {"7",0,0,0,1,0}, - {"v",0,0,0,1,0} + { "r", 0, "Compare files in which the messages are not in the same order. This option is time expensive.\n", 0, 1, 0 }, + { "b:", 0, 0, 0, 1, 0 }, + { "e", 0, "Edition independent compare. It is used to compare GRIB edition 1 and 2.\n", 0, 1, 0 }, + { "2", 0, "Enable two-way comparison.\n", 0, 1, 0 }, + { "c:", 0, 0, 0, 1, 0 }, + { "S:", "start", "First field to be processed.\n", 0, 1, 0 }, + { "E:", "end", "Last field to be processed.\n", 0, 1, 0 }, + { "a", 0, "-c option modifier. The keys listed with the option -c will be added to the list of keys compared without -c.\n", 0, 1, 0 }, + { "H", 0, "Compare only message headers (everything except data and bitmap). Bit-by-bit compare on. Incompatible with -c option.\n", 0, 1, 0 }, + { "R:", 0, 0, 0, 1, 0 }, + { "A:", 0, 0, 0, 1, 0 }, + { "P", 0, "Compare data values using the packing error as tolerance.\n", 0, 1, 0 }, + { "T:", "factor", "Compare data values using factor multiplied by the tolerance specified in options -P -R -A.\n", 0, 1, 0 }, + { "w:", 0, 0, 0, 1, 0 }, + { "f", 0, 0, 0, 1, 0 }, + { "F", 0, 0, 1, 0, 0 }, + { "q", 0, 0, 1, 0, 0 }, + { "M", 0, 0, 1, 0, 0 }, + { "I", 0, 0, 1, 0, 0 }, + { "V", 0, 0, 0, 1, 0 }, + { "7", 0, 0, 0, 1, 0 }, + { "v", 0, 0, 0, 1, 0 } }; -static grib_handle* global_handle=NULL; -static int global_counter=0; -static int theStart=-1; -static int theEnd=-1; +static grib_handle* global_handle = NULL; +static int global_counter = 0; +static int theStart = -1; +static int theEnd = -1; -const char* grib_tool_description= - "Compare GRIB messages contained in two files." - "\n\tIf some differences are found it fails returning an error code." - "\n\tFloating-point values are compared exactly by default, different tolerance can be defined see -P -A -R." - "\n\tDefault behaviour: absolute error=0, bit-by-bit compare, same order in files."; +const char* grib_tool_description = + "Compare GRIB messages contained in two files." + "\n\tIf some differences are found it fails returning an error code." + "\n\tFloating-point values are compared exactly by default, different tolerance can be defined see -P -A -R." + "\n\tDefault behaviour: absolute error=0, bit-by-bit compare, same order in files."; -const char* grib_tool_name="grib_compare"; -const char* grib_tool_usage="[options] grib_file1 grib_file2"; +const char* grib_tool_name = "grib_compare"; +const char* grib_tool_usage = "[options] grib_file1 grib_file2"; -int grib_options_count=sizeof(grib_options)/sizeof(grib_option); +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - return grib_tool(argc,argv); + return grib_tool(argc, argv); } int grib_tool_before_getopt(grib_runtime_options* options) @@ -177,35 +188,43 @@ int grib_tool_before_getopt(grib_runtime_options* options) int grib_tool_init(grib_runtime_options* options) { - int ret=0,i=0; - int nfiles=1; - const char orderby[]="md5Headers"; - grib_context* context=grib_context_get_default(); + int ret = 0, i = 0; + int nfiles = 1; + const char orderby[] = "md5Headers"; + grib_context* context = grib_context_get_default(); - options->strict=1; + options->strict = 1; if (grib_options_on("S:")) - theStart=atoi(grib_options_get_option("S:")); + theStart = atoi(grib_options_get_option("S:")); if (grib_options_on("E:")) - theEnd=atoi(grib_options_get_option("E:")); + theEnd = atoi(grib_options_get_option("E:")); - if (grib_options_on("f")) force=1; - else force=0; + if (grib_options_on("f")) + force = 1; + else + force = 0; - if (grib_options_on("2")) two_way=1; - else two_way=0; + if (grib_options_on("2")) + two_way = 1; + else + two_way = 0; verbose = grib_options_on("v"); - listFromCommandLine=0; + listFromCommandLine = 0; if (grib_options_on("c:") || grib_options_on("e")) - listFromCommandLine=1; + listFromCommandLine = 1; - if (grib_options_on("a")) onlyListed=0; - else onlyListed=1; + if (grib_options_on("a")) + onlyListed = 0; + else + onlyListed = 1; - if (grib_options_on("H")) headerMode=1; - else headerMode=0; + if (grib_options_on("H")) + headerMode = 1; + else + headerMode = 0; if (grib_options_on("H") && grib_options_on("c:")) { printf("Error: -H and -c options are incompatible. Choose one of the two please.\n"); @@ -217,33 +236,34 @@ int grib_tool_init(grib_runtime_options* options) } if (grib_options_on("b:")) { - grib_string_list *next=0; - blacklist=(grib_string_list*)grib_context_malloc_clear(context,sizeof(grib_string_list)); - blacklist->value=grib_context_strdup(context,options->set_values[0].name); - next=blacklist; - for (i=1;iset_values_count;i++) { - next->next=(grib_string_list*)grib_context_malloc_clear(context,sizeof(grib_string_list)); - next->next->value=grib_context_strdup(context,options->set_values[i].name); - next=next->next; + grib_string_list* next = 0; + blacklist = (grib_string_list*)grib_context_malloc_clear(context, sizeof(grib_string_list)); + blacklist->value = grib_context_strdup(context, options->set_values[0].name); + next = blacklist; + for (i = 1; i < options->set_values_count; i++) { + next->next = (grib_string_list*)grib_context_malloc_clear(context, sizeof(grib_string_list)); + next->next->value = grib_context_strdup(context, options->set_values[i].name); + next = next->next; } - context->blacklist=blacklist; + context->blacklist = blacklist; } if (grib_options_on("r")) { char* filename[1]; - filename[0]=options->infile_extra->name; - options->random=1; - options->orderby=strdup(orderby); - options->idx=grib_fieldset_new_from_files(context,filename, - nfiles,0,0,0,orderby,&ret); + filename[0] = options->infile_extra->name; + options->random = 1; + options->orderby = strdup(orderby); + options->idx = grib_fieldset_new_from_files(context, filename, + nfiles, 0, 0, 0, orderby, &ret); if (ret) { fprintf(stderr, "Unable to create index for input file %s (%s)", - options->infile_extra->name,grib_get_error_message(ret)); + options->infile_extra->name, grib_get_error_message(ret)); exit(ret); } - } else { - options->random=0; - options->infile_extra->file=fopen(options->infile_extra->name,"r"); + } + else { + options->random = 0; + options->infile_extra->file = fopen(options->infile_extra->name, "r"); if (!options->infile_extra->file) { perror(options->infile_extra->name); @@ -251,35 +271,36 @@ int grib_tool_init(grib_runtime_options* options) } } - global_tolerance=0; - compare_double= &compare_double_absolute; + global_tolerance = 0; + compare_double = &compare_double_absolute; if (grib_options_on("R:")) { - global_tolerance=0; - for (i=0;itolerance_count;i++) { - if (!strcmp((options->tolerance[i]).name,"all")) { - global_tolerance=(options->tolerance[i]).double_value; + global_tolerance = 0; + for (i = 0; i < options->tolerance_count; i++) { + if (!strcmp((options->tolerance[i]).name, "all")) { + global_tolerance = (options->tolerance[i]).double_value; break; } - if (!strcmp((options->tolerance[i]).name,"global")) { - global_tolerance=(options->tolerance[i]).double_value; + if (!strcmp((options->tolerance[i]).name, "global")) { + global_tolerance = (options->tolerance[i]).double_value; break; } } - compare_double= &compare_double_relative; - compareAbsolute=0; + compare_double = &compare_double_relative; + compareAbsolute = 0; } - if (grib_options_on("A:")){ + if (grib_options_on("A:")) { const char* absTolStr = grib_options_get_option("A:"); - char* endPtr = NULL; /* for error handling */ + char* endPtr = NULL; /* for error handling */ if (grib_options_on("R:")) { - maxAbsoluteError = strtod(absTolStr,&endPtr); + maxAbsoluteError = strtod(absTolStr, &endPtr); if (*endPtr) { fprintf(stderr, "Invalid absolute error: '%s'\n", absTolStr); exit(1); } - } else { - compare_double= &compare_double_absolute; - global_tolerance= strtod(absTolStr,&endPtr); + } + else { + compare_double = &compare_double_absolute; + global_tolerance = strtod(absTolStr, &endPtr); if (*endPtr) { fprintf(stderr, "Invalid absolute error: '%s'\n", absTolStr); exit(1); @@ -287,18 +308,18 @@ int grib_tool_init(grib_runtime_options* options) } } if (grib_options_on("P")) { - packingCompare=1; + packingCompare = 1; /* GRIB-972: Do not change the comparator yet. Not all GRIBs have packingError key! */ /*compare_double= &compare_double_absolute;*/ } if (grib_options_on("T:")) - tolerance_factor=atof(grib_options_get_option("T:")); + tolerance_factor = atof(grib_options_get_option("T:")); if (grib_options_on("R:")) { - char* sarg=grib_options_get_option("R:"); - options->tolerance_count=MAX_KEYS; - ret=parse_keyval_string(grib_tool_name, sarg,1,GRIB_TYPE_DOUBLE,options->tolerance,&(options->tolerance_count)); + char* sarg = grib_options_get_option("R:"); + options->tolerance_count = MAX_KEYS; + ret = parse_keyval_string(grib_tool_name, sarg, 1, GRIB_TYPE_DOUBLE, options->tolerance, &(options->tolerance_count)); if (ret == GRIB_INVALID_ARGUMENT) { usage(); exit(1); @@ -315,7 +336,7 @@ int grib_tool_init(grib_runtime_options* options) char bufr[2048] = {0,}; /* options->infile_extra->name is the 1st file */ sprintf(bufr, "%s%c%s", - infile->name, + infile->name, get_dir_separator_char(), extract_filename(options->infile_extra->name)); infile->name = strdup(bufr); @@ -326,136 +347,146 @@ int grib_tool_init(grib_runtime_options* options) return 0; } -int grib_tool_new_filename_action(grib_runtime_options* options,const char* file) { +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) +{ return 0; } -int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file) { +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) +{ return 0; } static void printInfo(grib_handle* h) { - char shortName[254]={0,}; - char levelType[254]={0,}; - char level[254]={0,}; - char paramId[254]={0,}; - char packingType[254]={0,}; - char gridType[254]={0,}; - char identifier[254]={0,}; - size_t len=254; - char stepRange[254]={0,}; - if (lastPrint==count) return; - - len=254; - grib_get_string(h,"shortName",shortName,&len); - len=254; - grib_get_string(h,"stepRange",stepRange,&len); - len=254; - grib_get_string(h,"levelType",levelType,&len); - len=254; - grib_get_string(h,"level",level,&len); - len=254; - grib_get_string(h,"paramId",paramId,&len); - len=254; - grib_get_string(h,"packingType",packingType,&len); - len=254; - grib_get_string(h,"gridType",gridType,&len); - len=254; - grib_get_string(h,"identifier",identifier,&len); + char shortName[254] = {0,}; + char levelType[254] = {0,}; + char level[254] = {0,}; + char paramId[254] = {0,}; + char packingType[254] = {0,}; + char gridType[254] = {0,}; + char identifier[254] = {0,}; + size_t len = 254; + char stepRange[254] = {0,}; + if (lastPrint == count) + return; - printf("\n-- %s #%d -- shortName=%s paramId=%s stepRange=%s levelType=%s level=%s packingType=%s gridType=%s --\n", - identifier,count,shortName,paramId,stepRange,levelType,level,packingType,gridType); - lastPrint=count; + len = 254; + grib_get_string(h, "shortName", shortName, &len); + len = 254; + grib_get_string(h, "stepRange", stepRange, &len); + len = 254; + grib_get_string(h, "levelType", levelType, &len); + len = 254; + grib_get_string(h, "level", level, &len); + len = 254; + grib_get_string(h, "paramId", paramId, &len); + len = 254; + grib_get_string(h, "packingType", packingType, &len); + len = 254; + grib_get_string(h, "gridType", gridType, &len); + len = 254; + grib_get_string(h, "identifier", identifier, &len); + printf("\n-- %s #%d -- shortName=%s paramId=%s stepRange=%s levelType=%s level=%s packingType=%s gridType=%s --\n", + identifier, count, shortName, paramId, stepRange, levelType, level, packingType, gridType); + lastPrint = count; } -static void print_index_key_values(grib_index* index,int counter) +static void print_index_key_values(grib_index* index, int counter) { - grib_index_key* keys=index->keys; - printf("== %d == ",counter); + grib_index_key* keys = index->keys; + printf("== %d == ", counter); while (keys) { - printf("%s=%s ",keys->name,keys->value); - keys=keys->next; + printf("%s=%s ", keys->name, keys->value); + keys = keys->next; } printf("\n"); } int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) { - int err=0; + int err = 0; count++; if (options->through_index) { - grib_index* idx1=options->index1; - verbose=0; + grib_index* idx1 = options->index1; + verbose = 0; global_counter++; - if ( theStart>0 && global_counter < theStart ) return 0; - if ( theEnd>0 && global_counter > theEnd ) { - options->stop=1; + if (theStart > 0 && global_counter < theStart) + return 0; + if (theEnd > 0 && global_counter > theEnd) { + options->stop = 1; return 0; } - grib_index_search_same(idx1,h); - global_handle=grib_handle_new_from_index(idx1,&err); + grib_index_search_same(idx1, h); + global_handle = grib_handle_new_from_index(idx1, &err); if (options->verbose) { - off_t offset=0; - char* filename=grib_get_field_file(options->index2,&offset); - printf("file1=\"%s\" ",filename); - filename=grib_get_field_file(options->index1,&offset); - printf("file2=\"%s\" \n",filename); - print_index_key_values(options->index1,global_counter); + off_t offset = 0; + char* filename = grib_get_field_file(options->index2, &offset); + printf("file1=\"%s\" ", filename); + filename = grib_get_field_file(options->index1, &offset); + printf("file2=\"%s\" \n", filename); + print_index_key_values(options->index1, global_counter); } if (!global_handle) { if (!options->verbose) - print_index_key_values(idx1,global_counter); - printf("====== NOT FOUND in %s\n",options->infile->name); + print_index_key_values(idx1, global_counter); + printf("====== NOT FOUND in %s\n", options->infile->name); } - if (!global_handle || err!= GRIB_SUCCESS ) { + if (!global_handle || err != GRIB_SUCCESS) { morein1++; - if (global_handle) grib_handle_delete(global_handle); + if (global_handle) + grib_handle_delete(global_handle); return 0; } - if(compare_handles(h,global_handle,options)) { + if (compare_handles(h, global_handle, options)) { error++; - if (!force) exit(1); + if (!force) + exit(1); } grib_handle_delete(global_handle); return 0; - - } else if (options->random) - global_handle = grib_fieldset_next_handle(options->idx,&err); + } + else if (options->random) + global_handle = grib_fieldset_next_handle(options->idx, &err); else - global_handle=grib_handle_new_from_file(h->context,options->infile_extra->file,&err); + global_handle = grib_handle_new_from_file(h->context, options->infile_extra->file, &err); - if (!global_handle || err!= GRIB_SUCCESS ) { + if (!global_handle || err != GRIB_SUCCESS) { morein2++; - if (global_handle) grib_handle_delete(global_handle); + if (global_handle) + grib_handle_delete(global_handle); return 0; } - if(compare_handles(global_handle,h,options)) { + if (compare_handles(global_handle, h, options)) { error++; if (!two_way) { /* If two_way mode: Don't exit yet. Show further differences */ - if (!force) exit(1); + if (!force) + exit(1); } } if (two_way) { /* ECC-651 and ECC-431 */ handles_swapped = 1; - if(compare_handles(h, global_handle, options)) { + if (compare_handles(h, global_handle, options)) { error++; - if (!force) exit(1); - } else { + if (!force) + exit(1); + } + else { if (error) { /* Error from first pass */ - if (!force) exit(1); + if (!force) + exit(1); } } } @@ -467,11 +498,11 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) { - int err=0; - if (!options->through_index && !options->random) { - global_handle=grib_handle_new_from_file(h->context,options->infile_extra->file,&err); + int err = 0; + if (!options->through_index && !options->random) { + global_handle = grib_handle_new_from_file(h->context, options->infile_extra->file, &err); - if (!global_handle || err!= GRIB_SUCCESS) + if (!global_handle || err != GRIB_SUCCESS) morein2++; grib_handle_delete(global_handle); @@ -483,103 +514,110 @@ int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) return 0; } -void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h) +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) { - grib_print_key_values(options,h); + grib_print_key_values(options, h); } int grib_tool_finalise_action(grib_runtime_options* options) { - grib_error* e=error_summary; - int err=0; - grib_context* c=grib_context_get_default(); + grib_error* e = error_summary; + int err = 0; + grib_context* c = grib_context_get_default(); /*if (grib_options_on("w:")) return 0;*/ - while ((global_handle=grib_handle_new_from_file(c,options->infile_extra->file,&err))) { + while ((global_handle = grib_handle_new_from_file(c, options->infile_extra->file, &err))) { morein1++; - if (global_handle) grib_handle_delete(global_handle); + if (global_handle) + grib_handle_delete(global_handle); } - error+=morein1+morein2; + error += morein1 + morein2; if (error) { printf("\n## ERRORS SUMMARY #######\n"); } - if (morein1>0) { + if (morein1 > 0) { printf("##\n## Different number of messages \n"); - printf("## %d more messages in %s than in %s\n",morein1, - options->infile_extra->name,options->infile->name); + printf("## %d more messages in %s than in %s\n", morein1, + options->infile_extra->name, options->infile->name); } - if (morein2>0) { + if (morein2 > 0) { printf("##\n## Different number of messages \n"); - printf("## %d more messages in %s than in %s\n",morein2, - options->infile->name,options->infile_extra->name); + printf("## %d more messages in %s than in %s\n", morein2, + options->infile->name, options->infile_extra->name); } if (error) { printf("##\n## Summary of different key values \n"); while (e) { - printf ("## %s ( %d different )\n",e->key,e->count); - e=e->next; + printf("## %s ( %d different )\n", e->key, e->count); + e = e->next; } - printf("##\n## %d different messages out of %d\n\n",error,count); + printf("##\n## %d different messages out of %d\n\n", error, count); } if (options->through_index) { grib_index_delete(options->index1); grib_index_delete(options->index2); } - if (error !=0) exit(1); + if (error != 0) + exit(1); return 0; } -static void save_error(grib_context* c,const char* key) +static void save_error(grib_context* c, const char* key) { - grib_error* e=0; - grib_error* next=0; - int saved=0; + grib_error* e = 0; + grib_error* next = 0; + int saved = 0; if (!error_summary) { - error_summary=(grib_error*)grib_context_malloc_clear(c,sizeof(grib_error)); - error_summary->count=1; - error_summary->key=grib_context_strdup(c,key); + error_summary = (grib_error*)grib_context_malloc_clear(c, sizeof(grib_error)); + error_summary->count = 1; + error_summary->key = grib_context_strdup(c, key); return; } - e=error_summary; - next=e; + e = error_summary; + next = e; while (next) { - if (!strcmp(next->key,key)) { + if (!strcmp(next->key, key)) { next->count++; - saved=1; + saved = 1; break; } - e=next; - next=next->next; + e = next; + next = next->next; } if (!saved) { - e->next=(grib_error*)grib_context_malloc_clear(c,sizeof(grib_error)); - e->next->count=1; - e->next->key=grib_context_strdup(c,key); + e->next = (grib_error*)grib_context_malloc_clear(c, sizeof(grib_error)); + e->next->count = 1; + e->next->key = grib_context_strdup(c, key); } } -static int test_bit(long a, long b) {return a&(1<cclass->name, "codeflag")==0) { + if (a && grib_inline_strcmp(a->cclass->name, "codeflag") == 0) { long i; - const long bytelen = a->length*8; - for(i=0; ilength * 8; + for (i = 0; i < bytelen; i++) { + if (test_bit(val, bytelen - i - 1)) + *result = '1'; + else + *result = '0'; result++; } return GRIB_SUCCESS; @@ -587,56 +625,54 @@ static int codeflag_to_bitstr(grib_accessor* a, long val, char* result) return GRIB_INVALID_TYPE; } -static int compare_values(grib_runtime_options* options,grib_handle* h1,grib_handle *h2,const char *name,int type) +static int compare_values(grib_runtime_options* options, grib_handle* h1, grib_handle* h2, const char* name, int type) { size_t len1 = 0; size_t len2 = 0; - int err=0,i=0; + int err = 0, i = 0; int err1; int err2; - int type1,type2; + int type1, type2; int countdiff; - int isangle=0; - int isMissing1,isMissing2; + int isangle = 0; + int isMissing1, isMissing2; - char *sval1 = NULL,*sval2 = NULL; - unsigned char *uval1 = NULL,*uval2 = NULL; + char *sval1 = NULL, *sval2 = NULL; + unsigned char *uval1 = NULL, *uval2 = NULL; double *dval1 = NULL, *dval2 = NULL; long *lval1 = NULL, *lval2 = NULL; - double maxdiff=0; - double packingError1=0,packingError2=0; - double value_tolerance=0; - grib_context* c=h1->context; - const char* first_str = (handles_swapped==0? "1st" : "2nd"); - const char* second_str = (handles_swapped==0? "2nd" : "1st"); - - type1=type; - type2=type; - if (verbose) printf(" comparing %s",name); + double maxdiff = 0; + double packingError1 = 0, packingError2 = 0; + double value_tolerance = 0; + grib_context* c = h1->context; + const char* first_str = (handles_swapped == 0 ? "1st" : "2nd"); + const char* second_str = (handles_swapped == 0 ? "2nd" : "1st"); + + type1 = type; + type2 = type; + if (verbose) + printf(" comparing %s", name); /* If key was blacklisted, then we should not have got here */ - DebugAssert( !blacklisted(name) ); + DebugAssert(!blacklisted(name)); - if( type1==GRIB_TYPE_UNDEFINED && (err = grib_get_native_type(h1,name,&type1)) != GRIB_SUCCESS) - { + if (type1 == GRIB_TYPE_UNDEFINED && (err = grib_get_native_type(h1, name, &type1)) != GRIB_SUCCESS) { printInfo(h1); - printf("Oops... cannot get type of [%s] in %s field: %s\n",name,first_str,grib_get_error_message(err)); - save_error(c,name); + printf("Oops... cannot get type of [%s] in %s field: %s\n", name, first_str, grib_get_error_message(err)); + save_error(c, name); return err; } - if(type2==GRIB_TYPE_UNDEFINED && (err = grib_get_native_type(h2,name,&type2)) != GRIB_SUCCESS) - { - if(err == GRIB_NOT_FOUND) - { + if (type2 == GRIB_TYPE_UNDEFINED && (err = grib_get_native_type(h2, name, &type2)) != GRIB_SUCCESS) { + if (err == GRIB_NOT_FOUND) { printInfo(h1); - printf("[%s] not found in %s field\n",name,second_str); - save_error(c,name); + printf("[%s] not found in %s field\n", name, second_str); + save_error(c, name); return err; } printInfo(h1); - printf("Oops... cannot get type of [%s] in %s field: %s\n",name,second_str,grib_get_error_message(err)); - save_error(c,name); + printf("Oops... cannot get type of [%s] in %s field: %s\n", name, second_str, grib_get_error_message(err)); + save_error(c, name); return err; } @@ -648,34 +684,31 @@ static int compare_values(grib_runtime_options* options,grib_handle* h1,grib_han } */ - if(type1 == GRIB_TYPE_LABEL) + if (type1 == GRIB_TYPE_LABEL) return err; - if(type1 == GRIB_TYPE_SECTION) + if (type1 == GRIB_TYPE_SECTION) return err; - if((err = grib_get_size(h1,name,&len1)) != GRIB_SUCCESS) - { + if ((err = grib_get_size(h1, name, &len1)) != GRIB_SUCCESS) { printInfo(h1); - printf("Oops... cannot get size of [%s] in %s field: %s\n",name,first_str,grib_get_error_message(err)); - save_error(c,name); + printf("Oops... cannot get size of [%s] in %s field: %s\n", name, first_str, grib_get_error_message(err)); + save_error(c, name); return err; } - if((err = grib_get_size(h2,name,&len2)) != GRIB_SUCCESS) - { - if(err == GRIB_NOT_FOUND) - { + if ((err = grib_get_size(h2, name, &len2)) != GRIB_SUCCESS) { + if (err == GRIB_NOT_FOUND) { printInfo(h1); - printf("[%s] not found in %s field\n",name,second_str); - save_error(c,name); + printf("[%s] not found in %s field\n", name, second_str); + save_error(c, name); return err; } printInfo(h1); - printf("Oops... cannot get size of [%s] in %s field: %s\n",name,second_str,grib_get_error_message(err)); - save_error(c,name); + printf("Oops... cannot get size of [%s] in %s field: %s\n", name, second_str, grib_get_error_message(err)); + save_error(c, name); return err; } @@ -692,399 +725,412 @@ static int compare_values(grib_runtime_options* options,grib_handle* h1,grib_han } */ - isMissing1= ( (grib_is_missing(h1,name,&err1)==1) && (err1 == 0) ) ? 1 : 0; - isMissing2= ( (grib_is_missing(h2,name,&err2)==1) && (err2 == 0) ) ? 1 : 0; + isMissing1 = ((grib_is_missing(h1, name, &err1) == 1) && (err1 == 0)) ? 1 : 0; + isMissing2 = ((grib_is_missing(h2, name, &err2) == 1) && (err2 == 0)) ? 1 : 0; - if ((isMissing1==1) && (isMissing2==1)) { - if (verbose) printf(" is set to missing in both fields\n"); + if ((isMissing1 == 1) && (isMissing2 == 1)) { + if (verbose) + printf(" is set to missing in both fields\n"); return GRIB_SUCCESS; } - if (isMissing1==1) { - if (verbose) printf(" is set to missing in %s field\n",first_str); + if (isMissing1 == 1) { + if (verbose) + printf(" is set to missing in %s field\n", first_str); printInfo(h1); - printf("%s is set to missing in %s field is not missing in %s field\n",name,first_str,second_str); + printf("%s is set to missing in %s field is not missing in %s field\n", name, first_str, second_str); err1 = GRIB_VALUE_MISMATCH; - save_error(c,name); + save_error(c, name); return GRIB_VALUE_MISMATCH; } - if (isMissing2==1) { - if (verbose) printf(" is set to missing in %s field\n",first_str); + if (isMissing2 == 1) { + if (verbose) + printf(" is set to missing in %s field\n", first_str); printInfo(h1); - printf("%s is set to missing in %s field is not missing in %s field\n",name,second_str,first_str); + printf("%s is set to missing in %s field is not missing in %s field\n", name, second_str, first_str); err1 = GRIB_VALUE_MISMATCH; - save_error(c,name); + save_error(c, name); return GRIB_VALUE_MISMATCH; } - switch(type1) - { - case GRIB_TYPE_STRING: - if (verbose) printf(" as string\n"); - grib_get_string_length(h1,name,&len1); - grib_get_string_length(h2,name,&len2); - sval1 = (char*)grib_context_malloc(h1->context,len1*sizeof(char)); - sval2 = (char*)grib_context_malloc(h2->context,len2*sizeof(char)); - - if((err1 = grib_get_string(h1,name,sval1,&len1)) != GRIB_SUCCESS) - { - printInfo(h1); - printf("Oops... cannot get string value of [%s] in %s field: %s\n", - name,first_str,grib_get_error_message(err1)); - save_error(c,name); - } + switch (type1) { + case GRIB_TYPE_STRING: + if (verbose) + printf(" as string\n"); + grib_get_string_length(h1, name, &len1); + grib_get_string_length(h2, name, &len2); + sval1 = (char*)grib_context_malloc(h1->context, len1 * sizeof(char)); + sval2 = (char*)grib_context_malloc(h2->context, len2 * sizeof(char)); - if((err2 = grib_get_string(h2,name,sval2,&len2)) != GRIB_SUCCESS) - { - printInfo(h1); - printf("Oops... cannot get string value of [%s] in %s field: %s\n", - name,second_str,grib_get_error_message(err2)); - save_error(c,name); - } + if ((err1 = grib_get_string(h1, name, sval1, &len1)) != GRIB_SUCCESS) { + printInfo(h1); + printf("Oops... cannot get string value of [%s] in %s field: %s\n", + name, first_str, grib_get_error_message(err1)); + save_error(c, name); + } - if(err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS) - { - if(grib_inline_strcmp(sval1,sval2) != 0) - { + if ((err2 = grib_get_string(h2, name, sval2, &len2)) != GRIB_SUCCESS) { printInfo(h1); - printf("string [%s]: [%s] != [%s]\n", - name,sval1,sval2); - err1 = GRIB_VALUE_MISMATCH; - save_error(c,name); + printf("Oops... cannot get string value of [%s] in %s field: %s\n", + name, second_str, grib_get_error_message(err2)); + save_error(c, name); } - else - { - /* ECC-136: string reps are the same, but integer values may not be */ - /* Note: Do not do this during edition-independent compare! */ - if (!listFromCommandLine) { - long v1, v2; - if (grib_get_long(h1,name,&v1) == GRIB_SUCCESS && - grib_get_long(h2,name,&v2) == GRIB_SUCCESS) - { - if (v1 != v2) - { - printInfo(h1); - save_error(c,name); - err1 = GRIB_VALUE_MISMATCH; - printf("long [%s]: [%ld] != [%ld]\n", name,v1,v2); + + if (err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS) { + if (grib_inline_strcmp(sval1, sval2) != 0) { + printInfo(h1); + printf("string [%s]: [%s] != [%s]\n", + name, sval1, sval2); + err1 = GRIB_VALUE_MISMATCH; + save_error(c, name); + } + else { + /* ECC-136: string reps are the same, but integer values may not be */ + /* Note: Do not do this during edition-independent compare! */ + if (!listFromCommandLine) { + long v1, v2; + if (grib_get_long(h1, name, &v1) == GRIB_SUCCESS && + grib_get_long(h2, name, &v2) == GRIB_SUCCESS) { + if (v1 != v2) { + printInfo(h1); + save_error(c, name); + err1 = GRIB_VALUE_MISMATCH; + printf("long [%s]: [%ld] != [%ld]\n", name, v1, v2); + } } } } } - } - grib_context_free(h1->context,sval1); - grib_context_free(h2->context,sval2); + grib_context_free(h1->context, sval1); + grib_context_free(h2->context, sval2); - if(err1) return err1; - if(err2) return err2; + if (err1) + return err1; + if (err2) + return err2; - break; + break; - case GRIB_TYPE_LONG: - if (verbose) printf(" as long\n"); + case GRIB_TYPE_LONG: + if (verbose) + printf(" as long\n"); - lval1 = (long*)grib_context_malloc(h1->context,len1*sizeof(long)); - lval2 = (long*)grib_context_malloc(h2->context,len2*sizeof(long)); + lval1 = (long*)grib_context_malloc(h1->context, len1 * sizeof(long)); + lval2 = (long*)grib_context_malloc(h2->context, len2 * sizeof(long)); - if((err1 = grib_get_long_array(h1,name,lval1,&len1)) != GRIB_SUCCESS) - { - printInfo(h1); - printf("Oops... cannot get long value of [%s] in %s field: %s\n", - name,first_str,grib_get_error_message(err1)); - save_error(c,name); - } - - if((err2 = grib_get_long_array(h2,name,lval2,&len2)) != GRIB_SUCCESS) - { - printInfo(h1); - printf("Oops... cannot get long value of [%s] in %s field: %s\n", - name,second_str,grib_get_error_message(err2)); - save_error(c,name); - } + if ((err1 = grib_get_long_array(h1, name, lval1, &len1)) != GRIB_SUCCESS) { + printInfo(h1); + printf("Oops... cannot get long value of [%s] in %s field: %s\n", + name, first_str, grib_get_error_message(err1)); + save_error(c, name); + } - if(err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS && len1!=len2) - { - printInfo(h1); - printf("Different size for \"%s\" [%ld] [%ld]\n",name,(long)len1,(long)len2); - save_error(c,name); - } - if(err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS && len1==len2) - { - countdiff=0; - for(i = 0; i < len1; i++) - if(lval1[i] != lval2[i]) countdiff++; + if ((err2 = grib_get_long_array(h2, name, lval2, &len2)) != GRIB_SUCCESS) { + printInfo(h1); + printf("Oops... cannot get long value of [%s] in %s field: %s\n", + name, second_str, grib_get_error_message(err2)); + save_error(c, name); + } - if (countdiff) { + if (err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS && len1 != len2) { printInfo(h1); - save_error(c,name); - err1 = GRIB_VALUE_MISMATCH; - if(len1 == 1) { - char buf1[128]={0,}; /* buffers to store the binary representation of codeflags */ - char buf2[128]={0,}; - grib_accessor* acc1=grib_find_accessor(h1, name); - grib_accessor* acc2=grib_find_accessor(h2, name); - printf("long [%s]: [%ld] != [%ld]", name,*lval1,*lval2); - if (codeflag_to_bitstr(acc1, *lval1, buf1)==GRIB_SUCCESS && codeflag_to_bitstr(acc2, *lval2, buf2)==GRIB_SUCCESS) { - printf(" ([%s] != [%s])", buf1, buf2); + printf("Different size for \"%s\" [%ld] [%ld]\n", name, (long)len1, (long)len2); + save_error(c, name); + } + if (err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS && len1 == len2) { + countdiff = 0; + for (i = 0; i < len1; i++) + if (lval1[i] != lval2[i]) + countdiff++; + + if (countdiff) { + printInfo(h1); + save_error(c, name); + err1 = GRIB_VALUE_MISMATCH; + if (len1 == 1) { + char buf1[128] = {0,}; /* buffers to store the binary representation of codeflags */ + char buf2[128] = {0,}; + grib_accessor* acc1 = grib_find_accessor(h1, name); + grib_accessor* acc2 = grib_find_accessor(h2, name); + printf("long [%s]: [%ld] != [%ld]", name, *lval1, *lval2); + if (codeflag_to_bitstr(acc1, *lval1, buf1) == GRIB_SUCCESS && codeflag_to_bitstr(acc2, *lval2, buf2) == GRIB_SUCCESS) { + printf(" ([%s] != [%s])", buf1, buf2); + } + printf("\n"); + } + else { + printf("long [%s] %d out of %ld different\n", name, countdiff, (long)len1); } - printf("\n"); - } - else { - printf("long [%s] %d out of %ld different\n", name,countdiff,(long)len1); } } - } - grib_context_free(h1->context,lval1); - grib_context_free(h2->context,lval2); - - if(err1) return err1; - if(err2) return err2; - break; - - case GRIB_TYPE_DOUBLE: - if (verbose) printf(" as double\n"); - dval1 = (double*)grib_context_malloc(h1->context,len1*sizeof(double)); - dval2 = (double*)grib_context_malloc(h2->context,len2*sizeof(double)); - - isangle=0; - value_tolerance=global_tolerance; - if (!grib_inline_strcmp(name,"packedValues") || !grib_inline_strcmp(name,"values") - || !grib_inline_strcmp(name,"codedValues")) { - packingError1=0; - packingError2=0; - err1=grib_get_double(h1,"packingError",&packingError1); - err2=grib_get_double(h2,"packingError",&packingError2); - if (packingCompare && !err1 && !err2) { - /* packingError specified by user and message supports it */ - /* GRIB-972: Not all GRIBs have packingError key! */ + grib_context_free(h1->context, lval1); + grib_context_free(h2->context, lval2); + + if (err1) + return err1; + if (err2) + return err2; + break; + + case GRIB_TYPE_DOUBLE: + if (verbose) + printf(" as double\n"); + dval1 = (double*)grib_context_malloc(h1->context, len1 * sizeof(double)); + dval2 = (double*)grib_context_malloc(h2->context, len2 * sizeof(double)); + + isangle = 0; + value_tolerance = global_tolerance; + if (!grib_inline_strcmp(name, "packedValues") || !grib_inline_strcmp(name, "values") || !grib_inline_strcmp(name, "codedValues")) { + packingError1 = 0; + packingError2 = 0; + err1 = grib_get_double(h1, "packingError", &packingError1); + err2 = grib_get_double(h2, "packingError", &packingError2); + if (packingCompare && !err1 && !err2) { + /* packingError specified by user and message supports it */ + /* GRIB-972: Not all GRIBs have packingError key! */ + value_tolerance = packingError1 > packingError2 ? packingError1 : packingError2; + compare_double = &compare_double_absolute; + compareAbsolute = 1; + } + } + else if (!grib_inline_strcmp(name, "unpackedValues")) { + packingError1 = 0; + packingError2 = 0; + err1 = grib_get_double(h1, "unpackedError", &packingError1); + err2 = grib_get_double(h2, "unpackedError", &packingError2); + if (packingCompare && !err1 && !err2) { + /* packingError specified by user and message supports it */ + /* GRIB-972: Not all GRIBs have unpackedError key! */ + value_tolerance = packingError1 > packingError2 ? packingError1 : packingError2; + compare_double = &compare_double_absolute; + compareAbsolute = 1; + } + } + else if (!grib_inline_rstrcmp(name, "InDegrees")) { + packingError1 = 0.0005; + packingError2 = 0.0005; + isangle = 1; value_tolerance = packingError1 > packingError2 ? packingError1 : packingError2; - compare_double= &compare_double_absolute; - compareAbsolute=1; } - } else if (!grib_inline_strcmp(name,"unpackedValues") ) { - packingError1=0; - packingError2=0; - err1=grib_get_double(h1,"unpackedError",&packingError1); - err2=grib_get_double(h2,"unpackedError",&packingError2); - if (packingCompare && !err1 && !err2) { - /* packingError specified by user and message supports it */ - /* GRIB-972: Not all GRIBs have unpackedError key! */ + else if (!grib_inline_strcmp(name, "referenceValue")) { + packingError1 = 0; + packingError2 = 0; + err1 = grib_get_double(h1, "referenceValueError", &packingError1); + err2 = grib_get_double(h2, "referenceValueError", &packingError2); value_tolerance = packingError1 > packingError2 ? packingError1 : packingError2; - compare_double= &compare_double_absolute; - compareAbsolute=1; } - } else if ( !grib_inline_rstrcmp(name,"InDegrees")) { - packingError1=0.0005; - packingError2=0.0005; - isangle=1; - value_tolerance = packingError1 > packingError2 ? packingError1 : packingError2; - } else if (!grib_inline_strcmp(name,"referenceValue") ) { - packingError1=0; - packingError2=0; - err1=grib_get_double(h1,"referenceValueError",&packingError1); - err2=grib_get_double(h2,"referenceValueError",&packingError2); - value_tolerance = packingError1 > packingError2 ? packingError1 : packingError2; - } - if (!compareAbsolute) { - int all_specified = 0; /* =1 if relative comparison with "all" specified */ - for (i=0;itolerance_count;i++) { - if (!strcmp((options->tolerance[i]).name, "all")) { - all_specified = 1; - value_tolerance=(options->tolerance[i]).double_value; - break; - } - } - if (!all_specified) { - for (i=0;itolerance_count;i++) { - if (!strcmp((options->tolerance[i]).name,name)) { - value_tolerance=(options->tolerance[i]).double_value; + if (!compareAbsolute) { + int all_specified = 0; /* =1 if relative comparison with "all" specified */ + for (i = 0; i < options->tolerance_count; i++) { + if (!strcmp((options->tolerance[i]).name, "all")) { + all_specified = 1; + value_tolerance = (options->tolerance[i]).double_value; break; } } + if (!all_specified) { + for (i = 0; i < options->tolerance_count; i++) { + if (!strcmp((options->tolerance[i]).name, name)) { + value_tolerance = (options->tolerance[i]).double_value; + break; + } + } + } } - } - - if((err1 = grib_get_double_array(h1,name,dval1,&len1)) != GRIB_SUCCESS) - { - printInfo(h1); - printf("Oops... cannot get double value of [%s] in %s field: %s\n", - name,first_str,grib_get_error_message(err1)); - save_error(c,name); - } - if((err2 = grib_get_double_array(h2,name,dval2,&len2)) != GRIB_SUCCESS) - { - printInfo(h1); - printf("Oops... cannot get double value of [%s] in %s field: %s\n", - name,second_str,grib_get_error_message(err2)); - save_error(c,name); - } + if ((err1 = grib_get_double_array(h1, name, dval1, &len1)) != GRIB_SUCCESS) { + printInfo(h1); + printf("Oops... cannot get double value of [%s] in %s field: %s\n", + name, first_str, grib_get_error_message(err1)); + save_error(c, name); + } - if(err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS && len1!=len2) - { - printInfo(h1); - printf("Different size for \"%s\" [%ld] [%ld]\n",name,(long)len1,(long)len2); - save_error(c,name); - } - if(err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS && len1==len2) - { - int imaxdiff; - double diff; - double *pv1,*pv2,dnew1,dnew2; - maxdiff=0; - imaxdiff=0; - countdiff=0; - pv1=dval1; - pv2=dval2; - if (isangle) { - dnew1=*dval1; dnew2=*dval2; - pv1=&dnew1; pv2=&dnew2; - if (*dval1 < 0 ) dnew1 += 360.0 ; - if (*dval2 < 0 ) dnew2 += 360.0 ; - if (*dval1 > 360 ) dnew1 -= 360.0 ; - if (*dval2 > 360 ) dnew2 -= 360.0 ; + if ((err2 = grib_get_double_array(h2, name, dval2, &len2)) != GRIB_SUCCESS) { + printInfo(h1); + printf("Oops... cannot get double value of [%s] in %s field: %s\n", + name, second_str, grib_get_error_message(err2)); + save_error(c, name); } - value_tolerance*=tolerance_factor; - if (verbose) { - printf(" (%d values) tolerance=%g \t",(int)len1,value_tolerance); - if (compare_double == &compare_double_absolute) printf("using compare_double_absolute"); - if (compare_double == &compare_double_relative) printf("using compare_double_relative"); - printf("\n"); + + if (err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS && len1 != len2) { + printInfo(h1); + printf("Different size for \"%s\" [%ld] [%ld]\n", name, (long)len1, (long)len2); + save_error(c, name); } - for(i = 0; i < len1; i++) { - if((diff=compare_double(pv1++, pv2++, value_tolerance))!=0) { - countdiff++; - if (maxdiff < diff) {maxdiff=diff;imaxdiff=i;} - err1 = GRIB_VALUE_MISMATCH; + if (err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS && len1 == len2) { + int imaxdiff; + double diff; + double *pv1, *pv2, dnew1, dnew2; + maxdiff = 0; + imaxdiff = 0; + countdiff = 0; + pv1 = dval1; + pv2 = dval2; + if (isangle) { + dnew1 = *dval1; + dnew2 = *dval2; + pv1 = &dnew1; + pv2 = &dnew2; + if (*dval1 < 0) + dnew1 += 360.0; + if (*dval2 < 0) + dnew2 += 360.0; + if (*dval1 > 360) + dnew1 -= 360.0; + if (*dval2 > 360) + dnew2 -= 360.0; + } + value_tolerance *= tolerance_factor; + if (verbose) { + printf(" (%d values) tolerance=%g \t", (int)len1, value_tolerance); + if (compare_double == &compare_double_absolute) + printf("using compare_double_absolute"); + if (compare_double == &compare_double_relative) + printf("using compare_double_relative"); + printf("\n"); + } + for (i = 0; i < len1; i++) { + if ((diff = compare_double(pv1++, pv2++, value_tolerance)) != 0) { + countdiff++; + if (maxdiff < diff) { + maxdiff = diff; + imaxdiff = i; + } + err1 = GRIB_VALUE_MISMATCH; + } } - } - if (countdiff) { - printInfo(h1); - save_error(c,name); - if (len1>1) { - printf("double [%s]: %d out of %ld different\n",name,countdiff,(long)len1); - if (compareAbsolute) printf(" max"); - printf(" absolute diff. = %.16e,",fabs(dval1[imaxdiff]-dval2[imaxdiff])); - if (!compareAbsolute) printf(" max"); - printf(" relative diff. = %g",relative_error(dval1[imaxdiff],dval2[imaxdiff],value_tolerance)); - printf("\n\tmax diff. element %d: %.20e %.20e", - imaxdiff,dval1[imaxdiff],dval2[imaxdiff]); - printf("\n\ttolerance=%.16e",value_tolerance); - if (packingError2!=0 || packingError1!=0) - printf(" packingError: [%g] [%g]",packingError1,packingError2); - - if (!grib_inline_strcmp(name,"packedValues") || !grib_inline_strcmp(name,"values") - || !grib_inline_strcmp(name,"codedValues")) { - double max1=0,min1=0,max2=0,min2=0; - /* Note: some packings like spectral do not have min,max */ - if (grib_get_double(h1,"max",&max1) == GRIB_SUCCESS && - grib_get_double(h1,"min",&min1) == GRIB_SUCCESS && - grib_get_double(h2,"max",&max2) == GRIB_SUCCESS && - grib_get_double(h2,"min",&min2) == GRIB_SUCCESS) - { - printf("\n\tvalues max= [%g] [%g] min= [%g] [%g]",max1,max2,min1,min2); + if (countdiff) { + printInfo(h1); + save_error(c, name); + if (len1 > 1) { + printf("double [%s]: %d out of %ld different\n", name, countdiff, (long)len1); + if (compareAbsolute) + printf(" max"); + printf(" absolute diff. = %.16e,", fabs(dval1[imaxdiff] - dval2[imaxdiff])); + if (!compareAbsolute) + printf(" max"); + printf(" relative diff. = %g", relative_error(dval1[imaxdiff], dval2[imaxdiff], value_tolerance)); + printf("\n\tmax diff. element %d: %.20e %.20e", + imaxdiff, dval1[imaxdiff], dval2[imaxdiff]); + printf("\n\ttolerance=%.16e", value_tolerance); + if (packingError2 != 0 || packingError1 != 0) + printf(" packingError: [%g] [%g]", packingError1, packingError2); + + if (!grib_inline_strcmp(name, "packedValues") || !grib_inline_strcmp(name, "values") || !grib_inline_strcmp(name, "codedValues")) { + double max1 = 0, min1 = 0, max2 = 0, min2 = 0; + /* Note: some packings like spectral do not have min,max */ + if (grib_get_double(h1, "max", &max1) == GRIB_SUCCESS && + grib_get_double(h1, "min", &min1) == GRIB_SUCCESS && + grib_get_double(h2, "max", &max2) == GRIB_SUCCESS && + grib_get_double(h2, "min", &min2) == GRIB_SUCCESS) { + printf("\n\tvalues max= [%g] [%g] min= [%g] [%g]", max1, max2, min1, min2); + } } + printf("\n"); + } + else { + printf("double [%s]: [%.20e] != [%.20e]\n", + name, dval1[0], dval2[0]); + printf("\tabsolute diff. = %g,", fabs(dval1[0] - dval2[0])); + printf(" relative diff. = %g\n", relative_error(dval1[0], dval2[0], value_tolerance)); + printf("\ttolerance=%g\n", value_tolerance); } - printf("\n"); - } else { - printf("double [%s]: [%.20e] != [%.20e]\n", - name,dval1[0],dval2[0]); - printf("\tabsolute diff. = %g,",fabs(dval1[0]-dval2[0])); - printf(" relative diff. = %g\n",relative_error(dval1[0],dval2[0],value_tolerance)); - printf("\ttolerance=%g\n",value_tolerance); } } - } - grib_context_free(h1->context,dval1); - grib_context_free(h2->context,dval2); + grib_context_free(h1->context, dval1); + grib_context_free(h2->context, dval2); - if(err1) return err1; - if(err2) return err2; - break; - - case GRIB_TYPE_BYTES: - if (verbose) printf(" as bytes\n"); - if (len1<2) len1=512; - if (len2<2) len2=512; - uval1 = (unsigned char*)grib_context_malloc(h1->context,len1*sizeof(unsigned char)); - uval2 = (unsigned char*)grib_context_malloc(h2->context,len2*sizeof(unsigned char)); + if (err1) + return err1; + if (err2) + return err2; + break; - if((err1 = grib_get_bytes(h1,name,uval1,&len1)) != GRIB_SUCCESS) - { - printInfo(h1); - save_error(c,name); - printf("Oops... cannot get bytes value of [%s] in %s field: %s\n", - name,first_str,grib_get_error_message(err1)); - } + case GRIB_TYPE_BYTES: + if (verbose) + printf(" as bytes\n"); + if (len1 < 2) + len1 = 512; + if (len2 < 2) + len2 = 512; + uval1 = (unsigned char*)grib_context_malloc(h1->context, len1 * sizeof(unsigned char)); + uval2 = (unsigned char*)grib_context_malloc(h2->context, len2 * sizeof(unsigned char)); + + if ((err1 = grib_get_bytes(h1, name, uval1, &len1)) != GRIB_SUCCESS) { + printInfo(h1); + save_error(c, name); + printf("Oops... cannot get bytes value of [%s] in %s field: %s\n", + name, first_str, grib_get_error_message(err1)); + } - if((err2 = grib_get_bytes(h2,name,uval2,&len2)) != GRIB_SUCCESS) - { - printInfo(h1); - save_error(c,name); - printf("Oops... cannot get bytes value of [%s] in %s field: %s\n", - name,second_str,grib_get_error_message(err2)); - } + if ((err2 = grib_get_bytes(h2, name, uval2, &len2)) != GRIB_SUCCESS) { + printInfo(h1); + save_error(c, name); + printf("Oops... cannot get bytes value of [%s] in %s field: %s\n", + name, second_str, grib_get_error_message(err2)); + } - if(err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS) - { - if(memcmp(uval1,uval2,len1) != 0) - { - for(i = 0; i < len1; i++) - if(uval1[i] != uval2[i]) - { - printInfo(h1); - save_error(c,name); - if(len1 == 1) - printf("[%s] byte values are different: [%02x] and [%02x]\n", - name,uval1[i],uval2[i]); - else - printf("[%s] byte value %d of %ld is different: [%02x] and [%02x]\n", - name,i,(long)len1,uval1[i],uval2[i]); + if (err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS) { + if (memcmp(uval1, uval2, len1) != 0) { + for (i = 0; i < len1; i++) + if (uval1[i] != uval2[i]) { + printInfo(h1); + save_error(c, name); + if (len1 == 1) + printf("[%s] byte values are different: [%02x] and [%02x]\n", + name, uval1[i], uval2[i]); + else + printf("[%s] byte value %d of %ld is different: [%02x] and [%02x]\n", + name, i, (long)len1, uval1[i], uval2[i]); - err1 = GRIB_VALUE_MISMATCH; - break; - } - err1 = GRIB_VALUE_MISMATCH; + err1 = GRIB_VALUE_MISMATCH; + break; + } + err1 = GRIB_VALUE_MISMATCH; + } } - } - grib_context_free(h1->context,uval1); - grib_context_free(h2->context,uval2); + grib_context_free(h1->context, uval1); + grib_context_free(h2->context, uval2); - if(err1) return err1; - if(err2) return err2; - break; + if (err1) + return err1; + if (err2) + return err2; + break; - case GRIB_TYPE_LABEL: - if (verbose) printf(" as label\n"); - break; + case GRIB_TYPE_LABEL: + if (verbose) + printf(" as label\n"); + break; - default: - if (verbose) printf("\n"); - printInfo(h1); - save_error(c,name); - printf("Cannot compare [%s], unsupported type %d\n",name,type1); - return GRIB_UNABLE_TO_COMPARE_ACCESSORS; + default: + if (verbose) + printf("\n"); + printInfo(h1); + save_error(c, name); + printf("Cannot compare [%s], unsupported type %d\n", name, type1); + return GRIB_UNABLE_TO_COMPARE_ACCESSORS; } return GRIB_SUCCESS; } -static int compare_handles(grib_handle* h1,grib_handle* h2,grib_runtime_options* options) +static int compare_handles(grib_handle* h1, grib_handle* h2, grib_runtime_options* options) { - int err = 0; - int i=0; - const char* name=NULL; - grib_keys_iterator* iter = NULL; + int err = 0; + int i = 0; + const char* name = NULL; + grib_keys_iterator* iter = NULL; /* mask only if no -c option or headerMode (-H)*/ - if (blacklist && ( !listFromCommandLine || headerMode )) { + if (blacklist && (!listFromCommandLine || headerMode)) { /* See ECC-245, GRIB-573, GRIB-915: Do not change handles in memory */ /* grib_string_list* nextb=blacklist; while (nextb) { @@ -1095,32 +1141,33 @@ static int compare_handles(grib_handle* h1,grib_handle* h2,grib_runtime_options* } if (headerMode) { - const void *msg1=NULL,*msg2=NULL; - size_t size1=0,size2=0; + const void *msg1 = NULL, *msg2 = NULL; + size_t size1 = 0, size2 = 0; grib_handle *h11, *h22; - GRIB_CHECK_NOLINE(grib_get_message_headers(h1,&msg1,&size1),0); - GRIB_CHECK_NOLINE(grib_get_message_headers(h2,&msg2,&size2),0); - if (size1==size2 && !memcmp(msg1,msg2,size1)) + GRIB_CHECK_NOLINE(grib_get_message_headers(h1, &msg1, &size1), 0); + GRIB_CHECK_NOLINE(grib_get_message_headers(h2, &msg2, &size2), 0); + if (size1 == size2 && !memcmp(msg1, msg2, size1)) return 0; - err=0; - h11=grib_handle_new_from_partial_message(h1->context,msg1,size1); - h22=grib_handle_new_from_partial_message(h1->context,msg2,size2); + err = 0; + h11 = grib_handle_new_from_partial_message(h1->context, msg1, size1); + h22 = grib_handle_new_from_partial_message(h1->context, msg2, size2); - iter=grib_keys_iterator_new(h11, GRIB_KEYS_ITERATOR_SKIP_COMPUTED, NULL); + iter = grib_keys_iterator_new(h11, GRIB_KEYS_ITERATOR_SKIP_COMPUTED, NULL); if (!iter) { printf("ERROR: unable to get keys iterator\n"); exit(1); } - while(grib_keys_iterator_next(iter)) - { - name=grib_keys_iterator_get_name(iter); + while (grib_keys_iterator_next(iter)) { + name = grib_keys_iterator_get_name(iter); /*printf("----- comparing %s\n",name);*/ - if (blacklisted(name)) continue; - if(compare_values(options,h11,h22,name,GRIB_TYPE_UNDEFINED)) err++; + if (blacklisted(name)) + continue; + if (compare_values(options, h11, h22, name, GRIB_TYPE_UNDEFINED)) + err++; } grib_keys_iterator_delete(iter); @@ -1129,75 +1176,83 @@ static int compare_handles(grib_handle* h1,grib_handle* h2,grib_runtime_options* return err; } - if ( listFromCommandLine && onlyListed ) { - for (i=0; i< options->compare_count; i++) { - if (blacklisted(options->compare[i].name)) continue; + if (listFromCommandLine && onlyListed) { + for (i = 0; i < options->compare_count; i++) { + if (blacklisted(options->compare[i].name)) + continue; if (options->compare[i].type == GRIB_NAMESPACE) { - iter=grib_keys_iterator_new(h1, 0, options->compare[i].name); + iter = grib_keys_iterator_new(h1, 0, options->compare[i].name); if (!iter) { printf("ERROR: unable to get keys iterator\n"); exit(1); } - while(grib_keys_iterator_next(iter)) - { - name=grib_keys_iterator_get_name(iter); + while (grib_keys_iterator_next(iter)) { + name = grib_keys_iterator_get_name(iter); /*printf("----- comparing %s\n",name);*/ - if (blacklisted(name)) continue; - if(compare_values(options,h1,h2,name,GRIB_TYPE_UNDEFINED)) err++; + if (blacklisted(name)) + continue; + if (compare_values(options, h1, h2, name, GRIB_TYPE_UNDEFINED)) + err++; } grib_keys_iterator_delete(iter); - } else { - if( compare_values(options,h1,h2,options->compare[i].name,options->compare[i].type)) + } + else { + if (compare_values(options, h1, h2, options->compare[i].name, options->compare[i].type)) err++; } } - } else { - const void *msg1=NULL,*msg2=NULL; - size_t size1=0,size2=0; - GRIB_CHECK_NOLINE(grib_get_message(h1,&msg1,&size1),0); - GRIB_CHECK_NOLINE(grib_get_message(h2,&msg2,&size2),0); - if (size1==size2 && !memcmp(msg1,msg2,size1)) + } + else { + const void *msg1 = NULL, *msg2 = NULL; + size_t size1 = 0, size2 = 0; + GRIB_CHECK_NOLINE(grib_get_message(h1, &msg1, &size1), 0); + GRIB_CHECK_NOLINE(grib_get_message(h2, &msg2, &size2), 0); + if (size1 == size2 && !memcmp(msg1, msg2, size1)) return 0; - iter=grib_keys_iterator_new(h1,GRIB_KEYS_ITERATOR_SKIP_COMPUTED,NULL); + iter = grib_keys_iterator_new(h1, GRIB_KEYS_ITERATOR_SKIP_COMPUTED, NULL); if (!iter) { printf("ERROR: unable to get keys iterator\n"); exit(1); } - while(grib_keys_iterator_next(iter)) - { - name=grib_keys_iterator_get_name(iter); + while (grib_keys_iterator_next(iter)) { + name = grib_keys_iterator_get_name(iter); /*printf("----- comparing %s\n",name);*/ - if (blacklisted(name)) continue; - if(compare_values(options,h1,h2,name,GRIB_TYPE_UNDEFINED)) err++; + if (blacklisted(name)) + continue; + if (compare_values(options, h1, h2, name, GRIB_TYPE_UNDEFINED)) + err++; } grib_keys_iterator_delete(iter); - if ( listFromCommandLine ) { - for (i=0; i< options->compare_count; i++) { - if (blacklisted(options->compare[i].name)) continue; + if (listFromCommandLine) { + for (i = 0; i < options->compare_count; i++) { + if (blacklisted(options->compare[i].name)) + continue; if (options->compare[i].type == GRIB_NAMESPACE) { - iter=grib_keys_iterator_new(h1, 0, options->compare[i].name); + iter = grib_keys_iterator_new(h1, 0, options->compare[i].name); if (!iter) { - printf("ERROR: unable to get iterator for %s\n",options->compare[i].name ); + printf("ERROR: unable to get iterator for %s\n", options->compare[i].name); exit(1); } - while(grib_keys_iterator_next(iter)) - { - name=grib_keys_iterator_get_name(iter); + while (grib_keys_iterator_next(iter)) { + name = grib_keys_iterator_get_name(iter); /*printf("----- comparing %s\n",name);*/ - if (blacklisted(name)) continue; - if(compare_values(options,h1,h2,name,GRIB_TYPE_UNDEFINED)) err++; + if (blacklisted(name)) + continue; + if (compare_values(options, h1, h2, name, GRIB_TYPE_UNDEFINED)) + err++; } grib_keys_iterator_delete(iter); - } else { - if( compare_values(options,h1,h2,options->compare[i].name,options->compare[i].type)) + } + else { + if (compare_values(options, h1, h2, options->compare[i].name, options->compare[i].type)) err++; } } @@ -1208,6 +1263,6 @@ static int compare_handles(grib_handle* h1,grib_handle* h2,grib_runtime_options* int grib_no_handle_action(grib_runtime_options* options, int err) { - fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\t\t\"ERROR: unreadable message\"\n"); return 0; } diff --git a/tools/grib_copy.c b/tools/grib_copy.c index 33f30e2da..ef4d4fc3c 100644 --- a/tools/grib_copy.c +++ b/tools/grib_copy.c @@ -15,49 +15,51 @@ #include "grib_tools.h" -const char* grib_tool_description="Copies the content of GRIB files printing" - " values of some keys." - "\n\tIf the name of the output_grib_file contains a key enclosed in square brackets, its value will be used."; -const char* grib_tool_name="grib_copy"; -const char* grib_tool_usage="[options] grib_file grib_file ... output_grib_file"; - -grib_option grib_options[]={ - /* {id, args, help}, on, command_line, value */ - {"f",0,0,0,1,0}, - {"c",0,0,1,0,0}, - {"r",0,0,0,1,0}, - {"q",0,0,1,0,0}, - {"p:",0,0,1,1,0}, - {"P:",0,0,0,1,0}, - {"w:","key[:{s|d|i}]{=|!=}value,key[:{s|d|i}]=value,...","\n\t\tWhere clause." - "\n\t\tOnly GRIB messages matching the key/value constraints are copied to the output_grib_file." - "\n\t\tA valid constraint is of type key=value or key!=value." - "\n\t\tFor each key a string (key:s), a " - "double (key:d) or an integer (key:i)\n\t\ttype can be defined. Default type is string." - "\n\t\tIn the value you can also use the forward-slash character '/' to specify an OR condition (i.e. a logical disjunction)" - "\n\t\tNote: only one -w clause is allowed.\n",0,1,0}, - {"B:",0,0,0,1,0}, - /*{"s:",0,0,0,1,0},*/ - {"V",0,0,0,1,0}, - {"W:",0,0,0,1,0}, - {"M",0,0,0,1,0}, - {"U",0,0,1,0,0}, - {"H",0,0,1,0,0}, - {"T:",0,0,0,1,0}, - {"S",0,0,1,0,0}, - {"g",0,0,0,1,0}, - {"G",0,0,0,1,0}, - {"7",0,0,0,1,0}, - {"X:",0,0,0,1,0}, - {"v",0,0,0,1,0} +const char* grib_tool_description = + "Copies the content of GRIB files printing" + " values of some keys." + "\n\tIf the name of the output_grib_file contains a key enclosed in square brackets, its value will be used."; +const char* grib_tool_name = "grib_copy"; +const char* grib_tool_usage = "[options] grib_file grib_file ... output_grib_file"; + +grib_option grib_options[] = { + /* {id, args, help}, on, command_line, value */ + { "f", 0, 0, 0, 1, 0 }, + { "c", 0, 0, 1, 0, 0 }, + { "r", 0, 0, 0, 1, 0 }, + { "q", 0, 0, 1, 0, 0 }, + { "p:", 0, 0, 1, 1, 0 }, + { "P:", 0, 0, 0, 1, 0 }, + { "w:", "key[:{s|d|i}]{=|!=}value,key[:{s|d|i}]=value,...", + "\n\t\tWhere clause." + "\n\t\tOnly GRIB messages matching the key/value constraints are copied to the output_grib_file." + "\n\t\tA valid constraint is of type key=value or key!=value." + "\n\t\tFor each key a string (key:s), a " + "double (key:d) or an integer (key:i)\n\t\ttype can be defined. Default type is string." + "\n\t\tIn the value you can also use the forward-slash character '/' to specify an OR condition (i.e. a logical disjunction)" + "\n\t\tNote: only one -w clause is allowed.\n", + 0, 1, 0 }, + { "B:", 0, 0, 0, 1, 0 }, + /*{"s:",0,0,0,1,0},*/ + { "V", 0, 0, 0, 1, 0 }, + { "W:", 0, 0, 0, 1, 0 }, + { "M", 0, 0, 0, 1, 0 }, + { "U", 0, 0, 1, 0, 0 }, + { "H", 0, 0, 1, 0, 0 }, + { "T:", 0, 0, 0, 1, 0 }, + { "S", 0, 0, 1, 0, 0 }, + { "g", 0, 0, 0, 1, 0 }, + { "G", 0, 0, 0, 1, 0 }, + { "7", 0, 0, 0, 1, 0 }, + { "X:", 0, 0, 0, 1, 0 }, + { "v", 0, 0, 0, 1, 0 } }; -int grib_options_count=sizeof(grib_options)/sizeof(grib_option); +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - int ret=grib_tool(argc,argv); - return ret; + return grib_tool(argc, argv); } int grib_tool_before_getopt(grib_runtime_options* options) @@ -85,12 +87,12 @@ int grib_tool_init(grib_runtime_options* options) return 0; } -int grib_tool_new_filename_action(grib_runtime_options* options,const char* file) +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) { return 0; } -int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file) +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { exit_if_input_is_directory(grib_tool_name, file->name); return 0; @@ -99,7 +101,7 @@ int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* fil int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) { double* v; - size_t size=0; + size_t size = 0; /* For '-s' option if (!options->skip) { @@ -110,20 +112,20 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) } */ - if ( options->repack ) { - GRIB_CHECK_NOLINE(grib_get_size(h,"values",&size),0); + if (options->repack) { + GRIB_CHECK_NOLINE(grib_get_size(h, "values", &size), 0); - v = (double*)calloc(size,sizeof(double)); - if(!v) { - fprintf(stderr,"failed to allocate %ld bytes\n",(long)(size*sizeof(double))); + v = (double*)calloc(size, sizeof(double)); + if (!v) { + fprintf(stderr, "failed to allocate %ld bytes\n", (long)(size * sizeof(double))); exit(1); } - GRIB_CHECK_NOLINE(grib_get_double_array(h,"values",v,&size),0); - GRIB_CHECK_NOLINE(grib_set_double_array(h,"values",v,size),0); + GRIB_CHECK_NOLINE(grib_get_double_array(h, "values", v, &size), 0); + GRIB_CHECK_NOLINE(grib_set_double_array(h, "values", v, size), 0); free(v); } - grib_tools_write_message(options,h); + grib_tools_write_message(options, h); return 0; } @@ -133,14 +135,14 @@ int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) return 0; } -void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h) +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) { - grib_print_key_values(options,h); + grib_print_key_values(options, h); } int grib_tool_finalise_action(grib_runtime_options* options) { - int err=0; + int err = 0; grib_file_close_all(&err); if (err != GRIB_SUCCESS) { perror(grib_tool_name); @@ -153,6 +155,6 @@ int grib_tool_finalise_action(grib_runtime_options* options) int grib_no_handle_action(grib_runtime_options* options, int err) { - fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\t\t\"ERROR: unreadable message\"\n"); return 0; } diff --git a/tools/grib_dump.c b/tools/grib_dump.c index 866331f2f..7182377cd 100644 --- a/tools/grib_dump.c +++ b/tools/grib_dump.c @@ -15,46 +15,46 @@ #include "grib_tools.h" -grib_option grib_options[]={ - /* {id, args, help}, on, command_line, value*/ - {"S",0,0,1,0,0}, - {"O",0,"Octet mode. WMO documentation style dump.\n",0,1,0}, - {"D",0,0,0,1,0}, - {"d",0,"Print all data values.\n",0,1,0}, - {"j",0,0,0,1,0}, - /* {"C",0,0,0,1,0}, */ /* See ECC-234 */ - {"t",0,0,0,1,0}, - {"H",0,0,0,1,0}, - {"a",0,0,0,1,0}, - {"w:",0,0,0,1,0}, - {"s:",0,0,0,1,0}, - {"M",0,0,0,1,0}, - {"T:",0,0,0,1,0}, - {"7",0,0,0,1,0}, - {"V",0,0,0,1,0}, - {"q",0,0,1,0,0}, - {"p:","key1,key2,...", - "\n\t\tDeclaration of keys to dump. Only those keys are dumped (not the whole message).\n",0,1,0}, - {"X:",0,0,0,1,0}, - {"x",0,0,0,1,0} +grib_option grib_options[] = { + /* {id, args, help}, on, command_line, value*/ + { "S", 0, 0, 1, 0, 0 }, + { "O", 0, "Octet mode. WMO documentation style dump.\n", 0, 1, 0 }, + { "D", 0, 0, 0, 1, 0 }, + { "d", 0, "Print all data values.\n", 0, 1, 0 }, + { "j", 0, 0, 0, 1, 0 }, + /* {"C",0,0,0,1,0}, */ /* See ECC-234 */ + { "t", 0, 0, 0, 1, 0 }, + { "H", 0, 0, 0, 1, 0 }, + { "a", 0, 0, 0, 1, 0 }, + { "w:", 0, 0, 0, 1, 0 }, + { "s:", 0, 0, 0, 1, 0 }, + { "M", 0, 0, 0, 1, 0 }, + { "T:", 0, 0, 0, 1, 0 }, + { "7", 0, 0, 0, 1, 0 }, + { "V", 0, 0, 0, 1, 0 }, + { "q", 0, 0, 1, 0, 0 }, + { "p:", "key1,key2,...", + "\n\t\tDeclaration of keys to dump. Only those keys are dumped (not the whole message).\n", 0, 1, 0 }, + { "X:", 0, 0, 0, 1, 0 }, + { "x", 0, 0, 0, 1, 0 } }; -const char* grib_tool_description="Dump the content of a GRIB file in different formats."; -const char* grib_tool_name="grib_dump"; -const char* grib_tool_usage="[options] grib_file grib_file ..."; -static int json=0; -static int first_handle=1; -static int dump_keys=0; +const char* grib_tool_description = "Dump the content of a GRIB file in different formats."; +const char* grib_tool_name = "grib_dump"; +const char* grib_tool_usage = "[options] grib_file grib_file ..."; +static int json = 0; +static int first_handle = 1; +static int dump_keys = 0; -int grib_options_count=sizeof(grib_options)/sizeof(grib_option); +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); /** * grib_dump * Dump the contents of a GRIB file */ -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - return grib_tool(argc,argv); + return grib_tool(argc, argv); } int grib_tool_before_getopt(grib_runtime_options* options) @@ -64,18 +64,18 @@ int grib_tool_before_getopt(grib_runtime_options* options) int grib_tool_init(grib_runtime_options* options) { - int opt=grib_options_on("C")+grib_options_on("O")+grib_options_on("D")+grib_options_on("j"); + int opt = grib_options_on("C") + grib_options_on("O") + grib_options_on("D") + grib_options_on("j"); options->dump_mode = "default"; if (opt > 1) { - printf("%s: simultaneous j/O/D options not allowed\n",grib_tool_name); + printf("%s: simultaneous j/O/D options not allowed\n", grib_tool_name); exit(1); } if (grib_options_on("j")) { options->dump_mode = "json"; - json=1; + json = 1; } /* See ECC-234 @@ -88,18 +88,14 @@ int grib_tool_init(grib_runtime_options* options) } */ - if (grib_options_on("O")) { - options->dump_mode = "wmo"; - options->dump_flags = GRIB_DUMP_FLAG_CODED - | GRIB_DUMP_FLAG_OCTECT - | GRIB_DUMP_FLAG_VALUES - | GRIB_DUMP_FLAG_READ_ONLY; + if (grib_options_on("O")) { + options->dump_mode = "wmo"; + options->dump_flags = GRIB_DUMP_FLAG_CODED | GRIB_DUMP_FLAG_OCTECT | GRIB_DUMP_FLAG_VALUES | GRIB_DUMP_FLAG_READ_ONLY; } if (grib_options_on("D")) { - options->dump_mode = "debug"; - options->dump_flags = GRIB_DUMP_FLAG_VALUES - | GRIB_DUMP_FLAG_READ_ONLY; + options->dump_mode = "debug"; + options->dump_flags = GRIB_DUMP_FLAG_VALUES | GRIB_DUMP_FLAG_READ_ONLY; } if (grib_options_on("a")) @@ -112,48 +108,48 @@ int grib_tool_init(grib_runtime_options* options) options->dump_flags |= GRIB_DUMP_FLAG_HEXADECIMAL; /* In JSON mode we want to print all data values */ - if ( grib_options_on("d") || grib_options_on("j") ) + if (grib_options_on("d") || grib_options_on("j")) options->dump_flags |= GRIB_DUMP_FLAG_ALL_DATA; - dump_keys=grib_options_on("p:"); + dump_keys = grib_options_on("p:"); return 0; } -int grib_tool_new_filename_action(grib_runtime_options* options,const char* file) +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) { return 0; } -int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file) +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { char tmp[1024]; - if (!options->current_infile->name) return 0; - if (json) return 0; + if (!options->current_infile->name) + return 0; + if (json) + return 0; exit_if_input_is_directory(grib_tool_name, file->name); - sprintf(tmp,"FILE: %s ",options->current_infile->name); + sprintf(tmp, "FILE: %s ", options->current_infile->name); if (!grib_options_on("C")) - fprintf(stdout,"***** %s\n",tmp); + fprintf(stdout, "***** %s\n", tmp); /* * In debug dump mode, allow dumping of GRIB index files */ - if (strcmp(options->dump_mode, "debug")==0) - { - if (is_grib_index_file(options->current_infile->name)) - { - int err = 0; - grib_context* c = grib_context_get_default(); + if (strcmp(options->dump_mode, "debug") == 0) { + if (is_grib_index_file(options->current_infile->name)) { + int err = 0; + grib_context* c = grib_context_get_default(); const char* filename = options->current_infile->name; err = grib_index_dump_file(stdout, filename); if (err) { grib_context_log(c, GRIB_LOG_ERROR, "%s: Could not dump index file \"%s\".\n%s\n", - grib_tool_name, - filename, - grib_get_error_message(err)); + grib_tool_name, + filename, + grib_get_error_message(err)); exit(1); } /* Since there are no GRIB messages, we have to stop tool exiting in case there @@ -167,32 +163,34 @@ int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* fil int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) { - long length=0; - int i,err=0; + long length = 0; + int i, err = 0; grib_context* c = h->context; - if (grib_get_long(h,"totalLength",&length) != GRIB_SUCCESS) - length=-9999; + if (grib_get_long(h, "totalLength", &length) != GRIB_SUCCESS) + length = -9999; if (!options->skip) { if (options->set_values_count != 0) - err=grib_set_values(h,options->set_values,options->set_values_count); - if( err != GRIB_SUCCESS && options->fail) exit(err); + err = grib_set_values(h, options->set_values, options->set_values_count); + if (err != GRIB_SUCCESS && options->fail) + exit(err); } /* ECC-961 */ if (dump_keys && options->print_keys_count > 0) { - int errors = 0; /* true if at least one error */ + int errors = 0; /* true if at least one error */ const int key_count_total = options->print_keys_count; - int key_count_valid = 0; /* Some requested keys may be invalid */ - const char** key_names=(const char**)grib_context_malloc_clear(c, sizeof(char*)*key_count_total); - for (i=0;iprint_keys[i].name; - err = grib_set_flag(h, key_name, GRIB_ACCESSOR_FLAG_DUMP); + err = grib_set_flag(h, key_name, GRIB_ACCESSOR_FLAG_DUMP); if (err) { - grib_context_log(c,GRIB_LOG_ERROR, "%s: %s", key_name, grib_get_error_message(err)); + grib_context_log(c, GRIB_LOG_ERROR, "%s: %s", key_name, grib_get_error_message(err)); errors = 1; - } else { - key_names[key_count_valid]=key_name; + } + else { + key_names[key_count_valid] = key_name; key_count_valid++; } } @@ -201,31 +199,31 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) return errors; } - if(json) { - if (!first_handle && options->handle_count>1) { - fprintf(stdout,",\n"); + if (json) { + if (!first_handle && options->handle_count > 1) { + fprintf(stdout, ",\n"); } if (json && first_handle) { - fprintf(stdout,"{ \"messages\" : [\n"); - first_handle=0; + fprintf(stdout, "{ \"messages\" : [\n"); + first_handle = 0; } } else { char tmp[1024]; char identifier[100]; - size_t idlen=100; - sprintf(tmp,"MESSAGE %d ( length=%ld )",options->handle_count,length); + size_t idlen = 100; + sprintf(tmp, "MESSAGE %d ( length=%ld )", options->handle_count, length); if (!grib_options_on("C")) - fprintf(stdout,"#============== %-38s ==============\n",tmp); - if (!strcmp(options->dump_mode,"default")) { - GRIB_CHECK_NOLINE(grib_get_string(h,"identifier",identifier,&idlen),0); - printf("%s {\n",identifier); + fprintf(stdout, "#============== %-38s ==============\n", tmp); + if (!strcmp(options->dump_mode, "default")) { + GRIB_CHECK_NOLINE(grib_get_string(h, "identifier", identifier, &idlen), 0); + printf("%s {\n", identifier); } } - grib_dump_content(h,stdout,options->dump_mode,options->dump_flags,0); + grib_dump_content(h, stdout, options->dump_mode, options->dump_flags, 0); - if (!strcmp(options->dump_mode,"default")) + if (!strcmp(options->dump_mode, "default")) printf("}\n"); return 0; } @@ -236,31 +234,34 @@ int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) return 0; } -void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h) +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) { - grib_print_key_values(options,h); + grib_print_key_values(options, h); } int grib_tool_finalise_action(grib_runtime_options* options) { if (json) { - if (!dump_keys) fprintf(stdout,"\n]}\n"); - else fprintf(stdout,"\n"); + if (!dump_keys) + fprintf(stdout, "\n]}\n"); + else + fprintf(stdout, "\n"); } return 0; } int grib_no_handle_action(grib_runtime_options* options, int err) { - if (json ){ + if (json) { if (first_handle) { - fprintf(dump_file,"{ \"messages\" : [ \n"); - first_handle=0; - } else { - fprintf(dump_file,",\n"); + fprintf(dump_file, "{ \"messages\" : [ \n"); + first_handle = 0; + } + else { + fprintf(dump_file, ",\n"); } } - fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\t\t\"ERROR: unreadable message\"\n"); return 0; } diff --git a/tools/grib_filter.c b/tools/grib_filter.c index d581724bc..3a7c1a038 100644 --- a/tools/grib_filter.c +++ b/tools/grib_filter.c @@ -10,34 +10,36 @@ #include "grib_tools.h" -grib_option grib_options[]={ -/* {id, args, help}, on, command_line, value */ - {"f",0,0,0,1,0}, - {"f",0,0,1,0,0}, - {"F",0,0,1,0,0}, - {"o:",0,0,1,1,"filter.out"}, - {"q",0,0,1,0,0}, - {"M",0,0,0,1,0}, - {"I",0,0,1,0,0}, - {"V",0,0,0,1,0}, - {"g",0,0,0,1,0}, - {"G",0,0,0,1,0}, - {"T:",0,0,0,1,0}, - {"7",0,0,0,1,0}, - {"v",0,0,0,1,0} +grib_option grib_options[] = { + /* {id, args, help}, on, command_line, value */ + { "f", 0, 0, 0, 1, 0 }, + { "f", 0, 0, 1, 0, 0 }, + { "F", 0, 0, 1, 0, 0 }, + { "o:", 0, 0, 1, 1, "filter.out" }, + { "q", 0, 0, 1, 0, 0 }, + { "M", 0, 0, 0, 1, 0 }, + { "I", 0, 0, 1, 0, 0 }, + { "V", 0, 0, 0, 1, 0 }, + { "g", 0, 0, 0, 1, 0 }, + { "G", 0, 0, 0, 1, 0 }, + { "T:", 0, 0, 0, 1, 0 }, + { "7", 0, 0, 0, 1, 0 }, + { "v", 0, 0, 0, 1, 0 } }; -const char* grib_tool_description="Apply the rules defined in rules_file to each GRIB " - "message\n\tin the GRIB files provided as arguments.\n\t" - "If you specify '-' (a single dash) for the rules_file, the rules will be read from standard input."; -const char* grib_tool_name="grib_filter"; -const char* grib_tool_usage="[options] rules_file " - "grib_file grib_file ..."; - -int grib_options_count=sizeof(grib_options)/sizeof(grib_option); - -int main(int argc, char *argv[]) +const char* grib_tool_description = + "Apply the rules defined in rules_file to each GRIB " + "message\n\tin the GRIB files provided as arguments.\n\t" + "If you specify '-' (a single dash) for the rules_file, the rules will be read from standard input."; +const char* grib_tool_name = "grib_filter"; +const char* grib_tool_usage = + "[options] rules_file " + "grib_file grib_file ..."; + +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); + +int main(int argc, char* argv[]) { - return grib_tool(argc,argv); + return grib_tool(argc, argv); } int grib_tool_before_getopt(grib_runtime_options* options) @@ -49,22 +51,22 @@ int grib_tool_init(grib_runtime_options* options) { options->action = grib_action_from_filter(options->infile_extra->name); if (!options->action) { - fprintf(stderr,"%s: error unable to create action\n",options->infile_extra->name); + fprintf(stderr, "%s: error unable to create action\n", options->infile_extra->name); exit(1); } - if ( options->outfile && options->outfile->name ) - options->action->context->outfilename=options->outfile->name; + if (options->outfile && options->outfile->name) + options->action->context->outfilename = options->outfile->name; return 0; } -int grib_tool_new_filename_action(grib_runtime_options* options,const char* file) +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) { return 0; -} +} -int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file) +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { exit_if_input_is_directory(grib_tool_name, file->name); return 0; @@ -72,16 +74,16 @@ int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* fil int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) { - int err=0; + int err = 0; if (options->current_infile->name) { - size_t len=strlen(options->current_infile->name); - grib_set_string(h,"file",options->current_infile->name,&len); + size_t len = strlen(options->current_infile->name); + grib_set_string(h, "file", options->current_infile->name, &len); } - err=grib_handle_apply_action(h,options->action); + err = grib_handle_apply_action(h, options->action); if (err != GRIB_SUCCESS && options->fail) { - printf("ERROR: %s\n",grib_get_error_message(err)); + printf("ERROR: %s\n", grib_get_error_message(err)); exit(err); } return 0; @@ -93,14 +95,14 @@ int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) return 0; } -void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h) +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) { - grib_print_key_values(options,h); + grib_print_key_values(options, h); } int grib_tool_finalise_action(grib_runtime_options* options) { - int err=0; + int err = 0; grib_file_close_all(&err); if (err != GRIB_SUCCESS) { perror(grib_tool_name); @@ -113,6 +115,6 @@ int grib_tool_finalise_action(grib_runtime_options* options) int grib_no_handle_action(grib_runtime_options* options, int err) { - fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\t\t\"ERROR: unreadable message\"\n"); return 0; } diff --git a/tools/grib_get.c b/tools/grib_get.c index 3f0e5c07c..1c98f47fd 100644 --- a/tools/grib_get.c +++ b/tools/grib_get.c @@ -10,136 +10,142 @@ #include "grib_tools.h" -grib_option grib_options[]={ - /* {id, args, help}, on, command_line, value*/ - {"f",0,0,0,1,0}, - {"p:",0,0,0,1,0}, - {"F:",0,0,1,1,"%g"}, - {"B:",0,0,0,1,0}, - {"l:",0,0,0,1,0}, - {"P:",0,0,0,1,0}, - {"w:",0,0,0,1,0}, - {"n:",0,0,1,1,0}, - {"s:",0,0,0,1,0}, - {"V",0,0,0,1,0}, - {"W:",0,0,1,1,"8"}, - {"m",0,0,0,1,0}, - {"M",0,0,0,1,0}, - {"S",0,0,1,0,0}, - {"g",0,0,0,1,0}, - {"G",0,0,0,1,0}, - {"T:",0,0,0,1,0}, - {"7",0,0,0,1,0}, - {"v",0,0,1,0,0}, - {"X:",0,0,0,1,0}, - {"i:",0,0,0,1,0} +grib_option grib_options[] = { + /* {id, args, help}, on, command_line, value*/ + { "f", 0, 0, 0, 1, 0 }, + { "p:", 0, 0, 0, 1, 0 }, + { "F:", 0, 0, 1, 1, "%g" }, + { "B:", 0, 0, 0, 1, 0 }, + { "l:", 0, 0, 0, 1, 0 }, + { "P:", 0, 0, 0, 1, 0 }, + { "w:", 0, 0, 0, 1, 0 }, + { "n:", 0, 0, 1, 1, 0 }, + { "s:", 0, 0, 0, 1, 0 }, + { "V", 0, 0, 0, 1, 0 }, + { "W:", 0, 0, 1, 1, "8" }, + { "m", 0, 0, 0, 1, 0 }, + { "M", 0, 0, 0, 1, 0 }, + { "S", 0, 0, 1, 0, 0 }, + { "g", 0, 0, 0, 1, 0 }, + { "G", 0, 0, 0, 1, 0 }, + { "T:", 0, 0, 0, 1, 0 }, + { "7", 0, 0, 0, 1, 0 }, + { "v", 0, 0, 1, 0, 0 }, + { "X:", 0, 0, 0, 1, 0 }, + { "i:", 0, 0, 0, 1, 0 } }; -const char* grib_tool_description="Get values of some keys from a GRIB file." - "\n\tIt is similar to grib_ls, but fails returning an error code " - "\n\twhen an error occurs (e.g. key not found)."; -const char* grib_tool_name="grib_get"; -const char* grib_tool_usage="[options] grib_file grib_file ..."; +const char* grib_tool_description = + "Get values of some keys from a GRIB file." + "\n\tIt is similar to grib_ls, but fails returning an error code " + "\n\twhen an error occurs (e.g. key not found)."; +const char* grib_tool_name = "grib_get"; +const char* grib_tool_usage = "[options] grib_file grib_file ..."; -int grib_options_count=sizeof(grib_options)/sizeof(grib_option); -static double lat=0; -static double lon=0; -static int mode=0; -static grib_nearest* nearest=NULL; +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); +static double lat = 0; +static double lon = 0; +static int mode = 0; +static grib_nearest* nearest = NULL; -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - return grib_tool(argc,argv); + return grib_tool(argc, argv); } int grib_tool_before_getopt(grib_runtime_options* options) { - options->print_keys_count=-1; + options->print_keys_count = -1; return 0; } int grib_tool_init(grib_runtime_options* options) { - char *theEnd = NULL, *end1=NULL; - size_t size=4; - int ret=0; - double min=0,max=0; - int i=0; - char* p=NULL; + char *theEnd = NULL, *end1 = NULL; + size_t size = 4; + int ret = 0; + double min = 0, max = 0; + int i = 0; + char* p = NULL; - options->print_header=0; - options->print_statistics=0; - options->default_print_width=-1; + options->print_header = 0; + options->print_statistics = 0; + options->default_print_width = -1; if (options->latlon) { - - lat = strtod(options->latlon,&theEnd); + lat = strtod(options->latlon, &theEnd); if (*theEnd != ',') { printf("ERROR: wrong latitude value\n"); exit(1); } - lon= strtod(++theEnd,&end1); + lon = strtod(++theEnd, &end1); - mode=GRIB_NEAREST_SAME_POINT | GRIB_NEAREST_SAME_GRID; + mode = GRIB_NEAREST_SAME_POINT | GRIB_NEAREST_SAME_GRID; if (end1 && *end1 == ',') { end1++; if (*end1 != '0') { - p=end1; - while (*p != ',' && *p !='\0') p++; + p = end1; + while (*p != ',' && *p != '\0') + p++; if (*end1 == '4') { - options->latlon_mode=4; - } else if (*end1 == '1') { - options->latlon_mode=1; - } else { - printf("ERROR %s: wrong mode given in option -l\n",grib_tool_name); + options->latlon_mode = 4; + } + else if (*end1 == '1') { + options->latlon_mode = 1; + } + else { + printf("ERROR %s: wrong mode given in option -l\n", grib_tool_name); exit(1); } } if (*p == ',') { p++; - options->latlon_mask=strdup(p); + options->latlon_mask = strdup(p); } } } if (options->latlon && options->latlon_mask) { grib_handle* hh; - FILE* f=fopen(options->latlon_mask,"r"); - if(!f) { + FILE* f = fopen(options->latlon_mask, "r"); + if (!f) { perror(options->latlon_mask); exit(1); } - hh=grib_handle_new_from_file(0,f,&ret); + hh = grib_handle_new_from_file(0, f, &ret); fclose(f); - GRIB_CHECK_NOLINE(ret,0); - nearest=grib_nearest_new(hh,&ret); - GRIB_CHECK_NOLINE(ret,0); - GRIB_CHECK_NOLINE(grib_nearest_find(nearest,hh,lat,lon,mode, - options->lats,options->lons,options->mask_values,options->distances,options->indexes,&size),0); + GRIB_CHECK_NOLINE(ret, 0); + nearest = grib_nearest_new(hh, &ret); + GRIB_CHECK_NOLINE(ret, 0); + GRIB_CHECK_NOLINE(grib_nearest_find(nearest, hh, lat, lon, mode, + options->lats, options->lons, options->mask_values, options->distances, options->indexes, &size), + 0); grib_nearest_delete(nearest); - nearest=NULL; - grib_handle_delete( hh); - - options->latlon_idx=-1; - max=options->distances[0]; - for (i=0;i<4;i++) - if (maxdistances[i]) {max=options->distances[i];} - min=max; - for (i=0;i<4;i++) { + nearest = NULL; + grib_handle_delete(hh); + + options->latlon_idx = -1; + max = options->distances[0]; + for (i = 0; i < 4; i++) + if (max < options->distances[i]) { + max = options->distances[i]; + } + min = max; + for (i = 0; i < 4; i++) { if ((min >= options->distances[i]) && (options->mask_values[i] >= 0.5)) { - options->latlon_idx=i; - min = options->distances[i]; + options->latlon_idx = i; + min = options->distances[i]; } } - if (options->latlon_idx<0){ - min=0; - options->latlon_idx=0; - for (i=1;i<4;i++) { - if (min>options->distances[i]) { - min = options->distances[i]; - options->latlon_idx=i; + if (options->latlon_idx < 0) { + min = 0; + options->latlon_idx = 0; + for (i = 1; i < 4; i++) { + if (min > options->distances[i]) { + min = options->distances[i]; + options->latlon_idx = i; } } } @@ -148,48 +154,52 @@ int grib_tool_init(grib_runtime_options* options) return 0; } -int grib_tool_new_filename_action(grib_runtime_options* options,const char* file) +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) { return 0; } -int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file) +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { exit_if_input_is_directory(grib_tool_name, file->name); - if (nearest) grib_nearest_delete(nearest); + if (nearest) + grib_nearest_delete(nearest); nearest = NULL; return 0; } -int grib_tool_new_handle_action(grib_runtime_options* options,grib_handle* h) +int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) { - size_t size=4; - int err = 0; + size_t size = 4; + int err = 0; if (!options->skip) { if (options->set_values_count != 0) { - err=grib_set_values(h,options->set_values,options->set_values_count); + err = grib_set_values(h, options->set_values, options->set_values_count); } - if (err != GRIB_SUCCESS && options->fail) exit(err); + if (err != GRIB_SUCCESS && options->fail) + exit(err); } if (options->latlon) { int i; double min; - err=0; - if (!nearest) nearest=grib_nearest_new(h,&err); - GRIB_CHECK_NOLINE(err,0); - GRIB_CHECK_NOLINE(grib_nearest_find(nearest,h,lat,lon,0, - options->lats,options->lons,options->values, - options->distances,options->indexes,&size),0); - min=options->distances[0]; - options->latlon_idx=0; - i=0; - for (i=1;i<4;i++) { - if (min>options->distances[i]) { - min=options->distances[i]; - options->latlon_idx=i; + err = 0; + if (!nearest) + nearest = grib_nearest_new(h, &err); + GRIB_CHECK_NOLINE(err, 0); + GRIB_CHECK_NOLINE(grib_nearest_find(nearest, h, lat, lon, 0, + options->lats, options->lons, options->values, + options->distances, options->indexes, &size), + 0); + min = options->distances[0]; + options->latlon_idx = 0; + i = 0; + for (i = 1; i < 4; i++) { + if (min > options->distances[i]) { + min = options->distances[i]; + options->latlon_idx = i; } } } @@ -203,20 +213,21 @@ int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) return 0; } -void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h) +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) { - grib_print_key_values(options,h); + grib_print_key_values(options, h); } int grib_tool_finalise_action(grib_runtime_options* options) { - if (nearest) grib_nearest_delete(nearest); + if (nearest) + grib_nearest_delete(nearest); nearest = NULL; return 0; } int grib_no_handle_action(grib_runtime_options* options, int err) { - fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\t\t\"ERROR: unreadable message\"\n"); return 0; } diff --git a/tools/grib_get_data.c b/tools/grib_get_data.c index fcd699f11..2699e951d 100644 --- a/tools/grib_get_data.c +++ b/tools/grib_get_data.c @@ -15,40 +15,43 @@ #include "grib_tools.h" -static void print_key_values(grib_values* values,int values_count); -static grib_values* get_key_values(grib_runtime_options* options,grib_handle* h); - -grib_option grib_options[]={ -/* {id, args, help}, on, command_line, value */ - {"q",0,0,1,0,0}, - {"S",0,0,1,0,0}, - {"M",0,0,0,1,0}, - {"m:","missingValue","\n\t\tThe missing value is given through this option." - "\n\t\tAny string is allowed and it is printed in place of the missing" - "\n\t\tvalues. Default is to skip the missing values.\n",0,1,0}, - {"p:",0,0,0,1,0}, - {"F:","format","\n\t\tC style format for values. Default is \"%.10e\"\n",0,1,0}, - {"w:",0,0,0,1,0}, - {"s:",0,0,0,1,0}, - {"f",0,0,0,1,0}, - {"G",0,0,0,1,0}, - {"7",0,0,0,1,0}, - {"X:",0,0,0,1,0}, - {"V",0,0,0,1,0} +static void print_key_values(grib_values* values, int values_count); +static grib_values* get_key_values(grib_runtime_options* options, grib_handle* h); + +grib_option grib_options[] = { + /* {id, args, help}, on, command_line, value */ + { "q", 0, 0, 1, 0, 0 }, + { "S", 0, 0, 1, 0, 0 }, + { "M", 0, 0, 0, 1, 0 }, + { "m:", "missingValue", + "\n\t\tThe missing value is given through this option." + "\n\t\tAny string is allowed and it is printed in place of the missing" + "\n\t\tvalues. Default is to skip the missing values.\n", + 0, 1, 0 }, + { "p:", 0, 0, 0, 1, 0 }, + { "F:", "format", "\n\t\tC style format for values. Default is \"%.10e\"\n", 0, 1, 0 }, + { "w:", 0, 0, 0, 1, 0 }, + { "s:", 0, 0, 0, 1, 0 }, + { "f", 0, 0, 0, 1, 0 }, + { "G", 0, 0, 0, 1, 0 }, + { "7", 0, 0, 0, 1, 0 }, + { "X:", 0, 0, 0, 1, 0 }, + { "V", 0, 0, 0, 1, 0 } }; -const char* grib_tool_description="Print a latitude, longitude, data values list.\n" - "\tNote: Rotated grids are first unrotated"; -const char* grib_tool_name="grib_get_data"; -const char* grib_tool_usage="[options] grib_file grib_file ..."; +const char* grib_tool_description = + "Print a latitude, longitude, data values list.\n" + "\tNote: Rotated grids are first unrotated"; +const char* grib_tool_name = "grib_get_data"; +const char* grib_tool_usage = "[options] grib_file grib_file ..."; extern FILE* dump_file; -int grib_options_count=sizeof(grib_options)/sizeof(grib_option); +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - return grib_tool(argc,argv); + return grib_tool(argc, argv); } int grib_tool_before_getopt(grib_runtime_options* options) @@ -61,12 +64,12 @@ int grib_tool_init(grib_runtime_options* options) return 0; } -int grib_tool_new_filename_action(grib_runtime_options* options,const char* file) +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) { return 0; } -int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file) +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { exit_if_input_is_directory(grib_tool_name, file->name); return 0; @@ -74,67 +77,70 @@ int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* fil int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) { - int err=0; - - double missingValue = 9999; - int skip_missing=1; - char *missing_string=NULL; - int i=0; - grib_values* values=NULL; - grib_iterator* iter = NULL; - char* format=NULL; - char* default_format="%.10e"; - int print_keys=grib_options_on("p:"); - long numberOfPoints=0; - long bitmapPresent = 0; - long *bitmap = NULL; /* bitmap array */ - size_t bmp_len = 0; - double *data_values=0,*lats=0,*lons=0; - int n = 0; - size_t size=0, num_bytes=0; + int err = 0; + + double missingValue = 9999; + int skip_missing = 1; + char* missing_string = NULL; + int i = 0; + grib_values* values = NULL; + grib_iterator* iter = NULL; + char* format = NULL; + char* default_format = "%.10e"; + int print_keys = grib_options_on("p:"); + long numberOfPoints = 0; + long bitmapPresent = 0; + long* bitmap = NULL; /* bitmap array */ + size_t bmp_len = 0; + double *data_values = 0, *lats = 0, *lons = 0; + int n = 0; + size_t size = 0, num_bytes = 0; long hasMissingValues = 0; if (!options->skip) { if (options->set_values_count != 0) - err=grib_set_values(h,options->set_values,options->set_values_count); - if( err != GRIB_SUCCESS && options->fail) exit(err); + err = grib_set_values(h, options->set_values, options->set_values_count); + if (err != GRIB_SUCCESS && options->fail) + exit(err); } if (grib_options_on("m:")) { /* User wants to see missing values */ char* theEnd = NULL; - double mval=0; - char* kmiss=grib_options_get_option("m:"); - char* p = kmiss; - skip_missing=0; - while (*p != ':' && *p != '\0') p++; - if (*p == ':' && *(p+1) != '\0') { - *p='\0'; - missing_string=strdup(p+1); - } else { - missing_string=strdup(kmiss); + double mval = 0; + char* kmiss = grib_options_get_option("m:"); + char* p = kmiss; + skip_missing = 0; + while (*p != ':' && *p != '\0') + p++; + if (*p == ':' && *(p + 1) != '\0') { + *p = '\0'; + missing_string = strdup(p + 1); } - mval=strtod(kmiss, &theEnd); + else { + missing_string = strdup(kmiss); + } + mval = strtod(kmiss, &theEnd); if (kmiss != theEnd && *theEnd == '\0') missingValue = mval; - grib_set_double(h,"missingValue",missingValue); + grib_set_double(h, "missingValue", missingValue); /*missing_string=grib_options_get_option("m:");*/ } if (grib_options_on("F:")) - format=grib_options_get_option("F:"); + format = grib_options_get_option("F:"); else - format=default_format; + format = default_format; - if ((err=grib_get_long(h,"numberOfPoints",&numberOfPoints)) !=GRIB_SUCCESS) { - fprintf(dump_file,"ERROR: unable to get number of points\n"); + if ((err = grib_get_long(h, "numberOfPoints", &numberOfPoints)) != GRIB_SUCCESS) { + fprintf(dump_file, "ERROR: unable to get number of points\n"); return err; } - iter=grib_iterator_new(h,0,&err); + iter = grib_iterator_new(h, 0, &err); - num_bytes = (numberOfPoints+1)*sizeof(double); - data_values=(double*)calloc(numberOfPoints+1, sizeof(double)); + num_bytes = (numberOfPoints + 1) * sizeof(double); + data_values = (double*)calloc(numberOfPoints + 1, sizeof(double)); if (!data_values) { fprintf(dump_file, "ERROR: failed to allocate %ld bytes for data values (number of points=%ld)\n", (long)num_bytes, numberOfPoints); @@ -142,97 +148,109 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) } if (iter) { - double *lat=0,*lon=0,*val=0; - lats=(double*)calloc(numberOfPoints+1,sizeof(double)); - lons=(double*)calloc(numberOfPoints+1,sizeof(double)); - lat=lats; lon=lons; val=data_values; - while(grib_iterator_next(iter,lat++,lon++,val++)) {} - } else if (err==GRIB_NOT_IMPLEMENTED || err==GRIB_SUCCESS){ - size=numberOfPoints; - err = grib_get_double_array(h,"values",data_values,&size); + double *lat = 0, *lon = 0, *val = 0; + lats = (double*)calloc(numberOfPoints + 1, sizeof(double)); + lons = (double*)calloc(numberOfPoints + 1, sizeof(double)); + lat = lats; + lon = lons; + val = data_values; + while (grib_iterator_next(iter, lat++, lon++, val++)) {} + } + else if (err == GRIB_NOT_IMPLEMENTED || err == GRIB_SUCCESS) { + size = numberOfPoints; + err = grib_get_double_array(h, "values", data_values, &size); if (err) { - grib_context_log(h->context,GRIB_LOG_ERROR,"Cannot decode values: %s", - grib_get_error_message(err)); + grib_context_log(h->context, GRIB_LOG_ERROR, "Cannot decode values: %s", + grib_get_error_message(err)); exit(1); } - if (size!=numberOfPoints) { + if (size != numberOfPoints) { if (!grib_options_on("q")) - fprintf(dump_file,"ERROR: wrong number of points %d\n",(int)numberOfPoints); - if (grib_options_on("f")) exit(1); + fprintf(dump_file, "ERROR: wrong number of points %d\n", (int)numberOfPoints); + if (grib_options_on("f")) + exit(1); } - } else { - grib_context_log(h->context,GRIB_LOG_ERROR, - "%s",grib_get_error_message(err)); + } + else { + grib_context_log(h->context, GRIB_LOG_ERROR, + "%s", grib_get_error_message(err)); exit(err); } /* Cater for GRIBs which have missing values but no bitmap */ /* See ECC-511 */ - GRIB_CHECK(grib_get_long(h,"missingValuesPresent",&hasMissingValues),0); - GRIB_CHECK(grib_get_long(h,"bitmapPresent",&bitmapPresent),0); - if (bitmapPresent) - { - GRIB_CHECK(grib_get_size(h,"bitmap",&bmp_len),0); - bitmap = (long*)malloc(bmp_len*sizeof(long)); - GRIB_CHECK(grib_get_long_array(h,"bitmap",bitmap,&bmp_len),0); + GRIB_CHECK(grib_get_long(h, "missingValuesPresent", &hasMissingValues), 0); + GRIB_CHECK(grib_get_long(h, "bitmapPresent", &bitmapPresent), 0); + if (bitmapPresent) { + GRIB_CHECK(grib_get_size(h, "bitmap", &bmp_len), 0); + bitmap = (long*)malloc(bmp_len * sizeof(long)); + GRIB_CHECK(grib_get_long_array(h, "bitmap", bitmap, &bmp_len), 0); } if (iter) - fprintf(dump_file,"Latitude, Longitude, "); + fprintf(dump_file, "Latitude, Longitude, "); - fprintf(dump_file,"Value"); + fprintf(dump_file, "Value"); if (print_keys) - for (i=0;iprint_keys_count; i++) - fprintf(dump_file,", %s",options->print_keys[i].name); + for (i = 0; i < options->print_keys_count; i++) + fprintf(dump_file, ", %s", options->print_keys[i].name); - fprintf(dump_file,"\n"); + fprintf(dump_file, "\n"); if (print_keys) - values=get_key_values(options,h); + values = get_key_values(options, h); - if (skip_missing==0){ + if (skip_missing == 0) { /* Show missing values in data */ - for (i=0;iprint_keys_count); - fprintf(dump_file,"\n"); + print_key_values(values, options->print_keys_count); + fprintf(dump_file, "\n"); n++; } - - } else if ( skip_missing==1 ){ + } + else if (skip_missing == 1) { /* Skip the missing values in data */ - for (i=0;iprint_keys_count); - fprintf(dump_file,"\n"); + print_key_values(values, options->print_keys_count); + fprintf(dump_file, "\n"); n++; } } } - if (iter) grib_iterator_delete(iter); - if (bitmap) free(bitmap); + if (iter) + grib_iterator_delete(iter); + if (bitmap) + free(bitmap); free(data_values); free(missing_string); @@ -250,9 +268,9 @@ int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) return 0; } -void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h) +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) { - grib_print_key_values(options,h); + grib_print_key_values(options, h); } int grib_tool_finalise_action(grib_runtime_options* options) @@ -260,71 +278,71 @@ int grib_tool_finalise_action(grib_runtime_options* options) return 0; } -static void print_key_values(grib_values* values,int values_count) +static void print_key_values(grib_values* values, int values_count) { - int i=0; - for (i=0; iprint_keys_count;i++) { - size_t len=MAX_STRING_LEN; - ret=GRIB_SUCCESS; - - if (grib_is_missing(h,options->print_keys[i].name,&ret) && ret==GRIB_SUCCESS) { - options->print_keys[i].type=GRIB_TYPE_MISSING; - sprintf(value,"MISSING"); - - } else if ( ret != GRIB_NOT_FOUND ){ + int i = 0; + int ret = 0; + char value[MAX_STRING_LEN] = {0,}; + char* notfound = "not found"; + + for (i = 0; i < options->print_keys_count; i++) { + size_t len = MAX_STRING_LEN; + ret = GRIB_SUCCESS; + + if (grib_is_missing(h, options->print_keys[i].name, &ret) && ret == GRIB_SUCCESS) { + options->print_keys[i].type = GRIB_TYPE_MISSING; + sprintf(value, "MISSING"); + } + else if (ret != GRIB_NOT_FOUND) { if (options->print_keys[i].type == GRIB_TYPE_UNDEFINED) { - grib_get_native_type(h,options->print_keys[i].name,&(options->print_keys[i].type)); + grib_get_native_type(h, options->print_keys[i].name, &(options->print_keys[i].type)); } switch (options->print_keys[i].type) { - case GRIB_TYPE_STRING: - ret=grib_get_string( h,options->print_keys[i].name,value,&len); - break; - case GRIB_TYPE_DOUBLE: - ret=grib_get_double( h,options->print_keys[i].name, - &(options->print_keys[i].double_value)); - sprintf(value,"%g",options->print_keys[i].double_value); - break; - case GRIB_TYPE_LONG: - ret=grib_get_long( h,options->print_keys[i].name, - &(options->print_keys[i].long_value)); - sprintf(value,"%ld",(long)options->print_keys[i].long_value); - break; - default: - fprintf(dump_file,"invalid type for %s\n",options->print_keys[i].name); - exit(1); - + case GRIB_TYPE_STRING: + ret = grib_get_string(h, options->print_keys[i].name, value, &len); + break; + case GRIB_TYPE_DOUBLE: + ret = grib_get_double(h, options->print_keys[i].name, + &(options->print_keys[i].double_value)); + sprintf(value, "%g", options->print_keys[i].double_value); + break; + case GRIB_TYPE_LONG: + ret = grib_get_long(h, options->print_keys[i].name, + &(options->print_keys[i].long_value)); + sprintf(value, "%ld", (long)options->print_keys[i].long_value); + break; + default: + fprintf(dump_file, "invalid type for %s\n", options->print_keys[i].name); + exit(1); } } if (ret != GRIB_SUCCESS) { - if (options->fail) GRIB_CHECK_NOLINE(ret,options->print_keys[i].name); - if (ret == GRIB_NOT_FOUND) strcpy(value,notfound); + if (options->fail) + GRIB_CHECK_NOLINE(ret, options->print_keys[i].name); + if (ret == GRIB_NOT_FOUND) + strcpy(value, notfound); else { - fprintf(dump_file,"%s %s\n",grib_get_error_message(ret),options->print_keys[i].name); + fprintf(dump_file, "%s %s\n", grib_get_error_message(ret), options->print_keys[i].name); exit(ret); } } - options->print_keys[i].string_value=strdup(value); + options->print_keys[i].string_value = strdup(value); } return options->print_keys; - } int grib_no_handle_action(grib_runtime_options* options, int err) { - fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\t\t\"ERROR: unreadable message\"\n"); return 0; } diff --git a/tools/grib_histogram.c b/tools/grib_histogram.c index 2bf00beb5..070593234 100644 --- a/tools/grib_histogram.c +++ b/tools/grib_histogram.c @@ -11,41 +11,41 @@ #include "grib_tools.h" grib_option grib_options[] = { -/* {id, args, help}, on, command_line, value*/ - {"V",0,0,0,1,0}, - {"p:", 0, 0, 0, 1, 0}, /* print keys */ - {"S",0,0,1,0,0}, /* needed for skip */ - {"w:",0,0,0,1,0} /* 'where' clause */ + /* {id, args, help}, on, command_line, value*/ + { "V", 0, 0, 0, 1, 0 }, + { "p:", 0, 0, 0, 1, 0 }, /* print keys */ + { "S", 0, 0, 1, 0, 0 }, /* needed for skip */ + { "w:", 0, 0, 0, 1, 0 } /* 'where' clause */ }; -int grib_options_count = sizeof(grib_options)/sizeof(grib_option); +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); -const char *grib_tool_description = "Histogram of GRIB files"; -const char *grib_tool_name = "grib_histogram"; -const char *grib_tool_usage = "[options] grib_file grib_file ..."; +const char* grib_tool_description = "Histogram of GRIB files"; +const char* grib_tool_name = "grib_histogram"; +const char* grib_tool_usage = "[options] grib_file grib_file ..."; -int main (int argc, char *argv[]) +int main(int argc, char* argv[]) { - return grib_tool (argc, argv); + return grib_tool(argc, argv); } -int grib_tool_before_getopt (grib_runtime_options * options) +int grib_tool_before_getopt(grib_runtime_options* options) { return 0; } -int grib_tool_init (grib_runtime_options * options) +int grib_tool_init(grib_runtime_options* options) { return 0; } -int grib_tool_new_filename_action (grib_runtime_options * options, const char *file) +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) { return 0; } -int grib_tool_new_file_action (grib_runtime_options * options, grib_tools_file * file) +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { - exit_if_input_is_directory (grib_tool_name, file->name); + exit_if_input_is_directory(grib_tool_name, file->name); return 0; } @@ -54,56 +54,56 @@ int grib_tool_new_file_action (grib_runtime_options * options, grib_tools_file * The handle available in this function is in the set of messages satisfying the constraint of the -w option. They are not to be skipped. */ -int grib_tool_new_handle_action (grib_runtime_options * options, grib_handle * h) +int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) { int i, j, err = 0; size_t last_size = 0; long missingValuesPresent; double delta; - double *values = NULL; + double* values = NULL; size_t size; double min, max; long count = 10; long intervals[10]; - const char *names[1024]; + const char* names[1024]; int name_count = 0; - for (i=0; i < options->requested_print_keys_count; i++) { + for (i = 0; i < options->requested_print_keys_count; i++) { names[name_count++] = options->requested_print_keys[i].name; } if (!options->skip) { if (options->set_values_count != 0) - err = grib_set_values (h, options->set_values, options->set_values_count); + err = grib_set_values(h, options->set_values, options->set_values_count); if (err != GRIB_SUCCESS && options->fail) - exit (err); + exit(err); } - GRIB_CHECK (grib_get_long (h, "missingValuesPresent", &missingValuesPresent), 0); + GRIB_CHECK(grib_get_long(h, "missingValuesPresent", &missingValuesPresent), 0); - GRIB_CHECK (grib_get_size (h, "values", &size), 0); + GRIB_CHECK(grib_get_size(h, "values", &size), 0); if (size > last_size) { if (values) - free (values); - values = (double *) malloc (size * sizeof (double)); + free(values); + values = (double*)malloc(size * sizeof(double)); last_size = size; if (!values) { - fprintf (stderr, "Failed to allocate memory for values (%lu bytes)\n", size * sizeof (double)); - exit (1); + fprintf(stderr, "Failed to allocate memory for values (%lu bytes)\n", size * sizeof(double)); + exit(1); } } - GRIB_CHECK (grib_get_double_array (h, "values", values, &size), 0); + GRIB_CHECK(grib_get_double_array(h, "values", values, &size), 0); for (j = 0; j < count; j++) intervals[j] = 0; if (missingValuesPresent) { double missing; - GRIB_CHECK (grib_get_double (h, "missingValue", &missing), 0); + GRIB_CHECK(grib_get_double(h, "missingValue", &missing), 0); min = max = missing; @@ -122,11 +122,12 @@ int grib_tool_new_handle_action (grib_runtime_options * options, grib_handle * h if (values[j] != missing) { int x = (values[j] - min) / delta * count; if (x == count) - x = x - 1; /*handle the absolute maximum */ + x = x - 1; /*handle the absolute maximum */ intervals[x]++; } } - } else { + } + else { min = max = values[0]; for (j = 1; j < size; j++) { if (min > values[j]) @@ -142,48 +143,48 @@ int grib_tool_new_handle_action (grib_runtime_options * options, grib_handle * h for (j = 0; j < size; j++) { int x = (values[j] - min) / delta * count; if (x == count) - x = x - 1; /*handle the absolute maximum */ + x = x - 1; /*handle the absolute maximum */ intervals[x]++; } } for (j = 0; j < name_count; j++) { char v[1024]; - size_t s = sizeof (v); - GRIB_CHECK (grib_get_string (h, names[j], v, &s), names[j]); - printf (" %s", v); + size_t s = sizeof(v); + GRIB_CHECK(grib_get_string(h, names[j], v, &s), names[j]); + printf(" %s", v); } - printf ("\nmin=%g max=%g size=%ld\n", min, max, (long) size); + printf("\nmin=%g max=%g size=%ld\n", min, max, (long)size); for (j = 0; j < count; j++) - printf (" %g:%g", j * (max - min) / count + min, (j + 1) * (max - min) / count + min); - printf ("\n"); + printf(" %g:%g", j * (max - min) / count + min, (j + 1) * (max - min) / count + min); + printf("\n"); for (j = 0; j < count; j++) - printf (" %ld", intervals[j]); - printf ("\n"); + printf(" %ld", intervals[j]); + printf("\n"); return 0; } -int grib_tool_skip_handle (grib_runtime_options * options, grib_handle * h) +int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) { - grib_handle_delete (h); + grib_handle_delete(h); return 0; } -void grib_tool_print_key_values (grib_runtime_options * options, grib_handle * h) +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) { - grib_print_key_values (options, h); + grib_print_key_values(options, h); } -int grib_tool_finalise_action (grib_runtime_options * options) +int grib_tool_finalise_action(grib_runtime_options* options) { return 0; } -int grib_no_handle_action (grib_runtime_options * options, int err) +int grib_no_handle_action(grib_runtime_options* options, int err) { - fprintf (dump_file, "\t\t\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\t\t\"ERROR: unreadable message\"\n"); return 0; } diff --git a/tools/grib_index_build.c b/tools/grib_index_build.c index 5cc416f42..25a2d7d71 100644 --- a/tools/grib_index_build.c +++ b/tools/grib_index_build.c @@ -15,38 +15,38 @@ #include "grib_tools.h" -const char* grib_tool_description="Build an index file for a set of input GRIB files."; -const char* grib_tool_name="grib_index_build"; -const char* grib_tool_usage="[options] grib_file grib_file ... "; -static grib_index* idx=NULL; +const char* grib_tool_description = "Build an index file for a set of input GRIB files."; +const char* grib_tool_name = "grib_index_build"; +const char* grib_tool_usage = "[options] grib_file grib_file ... "; +static grib_index* idx = NULL; static char* keys; static char* default_keys = "mars"; -grib_option grib_options[]={ - /* {id, args, help}, on, command_line, value */ - {"f",0,0,0,1,0}, - {"o:","output_index_file", - "\n\t\tOutput is written to output_index_file." - "\n\t\tIf an output index file is required and -o is not used, the" - " output index is written to 'gribidx'\n", - 1,1,"gribidx"}, - {"k:",0,0,0,1,0}, - {"V",0,0,0,1,0}, - {"T:",0,0,0,1,0}, - {"M",0,0,0,1,0}, - {"N",0,"Do not compress index." - "\n\t\tBy default the index is compressed to remove keys with only one value.\n",0,1,0 - } +grib_option grib_options[] = { + /* {id, args, help}, on, command_line, value */ + { "f", 0, 0, 0, 1, 0 }, + { "o:", "output_index_file", + "\n\t\tOutput is written to output_index_file." + "\n\t\tIf an output index file is required and -o is not used, the" + " output index is written to 'gribidx'\n", + 1, 1, "gribidx" }, + { "k:", 0, 0, 0, 1, 0 }, + { "V", 0, 0, 0, 1, 0 }, + { "T:", 0, 0, 0, 1, 0 }, + { "M", 0, 0, 0, 1, 0 }, + { "N", 0, + "Do not compress index." + "\n\t\tBy default the index is compressed to remove keys with only one value.\n", + 0, 1, 0 } }; static int compress_index; -int grib_options_count=sizeof(grib_options)/sizeof(grib_option); +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - int ret=grib_tool(argc,argv); - return ret; + return grib_tool(argc, argv); } int grib_tool_before_getopt(grib_runtime_options* options) @@ -56,38 +56,43 @@ int grib_tool_before_getopt(grib_runtime_options* options) int grib_tool_init(grib_runtime_options* options) { - int ret=0; - grib_context* c=grib_context_get_default(); + int ret = 0; + grib_context* c = grib_context_get_default(); - if (grib_options_on("N")) compress_index=0; - else compress_index=1; + if (grib_options_on("N")) + compress_index = 0; + else + compress_index = 1; if (grib_options_on("k:")) - keys=grib_options_get_option("k:"); + keys = grib_options_get_option("k:"); else - keys=default_keys; + keys = default_keys; - options->onlyfiles=1; + options->onlyfiles = 1; - idx=grib_index_new(c,keys,&ret); + idx = grib_index_new(c, keys, &ret); if (!idx || ret) - grib_context_log(c,GRIB_LOG_FATAL, - "Unable to create index %s",grib_get_error_message(ret)); + grib_context_log(c, GRIB_LOG_FATAL, + "Unable to create index %s", grib_get_error_message(ret)); return 0; } -int grib_tool_new_filename_action(grib_runtime_options* options,const char* file) +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) { - int ret=0; - printf("--- %s: processing %s\n",grib_tool_name,file); - ret=grib_index_add_file(idx,file); - if (ret) {printf("error: %s\n",grib_get_error_message(ret)); exit(ret);} + int ret = 0; + printf("--- %s: processing %s\n", grib_tool_name, file); + ret = grib_index_add_file(idx, file); + if (ret) { + printf("error: %s\n", grib_get_error_message(ret)); + exit(ret); + } return 0; } -int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file) +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { return 0; } @@ -102,7 +107,7 @@ int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) return 0; } -void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h) +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) { } @@ -116,41 +121,43 @@ int grib_tool_finalise_action(grib_runtime_options* options) grib_index_compress(idx); } printf("--- %s: keys included in the index file %s:\n", - grib_tool_name,options->outfile->name); + grib_tool_name, options->outfile->name); printf("--- "); - first=1; - the_keys=idx->keys; + first = 1; + the_keys = idx->keys; while (the_keys) { - if (!first) printf(", "); - printf("%s",the_keys->name); - the_keys=the_keys->next; - first=0; + if (!first) + printf(", "); + printf("%s", the_keys->name); + the_keys = the_keys->next; + first = 0; } printf("\n"); - the_keys=idx->keys; + the_keys = idx->keys; while (the_keys) { - printf("--- %s = { ",the_keys->name); - values=the_keys->values; - first=1; + printf("--- %s = { ", the_keys->name); + values = the_keys->values; + first = 1; while (values) { - if (!first) printf(", "); - printf("%s",values->value); - first=0; - values=values->next; + if (!first) + printf(", "); + printf("%s", values->value); + first = 0; + values = values->next; } printf(" }\n"); - the_keys=the_keys->next; + the_keys = the_keys->next; } - printf("--- %d messages indexed\n",idx->count); + printf("--- %d messages indexed\n", idx->count); if (idx->count) - grib_index_write(idx,options->outfile->name); + grib_index_write(idx, options->outfile->name); grib_index_delete(idx); return 0; } int grib_no_handle_action(grib_runtime_options* options, int err) { - fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\t\t\"ERROR: unreadable message\"\n"); return 0; } diff --git a/tools/grib_ls.c b/tools/grib_ls.c index dad47e29d..da9e2d5bf 100644 --- a/tools/grib_ls.c +++ b/tools/grib_ls.c @@ -14,44 +14,45 @@ */ #include "grib_tools.h" -grib_option grib_options[]={ -/* {id, args, help}, on, command_line, value*/ - {"f",0,0,1,0,0}, - {"p:",0,0,0,1,0}, - {"F:",0,0,1,1,"%g"}, - {"P:",0,0,0,1,0}, - {"w:",0,0,0,1,0}, - {"j",0,"JSON output\n",0,1,0}, - {"B:",0,0,0,1,0}, - {"l:",0,0,0,1,0}, - {"s:",0,0,0,1,0}, - {"i:",0,0,0,1,0}, - {"n:",0,0,1,1,"ls"}, - {"m",0,0,0,1,0}, - {"V",0,0,0,1,0}, - {"W:",0,0,1,1,"10"}, - {"S",0,0,1,0,0}, - {"M",0,0,0,1,0}, - {"H",0,0,1,0,0}, - {"g",0,0,0,1,0}, - {"P",0,0,1,0,0}, - {"T:",0,0,0,1,0}, - {"7",0,0,0,1,0}, - {"v",0,0,1,0,0}, - {"X:",0,0,0,1,0}, - {"x",0,0,0,1,0} +grib_option grib_options[] = { + /* {id, args, help}, on, command_line, value*/ + { "f", 0, 0, 1, 0, 0 }, + { "p:", 0, 0, 0, 1, 0 }, + { "F:", 0, 0, 1, 1, "%g" }, + { "P:", 0, 0, 0, 1, 0 }, + { "w:", 0, 0, 0, 1, 0 }, + { "j", 0, "JSON output\n", 0, 1, 0 }, + { "B:", 0, 0, 0, 1, 0 }, + { "l:", 0, 0, 0, 1, 0 }, + { "s:", 0, 0, 0, 1, 0 }, + { "i:", 0, 0, 0, 1, 0 }, + { "n:", 0, 0, 1, 1, "ls" }, + { "m", 0, 0, 0, 1, 0 }, + { "V", 0, 0, 0, 1, 0 }, + { "W:", 0, 0, 1, 1, "10" }, + { "S", 0, 0, 1, 0, 0 }, + { "M", 0, 0, 0, 1, 0 }, + { "H", 0, 0, 1, 0, 0 }, + { "g", 0, 0, 0, 1, 0 }, + { "P", 0, 0, 1, 0, 0 }, + { "T:", 0, 0, 0, 1, 0 }, + { "7", 0, 0, 0, 1, 0 }, + { "v", 0, 0, 1, 0, 0 }, + { "X:", 0, 0, 0, 1, 0 }, + { "x", 0, 0, 0, 1, 0 } }; -const char* grib_tool_description="List content of GRIB files printing values of " - "some keys.\n\tIt does not fail when a key is not found."; -const char* grib_tool_name="grib_ls"; -const char* grib_tool_usage="[options] grib_file grib_file ..."; -static char* new_handle=""; - -int grib_options_count=sizeof(grib_options)/sizeof(grib_option); -static double lat=0; -static double lon=0; -static int mode=0; +const char* grib_tool_description = + "List content of GRIB files printing values of " + "some keys.\n\tIt does not fail when a key is not found."; +const char* grib_tool_name = "grib_ls"; +const char* grib_tool_usage = "[options] grib_file grib_file ..."; +static char* new_handle = ""; + +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); +static double lat = 0; +static double lon = 0; +static int mode = 0; /* Note: * There are two JSON-output modes: * 1. With a provided lat-lon for the nearest neighbour (options->latlon==1) @@ -59,13 +60,13 @@ static int mode=0; * The first is special and has a very different format. They need to be * treated differently */ -static int json_latlon=0; -static int first_handle=1; -static grib_nearest* nearest=NULL; +static int json_latlon = 0; +static int first_handle = 1; +static grib_nearest* nearest = NULL; -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - return grib_tool(argc,argv); + return grib_tool(argc, argv); } /* @@ -85,105 +86,112 @@ int grib_tool_before_getopt(grib_runtime_options* options) */ int grib_tool_init(grib_runtime_options* options) { - char *theEnd = NULL, *end1=NULL; - size_t size=4; - int ret=0; - double min=0,max=0; - int i=0; - char* p=NULL; + char *theEnd = NULL, *end1 = NULL; + size_t size = 4; + int ret = 0; + double min = 0, max = 0; + int i = 0; + char* p = NULL; if (options->latlon && grib_options_on("j")) { - options->verbose=0; - json_latlon=1; + options->verbose = 0; + json_latlon = 1; } if (options->latlon) { - - lat = strtod(options->latlon,&theEnd); + lat = strtod(options->latlon, &theEnd); if (*theEnd != ',') { fprintf(stderr, "Error: wrong latitude value\n"); exit(1); } - lon= strtod(++theEnd,&end1); + lon = strtod(++theEnd, &end1); - mode=GRIB_NEAREST_SAME_POINT | GRIB_NEAREST_SAME_GRID; + mode = GRIB_NEAREST_SAME_POINT | GRIB_NEAREST_SAME_GRID; if (end1 && *end1 == ',') { end1++; if (*end1 != '0') { - p=end1; - while (*p != ',' && *p !='\0') p++; + p = end1; + while (*p != ',' && *p != '\0') + p++; if (*end1 == '4') { - options->latlon_mode=4; - } else if (*end1 == '1') { - options->latlon_mode=1; - } else { - fprintf(stderr, "Error %s: wrong mode given in option -l\n",grib_tool_name); + options->latlon_mode = 4; + } + else if (*end1 == '1') { + options->latlon_mode = 1; + } + else { + fprintf(stderr, "Error %s: wrong mode given in option -l\n", grib_tool_name); exit(1); } } if (*p == ',') { p++; - options->latlon_mask=strdup(p); + options->latlon_mask = strdup(p); } } } if (options->latlon && options->latlon_mask) { grib_handle* hh; - int idx=0, land_found=0; + int idx = 0, land_found = 0; double min_overall = 0.0; - int idx_overall = -1; - FILE* f=fopen(options->latlon_mask,"r"); - if(!f) { + int idx_overall = -1; + FILE* f = fopen(options->latlon_mask, "r"); + if (!f) { perror(options->latlon_mask); exit(1); } - hh=grib_handle_new_from_file(0,f,&ret); + hh = grib_handle_new_from_file(0, f, &ret); fclose(f); - GRIB_CHECK_NOLINE(ret,0); - nearest=grib_nearest_new(hh,&ret); - GRIB_CHECK_NOLINE(ret,0); - GRIB_CHECK_NOLINE(grib_nearest_find(nearest,hh,lat,lon,mode, - options->lats,options->lons,options->mask_values,options->distances,options->indexes,&size),0); + GRIB_CHECK_NOLINE(ret, 0); + nearest = grib_nearest_new(hh, &ret); + GRIB_CHECK_NOLINE(ret, 0); + GRIB_CHECK_NOLINE(grib_nearest_find(nearest, hh, lat, lon, mode, + options->lats, options->lons, options->mask_values, options->distances, options->indexes, &size), + 0); grib_nearest_delete(nearest); - nearest=NULL; + nearest = NULL; grib_handle_delete(hh); - options->latlon_idx=-1; - max=options->distances[0]; - for (i=0;i<4;i++) - if (maxdistances[i]) {max=options->distances[i];} - min=max; - min_overall=max; + options->latlon_idx = -1; + max = options->distances[0]; + for (i = 0; i < 4; i++) + if (max < options->distances[i]) { + max = options->distances[i]; + } + min = max; + min_overall = max; /* See GRIB-213 */ - for (i=0;i<4;i++) { + for (i = 0; i < 4; i++) { if (min_overall >= options->distances[i]) { /* find overall min and index ignoring mask */ min_overall = options->distances[i]; idx_overall = i; } if ((min >= options->distances[i]) && (options->mask_values[i] >= 0.5)) { - land_found=1; /* found at least one point which is land */ - min = options->distances[i]; - idx = i; + land_found = 1; /* found at least one point which is land */ + min = options->distances[i]; + idx = i; } } if (land_found) { - options->latlon_idx=idx; - } else { - options->latlon_idx=idx_overall; /* all points were sea, so pick the min overall */ + options->latlon_idx = idx; + } + else { + options->latlon_idx = idx_overall; /* all points were sea, so pick the min overall */ } - if (options->latlon_idx<0){ - min=0; - options->latlon_idx=0; - for (i=1;i<4;i++) - if (min>options->distances[i]) { - min = options->distances[i]; - options->latlon_idx=i; + if (options->latlon_idx < 0) { + min = 0; + options->latlon_idx = 0; + for (i = 1; i < 4; i++) + if (min > options->distances[i]) { + min = options->distances[i]; + options->latlon_idx = i; } } } - if (json_latlon) printf("[\n"); + if (json_latlon) + printf("[\n"); return 0; } @@ -192,58 +200,60 @@ int grib_tool_init(grib_runtime_options* options) A new file is being parsed. The file name is file. This function is called every time a new input file name is processed, before opening the file. */ -int grib_tool_new_filename_action(grib_runtime_options* options,const char* file) +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) { return 0; } -int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file) +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { exit_if_input_is_directory(grib_tool_name, file->name); - if (nearest) grib_nearest_delete(nearest); + if (nearest) + grib_nearest_delete(nearest); nearest = NULL; return 0; } -static void print_key_values(grib_runtime_options* options,grib_handle* h) +static void print_key_values(grib_runtime_options* options, grib_handle* h) { int i; - int ret=0; - char* s="\"keys\" : {"; - double dvalue=0; - long lvalue=0; + int ret = 0; + char* s = "\"keys\" : {"; + double dvalue = 0; + long lvalue = 0; char value[MAX_STRING_LEN]; - size_t len=MAX_STRING_LEN; - for (i=0;iprint_keys_count;i++) { - ret=GRIB_SUCCESS; - printf("%s",s); - len=MAX_STRING_LEN; - printf("\"%s\" : ",options->print_keys[i].name); - if (grib_is_missing(h,options->print_keys[i].name,&ret) && ret==GRIB_SUCCESS) + size_t len = MAX_STRING_LEN; + for (i = 0; i < options->print_keys_count; i++) { + ret = GRIB_SUCCESS; + printf("%s", s); + len = MAX_STRING_LEN; + printf("\"%s\" : ", options->print_keys[i].name); + if (grib_is_missing(h, options->print_keys[i].name, &ret) && ret == GRIB_SUCCESS) printf("\"missing\""); - else if ( ret == GRIB_SUCCESS ) { + else if (ret == GRIB_SUCCESS) { if (options->print_keys[i].type == GRIB_TYPE_UNDEFINED) - grib_get_native_type(h,options->print_keys[i].name,&(options->print_keys[i].type)); + grib_get_native_type(h, options->print_keys[i].name, &(options->print_keys[i].type)); switch (options->print_keys[i].type) { - case GRIB_TYPE_STRING: - ret=grib_get_string( h,options->print_keys[i].name,value,&len); - printf("\"%s\"",value); - break; - case GRIB_TYPE_DOUBLE: - ret=grib_get_double( h,options->print_keys[i].name,&dvalue); - printf("%g",dvalue); - break; - case GRIB_TYPE_LONG: - ret=grib_get_long( h,options->print_keys[i].name,&lvalue); - printf("%ld",lvalue); - break; - default: - printf("invalid_type"); - break; + case GRIB_TYPE_STRING: + ret = grib_get_string(h, options->print_keys[i].name, value, &len); + printf("\"%s\"", value); + break; + case GRIB_TYPE_DOUBLE: + ret = grib_get_double(h, options->print_keys[i].name, &dvalue); + printf("%g", dvalue); + break; + case GRIB_TYPE_LONG: + ret = grib_get_long(h, options->print_keys[i].name, &lvalue); + printf("%ld", lvalue); + break; + default: + printf("invalid_type"); + break; } } - if (ret == GRIB_NOT_FOUND) printf("null"); - s=", "; + if (ret == GRIB_NOT_FOUND) + printf("null"); + s = ", "; } printf("}"); } @@ -255,86 +265,93 @@ static void print_key_values(grib_runtime_options* options,grib_handle* h) */ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) { - size_t size=4; - double v=0; - int err=0; + size_t size = 4; + double v = 0; + int err = 0; int i; if (!options->skip) { - if (options->set_values_count != 0) - err=grib_set_values(h,options->set_values,options->set_values_count); + err = grib_set_values(h, options->set_values, options->set_values_count); - if( err != GRIB_SUCCESS && options->fail) exit(err); + if (err != GRIB_SUCCESS && options->fail) + exit(err); } if (options->latlon) { double min; - err=0; - if (!nearest) nearest=grib_nearest_new(h,&err); + err = 0; + if (!nearest) + nearest = grib_nearest_new(h, &err); if (err == GRIB_NOT_IMPLEMENTED) { char grid_type[100]; - size_t grid_type_len=100; - int err1=grib_get_string(h, "gridType", grid_type, &grid_type_len); + size_t grid_type_len = 100; + int err1 = grib_get_string(h, "gridType", grid_type, &grid_type_len); if (err1 == GRIB_SUCCESS) { - fprintf(stderr,"Nearest neighbour functionality is not supported for grid type: %s\n", grid_type); + fprintf(stderr, "Nearest neighbour functionality is not supported for grid type: %s\n", grid_type); } } - GRIB_CHECK_NOLINE(err,0); + GRIB_CHECK_NOLINE(err, 0); { int nn_flag = 0; if (options->latlon_mask) { nn_flag = mode; /* ECC-638 */ } - GRIB_CHECK_NOLINE(grib_nearest_find(nearest,h,lat,lon,nn_flag, - options->lats,options->lons,options->values, - options->distances,options->indexes,&size),0); + GRIB_CHECK_NOLINE(grib_nearest_find(nearest, h, lat, lon, nn_flag, + options->lats, options->lons, options->values, + options->distances, options->indexes, &size), + 0); } if (!options->latlon_mask) { - min=options->distances[0]; - options->latlon_idx=0; - i=0; - for (i=1;i<4;i++) { - if (min>options->distances[i]) { - min=options->distances[i]; - options->latlon_idx=i; + min = options->distances[0]; + options->latlon_idx = 0; + i = 0; + for (i = 1; i < 4; i++) { + if (min > options->distances[i]) { + min = options->distances[i]; + options->latlon_idx = i; } } } if (json_latlon) { - char* s="\n[\n"; - double missingValue=9999; + char* s = "\n[\n"; + double missingValue = 9999; char value[MAX_STRING_LEN]; - size_t len=MAX_STRING_LEN; - printf("%s",new_handle); + size_t len = MAX_STRING_LEN; + printf("%s", new_handle); printf("{\n"); - print_key_values(options,h); - printf("\n, \"selected\" : %d",options->latlon_idx); + print_key_values(options, h); + printf("\n, \"selected\" : %d", options->latlon_idx); printf(", \"method\" : "); - if (options->latlon_mask) printf("\"nearest_land\""); - else printf("\"nearest\""); + if (options->latlon_mask) + printf("\"nearest_land\""); + else + printf("\"nearest\""); printf("\n, \"neighbours\" : "); - for (i=0;i<4;i++) { - printf("%s",s); - len=MAX_STRING_LEN; - printf("{\"index\" : %d, \"latitude\" : %g, \"longitude\" : %g, \"distance\" : %g, " - "\"distance_unit\" : \"km\", ", - (int)options->indexes[i],options->lats[i],options->lons[i], - options->distances[i]); - if (grib_get_double_element(h,"values",options->indexes[i],&v) == GRIB_SUCCESS) { - if (v==missingValue) printf("\"value\" : null "); - else printf("\"value\" : %g ",v); + for (i = 0; i < 4; i++) { + printf("%s", s); + len = MAX_STRING_LEN; + printf( + "{\"index\" : %d, \"latitude\" : %g, \"longitude\" : %g, \"distance\" : %g, " + "\"distance_unit\" : \"km\", ", + (int)options->indexes[i], options->lats[i], options->lons[i], + options->distances[i]); + if (grib_get_double_element(h, "values", options->indexes[i], &v) == GRIB_SUCCESS) { + if (v == missingValue) + printf("\"value\" : null "); + else + printf("\"value\" : %g ", v); } - if (grib_get_string( h,"units",value,&len)==GRIB_SUCCESS) - printf(", \"unit\" : \"%s\"",value); + if (grib_get_string(h, "units", value, &len) == GRIB_SUCCESS) + printf(", \"unit\" : \"%s\"", value); if (options->latlon_mask) - printf(", \"mask_value\" : %.2f",options->mask_values[i]); + printf(", \"mask_value\" : %.2f", options->mask_values[i]); printf("}"); - s="\n,"; + s = "\n,"; } printf("\n]"); @@ -343,15 +360,15 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) } if (!json_latlon && options->json_output) { - if (!first_handle && options->handle_count>1) { - fprintf(stdout,",\n"); + if (!first_handle && options->handle_count > 1) { + fprintf(stdout, ",\n"); } if (options->json_output && first_handle) { - fprintf(stdout,"{ \"messages\" : [ \n"); - first_handle=0; + fprintf(stdout, "{ \"messages\" : [ \n"); + first_handle = 0; } } - new_handle="\n,"; + new_handle = "\n,"; return 0; } @@ -366,59 +383,63 @@ int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) } /* key values can be printed here. Headers are already printed if requested */ -void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h) +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) { - grib_print_key_values(options,h); + grib_print_key_values(options, h); } /* This is executed after the last message in the last file is processed */ int grib_tool_finalise_action(grib_runtime_options* options) { - int i=0; + int i = 0; if (options->latlon && options->verbose) { - - printf("Input Point: latitude=%.2f longitude=%.2f\n",lat,lon); + printf("Input Point: latitude=%.2f longitude=%.2f\n", lat, lon); printf("Grid Point chosen #%d index=%d latitude=%.2f longitude=%.2f distance=%.2f (Km)\n", - options->latlon_idx+1,(int)options->indexes[options->latlon_idx], - options->lats[options->latlon_idx], - options->lons[options->latlon_idx], - options->distances[options->latlon_idx]); + options->latlon_idx + 1, (int)options->indexes[options->latlon_idx], + options->lats[options->latlon_idx], + options->lons[options->latlon_idx], + options->distances[options->latlon_idx]); if (options->latlon_mask) { printf("Mask values:\n"); - for (i=0;i<4;i++) { + for (i = 0; i < 4; i++) { printf("- %d - index=%d latitude=%.2f longitude=%.2f distance=%.2f (Km) value=%.2f\n", - i+1,(int)options->indexes[i],options->lats[i],options->lons[i], - options->distances[i],options->mask_values[i]); + i + 1, (int)options->indexes[i], options->lats[i], options->lons[i], + options->distances[i], options->mask_values[i]); } - } else { + } + else { printf("Other grid Points\n"); - for (i=0;i<4;i++) { + for (i = 0; i < 4; i++) { printf("- %d - index=%d latitude=%.2f longitude=%.2f distance=%.2f (Km)\n", - i+1,(int)options->indexes[i],options->lats[i],options->lons[i], - options->distances[i]); + i + 1, (int)options->indexes[i], options->lats[i], options->lons[i], + options->distances[i]); } } } - - if (!json_latlon && options->json_output) fprintf(stdout,"\n]}\n"); - if (nearest) grib_nearest_delete(nearest); - if (json_latlon) printf("\n]\n"); + if (!json_latlon && options->json_output) + fprintf(stdout, "\n]}\n"); + + if (nearest) + grib_nearest_delete(nearest); + if (json_latlon) + printf("\n]\n"); return 0; } int grib_no_handle_action(grib_runtime_options* options, int err) { - if (options->json_output){ + if (options->json_output) { if (first_handle) { - fprintf(dump_file,"{ \"messages\" : [ \n"); - first_handle=0; - } else { - fprintf(dump_file,",\n"); + fprintf(dump_file, "{ \"messages\" : [ \n"); + first_handle = 0; + } + else { + fprintf(dump_file, ",\n"); } } - fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\t\t\"ERROR: unreadable message\"\n"); return 0; } diff --git a/tools/grib_merge.c b/tools/grib_merge.c index 0fa6b78fb..d4db61ccc 100644 --- a/tools/grib_merge.c +++ b/tools/grib_merge.c @@ -26,46 +26,45 @@ #define MAX_KEY_VALUES 100 -grib_handle *hh=0; +grib_handle* hh = 0; grib_values key_values[MAX_KEY_VALUES]; -int key_values_size=MAX_KEY_VALUES; +int key_values_size = MAX_KEY_VALUES; /* This key was added to provide a unique ID for the product description used by the merge * tool to identify the fields to be merged */ static const char* md5Key = "md5Product"; -const char* grib_tool_description="Merge two fields with identical parameters and different geographical area"; -const char* grib_tool_name="grib_merge"; -const char* grib_tool_usage="[options] file file ... output_file"; - -grib_option grib_options[]={ - /* {id, args, help}, on, command_line, value */ - {"f",0,0,0,1,0}, - {"c",0,0,1,0,0}, - {"r",0,0,0,1,0}, - {"q",0,0,1,0,0}, - {"p:",0,0,1,1,0}, - {"P:",0,0,0,1,0}, - {"B:",0,0,1,1,"md5Product"}, - {"V",0,0,0,1,0}, - {"W:",0,0,0,1,0}, - {"M",0,0,0,1,0}, - {"U",0,0,1,0,0}, - {"H",0,0,1,0,0}, - {"T:",0,0,1,0,"G"}, - {"S",0,0,1,0,0}, - {"g",0,0,0,1,0}, - {"G",0,0,0,1,0}, - {"7",0,0,0,1,0}, - {"v",0,0,0,1,0} +const char* grib_tool_description = "Merge two fields with identical parameters and different geographical area"; +const char* grib_tool_name = "grib_merge"; +const char* grib_tool_usage = "[options] file file ... output_file"; + +grib_option grib_options[] = { + /* {id, args, help}, on, command_line, value */ + { "f", 0, 0, 0, 1, 0 }, + { "c", 0, 0, 1, 0, 0 }, + { "r", 0, 0, 0, 1, 0 }, + { "q", 0, 0, 1, 0, 0 }, + { "p:", 0, 0, 1, 1, 0 }, + { "P:", 0, 0, 0, 1, 0 }, + { "B:", 0, 0, 1, 1, "md5Product" }, + { "V", 0, 0, 0, 1, 0 }, + { "W:", 0, 0, 0, 1, 0 }, + { "M", 0, 0, 0, 1, 0 }, + { "U", 0, 0, 1, 0, 0 }, + { "H", 0, 0, 1, 0, 0 }, + { "T:", 0, 0, 1, 0, "G" }, + { "S", 0, 0, 1, 0, 0 }, + { "g", 0, 0, 0, 1, 0 }, + { "G", 0, 0, 0, 1, 0 }, + { "7", 0, 0, 0, 1, 0 }, + { "v", 0, 0, 0, 1, 0 } }; -int grib_options_count=sizeof(grib_options)/sizeof(grib_option); +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - int ret=grib_tool(argc,argv); - return ret; + return grib_tool(argc, argv); } int grib_tool_before_getopt(grib_runtime_options* options) @@ -78,55 +77,60 @@ int grib_tool_init(grib_runtime_options* options) return 0; } -int grib_tool_new_filename_action(grib_runtime_options* options,const char* file) +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) { return 0; } -int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file) +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { return 0; } -static int idx(double lat,double lon,double latFirst,double lonFirst,double latLast,double lonLast, - long Ni,double di,double dj) +static int idx(double lat, double lon, double latFirst, double lonFirst, double latLast, double lonLast, + long Ni, double di, double dj) { - long ilon,ilat; - if ((ilon=(lon-lonFirst)/di) < 0 ) return -1; - if ((ilat=(latFirst-lat)/dj) < 0 ) return -1; - if (lon>lonLast) { - if (lonLast==180) { - lon-=360; - ilon=(lon-lonFirst)/di; - } else + long ilon, ilat; + if ((ilon = (lon - lonFirst) / di) < 0) + return -1; + if ((ilat = (latFirst - lat) / dj) < 0) + return -1; + if (lon > lonLast) { + if (lonLast == 180) { + lon -= 360; + ilon = (lon - lonFirst) / di; + } + else return -1; } - if (latcontext,GRIB_LOG_ERROR,"gridType=%s not supported",s2); + len2 = sizeof(s2) / sizeof(*s2); + err = grib_get_string(h2, "gridType", s2, &len2); + if (strcmp(s2, "regular_ll")) { + grib_context_log(h1->context, GRIB_LOG_ERROR, "gridType=%s not supported", s2); return NULL; } - len1=sizeof(s1)/sizeof(*s1); - err=grib_get_string(h1,"gridType",s1,&len1); - if (strcmp(s1,"regular_ll")) { - grib_context_log(h1->context,GRIB_LOG_ERROR,"gridType=%s not supported",s1); + len1 = sizeof(s1) / sizeof(*s1); + err = grib_get_string(h1, "gridType", s1, &len1); + if (strcmp(s1, "regular_ll")) { + grib_context_log(h1->context, GRIB_LOG_ERROR, "gridType=%s not supported", s1); return NULL; } - if (!grib_key_equal(h1,h2,"iDirectionIncrementInDegrees",GRIB_TYPE_DOUBLE,&err) ) { - grib_context_log(h1->context,GRIB_LOG_ERROR, - "unable to merge: different iDirectionIncrementInDegrees"); + if (!grib_key_equal(h1, h2, "iDirectionIncrementInDegrees", GRIB_TYPE_DOUBLE, &err)) { + grib_context_log(h1->context, GRIB_LOG_ERROR, + "unable to merge: different iDirectionIncrementInDegrees"); return NULL; } - if (!grib_key_equal(h1,h2,"jDirectionIncrementInDegrees",GRIB_TYPE_DOUBLE,&err) ) { - grib_context_log(h1->context,GRIB_LOG_ERROR, - "unable to merge: different jDirectionIncrementInDegrees"); + if (!grib_key_equal(h1, h2, "jDirectionIncrementInDegrees", GRIB_TYPE_DOUBLE, &err)) { + grib_context_log(h1->context, GRIB_LOG_ERROR, + "unable to merge: different jDirectionIncrementInDegrees"); return NULL; } - grib_get_long(h1,"latitudeOfFirstGridPoint",&l1); - grib_get_long(h2,"latitudeOfFirstGridPoint",&l2); - grib_get_long(h2,"jDirectionIncrement",&idj); - if ( (l1-l2) % idj ) { - grib_context_log(h1->context,GRIB_LOG_ERROR, "unable to merge: incompatible grid"); + grib_get_long(h1, "latitudeOfFirstGridPoint", &l1); + grib_get_long(h2, "latitudeOfFirstGridPoint", &l2); + grib_get_long(h2, "jDirectionIncrement", &idj); + if ((l1 - l2) % idj) { + grib_context_log(h1->context, GRIB_LOG_ERROR, "unable to merge: incompatible grid"); return NULL; } - grib_get_long(h1,"longitudeOfFirstGridPoint",&l1); - grib_get_long(h2,"longitudeOfFirstGridPoint",&l2); - grib_get_long(h2,"iDirectionIncrement",&idi); - if ( (l1-l2) % idi ) { - grib_context_log(h1->context,GRIB_LOG_ERROR, "unable to merge: incompatible grid"); + grib_get_long(h1, "longitudeOfFirstGridPoint", &l1); + grib_get_long(h2, "longitudeOfFirstGridPoint", &l2); + grib_get_long(h2, "iDirectionIncrement", &idi); + if ((l1 - l2) % idi) { + grib_context_log(h1->context, GRIB_LOG_ERROR, "unable to merge: incompatible grid"); return NULL; } @@ -187,11 +191,10 @@ static grib_handle* merge(grib_handle* h1,grib_handle* h2) /* do we have something to do?*/ - if ( grib_key_equal(h1,h2,"latitudeOfFirstGridPointInDegrees",GRIB_TYPE_DOUBLE,&err) && - grib_key_equal(h1,h2,"latitudeOfLastGridPointInDegrees",GRIB_TYPE_DOUBLE,&err) && - grib_key_equal(h1,h2,"longitudeOfFirstGridPointInDegrees",GRIB_TYPE_DOUBLE,&err) && - grib_key_equal(h1,h2,"longitudeOfLastGridPointInDegrees",GRIB_TYPE_DOUBLE,&err) - ) { + if (grib_key_equal(h1, h2, "latitudeOfFirstGridPointInDegrees", GRIB_TYPE_DOUBLE, &err) && + grib_key_equal(h1, h2, "latitudeOfLastGridPointInDegrees", GRIB_TYPE_DOUBLE, &err) && + grib_key_equal(h1, h2, "longitudeOfFirstGridPointInDegrees", GRIB_TYPE_DOUBLE, &err) && + grib_key_equal(h1, h2, "longitudeOfLastGridPointInDegrees", GRIB_TYPE_DOUBLE, &err)) { /* no we don't */ return NULL; } @@ -199,25 +202,29 @@ static grib_handle* merge(grib_handle* h1,grib_handle* h2) /* yes we do! */ /* check scanning mode */ - grib_get_long(h1,"iScansNegatively",&iscan); - if (iscan) grib_set_long(h1,"swapScanningLon",1); - grib_get_long(h2,"iScansNegatively",&iscan); - if (iscan) grib_set_long(h2,"swapScanningLon",1); - - grib_get_long(h1,"jScansPositively",&jscan); - if (jscan) grib_set_long(h1,"swapScanningLat",1); - grib_get_long(h2,"jScansPositively",&jscan); - if (jscan) grib_set_long(h2,"swapScanningLat",1); - - grib_get_double(h1,"latitudeOfFirstGridPointInDegrees",&latFirst1); - grib_get_double(h2,"latitudeOfFirstGridPointInDegrees",&latFirst2); - grib_get_double(h1,"longitudeOfFirstGridPointInDegrees",&lonFirst1); - grib_get_double(h2,"longitudeOfFirstGridPointInDegrees",&lonFirst2); - - grib_get_double(h1,"latitudeOfLastGridPointInDegrees",&latLast1); - grib_get_double(h2,"latitudeOfLastGridPointInDegrees",&latLast2); - grib_get_double(h1,"longitudeOfLastGridPointInDegrees",&lonLast1); - grib_get_double(h2,"longitudeOfLastGridPointInDegrees",&lonLast2); + grib_get_long(h1, "iScansNegatively", &iscan); + if (iscan) + grib_set_long(h1, "swapScanningLon", 1); + grib_get_long(h2, "iScansNegatively", &iscan); + if (iscan) + grib_set_long(h2, "swapScanningLon", 1); + + grib_get_long(h1, "jScansPositively", &jscan); + if (jscan) + grib_set_long(h1, "swapScanningLat", 1); + grib_get_long(h2, "jScansPositively", &jscan); + if (jscan) + grib_set_long(h2, "swapScanningLat", 1); + + grib_get_double(h1, "latitudeOfFirstGridPointInDegrees", &latFirst1); + grib_get_double(h2, "latitudeOfFirstGridPointInDegrees", &latFirst2); + grib_get_double(h1, "longitudeOfFirstGridPointInDegrees", &lonFirst1); + grib_get_double(h2, "longitudeOfFirstGridPointInDegrees", &lonFirst2); + + grib_get_double(h1, "latitudeOfLastGridPointInDegrees", &latLast1); + grib_get_double(h2, "latitudeOfLastGridPointInDegrees", &latLast2); + grib_get_double(h1, "longitudeOfLastGridPointInDegrees", &lonLast1); + grib_get_double(h2, "longitudeOfLastGridPointInDegrees", &lonLast2); /* ECC-949 */ if (lonFirst1 == 180 && lonLast1 == 180) { @@ -227,120 +234,128 @@ static grib_handle* merge(grib_handle* h1,grib_handle* h2) lonFirst2 = -180; } - latFirst = latFirst1>latFirst2 ? latFirst1 : latFirst2; - lonFirst = lonFirst1lonLast2 ? lonLast1 : lonLast2; - - grib_get_double(h1,"iDirectionIncrementInDegrees",&di1); - grib_get_double(h1,"jDirectionIncrementInDegrees",&dj1); - grib_get_double(h2,"iDirectionIncrementInDegrees",&di2); - grib_get_double(h2,"jDirectionIncrementInDegrees",&dj2); - grib_get_double(h1,"iDirectionIncrementInDegrees",&di); - grib_get_double(h1,"jDirectionIncrementInDegrees",&dj); - grib_get_long(h1,"Ni",&Ni1); - grib_get_long(h1,"Nj",&Nj1); - grib_get_long(h2,"Ni",&Ni2); - grib_get_long(h2,"Nj",&Nj2); - - if (lonFirst==0 && lonLast==360) lonLast-=di; - if (lonFirst==-180 && lonLast==180) { - lonFirst=0; - lonLast=360-di; + latFirst = latFirst1 > latFirst2 ? latFirst1 : latFirst2; + lonFirst = lonFirst1 < lonFirst2 ? lonFirst1 : lonFirst2; + + latLast = latLast1 < latLast2 ? latLast1 : latLast2; + lonLast = lonLast1 > lonLast2 ? lonLast1 : lonLast2; + + grib_get_double(h1, "iDirectionIncrementInDegrees", &di1); + grib_get_double(h1, "jDirectionIncrementInDegrees", &dj1); + grib_get_double(h2, "iDirectionIncrementInDegrees", &di2); + grib_get_double(h2, "jDirectionIncrementInDegrees", &dj2); + grib_get_double(h1, "iDirectionIncrementInDegrees", &di); + grib_get_double(h1, "jDirectionIncrementInDegrees", &dj); + grib_get_long(h1, "Ni", &Ni1); + grib_get_long(h1, "Nj", &Nj1); + grib_get_long(h2, "Ni", &Ni2); + grib_get_long(h2, "Nj", &Nj2); + + if (lonFirst == 0 && lonLast == 360) + lonLast -= di; + if (lonFirst == -180 && lonLast == 180) { + lonFirst = 0; + lonLast = 360 - di; } /* create new grib for bigger area*/ - h=grib_handle_clone(h1); - grib_set_double(h,"latitudeOfFirstGridPointInDegrees",latFirst); - grib_set_double(h,"longitudeOfFirstGridPointInDegrees",lonFirst); - grib_set_double(h,"latitudeOfLastGridPointInDegrees",latLast); - grib_set_double(h,"longitudeOfLastGridPointInDegrees",lonLast); - Ni=fabs(lonLast-lonFirst)/di+1; - Nj=fabs(latLast-latFirst)/dj+1; - - grib_set_long(h,"Ni",Ni); - grib_set_long(h,"Nj",Nj); - - grib_get_long(h,"bitmapPresent",&bitmapPresent); - if (!bitmapPresent) grib_set_long(h,"bitmapPresent",1); - - grib_get_long(h,"numberOfPoints",&n); - grib_get_double(h,"missingValue",&missingValue); - v=(double*)grib_context_malloc_clear(h->context,sizeof(double)*n); - for (i=0;icontext,sizeof(double)*n); - lon=(double*)grib_context_malloc_clear(h->context,sizeof(double)*n); - sn=n; - grib_get_double_array(h,"latitudes",lat,&sn); - grib_get_double_array(h,"longitudes",lon,&sn); - - grib_get_long(h1,"numberOfPoints",&n1); - v1=(double*)grib_context_malloc_clear(h->context,sizeof(double)*n1); - lat1=(double*)grib_context_malloc_clear(h->context,sizeof(double)*n1); - lon1=(double*)grib_context_malloc_clear(h->context,sizeof(double)*n1); - sn=n1; - grib_get_double_array(h1,"latitudes",lat1,&sn); - grib_get_double_array(h1,"longitudes",lon1,&sn); - grib_get_double_array(h1,"values",v1,&sn); - - grib_get_long(h2,"numberOfPoints",&n2); - v2=(double*)grib_context_malloc_clear(h->context,sizeof(double)*n2); - lat2=(double*)grib_context_malloc_clear(h->context,sizeof(double)*n2); - lon2=(double*)grib_context_malloc_clear(h->context,sizeof(double)*n2); - sn=n2; - grib_get_double_array(h2,"latitudes",lat2,&sn); - grib_get_double_array(h2,"longitudes",lon2,&sn); - grib_get_double_array(h2,"values",v2,&sn); - - for (i=0;i=0 ) { - v[i]=v1[j]; - } else if ( (j=idx(lat[i],lon[i],latFirst2,lonFirst2,latLast2,lonLast2,Ni2,di2,dj2))>=0) { - v[i]=v2[j]; + h = grib_handle_clone(h1); + grib_set_double(h, "latitudeOfFirstGridPointInDegrees", latFirst); + grib_set_double(h, "longitudeOfFirstGridPointInDegrees", lonFirst); + grib_set_double(h, "latitudeOfLastGridPointInDegrees", latLast); + grib_set_double(h, "longitudeOfLastGridPointInDegrees", lonLast); + Ni = fabs(lonLast - lonFirst) / di + 1; + Nj = fabs(latLast - latFirst) / dj + 1; + + grib_set_long(h, "Ni", Ni); + grib_set_long(h, "Nj", Nj); + + grib_get_long(h, "bitmapPresent", &bitmapPresent); + if (!bitmapPresent) + grib_set_long(h, "bitmapPresent", 1); + + grib_get_long(h, "numberOfPoints", &n); + grib_get_double(h, "missingValue", &missingValue); + v = (double*)grib_context_malloc_clear(h->context, sizeof(double) * n); + for (i = 0; i < n; i++) + v[i] = 1.0; + sn = n; + grib_set_double_array(h, "values", v, sn); + for (i = 0; i < n; i++) + v[i] = missingValue; + lat = (double*)grib_context_malloc_clear(h->context, sizeof(double) * n); + lon = (double*)grib_context_malloc_clear(h->context, sizeof(double) * n); + sn = n; + grib_get_double_array(h, "latitudes", lat, &sn); + grib_get_double_array(h, "longitudes", lon, &sn); + + grib_get_long(h1, "numberOfPoints", &n1); + v1 = (double*)grib_context_malloc_clear(h->context, sizeof(double) * n1); + lat1 = (double*)grib_context_malloc_clear(h->context, sizeof(double) * n1); + lon1 = (double*)grib_context_malloc_clear(h->context, sizeof(double) * n1); + sn = n1; + grib_get_double_array(h1, "latitudes", lat1, &sn); + grib_get_double_array(h1, "longitudes", lon1, &sn); + grib_get_double_array(h1, "values", v1, &sn); + + grib_get_long(h2, "numberOfPoints", &n2); + v2 = (double*)grib_context_malloc_clear(h->context, sizeof(double) * n2); + lat2 = (double*)grib_context_malloc_clear(h->context, sizeof(double) * n2); + lon2 = (double*)grib_context_malloc_clear(h->context, sizeof(double) * n2); + sn = n2; + grib_get_double_array(h2, "latitudes", lat2, &sn); + grib_get_double_array(h2, "longitudes", lon2, &sn); + grib_get_double_array(h2, "values", v2, &sn); + + for (i = 0; i < n; i++) { + if ((j = idx(lat[i], lon[i], latFirst1, lonFirst1, latLast1, lonLast1, Ni1, di1, dj1)) >= 0) { + v[i] = v1[j]; + } + else if ((j = idx(lat[i], lon[i], latFirst2, lonFirst2, latLast2, lonLast2, Ni2, di2, dj2)) >= 0) { + v[i] = v2[j]; } } - grib_set_double_array(h,"values",v,n); + grib_set_double_array(h, "values", v, n); return h; } int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) { - int err=0; - grib_handle* hm=0; - char md5[200]={0,}; - char fname[256]={0,}; - size_t lmd5=32; - - if (!hh) { hh=grib_handle_clone(h); return 0; } - err = grib_get_string(h,md5Key,md5,&lmd5); + int err = 0; + grib_handle* hm = 0; + char md5[200] = {0,}; + char fname[256] = {0,}; + size_t lmd5 = 32; + + if (!hh) { + hh = grib_handle_clone(h); + return 0; + } + err = grib_get_string(h, md5Key, md5, &lmd5); if (err) { - fprintf(stderr, "grib_merge error getting key %s: %s\n", + fprintf(stderr, "grib_merge error getting key %s: %s\n", md5Key, grib_get_error_message(err)); exit(err); } - sprintf(fname,"_%s.orig.grib",md5); - err = grib_write_message(h,fname,"a"); + sprintf(fname, "_%s.orig.grib", md5); + err = grib_write_message(h, fname, "a"); - if ((hm=merge(h,hh))==NULL ) { - grib_tools_write_message(options,hh); - lmd5=sizeof(md5)/sizeof(*md5); - err = grib_get_string(hh,md5Key,md5,&lmd5); + if ((hm = merge(h, hh)) == NULL) { + grib_tools_write_message(options, hh); + lmd5 = sizeof(md5) / sizeof(*md5); + err = grib_get_string(hh, md5Key, md5, &lmd5); if (err) { - fprintf(stderr, "grib_merge error getting key %s: %s\n", + fprintf(stderr, "grib_merge error getting key %s: %s\n", md5Key, grib_get_error_message(err)); exit(err); } - sprintf(fname,"_%s.merge.grib",md5); - grib_write_message(hh,fname,"a"); + sprintf(fname, "_%s.merge.grib", md5); + grib_write_message(hh, fname, "a"); } grib_handle_delete(hh); - hh = hm!=NULL ? hm : grib_handle_clone(h) ; + hh = hm != NULL ? hm : grib_handle_clone(h); return err; } @@ -351,14 +366,14 @@ int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) return 0; } -void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h) +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) { - grib_print_key_values(options,h); + grib_print_key_values(options, h); } int grib_tool_finalise_action(grib_runtime_options* options) { - grib_tools_write_message(options,hh); + grib_tools_write_message(options, hh); if (options->outfile->file) { fclose(options->outfile->file); } @@ -367,6 +382,6 @@ int grib_tool_finalise_action(grib_runtime_options* options) int grib_no_handle_action(grib_runtime_options* options, int err) { - fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\t\t\"ERROR: unreadable message\"\n"); return 0; } diff --git a/tools/grib_nearest_land.c b/tools/grib_nearest_land.c index b9b6ddc7d..12cd58185 100644 --- a/tools/grib_nearest_land.c +++ b/tools/grib_nearest_land.c @@ -19,88 +19,134 @@ #include "grib_api_internal.h" -static void usage(char* prog) { - printf("Usage: %s latlon_file grib_orography grib_file grib_file ...\n",prog); - exit(1); +static void usage(char* prog) +{ + printf("Usage: %s latlon_file grib_orography grib_file grib_file ...\n", prog); + exit(1); } -int main(int argc, char** argv) { - FILE* fin=0; - int ret=0; - char* fname=0; - float lat,lon; - double *vlat,*vlon; - int npoints=0,i=0,n=0; - grib_handle* h; - double *outlats,*outlons,*values,*lsm_values,*distances; - size_t* indexes; - - if (argc < 2) usage(argv[0]); - - fname=argv[1]; - fin=fopen(fname,"r"); - if(!fin) { perror(fname); exit(1); } - npoints=0; - while (fscanf(fin,"%g %g",&lat,&lon) != EOF) npoints++; - fclose(fin); - - vlat=(double*)malloc(npoints*sizeof(double)); - if (!vlat) {printf("unable to allocate %d bytes\n",npoints*sizeof(double));exit(1);} - vlon=(double*)malloc(npoints*sizeof(double)); - if (!vlon) {printf("unable to allocate %d bytes\n",npoints*sizeof(double));exit(1);} - outlats=(double*)malloc(npoints*sizeof(double)); - if (!outlats) {printf("unable to allocate %d bytes\n",npoints*sizeof(double));exit(1);} - outlons=(double*)malloc(npoints*sizeof(double)); - if (!outlons) {printf("unable to allocate %d bytes\n",npoints*sizeof(double));exit(1);} - values=(double*)malloc(npoints*sizeof(double)); - if (!values) {printf("unable to allocate %d bytes\n",npoints*sizeof(double));exit(1);} - lsm_values=(double*)malloc(npoints*sizeof(double)); - if (!lsm_values) {printf("unable to allocate %d bytes\n",npoints*sizeof(double));exit(1);} - distances=(double*)malloc(npoints*sizeof(double)); - if (!distances) {printf("unable to allocate %d bytes\n",npoints*sizeof(double));exit(1);} - indexes=(size_t*)malloc(npoints*sizeof(double)); - if (!indexes) {printf("unable to allocate %d bytes\n",npoints*sizeof(double));exit(1);} - - fname=argv[1]; - fin=fopen(fname,"r"); - if(!fin) { perror(fname); exit(1); } - i=0; - while (fscanf(fin,"%g %g",&lat,&lon) != EOF) {vlat[i]=lat; vlon[i]=lon>0 ? lon : lon+360; i++;} - fclose(fin); - - fname=argv[2]; - fin=fopen(fname,"r"); - if(!fin) { perror(fname); exit(1); } - h=grib_handle_new_from_file(0,fin,&ret); - if (!h || ret!=GRIB_SUCCESS) {printf(" unable to create handle\n");exit(1);} - - grib_nearest_find_multiple(h,1,vlat,vlon,npoints, - outlats,outlons,lsm_values,distances,indexes); - - grib_handle_delete(h); - - fclose(fin); - - for (n=3;n<=argc-1;n++) { - fname=argv[n]; - fin=fopen(fname,"r"); - if(!fin) { perror(fname); exit(1); } - while ((h=grib_handle_new_from_file(0,fin,&ret))!=NULL) { - grib_get_double_elements(h,"values",indexes,npoints,values); - - grib_handle_delete(h); - for (i=0;i 0 ? lon : lon + 360; + i++; + } fclose(fin); - } + fname = argv[2]; + fin = fopen(fname, "r"); + if (!fin) { + perror(fname); + exit(1); + } + h = grib_handle_new_from_file(0, fin, &ret); + if (!h || ret != GRIB_SUCCESS) { + printf(" unable to create handle\n"); + exit(1); + } + + grib_nearest_find_multiple(h, 1, vlat, vlon, npoints, + outlats, outlons, lsm_values, distances, indexes); + + grib_handle_delete(h); + + fclose(fin); + + for (n = 3; n <= argc - 1; n++) { + fname = argv[n]; + fin = fopen(fname, "r"); + if (!fin) { + perror(fname); + exit(1); + } + while ((h = grib_handle_new_from_file(0, fin, &ret)) != NULL) { + grib_get_double_elements(h, "values", indexes, npoints, values); + + grib_handle_delete(h); + for (i = 0; i < npoints; i++) + printf("%g %g %g %g %g %g\n", + vlat[i], vlon[i], + outlats[i], outlons[i], + lsm_values[i], values[i]); + } + + + fclose(fin); + } - return ret; + return ret; } diff --git a/tools/grib_options.c b/tools/grib_options.c index fec745b32..45208afd3 100644 --- a/tools/grib_options.c +++ b/tools/grib_options.c @@ -14,118 +14,119 @@ */ #include "grib_tools.h" -extern char *optarg; +extern char* optarg; extern int optind; #ifdef ECCODES_ON_WINDOWS #include "wingetopt.h" #endif -static const char* names[]={"parameter","vertical","geography","data","mars","local"}; -static int names_count=6; +static const char* names[] = { "parameter", "vertical", "geography", "data", "mars", "local" }; +static int names_count = 6; /* id,args,help */ -static grib_options_help grib_options_help_list[] ={ - {"a",0,"Dump aliases.\n"}, - {"b:","key,key,...", - "\n\t\tAll the keys in this list are skipped in the comparison. Bit-by-bit compare on.\n"}, - {"B:","'order by' directive", - "\n\t\tOrder by. The output will be ordered according to the 'order by' directive." - "\n\t\tExample: \"step:i asc, centre desc\" (step numeric ascending and centre descending)\n"}, - {"c:","key[:i|d|s|n],key[:i|d|s|n],...", - "\n\t\tOnly the listed keys or namespaces (:n) are compared. The optional letter after the colon is used " - "\n\t\tto force the type in the comparison: i->integer, d->float, s->string, n->namespace." - "\n\t\tSee -a option. Incompatible with -H option.\n"}, - {"d:","value", - "\n\t\tSet all the data values to \"value\".\n"}, - {"e:","tolerance","\n\t\tOnly values whose difference is more than tolerance are considered different.\n"}, - {"f",0,"Force. Force the execution not to fail on error.\n"}, - {"F:","format","\n\t\tC style format for floating-point values.\n"}, - {"g",0,"Copy GTS header. \n"}, - {"G",0,"GRIBEX compatibility mode.\n"}, - {"i:","index", - "\n\t\tData value corresponding to the given index is printed.\n"}, - {"j",0,"JSON mode (JavaScript Object Notation).\n"}, - {"l:","Latitude,Longitude[,MODE,file]", - "\n\t\tValue close to the point of a Latitude,Longitude." - "\n\t\tAllowed values for MODE are:" - "\n\t\t 4 (4 values in the nearest points are printed) Default" - "\n\t\t 1 (the value at the nearest point is printed)" - "\n\t\tfile (file is used as mask. The closer point with mask value>=0.5 is printed)\n" - }, - {"n:","namespace", - "\n\t\tAll the keys belonging to namespace are printed.\n"}, - {"m",0,"Mars keys are printed.\n"}, - {"o:","output_file", - "\n\t\tOutput is written to output_file." - "\n\t\tIf an output file is required and -o is not used, the" - " output is written to 'filter.out'\n"}, - {"p:","key[:{s|d|i}],key[:{s|d|i}],...", - "\n\t\tDeclaration of keys to print." - "\n\t\tFor each key a string (key:s), a double (key:d) or an integer (key:i)" - "\n\t\ttype can be requested. Default type is string.\n"}, - {"q",0,"Quiet.\n"}, - {"r",0,"Repack data. Sometimes after setting some keys involving properties" - "\n\t\tof the packing algorithm a repacking of data is needed." - "\n\t\tThis repacking is performed setting this -r option.\n"}, - {"s:","key[:{s|d|i}]=value,key[:{s|d|i}]=value,...", - "\n\t\tKey/values to set." - "\n\t\tFor each key a string (key:s), a double (key:d) or an integer (key:i)" - "\n\t\ttype can be defined. By default the native type is set.\n"}, - {"t",0,"Print type information.\n"}, - {"w:","key[:{s|d|i}]{=|!=}value,key[:{s|d|i}]{=|!=}value,...", - "\n\t\tWhere clause." - "\n\t\tMessages are processed only if they match all the" - " key/value constraints." - "\n\t\tA valid constraint is of type key=value or key!=value." - "\n\t\tFor each key a string (key:s), a double (key:d) or" - " an integer (key:i)\n\t\ttype can be specified. Default type is string." - "\n\t\tIn the value you can also use the forward-slash character '/' to specify an OR condition (i.e. a logical disjunction)" - "\n\t\tNote: only one -w clause is allowed.\n" - }, - {"v",0,"Verbose.\n"}, - {"7",0,"Does not fail when the message has wrong length\n"}, - {"A:","absolute error\n", - "\tCompare floating-point values using the absolute error as tolerance.\n\t\tDefault is absolute error=0\n"}, - {"C",0,"C code mode. A C code program generating the message is dumped.\n"}, - {"D",0,"Debug mode.\n"}, - {"H",0,"Print octet content in hexadecimal format.\n"}, - {"M",0,"Multi-field support off. Turn off support for multiple fields in single GRIB message.\n"}, - {"O",0,"Octet mode. WMO documentation style dump.\n"}, - {"P:","key[:{s|d|i}],key[:{s|d|i}],...", - "\n\t\tAs -p adding the declared keys to the default list.\n"}, - {"R:","key1=relative_error1,key2=relative_error2,...\n", - "\tCompare floating-point values using the relative error as tolerance." - "\n\t\tkey1=relative_error1 will compare key1 using relative_error1." - "\n\t\tall=relative_error will compare all the floating-point keys using relative_error. Default all=0.\n"}, - {"S",0,"Strict. Only messages matching all the constraints are copied to" - "\n\t\tthe output file\n"}, - {"T:","T | B | M | A","Message type. T->GTS, B->BUFR, M->METAR (Experimental), A->Any (Experimental).\n\t\t\t\tThe input file is interpreted according to the message type.\n"}, - {"V",0,"Version.\n"}, - {"W:","width","\n\t\tMinimum width of each column in output. Default is 10.\n"}, - {"X:","offset","\n\t\tInput file offset in bytes. Processing of the input file will start from \"offset\".\n"}, - {"x",0,"Fast parsing option, only headers are loaded.\n"}, - {"k:","key1,key2,...","\n\t\tSpecify a list of keys to index on. By default the input files are indexed on the MARS keys." - "\n\t\tFor each key a string (key:s) or a double (key:d) or an integer (key:i)" - "\n\t\ttype can be requested.\n"} +static grib_options_help grib_options_help_list[] = { + { "a", 0, "Dump aliases.\n" }, + { "b:", "key,key,...", + "\n\t\tAll the keys in this list are skipped in the comparison. Bit-by-bit compare on.\n" }, + { "B:", "'order by' directive", + "\n\t\tOrder by. The output will be ordered according to the 'order by' directive." + "\n\t\tExample: \"step:i asc, centre desc\" (step numeric ascending and centre descending)\n" }, + { "c:", "key[:i|d|s|n],key[:i|d|s|n],...", + "\n\t\tOnly the listed keys or namespaces (:n) are compared. The optional letter after the colon is used " + "\n\t\tto force the type in the comparison: i->integer, d->float, s->string, n->namespace." + "\n\t\tSee -a option. Incompatible with -H option.\n" }, + { "d:", "value", + "\n\t\tSet all the data values to \"value\".\n" }, + { "e:", "tolerance", "\n\t\tOnly values whose difference is more than tolerance are considered different.\n" }, + { "f", 0, "Force. Force the execution not to fail on error.\n" }, + { "F:", "format", "\n\t\tC style format for floating-point values.\n" }, + { "g", 0, "Copy GTS header. \n" }, + { "G", 0, "GRIBEX compatibility mode.\n" }, + { "i:", "index", + "\n\t\tData value corresponding to the given index is printed.\n" }, + { "j", 0, "JSON mode (JavaScript Object Notation).\n" }, + { "l:", "Latitude,Longitude[,MODE,file]", + "\n\t\tValue close to the point of a Latitude,Longitude." + "\n\t\tAllowed values for MODE are:" + "\n\t\t 4 (4 values in the nearest points are printed) Default" + "\n\t\t 1 (the value at the nearest point is printed)" + "\n\t\tfile (file is used as mask. The closer point with mask value>=0.5 is printed)\n" }, + { "n:", "namespace", + "\n\t\tAll the keys belonging to namespace are printed.\n" }, + { "m", 0, "Mars keys are printed.\n" }, + { "o:", "output_file", + "\n\t\tOutput is written to output_file." + "\n\t\tIf an output file is required and -o is not used, the" + " output is written to 'filter.out'\n" }, + { "p:", "key[:{s|d|i}],key[:{s|d|i}],...", + "\n\t\tDeclaration of keys to print." + "\n\t\tFor each key a string (key:s), a double (key:d) or an integer (key:i)" + "\n\t\ttype can be requested. Default type is string.\n" }, + { "q", 0, "Quiet.\n" }, + { "r", 0, + "Repack data. Sometimes after setting some keys involving properties" + "\n\t\tof the packing algorithm a repacking of data is needed." + "\n\t\tThis repacking is performed setting this -r option.\n" }, + { "s:", "key[:{s|d|i}]=value,key[:{s|d|i}]=value,...", + "\n\t\tKey/values to set." + "\n\t\tFor each key a string (key:s), a double (key:d) or an integer (key:i)" + "\n\t\ttype can be defined. By default the native type is set.\n" }, + { "t", 0, "Print type information.\n" }, + { "w:", "key[:{s|d|i}]{=|!=}value,key[:{s|d|i}]{=|!=}value,...", + "\n\t\tWhere clause." + "\n\t\tMessages are processed only if they match all the" + " key/value constraints." + "\n\t\tA valid constraint is of type key=value or key!=value." + "\n\t\tFor each key a string (key:s), a double (key:d) or" + " an integer (key:i)\n\t\ttype can be specified. Default type is string." + "\n\t\tIn the value you can also use the forward-slash character '/' to specify an OR condition (i.e. a logical disjunction)" + "\n\t\tNote: only one -w clause is allowed.\n" }, + { "v", 0, "Verbose.\n" }, + { "7", 0, "Does not fail when the message has wrong length\n" }, + { "A:", "absolute error\n", + "\tCompare floating-point values using the absolute error as tolerance.\n\t\tDefault is absolute error=0\n" }, + { "C", 0, "C code mode. A C code program generating the message is dumped.\n" }, + { "D", 0, "Debug mode.\n" }, + { "H", 0, "Print octet content in hexadecimal format.\n" }, + { "M", 0, "Multi-field support off. Turn off support for multiple fields in single GRIB message.\n" }, + { "O", 0, "Octet mode. WMO documentation style dump.\n" }, + { "P:", "key[:{s|d|i}],key[:{s|d|i}],...", + "\n\t\tAs -p adding the declared keys to the default list.\n" }, + { "R:", "key1=relative_error1,key2=relative_error2,...\n", + "\tCompare floating-point values using the relative error as tolerance." + "\n\t\tkey1=relative_error1 will compare key1 using relative_error1." + "\n\t\tall=relative_error will compare all the floating-point keys using relative_error. Default all=0.\n" }, + { "S", 0, + "Strict. Only messages matching all the constraints are copied to" + "\n\t\tthe output file\n" }, + { "T:", "T | B | M | A", "Message type. T->GTS, B->BUFR, M->METAR (Experimental), A->Any (Experimental).\n\t\t\t\tThe input file is interpreted according to the message type.\n" }, + { "V", 0, "Version.\n" }, + { "W:", "width", "\n\t\tMinimum width of each column in output. Default is 10.\n" }, + { "X:", "offset", "\n\t\tInput file offset in bytes. Processing of the input file will start from \"offset\".\n" }, + { "x", 0, "Fast parsing option, only headers are loaded.\n" }, + { "k:", "key1,key2,...", + "\n\t\tSpecify a list of keys to index on. By default the input files are indexed on the MARS keys." + "\n\t\tFor each key a string (key:s) or a double (key:d) or an integer (key:i)" + "\n\t\ttype can be requested.\n" } }; -static int grib_options_help_count=sizeof(grib_options_help_list)/sizeof(grib_options_help); +static int grib_options_help_count = sizeof(grib_options_help_list) / sizeof(grib_options_help); void usage(void) { - int i=0; - printf("\nNAME \t%s\n\n",grib_tool_name); - printf("DESCRIPTION\n\t%s\n\n",grib_tool_description); - printf("USAGE \n\t%s %s\n\n",grib_tool_name,grib_tool_usage); + int i = 0; + printf("\nNAME \t%s\n\n", grib_tool_name); + printf("DESCRIPTION\n\t%s\n\n", grib_tool_description); + printf("USAGE \n\t%s %s\n\n", grib_tool_name, grib_tool_usage); printf("OPTIONS\n"); - for (i=0;iorderby=grib_options_get_option("B:"); + options->orderby = grib_options_get_option("B:"); - if (grib_options_on("x")) options->headers_only=1; - else options->headers_only=0; + if (grib_options_on("x")) + options->headers_only = 1; + else + options->headers_only = 0; if (grib_options_on("T:")) { - char* x=grib_options_get_option("T:"); - if ( *x == 'T' ) options->mode=MODE_GTS; - else if ( *x == 'B' ) options->mode=MODE_BUFR; - else if ( *x == 'M' ) options->mode=MODE_METAR; - else if ( *x == 'F' ) options->mode=MODE_TAF; - else if ( *x == 'A' ) options->mode=MODE_ANY; - else options->mode=MODE_GRIB; + char* x = grib_options_get_option("T:"); + if (*x == 'T') + options->mode = MODE_GTS; + else if (*x == 'B') + options->mode = MODE_BUFR; + else if (*x == 'M') + options->mode = MODE_METAR; + else if (*x == 'F') + options->mode = MODE_TAF; + else if (*x == 'A') + options->mode = MODE_ANY; + else + options->mode = MODE_GRIB; } if (grib_options_on("F:")) - options->format=grib_options_get_option("F:"); + options->format = grib_options_get_option("F:"); else - options->format=strdup("%g"); + options->format = strdup("%g"); if (grib_options_on("i:")) { - options->index_on=1; - options->index=atoi(grib_options_get_option("i:")); + options->index_on = 1; + options->index = atoi(grib_options_get_option("i:")); } if (grib_options_on("l:")) - options->latlon=grib_options_get_option("l:"); + options->latlon = grib_options_get_option("l:"); - if (grib_options_on("j")) options->json_output=1; - else options->json_output=0; + if (grib_options_on("j")) + options->json_output = 1; + else + options->json_output = 0; if (grib_options_on("X:")) - options->infile_offset=atol(grib_options_get_option("X:")); + options->infile_offset = atol(grib_options_get_option("X:")); #ifndef ECCODES_ON_WINDOWS /* Check at compile time to ensure our file offset is at least 64 bits */ - COMPILE_TIME_ASSERT( sizeof(options->infile_offset) >= 8 ); + COMPILE_TIME_ASSERT(sizeof(options->infile_offset) >= 8); #endif - has_output=grib_options_on("U"); - has_input_extra=grib_options_on("I"); - options->repack=grib_options_on("r"); - options->gts=grib_options_on("g"); + has_output = grib_options_on("U"); + has_input_extra = grib_options_on("I"); + options->repack = grib_options_on("r"); + options->gts = grib_options_on("g"); if (grib_options_on("d:")) { - char* endPtr = NULL; /* for error handling */ + char* endPtr = NULL; /* for error handling */ const char* optionStr = grib_options_get_option("d:"); - options->constant=strtod(optionStr, &endPtr); - if(*endPtr) { + options->constant = strtod(optionStr, &endPtr); + if (*endPtr) { fprintf(stderr, "Invalid number for -d option: '%s'\n", optionStr); exit(1); } - options->repack=1; + options->repack = 1; } - if (grib_options_on("G")) grib_gribex_mode_on(context); + if (grib_options_on("G")) + grib_gribex_mode_on(context); - nfiles=argc-optind; - if ( nfiles < (1+has_output+has_input_extra) && !options->infile ) usage(); + nfiles = argc - optind; + if (nfiles < (1 + has_output + has_input_extra) && !options->infile) + usage(); if (has_input_extra) { - options->infile_extra=(grib_tools_file*)calloc(1,sizeof(grib_tools_file)); - options->infile_extra->name=argv[optind]; + options->infile_extra = (grib_tools_file*)calloc(1, sizeof(grib_tools_file)); + options->infile_extra->name = argv[optind]; } if (!options->infile) { - for (i=optind+has_input_extra;iname=argv[i]; - if (!options->infile) options->infile=infile; + for (i = optind + has_input_extra; i < argc - has_output; i++) { + grib_tools_file* p = NULL; + grib_tools_file* infile = (grib_tools_file*)calloc(1, sizeof(grib_tools_file)); + infile->name = argv[i]; + if (!options->infile) + options->infile = infile; else { - p=options->infile; - while(p->next) p=p->next; - p->next=infile; + p = options->infile; + while (p->next) + p = p->next; + p->next = infile; } } } if (has_output) { - options->outfile=(grib_tools_file*)calloc(1,sizeof(grib_tools_file)); - options->outfile->name=strdup(argv[argc-1]); + options->outfile = (grib_tools_file*)calloc(1, sizeof(grib_tools_file)); + options->outfile->name = strdup(argv[argc - 1]); } if (grib_options_on("o:")) { - options->outfile=(grib_tools_file*)calloc(1,sizeof(grib_tools_file)); - options->outfile->name=grib_options_get_option("o:"); + options->outfile = (grib_tools_file*)calloc(1, sizeof(grib_tools_file)); + options->outfile->name = grib_options_get_option("o:"); } - options->print_number=grib_options_on("N"); - options->print_header=grib_options_on("H"); - options->verbose=grib_options_on("v"); + options->print_number = grib_options_on("N"); + options->print_header = grib_options_on("H"); + options->verbose = grib_options_on("v"); if (grib_options_on("q") && grib_options_command_line("q")) - options->verbose=0; + options->verbose = 0; - options->fail=!grib_options_on("f"); + options->fail = !grib_options_on("f"); if (grib_options_get_option("W:")) - options->default_print_width=atoi(grib_options_get_option("W:")); + options->default_print_width = atoi(grib_options_get_option("W:")); if (grib_options_on("n:")) - options->name_space=grib_options_get_option("n:"); + options->name_space = grib_options_get_option("n:"); if (grib_options_on("m")) - options->name_space=strdup("mars"); + options->name_space = strdup("mars"); - if (grib_options_on("P:")) karg=grib_options_get_option("P:"); + if (grib_options_on("P:")) + karg = grib_options_get_option("P:"); else if (grib_options_on("p:")) { - karg=grib_options_get_option("p:"); - options->name_space=NULL; + karg = grib_options_get_option("p:"); + options->name_space = NULL; } - options->requested_print_keys_count=MAX_KEYS; - ret = parse_keyval_string(grib_tool_name,karg,0,GRIB_TYPE_UNDEFINED, - options->requested_print_keys,&(options->requested_print_keys_count)); - if (ret == GRIB_INVALID_ARGUMENT) usage(); - GRIB_CHECK_NOLINE(ret,0); + options->requested_print_keys_count = MAX_KEYS; + ret = parse_keyval_string(grib_tool_name, karg, 0, GRIB_TYPE_UNDEFINED, + options->requested_print_keys, &(options->requested_print_keys_count)); + if (ret == GRIB_INVALID_ARGUMENT) + usage(); + GRIB_CHECK_NOLINE(ret, 0); - options->strict=grib_options_on("S"); + options->strict = grib_options_on("S"); - if (grib_options_on("M")) grib_multi_support_off(context); - else grib_multi_support_on(context); + if (grib_options_on("M")) + grib_multi_support_off(context); + else + grib_multi_support_on(context); - if (grib_options_on("g")) grib_gts_header_on(context); - else grib_gts_header_off(context); + if (grib_options_on("g")) + grib_gts_header_on(context); + else + grib_gts_header_off(context); if (grib_options_on("V")) { printf("\necCodes Version "); @@ -333,58 +358,64 @@ int grib_process_runtime_options(grib_context* context,int argc,char** argv,grib } if (grib_options_on("s:")) { - sarg=grib_options_get_option("s:"); - options->set_values_count=MAX_KEYS; - ret=parse_keyval_string(grib_tool_name, sarg,1,GRIB_TYPE_UNDEFINED,options->set_values,&(options->set_values_count)); - if (ret == GRIB_INVALID_ARGUMENT) usage(); + sarg = grib_options_get_option("s:"); + options->set_values_count = MAX_KEYS; + ret = parse_keyval_string(grib_tool_name, sarg, 1, GRIB_TYPE_UNDEFINED, options->set_values, &(options->set_values_count)); + if (ret == GRIB_INVALID_ARGUMENT) + usage(); } if (grib_options_on("b:")) { - barg=grib_options_get_option("b:"); - options->set_values_count=MAX_KEYS; - ret=parse_keyval_string(grib_tool_name,barg,0,GRIB_TYPE_STRING,options->set_values,&(options->set_values_count)); - if (ret == GRIB_INVALID_ARGUMENT) usage(); + barg = grib_options_get_option("b:"); + options->set_values_count = MAX_KEYS; + ret = parse_keyval_string(grib_tool_name, barg, 0, GRIB_TYPE_STRING, options->set_values, &(options->set_values_count)); + if (ret == GRIB_INVALID_ARGUMENT) + usage(); } if (grib_options_on("c:")) { - sarg=grib_options_get_option("c:"); - options->compare_count=MAX_KEYS; - ret=parse_keyval_string(grib_tool_name,sarg,0,GRIB_TYPE_UNDEFINED,options->compare, - &(options->compare_count)); - if (ret == GRIB_INVALID_ARGUMENT) usage(); + sarg = grib_options_get_option("c:"); + options->compare_count = MAX_KEYS; + ret = parse_keyval_string(grib_tool_name, sarg, 0, GRIB_TYPE_UNDEFINED, options->compare, + &(options->compare_count)); + if (ret == GRIB_INVALID_ARGUMENT) + usage(); } if (grib_options_on("e")) { - for (i=0;icompare[i+options->compare_count].name=names[i]; - options->compare[i+options->compare_count].type=GRIB_NAMESPACE; + for (i = 0; i < names_count; i++) { + options->compare[i + options->compare_count].name = names[i]; + options->compare[i + options->compare_count].type = GRIB_NAMESPACE; } - options->compare_count+=names_count; + options->compare_count += names_count; } - warg=grib_options_get_option("w:"); + warg = grib_options_get_option("w:"); - options->constraints_count=MAX_KEYS; - ret=parse_keyval_string(grib_tool_name,warg,1,GRIB_TYPE_UNDEFINED, - options->constraints,&(options->constraints_count)); - if (ret == GRIB_INVALID_ARGUMENT) usage(); + options->constraints_count = MAX_KEYS; + ret = parse_keyval_string(grib_tool_name, warg, 1, GRIB_TYPE_UNDEFINED, + options->constraints, &(options->constraints_count)); + if (ret == GRIB_INVALID_ARGUMENT) + usage(); return GRIB_SUCCESS; } char* grib_options_get_help(char* id) { - int i=0; - char msg[]="ERROR: help not found for option "; - char* err=(char*)calloc(1,sizeof(msg)+3); - sprintf(err,"%s%c\n",msg,*id); - for (i=0; i GRIB %ld: size: %ld code: %ld (%s)\n", count, (long)len, ret, grib_get_error_message(ret)); - if(ret == 0) { - if(fwrite(buffer,1,len,bad) != len) { - perror(cbad); + switch (ret) { + case 0: + if (fwrite(buffer, 1, len, out) != len) { + perror(cout); exit(1); } - } - break; + break; + + case GRIB_WRONG_LENGTH: + case GRIB_PREMATURE_END_OF_FILE: + fseek(in, -4, SEEK_CUR); + memset(buffer + len - 4, '7', 4); /* add in 7777 at end */ + len = data_len = SIZE; + data = (unsigned char*)&buffer[0]; + ret = grib_read_any_from_memory(NULL, &data, &data_len, buffer, &len); + printf(" -> GRIB %ld: size: %ld code: %ld (%s)\n", count, (long)len, ret, grib_get_error_message(ret)); + if (ret == 0) { + if (fwrite(buffer, 1, len, bad) != len) { + perror(cbad); + exit(1); + } + } + break; } } - if(fclose(in)) { + if (fclose(in)) { perror(argv[1]); exit(1); } - if(fclose(out)) { + if (fclose(out)) { perror(argv[2]); exit(1); } - if(argc == 4) { - if(fclose(bad)) { + if (argc == 4) { + if (fclose(bad)) { perror(argv[3]); exit(1); } diff --git a/tools/grib_set.c b/tools/grib_set.c index 00c30a82a..243f03a3d 100644 --- a/tools/grib_set.c +++ b/tools/grib_set.c @@ -14,48 +14,50 @@ */ #include "grib_tools.h" -grib_option grib_options[]={ - /* {id, args, help}, on, command_line, value*/ - {"s:",0,0,1,1,0}, - {"r",0,0,0,1,0}, - {"d:",0,0,0,1,0}, - /*{"n:","noise percentage","\n\t\tAdd noise to the data values. The noise added is the given percentage of the data value.\n",0,1,0},*/ - {"p:",0,0,1,1,0}, - {"P:",0,0,0,1,0}, - {"w:","key[:{s|d|i}]{=|!=}value,key[:{s|d|i}]=value,...", - "\n\t\tWhere clause.\n\t\tSet is only executed for GRIB messages matching all the " - "key/value constraints.\n\t\tIf a GRIB message does not match the constraints it is" - " copied unchanged\n\t\tto the output_grib_file. This behaviour can be changed " - "setting the option -S." - "\n\t\tA valid constraint is of type key=value or key!=value." - "\n\t\tFor each key a string (key:s), a double (key:d) or" - " an integer (key:i)\n\t\ttype can be defined. Default type is string." - "\n\t\tIn the value you can also use the forward-slash character '/' to specify an OR condition (i.e. a logical disjunction)" - "\n\t\tNote: only one -w clause is allowed.\n",0,1,0}, - {"q",0,0,1,0,0}, - {"7",0,0,0,1,0}, - {"S",0,0,0,1,0}, - {"U",0,0,1,0,0}, - {"V",0,0,0,1,0}, - {"M",0,0,0,1,0}, - {"g",0,0,0,1,0}, - {"G",0,0,0,1,0}, - {"T:",0,0,0,1,0}, - {"f",0,0,0,1,0}, - {"v",0,0,0,1,0} +grib_option grib_options[] = { + /* {id, args, help}, on, command_line, value*/ + { "s:", 0, 0, 1, 1, 0 }, + { "r", 0, 0, 0, 1, 0 }, + { "d:", 0, 0, 0, 1, 0 }, + /*{"n:","noise percentage","\n\t\tAdd noise to the data values. The noise added is the given percentage of the data value.\n",0,1,0},*/ + { "p:", 0, 0, 1, 1, 0 }, + { "P:", 0, 0, 0, 1, 0 }, + { "w:", "key[:{s|d|i}]{=|!=}value,key[:{s|d|i}]=value,...", + "\n\t\tWhere clause.\n\t\tSet is only executed for GRIB messages matching all the " + "key/value constraints.\n\t\tIf a GRIB message does not match the constraints it is" + " copied unchanged\n\t\tto the output_grib_file. This behaviour can be changed " + "setting the option -S." + "\n\t\tA valid constraint is of type key=value or key!=value." + "\n\t\tFor each key a string (key:s), a double (key:d) or" + " an integer (key:i)\n\t\ttype can be defined. Default type is string." + "\n\t\tIn the value you can also use the forward-slash character '/' to specify an OR condition (i.e. a logical disjunction)" + "\n\t\tNote: only one -w clause is allowed.\n", + 0, 1, 0 }, + { "q", 0, 0, 1, 0, 0 }, + { "7", 0, 0, 0, 1, 0 }, + { "S", 0, 0, 0, 1, 0 }, + { "U", 0, 0, 1, 0, 0 }, + { "V", 0, 0, 0, 1, 0 }, + { "M", 0, 0, 0, 1, 0 }, + { "g", 0, 0, 0, 1, 0 }, + { "G", 0, 0, 0, 1, 0 }, + { "T:", 0, 0, 0, 1, 0 }, + { "f", 0, 0, 0, 1, 0 }, + { "v", 0, 0, 0, 1, 0 } }; -const char* grib_tool_description="Sets key/value pairs in the input GRIB file and writes" - "\n\teach message to the output_grib_file." - "\n\tIt fails when an error occurs (e.g. key not found)."; -const char* grib_tool_name="grib_set"; -const char* grib_tool_usage="[options] grib_file grib_file ... output_grib_file"; +const char* grib_tool_description = + "Sets key/value pairs in the input GRIB file and writes" + "\n\teach message to the output_grib_file." + "\n\tIt fails when an error occurs (e.g. key not found)."; +const char* grib_tool_name = "grib_set"; +const char* grib_tool_usage = "[options] grib_file grib_file ... output_grib_file"; -int grib_options_count=sizeof(grib_options)/sizeof(grib_option); +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - return grib_tool(argc,argv); + return grib_tool(argc, argv); } int grib_tool_before_getopt(grib_runtime_options* options) @@ -69,7 +71,8 @@ int grib_tool_init(grib_runtime_options* options) printf("ERROR: please provide some keys to set through the -s option or use the -r/-d options\n"); exit(1); } - if (options->verbose) options->print_header=1; + if (options->verbose) + options->print_header = 1; /*if (grib_options_on("n:")) { noise=atof(grib_options_get_option("n:")); options->repack=1; @@ -92,58 +95,60 @@ int grib_tool_init(grib_runtime_options* options) return 0; } -int grib_tool_new_filename_action(grib_runtime_options* options,const char* file) +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) { return 0; } -int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file) +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { return 0; } int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) { - size_t i=0; - int err=0; + size_t i = 0; + int err = 0; if (!options->skip) { - double* v=NULL; - size_t size=0; - if ( options->repack ) { - GRIB_CHECK_NOLINE(grib_get_size(h,"values",&size),0); - - v = (double*)calloc(size,sizeof(double)); - if(!v) { - fprintf(stderr,"failed to allocate %d bytes\n",(int)(size*sizeof(double))); + double* v = NULL; + size_t size = 0; + if (options->repack) { + GRIB_CHECK_NOLINE(grib_get_size(h, "values", &size), 0); + + v = (double*)calloc(size, sizeof(double)); + if (!v) { + fprintf(stderr, "failed to allocate %d bytes\n", (int)(size * sizeof(double))); exit(1); } - GRIB_CHECK_NOLINE(grib_get_double_array(h,"values",v,&size),0); + GRIB_CHECK_NOLINE(grib_get_double_array(h, "values", v, &size), 0); } if (options->set_values_count != 0) { - err=grib_set_values(h,options->set_values,options->set_values_count); - if( err != GRIB_SUCCESS && options->fail) exit(err); + err = grib_set_values(h, options->set_values, options->set_values_count); + if (err != GRIB_SUCCESS && options->fail) + exit(err); } - if ( options->repack ) { - + if (options->repack) { if (grib_options_on("d:")) { - for(i = 0; i< size; i++) - v[i] = options->constant; + for (i = 0; i < size; i++) + v[i] = options->constant; } if (err == GRIB_SUCCESS) { - GRIB_CHECK_NOLINE(grib_set_double_array(h,"values",v,size),0); + GRIB_CHECK_NOLINE(grib_set_double_array(h, "values", v, size), 0); } free(v); } - if( err != GRIB_SUCCESS && options->fail) exit(err); + if (err != GRIB_SUCCESS && options->fail) + exit(err); } - if (!options->skip || !options->strict) grib_tools_write_message(options,h); + if (!options->skip || !options->strict) + grib_tools_write_message(options, h); return 0; } @@ -154,14 +159,14 @@ int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) return 0; } -void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h) +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) { - grib_print_key_values(options,h); + grib_print_key_values(options, h); } int grib_tool_finalise_action(grib_runtime_options* options) { - int err=0; + int err = 0; grib_file_close_all(&err); if (err != GRIB_SUCCESS) { perror(grib_tool_name); @@ -173,6 +178,6 @@ int grib_tool_finalise_action(grib_runtime_options* options) int grib_no_handle_action(grib_runtime_options* options, int err) { - fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\t\t\"ERROR: unreadable message\"\n"); return 0; } diff --git a/tools/grib_to_json.c b/tools/grib_to_json.c index d830e12c4..dc70baeac 100644 --- a/tools/grib_to_json.c +++ b/tools/grib_to_json.c @@ -31,10 +31,10 @@ void get_param(FILE* f, grib_handle* h, const char* name, const char* arg) void get_iso_ref_date(FILE* f, grib_handle* h, const char* name, const char* arg) { long year; - long month ; + long month; long day; - long hour ; - long minute ; + long hour; + long minute; long second; GRIB_CHECK(grib_get_long(h, "year", &year), "year"); @@ -47,7 +47,8 @@ void get_iso_ref_date(FILE* f, grib_handle* h, const char* name, const char* arg fprintf(f, "\"%s\":\"%04ld-%02ld-%02ldT%02ld:%02ld:%02ld.000Z\"", name, year, month, day, hour, minute, second); } -typedef struct header_keys { +typedef struct header_keys +{ const char* name; getproc proc; const char* arg; @@ -66,31 +67,81 @@ typedef struct header_keys { */ header_keys header[] = { - {"scanMode",&get_long, "scanningMode",}, - {"la1",&get_long, "latitudeOfFirstGridPointInDegrees",}, - {"lo1",&get_long, "longitudeOfFirstGridPointInDegrees",}, + { + "scanMode", + &get_long, + "scanningMode", + }, + { + "la1", + &get_long, + "latitudeOfFirstGridPointInDegrees", + }, + { + "lo1", + &get_long, + "longitudeOfFirstGridPointInDegrees", + }, - {"la2",&get_long, "latitudeOfLastGridPointInDegrees",}, - {"lo2",&get_long, "longitudeOfLastGridPointInDegrees",}, + { + "la2", + &get_long, + "latitudeOfLastGridPointInDegrees", + }, + { + "lo2", + &get_long, + "longitudeOfLastGridPointInDegrees", + }, - {"forecastTime",&get_long, "step",}, + { + "forecastTime", + &get_long, + "step", + }, - {"nx",&get_long, "Nx",}, - {"ny",&get_long, "Ny",}, + { + "nx", + &get_long, + "Nx", + }, + { + "ny", + &get_long, + "Ny", + }, - {"dx",&get_long, "DxInDegrees",}, - {"dy",&get_long, "DyInDegrees",}, + { + "dx", + &get_long, + "DxInDegrees", + }, + { + "dy", + &get_long, + "DyInDegrees", + }, - {"parameterNumber", &get_param, "indicatorOfParameter",}, - {"refTime", &get_iso_ref_date, NULL,}, + { + "parameterNumber", + &get_param, + "indicatorOfParameter", + }, + { + "refTime", + &get_iso_ref_date, + NULL, + }, - {NULL,} + { + NULL, + } }; -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { grib_handle* h = NULL; - FILE* f = NULL; + FILE* f = NULL; size_t i, j = 0; int err = 0; double* values; @@ -99,17 +150,15 @@ int main(int argc, char *argv[]) printf("["); - for(i = 1; i < argc; i++) - { - f = fopen(argv[i],"r"); - if(!f) { + for (i = 1; i < argc; i++) { + f = fopen(argv[i], "r"); + if (!f) { perror(argv[i]); exit(1); } - while((h = grib_handle_new_from_file(0,f,&err)) != NULL) - { - if(++n>1) { + while ((h = grib_handle_new_from_file(0, f, &err)) != NULL) { + if (++n > 1) { printf(","); } @@ -117,8 +166,9 @@ int main(int argc, char *argv[]) printf("\"header\":{\n"); j = 0; - while(header[j].name) { - if(j) printf(","); + while (header[j].name) { + if (j) + printf(","); header[j].proc(stdout, h, header[j].name, header[j].arg); j++; } @@ -127,26 +177,27 @@ int main(int argc, char *argv[]) printf("\"meta\":{\n"); printf("},\n"); /*========== data *============*/ - size=0; - GRIB_CHECK(grib_get_size(h,"values",&size),0); - values = (double*)malloc(sizeof(double)*size); + size = 0; + GRIB_CHECK(grib_get_size(h, "values", &size), 0); + values = (double*)malloc(sizeof(double) * size); if (!values) { - fprintf(stderr,"%s: out of memory\n", argv[0]); + fprintf(stderr, "%s: out of memory\n", argv[0]); exit(1); } - count=size; - GRIB_CHECK(grib_get_double_array(h,"values",values,&count),0); + count = size; + GRIB_CHECK(grib_get_double_array(h, "values", values, &count), 0); if (count != size) { - printf("%s: wrong values count %lu %lu\n",argv[0],count,size); + printf("%s: wrong values count %lu %lu\n", argv[0], count, size); exit(1); } printf("\"data\":[\n"); - for(j = 0; j < count; j ++ ) { - if(j) printf(","); - printf("%g", (long)(values[j]*10+0.5)/10.0); - if(((j+1) % 20) == 0) { + for (j = 0; j < count; j++) { + if (j) + printf(","); + printf("%g", (long)(values[j] * 10 + 0.5) / 10.0); + if (((j + 1) % 20) == 0) { printf("\n"); } } @@ -159,9 +210,8 @@ int main(int argc, char *argv[]) grib_handle_delete(h); } fclose(f); - if(err) - { - fprintf(stderr,"%s\n",grib_get_error_message(err)); + if (err) { + fprintf(stderr, "%s\n", grib_get_error_message(err)); exit(1); } } diff --git a/tools/grib_to_netcdf.c b/tools/grib_to_netcdf.c index 88c9f7a3f..d2ccd49a0 100644 --- a/tools/grib_to_netcdf.c +++ b/tools/grib_to_netcdf.c @@ -25,45 +25,48 @@ #include "eccodes_windef.h" #ifdef ECCODES_ON_WINDOWS - #include +#include #endif -const char* grib_tool_description = "Convert a GRIB file to netCDF format." - "\n\tNote: The GRIB geometry should be a regular lat/lon grid or a regular Gaussian grid" - "\n\t(the key \"typeOfGrid\" should be \"regular_ll\" or \"regular_gg\")"; -const char* grib_tool_name = "grib_to_netcdf"; -const char* grib_tool_usage = "[options] grib_file grib_file ... "; +const char* grib_tool_description = + "Convert a GRIB file to netCDF format." + "\n\tNote: The GRIB geometry should be a regular lat/lon grid or a regular Gaussian grid" + "\n\t(the key \"typeOfGrid\" should be \"regular_ll\" or \"regular_gg\")"; +const char* grib_tool_name = "grib_to_netcdf"; +const char* grib_tool_usage = "[options] grib_file grib_file ... "; static char argvString[2048] = {0,}; /*=====================================================================*/ -static grib_context* ctx = NULL; +static grib_context* ctx = NULL; static double global_missing_value = 9.9692099683868690e+36; /* See GRIB-953 */ /*===============================================================================*/ /* request from mars client */ /*===============================================================================*/ -#define NUMBER(x) (sizeof(x)/sizeof(x[0])) +#define NUMBER(x) (sizeof(x) / sizeof(x[0])) typedef int boolean; typedef int err; typedef off_t file_offset; static int FALSE = 0; -static int TRUE = 1; +static int TRUE = 1; static int files = 0; -struct value { - struct value *next; +struct value +{ + struct value* next; char* name; }; typedef struct value value; -struct request { - struct request *next; - struct parameter *params; +struct request +{ + struct request* next; + struct parameter* params; char* name; int order; }; @@ -71,89 +74,88 @@ typedef struct request request; /* request part */ /* language part */ -struct parameter { - struct parameter *next; - struct value *values; +struct parameter +{ + struct parameter* next; + struct value* values; char* name; int count; }; typedef struct parameter parameter; static const char* get_value(const request*, const char* name, int n); -static boolean parsedate(const char *name, long* julian, long *second, boolean* isjul); +static boolean parsedate(const char* name, long* julian, long* second, boolean* isjul); -static boolean eq_string(const char *l, const char *r) +static boolean eq_string(const char* l, const char* r) { - if(l && r) + if (l && r) return strcmp(l, r) == 0; return FALSE; } -static boolean eq_integer(const char *l, const char *r) +static boolean eq_integer(const char* l, const char* r) { - if(l && r) + if (l && r) return atol(l) == atol(r); return FALSE; } -static boolean eq_null(const char *l, const char *r) +static boolean eq_null(const char* l, const char* r) { return TRUE; } -static boolean eq_coord(const char *l, const char *r) +static boolean eq_coord(const char* l, const char* r) { - if(l && r) + if (l && r) return strcmp(l, r) == 0; return FALSE; } -static boolean eq_range(const char *l, const char *r) +static boolean eq_range(const char* l, const char* r) { - if(l && r) + if (l && r) return strcmp(l, r) == 0; return FALSE; } -static boolean eq_date(const char *l, const char *r) +static boolean eq_date(const char* l, const char* r) { - if(l && r) + if (l && r) return strcmp(l, r) == 0; return FALSE; } -static boolean eq_param(const char *l, const char *r) +static boolean eq_param(const char* l, const char* r) { - if(l && r) + if (l && r) return strcmp(l, r) == 0; return FALSE; } -static boolean eq_time(const char *l, const char *r) +static boolean eq_time(const char* l, const char* r) { - if(l && r) + if (l && r) return strcmp(l, r) == 0; return FALSE; } -static value *new_value(const char *name) +static value* new_value(const char* name) { - value *v = (value*)calloc(sizeof(value), 1); + value* v = (value*)calloc(sizeof(value), 1); Assert(v); v->name = grib_context_strdup(ctx, name); return v; } -static parameter *find_parameter(const request *r, const char *parname) +static parameter* find_parameter(const request* r, const char* parname) { - if(!parname) + if (!parname) return 0; - if(r) - { - parameter *p = r->params; - while(p) - { - if(strcmp(p->name, parname) == 0) + if (r) { + parameter* p = r->params; + while (p) { + if (strcmp(p->name, parname) == 0) return p; p = p->next; } @@ -161,36 +163,32 @@ static parameter *find_parameter(const request *r, const char *parname) return NULL; } -static void _reqmerge(parameter *pa, const parameter *pb, request *a) +static void _reqmerge(parameter* pa, const parameter* pb, request* a) { - const value *vb = pb->values; + const value* vb = pb->values; - if(strcmp(pa->name, pb->name) != 0) + if (strcmp(pa->name, pb->name) != 0) return; - while(vb) - { - value *va = pa->values; - value *last = 0; - const char *nb = vb->name; - boolean add = TRUE; + while (vb) { + value* va = pa->values; + value* last = 0; + const char* nb = vb->name; + boolean add = TRUE; - while(va) - { - if(strcmp(va->name, nb) == 0) - { + while (va) { + if (strcmp(va->name, nb) == 0) { add = FALSE; break; } last = va; - va = va->next; + va = va->next; } - if(add) - { + if (add) { value* v = new_value(nb); - if(last) + if (last) last->next = v; else pa->values = v; @@ -199,18 +197,16 @@ static void _reqmerge(parameter *pa, const parameter *pb, request *a) vb = vb->next; } - } /* Fast version if a && b same */ -static boolean _reqmerge1(request *a, const request *b) +static boolean _reqmerge1(request* a, const request* b) { - parameter *pa = a->params; - const parameter *pb = b->params; + parameter* pa = a->params; + const parameter* pb = b->params; - while(pa && pb) - { - if(strcmp(pa->name, pb->name) != 0) + while (pa && pb) { + if (strcmp(pa->name, pb->name) != 0) return FALSE; _reqmerge(pa, pb, a); @@ -222,17 +218,16 @@ static boolean _reqmerge1(request *a, const request *b) return (pa == NULL && pb == NULL); } -static void free_one_value(value *p) +static void free_one_value(value* p) { grib_context_free(ctx, p->name); grib_context_free(ctx, p); } -static void free_all_values(value *p) +static void free_all_values(value* p) { - while(p) - { - value *q = p->next; + while (p) { + value* q = p->next; free_one_value(p); p = q; } @@ -240,11 +235,10 @@ static void free_all_values(value *p) /* Convert the first part of the string 'p' to a number (x) and set n to its length. */ /* Return the rest of the string */ -static const char *parse1(const char *p, int* x, int *n) +static const char* parse1(const char* p, int* x, int* n) { *x = *n = 0; - while(*p && isdigit(*p)) - { + while (*p && isdigit(*p)) { (*x) *= 10; (*x) += *p - '0'; (*n)++; @@ -253,111 +247,98 @@ static const char *parse1(const char *p, int* x, int *n) return p; } -static boolean is_number(const char *name) +static boolean is_number(const char* name) { - const char *p = name; + const char* p = name; int x, n; - if(p == 0 || *p == 0) + if (p == 0 || *p == 0) return FALSE; - if(*p == '-') + if (*p == '-') p++; - else if(*p == '+') + else if (*p == '+') p++; p = parse1(p, &x, &n); - if(n == 0 && *p != '.') + if (n == 0 && *p != '.') return FALSE; - if(*p == '.') - { + if (*p == '.') { p++; p = parse1(p, &x, &n); } - if(*p == 'e' || *p == 'E') - { + if (*p == 'e' || *p == 'E') { p++; - if(*p == '-') + if (*p == '-') p++; - else if(*p == '+') + else if (*p == '+') p++; p = parse1(p, &x, &n); - if(n == 0) + if (n == 0) return FALSE; } return *p == 0 ? TRUE : FALSE; } -static parameter *new_parameter(char *name, value *v) +static parameter* new_parameter(char* name, value* v) { - parameter *p = (parameter*)calloc(sizeof(parameter), 1); + parameter* p = (parameter*)calloc(sizeof(parameter), 1); Assert(p); - p->name = grib_context_strdup(ctx, name); + p->name = grib_context_strdup(ctx, name); p->values = v; return p; } -static void put_value(request *r, const char *parname, const char *valname, boolean append, boolean unique, boolean ascending) +static void put_value(request* r, const char* parname, const char* valname, boolean append, boolean unique, boolean ascending) { - parameter *p; - value *v; + parameter* p; + value* v; - if(!r) + if (!r) return; - if((p = find_parameter(r, parname)) != NULL) - { - if(append) - { + if ((p = find_parameter(r, parname)) != NULL) { + if (append) { value *a = p->values, *b = NULL, *c = NULL; - while(a) - { + while (a) { b = a; - if(unique) - { - if(is_number(a->name) && is_number(valname)) - { - if(atof(a->name) == atof(valname)) + if (unique) { + if (is_number(a->name) && is_number(valname)) { + if (atof(a->name) == atof(valname)) return; } - else if(strcmp(a->name, valname) == 0) + else if (strcmp(a->name, valname) == 0) return; } - if(ascending) - { - if(is_number(a->name)) - { - if(atof(valname) < atof(a->name)) + if (ascending) { + if (is_number(a->name)) { + if (atof(valname) < atof(a->name)) break; } - else if(strcmp(valname, a->name) < 0) + else if (strcmp(valname, a->name) < 0) break; } c = b; a = a->next; } v = new_value(grib_context_strdup(ctx, valname)); - if(ascending) - { - if(c) - { - if(b && b != c) + if (ascending) { + if (c) { + if (b && b != c) v->next = b; c->next = v; } - else - { - if(a) + else { + if (a) v->next = a; p->values = v; } } - else - { - if(b) + else { + if (b) b->next = v; else p->values = v; @@ -365,50 +346,44 @@ static void put_value(request *r, const char *parname, const char *valname, bool /* p->count++; */ p->count = 0; } - else - { - if(p->values) - { + else { + if (p->values) { free_all_values(p->values->next); p->values->next = NULL; /* p->count = 1; */ p->count = 0; - if(strcmp(p->values->name, valname) == 0) + if (strcmp(p->values->name, valname) == 0) return; - else - { + else { grib_context_free(ctx, p->values->name); p->values->name = grib_context_strdup(ctx, valname); } } - else - { - v = new_value(grib_context_strdup(ctx, valname)); + else { + v = new_value(grib_context_strdup(ctx, valname)); p->values = v; /* p->count = 1; */ p->count = 0; } } } - else - { - parameter *q = NULL; - parameter *s = r->params; - v = new_value(grib_context_strdup(ctx, valname)); - p = new_parameter(grib_context_strdup(ctx, parname), v); - while(s) - { + else { + parameter* q = NULL; + parameter* s = r->params; + v = new_value(grib_context_strdup(ctx, valname)); + p = new_parameter(grib_context_strdup(ctx, parname), v); + while (s) { q = s; s = s->next; } - if(q) + if (q) q->next = p; else r->params = p; } } -static void add_value(request *r, const char *parname, const char *fmt, ...) +static void add_value(request* r, const char* parname, const char* fmt, ...) { char buffer[1024]; va_list list; @@ -420,26 +395,21 @@ static void add_value(request *r, const char *parname, const char *fmt, ...) put_value(r, parname, buffer, TRUE, FALSE, FALSE); } -static void _reqmerge2(request *a, const request *b) +static void _reqmerge2(request* a, const request* b) { - const parameter *pb = b->params; + const parameter* pb = b->params; - while(pb) - { + while (pb) { parameter* pa = find_parameter(a, pb->name); - if(pa == NULL) - { - value *v = pb->values; - while(v) - { + if (pa == NULL) { + value* v = pb->values; + while (v) { put_value(a, pb->name, v->name, TRUE, TRUE, FALSE); v = v->next; } - } - else - { + else { _reqmerge(pa, pb, a); } @@ -447,52 +417,46 @@ static void _reqmerge2(request *a, const request *b) } } -static void reqmerge(request *a, const request *b) +static void reqmerge(request* a, const request* b) { - if(a && b) - { - if(!_reqmerge1(a, b)) + if (a && b) { + if (!_reqmerge1(a, b)) _reqmerge2(a, b); } } -static void save_name(FILE *f, const char* name, int n) +static void save_name(FILE* f, const char* name, int n) { - int i = 0, cnt = 0; - if(name == NULL) + if (name == NULL) name = "(null)"; cnt = fprintf(f, "%s", name); - for(i = cnt; i < n; i++) + for (i = cnt; i < n; i++) putc(' ', f); } -static void save_one_value(FILE *f, value *r) +static void save_one_value(FILE* f, value* r) { save_name(f, r->name, 0); } -static void save_all_values(FILE *f, value *r) +static void save_all_values(FILE* f, value* r) { - while(r) - { + while (r) { save_one_value(f, r); - if(r->next) + if (r->next) putc('/', f); r = r->next; } } -static void save_all_parameters(FILE *f, parameter *r) +static void save_all_parameters(FILE* f, parameter* r) { - while(r) - { - - if(r->values) - { + while (r) { + if (r->values) { fprintf(f, ",\n "); save_name(f, r->name, 10); fprintf(f, " = "); @@ -504,20 +468,18 @@ static void save_all_parameters(FILE *f, parameter *r) putc('\n', f); } -static void save_one_request(FILE *f, const request *r) +static void save_one_request(FILE* f, const request* r) { - if(r) - { + if (r) { save_name(f, r->name, 0); save_all_parameters(f, r->params); putc('\n', f); } } -static void save_all_requests(FILE *f, const request *r) +static void save_all_requests(FILE* f, const request* r) { - while(r) - { + while (r) { save_one_request(f, r); r = r->next; } @@ -530,12 +492,12 @@ static void print_one_request(const request *r) } */ -static void print_all_requests(const request *r) +static void print_all_requests(const request* r) { save_all_requests(stdout, r); } -static void free_one_parameter(parameter *p) +static void free_one_parameter(parameter* p) { grib_context_free(ctx, p->name); free_all_values(p->values); @@ -543,34 +505,32 @@ static void free_one_parameter(parameter *p) grib_context_free(ctx, p); } -static void free_all_parameters(parameter *p) +static void free_all_parameters(parameter* p) { - while(p) - { - parameter *q = p->next; + while (p) { + parameter* q = p->next; free_one_parameter(p); p = q; } } -static void free_one_request(request *r) +static void free_one_request(request* r) { grib_context_free(ctx, r->name); free_all_parameters(r->params); grib_context_free(ctx, r); } -static void free_all_requests(request *p) +static void free_all_requests(request* p) { - while(p) - { - request *q = p->next; + while (p) { + request* q = p->next; free_one_request(p); p = q; } } -static void set_value(request *r, const char *parname, const char *fmt, ...) +static void set_value(request* r, const char* parname, const char* fmt, ...) { char buffer[10240]; va_list list; @@ -582,25 +542,24 @@ static void set_value(request *r, const char *parname, const char *fmt, ...) put_value(r, parname, buffer, FALSE, FALSE, FALSE); } -static err handle_to_request(request *r, grib_handle* g) +static err handle_to_request(request* r, grib_handle* g) { grib_keys_iterator* ks; char name[256]; char value[256]; size_t len = sizeof(value); - int e = 0; + int e = 0; - if(!g) + if (!g) return -1; /* printf("------------\n"); */ ks = grib_keys_iterator_new(g, GRIB_KEYS_ITERATOR_ALL_KEYS, "mars"); - while(grib_keys_iterator_next(ks)) - { + while (grib_keys_iterator_next(ks)) { strcpy(name, grib_keys_iterator_get_name(ks)); - if((e = grib_keys_iterator_get_string(ks, value, &len)) != GRIB_SUCCESS) + if ((e = grib_keys_iterator_get_string(ks, value, &len)) != GRIB_SUCCESS) grib_context_log(ctx, GRIB_LOG_ERROR, "Cannot get %s as string %d (%s)", name, e, grib_get_error_message(e)); set_value(r, name, "%s", value); @@ -608,9 +567,12 @@ static err handle_to_request(request *r, grib_handle* g) } strcpy(name, "stepUnits"); - if((e = grib_get_string(g, name, value, &len)) == GRIB_SUCCESS) { + if ((e = grib_get_string(g, name, value, &len)) == GRIB_SUCCESS) { set_value(r, name, "%s", value); } + else { + grib_context_log(ctx, GRIB_LOG_ERROR, "Cannot get %s as string (%s)", name, grib_get_error_message(e)); + } /* Assert(grib_get_long(g, "validityDate", &l ) == 0); @@ -621,45 +583,35 @@ static err handle_to_request(request *r, grib_handle* g) */ len = sizeof(value); - if(grib_get_string(g, "cfVarName", name, &len) == 0) - { - if(strcmp(name,"unknown") != 0) - { + if (grib_get_string(g, "cfVarName", name, &len) == 0) { + if (strcmp(name, "unknown") != 0) { set_value(r, "param", "%s", name); } - else - { + else { len = sizeof(value); - if(grib_get_string(g, "shortName", name, &len) == 0) - { + if (grib_get_string(g, "shortName", name, &len) == 0) { set_value(r, "param", "%s", name); } } } len = sizeof(value); - if(grib_get_string(g, "name", name, &len) == 0) - { - if(strcmp(name,"unknown") != 0) - { + if (grib_get_string(g, "name", name, &len) == 0) { + if (strcmp(name, "unknown") != 0) { set_value(r, "_long_name", "%s", name); } } len = sizeof(value); - if(grib_get_string(g, "units", name, &len) == 0) - { - if(strcmp(name,"unknown") != 0) - { + if (grib_get_string(g, "units", name, &len) == 0) { + if (strcmp(name, "unknown") != 0) { set_value(r, "_units", "%s", name); } } len = sizeof(value); - if(grib_get_string(g, "cfName", name, &len) == 0) - { - if(strcmp(name,"unknown") != 0) - { + if (grib_get_string(g, "cfName", name, &len) == 0) { + if (strcmp(name, "unknown") != 0) { set_value(r, "_cf_name", "%s", name); } } @@ -671,40 +623,48 @@ static err handle_to_request(request *r, grib_handle* g) /*===============================================================================*/ /*===============================================================================*/ -typedef boolean (*namecmp)(const char *, const char *); +typedef boolean (*namecmp)(const char*, const char*); -typedef struct hypercube { - request *cube; - request *r; - request *iterator; - char *set; +typedef struct hypercube +{ + request* cube; + request* r; + request* iterator; + char* set; int count; int size; int max; int* index_cache; int index_cache_size; - namecmp *compare; + namecmp* compare; } hypercube; -typedef struct axis_t { - const char *name; +typedef struct axis_t +{ + const char* name; namecmp compare; } axis_t; /* This should be c++ ... */ -typedef enum field_state { - unknown, packed_mem, packed_file, expand_mem +typedef enum field_state +{ + unknown, + packed_mem, + packed_file, + expand_mem } field_state; -typedef struct { +typedef struct +{ int refcnt; request* r; } field_request; /* One field .. */ -typedef struct field { +typedef struct field +{ int refcnt; field_state shape; @@ -717,19 +677,19 @@ typedef struct field { file_offset offset; size_t length; - grib_file *file; + grib_file* file; /* missing fields/values */ /*boolean is_missing;*/ /* field is missing */ - boolean has_bitmap; /* field has missing values (= bitmap) */ + boolean has_bitmap; /* field has missing values (= bitmap) */ - field_request *r; + field_request* r; } field; -typedef struct fieldset { - +typedef struct fieldset +{ int refcnt; /* if fields */ @@ -737,7 +697,7 @@ typedef struct fieldset { int max; int count; - field **fields; + field** fields; } fieldset; @@ -750,133 +710,127 @@ typedef struct fieldset { #define grib_context_free(ctx,x) grib_context_free(ctx,x) */ -static field *get_field(fieldset *v, int n, field_state shape); -static hypercube *new_hypercube_from_mars_request(const request *r); -static void release_field(field *g); -static int count_axis(const hypercube *h); -static const char* get_axis(const hypercube *h, int pos); -static const char* get_axis(const hypercube *h, int pos); -static int cube_order(const hypercube *h, const request *r); -static void free_hypercube(hypercube *h); -static int _cube_position(const hypercube *h, const request *r, boolean remove_holes); +static field* get_field(fieldset* v, int n, field_state shape); +static hypercube* new_hypercube_from_mars_request(const request* r); +static void release_field(field* g); +static int count_axis(const hypercube* h); +static const char* get_axis(const hypercube* h, int pos); +static const char* get_axis(const hypercube* h, int pos); +static int cube_order(const hypercube* h, const request* r); +static void free_hypercube(hypercube* h); +static int _cube_position(const hypercube* h, const request* r, boolean remove_holes); -static value *clone_one_value(const value *p) +static value* clone_one_value(const value* p) { - value *q = (value*)calloc(sizeof(value), 1); + value* q = (value*)calloc(sizeof(value), 1); Assert(q); q->next = NULL; q->name = grib_context_strdup(ctx, p->name); return q; } -static value *clone_all_values(const value *p) +static value* clone_all_values(const value* p) { - if(p) - { - value *q = clone_one_value(p); - q->next = clone_all_values(p->next); + if (p) { + value* q = clone_one_value(p); + q->next = clone_all_values(p->next); /* q->alias = cone_value(p->alias); */ return q; } return NULL; } -static parameter *clone_one_parameter(const parameter *p) +static parameter* clone_one_parameter(const parameter* p) { - parameter *q = (parameter*)calloc(sizeof(parameter), 1); + parameter* q = (parameter*)calloc(sizeof(parameter), 1); Assert(q); - q->next = NULL; - q->name = grib_context_strdup(ctx, p->name); + q->next = NULL; + q->name = grib_context_strdup(ctx, p->name); q->values = clone_all_values(p->values); return q; } -static parameter *clone_all_parameters(const parameter *p) +static parameter* clone_all_parameters(const parameter* p) { - if(p) - { - parameter *q = clone_one_parameter(p); - q->next = clone_all_parameters(p->next); + if (p) { + parameter* q = clone_one_parameter(p); + q->next = clone_all_parameters(p->next); return q; } return NULL; } -static request *clone_one_request(const request *r) +static request* clone_one_request(const request* r) { - if(r) - { - request *p = (request*)calloc(sizeof(request), 1); + if (r) { + request* p = (request*)calloc(sizeof(request), 1); Assert(p); p->name = grib_context_strdup(ctx, r->name); p->params = clone_all_parameters(r->params); - p->next = NULL; + p->next = NULL; return p; } return NULL; } -static request *new_request(const char *name, parameter *p) +static request* new_request(const char* name, parameter* p) { - request *r = (request *)calloc(sizeof(request), 1); + request* r = (request*)calloc(sizeof(request), 1); Assert(r); - r->name = grib_context_strdup(ctx, name); + r->name = grib_context_strdup(ctx, name); r->params = p; return r; } -static request *empty_request(const char *name) +static request* empty_request(const char* name) { return new_request(name ? name : "", NULL); } -static field_request* new_field_request(request *r) +static field_request* new_field_request(request* r) { field_request* g = (field_request*)grib_context_malloc_clear(ctx, sizeof(field_request)); - g->r = clone_one_request(r); + g->r = clone_one_request(r); return g; } static void free_field_request(field_request* g) { - if(!g) + if (!g) return; g->refcnt--; - if(g->refcnt <= 0) - { + if (g->refcnt <= 0) { free_all_requests(g->r); grib_context_free(ctx, g); } } -static void free_field(field *g) +static void free_field(field* g) { - if(!g) + if (!g) return; g->refcnt--; - if(g->refcnt <= 0) - { + if (g->refcnt <= 0) { /*free_gribfile(g->file);*/ free_field_request(g->r); - if(g->values) + if (g->values) grib_context_free(ctx, g->values); grib_handle_delete(g->handle); grib_context_free(ctx, g); } } -static void free_fieldset(fieldset *v) +static void free_fieldset(fieldset* v) { - if(!v) + if (!v) return; v->refcnt--; - if(v->refcnt <= 0) - { + if (v->refcnt <= 0) { int i; grib_context_log(ctx, GRIB_LOG_DEBUG, "grib_to_netcdf: free_fieldset (%d fields) : ", v->count); - for(i = 0; i < v->count; i++) + for (i = 0; i < v->count; i++) free_field(v->fields[i]); grib_context_free(ctx, v->fields); @@ -884,131 +838,124 @@ static void free_fieldset(fieldset *v) } } -static field *new_field() +static field* new_field() { return (field*)grib_context_malloc_clear(ctx, sizeof(field)); } #define INIT_SIZE 1024 -static void grow_fieldset(fieldset *v, int n) +static void grow_fieldset(fieldset* v, int n) { int m = v->count; int x = v->max; - if(n < v->count) + if (n < v->count) return; v->count = n; - while(v->count >= v->max) - if(v->max < INIT_SIZE) + while (v->count >= v->max) + if (v->max < INIT_SIZE) v->max = INIT_SIZE; else v->max += v->max / 2 + 1; - if(v->max != x) - { + if (v->max != x) { int i; - if(v->fields == NULL) - { - v->fields = (field**) grib_context_malloc(ctx, sizeof(field*) * v->max); + if (v->fields == NULL) { + v->fields = (field**)grib_context_malloc(ctx, sizeof(field*) * v->max); Assert(v->fields); } - else - { - field** f = (field**) grib_context_malloc(ctx, sizeof(field*) * v->max); + else { + field** f = (field**)grib_context_malloc(ctx, sizeof(field*) * v->max); Assert(f); - for(i = 0; i < m; i++) + for (i = 0; i < m; i++) f[i] = v->fields[i]; grib_context_free(ctx, v->fields); v->fields = f; } - for(i = m; i < v->max; i++) + for (i = m; i < v->max; i++) v->fields[i] = NULL; } } -static fieldset *new_fieldset(int n) +static fieldset* new_fieldset(int n) { - fieldset *f = (fieldset*)calloc(sizeof(fieldset), 1); + fieldset* f = (fieldset*)calloc(sizeof(fieldset), 1); Assert(f); grow_fieldset(f, n); return f; } -static field* read_field(grib_file *file, file_offset pos, long length) +static field* read_field(grib_file* file, file_offset pos, long length) { - field *g = new_field(); + field* g = new_field(); - g->file = file; + g->file = file; g->offset = pos; g->length = length; - g->shape = packed_file; + g->shape = packed_file; return g; } -static err set_field(fieldset *v, field *g, int pos) +static err set_field(fieldset* v, field* g, int pos) { - if(pos >= 0) - { - field *h; + if (pos >= 0) { + field* h; grow_fieldset(v, pos + 1); - h = v->fields[pos]; + h = v->fields[pos]; v->fields[pos] = g; g->refcnt++; - if(h) + if (h) free_field(h); } return 0; } -static void count_parval(parameter *p) +static void count_parval(parameter* p) { - int n = 0; - value *v = p->values; + int n = 0; + value* v = p->values; - while(v) - { + while (v) { n++; v = v->next; } p->count = n; - } -static int count_values(const request *r, const char *parname) +static int count_values(const request* r, const char* parname) { - parameter *p = find_parameter(r, parname); + parameter* p = find_parameter(r, parname); - if(p == NULL) + if (p == NULL) return 0; - if(p->count) + if (p->count) return p->count; count_parval(p); return p->count; } -static const char *get_value(const request *r, const char *parname, int nth) +static const char* get_value(const request* r, const char* parname, int nth) { - parameter *p = find_parameter(r, parname); - value *v; + parameter* p = find_parameter(r, parname); + value* v; int i = 0; - if(p == NULL) + if (p == NULL) return NULL; - if(!p->count) + if (!p->count) count_values(r, parname); v = p->values; - while(v) - { - if(nth == i++) + while (v) { + if (nth == i++) return v->name; v = v->next; } @@ -1016,45 +963,39 @@ static const char *get_value(const request *r, const char *parname, int nth) return NULL; } -static err to_packed_mem(field *g) +static err to_packed_mem(field* g) { - - if(g->shape == packed_mem) + if (g->shape == packed_mem) return 0; - if(g->shape == expand_mem) - { - if(g->values) + if (g->shape == expand_mem) { + if (g->values) grib_context_free(ctx, g->values); - g->values = NULL; + g->values = NULL; g->value_count = 0; - g->shape = packed_mem; + g->shape = packed_mem; return 0; } - if(g->shape == packed_file) - { - + if (g->shape == packed_file) { } return 0; } -static err to_expand_mem(field *g) +static err to_expand_mem(field* g) { err e = 0; Assert(g); - if(g->shape == expand_mem) + if (g->shape == expand_mem) return 0; - if(g->shape == packed_file) - { + if (g->shape == packed_file) { const void* dummy = NULL; grib_file* file = grib_file_open(g->file->name, "r", &e); - if(!file || !file->handle) - { + if (!file || !file->handle) { grib_context_log(ctx, GRIB_LOG_ERROR | GRIB_LOG_PERROR, "%s", g->file->name); return -1; } @@ -1064,49 +1005,44 @@ static err to_expand_mem(field *g) g->handle = grib_handle_new_from_file(ctx, file->handle, &e); Assert(g->handle); - if(g->handle) + if (g->handle) grib_get_message(g->handle, &dummy, &g->length); grib_file_close(file->name, 0, &e); - if(!g->handle) + if (!g->handle) return -1; - if(g->values) + if (g->values) grib_context_free(ctx, g->values); g->values = NULL; } - if(g->values == NULL) - { + if (g->values == NULL) { size_t count = 0; - long bitmap = 0; + long bitmap = 0; - if((e = grib_get_size(g->handle, "values", &g->value_count))) - { + if ((e = grib_get_size(g->handle, "values", &g->value_count))) { grib_context_log(ctx, GRIB_LOG_ERROR, "ecCodes: cannot get number of values: %s", grib_get_error_message(e)); return e; } count = g->value_count; - if((e = grib_set_double(g->handle, "missingValue", global_missing_value))) - { + if ((e = grib_set_double(g->handle, "missingValue", global_missing_value))) { grib_context_log(ctx, GRIB_LOG_ERROR, "ecCodes: cannot set missingValue: %s", grib_get_error_message(e)); return e; } - g->values = (double*) grib_context_malloc(ctx, sizeof(double) * g->value_count); - if((e = grib_get_double_array(g->handle, "values", g->values, &count))) - { + g->values = (double*)grib_context_malloc(ctx, sizeof(double) * g->value_count); + if ((e = grib_get_double_array(g->handle, "values", g->values, &count))) { grib_context_log(ctx, GRIB_LOG_ERROR, "ecCodes: cannot decode values: %s", grib_get_error_message(e)); return e; } - if(count != g->value_count) + if (count != g->value_count) grib_context_log(ctx, GRIB_LOG_FATAL, "ecCodes: value count mismatch %d %d", count, g->value_count); - if((e = grib_get_long(g->handle, "missingValuesPresent", &bitmap))) - { + if ((e = grib_get_long(g->handle, "missingValuesPresent", &bitmap))) { grib_context_log(ctx, GRIB_LOG_ERROR, "ecCodes: cannot get missingValuesPresent: %s", grib_get_error_message(e)); return e; } @@ -1123,44 +1059,41 @@ static err to_expand_mem(field *g) return e; } -static void set_field_state(field *g, field_state shape) +static void set_field_state(field* g, field_state shape) { - switch(shape) - { - case expand_mem: - to_expand_mem(g); - break; - - case packed_mem: - to_packed_mem(g); - break; + switch (shape) { + case expand_mem: + to_expand_mem(g); + break; - case packed_file: - release_field(g); - break; + case packed_mem: + to_packed_mem(g); + break; - default: - grib_context_log(ctx, GRIB_LOG_FATAL, "Internal error %s %d", __FILE__, __LINE__); - break; + case packed_file: + release_field(g); + break; + default: + grib_context_log(ctx, GRIB_LOG_FATAL, "Internal error %s %d", __FILE__, __LINE__); + break; } } -static field *get_field(fieldset *v, int n, field_state shape) +static field* get_field(fieldset* v, int n, field_state shape) { - field *g = v->fields[n]; + field* g = v->fields[n]; set_field_state(g, shape); return g; } -static void release_field(field *g) +static void release_field(field* g) { - if(g->file) - { - if(g->values) + if (g->file) { + if (g->values) grib_context_free(ctx, g->values); g->values = NULL; - g->shape = packed_file; + g->shape = packed_file; grib_handle_delete(g->handle); g->handle = NULL; } @@ -1168,14 +1101,13 @@ static void release_field(field *g) static request* field_to_request(field* f) { - if(f->r == 0) - { + if (f->r == 0) { field_state state = f->shape; - request *r = empty_request( + request* r = empty_request( #ifdef COMEBACK - ((f->ksec1 == NULL) || (f->ksec1[2] != mars.computeflg)) ? "GRIB" : "COMPUTED"); + ((f->ksec1 == NULL) || (f->ksec1[2] != mars.computeflg)) ? "GRIB" : "COMPUTED"); #else - "GRIB"); + "GRIB"); #endif set_field_state(f, packed_mem); @@ -1188,18 +1120,17 @@ static request* field_to_request(field* f) return f->r->r; } -static request* fieldset_to_request(fieldset *fs) +static request* fieldset_to_request(fieldset* fs) { int i; request* r = empty_request("GRIB"); - if(!fs) + if (!fs) return 0; - for(i = 0; i < fs->count; i++) - { - request *s = field_to_request(fs->fields[i]); - reqmerge(r,s); + for (i = 0; i < fs->count; i++) { + request* s = field_to_request(fs->fields[i]); + reqmerge(r, s); } return r; @@ -1209,102 +1140,207 @@ static request* fieldset_to_request(fieldset *fs) /* hypercube from mars client */ /*===============================================================================*/ -static boolean eq_string(const char *, const char *); -static boolean eq_integer(const char *, const char *); -static boolean eq_range(const char *, const char *); -static boolean eq_param(const char *, const char *); -static boolean eq_coord(const char *, const char *); -static boolean eq_date(const char *, const char *); -static boolean eq_time(const char *, const char *); -static boolean eq_null(const char *, const char *); +static boolean eq_string(const char*, const char*); +static boolean eq_integer(const char*, const char*); +static boolean eq_range(const char*, const char*); +static boolean eq_param(const char*, const char*); +static boolean eq_coord(const char*, const char*); +static boolean eq_date(const char*, const char*); +static boolean eq_time(const char*, const char*); +static boolean eq_null(const char*, const char*); -static axis_t global_axis[] = -{ +static axis_t global_axis[] = { - /* From dhsbase.c 'check_grib' */ - { "class", eq_string, }, - { "type", eq_string, }, - { "stream", eq_string, }, - { "levtype", eq_string, }, + /* From dhsbase.c 'check_grib' */ + { + "class", + eq_string, + }, + { + "type", + eq_string, + }, + { + "stream", + eq_string, + }, + { + "levtype", + eq_string, + }, - { "origin", eq_string, }, - { "product", eq_string, }, - { "section", eq_string, }, - { "method", eq_integer, }, - { "system", eq_integer, }, + { + "origin", + eq_string, + }, + { + "product", + eq_string, + }, + { + "section", + eq_string, + }, + { + "method", + eq_integer, + }, + { + "system", + eq_integer, + }, - /* testing */ - /* {"repres", eq_null, }, */ + /* testing */ + /* {"repres", eq_null, }, */ - /* from field order */ - { "date", eq_date, }, - { "refdate", eq_date, }, - { "hdate", eq_date, }, - { "time", eq_time, }, + /* from field order */ + { + "date", + eq_date, + }, + { + "refdate", + eq_date, + }, + { + "hdate", + eq_date, + }, + { + "time", + eq_time, + }, - { "reference", eq_range, }, - { "step", eq_range, }, - { "fcmonth", eq_integer, }, - { "fcperiod", eq_range, }, + { + "reference", + eq_range, + }, + { + "step", + eq_range, + }, + { + "fcmonth", + eq_integer, + }, + { + "fcperiod", + eq_range, + }, - { "leadtime", eq_range, }, - { "opttime", eq_range, }, + { + "leadtime", + eq_range, + }, + { + "opttime", + eq_range, + }, - { "expver", eq_string, }, - { "domain", eq_string, }, + { + "expver", + eq_string, + }, + { + "domain", + eq_string, + }, - { "diagnostic", eq_integer, }, - { "iteration", eq_integer, }, + { + "diagnostic", + eq_integer, + }, + { + "iteration", + eq_integer, + }, - { "quantile", eq_range, }, - { "number", eq_integer, }, + { + "quantile", + eq_range, + }, + { + "number", + eq_integer, + }, - { "levelist", eq_coord, }, - { "latitude", eq_coord, }, - { "longitude", eq_coord, }, - { "range", eq_range, }, + { + "levelist", + eq_coord, + }, + { + "latitude", + eq_coord, + }, + { + "longitude", + eq_coord, + }, + { + "range", + eq_range, + }, - { "param", eq_param, }, + { + "param", + eq_param, + }, - { "ident", eq_integer, }, - { "obstype", eq_integer, }, - { "instrument", eq_integer, }, + { + "ident", + eq_integer, + }, + { + "obstype", + eq_integer, + }, + { + "instrument", + eq_integer, + }, - { "frequency", eq_integer, }, - { "direction", eq_integer, }, + { + "frequency", + eq_integer, + }, + { + "direction", + eq_integer, + }, - { "channel", eq_integer, }, }; + { + "channel", + eq_integer, + }, +}; -static int axisindex(const char *name) +static int axisindex(const char* name) { int i = 0; - for(i = 0; i < NUMBER(global_axis); i++) - { - if(strcmp(name, global_axis[i].name) == 0) + for (i = 0; i < NUMBER(global_axis); i++) { + if (strcmp(name, global_axis[i].name) == 0) return i; } return -1; } -static namecmp comparator(const char *name) +static namecmp comparator(const char* name) { - static char *dontcompare = NULL; - static boolean first = 1; - int i = 0; + static char* dontcompare = NULL; + static boolean first = 1; + int i = 0; - if(first) - { + if (first) { dontcompare = getenv("MARS_DONT_CHECK"); - first = FALSE; + first = FALSE; } - if(dontcompare != NULL) - { - if(strcmp(dontcompare, name) == 0) + if (dontcompare != NULL) { + if (strcmp(dontcompare, name) == 0) return eq_null; } - if((i = axisindex(name)) != -1) + if ((i = axisindex(name)) != -1) return global_axis[i].compare; grib_context_log(ctx, GRIB_LOG_ERROR, "No comparator for %s", name); return eq_string; @@ -1314,42 +1350,40 @@ static namecmp comparator(const char *name) /* index accessors */ /********************/ -static int count_index(const hypercube *h) +static int count_index(const hypercube* h) { int i = 0, n = 0; - for(i = 0; i < h->size; ++i) + for (i = 0; i < h->size; ++i) n += h->set[i]; return n; } -static int count_holes(const hypercube *h, int cnt) +static int count_holes(const hypercube* h, int cnt) { int i = 0, n = 0; - for(i = 0; i < cnt; ++i) + for (i = 0; i < cnt; ++i) n += h->set[i]; return (n == cnt) ? 0 : (cnt - n); } -static void reset_index(hypercube *h, int v) +static void reset_index(hypercube* h, int v) { memset(h->set, v, h->size); } -static void set_index(hypercube *h, int index, int value) +static void set_index(hypercube* h, int index, int value) { - if(index < 0 || index >= h->count) - { + if (index < 0 || index >= h->count) { grib_context_log(ctx, GRIB_LOG_ERROR, "Internal error, bad hypercube index %d", index); exit(1); } - if(index >= h->max) - { + if (index >= h->max) { int old = h->max; - while(index >= h->max) + while (index >= h->max) h->max += 4096; h->set = h->set ? (char*)grib_context_realloc(ctx, h->set, h->max) : (char*)grib_context_malloc(ctx, h->max); @@ -1357,7 +1391,7 @@ static void set_index(hypercube *h, int index, int value) memset(h->set + old, 0, h->max - old); } - if(index >= h->size) + if (index >= h->size) h->size = index + 1; h->set[index] = value; @@ -1371,41 +1405,38 @@ static void set_index(hypercube *h, int index, int value) /* axis accessors */ /*******************/ -static int count_axis(const hypercube *h) +static int count_axis(const hypercube* h) { - if(h && h->cube) + if (h && h->cube) return count_values(h->cube, "axis"); return -1; } -static const char* get_axis(const hypercube *h, int pos) +static const char* get_axis(const hypercube* h, int pos) { - const char *axis = NULL; - if(pos < count_axis(h)) - { + const char* axis = NULL; + if (pos < count_axis(h)) { axis = get_value(h->cube, "axis", pos); } return axis; } -static void add_axis(hypercube *h, const char *axis) +static void add_axis(hypercube* h, const char* axis) { add_value(h->cube, "axis", "%s", axis); } -static void unset_value(request *r, const char *parname) +static void unset_value(request* r, const char* parname) { parameter *p, *q = NULL; - if(!r) + if (!r) return; p = r->params; - while(p) - { - if(strcmp(parname, p->name) == 0) - { - if(q) + while (p) { + if (strcmp(parname, p->name) == 0) { + if (q) q->next = p->next; else r->params = p->next; @@ -1417,20 +1448,18 @@ static void unset_value(request *r, const char *parname) } } -static void reset_axis(hypercube *h) +static void reset_axis(hypercube* h) { unset_value(h->cube, "axis"); } -static void valcpy(request *a, request *b, char *aname, char *bname) +static void valcpy(request* a, request* b, char* aname, char* bname) { - parameter *p; - if(a && b && (p = find_parameter(b, bname))) - { + parameter* p; + if (a && b && (p = find_parameter(b, bname))) { boolean z = FALSE; - value *v = p->values; - while(v) - { + value* v = p->values; + while (v) { put_value(a, aname, v->name, z, FALSE, FALSE); z = TRUE; v = v->next; @@ -1438,24 +1467,22 @@ static void valcpy(request *a, request *b, char *aname, char *bname) } } -static void cube_values(hypercube *h, const char *p) +static void cube_values(hypercube* h, const char* p) { - valcpy(h->cube, h->r, (char *) p, (char *) p); + valcpy(h->cube, h->r, (char*)p, (char*)p); } -static int count_dimensions(const hypercube *, const char *); +static int count_dimensions(const hypercube*, const char*); -static int set_axis(hypercube *h) +static int set_axis(hypercube* h) { - int i = 0; + int i = 0; int count = (h && h->r) ? 1 : -1; reset_axis(h); - for(i = (NUMBER(global_axis) - 1); i >= 0; --i) - { + for (i = (NUMBER(global_axis) - 1); i >= 0; --i) { int n = count_dimensions(h, global_axis[i].name); - if(n > 1) - { + if (n > 1) { add_axis(h, global_axis[i].name); cube_values(h, global_axis[i].name); count *= n; @@ -1473,10 +1500,10 @@ static int set_axis(hypercube *h) /* Cube dimensions */ /*******************/ -static int count_dimensions(const hypercube *h, const char *axis) +static int count_dimensions(const hypercube* h, const char* axis) { int dims = -1; - if(h && h->r) + if (h && h->r) dims = count_values(h->r, axis); return dims; } @@ -1489,11 +1516,10 @@ static int count_dimensions(const hypercube *h, const char *axis) /* Auxiliary functions */ /**************************/ -static int count_hypercube(const request *r) +static int count_hypercube(const request* r) { int i = 0, count = 1; - for(i = 0; i < NUMBER(global_axis); ++i) - { + for (i = 0; i < NUMBER(global_axis); ++i) { int c = count_values(r, global_axis[i].name); count *= c ? c : 1; } @@ -1501,22 +1527,22 @@ static int count_hypercube(const request *r) return count; } -static int cube_order(const hypercube *h, const request *r) +static int cube_order(const hypercube* h, const request* r) { return _cube_position(h, r, TRUE); } -static int cube_position(const hypercube *h, const request *r) +static int cube_position(const hypercube* h, const request* r) { return _cube_position(h, r, FALSE); } -static void reserve_index_cache(hypercube *h, int size) +static void reserve_index_cache(hypercube* h, int size) { - if(size == 0) + if (size == 0) return; - if(h->index_cache != 0) + if (h->index_cache != 0) grib_context_free(ctx, h->index_cache); grib_context_log(ctx, GRIB_LOG_DEBUG, "grib_to_netcdf: Allocating hypercube index_cache: %d entries", size); h->index_cache = (int*)calloc(sizeof(int), size); @@ -1524,38 +1550,35 @@ static void reserve_index_cache(hypercube *h, int size) h->index_cache_size = size; } -static int _cube_position(const hypercube *h, const request *r, boolean remove_holes) +static int _cube_position(const hypercube* h, const request* r, boolean remove_holes) { - request *cube = h->cube; - int c = count_axis(h); - int index = 0; - int i = 0; - int n = 1; - int ok = 0; + request* cube = h->cube; + int c = count_axis(h); + int index = 0; + int i = 0; + int n = 1; + int ok = 0; - if(h->index_cache == 0 || h->index_cache_size != c) - reserve_index_cache((hypercube*) h, c); + if (h->index_cache == 0 || h->index_cache_size != c) + reserve_index_cache((hypercube*)h, c); - for(i = 0; i < c; ++i) - { - const char *axis = get_axis(h, i); - const char *v = get_value(r, axis, 0); - const char *w = NULL; - int dims = count_dimensions(h, axis); - int k = 0; - int count = count_values(cube, axis); - int last = h->index_cache[i]; - - for(k = 0; k < count; k++) - { + for (i = 0; i < c; ++i) { + const char* axis = get_axis(h, i); + const char* v = get_value(r, axis, 0); + const char* w = NULL; + int dims = count_dimensions(h, axis); + int k = 0; + int count = count_values(cube, axis); + int last = h->index_cache[i]; + + for (k = 0; k < count; k++) { int j = (k + last) % count; - w = get_value(cube, axis, j); - if(h->compare ? h->compare[i](w, v) : (strcmp(w, v) == 0)) - { + w = get_value(cube, axis, j); + if (h->compare ? h->compare[i](w, v) : (strcmp(w, v) == 0)) { index += j * n; n *= dims; ok++; - ((hypercube*) h)->index_cache[i] = j; + ((hypercube*)h)->index_cache[i] = j; break; } else @@ -1563,10 +1586,9 @@ static int _cube_position(const hypercube *h, const request *r, boolean remove_h } } - if(remove_holes) - { + if (remove_holes) { int holes = 0; - if(count_index(h) != h->size) + if (count_index(h) != h->size) holes = count_holes(h, index); index -= holes; } @@ -1575,47 +1597,44 @@ static int _cube_position(const hypercube *h, const request *r, boolean remove_h } static void cube_indexes( - const hypercube *h, request *r, - char** times_array, size_t times_array_size, - int *indexes, int size) -{ - request *cube = h->cube; - int c = count_axis(h); - int i = 0; - int index = 0; - int n = 1; - int ok = 0; - - if(size < c) - { + const hypercube* h, request* r, + char** times_array, size_t times_array_size, + int* indexes, int size) +{ + request* cube = h->cube; + int c = count_axis(h); + int i = 0; + int index = 0; + int n = 1; + int ok = 0; + + if (size < c) { grib_context_log(ctx, GRIB_LOG_ERROR, "Internal error in cube_indexes. size=%d < axis=%d", size, c); } - if(h->index_cache == 0 || h->index_cache_size != c) - reserve_index_cache((hypercube*) h, c); + if (h->index_cache == 0 || h->index_cache_size != c) + reserve_index_cache((hypercube*)h, c); - for(i = 0; i < c; ++i) - { - const char *axis = get_axis(h, i); - const char *v = get_value(r, axis, 0); - const char *w = NULL; - int dims = count_dimensions(h, axis); - int j = 0; - int k = 0; - int count = count_values(cube, axis); - int last = h->index_cache[i]; - const boolean is_time_axis = (strcmp(axis, "time")==0); + for (i = 0; i < c; ++i) { + const char* axis = get_axis(h, i); + const char* v = get_value(r, axis, 0); + const char* w = NULL; + int dims = count_dimensions(h, axis); + int j = 0; + int k = 0; + int count = count_values(cube, axis); + int last = h->index_cache[i]; + const boolean is_time_axis = (strcmp(axis, "time") == 0); if (is_time_axis) { Assert(times_array); Assert(times_array_size == count); } - for(k = 0; k < count; k++) - { + for (k = 0; k < count; k++) { j = (k + last) % count; if (is_time_axis) { /* GRIB-792: use fast lookup */ - Assert( j >=0 && j < times_array_size ); + Assert(j >= 0 && j < times_array_size); w = times_array[j]; /* For testing: * Assert( strcmp(w, get_value(cube, axis, j))==0 ); @@ -1626,14 +1645,12 @@ static void cube_indexes( w = get_value(cube, axis, j); } - if(h->compare ? h->compare[i](w, v) : (w == v)) - { + if (h->compare ? h->compare[i](w, v) : (w == v)) { index += j * n; n *= dims; ok++; - ((hypercube*) h)->index_cache[i] = j; + ((hypercube*)h)->index_cache[i] = j; break; - } } indexes[i] = j; @@ -1644,23 +1661,22 @@ static void cube_indexes( /* End of Auxiliary functions */ /*********************************/ -static hypercube *new_hypercube(const request *r) +static hypercube* new_hypercube(const request* r) { - hypercube *h = (hypercube*) calloc(sizeof(hypercube), 1); + hypercube* h = (hypercube*)calloc(sizeof(hypercube), 1); int total = 0, count = 0; - int n = 0; - const char *val = 0; + int n = 0; + const char* val = 0; Assert(h); - h->r = clone_one_request(r); + h->r = clone_one_request(r); h->cube = empty_request("CUBE"); h->count = total = count_hypercube(r); - count = set_axis(h); + count = set_axis(h); h->compare = 0; - if((total != count) || (count == 0)) - { + if ((total != count) || (count == 0)) { grib_context_log(ctx, GRIB_LOG_ERROR, "Internal error while computing hypercube fields"); grib_context_log(ctx, GRIB_LOG_ERROR, "Number of fields in request %d", total); grib_context_log(ctx, GRIB_LOG_ERROR, "Number of fields in hypercube %d", count); @@ -1671,21 +1687,21 @@ static hypercube *new_hypercube(const request *r) /* This is expensive, but makes the iterator with only those parameters found as axis */ h->iterator = empty_request(0); - for(n = 0; n < NUMBER(global_axis); ++n) - if((val = get_value(h->r, global_axis[n].name, 0)) != NULL) + for (n = 0; n < NUMBER(global_axis); ++n) + if ((val = get_value(h->r, global_axis[n].name, 0)) != NULL) set_value(h->iterator, global_axis[n].name, val); return h; } -static void print_hypercube(const hypercube *h) +static void print_hypercube(const hypercube* h) { print_all_requests(h->r); print_all_requests(h->cube); grib_context_log(ctx, GRIB_LOG_INFO, "%d active out of %d fields described\n", count_index(h), h->size); } -static void free_hypercube(hypercube *h) +static void free_hypercube(hypercube* h) { free_all_requests(h->r); free_all_requests(h->cube); @@ -1696,18 +1712,19 @@ static void free_hypercube(hypercube *h) grib_context_free(ctx, h); } -struct stuff_1 { - hypercube *c; - request *r; +struct stuff_1 +{ + hypercube* c; + request* r; }; -static void reqcb_1(const request *r, int count, axis_t *names, char *vals[], void *data) +static void reqcb_1(const request* r, int count, axis_t* names, char* vals[], void* data) { - struct stuff_1 *s = (struct stuff_1*) data; + struct stuff_1* s = (struct stuff_1*)data; int i; - for(i = 0; i < count; i++) - if(vals[i]) + for (i = 0; i < count; i++) + if (vals[i]) set_value(s->r, names[i].name, vals[i]); set_index(s->c, cube_position(s->c, s->r), 1); @@ -1715,9 +1732,9 @@ static void reqcb_1(const request *r, int count, axis_t *names, char *vals[], vo typedef void (*loopproc)(const request*, int, axis_t*, char**, void*); -static void names_loop(const request *r, loopproc proc, void *data); +static void names_loop(const request* r, loopproc proc, void* data); -static hypercube *new_hypercube_from_mars_request(const request *r) +static hypercube* new_hypercube_from_mars_request(const request* r) { int i; int n; @@ -1744,30 +1761,28 @@ static hypercube *new_hypercube_from_mars_request(const request *r) /* add single parameters */ - for(i = 0; i < NUMBER(global_axis); i++) - { + for (i = 0; i < NUMBER(global_axis); i++) { int m = count_values(r, global_axis[i].name); - if(m == 1) - { + if (m == 1) { add_value(s.c->cube, "axis", global_axis[i].name); set_value(s.c->cube, global_axis[i].name, get_value(r, global_axis[i].name, 0)); } } n = count_values(s.c->cube, "axis"); - if(n) { + if (n) { s.c->compare = (namecmp*)calloc(sizeof(namecmp), n); Assert(s.c->compare); } - for(i = 0; i < n; i++) + for (i = 0; i < n; i++) s.c->compare[i] = comparator(get_value(s.c->cube, "axis", i)); return s.c; } /* This one doesn't have single parameters in CUBE */ -static hypercube *new_simple_hypercube_from_mars_request(const request *r) +static hypercube* new_simple_hypercube_from_mars_request(const request* r) { int i; int n; @@ -1782,12 +1797,12 @@ static hypercube *new_simple_hypercube_from_mars_request(const request *r) free_one_request(s.r); n = count_values(s.c->cube, "axis"); - if(n) { + if (n) { s.c->compare = (namecmp*)calloc(sizeof(namecmp), n); Assert(s.c->compare); } - for(i = 0; i < n; i++) + for (i = 0; i < n; i++) s.c->compare[i] = comparator(get_value(s.c->cube, "axis", i)); return s.c; @@ -1810,26 +1825,28 @@ static hypercube *new_simple_hypercube_from_mars_request(const request *r) - Monthly means seem not to ignore STEP (data server, era40, eg retrieve 39/142) */ -typedef struct ncatt { +typedef struct ncatt +{ char name[1024]; - char *long_name; - char *units; - char *short_name; - char *standard_name; - request *metadata; + char* long_name; + char* units; + char* short_name; + char* standard_name; + request* metadata; nc_type nctype; } ncatt_t; -typedef struct filter { - fieldset *fset; - hypercube *filter; +typedef struct filter +{ + fieldset* fset; + hypercube* filter; int count; double scale_factor; double add_offset; double missing; boolean bitmap; ncatt_t att; - request *filter_request; + request* filter_request; boolean scale; } dataset_t; @@ -1840,18 +1857,19 @@ typedef struct filter { * } ncfile_t; */ -typedef struct ncoptions { +typedef struct ncoptions +{ boolean usevalidtime; /* Whether to use valid TIME only or not */ boolean auto_refdate; /* Automatic Reference Date */ - long refdate; /* Reference date */ - const char *version; + long refdate; /* Reference date */ + const char* version; - char *title; - char *history; - char *unlimited; + char* title; + char* history; + char* unlimited; boolean checkvalidtime; - request *mars_description; - boolean mmeans; /* Whether this dataset is Monthly Means */ + request* mars_description; + boolean mmeans; /* Whether this dataset is Monthly Means */ boolean climatology; /* Whether this dataset is climatology */ boolean shuffle; long deflate; @@ -1860,53 +1878,51 @@ typedef struct ncoptions { ncoptions_t setup; #define NC_TYPES 7 -struct nc_types_values { +struct nc_types_values +{ double nc_type_max; double nc_type_min; double nc_type_missing; -} nc_type_values[NC_TYPES] = -{ - /* In some occasions, SHRT_MIN-2 for the minimum value, makes ncview display +} nc_type_values[NC_TYPES] = { + /* In some occasions, SHRT_MIN-2 for the minimum value, makes ncview display missing values for -32766, while NC_FILL_SHORT=-32767, and SHRT_MIN=-32768 */ - { 0, 0, 0 }, /* NC_NAT, 'Not A Type' (c.f. NaN) */ - { 0x7f, NC_FILL_BYTE +1, NC_FILL_BYTE }, /* NC_BYTE, signed 1 byte integer */ - { 0xff, NC_FILL_CHAR +1, NC_FILL_CHAR }, /* NC_CHAR, ISO/ASCII character */ - { 0x7fff, NC_FILL_SHORT+1 , NC_FILL_SHORT }, /* NC_SHORT, signed 2 byte integer */ - { 0x7ffffff, NC_FILL_INT + 1, NC_FILL_INT }, /* NC_INT, signed 4 byte integer */ - { FLT_MAX, -FLT_MAX, NC_FILL_FLOAT }, /* NC_FLOAT, single precision floating point number */ - { DBL_MAX, -DBL_MAX, NC_FILL_DOUBLE }, /* NC_DOUBLE, double precision floating point number */ + { 0, 0, 0 }, /* NC_NAT, 'Not A Type' (c.f. NaN) */ + { 0x7f, NC_FILL_BYTE + 1, NC_FILL_BYTE }, /* NC_BYTE, signed 1 byte integer */ + { 0xff, NC_FILL_CHAR + 1, NC_FILL_CHAR }, /* NC_CHAR, ISO/ASCII character */ + { 0x7fff, NC_FILL_SHORT + 1, NC_FILL_SHORT }, /* NC_SHORT, signed 2 byte integer */ + { 0x7ffffff, NC_FILL_INT + 1, NC_FILL_INT }, /* NC_INT, signed 4 byte integer */ + { FLT_MAX, -FLT_MAX, NC_FILL_FLOAT }, /* NC_FLOAT, single precision floating point number */ + { DBL_MAX, -DBL_MAX, NC_FILL_DOUBLE }, /* NC_DOUBLE, double precision floating point number */ }; static long fcmonth2days(long date, long months) { long julianfrom = grib_date_to_julian(date); - long years = (long)(months/12); - long leap = (long)(years/4) - (long)(years/100); - long to = years*365 + (months%12)*32 + 1 + leap; /* FCMONTH can't be > 28 */ - long julianto = julianfrom + to; - long days = 0; - - long dd = date % 100; - long dateto = grib_julian_to_date(julianto); + long years = (long)(months / 12); + long leap = (long)(years / 4) - (long)(years / 100); + long to = years * 365 + (months % 12) * 32 + 1 + leap; /* FCMONTH can't be > 28 */ + long julianto = julianfrom + to; + long days = 0; + + long dd = date % 100; + long dateto = grib_julian_to_date(julianto); long nextdate = (dateto / 100) * 100 + dd; julianto = grib_date_to_julian(nextdate); - days = julianto - julianfrom; + days = julianto - julianfrom; grib_context_log(ctx, GRIB_LOG_DEBUG, "grib_to_netcdf: date: %ld + %ld months = %ld days", date, months, days); return days; } -static long request_fields(request *r) +static long request_fields(request* r) { - long cnt = 1; - parameter *p = r->params; - while(p) - { - if(p->name[0] != '_') - { - cnt *= count_values(r,p->name); + long cnt = 1; + parameter* p = r->params; + while (p) { + if (p->name[0] != '_') { + cnt *= count_values(r, p->name); } p = p->next; } @@ -1915,24 +1931,23 @@ static long request_fields(request *r) /* Transform MARS FCMONTHs into number of months from base date. For example, FCMONTH=1 is current month == 0 */ -static void fcmonth2nbmonths(request *r) +static void fcmonth2nbmonths(request* r) { long n = count_values(r, "fcmonth"); - if(n == 0) + if (n == 0) return; n = atol(get_value(r, "fcmonth", 0)); set_value(r, "fcmonth", "%ld", n - 1); } -static long monthnumber(const char *m) +static long monthnumber(const char* m) { - const char *months[] = - { "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC" }; - int i = 0; + const char* months[] = { "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC" }; + int i = 0; - while(i < 12) - if(strcmp(m, months[i++]) == 0) + while (i < 12) + if (strcmp(m, months[i++]) == 0) return i; grib_context_log(ctx, GRIB_LOG_ERROR, "Error. Translation for MONTH='%s' not found", m); return -1; @@ -1941,54 +1956,51 @@ static long monthnumber(const char *m) int check_stepUnits(const char* step_units_str) { /* Only hours, minutes and seconds supported */ - if (strcmp(step_units_str, "h")==0 || - strcmp(step_units_str, "m")==0 || - strcmp(step_units_str, "s")==0) - { + if (strcmp(step_units_str, "h") == 0 || + strcmp(step_units_str, "m") == 0 || + strcmp(step_units_str, "s") == 0) { return GRIB_SUCCESS; } return GRIB_WRONG_STEP_UNIT; } /* The argument represents 1 field */ -static void validation_time(request *r) +static void validation_time(request* r) { - long date = 0; - long time = 0; - double step = 0; + long date = 0; + long time = 0; + double step = 0; long fcmonthdays = 0; - long fcmonth = 0; + long fcmonth = 0; double v; - long julian = 0; + long julian = 0; const char* step_units = NULL; - long nstep = count_values(r, "step"); - long ndate = count_values(r, "date"); - long ntime = count_values(r, "time"); + long nstep = count_values(r, "step"); + long ndate = count_values(r, "date"); + long ntime = count_values(r, "time"); long nfcmonth = count_values(r, "fcmonth"); static long julianrefdate = 0; - if(nstep > 1 || ndate > 1 || ntime > 1 || nfcmonth > 1) - { - if(nstep > 1) + if (nstep > 1 || ndate > 1 || ntime > 1 || nfcmonth > 1) { + if (nstep > 1) grib_context_log(ctx, GRIB_LOG_ERROR, "Internal error. Field has more than 1 STEP"); - if(ntime > 1) + if (ntime > 1) grib_context_log(ctx, GRIB_LOG_ERROR, "Internal error. Field has more than 1 TIME"); - if(ndate > 1) + if (ndate > 1) grib_context_log(ctx, GRIB_LOG_ERROR, "Internal error. Field has more than 1 DATE"); - if(nfcmonth > 1) + if (nfcmonth > 1) grib_context_log(ctx, GRIB_LOG_ERROR, "Internal error. Field has more than 1 FCMONTH"); print_all_requests(r); exit(1); } - if(nstep) + if (nstep) step = atof(get_value(r, "step", 0)); - if(ndate) - { - const char* p = get_value(r, "date", 0); + if (ndate) { + const char* p = get_value(r, "date", 0); const char* marsClass = get_value(r, "class", 0); if (eq_string(marsClass, "s2")) { /* S2S Data. See GRIB-699 and GRIB-762 */ @@ -1998,53 +2010,51 @@ static void validation_time(request *r) p = hdate; /* This is a hindcast */ } } - if(is_number(p)) + if (is_number(p)) date = atol(p); - else - { + else { long julian = 0, second = 0; boolean isjul, date_ok; date_ok = parsedate(p, &julian, &second, &isjul); - if (!date_ok) grib_context_log(ctx, GRIB_LOG_ERROR, "Failed to parse date: '%s'", p); + if (!date_ok) + grib_context_log(ctx, GRIB_LOG_ERROR, "Failed to parse date: '%s'", p); date = grib_julian_to_date(julian); } /* Climatology */ - if(strlen(p) == 3) - { - if(setup.usevalidtime) + if (strlen(p) == 3) { + if (setup.usevalidtime) grib_context_log(ctx, GRIB_LOG_ERROR, "Climatology data. Setting usevalidtime=OFF"); setup.auto_refdate = FALSE; setup.usevalidtime = FALSE; - setup.climatology = TRUE; + setup.climatology = TRUE; } } - if(ntime) + if (ntime) time = atol(get_value(r, "time", 0)); - if(nfcmonth) - { + if (nfcmonth) { fcmonth = atol(get_value(r, "fcmonth", 0)); /* FCMONTH needs base DATE */ - if(date == 0) - { + if (date == 0) { grib_context_log(ctx, GRIB_LOG_ERROR, "Internal error: FCMONTH needs DATE"); exit(1); } fcmonthdays = fcmonth2days(date, fcmonth); } - julian = grib_date_to_julian(date); + julian = grib_date_to_julian(date); step_units = get_value(r, "stepUnits", 0); - if (step_units){ - if(check_stepUnits(step_units)!=GRIB_SUCCESS) { + if (step_units) { + if (check_stepUnits(step_units) != GRIB_SUCCESS) { grib_context_log(ctx, GRIB_LOG_ERROR, - "Cannot convert stepUnits of '%s'. Only hours, minutes and seconds supported.", step_units); + "Cannot convert stepUnits of '%s'. Only hours, minutes and seconds supported.", step_units); } - if (strcmp("m", step_units)==0) { + if (strcmp("m", step_units) == 0) { step /= 60; - } else if (strcmp("s", step_units)==0) { + } + else if (strcmp("s", step_units) == 0) { step /= 3600; } } @@ -2053,74 +2063,73 @@ static void validation_time(request *r) set_value(r, "_validation", "%lf", v); set_value(r, "_juliandate", "%ld", julian); - if(!julianrefdate) + if (!julianrefdate) julianrefdate = grib_date_to_julian(setup.refdate); set_value(r, "_validationtime", "%lf", v - julianrefdate * 24.0); /* Remove minutes from TIME */ - if(ntime) + if (ntime) set_value(r, "time", "%.1lf", time / 100.0); } static void free_nc_options() { - - if(setup.title) + if (setup.title) grib_context_free(ctx, setup.title); - if(setup.history) + if (setup.history) grib_context_free(ctx, setup.history); - if(setup.unlimited) + if (setup.unlimited) grib_context_free(ctx, setup.unlimited); - if(setup.mars_description) + if (setup.mars_description) free_all_requests(setup.mars_description); } -static void get_nc_options(const request *user_r) +static void get_nc_options(const request* user_r) { - const char *checkvalidtime_env = NULL; - const char *validtime = get_value(user_r, "usevalidtime", 0); - const char *refdate = get_value(user_r, "referencedate", 0); - const char *shuffle = get_value(user_r, "shuffle", 0); - const char *deflate = get_value(user_r, "deflate", 0); + const char* checkvalidtime_env = NULL; + const char* validtime = get_value(user_r, "usevalidtime", 0); + const char* refdate = get_value(user_r, "referencedate", 0); + const char* shuffle = get_value(user_r, "shuffle", 0); + const char* deflate = get_value(user_r, "deflate", 0); - const char *title = get_value(user_r, "title", 0); - const char *history = get_value(user_r, "history", 0); - const char *unlimited = get_value(user_r, "unlimited", 0); + const char* title = get_value(user_r, "title", 0); + const char* history = get_value(user_r, "history", 0); + const char* unlimited = get_value(user_r, "unlimited", 0); - setup.shuffle = shuffle ? (strcmp(shuffle, "true") == 0) : FALSE; - setup.deflate = deflate ? ((strcmp(deflate, "none") == 0) ? -1 : atol(deflate)) : -1; + setup.shuffle = shuffle ? (strcmp(shuffle, "true") == 0) : FALSE; + setup.deflate = deflate ? ((strcmp(deflate, "none") == 0) ? -1 : atol(deflate)) : -1; setup.usevalidtime = validtime ? (strcmp(validtime, "true") == 0) : FALSE; - setup.refdate = refdate ? atol(refdate) : 19000101; + setup.refdate = refdate ? atol(refdate) : 19000101; setup.auto_refdate = refdate ? (strcmp(get_value(user_r, "referencedate", 0), "AUTOMATIC") == 0) : FALSE; - setup.title = title ? grib_context_strdup(ctx, (title)) : NULL; - setup.history = history ? grib_context_strdup(ctx, (history)) : NULL; + setup.title = title ? grib_context_strdup(ctx, (title)) : NULL; + setup.history = history ? grib_context_strdup(ctx, (history)) : NULL; setup.unlimited = unlimited ? grib_context_strdup(ctx, ((unlimited))) : NULL; - checkvalidtime_env = getenv("GRIB_TO_NETCDF_CHECKVALIDTIME"); - setup.checkvalidtime = checkvalidtime_env ? atol(checkvalidtime_env) : 1; + checkvalidtime_env = getenv("GRIB_TO_NETCDF_CHECKVALIDTIME"); + setup.checkvalidtime = checkvalidtime_env ? atol(checkvalidtime_env) : 1; setup.mars_description = empty_request("MARS"); } -static nc_type translate_nctype(const char *name) +static nc_type translate_nctype(const char* name) { - if(!name) + if (!name) return NC_SHORT; - if(strcmp(name, "NC_BYTE") == 0) + if (strcmp(name, "NC_BYTE") == 0) return NC_BYTE; - if(strcmp(name, "NC_SHORT") == 0) + if (strcmp(name, "NC_SHORT") == 0) return NC_SHORT; - if(strcmp(name, "NC_INT") == 0) + if (strcmp(name, "NC_INT") == 0) return NC_INT; - if(strcmp(name, "NC_FLOAT") == 0) + if (strcmp(name, "NC_FLOAT") == 0) return NC_FLOAT; - if(strcmp(name, "NC_DOUBLE") == 0) + if (strcmp(name, "NC_DOUBLE") == 0) return NC_DOUBLE; grib_context_log(ctx, GRIB_LOG_ERROR, "Unknown NetCDF type '%s'. Using NC_SHORT", name); @@ -2129,45 +2138,43 @@ static nc_type translate_nctype(const char *name) static void check_err(const char* function, const int stat, const int line) { - if(stat != NC_NOERR) - { + if (stat != NC_NOERR) { /* (void) fprintf(stderr, "line %d of %s: %s\n", line, grib_tool_name, nc_strerror(stat)); */ (void)fprintf(stderr, "\n%s ERROR: line %d, %s: %s\n", grib_tool_name, line, function, nc_strerror(stat)); if (stat == NC_EVARSIZE) { - (void)fprintf(stderr, "\nCannot create netCDF classic format, dataset is too large!\n" - "Try splitting the input GRIB(s).\n"); + (void)fprintf(stderr, + "\nCannot create netCDF classic format, dataset is too large!\n" + "Try splitting the input GRIB(s).\n"); } exit(1); } } #define DIM_ID 1 -static int set_dimension(int ncid, const char *name, int n, int xtype, const char *units, const char *long_name) +static int set_dimension(int ncid, const char* name, int n, int xtype, const char* units, const char* long_name) { int var_id = 0; - int stat = 0; + int stat = 0; int dim_id = DIM_ID; int dim_vec[DIM_ID]; - if(setup.unlimited && (strcmp(name, setup.unlimited) == 0)) + if (setup.unlimited && (strcmp(name, setup.unlimited) == 0)) n = NC_UNLIMITED; stat = nc_def_dim(ncid, name, n, &dim_id); check_err("nc_def_dim", stat, __LINE__); dim_vec[0] = dim_id; - stat = nc_def_var(ncid, name, (nc_type) xtype, 1, dim_vec, &var_id); + stat = nc_def_var(ncid, name, (nc_type)xtype, 1, dim_vec, &var_id); check_err("nc_def_var", stat, __LINE__); - if(units != NULL) - { + if (units != NULL) { stat = nc_put_att_text(ncid, var_id, "units", strlen(units), units); check_err("nc_put_att_text", stat, __LINE__); } - if(long_name != NULL) - { + if (long_name != NULL) { stat = nc_put_att_text(ncid, var_id, "long_name", strlen(long_name), long_name); check_err("nc_put_att_text", stat, __LINE__); } @@ -2175,20 +2182,18 @@ static int set_dimension(int ncid, const char *name, int n, int xtype, const cha return var_id; } -static int check_grid(field *f) +static int check_grid(field* f) { err e = 0; char grid_type[80]; size_t size = sizeof(grid_type); - if ((e = grib_get_string(f->handle, "typeOfGrid", grid_type, &size)) != GRIB_SUCCESS) - { + if ((e = grib_get_string(f->handle, "typeOfGrid", grid_type, &size)) != GRIB_SUCCESS) { grib_context_log(ctx, GRIB_LOG_ERROR, "ecCodes: cannot get typeOfGrid %s", grib_get_error_message(e)); return e; } - if (strcmp(grid_type, "regular_ll") != 0 && (strcmp(grid_type, "regular_gg") != 0)) - { + if (strcmp(grid_type, "regular_ll") != 0 && (strcmp(grid_type, "regular_gg") != 0)) { grib_context_log(ctx, GRIB_LOG_ERROR, "Grid type = %s", grid_type); grib_context_log(ctx, GRIB_LOG_ERROR, "First GRIB is not on a regular lat/lon grid or on a regular Gaussian grid. Exiting.\n"); return GRIB_GEOCALCULUS_PROBLEM; @@ -2198,38 +2203,33 @@ static int check_grid(field *f) static int get_num_latitudes_longitudes(grib_handle* h, size_t* nlats, size_t* nlons) { - err e=0; + err e = 0; char grid_type[80]; size_t size = sizeof(grid_type); if (grib_get_string(h, "typeOfGrid", grid_type, &size) == GRIB_SUCCESS && - strcmp(grid_type, "regular_ll") == 0) - { + strcmp(grid_type, "regular_ll") == 0) { /* Special shortcut for regular lat/on grids */ long n; - Assert( !grib_is_missing(h, "Ni", &e) ); + Assert(!grib_is_missing(h, "Ni", &e)); if ((e = grib_get_long(h, "Ni", &n)) != GRIB_SUCCESS) { grib_context_log(ctx, GRIB_LOG_ERROR, "ecCodes: cannot get Ni: %s", grib_get_error_message(e)); return e; } *nlons = n; - if ((e = grib_get_long(h, "Nj", &n)) != GRIB_SUCCESS) - { + if ((e = grib_get_long(h, "Nj", &n)) != GRIB_SUCCESS) { grib_context_log(ctx, GRIB_LOG_ERROR, "ecCodes: cannot get Nj: %s", grib_get_error_message(e)); return e; } *nlats = n; } - else - { - if((e = grib_get_size(h, "distinctLatitudes", nlats)) != GRIB_SUCCESS) - { + else { + if ((e = grib_get_size(h, "distinctLatitudes", nlats)) != GRIB_SUCCESS) { grib_context_log(ctx, GRIB_LOG_ERROR, "ecCodes: cannot get distinctLatitudes: %s", grib_get_error_message(e)); return e; } - if((e = grib_get_size(h, "distinctLongitudes", nlons)) != GRIB_SUCCESS) - { + if ((e = grib_get_size(h, "distinctLongitudes", nlons)) != GRIB_SUCCESS) { grib_context_log(ctx, GRIB_LOG_ERROR, "ecCodes: cannot get distinctLongitudes: %s", grib_get_error_message(e)); return e; } @@ -2237,28 +2237,28 @@ static int get_num_latitudes_longitudes(grib_handle* h, size_t* nlats, size_t* n return e; } -static int def_latlon(int ncid, fieldset *fs) +static int def_latlon(int ncid, fieldset* fs) { - int n = 0; - size_t nlats=0, nlons=0; + int n = 0; + size_t nlats = 0, nlons = 0; int var_id = 0; - err e = 0; + err e = 0; - field *g = get_field(fs, 0, expand_mem); + field* g = get_field(fs, 0, expand_mem); - DebugAssert( check_grid(g)==GRIB_SUCCESS ); - - if((e = get_num_latitudes_longitudes(g->handle, &nlats, &nlons)) != GRIB_SUCCESS) { + DebugAssert(check_grid(g) == GRIB_SUCCESS); + + if ((e = get_num_latitudes_longitudes(g->handle, &nlats, &nlons)) != GRIB_SUCCESS) { grib_context_log(ctx, GRIB_LOG_ERROR, "ecCodes: cannot get lat/lon info: %s", grib_get_error_message(e)); return e; } /* Define longitude */ - n = (int)nlons; + n = (int)nlons; var_id = set_dimension(ncid, "longitude", n, NC_FLOAT, "degrees_east", "longitude"); /* Define latitude */ - n = nlats; + n = nlats; var_id = set_dimension(ncid, "latitude", n, NC_FLOAT, "degrees_north", "latitude"); /* g->purge_header = TRUE; */ @@ -2268,19 +2268,19 @@ static int def_latlon(int ncid, fieldset *fs) return e; } -static int put_latlon(int ncid, fieldset *fs) +static int put_latlon(int ncid, fieldset* fs) { int var_id = 0; - int i = 0; - size_t n = 0; - int stat = 0; - err e = 0; + int i = 0; + size_t n = 0; + int stat = 0; + err e = 0; - field *g = get_field(fs, 0, expand_mem); + field* g = get_field(fs, 0, expand_mem); - double *dvalues = NULL; - float *fvalues = NULL; - long nv = 0; + double* dvalues = NULL; + float* fvalues = NULL; + long nv = 0; size_t ni; size_t nj; @@ -2313,48 +2313,50 @@ static int put_latlon(int ncid, fieldset *fs) } #endif - if((e = get_num_latitudes_longitudes(g->handle, &nj, &ni)) != GRIB_SUCCESS) { + if ((e = get_num_latitudes_longitudes(g->handle, &nj, &ni)) != GRIB_SUCCESS) { grib_context_log(ctx, GRIB_LOG_ERROR, "ecCodes: put_latlon: cannot get distinctLatitudes: %s", grib_get_error_message(e)); return e; } /* Compute max. # values and allocate */ nv = ni; - if(nv < nj) + if (nv < nj) nv = nj; - fvalues = (float *) grib_context_malloc(ctx, sizeof(float) * nv); - dvalues = (double *) grib_context_malloc(ctx, sizeof(double) * nv); + fvalues = (float*)grib_context_malloc(ctx, sizeof(float) * nv); + dvalues = (double*)grib_context_malloc(ctx, sizeof(double) * nv); /* longitude */ - n = ni; + n = ni; stat = nc_inq_varid(ncid, "longitude", &var_id); check_err("nc_inq_varid", stat, __LINE__); - if((e = grib_get_double_array(g->handle, "distinctLongitudes", dvalues, &n)) != GRIB_SUCCESS) - { + if ((e = grib_get_double_array(g->handle, "distinctLongitudes", dvalues, &n)) != GRIB_SUCCESS) { grib_context_log(ctx, GRIB_LOG_ERROR, "ecCodes: put_latlon: cannot get distinctLongitudes: %s", grib_get_error_message(e)); return e; } Assert(n == ni); - for(i=0; i< n; i++) { fvalues[i] = dvalues[i]; } + for (i = 0; i < n; i++) { + fvalues[i] = dvalues[i]; + } stat = nc_put_var_float(ncid, var_id, fvalues); check_err("nc_put_var_float", stat, __LINE__); /* latitude */ - n = nj; + n = nj; stat = nc_inq_varid(ncid, "latitude", &var_id); check_err("nc_inq_varid", stat, __LINE__); - if((e = grib_get_double_array(g->handle, "distinctLatitudes", dvalues, &n)) != GRIB_SUCCESS) - { + if ((e = grib_get_double_array(g->handle, "distinctLatitudes", dvalues, &n)) != GRIB_SUCCESS) { grib_context_log(ctx, GRIB_LOG_ERROR, "ecCodes: put_latlon: cannot get distinctLatitudes: %s", grib_get_error_message(e)); return e; } Assert(n == nj); - for(i=0; i< n; i++) { fvalues[i] = dvalues[i]; } + for (i = 0; i < n; i++) { + fvalues[i] = dvalues[i]; + } stat = nc_put_var_float(ncid, var_id, fvalues); check_err("nc_put_var_float", stat, __LINE__); @@ -2366,75 +2368,66 @@ static int put_latlon(int ncid, fieldset *fs) return e; } -static int compute_scale(dataset_t *subset) +static int compute_scale(dataset_t* subset) { - double max = -DBL_MAX; - double min = DBL_MAX; - double median = 0; - long i = 0; - long j = 0; - int64_t scaled_max = 0; - int64_t scaled_min = 0; + double max = -DBL_MAX; + double min = DBL_MAX; + double median = 0; + long i = 0; + long j = 0; + int64_t scaled_max = 0; + int64_t scaled_min = 0; int64_t scaled_median = 0; double ao = 0.0, sf = 0.0; double x; - char test_scaled_max = 0; - char test_scaled_min = 0; + char test_scaled_max = 0; + char test_scaled_min = 0; char test_scaled_median = 0; err e = 0; - fieldset *fs = subset->fset; - int idx = subset->att.nctype; + fieldset* fs = subset->fset; + int idx = subset->att.nctype; - for(i = 0; i < fs->count; i++) - { - field *g = get_field(fs, i, expand_mem); + for (i = 0; i < fs->count; i++) { + field* g = get_field(fs, i, expand_mem); size_t len; - static double *vals = NULL; + static double* vals = NULL; static size_t vals_len = 0; - if((e = grib_get_size(g->handle, "values", &len)) != GRIB_SUCCESS) - { + if ((e = grib_get_size(g->handle, "values", &len)) != GRIB_SUCCESS) { grib_context_log(ctx, GRIB_LOG_ERROR, "ecCodes: cannot get size of values: %s", grib_get_error_message(e)); return e; } - if(len > vals_len) - { - if(vals) + if (len > vals_len) { + if (vals) grib_context_free(ctx, vals); - vals = (double*) grib_context_malloc(ctx, sizeof(double) * len); + vals = (double*)grib_context_malloc(ctx, sizeof(double) * len); vals_len = len; } - if((e = grib_get_double_array(g->handle, "values", vals, &len)) != GRIB_SUCCESS) - { + if ((e = grib_get_double_array(g->handle, "values", vals, &len)) != GRIB_SUCCESS) { grib_context_log(ctx, GRIB_LOG_ERROR, "ecCodes: cannot get values: %s", grib_get_error_message(e)); return e; } - if(g->has_bitmap) - { + if (g->has_bitmap) { subset->bitmap = TRUE; - for(j = 0; j < len; ++j) - { - if(vals[j] != (double) global_missing_value) - { - if(vals[j] > max) + for (j = 0; j < len; ++j) { + if (vals[j] != (double)global_missing_value) { + if (vals[j] > max) max = vals[j]; - if(vals[j] < min) + if (vals[j] < min) min = vals[j]; } } } - else - { - for(j = 0; j < len; ++j) - { - if(vals[j] > max) + else { + for (j = 0; j < len; ++j) { + if (vals[j] > max) max = vals[j]; - if(vals[j] < min) + if (vals[j] < min) min = vals[j]; } } @@ -2446,7 +2439,7 @@ static int compute_scale(dataset_t *subset) grib_context_log(ctx, GRIB_LOG_DEBUG, "grib_to_netcdf: max_int: %lf, min_int: %lf", nc_type_values[idx].nc_type_max, nc_type_values[idx].nc_type_min); - sf = (double) ((max - min) / (double) (nc_type_values[idx].nc_type_max - nc_type_values[idx].nc_type_min)); + sf = (double)((max - min) / (double)(nc_type_values[idx].nc_type_max - nc_type_values[idx].nc_type_min)); ao = ((max + min) - sf * (nc_type_values[idx].nc_type_min + nc_type_values[idx].nc_type_max)) / 2; if (min == max) { @@ -2461,103 +2454,101 @@ static int compute_scale(dataset_t *subset) x /= sf; grib_context_log(ctx, GRIB_LOG_DEBUG, "grib_to_netcdf: x=%lf", x); - scaled_max = rint((max - ao) / sf); - scaled_min = rint((min - ao) / sf); + scaled_max = rint((max - ao) / sf); + scaled_min = rint((min - ao) / sf); scaled_median = rint((median - ao) / sf); if (scaled_max > nc_type_values[idx].nc_type_max) { grib_context_log(ctx, GRIB_LOG_DEBUG, "grib_to_netcdf: scaled_max (=%lld) > nc_type_max (=%lf). Set sf to 1.0", scaled_max, nc_type_values[idx].nc_type_max); - sf = 1.0; /* ECC-685 */ + sf = 1.0; /* ECC-685 */ } - test_scaled_max = (char) scaled_max; - test_scaled_min = (char) scaled_min; - test_scaled_median = (char) scaled_median; + test_scaled_max = (char)scaled_max; + test_scaled_min = (char)scaled_min; + test_scaled_median = (char)scaled_median; grib_context_log(ctx, GRIB_LOG_DEBUG, "grib_to_netcdf: scaled_max: %lld, scaled_min: %lld, scaled_median: %lld, x: %lf", scaled_max, scaled_min, scaled_median, x); grib_context_log(ctx, GRIB_LOG_DEBUG, "grib_to_netcdf: test_scaled_max: %x, test_scaled_min: %x, test_scaled_median: %x", test_scaled_max, test_scaled_min, test_scaled_median, x); - max = scaled_max * sf + ao; - min = scaled_min * sf + ao; + max = scaled_max * sf + ao; + min = scaled_min * sf + ao; median = scaled_median * sf + ao; grib_context_log(ctx, GRIB_LOG_DEBUG, "grib_to_netcdf: max: %lf, min: %lf, median: %lf", max, min, median); subset->scale_factor = sf; - subset->add_offset = ao; + subset->add_offset = ao; return 0; } -static int nc_put_att_type(int ncid, int varid, const char *name, nc_type nctype, int n, double value) +static int nc_put_att_type(int ncid, int varid, const char* name, nc_type nctype, int n, double value) { int r = 0; - switch(nctype) - { - case NC_BYTE: { - unsigned char val_uchar = (unsigned char) value; - r = nc_put_att_uchar(ncid, varid, name, nctype, n, &val_uchar); - break; - } - case NC_SHORT: { - short int val_short = (short int) value; - r = nc_put_att_short(ncid, varid, name, nctype, n, &val_short); - break; - } - case NC_INT: { - int val_int = (int) value; - r = nc_put_att_int(ncid, varid, name, nctype, n, &val_int); - break; - } - case NC_FLOAT: { - float val_flt = (float) value; - r = nc_put_att_float(ncid, varid, name, nctype, n, &val_flt); - break; - } - case NC_DOUBLE: { - double val_dbl = (double) value; - r = nc_put_att_double(ncid, varid, name, nctype, n, &val_dbl); - break; - } - default: - grib_context_log(ctx, GRIB_LOG_ERROR, "nc_put_att_type(...): Unknown netcdf type '%d'", nctype); - break; + switch (nctype) { + case NC_BYTE: { + unsigned char val_uchar = (unsigned char)value; + r = nc_put_att_uchar(ncid, varid, name, nctype, n, &val_uchar); + break; + } + case NC_SHORT: { + short int val_short = (short int)value; + r = nc_put_att_short(ncid, varid, name, nctype, n, &val_short); + break; + } + case NC_INT: { + int val_int = (int)value; + r = nc_put_att_int(ncid, varid, name, nctype, n, &val_int); + break; + } + case NC_FLOAT: { + float val_flt = (float)value; + r = nc_put_att_float(ncid, varid, name, nctype, n, &val_flt); + break; + } + case NC_DOUBLE: { + double val_dbl = (double)value; + r = nc_put_att_double(ncid, varid, name, nctype, n, &val_dbl); + break; + } + default: + grib_context_log(ctx, GRIB_LOG_ERROR, "nc_put_att_type(...): Unknown netcdf type '%d'", nctype); + break; } return r; } -static int nc_put_vara_type(int ncid, int varid, const size_t start[], const size_t count[], void *valuesp, nc_type nctype) +static int nc_put_vara_type(int ncid, int varid, const size_t start[], const size_t count[], void* valuesp, nc_type nctype) { int r = 0; - switch(nctype) - { - case NC_BYTE: - r = nc_put_vara_uchar(ncid, varid, start, count, (unsigned char *) valuesp); - break; - case NC_SHORT: - r = nc_put_vara_short(ncid, varid, start, count, (short int *) valuesp); - break; - case NC_INT: - r = nc_put_vara_int(ncid, varid, start, count, (int *) valuesp); - break; - case NC_FLOAT: - r = nc_put_vara_float(ncid, varid, start, count, (float *) valuesp); - break; - case NC_DOUBLE: - r = nc_put_vara_double(ncid, varid, start, count, (double *) valuesp); - break; - default: - grib_context_log(ctx, GRIB_LOG_ERROR, "nc_put_vara_type(...): Unknown netcdf type '%d'", nctype); - break; + switch (nctype) { + case NC_BYTE: + r = nc_put_vara_uchar(ncid, varid, start, count, (unsigned char*)valuesp); + break; + case NC_SHORT: + r = nc_put_vara_short(ncid, varid, start, count, (short int*)valuesp); + break; + case NC_INT: + r = nc_put_vara_int(ncid, varid, start, count, (int*)valuesp); + break; + case NC_FLOAT: + r = nc_put_vara_float(ncid, varid, start, count, (float*)valuesp); + break; + case NC_DOUBLE: + r = nc_put_vara_double(ncid, varid, start, count, (double*)valuesp); + break; + default: + grib_context_log(ctx, GRIB_LOG_ERROR, "nc_put_vara_type(...): Unknown netcdf type '%d'", nctype); + break; } return r; } -static void scale_bitmap(double *vals, long n, void *data, dataset_t *subset) +static void scale_bitmap(double* vals, long n, void* data, dataset_t* subset) { - int i = 0; + int i = 0; nc_type nctype = subset->att.nctype; /* @@ -2568,75 +2559,69 @@ static void scale_bitmap(double *vals, long n, void *data, dataset_t *subset) } */ - switch(nctype) - { - case NC_BYTE: - { - unsigned char *vscaled = (unsigned char *) data; - for(i = 0; i < n; ++i){ - if(vals[i] == global_missing_value){ - vscaled[i] = (unsigned char) subset->missing; + switch (nctype) { + case NC_BYTE: { + unsigned char* vscaled = (unsigned char*)data; + for (i = 0; i < n; ++i) { + if (vals[i] == global_missing_value) { + vscaled[i] = (unsigned char)subset->missing; + } } + break; } - break; - } - case NC_SHORT: - { - short int *vscaled = (short int *) data; - for(i = 0; i < n; ++i){ - if(vals[i] == global_missing_value){ - vscaled[i] = (short int) subset->missing; + case NC_SHORT: { + short int* vscaled = (short int*)data; + for (i = 0; i < n; ++i) { + if (vals[i] == global_missing_value) { + vscaled[i] = (short int)subset->missing; + } } + break; } - break; - } - case NC_INT: - { - int *vscaled = (int *) data; - for(i = 0; i < n; ++i){ - if(vals[i] == global_missing_value){ - vscaled[i] = (int) subset->missing; + case NC_INT: { + int* vscaled = (int*)data; + for (i = 0; i < n; ++i) { + if (vals[i] == global_missing_value) { + vscaled[i] = (int)subset->missing; + } } + break; } - break; - } - case NC_FLOAT: - { - float *vscaled = (float *) data; - for(i = 0; i < n; ++i){ - if(vals[i] == global_missing_value){ - vscaled[i] = (float) subset->missing; + case NC_FLOAT: { + float* vscaled = (float*)data; + for (i = 0; i < n; ++i) { + if (vals[i] == global_missing_value) { + vscaled[i] = (float)subset->missing; + } } + break; } - break; - } - case NC_DOUBLE: - { - double *vscaled = (double *) data; - for(i = 0; i < n; ++i){ - if(vals[i] == global_missing_value){ - vscaled[i] = (double) subset->missing; + case NC_DOUBLE: { + double* vscaled = (double*)data; + for (i = 0; i < n; ++i) { + if (vals[i] == global_missing_value) { + vscaled[i] = (double)subset->missing; + } } + break; } - break; - } - default: - grib_context_log(ctx, GRIB_LOG_ERROR, "scale(...): Unknown netcdf type %d", nctype); - break; + default: + grib_context_log(ctx, GRIB_LOG_ERROR, "scale(...): Unknown netcdf type %d", nctype); + break; } } -static void scale(double *vals, long n, void *data, dataset_t *g) +static void scale(double* vals, long n, void* data, dataset_t* g) { - int i = 0; - nc_type nctype = g->att.nctype; + int i = 0; + nc_type nctype = g->att.nctype; double scale_factor = g->scale_factor; - double add_offset = g->add_offset; + double add_offset = g->add_offset; /* if(!subset->scale) @@ -2646,137 +2631,121 @@ static void scale(double *vals, long n, void *data, dataset_t *g) } */ - switch(nctype) - { - case NC_BYTE: - { - unsigned char *vscaled = (unsigned char *) data; - for(i = 0; i < n; ++i) - { - if(!g->bitmap || (vals[i] != global_missing_value)) - { - double d = rint((vals[i] - add_offset) / scale_factor); - Assert(d >= nc_type_values[nctype].nc_type_min && d <= nc_type_values[nctype].nc_type_max); - vscaled[i] = d; + switch (nctype) { + case NC_BYTE: { + unsigned char* vscaled = (unsigned char*)data; + for (i = 0; i < n; ++i) { + if (!g->bitmap || (vals[i] != global_missing_value)) { + double d = rint((vals[i] - add_offset) / scale_factor); + Assert(d >= nc_type_values[nctype].nc_type_min && d <= nc_type_values[nctype].nc_type_max); + vscaled[i] = d; + } } + break; } - break; - } - case NC_SHORT: - { - short int *vscaled = (short int *) data; - for(i = 0; i < n; ++i) - { - if(!g->bitmap || (vals[i] != global_missing_value)) - { - double d = 0; - Assert(scale_factor>0); - d = rint((vals[i] - add_offset) / scale_factor); - Assert(d >= nc_type_values[nctype].nc_type_min && d <= nc_type_values[nctype].nc_type_max); - vscaled[i] = d; + case NC_SHORT: { + short int* vscaled = (short int*)data; + for (i = 0; i < n; ++i) { + if (!g->bitmap || (vals[i] != global_missing_value)) { + double d = 0; + Assert(scale_factor > 0); + d = rint((vals[i] - add_offset) / scale_factor); + Assert(d >= nc_type_values[nctype].nc_type_min && d <= nc_type_values[nctype].nc_type_max); + vscaled[i] = d; + } } + break; } - break; - } - case NC_INT: - { - int *vscaled = (int *) data; - for(i = 0; i < n; ++i) - { - if(!g->bitmap || (vals[i] != global_missing_value)) - { - double d = rint((vals[i] - add_offset) / scale_factor); - Assert(d >= nc_type_values[nctype].nc_type_min && d <= nc_type_values[nctype].nc_type_max); - vscaled[i] = d; + case NC_INT: { + int* vscaled = (int*)data; + for (i = 0; i < n; ++i) { + if (!g->bitmap || (vals[i] != global_missing_value)) { + double d = rint((vals[i] - add_offset) / scale_factor); + Assert(d >= nc_type_values[nctype].nc_type_min && d <= nc_type_values[nctype].nc_type_max); + vscaled[i] = d; + } } + break; } - break; - } - case NC_FLOAT: - { - float *vscaled = (float *) data; - for(i = 0; i < n; ++i) - { - if(!g->bitmap || (vals[i] != global_missing_value)) - { - double d = vals[i]; - Assert(d >= nc_type_values[nctype].nc_type_min && d <= nc_type_values[nctype].nc_type_max); - vscaled[i] = d; + case NC_FLOAT: { + float* vscaled = (float*)data; + for (i = 0; i < n; ++i) { + if (!g->bitmap || (vals[i] != global_missing_value)) { + double d = vals[i]; + Assert(d >= nc_type_values[nctype].nc_type_min && d <= nc_type_values[nctype].nc_type_max); + vscaled[i] = d; + } } + break; } - break; - } - case NC_DOUBLE: - { - double *vscaled = (double *) data; - for(i = 0; i < n; ++i) - { - if(!g->bitmap || (vals[i] != global_missing_value)) - { - double d = vals[i]; - Assert(d >= nc_type_values[nctype].nc_type_min && d <= nc_type_values[nctype].nc_type_max); - vscaled[i] = d; + case NC_DOUBLE: { + double* vscaled = (double*)data; + for (i = 0; i < n; ++i) { + if (!g->bitmap || (vals[i] != global_missing_value)) { + double d = vals[i]; + Assert(d >= nc_type_values[nctype].nc_type_min && d <= nc_type_values[nctype].nc_type_max); + vscaled[i] = d; + } } + break; } - break; - } - default: - grib_context_log(ctx, GRIB_LOG_ERROR, "scale(...): Unknown netcdf type %d", nctype); - break; + default: + grib_context_log(ctx, GRIB_LOG_ERROR, "scale(...): Unknown netcdf type %d", nctype); + break; } } /* Return array of strings which are the "time" values */ static char** create_times_array(const request* cube, size_t* size) { - char** result = NULL; - const char *time_axis ="time"; /* special case */ - parameter *the_param = find_parameter(cube, time_axis); - *size = 0; + char** result = NULL; + const char* time_axis = "time"; /* special case */ + parameter* the_param = find_parameter(cube, time_axis); + *size = 0; if (the_param) { - size_t i=0, num_values=0; + size_t i = 0, num_values = 0; value* va = NULL; - if(!the_param->count) + if (!the_param->count) count_values(cube, time_axis); /* Go thru all values to count how many there are */ va = the_param->values; - while(va) { + while (va) { ++num_values; va = va->next; } /* Create and populate array */ - result = (char**) grib_context_malloc(ctx, sizeof(char*) * num_values); - va = the_param->values; - while(va) { + result = (char**)grib_context_malloc(ctx, sizeof(char*) * num_values); + va = the_param->values; + while (va) { result[i++] = va->name; - va = va->next; + va = va->next; } *size = num_values; } return result; } -static int put_data(hypercube *h, int ncid, const char *name, dataset_t *subset) +static int put_data(hypercube* h, int ncid, const char* name, dataset_t* subset) { - int i = 0; - int stat = 0; + int i = 0; + int stat = 0; int dataid = 0; - int naxis = count_axis(h); + int naxis = count_axis(h); size_t start[NC_MAX_DIMS]; size_t count[NC_MAX_DIMS]; - char** times_array = NULL; + char** times_array = NULL; size_t times_array_size = 0; - fieldset *fs = subset->fset; - field *f = get_field(fs, 0, expand_mem); + fieldset* fs = subset->fset; + field* f = get_field(fs, 0, expand_mem); - void *vscaled = NULL; + void* vscaled = NULL; long vscaled_length = 0; long ni; @@ -2784,27 +2753,25 @@ static int put_data(hypercube *h, int ncid, const char *name, dataset_t *subset) err e = 0; /* Define longitude */ - if((e = grib_get_long(f->handle, "Ni", &ni)) != GRIB_SUCCESS) - { + if ((e = grib_get_long(f->handle, "Ni", &ni)) != GRIB_SUCCESS) { grib_context_log(ctx, GRIB_LOG_ERROR, "ecCodes: cannot get Ni: %s", grib_get_error_message(e)); return e; } /* Define latitude */ - if((e = grib_get_long(f->handle, "Nj", &nj)) != GRIB_SUCCESS) - { + if ((e = grib_get_long(f->handle, "Nj", &nj)) != GRIB_SUCCESS) { grib_context_log(ctx, GRIB_LOG_ERROR, "ecCodes: cannot get Nj: %s", grib_get_error_message(e)); return e; } /* Start filling dimensions at first value */ - for(i = 0; i < 2 + naxis; ++i) + for (i = 0; i < 2 + naxis; ++i) start[i] = 0; /* Count dimensions per axis */ - for(i = 0; i < naxis; ++i) + for (i = 0; i < naxis; ++i) count[naxis - i - 1] = 1; - count[naxis] = nj; /* latitude */ + count[naxis] = nj; /* latitude */ count[naxis + 1] = ni; /* longitude */ /* f->purge_header = TRUE; */ @@ -2817,34 +2784,30 @@ static int put_data(hypercube *h, int ncid, const char *name, dataset_t *subset) /* This is for performance reasons */ times_array = create_times_array(h->cube, ×_array_size); - for(i = 0; i < fs->count; i++) - { - field *g = get_field(fs, i, expand_mem); + for (i = 0; i < fs->count; i++) { + field* g = get_field(fs, i, expand_mem); size_t len; - static double *vals = NULL; + static double* vals = NULL; static size_t vals_len = 0; - boolean missing = 0; + boolean missing = 0; - request *r; + request* r; int j = 0; int idx[1024]; int idxsize = 1024; - if((e = grib_get_size(g->handle, "values", &len)) != GRIB_SUCCESS) - { + if ((e = grib_get_size(g->handle, "values", &len)) != GRIB_SUCCESS) { grib_context_log(ctx, GRIB_LOG_ERROR, "ecCodes: cannot get size of values: %s", grib_get_error_message(e)); return e; } - if(len > vals_len) - { - if(vals) + if (len > vals_len) { + if (vals) grib_context_free(ctx, vals); - vals = (double*) grib_context_malloc(ctx, sizeof(double) * len); + vals = (double*)grib_context_malloc(ctx, sizeof(double) * len); vals_len = len; } - if((e = grib_get_double_array(g->handle, "values", vals, &len)) != GRIB_SUCCESS) - { + if ((e = grib_get_double_array(g->handle, "values", vals, &len)) != GRIB_SUCCESS) { grib_context_log(ctx, GRIB_LOG_ERROR, "ecCodes: cannot get values: %s", grib_get_error_message(e)); return e; } @@ -2854,43 +2817,38 @@ static int put_data(hypercube *h, int ncid, const char *name, dataset_t *subset) #endif r = field_to_request(g); - if(!missing) - { + if (!missing) { /* Reserved the maximum memory needed */ /* This should only be done once, as all fields have the same geometry */ - if((vscaled_length == 0) || (vscaled_length < sizeof(double) * len)) - { - if(vscaled) + if ((vscaled_length == 0) || (vscaled_length < sizeof(double) * len)) { + if (vscaled) grib_context_free(ctx, vscaled); - vscaled = (void *) grib_context_malloc(ctx, sizeof(double) * len); + vscaled = (void*)grib_context_malloc(ctx, sizeof(double) * len); vscaled_length = sizeof(double) * len; } scale(vals, len, vscaled, subset); - if(subset->bitmap) + if (subset->bitmap) scale_bitmap(vals, len, vscaled, subset); - if((e = grib_get_long(g->handle, "Ni", &ni)) != GRIB_SUCCESS) - { + if ((e = grib_get_long(g->handle, "Ni", &ni)) != GRIB_SUCCESS) { grib_context_log(ctx, GRIB_LOG_ERROR, "ecCodes: cannot get Ni: %s", grib_get_error_message(e)); return e; } /* Define latitude */ - if((e = grib_get_long(g->handle, "Nj", &nj)) != GRIB_SUCCESS) - { + if ((e = grib_get_long(g->handle, "Nj", &nj)) != GRIB_SUCCESS) { grib_context_log(ctx, GRIB_LOG_ERROR, "ecCodes: cannot get Nj: %s", grib_get_error_message(e)); return e; } - if(nj != count[naxis] || ni != count[naxis + 1]) - { + if (nj != count[naxis] || ni != count[naxis + 1]) { grib_context_log(ctx, GRIB_LOG_ERROR, "Grib %d has different resolution\n", i + 1); grib_context_log(ctx, GRIB_LOG_ERROR, "lat=%d, long=%d instead of lat=%d, long=%d\n", nj, ni, count[naxis], count[naxis + 1]); exit(1); } cube_indexes(h, r, times_array, times_array_size, idx, idxsize); - for(j = 0; j < naxis; ++j) + for (j = 0; j < naxis; ++j) start[naxis - j - 1] = idx[j]; grib_context_log(ctx, GRIB_LOG_DEBUG, "grib_to_netcdf: Put data from field %d", i); @@ -2908,52 +2866,50 @@ static int put_data(hypercube *h, int ncid, const char *name, dataset_t *subset) return 0; } -static void set_always_a_time(hypercube *h, request *data_r) +static void set_always_a_time(hypercube* h, request* data_r) { - if (setup.usevalidtime && count_values(data_r, "time") == 1) - { + if (setup.usevalidtime && count_values(data_r, "time") == 1) { set_value(h->cube, "time", "%.2lf", atof(get_value(data_r, "_validationtime", 0))); add_value(h->cube, "axis", "time"); { int i = 0; int n = count_values(h->cube, "axis"); - if(n) - { + if (n) { h->compare = (namecmp*)calloc(sizeof(namecmp), n); Assert(h->compare); } - for(i = 0; i < n; i++) + for (i = 0; i < n; i++) h->compare[i] = comparator(get_value(h->cube, "axis", i)); } } } -static int define_netcdf_dimensions(hypercube *h, fieldset *fs, int ncid, dataset_t *subsets, int subsetcnt, const request *data_r) +static int define_netcdf_dimensions(hypercube* h, fieldset* fs, int ncid, dataset_t* subsets, int subsetcnt, const request* data_r) { - const request *cube = h->cube; - int naxis = count_axis(h); - int i = 0; - int stat = 0; - int n = 0; - int var_id = 0; /* Variable ID */ + const request* cube = h->cube; + int naxis = count_axis(h); + int i = 0; + int stat = 0; + int n = 0; + int var_id = 0; /* Variable ID */ int dims[1024]; size_t chunks[NC_MAX_DIMS] = {0,}; /* For chunking */ err e = 0; - + long ni; long nj; - - field *f = get_field(fs, 0, expand_mem); - if ((e=check_grid(f)) != GRIB_SUCCESS) { + field* f = get_field(fs, 0, expand_mem); + + if ((e = check_grid(f)) != GRIB_SUCCESS) { release_field(f); return e; } - if((e = grib_get_long(f->handle, "Ni", &ni)) != GRIB_SUCCESS) { + if ((e = grib_get_long(f->handle, "Ni", &ni)) != GRIB_SUCCESS) { grib_context_log(ctx, GRIB_LOG_ERROR, "ecCodes: cannot get Ni: %s", grib_get_error_message(e)); return e; } @@ -2964,10 +2920,10 @@ static int define_netcdf_dimensions(hypercube *h, fieldset *fs, int ncid, datase release_field(f); /* Count dimensions per axis */ - for(i = 0; i < naxis; ++i) + for (i = 0; i < naxis; ++i) chunks[naxis - i - 1] = 1; - chunks[naxis] = nj; /* latitude */ + chunks[naxis] = nj; /* latitude */ chunks[naxis + 1] = ni; /* longitude */ /* START DEFINITIONS */ @@ -2978,42 +2934,35 @@ static int define_netcdf_dimensions(hypercube *h, fieldset *fs, int ncid, datase return e; /* Define netcdf dimensions */ - for(i = 0; i < naxis; ++i) - { - int nctype = NC_INT; - const char *axis = get_axis(h, i); - char *units = NULL; + for (i = 0; i < naxis; ++i) { + int nctype = NC_INT; + const char* axis = get_axis(h, i); + char* units = NULL; char u[10240]; - const char *lowaxis = (axis); - char *longname = (char *) lowaxis; - n = count_values(cube, axis); + const char* lowaxis = (axis); + char* longname = (char*)lowaxis; + n = count_values(cube, axis); - if(count_values(data_r,"levtype") > 1) - { + if (count_values(data_r, "levtype") > 1) { grib_context_log(ctx, GRIB_LOG_ERROR, "Cannot handle fields for different levtypes.\n"); grib_context_log(ctx, GRIB_LOG_ERROR, "Please split input data into different files. Exiting!\n"); exit(1); } - if(count_values(data_r,"stepUnits") > 1) - { + if (count_values(data_r, "stepUnits") > 1) { grib_context_log(ctx, GRIB_LOG_ERROR, "Cannot handle fields for different stepUnits.\n"); grib_context_log(ctx, GRIB_LOG_ERROR, "Please split input data into different files. Exiting!\n"); exit(1); } - if(strcmp(axis, "levelist") == 0) - { - const char *levtype = get_value(data_r, "levtype", 0); - if(levtype) - { - if(strcmp("pl", levtype) == 0) - { - units = "millibars"; + if (strcmp(axis, "levelist") == 0) { + const char* levtype = get_value(data_r, "levtype", 0); + if (levtype) { + if (strcmp("pl", levtype) == 0) { + units = "millibars"; longname = "pressure_level"; } - if(strcmp("ml", levtype) == 0) - { + if (strcmp("ml", levtype) == 0) { longname = "model_level_number"; } } @@ -3021,64 +2970,54 @@ static int define_netcdf_dimensions(hypercube *h, fieldset *fs, int ncid, datase lowaxis = "level"; } - if(strcmp(axis, "number") == 0) - { + if (strcmp(axis, "number") == 0) { longname = "ensemble_member"; } - if(strcmp(axis, "date") == 0) - { + if (strcmp(axis, "date") == 0) { sprintf(u, "days since %ld-%02ld-%02ld 00:00:0.0", setup.refdate / 10000, (setup.refdate % 10000) / 100, (setup.refdate % 100)); - units = u; + units = u; longname = "Base_date"; - if(setup.climatology) - { + if (setup.climatology) { sprintf(u, "months"); units = u; } } - if(strcmp(axis, "time") == 0) - { + if (strcmp(axis, "time") == 0) { boolean onedtime = (count_values(cube, "date") == 0 && count_values(cube, "step") == 0); sprintf(u, "hours since 0000-00-00 00:00:00.0"); longname = "reference_time"; - if(setup.usevalidtime || onedtime) - { + if (setup.usevalidtime || onedtime) { sprintf(u, "hours since %ld-%02ld-%02ld 00:00:00.0", setup.refdate / 10000, (setup.refdate % 10000) / 100, (setup.refdate % 100)); longname = "time"; } - if(setup.climatology) - { + if (setup.climatology) { sprintf(u, "hours"); } units = u; /* nctype = NC_FLOAT; */ } - if(strcmp(axis, "step") == 0) - { - units = "hours"; + if (strcmp(axis, "step") == 0) { + units = "hours"; longname = "time_step"; - if(count_values(cube, "date") == 0 && count_values(cube, "time") == 0) - { - const char *d = get_value(data_r, "date", 0); - const char *t = get_value(data_r, "time", 0); - long date = d ? atol(d) : 0; - long hour = t ? atol(t) : 0; - long min = t ? 60 * (atof(t) - hour) : 0; + if (count_values(cube, "date") == 0 && count_values(cube, "time") == 0) { + const char* d = get_value(data_r, "date", 0); + const char* t = get_value(data_r, "time", 0); + long date = d ? atol(d) : 0; + long hour = t ? atol(t) : 0; + long min = t ? 60 * (atof(t) - hour) : 0; sprintf(u, "hours since %ld-%02ld-%02ld %02ld:%02ld:00.0", date / 10000, (date % 10000) / 100, (date % 100), hour, min); units = u; } } - if((strcmp(axis, "fcmonth") == 0)) - { - const char *date = get_value(data_r, "date", 0); - char ymd[32] = ""; + if ((strcmp(axis, "fcmonth") == 0)) { + const char* date = get_value(data_r, "date", 0); + char ymd[32] = ""; - if(date) - { + if (date) { strncat(ymd, date, 4); strcat(ymd, "-"); strncat(ymd, date + 4, 2); @@ -3087,27 +3026,23 @@ static int define_netcdf_dimensions(hypercube *h, fieldset *fs, int ncid, datase /* ncview doesn't display properly */ strcat(ymd, "01"); } - else - { + else { sprintf(ymd, "00-00-00"); } sprintf(u, "months since %s 00:00:00.0", ymd); - units = u; + units = u; longname = "time"; } var_id = set_dimension(ncid, lowaxis, n, nctype, units, longname); - if(strcmp(axis, "time") == 0) - { - if(setup.usevalidtime) - { - const char *cal = "gregorian"; - - if(setup.mmeans) - { - char *period = "0000-01-00 00:00:00"; - stat = nc_put_att_text(ncid, var_id, "avg_period", strlen(period), period); + if (strcmp(axis, "time") == 0) { + if (setup.usevalidtime) { + const char* cal = "gregorian"; + + if (setup.mmeans) { + char* period = "0000-01-00 00:00:00"; + stat = nc_put_att_text(ncid, var_id, "avg_period", strlen(period), period); check_err("nc_put_att_text", stat, __LINE__); } @@ -3119,18 +3054,16 @@ static int define_netcdf_dimensions(hypercube *h, fieldset *fs, int ncid, datase /* Define data dimension */ n = 1 + 1 + naxis; /* longitude + latitude + # axis */ - for(i = 0; i < n; ++i) + for (i = 0; i < n; ++i) dims[i] = n - i - 1; - for(i = 0; i < subsetcnt; ++i) - { + for (i = 0; i < subsetcnt; ++i) { printf("%s: Defining variable '%s'.\n", grib_tool_name, subsets[i].att.name); stat = nc_def_var(ncid, subsets[i].att.name, subsets[i].att.nctype, n, dims, &var_id); check_err("nc_def_var", stat, __LINE__); - if (setup.deflate > -1) - { + if (setup.deflate > -1) { #ifdef NC_NETCDF4 stat = nc_def_var_chunking(ncid, var_id, NC_CHUNKED, chunks); check_err("nc_def_var_chunking", stat, __LINE__); @@ -3142,8 +3075,7 @@ static int define_netcdf_dimensions(hypercube *h, fieldset *fs, int ncid, datase grib_context_log(ctx, GRIB_LOG_ERROR, "Deflate option only supported in NetCDF4"); #endif } - if(subsets[i].scale) - { + if (subsets[i].scale) { compute_scale(&subsets[i]); stat = nc_put_att_double(ncid, var_id, "scale_factor", NC_DOUBLE, 1, &subsets[i].scale_factor); check_err("nc_put_att_double", stat, __LINE__); @@ -3157,31 +3089,27 @@ static int define_netcdf_dimensions(hypercube *h, fieldset *fs, int ncid, datase stat = nc_put_att_type(ncid, var_id, "missing_value", subsets[i].att.nctype, 1, nc_type_values[subsets[i].att.nctype].nc_type_missing); check_err("nc_put_att_type", stat, __LINE__); - if(subsets[i].att.units) - { - const char *txt = subsets[i].att.units; - stat = nc_put_att_text(ncid, var_id, "units", strlen(txt), txt); + if (subsets[i].att.units) { + const char* txt = subsets[i].att.units; + stat = nc_put_att_text(ncid, var_id, "units", strlen(txt), txt); check_err("nc_put_att_text", stat, __LINE__); } - if(subsets[i].att.long_name) - { - const char *txt = subsets[i].att.long_name; - stat = nc_put_att_text(ncid, var_id, "long_name", strlen(txt), txt); + if (subsets[i].att.long_name) { + const char* txt = subsets[i].att.long_name; + stat = nc_put_att_text(ncid, var_id, "long_name", strlen(txt), txt); check_err("nc_put_att_text", stat, __LINE__); } - if(subsets[i].att.short_name) - { - const char *txt = subsets[i].att.short_name; - stat = nc_put_att_text(ncid, var_id, "short_name", strlen(txt), txt); + if (subsets[i].att.short_name) { + const char* txt = subsets[i].att.short_name; + stat = nc_put_att_text(ncid, var_id, "short_name", strlen(txt), txt); check_err("nc_put_att_text", stat, __LINE__); } - if(subsets[i].att.standard_name) - { - const char *txt = subsets[i].att.standard_name; - stat = nc_put_att_text(ncid, var_id, "standard_name", strlen(txt), txt); + if (subsets[i].att.standard_name) { + const char* txt = subsets[i].att.standard_name; + stat = nc_put_att_text(ncid, var_id, "standard_name", strlen(txt), txt); check_err("nc_put_att_text", stat, __LINE__); } @@ -3194,36 +3122,31 @@ static int define_netcdf_dimensions(hypercube *h, fieldset *fs, int ncid, datase } #endif - if(subsets[i].att.metadata) - { - parameter *p = subsets[i].att.metadata->params; + if (subsets[i].att.metadata) { + parameter* p = subsets[i].att.metadata->params; - while(p) - { - const char *txt = p->values->name; - stat = nc_put_att_text(ncid, var_id, p->name, strlen(txt), txt); + while (p) { + const char* txt = p->values->name; + stat = nc_put_att_text(ncid, var_id, p->name, strlen(txt), txt); check_err("nc_put_att_text", stat, __LINE__); p = p->next; } } - } /* Dimension-less variable for MARS request */ - if(0) /* reset when we have proper & fast mars_description */ + if (0) /* reset when we have proper & fast mars_description */ { /* parameter *p = data_r->params; */ - parameter *p = setup.mars_description->params; - stat = nc_def_var(ncid, "MARS", NC_CHAR, 0, 0, &var_id); + parameter* p = setup.mars_description->params; + stat = nc_def_var(ncid, "MARS", NC_CHAR, 0, 0, &var_id); check_err("nc_def_var", stat, __LINE__); /* Store request for those parameters with single value */ - while(p) - { + while (p) { /* if((p->name[0] != '_') && (p->count == 1)) */ - if(p->name[0] != '_') - { + if (p->name[0] != '_') { char par[1024]; char val[1024000] = ""; sprintf(par, "%s", (p->name)); @@ -3233,8 +3156,7 @@ static int define_netcdf_dimensions(hypercube *h, fieldset *fs, int ncid, datase sprintf(val, "%s", (p->values->name)); #endif stat = nc_put_att_text(ncid, var_id, par, strlen(val), (val)); - if(stat != NC_NOERR) - { + if (stat != NC_NOERR) { printf("Error setting request for %s = %s\n", par, val); } check_err("nc_put_att_text", stat, __LINE__); @@ -3248,7 +3170,7 @@ static int define_netcdf_dimensions(hypercube *h, fieldset *fs, int ncid, datase char timestamp[80]; time_t now; /* char *convention = "MARS;CF"; */ - char *convention = "CF-1.6"; + char* convention = "CF-1.6"; char history[10240]; /* char *institution = "ECMWF Meteorological Archival and Retrieval System"; */ @@ -3257,14 +3179,12 @@ static int define_netcdf_dimensions(hypercube *h, fieldset *fs, int ncid, datase check_err("nc_put_att_text", stat, __LINE__); /* Use history provided or Timestamp */ - if(setup.history) - { + if (setup.history) { sprintf(history, "%s", setup.history); } - else - { - int major = ECCODES_MAJOR_VERSION; - int minor = ECCODES_MINOR_VERSION; + else { + int major = ECCODES_MAJOR_VERSION; + int minor = ECCODES_MINOR_VERSION; int revision = ECCODES_REVISION_VERSION; time(&now); @@ -3282,12 +3202,10 @@ static int define_netcdf_dimensions(hypercube *h, fieldset *fs, int ncid, datase check_err(stat,__LINE__,__FILE__); #endif - if(setup.title) - { + if (setup.title) { stat = nc_put_att_text(ncid, NC_GLOBAL, "title", strlen(setup.title), setup.title); check_err("nc_put_att_text", stat, __LINE__); } - } return e; } @@ -3295,34 +3213,45 @@ static int define_netcdf_dimensions(hypercube *h, fieldset *fs, int ncid, datase static size_t string_to_unique_number(const char* axis, const char* str) { size_t result = 0; - if(strcmp(axis, "type")==0) { + if (strcmp(axis, "type") == 0) { /* TODO: not ideal but capture the most common MARS types */ - if (strcmp(str,"an")==0) return 2; - else if(strcmp(str,"fc")==0) return 9; - else if(strcmp(str,"cf")==0) return 10; - else if(strcmp(str,"pf")==0) return 11; - else if(strcmp(str,"em")==0) return 17; - else if(strcmp(str,"es")==0) return 18; - else if(strcmp(str,"ep")==0) return 30; - else if(strcmp(str,"4i")==0) return 33; - else if(strcmp(str,"4g")==0) return 8; - else if(strcmp(str,"ia")==0) return 3; - else if(strcmp(str,"efi")==0) return 27; + if (strcmp(str, "an") == 0) + return 2; + else if (strcmp(str, "fc") == 0) + return 9; + else if (strcmp(str, "cf") == 0) + return 10; + else if (strcmp(str, "pf") == 0) + return 11; + else if (strcmp(str, "em") == 0) + return 17; + else if (strcmp(str, "es") == 0) + return 18; + else if (strcmp(str, "ep") == 0) + return 30; + else if (strcmp(str, "4i") == 0) + return 33; + else if (strcmp(str, "4g") == 0) + return 8; + else if (strcmp(str, "ia") == 0) + return 3; + else if (strcmp(str, "efi") == 0) + return 27; } /* Fallback general case: Use hashing */ result = 5381; while (*str) { - result = 33 * result ^ (unsigned char) *str++; + result = 33 * result ^ (unsigned char)*str++; } return result; } -static int fill_netcdf_dimensions(hypercube *h, fieldset *fs, int ncid) +static int fill_netcdf_dimensions(hypercube* h, fieldset* fs, int ncid) { - const request *cube = h->cube; - int naxis = count_axis(h); - int i = 0; - int var_id = 0; - int stat = 0; + const request* cube = h->cube; + int naxis = count_axis(h); + int i = 0; + int var_id = 0; + int stat = 0; /* Put latitude/longitude values */ grib_context_log(ctx, GRIB_LOG_DEBUG, "grib_to_netcdf: Put latitude/longitude values"); @@ -3330,37 +3259,35 @@ static int fill_netcdf_dimensions(hypercube *h, fieldset *fs, int ncid) /* Put netcdf axis values */ grib_context_log(ctx, GRIB_LOG_DEBUG, "grib_to_netcdf: Put netcdf axis values"); - for(i = 0; i < naxis; ++i) - { - int j = 0; - const char *axis = get_axis(h, i); - int n = count_values(cube, axis); - int *values = (int *) grib_context_malloc(ctx, sizeof(int) * n); - const char *lowaxis = (axis); - - if(!values) + for (i = 0; i < naxis; ++i) { + int j = 0; + const char* axis = get_axis(h, i); + int n = count_values(cube, axis); + int* values = (int*)grib_context_malloc(ctx, sizeof(int) * n); + const char* lowaxis = (axis); + + if (!values) grib_context_log(ctx, GRIB_LOG_ERROR, "fill_netcdf_dimensions: cannot allocate %ld bytes", sizeof(int) * n); - if(strcmp("levelist", axis) == 0) + if (strcmp("levelist", axis) == 0) lowaxis = "level"; - if(strcmp("date", axis) == 0) - { - if(setup.climatology) - for(j = 0; j < n; ++j) + if (strcmp("date", axis) == 0) { + if (setup.climatology) + for (j = 0; j < n; ++j) values[j] = monthnumber(get_value(cube, axis, j)); else - for(j = 0; j < n; ++j) + for (j = 0; j < n; ++j) values[j] = grib_date_to_julian(atol(get_value(cube, axis, j))) - grib_date_to_julian(setup.refdate); } - else - { - for(j = 0; j < n; ++j) { - long lv = 0; + else { + for (j = 0; j < n; ++j) { + long lv = 0; const char* sv = get_value(cube, axis, j); if (is_number(sv)) { lv = atol(sv); /* Detect error? */ - } else { + } + else { /* ECC-725: Convert string-valued dimension to integer * e.g. mars type or stream */ lv = string_to_unique_number(axis, sv); @@ -3375,8 +3302,7 @@ static int fill_netcdf_dimensions(hypercube *h, fieldset *fs, int ncid) /* if ( strcmp("time", axis) == 0 && setup.unlimited != NULL && strcmp(setup.unlimited, "time") == 0 && setup.usevalidtime) */ /* GRIB-437, GRIB-625 Special treatment of RECORD (unlimited) dimension */ /* See "The NetCDF C Interface Guide" Section 6.23 */ - if ( setup.unlimited != NULL && strcmp(setup.unlimited, axis) == 0 ) - { + if (setup.unlimited != NULL && strcmp(setup.unlimited, axis) == 0) { /* This is tricky. I'm not sure it works when this dimension is not outer dimension */ size_t start[NC_MAX_DIMS]; size_t count[NC_MAX_DIMS]; @@ -3391,8 +3317,7 @@ static int fill_netcdf_dimensions(hypercube *h, fieldset *fs, int ncid) stat = nc_put_vara_type(ncid, var_id, start, count, values, dim_type); check_err("nc_put_vara_type", stat, __LINE__); } - else - { + else { stat = nc_put_var_int(ncid, var_id, values); check_err("nc_put_var_int", stat, __LINE__); } @@ -3403,56 +3328,56 @@ static int fill_netcdf_dimensions(hypercube *h, fieldset *fs, int ncid) return 0; } -static void remove_param(request *r, void *data, const char *p) +static void remove_param(request* r, void* data, const char* p) { - request *config = (request *) data; - const char *ignore; + request* config = (request*)data; + const char* ignore; int i = 0; - while((ignore = get_value(config, p, i++)) != NULL) { + while ((ignore = get_value(config, p, i++)) != NULL) { unset_value(r, ignore); } } static void print_ignored_keys(FILE* f, request* data) { - const char *ignore = NULL; - int i = 0; + const char* ignore = NULL; + int i = 0; while ((ignore = get_value(data, "ignore", i)) != NULL) { - if (i==0) { + if (i == 0) { fprintf(f, "%s: Ignoring key(s): %s", grib_tool_name, ignore); - } else { + } + else { fprintf(f, ", %s", ignore); } ++i; } - if (i>0) fprintf(f, "\n"); + if (i > 0) + fprintf(f, "\n"); } #define NO_TABLE -1 -#define NO_PARAM 0 +#define NO_PARAM 0 -static void paramtable(const char *p, long *param, long *table, boolean paramIdMode) +static void paramtable(const char* p, long* param, long* table, boolean paramIdMode) { - const char *q = p; - int len = strlen(p); + const char* q = p; + int len = strlen(p); *param = atol(p); - while(p && (*p != '.') && ((p - q) < len)) + while (p && (*p != '.') && ((p - q) < len)) ++p; - if((*p == '.')) + if ((*p == '.')) *table = atol(++p); /* This version is grib_api... It should rely on what grib_api returns, either param.table or paramId */ - if(paramIdMode) - { + if (paramIdMode) { /* Special case for param=228015 => 15.228 */ - if((*param != NO_PARAM) && (*table == NO_TABLE) && (len == 6)) - { + if ((*param != NO_PARAM) && (*table == NO_TABLE) && (len == 6)) { char tbl[4]; char par[4]; p = q; @@ -3466,84 +3391,74 @@ static void paramtable(const char *p, long *param, long *table, boolean paramIdM } } -static void find_nc_attributes(const request *subset_r, const request *user_r, ncatt_t *att, const request *config_r, const request *data_r) +static void find_nc_attributes(const request* subset_r, const request* user_r, ncatt_t* att, const request* config_r, const request* data_r) { - const char *split = NULL; - int j = 0; + const char* split = NULL; + int j = 0; boolean set_param_as_name = TRUE; - long datatable = 0; /* = atol(get_value(data_r,"_CODETABLE2",0)); */ + long datatable = 0; /* = atol(get_value(data_r,"_CODETABLE2",0)); */ - if(count_values(user_r, "split") == 0) + if (count_values(user_r, "split") == 0) strcat(att->name, "data"); - while((split = get_value(user_r, "split", j++)) != NULL) - { - if(strcmp(split, "param") != 0) - { - if(count_values(data_r, split) > 1) + while ((split = get_value(user_r, "split", j++)) != NULL) { + if (strcmp(split, "param") != 0) { + if (count_values(data_r, split) > 1) set_param_as_name = FALSE; } } j = 0; - while((split = get_value(user_r, "split", j++)) != NULL) - { - boolean found = FALSE; - request *cfg = (request *) config_r; + while ((split = get_value(user_r, "split", j++)) != NULL) { + boolean found = FALSE; + request* cfg = (request*)config_r; boolean is_param = strcmp(split, "param") == 0; /* Only use this parameter in the name if there is more than one value in the original request or if param */ boolean setname = ((count_values(data_r, split) > 1) || (is_param && set_param_as_name)); - while(cfg) - { - const char *cfgname = get_value(cfg, "NAME", 0); - const char *cfgval = get_value(cfg, "VALUE", 0); - const char *dataval = NULL; - int i = 0; + while (cfg) { + const char* cfgname = get_value(cfg, "NAME", 0); + const char* cfgval = get_value(cfg, "VALUE", 0); + const char* dataval = NULL; + int i = 0; - if(strcmp(split, cfgname) == 0) - { - while((dataval = get_value(subset_r, cfgname, i++)) != NULL) - { - const char *tablestr = get_value(cfg, "TABLE2", 0); - long cfgtable = (is_param && tablestr != NULL) ? atol(get_value(cfg, "TABLE2", 0)) : -1; + if (strcmp(split, cfgname) == 0) { + while ((dataval = get_value(subset_r, cfgname, i++)) != NULL) { + const char* tablestr = get_value(cfg, "TABLE2", 0); + long cfgtable = (is_param && tablestr != NULL) ? atol(get_value(cfg, "TABLE2", 0)) : -1; - long cfgparam = atol(cfgval); + long cfgparam = atol(cfgval); long dataparam = atol(dataval); paramtable(dataval, &dataparam, &datatable, FALSE); /* If it is not param and they're EXACTLY equal or being param, they're the same parameter and table */ - if((!is_param && (strcmp(dataval, cfgval) == 0)) || (is_param && (dataparam == cfgparam) && (datatable == cfgtable || (datatable == 0 && (cfgtable == 128))))) - { - const char *val = NULL; - const char *metafile = NULL; + if ((!is_param && (strcmp(dataval, cfgval) == 0)) || (is_param && (dataparam == cfgparam) && (datatable == cfgtable || (datatable == 0 && (cfgtable == 128))))) { + const char* val = NULL; + const char* metafile = NULL; - if((val = get_value(cfg, "accuracy", 0)) != NULL) + if ((val = get_value(cfg, "accuracy", 0)) != NULL) att->nctype = translate_nctype(val); - att->long_name = grib_context_strdup(ctx, (get_value(cfg, "LONG_NAME", 0))); + att->long_name = grib_context_strdup(ctx, (get_value(cfg, "LONG_NAME", 0))); att->short_name = grib_context_strdup(ctx, (get_value(cfg, "SHORT_NAME", 0))); - att->units = grib_context_strdup(ctx, (get_value(cfg, "UNITS", 0))); + att->units = grib_context_strdup(ctx, (get_value(cfg, "UNITS", 0))); /* Check if there is more metadata for this variable */ - if((metafile = get_value(cfg, "METADATA", 0)) != NULL) - { - static const char *metadata_dir = NULL; + if ((metafile = get_value(cfg, "METADATA", 0)) != NULL) { + static const char* metadata_dir = NULL; char metapath[1024]; - if(!metadata_dir) + if (!metadata_dir) metadata_dir = getenv("METADATA_DIR"); sprintf(metapath, "%s/%s", metadata_dir ? metadata_dir : ".", metafile); - att->metadata = 0;/* read_request_file(metapath); */ - + att->metadata = 0; /* read_request_file(metapath); */ } - if(setname) - { - const char *pname = get_value(cfg, "DATA", 0); - if(strlen(att->name)) + if (setname) { + const char* pname = get_value(cfg, "DATA", 0); + if (strlen(att->name)) strcat(att->name, "_"); strcat(att->name, pname); } @@ -3557,12 +3472,10 @@ static void find_nc_attributes(const request *subset_r, const request *user_r, n } /* We have not found configuration for this attribute */ - if(!found) - { - const char *val = get_value(subset_r, split, 0); - if(val && (setname)) - { - if(strlen(att->name)) + if (!found) { + const char* val = get_value(subset_r, split, 0); + if (val && (setname)) { + if (strlen(att->name)) strcat(att->name, "_"); strcat(att->name, val); } @@ -3570,87 +3483,77 @@ static void find_nc_attributes(const request *subset_r, const request *user_r, n } /* NetCDF does not allow variable names to start with a digit */ - if(!isalpha(att->name[0])) - { + if (!isalpha(att->name[0])) { char buf[1048]; - const char *val = get_value(subset_r, "param", 0); - sprintf(buf,"%s_%s", (val ? val : "p"), att->name); - strcpy(att->name,buf); + const char* val = get_value(subset_r, "param", 0); + sprintf(buf, "%s_%s", (val ? val : "p"), att->name); + strcpy(att->name, buf); } } -static request *first; -static request *last; +static request* first; +static request* last; -static void reqcb(const request *r, int count, axis_t *names, char *vals[], void *data) +static void reqcb(const request* r, int count, axis_t* names, char* vals[], void* data) { - request *w = clone_one_request(r); + request* w = clone_one_request(r); int i; /*request **d = (request**)data;*/ - int *n = (int*) data; + int* n = (int*)data; w->order = (*n)++; - for(i = 0; i < count; i++) - { - - if(vals[i]) + for (i = 0; i < count; i++) { + if (vals[i]) put_value(w, names[i].name, vals[i], FALSE, FALSE, FALSE); } - if(first == NULL) + if (first == NULL) first = w; else last->next = w; last = w; } -static boolean chk_152(int count, axis_t *names, char *vals[]) +static boolean chk_152(int count, axis_t* names, char* vals[]) { return TRUE; } -static void loop(const request *r, boolean ml, int index, int count, axis_t* strings, char *values[], loopproc callback, void *data) +static void loop(const request* r, boolean ml, int index, int count, axis_t* strings, char* values[], loopproc callback, void* data) { - if(index < count) - { - parameter *p = find_parameter(r, strings[index].name); + if (index < count) { + parameter* p = find_parameter(r, strings[index].name); - (void) count_values(r, strings[index].name); /* force list expansion */ + (void)count_values(r, strings[index].name); /* force list expansion */ - if(p) - { - value *v = p->values; + if (p) { + value* v = p->values; - while(v) - { + while (v) { values[index] = v->name; loop(r, ml, index + 1, count, strings, values, callback, data); v = v->next; } } - else - { + else { values[index] = NULL; loop(r, ml, index + 1, count, strings, values, callback, data); } - } - else if(!ml || chk_152(count, strings, values)) + else if (!ml || chk_152(count, strings, values)) callback(r, count, strings, values, data); } -static void values_loop(const request *r, int count, axis_t *parnames, loopproc callback, void *data) +static void values_loop(const request* r, int count, axis_t* parnames, loopproc callback, void* data) { - char **values = (char**) grib_context_malloc(ctx, sizeof(char*) * count); - const char * p = get_value(r, "levtype", 0); - boolean ml = (boolean) (p && (strcmp(p, "ml") == 0)); + char** values = (char**)grib_context_malloc(ctx, sizeof(char*) * count); + const char* p = get_value(r, "levtype", 0); + boolean ml = (boolean)(p && (strcmp(p, "ml") == 0)); - if(ml) - { + if (ml) { p = get_value(r, "expect", 0); - if(p && atol(p) != 0) - { + if (p && atol(p) != 0) { grib_context_log(ctx, GRIB_LOG_ERROR, "EXPECT provided, special treatment of LNSP"); grib_context_log(ctx, GRIB_LOG_ERROR, "and other single level parameters disabled"); ml = FALSE; @@ -3662,12 +3565,12 @@ static void values_loop(const request *r, int count, axis_t *parnames, loopproc grib_context_free(ctx, values); } -static void names_loop(const request *r, loopproc proc, void *data) +static void names_loop(const request* r, loopproc proc, void* data) { values_loop(r, NUMBER(global_axis), global_axis, proc, data); } -static request *unwind_one_request(const request *r) +static request* unwind_one_request(const request* r) { int n = 0; first = last = NULL; @@ -3675,24 +3578,22 @@ static request *unwind_one_request(const request *r) return first; } -static int split_fieldset(fieldset *fs, request *data_r, dataset_t **subsets, const request *user_r, const request *config_r) +static int split_fieldset(fieldset* fs, request* data_r, dataset_t** subsets, const request* user_r, const request* config_r) { - const char *split = NULL; - int count = 1; - int i = 0; - request *s = NULL; - request *u = NULL; - dataset_t *filters = NULL; - nc_type nctype = translate_nctype(get_value(user_r, "accuracy", 0)); + const char* split = NULL; + int count = 1; + int i = 0; + request* s = NULL; + request* u = NULL; + dataset_t* filters = NULL; + nc_type nctype = translate_nctype(get_value(user_r, "accuracy", 0)); s = empty_request("filter"); - while((split = get_value(user_r, "split", i++)) != NULL) - { + while ((split = get_value(user_r, "split", i++)) != NULL) { int cnt = count_values(data_r, split); - if(cnt) - { + if (cnt) { count *= count_values(data_r, split); - valcpy(s, data_r, (char *) split, (char *) split); + valcpy(s, data_r, (char*)split, (char*)split); } } @@ -3704,51 +3605,43 @@ static int split_fieldset(fieldset *fs, request *data_r, dataset_t **subsets, co Assert(filters); s = u; - for(i = 0; i < count; ++i) - { + for (i = 0; i < count; ++i) { Assert(s); - filters[i].filter = new_hypercube_from_mars_request(s); - filters[i].fset = new_fieldset(1); - filters[i].count = 0; + filters[i].filter = new_hypercube_from_mars_request(s); + filters[i].fset = new_fieldset(1); + filters[i].count = 0; filters[i].filter_request = clone_one_request(s); - filters[i].bitmap = FALSE; + filters[i].bitmap = FALSE; /* filters[i].mmeans = FALSE; */ s = s->next; } - for(i = 0; i < fs->count; ++i) - { + for (i = 0; i < fs->count; ++i) { boolean ok = FALSE; - field *f = get_field(fs, i, packed_mem); - request *g = field_to_request(f); - int j = 0; + field* f = get_field(fs, i, packed_mem); + request* g = field_to_request(f); + int j = 0; - while(!ok && (j < count)) - { + while (!ok && (j < count)) { ok = (cube_order(filters[j].filter, g) != -1); - if(ok) - { - const char *p; + if (ok) { + const char* p; set_field(filters[j].fset, f, filters[j].count++); filters[j].bitmap |= f->has_bitmap; - if((p = get_value(f->r->r, "_units", 0)) != NULL) - { + if ((p = get_value(f->r->r, "_units", 0)) != NULL) { filters[j].att.units = grib_context_strdup(ctx, p); } - if((p = get_value(f->r->r, "_long_name", 0)) != NULL) - { + if ((p = get_value(f->r->r, "_long_name", 0)) != NULL) { filters[j].att.long_name = grib_context_strdup(ctx, p); } - if((p = get_value(f->r->r, "_cf_name", 0)) != NULL) - { + if ((p = get_value(f->r->r, "_cf_name", 0)) != NULL) { filters[j].att.standard_name = grib_context_strdup(ctx, p); } } j++; } - if(!ok) - { + if (!ok) { grib_context_log(ctx, GRIB_LOG_ERROR, "Internal error. Lost field %d while splitting fieldset", i); print_all_requests(g); grib_context_log(ctx, GRIB_LOG_ERROR, "count is %d", count); @@ -3760,30 +3653,27 @@ static int split_fieldset(fieldset *fs, request *data_r, dataset_t **subsets, co release_field(f); } - for(i = 0; i < count; ++i) - { + for (i = 0; i < count; ++i) { filters[i].att.nctype = nctype; - filters[i].scale = TRUE; - filters[i].missing = nc_type_values[nctype].nc_type_missing; + filters[i].scale = TRUE; + filters[i].missing = nc_type_values[nctype].nc_type_missing; find_nc_attributes(filters[i].filter_request, user_r, &(filters[i].att), config_r, data_r); grib_context_log(ctx, GRIB_LOG_DEBUG, "grib_to_netcdf: filter[%d] found.- Var. name '%s', nctype: %d, found nctype: %d", i, filters[i].att.name, nctype, filters[i].att.nctype); - if(strlen(filters[i].att.name) == 0) - { + if (strlen(filters[i].att.name) == 0) { grib_context_log(ctx, GRIB_LOG_ERROR, "Variable name not found"); exit(1); } /* Check if we need scaling */ - switch(filters[i].att.nctype) - { - case NC_FLOAT: - case NC_DOUBLE: - filters[i].scale = FALSE; - break; - default: - filters[i].scale = TRUE; - break; + switch (filters[i].att.nctype) { + case NC_FLOAT: + case NC_DOUBLE: + filters[i].scale = FALSE; + break; + default: + filters[i].scale = TRUE; + break; } } @@ -3792,12 +3682,11 @@ static int split_fieldset(fieldset *fs, request *data_r, dataset_t **subsets, co return count; } -static void free_subsets(dataset_t *subsets, int count) +static void free_subsets(dataset_t* subsets, int count) { int i = 0; - for(i = 0; i < count; ++i) - { + for (i = 0; i < count; ++i) { grib_context_free(ctx, subsets[i].att.units); grib_context_free(ctx, subsets[i].att.long_name); grib_context_free(ctx, subsets[i].att.short_name); @@ -3813,46 +3702,58 @@ static void free_subsets(dataset_t *subsets, int count) /* Return the number of the given month or -1 if it fails to match */ static int convert_month(const char* pMonthString) { - if (strcmp(pMonthString, "jan")==0) return 1; - if (strcmp(pMonthString, "feb")==0) return 2; - if (strcmp(pMonthString, "mar")==0) return 3; - if (strcmp(pMonthString, "apr")==0) return 4; - if (strcmp(pMonthString, "may")==0) return 5; - if (strcmp(pMonthString, "jun")==0) return 6; - if (strcmp(pMonthString, "jul")==0) return 7; - if (strcmp(pMonthString, "aug")==0) return 8; - if (strcmp(pMonthString, "sep")==0) return 9; - if (strcmp(pMonthString, "oct")==0) return 10; - if (strcmp(pMonthString, "nov")==0) return 11; - if (strcmp(pMonthString, "dec")==0) return 12; + if (strcmp(pMonthString, "jan") == 0) + return 1; + if (strcmp(pMonthString, "feb") == 0) + return 2; + if (strcmp(pMonthString, "mar") == 0) + return 3; + if (strcmp(pMonthString, "apr") == 0) + return 4; + if (strcmp(pMonthString, "may") == 0) + return 5; + if (strcmp(pMonthString, "jun") == 0) + return 6; + if (strcmp(pMonthString, "jul") == 0) + return 7; + if (strcmp(pMonthString, "aug") == 0) + return 8; + if (strcmp(pMonthString, "sep") == 0) + return 9; + if (strcmp(pMonthString, "oct") == 0) + return 10; + if (strcmp(pMonthString, "nov") == 0) + return 11; + if (strcmp(pMonthString, "dec") == 0) + return 12; return -1; /*Failed*/ } -static boolean parsedate(const char *name, long* julian, long *second, boolean* isjul) +static boolean parsedate(const char* name, long* julian, long* second, boolean* isjul) { - const char *p = name; + const char* p = name; int n; int y = 0, m = 0, d = 0, H = 0, M = 0, S = 0; *julian = *second = 0; - *isjul = FALSE; + *isjul = FALSE; - if(p == 0 || *p == 0) + if (p == 0 || *p == 0) return FALSE; /* Special ERA Interim grib1 date format: jul-21, sep-02 etc * See GRIB-416 */ - if (isalpha(*p)) - { + if (isalpha(*p)) { char month[32]; int day = 0; - int n = sscanf(p, "%[^-]-%d", month, &day); + int n = sscanf(p, "%[^-]-%d", month, &day); /* Matched two items (month and day) and month is 3 letters */ if (n == 2 && strlen(month) == 3) { y = 1900; /* no year specified */ m = convert_month(month); - if (m == -1) return FALSE; + if (m == -1) + return FALSE; *julian = grib_date_to_julian(y * 10000 + m * 100 + day); *second = 0; return TRUE; @@ -3861,29 +3762,27 @@ static boolean parsedate(const char *name, long* julian, long *second, boolean* /* year */ p = parse1(p, &y, &n); - if(n != 2 && n != 4) /* year string must be 2 or 4 characters long: 93 or 1993 */ + if (n != 2 && n != 4) /* year string must be 2 or 4 characters long: 93 or 1993 */ return FALSE; - if(*p++ != '-') + if (*p++ != '-') return FALSE; /* month */ p = parse1(p, &m, &n); - if(n == 2) - { + if (n == 2) { /* day */ - if(*p++ != '-') + if (*p++ != '-') return FALSE; p = parse1(p, &d, &n); - if(n != 2) + if (n != 2) return FALSE; } - else if(n == 3) - { + else if (n == 3) { long j = grib_date_to_julian(y * 10000 + 101) + m - 1; - j = grib_julian_to_date(j); + j = grib_julian_to_date(j); /* julian day */; - d = j % 100; - m = (j % 10000) / 100; + d = j % 100; + m = (j % 10000) / 100; *isjul = TRUE; } else @@ -3893,31 +3792,29 @@ static boolean parsedate(const char *name, long* julian, long *second, boolean* return FALSE; /* month out of range */ } - while(*p && isspace(*p)) + while (*p && isspace(*p)) p++; /* hour */ p = parse1(p, &H, &n); - if(n != 0) - { - if(n != 2) + if (n != 0) { + if (n != 2) return FALSE; /* minute */ - if(*p++ != ':') + if (*p++ != ':') return FALSE; p = parse1(p, &M, &n); - if(n != 2) + if (n != 2) return FALSE; - if(*p != 0) - { + if (*p != 0) { /* second */ - if(*p++ != ':') + if (*p++ != ':') return FALSE; p = parse1(p, &S, &n); - if(n != 2) + if (n != 2) return FALSE; } } @@ -3933,16 +3830,20 @@ static boolean check_dimension_name(const char* dim) /* Dimension name must begin with an alphabetic character, followed by zero * or more alphanumeric characters including the underscore */ int i = 0, len = 0; - if (!dim) return FALSE; + if (!dim) + return FALSE; len = strlen(dim); - if (len==0) return FALSE; - if (!isalpha(dim[0])) return FALSE; + if (len == 0) + return FALSE; + if (!isalpha(dim[0])) + return FALSE; - for (i=1; i netCDF classic file format" - "\n\t\t2 -> netCDF 64 bit classic file format (Default)" - "\n\t\t3 -> netCDF-4 file format" - "\n\t\t4 -> netCDF-4 classic model file format\n" - , 0, 1, "2" }, - { "d:", "level", "\n\t\tDeflate data (compression level). Only for netCDF-4 output format." - "\n\t\tPossible values [0,9]. Default None." - "\n\t\tChunking strategy based on GRIB message.\n", 0, 1, "6" }, - { "s", 0, "Shuffle data before deflation compression.\n", 0, 1, 0 }, - { "u:", "dimension", "\n\t\tSet dimension to be an unlimited dimension.\n", 0, 1, "time" } + { "I:", "key1,key2,...", "\n\t\tIgnore keys. Default method,type,stream,refdate,hdate\n", 0, 1, "method,type,stream,refdate,hdate" }, + { "S:", "key1,key2,...", "\n\t\tSplit according to keys. Default param,expver\n", 0, 1, "param,expver" }, + { "R:", "date", "\n\t\tReference date in the format YYYYMMDD. Default value 19000101.\n", 0, 1, "19000101" }, + { "D:", "NC_DATATYPE", + "\n\t\tType of data. Possible values NC_BYTE, NC_SHORT, NC_INT, NC_FLOAT, NC_DOUBLE." + "\n\t\tDefault NC_SHORT\n", + 0, 1, "NC_SHORT" }, + { "T", 0, "Don't use time of validity.\n", 0, 1, 0 }, + { "f", 0, 0, 0, 1, 0 }, + { "o:", "output file", "\n\t\tThe name of the netcdf file.\n", 1, 1, 0 }, + { "V", 0, 0, 0, 1, 0 }, + { "M", 0, 0, 0, 1, 0 }, + { "k:", "kind", + "\n\t\tSpecifies the kind of file to be created. Possible values are:" + "\n\t\t1 -> netCDF classic file format" + "\n\t\t2 -> netCDF 64 bit classic file format (Default)" + "\n\t\t3 -> netCDF-4 file format" + "\n\t\t4 -> netCDF-4 classic model file format\n", + 0, 1, "2" }, + { "d:", "level", + "\n\t\tDeflate data (compression level). Only for netCDF-4 output format." + "\n\t\tPossible values [0,9]. Default None." + "\n\t\tChunking strategy based on GRIB message.\n", + 0, 1, "6" }, + { "s", 0, "Shuffle data before deflation compression.\n", 0, 1, 0 }, + { "u:", "dimension", "\n\t\tSet dimension to be an unlimited dimension.\n", 0, 1, "time" } }; -int grib_options_count = sizeof(grib_options) / sizeof(grib_option); -static fieldset *fs = NULL; -static request* data_r = NULL; -request *user_r = NULL; -static int option_kind = 2; /* By default NetCDF3, 64-bit offset */ +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); +static fieldset* fs = NULL; +static request* data_r = NULL; +request* user_r = NULL; +static int option_kind = 2; /* By default NetCDF3, 64-bit offset */ static int deflate_option = 0; /* Table of formats for legal -k values. Inspired by nccopy */ -struct KindValue { +struct KindValue +{ char* name; int kind; } legalkinds[] = { - {"1", NC_FORMAT_CLASSIC}, - {"classic", NC_FORMAT_CLASSIC}, - - /* The 64-bit offset kind */ - {"2", NC_FORMAT_64BIT}, - {"64-bit-offset", NC_FORMAT_64BIT}, - {"64-bit offset", NC_FORMAT_64BIT}, - - /* NetCDF-4 HDF5 format */ - {"3", NC_FORMAT_NETCDF4}, - {"hdf5", NC_FORMAT_NETCDF4}, - {"netCDF-4", NC_FORMAT_NETCDF4}, - {"netCDF4", NC_FORMAT_NETCDF4}, - {"enhanced", NC_FORMAT_NETCDF4}, - - /* NetCDF-4 HDF5 format, but using only nc3 data model */ - {"4", NC_FORMAT_NETCDF4_CLASSIC}, - {"hdf5-nc3", NC_FORMAT_NETCDF4_CLASSIC}, - {"netCDF-4 classic model", NC_FORMAT_NETCDF4_CLASSIC}, - {"netCDF4_classic", NC_FORMAT_NETCDF4_CLASSIC}, - {"enhanced-nc3", NC_FORMAT_NETCDF4_CLASSIC}, - - /* null terminate*/ - {NULL,0} + { "1", NC_FORMAT_CLASSIC }, + { "classic", NC_FORMAT_CLASSIC }, + + /* The 64-bit offset kind */ + { "2", NC_FORMAT_64BIT }, + { "64-bit-offset", NC_FORMAT_64BIT }, + { "64-bit offset", NC_FORMAT_64BIT }, + + /* NetCDF-4 HDF5 format */ + { "3", NC_FORMAT_NETCDF4 }, + { "hdf5", NC_FORMAT_NETCDF4 }, + { "netCDF-4", NC_FORMAT_NETCDF4 }, + { "netCDF4", NC_FORMAT_NETCDF4 }, + { "enhanced", NC_FORMAT_NETCDF4 }, + + /* NetCDF-4 HDF5 format, but using only nc3 data model */ + { "4", NC_FORMAT_NETCDF4_CLASSIC }, + { "hdf5-nc3", NC_FORMAT_NETCDF4_CLASSIC }, + { "netCDF-4 classic model", NC_FORMAT_NETCDF4_CLASSIC }, + { "netCDF4_classic", NC_FORMAT_NETCDF4_CLASSIC }, + { "enhanced-nc3", NC_FORMAT_NETCDF4_CLASSIC }, + + /* null terminate*/ + { NULL, 0 } }; -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - int i, ret = 0; + int i = 0; /* GRIB-413: Collect all program arguments into a string */ const size_t maxLen = sizeof(argvString); - size_t currLen = 0; - for (i=0; i= maxLen-1 ) break; + if (currLen >= maxLen - 1) + break; strcat(argvString, argv[i]); - if (i != argc-1) strcat(argvString, " "); + if (i != argc - 1) + strcat(argvString, " "); } - ret = grib_tool(argc, argv); - - return ret; + return grib_tool(argc, argv); } int grib_tool_before_getopt(grib_runtime_options* options) @@ -4072,54 +3979,48 @@ int grib_tool_before_getopt(grib_runtime_options* options) int grib_tool_init(grib_runtime_options* options) { - char* p = NULL; - char* list = NULL; - ctx = grib_context_get_default(); + char* p = NULL; + char* list = NULL; + ctx = grib_context_get_default(); options->onlyfiles = 1; - fs = new_fieldset(0); - data_r = empty_request(0); - user_r = empty_request(0); + fs = new_fieldset(0); + data_r = empty_request(0); + user_r = empty_request(0); printf("%s: Version ", grib_tool_name); grib_print_api_version(stdout); printf("\n"); - if(grib_options_on("D:")) - { + if (grib_options_on("D:")) { set_value(user_r, "accuracy", grib_options_get_option("D:")); } - else - { + else { set_value(user_r, "accuracy", "NC_SHORT"); } /* Option -S: Split according to keys */ - if(grib_options_on("S:")) - { + if (grib_options_on("S:")) { list = grib_options_get_option("S:"); - p = strtok(list, ","); + p = strtok(list, ","); set_value(user_r, "split", p); p = strtok(NULL, ","); - while(p != NULL) - { + while (p != NULL) { add_value(user_r, "split", p); p = strtok(NULL, ","); } } - else - { + else { set_value(user_r, "split", "param"); add_value(user_r, "split", "expver"); } /* Option -I: Ignore keys */ - if (grib_options_on("I:")) - { + if (grib_options_on("I:")) { list = grib_options_get_option("I:"); - p = strtok(list, ","); + p = strtok(list, ","); set_value(user_r, "ignore", p); p = strtok(NULL, ","); - while(p != NULL) { + while (p != NULL) { add_value(user_r, "ignore", p); p = strtok(NULL, ","); } @@ -4132,18 +4033,17 @@ int grib_tool_init(grib_runtime_options* options) add_value(user_r, "ignore", "hdate"); } - if(grib_options_on("T")) + if (grib_options_on("T")) set_value(user_r, "usevalidtime", "false"); else set_value(user_r, "usevalidtime", "true"); - if (grib_options_on("k:")) - { + if (grib_options_on("k:")) { struct KindValue* kvalue = NULL; - char* kind_name = grib_options_get_option("k:"); - for (kvalue=legalkinds; kvalue->name; kvalue++) { + char* kind_name = grib_options_get_option("k:"); + for (kvalue = legalkinds; kvalue->name; kvalue++) { if (strcmp(kind_name, kvalue->name) == 0) { - option_kind = kvalue->kind;/* Found the right kind */ + option_kind = kvalue->kind; /* Found the right kind */ break; } } @@ -4154,45 +4054,40 @@ int grib_tool_init(grib_runtime_options* options) } } - if (grib_options_on("d:")) - { + if (grib_options_on("d:")) { if (option_kind == 3 || option_kind == 4) { /* netCDF-4 */ char* theArg = grib_options_get_option("d:"); - if (!is_number(theArg) || atol(theArg)<0 || atol(theArg)>9 ) { + if (!is_number(theArg) || atol(theArg) < 0 || atol(theArg) > 9) { fprintf(stderr, "Invalid deflate option: %s (must be 0 to 9)\n", theArg); usage(); exit(1); } set_value(user_r, "deflate", theArg); - deflate_option=1; - } else { + deflate_option = 1; + } + else { fprintf(stderr, "Invalid deflate option for non netCDF-4 output formats\n"); usage(); exit(1); } } - else - { + else { set_value(user_r, "deflate", "none"); } - if(grib_options_on("s")) - { - if(deflate_option) + if (grib_options_on("s")) { + if (deflate_option) set_value(user_r, "shuffle", "true"); - else - { + else { fprintf(stderr, "Invalid shuffle option. Deflate option needed.\n"); usage(); exit(1); } - } else set_value(user_r, "shuffle", "false"); - if(grib_options_on("R:")) - { + if (grib_options_on("R:")) { char* theArg = grib_options_get_option("R:"); if (!is_number(theArg)) { fprintf(stderr, "Invalid reference date: %s\n", theArg); @@ -4201,14 +4096,13 @@ int grib_tool_init(grib_runtime_options* options) } set_value(user_r, "referencedate", theArg); } - else - { + else { set_value(user_r, "referencedate", "19000101"); } if (grib_options_on("u:")) { char* theDimension = grib_options_get_option("u:"); - if ( !check_dimension_name(theDimension) ) { + if (!check_dimension_name(theDimension)) { fprintf(stderr, "Invalid dimension: \"%s\"\n", theDimension); exit(1); } @@ -4222,66 +4116,62 @@ int grib_tool_init(grib_runtime_options* options) int grib_tool_new_filename_action(grib_runtime_options* options, const char* filename) { - char buf[1024] = { 0, }; - int e = 0; - int i = 0; - grib_handle* h = NULL; + char buf[1024] = {0,}; + int e = 0; + int i = 0; + grib_handle* h = NULL; grib_file* file = NULL; printf("%s: Processing input file '%s'.\n", grib_tool_name, filename); file = grib_file_open(filename, "r", &e); - if(!file || !file->handle) + if (!file || !file->handle) return e; fseeko(file->handle, 0, SEEK_SET); files++; - while((h = grib_handle_new_from_file(ctx, file->handle, &e)) != NULL) - { + while ((h = grib_handle_new_from_file(ctx, file->handle, &e)) != NULL) { long length; field* g; - request *r; + request* r; /* process only GRIB for the moment*/ size_t size = sizeof(buf); Assert(grib_get_string(h, "identifier", buf, &size) == 0); - if(strcmp(buf, "GRIB")) - { + if (strcmp(buf, "GRIB")) { grib_handle_delete(h); continue; } - Assert(grib_get_long(h,"totalLength",&length) == 0); + Assert(grib_get_long(h, "totalLength", &length) == 0); g = read_field(file, h->offset, length); r = empty_request(""); - Assert(handle_to_request(r,h) == 0); + if (handle_to_request(r, h) != GRIB_SUCCESS) { + grib_context_log(ctx, GRIB_LOG_ERROR, "Failed to convert GRIB handle to a request"); + } /* Keep full MARS description */ /* copy = clone_one_request(r); */ /* reqmerge(setup.mars_description,copy); */ /* reqmerge(setup.mars_description,r); */ - if(i == 1) - { - const char *mmeans = get_value(r, "_MONTHLY_MEANS", 0); - setup.mmeans = mmeans ? (atol(mmeans) == 1) : FALSE; + if (i == 1) { + const char* mmeans = get_value(r, "_MONTHLY_MEANS", 0); + setup.mmeans = mmeans ? (atol(mmeans) == 1) : FALSE; } fcmonth2nbmonths(r); - if(!setup.refdate) - { - if(setup.auto_refdate) + if (!setup.refdate) { + if (setup.auto_refdate) setup.refdate = atol(get_value(r, "date", 0)); - else - { - const char *p = get_value(user_r, "referencedate", 0); - if(is_number(p)) + else { + const char* p = get_value(user_r, "referencedate", 0); + if (is_number(p)) setup.refdate = atol(p); - else - { + else { long julian = 0, second = 0; boolean isjul; parsedate(p, &julian, &second, &isjul); @@ -4291,8 +4181,7 @@ int grib_tool_new_filename_action(grib_runtime_options* options, const char* fil } validation_time(r); - if(setup.usevalidtime) - { + if (setup.usevalidtime) { unset_value(r, "date"); unset_value(r, "time"); unset_value(r, "step"); @@ -4316,11 +4205,9 @@ int grib_tool_new_filename_action(grib_runtime_options* options, const char* fil { /* Now do some checks */ request* temp_data_r = fieldset_to_request(fs); - if(setup.checkvalidtime) - { + if (setup.checkvalidtime) { int cnt = request_fields(temp_data_r); - if(fs->count != i || (cnt < i)) - { + if (fs->count != i || (cnt < i)) { grib_context_log(ctx, GRIB_LOG_ERROR, "Wrong number of fields"); grib_context_log(ctx, GRIB_LOG_ERROR, "File contains %d GRIBs, %d left in internal description, %d in request", i, fs->count, cnt); grib_context_log(ctx, GRIB_LOG_ERROR, "The fields are not considered distinct!\n"); @@ -4332,7 +4219,8 @@ int grib_tool_new_filename_action(grib_runtime_options* options, const char* fil } if (grib_options_on("T")) { grib_context_log(ctx, GRIB_LOG_ERROR, "Hint: This may be due to several fields having the same date, time and step."); - } else { + } + else { grib_context_log(ctx, GRIB_LOG_ERROR, "Hint: This may be due to several fields having the same validity time."); grib_context_log(ctx, GRIB_LOG_ERROR, "Try using the -T option (Do not use time of validity)"); } @@ -4352,7 +4240,6 @@ int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* fi int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) { - return 0; } @@ -4367,29 +4254,27 @@ void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) int grib_tool_finalise_action(grib_runtime_options* options) { - request *config_r = NULL; - hypercube *dims = NULL; - dataset_t *subsets = NULL; + request* config_r = NULL; + hypercube* dims = NULL; + dataset_t* subsets = NULL; int count; int i; int ncid; int stat; - int err = 0; + int err = 0; int creation_mode = NC_CLOBBER; - if(options->outfile==NULL || options->outfile->name==NULL) - { + if (options->outfile == NULL || options->outfile->name == NULL) { usage(); exit(1); } - if(fs->count == 0) - { + if (fs->count == 0) { grib_context_log(ctx, GRIB_LOG_ERROR, "Input does not contain any field. Exiting!"); return -1; } - printf("%s: Found %d GRIB field%s in %d file%s.\n", grib_tool_name, fs->count, fs->count>1?"s":"", files, files > 1 ? "s" : ""); + printf("%s: Found %d GRIB field%s in %d file%s.\n", grib_tool_name, fs->count, fs->count > 1 ? "s" : "", files, files > 1 ? "s" : ""); if (ctx->debug) { grib_context_log(ctx, GRIB_LOG_INFO, "Request representing %d fields ", fs->count); @@ -4398,8 +4283,8 @@ int grib_tool_finalise_action(grib_runtime_options* options) /* Split the SOURCE from request into as many datasets as specified */ count = split_fieldset(fs, data_r, &subsets, user_r, config_r); - remove_param(data_r, (void *) user_r, "ignore"); - remove_param(data_r, (void *) user_r, "split"); + remove_param(data_r, (void*)user_r, "ignore"); + remove_param(data_r, (void*)user_r, "split"); print_ignored_keys(stdout, user_r); dims = new_simple_hypercube_from_mars_request(data_r); @@ -4417,7 +4302,7 @@ int grib_tool_finalise_action(grib_runtime_options* options) printf("%s: NetCDF library version: %s\n", grib_tool_name, nc_inq_libvers()); creation_mode = get_creation_mode(option_kind); - stat = nc_create(options->outfile->name, creation_mode, &ncid); + stat = nc_create(options->outfile->name, creation_mode, &ncid); if (stat != NC_NOERR) { char msg[1024]; ecc_snprintf(msg, sizeof(msg), "nc_create: '%s'", options->outfile->name); @@ -4443,16 +4328,13 @@ int grib_tool_finalise_action(grib_runtime_options* options) fill_netcdf_dimensions(dims, fs, ncid); /* Put data values */ - for(i = 0; i < count; ++i) - { - if(subsets[i].fset) - { + for (i = 0; i < count; ++i) { + if (subsets[i].fset) { char dataset[100]; ecc_snprintf(dataset, sizeof(dataset), subsets[i].att.name, i + 1); put_data(dims, ncid, dataset, &subsets[i]); } - else - { + else { grib_context_log(ctx, GRIB_LOG_ERROR, "Fieldset %d is empty!!", i + 1); } } @@ -4473,7 +4355,7 @@ int grib_tool_finalise_action(grib_runtime_options* options) int grib_no_handle_action(grib_runtime_options* options, int err) { - fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\t\t\"ERROR: unreadable message\"\n"); return 0; } diff --git a/tools/grib_tools.c b/tools/grib_tools.c index caf97086e..cf0b23ace 100644 --- a/tools/grib_tools.c +++ b/tools/grib_tools.c @@ -29,285 +29,314 @@ int feenableexcept(int excepts); #endif -GRIB_INLINE static int grib_inline_strcmp(const char* a,const char* b) { - if (*a != *b) return 1; - while((*a!=0 && *b!=0) && *(a) == *(b) ) {a++;b++;} - return (*a==0 && *b==0) ? 0 : 1; +GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b) +{ + if (*a != *b) + return 1; + while ((*a != 0 && *b != 0) && *(a) == *(b)) { + a++; + b++; + } + return (*a == 0 && *b == 0) ? 0 : 1; } -static void grib_print_header(grib_runtime_options* options,grib_handle* h); -static void grib_tools_set_print_keys(grib_runtime_options* options,grib_handle* h,const char* ns); +static void grib_print_header(grib_runtime_options* options, grib_handle* h); +static void grib_tools_set_print_keys(grib_runtime_options* options, grib_handle* h, const char* ns); static int grib_tool_with_orderby(grib_runtime_options* options); static int grib_tool_without_orderby(grib_runtime_options* options); static int grib_tool_onlyfiles(grib_runtime_options* options); static int grib_tool_index(grib_runtime_options* options); -static int process(grib_context* c,grib_runtime_options* options,const char* path); -static int scan(grib_context* c,grib_runtime_options* options,const char* dir); +static int process(grib_context* c, grib_runtime_options* options, const char* path); +static int scan(grib_context* c, grib_runtime_options* options, const char* dir); FILE* dump_file; -static grib_runtime_options global_options={ - 0, /* verbose */ - 0, /* fail */ - 0, /* skip */ - 12, /* default_print_width */ - 0, /* print_header */ - 0, /* name_space */ - 0, /* print_number */ - 1, /* print_statistics */ - {{0,},}, /* grib_values requested_print_keys[MAX_KEYS] */ - 0, /* requested_print_keys_count */ - {{0,},}, /* grib_values print_keys[MAX_KEYS] */ - 0, /* print_keys_count */ - 0, /* strict */ - 0, /* multi_support */ - 0, /* set_values_count */ - {{0,},}, /* grib_values set_values[MAX_KEYS] */ - {{0,},}, /* grib_values constraints[MAX_KEYS] */ - 0, /* constraints_count */ - {{0,},}, /* grib_values compare[MAX_KEYS] */ - 0, /* compare_count */ - 0, /* handle_count */ - 0, /* filter_handle_count */ - 0, /* file_count */ - 0, /* grib_tools_file* infile_extra */ - 0, /* grib_tools_file* current_infile */ - 0, /* grib_tools_file* infile */ - 0, /* grib_tools_file* outfile */ - 0, /* grib_action* action */ - 0, /* grib_rule* rules */ - 0, /* int dump_flags; */ - 0, /* char* dump_mode; */ - 0, /* repack */ - 0, /* error */ - 0, /* gts */ - 0, /* orderby */ - 0, /* latlon */ - {0,}, /* double lats[4] */ - {0,}, /* double lons[4] */ - {0,}, /* double values[4] */ - {0,}, /* double distances[4] */ - {0,}, /* int indexes[4] */ - 4, /* int latlon_mode */ - 0, /* char* latlon_mask */ - -1, /* int latlon_idx */ - {0,}, /* double mask_values[4] */ - 0, /* index */ - 0, /* index_on */ - 0, /* constant */ - 0, /* dump_filename*/ - 0, /* grib_fieldset* idx */ - 0, /* random */ - 0, /* format */ - 0, /* onlyfiles */ - 0, /* tolerance_count */ - 0, /* through_index */ - 0, /* index1 */ - 0, /* index2 */ - 0, /* context */ - 0, /* stop */ - 0, /* mode */ - 0, /* headers_only */ - 0, /* skip_all */ - {{0,},}, /* grib_values tolerance[MAX_KEYS] */ - 0, /* infile_offset */ - 0 /* JSON output */ +static grib_runtime_options global_options = { + 0, /* verbose */ + 0, /* fail */ + 0, /* skip */ + 12, /* default_print_width */ + 0, /* print_header */ + 0, /* name_space */ + 0, /* print_number */ + 1, /* print_statistics */ + {{0,},}, /* grib_values requested_print_keys[MAX_KEYS] */ + 0, /* requested_print_keys_count */ + {{0,},}, /* grib_values print_keys[MAX_KEYS] */ + 0, /* print_keys_count */ + 0, /* strict */ + 0, /* multi_support */ + 0, /* set_values_count */ + {{0,},}, /* grib_values set_values[MAX_KEYS] */ + {{0,},}, /* grib_values constraints[MAX_KEYS] */ + 0, /* constraints_count */ + {{0,},}, /* grib_values compare[MAX_KEYS] */ + 0, /* compare_count */ + 0, /* handle_count */ + 0, /* filter_handle_count */ + 0, /* file_count */ + 0, /* grib_tools_file* infile_extra */ + 0, /* grib_tools_file* current_infile */ + 0, /* grib_tools_file* infile */ + 0, /* grib_tools_file* outfile */ + 0, /* grib_action* action */ + 0, /* grib_rule* rules */ + 0, /* int dump_flags; */ + 0, /* char* dump_mode; */ + 0, /* repack */ + 0, /* error */ + 0, /* gts */ + 0, /* orderby */ + 0, /* latlon */ + {0,}, /* double lats[4] */ + {0,}, /* double lons[4] */ + {0,}, /* double values[4] */ + {0,}, /* double distances[4] */ + {0,}, /* int indexes[4] */ + 4, /* int latlon_mode */ + 0, /* char* latlon_mask */ + -1, /* int latlon_idx */ + {0,}, /* double mask_values[4] */ + 0, /* index */ + 0, /* index_on */ + 0, /* constant */ + 0, /* dump_filename*/ + 0, /* grib_fieldset* idx */ + 0, /* random */ + 0, /* format */ + 0, /* onlyfiles */ + 0, /* tolerance_count */ + 0, /* through_index */ + 0, /* index1 */ + 0, /* index2 */ + 0, /* context */ + 0, /* stop */ + 0, /* mode */ + 0, /* headers_only */ + 0, /* skip_all */ + {{0,},}, /* grib_values tolerance[MAX_KEYS] */ + 0, /* infile_offset */ + 0 /* JSON output */ }; -static grib_handle* grib_handle_new_from_file_x(grib_context* c,FILE* f,int mode,int headers_only,int *err) +static grib_handle* grib_handle_new_from_file_x(grib_context* c, FILE* f, int mode, int headers_only, int* err) { - if (mode==MODE_GRIB) - return grib_new_from_file(c,f,headers_only,err); + if (mode == MODE_GRIB) + return grib_new_from_file(c, f, headers_only, err); - if (mode==MODE_BUFR) - return bufr_new_from_file(c,f,err); + if (mode == MODE_BUFR) + return bufr_new_from_file(c, f, err); - if (mode==MODE_ANY) - return any_new_from_file(c,f,err); + if (mode == MODE_ANY) + return any_new_from_file(c, f, err); - if (mode==MODE_GTS) - return gts_new_from_file(c,f,err); + if (mode == MODE_GTS) + return gts_new_from_file(c, f, err); - if (mode==MODE_METAR) - return metar_new_from_file(c,f,err); + if (mode == MODE_METAR) + return metar_new_from_file(c, f, err); - if (mode==MODE_TAF) - return taf_new_from_file(c,f,err); + if (mode == MODE_TAF) + return taf_new_from_file(c, f, err); Assert(!"grib_handle_new_from_file_x: unknown mode"); return NULL; } -int grib_tool(int argc, char **argv) +int grib_tool(int argc, char** argv) { - int ret=0; - grib_context* c=grib_context_get_default(); - global_options.context=c; + int ret = 0; + int i = 0; + grib_context* c = grib_context_get_default(); + global_options.context = c; #ifdef ENABLE_FLOATING_POINT_EXCEPTIONS feenableexcept(FE_ALL_EXCEPT & ~FE_INEXACT); #endif - if (getenv("DOXYGEN_USAGE") && argc==1 ) usage_doxygen(); + if (getenv("DOXYGEN_USAGE") && argc == 1) + usage_doxygen(); - grib_get_runtime_options(argc,argv,&global_options); + grib_get_runtime_options(argc, argv, &global_options); grib_tool_before_getopt(&global_options); - grib_process_runtime_options(c,argc,argv,&global_options); + grib_process_runtime_options(c, argc, argv, &global_options); grib_tool_init(&global_options); if (global_options.dump_filename) { - dump_file= fopen(global_options.dump_filename,"w"); - if(!dump_file) { + dump_file = fopen(global_options.dump_filename, "w"); + if (!dump_file) { perror(global_options.dump_filename); exit(1); } - } else { - dump_file=stdout; + } + else { + dump_file = stdout; } /* ECC-926: Currently only GRIB indexing works. Disable the through_index if BUFR, GTS etc */ if (global_options.mode == MODE_GRIB && is_grib_index_file(global_options.infile->name) && - ( global_options.infile_extra && is_grib_index_file(global_options.infile_extra->name))) { - global_options.through_index=1; + (global_options.infile_extra && is_grib_index_file(global_options.infile_extra->name))) { + global_options.through_index = 1; return grib_tool_index(&global_options); } if (global_options.onlyfiles) - ret=grib_tool_onlyfiles(&global_options); + ret = grib_tool_onlyfiles(&global_options); else { if (global_options.orderby) - ret=grib_tool_with_orderby(&global_options); + ret = grib_tool_with_orderby(&global_options); else - ret=grib_tool_without_orderby(&global_options); + ret = grib_tool_without_orderby(&global_options); } - if (global_options.dump_filename) fclose(dump_file); + if (global_options.dump_filename) + fclose(dump_file); + + /* Free memory */ + for (i = 0; i < global_options.print_keys_count; i++) { + if (global_options.print_keys[i].name) { + free((char*)global_options.print_keys[i].name); + } + } return ret; } static int grib_tool_with_orderby(grib_runtime_options* options) { - int err=0; - grib_failed *failed=NULL,*p=NULL; - grib_handle* h=NULL; - grib_tools_file* infile=options->infile; + int err = 0; + grib_failed *failed = NULL, *p = NULL; + grib_handle* h = NULL; + grib_tools_file* infile = options->infile; char** filenames; - int files_count=0; - grib_fieldset* set=NULL; - int i=0; - grib_context* c=grib_context_get_default(); - - if(infile) infile->failed=NULL; - - files_count=0; - while(infile) {files_count++;infile=infile->next;} + int files_count = 0; + grib_fieldset* set = NULL; + int i = 0; + grib_context* c = grib_context_get_default(); + + if (infile) + infile->failed = NULL; + + files_count = 0; + while (infile) { + files_count++; + infile = infile->next; + } - filenames=(char**)grib_context_malloc_clear(c,files_count*sizeof(char*)); + filenames = (char**)grib_context_malloc_clear(c, files_count * sizeof(char*)); - infile=options->infile; - for (i=0;iname;infile=infile->next;} + infile = options->infile; + for (i = 0; i < files_count; i++) { + filenames[i] = infile->name; + infile = infile->next; + } - if (grib_options_on("7")) c->no_fail_on_wrong_length=1; + if (grib_options_on("7")) + c->no_fail_on_wrong_length = 1; - set=grib_fieldset_new_from_files(0,filenames,files_count,0,0,0,options->orderby,&err); + set = grib_fieldset_new_from_files(0, filenames, files_count, 0, 0, 0, options->orderby, &err); if (err) { - grib_context_log(c,GRIB_LOG_ERROR,"unable to create index for input file %s (%s)", - filenames[0],grib_get_error_message(err)); + grib_context_log(c, GRIB_LOG_ERROR, "unable to create index for input file %s (%s)", + filenames[0], grib_get_error_message(err)); exit(err); } - options->handle_count=0; - grib_context_set_handle_file_count(c, 0); /* ECC-873 */ + options->handle_count = 0; + grib_context_set_handle_file_count(c, 0); /* ECC-873 */ grib_context_set_handle_total_count(c, 0); /* ECC-873 */ - while(!options->skip_all && ((h = grib_fieldset_next_handle(set,&err)) - != NULL || err != GRIB_SUCCESS )) { + while (!options->skip_all && ((h = grib_fieldset_next_handle(set, &err)) != NULL || err != GRIB_SUCCESS)) { options->handle_count++; - grib_context_set_handle_file_count(c, options->handle_count);/* ECC-873 */ - grib_context_set_handle_total_count(c, options->handle_count);/* ECC-873 */ - options->error=err; + grib_context_set_handle_file_count(c, options->handle_count); /* ECC-873 */ + grib_context_set_handle_total_count(c, options->handle_count); /* ECC-873 */ + options->error = err; if (!h) { grib_no_handle_action(options, err); - failed=(grib_failed*)grib_context_malloc_clear(c,sizeof(grib_failed)); - failed->count=infile->handle_count; - failed->error=err; - failed->next=NULL; + failed = (grib_failed*)grib_context_malloc_clear(c, sizeof(grib_failed)); + failed->count = infile->handle_count; + failed->error = err; + failed->next = NULL; if (!infile->failed) { - infile->failed=failed; - } else { - p=infile->failed; - while (p->next) p=p->next; - p->next=failed; + infile->failed = failed; + } + else { + p = infile->failed; + while (p->next) + p = p->next; + p->next = failed; } continue; } if (options->json_output == 0 || options->latlon) - grib_print_header(options,h); + grib_print_header(options, h); else - grib_tools_set_print_keys(options,h,options->name_space); + grib_tools_set_print_keys(options, h, options->name_space); - grib_skip_check(options,h); + grib_skip_check(options, h); if (options->skip && options->strict) { - grib_tool_skip_handle(options,h); + grib_tool_skip_handle(options, h); continue; } - grib_tool_new_handle_action(options,h); + grib_tool_new_handle_action(options, h); - grib_tool_print_key_values(options,h); + grib_tool_print_key_values(options, h); grib_handle_delete(h); } grib_tool_finalise_action(options); + grib_fieldset_delete(set); + free(filenames); + return 0; } -static char iobuf[1024*1024]; +static char iobuf[1024 * 1024]; static int grib_tool_without_orderby(grib_runtime_options* options) { - int err=0; + int err = 0; /*int nofail=0;*/ - grib_failed *failed=NULL,*p=NULL; - grib_handle* h=NULL; - grib_tools_file* infile=options->infile; - - grib_context* c=grib_context_get_default(); - options->file_count=0; - options->handle_count=0; - options->filter_handle_count=0; - options->current_infile=options->infile; - infile->failed=NULL; - - if (grib_options_on("7")) c->no_fail_on_wrong_length=1; - - while (infile!=NULL && infile->name!=NULL) { - - if (options->print_statistics && options->verbose && !options->json_output) fprintf(dump_file,"%s\n",infile->name); - if (strcmp(infile->name,"-")==0) + grib_failed *failed = NULL, *p = NULL; + grib_handle* h = NULL; + grib_tools_file* infile = options->infile; + + grib_context* c = grib_context_get_default(); + options->file_count = 0; + options->handle_count = 0; + options->filter_handle_count = 0; + options->current_infile = options->infile; + infile->failed = NULL; + + if (grib_options_on("7")) + c->no_fail_on_wrong_length = 1; + + while (infile != NULL && infile->name != NULL) { + if (options->print_statistics && options->verbose && !options->json_output) + fprintf(dump_file, "%s\n", infile->name); + if (strcmp(infile->name, "-") == 0) infile->file = stdin; else - infile->file = fopen(infile->name,"rb"); - if(!infile->file) { + infile->file = fopen(infile->name, "rb"); + if (!infile->file) { perror(infile->name); exit(1); } if (options->infile_offset) { #ifndef ECCODES_ON_WINDOWS /* Check at compile time to ensure our file offset is at least 64 bits */ - COMPILE_TIME_ASSERT( sizeof(options->infile_offset) >= 8 ); + COMPILE_TIME_ASSERT(sizeof(options->infile_offset) >= 8); #endif - err=fseeko(infile->file, options->infile_offset, SEEK_SET); + err = fseeko(infile->file, options->infile_offset, SEEK_SET); if (err) { /*fprintf(stderr, "Invalid file offset: %ld\n", options->infile_offset);*/ perror("Invalid file offset"); @@ -315,72 +344,76 @@ static int grib_tool_without_orderby(grib_runtime_options* options) } } - setvbuf(infile->file,iobuf,_IOFBF,sizeof(iobuf)); + setvbuf(infile->file, iobuf, _IOFBF, sizeof(iobuf)); options->file_count++; - infile->handle_count=0; - infile->filter_handle_count=0; + infile->handle_count = 0; + infile->filter_handle_count = 0; - grib_tool_new_file_action(options,infile); + grib_tool_new_file_action(options, infile); /*nofail=grib_options_on("f");*/ - while(!options->skip_all && ((h = grib_handle_new_from_file_x(c,infile->file,options->mode, - options->headers_only,&err)) - != NULL || err != GRIB_SUCCESS ) ) { + while (!options->skip_all && ((h = grib_handle_new_from_file_x(c, infile->file, options->mode, + options->headers_only, &err)) != NULL || + err != GRIB_SUCCESS)) { infile->handle_count++; options->handle_count++; - options->error=err; + options->error = err; if (!h) { /* fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); */ grib_no_handle_action(options, err); - failed=(grib_failed*)grib_context_malloc_clear(c,sizeof(grib_failed)); - failed->count=infile->handle_count; - failed->error=err; - failed->next=NULL; + failed = (grib_failed*)grib_context_malloc_clear(c, sizeof(grib_failed)); + failed->count = infile->handle_count; + failed->error = err; + failed->next = NULL; if (!infile->failed) { - infile->failed=failed; - } else { - p=infile->failed; - while (p->next) p=p->next; - p->next=failed; + infile->failed = failed; + } + else { + p = infile->failed; + while (p->next) + p = p->next; + p->next = failed; } continue; } if (options->json_output == 0 || options->latlon) - grib_print_header(options,h); + grib_print_header(options, h); else - grib_tools_set_print_keys(options,h,options->name_space); + grib_tools_set_print_keys(options, h, options->name_space); - grib_skip_check(options,h); + grib_skip_check(options, h); if (options->skip && options->strict) { - grib_tool_skip_handle(options,h); + grib_tool_skip_handle(options, h); continue; } - grib_tool_new_handle_action(options,h); + grib_tool_new_handle_action(options, h); - grib_print_key_values(options,h); + grib_print_key_values(options, h); grib_handle_delete(h); } - grib_print_file_statistics(options,infile); + grib_print_file_statistics(options, infile); - if (infile->file) fclose(infile->file); + if (infile->file) + fclose(infile->file); - if (infile->handle_count==0) { - fprintf(dump_file,"no messages found in %s\n", infile->name); - if (options->fail) exit(1); + if (infile->handle_count == 0) { + fprintf(dump_file, "no messages found in %s\n", infile->name); + if (options->fail) + exit(1); } - infile=infile->next; - options->current_infile=infile; + infile = infile->next; + options->current_infile = infile; } grib_print_full_statistics(options); @@ -390,133 +423,136 @@ static int grib_tool_without_orderby(grib_runtime_options* options) return options->error; } -static int navigate(grib_field_tree* fields,grib_runtime_options* options) +static int navigate(grib_field_tree* fields, grib_runtime_options* options) { - int err=0; - int message_type=0; + int err = 0; + int message_type = 0; - if (!fields || options->stop) return 0; + if (!fields || options->stop) + return 0; switch (options->mode) { - case MODE_GRIB: - message_type=CODES_GRIB; - break; - case MODE_BUFR: - message_type=CODES_BUFR; - break; - default : - Assert(0); + case MODE_GRIB: + message_type = CODES_GRIB; + break; + case MODE_BUFR: + message_type = CODES_BUFR; + break; + default: + Assert(0); } if (fields->field) { - grib_handle* h=codes_index_get_handle(fields->field,message_type,&err); + grib_handle* h = codes_index_get_handle(fields->field, message_type, &err); if (!options->index2->current) - options->index2->current=(grib_field_list*)grib_context_malloc_clear(options->context,sizeof(grib_field_list)); - options->index2->current->field=fields->field; - if (!h) return err; - grib_skip_check(options,h); + options->index2->current = (grib_field_list*)grib_context_malloc_clear(options->context, sizeof(grib_field_list)); + options->index2->current->field = fields->field; + if (!h) + return err; + grib_skip_check(options, h); if (options->skip && options->strict) { - grib_tool_skip_handle(options,h); - } else { - grib_tool_new_handle_action(options,h); + grib_tool_skip_handle(options, h); + } + else { + grib_tool_new_handle_action(options, h); grib_handle_delete(h); } } - err=navigate(fields->next_level,options); - if (err) return err; + err = navigate(fields->next_level, options); + if (err) + return err; - err=navigate(fields->next,options); + err = navigate(fields->next, options); return err; } static int grib_tool_index(grib_runtime_options* options) { - int err=0; - char* f1=options->infile->name; - char* f2=options->infile_extra->name; - grib_index_key *k1,*k2; - int found=0; + int err = 0; + char* f1 = options->infile->name; + char* f2 = options->infile_extra->name; + grib_index_key *k1, *k2; + int found = 0; - grib_context* c=grib_context_get_default(); + grib_context* c = grib_context_get_default(); - options->index1=grib_index_read(c,f1,&err); + options->index1 = grib_index_read(c, f1, &err); if (err) - grib_context_log(c,(GRIB_LOG_FATAL) | (GRIB_LOG_PERROR) , - "unable to read index from %s",f1); + grib_context_log(c, (GRIB_LOG_FATAL) | (GRIB_LOG_PERROR), + "unable to read index from %s", f1); - options->index2=grib_index_read(c,f2,&err); + options->index2 = grib_index_read(c, f2, &err); if (err) - grib_context_log(c,(GRIB_LOG_FATAL) | (GRIB_LOG_PERROR) , - "unable to read index from %s",f2); + grib_context_log(c, (GRIB_LOG_FATAL) | (GRIB_LOG_PERROR), + "unable to read index from %s", f2); - k1=options->index1->keys; - while ( k1 ) { - k2=options->index2->keys; - found=0; + k1 = options->index1->keys; + while (k1) { + k2 = options->index2->keys; + found = 0; while (k2) { - if ( !strcmp(k1->name,k2->name) ) { - found=1; + if (!strcmp(k1->name, k2->name)) { + found = 1; break; } - k2=k2->next; + k2 = k2->next; } if (!found) { printf("Indexes contained in the input files have different keys\n"); - printf("keys in file %s:\n",f1); - k1=options->index1->keys; + printf("keys in file %s:\n", f1); + k1 = options->index1->keys; while (k1) { - printf("\t%s\n",k1->name); - k1=k1->next; + printf("\t%s\n", k1->name); + k1 = k1->next; } - printf("keys in file %s:\n",f2); - k2=options->index2->keys; + printf("keys in file %s:\n", f2); + k2 = options->index2->keys; while (k2) { - printf("\t%s\n",k2->name); - k2=k2->next; + printf("\t%s\n", k2->name); + k2 = k2->next; } exit(1); } - k1->value[0]=0; - k1=k1->next; + k1->value[0] = 0; + k1 = k1->next; } - k2=options->index2->keys; - while ( k2 ) { - k1=options->index1->keys; - found=0; + k2 = options->index2->keys; + while (k2) { + k1 = options->index1->keys; + found = 0; while (k1) { - if ( !strcmp(k1->name,k2->name) ) { - found=1; + if (!strcmp(k1->name, k2->name)) { + found = 1; break; } - k1=k1->next; + k1 = k1->next; } if (!found) { printf("Indexes contained in the input files have different keys\n"); - printf("keys in file %s:\n",f2); - k2=options->index2->keys; + printf("keys in file %s:\n", f2); + k2 = options->index2->keys; while (k2) { - printf("\t%s\n",k2->name); - k2=k2->next; + printf("\t%s\n", k2->name); + k2 = k2->next; } - printf("keys in file %s:\n",f1); - k1=options->index1->keys; + printf("keys in file %s:\n", f1); + k1 = options->index1->keys; while (k1) { - printf("\t%s\n",k1->name); - k1=k1->next; + printf("\t%s\n", k1->name); + k1 = k1->next; } exit(1); - } - k2=k2->next; + k2 = k2->next; } - navigate(options->index2->fields,options); + navigate(options->index2->fields, options); grib_tool_finalise_action(options); @@ -524,49 +560,48 @@ static int grib_tool_index(grib_runtime_options* options) } #ifndef ECCODES_ON_WINDOWS -static int scan(grib_context* c,grib_runtime_options* options,const char* dir) +static int scan(grib_context* c, grib_runtime_options* options, const char* dir) { - struct dirent *s; - DIR *d; - int err=0; + struct dirent* s; + DIR* d; + int err = 0; - d= opendir(dir); + d = opendir(dir); if (!d) { - grib_context_log(c,(GRIB_LOG_ERROR) | (GRIB_LOG_PERROR) , "opendir %s",dir); + grib_context_log(c, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), "opendir %s", dir); return GRIB_IO_PROBLEM; } - while ((s=readdir(d)) && (err==0)) { - if(strcmp(s->d_name,".") != 0 && strcmp(s->d_name,"..") != 0) { + while ((s = readdir(d)) && (err == 0)) { + if (strcmp(s->d_name, ".") != 0 && strcmp(s->d_name, "..") != 0) { char buf[1024]; - sprintf(buf,"%s/%s",dir,s->d_name); - process(c,options,buf); + sprintf(buf, "%s/%s", dir, s->d_name); + process(c, options, buf); } } closedir(d); return 0; } #else -static int scan(grib_context* c,grib_runtime_options* options,const char* dir) { +static int scan(grib_context* c, grib_runtime_options* options, const char* dir) +{ struct _finddata_t fileinfo; intptr_t handle; char buffer[1024]; - sprintf(buffer, "%s/*", dir); - if((handle = _findfirst(buffer, &fileinfo)) != -1) - { + sprintf(buffer, "%s/*", dir); + if ((handle = _findfirst(buffer, &fileinfo)) != -1) { do { - if(strcmp(fileinfo.name, ".") != 0 && strcmp(fileinfo.name,"..") != 0) { + if (strcmp(fileinfo.name, ".") != 0 && strcmp(fileinfo.name, "..") != 0) { char buf[1024]; sprintf(buf, "%s/%s", dir, fileinfo.name); process(c, options, buf); } - } while(!_findnext(handle, &fileinfo)); + } while (!_findnext(handle, &fileinfo)); _findclose(handle); } - else - { - grib_context_log(c,(GRIB_LOG_ERROR) | (GRIB_LOG_PERROR) , "opendir %s",dir); + else { + grib_context_log(c, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), "opendir %s", dir); return GRIB_IO_PROBLEM; } return 0; @@ -574,39 +609,40 @@ static int scan(grib_context* c,grib_runtime_options* options,const char* dir) { #endif -static int process(grib_context* c,grib_runtime_options* options,const char* path) { +static int process(grib_context* c, grib_runtime_options* options, const char* path) +{ struct stat s; - int stat_val=0; + int stat_val = 0; #ifndef ECCODES_ON_WINDOWS - stat_val = lstat(path,&s); + stat_val = lstat(path, &s); #else - stat_val = stat(path,&s); + stat_val = stat(path, &s); #endif - if ( stat_val != 0 ) { - grib_context_log(c,(GRIB_LOG_ERROR) | (GRIB_LOG_PERROR),"Cannot stat %s",path); + if (stat_val != 0) { + grib_context_log(c, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), "Cannot stat %s", path); return GRIB_IO_PROBLEM; } if (S_ISDIR(s.st_mode) && !S_ISLNK(s.st_mode)) { - scan(c,options,path); - } else { - grib_tool_new_filename_action(options,path); + scan(c, options, path); + } + else { + grib_tool_new_filename_action(options, path); } return 0; } static int grib_tool_onlyfiles(grib_runtime_options* options) { - grib_context* c=grib_context_get_default(); - grib_tools_file* infile=options->infile; - - while (infile!=NULL && infile->name!=NULL) { + grib_context* c = grib_context_get_default(); + grib_tools_file* infile = options->infile; - process(c,options,infile->name); + while (infile != NULL && infile->name != NULL) { + process(c, options, infile->name); - infile=infile->next; + infile = infile->next; } grib_tool_finalise_action(options); @@ -614,107 +650,111 @@ static int grib_tool_onlyfiles(grib_runtime_options* options) return 0; } -static void grib_print_header(grib_runtime_options* options,grib_handle* h) +static void grib_print_header(grib_runtime_options* options, grib_handle* h) { - size_t strlenkey=0; + size_t strlenkey = 0; int width; int written_to_dump = 0; /* boolean */ if (options->json_output && !options->latlon) return; /* For JSON output we do not print a single header for all msgs */ - if (options->handle_count!=1) + if (options->handle_count != 1) return; - grib_tools_set_print_keys(options,h,options->name_space); + grib_tools_set_print_keys(options, h, options->name_space); if (options->verbose && options->print_header) { - int j=0; - for (j=0;jprint_keys_count;j++) { - strlenkey=strlen(options->print_keys[j].name); - width= strlenkey < options->default_print_width ? - options->default_print_width+2 : strlenkey+2; + int j = 0; + for (j = 0; j < options->print_keys_count; j++) { + strlenkey = strlen(options->print_keys[j].name); + width = strlenkey < options->default_print_width ? options->default_print_width + 2 : strlenkey + 2; if (options->default_print_width < 0) - width=strlenkey+1; + width = strlenkey + 1; - fprintf(dump_file,"%-*s",(int)width,options->print_keys[j].name); + fprintf(dump_file, "%-*s", (int)width, options->print_keys[j].name); written_to_dump = 1; } if (options->latlon) { - if (options->latlon_mode==4) { - fprintf(dump_file," value1 "); - fprintf(dump_file," value2 "); - fprintf(dump_file," value3 "); - fprintf(dump_file," value4 "); - } else { - fprintf(dump_file," value "); + if (options->latlon_mode == 4) { + fprintf(dump_file, " value1 "); + fprintf(dump_file, " value2 "); + fprintf(dump_file, " value3 "); + fprintf(dump_file, " value4 "); + } + else { + fprintf(dump_file, " value "); } written_to_dump = 1; } if (options->index_on) { - fprintf(dump_file," value(%d) ",(int)options->index); + fprintf(dump_file, " value(%d) ", (int)options->index); written_to_dump = 1; } if (written_to_dump) { - fprintf(dump_file,"\n"); + fprintf(dump_file, "\n"); } } } -static int cmpstringp(const void *p1, const void *p2) +static int cmpstringp(const void* p1, const void* p2) { /* The actual arguments to this function are "pointers to pointers to char", but strcmp(3) arguments are "pointers to char", hence the following cast plus dereference */ - return strcmp(* (char * const *) p1, * (char * const *) p2); + return strcmp(*(char* const*)p1, *(char* const*)p2); } static void grib_tools_set_print_keys(grib_runtime_options* options, grib_handle* h, const char* ns) { - int i=0; - grib_keys_iterator* kiter=NULL; + int i = 0; + grib_keys_iterator* kiter = NULL; - options->print_keys_count=0; + options->print_keys_count = 0; - for (i=0;irequested_print_keys_count;i++) { - options->print_keys[options->print_keys_count].name=options->requested_print_keys[i].name; + for (i = 0; i < options->requested_print_keys_count; i++) { + options->print_keys[options->print_keys_count].name = options->requested_print_keys[i].name; if (strlen(options->requested_print_keys[i].name) > options->default_print_width) options->default_print_width = (int)strlen(options->requested_print_keys[i].name); - options->print_keys[options->print_keys_count].type=options->requested_print_keys[i].type; + options->print_keys[options->print_keys_count].type = options->requested_print_keys[i].type; options->print_keys_count++; } if (ns) { - kiter=grib_keys_iterator_new(h,0,ns); + kiter = grib_keys_iterator_new(h, 0, ns); if (!kiter) { - fprintf(dump_file,"ERROR: Unable to create keys iterator\n"); + fprintf(dump_file, "ERROR: Unable to create keys iterator\n"); exit(1); } - while(grib_keys_iterator_next(kiter)) - { + while (grib_keys_iterator_next(kiter)) { const char* name = grib_keys_iterator_get_name(kiter); - if (options->print_keys_count >= MAX_KEYS ) { - fprintf(stderr,"ERROR: keys list too long (more than %d keys)\n", + if (options->print_keys_count >= MAX_KEYS) { + fprintf(stderr, "ERROR: keys list too long (more than %d keys)\n", options->print_keys_count); exit(1); } - options->print_keys[options->print_keys_count].name=strdup(name); - if (strlen(name)>options->default_print_width) - options->default_print_width=(int)strlen(name); - options->print_keys[options->print_keys_count].type=GRIB_TYPE_STRING; + if (options->print_keys[options->print_keys_count].name) { + free((char*)options->print_keys[options->print_keys_count].name); + } + options->print_keys[options->print_keys_count].name = strdup(name); + if (strlen(name) > options->default_print_width) + options->default_print_width = (int)strlen(name); + options->print_keys[options->print_keys_count].type = GRIB_TYPE_STRING; options->print_keys_count++; } grib_keys_iterator_delete(kiter); - if (options->print_keys_count==0 && options->latlon == 0 ) { - int j=0,k=0,ns_count=0; - const char* all_namespace_vals[1024] = {NULL,}; /* sorted array containing all namespaces */ - printf("ERROR: namespace \"%s\" does not contain any key.\n",ns); + if (options->print_keys_count == 0 && options->latlon == 0) { + int j = 0, k = 0, ns_count = 0; + const char* all_namespace_vals[1024] = { + NULL, + }; /* sorted array containing all namespaces */ + printf("ERROR: namespace \"%s\" does not contain any key.\n", ns); printf("Here are the available namespaces in this message:\n"); - for (i=0; iaccessors[i]; if (anAccessor) { - for (j=0; jall_name_spaces[j]; if (a_namespace) { all_namespace_vals[k++] = a_namespace; @@ -724,13 +764,14 @@ static void grib_tools_set_print_keys(grib_runtime_options* options, grib_handle } } qsort(&all_namespace_vals, ns_count, sizeof(char*), cmpstringp); - for(i=0; i0 && strcmp(all_namespace_vals[i], all_namespace_vals[i-1]) == 0) { - print_it = 0; /* skip duplicate entries */ + if (i > 0 && strcmp(all_namespace_vals[i], all_namespace_vals[i - 1]) == 0) { + print_it = 0; /* skip duplicate entries */ } - if (print_it) printf("\t%s\n", all_namespace_vals[i]); + if (print_it) + printf("\t%s\n", all_namespace_vals[i]); } } exit(1); @@ -738,78 +779,79 @@ static void grib_tools_set_print_keys(grib_runtime_options* options, grib_handle } } -static int to_skip(grib_handle* h,grib_values* v,int *err) +static int to_skip(grib_handle* h, grib_values* v, int* err) { - double dvalue=0; - int ret=0; - long lvalue=0; - char value[MAX_STRING_LEN]={0,}; - size_t len=MAX_STRING_LEN; - *err=0; + double dvalue = 0; + int ret = 0; + long lvalue = 0; + char value[MAX_STRING_LEN] = {0,}; + size_t len = MAX_STRING_LEN; + *err = 0; switch (v->type) { - case GRIB_TYPE_STRING: - *err=grib_get_string( h,v->name,value,&len); - ret = v->equal ? grib_inline_strcmp(value,v->string_value) : !grib_inline_strcmp(value,v->string_value); - break; - case GRIB_TYPE_DOUBLE: - *err=grib_get_double( h,v->name,&dvalue); - ret = v->equal ? (dvalue != v->double_value) : (dvalue == v->double_value); - break; - case GRIB_TYPE_LONG: - *err=grib_get_long( h,v->name,&lvalue); - ret = v->equal ? (lvalue != v->long_value) : (lvalue == v->long_value); - break; - case GRIB_TYPE_MISSING: - lvalue=grib_is_missing( h,v->name,err); - ret = (lvalue == v->equal) ? 0 : 1; - break; - default: - fprintf(dump_file,"invalid type for %s\n",v->name); - exit(1); + case GRIB_TYPE_STRING: + *err = grib_get_string(h, v->name, value, &len); + ret = v->equal ? grib_inline_strcmp(value, v->string_value) : !grib_inline_strcmp(value, v->string_value); + break; + case GRIB_TYPE_DOUBLE: + *err = grib_get_double(h, v->name, &dvalue); + ret = v->equal ? (dvalue != v->double_value) : (dvalue == v->double_value); + break; + case GRIB_TYPE_LONG: + *err = grib_get_long(h, v->name, &lvalue); + ret = v->equal ? (lvalue != v->long_value) : (lvalue == v->long_value); + break; + case GRIB_TYPE_MISSING: + lvalue = grib_is_missing(h, v->name, err); + ret = (lvalue == v->equal) ? 0 : 1; + break; + default: + fprintf(dump_file, "invalid type for %s\n", v->name); + exit(1); } return ret; } -void grib_skip_check(grib_runtime_options* options,grib_handle* h) +void grib_skip_check(grib_runtime_options* options, grib_handle* h) { - int i,ret=0; - grib_values* v=NULL; - for (i=0;i < options->constraints_count ;i++) { - v=&(options->constraints[i]); + int i, ret = 0; + grib_values* v = NULL; + for (i = 0; i < options->constraints_count; i++) { + v = &(options->constraints[i]); if (v->equal) { - options->skip=1; + options->skip = 1; while (v) { - if (!to_skip(h,v,&ret)) { - if (!strcmp(v->name,"count") && !v->next) - options->skip_all=1; - options->skip=0; + if (!to_skip(h, v, &ret)) { + if (!strcmp(v->name, "count") && !v->next) + options->skip_all = 1; + options->skip = 0; break; } if (ret != GRIB_SUCCESS && options->fail) { - grib_context_log(h->context,GRIB_LOG_ERROR,"unable to get \"%s\" (%s)", - v->name,grib_get_error_message(ret)); + grib_context_log(h->context, GRIB_LOG_ERROR, "unable to get \"%s\" (%s)", + v->name, grib_get_error_message(ret)); exit(ret); } - v=v->next; + v = v->next; } - } else { - options->skip=0; + } + else { + options->skip = 0; while (v) { - if (to_skip(h,v,&ret)) { - options->skip=1; + if (to_skip(h, v, &ret)) { + options->skip = 1; break; } if (ret != GRIB_SUCCESS && options->fail) { - grib_context_log(h->context,GRIB_LOG_ERROR,"unable to get \"%s\" (%s)", - v->name,grib_get_error_message(ret)); + grib_context_log(h->context, GRIB_LOG_ERROR, "unable to get \"%s\" (%s)", + v->name, grib_get_error_message(ret)); exit(ret); } - v=v->next; + v = v->next; } } - if (options->skip==1) + if (options->skip == 1) break; } @@ -823,15 +865,19 @@ void grib_skip_check(grib_runtime_options* options,grib_handle* h) /* TODO: Does not work for 2.7e+01 */ static int is_valid_JSON_number(const char* input) { - const char *p = input; - size_t len = 0; - int is_float = 0; - if (p == 0 || *p == '\0') return 0; - if (*p == '-') p++; + const char* p = input; + size_t len = 0; + int is_float = 0; + if (p == 0 || *p == '\0') + return 0; + if (*p == '-') + p++; while (*p) { - if (*p == '.') is_float=1; - if (*p != '.' && !isdigit(*p)) return 0; + if (*p == '.') + is_float = 1; + if (*p != '.' && !isdigit(*p)) + return 0; p++; len++; } @@ -840,8 +886,8 @@ static int is_valid_JSON_number(const char* input) * like 000000 or 013329 which are invalid JSON numbers. * In JSON a leading zero must not be followed by another digit */ - if (!is_float && len > 2 && input[0]=='0' && isdigit(input[1])) - return 0; /* Not a valid JSON number */ + if (!is_float && len > 2 && input[0] == '0' && isdigit(input[1])) + return 0; /* Not a valid JSON number */ return 1; } @@ -849,47 +895,47 @@ static void get_value_for_key(grib_handle* h, const char* key_name, int key_type { int ret = 0, type = key_type; double dvalue = 0; - long lvalue = 0; - size_t len=MAX_STRING_LEN; + long lvalue = 0; + size_t len = MAX_STRING_LEN; - if (grib_is_missing(h, key_name, &ret) && ret==GRIB_SUCCESS) { - sprintf(value_str,"MISSING"); + if (grib_is_missing(h, key_name, &ret) && ret == GRIB_SUCCESS) { + sprintf(value_str, "MISSING"); return; } if (ret == GRIB_NOT_FOUND) { - sprintf(value_str,"not_found"); + sprintf(value_str, "not_found"); return; } if (type == GRIB_TYPE_UNDEFINED) { - ret=grib_get_native_type(h, key_name, &type); - if(ret!=GRIB_SUCCESS) { - fprintf(dump_file,"Could not determine type for %s\n", key_name); + ret = grib_get_native_type(h, key_name, &type); + if (ret != GRIB_SUCCESS) { + fprintf(dump_file, "Could not determine type for %s\n", key_name); exit(1); } } if (type == GRIB_TYPE_STRING) { - ret=grib_get_string(h, key_name, value_str, &len); + ret = grib_get_string(h, key_name, value_str, &len); } else if (type == GRIB_TYPE_DOUBLE) { - ret=grib_get_double( h, key_name, &dvalue); + ret = grib_get_double(h, key_name, &dvalue); sprintf(value_str, format, dvalue); } else if (type == GRIB_TYPE_LONG) { - ret=grib_get_long( h, key_name, &lvalue); - sprintf(value_str,"%ld", lvalue); + ret = grib_get_long(h, key_name, &lvalue); + sprintf(value_str, "%ld", lvalue); } else if (type == GRIB_TYPE_BYTES) { - ret=grib_get_string(h, key_name, value_str, &len); + ret = grib_get_string(h, key_name, value_str, &len); } else { - fprintf(dump_file,"invalid format option for %s\n", key_name); + fprintf(dump_file, "invalid format option for %s\n", key_name); exit(1); } if (ret != GRIB_SUCCESS) { - fprintf(dump_file,"Failed to get value for key %s\n", key_name); + fprintf(dump_file, "Failed to get value for key %s\n", key_name); exit(1); } } @@ -898,7 +944,7 @@ static void get_value_for_key(grib_handle* h, const char* key_name, int key_type static int fix_for_lsdate_needed(grib_handle* h) { long lsdate_bug = 0; - int err = grib_get_long(h, "lsdate_bug", &lsdate_bug); + int err = grib_get_long(h, "lsdate_bug", &lsdate_bug); if (!err && lsdate_bug == 1) { return 1; } @@ -908,42 +954,51 @@ static int fix_for_lsdate_needed(grib_handle* h) static int get_initial_element_of_array(grib_handle* h, const char* keyName, size_t num_vals, char* value) { int err = 0, type = 0; - size_t len = num_vals; - char* sval = NULL; - unsigned char *uval = NULL; - long *lval = NULL; - double* dval = NULL; - grib_context* c = h->context; + size_t len = num_vals; + char* sval = NULL; + unsigned char* uval = NULL; + long* lval = NULL; + double* dval = NULL; + grib_context* c = h->context; Assert(num_vals > 1); /* This is for array keys */ - if ((err = grib_get_native_type(h,keyName,&type))!=GRIB_SUCCESS) return err; - switch(type) { + if ((err = grib_get_native_type(h, keyName, &type)) != GRIB_SUCCESS) + return err; + switch (type) { case GRIB_TYPE_STRING: - grib_get_string_length(h,keyName,&len); - sval = (char*)grib_context_malloc(c,len*sizeof(char)); - if (!sval) return GRIB_OUT_OF_MEMORY; - if((err = grib_get_string(h,keyName,sval,&len)) != GRIB_SUCCESS) return err; + grib_get_string_length(h, keyName, &len); + sval = (char*)grib_context_malloc(c, len * sizeof(char)); + if (!sval) + return GRIB_OUT_OF_MEMORY; + if ((err = grib_get_string(h, keyName, sval, &len)) != GRIB_SUCCESS) + return err; sprintf(value, "%s", sval); free(sval); break; case GRIB_TYPE_LONG: - lval = (long*)grib_context_malloc(c,num_vals*sizeof(long)); - if (!lval) return GRIB_OUT_OF_MEMORY; - if((err = grib_get_long_array(h,keyName,lval,&len)) != GRIB_SUCCESS) return err; + lval = (long*)grib_context_malloc(c, num_vals * sizeof(long)); + if (!lval) + return GRIB_OUT_OF_MEMORY; + if ((err = grib_get_long_array(h, keyName, lval, &len)) != GRIB_SUCCESS) + return err; sprintf(value, "%ld...", lval[0]); free(lval); break; case GRIB_TYPE_DOUBLE: - dval = (double*)grib_context_malloc(c,num_vals*sizeof(double)); - if (!dval) return GRIB_OUT_OF_MEMORY; - if((err = grib_get_double_array(h,keyName,dval,&len)) != GRIB_SUCCESS) return err; + dval = (double*)grib_context_malloc(c, num_vals * sizeof(double)); + if (!dval) + return GRIB_OUT_OF_MEMORY; + if ((err = grib_get_double_array(h, keyName, dval, &len)) != GRIB_SUCCESS) + return err; sprintf(value, "%g...", dval[0]); free(dval); break; case GRIB_TYPE_BYTES: - uval = (unsigned char*)grib_context_malloc(c,num_vals*sizeof(unsigned char)); - if (!uval) return GRIB_OUT_OF_MEMORY; - if((err = grib_get_bytes(h,keyName,uval,&len)) != GRIB_SUCCESS) return err; + uval = (unsigned char*)grib_context_malloc(c, num_vals * sizeof(unsigned char)); + if (!uval) + return GRIB_OUT_OF_MEMORY; + if ((err = grib_get_bytes(h, keyName, uval, &len)) != GRIB_SUCCESS) + return err; sprintf(value, "%d...", (short)uval[0]); free(uval); break; @@ -955,214 +1010,223 @@ static int get_initial_element_of_array(grib_handle* h, const char* keyName, siz void grib_print_key_values(grib_runtime_options* options, grib_handle* h) { - int i=0; - int ret=0,width=0; - int strlenvalue=0; - double dvalue=0; - long lvalue=0; + int i = 0; + int ret = 0, width = 0; + int strlenvalue = 0; + double dvalue = 0; + long lvalue = 0; char value[MAX_STRING_LEN]; - const char* notfound="not_found"; - int written_to_dump = 0; /* boolean */ - grib_accessor* acc = NULL; - size_t num_vals = 0; - int fix_lsdate = 0; + const char* notfound = "not_found"; + int written_to_dump = 0; /* boolean */ + grib_accessor* acc = NULL; + size_t num_vals = 0; + int fix_lsdate = 0; - if (!options->verbose) return; + if (!options->verbose) + return; if (options->json_output && !options->latlon) { /* fprintf(dump_file, "\"message %d\" : {\n", options->handle_count); */ fprintf(dump_file, " {\n"); - for (i=0;iprint_keys_count;i++) { - fprintf(dump_file," \"%s\": ", options->print_keys[i].name); + for (i = 0; i < options->print_keys_count; i++) { + fprintf(dump_file, " \"%s\": ", options->print_keys[i].name); get_value_for_key(h, options->print_keys[i].name, options->print_keys[i].type, value, options->format); if (is_valid_JSON_number(value)) - fprintf(dump_file,"%s", value); + fprintf(dump_file, "%s", value); else - fprintf(dump_file,"\"%s\"", value); - if (i != options->print_keys_count-1) - fprintf(dump_file,",\n"); + fprintf(dump_file, "\"%s\"", value); + if (i != options->print_keys_count - 1) + fprintf(dump_file, ",\n"); else - fprintf(dump_file,"\n"); + fprintf(dump_file, "\n"); } fprintf(dump_file, " }"); return; } - fix_lsdate = (fix_for_lsdate_needed(h) && options->name_space && strcmp(options->name_space,"ls")==0); + fix_lsdate = (fix_for_lsdate_needed(h) && options->name_space && strcmp(options->name_space, "ls") == 0); - for (i=0;iprint_keys_count;i++) { - size_t len=MAX_STRING_LEN; - ret=GRIB_SUCCESS; + for (i = 0; i < options->print_keys_count; i++) { + size_t len = MAX_STRING_LEN; + ret = GRIB_SUCCESS; if (h->product_kind == PRODUCT_BUFR) { /* ECC-236: Do not use grib_is_missing for BUFR */ - if (!grib_is_defined(h, options->print_keys[i].name)) ret = GRIB_NOT_FOUND; + if (!grib_is_defined(h, options->print_keys[i].name)) + ret = GRIB_NOT_FOUND; if (ret == GRIB_SUCCESS) { if (options->print_keys[i].type == GRIB_TYPE_UNDEFINED) grib_get_native_type(h, options->print_keys[i].name, &(options->print_keys[i].type)); switch (options->print_keys[i].type) { - case GRIB_TYPE_STRING: - acc = grib_find_accessor(h, options->print_keys[i].name); - ret=grib_get_string(h, options->print_keys[i].name, value, &len); - if (grib_is_missing_string(acc, (unsigned char *)value, len)) - sprintf(value,"MISSING"); - break; - case GRIB_TYPE_DOUBLE: - ret=grib_get_double(h, options->print_keys[i].name, &dvalue); - if (dvalue == GRIB_MISSING_DOUBLE) sprintf(value,"MISSING"); - else sprintf(value,options->format,dvalue); - break; - case GRIB_TYPE_LONG: - ret=grib_get_long(h, options->print_keys[i].name, &lvalue); - if (lvalue == GRIB_MISSING_LONG) sprintf(value,"MISSING"); - else sprintf(value,"%ld", lvalue); - break; - case GRIB_TYPE_BYTES: - ret=grib_get_string(h, options->print_keys[i].name, value, &len); - break; - default: - fprintf(dump_file,"Could not determine type for %s\n", options->print_keys[i].name); - exit(1); + case GRIB_TYPE_STRING: + acc = grib_find_accessor(h, options->print_keys[i].name); + ret = grib_get_string(h, options->print_keys[i].name, value, &len); + if (grib_is_missing_string(acc, (unsigned char*)value, len)) + sprintf(value, "MISSING"); + break; + case GRIB_TYPE_DOUBLE: + ret = grib_get_double(h, options->print_keys[i].name, &dvalue); + if (dvalue == GRIB_MISSING_DOUBLE) + sprintf(value, "MISSING"); + else + sprintf(value, options->format, dvalue); + break; + case GRIB_TYPE_LONG: + ret = grib_get_long(h, options->print_keys[i].name, &lvalue); + if (lvalue == GRIB_MISSING_LONG) + sprintf(value, "MISSING"); + else + sprintf(value, "%ld", lvalue); + break; + case GRIB_TYPE_BYTES: + ret = grib_get_string(h, options->print_keys[i].name, value, &len); + break; + default: + fprintf(dump_file, "Could not determine type for %s\n", options->print_keys[i].name); + exit(1); } } - } else { + } + else { /* Other products e.g. GRIB */ - if (grib_is_missing(h,options->print_keys[i].name,&ret) && ret==GRIB_SUCCESS) { - sprintf(value,"MISSING"); + if (grib_is_missing(h, options->print_keys[i].name, &ret) && ret == GRIB_SUCCESS) { + sprintf(value, "MISSING"); } - else if ( ret == GRIB_SUCCESS ) { + else if (ret == GRIB_SUCCESS) { const char* pName = NULL; if (options->print_keys[i].type == GRIB_TYPE_UNDEFINED) - grib_get_native_type(h,options->print_keys[i].name,&(options->print_keys[i].type)); + grib_get_native_type(h, options->print_keys[i].name, &(options->print_keys[i].type)); switch (options->print_keys[i].type) { - case GRIB_TYPE_STRING: - pName = options->print_keys[i].name; - if (fix_lsdate && strcmp(pName, "date")==0) { /* ECC-707 */ - pName = "ls.date"; - } - ret = grib_get_size(h, pName, &num_vals); - if(ret==GRIB_SUCCESS && num_vals>1) { /* See ECC-278 */ - ret = get_initial_element_of_array(h, pName, num_vals, value); - } else { - ret=grib_get_string( h,pName,value,&len); - } - break; - case GRIB_TYPE_DOUBLE: - ret=grib_get_double( h,options->print_keys[i].name,&dvalue); - sprintf(value,options->format,dvalue); - break; - case GRIB_TYPE_LONG: - ret=grib_get_long( h,options->print_keys[i].name,&lvalue); - sprintf(value,"%ld", lvalue); - break; - case GRIB_TYPE_BYTES: - ret=grib_get_string( h,options->print_keys[i].name,value,&len); - break; - default: - fprintf(dump_file,"invalid format option for %s\n",options->print_keys[i].name); - exit(1); + case GRIB_TYPE_STRING: + pName = options->print_keys[i].name; + if (fix_lsdate && strcmp(pName, "date") == 0) { /* ECC-707 */ + pName = "ls.date"; + } + ret = grib_get_size(h, pName, &num_vals); + if (ret == GRIB_SUCCESS && num_vals > 1) { /* See ECC-278 */ + ret = get_initial_element_of_array(h, pName, num_vals, value); + } + else { + ret = grib_get_string(h, pName, value, &len); + } + break; + case GRIB_TYPE_DOUBLE: + ret = grib_get_double(h, options->print_keys[i].name, &dvalue); + sprintf(value, options->format, dvalue); + break; + case GRIB_TYPE_LONG: + ret = grib_get_long(h, options->print_keys[i].name, &lvalue); + sprintf(value, "%ld", lvalue); + break; + case GRIB_TYPE_BYTES: + ret = grib_get_string(h, options->print_keys[i].name, value, &len); + break; + default: + fprintf(dump_file, "invalid format option for %s\n", options->print_keys[i].name); + exit(1); } } } if (ret != GRIB_SUCCESS) { - if (options->fail) GRIB_CHECK_NOLINE(ret,options->print_keys[i].name); - if (ret == GRIB_NOT_FOUND) strcpy(value,notfound); + if (options->fail) + GRIB_CHECK_NOLINE(ret, options->print_keys[i].name); + if (ret == GRIB_NOT_FOUND) + strcpy(value, notfound); else { - fprintf(dump_file,"%s %s\n",grib_get_error_message(ret),options->print_keys[i].name); + fprintf(dump_file, "%s %s\n", grib_get_error_message(ret), options->print_keys[i].name); exit(ret); } } strlenvalue = (int)strlen(value); - width = strlenvalue < options->default_print_width ? - options->default_print_width + 2 : - strlenvalue + 2; + width = strlenvalue < options->default_print_width ? options->default_print_width + 2 : strlenvalue + 2; - if (options->default_print_width < 0) width = strlenvalue + 1; + if (options->default_print_width < 0) + width = strlenvalue + 1; - if (options->print_keys_count==i+1 && options->latlon==0) width--; + if (options->print_keys_count == i + 1 && options->latlon == 0) + width--; - fprintf(dump_file,"%-*s",(int)width,value); + fprintf(dump_file, "%-*s", (int)width, value); written_to_dump = 1; } if (options->latlon) { - - if (options->latlon_mode==4){ - int ii=0; - for (ii=0;ii<4;ii++) { - fprintf(dump_file,options->format,options->values[ii]); - fprintf(dump_file," "); + if (options->latlon_mode == 4) { + int ii = 0; + for (ii = 0; ii < 4; ii++) { + fprintf(dump_file, options->format, options->values[ii]); + fprintf(dump_file, " "); } - written_to_dump=1; - } else if (options->latlon_mode==1) { - sprintf(value,options->format,options->values[options->latlon_idx]); + written_to_dump = 1; + } + else if (options->latlon_mode == 1) { + sprintf(value, options->format, options->values[options->latlon_idx]); strlenvalue = (int)strlen(value); - width = strlenvalue < options->default_print_width ? - options->default_print_width + 2 : - strlenvalue + 2; - fprintf(dump_file,"%-*s",(int)width,value); - written_to_dump=1; + width = strlenvalue < options->default_print_width ? options->default_print_width + 2 : strlenvalue + 2; + fprintf(dump_file, "%-*s", (int)width, value); + written_to_dump = 1; } } if (options->index_on) { - double v=0; + double v = 0; /*if (grib_get_double_element(h,"values",options->index,&v) != GRIB_SUCCESS) {*/ if (1) { size_t size, the_index = 0; double* values; - int err=0; + int err = 0; - err=grib_get_size(h,"values",&size); + err = grib_get_size(h, "values", &size); if (err) { - sprintf(value,"unknown"); - if (!options->fail) exit(err); + sprintf(value, "unknown"); + if (!options->fail) + exit(err); return; } - values=(double*)grib_context_malloc_clear(h->context,size*sizeof(double)); - grib_get_double_array(h,"values",values,&size); + values = (double*)grib_context_malloc_clear(h->context, size * sizeof(double)); + grib_get_double_array(h, "values", values, &size); the_index = options->index; if (the_index >= size) { - fprintf(dump_file,"\n"); + fprintf(dump_file, "\n"); fprintf(stderr, "invalid index value %d (should be between 0 and %d)\n", - options->index, (int)(size-1)); + options->index, (int)(size - 1)); exit(1); } - v=values[options->index]; - grib_context_free(h->context,values); + v = values[options->index]; + grib_context_free(h->context, values); } - sprintf(value,options->format,v); + sprintf(value, options->format, v); strlenvalue = (int)strlen(value); - width = strlenvalue < options->default_print_width ? - options->default_print_width + 2 : - strlenvalue + 2; - fprintf(dump_file,"%-*s",(int)width,value); - written_to_dump=1; + width = strlenvalue < options->default_print_width ? options->default_print_width + 2 : strlenvalue + 2; + fprintf(dump_file, "%-*s", (int)width, value); + written_to_dump = 1; } if (written_to_dump) { - fprintf(dump_file,"\n"); + fprintf(dump_file, "\n"); } } -void grib_print_file_statistics(grib_runtime_options* options,grib_tools_file* file) +void grib_print_file_statistics(grib_runtime_options* options, grib_tools_file* file) { - grib_failed* failed=NULL; + grib_failed* failed = NULL; Assert(file); if (options->json_output && !options->latlon) return; - failed=file->failed; + failed = file->failed; - if (!options->print_statistics || !options->verbose) return; + if (!options->print_statistics || !options->verbose) + return; - fprintf(dump_file,"%d of %d messages in %s\n\n", + fprintf(dump_file, "%d of %d messages in %s\n\n", file->filter_handle_count, file->handle_count, file->name); - if (!failed) return; + if (!failed) + return; /* fprintf(dump_file,"Following bad messages found in %s\n", file->name); @@ -1182,24 +1246,24 @@ void grib_print_full_statistics(grib_runtime_options* options) if (options->json_output && !options->latlon) return; if (options->print_statistics && options->verbose) - fprintf(dump_file,"%d of %d total messages in %d files\n", - options->filter_handle_count,options->handle_count,options->file_count); + fprintf(dump_file, "%d of %d total messages in %d files\n", + options->filter_handle_count, options->handle_count, options->file_count); } void grib_tools_write_message(grib_runtime_options* options, grib_handle* h) { - const void *buffer; + const void* buffer; size_t size; - grib_file* of = NULL; - int err = 0; - char filename[1024] = { 0, }; - Assert(options->outfile!=NULL && options->outfile->name!=NULL); + grib_file* of = NULL; + int err = 0; + char filename[1024] = {0,}; + Assert(options->outfile != NULL && options->outfile->name != NULL); if (options->error == GRIB_WRONG_LENGTH) return; if ((err = grib_get_message(h, &buffer, &size)) != GRIB_SUCCESS) { - grib_context_log(h->context, GRIB_LOG_ERROR,"unable to get binary message\n"); + grib_context_log(h->context, GRIB_LOG_ERROR, "unable to get binary message\n"); exit(err); } @@ -1209,21 +1273,21 @@ void grib_tools_write_message(grib_runtime_options* options, grib_handle* h) if (!of || !of->handle) { grib_context_log(h->context, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), - "unable to open file %s\n", filename); + "unable to open file %s\n", filename); exit(GRIB_IO_PROBLEM); } if (options->gts && h->gts_header) { if (fwrite(h->gts_header, 1, h->gts_header_len, of->handle) != h->gts_header_len) { grib_context_log(h->context, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), - "Error writing GTS header to %s", filename); + "Error writing GTS header to %s", filename); exit(GRIB_IO_PROBLEM); } } if (fwrite(buffer, 1, size, of->handle) != size) { grib_context_log(h->context, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), - "Error writing to %s", filename); + "Error writing to %s", filename); exit(GRIB_IO_PROBLEM); } @@ -1231,7 +1295,7 @@ void grib_tools_write_message(grib_runtime_options* options, grib_handle* h) char gts_trailer[4] = { '\x0D', '\x0D', '\x0A', '\x03' }; if (fwrite(gts_trailer, 1, 4, of->handle) != 4) { grib_context_log(h->context, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), - "Error writing GTS trailer to %s", filename); + "Error writing GTS trailer to %s", filename); exit(GRIB_IO_PROBLEM); } } @@ -1239,7 +1303,7 @@ void grib_tools_write_message(grib_runtime_options* options, grib_handle* h) grib_file_close(filename, 0, &err); if (err != GRIB_SUCCESS) { - grib_context_log(h->context, GRIB_LOG_ERROR,"unable to write message\n"); + grib_context_log(h->context, GRIB_LOG_ERROR, "unable to write message\n"); exit(err); } @@ -1268,11 +1332,10 @@ void grib_tools_write_message(grib_runtime_options* options, grib_handle* h) fwrite(gts_trailer,1,4,options->outfile->file); } #endif - } int exit_if_input_is_directory(const char* tool_name, const char* filename) { - if ( path_is_directory(filename) ) { + if (path_is_directory(filename)) { fprintf(stderr, "%s: ERROR: \"%s\": Is a directory\n", tool_name, filename); exit(1); } diff --git a/tools/gts_compare.c b/tools/gts_compare.c index 0d3cbc429..689f81c14 100644 --- a/tools/gts_compare.c +++ b/tools/gts_compare.c @@ -10,17 +10,22 @@ #include "grib_tools.h" -GRIB_INLINE static int grib_inline_strcmp(const char* a,const char* b) +GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b) { - if (*a != *b) return 1; - while((*a!=0 && *b!=0) && *(a) == *(b) ) {a++;b++;} - return (*a==0 && *b==0) ? 0 : 1; + if (*a != *b) + return 1; + while ((*a != 0 && *b != 0) && *(a) == *(b)) { + a++; + b++; + } + return (*a == 0 && *b == 0) ? 0 : 1; } -typedef double (*compare_double_proc) (double*,double*,double*); +typedef double (*compare_double_proc)(double*, double*, double*); typedef struct grib_error grib_error; -struct grib_error { +struct grib_error +{ char* key; int count; grib_error* next; @@ -29,115 +34,117 @@ struct grib_error { grib_error* error_summary; compare_double_proc compare_double; -grib_string_list* blacklist=0; - -static int compare_handles(grib_handle* h1,grib_handle* h2,grib_runtime_options* options); -static int compare_values(grib_runtime_options* options,grib_handle* h1,grib_handle *h2,const char *name,int type); -int error=0; -int count=0; -int lastPrint=0; -int force=0; +grib_string_list* blacklist = 0; + +static int compare_handles(grib_handle* h1, grib_handle* h2, grib_runtime_options* options); +static int compare_values(grib_runtime_options* options, grib_handle* h1, grib_handle* h2, const char* name, int type); +int error = 0; +int count = 0; +int lastPrint = 0; +int force = 0; double maxAbsoluteError = 1e-19; -int onlyListed=1; -int headerMode=0; -int morein1=0; -int morein2=0; +int onlyListed = 1; +int headerMode = 0; +int morein1 = 0; +int morein2 = 0; int listFromCommandLine; -int verbose=0; -int tolerance_factor=1; -static int write_error=0; +int verbose = 0; +int tolerance_factor = 1; +static int write_error = 0; -static int write_count=0; +static int write_count = 0; -static void write_message(grib_handle* h,const char* str) +static void write_message(grib_handle* h, const char* str) { - const void *m; size_t s; - char fname[1024]={0,}; - FILE* fh=NULL; - - grib_get_message(h,&m,&s); - sprintf(fname,"%s_%d.gts",str,write_count); - - fh= fopen(fname,"w"); - if(!fh) { - grib_context_log(h->context,(GRIB_LOG_ERROR)|(GRIB_LOG_PERROR), - "Error opening %s",fname); + const void* m; + size_t s; + char fname[1024] = {0,}; + FILE* fh = NULL; + + grib_get_message(h, &m, &s); + sprintf(fname, "%s_%d.gts", str, write_count); + + fh = fopen(fname, "w"); + if (!fh) { + grib_context_log(h->context, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), + "Error opening %s", fname); exit(GRIB_IO_PROBLEM); } - if(fwrite(m,1,s,fh) != s) { - grib_context_log(h->context,(GRIB_LOG_ERROR)|(GRIB_LOG_PERROR), - "Error writing to %s",fname); + if (fwrite(m, 1, s, fh) != s) { + grib_context_log(h->context, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), + "Error writing to %s", fname); exit(GRIB_IO_PROBLEM); } fclose(fh); } -static void write_messages(grib_handle* h1,grib_handle* h2) +static void write_messages(grib_handle* h1, grib_handle* h2) { - if (!write_error) return; + if (!write_error) + return; write_count++; - write_message(h1,"error1"); - write_message(h2,"error2"); + write_message(h1, "error1"); + write_message(h2, "error2"); } static int blacklisted(const char* name) { - grib_string_list* b=blacklist; + grib_string_list* b = blacklist; while (b) { Assert(b->value); - if (!strcmp(name,b->value)) + if (!strcmp(name, b->value)) return 1; - b=b->next; + b = b->next; } return 0; } -grib_option grib_options[]={ - /* {id, args, help}, on, command_line, value*/ - /*{"r",0,"Compare files in which the messages are not in the same order. This option is time expensive.\n",0,1,0},*/ - {"b:",0,0,0,1,0}, - {"d",0,"Write different messages on files\n",0,1,0}, - {"T:",0,0,1,0,"T"}, /* GTS */ - {"c:",0,0,0,1,0}, - {"S:","start","First field to be processed.\n",0,1,0}, - {"E:","end","Last field to be processed.\n",0,1,0}, - {"a",0,"-c option modifier. The keys listed with the option -c will be added to the list of keys compared without -c.\n" - ,0,1,0}, - /*{"H",0,"Compare only message headers. Bit-by-bit compare on. Incompatible with -c option.\n",0,1,0},*/ - /*{"R:",0,0,0,1,0},*/ - /*{"A:",0,0,0,1,0},*/ - {"w:",0,0,0,1,0}, - {"f",0,0,0,1,0}, - {"F",0,0,1,0,0}, - {"q",0,0,1,0,0}, - {"I",0,0,1,0,0}, - {"V",0,0,0,1,0}, - {"7",0,0,0,1,0}, - {"v",0,0,0,1,0} +grib_option grib_options[] = { + /* {id, args, help}, on, command_line, value*/ + /*{"r",0,"Compare files in which the messages are not in the same order. This option is time expensive.\n",0,1,0},*/ + { "b:", 0, 0, 0, 1, 0 }, + { "d", 0, "Write different messages on files\n", 0, 1, 0 }, + { "T:", 0, 0, 1, 0, "T" }, /* GTS */ + { "c:", 0, 0, 0, 1, 0 }, + { "S:", "start", "First field to be processed.\n", 0, 1, 0 }, + { "E:", "end", "Last field to be processed.\n", 0, 1, 0 }, + { "a", 0, "-c option modifier. The keys listed with the option -c will be added to the list of keys compared without -c.\n", 0, 1, 0 }, + /*{"H",0,"Compare only message headers. Bit-by-bit compare on. Incompatible with -c option.\n",0,1,0},*/ + /*{"R:",0,0,0,1,0},*/ + /*{"A:",0,0,0,1,0},*/ + { "w:", 0, 0, 0, 1, 0 }, + { "f", 0, 0, 0, 1, 0 }, + { "F", 0, 0, 1, 0, 0 }, + { "q", 0, 0, 1, 0, 0 }, + { "I", 0, 0, 1, 0, 0 }, + { "V", 0, 0, 0, 1, 0 }, + { "7", 0, 0, 0, 1, 0 }, + { "v", 0, 0, 0, 1, 0 } }; -grib_handle* global_handle=NULL; -int counter=0; -int start=-1; -int end=-1; +grib_handle* global_handle = NULL; +int counter = 0; +int start = -1; +int end = -1; -const char* grib_tool_description= - "Compare GTS messages contained in two files." - "\n\tIf some differences are found it fails returning an error code." - "\n\tDefault behaviour: bit-by-bit compare, same order in files."; +const char* grib_tool_description = + "Compare GTS messages contained in two files." + "\n\tIf some differences are found it fails returning an error code." + "\n\tDefault behaviour: bit-by-bit compare, same order in files."; -const char* grib_tool_name="gts_compare"; -const char* grib_tool_usage="[options] " - "file file"; +const char* grib_tool_name = "gts_compare"; +const char* grib_tool_usage = + "[options] " + "file file"; -int grib_options_count=sizeof(grib_options)/sizeof(grib_option); +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - return grib_tool(argc,argv); + return grib_tool(argc, argv); } int grib_tool_before_getopt(grib_runtime_options* options) @@ -147,35 +154,43 @@ int grib_tool_before_getopt(grib_runtime_options* options) int grib_tool_init(grib_runtime_options* options) { - int ret=0; - int nfiles=1; - char orderby[]="md5Headers"; - grib_context* context=grib_context_get_default(); + int ret = 0; + int nfiles = 1; + char orderby[] = "md5Headers"; + grib_context* context = grib_context_get_default(); - options->strict=1; + options->strict = 1; if (grib_options_on("S:")) - start=atoi(grib_options_get_option("S:")); + start = atoi(grib_options_get_option("S:")); if (grib_options_on("E:")) - end=atoi(grib_options_get_option("E:")); + end = atoi(grib_options_get_option("E:")); - if (grib_options_on("f")) force=1; - else force=0; + if (grib_options_on("f")) + force = 1; + else + force = 0; - if (grib_options_on("d")) write_error=1; - else write_error=0; + if (grib_options_on("d")) + write_error = 1; + else + write_error = 0; verbose = grib_options_on("v"); - listFromCommandLine=0; + listFromCommandLine = 0; if (grib_options_on("c:") || grib_options_on("e")) - listFromCommandLine=1; + listFromCommandLine = 1; - if (grib_options_on("a")) onlyListed=0; - else onlyListed=1; + if (grib_options_on("a")) + onlyListed = 0; + else + onlyListed = 1; - if (grib_options_on("H")) headerMode=1; - else headerMode=0; + if (grib_options_on("H")) + headerMode = 1; + else + headerMode = 0; if (grib_options_on("H") && grib_options_on("c:")) { printf("Error: -H and -c options are incompatible. Choose one of the two please.\n"); @@ -187,34 +202,35 @@ int grib_tool_init(grib_runtime_options* options) } if (grib_options_on("b:")) { - grib_string_list *next=0; - int i=0; - blacklist=(grib_string_list*)grib_context_malloc_clear(context,sizeof(grib_string_list)); - blacklist->value=grib_context_strdup(context,options->set_values[0].name); - next=blacklist; - for (i=1;iset_values_count;i++) { - next->next=(grib_string_list*)grib_context_malloc_clear(context,sizeof(grib_string_list)); - next->next->value=grib_context_strdup(context,options->set_values[i].name); - next=next->next; + grib_string_list* next = 0; + int i = 0; + blacklist = (grib_string_list*)grib_context_malloc_clear(context, sizeof(grib_string_list)); + blacklist->value = grib_context_strdup(context, options->set_values[0].name); + next = blacklist; + for (i = 1; i < options->set_values_count; i++) { + next->next = (grib_string_list*)grib_context_malloc_clear(context, sizeof(grib_string_list)); + next->next->value = grib_context_strdup(context, options->set_values[i].name); + next = next->next; } - context->blacklist=blacklist; + context->blacklist = blacklist; } if (grib_options_on("r")) { char* filename[1]; - filename[0]=options->infile_extra->name; - options->random=1; - options->orderby=strdup(orderby); - options->idx=grib_fieldset_new_from_files(context,filename, - nfiles,0,0,0,orderby,&ret); + filename[0] = options->infile_extra->name; + options->random = 1; + options->orderby = strdup(orderby); + options->idx = grib_fieldset_new_from_files(context, filename, + nfiles, 0, 0, 0, orderby, &ret); if (ret) { printf("unable to create index for input file %s (%s)", - options->infile_extra->name,grib_get_error_message(ret)); + options->infile_extra->name, grib_get_error_message(ret)); exit(ret); } - } else { - options->random=0; - options->infile_extra->file=fopen(options->infile_extra->name,"r"); + } + else { + options->random = 0; + options->infile_extra->file = fopen(options->infile_extra->name, "r"); if (!options->infile_extra->file) { perror(options->infile_extra->name); @@ -223,7 +239,7 @@ int grib_tool_init(grib_runtime_options* options) } if (grib_options_on("t:")) - tolerance_factor=atof(grib_options_get_option("t:")); + tolerance_factor = atof(grib_options_get_option("t:")); { /* Check for 2nd file being a directory. If so, we assume user is comparing to a file */ @@ -245,100 +261,106 @@ int grib_tool_init(grib_runtime_options* options) return 0; } -int grib_tool_new_filename_action(grib_runtime_options* options,const char* file) +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) { return 0; } -int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file) +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { return 0; } static void printInfo(grib_handle* h) { - printf("== %d == DIFFERENCE == ",count); - lastPrint=count; + printf("== %d == DIFFERENCE == ", count); + lastPrint = count; } -static void print_index_key_values(grib_index* index,int cnt,const char* error_message) +static void print_index_key_values(grib_index* index, int cnt, const char* error_message) { - grib_index_key* keys=index->keys; + grib_index_key* keys = index->keys; printf("== %d == ", cnt); - if (error_message) printf("%s == ",error_message); + if (error_message) + printf("%s == ", error_message); while (keys) { - printf("%s=%s ",keys->name,keys->value); - keys=keys->next; + printf("%s=%s ", keys->name, keys->value); + keys = keys->next; } printf("\n"); } static grib_handle* gts_handle_new_from_file_x( - grib_context* c,FILE* f,int mode,int headers_only,int *err) + grib_context* c, FILE* f, int mode, int headers_only, int* err) { - return codes_handle_new_from_file(c,f,PRODUCT_GTS,err); + return codes_handle_new_from_file(c, f, PRODUCT_GTS, err); } int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) { - int err=0; + int err = 0; count++; if (options->through_index) { - grib_index* idx1=options->index1; - verbose=0; + grib_index* idx1 = options->index1; + verbose = 0; counter++; - if ( start>0 && counter < start ) return 0; - if ( end>0 && counter > end ) { - options->stop=1; + if (start > 0 && counter < start) + return 0; + if (end > 0 && counter > end) { + options->stop = 1; return 0; } - grib_index_search_same(idx1,h); - global_handle=codes_new_from_index(idx1,CODES_GTS,&err); + grib_index_search_same(idx1, h); + global_handle = codes_new_from_index(idx1, CODES_GTS, &err); if (options->verbose) { - off_t offset=0; - char* filename=grib_get_field_file(options->index2,&offset); - printf("file1=\"%s\" ",filename); - filename=grib_get_field_file(options->index1,&offset); - printf("file2=\"%s\" \n",filename); - print_index_key_values(options->index1,counter,NULL); + off_t offset = 0; + char* filename = grib_get_field_file(options->index2, &offset); + printf("file1=\"%s\" ", filename); + filename = grib_get_field_file(options->index1, &offset); + printf("file2=\"%s\" \n", filename); + print_index_key_values(options->index1, counter, NULL); } if (!global_handle) { if (!options->verbose) - print_index_key_values(idx1,counter,"NOT FOUND "); + print_index_key_values(idx1, counter, "NOT FOUND "); } - if (!global_handle || err!= GRIB_SUCCESS ) { + if (!global_handle || err != GRIB_SUCCESS) { morein1++; - if (global_handle) grib_handle_delete(global_handle); + if (global_handle) + grib_handle_delete(global_handle); return 0; } - if(compare_handles(h,global_handle,options)) { + if (compare_handles(h, global_handle, options)) { error++; - if (!force) exit(1); + if (!force) + exit(1); } grib_handle_delete(global_handle); return 0; - - } else if (options->random) - global_handle = grib_fieldset_next_handle(options->idx,&err); + } + else if (options->random) + global_handle = grib_fieldset_next_handle(options->idx, &err); else - global_handle=gts_handle_new_from_file_x(h->context,options->infile_extra->file,options->mode,0,&err); + global_handle = gts_handle_new_from_file_x(h->context, options->infile_extra->file, options->mode, 0, &err); - if (!global_handle || err!= GRIB_SUCCESS ) { + if (!global_handle || err != GRIB_SUCCESS) { morein2++; - if (global_handle) grib_handle_delete(global_handle); + if (global_handle) + grib_handle_delete(global_handle); return 0; } - if(compare_handles(global_handle,h,options)) { + if (compare_handles(global_handle, h, options)) { error++; - if (!force) exit(1); + if (!force) + exit(1); } grib_handle_delete(global_handle); @@ -348,11 +370,11 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) { - int err=0; - if (!options->through_index && !options->random) { - global_handle=gts_new_from_file(h->context,options->infile_extra->file,&err); + int err = 0; + if (!options->through_index && !options->random) { + global_handle = gts_new_from_file(h->context, options->infile_extra->file, &err); - if (!global_handle || err!= GRIB_SUCCESS) + if (!global_handle || err != GRIB_SUCCESS) morein2++; grib_handle_delete(global_handle); @@ -364,130 +386,130 @@ int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) return 0; } -void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h) +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) { - grib_print_key_values(options,h); + grib_print_key_values(options, h); } int grib_tool_finalise_action(grib_runtime_options* options) { - grib_error* e=error_summary; - int err=0; - grib_context* c=grib_context_get_default(); + grib_error* e = error_summary; + int err = 0; + grib_context* c = grib_context_get_default(); - while ((global_handle=gts_new_from_file(c,options->infile_extra->file,&err))) { + while ((global_handle = gts_new_from_file(c, options->infile_extra->file, &err))) { morein1++; - if (global_handle) grib_handle_delete(global_handle); + if (global_handle) + grib_handle_delete(global_handle); } - error+=morein1+morein2; + error += morein1 + morein2; if (error) { printf("\n## ERRORS SUMMARY #######\n"); } - if (morein1>0) { + if (morein1 > 0) { printf("##\n## Different number of messages \n"); - printf("## %d more messages in %s than in %s\n",morein1, - options->infile_extra->name,options->infile->name); + printf("## %d more messages in %s than in %s\n", morein1, + options->infile_extra->name, options->infile->name); } - if (morein2>0) { + if (morein2 > 0) { printf("##\n## Different number of messages \n"); - printf("## %d more messages in %s than in %s\n",morein2, - options->infile->name,options->infile_extra->name); + printf("## %d more messages in %s than in %s\n", morein2, + options->infile->name, options->infile_extra->name); } if (error) { printf("##\n## Summary of different key values \n"); while (e) { - printf ("## %s ( %d different )\n",e->key,e->count); - e=e->next; + printf("## %s ( %d different )\n", e->key, e->count); + e = e->next; } - printf("##\n## %d different messages out of %d\n\n",error,count); + printf("##\n## %d different messages out of %d\n\n", error, count); } if (options->through_index) { grib_index_delete(options->index1); grib_index_delete(options->index2); } - if (error !=0) exit(1); + if (error != 0) + exit(1); return 0; } -static void save_error(grib_context* c,const char* key) +static void save_error(grib_context* c, const char* key) { - grib_error* e=0; - grib_error* next=0; - int saved=0; + grib_error* e = 0; + grib_error* next = 0; + int saved = 0; if (!error_summary) { - error_summary=(grib_error*)grib_context_malloc_clear(c,sizeof(grib_error)); - error_summary->count=1; - error_summary->key=grib_context_strdup(c,key); + error_summary = (grib_error*)grib_context_malloc_clear(c, sizeof(grib_error)); + error_summary->count = 1; + error_summary->key = grib_context_strdup(c, key); return; } - e=error_summary; - next=e; + e = error_summary; + next = e; while (next) { - if (!strcmp(next->key,key)) { + if (!strcmp(next->key, key)) { next->count++; - saved=1; + saved = 1; break; } - e=next; - next=next->next; + e = next; + next = next->next; } if (!saved) { - e->next=(grib_error*)grib_context_malloc_clear(c,sizeof(grib_error)); - e->next->count=1; - e->next->key=grib_context_strdup(c,key); + e->next = (grib_error*)grib_context_malloc_clear(c, sizeof(grib_error)); + e->next->count = 1; + e->next->key = grib_context_strdup(c, key); } } -static int compare_values(grib_runtime_options* options,grib_handle* h1,grib_handle *h2,const char *name,int type) +static int compare_values(grib_runtime_options* options, grib_handle* h1, grib_handle* h2, const char* name, int type) { size_t len1 = 0; size_t len2 = 0; - int err=0; + int err = 0; int err1; int err2; - int type1,type2; + int type1, type2; int countdiff; - int isMissing1=0,isMissing2=0; + int isMissing1 = 0, isMissing2 = 0; - char *sval1 = NULL,*sval2 = NULL; - unsigned char *uval1 = NULL,*uval2 = NULL; + char *sval1 = NULL, *sval2 = NULL; + unsigned char *uval1 = NULL, *uval2 = NULL; long *lval1 = NULL, *lval2 = NULL; - grib_context* c=h1->context; + grib_context* c = h1->context; - type1=type; - type2=type; - if (verbose) printf(" comparing %s",name); + type1 = type; + type2 = type; + if (verbose) + printf(" comparing %s", name); - if( type1==GRIB_TYPE_UNDEFINED && (err = grib_get_native_type(h1,name,&type1)) != GRIB_SUCCESS) - { + if (type1 == GRIB_TYPE_UNDEFINED && (err = grib_get_native_type(h1, name, &type1)) != GRIB_SUCCESS) { printInfo(h1); - printf("Oops... cannot get type of [%s] in 1st field: %s\n",name,grib_get_error_message(err)); - save_error(c,name); + printf("Oops... cannot get type of [%s] in 1st field: %s\n", name, grib_get_error_message(err)); + save_error(c, name); return err; } - if(type2==GRIB_TYPE_UNDEFINED && (err = grib_get_native_type(h2,name,&type2)) != GRIB_SUCCESS) - { - if(err == GRIB_NOT_FOUND) - { + if (type2 == GRIB_TYPE_UNDEFINED && (err = grib_get_native_type(h2, name, &type2)) != GRIB_SUCCESS) { + if (err == GRIB_NOT_FOUND) { printInfo(h1); - printf("[%s] not found in 2nd field\n",name); - save_error(c,name); + printf("[%s] not found in 2nd field\n", name); + save_error(c, name); return err; } printInfo(h1); - printf("Oops... cannot get type of [%s] in 2nd field: %s\n",name,grib_get_error_message(err)); - save_error(c,name); + printf("Oops... cannot get type of [%s] in 2nd field: %s\n", name, grib_get_error_message(err)); + save_error(c, name); return err; } @@ -501,34 +523,31 @@ static int compare_values(grib_runtime_options* options,grib_handle* h1,grib_han } */ - if(type1 == GRIB_TYPE_LABEL) + if (type1 == GRIB_TYPE_LABEL) return err; - if(type1 == GRIB_TYPE_SECTION) + if (type1 == GRIB_TYPE_SECTION) return err; - if((err = grib_get_size(h1,name,&len1)) != GRIB_SUCCESS) - { + if ((err = grib_get_size(h1, name, &len1)) != GRIB_SUCCESS) { printInfo(h1); - printf("Oops... cannot get size of [%s] in 1st field: %s\n",name,grib_get_error_message(err)); - save_error(c,name); + printf("Oops... cannot get size of [%s] in 1st field: %s\n", name, grib_get_error_message(err)); + save_error(c, name); return err; } - if((err = grib_get_size(h2,name,&len2)) != GRIB_SUCCESS) - { - if(err == GRIB_NOT_FOUND) - { + if ((err = grib_get_size(h2, name, &len2)) != GRIB_SUCCESS) { + if (err == GRIB_NOT_FOUND) { printInfo(h1); - printf("[%s] not found in 2nd field\n",name); - save_error(c,name); + printf("[%s] not found in 2nd field\n", name); + save_error(c, name); return err; } printInfo(h1); - printf("Oops... cannot get size of [%s] in 2nd field: %s\n",name,grib_get_error_message(err)); - save_error(c,name); + printf("Oops... cannot get size of [%s] in 2nd field: %s\n", name, grib_get_error_message(err)); + save_error(c, name); return err; } @@ -544,234 +563,239 @@ static int compare_values(grib_runtime_options* options,grib_handle* h1,grib_han if (options->mode != MODE_GTS) { /* TODO: Ignore missing values for keys in GTS. Not yet implemented */ - isMissing1= ( (grib_is_missing(h1,name,&err1)==1) && (err1 == 0) ) ? 1 : 0; - isMissing2= ( (grib_is_missing(h2,name,&err2)==1) && (err2 == 0) ) ? 1 : 0; + isMissing1 = ((grib_is_missing(h1, name, &err1) == 1) && (err1 == 0)) ? 1 : 0; + isMissing2 = ((grib_is_missing(h2, name, &err2) == 1) && (err2 == 0)) ? 1 : 0; } - if ((isMissing1==1) && (isMissing2==1)) { - if (verbose) printf(" is set to missing in both fields\n"); + if ((isMissing1 == 1) && (isMissing2 == 1)) { + if (verbose) + printf(" is set to missing in both fields\n"); return GRIB_SUCCESS; } - if (isMissing1==1) { - if (verbose) printf(" is set to missing in 1st field\n"); + if (isMissing1 == 1) { + if (verbose) + printf(" is set to missing in 1st field\n"); printInfo(h1); - printf("%s is set to missing in 1st field is not missing in 2nd field\n",name); + printf("%s is set to missing in 1st field is not missing in 2nd field\n", name); err1 = GRIB_VALUE_MISMATCH; - save_error(c,name); + save_error(c, name); return GRIB_VALUE_MISMATCH; } - if (isMissing2==1) { - if (verbose) printf(" is set to missing in 1st field\n"); + if (isMissing2 == 1) { + if (verbose) + printf(" is set to missing in 1st field\n"); printInfo(h1); - printf("%s is set to missing in 2nd field is not missing in 1st field\n",name); + printf("%s is set to missing in 2nd field is not missing in 1st field\n", name); err1 = GRIB_VALUE_MISMATCH; - save_error(c,name); + save_error(c, name); return GRIB_VALUE_MISMATCH; } - switch(type1) - { - case GRIB_TYPE_STRING: - if (verbose) printf(" as string\n"); - grib_get_string_length(h1,name,&len1); - grib_get_string_length(h2,name,&len2); - sval1 = (char*)grib_context_malloc(h1->context,len1*sizeof(char)); - sval2 = (char*)grib_context_malloc(h2->context,len2*sizeof(char)); - - if((err1 = grib_get_string(h1,name,sval1,&len1)) != GRIB_SUCCESS) - { - printInfo(h1); - printf("Oops... cannot get string value of [%s] in 1st field: %s\n", - name,grib_get_error_message(err1)); - save_error(c,name); - } + switch (type1) { + case GRIB_TYPE_STRING: + if (verbose) + printf(" as string\n"); + grib_get_string_length(h1, name, &len1); + grib_get_string_length(h2, name, &len2); + sval1 = (char*)grib_context_malloc(h1->context, len1 * sizeof(char)); + sval2 = (char*)grib_context_malloc(h2->context, len2 * sizeof(char)); - if((err2 = grib_get_string(h2,name,sval2,&len2)) != GRIB_SUCCESS) - { - printInfo(h1); - printf("Oops... cannot get string value of [%s] in 2nd field: %s\n", - name,grib_get_error_message(err2)); - save_error(c,name); - } + if ((err1 = grib_get_string(h1, name, sval1, &len1)) != GRIB_SUCCESS) { + printInfo(h1); + printf("Oops... cannot get string value of [%s] in 1st field: %s\n", + name, grib_get_error_message(err1)); + save_error(c, name); + } - if(err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS) - { - if(grib_inline_strcmp(sval1,sval2) != 0) - { + if ((err2 = grib_get_string(h2, name, sval2, &len2)) != GRIB_SUCCESS) { printInfo(h1); - printf("string [%s]: [%s] != [%s]\n", - name,sval1,sval2); - err1 = GRIB_VALUE_MISMATCH; - save_error(c,name); + printf("Oops... cannot get string value of [%s] in 2nd field: %s\n", + name, grib_get_error_message(err2)); + save_error(c, name); } - } - grib_context_free(h1->context,sval1); - grib_context_free(h2->context,sval2); + if (err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS) { + if (grib_inline_strcmp(sval1, sval2) != 0) { + printInfo(h1); + printf("string [%s]: [%s] != [%s]\n", + name, sval1, sval2); + err1 = GRIB_VALUE_MISMATCH; + save_error(c, name); + } + } - if(err1) return err1; - if(err2) return err2; + grib_context_free(h1->context, sval1); + grib_context_free(h2->context, sval2); - break; + if (err1) + return err1; + if (err2) + return err2; - case GRIB_TYPE_LONG: - if (verbose) printf(" as long\n"); + break; - lval1 = (long*)grib_context_malloc(h1->context,len1*sizeof(long)); - lval2 = (long*)grib_context_malloc(h2->context,len2*sizeof(long)); + case GRIB_TYPE_LONG: + if (verbose) + printf(" as long\n"); - if((err1 = grib_get_long_array(h1,name,lval1,&len1)) != GRIB_SUCCESS) - { - printInfo(h1); - printf("Oops... cannot get long value of [%s] in 1st field: %s\n", - name,grib_get_error_message(err1)); - save_error(c,name); - } + lval1 = (long*)grib_context_malloc(h1->context, len1 * sizeof(long)); + lval2 = (long*)grib_context_malloc(h2->context, len2 * sizeof(long)); - if((err2 = grib_get_long_array(h2,name,lval2,&len2)) != GRIB_SUCCESS) - { - printInfo(h1); - printf("Oops... cannot get long value of [%s] in 2nd field: %s\n", - name,grib_get_error_message(err2)); - save_error(c,name); - } + if ((err1 = grib_get_long_array(h1, name, lval1, &len1)) != GRIB_SUCCESS) { + printInfo(h1); + printf("Oops... cannot get long value of [%s] in 1st field: %s\n", + name, grib_get_error_message(err1)); + save_error(c, name); + } - if(err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS && len1!=len2) - { - printInfo(h1); - printf("Different size for \"%s\" [%ld] [%ld]\n",name,(long)len1,(long)len2); - err1=GRIB_INTERNAL_ERROR; - save_error(c,name); - } - if(err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS && len1==len2) - { - int i; - countdiff=0; - for(i = 0; i < len1; i++) - if(lval1[i] != lval2[i]) countdiff++; - - if (countdiff) { + if ((err2 = grib_get_long_array(h2, name, lval2, &len2)) != GRIB_SUCCESS) { printInfo(h1); - save_error(c,name); - err1 = GRIB_VALUE_MISMATCH; - if(len1 == 1) - printf("long [%s]: [%ld] != [%ld]\n", - name,*lval1,*lval2); - else - printf("long [%s] %d out of %ld different\n", - name,countdiff,(long)len1); + printf("Oops... cannot get long value of [%s] in 2nd field: %s\n", + name, grib_get_error_message(err2)); + save_error(c, name); } - } + if (err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS && len1 != len2) { + printInfo(h1); + printf("Different size for \"%s\" [%ld] [%ld]\n", name, (long)len1, (long)len2); + err1 = GRIB_INTERNAL_ERROR; + save_error(c, name); + } + if (err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS && len1 == len2) { + int i; + countdiff = 0; + for (i = 0; i < len1; i++) + if (lval1[i] != lval2[i]) + countdiff++; + + if (countdiff) { + printInfo(h1); + save_error(c, name); + err1 = GRIB_VALUE_MISMATCH; + if (len1 == 1) + printf("long [%s]: [%ld] != [%ld]\n", + name, *lval1, *lval2); + else + printf("long [%s] %d out of %ld different\n", + name, countdiff, (long)len1); + } + } - grib_context_free(h1->context,lval1); - grib_context_free(h2->context,lval2); - if(err1) return err1; - if(err2) return err2; - break; + grib_context_free(h1->context, lval1); + grib_context_free(h2->context, lval2); - case GRIB_TYPE_DOUBLE: - Assert(!"GTS cannot contain keys of type DOUBLE"); - break; + if (err1) + return err1; + if (err2) + return err2; + break; - case GRIB_TYPE_BYTES: - if (verbose) printf(" as bytes\n"); - if (options->mode==MODE_GTS) return 0; - if (len1<2) len1=512; - if (len2<2) len2=512; - uval1 = (unsigned char*)grib_context_malloc(h1->context,len1*sizeof(unsigned char)); - uval2 = (unsigned char*)grib_context_malloc(h2->context,len2*sizeof(unsigned char)); + case GRIB_TYPE_DOUBLE: + Assert(!"GTS cannot contain keys of type DOUBLE"); + break; - if((err1 = grib_get_bytes(h1,name,uval1,&len1)) != GRIB_SUCCESS) - { - printInfo(h1); - save_error(c,name); - printf("Oops... cannot get bytes value of [%s] in 1st field: %s\n", - name,grib_get_error_message(err1)); - } + case GRIB_TYPE_BYTES: + if (verbose) + printf(" as bytes\n"); + if (options->mode == MODE_GTS) + return 0; + if (len1 < 2) + len1 = 512; + if (len2 < 2) + len2 = 512; + uval1 = (unsigned char*)grib_context_malloc(h1->context, len1 * sizeof(unsigned char)); + uval2 = (unsigned char*)grib_context_malloc(h2->context, len2 * sizeof(unsigned char)); + + if ((err1 = grib_get_bytes(h1, name, uval1, &len1)) != GRIB_SUCCESS) { + printInfo(h1); + save_error(c, name); + printf("Oops... cannot get bytes value of [%s] in 1st field: %s\n", + name, grib_get_error_message(err1)); + } - if((err2 = grib_get_bytes(h2,name,uval2,&len2)) != GRIB_SUCCESS) - { - printInfo(h1); - save_error(c,name); - printf("Oops... cannot get bytes value of [%s] in 2nd field: %s\n", - name,grib_get_error_message(err2)); - } + if ((err2 = grib_get_bytes(h2, name, uval2, &len2)) != GRIB_SUCCESS) { + printInfo(h1); + save_error(c, name); + printf("Oops... cannot get bytes value of [%s] in 2nd field: %s\n", + name, grib_get_error_message(err2)); + } - if(err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS) - { - if(memcmp(uval1,uval2,len1) != 0) - { - int i; - for(i = 0; i < len1; i++) - if(uval1[i] != uval2[i]) - { - printInfo(h1); - save_error(c,name); - if(len1 == 1) - printf("[%s] byte values are different: [%02x] and [%02x]\n", - name,uval1[i],uval2[i]); - else - printf("[%s] byte value %d of %ld are different: [%02x] and [%02x]\n", - name,i,(long)len1,uval1[i],uval2[i]); - - err1 = GRIB_VALUE_MISMATCH; - break; - } - err1 = GRIB_VALUE_MISMATCH; + if (err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS) { + if (memcmp(uval1, uval2, len1) != 0) { + int i; + for (i = 0; i < len1; i++) + if (uval1[i] != uval2[i]) { + printInfo(h1); + save_error(c, name); + if (len1 == 1) + printf("[%s] byte values are different: [%02x] and [%02x]\n", + name, uval1[i], uval2[i]); + else + printf("[%s] byte value %d of %ld are different: [%02x] and [%02x]\n", + name, i, (long)len1, uval1[i], uval2[i]); + + err1 = GRIB_VALUE_MISMATCH; + break; + } + err1 = GRIB_VALUE_MISMATCH; + } } - } - grib_context_free(h1->context,uval1); - grib_context_free(h2->context,uval2); + grib_context_free(h1->context, uval1); + grib_context_free(h2->context, uval2); - if(err1) return err1; - if(err2) return err2; - break; + if (err1) + return err1; + if (err2) + return err2; + break; - case GRIB_TYPE_LABEL: - if (verbose) printf(" as label\n"); - break; + case GRIB_TYPE_LABEL: + if (verbose) + printf(" as label\n"); + break; - default: - if (verbose) printf("\n"); - printInfo(h1); - save_error(c,name); - printf("Cannot compare [%s], unsupported type %d\n",name,type1); - return GRIB_UNABLE_TO_COMPARE_ACCESSORS; - break; + default: + if (verbose) + printf("\n"); + printInfo(h1); + save_error(c, name); + printf("Cannot compare [%s], unsupported type %d\n", name, type1); + return GRIB_UNABLE_TO_COMPARE_ACCESSORS; + break; } return GRIB_SUCCESS; } -static int compare_all_dump_keys(grib_handle* h1,grib_handle* h2,grib_runtime_options* options,int *err) +static int compare_all_dump_keys(grib_handle* h1, grib_handle* h2, grib_runtime_options* options, int* err) { - int ret=0; - const char* name=NULL; - grib_keys_iterator* iter = NULL; - iter=grib_keys_iterator_new(h1,0,NULL); + int ret = 0; + const char* name = NULL; + grib_keys_iterator* iter = NULL; + iter = grib_keys_iterator_new(h1, 0, NULL); if (!iter) { printf("ERROR: unable to get iterator\n"); exit(1); } - while(grib_keys_iterator_next(iter)) - { - grib_accessor* xa=grib_keys_iterator_get_accessor(iter); - name=grib_keys_iterator_get_name(iter); + while (grib_keys_iterator_next(iter)) { + grib_accessor* xa = grib_keys_iterator_get_accessor(iter); + name = grib_keys_iterator_get_name(iter); /* printf("----- comparing %s\n",name); */ - if (blacklisted(name)) continue; - if (xa==NULL || ( xa->flags & GRIB_ACCESSOR_FLAG_DUMP )==0 ) continue; - if(compare_values(options,h1,h2,name,GRIB_TYPE_UNDEFINED)) { + if (blacklisted(name)) + continue; + if (xa == NULL || (xa->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) + continue; + if (compare_values(options, h1, h2, name, GRIB_TYPE_UNDEFINED)) { err++; - write_messages(h1,h2); - ret=1; + write_messages(h1, h2); + ret = 1; } } @@ -779,53 +803,53 @@ static int compare_all_dump_keys(grib_handle* h1,grib_handle* h2,grib_runtime_op return ret; } -static int compare_handles(grib_handle* h1,grib_handle* h2,grib_runtime_options* options) +static int compare_handles(grib_handle* h1, grib_handle* h2, grib_runtime_options* options) { - int err = 0; - int i=0; - grib_keys_iterator* iter = NULL; - const char* name=NULL; + int err = 0; + int i = 0; + grib_keys_iterator* iter = NULL; + const char* name = NULL; /* mask only if no -c option or headerMode (-H)*/ - if (blacklist && ( !listFromCommandLine || headerMode )) { - grib_string_list* nextb=blacklist; + if (blacklist && (!listFromCommandLine || headerMode)) { + grib_string_list* nextb = blacklist; while (nextb) { - grib_clear(h1,nextb->value); - grib_clear(h2,nextb->value); - nextb=nextb->next; + grib_clear(h1, nextb->value); + grib_clear(h2, nextb->value); + nextb = nextb->next; } } if (headerMode) { - const void *msg1=NULL,*msg2=NULL; - size_t size1=0,size2=0; + const void *msg1 = NULL, *msg2 = NULL; + size_t size1 = 0, size2 = 0; grib_handle *h11, *h22; - GRIB_CHECK_NOLINE(grib_get_message_headers(h1,&msg1,&size1),0); - GRIB_CHECK_NOLINE(grib_get_message_headers(h2,&msg2,&size2),0); - if (size1==size2 && !memcmp(msg1,msg2,size1)) + GRIB_CHECK_NOLINE(grib_get_message_headers(h1, &msg1, &size1), 0); + GRIB_CHECK_NOLINE(grib_get_message_headers(h2, &msg2, &size2), 0); + if (size1 == size2 && !memcmp(msg1, msg2, size1)) return 0; - err=0; - h11=grib_handle_new_from_partial_message(h1->context,msg1,size1); - h22=grib_handle_new_from_partial_message(h1->context,msg2,size2); + err = 0; + h11 = grib_handle_new_from_partial_message(h1->context, msg1, size1); + h22 = grib_handle_new_from_partial_message(h1->context, msg2, size2); - iter=grib_keys_iterator_new(h11, - GRIB_KEYS_ITERATOR_SKIP_COMPUTED,NULL); + iter = grib_keys_iterator_new(h11, + GRIB_KEYS_ITERATOR_SKIP_COMPUTED, NULL); if (!iter) { printf("ERROR: unable to get iterator\n"); exit(1); } - while(grib_keys_iterator_next(iter)) - { - name=grib_keys_iterator_get_name(iter); + while (grib_keys_iterator_next(iter)) { + name = grib_keys_iterator_get_name(iter); /*printf("----- comparing %s\n",name);*/ - if (blacklisted(name)) continue; - if(compare_values(options,h11,h22,name,GRIB_TYPE_UNDEFINED)) { + if (blacklisted(name)) + continue; + if (compare_values(options, h11, h22, name, GRIB_TYPE_UNDEFINED)) { err++; - write_messages(h11,h22); + write_messages(h11, h22); } } @@ -835,43 +859,46 @@ static int compare_handles(grib_handle* h1,grib_handle* h2,grib_runtime_options* return err; } - if ( listFromCommandLine && onlyListed ) { - for (i=0; i< options->compare_count; i++) { - if (blacklisted((char*)options->compare[i].name)) continue; + if (listFromCommandLine && onlyListed) { + for (i = 0; i < options->compare_count; i++) { + if (blacklisted((char*)options->compare[i].name)) + continue; if (options->compare[i].type == GRIB_NAMESPACE) { - iter=grib_keys_iterator_new(h1,0,options->compare[i].name); + iter = grib_keys_iterator_new(h1, 0, options->compare[i].name); if (!iter) { printf("ERROR: unable to get iterator\n"); exit(1); } - while(grib_keys_iterator_next(iter)) - { - name=grib_keys_iterator_get_name(iter); + while (grib_keys_iterator_next(iter)) { + name = grib_keys_iterator_get_name(iter); /*printf("----- comparing %s\n",name);*/ - if (blacklisted(name)) continue; - if(compare_values(options,h1,h2,name,GRIB_TYPE_UNDEFINED)) { + if (blacklisted(name)) + continue; + if (compare_values(options, h1, h2, name, GRIB_TYPE_UNDEFINED)) { err++; - write_messages(h1,h2); + write_messages(h1, h2); } } grib_keys_iterator_delete(iter); - } else { - if( compare_values(options,h1,h2,options->compare[i].name,options->compare[i].type)) + } + else { + if (compare_values(options, h1, h2, options->compare[i].name, options->compare[i].type)) err++; - write_messages(h1,h2); + write_messages(h1, h2); } } - } else { - const void *msg1=NULL,*msg2=NULL; - size_t size1=0,size2=0; - int memcmp_ret=0; + } + else { + const void *msg1 = NULL, *msg2 = NULL; + size_t size1 = 0, size2 = 0; + int memcmp_ret = 0; /* int ii=0; */ - GRIB_CHECK_NOLINE(grib_get_message(h1,&msg1,&size1),0); - GRIB_CHECK_NOLINE(grib_get_message(h2,&msg2,&size2),0); - if (size1==size2 && !(memcmp_ret=memcmp(msg1,msg2,size1))) { + GRIB_CHECK_NOLINE(grib_get_message(h1, &msg1, &size1), 0); + GRIB_CHECK_NOLINE(grib_get_message(h2, &msg2, &size2), 0); + if (size1 == size2 && !(memcmp_ret = memcmp(msg1, msg2, size1))) { return 0; - } + } #if 0 else { int lcount=count,ii; @@ -895,42 +922,45 @@ static int compare_handles(grib_handle* h1,grib_handle* h2,grib_runtime_options* #endif - if ( listFromCommandLine ) { - for (i=0; i< options->compare_count; i++) { - if (blacklisted(name)) continue; + if (listFromCommandLine) { + for (i = 0; i < options->compare_count; i++) { + if (blacklisted(name)) + continue; if (options->compare[i].type == GRIB_NAMESPACE) { - iter=grib_keys_iterator_new(h1,0,options->compare[i].name); + iter = grib_keys_iterator_new(h1, 0, options->compare[i].name); if (!iter) { - printf("ERROR: unable to get iterator for %s\n",options->compare[i].name ); + printf("ERROR: unable to get iterator for %s\n", options->compare[i].name); exit(1); } - while(grib_keys_iterator_next(iter)) - { - name=grib_keys_iterator_get_name(iter); + while (grib_keys_iterator_next(iter)) { + name = grib_keys_iterator_get_name(iter); /*printf("----- comparing %s\n",name);*/ - if (blacklisted(name)) continue; - if(compare_values(options,h1,h2,name,GRIB_TYPE_UNDEFINED)) { + if (blacklisted(name)) + continue; + if (compare_values(options, h1, h2, name, GRIB_TYPE_UNDEFINED)) { err++; - write_messages(h1,h2); - if (compare_all_dump_keys(h1,h2,options,&err)) { + write_messages(h1, h2); + if (compare_all_dump_keys(h1, h2, options, &err)) { err++; } } } grib_keys_iterator_delete(iter); - } else { - if( compare_values(options,h1,h2,options->compare[i].name,options->compare[i].type)) { + } + else { + if (compare_values(options, h1, h2, options->compare[i].name, options->compare[i].type)) { err++; - write_messages(h1,h2); - if (compare_all_dump_keys(h1,h2,options,&err)) { + write_messages(h1, h2); + if (compare_all_dump_keys(h1, h2, options, &err)) { err++; } } } } - } else { - if (compare_all_dump_keys(h1,h2,options,&err)) { + } + else { + if (compare_all_dump_keys(h1, h2, options, &err)) { err++; } } @@ -940,6 +970,6 @@ static int compare_handles(grib_handle* h1,grib_handle* h2,grib_runtime_options* int grib_no_handle_action(grib_runtime_options* options, int err) { - fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\t\t\"ERROR: unreadable message\"\n"); return 0; } diff --git a/tools/gts_copy.c b/tools/gts_copy.c index b44060857..7bc7a8825 100644 --- a/tools/gts_copy.c +++ b/tools/gts_copy.c @@ -10,41 +10,43 @@ #include "grib_tools.h" -const char* grib_tool_description="Copies the content of GTS files printing" - " values of some keys."; -const char* grib_tool_name="gts_copy"; -const char* grib_tool_usage="[options] file file ... output_file"; - -grib_option grib_options[]={ - /* {id, args, help}, on, command_line, value */ - {"f",0,0,0,1,0}, - {"c",0,0,1,0,0}, - {"q",0,0,1,0,0}, - {"p:",0,0,1,1,0}, - {"P:",0,0,0,1,0}, - {"w:","key[:{s|d|i}]=value,key[:{s|d|i}]=value,...","\n\t\tWhere clause." - "\n\t\tOnly GTS messages matching the key/value constraints are " - "copied to the\n\t\toutput_gts_file.\n\t\tFor each key a string (key:s), a " - "double (key:d) or an integer (key:i)\n\t\ttype can be defined. Default type " - "is string.\n",0,1,0}, - {"B:",0,0,0,1,0}, - {"V",0,0,0,1,0}, - {"W:",0,0,0,1,0}, - {"U",0,0,1,0,0}, - {"H",0,0,1,0,0}, - {"T:",0,0,1,0,"T"}, /* GTS */ - {"S",0,0,1,0,0}, - {"g",0,0,0,1,0}, - {"7",0,0,0,1,0}, - {"v",0,0,0,1,0} +const char* grib_tool_description = + "Copies the content of GTS files printing" + " values of some keys."; +const char* grib_tool_name = "gts_copy"; +const char* grib_tool_usage = "[options] file file ... output_file"; + +grib_option grib_options[] = { + /* {id, args, help}, on, command_line, value */ + { "f", 0, 0, 0, 1, 0 }, + { "c", 0, 0, 1, 0, 0 }, + { "q", 0, 0, 1, 0, 0 }, + { "p:", 0, 0, 1, 1, 0 }, + { "P:", 0, 0, 0, 1, 0 }, + { "w:", "key[:{s|d|i}]=value,key[:{s|d|i}]=value,...", + "\n\t\tWhere clause." + "\n\t\tOnly GTS messages matching the key/value constraints are " + "copied to the\n\t\toutput_gts_file.\n\t\tFor each key a string (key:s), a " + "double (key:d) or an integer (key:i)\n\t\ttype can be defined. Default type " + "is string.\n", + 0, 1, 0 }, + { "B:", 0, 0, 0, 1, 0 }, + { "V", 0, 0, 0, 1, 0 }, + { "W:", 0, 0, 0, 1, 0 }, + { "U", 0, 0, 1, 0, 0 }, + { "H", 0, 0, 1, 0, 0 }, + { "T:", 0, 0, 1, 0, "T" }, /* GTS */ + { "S", 0, 0, 1, 0, 0 }, + { "g", 0, 0, 0, 1, 0 }, + { "7", 0, 0, 0, 1, 0 }, + { "v", 0, 0, 0, 1, 0 } }; -int grib_options_count=sizeof(grib_options)/sizeof(grib_option); +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - int ret=grib_tool(argc,argv); - return ret; + return grib_tool(argc, argv); } int grib_tool_before_getopt(grib_runtime_options* options) @@ -66,27 +68,28 @@ int grib_tool_init(grib_runtime_options* options) return 0; } -int grib_tool_new_filename_action(grib_runtime_options* options,const char* file) +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) { return 0; } -int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file) +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { return 0; } int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) { - int err=0; + int err = 0; if (!options->skip) { if (options->set_values_count != 0) - err=grib_set_values(h,options->set_values,options->set_values_count); + err = grib_set_values(h, options->set_values, options->set_values_count); - if( err != GRIB_SUCCESS && options->fail) exit(err); + if (err != GRIB_SUCCESS && options->fail) + exit(err); } - grib_tools_write_message(options,h); + grib_tools_write_message(options, h); return 0; } @@ -96,9 +99,9 @@ int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) return 0; } -void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h) +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) { - grib_print_key_values(options,h); + grib_print_key_values(options, h); } int grib_tool_finalise_action(grib_runtime_options* options) @@ -113,6 +116,6 @@ int grib_tool_finalise_action(grib_runtime_options* options) int grib_no_handle_action(grib_runtime_options* options, int err) { - fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\t\t\"ERROR: unreadable message\"\n"); return 0; } diff --git a/tools/gts_dump.c b/tools/gts_dump.c index d16cd60ed..d0c93b26d 100644 --- a/tools/gts_dump.c +++ b/tools/gts_dump.c @@ -16,144 +16,143 @@ #include "grib_tools.h" -grib_option grib_options[]={ -/* {id, args, help}, on, command_line, value*/ - {"S",0,0,1,0,0}, - {"O",0,"Octet mode. WMO documentation style dump.\n",0,1,0}, - {"D",0,0,0,1,0}, - {"d",0,"Print all data values.\n",0,1,0}, - {"t",0,0,0,1,0}, - {"H",0,0,0,1,0}, - {"a",0,0,0,1,0}, - {"w:",0,0,0,1,0}, - {"T:",0,0,1,0,"T"}, - {"7",0,0,0,1,0}, - {"V",0,0,0,1,0}, - {"q",0,0,1,0,0}, - {"x",0,0,0,1,0} +grib_option grib_options[] = { + /* {id, args, help}, on, command_line, value*/ + { "S", 0, 0, 1, 0, 0 }, + { "O", 0, "Octet mode. WMO documentation style dump.\n", 0, 1, 0 }, + { "D", 0, 0, 0, 1, 0 }, + { "d", 0, "Print all data values.\n", 0, 1, 0 }, + { "t", 0, 0, 0, 1, 0 }, + { "H", 0, 0, 0, 1, 0 }, + { "a", 0, 0, 0, 1, 0 }, + { "w:", 0, 0, 0, 1, 0 }, + { "T:", 0, 0, 1, 0, "T" }, + { "7", 0, 0, 0, 1, 0 }, + { "V", 0, 0, 0, 1, 0 }, + { "q", 0, 0, 1, 0, 0 }, + { "x", 0, 0, 0, 1, 0 } }; -const char* grib_tool_description="Dump the content of a GTS file in different formats."; -const char* grib_tool_name="gts_dump"; -const char* grib_tool_usage="[options] file file ..."; +const char* grib_tool_description = "Dump the content of a GTS file in different formats."; +const char* grib_tool_name = "gts_dump"; +const char* grib_tool_usage = "[options] file file ..."; -int grib_options_count=sizeof(grib_options)/sizeof(grib_option); +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); /** * gts_dump * Dump the content of a GTS file * */ -int main(int argc, char *argv[]) { return grib_tool(argc,argv);} +int main(int argc, char* argv[]) +{ + return grib_tool(argc, argv); +} int grib_tool_before_getopt(grib_runtime_options* options) { - return 0; + return 0; } int grib_tool_init(grib_runtime_options* options) { + int opt = grib_options_on("C") + grib_options_on("O") + grib_options_on("D"); - int opt=grib_options_on("C")+grib_options_on("O")+grib_options_on("D"); + options->dump_mode = "default"; - options->dump_mode = "default"; + if (opt > 1) { + printf("%s: simultaneous O/D options not allowed\n", grib_tool_name); + exit(1); + } - if (opt > 1) { - printf("%s: simultaneous O/D options not allowed\n",grib_tool_name); - exit(1); - } + if (grib_options_on("O")) { + options->dump_mode = "wmo"; + options->dump_flags = GRIB_DUMP_FLAG_CODED | GRIB_DUMP_FLAG_OCTECT | GRIB_DUMP_FLAG_VALUES | GRIB_DUMP_FLAG_READ_ONLY; + } - if (grib_options_on("O")) { - options->dump_mode = "wmo"; - options->dump_flags = GRIB_DUMP_FLAG_CODED - | GRIB_DUMP_FLAG_OCTECT - | GRIB_DUMP_FLAG_VALUES - | GRIB_DUMP_FLAG_READ_ONLY; - } + if (grib_options_on("D")) { + options->dump_mode = "debug"; + options->dump_flags = GRIB_DUMP_FLAG_VALUES | GRIB_DUMP_FLAG_READ_ONLY; + } - if (grib_options_on("D")) { - options->dump_mode = "debug"; - options->dump_flags = GRIB_DUMP_FLAG_VALUES - | GRIB_DUMP_FLAG_READ_ONLY; - } + if (grib_options_on("a")) + options->dump_flags |= GRIB_DUMP_FLAG_ALIASES; - if (grib_options_on("a")) - options->dump_flags |= GRIB_DUMP_FLAG_ALIASES; + if (grib_options_on("t")) + options->dump_flags |= GRIB_DUMP_FLAG_TYPE; - if (grib_options_on("t")) - options->dump_flags |= GRIB_DUMP_FLAG_TYPE; + if (grib_options_on("H")) + options->dump_flags |= GRIB_DUMP_FLAG_HEXADECIMAL; - if (grib_options_on("H")) - options->dump_flags |= GRIB_DUMP_FLAG_HEXADECIMAL; + if (grib_options_on("d")) + options->dump_flags |= GRIB_DUMP_FLAG_ALL_DATA; - if (grib_options_on("d")) - options->dump_flags |= GRIB_DUMP_FLAG_ALL_DATA; - - return 0; + return 0; } -int grib_tool_new_filename_action(grib_runtime_options* options,const char* file) +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) { - return 0; + return 0; } -int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file) +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { - char tmp[1024]; - if (!options->current_infile->name) return 0; - sprintf(tmp,"FILE: %s ",options->current_infile->name); - if (!grib_options_on("C")) - fprintf(stdout,"***** %s\n",tmp); - return 0; + char tmp[1024]; + if (!options->current_infile->name) + return 0; + sprintf(tmp, "FILE: %s ", options->current_infile->name); + if (!grib_options_on("C")) + fprintf(stdout, "***** %s\n", tmp); + return 0; } int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) { - long length=0; - char tmp[1024]; - char identifier[100]; - size_t idlen=100; - int i; - if (grib_get_long(h,"totalLength",&length) != GRIB_SUCCESS) - length=-9999; - - for (i=0;iprint_keys_count;i++) - grib_set_flag(h,options->print_keys[i].name,GRIB_ACCESSOR_FLAG_DUMP); - - sprintf(tmp,"MESSAGE %d ( length=%ld )",options->handle_count,length); - if (!grib_options_on("C")) - fprintf(stdout,"#============== %-38s ==============\n",tmp); - if (!strcmp(options->dump_mode,"default")) { - GRIB_CHECK_NOLINE(grib_get_string(h,"identifier",identifier,&idlen),0); - printf("%s {\n",identifier); - } - - grib_dump_content(h,stdout,options->dump_mode,options->dump_flags,0); - - if (!strcmp(options->dump_mode,"default")) - printf("}\n"); - return 0; + long length = 0; + char tmp[1024]; + char identifier[100]; + size_t idlen = 100; + int i; + if (grib_get_long(h, "totalLength", &length) != GRIB_SUCCESS) + length = -9999; + + for (i = 0; i < options->print_keys_count; i++) + grib_set_flag(h, options->print_keys[i].name, GRIB_ACCESSOR_FLAG_DUMP); + + sprintf(tmp, "MESSAGE %d ( length=%ld )", options->handle_count, length); + if (!grib_options_on("C")) + fprintf(stdout, "#============== %-38s ==============\n", tmp); + if (!strcmp(options->dump_mode, "default")) { + GRIB_CHECK_NOLINE(grib_get_string(h, "identifier", identifier, &idlen), 0); + printf("%s {\n", identifier); + } + + grib_dump_content(h, stdout, options->dump_mode, options->dump_flags, 0); + + if (!strcmp(options->dump_mode, "default")) + printf("}\n"); + return 0; } int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) { - grib_handle_delete(h); - return 0; + grib_handle_delete(h); + return 0; } -void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h) +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) { - grib_print_key_values(options,h); + grib_print_key_values(options, h); } int grib_tool_finalise_action(grib_runtime_options* options) { - return 0; + return 0; } int grib_no_handle_action(grib_runtime_options* options, int err) { - fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\t\t\"ERROR: unreadable message\"\n"); return 0; } diff --git a/tools/gts_filter.c b/tools/gts_filter.c index 2224ffa9f..a7091cbdc 100644 --- a/tools/gts_filter.c +++ b/tools/gts_filter.c @@ -10,34 +10,36 @@ #include "grib_tools.h" -grib_option grib_options[]={ -/* {id, args, help}, on, command_line, value */ - {"f",0,0,0,1,0}, - {"f",0,0,1,0,0}, - {"F",0,0,1,0,0}, - {"o:",0,0,1,1,"filter.out"}, - {"q",0,0,1,0,0}, - {"M",0,0,0,1,0}, - {"I",0,0,1,0,0}, - {"V",0,0,0,1,0}, - {"g",0,0,0,1,0}, - {"G",0,0,0,1,0}, - {"T:",0,0,1,0,"T"}, /* GTS */ - {"7",0,0,0,1,0}, - {"v",0,0,0,1,0} +grib_option grib_options[] = { + /* {id, args, help}, on, command_line, value */ + { "f", 0, 0, 0, 1, 0 }, + { "f", 0, 0, 1, 0, 0 }, + { "F", 0, 0, 1, 0, 0 }, + { "o:", 0, 0, 1, 1, "filter.out" }, + { "q", 0, 0, 1, 0, 0 }, + { "M", 0, 0, 0, 1, 0 }, + { "I", 0, 0, 1, 0, 0 }, + { "V", 0, 0, 0, 1, 0 }, + { "g", 0, 0, 0, 1, 0 }, + { "G", 0, 0, 0, 1, 0 }, + { "T:", 0, 0, 1, 0, "T" }, /* GTS */ + { "7", 0, 0, 0, 1, 0 }, + { "v", 0, 0, 0, 1, 0 } }; -const char* grib_tool_description="Apply the rules defined in rules_file to each GTS " - "message\n\tin the GTS files provided as arguments.\n\t" - "If you specify '-' (a single dash) for the rules_file, the rules will be read from standard input."; -const char* grib_tool_name="gts_filter"; -const char* grib_tool_usage="[options] rules_file " - "file file ..."; -int fail=0; -int grib_options_count=sizeof(grib_options)/sizeof(grib_option); - -int main(int argc, char *argv[]) +const char* grib_tool_description = + "Apply the rules defined in rules_file to each GTS " + "message\n\tin the GTS files provided as arguments.\n\t" + "If you specify '-' (a single dash) for the rules_file, the rules will be read from standard input."; +const char* grib_tool_name = "gts_filter"; +const char* grib_tool_usage = + "[options] rules_file " + "file file ..."; +int fail = 0; +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); + +int main(int argc, char* argv[]) { - return grib_tool(argc,argv); + return grib_tool(argc, argv); } int grib_tool_before_getopt(grib_runtime_options* options) @@ -49,37 +51,38 @@ int grib_tool_init(grib_runtime_options* options) { options->action = grib_action_from_filter(options->infile_extra->name); if (!options->action) { - fprintf(stderr,"%s: error unable to create action\n",options->infile_extra->name); + fprintf(stderr, "%s: error unable to create action\n", options->infile_extra->name); exit(1); } - if ( options->outfile && options->outfile->name ) - options->action->context->outfilename=options->outfile->name; + if (options->outfile && options->outfile->name) + options->action->context->outfilename = options->outfile->name; return 0; } -int grib_tool_new_filename_action(grib_runtime_options* options,const char* file) +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) { return 0; -} +} -int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file) +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { return 0; } -int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) { - int err=0; +int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) +{ + int err = 0; if (options->current_infile->name) { - size_t len=strlen(options->current_infile->name); - grib_set_string(h,"file",options->current_infile->name,&len); + size_t len = strlen(options->current_infile->name); + grib_set_string(h, "file", options->current_infile->name, &len); } - err=grib_handle_apply_action(h,options->action); - if (err != GRIB_SUCCESS && options->fail && err!=GRIB_NOT_FOUND) { - printf("ERROR: %s\n",grib_get_error_message(err)); + err = grib_handle_apply_action(h, options->action); + if (err != GRIB_SUCCESS && options->fail && err != GRIB_NOT_FOUND) { + printf("ERROR: %s\n", grib_get_error_message(err)); exit(err); } return 0; @@ -91,9 +94,9 @@ int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) return 0; } -void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h) +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) { - grib_print_key_values(options,h); + grib_print_key_values(options, h); } int grib_tool_finalise_action(grib_runtime_options* options) @@ -104,6 +107,6 @@ int grib_tool_finalise_action(grib_runtime_options* options) int grib_no_handle_action(grib_runtime_options* options, int err) { - fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\t\t\"ERROR: unreadable message\"\n"); return 0; } diff --git a/tools/gts_get.c b/tools/gts_get.c index b51acb787..c17aa61a2 100644 --- a/tools/gts_get.c +++ b/tools/gts_get.c @@ -10,73 +10,75 @@ #include "grib_tools.h" -grib_option grib_options[]={ - /* {id, args, help}, on, command_line, value*/ - {"f",0,0,0,1,0}, - {"p:",0,0,0,1,0}, - {"F:",0,0,1,1,"%g"}, - {"P:",0,0,0,1,0}, - {"w:",0,0,0,1,0}, - {"n:",0,0,1,1,0}, - {"s:",0,0,0,1,0}, - {"V",0,0,0,1,0}, - {"W:",0,0,1,1,"8"}, - {"S",0,0,1,0,0}, - {"g",0,0,0,1,0}, - {"T:",0,0,1,0,"T"},/* GTS */ - {"7",0,0,0,1,0}, - {"v",0,0,1,0,0} +grib_option grib_options[] = { + /* {id, args, help}, on, command_line, value*/ + { "f", 0, 0, 0, 1, 0 }, + { "p:", 0, 0, 0, 1, 0 }, + { "F:", 0, 0, 1, 1, "%g" }, + { "P:", 0, 0, 0, 1, 0 }, + { "w:", 0, 0, 0, 1, 0 }, + { "n:", 0, 0, 1, 1, 0 }, + { "s:", 0, 0, 0, 1, 0 }, + { "V", 0, 0, 0, 1, 0 }, + { "W:", 0, 0, 1, 1, "8" }, + { "S", 0, 0, 1, 0, 0 }, + { "g", 0, 0, 0, 1, 0 }, + { "T:", 0, 0, 1, 0, "T" }, /* GTS */ + { "7", 0, 0, 0, 1, 0 }, + { "v", 0, 0, 1, 0, 0 } }; -const char* grib_tool_description="Get values of some keys from a GTS file." - "\n\tIt is similar to gts_ls, but fails returning an error code " - "\n\twhen an error occurs (e.g. key not found)."; -const char* grib_tool_name="gts_get"; -const char* grib_tool_usage="[options] file file ..."; +const char* grib_tool_description = + "Get values of some keys from a GTS file." + "\n\tIt is similar to gts_ls, but fails returning an error code " + "\n\twhen an error occurs (e.g. key not found)."; +const char* grib_tool_name = "gts_get"; +const char* grib_tool_usage = "[options] file file ..."; -int grib_options_count=sizeof(grib_options)/sizeof(grib_option); -int mode=0; +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); +int mode = 0; -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - return grib_tool(argc,argv); + return grib_tool(argc, argv); } int grib_tool_before_getopt(grib_runtime_options* options) { - options->print_keys_count=-1; + options->print_keys_count = -1; return 0; } int grib_tool_init(grib_runtime_options* options) { - options->print_header=0; - options->print_statistics=0; - options->default_print_width=-1; + options->print_header = 0; + options->print_statistics = 0; + options->default_print_width = -1; return 0; } -int grib_tool_new_filename_action(grib_runtime_options* options,const char* file) +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) { return 0; } -int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file) +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { return 0; } -int grib_tool_new_handle_action(grib_runtime_options* options,grib_handle* h) +int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) { int err = 0; if (!options->skip) { if (options->set_values_count != 0) { - err=grib_set_values(h,options->set_values,options->set_values_count); + err = grib_set_values(h, options->set_values, options->set_values_count); } - if (err != GRIB_SUCCESS && options->fail) exit(err); + if (err != GRIB_SUCCESS && options->fail) + exit(err); } return 0; @@ -88,9 +90,9 @@ int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) return 0; } -void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h) +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) { - grib_print_key_values(options,h); + grib_print_key_values(options, h); } int grib_tool_finalise_action(grib_runtime_options* options) @@ -100,6 +102,6 @@ int grib_tool_finalise_action(grib_runtime_options* options) int grib_no_handle_action(grib_runtime_options* options, int err) { - fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\t\t\"ERROR: unreadable message\"\n"); return 0; } diff --git a/tools/gts_ls.c b/tools/gts_ls.c index ee794f492..d41af1d0d 100644 --- a/tools/gts_ls.c +++ b/tools/gts_ls.c @@ -10,39 +10,40 @@ #include "grib_tools.h" -grib_option grib_options[]={ - /* {id, args, help}, on, command_line, value*/ - {"f",0,0,1,0,0}, - {"p:",0,0,0,1,0}, - {"F:",0,0,1,1,"%g"}, - {"P:",0,0,0,1,0}, - {"w:",0,0,0,1,0}, - /*{"j",0,"json output\n",0,1,0},*/ - {"B:",0,0,0,1,0}, - {"s:",0,0,0,1,0}, - {"n:",0,0,1,1,"ls"}, - {"V",0,0,0,1,0}, - {"W:",0,0,1,1,"10"}, - {"S",0,0,1,0,0}, - {"H",0,0,1,0,0}, - {"g",0,0,0,1,0}, - {"P",0,0,1,0,0}, - {"T:",0,0,1,0,"T"}, /* GTS */ - {"7",0,0,0,1,0}, - {"v",0,0,1,0,0} +grib_option grib_options[] = { + /* {id, args, help}, on, command_line, value*/ + { "f", 0, 0, 1, 0, 0 }, + { "p:", 0, 0, 0, 1, 0 }, + { "F:", 0, 0, 1, 1, "%g" }, + { "P:", 0, 0, 0, 1, 0 }, + { "w:", 0, 0, 0, 1, 0 }, + /*{"j",0,"json output\n",0,1,0},*/ + { "B:", 0, 0, 0, 1, 0 }, + { "s:", 0, 0, 0, 1, 0 }, + { "n:", 0, 0, 1, 1, "ls" }, + { "V", 0, 0, 0, 1, 0 }, + { "W:", 0, 0, 1, 1, "10" }, + { "S", 0, 0, 1, 0, 0 }, + { "H", 0, 0, 1, 0, 0 }, + { "g", 0, 0, 0, 1, 0 }, + { "P", 0, 0, 1, 0, 0 }, + { "T:", 0, 0, 1, 0, "T" }, /* GTS */ + { "7", 0, 0, 0, 1, 0 }, + { "v", 0, 0, 1, 0, 0 } }; -const char* grib_tool_description="List content of GTS files printing values of " - "some keys.\n\tIt does not fail when a key is not found."; -const char* grib_tool_name="gts_ls"; -const char* grib_tool_usage="[options] file file ..."; +const char* grib_tool_description = + "List content of GTS files printing values of " + "some keys.\n\tIt does not fail when a key is not found."; +const char* grib_tool_name = "gts_ls"; +const char* grib_tool_usage = "[options] file file ..."; -int grib_options_count=sizeof(grib_options)/sizeof(grib_option); -int mode=0; +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); +int mode = 0; -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - return grib_tool(argc,argv); + return grib_tool(argc, argv); } /* @@ -69,12 +70,12 @@ int grib_tool_init(grib_runtime_options* options) A new file is being parsed. The file name is file. This function is called every time a new input file name is processed, before opening the file. */ -int grib_tool_new_filename_action(grib_runtime_options* options,const char* file) +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) { return 0; } -int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file) +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { return 0; } @@ -85,13 +86,14 @@ The handle available in this function is in the set of messages satisfying the c */ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) { - int err=0; + int err = 0; if (!options->skip) { if (options->set_values_count != 0) - err=grib_set_values(h,options->set_values,options->set_values_count); + err = grib_set_values(h, options->set_values, options->set_values_count); - if( err != GRIB_SUCCESS && options->fail) exit(err); + if (err != GRIB_SUCCESS && options->fail) + exit(err); } return 0; @@ -106,9 +108,9 @@ int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) } /* key values can be printed in this function. Headers are already printed if requested.*/ -void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h) +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) { - grib_print_key_values(options,h); + grib_print_key_values(options, h); } /* this is executed after the last message in the last file is processed */ @@ -119,6 +121,6 @@ int grib_tool_finalise_action(grib_runtime_options* options) int grib_no_handle_action(grib_runtime_options* options, int err) { - fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\t\t\"ERROR: unreadable message\"\n"); return 0; } diff --git a/tools/list_keys.c b/tools/list_keys.c old mode 100755 new mode 100644 index ae78c3ec4..321d0d706 --- a/tools/list_keys.c +++ b/tools/list_keys.c @@ -10,64 +10,75 @@ #include "grib_api_internal.h" -typedef struct grib_action_if { - grib_action act; -/* Members defined in section */ -/* Members defined in if */ - grib_expression *expression; - grib_action *block_true; - grib_action *block_false; +typedef struct grib_action_if +{ + grib_action act; + /* Members defined in section */ + /* Members defined in if */ + grib_expression* expression; + grib_action* block_true; + grib_action* block_false; } grib_action_if; -typedef struct grib_action_list { - grib_action act; -/* Members defined in section */ -/* Members defined in list */ - grib_expression *expression; - grib_action *block_list; +typedef struct grib_action_list +{ + grib_action act; + /* Members defined in section */ + /* Members defined in list */ + grib_expression* expression; + grib_action* block_list; } grib_action_list; -void print_names(grib_action* a) { - while (a) { - if (a->op && !strcmp(a->op,"label") ) { a=a->next; continue; } - if (!strcmp(a->cclass->name,"action_class_noop") || - !strcmp(a->cclass->name,"action_class_when") ) - { a=a->next; continue; } +void print_names(grib_action* a) +{ + while (a) { + if (a->op && !strcmp(a->op, "label")) { + a = a->next; + continue; + } + if (!strcmp(a->cclass->name, "action_class_noop") || + !strcmp(a->cclass->name, "action_class_when")) { + a = a->next; + continue; + } - if (!strcmp(a->cclass->name,"action_class_list")) { - grib_action_list* al=(grib_action_list*)a; - printf("%s\n",a->name); - print_names(al->block_list); - } else if (!strcmp(a->cclass->name,"action_class_if")) { - grib_action_if* ai=(grib_action_if*)a; - print_names(ai->block_false); - print_names(ai->block_true); - } else { - /* printf("%s (%s %s)\n",a->name,a->op,a->cclass->name); */ - printf("%s\n",a->name); - } + if (!strcmp(a->cclass->name, "action_class_list")) { + grib_action_list* al = (grib_action_list*)a; + printf("%s\n", a->name); + print_names(al->block_list); + } + else if (!strcmp(a->cclass->name, "action_class_if")) { + grib_action_if* ai = (grib_action_if*)a; + print_names(ai->block_false); + print_names(ai->block_true); + } + else { + /* printf("%s (%s %s)\n",a->name,a->op,a->cclass->name); */ + printf("%s\n", a->name); + } - a=a->next; - } + a = a->next; + } } -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - int i = 0; - int fail = 0; + int i = 0; + int fail = 0; - grib_context* c = grib_context_get_default(); - grib_action* a=NULL; + grib_context* c = grib_context_get_default(); + grib_action* a = NULL; - for(i = 1; i < argc; i++){ - /* printf("%s ... \n",argv[i]);fflush(stdout); */ - if(!(a=grib_parse_file(c,argv[i]))) - { - fail++; - printf("FAILED\n"); - exit(1); - } else print_names(a); - } + for (i = 1; i < argc; i++) { + /* printf("%s ... \n",argv[i]);fflush(stdout); */ + if (!(a = grib_parse_file(c, argv[i]))) { + fail++; + printf("FAILED\n"); + exit(1); + } + else + print_names(a); + } - return fail; + return fail; } diff --git a/tools/load.c b/tools/load.c index b13cf97fa..6a6eb5ba4 100644 --- a/tools/load.c +++ b/tools/load.c @@ -23,170 +23,165 @@ extern FILE* load_in; extern int load_parse(); extern int yylineno; -static grib_handle *h = 0; +static grib_handle* h = 0; -static double* double_value = 0; -static size_t double_value_size = 0; +static double* double_value = 0; +static size_t double_value_size = 0; static size_t double_value_count = 0; -static long* long_value = 0; -static size_t long_value_size = 0; +static long* long_value = 0; +static size_t long_value_size = 0; static size_t long_value_count = 0; static int err; -const char *out_file; +const char* out_file; -static void check(int code,const char* name) +static void check(int code, const char* name) { - if(code) { - printf("%s: cannot set %s: %s\n",prog,name,grib_get_error_message(code)); - err++; - } + if (code) { + printf("%s: cannot set %s: %s\n", prog, name, grib_get_error_message(code)); + err++; + } } static grib_handle* handle() { - if(h == 0) - h = grib_handle_new_from_samples(NULL,"GRIB1"); - /* grib_dump_content(h,stdout,"debug",~0,NULL); */ - return h; + if (h == 0) + h = grib_handle_new_from_samples(NULL, "GRIB1"); + /* grib_dump_content(h,stdout,"debug",~0,NULL); */ + return h; } -void load_finish() { - const void* buffer; - size_t size; - assert(h); - GRIB_CHECK(grib_get_message(h,&buffer,&size),""); - - printf("%s: writing %ld bytes message\n",prog,(long)size); - - if(fwrite(buffer,1,size,fout) != size) - { - perror(out_file); - exit(1); - } - grib_handle_delete(h); - h = NULL; +void load_finish() +{ + const void* buffer; + size_t size; + assert(h); + GRIB_CHECK(grib_get_message(h, &buffer, &size), ""); + + printf("%s: writing %ld bytes message\n", prog, (long)size); + + if (fwrite(buffer, 1, size, fout) != size) { + perror(out_file); + exit(1); + } + grib_handle_delete(h); + h = NULL; } void load_missing(const char* name) -{ - printf("grib_set_missing(%s)\n",name); - check(grib_set_missing(handle(),name),name); +{ + printf("grib_set_missing(%s)\n", name); + check(grib_set_missing(handle(), name), name); } -void load_long(const char* name,long value) -{ - printf("grib_set_long(%s,%ld)\n",name,value); - check(grib_set_long(handle(),name,value),name); +void load_long(const char* name, long value) +{ + printf("grib_set_long(%s,%ld)\n", name, value); + check(grib_set_long(handle(), name, value), name); } -void load_string(const char* name,const char* value) +void load_string(const char* name, const char* value) { - size_t s = strlen(value); - printf("grib_set_string(%s,%s)\n",name,value); - check(grib_set_string(handle(),name,value,&s),name); + size_t s = strlen(value); + printf("grib_set_string(%s,%s)\n", name, value); + check(grib_set_string(handle(), name, value, &s), name); } -void load_double(const char* name,double value) +void load_double(const char* name, double value) { - printf("grib_set_double(%s,%g)\n",name,value); - check(grib_set_double(handle(),name,value),name); + printf("grib_set_double(%s,%g)\n", name, value); + check(grib_set_double(handle(), name, value), name); } -void load_start_array() { - - if(double_value == NULL) - { - double_value_size = 100000; - double_value = malloc(double_value_size*sizeof(double)); - } - - if(long_value == NULL) - { - long_value_size = 100000; - long_value = malloc(long_value_size*sizeof(long)); - } - - double_value_count = 0; - long_value_count = 0; - +void load_start_array() +{ + if (double_value == NULL) { + double_value_size = 100000; + double_value = malloc(double_value_size * sizeof(double)); + } + + if (long_value == NULL) { + long_value_size = 100000; + long_value = malloc(long_value_size * sizeof(long)); + } + + double_value_count = 0; + long_value_count = 0; } -void load_end_array(const char* name) +void load_end_array(const char* name) { - if(double_value_count == long_value_count) - { - printf("grib_set_long_array(%s,%ld)\n",name,(long)long_value_count); - check(grib_set_long_array(handle(),name,long_value,long_value_count),name); - } - else - { - printf("grib_set_double_array(%s,%ld)\n",name,(long)double_value_count); - check(grib_set_double_array(handle(),name,double_value,double_value_count),name); - } + if (double_value_count == long_value_count) { + printf("grib_set_long_array(%s,%ld)\n", name, (long)long_value_count); + check(grib_set_long_array(handle(), name, long_value, long_value_count), name); + } + else { + printf("grib_set_double_array(%s,%ld)\n", name, (long)double_value_count); + check(grib_set_double_array(handle(), name, double_value, double_value_count), name); + } } -void load_double_value(double value) { - - if(double_value_count == double_value_size) - { - double_value_size += 100000; - double_value = realloc(double_value,double_value_size*sizeof(double)); - } - - double_value[double_value_count++] = value; +void load_double_value(double value) +{ + if (double_value_count == double_value_size) { + double_value_size += 100000; + double_value = realloc(double_value, double_value_size * sizeof(double)); + } + double_value[double_value_count++] = value; } -void load_long_value(long value) { - - if(long_value_count == long_value_size) - { - long_value_size += 100000; - long_value = realloc(long_value,long_value_size*sizeof(long)); - } - - long_value[long_value_count++] = value; - - load_double_value(value); +void load_long_value(long value) +{ + if (long_value_count == long_value_size) { + long_value_size += 100000; + long_value = realloc(long_value, long_value_size * sizeof(long)); + } + long_value[long_value_count++] = value; + load_double_value(value); } - -int load_wrap() { return 1; } -int load_error(const char* msg) { printf("%s line %d\n",msg,yylineno); err = 1; return 1; } - +int load_wrap() +{ + return 1; +} +int load_error(const char* msg) +{ + printf("%s line %d\n", msg, yylineno); + err = 1; + return 1; +} -int load_file(const char* in,const char* out) +int load_file(const char* in, const char* out) { - err = 0; - fout = fopen(out,"w"); - if(!fout) { - perror(out); - return 1; - } - - load_in = fopen(in,"r"); - if(!load_in) { - perror(in); - return 1; - } - - load_parse(); - - fclose(load_in); - if(fclose(fout)) - { - perror(out); - return 1; - } - - return err; + err = 0; + fout = fopen(out, "w"); + if (!fout) { + perror(out); + return 1; + } + + load_in = fopen(in, "r"); + if (!load_in) { + perror(in); + return 1; + } + + load_parse(); + + fclose(load_in); + if (fclose(fout)) { + perror(out); + return 1; + } + + return err; } diff --git a/tools/mars_request.c b/tools/mars_request.c index eba45ce2d..aef14ee29 100644 --- a/tools/mars_request.c +++ b/tools/mars_request.c @@ -13,49 +13,47 @@ #include "grib_api.h" -static void usage(const char *prog) +static void usage(const char* prog) { - fprintf(stderr,"%s: file\n",prog); - exit(1); + fprintf(stderr, "%s: file\n", prog); + exit(1); } -int main(int argc, const char *argv[]) +int main(int argc, const char* argv[]) { - FILE *in; - int e; - grib_handle *h; + FILE* in; + int e; + grib_handle* h; - if(argc != 2) usage(argv[0]); + if (argc != 2) + usage(argv[0]); - in = fopen(argv[argc-1],"r"); - if(!in) { - perror(argv[argc-1]); - exit(1); - } + in = fopen(argv[argc - 1], "r"); + if (!in) { + perror(argv[argc - 1]); + exit(1); + } - while( (h = grib_handle_new_from_file(NULL,in,&e)) != NULL ) - { - grib_keys_iterator* i = grib_keys_iterator_new(h,GRIB_KEYS_ITERATOR_ALL_KEYS,"mars"); + while ((h = grib_handle_new_from_file(NULL, in, &e)) != NULL) { + grib_keys_iterator* i = grib_keys_iterator_new(h, GRIB_KEYS_ITERATOR_ALL_KEYS, "mars"); - while(grib_keys_iterator_next(i)) - { - char value[1024]; - size_t len = sizeof(value); - const char* name; + while (grib_keys_iterator_next(i)) { + char value[1024]; + size_t len = sizeof(value); + const char* name; - name=grib_keys_iterator_get_name(i); - GRIB_CHECK(grib_get_string(h,name,value,&len),0); + name = grib_keys_iterator_get_name(i); + GRIB_CHECK(grib_get_string(h, name, value, &len), 0); - printf("%s = %s\n",name,value); + printf("%s = %s\n", name, value); + } - } + grib_keys_iterator_delete(i); + grib_handle_delete(h); + } - grib_keys_iterator_delete(i); - grib_handle_delete(h); - } + GRIB_CHECK(e, argv[argc - 1]); - GRIB_CHECK(e,argv[argc-1]); - - return 0; + return 0; } diff --git a/tools/metar_compare.c b/tools/metar_compare.c index 05434deed..bf6da59ae 100644 --- a/tools/metar_compare.c +++ b/tools/metar_compare.c @@ -10,29 +10,41 @@ #include "grib_tools.h" -GRIB_INLINE static int grib_inline_strcmp(const char* a,const char* b) +GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b) { - if (*a != *b) return 1; - while((*a!=0 && *b!=0) && *(a) == *(b) ) {a++;b++;} - return (*a==0 && *b==0) ? 0 : 1; + if (*a != *b) + return 1; + while ((*a != 0 && *b != 0) && *(a) == *(b)) { + a++; + b++; + } + return (*a == 0 && *b == 0) ? 0 : 1; } -GRIB_INLINE static int grib_inline_rstrcmp(const char* a,const char* b) +GRIB_INLINE static int grib_inline_rstrcmp(const char* a, const char* b) { - char* p=(char*)a; - char* q=(char*)b; - while (*p != 0) p++; - while (*q != 0) q++; - q--;p--; - if (*q != *p) return 1; - while((p!=a && q!=b) && *(p) == *(q) ) {p--;q--;} - return (q==b) ? 0 : 1; + char* p = (char*)a; + char* q = (char*)b; + while (*p != 0) + p++; + while (*q != 0) + q++; + q--; + p--; + if (*q != *p) + return 1; + while ((p != a && q != b) && *(p) == *(q)) { + p--; + q--; + } + return (q == b) ? 0 : 1; } -typedef double (*compare_double_proc) (double*,double*,double*); +typedef double (*compare_double_proc)(double*, double*, double*); typedef struct grib_error grib_error; -struct grib_error { +struct grib_error +{ char* key; int count; grib_error* next; @@ -41,159 +53,162 @@ struct grib_error { grib_error* error_summary; compare_double_proc compare_double; -double global_tolerance=0; -int packingCompare=0; -grib_string_list* blacklist=0; -int compareAbsolute=1; - -static int compare_handles(grib_handle* h1,grib_handle* h2,grib_runtime_options* options); -static int compare_values(grib_runtime_options* options,grib_handle* h1,grib_handle *h2,const char *name,int type); -int error=0; -int count=0; -int lastPrint=0; -int force=0; +double global_tolerance = 0; +int packingCompare = 0; +grib_string_list* blacklist = 0; +int compareAbsolute = 1; + +static int compare_handles(grib_handle* h1, grib_handle* h2, grib_runtime_options* options); +static int compare_values(grib_runtime_options* options, grib_handle* h1, grib_handle* h2, const char* name, int type); +int error = 0; +int count = 0; +int lastPrint = 0; +int force = 0; double maxAbsoluteError = 1e-19; -int onlyListed=1; -int headerMode=0; -int morein1=0; -int morein2=0; +int onlyListed = 1; +int headerMode = 0; +int morein1 = 0; +int morein2 = 0; int listFromCommandLine; -int verbose=0; -int tolerance_factor=1; -static int write_error=0; +int verbose = 0; +int tolerance_factor = 1; +static int write_error = 0; -GRIB_INLINE static double compare_double_absolute(double *a,double *b,double *err) +GRIB_INLINE static double compare_double_absolute(double* a, double* b, double* err) { - double ret=0; - double d=fabs(*a-*b); + double ret = 0; + double d = fabs(*a - *b); if (d > *err) { - ret=d; + ret = d; } return ret; /* return fabs(*a-*b) > *err ? fabs(*a-*b) : 0; */ } -static int write_count=0; +static int write_count = 0; -static void write_message(grib_handle* h,const char* str) +static void write_message(grib_handle* h, const char* str) { - const void *m; size_t s; - char fname[1024]={0,}; + const void* m; + size_t s; + char fname[1024] = {0,}; FILE* fh; - grib_get_message(h,&m,&s); - sprintf(fname,"%s_%d.metar",str,write_count); + grib_get_message(h, &m, &s); + sprintf(fname, "%s_%d.metar", str, write_count); - fh= fopen(fname,"w"); - if(!fh) { - grib_context_log(h->context,(GRIB_LOG_ERROR)|(GRIB_LOG_PERROR), - "Error opening %s",fname); + fh = fopen(fname, "w"); + if (!fh) { + grib_context_log(h->context, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), + "Error opening %s", fname); exit(GRIB_IO_PROBLEM); } - if(fwrite(m,1,s,fh) != s) { - grib_context_log(h->context,(GRIB_LOG_ERROR)|(GRIB_LOG_PERROR), - "Error writing to %s",fname); + if (fwrite(m, 1, s, fh) != s) { + grib_context_log(h->context, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), + "Error writing to %s", fname); exit(GRIB_IO_PROBLEM); } fclose(fh); } -static void write_messages(grib_handle* h1,grib_handle* h2) +static void write_messages(grib_handle* h1, grib_handle* h2) { - if (!write_error) return; + if (!write_error) + return; write_count++; - write_message(h1,"error1"); - write_message(h2,"error2"); + write_message(h1, "error1"); + write_message(h2, "error2"); } -static double compare_double_relative(double *a,double *b,double *err) +static double compare_double_relative(double* a, double* b, double* err) { double relativeError; - if(fabs(*a) <= maxAbsoluteError || fabs(*b) <= maxAbsoluteError) - relativeError = fabs(*a-*b); + if (fabs(*a) <= maxAbsoluteError || fabs(*b) <= maxAbsoluteError) + relativeError = fabs(*a - *b); else if (fabs(*b) > fabs(*a)) - relativeError = fabs((*a-*b) / *b); + relativeError = fabs((*a - *b) / *b); else - relativeError = fabs((*a-*b) / *a); + relativeError = fabs((*a - *b) / *a); return relativeError > *err ? relativeError : 0; } static int blacklisted(const char* name) { - grib_string_list* b=blacklist; + grib_string_list* b = blacklist; while (b) { Assert(b->value); - if (!strcmp(name,b->value)) + if (!strcmp(name, b->value)) return 1; - b=b->next; + b = b->next; } return 0; } -static double relative_error(double a,double b,double err) +static double relative_error(double a, double b, double err) { double relativeError; - if(fabs(a) <= maxAbsoluteError || fabs(b) <= maxAbsoluteError) - relativeError = fabs(a-b); + if (fabs(a) <= maxAbsoluteError || fabs(b) <= maxAbsoluteError) + relativeError = fabs(a - b); else if (fabs(b) > fabs(a)) - relativeError = fabs((a-b) / b); + relativeError = fabs((a - b) / b); else - relativeError = fabs((a-b) / a); + relativeError = fabs((a - b) / a); - return relativeError ; + return relativeError; } -grib_option grib_options[]={ - /* {id, args, help}, on, command_line, value*/ - {"r",0,"Compare files in which the messages are not in the same order. This option is time expensive.\n",0,1,0}, - {"b:",0,0,0,1,0}, - {"d",0,"Write different messages on files\n",0,1,0}, - {"T:",0,0,1,0,"M"}, /* METAR */ - {"c:",0,0,0,1,0}, - {"S:","start","First field to be processed.\n",0,1,0}, - {"E:","end","Last field to be processed.\n",0,1,0}, - {"a",0,"-c option modifier. The keys listed with the option -c will be added to the list of keys compared without -c.\n",0,1,0}, - {"H",0,"Compare only message headers. Bit-by-bit compare on. Incompatible with -c option.\n",0,1,0}, - {"R:",0,0,0,1,0}, - {"A:",0,0,0,1,0}, - {"P",0,"Compare data values using the packing error as tolerance.\n",0,1,0}, - {"t:","factor","Compare data values using factor multiplied by the tolerance specified in options -P -R -A.\n",0,1,0}, - {"w:",0,0,0,1,0}, - {"f",0,0,0,1,0}, - {"F",0,0,1,0,0}, - {"q",0,0,1,0,0}, - {"I",0,0,1,0,0}, - {"V",0,0,0,1,0}, - {"7",0,0,0,1,0}, - {"v",0,0,0,1,0} +grib_option grib_options[] = { + /* {id, args, help}, on, command_line, value*/ + { "r", 0, "Compare files in which the messages are not in the same order. This option is time expensive.\n", 0, 1, 0 }, + { "b:", 0, 0, 0, 1, 0 }, + { "d", 0, "Write different messages on files\n", 0, 1, 0 }, + { "T:", 0, 0, 1, 0, "M" }, /* METAR */ + { "c:", 0, 0, 0, 1, 0 }, + { "S:", "start", "First field to be processed.\n", 0, 1, 0 }, + { "E:", "end", "Last field to be processed.\n", 0, 1, 0 }, + { "a", 0, "-c option modifier. The keys listed with the option -c will be added to the list of keys compared without -c.\n", 0, 1, 0 }, + { "H", 0, "Compare only message headers. Bit-by-bit compare on. Incompatible with -c option.\n", 0, 1, 0 }, + { "R:", 0, 0, 0, 1, 0 }, + { "A:", 0, 0, 0, 1, 0 }, + { "P", 0, "Compare data values using the packing error as tolerance.\n", 0, 1, 0 }, + { "t:", "factor", "Compare data values using factor multiplied by the tolerance specified in options -P -R -A.\n", 0, 1, 0 }, + { "w:", 0, 0, 0, 1, 0 }, + { "f", 0, 0, 0, 1, 0 }, + { "F", 0, 0, 1, 0, 0 }, + { "q", 0, 0, 1, 0, 0 }, + { "I", 0, 0, 1, 0, 0 }, + { "V", 0, 0, 0, 1, 0 }, + { "7", 0, 0, 0, 1, 0 }, + { "v", 0, 0, 0, 1, 0 } }; -grib_handle* global_handle=NULL; -int global_counter=0; -int start=-1; -int end=-1; +grib_handle* global_handle = NULL; +int global_counter = 0; +int start = -1; +int end = -1; -const char* grib_tool_description= - "Compare METAR messages contained in two files." - "\n\tIf some differences are found it fails returning an error code." - "\n\tFloating-point values are compared exactly by default, different tolerance can be defined see -P -A -R." - "\n\tDefault behaviour: absolute error=0, bit-by-bit compare, same order in files."; +const char* grib_tool_description = + "Compare METAR messages contained in two files." + "\n\tIf some differences are found it fails returning an error code." + "\n\tFloating-point values are compared exactly by default, different tolerance can be defined see -P -A -R." + "\n\tDefault behaviour: absolute error=0, bit-by-bit compare, same order in files."; -const char* grib_tool_name="metar_compare"; -const char* grib_tool_usage="[options] " - "file file"; +const char* grib_tool_name = "metar_compare"; +const char* grib_tool_usage = + "[options] " + "file file"; -int grib_options_count=sizeof(grib_options)/sizeof(grib_option); +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - return grib_tool(argc,argv); + return grib_tool(argc, argv); } int grib_tool_before_getopt(grib_runtime_options* options) @@ -203,35 +218,43 @@ int grib_tool_before_getopt(grib_runtime_options* options) int grib_tool_init(grib_runtime_options* options) { - int ret=0,i; - int nfiles=1; - char orderby[]="md5Headers"; - grib_context* context=grib_context_get_default(); + int ret = 0, i; + int nfiles = 1; + char orderby[] = "md5Headers"; + grib_context* context = grib_context_get_default(); - options->strict=1; + options->strict = 1; if (grib_options_on("S:")) - start=atoi(grib_options_get_option("S:")); + start = atoi(grib_options_get_option("S:")); if (grib_options_on("E:")) - end=atoi(grib_options_get_option("E:")); + end = atoi(grib_options_get_option("E:")); - if (grib_options_on("f")) force=1; - else force=0; + if (grib_options_on("f")) + force = 1; + else + force = 0; - if (grib_options_on("d")) write_error=1; - else write_error=0; + if (grib_options_on("d")) + write_error = 1; + else + write_error = 0; verbose = grib_options_on("v"); - listFromCommandLine=0; + listFromCommandLine = 0; if (grib_options_on("c:") || grib_options_on("e")) - listFromCommandLine=1; + listFromCommandLine = 1; - if (grib_options_on("a")) onlyListed=0; - else onlyListed=1; + if (grib_options_on("a")) + onlyListed = 0; + else + onlyListed = 1; - if (grib_options_on("H")) headerMode=1; - else headerMode=0; + if (grib_options_on("H")) + headerMode = 1; + else + headerMode = 0; if (grib_options_on("H") && grib_options_on("c:")) { printf("Error: -H and -c options are incompatible. Choose one of the two please.\n"); @@ -243,33 +266,34 @@ int grib_tool_init(grib_runtime_options* options) } if (grib_options_on("b:")) { - grib_string_list *next=0; - blacklist=(grib_string_list*)grib_context_malloc_clear(context,sizeof(grib_string_list)); - blacklist->value=grib_context_strdup(context,options->set_values[0].name); - next=blacklist; - for (i=1;iset_values_count;i++) { - next->next=(grib_string_list*)grib_context_malloc_clear(context,sizeof(grib_string_list)); - next->next->value=grib_context_strdup(context,options->set_values[i].name); - next=next->next; + grib_string_list* next = 0; + blacklist = (grib_string_list*)grib_context_malloc_clear(context, sizeof(grib_string_list)); + blacklist->value = grib_context_strdup(context, options->set_values[0].name); + next = blacklist; + for (i = 1; i < options->set_values_count; i++) { + next->next = (grib_string_list*)grib_context_malloc_clear(context, sizeof(grib_string_list)); + next->next->value = grib_context_strdup(context, options->set_values[i].name); + next = next->next; } - context->blacklist=blacklist; + context->blacklist = blacklist; } if (grib_options_on("r")) { char* filename[1]; - filename[0]=options->infile_extra->name; - options->random=1; - options->orderby=strdup(orderby); - options->idx=grib_fieldset_new_from_files(context,filename, - nfiles,0,0,0,orderby,&ret); + filename[0] = options->infile_extra->name; + options->random = 1; + options->orderby = strdup(orderby); + options->idx = grib_fieldset_new_from_files(context, filename, + nfiles, 0, 0, 0, orderby, &ret); if (ret) { printf("unable to create index for input file %s (%s)", - options->infile_extra->name,grib_get_error_message(ret)); + options->infile_extra->name, grib_get_error_message(ret)); exit(ret); } - } else { - options->random=0; - options->infile_extra->file=fopen(options->infile_extra->name,"r"); + } + else { + options->random = 0; + options->infile_extra->file = fopen(options->infile_extra->name, "r"); if (!options->infile_extra->file) { perror(options->infile_extra->name); @@ -277,38 +301,39 @@ int grib_tool_init(grib_runtime_options* options) } } - global_tolerance=0; - compare_double= &compare_double_absolute; + global_tolerance = 0; + compare_double = &compare_double_absolute; if (grib_options_on("R:")) { - global_tolerance=0; - for (i=0;itolerance_count;i++) { - if (!strcmp((options->tolerance[i]).name,"all")) { - global_tolerance=(options->tolerance[i]).double_value; + global_tolerance = 0; + for (i = 0; i < options->tolerance_count; i++) { + if (!strcmp((options->tolerance[i]).name, "all")) { + global_tolerance = (options->tolerance[i]).double_value; break; } - if (!strcmp((options->tolerance[i]).name,"global")) { - global_tolerance=(options->tolerance[i]).double_value; + if (!strcmp((options->tolerance[i]).name, "global")) { + global_tolerance = (options->tolerance[i]).double_value; break; } } - compare_double= &compare_double_relative; - compareAbsolute=0; + compare_double = &compare_double_relative; + compareAbsolute = 0; } - if (grib_options_on("A:")){ + if (grib_options_on("A:")) { if (grib_options_on("R:")) { maxAbsoluteError = atof(grib_options_get_option("A:")); - } else { - compare_double= &compare_double_absolute; + } + else { + compare_double = &compare_double_absolute; global_tolerance = atof(grib_options_get_option("A:")); } } if (grib_options_on("P")) { - packingCompare=1; - compare_double= &compare_double_absolute; + packingCompare = 1; + compare_double = &compare_double_absolute; } if (grib_options_on("t:")) - tolerance_factor=atof(grib_options_get_option("t:")); + tolerance_factor = atof(grib_options_get_option("t:")); { /* Check for 2nd file being a directory. If so, we assume user is comparing to a file */ @@ -331,100 +356,106 @@ int grib_tool_init(grib_runtime_options* options) return 0; } -int grib_tool_new_filename_action(grib_runtime_options* options,const char* file) +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) { return 0; } -int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file) +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { return 0; } static void printInfo(grib_handle* h) { - printf("== %d == DIFFERENCE == ",count); - lastPrint=count; + printf("== %d == DIFFERENCE == ", count); + lastPrint = count; } -static void print_index_key_values(grib_index* index,int counter,const char* error_message) +static void print_index_key_values(grib_index* index, int counter, const char* error_message) { - grib_index_key* keys=index->keys; - printf("== %d == ",counter); - if (error_message) printf("%s == ",error_message); + grib_index_key* keys = index->keys; + printf("== %d == ", counter); + if (error_message) + printf("%s == ", error_message); while (keys) { - printf("%s=%s ",keys->name,keys->value); - keys=keys->next; + printf("%s=%s ", keys->name, keys->value); + keys = keys->next; } printf("\n"); } static grib_handle* metar_handle_new_from_file_x( - grib_context* c,FILE* f,int mode,int headers_only,int *err) + grib_context* c, FILE* f, int mode, int headers_only, int* err) { - return codes_handle_new_from_file(c,f,PRODUCT_METAR,err); + return codes_handle_new_from_file(c, f, PRODUCT_METAR, err); } int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) { - int err=0; + int err = 0; count++; if (options->through_index) { - grib_index* idx1=options->index1; - verbose=0; + grib_index* idx1 = options->index1; + verbose = 0; global_counter++; - if ( start>0 && global_counter < start ) return 0; - if ( end>0 && global_counter > end ) { - options->stop=1; + if (start > 0 && global_counter < start) + return 0; + if (end > 0 && global_counter > end) { + options->stop = 1; return 0; } - grib_index_search_same(idx1,h); - global_handle=codes_new_from_index(idx1,CODES_METAR,&err); + grib_index_search_same(idx1, h); + global_handle = codes_new_from_index(idx1, CODES_METAR, &err); if (options->verbose) { - off_t offset=0; - char* filename=grib_get_field_file(options->index2,&offset); - printf("file1=\"%s\" ",filename); - filename=grib_get_field_file(options->index1,&offset); - printf("file2=\"%s\" \n",filename); - print_index_key_values(options->index1,global_counter,NULL); + off_t offset = 0; + char* filename = grib_get_field_file(options->index2, &offset); + printf("file1=\"%s\" ", filename); + filename = grib_get_field_file(options->index1, &offset); + printf("file2=\"%s\" \n", filename); + print_index_key_values(options->index1, global_counter, NULL); } if (!global_handle) { if (!options->verbose) - print_index_key_values(idx1,global_counter,"NOT FOUND "); + print_index_key_values(idx1, global_counter, "NOT FOUND "); } - if (!global_handle || err!= GRIB_SUCCESS ) { + if (!global_handle || err != GRIB_SUCCESS) { morein1++; - if (global_handle) grib_handle_delete(global_handle); + if (global_handle) + grib_handle_delete(global_handle); return 0; } - if(compare_handles(h,global_handle,options)) { + if (compare_handles(h, global_handle, options)) { error++; - if (!force) exit(1); + if (!force) + exit(1); } grib_handle_delete(global_handle); return 0; - - } else if (options->random) - global_handle = grib_fieldset_next_handle(options->idx,&err); + } + else if (options->random) + global_handle = grib_fieldset_next_handle(options->idx, &err); else - global_handle=metar_handle_new_from_file_x(h->context,options->infile_extra->file,options->mode,0,&err); + global_handle = metar_handle_new_from_file_x(h->context, options->infile_extra->file, options->mode, 0, &err); - if (!global_handle || err!= GRIB_SUCCESS ) { + if (!global_handle || err != GRIB_SUCCESS) { morein2++; - if (global_handle) grib_handle_delete(global_handle); + if (global_handle) + grib_handle_delete(global_handle); return 0; } - if(compare_handles(global_handle,h,options)) { + if (compare_handles(global_handle, h, options)) { error++; - if (!force) exit(1); + if (!force) + exit(1); } grib_handle_delete(global_handle); @@ -434,11 +465,11 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) { - int err=0; - if (!options->through_index && !options->random) { - global_handle=metar_new_from_file(h->context,options->infile_extra->file,&err); + int err = 0; + if (!options->through_index && !options->random) { + global_handle = metar_new_from_file(h->context, options->infile_extra->file, &err); - if (!global_handle || err!= GRIB_SUCCESS) + if (!global_handle || err != GRIB_SUCCESS) morein2++; grib_handle_delete(global_handle); @@ -450,135 +481,135 @@ int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) return 0; } -void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h) +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) { - grib_print_key_values(options,h); + grib_print_key_values(options, h); } int grib_tool_finalise_action(grib_runtime_options* options) { - grib_error* e=error_summary; - int err=0; - grib_context* c=grib_context_get_default(); + grib_error* e = error_summary; + int err = 0; + grib_context* c = grib_context_get_default(); - while ((global_handle=metar_new_from_file(c,options->infile_extra->file,&err))) { + while ((global_handle = metar_new_from_file(c, options->infile_extra->file, &err))) { morein1++; - if (global_handle) grib_handle_delete(global_handle); + if (global_handle) + grib_handle_delete(global_handle); } - error+=morein1+morein2; + error += morein1 + morein2; if (error) { printf("\n## ERRORS SUMMARY #######\n"); } - if (morein1>0) { + if (morein1 > 0) { printf("##\n## Different number of messages \n"); - printf("## %d more messages in %s than in %s\n",morein1, - options->infile_extra->name,options->infile->name); + printf("## %d more messages in %s than in %s\n", morein1, + options->infile_extra->name, options->infile->name); } - if (morein2>0) { + if (morein2 > 0) { printf("##\n## Different number of messages \n"); - printf("## %d more messages in %s than in %s\n",morein2, - options->infile->name,options->infile_extra->name); + printf("## %d more messages in %s than in %s\n", morein2, + options->infile->name, options->infile_extra->name); } if (error) { printf("##\n## Summary of different key values \n"); while (e) { - printf ("## %s ( %d different )\n",e->key,e->count); - e=e->next; + printf("## %s ( %d different )\n", e->key, e->count); + e = e->next; } - printf("##\n## %d different messages out of %d\n\n",error,count); + printf("##\n## %d different messages out of %d\n\n", error, count); } if (options->through_index) { grib_index_delete(options->index1); grib_index_delete(options->index2); } - if (error !=0) exit(1); + if (error != 0) + exit(1); return 0; } -static void save_error(grib_context* c,const char* key) +static void save_error(grib_context* c, const char* key) { - grib_error* e=0; - grib_error* next=0; - int saved=0; + grib_error* e = 0; + grib_error* next = 0; + int saved = 0; if (!error_summary) { - error_summary=(grib_error*)grib_context_malloc_clear(c,sizeof(grib_error)); - error_summary->count=1; - error_summary->key=grib_context_strdup(c,key); + error_summary = (grib_error*)grib_context_malloc_clear(c, sizeof(grib_error)); + error_summary->count = 1; + error_summary->key = grib_context_strdup(c, key); return; } - e=error_summary; - next=e; + e = error_summary; + next = e; while (next) { - if (!strcmp(next->key,key)) { + if (!strcmp(next->key, key)) { next->count++; - saved=1; + saved = 1; break; } - e=next; - next=next->next; + e = next; + next = next->next; } if (!saved) { - e->next=(grib_error*)grib_context_malloc_clear(c,sizeof(grib_error)); - e->next->count=1; - e->next->key=grib_context_strdup(c,key); + e->next = (grib_error*)grib_context_malloc_clear(c, sizeof(grib_error)); + e->next->count = 1; + e->next->key = grib_context_strdup(c, key); } } -static int compare_values(grib_runtime_options* options,grib_handle* h1,grib_handle *h2,const char *name,int type) +static int compare_values(grib_runtime_options* options, grib_handle* h1, grib_handle* h2, const char* name, int type) { size_t len1 = 0; size_t len2 = 0; - int err=0,i=0; + int err = 0, i = 0; int err1; int err2; - int type1,type2; + int type1, type2; int countdiff; - int isangle=0; - int isMissing1=0,isMissing2=0; + int isangle = 0; + int isMissing1 = 0, isMissing2 = 0; - char *sval1 = NULL,*sval2 = NULL; - unsigned char *uval1 = NULL,*uval2 = NULL; + char *sval1 = NULL, *sval2 = NULL; + unsigned char *uval1 = NULL, *uval2 = NULL; double *dval1 = NULL, *dval2 = NULL; long *lval1 = NULL, *lval2 = NULL; - double maxdiff=0; - double packingError1=0,packingError2=0; - double value_tolerance=0; - grib_context* c=h1->context; + double maxdiff = 0; + double packingError1 = 0, packingError2 = 0; + double value_tolerance = 0; + grib_context* c = h1->context; - type1=type; - type2=type; - if (verbose) printf(" comparing %s",name); + type1 = type; + type2 = type; + if (verbose) + printf(" comparing %s", name); - if( type1==GRIB_TYPE_UNDEFINED && (err = grib_get_native_type(h1,name,&type1)) != GRIB_SUCCESS) - { + if (type1 == GRIB_TYPE_UNDEFINED && (err = grib_get_native_type(h1, name, &type1)) != GRIB_SUCCESS) { printInfo(h1); - printf("Oops... cannot get type of [%s] in 1st field: %s\n",name,grib_get_error_message(err)); - save_error(c,name); + printf("Oops... cannot get type of [%s] in 1st field: %s\n", name, grib_get_error_message(err)); + save_error(c, name); return err; } - if(type2==GRIB_TYPE_UNDEFINED && (err = grib_get_native_type(h2,name,&type2)) != GRIB_SUCCESS) - { - if(err == GRIB_NOT_FOUND) - { + if (type2 == GRIB_TYPE_UNDEFINED && (err = grib_get_native_type(h2, name, &type2)) != GRIB_SUCCESS) { + if (err == GRIB_NOT_FOUND) { printInfo(h1); - printf("[%s] not found in 2nd field\n",name); - save_error(c,name); + printf("[%s] not found in 2nd field\n", name); + save_error(c, name); return err; } printInfo(h1); - printf("Oops... cannot get type of [%s] in 2nd field: %s\n",name,grib_get_error_message(err)); - save_error(c,name); + printf("Oops... cannot get type of [%s] in 2nd field: %s\n", name, grib_get_error_message(err)); + save_error(c, name); return err; } @@ -592,34 +623,31 @@ static int compare_values(grib_runtime_options* options,grib_handle* h1,grib_han } */ - if(type1 == GRIB_TYPE_LABEL) + if (type1 == GRIB_TYPE_LABEL) return err; - if(type1 == GRIB_TYPE_SECTION) + if (type1 == GRIB_TYPE_SECTION) return err; - if((err = grib_get_size(h1,name,&len1)) != GRIB_SUCCESS) - { + if ((err = grib_get_size(h1, name, &len1)) != GRIB_SUCCESS) { printInfo(h1); - printf("Oops... cannot get size of [%s] in 1st field: %s\n",name,grib_get_error_message(err)); - save_error(c,name); + printf("Oops... cannot get size of [%s] in 1st field: %s\n", name, grib_get_error_message(err)); + save_error(c, name); return err; } - if((err = grib_get_size(h2,name,&len2)) != GRIB_SUCCESS) - { - if(err == GRIB_NOT_FOUND) - { + if ((err = grib_get_size(h2, name, &len2)) != GRIB_SUCCESS) { + if (err == GRIB_NOT_FOUND) { printInfo(h1); - printf("[%s] not found in 2nd field\n",name); - save_error(c,name); + printf("[%s] not found in 2nd field\n", name); + save_error(c, name); return err; } printInfo(h1); - printf("Oops... cannot get size of [%s] in 2nd field: %s\n",name,grib_get_error_message(err)); - save_error(c,name); + printf("Oops... cannot get size of [%s] in 2nd field: %s\n", name, grib_get_error_message(err)); + save_error(c, name); return err; } @@ -635,363 +663,381 @@ static int compare_values(grib_runtime_options* options,grib_handle* h1,grib_han if (options->mode != MODE_METAR) { /* TODO: Ignore missing values for keys in METAR. Not yet implemented */ - isMissing1= ( (grib_is_missing(h1,name,&err1)==1) && (err1 == 0) ) ? 1 : 0; - isMissing2= ( (grib_is_missing(h2,name,&err2)==1) && (err2 == 0) ) ? 1 : 0; + isMissing1 = ((grib_is_missing(h1, name, &err1) == 1) && (err1 == 0)) ? 1 : 0; + isMissing2 = ((grib_is_missing(h2, name, &err2) == 1) && (err2 == 0)) ? 1 : 0; } - if ((isMissing1==1) && (isMissing2==1)) { - if (verbose) printf(" is set to missing in both fields\n"); + if ((isMissing1 == 1) && (isMissing2 == 1)) { + if (verbose) + printf(" is set to missing in both fields\n"); return GRIB_SUCCESS; } - if (isMissing1==1) { - if (verbose) printf(" is set to missing in 1st field\n"); + if (isMissing1 == 1) { + if (verbose) + printf(" is set to missing in 1st field\n"); printInfo(h1); - printf("%s is set to missing in 1st field is not missing in 2nd field\n",name); + printf("%s is set to missing in 1st field is not missing in 2nd field\n", name); err1 = GRIB_VALUE_MISMATCH; - save_error(c,name); + save_error(c, name); return GRIB_VALUE_MISMATCH; } - if (isMissing2==1) { - if (verbose) printf(" is set to missing in 1st field\n"); + if (isMissing2 == 1) { + if (verbose) + printf(" is set to missing in 1st field\n"); printInfo(h1); - printf("%s is set to missing in 2nd field is not missing in 1st field\n",name); + printf("%s is set to missing in 2nd field is not missing in 1st field\n", name); err1 = GRIB_VALUE_MISMATCH; - save_error(c,name); + save_error(c, name); return GRIB_VALUE_MISMATCH; } - switch(type1) - { - case GRIB_TYPE_STRING: - if (verbose) printf(" as string\n"); - grib_get_string_length(h1,name,&len1); - grib_get_string_length(h2,name,&len2); - sval1 = (char*)grib_context_malloc(h1->context,len1*sizeof(char)); - sval2 = (char*)grib_context_malloc(h2->context,len2*sizeof(char)); - - if((err1 = grib_get_string(h1,name,sval1,&len1)) != GRIB_SUCCESS) - { - printInfo(h1); - printf("Oops... cannot get string value of [%s] in 1st field: %s\n", - name,grib_get_error_message(err1)); - save_error(c,name); - } - - if((err2 = grib_get_string(h2,name,sval2,&len2)) != GRIB_SUCCESS) - { - printInfo(h1); - printf("Oops... cannot get string value of [%s] in 2nd field: %s\n", - name,grib_get_error_message(err2)); - save_error(c,name); - } + switch (type1) { + case GRIB_TYPE_STRING: + if (verbose) + printf(" as string\n"); + grib_get_string_length(h1, name, &len1); + grib_get_string_length(h2, name, &len2); + sval1 = (char*)grib_context_malloc(h1->context, len1 * sizeof(char)); + sval2 = (char*)grib_context_malloc(h2->context, len2 * sizeof(char)); - if(err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS) - { - if(grib_inline_strcmp(sval1,sval2) != 0) - { + if ((err1 = grib_get_string(h1, name, sval1, &len1)) != GRIB_SUCCESS) { printInfo(h1); - printf("string [%s]: [%s] != [%s]\n", - name,sval1,sval2); - err1 = GRIB_VALUE_MISMATCH; - save_error(c,name); + printf("Oops... cannot get string value of [%s] in 1st field: %s\n", + name, grib_get_error_message(err1)); + save_error(c, name); } - } - grib_context_free(h1->context,sval1); - grib_context_free(h2->context,sval2); + if ((err2 = grib_get_string(h2, name, sval2, &len2)) != GRIB_SUCCESS) { + printInfo(h1); + printf("Oops... cannot get string value of [%s] in 2nd field: %s\n", + name, grib_get_error_message(err2)); + save_error(c, name); + } - if(err1) return err1; - if(err2) return err2; + if (err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS) { + if (grib_inline_strcmp(sval1, sval2) != 0) { + printInfo(h1); + printf("string [%s]: [%s] != [%s]\n", + name, sval1, sval2); + err1 = GRIB_VALUE_MISMATCH; + save_error(c, name); + } + } - break; + grib_context_free(h1->context, sval1); + grib_context_free(h2->context, sval2); - case GRIB_TYPE_LONG: - if (verbose) printf(" as long\n"); + if (err1) + return err1; + if (err2) + return err2; - lval1 = (long*)grib_context_malloc(h1->context,len1*sizeof(long)); - lval2 = (long*)grib_context_malloc(h2->context,len2*sizeof(long)); + break; - if((err1 = grib_get_long_array(h1,name,lval1,&len1)) != GRIB_SUCCESS) - { - printInfo(h1); - printf("Oops... cannot get long value of [%s] in 1st field: %s\n", - name,grib_get_error_message(err1)); - save_error(c,name); - } + case GRIB_TYPE_LONG: + if (verbose) + printf(" as long\n"); - if((err2 = grib_get_long_array(h2,name,lval2,&len2)) != GRIB_SUCCESS) - { - printInfo(h1); - printf("Oops... cannot get long value of [%s] in 2nd field: %s\n", - name,grib_get_error_message(err2)); - save_error(c,name); - } + lval1 = (long*)grib_context_malloc(h1->context, len1 * sizeof(long)); + lval2 = (long*)grib_context_malloc(h2->context, len2 * sizeof(long)); - if(err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS && len1!=len2) - { - printInfo(h1); - printf("Different size for \"%s\" [%ld] [%ld]\n",name,(long)len1,(long)len2); - err1=GRIB_INTERNAL_ERROR; - save_error(c,name); - } - if(err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS && len1==len2) - { - countdiff=0; - for(i = 0; i < len1; i++) - if(lval1[i] != lval2[i]) countdiff++; + if ((err1 = grib_get_long_array(h1, name, lval1, &len1)) != GRIB_SUCCESS) { + printInfo(h1); + printf("Oops... cannot get long value of [%s] in 1st field: %s\n", + name, grib_get_error_message(err1)); + save_error(c, name); + } - if (countdiff) { + if ((err2 = grib_get_long_array(h2, name, lval2, &len2)) != GRIB_SUCCESS) { printInfo(h1); - save_error(c,name); - err1 = GRIB_VALUE_MISMATCH; - if(len1 == 1) - printf("long [%s]: [%ld] != [%ld]\n", - name,*lval1,*lval2); - else - printf("long [%s] %d out of %ld different\n", - name,countdiff,(long)len1); + printf("Oops... cannot get long value of [%s] in 2nd field: %s\n", + name, grib_get_error_message(err2)); + save_error(c, name); } - } + if (err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS && len1 != len2) { + printInfo(h1); + printf("Different size for \"%s\" [%ld] [%ld]\n", name, (long)len1, (long)len2); + err1 = GRIB_INTERNAL_ERROR; + save_error(c, name); + } + if (err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS && len1 == len2) { + countdiff = 0; + for (i = 0; i < len1; i++) + if (lval1[i] != lval2[i]) + countdiff++; + + if (countdiff) { + printInfo(h1); + save_error(c, name); + err1 = GRIB_VALUE_MISMATCH; + if (len1 == 1) + printf("long [%s]: [%ld] != [%ld]\n", + name, *lval1, *lval2); + else + printf("long [%s] %d out of %ld different\n", + name, countdiff, (long)len1); + } + } - grib_context_free(h1->context,lval1); - grib_context_free(h2->context,lval2); - if(err1) return err1; - if(err2) return err2; - break; + grib_context_free(h1->context, lval1); + grib_context_free(h2->context, lval2); - case GRIB_TYPE_DOUBLE: - if (verbose) printf(" as double\n"); - dval1 = (double*)grib_context_malloc(h1->context,len1*sizeof(double)); - dval2 = (double*)grib_context_malloc(h2->context,len2*sizeof(double)); + if (err1) + return err1; + if (err2) + return err2; + break; - isangle=0; - value_tolerance=global_tolerance; - if (!grib_inline_strcmp(name,"packedValues") || !grib_inline_strcmp(name,"values") - || !grib_inline_strcmp(name,"codedValues")) { - packingError1=0; - packingError2=0; - err1=grib_get_double(h1,"packingError",&packingError1); - err2=grib_get_double(h2,"packingError",&packingError2); - if (packingCompare) + case GRIB_TYPE_DOUBLE: + if (verbose) + printf(" as double\n"); + dval1 = (double*)grib_context_malloc(h1->context, len1 * sizeof(double)); + dval2 = (double*)grib_context_malloc(h2->context, len2 * sizeof(double)); + + isangle = 0; + value_tolerance = global_tolerance; + if (!grib_inline_strcmp(name, "packedValues") || !grib_inline_strcmp(name, "values") || !grib_inline_strcmp(name, "codedValues")) { + packingError1 = 0; + packingError2 = 0; + err1 = grib_get_double(h1, "packingError", &packingError1); + err2 = grib_get_double(h2, "packingError", &packingError2); + if (packingCompare) + value_tolerance = packingError1 > packingError2 ? packingError1 : packingError2; + } + else if (!grib_inline_strcmp(name, "unpackedValues")) { + packingError1 = 0; + packingError2 = 0; + err1 = grib_get_double(h1, "unpackedError", &packingError1); + err2 = grib_get_double(h2, "unpackedError", &packingError2); + if (packingCompare) + value_tolerance = packingError1 > packingError2 ? packingError1 : packingError2; + } + else if (!grib_inline_rstrcmp(name, "InDegrees")) { + packingError1 = 0.0005; + packingError2 = 0.0005; + isangle = 1; value_tolerance = packingError1 > packingError2 ? packingError1 : packingError2; - } else if (!grib_inline_strcmp(name,"unpackedValues") ) { - packingError1=0; - packingError2=0; - err1=grib_get_double(h1,"unpackedError",&packingError1); - err2=grib_get_double(h2,"unpackedError",&packingError2); - if (packingCompare) + } + else if (!grib_inline_strcmp(name, "referenceValue")) { + packingError1 = 0; + packingError2 = 0; + err1 = grib_get_double(h1, "referenceValueError", &packingError1); + err2 = grib_get_double(h2, "referenceValueError", &packingError2); value_tolerance = packingError1 > packingError2 ? packingError1 : packingError2; - } else if ( !grib_inline_rstrcmp(name,"InDegrees")) { - packingError1=0.0005; - packingError2=0.0005; - isangle=1; - value_tolerance = packingError1 > packingError2 ? packingError1 : packingError2; - } else if (!grib_inline_strcmp(name,"referenceValue") ) { - packingError1=0; - packingError2=0; - err1=grib_get_double(h1,"referenceValueError",&packingError1); - err2=grib_get_double(h2,"referenceValueError",&packingError2); - value_tolerance = packingError1 > packingError2 ? packingError1 : packingError2; - } + } - if (!compareAbsolute) { - for (i=0;itolerance_count;i++) { - if (!strcmp((options->tolerance[i]).name,name)) { - value_tolerance=(options->tolerance[i]).double_value; - break; + if (!compareAbsolute) { + for (i = 0; i < options->tolerance_count; i++) { + if (!strcmp((options->tolerance[i]).name, name)) { + value_tolerance = (options->tolerance[i]).double_value; + break; + } } } - } - if((err1 = grib_get_double_array(h1,name,dval1,&len1)) != GRIB_SUCCESS) - { - printInfo(h1); - printf("Oops... cannot get double value of [%s] in 1st field: %s\n", - name,grib_get_error_message(err1)); - save_error(c,name); - } + if ((err1 = grib_get_double_array(h1, name, dval1, &len1)) != GRIB_SUCCESS) { + printInfo(h1); + printf("Oops... cannot get double value of [%s] in 1st field: %s\n", + name, grib_get_error_message(err1)); + save_error(c, name); + } - if((err2 = grib_get_double_array(h2,name,dval2,&len2)) != GRIB_SUCCESS) - { - printInfo(h1); - printf("Oops... cannot get double value of [%s] in 2nd field: %s\n", - name,grib_get_error_message(err2)); - save_error(c,name); - } + if ((err2 = grib_get_double_array(h2, name, dval2, &len2)) != GRIB_SUCCESS) { + printInfo(h1); + printf("Oops... cannot get double value of [%s] in 2nd field: %s\n", + name, grib_get_error_message(err2)); + save_error(c, name); + } - if(err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS && len1!=len2) - { - printInfo(h1); - printf("Different size for \"%s\" [%ld] [%ld]\n",name,(long)len1,(long)len2); - save_error(c,name); - } - if(err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS && len1==len2) - { - int imaxdiff; - double diff; - double *pv1,*pv2,dnew1,dnew2; - maxdiff=0; - imaxdiff=0; - countdiff=0; - pv1=dval1; - pv2=dval2; - if (isangle) { - dnew1=*dval1; dnew2=*dval2; - pv1=&dnew1; pv2=&dnew2; - if (*dval1 < 0 ) dnew1 += 360.0 ; - if (*dval2 < 0 ) dnew2 += 360.0 ; - if (*dval1 > 360 ) dnew1 -= 360.0 ; - if (*dval2 > 360 ) dnew2 -= 360.0 ; + if (err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS && len1 != len2) { + printInfo(h1); + printf("Different size for \"%s\" [%ld] [%ld]\n", name, (long)len1, (long)len2); + save_error(c, name); } - value_tolerance*=tolerance_factor; - if (verbose) printf(" (%d values) tolerance=%g\n",(int)len1,value_tolerance); - for(i = 0; i < len1; i++) { - if((diff=compare_double(pv1++,pv2++,&value_tolerance))!=0) { - countdiff++; - if (maxdiff < diff) {maxdiff=diff;imaxdiff=i;} - err1 = GRIB_VALUE_MISMATCH; + if (err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS && len1 == len2) { + int imaxdiff; + double diff; + double *pv1, *pv2, dnew1, dnew2; + maxdiff = 0; + imaxdiff = 0; + countdiff = 0; + pv1 = dval1; + pv2 = dval2; + if (isangle) { + dnew1 = *dval1; + dnew2 = *dval2; + pv1 = &dnew1; + pv2 = &dnew2; + if (*dval1 < 0) + dnew1 += 360.0; + if (*dval2 < 0) + dnew2 += 360.0; + if (*dval1 > 360) + dnew1 -= 360.0; + if (*dval2 > 360) + dnew2 -= 360.0; + } + value_tolerance *= tolerance_factor; + if (verbose) + printf(" (%d values) tolerance=%g\n", (int)len1, value_tolerance); + for (i = 0; i < len1; i++) { + if ((diff = compare_double(pv1++, pv2++, &value_tolerance)) != 0) { + countdiff++; + if (maxdiff < diff) { + maxdiff = diff; + imaxdiff = i; + } + err1 = GRIB_VALUE_MISMATCH; + } } - } - if (countdiff) { - printInfo(h1); - save_error(c,name); - if (len1>1) { - printf("double [%s]: %d out of %ld different\n",name,countdiff,(long)len1); - if (compareAbsolute) printf(" max"); - printf(" absolute diff. = %.16e,",fabs(dval1[imaxdiff]-dval2[imaxdiff])); - if (!compareAbsolute) printf(" max"); - printf(" relative diff. = %g",relative_error(dval1[imaxdiff],dval2[imaxdiff],value_tolerance)); - printf("\n\tmax diff. element %d: %.20e %.20e", - imaxdiff,dval1[imaxdiff],dval2[imaxdiff]); - printf("\n\ttolerance=%.16e",value_tolerance); - if (packingError2!=0 || packingError1!=0) - printf(" packingError: [%g] [%g]",packingError1,packingError2); - - if (!grib_inline_strcmp(name,"packedValues") || !grib_inline_strcmp(name,"values") - || !grib_inline_strcmp(name,"codedValues")) { - double max1,min1,max2,min2; - grib_get_double(h1,"max",&max1); - grib_get_double(h1,"min",&min1); - grib_get_double(h2,"max",&max2); - grib_get_double(h2,"min",&min2); - printf("\n\tvalues max= [%g] [%g] min= [%g] [%g]",max1,max2,min1,min2); + if (countdiff) { + printInfo(h1); + save_error(c, name); + if (len1 > 1) { + printf("double [%s]: %d out of %ld different\n", name, countdiff, (long)len1); + if (compareAbsolute) + printf(" max"); + printf(" absolute diff. = %.16e,", fabs(dval1[imaxdiff] - dval2[imaxdiff])); + if (!compareAbsolute) + printf(" max"); + printf(" relative diff. = %g", relative_error(dval1[imaxdiff], dval2[imaxdiff], value_tolerance)); + printf("\n\tmax diff. element %d: %.20e %.20e", + imaxdiff, dval1[imaxdiff], dval2[imaxdiff]); + printf("\n\ttolerance=%.16e", value_tolerance); + if (packingError2 != 0 || packingError1 != 0) + printf(" packingError: [%g] [%g]", packingError1, packingError2); + + if (!grib_inline_strcmp(name, "packedValues") || !grib_inline_strcmp(name, "values") || !grib_inline_strcmp(name, "codedValues")) { + double max1, min1, max2, min2; + grib_get_double(h1, "max", &max1); + grib_get_double(h1, "min", &min1); + grib_get_double(h2, "max", &max2); + grib_get_double(h2, "min", &min2); + printf("\n\tvalues max= [%g] [%g] min= [%g] [%g]", max1, max2, min1, min2); + } + printf("\n"); + } + else { + printf("double [%s]: [%.20e] != [%.20e]\n", + name, dval1[0], dval2[0]); + printf("\tabsolute diff. = %g,", fabs(dval1[0] - dval2[0])); + printf(" relative diff. = %g\n", relative_error(dval1[0], dval2[0], value_tolerance)); + printf("\ttolerance=%g\n", value_tolerance); } - printf("\n"); - } else { - printf("double [%s]: [%.20e] != [%.20e]\n", - name,dval1[0],dval2[0]); - printf("\tabsolute diff. = %g,",fabs(dval1[0]-dval2[0])); - printf(" relative diff. = %g\n",relative_error(dval1[0],dval2[0],value_tolerance)); - printf("\ttolerance=%g\n",value_tolerance); } } - } - - grib_context_free(h1->context,dval1); - grib_context_free(h2->context,dval2); - if(err1) return err1; - if(err2) return err2; - break; + grib_context_free(h1->context, dval1); + grib_context_free(h2->context, dval2); - case GRIB_TYPE_BYTES: - if (verbose) printf(" as bytes\n"); - if (options->mode==MODE_METAR) return 0; - if (len1<2) len1=512; - if (len2<2) len2=512; - uval1 = (unsigned char*)grib_context_malloc(h1->context,len1*sizeof(unsigned char)); - uval2 = (unsigned char*)grib_context_malloc(h2->context,len2*sizeof(unsigned char)); - - if((err1 = grib_get_bytes(h1,name,uval1,&len1)) != GRIB_SUCCESS) - { - printInfo(h1); - save_error(c,name); - printf("Oops... cannot get bytes value of [%s] in 1st field: %s\n", - name,grib_get_error_message(err1)); - } + if (err1) + return err1; + if (err2) + return err2; + break; - if((err2 = grib_get_bytes(h2,name,uval2,&len2)) != GRIB_SUCCESS) - { - printInfo(h1); - save_error(c,name); - printf("Oops... cannot get bytes value of [%s] in 2nd field: %s\n", - name,grib_get_error_message(err2)); - } + case GRIB_TYPE_BYTES: + if (verbose) + printf(" as bytes\n"); + if (options->mode == MODE_METAR) + return 0; + if (len1 < 2) + len1 = 512; + if (len2 < 2) + len2 = 512; + uval1 = (unsigned char*)grib_context_malloc(h1->context, len1 * sizeof(unsigned char)); + uval2 = (unsigned char*)grib_context_malloc(h2->context, len2 * sizeof(unsigned char)); + + if ((err1 = grib_get_bytes(h1, name, uval1, &len1)) != GRIB_SUCCESS) { + printInfo(h1); + save_error(c, name); + printf("Oops... cannot get bytes value of [%s] in 1st field: %s\n", + name, grib_get_error_message(err1)); + } - if(err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS) - { - if(memcmp(uval1,uval2,len1) != 0) - { - for(i = 0; i < len1; i++) - if(uval1[i] != uval2[i]) - { - printInfo(h1); - save_error(c,name); - if(len1 == 1) - printf("[%s] byte values are different: [%02x] and [%02x]\n", - name,uval1[i],uval2[i]); - else - printf("[%s] byte value %d of %ld are different: [%02x] and [%02x]\n", - name,i,(long)len1,uval1[i],uval2[i]); + if ((err2 = grib_get_bytes(h2, name, uval2, &len2)) != GRIB_SUCCESS) { + printInfo(h1); + save_error(c, name); + printf("Oops... cannot get bytes value of [%s] in 2nd field: %s\n", + name, grib_get_error_message(err2)); + } - err1 = GRIB_VALUE_MISMATCH; - break; - } - err1 = GRIB_VALUE_MISMATCH; + if (err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS) { + if (memcmp(uval1, uval2, len1) != 0) { + for (i = 0; i < len1; i++) + if (uval1[i] != uval2[i]) { + printInfo(h1); + save_error(c, name); + if (len1 == 1) + printf("[%s] byte values are different: [%02x] and [%02x]\n", + name, uval1[i], uval2[i]); + else + printf("[%s] byte value %d of %ld are different: [%02x] and [%02x]\n", + name, i, (long)len1, uval1[i], uval2[i]); + + err1 = GRIB_VALUE_MISMATCH; + break; + } + err1 = GRIB_VALUE_MISMATCH; + } } - } - grib_context_free(h1->context,uval1); - grib_context_free(h2->context,uval2); + grib_context_free(h1->context, uval1); + grib_context_free(h2->context, uval2); - if(err1) return err1; - if(err2) return err2; - break; + if (err1) + return err1; + if (err2) + return err2; + break; - case GRIB_TYPE_LABEL: - if (verbose) printf(" as label\n"); - break; + case GRIB_TYPE_LABEL: + if (verbose) + printf(" as label\n"); + break; - default: - if (verbose) printf("\n"); - printInfo(h1); - save_error(c,name); - printf("Cannot compare [%s], unsupported type %d\n",name,type1); - return GRIB_UNABLE_TO_COMPARE_ACCESSORS; - break; + default: + if (verbose) + printf("\n"); + printInfo(h1); + save_error(c, name); + printf("Cannot compare [%s], unsupported type %d\n", name, type1); + return GRIB_UNABLE_TO_COMPARE_ACCESSORS; + break; } return GRIB_SUCCESS; } -static int compare_all_dump_keys(grib_handle* h1,grib_handle* h2,grib_runtime_options* options,int *err) +static int compare_all_dump_keys(grib_handle* h1, grib_handle* h2, grib_runtime_options* options, int* err) { - int ret=0; - const char* name=NULL; - grib_keys_iterator* iter = grib_keys_iterator_new(h1,0,NULL); + int ret = 0; + const char* name = NULL; + grib_keys_iterator* iter = grib_keys_iterator_new(h1, 0, NULL); if (!iter) { printf("ERROR: unable to get iterator\n"); exit(1); } - while(grib_keys_iterator_next(iter)) - { - grib_accessor* xa=grib_keys_iterator_get_accessor(iter); - name=grib_keys_iterator_get_name(iter); + while (grib_keys_iterator_next(iter)) { + grib_accessor* xa = grib_keys_iterator_get_accessor(iter); + name = grib_keys_iterator_get_name(iter); /* printf("----- comparing %s\n",name); */ - if (blacklisted(name)) continue; - if (xa==NULL || ( xa->flags & GRIB_ACCESSOR_FLAG_DUMP )==0 ) continue; - if(compare_values(options,h1,h2,name,GRIB_TYPE_UNDEFINED)) { + if (blacklisted(name)) + continue; + if (xa == NULL || (xa->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) + continue; + if (compare_values(options, h1, h2, name, GRIB_TYPE_UNDEFINED)) { err++; - write_messages(h1,h2); - ret=1; + write_messages(h1, h2); + ret = 1; } } @@ -999,53 +1045,53 @@ static int compare_all_dump_keys(grib_handle* h1,grib_handle* h2,grib_runtime_op return ret; } -static int compare_handles(grib_handle* h1,grib_handle* h2,grib_runtime_options* options) +static int compare_handles(grib_handle* h1, grib_handle* h2, grib_runtime_options* options) { - int err = 0; - int i=0; - grib_keys_iterator* iter = NULL; - const char* name=NULL; + int err = 0; + int i = 0; + grib_keys_iterator* iter = NULL; + const char* name = NULL; /* mask only if no -c option or headerMode (-H)*/ - if (blacklist && ( !listFromCommandLine || headerMode )) { - grib_string_list* nextb=blacklist; + if (blacklist && (!listFromCommandLine || headerMode)) { + grib_string_list* nextb = blacklist; while (nextb) { - grib_clear(h1,nextb->value); - grib_clear(h2,nextb->value); - nextb=nextb->next; + grib_clear(h1, nextb->value); + grib_clear(h2, nextb->value); + nextb = nextb->next; } } if (headerMode) { - const void *msg1=NULL,*msg2=NULL; - size_t size1=0,size2=0; + const void *msg1 = NULL, *msg2 = NULL; + size_t size1 = 0, size2 = 0; grib_handle *h11, *h22; - GRIB_CHECK_NOLINE(grib_get_message_headers(h1,&msg1,&size1),0); - GRIB_CHECK_NOLINE(grib_get_message_headers(h2,&msg2,&size2),0); - if (size1==size2 && !memcmp(msg1,msg2,size1)) + GRIB_CHECK_NOLINE(grib_get_message_headers(h1, &msg1, &size1), 0); + GRIB_CHECK_NOLINE(grib_get_message_headers(h2, &msg2, &size2), 0); + if (size1 == size2 && !memcmp(msg1, msg2, size1)) return 0; - err=0; - h11=grib_handle_new_from_partial_message(h1->context,msg1,size1); - h22=grib_handle_new_from_partial_message(h1->context,msg2,size2); + err = 0; + h11 = grib_handle_new_from_partial_message(h1->context, msg1, size1); + h22 = grib_handle_new_from_partial_message(h1->context, msg2, size2); - iter=grib_keys_iterator_new(h11, - GRIB_KEYS_ITERATOR_SKIP_COMPUTED,NULL); + iter = grib_keys_iterator_new(h11, + GRIB_KEYS_ITERATOR_SKIP_COMPUTED, NULL); if (!iter) { printf("ERROR: unable to get iterator\n"); exit(1); } - while(grib_keys_iterator_next(iter)) - { - name=grib_keys_iterator_get_name(iter); + while (grib_keys_iterator_next(iter)) { + name = grib_keys_iterator_get_name(iter); /*printf("----- comparing %s\n",name);*/ - if (blacklisted(name)) continue; - if(compare_values(options,h11,h22,name,GRIB_TYPE_UNDEFINED)) { + if (blacklisted(name)) + continue; + if (compare_values(options, h11, h22, name, GRIB_TYPE_UNDEFINED)) { err++; - write_messages(h11,h22); + write_messages(h11, h22); } } @@ -1055,43 +1101,46 @@ static int compare_handles(grib_handle* h1,grib_handle* h2,grib_runtime_options* return err; } - if ( listFromCommandLine && onlyListed ) { - for (i=0; i< options->compare_count; i++) { - if (blacklisted((char*)options->compare[i].name)) continue; + if (listFromCommandLine && onlyListed) { + for (i = 0; i < options->compare_count; i++) { + if (blacklisted((char*)options->compare[i].name)) + continue; if (options->compare[i].type == GRIB_NAMESPACE) { - iter=grib_keys_iterator_new(h1,0,options->compare[i].name); + iter = grib_keys_iterator_new(h1, 0, options->compare[i].name); if (!iter) { printf("ERROR: unable to get iterator\n"); exit(1); } - while(grib_keys_iterator_next(iter)) - { - name=grib_keys_iterator_get_name(iter); + while (grib_keys_iterator_next(iter)) { + name = grib_keys_iterator_get_name(iter); /*printf("----- comparing %s\n",name);*/ - if (blacklisted(name)) continue; - if(compare_values(options,h1,h2,name,GRIB_TYPE_UNDEFINED)) { + if (blacklisted(name)) + continue; + if (compare_values(options, h1, h2, name, GRIB_TYPE_UNDEFINED)) { err++; - write_messages(h1,h2); + write_messages(h1, h2); } } grib_keys_iterator_delete(iter); - } else { - if( compare_values(options,h1,h2,options->compare[i].name,options->compare[i].type)) + } + else { + if (compare_values(options, h1, h2, options->compare[i].name, options->compare[i].type)) err++; - write_messages(h1,h2); + write_messages(h1, h2); } } - } else { - const void *msg1=NULL,*msg2=NULL; - size_t size1=0,size2=0; - int memcmp_ret=0; + } + else { + const void *msg1 = NULL, *msg2 = NULL; + size_t size1 = 0, size2 = 0; + int memcmp_ret = 0; /* int ii=0; */ - GRIB_CHECK_NOLINE(grib_get_message(h1,&msg1,&size1),0); - GRIB_CHECK_NOLINE(grib_get_message(h2,&msg2,&size2),0); - if (size1==size2 && !(memcmp_ret=memcmp(msg1,msg2,size1))) { + GRIB_CHECK_NOLINE(grib_get_message(h1, &msg1, &size1), 0); + GRIB_CHECK_NOLINE(grib_get_message(h2, &msg2, &size2), 0); + if (size1 == size2 && !(memcmp_ret = memcmp(msg1, msg2, size1))) { return 0; - } + } #if 0 else { int lcount=count,ii; @@ -1115,42 +1164,45 @@ static int compare_handles(grib_handle* h1,grib_handle* h2,grib_runtime_options* #endif - if ( listFromCommandLine ) { - for (i=0; i< options->compare_count; i++) { - if (blacklisted(name)) continue; + if (listFromCommandLine) { + for (i = 0; i < options->compare_count; i++) { + if (blacklisted(name)) + continue; if (options->compare[i].type == GRIB_NAMESPACE) { - iter=grib_keys_iterator_new(h1,0,options->compare[i].name); + iter = grib_keys_iterator_new(h1, 0, options->compare[i].name); if (!iter) { - printf("ERROR: unable to get iterator for %s\n",options->compare[i].name ); + printf("ERROR: unable to get iterator for %s\n", options->compare[i].name); exit(1); } - while(grib_keys_iterator_next(iter)) - { - name=grib_keys_iterator_get_name(iter); + while (grib_keys_iterator_next(iter)) { + name = grib_keys_iterator_get_name(iter); /*printf("----- comparing %s\n",name);*/ - if (blacklisted(name)) continue; - if(compare_values(options,h1,h2,name,GRIB_TYPE_UNDEFINED)) { + if (blacklisted(name)) + continue; + if (compare_values(options, h1, h2, name, GRIB_TYPE_UNDEFINED)) { err++; - write_messages(h1,h2); - if (compare_all_dump_keys(h1,h2,options,&err)) { + write_messages(h1, h2); + if (compare_all_dump_keys(h1, h2, options, &err)) { err++; } } } grib_keys_iterator_delete(iter); - } else { - if( compare_values(options,h1,h2,options->compare[i].name,options->compare[i].type)) { + } + else { + if (compare_values(options, h1, h2, options->compare[i].name, options->compare[i].type)) { err++; - write_messages(h1,h2); - if (compare_all_dump_keys(h1,h2,options,&err)) { + write_messages(h1, h2); + if (compare_all_dump_keys(h1, h2, options, &err)) { err++; } } } } - } else { - if (compare_all_dump_keys(h1,h2,options,&err)) { + } + else { + if (compare_all_dump_keys(h1, h2, options, &err)) { err++; } } @@ -1160,6 +1212,6 @@ static int compare_handles(grib_handle* h1,grib_handle* h2,grib_runtime_options* int grib_no_handle_action(grib_runtime_options* options, int err) { - fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\t\t\"ERROR: unreadable message\"\n"); return 0; } diff --git a/tools/metar_copy.c b/tools/metar_copy.c index f88bd2c92..cbbbb8e93 100644 --- a/tools/metar_copy.c +++ b/tools/metar_copy.c @@ -10,41 +10,43 @@ #include "grib_tools.h" -const char* grib_tool_description="Copies the content of METAR files printing" - " values of some keys."; -const char* grib_tool_name="metar_copy"; -const char* grib_tool_usage="[options] file file ... output_file"; - -grib_option grib_options[]={ - /* {id, args, help}, on, command_line, value */ - {"f",0,0,0,1,0}, - {"c",0,0,1,0,0}, - {"q",0,0,1,0,0}, - {"p:",0,0,1,1,0}, - {"P:",0,0,0,1,0}, - {"w:","key[:{s|d|i}]=value,key[:{s|d|i}]=value,...","\n\t\tWhere clause." - "\n\t\tOnly messages matching the key/value constraints are " - "copied to the\n\t\toutput_grib_file.\n\t\tFor each key a string (key:s), a " - "double (key:d) or an integer (key:i)\n\t\ttype can be defined. Default type " - "is string.\n",0,1,0}, - {"B:",0,0,0,1,0}, - {"V",0,0,0,1,0}, - {"W:",0,0,0,1,0}, - {"U",0,0,1,0,0}, - {"H",0,0,1,0,0}, - {"T:",0,0,1,0,"M"}, /* METAR */ - {"S",0,0,1,0,0}, - {"g",0,0,0,1,0}, - {"7",0,0,0,1,0}, - {"v",0,0,0,1,0} +const char* grib_tool_description = + "Copies the content of METAR files printing" + " values of some keys."; +const char* grib_tool_name = "metar_copy"; +const char* grib_tool_usage = "[options] file file ... output_file"; + +grib_option grib_options[] = { + /* {id, args, help}, on, command_line, value */ + { "f", 0, 0, 0, 1, 0 }, + { "c", 0, 0, 1, 0, 0 }, + { "q", 0, 0, 1, 0, 0 }, + { "p:", 0, 0, 1, 1, 0 }, + { "P:", 0, 0, 0, 1, 0 }, + { "w:", "key[:{s|d|i}]=value,key[:{s|d|i}]=value,...", + "\n\t\tWhere clause." + "\n\t\tOnly messages matching the key/value constraints are " + "copied to the\n\t\toutput_grib_file.\n\t\tFor each key a string (key:s), a " + "double (key:d) or an integer (key:i)\n\t\ttype can be defined. Default type " + "is string.\n", + 0, 1, 0 }, + { "B:", 0, 0, 0, 1, 0 }, + { "V", 0, 0, 0, 1, 0 }, + { "W:", 0, 0, 0, 1, 0 }, + { "U", 0, 0, 1, 0, 0 }, + { "H", 0, 0, 1, 0, 0 }, + { "T:", 0, 0, 1, 0, "M" }, /* METAR */ + { "S", 0, 0, 1, 0, 0 }, + { "g", 0, 0, 0, 1, 0 }, + { "7", 0, 0, 0, 1, 0 }, + { "v", 0, 0, 0, 1, 0 } }; -int grib_options_count=sizeof(grib_options)/sizeof(grib_option); +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - int ret=grib_tool(argc,argv); - return ret; + return grib_tool(argc, argv); } int grib_tool_before_getopt(grib_runtime_options* options) @@ -66,27 +68,28 @@ int grib_tool_init(grib_runtime_options* options) return 0; } -int grib_tool_new_filename_action(grib_runtime_options* options,const char* file) +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) { return 0; } -int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file) +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { return 0; } int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) { - int err=0; + int err = 0; if (!options->skip) { if (options->set_values_count != 0) - err=grib_set_values(h,options->set_values,options->set_values_count); + err = grib_set_values(h, options->set_values, options->set_values_count); - if( err != GRIB_SUCCESS && options->fail) exit(err); + if (err != GRIB_SUCCESS && options->fail) + exit(err); } - grib_tools_write_message(options,h); + grib_tools_write_message(options, h); return 0; } @@ -96,9 +99,9 @@ int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) return 0; } -void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h) +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) { - grib_print_key_values(options,h); + grib_print_key_values(options, h); } int grib_tool_finalise_action(grib_runtime_options* options) @@ -113,6 +116,6 @@ int grib_tool_finalise_action(grib_runtime_options* options) int grib_no_handle_action(grib_runtime_options* options, int err) { - fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\t\t\"ERROR: unreadable message\"\n"); return 0; } diff --git a/tools/metar_dump.c b/tools/metar_dump.c index b88a3c549..fba57681b 100644 --- a/tools/metar_dump.c +++ b/tools/metar_dump.c @@ -18,33 +18,33 @@ #include "grib_tools.h" -grib_option grib_options[]={ -/* {id, args, help}, on, command_line, value*/ - {"S",0,0,1,0,0}, - {"O",0,"Octet mode. WMO documentation style dump.\n",0,1,0}, - {"D",0,0,0,1,0}, - {"d",0,"Print all data values.\n",0,1,0}, - {"t",0,0,0,1,0}, - {"j",0,0,0,1,0}, - {"H",0,0,0,1,0}, - {"a",0,0,0,1,0}, - {"w:",0,0,0,1,0}, - {"T:",0,0,1,0,"M"}, - {"7",0,0,0,1,0}, - {"V",0,0,0,1,0}, - {"q",0,0,1,0,0}, - {"x",0,0,0,1,0} +grib_option grib_options[] = { + /* {id, args, help}, on, command_line, value*/ + { "S", 0, 0, 1, 0, 0 }, + { "O", 0, "Octet mode. WMO documentation style dump.\n", 0, 1, 0 }, + { "D", 0, 0, 0, 1, 0 }, + { "d", 0, "Print all data values.\n", 0, 1, 0 }, + { "t", 0, 0, 0, 1, 0 }, + { "j", 0, 0, 0, 1, 0 }, + { "H", 0, 0, 0, 1, 0 }, + { "a", 0, 0, 0, 1, 0 }, + { "w:", 0, 0, 0, 1, 0 }, + { "T:", 0, 0, 1, 0, "M" }, + { "7", 0, 0, 0, 1, 0 }, + { "V", 0, 0, 0, 1, 0 }, + { "q", 0, 0, 1, 0, 0 }, + { "x", 0, 0, 0, 1, 0 } }; -const char* grib_tool_description="Dump the content of a METAR file in different formats."; -const char* grib_tool_name="metar_dump"; -const char* grib_tool_usage="[options] file file ..."; +const char* grib_tool_description = "Dump the content of a METAR file in different formats."; +const char* grib_tool_name = "metar_dump"; +const char* grib_tool_usage = "[options] file file ..."; -int grib_options_count=sizeof(grib_options)/sizeof(grib_option); +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - return grib_tool(argc,argv); + return grib_tool(argc, argv); } int grib_tool_before_getopt(grib_runtime_options* options) @@ -54,36 +54,33 @@ int grib_tool_before_getopt(grib_runtime_options* options) int grib_tool_init(grib_runtime_options* options) { - int opt=grib_options_on("C")+grib_options_on("O")+grib_options_on("D"); + int opt = grib_options_on("C") + grib_options_on("O") + grib_options_on("D"); options->dump_mode = "default"; if (opt > 1) { - printf("%s: simultaneous O/D options not allowed\n",grib_tool_name); + printf("%s: simultaneous O/D options not allowed\n", grib_tool_name); exit(1); } - if (grib_options_on("O")) { - options->dump_mode = "wmo"; - options->dump_flags = GRIB_DUMP_FLAG_CODED - | GRIB_DUMP_FLAG_OCTECT - | GRIB_DUMP_FLAG_VALUES - | GRIB_DUMP_FLAG_READ_ONLY; + if (grib_options_on("O")) { + options->dump_mode = "wmo"; + options->dump_flags = GRIB_DUMP_FLAG_CODED | GRIB_DUMP_FLAG_OCTECT | GRIB_DUMP_FLAG_VALUES | GRIB_DUMP_FLAG_READ_ONLY; } if (grib_options_on("D")) { - options->dump_mode = "debug"; - options->dump_flags = GRIB_DUMP_FLAG_VALUES | GRIB_DUMP_FLAG_READ_ONLY; + options->dump_mode = "debug"; + options->dump_flags = GRIB_DUMP_FLAG_VALUES | GRIB_DUMP_FLAG_READ_ONLY; } if (grib_options_on("J")) { - options->dump_mode = "json"; - options->dump_flags = GRIB_DUMP_FLAG_VALUES | GRIB_DUMP_FLAG_READ_ONLY; + options->dump_mode = "json"; + options->dump_flags = GRIB_DUMP_FLAG_VALUES | GRIB_DUMP_FLAG_READ_ONLY; } if (grib_options_on("X")) { - options->dump_mode = "xml"; - options->dump_flags = GRIB_DUMP_FLAG_VALUES | GRIB_DUMP_FLAG_READ_ONLY; + options->dump_mode = "xml"; + options->dump_flags = GRIB_DUMP_FLAG_VALUES | GRIB_DUMP_FLAG_READ_ONLY; } if (grib_options_on("a")) @@ -101,45 +98,46 @@ int grib_tool_init(grib_runtime_options* options) return 0; } -int grib_tool_new_filename_action(grib_runtime_options* options,const char* file) +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) { return 0; } -int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file) +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { char tmp[1024]; - if (!options->current_infile->name) return 0; - sprintf(tmp,"FILE: %s ",options->current_infile->name); - if (!grib_options_on("C") && !grib_options_on("J") && !grib_options_on("X") ) - fprintf(stdout,"***** %s\n",tmp); + if (!options->current_infile->name) + return 0; + sprintf(tmp, "FILE: %s ", options->current_infile->name); + if (!grib_options_on("C") && !grib_options_on("J") && !grib_options_on("X")) + fprintf(stdout, "***** %s\n", tmp); return 0; } int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) { - long length=0; + long length = 0; char tmp[1024]; char identifier[100]; - size_t idlen=100; + size_t idlen = 100; int i; - if (grib_get_long(h,"totalLength",&length) != GRIB_SUCCESS) - length=-9999; - - for (i=0;iprint_keys_count;i++) - grib_set_flag(h,options->print_keys[i].name,GRIB_ACCESSOR_FLAG_DUMP); - - sprintf(tmp,"MESSAGE %d ( length=%ld )",options->handle_count,length); - if (!grib_options_on("C") && !grib_options_on("X") && !grib_options_on("J") ) - fprintf(stdout,"#============== %-38s ==============\n",tmp); - if (!strcmp(options->dump_mode,"default")) { - GRIB_CHECK_NOLINE(grib_get_string(h,"identifier",identifier,&idlen),0); - printf("%s {\n",identifier); + if (grib_get_long(h, "totalLength", &length) != GRIB_SUCCESS) + length = -9999; + + for (i = 0; i < options->print_keys_count; i++) + grib_set_flag(h, options->print_keys[i].name, GRIB_ACCESSOR_FLAG_DUMP); + + sprintf(tmp, "MESSAGE %d ( length=%ld )", options->handle_count, length); + if (!grib_options_on("C") && !grib_options_on("X") && !grib_options_on("J")) + fprintf(stdout, "#============== %-38s ==============\n", tmp); + if (!strcmp(options->dump_mode, "default")) { + GRIB_CHECK_NOLINE(grib_get_string(h, "identifier", identifier, &idlen), 0); + printf("%s {\n", identifier); } - grib_dump_content(h,stdout,options->dump_mode,options->dump_flags,0); + grib_dump_content(h, stdout, options->dump_mode, options->dump_flags, 0); - if (!strcmp(options->dump_mode,"default")) + if (!strcmp(options->dump_mode, "default")) printf("}\n"); return 0; } @@ -150,9 +148,9 @@ int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) return 0; } -void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h) +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) { - grib_print_key_values(options,h); + grib_print_key_values(options, h); } int grib_tool_finalise_action(grib_runtime_options* options) @@ -162,6 +160,6 @@ int grib_tool_finalise_action(grib_runtime_options* options) int grib_no_handle_action(grib_runtime_options* options, int err) { - fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\t\t\"ERROR: unreadable message\"\n"); return 0; } diff --git a/tools/metar_filter.c b/tools/metar_filter.c index 0cd4a3d37..cc96eed2a 100644 --- a/tools/metar_filter.c +++ b/tools/metar_filter.c @@ -10,31 +10,33 @@ #include "grib_tools.h" -grib_option grib_options[]={ - /* {id, args, help}, on, command_line, value */ - {"f",0,0,0,1,0}, - {"f",0,0,1,0,0}, - {"F",0,0,1,0,0}, - {"o:",0,0,1,1,"filter.out"}, - {"q",0,0,1,0,0}, - {"I",0,0,1,0,0}, - {"V",0,0,0,1,0}, - {"g",0,0,0,1,0}, - {"T:",0,0,1,0,"M"}, - {"7",0,0,0,1,0}, - {"v",0,0,0,1,0} +grib_option grib_options[] = { + /* {id, args, help}, on, command_line, value */ + { "f", 0, 0, 0, 1, 0 }, + { "f", 0, 0, 1, 0, 0 }, + { "F", 0, 0, 1, 0, 0 }, + { "o:", 0, 0, 1, 1, "filter.out" }, + { "q", 0, 0, 1, 0, 0 }, + { "I", 0, 0, 1, 0, 0 }, + { "V", 0, 0, 0, 1, 0 }, + { "g", 0, 0, 0, 1, 0 }, + { "T:", 0, 0, 1, 0, "M" }, + { "7", 0, 0, 0, 1, 0 }, + { "v", 0, 0, 0, 1, 0 } }; -const char* grib_tool_description="Apply the rules defined in rules_file to each METAR " - "message\n\tin the files provided as arguments."; -const char* grib_tool_name="metar_filter"; -const char* grib_tool_usage="[options] rules_file " - "file file ..."; -int fail=0; -int grib_options_count=sizeof(grib_options)/sizeof(grib_option); - -int main(int argc, char *argv[]) +const char* grib_tool_description = + "Apply the rules defined in rules_file to each METAR " + "message\n\tin the files provided as arguments."; +const char* grib_tool_name = "metar_filter"; +const char* grib_tool_usage = + "[options] rules_file " + "file file ..."; +int fail = 0; +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); + +int main(int argc, char* argv[]) { - return grib_tool(argc,argv); + return grib_tool(argc, argv); } int grib_tool_before_getopt(grib_runtime_options* options) @@ -46,38 +48,38 @@ int grib_tool_init(grib_runtime_options* options) { options->action = grib_action_from_filter(options->infile_extra->name); if (!options->action) { - fprintf(stderr,"%s: error unable to create action\n",options->infile_extra->name); + fprintf(stderr, "%s: error unable to create action\n", options->infile_extra->name); exit(1); } - if ( options->outfile && options->outfile->name ) - options->action->context->outfilename=options->outfile->name; + if (options->outfile && options->outfile->name) + options->action->context->outfilename = options->outfile->name; return 0; } -int grib_tool_new_filename_action(grib_runtime_options* options,const char* file) +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) { return 0; -} +} -int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file) +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { return 0; } int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) { - int err=0; + int err = 0; if (options->current_infile->name) { - size_t len=strlen(options->current_infile->name); - grib_set_string(h,"file",options->current_infile->name,&len); + size_t len = strlen(options->current_infile->name); + grib_set_string(h, "file", options->current_infile->name, &len); } - err=grib_handle_apply_action(h,options->action); - if (err != GRIB_SUCCESS && options->fail && err!=GRIB_NOT_FOUND) { - printf("ERROR: %s\n",grib_get_error_message(err)); + err = grib_handle_apply_action(h, options->action); + if (err != GRIB_SUCCESS && options->fail && err != GRIB_NOT_FOUND) { + printf("ERROR: %s\n", grib_get_error_message(err)); exit(err); } return 0; @@ -89,9 +91,9 @@ int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) return 0; } -void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h) +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) { - grib_print_key_values(options,h); + grib_print_key_values(options, h); } int grib_tool_finalise_action(grib_runtime_options* options) @@ -102,6 +104,6 @@ int grib_tool_finalise_action(grib_runtime_options* options) int grib_no_handle_action(grib_runtime_options* options, int err) { - fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\t\t\"ERROR: unreadable message\"\n"); return 0; } diff --git a/tools/metar_get.c b/tools/metar_get.c index 24e1d8fd2..30b3e1a07 100644 --- a/tools/metar_get.c +++ b/tools/metar_get.c @@ -10,76 +10,78 @@ #include "grib_tools.h" -grib_option grib_options[]={ - /* {id, args, help}, on, command_line, value*/ - {"f",0,0,0,1,0}, - {"p:",0,0,0,1,0}, - {"F:",0,0,1,1,"%g"}, - {"P:",0,0,0,1,0}, - {"w:",0,0,0,1,0}, - {"n:",0,0,1,1,0}, - {"s:",0,0,0,1,0}, - {"V",0,0,0,1,0}, - {"W:",0,0,1,1,"8"}, - {"m",0,0,0,1,0}, - {"M",0,0,0,1,0}, - {"S",0,0,1,0,0}, - {"T:",0,0,1,0,"M"}, /* METAR */ - {"7",0,0,0,1,0}, - {"v",0,0,1,0,0} +grib_option grib_options[] = { + /* {id, args, help}, on, command_line, value*/ + { "f", 0, 0, 0, 1, 0 }, + { "p:", 0, 0, 0, 1, 0 }, + { "F:", 0, 0, 1, 1, "%g" }, + { "P:", 0, 0, 0, 1, 0 }, + { "w:", 0, 0, 0, 1, 0 }, + { "n:", 0, 0, 1, 1, 0 }, + { "s:", 0, 0, 0, 1, 0 }, + { "V", 0, 0, 0, 1, 0 }, + { "W:", 0, 0, 1, 1, "8" }, + { "m", 0, 0, 0, 1, 0 }, + { "M", 0, 0, 0, 1, 0 }, + { "S", 0, 0, 1, 0, 0 }, + { "T:", 0, 0, 1, 0, "M" }, /* METAR */ + { "7", 0, 0, 0, 1, 0 }, + { "v", 0, 0, 1, 0, 0 } }; -const char* grib_tool_description="Get values of some keys from a METAR file." - "\n\tIt is similar to metar_ls, but fails returning an error code " - "\n\twhen an error occurs (e.g. key not found)."; -const char* grib_tool_name="metar_get"; -const char* grib_tool_usage="[options] file file ..."; +const char* grib_tool_description = + "Get values of some keys from a METAR file." + "\n\tIt is similar to metar_ls, but fails returning an error code " + "\n\twhen an error occurs (e.g. key not found)."; +const char* grib_tool_name = "metar_get"; +const char* grib_tool_usage = "[options] file file ..."; -int grib_options_count=sizeof(grib_options)/sizeof(grib_option); -double lat=0; -double lon=0; -int mode=0; +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); +double lat = 0; +double lon = 0; +int mode = 0; -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - return grib_tool(argc,argv); + return grib_tool(argc, argv); } int grib_tool_before_getopt(grib_runtime_options* options) { - options->print_keys_count=-1; + options->print_keys_count = -1; return 0; } int grib_tool_init(grib_runtime_options* options) { - options->print_header=0; - options->print_statistics=0; - options->default_print_width=-1; + options->print_header = 0; + options->print_statistics = 0; + options->default_print_width = -1; return 0; } -int grib_tool_new_filename_action(grib_runtime_options* options,const char* file) +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) { return 0; } -int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file) +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { return 0; } -int grib_tool_new_handle_action(grib_runtime_options* options,grib_handle* h) +int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) { int err = 0; if (!options->skip) { if (options->set_values_count != 0) { - err=grib_set_values(h,options->set_values,options->set_values_count); + err = grib_set_values(h, options->set_values, options->set_values_count); } - if (err != GRIB_SUCCESS && options->fail) exit(err); + if (err != GRIB_SUCCESS && options->fail) + exit(err); } return 0; @@ -91,9 +93,9 @@ int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) return 0; } -void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h) +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) { - grib_print_key_values(options,h); + grib_print_key_values(options, h); } int grib_tool_finalise_action(grib_runtime_options* options) @@ -103,6 +105,6 @@ int grib_tool_finalise_action(grib_runtime_options* options) int grib_no_handle_action(grib_runtime_options* options, int err) { - fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\t\t\"ERROR: unreadable message\"\n"); return 0; } diff --git a/tools/metar_ls.c b/tools/metar_ls.c index eb7e2a794..a1780e057 100644 --- a/tools/metar_ls.c +++ b/tools/metar_ls.c @@ -17,47 +17,48 @@ */ #include "grib_tools.h" -grib_option grib_options[]={ - /* {id, args, help}, on, command_line, value*/ - {"f",0,0,1,0,0}, - {"p:",0,0,0,1,0}, - {"F:",0,0,1,1,"%g"}, - {"P:",0,0,0,1,0}, - {"w:",0,0,0,1,0}, - {"j",0,"json output\n",0,1,0}, - {"B:",0,0,0,1,0}, - /* {"l:",0,0,0,1,0}, */ - {"s:",0,0,0,1,0}, - /* {"i:",0,0,0,1,0}, */ - {"n:",0,0,1,1,"ls"}, - {"m",0,0,0,1,0}, - {"V",0,0,0,1,0}, - {"W:",0,0,1,1,"10"}, - {"S",0,0,1,0,0}, - /* {"M",0,0,0,1,0}, */ - {"H",0,0,1,0,0}, - {"g",0,0,0,1,0}, - {"P",0,0,1,0,0}, - {"T:",0,0,1,0,"M"}, - {"7",0,0,0,1,0}, - {"v",0,0,1,0,0} - /*{"x",0,0,0,1,0}*/ +grib_option grib_options[] = { + /* {id, args, help}, on, command_line, value*/ + { "f", 0, 0, 1, 0, 0 }, + { "p:", 0, 0, 0, 1, 0 }, + { "F:", 0, 0, 1, 1, "%g" }, + { "P:", 0, 0, 0, 1, 0 }, + { "w:", 0, 0, 0, 1, 0 }, + { "j", 0, "json output\n", 0, 1, 0 }, + { "B:", 0, 0, 0, 1, 0 }, + /* {"l:",0,0,0,1,0}, */ + { "s:", 0, 0, 0, 1, 0 }, + /* {"i:",0,0,0,1,0}, */ + { "n:", 0, 0, 1, 1, "ls" }, + { "m", 0, 0, 0, 1, 0 }, + { "V", 0, 0, 0, 1, 0 }, + { "W:", 0, 0, 1, 1, "10" }, + { "S", 0, 0, 1, 0, 0 }, + /* {"M",0,0,0,1,0}, */ + { "H", 0, 0, 1, 0, 0 }, + { "g", 0, 0, 0, 1, 0 }, + { "P", 0, 0, 1, 0, 0 }, + { "T:", 0, 0, 1, 0, "M" }, + { "7", 0, 0, 0, 1, 0 }, + { "v", 0, 0, 1, 0, 0 } + /*{"x",0,0,0,1,0}*/ }; -const char* grib_tool_description="List content of METAR files printing values of " - "some keys.\n\tIt does not fail when a key is not found."; -const char* grib_tool_name="metar_ls"; -const char* grib_tool_usage="[options] file file ..."; +const char* grib_tool_description = + "List content of METAR files printing values of " + "some keys.\n\tIt does not fail when a key is not found."; +const char* grib_tool_name = "metar_ls"; +const char* grib_tool_usage = "[options] file file ..."; -int grib_options_count=sizeof(grib_options)/sizeof(grib_option); -double lat=0; -double lon=0; -int mode=0; -static int json=0; +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); +double lat = 0; +double lon = 0; +int mode = 0; +static int json = 0; -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - return grib_tool(argc,argv); + return grib_tool(argc, argv); } /* @@ -78,11 +79,12 @@ Initialization and startup can be done here int grib_tool_init(grib_runtime_options* options) { if (grib_options_on("j")) { - options->verbose=0; - json=1; + options->verbose = 0; + json = 1; } - if (json) printf("[\n"); + if (json) + printf("[\n"); return 0; } @@ -91,11 +93,13 @@ int grib_tool_init(grib_runtime_options* options) A new file is being parsed. The file name is file. This function is called every time a new input file name is processed, before opening the file. */ -int grib_tool_new_filename_action(grib_runtime_options* options,const char* file) { +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) +{ return 0; } -int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file) { +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) +{ return 0; } @@ -105,14 +109,14 @@ The handle available in this function is in the set of messages satisfying the c */ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) { - int err=0; + int err = 0; if (!options->skip) { - if (options->set_values_count != 0) - err=grib_set_values(h,options->set_values,options->set_values_count); + err = grib_set_values(h, options->set_values, options->set_values_count); - if( err != GRIB_SUCCESS && options->fail) exit(err); + if (err != GRIB_SUCCESS && options->fail) + exit(err); } return 0; @@ -127,21 +131,22 @@ int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) } /* key values can be printed in this function. Headers are already printed if requested.*/ -void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h) +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) { - grib_print_key_values(options,h); + grib_print_key_values(options, h); } /* this is executed after the last message in the last file is processed */ int grib_tool_finalise_action(grib_runtime_options* options) { - if (json) printf("\n]\n"); + if (json) + printf("\n]\n"); return 0; } int grib_no_handle_action(grib_runtime_options* options, int err) { - fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\t\t\"ERROR: unreadable message\"\n"); return 0; } diff --git a/tools/taf_dump.c b/tools/taf_dump.c index 162172175..ec7ee78b6 100644 --- a/tools/taf_dump.c +++ b/tools/taf_dump.c @@ -10,34 +10,34 @@ #include "grib_tools.h" -grib_option grib_options[]={ - /* {id, args, help}, on, command_line, value*/ - {"S",0,0,1,0,0}, - {"O",0,"Octet mode. WMO documentation style dump.\n",0,1,0}, - {"D",0,0,0,1,0}, - {"d",0,"Print all data values.\n",0,1,0}, - {"C",0,0,0,1,0}, - {"t",0,0,0,1,0}, - {"H",0,0,0,1,0}, - {"a",0,0,0,1,0}, - {"w:",0,0,0,1,0}, - {"M",0,0,0,1,0}, - {"T:",0,0,1,0,"F"}, - {"7",0,0,0,1,0}, - {"V",0,0,0,1,0}, - {"q",0,0,1,0,0}, - {"x",0,0,0,1,0} +grib_option grib_options[] = { + /* {id, args, help}, on, command_line, value*/ + { "S", 0, 0, 1, 0, 0 }, + { "O", 0, "Octet mode. WMO documentation style dump.\n", 0, 1, 0 }, + { "D", 0, 0, 0, 1, 0 }, + { "d", 0, "Print all data values.\n", 0, 1, 0 }, + { "C", 0, 0, 0, 1, 0 }, + { "t", 0, 0, 0, 1, 0 }, + { "H", 0, 0, 0, 1, 0 }, + { "a", 0, 0, 0, 1, 0 }, + { "w:", 0, 0, 0, 1, 0 }, + { "M", 0, 0, 0, 1, 0 }, + { "T:", 0, 0, 1, 0, "F" }, + { "7", 0, 0, 0, 1, 0 }, + { "V", 0, 0, 0, 1, 0 }, + { "q", 0, 0, 1, 0, 0 }, + { "x", 0, 0, 0, 1, 0 } }; -const char* grib_tool_description="Dump the content of a TAF file in different formats."; -const char* grib_tool_name="taf_dump"; -const char* grib_tool_usage="[options] file file ..."; +const char* grib_tool_description = "Dump the content of a TAF file in different formats."; +const char* grib_tool_name = "taf_dump"; +const char* grib_tool_usage = "[options] file file ..."; -int grib_options_count=sizeof(grib_options)/sizeof(grib_option); +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - return grib_tool(argc,argv); + return grib_tool(argc, argv); } int grib_tool_before_getopt(grib_runtime_options* options) @@ -47,41 +47,34 @@ int grib_tool_before_getopt(grib_runtime_options* options) int grib_tool_init(grib_runtime_options* options) { - - int opt=grib_options_on("C")+grib_options_on("O")+grib_options_on("D"); + int opt = grib_options_on("C") + grib_options_on("O") + grib_options_on("D"); options->dump_mode = "default"; if (opt > 1) { - printf("%s: simultaneous C/O/D options not allowed\n",grib_tool_name); + printf("%s: simultaneous C/O/D options not allowed\n", grib_tool_name); exit(1); } - if (grib_options_on("O")) { - options->dump_mode = "wmo"; - options->dump_flags = GRIB_DUMP_FLAG_CODED - | GRIB_DUMP_FLAG_OCTECT - | GRIB_DUMP_FLAG_VALUES - | GRIB_DUMP_FLAG_READ_ONLY; + if (grib_options_on("O")) { + options->dump_mode = "wmo"; + options->dump_flags = GRIB_DUMP_FLAG_CODED | GRIB_DUMP_FLAG_OCTECT | GRIB_DUMP_FLAG_VALUES | GRIB_DUMP_FLAG_READ_ONLY; } if (grib_options_on("D")) { - options->dump_mode = "debug"; - options->dump_flags = GRIB_DUMP_FLAG_VALUES - | GRIB_DUMP_FLAG_READ_ONLY; + options->dump_mode = "debug"; + options->dump_flags = GRIB_DUMP_FLAG_VALUES | GRIB_DUMP_FLAG_READ_ONLY; } if (grib_options_on("J")) { - options->dump_mode = "json"; - options->dump_flags = GRIB_DUMP_FLAG_VALUES - | GRIB_DUMP_FLAG_READ_ONLY; + options->dump_mode = "json"; + options->dump_flags = GRIB_DUMP_FLAG_VALUES | GRIB_DUMP_FLAG_READ_ONLY; } if (grib_options_on("X")) { - options->dump_mode = "xml"; - options->dump_flags = GRIB_DUMP_FLAG_VALUES - | GRIB_DUMP_FLAG_READ_ONLY; + options->dump_mode = "xml"; + options->dump_flags = GRIB_DUMP_FLAG_VALUES | GRIB_DUMP_FLAG_READ_ONLY; } if (grib_options_on("a")) @@ -99,45 +92,46 @@ int grib_tool_init(grib_runtime_options* options) return 0; } -int grib_tool_new_filename_action(grib_runtime_options* options,const char* file) +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) { return 0; } -int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file) +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { char tmp[1024]; - if (!options->current_infile->name) return 0; - sprintf(tmp,"FILE: %s ",options->current_infile->name); - if (!grib_options_on("C") && !grib_options_on("J") && !grib_options_on("X") ) - fprintf(stdout,"***** %s\n",tmp); + if (!options->current_infile->name) + return 0; + sprintf(tmp, "FILE: %s ", options->current_infile->name); + if (!grib_options_on("C") && !grib_options_on("J") && !grib_options_on("X")) + fprintf(stdout, "***** %s\n", tmp); return 0; } int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) { - long length=0; + long length = 0; char tmp[1024]; char identifier[100]; - size_t idlen=100; + size_t idlen = 100; int i; - if (grib_get_long(h,"totalLength",&length) != GRIB_SUCCESS) - length=-9999; - - for (i=0;iprint_keys_count;i++) - grib_set_flag(h,options->print_keys[i].name,GRIB_ACCESSOR_FLAG_DUMP); - - sprintf(tmp,"MESSAGE %d ( length=%ld )",options->handle_count,length); - if (!grib_options_on("C") && !grib_options_on("X") && !grib_options_on("J") ) - fprintf(stdout,"#============== %-38s ==============\n",tmp); - if (!strcmp(options->dump_mode,"default")) { - GRIB_CHECK_NOLINE(grib_get_string(h,"identifier",identifier,&idlen),0); - printf("%s {\n",identifier); + if (grib_get_long(h, "totalLength", &length) != GRIB_SUCCESS) + length = -9999; + + for (i = 0; i < options->print_keys_count; i++) + grib_set_flag(h, options->print_keys[i].name, GRIB_ACCESSOR_FLAG_DUMP); + + sprintf(tmp, "MESSAGE %d ( length=%ld )", options->handle_count, length); + if (!grib_options_on("C") && !grib_options_on("X") && !grib_options_on("J")) + fprintf(stdout, "#============== %-38s ==============\n", tmp); + if (!strcmp(options->dump_mode, "default")) { + GRIB_CHECK_NOLINE(grib_get_string(h, "identifier", identifier, &idlen), 0); + printf("%s {\n", identifier); } - grib_dump_content(h,stdout,options->dump_mode,options->dump_flags,0); + grib_dump_content(h, stdout, options->dump_mode, options->dump_flags, 0); - if (!strcmp(options->dump_mode,"default")) + if (!strcmp(options->dump_mode, "default")) printf("}\n"); return 0; } @@ -148,9 +142,9 @@ int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) return 0; } -void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h) +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) { - grib_print_key_values(options,h); + grib_print_key_values(options, h); } int grib_tool_finalise_action(grib_runtime_options* options) @@ -160,6 +154,6 @@ int grib_tool_finalise_action(grib_runtime_options* options) int grib_no_handle_action(grib_runtime_options* options, int err) { - fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\t\t\"ERROR: unreadable message\"\n"); return 0; } diff --git a/tools/taf_filter.c b/tools/taf_filter.c index e57393849..6e5e6c4b2 100644 --- a/tools/taf_filter.c +++ b/tools/taf_filter.c @@ -10,33 +10,35 @@ #include "grib_tools.h" -grib_option grib_options[]={ - /* {id, args, help}, on, command_line, value */ - {"f",0,0,0,1,0}, - {"f",0,0,1,0,0}, - {"F",0,0,1,0,0}, - {"o:",0,0,1,1,"filter.out"}, - {"q",0,0,1,0,0}, - {"M",0,0,0,1,0}, - {"I",0,0,1,0,0}, - {"V",0,0,0,1,0}, - {"g",0,0,0,1,0}, - {"G",0,0,0,1,0}, - {"T:",0,0,1,0,"F"}, - {"7",0,0,0,1,0}, - {"v",0,0,0,1,0} +grib_option grib_options[] = { + /* {id, args, help}, on, command_line, value */ + { "f", 0, 0, 0, 1, 0 }, + { "f", 0, 0, 1, 0, 0 }, + { "F", 0, 0, 1, 0, 0 }, + { "o:", 0, 0, 1, 1, "filter.out" }, + { "q", 0, 0, 1, 0, 0 }, + { "M", 0, 0, 0, 1, 0 }, + { "I", 0, 0, 1, 0, 0 }, + { "V", 0, 0, 0, 1, 0 }, + { "g", 0, 0, 0, 1, 0 }, + { "G", 0, 0, 0, 1, 0 }, + { "T:", 0, 0, 1, 0, "F" }, + { "7", 0, 0, 0, 1, 0 }, + { "v", 0, 0, 0, 1, 0 } }; -const char* grib_tool_description="Apply the rules defined in rules_file to each TAF " - "message\n\tin the files provided as arguments."; -const char* grib_tool_name="taf_filter"; -const char* grib_tool_usage="[options] rules_file " - "file file ..."; -int fail=0; -int grib_options_count=sizeof(grib_options)/sizeof(grib_option); - -int main(int argc, char *argv[]) +const char* grib_tool_description = + "Apply the rules defined in rules_file to each TAF " + "message\n\tin the files provided as arguments."; +const char* grib_tool_name = "taf_filter"; +const char* grib_tool_usage = + "[options] rules_file " + "file file ..."; +int fail = 0; +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); + +int main(int argc, char* argv[]) { - return grib_tool(argc,argv); + return grib_tool(argc, argv); } int grib_tool_before_getopt(grib_runtime_options* options) @@ -48,38 +50,38 @@ int grib_tool_init(grib_runtime_options* options) { options->action = grib_action_from_filter(options->infile_extra->name); if (!options->action) { - fprintf(stderr,"%s: error unable to create action\n",options->infile_extra->name); + fprintf(stderr, "%s: error unable to create action\n", options->infile_extra->name); exit(1); } - if ( options->outfile && options->outfile->name ) - options->action->context->outfilename=options->outfile->name; + if (options->outfile && options->outfile->name) + options->action->context->outfilename = options->outfile->name; return 0; } -int grib_tool_new_filename_action(grib_runtime_options* options,const char* file) +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) { return 0; -} +} -int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file) +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { return 0; } int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) { - int err=0; + int err = 0; if (options->current_infile->name) { - size_t len=strlen(options->current_infile->name); - grib_set_string(h,"file",options->current_infile->name,&len); + size_t len = strlen(options->current_infile->name); + grib_set_string(h, "file", options->current_infile->name, &len); } - err=grib_handle_apply_action(h,options->action); - if (err != GRIB_SUCCESS && options->fail && err!=GRIB_NOT_FOUND) { - printf("ERROR: %s\n",grib_get_error_message(err)); + err = grib_handle_apply_action(h, options->action); + if (err != GRIB_SUCCESS && options->fail && err != GRIB_NOT_FOUND) { + printf("ERROR: %s\n", grib_get_error_message(err)); exit(err); } return 0; @@ -91,9 +93,9 @@ int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) return 0; } -void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h) +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) { - grib_print_key_values(options,h); + grib_print_key_values(options, h); } int grib_tool_finalise_action(grib_runtime_options* options) @@ -104,6 +106,6 @@ int grib_tool_finalise_action(grib_runtime_options* options) int grib_no_handle_action(grib_runtime_options* options, int err) { - fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\t\t\"ERROR: unreadable message\"\n"); return 0; } diff --git a/tools/taf_get.c b/tools/taf_get.c index 82558d3c0..0d309bb83 100644 --- a/tools/taf_get.c +++ b/tools/taf_get.c @@ -10,75 +10,80 @@ #include "grib_tools.h" -grib_option grib_options[]={ - /* {id, args, help}, on, command_line, value*/ - {"f",0,0,0,1,0}, - {"p:",0,0,0,1,0}, - {"F:",0,0,1,1,"%g"}, - {"l:",0,0,0,1,0}, - {"P:",0,0,0,1,0}, - {"w:",0,0,0,1,0}, - {"n:",0,0,1,1,0}, - {"s:",0,0,0,1,0}, - {"V",0,0,0,1,0}, - {"W:",0,0,1,1,"8"}, - {"m",0,0,0,1,0}, - {"M",0,0,0,1,0}, - {"S",0,0,1,0,0}, - {"g",0,0,0,1,0}, - {"G",0,0,0,1,0}, - {"T:",0,0,1,0,"F"}, - {"7",0,0,0,1,0}, - {"v",0,0,1,0,0}, - {"i:",0,0,0,1,0} +grib_option grib_options[] = { + /* {id, args, help}, on, command_line, value*/ + { "f", 0, 0, 0, 1, 0 }, + { "p:", 0, 0, 0, 1, 0 }, + { "F:", 0, 0, 1, 1, "%g" }, + { "l:", 0, 0, 0, 1, 0 }, + { "P:", 0, 0, 0, 1, 0 }, + { "w:", 0, 0, 0, 1, 0 }, + { "n:", 0, 0, 1, 1, 0 }, + { "s:", 0, 0, 0, 1, 0 }, + { "V", 0, 0, 0, 1, 0 }, + { "W:", 0, 0, 1, 1, "8" }, + { "m", 0, 0, 0, 1, 0 }, + { "M", 0, 0, 0, 1, 0 }, + { "S", 0, 0, 1, 0, 0 }, + { "g", 0, 0, 0, 1, 0 }, + { "G", 0, 0, 0, 1, 0 }, + { "T:", 0, 0, 1, 0, "F" }, + { "7", 0, 0, 0, 1, 0 }, + { "v", 0, 0, 1, 0, 0 }, + { "i:", 0, 0, 0, 1, 0 } }; -const char* grib_tool_description="Get values of some keys from a TAF file." - "\n\tIt is similar to taf_ls, but fails returning an error code " - "\n\twhen an error occurs (e.g. key not found)."; -const char* grib_tool_name="taf_get"; -const char* grib_tool_usage="[options] file file ..."; +const char* grib_tool_description = + "Get values of some keys from a TAF file." + "\n\tIt is similar to taf_ls, but fails returning an error code " + "\n\twhen an error occurs (e.g. key not found)."; +const char* grib_tool_name = "taf_get"; +const char* grib_tool_usage = "[options] file file ..."; -int grib_options_count=sizeof(grib_options)/sizeof(grib_option); -int mode=0; +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); +int mode = 0; -int main(int argc, char *argv[]) { return grib_tool(argc,argv);} +int main(int argc, char* argv[]) +{ + return grib_tool(argc, argv); +} int grib_tool_before_getopt(grib_runtime_options* options) { - options->print_keys_count=-1; + options->print_keys_count = -1; return 0; } int grib_tool_init(grib_runtime_options* options) { - options->print_header=0; - options->print_statistics=0; - options->default_print_width=-1; + options->print_header = 0; + options->print_statistics = 0; + options->default_print_width = -1; return 0; } -int grib_tool_new_filename_action(grib_runtime_options* options,const char* file) +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) { return 0; } -int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file) +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { return 0; } -int grib_tool_new_handle_action(grib_runtime_options* options,grib_handle* h) +int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) { int err = 0; if (!options->skip) { if (options->set_values_count != 0) { - err=grib_set_values(h,options->set_values,options->set_values_count); + err = grib_set_values(h, options->set_values, options->set_values_count); } - if (err != GRIB_SUCCESS && options->fail) exit(err); + if (err != GRIB_SUCCESS && options->fail) + exit(err); } return 0; @@ -90,9 +95,9 @@ int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) return 0; } -void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h) +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) { - grib_print_key_values(options,h); + grib_print_key_values(options, h); } int grib_tool_finalise_action(grib_runtime_options* options) @@ -102,6 +107,6 @@ int grib_tool_finalise_action(grib_runtime_options* options) int grib_no_handle_action(grib_runtime_options* options, int err) { - fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\t\t\"ERROR: unreadable message\"\n"); return 0; } diff --git a/tools/taf_ls.c b/tools/taf_ls.c index db7571d8a..21a72746f 100644 --- a/tools/taf_ls.c +++ b/tools/taf_ls.c @@ -10,47 +10,48 @@ #include "grib_tools.h" -grib_option grib_options[]={ - /* {id, args, help}, on, command_line, value*/ - {"f",0,0,1,0,0}, - {"p:",0,0,0,1,0}, - {"F:",0,0,1,1,"%g"}, - {"P:",0,0,0,1,0}, - {"w:",0,0,0,1,0}, - {"j",0,"json output\n",0,1,0}, - {"B:",0,0,0,1,0}, - {"l:",0,0,0,1,0}, - {"s:",0,0,0,1,0}, - {"i:",0,0,0,1,0}, - {"n:",0,0,1,1,"ls"}, - {"m",0,0,0,1,0}, - {"V",0,0,0,1,0}, - {"W:",0,0,1,1,"10"}, - {"S",0,0,1,0,0}, - {"M",0,0,0,1,0}, - {"H",0,0,1,0,0}, - {"g",0,0,0,1,0}, - {"P",0,0,1,0,0}, - {"T:",0,0,1,0,"F"}, - {"7",0,0,0,1,0}, - {"v",0,0,1,0,0}, - {"x",0,0,0,1,0} +grib_option grib_options[] = { + /* {id, args, help}, on, command_line, value*/ + { "f", 0, 0, 1, 0, 0 }, + { "p:", 0, 0, 0, 1, 0 }, + { "F:", 0, 0, 1, 1, "%g" }, + { "P:", 0, 0, 0, 1, 0 }, + { "w:", 0, 0, 0, 1, 0 }, + { "j", 0, "json output\n", 0, 1, 0 }, + { "B:", 0, 0, 0, 1, 0 }, + { "l:", 0, 0, 0, 1, 0 }, + { "s:", 0, 0, 0, 1, 0 }, + { "i:", 0, 0, 0, 1, 0 }, + { "n:", 0, 0, 1, 1, "ls" }, + { "m", 0, 0, 0, 1, 0 }, + { "V", 0, 0, 0, 1, 0 }, + { "W:", 0, 0, 1, 1, "10" }, + { "S", 0, 0, 1, 0, 0 }, + { "M", 0, 0, 0, 1, 0 }, + { "H", 0, 0, 1, 0, 0 }, + { "g", 0, 0, 0, 1, 0 }, + { "P", 0, 0, 1, 0, 0 }, + { "T:", 0, 0, 1, 0, "F" }, + { "7", 0, 0, 0, 1, 0 }, + { "v", 0, 0, 1, 0, 0 }, + { "x", 0, 0, 0, 1, 0 } }; -const char* grib_tool_description="List content of TAF files printing values of " - "some keys.\n\tIt does not fail when a key is not found."; -const char* grib_tool_name="taf_ls"; -const char* grib_tool_usage="[options] file file ..."; +const char* grib_tool_description = + "List content of TAF files printing values of " + "some keys.\n\tIt does not fail when a key is not found."; +const char* grib_tool_name = "taf_ls"; +const char* grib_tool_usage = "[options] file file ..."; -int grib_options_count=sizeof(grib_options)/sizeof(grib_option); -double lat=0; -double lon=0; -int mode=0; -static int json=0; +int grib_options_count = sizeof(grib_options) / sizeof(grib_option); +double lat = 0; +double lon = 0; +int mode = 0; +static int json = 0; -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - return grib_tool(argc,argv); + return grib_tool(argc, argv); } int grib_tool_before_getopt(grib_runtime_options* options) @@ -61,76 +62,78 @@ int grib_tool_before_getopt(grib_runtime_options* options) int grib_tool_init(grib_runtime_options* options) { if (grib_options_on("j")) { - options->verbose=0; - json=1; + options->verbose = 0; + json = 1; } - if (json) printf("[\n"); + if (json) + printf("[\n"); return 0; } -int grib_tool_new_filename_action(grib_runtime_options* options,const char* file) +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file) { return 0; } -int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file) +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file) { return 0; } -static void print_key_values(grib_runtime_options* options,grib_handle* h) +static void print_key_values(grib_runtime_options* options, grib_handle* h) { int i; - int ret=0; - char* s="\"keys\" : {"; - double dvalue=0; - long lvalue=0; + int ret = 0; + char* s = "\"keys\" : {"; + double dvalue = 0; + long lvalue = 0; char value[MAX_STRING_LEN]; - size_t len=MAX_STRING_LEN; - for (i=0;iprint_keys_count;i++) { - ret=GRIB_SUCCESS; - printf("%s",s); - len=MAX_STRING_LEN; - printf("\"%s\" : ",options->print_keys[i].name); - if (grib_is_missing(h,options->print_keys[i].name,&ret) && ret==GRIB_SUCCESS) + size_t len = MAX_STRING_LEN; + for (i = 0; i < options->print_keys_count; i++) { + ret = GRIB_SUCCESS; + printf("%s", s); + len = MAX_STRING_LEN; + printf("\"%s\" : ", options->print_keys[i].name); + if (grib_is_missing(h, options->print_keys[i].name, &ret) && ret == GRIB_SUCCESS) printf("\"missing\""); - else if ( ret == GRIB_SUCCESS ) { + else if (ret == GRIB_SUCCESS) { if (options->print_keys[i].type == GRIB_TYPE_UNDEFINED) - grib_get_native_type(h,options->print_keys[i].name,&(options->print_keys[i].type)); + grib_get_native_type(h, options->print_keys[i].name, &(options->print_keys[i].type)); switch (options->print_keys[i].type) { - case GRIB_TYPE_STRING: - ret=grib_get_string( h,options->print_keys[i].name,value,&len); - printf("\"%s\"",value); - break; - case GRIB_TYPE_DOUBLE: - ret=grib_get_double( h,options->print_keys[i].name,&dvalue); - printf("%g",dvalue); - break; - case GRIB_TYPE_LONG: - ret=grib_get_long( h,options->print_keys[i].name,&lvalue); - printf("%ld",lvalue); - break; - default: - printf("invalid_type"); + case GRIB_TYPE_STRING: + ret = grib_get_string(h, options->print_keys[i].name, value, &len); + printf("\"%s\"", value); + break; + case GRIB_TYPE_DOUBLE: + ret = grib_get_double(h, options->print_keys[i].name, &dvalue); + printf("%g", dvalue); + break; + case GRIB_TYPE_LONG: + ret = grib_get_long(h, options->print_keys[i].name, &lvalue); + printf("%ld", lvalue); + break; + default: + printf("invalid_type"); } } - if (ret == GRIB_NOT_FOUND) printf("null"); - s=", "; + if (ret == GRIB_NOT_FOUND) + printf("null"); + s = ", "; } printf("}"); } int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) { - int err=0; + int err = 0; if (!options->skip) { - if (options->set_values_count != 0) - err=grib_set_values(h,options->set_values,options->set_values_count); + err = grib_set_values(h, options->set_values, options->set_values_count); - if( err != GRIB_SUCCESS && options->fail) exit(err); + if (err != GRIB_SUCCESS && options->fail) + exit(err); } return 0; @@ -142,20 +145,21 @@ int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) return 0; } -void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h) +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h) { - grib_print_key_values(options,h); + grib_print_key_values(options, h); } int grib_tool_finalise_action(grib_runtime_options* options) { - if (json) printf("\n]\n"); + if (json) + printf("\n]\n"); return 0; } int grib_no_handle_action(grib_runtime_options* options, int err) { - fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); + fprintf(dump_file, "\t\t\"ERROR: unreadable message\"\n"); return 0; } diff --git a/tools/test.c b/tools/test.c index 66abfdce1..204d72f7d 100644 --- a/tools/test.c +++ b/tools/test.c @@ -11,25 +11,24 @@ #include "grib_api_internal.h" - -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - grib_context *c = grib_context_get_default(); - - grib_trie *t = grib_trie_new(c); - - grib_trie_insert(t,"hello","w"); - grib_trie_insert(t,"hola","e"); - - printf("%s\n",(char*)grib_trie_get(t,"hello")); - printf("%s\n",(char*)grib_trie_get(t,"hela")); - printf("%s\n",(char*)grib_trie_get(t,"hola")); - - grib_trie_remove(t,"hela"); - grib_trie_remove(t,"hola"); - - printf("%s\n",(char*)grib_trie_get(t,"hello")); - printf("%s\n",(char*)grib_trie_get(t,"hola")); - - return 0; + grib_context* c = grib_context_get_default(); + + grib_trie* t = grib_trie_new(c); + + grib_trie_insert(t, "hello", "w"); + grib_trie_insert(t, "hola", "e"); + + printf("%s\n", (char*)grib_trie_get(t, "hello")); + printf("%s\n", (char*)grib_trie_get(t, "hela")); + printf("%s\n", (char*)grib_trie_get(t, "hola")); + + grib_trie_remove(t, "hela"); + grib_trie_remove(t, "hola"); + + printf("%s\n", (char*)grib_trie_get(t, "hello")); + printf("%s\n", (char*)grib_trie_get(t, "hola")); + + return 0; } diff --git a/tools/wingetopt.c b/tools/wingetopt.c index f1d6ccd59..c726c4969 100644 --- a/tools/wingetopt.c +++ b/tools/wingetopt.c @@ -14,67 +14,60 @@ #include "string.h" -char *optarg; /* global argument pointer */ -int optind = 0; /* global argv index */ +char* optarg; /* global argument pointer */ +int optind = 0; /* global argv index */ int opterr = 0; -int getopt(int argc, char *argv[], const char *optstring) +int getopt(int argc, char* argv[], const char* optstring) { - static char *next = 0; + static char* next = 0; char c; - char *cp; + char* cp; if (optind == 0) next = 0; optarg = 0; - if (next == 0 || *next == '\0') - { + if (next == 0 || *next == '\0') { if (optind == 0) optind++; - if (optind >= argc || argv[optind][0] != '-' || argv[optind][1] == '\0') - { + if (optind >= argc || argv[optind][0] != '-' || argv[optind][1] == '\0') { optarg = 0; if (optind < argc) optarg = argv[optind]; return -1; } - if (strcmp(argv[optind], "--") == 0) - { + if (strcmp(argv[optind], "--") == 0) { optind++; optarg = NULL; if (optind < argc) optarg = argv[optind]; - return -1; + return -1; } next = argv[optind]; - next++; /* skip past - */ + next++; /* skip past - */ optind++; } - c = *next++; + c = *next++; cp = strrchr(optstring, c); if (cp == 0 || c == ':') return '?'; cp++; - if (*cp == ':') - { - if (*next != '\0') - { + if (*cp == ':') { + if (*next != '\0') { optarg = next; - next = 0; + next = 0; } - else if (optind < argc) - { + else if (optind < argc) { optarg = argv[optind]; optind++; } - else - { + else { return '?'; } } @@ -82,4 +75,3 @@ int getopt(int argc, char *argv[], const char *optstring) return c; } #endif - diff --git a/tools/xref.c b/tools/xref.c old mode 100755 new mode 100644 index 55ddd7984..fa4a002ed --- a/tools/xref.c +++ b/tools/xref.c @@ -10,25 +10,22 @@ #include "grib_api_internal.h" -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - int i = 0; - int fail = 0; + int i = 0; + int fail = 0; - grib_context* c = grib_context_get_default(); -grib_action *a; + grib_context* c = grib_context_get_default(); + grib_action* a; - for(i = 1; i < argc; i++){ - if(!(a = grib_parse_file(c,argv[i]))) - { - fail++; - exit(1); - } - else - { -grib_xref_action_branch(stdout,a,argv[i]); - - } - } - return fail; + for (i = 1; i < argc; i++) { + if (!(a = grib_parse_file(c, argv[i]))) { + fail++; + exit(1); + } + else { + grib_xref_action_branch(stdout, a, argv[i]); + } + } + return fail; } From 25fd0c97247f7b52feff5d6f60a3f1ecc8196b59 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 27 Jan 2020 14:59:56 +0000 Subject: [PATCH 51/82] Latest updates from develop (7) --- definitions/grib1/section.1.def | 1 + definitions/grib2/boot.def | 2 +- definitions/grib2/cfVarName.def | 12 + definitions/grib2/name.def | 12 + definitions/grib2/paramId.def | 12 + definitions/grib2/parameters.def | 1 + definitions/grib2/shortName.def | 12 + definitions/grib2/tables/0.0.table | 2 +- definitions/grib2/tables/1.0.table | 1 + definitions/grib2/tables/25/0.0.table | 10 + definitions/grib2/tables/25/1.0.table | 28 + definitions/grib2/tables/25/1.1.table | 4 + definitions/grib2/tables/25/1.2.table | 8 + definitions/grib2/tables/25/1.3.table | 16 + definitions/grib2/tables/25/1.4.table | 13 + definitions/grib2/tables/25/1.5.table | 7 + definitions/grib2/tables/25/1.6.table | 8 + definitions/grib2/tables/25/3.0.table | 6 + definitions/grib2/tables/25/3.1.table | 54 ++ definitions/grib2/tables/25/3.10.table | 8 + definitions/grib2/tables/25/3.11.table | 7 + definitions/grib2/tables/25/3.15.table | 23 + definitions/grib2/tables/25/3.2.table | 14 + definitions/grib2/tables/25/3.20.table | 6 + definitions/grib2/tables/25/3.21.table | 8 + definitions/grib2/tables/25/3.25.table | 10 + definitions/grib2/tables/25/3.3.table | 9 + definitions/grib2/tables/25/3.4.table | 17 + definitions/grib2/tables/25/3.5.table | 5 + definitions/grib2/tables/25/3.6.table | 3 + definitions/grib2/tables/25/3.7.table | 5 + definitions/grib2/tables/25/3.8.table | 7 + definitions/grib2/tables/25/3.9.table | 4 + definitions/grib2/tables/25/4.0.table | 86 ++++ definitions/grib2/tables/25/4.1.0.table | 27 + definitions/grib2/tables/25/4.1.1.table | 7 + definitions/grib2/tables/25/4.1.10.table | 10 + definitions/grib2/tables/25/4.1.192.table | 4 + definitions/grib2/tables/25/4.1.2.table | 10 + definitions/grib2/tables/25/4.1.20.table | 7 + definitions/grib2/tables/25/4.1.3.table | 11 + definitions/grib2/tables/25/4.10.table | 16 + definitions/grib2/tables/25/4.11.table | 10 + definitions/grib2/tables/25/4.12.table | 7 + definitions/grib2/tables/25/4.13.table | 6 + definitions/grib2/tables/25/4.14.table | 6 + definitions/grib2/tables/25/4.15.table | 11 + definitions/grib2/tables/25/4.16.table | 9 + definitions/grib2/tables/25/4.192.table | 4 + definitions/grib2/tables/25/4.2.0.0.table | 34 ++ definitions/grib2/tables/25/4.2.0.1.table | 141 +++++ definitions/grib2/tables/25/4.2.0.13.table | 5 + definitions/grib2/tables/25/4.2.0.14.table | 7 + definitions/grib2/tables/25/4.2.0.15.table | 21 + definitions/grib2/tables/25/4.2.0.16.table | 10 + definitions/grib2/tables/25/4.2.0.17.table | 6 + definitions/grib2/tables/25/4.2.0.18.table | 23 + definitions/grib2/tables/25/4.2.0.19.table | 41 ++ definitions/grib2/tables/25/4.2.0.190.table | 5 + definitions/grib2/tables/25/4.2.0.191.table | 8 + definitions/grib2/tables/25/4.2.0.2.table | 51 ++ definitions/grib2/tables/25/4.2.0.20.table | 64 +++ definitions/grib2/tables/25/4.2.0.3.table | 36 ++ definitions/grib2/tables/25/4.2.0.4.table | 24 + definitions/grib2/tables/25/4.2.0.5.table | 13 + definitions/grib2/tables/25/4.2.0.6.table | 49 ++ definitions/grib2/tables/25/4.2.0.7.table | 24 + definitions/grib2/tables/25/4.2.1.0.table | 21 + definitions/grib2/tables/25/4.2.1.1.table | 7 + definitions/grib2/tables/25/4.2.1.2.table | 15 + definitions/grib2/tables/25/4.2.10.0.table | 69 +++ definitions/grib2/tables/25/4.2.10.1.table | 9 + definitions/grib2/tables/25/4.2.10.191.table | 8 + definitions/grib2/tables/25/4.2.10.2.table | 17 + definitions/grib2/tables/25/4.2.10.3.table | 8 + definitions/grib2/tables/25/4.2.10.4.table | 24 + definitions/grib2/tables/25/4.2.2.0.table | 44 ++ definitions/grib2/tables/25/4.2.2.3.table | 32 ++ definitions/grib2/tables/25/4.2.2.4.table | 16 + definitions/grib2/tables/25/4.2.2.5.table | 2 + definitions/grib2/tables/25/4.2.20.0.table | 6 + definitions/grib2/tables/25/4.2.20.1.table | 14 + definitions/grib2/tables/25/4.2.20.2.table | 5 + definitions/grib2/tables/25/4.2.3.0.table | 14 + definitions/grib2/tables/25/4.2.3.1.table | 35 ++ definitions/grib2/tables/25/4.2.3.2.table | 24 + definitions/grib2/tables/25/4.2.3.3.table | 4 + definitions/grib2/tables/25/4.2.3.4.table | 10 + definitions/grib2/tables/25/4.2.3.5.table | 7 + definitions/grib2/tables/25/4.2.3.6.table | 7 + definitions/grib2/tables/25/4.201.table | 17 + definitions/grib2/tables/25/4.202.table | 4 + definitions/grib2/tables/25/4.203.table | 26 + definitions/grib2/tables/25/4.204.table | 9 + definitions/grib2/tables/25/4.205.table | 6 + definitions/grib2/tables/25/4.206.table | 6 + definitions/grib2/tables/25/4.207.table | 10 + definitions/grib2/tables/25/4.208.table | 9 + definitions/grib2/tables/25/4.209.table | 9 + definitions/grib2/tables/25/4.210.table | 6 + definitions/grib2/tables/25/4.211.table | 7 + definitions/grib2/tables/25/4.212.table | 18 + definitions/grib2/tables/25/4.213.table | 16 + definitions/grib2/tables/25/4.215.table | 9 + definitions/grib2/tables/25/4.216.table | 5 + definitions/grib2/tables/25/4.217.table | 8 + definitions/grib2/tables/25/4.218.table | 46 ++ definitions/grib2/tables/25/4.219.table | 8 + definitions/grib2/tables/25/4.220.table | 6 + definitions/grib2/tables/25/4.221.table | 6 + definitions/grib2/tables/25/4.222.table | 6 + definitions/grib2/tables/25/4.223.table | 5 + definitions/grib2/tables/25/4.224.table | 18 + definitions/grib2/tables/25/4.225.table | 2 + definitions/grib2/tables/25/4.227.table | 9 + definitions/grib2/tables/25/4.230.table | 512 +++++++++++++++++++ definitions/grib2/tables/25/4.233.table | 512 +++++++++++++++++++ definitions/grib2/tables/25/4.234.table | 21 + definitions/grib2/tables/25/4.236.table | 8 + definitions/grib2/tables/25/4.238.table | 16 + definitions/grib2/tables/25/4.240.table | 13 + definitions/grib2/tables/25/4.241.table | 9 + definitions/grib2/tables/25/4.242.table | 7 + definitions/grib2/tables/25/4.243.table | 43 ++ definitions/grib2/tables/25/4.244.table | 7 + definitions/grib2/tables/25/4.3.table | 23 + definitions/grib2/tables/25/4.4.table | 17 + definitions/grib2/tables/25/4.5.table | 76 +++ definitions/grib2/tables/25/4.6.table | 9 + definitions/grib2/tables/25/4.7.table | 14 + definitions/grib2/tables/25/4.8.table | 6 + definitions/grib2/tables/25/4.9.table | 13 + definitions/grib2/tables/25/4.91.table | 16 + definitions/grib2/tables/25/5.0.table | 27 + definitions/grib2/tables/25/5.1.table | 6 + definitions/grib2/tables/25/5.2.table | 8 + definitions/grib2/tables/25/5.25.table | 9 + definitions/grib2/tables/25/5.26.table | 5 + definitions/grib2/tables/25/5.3.table | 7 + definitions/grib2/tables/25/5.4.table | 6 + definitions/grib2/tables/25/5.40.table | 5 + definitions/grib2/tables/25/5.40000.table | 5 + definitions/grib2/tables/25/5.5.table | 7 + definitions/grib2/tables/25/5.50002.table | 19 + definitions/grib2/tables/25/5.6.table | 7 + definitions/grib2/tables/25/5.7.table | 7 + definitions/grib2/tables/25/6.0.table | 6 + definitions/grib2/tables/25/stepType.table | 2 + definitions/grib2/units.def | 12 + definitions/param_limits.def | 201 +++++++- src/grib_accessor_class_concept.c | 23 +- src/grib_util.c | 10 +- tests/grib_data_quality_checks.sh | 64 ++- 153 files changed, 3531 insertions(+), 24 deletions(-) create mode 100644 definitions/grib2/tables/25/0.0.table create mode 100644 definitions/grib2/tables/25/1.0.table create mode 100644 definitions/grib2/tables/25/1.1.table create mode 100644 definitions/grib2/tables/25/1.2.table create mode 100644 definitions/grib2/tables/25/1.3.table create mode 100644 definitions/grib2/tables/25/1.4.table create mode 100644 definitions/grib2/tables/25/1.5.table create mode 100644 definitions/grib2/tables/25/1.6.table create mode 100644 definitions/grib2/tables/25/3.0.table create mode 100644 definitions/grib2/tables/25/3.1.table create mode 100644 definitions/grib2/tables/25/3.10.table create mode 100644 definitions/grib2/tables/25/3.11.table create mode 100644 definitions/grib2/tables/25/3.15.table create mode 100644 definitions/grib2/tables/25/3.2.table create mode 100644 definitions/grib2/tables/25/3.20.table create mode 100644 definitions/grib2/tables/25/3.21.table create mode 100644 definitions/grib2/tables/25/3.25.table create mode 100644 definitions/grib2/tables/25/3.3.table create mode 100644 definitions/grib2/tables/25/3.4.table create mode 100644 definitions/grib2/tables/25/3.5.table create mode 100644 definitions/grib2/tables/25/3.6.table create mode 100644 definitions/grib2/tables/25/3.7.table create mode 100644 definitions/grib2/tables/25/3.8.table create mode 100644 definitions/grib2/tables/25/3.9.table create mode 100644 definitions/grib2/tables/25/4.0.table create mode 100644 definitions/grib2/tables/25/4.1.0.table create mode 100644 definitions/grib2/tables/25/4.1.1.table create mode 100644 definitions/grib2/tables/25/4.1.10.table create mode 100644 definitions/grib2/tables/25/4.1.192.table create mode 100644 definitions/grib2/tables/25/4.1.2.table create mode 100644 definitions/grib2/tables/25/4.1.20.table create mode 100644 definitions/grib2/tables/25/4.1.3.table create mode 100644 definitions/grib2/tables/25/4.10.table create mode 100644 definitions/grib2/tables/25/4.11.table create mode 100644 definitions/grib2/tables/25/4.12.table create mode 100644 definitions/grib2/tables/25/4.13.table create mode 100644 definitions/grib2/tables/25/4.14.table create mode 100644 definitions/grib2/tables/25/4.15.table create mode 100644 definitions/grib2/tables/25/4.16.table create mode 100644 definitions/grib2/tables/25/4.192.table create mode 100644 definitions/grib2/tables/25/4.2.0.0.table create mode 100644 definitions/grib2/tables/25/4.2.0.1.table create mode 100644 definitions/grib2/tables/25/4.2.0.13.table create mode 100644 definitions/grib2/tables/25/4.2.0.14.table create mode 100644 definitions/grib2/tables/25/4.2.0.15.table create mode 100644 definitions/grib2/tables/25/4.2.0.16.table create mode 100644 definitions/grib2/tables/25/4.2.0.17.table create mode 100644 definitions/grib2/tables/25/4.2.0.18.table create mode 100644 definitions/grib2/tables/25/4.2.0.19.table create mode 100644 definitions/grib2/tables/25/4.2.0.190.table create mode 100644 definitions/grib2/tables/25/4.2.0.191.table create mode 100644 definitions/grib2/tables/25/4.2.0.2.table create mode 100644 definitions/grib2/tables/25/4.2.0.20.table create mode 100644 definitions/grib2/tables/25/4.2.0.3.table create mode 100644 definitions/grib2/tables/25/4.2.0.4.table create mode 100644 definitions/grib2/tables/25/4.2.0.5.table create mode 100644 definitions/grib2/tables/25/4.2.0.6.table create mode 100644 definitions/grib2/tables/25/4.2.0.7.table create mode 100644 definitions/grib2/tables/25/4.2.1.0.table create mode 100644 definitions/grib2/tables/25/4.2.1.1.table create mode 100644 definitions/grib2/tables/25/4.2.1.2.table create mode 100644 definitions/grib2/tables/25/4.2.10.0.table create mode 100644 definitions/grib2/tables/25/4.2.10.1.table create mode 100644 definitions/grib2/tables/25/4.2.10.191.table create mode 100644 definitions/grib2/tables/25/4.2.10.2.table create mode 100644 definitions/grib2/tables/25/4.2.10.3.table create mode 100644 definitions/grib2/tables/25/4.2.10.4.table create mode 100644 definitions/grib2/tables/25/4.2.2.0.table create mode 100644 definitions/grib2/tables/25/4.2.2.3.table create mode 100644 definitions/grib2/tables/25/4.2.2.4.table create mode 100644 definitions/grib2/tables/25/4.2.2.5.table create mode 100644 definitions/grib2/tables/25/4.2.20.0.table create mode 100644 definitions/grib2/tables/25/4.2.20.1.table create mode 100644 definitions/grib2/tables/25/4.2.20.2.table create mode 100644 definitions/grib2/tables/25/4.2.3.0.table create mode 100644 definitions/grib2/tables/25/4.2.3.1.table create mode 100644 definitions/grib2/tables/25/4.2.3.2.table create mode 100644 definitions/grib2/tables/25/4.2.3.3.table create mode 100644 definitions/grib2/tables/25/4.2.3.4.table create mode 100644 definitions/grib2/tables/25/4.2.3.5.table create mode 100644 definitions/grib2/tables/25/4.2.3.6.table create mode 100644 definitions/grib2/tables/25/4.201.table create mode 100644 definitions/grib2/tables/25/4.202.table create mode 100644 definitions/grib2/tables/25/4.203.table create mode 100644 definitions/grib2/tables/25/4.204.table create mode 100644 definitions/grib2/tables/25/4.205.table create mode 100644 definitions/grib2/tables/25/4.206.table create mode 100644 definitions/grib2/tables/25/4.207.table create mode 100644 definitions/grib2/tables/25/4.208.table create mode 100644 definitions/grib2/tables/25/4.209.table create mode 100644 definitions/grib2/tables/25/4.210.table create mode 100644 definitions/grib2/tables/25/4.211.table create mode 100644 definitions/grib2/tables/25/4.212.table create mode 100644 definitions/grib2/tables/25/4.213.table create mode 100644 definitions/grib2/tables/25/4.215.table create mode 100644 definitions/grib2/tables/25/4.216.table create mode 100644 definitions/grib2/tables/25/4.217.table create mode 100644 definitions/grib2/tables/25/4.218.table create mode 100644 definitions/grib2/tables/25/4.219.table create mode 100644 definitions/grib2/tables/25/4.220.table create mode 100644 definitions/grib2/tables/25/4.221.table create mode 100644 definitions/grib2/tables/25/4.222.table create mode 100644 definitions/grib2/tables/25/4.223.table create mode 100644 definitions/grib2/tables/25/4.224.table create mode 100644 definitions/grib2/tables/25/4.225.table create mode 100644 definitions/grib2/tables/25/4.227.table create mode 100644 definitions/grib2/tables/25/4.230.table create mode 100644 definitions/grib2/tables/25/4.233.table create mode 100644 definitions/grib2/tables/25/4.234.table create mode 100644 definitions/grib2/tables/25/4.236.table create mode 100644 definitions/grib2/tables/25/4.238.table create mode 100644 definitions/grib2/tables/25/4.240.table create mode 100644 definitions/grib2/tables/25/4.241.table create mode 100644 definitions/grib2/tables/25/4.242.table create mode 100644 definitions/grib2/tables/25/4.243.table create mode 100644 definitions/grib2/tables/25/4.244.table create mode 100644 definitions/grib2/tables/25/4.3.table create mode 100644 definitions/grib2/tables/25/4.4.table create mode 100644 definitions/grib2/tables/25/4.5.table create mode 100644 definitions/grib2/tables/25/4.6.table create mode 100644 definitions/grib2/tables/25/4.7.table create mode 100644 definitions/grib2/tables/25/4.8.table create mode 100644 definitions/grib2/tables/25/4.9.table create mode 100644 definitions/grib2/tables/25/4.91.table create mode 100644 definitions/grib2/tables/25/5.0.table create mode 100644 definitions/grib2/tables/25/5.1.table create mode 100644 definitions/grib2/tables/25/5.2.table create mode 100644 definitions/grib2/tables/25/5.25.table create mode 100644 definitions/grib2/tables/25/5.26.table create mode 100644 definitions/grib2/tables/25/5.3.table create mode 100644 definitions/grib2/tables/25/5.4.table create mode 100644 definitions/grib2/tables/25/5.40.table create mode 100644 definitions/grib2/tables/25/5.40000.table create mode 100644 definitions/grib2/tables/25/5.5.table create mode 100644 definitions/grib2/tables/25/5.50002.table create mode 100644 definitions/grib2/tables/25/5.6.table create mode 100644 definitions/grib2/tables/25/5.7.table create mode 100644 definitions/grib2/tables/25/6.0.table create mode 100644 definitions/grib2/tables/25/stepType.table diff --git a/definitions/grib1/section.1.def b/definitions/grib1/section.1.def index 55bbc4109..30f8fa627 100644 --- a/definitions/grib1/section.1.def +++ b/definitions/grib1/section.1.def @@ -149,6 +149,7 @@ if(table2Version >= 128) { concept paramIdECMF (defaultParameter,"paramId.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy; concept paramId (paramIdECMF,"paramId.def",conceptsMasterDir,conceptsLocalDirAll): long_type,dump; +transient pid = paramId : hidden; concept cfNameECMF(defaultName,"cfName.def",conceptsMasterDir,conceptsLocalDirECMF) : dump,no_copy,read_only; concept cfName(cfNameECMF,"cfName.def",conceptsMasterDir,conceptsLocalDirAll) : dump,no_copy,read_only; diff --git a/definitions/grib2/boot.def b/definitions/grib2/boot.def index 3c5021935..70a340824 100644 --- a/definitions/grib2/boot.def +++ b/definitions/grib2/boot.def @@ -9,7 +9,7 @@ # This gets updated twice a year by WMO. # See http://www.wmo.int/pages/prog/www/WMOCodes/WMO306_vI2/LatestVERSION/LatestVERSION.html -constant tablesVersionLatest = 24 : edition_specific; +constant tablesVersionLatest = 25 : edition_specific; constant million = 1000000 : hidden; constant grib2divider = 1000000; diff --git a/definitions/grib2/cfVarName.def b/definitions/grib2/cfVarName.def index 2c04c8507..97814a304 100644 --- a/definitions/grib2/cfVarName.def +++ b/definitions/grib2/cfVarName.def @@ -1409,6 +1409,18 @@ parameterCategory = 1 ; parameterNumber = 23 ; } +#Universal thermal climate index +'utci' = { + discipline = 20 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + } +#Mean radiant temperature +'mrt' = { + discipline = 20 ; + parameterCategory = 0 ; + parameterNumber = 1 ; + } #Virtual temperature 'vtmp' = { discipline = 0 ; diff --git a/definitions/grib2/name.def b/definitions/grib2/name.def index 1a40636d4..92b1e36f6 100644 --- a/definitions/grib2/name.def +++ b/definitions/grib2/name.def @@ -1409,6 +1409,18 @@ parameterCategory = 1 ; parameterNumber = 23 ; } +#Universal thermal climate index +'Universal thermal climate index' = { + discipline = 20 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + } +#Mean radiant temperature +'Mean radiant temperature' = { + discipline = 20 ; + parameterCategory = 0 ; + parameterNumber = 1 ; + } #Virtual temperature 'Virtual temperature' = { discipline = 0 ; diff --git a/definitions/grib2/paramId.def b/definitions/grib2/paramId.def index aa61bee1f..46cb35b69 100644 --- a/definitions/grib2/paramId.def +++ b/definitions/grib2/paramId.def @@ -1409,6 +1409,18 @@ parameterCategory = 1 ; parameterNumber = 23 ; } +#Universal thermal climate index +'261001' = { + discipline = 20 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + } +#Mean radiant temperature +'261002' = { + discipline = 20 ; + parameterCategory = 0 ; + parameterNumber = 1 ; + } #Virtual temperature '300012' = { discipline = 0 ; diff --git a/definitions/grib2/parameters.def b/definitions/grib2/parameters.def index fc3083ffb..bbebcd116 100644 --- a/definitions/grib2/parameters.def +++ b/definitions/grib2/parameters.def @@ -7,6 +7,7 @@ constant conceptsLocalDirECMF="grib2/localConcepts/ecmf" : hidden; concept paramIdECMF (defaultParameter,"paramId.def",conceptsMasterDir,conceptsLocalDirECMF): long_type,no_copy; concept paramId (paramIdECMF,"paramId.def",conceptsMasterDir,conceptsLocalDirAll): long_type; +transient pid = paramId : hidden; concept shortNameECMF (defaultShortName,"shortName.def",conceptsMasterDir,conceptsLocalDirECMF) : no_copy,dump; concept ls.shortName (shortNameECMF,"shortName.def",conceptsMasterDir,conceptsLocalDirAll) : no_copy,dump; diff --git a/definitions/grib2/shortName.def b/definitions/grib2/shortName.def index b5f18764a..b7531089f 100644 --- a/definitions/grib2/shortName.def +++ b/definitions/grib2/shortName.def @@ -1409,6 +1409,18 @@ parameterCategory = 1 ; parameterNumber = 23 ; } +#Universal thermal climate index +'utci' = { + discipline = 20 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + } +#Mean radiant temperature +'mrt' = { + discipline = 20 ; + parameterCategory = 0 ; + parameterNumber = 1 ; + } #Virtual temperature 'vtmp' = { discipline = 0 ; diff --git a/definitions/grib2/tables/0.0.table b/definitions/grib2/tables/0.0.table index 9308c3a64..415784e77 100644 --- a/definitions/grib2/tables/0.0.table +++ b/definitions/grib2/tables/0.0.table @@ -6,6 +6,6 @@ 4 4 Space weather products # 5-9 Reserved 10 10 Oceanographic products -# 11-191 Reserved +20 20 Health and socioeconomic impacts # 192-254 Reserved for local use 255 255 Missing diff --git a/definitions/grib2/tables/1.0.table b/definitions/grib2/tables/1.0.table index d577b64fc..10baa8a0a 100644 --- a/definitions/grib2/tables/1.0.table +++ b/definitions/grib2/tables/1.0.table @@ -24,5 +24,6 @@ 22 22 Version implemented on 7 November 2018 23 23 Version implemented on 15 May 2019 24 24 Version implemented on 6 November 2019 +25 25 Pre-operational to be implemented by next amendment # 25-254 Future versions 255 255 Master tables not used. Local table entries and local templates may use the entire range of the table, not just those sections marked Reserved for local used. diff --git a/definitions/grib2/tables/25/0.0.table b/definitions/grib2/tables/25/0.0.table new file mode 100644 index 000000000..56a45f249 --- /dev/null +++ b/definitions/grib2/tables/25/0.0.table @@ -0,0 +1,10 @@ +# Code table 0.0 - Discipline of processed data in the GRIB message, number of GRIB Master table +0 0 Meteorological products +1 1 Hydrological products +2 2 Land surface products +3 3 Satellite remote sensing products (formerly Space products) +4 4 Space weather products +10 10 Oceanographic products +20 20 Health and socioeconomic impacts +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/1.0.table b/definitions/grib2/tables/25/1.0.table new file mode 100644 index 000000000..e2fa20abe --- /dev/null +++ b/definitions/grib2/tables/25/1.0.table @@ -0,0 +1,28 @@ +# Code table 1.0 - GRIB master tables version number +0 0 Experimental +1 1 Version implemented on 7 November 2001 +2 2 Version implemented on 4 November 2003 +3 3 Version implemented on 2 November 2005 +4 4 Version implemented on 7 November 2007 +5 5 Version implemented on 4 November 2009 +6 6 Version implemented on 15 September 2010 +7 7 Version implemented on 4 May 2011 +8 8 Version implemented on 2 November 2011 +9 9 Version implemented on 2 May 2012 +10 10 Version implemented on 7 November 2012 +11 11 Version implemented on 8 May 2013 +12 12 Version implemented on 14 November 2013 +13 13 Version implemented on 7 May 2014 +14 14 Version implemented on 5 November 2014 +15 15 Version implemented on 6 May 2015 +16 16 Version implemented on 11 November 2015 +17 17 Version implemented on 4 May 2016 +18 18 Version implemented on 2 November 2016 +19 19 Version implemented on 3 May 2017 +20 20 Version implemented on 8 November 2017 +21 21 Version implemented on 2 May 2018 +22 22 Version implemented on 7 November 2018 +23 23 Version implemented on 15 May 2019 +24 24 Version implemented on 6 November 2019 +# 25-254 Future versions +255 255 Master tables not used. Local table entries and local templates may use the entire range of the table, not just those sections marked Reserved for local used. diff --git a/definitions/grib2/tables/25/1.1.table b/definitions/grib2/tables/25/1.1.table new file mode 100644 index 000000000..d50f8fd72 --- /dev/null +++ b/definitions/grib2/tables/25/1.1.table @@ -0,0 +1,4 @@ +# Code table 1.1 - GRIB local tables version number +0 0 Local tables not used. Only table entries and templates from the current master table are valid +# 1-254 Number of local tables version used +255 255 Missing diff --git a/definitions/grib2/tables/25/1.2.table b/definitions/grib2/tables/25/1.2.table new file mode 100644 index 000000000..934b70455 --- /dev/null +++ b/definitions/grib2/tables/25/1.2.table @@ -0,0 +1,8 @@ +# Code table 1.2 - Significance of reference time +0 0 Analysis +1 1 Start of forecast +2 2 Verifying time of forecast +3 3 Observation time +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/1.3.table b/definitions/grib2/tables/25/1.3.table new file mode 100644 index 000000000..dd7e68132 --- /dev/null +++ b/definitions/grib2/tables/25/1.3.table @@ -0,0 +1,16 @@ +# Code table 1.3 - Production status of data +0 0 Operational products +1 1 Operational test products +2 2 Research products +3 3 Re-analysis products +4 4 THORPEX Interactive Grand Global Ensemble (TIGGE) +5 5 THORPEX Interactive Grand Global Ensemble test (TIGGE) +6 6 S2S operational products +7 7 S2S test products +8 8 Uncertainties in Ensembles of Regional ReAnalyses project (UERRA) +9 9 Uncertainties in Ensembles of Regional ReAnalyses project test (UERRA) +10 10 Copernicus regional reanalysis (CARRA/CERRA) +11 11 Copernicus regional reanalysis test (CARRA/CERRA) +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/1.4.table b/definitions/grib2/tables/25/1.4.table new file mode 100644 index 000000000..03203d874 --- /dev/null +++ b/definitions/grib2/tables/25/1.4.table @@ -0,0 +1,13 @@ +# Code table 1.4 - Type of data +0 an Analysis products +1 fc Forecast products +2 af Analysis and forecast products +3 cf Control forecast products +4 pf Perturbed forecast products +5 cp Control and perturbed forecast products +6 sa Processed satellite observations +7 ra Processed radar observations +8 ep Event probability +# 9-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/25/1.5.table b/definitions/grib2/tables/25/1.5.table new file mode 100644 index 000000000..b2cf9f087 --- /dev/null +++ b/definitions/grib2/tables/25/1.5.table @@ -0,0 +1,7 @@ +# Code table 1.5 - Identification template number +0 0 Calendar definition +1 1 Paleontological offset +2 2 Calendar definition and paleontological offset +# 3-32767 Reserved +# 32768-65534 Reserved for local use +65535 65535 Missing diff --git a/definitions/grib2/tables/25/1.6.table b/definitions/grib2/tables/25/1.6.table new file mode 100644 index 000000000..5db921990 --- /dev/null +++ b/definitions/grib2/tables/25/1.6.table @@ -0,0 +1,8 @@ +# Code table 1.6 - Type of calendar +0 0 Gregorian +1 1 360-day +2 2 365-day +3 3 Proleptic Gregorian +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/3.0.table b/definitions/grib2/tables/25/3.0.table new file mode 100644 index 000000000..45187b80d --- /dev/null +++ b/definitions/grib2/tables/25/3.0.table @@ -0,0 +1,6 @@ +# Code table 3.0 - Source of grid definition +0 0 Specified in Code table 3.1 +1 1 Predetermined grid definition (Defined by originating centre) +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 A grid definition does not apply to this product diff --git a/definitions/grib2/tables/25/3.1.table b/definitions/grib2/tables/25/3.1.table new file mode 100644 index 000000000..ed68c5144 --- /dev/null +++ b/definitions/grib2/tables/25/3.1.table @@ -0,0 +1,54 @@ +# Code table 3.1 - Grid definition template number +0 0 Latitude/longitude (Also called equidistant cylindrical, or Plate Carree) +1 1 Rotated latitude/longitude +2 2 Stretched latitude/longitude +3 3 Stretched and rotated latitude/longitude +4 4 Variable resolution latitude/longitude +5 5 Variable resolution rotated latitude/longitude +# 6-9 Reserved +10 10 Mercator +# 11-12 Reserved +13 13 Mercator with modelling subdomains definition +# 14-19 Reserved +20 20 Polar stereographic projection (Can be south or north) +# 21-22 Reserved +23 23 Polar stereographic with modelling subdomains definition +# 24-29 Reserved +30 30 Lambert conformal (Can be secant or tangent, conical or bipolar) +31 31 Albers equal area +32 32 Reserved +33 33 Lambert conformal with modelling subdomains definition +# 34-39 Reserved +40 40 Gaussian latitude/longitude +41 41 Rotated Gaussian latitude/longitude +42 42 Stretched Gaussian latitude/longitude +43 43 Stretched and rotated Gaussian latitude/longitude +# 44-49 Reserved +50 50 Spherical harmonic coefficients +51 51 Rotated spherical harmonic coefficients +52 52 Stretched spherical harmonic coefficients +53 53 Stretched and rotated spherical harmonic coefficients +# 54-60 Reserved +61 61 Spectral Mercator with modelling subdomains definition +62 62 Spectral polar stereographic with modelling subdomains definition +63 63 Spectral Lambert conformal with modelling subdomains definition +# 64-89 Reserved +90 90 Space view perspective or orthographic +# 91-99 Reserved +100 100 Triangular grid based on an icosahedron +101 101 General unstructured grid +# 102-109 Reserved +110 110 Equatorial azimuthal equidistant projection +# 111-119 Reserved +120 120 Azimuth-range projection +# 121-139 Reserved +140 140 Lambert azimuthal equal area projection +# 141-999 Reserved +1000 1000 Cross-section grid with points equally spaced on the horizontal +# 1001-1099 Reserved +1100 1100 Hovmoller diagram grid with points equally spaced on the horizontal +# 1101-1199 Reserved +1200 1200 Time section grid +# 1201-32767 Reserved +# 32768-65534 Reserved for local use +65535 65535 Missing diff --git a/definitions/grib2/tables/25/3.10.table b/definitions/grib2/tables/25/3.10.table new file mode 100644 index 000000000..afa8843a7 --- /dev/null +++ b/definitions/grib2/tables/25/3.10.table @@ -0,0 +1,8 @@ +# Flag table 3.10 - Scanning mode for one diamond +1 0 Points scan in +i direction, i.e. from pole to Equator +1 1 Points scan in -i direction, i.e. from Equator to pole +2 0 Points scan in +j direction, i.e. from west to east +2 1 Points scan in -j direction, i.e. from east to west +3 0 Adjacent points in i direction are consecutive +3 1 Adjacent points in j direction are consecutive +# 4-8 Reserved diff --git a/definitions/grib2/tables/25/3.11.table b/definitions/grib2/tables/25/3.11.table new file mode 100644 index 000000000..e516a2ab9 --- /dev/null +++ b/definitions/grib2/tables/25/3.11.table @@ -0,0 +1,7 @@ +# Code table 3.11 - Interpretation of list of numbers at end of section 3 +0 0 There is no appended list +1 1 Numbers define number of points corresponding to full coordinate circles (i.e. parallels), coordinate values on each circle are multiple of the circle mesh, and extreme coordinate values given in grid definition (i.e. extreme longitudes) may not be reached in all rows +2 2 Numbers define number of points corresponding to coordinate lines delimited by extreme coordinate values given in grid definition (i.e. extreme longitudes) which are present in each row +3 3 Numbers define the actual latitudes for each row in the grid. The list of numbers are integer values of the valid latitudes in microdegrees (scaled by 10-6) or in unit equal to the ratio of the basic angle and the subdivisions number for each row, in the same order as specified in the scanning mode flag (bit no. 2) +# 4-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/25/3.15.table b/definitions/grib2/tables/25/3.15.table new file mode 100644 index 000000000..331217ebe --- /dev/null +++ b/definitions/grib2/tables/25/3.15.table @@ -0,0 +1,23 @@ +# Code table 3.15 - Physical meaning of vertical coordinate +# 0-19 Reserved +20 20 Temperature (K) +# 21-99 Reserved +100 100 Pressure (Pa) +101 101 Pressure deviation from mean sea level (Pa) +102 102 Altitude above mean sea level (m) +103 103 Height above ground (m) +104 104 Sigma coordinate +105 105 Hybrid coordinate +106 106 Depth below land surface (m) +107 pt Potential temperature (theta) (K) +108 108 Pressure deviation from ground to level (Pa) +109 pv Potential vorticity (K m-2 kg-1 s-1) +110 110 Geometrical height (m) +111 111 Eta coordinate +112 112 Geopotential height (gpm) +113 113 Logarithmic hybrid coordinate +# 114-159 Reserved +160 160 Depth below sea level (m) +# 161-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/3.2.table b/definitions/grib2/tables/25/3.2.table new file mode 100644 index 000000000..1b5c8241d --- /dev/null +++ b/definitions/grib2/tables/25/3.2.table @@ -0,0 +1,14 @@ +# Code table 3.2 - Shape of the Earth +0 0 Earth assumed spherical with radius = 6 367 470.0 m +1 1 Earth assumed spherical with radius specified (in m) by data producer +2 2 Earth assumed oblate spheroid with size as determined by IAU in 1965 (major axis = 6 378 160.0 m, minor axis = 6 356 775.0 m, f = 1/297.0) +3 3 Earth assumed oblate spheroid with major and minor axes specified (in km) by data producer +4 4 Earth assumed oblate spheroid as defined in IAG-GRS80 model (major axis = 6 378 137.0 m, minor axis = 6 356 752.314 m, f = 1/298.257 222 101) +5 5 Earth assumed represented by WGS-84 (as used by ICAO since 1998) +6 6 Earth assumed spherical with radius of 6 371 229.0 m +7 7 Earth assumed oblate spheroid with major or minor axes specified (in m) by data producer +8 8 Earth model assumed spherical with radius of 6 371 200 m, but the horizontal datum of the resulting latitude/longitude field is the WGS-84 reference frame +9 9 Earth represented by the Ordnance Survey Great Britain 1936 Datum, using the Airy 1830 Spheroid, the Greenwich meridian as 0 longitude, and the Newlyn datum as mean sea level, 0 height +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/3.20.table b/definitions/grib2/tables/25/3.20.table new file mode 100644 index 000000000..efbf08d19 --- /dev/null +++ b/definitions/grib2/tables/25/3.20.table @@ -0,0 +1,6 @@ +# Code table 3.20 - Type of horizontal line +0 0 Rhumb +1 1 Great circle +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/3.21.table b/definitions/grib2/tables/25/3.21.table new file mode 100644 index 000000000..88dbb9019 --- /dev/null +++ b/definitions/grib2/tables/25/3.21.table @@ -0,0 +1,8 @@ +# Code table 3.21 - Vertical dimension coordinate values definition +0 0 Explicit coordinate values set +1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 +# 2-10 Reserved +11 11 Geometric coordinates f(1) = C1, f(n) = C2 * f(n-1) +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/3.25.table b/definitions/grib2/tables/25/3.25.table new file mode 100644 index 000000000..de1bc74ed --- /dev/null +++ b/definitions/grib2/tables/25/3.25.table @@ -0,0 +1,10 @@ +# Code table 3.25 - Type of bi-Fourier truncation +# 0-76 Reserved +77 77 Rectangular +# 78-87 Reserved +88 88 Elliptic +# 89-98 Reserved +99 99 Diamond +# 100-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/3.3.table b/definitions/grib2/tables/25/3.3.table new file mode 100644 index 000000000..5dd7c7001 --- /dev/null +++ b/definitions/grib2/tables/25/3.3.table @@ -0,0 +1,9 @@ +# Flag table 3.3 - Resolution and component flags +# 1-2 Reserved +3 0 i direction increments not given +3 1 i direction increments given +4 0 j direction increments not given +4 1 j direction increments given +5 0 Resolved u- and v- components of vector quantities relative to easterly and northerly directions +5 1 Resolved u- and v- components of vector quantities relative to the defined grid in the direction of increasing x and y (or i and j) coordinates, respectively +# 6-8 Reserved - set to zero diff --git a/definitions/grib2/tables/25/3.4.table b/definitions/grib2/tables/25/3.4.table new file mode 100644 index 000000000..897b813d7 --- /dev/null +++ b/definitions/grib2/tables/25/3.4.table @@ -0,0 +1,17 @@ +# Flag table 3.4 - Scanning mode +1 0 Points of first row or column scan in the +i (+x) direction +1 1 Points of first row or column scan in the -i (-x) direction +2 0 Points of first row or column scan in the -j (-y) direction +2 1 Points of first row or column scan in the +j (+y) direction +3 0 Adjacent points in i (x) direction are consecutive +3 1 Adjacent points in j (y) direction is consecutive +4 0 All rows scan in the same direction +4 1 Adjacent rows scans in the opposite direction +5 0 Points within odd rows are not offset in i (x) direction +5 1 Points within odd rows are offset by Di/2 in i (x) direction +6 0 Points within even rows are not offset in i (x) direction +6 1 Points within even rows are offset by Di/2 in i (x) direction +7 0 Points are not offset in j (y) direction +7 1 Points are offset by Dj/2 in j (y) direction +8 0 Rows have Ni grid points and columns have Nj grid points +8 1 Rows have Ni grid points if points are not offset in i direction Rows have Ni-1 grid points if points are offset by Di/2 in i direction Columns have Nj grid points if points are not offset in j direction Columns have Nj-1 grid points if points are offset by Dj/2 in j direction diff --git a/definitions/grib2/tables/25/3.5.table b/definitions/grib2/tables/25/3.5.table new file mode 100644 index 000000000..eabdde896 --- /dev/null +++ b/definitions/grib2/tables/25/3.5.table @@ -0,0 +1,5 @@ +# Flag table 3.5 - Projection centre +1 0 North Pole is on the projection plane +1 1 South Pole is on the projection plane +2 0 Only one projection centre is used +2 1 Projection is bipolar and symmetric diff --git a/definitions/grib2/tables/25/3.6.table b/definitions/grib2/tables/25/3.6.table new file mode 100644 index 000000000..dc7d107aa --- /dev/null +++ b/definitions/grib2/tables/25/3.6.table @@ -0,0 +1,3 @@ +# Code table 3.6 - Spectral data representation type +1 1 see separate doc or pdf file +2 2 Bi-Fourier representation diff --git a/definitions/grib2/tables/25/3.7.table b/definitions/grib2/tables/25/3.7.table new file mode 100644 index 000000000..0a7d6efde --- /dev/null +++ b/definitions/grib2/tables/25/3.7.table @@ -0,0 +1,5 @@ +# Code table 3.7 - Spectral data representation mode +0 0 Reserved +1 1 see separate doc or pdf file +# 2-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/25/3.8.table b/definitions/grib2/tables/25/3.8.table new file mode 100644 index 000000000..844e74235 --- /dev/null +++ b/definitions/grib2/tables/25/3.8.table @@ -0,0 +1,7 @@ +# Code table 3.8 - Grid point position +0 0 Grid points at triangle vertices +1 1 Grid points at centres of triangles +2 2 Grid points at midpoints of triangle sides +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/3.9.table b/definitions/grib2/tables/25/3.9.table new file mode 100644 index 000000000..fd730bc64 --- /dev/null +++ b/definitions/grib2/tables/25/3.9.table @@ -0,0 +1,4 @@ +# Flag table 3.9 - Numbering order of diamonds as seen from the corresponding pole +1 0 Clockwise orientation +1 1 Anti-clockwise (i.e. counter-clockwise) orientation +# 2-8 Reserved diff --git a/definitions/grib2/tables/25/4.0.table b/definitions/grib2/tables/25/4.0.table new file mode 100644 index 000000000..0ea0af4ec --- /dev/null +++ b/definitions/grib2/tables/25/4.0.table @@ -0,0 +1,86 @@ +# Code table 4.0 - Product definition template number +0 0 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time +1 1 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time +2 2 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer at a point in time +3 3 Derived forecasts based on a cluster of ensemble members over a rectangular area at a horizontal level or in a horizontal layer at a point in time +4 4 Derived forecasts based on a cluster of ensemble members over a circular area at a horizontal level or in a horizontal layer at a point in time +5 5 Probability forecasts at a horizontal level or in a horizontal layer at a point in time +6 6 Percentile forecasts at a horizontal level or in a horizontal layer at a point in time +7 7 Analysis or forecast error at a horizontal level or in a horizontal layer at a point in time +8 8 Average, accumulation, extreme values or other statistically processed values at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +9 9 Probability forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +10 10 Percentile forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +11 11 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +12 12 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +13 13 Derived forecasts based on a cluster of ensemble members over a rectangular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +14 14 Derived forecasts based on a cluster of ensemble members over a circular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +15 15 Average, accumulation, extreme values, or other statistically processed values over a spatial area at a horizontal level or in a horizontal layer at a point in time +# 16-19 Reserved +20 20 Radar product +# 21-29 Reserved +30 30 Satellite product (deprecated) +31 31 Satellite product +32 32 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data +33 33 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data +34 34 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data +35 35 Satellite product with or without associated quality values +# 36-39 Reserved +40 40 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents +41 41 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents +42 42 Average, accumulation and/or extreme values or other statistically processed values at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents +43 43 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents +44 44 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for aerosol +45 45 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for aerosol +46 46 Average, accumulation, and/or extreme values or other statistically processed values at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for aerosol +47 47 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for aerosol +48 48 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol +49 49 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol +# 50 Reserved +51 51 Categorical forecasts at a horizontal level or in a horizontal layer at a point in time +# 52 Reserved +53 53 Partitioned parameters at a horizontal level or in a horizontal layer at a point in time +54 54 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for partitioned parameters +55 55 Spatio-temporal changing tiles at a horizontal level or horizontal layer at a point in time +56 56 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for spatio-temporal changing tile parameters (deprecated) +57 57 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents based on a distribution function +58 58 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents based on a distribution function +59 59 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for spatio-temporal changing tile parameters (corrected version of template 4.56) +60 60 Individual ensemble reforecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time +61 61 Individual ensemble reforecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous time interval +62 62 Average, accumulation and/or extreme values or other statistically processed values at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for spatio-temporal changing tiles at a horizontal level or horizontal layer at a point in time +63 63 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for spatio-temporal changing tiles +# 64-66 Reserved +67 67 Average, accumulation and/or extreme values or other statistically processed values at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents based on a distribution function +68 68 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents based on a distribution function +# 69 Reserved +70 70 Post-processing analysis or forecast at a horizontal level or in a horizontal layer at a point in time +71 71 Post-processing individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time +72 72 Post-processing average, accumulation, extreme values or other statistically processed values at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +73 73 Post-processing individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous time interval +# 74-75 Reserved +76 76 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents with source/sink +77 77 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents with source/sink +78 78 Average, accumulation, and/or extreme values or other statistically processed values at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents with source/sink +79 79 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents with source/sink +80 80 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol with source/sink +81 81 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol with source/sink +82 82 Average, accumulation, and/or extreme values or other statistically processed values at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for aerosol with source/sink +83 83 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for aerosol with source/sink +# 84-90 Reserved +91 91 Categorical forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +# 92-253 Reserved +254 254 CCITT IA5 character string +# 255-999 Reserved +1000 1000 Cross-section of analysis and forecast at a point in time +1001 1001 Cross-section of averaged or otherwise statistically processed analysis or forecast over a range of time +1002 1002 Cross-section of analysis and forecast, averaged or otherwise statistically processed over latitude or longitude +# 1003-1099 Reserved +1100 1100 Hovmoller-type grid with no averaging or other statistical processing +1101 1101 Hovmoller-type grid with averaging or other statistical processing +50001 50001 Forecasting Systems with Variable Resolution in a point in time +50011 50011 Forecasting Systems with Variable Resolution in a continous or non countinous time interval +# 1102-32767 Reserved +# 32768-65534 Reserved for local use +40033 40033 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data +40034 40034 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data +65535 65535 Missing diff --git a/definitions/grib2/tables/25/4.1.0.table b/definitions/grib2/tables/25/4.1.0.table new file mode 100644 index 000000000..04cfd7802 --- /dev/null +++ b/definitions/grib2/tables/25/4.1.0.table @@ -0,0 +1,27 @@ +# Code table 4.1 - Parameter category by product discipline +0 0 Temperature +1 1 Moisture +2 2 Momentum +3 3 Mass +4 4 Short-wave radiation +5 5 Long-wave radiation +6 6 Cloud +7 7 Thermodynamic stability indices +8 8 Kinematic stability indices +9 9 Temperature probabilities +10 10 Moisture probabilities +11 11 Momentum probabilities +12 12 Mass probabilities +13 13 Aerosols +14 14 Trace gases (e.g. ozone, CO2) +15 15 Radar +16 16 Forecast radar imagery +17 17 Electrodynamics +18 18 Nuclear/radiology +19 19 Physical atmospheric properties +20 20 Atmospheric chemical constituents +# 21-189 Reserved +190 190 CCITT IA5 string +191 191 Miscellaneous +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.1.1.table b/definitions/grib2/tables/25/4.1.1.table new file mode 100644 index 000000000..7b22b6fed --- /dev/null +++ b/definitions/grib2/tables/25/4.1.1.table @@ -0,0 +1,7 @@ +# Code table 4.1 - Parameter category by product discipline +0 0 Hydrology basic products +1 1 Hydrology probabilities +2 2 Inland water and sediment properties +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.1.10.table b/definitions/grib2/tables/25/4.1.10.table new file mode 100644 index 000000000..a9b20eb9c --- /dev/null +++ b/definitions/grib2/tables/25/4.1.10.table @@ -0,0 +1,10 @@ +# Code table 4.1 - Parameter category by product discipline +0 0 Waves +1 1 Currents +2 2 Ice +3 3 Surface properties +4 4 Subsurface properties +# 5-190 Reserved +191 191 Miscellaneous +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.1.192.table b/definitions/grib2/tables/25/4.1.192.table new file mode 100644 index 000000000..c428acab0 --- /dev/null +++ b/definitions/grib2/tables/25/4.1.192.table @@ -0,0 +1,4 @@ +#Discipline 192: ECMWF local parameters +255 255 Missing + + diff --git a/definitions/grib2/tables/25/4.1.2.table b/definitions/grib2/tables/25/4.1.2.table new file mode 100644 index 000000000..60e2452d4 --- /dev/null +++ b/definitions/grib2/tables/25/4.1.2.table @@ -0,0 +1,10 @@ +# Code table 4.1 - Parameter category by product discipline +0 0 Vegetation/biomass +1 1 Agri-/aquacultural special products +2 2 Transportation-related products +3 3 Soil products +4 4 Fire weather products +5 5 Glaciers and inland ice +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.1.20.table b/definitions/grib2/tables/25/4.1.20.table new file mode 100644 index 000000000..fe4362b3c --- /dev/null +++ b/definitions/grib2/tables/25/4.1.20.table @@ -0,0 +1,7 @@ +# Code table 4.1 - Parameter category by product discipline +0 0 Health indicators +1 1 Epidemiology +2 2 Socioeconomic indicators +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.1.3.table b/definitions/grib2/tables/25/4.1.3.table new file mode 100644 index 000000000..7bf60d4a7 --- /dev/null +++ b/definitions/grib2/tables/25/4.1.3.table @@ -0,0 +1,11 @@ +# Code table 4.1 - Parameter category by product discipline +0 0 Image format products +1 1 Quantitative products +2 2 Cloud properties +3 3 Flight rule conditions +4 4 Volcanic ash +5 5 Sea-surface temperature +6 6 Solar radiation +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.10.table b/definitions/grib2/tables/25/4.10.table new file mode 100644 index 000000000..1a92baaf6 --- /dev/null +++ b/definitions/grib2/tables/25/4.10.table @@ -0,0 +1,16 @@ +# Code table 4.10 - Type of statistical processing +0 avg Average +1 accum Accumulation +2 max Maximum +3 min Minimum +4 diff Difference (value at the end of time range minus value at the beginning) +5 rms Root mean square +6 sd Standard deviation +7 cov Covariance (temporal variance) +8 8 Difference (value at the start of time range minus value at the end) +9 ratio Ratio +10 10 Standardized anomaly +11 11 Summation +# 12-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/25/4.11.table b/definitions/grib2/tables/25/4.11.table new file mode 100644 index 000000000..7f404c849 --- /dev/null +++ b/definitions/grib2/tables/25/4.11.table @@ -0,0 +1,10 @@ +# Code table 4.11 - Type of time intervals +0 0 Reserved +1 1 Successive times processed have same forecast time, start time of forecast is incremented +2 2 Successive times processed have same start time of forecast, forecast time is incremented +3 3 Successive times processed have start time of forecast incremented and forecast time decremented so that valid time remains constant +4 4 Successive times processed have start time of forecast decremented and forecast time incremented so that valid time remains constant +5 5 Floating subinterval of time between forecast time and end of overall time interval +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.12.table b/definitions/grib2/tables/25/4.12.table new file mode 100644 index 000000000..03fd89b36 --- /dev/null +++ b/definitions/grib2/tables/25/4.12.table @@ -0,0 +1,7 @@ +# Code table 4.12 - Operating mode +0 0 Maintenance mode +1 1 Clear air +2 2 Precipitation +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.13.table b/definitions/grib2/tables/25/4.13.table new file mode 100644 index 000000000..c92854eec --- /dev/null +++ b/definitions/grib2/tables/25/4.13.table @@ -0,0 +1,6 @@ +# Code table 4.13 - Quality control indicator +0 0 No quality control applied +1 1 Quality control applied +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.14.table b/definitions/grib2/tables/25/4.14.table new file mode 100644 index 000000000..a88cb93fa --- /dev/null +++ b/definitions/grib2/tables/25/4.14.table @@ -0,0 +1,6 @@ +# Code table 4.14 - Clutter filter indicator +0 0 No clutter filter used +1 1 Clutter filter used +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.15.table b/definitions/grib2/tables/25/4.15.table new file mode 100644 index 000000000..2e5f3dea3 --- /dev/null +++ b/definitions/grib2/tables/25/4.15.table @@ -0,0 +1,11 @@ +# Code table 4.15 - Type of spatial processing used to arrive at given data value from the source data +0 0 Data is calculated directly from the source grid with no interpolation +1 1 Bilinear interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +2 2 Bicubic interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +3 3 Using the value from the source grid grid-point which is nearest to the nominal grid-point +4 4 Budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +5 5 Spectral interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +6 6 Neighbor-budget interpolation using the 4 source grid grid-point values surrounding the nominal grid-point +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.16.table b/definitions/grib2/tables/25/4.16.table new file mode 100644 index 000000000..de025080a --- /dev/null +++ b/definitions/grib2/tables/25/4.16.table @@ -0,0 +1,9 @@ +# Code table 4.16 - Quality value associated with parameter +0 0 Confidence index +1 1 Quality indicator +2 2 Correlation of product with used calibration product +3 3 Standard deviation +4 4 Random error +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.192.table b/definitions/grib2/tables/25/4.192.table new file mode 100644 index 000000000..e1fd91594 --- /dev/null +++ b/definitions/grib2/tables/25/4.192.table @@ -0,0 +1,4 @@ +1 1 first +2 2 second +3 3 third +4 4 fourth diff --git a/definitions/grib2/tables/25/4.2.0.0.table b/definitions/grib2/tables/25/4.2.0.0.table new file mode 100644 index 000000000..7201a8667 --- /dev/null +++ b/definitions/grib2/tables/25/4.2.0.0.table @@ -0,0 +1,34 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Temperature (K) +1 1 Virtual temperature (K) +2 2 Potential temperature (K) +3 3 Pseudo-adiabatic potential temperature or equivalent potential temperature (K) +4 4 Maximum temperature (K) +5 5 Minimum temperature (K) +6 6 Dewpoint temperature (K) +7 7 Dewpoint depression (or deficit) (K) +8 8 Lapse rate (K/m) +9 9 Temperature anomaly (K) +10 10 Latent heat net flux (W m-2) +11 11 Sensible heat net flux (W m-2) +12 12 Heat index (K) +13 13 Wind chill factor (K) +14 14 Minimum dewpoint depression (K) +15 15 Virtual potential temperature (K) +16 16 Snow phase change heat flux (W m-2) +17 17 Skin temperature (K) +18 18 Snow temperature (top of snow) (K) +19 19 Turbulent transfer coefficient for heat (Numeric) +20 20 Turbulent diffusion coefficient for heat (m2/s) +21 21 Apparent temperature (K) +22 22 Temperature tendency due to short-wave radiation (K s-1) +23 23 Temperature tendency due to long-wave radiation (K s-1) +24 24 Temperature tendency due to short-wave radiation, clear sky (K s-1) +25 25 Temperature tendency due to long-wave radiation, clear sky (K s-1) +26 26 Temperature tendency due to parameterization (K s-1) +27 27 Wet-bulb temperature (K) +28 28 Unbalanced component of temperature (K) +29 29 Temperature advection (K s-1) +# 30-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.0.1.table b/definitions/grib2/tables/25/4.2.0.1.table new file mode 100644 index 000000000..ef6d2ed7e --- /dev/null +++ b/definitions/grib2/tables/25/4.2.0.1.table @@ -0,0 +1,141 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Specific humidity (kg/kg) +1 1 Relative humidity (%) +2 2 Humidity mixing ratio (kg/kg) +3 3 Precipitable water (kg m-2) +4 4 Vapour pressure (Pa) +5 5 Saturation deficit (Pa) +6 6 Evaporation (kg m-2) +7 7 Precipitation rate (kg m-2 s-1) +8 8 Total precipitation (kg m-2) +9 9 Large-scale precipitation (non-convective) (kg m-2) +10 10 Convective precipitation (kg m-2) +11 11 Snow depth (m) +12 12 Snowfall rate water equivalent (kg m-2 s-1) +13 13 Water equivalent of accumulated snow depth (kg m-2) +14 14 Convective snow (kg m-2) +15 15 Large-scale snow (kg m-2) +16 16 Snow melt (kg m-2) +17 17 Snow age (d) +18 18 Absolute humidity (kg m-3) +19 19 Precipitation type (Code table 4.201) +20 20 Integrated liquid water (kg m-2) +21 21 Condensate (kg/kg) +22 22 Cloud mixing ratio (kg/kg) +23 23 Ice water mixing ratio (kg/kg) +24 24 Rain mixing ratio (kg/kg) +25 25 Snow mixing ratio (kg/kg) +26 26 Horizontal moisture convergence (kg kg-1 s-1) +27 27 Maximum relative humidity (%) +28 28 Maximum absolute humidity (kg m-3) +29 29 Total snowfall (m) +30 30 Precipitable water category (Code table 4.202) +31 31 Hail (m) +32 32 Graupel (snow pellets) (kg/kg) +33 33 Categorical rain (Code table 4.222) +34 34 Categorical freezing rain (Code table 4.222) +35 35 Categorical ice pellets (Code table 4.222) +36 36 Categorical snow (Code table 4.222) +37 37 Convective precipitation rate (kg m-2 s-1) +38 38 Horizontal moisture divergence (kg kg-1 s-1) +39 39 Per cent frozen precipitation (%) +40 40 Potential evaporation (kg m-2) +41 41 Potential evaporation rate (W m-2) +42 42 Snow cover (%) +43 43 Rain fraction of total cloud water (Proportion) +44 44 Rime factor (Numeric) +45 45 Total column integrated rain (kg m-2) +46 46 Total column integrated snow (kg m-2) +47 47 Large scale water precipitation (non-convective) (kg m-2) +48 48 Convective water precipitation (kg m-2) +49 49 Total water precipitation (kg m-2) +50 50 Total snow precipitation (kg m-2) +51 51 Total column water (Vertically integrated total water=vapour + cloud water/ice) (kg m-2) +52 52 Total precipitation rate (kg m-2 s-1) +53 53 Total snowfall rate water equivalent (kg m-2 s-1) +54 54 Large scale precipitation rate (kg m-2 s-1) +55 55 Convective snowfall rate water equivalent (kg m-2 s-1) +56 56 Large scale snowfall rate water equivalent (kg m-2 s-1) +57 57 Total snowfall rate (m/s) +58 58 Convective snowfall rate (m/s) +59 59 Large scale snowfall rate (m/s) +60 60 Snow depth water equivalent (kg m-2) +61 61 Snow density (kg m-3) +62 62 Snow evaporation (kg m-2) +63 63 Reserved +64 64 Total column integrated water vapour (kg m-2) +65 65 Rain precipitation rate (kg m-2 s-1) +66 66 Snow precipitation rate (kg m-2 s-1) +67 67 Freezing rain precipitation rate (kg m-2 s-1) +68 68 Ice pellets precipitation rate (kg m-2 s-1) +69 69 Total column integrated cloud water (kg m-2) +70 70 Total column integrated cloud ice (kg m-2) +71 71 Hail mixing ratio (kg/kg) +72 72 Total column integrated hail (kg m-2) +73 73 Hail precipitation rate (kg m-2 s-1) +74 74 Total column integrated graupel (kg m-2) +75 75 Graupel (snow pellets) precipitation rate (kg m-2 s-1) +76 76 Convective rain rate (kg m-2 s-1) +77 77 Large scale rain rate (kg m-2 s-1) +78 78 Total column integrated water (all components including precipitation) (kg m-2) +79 79 Evaporation rate (kg m-2 s-1) +80 80 Total condensate (kg/kg) +81 81 Total column-integrated condensate (kg m-2) +82 82 Cloud ice mixing-ratio (kg/kg) +83 83 Specific cloud liquid water content (kg/kg) +84 84 Specific cloud ice water content (kg/kg) +85 85 Specific rainwater content (kg/kg) +86 86 Specific snow water content (kg/kg) +87 87 Stratiform precipitation rate (kg m-2 s-1) +88 88 Categorical convective precipitation (Code table 4.222) +# 89 Reserved +90 90 Total kinematic moisture flux (kg kg-1 m s-1) +91 91 u-component (zonal) kinematic moisture flux (kg kg-1 m s-1) +92 92 v-component (meridional) kinematic moisture flux (kg kg-1 m s-1) +93 93 Relative humidity with respect to water (%) +94 94 Relative humidity with respect to ice (%) +95 95 Freezing or frozen precipitation rate (kg m-2 s-1) +96 96 Mass density of rain (kg m-3) +97 97 Mass density of snow (kg m-3) +98 98 Mass density of graupel (kg m-3) +99 99 Mass density of hail (kg m-3) +100 100 Specific number concentration of rain (kg-1) +101 101 Specific number concentration of snow (kg-1) +102 102 Specific number concentration of graupel (kg-1) +103 103 Specific number concentration of hail (kg-1) +104 104 Number density of rain (m-3) +105 105 Number density of snow (m-3) +106 106 Number density of graupel (m-3) +107 107 Number density of hail (m-3) +108 108 Specific humidity tendency due to parameterization (kg kg-1 s-1) +109 109 Mass density of liquid water coating on hail expressed as mass of liquid water per unit volume of air (kg m-3) +110 110 Specific mass of liquid water coating on hail expressed as mass of liquid water per unit mass of moist air (kg kg-1) +111 111 Mass mixing ratio of liquid water coating on hail expressed as mass of liquid water per unit mass of dry air (kg kg-1) +112 112 Mass density of liquid water coating on graupel expressed as mass of liquid water per unit volume of air (kg m-3) +113 113 Specific mass of liquid water coating on graupel expressed as mass of liquid water per unit mass of moist air (kg kg-1) +114 114 Mass mixing ratio of liquid water coating on graupel expressed as mass of liquid water per unit mass of dry air (kg kg-1) +115 115 Mass density of liquid water coating on snow expressed as mass of liquid water per unit volume of air (kg m-3) +116 116 Specific mass of liquid water coating on snow expressed as mass of liquid water per unit mass of moist air (kg kg-1) +117 117 Mass mixing ratio of liquid water coating on snow expressed as mass of liquid water per unit mass of dry air (kg kg-1) +118 118 Unbalanced component of specific humidity (kg kg-1) +119 119 Unbalanced component of specific cloud liquid water content (kg kg-1) +120 120 Unbalanced component of specific cloud ice water content (kg kg-1) +121 121 Fraction of snow cover (Proportion) +# 122-128 Reserved +129 129 Effective radius of cloud water (m) +130 130 Effective radius of rain (m) +131 131 Effective radius of cloud ice (m) +132 132 Effective radius of snow (m) +133 133 Effective radius of graupel (m) +134 134 Effective radius of hail (m) +135 135 Effective radius of subgrid liquid clouds (m) +136 136 Effective radius of subgrid ice clouds (m) +137 137 Effective aspect ratio of rain (-) +138 138 Effective aspect ratio of cloud ice (-) +139 139 Effective aspect ratio of snow (-) +140 140 Effective aspect ratio of graupel (-) +141 141 Effective aspect ratio of hail (-) +142 142 Effective aspect ratio of subgrid ice clouds (-) +# 143-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.0.13.table b/definitions/grib2/tables/25/4.2.0.13.table new file mode 100644 index 000000000..5086101ad --- /dev/null +++ b/definitions/grib2/tables/25/4.2.0.13.table @@ -0,0 +1,5 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Aerosol type (Code table 4.205) +# 1-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.0.14.table b/definitions/grib2/tables/25/4.2.0.14.table new file mode 100644 index 000000000..215884737 --- /dev/null +++ b/definitions/grib2/tables/25/4.2.0.14.table @@ -0,0 +1,7 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Total ozone (DU) +1 1 Ozone mixing ratio (kg/kg) +2 2 Total column integrated ozone (DU) +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.0.15.table b/definitions/grib2/tables/25/4.2.0.15.table new file mode 100644 index 000000000..dfbc4d12f --- /dev/null +++ b/definitions/grib2/tables/25/4.2.0.15.table @@ -0,0 +1,21 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Base spectrum width (m/s) +1 1 Base reflectivity (dB) +2 2 Base radial velocity (m/s) +3 3 Vertically integrated liquid water (VIL) (kg m-2) +4 4 Layer-maximum base reflectivity (dB) +5 5 Precipitation (kg m-2) +6 6 Radar spectra (1) (-) +7 7 Radar spectra (2) (-) +8 8 Radar spectra (3) (-) +9 9 Reflectivity of cloud droplets (dB) +10 10 Reflectivity of cloud ice (dB) +11 11 Reflectivity of snow (dB) +12 12 Reflectivity of rain (dB) +13 13 Reflectivity of graupel (dB) +14 14 Reflectivity of hail (dB) +15 15 Hybrid scan reflectivity (dB) +16 16 Hybrid scan reflectivity height (m) +# 17-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.0.16.table b/definitions/grib2/tables/25/4.2.0.16.table new file mode 100644 index 000000000..0c240a853 --- /dev/null +++ b/definitions/grib2/tables/25/4.2.0.16.table @@ -0,0 +1,10 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Equivalent radar reflectivity factor for rain (mm6 m-3) +1 1 Equivalent radar reflectivity factor for snow (mm6 m-3) +2 2 Equivalent radar reflectivity factor for parameterized convection (mm6 m-3) +3 3 Echo top (m) +4 4 Reflectivity (dB) +5 5 Composite reflectivity (dB) +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.0.17.table b/definitions/grib2/tables/25/4.2.0.17.table new file mode 100644 index 000000000..ce1867aca --- /dev/null +++ b/definitions/grib2/tables/25/4.2.0.17.table @@ -0,0 +1,6 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Lightning strike density (m-2 s-1) +1 1 Lightning potential index (LPI) (J kg-1) +2 2 Cloud-to-ground Lightning flash density (km-2 day-1) +3 3 Cloud-to-cloud Lightning flash density (km-2 day-1) +4 4 Total Lightning flash density (km-2 day-1) diff --git a/definitions/grib2/tables/25/4.2.0.18.table b/definitions/grib2/tables/25/4.2.0.18.table new file mode 100644 index 000000000..9d106f419 --- /dev/null +++ b/definitions/grib2/tables/25/4.2.0.18.table @@ -0,0 +1,23 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Air concentration of caesium 137 (Bq m-3) +1 1 Air concentration of iodine 131 (Bq m-3) +2 2 Air concentration of radioactive pollutant (Bq m-3) +3 3 Ground deposition of caesium 137 (Bq m-2) +4 4 Ground deposition of iodine 131 (Bq m-2) +5 5 Ground deposition of radioactive pollutant (Bq m-2) +6 6 Time-integrated air concentration of caesium pollutant (Bq s m-3) +7 7 Time-integrated air concentration of iodine pollutant (Bq s m-3) +8 8 Time-integrated air concentration of radioactive pollutant (Bq s m-3) +9 9 Reserved +10 10 Air concentration (Bq m-3) +11 11 Wet deposition (Bq m-2) +12 12 Dry deposition (Bq m-2) +13 13 Total deposition (wet + dry) (Bq m-2) +14 14 Specific activity concentration (Bq kg-1) +15 15 Maximum of air concentration in layer (Bq m-3) +16 16 Height of maximum air concentration (m) +17 17 Column-integrated air concentration (Bq m-2) +18 18 Column-averaged air concentration in layer (Bq m-3) +# 19-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.0.19.table b/definitions/grib2/tables/25/4.2.0.19.table new file mode 100644 index 000000000..015a49a45 --- /dev/null +++ b/definitions/grib2/tables/25/4.2.0.19.table @@ -0,0 +1,41 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Visibility (m) +1 1 Albedo (%) +2 2 Thunderstorm probability (%) +3 3 Mixed layer depth (m) +4 4 Volcanic ash (Code table 4.206) +5 5 Icing top (m) +6 6 Icing base (m) +7 7 Icing (Code table 4.207) +8 8 Turbulence top (m) +9 9 Turbulence base (m) +10 10 Turbulence (Code table 4.208) +11 11 Turbulent kinetic energy (J/kg) +12 12 Planetary boundary-layer regime (Code table 4.209) +13 13 Contrail intensity (Code table 4.210) +14 14 Contrail engine type (Code table 4.211) +15 15 Contrail top (m) +16 16 Contrail base (m) +17 17 Maximum snow albedo (%) +18 18 Snow free albedo (%) +19 19 Snow albedo (%) +20 20 Icing (%) +21 21 In-cloud turbulence (%) +22 22 Clear air turbulence (CAT) (%) +23 23 Supercooled large droplet probability (%) +24 24 Convective turbulent kinetic energy (J/kg) +25 25 Weather (Code table 4.225) +26 26 Convective outlook (Code table 4.224) +27 27 Icing scenario (Code table 4.227) +28 28 Mountain wave turbulence (eddy dissipation rate) (m2/3 s-1) +29 29 Clear air turbulence (CAT) (m2/3 s-1) +30 30 Eddy dissipation parameter (m2/3 s-1) +31 31 Maximum of eddy dissipation parameter in layer (m2/3 s-1) +32 32 Highest freezing level (m) +33 33 Visibility through liquid fog (m) +34 34 Visibility through ice fog (m) +35 35 Visibility through blowing snow (m) +36 36 Presence of snow squalls (Code table 4.222) +# 37-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.0.190.table b/definitions/grib2/tables/25/4.2.0.190.table new file mode 100644 index 000000000..de621a924 --- /dev/null +++ b/definitions/grib2/tables/25/4.2.0.190.table @@ -0,0 +1,5 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Arbitrary text string (CCITT IA5) +# 1-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.0.191.table b/definitions/grib2/tables/25/4.2.0.191.table new file mode 100644 index 000000000..e3bba0ebe --- /dev/null +++ b/definitions/grib2/tables/25/4.2.0.191.table @@ -0,0 +1,8 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Seconds prior to initial reference time (defined in Section 1) (s) +1 1 Geographical latitude (deg N) +2 2 Geographical longitude (deg E) +3 3 Days since last observation (d) +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.0.2.table b/definitions/grib2/tables/25/4.2.0.2.table new file mode 100644 index 000000000..5446262e6 --- /dev/null +++ b/definitions/grib2/tables/25/4.2.0.2.table @@ -0,0 +1,51 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Wind direction (from which blowing) (degree true) +1 1 Wind speed (m/s) +2 2 u-component of wind (m/s) +3 3 v-component of wind (m/s) +4 4 Stream function (m2/s) +5 5 Velocity potential (m2/s) +6 6 Montgomery stream function (m2 s-2) +7 7 Sigma coordinate vertical velocity (/s) +8 8 Vertical velocity (pressure) (Pa/s) +9 9 Vertical velocity (geometric) (m/s) +10 10 Absolute vorticity (/s) +11 11 Absolute divergence (/s) +12 12 Relative vorticity (/s) +13 13 Relative divergence (/s) +14 14 Potential vorticity (K m2 kg-1 s-1) +15 15 Vertical u-component shear (/s) +16 16 Vertical v-component shear (/s) +17 17 Momentum flux, u-component (N m-2) +18 18 Momentum flux, v-component (N m-2) +19 19 Wind mixing energy (J) +20 20 Boundary layer dissipation (W m-2) +21 21 Maximum wind speed (m/s) +22 22 Wind speed (gust) (m/s) +23 23 u-component of wind (gust) (m/s) +24 24 v-component of wind (gust) (m/s) +25 25 Vertical speed shear (/s) +26 26 Horizontal momentum flux (N m-2) +27 27 u-component storm motion (m/s) +28 28 v-component storm motion (m/s) +29 29 Drag coefficient (Numeric) +30 30 Frictional velocity (m/s) +31 31 Turbulent diffusion coefficient for momentum (m2/s) +32 32 Eta coordinate vertical velocity (/s) +33 33 Wind fetch (m) +34 34 Normal wind component (m/s) +35 35 Tangential wind component (m/s) +36 36 Amplitude function for Rossby wave envelope for meridional wind (m/s) +37 37 Northward turbulent surface stress (N m-2 s) +38 38 Eastward turbulent surface stress (N m-2 s) +39 39 Eastward wind tendency due to parameterization (m s-2) +40 40 Northward wind tendency due to parameterization (m s-2) +41 41 u-component of geostrophic wind (m s-1) +42 42 v-component of geostrophic wind (m s-1) +43 43 Geostrophic wind direction (degree true) +44 44 Geostrophic wind speed (m s-1) +45 45 Unbalanced component of divergence (s-1) +46 46 Vorticity advection (s-2) +# 47-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.0.20.table b/definitions/grib2/tables/25/4.2.0.20.table new file mode 100644 index 000000000..042732760 --- /dev/null +++ b/definitions/grib2/tables/25/4.2.0.20.table @@ -0,0 +1,64 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Mass density (concentration) (kg m-3) +1 1 Column-integrated mass density (kg m-2) +2 2 Mass mixing ratio (mass fraction in air) (kg/kg) +3 3 Atmosphere emission mass flux (kg m-2 s-1) +4 4 Atmosphere net production mass flux (kg m-2 s-1) +5 5 Atmosphere net production and emission mass flux (kg m-2 s-1) +6 6 Surface dry deposition mass flux (kg m-2 s-1) +7 7 Surface wet deposition mass flux (kg m-2 s-1) +8 8 Atmosphere re-emission mass flux (kg m-2 s-1) +9 9 Wet deposition by large-scale precipitation mass flux (kg m-2 s-1) +10 10 Wet deposition by convective precipitation mass flux (kg m-2 s-1) +11 11 Sedimentation mass flux (kg m-2 s-1) +12 12 Dry deposition mass flux (kg m-2 s-1) +13 13 Transfer from hydrophobic to hydrophilic (kg kg-1 s-1) +14 14 Transfer from SO2 (sulphur dioxide) to SO4 (sulphate) (kg kg-1 s-1) +15 15 Dry deposition velocity (m/s) +16 16 Mass mixing ratio with respect to dry air (kg/kg) +17 17 Mass mixing ratio with respect to wet air (kg/kg) +# 18-49 Reserved +50 50 Amount in atmosphere (mol) +51 51 Concentration in air (mol m-3) +52 52 Volume mixing ratio (fraction in air) (mol/mol) +53 53 Chemical gross production rate of concentration (mol m-3 s-1) +54 54 Chemical gross destruction rate of concentration (mol m-3 s-1) +55 55 Surface flux (mol m-2 s-1) +56 56 Changes of amount in atmosphere (mol/s) +57 57 Total yearly average burden of the atmosphere (mol) +58 58 Total yearly averaged atmospheric loss (mol/s) +59 59 Aerosol number concentration (m-3) +60 60 Aerosol specific number concentration (kg-1) +61 61 Maximum of mass density in layer (kg m-3) +62 62 Height of maximum mass density (m) +63 63 Column-averaged mass density in layer (kg m-3) +64 64 Mole fraction with respect to dry air (mol/mol) +65 65 Mole fraction with respect to wet air (mol/mol) +66 66 Column-integrated in-cloud scavenging rate by precipitation (kg m-2 s-1) +67 67 Column-integrated below-cloud scavenging rate by precipitation (kg m-2 s-1) +68 68 Column-integrated release rate from evaporating precipitation (kg m-2 s-1) +69 69 Column-integrated in-cloud scavenging rate by large-scale precipitation (kg m-2 s-1) +70 70 Column-integrated below-cloud scavenging rate by large-scale precipitation (kg m-2 s-1) +71 71 Column-integrated release rate from evaporating large-scale precipitation (kg m-2 s-1) +72 72 Column-integrated in-cloud scavenging rate by convective precipitation (kg m-2 s-1) +73 73 Column-integrated below-cloud scavenging rate by convective precipitation (kg m-2 s-1) +74 74 Column-integrated release rate from evaporating convective precipitation (kg m-2 s-1) +75 75 Wildfire flux (kg m-2 s-1) +76 76 Emission rate (kg kg-1 s-1) +77 77 Surface emission flux (kg m-2 s-1) +# 78-99 Reserved +100 100 Surface area density (aerosol) (/m) +101 101 Vertical visual range (m) +102 102 Aerosol optical thickness (Numeric) +103 103 Single scattering albedo (Numeric) +104 104 Asymmetry factor (Numeric) +105 105 Aerosol extinction coefficient (/m) +106 106 Aerosol absorption coefficient (/m) +107 107 Aerosol lidar backscatter from satellite (m-1 sr-1) +108 108 Aerosol lidar backscatter from the ground (m-1 sr-1) +109 109 Aerosol lidar extinction from satellite (/m) +110 110 Aerosol lidar extinction from the ground (/m) +111 111 Angstrom exponent (Numeric) +# 112-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.0.3.table b/definitions/grib2/tables/25/4.2.0.3.table new file mode 100644 index 000000000..34941dcab --- /dev/null +++ b/definitions/grib2/tables/25/4.2.0.3.table @@ -0,0 +1,36 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Pressure (Pa) +1 1 Pressure reduced to MSL (Pa) +2 2 Pressure tendency (Pa/s) +3 3 ICAO Standard Atmosphere Reference Height (m) +4 4 Geopotential (m2 s-2) +5 5 Geopotential height (gpm) +6 6 Geometric height (m) +7 7 Standard deviation of height (m) +8 8 Pressure anomaly (Pa) +9 9 Geopotential height anomaly (gpm) +10 10 Density (kg m-3) +11 11 Altimeter setting (Pa) +12 12 Thickness (m) +13 13 Pressure altitude (m) +14 14 Density altitude (m) +15 15 5-wave geopotential height (gpm) +16 16 Zonal flux of gravity wave stress (N m-2) +17 17 Meridional flux of gravity wave stress (N m-2) +18 18 Planetary boundary layer height (m) +19 19 5-wave geopotential height anomaly (gpm) +20 20 Standard deviation of sub-grid scale orography (m) +21 21 Angle of sub-gridscale orography (rad) +22 22 Slope of sub-gridscale orography (Numeric) +23 23 Gravity wave dissipation (W m-2) +24 24 Anisotropy of sub-gridscale orography (Numeric) +25 25 Natural logarithm of pressure in Pa (Numeric) +26 26 Exner pressure (Numeric) +27 27 Updraught mass flux (kg m-2 s-1) +28 28 Downdraught mass flux (kg m-2 s-1) +29 29 Updraught detrainment rate (kg m-3 s-1) +30 30 Downdraught detrainment rate (kg m-3 s-1) +31 31 Unbalanced component of logarithm of surface pressure (-) +# 32-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.0.4.table b/definitions/grib2/tables/25/4.2.0.4.table new file mode 100644 index 000000000..0a5ded2b5 --- /dev/null +++ b/definitions/grib2/tables/25/4.2.0.4.table @@ -0,0 +1,24 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Net short-wave radiation flux (surface) (W m-2) +1 1 Net short-wave radiation flux (top of atmosphere) (W m-2) +2 2 Short-wave radiation flux (W m-2) +3 3 Global radiation flux (W m-2) +4 4 Brightness temperature (K) +5 5 Radiance (with respect to wave number) (W m-1 sr-1) +6 6 Radiance (with respect to wavelength) (W m-3 sr-1) +7 7 Downward short-wave radiation flux (W m-2) +8 8 Upward short-wave radiation flux (W m-2) +9 9 Net short wave radiation flux (W m-2) +10 10 Photosynthetically active radiation (W m-2) +11 11 Net short-wave radiation flux, clear sky (W m-2) +12 12 Downward UV radiation (W m-2) +13 13 Direct short-wave radiation flux (W m-2) +14 14 Diffuse short-wave radiation flux (W m-2) +# 15-49 Reserved +50 50 UV index (under clear sky) (Numeric) +51 51 UV index (Numeric) +52 52 Downward short-wave radiation flux, clear sky (W m-2) +53 53 Upward short-wave radiation flux, clear sky (W m-2) +# 54-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.0.5.table b/definitions/grib2/tables/25/4.2.0.5.table new file mode 100644 index 000000000..4550220b6 --- /dev/null +++ b/definitions/grib2/tables/25/4.2.0.5.table @@ -0,0 +1,13 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Net long-wave radiation flux (surface) (W m-2) +1 1 Net long-wave radiation flux (top of atmosphere) (W m-2) +2 2 Long-wave radiation flux (W m-2) +3 3 Downward long-wave radiation flux (W m-2) +4 4 Upward long-wave radiation flux (W m-2) +5 5 Net long-wave radiation flux (W m-2) +6 6 Net long-wave radiation flux, clear sky (W m-2) +7 7 Brightness temperature (K) +8 8 Downward long-wave radiation flux, clear sky (W m-2) +# 9-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.0.6.table b/definitions/grib2/tables/25/4.2.0.6.table new file mode 100644 index 000000000..4cec0c8aa --- /dev/null +++ b/definitions/grib2/tables/25/4.2.0.6.table @@ -0,0 +1,49 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Cloud ice (kg m-2) +1 1 Total cloud cover (%) +2 2 Convective cloud cover (%) +3 3 Low cloud cover (%) +4 4 Medium cloud cover (%) +5 5 High cloud cover (%) +6 6 Cloud water (kg m-2) +7 7 Cloud amount (%) +8 8 Cloud type (Code table 4.203) +9 9 Thunderstorm maximum tops (m) +10 10 Thunderstorm coverage (Code table 4.204) +11 11 Cloud base (m) +12 12 Cloud top (m) +13 13 Ceiling (m) +14 14 Non-convective cloud cover (%) +15 15 Cloud work function (J/kg) +16 16 Convective cloud efficiency (Proportion) +17 17 Total condensate (kg/kg) +18 18 Total column-integrated cloud water (kg m-2) +19 19 Total column-integrated cloud ice (kg m-2) +20 20 Total column-integrated condensate (kg m-2) +21 21 Ice fraction of total condensate (Proportion) +22 22 Cloud cover (%) +23 23 Cloud ice mixing ratio (kg/kg) +24 24 Sunshine (Numeric) +25 25 Horizontal extent of cumulonimbus (CB) (%) +26 26 Height of convective cloud base (m) +27 27 Height of convective cloud top (m) +28 28 Number of cloud droplets per unit mass of air (/kg) +29 29 Number of cloud ice particles per unit mass of air (/kg) +30 30 Number density of cloud droplets (m-3) +31 31 Number density of cloud ice particles (m-3) +32 32 Fraction of cloud cover (Numeric) +33 33 Sunshine duration (s) +34 34 Surface long-wave effective total cloudiness (Numeric) +35 35 Surface short-wave effective total cloudiness (Numeric) +36 36 Fraction of stratiform precipitation cover (Proportion) +37 37 Fraction of convective precipitation cover (Proportion) +38 38 Mass density of cloud droplets (kg m-3) +39 39 Mass density of cloud ice (kg m-3) +40 40 Mass density of convective cloud water droplets (kg m-3) +# 41-46 Reserved +47 47 Volume fraction of cloud water droplets (Numeric) +48 48 Volume fraction of cloud ice particles (Numeric) +49 49 Volume fraction of cloud (ice and/or water) (Numeric) +# 50-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.0.7.table b/definitions/grib2/tables/25/4.2.0.7.table new file mode 100644 index 000000000..aff6a6516 --- /dev/null +++ b/definitions/grib2/tables/25/4.2.0.7.table @@ -0,0 +1,24 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Parcel lifted index (to 500 hPa) (K) +1 1 Best lifted index (to 500 hPa) (K) +2 2 K index (K) +3 3 KO index (K) +4 4 Total totals index (K) +5 5 Sweat index (Numeric) +6 6 Convective available potential energy (J/kg) +7 7 Convective inhibition (J/kg) +8 8 Storm relative helicity (J/kg) +9 9 Energy helicity index (Numeric) +10 10 Surface lifted index (K) +11 11 Best (4-layer) lifted index (K) +12 12 Richardson number (Numeric) +13 13 Showalter index (K) +14 14 Reserved +15 15 Updraught helicity (m2 s-2) +16 16 Bulk Richardson number (Numeric) +17 17 Gradient Richardson number (Numeric) +18 18 Flux Richardson number (Numeric) +19 19 Convective available potential energy - shear (m2 s-2) +# 20-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.1.0.table b/definitions/grib2/tables/25/4.2.1.0.table new file mode 100644 index 000000000..bcd849c2e --- /dev/null +++ b/definitions/grib2/tables/25/4.2.1.0.table @@ -0,0 +1,21 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Flash flood guidance (Encoded as an accumulation over a floating subinterval of time between the reference time and valid time) (kg m-2) +1 1 Flash flood runoff (Encoded as an accumulation over a floating subinterval of time) (kg m-2) +2 2 Remotely-sensed snow cover (Code table 4.215) +3 3 Elevation of snow-covered terrain (Code table 4.216) +4 4 Snow water equivalent per cent of normal (%) +5 5 Baseflow-groundwater runoff (kg m-2) +6 6 Storm surface runoff (kg m-2) +7 7 Discharge from rivers or streams (m3/s) +8 8 Groundwater upper storage (kg m-2) +9 9 Groundwater lower storage (kg m-2) +10 10 Side flow into river channel (m3 s-1 m-1) +11 11 River storage of water (m3) +12 12 Floodplain storage of water (m3) +13 13 Depth of water on soil surface (kg m-2) +14 14 Upstream accumulated precipitation (kg m-2) +15 15 Upstream accumulated snow melt (kg m-2) +16 16 Percolation rate (kg m-2 s-1) +# 17-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.1.1.table b/definitions/grib2/tables/25/4.2.1.1.table new file mode 100644 index 000000000..b488eb0bd --- /dev/null +++ b/definitions/grib2/tables/25/4.2.1.1.table @@ -0,0 +1,7 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Conditional per cent precipitation amount fractile for an overall period (Encoded as an accumulation) (kg m-2) +1 1 Per cent precipitation in a sub-period of an overall period (Encoded as per cent accumulation over the sub-period) (%) +2 2 Probability of 0.01 inch of precipitation (POP) (%) +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.1.2.table b/definitions/grib2/tables/25/4.2.1.2.table new file mode 100644 index 000000000..ec9b11d41 --- /dev/null +++ b/definitions/grib2/tables/25/4.2.1.2.table @@ -0,0 +1,15 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Water depth (m) +1 1 Water temperature (K) +2 2 Water fraction (Proportion) +3 3 Sediment thickness (m) +4 4 Sediment temperature (K) +5 5 Ice thickness (m) +6 6 Ice temperature (K) +7 7 Ice cover (Proportion) +8 8 Land cover (0 = water, 1 = land) (Proportion) +9 9 Shape factor with respect to salinity profile (-) +10 10 Shape factor with respect to temperature profile in thermocline (-) +11 11 Attenuation coefficient of water with respect to solar radiation (/m) +12 12 Salinity (kg/kg) +13 13 Cross-sectional area of flow in channel (m2) diff --git a/definitions/grib2/tables/25/4.2.10.0.table b/definitions/grib2/tables/25/4.2.10.0.table new file mode 100644 index 000000000..53c9d2421 --- /dev/null +++ b/definitions/grib2/tables/25/4.2.10.0.table @@ -0,0 +1,69 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Wave spectra (1) (-) +1 1 Wave spectra (2) (-) +2 2 Wave spectra (3) (-) +3 3 Significant height of combined wind waves and swell (m) +4 4 Direction of wind waves (degree true) +5 5 Significant height of wind waves (m) +6 6 Mean period of wind waves (s) +7 7 Direction of swell waves (degree true) +8 8 Significant height of swell waves (m) +9 9 Mean period of swell waves (s) +10 10 Primary wave direction (degree true) +11 11 Primary wave mean period (s) +12 12 Secondary wave direction (degree true) +13 13 Secondary wave mean period (s) +14 14 Direction of combined wind waves and swell (degree true) +15 15 Mean period of combined wind waves and swell (s) +16 16 Coefficient of drag with waves (-) +17 17 Friction velocity (m/s) +18 18 Wave stress (N m-2) +19 19 Normalized wave stress (-) +20 20 Mean square slope of waves (-) +21 21 u-component surface Stokes drift (m/s) +22 22 v-component surface Stokes drift (m/s) +23 23 Period of maximum individual wave height (s) +24 24 Maximum individual wave height (m) +25 25 Inverse mean wave frequency (s) +26 26 Inverse mean frequency of wind waves (s) +27 27 Inverse mean frequency of total swell (s) +28 28 Mean zero-crossing wave period (s) +29 29 Mean zero-crossing period of wind waves (s) +30 30 Mean zero-crossing period of total swell (s) +31 31 Wave directional width (-) +32 32 Directional width of wind waves (-) +33 33 Directional width of total swell (-) +34 34 Peak wave period (s) +35 35 Peak period of wind waves (s) +36 36 Peak period of total swell (s) +37 37 Altimeter wave height (m) +38 38 Altimeter corrected wave height (m) +39 39 Altimeter range relative correction (-) +40 40 10-metre neutral wind speed over waves (m/s) +41 41 10-metre wind direction over waves (deg) +42 42 Wave energy spectrum (m2 s rad-1) +43 43 Kurtosis of the sea-surface elevation due to waves (-) +44 44 Benjamin-Feir index (-) +45 45 Spectral peakedness factor (/s) +46 46 Peak wave direction (deg) +47 47 Significant wave height of first swell partition (m) +48 48 Significant wave height of second swell partition (m) +49 49 Significant wave height of third swell partition (m) +50 50 Mean wave period of first swell partition (s) +51 51 Mean wave period of second swell partition (s) +52 52 Mean wave period of third swell partition (s) +53 53 Mean wave direction of first swell partition (deg) +54 54 Mean wave direction of second swell partition (deg) +55 55 Mean wave direction of third swell partition (deg) +56 56 Wave directional width of first swell partition (-) +57 57 Wave directional width of second swell partition (-) +58 58 Wave directional width of third swell partition (-) +59 59 Wave frequency width of first swell partition (-) +60 60 Wave frequency width of second swell partition (-) +61 61 Wave frequency width of third swell partition (-) +62 62 Wave frequency width (-) +63 63 Frequency width of wind waves (-) +64 64 Frequency width of total swell (-) +# 65-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.10.1.table b/definitions/grib2/tables/25/4.2.10.1.table new file mode 100644 index 000000000..00a084e34 --- /dev/null +++ b/definitions/grib2/tables/25/4.2.10.1.table @@ -0,0 +1,9 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Current direction (degree true) +1 1 Current speed (m/s) +2 2 u-component of current (m/s) +3 3 v-component of current (m/s) +4 4 Rip current occurrence probability (%) +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.10.191.table b/definitions/grib2/tables/25/4.2.10.191.table new file mode 100644 index 000000000..524929e78 --- /dev/null +++ b/definitions/grib2/tables/25/4.2.10.191.table @@ -0,0 +1,8 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Seconds prior to initial reference time (defined in Section 1) (s) +1 1 Meridional overturning stream function (m3/s) +2 2 Reserved +3 3 Days since last observation (d) +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.10.2.table b/definitions/grib2/tables/25/4.2.10.2.table new file mode 100644 index 000000000..6797062ac --- /dev/null +++ b/definitions/grib2/tables/25/4.2.10.2.table @@ -0,0 +1,17 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Ice cover (Proportion) +1 1 Ice thickness (m) +2 2 Direction of ice drift (degree true) +3 3 Speed of ice drift (m/s) +4 4 u-component of ice drift (m/s) +5 5 v-component of ice drift (m/s) +6 6 Ice growth rate (m/s) +7 7 Ice divergence (/s) +8 8 Ice temperature (K) +9 9 Module of ice internal pressure (Pa m) +10 10 Zonal vector component of vertically integrated ice internal pressure (Pa m) +11 11 Meridional vector component of vertically integrated ice internal pressure (Pa m) +12 12 Compressive ice strength (N/m) +# 13-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.10.3.table b/definitions/grib2/tables/25/4.2.10.3.table new file mode 100644 index 000000000..9f9492f04 --- /dev/null +++ b/definitions/grib2/tables/25/4.2.10.3.table @@ -0,0 +1,8 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Water temperature (K) +1 1 Deviation of sea level from mean (m) +2 2 Heat exchange coefficient (-) +3 3 Practical salinity (Numeric) +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.10.4.table b/definitions/grib2/tables/25/4.2.10.4.table new file mode 100644 index 000000000..69ba0cc66 --- /dev/null +++ b/definitions/grib2/tables/25/4.2.10.4.table @@ -0,0 +1,24 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Main thermocline depth (m) +1 1 Main thermocline anomaly (m) +2 2 Transient thermocline depth (m) +3 3 Salinity (kg/kg) +4 4 Ocean vertical heat diffusivity (m2/s) +5 5 Ocean vertical salt diffusivity (m2/s) +6 6 Ocean vertical momentum diffusivity (m2/s) +7 7 Bathymetry (m) +# 8-10 Reserved +11 11 Shape factor with respect to salinity profile (-) +12 12 Shape factor with respect to temperature profile in thermocline (-) +13 13 Attenuation coefficient of water with respect to solar radiation (/m) +14 14 Water depth (m) +15 15 Water temperature (K) +16 16 Water density (rho) (kg m-3) +17 17 Water density anomaly (sigma) (kg m-3) +18 18 Water potential temperature (theta) (K) +19 19 Water potential density (rho theta) (kg m-3) +20 20 Water potential density anomaly (sigma theta) (kg m-3) +21 21 Practical salinity (Numeric) +# 22-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.2.0.table b/definitions/grib2/tables/25/4.2.2.0.table new file mode 100644 index 000000000..849c2f1e4 --- /dev/null +++ b/definitions/grib2/tables/25/4.2.2.0.table @@ -0,0 +1,44 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Land cover (0 = sea, 1 = land) (Proportion) +1 1 Surface roughness (m) +2 2 Soil temperature (K) +3 3 Soil moisture content (kg m-2) +4 4 Vegetation (%) +5 5 Water runoff (kg m-2) +6 6 Evapotranspiration (kg-2 s-1) +7 7 Model terrain height (m) +8 8 Land use (Code table 4.212) +9 9 Volumetric soil moisture content (Proportion) +10 10 Ground heat flux (W m-2) +11 11 Moisture availability (%) +12 12 Exchange coefficient (kg m-2 s-1) +13 13 Plant canopy surface water (kg m-2) +14 14 Blackadar's mixing length scale (m) +15 15 Canopy conductance (m/s) +16 16 Minimal stomatal resistance (s/m) +17 17 Wilting point (Proportion) +18 18 Solar parameter in canopy conductance (Proportion) +19 19 Temperature parameter in canopy (Proportion) +20 20 Humidity parameter in canopy conductance (Proportion) +21 21 Soil moisture parameter in canopy conductance (Proportion) +22 22 Soil moisture (kg m-3) +23 23 Column-integrated soil water (kg m-2) +24 24 Heat flux (W m-2) +25 25 Volumetric soil moisture (m3 m-3) +26 26 Wilting point (kg m-3) +27 27 Volumetric wilting point (m3 m-3) +28 28 Leaf area index (Numeric) +29 29 Evergreen forest cover (Proportion) +30 30 Deciduous forest cover (Proportion) +31 31 Normalized differential vegetation index (NDVI) (Numeric) +32 32 Root depth of vegetation (m) +33 33 Water runoff and drainage (kg m-2) +34 34 Surface water runoff (kg m-2) +35 35 Tile class (Code table 4.243) +36 36 Tile fraction (Proportion) +37 37 Tile percentage (%) +38 38 Soil volumetric ice content (water equivalent) (m3 m-3) +39 39 Evapotranspiration rate (kg m-2 s-1) +# 40-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.2.3.table b/definitions/grib2/tables/25/4.2.2.3.table new file mode 100644 index 000000000..690fab42b --- /dev/null +++ b/definitions/grib2/tables/25/4.2.2.3.table @@ -0,0 +1,32 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Soil type (Code table 4.213) +1 1 Upper layer soil temperature (K) +2 2 Upper layer soil moisture (kg m-3) +3 3 Lower layer soil moisture (kg m-3) +4 4 Bottom layer soil temperature (K) +5 5 Liquid volumetric soil moisture (non-frozen) (Proportion) +6 6 Number of soil layers in root zone (Numeric) +7 7 Transpiration stress-onset (soil moisture) (Proportion) +8 8 Direct evaporation cease (soil moisture) (Proportion) +9 9 Soil porosity (Proportion) +10 10 Liquid volumetric soil moisture (non-frozen) (m3 m-3) +11 11 Volumetric transpiration stress-onset (soil moisture) (m3 m-3) +12 12 Transpiration stress-onset (soil moisture) (kg m-3) +13 13 Volumetric direct evaporation cease (soil moisture) (m3 m-3) +14 14 Direct evaporation cease (soil moisture) (kg m-3) +15 15 Soil porosity (m3 m-3) +16 16 Volumetric saturation of soil moisture (m3 m-3) +17 17 Saturation of soil moisture (kg m-3) +18 18 Soil temperature (K) +19 19 Soil moisture (kg m-3) +20 20 Column-integrated soil moisture (kg m-2) +21 21 Soil ice (kg m-3) +22 22 Column-integrated soil ice (kg m-2) +23 23 Liquid water in snow pack (kg m-2) +24 24 Frost index (K day-1) +25 25 Snow depth at elevation bands (kg m-2) +26 26 Soil heat flux (W m-2) +27 27 Soil depth (m) +# 28-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.2.4.table b/definitions/grib2/tables/25/4.2.2.4.table new file mode 100644 index 000000000..bb54fac22 --- /dev/null +++ b/definitions/grib2/tables/25/4.2.2.4.table @@ -0,0 +1,16 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Fire outlook (Code table 4.224) +1 1 Fire outlook due to dry thunderstorm (Code table 4.224) +2 2 Haines index (Numeric) +3 3 Fire burned area (%) +4 4 Fosberg index (Numeric) +5 5 Forest Fire Weather Index (Canadian Forest Service) (Numeric) +6 6 Fine Fuel Moisture Code (Canadian Forest Service) (Numeric) +7 7 Duff Moisture Code (Canadian Forest Service) (Numeric) +8 8 Drought Code (Canadian Forest Service) (Numeric) +9 9 Initial Fire Spread Index (Canadian Forest Service) (Numeric) +10 10 Fire Buildup Index (Canadian Forest Service) (Numeric) +11 11 Fire Daily Severity Rating (Canadian Forest Service) (Numeric) +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.2.5.table b/definitions/grib2/tables/25/4.2.2.5.table new file mode 100644 index 000000000..10fb68956 --- /dev/null +++ b/definitions/grib2/tables/25/4.2.2.5.table @@ -0,0 +1,2 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +1 1 Glacier temperature (K) diff --git a/definitions/grib2/tables/25/4.2.20.0.table b/definitions/grib2/tables/25/4.2.20.0.table new file mode 100644 index 000000000..cf842f6ea --- /dev/null +++ b/definitions/grib2/tables/25/4.2.20.0.table @@ -0,0 +1,6 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Universal thermal climate index (K) +1 1 Mean radiant temperature (K) +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.20.1.table b/definitions/grib2/tables/25/4.2.20.1.table new file mode 100644 index 000000000..0c814e6d3 --- /dev/null +++ b/definitions/grib2/tables/25/4.2.20.1.table @@ -0,0 +1,14 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Malaria cases (Fraction) +1 1 Malaria circumsporozoite protein rate (Fraction) +2 2 Plasmodium falciparum entomological inoculation rate (Bites per day per person) +3 3 Human bite rate by anopheles vectors (Bites per day per person) +4 4 Malaria immunity (Fraction) +5 5 Falciparum parasite rates (Fraction) +6 6 Detectable falciparum parasite ratio (after day 10) (Fraction) +7 7 Anopheles vector to host ratio (Fraction) +8 8 Anopheles vector number (Number m-2) +9 9 Fraction of malarial vector reproductive habitat (Fraction) +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.20.2.table b/definitions/grib2/tables/25/4.2.20.2.table new file mode 100644 index 000000000..8a937c0d1 --- /dev/null +++ b/definitions/grib2/tables/25/4.2.20.2.table @@ -0,0 +1,5 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Population density (Person m-2) +# 1-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.3.0.table b/definitions/grib2/tables/25/4.2.3.0.table new file mode 100644 index 000000000..c0ffa29f5 --- /dev/null +++ b/definitions/grib2/tables/25/4.2.3.0.table @@ -0,0 +1,14 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Scaled radiance (Numeric) +1 1 Scaled albedo (Numeric) +2 2 Scaled brightness temperature (Numeric) +3 3 Scaled precipitable water (Numeric) +4 4 Scaled lifted index (Numeric) +5 5 Scaled cloud top pressure (Numeric) +6 6 Scaled skin temperature (Numeric) +7 7 Cloud mask (Code table 4.217) +8 8 Pixel scene type (Code table 4.218) +9 9 Fire detection indicator (Code table 4.223) +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.3.1.table b/definitions/grib2/tables/25/4.2.3.1.table new file mode 100644 index 000000000..7d4364f4d --- /dev/null +++ b/definitions/grib2/tables/25/4.2.3.1.table @@ -0,0 +1,35 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Estimated precipitation (kg m-2) +1 1 Instantaneous rain rate (kg m-2 s-1) +2 2 Cloud top height (m) +3 3 Cloud top height quality indicator (Code table 4.219) +4 4 Estimated u-component of wind (m/s) +5 5 Estimated v-component of wind (m/s) +6 6 Number of pixel used (Numeric) +7 7 Solar zenith angle (deg) +8 8 Relative azimuth angle (deg) +9 9 Reflectance in 0.6 micron channel (%) +10 10 Reflectance in 0.8 micron channel (%) +11 11 Reflectance in 1.6 micron channel (%) +12 12 Reflectance in 3.9 micron channel (%) +13 13 Atmospheric divergence (/s) +14 14 Cloudy brightness temperature (K) +15 15 Clear-sky brightness temperature (K) +16 16 Cloudy radiance (with respect to wave number) (W m-1 sr-1) +17 17 Clear-sky radiance (with respect to wave number) (W m-1 sr-1) +18 18 Reserved +19 19 Wind speed (m/s) +20 20 Aerosol optical thickness at 0.635 um +21 21 Aerosol optical thickness at 0.810 um +22 22 Aerosol optical thickness at 1.640 um +23 23 Angstrom coefficient +# 24-26 Reserved +27 27 Bidirectional reflectance factor (numeric) +28 28 Brightness temperature (K) +29 29 Scaled radiance (numeric) +# 30-97 Reserved +98 98 Correlation coefficient between MPE rain-rates for the co-located IR data and the microwave data rain-rates (Numeric) +99 99 Standard deviation between MPE rain-rates for the co-located IR data and the microwave data rain-rates (kg m-2 s-1) +# 100-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.3.2.table b/definitions/grib2/tables/25/4.2.3.2.table new file mode 100644 index 000000000..6316ab39c --- /dev/null +++ b/definitions/grib2/tables/25/4.2.3.2.table @@ -0,0 +1,24 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Clear sky probability (%) +1 1 Cloud top temperature (K) +2 2 Cloud top pressure (Pa) +3 3 Cloud type (Code table 4.218) +4 4 Cloud phase (Code table 4.218) +5 5 Cloud optical depth (Numeric) +6 6 Cloud particle effective radius (m) +7 7 Cloud liquid water path (kg m-2) +8 8 Cloud ice water path (kg m-2) +9 9 Cloud albedo (Numeric) +10 10 Cloud emissivity (Numeric) +11 11 Effective absorption optical depth ratio (Numeric) +30 30 Measurement cost (Numeric) +31 31 Upper layer cloud optical depth (Numeric) +32 32 Upper layer cloud top pressure (Pa) +33 33 Upper layer cloud effective radius (m) +34 34 Error in upper layer cloud optical depth (Numeric) +35 35 Error in upper layer cloud top pressure (Pa) +36 36 Error in upper layer cloud effective radius (m) +37 37 Lower layer cloud optical depth (Numeric) +38 38 Lower layer cloud top pressure (Pa) +39 39 Error in lower layer cloud optical depth (Numeric) +40 40 Error in lower layer cloud top pressure (Pa) diff --git a/definitions/grib2/tables/25/4.2.3.3.table b/definitions/grib2/tables/25/4.2.3.3.table new file mode 100644 index 000000000..cb5c4b6ed --- /dev/null +++ b/definitions/grib2/tables/25/4.2.3.3.table @@ -0,0 +1,4 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Probability of encountering marginal visual flight rule conditions (%) +1 1 Probability of encountering low instrument flight rule conditions (%) +2 2 Probability of encountering instrument flight rule conditions (%) diff --git a/definitions/grib2/tables/25/4.2.3.4.table b/definitions/grib2/tables/25/4.2.3.4.table new file mode 100644 index 000000000..f86d2d653 --- /dev/null +++ b/definitions/grib2/tables/25/4.2.3.4.table @@ -0,0 +1,10 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Volcanic ash probability (%) +1 1 Volcanic ash cloud top temperature (K) +2 2 Volcanic ash cloud top pressure (Pa) +3 3 Volcanic ash cloud top height (m) +4 4 Volcanic ash cloud emissivity (Numeric) +5 5 Volcanic ash effective absorption optical depth ratio (Numeric) +6 6 Volcanic ash cloud optical depth (Numeric) +7 7 Volcanic ash column density (kg m-2) +8 8 Volcanic ash particle effective radius (m) diff --git a/definitions/grib2/tables/25/4.2.3.5.table b/definitions/grib2/tables/25/4.2.3.5.table new file mode 100644 index 000000000..92a050db0 --- /dev/null +++ b/definitions/grib2/tables/25/4.2.3.5.table @@ -0,0 +1,7 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Interface sea-surface temperature (K) +1 1 Skin sea-surface temperature (K) +2 2 Sub-skin sea-surface temperature (K) +3 3 Foundation sea-surface temperature (K) +4 4 Estimated bias between sea-surface temperature and standard (K) +5 5 Estimated standard deviation between sea surface temperature and standard (K) diff --git a/definitions/grib2/tables/25/4.2.3.6.table b/definitions/grib2/tables/25/4.2.3.6.table new file mode 100644 index 000000000..471beed55 --- /dev/null +++ b/definitions/grib2/tables/25/4.2.3.6.table @@ -0,0 +1,7 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Global solar irradiance (W m-2) +1 1 Global solar exposure (J m-2) +2 2 Direct solar irradiance (W m-2) +3 3 Direct solar exposure (J m-2) +4 4 Diffuse solar irradiance (W m-2) +5 5 Diffuse solar exposure (J m-2) diff --git a/definitions/grib2/tables/25/4.201.table b/definitions/grib2/tables/25/4.201.table new file mode 100644 index 000000000..44943d5e0 --- /dev/null +++ b/definitions/grib2/tables/25/4.201.table @@ -0,0 +1,17 @@ +# Code table 4.201 - Precipitation type +0 0 Reserved +1 1 Rain +2 2 Thunderstorm +3 3 Freezing rain +4 4 Mixed/ice +5 5 Snow +6 6 Wet snow +7 7 Mixture of rain and snow +8 8 Ice pellets +9 9 Graupel +10 10 Hail +11 11 Drizzle +12 12 Freezing drizzle +# 13-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.202.table b/definitions/grib2/tables/25/4.202.table new file mode 100644 index 000000000..438502ff9 --- /dev/null +++ b/definitions/grib2/tables/25/4.202.table @@ -0,0 +1,4 @@ +# Code table 4.202 - Precipitable water category +# 0-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.203.table b/definitions/grib2/tables/25/4.203.table new file mode 100644 index 000000000..8a9aedf7a --- /dev/null +++ b/definitions/grib2/tables/25/4.203.table @@ -0,0 +1,26 @@ +# Code table 4.203 - Cloud type +0 0 Clear +1 1 Cumulonimbus +2 2 Stratus +3 3 Stratocumulus +4 4 Cumulus +5 5 Altostratus +6 6 Nimbostratus +7 7 Altocumulus +8 8 Cirrostratus +9 9 Cirrocumulus +10 10 Cirrus +11 11 Cumulonimbus - ground-based fog beneath the lowest layer +12 12 Stratus - ground-based fog beneath the lowest layer +13 13 Stratocumulus - ground-based fog beneath the lowest layer +14 14 Cumulus - ground-based fog beneath the lowest layer +15 15 Altostratus - ground-based fog beneath the lowest layer +16 16 Nimbostratus - ground-based fog beneath the lowest layer +17 17 Altocumulus - ground-based fog beneath the lowest layer +18 18 Cirrostratus - ground-based fog beneath the lowest layer +19 19 Cirrocumulus - ground-based fog beneath the lowest layer +20 20 Cirrus - ground-based fog beneath the lowest layer +# 21-190 Reserved +191 191 Unknown +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.204.table b/definitions/grib2/tables/25/4.204.table new file mode 100644 index 000000000..481372936 --- /dev/null +++ b/definitions/grib2/tables/25/4.204.table @@ -0,0 +1,9 @@ +# Code table 4.204 - Thunderstorm coverage +0 0 None +1 1 Isolated (1-2%) +2 2 Few (3-5%) +3 3 Scattered (6-45%) +4 4 Numerous (> 45%) +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.205.table b/definitions/grib2/tables/25/4.205.table new file mode 100644 index 000000000..5b4484dfd --- /dev/null +++ b/definitions/grib2/tables/25/4.205.table @@ -0,0 +1,6 @@ +# Code table 4.205 - Presence of aerosol +0 0 Aerosol not present +1 1 Aerosol present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.206.table b/definitions/grib2/tables/25/4.206.table new file mode 100644 index 000000000..02c3dfdf9 --- /dev/null +++ b/definitions/grib2/tables/25/4.206.table @@ -0,0 +1,6 @@ +# Code table 4.206 - Volcanic ash +0 0 Not present +1 1 Present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.207.table b/definitions/grib2/tables/25/4.207.table new file mode 100644 index 000000000..8ddb2e048 --- /dev/null +++ b/definitions/grib2/tables/25/4.207.table @@ -0,0 +1,10 @@ +# Code table 4.207 - Icing +0 0 None +1 1 Light +2 2 Moderate +3 3 Severe +4 4 Trace +5 5 Heavy +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.208.table b/definitions/grib2/tables/25/4.208.table new file mode 100644 index 000000000..b83685a1a --- /dev/null +++ b/definitions/grib2/tables/25/4.208.table @@ -0,0 +1,9 @@ +# Code table 4.208 - Turbulence +0 0 None (smooth) +1 1 Light +2 2 Moderate +3 3 Severe +4 4 Extreme +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.209.table b/definitions/grib2/tables/25/4.209.table new file mode 100644 index 000000000..cb7617071 --- /dev/null +++ b/definitions/grib2/tables/25/4.209.table @@ -0,0 +1,9 @@ +# Code table 4.209 - Planetary boundary-layer regime +0 0 Reserved +1 1 Stable +2 2 Mechanically driven turbulence +3 3 Forced convection +4 4 Free convection +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.210.table b/definitions/grib2/tables/25/4.210.table new file mode 100644 index 000000000..524a6ca73 --- /dev/null +++ b/definitions/grib2/tables/25/4.210.table @@ -0,0 +1,6 @@ +# Code table 4.210 - Contrail intensity +0 0 Contrail not present +1 1 Contrail present +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.211.table b/definitions/grib2/tables/25/4.211.table new file mode 100644 index 000000000..098eb2d43 --- /dev/null +++ b/definitions/grib2/tables/25/4.211.table @@ -0,0 +1,7 @@ +# Code table 4.211 - Contrail engine type +0 0 Low bypass +1 1 High bypass +2 2 Non-bypass +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.212.table b/definitions/grib2/tables/25/4.212.table new file mode 100644 index 000000000..1a085b88d --- /dev/null +++ b/definitions/grib2/tables/25/4.212.table @@ -0,0 +1,18 @@ +# Code table 4.212 - Land use +0 0 Reserved +1 1 Urban land +2 2 Agriculture +3 3 Range land +4 4 Deciduous forest +5 5 Coniferous forest +6 6 Forest/wetland +7 7 Water +8 8 Wetlands +9 9 Desert +10 10 Tundra +11 11 Ice +12 12 Tropical forest +13 13 Savannah +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.213.table b/definitions/grib2/tables/25/4.213.table new file mode 100644 index 000000000..c65784a00 --- /dev/null +++ b/definitions/grib2/tables/25/4.213.table @@ -0,0 +1,16 @@ +# Code table 4.213 - Soil type +0 0 Reserved +1 1 Sand +2 2 Loamy sand +3 3 Sandy loam +4 4 Silt loam +5 5 Organic (redefined) +6 6 Sandy clay loam +7 7 Silt clay loam +8 8 Clay loam +9 9 Sandy clay +10 10 Silty clay +11 11 Clay +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.215.table b/definitions/grib2/tables/25/4.215.table new file mode 100644 index 000000000..034db72be --- /dev/null +++ b/definitions/grib2/tables/25/4.215.table @@ -0,0 +1,9 @@ +# Code table 4.215 - Remotely sensed snow coverage +# 0-49 Reserved +50 50 No-snow/no-cloud +# 51-99 Reserved +100 100 Clouds +# 101-249 Reserved +250 250 Snow +# 251-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.216.table b/definitions/grib2/tables/25/4.216.table new file mode 100644 index 000000000..5d1460cef --- /dev/null +++ b/definitions/grib2/tables/25/4.216.table @@ -0,0 +1,5 @@ +# Code table 4.216 - Elevation of snow-covered terrain +# 0-90 Elevation in increments of 100 m +# 91-253 Reserved +254 254 Clouds +255 255 Missing diff --git a/definitions/grib2/tables/25/4.217.table b/definitions/grib2/tables/25/4.217.table new file mode 100644 index 000000000..a4452182c --- /dev/null +++ b/definitions/grib2/tables/25/4.217.table @@ -0,0 +1,8 @@ +# Code table 4.217 - Cloud mask type +0 0 Clear over water +1 1 Clear over land +2 2 Cloud +3 3 No data +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.218.table b/definitions/grib2/tables/25/4.218.table new file mode 100644 index 000000000..fcd06c348 --- /dev/null +++ b/definitions/grib2/tables/25/4.218.table @@ -0,0 +1,46 @@ +# Code table 4.218 - Pixel scene type +0 0 No scene identified +1 1 Green needle-leafed forest +2 2 Green broad-leafed forest +3 3 Deciduous needle-leafed forest +4 4 Deciduous broad-leafed forest +5 5 Deciduous mixed forest +6 6 Closed shrub-land +7 7 Open shrub-land +8 8 Woody savannah +9 9 Savannah +10 10 Grassland +11 11 Permanent wetland +12 12 Cropland +13 13 Urban +14 14 Vegetation/crops +15 15 Permanent snow/ice +16 16 Barren desert +17 17 Water bodies +18 18 Tundra +19 19 Warm liquid water cloud +20 20 Supercooled liquid water cloud +21 21 Mixed-phase cloud +22 22 Optically thin ice cloud +23 23 Optically thick ice cloud +24 24 Multilayered cloud +# 25-96 Reserved +97 97 Snow/ice on land +98 98 Snow/ice on water +99 99 Sun-glint +100 100 General cloud +101 101 Low cloud/fog/stratus +102 102 Low cloud/stratocumulus +103 103 Low cloud/unknown type +104 104 Medium cloud/nimbostratus +105 105 Medium cloud/altostratus +106 106 Medium cloud/unknown type +107 107 High cloud/cumulus +108 108 High cloud/cirrus +109 109 High cloud/unknown +110 110 Unknown cloud type +111 111 Single layer water cloud +112 112 Single layer ice cloud +# 113-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.219.table b/definitions/grib2/tables/25/4.219.table new file mode 100644 index 000000000..86df0522e --- /dev/null +++ b/definitions/grib2/tables/25/4.219.table @@ -0,0 +1,8 @@ +# Code table 4.219 - Cloud top height quality indicator +0 0 Nominal cloud top height quality +1 1 Fog in segment +2 2 Poor quality height estimation +3 3 Fog in segment and poor quality height estimation +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.220.table b/definitions/grib2/tables/25/4.220.table new file mode 100644 index 000000000..93e841f8b --- /dev/null +++ b/definitions/grib2/tables/25/4.220.table @@ -0,0 +1,6 @@ +# Code table 4.220 - Horizontal dimension processed +0 0 Latitude +1 1 Longitude +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.221.table b/definitions/grib2/tables/25/4.221.table new file mode 100644 index 000000000..8448533d7 --- /dev/null +++ b/definitions/grib2/tables/25/4.221.table @@ -0,0 +1,6 @@ +# Code table 4.221 - Treatment of missing data +0 0 Not included +1 1 Extrapolated +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.222.table b/definitions/grib2/tables/25/4.222.table new file mode 100644 index 000000000..57f113014 --- /dev/null +++ b/definitions/grib2/tables/25/4.222.table @@ -0,0 +1,6 @@ +# Code table 4.222 - Categorical result +0 0 No +1 1 Yes +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.223.table b/definitions/grib2/tables/25/4.223.table new file mode 100644 index 000000000..f0deb076a --- /dev/null +++ b/definitions/grib2/tables/25/4.223.table @@ -0,0 +1,5 @@ +# Code table 4.223 - Fire detection indicator +0 0 No fire detected +1 1 Possible fire detected +2 2 Probable fire detected +3 3 Missing diff --git a/definitions/grib2/tables/25/4.224.table b/definitions/grib2/tables/25/4.224.table new file mode 100644 index 000000000..e87cde4bb --- /dev/null +++ b/definitions/grib2/tables/25/4.224.table @@ -0,0 +1,18 @@ +# Code table 4.224 - Categorical outlook +0 0 No risk area +1 1 Reserved +2 2 General thunderstorm risk area +3 3 Reserved +4 4 Slight risk area +5 5 Reserved +6 6 Moderate risk area +7 7 Reserved +8 8 High risk area +# 9-10 Reserved +11 11 Dry thunderstorm (dry lightning) risk area +# 12-13 Reserved +14 14 Critical risk area +# 15-17 Reserved +18 18 Extremely critical risk area +# 19-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/25/4.225.table b/definitions/grib2/tables/25/4.225.table new file mode 100644 index 000000000..9dc374087 --- /dev/null +++ b/definitions/grib2/tables/25/4.225.table @@ -0,0 +1,2 @@ +# Code table 4.225 - Weather (see FM 94 BUFR/FM 95 CREX Code table 0 20 003 - Present weather) +511 511 Missing value diff --git a/definitions/grib2/tables/25/4.227.table b/definitions/grib2/tables/25/4.227.table new file mode 100644 index 000000000..27c76553d --- /dev/null +++ b/definitions/grib2/tables/25/4.227.table @@ -0,0 +1,9 @@ +# Code table 4.227 - Icing scenario (weather/cloud classification) +0 0 None +1 1 General +2 2 Convective +3 3 Stratiform +4 4 Freezing +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing value diff --git a/definitions/grib2/tables/25/4.230.table b/definitions/grib2/tables/25/4.230.table new file mode 100644 index 000000000..147ff9747 --- /dev/null +++ b/definitions/grib2/tables/25/4.230.table @@ -0,0 +1,512 @@ +# Code table 4.230 - Atmospheric chemical constituent type +0 0 Ozone O3 +1 1 Water vapour H2O +2 2 Methane CH4 +3 3 Carbon dioxide CO2 +4 4 Carbon monoxide CO +5 5 Nitrogen dioxide NO2 +6 6 Nitrous oxide N2O +7 7 Formaldehyde HCHO +8 8 Sulphur dioxide SO2 +9 9 Ammonia NH3 +10 10 Ammonium cation NH4+ +11 11 Nitrogen monoxide NO +12 12 Atomic oxygen O +13 13 Nitrate radical NO3 +14 14 Hydroperoxyl radical HOO +15 15 Dinitrogen pentoxide N2O5 +16 16 Nitrous acid HONO +17 17 Nitric acid HNO3 +18 18 Peroxynitric acid HO2NO2 +19 19 Hydrogen peroxide H2O2 +20 20 Dihydrogen H2 +21 21 Atomic nitrogen N +22 22 Sulphate anion SO42- +23 23 Atomic Radon Rn +24 24 Mercury vapour Hg(0) +25 25 Mercury(II) cation Hg2+ +26 26 Atomic chlorine Cl +27 27 Chlorine monoxide ClO +28 28 Dichlorine peroxide Cl2O2 +29 29 Hypochlorous acid HClO +30 30 Chlorine nitrate ClONO2 +31 31 Chlorine dioxide ClO2 +32 32 Atomic bromine Br +33 33 Bromine monoxide BrO +34 34 Bromine chloride BrCl +35 35 Hydrogen bromide HBr +36 36 Hypobromous acid HBrO +37 37 Bromine nitrate BrONO2 +38 38 Dioxygen O2 +39 39 Nitryl chloride NO2Cl +40 40 Sulphuric acid H2SO4 +41 41 Hydrogen sulphide H2S +42 42 Sulphur trioxide SO3 +43 43 Bromine Br2 +44 44 Hydrofluoric acid HF +45 45 Sulphur hexafluoride SF6 +46 46 Chlorine Cl2 +# 47-9999 Reserved +10000 10000 Hydroxyl radical HO +10001 10001 Methyl peroxy radical CH3OO +10002 10002 Methyl hydroperoxide CH3O2H +10004 10004 Methanol CH3OH +10005 10005 Formic acid CH3OOH +10006 10006 Hydrogen cyanide HCN +10007 10007 Aceto nitrile CH3CN +10008 10008 Ethane C2H6 +10009 10009 Ethene (= Ethylene) C2H4 +10010 10010 Ethyne (= Acetylene) C2H2 +10011 10011 Ethanol C2H5OH +10012 10012 Acetic acid C2H5OOH +10013 10013 Peroxyacetyl nitrate CH3C(O)OONO2 +10014 10014 Propane C3H8 +10015 10015 Propene C3H6 +10016 10016 Butane (all isomers) C4H10 +10017 10017 Isoprene C5H10 +10018 10018 Alpha pinene C10H16 +10019 10019 Beta pinene C10H16 +10020 10020 Limonene C10H16 +10021 10021 Benzene C6H6 +10022 10022 Toluene C7H8 +10023 10023 XyleneC8H10 +10024 10024 Methanesulphonic acid CH3SO3H +10025 10025 Methylglyoxal (2-oxopropanal) CH3C(O)CHO +10026 10026 Peroxyacetyl radical CH3C(O)OO +10027 10027 Methacrylic acid (2-methylprop-2-enoic acid) CH2C(CH3)COOH +10028 10028 Methacrolein (2-methylprop-2-enal) CH2C(CH3)CHO +10029 10029 Acetone (propan-2-one) CH3C(O)CH3 +10030 10030 Ethyl dioxidanyl radical CH3CH2OO +10031 10031 Butadiene (buta-1,3-diene) (CH2CH)2 +10032 10032 Acetaldehyde (ethanal) CH3CHO +10033 10033 Glycolaldehyde (hydroxyethanal) HOCH2CHO +10034 10034 Cresol (methylphenol), all isomers CH3C6H4OH +10035 10035 Peracetic acid (ethaneperoxoic acid) CH3C(O)OOH +10036 10036 2-hydroxyethyl oxidanyl radical HOCH2CH2O +10037 10037 2-hydroxyethyl dioxidanyl radical HOCH2CH2OO +10038 10038 Glyoxal (oxaldehyde) OCHCHO +10039 10039 Isopropyl dioxidanyl radical (CH3)2CHOO +10040 10040 Isopropyl hydroperoxide (2-hydroperoxypropane) (CH3)2CHOOH +10041 10041 Hydroxyacetone (1-hydroxypropan-2-one) CH3C(O)CH2OH +10042 10042 Peroxyacetic acid (ethaneperoxoic acid) CH3C(O)OOH +10043 10043 Methyl vinyl ketone (but-3-en-2-one) CH3C(O)CHCH2 +10044 10044 Phenoxy radical C6H5O +10045 10045 Methyl radical CH3 +10046 10046 Carbonyl sulphide (carbon oxide sulphide) OCS +10047 10047 Dibromomethane CH2Br2 +10048 10048 Methoxy radical CH3O +10049 10049 Tribromomethane CHBr3 +10050 10050 Formyl radical (oxomethyl radical) HOC +10051 10051 Hydroxymethyl dioxidanyl radical HOCH2OO +10052 10052 Ethyl hydroperoxide CH3CH2OOH +10053 10053 3-hydroxypropyl dioxidanyl radical HOCH2CH2CH2OO +10054 10054 3-hydroxypropyl hydroperoxide HOCH2CH2CH2OOH +# 10055-10499 Reserved for other simple organic molecules (e.g. higher aldehydes, alcohols, peroxides, ...) +10500 10500 Dimethyl sulphide CH3SCH3 (DMS) +10501 10501 DMSO (dimethyl sulfoxide) (CH3)2SO +# 10502-20000 Reserved +20001 20001 Hydrogen chloride HCl +20002 20002 CFC-11 (trichlorofluoromethane) CCl3F +20003 20003 CFC-12 (dichlorodifluoromethane) CCl2F2 +20004 20004 CFC-113 (1,1,2-trichloro-1,2,2-trifluoroethane) Cl2FC-CClF2 +20005 20005 CFC-113a (1,1,1-trichloro-2,2,2-trifluoroethane) Cl3C-CF3 +20006 20006 CFC-114 (1,2-dichloro-1,1,2,2-tetrafluoroethane) ClF2C-CClF2 +20007 20007 CFC-115 (1-chloro-1,1,2,2,2-pentafluoroethane) ClF2C-CF3 +20008 20008 HCFC-22 (chlorodifluoromethane) CHClF2 +20009 20009 HCFC-141b (1,1-dichloro-1-fluoroethane) Cl2FC-CH3 +20010 20010 HCFC-142b (1-chloro-1,1-difluoroethane) ClF2C-CH3 +20011 20011 Halon-1202 (dibromodifluoromethane) CBr2F2 +20012 20012 Halon-1211 (bromochlorodifluoromethane) CBrClF2 +20013 20013 Halon-1301 (bromotrifluoromethane) CBrF3 +20014 20014 Halon-2402 (1,2-dibromo-1,1,2,2-tetrafluoroethane) BrF2C-CBrF2 +20015 20015 HCC-40 (methyl chloride) CH3Cl +20016 20016 HCC-10 (carbon tetrachloride) CCl4 +20017 20017 HCC-140a (1,1,1-trichloroethane) Cl3C-CH3 +20018 20018 HBC-40B1 (methyl bromide) CH3Br +20019 20019 HCH (hexachlorocyclohexane) all isomers C6H6Cl6 +20020 20020 alpha-HCH (alpha-hexachlorocyclohexane) both enantiomers alpha-C6H6Cl6 +20021 20021 PCB-153 (2,2',4,4',5,5'-hexachlorobiphenyl) (C6H2Cl3)2 +20022 20022 HCFC-141a (1,1-dichloro-2-fluoroethane) Cl2HC-CH2F +# 20023-29999 Reserved +30000 30000 Radioactive pollutant (tracer, defined by originating centre) +# 30001-30009 Reserved +30010 30010 Tritium (Hydrogen 3) H-3 +30011 30011 Tritium organic bounded H-3o +30012 30012 Tritium inorganic H-3a +30013 30013 Beryllium 7 Be-7 +30014 30014 Beryllium 10 Be-10 +30015 30015 Carbon 14 C-14 +30016 30016 Carbon 14 CO2 C-14CO2 +30017 30017 Carbon 14 other gases C-14og +30018 30018 Nitrogen 13 N-13 +30019 30019 Nitrogen 16 N-16 +30020 30020 Fluorine 18 F-18 +30021 30021 Sodium 22 Na-22 +30022 30022 Phosphate 32 P-32 +30023 30023 Phosphate 33 P-33 +30024 30024 Sulphur 35 S-35 +30025 30025 Chlorine 36 Cl-36 +30026 30026 Potassium 40 K-40 +30027 30027 Argon 41 Ar-41 +30028 30028 Calcium 41 Ca-41 +30029 30029 Calcium 45 Ca-45 +30030 30030 Titanium 44 Ti-44 +30031 30031 Scandium 46 Sc-46 +30032 30032 Vanadium 48 V-48 +30033 30033 Vanadium 49 V-49 +30034 30034 Chrome 51 Cr-51 +30035 30035 Manganese 52 Mn-52 +30036 30036 Manganese 54 Mn-54 +30037 30037 Iron 55 Fe-55 +30038 30038 Iron 59 Fe-59 +30039 30039 Cobalt 56 Co-56 +30040 30040 Cobalt 57 Co-57 +30041 30041 Cobalt 58 Co-58 +30042 30042 Cobalt 60 Co-60 +30043 30043 Nickel 59 Ni-59 +30044 30044 Nickel 63 Ni-63 +30045 30045 Zinc 65 Zn-65 +30046 30046 Gallium 67 Ga-67 +30047 30047 Gallium 68 Ga-68 +30048 30048 Germanium 68 Ge-68 +30049 30049 Germanium 69 Ge-69 +30050 30050 Arsenic 73 As-73 +30051 30051 Selenium 75 Se-75 +30052 30052 Selenium 79 Se-79 +30053 30053 Rubidium 81 Rb-81 +30054 30054 Rubidium 83 Rb-83 +30055 30055 Rubidium 84 Rb-84 +30056 30056 Rubidium 86 Rb-86 +30057 30057 Rubidium 87 Rb-87 +30058 30058 Rubidium 88 Rb-88 +30059 30059 Krypton 85 Kr-85 +30060 30060 Krypton 85 metastable Kr-85m +30061 30061 Krypton 87 Kr-87 +30062 30062 Krypton 88 Kr-88 +30063 30063 Krypton 89 Kr-89 +30064 30064 Strontium 85 Sr-85 +30065 30065 Strontium 89 Sr-89 +30066 30066 Strontium 89/90 Sr-8990 +30067 30067 Strontium 90 Sr-90 +30068 30068 Strontium 91 Sr-91 +30069 30069 Strontium 92 Sr-92 +30070 30070 Yttrium 87 Y-87 +30071 30071 Yttrium 88 Y-88 +30072 30072 Yttrium 90 Y-90 +30073 30073 Yttrium 91 Y-91 +30074 30074 Yttrium 91 metastable Y-91m +30075 30075 Yttrium 92 Y-92 +30076 30076 Yttrium 93 Y-93 +30077 30077 Zirconium 89 Zr-89 +30078 30078 Zirconium 93 Zr-93 +30079 30079 Zirconium 95 Zr-95 +30080 30080 Zirconium 97 Zr-97 +30081 30081 Niobium 93 metastable Nb-93m +30082 30082 Niobium 94 Nb-94 +30083 30083 Niobium 95 Nb-95 +30084 30084 Niobium 95 metastable Nb-95m +30085 30085 Niobium 97 Nb-97 +30086 30086 Niobium 97 metastable Nb-97m +30087 30087 Molybdenum 93 Mo-93 +30088 30088 Molybdenum 99 Mo-99 +30089 30089 Technetium 95 metastable Tc-95m +30090 30090 Technetium 96 Tc-96 +30091 30091 Technetium 99 Tc-99 +30092 30092 Technetium 99 metastable Tc-99m +30093 30093 Rhodium 99 Rh-99 +30094 30094 Rhodium 101 Rh-101 +30095 30095 Rhodium 102 metastable Rh-102m +30096 30096 Rhodium 103 metastable Rh-103m +30097 30097 Rhodium 105 Rh-105 +30098 30098 Rhodium 106 Rh-106 +30099 30099 Palladium 100 Pd-100 +30100 30100 Palladium 103 Pd-103 +30101 30101 Palladium 107 Pd-107 +30102 30102 Ruthenium 103 Ru-103 +30103 30103 Ruthenium 105 Ru-105 +30104 30104 Ruthenium 106 Ru-106 +30105 30105 Silver 108 metastable Ag-108m +30106 30106 Silver 110 metastable Ag-110m +30107 30107 Cadmium 109 Cd-109 +30108 30108 Cadmium 113 metastable Cd-113m +30109 30109 Cadmium 115 metastable Cd-115m +30110 30110 Indium 114 metastable In-114m +30111 30111 Tin 113 Sn-113 +30112 30112 Tin 119 metastable Sn-119m +30113 30113 Tin 121 metastable Sn-121m +30114 30114 Tin 122 Sn-122 +30115 30115 Tin 123 Sn-123 +30116 30116 Tin 126 Sn-126 +30117 30117 Antimony 124 Sb-124 +30118 30118 Antimony 125 Sb-125 +30119 30119 Antimony 126 Sb-126 +30120 30120 Antimony 127 Sb-127 +30121 30121 Antimony 129 Sb-129 +30122 30122 Tellurium 123 metastable Te-123m +30123 30123 Tellurium 125 metastable Te-125m +30124 30124 Tellurium 127 Te-127 +30125 30125 Tellurium 127 metastable Te-127m +30126 30126 Tellurium 129 Te-129 +30127 30127 Tellurium 129 metastable Te-129m +30128 30128 Tellurium 131 metastable Te-131m +30129 30129 Tellurium 132 Te-132 +30130 30130 Iodine 123 I-123 +30131 30131 Iodine 124 I-124 +30132 30132 Iodine 125 I-125 +30133 30133 Iodine 126 I-126 +30134 30134 Iodine 129 I-129 +30135 30135 Iodine 129 elementary gaseous I-129g +30136 30136 Iodine 129 organic bounded I-129o +30137 30137 Iodine 131 I-131 +30138 30138 Iodine 131 elementary gaseous I-131g +30139 30139 Iodine 131 organic bounded I-131o +30140 30140 Iodine 131 gaseous elementary and organic bounded I-131go +30141 30141 Iodine 131 aerosol I-131a +30142 30142 Iodine 132 I-132 +30143 30143 Iodine 132 elementary gaseous I-132g +30144 30144 Iodine 132 organic bounded I-132o +30145 30145 Iodine 132 gaseous elementary and organic bounded I-132go +30146 30146 Iodine 132 aerosol I-132a +30147 30147 Iodine 133 I-133 +30148 30148 Iodine 133 elementary gaseous I-133g +30149 30149 Iodine 133 organic bounded I-133o +30150 30150 Iodine 133 gaseous elementary and organic bounded I-133go +30151 30151 Iodine 133 aerosol I-133a +30152 30152 Iodine 134 I-134 +30153 30153 Iodine 134 elementary gaseous I-134g +30154 30154 Iodine 134 organic bounded I-134o +30155 30155 Iodine 135 I-135 +30156 30156 Iodine 135 elementary gaseous I-135g +30157 30157 Iodine 135 organic bounded I-135o +30158 30158 Iodine 135 gaseous elementary and organic bounded I-135go +30159 30159 Iodine 135 aerosol I-135a +30160 30160 Xenon 131 metastable Xe-131m +30161 30161 Xenon 133 Xe-133 +30162 30162 Xenon 133 metastable Xe-133m +30163 30163 Xenon 135 Xe-135 +30164 30164 Xenon 135 metastable Xe-135m +30165 30165 Xenon 137 Xe-137 +30166 30166 Xenon 138 Xe-138 +30167 30167 Xenon sum of all Xenon isotopes Xe-sum +30168 30168 Caesium 131 Cs-131 +30169 30169 Caesium 134 Cs-134 +30170 30170 Caesium 135 Cs-135 +30171 30171 Caesium 136 Cs-136 +30172 30172 Caesium 137 Cs-137 +30173 30173 Barium 133 Ba-133 +30174 30174 Barium 137 metastable Ba-137m +30175 30175 Barium 140 Ba-140 +30176 30176 Cerium 139 Ce-139 +30177 30177 Cerium 141 Ce-141 +30178 30178 Cerium 143 Ce-143 +30179 30179 Cerium 144 Ce-144 +30180 30180 Lanthanum 140 La-140 +30181 30181 Lanthanum 141 La-141 +30182 30182 Praseodymium 143 Pr-143 +30183 30183 Praseodymium 144 Pr-144 +30184 30184 Praseodymium 144 metastable Pr-144m +30185 30185 Samarium 145 Sm-145 +30186 30186 Samarium 147 Sm-147 +30187 30187 Samarium 151 Sm-151 +30188 30188 Neodymium 147 Nd-147 +30189 30189 Promethium 146 Pm-146 +30190 30190 Promethium 147 Pm-147 +30191 30191 Promethium 151 Pm-151 +30192 30192 Europium 152 Eu-152 +30193 30193 Europium 154 Eu-154 +30194 30194 Europium 155 Eu-155 +30195 30195 Gadolinium 153 Gd-153 +30196 30196 Terbium 160 Tb-160 +30197 30197 Holmium 166 metastable Ho-166m +30198 30198 Thulium 170 Tm-170 +30199 30199 Ytterbium 169 Yb-169 +30200 30200 Hafnium 175 Hf-175 +30201 30201 Hafnium 181 Hf-181 +30202 30202 Tantalum 179 Ta-179 +30203 30203 Tantalum 182 Ta-182 +30204 30204 Rhenium 184 Re-184 +30205 30205 Iridium 192 Ir-192 +30206 30206 Mercury 203 Hg-203 +30207 30207 Thallium 204 Tl-204 +30208 30208 Thallium 207 Tl-207 +30209 30209 Thallium 208 Tl-208 +30210 30210 Thallium 209 Tl-209 +30211 30211 Bismuth 205 Bi-205 +30212 30212 Bismuth 207 Bi-207 +30213 30213 Bismuth 210 Bi-210 +30214 30214 Bismuth 211 Bi-211 +30215 30215 Bismuth 212 Bi-212 +30216 30216 Bismuth 213 Bi-213 +30217 30217 Bismuth 214 Bi-214 +30218 30218 Polonium 208 Po-208 +30219 30219 Polonium 210 Po-210 +30220 30220 Polonium 212 Po-212 +30221 30221 Polonium 213 Po-213 +30222 30222 Polonium 214 Po-214 +30223 30223 Polonium 215 Po-215 +30224 30224 Polonium 216 Po-216 +30225 30225 Polonium 218 Po-218 +30226 30226 Lead 209 Pb-209 +30227 30227 Lead 210 Pb-210 +30228 30228 Lead 211 Pb-211 +30229 30229 Lead 212 Pb-212 +30230 30230 Lead 214 Pb-214 +30231 30231 Astatine 217 At-217 +30232 30232 Radon 219 Rn-219 +30233 30233 Radon 220 Rn-220 +30234 30234 Radon 222 Rn-222 +30235 30235 Francium 221 Fr-221 +30236 30236 Francium 223 Fr-223 +30237 30237 Radium 223 Ra-223 +30238 30238 Radium 224 Ra-224 +30239 30239 Radium 225 Ra-225 +30240 30240 Radium 226 Ra-226 +30241 30241 Radium 228 Ra-228 +30242 30242 Actinium 225 Ac-225 +30243 30243 Actinium 227 Ac-227 +30244 30244 Actinium 228 Ac-228 +30245 30245 Thorium 227 Th-227 +30246 30246 Thorium 228 Th-228 +30247 30247 Thorium 229 Th-229 +30248 30248 Thorium 230 Th-230 +30249 30249 Thorium 231 Th-231 +30250 30250 Thorium 232 Th-232 +30251 30251 Thorium 234 Th-234 +30252 30252 Protactinium 231 Pa-231 +30253 30253 Protactinium 233 Pa-233 +30254 30254 Protactinium 234 metastable Pa-234m +30255 30255 Uranium 232 U-232 +30256 30256 Uranium 233 U-233 +30257 30257 Uranium 234 U-234 +30258 30258 Uranium 235 U-235 +30259 30259 Uranium 236 U-236 +30260 30260 Uranium 237 U-237 +30261 30261 Uranium 238 U-238 +30262 30262 Plutonium 236 Pu-236 +30263 30263 Plutonium 238 Pu-238 +30264 30264 Plutonium 239 Pu-239 +30265 30265 Plutonium 240 Pu-240 +30266 30266 Plutonium 241 Pu-241 +30267 30267 Plutonium 242 Pu-242 +30268 30268 Plutonium 244 Pu-244 +30269 30269 Neptunium 237 Np-237 +30270 30270 Neptunium 238 Np-238 +30271 30271 Neptunium 239 Np-239 +30272 30272 Americium 241 Am-241 +30273 30273 Americium 242 Am-242 +30274 30274 Americium 242 metastable Am-242m +30275 30275 Americium 243 Am-243 +30276 30276 Curium 242 Cm-242 +30277 30277 Curium 243 Cm-243 +30278 30278 Curium 244 Cm-244 +30279 30279 Curium 245 Cm-245 +30280 30280 Curium 246 Cm-246 +30281 30281 Curium 247 Cm-247 +30282 30282 Curium 248 Cm-248 +30283 30283 Curium 243/244 Cm-243244 +30284 30284 Plutonium 238/Americium 241 Pu-238Am-241 +30285 30285 Plutonium 239/240 Pu-239240 +30286 30286 Berkelium 249 Bk-249 +30287 30287 Californium 249 Cf-249 +30288 30288 Californium 250 Cf-250 +30289 30289 Californium 252 Cf-252 +30290 30290 Sum aerosol particulates SumAer +30291 30291 Sum Iodine SumIod +30292 30292 Sum noble gas SumNG +30293 30293 Activation gas ActGas +30294 30294 Cs-137 Equivalent EquCs137 +30295 30295 Carbon-13 C-13 +30296 30296 Lead Pb +# 30297-39999 Reserved +40000 40000 Singlet sigma oxygen (dioxygen (sigma singlet)) O2 +40001 40001 Singlet delta oxygen (dioxygen (delta singlet)) O2 +40002 40002 Singlet excited oxygen atom O(1D) +40003 40003 Triplet ground state oxygen atom O(3P) +# 40004-59999 Reserved +60000 60000 HOx radical (OH+HO2) HOx +60001 60001 Total inorganic and organic peroxy radicals (HOO + ROO) ROO +60002 60002 Passive Ozone +60003 60003 NOx expressed as nitrogen NOx +60004 60004 All nitrogen oxides (NOy) expressed as nitrogen NOy +60005 60005 Total inorganic chlorine Clx +60006 60006 Total inorganic bromine Brx +60007 60007 Total inorganic chlorine except HCl, ClONO2: ClOx +60008 60008 Total inorganic bromine except HBr, BrONO2: BrOx +60009 60009 Lumped alkanes +60010 60010 Lumped alkenes +60011 60011 Lumped aromatic compounds +60012 60012 Lumped terpenes +60013 60013 Non-methane volatile organic compounds expressed as carbon NMVOC +60014 60014 Anthropogenic non-methane volatile organic compounds expressed as carbon aNMVOC +60015 60015 Biogenic non-methane volatile organic compounds expressed as carbon bNMVOC +60016 60016 Lumped oxygenated hydrocarbons OVOC +60017 60017 NOx expressed as nitrogen dioxide (NO2) NOx +60018 60018 Organic aldehydes RCHO +60019 60019 Organic peroxides ROOH +60020 60020 Organic nitrates RNO3 +60021 60021 Ethers ROR +60022 60022 Amines NRRR +60023 60023 Ketones RC(O)R +60024 60024 Dicarbonyls unsaturated RC(O)CH2C(O)R +60025 60025 Hydroxy dicarbonyls unsaturated RC(O)CHOHC(O)R +60026 60026 Hydroxy ketones RC(OH)C(O)R +60027 60027 Oxides Ox +# 60028-61999 Reserved +62000 62000 Total aerosol +62001 62001 Dust dry +62002 62002 Water in ambient +62003 62003 Ammonium dry +62004 62004 Nitrate dry +62005 62005 Nitric acid trihydrate +62006 62006 Sulphate dry +62007 62007 Mercury dry +62008 62008 Sea salt dry +62009 62009 Black carbon dry +62010 62010 Particulate organic matter dry +62011 62011 Primary particulate organic matter dry +62012 62012 Secondary particulate organic matter dry +62013 62013 Black carbon hydrophilic dry +62014 62014 Black carbon hydrophobic dry +62015 62015 Particulate organic matter hydrophilic dry +62016 62016 Particulate organic matter hydrophobic dry +62017 62017 Nitrate hydrophilic dry +62018 62018 Nitrate hydrophobic dry +# 62019 Reserved +62020 62020 Smoke - high absorption +62021 62021 Smoke - low absorption +62022 62022 Aerosol - high absorption +62023 62023 Aerosol - low absorption +# 62024 Reserved +62025 62025 Volcanic ash +62026 62026 Particulate matter (PM) +# 62027 Reserved +62028 62028 Total aerosol hydrophilic +62029 62029 Total aerosol hydrophobic +# 62030-62099 Reserved +62100 62100 Alnus (alder) pollen +62101 62101 Betula (birch) pollen +62102 62102 Castanea (chestnut) pollen +62103 62103 Carpinus (hornbeam) pollen +62104 62104 Corylus (hazel) pollen +62105 62105 Fagus (beech) pollen +62106 62106 Fraxinus (ash) pollen +62107 62107 Pinus (pine) pollen +62108 62108 Platanus (plane) pollen +62109 62109 Populus (cottonwood, poplar) pollen +62110 62110 Quercus (oak) pollen +62111 62111 Salix (willow) pollen +62112 62112 Taxus (yew) pollen +62113 62113 Tilia (lime, linden) pollen +62114 62114 Ulmus (elm) pollen +# 62115-62199 Reserved +62200 62200 Ambrosia (ragweed, burr-ragweed) pollen +62201 62201 Artemisia (sagebrush, wormwood, mugwort) pollen +62202 62202 Brassica (rape, broccoli, Brussels sprouts, cabbage, cauliflower, collards, kale,kohlrabi, mustard, rutabaga) pollen +62203 62203 Plantago (plantain) pollen +62204 62204 Rumex (dock, sorrel) pollen +62205 62205 Urtica (nettle) pollen +# 62206-62299 Reserved +62300 62300 Poaceae (grass family) pollen +# 62301-62999 Reserved +# 63000-65534 For experimental use at local level +65535 65535 Missing diff --git a/definitions/grib2/tables/25/4.233.table b/definitions/grib2/tables/25/4.233.table new file mode 100644 index 000000000..051d603a9 --- /dev/null +++ b/definitions/grib2/tables/25/4.233.table @@ -0,0 +1,512 @@ +# Code table 4.233 - Aerosol type +0 0 Ozone O3 +1 1 Water vapour H2O +2 2 Methane CH4 +3 3 Carbon dioxide CO2 +4 4 Carbon monoxide CO +5 5 Nitrogen dioxide NO2 +6 6 Nitrous oxide N2O +7 7 Formaldehyde HCHO +8 8 Sulphur dioxide SO2 +9 9 Ammonia NH3 +10 10 Ammonium cation NH4+ +11 11 Nitrogen monoxide NO +12 12 Atomic oxygen O +13 13 Nitrate radical NO3 +14 14 Hydroperoxyl radical HOO +15 15 Dinitrogen pentoxide N2O5 +16 16 Nitrous acid HONO +17 17 Nitric acid HNO3 +18 18 Peroxynitric acid HO2NO2 +19 19 Hydrogen peroxide H2O2 +20 20 Dihydrogen H2 +21 21 Atomic nitrogen N +22 22 Sulphate anion SO42- +23 23 Atomic Radon Rn +24 24 Mercury vapour Hg(0) +25 25 Mercury(II) cation Hg2+ +26 26 Atomic chlorine Cl +27 27 Chlorine monoxide ClO +28 28 Dichlorine peroxide Cl2O2 +29 29 Hypochlorous acid HClO +30 30 Chlorine nitrate ClONO2 +31 31 Chlorine dioxide ClO2 +32 32 Atomic bromine Br +33 33 Bromine monoxide BrO +34 34 Bromine chloride BrCl +35 35 Hydrogen bromide HBr +36 36 Hypobromous acid HBrO +37 37 Bromine nitrate BrONO2 +38 38 Dioxygen O2 +39 39 Nitryl chloride NO2Cl +40 40 Sulphuric acid H2SO4 +41 41 Hydrogen sulphide H2S +42 42 Sulphur trioxide SO3 +43 43 Bromine Br2 +44 44 Hydrofluoric acid HF +45 45 Sulphur hexafluoride SF6 +46 46 Chlorine Cl2 +# 47-9999 Reserved +10000 10000 Hydroxyl radical HO +10001 10001 Methyl peroxy radical CH3OO +10002 10002 Methyl hydroperoxide CH3O2H +10004 10004 Methanol CH3OH +10005 10005 Formic acid CH3OOH +10006 10006 Hydrogen cyanide HCN +10007 10007 Aceto nitrile CH3CN +10008 10008 Ethane C2H6 +10009 10009 Ethene (= Ethylene) C2H4 +10010 10010 Ethyne (= Acetylene) C2H2 +10011 10011 Ethanol C2H5OH +10012 10012 Acetic acid C2H5OOH +10013 10013 Peroxyacetyl nitrate CH3C(O)OONO2 +10014 10014 Propane C3H8 +10015 10015 Propene C3H6 +10016 10016 Butane (all isomers) C4H10 +10017 10017 Isoprene C5H10 +10018 10018 Alpha pinene C10H16 +10019 10019 Beta pinene C10H16 +10020 10020 Limonene C10H16 +10021 10021 Benzene C6H6 +10022 10022 Toluene C7H8 +10023 10023 XyleneC8H10 +10024 10024 Methanesulphonic acid CH3SO3H +10025 10025 Methylglyoxal (2-oxopropanal) CH3C(O)CHO +10026 10026 Peroxyacetyl radical CH3C(O)OO +10027 10027 Methacrylic acid (2-methylprop-2-enoic acid) CH2C(CH3)COOH +10028 10028 Methacrolein (2-methylprop-2-enal) CH2C(CH3)CHO +10029 10029 Acetone (propan-2-one) CH3C(O)CH3 +10030 10030 Ethyl dioxidanyl radical CH3CH2OO +10031 10031 Butadiene (buta-1,3-diene) (CH2CH)2 +10032 10032 Acetaldehyde (ethanal) CH3CHO +10033 10033 Glycolaldehyde (hydroxyethanal) HOCH2CHO +10034 10034 Cresol (methylphenol), all isomers CH3C6H4OH +10035 10035 Peracetic acid (ethaneperoxoic acid) CH3C(O)OOH +10036 10036 2-hydroxyethyl oxidanyl radical HOCH2CH2O +10037 10037 2-hydroxyethyl dioxidanyl radical HOCH2CH2OO +10038 10038 Glyoxal (oxaldehyde) OCHCHO +10039 10039 Isopropyl dioxidanyl radical (CH3)2CHOO +10040 10040 Isopropyl hydroperoxide (2-hydroperoxypropane) (CH3)2CHOOH +10041 10041 Hydroxyacetone (1-hydroxypropan-2-one) CH3C(O)CH2OH +10042 10042 Peroxyacetic acid (ethaneperoxoic acid) CH3C(O)OOH +10043 10043 Methyl vinyl ketone (but-3-en-2-one) CH3C(O)CHCH2 +10044 10044 Phenoxy radical C6H5O +10045 10045 Methyl radical CH3 +10046 10046 Carbonyl sulphide (carbon oxide sulphide) OCS +10047 10047 Dibromomethane CH2Br2 +10048 10048 Methoxy radical CH3O +10049 10049 Tribromomethane CHBr3 +10050 10050 Formyl radical (oxomethyl radical) HOC +10051 10051 Hydroxymethyl dioxidanyl radical HOCH2OO +10052 10052 Ethyl hydroperoxide CH3CH2OOH +10053 10053 3-hydroxypropyl dioxidanyl radical HOCH2CH2CH2OO +10054 10054 3-hydroxypropyl hydroperoxide HOCH2CH2CH2OOH +# 10055-10499 Reserved for other simple organic molecules (e.g. higher aldehydes, alcohols, peroxides, ...) +10500 10500 Dimethyl sulphide CH3SCH3 (DMS) +10501 10501 DMSO (dimethyl sulfoxide) (CH3)2SO +# 10502-20000 Reserved +20001 20001 Hydrogen chloride HCl +20002 20002 CFC-11 (trichlorofluoromethane) CCl3F +20003 20003 CFC-12 (dichlorodifluoromethane) CCl2F2 +20004 20004 CFC-113 (1,1,2-trichloro-1,2,2-trifluoroethane) Cl2FC-CClF2 +20005 20005 CFC-113a (1,1,1-trichloro-2,2,2-trifluoroethane) Cl3C-CF3 +20006 20006 CFC-114 (1,2-dichloro-1,1,2,2-tetrafluoroethane) ClF2C-CClF2 +20007 20007 CFC-115 (1-chloro-1,1,2,2,2-pentafluoroethane) ClF2C-CF3 +20008 20008 HCFC-22 (chlorodifluoromethane) CHClF2 +20009 20009 HCFC-141b (1,1-dichloro-1-fluoroethane) Cl2FC-CH3 +20010 20010 HCFC-142b (1-chloro-1,1-difluoroethane) ClF2C-CH3 +20011 20011 Halon-1202 (dibromodifluoromethane) CBr2F2 +20012 20012 Halon-1211 (bromochlorodifluoromethane) CBrClF2 +20013 20013 Halon-1301 (bromotrifluoromethane) CBrF3 +20014 20014 Halon-2402 (1,2-dibromo-1,1,2,2-tetrafluoroethane) BrF2C-CBrF2 +20015 20015 HCC-40 (methyl chloride) CH3Cl +20016 20016 HCC-10 (carbon tetrachloride) CCl4 +20017 20017 HCC-140a (1,1,1-trichloroethane) Cl3C-CH3 +20018 20018 HBC-40B1 (methyl bromide) CH3Br +20019 20019 HCH (hexachlorocyclohexane) all isomers C6H6Cl6 +20020 20020 alpha-HCH (alpha-hexachlorocyclohexane) both enantiomers alpha-C6H6Cl6 +20021 20021 PCB-153 (2,2',4,4',5,5'-hexachlorobiphenyl) (C6H2Cl3)2 +20022 20022 HCFC-141a (1,1-dichloro-2-fluoroethane) Cl2HC-CH2F +# 20023-29999 Reserved +30000 30000 Radioactive pollutant (tracer, defined by originating centre) +# 30001-30009 Reserved +30010 30010 Tritium (Hydrogen 3) H-3 +30011 30011 Tritium organic bounded H-3o +30012 30012 Tritium inorganic H-3a +30013 30013 Beryllium 7 Be-7 +30014 30014 Beryllium 10 Be-10 +30015 30015 Carbon 14 C-14 +30016 30016 Carbon 14 CO2 C-14CO2 +30017 30017 Carbon 14 other gases C-14og +30018 30018 Nitrogen 13 N-13 +30019 30019 Nitrogen 16 N-16 +30020 30020 Fluorine 18 F-18 +30021 30021 Sodium 22 Na-22 +30022 30022 Phosphate 32 P-32 +30023 30023 Phosphate 33 P-33 +30024 30024 Sulphur 35 S-35 +30025 30025 Chlorine 36 Cl-36 +30026 30026 Potassium 40 K-40 +30027 30027 Argon 41 Ar-41 +30028 30028 Calcium 41 Ca-41 +30029 30029 Calcium 45 Ca-45 +30030 30030 Titanium 44 Ti-44 +30031 30031 Scandium 46 Sc-46 +30032 30032 Vanadium 48 V-48 +30033 30033 Vanadium 49 V-49 +30034 30034 Chrome 51 Cr-51 +30035 30035 Manganese 52 Mn-52 +30036 30036 Manganese 54 Mn-54 +30037 30037 Iron 55 Fe-55 +30038 30038 Iron 59 Fe-59 +30039 30039 Cobalt 56 Co-56 +30040 30040 Cobalt 57 Co-57 +30041 30041 Cobalt 58 Co-58 +30042 30042 Cobalt 60 Co-60 +30043 30043 Nickel 59 Ni-59 +30044 30044 Nickel 63 Ni-63 +30045 30045 Zinc 65 Zn-65 +30046 30046 Gallium 67 Ga-67 +30047 30047 Gallium 68 Ga-68 +30048 30048 Germanium 68 Ge-68 +30049 30049 Germanium 69 Ge-69 +30050 30050 Arsenic 73 As-73 +30051 30051 Selenium 75 Se-75 +30052 30052 Selenium 79 Se-79 +30053 30053 Rubidium 81 Rb-81 +30054 30054 Rubidium 83 Rb-83 +30055 30055 Rubidium 84 Rb-84 +30056 30056 Rubidium 86 Rb-86 +30057 30057 Rubidium 87 Rb-87 +30058 30058 Rubidium 88 Rb-88 +30059 30059 Krypton 85 Kr-85 +30060 30060 Krypton 85 metastable Kr-85m +30061 30061 Krypton 87 Kr-87 +30062 30062 Krypton 88 Kr-88 +30063 30063 Krypton 89 Kr-89 +30064 30064 Strontium 85 Sr-85 +30065 30065 Strontium 89 Sr-89 +30066 30066 Strontium 89/90 Sr-8990 +30067 30067 Strontium 90 Sr-90 +30068 30068 Strontium 91 Sr-91 +30069 30069 Strontium 92 Sr-92 +30070 30070 Yttrium 87 Y-87 +30071 30071 Yttrium 88 Y-88 +30072 30072 Yttrium 90 Y-90 +30073 30073 Yttrium 91 Y-91 +30074 30074 Yttrium 91 metastable Y-91m +30075 30075 Yttrium 92 Y-92 +30076 30076 Yttrium 93 Y-93 +30077 30077 Zirconium 89 Zr-89 +30078 30078 Zirconium 93 Zr-93 +30079 30079 Zirconium 95 Zr-95 +30080 30080 Zirconium 97 Zr-97 +30081 30081 Niobium 93 metastable Nb-93m +30082 30082 Niobium 94 Nb-94 +30083 30083 Niobium 95 Nb-95 +30084 30084 Niobium 95 metastable Nb-95m +30085 30085 Niobium 97 Nb-97 +30086 30086 Niobium 97 metastable Nb-97m +30087 30087 Molybdenum 93 Mo-93 +30088 30088 Molybdenum 99 Mo-99 +30089 30089 Technetium 95 metastable Tc-95m +30090 30090 Technetium 96 Tc-96 +30091 30091 Technetium 99 Tc-99 +30092 30092 Technetium 99 metastable Tc-99m +30093 30093 Rhodium 99 Rh-99 +30094 30094 Rhodium 101 Rh-101 +30095 30095 Rhodium 102 metastable Rh-102m +30096 30096 Rhodium 103 metastable Rh-103m +30097 30097 Rhodium 105 Rh-105 +30098 30098 Rhodium 106 Rh-106 +30099 30099 Palladium 100 Pd-100 +30100 30100 Palladium 103 Pd-103 +30101 30101 Palladium 107 Pd-107 +30102 30102 Ruthenium 103 Ru-103 +30103 30103 Ruthenium 105 Ru-105 +30104 30104 Ruthenium 106 Ru-106 +30105 30105 Silver 108 metastable Ag-108m +30106 30106 Silver 110 metastable Ag-110m +30107 30107 Cadmium 109 Cd-109 +30108 30108 Cadmium 113 metastable Cd-113m +30109 30109 Cadmium 115 metastable Cd-115m +30110 30110 Indium 114 metastable In-114m +30111 30111 Tin 113 Sn-113 +30112 30112 Tin 119 metastable Sn-119m +30113 30113 Tin 121 metastable Sn-121m +30114 30114 Tin 122 Sn-122 +30115 30115 Tin 123 Sn-123 +30116 30116 Tin 126 Sn-126 +30117 30117 Antimony 124 Sb-124 +30118 30118 Antimony 125 Sb-125 +30119 30119 Antimony 126 Sb-126 +30120 30120 Antimony 127 Sb-127 +30121 30121 Antimony 129 Sb-129 +30122 30122 Tellurium 123 metastable Te-123m +30123 30123 Tellurium 125 metastable Te-125m +30124 30124 Tellurium 127 Te-127 +30125 30125 Tellurium 127 metastable Te-127m +30126 30126 Tellurium 129 Te-129 +30127 30127 Tellurium 129 metastable Te-129m +30128 30128 Tellurium 131 metastable Te-131m +30129 30129 Tellurium 132 Te-132 +30130 30130 Iodine 123 I-123 +30131 30131 Iodine 124 I-124 +30132 30132 Iodine 125 I-125 +30133 30133 Iodine 126 I-126 +30134 30134 Iodine 129 I-129 +30135 30135 Iodine 129 elementary gaseous I-129g +30136 30136 Iodine 129 organic bounded I-129o +30137 30137 Iodine 131 I-131 +30138 30138 Iodine 131 elementary gaseous I-131g +30139 30139 Iodine 131 organic bounded I-131o +30140 30140 Iodine 131 gaseous elementary and organic bounded I-131go +30141 30141 Iodine 131 aerosol I-131a +30142 30142 Iodine 132 I-132 +30143 30143 Iodine 132 elementary gaseous I-132g +30144 30144 Iodine 132 organic bounded I-132o +30145 30145 Iodine 132 gaseous elementary and organic bounded I-132go +30146 30146 Iodine 132 aerosol I-132a +30147 30147 Iodine 133 I-133 +30148 30148 Iodine 133 elementary gaseous I-133g +30149 30149 Iodine 133 organic bounded I-133o +30150 30150 Iodine 133 gaseous elementary and organic bounded I-133go +30151 30151 Iodine 133 aerosol I-133a +30152 30152 Iodine 134 I-134 +30153 30153 Iodine 134 elementary gaseous I-134g +30154 30154 Iodine 134 organic bounded I-134o +30155 30155 Iodine 135 I-135 +30156 30156 Iodine 135 elementary gaseous I-135g +30157 30157 Iodine 135 organic bounded I-135o +30158 30158 Iodine 135 gaseous elementary and organic bounded I-135go +30159 30159 Iodine 135 aerosol I-135a +30160 30160 Xenon 131 metastable Xe-131m +30161 30161 Xenon 133 Xe-133 +30162 30162 Xenon 133 metastable Xe-133m +30163 30163 Xenon 135 Xe-135 +30164 30164 Xenon 135 metastable Xe-135m +30165 30165 Xenon 137 Xe-137 +30166 30166 Xenon 138 Xe-138 +30167 30167 Xenon sum of all Xenon isotopes Xe-sum +30168 30168 Caesium 131 Cs-131 +30169 30169 Caesium 134 Cs-134 +30170 30170 Caesium 135 Cs-135 +30171 30171 Caesium 136 Cs-136 +30172 30172 Caesium 137 Cs-137 +30173 30173 Barium 133 Ba-133 +30174 30174 Barium 137 metastable Ba-137m +30175 30175 Barium 140 Ba-140 +30176 30176 Cerium 139 Ce-139 +30177 30177 Cerium 141 Ce-141 +30178 30178 Cerium 143 Ce-143 +30179 30179 Cerium 144 Ce-144 +30180 30180 Lanthanum 140 La-140 +30181 30181 Lanthanum 141 La-141 +30182 30182 Praseodymium 143 Pr-143 +30183 30183 Praseodymium 144 Pr-144 +30184 30184 Praseodymium 144 metastable Pr-144m +30185 30185 Samarium 145 Sm-145 +30186 30186 Samarium 147 Sm-147 +30187 30187 Samarium 151 Sm-151 +30188 30188 Neodymium 147 Nd-147 +30189 30189 Promethium 146 Pm-146 +30190 30190 Promethium 147 Pm-147 +30191 30191 Promethium 151 Pm-151 +30192 30192 Europium 152 Eu-152 +30193 30193 Europium 154 Eu-154 +30194 30194 Europium 155 Eu-155 +30195 30195 Gadolinium 153 Gd-153 +30196 30196 Terbium 160 Tb-160 +30197 30197 Holmium 166 metastable Ho-166m +30198 30198 Thulium 170 Tm-170 +30199 30199 Ytterbium 169 Yb-169 +30200 30200 Hafnium 175 Hf-175 +30201 30201 Hafnium 181 Hf-181 +30202 30202 Tantalum 179 Ta-179 +30203 30203 Tantalum 182 Ta-182 +30204 30204 Rhenium 184 Re-184 +30205 30205 Iridium 192 Ir-192 +30206 30206 Mercury 203 Hg-203 +30207 30207 Thallium 204 Tl-204 +30208 30208 Thallium 207 Tl-207 +30209 30209 Thallium 208 Tl-208 +30210 30210 Thallium 209 Tl-209 +30211 30211 Bismuth 205 Bi-205 +30212 30212 Bismuth 207 Bi-207 +30213 30213 Bismuth 210 Bi-210 +30214 30214 Bismuth 211 Bi-211 +30215 30215 Bismuth 212 Bi-212 +30216 30216 Bismuth 213 Bi-213 +30217 30217 Bismuth 214 Bi-214 +30218 30218 Polonium 208 Po-208 +30219 30219 Polonium 210 Po-210 +30220 30220 Polonium 212 Po-212 +30221 30221 Polonium 213 Po-213 +30222 30222 Polonium 214 Po-214 +30223 30223 Polonium 215 Po-215 +30224 30224 Polonium 216 Po-216 +30225 30225 Polonium 218 Po-218 +30226 30226 Lead 209 Pb-209 +30227 30227 Lead 210 Pb-210 +30228 30228 Lead 211 Pb-211 +30229 30229 Lead 212 Pb-212 +30230 30230 Lead 214 Pb-214 +30231 30231 Astatine 217 At-217 +30232 30232 Radon 219 Rn-219 +30233 30233 Radon 220 Rn-220 +30234 30234 Radon 222 Rn-222 +30235 30235 Francium 221 Fr-221 +30236 30236 Francium 223 Fr-223 +30237 30237 Radium 223 Ra-223 +30238 30238 Radium 224 Ra-224 +30239 30239 Radium 225 Ra-225 +30240 30240 Radium 226 Ra-226 +30241 30241 Radium 228 Ra-228 +30242 30242 Actinium 225 Ac-225 +30243 30243 Actinium 227 Ac-227 +30244 30244 Actinium 228 Ac-228 +30245 30245 Thorium 227 Th-227 +30246 30246 Thorium 228 Th-228 +30247 30247 Thorium 229 Th-229 +30248 30248 Thorium 230 Th-230 +30249 30249 Thorium 231 Th-231 +30250 30250 Thorium 232 Th-232 +30251 30251 Thorium 234 Th-234 +30252 30252 Protactinium 231 Pa-231 +30253 30253 Protactinium 233 Pa-233 +30254 30254 Protactinium 234 metastable Pa-234m +30255 30255 Uranium 232 U-232 +30256 30256 Uranium 233 U-233 +30257 30257 Uranium 234 U-234 +30258 30258 Uranium 235 U-235 +30259 30259 Uranium 236 U-236 +30260 30260 Uranium 237 U-237 +30261 30261 Uranium 238 U-238 +30262 30262 Plutonium 236 Pu-236 +30263 30263 Plutonium 238 Pu-238 +30264 30264 Plutonium 239 Pu-239 +30265 30265 Plutonium 240 Pu-240 +30266 30266 Plutonium 241 Pu-241 +30267 30267 Plutonium 242 Pu-242 +30268 30268 Plutonium 244 Pu-244 +30269 30269 Neptunium 237 Np-237 +30270 30270 Neptunium 238 Np-238 +30271 30271 Neptunium 239 Np-239 +30272 30272 Americium 241 Am-241 +30273 30273 Americium 242 Am-242 +30274 30274 Americium 242 metastable Am-242m +30275 30275 Americium 243 Am-243 +30276 30276 Curium 242 Cm-242 +30277 30277 Curium 243 Cm-243 +30278 30278 Curium 244 Cm-244 +30279 30279 Curium 245 Cm-245 +30280 30280 Curium 246 Cm-246 +30281 30281 Curium 247 Cm-247 +30282 30282 Curium 248 Cm-248 +30283 30283 Curium 243/244 Cm-243244 +30284 30284 Plutonium 238/Americium 241 Pu-238Am-241 +30285 30285 Plutonium 239/240 Pu-239240 +30286 30286 Berkelium 249 Bk-249 +30287 30287 Californium 249 Cf-249 +30288 30288 Californium 250 Cf-250 +30289 30289 Californium 252 Cf-252 +30290 30290 Sum aerosol particulates SumAer +30291 30291 Sum Iodine SumIod +30292 30292 Sum noble gas SumNG +30293 30293 Activation gas ActGas +30294 30294 Cs-137 Equivalent EquCs137 +30295 30295 Carbon-13 C-13 +30296 30296 Lead Pb +# 30297-39999 Reserved +40000 40000 Singlet sigma oxygen (dioxygen (sigma singlet)) O2 +40001 40001 Singlet delta oxygen (dioxygen (delta singlet)) O2 +40002 40002 Singlet excited oxygen atom O(1D) +40003 40003 Triplet ground state oxygen atom O(3P) +# 40004-59999 Reserved +60000 60000 HOx radical (OH+HO2) HOx +60001 60001 Total inorganic and organic peroxy radicals (HOO + ROO) ROO +60002 60002 Passive Ozone +60003 60003 NOx expressed as nitrogen NOx +60004 60004 All nitrogen oxides (NOy) expressed as nitrogen NOy +60005 60005 Total inorganic chlorine Clx +60006 60006 Total inorganic bromine Brx +60007 60007 Total inorganic chlorine except HCl, ClONO2: ClOx +60008 60008 Total inorganic bromine except HBr, BrONO2: BrOx +60009 60009 Lumped alkanes +60010 60010 Lumped alkenes +60011 60011 Lumped aromatic compounds +60012 60012 Lumped terpenes +60013 60013 Non-methane volatile organic compounds expressed as carbon NMVOC +60014 60014 Anthropogenic non-methane volatile organic compounds expressed as carbon aNMVOC +60015 60015 Biogenic non-methane volatile organic compounds expressed as carbon bNMVOC +60016 60016 Lumped oxygenated hydrocarbons OVOC +60017 60017 NOx expressed as nitrogen dioxide (NO2) NOx +60018 60018 Organic aldehydes RCHO +60019 60019 Organic peroxides ROOH +60020 60020 Organic nitrates RNO3 +60021 60021 Ethers ROR +60022 60022 Amines NRRR +60023 60023 Ketones RC(O)R +60024 60024 Dicarbonyls unsaturated RC(O)CH2C(O)R +60025 60025 Hydroxy dicarbonyls unsaturated RC(O)CHOHC(O)R +60026 60026 Hydroxy ketones RC(OH)C(O)R +60027 60027 Oxides Ox +# 60028-61999 Reserved +62000 62000 Total aerosol +62001 62001 Dust dry +62002 62002 Water in ambient +62003 62003 Ammonium dry +62004 62004 Nitrate dry +62005 62005 Nitric acid trihydrate +62006 62006 Sulphate dry +62007 62007 Mercury dry +62008 62008 Sea salt dry +62009 62009 Black carbon dry +62010 62010 Particulate organic matter dry +62011 62011 Primary particulate organic matter dry +62012 62012 Secondary particulate organic matter dry +62013 62013 Black carbon hydrophilic dry +62014 62014 Black carbon hydrophobic dry +62015 62015 Particulate organic matter hydrophilic dry +62016 62016 Particulate organic matter hydrophobic dry +62017 62017 Nitrate hydrophilic dry +62018 62018 Nitrate hydrophobic dry +# 62019 Reserved +62020 62020 Smoke - high absorption +62021 62021 Smoke - low absorption +62022 62022 Aerosol - high absorption +62023 62023 Aerosol - low absorption +# 62024 Reserved +62025 62025 Volcanic ash +62026 62026 Particulate matter (PM) +# 62027 Reserved +62028 62028 Total aerosol hydrophilic +62029 62029 Total aerosol hydrophobic +# 62030-62099 Reserved +62100 62100 Alnus (alder) pollen +62101 62101 Betula (birch) pollen +62102 62102 Castanea (chestnut) pollen +62103 62103 Carpinus (hornbeam) pollen +62104 62104 Corylus (hazel) pollen +62105 62105 Fagus (beech) pollen +62106 62106 Fraxinus (ash) pollen +62107 62107 Pinus (pine) pollen +62108 62108 Platanus (plane) pollen +62109 62109 Populus (cottonwood, poplar) pollen +62110 62110 Quercus (oak) pollen +62111 62111 Salix (willow) pollen +62112 62112 Taxus (yew) pollen +62113 62113 Tilia (lime, linden) pollen +62114 62114 Ulmus (elm) pollen +# 62115-62199 Reserved +62200 62200 Ambrosia (ragweed, burr-ragweed) pollen +62201 62201 Artemisia (sagebrush, wormwood, mugwort) pollen +62202 62202 Brassica (rape, broccoli, Brussels sprouts, cabbage, cauliflower, collards, kale,kohlrabi, mustard, rutabaga) pollen +62203 62203 Plantago (plantain) pollen +62204 62204 Rumex (dock, sorrel) pollen +62205 62205 Urtica (nettle) pollen +# 62206-62299 Reserved +62300 62300 Poaceae (grass family) pollen +# 62301-62999 Reserved +# 63000-65534 For experimental use at local level +65535 65535 Missing diff --git a/definitions/grib2/tables/25/4.234.table b/definitions/grib2/tables/25/4.234.table new file mode 100644 index 000000000..816541ce9 --- /dev/null +++ b/definitions/grib2/tables/25/4.234.table @@ -0,0 +1,21 @@ +# Code table 4.234 - Canopy cover fraction (to be used as partitioned parameter in product definition template 4.53 or 4.54) +1 1 Crops, mixed farming +2 2 Short grass +3 3 Evergreen needleleaf trees +4 4 Deciduous needleleaf trees +5 5 Deciduous broadleaf trees +6 6 Evergreen broadleaf trees +7 7 Tall grass +8 8 Desert +9 9 Tundra +10 10 Irrigated crops +11 11 Semidesert +12 12 Ice caps and glaciers +13 13 Bogs and marshes +14 14 Inland water +15 15 Ocean +16 16 Evergreen shrubs +17 17 Deciduous shrubs +18 18 Mixed forest +19 19 Interrupted forest +20 20 Water and land mixtures diff --git a/definitions/grib2/tables/25/4.236.table b/definitions/grib2/tables/25/4.236.table new file mode 100644 index 000000000..fbe093ce9 --- /dev/null +++ b/definitions/grib2/tables/25/4.236.table @@ -0,0 +1,8 @@ +# Code table 4.236 - Soil texture fraction (to be used as partitioned parameter in product definition template 4.53 or 4.54) +1 1 Coarse +2 2 Medium +3 3 Medium-fine +4 4 Fine +5 5 Very-fine +6 6 Organic +7 7 Tropical-organic diff --git a/definitions/grib2/tables/25/4.238.table b/definitions/grib2/tables/25/4.238.table new file mode 100644 index 000000000..6dfaf8286 --- /dev/null +++ b/definitions/grib2/tables/25/4.238.table @@ -0,0 +1,16 @@ +# Code table 4.238 - Source or sink +0 0 Reserved +1 1 Aviation +2 2 Lightning +3 3 Biogenic sources +4 4 Anthropogenic sources +5 5 Wild fires +6 6 Natural sources +7 7 Volcanoes +8 8 Bio-fuel +9 9 Fossil-fuel +10 10 Wetlands +11 11 Oceans +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.240.table b/definitions/grib2/tables/25/4.240.table new file mode 100644 index 000000000..f48c086e4 --- /dev/null +++ b/definitions/grib2/tables/25/4.240.table @@ -0,0 +1,13 @@ +# Code table 4.240 - Type of distribution function +0 0 No specific distribution function given +1 1 Delta functions with spatially variable concentration and fixed diameters Dl (p1) in metre +2 2 Delta functions with spatially variable concentration and fixed masses Ml (p1) in kg +3 3 Gaussian (normal) distribution with spatially variable concentration and fixed mean diameter Dl(p1) and variance(p2) +4 4 Gaussian (normal) distribution with spatially variable concentration, mean diameter and variance +5 5 Log-normal distribution with spatially variable number density, mean diameter and variance +6 6 Log-normal distribution with spatially variable number density, mean diameter and fixed variance(p1) +7 7 Log-normal distribution with spatially variable number density and mass density and fixed variance(p1) and fixed particle density(p2) +8 8 No distribution function. The encoded variable is derived from variables characterized by type of distribution function of type No. 7 (see above) with fixed variance(p1) and fixed particle density(p2) +# 9-49151 Reserved +# 49152-65534 Reserved for local use +65535 65535 Missing value diff --git a/definitions/grib2/tables/25/4.241.table b/definitions/grib2/tables/25/4.241.table new file mode 100644 index 000000000..a037b4ba5 --- /dev/null +++ b/definitions/grib2/tables/25/4.241.table @@ -0,0 +1,9 @@ +# Code table 4.241 - Coverage attributes +0 0 Undefined +1 1 Unmodified +2 2 Snow covered +3 3 Flooded +4 4 Ice covered +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing value diff --git a/definitions/grib2/tables/25/4.242.table b/definitions/grib2/tables/25/4.242.table new file mode 100644 index 000000000..083f88c29 --- /dev/null +++ b/definitions/grib2/tables/25/4.242.table @@ -0,0 +1,7 @@ +# Code table 4.242 - Tile classification +0 0 Reserved +1 1 Land use classes according to ESA-GlobCover GCV2009 +2 2 Land use classes according to European Commission-Global Land Cover Project GLC2000 +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing value diff --git a/definitions/grib2/tables/25/4.243.table b/definitions/grib2/tables/25/4.243.table new file mode 100644 index 000000000..b39053311 --- /dev/null +++ b/definitions/grib2/tables/25/4.243.table @@ -0,0 +1,43 @@ +# Code table 4.243 - Tile class +0 0 Reserved +1 1 Evergreen broadleaved forest +2 2 Deciduous broadleaved closed forest +3 3 Deciduous broadleaved open forest +4 4 Evergreen needle-leaf forest +5 5 Deciduous needle-leaf forest +6 6 Mixed leaf trees +7 7 Freshwater flooded trees +8 8 Saline water flooded trees +9 9 Mosaic tree/natural vegetation +10 10 Burnt tree cover +11 11 Evergreen shrubs closed-open +12 12 Deciduous shrubs closed-open +13 13 Herbaceous vegetation closed-open +14 14 Sparse herbaceous or grass +15 15 Flooded shrubs or herbaceous +16 16 Cultivated and managed areas +17 17 Mosaic crop/tree/natural vegetation +18 18 Mosaic crop/shrub/grass +19 19 Bare areas +20 20 Water +21 21 Snow and ice +22 22 Artificial surface +23 23 Ocean +24 24 Irrigated croplands +25 25 Rainfed croplands +26 26 Mosaic cropland (50-70%) - vegetation (20-50%) +27 27 Mosaic vegetation (50-70%) - cropland (20-50%) +28 28 Closed broadleaved evergreen forest +29 29 Closed needle-leaved evergreen forest +30 30 Open needle-leaved deciduous forest +31 31 Mixed broadleaved and needle-leaved forest +32 32 Mosaic shrubland (50-70%) - grassland (20-50%) +33 33 Mosaic grassland (50-70%) - shrubland (20-50%) +34 34 Closed to open shrubland +35 35 Sparse vegetation +36 36 Closed to open forest regularly flooded +37 37 Closed forest or shrubland permanently flooded +38 38 Closed to open grassland regularly flooded +39 39 Undefined +# 40-32767 Reserved +# 32768- Reserved for local use diff --git a/definitions/grib2/tables/25/4.244.table b/definitions/grib2/tables/25/4.244.table new file mode 100644 index 000000000..40534ee09 --- /dev/null +++ b/definitions/grib2/tables/25/4.244.table @@ -0,0 +1,7 @@ +# Code table 4.244 - Quality indicator +0 0 No quality information available +1 1 Failed +2 2 Passed +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.3.table b/definitions/grib2/tables/25/4.3.table new file mode 100644 index 000000000..8ba9e08ab --- /dev/null +++ b/definitions/grib2/tables/25/4.3.table @@ -0,0 +1,23 @@ +# Code table 4.3 - Type of generating process +0 0 Analysis +1 1 Initialization +2 2 Forecast +3 3 Bias corrected forecast +4 4 Ensemble forecast +5 5 Probability forecast +6 6 Forecast error +7 7 Analysis error +8 8 Observation +9 9 Climatological +10 10 Probability-weighted forecast +11 11 Bias-corrected ensemble forecast +12 12 Post-processed analysis +13 13 Post-processed forecast +14 14 Nowcast +15 15 Hindcast +16 16 Physical retrieval +17 17 Regression analysis +18 18 Difference between two forecasts +# 19-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.4.table b/definitions/grib2/tables/25/4.4.table new file mode 100644 index 000000000..7087ebddb --- /dev/null +++ b/definitions/grib2/tables/25/4.4.table @@ -0,0 +1,17 @@ +# Code table 4.4 - Indicator of unit of time range +0 m Minute +1 h Hour +2 D Day +3 M Month +4 Y Year +5 10Y Decade (10 years) +6 30Y Normal (30 years) +7 C Century (100 years) +# 8-9 Reserved +10 3h 3 hours +11 6h 6 hours +12 12h 12 hours +13 s Second +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.5.table b/definitions/grib2/tables/25/4.5.table new file mode 100644 index 000000000..ec956a361 --- /dev/null +++ b/definitions/grib2/tables/25/4.5.table @@ -0,0 +1,76 @@ +# Code table 4.5 - Fixed surface types and units +0 0 Reserved +1 sfc Ground or water surface (-) +2 2 Cloud base level (-) +3 3 Level of cloud tops (-) +4 4 Level of 0 degree C isotherm (-) +5 5 Level of adiabatic condensation lifted from the surface (-) +6 6 Maximum wind level (-) +7 7 Tropopause (-) +8 sfc Nominal top of the atmosphere (-) +9 9 Sea bottom (-) +10 10 Entire atmosphere (-) +11 11 Cumulonimbus (CB) base (m) +12 12 Cumulonimbus (CB) top (m) +13 13 Lowest level where vertically integrated cloud cover exceeds the specified percentage (cloud base for a given percentage cloud cover) (%) +14 14 Level of free convection (LFC) +15 15 Convective condensation level (CCL) +16 16 Level of neutral buoyancy or equilibrium level (LNB) +# 17-19 Reserved +20 20 Isothermal level (K) +21 21 Lowest level where mass density exceeds the specified value (base for a given threshold of mass density) (kg m-3) +22 22 Highest level where mass density exceeds the specified value (top for a given threshold of mass density) (kg m-3) +23 23 Lowest level where air concentration exceeds the specified value (base for a given threshold of air concentration) (Bq m-3) +24 24 Highest level where air concentration exceeds the specified value (top for a given threshold of air concentration) (Bq m-3) +25 25 Highest level where radar reflectivity exceeds the specified value (echo top for a given threshold of reflectivity) (dBZ) +# 26-99 Reserved +100 pl Isobaric surface (Pa) +101 sfc Mean sea level +102 102 Specific altitude above mean sea level (m) +103 sfc Specified height level above ground (m) +104 104 Sigma level (sigma value) +105 ml Hybrid level (-) +106 sfc Depth below land surface (m) +107 pt Isentropic (theta) level (K) +108 108 Level at specified pressure difference from ground to level (Pa) +109 pv Potential vorticity surface (K m2 kg-1 s-1) +110 110 Reserved +111 111 Eta level (-) +112 112 Reserved +113 113 Logarithmic hybrid level +114 114 Snow level (Numeric) +115 115 Sigma height level +# 116 Reserved +117 117 Mixed layer depth (m) +118 hhl Hybrid height level (-) +119 hpl Hybrid pressure level (-) +# 120-149 Reserved +150 150 Generalized vertical height coordinate +151 sol Soil level (Numeric) +# 152-159 Reserved +160 160 Depth below sea level (m) +161 161 Depth below water surface (m) +162 162 Lake or river bottom (-) +163 163 Bottom of sediment layer (-) +164 164 Bottom of thermally active sediment layer (-) +165 165 Bottom of sediment layer penetrated by thermal wave (-) +166 166 Mixing layer (-) +167 167 Bottom of root zone (-) +168 168 Ocean model level (Numeric) +169 169 Ocean level defined by water density (sigma-theta) difference from near-surface to level (kg m-3) +170 170 Ocean level defined by water potential temperature difference from near-surface to level (K) +# 171-173 Reserved +174 174 Top surface of ice on sea, lake or river +175 175 Top surface of ice, under snow cover, on sea, lake or river +176 176 Bottom surface (underside) ice on sea, lake or river +177 sfc Deep soil (of indefinite depth) +# 178 Reserved +179 179 Top surface of glacier ice and inland ice +180 180 Deep inland or glacier ice (of indefinite depth) +181 181 Grid tile land fraction as a model surface +182 182 Grid tile water fraction as a model surface +183 183 Grid tile ice fraction on sea, lake or river as a model surface +184 184 Grid tile glacier ice and inland ice fraction as a model surface +# 185-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.6.table b/definitions/grib2/tables/25/4.6.table new file mode 100644 index 000000000..b2dfeb498 --- /dev/null +++ b/definitions/grib2/tables/25/4.6.table @@ -0,0 +1,9 @@ +# Code table 4.6 - Type of ensemble forecast +0 0 Unperturbed high-resolution control forecast +1 1 Unperturbed low-resolution control forecast +2 2 Negatively perturbed forecast +3 3 Positively perturbed forecast +4 4 Multi-model forecast +# 5-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.7.table b/definitions/grib2/tables/25/4.7.table new file mode 100644 index 000000000..e0de0e1b2 --- /dev/null +++ b/definitions/grib2/tables/25/4.7.table @@ -0,0 +1,14 @@ +# Code table 4.7 - Derived forecast +0 0 Unweighted mean of all members +1 1 Weighted mean of all members +2 2 Standard deviation with respect to cluster mean +3 3 Standard deviation with respect to cluster mean, normalized +4 4 Spread of all members +5 5 Large anomaly index of all members +6 6 Unweighted mean of the cluster members +7 7 Interquartile range (range between the 25th and 75th quantile) +8 8 Minimum of all ensemble members +9 9 Maximum of all ensemble members +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.8.table b/definitions/grib2/tables/25/4.8.table new file mode 100644 index 000000000..ad883039c --- /dev/null +++ b/definitions/grib2/tables/25/4.8.table @@ -0,0 +1,6 @@ +# Code table 4.8 - Clustering method +0 0 Anomaly correlation +1 1 Root mean square +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.9.table b/definitions/grib2/tables/25/4.9.table new file mode 100644 index 000000000..9f74599c3 --- /dev/null +++ b/definitions/grib2/tables/25/4.9.table @@ -0,0 +1,13 @@ +# Code table 4.9 - Probability type +0 0 Probability of event below lower limit +1 1 Probability of event above upper limit +2 2 Probability of event between lower and upper limits (the range includes the lower limit but not the upper limit) +3 3 Probability of event above lower limit +4 4 Probability of event below upper limit +5 5 Probability of event equal to lower limit +6 6 Probability of event in above normal category +7 7 Probability of event in near normal category +8 8 Probability of event in below normal category +# 9-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.91.table b/definitions/grib2/tables/25/4.91.table new file mode 100644 index 000000000..44cf25f44 --- /dev/null +++ b/definitions/grib2/tables/25/4.91.table @@ -0,0 +1,16 @@ +# Code table 4.91 - Type of Interval +0 0 Smaller than first limit +1 1 Greater than second limit +2 2 Between first and second limit. The range includes the first limit but not the second limit +3 3 Greater than first limit +4 4 Smaller than second limit +5 5 Smaller or equal first limit +6 6 Greater or equal second limit +7 7 Between first and second. The range includes the first limit and the second limit +8 8 Greater or equal first limit +9 9 Smaller or equal second limit +10 10 Between first and second limit. The range includes the second limit but not the first limit +11 11 Equal to first limit +# 12-191 Reserved +# 192-254 Reserved for local use +255 missing Missing diff --git a/definitions/grib2/tables/25/5.0.table b/definitions/grib2/tables/25/5.0.table new file mode 100644 index 000000000..27a9fbc97 --- /dev/null +++ b/definitions/grib2/tables/25/5.0.table @@ -0,0 +1,27 @@ +# Code table 5.0 - Data representation template number +0 0 Grid point data - simple packing +1 1 Matrix value at grid point - simple packing +2 2 Grid point data - complex packing +3 3 Grid point data - complex packing and spatial differencing +4 4 Grid point data - IEEE floating point data +# 5-39 Reserved +40 40 Grid point data - JPEG 2000 code stream format +41 41 Grid point data - Portable Network Graphics (PNG) +42 42 Grid point and spectral data - CCSDS recommended lossless compression +# 43-49 Reserved +50 50 Spectral data - simple packing +51 51 Spherical harmonics data - complex packing +# 52 Reserved +53 53 Spectral data for limited area models - complex packing +# 54-60 Reserved +61 61 Grid point data - simple packing with logarithm pre-processing +# 62-199 Reserved +200 200 Run length packing with level values +# 201-49151 Reserved +# 49152-65534 Reserved for local use +40000 40000 JPEG2000 Packing +40010 40010 PNG pacling +50000 50000 Sperical harmonics ieee packing +50001 50001 Second order packing +50002 50002 Second order packing +65535 65535 Missing diff --git a/definitions/grib2/tables/25/5.1.table b/definitions/grib2/tables/25/5.1.table new file mode 100644 index 000000000..854330c74 --- /dev/null +++ b/definitions/grib2/tables/25/5.1.table @@ -0,0 +1,6 @@ +# Code table 5.1 - Type of original field values +0 0 Floating point +1 1 Integer +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/5.2.table b/definitions/grib2/tables/25/5.2.table new file mode 100644 index 000000000..40586a131 --- /dev/null +++ b/definitions/grib2/tables/25/5.2.table @@ -0,0 +1,8 @@ +# Code table 5.2 - Matrix coordinate value function definition +0 0 Explicit coordinate values set +1 1 Linear coordinates f(1) = C1, f(n) = f(n-1) + C2 +# 2-10 Reserved +11 11 Geometric coordinates f(1)=C1, f(n)=C2*f(n-1) +# 12-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/5.25.table b/definitions/grib2/tables/25/5.25.table new file mode 100644 index 000000000..1b45f28a3 --- /dev/null +++ b/definitions/grib2/tables/25/5.25.table @@ -0,0 +1,9 @@ +# Code table 5.25 - type of bi-Fourier subtruncation +# 0-76 Reserved +77 77 Rectangular +# 78-87 Reserved +88 88 Elliptic +# 89-98 Reserved +99 99 Diamond +# 100-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/25/5.26.table b/definitions/grib2/tables/25/5.26.table new file mode 100644 index 000000000..9e91ebf2e --- /dev/null +++ b/definitions/grib2/tables/25/5.26.table @@ -0,0 +1,5 @@ +# Code table 5.26 - packing mode for axes +0 0 Spectral coefficients for axes are packed +1 1 Spectral coefficients for axes included in the unpacked subset +# 2-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/25/5.3.table b/definitions/grib2/tables/25/5.3.table new file mode 100644 index 000000000..c3b7b30fe --- /dev/null +++ b/definitions/grib2/tables/25/5.3.table @@ -0,0 +1,7 @@ +# Code table 5.3 - Matrix coordinate parameter +1 1 Direction degrees true +2 2 Frequency (s-1) +3 3 Radial number (2pi/lambda) (m-1) +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/5.4.table b/definitions/grib2/tables/25/5.4.table new file mode 100644 index 000000000..8121c1819 --- /dev/null +++ b/definitions/grib2/tables/25/5.4.table @@ -0,0 +1,6 @@ +# Code table 5.4 - Group splitting method +0 0 Row by row splitting +1 1 General group splitting +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/5.40.table b/definitions/grib2/tables/25/5.40.table new file mode 100644 index 000000000..b9bad2c39 --- /dev/null +++ b/definitions/grib2/tables/25/5.40.table @@ -0,0 +1,5 @@ +# Code table 5.40 - Type of compression +0 0 Lossless +1 1 Lossy +# 2-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/25/5.40000.table b/definitions/grib2/tables/25/5.40000.table new file mode 100644 index 000000000..1eef7c763 --- /dev/null +++ b/definitions/grib2/tables/25/5.40000.table @@ -0,0 +1,5 @@ +# Code Table 5.40: Type of Compression +0 0 Lossless +1 1 Lossy +#2-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/25/5.5.table b/definitions/grib2/tables/25/5.5.table new file mode 100644 index 000000000..3ef3eb070 --- /dev/null +++ b/definitions/grib2/tables/25/5.5.table @@ -0,0 +1,7 @@ +# Code table 5.5 - Missing value management for complex packing +0 0 No explicit missing values included within data values +1 1 Primary missing values included within data values +2 2 Primary and secondary missing values included within data values +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/5.50002.table b/definitions/grib2/tables/25/5.50002.table new file mode 100644 index 000000000..10c243cb0 --- /dev/null +++ b/definitions/grib2/tables/25/5.50002.table @@ -0,0 +1,19 @@ +# second order packing modes table + +1 0 no boustrophedonic +1 1 boustrophedonic +2 0 Reserved +2 1 Reserved +3 0 Reserved +3 1 Reserved +4 0 Reserved +4 1 Reserved +5 0 Reserved +5 1 Reserved +6 0 Reserved +6 1 Reserved +7 0 Reserved +7 1 Reserved +8 0 Reserved +8 1 Reserved + diff --git a/definitions/grib2/tables/25/5.6.table b/definitions/grib2/tables/25/5.6.table new file mode 100644 index 000000000..6d5177877 --- /dev/null +++ b/definitions/grib2/tables/25/5.6.table @@ -0,0 +1,7 @@ +# Code table 5.6 - Order of spatial differencing +0 0 Reserved +1 1 First-order spatial differencing +2 2 Second-order spatial differencing +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/5.7.table b/definitions/grib2/tables/25/5.7.table new file mode 100644 index 000000000..5ab780056 --- /dev/null +++ b/definitions/grib2/tables/25/5.7.table @@ -0,0 +1,7 @@ +# Code table 5.7 - Precision of floating-point numbers +0 0 Reserved +1 1 IEEE 32-bit (I=4 in section 7) +2 2 IEEE 64-bit (I=8 in section 7) +3 3 IEEE 128-bit (I=16 in section 7) +# 4-254 Reserved +255 255 Missing diff --git a/definitions/grib2/tables/25/6.0.table b/definitions/grib2/tables/25/6.0.table new file mode 100644 index 000000000..2a29aa285 --- /dev/null +++ b/definitions/grib2/tables/25/6.0.table @@ -0,0 +1,6 @@ +# Code table 6.0 - Bit map indicator +0 0 A bit map applies to this product and is specified in this Section +1 1 A bit map pre-determined by the originating/generating centre applies to this product and is not specified in this Section +# 1-253 A bit map predetermined by the originating/generating centre applies to this product and is not specified in this Section +254 254 A bit map defined previously in the same GRIB message applies to this product +255 255 A bit map does not apply to this product diff --git a/definitions/grib2/tables/25/stepType.table b/definitions/grib2/tables/25/stepType.table new file mode 100644 index 000000000..4ec73e7a1 --- /dev/null +++ b/definitions/grib2/tables/25/stepType.table @@ -0,0 +1,2 @@ +0 instant Instant +1 interval Interval diff --git a/definitions/grib2/units.def b/definitions/grib2/units.def index 9c40e8d67..9b975528e 100644 --- a/definitions/grib2/units.def +++ b/definitions/grib2/units.def @@ -1409,6 +1409,18 @@ parameterCategory = 1 ; parameterNumber = 23 ; } +#Universal thermal climate index +'K' = { + discipline = 20 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + } +#Mean radiant temperature +'K' = { + discipline = 20 ; + parameterCategory = 0 ; + parameterNumber = 1 ; + } #Virtual temperature 'K' = { discipline = 0 ; diff --git a/definitions/param_limits.def b/definitions/param_limits.def index 24616f996..cd1c0b127 100644 --- a/definitions/param_limits.def +++ b/definitions/param_limits.def @@ -1,9 +1,198 @@ -constant default_min_val = -1e9 : long_type, hidden; -constant default_max_val = +1e9 : long_type, hidden; +constant default_min_val = -1e9 : double_type, hidden; +constant default_max_val = +1e9 : double_type, hidden; concept param_value_min(default_min_val) { - 0 = { paramId=167; } -} : long_type, hidden; + -150 = { pid=165; } + -100 = { pid=166; } + 0 = { pid=260260; } + 0 = { pid=228028; } + 0 = { pid=49; } + 0 = { pid=207; } + 25 = { pid=168; } + 0 = { pid=260242; } + 160 = { pid=167; } + -0.1 = { pid=260428; } + -0.1 = { pid=260423; } + -1e+09 = { pid=260427; } + 0 = { pid=260509; } + 5 = { pid=151175; } + 0 = { pid=260257; } + 0 = { pid=59; } + -60000 = { pid=228001; } + -0.05 = { pid=228143; } + 0 = { pid=151163; } + -3.5 = { pid=151131; } + -100000 = { pid=180; } + -10 = { pid=260259; } + -13000 = { pid=129; } + -1300 = { pid=156; } + 0 = { pid=3075; } + 0 = { pid=172; } + -0.05 = { pid=3062; } + 0 = { pid=260210; } + 0 = { pid=3073; } + 160 = { pid=121; } + 85000 = { pid=151; } + 270 = { pid=151126; } + -1 = { pid=140230; } + 0 = { pid=140221; } + 0 = { pid=3074; } + 150 = { pid=122; } + 0 = { pid=140214; } + -3.5 = { pid=151132; } + -100000 = { pid=181; } + 0 = { pid=151225; } + -1300 = { pid=228002; } + 0 = { pid=140231; } + 0 = { pid=260430; } + 170 = { pid=3; } + -1 = { pid=60; } + 100 = { pid=54; } + 0 = { pid=157; } + -4 = { pid=151145; } + 0 = { pid=151219; } + 160 = { pid=34; } + 0 = { pid=31; } + 0 = { pid=174098; } + 0 = { pid=140229; } + 120 = { pid=235; } + 20 = { pid=228032; } + 10 = { pid=33; } + 0 = { pid=3066; } + -1e-10 = { pid=228141; } + -1 = { pid=228144; } + 0.005 = { pid=260367; } + -1000 = { pid=260364; } + 0 = { pid=228039; } + 0 = { pid=228087; } + -20 = { pid=228086; } + 170 = { pid=260360; } + 170 = { pid=228139; } + 170 = { pid=228096; } + 170 = { pid=228095; } + 0 = { pid=43; } + 0 = { pid=247; } + 0 = { pid=246; } + -0.1 = { pid=133; } + 0 = { pid=189; } + -1e+08 = { pid=147; } + -1e+07 = { pid=176; } + -1e+08 = { pid=177; } + 43000 = { pid=134; } + 0 = { pid=173; } + -0.001 = { pid=174008; } + -1e+08 = { pid=146; } + -10 = { pid=169; } + 140 = { pid=130; } + -0.1 = { pid=260264; } + -1e+08 = { pid=179; } + -1e-06 = { pid=228164; } + -3 = { pid=260057; } + -50 = { pid=136; } + -0.05 = { pid=228228; } + -250 = { pid=131; } + -250 = { pid=132; } + -30 = { pid=135; } + 0 = { pid=260199; } + -0.001 = { pid=228205; } + 0 = { pid=3031; } + 0 = { pid=10; } +} : double_type, hidden; + concept param_value_max(default_max_val) { - 373 = { paramId=167; } -} : long_type, hidden; + 150 = { pid=165; } + 100 = { pid=166; } + 360.1 = { pid=260260; } + 140 = { pid=228028; } + 100 = { pid=49; } + 300 = { pid=207; } + 350 = { pid=168; } + 160 = { pid=260242; } + 370 = { pid=167; } + 1e+09 = { pid=260428; } + 1e+09 = { pid=260423; } + 0.1 = { pid=260427; } + 100 = { pid=260509; } + 50 = { pid=151175; } + 100 = { pid=260257; } + 40000 = { pid=59; } + 5 = { pid=228001; } + 130 = { pid=228143; } + 1500 = { pid=151163; } + 3.5 = { pid=151131; } + 100000 = { pid=180; } + 5 = { pid=260259; } + 350000 = { pid=129; } + 35000 = { pid=156; } + 100 = { pid=3075; } + 1 = { pid=172; } + 130 = { pid=3062; } + 1 = { pid=260210; } + 100 = { pid=3073; } + 380 = { pid=121; } + 125000 = { pid=151; } + 308 = { pid=151126; } + 360.5 = { pid=140230; } + 35 = { pid=140221; } + 100 = { pid=3074; } + 330 = { pid=122; } + 35 = { pid=140214; } + 3.5 = { pid=151132; } + 100000 = { pid=181; } + 4000 = { pid=151225; } + 8888 = { pid=228002; } + 50 = { pid=140231; } + 30 = { pid=260430; } + 1200 = { pid=3; } + 1 = { pid=60; } + 108000 = { pid=54; } + 180 = { pid=157; } + 4 = { pid=151145; } + 50 = { pid=151219; } + 320 = { pid=34; } + 1.001 = { pid=31; } + 15 = { pid=174098; } + 35 = { pid=140229; } + 380 = { pid=235; } + 100 = { pid=228032; } + 1000 = { pid=33; } + 5 = { pid=3066; } + 15000 = { pid=228141; } + 50 = { pid=228144; } + 100 = { pid=260367; } + 1000 = { pid=260364; } + 2000 = { pid=228039; } + 2000 = { pid=228087; } + 2000 = { pid=228086; } + 350 = { pid=260360; } + 350 = { pid=228139; } + 350 = { pid=228096; } + 350 = { pid=228095; } + 10 = { pid=43; } + 0.01 = { pid=247; } + 1e+06 = { pid=246; } + 0.1 = { pid=133; } + 3600 = { pid=189; } + 1e+08 = { pid=147; } + 1e+07 = { pid=176; } + 1e+06 = { pid=177; } + 115000 = { pid=134; } + 10 = { pid=173; } + 100 = { pid=174008; } + 1e+08 = { pid=146; } + 1e+09 = { pid=169; } + 400 = { pid=130; } + 1e+09 = { pid=260264; } + -1000 = { pid=179; } + 101 = { pid=228164; } + 150 = { pid=260057; } + 220 = { pid=136; } + 130 = { pid=228228; } + 250 = { pid=131; } + 250 = { pid=132; } + 30 = { pid=135; } + 1 = { pid=260199; } + 30 = { pid=228205; } + 360.1 = { pid=3031; } + 300 = { pid=10; } +} : double_type, hidden; diff --git a/src/grib_accessor_class_concept.c b/src/grib_accessor_class_concept.c index ee9d52a7c..09a9f5d3f 100644 --- a/src/grib_accessor_class_concept.c +++ b/src/grib_accessor_class_concept.c @@ -434,10 +434,25 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) * if (referenceValue > 0 && paramId == 129) */ /*return GRIB_NOT_IMPLEMENTED*/ - long lval = 0; - int ret = unpack_long(a, &lval, len); - if (ret == GRIB_SUCCESS) { - *val = lval; + int ret = 0; + if (a->flags & GRIB_ACCESSOR_FLAG_LONG_TYPE) { + long lval = 0; + int ret = unpack_long(a, &lval, len); + if (ret == GRIB_SUCCESS) { + *val = lval; + } + } else if (a->flags & GRIB_ACCESSOR_FLAG_DOUBLE_TYPE) { + const char* p = concept_evaluate(a); + + if (!p) { + grib_handle* h = grib_handle_of_accessor(a); + if (a->creator->defaultkey) + return grib_get_double_internal(h, a->creator->defaultkey, val); + + return GRIB_NOT_FOUND; + } + *val = atof(p); + *len = 1; } return ret; } diff --git a/src/grib_util.c b/src/grib_util.c index f0e9efa11..02782ab2f 100644 --- a/src/grib_util.c +++ b/src/grib_util.c @@ -2180,7 +2180,7 @@ int grib_is_earth_oblate(grib_handle* h) int grib_util_grib_data_quality_check(grib_handle* h, double min_val, double max_val) { int err = 0; - long min_field_value_allowed = 0, max_field_value_allowed = 0; + double min_field_value_allowed = 0, max_field_value_allowed = 0; long paramId = 0; double dmin_allowed = 0, dmax_allowed = 0; grib_context* ctx = h->context; @@ -2193,19 +2193,19 @@ int grib_util_grib_data_quality_check(grib_handle* h, double min_val, double max is_error = (ctx->grib_data_quality_checks == 1); /* The limit keys must exist if we are here */ - err = grib_get_long(h, "param_value_min", &min_field_value_allowed); + err = grib_get_double(h, "param_value_min", &min_field_value_allowed); if (err) { grib_context_log(ctx, GRIB_LOG_ERROR, "grib_data_quality_check: Could not get param_value_min"); return err; } - err = grib_get_long(h, "param_value_max", &max_field_value_allowed); + err = grib_get_double(h, "param_value_max", &max_field_value_allowed); if (err) { grib_context_log(ctx, GRIB_LOG_ERROR, "grib_data_quality_check: Could not get param_value_max"); return err; } - dmin_allowed = (double)min_field_value_allowed; - dmax_allowed = (double)max_field_value_allowed; + dmin_allowed = min_field_value_allowed; + dmax_allowed = max_field_value_allowed; if (min_val < dmin_allowed) { char description[1024] = {0,}; diff --git a/tests/grib_data_quality_checks.sh b/tests/grib_data_quality_checks.sh index 65a08ce79..f90de6f93 100755 --- a/tests/grib_data_quality_checks.sh +++ b/tests/grib_data_quality_checks.sh @@ -17,6 +17,11 @@ label="grib_data_quality" tempOut=temp.1.${label}.out temp2=temp.2.${label}.out tempErr=temp.${label}.err +tempGrib1=temp.${label}.grib1 +tempGrib2=temp.${label}.grib2 + +sample_g1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl +sample_g2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl # Start with clean environment unset ECCODES_GRIB_DATA_QUALITY_CHECKS @@ -28,11 +33,13 @@ input2=${data_dir}/reduced_gaussian_surface.grib2 grib_check_key_equals $input1 paramId 167 grib_check_key_equals $input2 paramId 167 -# Data quality checks disabled. Create huge values for temperature +echo "Data quality checks disabled. Create huge values for temperature..." +# -------------------------------------------------------------------------- ${tools_dir}/grib_set -s scaleValuesBy=100 $input1 $tempOut ${tools_dir}/grib_set -s scaleValuesBy=100 $input2 $tempOut -# Data quality checks enabled. Repacking should fail +echo "Data quality checks enabled. Repacking should fail..." +# ----------------------------------------------------------- export ECCODES_GRIB_DATA_QUALITY_CHECKS=1 set +e ${tools_dir}/grib_copy -r $tempOut /dev/null 2>$tempErr @@ -41,14 +48,15 @@ set -e [ $status -ne 0 ] grep -q 'more than the allowable limit' $tempErr - -# Data quality checks enabled but only as a warning. Repacking should pass +echo "Data quality checks enabled but only as a warning. Repacking should pass..." +# -------------------------------------------------------------------------------- export ECCODES_GRIB_DATA_QUALITY_CHECKS=2 ${tools_dir}/grib_copy -r $tempOut /dev/null 2>$tempErr grep -q 'more than the allowable limit' $tempErr -# Data quality checks enabled. Scaling should fail +echo "Data quality checks enabled. Scaling should fail..." +# -------------------------------------------------------- export ECCODES_GRIB_DATA_QUALITY_CHECKS=1 set +e ${tools_dir}/grib_set -s scaleValuesBy=100 $input1 $tempOut 2>$tempErr @@ -67,8 +75,50 @@ grep -q 'GRIB2 simple packing: unable to set values' $tempErr grep -q 'allowable limit' $tempErr -# Override the defaults -# ---------------------- +echo "Test limits which are doubles..." +# ------------------------------------- +pid=151131 # has limits -3.5 and +3.5 +${tools_dir}/grib_set -s paramId=$pid $input1 $tempGrib1 +${tools_dir}/grib_set -s paramId=$pid $input2 $tempGrib2 +minval1=`${tools_dir}/grib_get -p param_value_min $tempGrib1` +maxval1=`${tools_dir}/grib_get -p param_value_max $tempGrib1` +minval2=`${tools_dir}/grib_get -p param_value_min $tempGrib2` +maxval2=`${tools_dir}/grib_get -p param_value_max $tempGrib2` +[ "$minval1" = "-3.5" ] +[ "$maxval1" = "3.5" ] +[ "$minval2" = "-3.5" ] +[ "$maxval2" = "3.5" ] + +set +e +${tools_dir}/grib_set -s scaleValuesBy=1.1 $tempGrib1 $tempOut 2>$tempErr +stat1=$? +${tools_dir}/grib_set -s scaleValuesBy=1.1 $tempGrib2 $tempOut 2>$tempErr +stat2=$? +set -e +[ $stat1 -ne 0 ] +[ $stat2 -ne 0 ] + + +echo "Test close to the limit..." +# --------------------------------- +${tools_dir}/grib_set -s paramId=$pid $sample_g2 $tempGrib2 +${tools_dir}/grib_set -s scaleValuesBy=3 $tempGrib2 $tempOut # OK +set +e +${tools_dir}/grib_set -s scaleValuesBy=3.6 $tempGrib2 $tempOut +set -e +[ $status -ne 0 ] + +${tools_dir}/grib_set -s edition=1 $tempGrib2 $tempGrib1 +${tools_dir}/grib_set -s scaleValuesBy=-3 $tempGrib1 $tempOut # OK +set +e +${tools_dir}/grib_set -s scaleValuesBy=-3.55 $tempGrib1 $tempOut +set -e +[ $status -ne 0 ] + + + +echo "Override the defaults..." +# ------------------------------ tempDir=tempdir.$label rm -rf $tempDir mkdir -p $tempDir From 73174e19398b0fa0bf9431ba39a97a95c9a1eba0 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 28 Jan 2020 14:40:09 +0000 Subject: [PATCH 52/82] Latest updates from develop (8) --- CMakeLists.txt | 2 +- NOTICE | 2 +- README.md | 2 +- definitions/boot.def | 2 +- definitions/budg/boot.def | 2 +- definitions/budg/mars_labeling.def | 2 +- definitions/budg/section.1.def | 2 +- definitions/budg/section.4.def | 2 +- definitions/bufr/boot.def | 2 +- definitions/bufr/boot_edition_0.def | 2 +- definitions/bufr/boot_edition_1.def | 2 +- definitions/bufr/boot_edition_2.def | 2 +- definitions/bufr/boot_edition_3.def | 2 +- definitions/bufr/boot_edition_4.def | 2 +- definitions/bufr/old_section.1.def | 2 +- definitions/bufr/section.0.def | 2 +- definitions/bufr/section.1.1.def | 2 +- definitions/bufr/section.1.2.def | 2 +- definitions/bufr/section.1.3.def | 2 +- definitions/bufr/section.1.4.def | 2 +- definitions/bufr/section.2.def | 2 +- definitions/bufr/section.3.def | 2 +- definitions/bufr/section.4.def | 2 +- definitions/bufr/section.5.def | 2 +- definitions/check_grib_defs.pl | 2 +- definitions/common/statistics_grid.def | 2 +- definitions/common/statistics_spectral.def | 2 +- definitions/diag/boot.def | 2 +- definitions/diag/section.1.def | 2 +- definitions/diag/section.4.def | 2 +- definitions/grib1/boot.def | 2 +- definitions/grib1/data.grid_ieee.def | 2 +- definitions/grib1/data.grid_second_order.def | 2 +- definitions/grib1/data.grid_second_order_constant_width.def | 2 +- definitions/grib1/data.grid_second_order_general_grib1.def | 2 +- definitions/grib1/data.grid_second_order_row_by_row.def | 2 +- definitions/grib1/data.grid_simple.def | 2 +- definitions/grib1/data.grid_simple_matrix.def | 2 +- definitions/grib1/data.spectral_complex.def | 2 +- definitions/grib1/data.spectral_ieee.def | 2 +- definitions/grib1/data.spectral_simple.def | 2 +- definitions/grib1/gds_not_present_bitmap.def | 2 +- definitions/grib1/grid_21.def | 2 +- definitions/grib1/grid_22.def | 2 +- definitions/grib1/grid_23.def | 2 +- definitions/grib1/grid_24.def | 2 +- definitions/grib1/grid_25.def | 2 +- definitions/grib1/grid_26.def | 2 +- definitions/grib1/grid_61.def | 2 +- definitions/grib1/grid_62.def | 2 +- definitions/grib1/grid_63.def | 2 +- definitions/grib1/grid_64.def | 2 +- definitions/grib1/grid_definition_0.def | 2 +- definitions/grib1/grid_definition_1.def | 2 +- definitions/grib1/grid_definition_10.def | 2 +- definitions/grib1/grid_definition_13.def | 2 +- definitions/grib1/grid_definition_14.def | 2 +- definitions/grib1/grid_definition_192.78.def | 2 +- definitions/grib1/grid_definition_192.98.def | 2 +- definitions/grib1/grid_definition_193.98.def | 2 +- definitions/grib1/grid_definition_20.def | 2 +- definitions/grib1/grid_definition_24.def | 2 +- definitions/grib1/grid_definition_3.def | 2 +- definitions/grib1/grid_definition_30.def | 2 +- definitions/grib1/grid_definition_34.def | 2 +- definitions/grib1/grid_definition_4.def | 2 +- definitions/grib1/grid_definition_50.def | 2 +- definitions/grib1/grid_definition_60.def | 2 +- definitions/grib1/grid_definition_70.def | 2 +- definitions/grib1/grid_definition_8.def | 2 +- definitions/grib1/grid_definition_80.def | 2 +- definitions/grib1/grid_first_last_resandcomp.def | 2 +- definitions/grib1/grid_rotation.def | 2 +- definitions/grib1/grid_stretching.def | 2 +- definitions/grib1/local.1.def | 2 +- definitions/grib1/local.214.1.def | 2 +- definitions/grib1/local.214.244.def | 2 +- definitions/grib1/local.214.245.def | 2 +- definitions/grib1/local.253.def | 2 +- definitions/grib1/local.254.def | 2 +- definitions/grib1/local.46.def | 2 +- definitions/grib1/local.54.def | 2 +- definitions/grib1/local.7.1.def | 2 +- definitions/grib1/local.80.def | 2 +- definitions/grib1/local.98.1.def | 2 +- definitions/grib1/local.98.10.def | 2 +- definitions/grib1/local.98.11.def | 2 +- definitions/grib1/local.98.12.def | 2 +- definitions/grib1/local.98.13.def | 2 +- definitions/grib1/local.98.14.def | 2 +- definitions/grib1/local.98.15.def | 2 +- definitions/grib1/local.98.16.def | 2 +- definitions/grib1/local.98.17.def | 2 +- definitions/grib1/local.98.18.def | 2 +- definitions/grib1/local.98.19.def | 2 +- definitions/grib1/local.98.190.def | 2 +- definitions/grib1/local.98.191.def | 2 +- definitions/grib1/local.98.192.def | 2 +- definitions/grib1/local.98.2.def | 2 +- definitions/grib1/local.98.20.def | 2 +- definitions/grib1/local.98.21.def | 2 +- definitions/grib1/local.98.218.def | 2 +- definitions/grib1/local.98.23.def | 2 +- definitions/grib1/local.98.24.def | 2 +- definitions/grib1/local.98.25.def | 2 +- definitions/grib1/local.98.26.def | 2 +- definitions/grib1/local.98.27.def | 2 +- definitions/grib1/local.98.28.def | 2 +- definitions/grib1/local.98.29.def | 2 +- definitions/grib1/local.98.3.def | 2 +- definitions/grib1/local.98.30.def | 2 +- definitions/grib1/local.98.31.def | 2 +- definitions/grib1/local.98.32.def | 2 +- definitions/grib1/local.98.33.def | 2 +- definitions/grib1/local.98.35.def | 2 +- definitions/grib1/local.98.36.def | 2 +- definitions/grib1/local.98.37.def | 2 +- definitions/grib1/local.98.38.def | 2 +- definitions/grib1/local.98.39.def | 2 +- definitions/grib1/local.98.4.def | 2 +- definitions/grib1/local.98.40.def | 2 +- definitions/grib1/local.98.49.def | 2 +- definitions/grib1/local.98.5.def | 2 +- definitions/grib1/local.98.50.def | 2 +- definitions/grib1/local.98.6.def | 2 +- definitions/grib1/local.98.7.def | 2 +- definitions/grib1/local.98.8.def | 2 +- definitions/grib1/local.98.9.def | 2 +- definitions/grib1/local.98.def | 2 +- definitions/grib1/mars_labeling.23.def | 2 +- definitions/grib1/section.0.def | 2 +- definitions/grib1/section.5.def | 2 +- definitions/grib2/boot.def | 2 +- definitions/grib2/boot_multifield.def | 2 +- definitions/grib2/local.98.41.def | 2 +- definitions/grib2/local.98.42.def | 2 +- definitions/grib2/local.98.5.def | 2 +- definitions/grib2/local.98.7.def | 2 +- definitions/grib2/local.98.9.def | 2 +- definitions/grib2/mars_labeling.def | 2 +- definitions/grib2/meta.def | 2 +- definitions/grib2/parameters.def | 2 +- definitions/grib2/products_0.def | 2 +- definitions/grib2/products_1.def | 2 +- definitions/grib2/products_10.def | 2 +- definitions/grib2/products_11.def | 2 +- definitions/grib2/products_2.def | 2 +- definitions/grib2/products_3.def | 2 +- definitions/grib2/products_4.def | 2 +- definitions/grib2/products_5.def | 2 +- definitions/grib2/products_6.def | 2 +- definitions/grib2/products_7.def | 2 +- definitions/grib2/products_8.def | 2 +- definitions/grib2/products_9.def | 2 +- definitions/grib2/products_crra.def | 2 +- definitions/grib2/products_s2s.def | 2 +- definitions/grib2/products_tigge.def | 2 +- definitions/grib2/products_uerra.def | 2 +- definitions/grib2/rules.def | 2 +- definitions/grib2/section.0.def | 2 +- definitions/grib2/section.1.def | 2 +- definitions/grib2/section.2.def | 2 +- definitions/grib2/section.3.def | 2 +- definitions/grib2/section.4.def | 2 +- definitions/grib2/section.5.def | 2 +- definitions/grib2/section.6.def | 2 +- definitions/grib2/section.7.def | 2 +- definitions/grib2/section.8.def | 2 +- definitions/grib2/sections.def | 2 +- definitions/grib2/template.1.0.def | 2 +- definitions/grib2/template.1.1.def | 2 +- definitions/grib2/template.1.2.def | 2 +- definitions/grib2/template.1.calendar.def | 2 +- definitions/grib2/template.1.offset.def | 2 +- definitions/grib2/template.3.0.def | 2 +- definitions/grib2/template.3.1.def | 2 +- definitions/grib2/template.3.10.def | 2 +- definitions/grib2/template.3.100.def | 2 +- definitions/grib2/template.3.1000.def | 2 +- definitions/grib2/template.3.101.def | 2 +- definitions/grib2/template.3.110.def | 2 +- definitions/grib2/template.3.1100.def | 2 +- definitions/grib2/template.3.12.def | 2 +- definitions/grib2/template.3.120.def | 2 +- definitions/grib2/template.3.1200.def | 2 +- definitions/grib2/template.3.13.def | 2 +- definitions/grib2/template.3.130.def | 2 +- definitions/grib2/template.3.140.def | 2 +- definitions/grib2/template.3.2.def | 2 +- definitions/grib2/template.3.20.def | 2 +- definitions/grib2/template.3.23.def | 2 +- definitions/grib2/template.3.3.def | 2 +- definitions/grib2/template.3.30.def | 2 +- definitions/grib2/template.3.31.def | 2 +- definitions/grib2/template.3.33.def | 2 +- definitions/grib2/template.3.4.def | 2 +- definitions/grib2/template.3.40.def | 2 +- definitions/grib2/template.3.41.def | 2 +- definitions/grib2/template.3.42.def | 2 +- definitions/grib2/template.3.43.def | 2 +- definitions/grib2/template.3.5.def | 2 +- definitions/grib2/template.3.50.def | 2 +- definitions/grib2/template.3.51.def | 2 +- definitions/grib2/template.3.52.def | 2 +- definitions/grib2/template.3.53.def | 2 +- definitions/grib2/template.3.61.def | 2 +- definitions/grib2/template.3.62.def | 2 +- definitions/grib2/template.3.63.def | 2 +- definitions/grib2/template.3.90.def | 2 +- definitions/grib2/template.3.gaussian.def | 2 +- definitions/grib2/template.3.grid.def | 2 +- definitions/grib2/template.3.latlon.def | 2 +- definitions/grib2/template.3.latlon_vares.def | 2 +- definitions/grib2/template.3.resolution_flags.def | 2 +- definitions/grib2/template.3.rotation.def | 2 +- definitions/grib2/template.3.scanning_mode.def | 2 +- definitions/grib2/template.3.shape_of_the_earth.def | 2 +- definitions/grib2/template.3.spherical_harmonics.def | 2 +- definitions/grib2/template.3.stretching.def | 2 +- definitions/grib2/template.4.0.def | 2 +- definitions/grib2/template.4.1.def | 2 +- definitions/grib2/template.4.10.def | 2 +- definitions/grib2/template.4.1000.def | 2 +- definitions/grib2/template.4.1001.def | 2 +- definitions/grib2/template.4.1002.def | 2 +- definitions/grib2/template.4.11.def | 2 +- definitions/grib2/template.4.1100.def | 2 +- definitions/grib2/template.4.1101.def | 2 +- definitions/grib2/template.4.12.def | 2 +- definitions/grib2/template.4.13.def | 2 +- definitions/grib2/template.4.14.def | 2 +- definitions/grib2/template.4.15.def | 2 +- definitions/grib2/template.4.2.def | 2 +- definitions/grib2/template.4.20.def | 2 +- definitions/grib2/template.4.2000.def | 2 +- definitions/grib2/template.4.254.def | 2 +- definitions/grib2/template.4.3.def | 2 +- definitions/grib2/template.4.30.def | 2 +- definitions/grib2/template.4.31.def | 2 +- definitions/grib2/template.4.311.def | 2 +- definitions/grib2/template.4.32.def | 2 +- definitions/grib2/template.4.33.def | 2 +- definitions/grib2/template.4.34.def | 2 +- definitions/grib2/template.4.35.def | 2 +- definitions/grib2/template.4.4.def | 2 +- definitions/grib2/template.4.40.def | 2 +- definitions/grib2/template.4.40033.def | 2 +- definitions/grib2/template.4.40034.def | 2 +- definitions/grib2/template.4.41.def | 2 +- definitions/grib2/template.4.42.def | 2 +- definitions/grib2/template.4.43.def | 2 +- definitions/grib2/template.4.44.def | 2 +- definitions/grib2/template.4.45.def | 2 +- definitions/grib2/template.4.46.def | 2 +- definitions/grib2/template.4.47.def | 2 +- definitions/grib2/template.4.48.def | 2 +- definitions/grib2/template.4.49.def | 2 +- definitions/grib2/template.4.5.def | 2 +- definitions/grib2/template.4.51.def | 2 +- definitions/grib2/template.4.53.def | 2 +- definitions/grib2/template.4.54.def | 2 +- definitions/grib2/template.4.55.def | 2 +- definitions/grib2/template.4.57.def | 2 +- definitions/grib2/template.4.58.def | 2 +- definitions/grib2/template.4.59.def | 2 +- definitions/grib2/template.4.6.def | 2 +- definitions/grib2/template.4.60.def | 2 +- definitions/grib2/template.4.61.def | 2 +- definitions/grib2/template.4.67.def | 2 +- definitions/grib2/template.4.68.def | 2 +- definitions/grib2/template.4.70.def | 2 +- definitions/grib2/template.4.71.def | 2 +- definitions/grib2/template.4.72.def | 2 +- definitions/grib2/template.4.73.def | 2 +- definitions/grib2/template.4.76.def | 2 +- definitions/grib2/template.4.77.def | 2 +- definitions/grib2/template.4.78.def | 2 +- definitions/grib2/template.4.79.def | 2 +- definitions/grib2/template.4.8.def | 2 +- definitions/grib2/template.4.80.def | 2 +- definitions/grib2/template.4.81.def | 2 +- definitions/grib2/template.4.82.def | 2 +- definitions/grib2/template.4.83.def | 2 +- definitions/grib2/template.4.9.def | 2 +- definitions/grib2/template.4.91.def | 2 +- definitions/grib2/template.4.categorical.def | 2 +- definitions/grib2/template.4.circular_cluster.def | 2 +- definitions/grib2/template.4.derived.def | 2 +- definitions/grib2/template.4.eps.def | 2 +- definitions/grib2/template.4.horizontal.def | 2 +- definitions/grib2/template.4.parameter.def | 2 +- definitions/grib2/template.4.parameter_aerosol.def | 2 +- definitions/grib2/template.4.parameter_aerosol_44.def | 2 +- definitions/grib2/template.4.parameter_aerosol_optical.def | 2 +- .../grib2/template.4.parameter_aerosol_optical_source.def | 2 +- definitions/grib2/template.4.parameter_aerosol_source.def | 2 +- definitions/grib2/template.4.parameter_chemical.def | 2 +- .../grib2/template.4.parameter_chemical_distribution.def | 2 +- definitions/grib2/template.4.parameter_chemical_source.def | 2 +- definitions/grib2/template.4.parameter_partition.def | 2 +- definitions/grib2/template.4.parameter_postproc.def | 2 +- definitions/grib2/template.4.parameter_tile.def | 2 +- definitions/grib2/template.4.percentile.def | 2 +- definitions/grib2/template.4.point_in_time.def | 2 +- definitions/grib2/template.4.probability.def | 2 +- definitions/grib2/template.4.rectangular_cluster.def | 2 +- definitions/grib2/template.4.statistical.def | 2 +- definitions/grib2/template.5.0.def | 2 +- definitions/grib2/template.5.1.def | 2 +- definitions/grib2/template.5.2.def | 2 +- definitions/grib2/template.5.3.def | 2 +- definitions/grib2/template.5.4.def | 2 +- definitions/grib2/template.5.40.def | 2 +- definitions/grib2/template.5.40000.def | 2 +- definitions/grib2/template.5.40010.def | 2 +- definitions/grib2/template.5.41.def | 2 +- definitions/grib2/template.5.42.def | 2 +- definitions/grib2/template.5.50.def | 2 +- definitions/grib2/template.5.50000.def | 2 +- definitions/grib2/template.5.50001.def | 2 +- definitions/grib2/template.5.50002.def | 2 +- definitions/grib2/template.5.51.def | 2 +- definitions/grib2/template.5.53.def | 2 +- definitions/grib2/template.5.6.def | 2 +- definitions/grib2/template.5.61.def | 2 +- definitions/grib2/template.5.original_values.def | 2 +- definitions/grib2/template.5.packing.def | 2 +- definitions/grib2/template.5.second_order.def | 2 +- definitions/grib2/template.7.0.def | 2 +- definitions/grib2/template.7.1.def | 2 +- definitions/grib2/template.7.2.def | 2 +- definitions/grib2/template.7.3.def | 2 +- definitions/grib2/template.7.4.def | 2 +- definitions/grib2/template.7.40.def | 2 +- definitions/grib2/template.7.40000.def | 2 +- definitions/grib2/template.7.40010.def | 2 +- definitions/grib2/template.7.41.def | 2 +- definitions/grib2/template.7.42.def | 2 +- definitions/grib2/template.7.50.def | 2 +- definitions/grib2/template.7.50000.def | 2 +- definitions/grib2/template.7.50001.def | 2 +- definitions/grib2/template.7.50002.def | 2 +- definitions/grib2/template.7.51.def | 2 +- definitions/grib2/template.7.53.def | 2 +- definitions/grib2/template.7.6.def | 2 +- definitions/grib2/template.7.61.def | 2 +- definitions/grib2/template.7.second_order.def | 2 +- definitions/grib3/boot.def | 2 +- definitions/grib3/local.98.11.def | 2 +- definitions/grib3/local.98.14.def | 2 +- definitions/grib3/local.98.15.def | 2 +- definitions/grib3/local.98.16.def | 2 +- definitions/grib3/local.98.18.def | 2 +- definitions/grib3/local.98.192.def | 2 +- definitions/grib3/local.98.20.def | 2 +- definitions/grib3/local.98.21.def | 2 +- definitions/grib3/local.98.24.def | 2 +- definitions/grib3/local.98.25.def | 2 +- definitions/grib3/local.98.26.def | 2 +- definitions/grib3/local.98.28.def | 2 +- definitions/grib3/local.98.30.def | 2 +- definitions/grib3/local.98.300.def | 2 +- definitions/grib3/local.98.36.def | 2 +- definitions/grib3/local.98.38.def | 2 +- definitions/grib3/local.98.39.def | 2 +- definitions/grib3/local.98.7.def | 2 +- definitions/grib3/local.98.9.def | 2 +- definitions/grib3/mars_labeling.def | 2 +- definitions/grib3/meta.def | 2 +- definitions/grib3/parameters.def | 2 +- definitions/grib3/products_0.def | 2 +- definitions/grib3/products_1.def | 2 +- definitions/grib3/products_2.def | 2 +- definitions/grib3/products_3.def | 2 +- definitions/grib3/products_4.def | 2 +- definitions/grib3/products_5.def | 2 +- definitions/grib3/products_6.def | 2 +- definitions/grib3/products_7.def | 2 +- definitions/grib3/products_8.def | 2 +- definitions/grib3/products_9.def | 2 +- definitions/grib3/products_s2s.def | 2 +- definitions/grib3/products_tigge.def | 2 +- definitions/grib3/products_uerra.def | 2 +- definitions/grib3/rules.def | 2 +- definitions/grib3/section.00.def | 2 +- definitions/grib3/section.01.def | 2 +- definitions/grib3/section.02.def | 2 +- definitions/grib3/section.03.def | 2 +- definitions/grib3/section.04.def | 2 +- definitions/grib3/section.05.def | 2 +- definitions/grib3/section.06.def | 2 +- definitions/grib3/section.07.def | 2 +- definitions/grib3/section.08.def | 2 +- definitions/grib3/section.09.def | 2 +- definitions/grib3/section.10.def | 2 +- definitions/grib3/section.11.def | 2 +- definitions/grib3/sections.def | 2 +- definitions/grib3/template.10.0.def | 2 +- definitions/grib3/template.3.0.def | 2 +- definitions/grib3/template.3.110.def | 2 +- definitions/grib3/template.3.140.def | 2 +- definitions/grib3/template.3.20.def | 2 +- definitions/grib3/template.3.resolution_flags.def | 2 +- definitions/grib3/template.4.0.def | 2 +- definitions/grib3/template.4.1.def | 2 +- definitions/grib3/template.4.2.def | 2 +- definitions/grib3/template.4.3.def | 2 +- definitions/grib3/template.4.horizontal.def | 2 +- definitions/grib3/template.4.resolution_flags.def | 2 +- definitions/grib3/template.4.scanning_mode.def | 2 +- definitions/grib3/template.5.0.def | 2 +- definitions/grib3/template.5.1.def | 2 +- definitions/grib3/template.6.0.def | 2 +- definitions/grib3/template.6.1.def | 2 +- definitions/grib3/template.6.2.def | 2 +- definitions/grib3/template.7.0.def | 2 +- definitions/grib3/template.7.1.def | 2 +- definitions/grib3/template.7.2.def | 2 +- definitions/grib3/template.7.3.def | 2 +- definitions/grib3/template.7.4.def | 2 +- definitions/grib3/template.8.0.def | 2 +- definitions/grib3/template.8.1.def | 2 +- definitions/grib3/template.9.0.def | 2 +- definitions/gts/boot.def | 2 +- definitions/installDefinitions.sh | 2 +- definitions/mars/make_type_switch_case.sh | 2 +- definitions/metar/boot.def | 2 +- definitions/metar/boot.flexible.def | 2 +- definitions/publish_new_parameters.sh | 2 +- definitions/taf/boot.def | 2 +- definitions/tide/boot.def | 2 +- definitions/tide/mars_labeling.def | 2 +- definitions/tide/section.1.def | 2 +- definitions/tide/section.4.def | 2 +- definitions/wrap/boot.def | 2 +- eccodes_config.h.in | 2 +- examples/C/box.c | 2 +- examples/C/bufr_attributes.c | 2 +- examples/C/bufr_attributes.sh | 2 +- examples/C/bufr_clone.c | 2 +- examples/C/bufr_clone.sh | 2 +- examples/C/bufr_copy_data.c | 2 +- examples/C/bufr_copy_data.sh | 2 +- examples/C/bufr_expanded.c | 2 +- examples/C/bufr_expanded.sh | 2 +- examples/C/bufr_get_keys.c | 2 +- examples/C/bufr_get_keys.sh | 2 +- examples/C/bufr_get_string_array.c | 2 +- examples/C/bufr_get_string_array.sh | 2 +- examples/C/bufr_keys_iterator.c | 2 +- examples/C/bufr_keys_iterator.sh | 2 +- examples/C/bufr_missing.c | 2 +- examples/C/bufr_missing.sh | 2 +- examples/C/bufr_pthreads.c | 2 +- examples/C/bufr_pthreads.sh | 2 +- examples/C/bufr_read_header.c | 2 +- examples/C/bufr_read_header.sh | 2 +- examples/C/bufr_read_scatterometer.c | 2 +- examples/C/bufr_read_scatterometer.sh | 2 +- examples/C/bufr_read_synop.c | 2 +- examples/C/bufr_read_synop.sh | 2 +- examples/C/bufr_read_temp.c | 2 +- examples/C/bufr_read_temp.sh | 2 +- examples/C/bufr_set_keys.c | 2 +- examples/C/bufr_set_keys.sh | 2 +- examples/C/bufr_subset.c | 2 +- examples/C/bufr_subset.sh | 2 +- examples/C/ecmwf_link.sh | 2 +- examples/C/fieldset.c | 2 +- examples/C/get_product_kind.c | 2 +- examples/C/get_product_kind.sh | 2 +- examples/C/get_product_kind_samples.sh | 2 +- examples/C/grib_clone.c | 2 +- examples/C/grib_clone.sh | 2 +- examples/C/grib_copy_message.c | 2 +- examples/C/grib_copy_message.sh | 2 +- examples/C/grib_ensemble_index.c | 2 +- examples/C/grib_ensemble_index.sh | 2 +- examples/C/grib_get_data.c | 2 +- examples/C/grib_get_data.sh | 2 +- examples/C/grib_get_keys.c | 2 +- examples/C/grib_get_keys.sh | 2 +- examples/C/grib_index.c | 2 +- examples/C/grib_iterator.c | 2 +- examples/C/grib_iterator.sh | 2 +- examples/C/grib_iterator_bitmap.c | 2 +- examples/C/grib_keys_iterator.c | 2 +- examples/C/grib_keys_iterator.sh | 2 +- examples/C/grib_list.c | 2 +- examples/C/grib_list.sh | 2 +- examples/C/grib_multi.c | 2 +- examples/C/grib_multi.sh | 2 +- examples/C/grib_multi_write.c | 2 +- examples/C/grib_multi_write.sh | 2 +- examples/C/grib_nearest.c | 2 +- examples/C/grib_nearest_multiple.c | 2 +- examples/C/grib_nearest_multiple.sh | 2 +- examples/C/grib_precipitation.c | 2 +- examples/C/grib_precision.c | 2 +- examples/C/grib_precision.sh | 2 +- examples/C/grib_print_data.c | 2 +- examples/C/grib_print_data.sh | 2 +- examples/C/grib_pthreads.c | 2 +- examples/C/grib_pthreads.sh | 2 +- examples/C/grib_sections_copy.c | 2 +- examples/C/grib_sections_copy.sh | 2 +- examples/C/grib_set_bitmap.c | 2 +- examples/C/grib_set_bitmap.sh | 2 +- examples/C/grib_set_data.c | 2 +- examples/C/grib_set_data.sh | 2 +- examples/C/grib_set_keys.c | 2 +- examples/C/grib_set_keys.sh | 2 +- examples/C/grib_set_pv.c | 2 +- examples/C/grib_set_pv.sh | 2 +- examples/C/include.sh | 2 +- examples/C/large_grib1.c | 2 +- examples/C/large_grib1.sh | 2 +- examples/C/mars_param.c | 2 +- examples/C/multi2.c | 2 +- examples/C/nc.c | 2 +- examples/C/new_sample.c | 2 +- examples/C/rename.sh | 2 +- examples/C/run_examples.sh | 2 +- examples/C/set_missing.c | 2 +- examples/C/set_missing.sh | 2 +- examples/C/values_check.c | 2 +- examples/F90/bufr_attributes.f90 | 3 +-- examples/F90/bufr_attributes.sh | 2 +- examples/F90/bufr_clone.f90 | 2 +- examples/F90/bufr_clone.sh | 2 +- examples/F90/bufr_copy_data.f90 | 5 ++--- examples/F90/bufr_copy_data.sh | 2 +- examples/F90/bufr_copy_keys.f90 | 2 +- examples/F90/bufr_copy_keys.sh | 2 +- examples/F90/bufr_copy_message.f90 | 5 ++--- examples/F90/bufr_copy_message.sh | 2 +- examples/F90/bufr_expanded.f90 | 5 ++--- examples/F90/bufr_expanded.sh | 2 +- examples/F90/bufr_get_keys.f90 | 5 ++--- examples/F90/bufr_get_keys.sh | 2 +- examples/F90/bufr_get_string_array.f90 | 5 ++--- examples/F90/bufr_get_string_array.sh | 2 +- examples/F90/bufr_keys_iterator.f90 | 6 ++---- examples/F90/bufr_keys_iterator.sh | 2 +- examples/F90/bufr_read_header.f90 | 5 ++--- examples/F90/bufr_read_header.sh | 2 +- examples/F90/bufr_read_scatterometer.f90 | 5 ++--- examples/F90/bufr_read_scatterometer.sh | 2 +- examples/F90/bufr_read_synop.f90 | 5 ++--- examples/F90/bufr_read_synop.sh | 2 +- examples/F90/bufr_read_temp.f90 | 2 +- examples/F90/bufr_read_temp.sh | 2 +- examples/F90/bufr_read_tropical_cyclone.f90 | 5 ++--- examples/F90/bufr_read_tropical_cyclone.sh | 2 +- examples/F90/bufr_set_keys.f90 | 2 +- examples/F90/bufr_set_keys.sh | 2 +- examples/F90/bufr_subset.f90 | 5 ++--- examples/F90/bufr_subset.sh | 2 +- examples/F90/get_fortran.f90 | 2 +- examples/F90/get_pl.f90 | 2 +- examples/F90/get_pl.sh | 2 +- examples/F90/get_product_kind.f90 | 5 ++--- examples/F90/get_product_kind.sh | 2 +- examples/F90/get_pv.f90 | 6 ++---- examples/F90/get_pv.sh | 2 +- examples/F90/get_set_uuid.f90 | 6 +++--- examples/F90/get_set_uuid.sh | 2 +- examples/F90/grib_clone.f90 | 2 +- examples/F90/grib_clone.sh | 2 +- examples/F90/grib_copy_message.f90 | 2 +- examples/F90/grib_copy_message.sh | 2 +- examples/F90/grib_copy_namespace.f90 | 2 +- examples/F90/grib_copy_namespace.sh | 2 +- examples/F90/grib_count_messages.f90 | 2 +- examples/F90/grib_count_messages.sh | 2 +- examples/F90/grib_count_messages_multi.f90 | 2 +- examples/F90/grib_count_messages_multi.sh | 2 +- examples/F90/grib_ecc-671.f90 | 2 +- examples/F90/grib_ecc-671.sh | 2 +- examples/F90/grib_get_data.f90 | 2 +- examples/F90/grib_get_data.sh | 2 +- examples/F90/grib_get_keys.f90 | 2 +- examples/F90/grib_get_keys.sh | 2 +- examples/F90/grib_index.f90 | 2 +- examples/F90/grib_index.sh | 2 +- examples/F90/grib_keys_iterator.f90 | 2 +- examples/F90/grib_keys_iterator.sh | 2 +- examples/F90/grib_multi.f90 | 2 +- examples/F90/grib_multi.sh | 2 +- examples/F90/grib_multi_write.f90 | 2 +- examples/F90/grib_multi_write.sh | 2 +- examples/F90/grib_nearest.f90 | 2 +- examples/F90/grib_nearest.sh | 2 +- examples/F90/grib_precision.f90 | 2 +- examples/F90/grib_precision.sh | 2 +- examples/F90/grib_print_data.f90 | 2 +- examples/F90/grib_print_data.sh | 2 +- examples/F90/grib_print_data_static.f90 | 2 +- examples/F90/grib_samples.f90 | 2 +- examples/F90/grib_samples.sh | 2 +- examples/F90/grib_set_bitmap.f90 | 2 +- examples/F90/grib_set_bitmap.sh | 2 +- examples/F90/grib_set_data.f90 | 2 +- examples/F90/grib_set_data.sh | 2 +- examples/F90/grib_set_gvc.f90 | 2 +- examples/F90/grib_set_keys.f90 | 2 +- examples/F90/grib_set_keys.sh | 2 +- examples/F90/grib_set_missing.f90 | 2 +- examples/F90/grib_set_missing.sh | 2 +- examples/F90/grib_set_pv.f90 | 2 +- examples/F90/grib_set_pv.sh | 2 +- examples/F90/include.sh | 2 +- examples/F90/iterator_fortran.f90 | 2 +- examples/F90/keys_iterator_fortran.f90 | 2 +- examples/F90/multi_fortran.f90 | 2 +- examples/F90/new_from_file.f90 | 2 +- examples/F90/precision_fortran.f90 | 2 +- examples/F90/print_data_fortran.f90 | 2 +- examples/F90/read_from_file.f90 | 2 +- examples/F90/read_from_file.sh | 2 +- examples/F90/read_message.f90 | 3 +-- examples/F90/read_message.sh | 2 +- examples/F90/set_fortran.f90 | 2 +- examples/F90/set_missing_fortran.f90 | 2 +- examples/deprecated/fieldset.c | 2 +- examples/deprecated/get.c | 2 +- examples/deprecated/get_fortran.F | 2 +- examples/deprecated/grib_precipitation.c | 2 +- examples/deprecated/iterator.c | 2 +- examples/deprecated/iterator_fortran.F | 2 +- examples/deprecated/keys_iterator.c | 2 +- examples/deprecated/keys_iterator_fortran.F | 2 +- examples/deprecated/multi.c | 2 +- examples/deprecated/multi_fortran.F | 2 +- examples/deprecated/nearest.c | 2 +- examples/deprecated/precision.c | 2 +- examples/deprecated/precision_fortran.F | 2 +- examples/deprecated/print_data.c | 2 +- examples/deprecated/print_data_fortran.F | 2 +- examples/deprecated/set.c | 2 +- examples/deprecated/set_bitmap.c | 2 +- examples/deprecated/set_fortran.F | 2 +- examples/deprecated/set_pv.c | 2 +- examples/deprecated/set_pv_fortran.F | 2 +- examples/extra/ens_mean.f90 | 2 +- examples/extra/f_clone.f90 | 2 +- examples/extra/message_count_multi.f90 | 2 +- examples/python/binary_message.py | 2 +- examples/python/bufr_attributes.py | 2 +- examples/python/bufr_attributes.sh | 2 +- examples/python/bufr_clone.py | 2 +- examples/python/bufr_clone.sh | 2 +- examples/python/bufr_copy_data.py | 2 +- examples/python/bufr_copy_data.sh | 2 +- examples/python/bufr_copy_data2.py | 2 +- examples/python/bufr_copy_data3.py | 2 +- examples/python/bufr_ecc-448.py | 2 +- examples/python/bufr_ecc-448.sh | 2 +- examples/python/bufr_ecc-869.sh | 2 +- examples/python/bufr_encode_flight.py | 2 +- examples/python/bufr_expanded.py | 2 +- examples/python/bufr_expanded.sh | 2 +- examples/python/bufr_get_keys.py | 2 +- examples/python/bufr_get_keys.sh | 2 +- examples/python/bufr_keys_iterator.py | 2 +- examples/python/bufr_keys_iterator.sh | 2 +- examples/python/bufr_read_header.py | 2 +- examples/python/bufr_read_sample.py | 2 +- examples/python/bufr_read_sample.sh | 2 +- examples/python/bufr_read_scatterometer.py | 2 +- examples/python/bufr_read_scatterometer.sh | 2 +- examples/python/bufr_read_synop.py | 2 +- examples/python/bufr_read_synop.sh | 2 +- examples/python/bufr_read_temp.py | 2 +- examples/python/bufr_read_temp.sh | 2 +- examples/python/bufr_read_tropical_cyclone.py | 2 +- examples/python/bufr_read_tropical_cyclone.sh | 2 +- examples/python/bufr_set_keys.py | 2 +- examples/python/bufr_set_keys.sh | 2 +- examples/python/bufr_subset.py | 2 +- examples/python/bufr_subset.sh | 2 +- examples/python/get_product_kind.py | 2 +- examples/python/get_product_kind.sh | 2 +- examples/python/grib_ccsds.py | 2 +- examples/python/grib_clone.py | 2 +- examples/python/grib_count_messages.c | 2 +- examples/python/grib_count_messages.py | 2 +- examples/python/grib_get_keys.py | 2 +- examples/python/grib_get_message_offset.py | 2 +- examples/python/grib_get_message_offset.sh | 2 +- examples/python/grib_index.py | 2 +- examples/python/grib_iterator.c | 2 +- examples/python/grib_iterator.py | 2 +- examples/python/grib_iterator_bitmap.py | 2 +- examples/python/grib_keys_iterator.c | 2 +- examples/python/grib_keys_iterator.py | 2 +- examples/python/grib_ls_JSON.py | 2 +- examples/python/grib_multi_write.py | 2 +- examples/python/grib_nearest.py | 2 +- examples/python/grib_print_data.c | 2 +- examples/python/grib_print_data.py | 2 +- examples/python/grib_read_sample.py | 2 +- examples/python/grib_read_sample.sh | 2 +- examples/python/grib_samples.py | 2 +- examples/python/grib_set_bitmap.py | 2 +- examples/python/grib_set_keys.py | 2 +- examples/python/grib_set_missing.py | 2 +- examples/python/grib_set_pv.py | 2 +- examples/python/gts_get_keys.py | 2 +- examples/python/gts_get_keys.sh | 2 +- examples/python/keys_iterator_gts.py | 2 +- examples/python/metar_get_keys.py | 2 +- examples/python/metar_get_keys.sh | 2 +- fortran/create_grib_f90.sh | 2 +- fortran/eccodes_f90_head.f90 | 2 +- fortran/eccodes_f90_int.f90 | 2 +- fortran/eccodes_f90_int_size_t.f90 | 2 +- fortran/eccodes_f90_long_int.f90 | 2 +- fortran/eccodes_f90_long_size_t.f90 | 2 +- fortran/grib_f77.c | 2 +- fortran/grib_f90_head.f90 | 2 +- fortran/grib_f90_int.f90 | 2 +- fortran/grib_f90_int_size_t.f90 | 2 +- fortran/grib_f90_long_int.f90 | 2 +- fortran/grib_f90_long_size_t.f90 | 2 +- fortran/grib_fortran.c | 2 +- fortran/grib_fortran_kinds.c | 2 +- fortran/grib_fortran_prototypes.h | 2 +- fortran/grib_types.f90 | 2 +- fortran/same_int_long.f90 | 2 +- fortran/same_int_size_t.f90 | 2 +- perf/jmeter.awk | 2 +- perf/time.sh | 2 +- perl/GRIB-API/README | 2 +- perl/GRIB-API/convert.pl | 2 +- perl/GRIB-API/lib/GRIB/API.pm | 2 +- perl/GRIB-API/test.pl | 2 +- python/grib_interface.c | 2 +- python/gribapi.c | 2 +- python3/grib_interface.c | 2 +- python3/gribapi.c | 2 +- show_compile.sh | 2 +- src/CMakeLists.txt | 2 +- src/action.c | 2 +- src/action_class_alias.c | 2 +- src/action_class_assert.c | 2 +- src/action_class_close.c | 2 +- src/action_class_concept.c | 2 +- src/action_class_gen.c | 2 +- src/action_class_hash_array.c | 2 +- src/action_class_if.c | 2 +- src/action_class_list.c | 2 +- src/action_class_meta.c | 2 +- src/action_class_modify.c | 2 +- src/action_class_noop.c | 2 +- src/action_class_print.c | 2 +- src/action_class_put.c | 2 +- src/action_class_remove.c | 2 +- src/action_class_rename.c | 2 +- src/action_class_section.c | 2 +- src/action_class_set.c | 2 +- src/action_class_set_darray.c | 2 +- src/action_class_set_iarray.c | 2 +- src/action_class_set_missing.c | 2 +- src/action_class_set_sarray.c | 2 +- src/action_class_switch.c | 2 +- src/action_class_template.c | 2 +- src/action_class_transient_darray.c | 2 +- src/action_class_trigger.c | 2 +- src/action_class_variable.c | 2 +- src/action_class_when.c | 2 +- src/action_class_while.c | 2 +- src/action_class_write.c | 2 +- src/bufr_keys_iterator.c | 2 +- src/bufr_util.c | 2 +- src/codes_memfs.c | 2 +- src/codes_util.c | 2 +- src/eccodes.c | 2 +- src/eccodes.h | 2 +- src/eccodes_version.h.in | 2 +- src/eccodes_windef.h | 2 +- src/encode_double_array.c | 2 +- src/errors.pl | 2 +- src/functions.c | 2 +- src/grib2c.pl | 2 +- src/grib_2order_packer_simple.c | 2 +- src/grib_accessor.c | 2 +- src/grib_accessor_class.c | 2 +- src/grib_accessor_class_abstract_long_vector.c | 2 +- src/grib_accessor_class_abstract_vector.c | 2 +- src/grib_accessor_class_apply_operators.c | 2 +- src/grib_accessor_class_array.c | 2 +- src/grib_accessor_class_ascii.c | 2 +- src/grib_accessor_class_assert.c | 2 +- src/grib_accessor_class_bit.c | 2 +- src/grib_accessor_class_bitmap.c | 2 +- src/grib_accessor_class_bits.c | 2 +- src/grib_accessor_class_bits_per_value.c | 2 +- src/grib_accessor_class_blob.c | 2 +- src/grib_accessor_class_box.c | 2 +- src/grib_accessor_class_budgdate.c | 2 +- src/grib_accessor_class_bufr_clear_tables.c | 2 +- src/grib_accessor_class_bufr_data.c | 2 +- src/grib_accessor_class_bufr_data_array.c | 2 +- src/grib_accessor_class_bufr_data_element.c | 2 +- src/grib_accessor_class_bufr_elements_table.c | 2 +- src/grib_accessor_class_bufr_extract_area_subsets.c | 2 +- src/grib_accessor_class_bufr_extract_datetime_subsets.c | 2 +- src/grib_accessor_class_bufr_extract_subsets.c | 2 +- src/grib_accessor_class_bufr_group.c | 2 +- src/grib_accessor_class_bufr_has_delayed_replication.c | 2 +- src/grib_accessor_class_bufr_simple_thinning.c | 2 +- src/grib_accessor_class_bufr_string_values.c | 2 +- src/grib_accessor_class_bufrdc_expanded_descriptors.c | 2 +- src/grib_accessor_class_bytes.c | 2 +- src/grib_accessor_class_change_scanning_direction.c | 2 +- src/grib_accessor_class_check_internal_version.c | 2 +- src/grib_accessor_class_codeflag.c | 2 +- src/grib_accessor_class_codetable.c | 2 +- src/grib_accessor_class_codetable_title.c | 2 +- src/grib_accessor_class_codetable_units.c | 2 +- src/grib_accessor_class_concept.c | 2 +- src/grib_accessor_class_constant.c | 2 +- src/grib_accessor_class_count_file.c | 2 +- src/grib_accessor_class_count_missing.c | 2 +- src/grib_accessor_class_count_total.c | 2 +- src/grib_accessor_class_data_2order_packing.c | 2 +- src/grib_accessor_class_data_2order_packing_count.c | 2 +- src/grib_accessor_class_data_apply_bitmap.c | 2 +- src/grib_accessor_class_data_apply_boustrophedonic.c | 2 +- src/grib_accessor_class_data_apply_boustrophedonic_bitmap.c | 2 +- src/grib_accessor_class_data_apply_gdsnotpresent.c | 2 +- src/grib_accessor_class_data_ccsds_packing.c | 2 +- src/grib_accessor_class_data_complex_packing.c | 2 +- src/grib_accessor_class_data_constant_field.c | 2 +- src/grib_accessor_class_data_dummy_field.c | 2 +- src/grib_accessor_class_data_g1complex_packing.c | 2 +- ...essor_class_data_g1second_order_constant_width_packing.c | 2 +- ...sor_class_data_g1second_order_general_extended_packing.c | 2 +- ...rib_accessor_class_data_g1second_order_general_packing.c | 2 +- ..._accessor_class_data_g1second_order_row_by_row_packing.c | 2 +- src/grib_accessor_class_data_g1secondary_bitmap.c | 2 +- src/grib_accessor_class_data_g1shsimple_packing.c | 2 +- src/grib_accessor_class_data_g1simple_packing.c | 2 +- src/grib_accessor_class_data_g22order_packing.c | 2 +- src/grib_accessor_class_data_g2bifourier_packing.c | 2 +- src/grib_accessor_class_data_g2complex_packing.c | 2 +- src/grib_accessor_class_data_g2secondary_bitmap.c | 2 +- src/grib_accessor_class_data_g2shsimple_packing.c | 2 +- src/grib_accessor_class_data_g2simple_packing.c | 2 +- ...ccessor_class_data_g2simple_packing_with_preprocessing.c | 2 +- src/grib_accessor_class_data_jpeg2000_packing.c | 2 +- src/grib_accessor_class_data_png_packing.c | 2 +- src/grib_accessor_class_data_raw_packing.c | 2 +- src/grib_accessor_class_data_secondary_bitmap.c | 2 +- src/grib_accessor_class_data_sh_packed.c | 2 +- src/grib_accessor_class_data_sh_unpacked.c | 2 +- src/grib_accessor_class_data_shsimple_packing.c | 2 +- src/grib_accessor_class_data_simple_packing.c | 2 +- src/grib_accessor_class_decimal_precision.c | 2 +- src/grib_accessor_class_dictionary.c | 2 +- src/grib_accessor_class_dirty.c | 2 +- src/grib_accessor_class_divdouble.c | 2 +- src/grib_accessor_class_double.c | 2 +- src/grib_accessor_class_element.c | 2 +- src/grib_accessor_class_evaluate.c | 2 +- src/grib_accessor_class_expanded_descriptors.c | 2 +- src/grib_accessor_class_forward.c | 2 +- src/grib_accessor_class_from_scale_factor_scaled_value.c | 2 +- src/grib_accessor_class_g1_half_byte_codeflag.c | 2 +- src/grib_accessor_class_g1_increment.c | 2 +- src/grib_accessor_class_g1_message_length.c | 2 +- src/grib_accessor_class_g1_section4_length.c | 2 +- src/grib_accessor_class_g1area.c | 2 +- src/grib_accessor_class_g1bitmap.c | 2 +- src/grib_accessor_class_g1date.c | 2 +- src/grib_accessor_class_g1day_of_the_year_date.c | 2 +- src/grib_accessor_class_g1end_of_interval_monthly.c | 2 +- src/grib_accessor_class_g1fcperiod.c | 2 +- src/grib_accessor_class_g1forecastmonth.c | 2 +- src/grib_accessor_class_g1monthlydate.c | 2 +- ...rib_accessor_class_g1number_of_coded_values_sh_complex.c | 2 +- ...grib_accessor_class_g1number_of_coded_values_sh_simple.c | 2 +- src/grib_accessor_class_g1p1p2.c | 2 +- src/grib_accessor_class_g1param.c | 2 +- src/grib_accessor_class_g1step_range.c | 2 +- src/grib_accessor_class_g1verificationdate.c | 2 +- src/grib_accessor_class_g2_aerosol.c | 2 +- src/grib_accessor_class_g2_chemical.c | 2 +- src/grib_accessor_class_g2_eps.c | 2 +- src/grib_accessor_class_g2_mars_labeling.c | 2 +- src/grib_accessor_class_g2bitmap.c | 2 +- src/grib_accessor_class_g2bitmap_present.c | 2 +- src/grib_accessor_class_g2date.c | 2 +- src/grib_accessor_class_g2end_step.c | 2 +- src/grib_accessor_class_g2grid.c | 2 +- src/grib_accessor_class_g2latlon.c | 2 +- src/grib_accessor_class_g2level.c | 2 +- src/grib_accessor_class_g2lon.c | 2 +- src/grib_accessor_class_g2step.c | 2 +- src/grib_accessor_class_g2step_range.c | 2 +- src/grib_accessor_class_gaussian_grid_name.c | 2 +- src/grib_accessor_class_gds_is_present.c | 2 +- src/grib_accessor_class_gds_not_present_bitmap.c | 2 +- src/grib_accessor_class_gen.c | 2 +- src/grib_accessor_class_getenv.c | 2 +- src/grib_accessor_class_global_gaussian.c | 2 +- src/grib_accessor_class_group.c | 2 +- src/grib_accessor_class_gts_header.c | 2 +- src/grib_accessor_class_hash_array.c | 2 +- src/grib_accessor_class_headers_only.c | 2 +- src/grib_accessor_class_ibmfloat.c | 2 +- src/grib_accessor_class_ieeefloat.c | 2 +- src/grib_accessor_class_ifs_param.c | 2 +- src/grib_accessor_class_int16.c | 2 +- src/grib_accessor_class_int16_little_endian.c | 2 +- src/grib_accessor_class_int32.c | 2 +- src/grib_accessor_class_int32_little_endian.c | 2 +- src/grib_accessor_class_int64.c | 2 +- src/grib_accessor_class_int64_little_endian.c | 2 +- src/grib_accessor_class_int8.c | 2 +- src/grib_accessor_class_iterator.c | 2 +- src/grib_accessor_class_julian_date.c | 2 +- src/grib_accessor_class_julian_day.c | 2 +- src/grib_accessor_class_ksec1expver.c | 2 +- src/grib_accessor_class_label.c | 2 +- src/grib_accessor_class_laplacian.c | 2 +- src/grib_accessor_class_latitudes.c | 2 +- src/grib_accessor_class_latlon_increment.c | 2 +- src/grib_accessor_class_latlonvalues.c | 2 +- src/grib_accessor_class_library_version.c | 2 +- src/grib_accessor_class_local_definition.c | 2 +- src/grib_accessor_class_long.c | 2 +- src/grib_accessor_class_long_vector.c | 2 +- src/grib_accessor_class_longitudes.c | 2 +- src/grib_accessor_class_lookup.c | 2 +- src/grib_accessor_class_mars_param.c | 2 +- src/grib_accessor_class_mars_step.c | 2 +- src/grib_accessor_class_md5.c | 2 +- src/grib_accessor_class_message.c | 2 +- src/grib_accessor_class_message_copy.c | 2 +- src/grib_accessor_class_missing.c | 2 +- src/grib_accessor_class_nearest.c | 2 +- src/grib_accessor_class_non_alpha.c | 2 +- src/grib_accessor_class_number_of_coded_values.c | 2 +- src/grib_accessor_class_number_of_points.c | 2 +- src/grib_accessor_class_number_of_points_gaussian.c | 2 +- src/grib_accessor_class_number_of_values.c | 2 +- src/grib_accessor_class_number_of_values_data_raw_packing.c | 2 +- src/grib_accessor_class_octahedral_gaussian.c | 2 +- src/grib_accessor_class_octect_number.c | 2 +- src/grib_accessor_class_offset_file.c | 2 +- src/grib_accessor_class_offset_values.c | 2 +- src/grib_accessor_class_pack_bufr_values.c | 2 +- src/grib_accessor_class_pad.c | 2 +- src/grib_accessor_class_padding.c | 2 +- src/grib_accessor_class_padto.c | 2 +- src/grib_accessor_class_padtoeven.c | 2 +- src/grib_accessor_class_padtomultiple.c | 2 +- src/grib_accessor_class_position.c | 2 +- src/grib_accessor_class_raw.c | 2 +- src/grib_accessor_class_rdbtime_guess_date.c | 2 +- src/grib_accessor_class_reference_value_error.c | 2 +- src/grib_accessor_class_round.c | 2 +- src/grib_accessor_class_scale.c | 2 +- src/grib_accessor_class_scale_values.c | 2 +- src/grib_accessor_class_second_order_bits_per_value.c | 2 +- src/grib_accessor_class_section.c | 2 +- src/grib_accessor_class_section_length.c | 2 +- src/grib_accessor_class_section_padding.c | 2 +- src/grib_accessor_class_section_pointer.c | 2 +- src/grib_accessor_class_select_step_template.c | 2 +- src/grib_accessor_class_sexagesimal2decimal.c | 2 +- src/grib_accessor_class_signed.c | 2 +- src/grib_accessor_class_signed_bits.c | 2 +- src/grib_accessor_class_simple_packing_error.c | 2 +- src/grib_accessor_class_size.c | 2 +- src/grib_accessor_class_smart_table.c | 2 +- src/grib_accessor_class_smart_table_column.c | 2 +- src/grib_accessor_class_spd.c | 2 +- src/grib_accessor_class_spectral_truncation.c | 2 +- src/grib_accessor_class_sprintf.c | 2 +- src/grib_accessor_class_statistics.c | 2 +- src/grib_accessor_class_statistics_spectral.c | 2 +- src/grib_accessor_class_step_in_units.c | 2 +- src/grib_accessor_class_sum.c | 2 +- src/grib_accessor_class_suppressed.c | 2 +- src/grib_accessor_class_time.c | 2 +- src/grib_accessor_class_times.c | 2 +- src/grib_accessor_class_to_double.c | 2 +- src/grib_accessor_class_to_integer.c | 2 +- src/grib_accessor_class_to_string.c | 2 +- src/grib_accessor_class_transient.c | 2 +- src/grib_accessor_class_transient_darray.c | 2 +- src/grib_accessor_class_uint16.c | 2 +- src/grib_accessor_class_uint16_little_endian.c | 2 +- src/grib_accessor_class_uint32.c | 2 +- src/grib_accessor_class_uint32_little_endian.c | 2 +- src/grib_accessor_class_uint64.c | 2 +- src/grib_accessor_class_uint64_little_endian.c | 2 +- src/grib_accessor_class_uint8.c | 2 +- src/grib_accessor_class_unexpanded_descriptors.c | 2 +- src/grib_accessor_class_unpack_bufr_values.c | 2 +- src/grib_accessor_class_unsigned.c | 2 +- src/grib_accessor_class_unsigned_bits.c | 2 +- src/grib_accessor_class_validity_date.c | 2 +- src/grib_accessor_class_validity_time.c | 2 +- src/grib_accessor_class_values.c | 2 +- src/grib_accessor_class_variable.c | 2 +- src/grib_accessor_class_vector.c | 2 +- src/grib_accessor_class_when.c | 2 +- src/grib_api.h | 2 +- src/grib_api_internal.h | 2 +- src/grib_bits.c | 2 +- src/grib_bits_any_endian.c | 2 +- src/grib_bits_any_endian_omp.c | 2 +- src/grib_bits_any_endian_simple.c | 2 +- src/grib_bits_any_endian_vector.c | 2 +- src/grib_bits_fast_big_endian.c | 2 +- src/grib_bits_fast_big_endian_omp.c | 2 +- src/grib_bits_fast_big_endian_simple.c | 2 +- src/grib_bits_fast_big_endian_vector.c | 2 +- src/grib_bits_ibmpow.c | 2 +- src/grib_bits_ibmpow_opt.c | 2 +- src/grib_box.c | 2 +- src/grib_box_class.c | 2 +- src/grib_box_class_gen.c | 2 +- src/grib_box_class_reduced_gaussian.c | 2 +- src/grib_box_class_regular_gaussian.c | 2 +- src/grib_buffer.c | 2 +- src/grib_bufr_descriptor.c | 2 +- src/grib_bufr_descriptors_array.c | 2 +- src/grib_compressor.c | 2 +- src/grib_concept.c | 2 +- src/grib_concept_index.c | 2 +- src/grib_context.c | 2 +- src/grib_darray.c | 2 +- src/grib_date.c | 2 +- src/grib_db.c | 2 +- src/grib_dependency.c | 2 +- src/grib_dumper.c | 2 +- src/grib_dumper_class.c | 2 +- src/grib_dumper_class_bufr_decode_C.c | 2 +- src/grib_dumper_class_bufr_decode_filter.c | 2 +- src/grib_dumper_class_bufr_decode_fortran.c | 2 +- src/grib_dumper_class_bufr_decode_python.c | 2 +- src/grib_dumper_class_bufr_encode_C.c | 2 +- src/grib_dumper_class_bufr_encode_filter.c | 2 +- src/grib_dumper_class_bufr_encode_fortran.c | 2 +- src/grib_dumper_class_bufr_encode_python.c | 2 +- src/grib_dumper_class_bufr_simple.c | 2 +- src/grib_dumper_class_debug.c | 2 +- src/grib_dumper_class_default.c | 2 +- src/grib_dumper_class_grib_encode_C.c | 2 +- src/grib_dumper_class_json.c | 2 +- src/grib_dumper_class_keys.c | 2 +- src/grib_dumper_class_serialize.c | 2 +- src/grib_dumper_class_wmo.c | 2 +- src/grib_emoslib.h | 2 +- src/grib_expression.c | 2 +- src/grib_expression_class_accessor.c | 2 +- src/grib_expression_class_binop.c | 2 +- src/grib_expression_class_column.c | 2 +- src/grib_expression_class_constant.c | 2 +- src/grib_expression_class_double.c | 2 +- src/grib_expression_class_functor.c | 2 +- src/grib_expression_class_is_in_dict.c | 2 +- src/grib_expression_class_is_in_list.c | 2 +- src/grib_expression_class_is_integer.c | 2 +- src/grib_expression_class_length.c | 2 +- src/grib_expression_class_logical_and.c | 2 +- src/grib_expression_class_logical_or.c | 2 +- src/grib_expression_class_long.c | 2 +- src/grib_expression_class_string.c | 2 +- src/grib_expression_class_string_compare.c | 2 +- src/grib_expression_class_sub_string.c | 2 +- src/grib_expression_class_true.c | 2 +- src/grib_expression_class_unop.c | 2 +- src/grib_fieldset.c | 2 +- src/grib_filepool.c | 2 +- src/grib_gaussian_reduced.c | 2 +- src/grib_geography.c | 2 +- src/grib_handle.c | 2 +- src/grib_hash_array.c | 2 +- src/grib_hash_keys.c | 2 +- src/grib_header_compute.c | 2 +- src/grib_iarray.c | 2 +- src/grib_ibmfloat.c | 2 +- src/grib_ieeefloat.c | 2 +- src/grib_index.c | 2 +- src/grib_io.c | 2 +- src/grib_iterator.c | 2 +- src/grib_iterator_class.c | 2 +- src/grib_iterator_class_gaussian.c | 2 +- src/grib_iterator_class_gaussian_reduced.c | 2 +- src/grib_iterator_class_gen.c | 2 +- src/grib_iterator_class_lambert_azimuthal_equal_area.c | 2 +- src/grib_iterator_class_lambert_conformal.c | 2 +- src/grib_iterator_class_latlon.c | 2 +- src/grib_iterator_class_latlon_reduced.c | 2 +- src/grib_iterator_class_polar_stereographic.c | 2 +- src/grib_iterator_class_regular.c | 2 +- src/grib_iterator_class_space_view.c | 2 +- src/grib_itrie.c | 2 +- src/grib_itrie_keys.c | 2 +- src/grib_jasper_encoding.c | 2 +- src/grib_keys_iterator.c | 2 +- src/grib_lex.c | 2 +- src/grib_loader_from_array.c | 2 +- src/grib_loader_from_file.c | 2 +- src/grib_loader_from_handle.c | 2 +- src/grib_memory.c | 2 +- src/grib_nearest.c | 2 +- src/grib_nearest_class.c | 2 +- src/grib_nearest_class_gen.c | 2 +- src/grib_nearest_class_lambert_conformal.c | 2 +- src/grib_nearest_class_latlon_reduced.c | 2 +- src/grib_nearest_class_polar_stereographic.c | 2 +- src/grib_nearest_class_reduced.c | 2 +- src/grib_nearest_class_regular.c | 2 +- src/grib_nearest_class_sh.c | 2 +- src/grib_oarray.c | 2 +- src/grib_openjpeg_encoding.c | 2 +- src/grib_optimize_decimal_factor.c | 2 +- src/grib_optimize_decimal_factor.h | 2 +- src/grib_parse_utils.c | 6 ++++-- src/grib_query.c | 2 +- src/grib_rules.c | 2 +- src/grib_sarray.c | 2 +- src/grib_scaling.c | 2 +- src/grib_templates.c | 2 +- src/grib_templates.h | 2 +- src/grib_timer.c | 2 +- src/grib_trie.c | 2 +- src/grib_trie_with_rank.c | 2 +- src/grib_util.c | 2 +- src/grib_value.c | 2 +- src/grib_vdarray.c | 2 +- src/grib_viarray.c | 2 +- src/grib_vsarray.c | 2 +- src/gribl.l | 2 +- src/griby.y | 2 +- src/jgribapi_GribFile.h | 2 +- src/jgribapi_GribHandle.h | 2 +- src/jgribapi_GribIterator.h | 2 +- src/md5.c | 2 +- src/md5.h | 2 +- src/minmax_val.c | 2 +- src/string_util.c | 2 +- tests/badgrib.sh | 2 +- tests/bits.c | 2 +- tests/bpv_limit.c | 2 +- tests/bpv_limit.sh | 2 +- tests/budg.sh | 2 +- tests/bufr_change_edition.sh | 2 +- tests/bufr_compare.sh | 2 +- tests/bufr_copy.sh | 2 +- tests/bufr_count.sh | 2 +- tests/bufr_dump_data.sh | 2 +- tests/bufr_dump_decode_C.sh | 2 +- tests/bufr_dump_decode_filter.sh | 2 +- tests/bufr_dump_decode_fortran.sh | 2 +- tests/bufr_dump_decode_python.sh | 2 +- tests/bufr_dump_descriptors.sh | 2 +- tests/bufr_dump_encode_C.sh | 2 +- tests/bufr_dump_encode_filter.sh | 2 +- tests/bufr_dump_encode_fortran.sh | 2 +- tests/bufr_dump_encode_python.sh | 2 +- tests/bufr_dump_samples.sh | 2 +- tests/bufr_dump_subset.sh | 2 +- tests/bufr_ecc-197.sh | 2 +- tests/bufr_ecc-286.sh | 2 +- tests/bufr_ecc-288.sh | 2 +- tests/bufr_ecc-313.sh | 2 +- tests/bufr_ecc-359.sh | 2 +- tests/bufr_ecc-379.sh | 2 +- tests/bufr_ecc-393.sh | 2 +- tests/bufr_ecc-428.sh | 2 +- tests/bufr_ecc-433.sh | 2 +- tests/bufr_ecc-517.c | 2 +- tests/bufr_ecc-517.sh | 2 +- tests/bufr_ecc-556.sh | 2 +- tests/bufr_ecc-604.sh | 2 +- tests/bufr_ecc-616.sh | 2 +- tests/bufr_ecc-673.sh | 2 +- tests/bufr_ecc-686.sh | 2 +- tests/bufr_ecc-690.sh | 2 +- tests/bufr_ecc-750.sh | 2 +- tests/bufr_ecc-765.sh | 2 +- tests/bufr_ecc-875.sh | 2 +- tests/bufr_ecc-887.sh | 2 +- tests/bufr_extract_headers.c | 2 +- tests/bufr_extract_headers.sh | 2 +- tests/bufr_filter.sh | 2 +- tests/bufr_filter_extract_area.sh | 2 +- tests/bufr_filter_extract_datetime.sh | 2 +- tests/bufr_get.sh | 2 +- tests/bufr_get_element.c | 2 +- tests/bufr_get_element.sh | 2 +- tests/bufr_json_data.sh | 2 +- tests/bufr_json_samples.sh | 2 +- tests/bufr_keys_iter.c | 2 +- tests/bufr_keys_iter.sh | 2 +- tests/bufr_ls.sh | 2 +- tests/bufr_ls_json.sh | 2 +- tests/bufr_rdbSubTypes.sh | 2 +- tests/bufr_set.sh | 2 +- tests/bufr_split_by_rdbSubtype.sh | 2 +- tests/bufr_wmo_tables.sh | 2 +- tests/bufrdc_desc_ref.sh | 2 +- tests/bufrdc_ref.sh | 2 +- tests/codes_split_file.sh | 2 +- tests/decode.c | 2 +- tests/definitions.sh | 2 +- tests/diag.sh | 2 +- tests/fortran_interface.sh | 2 +- tests/gauss_sub.c | 2 +- tests/get_fail.sh | 2 +- tests/grib1to2.sh | 2 +- tests/grib1to3.sh | 2 +- tests/grib2to1.sh | 2 +- tests/grib2to3.sh | 2 +- tests/grib3_templates.sh | 2 +- tests/grib_2nd_order_numValues.c | 2 +- tests/grib_2nd_order_numValues.sh | 2 +- tests/grib_bitmap.sh | 2 +- tests/grib_bitsPerValue.sh | 2 +- tests/grib_calendar.sh | 2 +- tests/grib_ccsds.sh | 2 +- tests/grib_ccsds_perf.c | 2 +- tests/grib_change_scanning.sh | 2 +- tests/grib_check_gaussian_grids.sh | 2 +- tests/grib_check_param_concepts.sh | 2 +- tests/grib_compare.sh | 2 +- tests/grib_complex.sh | 2 +- tests/grib_concept.sh | 2 +- tests/grib_copy.sh | 2 +- tests/grib_data_quality_checks.sh | 4 ++-- tests/grib_decimalPrecision.sh | 2 +- tests/grib_double_cmp.c | 2 +- tests/grib_double_cmp.sh | 2 +- tests/grib_dump.sh | 2 +- tests/grib_dump_debug.sh | 2 +- tests/grib_dump_json.sh | 2 +- tests/grib_ecc-1000.sh | 2 +- tests/grib_ecc-1001.sh | 2 +- tests/grib_ecc-1030.sh | 2 +- tests/grib_ecc-1065.sh | 2 +- tests/grib_ecc-136.sh | 2 +- tests/grib_ecc-386.c | 2 +- tests/grib_ecc-386.sh | 2 +- tests/grib_ecc-490.sh | 2 +- tests/grib_ecc-600.sh | 2 +- tests/grib_ecc-604.sh | 2 +- tests/grib_ecc-756.sh | 2 +- tests/grib_ecc-873.sh | 2 +- tests/grib_ecc-923.sh | 2 +- tests/grib_ecc-967.sh | 2 +- tests/grib_ecc-979.sh | 2 +- tests/grib_ecc-984.sh | 2 +- tests/grib_efas.sh | 2 +- tests/grib_encode_pthreads.c | 2 +- tests/grib_encode_pthreads.sh | 2 +- tests/grib_filter.sh | 2 +- tests/grib_global.sh | 2 +- tests/grib_gridType.sh | 2 +- tests/grib_iterator.sh | 2 +- tests/grib_jpeg.sh | 2 +- tests/grib_lam_bf.sh | 2 +- tests/grib_lam_gp.sh | 2 +- tests/grib_lamb_az_eq_area.sh | 2 +- tests/grib_level.sh | 2 +- tests/grib_list.sh | 2 +- tests/grib_local.sh | 2 +- tests/grib_local_MeteoFrance.c | 2 +- tests/grib_local_MeteoFrance.sh | 2 +- tests/grib_ls.sh | 2 +- tests/grib_ls_json.sh | 2 +- tests/grib_mars_types.sh | 2 +- tests/grib_missing.sh | 2 +- tests/grib_multi.sh | 2 +- tests/grib_multi_from_message.c | 2 +- tests/grib_multi_from_message.sh | 2 +- tests/grib_nearest_test.c | 2 +- tests/grib_nearest_test.sh | 2 +- tests/grib_neg_fctime.sh | 2 +- tests/grib_octahedral.sh | 2 +- tests/grib_optimize_scaling.c | 2 +- tests/grib_optimize_scaling.sh | 2 +- tests/grib_optimize_scaling_sh.c | 2 +- tests/grib_optimize_scaling_sh.sh | 2 +- tests/grib_padding.sh | 2 +- tests/grib_png.sh | 2 +- tests/grib_second_order.sh | 2 +- tests/grib_set.sh | 2 +- tests/grib_sh_ieee64.c | 2 +- tests/grib_sh_ieee64.sh | 2 +- tests/grib_sh_imag.c | 2 +- tests/grib_sh_imag.sh | 2 +- tests/grib_statistics.sh | 2 +- tests/grib_step.sh | 2 +- tests/grib_tigge.sh | 2 +- tests/grib_tigge_conversions.sh | 2 +- tests/grib_to_netcdf.sh | 2 +- tests/grib_uerra.sh | 2 +- tests/grib_util_set_spec.c | 2 +- tests/grib_util_set_spec.sh | 2 +- tests/gribex_perf.c | 2 +- tests/gts_compare.sh | 2 +- tests/gts_count.sh | 2 +- tests/gts_get.sh | 2 +- tests/gts_ls.sh | 2 +- tests/ibm.c | 2 +- tests/ieee.c | 2 +- tests/ieee.sh | 2 +- tests/include.sh | 2 +- tests/index.c | 2 +- tests/index.sh | 2 +- tests/index_orderby.c | 2 +- tests/jpeg_perf.c | 2 +- tests/julian.c | 2 +- tests/julian.sh | 2 +- tests/laplacian.c | 2 +- tests/largefile.c | 2 +- tests/list_all_keys.ksh | 2 +- tests/metar_compare.sh | 2 +- tests/metar_dump.sh | 2 +- tests/metar_get.sh | 2 +- tests/metar_ls.sh | 2 +- tests/mybufrdc_ref.sh | 2 +- tests/pack_unpack.c | 2 +- tests/packing.c | 2 +- tests/packing_check.c | 2 +- tests/png_perf.c | 2 +- tests/read_any.c | 2 +- tests/read_any.sh | 2 +- tests/read_index.c | 2 +- tests/so_perf.c | 2 +- tests/timing.c | 2 +- tests/tiny.sh | 2 +- tests/tools_data_from_stdin.sh | 2 +- tests/unit_tests.c | 2 +- tests/unit_tests.sh | 2 +- tests/utils.sh | 2 +- tests/values_to_ascii.c | 2 +- tigge/jma.pl | 2 +- tigge/tigge_accumulations.c | 2 +- tigge/tigge_check.c | 2 +- tigge/tigge_check.h | 2 +- tigge/tigge_name.c | 2 +- tigge/tigge_split.c | 2 +- tigge/tigge_tools.c | 2 +- tigge/tigge_tools.h | 2 +- tools/CMakeLists.txt | 2 +- tools/big2gribex.c | 2 +- tools/bufr_3to4.c | 2 +- tools/bufr_compare.c | 2 +- tools/bufr_copy.c | 2 +- tools/bufr_dump.c | 2 +- tools/bufr_filter.c | 2 +- tools/bufr_get.c | 2 +- tools/bufr_index_build.c | 2 +- tools/bufr_ls.c | 2 +- tools/bufr_set.c | 2 +- tools/bufr_split_by_rdbSubtype.c | 2 +- tools/codes_count.c | 2 +- tools/codes_info.c | 2 +- tools/codes_parser.c | 2 +- tools/codes_split_file.c | 2 +- tools/compile.c | 2 +- tools/deprecated/all_keys.c | 2 +- tools/deprecated/dump.c | 2 +- tools/deprecated/dumpload.c | 2 +- tools/deprecated/grib_add.c | 2 +- tools/deprecated/grib_cmp.c | 2 +- tools/deprecated/grib_convert.c | 2 +- tools/deprecated/grib_corruption_check.c | 2 +- tools/deprecated/grib_debug.c | 2 +- tools/deprecated/grib_diff.c | 2 +- tools/deprecated/grib_distance.c | 2 +- tools/deprecated/grib_error.c | 2 +- tools/deprecated/grib_gen.c | 2 +- tools/deprecated/grib_keys.c | 2 +- tools/deprecated/grib_moments.c | 2 +- tools/deprecated/grib_packing.c | 2 +- tools/deprecated/grib_points.c | 2 +- tools/gaussian.c | 2 +- tools/gg_sub_area_check.c | 2 +- tools/grib2ppm.c | 2 +- tools/grib_2_request.c | 2 +- tools/grib_check_gaussian_grid.c | 2 +- tools/grib_compare.c | 2 +- tools/grib_copy.c | 2 +- tools/grib_dump.c | 2 +- tools/grib_filter.c | 2 +- tools/grib_filter.h | 2 +- tools/grib_get.c | 2 +- tools/grib_get_data.c | 2 +- tools/grib_histogram.c | 2 +- tools/grib_index_build.c | 2 +- tools/grib_ls.c | 2 +- tools/grib_merge.c | 2 +- tools/grib_nearest_land.c | 2 +- tools/grib_options.c | 2 +- tools/grib_repair.c | 2 +- tools/grib_set.c | 2 +- tools/grib_to_json.c | 2 +- tools/grib_to_netcdf.c | 2 +- tools/grib_tools.c | 2 +- tools/grib_tools.h | 2 +- tools/gts_compare.c | 2 +- tools/gts_copy.c | 2 +- tools/gts_dump.c | 2 +- tools/gts_filter.c | 2 +- tools/gts_get.c | 2 +- tools/gts_ls.c | 2 +- tools/list_keys.c | 2 +- tools/load.c | 2 +- tools/load.h | 2 +- tools/mars_request.c | 2 +- tools/metar_compare.c | 2 +- tools/metar_copy.c | 2 +- tools/metar_dump.c | 2 +- tools/metar_filter.c | 2 +- tools/metar_get.c | 2 +- tools/metar_ls.c | 2 +- tools/taf_dump.c | 2 +- tools/taf_filter.c | 2 +- tools/taf_get.c | 2 +- tools/taf_ls.c | 2 +- tools/test.c | 2 +- tools/wingetopt.c | 2 +- tools/wingetopt.h | 2 +- tools/xref.c | 2 +- 1434 files changed, 1453 insertions(+), 1468 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e94027361..1f49e5516 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/NOTICE b/NOTICE index 27d9f85aa..5d1b6f0f7 100644 --- a/NOTICE +++ b/NOTICE @@ -1,5 +1,5 @@ ECMWF ecCodes -Copyright 2005-2019 ECMWF. +(C) Copyright 2005- ECMWF. This product includes software developed at ECMWF (http://www.ecmwf.int). diff --git a/README.md b/README.md index d84fc865b..0ec2f214c 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ If you encounter any problems please send an e-mail with your problem to: COPYRIGHT AND LICENSE ---------------------- -Copyright 2005-2019 ECMWF. +(C) Copyright 2005- 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. diff --git a/definitions/boot.def b/definitions/boot.def index 069df6900..5287c0308 100644 --- a/definitions/boot.def +++ b/definitions/boot.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/budg/boot.def b/definitions/budg/boot.def index 0d0425db4..bea61a75d 100644 --- a/definitions/budg/boot.def +++ b/definitions/budg/boot.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/budg/mars_labeling.def b/definitions/budg/mars_labeling.def index 56cffed33..5fa826a74 100644 --- a/definitions/budg/mars_labeling.def +++ b/definitions/budg/mars_labeling.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/budg/section.1.def b/definitions/budg/section.1.def index de06ed58b..2a412d313 100644 --- a/definitions/budg/section.1.def +++ b/definitions/budg/section.1.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/budg/section.4.def b/definitions/budg/section.4.def index 8aa36257f..5d1dfe107 100644 --- a/definitions/budg/section.4.def +++ b/definitions/budg/section.4.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/bufr/boot.def b/definitions/bufr/boot.def index 20b680d81..9a48e5325 100644 --- a/definitions/bufr/boot.def +++ b/definitions/bufr/boot.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/bufr/boot_edition_0.def b/definitions/bufr/boot_edition_0.def index 12f7a2578..8820601cd 100644 --- a/definitions/bufr/boot_edition_0.def +++ b/definitions/bufr/boot_edition_0.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. ascii[4] identifier = "BUFR" : read_only,hidden; alias identifier=identifier; diff --git a/definitions/bufr/boot_edition_1.def b/definitions/bufr/boot_edition_1.def index 44f27f999..bbf700062 100644 --- a/definitions/bufr/boot_edition_1.def +++ b/definitions/bufr/boot_edition_1.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. ascii[4] identifier = "BUFR" : read_only,hidden; alias identifier=identifier; diff --git a/definitions/bufr/boot_edition_2.def b/definitions/bufr/boot_edition_2.def index 01d1d228d..88ccefaf1 100644 --- a/definitions/bufr/boot_edition_2.def +++ b/definitions/bufr/boot_edition_2.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. ascii[4] identifier = "BUFR" : read_only,hidden; alias identifier=identifier; diff --git a/definitions/bufr/boot_edition_3.def b/definitions/bufr/boot_edition_3.def index 28216ed3f..a05dd8ea9 100644 --- a/definitions/bufr/boot_edition_3.def +++ b/definitions/bufr/boot_edition_3.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. ascii[4] identifier = "BUFR" : read_only,hidden; alias identifier=identifier; diff --git a/definitions/bufr/boot_edition_4.def b/definitions/bufr/boot_edition_4.def index ee7e14721..0f8fa73ac 100644 --- a/definitions/bufr/boot_edition_4.def +++ b/definitions/bufr/boot_edition_4.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. ascii[4] identifier = "BUFR" : read_only,hidden; alias identifier=identifier; diff --git a/definitions/bufr/old_section.1.def b/definitions/bufr/old_section.1.def index d638808e5..5530219e4 100644 --- a/definitions/bufr/old_section.1.def +++ b/definitions/bufr/old_section.1.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. codetable[2] originatingCentre 'common/c-1.table' : dump; unsigned[1] updateSequenceNumber; diff --git a/definitions/bufr/section.0.def b/definitions/bufr/section.0.def index 625d8e596..b9eeb3fe1 100644 --- a/definitions/bufr/section.0.def +++ b/definitions/bufr/section.0.def @@ -1,3 +1,3 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. label empty; diff --git a/definitions/bufr/section.1.1.def b/definitions/bufr/section.1.1.def index 5aade0f44..04e44737c 100644 --- a/definitions/bufr/section.1.1.def +++ b/definitions/bufr/section.1.1.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. codetable[2] bufrHeaderCentre 'common/c-1.table' : dump; unsigned[1] updateSequenceNumber; diff --git a/definitions/bufr/section.1.2.def b/definitions/bufr/section.1.2.def index 44b978305..ee165e9f4 100644 --- a/definitions/bufr/section.1.2.def +++ b/definitions/bufr/section.1.2.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. position offsetSection1; section_length[3] section1Length ; diff --git a/definitions/bufr/section.1.3.def b/definitions/bufr/section.1.3.def index 8236b867e..ab28a1b45 100644 --- a/definitions/bufr/section.1.3.def +++ b/definitions/bufr/section.1.3.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. position offsetSection1; section_length[3] section1Length ; diff --git a/definitions/bufr/section.1.4.def b/definitions/bufr/section.1.4.def index 8287a5082..2d3e67c3d 100644 --- a/definitions/bufr/section.1.4.def +++ b/definitions/bufr/section.1.4.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. position offsetSection1; section_length[3] section1Length ; diff --git a/definitions/bufr/section.2.def b/definitions/bufr/section.2.def index 05a55748c..c3ce4c36d 100644 --- a/definitions/bufr/section.2.def +++ b/definitions/bufr/section.2.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. section_length[3] section2Length; unsigned[1] reservedSection2 = 0; diff --git a/definitions/bufr/section.3.def b/definitions/bufr/section.3.def index 0264a4acd..49ac2fa74 100644 --- a/definitions/bufr/section.3.def +++ b/definitions/bufr/section.3.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. constant defaultSequence=0; constant tablesMasterDir="bufr/tables/[masterTableNumber]/wmo/[masterTablesVersionNumber]" : hidden; diff --git a/definitions/bufr/section.4.def b/definitions/bufr/section.4.def index 8fe6aed57..ce17a1aa7 100644 --- a/definitions/bufr/section.4.def +++ b/definitions/bufr/section.4.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. position offsetSection4; section_length[3] section4Length ; diff --git a/definitions/bufr/section.5.def b/definitions/bufr/section.5.def index 11d7381f6..3973ad636 100644 --- a/definitions/bufr/section.5.def +++ b/definitions/bufr/section.5.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. constant section5Length=4; ascii[4] '7777' = "7777" : read_only; diff --git a/definitions/check_grib_defs.pl b/definitions/check_grib_defs.pl index e346f973f..59734fa3d 100755 --- a/definitions/check_grib_defs.pl +++ b/definitions/check_grib_defs.pl @@ -1,7 +1,7 @@ #!/usr/bin/env perl # -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/common/statistics_grid.def b/definitions/common/statistics_grid.def index fba296d80..b99ed6283 100644 --- a/definitions/common/statistics_grid.def +++ b/definitions/common/statistics_grid.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/common/statistics_spectral.def b/definitions/common/statistics_spectral.def index 4e3f74b9b..47dc27bb3 100644 --- a/definitions/common/statistics_spectral.def +++ b/definitions/common/statistics_spectral.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/diag/boot.def b/definitions/diag/boot.def index a4b3f4eb0..afc37ea86 100644 --- a/definitions/diag/boot.def +++ b/definitions/diag/boot.def @@ -1,4 +1,4 @@ -## Copyright 2005-2019 ECMWF. +## (C) Copyright 2005- ECMWF. position startOfHeaders; ascii[4] identifier; diff --git a/definitions/diag/section.1.def b/definitions/diag/section.1.def index 1fd931c43..be6ea41a3 100644 --- a/definitions/diag/section.1.def +++ b/definitions/diag/section.1.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. section_length[3] section1Length ; diff --git a/definitions/diag/section.4.def b/definitions/diag/section.4.def index 63b1dd5d1..676eb6fae 100644 --- a/definitions/diag/section.4.def +++ b/definitions/diag/section.4.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. section_length[3] section4Length ; diff --git a/definitions/grib1/boot.def b/definitions/grib1/boot.def index 09a57a17b..df8ea9aa9 100644 --- a/definitions/grib1/boot.def +++ b/definitions/grib1/boot.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib1/data.grid_ieee.def b/definitions/grib1/data.grid_ieee.def index 4c176144a..be40b7ea5 100644 --- a/definitions/grib1/data.grid_ieee.def +++ b/definitions/grib1/data.grid_ieee.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # moved here to allow different bitsPerValue in second order packing unsigned[1] bitsPerValue : dump ; diff --git a/definitions/grib1/data.grid_second_order.def b/definitions/grib1/data.grid_second_order.def index ca879e20a..d517d26b8 100644 --- a/definitions/grib1/data.grid_second_order.def +++ b/definitions/grib1/data.grid_second_order.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. unsigned [2] N2 : dump; unsigned [2] codedNumberOfGroups : no_copy ; diff --git a/definitions/grib1/data.grid_second_order_constant_width.def b/definitions/grib1/data.grid_second_order_constant_width.def index bfe2e1771..9feeade6b 100644 --- a/definitions/grib1/data.grid_second_order_constant_width.def +++ b/definitions/grib1/data.grid_second_order_constant_width.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. unsigned [2] N2 : dump; unsigned [2] codedNumberOfFirstOrderPackedValues : no_copy ; diff --git a/definitions/grib1/data.grid_second_order_general_grib1.def b/definitions/grib1/data.grid_second_order_general_grib1.def index 65c88d9f1..7548225a2 100644 --- a/definitions/grib1/data.grid_second_order_general_grib1.def +++ b/definitions/grib1/data.grid_second_order_general_grib1.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. unsigned [2] N2 : dump; unsigned [2] codedNumberOfFirstOrderPackedValues : no_copy ; diff --git a/definitions/grib1/data.grid_second_order_row_by_row.def b/definitions/grib1/data.grid_second_order_row_by_row.def index 44f13a990..8368f4430 100644 --- a/definitions/grib1/data.grid_second_order_row_by_row.def +++ b/definitions/grib1/data.grid_second_order_row_by_row.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. unsigned [2] N2 : dump; unsigned [2] codedNumberOfFirstOrderPackedValues : no_copy ; diff --git a/definitions/grib1/data.grid_simple.def b/definitions/grib1/data.grid_simple.def index e85aac147..638d3cb2a 100644 --- a/definitions/grib1/data.grid_simple.def +++ b/definitions/grib1/data.grid_simple.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # moved here to allow different bitsPerValue in second order packing unsigned[1] bitsPerValue : dump ; diff --git a/definitions/grib1/data.grid_simple_matrix.def b/definitions/grib1/data.grid_simple_matrix.def index e8d1def10..d63a19826 100644 --- a/definitions/grib1/data.grid_simple_matrix.def +++ b/definitions/grib1/data.grid_simple_matrix.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. #used in packing constant constantFieldHalfByte=0; diff --git a/definitions/grib1/data.spectral_complex.def b/definitions/grib1/data.spectral_complex.def index f3897fc6e..ebdf60d42 100644 --- a/definitions/grib1/data.spectral_complex.def +++ b/definitions/grib1/data.spectral_complex.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # moved here to allow different bitsPerValue in second order packing unsigned[1] bitsPerValue : dump ; diff --git a/definitions/grib1/data.spectral_ieee.def b/definitions/grib1/data.spectral_ieee.def index e95a3e85d..21a083e26 100644 --- a/definitions/grib1/data.spectral_ieee.def +++ b/definitions/grib1/data.spectral_ieee.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # moved here to allow different bitsPerValue in second order packing unsigned[1] bitsPerValue : dump ; diff --git a/definitions/grib1/data.spectral_simple.def b/definitions/grib1/data.spectral_simple.def index 47d59d8c1..939f1d642 100644 --- a/definitions/grib1/data.spectral_simple.def +++ b/definitions/grib1/data.spectral_simple.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # moved here to allow different bitsPerValue in second order packing unsigned[1] bitsPerValue : dump ; diff --git a/definitions/grib1/gds_not_present_bitmap.def b/definitions/grib1/gds_not_present_bitmap.def index 785fb9c25..735087dc8 100644 --- a/definitions/grib1/gds_not_present_bitmap.def +++ b/definitions/grib1/gds_not_present_bitmap.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # SECTION 3, Bit-map section position offsetSection3; diff --git a/definitions/grib1/grid_21.def b/definitions/grib1/grid_21.def index 72b6d4d69..79d552a48 100644 --- a/definitions/grib1/grid_21.def +++ b/definitions/grib1/grid_21.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Predefined grid 21 diff --git a/definitions/grib1/grid_22.def b/definitions/grib1/grid_22.def index da413efae..c9c0dd78d 100644 --- a/definitions/grib1/grid_22.def +++ b/definitions/grib1/grid_22.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Predefined grid 22 diff --git a/definitions/grib1/grid_23.def b/definitions/grib1/grid_23.def index 54c7863fc..0d24337c3 100644 --- a/definitions/grib1/grid_23.def +++ b/definitions/grib1/grid_23.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Predefined grid 23 diff --git a/definitions/grib1/grid_24.def b/definitions/grib1/grid_24.def index 8514c553f..15d582e44 100644 --- a/definitions/grib1/grid_24.def +++ b/definitions/grib1/grid_24.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Predefined grid 24 diff --git a/definitions/grib1/grid_25.def b/definitions/grib1/grid_25.def index 5638329d0..07ab7f8c8 100644 --- a/definitions/grib1/grid_25.def +++ b/definitions/grib1/grid_25.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Predefined grid 25 diff --git a/definitions/grib1/grid_26.def b/definitions/grib1/grid_26.def index 87dc3d8b9..746b9f8ed 100644 --- a/definitions/grib1/grid_26.def +++ b/definitions/grib1/grid_26.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Predefined grid 26 diff --git a/definitions/grib1/grid_61.def b/definitions/grib1/grid_61.def index 593bf64e9..625fd7be7 100644 --- a/definitions/grib1/grid_61.def +++ b/definitions/grib1/grid_61.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Predefined grid 61 diff --git a/definitions/grib1/grid_62.def b/definitions/grib1/grid_62.def index b7ff7ec41..3c62c810f 100644 --- a/definitions/grib1/grid_62.def +++ b/definitions/grib1/grid_62.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Predefined grid 62 diff --git a/definitions/grib1/grid_63.def b/definitions/grib1/grid_63.def index f3e6d3529..c1d037638 100644 --- a/definitions/grib1/grid_63.def +++ b/definitions/grib1/grid_63.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Predefined grid 63 diff --git a/definitions/grib1/grid_64.def b/definitions/grib1/grid_64.def index e0b29e6ef..dd1ecf8b8 100644 --- a/definitions/grib1/grid_64.def +++ b/definitions/grib1/grid_64.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Predefined grid 21 constant Ni = 91; diff --git a/definitions/grib1/grid_definition_0.def b/definitions/grib1/grid_definition_0.def index 3c51fcd65..1c7b4df6e 100644 --- a/definitions/grib1/grid_definition_0.def +++ b/definitions/grib1/grid_definition_0.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # GRID DEFINITION latitude/longitude grid - equidistant cylindrical or Plate Carree projection diff --git a/definitions/grib1/grid_definition_1.def b/definitions/grib1/grid_definition_1.def index a17f95d0c..5f179a108 100644 --- a/definitions/grib1/grid_definition_1.def +++ b/definitions/grib1/grid_definition_1.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # GRID DEFINITION Mercator projection # grib 1 -> 2 diff --git a/definitions/grib1/grid_definition_10.def b/definitions/grib1/grid_definition_10.def index ecee84311..221dee564 100644 --- a/definitions/grib1/grid_definition_10.def +++ b/definitions/grib1/grid_definition_10.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # GRID DEFINITION rotated latitude/longitude grid # grib 1 -> 2 diff --git a/definitions/grib1/grid_definition_13.def b/definitions/grib1/grid_definition_13.def index 8d0a38216..ffc42abac 100644 --- a/definitions/grib1/grid_definition_13.def +++ b/definitions/grib1/grid_definition_13.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # GRID DEFINITION Oblique Lambert conformal, secant or tangent, conic or bi-polar # grib 1 -> 2 diff --git a/definitions/grib1/grid_definition_14.def b/definitions/grib1/grid_definition_14.def index 64c21a0d4..3249069a5 100644 --- a/definitions/grib1/grid_definition_14.def +++ b/definitions/grib1/grid_definition_14.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # GRID DEFINITION Rotated Gaussian latitude/longitude grid # grib 1 -> 2 diff --git a/definitions/grib1/grid_definition_192.78.def b/definitions/grib1/grid_definition_192.78.def index 5ad78b027..e70f7019a 100755 --- a/definitions/grib1/grid_definition_192.78.def +++ b/definitions/grib1/grid_definition_192.78.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # DWD local grid definition 192 - triangular grid base on icosahedron subdivision diff --git a/definitions/grib1/grid_definition_192.98.def b/definitions/grib1/grid_definition_192.98.def index 9cc9af7c8..380328e88 100644 --- a/definitions/grib1/grid_definition_192.98.def +++ b/definitions/grib1/grid_definition_192.98.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # GRID DEFINITION ocean ECMWF convention diff --git a/definitions/grib1/grid_definition_193.98.def b/definitions/grib1/grid_definition_193.98.def index 1f4bcac03..c824b8465 100644 --- a/definitions/grib1/grid_definition_193.98.def +++ b/definitions/grib1/grid_definition_193.98.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # GRID DEFINITION quasi-regular latitude/longitude grid # grib 1 -> 2 diff --git a/definitions/grib1/grid_definition_20.def b/definitions/grib1/grid_definition_20.def index 70c7d9c1c..9f742b254 100644 --- a/definitions/grib1/grid_definition_20.def +++ b/definitions/grib1/grid_definition_20.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # GRID DEFINITION stretched latitude/longitude grid # grib 1 -> 2 diff --git a/definitions/grib1/grid_definition_24.def b/definitions/grib1/grid_definition_24.def index 6e9b6ecb4..314b4b86e 100644 --- a/definitions/grib1/grid_definition_24.def +++ b/definitions/grib1/grid_definition_24.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # GRID DEFINITION Stretched Gaussian latitude/longitude grid # grib 1 -> 2 diff --git a/definitions/grib1/grid_definition_3.def b/definitions/grib1/grid_definition_3.def index a10647997..86d1bfc7d 100644 --- a/definitions/grib1/grid_definition_3.def +++ b/definitions/grib1/grid_definition_3.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # GRID DEFINITION Lambert conformal, secant or tangent, conic or bi-polar # grib 1 -> 2 diff --git a/definitions/grib1/grid_definition_30.def b/definitions/grib1/grid_definition_30.def index ab1560774..e3b61a6e1 100644 --- a/definitions/grib1/grid_definition_30.def +++ b/definitions/grib1/grid_definition_30.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # GRID DEFINITION stretched and rotated latitude/longitude grids # grib 1 -> 2 diff --git a/definitions/grib1/grid_definition_34.def b/definitions/grib1/grid_definition_34.def index da4daab4c..252a8e06c 100644 --- a/definitions/grib1/grid_definition_34.def +++ b/definitions/grib1/grid_definition_34.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # GRID DEFINITION Stretched and rotated Gaussian latitude/longitude grids # grib 1 -> 2 diff --git a/definitions/grib1/grid_definition_4.def b/definitions/grib1/grid_definition_4.def index 109405499..12756280b 100644 --- a/definitions/grib1/grid_definition_4.def +++ b/definitions/grib1/grid_definition_4.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # GRID DEFINITION Gaussian latitude/longitude grid # grib 1 -> 2 diff --git a/definitions/grib1/grid_definition_50.def b/definitions/grib1/grid_definition_50.def index 6bc67bec8..d46a7b229 100644 --- a/definitions/grib1/grid_definition_50.def +++ b/definitions/grib1/grid_definition_50.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # GRID DEFINITION Spherical harmonic coefficients # grib 1 -> 2 diff --git a/definitions/grib1/grid_definition_60.def b/definitions/grib1/grid_definition_60.def index 7cf296c16..0b5efc40d 100644 --- a/definitions/grib1/grid_definition_60.def +++ b/definitions/grib1/grid_definition_60.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # GRID DEFINITION Rotated spherical harmonic coefficients # grib 1 -> 2 diff --git a/definitions/grib1/grid_definition_70.def b/definitions/grib1/grid_definition_70.def index 6578e61f1..7a510373f 100644 --- a/definitions/grib1/grid_definition_70.def +++ b/definitions/grib1/grid_definition_70.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # GRID DEFINITION Stretched spherical harmonics diff --git a/definitions/grib1/grid_definition_8.def b/definitions/grib1/grid_definition_8.def index c59efca65..82dac3813 100644 --- a/definitions/grib1/grid_definition_8.def +++ b/definitions/grib1/grid_definition_8.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # GRID DEFINITION Albers equal area, secant or tangent, conic or bi-polar # grib 1 -> 2 diff --git a/definitions/grib1/grid_definition_80.def b/definitions/grib1/grid_definition_80.def index e8871aa9f..a85b9ae48 100644 --- a/definitions/grib1/grid_definition_80.def +++ b/definitions/grib1/grid_definition_80.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # GRID DEFINITION Stretched and rotated spherical harmonic coefficients diff --git a/definitions/grib1/grid_first_last_resandcomp.def b/definitions/grib1/grid_first_last_resandcomp.def index 01bea9897..268e63131 100644 --- a/definitions/grib1/grid_first_last_resandcomp.def +++ b/definitions/grib1/grid_first_last_resandcomp.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # La1 - latitude of first grid point signed[3] latitudeOfFirstGridPoint : edition_specific; diff --git a/definitions/grib1/grid_rotation.def b/definitions/grib1/grid_rotation.def index 7834804f4..d94cf8e8b 100644 --- a/definitions/grib1/grid_rotation.def +++ b/definitions/grib1/grid_rotation.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. signed[3] latitudeOfSouthernPole : edition_specific; meta geography.latitudeOfSouthernPoleInDegrees scale(latitudeOfSouthernPole ,oneConstant,grib1divider,truncateDegrees) : dump; diff --git a/definitions/grib1/grid_stretching.def b/definitions/grib1/grid_stretching.def index bbb51501d..fac62e6da 100644 --- a/definitions/grib1/grid_stretching.def +++ b/definitions/grib1/grid_stretching.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. signed[3] latitudeOfStretchingPole : edition_specific,no_copy; signed[3] longitudeOfStretchingPole : edition_specific,no_copy; diff --git a/definitions/grib1/local.1.def b/definitions/grib1/local.1.def index f4774c79d..3c758b207 100644 --- a/definitions/grib1/local.1.def +++ b/definitions/grib1/local.1.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Definition for BOM , same as ECWF unsigned[1] localDefinitionNumber = 1 : dump; diff --git a/definitions/grib1/local.214.1.def b/definitions/grib1/local.214.1.def index e46bf903b..092bf992a 100644 --- a/definitions/grib1/local.214.1.def +++ b/definitions/grib1/local.214.1.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # START 1/local.98.1 ---------------------------------------------------------------------- # LOCAL 98 1 diff --git a/definitions/grib1/local.214.244.def b/definitions/grib1/local.214.244.def index 62f758f33..20831ab81 100644 --- a/definitions/grib1/local.214.244.def +++ b/definitions/grib1/local.214.244.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # START 1/local.98.244 ---------------------------------------------------------------------- # LOCAL 214 98 244 diff --git a/definitions/grib1/local.214.245.def b/definitions/grib1/local.214.245.def index a856e52f8..6ed1e2f17 100644 --- a/definitions/grib1/local.214.245.def +++ b/definitions/grib1/local.214.245.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # START 1/local.98.245 ---------------------------------------------------------------------- # LOCAL 214 98 245 diff --git a/definitions/grib1/local.253.def b/definitions/grib1/local.253.def index 9aed270c7..f5e86ea01 100644 --- a/definitions/grib1/local.253.def +++ b/definitions/grib1/local.253.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. label "local.253.def"; diff --git a/definitions/grib1/local.254.def b/definitions/grib1/local.254.def index 7b64af437..e7dde6ead 100644 --- a/definitions/grib1/local.254.def +++ b/definitions/grib1/local.254.def @@ -1,3 +1,3 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. label "EUMETSAT local definition (unknown)"; diff --git a/definitions/grib1/local.46.def b/definitions/grib1/local.46.def index 41896029a..3594d4c37 100644 --- a/definitions/grib1/local.46.def +++ b/definitions/grib1/local.46.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. label "CPTEC local definition"; # Same as NCEP diff --git a/definitions/grib1/local.54.def b/definitions/grib1/local.54.def index 9df64f198..1347570cf 100644 --- a/definitions/grib1/local.54.def +++ b/definitions/grib1/local.54.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. label "CMC local definition (Canada)"; # START 1/local.54 -------------------------------------------------------------------- diff --git a/definitions/grib1/local.7.1.def b/definitions/grib1/local.7.1.def index dac8b6a13..8d828cec1 100644 --- a/definitions/grib1/local.7.1.def +++ b/definitions/grib1/local.7.1.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # KWBC localDefinitionTemplate_001 # -------------------------------- diff --git a/definitions/grib1/local.80.def b/definitions/grib1/local.80.def index b981f7dd3..46b49ca77 100644 --- a/definitions/grib1/local.80.def +++ b/definitions/grib1/local.80.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. #Local definition for Rome label "Local definition for Rome CNMC"; diff --git a/definitions/grib1/local.98.1.def b/definitions/grib1/local.98.1.def index 3bdaa03bc..d06ea2f20 100644 --- a/definitions/grib1/local.98.1.def +++ b/definitions/grib1/local.98.1.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. constant GRIBEXSection1Problem = 52 - section1Length ; diff --git a/definitions/grib1/local.98.10.def b/definitions/grib1/local.98.10.def index 28a3d6d54..625026d06 100644 --- a/definitions/grib1/local.98.10.def +++ b/definitions/grib1/local.98.10.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. constant GRIBEXSection1Problem = 334 - section1Length ; template mars_labeling "grib1/mars_labeling.def"; diff --git a/definitions/grib1/local.98.11.def b/definitions/grib1/local.98.11.def index a7a8895c3..658c8ba8d 100644 --- a/definitions/grib1/local.98.11.def +++ b/definitions/grib1/local.98.11.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. constant GRIBEXSection1Problem = 72 - section1Length ; diff --git a/definitions/grib1/local.98.12.def b/definitions/grib1/local.98.12.def index d78d0e4cb..b1705045b 100644 --- a/definitions/grib1/local.98.12.def +++ b/definitions/grib1/local.98.12.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Seasonal forecast monthly mean data for lagged systems diff --git a/definitions/grib1/local.98.13.def b/definitions/grib1/local.98.13.def index 356141066..84acafb64 100644 --- a/definitions/grib1/local.98.13.def +++ b/definitions/grib1/local.98.13.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. template mars_labeling "grib1/mars_labeling.def"; diff --git a/definitions/grib1/local.98.14.def b/definitions/grib1/local.98.14.def index 63d8fdf5d..ad0901a49 100644 --- a/definitions/grib1/local.98.14.def +++ b/definitions/grib1/local.98.14.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. constant GRIBEXSection1Problem = 1080 - section1Length ; diff --git a/definitions/grib1/local.98.15.def b/definitions/grib1/local.98.15.def index a9fc4ec4a..3a66d9e64 100644 --- a/definitions/grib1/local.98.15.def +++ b/definitions/grib1/local.98.15.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # used in local definition 13 constant GRIBEXSection1Problem = 60 - section1Length ; diff --git a/definitions/grib1/local.98.16.def b/definitions/grib1/local.98.16.def index fccb2612c..4e5f184cd 100644 --- a/definitions/grib1/local.98.16.def +++ b/definitions/grib1/local.98.16.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Seasonal forecast monthly mean data diff --git a/definitions/grib1/local.98.17.def b/definitions/grib1/local.98.17.def index 60af7f190..e5ea33c3c 100644 --- a/definitions/grib1/local.98.17.def +++ b/definitions/grib1/local.98.17.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. template mars_labeling "grib1/mars_labeling.def"; diff --git a/definitions/grib1/local.98.18.def b/definitions/grib1/local.98.18.def index c9f8a6107..a7dd80414 100644 --- a/definitions/grib1/local.98.18.def +++ b/definitions/grib1/local.98.18.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. constant GRIBEXSection1Problem = 120 - section1Length ; diff --git a/definitions/grib1/local.98.19.def b/definitions/grib1/local.98.19.def index 8a6a97d55..c93438c7b 100644 --- a/definitions/grib1/local.98.19.def +++ b/definitions/grib1/local.98.19.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. template mars_labeling "grib1/mars_labeling.def"; diff --git a/definitions/grib1/local.98.190.def b/definitions/grib1/local.98.190.def index 1eafb51a7..c9d3c5eda 100644 --- a/definitions/grib1/local.98.190.def +++ b/definitions/grib1/local.98.190.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. constant GRIBEXSection1Problem = 0 ; diff --git a/definitions/grib1/local.98.191.def b/definitions/grib1/local.98.191.def index f32cdd5a1..b22c2f961 100644 --- a/definitions/grib1/local.98.191.def +++ b/definitions/grib1/local.98.191.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. template mars_labeling "grib1/mars_labeling.def"; diff --git a/definitions/grib1/local.98.192.def b/definitions/grib1/local.98.192.def index e65fe5cb1..b822d1d89 100644 --- a/definitions/grib1/local.98.192.def +++ b/definitions/grib1/local.98.192.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # The mars labeling must be inline # template mars_labeling "grib1/mars_labeling.def"; diff --git a/definitions/grib1/local.98.2.def b/definitions/grib1/local.98.2.def index d14fa6906..1dbe247c7 100644 --- a/definitions/grib1/local.98.2.def +++ b/definitions/grib1/local.98.2.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. constant GRIBEXSection1Problem = 328 - section1Length ; diff --git a/definitions/grib1/local.98.20.def b/definitions/grib1/local.98.20.def index f5014a5c5..4e114e911 100644 --- a/definitions/grib1/local.98.20.def +++ b/definitions/grib1/local.98.20.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. constant GRIBEXSection1Problem = 52 - section1Length ; diff --git a/definitions/grib1/local.98.21.def b/definitions/grib1/local.98.21.def index 3d2192684..e10f108da 100644 --- a/definitions/grib1/local.98.21.def +++ b/definitions/grib1/local.98.21.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. constant GRIBEXSection1Problem = 100 - section1Length ; diff --git a/definitions/grib1/local.98.218.def b/definitions/grib1/local.98.218.def index 4c7893c71..c6787e258 100644 --- a/definitions/grib1/local.98.218.def +++ b/definitions/grib1/local.98.218.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. constant GRIBEXSection1Problem = 120 - section1Length ; diff --git a/definitions/grib1/local.98.23.def b/definitions/grib1/local.98.23.def index ce8761fd8..f23fce2be 100644 --- a/definitions/grib1/local.98.23.def +++ b/definitions/grib1/local.98.23.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. constant GRIBEXSection1Problem = 84 - section1Length ; diff --git a/definitions/grib1/local.98.24.def b/definitions/grib1/local.98.24.def index e2fc29be8..32f9341af 100644 --- a/definitions/grib1/local.98.24.def +++ b/definitions/grib1/local.98.24.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. constant GRIBEXSection1Problem = 56 - section1Length ; diff --git a/definitions/grib1/local.98.25.def b/definitions/grib1/local.98.25.def index 64d636017..21b178918 100644 --- a/definitions/grib1/local.98.25.def +++ b/definitions/grib1/local.98.25.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. template mars_labeling "grib1/mars_labeling.def"; diff --git a/definitions/grib1/local.98.26.def b/definitions/grib1/local.98.26.def index fa17db14a..83025d4bd 100644 --- a/definitions/grib1/local.98.26.def +++ b/definitions/grib1/local.98.26.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. constant GRIBEXSection1Problem = 69 - section1Length ; diff --git a/definitions/grib1/local.98.27.def b/definitions/grib1/local.98.27.def index 07b5adc55..345f41f77 100644 --- a/definitions/grib1/local.98.27.def +++ b/definitions/grib1/local.98.27.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. constant GRIBEXSection1Problem = 107 - section1Length ; diff --git a/definitions/grib1/local.98.28.def b/definitions/grib1/local.98.28.def index d27a850a8..8b4ad9084 100644 --- a/definitions/grib1/local.98.28.def +++ b/definitions/grib1/local.98.28.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # information about probabilities (they have already probabilities) # information about clustering (they save it as ASCII, at the moment...) diff --git a/definitions/grib1/local.98.29.def b/definitions/grib1/local.98.29.def index 63f404e1d..3b4cf72a5 100644 --- a/definitions/grib1/local.98.29.def +++ b/definitions/grib1/local.98.29.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. constant GRIBEXSection1Problem = 960 - section1Length ; diff --git a/definitions/grib1/local.98.3.def b/definitions/grib1/local.98.3.def index b87a3b311..66838992b 100644 --- a/definitions/grib1/local.98.3.def +++ b/definitions/grib1/local.98.3.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. constant GRIBEXSection1Problem = 52 - section1Length ; diff --git a/definitions/grib1/local.98.30.def b/definitions/grib1/local.98.30.def index b03e248c3..952bf2f67 100644 --- a/definitions/grib1/local.98.30.def +++ b/definitions/grib1/local.98.30.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Forecasting Systems with Variable Resolution constant GRIBEXSection1Problem = 106 - section1Length ; diff --git a/definitions/grib1/local.98.31.def b/definitions/grib1/local.98.31.def index 87a889761..e565832b3 100644 --- a/definitions/grib1/local.98.31.def +++ b/definitions/grib1/local.98.31.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. constant GRIBEXSection1Problem = 240 - section1Length ; diff --git a/definitions/grib1/local.98.32.def b/definitions/grib1/local.98.32.def index 9827de382..4e90083fd 100644 --- a/definitions/grib1/local.98.32.def +++ b/definitions/grib1/local.98.32.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. constant GRIBEXSection1Problem = 328 - section1Length ; diff --git a/definitions/grib1/local.98.33.def b/definitions/grib1/local.98.33.def index 558d8f3a8..20fe3936e 100644 --- a/definitions/grib1/local.98.33.def +++ b/definitions/grib1/local.98.33.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. template mars_labeling "grib1/mars_labeling.def"; diff --git a/definitions/grib1/local.98.35.def b/definitions/grib1/local.98.35.def index 415f3a889..62e5dfcda 100644 --- a/definitions/grib1/local.98.35.def +++ b/definitions/grib1/local.98.35.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. constant GRIBEXSection1Problem = 120 - section1Length ; diff --git a/definitions/grib1/local.98.36.def b/definitions/grib1/local.98.36.def index 7967e8430..fbffd4600 100644 --- a/definitions/grib1/local.98.36.def +++ b/definitions/grib1/local.98.36.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. constant GRIBEXSection1Problem = 56 - section1Length ; diff --git a/definitions/grib1/local.98.37.def b/definitions/grib1/local.98.37.def index 099196e9a..c4db38667 100644 --- a/definitions/grib1/local.98.37.def +++ b/definitions/grib1/local.98.37.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. constant GRIBEXSection1Problem = 1080 - section1Length ; diff --git a/definitions/grib1/local.98.38.def b/definitions/grib1/local.98.38.def index aafcff7d3..74cb02ea4 100644 --- a/definitions/grib1/local.98.38.def +++ b/definitions/grib1/local.98.38.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. constant GRIBEXSection1Problem = 56 - section1Length ; diff --git a/definitions/grib1/local.98.39.def b/definitions/grib1/local.98.39.def index 6898b11f2..f59c67f3e 100644 --- a/definitions/grib1/local.98.39.def +++ b/definitions/grib1/local.98.39.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. template mars_labeling "grib1/mars_labeling.def"; diff --git a/definitions/grib1/local.98.4.def b/definitions/grib1/local.98.4.def index 102d533c7..bf4c18270 100644 --- a/definitions/grib1/local.98.4.def +++ b/definitions/grib1/local.98.4.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. constant GRIBEXSection1Problem = 0 ; diff --git a/definitions/grib1/local.98.40.def b/definitions/grib1/local.98.40.def index 79290e447..b32ba65b7 100644 --- a/definitions/grib1/local.98.40.def +++ b/definitions/grib1/local.98.40.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. constant GRIBEXSection1Problem = 56 - section1Length ; diff --git a/definitions/grib1/local.98.49.def b/definitions/grib1/local.98.49.def index 0124cec40..6a8543b0b 100644 --- a/definitions/grib1/local.98.49.def +++ b/definitions/grib1/local.98.49.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. template mars_labeling "grib1/mars_labeling.def"; diff --git a/definitions/grib1/local.98.5.def b/definitions/grib1/local.98.5.def index e51fb8c04..a152d85cf 100644 --- a/definitions/grib1/local.98.5.def +++ b/definitions/grib1/local.98.5.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. constant GRIBEXSection1Problem = 58 - section1Length ; diff --git a/definitions/grib1/local.98.50.def b/definitions/grib1/local.98.50.def index 3b3ca6947..182d6fe3c 100644 --- a/definitions/grib1/local.98.50.def +++ b/definitions/grib1/local.98.50.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. constant GRIBEXSection1Problem = 300 - section1Length ; diff --git a/definitions/grib1/local.98.6.def b/definitions/grib1/local.98.6.def index 4944d6478..8e3ed4911 100644 --- a/definitions/grib1/local.98.6.def +++ b/definitions/grib1/local.98.6.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. template mars_labeling "grib1/mars_labeling.def"; diff --git a/definitions/grib1/local.98.7.def b/definitions/grib1/local.98.7.def index 61928b900..9b15b410b 100644 --- a/definitions/grib1/local.98.7.def +++ b/definitions/grib1/local.98.7.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # 1-> 2 alias grib2LocalSectionPresent=present; diff --git a/definitions/grib1/local.98.8.def b/definitions/grib1/local.98.8.def index d67be8e7e..b2878870d 100644 --- a/definitions/grib1/local.98.8.def +++ b/definitions/grib1/local.98.8.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. constant GRIBEXSection1Problem = 62 - section1Length ; diff --git a/definitions/grib1/local.98.9.def b/definitions/grib1/local.98.9.def index e61e60e5c..a3d37151b 100644 --- a/definitions/grib1/local.98.9.def +++ b/definitions/grib1/local.98.9.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # 1-> 2 alias grib2LocalSectionPresent=present; diff --git a/definitions/grib1/local.98.def b/definitions/grib1/local.98.def index c54d53c4f..3fcd6e691 100644 --- a/definitions/grib1/local.98.def +++ b/definitions/grib1/local.98.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. unsigned[1] localDefinitionNumber = 1 : dump,edition_specific,no_copy; template localDefinition "grib1/local.[centre:l].[localDefinitionNumber:l].def"; diff --git a/definitions/grib1/mars_labeling.23.def b/definitions/grib1/mars_labeling.23.def index 42295f9ea..d373496bc 100644 --- a/definitions/grib1/mars_labeling.23.def +++ b/definitions/grib1/mars_labeling.23.def @@ -1 +1 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. diff --git a/definitions/grib1/section.0.def b/definitions/grib1/section.0.def index 1965b8610..dd4673c13 100644 --- a/definitions/grib1/section.0.def +++ b/definitions/grib1/section.0.def @@ -1,3 +1,3 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. label "_empty"; diff --git a/definitions/grib1/section.5.def b/definitions/grib1/section.5.def index 7fc5f995b..3e019b5ee 100644 --- a/definitions/grib1/section.5.def +++ b/definitions/grib1/section.5.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. position offsetSection5; constant section5Length=4; diff --git a/definitions/grib2/boot.def b/definitions/grib2/boot.def index 70a340824..97ef6f90a 100644 --- a/definitions/grib2/boot.def +++ b/definitions/grib2/boot.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib2/boot_multifield.def b/definitions/grib2/boot_multifield.def index 8e8ec3066..5684aa588 100644 --- a/definitions/grib2/boot_multifield.def +++ b/definitions/grib2/boot_multifield.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib2/local.98.41.def b/definitions/grib2/local.98.41.def index c3f123f18..604dcf36b 100644 --- a/definitions/grib2/local.98.41.def +++ b/definitions/grib2/local.98.41.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Local definition 41 - The European Flood Awareness System diff --git a/definitions/grib2/local.98.42.def b/definitions/grib2/local.98.42.def index 5983a8c20..1bb73af47 100644 --- a/definitions/grib2/local.98.42.def +++ b/definitions/grib2/local.98.42.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Definition 42 - WMO Lead Centre for Wave Forecast Verification (LC-WFV) diff --git a/definitions/grib2/local.98.5.def b/definitions/grib2/local.98.5.def index e06d51f60..19ab34188 100644 --- a/definitions/grib2/local.98.5.def +++ b/definitions/grib2/local.98.5.def @@ -1,3 +1,3 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. label "_empty section"; diff --git a/definitions/grib2/local.98.7.def b/definitions/grib2/local.98.7.def index cd165cc2f..66cf69195 100644 --- a/definitions/grib2/local.98.7.def +++ b/definitions/grib2/local.98.7.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. unsigned[1] iterationNumber : dump; alias number=iterationNumber; diff --git a/definitions/grib2/local.98.9.def b/definitions/grib2/local.98.9.def index ea683989a..7f9f0c989 100644 --- a/definitions/grib2/local.98.9.def +++ b/definitions/grib2/local.98.9.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. unsigned[2] forecastOrSingularVectorNumber : dump; diff --git a/definitions/grib2/mars_labeling.def b/definitions/grib2/mars_labeling.def index fdf0415df..6905210ce 100644 --- a/definitions/grib2/mars_labeling.def +++ b/definitions/grib2/mars_labeling.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. codetable[2] marsClass "mars/class.table" = "od" : dump,string_type,lowercase; codetable[2] marsType "mars/type.table" = "an" : dump,string_type,no_fail,lowercase; diff --git a/definitions/grib2/meta.def b/definitions/grib2/meta.def index e7f5a2945..baa49b8f2 100644 --- a/definitions/grib2/meta.def +++ b/definitions/grib2/meta.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. label "_Empty file"; diff --git a/definitions/grib2/parameters.def b/definitions/grib2/parameters.def index bbebcd116..2b29da1ba 100644 --- a/definitions/grib2/parameters.def +++ b/definitions/grib2/parameters.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. transient dummyc=0: hidden; constant conceptsMasterDir="grib2" : hidden; diff --git a/definitions/grib2/products_0.def b/definitions/grib2/products_0.def index 900434965..1f9241931 100644 --- a/definitions/grib2/products_0.def +++ b/definitions/grib2/products_0.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Operational products diff --git a/definitions/grib2/products_1.def b/definitions/grib2/products_1.def index 0caf0d7fd..bcf4b6d58 100644 --- a/definitions/grib2/products_1.def +++ b/definitions/grib2/products_1.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Operationl test products diff --git a/definitions/grib2/products_10.def b/definitions/grib2/products_10.def index 61d00a291..bafd04a6f 100644 --- a/definitions/grib2/products_10.def +++ b/definitions/grib2/products_10.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Copernicus regional reanalysis (CARRA/CERRA) constant marsExpver = 'prod'; diff --git a/definitions/grib2/products_11.def b/definitions/grib2/products_11.def index 80615b3ce..6084a0b37 100644 --- a/definitions/grib2/products_11.def +++ b/definitions/grib2/products_11.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Copernicus regional reanalysis (CARRA/CERRA) constant marsExpver = 'test'; diff --git a/definitions/grib2/products_2.def b/definitions/grib2/products_2.def index a12158642..9cc75a393 100644 --- a/definitions/grib2/products_2.def +++ b/definitions/grib2/products_2.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Research products diff --git a/definitions/grib2/products_3.def b/definitions/grib2/products_3.def index ce5461f62..1087302a0 100644 --- a/definitions/grib2/products_3.def +++ b/definitions/grib2/products_3.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Re-analysis products diff --git a/definitions/grib2/products_4.def b/definitions/grib2/products_4.def index 9cb9fffc4..ea15b4f75 100644 --- a/definitions/grib2/products_4.def +++ b/definitions/grib2/products_4.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Tigge constant marsExpver = 'prod'; diff --git a/definitions/grib2/products_5.def b/definitions/grib2/products_5.def index 80e5f6fbd..151b4e64e 100644 --- a/definitions/grib2/products_5.def +++ b/definitions/grib2/products_5.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Tigge constant marsExpver = 'test'; diff --git a/definitions/grib2/products_6.def b/definitions/grib2/products_6.def index 3f5b045e3..28a608b97 100644 --- a/definitions/grib2/products_6.def +++ b/definitions/grib2/products_6.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # S2S constant marsExpver = 'prod'; diff --git a/definitions/grib2/products_7.def b/definitions/grib2/products_7.def index eab672fd2..c691c9956 100644 --- a/definitions/grib2/products_7.def +++ b/definitions/grib2/products_7.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # S2S test constant marsExpver = 'test'; diff --git a/definitions/grib2/products_8.def b/definitions/grib2/products_8.def index a71100618..a1c28ffc7 100644 --- a/definitions/grib2/products_8.def +++ b/definitions/grib2/products_8.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Uncertainties in ensembles of regional re-analysis project (UERRA) constant marsExpver = 'prod'; diff --git a/definitions/grib2/products_9.def b/definitions/grib2/products_9.def index a19dd0f41..3b2d3a4de 100644 --- a/definitions/grib2/products_9.def +++ b/definitions/grib2/products_9.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Uncertainties in ensembles of regional re-analysis project test (UERRA) constant marsExpver = 'test'; diff --git a/definitions/grib2/products_crra.def b/definitions/grib2/products_crra.def index 6bd4984bd..4bf341924 100644 --- a/definitions/grib2/products_crra.def +++ b/definitions/grib2/products_crra.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Copernicus regional reanalysis (CARRA/CERRA) constant marsClass = 'rr'; diff --git a/definitions/grib2/products_s2s.def b/definitions/grib2/products_s2s.def index 59bacd8de..48d09e587 100644 --- a/definitions/grib2/products_s2s.def +++ b/definitions/grib2/products_s2s.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # S2S constant marsClass = 's2'; diff --git a/definitions/grib2/products_tigge.def b/definitions/grib2/products_tigge.def index a79391da4..9a3a4ae81 100644 --- a/definitions/grib2/products_tigge.def +++ b/definitions/grib2/products_tigge.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Tigge constant marsClass = 'ti'; diff --git a/definitions/grib2/products_uerra.def b/definitions/grib2/products_uerra.def index 5d70c23d9..3879ed2c1 100644 --- a/definitions/grib2/products_uerra.def +++ b/definitions/grib2/products_uerra.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Uncertainties in ensembles of regional re-analysis project (UERRA) constant marsClass = 'ur'; diff --git a/definitions/grib2/rules.def b/definitions/grib2/rules.def index ba817f0af..c1f74af5d 100644 --- a/definitions/grib2/rules.def +++ b/definitions/grib2/rules.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Experimental stuff diff --git a/definitions/grib2/section.0.def b/definitions/grib2/section.0.def index 37ccf3612..0268e173c 100644 --- a/definitions/grib2/section.0.def +++ b/definitions/grib2/section.0.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. position offsetSection0; constant section0Length=16; diff --git a/definitions/grib2/section.1.def b/definitions/grib2/section.1.def index b4731b63f..d44489622 100644 --- a/definitions/grib2/section.1.def +++ b/definitions/grib2/section.1.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. position offsetSection1; section_length[4] section1Length ; diff --git a/definitions/grib2/section.2.def b/definitions/grib2/section.2.def index f8f496446..f4d4f8dd2 100644 --- a/definitions/grib2/section.2.def +++ b/definitions/grib2/section.2.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. position offsetSection2; section_length[4] section2Length ; diff --git a/definitions/grib2/section.3.def b/definitions/grib2/section.3.def index 73031a662..409bcf2c4 100644 --- a/definitions/grib2/section.3.def +++ b/definitions/grib2/section.3.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # START grib2::section # SECTION 3, GRID DEFINITION SECTION diff --git a/definitions/grib2/section.4.def b/definitions/grib2/section.4.def index 5225157e8..b98ac1949 100644 --- a/definitions/grib2/section.4.def +++ b/definitions/grib2/section.4.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. transient timeRangeIndicator=0 : no_copy,hidden; diff --git a/definitions/grib2/section.5.def b/definitions/grib2/section.5.def index c6f803ca3..ec77e10c8 100644 --- a/definitions/grib2/section.5.def +++ b/definitions/grib2/section.5.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. position offsetBSection5; diff --git a/definitions/grib2/section.6.def b/definitions/grib2/section.6.def index fcb562c15..3cf18d720 100644 --- a/definitions/grib2/section.6.def +++ b/definitions/grib2/section.6.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # START grib2::section # SECTION 6, BIT-MAP SECTION diff --git a/definitions/grib2/section.7.def b/definitions/grib2/section.7.def index 6513c97cb..f83c9480a 100644 --- a/definitions/grib2/section.7.def +++ b/definitions/grib2/section.7.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # START grib2::section # SECTION 7, DATA SECTION diff --git a/definitions/grib2/section.8.def b/definitions/grib2/section.8.def index b65b6c11b..e8f6ae1f1 100644 --- a/definitions/grib2/section.8.def +++ b/definitions/grib2/section.8.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. constant section8Length=4; position offsetSection8; diff --git a/definitions/grib2/sections.def b/definitions/grib2/sections.def index 118597d8f..6b42cf4a3 100644 --- a/definitions/grib2/sections.def +++ b/definitions/grib2/sections.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. lookup[1] sectionNumber(4) ; diff --git a/definitions/grib2/template.1.0.def b/definitions/grib2/template.1.0.def index 885d921ce..0f8f32271 100644 --- a/definitions/grib2/template.1.0.def +++ b/definitions/grib2/template.1.0.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 1.0, Calendar Definition diff --git a/definitions/grib2/template.1.1.def b/definitions/grib2/template.1.1.def index b01b45817..7fcf51f53 100644 --- a/definitions/grib2/template.1.1.def +++ b/definitions/grib2/template.1.1.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 1.1, Paleontological Offset diff --git a/definitions/grib2/template.1.2.def b/definitions/grib2/template.1.2.def index 644c04611..3d5c0e3ba 100644 --- a/definitions/grib2/template.1.2.def +++ b/definitions/grib2/template.1.2.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 1.2, Calendar Definition and Paleontological Offset diff --git a/definitions/grib2/template.1.calendar.def b/definitions/grib2/template.1.calendar.def index 3da8621e7..8d55bc3f2 100644 --- a/definitions/grib2/template.1.calendar.def +++ b/definitions/grib2/template.1.calendar.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Type of Calendar (see Code Table 1.6) codetable[1] typeOfCalendar ('1.6.table',masterDir,localDir) = 255 : dump,no_copy,edition_specific; diff --git a/definitions/grib2/template.1.offset.def b/definitions/grib2/template.1.offset.def index b3c667a97..3f967e1a3 100644 --- a/definitions/grib2/template.1.offset.def +++ b/definitions/grib2/template.1.offset.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Number of tens of thousands of years of offset signed[2] numberOfTensOfThousandsOfYearsOfOffset = missing() : can_be_missing,dump,no_copy,edition_specific; diff --git a/definitions/grib2/template.3.0.def b/definitions/grib2/template.3.0.def index 75e0cf09a..11b5f0b0c 100644 --- a/definitions/grib2/template.3.0.def +++ b/definitions/grib2/template.3.0.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 3.0, Latitude/longitude (or equidistant cylindrical, or Plate Carree) diff --git a/definitions/grib2/template.3.1.def b/definitions/grib2/template.3.1.def index 791e5f1a4..733573062 100644 --- a/definitions/grib2/template.3.1.def +++ b/definitions/grib2/template.3.1.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 3.1, Rotated Latitude/longitude (or equidistant cylindrical, or Plate Carree) diff --git a/definitions/grib2/template.3.10.def b/definitions/grib2/template.3.10.def index cc225138a..37cf9f7a1 100644 --- a/definitions/grib2/template.3.10.def +++ b/definitions/grib2/template.3.10.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 3.10, Mercator include "grib2/template.3.shape_of_the_earth.def"; diff --git a/definitions/grib2/template.3.100.def b/definitions/grib2/template.3.100.def index 34d8b0685..6fb478753 100644 --- a/definitions/grib2/template.3.100.def +++ b/definitions/grib2/template.3.100.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 3.100, Triangular grid based on an icosahedron (see Attachment I.2-GRIB-Att.) diff --git a/definitions/grib2/template.3.1000.def b/definitions/grib2/template.3.1000.def index b353003ef..590151dde 100644 --- a/definitions/grib2/template.3.1000.def +++ b/definitions/grib2/template.3.1000.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 3.1000, Cross-section grid, with points equally spaced on the horizontal diff --git a/definitions/grib2/template.3.101.def b/definitions/grib2/template.3.101.def index dd6d12bb9..692e48bae 100644 --- a/definitions/grib2/template.3.101.def +++ b/definitions/grib2/template.3.101.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 3.101, General Unstructured Grid diff --git a/definitions/grib2/template.3.110.def b/definitions/grib2/template.3.110.def index 5c8488dc8..ea12ada97 100644 --- a/definitions/grib2/template.3.110.def +++ b/definitions/grib2/template.3.110.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 3.110, Equatorial azimuthal equidistant projection include "grib2/template.3.shape_of_the_earth.def"; diff --git a/definitions/grib2/template.3.1100.def b/definitions/grib2/template.3.1100.def index 29459a843..2996da7db 100644 --- a/definitions/grib2/template.3.1100.def +++ b/definitions/grib2/template.3.1100.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 3.1100, Hovmoller diagram grid with points equally spaced on the horizontal include "grib2/template.3.shape_of_the_earth.def"; diff --git a/definitions/grib2/template.3.12.def b/definitions/grib2/template.3.12.def index df93f9fdc..e2b5bcb18 100644 --- a/definitions/grib2/template.3.12.def +++ b/definitions/grib2/template.3.12.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 3.12, Transverse Mercator diff --git a/definitions/grib2/template.3.120.def b/definitions/grib2/template.3.120.def index 8d18d5a4a..430f3bdfb 100644 --- a/definitions/grib2/template.3.120.def +++ b/definitions/grib2/template.3.120.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 3.120, Azimuth-range projection # Nb - number of data bins along radials (A data bin is a data point representing the volume centred on it) diff --git a/definitions/grib2/template.3.1200.def b/definitions/grib2/template.3.1200.def index 53b2778f9..5429c32f9 100644 --- a/definitions/grib2/template.3.1200.def +++ b/definitions/grib2/template.3.1200.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 3.1200, Time section grid # NT - Number of time steps diff --git a/definitions/grib2/template.3.13.def b/definitions/grib2/template.3.13.def index 717471573..1fe8f8c47 100644 --- a/definitions/grib2/template.3.13.def +++ b/definitions/grib2/template.3.13.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 3.13 Mercator with modelling subdomains definition include "grib2/template.3.10.def" diff --git a/definitions/grib2/template.3.130.def b/definitions/grib2/template.3.130.def index 187c78538..3e1d831c7 100644 --- a/definitions/grib2/template.3.130.def +++ b/definitions/grib2/template.3.130.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 3.130, Irregular Latitude/longitude grid diff --git a/definitions/grib2/template.3.140.def b/definitions/grib2/template.3.140.def index d47ccba0b..a64b3826a 100644 --- a/definitions/grib2/template.3.140.def +++ b/definitions/grib2/template.3.140.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 3.140, Lambert azimuthal equal area projection include "grib2/template.3.shape_of_the_earth.def"; diff --git a/definitions/grib2/template.3.2.def b/definitions/grib2/template.3.2.def index 5739ea9a1..5ef4ef744 100644 --- a/definitions/grib2/template.3.2.def +++ b/definitions/grib2/template.3.2.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 3.2, Stretched Latitude/longitude (or equidistant cylindrical, or Plate Carree) diff --git a/definitions/grib2/template.3.20.def b/definitions/grib2/template.3.20.def index 2c90c58cc..efee0046f 100644 --- a/definitions/grib2/template.3.20.def +++ b/definitions/grib2/template.3.20.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 3.20, Polar stereographic projection include "grib2/template.3.shape_of_the_earth.def"; diff --git a/definitions/grib2/template.3.23.def b/definitions/grib2/template.3.23.def index ec1bc325b..9a1087a71 100644 --- a/definitions/grib2/template.3.23.def +++ b/definitions/grib2/template.3.23.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 3.23 Polar stereographic with modelling subdomains definition include "grib2/template.3.20.def" diff --git a/definitions/grib2/template.3.3.def b/definitions/grib2/template.3.3.def index 5f561d0f2..908695d1e 100644 --- a/definitions/grib2/template.3.3.def +++ b/definitions/grib2/template.3.3.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 3.3, Stretched and Rotated Latitude/longitude (or equidistant cylindrical, or Plate Carree) diff --git a/definitions/grib2/template.3.30.def b/definitions/grib2/template.3.30.def index 9a67688f4..377883dc2 100644 --- a/definitions/grib2/template.3.30.def +++ b/definitions/grib2/template.3.30.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 3.30, Lambert conformal include "grib2/template.3.shape_of_the_earth.def"; diff --git a/definitions/grib2/template.3.31.def b/definitions/grib2/template.3.31.def index 2f6306328..1b408693d 100644 --- a/definitions/grib2/template.3.31.def +++ b/definitions/grib2/template.3.31.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 3.31, Albers equal area include "grib2/template.3.shape_of_the_earth.def"; diff --git a/definitions/grib2/template.3.33.def b/definitions/grib2/template.3.33.def index d7211bff6..5c9dd93ef 100644 --- a/definitions/grib2/template.3.33.def +++ b/definitions/grib2/template.3.33.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 3.33, Lambert conformal with modelling subdomains definition include "grib2/template.3.30.def" diff --git a/definitions/grib2/template.3.4.def b/definitions/grib2/template.3.4.def index e7ebaeba2..1a3cca40e 100644 --- a/definitions/grib2/template.3.4.def +++ b/definitions/grib2/template.3.4.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 3.4, Variable resolution latitude/longitude diff --git a/definitions/grib2/template.3.40.def b/definitions/grib2/template.3.40.def index 5e38fa8b1..4cc651ed1 100644 --- a/definitions/grib2/template.3.40.def +++ b/definitions/grib2/template.3.40.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 3.40, Gaussian latitude/longitude diff --git a/definitions/grib2/template.3.41.def b/definitions/grib2/template.3.41.def index e302b8f86..03534c221 100644 --- a/definitions/grib2/template.3.41.def +++ b/definitions/grib2/template.3.41.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 3.41, Rotated Gaussian latitude/longitude diff --git a/definitions/grib2/template.3.42.def b/definitions/grib2/template.3.42.def index 4053a0486..192fd676d 100644 --- a/definitions/grib2/template.3.42.def +++ b/definitions/grib2/template.3.42.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 3.42, Stretched Gaussian latitude/longitude diff --git a/definitions/grib2/template.3.43.def b/definitions/grib2/template.3.43.def index bb68fddb0..b1301137e 100644 --- a/definitions/grib2/template.3.43.def +++ b/definitions/grib2/template.3.43.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 3.43, Stretched and rotated Gaussian latitude/longitude diff --git a/definitions/grib2/template.3.5.def b/definitions/grib2/template.3.5.def index b98f7b96a..d364d792c 100644 --- a/definitions/grib2/template.3.5.def +++ b/definitions/grib2/template.3.5.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 3.5, Variable resolution rotated latitude/longitude diff --git a/definitions/grib2/template.3.50.def b/definitions/grib2/template.3.50.def index 294c1b808..6d869799c 100644 --- a/definitions/grib2/template.3.50.def +++ b/definitions/grib2/template.3.50.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 3.50, Spherical harmonic coefficients diff --git a/definitions/grib2/template.3.51.def b/definitions/grib2/template.3.51.def index ce9bc3051..cd385a04c 100644 --- a/definitions/grib2/template.3.51.def +++ b/definitions/grib2/template.3.51.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 3.51, Rotated spherical harmonic coefficients diff --git a/definitions/grib2/template.3.52.def b/definitions/grib2/template.3.52.def index 92c3344cd..5b471bd0e 100644 --- a/definitions/grib2/template.3.52.def +++ b/definitions/grib2/template.3.52.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 3.52, Stretched spherical harmonic coefficients diff --git a/definitions/grib2/template.3.53.def b/definitions/grib2/template.3.53.def index 1b7f3d666..7ad169452 100644 --- a/definitions/grib2/template.3.53.def +++ b/definitions/grib2/template.3.53.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 3.53, Stretched and rotated spherical harmonic coefficients diff --git a/definitions/grib2/template.3.61.def b/definitions/grib2/template.3.61.def index e3bfc7a8a..0a9044ec6 100644 --- a/definitions/grib2/template.3.61.def +++ b/definitions/grib2/template.3.61.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 3.61, Bi-Fourier coefficients on Mercator projection # Spectral Mercator with modelling subdomains definition diff --git a/definitions/grib2/template.3.62.def b/definitions/grib2/template.3.62.def index 772b263dc..83e2690b5 100644 --- a/definitions/grib2/template.3.62.def +++ b/definitions/grib2/template.3.62.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 3.62, Bi-Fourier coefficients on polar stereographic projection # Spectral polar stereographic with modelling subdomains definition diff --git a/definitions/grib2/template.3.63.def b/definitions/grib2/template.3.63.def index f5760f0f0..a9c90ce77 100644 --- a/definitions/grib2/template.3.63.def +++ b/definitions/grib2/template.3.63.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 3.63, BiFourier coefficients on lambert projection diff --git a/definitions/grib2/template.3.90.def b/definitions/grib2/template.3.90.def index 7ef517c63..22f70e6da 100644 --- a/definitions/grib2/template.3.90.def +++ b/definitions/grib2/template.3.90.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 3.90, Space view perspective or orthographic include "grib2/template.3.shape_of_the_earth.def"; diff --git a/definitions/grib2/template.3.gaussian.def b/definitions/grib2/template.3.gaussian.def index 28470aebc..b41399654 100755 --- a/definitions/grib2/template.3.gaussian.def +++ b/definitions/grib2/template.3.gaussian.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. include "grib2/template.3.grid.def"; diff --git a/definitions/grib2/template.3.grid.def b/definitions/grib2/template.3.grid.def index e36bb50f6..98ede4f9a 100644 --- a/definitions/grib2/template.3.grid.def +++ b/definitions/grib2/template.3.grid.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. unsigned[4] Ni : can_be_missing,dump; alias numberOfPointsAlongAParallel=Ni; diff --git a/definitions/grib2/template.3.latlon.def b/definitions/grib2/template.3.latlon.def index 12436c727..fd3c874b4 100755 --- a/definitions/grib2/template.3.latlon.def +++ b/definitions/grib2/template.3.latlon.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. include "grib2/template.3.grid.def"; diff --git a/definitions/grib2/template.3.latlon_vares.def b/definitions/grib2/template.3.latlon_vares.def index ce3f16648..b3ef76569 100755 --- a/definitions/grib2/template.3.latlon_vares.def +++ b/definitions/grib2/template.3.latlon_vares.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. unsigned[4] Ni : can_be_missing,dump; alias numberOfPointsAlongAParallel=Ni; diff --git a/definitions/grib2/template.3.resolution_flags.def b/definitions/grib2/template.3.resolution_flags.def index 048896a5a..01c65f762 100644 --- a/definitions/grib2/template.3.resolution_flags.def +++ b/definitions/grib2/template.3.resolution_flags.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Resolution and component flags flags[1] resolutionAndComponentFlags 'grib2/tables/[tablesVersion]/3.3.table' : edition_specific,no_copy; diff --git a/definitions/grib2/template.3.rotation.def b/definitions/grib2/template.3.rotation.def index 1cfc32345..f35e005a6 100755 --- a/definitions/grib2/template.3.rotation.def +++ b/definitions/grib2/template.3.rotation.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Latitude of the southern pole of projection signed[4] latitudeOfSouthernPole : no_copy; diff --git a/definitions/grib2/template.3.scanning_mode.def b/definitions/grib2/template.3.scanning_mode.def index a6c6dae7a..d74d83c76 100644 --- a/definitions/grib2/template.3.scanning_mode.def +++ b/definitions/grib2/template.3.scanning_mode.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. flags[1] scanningMode 'grib2/tables/[tablesVersion]/3.4.table' : edition_specific,no_copy ; diff --git a/definitions/grib2/template.3.shape_of_the_earth.def b/definitions/grib2/template.3.shape_of_the_earth.def index f3ea36499..2ff2dcdf0 100755 --- a/definitions/grib2/template.3.shape_of_the_earth.def +++ b/definitions/grib2/template.3.shape_of_the_earth.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. codetable[1] shapeOfTheEarth ('3.2.table',masterDir,localDir) : dump; diff --git a/definitions/grib2/template.3.spherical_harmonics.def b/definitions/grib2/template.3.spherical_harmonics.def index ec366a69a..79be41bb4 100755 --- a/definitions/grib2/template.3.spherical_harmonics.def +++ b/definitions/grib2/template.3.spherical_harmonics.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. constant sphericalHarmonics=1; diff --git a/definitions/grib2/template.3.stretching.def b/definitions/grib2/template.3.stretching.def index 1fad9093d..11c0b12c3 100755 --- a/definitions/grib2/template.3.stretching.def +++ b/definitions/grib2/template.3.stretching.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Latitude of the pole of stretching signed[4] latitudeOfThePoleOfStretching : edition_specific,no_copy; diff --git a/definitions/grib2/template.4.0.def b/definitions/grib2/template.4.0.def index 06db2a737..a1a94830b 100644 --- a/definitions/grib2/template.4.0.def +++ b/definitions/grib2/template.4.0.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.0, Analysis or forecast at a horizontal level or in a horizontal layer at a point in time diff --git a/definitions/grib2/template.4.1.def b/definitions/grib2/template.4.1.def index 24f3d377d..24372d2fb 100644 --- a/definitions/grib2/template.4.1.def +++ b/definitions/grib2/template.4.1.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.1, Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time diff --git a/definitions/grib2/template.4.10.def b/definitions/grib2/template.4.10.def index 05530c586..1840943ec 100644 --- a/definitions/grib2/template.4.10.def +++ b/definitions/grib2/template.4.10.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.10, Percentile forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval diff --git a/definitions/grib2/template.4.1000.def b/definitions/grib2/template.4.1000.def index 5ffca8b00..a2b57262a 100644 --- a/definitions/grib2/template.4.1000.def +++ b/definitions/grib2/template.4.1000.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.1000, Cross section of analysis and forecast at a point in time diff --git a/definitions/grib2/template.4.1001.def b/definitions/grib2/template.4.1001.def index 4f8b433a9..c0b81a6d7 100644 --- a/definitions/grib2/template.4.1001.def +++ b/definitions/grib2/template.4.1001.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.1001, Cross section of averaged or otherwise statistically processed analysis or forecast over a range of time diff --git a/definitions/grib2/template.4.1002.def b/definitions/grib2/template.4.1002.def index d15c1f19f..63d0c0e13 100644 --- a/definitions/grib2/template.4.1002.def +++ b/definitions/grib2/template.4.1002.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.1002, Cross-section of analysis and forecast, averaged or otherwise statistically processed over latitude or longitude diff --git a/definitions/grib2/template.4.11.def b/definitions/grib2/template.4.11.def index 70fd1fd40..1506df9f4 100644 --- a/definitions/grib2/template.4.11.def +++ b/definitions/grib2/template.4.11.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.11, Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval diff --git a/definitions/grib2/template.4.1100.def b/definitions/grib2/template.4.1100.def index 86235fafb..c69138393 100644 --- a/definitions/grib2/template.4.1100.def +++ b/definitions/grib2/template.4.1100.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.1100, Hovmöller-type grid with no averaging or other statistical processing diff --git a/definitions/grib2/template.4.1101.def b/definitions/grib2/template.4.1101.def index fb5e0ea08..14a51ca46 100644 --- a/definitions/grib2/template.4.1101.def +++ b/definitions/grib2/template.4.1101.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.1101, Hovmöller-type grid with averaging or other statistical processing diff --git a/definitions/grib2/template.4.12.def b/definitions/grib2/template.4.12.def index e05ab076c..70aa465ac 100644 --- a/definitions/grib2/template.4.12.def +++ b/definitions/grib2/template.4.12.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.12, Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval diff --git a/definitions/grib2/template.4.13.def b/definitions/grib2/template.4.13.def index aed90b726..4de62804f 100644 --- a/definitions/grib2/template.4.13.def +++ b/definitions/grib2/template.4.13.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.13, Derived forecasts based on a cluster of ensemble members over a rectangular area at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval diff --git a/definitions/grib2/template.4.14.def b/definitions/grib2/template.4.14.def index 236bd57a6..8ba50edd5 100644 --- a/definitions/grib2/template.4.14.def +++ b/definitions/grib2/template.4.14.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.14, Derived forecasts based on a cluster of ensemble members over a circular area at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval diff --git a/definitions/grib2/template.4.15.def b/definitions/grib2/template.4.15.def index a3be7f9c5..d58a24851 100644 --- a/definitions/grib2/template.4.15.def +++ b/definitions/grib2/template.4.15.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.15, Average, accumulation, extreme values, or other statistically-processed values over a spatial area at a horizontal level or in a horizontal layer at a point in time diff --git a/definitions/grib2/template.4.2.def b/definitions/grib2/template.4.2.def index 378644657..27b00c320 100644 --- a/definitions/grib2/template.4.2.def +++ b/definitions/grib2/template.4.2.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.2, Derived forecast based on all ensemble members at a horizontal level or in a horizontal layer at a point in time diff --git a/definitions/grib2/template.4.20.def b/definitions/grib2/template.4.20.def index fcf38ab42..86cc2e8e7 100644 --- a/definitions/grib2/template.4.20.def +++ b/definitions/grib2/template.4.20.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.20, Radar product # Parameter category diff --git a/definitions/grib2/template.4.2000.def b/definitions/grib2/template.4.2000.def index 1148739f6..922c1d3c8 100644 --- a/definitions/grib2/template.4.2000.def +++ b/definitions/grib2/template.4.2000.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # test template label "_test template"; diff --git a/definitions/grib2/template.4.254.def b/definitions/grib2/template.4.254.def index 557de2d3a..94de021c6 100644 --- a/definitions/grib2/template.4.254.def +++ b/definitions/grib2/template.4.254.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.254, CCITT IA5 character string diff --git a/definitions/grib2/template.4.3.def b/definitions/grib2/template.4.3.def index e2fe19fae..cdc928841 100644 --- a/definitions/grib2/template.4.3.def +++ b/definitions/grib2/template.4.3.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.3, Derived forecasts based on a cluster of ensemble members over a rectangular area at a horizontal level or in a horizontal layer at a point in time diff --git a/definitions/grib2/template.4.30.def b/definitions/grib2/template.4.30.def index afb3ae3cd..948437ec9 100644 --- a/definitions/grib2/template.4.30.def +++ b/definitions/grib2/template.4.30.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # For grib2 to grib1 conversion constant dataRepresentationType = 90; diff --git a/definitions/grib2/template.4.31.def b/definitions/grib2/template.4.31.def index 0fe7dacb9..006d6ed44 100644 --- a/definitions/grib2/template.4.31.def +++ b/definitions/grib2/template.4.31.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # For grib2 to grib1 conversion constant dataRepresentationType = 90; diff --git a/definitions/grib2/template.4.311.def b/definitions/grib2/template.4.311.def index 85566fa63..ab4a284fc 100644 --- a/definitions/grib2/template.4.311.def +++ b/definitions/grib2/template.4.311.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # For grib2 to grib1 conversion constant dataRepresentationType = 90; diff --git a/definitions/grib2/template.4.32.def b/definitions/grib2/template.4.32.def index 896eb5fc2..f3d29828b 100644 --- a/definitions/grib2/template.4.32.def +++ b/definitions/grib2/template.4.32.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # For grib2 to grib1 conversion constant dataRepresentationType = 90; diff --git a/definitions/grib2/template.4.33.def b/definitions/grib2/template.4.33.def index 495c0d6fc..9abe54bad 100644 --- a/definitions/grib2/template.4.33.def +++ b/definitions/grib2/template.4.33.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.33, Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data diff --git a/definitions/grib2/template.4.34.def b/definitions/grib2/template.4.34.def index c6128e521..a523031ed 100644 --- a/definitions/grib2/template.4.34.def +++ b/definitions/grib2/template.4.34.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.34, Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data diff --git a/definitions/grib2/template.4.35.def b/definitions/grib2/template.4.35.def index de7ede3d3..0f6fef804 100644 --- a/definitions/grib2/template.4.35.def +++ b/definitions/grib2/template.4.35.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # For grib2 to grib1 conversion constant dataRepresentationType = 90; diff --git a/definitions/grib2/template.4.4.def b/definitions/grib2/template.4.4.def index 67055e655..4b84053a8 100644 --- a/definitions/grib2/template.4.4.def +++ b/definitions/grib2/template.4.4.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.4, Derived forecasts based on a cluster of ensemble members over a circular area at a horizontal level or in a horizontal layer at a point in time diff --git a/definitions/grib2/template.4.40.def b/definitions/grib2/template.4.40.def index 9736409e3..88d6f5616 100644 --- a/definitions/grib2/template.4.40.def +++ b/definitions/grib2/template.4.40.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.40, Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents diff --git a/definitions/grib2/template.4.40033.def b/definitions/grib2/template.4.40033.def index 4c2362b5e..c5a1421ad 100644 --- a/definitions/grib2/template.4.40033.def +++ b/definitions/grib2/template.4.40033.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # # This is deprecated and only included for backward compatibility, use template 4.33 diff --git a/definitions/grib2/template.4.40034.def b/definitions/grib2/template.4.40034.def index 4d56ad477..3c0fed44a 100644 --- a/definitions/grib2/template.4.40034.def +++ b/definitions/grib2/template.4.40034.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # # This is deprecated and only included for backward compatibility, use template 4.34 diff --git a/definitions/grib2/template.4.41.def b/definitions/grib2/template.4.41.def index cca6d9970..f3fccee3f 100644 --- a/definitions/grib2/template.4.41.def +++ b/definitions/grib2/template.4.41.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.41, Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents diff --git a/definitions/grib2/template.4.42.def b/definitions/grib2/template.4.42.def index f22132a05..fc2f42a8e 100644 --- a/definitions/grib2/template.4.42.def +++ b/definitions/grib2/template.4.42.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.42, Average, accumulation and/or extreme values or other statistically processed values at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents diff --git a/definitions/grib2/template.4.43.def b/definitions/grib2/template.4.43.def index eb5b3baa3..a514a0dd4 100644 --- a/definitions/grib2/template.4.43.def +++ b/definitions/grib2/template.4.43.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.43, Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents diff --git a/definitions/grib2/template.4.44.def b/definitions/grib2/template.4.44.def index aa75ad0da..22dd46ab2 100644 --- a/definitions/grib2/template.4.44.def +++ b/definitions/grib2/template.4.44.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.44, Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for aerosol # It is recommended not to use this template. PDT 4.48 should be used instead with optical wave length range set to missing diff --git a/definitions/grib2/template.4.45.def b/definitions/grib2/template.4.45.def index 07d0e4b00..1820766c4 100644 --- a/definitions/grib2/template.4.45.def +++ b/definitions/grib2/template.4.45.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.45, Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for aerosol diff --git a/definitions/grib2/template.4.46.def b/definitions/grib2/template.4.46.def index 9dc494a8d..844258874 100644 --- a/definitions/grib2/template.4.46.def +++ b/definitions/grib2/template.4.46.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.46, Average, accumulation, and/or extreme values or other statistically processed values at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for aerosol diff --git a/definitions/grib2/template.4.47.def b/definitions/grib2/template.4.47.def index d161e276a..e60c219ee 100644 --- a/definitions/grib2/template.4.47.def +++ b/definitions/grib2/template.4.47.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.47, Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval diff --git a/definitions/grib2/template.4.48.def b/definitions/grib2/template.4.48.def index e06280db1..6768145bc 100644 --- a/definitions/grib2/template.4.48.def +++ b/definitions/grib2/template.4.48.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.48, Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol diff --git a/definitions/grib2/template.4.49.def b/definitions/grib2/template.4.49.def index b8d66215e..7c4ea91a2 100644 --- a/definitions/grib2/template.4.49.def +++ b/definitions/grib2/template.4.49.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.49, Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol diff --git a/definitions/grib2/template.4.5.def b/definitions/grib2/template.4.5.def index 59d11f8a5..a0cba2d16 100644 --- a/definitions/grib2/template.4.5.def +++ b/definitions/grib2/template.4.5.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.5, Probability forecasts at a horizontal level or in a horizontal layer at a point in time diff --git a/definitions/grib2/template.4.51.def b/definitions/grib2/template.4.51.def index 4d87becbb..d495993db 100644 --- a/definitions/grib2/template.4.51.def +++ b/definitions/grib2/template.4.51.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.51, Categorical forecasts at a horizontal level or in a horizontal layer at a point in time diff --git a/definitions/grib2/template.4.53.def b/definitions/grib2/template.4.53.def index 7c11f3119..eb1b32282 100644 --- a/definitions/grib2/template.4.53.def +++ b/definitions/grib2/template.4.53.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.53, Partitioned parameters at a horizontal level or in a horizontal layer at a point in time diff --git a/definitions/grib2/template.4.54.def b/definitions/grib2/template.4.54.def index 6a3c8f2b1..b0acf7941 100644 --- a/definitions/grib2/template.4.54.def +++ b/definitions/grib2/template.4.54.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.54, Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for partitioned parameters diff --git a/definitions/grib2/template.4.55.def b/definitions/grib2/template.4.55.def index 7bdce12df..8a7010bbe 100644 --- a/definitions/grib2/template.4.55.def +++ b/definitions/grib2/template.4.55.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.55, Spatio-temporal changing tiles at a horizontal level or horizontal layer at a point in time diff --git a/definitions/grib2/template.4.57.def b/definitions/grib2/template.4.57.def index 921ec7f9a..939c0e5fa 100644 --- a/definitions/grib2/template.4.57.def +++ b/definitions/grib2/template.4.57.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.57, Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents based on a distribution function diff --git a/definitions/grib2/template.4.58.def b/definitions/grib2/template.4.58.def index fbef62abc..380f25725 100644 --- a/definitions/grib2/template.4.58.def +++ b/definitions/grib2/template.4.58.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.58, Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents based on a distribution function diff --git a/definitions/grib2/template.4.59.def b/definitions/grib2/template.4.59.def index 747e94a57..5cddfb29d 100644 --- a/definitions/grib2/template.4.59.def +++ b/definitions/grib2/template.4.59.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.59, Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for spatio-temporal changing tile parameters diff --git a/definitions/grib2/template.4.6.def b/definitions/grib2/template.4.6.def index 187c42285..f173b2cfb 100644 --- a/definitions/grib2/template.4.6.def +++ b/definitions/grib2/template.4.6.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.6, Percentile forecasts at a horizontal level or in a horizontal layer at a point in time diff --git a/definitions/grib2/template.4.60.def b/definitions/grib2/template.4.60.def index cd8633078..53773a2a7 100644 --- a/definitions/grib2/template.4.60.def +++ b/definitions/grib2/template.4.60.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.60, Individual ensemble re-forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time diff --git a/definitions/grib2/template.4.61.def b/definitions/grib2/template.4.61.def index 7a1d08546..ef8683710 100644 --- a/definitions/grib2/template.4.61.def +++ b/definitions/grib2/template.4.61.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.61, Individual ensemble re-forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval diff --git a/definitions/grib2/template.4.67.def b/definitions/grib2/template.4.67.def index b343233ab..462d3ea6a 100644 --- a/definitions/grib2/template.4.67.def +++ b/definitions/grib2/template.4.67.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.67, Average, accumulation and/or extreme values or other statistically processed values at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents based on a distribution function diff --git a/definitions/grib2/template.4.68.def b/definitions/grib2/template.4.68.def index f1924d8fe..9fa3a3d20 100644 --- a/definitions/grib2/template.4.68.def +++ b/definitions/grib2/template.4.68.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.68, Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents based on a distribution function diff --git a/definitions/grib2/template.4.70.def b/definitions/grib2/template.4.70.def index 4f8ff7a64..d98aacf9e 100644 --- a/definitions/grib2/template.4.70.def +++ b/definitions/grib2/template.4.70.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # EFAS: Analysis or forecast at a horizontal level or in a horizontal layer at a point in time diff --git a/definitions/grib2/template.4.71.def b/definitions/grib2/template.4.71.def index 5991cd94a..31b5da5fe 100644 --- a/definitions/grib2/template.4.71.def +++ b/definitions/grib2/template.4.71.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # EFAS: Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time diff --git a/definitions/grib2/template.4.72.def b/definitions/grib2/template.4.72.def index 0cf86650b..3c773b45e 100644 --- a/definitions/grib2/template.4.72.def +++ b/definitions/grib2/template.4.72.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # EFAS: Average, accumulation, and/or extreme values or other statistically processed values at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval diff --git a/definitions/grib2/template.4.73.def b/definitions/grib2/template.4.73.def index 28a5dab65..5cfd284ab 100644 --- a/definitions/grib2/template.4.73.def +++ b/definitions/grib2/template.4.73.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # EFAS: Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval diff --git a/definitions/grib2/template.4.76.def b/definitions/grib2/template.4.76.def index abb8f0f02..59f0b1985 100644 --- a/definitions/grib2/template.4.76.def +++ b/definitions/grib2/template.4.76.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib2/template.4.77.def b/definitions/grib2/template.4.77.def index 22acb6c2b..f51fbb1ab 100644 --- a/definitions/grib2/template.4.77.def +++ b/definitions/grib2/template.4.77.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib2/template.4.78.def b/definitions/grib2/template.4.78.def index 0a790f1d6..a6eeb401c 100644 --- a/definitions/grib2/template.4.78.def +++ b/definitions/grib2/template.4.78.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib2/template.4.79.def b/definitions/grib2/template.4.79.def index 4aafd958f..66be3acca 100644 --- a/definitions/grib2/template.4.79.def +++ b/definitions/grib2/template.4.79.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib2/template.4.8.def b/definitions/grib2/template.4.8.def index ab0bb7a8a..ce39303d7 100644 --- a/definitions/grib2/template.4.8.def +++ b/definitions/grib2/template.4.8.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.8, Average, accumulation, and/or extreme values or other statistically processed values at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval diff --git a/definitions/grib2/template.4.80.def b/definitions/grib2/template.4.80.def index e5eefa0d5..4e3325762 100644 --- a/definitions/grib2/template.4.80.def +++ b/definitions/grib2/template.4.80.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib2/template.4.81.def b/definitions/grib2/template.4.81.def index 6837c674b..a758d4be1 100644 --- a/definitions/grib2/template.4.81.def +++ b/definitions/grib2/template.4.81.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib2/template.4.82.def b/definitions/grib2/template.4.82.def index b65ed98e8..6e64bbd7c 100644 --- a/definitions/grib2/template.4.82.def +++ b/definitions/grib2/template.4.82.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib2/template.4.83.def b/definitions/grib2/template.4.83.def index fe207bb91..ebf1b6453 100644 --- a/definitions/grib2/template.4.83.def +++ b/definitions/grib2/template.4.83.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib2/template.4.9.def b/definitions/grib2/template.4.9.def index 1a5994926..11fffc68a 100644 --- a/definitions/grib2/template.4.9.def +++ b/definitions/grib2/template.4.9.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.9, Probability forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval diff --git a/definitions/grib2/template.4.91.def b/definitions/grib2/template.4.91.def index b213df3a5..5824fd971 100644 --- a/definitions/grib2/template.4.91.def +++ b/definitions/grib2/template.4.91.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 4.91, Categorical forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval diff --git a/definitions/grib2/template.4.categorical.def b/definitions/grib2/template.4.categorical.def index 2b841474b..561f28b18 100755 --- a/definitions/grib2/template.4.categorical.def +++ b/definitions/grib2/template.4.categorical.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Total number of forecast probabilities unsigned[1] numberOfCategories : dump; diff --git a/definitions/grib2/template.4.circular_cluster.def b/definitions/grib2/template.4.circular_cluster.def index b8fc8c961..7db252798 100755 --- a/definitions/grib2/template.4.circular_cluster.def +++ b/definitions/grib2/template.4.circular_cluster.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Cluster identifier unsigned[1] clusterIdentifier : dump; diff --git a/definitions/grib2/template.4.derived.def b/definitions/grib2/template.4.derived.def index e92f92d9b..429f57b99 100755 --- a/definitions/grib2/template.4.derived.def +++ b/definitions/grib2/template.4.derived.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Derived forecast codetable[1] derivedForecast ('4.7.table',masterDir,localDir) : dump; diff --git a/definitions/grib2/template.4.eps.def b/definitions/grib2/template.4.eps.def index 2252000bd..bda5c6b25 100644 --- a/definitions/grib2/template.4.eps.def +++ b/definitions/grib2/template.4.eps.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Type of ensemble forecast codetable[1] typeOfEnsembleForecast ('4.6.table',masterDir,localDir) = 255 : dump; diff --git a/definitions/grib2/template.4.horizontal.def b/definitions/grib2/template.4.horizontal.def index b9e913418..348e4eb89 100755 --- a/definitions/grib2/template.4.horizontal.def +++ b/definitions/grib2/template.4.horizontal.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Type of first fixed surface codetable[1] typeOfFirstFixedSurface ('4.5.table',masterDir,localDir) : dump,no_copy,edition_specific,string_type; diff --git a/definitions/grib2/template.4.parameter.def b/definitions/grib2/template.4.parameter.def index 5712662ff..b74a8bd45 100644 --- a/definitions/grib2/template.4.parameter.def +++ b/definitions/grib2/template.4.parameter.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Parameter category codetable[1] parameterCategory ('4.1.[discipline:l].table',masterDir,localDir) : dump; diff --git a/definitions/grib2/template.4.parameter_aerosol.def b/definitions/grib2/template.4.parameter_aerosol.def index b987b0fb3..d5a59c67a 100644 --- a/definitions/grib2/template.4.parameter_aerosol.def +++ b/definitions/grib2/template.4.parameter_aerosol.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Parameter category codetable[1] parameterCategory ('4.1.[discipline:l].table',masterDir,localDir) : dump; diff --git a/definitions/grib2/template.4.parameter_aerosol_44.def b/definitions/grib2/template.4.parameter_aerosol_44.def index c1150cedf..7218bd19e 100644 --- a/definitions/grib2/template.4.parameter_aerosol_44.def +++ b/definitions/grib2/template.4.parameter_aerosol_44.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # GRIB-530: This template is to be used by template.4.44.def ONLY diff --git a/definitions/grib2/template.4.parameter_aerosol_optical.def b/definitions/grib2/template.4.parameter_aerosol_optical.def index 5c48806d4..ebe73ec6e 100644 --- a/definitions/grib2/template.4.parameter_aerosol_optical.def +++ b/definitions/grib2/template.4.parameter_aerosol_optical.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Parameter category codetable[1] parameterCategory ('4.1.[discipline:l].table',masterDir,localDir) : dump; diff --git a/definitions/grib2/template.4.parameter_aerosol_optical_source.def b/definitions/grib2/template.4.parameter_aerosol_optical_source.def index 86b5fb5ec..d18f12ed0 100644 --- a/definitions/grib2/template.4.parameter_aerosol_optical_source.def +++ b/definitions/grib2/template.4.parameter_aerosol_optical_source.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Parameter category codetable[1] parameterCategory ('4.1.[discipline:l].table',masterDir,localDir) : dump; diff --git a/definitions/grib2/template.4.parameter_aerosol_source.def b/definitions/grib2/template.4.parameter_aerosol_source.def index 57c17e3f9..107d08291 100644 --- a/definitions/grib2/template.4.parameter_aerosol_source.def +++ b/definitions/grib2/template.4.parameter_aerosol_source.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Parameter category codetable[1] parameterCategory ('4.1.[discipline:l].table',masterDir,localDir) : dump; diff --git a/definitions/grib2/template.4.parameter_chemical.def b/definitions/grib2/template.4.parameter_chemical.def index f4b0f92a8..767daf9cf 100644 --- a/definitions/grib2/template.4.parameter_chemical.def +++ b/definitions/grib2/template.4.parameter_chemical.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Parameter category codetable[1] parameterCategory ('4.1.[discipline:l].table',masterDir,localDir): dump; diff --git a/definitions/grib2/template.4.parameter_chemical_distribution.def b/definitions/grib2/template.4.parameter_chemical_distribution.def index b46877245..9a4265f0c 100644 --- a/definitions/grib2/template.4.parameter_chemical_distribution.def +++ b/definitions/grib2/template.4.parameter_chemical_distribution.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Parameter category codetable[1] parameterCategory ('4.1.[discipline:l].table',masterDir,localDir): dump; diff --git a/definitions/grib2/template.4.parameter_chemical_source.def b/definitions/grib2/template.4.parameter_chemical_source.def index ada3e6cfd..94dc3c4a9 100644 --- a/definitions/grib2/template.4.parameter_chemical_source.def +++ b/definitions/grib2/template.4.parameter_chemical_source.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Parameter category codetable[1] parameterCategory ('4.1.[discipline:l].table',masterDir,localDir): dump; diff --git a/definitions/grib2/template.4.parameter_partition.def b/definitions/grib2/template.4.parameter_partition.def index b157f1d46..8c4252a23 100644 --- a/definitions/grib2/template.4.parameter_partition.def +++ b/definitions/grib2/template.4.parameter_partition.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Parameter category codetable[1] parameterCategory ('4.1.[discipline:l].table',masterDir,localDir) : dump; diff --git a/definitions/grib2/template.4.parameter_postproc.def b/definitions/grib2/template.4.parameter_postproc.def index 4b093d8f7..d20c88000 100644 --- a/definitions/grib2/template.4.parameter_postproc.def +++ b/definitions/grib2/template.4.parameter_postproc.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Parameter category codetable[1] parameterCategory ('4.1.[discipline:l].table',masterDir,localDir): dump; diff --git a/definitions/grib2/template.4.parameter_tile.def b/definitions/grib2/template.4.parameter_tile.def index 072d9e1e7..2002f212e 100644 --- a/definitions/grib2/template.4.parameter_tile.def +++ b/definitions/grib2/template.4.parameter_tile.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Parameter category codetable[1] parameterCategory ('4.1.[discipline:l].table',masterDir,localDir) : dump; diff --git a/definitions/grib2/template.4.percentile.def b/definitions/grib2/template.4.percentile.def index 4b0e103df..5f720cce7 100755 --- a/definitions/grib2/template.4.percentile.def +++ b/definitions/grib2/template.4.percentile.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Percentile value # (from 100% to 0%) diff --git a/definitions/grib2/template.4.point_in_time.def b/definitions/grib2/template.4.point_in_time.def index b863192b6..649c338c4 100644 --- a/definitions/grib2/template.4.point_in_time.def +++ b/definitions/grib2/template.4.point_in_time.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. meta startStep step_in_units(forecastTime,indicatorOfUnitOfTimeRange,stepUnits): no_copy; meta endStep g2end_step(startStep,stepUnits) : no_copy; diff --git a/definitions/grib2/template.4.probability.def b/definitions/grib2/template.4.probability.def index 1e86aa66f..ad1af9ff8 100755 --- a/definitions/grib2/template.4.probability.def +++ b/definitions/grib2/template.4.probability.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Forecast probability number unsigned[1] forecastProbabilityNumber : dump; diff --git a/definitions/grib2/template.4.rectangular_cluster.def b/definitions/grib2/template.4.rectangular_cluster.def index b0ce850d0..4d1208658 100755 --- a/definitions/grib2/template.4.rectangular_cluster.def +++ b/definitions/grib2/template.4.rectangular_cluster.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Cluster identifier unsigned[1] clusterIdentifier : dump ; diff --git a/definitions/grib2/template.4.statistical.def b/definitions/grib2/template.4.statistical.def index 315f84397..e4be03e10 100644 --- a/definitions/grib2/template.4.statistical.def +++ b/definitions/grib2/template.4.statistical.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Year of end of overall time interval unsigned[2] yearOfEndOfOverallTimeInterval =0 : edition_specific; diff --git a/definitions/grib2/template.5.0.def b/definitions/grib2/template.5.0.def index 5125629bf..9ec20b0ea 100644 --- a/definitions/grib2/template.5.0.def +++ b/definitions/grib2/template.5.0.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 5.0, Grid point data - simple packing diff --git a/definitions/grib2/template.5.1.def b/definitions/grib2/template.5.1.def index e3188aa48..0db50611f 100644 --- a/definitions/grib2/template.5.1.def +++ b/definitions/grib2/template.5.1.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 5.1, Matrix values at grid point -simple packing diff --git a/definitions/grib2/template.5.2.def b/definitions/grib2/template.5.2.def index a2b8e9920..03e74a290 100644 --- a/definitions/grib2/template.5.2.def +++ b/definitions/grib2/template.5.2.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 5.2, Grid point data - complex packing diff --git a/definitions/grib2/template.5.3.def b/definitions/grib2/template.5.3.def index 3d2e1ff9e..c2d00ef45 100644 --- a/definitions/grib2/template.5.3.def +++ b/definitions/grib2/template.5.3.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 5.3, Grid point data - complex packing and spatial differencing diff --git a/definitions/grib2/template.5.4.def b/definitions/grib2/template.5.4.def index 96a1e781f..1413d60e6 100644 --- a/definitions/grib2/template.5.4.def +++ b/definitions/grib2/template.5.4.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 5.4, Grid point data - IEEE packing # added for conversion from other packing diff --git a/definitions/grib2/template.5.40.def b/definitions/grib2/template.5.40.def index adde22a04..8340a0b3a 100644 --- a/definitions/grib2/template.5.40.def +++ b/definitions/grib2/template.5.40.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. #Data Representation Template 5.40: Grid point data - JPEG 2000 Code Stream Format diff --git a/definitions/grib2/template.5.40000.def b/definitions/grib2/template.5.40000.def index 287ce2a0b..7fd4303ad 100644 --- a/definitions/grib2/template.5.40000.def +++ b/definitions/grib2/template.5.40000.def @@ -1,3 +1,3 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. include "grib2/template.5.40.def" diff --git a/definitions/grib2/template.5.40010.def b/definitions/grib2/template.5.40010.def index c275b8686..a761bf1d0 100644 --- a/definitions/grib2/template.5.40010.def +++ b/definitions/grib2/template.5.40010.def @@ -1,3 +1,3 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. include "grib2/template.5.41.def" diff --git a/definitions/grib2/template.5.41.def b/definitions/grib2/template.5.41.def index cb214b25d..af95ab4de 100644 --- a/definitions/grib2/template.5.41.def +++ b/definitions/grib2/template.5.41.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Grid point data - PNG Code Stream Format SAME AS 5.40010 !!!!!! diff --git a/definitions/grib2/template.5.42.def b/definitions/grib2/template.5.42.def index f304bafcf..50fcc0805 100644 --- a/definitions/grib2/template.5.42.def +++ b/definitions/grib2/template.5.42.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 5.42, Grid point and spectral data - CCSDS recommended lossless compression diff --git a/definitions/grib2/template.5.50.def b/definitions/grib2/template.5.50.def index 72dde4aa4..065d65c51 100644 --- a/definitions/grib2/template.5.50.def +++ b/definitions/grib2/template.5.50.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 5.50, Spectral data - simple packing include "grib2/template.5.packing.def"; diff --git a/definitions/grib2/template.5.50000.def b/definitions/grib2/template.5.50000.def index 06340fe3d..46427b613 100644 --- a/definitions/grib2/template.5.50000.def +++ b/definitions/grib2/template.5.50000.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 5.51, Spherical harmonics data - complex packing diff --git a/definitions/grib2/template.5.50001.def b/definitions/grib2/template.5.50001.def index 93416da62..1e8eed339 100755 --- a/definitions/grib2/template.5.50001.def +++ b/definitions/grib2/template.5.50001.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. ieeefloat referenceValue : no_copy; meta referenceValueError reference_value_error(referenceValue,ieee); diff --git a/definitions/grib2/template.5.50002.def b/definitions/grib2/template.5.50002.def index 9cb6555bd..dd687a02b 100755 --- a/definitions/grib2/template.5.50002.def +++ b/definitions/grib2/template.5.50002.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. ieeefloat referenceValue : no_copy; meta referenceValueError reference_value_error(referenceValue,ieee); diff --git a/definitions/grib2/template.5.51.def b/definitions/grib2/template.5.51.def index aa91633df..747976a82 100644 --- a/definitions/grib2/template.5.51.def +++ b/definitions/grib2/template.5.51.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 5.51, Spherical harmonics data - complex packing diff --git a/definitions/grib2/template.5.53.def b/definitions/grib2/template.5.53.def index f72ae1f6c..9c52a8513 100644 --- a/definitions/grib2/template.5.53.def +++ b/definitions/grib2/template.5.53.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 5.53, BiFourier coefficients data - complex packing # Spectral data for limited area models \u2013 complex packing diff --git a/definitions/grib2/template.5.6.def b/definitions/grib2/template.5.6.def index cf437ef06..5214f812a 100644 --- a/definitions/grib2/template.5.6.def +++ b/definitions/grib2/template.5.6.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Grid point data - Simple packing with preprocessing diff --git a/definitions/grib2/template.5.61.def b/definitions/grib2/template.5.61.def index dc3a1e6f6..3565ebea7 100644 --- a/definitions/grib2/template.5.61.def +++ b/definitions/grib2/template.5.61.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Grid point data - Simple packing with logarithmic preprocessing constant typeOfPreProcessing=1; diff --git a/definitions/grib2/template.5.original_values.def b/definitions/grib2/template.5.original_values.def index 6d2833c28..9b8914732 100644 --- a/definitions/grib2/template.5.original_values.def +++ b/definitions/grib2/template.5.original_values.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Type of original field values codetable[1] typeOfOriginalFieldValues ('5.1.table',masterDir,localDir) = 0; # Default set to floating diff --git a/definitions/grib2/template.5.packing.def b/definitions/grib2/template.5.packing.def index 58f3d1838..63c48719f 100755 --- a/definitions/grib2/template.5.packing.def +++ b/definitions/grib2/template.5.packing.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # Reference value (R) # The copy_ok means that the value is copied when changing the representation diff --git a/definitions/grib2/template.5.second_order.def b/definitions/grib2/template.5.second_order.def index 3ac977bbf..f7a31a20b 100644 --- a/definitions/grib2/template.5.second_order.def +++ b/definitions/grib2/template.5.second_order.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. codetable[1] groupSplitting ('5.4.table',masterDir,localDir) = 1 ; #default general diff --git a/definitions/grib2/template.7.0.def b/definitions/grib2/template.7.0.def index 8a9cff878..d23d33b6b 100644 --- a/definitions/grib2/template.7.0.def +++ b/definitions/grib2/template.7.0.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 7.0, Grid point data - simple packing # Octets 6-nn : Binary data values - binary string, with each diff --git a/definitions/grib2/template.7.1.def b/definitions/grib2/template.7.1.def index 7585875d6..f4b2c3054 100644 --- a/definitions/grib2/template.7.1.def +++ b/definitions/grib2/template.7.1.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 7.1, Matrix values at grid point -simple packing # Octets 6-nn : Binary data values - binary string, with each diff --git a/definitions/grib2/template.7.2.def b/definitions/grib2/template.7.2.def index a3b8b1485..df506d9e8 100644 --- a/definitions/grib2/template.7.2.def +++ b/definitions/grib2/template.7.2.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 7.2, Grid point data - complex packing # Octets 6-xx : NG group reference values diff --git a/definitions/grib2/template.7.3.def b/definitions/grib2/template.7.3.def index f7345f9c7..470e0ca61 100644 --- a/definitions/grib2/template.7.3.def +++ b/definitions/grib2/template.7.3.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 7.3, Grid point data - complex packing and spatial differencing # Octets 6-ww : First value(s) of original diff --git a/definitions/grib2/template.7.4.def b/definitions/grib2/template.7.4.def index 3642bae94..fda92a0c2 100644 --- a/definitions/grib2/template.7.4.def +++ b/definitions/grib2/template.7.4.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 7.4, Grid point data - simple packing # Octets 6-nn : Binary data values - binary string, with each diff --git a/definitions/grib2/template.7.40.def b/definitions/grib2/template.7.40.def index 5de695762..d5b93c0de 100644 --- a/definitions/grib2/template.7.40.def +++ b/definitions/grib2/template.7.40.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 7.40, Grid point data - jpeg2000 # Octets 6-xx : NG group reference values diff --git a/definitions/grib2/template.7.40000.def b/definitions/grib2/template.7.40000.def index 0c85d28b0..33d9b4b8c 100644 --- a/definitions/grib2/template.7.40000.def +++ b/definitions/grib2/template.7.40000.def @@ -1,3 +1,3 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. include "grib2/template.7.40.def" diff --git a/definitions/grib2/template.7.40010.def b/definitions/grib2/template.7.40010.def index bd84d7242..96e332cd6 100644 --- a/definitions/grib2/template.7.40010.def +++ b/definitions/grib2/template.7.40010.def @@ -1,3 +1,3 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. include "grib2/template.7.41.def" diff --git a/definitions/grib2/template.7.41.def b/definitions/grib2/template.7.41.def index 0bce3cd6d..bd59ee357 100644 --- a/definitions/grib2/template.7.41.def +++ b/definitions/grib2/template.7.41.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 7.41, Grid point data - png meta codedValues data_png_packing( diff --git a/definitions/grib2/template.7.42.def b/definitions/grib2/template.7.42.def index e106c9b09..ff68e0664 100644 --- a/definitions/grib2/template.7.42.def +++ b/definitions/grib2/template.7.42.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 7.42, Grid point data - CCSDS meta codedValues data_ccsds_packing( diff --git a/definitions/grib2/template.7.50.def b/definitions/grib2/template.7.50.def index 3397f1997..ce7f790aa 100644 --- a/definitions/grib2/template.7.50.def +++ b/definitions/grib2/template.7.50.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 7.50, Spectral data - simple packing # Octets 6-nn : Binary data values - binary string, with each diff --git a/definitions/grib2/template.7.50000.def b/definitions/grib2/template.7.50000.def index 1d6b9ff34..d1584d690 100644 --- a/definitions/grib2/template.7.50000.def +++ b/definitions/grib2/template.7.50000.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. constant GRIBEXShBugPresent = 0; constant sphericalHarmonics = 1; diff --git a/definitions/grib2/template.7.50001.def b/definitions/grib2/template.7.50001.def index 9473eff41..178f36336 100644 --- a/definitions/grib2/template.7.50001.def +++ b/definitions/grib2/template.7.50001.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. if (bitsPerValue) { meta groupWidths unsigned_bits(widthOfWidths,numberOfGroups) : read_only; diff --git a/definitions/grib2/template.7.50002.def b/definitions/grib2/template.7.50002.def index 531ec6bc8..c29b61379 100644 --- a/definitions/grib2/template.7.50002.def +++ b/definitions/grib2/template.7.50002.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. meta groupWidths unsigned_bits(widthOfWidths,numberOfGroups) : read_only; meta groupLengths unsigned_bits(widthOfLengths,numberOfGroups) : read_only; diff --git a/definitions/grib2/template.7.51.def b/definitions/grib2/template.7.51.def index 2d6505b3a..04522eb68 100644 --- a/definitions/grib2/template.7.51.def +++ b/definitions/grib2/template.7.51.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 7.51, Spherical harmonics - complex packing # Octets 6-(5+I*TS) : Data values from the unpacked subset diff --git a/definitions/grib2/template.7.53.def b/definitions/grib2/template.7.53.def index 97cb22e89..ad4642bbf 100644 --- a/definitions/grib2/template.7.53.def +++ b/definitions/grib2/template.7.53.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 7.53, BiFourier coefficients - complex packing # Spectral data for limited area models \u2013 complex packing diff --git a/definitions/grib2/template.7.6.def b/definitions/grib2/template.7.6.def index 0d1389b66..ef5c7101a 100644 --- a/definitions/grib2/template.7.6.def +++ b/definitions/grib2/template.7.6.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 7.6, Grid point data - simple packing with preprocessing # Octets 6-nn : Binary data values - binary string, with each (scaled) diff --git a/definitions/grib2/template.7.61.def b/definitions/grib2/template.7.61.def index 0d1389b66..ef5c7101a 100644 --- a/definitions/grib2/template.7.61.def +++ b/definitions/grib2/template.7.61.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 7.6, Grid point data - simple packing with preprocessing # Octets 6-nn : Binary data values - binary string, with each (scaled) diff --git a/definitions/grib2/template.7.second_order.def b/definitions/grib2/template.7.second_order.def index 1bfb0b0d4..2e1796700 100644 --- a/definitions/grib2/template.7.second_order.def +++ b/definitions/grib2/template.7.second_order.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- ECMWF. # TEMPLATE 7.2, Grid point data - complex packing diff --git a/definitions/grib3/boot.def b/definitions/grib3/boot.def index 928ad96f2..34cf69829 100644 --- a/definitions/grib3/boot.def +++ b/definitions/grib3/boot.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/local.98.11.def b/definitions/grib3/local.98.11.def index e3ee83334..7c91145af 100644 --- a/definitions/grib3/local.98.11.def +++ b/definitions/grib3/local.98.11.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/local.98.14.def b/definitions/grib3/local.98.14.def index 8a9cd1b4a..68a8514e4 100644 --- a/definitions/grib3/local.98.14.def +++ b/definitions/grib3/local.98.14.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/local.98.15.def b/definitions/grib3/local.98.15.def index 278e5328c..ec0d61722 100644 --- a/definitions/grib3/local.98.15.def +++ b/definitions/grib3/local.98.15.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/local.98.16.def b/definitions/grib3/local.98.16.def index 40f0b53e7..1b2da664a 100644 --- a/definitions/grib3/local.98.16.def +++ b/definitions/grib3/local.98.16.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/local.98.18.def b/definitions/grib3/local.98.18.def index cf98daf1a..786005b2b 100644 --- a/definitions/grib3/local.98.18.def +++ b/definitions/grib3/local.98.18.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/local.98.192.def b/definitions/grib3/local.98.192.def index 42edc5211..6382bd8c3 100644 --- a/definitions/grib3/local.98.192.def +++ b/definitions/grib3/local.98.192.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/local.98.20.def b/definitions/grib3/local.98.20.def index f27ed13b8..2df29e302 100644 --- a/definitions/grib3/local.98.20.def +++ b/definitions/grib3/local.98.20.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/local.98.21.def b/definitions/grib3/local.98.21.def index d177a790e..2321c07b6 100644 --- a/definitions/grib3/local.98.21.def +++ b/definitions/grib3/local.98.21.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/local.98.24.def b/definitions/grib3/local.98.24.def index 5280e4364..b3cd50d33 100644 --- a/definitions/grib3/local.98.24.def +++ b/definitions/grib3/local.98.24.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/local.98.25.def b/definitions/grib3/local.98.25.def index 8f51c8ad0..7339ad9b2 100644 --- a/definitions/grib3/local.98.25.def +++ b/definitions/grib3/local.98.25.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/local.98.26.def b/definitions/grib3/local.98.26.def index d1bf498f6..6f7a3f709 100644 --- a/definitions/grib3/local.98.26.def +++ b/definitions/grib3/local.98.26.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/local.98.28.def b/definitions/grib3/local.98.28.def index 11e744e1a..fa52aa684 100644 --- a/definitions/grib3/local.98.28.def +++ b/definitions/grib3/local.98.28.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/local.98.30.def b/definitions/grib3/local.98.30.def index 11cc28ed0..40a2e29f9 100644 --- a/definitions/grib3/local.98.30.def +++ b/definitions/grib3/local.98.30.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/local.98.300.def b/definitions/grib3/local.98.300.def index 2e00e8a29..c4d1f9b65 100644 --- a/definitions/grib3/local.98.300.def +++ b/definitions/grib3/local.98.300.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/local.98.36.def b/definitions/grib3/local.98.36.def index 283f78af2..cd148bdc7 100644 --- a/definitions/grib3/local.98.36.def +++ b/definitions/grib3/local.98.36.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/local.98.38.def b/definitions/grib3/local.98.38.def index 227d65edd..e912bdb46 100644 --- a/definitions/grib3/local.98.38.def +++ b/definitions/grib3/local.98.38.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/local.98.39.def b/definitions/grib3/local.98.39.def index 538e254b8..9be03b61a 100644 --- a/definitions/grib3/local.98.39.def +++ b/definitions/grib3/local.98.39.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/local.98.7.def b/definitions/grib3/local.98.7.def index 42de2e798..e321ef80b 100644 --- a/definitions/grib3/local.98.7.def +++ b/definitions/grib3/local.98.7.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/local.98.9.def b/definitions/grib3/local.98.9.def index 60da0fd00..0a288c2e1 100644 --- a/definitions/grib3/local.98.9.def +++ b/definitions/grib3/local.98.9.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/mars_labeling.def b/definitions/grib3/mars_labeling.def index 189e0259b..f542ecb7f 100644 --- a/definitions/grib3/mars_labeling.def +++ b/definitions/grib3/mars_labeling.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/meta.def b/definitions/grib3/meta.def index 2e02e3322..eb3ab581c 100644 --- a/definitions/grib3/meta.def +++ b/definitions/grib3/meta.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/parameters.def b/definitions/grib3/parameters.def index f1a67f3a7..e7cea2eb2 100644 --- a/definitions/grib3/parameters.def +++ b/definitions/grib3/parameters.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/products_0.def b/definitions/grib3/products_0.def index 79b568927..4bf54ef1e 100644 --- a/definitions/grib3/products_0.def +++ b/definitions/grib3/products_0.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/products_1.def b/definitions/grib3/products_1.def index 782b04983..9688c57e7 100644 --- a/definitions/grib3/products_1.def +++ b/definitions/grib3/products_1.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/products_2.def b/definitions/grib3/products_2.def index 2b0e02af5..65a7fcd95 100644 --- a/definitions/grib3/products_2.def +++ b/definitions/grib3/products_2.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/products_3.def b/definitions/grib3/products_3.def index 7a7eb9105..bc11b6373 100644 --- a/definitions/grib3/products_3.def +++ b/definitions/grib3/products_3.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/products_4.def b/definitions/grib3/products_4.def index fc828608f..3d5e1fa0a 100644 --- a/definitions/grib3/products_4.def +++ b/definitions/grib3/products_4.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/products_5.def b/definitions/grib3/products_5.def index 55b3839b7..19aa93a96 100644 --- a/definitions/grib3/products_5.def +++ b/definitions/grib3/products_5.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/products_6.def b/definitions/grib3/products_6.def index 18b355d65..fe5c4d3b2 100644 --- a/definitions/grib3/products_6.def +++ b/definitions/grib3/products_6.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/products_7.def b/definitions/grib3/products_7.def index 3784fa6ef..c9e281dba 100644 --- a/definitions/grib3/products_7.def +++ b/definitions/grib3/products_7.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/products_8.def b/definitions/grib3/products_8.def index 35ac8f435..f06ae4c71 100644 --- a/definitions/grib3/products_8.def +++ b/definitions/grib3/products_8.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/products_9.def b/definitions/grib3/products_9.def index 419a2ef66..cf7911e99 100644 --- a/definitions/grib3/products_9.def +++ b/definitions/grib3/products_9.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/products_s2s.def b/definitions/grib3/products_s2s.def index ce034e8ec..7d1dd7720 100644 --- a/definitions/grib3/products_s2s.def +++ b/definitions/grib3/products_s2s.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/products_tigge.def b/definitions/grib3/products_tigge.def index 00597a1e9..bc1028008 100644 --- a/definitions/grib3/products_tigge.def +++ b/definitions/grib3/products_tigge.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/products_uerra.def b/definitions/grib3/products_uerra.def index 5a057ed15..82289f687 100644 --- a/definitions/grib3/products_uerra.def +++ b/definitions/grib3/products_uerra.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/rules.def b/definitions/grib3/rules.def index e369e9dd3..de8932e55 100644 --- a/definitions/grib3/rules.def +++ b/definitions/grib3/rules.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/section.00.def b/definitions/grib3/section.00.def index 1b361d046..bc68175bb 100644 --- a/definitions/grib3/section.00.def +++ b/definitions/grib3/section.00.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/section.01.def b/definitions/grib3/section.01.def index a1fd7384c..5bde245b5 100644 --- a/definitions/grib3/section.01.def +++ b/definitions/grib3/section.01.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/section.02.def b/definitions/grib3/section.02.def index 308bf2a9f..78c338932 100644 --- a/definitions/grib3/section.02.def +++ b/definitions/grib3/section.02.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/section.03.def b/definitions/grib3/section.03.def index b31b93d5a..16ddc6bc0 100644 --- a/definitions/grib3/section.03.def +++ b/definitions/grib3/section.03.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/section.04.def b/definitions/grib3/section.04.def index 072936071..fe8d01494 100644 --- a/definitions/grib3/section.04.def +++ b/definitions/grib3/section.04.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/section.05.def b/definitions/grib3/section.05.def index e839e9761..1cd85ec84 100644 --- a/definitions/grib3/section.05.def +++ b/definitions/grib3/section.05.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/section.06.def b/definitions/grib3/section.06.def index 73a071017..59db019e2 100644 --- a/definitions/grib3/section.06.def +++ b/definitions/grib3/section.06.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/section.07.def b/definitions/grib3/section.07.def index 1d4bd345e..5ac66dbad 100644 --- a/definitions/grib3/section.07.def +++ b/definitions/grib3/section.07.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/section.08.def b/definitions/grib3/section.08.def index 7475b8b5e..90838fa71 100644 --- a/definitions/grib3/section.08.def +++ b/definitions/grib3/section.08.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/section.09.def b/definitions/grib3/section.09.def index e95630cbf..8c4234835 100644 --- a/definitions/grib3/section.09.def +++ b/definitions/grib3/section.09.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/section.10.def b/definitions/grib3/section.10.def index df08b0dc9..ff53c3e75 100644 --- a/definitions/grib3/section.10.def +++ b/definitions/grib3/section.10.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/section.11.def b/definitions/grib3/section.11.def index af4cc9716..2c6bd14c5 100644 --- a/definitions/grib3/section.11.def +++ b/definitions/grib3/section.11.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/sections.def b/definitions/grib3/sections.def index 1ba940c34..313b93b7c 100644 --- a/definitions/grib3/sections.def +++ b/definitions/grib3/sections.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/template.10.0.def b/definitions/grib3/template.10.0.def index 3a5695abb..96685a9cb 100644 --- a/definitions/grib3/template.10.0.def +++ b/definitions/grib3/template.10.0.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/template.3.0.def b/definitions/grib3/template.3.0.def index 29fe1d3b7..bf36bce18 100644 --- a/definitions/grib3/template.3.0.def +++ b/definitions/grib3/template.3.0.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/template.3.110.def b/definitions/grib3/template.3.110.def index 408ac64ed..81cddc241 100644 --- a/definitions/grib3/template.3.110.def +++ b/definitions/grib3/template.3.110.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/template.3.140.def b/definitions/grib3/template.3.140.def index 63f6a1cbc..58ce8901f 100644 --- a/definitions/grib3/template.3.140.def +++ b/definitions/grib3/template.3.140.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/template.3.20.def b/definitions/grib3/template.3.20.def index 1e85eb8ab..af4afaaea 100644 --- a/definitions/grib3/template.3.20.def +++ b/definitions/grib3/template.3.20.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/template.3.resolution_flags.def b/definitions/grib3/template.3.resolution_flags.def index ed229ac44..41b11dfed 100644 --- a/definitions/grib3/template.3.resolution_flags.def +++ b/definitions/grib3/template.3.resolution_flags.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/template.4.0.def b/definitions/grib3/template.4.0.def index 97307c0c7..8fa46dee2 100644 --- a/definitions/grib3/template.4.0.def +++ b/definitions/grib3/template.4.0.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/template.4.1.def b/definitions/grib3/template.4.1.def index 30d9caa2c..477162a69 100644 --- a/definitions/grib3/template.4.1.def +++ b/definitions/grib3/template.4.1.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/template.4.2.def b/definitions/grib3/template.4.2.def index 02bddb9ba..474ef1c38 100644 --- a/definitions/grib3/template.4.2.def +++ b/definitions/grib3/template.4.2.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/template.4.3.def b/definitions/grib3/template.4.3.def index f867aa74e..930996946 100644 --- a/definitions/grib3/template.4.3.def +++ b/definitions/grib3/template.4.3.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/template.4.horizontal.def b/definitions/grib3/template.4.horizontal.def index e57f253f2..bc259c772 100755 --- a/definitions/grib3/template.4.horizontal.def +++ b/definitions/grib3/template.4.horizontal.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/template.4.resolution_flags.def b/definitions/grib3/template.4.resolution_flags.def index ed229ac44..41b11dfed 100644 --- a/definitions/grib3/template.4.resolution_flags.def +++ b/definitions/grib3/template.4.resolution_flags.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/template.4.scanning_mode.def b/definitions/grib3/template.4.scanning_mode.def index 32a3a402f..718e2eda1 100644 --- a/definitions/grib3/template.4.scanning_mode.def +++ b/definitions/grib3/template.4.scanning_mode.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/template.5.0.def b/definitions/grib3/template.5.0.def index 01765efc3..dd15efcb8 100644 --- a/definitions/grib3/template.5.0.def +++ b/definitions/grib3/template.5.0.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/template.5.1.def b/definitions/grib3/template.5.1.def index 58ae13023..b2f4041b7 100644 --- a/definitions/grib3/template.5.1.def +++ b/definitions/grib3/template.5.1.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/template.6.0.def b/definitions/grib3/template.6.0.def index 9fc7c995d..f30084b0c 100644 --- a/definitions/grib3/template.6.0.def +++ b/definitions/grib3/template.6.0.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/template.6.1.def b/definitions/grib3/template.6.1.def index a29ca1319..5f9e77fa6 100644 --- a/definitions/grib3/template.6.1.def +++ b/definitions/grib3/template.6.1.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/template.6.2.def b/definitions/grib3/template.6.2.def index eaa996806..6fd511fd8 100644 --- a/definitions/grib3/template.6.2.def +++ b/definitions/grib3/template.6.2.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/template.7.0.def b/definitions/grib3/template.7.0.def index 4bab6d48d..ab6c102d3 100644 --- a/definitions/grib3/template.7.0.def +++ b/definitions/grib3/template.7.0.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/template.7.1.def b/definitions/grib3/template.7.1.def index 4ac769672..e101423a6 100644 --- a/definitions/grib3/template.7.1.def +++ b/definitions/grib3/template.7.1.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/template.7.2.def b/definitions/grib3/template.7.2.def index fcc6667ff..8ed124fbd 100644 --- a/definitions/grib3/template.7.2.def +++ b/definitions/grib3/template.7.2.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/template.7.3.def b/definitions/grib3/template.7.3.def index 48a086848..c54707463 100644 --- a/definitions/grib3/template.7.3.def +++ b/definitions/grib3/template.7.3.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/template.7.4.def b/definitions/grib3/template.7.4.def index cab1fc71d..4bb1b1500 100644 --- a/definitions/grib3/template.7.4.def +++ b/definitions/grib3/template.7.4.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/template.8.0.def b/definitions/grib3/template.8.0.def index 96d77b31f..3a9a0fffd 100644 --- a/definitions/grib3/template.8.0.def +++ b/definitions/grib3/template.8.0.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/template.8.1.def b/definitions/grib3/template.8.1.def index 06c7d5056..c05cebe03 100644 --- a/definitions/grib3/template.8.1.def +++ b/definitions/grib3/template.8.1.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/grib3/template.9.0.def b/definitions/grib3/template.9.0.def index 6e95c427a..9c5dfd50d 100644 --- a/definitions/grib3/template.9.0.def +++ b/definitions/grib3/template.9.0.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/gts/boot.def b/definitions/gts/boot.def index 53905caa1..f2a2d3d5b 100644 --- a/definitions/gts/boot.def +++ b/definitions/gts/boot.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/installDefinitions.sh b/definitions/installDefinitions.sh index 502ede5d0..c686c54d8 100755 --- a/definitions/installDefinitions.sh +++ b/definitions/installDefinitions.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/mars/make_type_switch_case.sh b/definitions/mars/make_type_switch_case.sh index 932827e8d..ebaf6bf90 100755 --- a/definitions/mars/make_type_switch_case.sh +++ b/definitions/mars/make_type_switch_case.sh @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/metar/boot.def b/definitions/metar/boot.def index 022f86ffb..59c3f4c0c 100644 --- a/definitions/metar/boot.def +++ b/definitions/metar/boot.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/metar/boot.flexible.def b/definitions/metar/boot.flexible.def index b40967096..19774d05e 100644 --- a/definitions/metar/boot.flexible.def +++ b/definitions/metar/boot.flexible.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/publish_new_parameters.sh b/definitions/publish_new_parameters.sh index fe7e9792d..af3846288 100755 --- a/definitions/publish_new_parameters.sh +++ b/definitions/publish_new_parameters.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/taf/boot.def b/definitions/taf/boot.def index 88f36a19d..a9557208f 100644 --- a/definitions/taf/boot.def +++ b/definitions/taf/boot.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/tide/boot.def b/definitions/tide/boot.def index 702f6fa12..5f558b897 100644 --- a/definitions/tide/boot.def +++ b/definitions/tide/boot.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/tide/mars_labeling.def b/definitions/tide/mars_labeling.def index aba58fde5..ae5d2dbd8 100644 --- a/definitions/tide/mars_labeling.def +++ b/definitions/tide/mars_labeling.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/tide/section.1.def b/definitions/tide/section.1.def index ef2f397e4..2aa5d2b1a 100644 --- a/definitions/tide/section.1.def +++ b/definitions/tide/section.1.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/tide/section.4.def b/definitions/tide/section.4.def index 4d19308db..dde9e20f4 100644 --- a/definitions/tide/section.4.def +++ b/definitions/tide/section.4.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/definitions/wrap/boot.def b/definitions/wrap/boot.def index 456df4c94..f7915d89c 100644 --- a/definitions/wrap/boot.def +++ b/definitions/wrap/boot.def @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/eccodes_config.h.in b/eccodes_config.h.in index 65d0b81c3..6cdae518c 100644 --- a/eccodes_config.h.in +++ b/eccodes_config.h.in @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/box.c b/examples/C/box.c index 58b640c53..4d990aa45 100644 --- a/examples/C/box.c +++ b/examples/C/box.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/bufr_attributes.c b/examples/C/bufr_attributes.c index 7a5f744ef..d234a2b45 100644 --- a/examples/C/bufr_attributes.c +++ b/examples/C/bufr_attributes.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/bufr_attributes.sh b/examples/C/bufr_attributes.sh index 372ca92dd..9bffb6b16 100755 --- a/examples/C/bufr_attributes.sh +++ b/examples/C/bufr_attributes.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/bufr_clone.c b/examples/C/bufr_clone.c index f68e0fda7..3cda29678 100644 --- a/examples/C/bufr_clone.c +++ b/examples/C/bufr_clone.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/bufr_clone.sh b/examples/C/bufr_clone.sh index 88554effa..2e2bf3cba 100755 --- a/examples/C/bufr_clone.sh +++ b/examples/C/bufr_clone.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/bufr_copy_data.c b/examples/C/bufr_copy_data.c index 3c9f7eba6..b2447c21f 100644 --- a/examples/C/bufr_copy_data.c +++ b/examples/C/bufr_copy_data.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/bufr_copy_data.sh b/examples/C/bufr_copy_data.sh index 959a71411..7321f7463 100755 --- a/examples/C/bufr_copy_data.sh +++ b/examples/C/bufr_copy_data.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/bufr_expanded.c b/examples/C/bufr_expanded.c index 69aacaeed..53f393971 100644 --- a/examples/C/bufr_expanded.c +++ b/examples/C/bufr_expanded.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/bufr_expanded.sh b/examples/C/bufr_expanded.sh index 344ce4a4d..718bce1b9 100755 --- a/examples/C/bufr_expanded.sh +++ b/examples/C/bufr_expanded.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/bufr_get_keys.c b/examples/C/bufr_get_keys.c index 6cf9b20d4..e12538c2a 100644 --- a/examples/C/bufr_get_keys.c +++ b/examples/C/bufr_get_keys.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/bufr_get_keys.sh b/examples/C/bufr_get_keys.sh index 41cb72c0b..d6f0c8857 100755 --- a/examples/C/bufr_get_keys.sh +++ b/examples/C/bufr_get_keys.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/bufr_get_string_array.c b/examples/C/bufr_get_string_array.c index 2cbf74602..5c2eb1a0a 100644 --- a/examples/C/bufr_get_string_array.c +++ b/examples/C/bufr_get_string_array.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/bufr_get_string_array.sh b/examples/C/bufr_get_string_array.sh index c8dc0975a..70ca1989a 100755 --- a/examples/C/bufr_get_string_array.sh +++ b/examples/C/bufr_get_string_array.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/bufr_keys_iterator.c b/examples/C/bufr_keys_iterator.c index 4943d8a19..780456333 100644 --- a/examples/C/bufr_keys_iterator.c +++ b/examples/C/bufr_keys_iterator.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/bufr_keys_iterator.sh b/examples/C/bufr_keys_iterator.sh index 8ad46f42e..a01ec87e6 100755 --- a/examples/C/bufr_keys_iterator.sh +++ b/examples/C/bufr_keys_iterator.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/bufr_missing.c b/examples/C/bufr_missing.c index 8ca922e2e..10a582924 100644 --- a/examples/C/bufr_missing.c +++ b/examples/C/bufr_missing.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/bufr_missing.sh b/examples/C/bufr_missing.sh index 935b91e05..ae6b0def6 100755 --- a/examples/C/bufr_missing.sh +++ b/examples/C/bufr_missing.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/bufr_pthreads.c b/examples/C/bufr_pthreads.c index 2d03c5d29..a9fc1fcd7 100644 --- a/examples/C/bufr_pthreads.c +++ b/examples/C/bufr_pthreads.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/bufr_pthreads.sh b/examples/C/bufr_pthreads.sh index 74d7d00eb..150b457ea 100755 --- a/examples/C/bufr_pthreads.sh +++ b/examples/C/bufr_pthreads.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/bufr_read_header.c b/examples/C/bufr_read_header.c index cd715d18a..c29482117 100644 --- a/examples/C/bufr_read_header.c +++ b/examples/C/bufr_read_header.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/bufr_read_header.sh b/examples/C/bufr_read_header.sh index d844092be..8491e461c 100755 --- a/examples/C/bufr_read_header.sh +++ b/examples/C/bufr_read_header.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/bufr_read_scatterometer.c b/examples/C/bufr_read_scatterometer.c index 1cba6fcc3..914fe0753 100644 --- a/examples/C/bufr_read_scatterometer.c +++ b/examples/C/bufr_read_scatterometer.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/bufr_read_scatterometer.sh b/examples/C/bufr_read_scatterometer.sh index bcb5b4055..b3bc6d4ca 100755 --- a/examples/C/bufr_read_scatterometer.sh +++ b/examples/C/bufr_read_scatterometer.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/bufr_read_synop.c b/examples/C/bufr_read_synop.c index cf3602da0..280c17bba 100644 --- a/examples/C/bufr_read_synop.c +++ b/examples/C/bufr_read_synop.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/bufr_read_synop.sh b/examples/C/bufr_read_synop.sh index 60f8d5761..9d132ad63 100755 --- a/examples/C/bufr_read_synop.sh +++ b/examples/C/bufr_read_synop.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/bufr_read_temp.c b/examples/C/bufr_read_temp.c index 52d34d4b7..125506f89 100644 --- a/examples/C/bufr_read_temp.c +++ b/examples/C/bufr_read_temp.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/bufr_read_temp.sh b/examples/C/bufr_read_temp.sh index e12c89076..89b7f69f4 100755 --- a/examples/C/bufr_read_temp.sh +++ b/examples/C/bufr_read_temp.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/bufr_set_keys.c b/examples/C/bufr_set_keys.c index ba268458b..b56d490c3 100644 --- a/examples/C/bufr_set_keys.c +++ b/examples/C/bufr_set_keys.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/bufr_set_keys.sh b/examples/C/bufr_set_keys.sh index 1eb63f336..b52ff66b8 100755 --- a/examples/C/bufr_set_keys.sh +++ b/examples/C/bufr_set_keys.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/bufr_subset.c b/examples/C/bufr_subset.c index 80b8521c8..3d10f8e51 100644 --- a/examples/C/bufr_subset.c +++ b/examples/C/bufr_subset.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/bufr_subset.sh b/examples/C/bufr_subset.sh index 8dec4a021..0e68c9e8d 100755 --- a/examples/C/bufr_subset.sh +++ b/examples/C/bufr_subset.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/ecmwf_link.sh b/examples/C/ecmwf_link.sh index ffc94a1fc..f8180b1e4 100755 --- a/examples/C/ecmwf_link.sh +++ b/examples/C/ecmwf_link.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/fieldset.c b/examples/C/fieldset.c index b85e21b23..8aaba204f 100644 --- a/examples/C/fieldset.c +++ b/examples/C/fieldset.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/get_product_kind.c b/examples/C/get_product_kind.c index 81c98d449..30b471352 100644 --- a/examples/C/get_product_kind.c +++ b/examples/C/get_product_kind.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/get_product_kind.sh b/examples/C/get_product_kind.sh index 5cfdfb3f4..b0acae9c5 100755 --- a/examples/C/get_product_kind.sh +++ b/examples/C/get_product_kind.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/get_product_kind_samples.sh b/examples/C/get_product_kind_samples.sh index a2b657ee8..2622d09e5 100755 --- a/examples/C/get_product_kind_samples.sh +++ b/examples/C/get_product_kind_samples.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/grib_clone.c b/examples/C/grib_clone.c index a0d714cfe..cecc5f3d3 100644 --- a/examples/C/grib_clone.c +++ b/examples/C/grib_clone.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/grib_clone.sh b/examples/C/grib_clone.sh index 3e118dd03..e367cff30 100755 --- a/examples/C/grib_clone.sh +++ b/examples/C/grib_clone.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/grib_copy_message.c b/examples/C/grib_copy_message.c index 5223db8a6..6aabe31aa 100644 --- a/examples/C/grib_copy_message.c +++ b/examples/C/grib_copy_message.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/grib_copy_message.sh b/examples/C/grib_copy_message.sh index 767576064..58fa3ef9c 100755 --- a/examples/C/grib_copy_message.sh +++ b/examples/C/grib_copy_message.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/grib_ensemble_index.c b/examples/C/grib_ensemble_index.c index 5fd96163b..1d461f76c 100644 --- a/examples/C/grib_ensemble_index.c +++ b/examples/C/grib_ensemble_index.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/grib_ensemble_index.sh b/examples/C/grib_ensemble_index.sh index bab2a8fc4..307738e63 100755 --- a/examples/C/grib_ensemble_index.sh +++ b/examples/C/grib_ensemble_index.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/grib_get_data.c b/examples/C/grib_get_data.c index 169c0f024..04ca6f14c 100644 --- a/examples/C/grib_get_data.c +++ b/examples/C/grib_get_data.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/grib_get_data.sh b/examples/C/grib_get_data.sh index 49e5f6b6a..106c21c1e 100755 --- a/examples/C/grib_get_data.sh +++ b/examples/C/grib_get_data.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/grib_get_keys.c b/examples/C/grib_get_keys.c index ac4e00cb5..d7af778cc 100644 --- a/examples/C/grib_get_keys.c +++ b/examples/C/grib_get_keys.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/grib_get_keys.sh b/examples/C/grib_get_keys.sh index c81f32028..ef2e9913f 100755 --- a/examples/C/grib_get_keys.sh +++ b/examples/C/grib_get_keys.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/grib_index.c b/examples/C/grib_index.c index 693688baa..1faf3cd92 100644 --- a/examples/C/grib_index.c +++ b/examples/C/grib_index.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/grib_iterator.c b/examples/C/grib_iterator.c index 92c8253ba..122160817 100644 --- a/examples/C/grib_iterator.c +++ b/examples/C/grib_iterator.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/grib_iterator.sh b/examples/C/grib_iterator.sh index 5fb52531c..29c4cd042 100755 --- a/examples/C/grib_iterator.sh +++ b/examples/C/grib_iterator.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/grib_iterator_bitmap.c b/examples/C/grib_iterator_bitmap.c index d1739606f..53bc18127 100644 --- a/examples/C/grib_iterator_bitmap.c +++ b/examples/C/grib_iterator_bitmap.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/grib_keys_iterator.c b/examples/C/grib_keys_iterator.c index 6e34beffc..dcff27c21 100644 --- a/examples/C/grib_keys_iterator.c +++ b/examples/C/grib_keys_iterator.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/grib_keys_iterator.sh b/examples/C/grib_keys_iterator.sh index e3eadce5c..0d2edb2ce 100755 --- a/examples/C/grib_keys_iterator.sh +++ b/examples/C/grib_keys_iterator.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/grib_list.c b/examples/C/grib_list.c index 7e55f08bf..aabfc0381 100644 --- a/examples/C/grib_list.c +++ b/examples/C/grib_list.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/grib_list.sh b/examples/C/grib_list.sh index 78fac44e3..576c4ac66 100755 --- a/examples/C/grib_list.sh +++ b/examples/C/grib_list.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/grib_multi.c b/examples/C/grib_multi.c index ea0acfc23..1f29975a6 100644 --- a/examples/C/grib_multi.c +++ b/examples/C/grib_multi.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/grib_multi.sh b/examples/C/grib_multi.sh index b140b65a1..6b9f4573f 100755 --- a/examples/C/grib_multi.sh +++ b/examples/C/grib_multi.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/grib_multi_write.c b/examples/C/grib_multi_write.c index 866c04057..968fb5b23 100644 --- a/examples/C/grib_multi_write.c +++ b/examples/C/grib_multi_write.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/grib_multi_write.sh b/examples/C/grib_multi_write.sh index 024a1d2d8..247e8a6bf 100755 --- a/examples/C/grib_multi_write.sh +++ b/examples/C/grib_multi_write.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/grib_nearest.c b/examples/C/grib_nearest.c index 4adecf620..45d1c8eca 100644 --- a/examples/C/grib_nearest.c +++ b/examples/C/grib_nearest.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/grib_nearest_multiple.c b/examples/C/grib_nearest_multiple.c index 5d11ad7d3..c96cdcf69 100644 --- a/examples/C/grib_nearest_multiple.c +++ b/examples/C/grib_nearest_multiple.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/grib_nearest_multiple.sh b/examples/C/grib_nearest_multiple.sh index 98ea429fc..73e8c7eab 100755 --- a/examples/C/grib_nearest_multiple.sh +++ b/examples/C/grib_nearest_multiple.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/grib_precipitation.c b/examples/C/grib_precipitation.c index c04d5e9ba..2a0431502 100644 --- a/examples/C/grib_precipitation.c +++ b/examples/C/grib_precipitation.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/grib_precision.c b/examples/C/grib_precision.c index 8c7d833be..9a4ad72ff 100644 --- a/examples/C/grib_precision.c +++ b/examples/C/grib_precision.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/grib_precision.sh b/examples/C/grib_precision.sh index 4e9b92438..8e5bef899 100755 --- a/examples/C/grib_precision.sh +++ b/examples/C/grib_precision.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/grib_print_data.c b/examples/C/grib_print_data.c index f5b40d58c..915ea4cac 100644 --- a/examples/C/grib_print_data.c +++ b/examples/C/grib_print_data.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/grib_print_data.sh b/examples/C/grib_print_data.sh index 45639a906..a54e5e797 100755 --- a/examples/C/grib_print_data.sh +++ b/examples/C/grib_print_data.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/grib_pthreads.c b/examples/C/grib_pthreads.c index b3db17858..79e46ee4c 100644 --- a/examples/C/grib_pthreads.c +++ b/examples/C/grib_pthreads.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/grib_pthreads.sh b/examples/C/grib_pthreads.sh index 6da255f39..f2e2d636d 100755 --- a/examples/C/grib_pthreads.sh +++ b/examples/C/grib_pthreads.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/grib_sections_copy.c b/examples/C/grib_sections_copy.c index f35651c9f..dc55a1177 100644 --- a/examples/C/grib_sections_copy.c +++ b/examples/C/grib_sections_copy.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/grib_sections_copy.sh b/examples/C/grib_sections_copy.sh index b98660041..5bc00810d 100755 --- a/examples/C/grib_sections_copy.sh +++ b/examples/C/grib_sections_copy.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/grib_set_bitmap.c b/examples/C/grib_set_bitmap.c index 8cebe5718..aeac7fbe0 100644 --- a/examples/C/grib_set_bitmap.c +++ b/examples/C/grib_set_bitmap.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/grib_set_bitmap.sh b/examples/C/grib_set_bitmap.sh index 0abf513ae..c2b4e85ca 100755 --- a/examples/C/grib_set_bitmap.sh +++ b/examples/C/grib_set_bitmap.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/grib_set_data.c b/examples/C/grib_set_data.c index 2de99f880..2b5918763 100644 --- a/examples/C/grib_set_data.c +++ b/examples/C/grib_set_data.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/grib_set_data.sh b/examples/C/grib_set_data.sh index 5f6ba3916..c68e99e6a 100755 --- a/examples/C/grib_set_data.sh +++ b/examples/C/grib_set_data.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/grib_set_keys.c b/examples/C/grib_set_keys.c index 5c761fed3..f800dea93 100644 --- a/examples/C/grib_set_keys.c +++ b/examples/C/grib_set_keys.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/grib_set_keys.sh b/examples/C/grib_set_keys.sh index 6633411c3..65a7581c0 100755 --- a/examples/C/grib_set_keys.sh +++ b/examples/C/grib_set_keys.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/grib_set_pv.c b/examples/C/grib_set_pv.c index c16ef6fba..535be42eb 100644 --- a/examples/C/grib_set_pv.c +++ b/examples/C/grib_set_pv.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/grib_set_pv.sh b/examples/C/grib_set_pv.sh index b4fcce81e..04604aedb 100755 --- a/examples/C/grib_set_pv.sh +++ b/examples/C/grib_set_pv.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/include.sh b/examples/C/include.sh index 472180fe3..2332e2a42 100644 --- a/examples/C/include.sh +++ b/examples/C/include.sh @@ -1,5 +1,5 @@ set -ea -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/large_grib1.c b/examples/C/large_grib1.c index 0bc5e0553..e69f1e563 100644 --- a/examples/C/large_grib1.c +++ b/examples/C/large_grib1.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/large_grib1.sh b/examples/C/large_grib1.sh index 77037d8da..03fa1943b 100755 --- a/examples/C/large_grib1.sh +++ b/examples/C/large_grib1.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/mars_param.c b/examples/C/mars_param.c index 4b53ed247..aff84d385 100644 --- a/examples/C/mars_param.c +++ b/examples/C/mars_param.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/multi2.c b/examples/C/multi2.c index e5a9e94cd..5f8c46fac 100644 --- a/examples/C/multi2.c +++ b/examples/C/multi2.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/nc.c b/examples/C/nc.c index 7b9294b4d..35b844f1e 100644 --- a/examples/C/nc.c +++ b/examples/C/nc.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/new_sample.c b/examples/C/new_sample.c index 887f8e011..a6a436ffa 100644 --- a/examples/C/new_sample.c +++ b/examples/C/new_sample.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/rename.sh b/examples/C/rename.sh index fec2d088c..943ac7054 100755 --- a/examples/C/rename.sh +++ b/examples/C/rename.sh @@ -1,5 +1,5 @@ #!/bin/ksh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/run_examples.sh b/examples/C/run_examples.sh index 04f953da8..6531070a4 100644 --- a/examples/C/run_examples.sh +++ b/examples/C/run_examples.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/set_missing.c b/examples/C/set_missing.c index e65c70483..cae2ab76a 100644 --- a/examples/C/set_missing.c +++ b/examples/C/set_missing.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/C/set_missing.sh b/examples/C/set_missing.sh index 0d3ecb1e3..a2d5b27d0 100755 --- a/examples/C/set_missing.sh +++ b/examples/C/set_missing.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/C/values_check.c b/examples/C/values_check.c index 2796668f0..abb155487 100644 --- a/examples/C/values_check.c +++ b/examples/C/values_check.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/F90/bufr_attributes.f90 b/examples/F90/bufr_attributes.f90 index 4ffe812bb..f1c3144dc 100644 --- a/examples/F90/bufr_attributes.f90 +++ b/examples/F90/bufr_attributes.f90 @@ -1,5 +1,4 @@ -! -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/bufr_attributes.sh b/examples/F90/bufr_attributes.sh index 0802d52ba..76d58abe0 100755 --- a/examples/F90/bufr_attributes.sh +++ b/examples/F90/bufr_attributes.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/bufr_clone.f90 b/examples/F90/bufr_clone.f90 index ae0c07772..a8567453d 100644 --- a/examples/F90/bufr_clone.f90 +++ b/examples/F90/bufr_clone.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/bufr_clone.sh b/examples/F90/bufr_clone.sh index 60a8fef97..54fdb9bff 100755 --- a/examples/F90/bufr_clone.sh +++ b/examples/F90/bufr_clone.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/bufr_copy_data.f90 b/examples/F90/bufr_copy_data.f90 index 1b561f70f..e45e8fae8 100644 --- a/examples/F90/bufr_copy_data.f90 +++ b/examples/F90/bufr_copy_data.f90 @@ -1,8 +1,7 @@ -! -!Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. +! 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. diff --git a/examples/F90/bufr_copy_data.sh b/examples/F90/bufr_copy_data.sh index 086e28d8d..a55f2a71b 100755 --- a/examples/F90/bufr_copy_data.sh +++ b/examples/F90/bufr_copy_data.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/bufr_copy_keys.f90 b/examples/F90/bufr_copy_keys.f90 index 94b6d3f70..119b08505 100644 --- a/examples/F90/bufr_copy_keys.f90 +++ b/examples/F90/bufr_copy_keys.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/bufr_copy_keys.sh b/examples/F90/bufr_copy_keys.sh index ecc109fb5..5f5fa6d3b 100755 --- a/examples/F90/bufr_copy_keys.sh +++ b/examples/F90/bufr_copy_keys.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/bufr_copy_message.f90 b/examples/F90/bufr_copy_message.f90 index 167a443d3..4c49fc50f 100644 --- a/examples/F90/bufr_copy_message.f90 +++ b/examples/F90/bufr_copy_message.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. @@ -7,8 +7,7 @@ ! virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. ! ! -! -! Description: how to copy a BUFR message in memory +! Description: how to copy a BUFR message in memory ! ! program copy diff --git a/examples/F90/bufr_copy_message.sh b/examples/F90/bufr_copy_message.sh index 4078bc01e..226a89119 100755 --- a/examples/F90/bufr_copy_message.sh +++ b/examples/F90/bufr_copy_message.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/bufr_expanded.f90 b/examples/F90/bufr_expanded.f90 index f16c554b3..8176b20b4 100644 --- a/examples/F90/bufr_expanded.f90 +++ b/examples/F90/bufr_expanded.f90 @@ -1,8 +1,7 @@ -! -!Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. +! 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. diff --git a/examples/F90/bufr_expanded.sh b/examples/F90/bufr_expanded.sh index ccf816306..8b75c97ca 100755 --- a/examples/F90/bufr_expanded.sh +++ b/examples/F90/bufr_expanded.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/bufr_get_keys.f90 b/examples/F90/bufr_get_keys.f90 index 80947c0e1..a391c3fd0 100644 --- a/examples/F90/bufr_get_keys.f90 +++ b/examples/F90/bufr_get_keys.f90 @@ -1,8 +1,7 @@ -! -!Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. +! 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. diff --git a/examples/F90/bufr_get_keys.sh b/examples/F90/bufr_get_keys.sh index 118abca06..6650f0ef3 100755 --- a/examples/F90/bufr_get_keys.sh +++ b/examples/F90/bufr_get_keys.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/bufr_get_string_array.f90 b/examples/F90/bufr_get_string_array.f90 index dbc4462b8..b5ce5549a 100644 --- a/examples/F90/bufr_get_string_array.f90 +++ b/examples/F90/bufr_get_string_array.f90 @@ -1,8 +1,7 @@ -! -!Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. +! 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. diff --git a/examples/F90/bufr_get_string_array.sh b/examples/F90/bufr_get_string_array.sh index e469e7cc5..e22728ec3 100755 --- a/examples/F90/bufr_get_string_array.sh +++ b/examples/F90/bufr_get_string_array.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/bufr_keys_iterator.f90 b/examples/F90/bufr_keys_iterator.f90 index 3c20c7172..94d98ee3b 100644 --- a/examples/F90/bufr_keys_iterator.f90 +++ b/examples/F90/bufr_keys_iterator.f90 @@ -1,8 +1,7 @@ -! -!Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. +! 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. @@ -15,7 +14,6 @@ ! codes_bufr_keys_iterator structure to get all the available ! keys in a BUFR message. ! -! program bufr_keys_iterator use eccodes implicit none diff --git a/examples/F90/bufr_keys_iterator.sh b/examples/F90/bufr_keys_iterator.sh index b3190cec2..80f9f58d5 100755 --- a/examples/F90/bufr_keys_iterator.sh +++ b/examples/F90/bufr_keys_iterator.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/bufr_read_header.f90 b/examples/F90/bufr_read_header.f90 index 2415a2b20..f9bcbf0b6 100644 --- a/examples/F90/bufr_read_header.f90 +++ b/examples/F90/bufr_read_header.f90 @@ -1,8 +1,7 @@ -! -!Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. +! 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. diff --git a/examples/F90/bufr_read_header.sh b/examples/F90/bufr_read_header.sh index 02993f895..c3be92506 100755 --- a/examples/F90/bufr_read_header.sh +++ b/examples/F90/bufr_read_header.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/bufr_read_scatterometer.f90 b/examples/F90/bufr_read_scatterometer.f90 index 16e615cc6..7b27b5be2 100644 --- a/examples/F90/bufr_read_scatterometer.f90 +++ b/examples/F90/bufr_read_scatterometer.f90 @@ -1,8 +1,7 @@ -! -!Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. +! 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. diff --git a/examples/F90/bufr_read_scatterometer.sh b/examples/F90/bufr_read_scatterometer.sh index 997e56a01..db2871134 100755 --- a/examples/F90/bufr_read_scatterometer.sh +++ b/examples/F90/bufr_read_scatterometer.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/bufr_read_synop.f90 b/examples/F90/bufr_read_synop.f90 index 31e0334fd..5932c7faa 100644 --- a/examples/F90/bufr_read_synop.f90 +++ b/examples/F90/bufr_read_synop.f90 @@ -1,8 +1,7 @@ -! -!Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. +! 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. diff --git a/examples/F90/bufr_read_synop.sh b/examples/F90/bufr_read_synop.sh index c6529abd5..902c75fcc 100755 --- a/examples/F90/bufr_read_synop.sh +++ b/examples/F90/bufr_read_synop.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/bufr_read_temp.f90 b/examples/F90/bufr_read_temp.f90 index ca5a5a876..1bd142741 100644 --- a/examples/F90/bufr_read_temp.f90 +++ b/examples/F90/bufr_read_temp.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/bufr_read_temp.sh b/examples/F90/bufr_read_temp.sh index 56573e14b..0b48d432c 100755 --- a/examples/F90/bufr_read_temp.sh +++ b/examples/F90/bufr_read_temp.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/bufr_read_tropical_cyclone.f90 b/examples/F90/bufr_read_tropical_cyclone.f90 index e1bc5560f..a8c1ba0d5 100644 --- a/examples/F90/bufr_read_tropical_cyclone.f90 +++ b/examples/F90/bufr_read_tropical_cyclone.f90 @@ -1,8 +1,7 @@ - -!Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. +! 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. diff --git a/examples/F90/bufr_read_tropical_cyclone.sh b/examples/F90/bufr_read_tropical_cyclone.sh index 0bc86aa95..03eda00e0 100755 --- a/examples/F90/bufr_read_tropical_cyclone.sh +++ b/examples/F90/bufr_read_tropical_cyclone.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/bufr_set_keys.f90 b/examples/F90/bufr_set_keys.f90 index 22705fe8d..a3cc6ac2d 100644 --- a/examples/F90/bufr_set_keys.f90 +++ b/examples/F90/bufr_set_keys.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/bufr_set_keys.sh b/examples/F90/bufr_set_keys.sh index fd8d2bd36..5f32bb6b8 100755 --- a/examples/F90/bufr_set_keys.sh +++ b/examples/F90/bufr_set_keys.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/bufr_subset.f90 b/examples/F90/bufr_subset.f90 index a8a327564..d23008fc7 100644 --- a/examples/F90/bufr_subset.f90 +++ b/examples/F90/bufr_subset.f90 @@ -1,8 +1,7 @@ -! -!Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. +! 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. diff --git a/examples/F90/bufr_subset.sh b/examples/F90/bufr_subset.sh index 80d44e649..8b70ac75a 100755 --- a/examples/F90/bufr_subset.sh +++ b/examples/F90/bufr_subset.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/get_fortran.f90 b/examples/F90/get_fortran.f90 index 5ebe81a07..6a9e53a51 100644 --- a/examples/F90/get_fortran.f90 +++ b/examples/F90/get_fortran.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/get_pl.f90 b/examples/F90/get_pl.f90 index 59b29108e..b364f4113 100644 --- a/examples/F90/get_pl.f90 +++ b/examples/F90/get_pl.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/get_pl.sh b/examples/F90/get_pl.sh index 2953dd9e7..7001252b9 100755 --- a/examples/F90/get_pl.sh +++ b/examples/F90/get_pl.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/get_product_kind.f90 b/examples/F90/get_product_kind.f90 index 91773151a..d446fde6b 100644 --- a/examples/F90/get_product_kind.f90 +++ b/examples/F90/get_product_kind.f90 @@ -1,8 +1,7 @@ -! -!Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. +! 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. diff --git a/examples/F90/get_product_kind.sh b/examples/F90/get_product_kind.sh index 217f5918f..734e15e75 100755 --- a/examples/F90/get_product_kind.sh +++ b/examples/F90/get_product_kind.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/get_pv.f90 b/examples/F90/get_pv.f90 index 1c9200a65..dcfcdb77a 100644 --- a/examples/F90/get_pv.f90 +++ b/examples/F90/get_pv.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. @@ -7,9 +7,7 @@ ! virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. ! ! -! -! Description: how to get PV values. -! +! Description: how to get PV values. ! ! program get_pv diff --git a/examples/F90/get_pv.sh b/examples/F90/get_pv.sh index ac432e076..568d8701c 100755 --- a/examples/F90/get_pv.sh +++ b/examples/F90/get_pv.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/get_set_uuid.f90 b/examples/F90/get_set_uuid.f90 index f4f4d6118..097285987 100644 --- a/examples/F90/get_set_uuid.f90 +++ b/examples/F90/get_set_uuid.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. @@ -7,9 +7,9 @@ ! virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. ! ! -! Description: get/set byte array in a grib2 message, using the uuid as example. +! Description: get/set byte array in a grib2 message, using the uuid as example. ! -! Original authors: Harald Anlauf, Doerte Liermann (DWD), Luis Kornblueh (MPIfM). +! Original authors: Harald Anlauf, Doerte Liermann (DWD), Luis Kornblueh (MPIfM). ! program get_set_uuid use eccodes diff --git a/examples/F90/get_set_uuid.sh b/examples/F90/get_set_uuid.sh index 9ba8c0398..cf512b777 100755 --- a/examples/F90/get_set_uuid.sh +++ b/examples/F90/get_set_uuid.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/grib_clone.f90 b/examples/F90/grib_clone.f90 index 232abc5fe..cb69e5935 100644 --- a/examples/F90/grib_clone.f90 +++ b/examples/F90/grib_clone.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/grib_clone.sh b/examples/F90/grib_clone.sh index f3d1361b6..5faaa86e1 100755 --- a/examples/F90/grib_clone.sh +++ b/examples/F90/grib_clone.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/grib_copy_message.f90 b/examples/F90/grib_copy_message.f90 index 159b3609d..2b7d23035 100644 --- a/examples/F90/grib_copy_message.f90 +++ b/examples/F90/grib_copy_message.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/grib_copy_message.sh b/examples/F90/grib_copy_message.sh index 730536d81..dec0cd93b 100755 --- a/examples/F90/grib_copy_message.sh +++ b/examples/F90/grib_copy_message.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/grib_copy_namespace.f90 b/examples/F90/grib_copy_namespace.f90 index 7ef09c36a..440f22dcd 100644 --- a/examples/F90/grib_copy_namespace.f90 +++ b/examples/F90/grib_copy_namespace.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/grib_copy_namespace.sh b/examples/F90/grib_copy_namespace.sh index b14af3632..53680f4dc 100755 --- a/examples/F90/grib_copy_namespace.sh +++ b/examples/F90/grib_copy_namespace.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/grib_count_messages.f90 b/examples/F90/grib_count_messages.f90 index ab977d70d..de63eba57 100644 --- a/examples/F90/grib_count_messages.f90 +++ b/examples/F90/grib_count_messages.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/grib_count_messages.sh b/examples/F90/grib_count_messages.sh index 1f08f31b1..196a88fe9 100755 --- a/examples/F90/grib_count_messages.sh +++ b/examples/F90/grib_count_messages.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/grib_count_messages_multi.f90 b/examples/F90/grib_count_messages_multi.f90 index 715464db8..75b6668fb 100644 --- a/examples/F90/grib_count_messages_multi.f90 +++ b/examples/F90/grib_count_messages_multi.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/grib_count_messages_multi.sh b/examples/F90/grib_count_messages_multi.sh index 2ce515ecb..ac63751a6 100755 --- a/examples/F90/grib_count_messages_multi.sh +++ b/examples/F90/grib_count_messages_multi.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/grib_ecc-671.f90 b/examples/F90/grib_ecc-671.f90 index c2a1d3f06..31d5aad80 100644 --- a/examples/F90/grib_ecc-671.f90 +++ b/examples/F90/grib_ecc-671.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/grib_ecc-671.sh b/examples/F90/grib_ecc-671.sh index 421f00b22..37a607f05 100755 --- a/examples/F90/grib_ecc-671.sh +++ b/examples/F90/grib_ecc-671.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/grib_get_data.f90 b/examples/F90/grib_get_data.f90 index 63492aa80..315c0fd05 100644 --- a/examples/F90/grib_get_data.f90 +++ b/examples/F90/grib_get_data.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/grib_get_data.sh b/examples/F90/grib_get_data.sh index 34097bfea..46d2f56a1 100755 --- a/examples/F90/grib_get_data.sh +++ b/examples/F90/grib_get_data.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/grib_get_keys.f90 b/examples/F90/grib_get_keys.f90 index 071a433bc..ca1bdb53f 100644 --- a/examples/F90/grib_get_keys.f90 +++ b/examples/F90/grib_get_keys.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/grib_get_keys.sh b/examples/F90/grib_get_keys.sh index b9b8fd42c..3f619e862 100755 --- a/examples/F90/grib_get_keys.sh +++ b/examples/F90/grib_get_keys.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/grib_index.f90 b/examples/F90/grib_index.f90 index bbb13ffaa..6195e2c05 100644 --- a/examples/F90/grib_index.f90 +++ b/examples/F90/grib_index.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/grib_index.sh b/examples/F90/grib_index.sh index d2259928a..687e16444 100755 --- a/examples/F90/grib_index.sh +++ b/examples/F90/grib_index.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/grib_keys_iterator.f90 b/examples/F90/grib_keys_iterator.f90 index 085ae093f..93b0d9d6f 100644 --- a/examples/F90/grib_keys_iterator.f90 +++ b/examples/F90/grib_keys_iterator.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/grib_keys_iterator.sh b/examples/F90/grib_keys_iterator.sh index e087d4bc6..9699c5c3e 100755 --- a/examples/F90/grib_keys_iterator.sh +++ b/examples/F90/grib_keys_iterator.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/grib_multi.f90 b/examples/F90/grib_multi.f90 index 98b5b833f..32f8e4f13 100644 --- a/examples/F90/grib_multi.f90 +++ b/examples/F90/grib_multi.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/grib_multi.sh b/examples/F90/grib_multi.sh index cb34d3d48..6aa776b29 100755 --- a/examples/F90/grib_multi.sh +++ b/examples/F90/grib_multi.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/grib_multi_write.f90 b/examples/F90/grib_multi_write.f90 index 6bd1eea8c..652971b94 100644 --- a/examples/F90/grib_multi_write.f90 +++ b/examples/F90/grib_multi_write.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/grib_multi_write.sh b/examples/F90/grib_multi_write.sh index cb2cd274e..02cb077a3 100755 --- a/examples/F90/grib_multi_write.sh +++ b/examples/F90/grib_multi_write.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/grib_nearest.f90 b/examples/F90/grib_nearest.f90 index 9dcb4b321..29735ebe8 100644 --- a/examples/F90/grib_nearest.f90 +++ b/examples/F90/grib_nearest.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/grib_nearest.sh b/examples/F90/grib_nearest.sh index 7c4110219..589ada1df 100755 --- a/examples/F90/grib_nearest.sh +++ b/examples/F90/grib_nearest.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/grib_precision.f90 b/examples/F90/grib_precision.f90 index 08d02aacb..f4dcc5918 100644 --- a/examples/F90/grib_precision.f90 +++ b/examples/F90/grib_precision.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/grib_precision.sh b/examples/F90/grib_precision.sh index 8d106930b..b048c04e2 100755 --- a/examples/F90/grib_precision.sh +++ b/examples/F90/grib_precision.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/grib_print_data.f90 b/examples/F90/grib_print_data.f90 index 909030f9f..9225908eb 100644 --- a/examples/F90/grib_print_data.f90 +++ b/examples/F90/grib_print_data.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/grib_print_data.sh b/examples/F90/grib_print_data.sh index 4d667c85d..31bdf42e3 100755 --- a/examples/F90/grib_print_data.sh +++ b/examples/F90/grib_print_data.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/grib_print_data_static.f90 b/examples/F90/grib_print_data_static.f90 index 0f9f071b3..28a64fff7 100644 --- a/examples/F90/grib_print_data_static.f90 +++ b/examples/F90/grib_print_data_static.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/grib_samples.f90 b/examples/F90/grib_samples.f90 index c2667572e..cd64b6a4b 100644 --- a/examples/F90/grib_samples.f90 +++ b/examples/F90/grib_samples.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/grib_samples.sh b/examples/F90/grib_samples.sh index ac6611a87..d77aeb8b1 100755 --- a/examples/F90/grib_samples.sh +++ b/examples/F90/grib_samples.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/grib_set_bitmap.f90 b/examples/F90/grib_set_bitmap.f90 index 20e0490d5..e9b4c064c 100644 --- a/examples/F90/grib_set_bitmap.f90 +++ b/examples/F90/grib_set_bitmap.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/grib_set_bitmap.sh b/examples/F90/grib_set_bitmap.sh index 534691605..5281a85db 100755 --- a/examples/F90/grib_set_bitmap.sh +++ b/examples/F90/grib_set_bitmap.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/grib_set_data.f90 b/examples/F90/grib_set_data.f90 index 65149f6c5..fcaa2711b 100644 --- a/examples/F90/grib_set_data.f90 +++ b/examples/F90/grib_set_data.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/grib_set_data.sh b/examples/F90/grib_set_data.sh index 9e63ddffe..f9810fb9e 100755 --- a/examples/F90/grib_set_data.sh +++ b/examples/F90/grib_set_data.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/grib_set_gvc.f90 b/examples/F90/grib_set_gvc.f90 index 5b570a8b8..994ead1e5 100644 --- a/examples/F90/grib_set_gvc.f90 +++ b/examples/F90/grib_set_gvc.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/grib_set_keys.f90 b/examples/F90/grib_set_keys.f90 index 123ead546..60e76e6f0 100644 --- a/examples/F90/grib_set_keys.f90 +++ b/examples/F90/grib_set_keys.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/grib_set_keys.sh b/examples/F90/grib_set_keys.sh index 79270a42c..58bd91d41 100755 --- a/examples/F90/grib_set_keys.sh +++ b/examples/F90/grib_set_keys.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/grib_set_missing.f90 b/examples/F90/grib_set_missing.f90 index 2b5abec52..e225b43eb 100644 --- a/examples/F90/grib_set_missing.f90 +++ b/examples/F90/grib_set_missing.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/grib_set_missing.sh b/examples/F90/grib_set_missing.sh index e0353668d..ceab6a360 100755 --- a/examples/F90/grib_set_missing.sh +++ b/examples/F90/grib_set_missing.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/grib_set_pv.f90 b/examples/F90/grib_set_pv.f90 index 7dbbc41d2..9b35fbd7f 100644 --- a/examples/F90/grib_set_pv.f90 +++ b/examples/F90/grib_set_pv.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/grib_set_pv.sh b/examples/F90/grib_set_pv.sh index 04f65ed0e..c7cd26009 100755 --- a/examples/F90/grib_set_pv.sh +++ b/examples/F90/grib_set_pv.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/include.sh b/examples/F90/include.sh index 54f716e40..74403ee37 100755 --- a/examples/F90/include.sh +++ b/examples/F90/include.sh @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/iterator_fortran.f90 b/examples/F90/iterator_fortran.f90 index e540daa3d..73761833e 100644 --- a/examples/F90/iterator_fortran.f90 +++ b/examples/F90/iterator_fortran.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/keys_iterator_fortran.f90 b/examples/F90/keys_iterator_fortran.f90 index 5be973a7a..6181948ea 100644 --- a/examples/F90/keys_iterator_fortran.f90 +++ b/examples/F90/keys_iterator_fortran.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/multi_fortran.f90 b/examples/F90/multi_fortran.f90 index ab08f1943..f8ecd3f40 100644 --- a/examples/F90/multi_fortran.f90 +++ b/examples/F90/multi_fortran.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/new_from_file.f90 b/examples/F90/new_from_file.f90 index 6b4459f62..a80010f4b 100644 --- a/examples/F90/new_from_file.f90 +++ b/examples/F90/new_from_file.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/precision_fortran.f90 b/examples/F90/precision_fortran.f90 index 61db04510..7481140b6 100644 --- a/examples/F90/precision_fortran.f90 +++ b/examples/F90/precision_fortran.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/print_data_fortran.f90 b/examples/F90/print_data_fortran.f90 index 55983e66e..731df8947 100644 --- a/examples/F90/print_data_fortran.f90 +++ b/examples/F90/print_data_fortran.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/read_from_file.f90 b/examples/F90/read_from_file.f90 index 97835cf75..112d19f02 100644 --- a/examples/F90/read_from_file.f90 +++ b/examples/F90/read_from_file.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/read_from_file.sh b/examples/F90/read_from_file.sh index 886016d48..116ffe8e1 100755 --- a/examples/F90/read_from_file.sh +++ b/examples/F90/read_from_file.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/read_message.f90 b/examples/F90/read_message.f90 index 131a39b34..cb4dee699 100644 --- a/examples/F90/read_message.f90 +++ b/examples/F90/read_message.f90 @@ -1,5 +1,4 @@ -! -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/read_message.sh b/examples/F90/read_message.sh index b2ada6a55..04d6cbcfe 100755 --- a/examples/F90/read_message.sh +++ b/examples/F90/read_message.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/F90/set_fortran.f90 b/examples/F90/set_fortran.f90 index 0579e6a83..d976c1256 100644 --- a/examples/F90/set_fortran.f90 +++ b/examples/F90/set_fortran.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/F90/set_missing_fortran.f90 b/examples/F90/set_missing_fortran.f90 index ef2837ed1..afb1cbd73 100644 --- a/examples/F90/set_missing_fortran.f90 +++ b/examples/F90/set_missing_fortran.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/deprecated/fieldset.c b/examples/deprecated/fieldset.c index 91909058e..a4d53f559 100644 --- a/examples/deprecated/fieldset.c +++ b/examples/deprecated/fieldset.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/deprecated/get.c b/examples/deprecated/get.c index 149676e86..ebe6e273a 100644 --- a/examples/deprecated/get.c +++ b/examples/deprecated/get.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/deprecated/get_fortran.F b/examples/deprecated/get_fortran.F index 3cedfaa7d..7a546222c 100644 --- a/examples/deprecated/get_fortran.F +++ b/examples/deprecated/get_fortran.F @@ -1,4 +1,4 @@ -C Copyright 2005-2019 ECMWF. +C (C) Copyright 2005- ECMWF. C C This software is licensed under the terms of the Apache Licence Version 2.0 C which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. diff --git a/examples/deprecated/grib_precipitation.c b/examples/deprecated/grib_precipitation.c index 8fa29e696..943899188 100644 --- a/examples/deprecated/grib_precipitation.c +++ b/examples/deprecated/grib_precipitation.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/deprecated/iterator.c b/examples/deprecated/iterator.c index 57457c54a..6f66e090a 100644 --- a/examples/deprecated/iterator.c +++ b/examples/deprecated/iterator.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/deprecated/iterator_fortran.F b/examples/deprecated/iterator_fortran.F index caa1b55d5..b2c42de07 100644 --- a/examples/deprecated/iterator_fortran.F +++ b/examples/deprecated/iterator_fortran.F @@ -1,4 +1,4 @@ -C Copyright 2005-2019 ECMWF. +C (C) Copyright 2005- ECMWF. C C This software is licensed under the terms of the Apache Licence Version 2.0 C which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. diff --git a/examples/deprecated/keys_iterator.c b/examples/deprecated/keys_iterator.c index a82ae527d..e8273eddd 100644 --- a/examples/deprecated/keys_iterator.c +++ b/examples/deprecated/keys_iterator.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/deprecated/keys_iterator_fortran.F b/examples/deprecated/keys_iterator_fortran.F index f173be932..5ab2bac48 100644 --- a/examples/deprecated/keys_iterator_fortran.F +++ b/examples/deprecated/keys_iterator_fortran.F @@ -1,4 +1,4 @@ -C Copyright 2005-2019 ECMWF. +C (C) Copyright 2005- ECMWF. C C This software is licensed under the terms of the Apache Licence Version 2.0 C which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. diff --git a/examples/deprecated/multi.c b/examples/deprecated/multi.c index c9171ebc4..954234638 100644 --- a/examples/deprecated/multi.c +++ b/examples/deprecated/multi.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/deprecated/multi_fortran.F b/examples/deprecated/multi_fortran.F index 2f143f1c2..b1581ff20 100644 --- a/examples/deprecated/multi_fortran.F +++ b/examples/deprecated/multi_fortran.F @@ -1,4 +1,4 @@ -C Copyright 2005-2019 ECMWF. +C (C) Copyright 2005- ECMWF. C C This software is licensed under the terms of the Apache Licence Version 2.0 C which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. diff --git a/examples/deprecated/nearest.c b/examples/deprecated/nearest.c index 0b3b864b8..c1acd5c73 100644 --- a/examples/deprecated/nearest.c +++ b/examples/deprecated/nearest.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/deprecated/precision.c b/examples/deprecated/precision.c index 71cb1c076..edd52839e 100644 --- a/examples/deprecated/precision.c +++ b/examples/deprecated/precision.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/deprecated/precision_fortran.F b/examples/deprecated/precision_fortran.F index fe44f380b..621b88526 100644 --- a/examples/deprecated/precision_fortran.F +++ b/examples/deprecated/precision_fortran.F @@ -1,4 +1,4 @@ -C Copyright 2005-2019 ECMWF. +C (C) Copyright 2005- ECMWF. C C This software is licensed under the terms of the Apache Licence Version 2.0 C which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. diff --git a/examples/deprecated/print_data.c b/examples/deprecated/print_data.c index ba2c89557..2362bd0ea 100644 --- a/examples/deprecated/print_data.c +++ b/examples/deprecated/print_data.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/deprecated/print_data_fortran.F b/examples/deprecated/print_data_fortran.F index 25a61b62a..31aef8259 100644 --- a/examples/deprecated/print_data_fortran.F +++ b/examples/deprecated/print_data_fortran.F @@ -1,4 +1,4 @@ -C Copyright 2005-2019 ECMWF. +C (C) Copyright 2005- ECMWF. C C This software is licensed under the terms of the Apache Licence Version 2.0 C which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. diff --git a/examples/deprecated/set.c b/examples/deprecated/set.c index 602ded937..c1f26adb5 100644 --- a/examples/deprecated/set.c +++ b/examples/deprecated/set.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/deprecated/set_bitmap.c b/examples/deprecated/set_bitmap.c index e9dc4a745..dc9817243 100644 --- a/examples/deprecated/set_bitmap.c +++ b/examples/deprecated/set_bitmap.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/deprecated/set_fortran.F b/examples/deprecated/set_fortran.F index 4058ab53a..74e76963f 100644 --- a/examples/deprecated/set_fortran.F +++ b/examples/deprecated/set_fortran.F @@ -1,4 +1,4 @@ -C Copyright 2005-2019 ECMWF. +C (C) Copyright 2005- ECMWF. C C This software is licensed under the terms of the Apache Licence Version 2.0 C which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. diff --git a/examples/deprecated/set_pv.c b/examples/deprecated/set_pv.c index 0e3fbace5..73db1dcfc 100644 --- a/examples/deprecated/set_pv.c +++ b/examples/deprecated/set_pv.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/deprecated/set_pv_fortran.F b/examples/deprecated/set_pv_fortran.F index 47b9cea5a..5f0ebf7fa 100644 --- a/examples/deprecated/set_pv_fortran.F +++ b/examples/deprecated/set_pv_fortran.F @@ -1,4 +1,4 @@ -C Copyright 2005-2019 ECMWF. +C (C) Copyright 2005- ECMWF. C C This software is licensed under the terms of the Apache Licence Version 2.0 C which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. diff --git a/examples/extra/ens_mean.f90 b/examples/extra/ens_mean.f90 index 653abdddd..15a017beb 100644 --- a/examples/extra/ens_mean.f90 +++ b/examples/extra/ens_mean.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/extra/f_clone.f90 b/examples/extra/f_clone.f90 index 17f29297d..7eedd1dfe 100755 --- a/examples/extra/f_clone.f90 +++ b/examples/extra/f_clone.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/extra/message_count_multi.f90 b/examples/extra/message_count_multi.f90 index 4e10fca3a..521c28a28 100644 --- a/examples/extra/message_count_multi.f90 +++ b/examples/extra/message_count_multi.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/examples/python/binary_message.py b/examples/python/binary_message.py index 11049f66f..de6016361 100644 --- a/examples/python/binary_message.py +++ b/examples/python/binary_message.py @@ -1,5 +1,5 @@ # -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/bufr_attributes.py b/examples/python/bufr_attributes.py index f9de3251b..b3661fa3b 100644 --- a/examples/python/bufr_attributes.py +++ b/examples/python/bufr_attributes.py @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/bufr_attributes.sh b/examples/python/bufr_attributes.sh index 71aa171b8..767209079 100755 --- a/examples/python/bufr_attributes.sh +++ b/examples/python/bufr_attributes.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/bufr_clone.py b/examples/python/bufr_clone.py index 243c2e38e..1a54b9b79 100644 --- a/examples/python/bufr_clone.py +++ b/examples/python/bufr_clone.py @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/bufr_clone.sh b/examples/python/bufr_clone.sh index 53624e38a..ff6fd4a35 100755 --- a/examples/python/bufr_clone.sh +++ b/examples/python/bufr_clone.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/bufr_copy_data.py b/examples/python/bufr_copy_data.py index f56a87612..b65e47124 100644 --- a/examples/python/bufr_copy_data.py +++ b/examples/python/bufr_copy_data.py @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/bufr_copy_data.sh b/examples/python/bufr_copy_data.sh index 3c9265711..6acb71c0f 100755 --- a/examples/python/bufr_copy_data.sh +++ b/examples/python/bufr_copy_data.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/bufr_copy_data2.py b/examples/python/bufr_copy_data2.py index 03f9b423f..5e6f54c7a 100644 --- a/examples/python/bufr_copy_data2.py +++ b/examples/python/bufr_copy_data2.py @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/bufr_copy_data3.py b/examples/python/bufr_copy_data3.py index 92cf65228..9cf11ae81 100644 --- a/examples/python/bufr_copy_data3.py +++ b/examples/python/bufr_copy_data3.py @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/bufr_ecc-448.py b/examples/python/bufr_ecc-448.py index f441f769c..7216df4b6 100644 --- a/examples/python/bufr_ecc-448.py +++ b/examples/python/bufr_ecc-448.py @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/bufr_ecc-448.sh b/examples/python/bufr_ecc-448.sh index 802266dd1..1e12ff39c 100755 --- a/examples/python/bufr_ecc-448.sh +++ b/examples/python/bufr_ecc-448.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/bufr_ecc-869.sh b/examples/python/bufr_ecc-869.sh index c874445a2..fc5721d7b 100755 --- a/examples/python/bufr_ecc-869.sh +++ b/examples/python/bufr_ecc-869.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/bufr_encode_flight.py b/examples/python/bufr_encode_flight.py index cc302f125..9d6c9e13f 100644 --- a/examples/python/bufr_encode_flight.py +++ b/examples/python/bufr_encode_flight.py @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/bufr_expanded.py b/examples/python/bufr_expanded.py index e26f04fb8..3b3df93ee 100644 --- a/examples/python/bufr_expanded.py +++ b/examples/python/bufr_expanded.py @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/bufr_expanded.sh b/examples/python/bufr_expanded.sh index 89fdbf01b..735619e20 100755 --- a/examples/python/bufr_expanded.sh +++ b/examples/python/bufr_expanded.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/bufr_get_keys.py b/examples/python/bufr_get_keys.py index 24c23ec96..a204c69a2 100644 --- a/examples/python/bufr_get_keys.py +++ b/examples/python/bufr_get_keys.py @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/bufr_get_keys.sh b/examples/python/bufr_get_keys.sh index 186ea268c..0b1632465 100755 --- a/examples/python/bufr_get_keys.sh +++ b/examples/python/bufr_get_keys.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/bufr_keys_iterator.py b/examples/python/bufr_keys_iterator.py index 1ddbabafb..dbc48e6b3 100644 --- a/examples/python/bufr_keys_iterator.py +++ b/examples/python/bufr_keys_iterator.py @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/bufr_keys_iterator.sh b/examples/python/bufr_keys_iterator.sh index ff537b70f..5e9928ee4 100755 --- a/examples/python/bufr_keys_iterator.sh +++ b/examples/python/bufr_keys_iterator.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/bufr_read_header.py b/examples/python/bufr_read_header.py index f8e20b076..163568dc6 100644 --- a/examples/python/bufr_read_header.py +++ b/examples/python/bufr_read_header.py @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/bufr_read_sample.py b/examples/python/bufr_read_sample.py index d7c21b15e..4d66122cb 100644 --- a/examples/python/bufr_read_sample.py +++ b/examples/python/bufr_read_sample.py @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/bufr_read_sample.sh b/examples/python/bufr_read_sample.sh index fabfff5c6..8bd439d4e 100755 --- a/examples/python/bufr_read_sample.sh +++ b/examples/python/bufr_read_sample.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/bufr_read_scatterometer.py b/examples/python/bufr_read_scatterometer.py index c387410c1..da52ffe22 100644 --- a/examples/python/bufr_read_scatterometer.py +++ b/examples/python/bufr_read_scatterometer.py @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/bufr_read_scatterometer.sh b/examples/python/bufr_read_scatterometer.sh index f586d902b..c3dddd49d 100755 --- a/examples/python/bufr_read_scatterometer.sh +++ b/examples/python/bufr_read_scatterometer.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/bufr_read_synop.py b/examples/python/bufr_read_synop.py index 38c4f69b9..82496c18c 100644 --- a/examples/python/bufr_read_synop.py +++ b/examples/python/bufr_read_synop.py @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/bufr_read_synop.sh b/examples/python/bufr_read_synop.sh index 8e4fb79aa..91d48a2fd 100755 --- a/examples/python/bufr_read_synop.sh +++ b/examples/python/bufr_read_synop.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/bufr_read_temp.py b/examples/python/bufr_read_temp.py index 7dbd14b35..10e554312 100644 --- a/examples/python/bufr_read_temp.py +++ b/examples/python/bufr_read_temp.py @@ -1,5 +1,5 @@ # -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/bufr_read_temp.sh b/examples/python/bufr_read_temp.sh index 4ffa0927f..7a08ccab3 100755 --- a/examples/python/bufr_read_temp.sh +++ b/examples/python/bufr_read_temp.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/bufr_read_tropical_cyclone.py b/examples/python/bufr_read_tropical_cyclone.py index daf58da0a..7fe8aabcb 100644 --- a/examples/python/bufr_read_tropical_cyclone.py +++ b/examples/python/bufr_read_tropical_cyclone.py @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/bufr_read_tropical_cyclone.sh b/examples/python/bufr_read_tropical_cyclone.sh index db93bd3c1..75e07f02f 100755 --- a/examples/python/bufr_read_tropical_cyclone.sh +++ b/examples/python/bufr_read_tropical_cyclone.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/bufr_set_keys.py b/examples/python/bufr_set_keys.py index 2a238aa87..1b48b2478 100644 --- a/examples/python/bufr_set_keys.py +++ b/examples/python/bufr_set_keys.py @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/bufr_set_keys.sh b/examples/python/bufr_set_keys.sh index bc1c87221..7015ed87b 100755 --- a/examples/python/bufr_set_keys.sh +++ b/examples/python/bufr_set_keys.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/bufr_subset.py b/examples/python/bufr_subset.py index ba949e6f5..9e20a3dc4 100644 --- a/examples/python/bufr_subset.py +++ b/examples/python/bufr_subset.py @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/bufr_subset.sh b/examples/python/bufr_subset.sh index 789130a01..26b2c73a8 100755 --- a/examples/python/bufr_subset.sh +++ b/examples/python/bufr_subset.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/get_product_kind.py b/examples/python/get_product_kind.py index 640420b7b..7813315ca 100644 --- a/examples/python/get_product_kind.py +++ b/examples/python/get_product_kind.py @@ -1,5 +1,5 @@ # -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/get_product_kind.sh b/examples/python/get_product_kind.sh index c08272c87..bb233eabb 100755 --- a/examples/python/get_product_kind.sh +++ b/examples/python/get_product_kind.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/grib_ccsds.py b/examples/python/grib_ccsds.py index e8feb5ed1..d171daa70 100644 --- a/examples/python/grib_ccsds.py +++ b/examples/python/grib_ccsds.py @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/grib_clone.py b/examples/python/grib_clone.py index c7d1f487d..531ea22bb 100644 --- a/examples/python/grib_clone.py +++ b/examples/python/grib_clone.py @@ -1,5 +1,5 @@ # -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/grib_count_messages.c b/examples/python/grib_count_messages.c index 17bfbd46c..db604fa50 100644 --- a/examples/python/grib_count_messages.c +++ b/examples/python/grib_count_messages.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/python/grib_count_messages.py b/examples/python/grib_count_messages.py index 0747c6a65..28df17bd3 100644 --- a/examples/python/grib_count_messages.py +++ b/examples/python/grib_count_messages.py @@ -1,5 +1,5 @@ # -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/grib_get_keys.py b/examples/python/grib_get_keys.py index cdf558938..1d94f492d 100644 --- a/examples/python/grib_get_keys.py +++ b/examples/python/grib_get_keys.py @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/grib_get_message_offset.py b/examples/python/grib_get_message_offset.py index 39825da21..32583980e 100644 --- a/examples/python/grib_get_message_offset.py +++ b/examples/python/grib_get_message_offset.py @@ -1,5 +1,5 @@ # -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/grib_get_message_offset.sh b/examples/python/grib_get_message_offset.sh index bd9aa0938..03c8671c8 100755 --- a/examples/python/grib_get_message_offset.sh +++ b/examples/python/grib_get_message_offset.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/grib_index.py b/examples/python/grib_index.py index 5ab535783..b13cdae67 100644 --- a/examples/python/grib_index.py +++ b/examples/python/grib_index.py @@ -1,5 +1,5 @@ # -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/grib_iterator.c b/examples/python/grib_iterator.c index ad38d99e2..94d6987bf 100644 --- a/examples/python/grib_iterator.c +++ b/examples/python/grib_iterator.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/python/grib_iterator.py b/examples/python/grib_iterator.py index ac835e812..cdb984eea 100644 --- a/examples/python/grib_iterator.py +++ b/examples/python/grib_iterator.py @@ -1,5 +1,5 @@ # -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/grib_iterator_bitmap.py b/examples/python/grib_iterator_bitmap.py index c1901cc42..c2937de9b 100644 --- a/examples/python/grib_iterator_bitmap.py +++ b/examples/python/grib_iterator_bitmap.py @@ -1,5 +1,5 @@ # -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/grib_keys_iterator.c b/examples/python/grib_keys_iterator.c index 2b71340ab..aaf3d6ac8 100644 --- a/examples/python/grib_keys_iterator.c +++ b/examples/python/grib_keys_iterator.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/python/grib_keys_iterator.py b/examples/python/grib_keys_iterator.py index c79d4e455..237c016f3 100644 --- a/examples/python/grib_keys_iterator.py +++ b/examples/python/grib_keys_iterator.py @@ -1,5 +1,5 @@ # -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/grib_ls_JSON.py b/examples/python/grib_ls_JSON.py index d692a2452..685687070 100644 --- a/examples/python/grib_ls_JSON.py +++ b/examples/python/grib_ls_JSON.py @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/grib_multi_write.py b/examples/python/grib_multi_write.py index 4b0528ae6..e4386b9cf 100644 --- a/examples/python/grib_multi_write.py +++ b/examples/python/grib_multi_write.py @@ -1,5 +1,5 @@ # -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/grib_nearest.py b/examples/python/grib_nearest.py index 493d42b98..5eed9dff7 100644 --- a/examples/python/grib_nearest.py +++ b/examples/python/grib_nearest.py @@ -1,5 +1,5 @@ # -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/grib_print_data.c b/examples/python/grib_print_data.c index cf4647e36..c6933c6aa 100644 --- a/examples/python/grib_print_data.c +++ b/examples/python/grib_print_data.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/examples/python/grib_print_data.py b/examples/python/grib_print_data.py index d68faf65f..735479e01 100644 --- a/examples/python/grib_print_data.py +++ b/examples/python/grib_print_data.py @@ -1,5 +1,5 @@ # -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/grib_read_sample.py b/examples/python/grib_read_sample.py index 6af421392..d044f5c7c 100644 --- a/examples/python/grib_read_sample.py +++ b/examples/python/grib_read_sample.py @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/grib_read_sample.sh b/examples/python/grib_read_sample.sh index ed3e33749..37e29224a 100755 --- a/examples/python/grib_read_sample.sh +++ b/examples/python/grib_read_sample.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/grib_samples.py b/examples/python/grib_samples.py index 8a7cf059a..7be5cbbbc 100644 --- a/examples/python/grib_samples.py +++ b/examples/python/grib_samples.py @@ -1,5 +1,5 @@ # -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/grib_set_bitmap.py b/examples/python/grib_set_bitmap.py index db6be3372..d7e7f1ec6 100644 --- a/examples/python/grib_set_bitmap.py +++ b/examples/python/grib_set_bitmap.py @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/grib_set_keys.py b/examples/python/grib_set_keys.py index ac26840eb..c48edc84d 100644 --- a/examples/python/grib_set_keys.py +++ b/examples/python/grib_set_keys.py @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/grib_set_missing.py b/examples/python/grib_set_missing.py index c9259751a..703977b8f 100644 --- a/examples/python/grib_set_missing.py +++ b/examples/python/grib_set_missing.py @@ -1,5 +1,5 @@ # -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/grib_set_pv.py b/examples/python/grib_set_pv.py index 8e22e7909..e85f174e7 100644 --- a/examples/python/grib_set_pv.py +++ b/examples/python/grib_set_pv.py @@ -1,5 +1,5 @@ # -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/gts_get_keys.py b/examples/python/gts_get_keys.py index db837534b..1c9932889 100644 --- a/examples/python/gts_get_keys.py +++ b/examples/python/gts_get_keys.py @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/gts_get_keys.sh b/examples/python/gts_get_keys.sh index c0ac8564b..8279c1a55 100755 --- a/examples/python/gts_get_keys.sh +++ b/examples/python/gts_get_keys.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/keys_iterator_gts.py b/examples/python/keys_iterator_gts.py index a5df0f1e3..409546e8a 100644 --- a/examples/python/keys_iterator_gts.py +++ b/examples/python/keys_iterator_gts.py @@ -1,5 +1,5 @@ # -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/metar_get_keys.py b/examples/python/metar_get_keys.py index 66646e2f9..292b82450 100644 --- a/examples/python/metar_get_keys.py +++ b/examples/python/metar_get_keys.py @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/examples/python/metar_get_keys.sh b/examples/python/metar_get_keys.sh index b7833df06..c794df4da 100755 --- a/examples/python/metar_get_keys.sh +++ b/examples/python/metar_get_keys.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/fortran/create_grib_f90.sh b/fortran/create_grib_f90.sh index c7e006eac..26b132a84 100755 --- a/fortran/create_grib_f90.sh +++ b/fortran/create_grib_f90.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/fortran/eccodes_f90_head.f90 b/fortran/eccodes_f90_head.f90 index ee4dcdb4c..a93c62faa 100644 --- a/fortran/eccodes_f90_head.f90 +++ b/fortran/eccodes_f90_head.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/fortran/eccodes_f90_int.f90 b/fortran/eccodes_f90_int.f90 index a5ca7898c..f3062c6e4 100644 --- a/fortran/eccodes_f90_int.f90 +++ b/fortran/eccodes_f90_int.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/fortran/eccodes_f90_int_size_t.f90 b/fortran/eccodes_f90_int_size_t.f90 index 2282ca4e4..b33bc5617 100644 --- a/fortran/eccodes_f90_int_size_t.f90 +++ b/fortran/eccodes_f90_int_size_t.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/fortran/eccodes_f90_long_int.f90 b/fortran/eccodes_f90_long_int.f90 index e3f582cdf..abb465493 100644 --- a/fortran/eccodes_f90_long_int.f90 +++ b/fortran/eccodes_f90_long_int.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/fortran/eccodes_f90_long_size_t.f90 b/fortran/eccodes_f90_long_size_t.f90 index 968ddc6f6..282d3cf89 100644 --- a/fortran/eccodes_f90_long_size_t.f90 +++ b/fortran/eccodes_f90_long_size_t.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/fortran/grib_f77.c b/fortran/grib_f77.c index 792eaf45d..8c10c44b9 100644 --- a/fortran/grib_f77.c +++ b/fortran/grib_f77.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/fortran/grib_f90_head.f90 b/fortran/grib_f90_head.f90 index 5045d8365..987203b2d 100644 --- a/fortran/grib_f90_head.f90 +++ b/fortran/grib_f90_head.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/fortran/grib_f90_int.f90 b/fortran/grib_f90_int.f90 index 719abd440..ec4307d40 100644 --- a/fortran/grib_f90_int.f90 +++ b/fortran/grib_f90_int.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/fortran/grib_f90_int_size_t.f90 b/fortran/grib_f90_int_size_t.f90 index e83ba2721..bd6cf83de 100644 --- a/fortran/grib_f90_int_size_t.f90 +++ b/fortran/grib_f90_int_size_t.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/fortran/grib_f90_long_int.f90 b/fortran/grib_f90_long_int.f90 index 002d3b3a3..53a4e2829 100644 --- a/fortran/grib_f90_long_int.f90 +++ b/fortran/grib_f90_long_int.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/fortran/grib_f90_long_size_t.f90 b/fortran/grib_f90_long_size_t.f90 index 39d61ec3b..74ad5b0ce 100644 --- a/fortran/grib_f90_long_size_t.f90 +++ b/fortran/grib_f90_long_size_t.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/fortran/grib_fortran.c b/fortran/grib_fortran.c index a804e2c6c..1d6743f33 100644 --- a/fortran/grib_fortran.c +++ b/fortran/grib_fortran.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/fortran/grib_fortran_kinds.c b/fortran/grib_fortran_kinds.c index ffd8780b0..413a0d164 100644 --- a/fortran/grib_fortran_kinds.c +++ b/fortran/grib_fortran_kinds.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/fortran/grib_fortran_prototypes.h b/fortran/grib_fortran_prototypes.h index 1676eefac..3b7b5b3c6 100644 --- a/fortran/grib_fortran_prototypes.h +++ b/fortran/grib_fortran_prototypes.h @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/fortran/grib_types.f90 b/fortran/grib_types.f90 index e6eaff47f..d897deaa0 100644 --- a/fortran/grib_types.f90 +++ b/fortran/grib_types.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/fortran/same_int_long.f90 b/fortran/same_int_long.f90 index 41a7d82f6..15603a0c5 100644 --- a/fortran/same_int_long.f90 +++ b/fortran/same_int_long.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/fortran/same_int_size_t.f90 b/fortran/same_int_size_t.f90 index d28dfffa5..049be5034 100644 --- a/fortran/same_int_size_t.f90 +++ b/fortran/same_int_size_t.f90 @@ -1,4 +1,4 @@ -! Copyright 2005-2019 ECMWF. +! (C) Copyright 2005- 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. diff --git a/perf/jmeter.awk b/perf/jmeter.awk index 603a848f5..8b8daa9ee 100644 --- a/perf/jmeter.awk +++ b/perf/jmeter.awk @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/perf/time.sh b/perf/time.sh index b16be6052..12e22cf2b 100755 --- a/perf/time.sh +++ b/perf/time.sh @@ -1,6 +1,6 @@ # This script times stuff to get nice reports -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/perl/GRIB-API/README b/perl/GRIB-API/README index 6b4f38114..3284308c2 100644 --- a/perl/GRIB-API/README +++ b/perl/GRIB-API/README @@ -28,7 +28,7 @@ This module requires these other modules and libraries: blah blah blah COPYRIGHT AND LICENCE -Copyright 2005-2019 ECMWF. +(C) Copyright 2005- 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. diff --git a/perl/GRIB-API/convert.pl b/perl/GRIB-API/convert.pl index 0c9a7a97d..8399457b3 100755 --- a/perl/GRIB-API/convert.pl +++ b/perl/GRIB-API/convert.pl @@ -1,5 +1,5 @@ #!/usr/bin/perl -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/perl/GRIB-API/lib/GRIB/API.pm b/perl/GRIB-API/lib/GRIB/API.pm index 4e194dbd8..bf87fe2f7 100644 --- a/perl/GRIB-API/lib/GRIB/API.pm +++ b/perl/GRIB-API/lib/GRIB/API.pm @@ -86,7 +86,7 @@ If you have a web site set up for your module, mention it here. Baudouin Raoult =head1 COPYRIGHT AND LICENSE -Copyright 2005-2019 ECMWF. +(C) Copyright 2005- 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. diff --git a/perl/GRIB-API/test.pl b/perl/GRIB-API/test.pl index 36f80ea1e..e36b2c8ab 100755 --- a/perl/GRIB-API/test.pl +++ b/perl/GRIB-API/test.pl @@ -1,5 +1,5 @@ #!/usr/local/bin/perl56 -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/python/grib_interface.c b/python/grib_interface.c index cb6732d42..285e50616 100644 --- a/python/grib_interface.c +++ b/python/grib_interface.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/python/gribapi.c b/python/gribapi.c index 2c9f15d94..c74cce942 100644 --- a/python/gribapi.c +++ b/python/gribapi.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/python3/grib_interface.c b/python3/grib_interface.c index c3f8db02f..38ebaf0d1 100644 --- a/python3/grib_interface.c +++ b/python3/grib_interface.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/python3/gribapi.c b/python3/gribapi.c index 2c9f15d94..c74cce942 100644 --- a/python3/gribapi.c +++ b/python3/gribapi.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/show_compile.sh b/show_compile.sh index b9b458245..ad54fc20a 100755 --- a/show_compile.sh +++ b/show_compile.sh @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 95587cc75..6ebabd2db 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/src/action.c b/src/action.c index 02f16b270..18e53e36c 100644 --- a/src/action.c +++ b/src/action.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/action_class_alias.c b/src/action_class_alias.c index 498022162..0e91454f0 100644 --- a/src/action_class_alias.c +++ b/src/action_class_alias.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/action_class_assert.c b/src/action_class_assert.c index 37df3ae85..f908f5847 100644 --- a/src/action_class_assert.c +++ b/src/action_class_assert.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/action_class_close.c b/src/action_class_close.c index fcf7ae317..475ada745 100644 --- a/src/action_class_close.c +++ b/src/action_class_close.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/action_class_concept.c b/src/action_class_concept.c index c35b87514..e6991b849 100644 --- a/src/action_class_concept.c +++ b/src/action_class_concept.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/action_class_gen.c b/src/action_class_gen.c index 465456780..ffa305a5f 100644 --- a/src/action_class_gen.c +++ b/src/action_class_gen.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/action_class_hash_array.c b/src/action_class_hash_array.c index 69ae83811..bdfcf9014 100644 --- a/src/action_class_hash_array.c +++ b/src/action_class_hash_array.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/action_class_if.c b/src/action_class_if.c index 9838871c4..251bdc2e0 100644 --- a/src/action_class_if.c +++ b/src/action_class_if.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/action_class_list.c b/src/action_class_list.c index d776563d6..a27464537 100644 --- a/src/action_class_list.c +++ b/src/action_class_list.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/action_class_meta.c b/src/action_class_meta.c index 4cddc5528..fd4ba592f 100644 --- a/src/action_class_meta.c +++ b/src/action_class_meta.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/action_class_modify.c b/src/action_class_modify.c index 588c22129..56013b3ff 100644 --- a/src/action_class_modify.c +++ b/src/action_class_modify.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/action_class_noop.c b/src/action_class_noop.c index c6200daad..f8bbc4932 100644 --- a/src/action_class_noop.c +++ b/src/action_class_noop.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/action_class_print.c b/src/action_class_print.c index 872a1e182..63172b353 100644 --- a/src/action_class_print.c +++ b/src/action_class_print.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/action_class_put.c b/src/action_class_put.c index c8423e075..8a1dff621 100644 --- a/src/action_class_put.c +++ b/src/action_class_put.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/action_class_remove.c b/src/action_class_remove.c index 1470eb50a..001442e4c 100644 --- a/src/action_class_remove.c +++ b/src/action_class_remove.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/action_class_rename.c b/src/action_class_rename.c index 8480dab9b..68d90618c 100644 --- a/src/action_class_rename.c +++ b/src/action_class_rename.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/action_class_section.c b/src/action_class_section.c index 2ade627d8..2af2bef51 100644 --- a/src/action_class_section.c +++ b/src/action_class_section.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/action_class_set.c b/src/action_class_set.c index e95adc010..f843b1f45 100644 --- a/src/action_class_set.c +++ b/src/action_class_set.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/action_class_set_darray.c b/src/action_class_set_darray.c index bac34f26c..7b5a9ecf1 100644 --- a/src/action_class_set_darray.c +++ b/src/action_class_set_darray.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/action_class_set_iarray.c b/src/action_class_set_iarray.c index d0c52f0fb..08ed7b86b 100644 --- a/src/action_class_set_iarray.c +++ b/src/action_class_set_iarray.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/action_class_set_missing.c b/src/action_class_set_missing.c index 7ba4c2a18..09b6b742e 100644 --- a/src/action_class_set_missing.c +++ b/src/action_class_set_missing.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/action_class_set_sarray.c b/src/action_class_set_sarray.c index 02d51d5f1..aa811635a 100644 --- a/src/action_class_set_sarray.c +++ b/src/action_class_set_sarray.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/action_class_switch.c b/src/action_class_switch.c index 8d31c3a38..81387509f 100644 --- a/src/action_class_switch.c +++ b/src/action_class_switch.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/action_class_template.c b/src/action_class_template.c index 1a31356b9..ef1708dc9 100644 --- a/src/action_class_template.c +++ b/src/action_class_template.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/action_class_transient_darray.c b/src/action_class_transient_darray.c index c4c469ae2..64606fd69 100644 --- a/src/action_class_transient_darray.c +++ b/src/action_class_transient_darray.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/action_class_trigger.c b/src/action_class_trigger.c index c2715f497..d7a19bb9a 100644 --- a/src/action_class_trigger.c +++ b/src/action_class_trigger.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/action_class_variable.c b/src/action_class_variable.c index 9c3e6758c..5209f296e 100644 --- a/src/action_class_variable.c +++ b/src/action_class_variable.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/action_class_when.c b/src/action_class_when.c index 26f277a56..9c9f3fd2a 100644 --- a/src/action_class_when.c +++ b/src/action_class_when.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/action_class_while.c b/src/action_class_while.c index 4a1119c9d..5c97f0560 100644 --- a/src/action_class_while.c +++ b/src/action_class_while.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/action_class_write.c b/src/action_class_write.c index 76f6cb560..281613153 100644 --- a/src/action_class_write.c +++ b/src/action_class_write.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/bufr_keys_iterator.c b/src/bufr_keys_iterator.c index cfe121419..1d588b457 100644 --- a/src/bufr_keys_iterator.c +++ b/src/bufr_keys_iterator.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/bufr_util.c b/src/bufr_util.c index 1f1a9db52..8fdb6bada 100644 --- a/src/bufr_util.c +++ b/src/bufr_util.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/codes_memfs.c b/src/codes_memfs.c index 3e31f3847..5360393a2 100644 --- a/src/codes_memfs.c +++ b/src/codes_memfs.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/codes_util.c b/src/codes_util.c index bfda21879..4772f2e89 100644 --- a/src/codes_util.c +++ b/src/codes_util.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/eccodes.c b/src/eccodes.c index d202bf94d..fb56decc3 100644 --- a/src/eccodes.c +++ b/src/eccodes.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/eccodes.h b/src/eccodes.h index 53645727d..713259169 100644 --- a/src/eccodes.h +++ b/src/eccodes.h @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/eccodes_version.h.in b/src/eccodes_version.h.in index ea19b4162..27fb37ec4 100644 --- a/src/eccodes_version.h.in +++ b/src/eccodes_version.h.in @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/eccodes_windef.h b/src/eccodes_windef.h index 903ba8dd7..46c8ee97a 100644 --- a/src/eccodes_windef.h +++ b/src/eccodes_windef.h @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/encode_double_array.c b/src/encode_double_array.c index 3eca3784d..4854e544c 100644 --- a/src/encode_double_array.c +++ b/src/encode_double_array.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/errors.pl b/src/errors.pl index a8fbfdc58..b40ca72bc 100755 --- a/src/errors.pl +++ b/src/errors.pl @@ -1,5 +1,5 @@ #!/usr/bin/perl -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/src/functions.c b/src/functions.c index 6790e2958..eae2722bc 100644 --- a/src/functions.c +++ b/src/functions.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib2c.pl b/src/grib2c.pl index a4abe059d..d192b63fa 100755 --- a/src/grib2c.pl +++ b/src/grib2c.pl @@ -1,5 +1,5 @@ #!/usr/bin/perl -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/src/grib_2order_packer_simple.c b/src/grib_2order_packer_simple.c index f4feeecbf..f4b78d2db 100644 --- a/src/grib_2order_packer_simple.c +++ b/src/grib_2order_packer_simple.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor.c b/src/grib_accessor.c index 321275d56..4760fd954 100644 --- a/src/grib_accessor.c +++ b/src/grib_accessor.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class.c b/src/grib_accessor_class.c index f53a43050..f21af388b 100644 --- a/src/grib_accessor_class.c +++ b/src/grib_accessor_class.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_abstract_long_vector.c b/src/grib_accessor_class_abstract_long_vector.c index eebb1887f..86545d99d 100644 --- a/src/grib_accessor_class_abstract_long_vector.c +++ b/src/grib_accessor_class_abstract_long_vector.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_abstract_vector.c b/src/grib_accessor_class_abstract_vector.c index 672b8fd43..54ded9151 100644 --- a/src/grib_accessor_class_abstract_vector.c +++ b/src/grib_accessor_class_abstract_vector.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_apply_operators.c b/src/grib_accessor_class_apply_operators.c index 015ef3241..9a1685e1c 100644 --- a/src/grib_accessor_class_apply_operators.c +++ b/src/grib_accessor_class_apply_operators.c @@ -1,5 +1,5 @@ /* -* Copyright 2005-2019 ECMWF. +* (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_array.c b/src/grib_accessor_class_array.c index 40cc06c56..d1cb1ca28 100644 --- a/src/grib_accessor_class_array.c +++ b/src/grib_accessor_class_array.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_ascii.c b/src/grib_accessor_class_ascii.c index f939c41fb..f15a3e524 100644 --- a/src/grib_accessor_class_ascii.c +++ b/src/grib_accessor_class_ascii.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_assert.c b/src/grib_accessor_class_assert.c index 03c230bde..50e2def2f 100644 --- a/src/grib_accessor_class_assert.c +++ b/src/grib_accessor_class_assert.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_bit.c b/src/grib_accessor_class_bit.c index 55d699cd0..54758ff25 100644 --- a/src/grib_accessor_class_bit.c +++ b/src/grib_accessor_class_bit.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_bitmap.c b/src/grib_accessor_class_bitmap.c index 8ece7686f..e51cbdf11 100644 --- a/src/grib_accessor_class_bitmap.c +++ b/src/grib_accessor_class_bitmap.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_bits.c b/src/grib_accessor_class_bits.c index 4068d36e6..7bf969831 100644 --- a/src/grib_accessor_class_bits.c +++ b/src/grib_accessor_class_bits.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_bits_per_value.c b/src/grib_accessor_class_bits_per_value.c index 9d5566c0d..b0fdacf3d 100644 --- a/src/grib_accessor_class_bits_per_value.c +++ b/src/grib_accessor_class_bits_per_value.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_blob.c b/src/grib_accessor_class_blob.c index 25d4fbdba..f73ced894 100644 --- a/src/grib_accessor_class_blob.c +++ b/src/grib_accessor_class_blob.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_box.c b/src/grib_accessor_class_box.c index 14377c5ec..ca1830ba7 100644 --- a/src/grib_accessor_class_box.c +++ b/src/grib_accessor_class_box.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_budgdate.c b/src/grib_accessor_class_budgdate.c index a51b2f3e6..7890eb5cc 100644 --- a/src/grib_accessor_class_budgdate.c +++ b/src/grib_accessor_class_budgdate.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_bufr_clear_tables.c b/src/grib_accessor_class_bufr_clear_tables.c index a227f5c30..aa5f5602e 100644 --- a/src/grib_accessor_class_bufr_clear_tables.c +++ b/src/grib_accessor_class_bufr_clear_tables.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_bufr_data.c b/src/grib_accessor_class_bufr_data.c index e4d302751..093ad5fdb 100644 --- a/src/grib_accessor_class_bufr_data.c +++ b/src/grib_accessor_class_bufr_data.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_bufr_data_array.c b/src/grib_accessor_class_bufr_data_array.c index a1f00db49..0046e3f9b 100644 --- a/src/grib_accessor_class_bufr_data_array.c +++ b/src/grib_accessor_class_bufr_data_array.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_bufr_data_element.c b/src/grib_accessor_class_bufr_data_element.c index b66db443f..a3fa0efca 100644 --- a/src/grib_accessor_class_bufr_data_element.c +++ b/src/grib_accessor_class_bufr_data_element.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_bufr_elements_table.c b/src/grib_accessor_class_bufr_elements_table.c index d21077c4b..193c89228 100644 --- a/src/grib_accessor_class_bufr_elements_table.c +++ b/src/grib_accessor_class_bufr_elements_table.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_bufr_extract_area_subsets.c b/src/grib_accessor_class_bufr_extract_area_subsets.c index efbb6f6c0..6de896c93 100644 --- a/src/grib_accessor_class_bufr_extract_area_subsets.c +++ b/src/grib_accessor_class_bufr_extract_area_subsets.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_bufr_extract_datetime_subsets.c b/src/grib_accessor_class_bufr_extract_datetime_subsets.c index 4d7482bb7..500fa3b23 100644 --- a/src/grib_accessor_class_bufr_extract_datetime_subsets.c +++ b/src/grib_accessor_class_bufr_extract_datetime_subsets.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_bufr_extract_subsets.c b/src/grib_accessor_class_bufr_extract_subsets.c index 33471fee3..f797a0310 100644 --- a/src/grib_accessor_class_bufr_extract_subsets.c +++ b/src/grib_accessor_class_bufr_extract_subsets.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_bufr_group.c b/src/grib_accessor_class_bufr_group.c index fb02477f5..f0c160e9e 100644 --- a/src/grib_accessor_class_bufr_group.c +++ b/src/grib_accessor_class_bufr_group.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_bufr_has_delayed_replication.c b/src/grib_accessor_class_bufr_has_delayed_replication.c index 6582b8e5d..e80579e98 100644 --- a/src/grib_accessor_class_bufr_has_delayed_replication.c +++ b/src/grib_accessor_class_bufr_has_delayed_replication.c @@ -1,5 +1,5 @@ /* -* Copyright 2005-2019 ECMWF. +* (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_bufr_simple_thinning.c b/src/grib_accessor_class_bufr_simple_thinning.c index ac2a0024d..4eb40a384 100644 --- a/src/grib_accessor_class_bufr_simple_thinning.c +++ b/src/grib_accessor_class_bufr_simple_thinning.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_bufr_string_values.c b/src/grib_accessor_class_bufr_string_values.c index 734dc4cfe..0953ecff1 100644 --- a/src/grib_accessor_class_bufr_string_values.c +++ b/src/grib_accessor_class_bufr_string_values.c @@ -1,5 +1,5 @@ /* -* Copyright 2005-2019 ECMWF. +* (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_bufrdc_expanded_descriptors.c b/src/grib_accessor_class_bufrdc_expanded_descriptors.c index fde586436..511f300f9 100644 --- a/src/grib_accessor_class_bufrdc_expanded_descriptors.c +++ b/src/grib_accessor_class_bufrdc_expanded_descriptors.c @@ -1,5 +1,5 @@ /* -* Copyright 2005-2019 ECMWF. +* (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_bytes.c b/src/grib_accessor_class_bytes.c index 050e3551e..1aa1a4f23 100644 --- a/src/grib_accessor_class_bytes.c +++ b/src/grib_accessor_class_bytes.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_change_scanning_direction.c b/src/grib_accessor_class_change_scanning_direction.c index a95efd286..f234d2269 100644 --- a/src/grib_accessor_class_change_scanning_direction.c +++ b/src/grib_accessor_class_change_scanning_direction.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_check_internal_version.c b/src/grib_accessor_class_check_internal_version.c index 95fa9a48e..9f1ca3675 100644 --- a/src/grib_accessor_class_check_internal_version.c +++ b/src/grib_accessor_class_check_internal_version.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_codeflag.c b/src/grib_accessor_class_codeflag.c index 2cf52f742..643c84bde 100644 --- a/src/grib_accessor_class_codeflag.c +++ b/src/grib_accessor_class_codeflag.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_codetable.c b/src/grib_accessor_class_codetable.c index 38b47986f..d991beb0e 100644 --- a/src/grib_accessor_class_codetable.c +++ b/src/grib_accessor_class_codetable.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_codetable_title.c b/src/grib_accessor_class_codetable_title.c index dfd43277e..9555d576c 100644 --- a/src/grib_accessor_class_codetable_title.c +++ b/src/grib_accessor_class_codetable_title.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_codetable_units.c b/src/grib_accessor_class_codetable_units.c index 42173e428..534d6b9c2 100644 --- a/src/grib_accessor_class_codetable_units.c +++ b/src/grib_accessor_class_codetable_units.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_concept.c b/src/grib_accessor_class_concept.c index 09a9f5d3f..e581ba613 100644 --- a/src/grib_accessor_class_concept.c +++ b/src/grib_accessor_class_concept.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_constant.c b/src/grib_accessor_class_constant.c index 9e0bd7412..873a485ec 100644 --- a/src/grib_accessor_class_constant.c +++ b/src/grib_accessor_class_constant.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_count_file.c b/src/grib_accessor_class_count_file.c index c5b6f74a2..bef28e6f5 100644 --- a/src/grib_accessor_class_count_file.c +++ b/src/grib_accessor_class_count_file.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_count_missing.c b/src/grib_accessor_class_count_missing.c index 502a2bcda..98210f4ab 100644 --- a/src/grib_accessor_class_count_missing.c +++ b/src/grib_accessor_class_count_missing.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_count_total.c b/src/grib_accessor_class_count_total.c index cee652239..eb51ee7e0 100644 --- a/src/grib_accessor_class_count_total.c +++ b/src/grib_accessor_class_count_total.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_data_2order_packing.c b/src/grib_accessor_class_data_2order_packing.c index a199afc01..53381762f 100644 --- a/src/grib_accessor_class_data_2order_packing.c +++ b/src/grib_accessor_class_data_2order_packing.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_data_2order_packing_count.c b/src/grib_accessor_class_data_2order_packing_count.c index cb442ea92..aad67724a 100644 --- a/src/grib_accessor_class_data_2order_packing_count.c +++ b/src/grib_accessor_class_data_2order_packing_count.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_data_apply_bitmap.c b/src/grib_accessor_class_data_apply_bitmap.c index 92ec1ee8a..3b6bb4192 100644 --- a/src/grib_accessor_class_data_apply_bitmap.c +++ b/src/grib_accessor_class_data_apply_bitmap.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_data_apply_boustrophedonic.c b/src/grib_accessor_class_data_apply_boustrophedonic.c index acd7f3c7d..877d51b57 100644 --- a/src/grib_accessor_class_data_apply_boustrophedonic.c +++ b/src/grib_accessor_class_data_apply_boustrophedonic.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_data_apply_boustrophedonic_bitmap.c b/src/grib_accessor_class_data_apply_boustrophedonic_bitmap.c index d35a17dd6..d0c7d2ed9 100644 --- a/src/grib_accessor_class_data_apply_boustrophedonic_bitmap.c +++ b/src/grib_accessor_class_data_apply_boustrophedonic_bitmap.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_data_apply_gdsnotpresent.c b/src/grib_accessor_class_data_apply_gdsnotpresent.c index 06628f6e2..aa5adb5c4 100644 --- a/src/grib_accessor_class_data_apply_gdsnotpresent.c +++ b/src/grib_accessor_class_data_apply_gdsnotpresent.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_data_ccsds_packing.c b/src/grib_accessor_class_data_ccsds_packing.c index 7263e0867..92597aa86 100644 --- a/src/grib_accessor_class_data_ccsds_packing.c +++ b/src/grib_accessor_class_data_ccsds_packing.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_data_complex_packing.c b/src/grib_accessor_class_data_complex_packing.c index 182adbe48..7a8637b61 100644 --- a/src/grib_accessor_class_data_complex_packing.c +++ b/src/grib_accessor_class_data_complex_packing.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_data_constant_field.c b/src/grib_accessor_class_data_constant_field.c index c5d3b046f..8699f2b84 100644 --- a/src/grib_accessor_class_data_constant_field.c +++ b/src/grib_accessor_class_data_constant_field.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_data_dummy_field.c b/src/grib_accessor_class_data_dummy_field.c index af9e07b91..85ec76605 100644 --- a/src/grib_accessor_class_data_dummy_field.c +++ b/src/grib_accessor_class_data_dummy_field.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_data_g1complex_packing.c b/src/grib_accessor_class_data_g1complex_packing.c index cd5c48656..385d5db68 100644 --- a/src/grib_accessor_class_data_g1complex_packing.c +++ b/src/grib_accessor_class_data_g1complex_packing.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_data_g1second_order_constant_width_packing.c b/src/grib_accessor_class_data_g1second_order_constant_width_packing.c index 3639c8325..c346f156b 100644 --- a/src/grib_accessor_class_data_g1second_order_constant_width_packing.c +++ b/src/grib_accessor_class_data_g1second_order_constant_width_packing.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_data_g1second_order_general_extended_packing.c b/src/grib_accessor_class_data_g1second_order_general_extended_packing.c index ff5183b16..6effa25fe 100644 --- a/src/grib_accessor_class_data_g1second_order_general_extended_packing.c +++ b/src/grib_accessor_class_data_g1second_order_general_extended_packing.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_data_g1second_order_general_packing.c b/src/grib_accessor_class_data_g1second_order_general_packing.c index f458fbb8f..955d763fc 100644 --- a/src/grib_accessor_class_data_g1second_order_general_packing.c +++ b/src/grib_accessor_class_data_g1second_order_general_packing.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_data_g1second_order_row_by_row_packing.c b/src/grib_accessor_class_data_g1second_order_row_by_row_packing.c index 7a033cd6f..ffabc88b1 100644 --- a/src/grib_accessor_class_data_g1second_order_row_by_row_packing.c +++ b/src/grib_accessor_class_data_g1second_order_row_by_row_packing.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_data_g1secondary_bitmap.c b/src/grib_accessor_class_data_g1secondary_bitmap.c index e2df088a8..aa80534e9 100644 --- a/src/grib_accessor_class_data_g1secondary_bitmap.c +++ b/src/grib_accessor_class_data_g1secondary_bitmap.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_data_g1shsimple_packing.c b/src/grib_accessor_class_data_g1shsimple_packing.c index bf5a9e2f7..5a66db452 100644 --- a/src/grib_accessor_class_data_g1shsimple_packing.c +++ b/src/grib_accessor_class_data_g1shsimple_packing.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_data_g1simple_packing.c b/src/grib_accessor_class_data_g1simple_packing.c index 34c9ed15f..0f95d2736 100644 --- a/src/grib_accessor_class_data_g1simple_packing.c +++ b/src/grib_accessor_class_data_g1simple_packing.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_data_g22order_packing.c b/src/grib_accessor_class_data_g22order_packing.c index e0120d460..33c716b99 100644 --- a/src/grib_accessor_class_data_g22order_packing.c +++ b/src/grib_accessor_class_data_g22order_packing.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_data_g2bifourier_packing.c b/src/grib_accessor_class_data_g2bifourier_packing.c index 9c6ee6951..b5961e69d 100644 --- a/src/grib_accessor_class_data_g2bifourier_packing.c +++ b/src/grib_accessor_class_data_g2bifourier_packing.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_data_g2complex_packing.c b/src/grib_accessor_class_data_g2complex_packing.c index 7696d8513..ba930401c 100644 --- a/src/grib_accessor_class_data_g2complex_packing.c +++ b/src/grib_accessor_class_data_g2complex_packing.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_data_g2secondary_bitmap.c b/src/grib_accessor_class_data_g2secondary_bitmap.c index 37c514807..bf1357eb7 100644 --- a/src/grib_accessor_class_data_g2secondary_bitmap.c +++ b/src/grib_accessor_class_data_g2secondary_bitmap.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_data_g2shsimple_packing.c b/src/grib_accessor_class_data_g2shsimple_packing.c index 679ed9670..497b188d0 100644 --- a/src/grib_accessor_class_data_g2shsimple_packing.c +++ b/src/grib_accessor_class_data_g2shsimple_packing.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_data_g2simple_packing.c b/src/grib_accessor_class_data_g2simple_packing.c index 503ab2625..fda80b68e 100644 --- a/src/grib_accessor_class_data_g2simple_packing.c +++ b/src/grib_accessor_class_data_g2simple_packing.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_data_g2simple_packing_with_preprocessing.c b/src/grib_accessor_class_data_g2simple_packing_with_preprocessing.c index 239b46ef5..a3d2f6c14 100644 --- a/src/grib_accessor_class_data_g2simple_packing_with_preprocessing.c +++ b/src/grib_accessor_class_data_g2simple_packing_with_preprocessing.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_data_jpeg2000_packing.c b/src/grib_accessor_class_data_jpeg2000_packing.c index 1646126a7..0f44d7f86 100644 --- a/src/grib_accessor_class_data_jpeg2000_packing.c +++ b/src/grib_accessor_class_data_jpeg2000_packing.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_data_png_packing.c b/src/grib_accessor_class_data_png_packing.c index bc7c3c098..1e452e4b3 100644 --- a/src/grib_accessor_class_data_png_packing.c +++ b/src/grib_accessor_class_data_png_packing.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_data_raw_packing.c b/src/grib_accessor_class_data_raw_packing.c index 0d61d6cb2..147f0a3a3 100644 --- a/src/grib_accessor_class_data_raw_packing.c +++ b/src/grib_accessor_class_data_raw_packing.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_data_secondary_bitmap.c b/src/grib_accessor_class_data_secondary_bitmap.c index 2029b68d6..0d0228a8e 100644 --- a/src/grib_accessor_class_data_secondary_bitmap.c +++ b/src/grib_accessor_class_data_secondary_bitmap.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_data_sh_packed.c b/src/grib_accessor_class_data_sh_packed.c index 9b9897981..b7b3b7e76 100644 --- a/src/grib_accessor_class_data_sh_packed.c +++ b/src/grib_accessor_class_data_sh_packed.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_data_sh_unpacked.c b/src/grib_accessor_class_data_sh_unpacked.c index 12bc96fd4..41448fb61 100644 --- a/src/grib_accessor_class_data_sh_unpacked.c +++ b/src/grib_accessor_class_data_sh_unpacked.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_data_shsimple_packing.c b/src/grib_accessor_class_data_shsimple_packing.c index 662afe88d..81f606232 100644 --- a/src/grib_accessor_class_data_shsimple_packing.c +++ b/src/grib_accessor_class_data_shsimple_packing.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_data_simple_packing.c b/src/grib_accessor_class_data_simple_packing.c index 13a9d5f46..e49162ab6 100644 --- a/src/grib_accessor_class_data_simple_packing.c +++ b/src/grib_accessor_class_data_simple_packing.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_decimal_precision.c b/src/grib_accessor_class_decimal_precision.c index aa1e59a15..35452fae7 100644 --- a/src/grib_accessor_class_decimal_precision.c +++ b/src/grib_accessor_class_decimal_precision.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_dictionary.c b/src/grib_accessor_class_dictionary.c index a502a5c7f..1c88d6905 100644 --- a/src/grib_accessor_class_dictionary.c +++ b/src/grib_accessor_class_dictionary.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_dirty.c b/src/grib_accessor_class_dirty.c index 3d6fc9c4a..e43f08a02 100644 --- a/src/grib_accessor_class_dirty.c +++ b/src/grib_accessor_class_dirty.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_divdouble.c b/src/grib_accessor_class_divdouble.c index 2c56ba767..9ae4d9dec 100644 --- a/src/grib_accessor_class_divdouble.c +++ b/src/grib_accessor_class_divdouble.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_double.c b/src/grib_accessor_class_double.c index 40a189aee..d8be49c30 100644 --- a/src/grib_accessor_class_double.c +++ b/src/grib_accessor_class_double.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_element.c b/src/grib_accessor_class_element.c index e00992b71..dd876705a 100644 --- a/src/grib_accessor_class_element.c +++ b/src/grib_accessor_class_element.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_evaluate.c b/src/grib_accessor_class_evaluate.c index 1090c71e8..d58c949f1 100644 --- a/src/grib_accessor_class_evaluate.c +++ b/src/grib_accessor_class_evaluate.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_expanded_descriptors.c b/src/grib_accessor_class_expanded_descriptors.c index d8eb2ea13..417c1beae 100644 --- a/src/grib_accessor_class_expanded_descriptors.c +++ b/src/grib_accessor_class_expanded_descriptors.c @@ -1,5 +1,5 @@ /* -* Copyright 2005-2019 ECMWF. +* (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_forward.c b/src/grib_accessor_class_forward.c index 2cb482a29..bc562dcaa 100644 --- a/src/grib_accessor_class_forward.c +++ b/src/grib_accessor_class_forward.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_from_scale_factor_scaled_value.c b/src/grib_accessor_class_from_scale_factor_scaled_value.c index c658a3539..96e47a391 100644 --- a/src/grib_accessor_class_from_scale_factor_scaled_value.c +++ b/src/grib_accessor_class_from_scale_factor_scaled_value.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_g1_half_byte_codeflag.c b/src/grib_accessor_class_g1_half_byte_codeflag.c index 11168ad77..584a427f1 100644 --- a/src/grib_accessor_class_g1_half_byte_codeflag.c +++ b/src/grib_accessor_class_g1_half_byte_codeflag.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_g1_increment.c b/src/grib_accessor_class_g1_increment.c index 939c4b3cf..280df2b4b 100644 --- a/src/grib_accessor_class_g1_increment.c +++ b/src/grib_accessor_class_g1_increment.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_g1_message_length.c b/src/grib_accessor_class_g1_message_length.c index 7939e8880..ecd74039e 100644 --- a/src/grib_accessor_class_g1_message_length.c +++ b/src/grib_accessor_class_g1_message_length.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_g1_section4_length.c b/src/grib_accessor_class_g1_section4_length.c index c38c15f1f..ef5451eca 100644 --- a/src/grib_accessor_class_g1_section4_length.c +++ b/src/grib_accessor_class_g1_section4_length.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_g1area.c b/src/grib_accessor_class_g1area.c index 720caa832..ec96560af 100644 --- a/src/grib_accessor_class_g1area.c +++ b/src/grib_accessor_class_g1area.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_g1bitmap.c b/src/grib_accessor_class_g1bitmap.c index 490c7abdb..b5cfa37f5 100644 --- a/src/grib_accessor_class_g1bitmap.c +++ b/src/grib_accessor_class_g1bitmap.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_g1date.c b/src/grib_accessor_class_g1date.c index dea8cb176..97430d1b9 100644 --- a/src/grib_accessor_class_g1date.c +++ b/src/grib_accessor_class_g1date.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_g1day_of_the_year_date.c b/src/grib_accessor_class_g1day_of_the_year_date.c index 745795e57..5abe2ff5b 100644 --- a/src/grib_accessor_class_g1day_of_the_year_date.c +++ b/src/grib_accessor_class_g1day_of_the_year_date.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_g1end_of_interval_monthly.c b/src/grib_accessor_class_g1end_of_interval_monthly.c index 91963856b..5efb065eb 100644 --- a/src/grib_accessor_class_g1end_of_interval_monthly.c +++ b/src/grib_accessor_class_g1end_of_interval_monthly.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_g1fcperiod.c b/src/grib_accessor_class_g1fcperiod.c index 7bda0cea6..984223f7b 100644 --- a/src/grib_accessor_class_g1fcperiod.c +++ b/src/grib_accessor_class_g1fcperiod.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_g1forecastmonth.c b/src/grib_accessor_class_g1forecastmonth.c index 2be767e87..eb5e1c239 100644 --- a/src/grib_accessor_class_g1forecastmonth.c +++ b/src/grib_accessor_class_g1forecastmonth.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_g1monthlydate.c b/src/grib_accessor_class_g1monthlydate.c index 5524a4e18..2dfc2397f 100644 --- a/src/grib_accessor_class_g1monthlydate.c +++ b/src/grib_accessor_class_g1monthlydate.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_g1number_of_coded_values_sh_complex.c b/src/grib_accessor_class_g1number_of_coded_values_sh_complex.c index e1d524e6b..87a6545db 100644 --- a/src/grib_accessor_class_g1number_of_coded_values_sh_complex.c +++ b/src/grib_accessor_class_g1number_of_coded_values_sh_complex.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_g1number_of_coded_values_sh_simple.c b/src/grib_accessor_class_g1number_of_coded_values_sh_simple.c index 02a0455c1..d8c8fa64d 100644 --- a/src/grib_accessor_class_g1number_of_coded_values_sh_simple.c +++ b/src/grib_accessor_class_g1number_of_coded_values_sh_simple.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_g1p1p2.c b/src/grib_accessor_class_g1p1p2.c index a8c5c9a16..a39419b38 100644 --- a/src/grib_accessor_class_g1p1p2.c +++ b/src/grib_accessor_class_g1p1p2.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_g1param.c b/src/grib_accessor_class_g1param.c index c3b0e4687..e7cbdeab4 100644 --- a/src/grib_accessor_class_g1param.c +++ b/src/grib_accessor_class_g1param.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_g1step_range.c b/src/grib_accessor_class_g1step_range.c index cd1489c90..ff610a9a7 100644 --- a/src/grib_accessor_class_g1step_range.c +++ b/src/grib_accessor_class_g1step_range.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_g1verificationdate.c b/src/grib_accessor_class_g1verificationdate.c index b5810ad8c..b58397367 100644 --- a/src/grib_accessor_class_g1verificationdate.c +++ b/src/grib_accessor_class_g1verificationdate.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_g2_aerosol.c b/src/grib_accessor_class_g2_aerosol.c index 8ed857602..beb4d3abe 100644 --- a/src/grib_accessor_class_g2_aerosol.c +++ b/src/grib_accessor_class_g2_aerosol.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_g2_chemical.c b/src/grib_accessor_class_g2_chemical.c index 99be283a8..82bbb1480 100644 --- a/src/grib_accessor_class_g2_chemical.c +++ b/src/grib_accessor_class_g2_chemical.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_g2_eps.c b/src/grib_accessor_class_g2_eps.c index 66bd28a54..b580d59ab 100644 --- a/src/grib_accessor_class_g2_eps.c +++ b/src/grib_accessor_class_g2_eps.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_g2_mars_labeling.c b/src/grib_accessor_class_g2_mars_labeling.c index c829751d7..d758b4d43 100644 --- a/src/grib_accessor_class_g2_mars_labeling.c +++ b/src/grib_accessor_class_g2_mars_labeling.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_g2bitmap.c b/src/grib_accessor_class_g2bitmap.c index af2b9229b..19154d5fd 100644 --- a/src/grib_accessor_class_g2bitmap.c +++ b/src/grib_accessor_class_g2bitmap.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_g2bitmap_present.c b/src/grib_accessor_class_g2bitmap_present.c index 45eb97cc1..6da9a2454 100644 --- a/src/grib_accessor_class_g2bitmap_present.c +++ b/src/grib_accessor_class_g2bitmap_present.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_g2date.c b/src/grib_accessor_class_g2date.c index 00fdf5649..c5670c713 100644 --- a/src/grib_accessor_class_g2date.c +++ b/src/grib_accessor_class_g2date.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_g2end_step.c b/src/grib_accessor_class_g2end_step.c index 74851f87c..dedf5a8d1 100644 --- a/src/grib_accessor_class_g2end_step.c +++ b/src/grib_accessor_class_g2end_step.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_g2grid.c b/src/grib_accessor_class_g2grid.c index 4f98678f7..c8f4e056d 100644 --- a/src/grib_accessor_class_g2grid.c +++ b/src/grib_accessor_class_g2grid.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_g2latlon.c b/src/grib_accessor_class_g2latlon.c index 5e62f4d43..50b912c69 100644 --- a/src/grib_accessor_class_g2latlon.c +++ b/src/grib_accessor_class_g2latlon.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_g2level.c b/src/grib_accessor_class_g2level.c index 9be8ed369..ec3c60079 100644 --- a/src/grib_accessor_class_g2level.c +++ b/src/grib_accessor_class_g2level.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_g2lon.c b/src/grib_accessor_class_g2lon.c index 2b62235b3..7fde63962 100644 --- a/src/grib_accessor_class_g2lon.c +++ b/src/grib_accessor_class_g2lon.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_g2step.c b/src/grib_accessor_class_g2step.c index 1a80256e7..8618d0cf4 100644 --- a/src/grib_accessor_class_g2step.c +++ b/src/grib_accessor_class_g2step.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_g2step_range.c b/src/grib_accessor_class_g2step_range.c index 26490294c..4d437b99b 100644 --- a/src/grib_accessor_class_g2step_range.c +++ b/src/grib_accessor_class_g2step_range.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_gaussian_grid_name.c b/src/grib_accessor_class_gaussian_grid_name.c index e306027d0..be0ecf8ac 100644 --- a/src/grib_accessor_class_gaussian_grid_name.c +++ b/src/grib_accessor_class_gaussian_grid_name.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_gds_is_present.c b/src/grib_accessor_class_gds_is_present.c index dab2c42c3..a6f0f9a35 100644 --- a/src/grib_accessor_class_gds_is_present.c +++ b/src/grib_accessor_class_gds_is_present.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_gds_not_present_bitmap.c b/src/grib_accessor_class_gds_not_present_bitmap.c index f5abf4eb6..d732958cd 100644 --- a/src/grib_accessor_class_gds_not_present_bitmap.c +++ b/src/grib_accessor_class_gds_not_present_bitmap.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_gen.c b/src/grib_accessor_class_gen.c index eb265bc13..e6d51763a 100644 --- a/src/grib_accessor_class_gen.c +++ b/src/grib_accessor_class_gen.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_getenv.c b/src/grib_accessor_class_getenv.c index 664192b4d..88c876db8 100644 --- a/src/grib_accessor_class_getenv.c +++ b/src/grib_accessor_class_getenv.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_global_gaussian.c b/src/grib_accessor_class_global_gaussian.c index fb36943c3..8a64ab134 100644 --- a/src/grib_accessor_class_global_gaussian.c +++ b/src/grib_accessor_class_global_gaussian.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_group.c b/src/grib_accessor_class_group.c index 3651d15dd..38cc9c67f 100644 --- a/src/grib_accessor_class_group.c +++ b/src/grib_accessor_class_group.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_gts_header.c b/src/grib_accessor_class_gts_header.c index 21527c41f..34ced1219 100644 --- a/src/grib_accessor_class_gts_header.c +++ b/src/grib_accessor_class_gts_header.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_hash_array.c b/src/grib_accessor_class_hash_array.c index d5b8d57b7..9c8022310 100644 --- a/src/grib_accessor_class_hash_array.c +++ b/src/grib_accessor_class_hash_array.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_headers_only.c b/src/grib_accessor_class_headers_only.c index 8e482e3c2..e52a21d6b 100644 --- a/src/grib_accessor_class_headers_only.c +++ b/src/grib_accessor_class_headers_only.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_ibmfloat.c b/src/grib_accessor_class_ibmfloat.c index 814c23c3d..671957e71 100644 --- a/src/grib_accessor_class_ibmfloat.c +++ b/src/grib_accessor_class_ibmfloat.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_ieeefloat.c b/src/grib_accessor_class_ieeefloat.c index 6b88f0126..81074724c 100644 --- a/src/grib_accessor_class_ieeefloat.c +++ b/src/grib_accessor_class_ieeefloat.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_ifs_param.c b/src/grib_accessor_class_ifs_param.c index feb924c9c..fe882372e 100644 --- a/src/grib_accessor_class_ifs_param.c +++ b/src/grib_accessor_class_ifs_param.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_int16.c b/src/grib_accessor_class_int16.c index 860cdbbaa..196df85d3 100644 --- a/src/grib_accessor_class_int16.c +++ b/src/grib_accessor_class_int16.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_int16_little_endian.c b/src/grib_accessor_class_int16_little_endian.c index 271dd20a8..8db4cd75d 100644 --- a/src/grib_accessor_class_int16_little_endian.c +++ b/src/grib_accessor_class_int16_little_endian.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_int32.c b/src/grib_accessor_class_int32.c index cf3309503..a692fe9b1 100644 --- a/src/grib_accessor_class_int32.c +++ b/src/grib_accessor_class_int32.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_int32_little_endian.c b/src/grib_accessor_class_int32_little_endian.c index 9dcea7523..d08e4b544 100644 --- a/src/grib_accessor_class_int32_little_endian.c +++ b/src/grib_accessor_class_int32_little_endian.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_int64.c b/src/grib_accessor_class_int64.c index 0a2e87065..24e00c3f6 100644 --- a/src/grib_accessor_class_int64.c +++ b/src/grib_accessor_class_int64.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_int64_little_endian.c b/src/grib_accessor_class_int64_little_endian.c index ea30373c1..26a852b0f 100644 --- a/src/grib_accessor_class_int64_little_endian.c +++ b/src/grib_accessor_class_int64_little_endian.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_int8.c b/src/grib_accessor_class_int8.c index 8c2c21441..53b9da523 100644 --- a/src/grib_accessor_class_int8.c +++ b/src/grib_accessor_class_int8.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_iterator.c b/src/grib_accessor_class_iterator.c index 36db322b7..9ec3682e2 100644 --- a/src/grib_accessor_class_iterator.c +++ b/src/grib_accessor_class_iterator.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_julian_date.c b/src/grib_accessor_class_julian_date.c index fa8d40487..8a5a3beb0 100644 --- a/src/grib_accessor_class_julian_date.c +++ b/src/grib_accessor_class_julian_date.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_julian_day.c b/src/grib_accessor_class_julian_day.c index fa251cf89..682b6cd75 100644 --- a/src/grib_accessor_class_julian_day.c +++ b/src/grib_accessor_class_julian_day.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_ksec1expver.c b/src/grib_accessor_class_ksec1expver.c index c6c1f81ad..66bb2e209 100644 --- a/src/grib_accessor_class_ksec1expver.c +++ b/src/grib_accessor_class_ksec1expver.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_label.c b/src/grib_accessor_class_label.c index df3362e0c..a356ac59b 100644 --- a/src/grib_accessor_class_label.c +++ b/src/grib_accessor_class_label.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_laplacian.c b/src/grib_accessor_class_laplacian.c index 100751990..ec70d4e44 100644 --- a/src/grib_accessor_class_laplacian.c +++ b/src/grib_accessor_class_laplacian.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_latitudes.c b/src/grib_accessor_class_latitudes.c index 467deb184..522a6b262 100644 --- a/src/grib_accessor_class_latitudes.c +++ b/src/grib_accessor_class_latitudes.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_latlon_increment.c b/src/grib_accessor_class_latlon_increment.c index 1b130d05c..ec44929f5 100644 --- a/src/grib_accessor_class_latlon_increment.c +++ b/src/grib_accessor_class_latlon_increment.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_latlonvalues.c b/src/grib_accessor_class_latlonvalues.c index 07e1af845..358932829 100644 --- a/src/grib_accessor_class_latlonvalues.c +++ b/src/grib_accessor_class_latlonvalues.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_library_version.c b/src/grib_accessor_class_library_version.c index a2b0191e0..b01b703fa 100644 --- a/src/grib_accessor_class_library_version.c +++ b/src/grib_accessor_class_library_version.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_local_definition.c b/src/grib_accessor_class_local_definition.c index c66a99ba9..0363ffac0 100644 --- a/src/grib_accessor_class_local_definition.c +++ b/src/grib_accessor_class_local_definition.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_long.c b/src/grib_accessor_class_long.c index dfc98a45d..cce7f7eb7 100644 --- a/src/grib_accessor_class_long.c +++ b/src/grib_accessor_class_long.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_long_vector.c b/src/grib_accessor_class_long_vector.c index 8b461ac71..5068ba97e 100644 --- a/src/grib_accessor_class_long_vector.c +++ b/src/grib_accessor_class_long_vector.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_longitudes.c b/src/grib_accessor_class_longitudes.c index 0067dfbd1..9b3b40608 100644 --- a/src/grib_accessor_class_longitudes.c +++ b/src/grib_accessor_class_longitudes.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_lookup.c b/src/grib_accessor_class_lookup.c index 54643c513..1be9fa261 100644 --- a/src/grib_accessor_class_lookup.c +++ b/src/grib_accessor_class_lookup.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_mars_param.c b/src/grib_accessor_class_mars_param.c index e764fcc42..50083cd52 100644 --- a/src/grib_accessor_class_mars_param.c +++ b/src/grib_accessor_class_mars_param.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_mars_step.c b/src/grib_accessor_class_mars_step.c index 31ebcc0f1..1a3907afa 100644 --- a/src/grib_accessor_class_mars_step.c +++ b/src/grib_accessor_class_mars_step.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_md5.c b/src/grib_accessor_class_md5.c index b876b138c..465851bf5 100644 --- a/src/grib_accessor_class_md5.c +++ b/src/grib_accessor_class_md5.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_message.c b/src/grib_accessor_class_message.c index 84c8d5c8d..84f313770 100644 --- a/src/grib_accessor_class_message.c +++ b/src/grib_accessor_class_message.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_message_copy.c b/src/grib_accessor_class_message_copy.c index 2fcf17fb5..be09ec90f 100644 --- a/src/grib_accessor_class_message_copy.c +++ b/src/grib_accessor_class_message_copy.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_missing.c b/src/grib_accessor_class_missing.c index ff0e30b29..99effedb6 100644 --- a/src/grib_accessor_class_missing.c +++ b/src/grib_accessor_class_missing.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_nearest.c b/src/grib_accessor_class_nearest.c index 2f9006dcf..9f3f4c129 100644 --- a/src/grib_accessor_class_nearest.c +++ b/src/grib_accessor_class_nearest.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_non_alpha.c b/src/grib_accessor_class_non_alpha.c index 182a55f12..9c5b981e4 100644 --- a/src/grib_accessor_class_non_alpha.c +++ b/src/grib_accessor_class_non_alpha.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_number_of_coded_values.c b/src/grib_accessor_class_number_of_coded_values.c index 3767248b9..aedd14ed6 100644 --- a/src/grib_accessor_class_number_of_coded_values.c +++ b/src/grib_accessor_class_number_of_coded_values.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_number_of_points.c b/src/grib_accessor_class_number_of_points.c index f6131580f..578656eff 100644 --- a/src/grib_accessor_class_number_of_points.c +++ b/src/grib_accessor_class_number_of_points.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_number_of_points_gaussian.c b/src/grib_accessor_class_number_of_points_gaussian.c index eddd94f91..cc84a1ea3 100644 --- a/src/grib_accessor_class_number_of_points_gaussian.c +++ b/src/grib_accessor_class_number_of_points_gaussian.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_number_of_values.c b/src/grib_accessor_class_number_of_values.c index 177db5b04..dbcb759aa 100644 --- a/src/grib_accessor_class_number_of_values.c +++ b/src/grib_accessor_class_number_of_values.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_number_of_values_data_raw_packing.c b/src/grib_accessor_class_number_of_values_data_raw_packing.c index 2bb8d8968..a3fa2c669 100644 --- a/src/grib_accessor_class_number_of_values_data_raw_packing.c +++ b/src/grib_accessor_class_number_of_values_data_raw_packing.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_octahedral_gaussian.c b/src/grib_accessor_class_octahedral_gaussian.c index 3f186583e..9e4c005c5 100644 --- a/src/grib_accessor_class_octahedral_gaussian.c +++ b/src/grib_accessor_class_octahedral_gaussian.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_octect_number.c b/src/grib_accessor_class_octect_number.c index e11047248..cc2a15cee 100644 --- a/src/grib_accessor_class_octect_number.c +++ b/src/grib_accessor_class_octect_number.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_offset_file.c b/src/grib_accessor_class_offset_file.c index 069430065..83c6829a8 100644 --- a/src/grib_accessor_class_offset_file.c +++ b/src/grib_accessor_class_offset_file.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_offset_values.c b/src/grib_accessor_class_offset_values.c index 56df8696c..fad412b1b 100644 --- a/src/grib_accessor_class_offset_values.c +++ b/src/grib_accessor_class_offset_values.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_pack_bufr_values.c b/src/grib_accessor_class_pack_bufr_values.c index 932b0f3b6..a7ef238ef 100644 --- a/src/grib_accessor_class_pack_bufr_values.c +++ b/src/grib_accessor_class_pack_bufr_values.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_pad.c b/src/grib_accessor_class_pad.c index 8171787df..d0cd8a3c1 100644 --- a/src/grib_accessor_class_pad.c +++ b/src/grib_accessor_class_pad.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_padding.c b/src/grib_accessor_class_padding.c index 6495ea194..76dc34a3c 100644 --- a/src/grib_accessor_class_padding.c +++ b/src/grib_accessor_class_padding.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_padto.c b/src/grib_accessor_class_padto.c index e7d539459..e019e4ba5 100644 --- a/src/grib_accessor_class_padto.c +++ b/src/grib_accessor_class_padto.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_padtoeven.c b/src/grib_accessor_class_padtoeven.c index 304bf7e9e..13e9dc857 100644 --- a/src/grib_accessor_class_padtoeven.c +++ b/src/grib_accessor_class_padtoeven.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_padtomultiple.c b/src/grib_accessor_class_padtomultiple.c index 8f63d2866..93d2a67ac 100644 --- a/src/grib_accessor_class_padtomultiple.c +++ b/src/grib_accessor_class_padtomultiple.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_position.c b/src/grib_accessor_class_position.c index b23dd178c..9e0334ac7 100644 --- a/src/grib_accessor_class_position.c +++ b/src/grib_accessor_class_position.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_raw.c b/src/grib_accessor_class_raw.c index 6c77b0d5b..55100c045 100644 --- a/src/grib_accessor_class_raw.c +++ b/src/grib_accessor_class_raw.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_rdbtime_guess_date.c b/src/grib_accessor_class_rdbtime_guess_date.c index d1ac64e9a..a3a31e69c 100644 --- a/src/grib_accessor_class_rdbtime_guess_date.c +++ b/src/grib_accessor_class_rdbtime_guess_date.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_reference_value_error.c b/src/grib_accessor_class_reference_value_error.c index 195ad18c9..0c7f058e0 100644 --- a/src/grib_accessor_class_reference_value_error.c +++ b/src/grib_accessor_class_reference_value_error.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_round.c b/src/grib_accessor_class_round.c index 780a5ca98..c5ccbd653 100644 --- a/src/grib_accessor_class_round.c +++ b/src/grib_accessor_class_round.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_scale.c b/src/grib_accessor_class_scale.c index 088714cd1..03ddf2fc8 100644 --- a/src/grib_accessor_class_scale.c +++ b/src/grib_accessor_class_scale.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_scale_values.c b/src/grib_accessor_class_scale_values.c index 5cb348ea5..bd7386bd7 100644 --- a/src/grib_accessor_class_scale_values.c +++ b/src/grib_accessor_class_scale_values.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_second_order_bits_per_value.c b/src/grib_accessor_class_second_order_bits_per_value.c index 58eeb0db3..88df0c51e 100644 --- a/src/grib_accessor_class_second_order_bits_per_value.c +++ b/src/grib_accessor_class_second_order_bits_per_value.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_section.c b/src/grib_accessor_class_section.c index 227ba015b..bfe62c085 100644 --- a/src/grib_accessor_class_section.c +++ b/src/grib_accessor_class_section.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_section_length.c b/src/grib_accessor_class_section_length.c index 178471cb2..8fcd6c214 100644 --- a/src/grib_accessor_class_section_length.c +++ b/src/grib_accessor_class_section_length.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_section_padding.c b/src/grib_accessor_class_section_padding.c index 735587ff8..3bb3ecd33 100644 --- a/src/grib_accessor_class_section_padding.c +++ b/src/grib_accessor_class_section_padding.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_section_pointer.c b/src/grib_accessor_class_section_pointer.c index 0226b1287..e848f06c2 100644 --- a/src/grib_accessor_class_section_pointer.c +++ b/src/grib_accessor_class_section_pointer.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_select_step_template.c b/src/grib_accessor_class_select_step_template.c index 4c62fe60b..88a60e5ff 100644 --- a/src/grib_accessor_class_select_step_template.c +++ b/src/grib_accessor_class_select_step_template.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_sexagesimal2decimal.c b/src/grib_accessor_class_sexagesimal2decimal.c index 495822f0c..70faea5d9 100644 --- a/src/grib_accessor_class_sexagesimal2decimal.c +++ b/src/grib_accessor_class_sexagesimal2decimal.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_signed.c b/src/grib_accessor_class_signed.c index 1fbcab21d..cdac1fa22 100644 --- a/src/grib_accessor_class_signed.c +++ b/src/grib_accessor_class_signed.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_signed_bits.c b/src/grib_accessor_class_signed_bits.c index 936ab274d..194850277 100644 --- a/src/grib_accessor_class_signed_bits.c +++ b/src/grib_accessor_class_signed_bits.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_simple_packing_error.c b/src/grib_accessor_class_simple_packing_error.c index eb9afc758..a59b5d33b 100644 --- a/src/grib_accessor_class_simple_packing_error.c +++ b/src/grib_accessor_class_simple_packing_error.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_size.c b/src/grib_accessor_class_size.c index a45e18720..5871160c5 100644 --- a/src/grib_accessor_class_size.c +++ b/src/grib_accessor_class_size.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_smart_table.c b/src/grib_accessor_class_smart_table.c index 5addbdef8..099c20624 100644 --- a/src/grib_accessor_class_smart_table.c +++ b/src/grib_accessor_class_smart_table.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_smart_table_column.c b/src/grib_accessor_class_smart_table_column.c index 436b75567..55a6e97db 100644 --- a/src/grib_accessor_class_smart_table_column.c +++ b/src/grib_accessor_class_smart_table_column.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_spd.c b/src/grib_accessor_class_spd.c index b94ee7874..5e005f2f8 100644 --- a/src/grib_accessor_class_spd.c +++ b/src/grib_accessor_class_spd.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_spectral_truncation.c b/src/grib_accessor_class_spectral_truncation.c index a50b1300d..9ae52d410 100644 --- a/src/grib_accessor_class_spectral_truncation.c +++ b/src/grib_accessor_class_spectral_truncation.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_sprintf.c b/src/grib_accessor_class_sprintf.c index 68a158403..45b90b5b7 100644 --- a/src/grib_accessor_class_sprintf.c +++ b/src/grib_accessor_class_sprintf.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_statistics.c b/src/grib_accessor_class_statistics.c index fe5327926..3f523dd60 100644 --- a/src/grib_accessor_class_statistics.c +++ b/src/grib_accessor_class_statistics.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_statistics_spectral.c b/src/grib_accessor_class_statistics_spectral.c index 818dd8814..440580357 100644 --- a/src/grib_accessor_class_statistics_spectral.c +++ b/src/grib_accessor_class_statistics_spectral.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_step_in_units.c b/src/grib_accessor_class_step_in_units.c index 67489f62e..f97abd50c 100644 --- a/src/grib_accessor_class_step_in_units.c +++ b/src/grib_accessor_class_step_in_units.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_sum.c b/src/grib_accessor_class_sum.c index 53d6595f1..5c1750409 100644 --- a/src/grib_accessor_class_sum.c +++ b/src/grib_accessor_class_sum.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_suppressed.c b/src/grib_accessor_class_suppressed.c index d2e1ea842..2ab781fc6 100644 --- a/src/grib_accessor_class_suppressed.c +++ b/src/grib_accessor_class_suppressed.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_time.c b/src/grib_accessor_class_time.c index 609ebf6d4..f9155bdb0 100644 --- a/src/grib_accessor_class_time.c +++ b/src/grib_accessor_class_time.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_times.c b/src/grib_accessor_class_times.c index ae867c2a7..6e348d0a6 100644 --- a/src/grib_accessor_class_times.c +++ b/src/grib_accessor_class_times.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_to_double.c b/src/grib_accessor_class_to_double.c index 0a0b36455..b9ee9554f 100644 --- a/src/grib_accessor_class_to_double.c +++ b/src/grib_accessor_class_to_double.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_to_integer.c b/src/grib_accessor_class_to_integer.c index 867a82e7b..f9f6e2677 100644 --- a/src/grib_accessor_class_to_integer.c +++ b/src/grib_accessor_class_to_integer.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_to_string.c b/src/grib_accessor_class_to_string.c index 1b840be17..451ac1882 100644 --- a/src/grib_accessor_class_to_string.c +++ b/src/grib_accessor_class_to_string.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_transient.c b/src/grib_accessor_class_transient.c index cce792bb0..2c408c1e4 100644 --- a/src/grib_accessor_class_transient.c +++ b/src/grib_accessor_class_transient.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_transient_darray.c b/src/grib_accessor_class_transient_darray.c index 0e8ba5c2f..aba724df8 100644 --- a/src/grib_accessor_class_transient_darray.c +++ b/src/grib_accessor_class_transient_darray.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_uint16.c b/src/grib_accessor_class_uint16.c index 9b0d0262c..03fac8595 100644 --- a/src/grib_accessor_class_uint16.c +++ b/src/grib_accessor_class_uint16.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_uint16_little_endian.c b/src/grib_accessor_class_uint16_little_endian.c index d7c49ecaf..5117e15ea 100644 --- a/src/grib_accessor_class_uint16_little_endian.c +++ b/src/grib_accessor_class_uint16_little_endian.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_uint32.c b/src/grib_accessor_class_uint32.c index 608c63ed3..2e2590f45 100644 --- a/src/grib_accessor_class_uint32.c +++ b/src/grib_accessor_class_uint32.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_uint32_little_endian.c b/src/grib_accessor_class_uint32_little_endian.c index 73558f30f..0909b0754 100644 --- a/src/grib_accessor_class_uint32_little_endian.c +++ b/src/grib_accessor_class_uint32_little_endian.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_uint64.c b/src/grib_accessor_class_uint64.c index a77019bfd..e55c346b4 100644 --- a/src/grib_accessor_class_uint64.c +++ b/src/grib_accessor_class_uint64.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_uint64_little_endian.c b/src/grib_accessor_class_uint64_little_endian.c index 7a9358009..81bd49329 100644 --- a/src/grib_accessor_class_uint64_little_endian.c +++ b/src/grib_accessor_class_uint64_little_endian.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_uint8.c b/src/grib_accessor_class_uint8.c index d9bc80e0f..cdd47a4be 100644 --- a/src/grib_accessor_class_uint8.c +++ b/src/grib_accessor_class_uint8.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_unexpanded_descriptors.c b/src/grib_accessor_class_unexpanded_descriptors.c index 362abf5f2..f37620cf2 100644 --- a/src/grib_accessor_class_unexpanded_descriptors.c +++ b/src/grib_accessor_class_unexpanded_descriptors.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_unpack_bufr_values.c b/src/grib_accessor_class_unpack_bufr_values.c index 532edb9df..2e2ed9ff2 100644 --- a/src/grib_accessor_class_unpack_bufr_values.c +++ b/src/grib_accessor_class_unpack_bufr_values.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_unsigned.c b/src/grib_accessor_class_unsigned.c index a3a51a240..d1e09634e 100644 --- a/src/grib_accessor_class_unsigned.c +++ b/src/grib_accessor_class_unsigned.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_unsigned_bits.c b/src/grib_accessor_class_unsigned_bits.c index c34a37c58..8dfcfeb2a 100644 --- a/src/grib_accessor_class_unsigned_bits.c +++ b/src/grib_accessor_class_unsigned_bits.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_validity_date.c b/src/grib_accessor_class_validity_date.c index 1b323439b..1f8d306c6 100644 --- a/src/grib_accessor_class_validity_date.c +++ b/src/grib_accessor_class_validity_date.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_validity_time.c b/src/grib_accessor_class_validity_time.c index bca308099..60f8df121 100644 --- a/src/grib_accessor_class_validity_time.c +++ b/src/grib_accessor_class_validity_time.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_values.c b/src/grib_accessor_class_values.c index e4a3cedb6..bd8370a0f 100644 --- a/src/grib_accessor_class_values.c +++ b/src/grib_accessor_class_values.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_variable.c b/src/grib_accessor_class_variable.c index f3f353d1c..ba7954606 100644 --- a/src/grib_accessor_class_variable.c +++ b/src/grib_accessor_class_variable.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_vector.c b/src/grib_accessor_class_vector.c index f473ead56..0def0bee2 100644 --- a/src/grib_accessor_class_vector.c +++ b/src/grib_accessor_class_vector.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_accessor_class_when.c b/src/grib_accessor_class_when.c index a5bf209a8..22bd06565 100644 --- a/src/grib_accessor_class_when.c +++ b/src/grib_accessor_class_when.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_api.h b/src/grib_api.h index 8e5b1d83c..523ce189e 100644 --- a/src/grib_api.h +++ b/src/grib_api.h @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_api_internal.h b/src/grib_api_internal.h index 5028d7ff3..fa1e7d167 100644 --- a/src/grib_api_internal.h +++ b/src/grib_api_internal.h @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_bits.c b/src/grib_bits.c index 19221ee40..fa21c2ba7 100644 --- a/src/grib_bits.c +++ b/src/grib_bits.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_bits_any_endian.c b/src/grib_bits_any_endian.c index 5823ea284..a6906bf4a 100644 --- a/src/grib_bits_any_endian.c +++ b/src/grib_bits_any_endian.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_bits_any_endian_omp.c b/src/grib_bits_any_endian_omp.c index 618658394..fa726a19b 100644 --- a/src/grib_bits_any_endian_omp.c +++ b/src/grib_bits_any_endian_omp.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_bits_any_endian_simple.c b/src/grib_bits_any_endian_simple.c index 525ada7d3..7c00aa4c7 100644 --- a/src/grib_bits_any_endian_simple.c +++ b/src/grib_bits_any_endian_simple.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_bits_any_endian_vector.c b/src/grib_bits_any_endian_vector.c index 1e901d99c..3c3a13582 100644 --- a/src/grib_bits_any_endian_vector.c +++ b/src/grib_bits_any_endian_vector.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_bits_fast_big_endian.c b/src/grib_bits_fast_big_endian.c index ce167c838..dccd60189 100644 --- a/src/grib_bits_fast_big_endian.c +++ b/src/grib_bits_fast_big_endian.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_bits_fast_big_endian_omp.c b/src/grib_bits_fast_big_endian_omp.c index 5d3592243..6bdb787d9 100644 --- a/src/grib_bits_fast_big_endian_omp.c +++ b/src/grib_bits_fast_big_endian_omp.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_bits_fast_big_endian_simple.c b/src/grib_bits_fast_big_endian_simple.c index fbea5a94f..7bebaa6fe 100644 --- a/src/grib_bits_fast_big_endian_simple.c +++ b/src/grib_bits_fast_big_endian_simple.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_bits_fast_big_endian_vector.c b/src/grib_bits_fast_big_endian_vector.c index 78453d7fe..0304672bd 100644 --- a/src/grib_bits_fast_big_endian_vector.c +++ b/src/grib_bits_fast_big_endian_vector.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_bits_ibmpow.c b/src/grib_bits_ibmpow.c index cc1682cc1..162a7e4a9 100644 --- a/src/grib_bits_ibmpow.c +++ b/src/grib_bits_ibmpow.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_bits_ibmpow_opt.c b/src/grib_bits_ibmpow_opt.c index 5578daee1..4740c0ff5 100644 --- a/src/grib_bits_ibmpow_opt.c +++ b/src/grib_bits_ibmpow_opt.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_box.c b/src/grib_box.c index 5fd942a8d..6f4d42daf 100644 --- a/src/grib_box.c +++ b/src/grib_box.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_box_class.c b/src/grib_box_class.c index c0238bb80..86283ab86 100644 --- a/src/grib_box_class.c +++ b/src/grib_box_class.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_box_class_gen.c b/src/grib_box_class_gen.c index cccb62042..89b40409e 100644 --- a/src/grib_box_class_gen.c +++ b/src/grib_box_class_gen.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_box_class_reduced_gaussian.c b/src/grib_box_class_reduced_gaussian.c index af4cf8ee2..151d170a0 100644 --- a/src/grib_box_class_reduced_gaussian.c +++ b/src/grib_box_class_reduced_gaussian.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_box_class_regular_gaussian.c b/src/grib_box_class_regular_gaussian.c index 9924d589c..b7c4d92d6 100644 --- a/src/grib_box_class_regular_gaussian.c +++ b/src/grib_box_class_regular_gaussian.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_buffer.c b/src/grib_buffer.c index ee2e49f07..6f3bb1911 100644 --- a/src/grib_buffer.c +++ b/src/grib_buffer.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_bufr_descriptor.c b/src/grib_bufr_descriptor.c index 07d49642f..5a2549b5b 100644 --- a/src/grib_bufr_descriptor.c +++ b/src/grib_bufr_descriptor.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_bufr_descriptors_array.c b/src/grib_bufr_descriptors_array.c index 09efe88fd..3dd940ab5 100644 --- a/src/grib_bufr_descriptors_array.c +++ b/src/grib_bufr_descriptors_array.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_compressor.c b/src/grib_compressor.c index e165e4f70..d83bf6bd9 100644 --- a/src/grib_compressor.c +++ b/src/grib_compressor.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_concept.c b/src/grib_concept.c index 5e29f2719..bcadeb1b5 100644 --- a/src/grib_concept.c +++ b/src/grib_concept.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_concept_index.c b/src/grib_concept_index.c index 40dbd3a40..1d7ba8c1b 100644 --- a/src/grib_concept_index.c +++ b/src/grib_concept_index.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_context.c b/src/grib_context.c index f19a41b9a..357e98707 100644 --- a/src/grib_context.c +++ b/src/grib_context.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_darray.c b/src/grib_darray.c index 40f579ddd..af3c189a4 100644 --- a/src/grib_darray.c +++ b/src/grib_darray.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_date.c b/src/grib_date.c index 223cf917c..c71d1a9da 100644 --- a/src/grib_date.c +++ b/src/grib_date.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_db.c b/src/grib_db.c index ebba058ab..087d11192 100644 --- a/src/grib_db.c +++ b/src/grib_db.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_dependency.c b/src/grib_dependency.c index 45fc6f4ec..2935a22ae 100644 --- a/src/grib_dependency.c +++ b/src/grib_dependency.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_dumper.c b/src/grib_dumper.c index 7f7593fd3..4e8bfe483 100644 --- a/src/grib_dumper.c +++ b/src/grib_dumper.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_dumper_class.c b/src/grib_dumper_class.c index e97f0f456..698c9bace 100644 --- a/src/grib_dumper_class.c +++ b/src/grib_dumper_class.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_dumper_class_bufr_decode_C.c b/src/grib_dumper_class_bufr_decode_C.c index 53efe48a9..691aedc32 100644 --- a/src/grib_dumper_class_bufr_decode_C.c +++ b/src/grib_dumper_class_bufr_decode_C.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_dumper_class_bufr_decode_filter.c b/src/grib_dumper_class_bufr_decode_filter.c index 4037e5b15..766d14495 100644 --- a/src/grib_dumper_class_bufr_decode_filter.c +++ b/src/grib_dumper_class_bufr_decode_filter.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_dumper_class_bufr_decode_fortran.c b/src/grib_dumper_class_bufr_decode_fortran.c index 5c1b2e41a..6eea3f372 100644 --- a/src/grib_dumper_class_bufr_decode_fortran.c +++ b/src/grib_dumper_class_bufr_decode_fortran.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_dumper_class_bufr_decode_python.c b/src/grib_dumper_class_bufr_decode_python.c index a92ec1f7f..735760449 100644 --- a/src/grib_dumper_class_bufr_decode_python.c +++ b/src/grib_dumper_class_bufr_decode_python.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_dumper_class_bufr_encode_C.c b/src/grib_dumper_class_bufr_encode_C.c index d4dd72751..a1e052d70 100644 --- a/src/grib_dumper_class_bufr_encode_C.c +++ b/src/grib_dumper_class_bufr_encode_C.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_dumper_class_bufr_encode_filter.c b/src/grib_dumper_class_bufr_encode_filter.c index 3a23ffe1b..a61dfe6b2 100644 --- a/src/grib_dumper_class_bufr_encode_filter.c +++ b/src/grib_dumper_class_bufr_encode_filter.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_dumper_class_bufr_encode_fortran.c b/src/grib_dumper_class_bufr_encode_fortran.c index 10f7c5902..5bf86c199 100644 --- a/src/grib_dumper_class_bufr_encode_fortran.c +++ b/src/grib_dumper_class_bufr_encode_fortran.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_dumper_class_bufr_encode_python.c b/src/grib_dumper_class_bufr_encode_python.c index aa6ad4a80..4ddd50290 100644 --- a/src/grib_dumper_class_bufr_encode_python.c +++ b/src/grib_dumper_class_bufr_encode_python.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_dumper_class_bufr_simple.c b/src/grib_dumper_class_bufr_simple.c index 97e043e23..2a00dbc7e 100644 --- a/src/grib_dumper_class_bufr_simple.c +++ b/src/grib_dumper_class_bufr_simple.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_dumper_class_debug.c b/src/grib_dumper_class_debug.c index a210459a1..1d350a573 100644 --- a/src/grib_dumper_class_debug.c +++ b/src/grib_dumper_class_debug.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_dumper_class_default.c b/src/grib_dumper_class_default.c index 4030d503e..70101b743 100644 --- a/src/grib_dumper_class_default.c +++ b/src/grib_dumper_class_default.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_dumper_class_grib_encode_C.c b/src/grib_dumper_class_grib_encode_C.c index e8f88d8ba..9a64b6720 100644 --- a/src/grib_dumper_class_grib_encode_C.c +++ b/src/grib_dumper_class_grib_encode_C.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_dumper_class_json.c b/src/grib_dumper_class_json.c index b20224441..8c0abb36e 100644 --- a/src/grib_dumper_class_json.c +++ b/src/grib_dumper_class_json.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_dumper_class_keys.c b/src/grib_dumper_class_keys.c index c7b9da197..64815e760 100644 --- a/src/grib_dumper_class_keys.c +++ b/src/grib_dumper_class_keys.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_dumper_class_serialize.c b/src/grib_dumper_class_serialize.c index 6964fc285..02b4c5eda 100644 --- a/src/grib_dumper_class_serialize.c +++ b/src/grib_dumper_class_serialize.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_dumper_class_wmo.c b/src/grib_dumper_class_wmo.c index 275c94a5b..7815468d9 100644 --- a/src/grib_dumper_class_wmo.c +++ b/src/grib_dumper_class_wmo.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_emoslib.h b/src/grib_emoslib.h index c741ddfa6..9a358a8c4 100644 --- a/src/grib_emoslib.h +++ b/src/grib_emoslib.h @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_expression.c b/src/grib_expression.c index 21ad00044..60580d942 100644 --- a/src/grib_expression.c +++ b/src/grib_expression.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_expression_class_accessor.c b/src/grib_expression_class_accessor.c index 98b2f4d6f..07c9159a7 100644 --- a/src/grib_expression_class_accessor.c +++ b/src/grib_expression_class_accessor.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_expression_class_binop.c b/src/grib_expression_class_binop.c index 341831c46..08265b9b1 100644 --- a/src/grib_expression_class_binop.c +++ b/src/grib_expression_class_binop.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_expression_class_column.c b/src/grib_expression_class_column.c index edff52f67..ef540dcdb 100644 --- a/src/grib_expression_class_column.c +++ b/src/grib_expression_class_column.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_expression_class_constant.c b/src/grib_expression_class_constant.c index 7bb648da3..1bece12d4 100644 --- a/src/grib_expression_class_constant.c +++ b/src/grib_expression_class_constant.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_expression_class_double.c b/src/grib_expression_class_double.c index 7aa53785c..2599ad0ed 100644 --- a/src/grib_expression_class_double.c +++ b/src/grib_expression_class_double.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_expression_class_functor.c b/src/grib_expression_class_functor.c index 7a21344c4..4919ba5df 100644 --- a/src/grib_expression_class_functor.c +++ b/src/grib_expression_class_functor.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_expression_class_is_in_dict.c b/src/grib_expression_class_is_in_dict.c index 36427045a..07de322ad 100644 --- a/src/grib_expression_class_is_in_dict.c +++ b/src/grib_expression_class_is_in_dict.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_expression_class_is_in_list.c b/src/grib_expression_class_is_in_list.c index ab4a90e10..9f64f5979 100644 --- a/src/grib_expression_class_is_in_list.c +++ b/src/grib_expression_class_is_in_list.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_expression_class_is_integer.c b/src/grib_expression_class_is_integer.c index 60e76e7ed..f9a65d823 100644 --- a/src/grib_expression_class_is_integer.c +++ b/src/grib_expression_class_is_integer.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_expression_class_length.c b/src/grib_expression_class_length.c index 4de5b8c2b..495d6efc6 100644 --- a/src/grib_expression_class_length.c +++ b/src/grib_expression_class_length.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_expression_class_logical_and.c b/src/grib_expression_class_logical_and.c index 5dd1ee504..8e9cbd866 100644 --- a/src/grib_expression_class_logical_and.c +++ b/src/grib_expression_class_logical_and.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_expression_class_logical_or.c b/src/grib_expression_class_logical_or.c index 47a7bcdd1..75f003f5d 100644 --- a/src/grib_expression_class_logical_or.c +++ b/src/grib_expression_class_logical_or.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_expression_class_long.c b/src/grib_expression_class_long.c index c51b5b3fe..6964b433e 100644 --- a/src/grib_expression_class_long.c +++ b/src/grib_expression_class_long.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_expression_class_string.c b/src/grib_expression_class_string.c index 369aa4607..eca1db22f 100644 --- a/src/grib_expression_class_string.c +++ b/src/grib_expression_class_string.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_expression_class_string_compare.c b/src/grib_expression_class_string_compare.c index 0199b3394..cdae91f55 100644 --- a/src/grib_expression_class_string_compare.c +++ b/src/grib_expression_class_string_compare.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_expression_class_sub_string.c b/src/grib_expression_class_sub_string.c index 60e0d03ab..803f6f2ee 100644 --- a/src/grib_expression_class_sub_string.c +++ b/src/grib_expression_class_sub_string.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_expression_class_true.c b/src/grib_expression_class_true.c index 9bd79e4fd..58861e8ae 100644 --- a/src/grib_expression_class_true.c +++ b/src/grib_expression_class_true.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_expression_class_unop.c b/src/grib_expression_class_unop.c index b02812dc6..55ae382f1 100644 --- a/src/grib_expression_class_unop.c +++ b/src/grib_expression_class_unop.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_fieldset.c b/src/grib_fieldset.c index e99acb7d7..224e85e14 100644 --- a/src/grib_fieldset.c +++ b/src/grib_fieldset.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_filepool.c b/src/grib_filepool.c index 96faf8cf2..02d9e940d 100644 --- a/src/grib_filepool.c +++ b/src/grib_filepool.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_gaussian_reduced.c b/src/grib_gaussian_reduced.c index bc4ab9731..334b736d6 100644 --- a/src/grib_gaussian_reduced.c +++ b/src/grib_gaussian_reduced.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_geography.c b/src/grib_geography.c index e373f1f56..f993952ee 100644 --- a/src/grib_geography.c +++ b/src/grib_geography.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_handle.c b/src/grib_handle.c index 40c7227fe..723595fb3 100644 --- a/src/grib_handle.c +++ b/src/grib_handle.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_hash_array.c b/src/grib_hash_array.c index 308c58243..3e0446b32 100644 --- a/src/grib_hash_array.c +++ b/src/grib_hash_array.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_hash_keys.c b/src/grib_hash_keys.c index 74c031726..b23f1ffbe 100644 --- a/src/grib_hash_keys.c +++ b/src/grib_hash_keys.c @@ -8864,7 +8864,7 @@ grib_keys_hash_get (const char *str, unsigned int len) return 0; } /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_header_compute.c b/src/grib_header_compute.c index 816f3e8f8..828b4b42e 100644 --- a/src/grib_header_compute.c +++ b/src/grib_header_compute.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_iarray.c b/src/grib_iarray.c index 1303cff5e..4ab9eb9cd 100644 --- a/src/grib_iarray.c +++ b/src/grib_iarray.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_ibmfloat.c b/src/grib_ibmfloat.c index bdd192ef5..5785bf2fd 100644 --- a/src/grib_ibmfloat.c +++ b/src/grib_ibmfloat.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_ieeefloat.c b/src/grib_ieeefloat.c index 33a246df3..c27aa4830 100644 --- a/src/grib_ieeefloat.c +++ b/src/grib_ieeefloat.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_index.c b/src/grib_index.c index d2febf8db..a52033207 100644 --- a/src/grib_index.c +++ b/src/grib_index.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_io.c b/src/grib_io.c index 9748f9aba..208bfbb7c 100644 --- a/src/grib_io.c +++ b/src/grib_io.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_iterator.c b/src/grib_iterator.c index 2a256a704..7018f6b1c 100644 --- a/src/grib_iterator.c +++ b/src/grib_iterator.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_iterator_class.c b/src/grib_iterator_class.c index 8fcfc764b..dd16ed3da 100644 --- a/src/grib_iterator_class.c +++ b/src/grib_iterator_class.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_iterator_class_gaussian.c b/src/grib_iterator_class_gaussian.c index dd358dad9..536d38b11 100644 --- a/src/grib_iterator_class_gaussian.c +++ b/src/grib_iterator_class_gaussian.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_iterator_class_gaussian_reduced.c b/src/grib_iterator_class_gaussian_reduced.c index 7ec3d2326..67ce64d4a 100644 --- a/src/grib_iterator_class_gaussian_reduced.c +++ b/src/grib_iterator_class_gaussian_reduced.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_iterator_class_gen.c b/src/grib_iterator_class_gen.c index e002bacbf..5d8693dce 100644 --- a/src/grib_iterator_class_gen.c +++ b/src/grib_iterator_class_gen.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_iterator_class_lambert_azimuthal_equal_area.c b/src/grib_iterator_class_lambert_azimuthal_equal_area.c index 7566b7c2a..5d23253b2 100644 --- a/src/grib_iterator_class_lambert_azimuthal_equal_area.c +++ b/src/grib_iterator_class_lambert_azimuthal_equal_area.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_iterator_class_lambert_conformal.c b/src/grib_iterator_class_lambert_conformal.c index 6bae1d000..e0f75d8fe 100644 --- a/src/grib_iterator_class_lambert_conformal.c +++ b/src/grib_iterator_class_lambert_conformal.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_iterator_class_latlon.c b/src/grib_iterator_class_latlon.c index 571b908d3..25b8fd52e 100644 --- a/src/grib_iterator_class_latlon.c +++ b/src/grib_iterator_class_latlon.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_iterator_class_latlon_reduced.c b/src/grib_iterator_class_latlon_reduced.c index b7eba9cc5..c858e7954 100644 --- a/src/grib_iterator_class_latlon_reduced.c +++ b/src/grib_iterator_class_latlon_reduced.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_iterator_class_polar_stereographic.c b/src/grib_iterator_class_polar_stereographic.c index 7f2b8876d..4bf22502a 100644 --- a/src/grib_iterator_class_polar_stereographic.c +++ b/src/grib_iterator_class_polar_stereographic.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_iterator_class_regular.c b/src/grib_iterator_class_regular.c index 7e766f874..64f04c3bf 100644 --- a/src/grib_iterator_class_regular.c +++ b/src/grib_iterator_class_regular.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_iterator_class_space_view.c b/src/grib_iterator_class_space_view.c index 73a663771..e3119b607 100644 --- a/src/grib_iterator_class_space_view.c +++ b/src/grib_iterator_class_space_view.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_itrie.c b/src/grib_itrie.c index 20842bc59..74a13c86a 100644 --- a/src/grib_itrie.c +++ b/src/grib_itrie.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_itrie_keys.c b/src/grib_itrie_keys.c index c54329198..5b34eaa67 100644 --- a/src/grib_itrie_keys.c +++ b/src/grib_itrie_keys.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_jasper_encoding.c b/src/grib_jasper_encoding.c index 97e31534a..d795ece08 100644 --- a/src/grib_jasper_encoding.c +++ b/src/grib_jasper_encoding.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_keys_iterator.c b/src/grib_keys_iterator.c index 1b6d342d6..f1641dbf0 100644 --- a/src/grib_keys_iterator.c +++ b/src/grib_keys_iterator.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_lex.c b/src/grib_lex.c index 3928dd268..8f47c6d7a 100644 --- a/src/grib_lex.c +++ b/src/grib_lex.c @@ -1160,7 +1160,7 @@ int grib_yy_flex_debug = 0; char *grib_yytext; #line 1 "gribl.l" /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_loader_from_array.c b/src/grib_loader_from_array.c index 9d5101b14..e2eb728aa 100644 --- a/src/grib_loader_from_array.c +++ b/src/grib_loader_from_array.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_loader_from_file.c b/src/grib_loader_from_file.c index 045c59009..7a8401f5f 100644 --- a/src/grib_loader_from_file.c +++ b/src/grib_loader_from_file.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_loader_from_handle.c b/src/grib_loader_from_handle.c index 1b251ba6e..bf15a2fd7 100644 --- a/src/grib_loader_from_handle.c +++ b/src/grib_loader_from_handle.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_memory.c b/src/grib_memory.c index 6de8059f3..a73e965a8 100644 --- a/src/grib_memory.c +++ b/src/grib_memory.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_nearest.c b/src/grib_nearest.c index a26afc23c..e6a59d9ec 100644 --- a/src/grib_nearest.c +++ b/src/grib_nearest.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_nearest_class.c b/src/grib_nearest_class.c index a90977009..e0e5493c9 100644 --- a/src/grib_nearest_class.c +++ b/src/grib_nearest_class.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_nearest_class_gen.c b/src/grib_nearest_class_gen.c index 61917825e..ce9ea2fef 100644 --- a/src/grib_nearest_class_gen.c +++ b/src/grib_nearest_class_gen.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_nearest_class_lambert_conformal.c b/src/grib_nearest_class_lambert_conformal.c index 82e80daa4..3355de694 100644 --- a/src/grib_nearest_class_lambert_conformal.c +++ b/src/grib_nearest_class_lambert_conformal.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_nearest_class_latlon_reduced.c b/src/grib_nearest_class_latlon_reduced.c index 2f8da78c0..caa000c08 100644 --- a/src/grib_nearest_class_latlon_reduced.c +++ b/src/grib_nearest_class_latlon_reduced.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_nearest_class_polar_stereographic.c b/src/grib_nearest_class_polar_stereographic.c index b41711a64..28077d4fc 100644 --- a/src/grib_nearest_class_polar_stereographic.c +++ b/src/grib_nearest_class_polar_stereographic.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_nearest_class_reduced.c b/src/grib_nearest_class_reduced.c index 40cc92e55..cbea92f0f 100644 --- a/src/grib_nearest_class_reduced.c +++ b/src/grib_nearest_class_reduced.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_nearest_class_regular.c b/src/grib_nearest_class_regular.c index bebcd7411..75023845c 100644 --- a/src/grib_nearest_class_regular.c +++ b/src/grib_nearest_class_regular.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_nearest_class_sh.c b/src/grib_nearest_class_sh.c index 3ccc7d65f..7b89efe5a 100644 --- a/src/grib_nearest_class_sh.c +++ b/src/grib_nearest_class_sh.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_oarray.c b/src/grib_oarray.c index 2db1b9f62..8d2958479 100644 --- a/src/grib_oarray.c +++ b/src/grib_oarray.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_openjpeg_encoding.c b/src/grib_openjpeg_encoding.c index efae107d1..3503b9ce8 100644 --- a/src/grib_openjpeg_encoding.c +++ b/src/grib_openjpeg_encoding.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_optimize_decimal_factor.c b/src/grib_optimize_decimal_factor.c index 9e30f4ce0..517a9e869 100644 --- a/src/grib_optimize_decimal_factor.c +++ b/src/grib_optimize_decimal_factor.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_optimize_decimal_factor.h b/src/grib_optimize_decimal_factor.h index 895a06919..81378a0ac 100644 --- a/src/grib_optimize_decimal_factor.h +++ b/src/grib_optimize_decimal_factor.h @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_parse_utils.c b/src/grib_parse_utils.c index 0b2e46701..357fe3429 100644 --- a/src/grib_parse_utils.c +++ b/src/grib_parse_utils.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. @@ -483,7 +483,7 @@ int grib_recompose_print(grib_handle* h, grib_accessor* observer, const char* un case ']': loc[mode] = 0; mode = -1; - al = grib_find_accessors_list(h, loc); + al = grib_find_accessors_list(h, loc); /* This allocates memory */ if (!al) { if (!fail) { fprintf(out, "undef"); @@ -499,6 +499,7 @@ int grib_recompose_print(grib_handle* h, grib_accessor* observer, const char* un if (ret != GRIB_SUCCESS) { /* grib_context_log(h->context, GRIB_LOG_ERROR,"grib_recompose_print: Could not recompose print : %s", uname); */ + grib_accessors_list_delete(h->context, al); return ret; } } @@ -520,6 +521,7 @@ int grib_recompose_print(grib_handle* h, grib_accessor* observer, const char* un if (newline) fprintf(out, "\n"); + grib_accessors_list_delete(h->context, al); return ret; } diff --git a/src/grib_query.c b/src/grib_query.c index 1fd736ecd..479d002bf 100644 --- a/src/grib_query.c +++ b/src/grib_query.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_rules.c b/src/grib_rules.c index 78c5c3d56..4d4809606 100644 --- a/src/grib_rules.c +++ b/src/grib_rules.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_sarray.c b/src/grib_sarray.c index 0de574c6e..90904eafd 100644 --- a/src/grib_sarray.c +++ b/src/grib_sarray.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_scaling.c b/src/grib_scaling.c index 13bfa4725..d5dc80719 100644 --- a/src/grib_scaling.c +++ b/src/grib_scaling.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_templates.c b/src/grib_templates.c index fddb988ff..a9d03ad6a 100644 --- a/src/grib_templates.c +++ b/src/grib_templates.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_templates.h b/src/grib_templates.h index 805418677..c74ab44c2 100644 --- a/src/grib_templates.h +++ b/src/grib_templates.h @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_timer.c b/src/grib_timer.c index f3ed813ee..d7667e7ea 100644 --- a/src/grib_timer.c +++ b/src/grib_timer.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_trie.c b/src/grib_trie.c index 53c6e879e..90e21ba56 100644 --- a/src/grib_trie.c +++ b/src/grib_trie.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_trie_with_rank.c b/src/grib_trie_with_rank.c index d4dd278a2..c9db33b68 100644 --- a/src/grib_trie_with_rank.c +++ b/src/grib_trie_with_rank.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_util.c b/src/grib_util.c index 02782ab2f..cc6be90ad 100644 --- a/src/grib_util.c +++ b/src/grib_util.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_value.c b/src/grib_value.c index 45b735d33..814651dab 100644 --- a/src/grib_value.c +++ b/src/grib_value.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_vdarray.c b/src/grib_vdarray.c index e3c037401..b77d4a61d 100644 --- a/src/grib_vdarray.c +++ b/src/grib_vdarray.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_viarray.c b/src/grib_viarray.c index 31a5fcc20..8033ca669 100644 --- a/src/grib_viarray.c +++ b/src/grib_viarray.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/grib_vsarray.c b/src/grib_vsarray.c index 5c8d3e2db..237e42797 100644 --- a/src/grib_vsarray.c +++ b/src/grib_vsarray.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/gribl.l b/src/gribl.l index 5acc16852..e1a985362 100644 --- a/src/gribl.l +++ b/src/gribl.l @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/griby.y b/src/griby.y index 697a6a9cb..18401e911 100644 --- a/src/griby.y +++ b/src/griby.y @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/jgribapi_GribFile.h b/src/jgribapi_GribFile.h index 73a30b825..0d8061daa 100644 --- a/src/jgribapi_GribFile.h +++ b/src/jgribapi_GribFile.h @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/jgribapi_GribHandle.h b/src/jgribapi_GribHandle.h index f748832dd..ff0775f49 100644 --- a/src/jgribapi_GribHandle.h +++ b/src/jgribapi_GribHandle.h @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/jgribapi_GribIterator.h b/src/jgribapi_GribIterator.h index 9b17338a4..782e578bd 100644 --- a/src/jgribapi_GribIterator.h +++ b/src/jgribapi_GribIterator.h @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/md5.c b/src/md5.c index 2bdb55fed..633c4af9d 100644 --- a/src/md5.c +++ b/src/md5.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/md5.h b/src/md5.h index 305f21d51..973d2981c 100644 --- a/src/md5.h +++ b/src/md5.h @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/minmax_val.c b/src/minmax_val.c index 5cd578fbd..878c89bfe 100644 --- a/src/minmax_val.c +++ b/src/minmax_val.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/src/string_util.c b/src/string_util.c index 7b55c624a..448f4c5cc 100644 --- a/src/string_util.c +++ b/src/string_util.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/badgrib.sh b/tests/badgrib.sh index e9a7edf11..d978199a9 100755 --- a/tests/badgrib.sh +++ b/tests/badgrib.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bits.c b/tests/bits.c index 187d6ff47..b06ac279f 100755 --- a/tests/bits.c +++ b/tests/bits.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/bpv_limit.c b/tests/bpv_limit.c index 9194fd771..cd2f580ec 100644 --- a/tests/bpv_limit.c +++ b/tests/bpv_limit.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/bpv_limit.sh b/tests/bpv_limit.sh index 2e27c8c2b..3cfc29906 100755 --- a/tests/bpv_limit.sh +++ b/tests/bpv_limit.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/budg.sh b/tests/budg.sh index e1f9b21d0..4ee4ced56 100755 --- a/tests/budg.sh +++ b/tests/budg.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_change_edition.sh b/tests/bufr_change_edition.sh index 5b051f5fa..7805ef7c9 100755 --- a/tests/bufr_change_edition.sh +++ b/tests/bufr_change_edition.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_compare.sh b/tests/bufr_compare.sh index 63edee393..5902048ee 100755 --- a/tests/bufr_compare.sh +++ b/tests/bufr_compare.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_copy.sh b/tests/bufr_copy.sh index 5f0785d7e..5034029bd 100755 --- a/tests/bufr_copy.sh +++ b/tests/bufr_copy.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_count.sh b/tests/bufr_count.sh index 064eee5ea..9ba70b25e 100755 --- a/tests/bufr_count.sh +++ b/tests/bufr_count.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_dump_data.sh b/tests/bufr_dump_data.sh index 7fe2485dd..fe739faf1 100755 --- a/tests/bufr_dump_data.sh +++ b/tests/bufr_dump_data.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_dump_decode_C.sh b/tests/bufr_dump_decode_C.sh index 8be9a2f3c..7195095fb 100755 --- a/tests/bufr_dump_decode_C.sh +++ b/tests/bufr_dump_decode_C.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_dump_decode_filter.sh b/tests/bufr_dump_decode_filter.sh index 1d9aa4f67..c1898051a 100755 --- a/tests/bufr_dump_decode_filter.sh +++ b/tests/bufr_dump_decode_filter.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_dump_decode_fortran.sh b/tests/bufr_dump_decode_fortran.sh index dceb7ee7f..e37ee926f 100755 --- a/tests/bufr_dump_decode_fortran.sh +++ b/tests/bufr_dump_decode_fortran.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_dump_decode_python.sh b/tests/bufr_dump_decode_python.sh index 3ccbac43e..dde001a1d 100755 --- a/tests/bufr_dump_decode_python.sh +++ b/tests/bufr_dump_decode_python.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_dump_descriptors.sh b/tests/bufr_dump_descriptors.sh index 5d4752cc2..57eae96d4 100755 --- a/tests/bufr_dump_descriptors.sh +++ b/tests/bufr_dump_descriptors.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_dump_encode_C.sh b/tests/bufr_dump_encode_C.sh index 1d2a5204f..6e7b60a7e 100755 --- a/tests/bufr_dump_encode_C.sh +++ b/tests/bufr_dump_encode_C.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_dump_encode_filter.sh b/tests/bufr_dump_encode_filter.sh index aac14d22b..f5cf7801d 100755 --- a/tests/bufr_dump_encode_filter.sh +++ b/tests/bufr_dump_encode_filter.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_dump_encode_fortran.sh b/tests/bufr_dump_encode_fortran.sh index 7664c8607..c6feba219 100755 --- a/tests/bufr_dump_encode_fortran.sh +++ b/tests/bufr_dump_encode_fortran.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_dump_encode_python.sh b/tests/bufr_dump_encode_python.sh index 9aa20a643..90d26a486 100755 --- a/tests/bufr_dump_encode_python.sh +++ b/tests/bufr_dump_encode_python.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_dump_samples.sh b/tests/bufr_dump_samples.sh index 3a620fdad..41a341218 100755 --- a/tests/bufr_dump_samples.sh +++ b/tests/bufr_dump_samples.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_dump_subset.sh b/tests/bufr_dump_subset.sh index bf89215bb..907d1cd13 100755 --- a/tests/bufr_dump_subset.sh +++ b/tests/bufr_dump_subset.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_ecc-197.sh b/tests/bufr_ecc-197.sh index bfb221d81..ff6df8b62 100755 --- a/tests/bufr_ecc-197.sh +++ b/tests/bufr_ecc-197.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_ecc-286.sh b/tests/bufr_ecc-286.sh index 5baa601a3..970254fb7 100755 --- a/tests/bufr_ecc-286.sh +++ b/tests/bufr_ecc-286.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_ecc-288.sh b/tests/bufr_ecc-288.sh index 719f54562..eb831f39e 100755 --- a/tests/bufr_ecc-288.sh +++ b/tests/bufr_ecc-288.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_ecc-313.sh b/tests/bufr_ecc-313.sh index 5c418b9e8..18b57cb6b 100755 --- a/tests/bufr_ecc-313.sh +++ b/tests/bufr_ecc-313.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_ecc-359.sh b/tests/bufr_ecc-359.sh index db001afa5..808b6f1b4 100755 --- a/tests/bufr_ecc-359.sh +++ b/tests/bufr_ecc-359.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_ecc-379.sh b/tests/bufr_ecc-379.sh index 4bfd5392f..eb949a677 100755 --- a/tests/bufr_ecc-379.sh +++ b/tests/bufr_ecc-379.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_ecc-393.sh b/tests/bufr_ecc-393.sh index 76a092ef5..aa817b800 100755 --- a/tests/bufr_ecc-393.sh +++ b/tests/bufr_ecc-393.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_ecc-428.sh b/tests/bufr_ecc-428.sh index a1691ff3d..fb46c6e5c 100755 --- a/tests/bufr_ecc-428.sh +++ b/tests/bufr_ecc-428.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_ecc-433.sh b/tests/bufr_ecc-433.sh index c08a1f3ff..9d00ccfbf 100755 --- a/tests/bufr_ecc-433.sh +++ b/tests/bufr_ecc-433.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_ecc-517.c b/tests/bufr_ecc-517.c index a137ea95e..64bbc6a46 100644 --- a/tests/bufr_ecc-517.c +++ b/tests/bufr_ecc-517.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/bufr_ecc-517.sh b/tests/bufr_ecc-517.sh index 387ee168b..8993d8d7d 100755 --- a/tests/bufr_ecc-517.sh +++ b/tests/bufr_ecc-517.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_ecc-556.sh b/tests/bufr_ecc-556.sh index 880586d76..af3861326 100755 --- a/tests/bufr_ecc-556.sh +++ b/tests/bufr_ecc-556.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_ecc-604.sh b/tests/bufr_ecc-604.sh index 7bd6200ee..3d0772dd3 100755 --- a/tests/bufr_ecc-604.sh +++ b/tests/bufr_ecc-604.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2018 ECMWF. +# (C) Copyright 2005-2018 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. diff --git a/tests/bufr_ecc-616.sh b/tests/bufr_ecc-616.sh index 8aabba9f1..f8bdb22ad 100755 --- a/tests/bufr_ecc-616.sh +++ b/tests/bufr_ecc-616.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_ecc-673.sh b/tests/bufr_ecc-673.sh index ecb49511e..2a53c707e 100755 --- a/tests/bufr_ecc-673.sh +++ b/tests/bufr_ecc-673.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_ecc-686.sh b/tests/bufr_ecc-686.sh index 072a3b730..48dba8955 100755 --- a/tests/bufr_ecc-686.sh +++ b/tests/bufr_ecc-686.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_ecc-690.sh b/tests/bufr_ecc-690.sh index 0b1d3959b..582bb84e4 100755 --- a/tests/bufr_ecc-690.sh +++ b/tests/bufr_ecc-690.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_ecc-750.sh b/tests/bufr_ecc-750.sh index 5b84f4788..892400f8a 100755 --- a/tests/bufr_ecc-750.sh +++ b/tests/bufr_ecc-750.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_ecc-765.sh b/tests/bufr_ecc-765.sh index c2bc081c2..32780309f 100755 --- a/tests/bufr_ecc-765.sh +++ b/tests/bufr_ecc-765.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_ecc-875.sh b/tests/bufr_ecc-875.sh index 1f5120039..ddea6ba13 100755 --- a/tests/bufr_ecc-875.sh +++ b/tests/bufr_ecc-875.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_ecc-887.sh b/tests/bufr_ecc-887.sh index 6e2221dec..49e6711bf 100755 --- a/tests/bufr_ecc-887.sh +++ b/tests/bufr_ecc-887.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_extract_headers.c b/tests/bufr_extract_headers.c index 2d664b92e..84a6ac913 100644 --- a/tests/bufr_extract_headers.c +++ b/tests/bufr_extract_headers.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/bufr_extract_headers.sh b/tests/bufr_extract_headers.sh index 3bd9b5506..9de31dd8a 100755 --- a/tests/bufr_extract_headers.sh +++ b/tests/bufr_extract_headers.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_filter.sh b/tests/bufr_filter.sh index 40ad99af6..3a37adfd9 100755 --- a/tests/bufr_filter.sh +++ b/tests/bufr_filter.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_filter_extract_area.sh b/tests/bufr_filter_extract_area.sh index e47824b8e..426cc65c9 100755 --- a/tests/bufr_filter_extract_area.sh +++ b/tests/bufr_filter_extract_area.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_filter_extract_datetime.sh b/tests/bufr_filter_extract_datetime.sh index c214e5d0e..efa373171 100755 --- a/tests/bufr_filter_extract_datetime.sh +++ b/tests/bufr_filter_extract_datetime.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_get.sh b/tests/bufr_get.sh index 237e9321d..f91d5bcdb 100755 --- a/tests/bufr_get.sh +++ b/tests/bufr_get.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_get_element.c b/tests/bufr_get_element.c index a91410259..3120bc205 100644 --- a/tests/bufr_get_element.c +++ b/tests/bufr_get_element.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/bufr_get_element.sh b/tests/bufr_get_element.sh index ea20e69b7..d321e60ab 100755 --- a/tests/bufr_get_element.sh +++ b/tests/bufr_get_element.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_json_data.sh b/tests/bufr_json_data.sh index 8c6b8cb86..86392ffb7 100755 --- a/tests/bufr_json_data.sh +++ b/tests/bufr_json_data.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_json_samples.sh b/tests/bufr_json_samples.sh index e9cd9adcf..c7a9d47e3 100755 --- a/tests/bufr_json_samples.sh +++ b/tests/bufr_json_samples.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_keys_iter.c b/tests/bufr_keys_iter.c index 039a292c3..824718dab 100644 --- a/tests/bufr_keys_iter.c +++ b/tests/bufr_keys_iter.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/bufr_keys_iter.sh b/tests/bufr_keys_iter.sh index 7a6a4a2e1..665d253eb 100755 --- a/tests/bufr_keys_iter.sh +++ b/tests/bufr_keys_iter.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_ls.sh b/tests/bufr_ls.sh index a596f0a01..8a280b97c 100755 --- a/tests/bufr_ls.sh +++ b/tests/bufr_ls.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_ls_json.sh b/tests/bufr_ls_json.sh index 5c57d4492..01e282587 100755 --- a/tests/bufr_ls_json.sh +++ b/tests/bufr_ls_json.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_rdbSubTypes.sh b/tests/bufr_rdbSubTypes.sh index aad772768..410391342 100755 --- a/tests/bufr_rdbSubTypes.sh +++ b/tests/bufr_rdbSubTypes.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_set.sh b/tests/bufr_set.sh index 6e66c310c..79f62ef62 100755 --- a/tests/bufr_set.sh +++ b/tests/bufr_set.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_split_by_rdbSubtype.sh b/tests/bufr_split_by_rdbSubtype.sh index 33b85bb87..8e6eefc99 100755 --- a/tests/bufr_split_by_rdbSubtype.sh +++ b/tests/bufr_split_by_rdbSubtype.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_wmo_tables.sh b/tests/bufr_wmo_tables.sh index 531ec8de9..b8803609f 100755 --- a/tests/bufr_wmo_tables.sh +++ b/tests/bufr_wmo_tables.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufrdc_desc_ref.sh b/tests/bufrdc_desc_ref.sh index 49c32ae5e..e927f87df 100755 --- a/tests/bufrdc_desc_ref.sh +++ b/tests/bufrdc_desc_ref.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufrdc_ref.sh b/tests/bufrdc_ref.sh index c73e39cc2..4a0b0a653 100755 --- a/tests/bufrdc_ref.sh +++ b/tests/bufrdc_ref.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/codes_split_file.sh b/tests/codes_split_file.sh index 0698c3218..019ee6288 100755 --- a/tests/codes_split_file.sh +++ b/tests/codes_split_file.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/decode.c b/tests/decode.c index 595f677a0..79d41a0c3 100755 --- a/tests/decode.c +++ b/tests/decode.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/definitions.sh b/tests/definitions.sh index 2f693889e..e3b5461e7 100755 --- a/tests/definitions.sh +++ b/tests/definitions.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/diag.sh b/tests/diag.sh index 41509629f..61bdd47d1 100755 --- a/tests/diag.sh +++ b/tests/diag.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/fortran_interface.sh b/tests/fortran_interface.sh index 9664cf514..4ecf859bb 100755 --- a/tests/fortran_interface.sh +++ b/tests/fortran_interface.sh @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/gauss_sub.c b/tests/gauss_sub.c index 12d64f6ac..adb870cb2 100644 --- a/tests/gauss_sub.c +++ b/tests/gauss_sub.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/get_fail.sh b/tests/get_fail.sh index 68b145078..b93f96a40 100755 --- a/tests/get_fail.sh +++ b/tests/get_fail.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib1to2.sh b/tests/grib1to2.sh index 5f8b6e593..8660683df 100755 --- a/tests/grib1to2.sh +++ b/tests/grib1to2.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib1to3.sh b/tests/grib1to3.sh index 6bd86180a..ed98cb48e 100755 --- a/tests/grib1to3.sh +++ b/tests/grib1to3.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib2to1.sh b/tests/grib2to1.sh index 351011961..44f1761bb 100755 --- a/tests/grib2to1.sh +++ b/tests/grib2to1.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib2to3.sh b/tests/grib2to3.sh index 2337234b7..f69e1a504 100755 --- a/tests/grib2to3.sh +++ b/tests/grib2to3.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib3_templates.sh b/tests/grib3_templates.sh index 588f77e21..fe61bfdf8 100755 --- a/tests/grib3_templates.sh +++ b/tests/grib3_templates.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_2nd_order_numValues.c b/tests/grib_2nd_order_numValues.c index c9676fc44..b35e1a5a5 100644 --- a/tests/grib_2nd_order_numValues.c +++ b/tests/grib_2nd_order_numValues.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/grib_2nd_order_numValues.sh b/tests/grib_2nd_order_numValues.sh index 9da9c3042..21770974d 100755 --- a/tests/grib_2nd_order_numValues.sh +++ b/tests/grib_2nd_order_numValues.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_bitmap.sh b/tests/grib_bitmap.sh index 991cc8dcb..1b504d573 100755 --- a/tests/grib_bitmap.sh +++ b/tests/grib_bitmap.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_bitsPerValue.sh b/tests/grib_bitsPerValue.sh index 0d9bc7328..10b32f835 100755 --- a/tests/grib_bitsPerValue.sh +++ b/tests/grib_bitsPerValue.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_calendar.sh b/tests/grib_calendar.sh index 0a72b0442..ceebeb2ac 100755 --- a/tests/grib_calendar.sh +++ b/tests/grib_calendar.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_ccsds.sh b/tests/grib_ccsds.sh index 8a1b27a29..c2c3263f3 100755 --- a/tests/grib_ccsds.sh +++ b/tests/grib_ccsds.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_ccsds_perf.c b/tests/grib_ccsds_perf.c index 12e0001b4..d8f5c1a53 100644 --- a/tests/grib_ccsds_perf.c +++ b/tests/grib_ccsds_perf.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/grib_change_scanning.sh b/tests/grib_change_scanning.sh index a43690585..cce8391c7 100755 --- a/tests/grib_change_scanning.sh +++ b/tests/grib_change_scanning.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_check_gaussian_grids.sh b/tests/grib_check_gaussian_grids.sh index 4ba61982e..ca080012f 100755 --- a/tests/grib_check_gaussian_grids.sh +++ b/tests/grib_check_gaussian_grids.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_check_param_concepts.sh b/tests/grib_check_param_concepts.sh index 7f4a8906c..e781c2827 100755 --- a/tests/grib_check_param_concepts.sh +++ b/tests/grib_check_param_concepts.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_compare.sh b/tests/grib_compare.sh index 9abebf2bb..f83d0501b 100755 --- a/tests/grib_compare.sh +++ b/tests/grib_compare.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_complex.sh b/tests/grib_complex.sh index a67d26f70..5d451da2a 100755 --- a/tests/grib_complex.sh +++ b/tests/grib_complex.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_concept.sh b/tests/grib_concept.sh index 3d40b434d..5de54de26 100755 --- a/tests/grib_concept.sh +++ b/tests/grib_concept.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_copy.sh b/tests/grib_copy.sh index b7414e741..b01511fd7 100755 --- a/tests/grib_copy.sh +++ b/tests/grib_copy.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_data_quality_checks.sh b/tests/grib_data_quality_checks.sh index f90de6f93..0237f53f2 100755 --- a/tests/grib_data_quality_checks.sh +++ b/tests/grib_data_quality_checks.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. @@ -143,4 +143,4 @@ ${tools_dir}/grib_set -s scaleValuesBy=100 $input1 $tempOut # Clean up rm -rf $tempDir -rm -f $tempOut $tempErr +rm -f $tempOut $tempErr $tempGrib1 $tempGrib2 diff --git a/tests/grib_decimalPrecision.sh b/tests/grib_decimalPrecision.sh index 2ffe29e4a..ff6c91e91 100755 --- a/tests/grib_decimalPrecision.sh +++ b/tests/grib_decimalPrecision.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_double_cmp.c b/tests/grib_double_cmp.c index 94c77b025..367ba67f0 100644 --- a/tests/grib_double_cmp.c +++ b/tests/grib_double_cmp.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/grib_double_cmp.sh b/tests/grib_double_cmp.sh index d36dcb0b3..4f78f6103 100755 --- a/tests/grib_double_cmp.sh +++ b/tests/grib_double_cmp.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_dump.sh b/tests/grib_dump.sh index 2bc7b640b..6ef2994c1 100755 --- a/tests/grib_dump.sh +++ b/tests/grib_dump.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_dump_debug.sh b/tests/grib_dump_debug.sh index e59a7ba98..13d6bb015 100755 --- a/tests/grib_dump_debug.sh +++ b/tests/grib_dump_debug.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_dump_json.sh b/tests/grib_dump_json.sh index e02b760f1..92a473d5f 100755 --- a/tests/grib_dump_json.sh +++ b/tests/grib_dump_json.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_ecc-1000.sh b/tests/grib_ecc-1000.sh index 23c977e81..0c2257205 100755 --- a/tests/grib_ecc-1000.sh +++ b/tests/grib_ecc-1000.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_ecc-1001.sh b/tests/grib_ecc-1001.sh index d5402ab45..3b9a87fbf 100755 --- a/tests/grib_ecc-1001.sh +++ b/tests/grib_ecc-1001.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_ecc-1030.sh b/tests/grib_ecc-1030.sh index 96a102110..63eb6caa6 100755 --- a/tests/grib_ecc-1030.sh +++ b/tests/grib_ecc-1030.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_ecc-1065.sh b/tests/grib_ecc-1065.sh index de3557f56..8a5a786f0 100755 --- a/tests/grib_ecc-1065.sh +++ b/tests/grib_ecc-1065.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_ecc-136.sh b/tests/grib_ecc-136.sh index 57f648594..afcff109b 100755 --- a/tests/grib_ecc-136.sh +++ b/tests/grib_ecc-136.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_ecc-386.c b/tests/grib_ecc-386.c index 0f4908faa..0bcb41513 100644 --- a/tests/grib_ecc-386.c +++ b/tests/grib_ecc-386.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/grib_ecc-386.sh b/tests/grib_ecc-386.sh index 06653afc2..fb0ad21b0 100755 --- a/tests/grib_ecc-386.sh +++ b/tests/grib_ecc-386.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_ecc-490.sh b/tests/grib_ecc-490.sh index b2b9d05e3..d8b8c44bd 100755 --- a/tests/grib_ecc-490.sh +++ b/tests/grib_ecc-490.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_ecc-600.sh b/tests/grib_ecc-600.sh index e919704d2..7fdd32b89 100755 --- a/tests/grib_ecc-600.sh +++ b/tests/grib_ecc-600.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_ecc-604.sh b/tests/grib_ecc-604.sh index ad87d8695..94bcd5c3d 100755 --- a/tests/grib_ecc-604.sh +++ b/tests/grib_ecc-604.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2018 ECMWF. +# (C) Copyright 2005-2018 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. diff --git a/tests/grib_ecc-756.sh b/tests/grib_ecc-756.sh index 6276c7946..ae99438e8 100755 --- a/tests/grib_ecc-756.sh +++ b/tests/grib_ecc-756.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_ecc-873.sh b/tests/grib_ecc-873.sh index bc7c73693..5e52a89c8 100755 --- a/tests/grib_ecc-873.sh +++ b/tests/grib_ecc-873.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_ecc-923.sh b/tests/grib_ecc-923.sh index 036b2f636..0007057b1 100755 --- a/tests/grib_ecc-923.sh +++ b/tests/grib_ecc-923.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_ecc-967.sh b/tests/grib_ecc-967.sh index bccf1327c..dd0af82b0 100755 --- a/tests/grib_ecc-967.sh +++ b/tests/grib_ecc-967.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_ecc-979.sh b/tests/grib_ecc-979.sh index 4ebd98b73..0e987ca3c 100755 --- a/tests/grib_ecc-979.sh +++ b/tests/grib_ecc-979.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_ecc-984.sh b/tests/grib_ecc-984.sh index 848455e39..bf846f20f 100755 --- a/tests/grib_ecc-984.sh +++ b/tests/grib_ecc-984.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_efas.sh b/tests/grib_efas.sh index 2c2584d40..f1ef8452b 100755 --- a/tests/grib_efas.sh +++ b/tests/grib_efas.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_encode_pthreads.c b/tests/grib_encode_pthreads.c index 8099878dc..c3c1234d5 100644 --- a/tests/grib_encode_pthreads.c +++ b/tests/grib_encode_pthreads.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/grib_encode_pthreads.sh b/tests/grib_encode_pthreads.sh index 5c7479091..4382bacb0 100755 --- a/tests/grib_encode_pthreads.sh +++ b/tests/grib_encode_pthreads.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_filter.sh b/tests/grib_filter.sh index 7cacb7bba..90edda9ae 100755 --- a/tests/grib_filter.sh +++ b/tests/grib_filter.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_global.sh b/tests/grib_global.sh index 1ca22d351..c0335c811 100755 --- a/tests/grib_global.sh +++ b/tests/grib_global.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_gridType.sh b/tests/grib_gridType.sh index 35e20264d..a3db507a1 100755 --- a/tests/grib_gridType.sh +++ b/tests/grib_gridType.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_iterator.sh b/tests/grib_iterator.sh index 6350595b5..40ae22ccb 100755 --- a/tests/grib_iterator.sh +++ b/tests/grib_iterator.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_jpeg.sh b/tests/grib_jpeg.sh index e038c408b..3b8a648fb 100755 --- a/tests/grib_jpeg.sh +++ b/tests/grib_jpeg.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_lam_bf.sh b/tests/grib_lam_bf.sh index 59b1ec187..333bd7e42 100755 --- a/tests/grib_lam_bf.sh +++ b/tests/grib_lam_bf.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2018 ECMWF. +# (C) Copyright 2005-2018 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. diff --git a/tests/grib_lam_gp.sh b/tests/grib_lam_gp.sh index 196be16ea..b36734bf0 100755 --- a/tests/grib_lam_gp.sh +++ b/tests/grib_lam_gp.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2018 ECMWF. +# (C) Copyright 2005-2018 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. diff --git a/tests/grib_lamb_az_eq_area.sh b/tests/grib_lamb_az_eq_area.sh index 2c12a64a4..0f7c753ec 100755 --- a/tests/grib_lamb_az_eq_area.sh +++ b/tests/grib_lamb_az_eq_area.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_level.sh b/tests/grib_level.sh index 055ee698f..2a6b81efe 100755 --- a/tests/grib_level.sh +++ b/tests/grib_level.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_list.sh b/tests/grib_list.sh index 9ab15c1f7..83c62efb3 100755 --- a/tests/grib_list.sh +++ b/tests/grib_list.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_local.sh b/tests/grib_local.sh index c130e8975..5e25583de 100755 --- a/tests/grib_local.sh +++ b/tests/grib_local.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_local_MeteoFrance.c b/tests/grib_local_MeteoFrance.c index be5843da3..35a619082 100644 --- a/tests/grib_local_MeteoFrance.c +++ b/tests/grib_local_MeteoFrance.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/grib_local_MeteoFrance.sh b/tests/grib_local_MeteoFrance.sh index c7f6405d0..c8242eb10 100755 --- a/tests/grib_local_MeteoFrance.sh +++ b/tests/grib_local_MeteoFrance.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_ls.sh b/tests/grib_ls.sh index 7cbdff77e..8c97e17af 100755 --- a/tests/grib_ls.sh +++ b/tests/grib_ls.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_ls_json.sh b/tests/grib_ls_json.sh index 393bcaeaf..3cf6a4d46 100755 --- a/tests/grib_ls_json.sh +++ b/tests/grib_ls_json.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_mars_types.sh b/tests/grib_mars_types.sh index 2ae3c5b81..b32627370 100755 --- a/tests/grib_mars_types.sh +++ b/tests/grib_mars_types.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_missing.sh b/tests/grib_missing.sh index 524d20d84..c0d74eab8 100755 --- a/tests/grib_missing.sh +++ b/tests/grib_missing.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_multi.sh b/tests/grib_multi.sh index 82529fc43..4e635e56a 100755 --- a/tests/grib_multi.sh +++ b/tests/grib_multi.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_multi_from_message.c b/tests/grib_multi_from_message.c index 8eed585ac..c81415e7c 100644 --- a/tests/grib_multi_from_message.c +++ b/tests/grib_multi_from_message.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/grib_multi_from_message.sh b/tests/grib_multi_from_message.sh index 263886083..4d0c61f6a 100755 --- a/tests/grib_multi_from_message.sh +++ b/tests/grib_multi_from_message.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_nearest_test.c b/tests/grib_nearest_test.c index acb82fea1..ac52f0c4c 100644 --- a/tests/grib_nearest_test.c +++ b/tests/grib_nearest_test.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/grib_nearest_test.sh b/tests/grib_nearest_test.sh index 758482048..57381e1b2 100755 --- a/tests/grib_nearest_test.sh +++ b/tests/grib_nearest_test.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_neg_fctime.sh b/tests/grib_neg_fctime.sh index 675eb6d3a..b592bb49a 100755 --- a/tests/grib_neg_fctime.sh +++ b/tests/grib_neg_fctime.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_octahedral.sh b/tests/grib_octahedral.sh index 045b3553b..11d313bfe 100755 --- a/tests/grib_octahedral.sh +++ b/tests/grib_octahedral.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_optimize_scaling.c b/tests/grib_optimize_scaling.c index c34c62c09..40f83ca8c 100644 --- a/tests/grib_optimize_scaling.c +++ b/tests/grib_optimize_scaling.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/grib_optimize_scaling.sh b/tests/grib_optimize_scaling.sh index d7a956d5a..10b7e3d46 100755 --- a/tests/grib_optimize_scaling.sh +++ b/tests/grib_optimize_scaling.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_optimize_scaling_sh.c b/tests/grib_optimize_scaling_sh.c index cb4c5d68e..1536942cd 100644 --- a/tests/grib_optimize_scaling_sh.c +++ b/tests/grib_optimize_scaling_sh.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/grib_optimize_scaling_sh.sh b/tests/grib_optimize_scaling_sh.sh index 75e1b309e..7d7787cd9 100755 --- a/tests/grib_optimize_scaling_sh.sh +++ b/tests/grib_optimize_scaling_sh.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_padding.sh b/tests/grib_padding.sh index eb9634900..ccbcb952a 100755 --- a/tests/grib_padding.sh +++ b/tests/grib_padding.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_png.sh b/tests/grib_png.sh index 4cb26af50..3babf0dc4 100755 --- a/tests/grib_png.sh +++ b/tests/grib_png.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_second_order.sh b/tests/grib_second_order.sh index 668f54672..352b6f177 100755 --- a/tests/grib_second_order.sh +++ b/tests/grib_second_order.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_set.sh b/tests/grib_set.sh index 1c5291b63..31e945110 100755 --- a/tests/grib_set.sh +++ b/tests/grib_set.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_sh_ieee64.c b/tests/grib_sh_ieee64.c index 3d4b286e5..84fad6a93 100644 --- a/tests/grib_sh_ieee64.c +++ b/tests/grib_sh_ieee64.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/grib_sh_ieee64.sh b/tests/grib_sh_ieee64.sh index 43d2b4bb5..9c91cc617 100755 --- a/tests/grib_sh_ieee64.sh +++ b/tests/grib_sh_ieee64.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_sh_imag.c b/tests/grib_sh_imag.c index b306b0d11..400cad4d2 100644 --- a/tests/grib_sh_imag.c +++ b/tests/grib_sh_imag.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/grib_sh_imag.sh b/tests/grib_sh_imag.sh index 09d4fb471..985391b58 100755 --- a/tests/grib_sh_imag.sh +++ b/tests/grib_sh_imag.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_statistics.sh b/tests/grib_statistics.sh index 090732c2b..7f664cbf2 100755 --- a/tests/grib_statistics.sh +++ b/tests/grib_statistics.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_step.sh b/tests/grib_step.sh index 8ec8e4060..5882c6112 100755 --- a/tests/grib_step.sh +++ b/tests/grib_step.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_tigge.sh b/tests/grib_tigge.sh index 7a9954601..4017a855e 100755 --- a/tests/grib_tigge.sh +++ b/tests/grib_tigge.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_tigge_conversions.sh b/tests/grib_tigge_conversions.sh index 6b3b2aa46..6e8519363 100755 --- a/tests/grib_tigge_conversions.sh +++ b/tests/grib_tigge_conversions.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_to_netcdf.sh b/tests/grib_to_netcdf.sh index 687373027..fbd1c210e 100755 --- a/tests/grib_to_netcdf.sh +++ b/tests/grib_to_netcdf.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_uerra.sh b/tests/grib_uerra.sh index d89bda96a..bdc0664cb 100755 --- a/tests/grib_uerra.sh +++ b/tests/grib_uerra.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_util_set_spec.c b/tests/grib_util_set_spec.c index 3e227a2c8..5a4862da9 100644 --- a/tests/grib_util_set_spec.c +++ b/tests/grib_util_set_spec.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/grib_util_set_spec.sh b/tests/grib_util_set_spec.sh index fab74df00..7bab5ab08 100755 --- a/tests/grib_util_set_spec.sh +++ b/tests/grib_util_set_spec.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/gribex_perf.c b/tests/gribex_perf.c index ce2125ec8..53d6e8199 100644 --- a/tests/gribex_perf.c +++ b/tests/gribex_perf.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/gts_compare.sh b/tests/gts_compare.sh index 79ea8f3e4..21469c056 100755 --- a/tests/gts_compare.sh +++ b/tests/gts_compare.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/gts_count.sh b/tests/gts_count.sh index e202abaa5..89b4c854c 100755 --- a/tests/gts_count.sh +++ b/tests/gts_count.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/gts_get.sh b/tests/gts_get.sh index 7fde60b28..b1439d7dd 100755 --- a/tests/gts_get.sh +++ b/tests/gts_get.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/gts_ls.sh b/tests/gts_ls.sh index 83f85edc2..ec80c3d34 100755 --- a/tests/gts_ls.sh +++ b/tests/gts_ls.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/ibm.c b/tests/ibm.c index 0c43b3a40..aa7a4f66f 100755 --- a/tests/ibm.c +++ b/tests/ibm.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/ieee.c b/tests/ieee.c index 6101d2a21..14089c79b 100755 --- a/tests/ieee.c +++ b/tests/ieee.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/ieee.sh b/tests/ieee.sh index 12fe93179..6006a3e4e 100755 --- a/tests/ieee.sh +++ b/tests/ieee.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/include.sh b/tests/include.sh index 4cc46453f..29634bbc6 100644 --- a/tests/include.sh +++ b/tests/include.sh @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/index.c b/tests/index.c index ca551d0a7..8b4c81a50 100644 --- a/tests/index.c +++ b/tests/index.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/index.sh b/tests/index.sh index 7a780ad3f..4851d3345 100755 --- a/tests/index.sh +++ b/tests/index.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/index_orderby.c b/tests/index_orderby.c index a114a5ad9..16163a88a 100644 --- a/tests/index_orderby.c +++ b/tests/index_orderby.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/jpeg_perf.c b/tests/jpeg_perf.c index b2fcf038d..1d36f6572 100644 --- a/tests/jpeg_perf.c +++ b/tests/jpeg_perf.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/julian.c b/tests/julian.c index 175d1ef4c..c91c4f8f4 100644 --- a/tests/julian.c +++ b/tests/julian.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/julian.sh b/tests/julian.sh index 065f6e48f..01876c96d 100755 --- a/tests/julian.sh +++ b/tests/julian.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/laplacian.c b/tests/laplacian.c index ac47b41b5..43b70881f 100644 --- a/tests/laplacian.c +++ b/tests/laplacian.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/largefile.c b/tests/largefile.c index 97bb5faa6..8aff7521c 100644 --- a/tests/largefile.c +++ b/tests/largefile.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/list_all_keys.ksh b/tests/list_all_keys.ksh index 9b94f5a53..40c768323 100755 --- a/tests/list_all_keys.ksh +++ b/tests/list_all_keys.ksh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/metar_compare.sh b/tests/metar_compare.sh index fece81678..499fd8195 100755 --- a/tests/metar_compare.sh +++ b/tests/metar_compare.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/metar_dump.sh b/tests/metar_dump.sh index 8217a3a20..c16fef468 100755 --- a/tests/metar_dump.sh +++ b/tests/metar_dump.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/metar_get.sh b/tests/metar_get.sh index f94eb1fe3..b5d92c6fd 100755 --- a/tests/metar_get.sh +++ b/tests/metar_get.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/metar_ls.sh b/tests/metar_ls.sh index 8704d2448..3a5992638 100755 --- a/tests/metar_ls.sh +++ b/tests/metar_ls.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/mybufrdc_ref.sh b/tests/mybufrdc_ref.sh index eeb3312b3..9e7f18abb 100755 --- a/tests/mybufrdc_ref.sh +++ b/tests/mybufrdc_ref.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/pack_unpack.c b/tests/pack_unpack.c index f8b353487..63f223961 100644 --- a/tests/pack_unpack.c +++ b/tests/pack_unpack.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/packing.c b/tests/packing.c index 66d0f5824..c568c4576 100644 --- a/tests/packing.c +++ b/tests/packing.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/packing_check.c b/tests/packing_check.c index 64a6e041f..7a98d30f4 100644 --- a/tests/packing_check.c +++ b/tests/packing_check.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/png_perf.c b/tests/png_perf.c index 9dd552f34..34492e0f7 100644 --- a/tests/png_perf.c +++ b/tests/png_perf.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/read_any.c b/tests/read_any.c index 5e40fc26e..e1c931f9c 100644 --- a/tests/read_any.c +++ b/tests/read_any.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/read_any.sh b/tests/read_any.sh index 413a50e49..c6a278a60 100755 --- a/tests/read_any.sh +++ b/tests/read_any.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/read_index.c b/tests/read_index.c index 7249beb65..41f3343b1 100644 --- a/tests/read_index.c +++ b/tests/read_index.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/so_perf.c b/tests/so_perf.c index 1b94815b5..d985471b1 100644 --- a/tests/so_perf.c +++ b/tests/so_perf.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/timing.c b/tests/timing.c index 3b51633eb..ae3e5f1da 100644 --- a/tests/timing.c +++ b/tests/timing.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/tiny.sh b/tests/tiny.sh index 8e70ab1f3..4bac5063e 100755 --- a/tests/tiny.sh +++ b/tests/tiny.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/tools_data_from_stdin.sh b/tests/tools_data_from_stdin.sh index 85cfb4e21..3aea28d2f 100755 --- a/tests/tools_data_from_stdin.sh +++ b/tests/tools_data_from_stdin.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/unit_tests.c b/tests/unit_tests.c index 1da84d60d..9836ff557 100644 --- a/tests/unit_tests.c +++ b/tests/unit_tests.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tests/unit_tests.sh b/tests/unit_tests.sh index 6d8ef611d..dbae5254e 100755 --- a/tests/unit_tests.sh +++ b/tests/unit_tests.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/utils.sh b/tests/utils.sh index ec613381e..93f0b4348 100644 --- a/tests/utils.sh +++ b/tests/utils.sh @@ -1,4 +1,4 @@ -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/values_to_ascii.c b/tests/values_to_ascii.c index 8ead8e8da..bb3b0066c 100755 --- a/tests/values_to_ascii.c +++ b/tests/values_to_ascii.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tigge/jma.pl b/tigge/jma.pl index 2a673c393..f8e813207 100755 --- a/tigge/jma.pl +++ b/tigge/jma.pl @@ -1,5 +1,5 @@ #!/usr/bin/perl -I../perl/GRIB-API/blib/lib -I../perl/GRIB-API/blib/arch -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tigge/tigge_accumulations.c b/tigge/tigge_accumulations.c index faa642292..a8d4180f9 100755 --- a/tigge/tigge_accumulations.c +++ b/tigge/tigge_accumulations.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tigge/tigge_check.c b/tigge/tigge_check.c index 14b0255e3..9d718c1eb 100755 --- a/tigge/tigge_check.c +++ b/tigge/tigge_check.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tigge/tigge_check.h b/tigge/tigge_check.h index 2f9b0fe48..3f5517ab1 100644 --- a/tigge/tigge_check.h +++ b/tigge/tigge_check.h @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tigge/tigge_name.c b/tigge/tigge_name.c index f81968910..44bc58430 100755 --- a/tigge/tigge_name.c +++ b/tigge/tigge_name.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tigge/tigge_split.c b/tigge/tigge_split.c index cbfcc04e7..8900962c3 100755 --- a/tigge/tigge_split.c +++ b/tigge/tigge_split.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tigge/tigge_tools.c b/tigge/tigge_tools.c index 0bad072dd..237d2b1ae 100644 --- a/tigge/tigge_tools.c +++ b/tigge/tigge_tools.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tigge/tigge_tools.h b/tigge/tigge_tools.h index fd22c679f..272383ca3 100644 --- a/tigge/tigge_tools.h +++ b/tigge/tigge_tools.h @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 68a029ac1..19591c749 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright 2005-2019 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tools/big2gribex.c b/tools/big2gribex.c index ceb32d98a..059ad6988 100644 --- a/tools/big2gribex.c +++ b/tools/big2gribex.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/bufr_3to4.c b/tools/bufr_3to4.c index 3168e610f..e85c42c1f 100644 --- a/tools/bufr_3to4.c +++ b/tools/bufr_3to4.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/bufr_compare.c b/tools/bufr_compare.c index 706169755..2f5e5b572 100644 --- a/tools/bufr_compare.c +++ b/tools/bufr_compare.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/bufr_copy.c b/tools/bufr_copy.c index 2926e8716..56edaa81a 100644 --- a/tools/bufr_copy.c +++ b/tools/bufr_copy.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/bufr_dump.c b/tools/bufr_dump.c index 54c16f819..abd14fa00 100644 --- a/tools/bufr_dump.c +++ b/tools/bufr_dump.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/bufr_filter.c b/tools/bufr_filter.c index b659ee895..37db191d8 100644 --- a/tools/bufr_filter.c +++ b/tools/bufr_filter.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/bufr_get.c b/tools/bufr_get.c index d393785bd..8e35a819d 100644 --- a/tools/bufr_get.c +++ b/tools/bufr_get.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/bufr_index_build.c b/tools/bufr_index_build.c index 835efaa32..119727330 100644 --- a/tools/bufr_index_build.c +++ b/tools/bufr_index_build.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/bufr_ls.c b/tools/bufr_ls.c index 8b685caf8..eb09335f2 100644 --- a/tools/bufr_ls.c +++ b/tools/bufr_ls.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/bufr_set.c b/tools/bufr_set.c index 04d57f596..828b5fda3 100644 --- a/tools/bufr_set.c +++ b/tools/bufr_set.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/bufr_split_by_rdbSubtype.c b/tools/bufr_split_by_rdbSubtype.c index ffcb4c79c..a4486f566 100644 --- a/tools/bufr_split_by_rdbSubtype.c +++ b/tools/bufr_split_by_rdbSubtype.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/codes_count.c b/tools/codes_count.c index 24a423030..dbcae607c 100644 --- a/tools/codes_count.c +++ b/tools/codes_count.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/codes_info.c b/tools/codes_info.c index d6933bbb8..cc47c9980 100644 --- a/tools/codes_info.c +++ b/tools/codes_info.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/codes_parser.c b/tools/codes_parser.c index 92dca5711..465f8a271 100644 --- a/tools/codes_parser.c +++ b/tools/codes_parser.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/codes_split_file.c b/tools/codes_split_file.c index fc52df8d4..568dfcd89 100644 --- a/tools/codes_split_file.c +++ b/tools/codes_split_file.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/compile.c b/tools/compile.c index 2a65fd010..4559cebd4 100644 --- a/tools/compile.c +++ b/tools/compile.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/deprecated/all_keys.c b/tools/deprecated/all_keys.c index 4f8c16569..137316228 100755 --- a/tools/deprecated/all_keys.c +++ b/tools/deprecated/all_keys.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/deprecated/dump.c b/tools/deprecated/dump.c index 669866fed..d42910043 100644 --- a/tools/deprecated/dump.c +++ b/tools/deprecated/dump.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/deprecated/dumpload.c b/tools/deprecated/dumpload.c index bb7ce5660..cae050173 100644 --- a/tools/deprecated/dumpload.c +++ b/tools/deprecated/dumpload.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/deprecated/grib_add.c b/tools/deprecated/grib_add.c index c70989432..fbecba990 100644 --- a/tools/deprecated/grib_add.c +++ b/tools/deprecated/grib_add.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/deprecated/grib_cmp.c b/tools/deprecated/grib_cmp.c index d07e5a469..ffc937af2 100644 --- a/tools/deprecated/grib_cmp.c +++ b/tools/deprecated/grib_cmp.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/deprecated/grib_convert.c b/tools/deprecated/grib_convert.c index 9910f573b..68f1fd80c 100644 --- a/tools/deprecated/grib_convert.c +++ b/tools/deprecated/grib_convert.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/deprecated/grib_corruption_check.c b/tools/deprecated/grib_corruption_check.c index 8cac650aa..cee0ac72b 100644 --- a/tools/deprecated/grib_corruption_check.c +++ b/tools/deprecated/grib_corruption_check.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/deprecated/grib_debug.c b/tools/deprecated/grib_debug.c index 05ff79d8c..bd0af3057 100644 --- a/tools/deprecated/grib_debug.c +++ b/tools/deprecated/grib_debug.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/deprecated/grib_diff.c b/tools/deprecated/grib_diff.c index 07ebee022..17006506b 100644 --- a/tools/deprecated/grib_diff.c +++ b/tools/deprecated/grib_diff.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/deprecated/grib_distance.c b/tools/deprecated/grib_distance.c index fd74be2d7..7573928ac 100644 --- a/tools/deprecated/grib_distance.c +++ b/tools/deprecated/grib_distance.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/deprecated/grib_error.c b/tools/deprecated/grib_error.c index 2a65e33ff..14daa035c 100644 --- a/tools/deprecated/grib_error.c +++ b/tools/deprecated/grib_error.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/deprecated/grib_gen.c b/tools/deprecated/grib_gen.c index 7ace1e7b5..e87ebe151 100644 --- a/tools/deprecated/grib_gen.c +++ b/tools/deprecated/grib_gen.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/deprecated/grib_keys.c b/tools/deprecated/grib_keys.c index 3db4cf60b..d7b5e6482 100644 --- a/tools/deprecated/grib_keys.c +++ b/tools/deprecated/grib_keys.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/deprecated/grib_moments.c b/tools/deprecated/grib_moments.c index e8798af6e..80c7a5712 100644 --- a/tools/deprecated/grib_moments.c +++ b/tools/deprecated/grib_moments.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/deprecated/grib_packing.c b/tools/deprecated/grib_packing.c index b24b15eb1..2c3321ad0 100644 --- a/tools/deprecated/grib_packing.c +++ b/tools/deprecated/grib_packing.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/deprecated/grib_points.c b/tools/deprecated/grib_points.c index 9fc64b7b8..7e756df31 100644 --- a/tools/deprecated/grib_points.c +++ b/tools/deprecated/grib_points.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/gaussian.c b/tools/gaussian.c index 9647bbcfc..fe9fa9ddb 100644 --- a/tools/gaussian.c +++ b/tools/gaussian.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/gg_sub_area_check.c b/tools/gg_sub_area_check.c index c17f87c9a..c9a45005e 100644 --- a/tools/gg_sub_area_check.c +++ b/tools/gg_sub_area_check.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/grib2ppm.c b/tools/grib2ppm.c index f3190a4fa..0a20a72d4 100644 --- a/tools/grib2ppm.c +++ b/tools/grib2ppm.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/grib_2_request.c b/tools/grib_2_request.c index 1fc32afa2..81cbc10aa 100644 --- a/tools/grib_2_request.c +++ b/tools/grib_2_request.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/grib_check_gaussian_grid.c b/tools/grib_check_gaussian_grid.c index abcbdf60a..0fa14343c 100644 --- a/tools/grib_check_gaussian_grid.c +++ b/tools/grib_check_gaussian_grid.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/grib_compare.c b/tools/grib_compare.c index 2398eda76..dfefcdda0 100644 --- a/tools/grib_compare.c +++ b/tools/grib_compare.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/grib_copy.c b/tools/grib_copy.c index ef4d4fc3c..ebed96068 100644 --- a/tools/grib_copy.c +++ b/tools/grib_copy.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/grib_dump.c b/tools/grib_dump.c index 7182377cd..9541e8908 100644 --- a/tools/grib_dump.c +++ b/tools/grib_dump.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/grib_filter.c b/tools/grib_filter.c index 3a7c1a038..839ab3795 100644 --- a/tools/grib_filter.c +++ b/tools/grib_filter.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/grib_filter.h b/tools/grib_filter.h index 96e860b28..d183eecb9 100644 --- a/tools/grib_filter.h +++ b/tools/grib_filter.h @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/grib_get.c b/tools/grib_get.c index 1c98f47fd..9926bd533 100644 --- a/tools/grib_get.c +++ b/tools/grib_get.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/grib_get_data.c b/tools/grib_get_data.c index 2699e951d..9a042d32b 100644 --- a/tools/grib_get_data.c +++ b/tools/grib_get_data.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/grib_histogram.c b/tools/grib_histogram.c index 070593234..bee3ca0f6 100644 --- a/tools/grib_histogram.c +++ b/tools/grib_histogram.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/grib_index_build.c b/tools/grib_index_build.c index 25a2d7d71..96ffc9e4b 100644 --- a/tools/grib_index_build.c +++ b/tools/grib_index_build.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/grib_ls.c b/tools/grib_ls.c index da9e2d5bf..f4fad0c11 100644 --- a/tools/grib_ls.c +++ b/tools/grib_ls.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/grib_merge.c b/tools/grib_merge.c index d4db61ccc..d97bf359d 100644 --- a/tools/grib_merge.c +++ b/tools/grib_merge.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/grib_nearest_land.c b/tools/grib_nearest_land.c index 12cd58185..bb6039b22 100644 --- a/tools/grib_nearest_land.c +++ b/tools/grib_nearest_land.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/grib_options.c b/tools/grib_options.c index 45208afd3..299b376a0 100644 --- a/tools/grib_options.c +++ b/tools/grib_options.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/grib_repair.c b/tools/grib_repair.c index 32c1050df..31228a094 100644 --- a/tools/grib_repair.c +++ b/tools/grib_repair.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/grib_set.c b/tools/grib_set.c index 243f03a3d..d2cd7c774 100644 --- a/tools/grib_set.c +++ b/tools/grib_set.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/grib_to_json.c b/tools/grib_to_json.c index dc70baeac..62f4e548e 100644 --- a/tools/grib_to_json.c +++ b/tools/grib_to_json.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/grib_to_netcdf.c b/tools/grib_to_netcdf.c index d2ccd49a0..06226c45e 100644 --- a/tools/grib_to_netcdf.c +++ b/tools/grib_to_netcdf.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/grib_tools.c b/tools/grib_tools.c index cf0b23ace..d063a49a3 100644 --- a/tools/grib_tools.c +++ b/tools/grib_tools.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/grib_tools.h b/tools/grib_tools.h index 8833183f8..8ec586e7e 100644 --- a/tools/grib_tools.h +++ b/tools/grib_tools.h @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/gts_compare.c b/tools/gts_compare.c index 689f81c14..70ef54e24 100644 --- a/tools/gts_compare.c +++ b/tools/gts_compare.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/gts_copy.c b/tools/gts_copy.c index 7bc7a8825..fdc870b9c 100644 --- a/tools/gts_copy.c +++ b/tools/gts_copy.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/gts_dump.c b/tools/gts_dump.c index d0c93b26d..eb8a02094 100644 --- a/tools/gts_dump.c +++ b/tools/gts_dump.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/gts_filter.c b/tools/gts_filter.c index a7091cbdc..8a4dd9537 100644 --- a/tools/gts_filter.c +++ b/tools/gts_filter.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/gts_get.c b/tools/gts_get.c index c17aa61a2..14f91c6a4 100644 --- a/tools/gts_get.c +++ b/tools/gts_get.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/gts_ls.c b/tools/gts_ls.c index d41af1d0d..04bba3595 100644 --- a/tools/gts_ls.c +++ b/tools/gts_ls.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/list_keys.c b/tools/list_keys.c index 321d0d706..773ef3c5f 100644 --- a/tools/list_keys.c +++ b/tools/list_keys.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/load.c b/tools/load.c index 6a6eb5ba4..d9fea088b 100644 --- a/tools/load.c +++ b/tools/load.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/load.h b/tools/load.h index d6aa84a8e..f241eb343 100644 --- a/tools/load.h +++ b/tools/load.h @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/mars_request.c b/tools/mars_request.c index aef14ee29..84b840655 100644 --- a/tools/mars_request.c +++ b/tools/mars_request.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/metar_compare.c b/tools/metar_compare.c index bf6da59ae..7f758c3ea 100644 --- a/tools/metar_compare.c +++ b/tools/metar_compare.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/metar_copy.c b/tools/metar_copy.c index cbbbb8e93..714a29337 100644 --- a/tools/metar_copy.c +++ b/tools/metar_copy.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/metar_dump.c b/tools/metar_dump.c index fba57681b..577068d7b 100644 --- a/tools/metar_dump.c +++ b/tools/metar_dump.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/metar_filter.c b/tools/metar_filter.c index cc96eed2a..97db49d4c 100644 --- a/tools/metar_filter.c +++ b/tools/metar_filter.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/metar_get.c b/tools/metar_get.c index 30b3e1a07..e2ae92f8f 100644 --- a/tools/metar_get.c +++ b/tools/metar_get.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/metar_ls.c b/tools/metar_ls.c index a1780e057..c23acb7f9 100644 --- a/tools/metar_ls.c +++ b/tools/metar_ls.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/taf_dump.c b/tools/taf_dump.c index ec7ee78b6..6e37b15ef 100644 --- a/tools/taf_dump.c +++ b/tools/taf_dump.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/taf_filter.c b/tools/taf_filter.c index 6e5e6c4b2..c94b6dd17 100644 --- a/tools/taf_filter.c +++ b/tools/taf_filter.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/taf_get.c b/tools/taf_get.c index 0d309bb83..44567f8e0 100644 --- a/tools/taf_get.c +++ b/tools/taf_get.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/taf_ls.c b/tools/taf_ls.c index 21a72746f..c640f90a1 100644 --- a/tools/taf_ls.c +++ b/tools/taf_ls.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/test.c b/tools/test.c index 204d72f7d..dd15b8924 100644 --- a/tools/test.c +++ b/tools/test.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/wingetopt.c b/tools/wingetopt.c index c726c4969..5eb965cdb 100644 --- a/tools/wingetopt.c +++ b/tools/wingetopt.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/wingetopt.h b/tools/wingetopt.h index 0d9d939c2..f7f7c2c03 100644 --- a/tools/wingetopt.h +++ b/tools/wingetopt.h @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. diff --git a/tools/xref.c b/tools/xref.c index fa4a002ed..ec8b502c2 100644 --- a/tools/xref.c +++ b/tools/xref.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2019 ECMWF. + * (C) Copyright 2005- 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. From 3ccfdb2273b0bfcd7e5aea8532dd2b0b4a4805f3 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 29 Jan 2020 12:07:46 +0000 Subject: [PATCH 53/82] Latest updates from develop (9) --- LICENSE | 2 +- src/eccodes.h | 444 +- src/eccodes_windef.h | 8 +- src/grib_accessor_class_bufr_data_array.c | 2 +- src/grib_api.h | 685 +-- src/grib_api_internal.h | 2088 ++++---- src/grib_api_prototypes.h | 1463 +++--- src/grib_emoslib.h | 7 +- src/grib_parse_utils.c | 4 +- src/jgribapi_GribFile.h | 18 +- src/jgribapi_GribHandle.h | 57 +- src/jgribapi_GribIterator.h | 6 +- src/md5.h | 5 +- tests/bits.c | 441 +- tests/bpv_limit.c | 82 +- tests/bufr_ecc-517.c | 156 +- tests/bufr_ecc-604.c | 129 +- tests/bufr_ecc-604.sh | 2 +- tests/bufr_extract_headers.c | 26 +- tests/bufr_get_element.c | 35 +- tests/bufr_keys_iter.c | 40 +- tests/decode.c | 1 - tests/gauss_sub.c | 284 +- tests/grib_2nd_order_numValues.c | 5434 ++++++++++---------- tests/grib_ccsds_perf.c | 471 +- tests/grib_double_cmp.c | 39 +- tests/grib_ecc-386.c | 42 +- tests/grib_ecc-604-encode.c | 106 +- tests/grib_ecc-604.c | 145 +- tests/grib_ecc-604.sh | 2 +- tests/grib_encode_pthreads.c | 86 +- tests/grib_lam_bf.c | 206 +- tests/grib_lam_bf.sh | 2 +- tests/grib_lam_gp.c | 181 +- tests/grib_lam_gp.sh | 2 +- tests/grib_local_MeteoFrance.c | 1760 +++---- tests/grib_multi_from_message.c | 65 +- tests/grib_nearest_test.c | 93 +- tests/grib_optimize_scaling.c | 5451 ++++++++++----------- tests/grib_optimize_scaling_sh.c | 481 +- tests/grib_sh_ieee64.c | 456 +- tests/grib_sh_imag.c | 458 +- tests/grib_util_set_spec.c | 219 +- tests/ibm.c | 30 +- tests/ieee.c | 93 +- tests/index.c | 139 +- tests/index_orderby.c | 100 +- tests/jpeg_perf.c | 458 +- tests/julian.c | 166 +- tests/largefile.c | 88 +- tests/png_perf.c | 458 +- tests/read_any.c | 72 +- tests/read_index.c | 228 +- tests/unit_tests.c | 122 +- tests/values_to_ascii.c | 125 +- tools/grib_filter.h | 79 +- tools/grib_tools.h | 241 +- tools/load.h | 12 +- tools/wingetopt.h | 5 +- 59 files changed, 12180 insertions(+), 11920 deletions(-) mode change 100755 => 100644 tests/bits.c mode change 100755 => 100644 tests/decode.c mode change 100755 => 100644 tests/ibm.c mode change 100755 => 100644 tests/ieee.c mode change 100755 => 100644 tests/values_to_ascii.c diff --git a/LICENSE b/LICENSE index 57bc88a15..11bdc0cce 100755 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2005- ECMWF Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/src/eccodes.h b/src/eccodes.h index 713259169..44d299744 100644 --- a/src/eccodes.h +++ b/src/eccodes.h @@ -27,168 +27,168 @@ extern "C" { #define CODES_VERSION ECCODES_VERSION /* sections */ -#define CODES_SECTION_PRODUCT GRIB_SECTION_PRODUCT -#define CODES_SECTION_GRID GRIB_SECTION_GRID -#define CODES_SECTION_LOCAL GRIB_SECTION_LOCAL -#define CODES_SECTION_DATA GRIB_SECTION_DATA -#define CODES_SECTION_BITMAP GRIB_SECTION_BITMAP +#define CODES_SECTION_PRODUCT GRIB_SECTION_PRODUCT +#define CODES_SECTION_GRID GRIB_SECTION_GRID +#define CODES_SECTION_LOCAL GRIB_SECTION_LOCAL +#define CODES_SECTION_DATA GRIB_SECTION_DATA +#define CODES_SECTION_BITMAP GRIB_SECTION_BITMAP /* LOG MODES Log mode for information for processing information */ -#define CODES_LOG_INFO GRIB_LOG_INFO -#define CODES_LOG_WARNING GRIB_LOG_WARNING -#define CODES_LOG_ERROR GRIB_LOG_ERROR -#define CODES_LOG_FATAL GRIB_LOG_FATAL -#define CODES_LOG_DEBUG GRIB_LOG_DEBUG +#define CODES_LOG_INFO GRIB_LOG_INFO +#define CODES_LOG_WARNING GRIB_LOG_WARNING +#define CODES_LOG_ERROR GRIB_LOG_ERROR +#define CODES_LOG_FATAL GRIB_LOG_FATAL +#define CODES_LOG_DEBUG GRIB_LOG_DEBUG /* Types */ -#define CODES_TYPE_UNDEFINED GRIB_TYPE_UNDEFINED -#define CODES_TYPE_LONG GRIB_TYPE_LONG -#define CODES_TYPE_DOUBLE GRIB_TYPE_DOUBLE -#define CODES_TYPE_STRING GRIB_TYPE_STRING -#define CODES_TYPE_BYTES GRIB_TYPE_BYTES -#define CODES_TYPE_SECTION GRIB_TYPE_SECTION -#define CODES_TYPE_LABEL GRIB_TYPE_LABEL -#define CODES_TYPE_MISSING GRIB_TYPE_MISSING +#define CODES_TYPE_UNDEFINED GRIB_TYPE_UNDEFINED +#define CODES_TYPE_LONG GRIB_TYPE_LONG +#define CODES_TYPE_DOUBLE GRIB_TYPE_DOUBLE +#define CODES_TYPE_STRING GRIB_TYPE_STRING +#define CODES_TYPE_BYTES GRIB_TYPE_BYTES +#define CODES_TYPE_SECTION GRIB_TYPE_SECTION +#define CODES_TYPE_LABEL GRIB_TYPE_LABEL +#define CODES_TYPE_MISSING GRIB_TYPE_MISSING /* Missing values */ -#define CODES_MISSING_LONG GRIB_MISSING_LONG +#define CODES_MISSING_LONG GRIB_MISSING_LONG #define CODES_MISSING_DOUBLE GRIB_MISSING_DOUBLE /*set spec flags*/ #define CODES_UTIL_SET_SPEC_FLAGS_ONLY_PACKING GRIB_UTIL_SET_SPEC_FLAGS_ONLY_PACKING /* Dump option flags*/ -#define CODES_DUMP_FLAG_READ_ONLY GRIB_DUMP_FLAG_READ_ONLY -#define CODES_DUMP_FLAG_DUMP_OK GRIB_DUMP_FLAG_DUMP_OK -#define CODES_DUMP_FLAG_VALUES GRIB_DUMP_FLAG_VALUES -#define CODES_DUMP_FLAG_CODED GRIB_DUMP_FLAG_CODED -#define CODES_DUMP_FLAG_OCTECT GRIB_DUMP_FLAG_OCTECT -#define CODES_DUMP_FLAG_ALIASES GRIB_DUMP_FLAG_ALIASES -#define CODES_DUMP_FLAG_TYPE GRIB_DUMP_FLAG_TYPE -#define CODES_DUMP_FLAG_HEXADECIMAL GRIB_DUMP_FLAG_HEXADECIMAL -#define CODES_DUMP_FLAG_NO_DATA GRIB_DUMP_FLAG_NO_DATA -#define CODES_DUMP_FLAG_ALL_DATA GRIB_DUMP_FLAG_ALL_DATA -#define CODES_DUMP_FLAG_ALL_ATTRIBUTES GRIB_DUMP_FLAG_ALL_ATTRIBUTES +#define CODES_DUMP_FLAG_READ_ONLY GRIB_DUMP_FLAG_READ_ONLY +#define CODES_DUMP_FLAG_DUMP_OK GRIB_DUMP_FLAG_DUMP_OK +#define CODES_DUMP_FLAG_VALUES GRIB_DUMP_FLAG_VALUES +#define CODES_DUMP_FLAG_CODED GRIB_DUMP_FLAG_CODED +#define CODES_DUMP_FLAG_OCTECT GRIB_DUMP_FLAG_OCTECT +#define CODES_DUMP_FLAG_ALIASES GRIB_DUMP_FLAG_ALIASES +#define CODES_DUMP_FLAG_TYPE GRIB_DUMP_FLAG_TYPE +#define CODES_DUMP_FLAG_HEXADECIMAL GRIB_DUMP_FLAG_HEXADECIMAL +#define CODES_DUMP_FLAG_NO_DATA GRIB_DUMP_FLAG_NO_DATA +#define CODES_DUMP_FLAG_ALL_DATA GRIB_DUMP_FLAG_ALL_DATA +#define CODES_DUMP_FLAG_ALL_ATTRIBUTES GRIB_DUMP_FLAG_ALL_ATTRIBUTES /* codes_nearest flags */ -#define CODES_NEAREST_SAME_GRID GRIB_NEAREST_SAME_GRID -#define CODES_NEAREST_SAME_DATA GRIB_NEAREST_SAME_DATA -#define CODES_NEAREST_SAME_POINT GRIB_NEAREST_SAME_POINT +#define CODES_NEAREST_SAME_GRID GRIB_NEAREST_SAME_GRID +#define CODES_NEAREST_SAME_DATA GRIB_NEAREST_SAME_DATA +#define CODES_NEAREST_SAME_POINT GRIB_NEAREST_SAME_POINT /*! Iteration is carried out on all the keys available in the message \ingroup keys_iterator \see codes_keys_iterator_new */ -#define CODES_KEYS_ITERATOR_ALL_KEYS GRIB_KEYS_ITERATOR_ALL_KEYS +#define CODES_KEYS_ITERATOR_ALL_KEYS GRIB_KEYS_ITERATOR_ALL_KEYS /*! read only keys are skipped by keys iterator. \ingroup keys_iterator \see codes_keys_iterator_new */ -#define CODES_KEYS_ITERATOR_SKIP_READ_ONLY GRIB_KEYS_ITERATOR_SKIP_READ_ONLY +#define CODES_KEYS_ITERATOR_SKIP_READ_ONLY GRIB_KEYS_ITERATOR_SKIP_READ_ONLY /*! optional keys are skipped by keys iterator. \ingroup keys_iterator \see codes_keys_iterator_new */ -#define CODES_KEYS_ITERATOR_SKIP_OPTIONAL GRIB_KEYS_ITERATOR_SKIP_OPTIONAL +#define CODES_KEYS_ITERATOR_SKIP_OPTIONAL GRIB_KEYS_ITERATOR_SKIP_OPTIONAL /*! edition specific keys are skipped by keys iterator. \ingroup keys_iterator \see codes_keys_iterator_new */ -#define CODES_KEYS_ITERATOR_SKIP_EDITION_SPECIFIC GRIB_KEYS_ITERATOR_SKIP_EDITION_SPECIFIC +#define CODES_KEYS_ITERATOR_SKIP_EDITION_SPECIFIC GRIB_KEYS_ITERATOR_SKIP_EDITION_SPECIFIC /*! coded keys are skipped by keys iterator. \ingroup keys_iterator \see codes_keys_iterator_new */ -#define CODES_KEYS_ITERATOR_SKIP_CODED GRIB_KEYS_ITERATOR_SKIP_CODED +#define CODES_KEYS_ITERATOR_SKIP_CODED GRIB_KEYS_ITERATOR_SKIP_CODED /*! computed keys are skipped by keys iterator. \ingroup keys_iterator \see codes_keys_iterator_new */ -#define CODES_KEYS_ITERATOR_SKIP_COMPUTED GRIB_KEYS_ITERATOR_SKIP_COMPUTED +#define CODES_KEYS_ITERATOR_SKIP_COMPUTED GRIB_KEYS_ITERATOR_SKIP_COMPUTED /*! duplicates of a key are skipped by keys iterator. \ingroup keys_iterator \see codes_keys_iterator_new */ -#define CODES_KEYS_ITERATOR_SKIP_DUPLICATES GRIB_KEYS_ITERATOR_SKIP_DUPLICATES +#define CODES_KEYS_ITERATOR_SKIP_DUPLICATES GRIB_KEYS_ITERATOR_SKIP_DUPLICATES /*! function keys are skipped by keys iterator. \ingroup keys_iterator \see codes_keys_iterator_new */ -#define CODES_KEYS_ITERATOR_SKIP_FUNCTION GRIB_KEYS_ITERATOR_SKIP_FUNCTION +#define CODES_KEYS_ITERATOR_SKIP_FUNCTION GRIB_KEYS_ITERATOR_SKIP_FUNCTION /*! only keys present in the dump \ingroup keys_iterator \see codes_keys_iterator_new */ -#define CODES_KEYS_ITERATOR_DUMP_ONLY GRIB_KEYS_ITERATOR_DUMP_ONLY +#define CODES_KEYS_ITERATOR_DUMP_ONLY GRIB_KEYS_ITERATOR_DUMP_ONLY -typedef struct grib_values codes_values; -typedef struct grib_key_value_list codes_key_value_list; +typedef struct grib_values codes_values; +typedef struct grib_key_value_list codes_key_value_list; /*! Codes handle, structure giving access to parsed values by keys \ingroup codes_handle \struct codes_handle */ -typedef struct grib_handle codes_handle; +typedef struct grib_handle codes_handle; /*! GRIB multi field handle, structure used to build multi fields messages. \ingroup codes_handle \struct codes_multi_handle */ -typedef struct grib_multi_handle codes_multi_handle; +typedef struct grib_multi_handle codes_multi_handle; /*! Codes context, structure containing the memory methods, the parsers and the formats. \ingroup codes_context \struct codes_context */ -typedef struct grib_context codes_context; +typedef struct grib_context codes_context; /*! GRIB geoiterator, structure supporting a geographic iteration of values in a GRIB message. \ingroup iterators \struct codes_iterator */ -typedef struct grib_iterator codes_iterator; +typedef struct grib_iterator codes_iterator; /*! Codes nearest, structure used to find the nearest points of a latitude longitude point in a GRIB message. \ingroup iterators \struct codes_nearest */ -typedef struct grib_nearest codes_nearest; -typedef struct grib_box codes_box; -typedef struct grib_points codes_points; +typedef struct grib_nearest codes_nearest; +typedef struct grib_box codes_box; +typedef struct grib_points codes_points; /*! Codes keys iterator. Iterator over keys. \ingroup keys_iterator \struct codes_keys_iterator */ -typedef struct grib_keys_iterator codes_keys_iterator; -typedef struct bufr_keys_iterator codes_bufr_keys_iterator; - -typedef struct grib_fieldset codes_fieldset; -typedef struct grib_order_by codes_order_by; -typedef struct grib_where codes_where; -typedef struct grib_sarray codes_sarray; -typedef struct grib_oarray codes_oarray; -typedef struct grib_darray codes_darray; -typedef struct grib_iarray codes_iarray; -typedef struct grib_vdarray codes_vdarray; -typedef struct grib_vsarray codes_vsarray; -typedef struct grib_viarray codes_viarray; -typedef struct grib_string_list codes_string_list; +typedef struct grib_keys_iterator codes_keys_iterator; +typedef struct bufr_keys_iterator codes_bufr_keys_iterator; + +typedef struct grib_fieldset codes_fieldset; +typedef struct grib_order_by codes_order_by; +typedef struct grib_where codes_where; +typedef struct grib_sarray codes_sarray; +typedef struct grib_oarray codes_oarray; +typedef struct grib_darray codes_darray; +typedef struct grib_iarray codes_iarray; +typedef struct grib_vdarray codes_vdarray; +typedef struct grib_vsarray codes_vsarray; +typedef struct grib_viarray codes_viarray; +typedef struct grib_string_list codes_string_list; typedef struct grib_util_packing_spec codes_util_packing_spec; -typedef struct grib_util_grid_spec codes_util_grid_spec; +typedef struct grib_util_grid_spec codes_util_grid_spec; -codes_fieldset *codes_fieldset_new_from_files(codes_context *c, char *filenames[], int nfiles, char **keys, int nkeys, const char *where_string, const char *order_by_string, int *err); +codes_fieldset* codes_fieldset_new_from_files(codes_context* c, char* filenames[], int nfiles, char** keys, int nkeys, const char* where_string, const char* order_by_string, int* err); void codes_fieldset_delete(codes_fieldset* set); void codes_fieldset_rewind(codes_fieldset* set); -int codes_fieldset_apply_order_by(codes_fieldset* set, const char* order_by_string); +int codes_fieldset_apply_order_by(codes_fieldset* set, const char* order_by_string); codes_handle* codes_fieldset_next_handle(codes_fieldset* set, int* err); -int codes_fieldset_count(codes_fieldset *set); -int codes_values_check(codes_handle* h, codes_values* values, int count); +int codes_fieldset_count(codes_fieldset* set); +int codes_values_check(codes_handle* h, codes_values* values, int count); /*! \defgroup codes_index The indexing feature The codes_index is the structure giving indexed access to messages in a file. @@ -199,7 +199,7 @@ The codes_index is the structure giving indexed access to messages in a file. * \ingroup codes_index * \struct codes_index */ -typedef struct grib_index codes_index; +typedef struct grib_index codes_index; /** * Create a new index form a file. The file is indexed with the keys in argument. @@ -214,7 +214,7 @@ typedef struct grib_index codes_index; * @param err : 0 if OK, integer value on error * @return the newly created index */ -codes_index* codes_index_new_from_file(codes_context* c, char* filename, const char* keys, int *err); +codes_index* codes_index_new_from_file(codes_context* c, char* filename, const char* keys, int* err); /** * Create a new index based on a set of keys. @@ -228,7 +228,7 @@ codes_index* codes_index_new_from_file(codes_context* c, char* filename, const c * @param err : 0 if OK, integer value on error * @return the newly created index */ -codes_index* codes_index_new(codes_context* c, const char* keys, int *err); +codes_index* codes_index_new(codes_context* c, const char* keys, int* err); /** * Indexes the file given in argument in the index given in argument. @@ -237,9 +237,9 @@ codes_index* codes_index_new(codes_context* c, const char* keys, int *err); * @param filename : name of the file of messages to be indexed * @return 0 if OK, integer value on error */ -int codes_index_add_file(codes_index* index, const char *filename); -int codes_index_write(codes_index* index, const char *filename); -codes_index* codes_index_read(codes_context* c, const char* filename, int *err); +int codes_index_add_file(codes_index* index, const char* filename); +int codes_index_write(codes_index* index, const char* filename); +codes_index* codes_index_read(codes_context* c, const char* filename, int* err); /** * Get the number of distinct values of the key in argument contained in the index. The key must belong to the index. @@ -262,7 +262,7 @@ int codes_index_get_size(const codes_index* index, const char* key, size_t* size * @param size : size of the values array * @return 0 if OK, integer value on error */ -int codes_index_get_long(const codes_index* index, const char* key, long* values, size_t *size); +int codes_index_get_long(const codes_index* index, const char* key, long* values, size_t* size); /** * Get the distinct values of the key in argument contained in the index. The key must belong to the index. This function is used when the type of the key was explicitly defined as double or when the native type of the key is double. @@ -274,7 +274,7 @@ int codes_index_get_long(const codes_index* index, const char* key, long* values * @param size : size of the values array * @return 0 if OK, integer value on error */ -int codes_index_get_double(const codes_index* index, const char* key, double* values, size_t *size); +int codes_index_get_double(const codes_index* index, const char* key, double* values, size_t* size); /** * Get the distinct values of the key in argument contained in the index. The key must belong to the index. This function is used when the type of the key was explicitly defined as string or when the native type of the key is string. @@ -286,7 +286,7 @@ int codes_index_get_double(const codes_index* index, const char* key, double* va * @param size : size of the values array * @return 0 if OK, integer value on error */ -int codes_index_get_string(const codes_index* index, const char* key, char** values, size_t *size); +int codes_index_get_string(const codes_index* index, const char* key, char** values, size_t* size); /** @@ -331,7 +331,7 @@ int codes_index_select_string(codes_index* index, const char* key, char* value); * @param err : 0 if OK, integer value on error. CODES_END_OF_INDEX when no more handles are contained in the index. * @return grib handle. */ -codes_handle* codes_handle_new_from_index(codes_index* index, int *err); +codes_handle* codes_handle_new_from_index(codes_index* index, int* err); /** * Delete the index. @@ -417,7 +417,7 @@ codes_handle* codes_bufr_handle_new_from_file(codes_context* c, FILE* f, int* er */ int codes_write_message(const codes_handle* h, const char* file, const char* mode); -codes_handle* codes_grib_util_sections_copy(codes_handle* hfrom, codes_handle* hto, int what, int *err); +codes_handle* codes_grib_util_sections_copy(codes_handle* hfrom, codes_handle* hto, int what, int* err); codes_string_list* codes_grib_util_get_param_id(const char* mars_param); codes_string_list* codes_grib_util_get_mars_param(const char* param_id); @@ -444,7 +444,7 @@ codes_handle* codes_handle_new_from_message(codes_context* c, const void* data, * @return the new handle, NULL if the message is invalid or a problem is encountered */ codes_handle* codes_grib_handle_new_from_multi_message(codes_context* c, void** data, - size_t *data_len, int* error); + size_t* data_len, int* error); /** * Create a handle from a user message. The message is copied and will be freed with the handle @@ -552,7 +552,7 @@ int codes_grib_multi_handle_write(codes_multi_handle* mh, FILE* f); * @param message_length : On exit, the message size in number of bytes * @return 0 if OK, integer value on error */ -int codes_get_message(const codes_handle* h, const void** message, size_t *message_length); +int codes_get_message(const codes_handle* h, const void** message, size_t* message_length); /** @@ -564,7 +564,7 @@ int codes_get_message(const codes_handle* h, const void** message, size_t *messa * On exit, the actual message length in number of bytes * @return 0 if OK, integer value on error */ -int codes_get_message_copy(const codes_handle* h, void* message, size_t *message_length); +int codes_get_message_copy(const codes_handle* h, void* message, size_t* message_length); /*! @} */ /*! \defgroup iterators Iterating on latitude/longitude/values */ @@ -591,7 +591,7 @@ codes_iterator* codes_grib_iterator_new(const codes_handle* h, unsigned long fla * @param values : returned array of data values * @return 0 if OK, integer value on error */ -int codes_grib_get_data(const codes_handle *h, double *lats, double *lons, double *values); +int codes_grib_get_data(const codes_handle* h, double* lats, double* lons, double* values); /** * Get the next value from a geoiterator. @@ -602,7 +602,7 @@ int codes_grib_get_data(const codes_handle *h, double *lats, double *lons, doubl * @param value : on output value of the point * @return positive value if successful, 0 if no more data are available */ -int codes_grib_iterator_next(codes_iterator *i, double* lat, double* lon, double* value); +int codes_grib_iterator_next(codes_iterator* i, double* lat, double* lon, double* value); /** * Get the previous value from a geoiterator. @@ -613,7 +613,7 @@ int codes_grib_iterator_next(codes_iterator *i, double* lat, double* lon, double * @param value : on output value of the point* * @return positive value if successful, 0 if no more data are available */ -int codes_grib_iterator_previous(codes_iterator *i, double* lat, double* lon, double* value); +int codes_grib_iterator_previous(codes_iterator* i, double* lat, double* lon, double* value); /** * Test procedure for values in a geoiterator. @@ -621,7 +621,7 @@ int codes_grib_iterator_previous(codes_iterator *i, double* lat, double* lon, do * @param i : the geoiterator * @return boolean, 1 if the iterator still nave next values, 0 otherwise */ -int codes_grib_iterator_has_next(codes_iterator *i); +int codes_grib_iterator_has_next(codes_iterator* i); /** * Test procedure for values in a geoiterator. @@ -629,7 +629,7 @@ int codes_grib_iterator_has_next(codes_iterator *i); * @param i : the geoiterator * @return 0 if OK, integer value on error */ -int codes_grib_iterator_reset(codes_iterator *i); +int codes_grib_iterator_reset(codes_iterator* i); /** * Frees the geoiterator from memory. @@ -637,7 +637,7 @@ int codes_grib_iterator_reset(codes_iterator *i); * @param i : the geoiterator * @return 0 if OK, integer value on error */ -int codes_grib_iterator_delete(codes_iterator *i); +int codes_grib_iterator_delete(codes_iterator* i); /*! * \brief Create a new nearest neighbour object from a handle, using current geometry. @@ -669,9 +669,9 @@ codes_nearest* codes_grib_nearest_new(const codes_handle* h, int* error); * @param len : size of the arrays * @return 0 if OK, integer value on error */ -int codes_grib_nearest_find(codes_nearest *nearest, const codes_handle* h, double inlat, double inlon, - unsigned long flags, double* outlats, double* outlons, - double* values, double* distances, int* indexes, size_t *len); +int codes_grib_nearest_find(codes_nearest* nearest, const codes_handle* h, double inlat, double inlon, + unsigned long flags, double* outlats, double* outlons, + double* values, double* distances, int* indexes, size_t* len); /** * Frees an nearest from memory @@ -679,7 +679,7 @@ int codes_grib_nearest_find(codes_nearest *nearest, const codes_handle* h, doubl * @param nearest : the nearest * @return 0 if OK, integer value on error */ -int codes_grib_nearest_delete(codes_nearest *nearest); +int codes_grib_nearest_delete(codes_nearest* nearest); /** * Find the nearest point of a set of points whose latitudes and longitudes @@ -706,9 +706,9 @@ int codes_grib_nearest_delete(codes_nearest *nearest); * @return 0 if OK, integer value on error */ int codes_grib_nearest_find_multiple(const codes_handle* h, int is_lsm, - const double* inlats, const double* inlons, long npoints, - double* outlats, double* outlons, - double* values, double* distances, int* indexes); + const double* inlats, const double* inlons, long npoints, + double* outlats, double* outlons, + double* values, double* distances, int* indexes); /* @} */ @@ -733,7 +733,7 @@ int codes_get_offset(const codes_handle* h, const char* key, size_t* offset); * @param size : the address of a size_t where the size will be set * @return 0 if OK, integer value on error */ -int codes_get_size(const codes_handle* h, const char* key, size_t *size); +int codes_get_size(const codes_handle* h, const char* key, size_t* size); /** * Get the length of the string representation of the key, if several keys of the same name are present, the maximum length is returned @@ -743,7 +743,7 @@ int codes_get_size(const codes_handle* h, const char* key, size_t *size); * @param length : the address of a size_t where the length will be set * @return 0 if OK, integer value on error */ -int codes_get_length(const codes_handle* h, const char* key, size_t *length); +int codes_get_length(const codes_handle* h, const char* key, size_t* length); /** * Get a long value from a key, if several keys of the same name are present, the last one is returned @@ -800,7 +800,7 @@ int codes_get_double_elements(const codes_handle* h, const char* key, int* i, lo * @param length : the address of a size_t that contains allocated length of the string on input, and that contains the actual length of the string on output * @return 0 if OK, integer value on error */ -int codes_get_string(const codes_handle* h, const char* key, char* mesg, size_t *length); +int codes_get_string(const codes_handle* h, const char* key, char* mesg, size_t* length); /** * Get string array values from a key. If several keys of the same name are present, the last one is returned @@ -812,7 +812,7 @@ int codes_get_string(const codes_handle* h, const char* key, char* mesg, size_t * @param length : the address of a size_t that contains allocated length of the array on input, and that contains the actual length of the array on output * @return 0 if OK, integer value on error */ -int codes_get_string_array(const codes_handle* h, const char* key, char** vals, size_t *length); +int codes_get_string_array(const codes_handle* h, const char* key, char** vals, size_t* length); /** * Get raw bytes values from a key. If several keys of the same name are present, the last one is returned @@ -824,7 +824,7 @@ int codes_get_string_array(const codes_handle* h, const char* key, char** vals, * @param length : the address of a size_t that contains allocated length of the byte array on input, and that contains the actual length of the byte array on output * @return 0 if OK, integer value on error */ -int codes_get_bytes(const codes_handle* h, const char* key, unsigned char* bytes, size_t *length); +int codes_get_bytes(const codes_handle* h, const char* key, unsigned char* bytes, size_t* length); /** * Get double array values from a key. If several keys of the same name are present, the last one is returned @@ -836,7 +836,7 @@ int codes_get_bytes(const codes_handle* h, const char* key, unsigned char* bytes * @param length : the address of a size_t that contains allocated length of the double array on input, and that contains the actual length of the double array on output * @return 0 if OK, integer value on error */ -int codes_get_double_array(const codes_handle* h, const char* key, double* vals, size_t *length); +int codes_get_double_array(const codes_handle* h, const char* key, double* vals, size_t* length); /** * Get long array values from a key. If several keys of the same name are present, the last one is returned @@ -848,7 +848,7 @@ int codes_get_double_array(const codes_handle* h, const char* key, double* vals, * @param length : the address of a size_t that contains allocated length of the long array on input, and that contains the actual length of the long array on output * @return 0 if OK, integer value on error */ -int codes_get_long_array(const codes_handle* h, const char* key, long* vals, size_t *length); +int codes_get_long_array(const codes_handle* h, const char* key, long* vals, size_t* length); /* setting data */ @@ -895,7 +895,7 @@ int codes_set_double(codes_handle* h, const char* key, double val); * @param length : the address of a size_t that contains the length of the string on input, and that contains the actual packed length of the string on output * @return 0 if OK, integer value on error */ -int codes_set_string(codes_handle* h, const char* key , const char* mesg, size_t *length); +int codes_set_string(codes_handle* h, const char* key, const char* mesg, size_t* length); /** * Set a bytes array from a key. If several keys of the same name are present, the last one is set @@ -907,7 +907,7 @@ int codes_set_string(codes_handle* h, const char* key , const char* mesg, size_ * @param length : the address of a size_t that contains the length of the byte array on input, and that contains the actual packed length of the byte array on output * @return 0 if OK, integer value on error */ -int codes_set_bytes(codes_handle* h, const char* key, const unsigned char* bytes, size_t *length); +int codes_set_bytes(codes_handle* h, const char* key, const unsigned char* bytes, size_t* length); /** * Set a double array from a key. If several keys of the same name are present, the last one is set @@ -950,7 +950,7 @@ int codes_set_long_array(codes_handle* h, const char* key, const long* vals, siz * @param length : a size_t that contains the length of the array on input * @return 0 if OK, integer value on error */ -int codes_set_string_array(codes_handle *h, const char *key, const char **vals, size_t length); +int codes_set_string_array(codes_handle* h, const char* key, const char** vals, size_t length); /*! @} */ @@ -1088,8 +1088,8 @@ void codes_grib_multi_support_off(codes_context* c); */ void codes_grib_multi_support_reset_file(codes_context* c, FILE* f); -char* codes_samples_path(const codes_context *c); -char* codes_definition_path(const codes_context *c); +char* codes_samples_path(const codes_context* c); +char* codes_definition_path(const codes_context* c); /*! @} */ /** @@ -1140,7 +1140,7 @@ codes_keys_iterator* codes_keys_iterator_new(codes_handle* h, unsigned long filt * structure as the aim is to copy what is possible to be copied. * This will allow the user to add something to a message by creating a new message with additions or changes to the * unexpandedDescriptors and copying what is possible to copy from the original message. */ -char **codes_bufr_copy_data_return_copied_keys(codes_handle *hin, codes_handle *hout, size_t *nkeys, int *err); +char** codes_bufr_copy_data_return_copied_keys(codes_handle* hin, codes_handle* hout, size_t* nkeys, int* err); int codes_bufr_copy_data(codes_handle* hin, codes_handle* hout); @@ -1148,14 +1148,14 @@ int codes_bufr_copy_data(codes_handle* hin, codes_handle* hout); * @param kiter : valid codes_keys_iterator * @return 1 if next iterator exists, 0 if no more elements to iterate on */ -int codes_keys_iterator_next(codes_keys_iterator *kiter); +int codes_keys_iterator_next(codes_keys_iterator* kiter); /*! get the key name from the keys iterator * @param kiter : valid codes_keys_iterator * @return key name */ -const char* codes_keys_iterator_get_name(const codes_keys_iterator *kiter); +const char* codes_keys_iterator_get_name(const codes_keys_iterator* kiter); /*! Delete the keys iterator. * @param kiter : valid codes_keys_iterator @@ -1170,11 +1170,11 @@ int codes_keys_iterator_delete(codes_keys_iterator* kiter); int codes_keys_iterator_rewind(codes_keys_iterator* kiter); -int codes_keys_iterator_set_flags(codes_keys_iterator *kiter, unsigned long flags); -int codes_keys_iterator_get_long(const codes_keys_iterator *kiter, long *v, size_t *len); -int codes_keys_iterator_get_double(const codes_keys_iterator *kiter, double *v, size_t *len); -int codes_keys_iterator_get_string(const codes_keys_iterator *kiter, char *v, size_t *len); -int codes_keys_iterator_get_bytes(const codes_keys_iterator *kiter, unsigned char *v, size_t *len); +int codes_keys_iterator_set_flags(codes_keys_iterator* kiter, unsigned long flags); +int codes_keys_iterator_get_long(const codes_keys_iterator* kiter, long* v, size_t* len); +int codes_keys_iterator_get_double(const codes_keys_iterator* kiter, double* v, size_t* len); +int codes_keys_iterator_get_string(const codes_keys_iterator* kiter, char* v, size_t* len); +int codes_keys_iterator_get_bytes(const codes_keys_iterator* kiter, unsigned char* v, size_t* len); /* @} */ @@ -1192,7 +1192,7 @@ const char* codes_get_type_name(int type); int codes_get_native_type(const codes_handle* h, const char* name, int* type); void codes_check(const char* call, const char* file, int line, int e, const char* msg); -#define CODES_CHECK(a, msg) GRIB_CHECK(a, msg) +#define CODES_CHECK(a, msg) GRIB_CHECK(a, msg) #define CODES_CHECK_NOLINE(a, msg) GRIB_CHECK_NOLINE(a, msg) @@ -1205,13 +1205,13 @@ int codes_set_missing(codes_handle* h, const char* key); /* The truncation is the Gaussian number (or order) */ int codes_get_gaussian_latitudes(long truncation, double* latitudes); -int codes_julian_to_datetime(double jd, long *year, long *month, long *day, long *hour, long *minute, long *second); -int codes_datetime_to_julian(long year, long month, long day, long hour, long minute, long second, double *jd); +int codes_julian_to_datetime(double jd, long* year, long* month, long* day, long* hour, long* minute, long* second); +int codes_datetime_to_julian(long year, long month, long day, long hour, long minute, long second, double* jd); long codes_julian_to_date(long jdate); long codes_date_to_julian(long ddate); void codes_get_reduced_row(long pl, double lon_first, double lon_last, long* npoints, long* ilon_first, long* ilon_last); -void codes_get_reduced_row_p(long pl, double lon_first, double lon_last, long *npoints, double *olon_first, double *olon_last); +void codes_get_reduced_row_p(long pl, double lon_first, double lon_last, long* npoints, double* olon_first, double* olon_last); /* read products */ @@ -1222,45 +1222,45 @@ int codes_check_message_header(const void* bytes, size_t length, ProductKind pro int codes_check_message_footer(const void* bytes, size_t length, ProductKind product); codes_box* codes_box_new(codes_handle* h, int* error); -codes_points* codes_box_get_points(codes_box *box, double north, double west, double south, double east, int *err); +codes_points* codes_box_get_points(codes_box* box, double north, double west, double south, double east, int* err); int codes_points_get_values(codes_handle* h, codes_points* points, double* val); /* --------------------------------------- */ -#define CODES_UTIL_GRID_SPEC_REGULAR_LL GRIB_UTIL_GRID_SPEC_REGULAR_LL -#define CODES_UTIL_GRID_SPEC_ROTATED_LL GRIB_UTIL_GRID_SPEC_ROTATED_LL -#define CODES_UTIL_GRID_SPEC_REGULAR_GG GRIB_UTIL_GRID_SPEC_REGULAR_GG -#define CODES_UTIL_GRID_SPEC_ROTATED_GG GRIB_UTIL_GRID_SPEC_ROTATED_GG -#define CODES_UTIL_GRID_SPEC_REDUCED_GG GRIB_UTIL_GRID_SPEC_REDUCED_GG -#define CODES_UTIL_GRID_SPEC_SH GRIB_UTIL_GRID_SPEC_SH -#define CODES_UTIL_GRID_SPEC_REDUCED_LL GRIB_UTIL_GRID_SPEC_REDUCED_LL -#define CODES_UTIL_GRID_SPEC_POLAR_STEREOGRAPHIC GRIB_UTIL_GRID_SPEC_POLAR_STEREOGRAPHIC -#define CODES_UTIL_GRID_SPEC_LAMBERT_AZIMUTHAL_EQUAL_AREA GRIB_UTIL_GRID_SPEC_LAMBERT_AZIMUTHAL_EQUAL_AREA -#define CODES_UTIL_GRID_SPEC_LAMBERT_CONFORMAL GRIB_UTIL_GRID_SPEC_LAMBERT_CONFORMAL -#define CODES_UTIL_GRID_SPEC_UNSTRUCTURED GRIB_UTIL_GRID_SPEC_UNSTRUCTURED - -#define CODES_UTIL_PACKING_TYPE_SPECTRAL_COMPLEX GRIB_UTIL_PACKING_TYPE_SPECTRAL_COMPLEX -#define CODES_UTIL_PACKING_TYPE_SPECTRAL_SIMPLE GRIB_UTIL_PACKING_TYPE_SPECTRAL_SIMPLE -#define CODES_UTIL_PACKING_TYPE_JPEG GRIB_UTIL_PACKING_TYPE_JPEG -#define CODES_UTIL_PACKING_TYPE_GRID_COMPLEX GRIB_UTIL_PACKING_TYPE_GRID_COMPLEX -#define CODES_UTIL_PACKING_TYPE_GRID_SIMPLE GRIB_UTIL_PACKING_TYPE_GRID_SIMPLE -#define CODES_UTIL_PACKING_TYPE_GRID_SIMPLE_MATRIX GRIB_UTIL_PACKING_TYPE_GRID_SIMPLE_MATRIX -#define CODES_UTIL_PACKING_TYPE_GRID_SECOND_ORDER GRIB_UTIL_PACKING_TYPE_GRID_SECOND_ORDER -#define CODES_UTIL_PACKING_SAME_AS_INPUT GRIB_UTIL_PACKING_SAME_AS_INPUT -#define CODES_UTIL_PACKING_USE_PROVIDED GRIB_UTIL_PACKING_USE_PROVIDED -#define CODES_UTIL_ACCURACY_SAME_BITS_PER_VALUES_AS_INPUT GRIB_UTIL_ACCURACY_SAME_BITS_PER_VALUES_AS_INPUT -#define CODES_UTIL_ACCURACY_USE_PROVIDED_BITS_PER_VALUES GRIB_UTIL_ACCURACY_USE_PROVIDED_BITS_PER_VALUES +#define CODES_UTIL_GRID_SPEC_REGULAR_LL GRIB_UTIL_GRID_SPEC_REGULAR_LL +#define CODES_UTIL_GRID_SPEC_ROTATED_LL GRIB_UTIL_GRID_SPEC_ROTATED_LL +#define CODES_UTIL_GRID_SPEC_REGULAR_GG GRIB_UTIL_GRID_SPEC_REGULAR_GG +#define CODES_UTIL_GRID_SPEC_ROTATED_GG GRIB_UTIL_GRID_SPEC_ROTATED_GG +#define CODES_UTIL_GRID_SPEC_REDUCED_GG GRIB_UTIL_GRID_SPEC_REDUCED_GG +#define CODES_UTIL_GRID_SPEC_SH GRIB_UTIL_GRID_SPEC_SH +#define CODES_UTIL_GRID_SPEC_REDUCED_LL GRIB_UTIL_GRID_SPEC_REDUCED_LL +#define CODES_UTIL_GRID_SPEC_POLAR_STEREOGRAPHIC GRIB_UTIL_GRID_SPEC_POLAR_STEREOGRAPHIC +#define CODES_UTIL_GRID_SPEC_LAMBERT_AZIMUTHAL_EQUAL_AREA GRIB_UTIL_GRID_SPEC_LAMBERT_AZIMUTHAL_EQUAL_AREA +#define CODES_UTIL_GRID_SPEC_LAMBERT_CONFORMAL GRIB_UTIL_GRID_SPEC_LAMBERT_CONFORMAL +#define CODES_UTIL_GRID_SPEC_UNSTRUCTURED GRIB_UTIL_GRID_SPEC_UNSTRUCTURED + +#define CODES_UTIL_PACKING_TYPE_SPECTRAL_COMPLEX GRIB_UTIL_PACKING_TYPE_SPECTRAL_COMPLEX +#define CODES_UTIL_PACKING_TYPE_SPECTRAL_SIMPLE GRIB_UTIL_PACKING_TYPE_SPECTRAL_SIMPLE +#define CODES_UTIL_PACKING_TYPE_JPEG GRIB_UTIL_PACKING_TYPE_JPEG +#define CODES_UTIL_PACKING_TYPE_GRID_COMPLEX GRIB_UTIL_PACKING_TYPE_GRID_COMPLEX +#define CODES_UTIL_PACKING_TYPE_GRID_SIMPLE GRIB_UTIL_PACKING_TYPE_GRID_SIMPLE +#define CODES_UTIL_PACKING_TYPE_GRID_SIMPLE_MATRIX GRIB_UTIL_PACKING_TYPE_GRID_SIMPLE_MATRIX +#define CODES_UTIL_PACKING_TYPE_GRID_SECOND_ORDER GRIB_UTIL_PACKING_TYPE_GRID_SECOND_ORDER +#define CODES_UTIL_PACKING_SAME_AS_INPUT GRIB_UTIL_PACKING_SAME_AS_INPUT +#define CODES_UTIL_PACKING_USE_PROVIDED GRIB_UTIL_PACKING_USE_PROVIDED +#define CODES_UTIL_ACCURACY_SAME_BITS_PER_VALUES_AS_INPUT GRIB_UTIL_ACCURACY_SAME_BITS_PER_VALUES_AS_INPUT +#define CODES_UTIL_ACCURACY_USE_PROVIDED_BITS_PER_VALUES GRIB_UTIL_ACCURACY_USE_PROVIDED_BITS_PER_VALUES #define CODES_UTIL_ACCURACY_SAME_DECIMAL_SCALE_FACTOR_AS_INPUT GRIB_UTIL_ACCURACY_SAME_DECIMAL_SCALE_FACTOR_AS_INPUT -#define CODES_UTIL_ACCURACY_USE_PROVIDED_DECIMAL_SCALE_FACTOR GRIB_UTIL_ACCURACY_USE_PROVIDED_DECIMAL_SCALE_FACTOR +#define CODES_UTIL_ACCURACY_USE_PROVIDED_DECIMAL_SCALE_FACTOR GRIB_UTIL_ACCURACY_USE_PROVIDED_DECIMAL_SCALE_FACTOR -codes_handle *codes_grib_util_set_spec(codes_handle *h, - const codes_util_grid_spec *grid_spec, - const codes_util_packing_spec *packing_spec, /* NULL for defaults (same as input) */ - int flags, - const double *data_values, - size_t data_values_count, - int *err); +codes_handle* codes_grib_util_set_spec(codes_handle* h, + const codes_util_grid_spec* grid_spec, + const codes_util_packing_spec* packing_spec, /* NULL for defaults (same as input) */ + int flags, + const double* data_values, + size_t data_values_count, + int* err); /* EXPERIMENTAL FEATURE * Build an array of headers from input BUFR file. @@ -1271,7 +1271,7 @@ codes_handle *codes_grib_util_set_spec(codes_handle *h, * returns 0 if OK, integer value on error. */ int codes_bufr_extract_headers_malloc(codes_context* c, const char* filename, codes_bufr_header** result, int* num_messages, int strict_mode); -int codes_bufr_header_get_string(codes_bufr_header* bh, const char* key, char *val, size_t *len); +int codes_bufr_header_get_string(codes_bufr_header* bh, const char* key, char* val, size_t* len); /* --------------------------------------- */ #ifdef __cplusplus @@ -1286,140 +1286,140 @@ Error codes returned by the eccodes functions. */ /*! @{*/ /** No error */ -#define CODES_SUCCESS GRIB_SUCCESS +#define CODES_SUCCESS GRIB_SUCCESS /** End of resource reached */ -#define CODES_END_OF_FILE GRIB_END_OF_FILE +#define CODES_END_OF_FILE GRIB_END_OF_FILE /** Internal error */ -#define CODES_INTERNAL_ERROR GRIB_INTERNAL_ERROR +#define CODES_INTERNAL_ERROR GRIB_INTERNAL_ERROR /** Passed buffer is too small */ -#define CODES_BUFFER_TOO_SMALL GRIB_BUFFER_TOO_SMALL +#define CODES_BUFFER_TOO_SMALL GRIB_BUFFER_TOO_SMALL /** Function not yet implemented */ -#define CODES_NOT_IMPLEMENTED GRIB_NOT_IMPLEMENTED +#define CODES_NOT_IMPLEMENTED GRIB_NOT_IMPLEMENTED /** Missing 7777 at end of message */ -#define CODES_7777_NOT_FOUND GRIB_7777_NOT_FOUND +#define CODES_7777_NOT_FOUND GRIB_7777_NOT_FOUND /** Passed array is too small */ -#define CODES_ARRAY_TOO_SMALL GRIB_ARRAY_TOO_SMALL +#define CODES_ARRAY_TOO_SMALL GRIB_ARRAY_TOO_SMALL /** File not found */ -#define CODES_FILE_NOT_FOUND GRIB_FILE_NOT_FOUND +#define CODES_FILE_NOT_FOUND GRIB_FILE_NOT_FOUND /** Code not found in code table */ -#define CODES_CODE_NOT_FOUND_IN_TABLE GRIB_CODE_NOT_FOUND_IN_TABLE +#define CODES_CODE_NOT_FOUND_IN_TABLE GRIB_CODE_NOT_FOUND_IN_TABLE /** Array size mismatch */ -#define CODES_WRONG_ARRAY_SIZE GRIB_WRONG_ARRAY_SIZE +#define CODES_WRONG_ARRAY_SIZE GRIB_WRONG_ARRAY_SIZE /** Key/value not found */ -#define CODES_NOT_FOUND GRIB_NOT_FOUND +#define CODES_NOT_FOUND GRIB_NOT_FOUND /** Input output problem */ -#define CODES_IO_PROBLEM GRIB_IO_PROBLEM +#define CODES_IO_PROBLEM GRIB_IO_PROBLEM /** Message invalid */ -#define CODES_INVALID_MESSAGE GRIB_INVALID_MESSAGE +#define CODES_INVALID_MESSAGE GRIB_INVALID_MESSAGE /** Decoding invalid */ -#define CODES_DECODING_ERROR GRIB_DECODING_ERROR +#define CODES_DECODING_ERROR GRIB_DECODING_ERROR /** Encoding invalid */ -#define CODES_ENCODING_ERROR GRIB_ENCODING_ERROR +#define CODES_ENCODING_ERROR GRIB_ENCODING_ERROR /** Code cannot unpack because of string too small */ -#define CODES_NO_MORE_IN_SET GRIB_NO_MORE_IN_SET +#define CODES_NO_MORE_IN_SET GRIB_NO_MORE_IN_SET /** Problem with calculation of geographic attributes */ -#define CODES_GEOCALCULUS_PROBLEM GRIB_GEOCALCULUS_PROBLEM +#define CODES_GEOCALCULUS_PROBLEM GRIB_GEOCALCULUS_PROBLEM /** Memory allocation error */ -#define CODES_OUT_OF_MEMORY GRIB_OUT_OF_MEMORY +#define CODES_OUT_OF_MEMORY GRIB_OUT_OF_MEMORY /** Value is read only */ -#define CODES_READ_ONLY GRIB_READ_ONLY +#define CODES_READ_ONLY GRIB_READ_ONLY /** Invalid argument */ -#define CODES_INVALID_ARGUMENT GRIB_INVALID_ARGUMENT +#define CODES_INVALID_ARGUMENT GRIB_INVALID_ARGUMENT /** Null handle */ -#define CODES_NULL_HANDLE GRIB_NULL_HANDLE +#define CODES_NULL_HANDLE GRIB_NULL_HANDLE /** Invalid section number */ -#define CODES_INVALID_SECTION_NUMBER GRIB_INVALID_SECTION_NUMBER +#define CODES_INVALID_SECTION_NUMBER GRIB_INVALID_SECTION_NUMBER /** Value cannot be missing */ -#define CODES_VALUE_CANNOT_BE_MISSING GRIB_VALUE_CANNOT_BE_MISSING +#define CODES_VALUE_CANNOT_BE_MISSING GRIB_VALUE_CANNOT_BE_MISSING /** Wrong message length */ -#define CODES_WRONG_LENGTH GRIB_WRONG_LENGTH +#define CODES_WRONG_LENGTH GRIB_WRONG_LENGTH /** Invalid key type */ -#define CODES_INVALID_TYPE GRIB_INVALID_TYPE +#define CODES_INVALID_TYPE GRIB_INVALID_TYPE /** Unable to set step */ -#define CODES_WRONG_STEP GRIB_WRONG_STEP +#define CODES_WRONG_STEP GRIB_WRONG_STEP /** Wrong units for step (step must be integer) */ -#define CODES_WRONG_STEP_UNIT GRIB_WRONG_STEP_UNIT +#define CODES_WRONG_STEP_UNIT GRIB_WRONG_STEP_UNIT /** Invalid file id */ -#define CODES_INVALID_FILE GRIB_INVALID_FILE +#define CODES_INVALID_FILE GRIB_INVALID_FILE /** Invalid grib id */ -#define CODES_INVALID_GRIB GRIB_INVALID_GRIB +#define CODES_INVALID_GRIB GRIB_INVALID_GRIB /** Invalid index id */ -#define CODES_INVALID_INDEX GRIB_INVALID_INDEX +#define CODES_INVALID_INDEX GRIB_INVALID_INDEX /** Invalid iterator id */ -#define CODES_INVALID_ITERATOR GRIB_INVALID_ITERATOR +#define CODES_INVALID_ITERATOR GRIB_INVALID_ITERATOR /** Invalid keys iterator id */ -#define CODES_INVALID_KEYS_ITERATOR GRIB_INVALID_KEYS_ITERATOR +#define CODES_INVALID_KEYS_ITERATOR GRIB_INVALID_KEYS_ITERATOR /** Invalid nearest id */ -#define CODES_INVALID_NEAREST GRIB_INVALID_NEAREST +#define CODES_INVALID_NEAREST GRIB_INVALID_NEAREST /** Invalid order by */ -#define CODES_INVALID_ORDERBY GRIB_INVALID_ORDERBY +#define CODES_INVALID_ORDERBY GRIB_INVALID_ORDERBY /** Missing a key from the fieldset */ -#define CODES_MISSING_KEY GRIB_MISSING_KEY +#define CODES_MISSING_KEY GRIB_MISSING_KEY /** The point is out of the grid area */ -#define CODES_OUT_OF_AREA GRIB_OUT_OF_AREA +#define CODES_OUT_OF_AREA GRIB_OUT_OF_AREA /** Concept no match */ -#define CODES_CONCEPT_NO_MATCH GRIB_CONCEPT_NO_MATCH +#define CODES_CONCEPT_NO_MATCH GRIB_CONCEPT_NO_MATCH /** Hash array no match */ -#define CODES_HASH_ARRAY_NO_MATCH GRIB_HASH_ARRAY_NO_MATCH +#define CODES_HASH_ARRAY_NO_MATCH GRIB_HASH_ARRAY_NO_MATCH /** Definitions files not found */ -#define CODES_NO_DEFINITIONS GRIB_NO_DEFINITIONS +#define CODES_NO_DEFINITIONS GRIB_NO_DEFINITIONS /** Wrong type while packing */ -#define CODES_WRONG_TYPE GRIB_WRONG_TYPE +#define CODES_WRONG_TYPE GRIB_WRONG_TYPE /** End of resource */ -#define CODES_END GRIB_END +#define CODES_END GRIB_END /** Unable to code a field without values */ -#define CODES_NO_VALUES GRIB_NO_VALUES +#define CODES_NO_VALUES GRIB_NO_VALUES /** Grid description is wrong or inconsistent */ -#define CODES_WRONG_GRID GRIB_WRONG_GRID +#define CODES_WRONG_GRID GRIB_WRONG_GRID /** End of index reached */ -#define CODES_END_OF_INDEX GRIB_END_OF_INDEX +#define CODES_END_OF_INDEX GRIB_END_OF_INDEX /** Null index */ -#define CODES_NULL_INDEX GRIB_NULL_INDEX +#define CODES_NULL_INDEX GRIB_NULL_INDEX /** End of resource reached when reading message */ -#define CODES_PREMATURE_END_OF_FILE GRIB_PREMATURE_END_OF_FILE +#define CODES_PREMATURE_END_OF_FILE GRIB_PREMATURE_END_OF_FILE /** An internal array is too small */ -#define CODES_INTERNAL_ARRAY_TOO_SMALL GRIB_INTERNAL_ARRAY_TOO_SMALL +#define CODES_INTERNAL_ARRAY_TOO_SMALL GRIB_INTERNAL_ARRAY_TOO_SMALL /** Message is too large for the current architecture */ -#define CODES_MESSAGE_TOO_LARGE GRIB_MESSAGE_TOO_LARGE +#define CODES_MESSAGE_TOO_LARGE GRIB_MESSAGE_TOO_LARGE /** Constant field */ -#define CODES_CONSTANT_FIELD GRIB_CONSTANT_FIELD +#define CODES_CONSTANT_FIELD GRIB_CONSTANT_FIELD /** Switch unable to find a matching case */ -#define CODES_SWITCH_NO_MATCH GRIB_SWITCH_NO_MATCH +#define CODES_SWITCH_NO_MATCH GRIB_SWITCH_NO_MATCH /** Underflow */ -#define CODES_UNDERFLOW GRIB_UNDERFLOW +#define CODES_UNDERFLOW GRIB_UNDERFLOW /** Message malformed */ -#define CODES_MESSAGE_MALFORMED GRIB_MESSAGE_MALFORMED +#define CODES_MESSAGE_MALFORMED GRIB_MESSAGE_MALFORMED /** Index is corrupted */ -#define CODES_CORRUPTED_INDEX GRIB_CORRUPTED_INDEX +#define CODES_CORRUPTED_INDEX GRIB_CORRUPTED_INDEX /** Invalid number of bits per value */ -#define CODES_INVALID_BPV GRIB_INVALID_BPV +#define CODES_INVALID_BPV GRIB_INVALID_BPV /** Edition of two messages is different */ -#define CODES_DIFFERENT_EDITION GRIB_DIFFERENT_EDITION +#define CODES_DIFFERENT_EDITION GRIB_DIFFERENT_EDITION /** Value is different */ -#define CODES_VALUE_DIFFERENT GRIB_VALUE_DIFFERENT +#define CODES_VALUE_DIFFERENT GRIB_VALUE_DIFFERENT /** Invalid key value */ -#define CODES_INVALID_KEY_VALUE GRIB_INVALID_KEY_VALUE +#define CODES_INVALID_KEY_VALUE GRIB_INVALID_KEY_VALUE /** String is smaller than requested */ -#define CODES_STRING_TOO_SMALL GRIB_STRING_TOO_SMALL +#define CODES_STRING_TOO_SMALL GRIB_STRING_TOO_SMALL /** Wrong type conversion */ -#define CODES_WRONG_CONVERSION GRIB_WRONG_CONVERSION +#define CODES_WRONG_CONVERSION GRIB_WRONG_CONVERSION /** Missing BUFR table entry for descriptor */ -#define CODES_MISSING_BUFR_ENTRY GRIB_MISSING_BUFR_ENTRY +#define CODES_MISSING_BUFR_ENTRY GRIB_MISSING_BUFR_ENTRY /** Null pointer */ -#define CODES_NULL_POINTER GRIB_NULL_POINTER +#define CODES_NULL_POINTER GRIB_NULL_POINTER /** Attribute is already present, cannot add */ -#define CODES_ATTRIBUTE_CLASH GRIB_ATTRIBUTE_CLASH +#define CODES_ATTRIBUTE_CLASH GRIB_ATTRIBUTE_CLASH /** Too many attributes. Increase MAX_ACCESSOR_ATTRIBUTES */ -#define CODES_TOO_MANY_ATTRIBUTES GRIB_TOO_MANY_ATTRIBUTES +#define CODES_TOO_MANY_ATTRIBUTES GRIB_TOO_MANY_ATTRIBUTES /** Attribute not found. */ -#define CODES_ATTRIBUTE_NOT_FOUND GRIB_ATTRIBUTE_NOT_FOUND +#define CODES_ATTRIBUTE_NOT_FOUND GRIB_ATTRIBUTE_NOT_FOUND /** Edition not supported. */ -#define CODES_UNSUPPORTED_EDITION GRIB_UNSUPPORTED_EDITION +#define CODES_UNSUPPORTED_EDITION GRIB_UNSUPPORTED_EDITION /** Value out of coding range */ -#define CODES_OUT_OF_RANGE GRIB_OUT_OF_RANGE +#define CODES_OUT_OF_RANGE GRIB_OUT_OF_RANGE /** Size of bitmap is incorrect */ -#define CODES_WRONG_BITMAP_SIZE GRIB_WRONG_BITMAP_SIZE +#define CODES_WRONG_BITMAP_SIZE GRIB_WRONG_BITMAP_SIZE /** Functionality not enabled */ -#define CODES_FUNCTIONALITY_NOT_ENABLED GRIB_FUNCTIONALITY_NOT_ENABLED +#define CODES_FUNCTIONALITY_NOT_ENABLED GRIB_FUNCTIONALITY_NOT_ENABLED /*! @}*/ #endif diff --git a/src/eccodes_windef.h b/src/eccodes_windef.h index 46c8ee97a..61bb43f57 100644 --- a/src/eccodes_windef.h +++ b/src/eccodes_windef.h @@ -13,10 +13,10 @@ /* Microsoft Windows Visual Studio support */ #if defined(_WIN32) && defined(_MSC_VER) - #define ECCODES_ON_WINDOWS - #ifndef YY_NO_UNISTD_H - #define YY_NO_UNISTD_H - #endif +#define ECCODES_ON_WINDOWS +#ifndef YY_NO_UNISTD_H +#define YY_NO_UNISTD_H +#endif #endif #endif diff --git a/src/grib_accessor_class_bufr_data_array.c b/src/grib_accessor_class_bufr_data_array.c index 0046e3f9b..740863489 100644 --- a/src/grib_accessor_class_bufr_data_array.c +++ b/src/grib_accessor_class_bufr_data_array.c @@ -1416,7 +1416,7 @@ static int encode_new_replication(grib_context* c, grib_accessor_bufr_data_array if (self->compressedData) { grib_buffer_set_ulength_bits(c, buff, buff->ulength_bits + 6); grib_encode_unsigned_longb(buff->data, 0, pos, 6); - }; + } return err; } diff --git a/src/grib_api.h b/src/grib_api.h index 523ce189e..228e3f3dd 100644 --- a/src/grib_api.h +++ b/src/grib_api.h @@ -28,13 +28,21 @@ #endif #include -#if defined( __GNUC__) || defined(__clang__) +#if defined(__GNUC__) || defined(__clang__) #define ECCODES_DEPRECATED __attribute__((deprecated)) #else #define ECCODES_DEPRECATED #endif -typedef enum ProductKind {PRODUCT_ANY, PRODUCT_GRIB, PRODUCT_BUFR, PRODUCT_METAR, PRODUCT_GTS, PRODUCT_TAF} ProductKind; +typedef enum ProductKind +{ + PRODUCT_ANY, + PRODUCT_GRIB, + PRODUCT_BUFR, + PRODUCT_METAR, + PRODUCT_GTS, + PRODUCT_TAF +} ProductKind; #include "eccodes_version.h" @@ -43,26 +51,26 @@ extern "C" { #endif /* sections */ -#define GRIB_SECTION_PRODUCT (1<<0) -#define GRIB_SECTION_GRID (1<<1) -#define GRIB_SECTION_LOCAL (1<<2) -#define GRIB_SECTION_DATA (1<<3) -#define GRIB_SECTION_BITMAP (1<<4) +#define GRIB_SECTION_PRODUCT (1 << 0) +#define GRIB_SECTION_GRID (1 << 1) +#define GRIB_SECTION_LOCAL (1 << 2) +#define GRIB_SECTION_DATA (1 << 3) +#define GRIB_SECTION_BITMAP (1 << 4) /* LOG MODES Log mode for information for processing information */ /* Log mode for info */ -#define GRIB_LOG_INFO 0 +#define GRIB_LOG_INFO 0 /* Log mode for warnings */ -#define GRIB_LOG_WARNING 1 +#define GRIB_LOG_WARNING 1 /* Log mode for errors */ -#define GRIB_LOG_ERROR 2 +#define GRIB_LOG_ERROR 2 /* Log mode for fatal errors */ -#define GRIB_LOG_FATAL 3 +#define GRIB_LOG_FATAL 3 /* Log mode for debug */ -#define GRIB_LOG_DEBUG 4 +#define GRIB_LOG_DEBUG 4 /* Types */ /* undefined */ @@ -89,126 +97,127 @@ Log mode for information for processing information #define GRIB_MISSING_DOUBLE -1e+100 /*set spec flags*/ -#define GRIB_UTIL_SET_SPEC_FLAGS_ONLY_PACKING (1<<0) +#define GRIB_UTIL_SET_SPEC_FLAGS_ONLY_PACKING (1 << 0) /* Dump option flags*/ -#define GRIB_DUMP_FLAG_READ_ONLY (1<<0) -#define GRIB_DUMP_FLAG_DUMP_OK (1<<1) -#define GRIB_DUMP_FLAG_VALUES (1<<2) -#define GRIB_DUMP_FLAG_CODED (1<<3) -#define GRIB_DUMP_FLAG_OCTECT (1<<4) -#define GRIB_DUMP_FLAG_ALIASES (1<<5) -#define GRIB_DUMP_FLAG_TYPE (1<<6) -#define GRIB_DUMP_FLAG_HEXADECIMAL (1<<7) -#define GRIB_DUMP_FLAG_NO_DATA (1<<8) -#define GRIB_DUMP_FLAG_ALL_DATA (1<<9) -#define GRIB_DUMP_FLAG_ALL_ATTRIBUTES (1<<10) +#define GRIB_DUMP_FLAG_READ_ONLY (1 << 0) +#define GRIB_DUMP_FLAG_DUMP_OK (1 << 1) +#define GRIB_DUMP_FLAG_VALUES (1 << 2) +#define GRIB_DUMP_FLAG_CODED (1 << 3) +#define GRIB_DUMP_FLAG_OCTECT (1 << 4) +#define GRIB_DUMP_FLAG_ALIASES (1 << 5) +#define GRIB_DUMP_FLAG_TYPE (1 << 6) +#define GRIB_DUMP_FLAG_HEXADECIMAL (1 << 7) +#define GRIB_DUMP_FLAG_NO_DATA (1 << 8) +#define GRIB_DUMP_FLAG_ALL_DATA (1 << 9) +#define GRIB_DUMP_FLAG_ALL_ATTRIBUTES (1 << 10) /* grib_nearest flags */ -#define GRIB_NEAREST_SAME_GRID (1<<0) -#define GRIB_NEAREST_SAME_DATA (1<<1) -#define GRIB_NEAREST_SAME_POINT (1<<2) +#define GRIB_NEAREST_SAME_GRID (1 << 0) +#define GRIB_NEAREST_SAME_DATA (1 << 1) +#define GRIB_NEAREST_SAME_POINT (1 << 2) /*! Iteration is carried out on all the keys available in the message \ingroup keys_iterator \see grib_keys_iterator_new */ -#define GRIB_KEYS_ITERATOR_ALL_KEYS 0 +#define GRIB_KEYS_ITERATOR_ALL_KEYS 0 /*! read only keys are skipped by keys iterator. \ingroup keys_iterator \see grib_keys_iterator_new */ -#define GRIB_KEYS_ITERATOR_SKIP_READ_ONLY (1<<0) +#define GRIB_KEYS_ITERATOR_SKIP_READ_ONLY (1 << 0) /*! optional keys are skipped by keys iterator. \ingroup keys_iterator \see grib_keys_iterator_new */ -#define GRIB_KEYS_ITERATOR_SKIP_OPTIONAL (1<<1) +#define GRIB_KEYS_ITERATOR_SKIP_OPTIONAL (1 << 1) /*! edition specific keys are skipped by keys iterator. \ingroup keys_iterator \see grib_keys_iterator_new */ -#define GRIB_KEYS_ITERATOR_SKIP_EDITION_SPECIFIC (1<<2) +#define GRIB_KEYS_ITERATOR_SKIP_EDITION_SPECIFIC (1 << 2) /*! coded keys are skipped by keys iterator. \ingroup keys_iterator \see grib_keys_iterator_new */ -#define GRIB_KEYS_ITERATOR_SKIP_CODED (1<<3) +#define GRIB_KEYS_ITERATOR_SKIP_CODED (1 << 3) /*! computed keys are skipped by keys iterator. \ingroup keys_iterator \see grib_keys_iterator_new */ -#define GRIB_KEYS_ITERATOR_SKIP_COMPUTED (1<<4) +#define GRIB_KEYS_ITERATOR_SKIP_COMPUTED (1 << 4) /*! duplicates of a key are skipped by keys iterator. \ingroup keys_iterator \see grib_keys_iterator_new */ -#define GRIB_KEYS_ITERATOR_SKIP_DUPLICATES (1<<5) +#define GRIB_KEYS_ITERATOR_SKIP_DUPLICATES (1 << 5) /*! function keys are skipped by keys iterator. \ingroup keys_iterator \see grib_keys_iterator_new */ -#define GRIB_KEYS_ITERATOR_SKIP_FUNCTION (1<<6) +#define GRIB_KEYS_ITERATOR_SKIP_FUNCTION (1 << 6) /*! only keys present in the dump \ingroup keys_iterator \see grib_keys_iterator_new */ -#define GRIB_KEYS_ITERATOR_DUMP_ONLY (1<<7) +#define GRIB_KEYS_ITERATOR_DUMP_ONLY (1 << 7) typedef struct grib_key_value_list grib_key_value_list; typedef struct grib_values grib_values; -struct grib_values { - const char* name; - int type; - long long_value; - double double_value; - const char* string_value; - int error; - int has_value; - int equal; - grib_values* next; -} ; +struct grib_values +{ + const char* name; + int type; + long long_value; + double double_value; + const char* string_value; + int error; + int has_value; + int equal; + grib_values* next; +}; /*! Grib handle, structure giving access to parsed message values by keys \ingroup grib_handle */ -typedef struct grib_handle grib_handle; +typedef struct grib_handle grib_handle; /*! Grib multi field handle, structure used to build multi field GRIB messages. \ingroup grib_handle */ -typedef struct grib_multi_handle grib_multi_handle; +typedef struct grib_multi_handle grib_multi_handle; /*! Grib context, structure containing the memory methods, the parsers and the formats. \ingroup grib_context */ -typedef struct grib_context grib_context; +typedef struct grib_context grib_context; /*! Grib geoiterator, structure supporting a geographic iteration of values on a GRIB message. \ingroup grib_iterator */ -typedef struct grib_iterator grib_iterator; +typedef struct grib_iterator grib_iterator; /*! Grib nearest, structure used to find the nearest points of a latitude longitude point. \ingroup grib_iterator */ -typedef struct grib_nearest grib_nearest; +typedef struct grib_nearest grib_nearest; /*! Grib box, structure used to crop a box given north/west/south/east boundaries. \ingroup grib_box */ -typedef struct grib_box grib_box; -typedef struct grib_points grib_points; +typedef struct grib_box grib_box; +typedef struct grib_points grib_points; /*! Grib keys iterator. Iterator over keys. \ingroup keys_iterator */ -typedef struct grib_keys_iterator grib_keys_iterator; -typedef struct bufr_keys_iterator bufr_keys_iterator; +typedef struct grib_keys_iterator grib_keys_iterator; +typedef struct bufr_keys_iterator bufr_keys_iterator; typedef struct grib_fieldset grib_fieldset; @@ -226,12 +235,12 @@ typedef struct bufr_descriptor bufr_descriptor; typedef struct bufr_descriptors_array bufr_descriptors_array; typedef struct bufr_descriptors_map_list bufr_descriptors_map_list; -grib_fieldset *grib_fieldset_new_from_files(grib_context *c, char *filenames[], int nfiles, char **keys, int nkeys, const char *where_string, const char *order_by_string, int *err); +grib_fieldset* grib_fieldset_new_from_files(grib_context* c, char* filenames[], int nfiles, char** keys, int nkeys, const char* where_string, const char* order_by_string, int* err); void grib_fieldset_delete(grib_fieldset* set); void grib_fieldset_rewind(grib_fieldset* set); -int grib_fieldset_apply_order_by(grib_fieldset* set,const char* order_by_string); -grib_handle* grib_fieldset_next_handle(grib_fieldset* set,int* err); -int grib_fieldset_count(grib_fieldset *set); +int grib_fieldset_apply_order_by(grib_fieldset* set, const char* order_by_string); +grib_handle* grib_fieldset_next_handle(grib_fieldset* set, int* err); +int grib_fieldset_count(grib_fieldset* set); int grib_values_check(grib_handle* h, grib_values* values, int count); /*! \defgroup grib_index The grib_index @@ -257,7 +266,7 @@ typedef struct grib_index grib_index; * @return the newly created index */ grib_index* grib_index_new_from_file(grib_context* c, - char* filename,const char* keys,int *err); + char* filename, const char* keys, int* err); /** * Create a new index based on a set of keys. * @@ -270,7 +279,7 @@ grib_index* grib_index_new_from_file(grib_context* c, * @param err : 0 if OK, integer value on error * @return the newly created index */ -grib_index* grib_index_new(grib_context* c, const char* keys,int *err); +grib_index* grib_index_new(grib_context* c, const char* keys, int* err); /** * Indexes the file given in argument in the index given in argument. @@ -279,9 +288,9 @@ grib_index* grib_index_new(grib_context* c, const char* keys,int *err); * @param filename : name of the file of messages to be indexed * @return 0 if OK, integer value on error */ -int grib_index_add_file(grib_index *index, const char *filename); -int grib_index_write(grib_index *index, const char *filename); -grib_index* grib_index_read(grib_context* c,const char* filename,int *err); +int grib_index_add_file(grib_index* index, const char* filename); +int grib_index_write(grib_index* index, const char* filename); +grib_index* grib_index_read(grib_context* c, const char* filename, int* err); /** * Get the number of distinct values of the key in argument contained in the index. The key must belong to the index. @@ -292,7 +301,7 @@ grib_index* grib_index_read(grib_context* c,const char* filename,int *err); * @param size : number of distinct values of the key in the index * @return 0 if OK, integer value on error */ -int grib_index_get_size(const grib_index* index,const char* key,size_t* size); +int grib_index_get_size(const grib_index* index, const char* key, size_t* size); /** * Get the distinct values of the key in argument contained in the index. The key must belong to the index. This function is used when the type of the key was explicitly defined as long or when the native type of the key is long. @@ -304,8 +313,8 @@ int grib_index_get_size(const grib_index* index,const char* key,size_t* size); * @param size : size of the values array * @return 0 if OK, integer value on error */ -int grib_index_get_long(const grib_index* index,const char* key, - long* values,size_t *size); +int grib_index_get_long(const grib_index* index, const char* key, + long* values, size_t* size); /** * Get the distinct values of the key in argument contained in the index. The key must belong to the index. This function is used when the type of the key was explicitly defined as double or when the native type of the key is double. @@ -317,8 +326,8 @@ int grib_index_get_long(const grib_index* index,const char* key, * @param size : size of the values array * @return 0 if OK, integer value on error */ -int grib_index_get_double(const grib_index* index,const char* key, - double* values,size_t *size); +int grib_index_get_double(const grib_index* index, const char* key, + double* values, size_t* size); /** * Get the distinct values of the key in argument contained in the index. The key must belong to the index. This function is used when the type of the key was explicitly defined as string or when the native type of the key is string. @@ -330,8 +339,8 @@ int grib_index_get_double(const grib_index* index,const char* key, * @param size : size of the values array * @return 0 if OK, integer value on error */ -int grib_index_get_string(const grib_index* index,const char* key, - char** values,size_t *size); +int grib_index_get_string(const grib_index* index, const char* key, + char** values, size_t* size); /** @@ -343,7 +352,7 @@ int grib_index_get_string(const grib_index* index,const char* key, * @param value : value of the key to select * @return 0 if OK, integer value on error */ -int grib_index_select_long(grib_index* index,const char* key,long value); +int grib_index_select_long(grib_index* index, const char* key, long value); /** * Select the message subset with key==value. The value is a double. The key must have been created with double type or have double as native type if the type was not explicitly defined in the index creation. @@ -354,7 +363,7 @@ int grib_index_select_long(grib_index* index,const char* key,long value); * @param value : value of the key to select * @return 0 if OK, integer value on error */ -int grib_index_select_double(grib_index* index,const char* key,double value); +int grib_index_select_double(grib_index* index, const char* key, double value); /** * Select the message subset with key==value. The value is a string. The key must have been created with string type or have string as native type if the type was not explicitly defined in the index creation. @@ -365,7 +374,7 @@ int grib_index_select_double(grib_index* index,const char* key,double value); * @param value : value of the key to select * @return 0 if OK, integer value on error */ -int grib_index_select_string(grib_index* index,const char* key,char* value); +int grib_index_select_string(grib_index* index, const char* key, char* value); /** * Create a new handle from an index after having selected the key values. @@ -376,7 +385,7 @@ int grib_index_select_string(grib_index* index,const char* key,char* value); * @param err : 0 if OK, integer value on error. GRIB_END_OF_INDEX when no more handles are contained in the index. * @return grib handle. */ -grib_handle* grib_handle_new_from_index(grib_index* index,int *err); +grib_handle* grib_handle_new_from_index(grib_index* index, int* err); /** * Delete the index. @@ -399,7 +408,7 @@ The grib_handle is the structure giving access to parsed grib values by keys. * @param n : the number of messages in the file * @return 0 if OK, integer value on error */ -int grib_count_in_file(grib_context* c, FILE* f,int* n); +int grib_count_in_file(grib_context* c, FILE* f, int* n); /** * Counts the messages contained in a file. @@ -433,16 +442,17 @@ grib_handle* grib_handle_new_from_file(grib_context* c, FILE* f, int* error); * @param mode : mode * @return 0 if OK, integer value on error */ -int grib_write_message(const grib_handle* h,const char* file,const char* mode); +int grib_write_message(const grib_handle* h, const char* file, const char* mode); typedef struct grib_string_list grib_string_list; -struct grib_string_list { - char* value; - int count; - grib_string_list* next; +struct grib_string_list +{ + char* value; + int count; + grib_string_list* next; }; -grib_handle* grib_util_sections_copy(grib_handle* hfrom,grib_handle* hto,int what,int *err); +grib_handle* grib_util_sections_copy(grib_handle* hfrom, grib_handle* hto, int what, int* err); grib_string_list* grib_util_get_param_id(const char* mars_param); grib_string_list* grib_util_get_mars_param(const char* param_id); @@ -469,8 +479,8 @@ grib_handle* grib_handle_new_from_message(grib_context* c, const void* data, siz * @param error : error code * @return the new handle, NULL if the message is invalid or a problem is encountered */ -grib_handle* grib_handle_new_from_multi_message(grib_context* c,void** data, - size_t *data_len,int* error); +grib_handle* grib_handle_new_from_multi_message(grib_context* c, void** data, + size_t* data_len, int* error); /** * Create a handle from a user message. The message is copied and will be freed with the handle @@ -491,8 +501,7 @@ grib_handle* grib_handle_new_from_message_copy(grib_context* c, const void* data * @param sample_name : the name of the sample file (without the .tmpl extension) * @return the new handle, NULL if the resource is invalid or a problem is encountered */ -grib_handle* grib_handle_new_from_samples (grib_context* c, const char* sample_name); - +grib_handle* grib_handle_new_from_samples(grib_context* c, const char* sample_name); /** @@ -502,7 +511,7 @@ grib_handle* grib_handle_new_from_samples (grib_context* c, const char* sample_n * @param h : The handle to be cloned * @return the new handle, NULL if the message is invalid or a problem is encountered */ -grib_handle* grib_handle_clone(const grib_handle* h) ; +grib_handle* grib_handle_clone(const grib_handle* h); /** * Frees a handle, also frees the message if it is not a user message @@ -519,7 +528,7 @@ int grib_handle_delete(grib_handle* h); * * @param c : the context from which the handle will be created (NULL for default context) */ -grib_multi_handle* grib_multi_handle_new (grib_context* c); +grib_multi_handle* grib_multi_handle_new(grib_context* c); /** * Append the sections starting with start_section of the message pointed by h at @@ -532,7 +541,7 @@ grib_multi_handle* grib_multi_handle_new (grib_context* c); * @param mh : The multi field handle on which the sections are appended. * @return 0 if OK, integer value on error */ -int grib_multi_handle_append(grib_handle* h,int start_section,grib_multi_handle* mh); +int grib_multi_handle_append(grib_handle* h, int start_section, grib_multi_handle* mh); /** * Delete multi field handle. @@ -551,7 +560,7 @@ int grib_multi_handle_delete(grib_multi_handle* mh); * @param f : File on which the file handle is written. * @return 0 if OK, integer value on error */ -int grib_multi_handle_write(grib_multi_handle* mh,FILE* f); +int grib_multi_handle_write(grib_multi_handle* mh, FILE* f); /*! @} */ @@ -565,7 +574,7 @@ int grib_multi_handle_write(grib_multi_handle* mh,FILE* f); * @param message_length : On exit, the message size in number of bytes * @return 0 if OK, integer value on error */ -int grib_get_message(const grib_handle* h ,const void** message, size_t *message_length); +int grib_get_message(const grib_handle* h, const void** message, size_t* message_length); /** @@ -577,7 +586,7 @@ int grib_get_message(const grib_handle* h ,const void** message, size_t *message * On exit, the actual message length in number of bytes * @return 0 if OK, integer value on error */ -int grib_get_message_copy(const grib_handle* h, void* message,size_t *message_length); +int grib_get_message_copy(const grib_handle* h, void* message, size_t* message_length); /*! @} */ /*! \defgroup iterators Iterating on latitude/longitude/values */ @@ -604,7 +613,7 @@ grib_iterator* grib_iterator_new(const grib_handle* h, unsigned long flags, int* * @param values : returned array of data values * @return 0 if OK, integer value on error */ -int grib_get_data(const grib_handle *h, double *lats, double *lons, double *values); +int grib_get_data(const grib_handle* h, double* lats, double* lons, double* values); /** * Get the next value from a geoiterator. @@ -615,7 +624,7 @@ int grib_get_data(const grib_handle *h, double *lats, double *lons, double *valu * @param value : on output value of the point * @return positive value if successful, 0 if no more data are available */ -int grib_iterator_next(grib_iterator *i, double* lat,double* lon,double* value); +int grib_iterator_next(grib_iterator* i, double* lat, double* lon, double* value); /** * Get the previous value from a geoiterator. @@ -626,7 +635,7 @@ int grib_iterator_next(grib_iterator *i, double* lat,double* lon,double* value); * @param value : on output value of the point* * @return positive value if successful, 0 if no more data are available */ -int grib_iterator_previous(grib_iterator *i, double* lat,double* lon,double* value); +int grib_iterator_previous(grib_iterator* i, double* lat, double* lon, double* value); /** * Test procedure for values in a geoiterator. @@ -634,7 +643,7 @@ int grib_iterator_previous(grib_iterator *i, double* lat,double* lon,double* val * @param i : the geoiterator * @return boolean, 1 if the geoiterator still nave next values, 0 otherwise */ -int grib_iterator_has_next(grib_iterator *i); +int grib_iterator_has_next(grib_iterator* i); /** * Test procedure for values in a geoiterator. @@ -642,7 +651,7 @@ int grib_iterator_has_next(grib_iterator *i); * @param i : the geoiterator * @return 0 if OK, integer value on error */ -int grib_iterator_reset(grib_iterator *i); +int grib_iterator_reset(grib_iterator* i); /** * Frees a geoiterator from memory @@ -650,7 +659,7 @@ int grib_iterator_reset(grib_iterator *i); * @param i : the geoiterator * @return 0 if OK, integer value on error */ -int grib_iterator_delete(grib_iterator *i); +int grib_iterator_delete(grib_iterator* i); /*! * \brief Create a new nearest neighbour object from a handle, using current geometry. @@ -692,7 +701,7 @@ int grib_nearest_find(grib_nearest* nearest, const grib_handle* h, double inlat, * @param nearest : the nearest * @return 0 if OK, integer value on error */ -int grib_nearest_delete(grib_nearest *nearest); +int grib_nearest_delete(grib_nearest* nearest); /** * Find the nearest point of a set of points whose latitudes and longitudes @@ -719,9 +728,9 @@ int grib_nearest_delete(grib_nearest *nearest); * @return 0 if OK, integer value on error */ int grib_nearest_find_multiple(const grib_handle* h, int is_lsm, - const double* inlats, const double* inlons, long npoints, - double* outlats, double* outlons, - double* values, double* distances, int* indexes); + const double* inlats, const double* inlons, long npoints, + double* outlats, double* outlons, + double* values, double* distances, int* indexes); /* @} */ @@ -746,7 +755,7 @@ int grib_get_offset(const grib_handle* h, const char* key, size_t* offset); * @param size : the address of a size_t where the size will be set * @return 0 if OK, integer value on error */ -int grib_get_size(const grib_handle* h, const char* key,size_t *size); +int grib_get_size(const grib_handle* h, const char* key, size_t* size); /** * Get the length of the string representation of the key, if several keys of the same name are present, the maximum length is returned @@ -756,7 +765,7 @@ int grib_get_size(const grib_handle* h, const char* key,size_t *size); * @param length : the address of a size_t where the length will be set * @return 0 if OK, integer value on error */ -int grib_get_length(const grib_handle* h, const char* key,size_t *length); +int grib_get_length(const grib_handle* h, const char* key, size_t* length); /** * Get a long value from a key, if several keys of the same name are present, the last one is returned @@ -813,7 +822,7 @@ int grib_get_double_elements(const grib_handle* h, const char* key, int* i, long * @param length : the address of a size_t that contains allocated length of the string on input, and that contains the actual length of the string on output * @return 0 if OK, integer value on error */ -int grib_get_string(const grib_handle* h, const char* key, char* mesg, size_t *length); +int grib_get_string(const grib_handle* h, const char* key, char* mesg, size_t* length); /** * Get string array values from a key. If several keys of the same name are present, the last one is returned @@ -825,7 +834,7 @@ int grib_get_string(const grib_handle* h, const char* key, char* mesg, size_t *l * @param length : the address of a size_t that contains allocated length of the array on input, and that contains the actual length of the array on output * @return 0 if OK, integer value on error */ -int grib_get_string_array(const grib_handle* h, const char* key, char** vals, size_t *length); +int grib_get_string_array(const grib_handle* h, const char* key, char** vals, size_t* length); /** * Get raw bytes values from a key. If several keys of the same name are present, the last one is returned @@ -837,7 +846,7 @@ int grib_get_string_array(const grib_handle* h, const char* key, char** vals, si * @param length : the address of a size_t that contains allocated length of the byte array on input, and that contains the actual length of the byte array on output * @return 0 if OK, integer value on error */ -int grib_get_bytes(const grib_handle* h, const char* key, unsigned char* bytes, size_t *length); +int grib_get_bytes(const grib_handle* h, const char* key, unsigned char* bytes, size_t* length); /** * Get double array values from a key. If several keys of the same name are present, the last one is returned * @see grib_set_double_array @@ -848,7 +857,7 @@ int grib_get_bytes(const grib_handle* h, const char* key, unsigned char* bytes, * @param length : the address of a size_t that contains allocated length of the double array on input, and that contains the actual length of the double array on output * @return 0 if OK, integer value on error */ -int grib_get_double_array(const grib_handle* h, const char* key, double* vals, size_t *length); +int grib_get_double_array(const grib_handle* h, const char* key, double* vals, size_t* length); /** * Get long array values from a key. If several keys of the same name are present, the last one is returned @@ -860,7 +869,7 @@ int grib_get_double_array(const grib_handle* h, const char* key, double* vals, s * @param length : the address of a size_t that contains allocated length of the long array on input, and that contains the actual length of the long array on output * @return 0 if OK, integer value on error */ -int grib_get_long_array(const grib_handle* h, const char* key, long* vals, size_t *length); +int grib_get_long_array(const grib_handle* h, const char* key, long* vals, size_t* length); /* setting data */ @@ -907,7 +916,7 @@ int grib_set_double(grib_handle* h, const char* key, double val); * @param length : the address of a size_t that contains the length of the string on input, and that contains the actual packed length of the string on output * @return 0 if OK, integer value on error */ -int grib_set_string(grib_handle* h, const char* key, const char* mesg, size_t *length); +int grib_set_string(grib_handle* h, const char* key, const char* mesg, size_t* length); /** * Set a bytes array from a key. If several keys of the same name are present, the last one is set @@ -919,7 +928,7 @@ int grib_set_string(grib_handle* h, const char* key, const char* mesg, size_t *l * @param length : the address of a size_t that contains the length of the byte array on input, and that contains the actual packed length of the byte array on output * @return 0 if OK, integer value on error */ -int grib_set_bytes(grib_handle* h, const char* key, const unsigned char* bytes, size_t *length); +int grib_set_bytes(grib_handle* h, const char* key, const unsigned char* bytes, size_t* length); /** * Set a double array from a key. If several keys of the same name are present, the last one is set @@ -931,7 +940,7 @@ int grib_set_bytes(grib_handle* h, const char* key, const unsigned char* bytes, * @param length : a size_t that contains the length of the byte array on input * @return 0 if OK, integer value on error */ -int grib_set_double_array(grib_handle* h, const char* key , const double* vals , size_t length); +int grib_set_double_array(grib_handle* h, const char* key, const double* vals, size_t length); /** * Same as grib_set_double_array but allows setting of READ-ONLY keys like codedValues. @@ -950,7 +959,7 @@ int grib_set_force_double_array(grib_handle* h, const char* key, const double* v * @param length : a size_t that contains the length of the long array on input * @return 0 if OK, integer value on error */ -int grib_set_long_array(grib_handle* h, const char* key , const long* vals, size_t length); +int grib_set_long_array(grib_handle* h, const char* key, const long* vals, size_t length); /** * Set a string array from a key. If several keys of the same name are present, the last one is set @@ -962,7 +971,7 @@ int grib_set_long_array(grib_handle* h, const char* key , const long* vals, siz * @param length : a size_t that contains the length of the array on input * @return 0 if OK, integer value on error */ -int grib_set_string_array(grib_handle* h, const char *key, const char **vals, size_t length); +int grib_set_string_array(grib_handle* h, const char* key, const char** vals, size_t length); /*! @} */ @@ -975,7 +984,7 @@ int grib_set_string_array(grib_handle* h, const char *key, const char **vals, si * @param option_flags : all the GRIB_DUMP_FLAG_x flags can be used * @param arg : used to provide a format to output data (experimental) */ -void grib_dump_content(const grib_handle* h,FILE* out,const char* mode, unsigned long option_flags,void* arg); +void grib_dump_content(const grib_handle* h, FILE* out, const char* mode, unsigned long option_flags, void* arg); /** * Print all keys from the parsed definition files available in a context @@ -983,7 +992,7 @@ void grib_dump_content(const grib_handle* h,FILE* out,const char* mode, unsigned * @param f : the File used to print the keys on * @param c : the context that contains the cached definition files to be printed */ -void grib_dump_action_tree(grib_context* c, FILE* f) ; +void grib_dump_action_tree(grib_context* c, FILE* f); /*! \defgroup context The context object The context is a long life configuration object of the grib_api. @@ -998,7 +1007,7 @@ void grib_dump_action_tree(grib_context* c, FILE* f) ; * @param data : pointer to the data to be freed * must match @see grib_malloc_proc */ -typedef void (*grib_free_proc)(const grib_context* c, void* data); +typedef void (*grib_free_proc)(const grib_context* c, void* data); /** * Grib malloc procedure, format of a procedure referenced in the context that is used to allocate memory @@ -1025,7 +1034,7 @@ typedef void* (*grib_realloc_proc)(const grib_context* c, void* data, size_t len * @param level : the log level, as defined in log modes * @param mesg : the message to be logged */ -typedef void (*grib_log_proc)(const grib_context* c, int level, const char* mesg); +typedef void (*grib_log_proc)(const grib_context* c, int level, const char* mesg); /** * Grib print proc, format of a procedure referenced in the context that is used to print external messages @@ -1034,7 +1043,7 @@ typedef void (*grib_log_proc)(const grib_context* c, int level, const char* mes * @param descriptor : the structure to be printed on, must match the implementation * @param mesg : the message to be printed */ -typedef void (*grib_print_proc)(const grib_context* c, void* descriptor, const char* mesg); +typedef void (*grib_print_proc)(const grib_context* c, void* descriptor, const char* mesg); /** @@ -1046,7 +1055,7 @@ typedef void (*grib_print_proc)(const grib_context* c, void* descriptor, const * @param stream : the stream * @return size read */ -typedef size_t (*grib_data_read_proc)(const grib_context* c,void *ptr, size_t size, void *stream); +typedef size_t (*grib_data_read_proc)(const grib_context* c, void* ptr, size_t size, void* stream); /** * Grib data read write, format of a procedure referenced in the context that is used to write to a stream from a resource @@ -1057,7 +1066,7 @@ typedef size_t (*grib_data_read_proc)(const grib_context* c,void *ptr, size_t si * @param stream : the stream * @return size written */ -typedef size_t (*grib_data_write_proc)(const grib_context* c,const void *ptr, size_t size, void *stream); +typedef size_t (*grib_data_write_proc)(const grib_context* c, const void* ptr, size_t size, void* stream); /** * Grib data tell, format of a procedure referenced in the context that is used to tell the current position in a stream @@ -1066,7 +1075,7 @@ typedef size_t (*grib_data_write_proc)(const grib_context* c,const void *ptr, si * @param stream : the stream * @return the position in the stream */ -typedef off_t (*grib_data_tell_proc) (const grib_context* c, void *stream); +typedef off_t (*grib_data_tell_proc)(const grib_context* c, void* stream); /** * Grib data seek, format of a procedure referenced in the context that is used to seek the current position in a stream @@ -1079,7 +1088,7 @@ typedef off_t (*grib_data_tell_proc) (const grib_context* c, void *stream); * @param stream : the stream * @return 0 if OK, integer value on error */ -typedef off_t (*grib_data_seek_proc)(const grib_context* c, off_t offset, int whence, void *stream); +typedef off_t (*grib_data_seek_proc)(const grib_context* c, off_t offset, int whence, void* stream); /** * Grib data eof, format of a procedure referenced in the context that is used to test end of file @@ -1088,7 +1097,7 @@ typedef off_t (*grib_data_seek_proc)(const grib_context* c, off_t offset, int w * @param stream : the stream * @return the position in the stream */ -typedef int (*grib_data_eof_proc) (const grib_context* c, void *stream); +typedef int (*grib_data_eof_proc)(const grib_context* c, void* stream); /** * Get the static default context @@ -1110,7 +1119,7 @@ void grib_context_delete(grib_context* c); * * @param c : the context */ -void grib_gts_header_on(grib_context* c) ; +void grib_gts_header_on(grib_context* c); /** * Set the GTS header mode off. @@ -1167,8 +1176,8 @@ void grib_context_set_samples_path(grib_context* c, const char* path); * @param gribfree : the memory freeing procedure to be set @see grib_free_proc */ void grib_context_set_memory_proc(grib_context* c, grib_malloc_proc griballoc, - grib_free_proc gribfree, - grib_realloc_proc gribrealloc); + grib_free_proc gribfree, + grib_realloc_proc gribrealloc); /** * Sets memory procedures of the context for persistent data @@ -1177,8 +1186,8 @@ void grib_context_set_memory_proc(grib_context* c, grib_malloc_proc griballoc, * @param griballoc : the memory allocation procedure to be set @see grib_malloc_proc * @param gribfree : the memory freeing procedure to be set @see grib_free_proc */ -void grib_context_set_persistent_memory_proc(grib_context* c, grib_malloc_proc griballoc, - grib_free_proc gribfree); +void grib_context_set_persistent_memory_proc(grib_context* c, grib_malloc_proc griballoc, + grib_free_proc gribfree); /** * Sets memory procedures of the context for large buffers @@ -1229,8 +1238,8 @@ void grib_multi_support_off(grib_context* c); */ void grib_multi_support_reset_file(grib_context* c, FILE* f); -char* grib_samples_path(const grib_context *c); -char* grib_definition_path(const grib_context *c); +char* grib_samples_path(const grib_context* c); +char* grib_definition_path(const grib_context* c); /*! @} */ /** @@ -1273,7 +1282,7 @@ attributes or by the namespace they belong to. * @return keys iterator ready to iterate through keys according to filter_flags * and namespace */ -grib_keys_iterator* grib_keys_iterator_new(grib_handle* h,unsigned long filter_flags, const char* name_space); +grib_keys_iterator* grib_keys_iterator_new(grib_handle* h, unsigned long filter_flags, const char* name_space); bufr_keys_iterator* codes_bufr_keys_iterator_new(grib_handle* h, unsigned long filter_flags); bufr_keys_iterator* codes_bufr_data_section_keys_iterator_new(grib_handle* h); @@ -1288,7 +1297,7 @@ int codes_bufr_keys_iterator_next(bufr_keys_iterator* kiter); * @param kiter : valid grib_keys_iterator * @return key name */ -const char* grib_keys_iterator_get_name(const grib_keys_iterator *kiter); +const char* grib_keys_iterator_get_name(const grib_keys_iterator* kiter); char* codes_bufr_keys_iterator_get_name(const bufr_keys_iterator* kiter); /*! Delete the iterator. @@ -1305,13 +1314,13 @@ int codes_bufr_keys_iterator_delete(bufr_keys_iterator* kiter); int grib_keys_iterator_rewind(grib_keys_iterator* kiter); int codes_bufr_keys_iterator_rewind(bufr_keys_iterator* kiter); -int grib_keys_iterator_set_flags(grib_keys_iterator *kiter,unsigned long flags); +int grib_keys_iterator_set_flags(grib_keys_iterator* kiter, unsigned long flags); -int grib_keys_iterator_get_long(const grib_keys_iterator *kiter, long *v, size_t *len); -int grib_keys_iterator_get_double(const grib_keys_iterator *kiter, double *v, size_t *len); -int grib_keys_iterator_get_string(const grib_keys_iterator *kiter, char *v, size_t *len); -int grib_keys_iterator_get_bytes(const grib_keys_iterator *kiter, unsigned char *v, size_t *len); -int codes_copy_key(grib_handle* h1,grib_handle* h2,const char* key,int type); +int grib_keys_iterator_get_long(const grib_keys_iterator* kiter, long* v, size_t* len); +int grib_keys_iterator_get_double(const grib_keys_iterator* kiter, double* v, size_t* len); +int grib_keys_iterator_get_string(const grib_keys_iterator* kiter, char* v, size_t* len); +int grib_keys_iterator_get_bytes(const grib_keys_iterator* kiter, unsigned char* v, size_t* len); +int codes_copy_key(grib_handle* h1, grib_handle* h2, const char* key, int type); /* @} */ @@ -1326,49 +1335,50 @@ void grib_update_sections_lengths(grib_handle* h); const char* grib_get_error_message(int code); const char* grib_get_type_name(int type); -int grib_get_native_type(const grib_handle* h, const char* name,int* type); +int grib_get_native_type(const grib_handle* h, const char* name, int* type); -void grib_check(const char* call,const char* file,int line,int e,const char* msg); -#define GRIB_CHECK(a,msg) grib_check(#a,__FILE__,__LINE__,a,msg) -#define GRIB_CHECK_NOLINE(a,msg) grib_check(#a,0,0,a,msg) +void grib_check(const char* call, const char* file, int line, int e, const char* msg); +#define GRIB_CHECK(a, msg) grib_check(#a, __FILE__, __LINE__, a, msg) +#define GRIB_CHECK_NOLINE(a, msg) grib_check(#a, 0, 0, a, msg) -int grib_set_values(grib_handle* h,grib_values* grib_values , size_t arg_count); +int grib_set_values(grib_handle* h, grib_values* grib_values, size_t arg_count); grib_handle* grib_handle_new_from_partial_message_copy(grib_context* c, const void* data, size_t size); grib_handle* grib_handle_new_from_partial_message(grib_context* c, const void* data, size_t buflen); int grib_is_missing(const grib_handle* h, const char* key, int* err); int grib_is_defined(const grib_handle* h, const char* key); int grib_set_missing(grib_handle* h, const char* key); /* The truncation is the Gaussian number (or order) */ -int grib_get_gaussian_latitudes(long truncation,double* latitudes); +int grib_get_gaussian_latitudes(long truncation, double* latitudes); -int grib_julian_to_datetime(double jd, long *year, long *month, long *day, long *hour, long *minute, long *second); -int grib_datetime_to_julian(long year, long month, long day, long hour, long minute, long second, double *jd); +int grib_julian_to_datetime(double jd, long* year, long* month, long* day, long* hour, long* minute, long* second); +int grib_datetime_to_julian(long year, long month, long day, long hour, long minute, long second, double* jd); long grib_julian_to_date(long jdate); long grib_date_to_julian(long ddate); -void grib_get_reduced_row(long pl,double lon_first,double lon_last,long* npoints,long* ilon_first, long* ilon_last); -void grib_get_reduced_row_p(long pl, double lon_first, double lon_last, long *npoints, double *olon_first, double *olon_last); +void grib_get_reduced_row(long pl, double lon_first, double lon_last, long* npoints, long* ilon_first, long* ilon_last); +void grib_get_reduced_row_p(long pl, double lon_first, double lon_last, long* npoints, double* olon_first, double* olon_last); /* read products */ -int wmo_read_any_from_file(FILE *f, void *buffer, size_t *len); -int wmo_read_grib_from_file(FILE* f,void* buffer,size_t* len); -int wmo_read_bufr_from_file(FILE* f,void* buffer,size_t* len); -int wmo_read_gts_from_file(FILE* f,void* buffer,size_t* len); -int wmo_read_any_from_stream(void *stream_data, long (*stream_proc )(void *, void *buffer, long len ), void *buffer, size_t *len); +int wmo_read_any_from_file(FILE* f, void* buffer, size_t* len); +int wmo_read_grib_from_file(FILE* f, void* buffer, size_t* len); +int wmo_read_bufr_from_file(FILE* f, void* buffer, size_t* len); +int wmo_read_gts_from_file(FILE* f, void* buffer, size_t* len); +int wmo_read_any_from_stream(void* stream_data, long (*stream_proc)(void*, void* buffer, long len), void* buffer, size_t* len); /* These functions allocate memory for the result so the user is responsible for freeing it */ -void* wmo_read_any_from_stream_malloc(void* stream_data,long (*stream_proc)(void*,void* buffer,long len) ,size_t *size, int* err); -void *wmo_read_any_from_file_malloc(FILE* f,int headers_only,size_t *size,off_t *offset,int* err); -void *wmo_read_gts_from_file_malloc(FILE* f,int headers_only,size_t *size,off_t *offset,int* err); -void *wmo_read_bufr_from_file_malloc(FILE* f,int headers_only,size_t *size,off_t *offset,int* err); -void *wmo_read_grib_from_file_malloc(FILE* f,int headers_only,size_t *size,off_t *offset,int* err); - -int grib_read_any_from_file(grib_context *ctx, FILE *f, void *buffer, size_t *len); -int grib_get_message_offset(const grib_handle* h,off_t* offset); -int grib_get_message_size(const grib_handle* h,size_t* size); - -struct grib_points { +void* wmo_read_any_from_stream_malloc(void* stream_data, long (*stream_proc)(void*, void* buffer, long len), size_t* size, int* err); +void* wmo_read_any_from_file_malloc(FILE* f, int headers_only, size_t* size, off_t* offset, int* err); +void* wmo_read_gts_from_file_malloc(FILE* f, int headers_only, size_t* size, off_t* offset, int* err); +void* wmo_read_bufr_from_file_malloc(FILE* f, int headers_only, size_t* size, off_t* offset, int* err); +void* wmo_read_grib_from_file_malloc(FILE* f, int headers_only, size_t* size, off_t* offset, int* err); + +int grib_read_any_from_file(grib_context* ctx, FILE* f, void* buffer, size_t* len); +int grib_get_message_offset(const grib_handle* h, off_t* offset); +int grib_get_message_size(const grib_handle* h, size_t* size); + +struct grib_points +{ grib_context* context; double* latitudes; double* longitudes; @@ -1380,8 +1390,8 @@ struct grib_points { size_t size; }; -grib_box* grib_box_new(grib_handle* h,int* error); -grib_points* grib_box_get_points(grib_box *box,double north, double west,double south,double east, int *err); +grib_box* grib_box_new(grib_handle* h, int* error); +grib_points* grib_box_get_points(grib_box* box, double north, double west, double south, double east, int* err); int grib_points_get_values(grib_handle* h, grib_points* points, double* val); @@ -1393,70 +1403,70 @@ int grib_points_get_values(grib_handle* h, grib_points* points, double* val); #define GRIB_UTIL_GRID_SPEC_ROTATED_GG 4 #define GRIB_UTIL_GRID_SPEC_REDUCED_GG 5 -#define GRIB_UTIL_GRID_SPEC_SH 6 +#define GRIB_UTIL_GRID_SPEC_SH 6 #define GRIB_UTIL_GRID_SPEC_REDUCED_LL 7 -#define GRIB_UTIL_GRID_SPEC_POLAR_STEREOGRAPHIC 8 -#define GRIB_UTIL_GRID_SPEC_REDUCED_ROTATED_GG 9 +#define GRIB_UTIL_GRID_SPEC_POLAR_STEREOGRAPHIC 8 +#define GRIB_UTIL_GRID_SPEC_REDUCED_ROTATED_GG 9 #define GRIB_UTIL_GRID_SPEC_LAMBERT_AZIMUTHAL_EQUAL_AREA 10 -#define GRIB_UTIL_GRID_SPEC_LAMBERT_CONFORMAL 11 -#define GRIB_UTIL_GRID_SPEC_UNSTRUCTURED 12 - +#define GRIB_UTIL_GRID_SPEC_LAMBERT_CONFORMAL 11 +#define GRIB_UTIL_GRID_SPEC_UNSTRUCTURED 12 -typedef struct grib_util_grid_spec { - int grid_type; +typedef struct grib_util_grid_spec +{ + int grid_type; - /* Grid */ - long Ni; - long Nj; + /* Grid */ + long Ni; + long Nj; - double iDirectionIncrementInDegrees; - double jDirectionIncrementInDegrees; + double iDirectionIncrementInDegrees; + double jDirectionIncrementInDegrees; - double longitudeOfFirstGridPointInDegrees; - double longitudeOfLastGridPointInDegrees; + double longitudeOfFirstGridPointInDegrees; + double longitudeOfLastGridPointInDegrees; - double latitudeOfFirstGridPointInDegrees; - double latitudeOfLastGridPointInDegrees; + double latitudeOfFirstGridPointInDegrees; + double latitudeOfLastGridPointInDegrees; - /* Rotation */ - long uvRelativeToGrid; - double latitudeOfSouthernPoleInDegrees; - double longitudeOfSouthernPoleInDegrees; + /* Rotation */ + long uvRelativeToGrid; + double latitudeOfSouthernPoleInDegrees; + double longitudeOfSouthernPoleInDegrees; - /* Scanning mode */ - long iScansNegatively; - long jScansPositively; + /* Scanning mode */ + long iScansNegatively; + long jScansPositively; - /* Gaussian number */ - long N; + /* Gaussian number */ + long N; - /* bitmap */ - long bitmapPresent; - double missingValue; + /* bitmap */ + long bitmapPresent; + double missingValue; - /* pl list for reduced */ - const long *pl; - long pl_size; + /* pl list for reduced */ + const long* pl; + long pl_size; - /* Spherical harmonics */ - long truncation; + /* Spherical harmonics */ + long truncation; - /* polar stereographic */ - double orientationOfTheGridInDegrees; - long DyInMetres; - long DxInMetres; + /* polar stereographic */ + double orientationOfTheGridInDegrees; + long DyInMetres; + long DxInMetres; } grib_util_grid_spec; -typedef struct grib_util_grid_spec2 { - +typedef struct grib_util_grid_spec2 +{ int grid_type; const char* grid_name; /* e.g. N320 */ /* Grid */ - long Ni; - long Nj; + long Ni; + long Nj; double iDirectionIncrementInDegrees; double jDirectionIncrementInDegrees; @@ -1485,7 +1495,7 @@ typedef struct grib_util_grid_spec2 { double missingValue; /* pl list for reduced */ - const long *pl; + const long* pl; long pl_size; /* Spherical harmonics */ @@ -1498,72 +1508,73 @@ typedef struct grib_util_grid_spec2 { } grib_util_grid_spec2; -#define GRIB_UTIL_PACKING_TYPE_SAME_AS_INPUT 0 -#define GRIB_UTIL_PACKING_TYPE_SPECTRAL_COMPLEX 1 -#define GRIB_UTIL_PACKING_TYPE_SPECTRAL_SIMPLE 2 -#define GRIB_UTIL_PACKING_TYPE_JPEG 3 -#define GRIB_UTIL_PACKING_TYPE_GRID_COMPLEX 4 -#define GRIB_UTIL_PACKING_TYPE_GRID_SIMPLE 5 -#define GRIB_UTIL_PACKING_TYPE_GRID_SIMPLE_MATRIX 6 -#define GRIB_UTIL_PACKING_TYPE_GRID_SECOND_ORDER 7 -#define GRIB_UTIL_PACKING_TYPE_CCSDS 8 - -#define GRIB_UTIL_PACKING_SAME_AS_INPUT 0 -#define GRIB_UTIL_PACKING_USE_PROVIDED 1 - -#define GRIB_UTIL_ACCURACY_SAME_BITS_PER_VALUES_AS_INPUT 0 -#define GRIB_UTIL_ACCURACY_USE_PROVIDED_BITS_PER_VALUES 1 +#define GRIB_UTIL_PACKING_TYPE_SAME_AS_INPUT 0 +#define GRIB_UTIL_PACKING_TYPE_SPECTRAL_COMPLEX 1 +#define GRIB_UTIL_PACKING_TYPE_SPECTRAL_SIMPLE 2 +#define GRIB_UTIL_PACKING_TYPE_JPEG 3 +#define GRIB_UTIL_PACKING_TYPE_GRID_COMPLEX 4 +#define GRIB_UTIL_PACKING_TYPE_GRID_SIMPLE 5 +#define GRIB_UTIL_PACKING_TYPE_GRID_SIMPLE_MATRIX 6 +#define GRIB_UTIL_PACKING_TYPE_GRID_SECOND_ORDER 7 +#define GRIB_UTIL_PACKING_TYPE_CCSDS 8 + +#define GRIB_UTIL_PACKING_SAME_AS_INPUT 0 +#define GRIB_UTIL_PACKING_USE_PROVIDED 1 + +#define GRIB_UTIL_ACCURACY_SAME_BITS_PER_VALUES_AS_INPUT 0 +#define GRIB_UTIL_ACCURACY_USE_PROVIDED_BITS_PER_VALUES 1 #define GRIB_UTIL_ACCURACY_SAME_DECIMAL_SCALE_FACTOR_AS_INPUT 2 -#define GRIB_UTIL_ACCURACY_USE_PROVIDED_DECIMAL_SCALE_FACTOR 3 - -typedef struct grib_util_packing_spec { +#define GRIB_UTIL_ACCURACY_USE_PROVIDED_DECIMAL_SCALE_FACTOR 3 - /* Packing options */ - long packing_type; - long packing; - long boustrophedonic; +typedef struct grib_util_packing_spec +{ + /* Packing options */ + long packing_type; + long packing; + long boustrophedonic; - long editionNumber; /* =0 for default value */ + long editionNumber; /* =0 for default value */ - /* Accuracy */ - long accuracy; - long bitsPerValue; - long decimalScaleFactor; + /* Accuracy */ + long accuracy; + long bitsPerValue; + long decimalScaleFactor; - long computeLaplacianOperator; - int truncateLaplacian; - double laplacianOperator; + long computeLaplacianOperator; + int truncateLaplacian; + double laplacianOperator; - /* local definition */ - long deleteLocalDefinition; /* default(=0) local definition is taken from the input field */ + /* local definition */ + long deleteLocalDefinition; /* default(=0) local definition is taken from the input field */ - /* Extra values when packing */ - grib_values extra_settings[80]; - long extra_settings_count; + /* Extra values when packing */ + grib_values extra_settings[80]; + long extra_settings_count; } grib_util_packing_spec; -grib_handle *grib_util_set_spec(grib_handle *h, - const grib_util_grid_spec *grid_spec, - const grib_util_packing_spec *packing_spec, /* NULL for defaults (same as input) */ - int flags, - const double *data_values, - size_t data_values_count, - int *err); +grib_handle* grib_util_set_spec(grib_handle* h, + const grib_util_grid_spec* grid_spec, + const grib_util_packing_spec* packing_spec, /* NULL for defaults (same as input) */ + int flags, + const double* data_values, + size_t data_values_count, + int* err); -grib_handle *grib_util_set_spec2(grib_handle *h, - const grib_util_grid_spec2 *grid_spec, - const grib_util_packing_spec *packing_spec, /* NULL for defaults (same as input) */ - int flags, - const double *data_values, - size_t data_values_count, - int *err); +grib_handle* grib_util_set_spec2(grib_handle* h, + const grib_util_grid_spec2* grid_spec, + const grib_util_packing_spec* packing_spec, /* NULL for defaults (same as input) */ + int flags, + const double* data_values, + size_t data_values_count, + int* err); -int parse_keyval_string(const char *grib_tool, char *arg, int values_required, int default_type, grib_values values[], int *count); -grib_handle *grib_new_from_file(grib_context *c, FILE *f, int headers_only, int *error); +int parse_keyval_string(const char* grib_tool, char* arg, int values_required, int default_type, grib_values values[], int* count); +grib_handle* grib_new_from_file(grib_context* c, FILE* f, int headers_only, int* error); /* EXPERIMENTAL */ -typedef struct codes_bufr_header { +typedef struct codes_bufr_header +{ unsigned long message_offset; unsigned long message_size; @@ -1616,18 +1627,18 @@ typedef struct codes_bufr_header { long rectimeMinute; long rectimeSecond; - long isSatellite; + long isSatellite; double localLongitude1; double localLatitude1; double localLongitude2; double localLatitude2; double localLatitude; double localLongitude; - long localNumberOfObservations; - long satelliteID; - long qualityControl; - long newSubtype; - long daLoop; + long localNumberOfObservations; + long satelliteID; + long qualityControl; + long newSubtype; + long daLoop; /* Section 3 keys */ unsigned long numberOfSubsets; @@ -1653,140 +1664,140 @@ Error codes returned by the grib_api functions. */ /*! @{*/ /** No error */ -#define GRIB_SUCCESS 0 +#define GRIB_SUCCESS 0 /** End of resource reached */ -#define GRIB_END_OF_FILE -1 +#define GRIB_END_OF_FILE -1 /** Internal error */ -#define GRIB_INTERNAL_ERROR -2 +#define GRIB_INTERNAL_ERROR -2 /** Passed buffer is too small */ -#define GRIB_BUFFER_TOO_SMALL -3 +#define GRIB_BUFFER_TOO_SMALL -3 /** Function not yet implemented */ -#define GRIB_NOT_IMPLEMENTED -4 +#define GRIB_NOT_IMPLEMENTED -4 /** Missing 7777 at end of message */ -#define GRIB_7777_NOT_FOUND -5 +#define GRIB_7777_NOT_FOUND -5 /** Passed array is too small */ -#define GRIB_ARRAY_TOO_SMALL -6 +#define GRIB_ARRAY_TOO_SMALL -6 /** File not found */ -#define GRIB_FILE_NOT_FOUND -7 +#define GRIB_FILE_NOT_FOUND -7 /** Code not found in code table */ -#define GRIB_CODE_NOT_FOUND_IN_TABLE -8 +#define GRIB_CODE_NOT_FOUND_IN_TABLE -8 /** Array size mismatch */ -#define GRIB_WRONG_ARRAY_SIZE -9 +#define GRIB_WRONG_ARRAY_SIZE -9 /** Key/value not found */ -#define GRIB_NOT_FOUND -10 +#define GRIB_NOT_FOUND -10 /** Input output problem */ -#define GRIB_IO_PROBLEM -11 +#define GRIB_IO_PROBLEM -11 /** Message invalid */ -#define GRIB_INVALID_MESSAGE -12 +#define GRIB_INVALID_MESSAGE -12 /** Decoding invalid */ -#define GRIB_DECODING_ERROR -13 +#define GRIB_DECODING_ERROR -13 /** Encoding invalid */ -#define GRIB_ENCODING_ERROR -14 +#define GRIB_ENCODING_ERROR -14 /** Code cannot unpack because of string too small */ -#define GRIB_NO_MORE_IN_SET -15 +#define GRIB_NO_MORE_IN_SET -15 /** Problem with calculation of geographic attributes */ -#define GRIB_GEOCALCULUS_PROBLEM -16 +#define GRIB_GEOCALCULUS_PROBLEM -16 /** Memory allocation error */ -#define GRIB_OUT_OF_MEMORY -17 +#define GRIB_OUT_OF_MEMORY -17 /** Value is read only */ -#define GRIB_READ_ONLY -18 +#define GRIB_READ_ONLY -18 /** Invalid argument */ -#define GRIB_INVALID_ARGUMENT -19 +#define GRIB_INVALID_ARGUMENT -19 /** Null handle */ -#define GRIB_NULL_HANDLE -20 +#define GRIB_NULL_HANDLE -20 /** Invalid section number */ -#define GRIB_INVALID_SECTION_NUMBER -21 +#define GRIB_INVALID_SECTION_NUMBER -21 /** Value cannot be missing */ -#define GRIB_VALUE_CANNOT_BE_MISSING -22 +#define GRIB_VALUE_CANNOT_BE_MISSING -22 /** Wrong message length */ -#define GRIB_WRONG_LENGTH -23 +#define GRIB_WRONG_LENGTH -23 /** Invalid key type */ -#define GRIB_INVALID_TYPE -24 +#define GRIB_INVALID_TYPE -24 /** Unable to set step */ -#define GRIB_WRONG_STEP -25 +#define GRIB_WRONG_STEP -25 /** Wrong units for step (step must be integer) */ -#define GRIB_WRONG_STEP_UNIT -26 +#define GRIB_WRONG_STEP_UNIT -26 /** Invalid file id */ -#define GRIB_INVALID_FILE -27 +#define GRIB_INVALID_FILE -27 /** Invalid grib id */ -#define GRIB_INVALID_GRIB -28 +#define GRIB_INVALID_GRIB -28 /** Invalid index id */ -#define GRIB_INVALID_INDEX -29 +#define GRIB_INVALID_INDEX -29 /** Invalid iterator id */ -#define GRIB_INVALID_ITERATOR -30 +#define GRIB_INVALID_ITERATOR -30 /** Invalid keys iterator id */ -#define GRIB_INVALID_KEYS_ITERATOR -31 +#define GRIB_INVALID_KEYS_ITERATOR -31 /** Invalid nearest id */ -#define GRIB_INVALID_NEAREST -32 +#define GRIB_INVALID_NEAREST -32 /** Invalid order by */ -#define GRIB_INVALID_ORDERBY -33 +#define GRIB_INVALID_ORDERBY -33 /** Missing a key from the fieldset */ -#define GRIB_MISSING_KEY -34 +#define GRIB_MISSING_KEY -34 /** The point is out of the grid area */ -#define GRIB_OUT_OF_AREA -35 +#define GRIB_OUT_OF_AREA -35 /** Concept no match */ -#define GRIB_CONCEPT_NO_MATCH -36 +#define GRIB_CONCEPT_NO_MATCH -36 /** Hash array no match */ -#define GRIB_HASH_ARRAY_NO_MATCH -37 +#define GRIB_HASH_ARRAY_NO_MATCH -37 /** Definitions files not found */ -#define GRIB_NO_DEFINITIONS -38 +#define GRIB_NO_DEFINITIONS -38 /** Wrong type while packing */ -#define GRIB_WRONG_TYPE -39 +#define GRIB_WRONG_TYPE -39 /** End of resource */ -#define GRIB_END -40 +#define GRIB_END -40 /** Unable to code a field without values */ -#define GRIB_NO_VALUES -41 +#define GRIB_NO_VALUES -41 /** Grid description is wrong or inconsistent */ -#define GRIB_WRONG_GRID -42 +#define GRIB_WRONG_GRID -42 /** End of index reached */ -#define GRIB_END_OF_INDEX -43 +#define GRIB_END_OF_INDEX -43 /** Null index */ -#define GRIB_NULL_INDEX -44 +#define GRIB_NULL_INDEX -44 /** End of resource reached when reading message */ -#define GRIB_PREMATURE_END_OF_FILE -45 +#define GRIB_PREMATURE_END_OF_FILE -45 /** An internal array is too small */ -#define GRIB_INTERNAL_ARRAY_TOO_SMALL -46 +#define GRIB_INTERNAL_ARRAY_TOO_SMALL -46 /** Message is too large for the current architecture */ -#define GRIB_MESSAGE_TOO_LARGE -47 +#define GRIB_MESSAGE_TOO_LARGE -47 /** Constant field */ -#define GRIB_CONSTANT_FIELD -48 +#define GRIB_CONSTANT_FIELD -48 /** Switch unable to find a matching case */ -#define GRIB_SWITCH_NO_MATCH -49 +#define GRIB_SWITCH_NO_MATCH -49 /** Underflow */ -#define GRIB_UNDERFLOW -50 +#define GRIB_UNDERFLOW -50 /** Message malformed */ -#define GRIB_MESSAGE_MALFORMED -51 +#define GRIB_MESSAGE_MALFORMED -51 /** Index is corrupted */ -#define GRIB_CORRUPTED_INDEX -52 +#define GRIB_CORRUPTED_INDEX -52 /** Invalid number of bits per value */ -#define GRIB_INVALID_BPV -53 +#define GRIB_INVALID_BPV -53 /** Edition of two messages is different */ -#define GRIB_DIFFERENT_EDITION -54 +#define GRIB_DIFFERENT_EDITION -54 /** Value is different */ -#define GRIB_VALUE_DIFFERENT -55 +#define GRIB_VALUE_DIFFERENT -55 /** Invalid key value */ -#define GRIB_INVALID_KEY_VALUE -56 +#define GRIB_INVALID_KEY_VALUE -56 /** String is smaller than requested */ -#define GRIB_STRING_TOO_SMALL -57 +#define GRIB_STRING_TOO_SMALL -57 /** Wrong type conversion */ -#define GRIB_WRONG_CONVERSION -58 +#define GRIB_WRONG_CONVERSION -58 /** Missing BUFR table entry for descriptor */ -#define GRIB_MISSING_BUFR_ENTRY -59 +#define GRIB_MISSING_BUFR_ENTRY -59 /** Null pointer */ -#define GRIB_NULL_POINTER -60 +#define GRIB_NULL_POINTER -60 /** Attribute is already present, cannot add */ -#define GRIB_ATTRIBUTE_CLASH -61 +#define GRIB_ATTRIBUTE_CLASH -61 /** Too many attributes. Increase MAX_ACCESSOR_ATTRIBUTES */ -#define GRIB_TOO_MANY_ATTRIBUTES -62 +#define GRIB_TOO_MANY_ATTRIBUTES -62 /** Attribute not found. */ -#define GRIB_ATTRIBUTE_NOT_FOUND -63 +#define GRIB_ATTRIBUTE_NOT_FOUND -63 /** Edition not supported. */ -#define GRIB_UNSUPPORTED_EDITION -64 +#define GRIB_UNSUPPORTED_EDITION -64 /** Value out of coding range */ -#define GRIB_OUT_OF_RANGE -65 +#define GRIB_OUT_OF_RANGE -65 /** Size of bitmap is incorrect */ -#define GRIB_WRONG_BITMAP_SIZE -66 +#define GRIB_WRONG_BITMAP_SIZE -66 /** Functionality not enabled */ -#define GRIB_FUNCTIONALITY_NOT_ENABLED -67 +#define GRIB_FUNCTIONALITY_NOT_ENABLED -67 /*! @}*/ #endif diff --git a/src/grib_api_internal.h b/src/grib_api_internal.h index fa1e7d167..48d3fd279 100644 --- a/src/grib_api_internal.h +++ b/src/grib_api_internal.h @@ -18,40 +18,40 @@ #ifdef __cplusplus - extern "C" { +extern "C" { #endif /* cmake config header */ #ifdef HAVE_ECCODES_CONFIG_H - #include "eccodes_config.h" +#include "eccodes_config.h" #endif /* autoconf config header */ #ifdef HAVE_CONFIG_H - #include "config.h" - #ifdef _LARGE_FILES - #undef _LARGE_FILE_API - #endif +#include "config.h" +#ifdef _LARGE_FILES +#undef _LARGE_FILE_API +#endif #endif #ifndef GRIB_INLINE - #define GRIB_INLINE +#define GRIB_INLINE #endif #if IS_BIG_ENDIAN - #if GRIB_MEM_ALIGN - #define FAST_BIG_ENDIAN 0 - #else - #define FAST_BIG_ENDIAN 1 - #endif +#if GRIB_MEM_ALIGN +#define FAST_BIG_ENDIAN 0 +#else +#define FAST_BIG_ENDIAN 1 +#endif #endif #if IEEE_BE - #define IEEE +#define IEEE #else - #if IEEE_LE - #define IEEE - #endif +#if IEEE_LE +#define IEEE +#endif #endif #include @@ -61,46 +61,46 @@ #include "eccodes_windef.h" #ifndef ECCODES_ON_WINDOWS - #include - #include - #include - #define ecc_snprintf snprintf +#include +#include +#include +#define ecc_snprintf snprintf #else - #include - #include +#include +#include - /* Replace C99/Unix rint() for Windows Visual C++ (only before VC++ 2013 versions) */ - #if defined _MSC_VER && _MSC_VER < 1800 - double rint(double x); - #endif +/* Replace C99/Unix rint() for Windows Visual C++ (only before VC++ 2013 versions) */ +#if defined _MSC_VER && _MSC_VER < 1800 +double rint(double x); +#endif - #ifndef S_ISREG - #define S_ISREG(mode) (mode & S_IFREG) - #endif +#ifndef S_ISREG +#define S_ISREG(mode) (mode & S_IFREG) +#endif - #ifndef S_ISDIR - #define S_ISDIR(mode) (mode & S_IFDIR) - #endif +#ifndef S_ISDIR +#define S_ISDIR(mode) (mode & S_IFDIR) +#endif - #ifndef M_PI - #define M_PI 3.14159265358979323846 - #endif +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif - #define R_OK 04 /* Needed for Windows */ +#define R_OK 04 /* Needed for Windows */ - # ifndef F_OK - # define F_OK 0 - # endif +#ifndef F_OK +#define F_OK 0 +#endif - # define mkdir(dirname,mode) _mkdir(dirname) +#define mkdir(dirname, mode) _mkdir(dirname) - # ifdef _MSC_VER - # define access(path,mode) _access(path,mode) - # define chmod(path,mode) _chmod(path,mode) - # define strdup(str) _strdup(str) - # endif +#ifdef _MSC_VER +#define access(path, mode) _access(path, mode) +#define chmod(path, mode) _chmod(path, mode) +#define strdup(str) _strdup(str) +#endif - #define ecc_snprintf _snprintf +#define ecc_snprintf _snprintf #endif @@ -111,89 +111,98 @@ #include -#ifdef HAVE_STRING_H - #include +#ifdef HAVE_STRING_H +#include #else - #include +#include #endif #if GRIB_LINUX_PTHREADS - extern int pthread_mutexattr_settype(pthread_mutexattr_t* attr,int type); +extern int pthread_mutexattr_settype(pthread_mutexattr_t* attr, int type); #endif #if GRIB_PTHREADS - #include - #define GRIB_MUTEX_INIT_ONCE(a,b) pthread_once(a,b); - #define GRIB_MUTEX_LOCK(a) pthread_mutex_lock(a); - #define GRIB_MUTEX_UNLOCK(a) pthread_mutex_unlock(a); - /* +#include +#define GRIB_MUTEX_INIT_ONCE(a, b) pthread_once(a, b); +#define GRIB_MUTEX_LOCK(a) pthread_mutex_lock(a); +#define GRIB_MUTEX_UNLOCK(a) pthread_mutex_unlock(a); +/* #define GRIB_MUTEX_LOCK(a) {pthread_mutex_lock(a); printf("MUTEX LOCK %p %s line %d\n",(void*)a,__FILE__,__LINE__);} #define GRIB_MUTEX_UNLOCK(a) {pthread_mutex_unlock(a);printf("MUTEX UNLOCK %p %s line %d\n",(void*)a,__FILE__,__LINE__);} */ #elif GRIB_OMP_THREADS - #include - #ifdef _MSC_VER - #define GRIB_OMP_CRITICAL(a) __pragma(omp critical (a)) - #else - #define GRIB_OMP_STR(a) #a - #define GRIB_OMP_XSTR(a) GRIB_OMP_STR(a) - #define GRIB_OMP_CRITICAL(a) _Pragma( GRIB_OMP_XSTR(omp critical (a) ) ) - #endif - #define GRIB_MUTEX_INIT_ONCE(a,b) (*(b))(); - #define GRIB_MUTEX_LOCK(a) omp_set_nest_lock(a); - #define GRIB_MUTEX_UNLOCK(a) omp_unset_nest_lock(a); +#include +#ifdef _MSC_VER +#define GRIB_OMP_CRITICAL(a) __pragma(omp critical(a)) +#else +#define GRIB_OMP_STR(a) #a +#define GRIB_OMP_XSTR(a) GRIB_OMP_STR(a) +#define GRIB_OMP_CRITICAL(a) _Pragma(GRIB_OMP_XSTR(omp critical(a))) +#endif +#define GRIB_MUTEX_INIT_ONCE(a, b) (*(b))(); +#define GRIB_MUTEX_LOCK(a) omp_set_nest_lock(a); +#define GRIB_MUTEX_UNLOCK(a) omp_unset_nest_lock(a); #else - #define GRIB_MUTEX_INIT_ONCE(a,b) - #define GRIB_MUTEX_LOCK(a) - #define GRIB_MUTEX_UNLOCK(a) +#define GRIB_MUTEX_INIT_ONCE(a, b) +#define GRIB_MUTEX_LOCK(a) +#define GRIB_MUTEX_UNLOCK(a) #endif #if GRIB_LINUX_PTHREADS - /* Note: in newer pthreads PTHREAD_MUTEX_RECURSIVE and PTHREAD_MUTEX_RECURSIVE_NP are enums */ - #if !defined (PTHREAD_MUTEX_RECURSIVE) - #define PTHREAD_MUTEX_RECURSIVE PTHREAD_MUTEX_RECURSIVE_NP - #endif +/* Note: in newer pthreads PTHREAD_MUTEX_RECURSIVE and PTHREAD_MUTEX_RECURSIVE_NP are enums */ +#if !defined(PTHREAD_MUTEX_RECURSIVE) +#define PTHREAD_MUTEX_RECURSIVE PTHREAD_MUTEX_RECURSIVE_NP +#endif #endif #ifndef HAVE_FSEEKO - #define fseeko fseek - #define ftello ftell +#define fseeko fseek +#define ftello ftell #endif -#define Assert(a) do { if(!(a)) codes_assertion_failed(#a, __FILE__, __LINE__); } while(0) +#define Assert(a) \ + do { \ + if (!(a)) codes_assertion_failed(#a, __FILE__, __LINE__); \ + } while (0) #ifdef __gnu_hurd__ - #define COMPILE_TIME_ASSERT(condition) \ - extern int compile_time_assert[!!(condition) - 1] +#define COMPILE_TIME_ASSERT(condition) \ + extern int compile_time_assert[!!(condition)-1] #else - /* Compile time assertion - Thanks to Ralf Holly */ - #define COMPILE_TIME_ASSERT(condition) \ - do { \ - enum { assert_static__ = 1/(condition) }; \ - } while (0) +/* Compile time assertion - Thanks to Ralf Holly */ +#define COMPILE_TIME_ASSERT(condition) \ + do { \ + enum \ + { \ + assert_static__ = 1 / (condition) \ + }; \ + } while (0) #endif #ifdef DEBUG - #define DebugAssert(a) Assert(a) - #define DebugAssertAccess(array, index, size) \ - do { \ - if (!((index) >= 0 && (index) < (size)) ) {printf("ARRAY ACCESS ERROR: array=%s idx=%ld size=%ld @ %s +%d \n", #array, index, size, __FILE__, __LINE__); abort();} \ - } while(0) +#define DebugAssert(a) Assert(a) +#define DebugAssertAccess(array, index, size) \ + do { \ + if (!((index) >= 0 && (index) < (size))) { \ + printf("ARRAY ACCESS ERROR: array=%s idx=%ld size=%ld @ %s +%d \n", #array, index, size, __FILE__, __LINE__); \ + abort(); \ + } \ + } while (0) #else - #define DebugAssert(a) - #define DebugAssertAccess(array, index, size) +#define DebugAssert(a) +#define DebugAssertAccess(array, index, size) #endif /* Return true if two strings are equal */ -#define STR_EQ(a, b) (strcmp ((a), (b)) == 0) +#define STR_EQ(a, b) (strcmp((a), (b)) == 0) #include "grib_api.h" -#define GRIB_UNKNOWN_VALUE -9999.999 +#define GRIB_UNKNOWN_VALUE -9999.999 #define GRIB_KEY_UNDEF "undef" -#define GRIB_HANDLE_BIG_ECMWF_GRIB1 1 +#define GRIB_HANDLE_BIG_ECMWF_GRIB1 1 #define MAX_ACCESSOR_ATTRIBUTES 20 #define MAX_FILE_HANDLES_WITH_MULTI 10 @@ -201,176 +210,177 @@ #define MAX_NUM_CONCEPTS 2000 #define MAX_NUM_HASH_ARRAY 2000 -#define GRIB_NAMESPACE 10 -#define MAX_NAMESPACE_LEN 64 +#define GRIB_NAMESPACE 10 +#define MAX_NAMESPACE_LEN 64 -#define GRIB_MY_BUFFER 0 -#define GRIB_USER_BUFFER 1 +#define GRIB_MY_BUFFER 0 +#define GRIB_USER_BUFFER 1 -#define GRIB_REAL_MODE4 4 -#define GRIB_REAL_MODE8 8 +#define GRIB_REAL_MODE4 4 +#define GRIB_REAL_MODE8 8 -#define MAX_NUM_SECTIONS 12 +#define MAX_NUM_SECTIONS 12 -#define GRIB_DISPOSABLE_MEMORY 0 -#define GRIB_LONG_LASTING_MEMORY 1 +#define GRIB_DISPOSABLE_MEMORY 0 +#define GRIB_LONG_LASTING_MEMORY 1 -#define GRIB_LOG_PERROR (1<<10) +#define GRIB_LOG_PERROR (1 << 10) #define GRIB_HASH_ARRAY_TYPE_UNKNOWN 0 #define GRIB_HASH_ARRAY_TYPE_INTEGER 1 -#define GRIB_HASH_ARRAY_TYPE_DOUBLE 2 -#define GRIB_HASH_ARRAY_TYPE_STRING 3 +#define GRIB_HASH_ARRAY_TYPE_DOUBLE 2 +#define GRIB_HASH_ARRAY_TYPE_STRING 3 -#define CODES_GRIB 1 -#define CODES_BUFR 2 -#define CODES_METAR 3 -#define CODES_GTS 4 +#define CODES_GRIB 1 +#define CODES_BUFR 2 +#define CODES_METAR 3 +#define CODES_GTS 4 #define CODES_BUFR_UNPACK_STRUCTURE 0 -#define CODES_BUFR_UNPACK_FLAT 1 -#define CODES_BUFR_NEW_DATA 2 +#define CODES_BUFR_UNPACK_FLAT 1 +#define CODES_BUFR_NEW_DATA 2 #define MAX_SMART_TABLE_COLUMNS 20 #define MAX_CODETABLE_ENTRIES 65536 /* ACCESSOR COMPARE FLAGS */ -#define GRIB_COMPARE_NAMES (1<<0) -#define GRIB_COMPARE_TYPES (1<<1) - -typedef struct grib_expression grib_expression; -typedef struct grib_arguments grib_arguments; - -typedef struct grib_action_file grib_action_file; -typedef struct grib_action_file_list grib_action_file_list; -typedef struct grib_block_of_accessors grib_block_of_accessors; -typedef struct grib_buffer grib_buffer; -typedef struct grib_accessor_class grib_accessor_class; -typedef struct grib_action grib_action; -typedef struct grib_action_class grib_action_class; -typedef struct grib_section grib_section; -typedef struct grib_packer grib_packer; -typedef struct grib_codetable grib_codetable; -typedef struct grib_smart_table grib_smart_table; - -typedef struct grib_accessor grib_accessor; -typedef struct grib_iterator_class grib_iterator_class; -typedef struct grib_nearest_class grib_nearest_class; -typedef struct grib_box_class grib_box_class; -typedef struct grib_dumper grib_dumper; -typedef struct grib_dumper_class grib_dumper_class; -typedef struct grib_dependency grib_dependency; -typedef struct string_feed string_feed; +#define GRIB_COMPARE_NAMES (1 << 0) +#define GRIB_COMPARE_TYPES (1 << 1) + +typedef struct grib_expression grib_expression; +typedef struct grib_arguments grib_arguments; + +typedef struct grib_action_file grib_action_file; +typedef struct grib_action_file_list grib_action_file_list; +typedef struct grib_block_of_accessors grib_block_of_accessors; +typedef struct grib_buffer grib_buffer; +typedef struct grib_accessor_class grib_accessor_class; +typedef struct grib_action grib_action; +typedef struct grib_action_class grib_action_class; +typedef struct grib_section grib_section; +typedef struct grib_packer grib_packer; +typedef struct grib_codetable grib_codetable; +typedef struct grib_smart_table grib_smart_table; + +typedef struct grib_accessor grib_accessor; +typedef struct grib_iterator_class grib_iterator_class; +typedef struct grib_nearest_class grib_nearest_class; +typedef struct grib_box_class grib_box_class; +typedef struct grib_dumper grib_dumper; +typedef struct grib_dumper_class grib_dumper_class; +typedef struct grib_dependency grib_dependency; +typedef struct string_feed string_feed; typedef struct codes_condition codes_condition; /* typedef void (*dynamic_key_proc) (const char*, void*) */ -typedef void (*nearest_init_class_proc) (grib_nearest_class*); -typedef int (*nearest_init_proc) (grib_nearest* i,grib_handle*,grib_arguments*); - -typedef int (*nearest_find_proc) (grib_nearest* nearest, grib_handle* h, - double inlat, double inlon, - unsigned long flags, double* outlats, - double* outlons,double *values, - double* distances, int* indexes,size_t *len); -typedef int (*nearest_destroy_proc) (grib_nearest* nearest); - -typedef void (*box_init_class_proc) (grib_box_class*); -typedef int (*box_destroy_proc) (grib_box*); -typedef int (*box_init_proc) (grib_box* ,grib_handle*,grib_arguments*); -typedef grib_points* (*box_get_points_proc) (grib_box*, double, double, double,double, int*); - -typedef void (*iterator_init_class_proc) (grib_iterator_class*); -typedef int (*iterator_init_proc) (grib_iterator* i,grib_handle*,grib_arguments*); - -typedef int (*iterator_next_proc) (grib_iterator* i, double *lat, double *lon, double *val); -typedef int (*iterator_previous_proc) (grib_iterator* i, double *lat, double *lon, double *val); -typedef int (*iterator_reset_proc) (grib_iterator* i); -typedef int (*iterator_destroy_proc) (grib_iterator* i); -typedef long (*iterator_has_next_proc) (grib_iterator* i); - -typedef int (*grib_pack_proc) (grib_handle* h,const double* in, size_t inlen, void* out, size_t* outlen); -typedef int (*grib_unpack_proc) (grib_handle* h,const void* in, size_t inlen, double* out, size_t* outlen); - - -typedef void (*accessor_destroy_proc) (grib_context* , grib_accessor* ); - -typedef int (*accessor_unpack_long_proc) (grib_accessor*, long*, size_t *len); -typedef int (*accessor_unpack_double_proc) (grib_accessor*, double*, size_t *len); -typedef int (*accessor_unpack_double_element_proc) (grib_accessor*, size_t, double*); -typedef int (*accessor_unpack_double_subarray_proc) (grib_accessor*, double*,size_t , size_t); -typedef int (*accessor_unpack_string_proc) (grib_accessor*, char*, size_t *len); -typedef int (*accessor_unpack_string_array_proc) (grib_accessor*, char**, size_t *len); -typedef int (*accessor_unpack_bytes_proc) (grib_accessor*, unsigned char*, size_t *len); -typedef int (*accessor_get_native_type_proc) (grib_accessor*); -typedef int (*accessor_notify_change_proc) (grib_accessor*,grib_accessor*); -typedef void (*accessor_update_size_proc) (grib_accessor*,size_t); -typedef size_t (*accessor_preferred_size_proc) (grib_accessor*,int); -typedef void (*accessor_resize_proc) (grib_accessor*,size_t); - -typedef grib_accessor* (*accessor_next_proc) (grib_accessor*,int); -typedef grib_section* (*accessor_sub_section_proc) (grib_accessor*); - - -typedef int (*accessor_pack_missing_proc) (grib_accessor*); -typedef int (*accessor_pack_is_missing_proc) (grib_accessor*); -typedef int (*accessor_pack_long_proc) (grib_accessor*, const long*, size_t *len); -typedef int (*accessor_pack_double_proc) (grib_accessor*, const double*, size_t *len); -typedef int (*accessor_pack_string_proc) (grib_accessor*, const char*, size_t *len); -typedef int (*accessor_pack_string_array_proc) (grib_accessor*, const char**, size_t *len); -typedef int (*accessor_pack_bytes_proc) (grib_accessor*, const unsigned char*, size_t *len); -typedef int (*accessor_pack_expression_proc) (grib_accessor*, grib_expression*); -typedef int (*accessor_clear_proc) (grib_accessor*); -typedef grib_accessor* (*accessor_clone_proc) (grib_accessor*,grib_section*,int*); - -typedef void (*accessor_init_class_proc) (grib_accessor_class*); - -typedef int (*accessor_compare_proc) (grib_accessor*, grib_accessor*); -typedef size_t (*accessor_string_proc) (grib_accessor*); -typedef int (*accessor_value_with_ret_proc) (grib_accessor*,long*); -typedef long (*accessor_value_proc) (grib_accessor*); -typedef void (*accessor_dump_proc) (grib_accessor*, grib_dumper*); -typedef void (*accessor_init_proc) (grib_accessor*, const long len, grib_arguments*); -typedef void (*accessor_post_init_proc) (grib_accessor*); - -typedef int (*accessor_nearest_proc) (grib_accessor*, double,double*); - -typedef long (*grib_binop_long_proc) (long,long); -typedef long (*grib_unop_long_proc) (long); - -typedef double (*grib_binop_double_proc) (double,double); -typedef double (*grib_unop_double_proc) (double); - -typedef int (*grib_binop_string_proc) (char*,char*); +typedef void (*nearest_init_class_proc)(grib_nearest_class*); +typedef int (*nearest_init_proc)(grib_nearest* i, grib_handle*, grib_arguments*); + +typedef int (*nearest_find_proc)(grib_nearest* nearest, grib_handle* h, + double inlat, double inlon, + unsigned long flags, double* outlats, + double* outlons, double* values, + double* distances, int* indexes, size_t* len); +typedef int (*nearest_destroy_proc)(grib_nearest* nearest); + +typedef void (*box_init_class_proc)(grib_box_class*); +typedef int (*box_destroy_proc)(grib_box*); +typedef int (*box_init_proc)(grib_box*, grib_handle*, grib_arguments*); +typedef grib_points* (*box_get_points_proc)(grib_box*, double, double, double, double, int*); + +typedef void (*iterator_init_class_proc)(grib_iterator_class*); +typedef int (*iterator_init_proc)(grib_iterator* i, grib_handle*, grib_arguments*); + +typedef int (*iterator_next_proc)(grib_iterator* i, double* lat, double* lon, double* val); +typedef int (*iterator_previous_proc)(grib_iterator* i, double* lat, double* lon, double* val); +typedef int (*iterator_reset_proc)(grib_iterator* i); +typedef int (*iterator_destroy_proc)(grib_iterator* i); +typedef long (*iterator_has_next_proc)(grib_iterator* i); + +typedef int (*grib_pack_proc)(grib_handle* h, const double* in, size_t inlen, void* out, size_t* outlen); +typedef int (*grib_unpack_proc)(grib_handle* h, const void* in, size_t inlen, double* out, size_t* outlen); + + +typedef void (*accessor_destroy_proc)(grib_context*, grib_accessor*); + +typedef int (*accessor_unpack_long_proc)(grib_accessor*, long*, size_t* len); +typedef int (*accessor_unpack_double_proc)(grib_accessor*, double*, size_t* len); +typedef int (*accessor_unpack_double_element_proc)(grib_accessor*, size_t, double*); +typedef int (*accessor_unpack_double_subarray_proc)(grib_accessor*, double*, size_t, size_t); +typedef int (*accessor_unpack_string_proc)(grib_accessor*, char*, size_t* len); +typedef int (*accessor_unpack_string_array_proc)(grib_accessor*, char**, size_t* len); +typedef int (*accessor_unpack_bytes_proc)(grib_accessor*, unsigned char*, size_t* len); +typedef int (*accessor_get_native_type_proc)(grib_accessor*); +typedef int (*accessor_notify_change_proc)(grib_accessor*, grib_accessor*); +typedef void (*accessor_update_size_proc)(grib_accessor*, size_t); +typedef size_t (*accessor_preferred_size_proc)(grib_accessor*, int); +typedef void (*accessor_resize_proc)(grib_accessor*, size_t); + +typedef grib_accessor* (*accessor_next_proc)(grib_accessor*, int); +typedef grib_section* (*accessor_sub_section_proc)(grib_accessor*); + + +typedef int (*accessor_pack_missing_proc)(grib_accessor*); +typedef int (*accessor_pack_is_missing_proc)(grib_accessor*); +typedef int (*accessor_pack_long_proc)(grib_accessor*, const long*, size_t* len); +typedef int (*accessor_pack_double_proc)(grib_accessor*, const double*, size_t* len); +typedef int (*accessor_pack_string_proc)(grib_accessor*, const char*, size_t* len); +typedef int (*accessor_pack_string_array_proc)(grib_accessor*, const char**, size_t* len); +typedef int (*accessor_pack_bytes_proc)(grib_accessor*, const unsigned char*, size_t* len); +typedef int (*accessor_pack_expression_proc)(grib_accessor*, grib_expression*); +typedef int (*accessor_clear_proc)(grib_accessor*); +typedef grib_accessor* (*accessor_clone_proc)(grib_accessor*, grib_section*, int*); + +typedef void (*accessor_init_class_proc)(grib_accessor_class*); + +typedef int (*accessor_compare_proc)(grib_accessor*, grib_accessor*); +typedef size_t (*accessor_string_proc)(grib_accessor*); +typedef int (*accessor_value_with_ret_proc)(grib_accessor*, long*); +typedef long (*accessor_value_proc)(grib_accessor*); +typedef void (*accessor_dump_proc)(grib_accessor*, grib_dumper*); +typedef void (*accessor_init_proc)(grib_accessor*, const long len, grib_arguments*); +typedef void (*accessor_post_init_proc)(grib_accessor*); + +typedef int (*accessor_nearest_proc)(grib_accessor*, double, double*); + +typedef long (*grib_binop_long_proc)(long, long); +typedef long (*grib_unop_long_proc)(long); + +typedef double (*grib_binop_double_proc)(double, double); +typedef double (*grib_unop_double_proc)(double); + +typedef int (*grib_binop_string_proc)(char*, char*); typedef struct second_order_packed second_order_packed; -typedef void grib_expression_visit_proc (void* udata, grib_expression *e); - +typedef void grib_expression_visit_proc(void* udata, grib_expression* e); -struct grib_key_value_list { +struct grib_key_value_list +{ const char* name; - int type; - int size; - long* long_value; - double* double_value; + int type; + int size; + long* long_value; + double* double_value; grib_key_value_list* namespace_value; char* string_value; - int has_value; - int error; + int has_value; + int error; grib_key_value_list* next; }; -struct second_order_packed { - unsigned long nbits_per_widths; - unsigned long nbits_per_group_size; - size_t size_of_group_array; - size_t packed_byte_count; +struct second_order_packed +{ + unsigned long nbits_per_widths; + unsigned long nbits_per_group_size; + size_t size_of_group_array; + size_t packed_byte_count; unsigned long* array_of_group_size; unsigned long* array_of_group_width; - long* array_of_group_refs; + long* array_of_group_refs; }; /** @@ -379,25 +389,27 @@ struct second_order_packed { * * @see grib_action_create_data */ -struct grib_packer { - const char* name; - grib_pack_proc pack; /** < packing procedure */ - grib_unpack_proc unpack; /** < unpacking procedure */ +struct grib_packer +{ + const char* name; + grib_pack_proc pack; /** < packing procedure */ + grib_unpack_proc unpack; /** < unpacking procedure */ }; /* --------------- */ typedef struct grib_loader grib_loader; -typedef int (*grib_loader_init_accessor_proc)(grib_loader*,grib_accessor*,grib_arguments*); -typedef int (*grib_loader_lookup_long_proc) (grib_context*,grib_loader*,const char* name, long* value); +typedef int (*grib_loader_init_accessor_proc)(grib_loader*, grib_accessor*, grib_arguments*); +typedef int (*grib_loader_lookup_long_proc)(grib_context*, grib_loader*, const char* name, long* value); -struct grib_loader { - void* data; +struct grib_loader +{ + void* data; grib_loader_init_accessor_proc init_accessor; - grib_loader_lookup_long_proc lookup_long; - int list_is_resized; /** will be true if we resize a list */ - int changing_edition; + grib_loader_lookup_long_proc lookup_long; + int list_is_resized; /** will be true if we resize a list */ + int changing_edition; }; /** @@ -408,23 +420,24 @@ struct grib_loader { */ struct grib_action { - char* name; /** name of the definition statement */ - char* op; /** operator of the definition statement */ - char* name_space; /** namespace of the definition statement */ - grib_action* next; /** next action in the list */ - grib_action_class* cclass; /** link to the structure containing a specific behaviour */ - grib_context* context; /** Context */ - unsigned long flags; - char* defaultkey; /** name of the key used as default if not found */ - grib_arguments* default_value; /** default expression as in .def file */ - char* set; - char* debug_info; /** purely for debugging and tracing */ + char* name; /** name of the definition statement */ + char* op; /** operator of the definition statement */ + char* name_space; /** namespace of the definition statement */ + grib_action* next; /** next action in the list */ + grib_action_class* cclass; /** link to the structure containing a specific behaviour */ + grib_context* context; /** Context */ + unsigned long flags; + char* defaultkey; /** name of the key used as default if not found */ + grib_arguments* default_value; /** default expression as in .def file */ + char* set; + char* debug_info; /** purely for debugging and tracing */ }; typedef struct grib_accessors_list grib_accessors_list; -struct grib_accessors_list { - grib_accessor* accessor; +struct grib_accessors_list +{ + grib_accessor* accessor; int rank; grib_accessors_list* next; grib_accessors_list* prev; @@ -432,16 +445,16 @@ struct grib_accessors_list { }; -typedef int (*action_create_accessors_handle_proc) (grib_section* p, grib_action* a, grib_loader* h); -typedef int (*action_notify_change_proc) (grib_action* a, grib_accessor* observer,grib_accessor * observed); +typedef int (*action_create_accessors_handle_proc)(grib_section* p, grib_action* a, grib_loader* h); +typedef int (*action_notify_change_proc)(grib_action* a, grib_accessor* observer, grib_accessor* observed); -typedef void (*grib_dump_proc) (grib_action*, FILE*, int ); -typedef void (*grib_xref_proc) (grib_action*, FILE*,const char*); -typedef void (*action_init_class_proc) (grib_action_class* a); -typedef void (*action_init_proc) (grib_action* a); -typedef void (*action_destroy_proc) (grib_context* context, grib_action* a); -typedef grib_action* (*action_reparse_proc) (grib_action* a,grib_accessor*,int*); -typedef int (*action_execute_proc) (grib_action* a,grib_handle*); +typedef void (*grib_dump_proc)(grib_action*, FILE*, int); +typedef void (*grib_xref_proc)(grib_action*, FILE*, const char*); +typedef void (*action_init_class_proc)(grib_action_class* a); +typedef void (*action_init_proc)(grib_action* a); +typedef void (*action_destroy_proc)(grib_context* context, grib_action* a); +typedef grib_action* (*action_reparse_proc)(grib_action* a, grib_accessor*, int*); +typedef int (*action_execute_proc)(grib_action* a, grib_handle*); /** * an action_class @@ -451,41 +464,39 @@ typedef int (*action_execute_proc) (grib_action* a,grib_handle*); */ struct grib_action_class { - grib_action_class** super; /** < link to a more general behaviour */ - const char* name; /** < name of the behaviour class */ - size_t size; /** < size in bytes of the structure */ - - int inited; - action_init_class_proc init_class; + grib_action_class** super; /** < link to a more general behaviour */ + const char* name; /** < name of the behaviour class */ + size_t size; /** < size in bytes of the structure */ - action_init_proc init; - action_destroy_proc destroy; /** < destructor method to release the memory */ + int inited; + action_init_class_proc init_class; - grib_dump_proc dump; /** < dump method of the action */ - grib_xref_proc xref; /** < dump method of the action */ - action_create_accessors_handle_proc create_accessor; /** < method to create the corresponding accessor from a handle*/ - action_notify_change_proc notify_change; /** < method to create the corresponding accessor from a handle*/ + action_init_proc init; + action_destroy_proc destroy; /** < destructor method to release the memory */ - action_reparse_proc reparse; - action_execute_proc execute; + grib_dump_proc dump; /** < dump method of the action */ + grib_xref_proc xref; /** < dump method of the action */ + action_create_accessors_handle_proc create_accessor; /** < method to create the corresponding accessor from a handle*/ + action_notify_change_proc notify_change; /** < method to create the corresponding accessor from a handle*/ + action_reparse_proc reparse; + action_execute_proc execute; }; - /** * a buffer * Structure containing the data of a message */ struct grib_buffer { - int property; /** < property parameter of buffer */ - int validity; /** < validity parameter of buffer */ - int growable; /** < buffer can be grown */ - size_t length; /** < Buffer length */ - size_t ulength; /** < length used of the buffer */ - size_t ulength_bits; /** < length used of the buffer in bits */ - unsigned char* data; /** < the data byte array */ + int property; /** < property parameter of buffer */ + int validity; /** < validity parameter of buffer */ + int growable; /** < buffer can be grown */ + size_t length; /** < Buffer length */ + size_t ulength; /** < length used of the buffer */ + size_t ulength_bits; /** < length used of the buffer in bits */ + unsigned char* data; /** < the data byte array */ }; /** @@ -498,62 +509,63 @@ struct grib_buffer typedef struct grib_virtual_value grib_virtual_value; -struct grib_virtual_value { - long lval; - double dval; - char* cval; - int missing; - int length; - int type; +struct grib_virtual_value +{ + long lval; + double dval; + char* cval; + int missing; + int length; + int type; }; struct grib_accessor { - const char* name; /** < name of the accessor */ - const char* name_space; /** < namespace to which the accessor belongs */ - grib_context* context; - grib_handle* h; - grib_action* creator; /** < action that created the accessor */ - long length; /** < byte length of the accessor */ - long offset; /** < offset of the data in the buffer */ - grib_section* parent; /** < section to which the accessor is attached */ - grib_accessor* next; /** < next accessor in list */ - grib_accessor* previous; /** < next accessor in list */ - grib_accessor_class* cclass; /** < behaviour of the accessor */ - unsigned long flags; /** < Various flags */ - grib_section* sub_section; - - const char* all_names[MAX_ACCESSOR_NAMES]; /** < name of the accessor */ - const char* all_name_spaces[MAX_ACCESSOR_NAMES]; /** < namespace to which the accessor belongs */ - int dirty; - - grib_accessor* same; /** < accessors with the same name */ - long loop; /** < used in lists */ - long bufr_subset_number; /** < bufr subset (bufr data accessors belong to different subsets)*/ - long bufr_group_number; /** < used in bufr */ - grib_virtual_value* vvalue; /** < virtual value used when transient flag on **/ - const char* set; - grib_accessor* attributes[MAX_ACCESSOR_ATTRIBUTES]; /** < attributes are accessors */ - grib_accessor* parent_as_attribute; -}; - -#define GRIB_ACCESSOR_FLAG_READ_ONLY (1<<1) -#define GRIB_ACCESSOR_FLAG_DUMP (1<<2) -#define GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC (1<<3) -#define GRIB_ACCESSOR_FLAG_CAN_BE_MISSING (1<<4) -#define GRIB_ACCESSOR_FLAG_HIDDEN (1<<5) -#define GRIB_ACCESSOR_FLAG_CONSTRAINT (1<<6) -#define GRIB_ACCESSOR_FLAG_BUFR_DATA (1<<7) -#define GRIB_ACCESSOR_FLAG_NO_COPY (1<<8) -#define GRIB_ACCESSOR_FLAG_COPY_OK (1<<9) -#define GRIB_ACCESSOR_FLAG_FUNCTION (1<<10) -#define GRIB_ACCESSOR_FLAG_DATA (1<<11) -#define GRIB_ACCESSOR_FLAG_NO_FAIL (1<<12) -#define GRIB_ACCESSOR_FLAG_TRANSIENT (1<<13) -#define GRIB_ACCESSOR_FLAG_STRING_TYPE (1<<14) -#define GRIB_ACCESSOR_FLAG_LONG_TYPE (1<<15) -#define GRIB_ACCESSOR_FLAG_DOUBLE_TYPE (1<<16) -#define GRIB_ACCESSOR_FLAG_LOWERCASE (1<<17) + const char* name; /** < name of the accessor */ + const char* name_space; /** < namespace to which the accessor belongs */ + grib_context* context; + grib_handle* h; + grib_action* creator; /** < action that created the accessor */ + long length; /** < byte length of the accessor */ + long offset; /** < offset of the data in the buffer */ + grib_section* parent; /** < section to which the accessor is attached */ + grib_accessor* next; /** < next accessor in list */ + grib_accessor* previous; /** < next accessor in list */ + grib_accessor_class* cclass; /** < behaviour of the accessor */ + unsigned long flags; /** < Various flags */ + grib_section* sub_section; + + const char* all_names[MAX_ACCESSOR_NAMES]; /** < name of the accessor */ + const char* all_name_spaces[MAX_ACCESSOR_NAMES]; /** < namespace to which the accessor belongs */ + int dirty; + + grib_accessor* same; /** < accessors with the same name */ + long loop; /** < used in lists */ + long bufr_subset_number; /** < bufr subset (bufr data accessors belong to different subsets)*/ + long bufr_group_number; /** < used in bufr */ + grib_virtual_value* vvalue; /** < virtual value used when transient flag on **/ + const char* set; + grib_accessor* attributes[MAX_ACCESSOR_ATTRIBUTES]; /** < attributes are accessors */ + grib_accessor* parent_as_attribute; +}; + +#define GRIB_ACCESSOR_FLAG_READ_ONLY (1 << 1) +#define GRIB_ACCESSOR_FLAG_DUMP (1 << 2) +#define GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC (1 << 3) +#define GRIB_ACCESSOR_FLAG_CAN_BE_MISSING (1 << 4) +#define GRIB_ACCESSOR_FLAG_HIDDEN (1 << 5) +#define GRIB_ACCESSOR_FLAG_CONSTRAINT (1 << 6) +#define GRIB_ACCESSOR_FLAG_BUFR_DATA (1 << 7) +#define GRIB_ACCESSOR_FLAG_NO_COPY (1 << 8) +#define GRIB_ACCESSOR_FLAG_COPY_OK (1 << 9) +#define GRIB_ACCESSOR_FLAG_FUNCTION (1 << 10) +#define GRIB_ACCESSOR_FLAG_DATA (1 << 11) +#define GRIB_ACCESSOR_FLAG_NO_FAIL (1 << 12) +#define GRIB_ACCESSOR_FLAG_TRANSIENT (1 << 13) +#define GRIB_ACCESSOR_FLAG_STRING_TYPE (1 << 14) +#define GRIB_ACCESSOR_FLAG_LONG_TYPE (1 << 15) +#define GRIB_ACCESSOR_FLAG_DOUBLE_TYPE (1 << 16) +#define GRIB_ACCESSOR_FLAG_LOWERCASE (1 << 17) /** * a section accessor @@ -562,146 +574,152 @@ struct grib_accessor */ struct grib_section { - grib_accessor* owner; - grib_handle* h; /** < Handles of all accessors and buffer */ - grib_accessor* aclength; /** < block of the length of the block */ - grib_block_of_accessors* block; /** < block */ - grib_action* branch; /** < branch that created the block */ - size_t length; - size_t padding; + grib_accessor* owner; + grib_handle* h; /** < Handles of all accessors and buffer */ + grib_accessor* aclength; /** < block of the length of the block */ + grib_block_of_accessors* block; /** < block */ + grib_action* branch; /** < branch that created the block */ + size_t length; + size_t padding; }; +struct grib_iterator_class +{ + grib_iterator_class** super; + char* name; + size_t size; -struct grib_iterator_class{ - grib_iterator_class** super; - char* name; - size_t size; - - int inited; - iterator_init_class_proc init_class; - - iterator_init_proc init; - iterator_destroy_proc destroy; + int inited; + iterator_init_class_proc init_class; - iterator_next_proc next; - iterator_previous_proc previous; - iterator_reset_proc reset; - iterator_has_next_proc has_next; + iterator_init_proc init; + iterator_destroy_proc destroy; + iterator_next_proc next; + iterator_previous_proc previous; + iterator_reset_proc reset; + iterator_has_next_proc has_next; }; -struct grib_nearest_class{ - grib_nearest_class** super; - char* name; - size_t size; +struct grib_nearest_class +{ + grib_nearest_class** super; + char* name; + size_t size; - int inited; - nearest_init_class_proc init_class; + int inited; + nearest_init_class_proc init_class; - nearest_init_proc init; - nearest_destroy_proc destroy; + nearest_init_proc init; + nearest_destroy_proc destroy; - nearest_find_proc find; + nearest_find_proc find; }; -struct grib_box_class{ - grib_box_class** super; - char* name; - size_t size; - int inited; - box_init_class_proc init_class; - box_init_proc init; - box_destroy_proc destroy; - box_get_points_proc get_points; +struct grib_box_class +{ + grib_box_class** super; + char* name; + size_t size; + int inited; + box_init_class_proc init_class; + box_init_proc init; + box_destroy_proc destroy; + box_get_points_proc get_points; }; /* --------------- */ /* --------------- */ -typedef void (*search_all_callback_proc)(grib_accessor*,void* data); +typedef void (*search_all_callback_proc)(grib_accessor*, void* data); /* --------------- */ -typedef int (*dumper_init_proc) (grib_dumper*); -typedef void (*dumper_dump_proc) (grib_dumper*,grib_accessor*,const char* comment); -typedef void (*dumper_dump_section_proc)(grib_dumper*,grib_accessor*,grib_block_of_accessors* block); -typedef void (*dumper_dump_values_proc) (grib_dumper*,grib_accessor*); -typedef int (*dumper_destroy_proc) (grib_dumper*); -typedef void (*dumper_header_proc) (grib_dumper*,grib_handle*); -typedef void (*dumper_footer_proc) (grib_dumper*,grib_handle*); -typedef void (*dumper_init_class_proc) (grib_dumper_class*); - -struct grib_dumper { - FILE* out; - unsigned long option_flags; - void* arg; - int depth; - long count; - grib_handle* handle; - grib_dumper_class* cclass; - }; - -struct grib_dumper_class { - grib_dumper_class** super; - char* name; - size_t size; - int inited; - dumper_init_class_proc init_class; - dumper_init_proc init; - dumper_destroy_proc destroy; - dumper_dump_proc dump_long; - dumper_dump_proc dump_double; - dumper_dump_proc dump_string; - dumper_dump_proc dump_string_array; - dumper_dump_proc dump_label; - dumper_dump_proc dump_bytes; - dumper_dump_proc dump_bits; - dumper_dump_section_proc dump_section; - dumper_dump_values_proc dump_values; - dumper_header_proc header; - dumper_footer_proc footer; -}; - -struct grib_iterator{ - grib_arguments* args; /** args of iterator */ - grib_handle* h; - long e; /** current element */ - size_t nv; /** number of values */ - double* data; /** data values */ - grib_iterator_class* cclass; - unsigned long flags; -}; - -struct grib_nearest{ - grib_arguments* args; /** args of iterator */ - grib_handle* h; - grib_context* context; - double* values; - size_t values_count; - grib_nearest_class* cclass; - unsigned long flags; - -}; - -struct grib_box { - grib_box_class* cclass; - grib_context* context; - grib_arguments* args; - grib_handle* h; - unsigned long flags; - grib_points* points; -}; - -struct grib_dependency { - grib_dependency* next; - grib_accessor* observed; - grib_accessor* observer; - int run; +typedef int (*dumper_init_proc)(grib_dumper*); +typedef void (*dumper_dump_proc)(grib_dumper*, grib_accessor*, const char* comment); +typedef void (*dumper_dump_section_proc)(grib_dumper*, grib_accessor*, grib_block_of_accessors* block); +typedef void (*dumper_dump_values_proc)(grib_dumper*, grib_accessor*); +typedef int (*dumper_destroy_proc)(grib_dumper*); +typedef void (*dumper_header_proc)(grib_dumper*, grib_handle*); +typedef void (*dumper_footer_proc)(grib_dumper*, grib_handle*); +typedef void (*dumper_init_class_proc)(grib_dumper_class*); + +struct grib_dumper +{ + FILE* out; + unsigned long option_flags; + void* arg; + int depth; + long count; + grib_handle* handle; + grib_dumper_class* cclass; +}; + +struct grib_dumper_class +{ + grib_dumper_class** super; + char* name; + size_t size; + int inited; + dumper_init_class_proc init_class; + dumper_init_proc init; + dumper_destroy_proc destroy; + dumper_dump_proc dump_long; + dumper_dump_proc dump_double; + dumper_dump_proc dump_string; + dumper_dump_proc dump_string_array; + dumper_dump_proc dump_label; + dumper_dump_proc dump_bytes; + dumper_dump_proc dump_bits; + dumper_dump_section_proc dump_section; + dumper_dump_values_proc dump_values; + dumper_header_proc header; + dumper_footer_proc footer; +}; + +struct grib_iterator +{ + grib_arguments* args; /** args of iterator */ + grib_handle* h; + long e; /** current element */ + size_t nv; /** number of values */ + double* data; /** data values */ + grib_iterator_class* cclass; + unsigned long flags; +}; + +struct grib_nearest +{ + grib_arguments* args; /** args of iterator */ + grib_handle* h; + grib_context* context; + double* values; + size_t values_count; + grib_nearest_class* cclass; + unsigned long flags; +}; + +struct grib_box +{ + grib_box_class* cclass; + grib_context* context; + grib_arguments* args; + grib_handle* h; + unsigned long flags; + grib_points* points; +}; + +struct grib_dependency +{ + grib_dependency* next; + grib_accessor* observed; + grib_accessor* observer; + int run; }; struct grib_block_of_accessors { - grib_accessor* first; - grib_accessor* last; + grib_accessor* first; + grib_accessor* last; }; @@ -711,422 +729,442 @@ typedef struct grib_trie_with_rank grib_trie_with_rank; typedef struct grib_itrie grib_itrie; -struct grib_sarray { - char** v; - size_t size; - size_t n; - size_t incsize; - grib_context* context; -} ; - -struct grib_oarray { - void** v; - size_t size; - size_t n; - size_t incsize; - grib_context* context; -} ; - -struct grib_darray { - double* v; - size_t size; - size_t n; - size_t incsize; - grib_context* context; -} ; - -struct grib_iarray { - long* v; - size_t size; - size_t n; - size_t incsize; - size_t number_of_pop_front; - grib_context* context; -} ; - -struct grib_vdarray { - grib_darray** v; - size_t size; - size_t n; - size_t incsize; - grib_context* context; -} ; - -struct grib_vsarray { - grib_sarray** v; - size_t size; - size_t n; - size_t incsize; - grib_context* context; -} ; - -struct grib_viarray { - grib_iarray** v; - size_t size; - size_t n; - size_t incsize; - grib_context* context; -} ; +struct grib_sarray +{ + char** v; + size_t size; + size_t n; + size_t incsize; + grib_context* context; +}; + +struct grib_oarray +{ + void** v; + size_t size; + size_t n; + size_t incsize; + grib_context* context; +}; + +struct grib_darray +{ + double* v; + size_t size; + size_t n; + size_t incsize; + grib_context* context; +}; + +struct grib_iarray +{ + long* v; + size_t size; + size_t n; + size_t incsize; + size_t number_of_pop_front; + grib_context* context; +}; + +struct grib_vdarray +{ + grib_darray** v; + size_t size; + size_t n; + size_t incsize; + grib_context* context; +}; + +struct grib_vsarray +{ + grib_sarray** v; + size_t size; + size_t n; + size_t incsize; + grib_context* context; +}; + +struct grib_viarray +{ + grib_iarray** v; + size_t size; + size_t n; + size_t incsize; + grib_context* context; +}; /* types of BUFR descriptors used in bufr_descriptor->type*/ -#define BUFR_DESCRIPTOR_TYPE_UNKNOWN 0 -#define BUFR_DESCRIPTOR_TYPE_STRING 1 -#define BUFR_DESCRIPTOR_TYPE_DOUBLE 2 -#define BUFR_DESCRIPTOR_TYPE_LONG 3 -#define BUFR_DESCRIPTOR_TYPE_TABLE 4 -#define BUFR_DESCRIPTOR_TYPE_FLAG 5 -#define BUFR_DESCRIPTOR_TYPE_REPLICATION 6 -#define BUFR_DESCRIPTOR_TYPE_OPERATOR 7 -#define BUFR_DESCRIPTOR_TYPE_SEQUENCE 8 - -struct bufr_descriptor { - grib_context* context; - long code; - int F; - int X; - int Y; - int type; - /*char* name; Not needed: All usage commented out. See ECC-489 */ - char* shortName; - char* units; - long scale; - double factor; - long reference; - long width; - int nokey; /* set if descriptor does not have an associated key */ - grib_accessor* a; -}; - -struct bufr_descriptors_array { - bufr_descriptor** v; - size_t size; - size_t n; - size_t incsize; - size_t number_of_pop_front; - grib_context* context; -} ; - -struct bufr_descriptors_map_list { - bufr_descriptors_array* unexpanded; - bufr_descriptors_array* expanded; - bufr_descriptors_map_list* next; +#define BUFR_DESCRIPTOR_TYPE_UNKNOWN 0 +#define BUFR_DESCRIPTOR_TYPE_STRING 1 +#define BUFR_DESCRIPTOR_TYPE_DOUBLE 2 +#define BUFR_DESCRIPTOR_TYPE_LONG 3 +#define BUFR_DESCRIPTOR_TYPE_TABLE 4 +#define BUFR_DESCRIPTOR_TYPE_FLAG 5 +#define BUFR_DESCRIPTOR_TYPE_REPLICATION 6 +#define BUFR_DESCRIPTOR_TYPE_OPERATOR 7 +#define BUFR_DESCRIPTOR_TYPE_SEQUENCE 8 + +struct bufr_descriptor +{ + grib_context* context; + long code; + int F; + int X; + int Y; + int type; + /*char* name; Not needed: All usage commented out. See ECC-489 */ + char* shortName; + char* units; + long scale; + double factor; + long reference; + long width; + int nokey; /* set if descriptor does not have an associated key */ + grib_accessor* a; +}; + +struct bufr_descriptors_array +{ + bufr_descriptor** v; + size_t size; + size_t n; + size_t incsize; + size_t number_of_pop_front; + grib_context* context; +}; + +struct bufr_descriptors_map_list +{ + bufr_descriptors_array* unexpanded; + bufr_descriptors_array* expanded; + bufr_descriptors_map_list* next; }; /* BUFR: Operator 203YYY: Linked list storing Table B changed reference values */ typedef struct bufr_tableb_override bufr_tableb_override; -struct bufr_tableb_override { - bufr_tableb_override* next; - int code; - long new_ref_val; +struct bufr_tableb_override +{ + bufr_tableb_override* next; + int code; + long new_ref_val; }; -struct codes_condition { - char* left; - int rightType; - char* rightString; - long rightLong; - double rightDouble; +struct codes_condition +{ + char* left; + int rightType; + char* rightString; + long rightLong; + double rightDouble; }; void codes_assertion_failed(const char* message, const char* file, int line); -#define MAX_SET_VALUES 10 -#define MAX_ACCESSOR_CACHE 100 +#define MAX_SET_VALUES 10 +#define MAX_ACCESSOR_CACHE 100 struct grib_handle { - grib_context* context; /** < context attached to this handle */ - grib_buffer* buffer ; /** < buffer attached to the handle */ - grib_section* root; /** the root section*/ - grib_section* asserts; /** the assertion section*/ - grib_section* rules; /** the rules section*/ - grib_dependency* dependencies; /** List of dependencies */ - grib_handle* main; /** Used during reparsing */ - grib_handle* kid; /** Used during reparsing */ - grib_loader* loader; /** Used during reparsing */ - int values_stack; - const grib_values* values[MAX_SET_VALUES]; /** Used when setting multiple values at once */ - size_t values_count[MAX_SET_VALUES]; /** Used when setting multiple values at once */ - int dont_trigger; /** Don't notify triggers */ - int partial; /** Not a complete message (just headers) */ - int header_mode; /** Header not jet complete */ - char* gts_header; - size_t gts_header_len; - int use_trie; - int trie_invalid; - grib_accessor* accessors[ACCESSORS_ARRAY_SIZE]; - char* section_offset[MAX_NUM_SECTIONS]; - char* section_length[MAX_NUM_SECTIONS]; - int sections_count; - off_t offset; - long bufr_subset_number; /* bufr subset number */ - long bufr_group_number; /* used in bufr */ + grib_context* context; /** < context attached to this handle */ + grib_buffer* buffer; /** < buffer attached to the handle */ + grib_section* root; /** the root section*/ + grib_section* asserts; /** the assertion section*/ + grib_section* rules; /** the rules section*/ + grib_dependency* dependencies; /** List of dependencies */ + grib_handle* main; /** Used during reparsing */ + grib_handle* kid; /** Used during reparsing */ + grib_loader* loader; /** Used during reparsing */ + int values_stack; + const grib_values* values[MAX_SET_VALUES]; /** Used when setting multiple values at once */ + size_t values_count[MAX_SET_VALUES]; /** Used when setting multiple values at once */ + int dont_trigger; /** Don't notify triggers */ + int partial; /** Not a complete message (just headers) */ + int header_mode; /** Header not jet complete */ + char* gts_header; + size_t gts_header_len; + int use_trie; + int trie_invalid; + grib_accessor* accessors[ACCESSORS_ARRAY_SIZE]; + char* section_offset[MAX_NUM_SECTIONS]; + char* section_length[MAX_NUM_SECTIONS]; + int sections_count; + off_t offset; + long bufr_subset_number; /* bufr subset number */ + long bufr_group_number; /* used in bufr */ /* grib_accessor* groups[MAX_NUM_GROUPS]; */ - long missingValueLong; - double missingValueDouble; - ProductKind product_kind; - grib_trie* bufr_elements_table; + long missingValueLong; + double missingValueDouble; + ProductKind product_kind; + grib_trie* bufr_elements_table; }; -struct grib_multi_handle { - grib_context* context; /** < context attached to this handle */ - grib_buffer* buffer; /** < buffer attached to the handle */ - size_t offset; - size_t length; +struct grib_multi_handle +{ + grib_context* context; /** < context attached to this handle */ + grib_buffer* buffer; /** < buffer attached to the handle */ + size_t offset; + size_t length; }; struct grib_accessor_class { - grib_accessor_class** super; - const char* name; - size_t size; + grib_accessor_class** super; + const char* name; + size_t size; - int inited; - accessor_init_class_proc init_class; + int inited; + accessor_init_class_proc init_class; - accessor_init_proc init; - accessor_post_init_proc post_init; - accessor_destroy_proc destroy; + accessor_init_proc init; + accessor_post_init_proc post_init; + accessor_destroy_proc destroy; - accessor_dump_proc dump; - accessor_value_proc next_offset; + accessor_dump_proc dump; + accessor_value_proc next_offset; - accessor_string_proc string_length; - accessor_value_with_ret_proc value_count; + accessor_string_proc string_length; + accessor_value_with_ret_proc value_count; - accessor_value_proc byte_count; - accessor_value_proc byte_offset; + accessor_value_proc byte_count; + accessor_value_proc byte_offset; - accessor_get_native_type_proc get_native_type; + accessor_get_native_type_proc get_native_type; - accessor_sub_section_proc sub_section; + accessor_sub_section_proc sub_section; - accessor_pack_missing_proc pack_missing ; - accessor_pack_is_missing_proc is_missing ; + accessor_pack_missing_proc pack_missing; + accessor_pack_is_missing_proc is_missing; - accessor_pack_long_proc pack_long ; - accessor_unpack_long_proc unpack_long ; + accessor_pack_long_proc pack_long; + accessor_unpack_long_proc unpack_long; - accessor_pack_double_proc pack_double; - accessor_unpack_double_proc unpack_double; + accessor_pack_double_proc pack_double; + accessor_unpack_double_proc unpack_double; - accessor_pack_string_proc pack_string; - accessor_unpack_string_proc unpack_string; + accessor_pack_string_proc pack_string; + accessor_unpack_string_proc unpack_string; - accessor_pack_string_array_proc pack_string_array; - accessor_unpack_string_array_proc unpack_string_array; + accessor_pack_string_array_proc pack_string_array; + accessor_unpack_string_array_proc unpack_string_array; - accessor_pack_bytes_proc pack_bytes; - accessor_unpack_bytes_proc unpack_bytes; + accessor_pack_bytes_proc pack_bytes; + accessor_unpack_bytes_proc unpack_bytes; - accessor_pack_expression_proc pack_expression; + accessor_pack_expression_proc pack_expression; - accessor_notify_change_proc notify_change; - accessor_update_size_proc update_size; + accessor_notify_change_proc notify_change; + accessor_update_size_proc update_size; - accessor_preferred_size_proc preferred_size; - accessor_resize_proc resize; + accessor_preferred_size_proc preferred_size; + accessor_resize_proc resize; - accessor_nearest_proc nearest_smaller_value; - accessor_next_proc next; - accessor_compare_proc compare; - accessor_unpack_double_element_proc unpack_double_element; - accessor_unpack_double_subarray_proc unpack_double_subarray; - accessor_clear_proc clear; - accessor_clone_proc make_clone; + accessor_nearest_proc nearest_smaller_value; + accessor_next_proc next; + accessor_compare_proc compare; + accessor_unpack_double_element_proc unpack_double_element; + accessor_unpack_double_subarray_proc unpack_double_subarray; + accessor_clear_proc clear; + accessor_clone_proc make_clone; }; typedef struct grib_multi_support grib_multi_support; -struct grib_multi_support { - FILE* file; - size_t offset; - unsigned char* message; - size_t message_length; - unsigned char* sections[8]; - unsigned char* bitmap_section; - size_t bitmap_section_length; - size_t sections_length[9]; - int section_number; - grib_multi_support* next; +struct grib_multi_support +{ + FILE* file; + size_t offset; + unsigned char* message; + size_t message_length; + unsigned char* sections[8]; + unsigned char* bitmap_section; + size_t bitmap_section_length; + size_t sections_length[9]; + int section_number; + grib_multi_support* next; }; /* Hash_array */ typedef struct grib_hash_array_value grib_hash_array_value; -struct grib_hash_array_value { - grib_hash_array_value* next; - char* name; - int type; - grib_iarray* iarray; - grib_darray* darray; - grib_trie* index; +struct grib_hash_array_value +{ + grib_hash_array_value* next; + char* name; + int type; + grib_iarray* iarray; + grib_darray* darray; + grib_trie* index; }; /* Concepts */ typedef struct grib_concept_condition grib_concept_condition; -struct grib_concept_condition { - grib_concept_condition* next; - char* name; - grib_expression* expression; - grib_iarray* iarray; +struct grib_concept_condition +{ + grib_concept_condition* next; + char* name; + grib_expression* expression; + grib_iarray* iarray; }; typedef struct grib_concept_value_name grib_concept_value_name; -struct grib_concept_value_name { - grib_concept_value_name* next; - char* name; +struct grib_concept_value_name +{ + grib_concept_value_name* next; + char* name; }; typedef struct grib_concept_value grib_concept_value; -struct grib_concept_value { - grib_concept_value* next; - char* name; - grib_concept_condition* conditions; - grib_trie* index; +struct grib_concept_value +{ + grib_concept_value* next; + char* name; + grib_concept_condition* conditions; + grib_trie* index; }; /* ----------*/ struct grib_context { - int inited; - int debug; - int write_on_fail; - int no_abort; - int io_buffer_size; - int no_big_group_split; - int no_spd; - int keep_matrix; - char* grib_definition_files_path; - char* grib_samples_path; - char* grib_concept_path; - - grib_action_file_list* grib_reader; - void* user_data; - int real_mode; - - grib_free_proc free_mem; - grib_malloc_proc alloc_mem; - grib_realloc_proc realloc_mem; - - grib_free_proc free_persistent_mem; - grib_malloc_proc alloc_persistent_mem; - - grib_free_proc free_buffer_mem; - grib_malloc_proc alloc_buffer_mem; - grib_realloc_proc realloc_buffer_mem; - - grib_data_read_proc read; - grib_data_write_proc write; - grib_data_tell_proc tell; - grib_data_seek_proc seek; - grib_data_eof_proc eof; - - grib_log_proc output_log; - grib_print_proc print; - - grib_codetable* codetable; - grib_smart_table* smart_table; - char* outfilename; - int multi_support_on; - grib_multi_support* multi_support; - grib_string_list* grib_definition_files_dir; - int handle_file_count; - int handle_total_count; - off_t message_file_offset; - int no_fail_on_wrong_length; - int gts_header_on; - int gribex_mode_on; - int large_constant_fields; - grib_itrie* keys; - int keys_count; - grib_itrie* concepts_index; - int concepts_count; - grib_concept_value* concepts[MAX_NUM_CONCEPTS]; - grib_itrie* hash_array_index; - int hash_array_count; - grib_hash_array_value* hash_array[MAX_NUM_HASH_ARRAY]; - grib_trie* def_files; - grib_string_list* blacklist; - int ieee_packing; - int bufrdc_mode; - int bufr_set_to_missing_if_out_of_range; - int bufr_multi_element_constant_arrays; - int grib_data_quality_checks; - FILE* log_stream; - grib_trie* classes; - grib_trie* lists; - grib_trie* expanded_descriptors; - int file_pool_max_opened_files; + int inited; + int debug; + int write_on_fail; + int no_abort; + int io_buffer_size; + int no_big_group_split; + int no_spd; + int keep_matrix; + char* grib_definition_files_path; + char* grib_samples_path; + char* grib_concept_path; + + grib_action_file_list* grib_reader; + void* user_data; + int real_mode; + + grib_free_proc free_mem; + grib_malloc_proc alloc_mem; + grib_realloc_proc realloc_mem; + + grib_free_proc free_persistent_mem; + grib_malloc_proc alloc_persistent_mem; + + grib_free_proc free_buffer_mem; + grib_malloc_proc alloc_buffer_mem; + grib_realloc_proc realloc_buffer_mem; + + grib_data_read_proc read; + grib_data_write_proc write; + grib_data_tell_proc tell; + grib_data_seek_proc seek; + grib_data_eof_proc eof; + + grib_log_proc output_log; + grib_print_proc print; + + grib_codetable* codetable; + grib_smart_table* smart_table; + char* outfilename; + int multi_support_on; + grib_multi_support* multi_support; + grib_string_list* grib_definition_files_dir; + int handle_file_count; + int handle_total_count; + off_t message_file_offset; + int no_fail_on_wrong_length; + int gts_header_on; + int gribex_mode_on; + int large_constant_fields; + grib_itrie* keys; + int keys_count; + grib_itrie* concepts_index; + int concepts_count; + grib_concept_value* concepts[MAX_NUM_CONCEPTS]; + grib_itrie* hash_array_index; + int hash_array_count; + grib_hash_array_value* hash_array[MAX_NUM_HASH_ARRAY]; + grib_trie* def_files; + grib_string_list* blacklist; + int ieee_packing; + int bufrdc_mode; + int bufr_set_to_missing_if_out_of_range; + int bufr_multi_element_constant_arrays; + int grib_data_quality_checks; + FILE* log_stream; + grib_trie* classes; + grib_trie* lists; + grib_trie* expanded_descriptors; + int file_pool_max_opened_files; #if GRIB_PTHREADS - pthread_mutex_t mutex; + pthread_mutex_t mutex; #elif GRIB_OMP_THREADS - omp_nest_lock_t mutex; + omp_nest_lock_t mutex; #endif - }; /* expression*/ -typedef int (*expression_evaluate_long_proc)(grib_expression*,grib_handle*,long*); -typedef int (*expression_evaluate_double_proc)(grib_expression*,grib_handle*,double*); -typedef const char* (*expression_evaluate_string_proc)(grib_expression*,grib_handle*,char*,size_t*,int*); +typedef int (*expression_evaluate_long_proc)(grib_expression*, grib_handle*, long*); +typedef int (*expression_evaluate_double_proc)(grib_expression*, grib_handle*, double*); +typedef const char* (*expression_evaluate_string_proc)(grib_expression*, grib_handle*, char*, size_t*, int*); typedef const char* (*expression_get_name_proc)(grib_expression*); -typedef void (*expression_print_proc)(grib_context*,grib_expression*,grib_handle*); -typedef void (*expression_add_dependency_proc) (grib_expression*e, grib_accessor* observer ); +typedef void (*expression_print_proc)(grib_context*, grib_expression*, grib_handle*); +typedef void (*expression_add_dependency_proc)(grib_expression* e, grib_accessor* observer); typedef struct grib_expression_class grib_expression_class; -typedef void (*expression_class_init_proc) (grib_expression_class*e); -typedef void (*expression_init_proc) (grib_expression*e); -typedef void (*expression_destroy_proc) (grib_context*,grib_expression*e); +typedef void (*expression_class_init_proc)(grib_expression_class* e); +typedef void (*expression_init_proc)(grib_expression* e); +typedef void (*expression_destroy_proc)(grib_context*, grib_expression* e); -typedef int (*expression_native_type_proc)(grib_expression*,grib_handle*); +typedef int (*expression_native_type_proc)(grib_expression*, grib_handle*); -struct grib_expression { +struct grib_expression +{ grib_expression_class* cclass; }; -struct grib_expression_class { +struct grib_expression_class +{ grib_expression_class** super; - const char* name; - size_t size; - int inited; + const char* name; + size_t size; + int inited; expression_class_init_proc init_class; expression_init_proc init; expression_destroy_proc destroy; - expression_print_proc print; - expression_add_dependency_proc add_dependency; + expression_print_proc print; + expression_add_dependency_proc add_dependency; - expression_native_type_proc native_type; - expression_get_name_proc get_name; + expression_native_type_proc native_type; + expression_get_name_proc get_name; - expression_evaluate_long_proc evaluate_long; - expression_evaluate_double_proc evaluate_double; - expression_evaluate_string_proc evaluate_string; + expression_evaluate_long_proc evaluate_long; + expression_evaluate_double_proc evaluate_double; + expression_evaluate_string_proc evaluate_string; }; -struct grib_arguments { +struct grib_arguments +{ struct grib_arguments* next; - grib_expression* expression; - char value[80]; + grib_expression* expression; + char value[80]; }; -long grib_expression_evaluate(grib_handle*,grib_expression*); -void grib_expression_free(grib_context*,grib_expression*); +long grib_expression_evaluate(grib_handle*, grib_expression*); +void grib_expression_free(grib_context*, grib_expression*); -grib_arguments* grib_arguments_new(grib_context*,grib_expression*,grib_arguments*); -void grib_arguments_free(grib_context*,grib_arguments*); +grib_arguments* grib_arguments_new(grib_context*, grib_expression*, grib_arguments*); +void grib_arguments_free(grib_context*, grib_arguments*); const char* grib_argument_next(grib_arguments**); @@ -1136,24 +1174,26 @@ extern grib_string_list grib_file_not_found; typedef struct grib_file grib_file; typedef struct grib_file_pool grib_file_pool; -struct grib_file { - grib_context* context; - char* name; - FILE* handle; - char* mode; - char* buffer; - long refcount; - grib_file* next; - short id; -} ; - -struct grib_file_pool { - grib_context* context; - grib_file* first; - grib_file* current; - size_t size; - int number_of_opened_files; - int max_opened_files; +struct grib_file +{ + grib_context* context; + char* name; + FILE* handle; + char* mode; + char* buffer; + long refcount; + grib_file* next; + short id; +}; + +struct grib_file_pool +{ + grib_context* context; + grib_file* first; + grib_file* current; + size_t size; + int number_of_opened_files; + int max_opened_files; }; /* fieldset */ @@ -1162,87 +1202,96 @@ typedef struct grib_column grib_column; typedef struct grib_fields grib_fields; typedef struct grib_int_array grib_int_array; -struct grib_where { - grib_context* context; - char* string; -}; - -struct grib_column { - grib_context* context; - int refcount; - char* name; - int type; - size_t size; - size_t values_array_size; - long* long_values; - double* double_values; - char** string_values; - int* errors; -} ; - -struct grib_order_by { - char* key; - int idkey; - int mode; - grib_order_by* next; -} ; +struct grib_where +{ + grib_context* context; + char* string; +}; + +struct grib_column +{ + grib_context* context; + int refcount; + char* name; + int type; + size_t size; + size_t values_array_size; + long* long_values; + double* double_values; + char** string_values; + int* errors; +}; + +struct grib_order_by +{ + char* key; + int idkey; + int mode; + grib_order_by* next; +}; #ifdef NEWDB -struct grib_query { - grib_context* context; - char* where_string; - grib_order_by* order_by; +struct grib_query +{ + grib_context* context; + char* where_string; + grib_order_by* order_by; }; #endif -struct grib_field { - grib_file* file; - off_t offset; - long length; - grib_field* next; +struct grib_field +{ + grib_file* file; + off_t offset; + long length; + grib_field* next; }; -struct grib_int_array { - grib_context* context; - size_t size; - int* el; -} ; +struct grib_int_array +{ + grib_context* context; + size_t size; + int* el; +}; #ifndef NEWDB -struct grib_fieldset { - grib_context* context; - grib_int_array* filter; - grib_int_array* order; - size_t fields_array_size; - size_t size; - grib_column* columns; - size_t columns_size; - grib_where* where; - grib_order_by* order_by; - long current; - grib_field** fields; +struct grib_fieldset +{ + grib_context* context; + grib_int_array* filter; + grib_int_array* order; + size_t fields_array_size; + size_t size; + grib_column* columns; + size_t columns_size; + grib_where* where; + grib_order_by* order_by; + long current; + grib_field** fields; }; #endif #ifdef NEWDB /* grib db */ -struct grib_db { - grib_context* context; - size_t size; - size_t fields_array_size; - grib_column* columns; - size_t columns_size; - grib_field** fields; -}; - -struct grib_fieldset { - grib_context* context; - grib_db* db; - grib_int_array* filter; - grib_int_array* order; - size_t size; - grib_query* query; - long current; +struct grib_db +{ + grib_context* context; + size_t size; + size_t fields_array_size; + grib_column* columns; + size_t columns_size; + grib_field** fields; +}; + +struct grib_fieldset +{ + grib_context* context; + grib_db* db; + grib_int_array* filter; + grib_int_array* order; + size_t size; + grib_query* query; + long current; }; #endif @@ -1254,28 +1303,32 @@ typedef struct grib_conditions_tree grib_conditions_tree; typedef struct grib_concept_entry grib_concept_entry; typedef struct grib_concept_key grib_concept_key; -struct grib_concept_index_entry { - char* name; - char* value; - int type; - grib_concept_entry* next; +struct grib_concept_index_entry +{ + char* name; + char* value; + int type; + grib_concept_entry* next; }; -struct grib_concept_index_key { - char* name; - int type; - grib_concept_key* next; +struct grib_concept_index_key +{ + char* name; + int type; + grib_concept_key* next; }; -struct grib_concept_index { +struct grib_concept_index +{ grib_context* context; grib_concept_key* keys; grib_conditions_tree* conditions; }; -struct grib_conditions_tree { - char* value; - void* object; +struct grib_conditions_tree +{ + char* value; + void* object; grib_conditions_tree* next; grib_conditions_tree* next_key; }; @@ -1291,221 +1344,238 @@ extern FILE* codes_memfs_open(const char* path); typedef struct grib_field_tree grib_field_tree; -struct grib_field_tree { - grib_field* field; - char* value; - grib_field_tree* next; - grib_field_tree* next_level; +struct grib_field_tree +{ + grib_field* field; + char* value; + grib_field_tree* next; + grib_field_tree* next_level; }; typedef struct grib_index_key grib_index_key; -struct grib_index_key { - char* name; - int type; - char value[STRING_VALUE_LEN]; - grib_string_list* values; - grib_string_list* current; - int values_count; - int count; - grib_index_key* next; +struct grib_index_key +{ + char* name; + int type; + char value[STRING_VALUE_LEN]; + grib_string_list* values; + grib_string_list* current; + int values_count; + int count; + grib_index_key* next; }; typedef struct grib_field_list grib_field_list; -struct grib_field_list { - grib_field* field; - grib_field_list* next; +struct grib_field_list +{ + grib_field* field; + grib_field_list* next; }; -struct grib_index { - grib_context* context; - grib_index_key* keys; - int rewind; - int orderby; - grib_index_key* orederby_keys; - grib_field_tree* fields; - grib_field_list* fieldset; - grib_field_list* current; - grib_file* files; - int count; +struct grib_index +{ + grib_context* context; + grib_index_key* keys; + int rewind; + int orderby; + grib_index_key* orederby_keys; + grib_field_tree* fields; + grib_field_list* fieldset; + grib_field_list* current; + grib_file* files; + int count; }; /* header compute */ typedef struct grib_math grib_math; -struct grib_math{ - struct grib_math* left; - struct grib_math* right; - char* name; - int arity; +struct grib_math +{ + struct grib_math* left; + struct grib_math* right; + char* name; + int arity; }; typedef double (*mathproc)(void); -typedef int (*funcproc)(grib_math*,mathproc); - -typedef struct func { - char* name; - funcproc addr; - mathproc proc; - int arity; - char* info; +typedef int (*funcproc)(grib_math*, mathproc); + +typedef struct func +{ + char* name; + funcproc addr; + mathproc proc; + int arity; + char* info; } func; /* action file */ struct grib_action_file { - char* filename; - grib_action* root; + char* filename; + grib_action* root; grib_action_file* next; }; struct grib_action_file_list { - grib_action_file * first; - grib_action_file * last ; + grib_action_file* first; + grib_action_file* last; }; /* Common keys iterator */ -struct grib_keys_iterator{ - grib_handle *handle; - unsigned long filter_flags; /** flags to filter out accessors */ - unsigned long accessor_flags_skip; - grib_accessor *current; - char *name_space; - int at_start; - int match; - int i_curr_attribute; - grib_accessor** attributes; - char* prefix; - grib_trie *seen; +struct grib_keys_iterator +{ + grib_handle* handle; + unsigned long filter_flags; /** flags to filter out accessors */ + unsigned long accessor_flags_skip; + grib_accessor* current; + char* name_space; + int at_start; + int match; + int i_curr_attribute; + grib_accessor** attributes; + char* prefix; + grib_trie* seen; }; /* BUFR-specific keys iterator */ -struct bufr_keys_iterator{ - grib_handle* handle; - unsigned long filter_flags; /** flags to filter out accessors */ - unsigned long accessor_flags_skip; - unsigned long accessor_flags_only; - grib_accessor* current; - char* key_name; - int at_start; - int match; - int i_curr_attribute; - grib_accessor** attributes; - char* prefix; - grib_trie* seen; +struct bufr_keys_iterator +{ + grib_handle* handle; + unsigned long filter_flags; /** flags to filter out accessors */ + unsigned long accessor_flags_skip; + unsigned long accessor_flags_only; + grib_accessor* current; + char* key_name; + int at_start; + int match; + int i_curr_attribute; + grib_accessor** attributes; + char* prefix; + grib_trie* seen; }; /* ----------*/ /* md5 */ typedef unsigned long cvs_uint32; -struct cvs_MD5Context { - cvs_uint32 buf[4]; - cvs_uint32 bits[2]; - unsigned char in[64]; +struct cvs_MD5Context +{ + cvs_uint32 buf[4]; + cvs_uint32 bits[2]; + unsigned char in[64]; }; /* --- */ typedef struct grib_rule_entry grib_rule_entry; -struct grib_rule_entry { - grib_rule_entry* next; - char* name; - grib_expression* value; +struct grib_rule_entry +{ + grib_rule_entry* next; + char* name; + grib_expression* value; }; typedef struct grib_rule grib_rule; -struct grib_rule { - grib_rule* next; - grib_expression* condition; - grib_rule_entry* entries; +struct grib_rule +{ + grib_rule* next; + grib_expression* condition; + grib_rule_entry* entries; }; typedef struct grib_case grib_case; -struct grib_case { - grib_arguments* values; - grib_action* action; - grib_case* next; +struct grib_case +{ + grib_arguments* values; + grib_action* action; + grib_case* next; }; /* ----------*/ -typedef struct code_table_entry { - char* abbreviation; - char* title; - char* units; +typedef struct code_table_entry +{ + char* abbreviation; + char* title; + char* units; } code_table_entry; -struct grib_codetable { - char* filename[2]; - char* recomposed_name[2]; - grib_codetable* next; - size_t size; - code_table_entry entries[1]; +struct grib_codetable +{ + char* filename[2]; + char* recomposed_name[2]; + grib_codetable* next; + size_t size; + code_table_entry entries[1]; }; -typedef struct grib_smart_table_entry { - /*int code;*/ - char* abbreviation; - char* column[MAX_SMART_TABLE_COLUMNS]; +typedef struct grib_smart_table_entry +{ + /*int code;*/ + char* abbreviation; + char* column[MAX_SMART_TABLE_COLUMNS]; } grib_smart_table_entry; -struct grib_smart_table { - char* filename[3]; - char* recomposed_name[3]; - grib_smart_table* next; - size_t numberOfEntries; - grib_smart_table_entry* entries; +struct grib_smart_table +{ + char* filename[3]; + char* recomposed_name[3]; + grib_smart_table* next; + size_t numberOfEntries; + grib_smart_table_entry* entries; }; #if GRIB_TIMER -typedef struct grib_timer { - +typedef struct grib_timer +{ struct timeval start_; double timer_; - int active_; - char *name_; - int count_; + int active_; + char* name_; + int count_; long total_; int elapsed_; - double cpu_; - double total_cpu_; + double cpu_; + double total_cpu_; - char *statname_; + char* statname_; grib_context* context; - struct grib_timer *next_; + struct grib_timer* next_; } grib_timer; #else -typedef struct grib_timer { +typedef struct grib_timer +{ char nothing; } grib_timer; #endif -typedef struct j2k_encode_helper { - - size_t buffer_size; +typedef struct j2k_encode_helper +{ + size_t buffer_size; - long width; - long height; - long bits_per_value; + long width; + long height; + long bits_per_value; - float compression; + float compression; - long no_values; - const double* values; - double reference_value; - double divisor; - double decimal; + long no_values; + const double* values; + double reference_value; + double divisor; + double decimal; - long jpeg_length; - unsigned char* jpeg_buffer; + long jpeg_length; + unsigned char* jpeg_buffer; } j2k_encode_helper; @@ -1520,29 +1590,29 @@ typedef struct j2k_encode_helper { #ifndef grib_errors_internal_H #define grib_errors_internal_H /** Value mismatch */ -#define GRIB_VALUE_MISMATCH 1 +#define GRIB_VALUE_MISMATCH 1 /** double values are different */ -#define GRIB_DOUBLE_VALUE_MISMATCH 2 +#define GRIB_DOUBLE_VALUE_MISMATCH 2 /** long values are different */ -#define GRIB_LONG_VALUE_MISMATCH 3 +#define GRIB_LONG_VALUE_MISMATCH 3 /** byte values are different */ -#define GRIB_BYTE_VALUE_MISMATCH 4 +#define GRIB_BYTE_VALUE_MISMATCH 4 /** string values are different */ -#define GRIB_STRING_VALUE_MISMATCH 5 +#define GRIB_STRING_VALUE_MISMATCH 5 /** Offset mismatch */ -#define GRIB_OFFSET_MISMATCH 6 +#define GRIB_OFFSET_MISMATCH 6 /** Count mismatch */ -#define GRIB_COUNT_MISMATCH 7 +#define GRIB_COUNT_MISMATCH 7 /** Name mismatch */ -#define GRIB_NAME_MISMATCH 8 +#define GRIB_NAME_MISMATCH 8 /** Type mismatch */ -#define GRIB_TYPE_MISMATCH 9 +#define GRIB_TYPE_MISMATCH 9 /** Type and value mismatch */ -#define GRIB_TYPE_AND_VALUE_MISMATCH 10 +#define GRIB_TYPE_AND_VALUE_MISMATCH 10 /** Unable to compare accessors */ -#define GRIB_UNABLE_TO_COMPARE_ACCESSORS 11 +#define GRIB_UNABLE_TO_COMPARE_ACCESSORS 11 /** Unable to reset iterator */ -#define GRIB_UNABLE_TO_RESET_ITERATOR 12 +#define GRIB_UNABLE_TO_RESET_ITERATOR 12 /** Assertion failure */ -#define GRIB_ASSERTION_FAILURE 13 +#define GRIB_ASSERTION_FAILURE 13 #endif diff --git a/src/grib_api_prototypes.h b/src/grib_api_prototypes.h index 3a91d5c73..7eefcc17a 100644 --- a/src/grib_api_prototypes.h +++ b/src/grib_api_prototypes.h @@ -1,28 +1,28 @@ /* action.c */ -void grib_dump(grib_action *a, FILE *f, int l); -void grib_xref(grib_action *a, FILE *f, const char *path); -void grib_action_delete(grib_context *context, grib_action *a); -int grib_create_accessor(grib_section *p, grib_action *a, grib_loader *h); -int grib_action_notify_change(grib_action *a, grib_accessor *observer, grib_accessor *observed); -grib_action *grib_action_reparse(grib_action *a, grib_accessor *acc, int *doit); -int grib_action_execute(grib_action *a, grib_handle *h); -void grib_dump_action_branch(FILE *out, grib_action *a, int decay); -void grib_dump_action_tree(grib_context *ctx, FILE *out); -void grib_xref_action_branch(FILE *out, grib_action *a, const char *path); +void grib_dump(grib_action* a, FILE* f, int l); +void grib_xref(grib_action* a, FILE* f, const char* path); +void grib_action_delete(grib_context* context, grib_action* a); +int grib_create_accessor(grib_section* p, grib_action* a, grib_loader* h); +int grib_action_notify_change(grib_action* a, grib_accessor* observer, grib_accessor* observed); +grib_action* grib_action_reparse(grib_action* a, grib_accessor* acc, int* doit); +int grib_action_execute(grib_action* a, grib_handle* h); +void grib_dump_action_branch(FILE* out, grib_action* a, int decay); +void grib_dump_action_tree(grib_context* ctx, FILE* out); +void grib_xref_action_branch(FILE* out, grib_action* a, const char* path); /* action_class_alias.c */ -grib_action *grib_action_create_alias(grib_context *context, const char *name, const char *arg1, const char *name_space, int flags); +grib_action* grib_action_create_alias(grib_context* context, const char* name, const char* arg1, const char* name_space, int flags); /* action_class_gen.c */ -grib_action *grib_action_create_gen(grib_context *context, const char *name, const char *op, const long len, grib_arguments *params, grib_arguments *default_value, int flags, const char *name_space, const char *set); +grib_action* grib_action_create_gen(grib_context* context, const char* name, const char* op, const long len, grib_arguments* params, grib_arguments* default_value, int flags, const char* name_space, const char* set); /* action_class_if.c */ -grib_action *grib_action_create_if(grib_context *context, grib_expression *expression, grib_action *block_true, grib_action *block_false, int transient, int lineno, char *file_being_parsed); +grib_action* grib_action_create_if(grib_context* context, grib_expression* expression, grib_action* block_true, grib_action* block_false, int transient, int lineno, char* file_being_parsed); /* action_class_switch.c */ -grib_action *grib_action_create_switch(grib_context *context, grib_arguments *args, grib_case *Case, grib_action *Default); -grib_case *grib_case_new(grib_context *c, grib_arguments *values, grib_action *action); +grib_action* grib_action_create_switch(grib_context* context, grib_arguments* args, grib_case* Case, grib_action* Default); +grib_case* grib_case_new(grib_context* c, grib_arguments* values, grib_action* action); /* grib_accessor_class_g1fcperiod.c */ @@ -33,245 +33,245 @@ grib_case *grib_case_new(grib_context *c, grib_arguments *values, grib_action *a /* action_class_section.c */ /* action_class_list.c */ -grib_action *grib_action_create_list(grib_context *context, const char *name, grib_expression *expression, grib_action *block); +grib_action* grib_action_create_list(grib_context* context, const char* name, grib_expression* expression, grib_action* block); /* action_class_while.c */ -grib_action *grib_action_create_while(grib_context *context, grib_expression *expression, grib_action *block); +grib_action* grib_action_create_while(grib_context* context, grib_expression* expression, grib_action* block); /* action_class_put.c */ -grib_action *grib_action_create_put(grib_context *context, const char *name, grib_arguments *args); +grib_action* grib_action_create_put(grib_context* context, const char* name, grib_arguments* args); /* action_class_meta.c */ -grib_action *grib_action_create_meta(grib_context *context, const char *name, const char *op, grib_arguments *params, grib_arguments *default_value, unsigned long flags, const char *name_space); +grib_action* grib_action_create_meta(grib_context* context, const char* name, const char* op, grib_arguments* params, grib_arguments* default_value, unsigned long flags, const char* name_space); /* action_class_remove.c */ -grib_action *grib_action_create_remove(grib_context *context, grib_arguments *args); +grib_action* grib_action_create_remove(grib_context* context, grib_arguments* args); /* action_class_rename.c */ -grib_action *grib_action_create_rename(grib_context *context, char *the_old, char *the_new); +grib_action* grib_action_create_rename(grib_context* context, char* the_old, char* the_new); /* action_class_assert.c */ -grib_action *grib_action_create_assert(grib_context *context, grib_expression *expression); +grib_action* grib_action_create_assert(grib_context* context, grib_expression* expression); /* action_class_template.c */ -grib_action *grib_action_create_template(grib_context *context, int nofail, const char *name, const char *arg1); -grib_action *get_empty_template(grib_context *c, int *err); +grib_action* grib_action_create_template(grib_context* context, int nofail, const char* name, const char* arg1); +grib_action* get_empty_template(grib_context* c, int* err); /* action_class_trigger.c */ -grib_action *grib_action_create_trigger(grib_context *context, grib_arguments *args, grib_action *block); +grib_action* grib_action_create_trigger(grib_context* context, grib_arguments* args, grib_action* block); /* action_class_when.c */ -grib_action *grib_action_create_when(grib_context *context, grib_expression *expression, grib_action *block_true, grib_action *block_false); +grib_action* grib_action_create_when(grib_context* context, grib_expression* expression, grib_action* block_true, grib_action* block_false); /* action_class_concept.c */ -grib_concept_value *action_concept_get_concept(grib_accessor *a); -int action_concept_get_nofail(grib_accessor *a); -grib_action *grib_action_create_concept(grib_context *context, const char *name, grib_concept_value *concept, const char *basename, const char *name_space, const char *defaultkey, const char *masterDir, const char *localDir, const char *ecmfDir, int flags, int nofail); +grib_concept_value* action_concept_get_concept(grib_accessor* a); +int action_concept_get_nofail(grib_accessor* a); +grib_action* grib_action_create_concept(grib_context* context, const char* name, grib_concept_value* concept, const char* basename, const char* name_space, const char* defaultkey, const char* masterDir, const char* localDir, const char* ecmfDir, int flags, int nofail); int get_concept_condition_string(grib_handle* h, const char* key, const char* value, char* result); /* action_class_hash_array.c */ -grib_action *grib_action_create_hash_array(grib_context *context, const char *name, grib_hash_array_value *hash_array, const char *basename, const char *name_space, const char *defaultkey, const char *masterDir, const char *localDir, const char *ecmfDir, int flags, int nofail); -grib_hash_array_value *get_hash_array(grib_handle *h, grib_action *a); +grib_action* grib_action_create_hash_array(grib_context* context, const char* name, grib_hash_array_value* hash_array, const char* basename, const char* name_space, const char* defaultkey, const char* masterDir, const char* localDir, const char* ecmfDir, int flags, int nofail); +grib_hash_array_value* get_hash_array(grib_handle* h, grib_action* a); /* action_class_set.c */ -grib_action *grib_action_create_set(grib_context *context, const char *name, grib_expression *expression, int nofail); +grib_action* grib_action_create_set(grib_context* context, const char* name, grib_expression* expression, int nofail); /* action_class_set_darray.c */ -grib_action *grib_action_create_set_darray(grib_context *context, const char *name, grib_darray *darray); +grib_action* grib_action_create_set_darray(grib_context* context, const char* name, grib_darray* darray); /* action_class_set_iarray.c */ -grib_action *grib_action_create_set_iarray(grib_context *context, const char *name, grib_iarray *iarray); +grib_action* grib_action_create_set_iarray(grib_context* context, const char* name, grib_iarray* iarray); /* action_class_set_sarray.c */ -grib_action *grib_action_create_set_sarray(grib_context *context, const char *name, grib_sarray *sarray); +grib_action* grib_action_create_set_sarray(grib_context* context, const char* name, grib_sarray* sarray); /* action_class_noop.c */ -grib_action *grib_action_create_noop(grib_context *context, const char *fname); +grib_action* grib_action_create_noop(grib_context* context, const char* fname); /* action_class_write.c */ -grib_action *grib_action_create_write(grib_context *context, const char *name, int append, int padtomultiple); +grib_action* grib_action_create_write(grib_context* context, const char* name, int append, int padtomultiple); /* action_class_print.c */ -grib_action *grib_action_create_print(grib_context *context, const char *name, char *outname); +grib_action* grib_action_create_print(grib_context* context, const char* name, char* outname); /* action_class_close.c */ -grib_action *grib_action_create_close(grib_context *context, char *filename); +grib_action* grib_action_create_close(grib_context* context, char* filename); /* action_class_variable.c */ -grib_action *grib_action_create_variable(grib_context *context, const char *name, const char *op, const long len, grib_arguments *params, grib_arguments *default_value, int flags, const char *name_space); +grib_action* grib_action_create_variable(grib_context* context, const char* name, const char* op, const long len, grib_arguments* params, grib_arguments* default_value, int flags, const char* name_space); /* action_class_modify.c */ -grib_action *grib_action_create_modify(grib_context *context, const char *name, long flags); +grib_action* grib_action_create_modify(grib_context* context, const char* name, long flags); /* action_class_transient_darray.c */ -grib_action *grib_action_create_transient_darray(grib_context *context, const char *name, grib_darray *darray, int flags); +grib_action* grib_action_create_transient_darray(grib_context* context, const char* name, grib_darray* darray, int flags); /* grib_accessor.c */ -void grib_accessor_dump(grib_accessor *a, grib_dumper *f); -int grib_pack_missing(grib_accessor *a); -int grib_pack_zero(grib_accessor *a); -int grib_is_missing_internal(grib_accessor *a); -int grib_pack_double(grib_accessor *a, const double *v, size_t *len); -int grib_pack_expression(grib_accessor *a, grib_expression *e); -int grib_pack_string(grib_accessor *a, const char *v, size_t *len); -int grib_pack_string_array(grib_accessor *a, const char **v, size_t *len); -int grib_pack_long(grib_accessor *a, const long *v, size_t *len); -int grib_pack_bytes(grib_accessor *a, const unsigned char *v, size_t *len); -int grib_unpack_bytes(grib_accessor *a, unsigned char *v, size_t *len); -int grib_unpack_double_subarray(grib_accessor *a, double *v, size_t start, size_t len); -int grib_unpack_double(grib_accessor *a, double *v, size_t *len); -int grib_unpack_double_element(grib_accessor *a, size_t i, double *v); -int grib_unpack_string(grib_accessor *a, char *v, size_t *len); -int grib_unpack_string_array(grib_accessor *a, char **v, size_t *len); -int grib_accessors_list_unpack_long(grib_accessors_list *al, long *val, size_t *buffer_len); -int grib_accessors_list_unpack_double(grib_accessors_list *al, double *val, size_t *buffer_len); -int grib_accessors_list_unpack_string(grib_accessors_list *al, char **val, size_t *buffer_len); -int grib_unpack_long(grib_accessor *a, long *v, size_t *len); -long grib_accessor_get_native_type(grib_accessor *a); -long grib_get_next_position_offset(grib_accessor *a); -long grib_string_length(grib_accessor *a); -long grib_byte_offset(grib_accessor *a); -long grib_byte_count(grib_accessor *a); -int grib_value_count(grib_accessor *a, long *count); -int grib_accessors_list_value_count(grib_accessors_list *al, size_t *count); -int grib_accessor_notify_change(grib_accessor *a, grib_accessor *changed); -void grib_init_accessor(grib_accessor *a, const long len, grib_arguments *args); -void grib_accessor_delete(grib_context *ct, grib_accessor *a); -grib_accessor *grib_accessor_clone(grib_accessor *a, grib_section *s, int *err); -void grib_update_size(grib_accessor *a, size_t len); -int grib_nearest_smaller_value(grib_accessor *a, double val, double *nearest); -size_t grib_preferred_size(grib_accessor *a, int from_handle); -grib_accessor *grib_next_accessor(grib_accessor *a); -void grib_resize(grib_accessor *a, size_t new_size); -int grib_compare_accessors(grib_accessor *a1, grib_accessor *a2, int compare_flags); -const char *grib_get_type_name(int type); -int grib_accessor_add_attribute(grib_accessor *a, grib_accessor *attr, int nest_if_clash); -int grib_accessor_replace_attribute(grib_accessor *a, grib_accessor *attr); -int grib_accessor_delete_attribute(grib_accessor *a, const char *name); -grib_accessor *grib_accessor_get_attribute_by_index(grib_accessor *a, int index); -const char *grib_accessor_get_name(grib_accessor *a); -grib_accessor *_grib_accessor_get_attribute(grib_accessor *a, const char *name, int *index); -int grib_accessor_has_attributes(grib_accessor *a); -grib_accessor *grib_accessor_get_attribute(grib_accessor *a, const char *name); -grib_accessors_list *grib_accessors_list_create(grib_context *c); -void grib_accessors_list_push(grib_accessors_list *al, grib_accessor *a, int rank); -grib_accessors_list *grib_accessors_list_last(grib_accessors_list *al); -grib_accessors_list *grib_accessors_list_find(grib_accessors_list *al, grib_accessor *a); -void grib_accessors_list_delete(grib_context *c, grib_accessors_list *al); +void grib_accessor_dump(grib_accessor* a, grib_dumper* f); +int grib_pack_missing(grib_accessor* a); +int grib_pack_zero(grib_accessor* a); +int grib_is_missing_internal(grib_accessor* a); +int grib_pack_double(grib_accessor* a, const double* v, size_t* len); +int grib_pack_expression(grib_accessor* a, grib_expression* e); +int grib_pack_string(grib_accessor* a, const char* v, size_t* len); +int grib_pack_string_array(grib_accessor* a, const char** v, size_t* len); +int grib_pack_long(grib_accessor* a, const long* v, size_t* len); +int grib_pack_bytes(grib_accessor* a, const unsigned char* v, size_t* len); +int grib_unpack_bytes(grib_accessor* a, unsigned char* v, size_t* len); +int grib_unpack_double_subarray(grib_accessor* a, double* v, size_t start, size_t len); +int grib_unpack_double(grib_accessor* a, double* v, size_t* len); +int grib_unpack_double_element(grib_accessor* a, size_t i, double* v); +int grib_unpack_string(grib_accessor* a, char* v, size_t* len); +int grib_unpack_string_array(grib_accessor* a, char** v, size_t* len); +int grib_accessors_list_unpack_long(grib_accessors_list* al, long* val, size_t* buffer_len); +int grib_accessors_list_unpack_double(grib_accessors_list* al, double* val, size_t* buffer_len); +int grib_accessors_list_unpack_string(grib_accessors_list* al, char** val, size_t* buffer_len); +int grib_unpack_long(grib_accessor* a, long* v, size_t* len); +long grib_accessor_get_native_type(grib_accessor* a); +long grib_get_next_position_offset(grib_accessor* a); +long grib_string_length(grib_accessor* a); +long grib_byte_offset(grib_accessor* a); +long grib_byte_count(grib_accessor* a); +int grib_value_count(grib_accessor* a, long* count); +int grib_accessors_list_value_count(grib_accessors_list* al, size_t* count); +int grib_accessor_notify_change(grib_accessor* a, grib_accessor* changed); +void grib_init_accessor(grib_accessor* a, const long len, grib_arguments* args); +void grib_accessor_delete(grib_context* ct, grib_accessor* a); +grib_accessor* grib_accessor_clone(grib_accessor* a, grib_section* s, int* err); +void grib_update_size(grib_accessor* a, size_t len); +int grib_nearest_smaller_value(grib_accessor* a, double val, double* nearest); +size_t grib_preferred_size(grib_accessor* a, int from_handle); +grib_accessor* grib_next_accessor(grib_accessor* a); +void grib_resize(grib_accessor* a, size_t new_size); +int grib_compare_accessors(grib_accessor* a1, grib_accessor* a2, int compare_flags); +const char* grib_get_type_name(int type); +int grib_accessor_add_attribute(grib_accessor* a, grib_accessor* attr, int nest_if_clash); +int grib_accessor_replace_attribute(grib_accessor* a, grib_accessor* attr); +int grib_accessor_delete_attribute(grib_accessor* a, const char* name); +grib_accessor* grib_accessor_get_attribute_by_index(grib_accessor* a, int index); +const char* grib_accessor_get_name(grib_accessor* a); +grib_accessor* _grib_accessor_get_attribute(grib_accessor* a, const char* name, int* index); +int grib_accessor_has_attributes(grib_accessor* a); +grib_accessor* grib_accessor_get_attribute(grib_accessor* a, const char* name); +grib_accessors_list* grib_accessors_list_create(grib_context* c); +void grib_accessors_list_push(grib_accessors_list* al, grib_accessor* a, int rank); +grib_accessors_list* grib_accessors_list_last(grib_accessors_list* al); +grib_accessors_list* grib_accessors_list_find(grib_accessors_list* al, grib_accessor* a); +void grib_accessors_list_delete(grib_context* c, grib_accessors_list* al); /* grib_concept.c */ -grib_concept_value *grib_concept_value_new(grib_context *c, const char *name, grib_concept_condition *conditions); -void grib_concept_value_delete(grib_context *c, grib_concept_value *v); -grib_concept_condition *grib_concept_condition_new(grib_context *c, const char *name, grib_expression *expression, grib_iarray *iarray); -void grib_concept_condition_delete(grib_context *c, grib_concept_condition *v); +grib_concept_value* grib_concept_value_new(grib_context* c, const char* name, grib_concept_condition* conditions); +void grib_concept_value_delete(grib_context* c, grib_concept_value* v); +grib_concept_condition* grib_concept_condition_new(grib_context* c, const char* name, grib_expression* expression, grib_iarray* iarray); +void grib_concept_condition_delete(grib_context* c, grib_concept_condition* v); /* grib_hash_array.c */ -grib_hash_array_value *grib_integer_hash_array_value_new(grib_context *c, const char *name, grib_iarray *array); -grib_hash_array_value *grib_double_hash_array_value_new(grib_context *c, const char *name, grib_darray *array); -void grib_hash_array_value_delete(grib_context *c, grib_hash_array_value *v); +grib_hash_array_value* grib_integer_hash_array_value_new(grib_context* c, const char* name, grib_iarray* array); +grib_hash_array_value* grib_double_hash_array_value_new(grib_context* c, const char* name, grib_darray* array); +void grib_hash_array_value_delete(grib_context* c, grib_hash_array_value* v); /* grib_bufr_descriptor.c */ -bufr_descriptor *grib_bufr_descriptor_new(grib_accessor *tables_accessor, int code, int *err); -bufr_descriptor *grib_bufr_descriptor_clone(bufr_descriptor *d); -int grib_bufr_descriptor_set_code(grib_accessor *tables_accessor, int code, bufr_descriptor *v); -void grib_bufr_descriptor_set_reference(bufr_descriptor *v, long reference); -void grib_bufr_descriptor_set_width(bufr_descriptor *v, long width); -void grib_bufr_descriptor_set_scale(bufr_descriptor *v, long scale); -int grib_bufr_descriptor_can_be_missing(bufr_descriptor *v); -void grib_bufr_descriptor_delete(bufr_descriptor *v); +bufr_descriptor* grib_bufr_descriptor_new(grib_accessor* tables_accessor, int code, int* err); +bufr_descriptor* grib_bufr_descriptor_clone(bufr_descriptor* d); +int grib_bufr_descriptor_set_code(grib_accessor* tables_accessor, int code, bufr_descriptor* v); +void grib_bufr_descriptor_set_reference(bufr_descriptor* v, long reference); +void grib_bufr_descriptor_set_width(bufr_descriptor* v, long width); +void grib_bufr_descriptor_set_scale(bufr_descriptor* v, long scale); +int grib_bufr_descriptor_can_be_missing(bufr_descriptor* v); +void grib_bufr_descriptor_delete(bufr_descriptor* v); /* grib_bufr_descriptors_array.c */ -bufr_descriptors_array *grib_bufr_descriptors_array_new(grib_context *c, size_t size, size_t incsize); -bufr_descriptor *grib_bufr_descriptors_array_pop(bufr_descriptors_array *a); -bufr_descriptor *grib_bufr_descriptors_array_pop_front(bufr_descriptors_array *a); -bufr_descriptors_array *grib_bufr_descriptors_array_resize_to(bufr_descriptors_array *v, size_t newsize); -bufr_descriptors_array *grib_bufr_descriptors_array_resize(bufr_descriptors_array *v); -bufr_descriptors_array *grib_bufr_descriptors_array_push(bufr_descriptors_array *v, bufr_descriptor *val); -bufr_descriptors_array *grib_bufr_descriptors_array_append(bufr_descriptors_array *v, bufr_descriptors_array *ar); -bufr_descriptors_array *grib_bufr_descriptors_array_push_front(bufr_descriptors_array *v, bufr_descriptor *val); -bufr_descriptor *grib_bufr_descriptors_array_get(bufr_descriptors_array *a, size_t i); -void grib_bufr_descriptors_array_set(bufr_descriptors_array *a, size_t i, bufr_descriptor *v); -void grib_bufr_descriptors_array_delete(bufr_descriptors_array *v); -void grib_bufr_descriptors_array_delete_array(bufr_descriptors_array *v); -bufr_descriptor **grib_bufr_descriptors_array_get_array(bufr_descriptors_array *v); -size_t grib_bufr_descriptors_array_used_size(bufr_descriptors_array *v); +bufr_descriptors_array* grib_bufr_descriptors_array_new(grib_context* c, size_t size, size_t incsize); +bufr_descriptor* grib_bufr_descriptors_array_pop(bufr_descriptors_array* a); +bufr_descriptor* grib_bufr_descriptors_array_pop_front(bufr_descriptors_array* a); +bufr_descriptors_array* grib_bufr_descriptors_array_resize_to(bufr_descriptors_array* v, size_t newsize); +bufr_descriptors_array* grib_bufr_descriptors_array_resize(bufr_descriptors_array* v); +bufr_descriptors_array* grib_bufr_descriptors_array_push(bufr_descriptors_array* v, bufr_descriptor* val); +bufr_descriptors_array* grib_bufr_descriptors_array_append(bufr_descriptors_array* v, bufr_descriptors_array* ar); +bufr_descriptors_array* grib_bufr_descriptors_array_push_front(bufr_descriptors_array* v, bufr_descriptor* val); +bufr_descriptor* grib_bufr_descriptors_array_get(bufr_descriptors_array* a, size_t i); +void grib_bufr_descriptors_array_set(bufr_descriptors_array* a, size_t i, bufr_descriptor* v); +void grib_bufr_descriptors_array_delete(bufr_descriptors_array* v); +void grib_bufr_descriptors_array_delete_array(bufr_descriptors_array* v); +bufr_descriptor** grib_bufr_descriptors_array_get_array(bufr_descriptors_array* v); +size_t grib_bufr_descriptors_array_used_size(bufr_descriptors_array* v); /* grib_darray.c */ void grib_darray_print(const char* title, const grib_darray* darray); -grib_darray *grib_darray_new_from_array(grib_context *c, double *a, size_t size); -grib_darray *grib_darray_new(grib_context *c, size_t size, size_t incsize); -grib_darray *grib_darray_resize(grib_context *c, grib_darray *v); -grib_darray *grib_darray_push(grib_context *c, grib_darray *v, double val); -void grib_darray_delete(grib_context *c, grib_darray *v); -double *grib_darray_get_array(grib_context *c, grib_darray *v); -int grib_darray_is_constant(grib_darray *v, double eps); -size_t grib_darray_used_size(grib_darray *v); +grib_darray* grib_darray_new_from_array(grib_context* c, double* a, size_t size); +grib_darray* grib_darray_new(grib_context* c, size_t size, size_t incsize); +grib_darray* grib_darray_resize(grib_context* c, grib_darray* v); +grib_darray* grib_darray_push(grib_context* c, grib_darray* v, double val); +void grib_darray_delete(grib_context* c, grib_darray* v); +double* grib_darray_get_array(grib_context* c, grib_darray* v); +int grib_darray_is_constant(grib_darray* v, double eps); +size_t grib_darray_used_size(grib_darray* v); /* grib_sarray.c */ -grib_sarray *grib_sarray_new(grib_context *c, size_t size, size_t incsize); -grib_sarray *grib_sarray_resize(grib_context *c, grib_sarray *v); -grib_sarray *grib_sarray_push(grib_context *c, grib_sarray *v, char *val); -void grib_sarray_delete(grib_context *c, grib_sarray *v); -void grib_sarray_delete_content(grib_context *c, grib_sarray *v); -char **grib_sarray_get_array(grib_context *c, grib_sarray *v); -size_t grib_sarray_used_size(grib_sarray *v); +grib_sarray* grib_sarray_new(grib_context* c, size_t size, size_t incsize); +grib_sarray* grib_sarray_resize(grib_context* c, grib_sarray* v); +grib_sarray* grib_sarray_push(grib_context* c, grib_sarray* v, char* val); +void grib_sarray_delete(grib_context* c, grib_sarray* v); +void grib_sarray_delete_content(grib_context* c, grib_sarray* v); +char** grib_sarray_get_array(grib_context* c, grib_sarray* v); +size_t grib_sarray_used_size(grib_sarray* v); /* grib_oarray.c */ -grib_oarray *grib_oarray_new(grib_context *c, size_t size, size_t incsize); -grib_oarray *grib_oarray_resize(grib_context *c, grib_oarray *v); -grib_oarray *grib_oarray_push(grib_context *c, grib_oarray *v, void *val); -void grib_oarray_delete(grib_context *c, grib_oarray *v); -void grib_oarray_delete_content(grib_context *c, grib_oarray *v); -void **grib_oarray_get_array(grib_context *c, grib_oarray *v); -void *grib_oarray_get(grib_oarray *v, int i); -size_t grib_oarray_used_size(grib_oarray *v); +grib_oarray* grib_oarray_new(grib_context* c, size_t size, size_t incsize); +grib_oarray* grib_oarray_resize(grib_context* c, grib_oarray* v); +grib_oarray* grib_oarray_push(grib_context* c, grib_oarray* v, void* val); +void grib_oarray_delete(grib_context* c, grib_oarray* v); +void grib_oarray_delete_content(grib_context* c, grib_oarray* v); +void** grib_oarray_get_array(grib_context* c, grib_oarray* v); +void* grib_oarray_get(grib_oarray* v, int i); +size_t grib_oarray_used_size(grib_oarray* v); /* grib_iarray.c */ void grib_iarray_print(const char* title, const grib_iarray* iarray); -grib_iarray *grib_iarray_new_from_array(grib_context *c, long *a, size_t size); -grib_iarray *grib_iarray_new(grib_context *c, size_t size, size_t incsize); -long grib_iarray_pop(grib_iarray *a); -long grib_iarray_pop_front(grib_iarray *a); -grib_iarray *grib_iarray_resize_to(grib_iarray *v, size_t newsize); -grib_iarray *grib_iarray_resize(grib_iarray *v); -grib_iarray *grib_iarray_push(grib_iarray *v, long val); -grib_iarray *grib_iarray_push_front(grib_iarray *v, long val); -grib_iarray *grib_iarray_push_array(grib_iarray *v, long *val, size_t size); -long grib_iarray_get(grib_iarray *a, size_t i); -void grib_iarray_set(grib_iarray *a, size_t i, long v); -void grib_iarray_delete(grib_iarray *v); -void grib_iarray_delete_array(grib_iarray *v); -long *grib_iarray_get_array(grib_iarray *v); -size_t grib_iarray_used_size(grib_iarray *v); -int grib_iarray_is_constant(grib_iarray *v); +grib_iarray* grib_iarray_new_from_array(grib_context* c, long* a, size_t size); +grib_iarray* grib_iarray_new(grib_context* c, size_t size, size_t incsize); +long grib_iarray_pop(grib_iarray* a); +long grib_iarray_pop_front(grib_iarray* a); +grib_iarray* grib_iarray_resize_to(grib_iarray* v, size_t newsize); +grib_iarray* grib_iarray_resize(grib_iarray* v); +grib_iarray* grib_iarray_push(grib_iarray* v, long val); +grib_iarray* grib_iarray_push_front(grib_iarray* v, long val); +grib_iarray* grib_iarray_push_array(grib_iarray* v, long* val, size_t size); +long grib_iarray_get(grib_iarray* a, size_t i); +void grib_iarray_set(grib_iarray* a, size_t i, long v); +void grib_iarray_delete(grib_iarray* v); +void grib_iarray_delete_array(grib_iarray* v); +long* grib_iarray_get_array(grib_iarray* v); +size_t grib_iarray_used_size(grib_iarray* v); +int grib_iarray_is_constant(grib_iarray* v); /* grib_vdarray.c */ void grib_vdarray_print(const char* title, const grib_vdarray* vdarray); -grib_vdarray *grib_vdarray_new(grib_context *c, size_t size, size_t incsize); -grib_vdarray *grib_vdarray_resize(grib_context *c, grib_vdarray *v); -grib_vdarray *grib_vdarray_push(grib_context *c, grib_vdarray *v, grib_darray *val); -void grib_vdarray_delete(grib_context *c, grib_vdarray *v); -void grib_vdarray_delete_content(grib_context *c, grib_vdarray *v); -grib_darray **grib_vdarray_get_array(grib_context *c, grib_vdarray *v); -size_t grib_vdarray_used_size(grib_vdarray *v); +grib_vdarray* grib_vdarray_new(grib_context* c, size_t size, size_t incsize); +grib_vdarray* grib_vdarray_resize(grib_context* c, grib_vdarray* v); +grib_vdarray* grib_vdarray_push(grib_context* c, grib_vdarray* v, grib_darray* val); +void grib_vdarray_delete(grib_context* c, grib_vdarray* v); +void grib_vdarray_delete_content(grib_context* c, grib_vdarray* v); +grib_darray** grib_vdarray_get_array(grib_context* c, grib_vdarray* v); +size_t grib_vdarray_used_size(grib_vdarray* v); /* grib_vsarray.c */ -grib_vsarray *grib_vsarray_new(grib_context *c, size_t size, size_t incsize); -grib_vsarray *grib_vsarray_resize(grib_context *c, grib_vsarray *v); -grib_vsarray *grib_vsarray_push(grib_context *c, grib_vsarray *v, grib_sarray *val); -void grib_vsarray_delete(grib_context *c, grib_vsarray *v); -void grib_vsarray_delete_content(grib_context *c, grib_vsarray *v); -grib_sarray **grib_vsarray_get_array(grib_context *c, grib_vsarray *v); -size_t grib_vsarray_used_size(grib_vsarray *v); +grib_vsarray* grib_vsarray_new(grib_context* c, size_t size, size_t incsize); +grib_vsarray* grib_vsarray_resize(grib_context* c, grib_vsarray* v); +grib_vsarray* grib_vsarray_push(grib_context* c, grib_vsarray* v, grib_sarray* val); +void grib_vsarray_delete(grib_context* c, grib_vsarray* v); +void grib_vsarray_delete_content(grib_context* c, grib_vsarray* v); +grib_sarray** grib_vsarray_get_array(grib_context* c, grib_vsarray* v); +size_t grib_vsarray_used_size(grib_vsarray* v); /* grib_viarray.c */ -grib_viarray *grib_viarray_new(grib_context *c, size_t size, size_t incsize); -grib_viarray *grib_viarray_resize(grib_context *c, grib_viarray *v); -grib_viarray *grib_viarray_push(grib_context *c, grib_viarray *v, grib_iarray *val); -void grib_viarray_delete(grib_context *c, grib_viarray *v); -void grib_viarray_delete_content(grib_context *c, grib_viarray *v); -grib_iarray **grib_viarray_get_array(grib_context *c, grib_viarray *v); -size_t grib_viarray_used_size(grib_viarray *v); +grib_viarray* grib_viarray_new(grib_context* c, size_t size, size_t incsize); +grib_viarray* grib_viarray_resize(grib_context* c, grib_viarray* v); +grib_viarray* grib_viarray_push(grib_context* c, grib_viarray* v, grib_iarray* val); +void grib_viarray_delete(grib_context* c, grib_viarray* v); +void grib_viarray_delete_content(grib_context* c, grib_viarray* v); +grib_iarray** grib_viarray_get_array(grib_context* c, grib_viarray* v); +size_t grib_viarray_used_size(grib_viarray* v); /* grib_accessor_class_array.c */ @@ -292,25 +292,25 @@ size_t grib_viarray_used_size(grib_viarray *v); /* grib_accessor_class_bufr_clear_tables.c */ /* grib_accessor_class_bufr_data_array.c */ -grib_vsarray *accessor_bufr_data_array_get_stringValues(grib_accessor *a); -grib_accessors_list *accessor_bufr_data_array_get_dataAccessors(grib_accessor *a); -grib_trie_with_rank *accessor_bufr_data_array_get_dataAccessorsTrie(grib_accessor *a); -void accessor_bufr_data_array_set_unpackMode(grib_accessor *a, int unpackMode); +grib_vsarray* accessor_bufr_data_array_get_stringValues(grib_accessor* a); +grib_accessors_list* accessor_bufr_data_array_get_dataAccessors(grib_accessor* a); +grib_trie_with_rank* accessor_bufr_data_array_get_dataAccessorsTrie(grib_accessor* a); +void accessor_bufr_data_array_set_unpackMode(grib_accessor* a, int unpackMode); /* grib_accessor_class_bufr_data_element.c */ -void accessor_bufr_data_element_set_index(grib_accessor *a, long index); -void accessor_bufr_data_element_set_type(grib_accessor *a, int type); -void accessor_bufr_data_element_set_numberOfSubsets(grib_accessor *a, long numberOfSubsets); -void accessor_bufr_data_element_set_subsetNumber(grib_accessor *a, long subsetNumber); -void accessor_bufr_data_element_set_compressedData(grib_accessor *a, int compressedData); -void accessor_bufr_data_element_set_descriptors(grib_accessor *a, bufr_descriptors_array *descriptors); -void accessor_bufr_data_element_set_numericValues(grib_accessor *a, grib_vdarray *numericValues); -void accessor_bufr_data_element_set_stringValues(grib_accessor *a, grib_vsarray *stringValues); -void accessor_bufr_data_element_set_elementsDescriptorsIndex(grib_accessor *a, grib_viarray *elementsDescriptorsIndex); +void accessor_bufr_data_element_set_index(grib_accessor* a, long index); +void accessor_bufr_data_element_set_type(grib_accessor* a, int type); +void accessor_bufr_data_element_set_numberOfSubsets(grib_accessor* a, long numberOfSubsets); +void accessor_bufr_data_element_set_subsetNumber(grib_accessor* a, long subsetNumber); +void accessor_bufr_data_element_set_compressedData(grib_accessor* a, int compressedData); +void accessor_bufr_data_element_set_descriptors(grib_accessor* a, bufr_descriptors_array* descriptors); +void accessor_bufr_data_element_set_numericValues(grib_accessor* a, grib_vdarray* numericValues); +void accessor_bufr_data_element_set_stringValues(grib_accessor* a, grib_vsarray* stringValues); +void accessor_bufr_data_element_set_elementsDescriptorsIndex(grib_accessor* a, grib_viarray* elementsDescriptorsIndex); /* grib_accessor_class_bufr_elements_table.c */ -int bufr_descriptor_is_marker(bufr_descriptor *d); -bufr_descriptor *accessor_bufr_elements_table_get_descriptor(grib_accessor *a, int code, int *err); +int bufr_descriptor_is_marker(bufr_descriptor* d); +bufr_descriptor* accessor_bufr_elements_table_get_descriptor(grib_accessor* a, int code, int* err); /* grib_accessor_class_bufr_group.c */ @@ -329,7 +329,7 @@ bufr_descriptor *accessor_bufr_elements_table_get_descriptor(grib_accessor *a, i /* grib_accessor_class_bufr_has_delayed_replication.c */ /* grib_accessor_class_apply_operators.c */ -size_t compute_size_AO(long *descriptors, size_t numberOfDescriptors); +size_t compute_size_AO(long* descriptors, size_t numberOfDescriptors); /* grib_accessor_class_non_alpha.c */ @@ -354,14 +354,14 @@ size_t compute_size_AO(long *descriptors, size_t numberOfDescriptors); /* grib_accessor_class_bytes.c */ /* grib_accessor_class.c */ -grib_section *grib_create_root_section(const grib_context *context, grib_handle *h); -grib_accessor *grib_accessor_factory(grib_section *p, grib_action *creator, const long len, grib_arguments *params); -void grib_push_accessor(grib_accessor *a, grib_block_of_accessors *l); -void grib_section_post_init(grib_section *s); -int grib_section_adjust_sizes(grib_section *s, int update, int depth); -int grib_get_block_length(grib_section *s, size_t *l); -grib_accessor *find_paddings(grib_section *s); -void grib_update_paddings(grib_section *s); +grib_section* grib_create_root_section(const grib_context* context, grib_handle* h); +grib_accessor* grib_accessor_factory(grib_section* p, grib_action* creator, const long len, grib_arguments* params); +void grib_push_accessor(grib_accessor* a, grib_block_of_accessors* l); +void grib_section_post_init(grib_section* s); +int grib_section_adjust_sizes(grib_section* s, int update, int depth); +int grib_get_block_length(grib_section* s, size_t* l); +grib_accessor* find_paddings(grib_section* s); +void grib_update_paddings(grib_section* s); /* grib_accessor_class_change_scanning_direction.c */ @@ -370,12 +370,12 @@ void grib_update_paddings(grib_section *s); /* grib_accessor_class_codeflag.c */ /* grib_accessor_class_smart_table.c */ -void grib_smart_table_delete(grib_context *c); +void grib_smart_table_delete(grib_context* c); /* grib_accessor_class_smart_table_column.c */ /* grib_accessor_class_codetable.c */ -void grib_codetable_delete(grib_context *c); +void grib_codetable_delete(grib_context* c); /* grib_accessor_class_codetable_units.c */ @@ -410,8 +410,8 @@ void grib_codetable_delete(grib_context *c); /* grib_accessor_class_g1forecastmonth.c */ /* grib_accessor_class_g1step_range.c */ -int grib_g1_step_get_steps(grib_accessor *a, long *start, long *theEnd); -int grib_g1_step_apply_units(long *start, long *theEnd, long *step_unit, long *P1, long *P2, long *unit, const int max, const int instant); +int grib_g1_step_get_steps(grib_accessor* a, long* start, long* theEnd); +int grib_g1_step_apply_units(long* start, long* theEnd, long* step_unit, long* P1, long* P2, long* unit, const int max, const int instant); /* grib_accessor_class_g2step_range.c */ @@ -516,19 +516,19 @@ int grib_g1_step_apply_units(long *start, long *theEnd, long *step_unit, long *P /* grib_accessor_class_ieeefloat.c */ /* grib_accessor_class_constant.c */ -void accessor_constant_set_type(grib_accessor *a, int type); -void accessor_constant_set_dval(grib_accessor *a, double dval); +void accessor_constant_set_type(grib_accessor* a, int type); +void accessor_constant_set_dval(grib_accessor* a, double dval); /* grib_accessor_class_iterator.c */ -grib_iterator *grib_iterator_new(const grib_handle *h, unsigned long flags, int *error); +grib_iterator* grib_iterator_new(const grib_handle* h, unsigned long flags, int* error); /* grib_accessor_class_message.c */ /* grib_accessor_class_nearest.c */ -grib_nearest *grib_nearest_new(const grib_handle *h, int *error); +grib_nearest* grib_nearest_new(const grib_handle* h, int* error); /* grib_accessor_class_box.c */ -grib_box *grib_box_new(grib_handle *h, int *error); +grib_box* grib_box_new(grib_handle* h, int* error); /* grib_accessor_class_ksec1expver.c */ @@ -571,7 +571,7 @@ grib_box *grib_box_new(grib_handle *h, int *error); /* grib_accessor_class_section_length.c */ /* grib_accessor_class_g1_message_length.c */ -int grib_get_g1_message_size(grib_handle *h, grib_accessor *tl, grib_accessor *s4, long *total_length, long *sec4_len); +int grib_get_g1_message_size(grib_handle* h, grib_accessor* tl, grib_accessor* s4, long* total_length, long* sec4_len); /* grib_accessor_class_g1_section4_length.c */ @@ -620,11 +620,11 @@ int grib_get_g1_message_size(grib_handle *h, grib_accessor *tl, grib_accessor *s /* grib_accessor_class_data_dummy_field.c */ /* grib_2order_packer_simple.c */ -void grib_free_second_order_groups(grib_context *c, second_order_packed *sp); -second_order_packed *grib_get_second_order_groups(grib_context *c, const unsigned long *vals, size_t len); +void grib_free_second_order_groups(grib_context* c, second_order_packed* sp); +second_order_packed* grib_get_second_order_groups(grib_context* c, const unsigned long* vals, size_t len); /* grib_accessor_class_variable.c */ -void accessor_variable_set_type(grib_accessor *a, int type); +void accessor_variable_set_type(grib_accessor* a, int type); /* grib_accessor_class_second_order_bits_per_value.c */ @@ -653,8 +653,8 @@ void accessor_variable_set_type(grib_accessor *a, int type); /* grib_accessor_class_unexpanded_descriptors.c */ /* grib_accessor_class_expanded_descriptors.c */ -int grib_accessor_class_expanded_descriptors_set_do_expand(grib_accessor *a, long do_expand); -bufr_descriptors_array *grib_accessor_class_expanded_descriptors_get_expanded(grib_accessor *a, int *err); +int grib_accessor_class_expanded_descriptors_set_do_expand(grib_accessor* a, long do_expand); +bufr_descriptors_array* grib_accessor_class_expanded_descriptors_get_expanded(grib_accessor* a, int* err); /* grib_accessor_class_bufrdc_expanded_descriptors.c */ @@ -703,64 +703,64 @@ bufr_descriptors_array *grib_accessor_class_expanded_descriptors_get_expanded(gr /* grib_accessor_class_md5.c */ /* grib_jasper_encoding.c */ -int grib_jasper_decode(grib_context *c, unsigned char *buf, size_t *buflen, double *values, size_t *no_values); -int grib_jasper_encode(grib_context *c, j2k_encode_helper *helper); -int grib_jasper_decode(grib_context *c, unsigned char *buf, size_t *buflen, double *val, size_t *n_vals); -int grib_jasper_encode(grib_context *c, j2k_encode_helper *helper); +int grib_jasper_decode(grib_context* c, unsigned char* buf, size_t* buflen, double* values, size_t* no_values); +int grib_jasper_encode(grib_context* c, j2k_encode_helper* helper); +int grib_jasper_decode(grib_context* c, unsigned char* buf, size_t* buflen, double* val, size_t* n_vals); +int grib_jasper_encode(grib_context* c, j2k_encode_helper* helper); /* grib_openjpeg_encoding.c */ -int grib_openjpeg_encode(grib_context *c, j2k_encode_helper *helper); -int grib_openjpeg_decode(grib_context *c, unsigned char *buf, size_t *buflen, double *val, size_t *n_vals); +int grib_openjpeg_encode(grib_context* c, j2k_encode_helper* helper); +int grib_openjpeg_decode(grib_context* c, unsigned char* buf, size_t* buflen, double* val, size_t* n_vals); /* action_class_set_missing.c */ -grib_action *grib_action_create_set_missing(grib_context *context, const char *name); +grib_action* grib_action_create_set_missing(grib_context* context, const char* name); /* grib_accessor_class_number_of_points.c */ /* grib_accessor_class_suppressed.c */ /* grib_index.c */ -int grib_index_compress(grib_index *index); -int grib_read_uchar(FILE *fh, unsigned char *val); -int grib_read_short(FILE *fh, short *val); -int grib_read_long(FILE *fh, long *val); -int grib_read_unsigned_long(FILE *fh, unsigned long *val); -int grib_write_uchar(FILE *fh, unsigned char val); -int grib_write_short(FILE *fh, short val); -int grib_write_long(FILE *fh, long val); -int grib_write_unsigned_long(FILE *fh, unsigned long val); -int grib_write_string(FILE *fh, const char *s); -int grib_write_identifier(FILE *fh); -int grib_write_null_marker(FILE *fh); -int grib_write_not_null_marker(FILE *fh); -char *grib_read_string(grib_context *c, FILE *fh, int *err); -grib_field_tree *grib_read_field_tree(grib_context *c, FILE *fh, grib_file **files, int *err); -grib_index *grib_index_new(grib_context *c, const char *key, int *err); -void grib_index_delete(grib_index *index); -int grib_index_write(grib_index *index, const char *filename); -grib_index *grib_index_read(grib_context *c, const char *filename, int *err); -int grib_index_search_same(grib_index *index, grib_handle *h); -int grib_index_add_file(grib_index *index, const char *filename); -grib_handle *new_message_from_file(int message_type, grib_context *c, FILE *f, int *error); -int _codes_index_add_file(grib_index *index, const char *filename, int message_type); -int grib_index_add_file(grib_index *index, const char *filename); -grib_index *grib_index_new_from_file(grib_context *c, char *filename, const char *keys, int *err); -int grib_index_get_size(const grib_index *index, const char *key, size_t *size); -int grib_index_get_string(const grib_index *index, const char *key, char **values, size_t *size); -int grib_index_get_long(const grib_index *index, const char *key, long *values, size_t *size); -int grib_index_get_double(const grib_index *index, const char *key, double *values, size_t *size); -int grib_index_select_long(grib_index *index, const char *skey, long value); -int grib_index_select_double(grib_index *index, const char *skey, double value); -int grib_index_select_string(grib_index *index, const char *skey, char *value); -grib_handle *grib_index_get_handle(grib_field *field, int *err); -grib_handle *codes_index_get_handle(grib_field *field, int message_type, int *err); -int grib_index_dump_file(FILE *fout, const char *filename); -void grib_index_dump(FILE *fout, grib_index *index); -char *grib_get_field_file(grib_index *index, off_t *offset); -grib_handle *grib_handle_new_from_index(grib_index *index, int *err); -grib_handle *codes_new_from_index(grib_index *index, int message_type, int *err); -void grib_index_rewind(grib_index *index); -int grib_index_search(grib_index *index, grib_index_key *keys); +int grib_index_compress(grib_index* index); +int grib_read_uchar(FILE* fh, unsigned char* val); +int grib_read_short(FILE* fh, short* val); +int grib_read_long(FILE* fh, long* val); +int grib_read_unsigned_long(FILE* fh, unsigned long* val); +int grib_write_uchar(FILE* fh, unsigned char val); +int grib_write_short(FILE* fh, short val); +int grib_write_long(FILE* fh, long val); +int grib_write_unsigned_long(FILE* fh, unsigned long val); +int grib_write_string(FILE* fh, const char* s); +int grib_write_identifier(FILE* fh); +int grib_write_null_marker(FILE* fh); +int grib_write_not_null_marker(FILE* fh); +char* grib_read_string(grib_context* c, FILE* fh, int* err); +grib_field_tree* grib_read_field_tree(grib_context* c, FILE* fh, grib_file** files, int* err); +grib_index* grib_index_new(grib_context* c, const char* key, int* err); +void grib_index_delete(grib_index* index); +int grib_index_write(grib_index* index, const char* filename); +grib_index* grib_index_read(grib_context* c, const char* filename, int* err); +int grib_index_search_same(grib_index* index, grib_handle* h); +int grib_index_add_file(grib_index* index, const char* filename); +grib_handle* new_message_from_file(int message_type, grib_context* c, FILE* f, int* error); +int _codes_index_add_file(grib_index* index, const char* filename, int message_type); +int grib_index_add_file(grib_index* index, const char* filename); +grib_index* grib_index_new_from_file(grib_context* c, char* filename, const char* keys, int* err); +int grib_index_get_size(const grib_index* index, const char* key, size_t* size); +int grib_index_get_string(const grib_index* index, const char* key, char** values, size_t* size); +int grib_index_get_long(const grib_index* index, const char* key, long* values, size_t* size); +int grib_index_get_double(const grib_index* index, const char* key, double* values, size_t* size); +int grib_index_select_long(grib_index* index, const char* skey, long value); +int grib_index_select_double(grib_index* index, const char* skey, double value); +int grib_index_select_string(grib_index* index, const char* skey, char* value); +grib_handle* grib_index_get_handle(grib_field* field, int* err); +grib_handle* codes_index_get_handle(grib_field* field, int message_type, int* err); +int grib_index_dump_file(FILE* fout, const char* filename); +void grib_index_dump(FILE* fout, grib_index* index); +char* grib_get_field_file(grib_index* index, off_t* offset); +grib_handle* grib_handle_new_from_index(grib_index* index, int* err); +grib_handle* codes_new_from_index(grib_index* index, int message_type, int* err); +void grib_index_rewind(grib_index* index); +int grib_index_search(grib_index* index, grib_index_key* keys); /* grib_accessor_class_number_of_points_gaussian.c */ @@ -779,13 +779,13 @@ int grib_index_search(grib_index *index, grib_index_key *keys); /* grib_accessor_class_statistics_spectral.c */ /* grib_accessor_class_unsigned.c */ -int pack_long_unsigned_helper(grib_accessor *a, const long *val, size_t *len, int check); +int pack_long_unsigned_helper(grib_accessor* a, const long* val, size_t* len, int check); /* grib_accessor_class_unsigned_bits.c */ /* grib_accessor_class_raw.c */ -void accessor_raw_set_length(grib_accessor *a, size_t len); -long accessor_raw_get_offset(grib_accessor *a); +void accessor_raw_set_length(grib_accessor* a, size_t len); +long accessor_raw_get_offset(grib_accessor* a); /* grib_accessor_class_bufr_extract_subsets.c */ @@ -808,47 +808,47 @@ long accessor_raw_get_offset(grib_accessor *a); /* grib_accessor_class_long_vector.c */ /* grib_gaussian_reduced.c */ -void grib_get_reduced_row_wrapper(grib_handle *h, long pl, double lon_first, double lon_last, long *npoints, long *ilon_first, long *ilon_last); -void grib_get_reduced_row_legacy(long pl, double lon_first, double lon_last, long *npoints, long *ilon_first, long *ilon_last); -void grib_get_reduced_row(long pl, double lon_first, double lon_last, long *npoints, long *ilon_first, long *ilon_last); -void grib_get_reduced_row_p(long pl, double lon_first, double lon_last, long *npoints, double *olon_first, double *olon_last); +void grib_get_reduced_row_wrapper(grib_handle* h, long pl, double lon_first, double lon_last, long* npoints, long* ilon_first, long* ilon_last); +void grib_get_reduced_row_legacy(long pl, double lon_first, double lon_last, long* npoints, long* ilon_first, long* ilon_last); +void grib_get_reduced_row(long pl, double lon_first, double lon_last, long* npoints, long* ilon_first, long* ilon_last); +void grib_get_reduced_row_p(long pl, double lon_first, double lon_last, long* npoints, double* olon_first, double* olon_last); /* grib_accessor_class_abstract_vector.c */ /* grib_accessor_class_abstract_long_vector.c */ /* grib_loader_from_handle.c */ -int grib_lookup_long_from_handle(grib_context *gc, grib_loader *loader, const char *name, long *value); -int grib_init_accessor_from_handle(grib_loader *loader, grib_accessor *ga, grib_arguments *default_value); +int grib_lookup_long_from_handle(grib_context* gc, grib_loader* loader, const char* name, long* value); +int grib_init_accessor_from_handle(grib_loader* loader, grib_accessor* ga, grib_arguments* default_value); /* grib_bits.c */ -unsigned long grib_decode_unsigned_byte_long(const unsigned char *p, long o, int l); -long grib_decode_signed_long(const unsigned char *p, long o, int l); -int grib_encode_signed_long(unsigned char *p, long val, long o, int l); -void grib_set_bits_on(unsigned char *p, long *bitp, long nbits); -int grib_get_bit(const unsigned char *p, long bitp); -void grib_set_bit(unsigned char *p, long bitp, int val); -long grib_decode_signed_longb(const unsigned char *p, long *bitp, long nbits); -int grib_encode_signed_longb(unsigned char *p, long val, long *bitp, long nb); +unsigned long grib_decode_unsigned_byte_long(const unsigned char* p, long o, int l); +long grib_decode_signed_long(const unsigned char* p, long o, int l); +int grib_encode_signed_long(unsigned char* p, long val, long o, int l); +void grib_set_bits_on(unsigned char* p, long* bitp, long nbits); +int grib_get_bit(const unsigned char* p, long bitp); +void grib_set_bit(unsigned char* p, long bitp, int val); +long grib_decode_signed_longb(const unsigned char* p, long* bitp, long nbits); +int grib_encode_signed_longb(unsigned char* p, long val, long* bitp, long nb); /* grib_timer.c */ double proc_cpu(void); -char *timename(double t); -grib_timer *grib_get_timer(grib_context *c, const char *name, const char *statname, int elapsed); -int grib_timer_start(grib_timer *t); -int grib_timer_stop(grib_timer *t, long total); -double grib_timer_value(grib_timer *t); -const char *bytename(double bytes); -void grib_timer_print(grib_timer *t); -void grib_timer_partial_rate(grib_timer *t, double start, long total); +char* timename(double t); +grib_timer* grib_get_timer(grib_context* c, const char* name, const char* statname, int elapsed); +int grib_timer_start(grib_timer* t); +int grib_timer_stop(grib_timer* t, long total); +double grib_timer_value(grib_timer* t); +const char* bytename(double bytes); +void grib_timer_print(grib_timer* t); +void grib_timer_partial_rate(grib_timer* t, double start, long total); void grib_print_all_timers(void); void grib_reset_all_timers(void); -grib_timer *grib_get_timer(grib_context *c, const char *name, const char *statname, int elapsed); -int grib_timer_start(grib_timer *t); -int grib_timer_stop(grib_timer *t, long total); -double grib_timer_value(grib_timer *t); -void grib_timer_print(grib_timer *t); -void grib_timer_partial_rate(grib_timer *t, double start, long total); +grib_timer* grib_get_timer(grib_context* c, const char* name, const char* statname, int elapsed); +int grib_timer_start(grib_timer* t); +int grib_timer_stop(grib_timer* t, long total); +double grib_timer_value(grib_timer* t); +void grib_timer_print(grib_timer* t); +void grib_timer_partial_rate(grib_timer* t, double start, long total); void grib_print_all_timers(void); void grib_reset_all_timers(void); @@ -859,7 +859,7 @@ double grib_long_to_ibm(unsigned long x); double grib_ibm_table_e(unsigned long e); double grib_ibm_table_v(unsigned long e); unsigned long grib_ibm_nearest_smaller_to_long(double x); -int grib_nearest_smaller_ibm_float(double a, double *ret); +int grib_nearest_smaller_ibm_float(double a, double* ret); /* grib_ieeefloat.c */ double grib_ieee_table_e(unsigned long e); @@ -868,57 +868,57 @@ unsigned long grib_ieee_to_long(double x); double grib_ieeefloat_error(double x); double grib_long_to_ieee(unsigned long x); unsigned long grib_ieee_nearest_smaller_to_long(double x); -int grib_nearest_smaller_ieee_float(double a, double *ret); +int grib_nearest_smaller_ieee_float(double a, double* ret); double grib_ieeefloat_error(double x); double grib_long_to_ieee(unsigned long x); -int grib_nearest_smaller_ieee_float(double a, double *x); +int grib_nearest_smaller_ieee_float(double a, double* x); unsigned long grib_ieee_to_long(double x); unsigned long grib_ieee64_to_long(double x); double grib_long_to_ieee64(unsigned long x); -int grib_ieee_decode_array(grib_context *c, unsigned char *buf, size_t nvals, int bytes, double *val); -int grib_ieee_decode_array(grib_context *c, unsigned char *buf, size_t nvals, int bytes, double *val); -int grib_ieee_encode_array(grib_context *c, double *val, size_t nvals, int bytes, unsigned char *buf); -int grib_ieee_encode_array(grib_context *c, double *val, size_t nvals, int bytes, unsigned char *buf); +int grib_ieee_decode_array(grib_context* c, unsigned char* buf, size_t nvals, int bytes, double* val); +int grib_ieee_decode_array(grib_context* c, unsigned char* buf, size_t nvals, int bytes, double* val); +int grib_ieee_encode_array(grib_context* c, double* val, size_t nvals, int bytes, unsigned char* buf); +int grib_ieee_encode_array(grib_context* c, double* val, size_t nvals, int bytes, unsigned char* buf); /* grib_accessor_class_reference_value_error.c */ /* grib_memory.c */ -void *grib_transient_malloc(const grib_context *c, size_t s); -void *grib_transient_realloc(const grib_context *c, void *p, size_t s); -void grib_transient_free(const grib_context *c, void *p); -void *grib_permanent_malloc(const grib_context *c, size_t s); -void *grib_permanent_realloc(const grib_context *c, void *p, size_t s); -void grib_permanent_free(const grib_context *c, void *p); -void *grib_buffer_malloc(const grib_context *c, size_t s); -void grib_buffer_free(const grib_context *c, void *p); -void *grib_buffer_realloc(const grib_context *c, void *p, size_t s); +void* grib_transient_malloc(const grib_context* c, size_t s); +void* grib_transient_realloc(const grib_context* c, void* p, size_t s); +void grib_transient_free(const grib_context* c, void* p); +void* grib_permanent_malloc(const grib_context* c, size_t s); +void* grib_permanent_realloc(const grib_context* c, void* p, size_t s); +void grib_permanent_free(const grib_context* c, void* p); +void* grib_buffer_malloc(const grib_context* c, size_t s); +void grib_buffer_free(const grib_context* c, void* p); +void* grib_buffer_realloc(const grib_context* c, void* p, size_t s); /* grib_buffer.c */ -void grib_get_buffer_ownership(const grib_context *c, grib_buffer *b); -grib_buffer *grib_create_growable_buffer(const grib_context *c); -grib_buffer *grib_new_buffer(const grib_context *c, const unsigned char *data, size_t buflen); -void grib_buffer_delete(const grib_context *c, grib_buffer *b); -void grib_grow_buffer(const grib_context *c, grib_buffer *b, size_t new_size); -void grib_buffer_set_ulength_bits(const grib_context *c, grib_buffer *b, size_t length_bits); -void grib_buffer_set_ulength(const grib_context *c, grib_buffer *b, size_t length); -void grib_recompute_sections_lengths(grib_section *s); -void grib_buffer_replace(grib_accessor *a, const unsigned char *data, size_t newsize, int update_lengths, int update_paddings); -void grib_update_sections_lengths(grib_handle *h); +void grib_get_buffer_ownership(const grib_context* c, grib_buffer* b); +grib_buffer* grib_create_growable_buffer(const grib_context* c); +grib_buffer* grib_new_buffer(const grib_context* c, const unsigned char* data, size_t buflen); +void grib_buffer_delete(const grib_context* c, grib_buffer* b); +void grib_grow_buffer(const grib_context* c, grib_buffer* b, size_t new_size); +void grib_buffer_set_ulength_bits(const grib_context* c, grib_buffer* b, size_t length_bits); +void grib_buffer_set_ulength(const grib_context* c, grib_buffer* b, size_t length); +void grib_recompute_sections_lengths(grib_section* s); +void grib_buffer_replace(grib_accessor* a, const unsigned char* data, size_t newsize, int update_lengths, int update_paddings); +void grib_update_sections_lengths(grib_handle* h); /* grib_dumper.c */ -void grib_init_dumper(grib_dumper *d); -void grib_dumper_delete(grib_dumper *d); -void grib_dump_long(grib_dumper *d, grib_accessor *a, const char *comment); -void grib_dump_double(grib_dumper *d, grib_accessor *a, const char *comment); -void grib_dump_string(grib_dumper *d, grib_accessor *a, const char *comment); -void grib_dump_string_array(grib_dumper *d, grib_accessor *a, const char *comment); -void grib_dump_label(grib_dumper *d, grib_accessor *a, const char *comment); -void grib_dump_bytes(grib_dumper *d, grib_accessor *a, const char *comment); -void grib_dump_bits(grib_dumper *d, grib_accessor *a, const char *comment); -void grib_dump_section(grib_dumper *d, grib_accessor *a, grib_block_of_accessors *block); -void grib_dump_values(grib_dumper *d, grib_accessor *a); -void grib_dump_header(grib_dumper *d, const grib_handle *h); -void grib_dump_footer(grib_dumper *d, const grib_handle *h); +void grib_init_dumper(grib_dumper* d); +void grib_dumper_delete(grib_dumper* d); +void grib_dump_long(grib_dumper* d, grib_accessor* a, const char* comment); +void grib_dump_double(grib_dumper* d, grib_accessor* a, const char* comment); +void grib_dump_string(grib_dumper* d, grib_accessor* a, const char* comment); +void grib_dump_string_array(grib_dumper* d, grib_accessor* a, const char* comment); +void grib_dump_label(grib_dumper* d, grib_accessor* a, const char* comment); +void grib_dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment); +void grib_dump_bits(grib_dumper* d, grib_accessor* a, const char* comment); +void grib_dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block); +void grib_dump_values(grib_dumper* d, grib_accessor* a); +void grib_dump_header(grib_dumper* d, const grib_handle* h); +void grib_dump_footer(grib_dumper* d, const grib_handle* h); /* grib_dumper_class_serialize.c */ @@ -953,66 +953,66 @@ void grib_dump_footer(grib_dumper *d, const grib_handle *h); /* grib_dumper_class_wmo.c */ /* grib_dumper_class.c */ -grib_dumper *grib_dumper_factory(const char *op, const grib_handle *h, FILE *out, unsigned long option_flags, void *arg); -void grib_dump_accessors_block(grib_dumper *dumper, grib_block_of_accessors *block); -void grib_dump_accessors_list(grib_dumper *dumper, grib_accessors_list *al); -int grib_print(grib_handle *h, const char *name, grib_dumper *d); -void grib_dump_content(const grib_handle *h, FILE *f, const char *mode, unsigned long flags, void *data); -void grib_dump_keys(grib_handle* h, FILE* f, const char* mode, unsigned long flags, void *data, const char **keys, size_t num_keys); -grib_dumper *grib_dump_content_with_dumper(grib_handle *h, grib_dumper *dumper, FILE *f, const char *mode, unsigned long flags, void *data); -void codes_dump_bufr_flat(grib_accessors_list *al, grib_handle *h, FILE *f, const char *mode, unsigned long flags, void *data); +grib_dumper* grib_dumper_factory(const char* op, const grib_handle* h, FILE* out, unsigned long option_flags, void* arg); +void grib_dump_accessors_block(grib_dumper* dumper, grib_block_of_accessors* block); +void grib_dump_accessors_list(grib_dumper* dumper, grib_accessors_list* al); +int grib_print(grib_handle* h, const char* name, grib_dumper* d); +void grib_dump_content(const grib_handle* h, FILE* f, const char* mode, unsigned long flags, void* data); +void grib_dump_keys(grib_handle* h, FILE* f, const char* mode, unsigned long flags, void* data, const char** keys, size_t num_keys); +grib_dumper* grib_dump_content_with_dumper(grib_handle* h, grib_dumper* dumper, FILE* f, const char* mode, unsigned long flags, void* data); +void codes_dump_bufr_flat(grib_accessors_list* al, grib_handle* h, FILE* f, const char* mode, unsigned long flags, void* data); /* grib_context.c */ -size_t grib_context_read(const grib_context *c, void *ptr, size_t size, void *stream); -off_t grib_context_tell(const grib_context *c, void *stream); -int grib_context_seek(const grib_context *c, off_t offset, int whence, void *stream); -int grib_context_eof(const grib_context *c, void *stream); -size_t grib_context_write(const grib_context *c, const void *ptr, size_t size, void *stream); -void grib_context_set_print_proc(grib_context *c, grib_print_proc p); -void grib_context_set_debug(grib_context *c, int mode); -void grib_context_set_logging_proc(grib_context *c, grib_log_proc p); +size_t grib_context_read(const grib_context* c, void* ptr, size_t size, void* stream); +off_t grib_context_tell(const grib_context* c, void* stream); +int grib_context_seek(const grib_context* c, off_t offset, int whence, void* stream); +int grib_context_eof(const grib_context* c, void* stream); +size_t grib_context_write(const grib_context* c, const void* ptr, size_t size, void* stream); +void grib_context_set_print_proc(grib_context* c, grib_print_proc p); +void grib_context_set_debug(grib_context* c, int mode); +void grib_context_set_logging_proc(grib_context* c, grib_log_proc p); long grib_get_api_version(void); -void grib_print_api_version(FILE *out); -const char *grib_get_package_name(void); -grib_context *grib_context_get_default(void); -char *grib_context_full_defs_path(grib_context *c, const char *basename); -char *grib_samples_path(const grib_context *c); -char *grib_definition_path(const grib_context *c); -void grib_context_free(const grib_context *c, void *p); -void grib_context_free_persistent(const grib_context *c, void *p); -void grib_context_reset(grib_context *c); -void grib_context_delete(grib_context *c); +void grib_print_api_version(FILE* out); +const char* grib_get_package_name(void); +grib_context* grib_context_get_default(void); +char* grib_context_full_defs_path(grib_context* c, const char* basename); +char* grib_samples_path(const grib_context* c); +char* grib_definition_path(const grib_context* c); +void grib_context_free(const grib_context* c, void* p); +void grib_context_free_persistent(const grib_context* c, void* p); +void grib_context_reset(grib_context* c); +void grib_context_delete(grib_context* c); void codes_bufr_multi_element_constant_arrays_on(grib_context* c); void codes_bufr_multi_element_constant_arrays_off(grib_context* c); -void grib_context_set_definitions_path(grib_context *c, const char *path); -void grib_context_set_samples_path(grib_context *c, const char *path); -void *grib_context_malloc_persistent(const grib_context *c, size_t size); -char *grib_context_strdup_persistent(const grib_context *c, const char *s); -void *grib_context_malloc_clear_persistent(const grib_context *c, size_t size); -void *grib_context_malloc(const grib_context *c, size_t size); -void *grib_context_realloc(const grib_context *c, void *p, size_t size); -char *grib_context_strdup(const grib_context *c, const char *s); -void *grib_context_malloc_clear(const grib_context *c, size_t size); -void *grib_context_buffer_malloc(const grib_context *c, size_t size); -void grib_context_buffer_free(const grib_context *c, void *p); -void *grib_context_buffer_realloc(const grib_context *c, void *p, size_t size); -void *grib_context_buffer_malloc_clear(const grib_context *c, size_t size); -void grib_context_set_memory_proc(grib_context *c, grib_malloc_proc m, grib_free_proc f, grib_realloc_proc r); -void grib_context_set_persistent_memory_proc(grib_context *c, grib_malloc_proc m, grib_free_proc f); -void grib_context_set_buffer_memory_proc(grib_context *c, grib_malloc_proc m, grib_free_proc f, grib_realloc_proc r); -void grib_context_set_data_accessing_proc(grib_context *c, grib_data_read_proc read, grib_data_write_proc write, grib_data_tell_proc tell); -void grib_context_log(const grib_context *c, int level, const char *fmt, ...); -void grib_context_print(const grib_context *c, void *descriptor, const char *fmt, ...); -int grib_context_get_handle_file_count(grib_context *c); -int grib_context_get_handle_total_count(grib_context *c); -void grib_context_set_handle_file_count(grib_context *c, int new_count); -void grib_context_set_handle_total_count(grib_context *c, int new_count); -void grib_context_increment_handle_file_count(grib_context *c); -void grib_context_increment_handle_total_count(grib_context *c); -bufr_descriptors_array* grib_context_expanded_descriptors_list_get(grib_context* c,const char* key,long* u,size_t size); -void grib_context_expanded_descriptors_list_push(grib_context* c,const char* key,bufr_descriptors_array* expanded,bufr_descriptors_array* unexpanded); +void grib_context_set_definitions_path(grib_context* c, const char* path); +void grib_context_set_samples_path(grib_context* c, const char* path); +void* grib_context_malloc_persistent(const grib_context* c, size_t size); +char* grib_context_strdup_persistent(const grib_context* c, const char* s); +void* grib_context_malloc_clear_persistent(const grib_context* c, size_t size); +void* grib_context_malloc(const grib_context* c, size_t size); +void* grib_context_realloc(const grib_context* c, void* p, size_t size); +char* grib_context_strdup(const grib_context* c, const char* s); +void* grib_context_malloc_clear(const grib_context* c, size_t size); +void* grib_context_buffer_malloc(const grib_context* c, size_t size); +void grib_context_buffer_free(const grib_context* c, void* p); +void* grib_context_buffer_realloc(const grib_context* c, void* p, size_t size); +void* grib_context_buffer_malloc_clear(const grib_context* c, size_t size); +void grib_context_set_memory_proc(grib_context* c, grib_malloc_proc m, grib_free_proc f, grib_realloc_proc r); +void grib_context_set_persistent_memory_proc(grib_context* c, grib_malloc_proc m, grib_free_proc f); +void grib_context_set_buffer_memory_proc(grib_context* c, grib_malloc_proc m, grib_free_proc f, grib_realloc_proc r); +void grib_context_set_data_accessing_proc(grib_context* c, grib_data_read_proc read, grib_data_write_proc write, grib_data_tell_proc tell); +void grib_context_log(const grib_context* c, int level, const char* fmt, ...); +void grib_context_print(const grib_context* c, void* descriptor, const char* fmt, ...); +int grib_context_get_handle_file_count(grib_context* c); +int grib_context_get_handle_total_count(grib_context* c); +void grib_context_set_handle_file_count(grib_context* c, int new_count); +void grib_context_set_handle_total_count(grib_context* c, int new_count); +void grib_context_increment_handle_file_count(grib_context* c); +void grib_context_increment_handle_total_count(grib_context* c); +bufr_descriptors_array* grib_context_expanded_descriptors_list_get(grib_context* c, const char* key, long* u, size_t size); +void grib_context_expanded_descriptors_list_push(grib_context* c, const char* key, bufr_descriptors_array* expanded, bufr_descriptors_array* unexpanded); void codes_set_codes_assertion_failed_proc(codes_assertion_failed_proc proc); -void codes_assertion_failed(const char *message, const char *file, int line); +void codes_assertion_failed(const char* message, const char* file, int line); int grib_get_gribex_mode(grib_context* c); void grib_gribex_mode_on(grib_context* c); void grib_gribex_mode_off(grib_context* c); @@ -1022,363 +1022,362 @@ void grib_multi_support_on(grib_context* c); void grib_multi_support_off(grib_context* c); /* grib_date.c */ -int grib_julian_to_datetime(double jd, long *year, long *month, long *day, long *hour, long *minute, long *second); -int grib_datetime_to_julian(long year, long month, long day, long hour, long minute, long second, double *jd); -int grib_datetime_to_julian_d(long year,long month,long day,long hour,long minute,double second, double* jd); +int grib_julian_to_datetime(double jd, long* year, long* month, long* day, long* hour, long* minute, long* second); +int grib_datetime_to_julian(long year, long month, long day, long hour, long minute, long second, double* jd); +int grib_datetime_to_julian_d(long year, long month, long day, long hour, long minute, double second, double* jd); long grib_julian_to_date(long jdate); long grib_date_to_julian(long ddate); /* grib_fieldset.c */ -int grib_fieldset_new_column(grib_fieldset *set, int id, char *key, int type); -int grib_fieldset_column_copy_from_handle(grib_handle *h, grib_fieldset *set, int i); -grib_fieldset *grib_fieldset_new_from_files(grib_context *c, char *filenames[], int nfiles, char **keys, int nkeys, const char *where_string, const char *order_by_string, int *err); -int grib_fieldset_apply_where(grib_fieldset *set, const char *where_string); -int grib_fieldset_apply_order_by(grib_fieldset *set, const char *order_by_string); -void grib_fieldset_delete_order_by(grib_context *c, grib_order_by *order_by); -void grib_fieldset_delete(grib_fieldset *set); -int grib_fieldset_add(grib_fieldset *set, char *filename); -void grib_fieldset_rewind(grib_fieldset *set); -grib_handle *grib_fieldset_next_handle(grib_fieldset *set, int *err); -int grib_fieldset_count(grib_fieldset *set); -grib_handle *grib_fieldset_retrieve(grib_fieldset *set, int i, int *err); +int grib_fieldset_new_column(grib_fieldset* set, int id, char* key, int type); +int grib_fieldset_column_copy_from_handle(grib_handle* h, grib_fieldset* set, int i); +grib_fieldset* grib_fieldset_new_from_files(grib_context* c, char* filenames[], int nfiles, char** keys, int nkeys, const char* where_string, const char* order_by_string, int* err); +int grib_fieldset_apply_where(grib_fieldset* set, const char* where_string); +int grib_fieldset_apply_order_by(grib_fieldset* set, const char* order_by_string); +void grib_fieldset_delete_order_by(grib_context* c, grib_order_by* order_by); +void grib_fieldset_delete(grib_fieldset* set); +int grib_fieldset_add(grib_fieldset* set, char* filename); +void grib_fieldset_rewind(grib_fieldset* set); +grib_handle* grib_fieldset_next_handle(grib_fieldset* set, int* err); +int grib_fieldset_count(grib_fieldset* set); +grib_handle* grib_fieldset_retrieve(grib_fieldset* set, int i, int* err); /* grib_filepool.c */ void grib_file_pool_clean(void); -grib_file *grib_file_pool_get_files(void); -int grib_file_pool_read(grib_context *c, FILE *fh); -int grib_file_pool_write(FILE *fh); -grib_file *grib_file_open(const char *filename, const char *mode, int *err); -void grib_file_pool_delete_file(grib_file *file); -void grib_file_close(const char *filename, int force, int *err); -void grib_file_close_all(int *err); -grib_file *grib_get_file(const char *filename, int *err); -grib_file *grib_find_file(short id); -grib_file *grib_file_new(grib_context *c, const char *name, int *err); -void grib_file_delete(grib_file *file); +grib_file* grib_file_pool_get_files(void); +int grib_file_pool_read(grib_context* c, FILE* fh); +int grib_file_pool_write(FILE* fh); +grib_file* grib_file_open(const char* filename, const char* mode, int* err); +void grib_file_pool_delete_file(grib_file* file); +void grib_file_close(const char* filename, int force, int* err); +void grib_file_close_all(int* err); +grib_file* grib_get_file(const char* filename, int* err); +grib_file* grib_find_file(short id); +grib_file* grib_file_new(grib_context* c, const char* name, int* err); +void grib_file_delete(grib_file* file); /* grib_geography.c */ -int grib_get_gaussian_latitudes(long trunc, double *lats); -int is_gaussian_global(double lat1, double lat2, double lon1, double lon2, long num_points_equator, const double *latitudes, double angular_precision); +int grib_get_gaussian_latitudes(long trunc, double* lats); +int is_gaussian_global(double lat1, double lat2, double lon1, double lon2, long num_points_equator, const double* latitudes, double angular_precision); void rotate(const double inlat, const double inlon, const double angleOfRot, const double southPoleLat, const double southPoleLon, double* outlat, double* outlon); -void unrotate(const double inlat, const double inlon, const double angleOfRot, const double southPoleLat, const double southPoleLon, double *outlat, double *outlon); +void unrotate(const double inlat, const double inlon, const double angleOfRot, const double southPoleLat, const double southPoleLon, double* outlat, double* outlon); /* grib_handle.c */ -grib_section *grib_section_create(grib_handle *h, grib_accessor *owner); -void grib_swap_sections(grib_section *the_old, grib_section *the_new); -void grib_empty_section(grib_context *c, grib_section *b); -void grib_section_delete(grib_context *c, grib_section *b); -int grib_handle_delete(grib_handle *h); -grib_handle *grib_new_handle(grib_context *c); -grib_handle *grib_handle_new_from_samples(grib_context *c, const char *name); -grib_handle *codes_bufr_handle_new_from_samples(grib_context *c, const char *name); -int grib_write_message(const grib_handle *h, const char *file, const char *mode); -grib_handle *grib_handle_clone(const grib_handle *h); -grib_handle *codes_handle_new_from_file(grib_context *c, FILE *f, ProductKind product, int *error); -grib_handle *codes_grib_handle_new_from_file(grib_context *c, FILE *f, int *error); -grib_handle *codes_bufr_handle_new_from_file(grib_context *c, FILE *f, int *error); -grib_handle *codes_metar_handle_new_from_file(grib_context *c, FILE *f, int *error); -grib_handle *codes_gts_handle_new_from_file(grib_context *c, FILE *f, int *error); -grib_handle *grib_handle_new_from_message_copy(grib_context *c, const void *data, size_t size); -grib_handle *grib_handle_new_from_partial_message_copy(grib_context *c, const void *data, size_t size); -grib_handle *grib_handle_new_from_partial_message(grib_context *c, const void *data, size_t buflen); -grib_handle *grib_handle_new_from_message(grib_context *c, const void *data, size_t buflen); -grib_handle *grib_handle_new_from_multi_message(grib_context *c, void **data, size_t *buflen, int *error); -grib_handle *grib_handle_new_from_file(grib_context *c, FILE *f, int *error); -grib_handle *grib_new_from_file(grib_context *c, FILE *f, int headers_only, int *error); -grib_handle *gts_new_from_file(grib_context *c, FILE *f, int *error); -grib_handle *taf_new_from_file(grib_context *c, FILE *f, int *error); -grib_handle *metar_new_from_file(grib_context *c, FILE *f, int *error); -grib_handle *bufr_new_from_file(grib_context *c, FILE *f, int *error); -grib_handle *any_new_from_file(grib_context *c, FILE *f, int *error); -grib_multi_handle *grib_multi_handle_new(grib_context *c); -int grib_multi_handle_delete(grib_multi_handle *h); -int grib_multi_handle_append(grib_handle *h, int start_section, grib_multi_handle *mh); -int grib_multi_handle_write(grib_multi_handle *h, FILE *f); -int grib_get_partial_message(grib_handle *h, const void **msg, size_t *len, int start_section); -int grib_get_partial_message_copy(grib_handle *h, void *message, size_t *len, int start_section); -int grib_get_message_copy(const grib_handle *h, void *message, size_t *len); -int grib_get_message_offset(const grib_handle *h, off_t *offset); -int codes_get_product_kind(const grib_handle *h, ProductKind *product_kind); -int codes_check_message_header(const void *bytes, size_t length, ProductKind product); -int codes_check_message_footer(const void *bytes, size_t length, ProductKind product); -int grib_get_message_size(const grib_handle *h, size_t *size); -int grib_get_message(const grib_handle *h, const void **msg, size_t *size); -int grib_get_message_headers(grib_handle *h, const void **msg, size_t *size); -grib_handle *grib_handle_new(grib_context *c); -grib_action *grib_action_from_filter(const char *filter); -int grib_handle_apply_action(grib_handle *h, grib_action *a); -int grib_handle_prepare_action(grib_handle *h, grib_action *a); -void grib_multi_support_reset_file(grib_context *c, FILE *f); -void grib_multi_support_reset(grib_context *c); +grib_section* grib_section_create(grib_handle* h, grib_accessor* owner); +void grib_swap_sections(grib_section* the_old, grib_section* the_new); +void grib_empty_section(grib_context* c, grib_section* b); +void grib_section_delete(grib_context* c, grib_section* b); +int grib_handle_delete(grib_handle* h); +grib_handle* grib_new_handle(grib_context* c); +grib_handle* grib_handle_new_from_samples(grib_context* c, const char* name); +grib_handle* codes_bufr_handle_new_from_samples(grib_context* c, const char* name); +int grib_write_message(const grib_handle* h, const char* file, const char* mode); +grib_handle* grib_handle_clone(const grib_handle* h); +grib_handle* codes_handle_new_from_file(grib_context* c, FILE* f, ProductKind product, int* error); +grib_handle* codes_grib_handle_new_from_file(grib_context* c, FILE* f, int* error); +grib_handle* codes_bufr_handle_new_from_file(grib_context* c, FILE* f, int* error); +grib_handle* codes_metar_handle_new_from_file(grib_context* c, FILE* f, int* error); +grib_handle* codes_gts_handle_new_from_file(grib_context* c, FILE* f, int* error); +grib_handle* grib_handle_new_from_message_copy(grib_context* c, const void* data, size_t size); +grib_handle* grib_handle_new_from_partial_message_copy(grib_context* c, const void* data, size_t size); +grib_handle* grib_handle_new_from_partial_message(grib_context* c, const void* data, size_t buflen); +grib_handle* grib_handle_new_from_message(grib_context* c, const void* data, size_t buflen); +grib_handle* grib_handle_new_from_multi_message(grib_context* c, void** data, size_t* buflen, int* error); +grib_handle* grib_handle_new_from_file(grib_context* c, FILE* f, int* error); +grib_handle* grib_new_from_file(grib_context* c, FILE* f, int headers_only, int* error); +grib_handle* gts_new_from_file(grib_context* c, FILE* f, int* error); +grib_handle* taf_new_from_file(grib_context* c, FILE* f, int* error); +grib_handle* metar_new_from_file(grib_context* c, FILE* f, int* error); +grib_handle* bufr_new_from_file(grib_context* c, FILE* f, int* error); +grib_handle* any_new_from_file(grib_context* c, FILE* f, int* error); +grib_multi_handle* grib_multi_handle_new(grib_context* c); +int grib_multi_handle_delete(grib_multi_handle* h); +int grib_multi_handle_append(grib_handle* h, int start_section, grib_multi_handle* mh); +int grib_multi_handle_write(grib_multi_handle* h, FILE* f); +int grib_get_partial_message(grib_handle* h, const void** msg, size_t* len, int start_section); +int grib_get_partial_message_copy(grib_handle* h, void* message, size_t* len, int start_section); +int grib_get_message_copy(const grib_handle* h, void* message, size_t* len); +int grib_get_message_offset(const grib_handle* h, off_t* offset); +int codes_get_product_kind(const grib_handle* h, ProductKind* product_kind); +int codes_check_message_header(const void* bytes, size_t length, ProductKind product); +int codes_check_message_footer(const void* bytes, size_t length, ProductKind product); +int grib_get_message_size(const grib_handle* h, size_t* size); +int grib_get_message(const grib_handle* h, const void** msg, size_t* size); +int grib_get_message_headers(grib_handle* h, const void** msg, size_t* size); +grib_handle* grib_handle_new(grib_context* c); +grib_action* grib_action_from_filter(const char* filter); +int grib_handle_apply_action(grib_handle* h, grib_action* a); +int grib_handle_prepare_action(grib_handle* h, grib_action* a); +void grib_multi_support_reset_file(grib_context* c, FILE* f); +void grib_multi_support_reset(grib_context* c); /* grib_header_compute.c */ -void print_math(grib_math *m); -grib_math *grib_math_clone(grib_context *c, grib_math *m); -void grib_math_delete(grib_context *c, grib_math *m); -grib_math *grib_math_new(grib_context *c, const char *formula, int *err); +void print_math(grib_math* m); +grib_math* grib_math_clone(grib_context* c, grib_math* m); +void grib_math_delete(grib_context* c, grib_math* m); +grib_math* grib_math_new(grib_context* c, const char* formula, int* err); /* grib_hash_keys.c */ -const struct grib_keys_hash *grib_keys_hash_get(const char *str, unsigned int len); -grib_itrie *grib_hash_keys_new(grib_context *c, int *count); -void grib_hash_keys_delete(grib_itrie *t); -int grib_hash_keys_get_id(grib_itrie *t, const char *key); -int grib_hash_keys_insert(grib_itrie *t, const char *key); -int grib_hash_keys_get_size(grib_itrie *t); +const struct grib_keys_hash* grib_keys_hash_get(const char* str, unsigned int len); +grib_itrie* grib_hash_keys_new(grib_context* c, int* count); +void grib_hash_keys_delete(grib_itrie* t); +int grib_hash_keys_get_id(grib_itrie* t, const char* key); +int grib_hash_keys_insert(grib_itrie* t, const char* key); +int grib_hash_keys_get_size(grib_itrie* t); /* grib_io.c */ -off_t stdio_tell(void *data); -int stdio_seek(void *data, off_t len); -int stdio_seek_from_start(void *data, off_t len); -size_t stdio_read(void *data, void *buf, size_t len, int *err); -int wmo_read_any_from_file(FILE *f, void *buffer, size_t *len); -int wmo_read_grib_from_file(FILE *f, void *buffer, size_t *len); -int wmo_read_bufr_from_file(FILE *f, void *buffer, size_t *len); -int wmo_read_gts_from_file(FILE *f, void *buffer, size_t *len); -int wmo_read_taf_from_file(FILE *f, void *buffer, size_t *len); -int wmo_read_metar_from_file(FILE *f, void *buffer, size_t *len); -int wmo_read_any_from_stream(void *stream_data, long (*stream_proc )(void *, void *buffer, long len ), void *buffer, size_t *len); -void* wmo_read_any_from_stream_malloc(void* stream_data,long (*stream_proc)(void*,void* buffer,long len) ,size_t *size, int* err); -void *wmo_read_gts_from_file_malloc(FILE *f, int headers_only, size_t *size, off_t *offset, int *err); -void *wmo_read_taf_from_file_malloc(FILE *f, int headers_only, size_t *size, off_t *offset, int *err); -void *wmo_read_metar_from_file_malloc(FILE *f, int headers_only, size_t *size, off_t *offset, int *err); -void *wmo_read_any_from_file_malloc(FILE *f, int headers_only, size_t *size, off_t *offset, int *err); -void *wmo_read_grib_from_file_malloc(FILE *f, int headers_only, size_t *size, off_t *offset, int *err); -void *wmo_read_bufr_from_file_malloc(FILE *f, int headers_only, size_t *size, off_t *offset, int *err); -int grib_read_any_headers_only_from_file(grib_context *ctx, FILE *f, void *buffer, size_t *len); -int grib_read_any_from_file(grib_context *ctx, FILE *f, void *buffer, size_t *len); -int grib_read_any_from_memory_alloc(grib_context *ctx, unsigned char **data, size_t *data_length, void **buffer, size_t *length); -int grib_read_any_from_memory(grib_context *ctx, unsigned char **data, size_t *data_length, void *buffer, size_t *len); -int grib_count_in_file(grib_context *c, FILE *f, int *n); -int grib_count_in_filename(grib_context *c, const char *filename, int *n); +off_t stdio_tell(void* data); +int stdio_seek(void* data, off_t len); +int stdio_seek_from_start(void* data, off_t len); +size_t stdio_read(void* data, void* buf, size_t len, int* err); +int wmo_read_any_from_file(FILE* f, void* buffer, size_t* len); +int wmo_read_grib_from_file(FILE* f, void* buffer, size_t* len); +int wmo_read_bufr_from_file(FILE* f, void* buffer, size_t* len); +int wmo_read_gts_from_file(FILE* f, void* buffer, size_t* len); +int wmo_read_taf_from_file(FILE* f, void* buffer, size_t* len); +int wmo_read_metar_from_file(FILE* f, void* buffer, size_t* len); +int wmo_read_any_from_stream(void* stream_data, long (*stream_proc)(void*, void* buffer, long len), void* buffer, size_t* len); +void* wmo_read_any_from_stream_malloc(void* stream_data, long (*stream_proc)(void*, void* buffer, long len), size_t* size, int* err); +void* wmo_read_gts_from_file_malloc(FILE* f, int headers_only, size_t* size, off_t* offset, int* err); +void* wmo_read_taf_from_file_malloc(FILE* f, int headers_only, size_t* size, off_t* offset, int* err); +void* wmo_read_metar_from_file_malloc(FILE* f, int headers_only, size_t* size, off_t* offset, int* err); +void* wmo_read_any_from_file_malloc(FILE* f, int headers_only, size_t* size, off_t* offset, int* err); +void* wmo_read_grib_from_file_malloc(FILE* f, int headers_only, size_t* size, off_t* offset, int* err); +void* wmo_read_bufr_from_file_malloc(FILE* f, int headers_only, size_t* size, off_t* offset, int* err); +int grib_read_any_headers_only_from_file(grib_context* ctx, FILE* f, void* buffer, size_t* len); +int grib_read_any_from_file(grib_context* ctx, FILE* f, void* buffer, size_t* len); +int grib_read_any_from_memory_alloc(grib_context* ctx, unsigned char** data, size_t* data_length, void** buffer, size_t* length); +int grib_read_any_from_memory(grib_context* ctx, unsigned char** data, size_t* data_length, void* buffer, size_t* len); +int grib_count_in_file(grib_context* c, FILE* f, int* n); +int grib_count_in_filename(grib_context* c, const char* filename, int* n); /* grib_trie.c */ -grib_trie *grib_trie_new(grib_context *c); -void grib_trie_delete_container(grib_trie *t); -void grib_trie_delete(grib_trie *t); -void grib_trie_clear(grib_trie *t); -void *grib_trie_insert(grib_trie *t, const char *key, void *data); -void *grib_trie_insert_no_replace(grib_trie *t, const char *key, void *data); -void *grib_trie_get(grib_trie *t, const char *key); +grib_trie* grib_trie_new(grib_context* c); +void grib_trie_delete_container(grib_trie* t); +void grib_trie_delete(grib_trie* t); +void grib_trie_clear(grib_trie* t); +void* grib_trie_insert(grib_trie* t, const char* key, void* data); +void* grib_trie_insert_no_replace(grib_trie* t, const char* key, void* data); +void* grib_trie_get(grib_trie* t, const char* key); /* grib_trie_with_rank.c */ -grib_trie_with_rank *grib_trie_with_rank_new(grib_context *c); -void grib_trie_with_rank_delete_container(grib_trie_with_rank *t); -void grib_trie_with_rank_delete(grib_trie_with_rank *t); -void grib_trie_with_rank_clear(grib_trie_with_rank *t); -int grib_trie_with_rank_insert(grib_trie_with_rank *t, const char *key, void *data); -void *grib_trie_with_rank_get(grib_trie_with_rank *t, const char *key, int rank); +grib_trie_with_rank* grib_trie_with_rank_new(grib_context* c); +void grib_trie_with_rank_delete_container(grib_trie_with_rank* t); +void grib_trie_with_rank_delete(grib_trie_with_rank* t); +void grib_trie_with_rank_clear(grib_trie_with_rank* t); +int grib_trie_with_rank_insert(grib_trie_with_rank* t, const char* key, void* data); +void* grib_trie_with_rank_get(grib_trie_with_rank* t, const char* key, int rank); /* grib_itrie.c */ -grib_itrie *grib_itrie_new(grib_context *c, int *count); -void grib_itrie_delete(grib_itrie *t); -int grib_itrie_get_id(grib_itrie *t, const char *key); -int grib_itrie_insert(grib_itrie *t, const char *key); -int grib_itrie_get_size(grib_itrie *t); +grib_itrie* grib_itrie_new(grib_context* c, int* count); +void grib_itrie_delete(grib_itrie* t); +int grib_itrie_get_id(grib_itrie* t, const char* key); +int grib_itrie_insert(grib_itrie* t, const char* key); +int grib_itrie_get_size(grib_itrie* t); /* grib_rules.c */ -grib_rule_entry *grib_new_rule_entry(grib_context *c, const char *name, grib_expression *expression); -grib_rule *grib_new_rule(grib_context *c, grib_expression *condition, grib_rule_entry *entries); +grib_rule_entry* grib_new_rule_entry(grib_context* c, const char* name, grib_expression* expression); +grib_rule* grib_new_rule(grib_context* c, grib_expression* condition, grib_rule_entry* entries); /* grib_keys_iterator.c */ -grib_keys_iterator *grib_keys_iterator_new(grib_handle *h, unsigned long filter_flags, const char *name_space); -int grib_keys_iterator_set_flags(grib_keys_iterator *ki, unsigned long flags); -int grib_keys_iterator_rewind(grib_keys_iterator *ki); -int grib_keys_iterator_next(grib_keys_iterator *kiter); -const char *grib_keys_iterator_get_name(const grib_keys_iterator *kiter); -grib_accessor *grib_keys_iterator_get_accessor(grib_keys_iterator *kiter); -int grib_keys_iterator_delete(grib_keys_iterator *kiter); -int grib_keys_iterator_get_long(const grib_keys_iterator *kiter, long *v, size_t *len); -int grib_keys_iterator_get_double(const grib_keys_iterator *kiter, double *v, size_t *len); -int grib_keys_iterator_get_string(const grib_keys_iterator *kiter, char *v, size_t *len); -int grib_keys_iterator_get_bytes(const grib_keys_iterator *kiter, unsigned char *v, size_t *len); -int grib_keys_iterator_get_native_type(const grib_keys_iterator *kiter); +grib_keys_iterator* grib_keys_iterator_new(grib_handle* h, unsigned long filter_flags, const char* name_space); +int grib_keys_iterator_set_flags(grib_keys_iterator* ki, unsigned long flags); +int grib_keys_iterator_rewind(grib_keys_iterator* ki); +int grib_keys_iterator_next(grib_keys_iterator* kiter); +const char* grib_keys_iterator_get_name(const grib_keys_iterator* kiter); +grib_accessor* grib_keys_iterator_get_accessor(grib_keys_iterator* kiter); +int grib_keys_iterator_delete(grib_keys_iterator* kiter); +int grib_keys_iterator_get_long(const grib_keys_iterator* kiter, long* v, size_t* len); +int grib_keys_iterator_get_double(const grib_keys_iterator* kiter, double* v, size_t* len); +int grib_keys_iterator_get_string(const grib_keys_iterator* kiter, char* v, size_t* len); +int grib_keys_iterator_get_bytes(const grib_keys_iterator* kiter, unsigned char* v, size_t* len); +int grib_keys_iterator_get_native_type(const grib_keys_iterator* kiter); /* bufr_keys_iterator.c */ -bufr_keys_iterator *codes_bufr_keys_iterator_new(grib_handle *h, unsigned long filter_flags); -bufr_keys_iterator *codes_bufr_data_section_keys_iterator_new(grib_handle *h); -int codes_bufr_keys_iterator_rewind(bufr_keys_iterator *ki); -int codes_bufr_keys_iterator_next(bufr_keys_iterator *kiter); -char *codes_bufr_keys_iterator_get_name(const bufr_keys_iterator *kiter); -grib_accessor *codes_bufr_keys_iterator_get_accessor(bufr_keys_iterator *kiter); -int codes_bufr_keys_iterator_delete(bufr_keys_iterator *kiter); +bufr_keys_iterator* codes_bufr_keys_iterator_new(grib_handle* h, unsigned long filter_flags); +bufr_keys_iterator* codes_bufr_data_section_keys_iterator_new(grib_handle* h); +int codes_bufr_keys_iterator_rewind(bufr_keys_iterator* ki); +int codes_bufr_keys_iterator_next(bufr_keys_iterator* kiter); +char* codes_bufr_keys_iterator_get_name(const bufr_keys_iterator* kiter); +grib_accessor* codes_bufr_keys_iterator_get_accessor(bufr_keys_iterator* kiter); +int codes_bufr_keys_iterator_delete(bufr_keys_iterator* kiter); /* grib_parse_utils.c */ -int grib_recompose_name(grib_handle *h, grib_accessor *observer, const char *uname, char *fname, int fail); -int grib_accessor_print(grib_accessor *a, const char *name, int type, const char *format, const char *separator, int maxcols, int *newline, FILE *out); -int grib_accessors_list_print(grib_handle *h, grib_accessors_list *al, const char *name, int type, const char *format, const char *separator, int maxcols, int *newline, FILE *out); -int grib_recompose_print(grib_handle *h, grib_accessor *observer, const char *uname, int fail, FILE *out); -grib_action_file *grib_find_action_file(const char *fname, grib_action_file_list *afl); -void grib_push_action_file(grib_action_file *af, grib_action_file_list *afl); +int grib_recompose_name(grib_handle* h, grib_accessor* observer, const char* uname, char* fname, int fail); +int grib_accessor_print(grib_accessor* a, const char* name, int type, const char* format, const char* separator, int maxcols, int* newline, FILE* out); +int grib_accessors_list_print(grib_handle* h, grib_accessors_list* al, const char* name, int type, const char* format, const char* separator, int maxcols, int* newline, FILE* out); +int grib_recompose_print(grib_handle* h, grib_accessor* observer, const char* uname, int fail, FILE* out); +grib_action_file* grib_find_action_file(const char* fname, grib_action_file_list* afl); int grib_yywrap(void); -char *file_being_parsed(void); -int grib_yyerror(const char *msg); -void grib_parser_include(const char *included_fname); -grib_concept_value *grib_parse_concept_file(grib_context *gc, const char *filename); -grib_hash_array_value *grib_parse_hash_array_file(grib_context *gc, const char *filename); -grib_rule *grib_parse_rules_file(grib_context *gc, const char *filename); -grib_action *grib_parse_file(grib_context *gc, const char *filename); +char* file_being_parsed(void); +int grib_yyerror(const char* msg); +void grib_parser_include(const char* included_fname); +grib_concept_value* grib_parse_concept_file(grib_context* gc, const char* filename); +grib_hash_array_value* grib_parse_hash_array_file(grib_context* gc, const char* filename); +grib_rule* grib_parse_rules_file(grib_context* gc, const char* filename); +grib_action* grib_parse_file(grib_context* gc, const char* filename); int grib_type_to_int(char id); /* grib_query.c */ -grib_accessors_list *grib_find_accessors_list(const grib_handle *h, const char *name); -char *grib_split_name_attribute(grib_context *c, const char *name, char *attribute_name); -grib_accessor *grib_find_accessor(const grib_handle *h, const char *name); -grib_accessor *grib_find_attribute(grib_handle *h, const char *name, const char *attr_name, int *err); -grib_accessor *grib_find_accessor_fast(grib_handle *h, const char *name); +grib_accessors_list* grib_find_accessors_list(const grib_handle* h, const char* name); +char* grib_split_name_attribute(grib_context* c, const char* name, char* attribute_name); +grib_accessor* grib_find_accessor(const grib_handle* h, const char* name); +grib_accessor* grib_find_attribute(grib_handle* h, const char* name, const char* attr_name, int* err); +grib_accessor* grib_find_accessor_fast(grib_handle* h, const char* name); /* grib_scaling.c */ double grib_power(long s, long n); -long grib_get_binary_scale_fact(double max, double min, long bpval, int *ret); +long grib_get_binary_scale_fact(double max, double min, long bpval, int* ret); long grib_get_bits_per_value(double max, double min, long binary_scale_factor); long grib_get_decimal_scale_fact(double max, double min, long bpval, long binary_scale); /* grib_templates.c */ /*grib_handle *grib_internal_sample(grib_context *c, const char *name);*/ -grib_handle *grib_external_template(grib_context *c, const char *name); -grib_handle *bufr_external_template(grib_context *c, const char *name); -char *grib_external_template_path(grib_context *c, const char *name); +grib_handle* grib_external_template(grib_context* c, const char* name); +grib_handle* bufr_external_template(grib_context* c, const char* name); +char* grib_external_template_path(grib_context* c, const char* name); /* grib_dependency.c */ -grib_handle *grib_handle_of_accessor(grib_accessor *a); -void grib_dependency_add(grib_accessor *observer, grib_accessor *observed); -void grib_dependency_remove_observed(grib_accessor *observed); +grib_handle* grib_handle_of_accessor(grib_accessor* a); +void grib_dependency_add(grib_accessor* observer, grib_accessor* observed); +void grib_dependency_remove_observed(grib_accessor* observed); int _grib_dependency_notify_change(grib_handle* h, grib_accessor* observed); -int grib_dependency_notify_change(grib_accessor *observed); -void grib_dependency_remove_observer(grib_accessor *observer); -void grib_dependency_observe_expression(grib_accessor *observer, grib_expression *e); -void grib_dependency_observe_arguments(grib_accessor *observer, grib_arguments *a); +int grib_dependency_notify_change(grib_accessor* observed); +void grib_dependency_remove_observer(grib_accessor* observer); +void grib_dependency_observe_expression(grib_accessor* observer, grib_expression* e); +void grib_dependency_observe_arguments(grib_accessor* observer, grib_arguments* a); /* grib_value.c */ -int grib_set_expression(grib_handle *h, const char *name, grib_expression *e); -int grib_set_expression_internal(grib_handle *h, const char *name, grib_expression *e); -int grib_set_long_internal(grib_handle *h, const char *name, long val); -int grib_set_long(grib_handle *h, const char *name, long val); -int grib_set_double_internal(grib_handle *h, const char *name, double val); -int grib_copy_namespace(grib_handle *dest, const char *name, grib_handle *src); -int grib_set_double(grib_handle *h, const char *name, double val); -int grib_set_string_internal(grib_handle *h, const char *name, const char *val, size_t *length); -int grib_set_string(grib_handle *h, const char *name, const char *val, size_t *length); -int grib_set_string_array(grib_handle *h, const char *name, const char **val, size_t length); -int grib_set_bytes_internal(grib_handle *h, const char *name, const unsigned char *val, size_t *length); -int grib_set_bytes(grib_handle *h, const char *name, const unsigned char *val, size_t *length); -int grib_clear(grib_handle *h, const char *name); -int grib_set_missing_internal(grib_handle *h, const char *name); -int grib_set_missing(grib_handle *h, const char *name); -int grib_is_missing_long(grib_accessor *a, long x); -int grib_is_missing_double(grib_accessor *a, double x); -int grib_is_missing_string(grib_accessor *a, unsigned char *x, size_t len); -int grib_accessor_is_missing(grib_accessor *a, int *err); -int grib_is_missing(const grib_handle *h, const char *name, int *err); -int grib_is_defined(const grib_handle *h, const char *name); -int grib_set_flag(grib_handle *h, const char *name, unsigned long flag); -int grib_set_double_array_internal(grib_handle *h, const char *name, const double *val, size_t length); -int grib_set_force_double_array(grib_handle *h, const char *name, const double *val, size_t length); -int grib_set_double_array(grib_handle *h, const char *name, const double *val, size_t length); -int grib_set_long_array_internal(grib_handle *h, const char *name, const long *val, size_t length); -int grib_set_long_array(grib_handle *h, const char *name, const long *val, size_t length); -int grib_get_long_internal(grib_handle *h, const char *name, long *val); -int grib_is_in_dump(grib_handle *h, const char *name); -int grib_attributes_count(grib_accessor *a, size_t *size); -int grib_get_long(const grib_handle *h, const char *name, long *val); -int grib_get_double_internal(grib_handle *h, const char *name, double *val); -int grib_get_double(const grib_handle *h, const char *name, double *val); -int grib_get_double_element_internal(grib_handle *h, const char *name, int i, double *val); -int grib_get_double_element(const grib_handle *h, const char *name, int i, double *val); -int grib_points_get_values(grib_handle *h, grib_points *points, double *val); -int grib_get_double_elements(const grib_handle *h, const char *name, int *index_array, long len, double *val_array); -int grib_get_string_internal(grib_handle *h, const char *name, char *val, size_t *length); -int grib_get_string(const grib_handle *h, const char *name, char *val, size_t *length); -int grib_get_bytes_internal(const grib_handle *h, const char *name, unsigned char *val, size_t *length); -int grib_get_bytes(const grib_handle *h, const char *name, unsigned char *val, size_t *length); -int grib_get_native_type(const grib_handle *h, const char *name, int *type); -const char *grib_get_accessor_class_name(grib_handle *h, const char *name); -int _grib_get_double_array_internal(const grib_handle *h, grib_accessor *a, double *val, size_t buffer_len, size_t *decoded_length); -int grib_get_double_array_internal(const grib_handle *h, const char *name, double *val, size_t *length); -int grib_get_double_array(const grib_handle *h, const char *name, double *val, size_t *length); -int _grib_get_string_length(grib_accessor *a, size_t *size); -int grib_get_string_length(const grib_handle *h, const char *name, size_t *size); -int _grib_get_size(const grib_handle *h, grib_accessor *a, size_t *size); -int grib_get_size(const grib_handle *h, const char *name, size_t *size); -int grib_get_length(const grib_handle *h, const char *name, size_t *length); -int grib_get_count(grib_handle *h, const char *name, size_t *size); -int grib_get_offset(const grib_handle *h, const char *key, size_t *val); -int _grib_get_string_array_internal(const grib_handle *h, grib_accessor *a, char **val, size_t buffer_len, size_t *decoded_length); -int grib_get_string_array(const grib_handle *h, const char *name, char **val, size_t *length); -int _grib_get_long_array_internal(const grib_handle *h, grib_accessor *a, long *val, size_t buffer_len, size_t *decoded_length); -int grib_get_long_array_internal(grib_handle *h, const char *name, long *val, size_t *length); -int grib_get_long_array(const grib_handle *h, const char *name, long *val, size_t *length); -grib_key_value_list *grib_key_value_list_clone(grib_context *c, grib_key_value_list *list); -void grib_key_value_list_delete(grib_context *c, grib_key_value_list *kvl); -int grib_get_key_value_list(grib_handle *h, grib_key_value_list *list); -int grib_get_values(grib_handle *h, grib_values *args, size_t count); -int grib_set_values(grib_handle *h, grib_values *args, size_t count); -int grib_get_nearest_smaller_value(grib_handle *h, const char *name, double val, double *nearest); -void grib_print_values(grib_values *values, int count); -int grib_values_check(grib_handle *h, grib_values *values, int count); -int grib_key_equal(grib_handle *h1, grib_handle *h2, const char *key, int type, int *err); -int codes_copy_key(grib_handle *h1, grib_handle *h2, const char *key, int type); +int grib_set_expression(grib_handle* h, const char* name, grib_expression* e); +int grib_set_expression_internal(grib_handle* h, const char* name, grib_expression* e); +int grib_set_long_internal(grib_handle* h, const char* name, long val); +int grib_set_long(grib_handle* h, const char* name, long val); +int grib_set_double_internal(grib_handle* h, const char* name, double val); +int grib_copy_namespace(grib_handle* dest, const char* name, grib_handle* src); +int grib_set_double(grib_handle* h, const char* name, double val); +int grib_set_string_internal(grib_handle* h, const char* name, const char* val, size_t* length); +int grib_set_string(grib_handle* h, const char* name, const char* val, size_t* length); +int grib_set_string_array(grib_handle* h, const char* name, const char** val, size_t length); +int grib_set_bytes_internal(grib_handle* h, const char* name, const unsigned char* val, size_t* length); +int grib_set_bytes(grib_handle* h, const char* name, const unsigned char* val, size_t* length); +int grib_clear(grib_handle* h, const char* name); +int grib_set_missing_internal(grib_handle* h, const char* name); +int grib_set_missing(grib_handle* h, const char* name); +int grib_is_missing_long(grib_accessor* a, long x); +int grib_is_missing_double(grib_accessor* a, double x); +int grib_is_missing_string(grib_accessor* a, unsigned char* x, size_t len); +int grib_accessor_is_missing(grib_accessor* a, int* err); +int grib_is_missing(const grib_handle* h, const char* name, int* err); +int grib_is_defined(const grib_handle* h, const char* name); +int grib_set_flag(grib_handle* h, const char* name, unsigned long flag); +int grib_set_double_array_internal(grib_handle* h, const char* name, const double* val, size_t length); +int grib_set_force_double_array(grib_handle* h, const char* name, const double* val, size_t length); +int grib_set_double_array(grib_handle* h, const char* name, const double* val, size_t length); +int grib_set_long_array_internal(grib_handle* h, const char* name, const long* val, size_t length); +int grib_set_long_array(grib_handle* h, const char* name, const long* val, size_t length); +int grib_get_long_internal(grib_handle* h, const char* name, long* val); +int grib_is_in_dump(grib_handle* h, const char* name); +int grib_attributes_count(grib_accessor* a, size_t* size); +int grib_get_long(const grib_handle* h, const char* name, long* val); +int grib_get_double_internal(grib_handle* h, const char* name, double* val); +int grib_get_double(const grib_handle* h, const char* name, double* val); +int grib_get_double_element_internal(grib_handle* h, const char* name, int i, double* val); +int grib_get_double_element(const grib_handle* h, const char* name, int i, double* val); +int grib_points_get_values(grib_handle* h, grib_points* points, double* val); +int grib_get_double_elements(const grib_handle* h, const char* name, int* index_array, long len, double* val_array); +int grib_get_string_internal(grib_handle* h, const char* name, char* val, size_t* length); +int grib_get_string(const grib_handle* h, const char* name, char* val, size_t* length); +int grib_get_bytes_internal(const grib_handle* h, const char* name, unsigned char* val, size_t* length); +int grib_get_bytes(const grib_handle* h, const char* name, unsigned char* val, size_t* length); +int grib_get_native_type(const grib_handle* h, const char* name, int* type); +const char* grib_get_accessor_class_name(grib_handle* h, const char* name); +int _grib_get_double_array_internal(const grib_handle* h, grib_accessor* a, double* val, size_t buffer_len, size_t* decoded_length); +int grib_get_double_array_internal(const grib_handle* h, const char* name, double* val, size_t* length); +int grib_get_double_array(const grib_handle* h, const char* name, double* val, size_t* length); +int _grib_get_string_length(grib_accessor* a, size_t* size); +int grib_get_string_length(const grib_handle* h, const char* name, size_t* size); +int _grib_get_size(const grib_handle* h, grib_accessor* a, size_t* size); +int grib_get_size(const grib_handle* h, const char* name, size_t* size); +int grib_get_length(const grib_handle* h, const char* name, size_t* length); +int grib_get_count(grib_handle* h, const char* name, size_t* size); +int grib_get_offset(const grib_handle* h, const char* key, size_t* val); +int _grib_get_string_array_internal(const grib_handle* h, grib_accessor* a, char** val, size_t buffer_len, size_t* decoded_length); +int grib_get_string_array(const grib_handle* h, const char* name, char** val, size_t* length); +int _grib_get_long_array_internal(const grib_handle* h, grib_accessor* a, long* val, size_t buffer_len, size_t* decoded_length); +int grib_get_long_array_internal(grib_handle* h, const char* name, long* val, size_t* length); +int grib_get_long_array(const grib_handle* h, const char* name, long* val, size_t* length); +grib_key_value_list* grib_key_value_list_clone(grib_context* c, grib_key_value_list* list); +void grib_key_value_list_delete(grib_context* c, grib_key_value_list* kvl); +int grib_get_key_value_list(grib_handle* h, grib_key_value_list* list); +int grib_get_values(grib_handle* h, grib_values* args, size_t count); +int grib_set_values(grib_handle* h, grib_values* args, size_t count); +int grib_get_nearest_smaller_value(grib_handle* h, const char* name, double val, double* nearest); +void grib_print_values(grib_values* values, int count); +int grib_values_check(grib_handle* h, grib_values* values, int count); +int grib_key_equal(grib_handle* h1, grib_handle* h2, const char* key, int type, int* err); +int codes_copy_key(grib_handle* h1, grib_handle* h2, const char* key, int type); /* grib_errors.c */ -const char *grib_get_error_message(int code); -void grib_check(const char *call, const char *file, int line, int e, const char *msg); +const char* grib_get_error_message(int code); +void grib_check(const char* call, const char* file, int line, int e, const char* msg); /* grib_expression_class_binop.c */ -grib_expression *new_binop_expression(grib_context *c, grib_binop_long_proc long_func, grib_binop_double_proc double_func, grib_expression *left, grib_expression *right); +grib_expression* new_binop_expression(grib_context* c, grib_binop_long_proc long_func, grib_binop_double_proc double_func, grib_expression* left, grib_expression* right); /* grib_expression_class_logical_and.c */ -grib_expression *new_logical_and_expression(grib_context *c, grib_expression *left, grib_expression *right); +grib_expression* new_logical_and_expression(grib_context* c, grib_expression* left, grib_expression* right); /* grib_expression_class_logical_or.c */ -grib_expression *new_logical_or_expression(grib_context *c, grib_expression *left, grib_expression *right); +grib_expression* new_logical_or_expression(grib_context* c, grib_expression* left, grib_expression* right); /* grib_expression_class_is_in_dict.c */ -grib_expression *new_is_in_dict_expression(grib_context *c, const char *name, const char *list); +grib_expression* new_is_in_dict_expression(grib_context* c, const char* name, const char* list); /* grib_expression_class_true.c */ -grib_expression *new_true_expression(grib_context *c); +grib_expression* new_true_expression(grib_context* c); /* grib_expression_class_string_compare.c */ -grib_expression *new_string_compare_expression(grib_context *c, grib_expression *left, grib_expression *right); +grib_expression* new_string_compare_expression(grib_context* c, grib_expression* left, grib_expression* right); /* grib_expression_class_unop.c */ -grib_expression *new_unop_expression(grib_context *c, grib_unop_long_proc long_func, grib_unop_double_proc double_func, grib_expression *exp); +grib_expression* new_unop_expression(grib_context* c, grib_unop_long_proc long_func, grib_unop_double_proc double_func, grib_expression* exp); /* grib_expression_class_functor.c */ -grib_expression *new_func_expression(grib_context *c, const char *name, grib_arguments *args); +grib_expression* new_func_expression(grib_context* c, const char* name, grib_arguments* args); /* grib_expression_class_accessor.c */ -grib_expression *new_accessor_expression(grib_context *c, const char *name, long start, size_t length); +grib_expression* new_accessor_expression(grib_context* c, const char* name, long start, size_t length); /* grib_expression_class_is_in_list.c */ -grib_expression *new_is_in_list_expression(grib_context *c, const char *name, const char *list); +grib_expression* new_is_in_list_expression(grib_context* c, const char* name, const char* list); /* grib_expression_class_is_integer.c */ -grib_expression *new_is_integer_expression(grib_context *c, const char *name, int start, int length); +grib_expression* new_is_integer_expression(grib_context* c, const char* name, int start, int length); /* grib_expression_class_length.c */ -grib_expression *new_length_expression(grib_context *c, const char *name); +grib_expression* new_length_expression(grib_context* c, const char* name); /* grib_expression_class_long.c */ -grib_expression *new_long_expression(grib_context *c, long value); +grib_expression* new_long_expression(grib_context* c, long value); /* grib_expression_class_double.c */ -grib_expression *new_double_expression(grib_context *c, double value); +grib_expression* new_double_expression(grib_context* c, double value); /* grib_expression_class_string.c */ -grib_expression *new_string_expression(grib_context *c, const char *value); +grib_expression* new_string_expression(grib_context* c, const char* value); /* grib_expression_class_sub_string.c */ -grib_expression *new_sub_string_expression(grib_context *c, const char *value, size_t start, size_t length); +grib_expression* new_sub_string_expression(grib_context* c, const char* value, size_t start, size_t length); /* grib_box.c */ -grib_points *grib_box_get_points(grib_box *box, double north, double west, double south, double east, int *err); -int grib_box_init(grib_box *box, grib_handle *h, grib_arguments *args); -int grib_box_delete(grib_box *box); -grib_points *grib_points_new(grib_context *c, size_t size); -void grib_points_delete(grib_points *points); +grib_points* grib_box_get_points(grib_box* box, double north, double west, double south, double east, int* err); +int grib_box_init(grib_box* box, grib_handle* h, grib_arguments* args); +int grib_box_delete(grib_box* box); +grib_points* grib_points_new(grib_context* c, size_t size); +void grib_points_delete(grib_points* points); /* grib_box_class.c */ -grib_box *grib_box_factory(grib_handle *h, grib_arguments *args); +grib_box* grib_box_factory(grib_handle* h, grib_arguments* args); /* grib_box_class_gen.c */ @@ -1387,15 +1386,15 @@ grib_box *grib_box_factory(grib_handle *h, grib_arguments *args); /* grib_box_class_reduced_gaussian.c */ /* grib_nearest.c */ -int grib_nearest_find(grib_nearest *nearest, const grib_handle *h, double inlat, double inlon, unsigned long flags, double *outlats, double *outlons, double *values, double *distances, int *indexes, size_t *len); -int grib_nearest_init(grib_nearest *i, grib_handle *h, grib_arguments *args); -int grib_nearest_delete(grib_nearest *i); -void grib_binary_search(double xx[], const unsigned long n, double x, int *ju, int *jl); +int grib_nearest_find(grib_nearest* nearest, const grib_handle* h, double inlat, double inlon, unsigned long flags, double* outlats, double* outlons, double* values, double* distances, int* indexes, size_t* len); +int grib_nearest_init(grib_nearest* i, grib_handle* h, grib_arguments* args); +int grib_nearest_delete(grib_nearest* i); +void grib_binary_search(double xx[], const unsigned long n, double x, int* ju, int* jl); double grib_nearest_distance(double radius, double lon1, double lat1, double lon2, double lat2); -int grib_nearest_find_multiple(const grib_handle *h, int is_lsm, const double *inlats, const double *inlons, long npoints, double *outlats, double *outlons, double *values, double *distances, int *indexes); +int grib_nearest_find_multiple(const grib_handle* h, int is_lsm, const double* inlats, const double* inlons, long npoints, double* outlats, double* outlons, double* values, double* distances, int* indexes); /* grib_nearest_class.c */ -grib_nearest *grib_nearest_factory(grib_handle *h, grib_arguments *args); +grib_nearest* grib_nearest_factory(grib_handle* h, grib_arguments* args); /* grib_nearest_class_gen.c */ @@ -1418,16 +1417,16 @@ grib_nearest *grib_nearest_factory(grib_handle *h, grib_arguments *args); /* grib_iterator_class_lambert_conformal.c */ /* grib_iterator.c */ -int grib_get_data(const grib_handle *h, double *lats, double *lons, double *values); -int grib_iterator_next(grib_iterator *i, double *lat, double *lon, double *value); -int grib_iterator_has_next(grib_iterator *i); -int grib_iterator_previous(grib_iterator *i, double *lat, double *lon, double *value); -int grib_iterator_reset(grib_iterator *i); -int grib_iterator_init(grib_iterator *i, grib_handle *h, grib_arguments *args); -int grib_iterator_delete(grib_iterator *i); +int grib_get_data(const grib_handle* h, double* lats, double* lons, double* values); +int grib_iterator_next(grib_iterator* i, double* lat, double* lon, double* value); +int grib_iterator_has_next(grib_iterator* i); +int grib_iterator_previous(grib_iterator* i, double* lat, double* lon, double* value); +int grib_iterator_reset(grib_iterator* i); +int grib_iterator_init(grib_iterator* i, grib_handle* h, grib_arguments* args); +int grib_iterator_delete(grib_iterator* i); /* grib_iterator_class.c */ -grib_iterator *grib_iterator_factory(grib_handle *h, grib_arguments *args, unsigned long flags, int *ret); +grib_iterator* grib_iterator_factory(grib_handle* h, grib_arguments* args, unsigned long flags, int* ret); /* grib_iterator_class_gaussian.c */ @@ -1436,7 +1435,7 @@ grib_iterator *grib_iterator_factory(grib_handle *h, grib_arguments *args, unsig /* grib_iterator_class_latlon_reduced.c */ /* grib_iterator_class_gen.c */ -int transform_iterator_data(grib_handle *h, double *data, long iScansNegatively, long jScansPositively, long jPointsAreConsecutive, long alternativeRowScanning, size_t numPoints, long nx, long ny); +int transform_iterator_data(grib_handle* h, double* data, long iScansNegatively, long jScansPositively, long jPointsAreConsecutive, long alternativeRowScanning, size_t numPoints, long nx, long ny); /* grib_iterator_class_latlon.c */ @@ -1445,61 +1444,61 @@ int transform_iterator_data(grib_handle *h, double *data, long iScansNegatively, /* grib_iterator_class_space_view.c */ /* grib_expression.c */ -int grib_expression_native_type(grib_handle *h, grib_expression *g); -int grib_expression_evaluate_long(grib_handle *h, grib_expression *g, long *result); -int grib_expression_evaluate_double(grib_handle *h, grib_expression *g, double *result); -const char *grib_expression_evaluate_string(grib_handle *h, grib_expression *g, char *buf, size_t *size, int *err); -const char *grib_expression_get_name(grib_expression *g); -void grib_expression_print(grib_context *ctx, grib_expression *g, grib_handle *f); -void grib_expression_free(grib_context *ctx, grib_expression *g); -void grib_expression_add_dependency(grib_expression *e, grib_accessor *observer); -int grib_expression_set_value(grib_handle *h, grib_expression *g, grib_values *v); -grib_arguments *grib_arguments_new(grib_context *c, grib_expression *g, grib_arguments *n); -void grib_arguments_free(grib_context *c, grib_arguments *g); -void grib_arguments_print(grib_context *c, grib_arguments *g, grib_handle *f); -const char *grib_arguments_get_name(grib_handle *h, grib_arguments *args, int n); -const char *grib_arguments_get_string(grib_handle *h, grib_arguments *args, int n); -long grib_arguments_get_long(grib_handle *h, grib_arguments *args, int n); -double grib_arguments_get_double(grib_handle *h, grib_arguments *args, int n); -grib_expression *grib_arguments_get_expression(grib_handle *h, grib_arguments *args, int n); +int grib_expression_native_type(grib_handle* h, grib_expression* g); +int grib_expression_evaluate_long(grib_handle* h, grib_expression* g, long* result); +int grib_expression_evaluate_double(grib_handle* h, grib_expression* g, double* result); +const char* grib_expression_evaluate_string(grib_handle* h, grib_expression* g, char* buf, size_t* size, int* err); +const char* grib_expression_get_name(grib_expression* g); +void grib_expression_print(grib_context* ctx, grib_expression* g, grib_handle* f); +void grib_expression_free(grib_context* ctx, grib_expression* g); +void grib_expression_add_dependency(grib_expression* e, grib_accessor* observer); +int grib_expression_set_value(grib_handle* h, grib_expression* g, grib_values* v); +grib_arguments* grib_arguments_new(grib_context* c, grib_expression* g, grib_arguments* n); +void grib_arguments_free(grib_context* c, grib_arguments* g); +void grib_arguments_print(grib_context* c, grib_arguments* g, grib_handle* f); +const char* grib_arguments_get_name(grib_handle* h, grib_arguments* args, int n); +const char* grib_arguments_get_string(grib_handle* h, grib_arguments* args, int n); +long grib_arguments_get_long(grib_handle* h, grib_arguments* args, int n); +double grib_arguments_get_double(grib_handle* h, grib_arguments* args, int n); +grib_expression* grib_arguments_get_expression(grib_handle* h, grib_arguments* args, int n); /* codes_util.c */ char get_dir_separator_char(void); int path_is_directory(const char* filename); -char *codes_getenv(const char *name); +char* codes_getenv(const char* name); /* grib_util.c */ -grib_handle *grib_util_sections_copy(grib_handle *hfrom, grib_handle *hto, int what, int *err); -grib_string_list *grib_util_get_param_id(const char *mars_param); -grib_string_list *grib_util_get_mars_param(const char *param_id); -grib_handle *grib_util_set_spec(grib_handle *h, const grib_util_grid_spec *spec, const grib_util_packing_spec *packing_spec, int flags, const double *data_values, size_t data_values_count, int *err); -grib_handle *grib_util_set_spec2(grib_handle *h, const grib_util_grid_spec2 *spec, const grib_util_packing_spec *packing_spec, int flags, const double *data_values, size_t data_values_count, int *err); -int grib_moments(grib_handle *h, double east, double north, double west, double south, int order, double *moments, long *count); -int parse_keyval_string(const char *grib_tool, char *arg, int values_required, int default_type, grib_values values[], int *count); +grib_handle* grib_util_sections_copy(grib_handle* hfrom, grib_handle* hto, int what, int* err); +grib_string_list* grib_util_get_param_id(const char* mars_param); +grib_string_list* grib_util_get_mars_param(const char* param_id); +grib_handle* grib_util_set_spec(grib_handle* h, const grib_util_grid_spec* spec, const grib_util_packing_spec* packing_spec, int flags, const double* data_values, size_t data_values_count, int* err); +grib_handle* grib_util_set_spec2(grib_handle* h, const grib_util_grid_spec2* spec, const grib_util_packing_spec* packing_spec, int flags, const double* data_values, size_t data_values_count, int* err); +int grib_moments(grib_handle* h, double east, double north, double west, double south, int order, double* moments, long* count); +int parse_keyval_string(const char* grib_tool, char* arg, int values_required, int default_type, grib_values values[], int* count); int grib2_is_PDTN_EPS(long productDefinitionTemplateNumber); int grib2_is_PDTN_Chemical(long productDefinitionTemplateNumber); int grib2_is_PDTN_ChemicalDistFunc(long productDefinitionTemplateNumber); int grib2_is_PDTN_Aerosol(long productDefinitionTemplateNumber); int grib2_is_PDTN_AerosolOptical(long productDefinitionTemplateNumber); int grib2_select_PDTN(int is_eps, int is_instant, int is_chemical, int is_chemical_distfn, int is_aerosol, int is_aerosol_optical); -int is_grib_index_file(const char *filename); +int is_grib_index_file(const char* filename); size_t sum_of_pl_array(const long* pl, size_t plsize); int grib_is_earth_oblate(grib_handle* h); int grib_util_grib_data_quality_check(grib_handle* h, double min_val, double max_val); /* bufr_util.c */ -int compute_bufr_key_rank(grib_handle *h, grib_string_list *keys, const char *key); -char **codes_bufr_copy_data_return_copied_keys(grib_handle *hin, grib_handle *hout, size_t *nkeys, int *err); -int codes_bufr_copy_data(grib_handle *hin, grib_handle *hout); +int compute_bufr_key_rank(grib_handle* h, grib_string_list* keys, const char* key); +char** codes_bufr_copy_data_return_copied_keys(grib_handle* hin, grib_handle* hout, size_t* nkeys, int* err); +int codes_bufr_copy_data(grib_handle* hin, grib_handle* hout); int codes_bufr_extract_headers_malloc(grib_context* c, const char* filename, codes_bufr_header** result, int* num_messages, int strict_mode); -int codes_bufr_header_get_string(codes_bufr_header* bh, const char* key, char *val, size_t *len); +int codes_bufr_header_get_string(codes_bufr_header* bh, const char* key, char* val, size_t* len); /* string_util.c */ -int strcmp_nocase(const char *s1, const char *s2); -void rtrim(char *s); -const char *extract_filename(const char *filepath); -char **string_split(char *inputString, const char *delimiter); +int strcmp_nocase(const char* s1, const char* s2); +void rtrim(char* s); +const char* extract_filename(const char* filepath); +char** string_split(char* inputString, const char* delimiter); int string_to_long(const char* input, long* output); int string_ends_with(const char* str1, const char* str2); @@ -1533,38 +1532,38 @@ double grib_op_lt_d(double a, double b); double grib_op_gt_d(double a, double b); double grib_op_ge_d(double a, double b); double grib_op_le_d(double a, double b); -const char *grib_binop_long_proc_name(grib_binop_long_proc proc); -const char *grib_binop_double_proc_name(grib_binop_double_proc proc); -const char *grib_unop_long_proc_name(grib_unop_long_proc proc); -const char *grib_unop_double_proc_name(grib_unop_double_proc proc); +const char* grib_binop_long_proc_name(grib_binop_long_proc proc); +const char* grib_binop_double_proc_name(grib_binop_double_proc proc); +const char* grib_unop_long_proc_name(grib_unop_long_proc proc); +const char* grib_unop_double_proc_name(grib_unop_double_proc proc); /* codes_memfs.c */ -FILE *codes_fopen(const char *name, const char *mode); -int codes_access(const char *name, int mode); +FILE* codes_fopen(const char* name, const char* mode); +int codes_access(const char* name, int mode); /* grib_accessor_class_data_g2bifourier_packing.c */ /* grib_optimize_decimal_factor.c */ -int grib_optimize_decimal_factor(grib_accessor *a, const char *reference_value, const double pmax, const double pmin, const int knbit, const int compat_gribex, const int compat_32bit, long *kdec, long *kbin, double *ref); +int grib_optimize_decimal_factor(grib_accessor* a, const char* reference_value, const double pmax, const double pmin, const int knbit, const int compat_gribex, const int compat_32bit, long* kdec, long* kbin, double* ref); /* grib_api_version.c */ -const char *grib_get_git_sha1(void); +const char* grib_get_git_sha1(void); /* grib_bits_any_endian.c */ int grib_is_all_bits_one(long val, long nbits); -int grib_encode_string(unsigned char *bitStream, long *bitOffset, size_t numberOfCharacters, const char *string); -char *grib_decode_string(const unsigned char *bitStream, long *bitOffset, size_t numberOfCharacters, char *string); -unsigned long grib_decode_unsigned_long(const unsigned char *p, long *bitp, long nbits); -int grib_encode_unsigned_long(unsigned char *p, unsigned long val, long *bitp, long nbits); +int grib_encode_string(unsigned char* bitStream, long* bitOffset, size_t numberOfCharacters, const char* string); +char* grib_decode_string(const unsigned char* bitStream, long* bitOffset, size_t numberOfCharacters, char* string); +unsigned long grib_decode_unsigned_long(const unsigned char* p, long* bitp, long nbits); +int grib_encode_unsigned_long(unsigned char* p, unsigned long val, long* bitp, long nbits); size_t grib_decode_size_t(const unsigned char* p, long* bitp, long nbits); -int grib_encode_unsigned_longb(unsigned char *p, unsigned long val, long *bitp, long nb); -int grib_encode_size_tb(unsigned char* p, size_t val ,long *bitp, long nb); +int grib_encode_unsigned_longb(unsigned char* p, unsigned long val, long* bitp, long nb); +int grib_encode_size_tb(unsigned char* p, size_t val, long* bitp, long nb); /* grib_bits_any_endian_simple.c */ -int grib_decode_long_array(const unsigned char *p, long *bitp, long bitsPerValue, size_t n_vals, long *val); -int grib_decode_double_array(const unsigned char *p, long *bitp, long bitsPerValue, double reference_value, double s, double d, size_t n_vals, double *val); -int grib_decode_double_array_complex(const unsigned char *p, long *bitp, long nbits, double reference_value, double s, double *d, size_t size, double *val); -int grib_encode_long_array(size_t n_vals, const long *val, long bits_per_value, unsigned char *p, long *off); -int grib_encode_double_array(size_t n_vals, const double *val, long bits_per_value, double reference_value, double d, double divisor, unsigned char *p, long *off); -int grib_encode_double_array_complex(size_t n_vals, double *val, long nbits, double reference_value, double *scal, double d, double divisor, unsigned char *p, long *bitp); +int grib_decode_long_array(const unsigned char* p, long* bitp, long bitsPerValue, size_t n_vals, long* val); +int grib_decode_double_array(const unsigned char* p, long* bitp, long bitsPerValue, double reference_value, double s, double d, size_t n_vals, double* val); +int grib_decode_double_array_complex(const unsigned char* p, long* bitp, long nbits, double reference_value, double s, double* d, size_t size, double* val); +int grib_encode_long_array(size_t n_vals, const long* val, long bits_per_value, unsigned char* p, long* off); +int grib_encode_double_array(size_t n_vals, const double* val, long bits_per_value, double reference_value, double d, double divisor, unsigned char* p, long* off); +int grib_encode_double_array_complex(size_t n_vals, double* val, long nbits, double reference_value, double* scal, double d, double divisor, unsigned char* p, long* bitp); diff --git a/src/grib_emoslib.h b/src/grib_emoslib.h index 9a358a8c4..0b15aef3a 100644 --- a/src/grib_emoslib.h +++ b/src/grib_emoslib.h @@ -8,7 +8,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -int igglat_(long* KLAT, float *PGAUSS, long* KPR, long* KERR); -void gribex_(long* KSEC0, long* KSEC1, long* KSEC2, double *PSEC2,long* KSEC3, double *PSEC3, long* KSEC4, - double *PSEC4, long* KLENP, void* KGRIB, long* KLENG,long* KWORD, char* HOPER, long* KRET); - +int igglat_(long* KLAT, float* PGAUSS, long* KPR, long* KERR); +void gribex_(long* KSEC0, long* KSEC1, long* KSEC2, double* PSEC2, long* KSEC3, double* PSEC3, long* KSEC4, + double* PSEC4, long* KLENP, void* KGRIB, long* KLENG, long* KWORD, char* HOPER, long* KRET); diff --git a/src/grib_parse_utils.c b/src/grib_parse_utils.c index 357fe3429..bb73bed20 100644 --- a/src/grib_parse_utils.c +++ b/src/grib_parse_utils.c @@ -549,7 +549,7 @@ grib_action_file* grib_find_action_file(const char* fname, grib_action_file_list return 0; } -void grib_push_action_file(grib_action_file* af, grib_action_file_list* afl) +static void grib_push_action_file(grib_action_file* af, grib_action_file_list* afl) { if (!afl->first) afl->first = afl->last = af; @@ -853,7 +853,7 @@ grib_action* grib_parse_file(grib_context* gc, const char* filename) af->root = a; af->filename = grib_context_strdup_persistent(gc, filename); - grib_push_action_file(af, gc->grib_reader); + grib_push_action_file(af, gc->grib_reader); /* Add af to grib_reader action file list */ } else grib_context_log(gc, GRIB_LOG_DEBUG, "Using cached version of %s", filename); diff --git a/src/jgribapi_GribFile.h b/src/jgribapi_GribFile.h index 0d8061daa..580118d80 100644 --- a/src/jgribapi_GribFile.h +++ b/src/jgribapi_GribFile.h @@ -22,48 +22,42 @@ extern "C" { * Method: gribGetNextHandle * Signature: (J)Ljgribapi/GribHandle; */ -JNIEXPORT jobject JNICALL Java_jgribapi_GribFile_gribGetNextHandle - (JNIEnv *, jobject, jlong); +JNIEXPORT jobject JNICALL Java_jgribapi_GribFile_gribGetNextHandle(JNIEnv*, jobject, jlong); /* * Class: jgribapi_GribFile * Method: gribEOFReached * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_jgribapi_GribFile_gribEOFReached - (JNIEnv *, jobject, jlong); +JNIEXPORT jlong JNICALL Java_jgribapi_GribFile_gribEOFReached(JNIEnv*, jobject, jlong); /* * Class: jgribapi_GribFile * Method: gribGetGribFile * Signature: (Ljava/lang/String;)J */ -JNIEXPORT jlong JNICALL Java_jgribapi_GribFile_gribGetGribFile - (JNIEnv *, jobject, jstring); +JNIEXPORT jlong JNICALL Java_jgribapi_GribFile_gribGetGribFile(JNIEnv*, jobject, jstring); /* * Class: jgribapi_GribFile * Method: gribCloseFile * Signature: (J)V */ -JNIEXPORT void JNICALL Java_jgribapi_GribFile_gribCloseFile - (JNIEnv *, jobject, jlong); +JNIEXPORT void JNICALL Java_jgribapi_GribFile_gribCloseFile(JNIEnv*, jobject, jlong); /* * Class: jgribapi_GribFile * Method: gribNewFile * Signature: (Ljava/lang/String;)J */ -JNIEXPORT jlong JNICALL Java_jgribapi_GribFile_gribNewFile - (JNIEnv *, jobject, jstring); +JNIEXPORT jlong JNICALL Java_jgribapi_GribFile_gribNewFile(JNIEnv*, jobject, jstring); /* * Class: jgribapi_GribFile * Method: gribWriteHandle * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_jgribapi_GribFile_gribWriteHandle - (JNIEnv *, jobject, jlong, jlong); +JNIEXPORT void JNICALL Java_jgribapi_GribFile_gribWriteHandle(JNIEnv*, jobject, jlong, jlong); #ifdef __cplusplus } diff --git a/src/jgribapi_GribHandle.h b/src/jgribapi_GribHandle.h index ff0775f49..668ea4f1f 100644 --- a/src/jgribapi_GribHandle.h +++ b/src/jgribapi_GribHandle.h @@ -22,152 +22,133 @@ extern "C" { * Method: getIteratorID * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_jgribapi_GribHandle_getIteratorID - (JNIEnv *, jobject, jlong); +JNIEXPORT jlong JNICALL Java_jgribapi_GribHandle_getIteratorID(JNIEnv*, jobject, jlong); /* * Class: jgribapi_GribHandle * Method: gribGetString * Signature: (JLjava/lang/String;)Ljava/lang/String; */ -JNIEXPORT jstring JNICALL Java_jgribapi_GribHandle_gribGetString - (JNIEnv *, jobject, jlong, jstring); +JNIEXPORT jstring JNICALL Java_jgribapi_GribHandle_gribGetString(JNIEnv*, jobject, jlong, jstring); /* * Class: jgribapi_GribHandle * Method: gribGetLong * Signature: (JLjava/lang/String;)J */ -JNIEXPORT jlong JNICALL Java_jgribapi_GribHandle_gribGetLong - (JNIEnv *, jobject, jlong, jstring); +JNIEXPORT jlong JNICALL Java_jgribapi_GribHandle_gribGetLong(JNIEnv*, jobject, jlong, jstring); /* * Class: jgribapi_GribHandle * Method: gribGetDouble * Signature: (JLjava/lang/String;)D */ -JNIEXPORT jdouble JNICALL Java_jgribapi_GribHandle_gribGetDouble - (JNIEnv *, jobject, jlong, jstring); +JNIEXPORT jdouble JNICALL Java_jgribapi_GribHandle_gribGetDouble(JNIEnv*, jobject, jlong, jstring); /* * Class: jgribapi_GribHandle * Method: gribGetLongArray * Signature: (JLjava/lang/String;)[J */ -JNIEXPORT jlongArray JNICALL Java_jgribapi_GribHandle_gribGetLongArray - (JNIEnv *, jobject, jlong, jstring); +JNIEXPORT jlongArray JNICALL Java_jgribapi_GribHandle_gribGetLongArray(JNIEnv*, jobject, jlong, jstring); /* * Class: jgribapi_GribHandle * Method: gribGetDoubleArray * Signature: (JLjava/lang/String;)[D */ -JNIEXPORT jdoubleArray JNICALL Java_jgribapi_GribHandle_gribGetDoubleArray - (JNIEnv *, jobject, jlong, jstring); +JNIEXPORT jdoubleArray JNICALL Java_jgribapi_GribHandle_gribGetDoubleArray(JNIEnv*, jobject, jlong, jstring); /* * Class: jgribapi_GribHandle * Method: gribSetString * Signature: (JLjava/lang/String;Ljava/lang/String;)I */ -JNIEXPORT jint JNICALL Java_jgribapi_GribHandle_gribSetString - (JNIEnv *, jobject, jlong, jstring, jstring); +JNIEXPORT jint JNICALL Java_jgribapi_GribHandle_gribSetString(JNIEnv*, jobject, jlong, jstring, jstring); /* * Class: jgribapi_GribHandle * Method: gribCreateNext * Signature: (J)Ljgribapi/GribKey; */ -JNIEXPORT jobject JNICALL Java_jgribapi_GribHandle_gribCreateNext - (JNIEnv *, jobject, jlong); +JNIEXPORT jobject JNICALL Java_jgribapi_GribHandle_gribCreateNext(JNIEnv*, jobject, jlong); /* * Class: jgribapi_GribHandle * Method: gribSetSearch * Signature: (JLjava/lang/String;)J */ -JNIEXPORT jlong JNICALL Java_jgribapi_GribHandle_gribSetSearch - (JNIEnv *, jobject, jlong, jstring); +JNIEXPORT jlong JNICALL Java_jgribapi_GribHandle_gribSetSearch(JNIEnv*, jobject, jlong, jstring); /* * Class: jgribapi_GribHandle * Method: gribSetLong * Signature: (JLjava/lang/String;J)I */ -JNIEXPORT jint JNICALL Java_jgribapi_GribHandle_gribSetLong - (JNIEnv *, jobject, jlong, jstring, jlong); +JNIEXPORT jint JNICALL Java_jgribapi_GribHandle_gribSetLong(JNIEnv*, jobject, jlong, jstring, jlong); /* * Class: jgribapi_GribHandle * Method: gribSetDouble * Signature: (JLjava/lang/String;D)I */ -JNIEXPORT jint JNICALL Java_jgribapi_GribHandle_gribSetDouble - (JNIEnv *, jobject, jlong, jstring, jdouble); +JNIEXPORT jint JNICALL Java_jgribapi_GribHandle_gribSetDouble(JNIEnv*, jobject, jlong, jstring, jdouble); /* * Class: jgribapi_GribHandle * Method: gribSetLongArray * Signature: (JLjava/lang/String;[J)I */ -JNIEXPORT jint JNICALL Java_jgribapi_GribHandle_gribSetLongArray - (JNIEnv *, jobject, jlong, jstring, jlongArray); +JNIEXPORT jint JNICALL Java_jgribapi_GribHandle_gribSetLongArray(JNIEnv*, jobject, jlong, jstring, jlongArray); /* * Class: jgribapi_GribHandle * Method: gribSetDoubleArray * Signature: (JLjava/lang/String;[D)I */ -JNIEXPORT jint JNICALL Java_jgribapi_GribHandle_gribSetDoubleArray - (JNIEnv *, jobject, jlong, jstring, jdoubleArray); +JNIEXPORT jint JNICALL Java_jgribapi_GribHandle_gribSetDoubleArray(JNIEnv*, jobject, jlong, jstring, jdoubleArray); /* * Class: jgribapi_GribHandle * Method: gribGetXml * Signature: (J)Ljava/lang/String; */ -JNIEXPORT jstring JNICALL Java_jgribapi_GribHandle_gribGetXml__J - (JNIEnv *, jobject, jlong); +JNIEXPORT jstring JNICALL Java_jgribapi_GribHandle_gribGetXml__J(JNIEnv*, jobject, jlong); /* * Class: jgribapi_GribHandle * Method: gribGetXml * Signature: (JLjava/lang/String;)Ljava/lang/String; */ -JNIEXPORT jstring JNICALL Java_jgribapi_GribHandle_gribGetXml__JLjava_lang_String_2 - (JNIEnv *, jobject, jlong, jstring); +JNIEXPORT jstring JNICALL Java_jgribapi_GribHandle_gribGetXml__JLjava_lang_String_2(JNIEnv*, jobject, jlong, jstring); /* * Class: jgribapi_GribHandle * Method: gribGetAscii * Signature: (JLjava/lang/String;)Ljava/lang/String; */ -JNIEXPORT jstring JNICALL Java_jgribapi_GribHandle_gribGetAscii - (JNIEnv *, jobject, jlong, jstring); +JNIEXPORT jstring JNICALL Java_jgribapi_GribHandle_gribGetAscii(JNIEnv*, jobject, jlong, jstring); /* * Class: jgribapi_GribHandle * Method: gribGetBytes * Signature: (JLjava/lang/String;)[B */ -JNIEXPORT jbyteArray JNICALL Java_jgribapi_GribHandle_gribGetBytes - (JNIEnv *, jobject, jlong, jstring); +JNIEXPORT jbyteArray JNICALL Java_jgribapi_GribHandle_gribGetBytes(JNIEnv*, jobject, jlong, jstring); /* * Class: jgribapi_GribHandle * Method: gribDeleteHandle * Signature: (J)I */ -JNIEXPORT jint JNICALL Java_jgribapi_GribHandle_gribDeleteHandle - (JNIEnv *, jobject, jlong); +JNIEXPORT jint JNICALL Java_jgribapi_GribHandle_gribDeleteHandle(JNIEnv*, jobject, jlong); /* * Class: jgribapi_GribHandle * Method: gribResetHandle * Signature: (J)V */ -JNIEXPORT void JNICALL Java_jgribapi_GribHandle_gribResetHandle - (JNIEnv *, jobject, jlong); +JNIEXPORT void JNICALL Java_jgribapi_GribHandle_gribResetHandle(JNIEnv*, jobject, jlong); #ifdef __cplusplus } diff --git a/src/jgribapi_GribIterator.h b/src/jgribapi_GribIterator.h index 782e578bd..fcbad5b7b 100644 --- a/src/jgribapi_GribIterator.h +++ b/src/jgribapi_GribIterator.h @@ -22,16 +22,14 @@ extern "C" { * Method: gribIteratorGetNext * Signature: (J)Ljgribapi/GribPoint; */ -JNIEXPORT jobject JNICALL Java_jgribapi_GribIterator_gribIteratorGetNext - (JNIEnv *, jobject, jlong); +JNIEXPORT jobject JNICALL Java_jgribapi_GribIterator_gribIteratorGetNext(JNIEnv*, jobject, jlong); /* * Class: jgribapi_GribIterator * Method: gribIteratorHasNext * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_jgribapi_GribIterator_gribIteratorHasNext - (JNIEnv *, jobject, jlong); +JNIEXPORT jlong JNICALL Java_jgribapi_GribIterator_gribIteratorHasNext(JNIEnv*, jobject, jlong); #ifdef __cplusplus } diff --git a/src/md5.h b/src/md5.h index 973d2981c..16acfeb84 100644 --- a/src/md5.h +++ b/src/md5.h @@ -14,7 +14,8 @@ #include #include -typedef struct grib_md5_state { +typedef struct grib_md5_state +{ uint64_t size; unsigned long words[64]; @@ -31,6 +32,6 @@ typedef struct grib_md5_state { void grib_md5_init(grib_md5_state* s); void grib_md5_add(grib_md5_state* s, const void* data, size_t len); -void grib_md5_end(grib_md5_state* s, char *digest); +void grib_md5_end(grib_md5_state* s, char* digest); #endif diff --git a/tests/bits.c b/tests/bits.c old mode 100755 new mode 100644 index b06ac279f..0163f88e7 --- a/tests/bits.c +++ b/tests/bits.c @@ -15,117 +15,118 @@ #include "grib_api_internal.h" -#define NO_PRINT 1 -#define PRINT_ALL (1<<1) -#define PRINT_ROUND_ERRORS (1<<2) -#define PRINT_TRUNCATION (1<<3) -#define NO_NEAREST_SMALLER_IBM_FLOAT (1<<4) - -void test_bits(double x,unsigned long mode) { - double y=0,z=0,w=0,t=0; - double dy=0,dz=0,dw=0,dt=0; - unsigned long i=0,j=0,k=0,l=0; - - i=grib_ibm_to_long(x); - y=grib_long_to_ibm(i); - dy=y-x; - - z=grib_long_to_ibm(j); - dz=z-x; - - k=grib_ibm_nearest_smaller_to_long(x); - w=grib_long_to_ibm(k); - dw=w-x; - - if ( !(mode & NO_NEAREST_SMALLER_IBM_FLOAT) ) { - t=grib_nearest_smaller_ibm_float(x); - l=grib_ibm_to_long(y); - dt=t-x; - } +#define NO_PRINT 1 +#define PRINT_ALL (1 << 1) +#define PRINT_ROUND_ERRORS (1 << 2) +#define PRINT_TRUNCATION (1 << 3) +#define NO_NEAREST_SMALLER_IBM_FLOAT (1 << 4) - if (mode & PRINT_ALL) { - printf("x=%.20e \n",x); - printf("grib_ibm_to_long %lu (0x%lx) -> %.20e diff=%.20e\n",i,i,y,dy); - printf("grib_nearest_smaller_ibm_float %lu (0x%lx) -> %.20e diff=%.20e\n",l,l,t,dt); - printf("grib_ibm_nearest_smaller_to_long %lu (0x%lx) -> %.20e diff=%.20e\n",k,k,w,dw); - } +void test_bits(double x, unsigned long mode) +{ + double y = 0, z = 0, w = 0, t = 0; + double dy = 0, dz = 0, dw = 0, dt = 0; + unsigned long i = 0, j = 0, k = 0, l = 0; - if (fabs(dz) < fabs(dy) && ( (mode & PRINT_ROUND_ERRORS )| (mode & PRINT_ALL ) )) { - printf("!!!!!!!!!!-------------- Rounding error \n"); - printf("x=%.20e \n",x); - printf("grib_ibm_to_long %lu (0x%lx) -> %.20e diff=%.20e\n",i,i,y,dy); - printf("grib_ibm_to_long_trunc %lu (0x%lx) -> %.20e diff=%.20e\n",j,j,z,dz); - printf("grib_nearest_smaller_ibm_float %lu (0x%lx) -> %.20e diff=%.20e\n",l,l,t,dt); - printf("grib_ibm_nearest_smaller_to_long %lu (0x%lx) -> %.20e diff=%.20e\n",k,k,w,dw); - } + i = grib_ibm_to_long(x); + y = grib_long_to_ibm(i); + dy = y - x; - if (( w != t) && ( (mode & PRINT_TRUNCATION ) | ( mode & PRINT_ALL ) ) ) { - printf("!!!!!!!!!!--------------- Different nearest smaller \n"); - printf("x=%.20e \n",x); - printf("grib_ibm_to_long %lu (0x%lx) -> %.20e diff=%.20e\n",i,i,y,dy); - printf("grib_ibm_to_long_trunc %lu (0x%lx) -> %.20e diff=%.20e\n",j,j,z,dz); - printf("grib_nearest_smaller_ibm_float %lu (0x%lx) -> %.20e diff=%.20e\n",l,l,t,dt); - printf("grib_ibm_nearest_smaller_to_long %lu (0x%lx) -> %.20e diff=%.20e\n",k,k,w,dw); - } -} + z = grib_long_to_ibm(j); + dz = z - x; + + k = grib_ibm_nearest_smaller_to_long(x); + w = grib_long_to_ibm(k); + dw = w - x; -void print_machine_parameters() { - int ibeta=0, it=0, irnd=0, ngrd=0, machep=0, negep=0, iexp=0, minexp=0, maxexp=0; - float eps=0, epsneg=0, xmin=0, xmax=0; - - printf("-- Machine parameters ---\n"); - printf("ibeta=%d\n",ibeta); - printf("it=%d\n",it); - printf("irnd=%d\n",irnd); - printf("ngrd=%d\n",ngrd); - printf("machep=%d\n",machep); - printf("negep=%d\n",negep); - printf("iexp=%d\n",iexp); - printf("minexp=%d\n",minexp); - printf("maxexp=%d\n",maxexp); - printf("eps=%g\n",eps); - printf("epsneg=%g\n",epsneg); - printf("xmin=%.20e\n",xmin); - printf("xmax=%.20e\n",xmax); - printf("-------------------------\n\n"); + if (!(mode & NO_NEAREST_SMALLER_IBM_FLOAT)) { + t = grib_nearest_smaller_ibm_float(x); + l = grib_ibm_to_long(y); + dt = t - x; + } + + if (mode & PRINT_ALL) { + printf("x=%.20e \n", x); + printf("grib_ibm_to_long %lu (0x%lx) -> %.20e diff=%.20e\n", i, i, y, dy); + printf("grib_nearest_smaller_ibm_float %lu (0x%lx) -> %.20e diff=%.20e\n", l, l, t, dt); + printf("grib_ibm_nearest_smaller_to_long %lu (0x%lx) -> %.20e diff=%.20e\n", k, k, w, dw); + } + if (fabs(dz) < fabs(dy) && ((mode & PRINT_ROUND_ERRORS) | (mode & PRINT_ALL))) { + printf("!!!!!!!!!!-------------- Rounding error \n"); + printf("x=%.20e \n", x); + printf("grib_ibm_to_long %lu (0x%lx) -> %.20e diff=%.20e\n", i, i, y, dy); + printf("grib_ibm_to_long_trunc %lu (0x%lx) -> %.20e diff=%.20e\n", j, j, z, dz); + printf("grib_nearest_smaller_ibm_float %lu (0x%lx) -> %.20e diff=%.20e\n", l, l, t, dt); + printf("grib_ibm_nearest_smaller_to_long %lu (0x%lx) -> %.20e diff=%.20e\n", k, k, w, dw); + } + + if ((w != t) && ((mode & PRINT_TRUNCATION) | (mode & PRINT_ALL))) { + printf("!!!!!!!!!!--------------- Different nearest smaller \n"); + printf("x=%.20e \n", x); + printf("grib_ibm_to_long %lu (0x%lx) -> %.20e diff=%.20e\n", i, i, y, dy); + printf("grib_ibm_to_long_trunc %lu (0x%lx) -> %.20e diff=%.20e\n", j, j, z, dz); + printf("grib_nearest_smaller_ibm_float %lu (0x%lx) -> %.20e diff=%.20e\n", l, l, t, dt); + printf("grib_ibm_nearest_smaller_to_long %lu (0x%lx) -> %.20e diff=%.20e\n", k, k, w, dw); + } } -int main(int argc, char *argv[]) +void print_machine_parameters() { - double x,y,z,w,d,eps,epst,epsh; - double dt=0; - unsigned long i,j,n,nc,c,m; - unsigned long seed=123; - unsigned char ibm[4]; - float xf=0; - int r; - unsigned long iminp=0x00100000, imaxp=0x7fffffff; - unsigned long iminn=0x80100000, imaxn=0xffffffff; - double dminp=0,dmaxp=0,dminn=0,dmaxn=0; - double dminpn=0,dmaxpp=0,dminnn=0,dmaxnp=0; - unsigned long A; - long e; - int k,cc; - - dminp=grib_long_to_ibm(iminp); - dminpn=grib_long_to_ibm(iminp+1); - dmaxp=grib_long_to_ibm(imaxp); - dmaxpp=grib_long_to_ibm(imaxp-1); - dminn=grib_long_to_ibm(iminn); - dminnn=grib_long_to_ibm(iminn+1); - dmaxn=grib_long_to_ibm(imaxn); - dmaxnp=grib_long_to_ibm(imaxn-1); - - x=-1.33642013258103330000e-83; - i=grib_ibm_to_long(x); - j=grib_ibm_nearest_smaller_to_long(x); - printf("grib_ibm_to_long(%.20e)=0x%lX grib_long_to_ibm(0x%lX)=%.20e grib_ibm_nearest_smaller_to_long(%.20e)=0x%lX\n", - x,i,i,grib_long_to_ibm(i),x,j); - printf("grib_long_to_ibm(grib_ibm_nearest_smaller_to_long(%.20e))=%.20e\n",x,grib_long_to_ibm(j)); - exit(0); + int ibeta = 0, it = 0, irnd = 0, ngrd = 0, machep = 0, negep = 0, iexp = 0, minexp = 0, maxexp = 0; + float eps = 0, epsneg = 0, xmin = 0, xmax = 0; + + printf("-- Machine parameters ---\n"); + printf("ibeta=%d\n", ibeta); + printf("it=%d\n", it); + printf("irnd=%d\n", irnd); + printf("ngrd=%d\n", ngrd); + printf("machep=%d\n", machep); + printf("negep=%d\n", negep); + printf("iexp=%d\n", iexp); + printf("minexp=%d\n", minexp); + printf("maxexp=%d\n", maxexp); + printf("eps=%g\n", eps); + printf("epsneg=%g\n", epsneg); + printf("xmin=%.20e\n", xmin); + printf("xmax=%.20e\n", xmax); + printf("-------------------------\n\n"); +} -/* +int main(int argc, char* argv[]) +{ + double x, y, z, w, d, eps, epst, epsh; + double dt = 0; + unsigned long i, j, n, nc, c, m; + unsigned long seed = 123; + unsigned char ibm[4]; + float xf = 0; + int r; + unsigned long iminp = 0x00100000, imaxp = 0x7fffffff; + unsigned long iminn = 0x80100000, imaxn = 0xffffffff; + double dminp = 0, dmaxp = 0, dminn = 0, dmaxn = 0; + double dminpn = 0, dmaxpp = 0, dminnn = 0, dmaxnp = 0; + unsigned long A; + long e; + int k, cc; + + dminp = grib_long_to_ibm(iminp); + dminpn = grib_long_to_ibm(iminp + 1); + dmaxp = grib_long_to_ibm(imaxp); + dmaxpp = grib_long_to_ibm(imaxp - 1); + dminn = grib_long_to_ibm(iminn); + dminnn = grib_long_to_ibm(iminn + 1); + dmaxn = grib_long_to_ibm(imaxn); + dmaxnp = grib_long_to_ibm(imaxn - 1); + + x = -1.33642013258103330000e-83; + i = grib_ibm_to_long(x); + j = grib_ibm_nearest_smaller_to_long(x); + printf("grib_ibm_to_long(%.20e)=0x%lX grib_long_to_ibm(0x%lX)=%.20e grib_ibm_nearest_smaller_to_long(%.20e)=0x%lX\n", + x, i, i, grib_long_to_ibm(i), x, j); + printf("grib_long_to_ibm(grib_ibm_nearest_smaller_to_long(%.20e))=%.20e\n", x, grib_long_to_ibm(j)); + exit(0); + + /* if (argc > 1 ) { x=atof(argv[1]); test_bits(x,PRINT_ALL); @@ -134,7 +135,7 @@ int main(int argc, char *argv[]) } */ -/* + /* i=0x49800000; x=grib_long_to_ibm(i); j=grib_ibm_to_long(x); @@ -142,18 +143,18 @@ int main(int argc, char *argv[]) exit(0); */ - printf("-------------------------------- ibm float -------------------------------\n"); - printf("Min positive 0x%lX -> %.8e ",iminp,dminp); - printf("-- next 0x%lX -> %.8e diff=%.3e\n",iminp+1,dminpn,dminp-dminpn); - printf("Max positive 0x%lX -> %.8e ",imaxp,dmaxp); - printf("-- prev 0x%lX -> %.8e diff= %.3e\n",imaxp-1,dmaxpp,dmaxp-dmaxpp); - printf("Min negative 0x%lX -> %.8e ",iminn,dminn); - printf("-- next 0x%lX -> %.8e diff= %.3e\n",iminn+1,dminnn,dminn-dminnn); - printf("Max negative 0x%lX -> %.8e ",imaxn,dmaxn); - printf("-- prev 0x%lX -> %.8e diff=%.3e\n",imaxn-1,dmaxnp,dmaxn-dmaxnp); - printf("%lu negative values, %lu positive values\n",(imaxn-iminn),(imaxp-iminp)); - printf("--------------------------------------------------------------------------\n"); - fflush(stdout); + printf("-------------------------------- ibm float -------------------------------\n"); + printf("Min positive 0x%lX -> %.8e ", iminp, dminp); + printf("-- next 0x%lX -> %.8e diff=%.3e\n", iminp + 1, dminpn, dminp - dminpn); + printf("Max positive 0x%lX -> %.8e ", imaxp, dmaxp); + printf("-- prev 0x%lX -> %.8e diff= %.3e\n", imaxp - 1, dmaxpp, dmaxp - dmaxpp); + printf("Min negative 0x%lX -> %.8e ", iminn, dminn); + printf("-- next 0x%lX -> %.8e diff= %.3e\n", iminn + 1, dminnn, dminn - dminnn); + printf("Max negative 0x%lX -> %.8e ", imaxn, dmaxn); + printf("-- prev 0x%lX -> %.8e diff=%.3e\n", imaxn - 1, dmaxnp, dmaxn - dmaxnp); + printf("%lu negative values, %lu positive values\n", (imaxn - iminn), (imaxp - iminp)); + printf("--------------------------------------------------------------------------\n"); + fflush(stdout); #if 0 if (0) { printf("---- Test --------- ibm_to_long(long_to_ibm()) ---------------------------\n"); @@ -216,107 +217,115 @@ int main(int argc, char *argv[]) printf("----------------------------------\n"); #endif - printf("\n--- Rounding & nearest smaller test --------------\n"); - fflush(stdout); - nc=((imaxn-iminp))/100; - printf("imaxn=%lu iminp=%lu nc=%lu\n",imaxn,iminp,nc); - fflush(stdout); - c=0; - cc=1; - i=0xCC100000; - /* for (i=0x7F100000 ;i=nc) { printf("%d - %lu 0x%lX\n",cc,i-iminp,i);fflush(stdout); c=0;cc++; } - - A = (i & 0x7f000000) >> 24; - e = A-70; - eps=1; - m = (i & 0xffffff); - /* printf("---m=0x%lX\n",m); */ - - eps=grib_ibm_table_e(A); - - epsh=eps/2; - epst=eps/3; - - y=grib_long_to_ibm(i); - if (grib_ibm_to_long(y) != i) { - printf("------ grib_long_to_ibm(grib_ibm_to_long()) Failure -----------------\n"); - printf("i=0x%lX\n",i); - printf("grib_long_to_ibm(0x%lX)=%.20e \n", i,grib_long_to_ibm(i)); - printf("grib_long_to_ibm(0x%lX)=%.20e \n", i-1,grib_long_to_ibm(i-1)); - printf("grib_long_to_ibm(0x%lX)=%.20e \n", i+1,grib_long_to_ibm(i+1)); - printf("eps=%.20e\n",eps); - printf("y=%.20e grib_ibm_to_long(y)=0x%lX grib_long_to_ibm(grib_ibm_to_long(y))=%.20e\n",y,j,z); - printf("fabs(grib_long_to_ibm(grib_ibm_to_long(y))-y)=%.20e \n",d); - printf("--------------------------------------------------------\n"); - fflush(stdout); - exit(1); - } - - for (k=1;k<3;k++) { - if (i == 0x7FFFFFFF) continue; - if (y>0) y+=epst; - else y-=epst; - - /* rounding test */ - j=grib_ibm_to_long(y); - z=grib_long_to_ibm(j); - d=fabs(z-y); - if ( d > epsh ) { - printf("---------------- Rounding Failure ----------------------\n"); - printf("i=0x%lX\n",i); - printf("grib_long_to_ibm(0x%lX)=%.20e \n", i,grib_long_to_ibm(i)); - printf("grib_long_to_ibm(0x%lX)=%.20e \n", i-1,grib_long_to_ibm(i-1)); - printf("grib_long_to_ibm(0x%lX)=%.20e \n", i+1,grib_long_to_ibm(i+1)); - printf("eps=%.20e\n",eps); - printf("y=%.20e grib_ibm_to_long(y)=0x%lX grib_long_to_ibm(grib_ibm_to_long(y))=%.20e\n",y,j,z); - printf("fabs(grib_long_to_ibm(grib_ibm_to_long(y))-y)=%.20e \n",d); - printf("--------------------------------------------------------\n"); - fflush(stdout); - exit(1); - } - - /* nearest smaller test */ - j=grib_ibm_nearest_smaller_to_long(y); - z=grib_long_to_ibm(j); - d=z-y; - if ( d > 0 ) { - printf("---------------- Nearest smaller Failure ---------------\n"); - printf("i=0x%lX\n",i); - printf("grib_long_to_ibm(0x%lX)=%.20e \n", i-1,grib_long_to_ibm(i-1)); - printf("grib_long_to_ibm(0x%lX)=%.20e \n", i,grib_long_to_ibm(i)); - printf("grib_long_to_ibm(0x%lX)=%.20e \n", i+1,grib_long_to_ibm(i+1)); - printf("eps=%.20e d=%.20e\n",eps,d); - printf(" y=%.20e grib_ibm_nearest_smaller_to_long(y)=0x%lX\n",y,j); - printf("grib_long_to_ibm(0x%lX)=%.20e\n",j,z); - printf("--------------------------------------------------------\n"); - fflush(stdout); - exit(1); - } - if ( abs(d) > eps ) { - printf("---------------- Nearest smaller warning ---------------\n"); - printf("i=0x%lX\n",i); - printf("grib_long_to_ibm(0x%lX)=%.20e \n", i-1,grib_long_to_ibm(i-1)); - printf("grib_long_to_ibm(0x%lX)=%.20e \n", i,grib_long_to_ibm(i)); - printf("grib_long_to_ibm(0x%lX)=%.20e \n", i+1,grib_long_to_ibm(i+1)); - printf("eps=%.20e d=%.20e\n",eps,d); - printf(" y=%.20e grib_ibm_nearest_smaller_to_long(y)=0x%lX\n",y,j); - printf("grib_long_to_ibm(0x%lX)=%.20e\n",j,z); - printf("--------------------------------------------------------\n"); - fflush(stdout); + printf("\n--- Rounding & nearest smaller test --------------\n"); + fflush(stdout); + nc = ((imaxn - iminp)) / 100; + printf("imaxn=%lu iminp=%lu nc=%lu\n", imaxn, iminp, nc); + fflush(stdout); + c = 0; + cc = 1; + i = 0xCC100000; + /* for (i=0x7F100000 ;i= nc) { + printf("%d - %lu 0x%lX\n", cc, i - iminp, i); + fflush(stdout); + c = 0; + cc++; + } + + A = (i & 0x7f000000) >> 24; + e = A - 70; + eps = 1; + m = (i & 0xffffff); + /* printf("---m=0x%lX\n",m); */ + + eps = grib_ibm_table_e(A); + + epsh = eps / 2; + epst = eps / 3; + + y = grib_long_to_ibm(i); + if (grib_ibm_to_long(y) != i) { + printf("------ grib_long_to_ibm(grib_ibm_to_long()) Failure -----------------\n"); + printf("i=0x%lX\n", i); + printf("grib_long_to_ibm(0x%lX)=%.20e \n", i, grib_long_to_ibm(i)); + printf("grib_long_to_ibm(0x%lX)=%.20e \n", i - 1, grib_long_to_ibm(i - 1)); + printf("grib_long_to_ibm(0x%lX)=%.20e \n", i + 1, grib_long_to_ibm(i + 1)); + printf("eps=%.20e\n", eps); + printf("y=%.20e grib_ibm_to_long(y)=0x%lX grib_long_to_ibm(grib_ibm_to_long(y))=%.20e\n", y, j, z); + printf("fabs(grib_long_to_ibm(grib_ibm_to_long(y))-y)=%.20e \n", d); + printf("--------------------------------------------------------\n"); + fflush(stdout); + exit(1); + } + + for (k = 1; k < 3; k++) { + if (i == 0x7FFFFFFF) continue; + if (y > 0) + y += epst; + else + y -= epst; + + /* rounding test */ + j = grib_ibm_to_long(y); + z = grib_long_to_ibm(j); + d = fabs(z - y); + if (d > epsh) { + printf("---------------- Rounding Failure ----------------------\n"); + printf("i=0x%lX\n", i); + printf("grib_long_to_ibm(0x%lX)=%.20e \n", i, grib_long_to_ibm(i)); + printf("grib_long_to_ibm(0x%lX)=%.20e \n", i - 1, grib_long_to_ibm(i - 1)); + printf("grib_long_to_ibm(0x%lX)=%.20e \n", i + 1, grib_long_to_ibm(i + 1)); + printf("eps=%.20e\n", eps); + printf("y=%.20e grib_ibm_to_long(y)=0x%lX grib_long_to_ibm(grib_ibm_to_long(y))=%.20e\n", y, j, z); + printf("fabs(grib_long_to_ibm(grib_ibm_to_long(y))-y)=%.20e \n", d); + printf("--------------------------------------------------------\n"); + fflush(stdout); + exit(1); + } + + /* nearest smaller test */ + j = grib_ibm_nearest_smaller_to_long(y); + z = grib_long_to_ibm(j); + d = z - y; + if (d > 0) { + printf("---------------- Nearest smaller Failure ---------------\n"); + printf("i=0x%lX\n", i); + printf("grib_long_to_ibm(0x%lX)=%.20e \n", i - 1, grib_long_to_ibm(i - 1)); + printf("grib_long_to_ibm(0x%lX)=%.20e \n", i, grib_long_to_ibm(i)); + printf("grib_long_to_ibm(0x%lX)=%.20e \n", i + 1, grib_long_to_ibm(i + 1)); + printf("eps=%.20e d=%.20e\n", eps, d); + printf(" y=%.20e grib_ibm_nearest_smaller_to_long(y)=0x%lX\n", y, j); + printf("grib_long_to_ibm(0x%lX)=%.20e\n", j, z); + printf("--------------------------------------------------------\n"); + fflush(stdout); + exit(1); + } + if (abs(d) > eps) { + printf("---------------- Nearest smaller warning ---------------\n"); + printf("i=0x%lX\n", i); + printf("grib_long_to_ibm(0x%lX)=%.20e \n", i - 1, grib_long_to_ibm(i - 1)); + printf("grib_long_to_ibm(0x%lX)=%.20e \n", i, grib_long_to_ibm(i)); + printf("grib_long_to_ibm(0x%lX)=%.20e \n", i + 1, grib_long_to_ibm(i + 1)); + printf("eps=%.20e d=%.20e\n", eps, d); + printf(" y=%.20e grib_ibm_nearest_smaller_to_long(y)=0x%lX\n", y, j); + printf("grib_long_to_ibm(0x%lX)=%.20e\n", j, z); + printf("--------------------------------------------------------\n"); + fflush(stdout); + } + } + + c++; } - } - - c++; - } - printf("\n--- test finished ---------------------------------\n"); + printf("\n--- test finished ---------------------------------\n"); - return 0; + return 0; } diff --git a/tests/bpv_limit.c b/tests/bpv_limit.c index cd2f580ec..101f1ee83 100644 --- a/tests/bpv_limit.c +++ b/tests/bpv_limit.c @@ -16,18 +16,19 @@ #include #include "grib_api.h" -static double compare_double_absolute(double a,double b,double tolerance) +static double compare_double_absolute(double a, double b, double tolerance) { - double ret=0; - double d=fabs(a-b); + double ret = 0; + double d = fabs(a - b); if (d > tolerance) { - ret=d; + ret = d; } return ret; } -static void usage(const char* prog) { - fprintf(stderr, "usage: %s input\n",prog); +static void usage(const char* prog) +{ + fprintf(stderr, "usage: %s input\n", prog); exit(1); } @@ -38,37 +39,40 @@ static int check_error_code(int err) return GRIB_INVALID_ARGUMENT; } -int main(int argc, char** argv) { - int err = 0, i; - size_t values_len=0; - double *values = NULL; - char error_msg[100] ; +int main(int argc, char** argv) +{ + int err = 0, i; + size_t values_len = 0; + double* values = NULL; + char error_msg[100]; const double tolerance = 1e-5; - size_t slong = sizeof(long) * 8 ; - grib_handle *h; - char* filename ; + size_t slong = sizeof(long) * 8; + grib_handle* h; + char* filename; - if (argc<2) usage(argv[0]); - filename=argv[1]; + if (argc < 2) usage(argv[0]); + filename = argv[1]; - for (i=0;i<255;i++) { - FILE* in = fopen(filename,"rb"); assert(in); - h = grib_handle_new_from_file(0,in,&err); assert(h); + for (i = 0; i < 255; i++) { + FILE* in = fopen(filename, "rb"); + assert(in); + h = grib_handle_new_from_file(0, in, &err); + assert(h); /* get the size of the values array*/ - GRIB_CHECK(grib_get_size(h,"values",&values_len),0); + GRIB_CHECK(grib_get_size(h, "values", &values_len), 0); - values = (double*)malloc(values_len*sizeof(double)); + values = (double*)malloc(values_len * sizeof(double)); - err = grib_get_double_array(h,"values",values,&values_len); + err = grib_get_double_array(h, "values", values, &values_len); if (compare_double_absolute(values[0], 2.7900000000e+02, tolerance) != 0) - printf("oops i=%d values[0]=%g\n", i,values[0]); + printf("oops i=%d values[0]=%g\n", i, values[0]); if (compare_double_absolute(values[1], 2.7996093750e+02, tolerance) != 0) - printf("oops i=%d values[1]=%g\n", i,values[1]); + printf("oops i=%d values[1]=%g\n", i, values[1]); - GRIB_CHECK(grib_set_long(h,"bitsPerValue",i),0); + GRIB_CHECK(grib_set_long(h, "bitsPerValue", i), 0); - err = grib_set_double_array(h,"values",values,values_len); + err = grib_set_double_array(h, "values", values, values_len); free(values); values = 0; @@ -80,16 +84,18 @@ int main(int argc, char** argv) { if (i < slong && err == 0) { /* do nothing */ - } else if (i >= slong && check_error_code(err)==GRIB_SUCCESS) { + } + else if (i >= slong && check_error_code(err) == GRIB_SUCCESS) { /* do nothing */ - } else { - sprintf(error_msg,"Error decoding when bpv=%d. Error message:%s",i,grib_get_error_message(err)); + } + else { + sprintf(error_msg, "Error decoding when bpv=%d. Error message:%s", i, grib_get_error_message(err)); perror(error_msg); exit(1); } - values = (double*)malloc(values_len*sizeof(double)); - err = grib_get_double_array(h,"values",values,&values_len); + values = (double*)malloc(values_len * sizeof(double)); + err = grib_get_double_array(h, "values", values, &values_len); /* * check if decoding of the data fails when the number of bpv @@ -98,16 +104,20 @@ int main(int argc, char** argv) { if (i < slong && err == 0) { /* do nothing */ - } else if (i >= slong && check_error_code(err)==GRIB_SUCCESS) { + } + else if (i >= slong && check_error_code(err) == GRIB_SUCCESS) { /* do nothing */ - } else { - sprintf(error_msg,"Error decoding when bpv=%d. Error message:%s",i,grib_get_error_message(err)); + } + else { + sprintf(error_msg, "Error decoding when bpv=%d. Error message:%s", i, grib_get_error_message(err)); perror(error_msg); exit(1); } - free(values); values = 0; - grib_handle_delete(h); h = 0; + free(values); + values = 0; + grib_handle_delete(h); + h = 0; fclose(in); } diff --git a/tests/bufr_ecc-517.c b/tests/bufr_ecc-517.c index 64bbc6a46..d71c33350 100644 --- a/tests/bufr_ecc-517.c +++ b/tests/bufr_ecc-517.c @@ -10,114 +10,114 @@ #include "eccodes.h" #include -int main (int argc, char **argv) +int main(int argc, char** argv) { - size_t size = 0; - const void *buffer = NULL; - FILE *fout = NULL; - codes_handle *h = NULL; - long *ivalues = NULL; - char **svalues = NULL; - double *rvalues = NULL; - const char *sampleName = "BUFR3_local"; - char *outfilename = NULL; + size_t size = 0; + const void* buffer = NULL; + FILE* fout = NULL; + codes_handle* h = NULL; + long* ivalues = NULL; + char** svalues = NULL; + double* rvalues = NULL; + const char* sampleName = "BUFR3_local"; + char* outfilename = NULL; - assert (argc == 2); + assert(argc == 2); outfilename = argv[1]; - h = codes_bufr_handle_new_from_samples (NULL, sampleName); - assert (h); + h = codes_bufr_handle_new_from_samples(NULL, sampleName); + assert(h); - ivalues = (long *) malloc (1 * sizeof (long)); + ivalues = (long*)malloc(1 * sizeof(long)); if (!ivalues) { - fprintf (stderr, "Failed to allocate memory (ivalues).\n"); + fprintf(stderr, "Failed to allocate memory (ivalues).\n"); return 1; } - size = 1; + size = 1; ivalues[0] = 1; - CODES_CHECK (codes_set_long_array (h, "inputDelayedDescriptorReplicationFactor", ivalues, size), 0); + CODES_CHECK(codes_set_long_array(h, "inputDelayedDescriptorReplicationFactor", ivalues, size), 0); - ivalues = (long *) malloc (1 * sizeof (long)); - size = 1; + ivalues = (long*)malloc(1 * sizeof(long)); + size = 1; ivalues[0] = 486; - CODES_CHECK (codes_set_long_array (h, "inputExtendedDelayedDescriptorReplicationFactor", ivalues, size), 0); + CODES_CHECK(codes_set_long_array(h, "inputExtendedDelayedDescriptorReplicationFactor", ivalues, size), 0); - CODES_CHECK (codes_set_long (h, "edition", 3), 0); - CODES_CHECK (codes_set_long (h, "masterTableNumber", 0), 0); - CODES_CHECK (codes_set_long (h, "bufrHeaderSubCentre", 0), 0); - CODES_CHECK (codes_set_long (h, "bufrHeaderCentre", 98), 0); - CODES_CHECK (codes_set_long (h, "updateSequenceNumber", 0), 0); - CODES_CHECK (codes_set_long (h, "dataCategory", 2), 0); - CODES_CHECK (codes_set_long (h, "dataSubCategory", 109), 0); - CODES_CHECK (codes_set_long (h, "masterTablesVersionNumber", 13), 0); - CODES_CHECK (codes_set_long (h, "localTablesVersionNumber", 1), 0); - CODES_CHECK (codes_set_long (h, "typicalYearOfCentury", 17), 0); - CODES_CHECK (codes_set_long (h, "typicalMonth", 8), 0); - CODES_CHECK (codes_set_long (h, "typicalDay", 6), 0); - CODES_CHECK (codes_set_long (h, "typicalHour", 11), 0); - CODES_CHECK (codes_set_long (h, "typicalMinute", 15), 0); - CODES_CHECK (codes_set_long (h, "rdbType", 5), 0); - CODES_CHECK (codes_set_long (h, "oldSubtype", 109), 0); - CODES_CHECK (codes_set_long (h, "rdbtimeDay", 7), 0); - CODES_CHECK (codes_set_long (h, "rdbtimeHour", 11), 0); - CODES_CHECK (codes_set_long (h, "rdbtimeMinute", 13), 0); - CODES_CHECK (codes_set_long (h, "rdbtimeSecond", 46), 0); - CODES_CHECK (codes_set_long (h, "rectimeDay", 7), 0); - CODES_CHECK (codes_set_long (h, "rectimeHour", 11), 0); - CODES_CHECK (codes_set_long (h, "rectimeMinute", 13), 0); - CODES_CHECK (codes_set_long (h, "rectimeSecond", 46), 0); - CODES_CHECK (codes_set_long (h, "correction1", 0), 0); - CODES_CHECK (codes_set_long (h, "correction1Part", 0), 0); - CODES_CHECK (codes_set_long (h, "correction2", 0), 0); - CODES_CHECK (codes_set_long (h, "correction2Part", 0), 0); - CODES_CHECK (codes_set_long (h, "correction3", 0), 0); - CODES_CHECK (codes_set_long (h, "correction3Part", 0), 0); - CODES_CHECK (codes_set_long (h, "correction4", 0), 0); - CODES_CHECK (codes_set_long (h, "correction4Part", 0), 0); - CODES_CHECK (codes_set_long (h, "qualityControl", 70), 0); - CODES_CHECK (codes_set_long (h, "newSubtype", 0), 0); - CODES_CHECK (codes_set_long (h, "numberOfSubsets", 1), 0); - CODES_CHECK (codes_set_double (h, "localLatitude", 5.450296999999999770e+01), 0); - CODES_CHECK (codes_set_double (h, "localLongitude", -6.343119999999999870e+00), 0); - CODES_CHECK (codes_set_long (h, "observedData", 1), 0); - CODES_CHECK (codes_set_long (h, "compressedData", 0), 0); - free (ivalues); + CODES_CHECK(codes_set_long(h, "edition", 3), 0); + CODES_CHECK(codes_set_long(h, "masterTableNumber", 0), 0); + CODES_CHECK(codes_set_long(h, "bufrHeaderSubCentre", 0), 0); + CODES_CHECK(codes_set_long(h, "bufrHeaderCentre", 98), 0); + CODES_CHECK(codes_set_long(h, "updateSequenceNumber", 0), 0); + CODES_CHECK(codes_set_long(h, "dataCategory", 2), 0); + CODES_CHECK(codes_set_long(h, "dataSubCategory", 109), 0); + CODES_CHECK(codes_set_long(h, "masterTablesVersionNumber", 13), 0); + CODES_CHECK(codes_set_long(h, "localTablesVersionNumber", 1), 0); + CODES_CHECK(codes_set_long(h, "typicalYearOfCentury", 17), 0); + CODES_CHECK(codes_set_long(h, "typicalMonth", 8), 0); + CODES_CHECK(codes_set_long(h, "typicalDay", 6), 0); + CODES_CHECK(codes_set_long(h, "typicalHour", 11), 0); + CODES_CHECK(codes_set_long(h, "typicalMinute", 15), 0); + CODES_CHECK(codes_set_long(h, "rdbType", 5), 0); + CODES_CHECK(codes_set_long(h, "oldSubtype", 109), 0); + CODES_CHECK(codes_set_long(h, "rdbtimeDay", 7), 0); + CODES_CHECK(codes_set_long(h, "rdbtimeHour", 11), 0); + CODES_CHECK(codes_set_long(h, "rdbtimeMinute", 13), 0); + CODES_CHECK(codes_set_long(h, "rdbtimeSecond", 46), 0); + CODES_CHECK(codes_set_long(h, "rectimeDay", 7), 0); + CODES_CHECK(codes_set_long(h, "rectimeHour", 11), 0); + CODES_CHECK(codes_set_long(h, "rectimeMinute", 13), 0); + CODES_CHECK(codes_set_long(h, "rectimeSecond", 46), 0); + CODES_CHECK(codes_set_long(h, "correction1", 0), 0); + CODES_CHECK(codes_set_long(h, "correction1Part", 0), 0); + CODES_CHECK(codes_set_long(h, "correction2", 0), 0); + CODES_CHECK(codes_set_long(h, "correction2Part", 0), 0); + CODES_CHECK(codes_set_long(h, "correction3", 0), 0); + CODES_CHECK(codes_set_long(h, "correction3Part", 0), 0); + CODES_CHECK(codes_set_long(h, "correction4", 0), 0); + CODES_CHECK(codes_set_long(h, "correction4Part", 0), 0); + CODES_CHECK(codes_set_long(h, "qualityControl", 70), 0); + CODES_CHECK(codes_set_long(h, "newSubtype", 0), 0); + CODES_CHECK(codes_set_long(h, "numberOfSubsets", 1), 0); + CODES_CHECK(codes_set_double(h, "localLatitude", 5.450296999999999770e+01), 0); + CODES_CHECK(codes_set_double(h, "localLongitude", -6.343119999999999870e+00), 0); + CODES_CHECK(codes_set_long(h, "observedData", 1), 0); + CODES_CHECK(codes_set_long(h, "compressedData", 0), 0); + free(ivalues); ivalues = NULL; - ivalues = (long *) malloc (9 * sizeof (long)); + ivalues = (long*)malloc(9 * sizeof(long)); if (!ivalues) { - fprintf (stderr, "Failed to allocate memory (ivalues).\n"); + fprintf(stderr, "Failed to allocate memory (ivalues).\n"); return 1; } - size = 4; + size = 4; ivalues[0] = 309052; ivalues[1] = 5001; ivalues[2] = 6001; ivalues[3] = 7001; - CODES_CHECK (codes_set_long_array (h, "unexpandedDescriptors", ivalues, size), 0); + CODES_CHECK(codes_set_long_array(h, "unexpandedDescriptors", ivalues, size), 0); /* Encode the keys back in the data section */ - CODES_CHECK (codes_set_long (h, "pack", 1), 0); + CODES_CHECK(codes_set_long(h, "pack", 1), 0); - fout = fopen (outfilename, "wb"); + fout = fopen(outfilename, "wb"); if (!fout) { - fprintf (stderr, "Failed to open (create) output file.\n"); + fprintf(stderr, "Failed to open (create) output file.\n"); return 1; } - CODES_CHECK (codes_get_message (h, &buffer, &size), 0); - CODES_CHECK (codes_check_message_header(buffer, size, PRODUCT_BUFR), 0); - CODES_CHECK (codes_check_message_footer(buffer, size, PRODUCT_BUFR), 0); - if (fwrite (buffer, 1, size, fout) != size) { - fclose (fout); - fprintf (stderr, "Failed to write data.\n"); + CODES_CHECK(codes_get_message(h, &buffer, &size), 0); + CODES_CHECK(codes_check_message_header(buffer, size, PRODUCT_BUFR), 0); + CODES_CHECK(codes_check_message_footer(buffer, size, PRODUCT_BUFR), 0); + if (fwrite(buffer, 1, size, fout) != size) { + fclose(fout); + fprintf(stderr, "Failed to write data.\n"); return 1; } - fclose (fout); - codes_handle_delete (h); - free (ivalues); - free (rvalues); - free (svalues); + fclose(fout); + codes_handle_delete(h); + free(ivalues); + free(rvalues); + free(svalues); return 0; } diff --git a/tests/bufr_ecc-604.c b/tests/bufr_ecc-604.c index f280595be..39cc40ddc 100644 --- a/tests/bufr_ecc-604.c +++ b/tests/bufr_ecc-604.c @@ -12,58 +12,61 @@ /* These are passed in via argv */ static size_t NUM_THREADS = 0; static size_t FILES_PER_ITERATION = 0; -static char* INPUT_FILE = NULL; -int opt_dump = 0; /* If 1 then dump handle to /dev/null */ -int opt_clone = 0; /* If 1 then clone source handle */ -int opt_write = 0; /* If 1 write handle to file */ +static char* INPUT_FILE = NULL; +int opt_dump = 0; /* If 1 then dump handle to /dev/null */ +int opt_clone = 0; /* If 1 then clone source handle */ +int opt_write = 0; /* If 1 write handle to file */ -static int encode_file(char *template_file, char *output_file) +static int encode_file(char* template_file, char* output_file) { - FILE *in, *out=NULL; - codes_handle *source_handle = NULL; - const void *buffer = NULL; - size_t size = 0; - int err = 0; - long numSubsets = 0; + FILE *in, *out = NULL; + codes_handle* source_handle = NULL; + const void* buffer = NULL; + size_t size = 0; + int err = 0; + long numSubsets = 0; assert(template_file); - in = fopen(template_file,"rb"); assert(in); + in = fopen(template_file, "rb"); + assert(in); if (opt_write) { assert(output_file); - out = fopen(output_file,"wb"); assert(out); + out = fopen(output_file, "wb"); + assert(out); } /* loop over the messages in the source BUFR and clone them */ while ((source_handle = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) { - codes_handle *h = source_handle; - + codes_handle* h = source_handle; + if (opt_clone) { - h = codes_handle_clone(source_handle); assert(h); + h = codes_handle_clone(source_handle); + assert(h); } - CODES_CHECK(codes_get_long(h,"numberOfSubsets", &numSubsets),0); - CODES_CHECK(codes_set_long(h, "unpack", 1),0); + CODES_CHECK(codes_get_long(h, "numberOfSubsets", &numSubsets), 0); + CODES_CHECK(codes_set_long(h, "unpack", 1), 0); - CODES_CHECK(codes_get_message(h,&buffer,&size),0); + CODES_CHECK(codes_get_message(h, &buffer, &size), 0); if (opt_write) { - if(fwrite(buffer,1,size,out) != size) { + if (fwrite(buffer, 1, size, out) != size) { perror(output_file); return 1; } } if (opt_dump) { - FILE *devnull = fopen("/dev/null", "w"); - grib_dumper* dumper = NULL; - const char* dumper_name = "bufr_simple"; + FILE* devnull = fopen("/dev/null", "w"); + grib_dumper* dumper = NULL; + const char* dumper_name = "bufr_simple"; unsigned long dump_flags = CODES_DUMP_FLAG_ALL_DATA; /* codes_dump_content(source_handle,devnull, "json", 1024, NULL); */ /* JSON dump with all attributes */ - dumper=grib_dump_content_with_dumper(source_handle, dumper, devnull, dumper_name, dump_flags, NULL); + dumper = grib_dump_content_with_dumper(source_handle, dumper, devnull, dumper_name, dump_flags, NULL); assert(dumper); fclose(devnull); } codes_handle_delete(source_handle); - if(opt_clone) codes_handle_delete(h); + if (opt_clone) codes_handle_delete(h); } if (opt_write) fclose(out); @@ -72,101 +75,111 @@ static int encode_file(char *template_file, char *output_file) return 0; } -void do_stuff(void *data); +void do_stuff(void* data); /* Structure for passing data to threads */ -struct v { +struct v +{ size_t number; - char *data; + char* data; }; -void *runner(void *ptr); /* the thread */ +void* runner(void* ptr); /* the thread */ -int main(int argc, char **argv) +int main(int argc, char** argv) { size_t i; int thread_counter = 0; - int parallel=1, index=0, c=0; + int parallel = 1, index = 0, c = 0; const char* prog = argv[0]; char* mode; - if (argc<5 || argc>7) { + if (argc < 5 || argc > 7) { fprintf(stderr, "Usage:\n\t%s [options] seq file numRuns numIter\nOr\n\t%s [options] par file numThreads numIter\n", prog, prog); return 1; } - - while ((c = getopt (argc, argv, "dcw")) != -1) { + + while ((c = getopt(argc, argv, "dcw")) != -1) { switch (c) { - case 'd': opt_dump=1; break; - case 'c': opt_clone=1; break; - case 'w': opt_write=1; break; + case 'd': + opt_dump = 1; + break; + case 'c': + opt_clone = 1; + break; + case 'w': + opt_write = 1; + break; } } - index = optind; - mode = argv[index]; - INPUT_FILE = argv[index+1]; - NUM_THREADS = atol(argv[index+2]); - FILES_PER_ITERATION = atol(argv[index+3]); + index = optind; + mode = argv[index]; + INPUT_FILE = argv[index + 1]; + NUM_THREADS = atol(argv[index + 2]); + FILES_PER_ITERATION = atol(argv[index + 3]); - if (strcmp(mode,"seq")==0) { + if (strcmp(mode, "seq") == 0) { parallel = 0; } if (parallel) { printf("Running parallel in %ld threads. %ld iterations\n", NUM_THREADS, FILES_PER_ITERATION); printf("Options: dump=%d, clone=%d, write=%d\n", opt_dump, opt_clone, opt_write); - } else { + } + else { printf("Running sequentially in %ld runs. %ld iterations\n", NUM_THREADS, FILES_PER_ITERATION); } { pthread_t* workers = malloc(NUM_THREADS * sizeof(pthread_t)); for (i = 0; i < NUM_THREADS; i++) { - struct v *data = (struct v *) malloc(sizeof(struct v)); - data->number = i; - data->data = NULL; + struct v* data = (struct v*)malloc(sizeof(struct v)); + data->number = i; + data->data = NULL; if (parallel) { /* Now we will create the thread passing it data as an argument */ pthread_create(&workers[thread_counter], NULL, runner, data); /*pthread_join(workers[thread_counter], NULL);*/ thread_counter++; - } else { + } + else { do_stuff(data); } } if (parallel) { - for (i = 0; i < NUM_THREADS; i++) { + for (i = 0; i < NUM_THREADS; i++) { pthread_join(workers[i], NULL); } } - free (workers); + free(workers); } return 0; } -void *runner(void *ptr) +void* runner(void* ptr) { do_stuff(ptr); pthread_exit(0); } -void do_stuff(void *ptr) +void do_stuff(void* ptr) { /* Cast argument to struct v pointer */ - struct v *data = ptr; + struct v* data = ptr; size_t i; char output_file[50]; time_t ltime; struct tm result; char stime[32]; - for (i=0; inumber, i); - encode_file(INPUT_FILE,output_file); - } else { - encode_file(INPUT_FILE,NULL); + sprintf(output_file, "output/output_file_%ld-%ld.bufr", data->number, i); + encode_file(INPUT_FILE, output_file); + } + else { + encode_file(INPUT_FILE, NULL); } } diff --git a/tests/bufr_ecc-604.sh b/tests/bufr_ecc-604.sh index 3d0772dd3..0be4ddfe7 100755 --- a/tests/bufr_ecc-604.sh +++ b/tests/bufr_ecc-604.sh @@ -1,5 +1,5 @@ #!/bin/sh -# (C) Copyright 2005-2018 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/bufr_extract_headers.c b/tests/bufr_extract_headers.c index 84a6ac913..dbc0d2a4a 100644 --- a/tests/bufr_extract_headers.c +++ b/tests/bufr_extract_headers.c @@ -17,22 +17,22 @@ int main(int argc, char* argv[]) { char *filename, *keys; int i, err = 0; - int num_messages = 0; + int num_messages = 0; codes_bufr_header* header_array = NULL; - codes_context* c = codes_context_get_default(); - const int strict_mode = 1; - int requested_print_keys_count = MAX_KEYS; + codes_context* c = codes_context_get_default(); + const int strict_mode = 1; + int requested_print_keys_count = MAX_KEYS; codes_values requested_print_keys[MAX_KEYS]; /* Usage: prog keys file */ - assert (argc == 3); + assert(argc == 3); - keys = argv[1]; /* comma-separated like bufr_ls/bufr_get */ + keys = argv[1]; /* comma-separated like bufr_ls/bufr_get */ filename = argv[2]; err = codes_bufr_extract_headers_malloc(c, filename, &header_array, &num_messages, strict_mode); if (err) { - printf("ERROR: %s\n",grib_get_error_message(err)); + printf("ERROR: %s\n", grib_get_error_message(err)); return 1; } @@ -40,12 +40,12 @@ int main(int argc, char* argv[]) err = parse_keyval_string(NULL, keys, 0, GRIB_TYPE_UNDEFINED, requested_print_keys, &requested_print_keys_count); assert(!err); assert(requested_print_keys_count > 0); - for (i=0; i < num_messages; ++i) { + for (i = 0; i < num_messages; ++i) { int j; - for (j=0; j 0); if (j > 0) printf(" "); printf("%s", value); @@ -54,7 +54,7 @@ int main(int argc, char* argv[]) } free(header_array); - for (i=0; i 3) usage(prog); for (i = 1; i < argc; i++) { - if (strcmp(argv[i],"-a")==0) { + if (strcmp(argv[i], "-a") == 0) { iterator_mode = ITER_ALL_KEYS; - } else if (strcmp(argv[i],"-d")==0) { + } + else if (strcmp(argv[i], "-d") == 0) { iterator_mode = ITER_DATA_KEYS; - } else { + } + else { input_filename = argv[i]; - break;/* Only 1 file allowed */ + break; /* Only 1 file allowed */ } } @@ -51,19 +53,19 @@ int main(int argc,char* argv[]) h = codes_handle_new_from_file(NULL, f, PRODUCT_BUFR, &err); assert(h); - CODES_CHECK(codes_set_long(h,"unpack",1), 0); + CODES_CHECK(codes_set_long(h, "unpack", 1), 0); if (iterator_mode == ITER_ALL_KEYS) { /*printf("Dumping ALL keys\n");*/ kiter = codes_bufr_keys_iterator_new(h, 0); - } else { + } + else { /*printf("Dumping only DATA SECTION keys\n");*/ assert(iterator_mode == ITER_DATA_KEYS); - kiter=codes_bufr_data_section_keys_iterator_new(h); + kiter = codes_bufr_data_section_keys_iterator_new(h); } - while(codes_bufr_keys_iterator_next(kiter)) - { + while (codes_bufr_keys_iterator_next(kiter)) { char* kname = codes_bufr_keys_iterator_get_name(kiter); printf("%s\n", kname); } diff --git a/tests/decode.c b/tests/decode.c old mode 100755 new mode 100644 index 79d41a0c3..adbea9ba8 --- a/tests/decode.c +++ b/tests/decode.c @@ -7,4 +7,3 @@ * 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. */ - diff --git a/tests/gauss_sub.c b/tests/gauss_sub.c index adb870cb2..b1114e964 100644 --- a/tests/gauss_sub.c +++ b/tests/gauss_sub.c @@ -10,128 +10,168 @@ #include "grib_api.h" -static void usage(char* prog) { - printf("usage: %s file1.grib file2.grib\n",prog); - exit(1); +static void usage(char* prog) +{ + printf("usage: %s file1.grib file2.grib\n", prog); + exit(1); } -int main(int argc, char* argv[]) { - grib_handle *h1,*h2; - int ret=0; - FILE *f1,*f2; - char* infile1; - char* infile2; - double *v1,*v2,*v,*gv; - double *lon1,*lon2,*lon,*glon; - double *lat1,*lat2,*lat,*glat; - size_t size1,size2,size,gsize; - double err1,err2,err; - int i,j; - grib_context* c; - grib_iterator *iter1,*iter2; - - c=grib_context_get_default(); - - if (argc < 3) usage(argv[0]); - - infile1=argv[1]; - infile2=argv[2]; - - f1=fopen(infile1,"rb"); - if (!f1) { - perror(infile1); - exit(1); - } - - f2=fopen(infile2,"rb"); - if (!f2) { - perror(infile2); - exit(1); - } - - while ((h1=grib_handle_new_from_file(0,f1,&ret))!=NULL) { - if ((h2=grib_handle_new_from_file(c,f2,&ret))==NULL) { - printf("unable to create handle from file %s\n",infile2); - GRIB_CHECK(ret,0); - exit(1); - } - GRIB_CHECK(grib_get_size(h1,"values",&size1),0); - v1=(double*)malloc(size1*sizeof(double)); - if (!v1) {printf("unable to allocate v1\n");exit(1);} - lat1=(double*)malloc(size1*sizeof(double)); - if (!lat1) {printf("unable to allocate lat1\n");exit(1);} - lon1=(double*)malloc(size1*sizeof(double)); - if (!lon1) {printf("unable to allocate lon1\n");exit(1);} - GRIB_CHECK(grib_get_double(h1,"packingError",&err1),0); - - iter1=grib_iterator_new(h1,0,&ret); - GRIB_CHECK(ret,0); - - GRIB_CHECK(grib_get_size(h2,"values",&size2),0); - v2=(double*)malloc(size2*sizeof(double)); - if (!v2) {printf("unable to allocate v2\n");exit(1);} - lat2=(double*)malloc(size2*sizeof(double)); - if (!lat2) {printf("unable to allocate lat2\n");exit(1);} - lon2=(double*)malloc(size2*sizeof(double)); - if (!lon2) {printf("unable to allocate lon2\n");exit(1);} - GRIB_CHECK(grib_get_double(h2,"packingError",&err2),0); - - iter2=grib_iterator_new(h2,0,&ret); - GRIB_CHECK(ret,0); - - lat=lat1; lon=lon1; v=v1; - while(grib_iterator_next(iter1,lat,lon,v)) { - lat++; - if (*lon < 0 ) *lon+=360; - lon++; - v++; - } - lat=lat2; lon=lon2; v=v2; - while(grib_iterator_next(iter2,lat,lon,v)) { - lat++; - if (*lon < 0 ) *lon+=360; - lon++; - v++; - } - - if (size1 > size2) { - lat=lat2;lon=lon2;v=v2; - size=size2; - glat=lat1;glon=lon1;gv=v1; - gsize=size1; - } else { - lat=lat1;lon=lon1;v=v1; - size=size1; - glat=lat2;glon=lon2;gv=v2; - gsize=size2; - } - if (err1>err2) err=err1; - else err=err2; - - j=0; - for (i=0;ierr) { - ret=1; - printf("lat=%g lon=%g sub area value=%g global value=%g\n", - lat[i],lon[i],v[i],gv[j]); - } - - } - free(v);free(gv);free(lat);free(glat);free(lon);free(glon); - - } - - fclose(f1); - fclose(f2); - - return ret; +int main(int argc, char* argv[]) +{ + grib_handle *h1, *h2; + int ret = 0; + FILE *f1, *f2; + char* infile1; + char* infile2; + double *v1, *v2, *v, *gv; + double *lon1, *lon2, *lon, *glon; + double *lat1, *lat2, *lat, *glat; + size_t size1, size2, size, gsize; + double err1, err2, err; + int i, j; + grib_context* c; + grib_iterator *iter1, *iter2; + + c = grib_context_get_default(); + + if (argc < 3) usage(argv[0]); + + infile1 = argv[1]; + infile2 = argv[2]; + + f1 = fopen(infile1, "rb"); + if (!f1) { + perror(infile1); + exit(1); + } + + f2 = fopen(infile2, "rb"); + if (!f2) { + perror(infile2); + exit(1); + } + + while ((h1 = grib_handle_new_from_file(0, f1, &ret)) != NULL) { + if ((h2 = grib_handle_new_from_file(c, f2, &ret)) == NULL) { + printf("unable to create handle from file %s\n", infile2); + GRIB_CHECK(ret, 0); + exit(1); + } + GRIB_CHECK(grib_get_size(h1, "values", &size1), 0); + v1 = (double*)malloc(size1 * sizeof(double)); + if (!v1) { + printf("unable to allocate v1\n"); + exit(1); + } + lat1 = (double*)malloc(size1 * sizeof(double)); + if (!lat1) { + printf("unable to allocate lat1\n"); + exit(1); + } + lon1 = (double*)malloc(size1 * sizeof(double)); + if (!lon1) { + printf("unable to allocate lon1\n"); + exit(1); + } + GRIB_CHECK(grib_get_double(h1, "packingError", &err1), 0); + + iter1 = grib_iterator_new(h1, 0, &ret); + GRIB_CHECK(ret, 0); + + GRIB_CHECK(grib_get_size(h2, "values", &size2), 0); + v2 = (double*)malloc(size2 * sizeof(double)); + if (!v2) { + printf("unable to allocate v2\n"); + exit(1); + } + lat2 = (double*)malloc(size2 * sizeof(double)); + if (!lat2) { + printf("unable to allocate lat2\n"); + exit(1); + } + lon2 = (double*)malloc(size2 * sizeof(double)); + if (!lon2) { + printf("unable to allocate lon2\n"); + exit(1); + } + GRIB_CHECK(grib_get_double(h2, "packingError", &err2), 0); + + iter2 = grib_iterator_new(h2, 0, &ret); + GRIB_CHECK(ret, 0); + + lat = lat1; + lon = lon1; + v = v1; + while (grib_iterator_next(iter1, lat, lon, v)) { + lat++; + if (*lon < 0) *lon += 360; + lon++; + v++; + } + lat = lat2; + lon = lon2; + v = v2; + while (grib_iterator_next(iter2, lat, lon, v)) { + lat++; + if (*lon < 0) *lon += 360; + lon++; + v++; + } + + if (size1 > size2) { + lat = lat2; + lon = lon2; + v = v2; + size = size2; + glat = lat1; + glon = lon1; + gv = v1; + gsize = size1; + } + else { + lat = lat1; + lon = lon1; + v = v1; + size = size1; + glat = lat2; + glon = lon2; + gv = v2; + gsize = size2; + } + if (err1 > err2) + err = err1; + else + err = err2; + + j = 0; + for (i = 0; i < size; i++) { + while (j < gsize && (lat[i] != glat[j] || lon[i] != glon[j])) + j++; + if (j == gsize) { + j = 0; + while (j < gsize && (lat[i] != glat[j] || lon[i] != glon[j])) + j++; + } + if (j == gsize) { + printf("lat=%g lon=%g not found in global\n", lat[i], lon[i]); + exit(1); + } + if (fabs(v[i] - gv[j]) > err) { + ret = 1; + printf("lat=%g lon=%g sub area value=%g global value=%g\n", + lat[i], lon[i], v[i], gv[j]); + } + } + free(v); + free(gv); + free(lat); + free(glat); + free(lon); + free(glon); + } + + fclose(f1); + fclose(f2); + + return ret; } diff --git a/tests/grib_2nd_order_numValues.c b/tests/grib_2nd_order_numValues.c index b35e1a5a5..e129703ee 100644 --- a/tests/grib_2nd_order_numValues.c +++ b/tests/grib_2nd_order_numValues.c @@ -16,2749 +16,2749 @@ */ static double values[] = { - 0.101300032966540894E+06, 0.101300537463512766E+06, 0.101300575340236785E+06, 0.101300006392703450E+06, 0.101298681683129777E+06, - 0.101296357626198034E+06, 0.101291429037962458E+06, 0.101285211396584113E+06, 0.101277811769244916E+06, 0.101269604202318660E+06, - 0.101261086325391967E+06, 0.101252536774223816E+06, 0.101244258202072262E+06, 0.101236292863086681E+06, 0.101228818038673067E+06, - 0.101222576320632390E+06, 0.101217951101617422E+06, 0.101215281498123208E+06, 0.101214831830208335E+06, 0.101216756641191008E+06, - 0.101220329473252321E+06, 0.101229814720005656E+06, 0.101242852565120862E+06, 0.101257243179816374E+06, 0.101272242223526715E+06, - 0.101287023899284890E+06, 0.101300727324330161E+06, 0.101312508880994021E+06, 0.101321304787958841E+06, 0.101323045492054458E+06, - 0.101323689235454440E+06, 0.101322654817980932E+06, 0.101318546143449697E+06, 0.101311446435368038E+06, 0.101301582670344171E+06, - 0.101289313645048256E+06, 0.101272976739770951E+06, 0.101254670123119533E+06, 0.101236204711241953E+06, 0.101218525147353255E+06, - 0.101203644914472199E+06, 0.101191859002529978E+06, 0.101183427645969176E+06, 0.101178788732659857E+06, 0.101176248776911350E+06, - 0.101174781987763519E+06, 0.101173755414963452E+06, 0.101172549028196707E+06, 0.101170596810517556E+06, 0.101164899003713479E+06, - 0.101158419589045283E+06, 0.101152491572940358E+06, 0.101147843517789603E+06, 0.101145017464391334E+06, 0.101144350744426047E+06, - 0.101145965622140546E+06, 0.101150160852645960E+06, 0.101156489280060341E+06, 0.101164999288937499E+06, 0.101174680757722846E+06, - 0.101184614700939375E+06, 0.101194476866903220E+06, 0.101203847071805940E+06, 0.101212793693367261E+06, 0.101221210811864396E+06, - 0.101228967667653473E+06, 0.101235941297612240E+06, 0.101241825830798407E+06, 0.101246384813952725E+06, 0.101250233289149895E+06, - 0.101253625288606709E+06, 0.101256829767974210E+06, 0.101260135466684485E+06, 0.101263922730170481E+06, 0.101268258457290780E+06, - 0.101273173871677092E+06, 0.101278603318462468E+06, 0.101284438572224244E+06, 0.101291451901038017E+06, 0.101298825789695678E+06, - 0.101305583597361008E+06, 0.101311198590170257E+06, 0.101313106869633571E+06, 0.101311964918650119E+06, 0.101309609217350633E+06, - 0.101306588009722152E+06, 0.101303789827421686E+06, 0.101303204229508177E+06, 0.101302539808644782E+06, 0.101301748136565366E+06, - 0.101300889588588965E+06, 0.101301524026314495E+06, 0.101302253276609670E+06, 0.101302463210049027E+06, 0.101302292202795681E+06, - 0.101298302559037387E+06, 0.101291449427361382E+06, 0.101283550209983820E+06, 0.101275343284659903E+06, 0.101268451030137920E+06, - 0.101263440167506284E+06, 0.101259681043976845E+06, 0.101257275584439689E+06, 0.101255817294926324E+06, 0.101255329151085723E+06, - 0.101256832423130865E+06, 0.101260699063277454E+06, 0.101270225601657599E+06, 0.101287312191364559E+06, 0.101303455630186116E+06, - 0.101316029699689170E+06, 0.101320758891846766E+06, 0.101311100182774215E+06, 0.101294901290088586E+06, 0.101273081896347416E+06, - 0.101246397937256072E+06, 0.101214175532589943E+06, 0.101180475299171711E+06, 0.101147446887522659E+06, 0.101117364487217361E+06, - 0.101093085915674965E+06, 0.101075700452174933E+06, 0.101066299886712630E+06, 0.101066158368806296E+06, 0.101078251612071312E+06, - 0.101107333429588485E+06, 0.101145577197960345E+06, 0.101190184433163799E+06, 0.101238249723994639E+06, 0.101280682092796589E+06, - 0.101316576899162261E+06, 0.101349617253023622E+06, 0.101379226791601075E+06, 0.101404833281466810E+06, 0.101426608723689307E+06, - 0.101443265324151027E+06, 0.101453984963411596E+06, 0.101458728599400347E+06, 0.101457810163301183E+06, 0.101452773264225369E+06, - 0.101443352159658025E+06, 0.101428700824100233E+06, 0.101409534671443689E+06, 0.101387066094169772E+06, 0.101362901532581192E+06, - 0.101342428907368536E+06, 0.101323657976273273E+06, 0.101307125752964450E+06, 0.101293183514770688E+06, 0.101280868902945120E+06, - 0.101268909632403243E+06, 0.101254864133468844E+06, 0.101241751785266810E+06, 0.101229873732095890E+06, 0.101219507414652238E+06, - 0.101210854622372586E+06, 0.101203998200015136E+06, 0.101202118817604176E+06, 0.101204115282818020E+06, 0.101207394659720041E+06, - 0.101211469101194845E+06, 0.101215801913933246E+06, 0.101219837912576768E+06, 0.101222821880958276E+06, 0.101223619521153145E+06, - 0.101223119359168049E+06, 0.101279933976388784E+06, 0.101280230886902951E+06, 0.101280173829517254E+06, 0.101279628905657766E+06, - 0.101278452724477320E+06, 0.101276500130166445E+06, 0.101273279706602567E+06, 0.101267225127293903E+06, 0.101259879400551043E+06, - 0.101251952874409501E+06, 0.101243674039727790E+06, 0.101235303075196876E+06, 0.101227122345847776E+06, 0.101219423613287974E+06, - 0.101212178882549546E+06, 0.101205696806113177E+06, 0.101200710454399567E+06, 0.101197550054666615E+06, 0.101196424920055710E+06, - 0.101196682426928426E+06, 0.101199196544638864E+06, 0.101204111882830854E+06, 0.101214864879095490E+06, 0.101228568680570461E+06, - 0.101243289081509487E+06, 0.101258220436669624E+06, 0.101272521063369320E+06, 0.101285366950491778E+06, 0.101296012419061328E+06, - 0.101305658540617282E+06, 0.101309682063797125E+06, 0.101310624244857565E+06, 0.101308433795484656E+06, 0.101303210985482059E+06, - 0.101295198335334237E+06, 0.101284767756201632E+06, 0.101272403737592205E+06, 0.101256113788140079E+06, 0.101238847669926457E+06, - 0.101222589159180454E+06, 0.101208629956686913E+06, 0.101197517909479167E+06, 0.101189497449897433E+06, 0.101184456694785782E+06, - 0.101181649500138068E+06, 0.101179750491125887E+06, 0.101178046404878522E+06, 0.101175885037415414E+06, 0.101168022154143066E+06, - 0.101159966065713801E+06, 0.101152331174549618E+06, 0.101145627588820978E+06, 0.101140536375719617E+06, 0.101137554875074289E+06, - 0.101136964384819003E+06, 0.101138821605761070E+06, 0.101143054186604160E+06, 0.101151654753774303E+06, 0.101161075130481171E+06, - 0.101170963288776737E+06, 0.101180942106852366E+06, 0.101190660642090996E+06, 0.101199851697929174E+06, 0.101208579711314771E+06, - 0.101216763897321827E+06, 0.101224252677880388E+06, 0.101230718188980885E+06, 0.101236243573164116E+06, 0.101240451206177866E+06, - 0.101243892699987075E+06, 0.101246988344102370E+06, 0.101250044906442185E+06, 0.101253348298035868E+06, 0.101257374370298217E+06, - 0.101262251561231329E+06, 0.101267895803787687E+06, 0.101275473367753089E+06, 0.101283709026768585E+06, 0.101292283625024313E+06, - 0.101300598737905675E+06, 0.101308093199018083E+06, 0.101314220495369867E+06, 0.101317565250665139E+06, 0.101316383038650820E+06, - 0.101313738332474823E+06, 0.101310203262582130E+06, 0.101306334680532935E+06, 0.101304140173899126E+06, 0.101302185066315011E+06, - 0.101301166929963205E+06, 0.101300627409982437E+06, 0.101301442301666364E+06, 0.101302674870566902E+06, 0.101303021785214194E+06, - 0.101301874610097177E+06, 0.101297234163742920E+06, 0.101289212662159043E+06, 0.101280201810217695E+06, 0.101271153345172788E+06, - 0.101264093160240271E+06, 0.101259964551924568E+06, 0.101257527008254954E+06, 0.101256779297676592E+06, 0.101257083402693010E+06, - 0.101258345876766994E+06, 0.101261741195912517E+06, 0.101267637196925745E+06, 0.101280255542587736E+06, 0.101300219472217796E+06, - 0.101318811431023903E+06, 0.101333064281329105E+06, 0.101337822826176372E+06, 0.101329633927901843E+06, 0.101313842956693508E+06, - 0.101291773913463257E+06, 0.101264248822328038E+06, 0.101231681402834831E+06, 0.101198711256044262E+06, 0.101165944729817566E+06, - 0.101135663129340406E+06, 0.101112149821393570E+06, 0.101094336258872077E+06, 0.101083754934829689E+06, 0.101081962838100400E+06, - 0.101094161177945804E+06, 0.101119463798994111E+06, 0.101153379508463855E+06, 0.101193466772876971E+06, 0.101236864297787688E+06, - 0.101271319749684611E+06, 0.101304810719710440E+06, 0.101336529049048593E+06, 0.101365547226062699E+06, 0.101391403447243065E+06, - 0.101414233987549960E+06, 0.101431699751902197E+06, 0.101443249701215464E+06, 0.101448694379159249E+06, 0.101448342945639379E+06, - 0.101444949497289897E+06, 0.101434983683722516E+06, 0.101420339588228075E+06, 0.101400782009497547E+06, 0.101377357223598548E+06, - 0.101353445824612878E+06, 0.101331105881366500E+06, 0.101310391048972291E+06, 0.101292023316921361E+06, 0.101276408630823629E+06, - 0.101263594338449708E+06, 0.101249134886344415E+06, 0.101234892154251414E+06, 0.101221982151018121E+06, 0.101210641209280395E+06, - 0.101201103409364907E+06, 0.101193542381486463E+06, 0.101189530184913005E+06, 0.101188943141927884E+06, 0.101190369535781749E+06, - 0.101194174658495293E+06, 0.101198877046582638E+06, 0.101203781726436631E+06, 0.101208345081553751E+06, 0.101210641923420510E+06, - 0.101211907924376195E+06, 0.101211894158448660E+06, 0.101261542396602526E+06, 0.101261524602459496E+06, 0.101261271962264684E+06, - 0.101260655467705859E+06, 0.101259535677996173E+06, 0.101257770460092695E+06, 0.101254858567248273E+06, 0.101250130827152869E+06, - 0.101243199529206220E+06, 0.101235660710148513E+06, 0.101227727082598372E+06, 0.101219642017676335E+06, 0.101211669747645647E+06, - 0.101204082204654842E+06, 0.101197142166519814E+06, 0.101190828836761386E+06, 0.101185622952613427E+06, 0.101182084994122983E+06, - 0.101179819644487143E+06, 0.101179386785722192E+06, 0.101181037231546885E+06, 0.101184921544816825E+06, 0.101191071708805684E+06, - 0.101202963344456002E+06, 0.101217214661309525E+06, 0.101232127096539611E+06, 0.101246868435665092E+06, 0.101260623299959872E+06, - 0.101275012912500446E+06, 0.101287927630361359E+06, 0.101297156607966986E+06, 0.101300022279744313E+06, 0.101299658882873831E+06, - 0.101296185125092088E+06, 0.101289860769760111E+06, 0.101281072853932870E+06, 0.101270317685887567E+06, 0.101257849866728764E+06, - 0.101241620969336713E+06, 0.101226620289076629E+06, 0.101213719159152053E+06, 0.101203448100139896E+06, 0.101196030165699893E+06, - 0.101191332050565718E+06, 0.101188825460235021E+06, 0.101186627930786824E+06, 0.101183177496864155E+06, 0.101175055095382006E+06, - 0.101166325451567565E+06, 0.101157506572639366E+06, 0.101149141784503256E+06, 0.101141882059824522E+06, 0.101136611424843984E+06, - 0.101133780517071078E+06, 0.101133612778250375E+06, 0.101137015702474586E+06, 0.101144048000326933E+06, 0.101152946100252506E+06, - 0.101162592544671337E+06, 0.101172594122147348E+06, 0.101182525914593833E+06, 0.101192006688188281E+06, 0.101200731545306888E+06, - 0.101208949653701755E+06, 0.101216776035106115E+06, 0.101223643986761963E+06, 0.101229495275078225E+06, 0.101234397106283810E+06, - 0.101238325186287970E+06, 0.101241245958931366E+06, 0.101243986310471693E+06, 0.101246885079730608E+06, 0.101250239965938381E+06, - 0.101254497783043873E+06, 0.101260948534770170E+06, 0.101268693386766550E+06, 0.101277410860750868E+06, 0.101286673004684562E+06, - 0.101296037156777587E+06, 0.101304973100759889E+06, 0.101312836471203336E+06, 0.101319077100166265E+06, 0.101323200714451756E+06, - 0.101322250124293394E+06, 0.101319426400325508E+06, 0.101315327879672026E+06, 0.101311379409400208E+06, 0.101308929715621984E+06, - 0.101307576201749136E+06, 0.101306752066909641E+06, 0.101306276681202202E+06, 0.101306450951061837E+06, 0.101306928825287003E+06, - 0.101306304370611891E+06, 0.101304071949983219E+06, 0.101298726444911401E+06, 0.101289556844688181E+06, 0.101279573549734007E+06, - 0.101269900918276995E+06, 0.101262737639210711E+06, 0.101259533404357528E+06, 0.101258456904325285E+06, 0.101259373853730853E+06, - 0.101261455254273096E+06, 0.101264486663057716E+06, 0.101269671494430630E+06, 0.101277337091813301E+06, 0.101292476984397377E+06, - 0.101314252890570002E+06, 0.101334243526143560E+06, 0.101349257112687643E+06, 0.101353348220742904E+06, 0.101345316081726181E+06, - 0.101329205683580891E+06, 0.101306196398575121E+06, 0.101276157501052992E+06, 0.101241050683782683E+06, 0.101205878990180805E+06, - 0.101173117425566874E+06, 0.101145231775263543E+06, 0.101124829234029152E+06, 0.101110142836540865E+06, 0.101099009983212847E+06, - 0.101095931793603289E+06, 0.101107937055714152E+06, 0.101129557639286853E+06, 0.101159016947845914E+06, 0.101194290171214365E+06, - 0.101229194191076458E+06, 0.101259884907642350E+06, 0.101290909335772027E+06, 0.101321534960278805E+06, 0.101350933609778935E+06, - 0.101378619763291339E+06, 0.101402515553940961E+06, 0.101421126437325220E+06, 0.101433759893184542E+06, 0.101440081432142906E+06, - 0.101442774222367792E+06, 0.101440175371796868E+06, 0.101430382938397539E+06, 0.101414195446914280E+06, 0.101393183882853962E+06, - 0.101368556280786899E+06, 0.101342857987377705E+06, 0.101318002031737051E+06, 0.101294900480304379E+06, 0.101274304523903862E+06, - 0.101256697091383176E+06, 0.101240541623616038E+06, 0.101225909818463362E+06, 0.101213299349493405E+06, 0.101200928172660904E+06, - 0.101190501742025459E+06, 0.101182213405811461E+06, 0.101176901403817319E+06, 0.101175245583661221E+06, 0.101175762446152599E+06, - 0.101178005333581008E+06, 0.101181392651505157E+06, 0.101186087494527630E+06, 0.101191405412103719E+06, 0.101195091837111089E+06, - 0.101197730891759726E+06, 0.101199364382066880E+06, 0.101199730209935369E+06, 0.101245004040932326E+06, 0.101244559135352756E+06, - 0.101244006361693333E+06, 0.101243220164091719E+06, 0.101242063426875131E+06, 0.101239785127296316E+06, 0.101236357261140554E+06, - 0.101232655165141550E+06, 0.101227802625625860E+06, 0.101220780822386791E+06, 0.101213322053334618E+06, 0.101205654745465290E+06, - 0.101198027406206093E+06, 0.101190695138277268E+06, 0.101183902374283105E+06, 0.101177861446733092E+06, 0.101172715839318174E+06, - 0.101168727915036332E+06, 0.101166083677619172E+06, 0.101165120300427254E+06, 0.101166097664782996E+06, 0.101169176642534818E+06, - 0.101174400762938254E+06, 0.101181681695578300E+06, 0.101194628149370954E+06, 0.101209354172510837E+06, 0.101224384543212596E+06, - 0.101241003377192639E+06, 0.101256971279536912E+06, 0.101271325762838256E+06, 0.101283302907598583E+06, 0.101290837888259193E+06, - 0.101292188600320253E+06, 0.101290316399723524E+06, 0.101285500501916889E+06, 0.101278145707370568E+06, 0.101268063741988299E+06, - 0.101255992666718317E+06, 0.101243630289196284E+06, 0.101230020660095543E+06, 0.101218300352418431E+06, 0.101208996070145775E+06, - 0.101202318103285957E+06, 0.101198115125068754E+06, 0.101195865072430563E+06, 0.101192485973754709E+06, 0.101184883550562605E+06, - 0.101176252043943983E+06, 0.101167064140836461E+06, 0.101157837055866650E+06, 0.101149111932572778E+06, 0.101141425669095363E+06, - 0.101136096494374695E+06, 0.101133772515929886E+06, 0.101136278536261714E+06, 0.101141790910123251E+06, 0.101149565058361550E+06, - 0.101159158826086161E+06, 0.101169280924233710E+06, 0.101179364339541717E+06, 0.101189214375348573E+06, 0.101198419330631325E+06, - 0.101206662421100802E+06, 0.101214110977152406E+06, 0.101221277683224456E+06, 0.101227361193735371E+06, 0.101232391962857888E+06, - 0.101236456240121115E+06, 0.101239696448804534E+06, 0.101242131415364871E+06, 0.101244485321801025E+06, 0.101247206329288369E+06, - 0.101250813340918423E+06, 0.101256254483921584E+06, 0.101263638654577793E+06, 0.101272420586206106E+06, 0.101282081390786785E+06, - 0.101292093147014763E+06, 0.101301886889219619E+06, 0.101311011635127215E+06, 0.101318745388787589E+06, 0.101324552511834278E+06, - 0.101327137099599713E+06, 0.101325798652594996E+06, 0.101322370281172494E+06, 0.101318873214067411E+06, 0.101316033453167009E+06, - 0.101314254241750285E+06, 0.101313290040590538E+06, 0.101312777489808956E+06, 0.101312426972162124E+06, 0.101312077043907979E+06, - 0.101311637613854371E+06, 0.101309930679532728E+06, 0.101306604219150962E+06, 0.101300708574919438E+06, 0.101290667766194849E+06, - 0.101280103453056901E+06, 0.101270238174615952E+06, 0.101263265305097812E+06, 0.101261210282368877E+06, 0.101261635280168994E+06, - 0.101264259503469541E+06, 0.101268188459234763E+06, 0.101273120782915241E+06, 0.101280081032422138E+06, 0.101289326234345950E+06, - 0.101306137507821695E+06, 0.101328331726916280E+06, 0.101348454606262691E+06, 0.101363243724620203E+06, 0.101365228148856142E+06, - 0.101355701191101674E+06, 0.101338137535693226E+06, 0.101313442343172661E+06, 0.101279893686959578E+06, 0.101241766771608411E+06, - 0.101204166019317592E+06, 0.101170013105795253E+06, 0.101142432350644231E+06, 0.101122231791865343E+06, 0.101108816561727523E+06, - 0.101102229721379510E+06, 0.101103813368451665E+06, 0.101116580337189007E+06, 0.101134920647456835E+06, 0.101160141230191730E+06, - 0.101190695983823272E+06, 0.101217581338673946E+06, 0.101244990949544663E+06, 0.101273917316553634E+06, 0.101303572896501239E+06, - 0.101333544453130846E+06, 0.101364877370781323E+06, 0.101391063816659895E+06, 0.101411237101045277E+06, 0.101425278782258334E+06, - 0.101433519934200929E+06, 0.101439158935259431E+06, 0.101436999045160905E+06, 0.101426916105024720E+06, 0.101409617969188068E+06, - 0.101386542831537823E+06, 0.101358099179373283E+06, 0.101329104321193983E+06, 0.101301390131810738E+06, 0.101275584184176812E+06, - 0.101252450915750233E+06, 0.101231887457535791E+06, 0.101212090768716560E+06, 0.101196447068532798E+06, 0.101185068443023629E+06, - 0.101177384135667060E+06, 0.101168309967723544E+06, 0.101161992541140848E+06, 0.101159852630578913E+06, 0.101159796489626082E+06, - 0.101161597602608847E+06, 0.101164838510229980E+06, 0.101168957886595192E+06, 0.101173308450019656E+06, 0.101177043737997461E+06, - 0.101180725542300570E+06, 0.101183638211952741E+06, 0.101185541375514644E+06, 0.101186177771331219E+06, 0.101231389269493171E+06, - 0.101229452023944614E+06, 0.101228492450459045E+06, 0.101227437857730562E+06, 0.101225272919369032E+06, 0.101222115782736248E+06, - 0.101218895852368762E+06, 0.101215584732123752E+06, 0.101212116636056322E+06, 0.101207354097621472E+06, 0.101200521838921966E+06, - 0.101193426713001274E+06, 0.101186304142571476E+06, 0.101179395677309934E+06, 0.101172931379861388E+06, 0.101167151828382484E+06, - 0.101162308500518877E+06, 0.101158300144806009E+06, 0.101155408258388663E+06, 0.101154070184498851E+06, 0.101154559752015484E+06, - 0.101157052466433044E+06, 0.101161607131965604E+06, 0.101168151354609319E+06, 0.101176471448160533E+06, 0.101190446255643255E+06, - 0.101207546249739040E+06, 0.101224869025537133E+06, 0.101241629266362957E+06, 0.101257034534386199E+06, 0.101270300423290071E+06, - 0.101280701804350014E+06, 0.101286032850469506E+06, 0.101285592385854572E+06, 0.101282085195034277E+06, 0.101274697798302746E+06, - 0.101264580591891121E+06, 0.101253728075986262E+06, 0.101242929317346643E+06, 0.101232485866013521E+06, 0.101222025672053554E+06, - 0.101213765521939480E+06, 0.101207908438247250E+06, 0.101204284122239580E+06, 0.101199927839590950E+06, 0.101194734819518329E+06, - 0.101188456889903726E+06, 0.101179666542616309E+06, 0.101170394407501270E+06, 0.101161163472120141E+06, 0.101152520749703152E+06, - 0.101145006252468942E+06, 0.101139495861547286E+06, 0.101140801932908304E+06, 0.101144658005535239E+06, 0.101150950782672968E+06, - 0.101159402010231061E+06, 0.101169516352869221E+06, 0.101180618870833394E+06, 0.101190857796199096E+06, 0.101200641550543587E+06, - 0.101209362327359180E+06, 0.101217130139796180E+06, 0.101224049008589936E+06, 0.101230122753387783E+06, 0.101235212462695199E+06, - 0.101239229954162147E+06, 0.101242277095199534E+06, 0.101244507835626879E+06, 0.101246153185945266E+06, 0.101247135672995661E+06, - 0.101249606832741643E+06, 0.101254017340448758E+06, 0.101260512682501125E+06, 0.101268912159280037E+06, 0.101278581961162170E+06, - 0.101288935630890279E+06, 0.101299344634514127E+06, 0.101309165575948311E+06, 0.101317556887074039E+06, 0.101323172703937016E+06, - 0.101326358447397986E+06, 0.101327232302474091E+06, 0.101325894572504010E+06, 0.101322706535794525E+06, 0.101319932108380584E+06, - 0.101318115839731938E+06, 0.101317374329348502E+06, 0.101316802412196412E+06, 0.101316539167573457E+06, 0.101316220872659469E+06, - 0.101315472541661889E+06, 0.101313988991298058E+06, 0.101311143303248988E+06, 0.101306823565026949E+06, 0.101300909517459571E+06, - 0.101291139156745485E+06, 0.101281432901143096E+06, 0.101272931024738762E+06, 0.101267480423988032E+06, 0.101267406598649904E+06, - 0.101269963384954986E+06, 0.101274800002130170E+06, 0.101281233237463195E+06, 0.101288842618392577E+06, 0.101297886975346977E+06, - 0.101308296387334616E+06, 0.101325624485844790E+06, 0.101346166178142783E+06, 0.101363441252856501E+06, 0.101374801583022883E+06, - 0.101371478339382054E+06, 0.101357965915636902E+06, 0.101337616663800756E+06, 0.101310513973449386E+06, 0.101272307541573202E+06, - 0.101230865550039016E+06, 0.101190791911869368E+06, 0.101155350687670492E+06, 0.101129224427448615E+06, 0.101110583343861392E+06, - 0.101099020700267734E+06, 0.101094724119735372E+06, 0.101099023269690821E+06, 0.101111662707600757E+06, 0.101130628382792580E+06, - 0.101154442701152686E+06, 0.101179514522985817E+06, 0.101201379997560478E+06, 0.101226265787734679E+06, 0.101253796882664625E+06, - 0.101283225572595169E+06, 0.101317124967778669E+06, 0.101350989077608407E+06, 0.101379921717535108E+06, 0.101402381642000008E+06, - 0.101417742462739217E+06, 0.101429901727416946E+06, 0.101436203470310473E+06, 0.101434079341425662E+06, 0.101423164600191842E+06, - 0.101404037685293821E+06, 0.101376818918793375E+06, 0.101344589194113520E+06, 0.101311531147971255E+06, 0.101279820675164505E+06, - 0.101251153362574143E+06, 0.101225285333396270E+06, 0.101199764562447148E+06, 0.101178262360150809E+06, 0.101161772194779478E+06, - 0.101150434481179953E+06, 0.101143909494338062E+06, 0.101141390141577620E+06, 0.101140639767941699E+06, 0.101140632648710569E+06, - 0.101142372620975060E+06, 0.101145663398052158E+06, 0.101150107990777600E+06, 0.101155154940690569E+06, 0.101159369531278891E+06, - 0.101162295247948568E+06, 0.101164893804552295E+06, 0.101168002876310085E+06, 0.101170082535517562E+06, 0.101170879828210964E+06, - 0.101219861459639709E+06, 0.101217353733850920E+06, 0.101214813662341927E+06, 0.101212272616671195E+06, 0.101208980334428372E+06, - 0.101205795685889956E+06, 0.101202734659769427E+06, 0.101199769990954403E+06, 0.101196834984741159E+06, 0.101193828164992272E+06, - 0.101189376363543503E+06, 0.101183028116295318E+06, 0.101176590659241221E+06, 0.101170295511546516E+06, 0.101164459781001147E+06, - 0.101159272837843542E+06, 0.101154626508349247E+06, 0.101150830978481536E+06, 0.101147940393322046E+06, 0.101146374185143752E+06, - 0.101146551350105059E+06, 0.101148666345078062E+06, 0.101152796928674230E+06, 0.101158889620899077E+06, 0.101166802022490039E+06, - 0.101178035305259487E+06, 0.101194860122035752E+06, 0.101212325551695918E+06, 0.101229507831180323E+06, 0.101245588075390231E+06, - 0.101259749204794090E+06, 0.101271227064842373E+06, 0.101279354568716226E+06, 0.101282023041620065E+06, 0.101277735417878983E+06, - 0.101270065940430606E+06, 0.101260942221718724E+06, 0.101251183302667749E+06, 0.101241580790420048E+06, 0.101232817663754860E+06, - 0.101224865544509375E+06, 0.101217678236240463E+06, 0.101212672610467605E+06, 0.101207368061914924E+06, 0.101202142949429748E+06, - 0.101197200360827206E+06, 0.101192321056135959E+06, 0.101185312042045203E+06, 0.101176366919002583E+06, 0.101167575306740793E+06, - 0.101159499887747690E+06, 0.101153693581619635E+06, 0.101151632492099627E+06, 0.101152648343697670E+06, 0.101157198969257923E+06, - 0.101164178808173063E+06, 0.101173247856793882E+06, 0.101183857272265639E+06, 0.101195294072408884E+06, 0.101206439742155373E+06, - 0.101215821840872028E+06, 0.101224223508709707E+06, 0.101231582323487324E+06, 0.101237823030360581E+06, 0.101242874318770337E+06, - 0.101246774089702827E+06, 0.101249620201836733E+06, 0.101251514633922707E+06, 0.101250998739460556E+06, 0.101250350564701104E+06, - 0.101251192192736547E+06, 0.101254126969565099E+06, 0.101259362363834385E+06, 0.101266888172729494E+06, 0.101276372037240624E+06, - 0.101286838617996444E+06, 0.101297573246049607E+06, 0.101307533698699568E+06, 0.101315884770704040E+06, 0.101322262940598855E+06, - 0.101325965760392661E+06, 0.101327074410681467E+06, 0.101325913256045969E+06, 0.101323124870245505E+06, 0.101319702236701676E+06, - 0.101317199019545646E+06, 0.101315951598744505E+06, 0.101315806747022463E+06, 0.101315575437492836E+06, 0.101314907982108765E+06, - 0.101313877512845647E+06, 0.101312479697057366E+06, 0.101309803618787570E+06, 0.101306072028328548E+06, 0.101301517809186698E+06, - 0.101296222398532715E+06, 0.101287978736962512E+06, 0.101280134483104775E+06, 0.101273858730883643E+06, 0.101270559684999607E+06, - 0.101272646114663905E+06, 0.101277445816036910E+06, 0.101284587711525965E+06, 0.101293877343276210E+06, 0.101304839668757166E+06, - 0.101316528257227954E+06, 0.101328366576771165E+06, 0.101345969486117698E+06, 0.101364186088572969E+06, 0.101377148495963469E+06, - 0.101382093829553254E+06, 0.101370766337072331E+06, 0.101349741353763951E+06, 0.101321811510905638E+06, 0.101288468123698593E+06, - 0.101244965303345511E+06, 0.101202004776977919E+06, 0.101162860285996649E+06, 0.101126851606302604E+06, 0.101104372225545885E+06, - 0.101088557676466924E+06, 0.101079807482518576E+06, 0.101078498448923550E+06, 0.101085445131155400E+06, 0.101098827324377111E+06, - 0.101117379276230466E+06, 0.101139770652544976E+06, 0.101160113557297649E+06, 0.101180387504904938E+06, 0.101203886596317709E+06, - 0.101230902181368132E+06, 0.101261803558958476E+06, 0.101300608660476937E+06, 0.101337274184836075E+06, 0.101369125977644289E+06, - 0.101394267041929546E+06, 0.101413158265606093E+06, 0.101427330114929093E+06, 0.101432361057773902E+06, 0.101429910859225725E+06, - 0.101417624134461643E+06, 0.101395314188587567E+06, 0.101362172145086661E+06, 0.101325960646168634E+06, 0.101289070977803320E+06, - 0.101253544677021608E+06, 0.101220938962399465E+06, 0.101189935258524172E+06, 0.101161696612905507E+06, 0.101138721820111517E+06, - 0.101121644349305658E+06, 0.101110649141410599E+06, 0.101105415636551304E+06, 0.101106709372907222E+06, 0.101112684473039320E+06, - 0.101118393699309789E+06, 0.101122164751330070E+06, 0.101127188453840165E+06, 0.101133080620089138E+06, 0.101138746974859983E+06, - 0.101142873479913527E+06, 0.101146389620966002E+06, 0.101149025184660437E+06, 0.101150587859464547E+06, 0.101152755345234560E+06, - 0.101153603260132426E+06, 0.101210525717246186E+06, 0.101207548474999538E+06, 0.101202904596832290E+06, 0.101197951386655157E+06, - 0.101194386519771622E+06, 0.101191122015514105E+06, 0.101188175657561296E+06, 0.101185519945178385E+06, 0.101183085746111174E+06, - 0.101180766773284515E+06, 0.101178424993241424E+06, 0.101174517040993989E+06, 0.101168962341147722E+06, 0.101163714253363345E+06, - 0.101158948557658077E+06, 0.101154261182255184E+06, 0.101149950932639709E+06, 0.101146327181315632E+06, 0.101143687040794233E+06, - 0.101142126337276364E+06, 0.101142152044085655E+06, 0.101144083527112423E+06, 0.101148021171421016E+06, 0.101154000779215450E+06, - 0.101162760282120405E+06, 0.101173711396198050E+06, 0.101186611484798021E+06, 0.101203854792520258E+06, 0.101221108630801245E+06, - 0.101237514909808757E+06, 0.101252212005649548E+06, 0.101264385838287199E+06, 0.101273313773670612E+06, 0.101275991122254636E+06, - 0.101272633847169331E+06, 0.101265839223746094E+06, 0.101257619395513131E+06, 0.101248828329997094E+06, 0.101240269262524962E+06, - 0.101232609922544550E+06, 0.101226305719316471E+06, 0.101221001261636731E+06, 0.101215325578545016E+06, 0.101210148330884782E+06, - 0.101205386910296002E+06, 0.101200913609812837E+06, 0.101196557499459639E+06, 0.101192094621711993E+06, 0.101184939627293686E+06, - 0.101177056092112194E+06, 0.101171384998373789E+06, 0.101168077457142164E+06, 0.101167062491365999E+06, 0.101168742847490139E+06, - 0.101173481015017140E+06, 0.101181062252591364E+06, 0.101190688726292763E+06, 0.101201754487460537E+06, 0.101213053590803727E+06, - 0.101224458950927612E+06, 0.101234613260145692E+06, 0.101242743726390036E+06, 0.101249595831817132E+06, 0.101255046289272010E+06, - 0.101258984767052723E+06, 0.101261363785577109E+06, 0.101261779254400128E+06, 0.101259695740838331E+06, 0.101257723355522670E+06, - 0.101256712782620496E+06, 0.101257390131988577E+06, 0.101260812728128207E+06, 0.101266865110914150E+06, 0.101275356425384583E+06, - 0.101285757165198593E+06, 0.101297005109519319E+06, 0.101307222441895385E+06, 0.101316130802742104E+06, 0.101323131432448601E+06, - 0.101327755554835458E+06, 0.101329091060690815E+06, 0.101327426676222676E+06, 0.101323405755774875E+06, 0.101317808009742424E+06, - 0.101312695092861308E+06, 0.101309644418928467E+06, 0.101307843097245379E+06, 0.101307258014776118E+06, 0.101306396062738830E+06, - 0.101304392989299769E+06, 0.101302318926388383E+06, 0.101300146974100906E+06, 0.101296693003163877E+06, 0.101292171838443071E+06, - 0.101287472873098537E+06, 0.101282787197424317E+06, 0.101276691890622955E+06, 0.101271343380570586E+06, 0.101267971439309680E+06, - 0.101267491024100920E+06, 0.101272069334797809E+06, 0.101279335267968272E+06, 0.101288917788163279E+06, 0.101301241225878053E+06, - 0.101315819189724789E+06, 0.101330320177330534E+06, 0.101343606724499783E+06, 0.101360277666390102E+06, 0.101374651937569957E+06, - 0.101381948044541350E+06, 0.101379139254734604E+06, 0.101357829215456179E+06, 0.101327280040149271E+06, 0.101289941888269532E+06, - 0.101246108522415467E+06, 0.101194796632095546E+06, 0.101146024288208340E+06, 0.101103656741928615E+06, 0.101073141515266252E+06, - 0.101057806173447316E+06, 0.101051682514418280E+06, 0.101049406076037965E+06, 0.101052339673225651E+06, 0.101063115066462298E+06, - 0.101078506068417060E+06, 0.101097590566484258E+06, 0.101118771179471136E+06, 0.101135489318013730E+06, 0.101154758424584812E+06, - 0.101177654242688412E+06, 0.101205061131610448E+06, 0.101242230976538951E+06, 0.101283647903067162E+06, 0.101323242160821901E+06, - 0.101358087742294330E+06, 0.101385937955843910E+06, 0.101409794381458749E+06, 0.101425117131910592E+06, 0.101429997042675925E+06, - 0.101424225668113679E+06, 0.101409012607044147E+06, 0.101378645916584719E+06, 0.101341017521829854E+06, 0.101300635121866770E+06, - 0.101259780015675904E+06, 0.101220490612824302E+06, 0.101183385014229250E+06, 0.101147969487759023E+06, 0.101117685992608021E+06, - 0.101093539937281050E+06, 0.101076195561657238E+06, 0.101065910310074483E+06, 0.101063435753359998E+06, 0.101067804628520898E+06, - 0.101076221687106154E+06, 0.101087269872699864E+06, 0.101098388777976448E+06, 0.101105436139853176E+06, 0.101112874451142532E+06, - 0.101118849015061031E+06, 0.101124113984576659E+06, 0.101128454272832299E+06, 0.101131632912711430E+06, 0.101133440671438293E+06, - 0.101133742258942963E+06, 0.101133420481460824E+06, 0.101203377126110252E+06, 0.101198268613597073E+06, 0.101192518049139719E+06, - 0.101186803252296639E+06, 0.101181813758537333E+06, 0.101178421999043727E+06, 0.101175553435103371E+06, 0.101173179030172672E+06, - 0.101171225754259809E+06, 0.101169580857152410E+06, 0.101168097072006873E+06, 0.101166598871645896E+06, 0.101163936200708034E+06, - 0.101160319529115644E+06, 0.101156350070871646E+06, 0.101152298957045554E+06, 0.101148469397518347E+06, 0.101145174878879858E+06, - 0.101142716121090431E+06, 0.101141356671128422E+06, 0.101141393983984628E+06, 0.101143318014807519E+06, 0.101147349641468565E+06, - 0.101153926105170540E+06, 0.101162646354183598E+06, 0.101173404206242340E+06, 0.101185918183552916E+06, 0.101199863730921250E+06, - 0.101216872253279580E+06, 0.101233295276471807E+06, 0.101248215030952546E+06, 0.101260757021715341E+06, 0.101267495548934719E+06, - 0.101269706371902867E+06, 0.101268204478453976E+06, 0.101262805085999877E+06, 0.101255380826612120E+06, 0.101247430865831397E+06, - 0.101239780825202557E+06, 0.101233090454269026E+06, 0.101227802760140185E+06, 0.101223571816330572E+06, 0.101219066722623626E+06, - 0.101214540599785731E+06, 0.101210406057645538E+06, 0.101206592274863258E+06, 0.101202981532469319E+06, 0.101199400726594919E+06, - 0.101195627874287937E+06, 0.101191227720762778E+06, 0.101187565739316706E+06, 0.101185464827996155E+06, 0.101185511851585936E+06, - 0.101188073018881041E+06, 0.101193228150490002E+06, 0.101201132185450770E+06, 0.101211253103469411E+06, 0.101221691007216708E+06, - 0.101232930515629778E+06, 0.101244622455395234E+06, 0.101256099137093290E+06, 0.101264336488988658E+06, 0.101270613718010951E+06, - 0.101275186944850837E+06, 0.101277911712320536E+06, 0.101275720871891084E+06, 0.101272701050287156E+06, 0.101269530015498065E+06, - 0.101266916775846155E+06, 0.101265667085305176E+06, 0.101266412423480491E+06, 0.101269963618393420E+06, 0.101276824074798991E+06, - 0.101286538984123661E+06, 0.101297754584716895E+06, 0.101309268788473608E+06, 0.101319049570761636E+06, 0.101326688370924327E+06, - 0.101331858743319128E+06, 0.101334118663267698E+06, 0.101332850026087355E+06, 0.101327763563889297E+06, 0.101320054486635490E+06, - 0.101310581963123463E+06, 0.101301464042469088E+06, 0.101296071475081029E+06, 0.101292351628835357E+06, 0.101290169534329834E+06, - 0.101288302766939916E+06, 0.101284014152439850E+06, 0.101279941996829206E+06, 0.101276061598442378E+06, 0.101271538120976256E+06, - 0.101266097326113042E+06, 0.101261239127189925E+06, 0.101257245251898741E+06, 0.101253483641709958E+06, 0.101251125639619684E+06, - 0.101251189762292764E+06, 0.101253695416316186E+06, 0.101260342754598576E+06, 0.101269818597965233E+06, 0.101281786685942599E+06, - 0.101297267888598697E+06, 0.101315752383087500E+06, 0.101333588295053938E+06, 0.101349152940472399E+06, 0.101363783604825469E+06, - 0.101372978867465237E+06, 0.101373889912201208E+06, 0.101361962340075130E+06, 0.101329656482126462E+06, 0.101288577681367635E+06, - 0.101241353955692000E+06, 0.101187015186283301E+06, 0.101128342669573714E+06, 0.101074249019373397E+06, 0.101029162958810339E+06, - 0.101000523612843142E+06, 0.100987089359594960E+06, 0.100984958621042068E+06, 0.100992130612266148E+06, 0.101008448898443559E+06, - 0.101030521667859153E+06, 0.101051007866767963E+06, 0.101071664234935859E+06, 0.101090175915114785E+06, 0.101106549855269026E+06, - 0.101125443846952985E+06, 0.101148128478478480E+06, 0.101176649869573142E+06, 0.101219367480301720E+06, 0.101264169410245595E+06, - 0.101307902998138612E+06, 0.101345704641115881E+06, 0.101377820901637606E+06, 0.101403851472658702E+06, 0.101419708524997433E+06, - 0.101423957150136412E+06, 0.101416125366734399E+06, 0.101392821386149662E+06, 0.101354118286926780E+06, 0.101311952791900418E+06, - 0.101267586958551430E+06, 0.101222923148393995E+06, 0.101179984606825063E+06, 0.101137775123404324E+06, 0.101100052058991307E+06, - 0.101068211877007227E+06, 0.101043182495123227E+06, 0.101025887119877370E+06, 0.101017441028948917E+06, 0.101018646999727091E+06, - 0.101025249625575729E+06, 0.101036067916060245E+06, 0.101049702828005305E+06, 0.101064676552964025E+06, 0.101079565938465035E+06, - 0.101088532594576784E+06, 0.101096312478571519E+06, 0.101102983223382442E+06, 0.101108374984337381E+06, 0.101112280329396730E+06, - 0.101114507038743657E+06, 0.101114428830065517E+06, 0.101111055246130432E+06, 0.101196406538596522E+06, 0.101190461736979341E+06, - 0.101184419171533169E+06, 0.101178438759959274E+06, 0.101172694307587532E+06, 0.101168042459568693E+06, 0.101165224780188713E+06, - 0.101163116738625147E+06, 0.101161640044718297E+06, 0.101160673934197897E+06, 0.101160060130737882E+06, 0.101160308872814785E+06, - 0.101161160328086728E+06, 0.101159852318196237E+06, 0.101156811572228151E+06, 0.101153532829243355E+06, 0.101150328623015521E+06, - 0.101147521674777250E+06, 0.101145421670737880E+06, 0.101144300600728122E+06, 0.101144366524547018E+06, 0.101146453358106490E+06, - 0.101151154760197140E+06, 0.101157852536650826E+06, 0.101166593375939396E+06, 0.101177254193880435E+06, 0.101189538295227583E+06, - 0.101202976381101937E+06, 0.101217143841964367E+06, 0.101233326011591271E+06, 0.101248211830283530E+06, 0.101258376645531374E+06, - 0.101264582921753405E+06, 0.101267070734474910E+06, 0.101266001194085227E+06, 0.101261820132445268E+06, 0.101255225790946322E+06, - 0.101247986960119670E+06, 0.101241132826118715E+06, 0.101235589817356347E+06, 0.101231742691396459E+06, 0.101228190519347510E+06, - 0.101224868811623688E+06, 0.101221346956982394E+06, 0.101217966212733285E+06, 0.101214970532675288E+06, 0.101212299627427041E+06, - 0.101209926653408853E+06, 0.101209182347595939E+06, 0.101208894928154026E+06, 0.101206557077161851E+06, 0.101205653829090777E+06, - 0.101206766501731909E+06, 0.101210234953384323E+06, 0.101216093544594405E+06, 0.101223864474518923E+06, 0.101233270650245788E+06, - 0.101243919236364745E+06, 0.101255411905531102E+06, 0.101267215651558581E+06, 0.101278589053053409E+06, 0.101288326667672663E+06, - 0.101293977254483369E+06, 0.101295988963460462E+06, 0.101293942850610052E+06, 0.101290379977981182E+06, 0.101286211796570817E+06, - 0.101282157951643720E+06, 0.101279101833166642E+06, 0.101277814046354848E+06, 0.101278807487432292E+06, 0.101282938226413549E+06, - 0.101291273361035273E+06, 0.101301583582921769E+06, 0.101312849202165788E+06, 0.101324002651453309E+06, 0.101333489244781522E+06, - 0.101339488921891199E+06, 0.101342369325021820E+06, 0.101341720289730991E+06, 0.101337127319298394E+06, 0.101327791615567519E+06, - 0.101315437423608601E+06, 0.101301282640627105E+06, 0.101286811802460725E+06, 0.101276747879297676E+06, 0.101269331760055575E+06, - 0.101263643990522745E+06, 0.101258989523824217E+06, 0.101251456119543334E+06, 0.101244182196566340E+06, 0.101237348106484831E+06, - 0.101228692607444944E+06, 0.101218585751885927E+06, 0.101210928314959441E+06, 0.101206232353375613E+06, 0.101203871455940549E+06, - 0.101203999533384937E+06, 0.101207475042430247E+06, 0.101214320092416674E+06, 0.101224147807091678E+06, 0.101236699974733609E+06, - 0.101251676274940794E+06, 0.101270825632959895E+06, 0.101293545270099348E+06, 0.101314419599624249E+06, 0.101330994497954525E+06, - 0.101343242305169362E+06, 0.101347429834497641E+06, 0.101341255518135789E+06, 0.101319524205864262E+06, 0.101278200143226626E+06, - 0.101228562906559484E+06, 0.101174212317573372E+06, 0.101112623030610339E+06, 0.101048222350508891E+06, 0.100990099190183420E+06, - 0.100943211786408705E+06, 0.100918044317067266E+06, 0.100907611661432689E+06, 0.100910107183064712E+06, 0.100923917070401818E+06, - 0.100948850301936414E+06, 0.100978281786140433E+06, 0.101008728042257979E+06, 0.101037658211344344E+06, 0.101057364399701371E+06, - 0.101074391235513976E+06, 0.101093594285308805E+06, 0.101116488413099345E+06, 0.101150558690399863E+06, 0.101193914933389984E+06, - 0.101239758121016799E+06, 0.101285323747319708E+06, 0.101327925492475028E+06, 0.101365565138565944E+06, 0.101392573640838629E+06, - 0.101408539383438299E+06, 0.101411604282492801E+06, 0.101400582930128410E+06, 0.101366946069406418E+06, 0.101324287192622069E+06, - 0.101276101666633986E+06, 0.101226619258282910E+06, 0.101178585432356136E+06, 0.101130984262627506E+06, 0.101086307783769356E+06, - 0.101046851053375387E+06, 0.101014063196888950E+06, 0.100988908271188513E+06, 0.100971785835137707E+06, 0.100968245753203373E+06, - 0.100971380696101813E+06, 0.100980060807918417E+06, 0.100993169646215858E+06, 0.101009312468744305E+06, 0.101026966655764860E+06, - 0.101044366184895640E+06, 0.101060339563627815E+06, 0.101071158866529076E+06, 0.101079488812984200E+06, 0.101086153913575283E+06, - 0.101090971172654899E+06, 0.101093525999388585E+06, 0.101092846852564820E+06, 0.101089780957355411E+06, 0.101191123249149765E+06, - 0.101184975896710632E+06, 0.101178781171733193E+06, 0.101172687284701038E+06, 0.101166856628363908E+06, 0.101161463025241668E+06, - 0.101157556719236236E+06, 0.101155715658911155E+06, 0.101154729896713383E+06, 0.101154469238441612E+06, 0.101155775624535832E+06, - 0.101158121462038107E+06, 0.101160042093184384E+06, 0.101161344855236384E+06, 0.101160448275110015E+06, 0.101158071590188309E+06, - 0.101155631532086059E+06, 0.101153465356088433E+06, 0.101151897289994900E+06, 0.101151213659422618E+06, 0.101151737576582789E+06, - 0.101154199170773107E+06, 0.101158985005759008E+06, 0.101165841396522868E+06, 0.101174673234837159E+06, 0.101185340894024586E+06, - 0.101197532040988634E+06, 0.101210762902995120E+06, 0.101224385238204501E+06, 0.101237894404589199E+06, 0.101250772227856185E+06, - 0.101260411029266310E+06, 0.101266591706174368E+06, 0.101269204187456722E+06, 0.101268397182717250E+06, 0.101264588122030676E+06, - 0.101258438511883942E+06, 0.101251623403392019E+06, 0.101246063118456994E+06, 0.101242417800723517E+06, 0.101239166549985050E+06, - 0.101236254306650939E+06, 0.101233631773944420E+06, 0.101231248894982156E+06, 0.101228825720597553E+06, 0.101226772928204024E+06, - 0.101225473798737570E+06, 0.101225516278296083E+06, 0.101226043519455008E+06, 0.101227093486833808E+06, 0.101228289760449348E+06, - 0.101228546951147655E+06, 0.101230707510254171E+06, 0.101235093253586310E+06, 0.101241126677553519E+06, 0.101248645598633651E+06, - 0.101258142018320970E+06, 0.101268933306888299E+06, 0.101280513500391826E+06, 0.101292262732881034E+06, 0.101303355465601169E+06, - 0.101312817264586003E+06, 0.101316400177874268E+06, 0.101315483458758521E+06, 0.101312277984593762E+06, 0.101307698621808959E+06, - 0.101302673951913355E+06, 0.101298053010945936E+06, 0.101294840530663249E+06, 0.101294065839099727E+06, 0.101296783533959431E+06, - 0.101302065639223511E+06, 0.101310033568624291E+06, 0.101320378178744606E+06, 0.101331366932783130E+06, 0.101341800425977897E+06, - 0.101350415611308272E+06, 0.101354800042096002E+06, 0.101354718500839095E+06, 0.101350294315183972E+06, 0.101341487001001398E+06, - 0.101327926160731338E+06, 0.101310260858651716E+06, 0.101290273767883307E+06, 0.101269495556410489E+06, 0.101251846238950835E+06, - 0.101238682635122401E+06, 0.101227174341821534E+06, 0.101213482647208613E+06, 0.101195603009729079E+06, 0.101177872156641286E+06, - 0.101162325618075352E+06, 0.101149982165601716E+06, 0.101139852149278217E+06, 0.101134024565056650E+06, 0.101132753824598782E+06, - 0.101135032680571021E+06, 0.101140084766430024E+06, 0.101148877574289698E+06, 0.101161005262514984E+06, 0.101174747769146576E+06, - 0.101190713232751208E+06, 0.101208811802622309E+06, 0.101231640660711972E+06, 0.101258571723189729E+06, 0.101282336017681446E+06, - 0.101299629439163051E+06, 0.101308040998087759E+06, 0.101305555171365690E+06, 0.101290435343250807E+06, 0.101256519799893256E+06, - 0.101204322883293091E+06, 0.101144321216045384E+06, 0.101080811870748948E+06, 0.101014238668434729E+06, 0.100950513534181708E+06, - 0.100894391363170798E+06, 0.100851829575523923E+06, 0.100832142921501421E+06, 0.100825615789308096E+06, 0.100832955840479583E+06, - 0.100854821405899405E+06, 0.100888239967709887E+06, 0.100925422763286362E+06, 0.100962602314510819E+06, 0.100994687767612981E+06, - 0.101018445383155631E+06, 0.101039638130810010E+06, 0.101060824122542370E+06, 0.101084945514884181E+06, 0.101122354145820311E+06, - 0.101165147778325379E+06, 0.101210847657910417E+06, 0.101256682236652778E+06, 0.101301382158490291E+06, 0.101341411155713809E+06, - 0.101372219111328362E+06, 0.101389231784620119E+06, 0.101390880863434664E+06, 0.101369226261351185E+06, 0.101331834231281726E+06, - 0.101285779545129859E+06, 0.101234345503529141E+06, 0.101180743690781746E+06, 0.101127223607977256E+06, 0.101076620915575957E+06, - 0.101030138146362922E+06, 0.100989582250385356E+06, 0.100956503181212684E+06, 0.100931937764084651E+06, 0.100920299784557195E+06, - 0.100918057371207338E+06, 0.100922770743209869E+06, 0.100933261994784887E+06, 0.100948483778151451E+06, 0.100967026543898348E+06, - 0.100987282070977919E+06, 0.101007276882737569E+06, 0.101025807002176851E+06, 0.101042092544874176E+06, 0.101053732614110791E+06, - 0.101061889868345606E+06, 0.101067702910314212E+06, 0.101070224192290465E+06, 0.101070263142884942E+06, 0.101067836061994312E+06, - 0.101188101877120876E+06, 0.101181904204517952E+06, 0.101175721080675750E+06, 0.101169689701016847E+06, 0.101163962332899173E+06, - 0.101158703372389791E+06, 0.101154083105507743E+06, 0.101151357736191479E+06, 0.101150899044327409E+06, 0.101152824487497259E+06, - 0.101156224838871945E+06, 0.101159507416219887E+06, 0.101162417168140935E+06, 0.101164756494849746E+06, 0.101166400553546104E+06, - 0.101165982684454619E+06, 0.101164433293333408E+06, 0.101163049411835455E+06, 0.101162175585306977E+06, 0.101162128095756125E+06, - 0.101163361425100273E+06, 0.101166227742201969E+06, 0.101170937924715152E+06, 0.101177913034471421E+06, 0.101186917319165936E+06, - 0.101197704545258457E+06, 0.101209946031686050E+06, 0.101223141837685776E+06, 0.101236628019135329E+06, 0.101248564959035430E+06, - 0.101259061289307880E+06, 0.101268404236147617E+06, 0.101274449875235630E+06, 0.101277082514349167E+06, 0.101276437786749404E+06, - 0.101272910152209646E+06, 0.101267124457491314E+06, 0.101260716984134080E+06, 0.101256743164844607E+06, 0.101253604663335806E+06, - 0.101250897345323741E+06, 0.101248591593381454E+06, 0.101246654559015689E+06, 0.101245041613427515E+06, 0.101243680788220503E+06, - 0.101243097273199470E+06, 0.101243781512439353E+06, 0.101244948599458978E+06, 0.101246597302939059E+06, 0.101248747416430124E+06, - 0.101251423906546814E+06, 0.101254153427662954E+06, 0.101257318705204321E+06, 0.101261887373189515E+06, 0.101267979989058746E+06, - 0.101275948774720324E+06, 0.101285713213097159E+06, 0.101296774828760288E+06, 0.101308302668075557E+06, 0.101319850467473152E+06, - 0.101329837083710619E+06, 0.101335921303205963E+06, 0.101339123113933456E+06, 0.101337898637374194E+06, 0.101333773323031986E+06, - 0.101328456667992868E+06, 0.101322897112772887E+06, 0.101317900606162963E+06, 0.101315889108461066E+06, 0.101316599306327043E+06, - 0.101319758730558635E+06, 0.101325424301052059E+06, 0.101333284991047447E+06, 0.101343211873693581E+06, 0.101353644944564134E+06, - 0.101363021317380320E+06, 0.101370049287251401E+06, 0.101372596455484265E+06, 0.101369268865042672E+06, 0.101360883616870342E+06, - 0.101347449435595729E+06, 0.101329133164082014E+06, 0.101305327141900649E+06, 0.101278380398203022E+06, 0.101249743471045615E+06, - 0.101219239546209603E+06, 0.101192352888002861E+06, 0.101165652475197479E+06, 0.101139697586887822E+06, 0.101114494511137265E+06, - 0.101090858686180072E+06, 0.101071576294283674E+06, 0.101057575297732197E+06, 0.101048074783742806E+06, 0.101044336258060692E+06, - 0.101046551193469917E+06, 0.101053556962642004E+06, 0.101063713831673056E+06, 0.101077829626709223E+06, 0.101095071852015652E+06, - 0.101113125151151267E+06, 0.101132720710483336E+06, 0.101154045391176667E+06, 0.101180390285880436E+06, 0.101211142948122884E+06, - 0.101237614514436951E+06, 0.101255726302408526E+06, 0.101259492448119025E+06, 0.101250509056824711E+06, 0.101227395084634161E+06, - 0.101182035261948520E+06, 0.101119630114631931E+06, 0.101050635848782738E+06, 0.100979922793482459E+06, 0.100910697623495973E+06, - 0.100847357213499476E+06, 0.100794166368117731E+06, 0.100758894445481623E+06, 0.100744322296544080E+06, 0.100745120848886974E+06, - 0.100759352059448109E+06, 0.100791294801023934E+06, 0.100833112039419531E+06, 0.100877562571698305E+06, 0.100920779246866339E+06, - 0.100955025798225848E+06, 0.100982525754081420E+06, 0.101006044587505748E+06, 0.101028143007870822E+06, 0.101055611280174300E+06, - 0.101091320427340703E+06, 0.101132355621430252E+06, 0.101176767088174020E+06, 0.101222102616479577E+06, 0.101267504098879013E+06, - 0.101307233300950669E+06, 0.101337730007502250E+06, 0.101356132691262712E+06, 0.101355517504656993E+06, 0.101326703347885734E+06, - 0.101286746249401243E+06, 0.101238373176205030E+06, 0.101184685036191077E+06, 0.101128907484998796E+06, 0.101073391747240559E+06, - 0.101019454525129811E+06, 0.100970871910515343E+06, 0.100929826661987419E+06, 0.100897105571455861E+06, 0.100876831879007659E+06, - 0.100867962906273533E+06, 0.100867330421829305E+06, 0.100873728684090966E+06, 0.100885749735442761E+06, 0.100902849954122852E+06, - 0.100924138951177738E+06, 0.100946961851234868E+06, 0.100969279025770302E+06, 0.100990033557581031E+06, 0.101008477654044342E+06, - 0.101024214908302165E+06, 0.101035732998499894E+06, 0.101041912961714450E+06, 0.101045642366251923E+06, 0.101046792406885972E+06, - 0.101045365333532347E+06, 0.101187355100872199E+06, 0.101181283838042174E+06, 0.101175299671037268E+06, 0.101169529662610788E+06, - 0.101164117431673949E+06, 0.101159220075809775E+06, 0.101155001817589582E+06, 0.101151624022777440E+06, 0.101152497595067340E+06, - 0.101156451659840226E+06, 0.101160648061411019E+06, 0.101164790528929152E+06, 0.101168618147906396E+06, 0.101171926049179310E+06, - 0.101174580360364256E+06, 0.101176526712674633E+06, 0.101176736224529814E+06, 0.101176257363116325E+06, 0.101176166983752380E+06, - 0.101176807287626842E+06, 0.101178681128324213E+06, 0.101182078251181316E+06, 0.101187204570596310E+06, 0.101194163269585537E+06, - 0.101203334524264646E+06, 0.101214364937736551E+06, 0.101226809413448165E+06, 0.101240149829298927E+06, 0.101253261358725853E+06, - 0.101265100089497806E+06, 0.101275120974395875E+06, 0.101282996940042518E+06, 0.101288828111014154E+06, 0.101291420149586207E+06, - 0.101290897222999163E+06, 0.101287639377078289E+06, 0.101283002528089506E+06, 0.101278193857728707E+06, 0.101273020512430914E+06, - 0.101269901051284018E+06, 0.101267678623295869E+06, 0.101265950449211479E+06, 0.101264703039611326E+06, 0.101263900879826906E+06, - 0.101263923607509249E+06, 0.101265004562038375E+06, 0.101266684912193334E+06, 0.101268855296950496E+06, 0.101271506964180182E+06, - 0.101274640173084292E+06, 0.101278241537383161E+06, 0.101282245825992912E+06, 0.101286353240369135E+06, 0.101291355828485597E+06, - 0.101297931619035255E+06, 0.101306253371424813E+06, 0.101316214078965480E+06, 0.101327380285913983E+06, 0.101338920669929619E+06, - 0.101349293450103680E+06, 0.101357122930671496E+06, 0.101362252520088790E+06, 0.101364464771970830E+06, 0.101363785192026829E+06, - 0.101359089181177871E+06, 0.101353368594169064E+06, 0.101348059285105599E+06, 0.101344504609358351E+06, 0.101342802273270747E+06, - 0.101343694674300015E+06, 0.101347186594235303E+06, 0.101353156284255645E+06, 0.101361135003142495E+06, 0.101370388484892959E+06, - 0.101380640458787442E+06, 0.101388946718752617E+06, 0.101393651801589484E+06, 0.101393499019751704E+06, 0.101386884558896083E+06, - 0.101374143979384535E+06, 0.101355609362859250E+06, 0.101331626780358332E+06, 0.101301083582183201E+06, 0.101263353354839783E+06, - 0.101221306897352624E+06, 0.101176993466944725E+06, 0.101136539903244993E+06, 0.101098204242251013E+06, 0.101061761330862719E+06, - 0.101028266665796909E+06, 0.100998589290583972E+06, 0.100975333400938267E+06, 0.100959068131358043E+06, 0.100949766177223195E+06, - 0.100947806353674678E+06, 0.100952626346498961E+06, 0.100962758032929953E+06, 0.100976213788639361E+06, 0.100993663080123253E+06, - 0.101014486892675981E+06, 0.101035822837299012E+06, 0.101058579399157214E+06, 0.101083303211150094E+06, 0.101113186489526008E+06, - 0.101147351565124962E+06, 0.101176652682216401E+06, 0.101196193972918787E+06, 0.101198569776344622E+06, 0.101186160134931008E+06, - 0.101157868126258880E+06, 0.101103141394806822E+06, 0.101031831614193070E+06, 0.100956733996206865E+06, 0.100882403087983286E+06, - 0.100813473138545116E+06, 0.100752516407046714E+06, 0.100703757785565627E+06, 0.100676218536944187E+06, 0.100667431274046598E+06, - 0.100674873519601999E+06, 0.100697658618489222E+06, 0.100739841159568794E+06, 0.100789068474863947E+06, 0.100839720710070338E+06, - 0.100886379550526690E+06, 0.100923029883014446E+06, 0.100953143284320337E+06, 0.100977639241319004E+06, 0.100999128395021136E+06, - 0.101024581691416737E+06, 0.101055845921262473E+06, 0.101093715024692676E+06, 0.101137145750038864E+06, 0.101181709309337297E+06, - 0.101225325474523444E+06, 0.101263559713032722E+06, 0.101292474677031365E+06, 0.101308682549641118E+06, 0.101297475120822361E+06, - 0.101271409211849808E+06, 0.101232040601299872E+06, 0.101182869285470704E+06, 0.101128290980360704E+06, 0.101072929755581790E+06, - 0.101016889073163620E+06, 0.100962491541966170E+06, 0.100912327910715336E+06, 0.100869361400221751E+06, 0.100839775977090918E+06, - 0.100823441492130820E+06, 0.100816113342184137E+06, 0.100817094874734074E+06, 0.100825233759279654E+06, 0.100839074432490510E+06, - 0.100858082771811969E+06, 0.100882174552001874E+06, 0.100906977487573211E+06, 0.100931151837540980E+06, 0.100953671595204651E+06, - 0.100973813441941427E+06, 0.100991208365737388E+06, 0.101004593996319396E+06, 0.101014464426847393E+06, 0.101019840305871679E+06, - 0.101022516216040211E+06, 0.101022479820383916E+06, 0.101189306237606637E+06, 0.101183099563423224E+06, 0.101177524645541649E+06, - 0.101172236435105573E+06, 0.101167371532973528E+06, 0.101163082020276575E+06, 0.101159529060147339E+06, 0.101159316447558173E+06, - 0.101160894564677219E+06, 0.101164348300187223E+06, 0.101169261422140553E+06, 0.101174195290734366E+06, 0.101178879818970003E+06, - 0.101183100812083387E+06, 0.101186714675334646E+06, 0.101189656703835382E+06, 0.101191942124414170E+06, 0.101192917377320977E+06, - 0.101193593575982464E+06, 0.101195069630171711E+06, 0.101197693383898673E+06, 0.101201751769885639E+06, 0.101207449602623747E+06, - 0.101214890679059696E+06, 0.101224061589853489E+06, 0.101235336912347877E+06, 0.101248190104239126E+06, 0.101262427935202722E+06, - 0.101275786221996692E+06, 0.101287697523967043E+06, 0.101297635973110140E+06, 0.101305160473319178E+06, 0.101310051693956630E+06, - 0.101312576731523863E+06, 0.101312178530984005E+06, 0.101309704462442271E+06, 0.101306154021924303E+06, 0.101301740366064056E+06, - 0.101296951709652378E+06, 0.101292269396465854E+06, 0.101290108113855764E+06, 0.101288928548419208E+06, 0.101288387917089291E+06, - 0.101288777866387623E+06, 0.101290116771842790E+06, 0.101292139767421628E+06, 0.101294723268304471E+06, 0.101297795211849851E+06, - 0.101301366709605994E+06, 0.101305420330384557E+06, 0.101309869927812077E+06, 0.101314312823006214E+06, 0.101319116997910372E+06, - 0.101324617109151222E+06, 0.101331532615370001E+06, 0.101340103637168490E+06, 0.101350201834497682E+06, 0.101361344371531173E+06, - 0.101372418886796950E+06, 0.101381948875157381E+06, 0.101388923839096911E+06, 0.101393136106285616E+06, 0.101394429864949576E+06, - 0.101392894622174237E+06, 0.101388710803148075E+06, 0.101383777236252092E+06, 0.101379295952832908E+06, 0.101375940276367168E+06, - 0.101374441230547527E+06, 0.101375326622697306E+06, 0.101379093018278771E+06, 0.101385343361571824E+06, 0.101393971058482173E+06, - 0.101404050563811383E+06, 0.101413309721598285E+06, 0.101419590399406094E+06, 0.101421556394179410E+06, 0.101418021431235960E+06, - 0.101407974515161055E+06, 0.101390537479077990E+06, 0.101366032709315157E+06, 0.101334626683717870E+06, 0.101295933958054040E+06, - 0.101248443893183838E+06, 0.101195557967522065E+06, 0.101139585544601810E+06, 0.101085211343045346E+06, 0.101035266930195139E+06, - 0.100988241812145512E+06, 0.100945367896748721E+06, 0.100910497202633036E+06, 0.100884702886764164E+06, 0.100866517649476897E+06, - 0.100856014684083144E+06, 0.100852787000617667E+06, 0.100856653557479323E+06, 0.100867163372326730E+06, 0.100881111266454434E+06, - 0.100900315195405696E+06, 0.100923976750114074E+06, 0.100948598119614544E+06, 0.100974781704195004E+06, 0.101003202157587060E+06, - 0.101036407590628412E+06, 0.101073193182310031E+06, 0.101104736474453239E+06, 0.101125695287679831E+06, 0.101129453279073452E+06, - 0.101117773581594010E+06, 0.101089185532541305E+06, 0.101034032199054171E+06, 0.100963945545633382E+06, 0.100886699328991119E+06, - 0.100810636627241329E+06, 0.100740715610179395E+06, 0.100679191246166200E+06, 0.100632989251138570E+06, 0.100613781871159343E+06, - 0.100610871530594683E+06, 0.100624379990977119E+06, 0.100656925116010229E+06, 0.100705935141557828E+06, 0.100761070879974053E+06, - 0.100816622699684551E+06, 0.100864793595773081E+06, 0.100902967646118850E+06, 0.100932714749620762E+06, 0.100956310150092322E+06, - 0.100973624358999965E+06, 0.100992241483773090E+06, 0.101016637765204548E+06, 0.101048154107647293E+06, 0.101087466334016062E+06, - 0.101132339254048915E+06, 0.101174823812832328E+06, 0.101210761915469266E+06, 0.101237271423401384E+06, 0.101243002885737078E+06, - 0.101230131791106003E+06, 0.101203940299668466E+06, 0.101166656487591579E+06, 0.101121119041289232E+06, 0.101069073832594047E+06, - 0.101014700223724387E+06, 0.100959265268248433E+06, 0.100905468112225586E+06, 0.100856040902612105E+06, 0.100814460428244129E+06, - 0.100787259237540056E+06, 0.100772005863003345E+06, 0.100765985352267919E+06, 0.100768479113289053E+06, 0.100778366997407138E+06, - 0.100794945598743492E+06, 0.100817620478677374E+06, 0.100842147859125718E+06, 0.100867955315801722E+06, 0.100893394586128459E+06, - 0.100917107047287223E+06, 0.100938380004807230E+06, 0.100955347801049342E+06, 0.100970101009214006E+06, 0.100982904354844184E+06, - 0.100992784717252944E+06, 0.100997426697573173E+06, 0.100999203666720758E+06, 0.101193726602745155E+06, 0.101187754050723946E+06, - 0.101182357442443288E+06, 0.101177791388126643E+06, 0.101173723996436573E+06, 0.101170304719806183E+06, 0.101170612153776412E+06, - 0.101172440371721386E+06, 0.101174837075875621E+06, 0.101177672254314428E+06, 0.101182161160034389E+06, 0.101187828651191783E+06, - 0.101193320301503438E+06, 0.101198410730358519E+06, 0.101202946144533795E+06, 0.101206852558810875E+06, 0.101210007801575470E+06, - 0.101212489910168282E+06, 0.101214469378389869E+06, 0.101216878002924321E+06, 0.101220363461237575E+06, 0.101225214136769951E+06, - 0.101231637580600829E+06, 0.101239741560505950E+06, 0.101249517808410572E+06, 0.101260983023677167E+06, 0.101275957870551239E+06, - 0.101290656294668952E+06, 0.101304333702323362E+06, 0.101316427532517599E+06, 0.101326426428850100E+06, 0.101333915035895625E+06, - 0.101338611708287717E+06, 0.101340492859798338E+06, 0.101340362563395611E+06, 0.101338449476013702E+06, 0.101335257523435517E+06, - 0.101331249861504504E+06, 0.101326886093198918E+06, 0.101322617484757109E+06, 0.101318867500197564E+06, 0.101317900452591755E+06, - 0.101318314786954928E+06, 0.101319723768116164E+06, 0.101321959881412520E+06, 0.101324889048512938E+06, 0.101328347647524672E+06, - 0.101332174840765205E+06, 0.101336616060312401E+06, 0.101341556829236884E+06, 0.101346573413864826E+06, 0.101351603295543347E+06, - 0.101356815104860521E+06, 0.101362438373961399E+06, 0.101369371088361426E+06, 0.101378082295762331E+06, 0.101388314410706720E+06, - 0.101399372327800622E+06, 0.101410061836120745E+06, 0.101419580351030396E+06, 0.101425913537260407E+06, 0.101429293259021812E+06, - 0.101429804412116951E+06, 0.101427672924137820E+06, 0.101424080437455879E+06, 0.101419619212416699E+06, 0.101415230974183942E+06, - 0.101412067965185430E+06, 0.101410791086110883E+06, 0.101411739073867124E+06, 0.101415639705951602E+06, 0.101423312622668134E+06, - 0.101432474045874798E+06, 0.101442051195699867E+06, 0.101450469188552204E+06, 0.101454491373749755E+06, 0.101453440137517347E+06, - 0.101446281387837167E+06, 0.101431595048405667E+06, 0.101408886711617088E+06, 0.101378784184722594E+06, 0.101341184770978914E+06, - 0.101295889547724786E+06, 0.101240328400627433E+06, 0.101177652284460986E+06, 0.101111150684114546E+06, 0.101044053118300144E+06, - 0.100984918740243505E+06, 0.100930374090685815E+06, 0.100881582472409573E+06, 0.100841112633375247E+06, 0.100809768362702191E+06, - 0.100786799243457121E+06, 0.100772143085301912E+06, 0.100764968278141983E+06, 0.100765770745809103E+06, 0.100774102380776618E+06, - 0.100787701814049200E+06, 0.100807502103195773E+06, 0.100832717694658859E+06, 0.100860249536352872E+06, 0.100889852423407749E+06, - 0.100921848628126099E+06, 0.100957861355781963E+06, 0.100996433916241411E+06, 0.101029829562515966E+06, 0.101052485930506547E+06, - 0.101058372937639273E+06, 0.101049548410078569E+06, 0.101024243456762211E+06, 0.100972590760278690E+06, 0.100908281417167527E+06, - 0.100837060983074800E+06, 0.100768161325613342E+06, 0.100704714640766149E+06, 0.100649980401007386E+06, 0.100610226186345069E+06, - 0.100590748020045430E+06, 0.100587436259410169E+06, 0.100600313080586799E+06, 0.100641206195168561E+06, 0.100694783185600594E+06, - 0.100753395339411843E+06, 0.100811221255729251E+06, 0.100860359364136690E+06, 0.100899824043495319E+06, 0.100928315410134717E+06, - 0.100945425133485944E+06, 0.100949685705930868E+06, 0.100959203677864440E+06, 0.100974757114044391E+06, 0.100998131833821230E+06, - 0.101033920715517670E+06, 0.101074219109624129E+06, 0.101114091820176982E+06, 0.101149405994865883E+06, 0.101170348641579942E+06, - 0.101169807298637141E+06, 0.101156298476682292E+06, 0.101130628971099330E+06, 0.101094643437300154E+06, 0.101052492078486888E+06, - 0.101007253119503090E+06, 0.100955907017813224E+06, 0.100902084595712833E+06, 0.100849827379669470E+06, 0.100802083544595851E+06, - 0.100765913220995702E+06, 0.100739572869835451E+06, 0.100723779479156976E+06, 0.100718506421119528E+06, 0.100722320980193326E+06, - 0.100734436110120514E+06, 0.100755329206052033E+06, 0.100779519272158068E+06, 0.100805173540144926E+06, 0.100830784490592530E+06, - 0.100856189170746162E+06, 0.100880432886013805E+06, 0.100899949784039432E+06, 0.100917438620547167E+06, 0.100933522862752710E+06, - 0.100948109352301544E+06, 0.100961044329522949E+06, 0.100971373211325132E+06, 0.100975423948777170E+06, 0.101200152192834488E+06, - 0.101194982325493736E+06, 0.101190103263664205E+06, 0.101186138559247396E+06, 0.101183134221834189E+06, 0.101184216681154692E+06, - 0.101186521041798725E+06, 0.101189436060083317E+06, 0.101192802546943451E+06, 0.101196478796712297E+06, 0.101200354354545649E+06, - 0.101205668611732151E+06, 0.101211929159398627E+06, 0.101217855930562437E+06, 0.101223284560094209E+06, 0.101227968215825720E+06, - 0.101231889676374194E+06, 0.101235394681567603E+06, 0.101238691342655846E+06, 0.101242180145337508E+06, 0.101246637252434826E+06, - 0.101252408136256170E+06, 0.101259706939182157E+06, 0.101268648761024378E+06, 0.101279505402642011E+06, 0.101294343975882977E+06, - 0.101309563533686218E+06, 0.101324641711895500E+06, 0.101338688391072021E+06, 0.101351044389960793E+06, 0.101361207159967045E+06, - 0.101368783445243811E+06, 0.101373529077171552E+06, 0.101374957490127519E+06, 0.101374464042535998E+06, 0.101372814207710297E+06, - 0.101369991240096075E+06, 0.101366429702577938E+06, 0.101362562430391059E+06, 0.101358815668015828E+06, 0.101355589086463762E+06, - 0.101353446673457220E+06, 0.101354379072032898E+06, 0.101356568662050558E+06, 0.101359675232751892E+06, 0.101363521918530183E+06, - 0.101367901119934351E+06, 0.101372596354978567E+06, 0.101377679630817802E+06, 0.101383555064504282E+06, 0.101389214201889146E+06, - 0.101394747283543154E+06, 0.101400304955646759E+06, 0.101406085277459220E+06, 0.101412285840230092E+06, 0.101421118963008921E+06, - 0.101431763041225102E+06, 0.101442507714153820E+06, 0.101452705296310087E+06, 0.101461587946274274E+06, 0.101468308697248838E+06, - 0.101470980618346424E+06, 0.101470729759961876E+06, 0.101468260238464049E+06, 0.101464485269084631E+06, 0.101460142280246233E+06, - 0.101455922507406227E+06, 0.101452998879112638E+06, 0.101452045655453316E+06, 0.101454002525278673E+06, 0.101458795222069632E+06, - 0.101466167386261062E+06, 0.101474834484365027E+06, 0.101483448321051124E+06, 0.101490293297485317E+06, 0.101492761571887779E+06, - 0.101487122913431667E+06, 0.101474656695076628E+06, 0.101456224507296021E+06, 0.101430664509854570E+06, 0.101396241168372988E+06, - 0.101353344458271313E+06, 0.101301873429881321E+06, 0.101240809982906721E+06, 0.101170237649192510E+06, 0.101096056635001150E+06, - 0.101022326149495057E+06, 0.100954494264510751E+06, 0.100892663983306251E+06, 0.100837194485465618E+06, 0.100789854158125687E+06, - 0.100752681688232609E+06, 0.100724050472389747E+06, 0.100703743253736306E+06, 0.100691513151292049E+06, 0.100687489061012806E+06, - 0.100691112445670500E+06, 0.100703488782601926E+06, 0.100723515984008409E+06, 0.100749686437924174E+06, 0.100779862035053753E+06, - 0.100812870466228749E+06, 0.100848356219152789E+06, 0.100886618033728999E+06, 0.100925814700154908E+06, 0.100959913340029161E+06, - 0.100983841408427761E+06, 0.100992708938197888E+06, 0.100988038726636543E+06, 0.100967451749821237E+06, 0.100923773661071609E+06, - 0.100869154347678006E+06, 0.100808293671752166E+06, 0.100749950128448239E+06, 0.100695742144580625E+06, 0.100650055466795442E+06, - 0.100620543751264457E+06, 0.100607774629359716E+06, 0.100609856499218455E+06, 0.100627731512123690E+06, 0.100665827330432643E+06, - 0.100713727303578300E+06, 0.100768972922192886E+06, 0.100825101449405265E+06, 0.100873709631678183E+06, 0.100911910907812446E+06, - 0.100937425920985901E+06, 0.100943826278808614E+06, 0.100938923612846338E+06, 0.100932772703382885E+06, 0.100933209681834254E+06, - 0.100949942917228545E+06, 0.100978390439217677E+06, 0.101012218238497939E+06, 0.101047001443362271E+06, 0.101078030320958118E+06, - 0.101092528178749781E+06, 0.101092763600199483E+06, 0.101079667768304178E+06, 0.101055363093306296E+06, 0.101021923023798488E+06, - 0.100985043918944197E+06, 0.100942576674115116E+06, 0.100896142310934607E+06, 0.100846740359288175E+06, 0.100796745756417309E+06, - 0.100754281013923188E+06, 0.100719661969801513E+06, 0.100694202095497239E+06, 0.100678990016565542E+06, 0.100674159552381345E+06, - 0.100679144362130333E+06, 0.100696517057853678E+06, 0.100718723297862292E+06, 0.100743828966135392E+06, 0.100770038155539907E+06, - 0.100795879753092362E+06, 0.100820314666932885E+06, 0.100840279171251284E+06, 0.100859249879902098E+06, 0.100877455365052447E+06, - 0.100894767625869688E+06, 0.100911051050858092E+06, 0.100926113687447752E+06, 0.100939677540915931E+06, 0.100954098051095163E+06, - 0.101208266074669766E+06, 0.101204147301312958E+06, 0.101200416332034234E+06, 0.101197391022381067E+06, 0.101199181271863577E+06, - 0.101202094479608772E+06, 0.101205718922681015E+06, 0.101209868079757638E+06, 0.101214363087133126E+06, 0.101219049217859545E+06, - 0.101223809934456556E+06, 0.101228578149758148E+06, 0.101234563424877633E+06, 0.101241302361129114E+06, 0.101247428820028508E+06, - 0.101252833705618847E+06, 0.101257741214607289E+06, 0.101262268791874914E+06, 0.101266621965163562E+06, 0.101271104202253337E+06, - 0.101276449761759577E+06, 0.101283261996570189E+06, 0.101291578552841063E+06, 0.101301921001578070E+06, 0.101316864610287244E+06, - 0.101332633397110185E+06, 0.101348565409528048E+06, 0.101363970375545556E+06, 0.101378339950166031E+06, 0.101391005184961628E+06, - 0.101401390238182328E+06, 0.101409118811233842E+06, 0.101412813852507519E+06, 0.101413916622343488E+06, 0.101413648249779086E+06, - 0.101412262363096830E+06, 0.101409843816287481E+06, 0.101406792118611833E+06, 0.101403515263375913E+06, 0.101400419883465394E+06, - 0.101397648089374270E+06, 0.101396200071828469E+06, 0.101396462464251483E+06, 0.101399249041504649E+06, 0.101403242459244415E+06, - 0.101408064521844237E+06, 0.101413460579763079E+06, 0.101419299541355576E+06, 0.101425515902185769E+06, 0.101431872156549493E+06, - 0.101438092345517420E+06, 0.101444082593329236E+06, 0.101449980221889302E+06, 0.101455962961780679E+06, 0.101462741205452243E+06, - 0.101470817291088752E+06, 0.101480892587434573E+06, 0.101491089133211004E+06, 0.101500643428374140E+06, 0.101508817670985038E+06, - 0.101514860224122342E+06, 0.101517434476198061E+06, 0.101516541747761323E+06, 0.101513815068472235E+06, 0.101509904719619197E+06, - 0.101505507654049128E+06, 0.101501313463842132E+06, 0.101498849002981064E+06, 0.101499159934514231E+06, 0.101501693020130377E+06, - 0.101506338552975649E+06, 0.101512651659291208E+06, 0.101520288072555239E+06, 0.101527432009874057E+06, 0.101531192551327069E+06, - 0.101528423709889583E+06, 0.101519435532333911E+06, 0.101504734513441072E+06, 0.101484004484384001E+06, 0.101456280732745858E+06, - 0.101419035179553714E+06, 0.101371837096264266E+06, 0.101315248944149382E+06, 0.101249891741609565E+06, 0.101174205010685138E+06, - 0.101095025216710172E+06, 0.101016603839094241E+06, 0.100942714517862012E+06, 0.100875651961458614E+06, 0.100815206600637175E+06, - 0.100762266129504540E+06, 0.100719792923412402E+06, 0.100688381242510412E+06, 0.100664315202569429E+06, 0.100646899315571907E+06, - 0.100636389190856382E+06, 0.100633921317728295E+06, 0.100640986745192960E+06, 0.100657927960284273E+06, 0.100683603999329847E+06, - 0.100715139361547874E+06, 0.100750464071587950E+06, 0.100789001781336541E+06, 0.100828980626378441E+06, 0.100867904881876937E+06, - 0.100901941917073651E+06, 0.100927518925117751E+06, 0.100941703370720032E+06, 0.100943313763502156E+06, 0.100929483993483183E+06, - 0.100897899422321643E+06, 0.100855144068640948E+06, 0.100806216832129357E+06, 0.100757963881253396E+06, 0.100713882396988687E+06, - 0.100678037239657642E+06, 0.100660578064393208E+06, 0.100655660139403961E+06, 0.100663394611081239E+06, 0.100687757803070126E+06, - 0.100726360544964817E+06, 0.100771737117872792E+06, 0.100819550423355045E+06, 0.100863789606076709E+06, 0.100903960982124961E+06, - 0.100937933974381580E+06, 0.100955929021348216E+06, 0.100950002084778927E+06, 0.100936336168784517E+06, 0.100920611799506456E+06, - 0.100908792443247541E+06, 0.100909956087163751E+06, 0.100924519937428529E+06, 0.100950317855032117E+06, 0.100978637481090613E+06, - 0.101001785171553231E+06, 0.101014600980588948E+06, 0.101015533816949537E+06, 0.101004399554267075E+06, 0.100982402170127083E+06, - 0.100954472767269413E+06, 0.100920498290662959E+06, 0.100881272186000555E+06, 0.100838252143924561E+06, 0.100793001524282852E+06, - 0.100749722238879811E+06, 0.100710007831689465E+06, 0.100676561452258436E+06, 0.100651754156739727E+06, 0.100637016515992684E+06, - 0.100632797680647462E+06, 0.100643122435673547E+06, 0.100662040946369423E+06, 0.100684765371038040E+06, 0.100710073382574032E+06, - 0.100736158886730540E+06, 0.100761558107963079E+06, 0.100780935166741401E+06, 0.100798370121153508E+06, 0.100816555152162895E+06, - 0.100835390903751701E+06, 0.100853847765655024E+06, 0.100871757501481305E+06, 0.100888895778612612E+06, 0.100908175229415137E+06, - 0.100925669047910487E+06, 0.101217702072300162E+06, 0.101214879429494846E+06, 0.101212918203238412E+06, 0.101215072363802130E+06, - 0.101218250672383481E+06, 0.101222522132735277E+06, 0.101227622288938786E+06, 0.101233167267756522E+06, 0.101238956389902218E+06, - 0.101244820309774892E+06, 0.101250635435466815E+06, 0.101256335683556361E+06, 0.101261921151622766E+06, 0.101268342600560762E+06, - 0.101275163933372678E+06, 0.101281497833931266E+06, 0.101287383286156546E+06, 0.101292932525330558E+06, 0.101298347923196663E+06, - 0.101303932128846092E+06, 0.101310090422888767E+06, 0.101317693616226330E+06, 0.101327652607175361E+06, 0.101342480557763687E+06, - 0.101358556451299402E+06, 0.101375279086523937E+06, 0.101391978870831925E+06, 0.101407971443584844E+06, 0.101422613121423448E+06, - 0.101435506823643867E+06, 0.101446124078218185E+06, 0.101452234738676838E+06, 0.101455284023688801E+06, 0.101456737369482420E+06, - 0.101456865445288451E+06, 0.101455916182255954E+06, 0.101454121953738781E+06, 0.101451661773156113E+06, 0.101449081947506013E+06, - 0.101446228059309360E+06, 0.101444208961239303E+06, 0.101443612932188233E+06, 0.101444705011359765E+06, 0.101447541270001515E+06, - 0.101452383501387390E+06, 0.101458282693875270E+06, 0.101464997464114887E+06, 0.101472100710916289E+06, 0.101479273864667499E+06, - 0.101486350419971670E+06, 0.101493152086614995E+06, 0.101499576717366377E+06, 0.101505843270561643E+06, 0.101512436676125639E+06, - 0.101519641676807107E+06, 0.101527434410592061E+06, 0.101535644765811841E+06, 0.101545029301612725E+06, 0.101553754432012545E+06, - 0.101560956040866411E+06, 0.101564550165702050E+06, 0.101566892094339870E+06, 0.101567035078111294E+06, 0.101564167039659485E+06, - 0.101560257949168226E+06, 0.101555969226616333E+06, 0.101552313766367617E+06, 0.101550452021603851E+06, 0.101550963150145908E+06, - 0.101553454481203808E+06, 0.101557594737071355E+06, 0.101562591960326725E+06, 0.101568055832384678E+06, 0.101570018237429336E+06, - 0.101568806715803599E+06, 0.101563796324326468E+06, 0.101553825571776295E+06, 0.101537561122490020E+06, 0.101515230788797810E+06, - 0.101485862600308523E+06, 0.101448189650402157E+06, 0.101397681000099896E+06, 0.101336913516701141E+06, 0.101267241010695536E+06, - 0.101189600658946001E+06, 0.101107785950000631E+06, 0.101027329917614610E+06, 0.100951013494106854E+06, 0.100883020611558357E+06, - 0.100825246076290889E+06, 0.100775271676367163E+06, 0.100732070018118597E+06, 0.100693807828755365E+06, 0.100660471847562090E+06, - 0.100632198820324600E+06, 0.100610336348454613E+06, 0.100597445568148105E+06, 0.100596347705297740E+06, 0.100608739289963560E+06, - 0.100632312399144867E+06, 0.100664180492312080E+06, 0.100701580165578795E+06, 0.100742885809197804E+06, 0.100784251808581277E+06, - 0.100822721504335888E+06, 0.100857114729781009E+06, 0.100884974331454141E+06, 0.100904296005382625E+06, 0.100913525976403209E+06, - 0.100909880311948247E+06, 0.100892635225440783E+06, 0.100865034092500646E+06, 0.100830041776689235E+06, 0.100792635237818962E+06, - 0.100758858691726316E+06, 0.100734424708176390E+06, 0.100726153683192097E+06, 0.100729591906647329E+06, 0.100742469628359380E+06, - 0.100772373108355430E+06, 0.100810039805286127E+06, 0.100850865902025442E+06, 0.100889839249818047E+06, 0.100924291493751982E+06, - 0.100954018166122405E+06, 0.100976020229241141E+06, 0.100977598211779696E+06, 0.100962801120868462E+06, 0.100940325812200113E+06, - 0.100915300637579014E+06, 0.100897607613392654E+06, 0.100888545266499175E+06, 0.100887361365753401E+06, 0.100894417619390835E+06, - 0.100914107950286358E+06, 0.100931864535990011E+06, 0.100942729300749750E+06, 0.100943712413188565E+06, 0.100933999633237443E+06, - 0.100915953837210676E+06, 0.100891962587812566E+06, 0.100861290497928669E+06, 0.100825794229352119E+06, 0.100786805648525173E+06, - 0.100747059949918155E+06, 0.100708052571343884E+06, 0.100670389177752746E+06, 0.100637438856290988E+06, 0.100612791553316754E+06, - 0.100598161054412602E+06, 0.100597616745557592E+06, 0.100608245258248513E+06, 0.100627589752602711E+06, 0.100652501052796259E+06, - 0.100677256390096882E+06, 0.100702485105916334E+06, 0.100721371071945381E+06, 0.100737732280855227E+06, 0.100754743779602475E+06, - 0.100772593580461515E+06, 0.100791374419969914E+06, 0.100810897025248196E+06, 0.100830367089737425E+06, 0.100852737881952431E+06, - 0.100874075837282377E+06, 0.100893534157121714E+06, 0.101228070489269143E+06, 0.101227544665406953E+06, 0.101230349746524807E+06, - 0.101234269851944497E+06, 0.101239184467959683E+06, 0.101244939450664504E+06, 0.101251545017166776E+06, 0.101258662705518451E+06, - 0.101265918196699597E+06, 0.101273125560589353E+06, 0.101280152736103031E+06, 0.101286933875186733E+06, 0.101293407125996848E+06, - 0.101299586824039099E+06, 0.101306376779591956E+06, 0.101313623028716072E+06, 0.101320476967868250E+06, 0.101327043370354135E+06, - 0.101333520713772232E+06, 0.101340211822319048E+06, 0.101347526837547412E+06, 0.101356523012281294E+06, 0.101370533287668499E+06, - 0.101386582740267011E+06, 0.101403758993542797E+06, 0.101421430602220105E+06, 0.101438909393433467E+06, 0.101455505881131437E+06, - 0.101470586854150286E+06, 0.101483635012064580E+06, 0.101492144560654036E+06, 0.101497362403152074E+06, 0.101500801900675287E+06, - 0.101502736875093309E+06, 0.101503413235270535E+06, 0.101503062612840484E+06, 0.101501914512809366E+06, 0.101500206465205003E+06, - 0.101497831592138784E+06, 0.101495767534276791E+06, 0.101494714546066039E+06, 0.101495119352637426E+06, 0.101497237786485115E+06, - 0.101501125674684867E+06, 0.101506644060371764E+06, 0.101514150312748505E+06, 0.101522320784248848E+06, 0.101530563331544297E+06, - 0.101538706294350879E+06, 0.101546559377466736E+06, 0.101553946547580461E+06, 0.101560765945043371E+06, 0.101567653265792658E+06, - 0.101574587210003941E+06, 0.101581752742970988E+06, 0.101589174518686996E+06, 0.101596642355671458E+06, 0.101603818859754785E+06, - 0.101610799838750623E+06, 0.101614811522755466E+06, 0.101617790546373333E+06, 0.101619757440904345E+06, 0.101620562545717650E+06, - 0.101618884459059045E+06, 0.101615191240677028E+06, 0.101611483339551589E+06, 0.101608375965291722E+06, 0.101606589668011176E+06, - 0.101606767311590491E+06, 0.101608967585915860E+06, 0.101612347393029107E+06, 0.101614810665037265E+06, 0.101614446811429036E+06, - 0.101613127583126843E+06, 0.101609516694027276E+06, 0.101602475273863849E+06, 0.101591105455035053E+06, 0.101574139304303288E+06, - 0.101552261616850359E+06, 0.101522964529426812E+06, 0.101483809256113498E+06, 0.101431803333729331E+06, 0.101367984772122625E+06, - 0.101295216781381270E+06, 0.101216180859079337E+06, 0.101134418945842335E+06, 0.101057719484696820E+06, 0.100987761361816083E+06, - 0.100925129407695815E+06, 0.100869076127166059E+06, 0.100819148307903684E+06, 0.100772602660554068E+06, 0.100726367887494707E+06, - 0.100682387602061091E+06, 0.100642046686646194E+06, 0.100608073036628615E+06, 0.100583165331615121E+06, 0.100571567333927058E+06, - 0.100579161681519065E+06, 0.100599831523424771E+06, 0.100631457444745640E+06, 0.100671162741316628E+06, 0.100715517300559659E+06, - 0.100759196447210823E+06, 0.100798644466533326E+06, 0.100834218092755124E+06, 0.100864022068452279E+06, 0.100886844670119492E+06, - 0.100903072952249466E+06, 0.100910324635737983E+06, 0.100907110564502160E+06, 0.100894913649374212E+06, 0.100873485872527890E+06, - 0.100847908218072756E+06, 0.100825028815845202E+06, 0.100812235195442801E+06, 0.100811789392154620E+06, 0.100821477468724654E+06, - 0.100842188280174509E+06, 0.100874882105417564E+06, 0.100910352034741096E+06, 0.100944613694273561E+06, 0.100970573806106200E+06, - 0.100992876564753780E+06, 0.101010256709896377E+06, 0.101017365734439736E+06, 0.101004642180764087E+06, 0.100981216767300502E+06, - 0.100950670557522288E+06, 0.100918693714911191E+06, 0.100893168282002865E+06, 0.100873786774855747E+06, 0.100862092518860401E+06, - 0.100858765389723776E+06, 0.100863848594959985E+06, 0.100872455106490743E+06, 0.100880727391939872E+06, 0.100881060958518239E+06, - 0.100871581642927995E+06, 0.100854982629453050E+06, 0.100833968938175327E+06, 0.100809126941723182E+06, 0.100777926015906574E+06, - 0.100744862813125714E+06, 0.100711030659190204E+06, 0.100674920663551122E+06, 0.100638665812651045E+06, 0.100604613640158801E+06, - 0.100577951755037328E+06, 0.100565299257314167E+06, 0.100564490794773781E+06, 0.100574070775104672E+06, 0.100592267906427369E+06, - 0.100616576592620535E+06, 0.100643954138155808E+06, 0.100661679785274406E+06, 0.100676519993234426E+06, 0.100692101751513052E+06, - 0.100708845098980164E+06, 0.100726890359751837E+06, 0.100746088291053093E+06, 0.100766274118497415E+06, 0.100790485020117267E+06, - 0.100814283052694198E+06, 0.100836998900601233E+06, 0.100857834251143926E+06, 0.101239951294366925E+06, 0.101243511198018721E+06, - 0.101248266604097182E+06, 0.101254120739513630E+06, 0.101260940255995316E+06, 0.101268566543099048E+06, 0.101276830453567702E+06, - 0.101285622454819968E+06, 0.101294523809254446E+06, 0.101303237484829937E+06, 0.101311620976720500E+06, 0.101319644374765689E+06, - 0.101327259549206297E+06, 0.101334480948853117E+06, 0.101341388354789131E+06, 0.101348710884544664E+06, 0.101356521517190282E+06, - 0.101364093945627537E+06, 0.101371621643877312E+06, 0.101379408199202080E+06, 0.101388443315429948E+06, 0.101401687552132498E+06, - 0.101416572004818678E+06, 0.101433189992554107E+06, 0.101451428970825116E+06, 0.101470024045938291E+06, 0.101488255659360628E+06, - 0.101505416028128879E+06, 0.101520868917434069E+06, 0.101531842805264969E+06, 0.101539245769958565E+06, 0.101544605958666289E+06, - 0.101548569302459247E+06, 0.101551134535491103E+06, 0.101552518676128384E+06, 0.101552933361419549E+06, 0.101552598628048305E+06, - 0.101551346091754502E+06, 0.101549620534837697E+06, 0.101548503290274006E+06, 0.101548531268210281E+06, 0.101550086213979870E+06, - 0.101553415865284071E+06, 0.101558574308658994E+06, 0.101566141420655156E+06, 0.101575323430362041E+06, 0.101584790524686381E+06, - 0.101594148506046142E+06, 0.101603272905442951E+06, 0.101611945735174741E+06, 0.101619979003416622E+06, 0.101627204805596586E+06, - 0.101634427668451928E+06, 0.101641404911077247E+06, 0.101648381901037224E+06, 0.101655340222651532E+06, 0.101662034474683896E+06, - 0.101666783103935741E+06, 0.101669591715802919E+06, 0.101672592019255666E+06, 0.101674896474706766E+06, 0.101676486613950226E+06, - 0.101677173545713507E+06, 0.101676735064566892E+06, 0.101674421820609132E+06, 0.101671063643987713E+06, 0.101668202552547300E+06, - 0.101666520557556054E+06, 0.101666348434875123E+06, 0.101667923680669555E+06, 0.101669351667803800E+06, 0.101668978131977754E+06, - 0.101666110028333933E+06, 0.101660538752964931E+06, 0.101654594444694463E+06, 0.101645738692219165E+06, 0.101634351733125281E+06, - 0.101619445806351592E+06, 0.101597486529762551E+06, 0.101566963080607631E+06, 0.101526313623151611E+06, 0.101474414132893216E+06, - 0.101408806070782084E+06, 0.101334676336432865E+06, 0.101255967485764850E+06, 0.101177930379907673E+06, 0.101105923487214692E+06, - 0.101041528067973224E+06, 0.100984421243628807E+06, 0.100931366999700622E+06, 0.100882259035952666E+06, 0.100834318510275116E+06, - 0.100780975023316409E+06, 0.100725029283105585E+06, 0.100672125573187601E+06, 0.100626333648281943E+06, 0.100591108252538659E+06, - 0.100571154519613207E+06, 0.100572764811242494E+06, 0.100590644123334263E+06, 0.100622114840101916E+06, 0.100663170419413218E+06, - 0.100711109304953105E+06, 0.100759450274770090E+06, 0.100803668821019484E+06, 0.100843723009858411E+06, 0.100878065056743988E+06, - 0.100905193898488564E+06, 0.100924238150348683E+06, 0.100935705112497482E+06, 0.100940040808540827E+06, 0.100938611611957211E+06, - 0.100929132041696241E+06, 0.100917754954705204E+06, 0.100905818223427166E+06, 0.100905472653716875E+06, 0.100913513200435162E+06, - 0.100929234171202479E+06, 0.100956672791980032E+06, 0.100989933744260285E+06, 0.101021721049159081E+06, 0.101045261345619481E+06, - 0.101056484086316414E+06, 0.101064376750130497E+06, 0.101068662292293593E+06, 0.101058850049314118E+06, 0.101036734626105259E+06, - 0.101005396099047648E+06, 0.100967551751069492E+06, 0.100930584068150943E+06, 0.100895049839971194E+06, 0.100865689126530953E+06, - 0.100843766391791884E+06, 0.100833519035555830E+06, 0.100830429319700765E+06, 0.100830534716874317E+06, 0.100831218872075027E+06, - 0.100828733033744793E+06, 0.100816736999957517E+06, 0.100801115692818625E+06, 0.100782650624359696E+06, 0.100761638271208169E+06, - 0.100739079948099330E+06, 0.100715508303584225E+06, 0.100685570121976882E+06, 0.100651926936336182E+06, 0.100616808436076797E+06, - 0.100582738088950529E+06, 0.100553609533300842E+06, 0.100536151852068826E+06, 0.100533191840017098E+06, 0.100540563795043839E+06, - 0.100556547268302660E+06, 0.100578647827983019E+06, 0.100597845282151320E+06, 0.100615643951716338E+06, 0.100629644958407152E+06, - 0.100644649717624998E+06, 0.100661314686951257E+06, 0.100679739011681770E+06, 0.100699923738231213E+06, 0.100724000291545439E+06, - 0.100748935934403649E+06, 0.100773460147275109E+06, 0.100796886100017015E+06, 0.100818431742268527E+06, 0.101253250319671861E+06, - 0.101258941275491015E+06, 0.101265825984074268E+06, 0.101273785992740712E+06, 0.101282673338371926E+06, 0.101292322337458594E+06, - 0.101302564811119126E+06, 0.101313249084015886E+06, 0.101324039732978374E+06, 0.101334420443956798E+06, 0.101344441355969844E+06, - 0.101353937804033951E+06, 0.101362853548466621E+06, 0.101371239996888005E+06, 0.101379195223571107E+06, 0.101386868114858662E+06, - 0.101394863418320267E+06, 0.101403421459721620E+06, 0.101411971625535502E+06, 0.101421328676152989E+06, 0.101434052612144369E+06, - 0.101448448578493975E+06, 0.101464428560022046E+06, 0.101481780318751698E+06, 0.101500377161328623E+06, 0.101519861969620310E+06, - 0.101538794301281392E+06, 0.101556432572582416E+06, 0.101569913275213607E+06, 0.101580111679331065E+06, 0.101588077608188687E+06, - 0.101593761388586005E+06, 0.101597743292873696E+06, 0.101601111211300595E+06, 0.101603375473686290E+06, 0.101604722386775393E+06, - 0.101605277974446421E+06, 0.101605137189286179E+06, 0.101604583774228318E+06, 0.101604027662526438E+06, 0.101605032612257637E+06, - 0.101607890648949600E+06, 0.101612610274943596E+06, 0.101620190413487217E+06, 0.101629709918692257E+06, 0.101640274485895483E+06, - 0.101651366271263018E+06, 0.101662017372317307E+06, 0.101672127532921921E+06, 0.101681639836175294E+06, 0.101689695653715113E+06, - 0.101697371401130935E+06, 0.101704816287710346E+06, 0.101711959261812881E+06, 0.101718592829194225E+06, 0.101724976617920722E+06, - 0.101729049321389990E+06, 0.101731107282530153E+06, 0.101732743234520705E+06, 0.101734177642089810E+06, 0.101735792298410903E+06, - 0.101737051523103568E+06, 0.101737813506062157E+06, 0.101737771770358304E+06, 0.101736766611527375E+06, 0.101733998643601444E+06, - 0.101731285447018498E+06, 0.101729657615879667E+06, 0.101729463824108592E+06, 0.101730467776220365E+06, 0.101730634889909721E+06, - 0.101728530424326527E+06, 0.101723478773003560E+06, 0.101715128998538450E+06, 0.101705173881448645E+06, 0.101697065128410613E+06, - 0.101686174729378530E+06, 0.101670746397321127E+06, 0.101648602916028351E+06, 0.101617289856162359E+06, 0.101575677936215157E+06, - 0.101523549414822643E+06, 0.101459384090740117E+06, 0.101385766535040675E+06, 0.101307806220871105E+06, 0.101230532040925333E+06, - 0.101163615695121596E+06, 0.101105144301163149E+06, 0.101053953064553687E+06, 0.101004506092646785E+06, 0.100954394425546445E+06, - 0.100903265851270029E+06, 0.100843568326323351E+06, 0.100779909310060830E+06, 0.100718507897475429E+06, 0.100663227538561507E+06, - 0.100619196470881463E+06, 0.100590878309716514E+06, 0.100585918330994056E+06, 0.100599670235220139E+06, 0.100629367268692309E+06, - 0.100671559948193928E+06, 0.100722625470161831E+06, 0.100775876461740903E+06, 0.100826307692812305E+06, 0.100872731273009820E+06, - 0.100911769660482067E+06, 0.100942401025764135E+06, 0.100964392752327054E+06, 0.100978678374194351E+06, 0.100986716960824007E+06, - 0.100990258819483715E+06, 0.100986859094204920E+06, 0.100984358423690996E+06, 0.100986880945730183E+06, 0.101001308030144719E+06, - 0.101021911204537639E+06, 0.101045314756852677E+06, 0.101079374563270016E+06, 0.101112057664106265E+06, 0.101138492426304845E+06, - 0.101147264582452117E+06, 0.101146181575950890E+06, 0.101139597898295426E+06, 0.101126956426191653E+06, 0.101104207044017559E+06, - 0.101074184746976593E+06, 0.101036351784390296E+06, 0.100994839802225833E+06, 0.100951701131987342E+06, 0.100907802015808338E+06, - 0.100866623322513595E+06, 0.100836261177509557E+06, 0.100817609325104844E+06, 0.100806057949370603E+06, 0.100799101756952587E+06, - 0.100794178922864405E+06, 0.100782586521973222E+06, 0.100770278560914870E+06, 0.100755730874395027E+06, 0.100740174567162278E+06, - 0.100724221891415305E+06, 0.100711960802472036E+06, 0.100695201938734870E+06, 0.100670904548085469E+06, 0.100639130264881242E+06, - 0.100604667725497551E+06, 0.100569533181772116E+06, 0.100538827586813903E+06, 0.100515863557522040E+06, 0.100504283432544311E+06, - 0.100508208880423437E+06, 0.100520846592849106E+06, 0.100533319890499857E+06, 0.100546979620563667E+06, 0.100563406036921282E+06, - 0.100581336883139578E+06, 0.100596479945475046E+06, 0.100613263609396352E+06, 0.100632606505272503E+06, 0.100655737101977575E+06, - 0.100680377627359165E+06, 0.100705693019706334E+06, 0.100730567542817560E+06, 0.100753963268230000E+06, 0.100775475443369112E+06, - 0.101264306669592683E+06, 0.101273005643247234E+06, 0.101282212261941575E+06, 0.101292455230279535E+06, 0.101303569666892407E+06, - 0.101315379627821021E+06, 0.101327713762651794E+06, 0.101340424766245633E+06, 0.101353413011349316E+06, 0.101366215214067837E+06, - 0.101378003241061873E+06, 0.101389048142805594E+06, 0.101399358057326695E+06, 0.101408993909155237E+06, 0.101418071350073515E+06, - 0.101426765747085621E+06, 0.101435320572288721E+06, 0.101444230417056518E+06, 0.101454115342003613E+06, 0.101466281775386233E+06, - 0.101480018815107192E+06, 0.101495370152025978E+06, 0.101512249092142942E+06, 0.101530457200416044E+06, 0.101549717357720714E+06, - 0.101569710093644739E+06, 0.101589282549966229E+06, 0.101605011230739328E+06, 0.101617835360473735E+06, 0.101628768238586897E+06, - 0.101637571031423722E+06, 0.101644166338589697E+06, 0.101648697806602591E+06, 0.101651881208006424E+06, 0.101655220484862148E+06, - 0.101657859335835557E+06, 0.101659761085947117E+06, 0.101661032940759702E+06, 0.101661921699332699E+06, 0.101662809971163108E+06, - 0.101664227024246793E+06, 0.101667989933228542E+06, 0.101675508452427108E+06, 0.101685268933038969E+06, 0.101696374945899413E+06, - 0.101708376350831662E+06, 0.101720741353243910E+06, 0.101732914311869565E+06, 0.101744191311434886E+06, 0.101753679207339199E+06, - 0.101762383198229145E+06, 0.101770484632283566E+06, 0.101778058653469430E+06, 0.101785052189110153E+06, 0.101791286685933344E+06, - 0.101795171487182030E+06, 0.101797156941597103E+06, 0.101798421280143026E+06, 0.101799261614609830E+06, 0.101799803038408485E+06, - 0.101800210895802447E+06, 0.101801683280290250E+06, 0.101802630829050468E+06, 0.101802543397740184E+06, 0.101801482357017914E+06, - 0.101799624587932572E+06, 0.101797066559983883E+06, 0.101795799625004249E+06, 0.101795785922852519E+06, 0.101796374037248344E+06, - 0.101796548441705847E+06, 0.101793091799900605E+06, 0.101786346983049574E+06, 0.101776575607877137E+06, 0.101765049283969143E+06, - 0.101754303368654233E+06, 0.101742481241294314E+06, 0.101726517364683619E+06, 0.101704526213350880E+06, 0.101673251963278643E+06, - 0.101631549642581842E+06, 0.101579630218674371E+06, 0.101517751331919892E+06, 0.101445587957413649E+06, 0.101369276534187840E+06, - 0.101293749197962985E+06, 0.101228845743408630E+06, 0.101175974072217723E+06, 0.101128069068520213E+06, 0.101080672101220363E+06, - 0.101030554297062597E+06, 0.100978255877595599E+06, 0.100917786384446328E+06, 0.100848380590802917E+06, 0.100779685419598463E+06, - 0.100716993576480047E+06, 0.100665449877585226E+06, 0.100628730188585745E+06, 0.100616768912061103E+06, 0.100625017647516172E+06, - 0.100651010955717982E+06, 0.100693983128488617E+06, 0.100748028718061119E+06, 0.100807126354548294E+06, 0.100865743222122503E+06, - 0.100920280263948240E+06, 0.100963697339721592E+06, 0.100996625031755175E+06, 0.101020588466931018E+06, 0.101034801756696354E+06, - 0.101044107550953762E+06, 0.101050001068824189E+06, 0.101053046373654055E+06, 0.101058552912032319E+06, 0.101072171257776601E+06, - 0.101095588999532294E+06, 0.101124462408449937E+06, 0.101159998252541394E+06, 0.101199939829214418E+06, 0.101233511940909040E+06, - 0.101250548981260363E+06, 0.101245238633873159E+06, 0.101231967019851887E+06, 0.101212524735667932E+06, 0.101187116747768814E+06, - 0.101155254569723096E+06, 0.101117728069520774E+06, 0.101075849861174778E+06, 0.101031454770778844E+06, 0.100982633468066182E+06, - 0.100931817382534617E+06, 0.100883044212189372E+06, 0.100842431678571462E+06, 0.100810753030772234E+06, 0.100790307235783985E+06, - 0.100775641660991605E+06, 0.100758065719658363E+06, 0.100742431929372280E+06, 0.100730276589137924E+06, 0.100719950891765460E+06, - 0.100707897196450547E+06, 0.100704034450479885E+06, 0.100696304475012279E+06, 0.100682955042842383E+06, 0.100662970635189646E+06, - 0.100635257255516670E+06, 0.100598919177042175E+06, 0.100561998994079375E+06, 0.100529207116205667E+06, 0.100503120931424841E+06, - 0.100485371253469493E+06, 0.100478084387816067E+06, 0.100480161528695491E+06, 0.100486330170588408E+06, 0.100497656033703854E+06, - 0.100512793940874559E+06, 0.100530267502319883E+06, 0.100548674998529634E+06, 0.100566870164484106E+06, 0.100588713074028346E+06, - 0.100612035752629497E+06, 0.100636570551070865E+06, 0.100661555413946771E+06, 0.100685975940573393E+06, 0.100708805081237850E+06, - 0.100728426698084644E+06, 0.101271996036762896E+06, 0.101284449704480561E+06, 0.101296689346213228E+06, 0.101309400454198360E+06, - 0.101322901055611903E+06, 0.101337001192974072E+06, 0.101351521575208899E+06, 0.101366313393139906E+06, 0.101382034494546009E+06, - 0.101397351776588475E+06, 0.101411443443270473E+06, 0.101424117470686309E+06, 0.101435883616085790E+06, 0.101446811616959909E+06, - 0.101457033181746156E+06, 0.101466747751913790E+06, 0.101476231696805597E+06, 0.101486021283400187E+06, 0.101497396375811921E+06, - 0.101510400207985600E+06, 0.101524923388815208E+06, 0.101540994381505661E+06, 0.101558520228044814E+06, 0.101577305318149651E+06, - 0.101597084529118074E+06, 0.101617572913645636E+06, 0.101635935716414897E+06, 0.101650985317801838E+06, 0.101664666828709975E+06, - 0.101676613583561295E+06, 0.101686531498022989E+06, 0.101694300750966708E+06, 0.101700039232711759E+06, 0.101704155496819658E+06, - 0.101707559871844016E+06, 0.101711706616868032E+06, 0.101715220819953611E+06, 0.101718183769718671E+06, 0.101720797579619655E+06, - 0.101723413797095534E+06, 0.101726548168837966E+06, 0.101732421109602874E+06, 0.101741180387240456E+06, 0.101752626090808626E+06, - 0.101765327683930620E+06, 0.101778794125947126E+06, 0.101792465254962983E+06, 0.101805759257347163E+06, 0.101817578749370528E+06, - 0.101828002210067600E+06, 0.101837310759124710E+06, 0.101845770211075462E+06, 0.101853420566787143E+06, 0.101860181736826940E+06, - 0.101864213062694500E+06, 0.101866574115216965E+06, 0.101867875008511299E+06, 0.101868524705411764E+06, 0.101868825959176160E+06, - 0.101868919433276926E+06, 0.101869678539425964E+06, 0.101870695483190138E+06, 0.101871330785532584E+06, 0.101870979213963699E+06, - 0.101869675931957303E+06, 0.101867574002842535E+06, 0.101865625644742016E+06, 0.101864444239763863E+06, 0.101864129871809724E+06, - 0.101864253411905665E+06, 0.101863863423935647E+06, 0.101861147095331355E+06, 0.101853046503827805E+06, 0.101842469691830149E+06, - 0.101829793173113096E+06, 0.101815148158582204E+06, 0.101801721489973846E+06, 0.101784969966993638E+06, 0.101762516553084497E+06, - 0.101733198141890345E+06, 0.101692387931239413E+06, 0.101641579160683832E+06, 0.101581604629232388E+06, 0.101513447361368249E+06, - 0.101440920474624741E+06, 0.101370696075984946E+06, 0.101305428265875380E+06, 0.101254160309156374E+06, 0.101207383873920160E+06, - 0.101161789898628529E+06, 0.101111489873579616E+06, 0.101058073620173833E+06, 0.100998431410120465E+06, 0.100925178881860134E+06, - 0.100851277940204382E+06, 0.100782887728638991E+06, 0.100724637342850445E+06, 0.100681654247053943E+06, 0.100660743763258797E+06, - 0.100662241191619672E+06, 0.100684600997945701E+06, 0.100726431789378737E+06, 0.100783621753223240E+06, 0.100850165592330639E+06, - 0.100919393459606828E+06, 0.100984663126731160E+06, 0.101035581217426865E+06, 0.101073289555574971E+06, 0.101097883508170984E+06, - 0.101109275635634360E+06, 0.101115535689499287E+06, 0.101120721213043289E+06, 0.101127445332507938E+06, 0.101138555650677066E+06, - 0.101162386128591490E+06, 0.101193764958060041E+06, 0.101229324100487633E+06, 0.101272586038755646E+06, 0.101314017050708091E+06, - 0.101345307647537833E+06, 0.101350681405921583E+06, 0.101336274552223433E+06, 0.101312002659208913E+06, 0.101282108941999220E+06, - 0.101247511268828879E+06, 0.101208775326433519E+06, 0.101166118942493005E+06, 0.101124324087716755E+06, 0.101077097855417393E+06, - 0.101023493736806588E+06, 0.100966370678116829E+06, 0.100910649732596605E+06, 0.100860956183662900E+06, 0.100818859583747035E+06, - 0.100784487610509677E+06, 0.100755633857502806E+06, 0.100730268695456398E+06, 0.100710865638861083E+06, 0.100697679049610029E+06, - 0.100690061794109570E+06, 0.100696089852752222E+06, 0.100696921102593260E+06, 0.100692632540626320E+06, 0.100681762801710865E+06, - 0.100663264802660036E+06, 0.100633791904004815E+06, 0.100597430688150896E+06, 0.100559133196241281E+06, 0.100524051576254133E+06, - 0.100494743325319461E+06, 0.100472843717532320E+06, 0.100453469270866597E+06, 0.100441938855850953E+06, 0.100444602587366870E+06, - 0.100453700278505523E+06, 0.100467703647186674E+06, 0.100484865751373640E+06, 0.100504556800278908E+06, 0.100526747147881411E+06, - 0.100548342492759344E+06, 0.100570928110482331E+06, 0.100594499129673175E+06, 0.100618314768352022E+06, 0.100641358389098648E+06, - 0.100661048545089099E+06, 0.100674922441404182E+06, 0.101277440454925483E+06, 0.101292275045881630E+06, 0.101308217918252703E+06, - 0.101324032641650105E+06, 0.101340083417949048E+06, 0.101356599817204507E+06, 0.101373389242319026E+06, 0.101391680572806275E+06, - 0.101409655246696246E+06, 0.101426966070523806E+06, 0.101443353143514600E+06, 0.101458277199001546E+06, 0.101471528522387307E+06, - 0.101483748681189623E+06, 0.101495083125874895E+06, 0.101505752090554262E+06, 0.101516050089151657E+06, 0.101526815975076141E+06, - 0.101538795327266271E+06, 0.101552338028206417E+06, 0.101567404995926277E+06, 0.101583932457588046E+06, 0.101601812845274559E+06, - 0.101620841504076889E+06, 0.101640749378202716E+06, 0.101659290500403222E+06, 0.101676771795349603E+06, 0.101693884723980591E+06, - 0.101708998663612001E+06, 0.101722276078936207E+06, 0.101733606252533034E+06, 0.101742808520292456E+06, 0.101749958233873534E+06, - 0.101756733187784732E+06, 0.101761976313215302E+06, 0.101765600227458519E+06, 0.101770624962746049E+06, 0.101775587804667244E+06, - 0.101780223730697457E+06, 0.101784845963681015E+06, 0.101792019560120360E+06, 0.101800861910829000E+06, 0.101810238167576026E+06, - 0.101821334626365482E+06, 0.101835649384848730E+06, 0.101850599319270405E+06, 0.101865571025550424E+06, 0.101879726510542314E+06, - 0.101892673462390783E+06, 0.101903975174055988E+06, 0.101913651691837455E+06, 0.101922403262289721E+06, 0.101930066269132934E+06, - 0.101934959838625931E+06, 0.101938013574382479E+06, 0.101939867945920269E+06, 0.101940768404829549E+06, 0.101940976512875422E+06, - 0.101940974808985324E+06, 0.101941915218950715E+06, 0.101942796779357042E+06, 0.101943325071244180E+06, 0.101943321289824438E+06, - 0.101942520685581403E+06, 0.101940795734215877E+06, 0.101938328485986989E+06, 0.101936102913573559E+06, 0.101934189161022412E+06, - 0.101933270983365946E+06, 0.101932726854111810E+06, 0.101931071080041162E+06, 0.101927390375963005E+06, 0.101920782487591568E+06, - 0.101909599976852041E+06, 0.101896034018928112E+06, 0.101880121030327078E+06, 0.101861777722108454E+06, 0.101843441866567693E+06, - 0.101821175828396939E+06, 0.101793162871491804E+06, 0.101756243381197477E+06, 0.101707526053893132E+06, 0.101651390637597418E+06, - 0.101591096250860501E+06, 0.101525066978488496E+06, 0.101457842460151805E+06, 0.101392749867658815E+06, 0.101338205739929384E+06, - 0.101290789521037383E+06, 0.101243732978547458E+06, 0.101191560328100386E+06, 0.101135333560209707E+06, 0.101074991868799916E+06, - 0.101002789603246347E+06, 0.100928035016280875E+06, 0.100857779212484500E+06, 0.100794984785666602E+06, 0.100746221294778152E+06, - 0.100717266126841918E+06, 0.100710869212579069E+06, 0.100726313373954297E+06, 0.100765862955971417E+06, 0.100824009621681325E+06, - 0.100896074483335498E+06, 0.100975156087370415E+06, 0.101050862045185830E+06, 0.101108616996395343E+06, 0.101151397540630162E+06, - 0.101177118649863274E+06, 0.101187234876946401E+06, 0.101192189574432836E+06, 0.101198920872520132E+06, 0.101209271572763842E+06, - 0.101225853188380381E+06, 0.101255763867716960E+06, 0.101292205782835576E+06, 0.101333769433737034E+06, 0.101380487686360808E+06, - 0.101421196585383368E+06, 0.101445943578677994E+06, 0.101442593076884281E+06, 0.101422753739062216E+06, 0.101390520324852318E+06, - 0.101350761888702051E+06, 0.101308120360709363E+06, 0.101265074031475204E+06, 0.101223556150358476E+06, 0.101181059083197164E+06, - 0.101131282154724337E+06, 0.101073985674786556E+06, 0.101009316519365500E+06, 0.100945620806578852E+06, 0.100887564966803198E+06, - 0.100836870701820939E+06, 0.100791306568270127E+06, 0.100748587002241606E+06, 0.100714275195360678E+06, 0.100691096015225994E+06, - 0.100677036214206237E+06, 0.100679656532840978E+06, 0.100689403954963505E+06, 0.100699806241966638E+06, 0.100699758014009334E+06, - 0.100690385161567290E+06, 0.100668712287826143E+06, 0.100636906386880102E+06, 0.100599766534639755E+06, 0.100560426804608782E+06, - 0.100523011227441762E+06, 0.100490487333571364E+06, 0.100458484377625064E+06, 0.100433836484664062E+06, 0.100418321599970062E+06, - 0.100412076649917391E+06, 0.100419080629848453E+06, 0.100432241000389156E+06, 0.100450792482229837E+06, 0.100472305642769512E+06, - 0.100493869619492121E+06, 0.100514430080734746E+06, 0.100535036793476407E+06, 0.100556629184451856E+06, 0.100578314394928922E+06, - 0.100596991295179905E+06, 0.100611500340730694E+06, 0.100623274306907668E+06, 0.101280196625301396E+06, 0.101297364868656936E+06, - 0.101315860426329833E+06, 0.101335437548964052E+06, 0.101354738212366676E+06, 0.101373945822871654E+06, 0.101394704590563779E+06, - 0.101415369573864707E+06, 0.101435547066077095E+06, 0.101454900560777067E+06, 0.101473156717428967E+06, 0.101490111858949429E+06, - 0.101505426648419336E+06, 0.101518896733282789E+06, 0.101531260767964472E+06, 0.101542531309453814E+06, 0.101553164954199878E+06, - 0.101564411925864319E+06, 0.101576767311889984E+06, 0.101590613786174377E+06, 0.101606186426911474E+06, 0.101622949542643095E+06, - 0.101640870734518088E+06, 0.101659778611533140E+06, 0.101677671599300767E+06, 0.101695145189232746E+06, 0.101713022490742442E+06, - 0.101730968458130665E+06, 0.101748633328473559E+06, 0.101764332593418454E+06, 0.101777415582760368E+06, 0.101788327636173344E+06, - 0.101798745459491343E+06, 0.101807854686651277E+06, 0.101815215507054876E+06, 0.101821043040616947E+06, 0.101825884968623417E+06, - 0.101832189148969264E+06, 0.101839168448648401E+06, 0.101848045440598347E+06, 0.101858730804693652E+06, 0.101869959329435806E+06, - 0.101881533268110448E+06, 0.101893454722194554E+06, 0.101906437265534973E+06, 0.101922905509709031E+06, 0.101939197745689977E+06, - 0.101954795923734462E+06, 0.101969009671704334E+06, 0.101981310726737574E+06, 0.101991415766123711E+06, 0.101999594743156573E+06, - 0.102005976491342561E+06, 0.102010334316063047E+06, 0.102013157295944911E+06, 0.102014722383416287E+06, 0.102015313093490025E+06, - 0.102015201185307524E+06, 0.102016512237083880E+06, 0.102017510782104568E+06, 0.102018055903560264E+06, 0.102018084579591843E+06, - 0.102017466339170613E+06, 0.102015842014936527E+06, 0.102013009808558825E+06, 0.102010188377710918E+06, 0.102007504920719613E+06, - 0.102004842449303280E+06, 0.102002010784629019E+06, 0.101999472815438930E+06, 0.101995912864510945E+06, 0.101991527724094442E+06, - 0.101985699759707655E+06, 0.101975812995855114E+06, 0.101961537246313150E+06, 0.101943695019863866E+06, 0.101923033375715851E+06, - 0.101901362121280530E+06, 0.101879075837123033E+06, 0.101852284874085046E+06, 0.101819539147717020E+06, 0.101776999589703846E+06, - 0.101726785900868257E+06, 0.101671557646898407E+06, 0.101612042588822980E+06, 0.101548622762663115E+06, 0.101485284216076703E+06, - 0.101425147441038411E+06, 0.101373420817102917E+06, 0.101321191476503751E+06, 0.101266538752380700E+06, 0.101208938335707280E+06, - 0.101148533319442722E+06, 0.101080582757091557E+06, 0.101007172321080754E+06, 0.100937106866050381E+06, 0.100872650853732252E+06, - 0.100818490092161403E+06, 0.100780581038449120E+06, 0.100763989069985822E+06, 0.100769172528104478E+06, 0.100801781036641652E+06, - 0.100856282722816642E+06, 0.100929221528193739E+06, 0.101013884730459817E+06, 0.101097563707576744E+06, 0.101162534274172547E+06, - 0.101213486478638646E+06, 0.101244516559525029E+06, 0.101257648408437890E+06, 0.101263733502884890E+06, 0.101275510052246449E+06, - 0.101290762661853529E+06, 0.101314197491016195E+06, 0.101347943558257903E+06, 0.101386651316440679E+06, 0.101430443429601510E+06, - 0.101475669896804160E+06, 0.101514950055520574E+06, 0.101531515938051540E+06, 0.101524788957272292E+06, 0.101501664340208648E+06, - 0.101465580088908755E+06, 0.101421732802947983E+06, 0.101374184582676520E+06, 0.101328046898908578E+06, 0.101289807901878230E+06, - 0.101246491413997268E+06, 0.101194778317482283E+06, 0.101131646224091921E+06, 0.101060205833383836E+06, 0.100988174374432070E+06, - 0.100922370979696687E+06, 0.100863854824209222E+06, 0.100809964699915654E+06, 0.100761271524313197E+06, 0.100719104259046479E+06, - 0.100686430395430245E+06, 0.100678847862221184E+06, 0.100683138663107515E+06, 0.100693073794055832E+06, 0.100704133264039236E+06, - 0.100711587564049987E+06, 0.100702838554374641E+06, 0.100679156446423745E+06, 0.100646910483054933E+06, 0.100608627281804467E+06, - 0.100567412671928309E+06, 0.100526528285293534E+06, 0.100483943399388023E+06, 0.100448443665773972E+06, 0.100421899539395425E+06, - 0.100404924203073868E+06, 0.100397063255380912E+06, 0.100397195586259491E+06, 0.100412985650041403E+06, 0.100432834475288488E+06, - 0.100453366207182436E+06, 0.100473356439391355E+06, 0.100491742373035304E+06, 0.100507905429383289E+06, 0.100525814076571885E+06, - 0.100542096974396103E+06, 0.100555812166254138E+06, 0.100567395231908740E+06, 0.100576579149565121E+06, 0.101279908089260382E+06, - 0.101299372851355220E+06, 0.101320345227797603E+06, 0.101342568251312987E+06, 0.101366203167707048E+06, 0.101390159455080997E+06, - 0.101413541104309363E+06, 0.101436670068180945E+06, 0.101459134145086064E+06, 0.101480579621756508E+06, 0.101500717501762701E+06, - 0.101519330301993643E+06, 0.101536279443531355E+06, 0.101551434684382868E+06, 0.101564255195383463E+06, 0.101575422887434994E+06, - 0.101586445548099669E+06, 0.101597902131166629E+06, 0.101610316943178666E+06, 0.101624105975331244E+06, 0.101639540620591506E+06, - 0.101656731770743747E+06, 0.101674690803331439E+06, 0.101691335236531100E+06, 0.101707821449698851E+06, 0.101725245164068649E+06, - 0.101743396815362881E+06, 0.101762005533747782E+06, 0.101780794703432257E+06, 0.101799566956391791E+06, 0.101816729089967106E+06, - 0.101830810115947446E+06, 0.101843847767199652E+06, 0.101855309960108818E+06, 0.101865083082604426E+06, 0.101873349177960990E+06, - 0.101880647099664595E+06, 0.101887932618480903E+06, 0.101897799286328358E+06, 0.101910318475203370E+06, 0.101923741945953618E+06, - 0.101937617512615703E+06, 0.101951634884124011E+06, 0.101965709346062926E+06, 0.101980052214833602E+06, 0.101995075682068244E+06, - 0.102012705906177565E+06, 0.102029916826673259E+06, 0.102045578980748891E+06, 0.102059048316380504E+06, 0.102069947174644665E+06, - 0.102077684357740349E+06, 0.102082147312762972E+06, 0.102086500261915091E+06, 0.102089248935513198E+06, 0.102090698933738371E+06, - 0.102091178364924752E+06, 0.102092701245381337E+06, 0.102093815457381104E+06, 0.102094368575754212E+06, 0.102094331459262947E+06, - 0.102093649378548696E+06, 0.102091495160413397E+06, 0.102088077118329078E+06, 0.102085266715555787E+06, 0.102082068081696532E+06, - 0.102078934857918081E+06, 0.102075562114887900E+06, 0.102070631820974115E+06, 0.102064438122544176E+06, 0.102059414174384161E+06, - 0.102053827822841413E+06, 0.102047097203453392E+06, 0.102038205276517619E+06, 0.102023970080276820E+06, 0.102005255572377879E+06, - 0.101983545280989390E+06, 0.101959239559772468E+06, 0.101934934813177606E+06, 0.101909416211695381E+06, 0.101879530216405619E+06, - 0.101843729384204227E+06, 0.101798771374156902E+06, 0.101749131431232046E+06, 0.101696435747962270E+06, 0.101638597439857098E+06, - 0.101576958615739393E+06, 0.101514239708325505E+06, 0.101456190833159548E+06, 0.101399554349585407E+06, 0.101340424142701784E+06, - 0.101280446676456311E+06, 0.101219442303719290E+06, 0.101155802903883246E+06, 0.101085010925495619E+06, 0.101016127520053677E+06, - 0.100949559692596478E+06, 0.100889898302085116E+06, 0.100844209040313392E+06, 0.100816129681629769E+06, 0.100810501379105452E+06, - 0.100832591111220638E+06, 0.100879523722449056E+06, 0.100948063089510324E+06, 0.101031460853947981E+06, 0.101115973986060417E+06, - 0.101184231818201646E+06, 0.101240245990651732E+06, 0.101276004337181133E+06, 0.101297693264287940E+06, 0.101316108838536718E+06, - 0.101339338207326771E+06, 0.101364838726589573E+06, 0.101398212697034352E+06, 0.101435020262566584E+06, 0.101474120214935858E+06, - 0.101515374742090018E+06, 0.101554913896900893E+06, 0.101585525309637247E+06, 0.101596313029333352E+06, 0.101591763310596391E+06, - 0.101572063905601564E+06, 0.101533915795807872E+06, 0.101488864498615381E+06, 0.101440950048410057E+06, 0.101401964815710235E+06, - 0.101362939393266570E+06, 0.101319118725317487E+06, 0.101264253224874032E+06, 0.101194604583161839E+06, 0.101119529697804493E+06, - 0.101043148821796305E+06, 0.100969817218776385E+06, 0.100904222807714512E+06, 0.100845424566366739E+06, 0.100792297539129795E+06, - 0.100746429506127941E+06, 0.100716119483396033E+06, 0.100699086889567552E+06, 0.100699855109205411E+06, 0.100707310375888119E+06, - 0.100716570575528633E+06, 0.100720007898216936E+06, 0.100714797932772417E+06, 0.100695727134459230E+06, 0.100662985850684985E+06, - 0.100623495462979961E+06, 0.100579571082265902E+06, 0.100528287659914175E+06, 0.100483047690553038E+06, 0.100446858129451386E+06, - 0.100420432087088702E+06, 0.100404117469529898E+06, 0.100397105480157465E+06, 0.100403234638665162E+06, 0.100415020179178769E+06, - 0.100433067114222082E+06, 0.100451452530888302E+06, 0.100468854497717490E+06, 0.100484113018387754E+06, 0.100496513635322510E+06, - 0.100504396642556661E+06, 0.100514796346128511E+06, 0.100524493045942218E+06, 0.100532404153307187E+06, 0.100538289704171490E+06, - 0.101276336252575435E+06, 0.101298080414544456E+06, 0.101321469561098274E+06, 0.101347127563797287E+06, 0.101375017595738012E+06, - 0.101402741686854177E+06, 0.101429372639699533E+06, 0.101455094154428705E+06, 0.101479936738935212E+06, 0.101503527247806051E+06, - 0.101525558424067625E+06, 0.101545795970329476E+06, 0.101564086253569083E+06, 0.101579860400036196E+06, 0.101592656313919491E+06, - 0.101604222243081458E+06, 0.101615370617936293E+06, 0.101626717204329048E+06, 0.101638824013794816E+06, 0.101652144675515985E+06, - 0.101666986413953739E+06, 0.101683491567268982E+06, 0.101699730410034434E+06, 0.101715308981035720E+06, 0.101731361440654102E+06, - 0.101748589449732390E+06, 0.101766824698764540E+06, 0.101785841910313233E+06, 0.101805411629659066E+06, 0.101825381837012450E+06, - 0.101846839764007193E+06, 0.101867081140515147E+06, 0.101882747001865355E+06, 0.101896903928888263E+06, 0.101909362288120537E+06, - 0.101920245934517079E+06, 0.101930058238641242E+06, 0.101941637442764200E+06, 0.101954785426383867E+06, 0.101968215450878924E+06, - 0.101984710778129607E+06, 0.102001549965592465E+06, 0.102018275841846422E+06, 0.102034683222590960E+06, 0.102052401989689286E+06, - 0.102069645673240069E+06, 0.102086007650836211E+06, 0.102103768116502732E+06, 0.102121127630333416E+06, 0.102135973777942898E+06, - 0.102147987937177197E+06, 0.102156601874315427E+06, 0.102161672760610920E+06, 0.102163612354316181E+06, 0.102165768392921964E+06, - 0.102167214431077227E+06, 0.102169260247518920E+06, 0.102170746287005837E+06, 0.102171480626503515E+06, 0.102171269145651808E+06, - 0.102170214520413967E+06, 0.102167256562754847E+06, 0.102162479386098232E+06, 0.102158371150627951E+06, 0.102155244448894475E+06, - 0.102152875264177637E+06, 0.102149492287714515E+06, 0.102145495391175835E+06, 0.102139392366010521E+06, 0.102131234162350753E+06, - 0.102121845495369198E+06, 0.102114444604303775E+06, 0.102106462190456019E+06, 0.102096364075651625E+06, 0.102082958297694466E+06, - 0.102064065966768365E+06, 0.102041420899050965E+06, 0.102016297892142000E+06, 0.101989261194259234E+06, 0.101963193901333740E+06, - 0.101934697827006079E+06, 0.101902018630394974E+06, 0.101863893013675159E+06, 0.101820477410193009E+06, 0.101774528513823985E+06, - 0.101724002882111308E+06, 0.101665763047983230E+06, 0.101603648801794363E+06, 0.101540096977050402E+06, 0.101478947206942044E+06, - 0.101415470097827929E+06, 0.101351609294201058E+06, 0.101289469642166499E+06, 0.101226537327552069E+06, 0.101158605139549531E+06, - 0.101091671283985226E+06, 0.101026501778518956E+06, 0.100963906622713315E+06, 0.100912235109733156E+06, 0.100875156448926034E+06, - 0.100858092199168052E+06, 0.100869196724643829E+06, 0.100906258192389359E+06, 0.100966643545000639E+06, 0.101044871026198045E+06, - 0.101126128294873750E+06, 0.101195519846174895E+06, 0.101255659962385485E+06, 0.101297057174446716E+06, 0.101328131549875659E+06, - 0.101358621176643224E+06, 0.101392239138290606E+06, 0.101427359701943147E+06, 0.101468500213009858E+06, 0.101510703720686288E+06, - 0.101550908563824967E+06, 0.101587166287520682E+06, 0.101619760493459311E+06, 0.101640375989610111E+06, 0.101647164822681414E+06, - 0.101640476796716728E+06, 0.101620225665346763E+06, 0.101589549071868416E+06, 0.101551044697311809E+06, 0.101511563682290900E+06, - 0.101475939268223781E+06, 0.101437438003792078E+06, 0.101392805212183681E+06, 0.101332702985176016E+06, 0.101262976832194923E+06, - 0.101186444126810515E+06, 0.101108333464266703E+06, 0.101034512676034472E+06, 0.100963849818957518E+06, 0.100898562106253885E+06, - 0.100842056459041982E+06, 0.100798749608423153E+06, 0.100767148703609448E+06, 0.100745027122654850E+06, 0.100731425417328996E+06, - 0.100731821012642424E+06, 0.100734592849697350E+06, 0.100733986756515151E+06, 0.100727026999971698E+06, 0.100711618349869153E+06, - 0.100683470368124676E+06, 0.100640250766840603E+06, 0.100586314437398818E+06, 0.100534961959011474E+06, 0.100490642055552060E+06, - 0.100456264076438296E+06, 0.100432289810027520E+06, 0.100419632142970615E+06, 0.100423645734029778E+06, 0.100432024957258123E+06, - 0.100442709528904365E+06, 0.100454138069834065E+06, 0.100469282754753091E+06, 0.100483179206656147E+06, 0.100494317659240289E+06, - 0.100501048475271105E+06, 0.100503737147053136E+06, 0.100502939624753810E+06, 0.100506864511892840E+06, 0.100510205922212830E+06, - 0.100511985008099888E+06, 0.101269395817640194E+06, 0.101293433370600033E+06, 0.101320709064215349E+06, 0.101350720216622271E+06, - 0.101381363474586935E+06, 0.101411901774678990E+06, 0.101441702408660596E+06, 0.101470286272251309E+06, 0.101497612121933402E+06, - 0.101523409436511720E+06, 0.101547349710601979E+06, 0.101569178391354450E+06, 0.101588382552830284E+06, 0.101604424454005639E+06, - 0.101617806496970152E+06, 0.101629009202247544E+06, 0.101639790736640862E+06, 0.101650653799515901E+06, 0.101662034467563892E+06, - 0.101674429962589624E+06, 0.101688184881771667E+06, 0.101701776789907686E+06, 0.101715632368359467E+06, 0.101731005396025357E+06, - 0.101747619021182472E+06, 0.101764475149160600E+06, 0.101782565451806455E+06, 0.101801692572504733E+06, 0.101821649291101741E+06, - 0.101844372908615100E+06, 0.101868013490669473E+06, 0.101890926735153276E+06, 0.101912734436730447E+06, 0.101930521333358061E+06, - 0.101945955049482625E+06, 0.101959618341155976E+06, 0.101973842306752718E+06, 0.101990092943988522E+06, 0.102006492234429417E+06, - 0.102022981199823858E+06, 0.102039845835770568E+06, 0.102059553276874620E+06, 0.102079331788742449E+06, 0.102099902964415654E+06, - 0.102120532959564909E+06, 0.102140448801236460E+06, 0.102159255793075747E+06, 0.102176879448503649E+06, 0.102194365868866342E+06, - 0.102211106097444455E+06, 0.102224803244153038E+06, 0.102234823789642047E+06, 0.102240968923527806E+06, 0.102243570541519104E+06, - 0.102243519688579676E+06, 0.102244750868611838E+06, 0.102246759472131700E+06, 0.102247988131721504E+06, 0.102248209161490959E+06, - 0.102247170632681489E+06, 0.102243247319650705E+06, 0.102236753031268512E+06, 0.102230982493940493E+06, 0.102226187707310237E+06, - 0.102222666096639834E+06, 0.102220567141386651E+06, 0.102219855956292071E+06, 0.102215511479397683E+06, 0.102208434908867741E+06, - 0.102198721169081880E+06, 0.102186789184960857E+06, 0.102174609249495770E+06, 0.102164550205667154E+06, 0.102152502370517235E+06, - 0.102137501608386214E+06, 0.102118919702411848E+06, 0.102095889999392573E+06, 0.102070100404917495E+06, 0.102041997958624415E+06, - 0.102012090612610089E+06, 0.101983710969351829E+06, 0.101953137519082840E+06, 0.101920734120792738E+06, 0.101883717982373681E+06, - 0.101842973734119500E+06, 0.101798428245916861E+06, 0.101747102066966778E+06, 0.101687602338869881E+06, 0.101624664318831565E+06, - 0.101559707946739305E+06, 0.101491658640950249E+06, 0.101420567276357397E+06, 0.101354355882096454E+06, 0.101289435543346961E+06, - 0.101224098024003702E+06, 0.101159952737485408E+06, 0.101097956680038245E+06, 0.101035227047009626E+06, 0.100981546520210177E+06, - 0.100939244847484995E+06, 0.100914786575781181E+06, 0.100915867157493747E+06, 0.100942559164277671E+06, 0.100993021366280096E+06, - 0.101062207385378511E+06, 0.101136754321606641E+06, 0.101205153055716102E+06, 0.101267549676815237E+06, 0.101315566331653798E+06, - 0.101356986952566978E+06, 0.101400109049254897E+06, 0.101444047042664242E+06, 0.101488513133860251E+06, 0.101534593023339607E+06, - 0.101578862893253303E+06, 0.101617989104461085E+06, 0.101651469070145307E+06, 0.101676676962902973E+06, 0.101688426206951568E+06, - 0.101690699198194692E+06, 0.101681585082600272E+06, 0.101660802224054729E+06, 0.101632322368388574E+06, 0.101602214382015110E+06, - 0.101577248018812563E+06, 0.101546577483431887E+06, 0.101509347660459607E+06, 0.101460277851145336E+06, 0.101400695177468675E+06, - 0.101333061941295062E+06, 0.101259893373003069E+06, 0.101185498750814251E+06, 0.101111060613673137E+06, 0.101038806163680754E+06, - 0.100970853556921851E+06, 0.100913205537255504E+06, 0.100868081185120318E+06, 0.100831661076531760E+06, 0.100803490881640522E+06, - 0.100782858759036229E+06, 0.100767010800255986E+06, 0.100760517927946479E+06, 0.100755313595541767E+06, 0.100745011420950410E+06, - 0.100727337942231010E+06, 0.100696437123156371E+06, 0.100650083823098379E+06, 0.100597278983266224E+06, 0.100548413676936747E+06, - 0.100507765427222563E+06, 0.100477948430878227E+06, 0.100463614942480534E+06, 0.100466404104801695E+06, 0.100473340681007379E+06, - 0.100482742216284692E+06, 0.100492637659898319E+06, 0.100501306119762710E+06, 0.100508155310289090E+06, 0.100517896956254641E+06, - 0.100523967020314361E+06, 0.100525551437862276E+06, 0.100522692726944748E+06, 0.100516008939190593E+06, 0.100506617021169775E+06, - 0.100504130401290677E+06, 0.100500855757604397E+06, 0.101259195015618316E+06, 0.101287394131248599E+06, 0.101318624387393094E+06, - 0.101351388311065471E+06, 0.101384848445848693E+06, 0.101418230695586331E+06, 0.101450864090695264E+06, 0.101482215379592511E+06, - 0.101512000328888942E+06, 0.101540081556911420E+06, 0.101565958007626774E+06, 0.101589239793549044E+06, 0.101609354590231524E+06, - 0.101626245425942194E+06, 0.101640116415258730E+06, 0.101651384047841973E+06, 0.101660624537901342E+06, 0.101669864682349900E+06, - 0.101680046518619303E+06, 0.101691016789836227E+06, 0.101701600972581538E+06, 0.101712344116073305E+06, 0.101724596034016693E+06, - 0.101738626214170567E+06, 0.101754578760972465E+06, 0.101772464174383247E+06, 0.101790289256249525E+06, 0.101809225095436283E+06, - 0.101831409086778760E+06, 0.101855713865937665E+06, 0.101880304248738481E+06, 0.101904708267321548E+06, 0.101928659429272666E+06, - 0.101952215895369998E+06, 0.101973129343184191E+06, 0.101990492819853054E+06, 0.102009155453432861E+06, 0.102028626658851339E+06, - 0.102048465714061036E+06, 0.102068480817810836E+06, 0.102088846460710702E+06, 0.102110232566220016E+06, 0.102133295641766570E+06, - 0.102157356921516912E+06, 0.102181314870907911E+06, 0.102204374004590238E+06, 0.102226000444488978E+06, 0.102246017656184413E+06, - 0.102265607213167954E+06, 0.102282589184103534E+06, 0.102298432423255334E+06, 0.102310352702715958E+06, 0.102317999706446251E+06, - 0.102321598850661234E+06, 0.102323515138576258E+06, 0.102323197704490987E+06, 0.102322212878332677E+06, 0.102323063816814887E+06, - 0.102322646091264614E+06, 0.102319439183542258E+06, 0.102312970911412354E+06, 0.102304997794601848E+06, 0.102296841478971372E+06, - 0.102291418130089238E+06, 0.102288360395478667E+06, 0.102288552237265947E+06, 0.102287701703575425E+06, 0.102284538846590702E+06, - 0.102276897495121520E+06, 0.102265740813761135E+06, 0.102252134571836228E+06, 0.102237131022390793E+06, 0.102221272996986561E+06, - 0.102206507054624482E+06, 0.102189132554294789E+06, 0.102168602609417649E+06, 0.102145544389345145E+06, 0.102118566149667124E+06, - 0.102089083952633140E+06, 0.102057798140960163E+06, 0.102026969995698295E+06, 0.101997794023706476E+06, 0.101966743922712252E+06, - 0.101933057167765714E+06, 0.101896592945729586E+06, 0.101857371791885336E+06, 0.101815607416803119E+06, 0.101763023383776948E+06, - 0.101702407436462090E+06, 0.101635116047538351E+06, 0.101562945833011370E+06, 0.101485822606547168E+06, 0.101411005039628857E+06, - 0.101339835091662317E+06, 0.101272689532459044E+06, 0.101210368076346276E+06, 0.101154473004817381E+06, 0.101097829928473817E+06, - 0.101048482059940754E+06, 0.101007048910648111E+06, 0.100979473833055905E+06, 0.100973447727585182E+06, 0.100990584221201716E+06, - 0.101029960997994902E+06, 0.101087951257948895E+06, 0.101153695183268181E+06, 0.101219018003879406E+06, 0.101282293838312820E+06, - 0.101338465984178547E+06, 0.101391368230947162E+06, 0.101446772222011277E+06, 0.101500085973176334E+06, 0.101550853250171887E+06, - 0.101598573456663202E+06, 0.101641988898670184E+06, 0.101679214186169236E+06, 0.101710098564568776E+06, 0.101732780885386266E+06, - 0.101743179226637279E+06, 0.101740055966295447E+06, 0.101722994425650759E+06, 0.101700469255730888E+06, 0.101674123165238838E+06, - 0.101653160060864204E+06, 0.101631596453806415E+06, 0.101607075787893336E+06, 0.101574486424828559E+06, 0.101526976419999381E+06, - 0.101469612332252946E+06, 0.101404225279481514E+06, 0.101336714868594907E+06, 0.101267916935403031E+06, 0.101195492908750399E+06, - 0.101123687793417601E+06, 0.101058751346724224E+06, 0.101000171416406578E+06, 0.100947653236097554E+06, 0.100904324965127365E+06, - 0.100869022485961759E+06, 0.100838631774334179E+06, 0.100814997040174785E+06, 0.100796371893838630E+06, 0.100782994420463059E+06, - 0.100767931078048772E+06, 0.100738709347425858E+06, 0.100699551218149616E+06, 0.100657848886243373E+06, 0.100613930496747955E+06, - 0.100570328091677089E+06, 0.100536417956577148E+06, 0.100522106220241680E+06, 0.100523981788664518E+06, 0.100534576173254580E+06, - 0.100544607428678122E+06, 0.100555100707554739E+06, 0.100564477570051735E+06, 0.100571044680449282E+06, 0.100573984997784108E+06, - 0.100574098036419746E+06, 0.100574969682196417E+06, 0.100570985693230745E+06, 0.100562235725965831E+06, 0.100549403090203457E+06, - 0.100533663303323410E+06, 0.100514985690890928E+06, 0.100501506969102309E+06, 0.101247028543607215E+06, 0.101279000272323727E+06, - 0.101313044900483452E+06, 0.101348706117229129E+06, 0.101385099864543183E+06, 0.101421406335684835E+06, 0.101456908730823867E+06, - 0.101491027169870344E+06, 0.101523346965489472E+06, 0.101553641131603319E+06, 0.101581591041353255E+06, 0.101606456037034135E+06, - 0.101627802489960915E+06, 0.101645553091339185E+06, 0.101659871959589625E+06, 0.101671125963614424E+06, 0.101679833672676948E+06, - 0.101686600287344059E+06, 0.101693249899754504E+06, 0.101700828771449567E+06, 0.101708214676399468E+06, 0.101716786788727914E+06, - 0.101726994188702083E+06, 0.101739189978545895E+06, 0.101753597010140846E+06, 0.101770294478413707E+06, 0.101789229323241438E+06, - 0.101810439881563492E+06, 0.101833551125124432E+06, 0.101857745342370516E+06, 0.101882520275840274E+06, 0.101907489508364233E+06, - 0.101932461599410264E+06, 0.101957552146214075E+06, 0.101983305456973438E+06, 0.102008579834297911E+06, 0.102030494060992147E+06, - 0.102053548115608966E+06, 0.102077104427164624E+06, 0.102100783210934751E+06, 0.102124584361851768E+06, 0.102151618960978216E+06, - 0.102178487299050277E+06, 0.102203837934088209E+06, 0.102231789811787370E+06, 0.102258565924026567E+06, 0.102283435612743153E+06, - 0.102308168911264584E+06, 0.102331519967324959E+06, 0.102351306090243161E+06, 0.102367344163488393E+06, 0.102380956720203612E+06, - 0.102390540926741916E+06, 0.102396561280422888E+06, 0.102399644414793191E+06, 0.102399967479044542E+06, 0.102398097050173761E+06, - 0.102394877934586664E+06, 0.102392579382061362E+06, 0.102387437885771593E+06, 0.102380474134807795E+06, 0.102372089234619867E+06, - 0.102363087167973557E+06, 0.102355720695108947E+06, 0.102355336216227777E+06, 0.102355244528026058E+06, 0.102353863384518510E+06, - 0.102349945815737563E+06, 0.102342442703922468E+06, 0.102329934370864139E+06, 0.102314612359457431E+06, 0.102297370131901000E+06, - 0.102278388120427626E+06, 0.102257491551240819E+06, 0.102236307907230104E+06, 0.102213097347429662E+06, 0.102187800432568954E+06, - 0.102160229919730293E+06, 0.102129097981842890E+06, 0.102096889363146300E+06, 0.102063827052134482E+06, 0.102031184486610946E+06, - 0.101999264622467439E+06, 0.101966221591490219E+06, 0.101931754343580265E+06, 0.101897700536754972E+06, 0.101861993529889558E+06, - 0.101819636716650479E+06, 0.101763615901241341E+06, 0.101697976370488861E+06, 0.101620393736143524E+06, 0.101535102872161384E+06, - 0.101449253069692393E+06, 0.101374420264238244E+06, 0.101306501858255855E+06, 0.101247778577939956E+06, 0.101198381473636808E+06, - 0.101152064836353820E+06, 0.101110344624142366E+06, 0.101075281561938828E+06, 0.101049407554255304E+06, 0.101040768998780331E+06, - 0.101052199471517510E+06, 0.101082392815890635E+06, 0.101129144157533199E+06, 0.101184092780294726E+06, 0.101243772906750455E+06, - 0.101307121999288836E+06, 0.101369991062098430E+06, 0.101433698297000723E+06, 0.101498903828178067E+06, 0.101560474018943947E+06, - 0.101615857050411636E+06, 0.101665138596523073E+06, 0.101705590047241931E+06, 0.101738943786932854E+06, 0.101767114003134644E+06, - 0.101789192730629773E+06, 0.101799147989736230E+06, 0.101794735430608300E+06, 0.101777146397531964E+06, 0.101750372193384130E+06, - 0.101723141667504169E+06, 0.101702833712477848E+06, 0.101682678205011733E+06, 0.101660302359832262E+06, 0.101630633216063026E+06, - 0.101590584748240784E+06, 0.101537939783765964E+06, 0.101477184750419154E+06, 0.101412613988421668E+06, 0.101346432956553763E+06, - 0.101280354991399392E+06, 0.101215950742003886E+06, 0.101152407700542390E+06, 0.101091630971862964E+06, 0.101034381306262483E+06, - 0.100980581565512359E+06, 0.100932607474756849E+06, 0.100894526231033058E+06, 0.100863524006721316E+06, 0.100837940986693153E+06, - 0.100815616712752075E+06, 0.100783831314269482E+06, 0.100747340055464098E+06, 0.100708359519305974E+06, 0.100669700349442544E+06, - 0.100634134123292621E+06, 0.100602055798299742E+06, 0.100591037034284673E+06, 0.100590664657868474E+06, 0.100599127748830913E+06, - 0.100614596189110918E+06, 0.100634150489947802E+06, 0.100646345748706677E+06, 0.100655865724535965E+06, 0.100661116257080008E+06, - 0.100661028163947834E+06, 0.100655523835145024E+06, 0.100646490601253885E+06, 0.100636711851892294E+06, 0.100621894936014534E+06, - 0.100602810704563395E+06, 0.100576368488764041E+06, 0.100548286166395032E+06, 0.100522977180969814E+06, 0.101228903510937074E+06, - 0.101265781795862422E+06, 0.101303509185958625E+06, 0.101342284425688282E+06, 0.101381796177970391E+06, 0.101421170386188518E+06, - 0.101459636817675681E+06, 0.101496562449942183E+06, 0.101531479594885182E+06, 0.101564960000747014E+06, 0.101594803080993937E+06, - 0.101621355790812595E+06, 0.101644027594565501E+06, 0.101662677874236993E+06, 0.101677441926593165E+06, 0.101688651352830973E+06, - 0.101696785059940390E+06, 0.101702406683447451E+06, 0.101704728868073435E+06, 0.101705248359237783E+06, 0.101710033061244059E+06, - 0.101715986265950589E+06, 0.101723653592966657E+06, 0.101733480291010681E+06, 0.101745772459652580E+06, 0.101760677660607515E+06, - 0.101780220410703594E+06, 0.101803075598452182E+06, 0.101826488604444239E+06, 0.101849820362239523E+06, 0.101873892351949500E+06, - 0.101898378960095564E+06, 0.101923130766489805E+06, 0.101948518897807691E+06, 0.101975696258303404E+06, 0.102004061929304342E+06, - 0.102033460145040677E+06, 0.102061651327409054E+06, 0.102089414327740989E+06, 0.102117077133701037E+06, 0.102147883501053424E+06, - 0.102180718015203005E+06, 0.102212493723892243E+06, 0.102242559046992334E+06, 0.102271049350391899E+06, 0.102300915058795246E+06, - 0.102331227250506359E+06, 0.102361003675242988E+06, 0.102387797529886448E+06, 0.102410738749007287E+06, 0.102429543001075872E+06, - 0.102444601309541205E+06, 0.102455934113666241E+06, 0.102463826248762096E+06, 0.102468461440316110E+06, 0.102469870975073049E+06, - 0.102468446450288320E+06, 0.102464798290121791E+06, 0.102458449322550092E+06, 0.102451735051873286E+06, 0.102444849067868476E+06, - 0.102436636367539046E+06, 0.102428988993985171E+06, 0.102425331914020266E+06, 0.102421620005855337E+06, 0.102419560924305013E+06, - 0.102417115927208128E+06, 0.102411283378863518E+06, 0.102401124644854805E+06, 0.102388294546935547E+06, 0.102372130138911380E+06, - 0.102352872703988251E+06, 0.102330900792506814E+06, 0.102305906692453034E+06, 0.102278836660343848E+06, 0.102251891886031619E+06, - 0.102223352000414103E+06, 0.102193067106830058E+06, 0.102161078903831076E+06, 0.102125912821954276E+06, 0.102089510678556544E+06, - 0.102052507421496150E+06, 0.102015228902546209E+06, 0.101978931284532373E+06, 0.101944546111379605E+06, 0.101912474602996255E+06, - 0.101881505541306557E+06, 0.101847220983536259E+06, 0.101796545763435774E+06, 0.101731194445780915E+06, 0.101655521374345393E+06, - 0.101570254785904996E+06, 0.101481522317187802E+06, 0.101401331116195521E+06, 0.101332141668882890E+06, 0.101273993470810659E+06, - 0.101228638656778901E+06, 0.101190604276845741E+06, 0.101158196197344718E+06, 0.101133936056759660E+06, 0.101117981664703751E+06, - 0.101116933850947476E+06, 0.101131399795691948E+06, 0.101160604644423380E+06, 0.101201518443580746E+06, 0.101248903707713456E+06, - 0.101300592974865489E+06, 0.101357214090897702E+06, 0.101418441744321666E+06, 0.101485557443350626E+06, 0.101555445746166064E+06, - 0.101621303501475879E+06, 0.101679228518906544E+06, 0.101728241686716501E+06, 0.101766854072509333E+06, 0.101798436487011495E+06, - 0.101826906634104991E+06, 0.101847291990324695E+06, 0.101856878275200172E+06, 0.101852227620230362E+06, 0.101834698267214306E+06, - 0.101809239675292964E+06, 0.101781969547875371E+06, 0.101755152512939356E+06, 0.101732931589822008E+06, 0.101712653074247995E+06, - 0.101684830999865546E+06, 0.101647239704296619E+06, 0.101599826041378212E+06, 0.101544653396053778E+06, 0.101483464700333992E+06, - 0.101420696082338764E+06, 0.101361355157000173E+06, 0.101303077019503457E+06, 0.101242949922489031E+06, 0.101180470229611776E+06, - 0.101117365765681796E+06, 0.101054059738264114E+06, 0.100995066688862426E+06, 0.100946512981860345E+06, 0.100908291761953325E+06, - 0.100873905402216697E+06, 0.100835045455127693E+06, 0.100798873170272855E+06, 0.100762695696108858E+06, 0.100726025871425081E+06, - 0.100692734909454986E+06, 0.100668902864702948E+06, 0.100663213502720391E+06, 0.100664621390201341E+06, 0.100671374502519597E+06, - 0.100685680453359950E+06, 0.100705798123986984E+06, 0.100728995575579524E+06, 0.100751658112675097E+06, 0.100762519462763623E+06, - 0.100767027529124854E+06, 0.100764553224004907E+06, 0.100755187738630775E+06, 0.100739605979863540E+06, 0.100720551089520799E+06, - 0.100698313533178705E+06, 0.100666865056198847E+06, 0.100634031483894869E+06, 0.100601785153826728E+06, 0.100571987820731039E+06, - 0.101206374045435979E+06, 0.101245886159229500E+06, 0.101288633787391896E+06, 0.101331822184275137E+06, 0.101374720391458119E+06, - 0.101417383823794662E+06, 0.101458981013573735E+06, 0.101498818874093005E+06, 0.101538685205643225E+06, 0.101575422468180957E+06, - 0.101607594064004836E+06, 0.101634787525358639E+06, 0.101658391829702683E+06, 0.101677992927276675E+06, 0.101693216382147584E+06, - 0.101704372381742840E+06, 0.101711917535928253E+06, 0.101714961207000641E+06, 0.101714465004361307E+06, 0.101712311040969114E+06, - 0.101709673671424040E+06, 0.101711218999391320E+06, 0.101715783535561670E+06, 0.101722657082666818E+06, 0.101732238893442816E+06, - 0.101747062236834958E+06, 0.101766365174287086E+06, 0.101787109475394507E+06, 0.101808925705709073E+06, 0.101831553485340701E+06, - 0.101854101136956699E+06, 0.101876977318564983E+06, 0.101900071328279475E+06, 0.101924414875452247E+06, 0.101951462468272264E+06, - 0.101980975232741199E+06, 0.102012836826491402E+06, 0.102047258491401968E+06, 0.102083474297558190E+06, 0.102117469380506620E+06, - 0.102154658530511195E+06, 0.102192659983700083E+06, 0.102229894335694480E+06, 0.102265384438205918E+06, 0.102298947455958070E+06, - 0.102332733340180333E+06, 0.102366161911789881E+06, 0.102400223366988168E+06, 0.102430989231899657E+06, 0.102457385343324306E+06, - 0.102478953671150099E+06, 0.102497140263958892E+06, 0.102511039792962809E+06, 0.102520299291871444E+06, 0.102526846630820248E+06, - 0.102529945588383314E+06, 0.102529752833756676E+06, 0.102527108906249603E+06, 0.102521410242623388E+06, 0.102513405849115865E+06, - 0.102504764193898140E+06, 0.102498120743343170E+06, 0.102494756241843366E+06, 0.102491412904970945E+06, 0.102487349910826408E+06, - 0.102482003045019752E+06, 0.102474975478072651E+06, 0.102465362858837878E+06, 0.102453624922867719E+06, 0.102439388282147716E+06, - 0.102422313370157048E+06, 0.102401857750208626E+06, 0.102377162061003954E+06, 0.102349188460773526E+06, 0.102318424237125233E+06, - 0.102285363297180986E+06, 0.102252385208010586E+06, 0.102218029776633513E+06, 0.102181810380545387E+06, 0.102143591228429039E+06, - 0.102102341867038209E+06, 0.102057770995654748E+06, 0.102012593759546347E+06, 0.101970748503609808E+06, 0.101933725108693834E+06, - 0.101900789684666524E+06, 0.101867979870800904E+06, 0.101834235978935918E+06, 0.101794954568116285E+06, 0.101739484665823096E+06, - 0.101671789500483821E+06, 0.101593418617286006E+06, 0.101506698290483502E+06, 0.101422237896336897E+06, 0.101350833220772416E+06, - 0.101290575286891341E+06, 0.101248402171152557E+06, 0.101218529092999917E+06, 0.101197447450399108E+06, 0.101187612570890138E+06, - 0.101185871864261528E+06, 0.101196499134288402E+06, 0.101218353571942265E+06, 0.101249194623964548E+06, 0.101286372345386742E+06, - 0.101326464875508391E+06, 0.101369986766969960E+06, 0.101419749853660280E+06, 0.101476722498559480E+06, 0.101542829739890207E+06, - 0.101612522924097197E+06, 0.101678721249810798E+06, 0.101737575823144638E+06, 0.101785395492746917E+06, 0.101823368561408701E+06, - 0.101856014056084430E+06, 0.101884313206989173E+06, 0.101903695929922687E+06, 0.101912969317636380E+06, 0.101908832298462992E+06, - 0.101892237038585794E+06, 0.101866203497664581E+06, 0.101837081196005645E+06, 0.101809606048398258E+06, 0.101786840568731568E+06, - 0.101762564033379982E+06, 0.101734680154915579E+06, 0.101696592635540685E+06, 0.101650662453849189E+06, 0.101599162120752633E+06, - 0.101544343001196743E+06, 0.101488647544765059E+06, 0.101433089123172278E+06, 0.101377125096785036E+06, 0.101320042947392227E+06, - 0.101256674805424394E+06, 0.101187987297748215E+06, 0.101120641997896339E+06, 0.101056247927954246E+06, 0.100996331972370142E+06, - 0.100943232428022544E+06, 0.100895353842840079E+06, 0.100852555312220196E+06, 0.100815337064243067E+06, 0.100783799781542155E+06, - 0.100753868748835012E+06, 0.100736637044447663E+06, 0.100730650096307727E+06, 0.100733232093861763E+06, 0.100743913291446443E+06, - 0.100758835470579754E+06, 0.100778259316407013E+06, 0.100802567061591370E+06, 0.100828283762383522E+06, 0.100855135515023372E+06, - 0.100877691529341333E+06, 0.100882602938691591E+06, 0.100878787688210650E+06, 0.100866582130667157E+06, 0.100846949291204379E+06, - 0.100815418882725819E+06, 0.100780247866813195E+06, 0.100745087245795497E+06, 0.100709396490561645E+06, 0.100675020472311327E+06, - 0.100643622948665085E+06, 0.101179250397845899E+06, 0.101221149498052953E+06, 0.101266816356343159E+06, 0.101315335097978430E+06, - 0.101363838550262313E+06, 0.101410108301517408E+06, 0.101455090720967710E+06, 0.101501448789654576E+06, 0.101545139345543692E+06, - 0.101584741389399278E+06, 0.101619452976458153E+06, 0.101648772604086349E+06, 0.101672509578882498E+06, 0.101691865395895249E+06, - 0.101707555892752804E+06, 0.101718643945821881E+06, 0.101724156365132570E+06, 0.101724941937858879E+06, 0.101722568702130273E+06, - 0.101718069834871334E+06, 0.101712578971246767E+06, 0.101707223787895346E+06, 0.101704839789861668E+06, 0.101708104689497137E+06, - 0.101716865742578157E+06, 0.101731053443752840E+06, 0.101746952161869922E+06, 0.101764257279303914E+06, 0.101782706182959490E+06, - 0.101802123848941148E+06, 0.101822482313672357E+06, 0.101842936616784311E+06, 0.101860934973268697E+06, 0.101882854305976114E+06, - 0.101908552344231415E+06, 0.101937813400383588E+06, 0.101970499454458186E+06, 0.102006741063404974E+06, 0.102048298491096837E+06, - 0.102094559383243701E+06, 0.102138864116678858E+06, 0.102182980858368159E+06, 0.102226517702417070E+06, 0.102268076174545422E+06, - 0.102309052474061144E+06, 0.102352381321886001E+06, 0.102391102131696549E+06, 0.102425199358256839E+06, 0.102458541492672259E+06, - 0.102488862618142084E+06, 0.102514290917361213E+06, 0.102535791702452596E+06, 0.102552503476764061E+06, 0.102564543232835902E+06, - 0.102572720164328770E+06, 0.102578198051091356E+06, 0.102580323990135614E+06, 0.102579265394634727E+06, 0.102574962647335808E+06, - 0.102568059504060235E+06, 0.102560319977754334E+06, 0.102556118504191676E+06, 0.102553057067685237E+06, 0.102550069919232395E+06, - 0.102545676460258372E+06, 0.102538438321503912E+06, 0.102526558414006213E+06, 0.102512331043456594E+06, 0.102498934035030790E+06, - 0.102483367837719314E+06, 0.102465528571415576E+06, 0.102444019300123240E+06, 0.102417539855634386E+06, 0.102386941153851396E+06, - 0.102352803854769852E+06, 0.102315908735629360E+06, 0.102276253891919623E+06, 0.102235698643740441E+06, 0.102193754813942534E+06, - 0.102149197092732255E+06, 0.102100466547888893E+06, 0.102048387340808171E+06, 0.101995636407850165E+06, 0.101944784700201388E+06, - 0.101899202783926419E+06, 0.101857839910913841E+06, 0.101822276933475470E+06, 0.101792037001853430E+06, 0.101761456733915693E+06, - 0.101723124817417673E+06, 0.101667540093368385E+06, 0.101602052196997916E+06, 0.101524286713149719E+06, 0.101443448254745468E+06, - 0.101372151184877337E+06, 0.101312547429677303E+06, 0.101270741733953284E+06, 0.101245862300696550E+06, 0.101237403284129323E+06, - 0.101240955267019526E+06, 0.101253727619962054E+06, 0.101276647528408124E+06, 0.101307289777398546E+06, 0.101342096503173772E+06, - 0.101377440256415284E+06, 0.101410859947128090E+06, 0.101445291144028568E+06, 0.101485896954639960E+06, 0.101536034363702740E+06, - 0.101598275532425832E+06, 0.101665271864468625E+06, 0.101730455163620383E+06, 0.101789053839460757E+06, 0.101836451975671342E+06, - 0.101875114449402914E+06, 0.101909841821580325E+06, 0.101937388731349492E+06, 0.101957316621074744E+06, 0.101965726747313485E+06, - 0.101960066223235612E+06, 0.101941333444338321E+06, 0.101914153314528972E+06, 0.101884034639169928E+06, 0.101858023754631969E+06, - 0.101832589987368483E+06, 0.101805510097226972E+06, 0.101772567651719524E+06, 0.101733410070028302E+06, 0.101687946616198518E+06, - 0.101638303259297347E+06, 0.101588584508090702E+06, 0.101540424262528119E+06, 0.101488738611497931E+06, 0.101435260593399056E+06, - 0.101375735107437940E+06, 0.101312542555417007E+06, 0.101246134029601395E+06, 0.101177277643560679E+06, 0.101109587858444022E+06, - 0.101039831433180021E+06, 0.100972865937903305E+06, 0.100917142934489922E+06, 0.100872742649287640E+06, 0.100836992191858386E+06, - 0.100811317083979215E+06, 0.100803167641532855E+06, 0.100798970012812904E+06, 0.100800172827859802E+06, 0.100809159254650964E+06, - 0.100825090132632613E+06, 0.100846063732092007E+06, 0.100868925096583727E+06, 0.100895209549142979E+06, 0.100924583482422255E+06, - 0.100954767114643226E+06, 0.100982762726865476E+06, 0.101000126944911273E+06, 0.100996312696391295E+06, 0.100980278059754797E+06, - 0.100948675007578538E+06, 0.100912131109198177E+06, 0.100873893055713954E+06, 0.100836895686632663E+06, 0.100800840190763440E+06, - 0.100766824999287084E+06, 0.100736390306808840E+06, 0.101147547908848283E+06, 0.101191548413107710E+06, 0.101239813004555443E+06, - 0.101291456639815791E+06, 0.101345618815623297E+06, 0.101399848017628567E+06, 0.101452120246013321E+06, 0.101502531147260263E+06, - 0.101549713655955595E+06, 0.101592520742368200E+06, 0.101630069264663078E+06, 0.101661769202013544E+06, 0.101687336031179409E+06, - 0.101706783718499020E+06, 0.101720752729463624E+06, 0.101730352171304155E+06, 0.101734303682047248E+06, 0.101733803712048772E+06, - 0.101729673880940856E+06, 0.101722933683541196E+06, 0.101714707079396278E+06, 0.101706119415995257E+06, 0.101698183703231305E+06, - 0.101694443401773460E+06, 0.101701997679200067E+06, 0.101711622212974413E+06, 0.101722702839184887E+06, 0.101735051927557608E+06, - 0.101748506288605597E+06, 0.101762966981866150E+06, 0.101778437616403622E+06, 0.101789127619601830E+06, 0.101803967912821841E+06, - 0.101822592115495441E+06, 0.101845777685417066E+06, 0.101873478314957349E+06, 0.101905482242767845E+06, 0.101942888324591171E+06, - 0.101988404530944768E+06, 0.102038702733784274E+06, 0.102092474242398283E+06, 0.102148032734040069E+06, 0.102199248899464394E+06, - 0.102248915596860126E+06, 0.102302591874664358E+06, 0.102352656965704402E+06, 0.102397731646050539E+06, 0.102437448450124619E+06, - 0.102472449474120032E+06, 0.102503421423363616E+06, 0.102532064367287210E+06, 0.102556777288245488E+06, 0.102576671821794167E+06, - 0.102591572855277176E+06, 0.102602228863800672E+06, 0.102612279279788083E+06, 0.102616851593614643E+06, 0.102617893333235930E+06, - 0.102615765691172550E+06, 0.102610441888248854E+06, 0.102607301386114821E+06, 0.102603993592939412E+06, 0.102600663908017392E+06, - 0.102597488187445881E+06, 0.102592493791941044E+06, 0.102582466666192224E+06, 0.102569826273933562E+06, 0.102554713868615829E+06, - 0.102537648672080177E+06, 0.102521039168448478E+06, 0.102503173475915130E+06, 0.102480635537613605E+06, 0.102452652573625455E+06, - 0.102419350874903001E+06, 0.102382346399272821E+06, 0.102341612134553201E+06, 0.102297029075732309E+06, 0.102248948564059086E+06, - 0.102198720030139870E+06, 0.102145758870677353E+06, 0.102088950595530157E+06, 0.102029051584965782E+06, 0.101967199226732264E+06, - 0.101903210271600808E+06, 0.101842958311824055E+06, 0.101794271532633502E+06, 0.101756533651972539E+06, 0.101727257623922851E+06, - 0.101703822910323244E+06, 0.101679786232533574E+06, 0.101644516695705548E+06, 0.101595106427152612E+06, 0.101536504683202511E+06, - 0.101467865301457467E+06, 0.101405006154835806E+06, 0.101354849767181862E+06, 0.101317686662273423E+06, 0.101296595665381508E+06, - 0.101290414819946876E+06, 0.101298257504082198E+06, 0.101319018351106934E+06, 0.101351193190044753E+06, 0.101389882715506814E+06, - 0.101429774758297252E+06, 0.101465327153650665E+06, 0.101493697248690820E+06, 0.101519475777882981E+06, 0.101549278536429629E+06, - 0.101589674862889879E+06, 0.101644437539602266E+06, 0.101707639653092512E+06, 0.101773446880721283E+06, 0.101832627929812195E+06, - 0.101881326017934320E+06, 0.101922991773475122E+06, 0.101958375717528819E+06, 0.101986274837340650E+06, 0.102005491030983016E+06, - 0.102011686815100737E+06, 0.102002038930530602E+06, 0.101979844500374034E+06, 0.101949713592872038E+06, 0.101919794688969385E+06, - 0.101890097820657014E+06, 0.101860915631872151E+06, 0.101828511020572609E+06, 0.101792400720458652E+06, 0.101751700978283421E+06, - 0.101705424659848417E+06, 0.101656344874022790E+06, 0.101609238060088639E+06, 0.101564980684227325E+06, 0.101522208207649019E+06, - 0.101469412985671690E+06, 0.101412347630207965E+06, 0.101351832558558221E+06, 0.101288709894130297E+06, 0.101222062151738224E+06, - 0.101149874038784459E+06, 0.101078002130177440E+06, 0.101009088984990114E+06, 0.100945974661293003E+06, 0.100898762938745946E+06, - 0.100870562536964586E+06, 0.100856855516523385E+06, 0.100855450035140704E+06, 0.100864081929396765E+06, 0.100872263570757554E+06, - 0.100886283473303847E+06, 0.100905686340654982E+06, 0.100926632293872623E+06, 0.100951268783756459E+06, 0.100980364613721176E+06, - 0.101012594678026580E+06, 0.101045448177269616E+06, 0.101076054483113505E+06, 0.101101140326098612E+06, 0.101100763828566429E+06, - 0.101077946327603815E+06, 0.101047158711316821E+06, 0.101011715736067359E+06, 0.100974871631289832E+06, 0.100939265943285602E+06, - 0.100905758734950185E+06, 0.100874978764764266E+06, 0.100855175471442562E+06, 0.101111520792912168E+06, 0.101157325849907211E+06, - 0.101207855335016298E+06, 0.101262234561872421E+06, 0.101320453238625094E+06, 0.101383611932041124E+06, 0.101446021580746979E+06, - 0.101500639373333164E+06, 0.101551782605323038E+06, 0.101598222486408573E+06, 0.101638989420395039E+06, 0.101673403579343765E+06, - 0.101701089807805052E+06, 0.101721974472240297E+06, 0.101735419880771398E+06, 0.101741369945130849E+06, 0.101743897808629612E+06, - 0.101742267006478505E+06, 0.101736494037811004E+06, 0.101727612235604785E+06, 0.101716766590943007E+06, 0.101705114503249541E+06, - 0.101695691907190470E+06, 0.101691082917827283E+06, 0.101688492565094857E+06, 0.101689693834759819E+06, 0.101694319117847946E+06, - 0.101699984888099891E+06, 0.101706624023230441E+06, 0.101714209290037295E+06, 0.101714886189053461E+06, 0.101718477607258348E+06, - 0.101727166805334680E+06, 0.101741942812281210E+06, 0.101762884060961267E+06, 0.101787922016469936E+06, 0.101818124304470504E+06, - 0.101856144652932824E+06, 0.101902274632393572E+06, 0.101955219215111909E+06, 0.102013545239481187E+06, 0.102075989637765349E+06, - 0.102141825734524129E+06, 0.102209412008951840E+06, 0.102271101455590702E+06, 0.102328905451065119E+06, 0.102380997966748007E+06, - 0.102426592472327698E+06, 0.102466679017069036E+06, 0.102502492265674373E+06, 0.102531828163015132E+06, 0.102557693337524877E+06, - 0.102581562159738140E+06, 0.102599817594232780E+06, 0.102617360456048831E+06, 0.102630533755776734E+06, 0.102638413398652745E+06, - 0.102641585059017671E+06, 0.102641643207641609E+06, 0.102639909103140890E+06, 0.102637870663539637E+06, 0.102635390209430159E+06, - 0.102632452553768846E+06, 0.102629055188468876E+06, 0.102622883797323870E+06, 0.102613396703866238E+06, 0.102601167982128070E+06, - 0.102586228500797864E+06, 0.102570641502416736E+06, 0.102554342163336842E+06, 0.102534088219572732E+06, 0.102511041429401579E+06, - 0.102481963706129696E+06, 0.102447121630716501E+06, 0.102407091340582192E+06, 0.102362401740888643E+06, 0.102313427305605088E+06, - 0.102259555941640690E+06, 0.102201038299707958E+06, 0.102138783904224241E+06, 0.102073015852343407E+06, 0.102003417942998523E+06, - 0.101925865118624715E+06, 0.101850155355117560E+06, 0.101780650482480312E+06, 0.101721528392427077E+06, 0.101678592950691062E+06, - 0.101649600593305571E+06, 0.101630406458717945E+06, 0.101617445713840047E+06, 0.101603733747246617E+06, 0.101577149951594518E+06, - 0.101547743780961551E+06, 0.101507738128132827E+06, 0.101462001737325336E+06, 0.101417253659172507E+06, 0.101379673252643261E+06, - 0.101354722198341828E+06, 0.101344083982961922E+06, 0.101350090319994677E+06, 0.101372932240478462E+06, 0.101408874721438551E+06, - 0.101453217513073498E+06, 0.101497802352511892E+06, 0.101536224569247846E+06, 0.101563019361021943E+06, 0.101582620293203203E+06, - 0.101603379870639314E+06, 0.101634664417891821E+06, 0.101681132562699248E+06, 0.101739502773358443E+06, 0.101803164120008223E+06, - 0.101863683127456912E+06, 0.101917393438978630E+06, 0.101963558171047160E+06, 0.101999276960053059E+06, 0.102027732037148526E+06, - 0.102044731025719229E+06, 0.102045431775095058E+06, 0.102030705033808161E+06, 0.102003666856825570E+06, 0.101970343646836016E+06, - 0.101935360181740762E+06, 0.101900669036632447E+06, 0.101865688643875081E+06, 0.101829409780582253E+06, 0.101790176042387873E+06, - 0.101745151599830831E+06, 0.101696472660873420E+06, 0.101648060959889524E+06, 0.101603410369994090E+06, 0.101561835852602439E+06, - 0.101521855998799132E+06, 0.101482037163334768E+06, 0.101431340410975914E+06, 0.101375699870779092E+06, 0.101314779976223654E+06, - 0.101251712502201844E+06, 0.101185784883436660E+06, 0.101116517257030340E+06, 0.101049883113580014E+06, 0.100989563385332454E+06, - 0.100941765093850961E+06, 0.100916306862933794E+06, 0.100906980056579865E+06, 0.100910197269982164E+06, 0.100922958161069488E+06, - 0.100941314458770998E+06, 0.100957519326146881E+06, 0.100976831072572779E+06, 0.100999605735160003E+06, 0.101025582535843947E+06, - 0.101054164787686663E+06, 0.101087890451072817E+06, 0.101122283479534453E+06, 0.101149350938674921E+06, 0.101166873408313593E+06, - 0.101177821152178367E+06, 0.101167655432610394E+06, 0.101141220410113790E+06, 0.101110321588459745E+06, 0.101078361586283063E+06, - 0.101047967121170557E+06, 0.101023734539325480E+06, 0.101008383694813747E+06, 0.100996781521485842E+06, 0.101071681166949435E+06, - 0.101119012263039112E+06, 0.101171496350808069E+06, 0.101230050130927513E+06, 0.101294972556584413E+06, 0.101361718999132645E+06, - 0.101428515451916319E+06, 0.101493595145979649E+06, 0.101550612440880213E+06, 0.101601210858501552E+06, 0.101645666556374214E+06, - 0.101683206121268653E+06, 0.101713363718937704E+06, 0.101736031118329251E+06, 0.101750515944612693E+06, 0.101757053628392736E+06, - 0.101756382807271759E+06, 0.101751079781741602E+06, 0.101743715819909994E+06, 0.101732729519215369E+06, 0.101719316686245147E+06, - 0.101706213959027606E+06, 0.101695984176562313E+06, 0.101686190677071994E+06, 0.101677301261342131E+06, 0.101669511529871947E+06, - 0.101662644903393695E+06, 0.101659294762388396E+06, 0.101657066043437371E+06, 0.101647001805639928E+06, 0.101637372304767356E+06, - 0.101632049251178221E+06, 0.101632583495971994E+06, 0.101640198281276986E+06, 0.101655810259860154E+06, 0.101680028481804649E+06, - 0.101706638821039131E+06, 0.101742286180341995E+06, 0.101788109417502055E+06, 0.101842726554478882E+06, 0.101904504042995715E+06, - 0.101971839066862056E+06, 0.102051325178151485E+06, 0.102132183694597014E+06, 0.102209672996832567E+06, 0.102278148214885616E+06, - 0.102338448224708001E+06, 0.102390873033725249E+06, 0.102438626144456910E+06, 0.102479259552033545E+06, 0.102513206393975473E+06, - 0.102541824188105747E+06, 0.102567198188429233E+06, 0.102591367917437441E+06, 0.102612619776373147E+06, 0.102629292784196412E+06, - 0.102640555112501301E+06, 0.102646561280503796E+06, 0.102650072544106879E+06, 0.102650385076837265E+06, 0.102648623310889074E+06, - 0.102647398290377925E+06, 0.102645017994891765E+06, 0.102642292476577204E+06, 0.102637067835034904E+06, 0.102629000591322547E+06, - 0.102618729003435990E+06, 0.102606585296063713E+06, 0.102594489398555161E+06, 0.102579129366844747E+06, 0.102559288929741029E+06, - 0.102534463674515951E+06, 0.102503683064059122E+06, 0.102467677027648388E+06, 0.102425952698371388E+06, 0.102378489696413220E+06, - 0.102325464394964612E+06, 0.102266592853272959E+06, 0.102201770963158517E+06, 0.102131402230157837E+06, 0.102054746212255937E+06, - 0.101968929014764348E+06, 0.101881350922099227E+06, 0.101796528814235106E+06, 0.101718540575217223E+06, 0.101652169308423996E+06, - 0.101599956132104824E+06, 0.101567900805891448E+06, 0.101551935071902582E+06, 0.101547427861477787E+06, 0.101554419426909473E+06, - 0.101561600978615184E+06, 0.101559452993868224E+06, 0.101543318540946057E+06, 0.101516046490907509E+06, 0.101480708475794294E+06, - 0.101442199752635075E+06, 0.101409794893836297E+06, 0.101389114738180739E+06, 0.101385262237127725E+06, 0.101400028248419621E+06, - 0.101431176088229637E+06, 0.101474781214988048E+06, 0.101522572921117302E+06, 0.101566852249736243E+06, 0.101600450643120159E+06, - 0.101625889986676848E+06, 0.101647907487096571E+06, 0.101675661997654053E+06, 0.101714463575179296E+06, 0.101767306549608373E+06, - 0.101829328954263532E+06, 0.101890507206039634E+06, 0.101946066216170686E+06, 0.101992520848846892E+06, 0.102030925636120199E+06, - 0.102058119932572736E+06, 0.102069397218130180E+06, 0.102063960577488731E+06, 0.102043326123970241E+06, 0.102008553848255615E+06, - 0.101967472871147096E+06, 0.101926394136031289E+06, 0.101886043970172454E+06, 0.101846744426466306E+06, 0.101807275512743188E+06, - 0.101761955344090966E+06, 0.101713799217710359E+06, 0.101665117193273894E+06, 0.101617359026062331E+06, 0.101572592180247302E+06, - 0.101533981842693742E+06, 0.101499194744985522E+06, 0.101466415578573593E+06, 0.101432243614177438E+06, 0.101381882914991351E+06, - 0.101327735566313961E+06, 0.101272085428944469E+06, 0.101216117169049772E+06, 0.101156916040190554E+06, 0.101098197832462072E+06, - 0.101045083251186894E+06, 0.101001341900752319E+06, 0.100969631972021365E+06, 0.100962352822747649E+06, 0.100968513387743296E+06, - 0.100983909597780104E+06, 0.101002878032770619E+06, 0.101021997578890048E+06, 0.101041366902723443E+06, 0.101063829282811043E+06, - 0.101089246526039147E+06, 0.101117245287077734E+06, 0.101145180487582722E+06, 0.101169961535366980E+06, 0.101193870243324593E+06, - 0.101214945572481010E+06, 0.101231265902229890E+06, 0.101240946166576672E+06, 0.101226758959788902E+06, 0.101203801319224774E+06, - 0.101180554692105070E+06, 0.101163284364848339E+06, 0.101153028319845049E+06, 0.101150355172476586E+06, 0.101145580058182692E+06, - 0.101028800627874574E+06, 0.101077428684324259E+06, 0.101134167142638209E+06, 0.101197990565301836E+06, 0.101265722975280849E+06, - 0.101335709112544850E+06, 0.101406209334330430E+06, 0.101475487925550115E+06, 0.101541907493692343E+06, 0.101600856889744842E+06, - 0.101649573257523298E+06, 0.101690733358275495E+06, 0.101724376638615926E+06, 0.101749510141425519E+06, 0.101765791117457280E+06, - 0.101773452578481490E+06, 0.101773114885158633E+06, 0.101765715127990101E+06, 0.101752413867995332E+06, 0.101738692514285227E+06, - 0.101723904619569148E+06, 0.101710227930270819E+06, 0.101695310346281782E+06, 0.101679758838352922E+06, 0.101664029621015856E+06, - 0.101648327607929226E+06, 0.101632507008869143E+06, 0.101615973949263309E+06, 0.101591834033789346E+06, 0.101568495570761865E+06, - 0.101547691859404833E+06, 0.101531530936334253E+06, 0.101521827887484746E+06, 0.101520050854732108E+06, 0.101527313513054993E+06, - 0.101537145982894304E+06, 0.101560590862112396E+06, 0.101599562166824646E+06, 0.101645766826557534E+06, 0.101701752618078797E+06, - 0.101766692067664408E+06, 0.101846710834492522E+06, 0.101935405126349360E+06, 0.102024396175872622E+06, 0.102110867349092339E+06, - 0.102192853218211705E+06, 0.102269413494696259E+06, 0.102330281542130935E+06, 0.102383945506085889E+06, 0.102430199256480380E+06, - 0.102469066393364890E+06, 0.102501583023640342E+06, 0.102532817139689723E+06, 0.102561960069998779E+06, 0.102585754372647149E+06, - 0.102606277240311640E+06, 0.102621561801826407E+06, 0.102631876834385388E+06, 0.102638884194148588E+06, 0.102641934388380745E+06, - 0.102641959420915780E+06, 0.102640521654950935E+06, 0.102639686428696965E+06, 0.102638253506522131E+06, 0.102634465365988304E+06, - 0.102627915114268661E+06, 0.102619787557100746E+06, 0.102613378349844119E+06, 0.102603999870031650E+06, 0.102590631585167415E+06, - 0.102572103225089755E+06, 0.102547313635873026E+06, 0.102516398885249058E+06, 0.102479446900462790E+06, 0.102437237325361522E+06, - 0.102388874413479600E+06, 0.102333718028784861E+06, 0.102271049401030890E+06, 0.102201028861754414E+06, 0.102122663528859397E+06, - 0.102032876851637207E+06, 0.101938463410692304E+06, 0.101842660210214104E+06, 0.101749957344606999E+06, 0.101664764507437576E+06, - 0.101591439187819764E+06, 0.101533919460466379E+06, 0.101494271575071776E+06, 0.101478987993255127E+06, 0.101485263674090980E+06, - 0.101506279443945081E+06, 0.101532941096559764E+06, 0.101553896677561657E+06, 0.101563917085832989E+06, 0.101552692436306723E+06, - 0.101526766068070108E+06, 0.101490572300548680E+06, 0.101454740971174542E+06, 0.101425776324883132E+06, 0.101411062568111098E+06, - 0.101413866812942622E+06, 0.101435131474614493E+06, 0.101474051380900128E+06, 0.101522941427092213E+06, 0.101574152032058948E+06, - 0.101618098831177398E+06, 0.101654170137284003E+06, 0.101684054984246599E+06, 0.101716539075889523E+06, 0.101756604551361495E+06, - 0.101806467761705877E+06, 0.101862424100462653E+06, 0.101918408568819126E+06, 0.101971439624029648E+06, 0.102015800714595636E+06, - 0.102049385208646127E+06, 0.102069908714661666E+06, 0.102076032068515779E+06, 0.102064732659179368E+06, 0.102034093795762514E+06, - 0.101992630086863239E+06, 0.101944780810628261E+06, 0.101894141477159937E+06, 0.101849042057571452E+06, 0.101805808680122878E+06, - 0.101760916109816302E+06, 0.101714291793644923E+06, 0.101666393705850103E+06, 0.101619297696421156E+06, 0.101573598742667251E+06, - 0.101529420471224686E+06, 0.101490381423561645E+06, 0.101460489541744115E+06, 0.101432531917615197E+06, 0.101405679166028422E+06, - 0.101376758400729959E+06, 0.101333014356477448E+06, 0.101288061869102195E+06, 0.101243137897010267E+06, 0.101200014773099698E+06, - 0.101153035601030700E+06, 0.101107255027280131E+06, 0.101068975039667697E+06, 0.101040318598185462E+06, 0.101026239021205620E+06, - 0.101036150724925217E+06, 0.101050786638747362E+06, 0.101066960176317720E+06, 0.101082545023658342E+06, 0.101098187778212945E+06, - 0.101117678130985703E+06, 0.101139021760228803E+06, 0.101155522461091532E+06, 0.101175020122667425E+06, 0.101198265495543150E+06, - 0.101224832562545693E+06, 0.101250329820757150E+06, 0.101272684085133165E+06, 0.101289811161881575E+06, 0.101299701614067628E+06, - 0.101289739336630024E+06, 0.101279678002747503E+06, 0.101273826681569160E+06, 0.101274570526567550E+06, 0.101282465694758634E+06, - 0.101293902962443753E+06, 0.100983835656151976E+06, 0.101036388934372706E+06, 0.101096497142358145E+06, 0.101162397946509547E+06, - 0.101232608232112354E+06, 0.101305480982330599E+06, 0.101379283841868455E+06, 0.101452283197187178E+06, 0.101522834159475562E+06, - 0.101589476875808105E+06, 0.101650386759155634E+06, 0.101696210127681858E+06, 0.101733613430271813E+06, 0.101761832290367092E+06, - 0.101780569821559126E+06, 0.101789961901369534E+06, 0.101790532679209500E+06, 0.101783131653860866E+06, 0.101768849808582265E+06, - 0.101750041068809616E+06, 0.101731803246356489E+06, 0.101713921895166000E+06, 0.101693731889764837E+06, 0.101671835744684708E+06, - 0.101648705771986570E+06, 0.101624585079514640E+06, 0.101599389025969096E+06, 0.101563768387053642E+06, 0.101522704766848532E+06, - 0.101483489785699712E+06, 0.101448687013231232E+06, 0.101419615240213854E+06, 0.101397479525329196E+06, 0.101384028029676760E+06, - 0.101370836998047147E+06, 0.101368370266732833E+06, 0.101383065641375812E+06, 0.101416090998647196E+06, 0.101467290265164353E+06, - 0.101534882313080263E+06, 0.101609445319890510E+06, 0.101699733235880441E+06, 0.101794859855521834E+06, 0.101891101060966321E+06, - 0.101985315130313480E+06, 0.102075076914327306E+06, 0.102159945052938041E+06, 0.102235771297951098E+06, 0.102301477656430769E+06, - 0.102354930558367778E+06, 0.102399782724316072E+06, 0.102438694369211255E+06, 0.102476839111309280E+06, 0.102509751156878236E+06, - 0.102537521783681077E+06, 0.102560895469354815E+06, 0.102580819063130271E+06, 0.102594854584419911E+06, 0.102605160074562926E+06, - 0.102611577337313051E+06, 0.102614486702620023E+06, 0.102617674490494959E+06, 0.102619973525111447E+06, 0.102618324460179618E+06, - 0.102615416266488261E+06, 0.102610851205396946E+06, 0.102607299216665502E+06, 0.102602572628475973E+06, 0.102595515104050908E+06, - 0.102585432283621078E+06, 0.102569550312714797E+06, 0.102546496599273247E+06, 0.102517612581426918E+06, 0.102482362007529839E+06, - 0.102441544642516921E+06, 0.102393921375066857E+06, 0.102338338767732290E+06, 0.102273827698305467E+06, 0.102199580759235032E+06, - 0.102112717239415593E+06, 0.102017541011033652E+06, 0.101917267901995700E+06, 0.101815758981969469E+06, 0.101717854365049221E+06, - 0.101627270343615834E+06, 0.101547308817353100E+06, 0.101483765146806487E+06, 0.101441943712900873E+06, 0.101423999856314156E+06, - 0.101430776328316933E+06, 0.101457783973006139E+06, 0.101497023306538365E+06, 0.101538146597104598E+06, 0.101564980031804182E+06, - 0.101571345079031700E+06, 0.101556555710264554E+06, 0.101527227279379993E+06, 0.101491242458124063E+06, 0.101455431195561541E+06, - 0.101427222639413303E+06, 0.101413952789479707E+06, 0.101420016873493543E+06, 0.101448672726717166E+06, 0.101494479796940665E+06, - 0.101550679225448213E+06, 0.101607025893701604E+06, 0.101659304835337243E+06, 0.101705889950175377E+06, 0.101749787609497245E+06, - 0.101793551387452957E+06, 0.101844793551510127E+06, 0.101899113907290477E+06, 0.101951953582127840E+06, 0.101997167012573933E+06, - 0.102030191525044342E+06, 0.102053787395966574E+06, 0.102064887574337728E+06, 0.102060267944376203E+06, 0.102039749700523636E+06, - 0.102005081906476669E+06, 0.101957654047840246E+06, 0.101904801258523614E+06, 0.101850843726662788E+06, 0.101798946363995929E+06, - 0.101751878064897523E+06, 0.101705939443378287E+06, 0.101659768391705205E+06, 0.101615380159911743E+06, 0.101570783461705709E+06, - 0.101526947551755860E+06, 0.101484787939652975E+06, 0.101445231219594032E+06, 0.101413345817087800E+06, 0.101391047300393111E+06, - 0.101372584877227360E+06, 0.101355566853485740E+06, 0.101335220992961375E+06, 0.101303837716816255E+06, 0.101271525370591757E+06, - 0.101240298133351855E+06, 0.101211003024413338E+06, 0.101175839364889063E+06, 0.101146665774628709E+06, 0.101127801050420749E+06, - 0.101116214564623544E+06, 0.101115217567181709E+06, 0.101124992952320288E+06, 0.101134962605509543E+06, 0.101143290627816998E+06, - 0.101149282865567409E+06, 0.101151001731697805E+06, 0.101160080279956310E+06, 0.101174468885292459E+06, 0.101194158852267166E+06, - 0.101218629627263130E+06, 0.101247610934086246E+06, 0.101278139638903813E+06, 0.101306993640526780E+06, 0.101332857422239162E+06, - 0.101352835922766695E+06, 0.101364854062282961E+06, 0.101366215681609348E+06, 0.101371982657827277E+06, 0.101384204628605657E+06, - 0.101403123567578412E+06, 0.101427293507956012E+06, 0.100939699761507189E+06, 0.100993926545564740E+06, 0.101055617446205957E+06, - 0.101123302505147047E+06, 0.101195700951661318E+06, 0.101271150132425566E+06, 0.101347899405442047E+06, 0.101424189839355866E+06, - 0.101498339603613043E+06, 0.101568835452811982E+06, 0.101636401101424097E+06, 0.101695457584751377E+06, 0.101740082571501800E+06, - 0.101772165987128828E+06, 0.101794061760174460E+06, 0.101805821721959510E+06, 0.101807890769523758E+06, 0.101801052084176001E+06, - 0.101787222143099047E+06, 0.101769333451322513E+06, 0.101746134751190912E+06, 0.101718716143227328E+06, 0.101691356809011646E+06, - 0.101662464249923956E+06, 0.101631298348493656E+06, 0.101598170677190283E+06, 0.101554964683279206E+06, 0.101502331999436428E+06, - 0.101449056042133889E+06, 0.101396847279871756E+06, 0.101347056172201555E+06, 0.101300460882216124E+06, 0.101262584703042259E+06, - 0.101225780265849375E+06, 0.101194459775717551E+06, 0.101179417053502169E+06, 0.101183702376592380E+06, 0.101209076499852017E+06, - 0.101255909037280071E+06, 0.101326640203920455E+06, 0.101424239758254218E+06, 0.101531367651623077E+06, 0.101632910073723979E+06, - 0.101736158570445637E+06, 0.101837656744184424E+06, 0.101936360666710083E+06, 0.102029774479476604E+06, 0.102113550935132720E+06, - 0.102187275245992423E+06, 0.102251742085495353E+06, 0.102308744854441014E+06, 0.102354056548559587E+06, 0.102395496326958368E+06, - 0.102432085609497080E+06, 0.102463450245845990E+06, 0.102489865598489851E+06, 0.102514853262571502E+06, 0.102534082770129738E+06, - 0.102548592777604266E+06, 0.102559883810599669E+06, 0.102568794081739034E+06, 0.102579021392062437E+06, 0.102585007107402751E+06, - 0.102586497457448539E+06, 0.102584376842419224E+06, 0.102580903181294503E+06, 0.102577151681759657E+06, 0.102573827515381417E+06, - 0.102568538059750121E+06, 0.102560561364228692E+06, 0.102548460310359820E+06, 0.102530289426340809E+06, 0.102505861568008157E+06, - 0.102475498063954670E+06, 0.102440643792700503E+06, 0.102396241614374099E+06, 0.102341446243588929E+06, 0.102276649353635905E+06, - 0.102199862029058393E+06, 0.102111863644497949E+06, 0.102014314786398143E+06, 0.101910607455440113E+06, 0.101806306816961252E+06, - 0.101704399917697054E+06, 0.101609603981306922E+06, 0.101526211311625375E+06, 0.101459322473350869E+06, 0.101412795838567283E+06, - 0.101389618525710335E+06, 0.101393845554395113E+06, 0.101424357742906359E+06, 0.101472713797786171E+06, 0.101522607587252613E+06, - 0.101559998357663775E+06, 0.101576743781235520E+06, 0.101573310646049868E+06, 0.101549833954751783E+06, 0.101514456685338067E+06, - 0.101472694191529066E+06, 0.101434208011361596E+06, 0.101406914911600485E+06, 0.101398454904380153E+06, 0.101415253675564527E+06, - 0.101455136695375608E+06, 0.101512719547979839E+06, 0.101577237869349250E+06, 0.101641152022720256E+06, 0.101700396834169049E+06, - 0.101757567947174000E+06, 0.101815111575731135E+06, 0.101874014294397304E+06, 0.101930155420364375E+06, 0.101979578233631371E+06, - 0.102017827567168875E+06, 0.102041453032023797E+06, 0.102049181677356071E+06, 0.102042624564991027E+06, 0.102027458526470917E+06, - 0.101998856271186160E+06, 0.101958763385915998E+06, 0.101909825004560786E+06, 0.101855834630693556E+06, 0.101803471305377156E+06, - 0.101751840395667561E+06, 0.101701669671223848E+06, 0.101657371568089962E+06, 0.101614737302306821E+06, 0.101571808841198203E+06, - 0.101529035182503387E+06, 0.101487836291383923E+06, 0.101448187429775586E+06, 0.101410201287687276E+06, 0.101375725543945955E+06, - 0.101354091334976038E+06, 0.101343701275904139E+06, 0.101337958790157587E+06, 0.101334014323027164E+06, 0.101323058410853802E+06, - 0.101303680281432564E+06, 0.101285071086934273E+06, 0.101269046902558985E+06, 0.101256912292666253E+06, 0.101239485050412128E+06, - 0.101225094542196108E+06, 0.101214114558167246E+06, 0.101206300766355242E+06, 0.101205366180458252E+06, 0.101205376802251209E+06, - 0.101196436467417006E+06, 0.101184014918681118E+06, 0.101170971956995039E+06, 0.101173896703063627E+06, 0.101186778426832985E+06, - 0.101207425966799259E+06, 0.101235075391491133E+06, 0.101268299800364039E+06, 0.101308063493844020E+06, 0.101344788336284473E+06, - 0.101376389450400151E+06, 0.101402378295128001E+06, 0.101423140134659829E+06, 0.101438782026730638E+06, 0.101455746728587110E+06, - 0.101479368387625509E+06, 0.101509546030359561E+06, 0.101546739387306210E+06, 0.100893625093361974E+06, 0.100948455392464501E+06, - 0.101011317645263582E+06, 0.101080913011082172E+06, 0.101155302174425058E+06, 0.101233112731396410E+06, 0.101312551980581891E+06, - 0.101391810121618284E+06, 0.101469643740293817E+06, 0.101547894952444782E+06, 0.101619713078854009E+06, 0.101683304064554628E+06, - 0.101737232999154556E+06, 0.101779617777438179E+06, 0.101805388291197829E+06, 0.101820150398714570E+06, 0.101824280737551730E+06, - 0.101819067925622789E+06, 0.101806980910888844E+06, 0.101787436214918198E+06, 0.101761287349566453E+06, 0.101729423465328233E+06, - 0.101692622608612961E+06, 0.101651573936670728E+06, 0.101611590783753491E+06, 0.101562833006838278E+06, 0.101502364394767414E+06, - 0.101438724936641054E+06, 0.101373805958635741E+06, 0.101309369954324357E+06, 0.101246873385268977E+06, 0.101187267453513661E+06, - 0.101122914968029043E+06, 0.101055428119650373E+06, 0.101008249772026029E+06, 0.100979473982631680E+06, 0.100972177967227311E+06, - 0.100988832853860484E+06, 0.101031262783445170E+06, 0.101112202656024601E+06, 0.101211093846252057E+06, 0.101323155130905317E+06, - 0.101443212391304434E+06, 0.101565274984548159E+06, 0.101675064133449094E+06, 0.101783046764746541E+06, 0.101883427362778093E+06, - 0.101974048605326316E+06, 0.102054089915572622E+06, 0.102123916001737191E+06, 0.102185138506351650E+06, 0.102239277647944138E+06, - 0.102288043635062262E+06, 0.102329848961112002E+06, 0.102365570526105090E+06, 0.102398175565311816E+06, 0.102427118018994763E+06, - 0.102451215888181687E+06, 0.102470889959435211E+06, 0.102487322259304128E+06, 0.102507363262553656E+06, 0.102522539511451090E+06, - 0.102533202617323841E+06, 0.102538447738773189E+06, 0.102539366679125000E+06, 0.102537806325041631E+06, 0.102534134338413278E+06, - 0.102529616480806799E+06, 0.102525504718401397E+06, 0.102520340764588414E+06, 0.102512361946182253E+06, 0.102499685852779818E+06, - 0.102481370178637997E+06, 0.102461804458447645E+06, 0.102433116211535496E+06, 0.102394820498302695E+06, 0.102344806742965229E+06, - 0.102282869771580241E+06, 0.102208190347609911E+06, 0.102122230232017173E+06, 0.102026360478078772E+06, 0.101922376088166435E+06, - 0.101815964790077211E+06, 0.101712553837059808E+06, 0.101615912730210781E+06, 0.101531538428717235E+06, 0.101462015329520931E+06, - 0.101411095529211190E+06, 0.101383553801811446E+06, 0.101387868686696354E+06, 0.101419065450411930E+06, 0.101465197763774107E+06, - 0.101514122624701689E+06, 0.101554157750064871E+06, 0.101577510533460605E+06, 0.101578561408166206E+06, 0.101561717136454608E+06, - 0.101527942832344896E+06, 0.101485492708933743E+06, 0.101442040681691869E+06, 0.101407214730937660E+06, 0.101391475969427891E+06, - 0.101402057936737707E+06, 0.101438129992839313E+06, 0.101494675186752138E+06, 0.101561405991801003E+06, 0.101631832958464947E+06, - 0.101700764128050694E+06, 0.101765471244284083E+06, 0.101829298739144535E+06, 0.101891487805957440E+06, 0.101949649930012936E+06, - 0.101996983260441179E+06, 0.102028825999188412E+06, 0.102041977726062381E+06, 0.102037063043873364E+06, 0.102018484271153007E+06, - 0.101987519813082123E+06, 0.101953322744109144E+06, 0.101911210582393775E+06, 0.101863879485885569E+06, 0.101813868935175255E+06, - 0.101763558865488987E+06, 0.101714781421884982E+06, 0.101669784944327868E+06, 0.101626116114336663E+06, 0.101583855166139518E+06, - 0.101542346971029430E+06, 0.101502633877275308E+06, 0.101464939559164166E+06, 0.101426766367174598E+06, 0.101390458857219390E+06, - 0.101358471458522574E+06, 0.101334112694217969E+06, 0.101328407691393310E+06, 0.101330874497622441E+06, 0.101337110359200757E+06, - 0.101343736678259927E+06, 0.101343244142495707E+06, 0.101341300900043818E+06, 0.101339844172589394E+06, 0.101338724330486657E+06, - 0.101333664918719776E+06, 0.101322891249048946E+06, 0.101311826452015521E+06, 0.101299221594776434E+06, 0.101282571152943405E+06, - 0.101266530780531204E+06, 0.101246643011162712E+06, 0.101224150063358495E+06, 0.101202571591745436E+06, 0.101188612840670292E+06, - 0.101199966484071061E+06, 0.101222097051704724E+06, 0.101260233588647054E+06, 0.101304129252313578E+06, 0.101350161554908336E+06, - 0.101389652624068185E+06, 0.101424551417429771E+06, 0.101454274075586436E+06, 0.101479148917351384E+06, 0.101500388782067501E+06, - 0.101525545796928971E+06, 0.101562513561929518E+06, 0.101606090475506091E+06, 0.101653619386718725E+06, 0.100845507039246062E+06, - 0.100900566753226827E+06, 0.100964147998307293E+06, 0.101035004760987780E+06, 0.101111734714359307E+06, 0.101192123809297234E+06, - 0.101274156352906692E+06, 0.101357605885697238E+06, 0.101443671119726976E+06, 0.101525544557033369E+06, 0.101601182677887831E+06, - 0.101668789681363778E+06, 0.101726898348598319E+06, 0.101774441929614739E+06, 0.101810815552412794E+06, 0.101832035149566495E+06, - 0.101838765440822797E+06, 0.101835596101807649E+06, 0.101823419644672496E+06, 0.101802715728713345E+06, 0.101774151142095492E+06, - 0.101738457612419079E+06, 0.101696295926065533E+06, 0.101648104911459959E+06, 0.101590285842002006E+06, 0.101521209919707282E+06, - 0.101450839575846665E+06, 0.101376697188940336E+06, 0.101300744148618498E+06, 0.101224863840720194E+06, 0.101150697403150189E+06, - 0.101073301607053800E+06, 0.100983235760375988E+06, 0.100901684378507489E+06, 0.100833101972986929E+06, 0.100781373167571786E+06, - 0.100760772506158712E+06, 0.100768040826660945E+06, 0.100819963855216105E+06, 0.100898361962391151E+06, 0.100996401252706506E+06, - 0.101109805590524003E+06, 0.101233684034863138E+06, 0.101362757333502159E+06, 0.101494642793831357E+06, 0.101619684005633680E+06, - 0.101728129058541483E+06, 0.101825059560781054E+06, 0.101910320070122136E+06, 0.101982389350624275E+06, 0.102044412115271698E+06, - 0.102100145695870931E+06, 0.102151182120026933E+06, 0.102199014246850449E+06, 0.102244844616859526E+06, 0.102284509458517772E+06, - 0.102318215421307876E+06, 0.102347902960885476E+06, 0.102373421335254781E+06, 0.102401951332123936E+06, 0.102429181477717284E+06, - 0.102450532016644735E+06, 0.102465997336774948E+06, 0.102475777963121422E+06, 0.102478313815590023E+06, 0.102478110250759957E+06, - 0.102475657036715347E+06, 0.102471918321198871E+06, 0.102469939192222024E+06, 0.102467007436977176E+06, 0.102462490014742158E+06, - 0.102456722431479779E+06, 0.102450737615132341E+06, 0.102440335034919917E+06, 0.102420575011656954E+06, 0.102389812989896382E+06, - 0.102347122683242473E+06, 0.102292275082950306E+06, 0.102224438636867562E+06, 0.102143836217952965E+06, 0.102050866494433591E+06, - 0.101949943411085245E+06, 0.101845736377779569E+06, 0.101742816153747364E+06, 0.101647911129982123E+06, 0.101563216996056130E+06, - 0.101491604823778136E+06, 0.101437861556007003E+06, 0.101412287502927546E+06, 0.101412856551671823E+06, 0.101435247443498505E+06, - 0.101472966599928535E+06, 0.101514519271643498E+06, 0.101550307716508367E+06, 0.101572773831424129E+06, 0.101577300876503461E+06, - 0.101561783761491213E+06, 0.101528832671536744E+06, 0.101487621468217170E+06, 0.101449333621855301E+06, 0.101421572690143163E+06, - 0.101412849368901254E+06, 0.101428815273143569E+06, 0.101468452704213269E+06, 0.101526342258825374E+06, 0.101593070240422909E+06, - 0.101660293633886846E+06, 0.101724359259873541E+06, 0.101785772418607943E+06, 0.101847556062125179E+06, 0.101908363003809383E+06, - 0.101961701914240010E+06, 0.102002429874153109E+06, 0.102025185688122059E+06, 0.102030228237618969E+06, 0.102016392623057240E+06, - 0.101989203583738155E+06, 0.101954215596148948E+06, 0.101916658897302012E+06, 0.101876815696310456E+06, 0.101833071043157586E+06, - 0.101787308476072212E+06, 0.101741539193291770E+06, 0.101697630101558476E+06, 0.101654119182481736E+06, 0.101610960850170581E+06, - 0.101569179414185535E+06, 0.101528773468682877E+06, 0.101490142318063241E+06, 0.101454189911789217E+06, 0.101420537325155994E+06, - 0.101387196165512592E+06, 0.101359208745426033E+06, 0.101338989486127597E+06, 0.101329695327606096E+06, 0.101338867992364074E+06, - 0.101355871810450670E+06, 0.101375430345140587E+06, 0.101394209504973755E+06, 0.101402919751202760E+06, 0.101410688334029808E+06, - 0.101416920285657412E+06, 0.101420489242522977E+06, 0.101413658635510583E+06, 0.101399351916641783E+06, 0.101380364637205465E+06, - 0.101357315413079603E+06, 0.101331383086953632E+06, 0.101302463143222500E+06, 0.101271861027862804E+06, 0.101243797629858222E+06, - 0.101225102912379341E+06, 0.101230895188582799E+06, 0.101260967028080006E+06, 0.101301126414935963E+06, 0.101347821784489817E+06, - 0.101397550525323837E+06, 0.101444003541722705E+06, 0.101480976560253359E+06, 0.101512946357403111E+06, 0.101540212183607568E+06, - 0.101567953884550225E+06, 0.101594468785546575E+06, 0.101637676393726375E+06, 0.101688399693186482E+06, 0.101742930184759069E+06, - 0.100795882153115017E+06, 0.100850797431345025E+06, 0.100914750948998306E+06, 0.100986523708389999E+06, 0.101064741053657359E+06, - 0.101147944583867647E+06, 0.101236474647069423E+06, 0.101327593382317646E+06, 0.101416818345205553E+06, 0.101501970105562199E+06, - 0.101581006340059568E+06, 0.101652107178935606E+06, 0.101713753841424812E+06, 0.101764799350409041E+06, 0.101804529976921447E+06, - 0.101832451081090258E+06, 0.101847567048303332E+06, 0.101846442214230046E+06, 0.101834900151378431E+06, 0.101813744156519519E+06, - 0.101783490044669117E+06, 0.101744750228076155E+06, 0.101698109004179641E+06, 0.101641364118676778E+06, 0.101569583201128436E+06, - 0.101490816574609969E+06, 0.101406531256311253E+06, 0.101319625817001812E+06, 0.101233091961074242E+06, 0.101146347584902731E+06, - 0.101058989124578555E+06, 0.100953964690316512E+06, 0.100852899705475327E+06, 0.100760578698964149E+06, 0.100681685450575751E+06, - 0.100620492778267973E+06, 0.100580496608869158E+06, 0.100579462774121028E+06, 0.100625977088063315E+06, 0.100699672061534206E+06, - 0.100794647180633037E+06, 0.100907249288633233E+06, 0.101033016501104474E+06, 0.101170532820658074E+06, 0.101310202043631813E+06, - 0.101443951517617694E+06, 0.101566665342990047E+06, 0.101674561727816923E+06, 0.101762857707379371E+06, 0.101831050817027455E+06, - 0.101892059674295087E+06, 0.101947353598683054E+06, 0.101998507084363489E+06, 0.102047351014086569E+06, 0.102096770563981801E+06, - 0.102143221374936838E+06, 0.102186890306655871E+06, 0.102228196597294736E+06, 0.102264105567156759E+06, 0.102302445150954794E+06, - 0.102336246787148004E+06, 0.102363781472504663E+06, 0.102384291162903231E+06, 0.102397430622010026E+06, 0.102403312624922473E+06, - 0.102403832627536103E+06, 0.102402612769131738E+06, 0.102401390930183130E+06, 0.102401466546220196E+06, 0.102401874865610895E+06, - 0.102402100027913009E+06, 0.102404524182350739E+06, 0.102408945753433436E+06, 0.102408228479075435E+06, 0.102399207567720179E+06, - 0.102378727543360583E+06, 0.102346081419689654E+06, 0.102300584036716507E+06, 0.102242408524207058E+06, 0.102170172560628038E+06, - 0.102084827969266131E+06, 0.101990466580006148E+06, 0.101891305283198890E+06, 0.101794051647235989E+06, 0.101701758202335564E+06, - 0.101617607399452128E+06, 0.101545673956610553E+06, 0.101493920019806435E+06, 0.101463389589686616E+06, 0.101454707404169429E+06, - 0.101465784796775130E+06, 0.101489404864046577E+06, 0.101519701691131908E+06, 0.101547620610180951E+06, 0.101565576165996550E+06, - 0.101562026624260950E+06, 0.101539419490073633E+06, 0.101508015501831396E+06, 0.101475602714955035E+06, 0.101449209652947975E+06, - 0.101436251410560508E+06, 0.101442877175111498E+06, 0.101471341372345414E+06, 0.101518178052896081E+06, 0.101577355032239313E+06, - 0.101641314782584261E+06, 0.101703564541155953E+06, 0.101762362987943518E+06, 0.101818379277178246E+06, 0.101872714548978096E+06, - 0.101924119264252775E+06, 0.101966776195386803E+06, 0.101995500768842219E+06, 0.102007086660768691E+06, 0.102002030153628395E+06, - 0.101985038462701981E+06, 0.101956611217972633E+06, 0.101924174284332606E+06, 0.101890531345005773E+06, 0.101858684611865552E+06, - 0.101821867670641383E+06, 0.101781442886233301E+06, 0.101738169818174909E+06, 0.101693020445221118E+06, 0.101649533509090848E+06, - 0.101606065252630258E+06, 0.101563356987927487E+06, 0.101522196794781717E+06, 0.101483000104046587E+06, 0.101448492093986119E+06, - 0.101420196255985837E+06, 0.101395294590973572E+06, 0.101373162271020163E+06, 0.101359621762719311E+06, 0.101356933368830039E+06, - 0.101368947980949306E+06, 0.101392192190573551E+06, 0.101417779659041989E+06, 0.101442531040709990E+06, 0.101462476541542521E+06, - 0.101476476704636079E+06, 0.101486973325915984E+06, 0.101492708978460287E+06, 0.101491506327010982E+06, 0.101476163566485891E+06, - 0.101454012045195879E+06, 0.101426588508176050E+06, 0.101395767868210212E+06, 0.101361555520167341E+06, 0.101327388871009054E+06, - 0.101300667576237203E+06, 0.101284994174892112E+06, 0.101283350959747040E+06, 0.101309210052713708E+06, 0.101350688755181967E+06, - 0.101399465772761600E+06, 0.101451857069433157E+06, 0.101504338927611956E+06, 0.101548087731741456E+06, 0.101585173851711908E+06, - 0.101617418107249265E+06, 0.101645918462371425E+06, 0.101672368866688703E+06, 0.101702644054264791E+06, 0.101756834440843944E+06, - 0.101815020493009375E+06, 0.100745394112667054E+06, 0.100799832870823317E+06, 0.100863855953311213E+06, 0.100936251298315474E+06, - 0.101015648499264644E+06, 0.101104654341683374E+06, 0.101200128443110370E+06, 0.101296361142831636E+06, 0.101389195762127056E+06, - 0.101477275829104881E+06, 0.101559295351936235E+06, 0.101633387586243814E+06, 0.101697961740723156E+06, 0.101751772598623953E+06, - 0.101793901427349119E+06, 0.101823866729636080E+06, 0.101841583691637163E+06, 0.101847052782340179E+06, 0.101840097601263231E+06, - 0.101819364884434224E+06, 0.101788292383590582E+06, 0.101747405137351147E+06, 0.101695621343299601E+06, 0.101627436111935327E+06, - 0.101550322384277897E+06, 0.101465476616664964E+06, 0.101374194733789423E+06, 0.101277718928660746E+06, 0.101177047947947533E+06, - 0.101075621770040874E+06, 0.100963507971772880E+06, 0.100850151599165794E+06, 0.100741049456883455E+06, 0.100641201275214524E+06, - 0.100555640521779089E+06, 0.100489164793431541E+06, 0.100453712051746988E+06, 0.100455966233873114E+06, 0.100484341033634380E+06, - 0.100537490332318921E+06, 0.100620003905902136E+06, 0.100729309835612949E+06, 0.100858870023752374E+06, 0.101002649715674357E+06, - 0.101147678361066428E+06, 0.101287802540963821E+06, 0.101417496539417145E+06, 0.101532273896933402E+06, 0.101613683175199098E+06, - 0.101680723164626179E+06, 0.101737444859119263E+06, 0.101791182708811306E+06, 0.101841314940347904E+06, 0.101891796533315224E+06, - 0.101941590080887530E+06, 0.101990059211011772E+06, 0.102037355306302023E+06, 0.102083701488133767E+06, 0.102136891332944331E+06, - 0.102186806386969169E+06, 0.102230479823408270E+06, 0.102264774535572782E+06, 0.102290420308268731E+06, 0.102307702555592783E+06, - 0.102317766904831617E+06, 0.102321662148245741E+06, 0.102321498408406202E+06, 0.102320441248726507E+06, 0.102319523718290511E+06, - 0.102322447750704567E+06, 0.102327503158949214E+06, 0.102340754529364640E+06, 0.102353506384693246E+06, 0.102362358688122375E+06, - 0.102364445626707267E+06, 0.102355674159446760E+06, 0.102335040551811529E+06, 0.102301981999839074E+06, 0.102255676163442389E+06, - 0.102195798314690837E+06, 0.102122639698007450E+06, 0.102039086723219865E+06, 0.101949840960878224E+06, 0.101859938889724974E+06, - 0.101771880315094095E+06, 0.101689691466275064E+06, 0.101619553461018091E+06, 0.101564784382206009E+06, 0.101527063676792590E+06, - 0.101506865347517232E+06, 0.101503522390084341E+06, 0.101512744653858725E+06, 0.101529231308459130E+06, 0.101545937638918578E+06, - 0.101543746232650679E+06, 0.101529149091683401E+06, 0.101505036617385034E+06, 0.101477259643610611E+06, 0.101452985842091570E+06, - 0.101443019818922796E+06, 0.101450005107018835E+06, 0.101477223491849247E+06, 0.101523231314288976E+06, 0.101581629450517838E+06, - 0.101644098508760901E+06, 0.101703051093558723E+06, 0.101755080739197074E+06, 0.101801349748540073E+06, 0.101847343504094184E+06, - 0.101892088842664132E+06, 0.101930776572625342E+06, 0.101959972929516225E+06, 0.101973275480066382E+06, 0.101972016851233420E+06, - 0.101959747868463455E+06, 0.101940685784926434E+06, 0.101919336338791196E+06, 0.101894507185877927E+06, 0.101871113669696017E+06, - 0.101847657889249851E+06, 0.101820887903955852E+06, 0.101784170021964572E+06, 0.101741602583369866E+06, 0.101694747059338464E+06, - 0.101647292622998575E+06, 0.101600773270067424E+06, 0.101554052329806203E+06, 0.101509997350416306E+06, 0.101472107321641699E+06, - 0.101442071551669200E+06, 0.101420240877131699E+06, 0.101406891473258380E+06, 0.101396015807551084E+06, 0.101392164060749914E+06, - 0.101397198621684831E+06, 0.101410725481402653E+06, 0.101436168965154429E+06, 0.101464448461599168E+06, 0.101491134274545591E+06, - 0.101513817760506034E+06, 0.101531534488231206E+06, 0.101544658070101810E+06, 0.101551681755858954E+06, 0.101551216434335554E+06, - 0.101539195357785327E+06, 0.101514919199184893E+06, 0.101483010220912314E+06, 0.101448007466093870E+06, 0.101414858070553688E+06, - 0.101383218898751307E+06, 0.101359262217297684E+06, 0.101346709055278770E+06, 0.101347915439013712E+06, 0.101365119587774912E+06, - 0.101407924765819262E+06, 0.101458658683875430E+06, 0.101515675014729291E+06, 0.101573920518004117E+06, 0.101629788706552135E+06, - 0.101668434413804149E+06, 0.101700504314289530E+06, 0.101727848552964642E+06, 0.101752288382924846E+06, 0.101776226460626523E+06, - 0.101814361167678813E+06, 0.101872139466116685E+06, 0.100694816386903738E+06, 0.100748531064111390E+06, 0.100812413075077391E+06, - 0.100885240325433202E+06, 0.100971984589634725E+06, 0.101066079836500590E+06, 0.101163332246353209E+06, 0.101261519892330936E+06, - 0.101358385768427062E+06, 0.101451421123224791E+06, 0.101536054276749637E+06, 0.101612689419430462E+06, 0.101679641914763270E+06, - 0.101735174644287632E+06, 0.101778750617147758E+06, 0.101810665166487233E+06, 0.101830410029895895E+06, 0.101837810772118624E+06, - 0.101833022665443903E+06, 0.101816510393020842E+06, 0.101787854012666052E+06, 0.101744823421577603E+06, 0.101683938556403096E+06, - 0.101613036597664483E+06, 0.101532884942156001E+06, 0.101444504410039342E+06, 0.101349069651044396E+06, 0.101247781610335631E+06, - 0.101141708506075884E+06, 0.101021202144232695E+06, 0.100894721062327983E+06, 0.100769982600624178E+06, 0.100655427823023274E+06, - 0.100550770964121868E+06, 0.100461477319971644E+06, 0.100396193533225101E+06, 0.100370475160386210E+06, 0.100369362731624045E+06, - 0.100393088104568509E+06, 0.100440996230512974E+06, 0.100511511049115361E+06, 0.100603846780177613E+06, 0.100726574426591877E+06, - 0.100871208402494914E+06, 0.101018016887883554E+06, 0.101160944293748136E+06, 0.101294154343677379E+06, 0.101398406532467285E+06, - 0.101478074072107382E+06, 0.101546049324473512E+06, 0.101603974418745871E+06, 0.101653727077973454E+06, 0.101697954544609078E+06, - 0.101741376690074656E+06, 0.101789988330066262E+06, 0.101838680208411213E+06, 0.101887795803836605E+06, 0.101942598855672841E+06, - 0.102000837418646348E+06, 0.102056277940396962E+06, 0.102106768405713607E+06, 0.102150535774670396E+06, 0.102182996899048041E+06, - 0.102206750157000613E+06, 0.102221201245532342E+06, 0.102228757950974235E+06, 0.102230269318708335E+06, 0.102229908214737996E+06, - 0.102230221444085299E+06, 0.102233117647704858E+06, 0.102243955867660014E+06, 0.102261169827573845E+06, 0.102280623025385154E+06, - 0.102298710646779829E+06, 0.102311720481040116E+06, 0.102316483254606297E+06, 0.102310329085876278E+06, 0.102292054686377145E+06, - 0.102261582445110776E+06, 0.102217278999264774E+06, 0.102159938958497296E+06, 0.102090651836751262E+06, 0.102014420809727890E+06, - 0.101933158619991009E+06, 0.101851325383247095E+06, 0.101773700996606422E+06, 0.101704655579852813E+06, 0.101645470306280142E+06, - 0.101599387487163476E+06, 0.101568762309086727E+06, 0.101551200721109650E+06, 0.101544950055199806E+06, 0.101545234940555893E+06, - 0.101536151271568684E+06, 0.101520957074193793E+06, 0.101499514166347813E+06, 0.101472481430049040E+06, 0.101447481037651174E+06, - 0.101431698928562022E+06, 0.101432519665399988E+06, 0.101455989679772596E+06, 0.101503867701139068E+06, 0.101569707321795955E+06, - 0.101641541183263049E+06, 0.101707359784777087E+06, 0.101760909663319078E+06, 0.101802944092112913E+06, 0.101837429073186562E+06, - 0.101868490058515003E+06, 0.101895999089963501E+06, 0.101921719560774494E+06, 0.101935208629263929E+06, 0.101934734847469299E+06, - 0.101921789770189804E+06, 0.101905337918664198E+06, 0.101889233907825823E+06, 0.101876223533093609E+06, 0.101864529046626514E+06, - 0.101850666495852842E+06, 0.101835575764428810E+06, 0.101815211112956240E+06, 0.101783740571016519E+06, 0.101739678309719806E+06, - 0.101689041718466135E+06, 0.101634899667157661E+06, 0.101583884425190394E+06, 0.101535509776931387E+06, 0.101491128441498251E+06, - 0.101453011421685966E+06, 0.101428708334432333E+06, 0.101415133080661239E+06, 0.101411902195392497E+06, 0.101415741142001993E+06, - 0.101421700628259656E+06, 0.101434916879656914E+06, 0.101454096376128975E+06, 0.101478884585159176E+06, 0.101507961817356219E+06, - 0.101534772926637874E+06, 0.101557090728886120E+06, 0.101574113620330667E+06, 0.101587280909418565E+06, 0.101593317203057959E+06, - 0.101589233196906163E+06, 0.101574814776511601E+06, 0.101547332581751762E+06, 0.101514869284270651E+06, 0.101481998192358122E+06, - 0.101452150550811974E+06, 0.101427572510067519E+06, 0.101409813743047896E+06, 0.101403676308175665E+06, 0.101410943983370715E+06, - 0.101433007929108295E+06, 0.101473704830047689E+06, 0.101528968358056605E+06, 0.101588585098966272E+06, 0.101648865730780017E+06, - 0.101706538485246449E+06, 0.101754905727487509E+06, 0.101785976200502380E+06, 0.101811017148794053E+06, 0.101832089114193281E+06, - 0.101851827047180632E+06, 0.101871848271984418E+06, 0.101914442748880043E+06, 0.100645050821058583E+06, 0.100697921098829320E+06, - 0.100761591261288675E+06, 0.100844244243942405E+06, 0.100934005537327830E+06, 0.101028963380699686E+06, 0.101127123691640561E+06, - 0.101226361187462535E+06, 0.101324505036089657E+06, 0.101419431488063798E+06, 0.101509163971173737E+06, 0.101590063785101636E+06, - 0.101657671467199980E+06, 0.101713396702810118E+06, 0.101758515364488485E+06, 0.101792091325616479E+06, 0.101813481673006056E+06, - 0.101822350253392695E+06, 0.101818668615804971E+06, 0.101802702749391727E+06, 0.101774619027333058E+06, 0.101728109831474241E+06, - 0.101668908134665704E+06, 0.101597584119515159E+06, 0.101516856663981162E+06, 0.101427599824837293E+06, 0.101330896414631075E+06, - 0.101227935201261804E+06, 0.101113372919066416E+06, 0.100989129696766337E+06, 0.100861373889168084E+06, 0.100733678225485171E+06, - 0.100610105917794019E+06, 0.100495004451233079E+06, 0.100402578780181022E+06, 0.100353109983544055E+06, 0.100326440206043859E+06, - 0.100322735531117156E+06, 0.100342802276422299E+06, 0.100386646482634504E+06, 0.100453451962470805E+06, 0.100549574897853177E+06, - 0.100666205550992949E+06, 0.100795807241975184E+06, 0.100931381874395069E+06, 0.101067411193584325E+06, 0.101192762302618430E+06, - 0.101283622761741586E+06, 0.101362350787791220E+06, 0.101430423297678528E+06, 0.101489314399921583E+06, 0.101540641111512159E+06, - 0.101585585061290316E+06, 0.101627410996723280E+06, 0.101667724011934901E+06, 0.101707970653555123E+06, 0.101751269935565215E+06, - 0.101811021944586406E+06, 0.101870809774501089E+06, 0.101928469764575537E+06, 0.101981732364511379E+06, 0.102026310772180412E+06, - 0.102061898497918446E+06, 0.102089845634957077E+06, 0.102110105242362508E+06, 0.102121882127719451E+06, 0.102124061355970684E+06, - 0.102123733324673376E+06, 0.102124546125847337E+06, 0.102129219082775890E+06, 0.102145351303200790E+06, 0.102166260171440692E+06, - 0.102190433845960331E+06, 0.102216291023032318E+06, 0.102242152119835548E+06, 0.102260901292175229E+06, 0.102271019053290802E+06, - 0.102270194336435845E+06, 0.102258376332468251E+06, 0.102232740434276260E+06, 0.102193082447496578E+06, 0.102140339518538545E+06, - 0.102077291761659100E+06, 0.102007943796066291E+06, 0.101934901694509579E+06, 0.101863769251748963E+06, 0.101795867039438526E+06, - 0.101734634917306947E+06, 0.101683465453549536E+06, 0.101643719755611994E+06, 0.101613589850316028E+06, 0.101591266195843433E+06, - 0.101568063676064237E+06, 0.101544190597726789E+06, 0.101518173523634308E+06, 0.101489293133355706E+06, 0.101456969224960791E+06, - 0.101429471204937334E+06, 0.101413477375518429E+06, 0.101417790921687454E+06, 0.101450822395921219E+06, 0.101510233193849519E+06, - 0.101585841462266966E+06, 0.101664438788265412E+06, 0.101733920550829818E+06, 0.101788706066789920E+06, 0.101825829329588349E+06, - 0.101850405636027645E+06, 0.101871083937706790E+06, 0.101887382097668247E+06, 0.101896455049501354E+06, 0.101897289413654769E+06, - 0.101886248870001597E+06, 0.101867415759247539E+06, 0.101847995171556977E+06, 0.101838485076295401E+06, 0.101834100858943464E+06, - 0.101832686427819717E+06, 0.101828063075528247E+06, 0.101816399093795466E+06, 0.101796719243765314E+06, 0.101767216502717842E+06, - 0.101721966250064579E+06, 0.101668953652310433E+06, 0.101611959093829370E+06, 0.101556227036786251E+06, 0.101506414279391960E+06, - 0.101461971390057777E+06, 0.101425468706421860E+06, 0.101404163733341426E+06, 0.101399096476539751E+06, 0.101405522879150667E+06, - 0.101421050121819761E+06, 0.101438689378578158E+06, 0.101460180927881505E+06, 0.101485796004159551E+06, 0.101513713918150577E+06, - 0.101542550860272706E+06, 0.101568068025141562E+06, 0.101588331740948968E+06, 0.101600913455480535E+06, 0.101607630152187616E+06, - 0.101607407012941694E+06, 0.101598607139348926E+06, 0.101581645287700347E+06, 0.101557205094100689E+06, 0.101527626140599372E+06, - 0.101498954813168501E+06, 0.101474478229909684E+06, 0.101456851592814171E+06, 0.101447916547657107E+06, 0.101451532249133510E+06, - 0.101469023039587555E+06, 0.101500095660945575E+06, 0.101543265481331633E+06, 0.101599989966535504E+06, 0.101661394639400824E+06, - 0.101722843298708525E+06, 0.101781217785530855E+06, 0.101833962893083750E+06, 0.101869504665579036E+06, 0.101891006131465809E+06, - 0.101907724224272592E+06, 0.101922174311177543E+06, 0.101935867942354409E+06, 0.101950426065447158E+06, 0.100607098755765037E+06, - 0.100655240281701743E+06, 0.100726600376942501E+06, 0.100809356254825645E+06, 0.100899004634437370E+06, 0.100993829979357848E+06, - 0.101091906852125423E+06, 0.101191172811513417E+06, 0.101289507328918466E+06, 0.101384817108912728E+06, 0.101475128234200398E+06, - 0.101556622026723067E+06, 0.101627508170991190E+06, 0.101685968687809233E+06, 0.101732567539073978E+06, 0.101767665006896481E+06, - 0.101790488350008833E+06, 0.101800548295886649E+06, 0.101797644943693944E+06, 0.101781861361740375E+06, 0.101747873759633774E+06, - 0.101701859594637368E+06, 0.101644745116156497E+06, 0.101577648617696381E+06, 0.101501095515959882E+06, 0.101413668608079461E+06, - 0.101318547892610906E+06, 0.101214143017131020E+06, 0.101099338905386365E+06, 0.100978397278849705E+06, 0.100854041321450713E+06, - 0.100729710648106629E+06, 0.100609462614676057E+06, 0.100497826949930561E+06, 0.100414459388165211E+06, 0.100356511886266162E+06, - 0.100322777395156372E+06, 0.100316042351856522E+06, 0.100332097081535409E+06, 0.100371561029088683E+06, 0.100439298341075264E+06, - 0.100532568922400489E+06, 0.100643002914990837E+06, 0.100765387761929349E+06, 0.100893492581718543E+06, 0.101020399500629603E+06, - 0.101112706098134367E+06, 0.101194570041727216E+06, 0.101269273413618284E+06, 0.101335562528605122E+06, 0.101394060212437602E+06, - 0.101445483977905038E+06, 0.101491335215433006E+06, 0.101533800970901357E+06, 0.101574594133775521E+06, 0.101615314066683874E+06, - 0.101662259781339875E+06, 0.101713149881755875E+06, 0.101764653351764238E+06, 0.101815034877485959E+06, 0.101864609985221337E+06, - 0.101906670614871124E+06, 0.101942016196974146E+06, 0.101970135166829859E+06, 0.101990609169172516E+06, 0.101996950610404732E+06, - 0.101996810049367472E+06, 0.101996317886868128E+06, 0.101998445642552077E+06, 0.102008824591142213E+06, 0.102027635971959302E+06, - 0.102051641514833580E+06, 0.102080850665324571E+06, 0.102117904503131693E+06, 0.102157634194590821E+06, 0.102192504721610734E+06, - 0.102219235460459910E+06, 0.102236777347130861E+06, 0.102242902162718834E+06, 0.102236355155139478E+06, 0.102216651883876315E+06, - 0.102180426444035780E+06, 0.102133083528179093E+06, 0.102077034681391349E+06, 0.102016323324797893E+06, 0.101953628282518228E+06, - 0.101890856388452012E+06, 0.101830915333128054E+06, 0.101779447310396441E+06, 0.101734080624489550E+06, 0.101693870504157734E+06, - 0.101656684022070389E+06, 0.101619340499046710E+06, 0.101584139894536143E+06, 0.101548750508560886E+06, 0.101508927593507731E+06, - 0.101469477866382847E+06, 0.101436805815304979E+06, 0.101415993387059803E+06, 0.101423466131997789E+06, 0.101453632286171531E+06, - 0.101508029375078389E+06, 0.101580823336132147E+06, 0.101656593588021438E+06, 0.101722011470405239E+06, 0.101771508397742451E+06, - 0.101807913013677957E+06, 0.101834964343916130E+06, 0.101850402618856344E+06, 0.101859186985402383E+06, 0.101860587418252151E+06, - 0.101854518941434624E+06, 0.101838720084331697E+06, 0.101819824582356232E+06, 0.101803402458019846E+06, 0.101796893209118367E+06, - 0.101799592648883248E+06, 0.101802452116411427E+06, 0.101801265547130839E+06, 0.101788566176828695E+06, 0.101765879286445153E+06, - 0.101732953696931960E+06, 0.101687950182710265E+06, 0.101633167492824286E+06, 0.101575598313827417E+06, 0.101518917024984054E+06, - 0.101468456845219422E+06, 0.101425013728590406E+06, 0.101390361593186084E+06, 0.101368216911030337E+06, 0.101370279495935785E+06, - 0.101384930299833504E+06, 0.101409208395769369E+06, 0.101438468993645060E+06, 0.101467787546390668E+06, 0.101499453696433935E+06, - 0.101530518538351142E+06, 0.101558938309742618E+06, 0.101581645149348537E+06, 0.101598207551499479E+06, 0.101607649285544889E+06, - 0.101609802844516307E+06, 0.101605573988511765E+06, 0.101593037714059843E+06, 0.101573514674016667E+06, 0.101549196000671189E+06, - 0.101522849664976588E+06, 0.101498330261054754E+06, 0.101479889987571310E+06, 0.101470097853539497E+06, 0.101471225349216998E+06, - 0.101486588535369752E+06, 0.101515334980482352E+06, 0.101556357596876667E+06, 0.101607560846124834E+06, 0.101666443968593783E+06, - 0.101729419441298363E+06, 0.101791387702929569E+06, 0.101848011454613385E+06, 0.101897514583017852E+06, 0.101939642427183790E+06, - 0.101960271009820077E+06, 0.101975158780464568E+06, 0.101986424653725320E+06, 0.101995822513432664E+06, 0.102004992120982162E+06, - 0.100578411052675729E+06, 0.100635318784110554E+06, 0.100702588041198120E+06, 0.100778983082032035E+06, 0.100867372014784603E+06, - 0.100961003291497836E+06, 0.101057944061462069E+06, 0.101156164506401896E+06, 0.101253562485936651E+06, 0.101348041518852056E+06, - 0.101435305736620867E+06, 0.101514565773677881E+06, 0.101585969098869886E+06, 0.101648080408071197E+06, 0.101699676885091831E+06, - 0.101737081890784044E+06, 0.101761287426791518E+06, 0.101772434840921720E+06, 0.101770158786062922E+06, 0.101748537453835859E+06, - 0.101714770053279746E+06, 0.101669742860261249E+06, 0.101614251954373656E+06, 0.101549290791504973E+06, 0.101476027861641691E+06, - 0.101395781087328636E+06, 0.101309332351133024E+06, 0.101208930191804626E+06, 0.101100827344175617E+06, 0.100987036454510526E+06, - 0.100870048278151575E+06, 0.100753131768219901E+06, 0.100640279785382925E+06, 0.100543839073244162E+06, 0.100470119984832578E+06, - 0.100412920571785522E+06, 0.100374418672954038E+06, 0.100356321711452154E+06, 0.100359754832890321E+06, 0.100393037545625295E+06, - 0.100461456665693026E+06, 0.100548040695085903E+06, 0.100649774320544951E+06, 0.100762231735881898E+06, 0.100879810004682629E+06, - 0.100978944107382951E+06, 0.101056139035317683E+06, 0.101129122973660080E+06, 0.101197131809436498E+06, 0.101259400864402109E+06, - 0.101315369721067444E+06, 0.101366567376128267E+06, 0.101413068730518760E+06, 0.101456050767495792E+06, 0.101497394979706776E+06, - 0.101540388547235518E+06, 0.101589723482442452E+06, 0.101639287384227951E+06, 0.101688119127630343E+06, 0.101734881227949692E+06, - 0.101774055633342999E+06, 0.101806176343790416E+06, 0.101833758016756707E+06, 0.101855867301477920E+06, 0.101869669516056863E+06, - 0.101867423844660036E+06, 0.101862185064065459E+06, 0.101857648911106618E+06, 0.101857166947219768E+06, 0.101869453362050233E+06, - 0.101889395994667357E+06, 0.101917145273055416E+06, 0.101952665990595080E+06, 0.102005113066678605E+06, 0.102059201352783610E+06, - 0.102110590092891594E+06, 0.102155134120450733E+06, 0.102189008661845161E+06, 0.102212893719536674E+06, 0.102224794573552019E+06, - 0.102221917283866860E+06, 0.102203717818992911E+06, 0.102173729797711843E+06, 0.102134066117315539E+06, 0.102088155198460590E+06, - 0.102037322504280150E+06, 0.101983804157969324E+06, 0.101930882216981918E+06, 0.101882568835916391E+06, 0.101835848097687121E+06, - 0.101791045975844638E+06, 0.101745969221785286E+06, 0.101701401299452598E+06, 0.101658034247290489E+06, 0.101613792586539625E+06, - 0.101566658381616784E+06, 0.101523107840297394E+06, 0.101485865057037794E+06, 0.101467196461575470E+06, 0.101465231282475186E+06, - 0.101481792269703801E+06, 0.101521171184929379E+06, 0.101584362409188645E+06, 0.101654606382538637E+06, 0.101708085889500013E+06, - 0.101750884319908815E+06, 0.101781151271932016E+06, 0.101802265119226417E+06, 0.101814660749166302E+06, 0.101818059160636913E+06, - 0.101815376584443497E+06, 0.101808025978518664E+06, 0.101796093709958877E+06, 0.101783205967926551E+06, 0.101773519465245452E+06, - 0.101768347262196490E+06, 0.101772318875173907E+06, 0.101774032894583841E+06, 0.101769304008539359E+06, 0.101752736287782580E+06, - 0.101724576811767562E+06, 0.101687606667018787E+06, 0.101642832213384885E+06, 0.101588413046507747E+06, 0.101532052789407389E+06, - 0.101477089478998780E+06, 0.101426937636667906E+06, 0.101383983337104524E+06, 0.101350070067916895E+06, 0.101327894217902314E+06, - 0.101330294767154453E+06, 0.101349863124191863E+06, 0.101379498558547202E+06, 0.101415335536042723E+06, 0.101450570253408456E+06, - 0.101486617503024216E+06, 0.101521790468661828E+06, 0.101553679702050722E+06, 0.101576951634593526E+06, 0.101592599322586801E+06, - 0.101600882539355007E+06, 0.101601982296252419E+06, 0.101593711037322297E+06, 0.101576295595724252E+06, 0.101552760225610255E+06, - 0.101525860012702775E+06, 0.101500304746004782E+06, 0.101482529221745732E+06, 0.101472615361795470E+06, 0.101472486373178777E+06, - 0.101483501295817390E+06, 0.101509279618775763E+06, 0.101549321581216165E+06, 0.101600205319342873E+06, 0.101659295372980385E+06, - 0.101721590076149907E+06, 0.101783337171577281E+06, 0.101842427132610639E+06, 0.101897333754838794E+06, 0.101946395082493676E+06, - 0.101988236942542819E+06, 0.102017526821220177E+06, 0.102031828714653369E+06, 0.102041305631011754E+06, 0.102047936605813040E+06, - 0.102053545022376406E+06, 0.100561618890645521E+06, 0.100618675407796312E+06, 0.100685232428278308E+06, 0.100760148812781379E+06, - 0.100842043992347171E+06, 0.100930626779751663E+06, 0.101025380770443604E+06, 0.101121496737499227E+06, 0.101216863489791329E+06, - 0.101306591907260168E+06, 0.101390820508431876E+06, 0.101469198549494278E+06, 0.101540194252744899E+06, 0.101602382440106187E+06, - 0.101654511301229999E+06, 0.101695567045773627E+06, 0.101724835997739530E+06, 0.101738206502799672E+06, 0.101728469792924647E+06, - 0.101706705766990082E+06, 0.101673943944349550E+06, 0.101630654689779229E+06, 0.101577521269946941E+06, 0.101515423259462186E+06, - 0.101445417400194085E+06, 0.101369301689578249E+06, 0.101289207179891833E+06, 0.101202291357723705E+06, 0.101109840862024794E+06, - 0.101010060536526478E+06, 0.100903624985256116E+06, 0.100797206247763170E+06, 0.100697721229483854E+06, 0.100617879166639119E+06, - 0.100549334862444375E+06, 0.100494554672908853E+06, 0.100455829928310864E+06, 0.100435159192249281E+06, 0.100434140902790139E+06, - 0.100463827743078145E+06, 0.100516682399563157E+06, 0.100588924784875649E+06, 0.100677081454071609E+06, 0.100775641942890885E+06, - 0.100875619518922729E+06, 0.100945870321605689E+06, 0.101013133541299816E+06, 0.101077503451870405E+06, 0.101138697419382283E+06, - 0.101196245970018281E+06, 0.101247478059058092E+06, 0.101295381961911495E+06, 0.101341293286219021E+06, 0.101385520658941925E+06, - 0.101428507369388099E+06, 0.101477628384924552E+06, 0.101527439265766385E+06, 0.101575625370267109E+06, 0.101621502298168052E+06, - 0.101663832962092813E+06, 0.101694866512688139E+06, 0.101720503961646493E+06, 0.101740691340596662E+06, 0.101755087321406769E+06, - 0.101753809082437700E+06, 0.101741526291839808E+06, 0.101728608499199152E+06, 0.101718502985755840E+06, 0.101716703972249219E+06, - 0.101727329002141589E+06, 0.101746865685733879E+06, 0.101776394054624689E+06, 0.101821041668101156E+06, 0.101883903619016666E+06, - 0.101950707313021689E+06, 0.102016579439056790E+06, 0.102074857884153607E+06, 0.102122966684235507E+06, 0.102162229375958646E+06, - 0.102191070936530305E+06, 0.102205291241337400E+06, 0.102205781057829736E+06, 0.102194562190391560E+06, 0.102173148282368042E+06, - 0.102144343637741913E+06, 0.102108830373893230E+06, 0.102068178268037620E+06, 0.102026306869767315E+06, 0.101984352807968040E+06, - 0.101941207962857719E+06, 0.101897306791024865E+06, 0.101851675563811092E+06, 0.101805566459294409E+06, 0.101759497966033654E+06, - 0.101711369603787127E+06, 0.101663340792011426E+06, 0.101619227450208040E+06, 0.101582695699032221E+06, 0.101558695579259147E+06, - 0.101546029798913645E+06, 0.101545588074274448E+06, 0.101567771713567665E+06, 0.101607748589558381E+06, 0.101688531278736336E+06, - 0.101712604992569381E+06, 0.101743096832469848E+06, 0.101760620836449103E+06, 0.101769961191482769E+06, 0.101772822414354494E+06, - 0.101770897529126829E+06, 0.101765958574697099E+06, 0.101759443212774597E+06, 0.101753267088761611E+06, 0.101750523367411457E+06, - 0.101749706624054088E+06, 0.101749678109808025E+06, 0.101749285406108000E+06, 0.101744523322546709E+06, 0.101733022628531995E+06, - 0.101711787295703034E+06, 0.101679008351294804E+06, 0.101639130834085285E+06, 0.101593625025334943E+06, 0.101541393928166348E+06, - 0.101487105460277933E+06, 0.101434417444056598E+06, 0.101385551046964029E+06, 0.101342006161188154E+06, 0.101307140291916905E+06, - 0.101283659047930778E+06, 0.101280818499683781E+06, 0.101302531797972479E+06, 0.101335121595155433E+06, 0.101374651651055479E+06, - 0.101415853089015101E+06, 0.101456337388213346E+06, 0.101495434796083166E+06, 0.101530692665964845E+06, 0.101556780887815577E+06, - 0.101572252524485899E+06, 0.101580348283763422E+06, 0.101581288046389862E+06, 0.101573497525049606E+06, 0.101553231842264839E+06, - 0.101527699101148173E+06, 0.101500366015751919E+06, 0.101475147159402040E+06, 0.101462872833845016E+06, 0.101461553787802579E+06, - 0.101470899121458526E+06, 0.101491574771335596E+06, 0.101526109462851629E+06, 0.101575993595638676E+06, 0.101633539000189689E+06, - 0.101696017474012726E+06, 0.101760468358366721E+06, 0.101823741442191822E+06, 0.101882328042741588E+06, 0.101936367528451112E+06, - 0.101984427337493747E+06, 0.102025414498975340E+06, 0.102058638462272647E+06, 0.102075739484648249E+06, 0.102084208298001584E+06, - 0.102090352048999324E+06, 0.102097473483009948E+06, 0.100548208007167515E+06, 0.100605095427047316E+06, 0.100670706010579946E+06, - 0.100743978438203791E+06, 0.100823629545142438E+06, 0.100908178696427160E+06, 0.100995982580288008E+06, 0.101087314481146692E+06, - 0.101176414116338347E+06, 0.101262458356531424E+06, 0.101344547676157905E+06, 0.101421163164599711E+06, 0.101490796631980134E+06, - 0.101552014265238700E+06, 0.101603518886931997E+06, 0.101644210460807284E+06, 0.101673244462872826E+06, 0.101680735386759538E+06, - 0.101674706326058280E+06, 0.101655388783202914E+06, 0.101624670690422980E+06, 0.101584138623298597E+06, 0.101534372942937815E+06, - 0.101476149074961329E+06, 0.101410568098193849E+06, 0.101343974609530458E+06, 0.101270896963409337E+06, 0.101192137510717424E+06, - 0.101108880683603289E+06, 0.101022724309234283E+06, 0.100935715390839119E+06, 0.100850390680374665E+06, 0.100774745624155403E+06, - 0.100703597598235123E+06, 0.100641200968575649E+06, 0.100589854186508950E+06, 0.100551830710988637E+06, 0.100529267606730675E+06, - 0.100528295556730111E+06, 0.100549682448172025E+06, 0.100589658714417616E+06, 0.100646339245096955E+06, 0.100716647083594595E+06, - 0.100796330849082777E+06, 0.100862509969368170E+06, 0.100921980592583743E+06, 0.100978572070364797E+06, 0.101033342690100937E+06, - 0.101086524659137300E+06, 0.101137201268390738E+06, 0.101183872284207260E+06, 0.101229010938212319E+06, 0.101273109489612165E+06, - 0.101316619892713090E+06, 0.101361395459038307E+06, 0.101412097251747749E+06, 0.101462443230712757E+06, 0.101510984330326377E+06, - 0.101556016862365155E+06, 0.101593723038725308E+06, 0.101622224707454676E+06, 0.101642725690420295E+06, 0.101656123946685548E+06, - 0.101662476115757090E+06, 0.101646779923387396E+06, 0.101626132803217159E+06, 0.101605491482854268E+06, 0.101589147781629013E+06, - 0.101585251139149026E+06, 0.101593208937773641E+06, 0.101612184718608827E+06, 0.101643206312575028E+06, 0.101695818816071987E+06, - 0.101764928221785813E+06, 0.101840193899589591E+06, 0.101916494038259974E+06, 0.101982907500618603E+06, 0.102040970845980133E+06, - 0.102091837845918839E+06, 0.102134078254784647E+06, 0.102164394058369740E+06, 0.102183887971255608E+06, 0.102192909965391460E+06, - 0.102191628213096585E+06, 0.102180725302393228E+06, 0.102161729213580154E+06, 0.102136138522838941E+06, 0.102107142982990175E+06, - 0.102074807010027405E+06, 0.102039103318180598E+06, 0.102000767273371166E+06, 0.101960362993373739E+06, 0.101918302600709168E+06, - 0.101875356744285367E+06, 0.101830760544282428E+06, 0.101787058843222650E+06, 0.101746854946198102E+06, 0.101712081627763269E+06, - 0.101684170852595838E+06, 0.101663959106856215E+06, 0.101652494286064044E+06, 0.101669560085676902E+06, 0.101704444840698343E+06, - 0.101700571875176043E+06, 0.101721535240709272E+06, 0.101745779185469408E+06, 0.101743873285487498E+06, 0.101738112527286779E+06, - 0.101730354652939321E+06, 0.101722249363334777E+06, 0.101714810079808434E+06, 0.101708639567806546E+06, 0.101706113756708350E+06, - 0.101714036658689380E+06, 0.101722369687996295E+06, 0.101728359378835914E+06, 0.101725407412529981E+06, 0.101714092896974922E+06, - 0.101695958827062772E+06, 0.101670373525743838E+06, 0.101635678816692453E+06, 0.101595418488830386E+06, 0.101550830010831283E+06, - 0.101501001127021242E+06, 0.101448446456819016E+06, 0.101396954698346424E+06, 0.101348845039631386E+06, 0.101304062386825870E+06, - 0.101267451987425215E+06, 0.101242193004994537E+06, 0.101233636404356381E+06, 0.101254846780972948E+06, 0.101287816325990920E+06, - 0.101328479900242310E+06, 0.101372263340125617E+06, 0.101414617472293321E+06, 0.101455579958959497E+06, 0.101492853465017077E+06, - 0.101523278594798670E+06, 0.101540885808085994E+06, 0.101551450070809791E+06, 0.101555278183125236E+06, 0.101552538038431827E+06, - 0.101533468414678850E+06, 0.101508500675057512E+06, 0.101482796927905787E+06, 0.101462379842144772E+06, 0.101454892688142470E+06, - 0.101464325466535738E+06, 0.101484135316789325E+06, 0.101513829601535981E+06, 0.101552601163330517E+06, 0.101603687744035284E+06, - 0.101663791684624332E+06, 0.101727767774695865E+06, 0.101792762408730807E+06, 0.101856171640086162E+06, 0.101914393070144404E+06, - 0.101966522189743861E+06, 0.102012469486766611E+06, 0.102051444457628037E+06, 0.102084940153698932E+06, 0.102109046172999864E+06, - 0.102120432478447823E+06, 0.102128404810622902E+06, 0.102134103220031029E+06, 0.100537775584916468E+06, 0.100594064464056602E+06, - 0.100658361556240663E+06, 0.100729672253821584E+06, 0.100806792979668055E+06, 0.100888331818478662E+06, 0.100972640703881028E+06, - 0.101054356923499276E+06, 0.101136218305642746E+06, 0.101218059282136164E+06, 0.101297128938538604E+06, 0.101371075949467442E+06, - 0.101438396724319813E+06, 0.101497631946100053E+06, 0.101547424352719638E+06, 0.101586575081165560E+06, 0.101605344305898223E+06, - 0.101611802560867160E+06, 0.101607062825132700E+06, 0.101591492022024759E+06, 0.101565740711957988E+06, 0.101530433274754861E+06, - 0.101485334233030881E+06, 0.101432291750987933E+06, 0.101377329376169117E+06, 0.101317207789115375E+06, 0.101251671625233779E+06, - 0.101181417558871472E+06, 0.101107498655681804E+06, 0.101031350521440603E+06, 0.100954821051961742E+06, 0.100889588668171375E+06, - 0.100831564213864112E+06, 0.100778330447916189E+06, 0.100731315465427993E+06, 0.100686629349019524E+06, 0.100649847468544394E+06, - 0.100626941602005361E+06, 0.100623247975728824E+06, 0.100634858419738637E+06, 0.100661484011766472E+06, 0.100701891329741135E+06, - 0.100753800334865009E+06, 0.100807541818709986E+06, 0.100848659308669099E+06, 0.100892548219874385E+06, 0.100938268977634565E+06, - 0.100984815257879964E+06, 0.101031244555508310E+06, 0.101077229148432787E+06, 0.101120811543651638E+06, 0.101163080762204729E+06, - 0.101205133328227632E+06, 0.101247555470727515E+06, 0.101295212705033598E+06, 0.101345677435592734E+06, 0.101395414916676789E+06, - 0.101443142113523310E+06, 0.101487391928729412E+06, 0.101523112860496927E+06, 0.101551091220213115E+06, 0.101571202362138647E+06, - 0.101582765233024111E+06, 0.101580576420733298E+06, 0.101559006090641735E+06, 0.101532638260340871E+06, 0.101505636854472148E+06, - 0.101482925905383032E+06, 0.101478221569192814E+06, 0.101483749961331385E+06, 0.101500913638159356E+06, 0.101531272427147036E+06, - 0.101587537367870260E+06, 0.101657752923680528E+06, 0.101735341257440305E+06, 0.101815392189158199E+06, 0.101883415778570139E+06, - 0.101946670918334348E+06, 0.102005217869353437E+06, 0.102057696492837160E+06, 0.102103056512906318E+06, 0.102140317424393026E+06, - 0.102168554530401248E+06, 0.102186118819968382E+06, 0.102192209463688341E+06, 0.102189750578587409E+06, 0.102179864477714669E+06, - 0.102164622014063440E+06, 0.102144222519251431E+06, 0.102119031801210527E+06, 0.102090001778615697E+06, 0.102058500322085427E+06, - 0.102024456224525828E+06, 0.101988984142914618E+06, 0.101952414757101811E+06, 0.101915891308398845E+06, 0.101881589770049075E+06, - 0.101851270386932039E+06, 0.101822396029631869E+06, 0.101797879312661476E+06, 0.101778855518825338E+06, 0.101766764384149530E+06, - 0.101767117846749301E+06, 0.101765125533417420E+06, 0.101764893632733350E+06, 0.101755791518637372E+06, 0.101738415072208983E+06, - 0.101717693412627370E+06, 0.101697849566573597E+06, 0.101679653680022544E+06, 0.101666036116405725E+06, 0.101657802915804903E+06, - 0.101659358381537619E+06, 0.101675042132274451E+06, 0.101690591932105221E+06, 0.101702102691112683E+06, 0.101698890266004499E+06, - 0.101685170063431069E+06, 0.101664399827034271E+06, 0.101636981850683907E+06, 0.101602430202209493E+06, 0.101562887328751778E+06, - 0.101519409569218289E+06, 0.101470958313536248E+06, 0.101419317694792786E+06, 0.101368660117972962E+06, 0.101321145110236859E+06, - 0.101276071087296979E+06, 0.101238240695380387E+06, 0.101211277007847661E+06, 0.101197902530338179E+06, 0.101215581555680212E+06, - 0.101246094621904544E+06, 0.101284825497456564E+06, 0.101328072813235674E+06, 0.101370225701783012E+06, 0.101411514155655474E+06, - 0.101449747457354388E+06, 0.101482930506732373E+06, 0.101505336383574511E+06, 0.101520932260299305E+06, 0.101530875621757339E+06, - 0.101535660531138637E+06, 0.101527586118792417E+06, 0.101509422337400800E+06, 0.101491464951296075E+06, 0.101477501245060659E+06, - 0.101471117495995146E+06, 0.101486007619632292E+06, 0.101510757134502812E+06, 0.101544449952577212E+06, 0.101586055913800505E+06, - 0.101635695535260849E+06, 0.101695729268481853E+06, 0.101758721424995805E+06, 0.101822050355179599E+06, 0.101883639102236455E+06, - 0.101943513401448537E+06, 0.101994845858460889E+06, 0.102039591261445501E+06, 0.102076829661285185E+06, 0.102105964877399136E+06, - 0.102126794141653125E+06, 0.102139212624906431E+06, 0.102146437567661822E+06, 0.102150500772487969E+06, 0.100529766660700814E+06, - 0.100584936771645967E+06, 0.100647449978120101E+06, 0.100716367627817162E+06, 0.100790551176116554E+06, 0.100867761991881081E+06, - 0.100944392016551021E+06, 0.101022283363768598E+06, 0.101100094859150340E+06, 0.101176390860314190E+06, 0.101249683961219664E+06, - 0.101319429056106397E+06, 0.101383533080313195E+06, 0.101439851116198683E+06, 0.101486953091034593E+06, 0.101514035380600777E+06, - 0.101530274350960754E+06, 0.101536503930903316E+06, 0.101532791192708028E+06, 0.101519414459226711E+06, 0.101496896545514726E+06, - 0.101466032997577611E+06, 0.101427914819550628E+06, 0.101386928031759133E+06, 0.101339510051842895E+06, 0.101286534144961479E+06, - 0.101229073267725224E+06, 0.101167697805292846E+06, 0.101103306882333491E+06, 0.101037149535454111E+06, 0.100976699320003900E+06, - 0.100924651148493227E+06, 0.100875357695395811E+06, 0.100829790933326149E+06, 0.100789063316662927E+06, 0.100754382631035871E+06, - 0.100727001544673127E+06, 0.100712812235705482E+06, 0.100707393276471601E+06, 0.100709250582931563E+06, 0.100722573388958059E+06, - 0.100746645734061545E+06, 0.100779895700786001E+06, 0.100804396943602027E+06, 0.100830073367685545E+06, 0.100859556300720957E+06, - 0.100892387870409642E+06, 0.100927975633083144E+06, 0.100965551602012056E+06, 0.101004683619487085E+06, 0.101045330597207460E+06, - 0.101087013008305672E+06, 0.101129446011777312E+06, 0.101173089623770706E+06, 0.101224746709176397E+06, 0.101276086346010212E+06, - 0.101326149198708168E+06, 0.101374129662616979E+06, 0.101418481717269460E+06, 0.101456308681409500E+06, 0.101487100471046055E+06, - 0.101509891159304345E+06, 0.101523887972284254E+06, 0.101519085107067789E+06, 0.101499035636973305E+06, 0.101474107212159681E+06, - 0.101448532598947975E+06, 0.101428087461135481E+06, 0.101420183587270294E+06, 0.101421890388346379E+06, 0.101434924963140438E+06, - 0.101461175739645623E+06, 0.101512942173575240E+06, 0.101576674737662266E+06, 0.101648311032956131E+06, 0.101723489882150840E+06, - 0.101787480132178534E+06, 0.101850028038504926E+06, 0.101910282046108841E+06, 0.101967661149882086E+06, 0.102023524732844948E+06, - 0.102074242265323439E+06, 0.102118210977073832E+06, 0.102152171123111169E+06, 0.102173114540454029E+06, 0.102185669537254769E+06, - 0.102190716001940251E+06, 0.102189608656019511E+06, 0.102183136999173483E+06, 0.102171644521202223E+06, 0.102155743904811548E+06, - 0.102135288964191917E+06, 0.102110694874428111E+06, 0.102083194402445937E+06, 0.102053140888443799E+06, 0.102023029614340878E+06, - 0.101994305634375618E+06, 0.101968130490490352E+06, 0.101944981816832049E+06, 0.101917533305451230E+06, 0.101891792228334729E+06, - 0.101867962161627947E+06, 0.101846942835226117E+06, 0.101828399128989535E+06, 0.101808349218342468E+06, 0.101783185169399527E+06, - 0.101752129728330387E+06, 0.101717730687555537E+06, 0.101682415904166002E+06, 0.101651064189548269E+06, 0.101628214835530569E+06, - 0.101615101470726600E+06, 0.101622078677434256E+06, 0.101640462768905272E+06, 0.101659951220889372E+06, 0.101675418801938606E+06, - 0.101673225878615136E+06, 0.101661928138148622E+06, 0.101642662123728296E+06, 0.101615888022248750E+06, 0.101582080924031965E+06, - 0.101543348953446970E+06, 0.101500631267208417E+06, 0.101452586432289259E+06, 0.101401256146737229E+06, 0.101350655526253569E+06, - 0.101302884790491065E+06, 0.101258041134635379E+06, 0.101219975854280870E+06, 0.101192075948155878E+06, 0.101176911767419486E+06, - 0.101189137340948175E+06, 0.101215695508690798E+06, 0.101250828629981872E+06, 0.101291224981271953E+06, 0.101331080207125036E+06, - 0.101370380504028988E+06, 0.101408081153893057E+06, 0.101442820210735677E+06, 0.101470980944890180E+06, 0.101493569638212546E+06, - 0.101512139169726375E+06, 0.101526611096755121E+06, 0.101532495997983948E+06, 0.101522627542459595E+06, 0.101512420265735462E+06, - 0.101505304745591246E+06, 0.101504334695817597E+06, 0.101519650872094615E+06, 0.101547899391185740E+06, 0.101583965970937570E+06, - 0.101627433236286277E+06, 0.101678082609776582E+06, 0.101737298190423375E+06, 0.101799968663717998E+06, 0.101862212637869627E+06, - 0.101921525254885390E+06, 0.101975615485969174E+06, 0.102022129365600340E+06, 0.102060753757629835E+06, 0.102091435012152549E+06, - 0.102114037703653419E+06, 0.102128864386004381E+06, 0.102136712377933785E+06, 0.102141341896670521E+06, 0.102142376150148193E+06, - 0.100523535976660394E+06, 0.100577052820581303E+06, 0.100637236479140498E+06, 0.100703252727134633E+06, 0.100772552025250538E+06, - 0.100843355148487011E+06, 0.100916200005643404E+06, 0.100989978980367348E+06, 0.101063458978865412E+06, 0.101135313180651341E+06, - 0.101204158192835064E+06, 0.101268596961150513E+06, 0.101327267803054579E+06, 0.101379219393509498E+06, 0.101411658551840825E+06, - 0.101435013304419204E+06, 0.101449723991433348E+06, 0.101455671589434161E+06, 0.101452876078218949E+06, 0.101441532989260799E+06, - 0.101422046210621003E+06, 0.101395056661309005E+06, 0.101365757780455795E+06, 0.101332677387078918E+06, 0.101293673363073496E+06, - 0.101249457127459696E+06, 0.101201011753970408E+06, 0.101149108558075517E+06, 0.101094587629913221E+06, 0.101040779590145175E+06, - 0.100995382496306906E+06, 0.100951579695860622E+06, 0.100909850434587090E+06, 0.100870858422985533E+06, 0.100835419863702089E+06, - 0.100804467614276640E+06, 0.100781685669042199E+06, 0.100767335396187831E+06, 0.100759289879836622E+06, 0.100757866722066232E+06, - 0.100763078005519506E+06, 0.100774506516805646E+06, 0.100786062954307781E+06, 0.100793269206959361E+06, 0.100804822422906916E+06, - 0.100820834091496698E+06, 0.100841255618750598E+06, 0.100865889078778535E+06, 0.100894749198775666E+06, 0.100927416956011424E+06, - 0.100963395796724551E+06, 0.101002315623510774E+06, 0.101043887250100248E+06, 0.101091039191901757E+06, 0.101144066547046401E+06, - 0.101197932497966991E+06, 0.101251195535936524E+06, 0.101302429885710808E+06, 0.101350642114984890E+06, 0.101394018940216731E+06, - 0.101430608604817069E+06, 0.101459057570376521E+06, 0.101478044590623220E+06, 0.101475387865733283E+06, 0.101461856537208994E+06, - 0.101443018892087159E+06, 0.101422586718123261E+06, 0.101406882059484167E+06, 0.101400350668646613E+06, 0.101401136819027641E+06, - 0.101411047287252732E+06, 0.101432998273655045E+06, 0.101475019664207721E+06, 0.101526976345226532E+06, 0.101585936905203198E+06, - 0.101648470322235924E+06, 0.101703644183282871E+06, 0.101759331828263079E+06, 0.101814866055730265E+06, 0.101869901220545507E+06, - 0.101928914084517004E+06, 0.101985712555209233E+06, 0.102038213057230983E+06, 0.102083503006818413E+06, 0.102116318481194263E+06, - 0.102142478770143352E+06, 0.102162510227578357E+06, 0.102176745632176331E+06, 0.102185382260760132E+06, 0.102189351865029588E+06, - 0.102188985060908250E+06, 0.102181978502190381E+06, 0.102166343098074416E+06, 0.102144949217122790E+06, 0.102118539343817305E+06, - 0.102090320241642432E+06, 0.102064949154931208E+06, 0.102041510471142406E+06, 0.102020894051233234E+06, 0.102002076919490239E+06, - 0.101978687982916701E+06, 0.101949947159686926E+06, 0.101920721729201105E+06, 0.101890840787188339E+06, 0.101858502442174227E+06, - 0.101821787050020226E+06, 0.101779170614060145E+06, 0.101731633607835785E+06, 0.101683872606227975E+06, 0.101641706250363815E+06, - 0.101609757163432500E+06, 0.101594408710602715E+06, 0.101599861763739507E+06, 0.101615600568650814E+06, 0.101634792862023707E+06, - 0.101649560822422354E+06, 0.101653324074520948E+06, 0.101647718645786255E+06, 0.101632892509714380E+06, 0.101607498410070068E+06, - 0.101573604987650251E+06, 0.101534332171428061E+06, 0.101490882315485491E+06, 0.101441914985506301E+06, 0.101390598505943577E+06, - 0.101340225499994325E+06, 0.101292893172337470E+06, 0.101249121490931240E+06, 0.101212206615971038E+06, 0.101184803983927792E+06, - 0.101169090523178049E+06, 0.101177216406820677E+06, 0.101199121436619549E+06, 0.101229487274117826E+06, 0.101265433425285810E+06, - 0.101301460838134211E+06, 0.101337546551032807E+06, 0.101373572179327981E+06, 0.101408481747705810E+06, 0.101441269413672373E+06, - 0.101471589979924611E+06, 0.101499094210238720E+06, 0.101523046431578827E+06, 0.101542483002773370E+06, 0.101543831013172356E+06, - 0.101544064378257113E+06, 0.101546276856648081E+06, 0.101553107004487800E+06, 0.101570758226424994E+06, 0.101603899362922981E+06, - 0.101643466171828870E+06, 0.101688020902613556E+06, 0.101736066489577410E+06, 0.101788778651382352E+06, 0.101846229772819366E+06, - 0.101902087545993330E+06, 0.101954243560902876E+06, 0.102000912067655503E+06, 0.102040460468150268E+06, 0.102070397922830496E+06, - 0.102092123176266672E+06, 0.102106027606901625E+06, 0.102112955537274407E+06, 0.102114233430400913E+06, 0.102110160726652859E+06, - 0.102103564706523437E+06, 0.100518689604693471E+06, 0.100570188968489383E+06, 0.100627085580226092E+06, 0.100688425846865008E+06, - 0.100752801664219747E+06, 0.100819711434372482E+06, 0.100888275239485200E+06, 0.100957467842034559E+06, 0.101026141537060103E+06, - 0.101093053338000958E+06, 0.101156896762082222E+06, 0.101216338486683555E+06, 0.101270050228910055E+06, 0.101303959592322863E+06, - 0.101331155104026548E+06, 0.101351367252466414E+06, 0.101364631606699608E+06, 0.101370354947362532E+06, 0.101368511938952593E+06, - 0.101359219879845390E+06, 0.101342770712901329E+06, 0.101323279228074665E+06, 0.101301442257920979E+06, 0.101274216777385765E+06, - 0.101241963101549714E+06, 0.101205245491941663E+06, 0.101164856326946916E+06, 0.101121839477416492E+06, 0.101077512757932636E+06, - 0.101040769978266762E+06, 0.101003816768457153E+06, 0.100967482943484662E+06, 0.100932599047362921E+06, 0.100899538621347674E+06, - 0.100868835073115974E+06, 0.100841822788138859E+06, 0.100822146543393857E+06, 0.100806275342578825E+06, 0.100794425676255967E+06, - 0.100786746583171247E+06, 0.100783223558698664E+06, 0.100783580356914550E+06, 0.100777240593710594E+06, 0.100772797244677698E+06, - 0.100771995893256535E+06, 0.100775628518037935E+06, 0.100784330892865575E+06, 0.100798832415402489E+06, 0.100819830174998613E+06, - 0.100845869940026445E+06, 0.100876821716840641E+06, 0.100912505059014773E+06, 0.100952732377084161E+06, 0.101002888396750073E+06, - 0.101057716858402928E+06, 0.101114463416698447E+06, 0.101171669964558023E+06, 0.101227895955215106E+06, 0.101283382095900626E+06, - 0.101334958226825765E+06, 0.101380444142405948E+06, 0.101418245220739525E+06, 0.101446407440058887E+06, 0.101450870781566424E+06, - 0.101446840525337553E+06, 0.101437171069169228E+06, 0.101424931486162226E+06, 0.101415799787063268E+06, 0.101412071436230064E+06, - 0.101412950725123417E+06, 0.101420014842418866E+06, 0.101435968083775937E+06, 0.101466352271600088E+06, 0.101503661068658505E+06, - 0.101546063702057072E+06, 0.101591631627750539E+06, 0.101633780932880036E+06, 0.101677233535571504E+06, 0.101722001382731454E+06, - 0.101768084603012278E+06, 0.101821697636718192E+06, 0.101876504987276159E+06, 0.101929725277785576E+06, 0.101979436992402916E+06, - 0.102021048948978249E+06, 0.102058738337406423E+06, 0.102093407361196325E+06, 0.102125483850517805E+06, 0.102150396359340550E+06, - 0.102169939569479524E+06, 0.102183985952502859E+06, 0.102191376525420768E+06, 0.102185685603385369E+06, 0.102169450367412603E+06, - 0.102146358644484295E+06, 0.102119842646822071E+06, 0.102094075555721618E+06, 0.102073636097204362E+06, 0.102056299206566269E+06, - 0.102039605800132485E+06, 0.102021374390271580E+06, 0.101998770599080817E+06, 0.101970853166201807E+06, 0.101937971227922506E+06, - 0.101900413338984057E+06, 0.101857321774920129E+06, 0.101808436773914334E+06, 0.101755010517902134E+06, 0.101701108954033160E+06, - 0.101652170013780356E+06, 0.101614009141804403E+06, 0.101594396568573589E+06, 0.101591391668390439E+06, 0.101601222158549106E+06, - 0.101618244864968845E+06, 0.101635666146591233E+06, 0.101645911116270872E+06, 0.101646699642323045E+06, 0.101636431221179548E+06, - 0.101609654908569675E+06, 0.101575048385323738E+06, 0.101534330175456344E+06, 0.101489532139668852E+06, 0.101438185377782967E+06, - 0.101385959560380783E+06, 0.101335194667244825E+06, 0.101287926354806812E+06, 0.101245203663320397E+06, 0.101209646717536321E+06, - 0.101183113534233489E+06, 0.101167399256673903E+06, 0.101173255047212093E+06, 0.101191266867459737E+06, 0.101217555082850216E+06, - 0.101249738922742486E+06, 0.101282540292244405E+06, 0.101316175523455371E+06, 0.101351248733287808E+06, 0.101387035478988051E+06, - 0.101423676548066695E+06, 0.101461316613871037E+06, 0.101497507316982592E+06, 0.101531170814716766E+06, 0.101561263551730270E+06, - 0.101576206116756410E+06, 0.101586714996634080E+06, 0.101597778963160541E+06, 0.101611464789349586E+06, 0.101630169532632644E+06, - 0.101664927306783313E+06, 0.101704113353483583E+06, 0.101746416585083251E+06, 0.101790584390523509E+06, 0.101835630759291264E+06, - 0.101885286326592308E+06, 0.101932452931491775E+06, 0.101975582690834839E+06, 0.102013491689891205E+06, 0.102045391567770363E+06, - 0.102064776694095723E+06, 0.102074647376751818E+06, 0.102077355461506435E+06, 0.102073009372423272E+06, 0.102062037114194260E+06, - 0.102045197475351029E+06, 0.102032862053345467E+06, 0.100516203599419721E+06, 0.100565218916304395E+06, 0.100617260891664730E+06, - 0.100673956912948721E+06, 0.100734470974993252E+06, 0.100796865106346027E+06, 0.100860518975916333E+06, 0.100924514220946570E+06, - 0.100987769915576093E+06, 0.101049106773664753E+06, 0.101107273840837661E+06, 0.101159905161335395E+06, 0.101194545284544540E+06, - 0.101223680392232840E+06, 0.101247089234949191E+06, 0.101264590537126525E+06, 0.101276076890375974E+06, 0.101281552099694847E+06, - 0.101280982310362175E+06, 0.101273943686812767E+06, 0.101262940282394411E+06, 0.101250027136122240E+06, 0.101232503141791327E+06, - 0.101210483653828545E+06, 0.101184228737493526E+06, 0.101154165002910086E+06, 0.101120906752935975E+06, 0.101085276329601198E+06, - 0.101055059197187191E+06, 0.101026747435691374E+06, 0.100998039675420368E+06, 0.100969366867174089E+06, 0.100941239345533730E+06, - 0.100914229378812437E+06, 0.100888324815689179E+06, 0.100866108957016506E+06, 0.100846788167441075E+06, 0.100829635550168416E+06, - 0.100814589974162533E+06, 0.100801624509251793E+06, 0.100790670060632678E+06, 0.100777235449754880E+06, 0.100759761272309115E+06, - 0.100744498201414157E+06, 0.100732510380326974E+06, 0.100724806452672536E+06, 0.100722312648745443E+06, 0.100727124797232929E+06, - 0.100739250727341408E+06, 0.100757924088756554E+06, 0.100783210335334952E+06, 0.100815143464493012E+06, 0.100854893070929611E+06, - 0.100907659832364327E+06, 0.100964923673006793E+06, 0.101024919613124526E+06, 0.101086575092280807E+06, 0.101148693938726588E+06, - 0.101212491181683130E+06, 0.101273236178490639E+06, 0.101328963344270000E+06, 0.101377761563192791E+06, 0.101415272026218052E+06, - 0.101431876200949133E+06, 0.101440210101162083E+06, 0.101442472419936472E+06, 0.101441025799434588E+06, 0.101440273436921474E+06, - 0.101441412028859413E+06, 0.101444242700126299E+06, 0.101450026358596937E+06, 0.101460476599565445E+06, 0.101479171248484825E+06, - 0.101501585380914767E+06, 0.101526832551874162E+06, 0.101554045751632453E+06, 0.101581088175181358E+06, 0.101609436210866566E+06, - 0.101639553558900094E+06, 0.101671699640266219E+06, 0.101712219603055011E+06, 0.101758423241378463E+06, 0.101805738585399682E+06, - 0.101852962314692355E+06, 0.101899310754771403E+06, 0.101946265190960024E+06, 0.101994211955312698E+06, 0.102041986736160048E+06, - 0.102085797585756969E+06, 0.102118247218596109E+06, 0.102143944256965377E+06, 0.102160780837746963E+06, 0.102166943569605079E+06, - 0.102158326056491831E+06, 0.102140886616651740E+06, 0.102119658913957755E+06, 0.102098499930418155E+06, 0.102080904999102844E+06, - 0.102066516422517074E+06, 0.102054504472527260E+06, 0.102039748545332608E+06, 0.102020600907278713E+06, 0.101995196360471018E+06, - 0.101963875490564329E+06, 0.101926792596088359E+06, 0.101883686482137069E+06, 0.101834681537134267E+06, 0.101781342698296125E+06, - 0.101725325815194636E+06, 0.101672635846780700E+06, 0.101631506833831096E+06, 0.101606236395939879E+06, 0.101597475949642787E+06, - 0.101603731801431582E+06, 0.101625616805930535E+06, 0.101646355193644980E+06, 0.101660903200991379E+06, 0.101665697733909154E+06, - 0.101654090491919997E+06, 0.101628201204639379E+06, 0.101592718579965003E+06, 0.101550440364196067E+06, 0.101501865690094695E+06, - 0.101447993110863157E+06, 0.101394085224710812E+06, 0.101342099839650211E+06, 0.101293810362817196E+06, 0.101250946740538144E+06, - 0.101215426073013630E+06, 0.101188872150540003E+06, 0.101172928312290038E+06, 0.101177855232292422E+06, 0.101192799356549629E+06, - 0.101215813274799773E+06, 0.101244944643138500E+06, 0.101275131726042877E+06, 0.101307174081444085E+06, 0.101341749283816956E+06, - 0.101378289914467692E+06, 0.101417332589792815E+06, 0.101459925058367837E+06, 0.101502062670976826E+06, 0.101542401965262659E+06, - 0.101579707707947498E+06, 0.101605443608385016E+06, 0.101624638835457939E+06, 0.101643143897028465E+06, 0.101662631727210814E+06, - 0.101684583160134658E+06, 0.101717073342919160E+06, 0.101753756733753267E+06, 0.101791888041425977E+06, 0.101829704004501327E+06, - 0.101866836453342432E+06, 0.101904943611418348E+06, 0.101941838182645661E+06, 0.101974805182480457E+06, 0.102002312012851093E+06, - 0.102022951004307251E+06, 0.102034588422611414E+06, 0.102035115083442288E+06, 0.102027670824049870E+06, 0.102012988929236992E+06, - 0.101992061827493861E+06, 0.101966142466949459E+06, 0.101941390128694227E+06, 0.100514970796833106E+06, 0.100558835077606142E+06, - 0.100607260398477549E+06, 0.100659655071357542E+06, 0.100715265417817398E+06, 0.100773178786940116E+06, 0.100832331209467477E+06, - 0.100890717506978282E+06, 0.100947860531606886E+06, 0.101002917974898708E+06, 0.101052195859970219E+06, 0.101086008388641625E+06, - 0.101115273930014009E+06, 0.101139857117029198E+06, 0.101159622269959131E+06, 0.101174458955507551E+06, 0.101184310219007501E+06, - 0.101189203551941042E+06, 0.101189284643897758E+06, 0.101186114007991724E+06, 0.101181270068826241E+06, 0.101171908271853448E+06, - 0.101158297091944536E+06, 0.101141013465808763E+06, 0.101120226925708761E+06, 0.101096239397641839E+06, 0.101069503529764173E+06, - 0.101044711943530012E+06, 0.101023498931715556E+06, 0.101001656961748697E+06, 0.100979308414565210E+06, 0.100956646567351941E+06, - 0.100933930245713549E+06, 0.100911474196776457E+06, 0.100891471408871366E+06, 0.100874184642035718E+06, 0.100856582877880370E+06, - 0.100838800023023141E+06, 0.100821055717833835E+06, 0.100804211342234223E+06, 0.100787393558680691E+06, 0.100761008720101294E+06, - 0.100734732500141792E+06, 0.100710174312875781E+06, 0.100688451173672947E+06, 0.100670708926784253E+06, 0.100658093134885828E+06, - 0.100653547542059678E+06, 0.100656000772829168E+06, 0.100665921580032358E+06, 0.100683713857153736E+06, 0.100709718860814537E+06, - 0.100748801228508208E+06, 0.100801823503565058E+06, 0.100861225414351109E+06, 0.100925234962917515E+06, 0.100992162379509042E+06, - 0.101061180367843728E+06, 0.101132825200904612E+06, 0.101202551905614309E+06, 0.101268249128093084E+06, 0.101327796560415067E+06, - 0.101375435871056281E+06, 0.101404641442907785E+06, 0.101425758115715638E+06, 0.101440394650381306E+06, 0.101450217422559756E+06, - 0.101458727822546076E+06, 0.101466619611513932E+06, 0.101473463661342525E+06, 0.101480183000528341E+06, 0.101487645084924108E+06, - 0.101498004691627488E+06, 0.101508871394480026E+06, 0.101520205876727661E+06, 0.101532083912951843E+06, 0.101544647478942308E+06, - 0.101558096380653675E+06, 0.101573050568899664E+06, 0.101590428478391070E+06, 0.101613972514299414E+06, 0.101648920007989669E+06, - 0.101687381188284504E+06, 0.101728410452743919E+06, 0.101771447499673959E+06, 0.101823102602039115E+06, 0.101880173737650490E+06, - 0.101939952057504197E+06, 0.101998671132745076E+06, 0.102047778748635392E+06, 0.102081283700837084E+06, 0.102104626314851310E+06, - 0.102117132803555040E+06, 0.102118423258010647E+06, 0.102110210033883151E+06, 0.102097574911021075E+06, 0.102084451243621195E+06, - 0.102073635202554215E+06, 0.102064362043080371E+06, 0.102055076068754133E+06, 0.102042482878204013E+06, 0.102025288372749041E+06, - 0.102001685111197468E+06, 0.101971967159961292E+06, 0.101935955157193923E+06, 0.101893991729276575E+06, 0.101846831752592378E+06, - 0.101795519670136433E+06, 0.101743547706146055E+06, 0.101695867126943878E+06, 0.101657509946900449E+06, 0.101633507015335563E+06, - 0.101630312812292759E+06, 0.101646392192630388E+06, 0.101668889131485266E+06, 0.101690704618882228E+06, 0.101706951776862203E+06, - 0.101710803657395867E+06, 0.101698215938497582E+06, 0.101672792047461742E+06, 0.101636565396570542E+06, 0.101592796399993240E+06, - 0.101539557371443312E+06, 0.101482505549964961E+06, 0.101424993232468783E+06, 0.101369854642081831E+06, 0.101318588912198626E+06, - 0.101273234899637857E+06, 0.101235886605930398E+06, 0.101207937266056106E+06, 0.101192654572110885E+06, 0.101195023201913122E+06, - 0.101207165308628755E+06, 0.101227217799392965E+06, 0.101253372828479289E+06, 0.101281097568006837E+06, 0.101311856149601605E+06, - 0.101345648585710995E+06, 0.101381904947258168E+06, 0.101421272631944972E+06, 0.101465042995991040E+06, 0.101508835313142772E+06, - 0.101551196503329018E+06, 0.101590747790927970E+06, 0.101621682377021876E+06, 0.101645776231220763E+06, 0.101668026172758953E+06, - 0.101689491310640093E+06, 0.101711039834481373E+06, 0.101739312046503386E+06, 0.101772112447843610E+06, 0.101804858575323728E+06, - 0.101836540790179512E+06, 0.101866167898941654E+06, 0.101895518959796798E+06, 0.101925181845865300E+06, 0.101950074886373186E+06, - 0.101969061543749413E+06, 0.101981139844382837E+06, 0.101985462621642117E+06, 0.101977051366888656E+06, 0.101959701573010476E+06, - 0.101935377351789808E+06, 0.101905526341066099E+06, 0.101871781260336036E+06, 0.101835950124052295E+06, 0.100513581366792612E+06, - 0.100554019513422492E+06, 0.100598330045055409E+06, 0.100645982440550681E+06, 0.100696296648474527E+06, 0.100748444268485124E+06, - 0.100801453596632928E+06, 0.100854218792530621E+06, 0.100905513420273754E+06, 0.100949903492433834E+06, 0.100981652101286920E+06, - 0.101009573882022771E+06, 0.101033642379315977E+06, 0.101053802681678295E+06, 0.101069990410599494E+06, 0.101082152783372076E+06, - 0.101090271780979238E+06, 0.101094389439540580E+06, 0.101095654589873608E+06, 0.101096426446181518E+06, 0.101093666576257223E+06, - 0.101087429979991794E+06, 0.101077885304853742E+06, 0.101065339866105438E+06, 0.101050264366095507E+06, 0.101032061623940666E+06, - 0.101012844290179608E+06, 0.100996964302313558E+06, 0.100980770382518007E+06, 0.100964167390490678E+06, 0.100947108284160218E+06, - 0.100929597010366851E+06, 0.100911688070060860E+06, 0.100893582156858451E+06, 0.100881499094758808E+06, 0.100868335774262508E+06, - 0.100853829088449522E+06, 0.100837798044627038E+06, 0.100820106254778977E+06, 0.100800619132333683E+06, 0.100775042434612522E+06, - 0.100741873481754403E+06, 0.100707732498585203E+06, 0.100674198173852987E+06, 0.100642873485934600E+06, 0.100616787946543613E+06, - 0.100595574493244218E+06, 0.100580853452354946E+06, 0.100573369371954352E+06, 0.100573991194533155E+06, 0.100583507950136642E+06, - 0.100602650207284896E+06, 0.100640744734742359E+06, 0.100692244893923940E+06, 0.100751760770043053E+06, 0.100817532941637197E+06, - 0.100887787830291069E+06, 0.100962050144272376E+06, 0.101039744081827113E+06, 0.101116778936214221E+06, 0.101190892544115282E+06, - 0.101259778024939151E+06, 0.101317175633898092E+06, 0.101357978697233921E+06, 0.101390994520218446E+06, 0.101417406025828648E+06, - 0.101438439369066997E+06, 0.101456877295130529E+06, 0.101473268310223793E+06, 0.101486701484946811E+06, 0.101497860785624449E+06, - 0.101507276039524368E+06, 0.101514237723266677E+06, 0.101518949933443597E+06, 0.101522085026395580E+06, 0.101524243387710812E+06, - 0.101525990459469860E+06, 0.101528194232853784E+06, 0.101531700114421837E+06, 0.101537410817429205E+06, 0.101546492305229593E+06, - 0.101567903398293696E+06, 0.101597046994887613E+06, 0.101630996885802393E+06, 0.101669578744430226E+06, 0.101714590729228381E+06, - 0.101773403370424989E+06, 0.101836874445576148E+06, 0.101900881795697991E+06, 0.101960687121667026E+06, 0.102008686461021774E+06, - 0.102037960319300764E+06, 0.102056196723826288E+06, 0.102065273055902842E+06, 0.102066914347914004E+06, 0.102063547681288721E+06, - 0.102059509493393372E+06, 0.102055314339710254E+06, 0.102050951292832178E+06, 0.102044111461623615E+06, 0.102032193928193665E+06, - 0.102014558041099997E+06, 0.101990243188425869E+06, 0.101960364538554975E+06, 0.101925773749474116E+06, 0.101887402236031689E+06, - 0.101845900309227552E+06, 0.101802685936693102E+06, 0.101760172705529054E+06, 0.101722211673123806E+06, 0.101698120911338105E+06, - 0.101693242621827798E+06, 0.101701200555816351E+06, 0.101719376001235738E+06, 0.101743123574903206E+06, 0.101765016750218143E+06, - 0.101780249253377129E+06, 0.101783141086790420E+06, 0.101773015434274668E+06, 0.101749944711398595E+06, 0.101715364981995837E+06, - 0.101666832632786492E+06, 0.101609705385936162E+06, 0.101549151532732372E+06, 0.101488088183680564E+06, 0.101428826013168145E+06, - 0.101371975824192647E+06, 0.101321130368394268E+06, 0.101278514950626632E+06, 0.101245823084732416E+06, 0.101229713571326531E+06, - 0.101228252523962350E+06, 0.101236240082679593E+06, 0.101252202249213733E+06, 0.101274554004038626E+06, 0.101299571284751277E+06, - 0.101328619250470016E+06, 0.101360846988672172E+06, 0.101395461438518367E+06, 0.101432766703864487E+06, 0.101473307204623023E+06, - 0.101514010222445781E+06, 0.101553562190150420E+06, 0.101590717887284656E+06, 0.101621853851409600E+06, 0.101647543893485548E+06, - 0.101671058814602424E+06, 0.101693056210828203E+06, 0.101714129349830531E+06, 0.101738767714405170E+06, 0.101767638107703999E+06, - 0.101795424880191335E+06, 0.101821375190827370E+06, 0.101844797381800585E+06, 0.101865803928462847E+06, 0.101887241456978605E+06, - 0.101903742329332832E+06, 0.101914505259923375E+06, 0.101918870822307275E+06, 0.101916337996088478E+06, 0.101901784739594950E+06, - 0.101874548045828633E+06, 0.101841292001167923E+06, 0.101803678665118787E+06, 0.101762946401782145E+06, 0.101720412831625683E+06, - 0.100515408142486602E+06, 0.100551771547175376E+06, 0.100591372710722571E+06, 0.100633738189236901E+06, 0.100678255595108407E+06, - 0.100724173138854574E+06, 0.100770602351690526E+06, 0.100816524184232330E+06, 0.100854077383907817E+06, 0.100882309305546267E+06, - 0.100908312612091744E+06, 0.100931760805658370E+06, 0.100951200960303162E+06, 0.100967005250871938E+06, 0.100979637398817140E+06, - 0.100989094128378885E+06, 0.100995390483498064E+06, 0.100999335048962457E+06, 0.101003623776222332E+06, 0.101005037852830981E+06, - 0.101003566011062838E+06, 0.100999260214490059E+06, 0.100992254677997669E+06, 0.100982785569327156E+06, 0.100971211282625562E+06, - 0.100958033151982832E+06, 0.100947713227353204E+06, 0.100936845226361344E+06, 0.100925586455398079E+06, 0.100913386427886144E+06, - 0.100900970885727584E+06, 0.100888200173575184E+06, 0.100874969576689109E+06, 0.100865322504112410E+06, 0.100857431942648880E+06, - 0.100848190571948653E+06, 0.100837041611588123E+06, 0.100823522652975458E+06, 0.100807245058683751E+06, 0.100787869439158167E+06, - 0.100757391684316404E+06, 0.100722719302699363E+06, 0.100685949398277124E+06, 0.100648508643416208E+06, 0.100611886678086536E+06, - 0.100577601709138020E+06, 0.100546746024841152E+06, 0.100520863816718731E+06, 0.100501704292206879E+06, 0.100490795320886566E+06, - 0.100489573337377500E+06, 0.100499397978964334E+06, 0.100534016438231076E+06, 0.100580634795179663E+06, 0.100636771821988543E+06, - 0.100700900349775504E+06, 0.100771475161532377E+06, 0.100847971681032548E+06, 0.100928796704597553E+06, 0.101010401416626322E+06, - 0.101090599925904797E+06, 0.101167170271662733E+06, 0.101233921628300508E+06, 0.101285179817018958E+06, 0.101329796645055787E+06, - 0.101368459516926756E+06, 0.101402063972120028E+06, 0.101431554233350747E+06, 0.101457605089509292E+06, 0.101479887700559731E+06, - 0.101498521383338972E+06, 0.101513550784224833E+06, 0.101523174827992611E+06, 0.101527475564510401E+06, 0.101528428909431837E+06, - 0.101526914423630384E+06, 0.101523962459723334E+06, 0.101520309815973524E+06, 0.101516483972158181E+06, 0.101514002315449485E+06, - 0.101514722417862809E+06, 0.101522283068780089E+06, 0.101544056083037300E+06, 0.101571190634249404E+06, 0.101603956939872005E+06, - 0.101642017592925840E+06, 0.101688020789515867E+06, 0.101748771464749283E+06, 0.101810913304749745E+06, 0.101870419614457860E+06, - 0.101923449267402393E+06, 0.101967012984100948E+06, 0.101994050943781331E+06, 0.102011245751808630E+06, 0.102022174558490107E+06, - 0.102029125315834375E+06, 0.102033037791472336E+06, 0.102034394101747268E+06, 0.102032647951692605E+06, 0.102026060860393205E+06, - 0.102014286206869132E+06, 0.101997287902874697E+06, 0.101973908129249903E+06, 0.101945685744995091E+06, 0.101913755487835835E+06, - 0.101879518050633123E+06, 0.101845462413359521E+06, 0.101814438244852194E+06, 0.101787626131292665E+06, 0.101769079269016060E+06, - 0.101760662506367516E+06, 0.101763690025728793E+06, 0.101778245812273221E+06, 0.101800769364128020E+06, 0.101825464810029356E+06, - 0.101849318133198423E+06, 0.101866690516569448E+06, 0.101874423097137915E+06, 0.101868322033511577E+06, 0.101847631400323429E+06, - 0.101809657617465651E+06, 0.101759023134988529E+06, 0.101701048933469734E+06, 0.101638831844116052E+06, 0.101574555754104877E+06, - 0.101509980617449197E+06, 0.101449449533488441E+06, 0.101394594035173650E+06, 0.101347377713062888E+06, 0.101309681379202666E+06, - 0.101289625678805663E+06, 0.101280310168622382E+06, 0.101280601256181355E+06, 0.101289183040688731E+06, 0.101304405647058535E+06, - 0.101324688438220604E+06, 0.101349563357044477E+06, 0.101377976699525767E+06, 0.101409028339016470E+06, 0.101442179995567261E+06, - 0.101476777887449236E+06, 0.101511738303380160E+06, 0.101546126683052818E+06, 0.101579196765551533E+06, 0.101607991498285395E+06, - 0.101632611269017507E+06, 0.101655502605639515E+06, 0.101677080810846644E+06, 0.101697768628730599E+06, 0.101719316740837268E+06, - 0.101742656846947124E+06, 0.101764837611636452E+06, 0.101785178883928776E+06, 0.101802942432164040E+06, 0.101817351144786313E+06, - 0.101829733328404807E+06, 0.101837655847121932E+06, 0.101840093420000965E+06, 0.101836302876360205E+06, 0.101825658934804160E+06, - 0.101806477102295394E+06, 0.101772591154458947E+06, 0.101732979877375386E+06, 0.101689114392674877E+06, 0.101642472350711148E+06, - 0.101594527408217124E+06, 0.100521483098622790E+06, 0.100553034374379175E+06, 0.100587237837357708E+06, 0.100623674982973011E+06, - 0.100661797732431733E+06, 0.100700926585977664E+06, 0.100740251364819997E+06, 0.100769102422238415E+06, 0.100792034055430398E+06, - 0.100813412935669796E+06, 0.100833061354508041E+06, 0.100850766087262135E+06, 0.100866291971468818E+06, 0.100879397215573350E+06, - 0.100889850447447578E+06, 0.100896874983048474E+06, 0.100901879624732552E+06, 0.100908045012513743E+06, 0.100911845008177756E+06, - 0.100913263133695262E+06, 0.100912309117336132E+06, 0.100909033352763217E+06, 0.100903541829518552E+06, 0.100896011438153932E+06, - 0.100886705535507586E+06, 0.100878478741165993E+06, 0.100870518698868997E+06, 0.100862258577488697E+06, 0.100853850267061993E+06, - 0.100845456536039332E+06, 0.100837262111476593E+06, 0.100829483975533818E+06, 0.100823560640713331E+06, 0.100821677296257287E+06, - 0.100817550375560750E+06, 0.100812145039498006E+06, 0.100804659355862575E+06, 0.100794378660273913E+06, 0.100780665915676014E+06, - 0.100760028631593887E+06, 0.100729776405452620E+06, 0.100695664007384359E+06, 0.100658676701707998E+06, 0.100619966898071216E+06, - 0.100580820672301052E+06, 0.100542567168908456E+06, 0.100504377972890885E+06, 0.100469914337100665E+06, 0.100440979221872039E+06, - 0.100419342752137061E+06, 0.100406745142411062E+06, 0.100406705150974245E+06, 0.100432011566503701E+06, 0.100468676779983842E+06, - 0.100515495509657252E+06, 0.100571181275147042E+06, 0.100634390994595859E+06, 0.100706784795550964E+06, 0.100786680087649889E+06, - 0.100869494529497810E+06, 0.100952905038971541E+06, 0.101034572199124057E+06, 0.101109749894571214E+06, 0.101172314783061069E+06, - 0.101229755518492922E+06, 0.101282350507230105E+06, 0.101330323821815167E+06, 0.101373763209774886E+06, 0.101412160049147336E+06, - 0.101445520624250392E+06, 0.101474055469030995E+06, 0.101497872459806793E+06, 0.101516095634979050E+06, 0.101525003393313920E+06, - 0.101529087732478598E+06, 0.101529555701643461E+06, 0.101527554535439689E+06, 0.101523924716972469E+06, 0.101519184588702949E+06, - 0.101515359052858228E+06, 0.101513419431477203E+06, 0.101515061119696038E+06, 0.101524365504439338E+06, 0.101545492952323460E+06, - 0.101572260216870665E+06, 0.101604062662735640E+06, 0.101640454999672467E+06, 0.101681140705924787E+06, 0.101736471342456469E+06, - 0.101791820815604107E+06, 0.101843025813835338E+06, 0.101888338055426750E+06, 0.101926497388645425E+06, 0.101956523951729410E+06, - 0.101977389503551763E+06, 0.101992863624521677E+06, 0.102004636055621828E+06, 0.102012873990628723E+06, 0.102016923944167502E+06, - 0.102015589894533594E+06, 0.102008242524494635E+06, 0.101994805733422399E+06, 0.101975527326879805E+06, 0.101951699623577006E+06, - 0.101924648595227743E+06, 0.101896134378200717E+06, 0.101868181223228035E+06, 0.101842690796364026E+06, 0.101823518800336897E+06, - 0.101810966006917995E+06, 0.101810361562174381E+06, 0.101819625326231835E+06, 0.101837655873780983E+06, 0.101862056783833701E+06, - 0.101890848697784473E+06, 0.101919025148523811E+06, 0.101942604878219718E+06, 0.101953732079914320E+06, 0.101952348959737385E+06, - 0.101930393928014251E+06, 0.101894531594142769E+06, 0.101847206824460780E+06, 0.101792255748977870E+06, 0.101731720782488774E+06, - 0.101667410578914118E+06, 0.101601955467176056E+06, 0.101538353512944566E+06, 0.101479206063803722E+06, 0.101426875382686587E+06, - 0.101386679687780139E+06, 0.101358881267937715E+06, 0.101340978693972764E+06, 0.101332100373616413E+06, 0.101331377677835859E+06, - 0.101337757250038121E+06, 0.101350176595795769E+06, 0.101367529237839539E+06, 0.101388710034061514E+06, 0.101412656335492444E+06, - 0.101438146564572395E+06, 0.101465030990242507E+06, 0.101492743759273944E+06, 0.101520528048576030E+06, 0.101547656089289187E+06, - 0.101573646733203917E+06, 0.101598176409242311E+06, 0.101621015547307805E+06, 0.101642090999262466E+06, 0.101661344187207244E+06, - 0.101680048117579805E+06, 0.101700060142799775E+06, 0.101717676267340707E+06, 0.101732293239297534E+06, 0.101743299867593101E+06, - 0.101750084174098316E+06, 0.101754164408332057E+06, 0.101753815772929738E+06, 0.101747787368181351E+06, 0.101735699407228763E+06, - 0.101717273900884597E+06, 0.101692348035134710E+06, 0.101654861811602153E+06, 0.101610673295375120E+06, 0.101562751614357956E+06, - 0.101512638519625150E+06, 0.101461813597627668E+06, 0.100533318325900138E+06, 0.100559018706234609E+06, 0.100586667516233734E+06, - 0.100616430509356855E+06, 0.100647457772304173E+06, 0.100679140607943787E+06, 0.100698527261697847E+06, 0.100715798167830915E+06, - 0.100731931694921790E+06, 0.100746896633405166E+06, 0.100760616569955790E+06, 0.100772979417731243E+06, 0.100783848302944942E+06, - 0.100793073809534399E+06, 0.100800507571478287E+06, 0.100806483772806212E+06, 0.100813801762586605E+06, 0.100819127022868051E+06, - 0.100822124828140237E+06, 0.100822902466370797E+06, 0.100821716855826366E+06, 0.100818621189554789E+06, 0.100813702346186765E+06, - 0.100807092657524059E+06, 0.100799795563032545E+06, 0.100792638500522866E+06, 0.100785284309503724E+06, 0.100777874398839282E+06, - 0.100770527259340961E+06, 0.100763347669699418E+06, 0.100756435329570639E+06, 0.100749892793592095E+06, 0.100749373875165576E+06, - 0.100750222933888348E+06, 0.100750603463785985E+06, 0.100749864242144642E+06, 0.100747320689053289E+06, 0.100742256076426071E+06, - 0.100733920852957395E+06, 0.100715113795294979E+06, 0.100689064952966379E+06, 0.100657845711542803E+06, 0.100623250918292935E+06, - 0.100586038000497676E+06, 0.100547134348203457E+06, 0.100506028825088957E+06, 0.100462291432826620E+06, 0.100421048783818245E+06, - 0.100384122683633468E+06, 0.100353368412380165E+06, 0.100330670880394246E+06, 0.100321776442990944E+06, 0.100334624094787185E+06, - 0.100358437666044687E+06, 0.100392488442372807E+06, 0.100435977221972600E+06, 0.100488073955800399E+06, 0.100552415559277870E+06, - 0.100627255810881121E+06, 0.100707092289738357E+06, 0.100789756856378794E+06, 0.100873101113792349E+06, 0.100954216801293107E+06, - 0.101025863759345229E+06, 0.101094584610272868E+06, 0.101160235498342692E+06, 0.101222606811297053E+06, 0.101281370962640489E+06, - 0.101332163642811851E+06, 0.101376972618262807E+06, 0.101416728366496085E+06, 0.101451473910749541E+06, 0.101480959555488313E+06, - 0.101500381551832834E+06, 0.101512210195641775E+06, 0.101519514244373393E+06, 0.101523444803633465E+06, 0.101525155563451161E+06, - 0.101524617344664759E+06, 0.101522395272590235E+06, 0.101521151212846860E+06, 0.101522340865174643E+06, 0.101527072168721963E+06, - 0.101537882062393008E+06, 0.101559080181885220E+06, 0.101584526114373686E+06, 0.101614244538571933E+06, 0.101647894372795839E+06, - 0.101684681982032082E+06, 0.101726895995367770E+06, 0.101774312937747018E+06, 0.101818830342195433E+06, 0.101858335228138851E+06, - 0.101893176738273338E+06, 0.101922949034176403E+06, 0.101947508183230893E+06, 0.101967684274917294E+06, 0.101983202615811271E+06, - 0.101993442131563672E+06, 0.101998812147038072E+06, 0.101998613039324773E+06, 0.101992329378160532E+06, 0.101980249760691964E+06, - 0.101962626054339082E+06, 0.101940465078019130E+06, 0.101915907622174098E+06, 0.101890478407916715E+06, 0.101866977689826570E+06, - 0.101849754719304707E+06, 0.101837665745559920E+06, 0.101833602586389810E+06, 0.101841599729967784E+06, 0.101859775477370218E+06, - 0.101886984424902446E+06, 0.101919867690970117E+06, 0.101951746477934430E+06, 0.101978482983373731E+06, 0.101993393892969194E+06, - 0.101991412250034802E+06, 0.101974123414601141E+06, 0.101945239434022718E+06, 0.101905684392780662E+06, 0.101856949799144815E+06, - 0.101801731134592686E+06, 0.101742504741481811E+06, 0.101681038790539489E+06, 0.101619356067038418E+06, 0.101559380452289755E+06, - 0.101505641285490463E+06, 0.101461701752299428E+06, 0.101426005705293821E+06, 0.101398896334048623E+06, 0.101380282180095601E+06, - 0.101369836995025384E+06, 0.101367277170112575E+06, 0.101370986941406809E+06, 0.101379906423074499E+06, 0.101392831033495459E+06, - 0.101408554312665205E+06, 0.101424869582900283E+06, 0.101443182567207696E+06, 0.101462968409184250E+06, 0.101483671134433898E+06, - 0.101504732894123474E+06, 0.101527421913474638E+06, 0.101550095820920280E+06, 0.101571562110317216E+06, 0.101591355780169426E+06, - 0.101609078015251362E+06, 0.101625097194956237E+06, 0.101640337310256451E+06, 0.101652605117688974E+06, 0.101661397415208048E+06, - 0.101666225004107662E+06, 0.101666619975683658E+06, 0.101662556408727090E+06, 0.101653580628123964E+06, 0.101639218203126409E+06, - 0.101619381357809092E+06, 0.101594063768788052E+06, 0.101563351510846944E+06, 0.101523851133020638E+06, 0.101476807405962056E+06, - 0.101426978369828445E+06, 0.101375797428347505E+06, 0.101324598573980998E+06, 0.100551530203326562E+06, 0.100571727120900570E+06, - 0.100593051779557791E+06, 0.100614868997312486E+06, 0.100634144763448072E+06, 0.100645833089619511E+06, 0.100657235284227281E+06, - 0.100667686387769805E+06, 0.100677292913672762E+06, 0.100686112073701530E+06, 0.100694158258119947E+06, 0.100701410586929007E+06, - 0.100707821531117806E+06, 0.100713326592793543E+06, 0.100718292448464927E+06, 0.100725135313074701E+06, 0.100730736036059810E+06, - 0.100734776949494801E+06, 0.100736983079004160E+06, 0.100737142689159882E+06, 0.100735125062421313E+06, 0.100730895453973062E+06, - 0.100724936089312163E+06, 0.100718101716589372E+06, 0.100710128659467940E+06, 0.100701978143640532E+06, 0.100693854728853868E+06, - 0.100685917546278361E+06, 0.100678288281938949E+06, 0.100671058793584918E+06, 0.100664298277410649E+06, 0.100660712381595760E+06, - 0.100661723426356752E+06, 0.100663150264819735E+06, 0.100664393149270531E+06, 0.100664799968549007E+06, 0.100663672287188572E+06, - 0.100660269896986065E+06, 0.100653054372944243E+06, 0.100638919308817800E+06, 0.100620188598009743E+06, 0.100597036492593310E+06, - 0.100569788712949841E+06, 0.100538901380231502E+06, 0.100504939031211514E+06, 0.100464616545740675E+06, 0.100420082357890147E+06, - 0.100376069547844643E+06, 0.100334560389268605E+06, 0.100297550195584583E+06, 0.100267038173233668E+06, 0.100249183652606138E+06, - 0.100248031291493899E+06, 0.100256756900526307E+06, 0.100275250996069168E+06, 0.100303318888992886E+06, 0.100340733860613560E+06, - 0.100392668457859341E+06, 0.100458197469974984E+06, 0.100530344725997711E+06, 0.100607247564767138E+06, 0.100687079608666914E+06, - 0.100768076831136714E+06, 0.100845286817167653E+06, 0.100921915425536106E+06, 0.100997896081585553E+06, 0.101072548063258917E+06, - 0.101144965887108527E+06, 0.101210711249507964E+06, 0.101267759563819229E+06, 0.101319932991058231E+06, 0.101367121820533270E+06, - 0.101409115377035181E+06, 0.101445063624758288E+06, 0.101467868269852072E+06, 0.101485221941439115E+06, 0.101498187544558168E+06, - 0.101507881316604296E+06, 0.101515310949875333E+06, 0.101519599975213365E+06, 0.101522106701145909E+06, 0.101524851878856789E+06, - 0.101529230085351330E+06, 0.101536191323789782E+06, 0.101546697524065807E+06, 0.101566224388216360E+06, 0.101589918902257763E+06, - 0.101616845515287452E+06, 0.101647215589828833E+06, 0.101680341115790361E+06, 0.101715366089036543E+06, 0.101752316168779886E+06, - 0.101791176678952732E+06, 0.101827052748008107E+06, 0.101859044996505589E+06, 0.101887670526199319E+06, 0.101913122414070647E+06, - 0.101934463666524054E+06, 0.101952632860506710E+06, 0.101966700037415663E+06, 0.101975525710702976E+06, 0.101978461989723088E+06, - 0.101975173899271627E+06, 0.101964823473388897E+06, 0.101947665044748559E+06, 0.101926227690128857E+06, 0.101900561072349257E+06, - 0.101874251008341424E+06, 0.101851830347918643E+06, 0.101836189738381829E+06, 0.101828888260193082E+06, 0.101835000054969831E+06, - 0.101851733006117443E+06, 0.101877232568018531E+06, 0.101909510086827300E+06, 0.101940989073697696E+06, 0.101965528537313672E+06, - 0.101979608526400712E+06, 0.101982970036656799E+06, 0.101975240583827399E+06, 0.101955388827734365E+06, 0.101924654892196661E+06, - 0.101887578699447098E+06, 0.101842186561714494E+06, 0.101789317463778367E+06, 0.101732832688802417E+06, 0.101675288481823532E+06, - 0.101619263688587671E+06, 0.101568048094496247E+06, 0.101521062700628769E+06, 0.101479654154784279E+06, 0.101445221739311222E+06, - 0.101418076416901371E+06, 0.101399045923829544E+06, 0.101387018859001342E+06, 0.101381135963448469E+06, 0.101380650007871780E+06, - 0.101384722424981679E+06, 0.101391720295262028E+06, 0.101400396876228624E+06, 0.101411346068523795E+06, 0.101424155121034681E+06, - 0.101438457710905030E+06, 0.101453929199892154E+06, 0.101472913422971527E+06, 0.101492074099173711E+06, 0.101510560767898467E+06, - 0.101527744434993336E+06, 0.101543054611759319E+06, 0.101555675557276962E+06, 0.101564929191696821E+06, 0.101571016898623420E+06, - 0.101573544015567939E+06, 0.101572121672385867E+06, 0.101566370463087485E+06, 0.101554662308102721E+06, 0.101536629786898047E+06, - 0.101513803810128695E+06, 0.101486361735486105E+06, 0.101454563654390658E+06, 0.101418767627698660E+06, 0.101378013088347099E+06, - 0.101330707820646552E+06, 0.101282264555356756E+06, 0.101234028760920090E+06, 0.101187294700704195E+06, 0.100576965529563255E+06, - 0.100591678218711211E+06, 0.100607008383076420E+06, 0.100616323103987481E+06, 0.100620258552074985E+06, 0.100623651287353903E+06, - 0.100626463751429124E+06, 0.100628648078344573E+06, 0.100631378331016531E+06, 0.100634129163284262E+06, 0.100636562070289394E+06, - 0.100638738873227092E+06, 0.100640693964837556E+06, 0.100643049230926015E+06, 0.100648185229669587E+06, 0.100652678597624064E+06, - 0.100656261255894686E+06, 0.100658660860211399E+06, 0.100659622834889029E+06, 0.100658930196984991E+06, 0.100656421096238220E+06, - 0.100652004015325234E+06, 0.100645400203396595E+06, 0.100634943591599571E+06, 0.100623790772243461E+06, 0.100612166299320219E+06, - 0.100600323220825783E+06, 0.100589367539107639E+06, 0.100580442279124138E+06, 0.100572243324848969E+06, 0.100564857703730217E+06, - 0.100563322531964557E+06, 0.100563065402201857E+06, 0.100563607762748041E+06, 0.100564433779967017E+06, 0.100564965723689515E+06, - 0.100564572517680892E+06, 0.100562577288210698E+06, 0.100558128795487573E+06, 0.100550306656448985E+06, 0.100538784205606309E+06, - 0.100523395229331582E+06, 0.100504107960399502E+06, 0.100481009310527326E+06, 0.100454286649172413E+06, 0.100417998848613410E+06, - 0.100377654481256992E+06, 0.100336323265197076E+06, 0.100295695643989733E+06, 0.100257502669341542E+06, 0.100223497751048752E+06, - 0.100198365893325012E+06, 0.100183895883056030E+06, 0.100176748173119719E+06, 0.100177409781642637E+06, 0.100186348863375271E+06, - 0.100204071706916817E+06, 0.100236974921233719E+06, 0.100288202283773542E+06, 0.100347584962604393E+06, 0.100413567810885099E+06, - 0.100484685800612540E+06, 0.100559609376774941E+06, 0.100637786676389092E+06, 0.100719143709254829E+06, 0.100802573207076450E+06, - 0.100886953694736978E+06, 0.100970981281993736E+06, 0.101053137277853224E+06, 0.101122114850514685E+06, 0.101186021991939982E+06, - 0.101244880734986247E+06, 0.101298842483030225E+06, 0.101347976726965513E+06, 0.101388865316328054E+06, 0.101417494561782441E+06, - 0.101441011237599363E+06, 0.101460308434203442E+06, 0.101476142058636950E+06, 0.101489111828680267E+06, 0.101498177707129027E+06, - 0.101504275218907074E+06, 0.101509888353816961E+06, 0.101516205429889771E+06, 0.101524373025953057E+06, 0.101535544403108914E+06, - 0.101550771587497264E+06, 0.101572228401773711E+06, 0.101596922610232752E+06, 0.101624267341491490E+06, 0.101653892197854148E+06, - 0.101685371964174541E+06, 0.101717744368668005E+06, 0.101749825128001146E+06, 0.101781782699506482E+06, 0.101812709382600748E+06, - 0.101841353313321029E+06, 0.101867900490832937E+06, 0.101893188014203624E+06, 0.101915193984979924E+06, 0.101933169418903170E+06, - 0.101945970442238802E+06, 0.101952233644425200E+06, 0.101949989638197949E+06, 0.101938812116678397E+06, 0.101921309771955755E+06, - 0.101897306204910492E+06, 0.101870511994013577E+06, 0.101845727987357284E+06, 0.101827162893394896E+06, 0.101815741469126820E+06, - 0.101815347936997394E+06, 0.101829035456973521E+06, 0.101849227052658054E+06, 0.101873947210599901E+06, 0.101900166979187969E+06, - 0.101922501433547208E+06, 0.101938537730062933E+06, 0.101945622505927895E+06, 0.101943220759731354E+06, 0.101933233593028053E+06, - 0.101913480508279812E+06, 0.101884226864883196E+06, 0.101847880125950556E+06, 0.101805028700279145E+06, 0.101757073613196655E+06, - 0.101706590973509752E+06, 0.101656335498895467E+06, 0.101607292592687139E+06, 0.101560626743744360E+06, 0.101517500638364392E+06, - 0.101478925847553910E+06, 0.101446343700160927E+06, 0.101419879250754559E+06, 0.101398958955256283E+06, 0.101383710029623602E+06, - 0.101374588904196891E+06, 0.101370168865842439E+06, 0.101369105684779628E+06, 0.101370929669406774E+06, 0.101375271898136503E+06, - 0.101381760968333765E+06, 0.101390061699633865E+06, 0.101400585700279218E+06, 0.101414338736935577E+06, 0.101428328122293344E+06, - 0.101441772517097343E+06, 0.101453941211612226E+06, 0.101464150240094372E+06, 0.101470694861331591E+06, 0.101472993001670693E+06, - 0.101472098749250043E+06, 0.101467692245319617E+06, 0.101459459863983502E+06, 0.101447099986294808E+06, 0.101428337148487699E+06, - 0.101402273058774066E+06, 0.101372210423711062E+06, 0.101338601145403256E+06, 0.101301942982120236E+06, 0.101262793506100817E+06, - 0.101221677786233748E+06, 0.101176731503889008E+06, 0.101131973913656722E+06, 0.101088479543089110E+06, 0.101047269615024925E+06, - 0.100610222449967056E+06, 0.100619368346169198E+06, 0.100619051340248508E+06, 0.100617580194349401E+06, 0.100615500249746110E+06, - 0.100612844510783863E+06, 0.100609637715591729E+06, 0.100605899629696811E+06, 0.100601648181252385E+06, 0.100596902436962919E+06, - 0.100591685422206356E+06, 0.100587098052459361E+06, 0.100585436102778738E+06, 0.100587603438895458E+06, 0.100589520780671664E+06, - 0.100591027689952418E+06, 0.100591916118502122E+06, 0.100591952568608729E+06, 0.100590898493088505E+06, 0.100588528847269830E+06, - 0.100584648718839380E+06, 0.100579107975368854E+06, 0.100568181408087505E+06, 0.100556028233350124E+06, 0.100543329111321902E+06, - 0.100530292741429832E+06, 0.100517138305172819E+06, 0.100504104046550317E+06, 0.100491454262540399E+06, 0.100479484740824249E+06, - 0.100470155044772182E+06, 0.100463687256117119E+06, 0.100458896797118272E+06, 0.100455620879032227E+06, 0.100454260984570079E+06, - 0.100454114005490293E+06, 0.100453954401208190E+06, 0.100453246548017763E+06, 0.100453544534649671E+06, 0.100451784335522374E+06, - 0.100447402272511725E+06, 0.100439945313556469E+06, 0.100429058870933281E+06, 0.100414474145118424E+06, 0.100395971880822995E+06, - 0.100364627363950829E+06, 0.100330069619100730E+06, 0.100293517928604648E+06, 0.100256250274621154E+06, 0.100219578502905337E+06, - 0.100184821369736295E+06, 0.100153602788173128E+06, 0.100126759271301082E+06, 0.100104736505522000E+06, 0.100088530813236051E+06, - 0.100079174170628597E+06, 0.100077782208942881E+06, 0.100089384583247156E+06, 0.100124675759422840E+06, 0.100169171328412835E+06, - 0.100221720050477204E+06, 0.100281293603445694E+06, 0.100347032197583365E+06, 0.100419381954596480E+06, 0.100501100689285435E+06, - 0.100587123759395632E+06, 0.100676265830202465E+06, 0.100767041531711700E+06, 0.100857717751965523E+06, 0.100942425402787208E+06, - 0.101015252626361835E+06, 0.101084506455799405E+06, 0.101149930187516162E+06, 0.101211031351648766E+06, 0.101267093811678642E+06, - 0.101313485842090842E+06, 0.101347864445685816E+06, 0.101377348186801406E+06, 0.101401563075397265E+06, 0.101421152746379506E+06, - 0.101436703379514453E+06, 0.101448418323353719E+06, 0.101455739244278491E+06, 0.101461288984514365E+06, 0.101466634842994637E+06, - 0.101474204912937290E+06, 0.101485236375258624E+06, 0.101500599693197641E+06, 0.101519974341673922E+06, 0.101542425947491516E+06, - 0.101567705013514729E+06, 0.101595287754062447E+06, 0.101623559085342917E+06, 0.101653300863473152E+06, 0.101684268370484802E+06, - 0.101715396578327011E+06, 0.101746648790418796E+06, 0.101778157009654227E+06, 0.101810294427225992E+06, 0.101840186138904261E+06, - 0.101866664724512098E+06, 0.101888829801923304E+06, 0.101904365840783910E+06, 0.101910875981687976E+06, 0.101907623411986046E+06, - 0.101897747215346535E+06, 0.101880196785050444E+06, 0.101858268156208374E+06, 0.101836776997478300E+06, 0.101819952813389187E+06, - 0.101808320250000223E+06, 0.101803197426602317E+06, 0.101808609816872282E+06, 0.101820932164050100E+06, 0.101835981686293468E+06, - 0.101853975694054869E+06, 0.101871402202830723E+06, 0.101884750589340591E+06, 0.101893763845945417E+06, 0.101896316342375110E+06, - 0.101891679490974697E+06, 0.101879011465031377E+06, 0.101858040507289596E+06, 0.101829415896828315E+06, 0.101794099063775866E+06, - 0.101754870334758903E+06, 0.101712830221134776E+06, 0.101668524343052632E+06, 0.101623305627111258E+06, 0.101578731565899987E+06, - 0.101536822594720084E+06, 0.101498255706646247E+06, 0.101464056159653454E+06, 0.101434228357694403E+06, 0.101408947230003760E+06, - 0.101388258426133107E+06, 0.101372054750796451E+06, 0.101360489212098575E+06, 0.101352621134682369E+06, 0.101347535522944934E+06, - 0.101344862604306050E+06, 0.101344225484927229E+06, 0.101345820651379589E+06, 0.101351700849621455E+06, 0.101359530806993411E+06, - 0.101367464680662029E+06, 0.101374791985950258E+06, 0.101380818284913359E+06, 0.101384869714943547E+06, 0.101384236152984289E+06, - 0.101379411934677875E+06, 0.101371434785651902E+06, 0.101360085004396402E+06, 0.101345137105284986E+06, 0.101326366500254488E+06, - 0.101300808610161446E+06, 0.101267227431123814E+06, 0.101230448890002648E+06, 0.101191134568648122E+06, 0.101149957676138991E+06, - 0.101107616865909265E+06, 0.101064847159165423E+06, 0.101022580301005539E+06, 0.100981724783641272E+06, 0.100943032631428388E+06, - 0.100907229742725089E+06, 0.100647986354424997E+06, 0.100642715659511494E+06, 0.100636609969385099E+06, 0.100629766959429631E+06, - 0.100622273153360293E+06, 0.100614207409999959E+06, 0.100605644320867577E+06, 0.100596657511128040E+06, 0.100587322839384142E+06, - 0.100577721494929676E+06, 0.100567942994422949E+06, 0.100559032457675799E+06, 0.100552977775159990E+06, 0.100548029023239913E+06, - 0.100543925649759869E+06, 0.100540775676255420E+06, 0.100537926202230563E+06, 0.100534526225857189E+06, 0.100530349204130558E+06, - 0.100525160024924175E+06, 0.100518730289664294E+06, 0.100507262057308282E+06, 0.100493351445575739E+06, 0.100478812420309798E+06, - 0.100463863563753723E+06, 0.100448706735957079E+06, 0.100433537133342616E+06, 0.100418551953121700E+06, 0.100403957667064577E+06, - 0.100390113818734360E+06, 0.100378283224859435E+06, 0.100368019408275955E+06, 0.100359348113145898E+06, 0.100352231413445901E+06, - 0.100346572462762793E+06, 0.100342221388570266E+06, 0.100338982151060118E+06, 0.100338392782828159E+06, 0.100341188152017450E+06, - 0.100343374795880460E+06, 0.100344284175602748E+06, 0.100343279804720136E+06, 0.100339754195549598E+06, 0.100333123950383713E+06, - 0.100321286971674039E+06, 0.100297287465905509E+06, 0.100269835508128133E+06, 0.100239714419667638E+06, 0.100207741409672206E+06, - 0.100174751447097195E+06, 0.100141579771693956E+06, 0.100106755441371904E+06, 0.100069912900784475E+06, 0.100035704844720982E+06, - 0.100005528642180579E+06, 0.999808555037528422E+05, 0.999632723451110069E+05, 0.999545236439836153E+05, 0.999736658577992639E+05, - 0.100003353333015431E+06, 0.100042064117430200E+06, 0.100089071041598727E+06, 0.100143778848621456E+06, 0.100205754250853075E+06, - 0.100280664932831889E+06, 0.100364704219084786E+06, 0.100454126970714191E+06, 0.100547163719590288E+06, 0.100641885410501171E+06, - 0.100736224731986324E+06, 0.100821668363604142E+06, 0.100899090295081827E+06, 0.100973330050358534E+06, 0.101044570047650093E+06, - 0.101111101684352281E+06, 0.101171922832138123E+06, 0.101223284014747289E+06, 0.101260000146915598E+06, 0.101290169362142216E+06, - 0.101314373328620830E+06, 0.101333177003506280E+06, 0.101345070024148474E+06, 0.101353392220116293E+06, 0.101359052838648713E+06, - 0.101363820978951000E+06, 0.101369812488926094E+06, 0.101377607762478350E+06, 0.101388432240829963E+06, 0.101403721097234418E+06, - 0.101423686495689355E+06, 0.101447911692908267E+06, 0.101474956233570803E+06, 0.101501708578459278E+06, 0.101530416403443902E+06, - 0.101560731988182699E+06, 0.101592331907465996E+06, 0.101625384375889567E+06, 0.101660463766652349E+06, 0.101696287937694025E+06, - 0.101731505165402195E+06, 0.101765373671168942E+06, 0.101795889760683582E+06, 0.101821575901139222E+06, 0.101839426770240534E+06, - 0.101848304582011391E+06, 0.101850674932157766E+06, 0.101845563338820590E+06, 0.101833662450669886E+06, 0.101819729736987734E+06, - 0.101806525676924168E+06, 0.101796235624030873E+06, 0.101788878921415002E+06, 0.101786474628160606E+06, 0.101791411418041462E+06, - 0.101799155363379643E+06, 0.101808395203049906E+06, 0.101819645577764153E+06, 0.101830409662230682E+06, 0.101837554446248556E+06, - 0.101839744105951162E+06, 0.101836170755967585E+06, 0.101826399135349377E+06, 0.101810169058729633E+06, 0.101787697095879019E+06, - 0.101760376393189144E+06, 0.101728853043894385E+06, 0.101693851935638726E+06, 0.101656211520082943E+06, 0.101616790158213262E+06, - 0.101576704560053928E+06, 0.101537500986694940E+06, 0.101500335696260430E+06, 0.101465878362827381E+06, 0.101434840756723977E+06, - 0.101408292472182264E+06, 0.101385653681886775E+06, 0.101367773762272278E+06, 0.101355060936308873E+06, 0.101344865614149967E+06, - 0.101336866601978196E+06, 0.101330803221953858E+06, 0.101326445157375012E+06, 0.101323705025865274E+06, 0.101323151766299212E+06, - 0.101323317919074820E+06, 0.101323609309034800E+06, 0.101323383998279736E+06, 0.101321968519799790E+06, 0.101318674829698095E+06, - 0.101309557473271183E+06, 0.101297255318789845E+06, 0.101282004506700381E+06, 0.101263593826286131E+06, 0.101241822534985287E+06, - 0.101216505434514431E+06, 0.101183763113335532E+06, 0.101143062284304673E+06, 0.101099958082106066E+06, 0.101055260378077917E+06, - 0.101009770107324861E+06, 0.100964289722992879E+06, 0.100919631222605836E+06, 0.100878395229792455E+06, 0.100840230418695966E+06, - 0.100804814065610379E+06, 0.100772660269162792E+06, 0.100687581879727732E+06, 0.100677327145079587E+06, 0.100666160693170401E+06, - 0.100654207341057889E+06, 0.100641583937123549E+06, 0.100628402623918475E+06, 0.100614774045043421E+06, 0.100600810488184259E+06, - 0.100586628958508634E+06, 0.100572354178803900E+06, 0.100558377265734845E+06, 0.100545518784321612E+06, 0.100533722529582723E+06, - 0.100522910171807918E+06, 0.100512931196078469E+06, 0.100503576020145658E+06, 0.100494590303307457E+06, 0.100485690264560879E+06, - 0.100476578798775605E+06, 0.100466962148914608E+06, 0.100453831814755409E+06, 0.100437250927331042E+06, 0.100419883924672962E+06, - 0.100402010894887906E+06, 0.100383869790613491E+06, 0.100365667294769126E+06, 0.100347588515499185E+06, 0.100329805497802925E+06, - 0.100312484547517117E+06, 0.100295677938969020E+06, 0.100279971482571520E+06, 0.100265646792895117E+06, 0.100252835911466231E+06, - 0.100241624480511469E+06, 0.100232054881627162E+06, 0.100224130808306480E+06, 0.100217823206996967E+06, 0.100218259667894425E+06, - 0.100221888558547784E+06, 0.100225662634090608E+06, 0.100228894178654795E+06, 0.100230909476646018E+06, 0.100231046622607246E+06, - 0.100228652435841679E+06, 0.100220736457496634E+06, 0.100203006988572233E+06, 0.100182026084597936E+06, 0.100158298000477531E+06, - 0.100132350369893451E+06, 0.100104715520267695E+06, 0.100075909358704739E+06, 0.100043124770855982E+06, 0.100002028989072438E+06, - 0.999616642547620577E+05, 0.999236877809293510E+05, 0.998898266920593742E+05, 0.998618945050216280E+05, 0.998418030619178171E+05, - 0.998423833568641858E+05, 0.998594396345241257E+05, 0.998857662121956964E+05, 0.999209046169008070E+05, 0.999644862724064005E+05, - 0.100016242187354641E+06, 0.100077317810256820E+06, 0.100156061627195784E+06, 0.100241897409154641E+06, 0.100332874470688155E+06, - 0.100428637026128985E+06, 0.100526117084385623E+06, 0.100622332108951261E+06, 0.100709061724389190E+06, 0.100788527255290071E+06, - 0.100863969991383987E+06, 0.100934619610214693E+06, 0.100999507530848088E+06, 0.101057589879684849E+06, 0.101107912118639942E+06, - 0.101140898046464674E+06, 0.101165194334426677E+06, 0.101183324487668549E+06, 0.101196455912974372E+06, 0.101205787756098696E+06, - 0.101212555660780359E+06, 0.101217307428240179E+06, 0.101221221076374510E+06, 0.101226815969850082E+06, 0.101235775469520071E+06, - 0.101249089517923203E+06, 0.101267499119154090E+06, 0.101290114155802439E+06, 0.101316108973235343E+06, 0.101344864351232871E+06, - 0.101376027068939133E+06, 0.101409318557868275E+06, 0.101444185441017980E+06, 0.101479505555003896E+06, 0.101516882009007721E+06, - 0.101555258888103534E+06, 0.101593997928136538E+06, 0.101632899844262269E+06, 0.101670115604274892E+06, 0.101703897209036979E+06, - 0.101731821696663668E+06, 0.101752696747597220E+06, 0.101767805557897402E+06, 0.101776451771069726E+06, 0.101776669469582252E+06, - 0.101773409436917937E+06, 0.101768516316242836E+06, 0.101762622025664066E+06, 0.101757375988241824E+06, 0.101753826825127559E+06, - 0.101753403149395934E+06, 0.101756975828023817E+06, 0.101760728893977721E+06, 0.101764213695991348E+06, 0.101767251659026326E+06, - 0.101770663081707637E+06, 0.101770424123169345E+06, 0.101766072271416459E+06, 0.101755995409002455E+06, 0.101740345666592038E+06, - 0.101721298174118318E+06, 0.101699043646416510E+06, 0.101673714396835901E+06, 0.101645709970302123E+06, 0.101615709217670097E+06, - 0.101584438818864903E+06, 0.101549071157331651E+06, 0.101514367930820241E+06, 0.101481015481659371E+06, 0.101449616141240651E+06, - 0.101420749509000205E+06, 0.101394921878986992E+06, 0.101373676775729036E+06, 0.101359486676981818E+06, 0.101347304837422518E+06, - 0.101336841360518913E+06, 0.101328023341265842E+06, 0.101320386045212057E+06, 0.101313764510643596E+06, 0.101308434768293082E+06, - 0.101303621069785135E+06, 0.101298777855350723E+06, 0.101293531204510582E+06, 0.101287470834921696E+06, 0.101280152845400124E+06, - 0.101270201669037211E+06, 0.101254701725787949E+06, 0.101236553755882080E+06, 0.101215630660361639E+06, 0.101191802985207483E+06, - 0.101164939977834394E+06, 0.101134911067020425E+06, 0.101095221983884170E+06, 0.101047509096163092E+06, 0.100998010357585692E+06, - 0.100947641730482603E+06, 0.100897282218335793E+06, 0.100847785377602457E+06, 0.100799988650482410E+06, 0.100756067172860465E+06, - 0.100716404949108095E+06, 0.100680394601797932E+06, 0.100648426393021538E+06, 0.100745881471474568E+06, 0.100728142553068014E+06, - 0.100709625290291020E+06, 0.100690810595279676E+06, 0.100673015913888710E+06, 0.100654662696282932E+06, 0.100635883098483231E+06, - 0.100616812156066226E+06, 0.100597590570947941E+06, 0.100577923093225269E+06, 0.100558481382763435E+06, 0.100539763749561054E+06, - 0.100521848971490384E+06, 0.100504736841997088E+06, 0.100488356281683067E+06, 0.100472574428834167E+06, 0.100457206575664590E+06, - 0.100442026795809623E+06, 0.100426779086875598E+06, 0.100408173847290411E+06, 0.100384737995668649E+06, 0.100361938241868149E+06, - 0.100339809752568588E+06, 0.100318341944825661E+06, 0.100297490120403570E+06, 0.100277187624826533E+06, 0.100256847285368276E+06, - 0.100235365725066120E+06, 0.100214436988323068E+06, 0.100194015395758135E+06, 0.100174603679756343E+06, 0.100156451770575964E+06, - 0.100139783864459299E+06, 0.100124799136242582E+06, 0.100111674036540222E+06, 0.100100566149749706E+06, 0.100091646133474802E+06, - 0.100094268080595342E+06, 0.100098360646490051E+06, 0.100103245417476035E+06, 0.100108251398645036E+06, 0.100112713737688697E+06, - 0.100115972074298101E+06, 0.100117368468727698E+06, 0.100113713047268437E+06, 0.100102264314479005E+06, 0.100088001440509222E+06, - 0.100071163974188516E+06, 0.100051996036882978E+06, 0.100030726477270320E+06, 0.100007546295320470E+06, 0.999807647979038738E+05, - 0.999391989552558807E+05, 0.998969708781520749E+05, 0.998557810370234511E+05, 0.998173700956349639E+05, 0.997835138413437380E+05, - 0.997560107381300622E+05, 0.997399269866001996E+05, 0.997470920864752261E+05, 0.997634292598558095E+05, 0.997888964555621351E+05, - 0.998253139512354246E+05, 0.998703081483062851E+05, 0.999237330223304161E+05, 0.999900673422841937E+05, 0.100071098592214898E+06, - 0.100157786095159157E+06, 0.100248141148947368E+06, 0.100340095617225234E+06, 0.100431568456538211E+06, 0.100520552982271765E+06, - 0.100601957172444119E+06, 0.100676277857242458E+06, 0.100746000837763233E+06, 0.100808736668317229E+06, 0.100864485886548777E+06, - 0.100912656357667453E+06, 0.100952804425252194E+06, 0.100983458937089512E+06, 0.101002905816960556E+06, 0.101017076739301760E+06, - 0.101025919304932366E+06, 0.101031319629252597E+06, 0.101035629307633033E+06, 0.101040244934609727E+06, 0.101046393155694794E+06, - 0.101055516125687020E+06, 0.101070906234944094E+06, 0.101089614225348079E+06, 0.101111577432790844E+06, 0.101136727145279292E+06, - 0.101164845396941935E+06, 0.101195505773623969E+06, 0.101228307857940395E+06, 0.101262885478130513E+06, 0.101298695011647855E+06, - 0.101336323186784808E+06, 0.101375617863355365E+06, 0.101416132308550543E+06, 0.101458486694783467E+06, 0.101500186893265898E+06, - 0.101539835500673144E+06, 0.101576113752189529E+06, 0.101608148989054069E+06, 0.101635731083729115E+06, 0.101658502412969741E+06, - 0.101672883340000117E+06, 0.101682956248776158E+06, 0.101690136156231834E+06, 0.101694729692935623E+06, 0.101695555850151519E+06, - 0.101694985210699713E+06, 0.101693812129123311E+06, 0.101693039728607808E+06, 0.101693715283905956E+06, 0.101692868849250488E+06, - 0.101690508890417783E+06, 0.101685212790082718E+06, 0.101676311144040446E+06, 0.101666676329463662E+06, 0.101655232931092047E+06, - 0.101641717109236590E+06, 0.101625993005500495E+06, 0.101608164735537764E+06, 0.101588188219044227E+06, 0.101565919017002117E+06, - 0.101541334705616158E+06, 0.101515224870468810E+06, 0.101488328834034881E+06, 0.101461275807381404E+06, 0.101434883687913665E+06, - 0.101409484965064941E+06, 0.101385820779280519E+06, 0.101366650582102375E+06, 0.101354446840173172E+06, 0.101343919272935833E+06, - 0.101334580534699839E+06, 0.101326051033725802E+06, 0.101318025772555571E+06, 0.101310244905231491E+06, 0.101303240884958926E+06, - 0.101296508440228543E+06, 0.101288703571071324E+06, 0.101279586340018883E+06, 0.101269869694777401E+06, 0.101258981910571456E+06, - 0.101246361574452327E+06, 0.101230052909366845E+06, 0.101210205538298207E+06, 0.101187520180750522E+06, 0.101161911206820834E+06, - 0.101133290201435040E+06, 0.101101563145659631E+06, 0.101066628653128937E+06, 0.101019252959455625E+06, 0.100965746706630394E+06, - 0.100910740992734136E+06, 0.100855238817428384E+06, 0.100800186778776610E+06, 0.100746485895287333E+06, 0.100695000750680716E+06, - 0.100647864656014091E+06, 0.100605793755290593E+06, 0.100567897173808713E+06, 0.100534547818198989E+06, 0.100814127595255733E+06, - 0.100792022069682134E+06, 0.100768906676945466E+06, 0.100744859019167008E+06, 0.100719947172904969E+06, 0.100694229203288138E+06, - 0.100667752842392147E+06, 0.100641747076966523E+06, 0.100616187623394333E+06, 0.100590421603492592E+06, 0.100564843816162116E+06, - 0.100539661442132914E+06, 0.100515003622905657E+06, 0.100490925990557327E+06, 0.100467416019604236E+06, 0.100444399107853926E+06, - 0.100421745278230635E+06, 0.100399276378565366E+06, 0.100374479059296529E+06, 0.100342341387721070E+06, 0.100310819294281551E+06, - 0.100280122297496389E+06, 0.100250406051737154E+06, 0.100221779328347242E+06, 0.100194311780137796E+06, 0.100168042299398876E+06, - 0.100142987772136228E+06, 0.100119152028053810E+06, 0.100096071569344102E+06, 0.100074127372371906E+06, 0.100053458844250679E+06, - 0.100034145590099070E+06, 0.100016303683140140E+06, 0.100000086204841966E+06, 0.999856841527353536E+05, 0.999733278135488799E+05, - 0.999663531822283549E+05, 0.999693777575280983E+05, 0.999741959503276157E+05, 0.999802590538802469E+05, 0.999870378916889313E+05, - 0.999938949144795042E+05, 0.100000191518739506E+06, 0.100005286991947069E+06, 0.100006317487418550E+06, 0.100001195017387858E+06, - 0.999937624881289375E+05, 0.999840228227615153E+05, 0.999719630030743720E+05, 0.999577541117163637E+05, 0.999414190489595931E+05, - 0.999227353126357775E+05, 0.998873066933161899E+05, 0.998482442672230973E+05, 0.998092392179712187E+05, 0.997720171343442780E+05, - 0.997383602763239178E+05, 0.997100954593149654E+05, 0.996890738866330212E+05, 0.996865348971301573E+05, 0.996979284283922898E+05, - 0.997178025858917244E+05, 0.997459381653020537E+05, 0.997821174181933602E+05, 0.998261113921440992E+05, 0.998776597193271737E+05, - 0.999420283421857603E+05, 0.100017917957394646E+06, 0.100097878242084247E+06, 0.100179897231054711E+06, 0.100262024118021669E+06, - 0.100342632647495484E+06, 0.100419763744213284E+06, 0.100491241165072570E+06, 0.100554990596539108E+06, 0.100613108372608185E+06, - 0.100664964935558615E+06, 0.100710050488669251E+06, 0.100748062257432917E+06, 0.100778981129089982E+06, 0.100801136588479072E+06, - 0.100816775933362136E+06, 0.100825979191023362E+06, 0.100833035761093313E+06, 0.100839384072879693E+06, 0.100846373089390050E+06, - 0.100857951736503237E+06, 0.100872302980121356E+06, 0.100888680627202251E+06, 0.100907092306334001E+06, 0.100927501559027049E+06, - 0.100950662310288419E+06, 0.100977294658870305E+06, 0.101006277386327682E+06, 0.101036971461367139E+06, 0.101068254496147259E+06, - 0.101099848827670517E+06, 0.101133511540723193E+06, 0.101169399010245761E+06, 0.101207870174907031E+06, 0.101248846664781042E+06, - 0.101290872607848010E+06, 0.101333141189654139E+06, 0.101375246051365641E+06, 0.101416446476650075E+06, 0.101455302158143284E+06, - 0.101490839830927347E+06, 0.101520107656443550E+06, 0.101543517742126453E+06, 0.101563037513223637E+06, 0.101578855351202437E+06, - 0.101589294440855650E+06, 0.101594084692158984E+06, 0.101595811485579121E+06, 0.101594522898840631E+06, 0.101587783852875349E+06, - 0.101580434348492054E+06, 0.101571251185715577E+06, 0.101560523496472335E+06, 0.101548552694418337E+06, 0.101535867827232971E+06, - 0.101525413599061823E+06, 0.101514059084604145E+06, 0.101501599931887249E+06, 0.101487982453526070E+06, 0.101472687979190014E+06, - 0.101455256212675624E+06, 0.101436599458446668E+06, 0.101417421871714148E+06, 0.101397941747779230E+06, 0.101378563636379375E+06, - 0.101359842874464084E+06, 0.101342462840995518E+06, 0.101332246224379633E+06, 0.101325840252083945E+06, 0.101320103689658979E+06, - 0.101314877253089740E+06, 0.101310111834561045E+06, 0.101305378666758857E+06, 0.101300345803243748E+06, 0.101295776170531011E+06, - 0.101292199871251156E+06, 0.101287082936946317E+06, 0.101280060941132921E+06, 0.101270852280511215E+06, 0.101259228389922413E+06, - 0.101244988802512118E+06, 0.101227740446083306E+06, 0.101206586899449845E+06, 0.101182271497207475E+06, 0.101154765725986566E+06, - 0.101124017218970926E+06, 0.101089948851124151E+06, 0.101052459983455323E+06, 0.101011429271982197E+06, 0.100955245737388075E+06, - 0.100896292883737755E+06, 0.100836289133349041E+06, 0.100776402552628671E+06, 0.100717117782225978E+06, 0.100659365283430379E+06, - 0.100604025319315682E+06, 0.100553449734939946E+06, 0.100508407522918642E+06, 0.100467703215460322E+06, 0.100431774319843782E+06, - 0.100887777028820332E+06, 0.100861720047367722E+06, 0.100834436753951144E+06, 0.100806009321876336E+06, 0.100776515387351727E+06, - 0.100746027719175327E+06, 0.100714128174464058E+06, 0.100678835400336873E+06, 0.100643940658424166E+06, 0.100609599439615049E+06, - 0.100575890439937211E+06, 0.100542814645689868E+06, 0.100510647118237335E+06, 0.100478852228419142E+06, 0.100447427441828680E+06, - 0.100416345678542421E+06, 0.100385524391706378E+06, 0.100353710114660586E+06, 0.100313330006065604E+06, 0.100273215809488320E+06, - 0.100233726851702537E+06, 0.100195172710990315E+06, 0.100157816918484707E+06, 0.100121881575408392E+06, 0.100087552777137244E+06, - 0.100054986731522251E+06, 0.100024316458513829E+06, 0.999958188555688102E+05, 0.999694587498323526E+05, 0.999449162204764725E+05, - 0.999222572991156194E+05, 0.999015841003048117E+05, 0.998830358793447813E+05, 0.998667901084829064E+05, 0.998530636160492868E+05, - 0.998421138196279935E+05, 0.998399548826702376E+05, 0.998456341634458367E+05, 0.998536660057044792E+05, 0.998634438903502014E+05, - 0.998743637363783346E+05, 0.998858203733583359E+05, 0.998972031892049272E+05, 0.999078909209750127E+05, 0.999149362451545312E+05, - 0.999155853988857416E+05, 0.999144713123037072E+05, 0.999115094947106991E+05, 0.999066084422268032E+05, 0.998996635379296931E+05, - 0.998905505086211051E+05, 0.998791187039132201E+05, 0.998553009292081260E+05, 0.998211706427201134E+05, 0.997864909210314072E+05, - 0.997528267554746853E+05, 0.997217498141473916E+05, 0.996948180668799905E+05, 0.996735491411857802E+05, 0.996593866015884996E+05, - 0.996655234255323448E+05, 0.996793806269131601E+05, 0.997006480667150026E+05, 0.997291101032920706E+05, 0.997645101820020791E+05, - 0.998065302642879251E+05, 0.998547900089741306E+05, 0.999134103376733110E+05, 0.999816545378570445E+05, 0.100052123784172887E+06, - 0.100122995502983205E+06, 0.100192554793170464E+06, 0.100259253657548237E+06, 0.100321770579711141E+06, 0.100379066111299660E+06, - 0.100430565790236928E+06, 0.100476507405646029E+06, 0.100515199549242738E+06, 0.100547257296906639E+06, 0.100573671260601302E+06, - 0.100594920234367688E+06, 0.100611741953639648E+06, 0.100625093360959523E+06, 0.100636085854106641E+06, 0.100648539226327353E+06, - 0.100663110344216606E+06, 0.100678485576473686E+06, 0.100694991774415132E+06, 0.100712835683178113E+06, 0.100732147548005290E+06, - 0.100753127553809449E+06, 0.100775525773403977E+06, 0.100799178062266757E+06, 0.100823896465442915E+06, 0.100848973735924432E+06, - 0.100871627589741343E+06, 0.100896325593451635E+06, 0.100923508440905760E+06, 0.100953444968081341E+06, 0.100987803936626107E+06, - 0.101025452874861629E+06, 0.101064958354120550E+06, 0.101105934719207362E+06, 0.101149656229281260E+06, 0.101195955740066449E+06, - 0.101241312234646321E+06, 0.101284295970940017E+06, 0.101322838039260794E+06, 0.101354503959834561E+06, 0.101381602347716602E+06, - 0.101404011754918669E+06, 0.101421551762267889E+06, 0.101430360992792368E+06, 0.101432922117767157E+06, 0.101431497700586173E+06, - 0.101426925441668209E+06, 0.101419967655507149E+06, 0.101411983040633873E+06, 0.101402716970667971E+06, 0.101392421375849139E+06, - 0.101381472260780953E+06, 0.101370274940234522E+06, 0.101359740662010270E+06, 0.101350634658367329E+06, 0.101341143517682387E+06, - 0.101330923240958698E+06, 0.101319823874219393E+06, 0.101307931163203728E+06, 0.101295590108053555E+06, 0.101283554840952769E+06, - 0.101272503805782646E+06, 0.101264230996134676E+06, 0.101263165987784392E+06, 0.101263248071743699E+06, 0.101263968423840182E+06, - 0.101264949849351571E+06, 0.101265950281725454E+06, 0.101266859267559164E+06, 0.101267688820318188E+06, 0.101269586773692979E+06, - 0.101271200254654817E+06, 0.101270843870590616E+06, 0.101268468005190778E+06, 0.101263583383249803E+06, 0.101255809203046563E+06, - 0.101244849341628564E+06, 0.101230469880693592E+06, 0.101211897835992699E+06, 0.101189677118595791E+06, 0.101163874725058151E+06, - 0.101134452948665217E+06, 0.101101374466219480E+06, 0.101064596222306151E+06, 0.101024065194136114E+06, 0.100976094439065258E+06, - 0.100916143828112647E+06, 0.100853769181501484E+06, 0.100790071236260570E+06, 0.100726087398982490E+06, 0.100662794662010128E+06, - 0.100601113224382003E+06, 0.100541910367744073E+06, 0.100487274737311833E+06, 0.100437683864829785E+06, 0.100392394095480457E+06, - 0.100351867577605750E+06, 0.100962168045125494E+06, 0.100932365352918903E+06, 0.100901110935450168E+06, 0.100868480358099798E+06, - 0.100834547574790442E+06, 0.100796703363587934E+06, 0.100755267960995203E+06, 0.100713570472402876E+06, 0.100671854726096004E+06, - 0.100630308500112806E+06, 0.100589060133053688E+06, 0.100548176434007823E+06, 0.100507661857319457E+06, 0.100467458892467330E+06, - 0.100427449603971385E+06, 0.100387458241177985E+06, 0.100347067293918182E+06, 0.100298654635154177E+06, 0.100250789888946878E+06, - 0.100203094461237808E+06, 0.100156000274838036E+06, 0.100109901773151054E+06, 0.100065158238268661E+06, 0.100022096993949221E+06, - 0.999810174333996401E+05, 0.999421958115488960E+05, 0.999058907435752189E+05, 0.998749313841952826E+05, 0.998464722705311870E+05, - 0.998203417981312523E+05, 0.997966268545406929E+05, 0.997754458911707188E+05, 0.997569500594004494E+05, 0.997413241542494943E+05, - 0.997287873670089612E+05, 0.997195938347852207E+05, 0.997219848697613779E+05, 0.997302647271703609E+05, 0.997413201843605202E+05, - 0.997545532545877795E+05, 0.997693575270145375E+05, 0.997851155398511037E+05, 0.998011953959217790E+05, 0.998169466903843859E+05, - 0.998299082101016102E+05, 0.998356142670790869E+05, 0.998398422284621047E+05, 0.998424522644160897E+05, 0.998432923817324918E+05, - 0.998421955048720556E+05, 0.998389770375031076E+05, 0.998334333807975636E+05, 0.998233671652358898E+05, 0.997961670290865004E+05, - 0.997678973047597101E+05, 0.997399010170866677E+05, 0.997134966342892585E+05, 0.996899556689095043E+05, 0.996704759993049811E+05, - 0.996561506699569145E+05, 0.996500136858785991E+05, 0.996586427100675064E+05, 0.996741311696416087E+05, 0.996962994894855947E+05, - 0.997249142503650510E+05, 0.997596639024193428E+05, 0.998001312580039958E+05, 0.998457643772705051E+05, 0.998968741052847909E+05, - 0.999554058789066621E+05, 0.100014421175045645E+06, 0.100072433938662172E+06, 0.100128122411163247E+06, 0.100180369857232887E+06, - 0.100226565707743983E+06, 0.100267364450542242E+06, 0.100303437234851634E+06, 0.100335667091963755E+06, 0.100364067822408935E+06, - 0.100388352892750874E+06, 0.100408979571248361E+06, 0.100426614584295938E+06, 0.100443740449263758E+06, 0.100461134998395326E+06, - 0.100478174321635088E+06, 0.100495256991003844E+06, 0.100512619944850769E+06, 0.100530318011748270E+06, 0.100548816195507636E+06, - 0.100568537852548383E+06, 0.100588688433695279E+06, 0.100609168368209503E+06, 0.100629814904332350E+06, 0.100650416237038749E+06, - 0.100665634418575515E+06, 0.100681296503981284E+06, 0.100698501345687095E+06, 0.100717920340627403E+06, 0.100740215249176472E+06, - 0.100766890514599916E+06, 0.100796657224606606E+06, 0.100829306693609207E+06, 0.100864641226465828E+06, 0.100904494038338991E+06, - 0.100948883593760926E+06, 0.100993670283464584E+06, 0.101037518284592399E+06, 0.101079215492193092E+06, 0.101115268009655614E+06, - 0.101146790223207165E+06, 0.101174201341284715E+06, 0.101197180680782549E+06, 0.101215405063571248E+06, 0.101223672236876388E+06, - 0.101227039458753206E+06, 0.101226892310118274E+06, 0.101223972224575875E+06, 0.101218953111666357E+06, 0.101212937481870860E+06, - 0.101205841402347578E+06, 0.101198438153766576E+06, 0.101191337677150907E+06, 0.101184775501605473E+06, 0.101178859738651910E+06, - 0.101173861836438504E+06, 0.101169688625135837E+06, 0.101165295165053874E+06, 0.101160720689472480E+06, 0.101156205118519152E+06, - 0.101153904081471745E+06, 0.101157778313312563E+06, 0.101162376363148098E+06, 0.101167695990116554E+06, 0.101174407609201837E+06, - 0.101181289698729292E+06, 0.101187910343826748E+06, 0.101193938755009076E+06, 0.101199145593254492E+06, 0.101206932922006279E+06, - 0.101215167455344184E+06, 0.101221538641997948E+06, 0.101225600948191553E+06, 0.101227025345643400E+06, 0.101225591909201801E+06, - 0.101221179118605258E+06, 0.101213750568578733E+06, 0.101199646966405868E+06, 0.101180697627794187E+06, 0.101158105995225807E+06, - 0.101131732247750042E+06, 0.101101468150223940E+06, 0.101067227518597691E+06, 0.101028937999906033E+06, 0.100986534229694924E+06, - 0.100931637537634888E+06, 0.100870116212888723E+06, 0.100806172230221506E+06, 0.100740814221331588E+06, 0.100675010844437245E+06, - 0.100609686876287946E+06, 0.100545721239012084E+06, 0.100483946382944894E+06, 0.100426130298766730E+06, 0.100372432821891009E+06, - 0.100322757504134090E+06, 0.100277638455664739E+06, 0.101031760825673671E+06, 0.100998271623218010E+06, 0.100963081981794705E+06, - 0.100926251398063658E+06, 0.100882116391194853E+06, 0.100836110949086375E+06, 0.100789196010976768E+06, 0.100741656022242169E+06, - 0.100693739602509639E+06, 0.100645654807320738E+06, 0.100597565425804190E+06, 0.100549588305930272E+06, 0.100501791687992096E+06, - 0.100454194516198477E+06, 0.100406766687836353E+06, 0.100359430189551465E+06, 0.100303106797204193E+06, 0.100246577208372706E+06, - 0.100190531822652643E+06, 0.100135266216653603E+06, 0.100081062875707968E+06, 0.100028192493603376E+06, 0.999769161960119818E+05, - 0.999274886616365693E+05, 0.998801621121565840E+05, 0.998351911400472018E+05, 0.997962094163349393E+05, 0.997640534483473457E+05, - 0.997345240177219384E+05, 0.997076990988948673E+05, 0.996836794307263772E+05, 0.996625896600271371E+05, 0.996445791479565378E+05, - 0.996298224252568762E+05, 0.996185192726470996E+05, 0.996108943913202529E+05, 0.996171044733596500E+05, 0.996274341933858086E+05, - 0.996407368485686020E+05, 0.996564433077199938E+05, 0.996739662819337100E+05, 0.996926995456860750E+05, 0.997120167510192841E+05, - 0.997312700110226870E+05, 0.997492720049924683E+05, 0.997589945357419347E+05, 0.997672950870170171E+05, 0.997740082631510304E+05, - 0.997789569418504107E+05, 0.997819534179343900E+05, 0.997828018434580008E+05, 0.997813025467889238E+05, 0.997761547542830958E+05, - 0.997606903751367063E+05, 0.997380039112137747E+05, 0.997148807783809316E+05, 0.996925793721139198E+05, 0.996723316187614837E+05, - 0.996553186696160265E+05, 0.996426434711866459E+05, 0.996353006212308683E+05, 0.996360089851673401E+05, 0.996493081867637520E+05, - 0.996683800195190997E+05, 0.996929780547397386E+05, 0.997227658669395460E+05, 0.997573001543519495E+05, 0.997960150791931374E+05, - 0.998382096557535260E+05, 0.998830404070649238E+05, 0.999298323121304275E+05, 0.999742523604048474E+05, 0.100016965326181715E+06, - 0.100057253131543956E+06, 0.100094584675305145E+06, 0.100128612542877818E+06, 0.100159162106115866E+06, 0.100186212494174571E+06, - 0.100209869217876141E+06, 0.100230664541801205E+06, 0.100252215827535721E+06, 0.100272507526162837E+06, 0.100291578842935764E+06, - 0.100309849731348106E+06, 0.100327689967233746E+06, 0.100345394170965068E+06, 0.100363163535270942E+06, 0.100381092592034052E+06, - 0.100399259031973241E+06, 0.100417513798931104E+06, 0.100435580822035801E+06, 0.100453091252954211E+06, 0.100469603339999827E+06, - 0.100480151507121773E+06, 0.100489254638568047E+06, 0.100498595808049067E+06, 0.100508951548301586E+06, 0.100521040443233302E+06, - 0.100536087694824993E+06, 0.100554481106296153E+06, 0.100575842199618433E+06, 0.100600284600435130E+06, 0.100627894363922838E+06, - 0.100660998742818352E+06, 0.100699900685942383E+06, 0.100740240979155365E+06, 0.100780773089326132E+06, 0.100820325888548046E+06, - 0.100857002425394050E+06, 0.100889306549680012E+06, 0.100918410465244044E+06, 0.100943855527829830E+06, 0.100965216993375041E+06, - 0.100982104369596826E+06, 0.100988787448417890E+06, 0.100992039290643908E+06, 0.100992851817592629E+06, 0.100992148367721486E+06, - 0.100990754377491627E+06, 0.100989328864528783E+06, 0.100987939282731590E+06, 0.100987019598780156E+06, 0.100986810224360001E+06, - 0.100987461015865600E+06, 0.100989052975663959E+06, 0.100991630597561802E+06, 0.100995163025901697E+06, 0.101001875722349461E+06, - 0.101011088720900429E+06, 0.101021084899088091E+06, 0.101031663037972830E+06, 0.101042638294081626E+06, 0.101053858103835970E+06, - 0.101065218626100279E+06, 0.101076680586933391E+06, 0.101088283485301858E+06, 0.101099874970037970E+06, 0.101113089326713816E+06, - 0.101125428039884195E+06, 0.101136196176455385E+06, 0.101144782354753406E+06, 0.101150661981462021E+06, 0.101153397040916956E+06, - 0.101152632849470392E+06, 0.101148092219151222E+06, 0.101138825885236918E+06, 0.101125297346996245E+06, 0.101107998631323659E+06, - 0.101086896343469081E+06, 0.101061954484055474E+06, 0.101033133620494526E+06, 0.101000389988487950E+06, 0.100963674428856495E+06, - 0.100920035249967157E+06, 0.100864002050084426E+06, 0.100802954127500183E+06, 0.100739491656333426E+06, 0.100674607806506479E+06, - 0.100609142818467881E+06, 0.100543918229119721E+06, 0.100479729438758746E+06, 0.100417340423775575E+06, 0.100357818911458060E+06, - 0.100301549120910859E+06, 0.100249027161521051E+06, 0.100200821670612902E+06, 0.101087517829558172E+06, 0.101052015003826687E+06, - 0.101011788745108162E+06, 0.100964536778963855E+06, 0.100915488137692053E+06, 0.100864943012846241E+06, 0.100813190048196135E+06, - 0.100760500256302723E+06, 0.100707121731364154E+06, 0.100653275174801398E+06, 0.100599150242222226E+06, 0.100544902712618306E+06, - 0.100490652473024573E+06, 0.100436482304513964E+06, 0.100382437448442113E+06, 0.100320280351299210E+06, 0.100257427382579408E+06, - 0.100194846079550756E+06, 0.100132891655021755E+06, 0.100071918796184837E+06, 0.100012281557507449E+06, 0.999543340473443968E+05, - 0.998984318951125897E+05, 0.998449344820776314E+05, 0.997942079153267550E+05, 0.997466460297804297E+05, 0.997094928681285237E+05, - 0.996756279012622545E+05, 0.996450218538222252E+05, 0.996176735384205385E+05, 0.995936103776563396E+05, 0.995728884174646664E+05, - 0.995555917894421727E+05, 0.995418315732738702E+05, 0.995317440033937164E+05, 0.995262628136555868E+05, 0.995329410864949314E+05, - 0.995433141117427585E+05, 0.995568197318211314E+05, 0.995728823939344729E+05, 0.995909116272487881E+05, 0.996102999545491039E+05, - 0.996304204174830811E+05, 0.996506239397997124E+05, 0.996702368021630245E+05, 0.996815718025470851E+05, 0.996899469928969920E+05, - 0.996967323341972806E+05, 0.997018093255459680E+05, 0.997050766826754843E+05, 0.997064543685055542E+05, 0.997058891541211779E+05, - 0.997033620388164272E+05, 0.996988978495463380E+05, 0.996831868676393642E+05, 0.996664226445127570E+05, 0.996504367351514375E+05, - 0.996361908772876632E+05, 0.996245860820844246E+05, 0.996164411729444837E+05, 0.996124708057612588E+05, 0.996132638091558620E+05, - 0.996196649575229239E+05, 0.996367110923675500E+05, 0.996583825556631200E+05, 0.996843326520396949E+05, 0.997128691088688356E+05, - 0.997429147876210773E+05, 0.997758051592909760E+05, 0.998110107603276119E+05, 0.998478942000829556E+05, 0.998857114279977977E+05, - 0.999214491155317955E+05, 0.999550948845939129E+05, 0.999866837454055931E+05, 0.100015951080814193E+06, 0.100042763152220112E+06, - 0.100066833155271277E+06, 0.100088158247781059E+06, 0.100108078185884762E+06, 0.100126927297932227E+06, 0.100144951073682430E+06, - 0.100162306504082269E+06, 0.100179972902585811E+06, 0.100197255514410528E+06, 0.100214513504718459E+06, 0.100231716678680328E+06, - 0.100248516891677820E+06, 0.100264879167597144E+06, 0.100280677931150029E+06, 0.100295703143529230E+06, 0.100309668678237373E+06, - 0.100317822458752169E+06, 0.100323698725186405E+06, 0.100328766123466703E+06, 0.100333617686529382E+06, 0.100338870421945830E+06, - 0.100345146510504768E+06, 0.100353505811859010E+06, 0.100364091412822730E+06, 0.100377219192028511E+06, 0.100393145224109379E+06, - 0.100412076822805961E+06, 0.100436536362016341E+06, 0.100466993027333549E+06, 0.100499128955239808E+06, 0.100531867585847620E+06, - 0.100564210070354224E+06, 0.100595268938737849E+06, 0.100623389505981249E+06, 0.100648875381678285E+06, 0.100671545265182722E+06, - 0.100691215991390258E+06, 0.100707855569253967E+06, 0.100721531568851729E+06, 0.100729765774870320E+06, 0.100736382308921660E+06, - 0.100742049357786149E+06, 0.100747338931632839E+06, 0.100752699996680560E+06, 0.100758437644766876E+06, 0.100764492369211905E+06, - 0.100771174162651805E+06, 0.100778897781122723E+06, 0.100791202238176033E+06, 0.100805304746492911E+06, 0.100820453141876555E+06, - 0.100836553977341420E+06, 0.100853433691068960E+06, 0.100869804352758074E+06, 0.100885565873248357E+06, 0.100901263434718436E+06, - 0.100916755649211860E+06, 0.100931925490762223E+06, 0.100946862129343805E+06, 0.100964994999554750E+06, 0.100982379998277524E+06, - 0.100998599729598267E+06, 0.101013259118967748E+06, 0.101025997621651855E+06, 0.101036183051793079E+06, 0.101042991775159331E+06, - 0.101046219174794693E+06, 0.101045436783694371E+06, 0.101037979396283830E+06, 0.101026389136987622E+06, 0.101011353849770458E+06, - 0.100992765156084381E+06, 0.100970520839387638E+06, 0.100944522980413691E+06, 0.100914676733503889E+06, 0.100880889510173438E+06, - 0.100843070409204898E+06, 0.100794195318855112E+06, 0.100740849916230014E+06, 0.100684368608276331E+06, 0.100625515617689191E+06, - 0.100565057571482292E+06, 0.100503753672499588E+06, 0.100442348146381337E+06, 0.100381564680888332E+06, 0.100322120082476831E+06, - 0.100265427081164002E+06, 0.100211108587006820E+06, 0.100159852906932778E+06, 0.100112309293580329E+06, 0.101124201328911135E+06, - 0.101079108320663814E+06, 0.101031809144729792E+06, 0.100982479818601947E+06, 0.100931296727433786E+06, 0.100878431465452362E+06, - 0.100824045759680885E+06, 0.100768286540631874E+06, 0.100710530566360118E+06, 0.100651851143405918E+06, 0.100592641779612633E+06, - 0.100533088300546049E+06, 0.100473351995987294E+06, 0.100413568226339557E+06, 0.100347374189164038E+06, 0.100280419558277266E+06, - 0.100213466642138825E+06, 0.100146884874704396E+06, 0.100081054126754942E+06, 0.100016363564741026E+06, 0.999532111494706915E+05, - 0.998920037667682045E+05, 0.998331579776468134E+05, 0.997771013708717801E+05, 0.997242744959584961E+05, 0.996794911425569007E+05, - 0.996421673866169731E+05, 0.996083624063458992E+05, 0.995780558571076108E+05, 0.995512438908386830E+05, 0.995279390599935141E+05, - 0.995081697090995876E+05, 0.994919788171798573E+05, 0.994794222509916144E+05, 0.994705663858296175E+05, 0.994666304399983201E+05, - 0.994716729317709396E+05, 0.994803098980725772E+05, 0.994920284915772354E+05, 0.995062941002977459E+05, 0.995225510997954116E+05, - 0.995402235083560226E+05, 0.995587157137078175E+05, 0.995774134724761680E+05, 0.995956854178548674E+05, 0.996082099438724399E+05, - 0.996146714115503564E+05, 0.996198917096476653E+05, 0.996237772972328385E+05, 0.996262556600006501E+05, 0.996272811679797160E+05, - 0.996268420791924145E+05, 0.996249688472863927E+05, 0.996217438673883153E+05, 0.996165665480622556E+05, 0.996053672464558331E+05, - 0.995949919441781822E+05, 0.995861528017038072E+05, 0.995795026742108748E+05, 0.995756196555683418E+05, 0.995749923295157205E+05, - 0.995764918417123117E+05, 0.995811371618628909E+05, 0.995900021812679042E+05, 0.996053443416097725E+05, 0.996253126869847765E+05, - 0.996485392863536254E+05, 0.996747275639752770E+05, 0.997034975235640304E+05, 0.997343816924544808E+05, 0.997668244608898967E+05, - 0.998001857951137499E+05, 0.998337502953590738E+05, 0.998667425003782409E+05, 0.998964382191309269E+05, 0.999219732315580331E+05, - 0.999453769704884326E+05, 0.999669632680838986E+05, 0.999870458961453260E+05, 0.100005916456012012E+06, 0.100023824889774987E+06, - 0.100040963571971195E+06, 0.100057455775243085E+06, 0.100073413986486979E+06, 0.100089335775104671E+06, 0.100104815244426631E+06, - 0.100119703191363587E+06, 0.100134379227022902E+06, 0.100148369375800728E+06, 0.100161370783191393E+06, 0.100173213642796953E+06, - 0.100180378799944810E+06, 0.100185526497069281E+06, 0.100189324284954535E+06, 0.100192153267272603E+06, 0.100194434190503976E+06, - 0.100196610662858875E+06, 0.100198905421094794E+06, 0.100201850991823914E+06, 0.100206163107215340E+06, 0.100212230663632377E+06, - 0.100220378132198122E+06, 0.100230869811071767E+06, 0.100245444302250398E+06, 0.100264473811748554E+06, 0.100285188354245533E+06, - 0.100306907645131752E+06, 0.100328990026887506E+06, 0.100350863943610893E+06, 0.100371839758985952E+06, 0.100391444833452260E+06, - 0.100409831169643890E+06, 0.100426823791286341E+06, 0.100442350551841242E+06, 0.100456434485740057E+06, 0.100469179887128601E+06, - 0.100480095078871280E+06, 0.100490844862516460E+06, 0.100501773469729742E+06, 0.100513473090107072E+06, 0.100529036405637875E+06, - 0.100544944618372494E+06, 0.100561407314039185E+06, 0.100578441255079553E+06, 0.100596158161423402E+06, 0.100614688506316757E+06, - 0.100634037456854698E+06, 0.100654132781311564E+06, 0.100674831301503669E+06, 0.100695930204477670E+06, 0.100717182634869590E+06, - 0.100738316734543623E+06, 0.100757949561458212E+06, 0.100778269263575014E+06, 0.100798138776316147E+06, 0.100817212656416305E+06, - 0.100835135245772617E+06, 0.100851545416907000E+06, 0.100866083297882986E+06, 0.100878398135237148E+06, 0.100888156496614407E+06, - 0.100895050095971907E+06, 0.100897946875170004E+06, 0.100893038607802475E+06, 0.100884438418173842E+06, 0.100872056807847897E+06, - 0.100855733686039923E+06, 0.100836196267254127E+06, 0.100813309503127763E+06, 0.100786948600525633E+06, 0.100756997497101227E+06, - 0.100723347939641535E+06, 0.100681497385685245E+06, 0.100634489632593322E+06, 0.100584469640955329E+06, 0.100531975070484972E+06, - 0.100477580490852386E+06, 0.100421885399875624E+06, 0.100365503956835804E+06, 0.100309056337240749E+06, 0.100253161585176160E+06, - 0.100199112753698049E+06, 0.100147837599931416E+06, 0.100098570404209735E+06, 0.100051904767761502E+06, 0.100008417383464068E+06, - 0.101133829804470908E+06, 0.101086063734912168E+06, 0.101036163378778583E+06, 0.100984272823056410E+06, 0.100930541473297533E+06, - 0.100875120408097937E+06, 0.100818158832696005E+06, 0.100759800682388610E+06, 0.100700181428799915E+06, 0.100639425144117529E+06, - 0.100577641880169904E+06, 0.100514925420599073E+06, 0.100451351465310479E+06, 0.100382775391041228E+06, 0.100313407558045423E+06, - 0.100244124043691409E+06, 0.100175160300200252E+06, 0.100106643005048623E+06, 0.100038955227867787E+06, 0.999724957502307661E+05, - 0.999076781431158888E+05, 0.998449303055831406E+05, 0.997846944474534976E+05, 0.997274274929867825E+05, 0.996741803525597352E+05, - 0.996341923290063423E+05, 0.995977652427823923E+05, 0.995648719529626542E+05, 0.995354913787664409E+05, 0.995096084222995123E+05, - 0.994872134460891248E+05, 0.994683012796486000E+05, 0.994528697284307418E+05, 0.994409175579627627E+05, 0.994324419258456037E+05, - 0.994284685420939932E+05, 0.994314645232595940E+05, 0.994376508028579119E+05, 0.994465880324430618E+05, 0.994578122019961011E+05, - 0.994708370980191394E+05, 0.994851569440643361E+05, 0.995002493657292362E+05, 0.995155788435459253E+05, 0.995306008387735346E+05, - 0.995442855494334071E+05, 0.995482724169068970E+05, 0.995511559961705934E+05, 0.995528872179506288E+05, 0.995534386606523331E+05, - 0.995528106454166118E+05, 0.995510380683528929E+05, 0.995481980155677447E+05, 0.995444181794313772E+05, 0.995389426918443642E+05, - 0.995326299748121528E+05, 0.995248068651720969E+05, 0.995181203502452699E+05, 0.995131485287031392E+05, 0.995104093839186244E+05, - 0.995103487778951967E+05, 0.995133292577804386E+05, 0.995196200330811116E+05, 0.995293885226779821E+05, 0.995426939068978973E+05, - 0.995594831481808505E+05, 0.995804466354603064E+05, 0.996042013257502404E+05, 0.996303970501146687E+05, 0.996586123005633417E+05, - 0.996883528051014437E+05, 0.997188265847352159E+05, 0.997490367113701504E+05, 0.997788526495865081E+05, 0.998078707819837873E+05, - 0.998356993938613014E+05, 0.998619800562695164E+05, 0.998837326032437413E+05, 0.999030588156207523E+05, 0.999213959026974480E+05, - 0.999389528776631778E+05, 0.999559737390779337E+05, 0.999728528505193826E+05, 0.999889548460716323E+05, 0.100004292017804837E+06, - 0.100018822423468373E+06, 0.100032457501698547E+06, 0.100045070251751036E+06, 0.100056503593779649E+06, 0.100066444229329674E+06, - 0.100073267298309525E+06, 0.100078208907556284E+06, 0.100081428306994378E+06, 0.100083145646425299E+06, 0.100084490398295631E+06, - 0.100085214798590619E+06, 0.100085235536889129E+06, 0.100083644141418641E+06, 0.100082296767241191E+06, 0.100081573165770096E+06, - 0.100081814208376789E+06, 0.100083316094140551E+06, 0.100086326553815597E+06, 0.100092077248113128E+06, 0.100100913993150592E+06, - 0.100111107468981296E+06, 0.100122323217253404E+06, 0.100134231875447673E+06, 0.100146529461883110E+06, 0.100158953738958458E+06, - 0.100172103739167927E+06, 0.100185442550333013E+06, 0.100198870033114930E+06, 0.100214743046030431E+06, 0.100230501702414200E+06, - 0.100246186063517438E+06, 0.100261900880765723E+06, 0.100278280962620207E+06, 0.100294975745097370E+06, 0.100311878419328103E+06, - 0.100329065054564679E+06, 0.100346610730169734E+06, 0.100364576981339662E+06, 0.100382997190169379E+06, 0.100401860048637522E+06, - 0.100421460558640218E+06, 0.100441987614432976E+06, 0.100463274519939529E+06, 0.100485156332498926E+06, 0.100507667562079601E+06, - 0.100531755712309474E+06, 0.100555537683995659E+06, 0.100578784151641899E+06, 0.100601239956125326E+06, 0.100622628756313949E+06, - 0.100641873088256354E+06, 0.100658680264014634E+06, 0.100673598187900920E+06, 0.100686312726101605E+06, 0.100696503456104270E+06, - 0.100703849613094353E+06, 0.100704152415214849E+06, 0.100700762505721214E+06, 0.100694332357036590E+06, 0.100684801738842943E+06, - 0.100672137064367969E+06, 0.100656329651135165E+06, 0.100637393206196401E+06, 0.100615360755861184E+06, 0.100590281222544916E+06, - 0.100562215831141861E+06, 0.100526781016220033E+06, 0.100486348156266336E+06, 0.100442798181998849E+06, 0.100397163429546563E+06, - 0.100349807344903311E+06, 0.100301139976506107E+06, 0.100251607747954069E+06, 0.100201684250218939E+06, 0.100151862062679153E+06, - 0.100102645581508201E+06, 0.100056044918004729E+06, 0.100011301942910883E+06, 0.999684520456376777E+05, 0.999279531311431929E+05, - 0.998902646792392770E+05, 0.101126663346454399E+06, 0.101077325354608969E+06, 0.101025975734916894E+06, 0.100972737972671399E+06, - 0.100917744423974829E+06, 0.100861133803490855E+06, 0.100803048766821448E+06, 0.100743633625432005E+06, 0.100683032233185906E+06, - 0.100621386084403202E+06, 0.100558832663878042E+06, 0.100495211427552291E+06, 0.100428081646754872E+06, 0.100360053702616802E+06, - 0.100291421804985934E+06, 0.100222501857581025E+06, 0.100153629396011398E+06, 0.100085157752426705E+06, 0.100017456492403435E+06, - 0.999509101650603116E+05, 0.998859174013813172E+05, 0.998228903882164013E+05, 0.997622547363343474E+05, 0.997044497501409787E+05, - 0.996565808532324445E+05, 0.996171954030033376E+05, 0.995813735590216529E+05, 0.995490780595074320E+05, 0.995202664706442010E+05, - 0.994948916653312772E+05, 0.994731497863732366E+05, 0.994547373765991215E+05, 0.994395024448596523E+05, 0.994273918334258487E+05, - 0.994183417080185318E+05, 0.994131115873192466E+05, 0.994138210062121798E+05, 0.994170868554473127E+05, 0.994225572846895811E+05, - 0.994298923767942179E+05, 0.994385978253560606E+05, 0.994482495116238133E+05, 0.994584440096453618E+05, 0.994687785322086420E+05, - 0.994788546658055129E+05, 0.994882828035313869E+05, 0.994927040708071727E+05, 0.994917547439376503E+05, 0.994895539007886109E+05, - 0.994862075166797877E+05, 0.994818501581585733E+05, 0.994766470759525691E+05, 0.994707963627129502E+05, 0.994645310337857954E+05, - 0.994581208250226337E+05, 0.994518734280974313E+05, 0.994461348017268174E+05, 0.994415182672292285E+05, 0.994388346879257297E+05, - 0.994384357346413162E+05, 0.994406125032009149E+05, 0.994455917032776051E+05, 0.994535286747415666E+05, 0.994645016916688619E+05, - 0.994785078337676387E+05, 0.994954607091662765E+05, 0.995151903074341826E+05, 0.995379744989390892E+05, 0.995645762978403654E+05, - 0.995919660907828365E+05, 0.996199268533732247E+05, 0.996482101418556267E+05, 0.996765332991438627E+05, 0.997045938426658686E+05, - 0.997320840835444978E+05, 0.997587053657859215E+05, 0.997841813092843222E+05, 0.998082694645679585E+05, 0.998307708426059398E+05, - 0.998521847777656949E+05, 0.998731316336951131E+05, 0.998915223579208832E+05, 0.999088069900928822E+05, 0.999250655468217301E+05, - 0.999403321942196199E+05, 0.999545992766920099E+05, 0.999678219791941956E+05, 0.999799234377201792E+05, 0.999908557408674824E+05, - 0.100000288315772239E+06, 0.100007974659642932E+06, 0.100013912274213857E+06, 0.100018152445268570E+06, 0.100020792433534516E+06, - 0.100021965384116600E+06, 0.100021828600707202E+06, 0.100018978825766098E+06, 0.100014638020503815E+06, 0.100010038309740252E+06, - 0.100005576575099418E+06, 0.100001604858675491E+06, 0.999984320892866672E+05, 0.999963266886948113E+05, 0.999958737477183749E+05, - 0.999972975927051302E+05, 0.100000048030566773E+06, 0.100004042344745598E+06, 0.100009194673973179E+06, 0.100015426118827090E+06, - 0.100022673026545686E+06, 0.100031009563329135E+06, 0.100040766570146734E+06, 0.100051217540583049E+06, 0.100062248668533124E+06, - 0.100073786795171531E+06, 0.100085797503990121E+06, 0.100098280610450573E+06, 0.100111262656178049E+06, 0.100125001802413579E+06, - 0.100139645695878644E+06, 0.100154900063508263E+06, 0.100170710309353148E+06, 0.100187004814548171E+06, 0.100203682971120987E+06, - 0.100220602392753455E+06, 0.100237565502663623E+06, 0.100256278549938754E+06, 0.100276900404893633E+06, 0.100298794291387065E+06, - 0.100320557514765664E+06, 0.100342058165774986E+06, 0.100363130678741916E+06, 0.100383577435456726E+06, 0.100403171366828377E+06, - 0.100421659429775435E+06, 0.100438766794516225E+06, 0.100454201546808938E+06, 0.100467659691497232E+06, 0.100478830237807808E+06, - 0.100481024801078907E+06, 0.100479810484167552E+06, 0.100476403382797740E+06, 0.100470673041393165E+06, 0.100462504496619513E+06, - 0.100451800234604845E+06, 0.100438481209722173E+06, 0.100422487058078696E+06, 0.100403775642287073E+06, 0.100382322062990715E+06, - 0.100358117267813446E+06, 0.100327534199358997E+06, 0.100293850879764213E+06, 0.100257806725219358E+06, 0.100219741686727677E+06, - 0.100180023194298759E+06, 0.100139040711945461E+06, 0.100097200477411025E+06, 0.100054920551059535E+06, 0.100012626265403043E+06, - 0.999707461374165723E+05, 0.999303503014407033E+05, 0.998922229704366764E+05, 0.998554721656402544E+05, 0.998204850080980395E+05, - 0.997876409225251264E+05, 0.997573084048583696E+05, 0.101103863341862932E+06, 0.101054198041262367E+06, 0.101002678396138304E+06, - 0.100949414469850730E+06, 0.100894527371675096E+06, 0.100838147558637153E+06, 0.100780413214267071E+06, 0.100721468731159111E+06, - 0.100661463324523051E+06, 0.100600549803942500E+06, 0.100538495641508489E+06, 0.100474499779926511E+06, 0.100409614880186520E+06, - 0.100344074690081019E+06, 0.100278137807477731E+06, 0.100212086086552372E+06, 0.100146223109295490E+06, 0.100080872747272268E+06, - 0.100016377835126099E+06, 0.999530989729176799E+05, 0.998914134690468200E+05, 0.998317144291724107E+05, 0.997744099892116501E+05, - 0.997208338934957865E+05, 0.996799309689324291E+05, 0.996422327801534993E+05, 0.996077247089604498E+05, 0.995763830833266111E+05, - 0.995481752007196337E+05, 0.995230592311468208E+05, 0.995009839760444302E+05, 0.994818884619951277E+05, 0.994657013515687577E+05, - 0.994523401572802686E+05, 0.994417102486785589E+05, 0.994338127166474005E+05, 0.994291184813256987E+05, 0.994266081659517949E+05, - 0.994259833524572168E+05, 0.994269351914163999E+05, 0.994291475057475909E+05, 0.994323001129119220E+05, 0.994360724062380032E+05, - 0.994401472289394151E+05, 0.994442150616938598E+05, 0.994479785254193557E+05, 0.994511571742526139E+05, 0.994472284598653205E+05, - 0.994408965796853736E+05, 0.994339336034472362E+05, 0.994264710020695638E+05, 0.994186660048548511E+05, 0.994107025256855122E+05, - 0.994027916086733312E+05, 0.993951711926945572E+05, 0.993881049497915083E+05, 0.993818799057818542E+05, 0.993768025040628709E+05, - 0.993745371453054540E+05, 0.993758273945832625E+05, 0.993797480709728989E+05, 0.993864179439653672E+05, 0.993959015946626314E+05, - 0.994106666848780587E+05, 0.994280957797027659E+05, 0.994479062249146809E+05, 0.994699024606817256E+05, 0.994938326370272989E+05, - 0.995193970618178137E+05, 0.995462575961586117E+05, 0.995732238058578514E+05, 0.995996836683722795E+05, 0.996264076540508540E+05, - 0.996531520384603791E+05, 0.996796729134591151E+05, 0.997057352581914602E+05, 0.997311214531925361E+05, 0.997565307292698708E+05, - 0.997809628500159452E+05, 0.998041926037547237E+05, 0.998260922842872533E+05, 0.998465616497438023E+05, 0.998655323213428928E+05, - 0.998829702013785281E+05, 0.998988759405013552E+05, 0.999132835855504527E+05, 0.999267531384376343E+05, 0.999401187534305645E+05, - 0.999522829859957856E+05, 0.999629705900948175E+05, 0.999720750719777716E+05, 0.999795225775888684E+05, 0.999852704402040836E+05, - 0.999893033756584045E+05, 0.999916276698245056E+05, 0.999912215328864258E+05, 0.999874978505536856E+05, 0.999827294697511534E+05, - 0.999772668831095216E+05, 0.999714403004270425E+05, 0.999655543840146129E+05, 0.999598844544293243E+05, 0.999546738384171913E+05, - 0.999501503361758805E+05, 0.999464612795733119E+05, 0.999436472754112765E+05, 0.999417478240415512E+05, 0.999407845190346270E+05, - 0.999407674168311496E+05, 0.999417003681598144E+05, 0.999435850419050112E+05, 0.999466778359479795E+05, 0.999509741170870548E+05, - 0.999561184478715149E+05, 0.999620266396879451E+05, 0.999686260435519798E+05, 0.999758509523019893E+05, 0.999836356497705565E+05, - 0.999919049957114039E+05, 0.100000562486864073E+06, 0.100011784952549118E+06, 0.100025750768122278E+06, 0.100039950549839836E+06, - 0.100054145017178846E+06, 0.100068316891848794E+06, 0.100082450146767165E+06, 0.100096523400557431E+06, 0.100110501610887819E+06, - 0.100124326095454249E+06, 0.100137903024072584E+06, 0.100153035210029513E+06, 0.100168028234449826E+06, 0.100182528489386037E+06, - 0.100196311615898419E+06, 0.100209129758123207E+06, 0.100220714305906484E+06, 0.100227674075086179E+06, 0.100228582862959636E+06, - 0.100228182141282334E+06, 0.100226441566948473E+06, 0.100223301716988630E+06, 0.100218680617939594E+06, 0.100212480375930187E+06, - 0.100204593660852275E+06, 0.100193237399701000E+06, 0.100179608999797390E+06, 0.100163806561057383E+06, 0.100145763706322687E+06, - 0.100124166108882637E+06, 0.100097853920290698E+06, 0.100069603397772837E+06, 0.100039598196173276E+06, 0.100008052525304520E+06, - 0.999752085984543955E+05, 0.999413336779185047E+05, 0.999067168729345140E+05, 0.998716658233869821E+05, 0.998365033809807937E+05, - 0.998015643788216548E+05, 0.997673503212209471E+05, 0.997368095318123815E+05, 0.997072417009385681E+05, 0.996789372306682053E+05, - 0.996521942416031088E+05, 0.996273141486202512E+05, 0.996045978845247591E+05, 0.101067589111213412E+06, 0.101018770688517165E+06, - 0.100968154311929655E+06, 0.100916004392167699E+06, 0.100862587963118029E+06, 0.100807829042751429E+06, 0.100751860689524168E+06, - 0.100694824678955032E+06, 0.100636870575220571E+06, 0.100578085861079686E+06, 0.100518387120511878E+06, 0.100457910498338359E+06, - 0.100396827710058526E+06, 0.100335334776766380E+06, 0.100273650785659062E+06, 0.100212016619918053E+06, 0.100150693670614579E+06, - 0.100089962540906286E+06, 0.100030121749858867E+06, 0.999714864397286292E+05, 0.999143870864777564E+05, 0.998591682086720684E+05, - 0.998061870647466858E+05, 0.997614041189860436E+05, 0.997232133410041570E+05, 0.996877601571912237E+05, 0.996550329117300425E+05, - 0.996250097998356068E+05, 0.995976585142769036E+05, 0.995729358349222894E+05, 0.995507871467952355E+05, 0.995311458738776855E+05, - 0.995139328178480646E+05, 0.994990553930397000E+05, 0.994864067510919558E+05, 0.994758647909620777E+05, 0.994662936172032933E+05, - 0.994584116138104437E+05, 0.994520440064580325E+05, 0.994469670430250553E+05, 0.994429511205758317E+05, 0.994397638951787376E+05, - 0.994371735196124209E+05, 0.994349519828108314E+05, 0.994328785098660155E+05, 0.994307429622300406E+05, 0.994283491541375697E+05, - 0.994255179730021191E+05, 0.994164893114872393E+05, 0.994067289084808290E+05, 0.993968888922061742E+05, 0.993871232560968492E+05, - 0.993776052903232921E+05, 0.993685268314349669E+05, 0.993600967438642401E+05, 0.993525384531912714E+05, 0.993461969112091901E+05, - 0.993435709722199681E+05, 0.993430289823759958E+05, 0.993448240458555374E+05, 0.993518125064813066E+05, 0.993620332314667612E+05, - 0.993746322170980275E+05, 0.993895541802843509E+05, 0.994066995366652700E+05, 0.994259271220238734E+05, 0.994470579336317896E+05, - 0.994698797554098419E+05, 0.994941524985713913E+05, 0.995196140617028141E+05, 0.995459864926176379E+05, 0.995729822203312797E+05, - 0.996003101205446874E+05, 0.996273070851956145E+05, 0.996547798040555062E+05, 0.996819738131592894E+05, 0.997085378998868837E+05, - 0.997343278080748278E+05, 0.997592022275180498E+05, 0.997830289890008135E+05, 0.998056904289906088E+05, 0.998270877683784638E+05, - 0.998471443932554248E+05, 0.998658079734391795E+05, 0.998830514038870024E+05, 0.998996025676379795E+05, 0.999153229697452334E+05, - 0.999295566639472963E+05, 0.999422722019988432E+05, 0.999534500054842792E+05, 0.999630795823789667E+05, 0.999711562553596450E+05, - 0.999776774721563124E+05, 0.999826387612595136E+05, 0.999854644320731022E+05, 0.999828794177739328E+05, 0.999789847225893318E+05, - 0.999739838414557307E+05, 0.999680998532223457E+05, 0.999615553821963986E+05, 0.999545658866950980E+05, 0.999473341203756863E+05, - 0.999400456392968772E+05, 0.999327953721481608E+05, 0.999256989141568774E+05, 0.999189700236989156E+05, 0.999127048128768074E+05, - 0.999069798769329791E+05, 0.999018544683639047E+05, 0.998973722234758170E+05, 0.998935621850836178E+05, 0.998904388907014218E+05, - 0.998896448727687675E+05, 0.998900344972452294E+05, 0.998911970826382749E+05, 0.998931396187662176E+05, 0.998958769268335309E+05, - 0.998994275255013781E+05, 0.999038084460577520E+05, 0.999090289824781794E+05, 0.999150833667861443E+05, 0.999217240524284571E+05, - 0.999282473433497362E+05, 0.999348833579850179E+05, 0.999415375242985901E+05, 0.999481154404054105E+05, 0.999545171017064131E+05, - 0.999606302661866066E+05, 0.999663230149861483E+05, 0.999714356178636663E+05, 0.999757718627941504E+05, 0.999790900530105428E+05, - 0.999810939111108019E+05, 0.999819561511524662E+05, 0.999789948862129386E+05, 0.999752827398946683E+05, 0.999708888630344300E+05, - 0.999658466886194801E+05, 0.999601566475907457E+05, 0.999537895884533064E+05, 0.999466907368066168E+05, 0.999387840276392963E+05, - 0.999299766462147236E+05, 0.999201636218782805E+05, 0.999092323322767916E+05, 0.998970667923400615E+05, 0.998831789013588714E+05, - 0.998636939941647142E+05, 0.998431119746374316E+05, 0.998214963412640354E+05, 0.997970862666926550E+05, 0.997712444170942908E+05, - 0.997445906917362154E+05, 0.997173029439411330E+05, 0.996895795051780588E+05, 0.996616375682111830E+05, 0.996337113354519679E+05, - 0.996060500180081726E+05, 0.995789157595469587E+05, 0.995557562522905791E+05, 0.995337048495515774E+05, 0.995126888312002120E+05, - 0.994929130817774712E+05, 0.994745951235418033E+05, 0.994579612022724759E+05, 0.994432427594338078E+05, 0.101021034351216382E+06, - 0.100974523158164724E+06, 0.100926407272977900E+06, 0.100876804093661282E+06, 0.100825841471867636E+06, 0.100773656698396328E+06, - 0.100720395485641522E+06, 0.100666210969990992E+06, 0.100612099345619077E+06, 0.100557249279083626E+06, 0.100501677971650905E+06, - 0.100445572670880414E+06, 0.100389253853780203E+06, 0.100332968905338319E+06, 0.100276665148379936E+06, 0.100220537893264976E+06, - 0.100164799821054621E+06, 0.100109679736971462E+06, 0.100055421257730064E+06, 0.100002281430952105E+06, 0.999505292822571937E+05, - 0.999004442827473104E+05, 0.998530843548639095E+05, 0.998156761219489854E+05, 0.997805278523404413E+05, 0.997476323427424795E+05, - 0.997169731242686539E+05, 0.996885239311042969E+05, 0.996622481616842706E+05, 0.996380983225617529E+05, 0.996160154459489713E+05, - 0.995959284728124476E+05, 0.995777535943772964E+05, 0.995613935458951310E+05, 0.995467368475156691E+05, 0.995336569880241732E+05, - 0.995208266243795515E+05, 0.995087482639954542E+05, 0.994977965334250039E+05, 0.994878249241337762E+05, 0.994786826211323350E+05, - 0.994702168427006691E+05, 0.994622751834644587E+05, 0.994547079083998542E+05, 0.994473701327138842E+05, 0.994401238077413873E+05, - 0.994328394160198222E+05, 0.994254188335577346E+05, 0.994184404922492249E+05, 0.994087127432848210E+05, 0.993987930235803360E+05, - 0.993894574291334138E+05, 0.993808966627234331E+05, 0.993733080854502186E+05, 0.993668924009867187E+05, 0.993618498078672274E+05, - 0.993583756460734730E+05, 0.993566555807828554E+05, 0.993568603838800627E+05, 0.993591403923829785E+05, 0.993636197419046657E+05, - 0.993703904921866488E+05, 0.993811197203903430E+05, 0.993950856599565304E+05, 0.994111457979586703E+05, 0.994291602554974379E+05, - 0.994489675444759632E+05, 0.994703876196585625E+05, 0.994932253351752443E+05, 0.995172741944998997E+05, 0.995426559018634871E+05, - 0.995694776827033347E+05, 0.995970389008766942E+05, 0.996251091056232981E+05, 0.996534496905636333E+05, 0.996818187512539298E+05, - 0.997099760279327893E+05, 0.997374141751707793E+05, 0.997622618739524623E+05, 0.997862435467323085E+05, 0.998092414887019404E+05, - 0.998311505958143825E+05, 0.998518805596518214E+05, 0.998718102890837035E+05, 0.998910750046514877E+05, 0.999090219912788452E+05, - 0.999255559670365765E+05, 0.999405919139345788E+05, 0.999540538378546335E+05, 0.999658730563341524E+05, 0.999759860512857849E+05, - 0.999843319314751134E+05, 0.999908495555851987E+05, 0.999954743712658383E+05, 0.999944404784162907E+05, 0.999915968456238916E+05, - 0.999872439634975599E+05, 0.999816171531630534E+05, 0.999749362615833961E+05, 0.999674042229870247E+05, 0.999592064518093102E+05, - 0.999505109123499715E+05, 0.999414687118180882E+05, 0.999323665105546679E+05, 0.999233975283402833E+05, 0.999144981369005836E+05, - 0.999058003303556034E+05, 0.998974241845954093E+05, 0.998894782591478870E+05, 0.998820595750179200E+05, 0.998752530846157169E+05, - 0.998691305778080132E+05, 0.998637489957377547E+05, 0.998586746844062873E+05, 0.998541772928227729E+05, 0.998502966627068381E+05, - 0.998469966131329420E+05, 0.998442320106148400E+05, 0.998419453691209637E+05, 0.998400626589490130E+05, 0.998384883490106731E+05, - 0.998370997211475333E+05, 0.998357405118142487E+05, 0.998339247931384743E+05, 0.998316580178510631E+05, 0.998293639855545480E+05, - 0.998269017565975373E+05, 0.998241201967542729E+05, 0.998208528853709577E+05, 0.998098081032783375E+05, 0.997954370825381193E+05, - 0.997808296869748592E+05, 0.997662255405725009E+05, 0.997518145513712225E+05, 0.997377288090598740E+05, 0.997240360167264153E+05, - 0.997115902471897134E+05, 0.997002807779587602E+05, 0.996889928911353927E+05, 0.996776906921413611E+05, 0.996663184120892256E+05, - 0.996548031405013462E+05, 0.996430577981460665E+05, 0.996309842516777717E+05, 0.996172720856796950E+05, 0.995989960463366879E+05, - 0.995803026148819772E+05, 0.995612677891255880E+05, 0.995419614978694444E+05, 0.995224517021402135E+05, 0.995028080337064894E+05, - 0.994831049415358284E+05, 0.994634243322594411E+05, 0.994438577049017331E+05, 0.994245077928505052E+05, 0.994054897371244297E+05, - 0.993869318243143207E+05, 0.993690043020055746E+05, 0.993554308490509575E+05, 0.993412332136938494E+05, 0.993276308539287711E+05, - 0.993151162456799066E+05, 0.993038276851009432E+05, 0.992939167429839872E+05, 0.992855451787946949E+05, 0.992788820449725754E+05, - 0.100964847544612581E+06, 0.100921528597807934E+06, 0.100876819617514033E+06, 0.100830819119977881E+06, 0.100783635790840315E+06, - 0.100735387872604493E+06, 0.100686849362626730E+06, 0.100638850722815405E+06, 0.100589987206303587E+06, 0.100540391690949080E+06, - 0.100490207838124057E+06, 0.100439589213655403E+06, 0.100388698427470110E+06, 0.100337706295036201E+06, 0.100286791022897989E+06, - 0.100236137419730803E+06, 0.100185936133379830E+06, 0.100136382913311769E+06, 0.100087677896791603E+06, 0.100040024915916016E+06, - 0.999936308213850425E+05, 0.999487048175969685E+05, 0.999098959263045108E+05, 0.998760905821691704E+05, 0.998440744381323602E+05, - 0.998138388707919803E+05, 0.997853639904371375E+05, 0.997586190608742472E+05, 0.997335630315415328E+05, 0.997101451748205582E+05, - 0.996883058208672010E+05, 0.996679771815481945E+05, 0.996490842541338643E+05, 0.996315457942174835E+05, 0.996152753458579973E+05, - 0.996001823151213321E+05, 0.995855679555827810E+05, 0.995705558364965109E+05, 0.995563634129148850E+05, 0.995429286082849721E+05, - 0.995301928975228802E+05, 0.995181034121451230E+05, 0.995066149374921079E+05, 0.994956917495421949E+05, 0.994853092368055950E+05, - 0.994754552514231473E+05, 0.994661311329740856E+05, 0.994573523487461207E+05, 0.994491486954472930E+05, 0.994415640096655407E+05, - 0.994332401191460376E+05, 0.994242851325149240E+05, 0.994162875697421550E+05, 0.994093942955236271E+05, 0.994037502528714977E+05, - 0.993994957235938200E+05, 0.993967633485402912E+05, 0.993956749460767023E+05, 0.993963381773120200E+05, 0.993988431167032832E+05, - 0.994032587965396087E+05, 0.994096298031491460E+05, 0.994179730111528625E+05, 0.994282745493404218E+05, 0.994404870973938814E+05, - 0.994568186139204772E+05, 0.994754658271223161E+05, 0.994958964449326450E+05, 0.995177045414582390E+05, 0.995407458140571835E+05, - 0.995648609237595665E+05, 0.995898777201360062E+05, 0.996156137473152776E+05, 0.996418789751202567E+05, 0.996684786927591776E+05, - 0.996952164972683240E+05, 0.997218973051197536E+05, 0.997483303132390720E+05, 0.997743318352098577E+05, 0.997997279397391831E+05, - 0.998243568215117266E+05, 0.998484029817739647E+05, 0.998715185643880104E+05, 0.998929709407826740E+05, 0.999121391071011894E+05, - 0.999300598538423073E+05, 0.999466118827012979E+05, 0.999616803026846756E+05, 0.999751558213879034E+05, 0.999869336418048333E+05, - 0.999969120922718139E+05, 0.100004991024896648E+06, 0.100011070025070803E+06, 0.100011361902027944E+06, 0.100009689874259901E+06, - 0.100006354866167210E+06, 0.100001521961853068E+06, 0.999953569047140481E+05, 0.999880229251482233E+05, 0.999796782529097254E+05, - 0.999704742484093149E+05, 0.999605540801449097E+05, 0.999500518713602651E+05, 0.999395620634615480E+05, 0.999293797224061564E+05, - 0.999189780037119199E+05, 0.999084634603603772E+05, 0.998979305732036155E+05, 0.998874607924644370E+05, 0.998771215026191203E+05, - 0.998669648551638238E+05, 0.998570264274643996E+05, 0.998473236800365266E+05, 0.998378541987464268E+05, 0.998280094515223464E+05, - 0.998183015118441253E+05, 0.998087584599398106E+05, 0.997993088922536845E+05, 0.997898632369703118E+05, 0.997803110261358233E+05, - 0.997705176970055909E+05, 0.997603209573400527E+05, 0.997495267616314668E+05, 0.997338504371996823E+05, 0.997144148866953765E+05, - 0.996946194589021616E+05, 0.996748889962201501E+05, 0.996543973099300492E+05, 0.996333799061114987E+05, 0.996120632551793096E+05, - 0.995906575155593600E+05, 0.995693496108486434E+05, 0.995482968337894126E+05, 0.995276211300861032E+05, 0.995074041910853848E+05, - 0.994876834578204434E+05, 0.994684491110481467E+05, 0.994496420937635121E+05, 0.994311531852242333E+05, 0.994128231195840344E+05, - 0.993950629246981553E+05, 0.993796705843183881E+05, 0.993609699415756186E+05, 0.993418055421917088E+05, 0.993226794637357671E+05, - 0.993037059687493893E+05, 0.992849845648908376E+05, 0.992666033190360467E+05, 0.992486420429716236E+05, 0.992311752996093419E+05, - 0.992142751883332967E+05, 0.991980138777397078E+05, 0.991824658634138323E+05, 0.991677099373037345E+05, 0.991538308635238063E+05, - 0.991409207629147422E+05, 0.991303845164175582E+05, 0.991233478553789610E+05, 0.991173123854586884E+05, 0.991122941300806997E+05, - 0.991083274217430298E+05, 0.991054636978437338E+05, 0.991037699911700765E+05, 0.991033272031231463E+05, 0.991042282352598704E+05, - 0.991065760427079076E+05, 0.100899327711180042E+06, 0.100860014589195416E+06, 0.100819531202107522E+06, 0.100777959510744709E+06, - 0.100735390607726556E+06, 0.100694036465613695E+06, 0.100652089405901919E+06, 0.100609367247066592E+06, 0.100565963600471325E+06, - 0.100521982301190656E+06, 0.100477536683349797E+06, 0.100432748853070138E+06, 0.100387748961175384E+06, 0.100342674477306704E+06, - 0.100297669466538631E+06, 0.100252883868987425E+06, 0.100208472782261073E+06, 0.100164595745919316E+06, 0.100121416026401625E+06, - 0.100079099900142377E+06, 0.100037815931840771E+06, 0.999981416469988617E+05, 0.999662389876496309E+05, 0.999356748708466621E+05, - 0.999064575822306797E+05, 0.998785877324428584E+05, 0.998520583580002858E+05, 0.998268551135048328E+05, 0.998029565487271466E+05, - 0.997803344633126544E+05, 0.997589543309666333E+05, 0.997387757839643018E+05, 0.997197531476882141E+05, 0.997018360135869007E+05, - 0.996849698374662257E+05, 0.996690965483438340E+05, 0.996541551512074802E+05, 0.996382689559327409E+05, 0.996225861026435014E+05, - 0.996075569737299666E+05, 0.995931690202676109E+05, 0.995794128974490304E+05, 0.995662834351470083E+05, 0.995537804808199580E+05, - 0.995419095816340414E+05, 0.995306824727639178E+05, 0.995201173394836951E+05, 0.995102388219246932E+05, 0.995010777333177539E+05, - 0.994926704652096669E+05, 0.994850580565927958E+05, 0.994782849081547320E+05, 0.994712945317966660E+05, 0.994652135801002441E+05, - 0.994603804881314572E+05, 0.994568932856863394E+05, 0.994548423780885496E+05, 0.994543085284921108E+05, 0.994553608083860745E+05, - 0.994580545552721160E+05, 0.994624293810699601E+05, 0.994689205148530309E+05, 0.994771599445407046E+05, 0.994871232315969537E+05, - 0.994987933987223369E+05, 0.995121358180468815E+05, 0.995270974554495333E+05, 0.995436065119199775E+05, 0.995623452046183083E+05, - 0.995829609157189843E+05, 0.996045871363499173E+05, 0.996270734208106005E+05, 0.996502628846515872E+05, 0.996739938804089179E+05, - 0.996981017517049913E+05, 0.997224206254554738E+05, 0.997467852001343563E+05, 0.997710324871725461E+05, 0.997951466602976434E+05, - 0.998195365345201863E+05, 0.998432686447168817E+05, 0.998661797675172566E+05, 0.998881192989034753E+05, 0.999089497794278432E+05, - 0.999285470134942298E+05, 0.999467997752335650E+05, 0.999636091025751084E+05, 0.999788871899545629E+05, 0.999925558984901872E+05, - 0.100004544910230834E+06, 0.100014789560105870E+06, 0.100022807416958167E+06, 0.100024265952704969E+06, 0.100023783498597622E+06, - 0.100021339437537274E+06, 0.100017269778783608E+06, 0.100011871918673860E+06, 0.100005243624383627E+06, 0.999974886843563872E+05, - 0.999887143337349553E+05, 0.999790290942598513E+05, 0.999685409989449690E+05, 0.999573561671147618E+05, 0.999457665900857537E+05, - 0.999339297350767738E+05, 0.999216537925987359E+05, 0.999089986755408318E+05, 0.998960156700364460E+05, 0.998827458376240684E+05, - 0.998692184851955972E+05, 0.998554496711306274E+05, 0.998414407220986322E+05, 0.998266607131311466E+05, 0.998100194463602238E+05, - 0.997926225952954846E+05, 0.997741943883323111E+05, 0.997546758201429911E+05, 0.997340957313024119E+05, 0.997124527623238246E+05, - 0.996897658681415196E+05, 0.996660748766462057E+05, 0.996414402768971777E+05, 0.996159421531026164E+05, 0.995896781945527619E+05, - 0.995627607309631567E+05, 0.995353127665240754E+05, 0.995074630135256157E+05, 0.994793399566985754E+05, 0.994514054125879338E+05, - 0.994238487412724935E+05, 0.993966902679466439E+05, 0.993700475395201356E+05, 0.993440177799105440E+05, 0.993186743649216805E+05, - 0.992940638036397431E+05, 0.992702032829608506E+05, 0.992470788181921816E+05, 0.992246440384727030E+05, 0.992011645870204229E+05, - 0.991746701100545615E+05, 0.991489545634662645E+05, 0.991241218039765226E+05, 0.991002500071589602E+05, 0.990773923979805404E+05, - 0.990555784783537238E+05, 0.990348157029355934E+05, 0.990159736965085758E+05, 0.989981835313982592E+05, 0.989814199610305950E+05, - 0.989657585620708269E+05, 0.989512713805230014E+05, 0.989380287548638735E+05, 0.989261010103145527E+05, 0.989155600070171640E+05, - 0.989065271083586849E+05, 0.989035472935256403E+05, 0.989017382893972535E+05, 0.989010885106625501E+05, 0.989015950018414442E+05, - 0.989032643180148880E+05, 0.989061129372854630E+05, 0.989101672753579624E+05, 0.989154633681022387E+05, 0.989220462827519368E+05, - 0.989299693127524224E+05, 0.989392930054068274E+05, 0.100824204136130124E+06, 0.100789629875414903E+06, 0.100754101269738283E+06, - 0.100718965766187423E+06, 0.100683784943369043E+06, 0.100647901733698469E+06, 0.100611367338035154E+06, 0.100574242617115160E+06, - 0.100536597536512694E+06, 0.100498510595931759E+06, 0.100460068244709808E+06, 0.100421364285146075E+06, 0.100382499264969942E+06, - 0.100343579859943900E+06, 0.100304718247249199E+06, 0.100266031469940950E+06, 0.100227640792377366E+06, 0.100189671046138596E+06, - 0.100152249965554060E+06, 0.100115507511560325E+06, 0.100079575182221481E+06, 0.100047602801154819E+06, 0.100019322376832803E+06, - 0.999920409995853261E+05, 0.999657674355637573E+05, 0.999405058915761474E+05, 0.999162559646318405E+05, 0.998930126550737332E+05, - 0.998707664374257292E+05, 0.998495033822863334E+05, 0.998292053217475768E+05, 0.998098500498988724E+05, 0.997914115489896358E+05, - 0.997738602307620895E+05, 0.997571631813267886E+05, 0.997412843967411318E+05, 0.997261849951640761E+05, 0.997116241750995250E+05, - 0.996956516613714484E+05, 0.996802443385057850E+05, 0.996654141346137912E+05, 0.996511746410201595E+05, 0.996375414807133056E+05, - 0.996245325880948803E+05, 0.996121683814974822E+05, 0.996004718105865177E+05, 0.995894682617738144E+05, 0.995791853061816655E+05, - 0.995696522765213740E+05, 0.995608996615122596E+05, 0.995529583091799286E+05, 0.995458584335334599E+05, 0.995396284227406868E+05, - 0.995343367855710967E+05, 0.995305561580702051E+05, 0.995281233336275036E+05, 0.995270277929425938E+05, 0.995273063084702299E+05, - 0.995289897428417025E+05, 0.995321019769720151E+05, 0.995366588694784150E+05, 0.995426672761023801E+05, 0.995501241589093697E+05, - 0.995590158153962548E+05, 0.995693172571642208E+05, 0.995809917664462992E+05, 0.995939906564428093E+05, 0.996082532580851985E+05, - 0.996237071514999261E+05, 0.996402686551040679E+05, 0.996578435789826035E+05, 0.996763282420650648E+05, 0.996956299728876329E+05, - 0.997162410862197139E+05, 0.997372387307632453E+05, 0.997586353656998253E+05, 0.997808433601890720E+05, 0.998030187608370179E+05, - 0.998249872889569233E+05, 0.998465794208683947E+05, 0.998676313277232548E+05, 0.998879856224390824E+05, 0.999074918951320724E+05, - 0.999260070231147402E+05, 0.999433952465451439E+05, 0.999595280060564692E+05, 0.999742835440646595E+05, 0.999875462768208236E+05, - 0.999992059495608264E+05, 0.100009156592205647E+06, 0.100016063172606460E+06, 0.100019024917317467E+06, 0.100020084175617667E+06, - 0.100019327613303438E+06, 0.100016848817808917E+06, 0.100012745044390162E+06, 0.100007114161981110E+06, 0.100000051820447916E+06, - 0.999916488518789411E+05, 0.999819889104085451E+05, 0.999711463483044645E+05, 0.999591843210265215E+05, 0.999461531109617499E+05, - 0.999321525809828890E+05, 0.999172469778668019E+05, 0.999013989306642325E+05, 0.998846455567706289E+05, 0.998670119376398798E+05, - 0.998485130268999492E+05, 0.998291555936072982E+05, 0.998089401641651202E+05, 0.997878629283593327E+05, 0.997659175757975609E+05, - 0.997430970289848337E+05, 0.997193950386116485E+05, 0.996948076057053986E+05, 0.996688019987970183E+05, 0.996412728663371527E+05, - 0.996128531282160839E+05, 0.995835822131826571E+05, 0.995535100083936413E+05, 0.995226963046177698E+05, 0.994912096890770918E+05, - 0.994591258685886423E+05, 0.994265254172218556E+05, 0.993934909557864739E+05, 0.993601037847762636E+05, 0.993264400074980804E+05, - 0.992925661955399555E+05, 0.992585346639741329E+05, 0.992243784382298763E+05, 0.991926785386021656E+05, 0.991631423960881948E+05, - 0.991346701590620942E+05, 0.991043957205902552E+05, 0.990738404866020282E+05, 0.990437385072277393E+05, 0.990142493709584378E+05, - 0.989855195191612147E+05, 0.989576810877346288E+05, 0.989308511084253696E+05, 0.989051310684979690E+05, 0.988806068206827622E+05, - 0.988573488291608082E+05, 0.988354127318868268E+05, 0.988148401948802202E+05, 0.987956600302788138E+05, 0.987778895469693816E+05, - 0.987615361004738952E+05, 0.987465988074585912E+05, 0.987330703896907362E+05, 0.987209391124356771E+05, 0.987108234055703360E+05, - 0.987097019913824042E+05, 0.987103429529451387E+05, 0.987122111650228762E+05, 0.987153073516145814E+05, 0.987196321217762743E+05, - 0.987251875827369804E+05, 0.987319785667343094E+05, 0.987400135082831985E+05, 0.987493050090511242E+05, 0.987598701271371101E+05, - 0.987717304264797713E+05, 0.987849118205066625E+05, 0.987994442421061685E+05, 0.100725315299336173E+06, 0.100698574995327697E+06, - 0.100671977068823689E+06, 0.100644595052366465E+06, 0.100616468093977863E+06, 0.100587642901921921E+06, 0.100558173361375360E+06, - 0.100528120104899528E+06, 0.100497550042423565E+06, 0.100466272904751735E+06, 0.100434015096099785E+06, 0.100401562459773442E+06, - 0.100368989820934105E+06, 0.100336376879503077E+06, 0.100303807689072302E+06, 0.100271370122519947E+06, 0.100239155324566673E+06, - 0.100207257151323618E+06, 0.100175771596705425E+06, 0.100144796205413048E+06, 0.100114429472040734E+06, 0.100088940515445298E+06, - 0.100064277849083956E+06, 0.100040376776062651E+06, 0.100017243413296688E+06, 0.999948816446533019E+05, 0.999732929686431889E+05, - 0.999524763863759727E+05, 0.999324283249947912E+05, 0.999131425911760016E+05, 0.998946103486297798E+05, 0.998768201128693472E+05, - 0.998597577558295598E+05, 0.998434065122163738E+05, 0.998277469787591108E+05, 0.998127570968272776E+05, 0.997984121081719059E+05, - 0.997846844728672440E+05, 0.997711641937448148E+05, 0.997562547182444541E+05, 0.997418715469619347E+05, 0.997280378138771339E+05, - 0.997149197421024874E+05, 0.997024870178837737E+05, 0.996907061322415975E+05, 0.996795848806745926E+05, 0.996691347733205621E+05, - 0.996593714260480774E+05, 0.996503148183509184E+05, 0.996419894088608416E+05, 0.996344241017298482E+05, 0.996276520598402276E+05, - 0.996217103637612599E+05, 0.996166395185360743E+05, 0.996124828137155564E+05, 0.996092855454927922E+05, 0.996072490608482622E+05, - 0.996076113749229989E+05, 0.996091697144805221E+05, 0.996119324075692421E+05, 0.996159015340781625E+05, 0.996210724174448842E+05, - 0.996274331797853811E+05, 0.996349643746027868E+05, 0.996436387104583700E+05, 0.996534208777727908E+05, 0.996642674892599607E+05, - 0.996761271423777071E+05, 0.996889406096304010E+05, 0.997026411596077960E+05, 0.997171550083373149E+05, 0.997324018969322351E+05, - 0.997493713951271493E+05, 0.997669298086039198E+05, 0.997847561118552549E+05, 0.998027246306509041E+05, 0.998207116516734968E+05, - 0.998385964503245486E+05, 0.998562622533936083E+05, 0.998740649961419404E+05, 0.998916906165886030E+05, 0.999087089343172702E+05, - 0.999249770553750277E+05, 0.999403560696216737E+05, 0.999547111717594089E+05, 0.999679116588610341E+05, 0.999798308071318752E+05, - 0.999903456338236865E+05, 0.999993365533926699E+05, 0.100004220125714884E+06, 0.100007207317976179E+06, 0.100008572293640507E+06, - 0.100008322094038289E+06, 0.100006474067698131E+06, 0.100003053654514384E+06, 0.999980922203631635E+05, 0.999916249686873634E+05, - 0.999836889524048456E+05, 0.999743212064066029E+05, 0.999635570180646901E+05, 0.999514283507113723E+05, 0.999379624331032392E+05, - 0.999231805265346338E+05, 0.999068710521996836E+05, 0.998889830637409177E+05, 0.998698844492443604E+05, 0.998496268247692351E+05, - 0.998282550606056902E+05, 0.998058081407207792E+05, 0.997823201056188700E+05, 0.997578210428315797E+05, 0.997323380908236431E+05, - 0.997058964236216998E+05, 0.996785201849737350E+05, 0.996502333423933014E+05, 0.996210604331023060E+05, 0.995910271757503942E+05, - 0.995601609239409008E+05, 0.995275572850741737E+05, 0.994942010526460217E+05, 0.994602086162104097E+05, 0.994256424562004540E+05, - 0.993905674250224547E+05, 0.993550495610398939E+05, 0.993191545857771562E+05, 0.992829460972773086E+05, 0.992464834802344849E+05, - 0.992093627746182028E+05, 0.991704192318807618E+05, 0.991313574404489191E+05, 0.990923405318182195E+05, 0.990535358095906413E+05, - 0.990151121756168286E+05, 0.989772373919561505E+05, 0.989400752255912812E+05, 0.989077617710938066E+05, 0.988763612273478793E+05, - 0.988459508623079601E+05, 0.988166439660097676E+05, 0.987885464355162840E+05, 0.987617561295779306E+05, 0.987363624383705755E+05, - 0.987124460655073344E+05, 0.986900790161369223E+05, 0.986693247818405216E+05, 0.986502387102765642E+05, 0.986328685451310157E+05, - 0.986172551199377485E+05, 0.986034331877511868E+05, 0.985914323674813641E+05, 0.985849022212989948E+05, 0.985815381689221977E+05, - 0.985799833097597439E+05, 0.985801745721993211E+05, 0.985820463347552868E+05, 0.985855324877461535E+05, 0.985905682465279388E+05, - 0.985970917144189152E+05, 0.986050451971537113E+05, 0.986143762739106751E+05, 0.986250386326789885E+05, 0.986369926800004905E+05, - 0.986502059369656636E+05, 0.986646532347960892E+05, 0.986803686823803437E+05, 0.986978893846687570E+05, 0.100614832696455240E+06, - 0.100593867821148029E+06, 0.100572316446986515E+06, 0.100550197550235505E+06, 0.100527535703133908E+06, 0.100504360904461792E+06, - 0.100480708372667563E+06, 0.100456618304392017E+06, 0.100432135601374786E+06, 0.100407309568833982E+06, 0.100382193588466369E+06, - 0.100356844769226343E+06, 0.100331323579001226E+06, 0.100305693460217895E+06, 0.100280020432285120E+06, 0.100254372683605921E+06, - 0.100228820155686772E+06, 0.100203434121630358E+06, 0.100178286761032883E+06, 0.100153450733022924E+06, 0.100130475669895299E+06, - 0.100109956889046269E+06, 0.100089889070985242E+06, 0.100070296914338702E+06, 0.100051202164876013E+06, 0.100032623579079911E+06, - 0.100014576934231576E+06, 0.999970750815462088E+05, 0.999801280379814852E+05, 0.999637431114950741E+05, 0.999479250537698827E+05, - 0.999326762337752152E+05, 0.999179968250171223E+05, 0.999038849989644077E+05, 0.998903371169458405E+05, 0.998773479128125327E+05, - 0.998649106588674185E+05, 0.998530173079915839E+05, 0.998416586055586959E+05, 0.998308241656294995E+05, 0.998183931314519723E+05, - 0.998063026544255990E+05, 0.997946768033270637E+05, 0.997835353574148758E+05, 0.997728988116216497E+05, 0.997627886474906263E+05, - 0.997532275467060972E+05, 0.997442395412217011E+05, 0.997358500950898597E+05, 0.997280861143391958E+05, 0.997209758826208854E+05, - 0.997145489218259900E+05, 0.997088357784521941E+05, 0.997038677381365414E+05, 0.996996764724488748E+05, 0.996962936237215035E+05, - 0.996937503353465436E+05, 0.996920767365576030E+05, 0.996913013921977254E+05, 0.996914507293131610E+05, 0.996938892044791864E+05, - 0.996979235599974199E+05, 0.997029058021154924E+05, 0.997088141832942201E+05, 0.997156214047231770E+05, 0.997232945456081070E+05, - 0.997317950535919081E+05, 0.997416867970129533E+05, 0.997530959050235106E+05, 0.997652059203542885E+05, 0.997779192013086576E+05, - 0.997911354948921798E+05, 0.998047524629107502E+05, 0.998186662279794255E+05, 0.998327719289349043E+05, 0.998469642740837880E+05, - 0.998611380798811879E+05, 0.998751887820599950E+05, 0.998890129059611209E+05, 0.999025084828911640E+05, 0.999155753997843713E+05, - 0.999281156702924636E+05, 0.999400336166881025E+05, 0.999512359536410950E+05, 0.999616317670096760E+05, 0.999711323832548660E+05, - 0.999796511279028782E+05, 0.999849269357346784E+05, 0.999879656837563089E+05, 0.999896251175745128E+05, 0.999900253003605030E+05, - 0.999893361854775139E+05, 0.999873542140159407E+05, 0.999840556297011499E+05, 0.999794245840091753E+05, 0.999734518744631496E+05, - 0.999661337157758971E+05, 0.999574705623641785E+05, 0.999474659997932467E+05, 0.999361257217314414E+05, 0.999234566080410732E+05, - 0.999094659187412326E+05, 0.998941606177814683E+05, 0.998764809352623415E+05, 0.998560560817922524E+05, 0.998343967946635821E+05, - 0.998115510889874568E+05, 0.997875653304692096E+05, 0.997624843255732849E+05, 0.997363514996802405E+05, 0.997092091386610118E+05, - 0.996810986700549984E+05, 0.996520609610099054E+05, 0.996221366113048280E+05, 0.995913662211383053E+05, 0.995597906149207993E+05, - 0.995273916799414146E+05, 0.994941482859833632E+05, 0.994601365478679945E+05, 0.994253058448178053E+05, 0.993891469979643734E+05, - 0.993522589965478983E+05, 0.993147135957212886E+05, 0.992765913082987827E+05, 0.992379812368316198E+05, 0.991989807125657680E+05, - 0.991596947441791563E+05, 0.991202352822574612E+05, 0.990807203086648369E+05, 0.990412727632243623E+05, 0.990020193233719183E+05, - 0.989630890556004597E+05, 0.989246119604841224E+05, 0.988867174357804033E+05, 0.988495326844704396E+05, 0.988131810965392942E+05, - 0.987777806347563455E+05, 0.987434422556348145E+05, 0.987102683970903163E+05, 0.986800386904530314E+05, 0.986539370199152036E+05, - 0.986295226205249346E+05, 0.986068636404624995E+05, 0.985860239517589507E+05, 0.985670631337701197E+05, 0.985500365691113984E+05, - 0.985358556718200416E+05, 0.985278808654735767E+05, 0.985216145256253949E+05, 0.985170549437755544E+05, 0.985141907191163773E+05, - 0.985130023621957516E+05, 0.985134638334888878E+05, 0.985155439987927239E+05, 0.985192079865073320E+05, 0.985244184348827694E+05, - 0.985311366201568162E+05, 0.985393234591571963E+05, 0.985489403823850007E+05, 0.985599500758101349E+05, 0.985723170916025701E+05, - 0.985860083297847013E+05, 0.986009933943283249E+05, 0.986172448285415594E+05, 0.986347382357068564E+05, 0.986534522918489238E+05, - 0.100501068864754794E+06, 0.100484535396120875E+06, 0.100467601980879481E+06, 0.100450280398188552E+06, 0.100432586236747622E+06, - 0.100414538813697291E+06, 0.100396161067221547E+06, 0.100377479424244724E+06, 0.100358523644725865E+06, 0.100339326644139262E+06, - 0.100319924295798162E+06, 0.100300355214719486E+06, 0.100280660524754756E+06, 0.100260883610713514E+06, 0.100241069857193317E+06, - 0.100221266375801104E+06, 0.100201521722408346E+06, 0.100181885606032156E+06, 0.100162408590875246E+06, 0.100143141793000657E+06, - 0.100126731204709198E+06, 0.100111095964644017E+06, 0.100095755686584438E+06, 0.100080729264227775E+06, 0.100066034373636823E+06, - 0.100051687390123538E+06, 0.100037703324969872E+06, 0.100024095780550211E+06, 0.100010876922054129E+06, 0.999980574636844394E+05, - 0.999856466669404908E+05, 0.999736523483940109E+05, 0.999620808942374570E+05, 0.999509372788386972E+05, 0.999402250845782837E+05, - 0.999299465203828877E+05, 0.999201024366045604E+05, 0.999106923342315858E+05, 0.999017143668564822E+05, 0.998931653343625367E+05, - 0.998850406679233711E+05, 0.998765024783978733E+05, 0.998667989571770595E+05, 0.998574263414941233E+05, 0.998484104846885893E+05, - 0.998397772139483568E+05, 0.998315523922983994E+05, 0.998237619509676297E+05, 0.998164318901620281E+05, 0.998095882469221542E+05, - 0.998032570294378238E+05, 0.997974641179290484E+05, 0.997922351329589583E+05, 0.997875952728177945E+05, 0.997835691223818721E+05, - 0.997801804366022552E+05, 0.997774519024890033E+05, 0.997754048841174226E+05, 0.997740591557720181E+05, 0.997734326288465818E+05, - 0.997735410785172280E+05, 0.997747073495277582E+05, 0.997769755457649590E+05, 0.997800038461367949E+05, 0.997839110555756342E+05, - 0.997903666077980015E+05, 0.997975557260811329E+05, 0.998054075409305369E+05, 0.998138481350147340E+05, 0.998228007968337915E+05, - 0.998321862933507946E+05, 0.998419231581400672E+05, 0.998519279910743644E+05, 0.998621157651026879E+05, 0.998724001352771593E+05, - 0.998826937448957033E+05, 0.998929085234460072E+05, 0.999029559709882014E+05, 0.999127474237070273E+05, 0.999221942956127314E+05, - 0.999312082917789958E+05, 0.999397015890797338E+05, 0.999475869811254670E+05, 0.999547779849950166E+05, 0.999611889084034483E+05, - 0.999655508333875332E+05, 0.999687521058104176E+05, 0.999708756209590647E+05, 0.999718892905484245E+05, 0.999717672485314106E+05, - 0.999704891389138356E+05, 0.999680393573227484E+05, 0.999644062616458687E+05, 0.999595813666838658E+05, 0.999535585371076886E+05, - 0.999463331921408535E+05, 0.999379015343325445E+05, 0.999282598136142769E+05, 0.999174036365871580E+05, 0.999053273297332198E+05, - 0.998920233640268561E+05, 0.998774818472951010E+05, 0.998616900896773586E+05, 0.998432094200693391E+05, 0.998215258930813725E+05, - 0.997986442532860819E+05, 0.997746159978670912E+05, 0.997494898657428857E+05, 0.997233122677003994E+05, 0.996961277569055965E+05, - 0.996679795269207534E+05, 0.996389099249155406E+05, 0.996089609684258903E+05, 0.995781748547828611E+05, 0.995465944531801651E+05, - 0.995142637702681968E+05, 0.994812283811399975E+05, 0.994475358185973892E+05, 0.994132359146495874E+05, 0.993783810892878100E+05, - 0.993430265826917603E+05, 0.993072306281462952E+05, 0.992699361805924273E+05, 0.992322369590151648E+05, 0.991942880496349680E+05, - 0.991561790488717525E+05, 0.991180035697510175E+05, 0.990798588542613288E+05, 0.990418452912010980E+05, 0.990040658471643255E+05, - 0.989666254199359537E+05, 0.989296301250896213E+05, 0.988931865279689664E+05, 0.988574008344593603E+05, 0.988223780549877847E+05, - 0.987882211569994834E+05, 0.987550302217251592E+05, 0.987229016213559953E+05, 0.986919272327695508E+05, 0.986621937036891904E+05, - 0.986337817866148835E+05, 0.986067657550310105E+05, 0.985855251179539773E+05, 0.985675277620845591E+05, 0.985515831726142933E+05, - 0.985391751050558669E+05, 0.985310659201639937E+05, 0.985245080408891663E+05, 0.985195088048070465E+05, 0.985160685473306512E+05, - 0.985141813574870466E+05, 0.985138358391387155E+05, 0.985150158641151211E+05, 0.985177013051926042E+05, 0.985218687383599317E+05, - 0.985274921053063881E+05, 0.985345433285448526E+05, 0.985429928730166866E+05, 0.985528102493964543E+05, 0.985639644556170097E+05, - 0.985764243543491611E+05, 0.985901589852987236E+05, 0.986051378122090100E+05, 0.986213309053895937E+05, 0.986387090614195185E+05, - 0.986574141307979880E+05 + 0.101300032966540894E+06, 0.101300537463512766E+06, 0.101300575340236785E+06, 0.101300006392703450E+06, 0.101298681683129777E+06, + 0.101296357626198034E+06, 0.101291429037962458E+06, 0.101285211396584113E+06, 0.101277811769244916E+06, 0.101269604202318660E+06, + 0.101261086325391967E+06, 0.101252536774223816E+06, 0.101244258202072262E+06, 0.101236292863086681E+06, 0.101228818038673067E+06, + 0.101222576320632390E+06, 0.101217951101617422E+06, 0.101215281498123208E+06, 0.101214831830208335E+06, 0.101216756641191008E+06, + 0.101220329473252321E+06, 0.101229814720005656E+06, 0.101242852565120862E+06, 0.101257243179816374E+06, 0.101272242223526715E+06, + 0.101287023899284890E+06, 0.101300727324330161E+06, 0.101312508880994021E+06, 0.101321304787958841E+06, 0.101323045492054458E+06, + 0.101323689235454440E+06, 0.101322654817980932E+06, 0.101318546143449697E+06, 0.101311446435368038E+06, 0.101301582670344171E+06, + 0.101289313645048256E+06, 0.101272976739770951E+06, 0.101254670123119533E+06, 0.101236204711241953E+06, 0.101218525147353255E+06, + 0.101203644914472199E+06, 0.101191859002529978E+06, 0.101183427645969176E+06, 0.101178788732659857E+06, 0.101176248776911350E+06, + 0.101174781987763519E+06, 0.101173755414963452E+06, 0.101172549028196707E+06, 0.101170596810517556E+06, 0.101164899003713479E+06, + 0.101158419589045283E+06, 0.101152491572940358E+06, 0.101147843517789603E+06, 0.101145017464391334E+06, 0.101144350744426047E+06, + 0.101145965622140546E+06, 0.101150160852645960E+06, 0.101156489280060341E+06, 0.101164999288937499E+06, 0.101174680757722846E+06, + 0.101184614700939375E+06, 0.101194476866903220E+06, 0.101203847071805940E+06, 0.101212793693367261E+06, 0.101221210811864396E+06, + 0.101228967667653473E+06, 0.101235941297612240E+06, 0.101241825830798407E+06, 0.101246384813952725E+06, 0.101250233289149895E+06, + 0.101253625288606709E+06, 0.101256829767974210E+06, 0.101260135466684485E+06, 0.101263922730170481E+06, 0.101268258457290780E+06, + 0.101273173871677092E+06, 0.101278603318462468E+06, 0.101284438572224244E+06, 0.101291451901038017E+06, 0.101298825789695678E+06, + 0.101305583597361008E+06, 0.101311198590170257E+06, 0.101313106869633571E+06, 0.101311964918650119E+06, 0.101309609217350633E+06, + 0.101306588009722152E+06, 0.101303789827421686E+06, 0.101303204229508177E+06, 0.101302539808644782E+06, 0.101301748136565366E+06, + 0.101300889588588965E+06, 0.101301524026314495E+06, 0.101302253276609670E+06, 0.101302463210049027E+06, 0.101302292202795681E+06, + 0.101298302559037387E+06, 0.101291449427361382E+06, 0.101283550209983820E+06, 0.101275343284659903E+06, 0.101268451030137920E+06, + 0.101263440167506284E+06, 0.101259681043976845E+06, 0.101257275584439689E+06, 0.101255817294926324E+06, 0.101255329151085723E+06, + 0.101256832423130865E+06, 0.101260699063277454E+06, 0.101270225601657599E+06, 0.101287312191364559E+06, 0.101303455630186116E+06, + 0.101316029699689170E+06, 0.101320758891846766E+06, 0.101311100182774215E+06, 0.101294901290088586E+06, 0.101273081896347416E+06, + 0.101246397937256072E+06, 0.101214175532589943E+06, 0.101180475299171711E+06, 0.101147446887522659E+06, 0.101117364487217361E+06, + 0.101093085915674965E+06, 0.101075700452174933E+06, 0.101066299886712630E+06, 0.101066158368806296E+06, 0.101078251612071312E+06, + 0.101107333429588485E+06, 0.101145577197960345E+06, 0.101190184433163799E+06, 0.101238249723994639E+06, 0.101280682092796589E+06, + 0.101316576899162261E+06, 0.101349617253023622E+06, 0.101379226791601075E+06, 0.101404833281466810E+06, 0.101426608723689307E+06, + 0.101443265324151027E+06, 0.101453984963411596E+06, 0.101458728599400347E+06, 0.101457810163301183E+06, 0.101452773264225369E+06, + 0.101443352159658025E+06, 0.101428700824100233E+06, 0.101409534671443689E+06, 0.101387066094169772E+06, 0.101362901532581192E+06, + 0.101342428907368536E+06, 0.101323657976273273E+06, 0.101307125752964450E+06, 0.101293183514770688E+06, 0.101280868902945120E+06, + 0.101268909632403243E+06, 0.101254864133468844E+06, 0.101241751785266810E+06, 0.101229873732095890E+06, 0.101219507414652238E+06, + 0.101210854622372586E+06, 0.101203998200015136E+06, 0.101202118817604176E+06, 0.101204115282818020E+06, 0.101207394659720041E+06, + 0.101211469101194845E+06, 0.101215801913933246E+06, 0.101219837912576768E+06, 0.101222821880958276E+06, 0.101223619521153145E+06, + 0.101223119359168049E+06, 0.101279933976388784E+06, 0.101280230886902951E+06, 0.101280173829517254E+06, 0.101279628905657766E+06, + 0.101278452724477320E+06, 0.101276500130166445E+06, 0.101273279706602567E+06, 0.101267225127293903E+06, 0.101259879400551043E+06, + 0.101251952874409501E+06, 0.101243674039727790E+06, 0.101235303075196876E+06, 0.101227122345847776E+06, 0.101219423613287974E+06, + 0.101212178882549546E+06, 0.101205696806113177E+06, 0.101200710454399567E+06, 0.101197550054666615E+06, 0.101196424920055710E+06, + 0.101196682426928426E+06, 0.101199196544638864E+06, 0.101204111882830854E+06, 0.101214864879095490E+06, 0.101228568680570461E+06, + 0.101243289081509487E+06, 0.101258220436669624E+06, 0.101272521063369320E+06, 0.101285366950491778E+06, 0.101296012419061328E+06, + 0.101305658540617282E+06, 0.101309682063797125E+06, 0.101310624244857565E+06, 0.101308433795484656E+06, 0.101303210985482059E+06, + 0.101295198335334237E+06, 0.101284767756201632E+06, 0.101272403737592205E+06, 0.101256113788140079E+06, 0.101238847669926457E+06, + 0.101222589159180454E+06, 0.101208629956686913E+06, 0.101197517909479167E+06, 0.101189497449897433E+06, 0.101184456694785782E+06, + 0.101181649500138068E+06, 0.101179750491125887E+06, 0.101178046404878522E+06, 0.101175885037415414E+06, 0.101168022154143066E+06, + 0.101159966065713801E+06, 0.101152331174549618E+06, 0.101145627588820978E+06, 0.101140536375719617E+06, 0.101137554875074289E+06, + 0.101136964384819003E+06, 0.101138821605761070E+06, 0.101143054186604160E+06, 0.101151654753774303E+06, 0.101161075130481171E+06, + 0.101170963288776737E+06, 0.101180942106852366E+06, 0.101190660642090996E+06, 0.101199851697929174E+06, 0.101208579711314771E+06, + 0.101216763897321827E+06, 0.101224252677880388E+06, 0.101230718188980885E+06, 0.101236243573164116E+06, 0.101240451206177866E+06, + 0.101243892699987075E+06, 0.101246988344102370E+06, 0.101250044906442185E+06, 0.101253348298035868E+06, 0.101257374370298217E+06, + 0.101262251561231329E+06, 0.101267895803787687E+06, 0.101275473367753089E+06, 0.101283709026768585E+06, 0.101292283625024313E+06, + 0.101300598737905675E+06, 0.101308093199018083E+06, 0.101314220495369867E+06, 0.101317565250665139E+06, 0.101316383038650820E+06, + 0.101313738332474823E+06, 0.101310203262582130E+06, 0.101306334680532935E+06, 0.101304140173899126E+06, 0.101302185066315011E+06, + 0.101301166929963205E+06, 0.101300627409982437E+06, 0.101301442301666364E+06, 0.101302674870566902E+06, 0.101303021785214194E+06, + 0.101301874610097177E+06, 0.101297234163742920E+06, 0.101289212662159043E+06, 0.101280201810217695E+06, 0.101271153345172788E+06, + 0.101264093160240271E+06, 0.101259964551924568E+06, 0.101257527008254954E+06, 0.101256779297676592E+06, 0.101257083402693010E+06, + 0.101258345876766994E+06, 0.101261741195912517E+06, 0.101267637196925745E+06, 0.101280255542587736E+06, 0.101300219472217796E+06, + 0.101318811431023903E+06, 0.101333064281329105E+06, 0.101337822826176372E+06, 0.101329633927901843E+06, 0.101313842956693508E+06, + 0.101291773913463257E+06, 0.101264248822328038E+06, 0.101231681402834831E+06, 0.101198711256044262E+06, 0.101165944729817566E+06, + 0.101135663129340406E+06, 0.101112149821393570E+06, 0.101094336258872077E+06, 0.101083754934829689E+06, 0.101081962838100400E+06, + 0.101094161177945804E+06, 0.101119463798994111E+06, 0.101153379508463855E+06, 0.101193466772876971E+06, 0.101236864297787688E+06, + 0.101271319749684611E+06, 0.101304810719710440E+06, 0.101336529049048593E+06, 0.101365547226062699E+06, 0.101391403447243065E+06, + 0.101414233987549960E+06, 0.101431699751902197E+06, 0.101443249701215464E+06, 0.101448694379159249E+06, 0.101448342945639379E+06, + 0.101444949497289897E+06, 0.101434983683722516E+06, 0.101420339588228075E+06, 0.101400782009497547E+06, 0.101377357223598548E+06, + 0.101353445824612878E+06, 0.101331105881366500E+06, 0.101310391048972291E+06, 0.101292023316921361E+06, 0.101276408630823629E+06, + 0.101263594338449708E+06, 0.101249134886344415E+06, 0.101234892154251414E+06, 0.101221982151018121E+06, 0.101210641209280395E+06, + 0.101201103409364907E+06, 0.101193542381486463E+06, 0.101189530184913005E+06, 0.101188943141927884E+06, 0.101190369535781749E+06, + 0.101194174658495293E+06, 0.101198877046582638E+06, 0.101203781726436631E+06, 0.101208345081553751E+06, 0.101210641923420510E+06, + 0.101211907924376195E+06, 0.101211894158448660E+06, 0.101261542396602526E+06, 0.101261524602459496E+06, 0.101261271962264684E+06, + 0.101260655467705859E+06, 0.101259535677996173E+06, 0.101257770460092695E+06, 0.101254858567248273E+06, 0.101250130827152869E+06, + 0.101243199529206220E+06, 0.101235660710148513E+06, 0.101227727082598372E+06, 0.101219642017676335E+06, 0.101211669747645647E+06, + 0.101204082204654842E+06, 0.101197142166519814E+06, 0.101190828836761386E+06, 0.101185622952613427E+06, 0.101182084994122983E+06, + 0.101179819644487143E+06, 0.101179386785722192E+06, 0.101181037231546885E+06, 0.101184921544816825E+06, 0.101191071708805684E+06, + 0.101202963344456002E+06, 0.101217214661309525E+06, 0.101232127096539611E+06, 0.101246868435665092E+06, 0.101260623299959872E+06, + 0.101275012912500446E+06, 0.101287927630361359E+06, 0.101297156607966986E+06, 0.101300022279744313E+06, 0.101299658882873831E+06, + 0.101296185125092088E+06, 0.101289860769760111E+06, 0.101281072853932870E+06, 0.101270317685887567E+06, 0.101257849866728764E+06, + 0.101241620969336713E+06, 0.101226620289076629E+06, 0.101213719159152053E+06, 0.101203448100139896E+06, 0.101196030165699893E+06, + 0.101191332050565718E+06, 0.101188825460235021E+06, 0.101186627930786824E+06, 0.101183177496864155E+06, 0.101175055095382006E+06, + 0.101166325451567565E+06, 0.101157506572639366E+06, 0.101149141784503256E+06, 0.101141882059824522E+06, 0.101136611424843984E+06, + 0.101133780517071078E+06, 0.101133612778250375E+06, 0.101137015702474586E+06, 0.101144048000326933E+06, 0.101152946100252506E+06, + 0.101162592544671337E+06, 0.101172594122147348E+06, 0.101182525914593833E+06, 0.101192006688188281E+06, 0.101200731545306888E+06, + 0.101208949653701755E+06, 0.101216776035106115E+06, 0.101223643986761963E+06, 0.101229495275078225E+06, 0.101234397106283810E+06, + 0.101238325186287970E+06, 0.101241245958931366E+06, 0.101243986310471693E+06, 0.101246885079730608E+06, 0.101250239965938381E+06, + 0.101254497783043873E+06, 0.101260948534770170E+06, 0.101268693386766550E+06, 0.101277410860750868E+06, 0.101286673004684562E+06, + 0.101296037156777587E+06, 0.101304973100759889E+06, 0.101312836471203336E+06, 0.101319077100166265E+06, 0.101323200714451756E+06, + 0.101322250124293394E+06, 0.101319426400325508E+06, 0.101315327879672026E+06, 0.101311379409400208E+06, 0.101308929715621984E+06, + 0.101307576201749136E+06, 0.101306752066909641E+06, 0.101306276681202202E+06, 0.101306450951061837E+06, 0.101306928825287003E+06, + 0.101306304370611891E+06, 0.101304071949983219E+06, 0.101298726444911401E+06, 0.101289556844688181E+06, 0.101279573549734007E+06, + 0.101269900918276995E+06, 0.101262737639210711E+06, 0.101259533404357528E+06, 0.101258456904325285E+06, 0.101259373853730853E+06, + 0.101261455254273096E+06, 0.101264486663057716E+06, 0.101269671494430630E+06, 0.101277337091813301E+06, 0.101292476984397377E+06, + 0.101314252890570002E+06, 0.101334243526143560E+06, 0.101349257112687643E+06, 0.101353348220742904E+06, 0.101345316081726181E+06, + 0.101329205683580891E+06, 0.101306196398575121E+06, 0.101276157501052992E+06, 0.101241050683782683E+06, 0.101205878990180805E+06, + 0.101173117425566874E+06, 0.101145231775263543E+06, 0.101124829234029152E+06, 0.101110142836540865E+06, 0.101099009983212847E+06, + 0.101095931793603289E+06, 0.101107937055714152E+06, 0.101129557639286853E+06, 0.101159016947845914E+06, 0.101194290171214365E+06, + 0.101229194191076458E+06, 0.101259884907642350E+06, 0.101290909335772027E+06, 0.101321534960278805E+06, 0.101350933609778935E+06, + 0.101378619763291339E+06, 0.101402515553940961E+06, 0.101421126437325220E+06, 0.101433759893184542E+06, 0.101440081432142906E+06, + 0.101442774222367792E+06, 0.101440175371796868E+06, 0.101430382938397539E+06, 0.101414195446914280E+06, 0.101393183882853962E+06, + 0.101368556280786899E+06, 0.101342857987377705E+06, 0.101318002031737051E+06, 0.101294900480304379E+06, 0.101274304523903862E+06, + 0.101256697091383176E+06, 0.101240541623616038E+06, 0.101225909818463362E+06, 0.101213299349493405E+06, 0.101200928172660904E+06, + 0.101190501742025459E+06, 0.101182213405811461E+06, 0.101176901403817319E+06, 0.101175245583661221E+06, 0.101175762446152599E+06, + 0.101178005333581008E+06, 0.101181392651505157E+06, 0.101186087494527630E+06, 0.101191405412103719E+06, 0.101195091837111089E+06, + 0.101197730891759726E+06, 0.101199364382066880E+06, 0.101199730209935369E+06, 0.101245004040932326E+06, 0.101244559135352756E+06, + 0.101244006361693333E+06, 0.101243220164091719E+06, 0.101242063426875131E+06, 0.101239785127296316E+06, 0.101236357261140554E+06, + 0.101232655165141550E+06, 0.101227802625625860E+06, 0.101220780822386791E+06, 0.101213322053334618E+06, 0.101205654745465290E+06, + 0.101198027406206093E+06, 0.101190695138277268E+06, 0.101183902374283105E+06, 0.101177861446733092E+06, 0.101172715839318174E+06, + 0.101168727915036332E+06, 0.101166083677619172E+06, 0.101165120300427254E+06, 0.101166097664782996E+06, 0.101169176642534818E+06, + 0.101174400762938254E+06, 0.101181681695578300E+06, 0.101194628149370954E+06, 0.101209354172510837E+06, 0.101224384543212596E+06, + 0.101241003377192639E+06, 0.101256971279536912E+06, 0.101271325762838256E+06, 0.101283302907598583E+06, 0.101290837888259193E+06, + 0.101292188600320253E+06, 0.101290316399723524E+06, 0.101285500501916889E+06, 0.101278145707370568E+06, 0.101268063741988299E+06, + 0.101255992666718317E+06, 0.101243630289196284E+06, 0.101230020660095543E+06, 0.101218300352418431E+06, 0.101208996070145775E+06, + 0.101202318103285957E+06, 0.101198115125068754E+06, 0.101195865072430563E+06, 0.101192485973754709E+06, 0.101184883550562605E+06, + 0.101176252043943983E+06, 0.101167064140836461E+06, 0.101157837055866650E+06, 0.101149111932572778E+06, 0.101141425669095363E+06, + 0.101136096494374695E+06, 0.101133772515929886E+06, 0.101136278536261714E+06, 0.101141790910123251E+06, 0.101149565058361550E+06, + 0.101159158826086161E+06, 0.101169280924233710E+06, 0.101179364339541717E+06, 0.101189214375348573E+06, 0.101198419330631325E+06, + 0.101206662421100802E+06, 0.101214110977152406E+06, 0.101221277683224456E+06, 0.101227361193735371E+06, 0.101232391962857888E+06, + 0.101236456240121115E+06, 0.101239696448804534E+06, 0.101242131415364871E+06, 0.101244485321801025E+06, 0.101247206329288369E+06, + 0.101250813340918423E+06, 0.101256254483921584E+06, 0.101263638654577793E+06, 0.101272420586206106E+06, 0.101282081390786785E+06, + 0.101292093147014763E+06, 0.101301886889219619E+06, 0.101311011635127215E+06, 0.101318745388787589E+06, 0.101324552511834278E+06, + 0.101327137099599713E+06, 0.101325798652594996E+06, 0.101322370281172494E+06, 0.101318873214067411E+06, 0.101316033453167009E+06, + 0.101314254241750285E+06, 0.101313290040590538E+06, 0.101312777489808956E+06, 0.101312426972162124E+06, 0.101312077043907979E+06, + 0.101311637613854371E+06, 0.101309930679532728E+06, 0.101306604219150962E+06, 0.101300708574919438E+06, 0.101290667766194849E+06, + 0.101280103453056901E+06, 0.101270238174615952E+06, 0.101263265305097812E+06, 0.101261210282368877E+06, 0.101261635280168994E+06, + 0.101264259503469541E+06, 0.101268188459234763E+06, 0.101273120782915241E+06, 0.101280081032422138E+06, 0.101289326234345950E+06, + 0.101306137507821695E+06, 0.101328331726916280E+06, 0.101348454606262691E+06, 0.101363243724620203E+06, 0.101365228148856142E+06, + 0.101355701191101674E+06, 0.101338137535693226E+06, 0.101313442343172661E+06, 0.101279893686959578E+06, 0.101241766771608411E+06, + 0.101204166019317592E+06, 0.101170013105795253E+06, 0.101142432350644231E+06, 0.101122231791865343E+06, 0.101108816561727523E+06, + 0.101102229721379510E+06, 0.101103813368451665E+06, 0.101116580337189007E+06, 0.101134920647456835E+06, 0.101160141230191730E+06, + 0.101190695983823272E+06, 0.101217581338673946E+06, 0.101244990949544663E+06, 0.101273917316553634E+06, 0.101303572896501239E+06, + 0.101333544453130846E+06, 0.101364877370781323E+06, 0.101391063816659895E+06, 0.101411237101045277E+06, 0.101425278782258334E+06, + 0.101433519934200929E+06, 0.101439158935259431E+06, 0.101436999045160905E+06, 0.101426916105024720E+06, 0.101409617969188068E+06, + 0.101386542831537823E+06, 0.101358099179373283E+06, 0.101329104321193983E+06, 0.101301390131810738E+06, 0.101275584184176812E+06, + 0.101252450915750233E+06, 0.101231887457535791E+06, 0.101212090768716560E+06, 0.101196447068532798E+06, 0.101185068443023629E+06, + 0.101177384135667060E+06, 0.101168309967723544E+06, 0.101161992541140848E+06, 0.101159852630578913E+06, 0.101159796489626082E+06, + 0.101161597602608847E+06, 0.101164838510229980E+06, 0.101168957886595192E+06, 0.101173308450019656E+06, 0.101177043737997461E+06, + 0.101180725542300570E+06, 0.101183638211952741E+06, 0.101185541375514644E+06, 0.101186177771331219E+06, 0.101231389269493171E+06, + 0.101229452023944614E+06, 0.101228492450459045E+06, 0.101227437857730562E+06, 0.101225272919369032E+06, 0.101222115782736248E+06, + 0.101218895852368762E+06, 0.101215584732123752E+06, 0.101212116636056322E+06, 0.101207354097621472E+06, 0.101200521838921966E+06, + 0.101193426713001274E+06, 0.101186304142571476E+06, 0.101179395677309934E+06, 0.101172931379861388E+06, 0.101167151828382484E+06, + 0.101162308500518877E+06, 0.101158300144806009E+06, 0.101155408258388663E+06, 0.101154070184498851E+06, 0.101154559752015484E+06, + 0.101157052466433044E+06, 0.101161607131965604E+06, 0.101168151354609319E+06, 0.101176471448160533E+06, 0.101190446255643255E+06, + 0.101207546249739040E+06, 0.101224869025537133E+06, 0.101241629266362957E+06, 0.101257034534386199E+06, 0.101270300423290071E+06, + 0.101280701804350014E+06, 0.101286032850469506E+06, 0.101285592385854572E+06, 0.101282085195034277E+06, 0.101274697798302746E+06, + 0.101264580591891121E+06, 0.101253728075986262E+06, 0.101242929317346643E+06, 0.101232485866013521E+06, 0.101222025672053554E+06, + 0.101213765521939480E+06, 0.101207908438247250E+06, 0.101204284122239580E+06, 0.101199927839590950E+06, 0.101194734819518329E+06, + 0.101188456889903726E+06, 0.101179666542616309E+06, 0.101170394407501270E+06, 0.101161163472120141E+06, 0.101152520749703152E+06, + 0.101145006252468942E+06, 0.101139495861547286E+06, 0.101140801932908304E+06, 0.101144658005535239E+06, 0.101150950782672968E+06, + 0.101159402010231061E+06, 0.101169516352869221E+06, 0.101180618870833394E+06, 0.101190857796199096E+06, 0.101200641550543587E+06, + 0.101209362327359180E+06, 0.101217130139796180E+06, 0.101224049008589936E+06, 0.101230122753387783E+06, 0.101235212462695199E+06, + 0.101239229954162147E+06, 0.101242277095199534E+06, 0.101244507835626879E+06, 0.101246153185945266E+06, 0.101247135672995661E+06, + 0.101249606832741643E+06, 0.101254017340448758E+06, 0.101260512682501125E+06, 0.101268912159280037E+06, 0.101278581961162170E+06, + 0.101288935630890279E+06, 0.101299344634514127E+06, 0.101309165575948311E+06, 0.101317556887074039E+06, 0.101323172703937016E+06, + 0.101326358447397986E+06, 0.101327232302474091E+06, 0.101325894572504010E+06, 0.101322706535794525E+06, 0.101319932108380584E+06, + 0.101318115839731938E+06, 0.101317374329348502E+06, 0.101316802412196412E+06, 0.101316539167573457E+06, 0.101316220872659469E+06, + 0.101315472541661889E+06, 0.101313988991298058E+06, 0.101311143303248988E+06, 0.101306823565026949E+06, 0.101300909517459571E+06, + 0.101291139156745485E+06, 0.101281432901143096E+06, 0.101272931024738762E+06, 0.101267480423988032E+06, 0.101267406598649904E+06, + 0.101269963384954986E+06, 0.101274800002130170E+06, 0.101281233237463195E+06, 0.101288842618392577E+06, 0.101297886975346977E+06, + 0.101308296387334616E+06, 0.101325624485844790E+06, 0.101346166178142783E+06, 0.101363441252856501E+06, 0.101374801583022883E+06, + 0.101371478339382054E+06, 0.101357965915636902E+06, 0.101337616663800756E+06, 0.101310513973449386E+06, 0.101272307541573202E+06, + 0.101230865550039016E+06, 0.101190791911869368E+06, 0.101155350687670492E+06, 0.101129224427448615E+06, 0.101110583343861392E+06, + 0.101099020700267734E+06, 0.101094724119735372E+06, 0.101099023269690821E+06, 0.101111662707600757E+06, 0.101130628382792580E+06, + 0.101154442701152686E+06, 0.101179514522985817E+06, 0.101201379997560478E+06, 0.101226265787734679E+06, 0.101253796882664625E+06, + 0.101283225572595169E+06, 0.101317124967778669E+06, 0.101350989077608407E+06, 0.101379921717535108E+06, 0.101402381642000008E+06, + 0.101417742462739217E+06, 0.101429901727416946E+06, 0.101436203470310473E+06, 0.101434079341425662E+06, 0.101423164600191842E+06, + 0.101404037685293821E+06, 0.101376818918793375E+06, 0.101344589194113520E+06, 0.101311531147971255E+06, 0.101279820675164505E+06, + 0.101251153362574143E+06, 0.101225285333396270E+06, 0.101199764562447148E+06, 0.101178262360150809E+06, 0.101161772194779478E+06, + 0.101150434481179953E+06, 0.101143909494338062E+06, 0.101141390141577620E+06, 0.101140639767941699E+06, 0.101140632648710569E+06, + 0.101142372620975060E+06, 0.101145663398052158E+06, 0.101150107990777600E+06, 0.101155154940690569E+06, 0.101159369531278891E+06, + 0.101162295247948568E+06, 0.101164893804552295E+06, 0.101168002876310085E+06, 0.101170082535517562E+06, 0.101170879828210964E+06, + 0.101219861459639709E+06, 0.101217353733850920E+06, 0.101214813662341927E+06, 0.101212272616671195E+06, 0.101208980334428372E+06, + 0.101205795685889956E+06, 0.101202734659769427E+06, 0.101199769990954403E+06, 0.101196834984741159E+06, 0.101193828164992272E+06, + 0.101189376363543503E+06, 0.101183028116295318E+06, 0.101176590659241221E+06, 0.101170295511546516E+06, 0.101164459781001147E+06, + 0.101159272837843542E+06, 0.101154626508349247E+06, 0.101150830978481536E+06, 0.101147940393322046E+06, 0.101146374185143752E+06, + 0.101146551350105059E+06, 0.101148666345078062E+06, 0.101152796928674230E+06, 0.101158889620899077E+06, 0.101166802022490039E+06, + 0.101178035305259487E+06, 0.101194860122035752E+06, 0.101212325551695918E+06, 0.101229507831180323E+06, 0.101245588075390231E+06, + 0.101259749204794090E+06, 0.101271227064842373E+06, 0.101279354568716226E+06, 0.101282023041620065E+06, 0.101277735417878983E+06, + 0.101270065940430606E+06, 0.101260942221718724E+06, 0.101251183302667749E+06, 0.101241580790420048E+06, 0.101232817663754860E+06, + 0.101224865544509375E+06, 0.101217678236240463E+06, 0.101212672610467605E+06, 0.101207368061914924E+06, 0.101202142949429748E+06, + 0.101197200360827206E+06, 0.101192321056135959E+06, 0.101185312042045203E+06, 0.101176366919002583E+06, 0.101167575306740793E+06, + 0.101159499887747690E+06, 0.101153693581619635E+06, 0.101151632492099627E+06, 0.101152648343697670E+06, 0.101157198969257923E+06, + 0.101164178808173063E+06, 0.101173247856793882E+06, 0.101183857272265639E+06, 0.101195294072408884E+06, 0.101206439742155373E+06, + 0.101215821840872028E+06, 0.101224223508709707E+06, 0.101231582323487324E+06, 0.101237823030360581E+06, 0.101242874318770337E+06, + 0.101246774089702827E+06, 0.101249620201836733E+06, 0.101251514633922707E+06, 0.101250998739460556E+06, 0.101250350564701104E+06, + 0.101251192192736547E+06, 0.101254126969565099E+06, 0.101259362363834385E+06, 0.101266888172729494E+06, 0.101276372037240624E+06, + 0.101286838617996444E+06, 0.101297573246049607E+06, 0.101307533698699568E+06, 0.101315884770704040E+06, 0.101322262940598855E+06, + 0.101325965760392661E+06, 0.101327074410681467E+06, 0.101325913256045969E+06, 0.101323124870245505E+06, 0.101319702236701676E+06, + 0.101317199019545646E+06, 0.101315951598744505E+06, 0.101315806747022463E+06, 0.101315575437492836E+06, 0.101314907982108765E+06, + 0.101313877512845647E+06, 0.101312479697057366E+06, 0.101309803618787570E+06, 0.101306072028328548E+06, 0.101301517809186698E+06, + 0.101296222398532715E+06, 0.101287978736962512E+06, 0.101280134483104775E+06, 0.101273858730883643E+06, 0.101270559684999607E+06, + 0.101272646114663905E+06, 0.101277445816036910E+06, 0.101284587711525965E+06, 0.101293877343276210E+06, 0.101304839668757166E+06, + 0.101316528257227954E+06, 0.101328366576771165E+06, 0.101345969486117698E+06, 0.101364186088572969E+06, 0.101377148495963469E+06, + 0.101382093829553254E+06, 0.101370766337072331E+06, 0.101349741353763951E+06, 0.101321811510905638E+06, 0.101288468123698593E+06, + 0.101244965303345511E+06, 0.101202004776977919E+06, 0.101162860285996649E+06, 0.101126851606302604E+06, 0.101104372225545885E+06, + 0.101088557676466924E+06, 0.101079807482518576E+06, 0.101078498448923550E+06, 0.101085445131155400E+06, 0.101098827324377111E+06, + 0.101117379276230466E+06, 0.101139770652544976E+06, 0.101160113557297649E+06, 0.101180387504904938E+06, 0.101203886596317709E+06, + 0.101230902181368132E+06, 0.101261803558958476E+06, 0.101300608660476937E+06, 0.101337274184836075E+06, 0.101369125977644289E+06, + 0.101394267041929546E+06, 0.101413158265606093E+06, 0.101427330114929093E+06, 0.101432361057773902E+06, 0.101429910859225725E+06, + 0.101417624134461643E+06, 0.101395314188587567E+06, 0.101362172145086661E+06, 0.101325960646168634E+06, 0.101289070977803320E+06, + 0.101253544677021608E+06, 0.101220938962399465E+06, 0.101189935258524172E+06, 0.101161696612905507E+06, 0.101138721820111517E+06, + 0.101121644349305658E+06, 0.101110649141410599E+06, 0.101105415636551304E+06, 0.101106709372907222E+06, 0.101112684473039320E+06, + 0.101118393699309789E+06, 0.101122164751330070E+06, 0.101127188453840165E+06, 0.101133080620089138E+06, 0.101138746974859983E+06, + 0.101142873479913527E+06, 0.101146389620966002E+06, 0.101149025184660437E+06, 0.101150587859464547E+06, 0.101152755345234560E+06, + 0.101153603260132426E+06, 0.101210525717246186E+06, 0.101207548474999538E+06, 0.101202904596832290E+06, 0.101197951386655157E+06, + 0.101194386519771622E+06, 0.101191122015514105E+06, 0.101188175657561296E+06, 0.101185519945178385E+06, 0.101183085746111174E+06, + 0.101180766773284515E+06, 0.101178424993241424E+06, 0.101174517040993989E+06, 0.101168962341147722E+06, 0.101163714253363345E+06, + 0.101158948557658077E+06, 0.101154261182255184E+06, 0.101149950932639709E+06, 0.101146327181315632E+06, 0.101143687040794233E+06, + 0.101142126337276364E+06, 0.101142152044085655E+06, 0.101144083527112423E+06, 0.101148021171421016E+06, 0.101154000779215450E+06, + 0.101162760282120405E+06, 0.101173711396198050E+06, 0.101186611484798021E+06, 0.101203854792520258E+06, 0.101221108630801245E+06, + 0.101237514909808757E+06, 0.101252212005649548E+06, 0.101264385838287199E+06, 0.101273313773670612E+06, 0.101275991122254636E+06, + 0.101272633847169331E+06, 0.101265839223746094E+06, 0.101257619395513131E+06, 0.101248828329997094E+06, 0.101240269262524962E+06, + 0.101232609922544550E+06, 0.101226305719316471E+06, 0.101221001261636731E+06, 0.101215325578545016E+06, 0.101210148330884782E+06, + 0.101205386910296002E+06, 0.101200913609812837E+06, 0.101196557499459639E+06, 0.101192094621711993E+06, 0.101184939627293686E+06, + 0.101177056092112194E+06, 0.101171384998373789E+06, 0.101168077457142164E+06, 0.101167062491365999E+06, 0.101168742847490139E+06, + 0.101173481015017140E+06, 0.101181062252591364E+06, 0.101190688726292763E+06, 0.101201754487460537E+06, 0.101213053590803727E+06, + 0.101224458950927612E+06, 0.101234613260145692E+06, 0.101242743726390036E+06, 0.101249595831817132E+06, 0.101255046289272010E+06, + 0.101258984767052723E+06, 0.101261363785577109E+06, 0.101261779254400128E+06, 0.101259695740838331E+06, 0.101257723355522670E+06, + 0.101256712782620496E+06, 0.101257390131988577E+06, 0.101260812728128207E+06, 0.101266865110914150E+06, 0.101275356425384583E+06, + 0.101285757165198593E+06, 0.101297005109519319E+06, 0.101307222441895385E+06, 0.101316130802742104E+06, 0.101323131432448601E+06, + 0.101327755554835458E+06, 0.101329091060690815E+06, 0.101327426676222676E+06, 0.101323405755774875E+06, 0.101317808009742424E+06, + 0.101312695092861308E+06, 0.101309644418928467E+06, 0.101307843097245379E+06, 0.101307258014776118E+06, 0.101306396062738830E+06, + 0.101304392989299769E+06, 0.101302318926388383E+06, 0.101300146974100906E+06, 0.101296693003163877E+06, 0.101292171838443071E+06, + 0.101287472873098537E+06, 0.101282787197424317E+06, 0.101276691890622955E+06, 0.101271343380570586E+06, 0.101267971439309680E+06, + 0.101267491024100920E+06, 0.101272069334797809E+06, 0.101279335267968272E+06, 0.101288917788163279E+06, 0.101301241225878053E+06, + 0.101315819189724789E+06, 0.101330320177330534E+06, 0.101343606724499783E+06, 0.101360277666390102E+06, 0.101374651937569957E+06, + 0.101381948044541350E+06, 0.101379139254734604E+06, 0.101357829215456179E+06, 0.101327280040149271E+06, 0.101289941888269532E+06, + 0.101246108522415467E+06, 0.101194796632095546E+06, 0.101146024288208340E+06, 0.101103656741928615E+06, 0.101073141515266252E+06, + 0.101057806173447316E+06, 0.101051682514418280E+06, 0.101049406076037965E+06, 0.101052339673225651E+06, 0.101063115066462298E+06, + 0.101078506068417060E+06, 0.101097590566484258E+06, 0.101118771179471136E+06, 0.101135489318013730E+06, 0.101154758424584812E+06, + 0.101177654242688412E+06, 0.101205061131610448E+06, 0.101242230976538951E+06, 0.101283647903067162E+06, 0.101323242160821901E+06, + 0.101358087742294330E+06, 0.101385937955843910E+06, 0.101409794381458749E+06, 0.101425117131910592E+06, 0.101429997042675925E+06, + 0.101424225668113679E+06, 0.101409012607044147E+06, 0.101378645916584719E+06, 0.101341017521829854E+06, 0.101300635121866770E+06, + 0.101259780015675904E+06, 0.101220490612824302E+06, 0.101183385014229250E+06, 0.101147969487759023E+06, 0.101117685992608021E+06, + 0.101093539937281050E+06, 0.101076195561657238E+06, 0.101065910310074483E+06, 0.101063435753359998E+06, 0.101067804628520898E+06, + 0.101076221687106154E+06, 0.101087269872699864E+06, 0.101098388777976448E+06, 0.101105436139853176E+06, 0.101112874451142532E+06, + 0.101118849015061031E+06, 0.101124113984576659E+06, 0.101128454272832299E+06, 0.101131632912711430E+06, 0.101133440671438293E+06, + 0.101133742258942963E+06, 0.101133420481460824E+06, 0.101203377126110252E+06, 0.101198268613597073E+06, 0.101192518049139719E+06, + 0.101186803252296639E+06, 0.101181813758537333E+06, 0.101178421999043727E+06, 0.101175553435103371E+06, 0.101173179030172672E+06, + 0.101171225754259809E+06, 0.101169580857152410E+06, 0.101168097072006873E+06, 0.101166598871645896E+06, 0.101163936200708034E+06, + 0.101160319529115644E+06, 0.101156350070871646E+06, 0.101152298957045554E+06, 0.101148469397518347E+06, 0.101145174878879858E+06, + 0.101142716121090431E+06, 0.101141356671128422E+06, 0.101141393983984628E+06, 0.101143318014807519E+06, 0.101147349641468565E+06, + 0.101153926105170540E+06, 0.101162646354183598E+06, 0.101173404206242340E+06, 0.101185918183552916E+06, 0.101199863730921250E+06, + 0.101216872253279580E+06, 0.101233295276471807E+06, 0.101248215030952546E+06, 0.101260757021715341E+06, 0.101267495548934719E+06, + 0.101269706371902867E+06, 0.101268204478453976E+06, 0.101262805085999877E+06, 0.101255380826612120E+06, 0.101247430865831397E+06, + 0.101239780825202557E+06, 0.101233090454269026E+06, 0.101227802760140185E+06, 0.101223571816330572E+06, 0.101219066722623626E+06, + 0.101214540599785731E+06, 0.101210406057645538E+06, 0.101206592274863258E+06, 0.101202981532469319E+06, 0.101199400726594919E+06, + 0.101195627874287937E+06, 0.101191227720762778E+06, 0.101187565739316706E+06, 0.101185464827996155E+06, 0.101185511851585936E+06, + 0.101188073018881041E+06, 0.101193228150490002E+06, 0.101201132185450770E+06, 0.101211253103469411E+06, 0.101221691007216708E+06, + 0.101232930515629778E+06, 0.101244622455395234E+06, 0.101256099137093290E+06, 0.101264336488988658E+06, 0.101270613718010951E+06, + 0.101275186944850837E+06, 0.101277911712320536E+06, 0.101275720871891084E+06, 0.101272701050287156E+06, 0.101269530015498065E+06, + 0.101266916775846155E+06, 0.101265667085305176E+06, 0.101266412423480491E+06, 0.101269963618393420E+06, 0.101276824074798991E+06, + 0.101286538984123661E+06, 0.101297754584716895E+06, 0.101309268788473608E+06, 0.101319049570761636E+06, 0.101326688370924327E+06, + 0.101331858743319128E+06, 0.101334118663267698E+06, 0.101332850026087355E+06, 0.101327763563889297E+06, 0.101320054486635490E+06, + 0.101310581963123463E+06, 0.101301464042469088E+06, 0.101296071475081029E+06, 0.101292351628835357E+06, 0.101290169534329834E+06, + 0.101288302766939916E+06, 0.101284014152439850E+06, 0.101279941996829206E+06, 0.101276061598442378E+06, 0.101271538120976256E+06, + 0.101266097326113042E+06, 0.101261239127189925E+06, 0.101257245251898741E+06, 0.101253483641709958E+06, 0.101251125639619684E+06, + 0.101251189762292764E+06, 0.101253695416316186E+06, 0.101260342754598576E+06, 0.101269818597965233E+06, 0.101281786685942599E+06, + 0.101297267888598697E+06, 0.101315752383087500E+06, 0.101333588295053938E+06, 0.101349152940472399E+06, 0.101363783604825469E+06, + 0.101372978867465237E+06, 0.101373889912201208E+06, 0.101361962340075130E+06, 0.101329656482126462E+06, 0.101288577681367635E+06, + 0.101241353955692000E+06, 0.101187015186283301E+06, 0.101128342669573714E+06, 0.101074249019373397E+06, 0.101029162958810339E+06, + 0.101000523612843142E+06, 0.100987089359594960E+06, 0.100984958621042068E+06, 0.100992130612266148E+06, 0.101008448898443559E+06, + 0.101030521667859153E+06, 0.101051007866767963E+06, 0.101071664234935859E+06, 0.101090175915114785E+06, 0.101106549855269026E+06, + 0.101125443846952985E+06, 0.101148128478478480E+06, 0.101176649869573142E+06, 0.101219367480301720E+06, 0.101264169410245595E+06, + 0.101307902998138612E+06, 0.101345704641115881E+06, 0.101377820901637606E+06, 0.101403851472658702E+06, 0.101419708524997433E+06, + 0.101423957150136412E+06, 0.101416125366734399E+06, 0.101392821386149662E+06, 0.101354118286926780E+06, 0.101311952791900418E+06, + 0.101267586958551430E+06, 0.101222923148393995E+06, 0.101179984606825063E+06, 0.101137775123404324E+06, 0.101100052058991307E+06, + 0.101068211877007227E+06, 0.101043182495123227E+06, 0.101025887119877370E+06, 0.101017441028948917E+06, 0.101018646999727091E+06, + 0.101025249625575729E+06, 0.101036067916060245E+06, 0.101049702828005305E+06, 0.101064676552964025E+06, 0.101079565938465035E+06, + 0.101088532594576784E+06, 0.101096312478571519E+06, 0.101102983223382442E+06, 0.101108374984337381E+06, 0.101112280329396730E+06, + 0.101114507038743657E+06, 0.101114428830065517E+06, 0.101111055246130432E+06, 0.101196406538596522E+06, 0.101190461736979341E+06, + 0.101184419171533169E+06, 0.101178438759959274E+06, 0.101172694307587532E+06, 0.101168042459568693E+06, 0.101165224780188713E+06, + 0.101163116738625147E+06, 0.101161640044718297E+06, 0.101160673934197897E+06, 0.101160060130737882E+06, 0.101160308872814785E+06, + 0.101161160328086728E+06, 0.101159852318196237E+06, 0.101156811572228151E+06, 0.101153532829243355E+06, 0.101150328623015521E+06, + 0.101147521674777250E+06, 0.101145421670737880E+06, 0.101144300600728122E+06, 0.101144366524547018E+06, 0.101146453358106490E+06, + 0.101151154760197140E+06, 0.101157852536650826E+06, 0.101166593375939396E+06, 0.101177254193880435E+06, 0.101189538295227583E+06, + 0.101202976381101937E+06, 0.101217143841964367E+06, 0.101233326011591271E+06, 0.101248211830283530E+06, 0.101258376645531374E+06, + 0.101264582921753405E+06, 0.101267070734474910E+06, 0.101266001194085227E+06, 0.101261820132445268E+06, 0.101255225790946322E+06, + 0.101247986960119670E+06, 0.101241132826118715E+06, 0.101235589817356347E+06, 0.101231742691396459E+06, 0.101228190519347510E+06, + 0.101224868811623688E+06, 0.101221346956982394E+06, 0.101217966212733285E+06, 0.101214970532675288E+06, 0.101212299627427041E+06, + 0.101209926653408853E+06, 0.101209182347595939E+06, 0.101208894928154026E+06, 0.101206557077161851E+06, 0.101205653829090777E+06, + 0.101206766501731909E+06, 0.101210234953384323E+06, 0.101216093544594405E+06, 0.101223864474518923E+06, 0.101233270650245788E+06, + 0.101243919236364745E+06, 0.101255411905531102E+06, 0.101267215651558581E+06, 0.101278589053053409E+06, 0.101288326667672663E+06, + 0.101293977254483369E+06, 0.101295988963460462E+06, 0.101293942850610052E+06, 0.101290379977981182E+06, 0.101286211796570817E+06, + 0.101282157951643720E+06, 0.101279101833166642E+06, 0.101277814046354848E+06, 0.101278807487432292E+06, 0.101282938226413549E+06, + 0.101291273361035273E+06, 0.101301583582921769E+06, 0.101312849202165788E+06, 0.101324002651453309E+06, 0.101333489244781522E+06, + 0.101339488921891199E+06, 0.101342369325021820E+06, 0.101341720289730991E+06, 0.101337127319298394E+06, 0.101327791615567519E+06, + 0.101315437423608601E+06, 0.101301282640627105E+06, 0.101286811802460725E+06, 0.101276747879297676E+06, 0.101269331760055575E+06, + 0.101263643990522745E+06, 0.101258989523824217E+06, 0.101251456119543334E+06, 0.101244182196566340E+06, 0.101237348106484831E+06, + 0.101228692607444944E+06, 0.101218585751885927E+06, 0.101210928314959441E+06, 0.101206232353375613E+06, 0.101203871455940549E+06, + 0.101203999533384937E+06, 0.101207475042430247E+06, 0.101214320092416674E+06, 0.101224147807091678E+06, 0.101236699974733609E+06, + 0.101251676274940794E+06, 0.101270825632959895E+06, 0.101293545270099348E+06, 0.101314419599624249E+06, 0.101330994497954525E+06, + 0.101343242305169362E+06, 0.101347429834497641E+06, 0.101341255518135789E+06, 0.101319524205864262E+06, 0.101278200143226626E+06, + 0.101228562906559484E+06, 0.101174212317573372E+06, 0.101112623030610339E+06, 0.101048222350508891E+06, 0.100990099190183420E+06, + 0.100943211786408705E+06, 0.100918044317067266E+06, 0.100907611661432689E+06, 0.100910107183064712E+06, 0.100923917070401818E+06, + 0.100948850301936414E+06, 0.100978281786140433E+06, 0.101008728042257979E+06, 0.101037658211344344E+06, 0.101057364399701371E+06, + 0.101074391235513976E+06, 0.101093594285308805E+06, 0.101116488413099345E+06, 0.101150558690399863E+06, 0.101193914933389984E+06, + 0.101239758121016799E+06, 0.101285323747319708E+06, 0.101327925492475028E+06, 0.101365565138565944E+06, 0.101392573640838629E+06, + 0.101408539383438299E+06, 0.101411604282492801E+06, 0.101400582930128410E+06, 0.101366946069406418E+06, 0.101324287192622069E+06, + 0.101276101666633986E+06, 0.101226619258282910E+06, 0.101178585432356136E+06, 0.101130984262627506E+06, 0.101086307783769356E+06, + 0.101046851053375387E+06, 0.101014063196888950E+06, 0.100988908271188513E+06, 0.100971785835137707E+06, 0.100968245753203373E+06, + 0.100971380696101813E+06, 0.100980060807918417E+06, 0.100993169646215858E+06, 0.101009312468744305E+06, 0.101026966655764860E+06, + 0.101044366184895640E+06, 0.101060339563627815E+06, 0.101071158866529076E+06, 0.101079488812984200E+06, 0.101086153913575283E+06, + 0.101090971172654899E+06, 0.101093525999388585E+06, 0.101092846852564820E+06, 0.101089780957355411E+06, 0.101191123249149765E+06, + 0.101184975896710632E+06, 0.101178781171733193E+06, 0.101172687284701038E+06, 0.101166856628363908E+06, 0.101161463025241668E+06, + 0.101157556719236236E+06, 0.101155715658911155E+06, 0.101154729896713383E+06, 0.101154469238441612E+06, 0.101155775624535832E+06, + 0.101158121462038107E+06, 0.101160042093184384E+06, 0.101161344855236384E+06, 0.101160448275110015E+06, 0.101158071590188309E+06, + 0.101155631532086059E+06, 0.101153465356088433E+06, 0.101151897289994900E+06, 0.101151213659422618E+06, 0.101151737576582789E+06, + 0.101154199170773107E+06, 0.101158985005759008E+06, 0.101165841396522868E+06, 0.101174673234837159E+06, 0.101185340894024586E+06, + 0.101197532040988634E+06, 0.101210762902995120E+06, 0.101224385238204501E+06, 0.101237894404589199E+06, 0.101250772227856185E+06, + 0.101260411029266310E+06, 0.101266591706174368E+06, 0.101269204187456722E+06, 0.101268397182717250E+06, 0.101264588122030676E+06, + 0.101258438511883942E+06, 0.101251623403392019E+06, 0.101246063118456994E+06, 0.101242417800723517E+06, 0.101239166549985050E+06, + 0.101236254306650939E+06, 0.101233631773944420E+06, 0.101231248894982156E+06, 0.101228825720597553E+06, 0.101226772928204024E+06, + 0.101225473798737570E+06, 0.101225516278296083E+06, 0.101226043519455008E+06, 0.101227093486833808E+06, 0.101228289760449348E+06, + 0.101228546951147655E+06, 0.101230707510254171E+06, 0.101235093253586310E+06, 0.101241126677553519E+06, 0.101248645598633651E+06, + 0.101258142018320970E+06, 0.101268933306888299E+06, 0.101280513500391826E+06, 0.101292262732881034E+06, 0.101303355465601169E+06, + 0.101312817264586003E+06, 0.101316400177874268E+06, 0.101315483458758521E+06, 0.101312277984593762E+06, 0.101307698621808959E+06, + 0.101302673951913355E+06, 0.101298053010945936E+06, 0.101294840530663249E+06, 0.101294065839099727E+06, 0.101296783533959431E+06, + 0.101302065639223511E+06, 0.101310033568624291E+06, 0.101320378178744606E+06, 0.101331366932783130E+06, 0.101341800425977897E+06, + 0.101350415611308272E+06, 0.101354800042096002E+06, 0.101354718500839095E+06, 0.101350294315183972E+06, 0.101341487001001398E+06, + 0.101327926160731338E+06, 0.101310260858651716E+06, 0.101290273767883307E+06, 0.101269495556410489E+06, 0.101251846238950835E+06, + 0.101238682635122401E+06, 0.101227174341821534E+06, 0.101213482647208613E+06, 0.101195603009729079E+06, 0.101177872156641286E+06, + 0.101162325618075352E+06, 0.101149982165601716E+06, 0.101139852149278217E+06, 0.101134024565056650E+06, 0.101132753824598782E+06, + 0.101135032680571021E+06, 0.101140084766430024E+06, 0.101148877574289698E+06, 0.101161005262514984E+06, 0.101174747769146576E+06, + 0.101190713232751208E+06, 0.101208811802622309E+06, 0.101231640660711972E+06, 0.101258571723189729E+06, 0.101282336017681446E+06, + 0.101299629439163051E+06, 0.101308040998087759E+06, 0.101305555171365690E+06, 0.101290435343250807E+06, 0.101256519799893256E+06, + 0.101204322883293091E+06, 0.101144321216045384E+06, 0.101080811870748948E+06, 0.101014238668434729E+06, 0.100950513534181708E+06, + 0.100894391363170798E+06, 0.100851829575523923E+06, 0.100832142921501421E+06, 0.100825615789308096E+06, 0.100832955840479583E+06, + 0.100854821405899405E+06, 0.100888239967709887E+06, 0.100925422763286362E+06, 0.100962602314510819E+06, 0.100994687767612981E+06, + 0.101018445383155631E+06, 0.101039638130810010E+06, 0.101060824122542370E+06, 0.101084945514884181E+06, 0.101122354145820311E+06, + 0.101165147778325379E+06, 0.101210847657910417E+06, 0.101256682236652778E+06, 0.101301382158490291E+06, 0.101341411155713809E+06, + 0.101372219111328362E+06, 0.101389231784620119E+06, 0.101390880863434664E+06, 0.101369226261351185E+06, 0.101331834231281726E+06, + 0.101285779545129859E+06, 0.101234345503529141E+06, 0.101180743690781746E+06, 0.101127223607977256E+06, 0.101076620915575957E+06, + 0.101030138146362922E+06, 0.100989582250385356E+06, 0.100956503181212684E+06, 0.100931937764084651E+06, 0.100920299784557195E+06, + 0.100918057371207338E+06, 0.100922770743209869E+06, 0.100933261994784887E+06, 0.100948483778151451E+06, 0.100967026543898348E+06, + 0.100987282070977919E+06, 0.101007276882737569E+06, 0.101025807002176851E+06, 0.101042092544874176E+06, 0.101053732614110791E+06, + 0.101061889868345606E+06, 0.101067702910314212E+06, 0.101070224192290465E+06, 0.101070263142884942E+06, 0.101067836061994312E+06, + 0.101188101877120876E+06, 0.101181904204517952E+06, 0.101175721080675750E+06, 0.101169689701016847E+06, 0.101163962332899173E+06, + 0.101158703372389791E+06, 0.101154083105507743E+06, 0.101151357736191479E+06, 0.101150899044327409E+06, 0.101152824487497259E+06, + 0.101156224838871945E+06, 0.101159507416219887E+06, 0.101162417168140935E+06, 0.101164756494849746E+06, 0.101166400553546104E+06, + 0.101165982684454619E+06, 0.101164433293333408E+06, 0.101163049411835455E+06, 0.101162175585306977E+06, 0.101162128095756125E+06, + 0.101163361425100273E+06, 0.101166227742201969E+06, 0.101170937924715152E+06, 0.101177913034471421E+06, 0.101186917319165936E+06, + 0.101197704545258457E+06, 0.101209946031686050E+06, 0.101223141837685776E+06, 0.101236628019135329E+06, 0.101248564959035430E+06, + 0.101259061289307880E+06, 0.101268404236147617E+06, 0.101274449875235630E+06, 0.101277082514349167E+06, 0.101276437786749404E+06, + 0.101272910152209646E+06, 0.101267124457491314E+06, 0.101260716984134080E+06, 0.101256743164844607E+06, 0.101253604663335806E+06, + 0.101250897345323741E+06, 0.101248591593381454E+06, 0.101246654559015689E+06, 0.101245041613427515E+06, 0.101243680788220503E+06, + 0.101243097273199470E+06, 0.101243781512439353E+06, 0.101244948599458978E+06, 0.101246597302939059E+06, 0.101248747416430124E+06, + 0.101251423906546814E+06, 0.101254153427662954E+06, 0.101257318705204321E+06, 0.101261887373189515E+06, 0.101267979989058746E+06, + 0.101275948774720324E+06, 0.101285713213097159E+06, 0.101296774828760288E+06, 0.101308302668075557E+06, 0.101319850467473152E+06, + 0.101329837083710619E+06, 0.101335921303205963E+06, 0.101339123113933456E+06, 0.101337898637374194E+06, 0.101333773323031986E+06, + 0.101328456667992868E+06, 0.101322897112772887E+06, 0.101317900606162963E+06, 0.101315889108461066E+06, 0.101316599306327043E+06, + 0.101319758730558635E+06, 0.101325424301052059E+06, 0.101333284991047447E+06, 0.101343211873693581E+06, 0.101353644944564134E+06, + 0.101363021317380320E+06, 0.101370049287251401E+06, 0.101372596455484265E+06, 0.101369268865042672E+06, 0.101360883616870342E+06, + 0.101347449435595729E+06, 0.101329133164082014E+06, 0.101305327141900649E+06, 0.101278380398203022E+06, 0.101249743471045615E+06, + 0.101219239546209603E+06, 0.101192352888002861E+06, 0.101165652475197479E+06, 0.101139697586887822E+06, 0.101114494511137265E+06, + 0.101090858686180072E+06, 0.101071576294283674E+06, 0.101057575297732197E+06, 0.101048074783742806E+06, 0.101044336258060692E+06, + 0.101046551193469917E+06, 0.101053556962642004E+06, 0.101063713831673056E+06, 0.101077829626709223E+06, 0.101095071852015652E+06, + 0.101113125151151267E+06, 0.101132720710483336E+06, 0.101154045391176667E+06, 0.101180390285880436E+06, 0.101211142948122884E+06, + 0.101237614514436951E+06, 0.101255726302408526E+06, 0.101259492448119025E+06, 0.101250509056824711E+06, 0.101227395084634161E+06, + 0.101182035261948520E+06, 0.101119630114631931E+06, 0.101050635848782738E+06, 0.100979922793482459E+06, 0.100910697623495973E+06, + 0.100847357213499476E+06, 0.100794166368117731E+06, 0.100758894445481623E+06, 0.100744322296544080E+06, 0.100745120848886974E+06, + 0.100759352059448109E+06, 0.100791294801023934E+06, 0.100833112039419531E+06, 0.100877562571698305E+06, 0.100920779246866339E+06, + 0.100955025798225848E+06, 0.100982525754081420E+06, 0.101006044587505748E+06, 0.101028143007870822E+06, 0.101055611280174300E+06, + 0.101091320427340703E+06, 0.101132355621430252E+06, 0.101176767088174020E+06, 0.101222102616479577E+06, 0.101267504098879013E+06, + 0.101307233300950669E+06, 0.101337730007502250E+06, 0.101356132691262712E+06, 0.101355517504656993E+06, 0.101326703347885734E+06, + 0.101286746249401243E+06, 0.101238373176205030E+06, 0.101184685036191077E+06, 0.101128907484998796E+06, 0.101073391747240559E+06, + 0.101019454525129811E+06, 0.100970871910515343E+06, 0.100929826661987419E+06, 0.100897105571455861E+06, 0.100876831879007659E+06, + 0.100867962906273533E+06, 0.100867330421829305E+06, 0.100873728684090966E+06, 0.100885749735442761E+06, 0.100902849954122852E+06, + 0.100924138951177738E+06, 0.100946961851234868E+06, 0.100969279025770302E+06, 0.100990033557581031E+06, 0.101008477654044342E+06, + 0.101024214908302165E+06, 0.101035732998499894E+06, 0.101041912961714450E+06, 0.101045642366251923E+06, 0.101046792406885972E+06, + 0.101045365333532347E+06, 0.101187355100872199E+06, 0.101181283838042174E+06, 0.101175299671037268E+06, 0.101169529662610788E+06, + 0.101164117431673949E+06, 0.101159220075809775E+06, 0.101155001817589582E+06, 0.101151624022777440E+06, 0.101152497595067340E+06, + 0.101156451659840226E+06, 0.101160648061411019E+06, 0.101164790528929152E+06, 0.101168618147906396E+06, 0.101171926049179310E+06, + 0.101174580360364256E+06, 0.101176526712674633E+06, 0.101176736224529814E+06, 0.101176257363116325E+06, 0.101176166983752380E+06, + 0.101176807287626842E+06, 0.101178681128324213E+06, 0.101182078251181316E+06, 0.101187204570596310E+06, 0.101194163269585537E+06, + 0.101203334524264646E+06, 0.101214364937736551E+06, 0.101226809413448165E+06, 0.101240149829298927E+06, 0.101253261358725853E+06, + 0.101265100089497806E+06, 0.101275120974395875E+06, 0.101282996940042518E+06, 0.101288828111014154E+06, 0.101291420149586207E+06, + 0.101290897222999163E+06, 0.101287639377078289E+06, 0.101283002528089506E+06, 0.101278193857728707E+06, 0.101273020512430914E+06, + 0.101269901051284018E+06, 0.101267678623295869E+06, 0.101265950449211479E+06, 0.101264703039611326E+06, 0.101263900879826906E+06, + 0.101263923607509249E+06, 0.101265004562038375E+06, 0.101266684912193334E+06, 0.101268855296950496E+06, 0.101271506964180182E+06, + 0.101274640173084292E+06, 0.101278241537383161E+06, 0.101282245825992912E+06, 0.101286353240369135E+06, 0.101291355828485597E+06, + 0.101297931619035255E+06, 0.101306253371424813E+06, 0.101316214078965480E+06, 0.101327380285913983E+06, 0.101338920669929619E+06, + 0.101349293450103680E+06, 0.101357122930671496E+06, 0.101362252520088790E+06, 0.101364464771970830E+06, 0.101363785192026829E+06, + 0.101359089181177871E+06, 0.101353368594169064E+06, 0.101348059285105599E+06, 0.101344504609358351E+06, 0.101342802273270747E+06, + 0.101343694674300015E+06, 0.101347186594235303E+06, 0.101353156284255645E+06, 0.101361135003142495E+06, 0.101370388484892959E+06, + 0.101380640458787442E+06, 0.101388946718752617E+06, 0.101393651801589484E+06, 0.101393499019751704E+06, 0.101386884558896083E+06, + 0.101374143979384535E+06, 0.101355609362859250E+06, 0.101331626780358332E+06, 0.101301083582183201E+06, 0.101263353354839783E+06, + 0.101221306897352624E+06, 0.101176993466944725E+06, 0.101136539903244993E+06, 0.101098204242251013E+06, 0.101061761330862719E+06, + 0.101028266665796909E+06, 0.100998589290583972E+06, 0.100975333400938267E+06, 0.100959068131358043E+06, 0.100949766177223195E+06, + 0.100947806353674678E+06, 0.100952626346498961E+06, 0.100962758032929953E+06, 0.100976213788639361E+06, 0.100993663080123253E+06, + 0.101014486892675981E+06, 0.101035822837299012E+06, 0.101058579399157214E+06, 0.101083303211150094E+06, 0.101113186489526008E+06, + 0.101147351565124962E+06, 0.101176652682216401E+06, 0.101196193972918787E+06, 0.101198569776344622E+06, 0.101186160134931008E+06, + 0.101157868126258880E+06, 0.101103141394806822E+06, 0.101031831614193070E+06, 0.100956733996206865E+06, 0.100882403087983286E+06, + 0.100813473138545116E+06, 0.100752516407046714E+06, 0.100703757785565627E+06, 0.100676218536944187E+06, 0.100667431274046598E+06, + 0.100674873519601999E+06, 0.100697658618489222E+06, 0.100739841159568794E+06, 0.100789068474863947E+06, 0.100839720710070338E+06, + 0.100886379550526690E+06, 0.100923029883014446E+06, 0.100953143284320337E+06, 0.100977639241319004E+06, 0.100999128395021136E+06, + 0.101024581691416737E+06, 0.101055845921262473E+06, 0.101093715024692676E+06, 0.101137145750038864E+06, 0.101181709309337297E+06, + 0.101225325474523444E+06, 0.101263559713032722E+06, 0.101292474677031365E+06, 0.101308682549641118E+06, 0.101297475120822361E+06, + 0.101271409211849808E+06, 0.101232040601299872E+06, 0.101182869285470704E+06, 0.101128290980360704E+06, 0.101072929755581790E+06, + 0.101016889073163620E+06, 0.100962491541966170E+06, 0.100912327910715336E+06, 0.100869361400221751E+06, 0.100839775977090918E+06, + 0.100823441492130820E+06, 0.100816113342184137E+06, 0.100817094874734074E+06, 0.100825233759279654E+06, 0.100839074432490510E+06, + 0.100858082771811969E+06, 0.100882174552001874E+06, 0.100906977487573211E+06, 0.100931151837540980E+06, 0.100953671595204651E+06, + 0.100973813441941427E+06, 0.100991208365737388E+06, 0.101004593996319396E+06, 0.101014464426847393E+06, 0.101019840305871679E+06, + 0.101022516216040211E+06, 0.101022479820383916E+06, 0.101189306237606637E+06, 0.101183099563423224E+06, 0.101177524645541649E+06, + 0.101172236435105573E+06, 0.101167371532973528E+06, 0.101163082020276575E+06, 0.101159529060147339E+06, 0.101159316447558173E+06, + 0.101160894564677219E+06, 0.101164348300187223E+06, 0.101169261422140553E+06, 0.101174195290734366E+06, 0.101178879818970003E+06, + 0.101183100812083387E+06, 0.101186714675334646E+06, 0.101189656703835382E+06, 0.101191942124414170E+06, 0.101192917377320977E+06, + 0.101193593575982464E+06, 0.101195069630171711E+06, 0.101197693383898673E+06, 0.101201751769885639E+06, 0.101207449602623747E+06, + 0.101214890679059696E+06, 0.101224061589853489E+06, 0.101235336912347877E+06, 0.101248190104239126E+06, 0.101262427935202722E+06, + 0.101275786221996692E+06, 0.101287697523967043E+06, 0.101297635973110140E+06, 0.101305160473319178E+06, 0.101310051693956630E+06, + 0.101312576731523863E+06, 0.101312178530984005E+06, 0.101309704462442271E+06, 0.101306154021924303E+06, 0.101301740366064056E+06, + 0.101296951709652378E+06, 0.101292269396465854E+06, 0.101290108113855764E+06, 0.101288928548419208E+06, 0.101288387917089291E+06, + 0.101288777866387623E+06, 0.101290116771842790E+06, 0.101292139767421628E+06, 0.101294723268304471E+06, 0.101297795211849851E+06, + 0.101301366709605994E+06, 0.101305420330384557E+06, 0.101309869927812077E+06, 0.101314312823006214E+06, 0.101319116997910372E+06, + 0.101324617109151222E+06, 0.101331532615370001E+06, 0.101340103637168490E+06, 0.101350201834497682E+06, 0.101361344371531173E+06, + 0.101372418886796950E+06, 0.101381948875157381E+06, 0.101388923839096911E+06, 0.101393136106285616E+06, 0.101394429864949576E+06, + 0.101392894622174237E+06, 0.101388710803148075E+06, 0.101383777236252092E+06, 0.101379295952832908E+06, 0.101375940276367168E+06, + 0.101374441230547527E+06, 0.101375326622697306E+06, 0.101379093018278771E+06, 0.101385343361571824E+06, 0.101393971058482173E+06, + 0.101404050563811383E+06, 0.101413309721598285E+06, 0.101419590399406094E+06, 0.101421556394179410E+06, 0.101418021431235960E+06, + 0.101407974515161055E+06, 0.101390537479077990E+06, 0.101366032709315157E+06, 0.101334626683717870E+06, 0.101295933958054040E+06, + 0.101248443893183838E+06, 0.101195557967522065E+06, 0.101139585544601810E+06, 0.101085211343045346E+06, 0.101035266930195139E+06, + 0.100988241812145512E+06, 0.100945367896748721E+06, 0.100910497202633036E+06, 0.100884702886764164E+06, 0.100866517649476897E+06, + 0.100856014684083144E+06, 0.100852787000617667E+06, 0.100856653557479323E+06, 0.100867163372326730E+06, 0.100881111266454434E+06, + 0.100900315195405696E+06, 0.100923976750114074E+06, 0.100948598119614544E+06, 0.100974781704195004E+06, 0.101003202157587060E+06, + 0.101036407590628412E+06, 0.101073193182310031E+06, 0.101104736474453239E+06, 0.101125695287679831E+06, 0.101129453279073452E+06, + 0.101117773581594010E+06, 0.101089185532541305E+06, 0.101034032199054171E+06, 0.100963945545633382E+06, 0.100886699328991119E+06, + 0.100810636627241329E+06, 0.100740715610179395E+06, 0.100679191246166200E+06, 0.100632989251138570E+06, 0.100613781871159343E+06, + 0.100610871530594683E+06, 0.100624379990977119E+06, 0.100656925116010229E+06, 0.100705935141557828E+06, 0.100761070879974053E+06, + 0.100816622699684551E+06, 0.100864793595773081E+06, 0.100902967646118850E+06, 0.100932714749620762E+06, 0.100956310150092322E+06, + 0.100973624358999965E+06, 0.100992241483773090E+06, 0.101016637765204548E+06, 0.101048154107647293E+06, 0.101087466334016062E+06, + 0.101132339254048915E+06, 0.101174823812832328E+06, 0.101210761915469266E+06, 0.101237271423401384E+06, 0.101243002885737078E+06, + 0.101230131791106003E+06, 0.101203940299668466E+06, 0.101166656487591579E+06, 0.101121119041289232E+06, 0.101069073832594047E+06, + 0.101014700223724387E+06, 0.100959265268248433E+06, 0.100905468112225586E+06, 0.100856040902612105E+06, 0.100814460428244129E+06, + 0.100787259237540056E+06, 0.100772005863003345E+06, 0.100765985352267919E+06, 0.100768479113289053E+06, 0.100778366997407138E+06, + 0.100794945598743492E+06, 0.100817620478677374E+06, 0.100842147859125718E+06, 0.100867955315801722E+06, 0.100893394586128459E+06, + 0.100917107047287223E+06, 0.100938380004807230E+06, 0.100955347801049342E+06, 0.100970101009214006E+06, 0.100982904354844184E+06, + 0.100992784717252944E+06, 0.100997426697573173E+06, 0.100999203666720758E+06, 0.101193726602745155E+06, 0.101187754050723946E+06, + 0.101182357442443288E+06, 0.101177791388126643E+06, 0.101173723996436573E+06, 0.101170304719806183E+06, 0.101170612153776412E+06, + 0.101172440371721386E+06, 0.101174837075875621E+06, 0.101177672254314428E+06, 0.101182161160034389E+06, 0.101187828651191783E+06, + 0.101193320301503438E+06, 0.101198410730358519E+06, 0.101202946144533795E+06, 0.101206852558810875E+06, 0.101210007801575470E+06, + 0.101212489910168282E+06, 0.101214469378389869E+06, 0.101216878002924321E+06, 0.101220363461237575E+06, 0.101225214136769951E+06, + 0.101231637580600829E+06, 0.101239741560505950E+06, 0.101249517808410572E+06, 0.101260983023677167E+06, 0.101275957870551239E+06, + 0.101290656294668952E+06, 0.101304333702323362E+06, 0.101316427532517599E+06, 0.101326426428850100E+06, 0.101333915035895625E+06, + 0.101338611708287717E+06, 0.101340492859798338E+06, 0.101340362563395611E+06, 0.101338449476013702E+06, 0.101335257523435517E+06, + 0.101331249861504504E+06, 0.101326886093198918E+06, 0.101322617484757109E+06, 0.101318867500197564E+06, 0.101317900452591755E+06, + 0.101318314786954928E+06, 0.101319723768116164E+06, 0.101321959881412520E+06, 0.101324889048512938E+06, 0.101328347647524672E+06, + 0.101332174840765205E+06, 0.101336616060312401E+06, 0.101341556829236884E+06, 0.101346573413864826E+06, 0.101351603295543347E+06, + 0.101356815104860521E+06, 0.101362438373961399E+06, 0.101369371088361426E+06, 0.101378082295762331E+06, 0.101388314410706720E+06, + 0.101399372327800622E+06, 0.101410061836120745E+06, 0.101419580351030396E+06, 0.101425913537260407E+06, 0.101429293259021812E+06, + 0.101429804412116951E+06, 0.101427672924137820E+06, 0.101424080437455879E+06, 0.101419619212416699E+06, 0.101415230974183942E+06, + 0.101412067965185430E+06, 0.101410791086110883E+06, 0.101411739073867124E+06, 0.101415639705951602E+06, 0.101423312622668134E+06, + 0.101432474045874798E+06, 0.101442051195699867E+06, 0.101450469188552204E+06, 0.101454491373749755E+06, 0.101453440137517347E+06, + 0.101446281387837167E+06, 0.101431595048405667E+06, 0.101408886711617088E+06, 0.101378784184722594E+06, 0.101341184770978914E+06, + 0.101295889547724786E+06, 0.101240328400627433E+06, 0.101177652284460986E+06, 0.101111150684114546E+06, 0.101044053118300144E+06, + 0.100984918740243505E+06, 0.100930374090685815E+06, 0.100881582472409573E+06, 0.100841112633375247E+06, 0.100809768362702191E+06, + 0.100786799243457121E+06, 0.100772143085301912E+06, 0.100764968278141983E+06, 0.100765770745809103E+06, 0.100774102380776618E+06, + 0.100787701814049200E+06, 0.100807502103195773E+06, 0.100832717694658859E+06, 0.100860249536352872E+06, 0.100889852423407749E+06, + 0.100921848628126099E+06, 0.100957861355781963E+06, 0.100996433916241411E+06, 0.101029829562515966E+06, 0.101052485930506547E+06, + 0.101058372937639273E+06, 0.101049548410078569E+06, 0.101024243456762211E+06, 0.100972590760278690E+06, 0.100908281417167527E+06, + 0.100837060983074800E+06, 0.100768161325613342E+06, 0.100704714640766149E+06, 0.100649980401007386E+06, 0.100610226186345069E+06, + 0.100590748020045430E+06, 0.100587436259410169E+06, 0.100600313080586799E+06, 0.100641206195168561E+06, 0.100694783185600594E+06, + 0.100753395339411843E+06, 0.100811221255729251E+06, 0.100860359364136690E+06, 0.100899824043495319E+06, 0.100928315410134717E+06, + 0.100945425133485944E+06, 0.100949685705930868E+06, 0.100959203677864440E+06, 0.100974757114044391E+06, 0.100998131833821230E+06, + 0.101033920715517670E+06, 0.101074219109624129E+06, 0.101114091820176982E+06, 0.101149405994865883E+06, 0.101170348641579942E+06, + 0.101169807298637141E+06, 0.101156298476682292E+06, 0.101130628971099330E+06, 0.101094643437300154E+06, 0.101052492078486888E+06, + 0.101007253119503090E+06, 0.100955907017813224E+06, 0.100902084595712833E+06, 0.100849827379669470E+06, 0.100802083544595851E+06, + 0.100765913220995702E+06, 0.100739572869835451E+06, 0.100723779479156976E+06, 0.100718506421119528E+06, 0.100722320980193326E+06, + 0.100734436110120514E+06, 0.100755329206052033E+06, 0.100779519272158068E+06, 0.100805173540144926E+06, 0.100830784490592530E+06, + 0.100856189170746162E+06, 0.100880432886013805E+06, 0.100899949784039432E+06, 0.100917438620547167E+06, 0.100933522862752710E+06, + 0.100948109352301544E+06, 0.100961044329522949E+06, 0.100971373211325132E+06, 0.100975423948777170E+06, 0.101200152192834488E+06, + 0.101194982325493736E+06, 0.101190103263664205E+06, 0.101186138559247396E+06, 0.101183134221834189E+06, 0.101184216681154692E+06, + 0.101186521041798725E+06, 0.101189436060083317E+06, 0.101192802546943451E+06, 0.101196478796712297E+06, 0.101200354354545649E+06, + 0.101205668611732151E+06, 0.101211929159398627E+06, 0.101217855930562437E+06, 0.101223284560094209E+06, 0.101227968215825720E+06, + 0.101231889676374194E+06, 0.101235394681567603E+06, 0.101238691342655846E+06, 0.101242180145337508E+06, 0.101246637252434826E+06, + 0.101252408136256170E+06, 0.101259706939182157E+06, 0.101268648761024378E+06, 0.101279505402642011E+06, 0.101294343975882977E+06, + 0.101309563533686218E+06, 0.101324641711895500E+06, 0.101338688391072021E+06, 0.101351044389960793E+06, 0.101361207159967045E+06, + 0.101368783445243811E+06, 0.101373529077171552E+06, 0.101374957490127519E+06, 0.101374464042535998E+06, 0.101372814207710297E+06, + 0.101369991240096075E+06, 0.101366429702577938E+06, 0.101362562430391059E+06, 0.101358815668015828E+06, 0.101355589086463762E+06, + 0.101353446673457220E+06, 0.101354379072032898E+06, 0.101356568662050558E+06, 0.101359675232751892E+06, 0.101363521918530183E+06, + 0.101367901119934351E+06, 0.101372596354978567E+06, 0.101377679630817802E+06, 0.101383555064504282E+06, 0.101389214201889146E+06, + 0.101394747283543154E+06, 0.101400304955646759E+06, 0.101406085277459220E+06, 0.101412285840230092E+06, 0.101421118963008921E+06, + 0.101431763041225102E+06, 0.101442507714153820E+06, 0.101452705296310087E+06, 0.101461587946274274E+06, 0.101468308697248838E+06, + 0.101470980618346424E+06, 0.101470729759961876E+06, 0.101468260238464049E+06, 0.101464485269084631E+06, 0.101460142280246233E+06, + 0.101455922507406227E+06, 0.101452998879112638E+06, 0.101452045655453316E+06, 0.101454002525278673E+06, 0.101458795222069632E+06, + 0.101466167386261062E+06, 0.101474834484365027E+06, 0.101483448321051124E+06, 0.101490293297485317E+06, 0.101492761571887779E+06, + 0.101487122913431667E+06, 0.101474656695076628E+06, 0.101456224507296021E+06, 0.101430664509854570E+06, 0.101396241168372988E+06, + 0.101353344458271313E+06, 0.101301873429881321E+06, 0.101240809982906721E+06, 0.101170237649192510E+06, 0.101096056635001150E+06, + 0.101022326149495057E+06, 0.100954494264510751E+06, 0.100892663983306251E+06, 0.100837194485465618E+06, 0.100789854158125687E+06, + 0.100752681688232609E+06, 0.100724050472389747E+06, 0.100703743253736306E+06, 0.100691513151292049E+06, 0.100687489061012806E+06, + 0.100691112445670500E+06, 0.100703488782601926E+06, 0.100723515984008409E+06, 0.100749686437924174E+06, 0.100779862035053753E+06, + 0.100812870466228749E+06, 0.100848356219152789E+06, 0.100886618033728999E+06, 0.100925814700154908E+06, 0.100959913340029161E+06, + 0.100983841408427761E+06, 0.100992708938197888E+06, 0.100988038726636543E+06, 0.100967451749821237E+06, 0.100923773661071609E+06, + 0.100869154347678006E+06, 0.100808293671752166E+06, 0.100749950128448239E+06, 0.100695742144580625E+06, 0.100650055466795442E+06, + 0.100620543751264457E+06, 0.100607774629359716E+06, 0.100609856499218455E+06, 0.100627731512123690E+06, 0.100665827330432643E+06, + 0.100713727303578300E+06, 0.100768972922192886E+06, 0.100825101449405265E+06, 0.100873709631678183E+06, 0.100911910907812446E+06, + 0.100937425920985901E+06, 0.100943826278808614E+06, 0.100938923612846338E+06, 0.100932772703382885E+06, 0.100933209681834254E+06, + 0.100949942917228545E+06, 0.100978390439217677E+06, 0.101012218238497939E+06, 0.101047001443362271E+06, 0.101078030320958118E+06, + 0.101092528178749781E+06, 0.101092763600199483E+06, 0.101079667768304178E+06, 0.101055363093306296E+06, 0.101021923023798488E+06, + 0.100985043918944197E+06, 0.100942576674115116E+06, 0.100896142310934607E+06, 0.100846740359288175E+06, 0.100796745756417309E+06, + 0.100754281013923188E+06, 0.100719661969801513E+06, 0.100694202095497239E+06, 0.100678990016565542E+06, 0.100674159552381345E+06, + 0.100679144362130333E+06, 0.100696517057853678E+06, 0.100718723297862292E+06, 0.100743828966135392E+06, 0.100770038155539907E+06, + 0.100795879753092362E+06, 0.100820314666932885E+06, 0.100840279171251284E+06, 0.100859249879902098E+06, 0.100877455365052447E+06, + 0.100894767625869688E+06, 0.100911051050858092E+06, 0.100926113687447752E+06, 0.100939677540915931E+06, 0.100954098051095163E+06, + 0.101208266074669766E+06, 0.101204147301312958E+06, 0.101200416332034234E+06, 0.101197391022381067E+06, 0.101199181271863577E+06, + 0.101202094479608772E+06, 0.101205718922681015E+06, 0.101209868079757638E+06, 0.101214363087133126E+06, 0.101219049217859545E+06, + 0.101223809934456556E+06, 0.101228578149758148E+06, 0.101234563424877633E+06, 0.101241302361129114E+06, 0.101247428820028508E+06, + 0.101252833705618847E+06, 0.101257741214607289E+06, 0.101262268791874914E+06, 0.101266621965163562E+06, 0.101271104202253337E+06, + 0.101276449761759577E+06, 0.101283261996570189E+06, 0.101291578552841063E+06, 0.101301921001578070E+06, 0.101316864610287244E+06, + 0.101332633397110185E+06, 0.101348565409528048E+06, 0.101363970375545556E+06, 0.101378339950166031E+06, 0.101391005184961628E+06, + 0.101401390238182328E+06, 0.101409118811233842E+06, 0.101412813852507519E+06, 0.101413916622343488E+06, 0.101413648249779086E+06, + 0.101412262363096830E+06, 0.101409843816287481E+06, 0.101406792118611833E+06, 0.101403515263375913E+06, 0.101400419883465394E+06, + 0.101397648089374270E+06, 0.101396200071828469E+06, 0.101396462464251483E+06, 0.101399249041504649E+06, 0.101403242459244415E+06, + 0.101408064521844237E+06, 0.101413460579763079E+06, 0.101419299541355576E+06, 0.101425515902185769E+06, 0.101431872156549493E+06, + 0.101438092345517420E+06, 0.101444082593329236E+06, 0.101449980221889302E+06, 0.101455962961780679E+06, 0.101462741205452243E+06, + 0.101470817291088752E+06, 0.101480892587434573E+06, 0.101491089133211004E+06, 0.101500643428374140E+06, 0.101508817670985038E+06, + 0.101514860224122342E+06, 0.101517434476198061E+06, 0.101516541747761323E+06, 0.101513815068472235E+06, 0.101509904719619197E+06, + 0.101505507654049128E+06, 0.101501313463842132E+06, 0.101498849002981064E+06, 0.101499159934514231E+06, 0.101501693020130377E+06, + 0.101506338552975649E+06, 0.101512651659291208E+06, 0.101520288072555239E+06, 0.101527432009874057E+06, 0.101531192551327069E+06, + 0.101528423709889583E+06, 0.101519435532333911E+06, 0.101504734513441072E+06, 0.101484004484384001E+06, 0.101456280732745858E+06, + 0.101419035179553714E+06, 0.101371837096264266E+06, 0.101315248944149382E+06, 0.101249891741609565E+06, 0.101174205010685138E+06, + 0.101095025216710172E+06, 0.101016603839094241E+06, 0.100942714517862012E+06, 0.100875651961458614E+06, 0.100815206600637175E+06, + 0.100762266129504540E+06, 0.100719792923412402E+06, 0.100688381242510412E+06, 0.100664315202569429E+06, 0.100646899315571907E+06, + 0.100636389190856382E+06, 0.100633921317728295E+06, 0.100640986745192960E+06, 0.100657927960284273E+06, 0.100683603999329847E+06, + 0.100715139361547874E+06, 0.100750464071587950E+06, 0.100789001781336541E+06, 0.100828980626378441E+06, 0.100867904881876937E+06, + 0.100901941917073651E+06, 0.100927518925117751E+06, 0.100941703370720032E+06, 0.100943313763502156E+06, 0.100929483993483183E+06, + 0.100897899422321643E+06, 0.100855144068640948E+06, 0.100806216832129357E+06, 0.100757963881253396E+06, 0.100713882396988687E+06, + 0.100678037239657642E+06, 0.100660578064393208E+06, 0.100655660139403961E+06, 0.100663394611081239E+06, 0.100687757803070126E+06, + 0.100726360544964817E+06, 0.100771737117872792E+06, 0.100819550423355045E+06, 0.100863789606076709E+06, 0.100903960982124961E+06, + 0.100937933974381580E+06, 0.100955929021348216E+06, 0.100950002084778927E+06, 0.100936336168784517E+06, 0.100920611799506456E+06, + 0.100908792443247541E+06, 0.100909956087163751E+06, 0.100924519937428529E+06, 0.100950317855032117E+06, 0.100978637481090613E+06, + 0.101001785171553231E+06, 0.101014600980588948E+06, 0.101015533816949537E+06, 0.101004399554267075E+06, 0.100982402170127083E+06, + 0.100954472767269413E+06, 0.100920498290662959E+06, 0.100881272186000555E+06, 0.100838252143924561E+06, 0.100793001524282852E+06, + 0.100749722238879811E+06, 0.100710007831689465E+06, 0.100676561452258436E+06, 0.100651754156739727E+06, 0.100637016515992684E+06, + 0.100632797680647462E+06, 0.100643122435673547E+06, 0.100662040946369423E+06, 0.100684765371038040E+06, 0.100710073382574032E+06, + 0.100736158886730540E+06, 0.100761558107963079E+06, 0.100780935166741401E+06, 0.100798370121153508E+06, 0.100816555152162895E+06, + 0.100835390903751701E+06, 0.100853847765655024E+06, 0.100871757501481305E+06, 0.100888895778612612E+06, 0.100908175229415137E+06, + 0.100925669047910487E+06, 0.101217702072300162E+06, 0.101214879429494846E+06, 0.101212918203238412E+06, 0.101215072363802130E+06, + 0.101218250672383481E+06, 0.101222522132735277E+06, 0.101227622288938786E+06, 0.101233167267756522E+06, 0.101238956389902218E+06, + 0.101244820309774892E+06, 0.101250635435466815E+06, 0.101256335683556361E+06, 0.101261921151622766E+06, 0.101268342600560762E+06, + 0.101275163933372678E+06, 0.101281497833931266E+06, 0.101287383286156546E+06, 0.101292932525330558E+06, 0.101298347923196663E+06, + 0.101303932128846092E+06, 0.101310090422888767E+06, 0.101317693616226330E+06, 0.101327652607175361E+06, 0.101342480557763687E+06, + 0.101358556451299402E+06, 0.101375279086523937E+06, 0.101391978870831925E+06, 0.101407971443584844E+06, 0.101422613121423448E+06, + 0.101435506823643867E+06, 0.101446124078218185E+06, 0.101452234738676838E+06, 0.101455284023688801E+06, 0.101456737369482420E+06, + 0.101456865445288451E+06, 0.101455916182255954E+06, 0.101454121953738781E+06, 0.101451661773156113E+06, 0.101449081947506013E+06, + 0.101446228059309360E+06, 0.101444208961239303E+06, 0.101443612932188233E+06, 0.101444705011359765E+06, 0.101447541270001515E+06, + 0.101452383501387390E+06, 0.101458282693875270E+06, 0.101464997464114887E+06, 0.101472100710916289E+06, 0.101479273864667499E+06, + 0.101486350419971670E+06, 0.101493152086614995E+06, 0.101499576717366377E+06, 0.101505843270561643E+06, 0.101512436676125639E+06, + 0.101519641676807107E+06, 0.101527434410592061E+06, 0.101535644765811841E+06, 0.101545029301612725E+06, 0.101553754432012545E+06, + 0.101560956040866411E+06, 0.101564550165702050E+06, 0.101566892094339870E+06, 0.101567035078111294E+06, 0.101564167039659485E+06, + 0.101560257949168226E+06, 0.101555969226616333E+06, 0.101552313766367617E+06, 0.101550452021603851E+06, 0.101550963150145908E+06, + 0.101553454481203808E+06, 0.101557594737071355E+06, 0.101562591960326725E+06, 0.101568055832384678E+06, 0.101570018237429336E+06, + 0.101568806715803599E+06, 0.101563796324326468E+06, 0.101553825571776295E+06, 0.101537561122490020E+06, 0.101515230788797810E+06, + 0.101485862600308523E+06, 0.101448189650402157E+06, 0.101397681000099896E+06, 0.101336913516701141E+06, 0.101267241010695536E+06, + 0.101189600658946001E+06, 0.101107785950000631E+06, 0.101027329917614610E+06, 0.100951013494106854E+06, 0.100883020611558357E+06, + 0.100825246076290889E+06, 0.100775271676367163E+06, 0.100732070018118597E+06, 0.100693807828755365E+06, 0.100660471847562090E+06, + 0.100632198820324600E+06, 0.100610336348454613E+06, 0.100597445568148105E+06, 0.100596347705297740E+06, 0.100608739289963560E+06, + 0.100632312399144867E+06, 0.100664180492312080E+06, 0.100701580165578795E+06, 0.100742885809197804E+06, 0.100784251808581277E+06, + 0.100822721504335888E+06, 0.100857114729781009E+06, 0.100884974331454141E+06, 0.100904296005382625E+06, 0.100913525976403209E+06, + 0.100909880311948247E+06, 0.100892635225440783E+06, 0.100865034092500646E+06, 0.100830041776689235E+06, 0.100792635237818962E+06, + 0.100758858691726316E+06, 0.100734424708176390E+06, 0.100726153683192097E+06, 0.100729591906647329E+06, 0.100742469628359380E+06, + 0.100772373108355430E+06, 0.100810039805286127E+06, 0.100850865902025442E+06, 0.100889839249818047E+06, 0.100924291493751982E+06, + 0.100954018166122405E+06, 0.100976020229241141E+06, 0.100977598211779696E+06, 0.100962801120868462E+06, 0.100940325812200113E+06, + 0.100915300637579014E+06, 0.100897607613392654E+06, 0.100888545266499175E+06, 0.100887361365753401E+06, 0.100894417619390835E+06, + 0.100914107950286358E+06, 0.100931864535990011E+06, 0.100942729300749750E+06, 0.100943712413188565E+06, 0.100933999633237443E+06, + 0.100915953837210676E+06, 0.100891962587812566E+06, 0.100861290497928669E+06, 0.100825794229352119E+06, 0.100786805648525173E+06, + 0.100747059949918155E+06, 0.100708052571343884E+06, 0.100670389177752746E+06, 0.100637438856290988E+06, 0.100612791553316754E+06, + 0.100598161054412602E+06, 0.100597616745557592E+06, 0.100608245258248513E+06, 0.100627589752602711E+06, 0.100652501052796259E+06, + 0.100677256390096882E+06, 0.100702485105916334E+06, 0.100721371071945381E+06, 0.100737732280855227E+06, 0.100754743779602475E+06, + 0.100772593580461515E+06, 0.100791374419969914E+06, 0.100810897025248196E+06, 0.100830367089737425E+06, 0.100852737881952431E+06, + 0.100874075837282377E+06, 0.100893534157121714E+06, 0.101228070489269143E+06, 0.101227544665406953E+06, 0.101230349746524807E+06, + 0.101234269851944497E+06, 0.101239184467959683E+06, 0.101244939450664504E+06, 0.101251545017166776E+06, 0.101258662705518451E+06, + 0.101265918196699597E+06, 0.101273125560589353E+06, 0.101280152736103031E+06, 0.101286933875186733E+06, 0.101293407125996848E+06, + 0.101299586824039099E+06, 0.101306376779591956E+06, 0.101313623028716072E+06, 0.101320476967868250E+06, 0.101327043370354135E+06, + 0.101333520713772232E+06, 0.101340211822319048E+06, 0.101347526837547412E+06, 0.101356523012281294E+06, 0.101370533287668499E+06, + 0.101386582740267011E+06, 0.101403758993542797E+06, 0.101421430602220105E+06, 0.101438909393433467E+06, 0.101455505881131437E+06, + 0.101470586854150286E+06, 0.101483635012064580E+06, 0.101492144560654036E+06, 0.101497362403152074E+06, 0.101500801900675287E+06, + 0.101502736875093309E+06, 0.101503413235270535E+06, 0.101503062612840484E+06, 0.101501914512809366E+06, 0.101500206465205003E+06, + 0.101497831592138784E+06, 0.101495767534276791E+06, 0.101494714546066039E+06, 0.101495119352637426E+06, 0.101497237786485115E+06, + 0.101501125674684867E+06, 0.101506644060371764E+06, 0.101514150312748505E+06, 0.101522320784248848E+06, 0.101530563331544297E+06, + 0.101538706294350879E+06, 0.101546559377466736E+06, 0.101553946547580461E+06, 0.101560765945043371E+06, 0.101567653265792658E+06, + 0.101574587210003941E+06, 0.101581752742970988E+06, 0.101589174518686996E+06, 0.101596642355671458E+06, 0.101603818859754785E+06, + 0.101610799838750623E+06, 0.101614811522755466E+06, 0.101617790546373333E+06, 0.101619757440904345E+06, 0.101620562545717650E+06, + 0.101618884459059045E+06, 0.101615191240677028E+06, 0.101611483339551589E+06, 0.101608375965291722E+06, 0.101606589668011176E+06, + 0.101606767311590491E+06, 0.101608967585915860E+06, 0.101612347393029107E+06, 0.101614810665037265E+06, 0.101614446811429036E+06, + 0.101613127583126843E+06, 0.101609516694027276E+06, 0.101602475273863849E+06, 0.101591105455035053E+06, 0.101574139304303288E+06, + 0.101552261616850359E+06, 0.101522964529426812E+06, 0.101483809256113498E+06, 0.101431803333729331E+06, 0.101367984772122625E+06, + 0.101295216781381270E+06, 0.101216180859079337E+06, 0.101134418945842335E+06, 0.101057719484696820E+06, 0.100987761361816083E+06, + 0.100925129407695815E+06, 0.100869076127166059E+06, 0.100819148307903684E+06, 0.100772602660554068E+06, 0.100726367887494707E+06, + 0.100682387602061091E+06, 0.100642046686646194E+06, 0.100608073036628615E+06, 0.100583165331615121E+06, 0.100571567333927058E+06, + 0.100579161681519065E+06, 0.100599831523424771E+06, 0.100631457444745640E+06, 0.100671162741316628E+06, 0.100715517300559659E+06, + 0.100759196447210823E+06, 0.100798644466533326E+06, 0.100834218092755124E+06, 0.100864022068452279E+06, 0.100886844670119492E+06, + 0.100903072952249466E+06, 0.100910324635737983E+06, 0.100907110564502160E+06, 0.100894913649374212E+06, 0.100873485872527890E+06, + 0.100847908218072756E+06, 0.100825028815845202E+06, 0.100812235195442801E+06, 0.100811789392154620E+06, 0.100821477468724654E+06, + 0.100842188280174509E+06, 0.100874882105417564E+06, 0.100910352034741096E+06, 0.100944613694273561E+06, 0.100970573806106200E+06, + 0.100992876564753780E+06, 0.101010256709896377E+06, 0.101017365734439736E+06, 0.101004642180764087E+06, 0.100981216767300502E+06, + 0.100950670557522288E+06, 0.100918693714911191E+06, 0.100893168282002865E+06, 0.100873786774855747E+06, 0.100862092518860401E+06, + 0.100858765389723776E+06, 0.100863848594959985E+06, 0.100872455106490743E+06, 0.100880727391939872E+06, 0.100881060958518239E+06, + 0.100871581642927995E+06, 0.100854982629453050E+06, 0.100833968938175327E+06, 0.100809126941723182E+06, 0.100777926015906574E+06, + 0.100744862813125714E+06, 0.100711030659190204E+06, 0.100674920663551122E+06, 0.100638665812651045E+06, 0.100604613640158801E+06, + 0.100577951755037328E+06, 0.100565299257314167E+06, 0.100564490794773781E+06, 0.100574070775104672E+06, 0.100592267906427369E+06, + 0.100616576592620535E+06, 0.100643954138155808E+06, 0.100661679785274406E+06, 0.100676519993234426E+06, 0.100692101751513052E+06, + 0.100708845098980164E+06, 0.100726890359751837E+06, 0.100746088291053093E+06, 0.100766274118497415E+06, 0.100790485020117267E+06, + 0.100814283052694198E+06, 0.100836998900601233E+06, 0.100857834251143926E+06, 0.101239951294366925E+06, 0.101243511198018721E+06, + 0.101248266604097182E+06, 0.101254120739513630E+06, 0.101260940255995316E+06, 0.101268566543099048E+06, 0.101276830453567702E+06, + 0.101285622454819968E+06, 0.101294523809254446E+06, 0.101303237484829937E+06, 0.101311620976720500E+06, 0.101319644374765689E+06, + 0.101327259549206297E+06, 0.101334480948853117E+06, 0.101341388354789131E+06, 0.101348710884544664E+06, 0.101356521517190282E+06, + 0.101364093945627537E+06, 0.101371621643877312E+06, 0.101379408199202080E+06, 0.101388443315429948E+06, 0.101401687552132498E+06, + 0.101416572004818678E+06, 0.101433189992554107E+06, 0.101451428970825116E+06, 0.101470024045938291E+06, 0.101488255659360628E+06, + 0.101505416028128879E+06, 0.101520868917434069E+06, 0.101531842805264969E+06, 0.101539245769958565E+06, 0.101544605958666289E+06, + 0.101548569302459247E+06, 0.101551134535491103E+06, 0.101552518676128384E+06, 0.101552933361419549E+06, 0.101552598628048305E+06, + 0.101551346091754502E+06, 0.101549620534837697E+06, 0.101548503290274006E+06, 0.101548531268210281E+06, 0.101550086213979870E+06, + 0.101553415865284071E+06, 0.101558574308658994E+06, 0.101566141420655156E+06, 0.101575323430362041E+06, 0.101584790524686381E+06, + 0.101594148506046142E+06, 0.101603272905442951E+06, 0.101611945735174741E+06, 0.101619979003416622E+06, 0.101627204805596586E+06, + 0.101634427668451928E+06, 0.101641404911077247E+06, 0.101648381901037224E+06, 0.101655340222651532E+06, 0.101662034474683896E+06, + 0.101666783103935741E+06, 0.101669591715802919E+06, 0.101672592019255666E+06, 0.101674896474706766E+06, 0.101676486613950226E+06, + 0.101677173545713507E+06, 0.101676735064566892E+06, 0.101674421820609132E+06, 0.101671063643987713E+06, 0.101668202552547300E+06, + 0.101666520557556054E+06, 0.101666348434875123E+06, 0.101667923680669555E+06, 0.101669351667803800E+06, 0.101668978131977754E+06, + 0.101666110028333933E+06, 0.101660538752964931E+06, 0.101654594444694463E+06, 0.101645738692219165E+06, 0.101634351733125281E+06, + 0.101619445806351592E+06, 0.101597486529762551E+06, 0.101566963080607631E+06, 0.101526313623151611E+06, 0.101474414132893216E+06, + 0.101408806070782084E+06, 0.101334676336432865E+06, 0.101255967485764850E+06, 0.101177930379907673E+06, 0.101105923487214692E+06, + 0.101041528067973224E+06, 0.100984421243628807E+06, 0.100931366999700622E+06, 0.100882259035952666E+06, 0.100834318510275116E+06, + 0.100780975023316409E+06, 0.100725029283105585E+06, 0.100672125573187601E+06, 0.100626333648281943E+06, 0.100591108252538659E+06, + 0.100571154519613207E+06, 0.100572764811242494E+06, 0.100590644123334263E+06, 0.100622114840101916E+06, 0.100663170419413218E+06, + 0.100711109304953105E+06, 0.100759450274770090E+06, 0.100803668821019484E+06, 0.100843723009858411E+06, 0.100878065056743988E+06, + 0.100905193898488564E+06, 0.100924238150348683E+06, 0.100935705112497482E+06, 0.100940040808540827E+06, 0.100938611611957211E+06, + 0.100929132041696241E+06, 0.100917754954705204E+06, 0.100905818223427166E+06, 0.100905472653716875E+06, 0.100913513200435162E+06, + 0.100929234171202479E+06, 0.100956672791980032E+06, 0.100989933744260285E+06, 0.101021721049159081E+06, 0.101045261345619481E+06, + 0.101056484086316414E+06, 0.101064376750130497E+06, 0.101068662292293593E+06, 0.101058850049314118E+06, 0.101036734626105259E+06, + 0.101005396099047648E+06, 0.100967551751069492E+06, 0.100930584068150943E+06, 0.100895049839971194E+06, 0.100865689126530953E+06, + 0.100843766391791884E+06, 0.100833519035555830E+06, 0.100830429319700765E+06, 0.100830534716874317E+06, 0.100831218872075027E+06, + 0.100828733033744793E+06, 0.100816736999957517E+06, 0.100801115692818625E+06, 0.100782650624359696E+06, 0.100761638271208169E+06, + 0.100739079948099330E+06, 0.100715508303584225E+06, 0.100685570121976882E+06, 0.100651926936336182E+06, 0.100616808436076797E+06, + 0.100582738088950529E+06, 0.100553609533300842E+06, 0.100536151852068826E+06, 0.100533191840017098E+06, 0.100540563795043839E+06, + 0.100556547268302660E+06, 0.100578647827983019E+06, 0.100597845282151320E+06, 0.100615643951716338E+06, 0.100629644958407152E+06, + 0.100644649717624998E+06, 0.100661314686951257E+06, 0.100679739011681770E+06, 0.100699923738231213E+06, 0.100724000291545439E+06, + 0.100748935934403649E+06, 0.100773460147275109E+06, 0.100796886100017015E+06, 0.100818431742268527E+06, 0.101253250319671861E+06, + 0.101258941275491015E+06, 0.101265825984074268E+06, 0.101273785992740712E+06, 0.101282673338371926E+06, 0.101292322337458594E+06, + 0.101302564811119126E+06, 0.101313249084015886E+06, 0.101324039732978374E+06, 0.101334420443956798E+06, 0.101344441355969844E+06, + 0.101353937804033951E+06, 0.101362853548466621E+06, 0.101371239996888005E+06, 0.101379195223571107E+06, 0.101386868114858662E+06, + 0.101394863418320267E+06, 0.101403421459721620E+06, 0.101411971625535502E+06, 0.101421328676152989E+06, 0.101434052612144369E+06, + 0.101448448578493975E+06, 0.101464428560022046E+06, 0.101481780318751698E+06, 0.101500377161328623E+06, 0.101519861969620310E+06, + 0.101538794301281392E+06, 0.101556432572582416E+06, 0.101569913275213607E+06, 0.101580111679331065E+06, 0.101588077608188687E+06, + 0.101593761388586005E+06, 0.101597743292873696E+06, 0.101601111211300595E+06, 0.101603375473686290E+06, 0.101604722386775393E+06, + 0.101605277974446421E+06, 0.101605137189286179E+06, 0.101604583774228318E+06, 0.101604027662526438E+06, 0.101605032612257637E+06, + 0.101607890648949600E+06, 0.101612610274943596E+06, 0.101620190413487217E+06, 0.101629709918692257E+06, 0.101640274485895483E+06, + 0.101651366271263018E+06, 0.101662017372317307E+06, 0.101672127532921921E+06, 0.101681639836175294E+06, 0.101689695653715113E+06, + 0.101697371401130935E+06, 0.101704816287710346E+06, 0.101711959261812881E+06, 0.101718592829194225E+06, 0.101724976617920722E+06, + 0.101729049321389990E+06, 0.101731107282530153E+06, 0.101732743234520705E+06, 0.101734177642089810E+06, 0.101735792298410903E+06, + 0.101737051523103568E+06, 0.101737813506062157E+06, 0.101737771770358304E+06, 0.101736766611527375E+06, 0.101733998643601444E+06, + 0.101731285447018498E+06, 0.101729657615879667E+06, 0.101729463824108592E+06, 0.101730467776220365E+06, 0.101730634889909721E+06, + 0.101728530424326527E+06, 0.101723478773003560E+06, 0.101715128998538450E+06, 0.101705173881448645E+06, 0.101697065128410613E+06, + 0.101686174729378530E+06, 0.101670746397321127E+06, 0.101648602916028351E+06, 0.101617289856162359E+06, 0.101575677936215157E+06, + 0.101523549414822643E+06, 0.101459384090740117E+06, 0.101385766535040675E+06, 0.101307806220871105E+06, 0.101230532040925333E+06, + 0.101163615695121596E+06, 0.101105144301163149E+06, 0.101053953064553687E+06, 0.101004506092646785E+06, 0.100954394425546445E+06, + 0.100903265851270029E+06, 0.100843568326323351E+06, 0.100779909310060830E+06, 0.100718507897475429E+06, 0.100663227538561507E+06, + 0.100619196470881463E+06, 0.100590878309716514E+06, 0.100585918330994056E+06, 0.100599670235220139E+06, 0.100629367268692309E+06, + 0.100671559948193928E+06, 0.100722625470161831E+06, 0.100775876461740903E+06, 0.100826307692812305E+06, 0.100872731273009820E+06, + 0.100911769660482067E+06, 0.100942401025764135E+06, 0.100964392752327054E+06, 0.100978678374194351E+06, 0.100986716960824007E+06, + 0.100990258819483715E+06, 0.100986859094204920E+06, 0.100984358423690996E+06, 0.100986880945730183E+06, 0.101001308030144719E+06, + 0.101021911204537639E+06, 0.101045314756852677E+06, 0.101079374563270016E+06, 0.101112057664106265E+06, 0.101138492426304845E+06, + 0.101147264582452117E+06, 0.101146181575950890E+06, 0.101139597898295426E+06, 0.101126956426191653E+06, 0.101104207044017559E+06, + 0.101074184746976593E+06, 0.101036351784390296E+06, 0.100994839802225833E+06, 0.100951701131987342E+06, 0.100907802015808338E+06, + 0.100866623322513595E+06, 0.100836261177509557E+06, 0.100817609325104844E+06, 0.100806057949370603E+06, 0.100799101756952587E+06, + 0.100794178922864405E+06, 0.100782586521973222E+06, 0.100770278560914870E+06, 0.100755730874395027E+06, 0.100740174567162278E+06, + 0.100724221891415305E+06, 0.100711960802472036E+06, 0.100695201938734870E+06, 0.100670904548085469E+06, 0.100639130264881242E+06, + 0.100604667725497551E+06, 0.100569533181772116E+06, 0.100538827586813903E+06, 0.100515863557522040E+06, 0.100504283432544311E+06, + 0.100508208880423437E+06, 0.100520846592849106E+06, 0.100533319890499857E+06, 0.100546979620563667E+06, 0.100563406036921282E+06, + 0.100581336883139578E+06, 0.100596479945475046E+06, 0.100613263609396352E+06, 0.100632606505272503E+06, 0.100655737101977575E+06, + 0.100680377627359165E+06, 0.100705693019706334E+06, 0.100730567542817560E+06, 0.100753963268230000E+06, 0.100775475443369112E+06, + 0.101264306669592683E+06, 0.101273005643247234E+06, 0.101282212261941575E+06, 0.101292455230279535E+06, 0.101303569666892407E+06, + 0.101315379627821021E+06, 0.101327713762651794E+06, 0.101340424766245633E+06, 0.101353413011349316E+06, 0.101366215214067837E+06, + 0.101378003241061873E+06, 0.101389048142805594E+06, 0.101399358057326695E+06, 0.101408993909155237E+06, 0.101418071350073515E+06, + 0.101426765747085621E+06, 0.101435320572288721E+06, 0.101444230417056518E+06, 0.101454115342003613E+06, 0.101466281775386233E+06, + 0.101480018815107192E+06, 0.101495370152025978E+06, 0.101512249092142942E+06, 0.101530457200416044E+06, 0.101549717357720714E+06, + 0.101569710093644739E+06, 0.101589282549966229E+06, 0.101605011230739328E+06, 0.101617835360473735E+06, 0.101628768238586897E+06, + 0.101637571031423722E+06, 0.101644166338589697E+06, 0.101648697806602591E+06, 0.101651881208006424E+06, 0.101655220484862148E+06, + 0.101657859335835557E+06, 0.101659761085947117E+06, 0.101661032940759702E+06, 0.101661921699332699E+06, 0.101662809971163108E+06, + 0.101664227024246793E+06, 0.101667989933228542E+06, 0.101675508452427108E+06, 0.101685268933038969E+06, 0.101696374945899413E+06, + 0.101708376350831662E+06, 0.101720741353243910E+06, 0.101732914311869565E+06, 0.101744191311434886E+06, 0.101753679207339199E+06, + 0.101762383198229145E+06, 0.101770484632283566E+06, 0.101778058653469430E+06, 0.101785052189110153E+06, 0.101791286685933344E+06, + 0.101795171487182030E+06, 0.101797156941597103E+06, 0.101798421280143026E+06, 0.101799261614609830E+06, 0.101799803038408485E+06, + 0.101800210895802447E+06, 0.101801683280290250E+06, 0.101802630829050468E+06, 0.101802543397740184E+06, 0.101801482357017914E+06, + 0.101799624587932572E+06, 0.101797066559983883E+06, 0.101795799625004249E+06, 0.101795785922852519E+06, 0.101796374037248344E+06, + 0.101796548441705847E+06, 0.101793091799900605E+06, 0.101786346983049574E+06, 0.101776575607877137E+06, 0.101765049283969143E+06, + 0.101754303368654233E+06, 0.101742481241294314E+06, 0.101726517364683619E+06, 0.101704526213350880E+06, 0.101673251963278643E+06, + 0.101631549642581842E+06, 0.101579630218674371E+06, 0.101517751331919892E+06, 0.101445587957413649E+06, 0.101369276534187840E+06, + 0.101293749197962985E+06, 0.101228845743408630E+06, 0.101175974072217723E+06, 0.101128069068520213E+06, 0.101080672101220363E+06, + 0.101030554297062597E+06, 0.100978255877595599E+06, 0.100917786384446328E+06, 0.100848380590802917E+06, 0.100779685419598463E+06, + 0.100716993576480047E+06, 0.100665449877585226E+06, 0.100628730188585745E+06, 0.100616768912061103E+06, 0.100625017647516172E+06, + 0.100651010955717982E+06, 0.100693983128488617E+06, 0.100748028718061119E+06, 0.100807126354548294E+06, 0.100865743222122503E+06, + 0.100920280263948240E+06, 0.100963697339721592E+06, 0.100996625031755175E+06, 0.101020588466931018E+06, 0.101034801756696354E+06, + 0.101044107550953762E+06, 0.101050001068824189E+06, 0.101053046373654055E+06, 0.101058552912032319E+06, 0.101072171257776601E+06, + 0.101095588999532294E+06, 0.101124462408449937E+06, 0.101159998252541394E+06, 0.101199939829214418E+06, 0.101233511940909040E+06, + 0.101250548981260363E+06, 0.101245238633873159E+06, 0.101231967019851887E+06, 0.101212524735667932E+06, 0.101187116747768814E+06, + 0.101155254569723096E+06, 0.101117728069520774E+06, 0.101075849861174778E+06, 0.101031454770778844E+06, 0.100982633468066182E+06, + 0.100931817382534617E+06, 0.100883044212189372E+06, 0.100842431678571462E+06, 0.100810753030772234E+06, 0.100790307235783985E+06, + 0.100775641660991605E+06, 0.100758065719658363E+06, 0.100742431929372280E+06, 0.100730276589137924E+06, 0.100719950891765460E+06, + 0.100707897196450547E+06, 0.100704034450479885E+06, 0.100696304475012279E+06, 0.100682955042842383E+06, 0.100662970635189646E+06, + 0.100635257255516670E+06, 0.100598919177042175E+06, 0.100561998994079375E+06, 0.100529207116205667E+06, 0.100503120931424841E+06, + 0.100485371253469493E+06, 0.100478084387816067E+06, 0.100480161528695491E+06, 0.100486330170588408E+06, 0.100497656033703854E+06, + 0.100512793940874559E+06, 0.100530267502319883E+06, 0.100548674998529634E+06, 0.100566870164484106E+06, 0.100588713074028346E+06, + 0.100612035752629497E+06, 0.100636570551070865E+06, 0.100661555413946771E+06, 0.100685975940573393E+06, 0.100708805081237850E+06, + 0.100728426698084644E+06, 0.101271996036762896E+06, 0.101284449704480561E+06, 0.101296689346213228E+06, 0.101309400454198360E+06, + 0.101322901055611903E+06, 0.101337001192974072E+06, 0.101351521575208899E+06, 0.101366313393139906E+06, 0.101382034494546009E+06, + 0.101397351776588475E+06, 0.101411443443270473E+06, 0.101424117470686309E+06, 0.101435883616085790E+06, 0.101446811616959909E+06, + 0.101457033181746156E+06, 0.101466747751913790E+06, 0.101476231696805597E+06, 0.101486021283400187E+06, 0.101497396375811921E+06, + 0.101510400207985600E+06, 0.101524923388815208E+06, 0.101540994381505661E+06, 0.101558520228044814E+06, 0.101577305318149651E+06, + 0.101597084529118074E+06, 0.101617572913645636E+06, 0.101635935716414897E+06, 0.101650985317801838E+06, 0.101664666828709975E+06, + 0.101676613583561295E+06, 0.101686531498022989E+06, 0.101694300750966708E+06, 0.101700039232711759E+06, 0.101704155496819658E+06, + 0.101707559871844016E+06, 0.101711706616868032E+06, 0.101715220819953611E+06, 0.101718183769718671E+06, 0.101720797579619655E+06, + 0.101723413797095534E+06, 0.101726548168837966E+06, 0.101732421109602874E+06, 0.101741180387240456E+06, 0.101752626090808626E+06, + 0.101765327683930620E+06, 0.101778794125947126E+06, 0.101792465254962983E+06, 0.101805759257347163E+06, 0.101817578749370528E+06, + 0.101828002210067600E+06, 0.101837310759124710E+06, 0.101845770211075462E+06, 0.101853420566787143E+06, 0.101860181736826940E+06, + 0.101864213062694500E+06, 0.101866574115216965E+06, 0.101867875008511299E+06, 0.101868524705411764E+06, 0.101868825959176160E+06, + 0.101868919433276926E+06, 0.101869678539425964E+06, 0.101870695483190138E+06, 0.101871330785532584E+06, 0.101870979213963699E+06, + 0.101869675931957303E+06, 0.101867574002842535E+06, 0.101865625644742016E+06, 0.101864444239763863E+06, 0.101864129871809724E+06, + 0.101864253411905665E+06, 0.101863863423935647E+06, 0.101861147095331355E+06, 0.101853046503827805E+06, 0.101842469691830149E+06, + 0.101829793173113096E+06, 0.101815148158582204E+06, 0.101801721489973846E+06, 0.101784969966993638E+06, 0.101762516553084497E+06, + 0.101733198141890345E+06, 0.101692387931239413E+06, 0.101641579160683832E+06, 0.101581604629232388E+06, 0.101513447361368249E+06, + 0.101440920474624741E+06, 0.101370696075984946E+06, 0.101305428265875380E+06, 0.101254160309156374E+06, 0.101207383873920160E+06, + 0.101161789898628529E+06, 0.101111489873579616E+06, 0.101058073620173833E+06, 0.100998431410120465E+06, 0.100925178881860134E+06, + 0.100851277940204382E+06, 0.100782887728638991E+06, 0.100724637342850445E+06, 0.100681654247053943E+06, 0.100660743763258797E+06, + 0.100662241191619672E+06, 0.100684600997945701E+06, 0.100726431789378737E+06, 0.100783621753223240E+06, 0.100850165592330639E+06, + 0.100919393459606828E+06, 0.100984663126731160E+06, 0.101035581217426865E+06, 0.101073289555574971E+06, 0.101097883508170984E+06, + 0.101109275635634360E+06, 0.101115535689499287E+06, 0.101120721213043289E+06, 0.101127445332507938E+06, 0.101138555650677066E+06, + 0.101162386128591490E+06, 0.101193764958060041E+06, 0.101229324100487633E+06, 0.101272586038755646E+06, 0.101314017050708091E+06, + 0.101345307647537833E+06, 0.101350681405921583E+06, 0.101336274552223433E+06, 0.101312002659208913E+06, 0.101282108941999220E+06, + 0.101247511268828879E+06, 0.101208775326433519E+06, 0.101166118942493005E+06, 0.101124324087716755E+06, 0.101077097855417393E+06, + 0.101023493736806588E+06, 0.100966370678116829E+06, 0.100910649732596605E+06, 0.100860956183662900E+06, 0.100818859583747035E+06, + 0.100784487610509677E+06, 0.100755633857502806E+06, 0.100730268695456398E+06, 0.100710865638861083E+06, 0.100697679049610029E+06, + 0.100690061794109570E+06, 0.100696089852752222E+06, 0.100696921102593260E+06, 0.100692632540626320E+06, 0.100681762801710865E+06, + 0.100663264802660036E+06, 0.100633791904004815E+06, 0.100597430688150896E+06, 0.100559133196241281E+06, 0.100524051576254133E+06, + 0.100494743325319461E+06, 0.100472843717532320E+06, 0.100453469270866597E+06, 0.100441938855850953E+06, 0.100444602587366870E+06, + 0.100453700278505523E+06, 0.100467703647186674E+06, 0.100484865751373640E+06, 0.100504556800278908E+06, 0.100526747147881411E+06, + 0.100548342492759344E+06, 0.100570928110482331E+06, 0.100594499129673175E+06, 0.100618314768352022E+06, 0.100641358389098648E+06, + 0.100661048545089099E+06, 0.100674922441404182E+06, 0.101277440454925483E+06, 0.101292275045881630E+06, 0.101308217918252703E+06, + 0.101324032641650105E+06, 0.101340083417949048E+06, 0.101356599817204507E+06, 0.101373389242319026E+06, 0.101391680572806275E+06, + 0.101409655246696246E+06, 0.101426966070523806E+06, 0.101443353143514600E+06, 0.101458277199001546E+06, 0.101471528522387307E+06, + 0.101483748681189623E+06, 0.101495083125874895E+06, 0.101505752090554262E+06, 0.101516050089151657E+06, 0.101526815975076141E+06, + 0.101538795327266271E+06, 0.101552338028206417E+06, 0.101567404995926277E+06, 0.101583932457588046E+06, 0.101601812845274559E+06, + 0.101620841504076889E+06, 0.101640749378202716E+06, 0.101659290500403222E+06, 0.101676771795349603E+06, 0.101693884723980591E+06, + 0.101708998663612001E+06, 0.101722276078936207E+06, 0.101733606252533034E+06, 0.101742808520292456E+06, 0.101749958233873534E+06, + 0.101756733187784732E+06, 0.101761976313215302E+06, 0.101765600227458519E+06, 0.101770624962746049E+06, 0.101775587804667244E+06, + 0.101780223730697457E+06, 0.101784845963681015E+06, 0.101792019560120360E+06, 0.101800861910829000E+06, 0.101810238167576026E+06, + 0.101821334626365482E+06, 0.101835649384848730E+06, 0.101850599319270405E+06, 0.101865571025550424E+06, 0.101879726510542314E+06, + 0.101892673462390783E+06, 0.101903975174055988E+06, 0.101913651691837455E+06, 0.101922403262289721E+06, 0.101930066269132934E+06, + 0.101934959838625931E+06, 0.101938013574382479E+06, 0.101939867945920269E+06, 0.101940768404829549E+06, 0.101940976512875422E+06, + 0.101940974808985324E+06, 0.101941915218950715E+06, 0.101942796779357042E+06, 0.101943325071244180E+06, 0.101943321289824438E+06, + 0.101942520685581403E+06, 0.101940795734215877E+06, 0.101938328485986989E+06, 0.101936102913573559E+06, 0.101934189161022412E+06, + 0.101933270983365946E+06, 0.101932726854111810E+06, 0.101931071080041162E+06, 0.101927390375963005E+06, 0.101920782487591568E+06, + 0.101909599976852041E+06, 0.101896034018928112E+06, 0.101880121030327078E+06, 0.101861777722108454E+06, 0.101843441866567693E+06, + 0.101821175828396939E+06, 0.101793162871491804E+06, 0.101756243381197477E+06, 0.101707526053893132E+06, 0.101651390637597418E+06, + 0.101591096250860501E+06, 0.101525066978488496E+06, 0.101457842460151805E+06, 0.101392749867658815E+06, 0.101338205739929384E+06, + 0.101290789521037383E+06, 0.101243732978547458E+06, 0.101191560328100386E+06, 0.101135333560209707E+06, 0.101074991868799916E+06, + 0.101002789603246347E+06, 0.100928035016280875E+06, 0.100857779212484500E+06, 0.100794984785666602E+06, 0.100746221294778152E+06, + 0.100717266126841918E+06, 0.100710869212579069E+06, 0.100726313373954297E+06, 0.100765862955971417E+06, 0.100824009621681325E+06, + 0.100896074483335498E+06, 0.100975156087370415E+06, 0.101050862045185830E+06, 0.101108616996395343E+06, 0.101151397540630162E+06, + 0.101177118649863274E+06, 0.101187234876946401E+06, 0.101192189574432836E+06, 0.101198920872520132E+06, 0.101209271572763842E+06, + 0.101225853188380381E+06, 0.101255763867716960E+06, 0.101292205782835576E+06, 0.101333769433737034E+06, 0.101380487686360808E+06, + 0.101421196585383368E+06, 0.101445943578677994E+06, 0.101442593076884281E+06, 0.101422753739062216E+06, 0.101390520324852318E+06, + 0.101350761888702051E+06, 0.101308120360709363E+06, 0.101265074031475204E+06, 0.101223556150358476E+06, 0.101181059083197164E+06, + 0.101131282154724337E+06, 0.101073985674786556E+06, 0.101009316519365500E+06, 0.100945620806578852E+06, 0.100887564966803198E+06, + 0.100836870701820939E+06, 0.100791306568270127E+06, 0.100748587002241606E+06, 0.100714275195360678E+06, 0.100691096015225994E+06, + 0.100677036214206237E+06, 0.100679656532840978E+06, 0.100689403954963505E+06, 0.100699806241966638E+06, 0.100699758014009334E+06, + 0.100690385161567290E+06, 0.100668712287826143E+06, 0.100636906386880102E+06, 0.100599766534639755E+06, 0.100560426804608782E+06, + 0.100523011227441762E+06, 0.100490487333571364E+06, 0.100458484377625064E+06, 0.100433836484664062E+06, 0.100418321599970062E+06, + 0.100412076649917391E+06, 0.100419080629848453E+06, 0.100432241000389156E+06, 0.100450792482229837E+06, 0.100472305642769512E+06, + 0.100493869619492121E+06, 0.100514430080734746E+06, 0.100535036793476407E+06, 0.100556629184451856E+06, 0.100578314394928922E+06, + 0.100596991295179905E+06, 0.100611500340730694E+06, 0.100623274306907668E+06, 0.101280196625301396E+06, 0.101297364868656936E+06, + 0.101315860426329833E+06, 0.101335437548964052E+06, 0.101354738212366676E+06, 0.101373945822871654E+06, 0.101394704590563779E+06, + 0.101415369573864707E+06, 0.101435547066077095E+06, 0.101454900560777067E+06, 0.101473156717428967E+06, 0.101490111858949429E+06, + 0.101505426648419336E+06, 0.101518896733282789E+06, 0.101531260767964472E+06, 0.101542531309453814E+06, 0.101553164954199878E+06, + 0.101564411925864319E+06, 0.101576767311889984E+06, 0.101590613786174377E+06, 0.101606186426911474E+06, 0.101622949542643095E+06, + 0.101640870734518088E+06, 0.101659778611533140E+06, 0.101677671599300767E+06, 0.101695145189232746E+06, 0.101713022490742442E+06, + 0.101730968458130665E+06, 0.101748633328473559E+06, 0.101764332593418454E+06, 0.101777415582760368E+06, 0.101788327636173344E+06, + 0.101798745459491343E+06, 0.101807854686651277E+06, 0.101815215507054876E+06, 0.101821043040616947E+06, 0.101825884968623417E+06, + 0.101832189148969264E+06, 0.101839168448648401E+06, 0.101848045440598347E+06, 0.101858730804693652E+06, 0.101869959329435806E+06, + 0.101881533268110448E+06, 0.101893454722194554E+06, 0.101906437265534973E+06, 0.101922905509709031E+06, 0.101939197745689977E+06, + 0.101954795923734462E+06, 0.101969009671704334E+06, 0.101981310726737574E+06, 0.101991415766123711E+06, 0.101999594743156573E+06, + 0.102005976491342561E+06, 0.102010334316063047E+06, 0.102013157295944911E+06, 0.102014722383416287E+06, 0.102015313093490025E+06, + 0.102015201185307524E+06, 0.102016512237083880E+06, 0.102017510782104568E+06, 0.102018055903560264E+06, 0.102018084579591843E+06, + 0.102017466339170613E+06, 0.102015842014936527E+06, 0.102013009808558825E+06, 0.102010188377710918E+06, 0.102007504920719613E+06, + 0.102004842449303280E+06, 0.102002010784629019E+06, 0.101999472815438930E+06, 0.101995912864510945E+06, 0.101991527724094442E+06, + 0.101985699759707655E+06, 0.101975812995855114E+06, 0.101961537246313150E+06, 0.101943695019863866E+06, 0.101923033375715851E+06, + 0.101901362121280530E+06, 0.101879075837123033E+06, 0.101852284874085046E+06, 0.101819539147717020E+06, 0.101776999589703846E+06, + 0.101726785900868257E+06, 0.101671557646898407E+06, 0.101612042588822980E+06, 0.101548622762663115E+06, 0.101485284216076703E+06, + 0.101425147441038411E+06, 0.101373420817102917E+06, 0.101321191476503751E+06, 0.101266538752380700E+06, 0.101208938335707280E+06, + 0.101148533319442722E+06, 0.101080582757091557E+06, 0.101007172321080754E+06, 0.100937106866050381E+06, 0.100872650853732252E+06, + 0.100818490092161403E+06, 0.100780581038449120E+06, 0.100763989069985822E+06, 0.100769172528104478E+06, 0.100801781036641652E+06, + 0.100856282722816642E+06, 0.100929221528193739E+06, 0.101013884730459817E+06, 0.101097563707576744E+06, 0.101162534274172547E+06, + 0.101213486478638646E+06, 0.101244516559525029E+06, 0.101257648408437890E+06, 0.101263733502884890E+06, 0.101275510052246449E+06, + 0.101290762661853529E+06, 0.101314197491016195E+06, 0.101347943558257903E+06, 0.101386651316440679E+06, 0.101430443429601510E+06, + 0.101475669896804160E+06, 0.101514950055520574E+06, 0.101531515938051540E+06, 0.101524788957272292E+06, 0.101501664340208648E+06, + 0.101465580088908755E+06, 0.101421732802947983E+06, 0.101374184582676520E+06, 0.101328046898908578E+06, 0.101289807901878230E+06, + 0.101246491413997268E+06, 0.101194778317482283E+06, 0.101131646224091921E+06, 0.101060205833383836E+06, 0.100988174374432070E+06, + 0.100922370979696687E+06, 0.100863854824209222E+06, 0.100809964699915654E+06, 0.100761271524313197E+06, 0.100719104259046479E+06, + 0.100686430395430245E+06, 0.100678847862221184E+06, 0.100683138663107515E+06, 0.100693073794055832E+06, 0.100704133264039236E+06, + 0.100711587564049987E+06, 0.100702838554374641E+06, 0.100679156446423745E+06, 0.100646910483054933E+06, 0.100608627281804467E+06, + 0.100567412671928309E+06, 0.100526528285293534E+06, 0.100483943399388023E+06, 0.100448443665773972E+06, 0.100421899539395425E+06, + 0.100404924203073868E+06, 0.100397063255380912E+06, 0.100397195586259491E+06, 0.100412985650041403E+06, 0.100432834475288488E+06, + 0.100453366207182436E+06, 0.100473356439391355E+06, 0.100491742373035304E+06, 0.100507905429383289E+06, 0.100525814076571885E+06, + 0.100542096974396103E+06, 0.100555812166254138E+06, 0.100567395231908740E+06, 0.100576579149565121E+06, 0.101279908089260382E+06, + 0.101299372851355220E+06, 0.101320345227797603E+06, 0.101342568251312987E+06, 0.101366203167707048E+06, 0.101390159455080997E+06, + 0.101413541104309363E+06, 0.101436670068180945E+06, 0.101459134145086064E+06, 0.101480579621756508E+06, 0.101500717501762701E+06, + 0.101519330301993643E+06, 0.101536279443531355E+06, 0.101551434684382868E+06, 0.101564255195383463E+06, 0.101575422887434994E+06, + 0.101586445548099669E+06, 0.101597902131166629E+06, 0.101610316943178666E+06, 0.101624105975331244E+06, 0.101639540620591506E+06, + 0.101656731770743747E+06, 0.101674690803331439E+06, 0.101691335236531100E+06, 0.101707821449698851E+06, 0.101725245164068649E+06, + 0.101743396815362881E+06, 0.101762005533747782E+06, 0.101780794703432257E+06, 0.101799566956391791E+06, 0.101816729089967106E+06, + 0.101830810115947446E+06, 0.101843847767199652E+06, 0.101855309960108818E+06, 0.101865083082604426E+06, 0.101873349177960990E+06, + 0.101880647099664595E+06, 0.101887932618480903E+06, 0.101897799286328358E+06, 0.101910318475203370E+06, 0.101923741945953618E+06, + 0.101937617512615703E+06, 0.101951634884124011E+06, 0.101965709346062926E+06, 0.101980052214833602E+06, 0.101995075682068244E+06, + 0.102012705906177565E+06, 0.102029916826673259E+06, 0.102045578980748891E+06, 0.102059048316380504E+06, 0.102069947174644665E+06, + 0.102077684357740349E+06, 0.102082147312762972E+06, 0.102086500261915091E+06, 0.102089248935513198E+06, 0.102090698933738371E+06, + 0.102091178364924752E+06, 0.102092701245381337E+06, 0.102093815457381104E+06, 0.102094368575754212E+06, 0.102094331459262947E+06, + 0.102093649378548696E+06, 0.102091495160413397E+06, 0.102088077118329078E+06, 0.102085266715555787E+06, 0.102082068081696532E+06, + 0.102078934857918081E+06, 0.102075562114887900E+06, 0.102070631820974115E+06, 0.102064438122544176E+06, 0.102059414174384161E+06, + 0.102053827822841413E+06, 0.102047097203453392E+06, 0.102038205276517619E+06, 0.102023970080276820E+06, 0.102005255572377879E+06, + 0.101983545280989390E+06, 0.101959239559772468E+06, 0.101934934813177606E+06, 0.101909416211695381E+06, 0.101879530216405619E+06, + 0.101843729384204227E+06, 0.101798771374156902E+06, 0.101749131431232046E+06, 0.101696435747962270E+06, 0.101638597439857098E+06, + 0.101576958615739393E+06, 0.101514239708325505E+06, 0.101456190833159548E+06, 0.101399554349585407E+06, 0.101340424142701784E+06, + 0.101280446676456311E+06, 0.101219442303719290E+06, 0.101155802903883246E+06, 0.101085010925495619E+06, 0.101016127520053677E+06, + 0.100949559692596478E+06, 0.100889898302085116E+06, 0.100844209040313392E+06, 0.100816129681629769E+06, 0.100810501379105452E+06, + 0.100832591111220638E+06, 0.100879523722449056E+06, 0.100948063089510324E+06, 0.101031460853947981E+06, 0.101115973986060417E+06, + 0.101184231818201646E+06, 0.101240245990651732E+06, 0.101276004337181133E+06, 0.101297693264287940E+06, 0.101316108838536718E+06, + 0.101339338207326771E+06, 0.101364838726589573E+06, 0.101398212697034352E+06, 0.101435020262566584E+06, 0.101474120214935858E+06, + 0.101515374742090018E+06, 0.101554913896900893E+06, 0.101585525309637247E+06, 0.101596313029333352E+06, 0.101591763310596391E+06, + 0.101572063905601564E+06, 0.101533915795807872E+06, 0.101488864498615381E+06, 0.101440950048410057E+06, 0.101401964815710235E+06, + 0.101362939393266570E+06, 0.101319118725317487E+06, 0.101264253224874032E+06, 0.101194604583161839E+06, 0.101119529697804493E+06, + 0.101043148821796305E+06, 0.100969817218776385E+06, 0.100904222807714512E+06, 0.100845424566366739E+06, 0.100792297539129795E+06, + 0.100746429506127941E+06, 0.100716119483396033E+06, 0.100699086889567552E+06, 0.100699855109205411E+06, 0.100707310375888119E+06, + 0.100716570575528633E+06, 0.100720007898216936E+06, 0.100714797932772417E+06, 0.100695727134459230E+06, 0.100662985850684985E+06, + 0.100623495462979961E+06, 0.100579571082265902E+06, 0.100528287659914175E+06, 0.100483047690553038E+06, 0.100446858129451386E+06, + 0.100420432087088702E+06, 0.100404117469529898E+06, 0.100397105480157465E+06, 0.100403234638665162E+06, 0.100415020179178769E+06, + 0.100433067114222082E+06, 0.100451452530888302E+06, 0.100468854497717490E+06, 0.100484113018387754E+06, 0.100496513635322510E+06, + 0.100504396642556661E+06, 0.100514796346128511E+06, 0.100524493045942218E+06, 0.100532404153307187E+06, 0.100538289704171490E+06, + 0.101276336252575435E+06, 0.101298080414544456E+06, 0.101321469561098274E+06, 0.101347127563797287E+06, 0.101375017595738012E+06, + 0.101402741686854177E+06, 0.101429372639699533E+06, 0.101455094154428705E+06, 0.101479936738935212E+06, 0.101503527247806051E+06, + 0.101525558424067625E+06, 0.101545795970329476E+06, 0.101564086253569083E+06, 0.101579860400036196E+06, 0.101592656313919491E+06, + 0.101604222243081458E+06, 0.101615370617936293E+06, 0.101626717204329048E+06, 0.101638824013794816E+06, 0.101652144675515985E+06, + 0.101666986413953739E+06, 0.101683491567268982E+06, 0.101699730410034434E+06, 0.101715308981035720E+06, 0.101731361440654102E+06, + 0.101748589449732390E+06, 0.101766824698764540E+06, 0.101785841910313233E+06, 0.101805411629659066E+06, 0.101825381837012450E+06, + 0.101846839764007193E+06, 0.101867081140515147E+06, 0.101882747001865355E+06, 0.101896903928888263E+06, 0.101909362288120537E+06, + 0.101920245934517079E+06, 0.101930058238641242E+06, 0.101941637442764200E+06, 0.101954785426383867E+06, 0.101968215450878924E+06, + 0.101984710778129607E+06, 0.102001549965592465E+06, 0.102018275841846422E+06, 0.102034683222590960E+06, 0.102052401989689286E+06, + 0.102069645673240069E+06, 0.102086007650836211E+06, 0.102103768116502732E+06, 0.102121127630333416E+06, 0.102135973777942898E+06, + 0.102147987937177197E+06, 0.102156601874315427E+06, 0.102161672760610920E+06, 0.102163612354316181E+06, 0.102165768392921964E+06, + 0.102167214431077227E+06, 0.102169260247518920E+06, 0.102170746287005837E+06, 0.102171480626503515E+06, 0.102171269145651808E+06, + 0.102170214520413967E+06, 0.102167256562754847E+06, 0.102162479386098232E+06, 0.102158371150627951E+06, 0.102155244448894475E+06, + 0.102152875264177637E+06, 0.102149492287714515E+06, 0.102145495391175835E+06, 0.102139392366010521E+06, 0.102131234162350753E+06, + 0.102121845495369198E+06, 0.102114444604303775E+06, 0.102106462190456019E+06, 0.102096364075651625E+06, 0.102082958297694466E+06, + 0.102064065966768365E+06, 0.102041420899050965E+06, 0.102016297892142000E+06, 0.101989261194259234E+06, 0.101963193901333740E+06, + 0.101934697827006079E+06, 0.101902018630394974E+06, 0.101863893013675159E+06, 0.101820477410193009E+06, 0.101774528513823985E+06, + 0.101724002882111308E+06, 0.101665763047983230E+06, 0.101603648801794363E+06, 0.101540096977050402E+06, 0.101478947206942044E+06, + 0.101415470097827929E+06, 0.101351609294201058E+06, 0.101289469642166499E+06, 0.101226537327552069E+06, 0.101158605139549531E+06, + 0.101091671283985226E+06, 0.101026501778518956E+06, 0.100963906622713315E+06, 0.100912235109733156E+06, 0.100875156448926034E+06, + 0.100858092199168052E+06, 0.100869196724643829E+06, 0.100906258192389359E+06, 0.100966643545000639E+06, 0.101044871026198045E+06, + 0.101126128294873750E+06, 0.101195519846174895E+06, 0.101255659962385485E+06, 0.101297057174446716E+06, 0.101328131549875659E+06, + 0.101358621176643224E+06, 0.101392239138290606E+06, 0.101427359701943147E+06, 0.101468500213009858E+06, 0.101510703720686288E+06, + 0.101550908563824967E+06, 0.101587166287520682E+06, 0.101619760493459311E+06, 0.101640375989610111E+06, 0.101647164822681414E+06, + 0.101640476796716728E+06, 0.101620225665346763E+06, 0.101589549071868416E+06, 0.101551044697311809E+06, 0.101511563682290900E+06, + 0.101475939268223781E+06, 0.101437438003792078E+06, 0.101392805212183681E+06, 0.101332702985176016E+06, 0.101262976832194923E+06, + 0.101186444126810515E+06, 0.101108333464266703E+06, 0.101034512676034472E+06, 0.100963849818957518E+06, 0.100898562106253885E+06, + 0.100842056459041982E+06, 0.100798749608423153E+06, 0.100767148703609448E+06, 0.100745027122654850E+06, 0.100731425417328996E+06, + 0.100731821012642424E+06, 0.100734592849697350E+06, 0.100733986756515151E+06, 0.100727026999971698E+06, 0.100711618349869153E+06, + 0.100683470368124676E+06, 0.100640250766840603E+06, 0.100586314437398818E+06, 0.100534961959011474E+06, 0.100490642055552060E+06, + 0.100456264076438296E+06, 0.100432289810027520E+06, 0.100419632142970615E+06, 0.100423645734029778E+06, 0.100432024957258123E+06, + 0.100442709528904365E+06, 0.100454138069834065E+06, 0.100469282754753091E+06, 0.100483179206656147E+06, 0.100494317659240289E+06, + 0.100501048475271105E+06, 0.100503737147053136E+06, 0.100502939624753810E+06, 0.100506864511892840E+06, 0.100510205922212830E+06, + 0.100511985008099888E+06, 0.101269395817640194E+06, 0.101293433370600033E+06, 0.101320709064215349E+06, 0.101350720216622271E+06, + 0.101381363474586935E+06, 0.101411901774678990E+06, 0.101441702408660596E+06, 0.101470286272251309E+06, 0.101497612121933402E+06, + 0.101523409436511720E+06, 0.101547349710601979E+06, 0.101569178391354450E+06, 0.101588382552830284E+06, 0.101604424454005639E+06, + 0.101617806496970152E+06, 0.101629009202247544E+06, 0.101639790736640862E+06, 0.101650653799515901E+06, 0.101662034467563892E+06, + 0.101674429962589624E+06, 0.101688184881771667E+06, 0.101701776789907686E+06, 0.101715632368359467E+06, 0.101731005396025357E+06, + 0.101747619021182472E+06, 0.101764475149160600E+06, 0.101782565451806455E+06, 0.101801692572504733E+06, 0.101821649291101741E+06, + 0.101844372908615100E+06, 0.101868013490669473E+06, 0.101890926735153276E+06, 0.101912734436730447E+06, 0.101930521333358061E+06, + 0.101945955049482625E+06, 0.101959618341155976E+06, 0.101973842306752718E+06, 0.101990092943988522E+06, 0.102006492234429417E+06, + 0.102022981199823858E+06, 0.102039845835770568E+06, 0.102059553276874620E+06, 0.102079331788742449E+06, 0.102099902964415654E+06, + 0.102120532959564909E+06, 0.102140448801236460E+06, 0.102159255793075747E+06, 0.102176879448503649E+06, 0.102194365868866342E+06, + 0.102211106097444455E+06, 0.102224803244153038E+06, 0.102234823789642047E+06, 0.102240968923527806E+06, 0.102243570541519104E+06, + 0.102243519688579676E+06, 0.102244750868611838E+06, 0.102246759472131700E+06, 0.102247988131721504E+06, 0.102248209161490959E+06, + 0.102247170632681489E+06, 0.102243247319650705E+06, 0.102236753031268512E+06, 0.102230982493940493E+06, 0.102226187707310237E+06, + 0.102222666096639834E+06, 0.102220567141386651E+06, 0.102219855956292071E+06, 0.102215511479397683E+06, 0.102208434908867741E+06, + 0.102198721169081880E+06, 0.102186789184960857E+06, 0.102174609249495770E+06, 0.102164550205667154E+06, 0.102152502370517235E+06, + 0.102137501608386214E+06, 0.102118919702411848E+06, 0.102095889999392573E+06, 0.102070100404917495E+06, 0.102041997958624415E+06, + 0.102012090612610089E+06, 0.101983710969351829E+06, 0.101953137519082840E+06, 0.101920734120792738E+06, 0.101883717982373681E+06, + 0.101842973734119500E+06, 0.101798428245916861E+06, 0.101747102066966778E+06, 0.101687602338869881E+06, 0.101624664318831565E+06, + 0.101559707946739305E+06, 0.101491658640950249E+06, 0.101420567276357397E+06, 0.101354355882096454E+06, 0.101289435543346961E+06, + 0.101224098024003702E+06, 0.101159952737485408E+06, 0.101097956680038245E+06, 0.101035227047009626E+06, 0.100981546520210177E+06, + 0.100939244847484995E+06, 0.100914786575781181E+06, 0.100915867157493747E+06, 0.100942559164277671E+06, 0.100993021366280096E+06, + 0.101062207385378511E+06, 0.101136754321606641E+06, 0.101205153055716102E+06, 0.101267549676815237E+06, 0.101315566331653798E+06, + 0.101356986952566978E+06, 0.101400109049254897E+06, 0.101444047042664242E+06, 0.101488513133860251E+06, 0.101534593023339607E+06, + 0.101578862893253303E+06, 0.101617989104461085E+06, 0.101651469070145307E+06, 0.101676676962902973E+06, 0.101688426206951568E+06, + 0.101690699198194692E+06, 0.101681585082600272E+06, 0.101660802224054729E+06, 0.101632322368388574E+06, 0.101602214382015110E+06, + 0.101577248018812563E+06, 0.101546577483431887E+06, 0.101509347660459607E+06, 0.101460277851145336E+06, 0.101400695177468675E+06, + 0.101333061941295062E+06, 0.101259893373003069E+06, 0.101185498750814251E+06, 0.101111060613673137E+06, 0.101038806163680754E+06, + 0.100970853556921851E+06, 0.100913205537255504E+06, 0.100868081185120318E+06, 0.100831661076531760E+06, 0.100803490881640522E+06, + 0.100782858759036229E+06, 0.100767010800255986E+06, 0.100760517927946479E+06, 0.100755313595541767E+06, 0.100745011420950410E+06, + 0.100727337942231010E+06, 0.100696437123156371E+06, 0.100650083823098379E+06, 0.100597278983266224E+06, 0.100548413676936747E+06, + 0.100507765427222563E+06, 0.100477948430878227E+06, 0.100463614942480534E+06, 0.100466404104801695E+06, 0.100473340681007379E+06, + 0.100482742216284692E+06, 0.100492637659898319E+06, 0.100501306119762710E+06, 0.100508155310289090E+06, 0.100517896956254641E+06, + 0.100523967020314361E+06, 0.100525551437862276E+06, 0.100522692726944748E+06, 0.100516008939190593E+06, 0.100506617021169775E+06, + 0.100504130401290677E+06, 0.100500855757604397E+06, 0.101259195015618316E+06, 0.101287394131248599E+06, 0.101318624387393094E+06, + 0.101351388311065471E+06, 0.101384848445848693E+06, 0.101418230695586331E+06, 0.101450864090695264E+06, 0.101482215379592511E+06, + 0.101512000328888942E+06, 0.101540081556911420E+06, 0.101565958007626774E+06, 0.101589239793549044E+06, 0.101609354590231524E+06, + 0.101626245425942194E+06, 0.101640116415258730E+06, 0.101651384047841973E+06, 0.101660624537901342E+06, 0.101669864682349900E+06, + 0.101680046518619303E+06, 0.101691016789836227E+06, 0.101701600972581538E+06, 0.101712344116073305E+06, 0.101724596034016693E+06, + 0.101738626214170567E+06, 0.101754578760972465E+06, 0.101772464174383247E+06, 0.101790289256249525E+06, 0.101809225095436283E+06, + 0.101831409086778760E+06, 0.101855713865937665E+06, 0.101880304248738481E+06, 0.101904708267321548E+06, 0.101928659429272666E+06, + 0.101952215895369998E+06, 0.101973129343184191E+06, 0.101990492819853054E+06, 0.102009155453432861E+06, 0.102028626658851339E+06, + 0.102048465714061036E+06, 0.102068480817810836E+06, 0.102088846460710702E+06, 0.102110232566220016E+06, 0.102133295641766570E+06, + 0.102157356921516912E+06, 0.102181314870907911E+06, 0.102204374004590238E+06, 0.102226000444488978E+06, 0.102246017656184413E+06, + 0.102265607213167954E+06, 0.102282589184103534E+06, 0.102298432423255334E+06, 0.102310352702715958E+06, 0.102317999706446251E+06, + 0.102321598850661234E+06, 0.102323515138576258E+06, 0.102323197704490987E+06, 0.102322212878332677E+06, 0.102323063816814887E+06, + 0.102322646091264614E+06, 0.102319439183542258E+06, 0.102312970911412354E+06, 0.102304997794601848E+06, 0.102296841478971372E+06, + 0.102291418130089238E+06, 0.102288360395478667E+06, 0.102288552237265947E+06, 0.102287701703575425E+06, 0.102284538846590702E+06, + 0.102276897495121520E+06, 0.102265740813761135E+06, 0.102252134571836228E+06, 0.102237131022390793E+06, 0.102221272996986561E+06, + 0.102206507054624482E+06, 0.102189132554294789E+06, 0.102168602609417649E+06, 0.102145544389345145E+06, 0.102118566149667124E+06, + 0.102089083952633140E+06, 0.102057798140960163E+06, 0.102026969995698295E+06, 0.101997794023706476E+06, 0.101966743922712252E+06, + 0.101933057167765714E+06, 0.101896592945729586E+06, 0.101857371791885336E+06, 0.101815607416803119E+06, 0.101763023383776948E+06, + 0.101702407436462090E+06, 0.101635116047538351E+06, 0.101562945833011370E+06, 0.101485822606547168E+06, 0.101411005039628857E+06, + 0.101339835091662317E+06, 0.101272689532459044E+06, 0.101210368076346276E+06, 0.101154473004817381E+06, 0.101097829928473817E+06, + 0.101048482059940754E+06, 0.101007048910648111E+06, 0.100979473833055905E+06, 0.100973447727585182E+06, 0.100990584221201716E+06, + 0.101029960997994902E+06, 0.101087951257948895E+06, 0.101153695183268181E+06, 0.101219018003879406E+06, 0.101282293838312820E+06, + 0.101338465984178547E+06, 0.101391368230947162E+06, 0.101446772222011277E+06, 0.101500085973176334E+06, 0.101550853250171887E+06, + 0.101598573456663202E+06, 0.101641988898670184E+06, 0.101679214186169236E+06, 0.101710098564568776E+06, 0.101732780885386266E+06, + 0.101743179226637279E+06, 0.101740055966295447E+06, 0.101722994425650759E+06, 0.101700469255730888E+06, 0.101674123165238838E+06, + 0.101653160060864204E+06, 0.101631596453806415E+06, 0.101607075787893336E+06, 0.101574486424828559E+06, 0.101526976419999381E+06, + 0.101469612332252946E+06, 0.101404225279481514E+06, 0.101336714868594907E+06, 0.101267916935403031E+06, 0.101195492908750399E+06, + 0.101123687793417601E+06, 0.101058751346724224E+06, 0.101000171416406578E+06, 0.100947653236097554E+06, 0.100904324965127365E+06, + 0.100869022485961759E+06, 0.100838631774334179E+06, 0.100814997040174785E+06, 0.100796371893838630E+06, 0.100782994420463059E+06, + 0.100767931078048772E+06, 0.100738709347425858E+06, 0.100699551218149616E+06, 0.100657848886243373E+06, 0.100613930496747955E+06, + 0.100570328091677089E+06, 0.100536417956577148E+06, 0.100522106220241680E+06, 0.100523981788664518E+06, 0.100534576173254580E+06, + 0.100544607428678122E+06, 0.100555100707554739E+06, 0.100564477570051735E+06, 0.100571044680449282E+06, 0.100573984997784108E+06, + 0.100574098036419746E+06, 0.100574969682196417E+06, 0.100570985693230745E+06, 0.100562235725965831E+06, 0.100549403090203457E+06, + 0.100533663303323410E+06, 0.100514985690890928E+06, 0.100501506969102309E+06, 0.101247028543607215E+06, 0.101279000272323727E+06, + 0.101313044900483452E+06, 0.101348706117229129E+06, 0.101385099864543183E+06, 0.101421406335684835E+06, 0.101456908730823867E+06, + 0.101491027169870344E+06, 0.101523346965489472E+06, 0.101553641131603319E+06, 0.101581591041353255E+06, 0.101606456037034135E+06, + 0.101627802489960915E+06, 0.101645553091339185E+06, 0.101659871959589625E+06, 0.101671125963614424E+06, 0.101679833672676948E+06, + 0.101686600287344059E+06, 0.101693249899754504E+06, 0.101700828771449567E+06, 0.101708214676399468E+06, 0.101716786788727914E+06, + 0.101726994188702083E+06, 0.101739189978545895E+06, 0.101753597010140846E+06, 0.101770294478413707E+06, 0.101789229323241438E+06, + 0.101810439881563492E+06, 0.101833551125124432E+06, 0.101857745342370516E+06, 0.101882520275840274E+06, 0.101907489508364233E+06, + 0.101932461599410264E+06, 0.101957552146214075E+06, 0.101983305456973438E+06, 0.102008579834297911E+06, 0.102030494060992147E+06, + 0.102053548115608966E+06, 0.102077104427164624E+06, 0.102100783210934751E+06, 0.102124584361851768E+06, 0.102151618960978216E+06, + 0.102178487299050277E+06, 0.102203837934088209E+06, 0.102231789811787370E+06, 0.102258565924026567E+06, 0.102283435612743153E+06, + 0.102308168911264584E+06, 0.102331519967324959E+06, 0.102351306090243161E+06, 0.102367344163488393E+06, 0.102380956720203612E+06, + 0.102390540926741916E+06, 0.102396561280422888E+06, 0.102399644414793191E+06, 0.102399967479044542E+06, 0.102398097050173761E+06, + 0.102394877934586664E+06, 0.102392579382061362E+06, 0.102387437885771593E+06, 0.102380474134807795E+06, 0.102372089234619867E+06, + 0.102363087167973557E+06, 0.102355720695108947E+06, 0.102355336216227777E+06, 0.102355244528026058E+06, 0.102353863384518510E+06, + 0.102349945815737563E+06, 0.102342442703922468E+06, 0.102329934370864139E+06, 0.102314612359457431E+06, 0.102297370131901000E+06, + 0.102278388120427626E+06, 0.102257491551240819E+06, 0.102236307907230104E+06, 0.102213097347429662E+06, 0.102187800432568954E+06, + 0.102160229919730293E+06, 0.102129097981842890E+06, 0.102096889363146300E+06, 0.102063827052134482E+06, 0.102031184486610946E+06, + 0.101999264622467439E+06, 0.101966221591490219E+06, 0.101931754343580265E+06, 0.101897700536754972E+06, 0.101861993529889558E+06, + 0.101819636716650479E+06, 0.101763615901241341E+06, 0.101697976370488861E+06, 0.101620393736143524E+06, 0.101535102872161384E+06, + 0.101449253069692393E+06, 0.101374420264238244E+06, 0.101306501858255855E+06, 0.101247778577939956E+06, 0.101198381473636808E+06, + 0.101152064836353820E+06, 0.101110344624142366E+06, 0.101075281561938828E+06, 0.101049407554255304E+06, 0.101040768998780331E+06, + 0.101052199471517510E+06, 0.101082392815890635E+06, 0.101129144157533199E+06, 0.101184092780294726E+06, 0.101243772906750455E+06, + 0.101307121999288836E+06, 0.101369991062098430E+06, 0.101433698297000723E+06, 0.101498903828178067E+06, 0.101560474018943947E+06, + 0.101615857050411636E+06, 0.101665138596523073E+06, 0.101705590047241931E+06, 0.101738943786932854E+06, 0.101767114003134644E+06, + 0.101789192730629773E+06, 0.101799147989736230E+06, 0.101794735430608300E+06, 0.101777146397531964E+06, 0.101750372193384130E+06, + 0.101723141667504169E+06, 0.101702833712477848E+06, 0.101682678205011733E+06, 0.101660302359832262E+06, 0.101630633216063026E+06, + 0.101590584748240784E+06, 0.101537939783765964E+06, 0.101477184750419154E+06, 0.101412613988421668E+06, 0.101346432956553763E+06, + 0.101280354991399392E+06, 0.101215950742003886E+06, 0.101152407700542390E+06, 0.101091630971862964E+06, 0.101034381306262483E+06, + 0.100980581565512359E+06, 0.100932607474756849E+06, 0.100894526231033058E+06, 0.100863524006721316E+06, 0.100837940986693153E+06, + 0.100815616712752075E+06, 0.100783831314269482E+06, 0.100747340055464098E+06, 0.100708359519305974E+06, 0.100669700349442544E+06, + 0.100634134123292621E+06, 0.100602055798299742E+06, 0.100591037034284673E+06, 0.100590664657868474E+06, 0.100599127748830913E+06, + 0.100614596189110918E+06, 0.100634150489947802E+06, 0.100646345748706677E+06, 0.100655865724535965E+06, 0.100661116257080008E+06, + 0.100661028163947834E+06, 0.100655523835145024E+06, 0.100646490601253885E+06, 0.100636711851892294E+06, 0.100621894936014534E+06, + 0.100602810704563395E+06, 0.100576368488764041E+06, 0.100548286166395032E+06, 0.100522977180969814E+06, 0.101228903510937074E+06, + 0.101265781795862422E+06, 0.101303509185958625E+06, 0.101342284425688282E+06, 0.101381796177970391E+06, 0.101421170386188518E+06, + 0.101459636817675681E+06, 0.101496562449942183E+06, 0.101531479594885182E+06, 0.101564960000747014E+06, 0.101594803080993937E+06, + 0.101621355790812595E+06, 0.101644027594565501E+06, 0.101662677874236993E+06, 0.101677441926593165E+06, 0.101688651352830973E+06, + 0.101696785059940390E+06, 0.101702406683447451E+06, 0.101704728868073435E+06, 0.101705248359237783E+06, 0.101710033061244059E+06, + 0.101715986265950589E+06, 0.101723653592966657E+06, 0.101733480291010681E+06, 0.101745772459652580E+06, 0.101760677660607515E+06, + 0.101780220410703594E+06, 0.101803075598452182E+06, 0.101826488604444239E+06, 0.101849820362239523E+06, 0.101873892351949500E+06, + 0.101898378960095564E+06, 0.101923130766489805E+06, 0.101948518897807691E+06, 0.101975696258303404E+06, 0.102004061929304342E+06, + 0.102033460145040677E+06, 0.102061651327409054E+06, 0.102089414327740989E+06, 0.102117077133701037E+06, 0.102147883501053424E+06, + 0.102180718015203005E+06, 0.102212493723892243E+06, 0.102242559046992334E+06, 0.102271049350391899E+06, 0.102300915058795246E+06, + 0.102331227250506359E+06, 0.102361003675242988E+06, 0.102387797529886448E+06, 0.102410738749007287E+06, 0.102429543001075872E+06, + 0.102444601309541205E+06, 0.102455934113666241E+06, 0.102463826248762096E+06, 0.102468461440316110E+06, 0.102469870975073049E+06, + 0.102468446450288320E+06, 0.102464798290121791E+06, 0.102458449322550092E+06, 0.102451735051873286E+06, 0.102444849067868476E+06, + 0.102436636367539046E+06, 0.102428988993985171E+06, 0.102425331914020266E+06, 0.102421620005855337E+06, 0.102419560924305013E+06, + 0.102417115927208128E+06, 0.102411283378863518E+06, 0.102401124644854805E+06, 0.102388294546935547E+06, 0.102372130138911380E+06, + 0.102352872703988251E+06, 0.102330900792506814E+06, 0.102305906692453034E+06, 0.102278836660343848E+06, 0.102251891886031619E+06, + 0.102223352000414103E+06, 0.102193067106830058E+06, 0.102161078903831076E+06, 0.102125912821954276E+06, 0.102089510678556544E+06, + 0.102052507421496150E+06, 0.102015228902546209E+06, 0.101978931284532373E+06, 0.101944546111379605E+06, 0.101912474602996255E+06, + 0.101881505541306557E+06, 0.101847220983536259E+06, 0.101796545763435774E+06, 0.101731194445780915E+06, 0.101655521374345393E+06, + 0.101570254785904996E+06, 0.101481522317187802E+06, 0.101401331116195521E+06, 0.101332141668882890E+06, 0.101273993470810659E+06, + 0.101228638656778901E+06, 0.101190604276845741E+06, 0.101158196197344718E+06, 0.101133936056759660E+06, 0.101117981664703751E+06, + 0.101116933850947476E+06, 0.101131399795691948E+06, 0.101160604644423380E+06, 0.101201518443580746E+06, 0.101248903707713456E+06, + 0.101300592974865489E+06, 0.101357214090897702E+06, 0.101418441744321666E+06, 0.101485557443350626E+06, 0.101555445746166064E+06, + 0.101621303501475879E+06, 0.101679228518906544E+06, 0.101728241686716501E+06, 0.101766854072509333E+06, 0.101798436487011495E+06, + 0.101826906634104991E+06, 0.101847291990324695E+06, 0.101856878275200172E+06, 0.101852227620230362E+06, 0.101834698267214306E+06, + 0.101809239675292964E+06, 0.101781969547875371E+06, 0.101755152512939356E+06, 0.101732931589822008E+06, 0.101712653074247995E+06, + 0.101684830999865546E+06, 0.101647239704296619E+06, 0.101599826041378212E+06, 0.101544653396053778E+06, 0.101483464700333992E+06, + 0.101420696082338764E+06, 0.101361355157000173E+06, 0.101303077019503457E+06, 0.101242949922489031E+06, 0.101180470229611776E+06, + 0.101117365765681796E+06, 0.101054059738264114E+06, 0.100995066688862426E+06, 0.100946512981860345E+06, 0.100908291761953325E+06, + 0.100873905402216697E+06, 0.100835045455127693E+06, 0.100798873170272855E+06, 0.100762695696108858E+06, 0.100726025871425081E+06, + 0.100692734909454986E+06, 0.100668902864702948E+06, 0.100663213502720391E+06, 0.100664621390201341E+06, 0.100671374502519597E+06, + 0.100685680453359950E+06, 0.100705798123986984E+06, 0.100728995575579524E+06, 0.100751658112675097E+06, 0.100762519462763623E+06, + 0.100767027529124854E+06, 0.100764553224004907E+06, 0.100755187738630775E+06, 0.100739605979863540E+06, 0.100720551089520799E+06, + 0.100698313533178705E+06, 0.100666865056198847E+06, 0.100634031483894869E+06, 0.100601785153826728E+06, 0.100571987820731039E+06, + 0.101206374045435979E+06, 0.101245886159229500E+06, 0.101288633787391896E+06, 0.101331822184275137E+06, 0.101374720391458119E+06, + 0.101417383823794662E+06, 0.101458981013573735E+06, 0.101498818874093005E+06, 0.101538685205643225E+06, 0.101575422468180957E+06, + 0.101607594064004836E+06, 0.101634787525358639E+06, 0.101658391829702683E+06, 0.101677992927276675E+06, 0.101693216382147584E+06, + 0.101704372381742840E+06, 0.101711917535928253E+06, 0.101714961207000641E+06, 0.101714465004361307E+06, 0.101712311040969114E+06, + 0.101709673671424040E+06, 0.101711218999391320E+06, 0.101715783535561670E+06, 0.101722657082666818E+06, 0.101732238893442816E+06, + 0.101747062236834958E+06, 0.101766365174287086E+06, 0.101787109475394507E+06, 0.101808925705709073E+06, 0.101831553485340701E+06, + 0.101854101136956699E+06, 0.101876977318564983E+06, 0.101900071328279475E+06, 0.101924414875452247E+06, 0.101951462468272264E+06, + 0.101980975232741199E+06, 0.102012836826491402E+06, 0.102047258491401968E+06, 0.102083474297558190E+06, 0.102117469380506620E+06, + 0.102154658530511195E+06, 0.102192659983700083E+06, 0.102229894335694480E+06, 0.102265384438205918E+06, 0.102298947455958070E+06, + 0.102332733340180333E+06, 0.102366161911789881E+06, 0.102400223366988168E+06, 0.102430989231899657E+06, 0.102457385343324306E+06, + 0.102478953671150099E+06, 0.102497140263958892E+06, 0.102511039792962809E+06, 0.102520299291871444E+06, 0.102526846630820248E+06, + 0.102529945588383314E+06, 0.102529752833756676E+06, 0.102527108906249603E+06, 0.102521410242623388E+06, 0.102513405849115865E+06, + 0.102504764193898140E+06, 0.102498120743343170E+06, 0.102494756241843366E+06, 0.102491412904970945E+06, 0.102487349910826408E+06, + 0.102482003045019752E+06, 0.102474975478072651E+06, 0.102465362858837878E+06, 0.102453624922867719E+06, 0.102439388282147716E+06, + 0.102422313370157048E+06, 0.102401857750208626E+06, 0.102377162061003954E+06, 0.102349188460773526E+06, 0.102318424237125233E+06, + 0.102285363297180986E+06, 0.102252385208010586E+06, 0.102218029776633513E+06, 0.102181810380545387E+06, 0.102143591228429039E+06, + 0.102102341867038209E+06, 0.102057770995654748E+06, 0.102012593759546347E+06, 0.101970748503609808E+06, 0.101933725108693834E+06, + 0.101900789684666524E+06, 0.101867979870800904E+06, 0.101834235978935918E+06, 0.101794954568116285E+06, 0.101739484665823096E+06, + 0.101671789500483821E+06, 0.101593418617286006E+06, 0.101506698290483502E+06, 0.101422237896336897E+06, 0.101350833220772416E+06, + 0.101290575286891341E+06, 0.101248402171152557E+06, 0.101218529092999917E+06, 0.101197447450399108E+06, 0.101187612570890138E+06, + 0.101185871864261528E+06, 0.101196499134288402E+06, 0.101218353571942265E+06, 0.101249194623964548E+06, 0.101286372345386742E+06, + 0.101326464875508391E+06, 0.101369986766969960E+06, 0.101419749853660280E+06, 0.101476722498559480E+06, 0.101542829739890207E+06, + 0.101612522924097197E+06, 0.101678721249810798E+06, 0.101737575823144638E+06, 0.101785395492746917E+06, 0.101823368561408701E+06, + 0.101856014056084430E+06, 0.101884313206989173E+06, 0.101903695929922687E+06, 0.101912969317636380E+06, 0.101908832298462992E+06, + 0.101892237038585794E+06, 0.101866203497664581E+06, 0.101837081196005645E+06, 0.101809606048398258E+06, 0.101786840568731568E+06, + 0.101762564033379982E+06, 0.101734680154915579E+06, 0.101696592635540685E+06, 0.101650662453849189E+06, 0.101599162120752633E+06, + 0.101544343001196743E+06, 0.101488647544765059E+06, 0.101433089123172278E+06, 0.101377125096785036E+06, 0.101320042947392227E+06, + 0.101256674805424394E+06, 0.101187987297748215E+06, 0.101120641997896339E+06, 0.101056247927954246E+06, 0.100996331972370142E+06, + 0.100943232428022544E+06, 0.100895353842840079E+06, 0.100852555312220196E+06, 0.100815337064243067E+06, 0.100783799781542155E+06, + 0.100753868748835012E+06, 0.100736637044447663E+06, 0.100730650096307727E+06, 0.100733232093861763E+06, 0.100743913291446443E+06, + 0.100758835470579754E+06, 0.100778259316407013E+06, 0.100802567061591370E+06, 0.100828283762383522E+06, 0.100855135515023372E+06, + 0.100877691529341333E+06, 0.100882602938691591E+06, 0.100878787688210650E+06, 0.100866582130667157E+06, 0.100846949291204379E+06, + 0.100815418882725819E+06, 0.100780247866813195E+06, 0.100745087245795497E+06, 0.100709396490561645E+06, 0.100675020472311327E+06, + 0.100643622948665085E+06, 0.101179250397845899E+06, 0.101221149498052953E+06, 0.101266816356343159E+06, 0.101315335097978430E+06, + 0.101363838550262313E+06, 0.101410108301517408E+06, 0.101455090720967710E+06, 0.101501448789654576E+06, 0.101545139345543692E+06, + 0.101584741389399278E+06, 0.101619452976458153E+06, 0.101648772604086349E+06, 0.101672509578882498E+06, 0.101691865395895249E+06, + 0.101707555892752804E+06, 0.101718643945821881E+06, 0.101724156365132570E+06, 0.101724941937858879E+06, 0.101722568702130273E+06, + 0.101718069834871334E+06, 0.101712578971246767E+06, 0.101707223787895346E+06, 0.101704839789861668E+06, 0.101708104689497137E+06, + 0.101716865742578157E+06, 0.101731053443752840E+06, 0.101746952161869922E+06, 0.101764257279303914E+06, 0.101782706182959490E+06, + 0.101802123848941148E+06, 0.101822482313672357E+06, 0.101842936616784311E+06, 0.101860934973268697E+06, 0.101882854305976114E+06, + 0.101908552344231415E+06, 0.101937813400383588E+06, 0.101970499454458186E+06, 0.102006741063404974E+06, 0.102048298491096837E+06, + 0.102094559383243701E+06, 0.102138864116678858E+06, 0.102182980858368159E+06, 0.102226517702417070E+06, 0.102268076174545422E+06, + 0.102309052474061144E+06, 0.102352381321886001E+06, 0.102391102131696549E+06, 0.102425199358256839E+06, 0.102458541492672259E+06, + 0.102488862618142084E+06, 0.102514290917361213E+06, 0.102535791702452596E+06, 0.102552503476764061E+06, 0.102564543232835902E+06, + 0.102572720164328770E+06, 0.102578198051091356E+06, 0.102580323990135614E+06, 0.102579265394634727E+06, 0.102574962647335808E+06, + 0.102568059504060235E+06, 0.102560319977754334E+06, 0.102556118504191676E+06, 0.102553057067685237E+06, 0.102550069919232395E+06, + 0.102545676460258372E+06, 0.102538438321503912E+06, 0.102526558414006213E+06, 0.102512331043456594E+06, 0.102498934035030790E+06, + 0.102483367837719314E+06, 0.102465528571415576E+06, 0.102444019300123240E+06, 0.102417539855634386E+06, 0.102386941153851396E+06, + 0.102352803854769852E+06, 0.102315908735629360E+06, 0.102276253891919623E+06, 0.102235698643740441E+06, 0.102193754813942534E+06, + 0.102149197092732255E+06, 0.102100466547888893E+06, 0.102048387340808171E+06, 0.101995636407850165E+06, 0.101944784700201388E+06, + 0.101899202783926419E+06, 0.101857839910913841E+06, 0.101822276933475470E+06, 0.101792037001853430E+06, 0.101761456733915693E+06, + 0.101723124817417673E+06, 0.101667540093368385E+06, 0.101602052196997916E+06, 0.101524286713149719E+06, 0.101443448254745468E+06, + 0.101372151184877337E+06, 0.101312547429677303E+06, 0.101270741733953284E+06, 0.101245862300696550E+06, 0.101237403284129323E+06, + 0.101240955267019526E+06, 0.101253727619962054E+06, 0.101276647528408124E+06, 0.101307289777398546E+06, 0.101342096503173772E+06, + 0.101377440256415284E+06, 0.101410859947128090E+06, 0.101445291144028568E+06, 0.101485896954639960E+06, 0.101536034363702740E+06, + 0.101598275532425832E+06, 0.101665271864468625E+06, 0.101730455163620383E+06, 0.101789053839460757E+06, 0.101836451975671342E+06, + 0.101875114449402914E+06, 0.101909841821580325E+06, 0.101937388731349492E+06, 0.101957316621074744E+06, 0.101965726747313485E+06, + 0.101960066223235612E+06, 0.101941333444338321E+06, 0.101914153314528972E+06, 0.101884034639169928E+06, 0.101858023754631969E+06, + 0.101832589987368483E+06, 0.101805510097226972E+06, 0.101772567651719524E+06, 0.101733410070028302E+06, 0.101687946616198518E+06, + 0.101638303259297347E+06, 0.101588584508090702E+06, 0.101540424262528119E+06, 0.101488738611497931E+06, 0.101435260593399056E+06, + 0.101375735107437940E+06, 0.101312542555417007E+06, 0.101246134029601395E+06, 0.101177277643560679E+06, 0.101109587858444022E+06, + 0.101039831433180021E+06, 0.100972865937903305E+06, 0.100917142934489922E+06, 0.100872742649287640E+06, 0.100836992191858386E+06, + 0.100811317083979215E+06, 0.100803167641532855E+06, 0.100798970012812904E+06, 0.100800172827859802E+06, 0.100809159254650964E+06, + 0.100825090132632613E+06, 0.100846063732092007E+06, 0.100868925096583727E+06, 0.100895209549142979E+06, 0.100924583482422255E+06, + 0.100954767114643226E+06, 0.100982762726865476E+06, 0.101000126944911273E+06, 0.100996312696391295E+06, 0.100980278059754797E+06, + 0.100948675007578538E+06, 0.100912131109198177E+06, 0.100873893055713954E+06, 0.100836895686632663E+06, 0.100800840190763440E+06, + 0.100766824999287084E+06, 0.100736390306808840E+06, 0.101147547908848283E+06, 0.101191548413107710E+06, 0.101239813004555443E+06, + 0.101291456639815791E+06, 0.101345618815623297E+06, 0.101399848017628567E+06, 0.101452120246013321E+06, 0.101502531147260263E+06, + 0.101549713655955595E+06, 0.101592520742368200E+06, 0.101630069264663078E+06, 0.101661769202013544E+06, 0.101687336031179409E+06, + 0.101706783718499020E+06, 0.101720752729463624E+06, 0.101730352171304155E+06, 0.101734303682047248E+06, 0.101733803712048772E+06, + 0.101729673880940856E+06, 0.101722933683541196E+06, 0.101714707079396278E+06, 0.101706119415995257E+06, 0.101698183703231305E+06, + 0.101694443401773460E+06, 0.101701997679200067E+06, 0.101711622212974413E+06, 0.101722702839184887E+06, 0.101735051927557608E+06, + 0.101748506288605597E+06, 0.101762966981866150E+06, 0.101778437616403622E+06, 0.101789127619601830E+06, 0.101803967912821841E+06, + 0.101822592115495441E+06, 0.101845777685417066E+06, 0.101873478314957349E+06, 0.101905482242767845E+06, 0.101942888324591171E+06, + 0.101988404530944768E+06, 0.102038702733784274E+06, 0.102092474242398283E+06, 0.102148032734040069E+06, 0.102199248899464394E+06, + 0.102248915596860126E+06, 0.102302591874664358E+06, 0.102352656965704402E+06, 0.102397731646050539E+06, 0.102437448450124619E+06, + 0.102472449474120032E+06, 0.102503421423363616E+06, 0.102532064367287210E+06, 0.102556777288245488E+06, 0.102576671821794167E+06, + 0.102591572855277176E+06, 0.102602228863800672E+06, 0.102612279279788083E+06, 0.102616851593614643E+06, 0.102617893333235930E+06, + 0.102615765691172550E+06, 0.102610441888248854E+06, 0.102607301386114821E+06, 0.102603993592939412E+06, 0.102600663908017392E+06, + 0.102597488187445881E+06, 0.102592493791941044E+06, 0.102582466666192224E+06, 0.102569826273933562E+06, 0.102554713868615829E+06, + 0.102537648672080177E+06, 0.102521039168448478E+06, 0.102503173475915130E+06, 0.102480635537613605E+06, 0.102452652573625455E+06, + 0.102419350874903001E+06, 0.102382346399272821E+06, 0.102341612134553201E+06, 0.102297029075732309E+06, 0.102248948564059086E+06, + 0.102198720030139870E+06, 0.102145758870677353E+06, 0.102088950595530157E+06, 0.102029051584965782E+06, 0.101967199226732264E+06, + 0.101903210271600808E+06, 0.101842958311824055E+06, 0.101794271532633502E+06, 0.101756533651972539E+06, 0.101727257623922851E+06, + 0.101703822910323244E+06, 0.101679786232533574E+06, 0.101644516695705548E+06, 0.101595106427152612E+06, 0.101536504683202511E+06, + 0.101467865301457467E+06, 0.101405006154835806E+06, 0.101354849767181862E+06, 0.101317686662273423E+06, 0.101296595665381508E+06, + 0.101290414819946876E+06, 0.101298257504082198E+06, 0.101319018351106934E+06, 0.101351193190044753E+06, 0.101389882715506814E+06, + 0.101429774758297252E+06, 0.101465327153650665E+06, 0.101493697248690820E+06, 0.101519475777882981E+06, 0.101549278536429629E+06, + 0.101589674862889879E+06, 0.101644437539602266E+06, 0.101707639653092512E+06, 0.101773446880721283E+06, 0.101832627929812195E+06, + 0.101881326017934320E+06, 0.101922991773475122E+06, 0.101958375717528819E+06, 0.101986274837340650E+06, 0.102005491030983016E+06, + 0.102011686815100737E+06, 0.102002038930530602E+06, 0.101979844500374034E+06, 0.101949713592872038E+06, 0.101919794688969385E+06, + 0.101890097820657014E+06, 0.101860915631872151E+06, 0.101828511020572609E+06, 0.101792400720458652E+06, 0.101751700978283421E+06, + 0.101705424659848417E+06, 0.101656344874022790E+06, 0.101609238060088639E+06, 0.101564980684227325E+06, 0.101522208207649019E+06, + 0.101469412985671690E+06, 0.101412347630207965E+06, 0.101351832558558221E+06, 0.101288709894130297E+06, 0.101222062151738224E+06, + 0.101149874038784459E+06, 0.101078002130177440E+06, 0.101009088984990114E+06, 0.100945974661293003E+06, 0.100898762938745946E+06, + 0.100870562536964586E+06, 0.100856855516523385E+06, 0.100855450035140704E+06, 0.100864081929396765E+06, 0.100872263570757554E+06, + 0.100886283473303847E+06, 0.100905686340654982E+06, 0.100926632293872623E+06, 0.100951268783756459E+06, 0.100980364613721176E+06, + 0.101012594678026580E+06, 0.101045448177269616E+06, 0.101076054483113505E+06, 0.101101140326098612E+06, 0.101100763828566429E+06, + 0.101077946327603815E+06, 0.101047158711316821E+06, 0.101011715736067359E+06, 0.100974871631289832E+06, 0.100939265943285602E+06, + 0.100905758734950185E+06, 0.100874978764764266E+06, 0.100855175471442562E+06, 0.101111520792912168E+06, 0.101157325849907211E+06, + 0.101207855335016298E+06, 0.101262234561872421E+06, 0.101320453238625094E+06, 0.101383611932041124E+06, 0.101446021580746979E+06, + 0.101500639373333164E+06, 0.101551782605323038E+06, 0.101598222486408573E+06, 0.101638989420395039E+06, 0.101673403579343765E+06, + 0.101701089807805052E+06, 0.101721974472240297E+06, 0.101735419880771398E+06, 0.101741369945130849E+06, 0.101743897808629612E+06, + 0.101742267006478505E+06, 0.101736494037811004E+06, 0.101727612235604785E+06, 0.101716766590943007E+06, 0.101705114503249541E+06, + 0.101695691907190470E+06, 0.101691082917827283E+06, 0.101688492565094857E+06, 0.101689693834759819E+06, 0.101694319117847946E+06, + 0.101699984888099891E+06, 0.101706624023230441E+06, 0.101714209290037295E+06, 0.101714886189053461E+06, 0.101718477607258348E+06, + 0.101727166805334680E+06, 0.101741942812281210E+06, 0.101762884060961267E+06, 0.101787922016469936E+06, 0.101818124304470504E+06, + 0.101856144652932824E+06, 0.101902274632393572E+06, 0.101955219215111909E+06, 0.102013545239481187E+06, 0.102075989637765349E+06, + 0.102141825734524129E+06, 0.102209412008951840E+06, 0.102271101455590702E+06, 0.102328905451065119E+06, 0.102380997966748007E+06, + 0.102426592472327698E+06, 0.102466679017069036E+06, 0.102502492265674373E+06, 0.102531828163015132E+06, 0.102557693337524877E+06, + 0.102581562159738140E+06, 0.102599817594232780E+06, 0.102617360456048831E+06, 0.102630533755776734E+06, 0.102638413398652745E+06, + 0.102641585059017671E+06, 0.102641643207641609E+06, 0.102639909103140890E+06, 0.102637870663539637E+06, 0.102635390209430159E+06, + 0.102632452553768846E+06, 0.102629055188468876E+06, 0.102622883797323870E+06, 0.102613396703866238E+06, 0.102601167982128070E+06, + 0.102586228500797864E+06, 0.102570641502416736E+06, 0.102554342163336842E+06, 0.102534088219572732E+06, 0.102511041429401579E+06, + 0.102481963706129696E+06, 0.102447121630716501E+06, 0.102407091340582192E+06, 0.102362401740888643E+06, 0.102313427305605088E+06, + 0.102259555941640690E+06, 0.102201038299707958E+06, 0.102138783904224241E+06, 0.102073015852343407E+06, 0.102003417942998523E+06, + 0.101925865118624715E+06, 0.101850155355117560E+06, 0.101780650482480312E+06, 0.101721528392427077E+06, 0.101678592950691062E+06, + 0.101649600593305571E+06, 0.101630406458717945E+06, 0.101617445713840047E+06, 0.101603733747246617E+06, 0.101577149951594518E+06, + 0.101547743780961551E+06, 0.101507738128132827E+06, 0.101462001737325336E+06, 0.101417253659172507E+06, 0.101379673252643261E+06, + 0.101354722198341828E+06, 0.101344083982961922E+06, 0.101350090319994677E+06, 0.101372932240478462E+06, 0.101408874721438551E+06, + 0.101453217513073498E+06, 0.101497802352511892E+06, 0.101536224569247846E+06, 0.101563019361021943E+06, 0.101582620293203203E+06, + 0.101603379870639314E+06, 0.101634664417891821E+06, 0.101681132562699248E+06, 0.101739502773358443E+06, 0.101803164120008223E+06, + 0.101863683127456912E+06, 0.101917393438978630E+06, 0.101963558171047160E+06, 0.101999276960053059E+06, 0.102027732037148526E+06, + 0.102044731025719229E+06, 0.102045431775095058E+06, 0.102030705033808161E+06, 0.102003666856825570E+06, 0.101970343646836016E+06, + 0.101935360181740762E+06, 0.101900669036632447E+06, 0.101865688643875081E+06, 0.101829409780582253E+06, 0.101790176042387873E+06, + 0.101745151599830831E+06, 0.101696472660873420E+06, 0.101648060959889524E+06, 0.101603410369994090E+06, 0.101561835852602439E+06, + 0.101521855998799132E+06, 0.101482037163334768E+06, 0.101431340410975914E+06, 0.101375699870779092E+06, 0.101314779976223654E+06, + 0.101251712502201844E+06, 0.101185784883436660E+06, 0.101116517257030340E+06, 0.101049883113580014E+06, 0.100989563385332454E+06, + 0.100941765093850961E+06, 0.100916306862933794E+06, 0.100906980056579865E+06, 0.100910197269982164E+06, 0.100922958161069488E+06, + 0.100941314458770998E+06, 0.100957519326146881E+06, 0.100976831072572779E+06, 0.100999605735160003E+06, 0.101025582535843947E+06, + 0.101054164787686663E+06, 0.101087890451072817E+06, 0.101122283479534453E+06, 0.101149350938674921E+06, 0.101166873408313593E+06, + 0.101177821152178367E+06, 0.101167655432610394E+06, 0.101141220410113790E+06, 0.101110321588459745E+06, 0.101078361586283063E+06, + 0.101047967121170557E+06, 0.101023734539325480E+06, 0.101008383694813747E+06, 0.100996781521485842E+06, 0.101071681166949435E+06, + 0.101119012263039112E+06, 0.101171496350808069E+06, 0.101230050130927513E+06, 0.101294972556584413E+06, 0.101361718999132645E+06, + 0.101428515451916319E+06, 0.101493595145979649E+06, 0.101550612440880213E+06, 0.101601210858501552E+06, 0.101645666556374214E+06, + 0.101683206121268653E+06, 0.101713363718937704E+06, 0.101736031118329251E+06, 0.101750515944612693E+06, 0.101757053628392736E+06, + 0.101756382807271759E+06, 0.101751079781741602E+06, 0.101743715819909994E+06, 0.101732729519215369E+06, 0.101719316686245147E+06, + 0.101706213959027606E+06, 0.101695984176562313E+06, 0.101686190677071994E+06, 0.101677301261342131E+06, 0.101669511529871947E+06, + 0.101662644903393695E+06, 0.101659294762388396E+06, 0.101657066043437371E+06, 0.101647001805639928E+06, 0.101637372304767356E+06, + 0.101632049251178221E+06, 0.101632583495971994E+06, 0.101640198281276986E+06, 0.101655810259860154E+06, 0.101680028481804649E+06, + 0.101706638821039131E+06, 0.101742286180341995E+06, 0.101788109417502055E+06, 0.101842726554478882E+06, 0.101904504042995715E+06, + 0.101971839066862056E+06, 0.102051325178151485E+06, 0.102132183694597014E+06, 0.102209672996832567E+06, 0.102278148214885616E+06, + 0.102338448224708001E+06, 0.102390873033725249E+06, 0.102438626144456910E+06, 0.102479259552033545E+06, 0.102513206393975473E+06, + 0.102541824188105747E+06, 0.102567198188429233E+06, 0.102591367917437441E+06, 0.102612619776373147E+06, 0.102629292784196412E+06, + 0.102640555112501301E+06, 0.102646561280503796E+06, 0.102650072544106879E+06, 0.102650385076837265E+06, 0.102648623310889074E+06, + 0.102647398290377925E+06, 0.102645017994891765E+06, 0.102642292476577204E+06, 0.102637067835034904E+06, 0.102629000591322547E+06, + 0.102618729003435990E+06, 0.102606585296063713E+06, 0.102594489398555161E+06, 0.102579129366844747E+06, 0.102559288929741029E+06, + 0.102534463674515951E+06, 0.102503683064059122E+06, 0.102467677027648388E+06, 0.102425952698371388E+06, 0.102378489696413220E+06, + 0.102325464394964612E+06, 0.102266592853272959E+06, 0.102201770963158517E+06, 0.102131402230157837E+06, 0.102054746212255937E+06, + 0.101968929014764348E+06, 0.101881350922099227E+06, 0.101796528814235106E+06, 0.101718540575217223E+06, 0.101652169308423996E+06, + 0.101599956132104824E+06, 0.101567900805891448E+06, 0.101551935071902582E+06, 0.101547427861477787E+06, 0.101554419426909473E+06, + 0.101561600978615184E+06, 0.101559452993868224E+06, 0.101543318540946057E+06, 0.101516046490907509E+06, 0.101480708475794294E+06, + 0.101442199752635075E+06, 0.101409794893836297E+06, 0.101389114738180739E+06, 0.101385262237127725E+06, 0.101400028248419621E+06, + 0.101431176088229637E+06, 0.101474781214988048E+06, 0.101522572921117302E+06, 0.101566852249736243E+06, 0.101600450643120159E+06, + 0.101625889986676848E+06, 0.101647907487096571E+06, 0.101675661997654053E+06, 0.101714463575179296E+06, 0.101767306549608373E+06, + 0.101829328954263532E+06, 0.101890507206039634E+06, 0.101946066216170686E+06, 0.101992520848846892E+06, 0.102030925636120199E+06, + 0.102058119932572736E+06, 0.102069397218130180E+06, 0.102063960577488731E+06, 0.102043326123970241E+06, 0.102008553848255615E+06, + 0.101967472871147096E+06, 0.101926394136031289E+06, 0.101886043970172454E+06, 0.101846744426466306E+06, 0.101807275512743188E+06, + 0.101761955344090966E+06, 0.101713799217710359E+06, 0.101665117193273894E+06, 0.101617359026062331E+06, 0.101572592180247302E+06, + 0.101533981842693742E+06, 0.101499194744985522E+06, 0.101466415578573593E+06, 0.101432243614177438E+06, 0.101381882914991351E+06, + 0.101327735566313961E+06, 0.101272085428944469E+06, 0.101216117169049772E+06, 0.101156916040190554E+06, 0.101098197832462072E+06, + 0.101045083251186894E+06, 0.101001341900752319E+06, 0.100969631972021365E+06, 0.100962352822747649E+06, 0.100968513387743296E+06, + 0.100983909597780104E+06, 0.101002878032770619E+06, 0.101021997578890048E+06, 0.101041366902723443E+06, 0.101063829282811043E+06, + 0.101089246526039147E+06, 0.101117245287077734E+06, 0.101145180487582722E+06, 0.101169961535366980E+06, 0.101193870243324593E+06, + 0.101214945572481010E+06, 0.101231265902229890E+06, 0.101240946166576672E+06, 0.101226758959788902E+06, 0.101203801319224774E+06, + 0.101180554692105070E+06, 0.101163284364848339E+06, 0.101153028319845049E+06, 0.101150355172476586E+06, 0.101145580058182692E+06, + 0.101028800627874574E+06, 0.101077428684324259E+06, 0.101134167142638209E+06, 0.101197990565301836E+06, 0.101265722975280849E+06, + 0.101335709112544850E+06, 0.101406209334330430E+06, 0.101475487925550115E+06, 0.101541907493692343E+06, 0.101600856889744842E+06, + 0.101649573257523298E+06, 0.101690733358275495E+06, 0.101724376638615926E+06, 0.101749510141425519E+06, 0.101765791117457280E+06, + 0.101773452578481490E+06, 0.101773114885158633E+06, 0.101765715127990101E+06, 0.101752413867995332E+06, 0.101738692514285227E+06, + 0.101723904619569148E+06, 0.101710227930270819E+06, 0.101695310346281782E+06, 0.101679758838352922E+06, 0.101664029621015856E+06, + 0.101648327607929226E+06, 0.101632507008869143E+06, 0.101615973949263309E+06, 0.101591834033789346E+06, 0.101568495570761865E+06, + 0.101547691859404833E+06, 0.101531530936334253E+06, 0.101521827887484746E+06, 0.101520050854732108E+06, 0.101527313513054993E+06, + 0.101537145982894304E+06, 0.101560590862112396E+06, 0.101599562166824646E+06, 0.101645766826557534E+06, 0.101701752618078797E+06, + 0.101766692067664408E+06, 0.101846710834492522E+06, 0.101935405126349360E+06, 0.102024396175872622E+06, 0.102110867349092339E+06, + 0.102192853218211705E+06, 0.102269413494696259E+06, 0.102330281542130935E+06, 0.102383945506085889E+06, 0.102430199256480380E+06, + 0.102469066393364890E+06, 0.102501583023640342E+06, 0.102532817139689723E+06, 0.102561960069998779E+06, 0.102585754372647149E+06, + 0.102606277240311640E+06, 0.102621561801826407E+06, 0.102631876834385388E+06, 0.102638884194148588E+06, 0.102641934388380745E+06, + 0.102641959420915780E+06, 0.102640521654950935E+06, 0.102639686428696965E+06, 0.102638253506522131E+06, 0.102634465365988304E+06, + 0.102627915114268661E+06, 0.102619787557100746E+06, 0.102613378349844119E+06, 0.102603999870031650E+06, 0.102590631585167415E+06, + 0.102572103225089755E+06, 0.102547313635873026E+06, 0.102516398885249058E+06, 0.102479446900462790E+06, 0.102437237325361522E+06, + 0.102388874413479600E+06, 0.102333718028784861E+06, 0.102271049401030890E+06, 0.102201028861754414E+06, 0.102122663528859397E+06, + 0.102032876851637207E+06, 0.101938463410692304E+06, 0.101842660210214104E+06, 0.101749957344606999E+06, 0.101664764507437576E+06, + 0.101591439187819764E+06, 0.101533919460466379E+06, 0.101494271575071776E+06, 0.101478987993255127E+06, 0.101485263674090980E+06, + 0.101506279443945081E+06, 0.101532941096559764E+06, 0.101553896677561657E+06, 0.101563917085832989E+06, 0.101552692436306723E+06, + 0.101526766068070108E+06, 0.101490572300548680E+06, 0.101454740971174542E+06, 0.101425776324883132E+06, 0.101411062568111098E+06, + 0.101413866812942622E+06, 0.101435131474614493E+06, 0.101474051380900128E+06, 0.101522941427092213E+06, 0.101574152032058948E+06, + 0.101618098831177398E+06, 0.101654170137284003E+06, 0.101684054984246599E+06, 0.101716539075889523E+06, 0.101756604551361495E+06, + 0.101806467761705877E+06, 0.101862424100462653E+06, 0.101918408568819126E+06, 0.101971439624029648E+06, 0.102015800714595636E+06, + 0.102049385208646127E+06, 0.102069908714661666E+06, 0.102076032068515779E+06, 0.102064732659179368E+06, 0.102034093795762514E+06, + 0.101992630086863239E+06, 0.101944780810628261E+06, 0.101894141477159937E+06, 0.101849042057571452E+06, 0.101805808680122878E+06, + 0.101760916109816302E+06, 0.101714291793644923E+06, 0.101666393705850103E+06, 0.101619297696421156E+06, 0.101573598742667251E+06, + 0.101529420471224686E+06, 0.101490381423561645E+06, 0.101460489541744115E+06, 0.101432531917615197E+06, 0.101405679166028422E+06, + 0.101376758400729959E+06, 0.101333014356477448E+06, 0.101288061869102195E+06, 0.101243137897010267E+06, 0.101200014773099698E+06, + 0.101153035601030700E+06, 0.101107255027280131E+06, 0.101068975039667697E+06, 0.101040318598185462E+06, 0.101026239021205620E+06, + 0.101036150724925217E+06, 0.101050786638747362E+06, 0.101066960176317720E+06, 0.101082545023658342E+06, 0.101098187778212945E+06, + 0.101117678130985703E+06, 0.101139021760228803E+06, 0.101155522461091532E+06, 0.101175020122667425E+06, 0.101198265495543150E+06, + 0.101224832562545693E+06, 0.101250329820757150E+06, 0.101272684085133165E+06, 0.101289811161881575E+06, 0.101299701614067628E+06, + 0.101289739336630024E+06, 0.101279678002747503E+06, 0.101273826681569160E+06, 0.101274570526567550E+06, 0.101282465694758634E+06, + 0.101293902962443753E+06, 0.100983835656151976E+06, 0.101036388934372706E+06, 0.101096497142358145E+06, 0.101162397946509547E+06, + 0.101232608232112354E+06, 0.101305480982330599E+06, 0.101379283841868455E+06, 0.101452283197187178E+06, 0.101522834159475562E+06, + 0.101589476875808105E+06, 0.101650386759155634E+06, 0.101696210127681858E+06, 0.101733613430271813E+06, 0.101761832290367092E+06, + 0.101780569821559126E+06, 0.101789961901369534E+06, 0.101790532679209500E+06, 0.101783131653860866E+06, 0.101768849808582265E+06, + 0.101750041068809616E+06, 0.101731803246356489E+06, 0.101713921895166000E+06, 0.101693731889764837E+06, 0.101671835744684708E+06, + 0.101648705771986570E+06, 0.101624585079514640E+06, 0.101599389025969096E+06, 0.101563768387053642E+06, 0.101522704766848532E+06, + 0.101483489785699712E+06, 0.101448687013231232E+06, 0.101419615240213854E+06, 0.101397479525329196E+06, 0.101384028029676760E+06, + 0.101370836998047147E+06, 0.101368370266732833E+06, 0.101383065641375812E+06, 0.101416090998647196E+06, 0.101467290265164353E+06, + 0.101534882313080263E+06, 0.101609445319890510E+06, 0.101699733235880441E+06, 0.101794859855521834E+06, 0.101891101060966321E+06, + 0.101985315130313480E+06, 0.102075076914327306E+06, 0.102159945052938041E+06, 0.102235771297951098E+06, 0.102301477656430769E+06, + 0.102354930558367778E+06, 0.102399782724316072E+06, 0.102438694369211255E+06, 0.102476839111309280E+06, 0.102509751156878236E+06, + 0.102537521783681077E+06, 0.102560895469354815E+06, 0.102580819063130271E+06, 0.102594854584419911E+06, 0.102605160074562926E+06, + 0.102611577337313051E+06, 0.102614486702620023E+06, 0.102617674490494959E+06, 0.102619973525111447E+06, 0.102618324460179618E+06, + 0.102615416266488261E+06, 0.102610851205396946E+06, 0.102607299216665502E+06, 0.102602572628475973E+06, 0.102595515104050908E+06, + 0.102585432283621078E+06, 0.102569550312714797E+06, 0.102546496599273247E+06, 0.102517612581426918E+06, 0.102482362007529839E+06, + 0.102441544642516921E+06, 0.102393921375066857E+06, 0.102338338767732290E+06, 0.102273827698305467E+06, 0.102199580759235032E+06, + 0.102112717239415593E+06, 0.102017541011033652E+06, 0.101917267901995700E+06, 0.101815758981969469E+06, 0.101717854365049221E+06, + 0.101627270343615834E+06, 0.101547308817353100E+06, 0.101483765146806487E+06, 0.101441943712900873E+06, 0.101423999856314156E+06, + 0.101430776328316933E+06, 0.101457783973006139E+06, 0.101497023306538365E+06, 0.101538146597104598E+06, 0.101564980031804182E+06, + 0.101571345079031700E+06, 0.101556555710264554E+06, 0.101527227279379993E+06, 0.101491242458124063E+06, 0.101455431195561541E+06, + 0.101427222639413303E+06, 0.101413952789479707E+06, 0.101420016873493543E+06, 0.101448672726717166E+06, 0.101494479796940665E+06, + 0.101550679225448213E+06, 0.101607025893701604E+06, 0.101659304835337243E+06, 0.101705889950175377E+06, 0.101749787609497245E+06, + 0.101793551387452957E+06, 0.101844793551510127E+06, 0.101899113907290477E+06, 0.101951953582127840E+06, 0.101997167012573933E+06, + 0.102030191525044342E+06, 0.102053787395966574E+06, 0.102064887574337728E+06, 0.102060267944376203E+06, 0.102039749700523636E+06, + 0.102005081906476669E+06, 0.101957654047840246E+06, 0.101904801258523614E+06, 0.101850843726662788E+06, 0.101798946363995929E+06, + 0.101751878064897523E+06, 0.101705939443378287E+06, 0.101659768391705205E+06, 0.101615380159911743E+06, 0.101570783461705709E+06, + 0.101526947551755860E+06, 0.101484787939652975E+06, 0.101445231219594032E+06, 0.101413345817087800E+06, 0.101391047300393111E+06, + 0.101372584877227360E+06, 0.101355566853485740E+06, 0.101335220992961375E+06, 0.101303837716816255E+06, 0.101271525370591757E+06, + 0.101240298133351855E+06, 0.101211003024413338E+06, 0.101175839364889063E+06, 0.101146665774628709E+06, 0.101127801050420749E+06, + 0.101116214564623544E+06, 0.101115217567181709E+06, 0.101124992952320288E+06, 0.101134962605509543E+06, 0.101143290627816998E+06, + 0.101149282865567409E+06, 0.101151001731697805E+06, 0.101160080279956310E+06, 0.101174468885292459E+06, 0.101194158852267166E+06, + 0.101218629627263130E+06, 0.101247610934086246E+06, 0.101278139638903813E+06, 0.101306993640526780E+06, 0.101332857422239162E+06, + 0.101352835922766695E+06, 0.101364854062282961E+06, 0.101366215681609348E+06, 0.101371982657827277E+06, 0.101384204628605657E+06, + 0.101403123567578412E+06, 0.101427293507956012E+06, 0.100939699761507189E+06, 0.100993926545564740E+06, 0.101055617446205957E+06, + 0.101123302505147047E+06, 0.101195700951661318E+06, 0.101271150132425566E+06, 0.101347899405442047E+06, 0.101424189839355866E+06, + 0.101498339603613043E+06, 0.101568835452811982E+06, 0.101636401101424097E+06, 0.101695457584751377E+06, 0.101740082571501800E+06, + 0.101772165987128828E+06, 0.101794061760174460E+06, 0.101805821721959510E+06, 0.101807890769523758E+06, 0.101801052084176001E+06, + 0.101787222143099047E+06, 0.101769333451322513E+06, 0.101746134751190912E+06, 0.101718716143227328E+06, 0.101691356809011646E+06, + 0.101662464249923956E+06, 0.101631298348493656E+06, 0.101598170677190283E+06, 0.101554964683279206E+06, 0.101502331999436428E+06, + 0.101449056042133889E+06, 0.101396847279871756E+06, 0.101347056172201555E+06, 0.101300460882216124E+06, 0.101262584703042259E+06, + 0.101225780265849375E+06, 0.101194459775717551E+06, 0.101179417053502169E+06, 0.101183702376592380E+06, 0.101209076499852017E+06, + 0.101255909037280071E+06, 0.101326640203920455E+06, 0.101424239758254218E+06, 0.101531367651623077E+06, 0.101632910073723979E+06, + 0.101736158570445637E+06, 0.101837656744184424E+06, 0.101936360666710083E+06, 0.102029774479476604E+06, 0.102113550935132720E+06, + 0.102187275245992423E+06, 0.102251742085495353E+06, 0.102308744854441014E+06, 0.102354056548559587E+06, 0.102395496326958368E+06, + 0.102432085609497080E+06, 0.102463450245845990E+06, 0.102489865598489851E+06, 0.102514853262571502E+06, 0.102534082770129738E+06, + 0.102548592777604266E+06, 0.102559883810599669E+06, 0.102568794081739034E+06, 0.102579021392062437E+06, 0.102585007107402751E+06, + 0.102586497457448539E+06, 0.102584376842419224E+06, 0.102580903181294503E+06, 0.102577151681759657E+06, 0.102573827515381417E+06, + 0.102568538059750121E+06, 0.102560561364228692E+06, 0.102548460310359820E+06, 0.102530289426340809E+06, 0.102505861568008157E+06, + 0.102475498063954670E+06, 0.102440643792700503E+06, 0.102396241614374099E+06, 0.102341446243588929E+06, 0.102276649353635905E+06, + 0.102199862029058393E+06, 0.102111863644497949E+06, 0.102014314786398143E+06, 0.101910607455440113E+06, 0.101806306816961252E+06, + 0.101704399917697054E+06, 0.101609603981306922E+06, 0.101526211311625375E+06, 0.101459322473350869E+06, 0.101412795838567283E+06, + 0.101389618525710335E+06, 0.101393845554395113E+06, 0.101424357742906359E+06, 0.101472713797786171E+06, 0.101522607587252613E+06, + 0.101559998357663775E+06, 0.101576743781235520E+06, 0.101573310646049868E+06, 0.101549833954751783E+06, 0.101514456685338067E+06, + 0.101472694191529066E+06, 0.101434208011361596E+06, 0.101406914911600485E+06, 0.101398454904380153E+06, 0.101415253675564527E+06, + 0.101455136695375608E+06, 0.101512719547979839E+06, 0.101577237869349250E+06, 0.101641152022720256E+06, 0.101700396834169049E+06, + 0.101757567947174000E+06, 0.101815111575731135E+06, 0.101874014294397304E+06, 0.101930155420364375E+06, 0.101979578233631371E+06, + 0.102017827567168875E+06, 0.102041453032023797E+06, 0.102049181677356071E+06, 0.102042624564991027E+06, 0.102027458526470917E+06, + 0.101998856271186160E+06, 0.101958763385915998E+06, 0.101909825004560786E+06, 0.101855834630693556E+06, 0.101803471305377156E+06, + 0.101751840395667561E+06, 0.101701669671223848E+06, 0.101657371568089962E+06, 0.101614737302306821E+06, 0.101571808841198203E+06, + 0.101529035182503387E+06, 0.101487836291383923E+06, 0.101448187429775586E+06, 0.101410201287687276E+06, 0.101375725543945955E+06, + 0.101354091334976038E+06, 0.101343701275904139E+06, 0.101337958790157587E+06, 0.101334014323027164E+06, 0.101323058410853802E+06, + 0.101303680281432564E+06, 0.101285071086934273E+06, 0.101269046902558985E+06, 0.101256912292666253E+06, 0.101239485050412128E+06, + 0.101225094542196108E+06, 0.101214114558167246E+06, 0.101206300766355242E+06, 0.101205366180458252E+06, 0.101205376802251209E+06, + 0.101196436467417006E+06, 0.101184014918681118E+06, 0.101170971956995039E+06, 0.101173896703063627E+06, 0.101186778426832985E+06, + 0.101207425966799259E+06, 0.101235075391491133E+06, 0.101268299800364039E+06, 0.101308063493844020E+06, 0.101344788336284473E+06, + 0.101376389450400151E+06, 0.101402378295128001E+06, 0.101423140134659829E+06, 0.101438782026730638E+06, 0.101455746728587110E+06, + 0.101479368387625509E+06, 0.101509546030359561E+06, 0.101546739387306210E+06, 0.100893625093361974E+06, 0.100948455392464501E+06, + 0.101011317645263582E+06, 0.101080913011082172E+06, 0.101155302174425058E+06, 0.101233112731396410E+06, 0.101312551980581891E+06, + 0.101391810121618284E+06, 0.101469643740293817E+06, 0.101547894952444782E+06, 0.101619713078854009E+06, 0.101683304064554628E+06, + 0.101737232999154556E+06, 0.101779617777438179E+06, 0.101805388291197829E+06, 0.101820150398714570E+06, 0.101824280737551730E+06, + 0.101819067925622789E+06, 0.101806980910888844E+06, 0.101787436214918198E+06, 0.101761287349566453E+06, 0.101729423465328233E+06, + 0.101692622608612961E+06, 0.101651573936670728E+06, 0.101611590783753491E+06, 0.101562833006838278E+06, 0.101502364394767414E+06, + 0.101438724936641054E+06, 0.101373805958635741E+06, 0.101309369954324357E+06, 0.101246873385268977E+06, 0.101187267453513661E+06, + 0.101122914968029043E+06, 0.101055428119650373E+06, 0.101008249772026029E+06, 0.100979473982631680E+06, 0.100972177967227311E+06, + 0.100988832853860484E+06, 0.101031262783445170E+06, 0.101112202656024601E+06, 0.101211093846252057E+06, 0.101323155130905317E+06, + 0.101443212391304434E+06, 0.101565274984548159E+06, 0.101675064133449094E+06, 0.101783046764746541E+06, 0.101883427362778093E+06, + 0.101974048605326316E+06, 0.102054089915572622E+06, 0.102123916001737191E+06, 0.102185138506351650E+06, 0.102239277647944138E+06, + 0.102288043635062262E+06, 0.102329848961112002E+06, 0.102365570526105090E+06, 0.102398175565311816E+06, 0.102427118018994763E+06, + 0.102451215888181687E+06, 0.102470889959435211E+06, 0.102487322259304128E+06, 0.102507363262553656E+06, 0.102522539511451090E+06, + 0.102533202617323841E+06, 0.102538447738773189E+06, 0.102539366679125000E+06, 0.102537806325041631E+06, 0.102534134338413278E+06, + 0.102529616480806799E+06, 0.102525504718401397E+06, 0.102520340764588414E+06, 0.102512361946182253E+06, 0.102499685852779818E+06, + 0.102481370178637997E+06, 0.102461804458447645E+06, 0.102433116211535496E+06, 0.102394820498302695E+06, 0.102344806742965229E+06, + 0.102282869771580241E+06, 0.102208190347609911E+06, 0.102122230232017173E+06, 0.102026360478078772E+06, 0.101922376088166435E+06, + 0.101815964790077211E+06, 0.101712553837059808E+06, 0.101615912730210781E+06, 0.101531538428717235E+06, 0.101462015329520931E+06, + 0.101411095529211190E+06, 0.101383553801811446E+06, 0.101387868686696354E+06, 0.101419065450411930E+06, 0.101465197763774107E+06, + 0.101514122624701689E+06, 0.101554157750064871E+06, 0.101577510533460605E+06, 0.101578561408166206E+06, 0.101561717136454608E+06, + 0.101527942832344896E+06, 0.101485492708933743E+06, 0.101442040681691869E+06, 0.101407214730937660E+06, 0.101391475969427891E+06, + 0.101402057936737707E+06, 0.101438129992839313E+06, 0.101494675186752138E+06, 0.101561405991801003E+06, 0.101631832958464947E+06, + 0.101700764128050694E+06, 0.101765471244284083E+06, 0.101829298739144535E+06, 0.101891487805957440E+06, 0.101949649930012936E+06, + 0.101996983260441179E+06, 0.102028825999188412E+06, 0.102041977726062381E+06, 0.102037063043873364E+06, 0.102018484271153007E+06, + 0.101987519813082123E+06, 0.101953322744109144E+06, 0.101911210582393775E+06, 0.101863879485885569E+06, 0.101813868935175255E+06, + 0.101763558865488987E+06, 0.101714781421884982E+06, 0.101669784944327868E+06, 0.101626116114336663E+06, 0.101583855166139518E+06, + 0.101542346971029430E+06, 0.101502633877275308E+06, 0.101464939559164166E+06, 0.101426766367174598E+06, 0.101390458857219390E+06, + 0.101358471458522574E+06, 0.101334112694217969E+06, 0.101328407691393310E+06, 0.101330874497622441E+06, 0.101337110359200757E+06, + 0.101343736678259927E+06, 0.101343244142495707E+06, 0.101341300900043818E+06, 0.101339844172589394E+06, 0.101338724330486657E+06, + 0.101333664918719776E+06, 0.101322891249048946E+06, 0.101311826452015521E+06, 0.101299221594776434E+06, 0.101282571152943405E+06, + 0.101266530780531204E+06, 0.101246643011162712E+06, 0.101224150063358495E+06, 0.101202571591745436E+06, 0.101188612840670292E+06, + 0.101199966484071061E+06, 0.101222097051704724E+06, 0.101260233588647054E+06, 0.101304129252313578E+06, 0.101350161554908336E+06, + 0.101389652624068185E+06, 0.101424551417429771E+06, 0.101454274075586436E+06, 0.101479148917351384E+06, 0.101500388782067501E+06, + 0.101525545796928971E+06, 0.101562513561929518E+06, 0.101606090475506091E+06, 0.101653619386718725E+06, 0.100845507039246062E+06, + 0.100900566753226827E+06, 0.100964147998307293E+06, 0.101035004760987780E+06, 0.101111734714359307E+06, 0.101192123809297234E+06, + 0.101274156352906692E+06, 0.101357605885697238E+06, 0.101443671119726976E+06, 0.101525544557033369E+06, 0.101601182677887831E+06, + 0.101668789681363778E+06, 0.101726898348598319E+06, 0.101774441929614739E+06, 0.101810815552412794E+06, 0.101832035149566495E+06, + 0.101838765440822797E+06, 0.101835596101807649E+06, 0.101823419644672496E+06, 0.101802715728713345E+06, 0.101774151142095492E+06, + 0.101738457612419079E+06, 0.101696295926065533E+06, 0.101648104911459959E+06, 0.101590285842002006E+06, 0.101521209919707282E+06, + 0.101450839575846665E+06, 0.101376697188940336E+06, 0.101300744148618498E+06, 0.101224863840720194E+06, 0.101150697403150189E+06, + 0.101073301607053800E+06, 0.100983235760375988E+06, 0.100901684378507489E+06, 0.100833101972986929E+06, 0.100781373167571786E+06, + 0.100760772506158712E+06, 0.100768040826660945E+06, 0.100819963855216105E+06, 0.100898361962391151E+06, 0.100996401252706506E+06, + 0.101109805590524003E+06, 0.101233684034863138E+06, 0.101362757333502159E+06, 0.101494642793831357E+06, 0.101619684005633680E+06, + 0.101728129058541483E+06, 0.101825059560781054E+06, 0.101910320070122136E+06, 0.101982389350624275E+06, 0.102044412115271698E+06, + 0.102100145695870931E+06, 0.102151182120026933E+06, 0.102199014246850449E+06, 0.102244844616859526E+06, 0.102284509458517772E+06, + 0.102318215421307876E+06, 0.102347902960885476E+06, 0.102373421335254781E+06, 0.102401951332123936E+06, 0.102429181477717284E+06, + 0.102450532016644735E+06, 0.102465997336774948E+06, 0.102475777963121422E+06, 0.102478313815590023E+06, 0.102478110250759957E+06, + 0.102475657036715347E+06, 0.102471918321198871E+06, 0.102469939192222024E+06, 0.102467007436977176E+06, 0.102462490014742158E+06, + 0.102456722431479779E+06, 0.102450737615132341E+06, 0.102440335034919917E+06, 0.102420575011656954E+06, 0.102389812989896382E+06, + 0.102347122683242473E+06, 0.102292275082950306E+06, 0.102224438636867562E+06, 0.102143836217952965E+06, 0.102050866494433591E+06, + 0.101949943411085245E+06, 0.101845736377779569E+06, 0.101742816153747364E+06, 0.101647911129982123E+06, 0.101563216996056130E+06, + 0.101491604823778136E+06, 0.101437861556007003E+06, 0.101412287502927546E+06, 0.101412856551671823E+06, 0.101435247443498505E+06, + 0.101472966599928535E+06, 0.101514519271643498E+06, 0.101550307716508367E+06, 0.101572773831424129E+06, 0.101577300876503461E+06, + 0.101561783761491213E+06, 0.101528832671536744E+06, 0.101487621468217170E+06, 0.101449333621855301E+06, 0.101421572690143163E+06, + 0.101412849368901254E+06, 0.101428815273143569E+06, 0.101468452704213269E+06, 0.101526342258825374E+06, 0.101593070240422909E+06, + 0.101660293633886846E+06, 0.101724359259873541E+06, 0.101785772418607943E+06, 0.101847556062125179E+06, 0.101908363003809383E+06, + 0.101961701914240010E+06, 0.102002429874153109E+06, 0.102025185688122059E+06, 0.102030228237618969E+06, 0.102016392623057240E+06, + 0.101989203583738155E+06, 0.101954215596148948E+06, 0.101916658897302012E+06, 0.101876815696310456E+06, 0.101833071043157586E+06, + 0.101787308476072212E+06, 0.101741539193291770E+06, 0.101697630101558476E+06, 0.101654119182481736E+06, 0.101610960850170581E+06, + 0.101569179414185535E+06, 0.101528773468682877E+06, 0.101490142318063241E+06, 0.101454189911789217E+06, 0.101420537325155994E+06, + 0.101387196165512592E+06, 0.101359208745426033E+06, 0.101338989486127597E+06, 0.101329695327606096E+06, 0.101338867992364074E+06, + 0.101355871810450670E+06, 0.101375430345140587E+06, 0.101394209504973755E+06, 0.101402919751202760E+06, 0.101410688334029808E+06, + 0.101416920285657412E+06, 0.101420489242522977E+06, 0.101413658635510583E+06, 0.101399351916641783E+06, 0.101380364637205465E+06, + 0.101357315413079603E+06, 0.101331383086953632E+06, 0.101302463143222500E+06, 0.101271861027862804E+06, 0.101243797629858222E+06, + 0.101225102912379341E+06, 0.101230895188582799E+06, 0.101260967028080006E+06, 0.101301126414935963E+06, 0.101347821784489817E+06, + 0.101397550525323837E+06, 0.101444003541722705E+06, 0.101480976560253359E+06, 0.101512946357403111E+06, 0.101540212183607568E+06, + 0.101567953884550225E+06, 0.101594468785546575E+06, 0.101637676393726375E+06, 0.101688399693186482E+06, 0.101742930184759069E+06, + 0.100795882153115017E+06, 0.100850797431345025E+06, 0.100914750948998306E+06, 0.100986523708389999E+06, 0.101064741053657359E+06, + 0.101147944583867647E+06, 0.101236474647069423E+06, 0.101327593382317646E+06, 0.101416818345205553E+06, 0.101501970105562199E+06, + 0.101581006340059568E+06, 0.101652107178935606E+06, 0.101713753841424812E+06, 0.101764799350409041E+06, 0.101804529976921447E+06, + 0.101832451081090258E+06, 0.101847567048303332E+06, 0.101846442214230046E+06, 0.101834900151378431E+06, 0.101813744156519519E+06, + 0.101783490044669117E+06, 0.101744750228076155E+06, 0.101698109004179641E+06, 0.101641364118676778E+06, 0.101569583201128436E+06, + 0.101490816574609969E+06, 0.101406531256311253E+06, 0.101319625817001812E+06, 0.101233091961074242E+06, 0.101146347584902731E+06, + 0.101058989124578555E+06, 0.100953964690316512E+06, 0.100852899705475327E+06, 0.100760578698964149E+06, 0.100681685450575751E+06, + 0.100620492778267973E+06, 0.100580496608869158E+06, 0.100579462774121028E+06, 0.100625977088063315E+06, 0.100699672061534206E+06, + 0.100794647180633037E+06, 0.100907249288633233E+06, 0.101033016501104474E+06, 0.101170532820658074E+06, 0.101310202043631813E+06, + 0.101443951517617694E+06, 0.101566665342990047E+06, 0.101674561727816923E+06, 0.101762857707379371E+06, 0.101831050817027455E+06, + 0.101892059674295087E+06, 0.101947353598683054E+06, 0.101998507084363489E+06, 0.102047351014086569E+06, 0.102096770563981801E+06, + 0.102143221374936838E+06, 0.102186890306655871E+06, 0.102228196597294736E+06, 0.102264105567156759E+06, 0.102302445150954794E+06, + 0.102336246787148004E+06, 0.102363781472504663E+06, 0.102384291162903231E+06, 0.102397430622010026E+06, 0.102403312624922473E+06, + 0.102403832627536103E+06, 0.102402612769131738E+06, 0.102401390930183130E+06, 0.102401466546220196E+06, 0.102401874865610895E+06, + 0.102402100027913009E+06, 0.102404524182350739E+06, 0.102408945753433436E+06, 0.102408228479075435E+06, 0.102399207567720179E+06, + 0.102378727543360583E+06, 0.102346081419689654E+06, 0.102300584036716507E+06, 0.102242408524207058E+06, 0.102170172560628038E+06, + 0.102084827969266131E+06, 0.101990466580006148E+06, 0.101891305283198890E+06, 0.101794051647235989E+06, 0.101701758202335564E+06, + 0.101617607399452128E+06, 0.101545673956610553E+06, 0.101493920019806435E+06, 0.101463389589686616E+06, 0.101454707404169429E+06, + 0.101465784796775130E+06, 0.101489404864046577E+06, 0.101519701691131908E+06, 0.101547620610180951E+06, 0.101565576165996550E+06, + 0.101562026624260950E+06, 0.101539419490073633E+06, 0.101508015501831396E+06, 0.101475602714955035E+06, 0.101449209652947975E+06, + 0.101436251410560508E+06, 0.101442877175111498E+06, 0.101471341372345414E+06, 0.101518178052896081E+06, 0.101577355032239313E+06, + 0.101641314782584261E+06, 0.101703564541155953E+06, 0.101762362987943518E+06, 0.101818379277178246E+06, 0.101872714548978096E+06, + 0.101924119264252775E+06, 0.101966776195386803E+06, 0.101995500768842219E+06, 0.102007086660768691E+06, 0.102002030153628395E+06, + 0.101985038462701981E+06, 0.101956611217972633E+06, 0.101924174284332606E+06, 0.101890531345005773E+06, 0.101858684611865552E+06, + 0.101821867670641383E+06, 0.101781442886233301E+06, 0.101738169818174909E+06, 0.101693020445221118E+06, 0.101649533509090848E+06, + 0.101606065252630258E+06, 0.101563356987927487E+06, 0.101522196794781717E+06, 0.101483000104046587E+06, 0.101448492093986119E+06, + 0.101420196255985837E+06, 0.101395294590973572E+06, 0.101373162271020163E+06, 0.101359621762719311E+06, 0.101356933368830039E+06, + 0.101368947980949306E+06, 0.101392192190573551E+06, 0.101417779659041989E+06, 0.101442531040709990E+06, 0.101462476541542521E+06, + 0.101476476704636079E+06, 0.101486973325915984E+06, 0.101492708978460287E+06, 0.101491506327010982E+06, 0.101476163566485891E+06, + 0.101454012045195879E+06, 0.101426588508176050E+06, 0.101395767868210212E+06, 0.101361555520167341E+06, 0.101327388871009054E+06, + 0.101300667576237203E+06, 0.101284994174892112E+06, 0.101283350959747040E+06, 0.101309210052713708E+06, 0.101350688755181967E+06, + 0.101399465772761600E+06, 0.101451857069433157E+06, 0.101504338927611956E+06, 0.101548087731741456E+06, 0.101585173851711908E+06, + 0.101617418107249265E+06, 0.101645918462371425E+06, 0.101672368866688703E+06, 0.101702644054264791E+06, 0.101756834440843944E+06, + 0.101815020493009375E+06, 0.100745394112667054E+06, 0.100799832870823317E+06, 0.100863855953311213E+06, 0.100936251298315474E+06, + 0.101015648499264644E+06, 0.101104654341683374E+06, 0.101200128443110370E+06, 0.101296361142831636E+06, 0.101389195762127056E+06, + 0.101477275829104881E+06, 0.101559295351936235E+06, 0.101633387586243814E+06, 0.101697961740723156E+06, 0.101751772598623953E+06, + 0.101793901427349119E+06, 0.101823866729636080E+06, 0.101841583691637163E+06, 0.101847052782340179E+06, 0.101840097601263231E+06, + 0.101819364884434224E+06, 0.101788292383590582E+06, 0.101747405137351147E+06, 0.101695621343299601E+06, 0.101627436111935327E+06, + 0.101550322384277897E+06, 0.101465476616664964E+06, 0.101374194733789423E+06, 0.101277718928660746E+06, 0.101177047947947533E+06, + 0.101075621770040874E+06, 0.100963507971772880E+06, 0.100850151599165794E+06, 0.100741049456883455E+06, 0.100641201275214524E+06, + 0.100555640521779089E+06, 0.100489164793431541E+06, 0.100453712051746988E+06, 0.100455966233873114E+06, 0.100484341033634380E+06, + 0.100537490332318921E+06, 0.100620003905902136E+06, 0.100729309835612949E+06, 0.100858870023752374E+06, 0.101002649715674357E+06, + 0.101147678361066428E+06, 0.101287802540963821E+06, 0.101417496539417145E+06, 0.101532273896933402E+06, 0.101613683175199098E+06, + 0.101680723164626179E+06, 0.101737444859119263E+06, 0.101791182708811306E+06, 0.101841314940347904E+06, 0.101891796533315224E+06, + 0.101941590080887530E+06, 0.101990059211011772E+06, 0.102037355306302023E+06, 0.102083701488133767E+06, 0.102136891332944331E+06, + 0.102186806386969169E+06, 0.102230479823408270E+06, 0.102264774535572782E+06, 0.102290420308268731E+06, 0.102307702555592783E+06, + 0.102317766904831617E+06, 0.102321662148245741E+06, 0.102321498408406202E+06, 0.102320441248726507E+06, 0.102319523718290511E+06, + 0.102322447750704567E+06, 0.102327503158949214E+06, 0.102340754529364640E+06, 0.102353506384693246E+06, 0.102362358688122375E+06, + 0.102364445626707267E+06, 0.102355674159446760E+06, 0.102335040551811529E+06, 0.102301981999839074E+06, 0.102255676163442389E+06, + 0.102195798314690837E+06, 0.102122639698007450E+06, 0.102039086723219865E+06, 0.101949840960878224E+06, 0.101859938889724974E+06, + 0.101771880315094095E+06, 0.101689691466275064E+06, 0.101619553461018091E+06, 0.101564784382206009E+06, 0.101527063676792590E+06, + 0.101506865347517232E+06, 0.101503522390084341E+06, 0.101512744653858725E+06, 0.101529231308459130E+06, 0.101545937638918578E+06, + 0.101543746232650679E+06, 0.101529149091683401E+06, 0.101505036617385034E+06, 0.101477259643610611E+06, 0.101452985842091570E+06, + 0.101443019818922796E+06, 0.101450005107018835E+06, 0.101477223491849247E+06, 0.101523231314288976E+06, 0.101581629450517838E+06, + 0.101644098508760901E+06, 0.101703051093558723E+06, 0.101755080739197074E+06, 0.101801349748540073E+06, 0.101847343504094184E+06, + 0.101892088842664132E+06, 0.101930776572625342E+06, 0.101959972929516225E+06, 0.101973275480066382E+06, 0.101972016851233420E+06, + 0.101959747868463455E+06, 0.101940685784926434E+06, 0.101919336338791196E+06, 0.101894507185877927E+06, 0.101871113669696017E+06, + 0.101847657889249851E+06, 0.101820887903955852E+06, 0.101784170021964572E+06, 0.101741602583369866E+06, 0.101694747059338464E+06, + 0.101647292622998575E+06, 0.101600773270067424E+06, 0.101554052329806203E+06, 0.101509997350416306E+06, 0.101472107321641699E+06, + 0.101442071551669200E+06, 0.101420240877131699E+06, 0.101406891473258380E+06, 0.101396015807551084E+06, 0.101392164060749914E+06, + 0.101397198621684831E+06, 0.101410725481402653E+06, 0.101436168965154429E+06, 0.101464448461599168E+06, 0.101491134274545591E+06, + 0.101513817760506034E+06, 0.101531534488231206E+06, 0.101544658070101810E+06, 0.101551681755858954E+06, 0.101551216434335554E+06, + 0.101539195357785327E+06, 0.101514919199184893E+06, 0.101483010220912314E+06, 0.101448007466093870E+06, 0.101414858070553688E+06, + 0.101383218898751307E+06, 0.101359262217297684E+06, 0.101346709055278770E+06, 0.101347915439013712E+06, 0.101365119587774912E+06, + 0.101407924765819262E+06, 0.101458658683875430E+06, 0.101515675014729291E+06, 0.101573920518004117E+06, 0.101629788706552135E+06, + 0.101668434413804149E+06, 0.101700504314289530E+06, 0.101727848552964642E+06, 0.101752288382924846E+06, 0.101776226460626523E+06, + 0.101814361167678813E+06, 0.101872139466116685E+06, 0.100694816386903738E+06, 0.100748531064111390E+06, 0.100812413075077391E+06, + 0.100885240325433202E+06, 0.100971984589634725E+06, 0.101066079836500590E+06, 0.101163332246353209E+06, 0.101261519892330936E+06, + 0.101358385768427062E+06, 0.101451421123224791E+06, 0.101536054276749637E+06, 0.101612689419430462E+06, 0.101679641914763270E+06, + 0.101735174644287632E+06, 0.101778750617147758E+06, 0.101810665166487233E+06, 0.101830410029895895E+06, 0.101837810772118624E+06, + 0.101833022665443903E+06, 0.101816510393020842E+06, 0.101787854012666052E+06, 0.101744823421577603E+06, 0.101683938556403096E+06, + 0.101613036597664483E+06, 0.101532884942156001E+06, 0.101444504410039342E+06, 0.101349069651044396E+06, 0.101247781610335631E+06, + 0.101141708506075884E+06, 0.101021202144232695E+06, 0.100894721062327983E+06, 0.100769982600624178E+06, 0.100655427823023274E+06, + 0.100550770964121868E+06, 0.100461477319971644E+06, 0.100396193533225101E+06, 0.100370475160386210E+06, 0.100369362731624045E+06, + 0.100393088104568509E+06, 0.100440996230512974E+06, 0.100511511049115361E+06, 0.100603846780177613E+06, 0.100726574426591877E+06, + 0.100871208402494914E+06, 0.101018016887883554E+06, 0.101160944293748136E+06, 0.101294154343677379E+06, 0.101398406532467285E+06, + 0.101478074072107382E+06, 0.101546049324473512E+06, 0.101603974418745871E+06, 0.101653727077973454E+06, 0.101697954544609078E+06, + 0.101741376690074656E+06, 0.101789988330066262E+06, 0.101838680208411213E+06, 0.101887795803836605E+06, 0.101942598855672841E+06, + 0.102000837418646348E+06, 0.102056277940396962E+06, 0.102106768405713607E+06, 0.102150535774670396E+06, 0.102182996899048041E+06, + 0.102206750157000613E+06, 0.102221201245532342E+06, 0.102228757950974235E+06, 0.102230269318708335E+06, 0.102229908214737996E+06, + 0.102230221444085299E+06, 0.102233117647704858E+06, 0.102243955867660014E+06, 0.102261169827573845E+06, 0.102280623025385154E+06, + 0.102298710646779829E+06, 0.102311720481040116E+06, 0.102316483254606297E+06, 0.102310329085876278E+06, 0.102292054686377145E+06, + 0.102261582445110776E+06, 0.102217278999264774E+06, 0.102159938958497296E+06, 0.102090651836751262E+06, 0.102014420809727890E+06, + 0.101933158619991009E+06, 0.101851325383247095E+06, 0.101773700996606422E+06, 0.101704655579852813E+06, 0.101645470306280142E+06, + 0.101599387487163476E+06, 0.101568762309086727E+06, 0.101551200721109650E+06, 0.101544950055199806E+06, 0.101545234940555893E+06, + 0.101536151271568684E+06, 0.101520957074193793E+06, 0.101499514166347813E+06, 0.101472481430049040E+06, 0.101447481037651174E+06, + 0.101431698928562022E+06, 0.101432519665399988E+06, 0.101455989679772596E+06, 0.101503867701139068E+06, 0.101569707321795955E+06, + 0.101641541183263049E+06, 0.101707359784777087E+06, 0.101760909663319078E+06, 0.101802944092112913E+06, 0.101837429073186562E+06, + 0.101868490058515003E+06, 0.101895999089963501E+06, 0.101921719560774494E+06, 0.101935208629263929E+06, 0.101934734847469299E+06, + 0.101921789770189804E+06, 0.101905337918664198E+06, 0.101889233907825823E+06, 0.101876223533093609E+06, 0.101864529046626514E+06, + 0.101850666495852842E+06, 0.101835575764428810E+06, 0.101815211112956240E+06, 0.101783740571016519E+06, 0.101739678309719806E+06, + 0.101689041718466135E+06, 0.101634899667157661E+06, 0.101583884425190394E+06, 0.101535509776931387E+06, 0.101491128441498251E+06, + 0.101453011421685966E+06, 0.101428708334432333E+06, 0.101415133080661239E+06, 0.101411902195392497E+06, 0.101415741142001993E+06, + 0.101421700628259656E+06, 0.101434916879656914E+06, 0.101454096376128975E+06, 0.101478884585159176E+06, 0.101507961817356219E+06, + 0.101534772926637874E+06, 0.101557090728886120E+06, 0.101574113620330667E+06, 0.101587280909418565E+06, 0.101593317203057959E+06, + 0.101589233196906163E+06, 0.101574814776511601E+06, 0.101547332581751762E+06, 0.101514869284270651E+06, 0.101481998192358122E+06, + 0.101452150550811974E+06, 0.101427572510067519E+06, 0.101409813743047896E+06, 0.101403676308175665E+06, 0.101410943983370715E+06, + 0.101433007929108295E+06, 0.101473704830047689E+06, 0.101528968358056605E+06, 0.101588585098966272E+06, 0.101648865730780017E+06, + 0.101706538485246449E+06, 0.101754905727487509E+06, 0.101785976200502380E+06, 0.101811017148794053E+06, 0.101832089114193281E+06, + 0.101851827047180632E+06, 0.101871848271984418E+06, 0.101914442748880043E+06, 0.100645050821058583E+06, 0.100697921098829320E+06, + 0.100761591261288675E+06, 0.100844244243942405E+06, 0.100934005537327830E+06, 0.101028963380699686E+06, 0.101127123691640561E+06, + 0.101226361187462535E+06, 0.101324505036089657E+06, 0.101419431488063798E+06, 0.101509163971173737E+06, 0.101590063785101636E+06, + 0.101657671467199980E+06, 0.101713396702810118E+06, 0.101758515364488485E+06, 0.101792091325616479E+06, 0.101813481673006056E+06, + 0.101822350253392695E+06, 0.101818668615804971E+06, 0.101802702749391727E+06, 0.101774619027333058E+06, 0.101728109831474241E+06, + 0.101668908134665704E+06, 0.101597584119515159E+06, 0.101516856663981162E+06, 0.101427599824837293E+06, 0.101330896414631075E+06, + 0.101227935201261804E+06, 0.101113372919066416E+06, 0.100989129696766337E+06, 0.100861373889168084E+06, 0.100733678225485171E+06, + 0.100610105917794019E+06, 0.100495004451233079E+06, 0.100402578780181022E+06, 0.100353109983544055E+06, 0.100326440206043859E+06, + 0.100322735531117156E+06, 0.100342802276422299E+06, 0.100386646482634504E+06, 0.100453451962470805E+06, 0.100549574897853177E+06, + 0.100666205550992949E+06, 0.100795807241975184E+06, 0.100931381874395069E+06, 0.101067411193584325E+06, 0.101192762302618430E+06, + 0.101283622761741586E+06, 0.101362350787791220E+06, 0.101430423297678528E+06, 0.101489314399921583E+06, 0.101540641111512159E+06, + 0.101585585061290316E+06, 0.101627410996723280E+06, 0.101667724011934901E+06, 0.101707970653555123E+06, 0.101751269935565215E+06, + 0.101811021944586406E+06, 0.101870809774501089E+06, 0.101928469764575537E+06, 0.101981732364511379E+06, 0.102026310772180412E+06, + 0.102061898497918446E+06, 0.102089845634957077E+06, 0.102110105242362508E+06, 0.102121882127719451E+06, 0.102124061355970684E+06, + 0.102123733324673376E+06, 0.102124546125847337E+06, 0.102129219082775890E+06, 0.102145351303200790E+06, 0.102166260171440692E+06, + 0.102190433845960331E+06, 0.102216291023032318E+06, 0.102242152119835548E+06, 0.102260901292175229E+06, 0.102271019053290802E+06, + 0.102270194336435845E+06, 0.102258376332468251E+06, 0.102232740434276260E+06, 0.102193082447496578E+06, 0.102140339518538545E+06, + 0.102077291761659100E+06, 0.102007943796066291E+06, 0.101934901694509579E+06, 0.101863769251748963E+06, 0.101795867039438526E+06, + 0.101734634917306947E+06, 0.101683465453549536E+06, 0.101643719755611994E+06, 0.101613589850316028E+06, 0.101591266195843433E+06, + 0.101568063676064237E+06, 0.101544190597726789E+06, 0.101518173523634308E+06, 0.101489293133355706E+06, 0.101456969224960791E+06, + 0.101429471204937334E+06, 0.101413477375518429E+06, 0.101417790921687454E+06, 0.101450822395921219E+06, 0.101510233193849519E+06, + 0.101585841462266966E+06, 0.101664438788265412E+06, 0.101733920550829818E+06, 0.101788706066789920E+06, 0.101825829329588349E+06, + 0.101850405636027645E+06, 0.101871083937706790E+06, 0.101887382097668247E+06, 0.101896455049501354E+06, 0.101897289413654769E+06, + 0.101886248870001597E+06, 0.101867415759247539E+06, 0.101847995171556977E+06, 0.101838485076295401E+06, 0.101834100858943464E+06, + 0.101832686427819717E+06, 0.101828063075528247E+06, 0.101816399093795466E+06, 0.101796719243765314E+06, 0.101767216502717842E+06, + 0.101721966250064579E+06, 0.101668953652310433E+06, 0.101611959093829370E+06, 0.101556227036786251E+06, 0.101506414279391960E+06, + 0.101461971390057777E+06, 0.101425468706421860E+06, 0.101404163733341426E+06, 0.101399096476539751E+06, 0.101405522879150667E+06, + 0.101421050121819761E+06, 0.101438689378578158E+06, 0.101460180927881505E+06, 0.101485796004159551E+06, 0.101513713918150577E+06, + 0.101542550860272706E+06, 0.101568068025141562E+06, 0.101588331740948968E+06, 0.101600913455480535E+06, 0.101607630152187616E+06, + 0.101607407012941694E+06, 0.101598607139348926E+06, 0.101581645287700347E+06, 0.101557205094100689E+06, 0.101527626140599372E+06, + 0.101498954813168501E+06, 0.101474478229909684E+06, 0.101456851592814171E+06, 0.101447916547657107E+06, 0.101451532249133510E+06, + 0.101469023039587555E+06, 0.101500095660945575E+06, 0.101543265481331633E+06, 0.101599989966535504E+06, 0.101661394639400824E+06, + 0.101722843298708525E+06, 0.101781217785530855E+06, 0.101833962893083750E+06, 0.101869504665579036E+06, 0.101891006131465809E+06, + 0.101907724224272592E+06, 0.101922174311177543E+06, 0.101935867942354409E+06, 0.101950426065447158E+06, 0.100607098755765037E+06, + 0.100655240281701743E+06, 0.100726600376942501E+06, 0.100809356254825645E+06, 0.100899004634437370E+06, 0.100993829979357848E+06, + 0.101091906852125423E+06, 0.101191172811513417E+06, 0.101289507328918466E+06, 0.101384817108912728E+06, 0.101475128234200398E+06, + 0.101556622026723067E+06, 0.101627508170991190E+06, 0.101685968687809233E+06, 0.101732567539073978E+06, 0.101767665006896481E+06, + 0.101790488350008833E+06, 0.101800548295886649E+06, 0.101797644943693944E+06, 0.101781861361740375E+06, 0.101747873759633774E+06, + 0.101701859594637368E+06, 0.101644745116156497E+06, 0.101577648617696381E+06, 0.101501095515959882E+06, 0.101413668608079461E+06, + 0.101318547892610906E+06, 0.101214143017131020E+06, 0.101099338905386365E+06, 0.100978397278849705E+06, 0.100854041321450713E+06, + 0.100729710648106629E+06, 0.100609462614676057E+06, 0.100497826949930561E+06, 0.100414459388165211E+06, 0.100356511886266162E+06, + 0.100322777395156372E+06, 0.100316042351856522E+06, 0.100332097081535409E+06, 0.100371561029088683E+06, 0.100439298341075264E+06, + 0.100532568922400489E+06, 0.100643002914990837E+06, 0.100765387761929349E+06, 0.100893492581718543E+06, 0.101020399500629603E+06, + 0.101112706098134367E+06, 0.101194570041727216E+06, 0.101269273413618284E+06, 0.101335562528605122E+06, 0.101394060212437602E+06, + 0.101445483977905038E+06, 0.101491335215433006E+06, 0.101533800970901357E+06, 0.101574594133775521E+06, 0.101615314066683874E+06, + 0.101662259781339875E+06, 0.101713149881755875E+06, 0.101764653351764238E+06, 0.101815034877485959E+06, 0.101864609985221337E+06, + 0.101906670614871124E+06, 0.101942016196974146E+06, 0.101970135166829859E+06, 0.101990609169172516E+06, 0.101996950610404732E+06, + 0.101996810049367472E+06, 0.101996317886868128E+06, 0.101998445642552077E+06, 0.102008824591142213E+06, 0.102027635971959302E+06, + 0.102051641514833580E+06, 0.102080850665324571E+06, 0.102117904503131693E+06, 0.102157634194590821E+06, 0.102192504721610734E+06, + 0.102219235460459910E+06, 0.102236777347130861E+06, 0.102242902162718834E+06, 0.102236355155139478E+06, 0.102216651883876315E+06, + 0.102180426444035780E+06, 0.102133083528179093E+06, 0.102077034681391349E+06, 0.102016323324797893E+06, 0.101953628282518228E+06, + 0.101890856388452012E+06, 0.101830915333128054E+06, 0.101779447310396441E+06, 0.101734080624489550E+06, 0.101693870504157734E+06, + 0.101656684022070389E+06, 0.101619340499046710E+06, 0.101584139894536143E+06, 0.101548750508560886E+06, 0.101508927593507731E+06, + 0.101469477866382847E+06, 0.101436805815304979E+06, 0.101415993387059803E+06, 0.101423466131997789E+06, 0.101453632286171531E+06, + 0.101508029375078389E+06, 0.101580823336132147E+06, 0.101656593588021438E+06, 0.101722011470405239E+06, 0.101771508397742451E+06, + 0.101807913013677957E+06, 0.101834964343916130E+06, 0.101850402618856344E+06, 0.101859186985402383E+06, 0.101860587418252151E+06, + 0.101854518941434624E+06, 0.101838720084331697E+06, 0.101819824582356232E+06, 0.101803402458019846E+06, 0.101796893209118367E+06, + 0.101799592648883248E+06, 0.101802452116411427E+06, 0.101801265547130839E+06, 0.101788566176828695E+06, 0.101765879286445153E+06, + 0.101732953696931960E+06, 0.101687950182710265E+06, 0.101633167492824286E+06, 0.101575598313827417E+06, 0.101518917024984054E+06, + 0.101468456845219422E+06, 0.101425013728590406E+06, 0.101390361593186084E+06, 0.101368216911030337E+06, 0.101370279495935785E+06, + 0.101384930299833504E+06, 0.101409208395769369E+06, 0.101438468993645060E+06, 0.101467787546390668E+06, 0.101499453696433935E+06, + 0.101530518538351142E+06, 0.101558938309742618E+06, 0.101581645149348537E+06, 0.101598207551499479E+06, 0.101607649285544889E+06, + 0.101609802844516307E+06, 0.101605573988511765E+06, 0.101593037714059843E+06, 0.101573514674016667E+06, 0.101549196000671189E+06, + 0.101522849664976588E+06, 0.101498330261054754E+06, 0.101479889987571310E+06, 0.101470097853539497E+06, 0.101471225349216998E+06, + 0.101486588535369752E+06, 0.101515334980482352E+06, 0.101556357596876667E+06, 0.101607560846124834E+06, 0.101666443968593783E+06, + 0.101729419441298363E+06, 0.101791387702929569E+06, 0.101848011454613385E+06, 0.101897514583017852E+06, 0.101939642427183790E+06, + 0.101960271009820077E+06, 0.101975158780464568E+06, 0.101986424653725320E+06, 0.101995822513432664E+06, 0.102004992120982162E+06, + 0.100578411052675729E+06, 0.100635318784110554E+06, 0.100702588041198120E+06, 0.100778983082032035E+06, 0.100867372014784603E+06, + 0.100961003291497836E+06, 0.101057944061462069E+06, 0.101156164506401896E+06, 0.101253562485936651E+06, 0.101348041518852056E+06, + 0.101435305736620867E+06, 0.101514565773677881E+06, 0.101585969098869886E+06, 0.101648080408071197E+06, 0.101699676885091831E+06, + 0.101737081890784044E+06, 0.101761287426791518E+06, 0.101772434840921720E+06, 0.101770158786062922E+06, 0.101748537453835859E+06, + 0.101714770053279746E+06, 0.101669742860261249E+06, 0.101614251954373656E+06, 0.101549290791504973E+06, 0.101476027861641691E+06, + 0.101395781087328636E+06, 0.101309332351133024E+06, 0.101208930191804626E+06, 0.101100827344175617E+06, 0.100987036454510526E+06, + 0.100870048278151575E+06, 0.100753131768219901E+06, 0.100640279785382925E+06, 0.100543839073244162E+06, 0.100470119984832578E+06, + 0.100412920571785522E+06, 0.100374418672954038E+06, 0.100356321711452154E+06, 0.100359754832890321E+06, 0.100393037545625295E+06, + 0.100461456665693026E+06, 0.100548040695085903E+06, 0.100649774320544951E+06, 0.100762231735881898E+06, 0.100879810004682629E+06, + 0.100978944107382951E+06, 0.101056139035317683E+06, 0.101129122973660080E+06, 0.101197131809436498E+06, 0.101259400864402109E+06, + 0.101315369721067444E+06, 0.101366567376128267E+06, 0.101413068730518760E+06, 0.101456050767495792E+06, 0.101497394979706776E+06, + 0.101540388547235518E+06, 0.101589723482442452E+06, 0.101639287384227951E+06, 0.101688119127630343E+06, 0.101734881227949692E+06, + 0.101774055633342999E+06, 0.101806176343790416E+06, 0.101833758016756707E+06, 0.101855867301477920E+06, 0.101869669516056863E+06, + 0.101867423844660036E+06, 0.101862185064065459E+06, 0.101857648911106618E+06, 0.101857166947219768E+06, 0.101869453362050233E+06, + 0.101889395994667357E+06, 0.101917145273055416E+06, 0.101952665990595080E+06, 0.102005113066678605E+06, 0.102059201352783610E+06, + 0.102110590092891594E+06, 0.102155134120450733E+06, 0.102189008661845161E+06, 0.102212893719536674E+06, 0.102224794573552019E+06, + 0.102221917283866860E+06, 0.102203717818992911E+06, 0.102173729797711843E+06, 0.102134066117315539E+06, 0.102088155198460590E+06, + 0.102037322504280150E+06, 0.101983804157969324E+06, 0.101930882216981918E+06, 0.101882568835916391E+06, 0.101835848097687121E+06, + 0.101791045975844638E+06, 0.101745969221785286E+06, 0.101701401299452598E+06, 0.101658034247290489E+06, 0.101613792586539625E+06, + 0.101566658381616784E+06, 0.101523107840297394E+06, 0.101485865057037794E+06, 0.101467196461575470E+06, 0.101465231282475186E+06, + 0.101481792269703801E+06, 0.101521171184929379E+06, 0.101584362409188645E+06, 0.101654606382538637E+06, 0.101708085889500013E+06, + 0.101750884319908815E+06, 0.101781151271932016E+06, 0.101802265119226417E+06, 0.101814660749166302E+06, 0.101818059160636913E+06, + 0.101815376584443497E+06, 0.101808025978518664E+06, 0.101796093709958877E+06, 0.101783205967926551E+06, 0.101773519465245452E+06, + 0.101768347262196490E+06, 0.101772318875173907E+06, 0.101774032894583841E+06, 0.101769304008539359E+06, 0.101752736287782580E+06, + 0.101724576811767562E+06, 0.101687606667018787E+06, 0.101642832213384885E+06, 0.101588413046507747E+06, 0.101532052789407389E+06, + 0.101477089478998780E+06, 0.101426937636667906E+06, 0.101383983337104524E+06, 0.101350070067916895E+06, 0.101327894217902314E+06, + 0.101330294767154453E+06, 0.101349863124191863E+06, 0.101379498558547202E+06, 0.101415335536042723E+06, 0.101450570253408456E+06, + 0.101486617503024216E+06, 0.101521790468661828E+06, 0.101553679702050722E+06, 0.101576951634593526E+06, 0.101592599322586801E+06, + 0.101600882539355007E+06, 0.101601982296252419E+06, 0.101593711037322297E+06, 0.101576295595724252E+06, 0.101552760225610255E+06, + 0.101525860012702775E+06, 0.101500304746004782E+06, 0.101482529221745732E+06, 0.101472615361795470E+06, 0.101472486373178777E+06, + 0.101483501295817390E+06, 0.101509279618775763E+06, 0.101549321581216165E+06, 0.101600205319342873E+06, 0.101659295372980385E+06, + 0.101721590076149907E+06, 0.101783337171577281E+06, 0.101842427132610639E+06, 0.101897333754838794E+06, 0.101946395082493676E+06, + 0.101988236942542819E+06, 0.102017526821220177E+06, 0.102031828714653369E+06, 0.102041305631011754E+06, 0.102047936605813040E+06, + 0.102053545022376406E+06, 0.100561618890645521E+06, 0.100618675407796312E+06, 0.100685232428278308E+06, 0.100760148812781379E+06, + 0.100842043992347171E+06, 0.100930626779751663E+06, 0.101025380770443604E+06, 0.101121496737499227E+06, 0.101216863489791329E+06, + 0.101306591907260168E+06, 0.101390820508431876E+06, 0.101469198549494278E+06, 0.101540194252744899E+06, 0.101602382440106187E+06, + 0.101654511301229999E+06, 0.101695567045773627E+06, 0.101724835997739530E+06, 0.101738206502799672E+06, 0.101728469792924647E+06, + 0.101706705766990082E+06, 0.101673943944349550E+06, 0.101630654689779229E+06, 0.101577521269946941E+06, 0.101515423259462186E+06, + 0.101445417400194085E+06, 0.101369301689578249E+06, 0.101289207179891833E+06, 0.101202291357723705E+06, 0.101109840862024794E+06, + 0.101010060536526478E+06, 0.100903624985256116E+06, 0.100797206247763170E+06, 0.100697721229483854E+06, 0.100617879166639119E+06, + 0.100549334862444375E+06, 0.100494554672908853E+06, 0.100455829928310864E+06, 0.100435159192249281E+06, 0.100434140902790139E+06, + 0.100463827743078145E+06, 0.100516682399563157E+06, 0.100588924784875649E+06, 0.100677081454071609E+06, 0.100775641942890885E+06, + 0.100875619518922729E+06, 0.100945870321605689E+06, 0.101013133541299816E+06, 0.101077503451870405E+06, 0.101138697419382283E+06, + 0.101196245970018281E+06, 0.101247478059058092E+06, 0.101295381961911495E+06, 0.101341293286219021E+06, 0.101385520658941925E+06, + 0.101428507369388099E+06, 0.101477628384924552E+06, 0.101527439265766385E+06, 0.101575625370267109E+06, 0.101621502298168052E+06, + 0.101663832962092813E+06, 0.101694866512688139E+06, 0.101720503961646493E+06, 0.101740691340596662E+06, 0.101755087321406769E+06, + 0.101753809082437700E+06, 0.101741526291839808E+06, 0.101728608499199152E+06, 0.101718502985755840E+06, 0.101716703972249219E+06, + 0.101727329002141589E+06, 0.101746865685733879E+06, 0.101776394054624689E+06, 0.101821041668101156E+06, 0.101883903619016666E+06, + 0.101950707313021689E+06, 0.102016579439056790E+06, 0.102074857884153607E+06, 0.102122966684235507E+06, 0.102162229375958646E+06, + 0.102191070936530305E+06, 0.102205291241337400E+06, 0.102205781057829736E+06, 0.102194562190391560E+06, 0.102173148282368042E+06, + 0.102144343637741913E+06, 0.102108830373893230E+06, 0.102068178268037620E+06, 0.102026306869767315E+06, 0.101984352807968040E+06, + 0.101941207962857719E+06, 0.101897306791024865E+06, 0.101851675563811092E+06, 0.101805566459294409E+06, 0.101759497966033654E+06, + 0.101711369603787127E+06, 0.101663340792011426E+06, 0.101619227450208040E+06, 0.101582695699032221E+06, 0.101558695579259147E+06, + 0.101546029798913645E+06, 0.101545588074274448E+06, 0.101567771713567665E+06, 0.101607748589558381E+06, 0.101688531278736336E+06, + 0.101712604992569381E+06, 0.101743096832469848E+06, 0.101760620836449103E+06, 0.101769961191482769E+06, 0.101772822414354494E+06, + 0.101770897529126829E+06, 0.101765958574697099E+06, 0.101759443212774597E+06, 0.101753267088761611E+06, 0.101750523367411457E+06, + 0.101749706624054088E+06, 0.101749678109808025E+06, 0.101749285406108000E+06, 0.101744523322546709E+06, 0.101733022628531995E+06, + 0.101711787295703034E+06, 0.101679008351294804E+06, 0.101639130834085285E+06, 0.101593625025334943E+06, 0.101541393928166348E+06, + 0.101487105460277933E+06, 0.101434417444056598E+06, 0.101385551046964029E+06, 0.101342006161188154E+06, 0.101307140291916905E+06, + 0.101283659047930778E+06, 0.101280818499683781E+06, 0.101302531797972479E+06, 0.101335121595155433E+06, 0.101374651651055479E+06, + 0.101415853089015101E+06, 0.101456337388213346E+06, 0.101495434796083166E+06, 0.101530692665964845E+06, 0.101556780887815577E+06, + 0.101572252524485899E+06, 0.101580348283763422E+06, 0.101581288046389862E+06, 0.101573497525049606E+06, 0.101553231842264839E+06, + 0.101527699101148173E+06, 0.101500366015751919E+06, 0.101475147159402040E+06, 0.101462872833845016E+06, 0.101461553787802579E+06, + 0.101470899121458526E+06, 0.101491574771335596E+06, 0.101526109462851629E+06, 0.101575993595638676E+06, 0.101633539000189689E+06, + 0.101696017474012726E+06, 0.101760468358366721E+06, 0.101823741442191822E+06, 0.101882328042741588E+06, 0.101936367528451112E+06, + 0.101984427337493747E+06, 0.102025414498975340E+06, 0.102058638462272647E+06, 0.102075739484648249E+06, 0.102084208298001584E+06, + 0.102090352048999324E+06, 0.102097473483009948E+06, 0.100548208007167515E+06, 0.100605095427047316E+06, 0.100670706010579946E+06, + 0.100743978438203791E+06, 0.100823629545142438E+06, 0.100908178696427160E+06, 0.100995982580288008E+06, 0.101087314481146692E+06, + 0.101176414116338347E+06, 0.101262458356531424E+06, 0.101344547676157905E+06, 0.101421163164599711E+06, 0.101490796631980134E+06, + 0.101552014265238700E+06, 0.101603518886931997E+06, 0.101644210460807284E+06, 0.101673244462872826E+06, 0.101680735386759538E+06, + 0.101674706326058280E+06, 0.101655388783202914E+06, 0.101624670690422980E+06, 0.101584138623298597E+06, 0.101534372942937815E+06, + 0.101476149074961329E+06, 0.101410568098193849E+06, 0.101343974609530458E+06, 0.101270896963409337E+06, 0.101192137510717424E+06, + 0.101108880683603289E+06, 0.101022724309234283E+06, 0.100935715390839119E+06, 0.100850390680374665E+06, 0.100774745624155403E+06, + 0.100703597598235123E+06, 0.100641200968575649E+06, 0.100589854186508950E+06, 0.100551830710988637E+06, 0.100529267606730675E+06, + 0.100528295556730111E+06, 0.100549682448172025E+06, 0.100589658714417616E+06, 0.100646339245096955E+06, 0.100716647083594595E+06, + 0.100796330849082777E+06, 0.100862509969368170E+06, 0.100921980592583743E+06, 0.100978572070364797E+06, 0.101033342690100937E+06, + 0.101086524659137300E+06, 0.101137201268390738E+06, 0.101183872284207260E+06, 0.101229010938212319E+06, 0.101273109489612165E+06, + 0.101316619892713090E+06, 0.101361395459038307E+06, 0.101412097251747749E+06, 0.101462443230712757E+06, 0.101510984330326377E+06, + 0.101556016862365155E+06, 0.101593723038725308E+06, 0.101622224707454676E+06, 0.101642725690420295E+06, 0.101656123946685548E+06, + 0.101662476115757090E+06, 0.101646779923387396E+06, 0.101626132803217159E+06, 0.101605491482854268E+06, 0.101589147781629013E+06, + 0.101585251139149026E+06, 0.101593208937773641E+06, 0.101612184718608827E+06, 0.101643206312575028E+06, 0.101695818816071987E+06, + 0.101764928221785813E+06, 0.101840193899589591E+06, 0.101916494038259974E+06, 0.101982907500618603E+06, 0.102040970845980133E+06, + 0.102091837845918839E+06, 0.102134078254784647E+06, 0.102164394058369740E+06, 0.102183887971255608E+06, 0.102192909965391460E+06, + 0.102191628213096585E+06, 0.102180725302393228E+06, 0.102161729213580154E+06, 0.102136138522838941E+06, 0.102107142982990175E+06, + 0.102074807010027405E+06, 0.102039103318180598E+06, 0.102000767273371166E+06, 0.101960362993373739E+06, 0.101918302600709168E+06, + 0.101875356744285367E+06, 0.101830760544282428E+06, 0.101787058843222650E+06, 0.101746854946198102E+06, 0.101712081627763269E+06, + 0.101684170852595838E+06, 0.101663959106856215E+06, 0.101652494286064044E+06, 0.101669560085676902E+06, 0.101704444840698343E+06, + 0.101700571875176043E+06, 0.101721535240709272E+06, 0.101745779185469408E+06, 0.101743873285487498E+06, 0.101738112527286779E+06, + 0.101730354652939321E+06, 0.101722249363334777E+06, 0.101714810079808434E+06, 0.101708639567806546E+06, 0.101706113756708350E+06, + 0.101714036658689380E+06, 0.101722369687996295E+06, 0.101728359378835914E+06, 0.101725407412529981E+06, 0.101714092896974922E+06, + 0.101695958827062772E+06, 0.101670373525743838E+06, 0.101635678816692453E+06, 0.101595418488830386E+06, 0.101550830010831283E+06, + 0.101501001127021242E+06, 0.101448446456819016E+06, 0.101396954698346424E+06, 0.101348845039631386E+06, 0.101304062386825870E+06, + 0.101267451987425215E+06, 0.101242193004994537E+06, 0.101233636404356381E+06, 0.101254846780972948E+06, 0.101287816325990920E+06, + 0.101328479900242310E+06, 0.101372263340125617E+06, 0.101414617472293321E+06, 0.101455579958959497E+06, 0.101492853465017077E+06, + 0.101523278594798670E+06, 0.101540885808085994E+06, 0.101551450070809791E+06, 0.101555278183125236E+06, 0.101552538038431827E+06, + 0.101533468414678850E+06, 0.101508500675057512E+06, 0.101482796927905787E+06, 0.101462379842144772E+06, 0.101454892688142470E+06, + 0.101464325466535738E+06, 0.101484135316789325E+06, 0.101513829601535981E+06, 0.101552601163330517E+06, 0.101603687744035284E+06, + 0.101663791684624332E+06, 0.101727767774695865E+06, 0.101792762408730807E+06, 0.101856171640086162E+06, 0.101914393070144404E+06, + 0.101966522189743861E+06, 0.102012469486766611E+06, 0.102051444457628037E+06, 0.102084940153698932E+06, 0.102109046172999864E+06, + 0.102120432478447823E+06, 0.102128404810622902E+06, 0.102134103220031029E+06, 0.100537775584916468E+06, 0.100594064464056602E+06, + 0.100658361556240663E+06, 0.100729672253821584E+06, 0.100806792979668055E+06, 0.100888331818478662E+06, 0.100972640703881028E+06, + 0.101054356923499276E+06, 0.101136218305642746E+06, 0.101218059282136164E+06, 0.101297128938538604E+06, 0.101371075949467442E+06, + 0.101438396724319813E+06, 0.101497631946100053E+06, 0.101547424352719638E+06, 0.101586575081165560E+06, 0.101605344305898223E+06, + 0.101611802560867160E+06, 0.101607062825132700E+06, 0.101591492022024759E+06, 0.101565740711957988E+06, 0.101530433274754861E+06, + 0.101485334233030881E+06, 0.101432291750987933E+06, 0.101377329376169117E+06, 0.101317207789115375E+06, 0.101251671625233779E+06, + 0.101181417558871472E+06, 0.101107498655681804E+06, 0.101031350521440603E+06, 0.100954821051961742E+06, 0.100889588668171375E+06, + 0.100831564213864112E+06, 0.100778330447916189E+06, 0.100731315465427993E+06, 0.100686629349019524E+06, 0.100649847468544394E+06, + 0.100626941602005361E+06, 0.100623247975728824E+06, 0.100634858419738637E+06, 0.100661484011766472E+06, 0.100701891329741135E+06, + 0.100753800334865009E+06, 0.100807541818709986E+06, 0.100848659308669099E+06, 0.100892548219874385E+06, 0.100938268977634565E+06, + 0.100984815257879964E+06, 0.101031244555508310E+06, 0.101077229148432787E+06, 0.101120811543651638E+06, 0.101163080762204729E+06, + 0.101205133328227632E+06, 0.101247555470727515E+06, 0.101295212705033598E+06, 0.101345677435592734E+06, 0.101395414916676789E+06, + 0.101443142113523310E+06, 0.101487391928729412E+06, 0.101523112860496927E+06, 0.101551091220213115E+06, 0.101571202362138647E+06, + 0.101582765233024111E+06, 0.101580576420733298E+06, 0.101559006090641735E+06, 0.101532638260340871E+06, 0.101505636854472148E+06, + 0.101482925905383032E+06, 0.101478221569192814E+06, 0.101483749961331385E+06, 0.101500913638159356E+06, 0.101531272427147036E+06, + 0.101587537367870260E+06, 0.101657752923680528E+06, 0.101735341257440305E+06, 0.101815392189158199E+06, 0.101883415778570139E+06, + 0.101946670918334348E+06, 0.102005217869353437E+06, 0.102057696492837160E+06, 0.102103056512906318E+06, 0.102140317424393026E+06, + 0.102168554530401248E+06, 0.102186118819968382E+06, 0.102192209463688341E+06, 0.102189750578587409E+06, 0.102179864477714669E+06, + 0.102164622014063440E+06, 0.102144222519251431E+06, 0.102119031801210527E+06, 0.102090001778615697E+06, 0.102058500322085427E+06, + 0.102024456224525828E+06, 0.101988984142914618E+06, 0.101952414757101811E+06, 0.101915891308398845E+06, 0.101881589770049075E+06, + 0.101851270386932039E+06, 0.101822396029631869E+06, 0.101797879312661476E+06, 0.101778855518825338E+06, 0.101766764384149530E+06, + 0.101767117846749301E+06, 0.101765125533417420E+06, 0.101764893632733350E+06, 0.101755791518637372E+06, 0.101738415072208983E+06, + 0.101717693412627370E+06, 0.101697849566573597E+06, 0.101679653680022544E+06, 0.101666036116405725E+06, 0.101657802915804903E+06, + 0.101659358381537619E+06, 0.101675042132274451E+06, 0.101690591932105221E+06, 0.101702102691112683E+06, 0.101698890266004499E+06, + 0.101685170063431069E+06, 0.101664399827034271E+06, 0.101636981850683907E+06, 0.101602430202209493E+06, 0.101562887328751778E+06, + 0.101519409569218289E+06, 0.101470958313536248E+06, 0.101419317694792786E+06, 0.101368660117972962E+06, 0.101321145110236859E+06, + 0.101276071087296979E+06, 0.101238240695380387E+06, 0.101211277007847661E+06, 0.101197902530338179E+06, 0.101215581555680212E+06, + 0.101246094621904544E+06, 0.101284825497456564E+06, 0.101328072813235674E+06, 0.101370225701783012E+06, 0.101411514155655474E+06, + 0.101449747457354388E+06, 0.101482930506732373E+06, 0.101505336383574511E+06, 0.101520932260299305E+06, 0.101530875621757339E+06, + 0.101535660531138637E+06, 0.101527586118792417E+06, 0.101509422337400800E+06, 0.101491464951296075E+06, 0.101477501245060659E+06, + 0.101471117495995146E+06, 0.101486007619632292E+06, 0.101510757134502812E+06, 0.101544449952577212E+06, 0.101586055913800505E+06, + 0.101635695535260849E+06, 0.101695729268481853E+06, 0.101758721424995805E+06, 0.101822050355179599E+06, 0.101883639102236455E+06, + 0.101943513401448537E+06, 0.101994845858460889E+06, 0.102039591261445501E+06, 0.102076829661285185E+06, 0.102105964877399136E+06, + 0.102126794141653125E+06, 0.102139212624906431E+06, 0.102146437567661822E+06, 0.102150500772487969E+06, 0.100529766660700814E+06, + 0.100584936771645967E+06, 0.100647449978120101E+06, 0.100716367627817162E+06, 0.100790551176116554E+06, 0.100867761991881081E+06, + 0.100944392016551021E+06, 0.101022283363768598E+06, 0.101100094859150340E+06, 0.101176390860314190E+06, 0.101249683961219664E+06, + 0.101319429056106397E+06, 0.101383533080313195E+06, 0.101439851116198683E+06, 0.101486953091034593E+06, 0.101514035380600777E+06, + 0.101530274350960754E+06, 0.101536503930903316E+06, 0.101532791192708028E+06, 0.101519414459226711E+06, 0.101496896545514726E+06, + 0.101466032997577611E+06, 0.101427914819550628E+06, 0.101386928031759133E+06, 0.101339510051842895E+06, 0.101286534144961479E+06, + 0.101229073267725224E+06, 0.101167697805292846E+06, 0.101103306882333491E+06, 0.101037149535454111E+06, 0.100976699320003900E+06, + 0.100924651148493227E+06, 0.100875357695395811E+06, 0.100829790933326149E+06, 0.100789063316662927E+06, 0.100754382631035871E+06, + 0.100727001544673127E+06, 0.100712812235705482E+06, 0.100707393276471601E+06, 0.100709250582931563E+06, 0.100722573388958059E+06, + 0.100746645734061545E+06, 0.100779895700786001E+06, 0.100804396943602027E+06, 0.100830073367685545E+06, 0.100859556300720957E+06, + 0.100892387870409642E+06, 0.100927975633083144E+06, 0.100965551602012056E+06, 0.101004683619487085E+06, 0.101045330597207460E+06, + 0.101087013008305672E+06, 0.101129446011777312E+06, 0.101173089623770706E+06, 0.101224746709176397E+06, 0.101276086346010212E+06, + 0.101326149198708168E+06, 0.101374129662616979E+06, 0.101418481717269460E+06, 0.101456308681409500E+06, 0.101487100471046055E+06, + 0.101509891159304345E+06, 0.101523887972284254E+06, 0.101519085107067789E+06, 0.101499035636973305E+06, 0.101474107212159681E+06, + 0.101448532598947975E+06, 0.101428087461135481E+06, 0.101420183587270294E+06, 0.101421890388346379E+06, 0.101434924963140438E+06, + 0.101461175739645623E+06, 0.101512942173575240E+06, 0.101576674737662266E+06, 0.101648311032956131E+06, 0.101723489882150840E+06, + 0.101787480132178534E+06, 0.101850028038504926E+06, 0.101910282046108841E+06, 0.101967661149882086E+06, 0.102023524732844948E+06, + 0.102074242265323439E+06, 0.102118210977073832E+06, 0.102152171123111169E+06, 0.102173114540454029E+06, 0.102185669537254769E+06, + 0.102190716001940251E+06, 0.102189608656019511E+06, 0.102183136999173483E+06, 0.102171644521202223E+06, 0.102155743904811548E+06, + 0.102135288964191917E+06, 0.102110694874428111E+06, 0.102083194402445937E+06, 0.102053140888443799E+06, 0.102023029614340878E+06, + 0.101994305634375618E+06, 0.101968130490490352E+06, 0.101944981816832049E+06, 0.101917533305451230E+06, 0.101891792228334729E+06, + 0.101867962161627947E+06, 0.101846942835226117E+06, 0.101828399128989535E+06, 0.101808349218342468E+06, 0.101783185169399527E+06, + 0.101752129728330387E+06, 0.101717730687555537E+06, 0.101682415904166002E+06, 0.101651064189548269E+06, 0.101628214835530569E+06, + 0.101615101470726600E+06, 0.101622078677434256E+06, 0.101640462768905272E+06, 0.101659951220889372E+06, 0.101675418801938606E+06, + 0.101673225878615136E+06, 0.101661928138148622E+06, 0.101642662123728296E+06, 0.101615888022248750E+06, 0.101582080924031965E+06, + 0.101543348953446970E+06, 0.101500631267208417E+06, 0.101452586432289259E+06, 0.101401256146737229E+06, 0.101350655526253569E+06, + 0.101302884790491065E+06, 0.101258041134635379E+06, 0.101219975854280870E+06, 0.101192075948155878E+06, 0.101176911767419486E+06, + 0.101189137340948175E+06, 0.101215695508690798E+06, 0.101250828629981872E+06, 0.101291224981271953E+06, 0.101331080207125036E+06, + 0.101370380504028988E+06, 0.101408081153893057E+06, 0.101442820210735677E+06, 0.101470980944890180E+06, 0.101493569638212546E+06, + 0.101512139169726375E+06, 0.101526611096755121E+06, 0.101532495997983948E+06, 0.101522627542459595E+06, 0.101512420265735462E+06, + 0.101505304745591246E+06, 0.101504334695817597E+06, 0.101519650872094615E+06, 0.101547899391185740E+06, 0.101583965970937570E+06, + 0.101627433236286277E+06, 0.101678082609776582E+06, 0.101737298190423375E+06, 0.101799968663717998E+06, 0.101862212637869627E+06, + 0.101921525254885390E+06, 0.101975615485969174E+06, 0.102022129365600340E+06, 0.102060753757629835E+06, 0.102091435012152549E+06, + 0.102114037703653419E+06, 0.102128864386004381E+06, 0.102136712377933785E+06, 0.102141341896670521E+06, 0.102142376150148193E+06, + 0.100523535976660394E+06, 0.100577052820581303E+06, 0.100637236479140498E+06, 0.100703252727134633E+06, 0.100772552025250538E+06, + 0.100843355148487011E+06, 0.100916200005643404E+06, 0.100989978980367348E+06, 0.101063458978865412E+06, 0.101135313180651341E+06, + 0.101204158192835064E+06, 0.101268596961150513E+06, 0.101327267803054579E+06, 0.101379219393509498E+06, 0.101411658551840825E+06, + 0.101435013304419204E+06, 0.101449723991433348E+06, 0.101455671589434161E+06, 0.101452876078218949E+06, 0.101441532989260799E+06, + 0.101422046210621003E+06, 0.101395056661309005E+06, 0.101365757780455795E+06, 0.101332677387078918E+06, 0.101293673363073496E+06, + 0.101249457127459696E+06, 0.101201011753970408E+06, 0.101149108558075517E+06, 0.101094587629913221E+06, 0.101040779590145175E+06, + 0.100995382496306906E+06, 0.100951579695860622E+06, 0.100909850434587090E+06, 0.100870858422985533E+06, 0.100835419863702089E+06, + 0.100804467614276640E+06, 0.100781685669042199E+06, 0.100767335396187831E+06, 0.100759289879836622E+06, 0.100757866722066232E+06, + 0.100763078005519506E+06, 0.100774506516805646E+06, 0.100786062954307781E+06, 0.100793269206959361E+06, 0.100804822422906916E+06, + 0.100820834091496698E+06, 0.100841255618750598E+06, 0.100865889078778535E+06, 0.100894749198775666E+06, 0.100927416956011424E+06, + 0.100963395796724551E+06, 0.101002315623510774E+06, 0.101043887250100248E+06, 0.101091039191901757E+06, 0.101144066547046401E+06, + 0.101197932497966991E+06, 0.101251195535936524E+06, 0.101302429885710808E+06, 0.101350642114984890E+06, 0.101394018940216731E+06, + 0.101430608604817069E+06, 0.101459057570376521E+06, 0.101478044590623220E+06, 0.101475387865733283E+06, 0.101461856537208994E+06, + 0.101443018892087159E+06, 0.101422586718123261E+06, 0.101406882059484167E+06, 0.101400350668646613E+06, 0.101401136819027641E+06, + 0.101411047287252732E+06, 0.101432998273655045E+06, 0.101475019664207721E+06, 0.101526976345226532E+06, 0.101585936905203198E+06, + 0.101648470322235924E+06, 0.101703644183282871E+06, 0.101759331828263079E+06, 0.101814866055730265E+06, 0.101869901220545507E+06, + 0.101928914084517004E+06, 0.101985712555209233E+06, 0.102038213057230983E+06, 0.102083503006818413E+06, 0.102116318481194263E+06, + 0.102142478770143352E+06, 0.102162510227578357E+06, 0.102176745632176331E+06, 0.102185382260760132E+06, 0.102189351865029588E+06, + 0.102188985060908250E+06, 0.102181978502190381E+06, 0.102166343098074416E+06, 0.102144949217122790E+06, 0.102118539343817305E+06, + 0.102090320241642432E+06, 0.102064949154931208E+06, 0.102041510471142406E+06, 0.102020894051233234E+06, 0.102002076919490239E+06, + 0.101978687982916701E+06, 0.101949947159686926E+06, 0.101920721729201105E+06, 0.101890840787188339E+06, 0.101858502442174227E+06, + 0.101821787050020226E+06, 0.101779170614060145E+06, 0.101731633607835785E+06, 0.101683872606227975E+06, 0.101641706250363815E+06, + 0.101609757163432500E+06, 0.101594408710602715E+06, 0.101599861763739507E+06, 0.101615600568650814E+06, 0.101634792862023707E+06, + 0.101649560822422354E+06, 0.101653324074520948E+06, 0.101647718645786255E+06, 0.101632892509714380E+06, 0.101607498410070068E+06, + 0.101573604987650251E+06, 0.101534332171428061E+06, 0.101490882315485491E+06, 0.101441914985506301E+06, 0.101390598505943577E+06, + 0.101340225499994325E+06, 0.101292893172337470E+06, 0.101249121490931240E+06, 0.101212206615971038E+06, 0.101184803983927792E+06, + 0.101169090523178049E+06, 0.101177216406820677E+06, 0.101199121436619549E+06, 0.101229487274117826E+06, 0.101265433425285810E+06, + 0.101301460838134211E+06, 0.101337546551032807E+06, 0.101373572179327981E+06, 0.101408481747705810E+06, 0.101441269413672373E+06, + 0.101471589979924611E+06, 0.101499094210238720E+06, 0.101523046431578827E+06, 0.101542483002773370E+06, 0.101543831013172356E+06, + 0.101544064378257113E+06, 0.101546276856648081E+06, 0.101553107004487800E+06, 0.101570758226424994E+06, 0.101603899362922981E+06, + 0.101643466171828870E+06, 0.101688020902613556E+06, 0.101736066489577410E+06, 0.101788778651382352E+06, 0.101846229772819366E+06, + 0.101902087545993330E+06, 0.101954243560902876E+06, 0.102000912067655503E+06, 0.102040460468150268E+06, 0.102070397922830496E+06, + 0.102092123176266672E+06, 0.102106027606901625E+06, 0.102112955537274407E+06, 0.102114233430400913E+06, 0.102110160726652859E+06, + 0.102103564706523437E+06, 0.100518689604693471E+06, 0.100570188968489383E+06, 0.100627085580226092E+06, 0.100688425846865008E+06, + 0.100752801664219747E+06, 0.100819711434372482E+06, 0.100888275239485200E+06, 0.100957467842034559E+06, 0.101026141537060103E+06, + 0.101093053338000958E+06, 0.101156896762082222E+06, 0.101216338486683555E+06, 0.101270050228910055E+06, 0.101303959592322863E+06, + 0.101331155104026548E+06, 0.101351367252466414E+06, 0.101364631606699608E+06, 0.101370354947362532E+06, 0.101368511938952593E+06, + 0.101359219879845390E+06, 0.101342770712901329E+06, 0.101323279228074665E+06, 0.101301442257920979E+06, 0.101274216777385765E+06, + 0.101241963101549714E+06, 0.101205245491941663E+06, 0.101164856326946916E+06, 0.101121839477416492E+06, 0.101077512757932636E+06, + 0.101040769978266762E+06, 0.101003816768457153E+06, 0.100967482943484662E+06, 0.100932599047362921E+06, 0.100899538621347674E+06, + 0.100868835073115974E+06, 0.100841822788138859E+06, 0.100822146543393857E+06, 0.100806275342578825E+06, 0.100794425676255967E+06, + 0.100786746583171247E+06, 0.100783223558698664E+06, 0.100783580356914550E+06, 0.100777240593710594E+06, 0.100772797244677698E+06, + 0.100771995893256535E+06, 0.100775628518037935E+06, 0.100784330892865575E+06, 0.100798832415402489E+06, 0.100819830174998613E+06, + 0.100845869940026445E+06, 0.100876821716840641E+06, 0.100912505059014773E+06, 0.100952732377084161E+06, 0.101002888396750073E+06, + 0.101057716858402928E+06, 0.101114463416698447E+06, 0.101171669964558023E+06, 0.101227895955215106E+06, 0.101283382095900626E+06, + 0.101334958226825765E+06, 0.101380444142405948E+06, 0.101418245220739525E+06, 0.101446407440058887E+06, 0.101450870781566424E+06, + 0.101446840525337553E+06, 0.101437171069169228E+06, 0.101424931486162226E+06, 0.101415799787063268E+06, 0.101412071436230064E+06, + 0.101412950725123417E+06, 0.101420014842418866E+06, 0.101435968083775937E+06, 0.101466352271600088E+06, 0.101503661068658505E+06, + 0.101546063702057072E+06, 0.101591631627750539E+06, 0.101633780932880036E+06, 0.101677233535571504E+06, 0.101722001382731454E+06, + 0.101768084603012278E+06, 0.101821697636718192E+06, 0.101876504987276159E+06, 0.101929725277785576E+06, 0.101979436992402916E+06, + 0.102021048948978249E+06, 0.102058738337406423E+06, 0.102093407361196325E+06, 0.102125483850517805E+06, 0.102150396359340550E+06, + 0.102169939569479524E+06, 0.102183985952502859E+06, 0.102191376525420768E+06, 0.102185685603385369E+06, 0.102169450367412603E+06, + 0.102146358644484295E+06, 0.102119842646822071E+06, 0.102094075555721618E+06, 0.102073636097204362E+06, 0.102056299206566269E+06, + 0.102039605800132485E+06, 0.102021374390271580E+06, 0.101998770599080817E+06, 0.101970853166201807E+06, 0.101937971227922506E+06, + 0.101900413338984057E+06, 0.101857321774920129E+06, 0.101808436773914334E+06, 0.101755010517902134E+06, 0.101701108954033160E+06, + 0.101652170013780356E+06, 0.101614009141804403E+06, 0.101594396568573589E+06, 0.101591391668390439E+06, 0.101601222158549106E+06, + 0.101618244864968845E+06, 0.101635666146591233E+06, 0.101645911116270872E+06, 0.101646699642323045E+06, 0.101636431221179548E+06, + 0.101609654908569675E+06, 0.101575048385323738E+06, 0.101534330175456344E+06, 0.101489532139668852E+06, 0.101438185377782967E+06, + 0.101385959560380783E+06, 0.101335194667244825E+06, 0.101287926354806812E+06, 0.101245203663320397E+06, 0.101209646717536321E+06, + 0.101183113534233489E+06, 0.101167399256673903E+06, 0.101173255047212093E+06, 0.101191266867459737E+06, 0.101217555082850216E+06, + 0.101249738922742486E+06, 0.101282540292244405E+06, 0.101316175523455371E+06, 0.101351248733287808E+06, 0.101387035478988051E+06, + 0.101423676548066695E+06, 0.101461316613871037E+06, 0.101497507316982592E+06, 0.101531170814716766E+06, 0.101561263551730270E+06, + 0.101576206116756410E+06, 0.101586714996634080E+06, 0.101597778963160541E+06, 0.101611464789349586E+06, 0.101630169532632644E+06, + 0.101664927306783313E+06, 0.101704113353483583E+06, 0.101746416585083251E+06, 0.101790584390523509E+06, 0.101835630759291264E+06, + 0.101885286326592308E+06, 0.101932452931491775E+06, 0.101975582690834839E+06, 0.102013491689891205E+06, 0.102045391567770363E+06, + 0.102064776694095723E+06, 0.102074647376751818E+06, 0.102077355461506435E+06, 0.102073009372423272E+06, 0.102062037114194260E+06, + 0.102045197475351029E+06, 0.102032862053345467E+06, 0.100516203599419721E+06, 0.100565218916304395E+06, 0.100617260891664730E+06, + 0.100673956912948721E+06, 0.100734470974993252E+06, 0.100796865106346027E+06, 0.100860518975916333E+06, 0.100924514220946570E+06, + 0.100987769915576093E+06, 0.101049106773664753E+06, 0.101107273840837661E+06, 0.101159905161335395E+06, 0.101194545284544540E+06, + 0.101223680392232840E+06, 0.101247089234949191E+06, 0.101264590537126525E+06, 0.101276076890375974E+06, 0.101281552099694847E+06, + 0.101280982310362175E+06, 0.101273943686812767E+06, 0.101262940282394411E+06, 0.101250027136122240E+06, 0.101232503141791327E+06, + 0.101210483653828545E+06, 0.101184228737493526E+06, 0.101154165002910086E+06, 0.101120906752935975E+06, 0.101085276329601198E+06, + 0.101055059197187191E+06, 0.101026747435691374E+06, 0.100998039675420368E+06, 0.100969366867174089E+06, 0.100941239345533730E+06, + 0.100914229378812437E+06, 0.100888324815689179E+06, 0.100866108957016506E+06, 0.100846788167441075E+06, 0.100829635550168416E+06, + 0.100814589974162533E+06, 0.100801624509251793E+06, 0.100790670060632678E+06, 0.100777235449754880E+06, 0.100759761272309115E+06, + 0.100744498201414157E+06, 0.100732510380326974E+06, 0.100724806452672536E+06, 0.100722312648745443E+06, 0.100727124797232929E+06, + 0.100739250727341408E+06, 0.100757924088756554E+06, 0.100783210335334952E+06, 0.100815143464493012E+06, 0.100854893070929611E+06, + 0.100907659832364327E+06, 0.100964923673006793E+06, 0.101024919613124526E+06, 0.101086575092280807E+06, 0.101148693938726588E+06, + 0.101212491181683130E+06, 0.101273236178490639E+06, 0.101328963344270000E+06, 0.101377761563192791E+06, 0.101415272026218052E+06, + 0.101431876200949133E+06, 0.101440210101162083E+06, 0.101442472419936472E+06, 0.101441025799434588E+06, 0.101440273436921474E+06, + 0.101441412028859413E+06, 0.101444242700126299E+06, 0.101450026358596937E+06, 0.101460476599565445E+06, 0.101479171248484825E+06, + 0.101501585380914767E+06, 0.101526832551874162E+06, 0.101554045751632453E+06, 0.101581088175181358E+06, 0.101609436210866566E+06, + 0.101639553558900094E+06, 0.101671699640266219E+06, 0.101712219603055011E+06, 0.101758423241378463E+06, 0.101805738585399682E+06, + 0.101852962314692355E+06, 0.101899310754771403E+06, 0.101946265190960024E+06, 0.101994211955312698E+06, 0.102041986736160048E+06, + 0.102085797585756969E+06, 0.102118247218596109E+06, 0.102143944256965377E+06, 0.102160780837746963E+06, 0.102166943569605079E+06, + 0.102158326056491831E+06, 0.102140886616651740E+06, 0.102119658913957755E+06, 0.102098499930418155E+06, 0.102080904999102844E+06, + 0.102066516422517074E+06, 0.102054504472527260E+06, 0.102039748545332608E+06, 0.102020600907278713E+06, 0.101995196360471018E+06, + 0.101963875490564329E+06, 0.101926792596088359E+06, 0.101883686482137069E+06, 0.101834681537134267E+06, 0.101781342698296125E+06, + 0.101725325815194636E+06, 0.101672635846780700E+06, 0.101631506833831096E+06, 0.101606236395939879E+06, 0.101597475949642787E+06, + 0.101603731801431582E+06, 0.101625616805930535E+06, 0.101646355193644980E+06, 0.101660903200991379E+06, 0.101665697733909154E+06, + 0.101654090491919997E+06, 0.101628201204639379E+06, 0.101592718579965003E+06, 0.101550440364196067E+06, 0.101501865690094695E+06, + 0.101447993110863157E+06, 0.101394085224710812E+06, 0.101342099839650211E+06, 0.101293810362817196E+06, 0.101250946740538144E+06, + 0.101215426073013630E+06, 0.101188872150540003E+06, 0.101172928312290038E+06, 0.101177855232292422E+06, 0.101192799356549629E+06, + 0.101215813274799773E+06, 0.101244944643138500E+06, 0.101275131726042877E+06, 0.101307174081444085E+06, 0.101341749283816956E+06, + 0.101378289914467692E+06, 0.101417332589792815E+06, 0.101459925058367837E+06, 0.101502062670976826E+06, 0.101542401965262659E+06, + 0.101579707707947498E+06, 0.101605443608385016E+06, 0.101624638835457939E+06, 0.101643143897028465E+06, 0.101662631727210814E+06, + 0.101684583160134658E+06, 0.101717073342919160E+06, 0.101753756733753267E+06, 0.101791888041425977E+06, 0.101829704004501327E+06, + 0.101866836453342432E+06, 0.101904943611418348E+06, 0.101941838182645661E+06, 0.101974805182480457E+06, 0.102002312012851093E+06, + 0.102022951004307251E+06, 0.102034588422611414E+06, 0.102035115083442288E+06, 0.102027670824049870E+06, 0.102012988929236992E+06, + 0.101992061827493861E+06, 0.101966142466949459E+06, 0.101941390128694227E+06, 0.100514970796833106E+06, 0.100558835077606142E+06, + 0.100607260398477549E+06, 0.100659655071357542E+06, 0.100715265417817398E+06, 0.100773178786940116E+06, 0.100832331209467477E+06, + 0.100890717506978282E+06, 0.100947860531606886E+06, 0.101002917974898708E+06, 0.101052195859970219E+06, 0.101086008388641625E+06, + 0.101115273930014009E+06, 0.101139857117029198E+06, 0.101159622269959131E+06, 0.101174458955507551E+06, 0.101184310219007501E+06, + 0.101189203551941042E+06, 0.101189284643897758E+06, 0.101186114007991724E+06, 0.101181270068826241E+06, 0.101171908271853448E+06, + 0.101158297091944536E+06, 0.101141013465808763E+06, 0.101120226925708761E+06, 0.101096239397641839E+06, 0.101069503529764173E+06, + 0.101044711943530012E+06, 0.101023498931715556E+06, 0.101001656961748697E+06, 0.100979308414565210E+06, 0.100956646567351941E+06, + 0.100933930245713549E+06, 0.100911474196776457E+06, 0.100891471408871366E+06, 0.100874184642035718E+06, 0.100856582877880370E+06, + 0.100838800023023141E+06, 0.100821055717833835E+06, 0.100804211342234223E+06, 0.100787393558680691E+06, 0.100761008720101294E+06, + 0.100734732500141792E+06, 0.100710174312875781E+06, 0.100688451173672947E+06, 0.100670708926784253E+06, 0.100658093134885828E+06, + 0.100653547542059678E+06, 0.100656000772829168E+06, 0.100665921580032358E+06, 0.100683713857153736E+06, 0.100709718860814537E+06, + 0.100748801228508208E+06, 0.100801823503565058E+06, 0.100861225414351109E+06, 0.100925234962917515E+06, 0.100992162379509042E+06, + 0.101061180367843728E+06, 0.101132825200904612E+06, 0.101202551905614309E+06, 0.101268249128093084E+06, 0.101327796560415067E+06, + 0.101375435871056281E+06, 0.101404641442907785E+06, 0.101425758115715638E+06, 0.101440394650381306E+06, 0.101450217422559756E+06, + 0.101458727822546076E+06, 0.101466619611513932E+06, 0.101473463661342525E+06, 0.101480183000528341E+06, 0.101487645084924108E+06, + 0.101498004691627488E+06, 0.101508871394480026E+06, 0.101520205876727661E+06, 0.101532083912951843E+06, 0.101544647478942308E+06, + 0.101558096380653675E+06, 0.101573050568899664E+06, 0.101590428478391070E+06, 0.101613972514299414E+06, 0.101648920007989669E+06, + 0.101687381188284504E+06, 0.101728410452743919E+06, 0.101771447499673959E+06, 0.101823102602039115E+06, 0.101880173737650490E+06, + 0.101939952057504197E+06, 0.101998671132745076E+06, 0.102047778748635392E+06, 0.102081283700837084E+06, 0.102104626314851310E+06, + 0.102117132803555040E+06, 0.102118423258010647E+06, 0.102110210033883151E+06, 0.102097574911021075E+06, 0.102084451243621195E+06, + 0.102073635202554215E+06, 0.102064362043080371E+06, 0.102055076068754133E+06, 0.102042482878204013E+06, 0.102025288372749041E+06, + 0.102001685111197468E+06, 0.101971967159961292E+06, 0.101935955157193923E+06, 0.101893991729276575E+06, 0.101846831752592378E+06, + 0.101795519670136433E+06, 0.101743547706146055E+06, 0.101695867126943878E+06, 0.101657509946900449E+06, 0.101633507015335563E+06, + 0.101630312812292759E+06, 0.101646392192630388E+06, 0.101668889131485266E+06, 0.101690704618882228E+06, 0.101706951776862203E+06, + 0.101710803657395867E+06, 0.101698215938497582E+06, 0.101672792047461742E+06, 0.101636565396570542E+06, 0.101592796399993240E+06, + 0.101539557371443312E+06, 0.101482505549964961E+06, 0.101424993232468783E+06, 0.101369854642081831E+06, 0.101318588912198626E+06, + 0.101273234899637857E+06, 0.101235886605930398E+06, 0.101207937266056106E+06, 0.101192654572110885E+06, 0.101195023201913122E+06, + 0.101207165308628755E+06, 0.101227217799392965E+06, 0.101253372828479289E+06, 0.101281097568006837E+06, 0.101311856149601605E+06, + 0.101345648585710995E+06, 0.101381904947258168E+06, 0.101421272631944972E+06, 0.101465042995991040E+06, 0.101508835313142772E+06, + 0.101551196503329018E+06, 0.101590747790927970E+06, 0.101621682377021876E+06, 0.101645776231220763E+06, 0.101668026172758953E+06, + 0.101689491310640093E+06, 0.101711039834481373E+06, 0.101739312046503386E+06, 0.101772112447843610E+06, 0.101804858575323728E+06, + 0.101836540790179512E+06, 0.101866167898941654E+06, 0.101895518959796798E+06, 0.101925181845865300E+06, 0.101950074886373186E+06, + 0.101969061543749413E+06, 0.101981139844382837E+06, 0.101985462621642117E+06, 0.101977051366888656E+06, 0.101959701573010476E+06, + 0.101935377351789808E+06, 0.101905526341066099E+06, 0.101871781260336036E+06, 0.101835950124052295E+06, 0.100513581366792612E+06, + 0.100554019513422492E+06, 0.100598330045055409E+06, 0.100645982440550681E+06, 0.100696296648474527E+06, 0.100748444268485124E+06, + 0.100801453596632928E+06, 0.100854218792530621E+06, 0.100905513420273754E+06, 0.100949903492433834E+06, 0.100981652101286920E+06, + 0.101009573882022771E+06, 0.101033642379315977E+06, 0.101053802681678295E+06, 0.101069990410599494E+06, 0.101082152783372076E+06, + 0.101090271780979238E+06, 0.101094389439540580E+06, 0.101095654589873608E+06, 0.101096426446181518E+06, 0.101093666576257223E+06, + 0.101087429979991794E+06, 0.101077885304853742E+06, 0.101065339866105438E+06, 0.101050264366095507E+06, 0.101032061623940666E+06, + 0.101012844290179608E+06, 0.100996964302313558E+06, 0.100980770382518007E+06, 0.100964167390490678E+06, 0.100947108284160218E+06, + 0.100929597010366851E+06, 0.100911688070060860E+06, 0.100893582156858451E+06, 0.100881499094758808E+06, 0.100868335774262508E+06, + 0.100853829088449522E+06, 0.100837798044627038E+06, 0.100820106254778977E+06, 0.100800619132333683E+06, 0.100775042434612522E+06, + 0.100741873481754403E+06, 0.100707732498585203E+06, 0.100674198173852987E+06, 0.100642873485934600E+06, 0.100616787946543613E+06, + 0.100595574493244218E+06, 0.100580853452354946E+06, 0.100573369371954352E+06, 0.100573991194533155E+06, 0.100583507950136642E+06, + 0.100602650207284896E+06, 0.100640744734742359E+06, 0.100692244893923940E+06, 0.100751760770043053E+06, 0.100817532941637197E+06, + 0.100887787830291069E+06, 0.100962050144272376E+06, 0.101039744081827113E+06, 0.101116778936214221E+06, 0.101190892544115282E+06, + 0.101259778024939151E+06, 0.101317175633898092E+06, 0.101357978697233921E+06, 0.101390994520218446E+06, 0.101417406025828648E+06, + 0.101438439369066997E+06, 0.101456877295130529E+06, 0.101473268310223793E+06, 0.101486701484946811E+06, 0.101497860785624449E+06, + 0.101507276039524368E+06, 0.101514237723266677E+06, 0.101518949933443597E+06, 0.101522085026395580E+06, 0.101524243387710812E+06, + 0.101525990459469860E+06, 0.101528194232853784E+06, 0.101531700114421837E+06, 0.101537410817429205E+06, 0.101546492305229593E+06, + 0.101567903398293696E+06, 0.101597046994887613E+06, 0.101630996885802393E+06, 0.101669578744430226E+06, 0.101714590729228381E+06, + 0.101773403370424989E+06, 0.101836874445576148E+06, 0.101900881795697991E+06, 0.101960687121667026E+06, 0.102008686461021774E+06, + 0.102037960319300764E+06, 0.102056196723826288E+06, 0.102065273055902842E+06, 0.102066914347914004E+06, 0.102063547681288721E+06, + 0.102059509493393372E+06, 0.102055314339710254E+06, 0.102050951292832178E+06, 0.102044111461623615E+06, 0.102032193928193665E+06, + 0.102014558041099997E+06, 0.101990243188425869E+06, 0.101960364538554975E+06, 0.101925773749474116E+06, 0.101887402236031689E+06, + 0.101845900309227552E+06, 0.101802685936693102E+06, 0.101760172705529054E+06, 0.101722211673123806E+06, 0.101698120911338105E+06, + 0.101693242621827798E+06, 0.101701200555816351E+06, 0.101719376001235738E+06, 0.101743123574903206E+06, 0.101765016750218143E+06, + 0.101780249253377129E+06, 0.101783141086790420E+06, 0.101773015434274668E+06, 0.101749944711398595E+06, 0.101715364981995837E+06, + 0.101666832632786492E+06, 0.101609705385936162E+06, 0.101549151532732372E+06, 0.101488088183680564E+06, 0.101428826013168145E+06, + 0.101371975824192647E+06, 0.101321130368394268E+06, 0.101278514950626632E+06, 0.101245823084732416E+06, 0.101229713571326531E+06, + 0.101228252523962350E+06, 0.101236240082679593E+06, 0.101252202249213733E+06, 0.101274554004038626E+06, 0.101299571284751277E+06, + 0.101328619250470016E+06, 0.101360846988672172E+06, 0.101395461438518367E+06, 0.101432766703864487E+06, 0.101473307204623023E+06, + 0.101514010222445781E+06, 0.101553562190150420E+06, 0.101590717887284656E+06, 0.101621853851409600E+06, 0.101647543893485548E+06, + 0.101671058814602424E+06, 0.101693056210828203E+06, 0.101714129349830531E+06, 0.101738767714405170E+06, 0.101767638107703999E+06, + 0.101795424880191335E+06, 0.101821375190827370E+06, 0.101844797381800585E+06, 0.101865803928462847E+06, 0.101887241456978605E+06, + 0.101903742329332832E+06, 0.101914505259923375E+06, 0.101918870822307275E+06, 0.101916337996088478E+06, 0.101901784739594950E+06, + 0.101874548045828633E+06, 0.101841292001167923E+06, 0.101803678665118787E+06, 0.101762946401782145E+06, 0.101720412831625683E+06, + 0.100515408142486602E+06, 0.100551771547175376E+06, 0.100591372710722571E+06, 0.100633738189236901E+06, 0.100678255595108407E+06, + 0.100724173138854574E+06, 0.100770602351690526E+06, 0.100816524184232330E+06, 0.100854077383907817E+06, 0.100882309305546267E+06, + 0.100908312612091744E+06, 0.100931760805658370E+06, 0.100951200960303162E+06, 0.100967005250871938E+06, 0.100979637398817140E+06, + 0.100989094128378885E+06, 0.100995390483498064E+06, 0.100999335048962457E+06, 0.101003623776222332E+06, 0.101005037852830981E+06, + 0.101003566011062838E+06, 0.100999260214490059E+06, 0.100992254677997669E+06, 0.100982785569327156E+06, 0.100971211282625562E+06, + 0.100958033151982832E+06, 0.100947713227353204E+06, 0.100936845226361344E+06, 0.100925586455398079E+06, 0.100913386427886144E+06, + 0.100900970885727584E+06, 0.100888200173575184E+06, 0.100874969576689109E+06, 0.100865322504112410E+06, 0.100857431942648880E+06, + 0.100848190571948653E+06, 0.100837041611588123E+06, 0.100823522652975458E+06, 0.100807245058683751E+06, 0.100787869439158167E+06, + 0.100757391684316404E+06, 0.100722719302699363E+06, 0.100685949398277124E+06, 0.100648508643416208E+06, 0.100611886678086536E+06, + 0.100577601709138020E+06, 0.100546746024841152E+06, 0.100520863816718731E+06, 0.100501704292206879E+06, 0.100490795320886566E+06, + 0.100489573337377500E+06, 0.100499397978964334E+06, 0.100534016438231076E+06, 0.100580634795179663E+06, 0.100636771821988543E+06, + 0.100700900349775504E+06, 0.100771475161532377E+06, 0.100847971681032548E+06, 0.100928796704597553E+06, 0.101010401416626322E+06, + 0.101090599925904797E+06, 0.101167170271662733E+06, 0.101233921628300508E+06, 0.101285179817018958E+06, 0.101329796645055787E+06, + 0.101368459516926756E+06, 0.101402063972120028E+06, 0.101431554233350747E+06, 0.101457605089509292E+06, 0.101479887700559731E+06, + 0.101498521383338972E+06, 0.101513550784224833E+06, 0.101523174827992611E+06, 0.101527475564510401E+06, 0.101528428909431837E+06, + 0.101526914423630384E+06, 0.101523962459723334E+06, 0.101520309815973524E+06, 0.101516483972158181E+06, 0.101514002315449485E+06, + 0.101514722417862809E+06, 0.101522283068780089E+06, 0.101544056083037300E+06, 0.101571190634249404E+06, 0.101603956939872005E+06, + 0.101642017592925840E+06, 0.101688020789515867E+06, 0.101748771464749283E+06, 0.101810913304749745E+06, 0.101870419614457860E+06, + 0.101923449267402393E+06, 0.101967012984100948E+06, 0.101994050943781331E+06, 0.102011245751808630E+06, 0.102022174558490107E+06, + 0.102029125315834375E+06, 0.102033037791472336E+06, 0.102034394101747268E+06, 0.102032647951692605E+06, 0.102026060860393205E+06, + 0.102014286206869132E+06, 0.101997287902874697E+06, 0.101973908129249903E+06, 0.101945685744995091E+06, 0.101913755487835835E+06, + 0.101879518050633123E+06, 0.101845462413359521E+06, 0.101814438244852194E+06, 0.101787626131292665E+06, 0.101769079269016060E+06, + 0.101760662506367516E+06, 0.101763690025728793E+06, 0.101778245812273221E+06, 0.101800769364128020E+06, 0.101825464810029356E+06, + 0.101849318133198423E+06, 0.101866690516569448E+06, 0.101874423097137915E+06, 0.101868322033511577E+06, 0.101847631400323429E+06, + 0.101809657617465651E+06, 0.101759023134988529E+06, 0.101701048933469734E+06, 0.101638831844116052E+06, 0.101574555754104877E+06, + 0.101509980617449197E+06, 0.101449449533488441E+06, 0.101394594035173650E+06, 0.101347377713062888E+06, 0.101309681379202666E+06, + 0.101289625678805663E+06, 0.101280310168622382E+06, 0.101280601256181355E+06, 0.101289183040688731E+06, 0.101304405647058535E+06, + 0.101324688438220604E+06, 0.101349563357044477E+06, 0.101377976699525767E+06, 0.101409028339016470E+06, 0.101442179995567261E+06, + 0.101476777887449236E+06, 0.101511738303380160E+06, 0.101546126683052818E+06, 0.101579196765551533E+06, 0.101607991498285395E+06, + 0.101632611269017507E+06, 0.101655502605639515E+06, 0.101677080810846644E+06, 0.101697768628730599E+06, 0.101719316740837268E+06, + 0.101742656846947124E+06, 0.101764837611636452E+06, 0.101785178883928776E+06, 0.101802942432164040E+06, 0.101817351144786313E+06, + 0.101829733328404807E+06, 0.101837655847121932E+06, 0.101840093420000965E+06, 0.101836302876360205E+06, 0.101825658934804160E+06, + 0.101806477102295394E+06, 0.101772591154458947E+06, 0.101732979877375386E+06, 0.101689114392674877E+06, 0.101642472350711148E+06, + 0.101594527408217124E+06, 0.100521483098622790E+06, 0.100553034374379175E+06, 0.100587237837357708E+06, 0.100623674982973011E+06, + 0.100661797732431733E+06, 0.100700926585977664E+06, 0.100740251364819997E+06, 0.100769102422238415E+06, 0.100792034055430398E+06, + 0.100813412935669796E+06, 0.100833061354508041E+06, 0.100850766087262135E+06, 0.100866291971468818E+06, 0.100879397215573350E+06, + 0.100889850447447578E+06, 0.100896874983048474E+06, 0.100901879624732552E+06, 0.100908045012513743E+06, 0.100911845008177756E+06, + 0.100913263133695262E+06, 0.100912309117336132E+06, 0.100909033352763217E+06, 0.100903541829518552E+06, 0.100896011438153932E+06, + 0.100886705535507586E+06, 0.100878478741165993E+06, 0.100870518698868997E+06, 0.100862258577488697E+06, 0.100853850267061993E+06, + 0.100845456536039332E+06, 0.100837262111476593E+06, 0.100829483975533818E+06, 0.100823560640713331E+06, 0.100821677296257287E+06, + 0.100817550375560750E+06, 0.100812145039498006E+06, 0.100804659355862575E+06, 0.100794378660273913E+06, 0.100780665915676014E+06, + 0.100760028631593887E+06, 0.100729776405452620E+06, 0.100695664007384359E+06, 0.100658676701707998E+06, 0.100619966898071216E+06, + 0.100580820672301052E+06, 0.100542567168908456E+06, 0.100504377972890885E+06, 0.100469914337100665E+06, 0.100440979221872039E+06, + 0.100419342752137061E+06, 0.100406745142411062E+06, 0.100406705150974245E+06, 0.100432011566503701E+06, 0.100468676779983842E+06, + 0.100515495509657252E+06, 0.100571181275147042E+06, 0.100634390994595859E+06, 0.100706784795550964E+06, 0.100786680087649889E+06, + 0.100869494529497810E+06, 0.100952905038971541E+06, 0.101034572199124057E+06, 0.101109749894571214E+06, 0.101172314783061069E+06, + 0.101229755518492922E+06, 0.101282350507230105E+06, 0.101330323821815167E+06, 0.101373763209774886E+06, 0.101412160049147336E+06, + 0.101445520624250392E+06, 0.101474055469030995E+06, 0.101497872459806793E+06, 0.101516095634979050E+06, 0.101525003393313920E+06, + 0.101529087732478598E+06, 0.101529555701643461E+06, 0.101527554535439689E+06, 0.101523924716972469E+06, 0.101519184588702949E+06, + 0.101515359052858228E+06, 0.101513419431477203E+06, 0.101515061119696038E+06, 0.101524365504439338E+06, 0.101545492952323460E+06, + 0.101572260216870665E+06, 0.101604062662735640E+06, 0.101640454999672467E+06, 0.101681140705924787E+06, 0.101736471342456469E+06, + 0.101791820815604107E+06, 0.101843025813835338E+06, 0.101888338055426750E+06, 0.101926497388645425E+06, 0.101956523951729410E+06, + 0.101977389503551763E+06, 0.101992863624521677E+06, 0.102004636055621828E+06, 0.102012873990628723E+06, 0.102016923944167502E+06, + 0.102015589894533594E+06, 0.102008242524494635E+06, 0.101994805733422399E+06, 0.101975527326879805E+06, 0.101951699623577006E+06, + 0.101924648595227743E+06, 0.101896134378200717E+06, 0.101868181223228035E+06, 0.101842690796364026E+06, 0.101823518800336897E+06, + 0.101810966006917995E+06, 0.101810361562174381E+06, 0.101819625326231835E+06, 0.101837655873780983E+06, 0.101862056783833701E+06, + 0.101890848697784473E+06, 0.101919025148523811E+06, 0.101942604878219718E+06, 0.101953732079914320E+06, 0.101952348959737385E+06, + 0.101930393928014251E+06, 0.101894531594142769E+06, 0.101847206824460780E+06, 0.101792255748977870E+06, 0.101731720782488774E+06, + 0.101667410578914118E+06, 0.101601955467176056E+06, 0.101538353512944566E+06, 0.101479206063803722E+06, 0.101426875382686587E+06, + 0.101386679687780139E+06, 0.101358881267937715E+06, 0.101340978693972764E+06, 0.101332100373616413E+06, 0.101331377677835859E+06, + 0.101337757250038121E+06, 0.101350176595795769E+06, 0.101367529237839539E+06, 0.101388710034061514E+06, 0.101412656335492444E+06, + 0.101438146564572395E+06, 0.101465030990242507E+06, 0.101492743759273944E+06, 0.101520528048576030E+06, 0.101547656089289187E+06, + 0.101573646733203917E+06, 0.101598176409242311E+06, 0.101621015547307805E+06, 0.101642090999262466E+06, 0.101661344187207244E+06, + 0.101680048117579805E+06, 0.101700060142799775E+06, 0.101717676267340707E+06, 0.101732293239297534E+06, 0.101743299867593101E+06, + 0.101750084174098316E+06, 0.101754164408332057E+06, 0.101753815772929738E+06, 0.101747787368181351E+06, 0.101735699407228763E+06, + 0.101717273900884597E+06, 0.101692348035134710E+06, 0.101654861811602153E+06, 0.101610673295375120E+06, 0.101562751614357956E+06, + 0.101512638519625150E+06, 0.101461813597627668E+06, 0.100533318325900138E+06, 0.100559018706234609E+06, 0.100586667516233734E+06, + 0.100616430509356855E+06, 0.100647457772304173E+06, 0.100679140607943787E+06, 0.100698527261697847E+06, 0.100715798167830915E+06, + 0.100731931694921790E+06, 0.100746896633405166E+06, 0.100760616569955790E+06, 0.100772979417731243E+06, 0.100783848302944942E+06, + 0.100793073809534399E+06, 0.100800507571478287E+06, 0.100806483772806212E+06, 0.100813801762586605E+06, 0.100819127022868051E+06, + 0.100822124828140237E+06, 0.100822902466370797E+06, 0.100821716855826366E+06, 0.100818621189554789E+06, 0.100813702346186765E+06, + 0.100807092657524059E+06, 0.100799795563032545E+06, 0.100792638500522866E+06, 0.100785284309503724E+06, 0.100777874398839282E+06, + 0.100770527259340961E+06, 0.100763347669699418E+06, 0.100756435329570639E+06, 0.100749892793592095E+06, 0.100749373875165576E+06, + 0.100750222933888348E+06, 0.100750603463785985E+06, 0.100749864242144642E+06, 0.100747320689053289E+06, 0.100742256076426071E+06, + 0.100733920852957395E+06, 0.100715113795294979E+06, 0.100689064952966379E+06, 0.100657845711542803E+06, 0.100623250918292935E+06, + 0.100586038000497676E+06, 0.100547134348203457E+06, 0.100506028825088957E+06, 0.100462291432826620E+06, 0.100421048783818245E+06, + 0.100384122683633468E+06, 0.100353368412380165E+06, 0.100330670880394246E+06, 0.100321776442990944E+06, 0.100334624094787185E+06, + 0.100358437666044687E+06, 0.100392488442372807E+06, 0.100435977221972600E+06, 0.100488073955800399E+06, 0.100552415559277870E+06, + 0.100627255810881121E+06, 0.100707092289738357E+06, 0.100789756856378794E+06, 0.100873101113792349E+06, 0.100954216801293107E+06, + 0.101025863759345229E+06, 0.101094584610272868E+06, 0.101160235498342692E+06, 0.101222606811297053E+06, 0.101281370962640489E+06, + 0.101332163642811851E+06, 0.101376972618262807E+06, 0.101416728366496085E+06, 0.101451473910749541E+06, 0.101480959555488313E+06, + 0.101500381551832834E+06, 0.101512210195641775E+06, 0.101519514244373393E+06, 0.101523444803633465E+06, 0.101525155563451161E+06, + 0.101524617344664759E+06, 0.101522395272590235E+06, 0.101521151212846860E+06, 0.101522340865174643E+06, 0.101527072168721963E+06, + 0.101537882062393008E+06, 0.101559080181885220E+06, 0.101584526114373686E+06, 0.101614244538571933E+06, 0.101647894372795839E+06, + 0.101684681982032082E+06, 0.101726895995367770E+06, 0.101774312937747018E+06, 0.101818830342195433E+06, 0.101858335228138851E+06, + 0.101893176738273338E+06, 0.101922949034176403E+06, 0.101947508183230893E+06, 0.101967684274917294E+06, 0.101983202615811271E+06, + 0.101993442131563672E+06, 0.101998812147038072E+06, 0.101998613039324773E+06, 0.101992329378160532E+06, 0.101980249760691964E+06, + 0.101962626054339082E+06, 0.101940465078019130E+06, 0.101915907622174098E+06, 0.101890478407916715E+06, 0.101866977689826570E+06, + 0.101849754719304707E+06, 0.101837665745559920E+06, 0.101833602586389810E+06, 0.101841599729967784E+06, 0.101859775477370218E+06, + 0.101886984424902446E+06, 0.101919867690970117E+06, 0.101951746477934430E+06, 0.101978482983373731E+06, 0.101993393892969194E+06, + 0.101991412250034802E+06, 0.101974123414601141E+06, 0.101945239434022718E+06, 0.101905684392780662E+06, 0.101856949799144815E+06, + 0.101801731134592686E+06, 0.101742504741481811E+06, 0.101681038790539489E+06, 0.101619356067038418E+06, 0.101559380452289755E+06, + 0.101505641285490463E+06, 0.101461701752299428E+06, 0.101426005705293821E+06, 0.101398896334048623E+06, 0.101380282180095601E+06, + 0.101369836995025384E+06, 0.101367277170112575E+06, 0.101370986941406809E+06, 0.101379906423074499E+06, 0.101392831033495459E+06, + 0.101408554312665205E+06, 0.101424869582900283E+06, 0.101443182567207696E+06, 0.101462968409184250E+06, 0.101483671134433898E+06, + 0.101504732894123474E+06, 0.101527421913474638E+06, 0.101550095820920280E+06, 0.101571562110317216E+06, 0.101591355780169426E+06, + 0.101609078015251362E+06, 0.101625097194956237E+06, 0.101640337310256451E+06, 0.101652605117688974E+06, 0.101661397415208048E+06, + 0.101666225004107662E+06, 0.101666619975683658E+06, 0.101662556408727090E+06, 0.101653580628123964E+06, 0.101639218203126409E+06, + 0.101619381357809092E+06, 0.101594063768788052E+06, 0.101563351510846944E+06, 0.101523851133020638E+06, 0.101476807405962056E+06, + 0.101426978369828445E+06, 0.101375797428347505E+06, 0.101324598573980998E+06, 0.100551530203326562E+06, 0.100571727120900570E+06, + 0.100593051779557791E+06, 0.100614868997312486E+06, 0.100634144763448072E+06, 0.100645833089619511E+06, 0.100657235284227281E+06, + 0.100667686387769805E+06, 0.100677292913672762E+06, 0.100686112073701530E+06, 0.100694158258119947E+06, 0.100701410586929007E+06, + 0.100707821531117806E+06, 0.100713326592793543E+06, 0.100718292448464927E+06, 0.100725135313074701E+06, 0.100730736036059810E+06, + 0.100734776949494801E+06, 0.100736983079004160E+06, 0.100737142689159882E+06, 0.100735125062421313E+06, 0.100730895453973062E+06, + 0.100724936089312163E+06, 0.100718101716589372E+06, 0.100710128659467940E+06, 0.100701978143640532E+06, 0.100693854728853868E+06, + 0.100685917546278361E+06, 0.100678288281938949E+06, 0.100671058793584918E+06, 0.100664298277410649E+06, 0.100660712381595760E+06, + 0.100661723426356752E+06, 0.100663150264819735E+06, 0.100664393149270531E+06, 0.100664799968549007E+06, 0.100663672287188572E+06, + 0.100660269896986065E+06, 0.100653054372944243E+06, 0.100638919308817800E+06, 0.100620188598009743E+06, 0.100597036492593310E+06, + 0.100569788712949841E+06, 0.100538901380231502E+06, 0.100504939031211514E+06, 0.100464616545740675E+06, 0.100420082357890147E+06, + 0.100376069547844643E+06, 0.100334560389268605E+06, 0.100297550195584583E+06, 0.100267038173233668E+06, 0.100249183652606138E+06, + 0.100248031291493899E+06, 0.100256756900526307E+06, 0.100275250996069168E+06, 0.100303318888992886E+06, 0.100340733860613560E+06, + 0.100392668457859341E+06, 0.100458197469974984E+06, 0.100530344725997711E+06, 0.100607247564767138E+06, 0.100687079608666914E+06, + 0.100768076831136714E+06, 0.100845286817167653E+06, 0.100921915425536106E+06, 0.100997896081585553E+06, 0.101072548063258917E+06, + 0.101144965887108527E+06, 0.101210711249507964E+06, 0.101267759563819229E+06, 0.101319932991058231E+06, 0.101367121820533270E+06, + 0.101409115377035181E+06, 0.101445063624758288E+06, 0.101467868269852072E+06, 0.101485221941439115E+06, 0.101498187544558168E+06, + 0.101507881316604296E+06, 0.101515310949875333E+06, 0.101519599975213365E+06, 0.101522106701145909E+06, 0.101524851878856789E+06, + 0.101529230085351330E+06, 0.101536191323789782E+06, 0.101546697524065807E+06, 0.101566224388216360E+06, 0.101589918902257763E+06, + 0.101616845515287452E+06, 0.101647215589828833E+06, 0.101680341115790361E+06, 0.101715366089036543E+06, 0.101752316168779886E+06, + 0.101791176678952732E+06, 0.101827052748008107E+06, 0.101859044996505589E+06, 0.101887670526199319E+06, 0.101913122414070647E+06, + 0.101934463666524054E+06, 0.101952632860506710E+06, 0.101966700037415663E+06, 0.101975525710702976E+06, 0.101978461989723088E+06, + 0.101975173899271627E+06, 0.101964823473388897E+06, 0.101947665044748559E+06, 0.101926227690128857E+06, 0.101900561072349257E+06, + 0.101874251008341424E+06, 0.101851830347918643E+06, 0.101836189738381829E+06, 0.101828888260193082E+06, 0.101835000054969831E+06, + 0.101851733006117443E+06, 0.101877232568018531E+06, 0.101909510086827300E+06, 0.101940989073697696E+06, 0.101965528537313672E+06, + 0.101979608526400712E+06, 0.101982970036656799E+06, 0.101975240583827399E+06, 0.101955388827734365E+06, 0.101924654892196661E+06, + 0.101887578699447098E+06, 0.101842186561714494E+06, 0.101789317463778367E+06, 0.101732832688802417E+06, 0.101675288481823532E+06, + 0.101619263688587671E+06, 0.101568048094496247E+06, 0.101521062700628769E+06, 0.101479654154784279E+06, 0.101445221739311222E+06, + 0.101418076416901371E+06, 0.101399045923829544E+06, 0.101387018859001342E+06, 0.101381135963448469E+06, 0.101380650007871780E+06, + 0.101384722424981679E+06, 0.101391720295262028E+06, 0.101400396876228624E+06, 0.101411346068523795E+06, 0.101424155121034681E+06, + 0.101438457710905030E+06, 0.101453929199892154E+06, 0.101472913422971527E+06, 0.101492074099173711E+06, 0.101510560767898467E+06, + 0.101527744434993336E+06, 0.101543054611759319E+06, 0.101555675557276962E+06, 0.101564929191696821E+06, 0.101571016898623420E+06, + 0.101573544015567939E+06, 0.101572121672385867E+06, 0.101566370463087485E+06, 0.101554662308102721E+06, 0.101536629786898047E+06, + 0.101513803810128695E+06, 0.101486361735486105E+06, 0.101454563654390658E+06, 0.101418767627698660E+06, 0.101378013088347099E+06, + 0.101330707820646552E+06, 0.101282264555356756E+06, 0.101234028760920090E+06, 0.101187294700704195E+06, 0.100576965529563255E+06, + 0.100591678218711211E+06, 0.100607008383076420E+06, 0.100616323103987481E+06, 0.100620258552074985E+06, 0.100623651287353903E+06, + 0.100626463751429124E+06, 0.100628648078344573E+06, 0.100631378331016531E+06, 0.100634129163284262E+06, 0.100636562070289394E+06, + 0.100638738873227092E+06, 0.100640693964837556E+06, 0.100643049230926015E+06, 0.100648185229669587E+06, 0.100652678597624064E+06, + 0.100656261255894686E+06, 0.100658660860211399E+06, 0.100659622834889029E+06, 0.100658930196984991E+06, 0.100656421096238220E+06, + 0.100652004015325234E+06, 0.100645400203396595E+06, 0.100634943591599571E+06, 0.100623790772243461E+06, 0.100612166299320219E+06, + 0.100600323220825783E+06, 0.100589367539107639E+06, 0.100580442279124138E+06, 0.100572243324848969E+06, 0.100564857703730217E+06, + 0.100563322531964557E+06, 0.100563065402201857E+06, 0.100563607762748041E+06, 0.100564433779967017E+06, 0.100564965723689515E+06, + 0.100564572517680892E+06, 0.100562577288210698E+06, 0.100558128795487573E+06, 0.100550306656448985E+06, 0.100538784205606309E+06, + 0.100523395229331582E+06, 0.100504107960399502E+06, 0.100481009310527326E+06, 0.100454286649172413E+06, 0.100417998848613410E+06, + 0.100377654481256992E+06, 0.100336323265197076E+06, 0.100295695643989733E+06, 0.100257502669341542E+06, 0.100223497751048752E+06, + 0.100198365893325012E+06, 0.100183895883056030E+06, 0.100176748173119719E+06, 0.100177409781642637E+06, 0.100186348863375271E+06, + 0.100204071706916817E+06, 0.100236974921233719E+06, 0.100288202283773542E+06, 0.100347584962604393E+06, 0.100413567810885099E+06, + 0.100484685800612540E+06, 0.100559609376774941E+06, 0.100637786676389092E+06, 0.100719143709254829E+06, 0.100802573207076450E+06, + 0.100886953694736978E+06, 0.100970981281993736E+06, 0.101053137277853224E+06, 0.101122114850514685E+06, 0.101186021991939982E+06, + 0.101244880734986247E+06, 0.101298842483030225E+06, 0.101347976726965513E+06, 0.101388865316328054E+06, 0.101417494561782441E+06, + 0.101441011237599363E+06, 0.101460308434203442E+06, 0.101476142058636950E+06, 0.101489111828680267E+06, 0.101498177707129027E+06, + 0.101504275218907074E+06, 0.101509888353816961E+06, 0.101516205429889771E+06, 0.101524373025953057E+06, 0.101535544403108914E+06, + 0.101550771587497264E+06, 0.101572228401773711E+06, 0.101596922610232752E+06, 0.101624267341491490E+06, 0.101653892197854148E+06, + 0.101685371964174541E+06, 0.101717744368668005E+06, 0.101749825128001146E+06, 0.101781782699506482E+06, 0.101812709382600748E+06, + 0.101841353313321029E+06, 0.101867900490832937E+06, 0.101893188014203624E+06, 0.101915193984979924E+06, 0.101933169418903170E+06, + 0.101945970442238802E+06, 0.101952233644425200E+06, 0.101949989638197949E+06, 0.101938812116678397E+06, 0.101921309771955755E+06, + 0.101897306204910492E+06, 0.101870511994013577E+06, 0.101845727987357284E+06, 0.101827162893394896E+06, 0.101815741469126820E+06, + 0.101815347936997394E+06, 0.101829035456973521E+06, 0.101849227052658054E+06, 0.101873947210599901E+06, 0.101900166979187969E+06, + 0.101922501433547208E+06, 0.101938537730062933E+06, 0.101945622505927895E+06, 0.101943220759731354E+06, 0.101933233593028053E+06, + 0.101913480508279812E+06, 0.101884226864883196E+06, 0.101847880125950556E+06, 0.101805028700279145E+06, 0.101757073613196655E+06, + 0.101706590973509752E+06, 0.101656335498895467E+06, 0.101607292592687139E+06, 0.101560626743744360E+06, 0.101517500638364392E+06, + 0.101478925847553910E+06, 0.101446343700160927E+06, 0.101419879250754559E+06, 0.101398958955256283E+06, 0.101383710029623602E+06, + 0.101374588904196891E+06, 0.101370168865842439E+06, 0.101369105684779628E+06, 0.101370929669406774E+06, 0.101375271898136503E+06, + 0.101381760968333765E+06, 0.101390061699633865E+06, 0.101400585700279218E+06, 0.101414338736935577E+06, 0.101428328122293344E+06, + 0.101441772517097343E+06, 0.101453941211612226E+06, 0.101464150240094372E+06, 0.101470694861331591E+06, 0.101472993001670693E+06, + 0.101472098749250043E+06, 0.101467692245319617E+06, 0.101459459863983502E+06, 0.101447099986294808E+06, 0.101428337148487699E+06, + 0.101402273058774066E+06, 0.101372210423711062E+06, 0.101338601145403256E+06, 0.101301942982120236E+06, 0.101262793506100817E+06, + 0.101221677786233748E+06, 0.101176731503889008E+06, 0.101131973913656722E+06, 0.101088479543089110E+06, 0.101047269615024925E+06, + 0.100610222449967056E+06, 0.100619368346169198E+06, 0.100619051340248508E+06, 0.100617580194349401E+06, 0.100615500249746110E+06, + 0.100612844510783863E+06, 0.100609637715591729E+06, 0.100605899629696811E+06, 0.100601648181252385E+06, 0.100596902436962919E+06, + 0.100591685422206356E+06, 0.100587098052459361E+06, 0.100585436102778738E+06, 0.100587603438895458E+06, 0.100589520780671664E+06, + 0.100591027689952418E+06, 0.100591916118502122E+06, 0.100591952568608729E+06, 0.100590898493088505E+06, 0.100588528847269830E+06, + 0.100584648718839380E+06, 0.100579107975368854E+06, 0.100568181408087505E+06, 0.100556028233350124E+06, 0.100543329111321902E+06, + 0.100530292741429832E+06, 0.100517138305172819E+06, 0.100504104046550317E+06, 0.100491454262540399E+06, 0.100479484740824249E+06, + 0.100470155044772182E+06, 0.100463687256117119E+06, 0.100458896797118272E+06, 0.100455620879032227E+06, 0.100454260984570079E+06, + 0.100454114005490293E+06, 0.100453954401208190E+06, 0.100453246548017763E+06, 0.100453544534649671E+06, 0.100451784335522374E+06, + 0.100447402272511725E+06, 0.100439945313556469E+06, 0.100429058870933281E+06, 0.100414474145118424E+06, 0.100395971880822995E+06, + 0.100364627363950829E+06, 0.100330069619100730E+06, 0.100293517928604648E+06, 0.100256250274621154E+06, 0.100219578502905337E+06, + 0.100184821369736295E+06, 0.100153602788173128E+06, 0.100126759271301082E+06, 0.100104736505522000E+06, 0.100088530813236051E+06, + 0.100079174170628597E+06, 0.100077782208942881E+06, 0.100089384583247156E+06, 0.100124675759422840E+06, 0.100169171328412835E+06, + 0.100221720050477204E+06, 0.100281293603445694E+06, 0.100347032197583365E+06, 0.100419381954596480E+06, 0.100501100689285435E+06, + 0.100587123759395632E+06, 0.100676265830202465E+06, 0.100767041531711700E+06, 0.100857717751965523E+06, 0.100942425402787208E+06, + 0.101015252626361835E+06, 0.101084506455799405E+06, 0.101149930187516162E+06, 0.101211031351648766E+06, 0.101267093811678642E+06, + 0.101313485842090842E+06, 0.101347864445685816E+06, 0.101377348186801406E+06, 0.101401563075397265E+06, 0.101421152746379506E+06, + 0.101436703379514453E+06, 0.101448418323353719E+06, 0.101455739244278491E+06, 0.101461288984514365E+06, 0.101466634842994637E+06, + 0.101474204912937290E+06, 0.101485236375258624E+06, 0.101500599693197641E+06, 0.101519974341673922E+06, 0.101542425947491516E+06, + 0.101567705013514729E+06, 0.101595287754062447E+06, 0.101623559085342917E+06, 0.101653300863473152E+06, 0.101684268370484802E+06, + 0.101715396578327011E+06, 0.101746648790418796E+06, 0.101778157009654227E+06, 0.101810294427225992E+06, 0.101840186138904261E+06, + 0.101866664724512098E+06, 0.101888829801923304E+06, 0.101904365840783910E+06, 0.101910875981687976E+06, 0.101907623411986046E+06, + 0.101897747215346535E+06, 0.101880196785050444E+06, 0.101858268156208374E+06, 0.101836776997478300E+06, 0.101819952813389187E+06, + 0.101808320250000223E+06, 0.101803197426602317E+06, 0.101808609816872282E+06, 0.101820932164050100E+06, 0.101835981686293468E+06, + 0.101853975694054869E+06, 0.101871402202830723E+06, 0.101884750589340591E+06, 0.101893763845945417E+06, 0.101896316342375110E+06, + 0.101891679490974697E+06, 0.101879011465031377E+06, 0.101858040507289596E+06, 0.101829415896828315E+06, 0.101794099063775866E+06, + 0.101754870334758903E+06, 0.101712830221134776E+06, 0.101668524343052632E+06, 0.101623305627111258E+06, 0.101578731565899987E+06, + 0.101536822594720084E+06, 0.101498255706646247E+06, 0.101464056159653454E+06, 0.101434228357694403E+06, 0.101408947230003760E+06, + 0.101388258426133107E+06, 0.101372054750796451E+06, 0.101360489212098575E+06, 0.101352621134682369E+06, 0.101347535522944934E+06, + 0.101344862604306050E+06, 0.101344225484927229E+06, 0.101345820651379589E+06, 0.101351700849621455E+06, 0.101359530806993411E+06, + 0.101367464680662029E+06, 0.101374791985950258E+06, 0.101380818284913359E+06, 0.101384869714943547E+06, 0.101384236152984289E+06, + 0.101379411934677875E+06, 0.101371434785651902E+06, 0.101360085004396402E+06, 0.101345137105284986E+06, 0.101326366500254488E+06, + 0.101300808610161446E+06, 0.101267227431123814E+06, 0.101230448890002648E+06, 0.101191134568648122E+06, 0.101149957676138991E+06, + 0.101107616865909265E+06, 0.101064847159165423E+06, 0.101022580301005539E+06, 0.100981724783641272E+06, 0.100943032631428388E+06, + 0.100907229742725089E+06, 0.100647986354424997E+06, 0.100642715659511494E+06, 0.100636609969385099E+06, 0.100629766959429631E+06, + 0.100622273153360293E+06, 0.100614207409999959E+06, 0.100605644320867577E+06, 0.100596657511128040E+06, 0.100587322839384142E+06, + 0.100577721494929676E+06, 0.100567942994422949E+06, 0.100559032457675799E+06, 0.100552977775159990E+06, 0.100548029023239913E+06, + 0.100543925649759869E+06, 0.100540775676255420E+06, 0.100537926202230563E+06, 0.100534526225857189E+06, 0.100530349204130558E+06, + 0.100525160024924175E+06, 0.100518730289664294E+06, 0.100507262057308282E+06, 0.100493351445575739E+06, 0.100478812420309798E+06, + 0.100463863563753723E+06, 0.100448706735957079E+06, 0.100433537133342616E+06, 0.100418551953121700E+06, 0.100403957667064577E+06, + 0.100390113818734360E+06, 0.100378283224859435E+06, 0.100368019408275955E+06, 0.100359348113145898E+06, 0.100352231413445901E+06, + 0.100346572462762793E+06, 0.100342221388570266E+06, 0.100338982151060118E+06, 0.100338392782828159E+06, 0.100341188152017450E+06, + 0.100343374795880460E+06, 0.100344284175602748E+06, 0.100343279804720136E+06, 0.100339754195549598E+06, 0.100333123950383713E+06, + 0.100321286971674039E+06, 0.100297287465905509E+06, 0.100269835508128133E+06, 0.100239714419667638E+06, 0.100207741409672206E+06, + 0.100174751447097195E+06, 0.100141579771693956E+06, 0.100106755441371904E+06, 0.100069912900784475E+06, 0.100035704844720982E+06, + 0.100005528642180579E+06, 0.999808555037528422E+05, 0.999632723451110069E+05, 0.999545236439836153E+05, 0.999736658577992639E+05, + 0.100003353333015431E+06, 0.100042064117430200E+06, 0.100089071041598727E+06, 0.100143778848621456E+06, 0.100205754250853075E+06, + 0.100280664932831889E+06, 0.100364704219084786E+06, 0.100454126970714191E+06, 0.100547163719590288E+06, 0.100641885410501171E+06, + 0.100736224731986324E+06, 0.100821668363604142E+06, 0.100899090295081827E+06, 0.100973330050358534E+06, 0.101044570047650093E+06, + 0.101111101684352281E+06, 0.101171922832138123E+06, 0.101223284014747289E+06, 0.101260000146915598E+06, 0.101290169362142216E+06, + 0.101314373328620830E+06, 0.101333177003506280E+06, 0.101345070024148474E+06, 0.101353392220116293E+06, 0.101359052838648713E+06, + 0.101363820978951000E+06, 0.101369812488926094E+06, 0.101377607762478350E+06, 0.101388432240829963E+06, 0.101403721097234418E+06, + 0.101423686495689355E+06, 0.101447911692908267E+06, 0.101474956233570803E+06, 0.101501708578459278E+06, 0.101530416403443902E+06, + 0.101560731988182699E+06, 0.101592331907465996E+06, 0.101625384375889567E+06, 0.101660463766652349E+06, 0.101696287937694025E+06, + 0.101731505165402195E+06, 0.101765373671168942E+06, 0.101795889760683582E+06, 0.101821575901139222E+06, 0.101839426770240534E+06, + 0.101848304582011391E+06, 0.101850674932157766E+06, 0.101845563338820590E+06, 0.101833662450669886E+06, 0.101819729736987734E+06, + 0.101806525676924168E+06, 0.101796235624030873E+06, 0.101788878921415002E+06, 0.101786474628160606E+06, 0.101791411418041462E+06, + 0.101799155363379643E+06, 0.101808395203049906E+06, 0.101819645577764153E+06, 0.101830409662230682E+06, 0.101837554446248556E+06, + 0.101839744105951162E+06, 0.101836170755967585E+06, 0.101826399135349377E+06, 0.101810169058729633E+06, 0.101787697095879019E+06, + 0.101760376393189144E+06, 0.101728853043894385E+06, 0.101693851935638726E+06, 0.101656211520082943E+06, 0.101616790158213262E+06, + 0.101576704560053928E+06, 0.101537500986694940E+06, 0.101500335696260430E+06, 0.101465878362827381E+06, 0.101434840756723977E+06, + 0.101408292472182264E+06, 0.101385653681886775E+06, 0.101367773762272278E+06, 0.101355060936308873E+06, 0.101344865614149967E+06, + 0.101336866601978196E+06, 0.101330803221953858E+06, 0.101326445157375012E+06, 0.101323705025865274E+06, 0.101323151766299212E+06, + 0.101323317919074820E+06, 0.101323609309034800E+06, 0.101323383998279736E+06, 0.101321968519799790E+06, 0.101318674829698095E+06, + 0.101309557473271183E+06, 0.101297255318789845E+06, 0.101282004506700381E+06, 0.101263593826286131E+06, 0.101241822534985287E+06, + 0.101216505434514431E+06, 0.101183763113335532E+06, 0.101143062284304673E+06, 0.101099958082106066E+06, 0.101055260378077917E+06, + 0.101009770107324861E+06, 0.100964289722992879E+06, 0.100919631222605836E+06, 0.100878395229792455E+06, 0.100840230418695966E+06, + 0.100804814065610379E+06, 0.100772660269162792E+06, 0.100687581879727732E+06, 0.100677327145079587E+06, 0.100666160693170401E+06, + 0.100654207341057889E+06, 0.100641583937123549E+06, 0.100628402623918475E+06, 0.100614774045043421E+06, 0.100600810488184259E+06, + 0.100586628958508634E+06, 0.100572354178803900E+06, 0.100558377265734845E+06, 0.100545518784321612E+06, 0.100533722529582723E+06, + 0.100522910171807918E+06, 0.100512931196078469E+06, 0.100503576020145658E+06, 0.100494590303307457E+06, 0.100485690264560879E+06, + 0.100476578798775605E+06, 0.100466962148914608E+06, 0.100453831814755409E+06, 0.100437250927331042E+06, 0.100419883924672962E+06, + 0.100402010894887906E+06, 0.100383869790613491E+06, 0.100365667294769126E+06, 0.100347588515499185E+06, 0.100329805497802925E+06, + 0.100312484547517117E+06, 0.100295677938969020E+06, 0.100279971482571520E+06, 0.100265646792895117E+06, 0.100252835911466231E+06, + 0.100241624480511469E+06, 0.100232054881627162E+06, 0.100224130808306480E+06, 0.100217823206996967E+06, 0.100218259667894425E+06, + 0.100221888558547784E+06, 0.100225662634090608E+06, 0.100228894178654795E+06, 0.100230909476646018E+06, 0.100231046622607246E+06, + 0.100228652435841679E+06, 0.100220736457496634E+06, 0.100203006988572233E+06, 0.100182026084597936E+06, 0.100158298000477531E+06, + 0.100132350369893451E+06, 0.100104715520267695E+06, 0.100075909358704739E+06, 0.100043124770855982E+06, 0.100002028989072438E+06, + 0.999616642547620577E+05, 0.999236877809293510E+05, 0.998898266920593742E+05, 0.998618945050216280E+05, 0.998418030619178171E+05, + 0.998423833568641858E+05, 0.998594396345241257E+05, 0.998857662121956964E+05, 0.999209046169008070E+05, 0.999644862724064005E+05, + 0.100016242187354641E+06, 0.100077317810256820E+06, 0.100156061627195784E+06, 0.100241897409154641E+06, 0.100332874470688155E+06, + 0.100428637026128985E+06, 0.100526117084385623E+06, 0.100622332108951261E+06, 0.100709061724389190E+06, 0.100788527255290071E+06, + 0.100863969991383987E+06, 0.100934619610214693E+06, 0.100999507530848088E+06, 0.101057589879684849E+06, 0.101107912118639942E+06, + 0.101140898046464674E+06, 0.101165194334426677E+06, 0.101183324487668549E+06, 0.101196455912974372E+06, 0.101205787756098696E+06, + 0.101212555660780359E+06, 0.101217307428240179E+06, 0.101221221076374510E+06, 0.101226815969850082E+06, 0.101235775469520071E+06, + 0.101249089517923203E+06, 0.101267499119154090E+06, 0.101290114155802439E+06, 0.101316108973235343E+06, 0.101344864351232871E+06, + 0.101376027068939133E+06, 0.101409318557868275E+06, 0.101444185441017980E+06, 0.101479505555003896E+06, 0.101516882009007721E+06, + 0.101555258888103534E+06, 0.101593997928136538E+06, 0.101632899844262269E+06, 0.101670115604274892E+06, 0.101703897209036979E+06, + 0.101731821696663668E+06, 0.101752696747597220E+06, 0.101767805557897402E+06, 0.101776451771069726E+06, 0.101776669469582252E+06, + 0.101773409436917937E+06, 0.101768516316242836E+06, 0.101762622025664066E+06, 0.101757375988241824E+06, 0.101753826825127559E+06, + 0.101753403149395934E+06, 0.101756975828023817E+06, 0.101760728893977721E+06, 0.101764213695991348E+06, 0.101767251659026326E+06, + 0.101770663081707637E+06, 0.101770424123169345E+06, 0.101766072271416459E+06, 0.101755995409002455E+06, 0.101740345666592038E+06, + 0.101721298174118318E+06, 0.101699043646416510E+06, 0.101673714396835901E+06, 0.101645709970302123E+06, 0.101615709217670097E+06, + 0.101584438818864903E+06, 0.101549071157331651E+06, 0.101514367930820241E+06, 0.101481015481659371E+06, 0.101449616141240651E+06, + 0.101420749509000205E+06, 0.101394921878986992E+06, 0.101373676775729036E+06, 0.101359486676981818E+06, 0.101347304837422518E+06, + 0.101336841360518913E+06, 0.101328023341265842E+06, 0.101320386045212057E+06, 0.101313764510643596E+06, 0.101308434768293082E+06, + 0.101303621069785135E+06, 0.101298777855350723E+06, 0.101293531204510582E+06, 0.101287470834921696E+06, 0.101280152845400124E+06, + 0.101270201669037211E+06, 0.101254701725787949E+06, 0.101236553755882080E+06, 0.101215630660361639E+06, 0.101191802985207483E+06, + 0.101164939977834394E+06, 0.101134911067020425E+06, 0.101095221983884170E+06, 0.101047509096163092E+06, 0.100998010357585692E+06, + 0.100947641730482603E+06, 0.100897282218335793E+06, 0.100847785377602457E+06, 0.100799988650482410E+06, 0.100756067172860465E+06, + 0.100716404949108095E+06, 0.100680394601797932E+06, 0.100648426393021538E+06, 0.100745881471474568E+06, 0.100728142553068014E+06, + 0.100709625290291020E+06, 0.100690810595279676E+06, 0.100673015913888710E+06, 0.100654662696282932E+06, 0.100635883098483231E+06, + 0.100616812156066226E+06, 0.100597590570947941E+06, 0.100577923093225269E+06, 0.100558481382763435E+06, 0.100539763749561054E+06, + 0.100521848971490384E+06, 0.100504736841997088E+06, 0.100488356281683067E+06, 0.100472574428834167E+06, 0.100457206575664590E+06, + 0.100442026795809623E+06, 0.100426779086875598E+06, 0.100408173847290411E+06, 0.100384737995668649E+06, 0.100361938241868149E+06, + 0.100339809752568588E+06, 0.100318341944825661E+06, 0.100297490120403570E+06, 0.100277187624826533E+06, 0.100256847285368276E+06, + 0.100235365725066120E+06, 0.100214436988323068E+06, 0.100194015395758135E+06, 0.100174603679756343E+06, 0.100156451770575964E+06, + 0.100139783864459299E+06, 0.100124799136242582E+06, 0.100111674036540222E+06, 0.100100566149749706E+06, 0.100091646133474802E+06, + 0.100094268080595342E+06, 0.100098360646490051E+06, 0.100103245417476035E+06, 0.100108251398645036E+06, 0.100112713737688697E+06, + 0.100115972074298101E+06, 0.100117368468727698E+06, 0.100113713047268437E+06, 0.100102264314479005E+06, 0.100088001440509222E+06, + 0.100071163974188516E+06, 0.100051996036882978E+06, 0.100030726477270320E+06, 0.100007546295320470E+06, 0.999807647979038738E+05, + 0.999391989552558807E+05, 0.998969708781520749E+05, 0.998557810370234511E+05, 0.998173700956349639E+05, 0.997835138413437380E+05, + 0.997560107381300622E+05, 0.997399269866001996E+05, 0.997470920864752261E+05, 0.997634292598558095E+05, 0.997888964555621351E+05, + 0.998253139512354246E+05, 0.998703081483062851E+05, 0.999237330223304161E+05, 0.999900673422841937E+05, 0.100071098592214898E+06, + 0.100157786095159157E+06, 0.100248141148947368E+06, 0.100340095617225234E+06, 0.100431568456538211E+06, 0.100520552982271765E+06, + 0.100601957172444119E+06, 0.100676277857242458E+06, 0.100746000837763233E+06, 0.100808736668317229E+06, 0.100864485886548777E+06, + 0.100912656357667453E+06, 0.100952804425252194E+06, 0.100983458937089512E+06, 0.101002905816960556E+06, 0.101017076739301760E+06, + 0.101025919304932366E+06, 0.101031319629252597E+06, 0.101035629307633033E+06, 0.101040244934609727E+06, 0.101046393155694794E+06, + 0.101055516125687020E+06, 0.101070906234944094E+06, 0.101089614225348079E+06, 0.101111577432790844E+06, 0.101136727145279292E+06, + 0.101164845396941935E+06, 0.101195505773623969E+06, 0.101228307857940395E+06, 0.101262885478130513E+06, 0.101298695011647855E+06, + 0.101336323186784808E+06, 0.101375617863355365E+06, 0.101416132308550543E+06, 0.101458486694783467E+06, 0.101500186893265898E+06, + 0.101539835500673144E+06, 0.101576113752189529E+06, 0.101608148989054069E+06, 0.101635731083729115E+06, 0.101658502412969741E+06, + 0.101672883340000117E+06, 0.101682956248776158E+06, 0.101690136156231834E+06, 0.101694729692935623E+06, 0.101695555850151519E+06, + 0.101694985210699713E+06, 0.101693812129123311E+06, 0.101693039728607808E+06, 0.101693715283905956E+06, 0.101692868849250488E+06, + 0.101690508890417783E+06, 0.101685212790082718E+06, 0.101676311144040446E+06, 0.101666676329463662E+06, 0.101655232931092047E+06, + 0.101641717109236590E+06, 0.101625993005500495E+06, 0.101608164735537764E+06, 0.101588188219044227E+06, 0.101565919017002117E+06, + 0.101541334705616158E+06, 0.101515224870468810E+06, 0.101488328834034881E+06, 0.101461275807381404E+06, 0.101434883687913665E+06, + 0.101409484965064941E+06, 0.101385820779280519E+06, 0.101366650582102375E+06, 0.101354446840173172E+06, 0.101343919272935833E+06, + 0.101334580534699839E+06, 0.101326051033725802E+06, 0.101318025772555571E+06, 0.101310244905231491E+06, 0.101303240884958926E+06, + 0.101296508440228543E+06, 0.101288703571071324E+06, 0.101279586340018883E+06, 0.101269869694777401E+06, 0.101258981910571456E+06, + 0.101246361574452327E+06, 0.101230052909366845E+06, 0.101210205538298207E+06, 0.101187520180750522E+06, 0.101161911206820834E+06, + 0.101133290201435040E+06, 0.101101563145659631E+06, 0.101066628653128937E+06, 0.101019252959455625E+06, 0.100965746706630394E+06, + 0.100910740992734136E+06, 0.100855238817428384E+06, 0.100800186778776610E+06, 0.100746485895287333E+06, 0.100695000750680716E+06, + 0.100647864656014091E+06, 0.100605793755290593E+06, 0.100567897173808713E+06, 0.100534547818198989E+06, 0.100814127595255733E+06, + 0.100792022069682134E+06, 0.100768906676945466E+06, 0.100744859019167008E+06, 0.100719947172904969E+06, 0.100694229203288138E+06, + 0.100667752842392147E+06, 0.100641747076966523E+06, 0.100616187623394333E+06, 0.100590421603492592E+06, 0.100564843816162116E+06, + 0.100539661442132914E+06, 0.100515003622905657E+06, 0.100490925990557327E+06, 0.100467416019604236E+06, 0.100444399107853926E+06, + 0.100421745278230635E+06, 0.100399276378565366E+06, 0.100374479059296529E+06, 0.100342341387721070E+06, 0.100310819294281551E+06, + 0.100280122297496389E+06, 0.100250406051737154E+06, 0.100221779328347242E+06, 0.100194311780137796E+06, 0.100168042299398876E+06, + 0.100142987772136228E+06, 0.100119152028053810E+06, 0.100096071569344102E+06, 0.100074127372371906E+06, 0.100053458844250679E+06, + 0.100034145590099070E+06, 0.100016303683140140E+06, 0.100000086204841966E+06, 0.999856841527353536E+05, 0.999733278135488799E+05, + 0.999663531822283549E+05, 0.999693777575280983E+05, 0.999741959503276157E+05, 0.999802590538802469E+05, 0.999870378916889313E+05, + 0.999938949144795042E+05, 0.100000191518739506E+06, 0.100005286991947069E+06, 0.100006317487418550E+06, 0.100001195017387858E+06, + 0.999937624881289375E+05, 0.999840228227615153E+05, 0.999719630030743720E+05, 0.999577541117163637E+05, 0.999414190489595931E+05, + 0.999227353126357775E+05, 0.998873066933161899E+05, 0.998482442672230973E+05, 0.998092392179712187E+05, 0.997720171343442780E+05, + 0.997383602763239178E+05, 0.997100954593149654E+05, 0.996890738866330212E+05, 0.996865348971301573E+05, 0.996979284283922898E+05, + 0.997178025858917244E+05, 0.997459381653020537E+05, 0.997821174181933602E+05, 0.998261113921440992E+05, 0.998776597193271737E+05, + 0.999420283421857603E+05, 0.100017917957394646E+06, 0.100097878242084247E+06, 0.100179897231054711E+06, 0.100262024118021669E+06, + 0.100342632647495484E+06, 0.100419763744213284E+06, 0.100491241165072570E+06, 0.100554990596539108E+06, 0.100613108372608185E+06, + 0.100664964935558615E+06, 0.100710050488669251E+06, 0.100748062257432917E+06, 0.100778981129089982E+06, 0.100801136588479072E+06, + 0.100816775933362136E+06, 0.100825979191023362E+06, 0.100833035761093313E+06, 0.100839384072879693E+06, 0.100846373089390050E+06, + 0.100857951736503237E+06, 0.100872302980121356E+06, 0.100888680627202251E+06, 0.100907092306334001E+06, 0.100927501559027049E+06, + 0.100950662310288419E+06, 0.100977294658870305E+06, 0.101006277386327682E+06, 0.101036971461367139E+06, 0.101068254496147259E+06, + 0.101099848827670517E+06, 0.101133511540723193E+06, 0.101169399010245761E+06, 0.101207870174907031E+06, 0.101248846664781042E+06, + 0.101290872607848010E+06, 0.101333141189654139E+06, 0.101375246051365641E+06, 0.101416446476650075E+06, 0.101455302158143284E+06, + 0.101490839830927347E+06, 0.101520107656443550E+06, 0.101543517742126453E+06, 0.101563037513223637E+06, 0.101578855351202437E+06, + 0.101589294440855650E+06, 0.101594084692158984E+06, 0.101595811485579121E+06, 0.101594522898840631E+06, 0.101587783852875349E+06, + 0.101580434348492054E+06, 0.101571251185715577E+06, 0.101560523496472335E+06, 0.101548552694418337E+06, 0.101535867827232971E+06, + 0.101525413599061823E+06, 0.101514059084604145E+06, 0.101501599931887249E+06, 0.101487982453526070E+06, 0.101472687979190014E+06, + 0.101455256212675624E+06, 0.101436599458446668E+06, 0.101417421871714148E+06, 0.101397941747779230E+06, 0.101378563636379375E+06, + 0.101359842874464084E+06, 0.101342462840995518E+06, 0.101332246224379633E+06, 0.101325840252083945E+06, 0.101320103689658979E+06, + 0.101314877253089740E+06, 0.101310111834561045E+06, 0.101305378666758857E+06, 0.101300345803243748E+06, 0.101295776170531011E+06, + 0.101292199871251156E+06, 0.101287082936946317E+06, 0.101280060941132921E+06, 0.101270852280511215E+06, 0.101259228389922413E+06, + 0.101244988802512118E+06, 0.101227740446083306E+06, 0.101206586899449845E+06, 0.101182271497207475E+06, 0.101154765725986566E+06, + 0.101124017218970926E+06, 0.101089948851124151E+06, 0.101052459983455323E+06, 0.101011429271982197E+06, 0.100955245737388075E+06, + 0.100896292883737755E+06, 0.100836289133349041E+06, 0.100776402552628671E+06, 0.100717117782225978E+06, 0.100659365283430379E+06, + 0.100604025319315682E+06, 0.100553449734939946E+06, 0.100508407522918642E+06, 0.100467703215460322E+06, 0.100431774319843782E+06, + 0.100887777028820332E+06, 0.100861720047367722E+06, 0.100834436753951144E+06, 0.100806009321876336E+06, 0.100776515387351727E+06, + 0.100746027719175327E+06, 0.100714128174464058E+06, 0.100678835400336873E+06, 0.100643940658424166E+06, 0.100609599439615049E+06, + 0.100575890439937211E+06, 0.100542814645689868E+06, 0.100510647118237335E+06, 0.100478852228419142E+06, 0.100447427441828680E+06, + 0.100416345678542421E+06, 0.100385524391706378E+06, 0.100353710114660586E+06, 0.100313330006065604E+06, 0.100273215809488320E+06, + 0.100233726851702537E+06, 0.100195172710990315E+06, 0.100157816918484707E+06, 0.100121881575408392E+06, 0.100087552777137244E+06, + 0.100054986731522251E+06, 0.100024316458513829E+06, 0.999958188555688102E+05, 0.999694587498323526E+05, 0.999449162204764725E+05, + 0.999222572991156194E+05, 0.999015841003048117E+05, 0.998830358793447813E+05, 0.998667901084829064E+05, 0.998530636160492868E+05, + 0.998421138196279935E+05, 0.998399548826702376E+05, 0.998456341634458367E+05, 0.998536660057044792E+05, 0.998634438903502014E+05, + 0.998743637363783346E+05, 0.998858203733583359E+05, 0.998972031892049272E+05, 0.999078909209750127E+05, 0.999149362451545312E+05, + 0.999155853988857416E+05, 0.999144713123037072E+05, 0.999115094947106991E+05, 0.999066084422268032E+05, 0.998996635379296931E+05, + 0.998905505086211051E+05, 0.998791187039132201E+05, 0.998553009292081260E+05, 0.998211706427201134E+05, 0.997864909210314072E+05, + 0.997528267554746853E+05, 0.997217498141473916E+05, 0.996948180668799905E+05, 0.996735491411857802E+05, 0.996593866015884996E+05, + 0.996655234255323448E+05, 0.996793806269131601E+05, 0.997006480667150026E+05, 0.997291101032920706E+05, 0.997645101820020791E+05, + 0.998065302642879251E+05, 0.998547900089741306E+05, 0.999134103376733110E+05, 0.999816545378570445E+05, 0.100052123784172887E+06, + 0.100122995502983205E+06, 0.100192554793170464E+06, 0.100259253657548237E+06, 0.100321770579711141E+06, 0.100379066111299660E+06, + 0.100430565790236928E+06, 0.100476507405646029E+06, 0.100515199549242738E+06, 0.100547257296906639E+06, 0.100573671260601302E+06, + 0.100594920234367688E+06, 0.100611741953639648E+06, 0.100625093360959523E+06, 0.100636085854106641E+06, 0.100648539226327353E+06, + 0.100663110344216606E+06, 0.100678485576473686E+06, 0.100694991774415132E+06, 0.100712835683178113E+06, 0.100732147548005290E+06, + 0.100753127553809449E+06, 0.100775525773403977E+06, 0.100799178062266757E+06, 0.100823896465442915E+06, 0.100848973735924432E+06, + 0.100871627589741343E+06, 0.100896325593451635E+06, 0.100923508440905760E+06, 0.100953444968081341E+06, 0.100987803936626107E+06, + 0.101025452874861629E+06, 0.101064958354120550E+06, 0.101105934719207362E+06, 0.101149656229281260E+06, 0.101195955740066449E+06, + 0.101241312234646321E+06, 0.101284295970940017E+06, 0.101322838039260794E+06, 0.101354503959834561E+06, 0.101381602347716602E+06, + 0.101404011754918669E+06, 0.101421551762267889E+06, 0.101430360992792368E+06, 0.101432922117767157E+06, 0.101431497700586173E+06, + 0.101426925441668209E+06, 0.101419967655507149E+06, 0.101411983040633873E+06, 0.101402716970667971E+06, 0.101392421375849139E+06, + 0.101381472260780953E+06, 0.101370274940234522E+06, 0.101359740662010270E+06, 0.101350634658367329E+06, 0.101341143517682387E+06, + 0.101330923240958698E+06, 0.101319823874219393E+06, 0.101307931163203728E+06, 0.101295590108053555E+06, 0.101283554840952769E+06, + 0.101272503805782646E+06, 0.101264230996134676E+06, 0.101263165987784392E+06, 0.101263248071743699E+06, 0.101263968423840182E+06, + 0.101264949849351571E+06, 0.101265950281725454E+06, 0.101266859267559164E+06, 0.101267688820318188E+06, 0.101269586773692979E+06, + 0.101271200254654817E+06, 0.101270843870590616E+06, 0.101268468005190778E+06, 0.101263583383249803E+06, 0.101255809203046563E+06, + 0.101244849341628564E+06, 0.101230469880693592E+06, 0.101211897835992699E+06, 0.101189677118595791E+06, 0.101163874725058151E+06, + 0.101134452948665217E+06, 0.101101374466219480E+06, 0.101064596222306151E+06, 0.101024065194136114E+06, 0.100976094439065258E+06, + 0.100916143828112647E+06, 0.100853769181501484E+06, 0.100790071236260570E+06, 0.100726087398982490E+06, 0.100662794662010128E+06, + 0.100601113224382003E+06, 0.100541910367744073E+06, 0.100487274737311833E+06, 0.100437683864829785E+06, 0.100392394095480457E+06, + 0.100351867577605750E+06, 0.100962168045125494E+06, 0.100932365352918903E+06, 0.100901110935450168E+06, 0.100868480358099798E+06, + 0.100834547574790442E+06, 0.100796703363587934E+06, 0.100755267960995203E+06, 0.100713570472402876E+06, 0.100671854726096004E+06, + 0.100630308500112806E+06, 0.100589060133053688E+06, 0.100548176434007823E+06, 0.100507661857319457E+06, 0.100467458892467330E+06, + 0.100427449603971385E+06, 0.100387458241177985E+06, 0.100347067293918182E+06, 0.100298654635154177E+06, 0.100250789888946878E+06, + 0.100203094461237808E+06, 0.100156000274838036E+06, 0.100109901773151054E+06, 0.100065158238268661E+06, 0.100022096993949221E+06, + 0.999810174333996401E+05, 0.999421958115488960E+05, 0.999058907435752189E+05, 0.998749313841952826E+05, 0.998464722705311870E+05, + 0.998203417981312523E+05, 0.997966268545406929E+05, 0.997754458911707188E+05, 0.997569500594004494E+05, 0.997413241542494943E+05, + 0.997287873670089612E+05, 0.997195938347852207E+05, 0.997219848697613779E+05, 0.997302647271703609E+05, 0.997413201843605202E+05, + 0.997545532545877795E+05, 0.997693575270145375E+05, 0.997851155398511037E+05, 0.998011953959217790E+05, 0.998169466903843859E+05, + 0.998299082101016102E+05, 0.998356142670790869E+05, 0.998398422284621047E+05, 0.998424522644160897E+05, 0.998432923817324918E+05, + 0.998421955048720556E+05, 0.998389770375031076E+05, 0.998334333807975636E+05, 0.998233671652358898E+05, 0.997961670290865004E+05, + 0.997678973047597101E+05, 0.997399010170866677E+05, 0.997134966342892585E+05, 0.996899556689095043E+05, 0.996704759993049811E+05, + 0.996561506699569145E+05, 0.996500136858785991E+05, 0.996586427100675064E+05, 0.996741311696416087E+05, 0.996962994894855947E+05, + 0.997249142503650510E+05, 0.997596639024193428E+05, 0.998001312580039958E+05, 0.998457643772705051E+05, 0.998968741052847909E+05, + 0.999554058789066621E+05, 0.100014421175045645E+06, 0.100072433938662172E+06, 0.100128122411163247E+06, 0.100180369857232887E+06, + 0.100226565707743983E+06, 0.100267364450542242E+06, 0.100303437234851634E+06, 0.100335667091963755E+06, 0.100364067822408935E+06, + 0.100388352892750874E+06, 0.100408979571248361E+06, 0.100426614584295938E+06, 0.100443740449263758E+06, 0.100461134998395326E+06, + 0.100478174321635088E+06, 0.100495256991003844E+06, 0.100512619944850769E+06, 0.100530318011748270E+06, 0.100548816195507636E+06, + 0.100568537852548383E+06, 0.100588688433695279E+06, 0.100609168368209503E+06, 0.100629814904332350E+06, 0.100650416237038749E+06, + 0.100665634418575515E+06, 0.100681296503981284E+06, 0.100698501345687095E+06, 0.100717920340627403E+06, 0.100740215249176472E+06, + 0.100766890514599916E+06, 0.100796657224606606E+06, 0.100829306693609207E+06, 0.100864641226465828E+06, 0.100904494038338991E+06, + 0.100948883593760926E+06, 0.100993670283464584E+06, 0.101037518284592399E+06, 0.101079215492193092E+06, 0.101115268009655614E+06, + 0.101146790223207165E+06, 0.101174201341284715E+06, 0.101197180680782549E+06, 0.101215405063571248E+06, 0.101223672236876388E+06, + 0.101227039458753206E+06, 0.101226892310118274E+06, 0.101223972224575875E+06, 0.101218953111666357E+06, 0.101212937481870860E+06, + 0.101205841402347578E+06, 0.101198438153766576E+06, 0.101191337677150907E+06, 0.101184775501605473E+06, 0.101178859738651910E+06, + 0.101173861836438504E+06, 0.101169688625135837E+06, 0.101165295165053874E+06, 0.101160720689472480E+06, 0.101156205118519152E+06, + 0.101153904081471745E+06, 0.101157778313312563E+06, 0.101162376363148098E+06, 0.101167695990116554E+06, 0.101174407609201837E+06, + 0.101181289698729292E+06, 0.101187910343826748E+06, 0.101193938755009076E+06, 0.101199145593254492E+06, 0.101206932922006279E+06, + 0.101215167455344184E+06, 0.101221538641997948E+06, 0.101225600948191553E+06, 0.101227025345643400E+06, 0.101225591909201801E+06, + 0.101221179118605258E+06, 0.101213750568578733E+06, 0.101199646966405868E+06, 0.101180697627794187E+06, 0.101158105995225807E+06, + 0.101131732247750042E+06, 0.101101468150223940E+06, 0.101067227518597691E+06, 0.101028937999906033E+06, 0.100986534229694924E+06, + 0.100931637537634888E+06, 0.100870116212888723E+06, 0.100806172230221506E+06, 0.100740814221331588E+06, 0.100675010844437245E+06, + 0.100609686876287946E+06, 0.100545721239012084E+06, 0.100483946382944894E+06, 0.100426130298766730E+06, 0.100372432821891009E+06, + 0.100322757504134090E+06, 0.100277638455664739E+06, 0.101031760825673671E+06, 0.100998271623218010E+06, 0.100963081981794705E+06, + 0.100926251398063658E+06, 0.100882116391194853E+06, 0.100836110949086375E+06, 0.100789196010976768E+06, 0.100741656022242169E+06, + 0.100693739602509639E+06, 0.100645654807320738E+06, 0.100597565425804190E+06, 0.100549588305930272E+06, 0.100501791687992096E+06, + 0.100454194516198477E+06, 0.100406766687836353E+06, 0.100359430189551465E+06, 0.100303106797204193E+06, 0.100246577208372706E+06, + 0.100190531822652643E+06, 0.100135266216653603E+06, 0.100081062875707968E+06, 0.100028192493603376E+06, 0.999769161960119818E+05, + 0.999274886616365693E+05, 0.998801621121565840E+05, 0.998351911400472018E+05, 0.997962094163349393E+05, 0.997640534483473457E+05, + 0.997345240177219384E+05, 0.997076990988948673E+05, 0.996836794307263772E+05, 0.996625896600271371E+05, 0.996445791479565378E+05, + 0.996298224252568762E+05, 0.996185192726470996E+05, 0.996108943913202529E+05, 0.996171044733596500E+05, 0.996274341933858086E+05, + 0.996407368485686020E+05, 0.996564433077199938E+05, 0.996739662819337100E+05, 0.996926995456860750E+05, 0.997120167510192841E+05, + 0.997312700110226870E+05, 0.997492720049924683E+05, 0.997589945357419347E+05, 0.997672950870170171E+05, 0.997740082631510304E+05, + 0.997789569418504107E+05, 0.997819534179343900E+05, 0.997828018434580008E+05, 0.997813025467889238E+05, 0.997761547542830958E+05, + 0.997606903751367063E+05, 0.997380039112137747E+05, 0.997148807783809316E+05, 0.996925793721139198E+05, 0.996723316187614837E+05, + 0.996553186696160265E+05, 0.996426434711866459E+05, 0.996353006212308683E+05, 0.996360089851673401E+05, 0.996493081867637520E+05, + 0.996683800195190997E+05, 0.996929780547397386E+05, 0.997227658669395460E+05, 0.997573001543519495E+05, 0.997960150791931374E+05, + 0.998382096557535260E+05, 0.998830404070649238E+05, 0.999298323121304275E+05, 0.999742523604048474E+05, 0.100016965326181715E+06, + 0.100057253131543956E+06, 0.100094584675305145E+06, 0.100128612542877818E+06, 0.100159162106115866E+06, 0.100186212494174571E+06, + 0.100209869217876141E+06, 0.100230664541801205E+06, 0.100252215827535721E+06, 0.100272507526162837E+06, 0.100291578842935764E+06, + 0.100309849731348106E+06, 0.100327689967233746E+06, 0.100345394170965068E+06, 0.100363163535270942E+06, 0.100381092592034052E+06, + 0.100399259031973241E+06, 0.100417513798931104E+06, 0.100435580822035801E+06, 0.100453091252954211E+06, 0.100469603339999827E+06, + 0.100480151507121773E+06, 0.100489254638568047E+06, 0.100498595808049067E+06, 0.100508951548301586E+06, 0.100521040443233302E+06, + 0.100536087694824993E+06, 0.100554481106296153E+06, 0.100575842199618433E+06, 0.100600284600435130E+06, 0.100627894363922838E+06, + 0.100660998742818352E+06, 0.100699900685942383E+06, 0.100740240979155365E+06, 0.100780773089326132E+06, 0.100820325888548046E+06, + 0.100857002425394050E+06, 0.100889306549680012E+06, 0.100918410465244044E+06, 0.100943855527829830E+06, 0.100965216993375041E+06, + 0.100982104369596826E+06, 0.100988787448417890E+06, 0.100992039290643908E+06, 0.100992851817592629E+06, 0.100992148367721486E+06, + 0.100990754377491627E+06, 0.100989328864528783E+06, 0.100987939282731590E+06, 0.100987019598780156E+06, 0.100986810224360001E+06, + 0.100987461015865600E+06, 0.100989052975663959E+06, 0.100991630597561802E+06, 0.100995163025901697E+06, 0.101001875722349461E+06, + 0.101011088720900429E+06, 0.101021084899088091E+06, 0.101031663037972830E+06, 0.101042638294081626E+06, 0.101053858103835970E+06, + 0.101065218626100279E+06, 0.101076680586933391E+06, 0.101088283485301858E+06, 0.101099874970037970E+06, 0.101113089326713816E+06, + 0.101125428039884195E+06, 0.101136196176455385E+06, 0.101144782354753406E+06, 0.101150661981462021E+06, 0.101153397040916956E+06, + 0.101152632849470392E+06, 0.101148092219151222E+06, 0.101138825885236918E+06, 0.101125297346996245E+06, 0.101107998631323659E+06, + 0.101086896343469081E+06, 0.101061954484055474E+06, 0.101033133620494526E+06, 0.101000389988487950E+06, 0.100963674428856495E+06, + 0.100920035249967157E+06, 0.100864002050084426E+06, 0.100802954127500183E+06, 0.100739491656333426E+06, 0.100674607806506479E+06, + 0.100609142818467881E+06, 0.100543918229119721E+06, 0.100479729438758746E+06, 0.100417340423775575E+06, 0.100357818911458060E+06, + 0.100301549120910859E+06, 0.100249027161521051E+06, 0.100200821670612902E+06, 0.101087517829558172E+06, 0.101052015003826687E+06, + 0.101011788745108162E+06, 0.100964536778963855E+06, 0.100915488137692053E+06, 0.100864943012846241E+06, 0.100813190048196135E+06, + 0.100760500256302723E+06, 0.100707121731364154E+06, 0.100653275174801398E+06, 0.100599150242222226E+06, 0.100544902712618306E+06, + 0.100490652473024573E+06, 0.100436482304513964E+06, 0.100382437448442113E+06, 0.100320280351299210E+06, 0.100257427382579408E+06, + 0.100194846079550756E+06, 0.100132891655021755E+06, 0.100071918796184837E+06, 0.100012281557507449E+06, 0.999543340473443968E+05, + 0.998984318951125897E+05, 0.998449344820776314E+05, 0.997942079153267550E+05, 0.997466460297804297E+05, 0.997094928681285237E+05, + 0.996756279012622545E+05, 0.996450218538222252E+05, 0.996176735384205385E+05, 0.995936103776563396E+05, 0.995728884174646664E+05, + 0.995555917894421727E+05, 0.995418315732738702E+05, 0.995317440033937164E+05, 0.995262628136555868E+05, 0.995329410864949314E+05, + 0.995433141117427585E+05, 0.995568197318211314E+05, 0.995728823939344729E+05, 0.995909116272487881E+05, 0.996102999545491039E+05, + 0.996304204174830811E+05, 0.996506239397997124E+05, 0.996702368021630245E+05, 0.996815718025470851E+05, 0.996899469928969920E+05, + 0.996967323341972806E+05, 0.997018093255459680E+05, 0.997050766826754843E+05, 0.997064543685055542E+05, 0.997058891541211779E+05, + 0.997033620388164272E+05, 0.996988978495463380E+05, 0.996831868676393642E+05, 0.996664226445127570E+05, 0.996504367351514375E+05, + 0.996361908772876632E+05, 0.996245860820844246E+05, 0.996164411729444837E+05, 0.996124708057612588E+05, 0.996132638091558620E+05, + 0.996196649575229239E+05, 0.996367110923675500E+05, 0.996583825556631200E+05, 0.996843326520396949E+05, 0.997128691088688356E+05, + 0.997429147876210773E+05, 0.997758051592909760E+05, 0.998110107603276119E+05, 0.998478942000829556E+05, 0.998857114279977977E+05, + 0.999214491155317955E+05, 0.999550948845939129E+05, 0.999866837454055931E+05, 0.100015951080814193E+06, 0.100042763152220112E+06, + 0.100066833155271277E+06, 0.100088158247781059E+06, 0.100108078185884762E+06, 0.100126927297932227E+06, 0.100144951073682430E+06, + 0.100162306504082269E+06, 0.100179972902585811E+06, 0.100197255514410528E+06, 0.100214513504718459E+06, 0.100231716678680328E+06, + 0.100248516891677820E+06, 0.100264879167597144E+06, 0.100280677931150029E+06, 0.100295703143529230E+06, 0.100309668678237373E+06, + 0.100317822458752169E+06, 0.100323698725186405E+06, 0.100328766123466703E+06, 0.100333617686529382E+06, 0.100338870421945830E+06, + 0.100345146510504768E+06, 0.100353505811859010E+06, 0.100364091412822730E+06, 0.100377219192028511E+06, 0.100393145224109379E+06, + 0.100412076822805961E+06, 0.100436536362016341E+06, 0.100466993027333549E+06, 0.100499128955239808E+06, 0.100531867585847620E+06, + 0.100564210070354224E+06, 0.100595268938737849E+06, 0.100623389505981249E+06, 0.100648875381678285E+06, 0.100671545265182722E+06, + 0.100691215991390258E+06, 0.100707855569253967E+06, 0.100721531568851729E+06, 0.100729765774870320E+06, 0.100736382308921660E+06, + 0.100742049357786149E+06, 0.100747338931632839E+06, 0.100752699996680560E+06, 0.100758437644766876E+06, 0.100764492369211905E+06, + 0.100771174162651805E+06, 0.100778897781122723E+06, 0.100791202238176033E+06, 0.100805304746492911E+06, 0.100820453141876555E+06, + 0.100836553977341420E+06, 0.100853433691068960E+06, 0.100869804352758074E+06, 0.100885565873248357E+06, 0.100901263434718436E+06, + 0.100916755649211860E+06, 0.100931925490762223E+06, 0.100946862129343805E+06, 0.100964994999554750E+06, 0.100982379998277524E+06, + 0.100998599729598267E+06, 0.101013259118967748E+06, 0.101025997621651855E+06, 0.101036183051793079E+06, 0.101042991775159331E+06, + 0.101046219174794693E+06, 0.101045436783694371E+06, 0.101037979396283830E+06, 0.101026389136987622E+06, 0.101011353849770458E+06, + 0.100992765156084381E+06, 0.100970520839387638E+06, 0.100944522980413691E+06, 0.100914676733503889E+06, 0.100880889510173438E+06, + 0.100843070409204898E+06, 0.100794195318855112E+06, 0.100740849916230014E+06, 0.100684368608276331E+06, 0.100625515617689191E+06, + 0.100565057571482292E+06, 0.100503753672499588E+06, 0.100442348146381337E+06, 0.100381564680888332E+06, 0.100322120082476831E+06, + 0.100265427081164002E+06, 0.100211108587006820E+06, 0.100159852906932778E+06, 0.100112309293580329E+06, 0.101124201328911135E+06, + 0.101079108320663814E+06, 0.101031809144729792E+06, 0.100982479818601947E+06, 0.100931296727433786E+06, 0.100878431465452362E+06, + 0.100824045759680885E+06, 0.100768286540631874E+06, 0.100710530566360118E+06, 0.100651851143405918E+06, 0.100592641779612633E+06, + 0.100533088300546049E+06, 0.100473351995987294E+06, 0.100413568226339557E+06, 0.100347374189164038E+06, 0.100280419558277266E+06, + 0.100213466642138825E+06, 0.100146884874704396E+06, 0.100081054126754942E+06, 0.100016363564741026E+06, 0.999532111494706915E+05, + 0.998920037667682045E+05, 0.998331579776468134E+05, 0.997771013708717801E+05, 0.997242744959584961E+05, 0.996794911425569007E+05, + 0.996421673866169731E+05, 0.996083624063458992E+05, 0.995780558571076108E+05, 0.995512438908386830E+05, 0.995279390599935141E+05, + 0.995081697090995876E+05, 0.994919788171798573E+05, 0.994794222509916144E+05, 0.994705663858296175E+05, 0.994666304399983201E+05, + 0.994716729317709396E+05, 0.994803098980725772E+05, 0.994920284915772354E+05, 0.995062941002977459E+05, 0.995225510997954116E+05, + 0.995402235083560226E+05, 0.995587157137078175E+05, 0.995774134724761680E+05, 0.995956854178548674E+05, 0.996082099438724399E+05, + 0.996146714115503564E+05, 0.996198917096476653E+05, 0.996237772972328385E+05, 0.996262556600006501E+05, 0.996272811679797160E+05, + 0.996268420791924145E+05, 0.996249688472863927E+05, 0.996217438673883153E+05, 0.996165665480622556E+05, 0.996053672464558331E+05, + 0.995949919441781822E+05, 0.995861528017038072E+05, 0.995795026742108748E+05, 0.995756196555683418E+05, 0.995749923295157205E+05, + 0.995764918417123117E+05, 0.995811371618628909E+05, 0.995900021812679042E+05, 0.996053443416097725E+05, 0.996253126869847765E+05, + 0.996485392863536254E+05, 0.996747275639752770E+05, 0.997034975235640304E+05, 0.997343816924544808E+05, 0.997668244608898967E+05, + 0.998001857951137499E+05, 0.998337502953590738E+05, 0.998667425003782409E+05, 0.998964382191309269E+05, 0.999219732315580331E+05, + 0.999453769704884326E+05, 0.999669632680838986E+05, 0.999870458961453260E+05, 0.100005916456012012E+06, 0.100023824889774987E+06, + 0.100040963571971195E+06, 0.100057455775243085E+06, 0.100073413986486979E+06, 0.100089335775104671E+06, 0.100104815244426631E+06, + 0.100119703191363587E+06, 0.100134379227022902E+06, 0.100148369375800728E+06, 0.100161370783191393E+06, 0.100173213642796953E+06, + 0.100180378799944810E+06, 0.100185526497069281E+06, 0.100189324284954535E+06, 0.100192153267272603E+06, 0.100194434190503976E+06, + 0.100196610662858875E+06, 0.100198905421094794E+06, 0.100201850991823914E+06, 0.100206163107215340E+06, 0.100212230663632377E+06, + 0.100220378132198122E+06, 0.100230869811071767E+06, 0.100245444302250398E+06, 0.100264473811748554E+06, 0.100285188354245533E+06, + 0.100306907645131752E+06, 0.100328990026887506E+06, 0.100350863943610893E+06, 0.100371839758985952E+06, 0.100391444833452260E+06, + 0.100409831169643890E+06, 0.100426823791286341E+06, 0.100442350551841242E+06, 0.100456434485740057E+06, 0.100469179887128601E+06, + 0.100480095078871280E+06, 0.100490844862516460E+06, 0.100501773469729742E+06, 0.100513473090107072E+06, 0.100529036405637875E+06, + 0.100544944618372494E+06, 0.100561407314039185E+06, 0.100578441255079553E+06, 0.100596158161423402E+06, 0.100614688506316757E+06, + 0.100634037456854698E+06, 0.100654132781311564E+06, 0.100674831301503669E+06, 0.100695930204477670E+06, 0.100717182634869590E+06, + 0.100738316734543623E+06, 0.100757949561458212E+06, 0.100778269263575014E+06, 0.100798138776316147E+06, 0.100817212656416305E+06, + 0.100835135245772617E+06, 0.100851545416907000E+06, 0.100866083297882986E+06, 0.100878398135237148E+06, 0.100888156496614407E+06, + 0.100895050095971907E+06, 0.100897946875170004E+06, 0.100893038607802475E+06, 0.100884438418173842E+06, 0.100872056807847897E+06, + 0.100855733686039923E+06, 0.100836196267254127E+06, 0.100813309503127763E+06, 0.100786948600525633E+06, 0.100756997497101227E+06, + 0.100723347939641535E+06, 0.100681497385685245E+06, 0.100634489632593322E+06, 0.100584469640955329E+06, 0.100531975070484972E+06, + 0.100477580490852386E+06, 0.100421885399875624E+06, 0.100365503956835804E+06, 0.100309056337240749E+06, 0.100253161585176160E+06, + 0.100199112753698049E+06, 0.100147837599931416E+06, 0.100098570404209735E+06, 0.100051904767761502E+06, 0.100008417383464068E+06, + 0.101133829804470908E+06, 0.101086063734912168E+06, 0.101036163378778583E+06, 0.100984272823056410E+06, 0.100930541473297533E+06, + 0.100875120408097937E+06, 0.100818158832696005E+06, 0.100759800682388610E+06, 0.100700181428799915E+06, 0.100639425144117529E+06, + 0.100577641880169904E+06, 0.100514925420599073E+06, 0.100451351465310479E+06, 0.100382775391041228E+06, 0.100313407558045423E+06, + 0.100244124043691409E+06, 0.100175160300200252E+06, 0.100106643005048623E+06, 0.100038955227867787E+06, 0.999724957502307661E+05, + 0.999076781431158888E+05, 0.998449303055831406E+05, 0.997846944474534976E+05, 0.997274274929867825E+05, 0.996741803525597352E+05, + 0.996341923290063423E+05, 0.995977652427823923E+05, 0.995648719529626542E+05, 0.995354913787664409E+05, 0.995096084222995123E+05, + 0.994872134460891248E+05, 0.994683012796486000E+05, 0.994528697284307418E+05, 0.994409175579627627E+05, 0.994324419258456037E+05, + 0.994284685420939932E+05, 0.994314645232595940E+05, 0.994376508028579119E+05, 0.994465880324430618E+05, 0.994578122019961011E+05, + 0.994708370980191394E+05, 0.994851569440643361E+05, 0.995002493657292362E+05, 0.995155788435459253E+05, 0.995306008387735346E+05, + 0.995442855494334071E+05, 0.995482724169068970E+05, 0.995511559961705934E+05, 0.995528872179506288E+05, 0.995534386606523331E+05, + 0.995528106454166118E+05, 0.995510380683528929E+05, 0.995481980155677447E+05, 0.995444181794313772E+05, 0.995389426918443642E+05, + 0.995326299748121528E+05, 0.995248068651720969E+05, 0.995181203502452699E+05, 0.995131485287031392E+05, 0.995104093839186244E+05, + 0.995103487778951967E+05, 0.995133292577804386E+05, 0.995196200330811116E+05, 0.995293885226779821E+05, 0.995426939068978973E+05, + 0.995594831481808505E+05, 0.995804466354603064E+05, 0.996042013257502404E+05, 0.996303970501146687E+05, 0.996586123005633417E+05, + 0.996883528051014437E+05, 0.997188265847352159E+05, 0.997490367113701504E+05, 0.997788526495865081E+05, 0.998078707819837873E+05, + 0.998356993938613014E+05, 0.998619800562695164E+05, 0.998837326032437413E+05, 0.999030588156207523E+05, 0.999213959026974480E+05, + 0.999389528776631778E+05, 0.999559737390779337E+05, 0.999728528505193826E+05, 0.999889548460716323E+05, 0.100004292017804837E+06, + 0.100018822423468373E+06, 0.100032457501698547E+06, 0.100045070251751036E+06, 0.100056503593779649E+06, 0.100066444229329674E+06, + 0.100073267298309525E+06, 0.100078208907556284E+06, 0.100081428306994378E+06, 0.100083145646425299E+06, 0.100084490398295631E+06, + 0.100085214798590619E+06, 0.100085235536889129E+06, 0.100083644141418641E+06, 0.100082296767241191E+06, 0.100081573165770096E+06, + 0.100081814208376789E+06, 0.100083316094140551E+06, 0.100086326553815597E+06, 0.100092077248113128E+06, 0.100100913993150592E+06, + 0.100111107468981296E+06, 0.100122323217253404E+06, 0.100134231875447673E+06, 0.100146529461883110E+06, 0.100158953738958458E+06, + 0.100172103739167927E+06, 0.100185442550333013E+06, 0.100198870033114930E+06, 0.100214743046030431E+06, 0.100230501702414200E+06, + 0.100246186063517438E+06, 0.100261900880765723E+06, 0.100278280962620207E+06, 0.100294975745097370E+06, 0.100311878419328103E+06, + 0.100329065054564679E+06, 0.100346610730169734E+06, 0.100364576981339662E+06, 0.100382997190169379E+06, 0.100401860048637522E+06, + 0.100421460558640218E+06, 0.100441987614432976E+06, 0.100463274519939529E+06, 0.100485156332498926E+06, 0.100507667562079601E+06, + 0.100531755712309474E+06, 0.100555537683995659E+06, 0.100578784151641899E+06, 0.100601239956125326E+06, 0.100622628756313949E+06, + 0.100641873088256354E+06, 0.100658680264014634E+06, 0.100673598187900920E+06, 0.100686312726101605E+06, 0.100696503456104270E+06, + 0.100703849613094353E+06, 0.100704152415214849E+06, 0.100700762505721214E+06, 0.100694332357036590E+06, 0.100684801738842943E+06, + 0.100672137064367969E+06, 0.100656329651135165E+06, 0.100637393206196401E+06, 0.100615360755861184E+06, 0.100590281222544916E+06, + 0.100562215831141861E+06, 0.100526781016220033E+06, 0.100486348156266336E+06, 0.100442798181998849E+06, 0.100397163429546563E+06, + 0.100349807344903311E+06, 0.100301139976506107E+06, 0.100251607747954069E+06, 0.100201684250218939E+06, 0.100151862062679153E+06, + 0.100102645581508201E+06, 0.100056044918004729E+06, 0.100011301942910883E+06, 0.999684520456376777E+05, 0.999279531311431929E+05, + 0.998902646792392770E+05, 0.101126663346454399E+06, 0.101077325354608969E+06, 0.101025975734916894E+06, 0.100972737972671399E+06, + 0.100917744423974829E+06, 0.100861133803490855E+06, 0.100803048766821448E+06, 0.100743633625432005E+06, 0.100683032233185906E+06, + 0.100621386084403202E+06, 0.100558832663878042E+06, 0.100495211427552291E+06, 0.100428081646754872E+06, 0.100360053702616802E+06, + 0.100291421804985934E+06, 0.100222501857581025E+06, 0.100153629396011398E+06, 0.100085157752426705E+06, 0.100017456492403435E+06, + 0.999509101650603116E+05, 0.998859174013813172E+05, 0.998228903882164013E+05, 0.997622547363343474E+05, 0.997044497501409787E+05, + 0.996565808532324445E+05, 0.996171954030033376E+05, 0.995813735590216529E+05, 0.995490780595074320E+05, 0.995202664706442010E+05, + 0.994948916653312772E+05, 0.994731497863732366E+05, 0.994547373765991215E+05, 0.994395024448596523E+05, 0.994273918334258487E+05, + 0.994183417080185318E+05, 0.994131115873192466E+05, 0.994138210062121798E+05, 0.994170868554473127E+05, 0.994225572846895811E+05, + 0.994298923767942179E+05, 0.994385978253560606E+05, 0.994482495116238133E+05, 0.994584440096453618E+05, 0.994687785322086420E+05, + 0.994788546658055129E+05, 0.994882828035313869E+05, 0.994927040708071727E+05, 0.994917547439376503E+05, 0.994895539007886109E+05, + 0.994862075166797877E+05, 0.994818501581585733E+05, 0.994766470759525691E+05, 0.994707963627129502E+05, 0.994645310337857954E+05, + 0.994581208250226337E+05, 0.994518734280974313E+05, 0.994461348017268174E+05, 0.994415182672292285E+05, 0.994388346879257297E+05, + 0.994384357346413162E+05, 0.994406125032009149E+05, 0.994455917032776051E+05, 0.994535286747415666E+05, 0.994645016916688619E+05, + 0.994785078337676387E+05, 0.994954607091662765E+05, 0.995151903074341826E+05, 0.995379744989390892E+05, 0.995645762978403654E+05, + 0.995919660907828365E+05, 0.996199268533732247E+05, 0.996482101418556267E+05, 0.996765332991438627E+05, 0.997045938426658686E+05, + 0.997320840835444978E+05, 0.997587053657859215E+05, 0.997841813092843222E+05, 0.998082694645679585E+05, 0.998307708426059398E+05, + 0.998521847777656949E+05, 0.998731316336951131E+05, 0.998915223579208832E+05, 0.999088069900928822E+05, 0.999250655468217301E+05, + 0.999403321942196199E+05, 0.999545992766920099E+05, 0.999678219791941956E+05, 0.999799234377201792E+05, 0.999908557408674824E+05, + 0.100000288315772239E+06, 0.100007974659642932E+06, 0.100013912274213857E+06, 0.100018152445268570E+06, 0.100020792433534516E+06, + 0.100021965384116600E+06, 0.100021828600707202E+06, 0.100018978825766098E+06, 0.100014638020503815E+06, 0.100010038309740252E+06, + 0.100005576575099418E+06, 0.100001604858675491E+06, 0.999984320892866672E+05, 0.999963266886948113E+05, 0.999958737477183749E+05, + 0.999972975927051302E+05, 0.100000048030566773E+06, 0.100004042344745598E+06, 0.100009194673973179E+06, 0.100015426118827090E+06, + 0.100022673026545686E+06, 0.100031009563329135E+06, 0.100040766570146734E+06, 0.100051217540583049E+06, 0.100062248668533124E+06, + 0.100073786795171531E+06, 0.100085797503990121E+06, 0.100098280610450573E+06, 0.100111262656178049E+06, 0.100125001802413579E+06, + 0.100139645695878644E+06, 0.100154900063508263E+06, 0.100170710309353148E+06, 0.100187004814548171E+06, 0.100203682971120987E+06, + 0.100220602392753455E+06, 0.100237565502663623E+06, 0.100256278549938754E+06, 0.100276900404893633E+06, 0.100298794291387065E+06, + 0.100320557514765664E+06, 0.100342058165774986E+06, 0.100363130678741916E+06, 0.100383577435456726E+06, 0.100403171366828377E+06, + 0.100421659429775435E+06, 0.100438766794516225E+06, 0.100454201546808938E+06, 0.100467659691497232E+06, 0.100478830237807808E+06, + 0.100481024801078907E+06, 0.100479810484167552E+06, 0.100476403382797740E+06, 0.100470673041393165E+06, 0.100462504496619513E+06, + 0.100451800234604845E+06, 0.100438481209722173E+06, 0.100422487058078696E+06, 0.100403775642287073E+06, 0.100382322062990715E+06, + 0.100358117267813446E+06, 0.100327534199358997E+06, 0.100293850879764213E+06, 0.100257806725219358E+06, 0.100219741686727677E+06, + 0.100180023194298759E+06, 0.100139040711945461E+06, 0.100097200477411025E+06, 0.100054920551059535E+06, 0.100012626265403043E+06, + 0.999707461374165723E+05, 0.999303503014407033E+05, 0.998922229704366764E+05, 0.998554721656402544E+05, 0.998204850080980395E+05, + 0.997876409225251264E+05, 0.997573084048583696E+05, 0.101103863341862932E+06, 0.101054198041262367E+06, 0.101002678396138304E+06, + 0.100949414469850730E+06, 0.100894527371675096E+06, 0.100838147558637153E+06, 0.100780413214267071E+06, 0.100721468731159111E+06, + 0.100661463324523051E+06, 0.100600549803942500E+06, 0.100538495641508489E+06, 0.100474499779926511E+06, 0.100409614880186520E+06, + 0.100344074690081019E+06, 0.100278137807477731E+06, 0.100212086086552372E+06, 0.100146223109295490E+06, 0.100080872747272268E+06, + 0.100016377835126099E+06, 0.999530989729176799E+05, 0.998914134690468200E+05, 0.998317144291724107E+05, 0.997744099892116501E+05, + 0.997208338934957865E+05, 0.996799309689324291E+05, 0.996422327801534993E+05, 0.996077247089604498E+05, 0.995763830833266111E+05, + 0.995481752007196337E+05, 0.995230592311468208E+05, 0.995009839760444302E+05, 0.994818884619951277E+05, 0.994657013515687577E+05, + 0.994523401572802686E+05, 0.994417102486785589E+05, 0.994338127166474005E+05, 0.994291184813256987E+05, 0.994266081659517949E+05, + 0.994259833524572168E+05, 0.994269351914163999E+05, 0.994291475057475909E+05, 0.994323001129119220E+05, 0.994360724062380032E+05, + 0.994401472289394151E+05, 0.994442150616938598E+05, 0.994479785254193557E+05, 0.994511571742526139E+05, 0.994472284598653205E+05, + 0.994408965796853736E+05, 0.994339336034472362E+05, 0.994264710020695638E+05, 0.994186660048548511E+05, 0.994107025256855122E+05, + 0.994027916086733312E+05, 0.993951711926945572E+05, 0.993881049497915083E+05, 0.993818799057818542E+05, 0.993768025040628709E+05, + 0.993745371453054540E+05, 0.993758273945832625E+05, 0.993797480709728989E+05, 0.993864179439653672E+05, 0.993959015946626314E+05, + 0.994106666848780587E+05, 0.994280957797027659E+05, 0.994479062249146809E+05, 0.994699024606817256E+05, 0.994938326370272989E+05, + 0.995193970618178137E+05, 0.995462575961586117E+05, 0.995732238058578514E+05, 0.995996836683722795E+05, 0.996264076540508540E+05, + 0.996531520384603791E+05, 0.996796729134591151E+05, 0.997057352581914602E+05, 0.997311214531925361E+05, 0.997565307292698708E+05, + 0.997809628500159452E+05, 0.998041926037547237E+05, 0.998260922842872533E+05, 0.998465616497438023E+05, 0.998655323213428928E+05, + 0.998829702013785281E+05, 0.998988759405013552E+05, 0.999132835855504527E+05, 0.999267531384376343E+05, 0.999401187534305645E+05, + 0.999522829859957856E+05, 0.999629705900948175E+05, 0.999720750719777716E+05, 0.999795225775888684E+05, 0.999852704402040836E+05, + 0.999893033756584045E+05, 0.999916276698245056E+05, 0.999912215328864258E+05, 0.999874978505536856E+05, 0.999827294697511534E+05, + 0.999772668831095216E+05, 0.999714403004270425E+05, 0.999655543840146129E+05, 0.999598844544293243E+05, 0.999546738384171913E+05, + 0.999501503361758805E+05, 0.999464612795733119E+05, 0.999436472754112765E+05, 0.999417478240415512E+05, 0.999407845190346270E+05, + 0.999407674168311496E+05, 0.999417003681598144E+05, 0.999435850419050112E+05, 0.999466778359479795E+05, 0.999509741170870548E+05, + 0.999561184478715149E+05, 0.999620266396879451E+05, 0.999686260435519798E+05, 0.999758509523019893E+05, 0.999836356497705565E+05, + 0.999919049957114039E+05, 0.100000562486864073E+06, 0.100011784952549118E+06, 0.100025750768122278E+06, 0.100039950549839836E+06, + 0.100054145017178846E+06, 0.100068316891848794E+06, 0.100082450146767165E+06, 0.100096523400557431E+06, 0.100110501610887819E+06, + 0.100124326095454249E+06, 0.100137903024072584E+06, 0.100153035210029513E+06, 0.100168028234449826E+06, 0.100182528489386037E+06, + 0.100196311615898419E+06, 0.100209129758123207E+06, 0.100220714305906484E+06, 0.100227674075086179E+06, 0.100228582862959636E+06, + 0.100228182141282334E+06, 0.100226441566948473E+06, 0.100223301716988630E+06, 0.100218680617939594E+06, 0.100212480375930187E+06, + 0.100204593660852275E+06, 0.100193237399701000E+06, 0.100179608999797390E+06, 0.100163806561057383E+06, 0.100145763706322687E+06, + 0.100124166108882637E+06, 0.100097853920290698E+06, 0.100069603397772837E+06, 0.100039598196173276E+06, 0.100008052525304520E+06, + 0.999752085984543955E+05, 0.999413336779185047E+05, 0.999067168729345140E+05, 0.998716658233869821E+05, 0.998365033809807937E+05, + 0.998015643788216548E+05, 0.997673503212209471E+05, 0.997368095318123815E+05, 0.997072417009385681E+05, 0.996789372306682053E+05, + 0.996521942416031088E+05, 0.996273141486202512E+05, 0.996045978845247591E+05, 0.101067589111213412E+06, 0.101018770688517165E+06, + 0.100968154311929655E+06, 0.100916004392167699E+06, 0.100862587963118029E+06, 0.100807829042751429E+06, 0.100751860689524168E+06, + 0.100694824678955032E+06, 0.100636870575220571E+06, 0.100578085861079686E+06, 0.100518387120511878E+06, 0.100457910498338359E+06, + 0.100396827710058526E+06, 0.100335334776766380E+06, 0.100273650785659062E+06, 0.100212016619918053E+06, 0.100150693670614579E+06, + 0.100089962540906286E+06, 0.100030121749858867E+06, 0.999714864397286292E+05, 0.999143870864777564E+05, 0.998591682086720684E+05, + 0.998061870647466858E+05, 0.997614041189860436E+05, 0.997232133410041570E+05, 0.996877601571912237E+05, 0.996550329117300425E+05, + 0.996250097998356068E+05, 0.995976585142769036E+05, 0.995729358349222894E+05, 0.995507871467952355E+05, 0.995311458738776855E+05, + 0.995139328178480646E+05, 0.994990553930397000E+05, 0.994864067510919558E+05, 0.994758647909620777E+05, 0.994662936172032933E+05, + 0.994584116138104437E+05, 0.994520440064580325E+05, 0.994469670430250553E+05, 0.994429511205758317E+05, 0.994397638951787376E+05, + 0.994371735196124209E+05, 0.994349519828108314E+05, 0.994328785098660155E+05, 0.994307429622300406E+05, 0.994283491541375697E+05, + 0.994255179730021191E+05, 0.994164893114872393E+05, 0.994067289084808290E+05, 0.993968888922061742E+05, 0.993871232560968492E+05, + 0.993776052903232921E+05, 0.993685268314349669E+05, 0.993600967438642401E+05, 0.993525384531912714E+05, 0.993461969112091901E+05, + 0.993435709722199681E+05, 0.993430289823759958E+05, 0.993448240458555374E+05, 0.993518125064813066E+05, 0.993620332314667612E+05, + 0.993746322170980275E+05, 0.993895541802843509E+05, 0.994066995366652700E+05, 0.994259271220238734E+05, 0.994470579336317896E+05, + 0.994698797554098419E+05, 0.994941524985713913E+05, 0.995196140617028141E+05, 0.995459864926176379E+05, 0.995729822203312797E+05, + 0.996003101205446874E+05, 0.996273070851956145E+05, 0.996547798040555062E+05, 0.996819738131592894E+05, 0.997085378998868837E+05, + 0.997343278080748278E+05, 0.997592022275180498E+05, 0.997830289890008135E+05, 0.998056904289906088E+05, 0.998270877683784638E+05, + 0.998471443932554248E+05, 0.998658079734391795E+05, 0.998830514038870024E+05, 0.998996025676379795E+05, 0.999153229697452334E+05, + 0.999295566639472963E+05, 0.999422722019988432E+05, 0.999534500054842792E+05, 0.999630795823789667E+05, 0.999711562553596450E+05, + 0.999776774721563124E+05, 0.999826387612595136E+05, 0.999854644320731022E+05, 0.999828794177739328E+05, 0.999789847225893318E+05, + 0.999739838414557307E+05, 0.999680998532223457E+05, 0.999615553821963986E+05, 0.999545658866950980E+05, 0.999473341203756863E+05, + 0.999400456392968772E+05, 0.999327953721481608E+05, 0.999256989141568774E+05, 0.999189700236989156E+05, 0.999127048128768074E+05, + 0.999069798769329791E+05, 0.999018544683639047E+05, 0.998973722234758170E+05, 0.998935621850836178E+05, 0.998904388907014218E+05, + 0.998896448727687675E+05, 0.998900344972452294E+05, 0.998911970826382749E+05, 0.998931396187662176E+05, 0.998958769268335309E+05, + 0.998994275255013781E+05, 0.999038084460577520E+05, 0.999090289824781794E+05, 0.999150833667861443E+05, 0.999217240524284571E+05, + 0.999282473433497362E+05, 0.999348833579850179E+05, 0.999415375242985901E+05, 0.999481154404054105E+05, 0.999545171017064131E+05, + 0.999606302661866066E+05, 0.999663230149861483E+05, 0.999714356178636663E+05, 0.999757718627941504E+05, 0.999790900530105428E+05, + 0.999810939111108019E+05, 0.999819561511524662E+05, 0.999789948862129386E+05, 0.999752827398946683E+05, 0.999708888630344300E+05, + 0.999658466886194801E+05, 0.999601566475907457E+05, 0.999537895884533064E+05, 0.999466907368066168E+05, 0.999387840276392963E+05, + 0.999299766462147236E+05, 0.999201636218782805E+05, 0.999092323322767916E+05, 0.998970667923400615E+05, 0.998831789013588714E+05, + 0.998636939941647142E+05, 0.998431119746374316E+05, 0.998214963412640354E+05, 0.997970862666926550E+05, 0.997712444170942908E+05, + 0.997445906917362154E+05, 0.997173029439411330E+05, 0.996895795051780588E+05, 0.996616375682111830E+05, 0.996337113354519679E+05, + 0.996060500180081726E+05, 0.995789157595469587E+05, 0.995557562522905791E+05, 0.995337048495515774E+05, 0.995126888312002120E+05, + 0.994929130817774712E+05, 0.994745951235418033E+05, 0.994579612022724759E+05, 0.994432427594338078E+05, 0.101021034351216382E+06, + 0.100974523158164724E+06, 0.100926407272977900E+06, 0.100876804093661282E+06, 0.100825841471867636E+06, 0.100773656698396328E+06, + 0.100720395485641522E+06, 0.100666210969990992E+06, 0.100612099345619077E+06, 0.100557249279083626E+06, 0.100501677971650905E+06, + 0.100445572670880414E+06, 0.100389253853780203E+06, 0.100332968905338319E+06, 0.100276665148379936E+06, 0.100220537893264976E+06, + 0.100164799821054621E+06, 0.100109679736971462E+06, 0.100055421257730064E+06, 0.100002281430952105E+06, 0.999505292822571937E+05, + 0.999004442827473104E+05, 0.998530843548639095E+05, 0.998156761219489854E+05, 0.997805278523404413E+05, 0.997476323427424795E+05, + 0.997169731242686539E+05, 0.996885239311042969E+05, 0.996622481616842706E+05, 0.996380983225617529E+05, 0.996160154459489713E+05, + 0.995959284728124476E+05, 0.995777535943772964E+05, 0.995613935458951310E+05, 0.995467368475156691E+05, 0.995336569880241732E+05, + 0.995208266243795515E+05, 0.995087482639954542E+05, 0.994977965334250039E+05, 0.994878249241337762E+05, 0.994786826211323350E+05, + 0.994702168427006691E+05, 0.994622751834644587E+05, 0.994547079083998542E+05, 0.994473701327138842E+05, 0.994401238077413873E+05, + 0.994328394160198222E+05, 0.994254188335577346E+05, 0.994184404922492249E+05, 0.994087127432848210E+05, 0.993987930235803360E+05, + 0.993894574291334138E+05, 0.993808966627234331E+05, 0.993733080854502186E+05, 0.993668924009867187E+05, 0.993618498078672274E+05, + 0.993583756460734730E+05, 0.993566555807828554E+05, 0.993568603838800627E+05, 0.993591403923829785E+05, 0.993636197419046657E+05, + 0.993703904921866488E+05, 0.993811197203903430E+05, 0.993950856599565304E+05, 0.994111457979586703E+05, 0.994291602554974379E+05, + 0.994489675444759632E+05, 0.994703876196585625E+05, 0.994932253351752443E+05, 0.995172741944998997E+05, 0.995426559018634871E+05, + 0.995694776827033347E+05, 0.995970389008766942E+05, 0.996251091056232981E+05, 0.996534496905636333E+05, 0.996818187512539298E+05, + 0.997099760279327893E+05, 0.997374141751707793E+05, 0.997622618739524623E+05, 0.997862435467323085E+05, 0.998092414887019404E+05, + 0.998311505958143825E+05, 0.998518805596518214E+05, 0.998718102890837035E+05, 0.998910750046514877E+05, 0.999090219912788452E+05, + 0.999255559670365765E+05, 0.999405919139345788E+05, 0.999540538378546335E+05, 0.999658730563341524E+05, 0.999759860512857849E+05, + 0.999843319314751134E+05, 0.999908495555851987E+05, 0.999954743712658383E+05, 0.999944404784162907E+05, 0.999915968456238916E+05, + 0.999872439634975599E+05, 0.999816171531630534E+05, 0.999749362615833961E+05, 0.999674042229870247E+05, 0.999592064518093102E+05, + 0.999505109123499715E+05, 0.999414687118180882E+05, 0.999323665105546679E+05, 0.999233975283402833E+05, 0.999144981369005836E+05, + 0.999058003303556034E+05, 0.998974241845954093E+05, 0.998894782591478870E+05, 0.998820595750179200E+05, 0.998752530846157169E+05, + 0.998691305778080132E+05, 0.998637489957377547E+05, 0.998586746844062873E+05, 0.998541772928227729E+05, 0.998502966627068381E+05, + 0.998469966131329420E+05, 0.998442320106148400E+05, 0.998419453691209637E+05, 0.998400626589490130E+05, 0.998384883490106731E+05, + 0.998370997211475333E+05, 0.998357405118142487E+05, 0.998339247931384743E+05, 0.998316580178510631E+05, 0.998293639855545480E+05, + 0.998269017565975373E+05, 0.998241201967542729E+05, 0.998208528853709577E+05, 0.998098081032783375E+05, 0.997954370825381193E+05, + 0.997808296869748592E+05, 0.997662255405725009E+05, 0.997518145513712225E+05, 0.997377288090598740E+05, 0.997240360167264153E+05, + 0.997115902471897134E+05, 0.997002807779587602E+05, 0.996889928911353927E+05, 0.996776906921413611E+05, 0.996663184120892256E+05, + 0.996548031405013462E+05, 0.996430577981460665E+05, 0.996309842516777717E+05, 0.996172720856796950E+05, 0.995989960463366879E+05, + 0.995803026148819772E+05, 0.995612677891255880E+05, 0.995419614978694444E+05, 0.995224517021402135E+05, 0.995028080337064894E+05, + 0.994831049415358284E+05, 0.994634243322594411E+05, 0.994438577049017331E+05, 0.994245077928505052E+05, 0.994054897371244297E+05, + 0.993869318243143207E+05, 0.993690043020055746E+05, 0.993554308490509575E+05, 0.993412332136938494E+05, 0.993276308539287711E+05, + 0.993151162456799066E+05, 0.993038276851009432E+05, 0.992939167429839872E+05, 0.992855451787946949E+05, 0.992788820449725754E+05, + 0.100964847544612581E+06, 0.100921528597807934E+06, 0.100876819617514033E+06, 0.100830819119977881E+06, 0.100783635790840315E+06, + 0.100735387872604493E+06, 0.100686849362626730E+06, 0.100638850722815405E+06, 0.100589987206303587E+06, 0.100540391690949080E+06, + 0.100490207838124057E+06, 0.100439589213655403E+06, 0.100388698427470110E+06, 0.100337706295036201E+06, 0.100286791022897989E+06, + 0.100236137419730803E+06, 0.100185936133379830E+06, 0.100136382913311769E+06, 0.100087677896791603E+06, 0.100040024915916016E+06, + 0.999936308213850425E+05, 0.999487048175969685E+05, 0.999098959263045108E+05, 0.998760905821691704E+05, 0.998440744381323602E+05, + 0.998138388707919803E+05, 0.997853639904371375E+05, 0.997586190608742472E+05, 0.997335630315415328E+05, 0.997101451748205582E+05, + 0.996883058208672010E+05, 0.996679771815481945E+05, 0.996490842541338643E+05, 0.996315457942174835E+05, 0.996152753458579973E+05, + 0.996001823151213321E+05, 0.995855679555827810E+05, 0.995705558364965109E+05, 0.995563634129148850E+05, 0.995429286082849721E+05, + 0.995301928975228802E+05, 0.995181034121451230E+05, 0.995066149374921079E+05, 0.994956917495421949E+05, 0.994853092368055950E+05, + 0.994754552514231473E+05, 0.994661311329740856E+05, 0.994573523487461207E+05, 0.994491486954472930E+05, 0.994415640096655407E+05, + 0.994332401191460376E+05, 0.994242851325149240E+05, 0.994162875697421550E+05, 0.994093942955236271E+05, 0.994037502528714977E+05, + 0.993994957235938200E+05, 0.993967633485402912E+05, 0.993956749460767023E+05, 0.993963381773120200E+05, 0.993988431167032832E+05, + 0.994032587965396087E+05, 0.994096298031491460E+05, 0.994179730111528625E+05, 0.994282745493404218E+05, 0.994404870973938814E+05, + 0.994568186139204772E+05, 0.994754658271223161E+05, 0.994958964449326450E+05, 0.995177045414582390E+05, 0.995407458140571835E+05, + 0.995648609237595665E+05, 0.995898777201360062E+05, 0.996156137473152776E+05, 0.996418789751202567E+05, 0.996684786927591776E+05, + 0.996952164972683240E+05, 0.997218973051197536E+05, 0.997483303132390720E+05, 0.997743318352098577E+05, 0.997997279397391831E+05, + 0.998243568215117266E+05, 0.998484029817739647E+05, 0.998715185643880104E+05, 0.998929709407826740E+05, 0.999121391071011894E+05, + 0.999300598538423073E+05, 0.999466118827012979E+05, 0.999616803026846756E+05, 0.999751558213879034E+05, 0.999869336418048333E+05, + 0.999969120922718139E+05, 0.100004991024896648E+06, 0.100011070025070803E+06, 0.100011361902027944E+06, 0.100009689874259901E+06, + 0.100006354866167210E+06, 0.100001521961853068E+06, 0.999953569047140481E+05, 0.999880229251482233E+05, 0.999796782529097254E+05, + 0.999704742484093149E+05, 0.999605540801449097E+05, 0.999500518713602651E+05, 0.999395620634615480E+05, 0.999293797224061564E+05, + 0.999189780037119199E+05, 0.999084634603603772E+05, 0.998979305732036155E+05, 0.998874607924644370E+05, 0.998771215026191203E+05, + 0.998669648551638238E+05, 0.998570264274643996E+05, 0.998473236800365266E+05, 0.998378541987464268E+05, 0.998280094515223464E+05, + 0.998183015118441253E+05, 0.998087584599398106E+05, 0.997993088922536845E+05, 0.997898632369703118E+05, 0.997803110261358233E+05, + 0.997705176970055909E+05, 0.997603209573400527E+05, 0.997495267616314668E+05, 0.997338504371996823E+05, 0.997144148866953765E+05, + 0.996946194589021616E+05, 0.996748889962201501E+05, 0.996543973099300492E+05, 0.996333799061114987E+05, 0.996120632551793096E+05, + 0.995906575155593600E+05, 0.995693496108486434E+05, 0.995482968337894126E+05, 0.995276211300861032E+05, 0.995074041910853848E+05, + 0.994876834578204434E+05, 0.994684491110481467E+05, 0.994496420937635121E+05, 0.994311531852242333E+05, 0.994128231195840344E+05, + 0.993950629246981553E+05, 0.993796705843183881E+05, 0.993609699415756186E+05, 0.993418055421917088E+05, 0.993226794637357671E+05, + 0.993037059687493893E+05, 0.992849845648908376E+05, 0.992666033190360467E+05, 0.992486420429716236E+05, 0.992311752996093419E+05, + 0.992142751883332967E+05, 0.991980138777397078E+05, 0.991824658634138323E+05, 0.991677099373037345E+05, 0.991538308635238063E+05, + 0.991409207629147422E+05, 0.991303845164175582E+05, 0.991233478553789610E+05, 0.991173123854586884E+05, 0.991122941300806997E+05, + 0.991083274217430298E+05, 0.991054636978437338E+05, 0.991037699911700765E+05, 0.991033272031231463E+05, 0.991042282352598704E+05, + 0.991065760427079076E+05, 0.100899327711180042E+06, 0.100860014589195416E+06, 0.100819531202107522E+06, 0.100777959510744709E+06, + 0.100735390607726556E+06, 0.100694036465613695E+06, 0.100652089405901919E+06, 0.100609367247066592E+06, 0.100565963600471325E+06, + 0.100521982301190656E+06, 0.100477536683349797E+06, 0.100432748853070138E+06, 0.100387748961175384E+06, 0.100342674477306704E+06, + 0.100297669466538631E+06, 0.100252883868987425E+06, 0.100208472782261073E+06, 0.100164595745919316E+06, 0.100121416026401625E+06, + 0.100079099900142377E+06, 0.100037815931840771E+06, 0.999981416469988617E+05, 0.999662389876496309E+05, 0.999356748708466621E+05, + 0.999064575822306797E+05, 0.998785877324428584E+05, 0.998520583580002858E+05, 0.998268551135048328E+05, 0.998029565487271466E+05, + 0.997803344633126544E+05, 0.997589543309666333E+05, 0.997387757839643018E+05, 0.997197531476882141E+05, 0.997018360135869007E+05, + 0.996849698374662257E+05, 0.996690965483438340E+05, 0.996541551512074802E+05, 0.996382689559327409E+05, 0.996225861026435014E+05, + 0.996075569737299666E+05, 0.995931690202676109E+05, 0.995794128974490304E+05, 0.995662834351470083E+05, 0.995537804808199580E+05, + 0.995419095816340414E+05, 0.995306824727639178E+05, 0.995201173394836951E+05, 0.995102388219246932E+05, 0.995010777333177539E+05, + 0.994926704652096669E+05, 0.994850580565927958E+05, 0.994782849081547320E+05, 0.994712945317966660E+05, 0.994652135801002441E+05, + 0.994603804881314572E+05, 0.994568932856863394E+05, 0.994548423780885496E+05, 0.994543085284921108E+05, 0.994553608083860745E+05, + 0.994580545552721160E+05, 0.994624293810699601E+05, 0.994689205148530309E+05, 0.994771599445407046E+05, 0.994871232315969537E+05, + 0.994987933987223369E+05, 0.995121358180468815E+05, 0.995270974554495333E+05, 0.995436065119199775E+05, 0.995623452046183083E+05, + 0.995829609157189843E+05, 0.996045871363499173E+05, 0.996270734208106005E+05, 0.996502628846515872E+05, 0.996739938804089179E+05, + 0.996981017517049913E+05, 0.997224206254554738E+05, 0.997467852001343563E+05, 0.997710324871725461E+05, 0.997951466602976434E+05, + 0.998195365345201863E+05, 0.998432686447168817E+05, 0.998661797675172566E+05, 0.998881192989034753E+05, 0.999089497794278432E+05, + 0.999285470134942298E+05, 0.999467997752335650E+05, 0.999636091025751084E+05, 0.999788871899545629E+05, 0.999925558984901872E+05, + 0.100004544910230834E+06, 0.100014789560105870E+06, 0.100022807416958167E+06, 0.100024265952704969E+06, 0.100023783498597622E+06, + 0.100021339437537274E+06, 0.100017269778783608E+06, 0.100011871918673860E+06, 0.100005243624383627E+06, 0.999974886843563872E+05, + 0.999887143337349553E+05, 0.999790290942598513E+05, 0.999685409989449690E+05, 0.999573561671147618E+05, 0.999457665900857537E+05, + 0.999339297350767738E+05, 0.999216537925987359E+05, 0.999089986755408318E+05, 0.998960156700364460E+05, 0.998827458376240684E+05, + 0.998692184851955972E+05, 0.998554496711306274E+05, 0.998414407220986322E+05, 0.998266607131311466E+05, 0.998100194463602238E+05, + 0.997926225952954846E+05, 0.997741943883323111E+05, 0.997546758201429911E+05, 0.997340957313024119E+05, 0.997124527623238246E+05, + 0.996897658681415196E+05, 0.996660748766462057E+05, 0.996414402768971777E+05, 0.996159421531026164E+05, 0.995896781945527619E+05, + 0.995627607309631567E+05, 0.995353127665240754E+05, 0.995074630135256157E+05, 0.994793399566985754E+05, 0.994514054125879338E+05, + 0.994238487412724935E+05, 0.993966902679466439E+05, 0.993700475395201356E+05, 0.993440177799105440E+05, 0.993186743649216805E+05, + 0.992940638036397431E+05, 0.992702032829608506E+05, 0.992470788181921816E+05, 0.992246440384727030E+05, 0.992011645870204229E+05, + 0.991746701100545615E+05, 0.991489545634662645E+05, 0.991241218039765226E+05, 0.991002500071589602E+05, 0.990773923979805404E+05, + 0.990555784783537238E+05, 0.990348157029355934E+05, 0.990159736965085758E+05, 0.989981835313982592E+05, 0.989814199610305950E+05, + 0.989657585620708269E+05, 0.989512713805230014E+05, 0.989380287548638735E+05, 0.989261010103145527E+05, 0.989155600070171640E+05, + 0.989065271083586849E+05, 0.989035472935256403E+05, 0.989017382893972535E+05, 0.989010885106625501E+05, 0.989015950018414442E+05, + 0.989032643180148880E+05, 0.989061129372854630E+05, 0.989101672753579624E+05, 0.989154633681022387E+05, 0.989220462827519368E+05, + 0.989299693127524224E+05, 0.989392930054068274E+05, 0.100824204136130124E+06, 0.100789629875414903E+06, 0.100754101269738283E+06, + 0.100718965766187423E+06, 0.100683784943369043E+06, 0.100647901733698469E+06, 0.100611367338035154E+06, 0.100574242617115160E+06, + 0.100536597536512694E+06, 0.100498510595931759E+06, 0.100460068244709808E+06, 0.100421364285146075E+06, 0.100382499264969942E+06, + 0.100343579859943900E+06, 0.100304718247249199E+06, 0.100266031469940950E+06, 0.100227640792377366E+06, 0.100189671046138596E+06, + 0.100152249965554060E+06, 0.100115507511560325E+06, 0.100079575182221481E+06, 0.100047602801154819E+06, 0.100019322376832803E+06, + 0.999920409995853261E+05, 0.999657674355637573E+05, 0.999405058915761474E+05, 0.999162559646318405E+05, 0.998930126550737332E+05, + 0.998707664374257292E+05, 0.998495033822863334E+05, 0.998292053217475768E+05, 0.998098500498988724E+05, 0.997914115489896358E+05, + 0.997738602307620895E+05, 0.997571631813267886E+05, 0.997412843967411318E+05, 0.997261849951640761E+05, 0.997116241750995250E+05, + 0.996956516613714484E+05, 0.996802443385057850E+05, 0.996654141346137912E+05, 0.996511746410201595E+05, 0.996375414807133056E+05, + 0.996245325880948803E+05, 0.996121683814974822E+05, 0.996004718105865177E+05, 0.995894682617738144E+05, 0.995791853061816655E+05, + 0.995696522765213740E+05, 0.995608996615122596E+05, 0.995529583091799286E+05, 0.995458584335334599E+05, 0.995396284227406868E+05, + 0.995343367855710967E+05, 0.995305561580702051E+05, 0.995281233336275036E+05, 0.995270277929425938E+05, 0.995273063084702299E+05, + 0.995289897428417025E+05, 0.995321019769720151E+05, 0.995366588694784150E+05, 0.995426672761023801E+05, 0.995501241589093697E+05, + 0.995590158153962548E+05, 0.995693172571642208E+05, 0.995809917664462992E+05, 0.995939906564428093E+05, 0.996082532580851985E+05, + 0.996237071514999261E+05, 0.996402686551040679E+05, 0.996578435789826035E+05, 0.996763282420650648E+05, 0.996956299728876329E+05, + 0.997162410862197139E+05, 0.997372387307632453E+05, 0.997586353656998253E+05, 0.997808433601890720E+05, 0.998030187608370179E+05, + 0.998249872889569233E+05, 0.998465794208683947E+05, 0.998676313277232548E+05, 0.998879856224390824E+05, 0.999074918951320724E+05, + 0.999260070231147402E+05, 0.999433952465451439E+05, 0.999595280060564692E+05, 0.999742835440646595E+05, 0.999875462768208236E+05, + 0.999992059495608264E+05, 0.100009156592205647E+06, 0.100016063172606460E+06, 0.100019024917317467E+06, 0.100020084175617667E+06, + 0.100019327613303438E+06, 0.100016848817808917E+06, 0.100012745044390162E+06, 0.100007114161981110E+06, 0.100000051820447916E+06, + 0.999916488518789411E+05, 0.999819889104085451E+05, 0.999711463483044645E+05, 0.999591843210265215E+05, 0.999461531109617499E+05, + 0.999321525809828890E+05, 0.999172469778668019E+05, 0.999013989306642325E+05, 0.998846455567706289E+05, 0.998670119376398798E+05, + 0.998485130268999492E+05, 0.998291555936072982E+05, 0.998089401641651202E+05, 0.997878629283593327E+05, 0.997659175757975609E+05, + 0.997430970289848337E+05, 0.997193950386116485E+05, 0.996948076057053986E+05, 0.996688019987970183E+05, 0.996412728663371527E+05, + 0.996128531282160839E+05, 0.995835822131826571E+05, 0.995535100083936413E+05, 0.995226963046177698E+05, 0.994912096890770918E+05, + 0.994591258685886423E+05, 0.994265254172218556E+05, 0.993934909557864739E+05, 0.993601037847762636E+05, 0.993264400074980804E+05, + 0.992925661955399555E+05, 0.992585346639741329E+05, 0.992243784382298763E+05, 0.991926785386021656E+05, 0.991631423960881948E+05, + 0.991346701590620942E+05, 0.991043957205902552E+05, 0.990738404866020282E+05, 0.990437385072277393E+05, 0.990142493709584378E+05, + 0.989855195191612147E+05, 0.989576810877346288E+05, 0.989308511084253696E+05, 0.989051310684979690E+05, 0.988806068206827622E+05, + 0.988573488291608082E+05, 0.988354127318868268E+05, 0.988148401948802202E+05, 0.987956600302788138E+05, 0.987778895469693816E+05, + 0.987615361004738952E+05, 0.987465988074585912E+05, 0.987330703896907362E+05, 0.987209391124356771E+05, 0.987108234055703360E+05, + 0.987097019913824042E+05, 0.987103429529451387E+05, 0.987122111650228762E+05, 0.987153073516145814E+05, 0.987196321217762743E+05, + 0.987251875827369804E+05, 0.987319785667343094E+05, 0.987400135082831985E+05, 0.987493050090511242E+05, 0.987598701271371101E+05, + 0.987717304264797713E+05, 0.987849118205066625E+05, 0.987994442421061685E+05, 0.100725315299336173E+06, 0.100698574995327697E+06, + 0.100671977068823689E+06, 0.100644595052366465E+06, 0.100616468093977863E+06, 0.100587642901921921E+06, 0.100558173361375360E+06, + 0.100528120104899528E+06, 0.100497550042423565E+06, 0.100466272904751735E+06, 0.100434015096099785E+06, 0.100401562459773442E+06, + 0.100368989820934105E+06, 0.100336376879503077E+06, 0.100303807689072302E+06, 0.100271370122519947E+06, 0.100239155324566673E+06, + 0.100207257151323618E+06, 0.100175771596705425E+06, 0.100144796205413048E+06, 0.100114429472040734E+06, 0.100088940515445298E+06, + 0.100064277849083956E+06, 0.100040376776062651E+06, 0.100017243413296688E+06, 0.999948816446533019E+05, 0.999732929686431889E+05, + 0.999524763863759727E+05, 0.999324283249947912E+05, 0.999131425911760016E+05, 0.998946103486297798E+05, 0.998768201128693472E+05, + 0.998597577558295598E+05, 0.998434065122163738E+05, 0.998277469787591108E+05, 0.998127570968272776E+05, 0.997984121081719059E+05, + 0.997846844728672440E+05, 0.997711641937448148E+05, 0.997562547182444541E+05, 0.997418715469619347E+05, 0.997280378138771339E+05, + 0.997149197421024874E+05, 0.997024870178837737E+05, 0.996907061322415975E+05, 0.996795848806745926E+05, 0.996691347733205621E+05, + 0.996593714260480774E+05, 0.996503148183509184E+05, 0.996419894088608416E+05, 0.996344241017298482E+05, 0.996276520598402276E+05, + 0.996217103637612599E+05, 0.996166395185360743E+05, 0.996124828137155564E+05, 0.996092855454927922E+05, 0.996072490608482622E+05, + 0.996076113749229989E+05, 0.996091697144805221E+05, 0.996119324075692421E+05, 0.996159015340781625E+05, 0.996210724174448842E+05, + 0.996274331797853811E+05, 0.996349643746027868E+05, 0.996436387104583700E+05, 0.996534208777727908E+05, 0.996642674892599607E+05, + 0.996761271423777071E+05, 0.996889406096304010E+05, 0.997026411596077960E+05, 0.997171550083373149E+05, 0.997324018969322351E+05, + 0.997493713951271493E+05, 0.997669298086039198E+05, 0.997847561118552549E+05, 0.998027246306509041E+05, 0.998207116516734968E+05, + 0.998385964503245486E+05, 0.998562622533936083E+05, 0.998740649961419404E+05, 0.998916906165886030E+05, 0.999087089343172702E+05, + 0.999249770553750277E+05, 0.999403560696216737E+05, 0.999547111717594089E+05, 0.999679116588610341E+05, 0.999798308071318752E+05, + 0.999903456338236865E+05, 0.999993365533926699E+05, 0.100004220125714884E+06, 0.100007207317976179E+06, 0.100008572293640507E+06, + 0.100008322094038289E+06, 0.100006474067698131E+06, 0.100003053654514384E+06, 0.999980922203631635E+05, 0.999916249686873634E+05, + 0.999836889524048456E+05, 0.999743212064066029E+05, 0.999635570180646901E+05, 0.999514283507113723E+05, 0.999379624331032392E+05, + 0.999231805265346338E+05, 0.999068710521996836E+05, 0.998889830637409177E+05, 0.998698844492443604E+05, 0.998496268247692351E+05, + 0.998282550606056902E+05, 0.998058081407207792E+05, 0.997823201056188700E+05, 0.997578210428315797E+05, 0.997323380908236431E+05, + 0.997058964236216998E+05, 0.996785201849737350E+05, 0.996502333423933014E+05, 0.996210604331023060E+05, 0.995910271757503942E+05, + 0.995601609239409008E+05, 0.995275572850741737E+05, 0.994942010526460217E+05, 0.994602086162104097E+05, 0.994256424562004540E+05, + 0.993905674250224547E+05, 0.993550495610398939E+05, 0.993191545857771562E+05, 0.992829460972773086E+05, 0.992464834802344849E+05, + 0.992093627746182028E+05, 0.991704192318807618E+05, 0.991313574404489191E+05, 0.990923405318182195E+05, 0.990535358095906413E+05, + 0.990151121756168286E+05, 0.989772373919561505E+05, 0.989400752255912812E+05, 0.989077617710938066E+05, 0.988763612273478793E+05, + 0.988459508623079601E+05, 0.988166439660097676E+05, 0.987885464355162840E+05, 0.987617561295779306E+05, 0.987363624383705755E+05, + 0.987124460655073344E+05, 0.986900790161369223E+05, 0.986693247818405216E+05, 0.986502387102765642E+05, 0.986328685451310157E+05, + 0.986172551199377485E+05, 0.986034331877511868E+05, 0.985914323674813641E+05, 0.985849022212989948E+05, 0.985815381689221977E+05, + 0.985799833097597439E+05, 0.985801745721993211E+05, 0.985820463347552868E+05, 0.985855324877461535E+05, 0.985905682465279388E+05, + 0.985970917144189152E+05, 0.986050451971537113E+05, 0.986143762739106751E+05, 0.986250386326789885E+05, 0.986369926800004905E+05, + 0.986502059369656636E+05, 0.986646532347960892E+05, 0.986803686823803437E+05, 0.986978893846687570E+05, 0.100614832696455240E+06, + 0.100593867821148029E+06, 0.100572316446986515E+06, 0.100550197550235505E+06, 0.100527535703133908E+06, 0.100504360904461792E+06, + 0.100480708372667563E+06, 0.100456618304392017E+06, 0.100432135601374786E+06, 0.100407309568833982E+06, 0.100382193588466369E+06, + 0.100356844769226343E+06, 0.100331323579001226E+06, 0.100305693460217895E+06, 0.100280020432285120E+06, 0.100254372683605921E+06, + 0.100228820155686772E+06, 0.100203434121630358E+06, 0.100178286761032883E+06, 0.100153450733022924E+06, 0.100130475669895299E+06, + 0.100109956889046269E+06, 0.100089889070985242E+06, 0.100070296914338702E+06, 0.100051202164876013E+06, 0.100032623579079911E+06, + 0.100014576934231576E+06, 0.999970750815462088E+05, 0.999801280379814852E+05, 0.999637431114950741E+05, 0.999479250537698827E+05, + 0.999326762337752152E+05, 0.999179968250171223E+05, 0.999038849989644077E+05, 0.998903371169458405E+05, 0.998773479128125327E+05, + 0.998649106588674185E+05, 0.998530173079915839E+05, 0.998416586055586959E+05, 0.998308241656294995E+05, 0.998183931314519723E+05, + 0.998063026544255990E+05, 0.997946768033270637E+05, 0.997835353574148758E+05, 0.997728988116216497E+05, 0.997627886474906263E+05, + 0.997532275467060972E+05, 0.997442395412217011E+05, 0.997358500950898597E+05, 0.997280861143391958E+05, 0.997209758826208854E+05, + 0.997145489218259900E+05, 0.997088357784521941E+05, 0.997038677381365414E+05, 0.996996764724488748E+05, 0.996962936237215035E+05, + 0.996937503353465436E+05, 0.996920767365576030E+05, 0.996913013921977254E+05, 0.996914507293131610E+05, 0.996938892044791864E+05, + 0.996979235599974199E+05, 0.997029058021154924E+05, 0.997088141832942201E+05, 0.997156214047231770E+05, 0.997232945456081070E+05, + 0.997317950535919081E+05, 0.997416867970129533E+05, 0.997530959050235106E+05, 0.997652059203542885E+05, 0.997779192013086576E+05, + 0.997911354948921798E+05, 0.998047524629107502E+05, 0.998186662279794255E+05, 0.998327719289349043E+05, 0.998469642740837880E+05, + 0.998611380798811879E+05, 0.998751887820599950E+05, 0.998890129059611209E+05, 0.999025084828911640E+05, 0.999155753997843713E+05, + 0.999281156702924636E+05, 0.999400336166881025E+05, 0.999512359536410950E+05, 0.999616317670096760E+05, 0.999711323832548660E+05, + 0.999796511279028782E+05, 0.999849269357346784E+05, 0.999879656837563089E+05, 0.999896251175745128E+05, 0.999900253003605030E+05, + 0.999893361854775139E+05, 0.999873542140159407E+05, 0.999840556297011499E+05, 0.999794245840091753E+05, 0.999734518744631496E+05, + 0.999661337157758971E+05, 0.999574705623641785E+05, 0.999474659997932467E+05, 0.999361257217314414E+05, 0.999234566080410732E+05, + 0.999094659187412326E+05, 0.998941606177814683E+05, 0.998764809352623415E+05, 0.998560560817922524E+05, 0.998343967946635821E+05, + 0.998115510889874568E+05, 0.997875653304692096E+05, 0.997624843255732849E+05, 0.997363514996802405E+05, 0.997092091386610118E+05, + 0.996810986700549984E+05, 0.996520609610099054E+05, 0.996221366113048280E+05, 0.995913662211383053E+05, 0.995597906149207993E+05, + 0.995273916799414146E+05, 0.994941482859833632E+05, 0.994601365478679945E+05, 0.994253058448178053E+05, 0.993891469979643734E+05, + 0.993522589965478983E+05, 0.993147135957212886E+05, 0.992765913082987827E+05, 0.992379812368316198E+05, 0.991989807125657680E+05, + 0.991596947441791563E+05, 0.991202352822574612E+05, 0.990807203086648369E+05, 0.990412727632243623E+05, 0.990020193233719183E+05, + 0.989630890556004597E+05, 0.989246119604841224E+05, 0.988867174357804033E+05, 0.988495326844704396E+05, 0.988131810965392942E+05, + 0.987777806347563455E+05, 0.987434422556348145E+05, 0.987102683970903163E+05, 0.986800386904530314E+05, 0.986539370199152036E+05, + 0.986295226205249346E+05, 0.986068636404624995E+05, 0.985860239517589507E+05, 0.985670631337701197E+05, 0.985500365691113984E+05, + 0.985358556718200416E+05, 0.985278808654735767E+05, 0.985216145256253949E+05, 0.985170549437755544E+05, 0.985141907191163773E+05, + 0.985130023621957516E+05, 0.985134638334888878E+05, 0.985155439987927239E+05, 0.985192079865073320E+05, 0.985244184348827694E+05, + 0.985311366201568162E+05, 0.985393234591571963E+05, 0.985489403823850007E+05, 0.985599500758101349E+05, 0.985723170916025701E+05, + 0.985860083297847013E+05, 0.986009933943283249E+05, 0.986172448285415594E+05, 0.986347382357068564E+05, 0.986534522918489238E+05, + 0.100501068864754794E+06, 0.100484535396120875E+06, 0.100467601980879481E+06, 0.100450280398188552E+06, 0.100432586236747622E+06, + 0.100414538813697291E+06, 0.100396161067221547E+06, 0.100377479424244724E+06, 0.100358523644725865E+06, 0.100339326644139262E+06, + 0.100319924295798162E+06, 0.100300355214719486E+06, 0.100280660524754756E+06, 0.100260883610713514E+06, 0.100241069857193317E+06, + 0.100221266375801104E+06, 0.100201521722408346E+06, 0.100181885606032156E+06, 0.100162408590875246E+06, 0.100143141793000657E+06, + 0.100126731204709198E+06, 0.100111095964644017E+06, 0.100095755686584438E+06, 0.100080729264227775E+06, 0.100066034373636823E+06, + 0.100051687390123538E+06, 0.100037703324969872E+06, 0.100024095780550211E+06, 0.100010876922054129E+06, 0.999980574636844394E+05, + 0.999856466669404908E+05, 0.999736523483940109E+05, 0.999620808942374570E+05, 0.999509372788386972E+05, 0.999402250845782837E+05, + 0.999299465203828877E+05, 0.999201024366045604E+05, 0.999106923342315858E+05, 0.999017143668564822E+05, 0.998931653343625367E+05, + 0.998850406679233711E+05, 0.998765024783978733E+05, 0.998667989571770595E+05, 0.998574263414941233E+05, 0.998484104846885893E+05, + 0.998397772139483568E+05, 0.998315523922983994E+05, 0.998237619509676297E+05, 0.998164318901620281E+05, 0.998095882469221542E+05, + 0.998032570294378238E+05, 0.997974641179290484E+05, 0.997922351329589583E+05, 0.997875952728177945E+05, 0.997835691223818721E+05, + 0.997801804366022552E+05, 0.997774519024890033E+05, 0.997754048841174226E+05, 0.997740591557720181E+05, 0.997734326288465818E+05, + 0.997735410785172280E+05, 0.997747073495277582E+05, 0.997769755457649590E+05, 0.997800038461367949E+05, 0.997839110555756342E+05, + 0.997903666077980015E+05, 0.997975557260811329E+05, 0.998054075409305369E+05, 0.998138481350147340E+05, 0.998228007968337915E+05, + 0.998321862933507946E+05, 0.998419231581400672E+05, 0.998519279910743644E+05, 0.998621157651026879E+05, 0.998724001352771593E+05, + 0.998826937448957033E+05, 0.998929085234460072E+05, 0.999029559709882014E+05, 0.999127474237070273E+05, 0.999221942956127314E+05, + 0.999312082917789958E+05, 0.999397015890797338E+05, 0.999475869811254670E+05, 0.999547779849950166E+05, 0.999611889084034483E+05, + 0.999655508333875332E+05, 0.999687521058104176E+05, 0.999708756209590647E+05, 0.999718892905484245E+05, 0.999717672485314106E+05, + 0.999704891389138356E+05, 0.999680393573227484E+05, 0.999644062616458687E+05, 0.999595813666838658E+05, 0.999535585371076886E+05, + 0.999463331921408535E+05, 0.999379015343325445E+05, 0.999282598136142769E+05, 0.999174036365871580E+05, 0.999053273297332198E+05, + 0.998920233640268561E+05, 0.998774818472951010E+05, 0.998616900896773586E+05, 0.998432094200693391E+05, 0.998215258930813725E+05, + 0.997986442532860819E+05, 0.997746159978670912E+05, 0.997494898657428857E+05, 0.997233122677003994E+05, 0.996961277569055965E+05, + 0.996679795269207534E+05, 0.996389099249155406E+05, 0.996089609684258903E+05, 0.995781748547828611E+05, 0.995465944531801651E+05, + 0.995142637702681968E+05, 0.994812283811399975E+05, 0.994475358185973892E+05, 0.994132359146495874E+05, 0.993783810892878100E+05, + 0.993430265826917603E+05, 0.993072306281462952E+05, 0.992699361805924273E+05, 0.992322369590151648E+05, 0.991942880496349680E+05, + 0.991561790488717525E+05, 0.991180035697510175E+05, 0.990798588542613288E+05, 0.990418452912010980E+05, 0.990040658471643255E+05, + 0.989666254199359537E+05, 0.989296301250896213E+05, 0.988931865279689664E+05, 0.988574008344593603E+05, 0.988223780549877847E+05, + 0.987882211569994834E+05, 0.987550302217251592E+05, 0.987229016213559953E+05, 0.986919272327695508E+05, 0.986621937036891904E+05, + 0.986337817866148835E+05, 0.986067657550310105E+05, 0.985855251179539773E+05, 0.985675277620845591E+05, 0.985515831726142933E+05, + 0.985391751050558669E+05, 0.985310659201639937E+05, 0.985245080408891663E+05, 0.985195088048070465E+05, 0.985160685473306512E+05, + 0.985141813574870466E+05, 0.985138358391387155E+05, 0.985150158641151211E+05, 0.985177013051926042E+05, 0.985218687383599317E+05, + 0.985274921053063881E+05, 0.985345433285448526E+05, 0.985429928730166866E+05, 0.985528102493964543E+05, 0.985639644556170097E+05, + 0.985764243543491611E+05, 0.985901589852987236E+05, 0.986051378122090100E+05, 0.986213309053895937E+05, 0.986387090614195185E+05, + 0.986574141307979880E+05 }; -#define NLON 81 +#define NLON 81 #define NLAT 166 -int main (int argc, char * argv[]) +int main(int argc, char* argv[]) { size_t len, slen; - grib_handle * h; - const char * packingType[2] = {"grid_second_order", "grid_complex_spatial_differencing"}; + grib_handle* h; + const char* packingType[2] = { "grid_second_order", "grid_complex_spatial_differencing" }; int ipackingType; const double zmiss = 9999999999.; long numberOfValues, numberOfDataPoints; int i, numberOfMissing; for (ipackingType = 0; ipackingType < 2; ipackingType++) { - GRIB_CHECK (((h = grib_handle_new_from_samples (NULL, "regular_ll_pl_grib2")) == NULL), 0); - GRIB_CHECK (grib_set_long (h, "Ni", NLON), 0); - GRIB_CHECK (grib_set_long (h, "Nj", NLAT), 0); - GRIB_CHECK (grib_set_double (h, "latitudeOfFirstGridPointInDegrees", 80.), 0); - GRIB_CHECK (grib_set_double (h, "longitudeOfFirstGridPointInDegrees", -100.), 0); - GRIB_CHECK (grib_set_double (h, "latitudeOfLastGridPointInDegrees", 0.) , 0); - GRIB_CHECK (grib_set_double (h, "longitudeOfLastGridPointInDegrees", 65.), 0); - GRIB_CHECK (grib_set_long (h, "iScansNegatively", 0), 0); - GRIB_CHECK (grib_set_long (h, "jScansPositively", 0), 0); - GRIB_CHECK (grib_set_long (h, "NV", 0), 0); - slen = strlen ("sfc"); - GRIB_CHECK (grib_set_string (h, "typeOfFirstFixedSurface", "sfc", &slen), 0); + GRIB_CHECK(((h = grib_handle_new_from_samples(NULL, "regular_ll_pl_grib2")) == NULL), 0); + GRIB_CHECK(grib_set_long(h, "Ni", NLON), 0); + GRIB_CHECK(grib_set_long(h, "Nj", NLAT), 0); + GRIB_CHECK(grib_set_double(h, "latitudeOfFirstGridPointInDegrees", 80.), 0); + GRIB_CHECK(grib_set_double(h, "longitudeOfFirstGridPointInDegrees", -100.), 0); + GRIB_CHECK(grib_set_double(h, "latitudeOfLastGridPointInDegrees", 0.), 0); + GRIB_CHECK(grib_set_double(h, "longitudeOfLastGridPointInDegrees", 65.), 0); + GRIB_CHECK(grib_set_long(h, "iScansNegatively", 0), 0); + GRIB_CHECK(grib_set_long(h, "jScansPositively", 0), 0); + GRIB_CHECK(grib_set_long(h, "NV", 0), 0); + slen = strlen("sfc"); + GRIB_CHECK(grib_set_string(h, "typeOfFirstFixedSurface", "sfc", &slen), 0); - GRIB_CHECK (grib_set_long (h, "bitsPerValue", 16), 0); - slen = strlen (packingType[ipackingType]); - GRIB_CHECK (grib_set_string (h, "packingType", packingType[ipackingType], &slen), 0); + GRIB_CHECK(grib_set_long(h, "bitsPerValue", 16), 0); + slen = strlen(packingType[ipackingType]); + GRIB_CHECK(grib_set_string(h, "packingType", packingType[ipackingType], &slen), 0); - GRIB_CHECK (grib_set_long (h, "bitmapPresent", 1), 0); - GRIB_CHECK (grib_set_double (h, "missingValue", zmiss), 0); + GRIB_CHECK(grib_set_long(h, "bitmapPresent", 1), 0); + GRIB_CHECK(grib_set_double(h, "missingValue", zmiss), 0); for (i = 0, numberOfMissing = 0; i < NLON * NLAT; i += 100, numberOfMissing++) { values[i] = zmiss; } len = NLON * NLAT; - GRIB_CHECK (grib_set_double_array (h, "values", values, len), 0); + GRIB_CHECK(grib_set_double_array(h, "values", values, len), 0); - GRIB_CHECK (grib_get_long (h, "numberOfValues", &numberOfValues), 0); - GRIB_CHECK (grib_get_long (h, "numberOfDataPoints", &numberOfDataPoints), 0); + GRIB_CHECK(grib_get_long(h, "numberOfValues", &numberOfValues), 0); + GRIB_CHECK(grib_get_long(h, "numberOfDataPoints", &numberOfDataPoints), 0); if (numberOfValues + numberOfMissing != numberOfDataPoints) { - printf (" numberOfValues = %ld, numberOfDataPoints = %ld, numberOfMissing = %d\n", numberOfValues, numberOfDataPoints, numberOfMissing); - printf (" numberOfValues appears to be incorrect\n"); + printf(" numberOfValues = %ld, numberOfDataPoints = %ld, numberOfMissing = %d\n", numberOfValues, numberOfDataPoints, numberOfMissing); + printf(" numberOfValues appears to be incorrect\n"); return 1; } - GRIB_CHECK (grib_handle_delete (h), 0); + GRIB_CHECK(grib_handle_delete(h), 0); } printf("ALL OK\n"); diff --git a/tests/grib_ccsds_perf.c b/tests/grib_ccsds_perf.c index d8f5c1a53..e3c2c235f 100644 --- a/tests/grib_ccsds_perf.c +++ b/tests/grib_ccsds_perf.c @@ -12,235 +12,266 @@ #if GRIB_TIMER -void usage(char* prog) { - printf("usage: %s [-a outfile | -w outfile ] grib_file repetitions bitsPerValue\n",prog); - exit(1); -} - -size_t grib_handle_write(grib_handle* h,char* filename) { - FILE* of=NULL; - const void *buffer; size_t size; - - of = fopen(filename,"wb"); - if(!of) { - perror(filename); - exit(1); - } - GRIB_CHECK(grib_get_message(h,&buffer,&size),0); - if(fwrite(buffer,1,size,of) != size) { - perror(filename); +void usage(char* prog) +{ + printf("usage: %s [-a outfile | -w outfile ] grib_file repetitions bitsPerValue\n", prog); exit(1); - } - fclose(of); - - return size; +} +size_t grib_handle_write(grib_handle* h, char* filename) +{ + FILE* of = NULL; + const void* buffer; + size_t size; + + of = fopen(filename, "wb"); + if (!of) { + perror(filename); + exit(1); + } + GRIB_CHECK(grib_get_message(h, &buffer, &size), 0); + if (fwrite(buffer, 1, size, of) != size) { + perror(filename); + exit(1); + } + fclose(of); + + return size; } -static void print_timer(grib_timer* t,int repeat) { - printf("%s : %g cpu\n",t->name_,t->timer_/repeat); +static void print_timer(grib_timer* t, int repeat) +{ + printf("%s : %g cpu\n", t->name_, t->timer_ / repeat); } -int main(int argc, char* argv[]) { - grib_handle *h=NULL; - grib_context* c=NULL; - FILE* fin=NULL; - FILE* fout=NULL; - char* finname; - char* ofilename; - char defofilename[]="grib_ccsds_perf.out"; - double *values=NULL; - int append=0; - size_t nvalues=0; - int count,e=0; - int repeatccsds=1; - int repeatsimple=1; - grib_timer *tes,*tds,*tej,*tdj; - char grid_ccsds[]="grid_ccsds"; - size_t grid_ccsds_l=strlen(grid_ccsds); - char grid_simple[]="grid_simple"; - size_t grid_simple_l=strlen(grid_simple); - char packingType[50]={0,}; - size_t len=50; - char param[50]={0,}; - char gridType[50]={0,}; - char outfilename[255]={0,}; - size_t filesize_ccsds=0; - size_t filesize_simple=0; - double perc=0; - long bitsPerValue=0; - int iarg=1; - char grid[40]={0,}; - char shortName[20]={0,}; - long level; - char levelType[20]={0,}; - - tes=grib_get_timer(0,"encoding simple", 0, 0); - tds=grib_get_timer(0,"decoding simple", 0, 0); - tej=grib_get_timer(0,"encoding ccsds", 0, 0); - tdj=grib_get_timer(0,"decoding ccsds", 0, 0); - - if (argc != 4 && argc != 6 ) usage(argv[0]); - if (!strcmp(argv[iarg],"-w")) { - append=0; - iarg++; - ofilename=argv[iarg]; - iarg++; - } else if (!strcmp(argv[iarg],"-a")) { - append=1; - iarg++; - ofilename=argv[iarg]; - iarg++; - } else { - append=0; - ofilename=defofilename; - } - finname=argv[iarg++]; - repeatsimple=atoi(argv[iarg++]); - bitsPerValue=atoi(argv[iarg++]); - - fin = fopen(finname,"rb"); - if(!fin) {perror(finname);exit(1);} - - if (append) - fout = fopen(ofilename,"ab"); - else - fout = fopen(ofilename,"wb"); - - if(!fout) {perror(ofilename);exit(1);} - - c=grib_context_get_default(); - e=0; - h=grib_handle_new_from_file(c,fin,&e); - fclose(fin); - - GRIB_CHECK(e,0); - - len=50; - grib_get_string(h,"shortName",param,&len); - - len=20; - grib_get_string(h,"levelType",levelType,&len); - - if (!strcmp(levelType,"pl")) { - GRIB_CHECK(grib_get_long(h,"level",&level),0); - sprintf(shortName,"%s%ld",param,level); - } else { - sprintf(shortName,"%s",param); - } - - - grib_set_long(h,"editionNumber",2); - GRIB_CHECK(grib_get_size(h,"values",&nvalues),0); - values=(double*)grib_context_malloc(c,sizeof(double)*nvalues); - if (!values) { printf("%s: memory allocation error\n",argv[0]); exit(1); } - - len=50; - grib_get_string(h,"gridType",gridType,&len); - - len=50; - grib_get_string(h,"packingType",packingType,&len); - - GRIB_CHECK(grib_get_double_array(h,"values",values,&nvalues),0); - grib_set_long(h,"bitsPerValue",bitsPerValue); - GRIB_CHECK(grib_set_double_array(h,"values",values,nvalues),0); - - printf("--------------------------------\n"); - printf("- %s - gridType=%s packingType=%s numberOfValues=%ld bitsPerValue=%ld\n", - param,gridType,packingType,(long)nvalues,bitsPerValue); - - if (!strcmp(packingType,"spectral_complex") || !strcmp(packingType,"spectral_simple")) { - printf("unable to process spectral data\n"); - exit(1); - } - - if (!strcmp(gridType,"reduced_gg") || !strcmp(gridType,"regular_gg")) { - long N; - grib_get_long(h,"N",&N); - printf(" N=%ld\n",N); - sprintf(grid,"%ld",N); - } - if (!strcmp(gridType,"regular_ll")) { - double Di,Dj; - grib_get_double(h,"DiInDegrees",&Di); - grib_get_double(h,"DjInDegrees",&Dj); - printf(" Di=%g Dj=%g\n",Di,Dj); - sprintf(grid,"%g/%g",Di,Dj); - } - - - if (!append) - fprintf(fout, - "shortName gridType numberOfValues bitsPerValue grid sizeSimple sizeccsds encodeccsds encodeSimple decodeccsds decodeSimple\n"); - - /* decode values grid_simple */ - if (strcmp(packingType,grid_simple)) - grib_set_string(h,"packingType",grid_simple,&grid_simple_l); - /* printf("decoding simple\n"); */ - grib_timer_start(tds); - for (count=0;counttimer_/repeatccsds,tes->timer_/repeatsimple,tdj->timer_/repeatccsds,tds->timer_/repeatsimple); - - return 0; +int main(int argc, char* argv[]) +{ + grib_handle* h = NULL; + grib_context* c = NULL; + FILE* fin = NULL; + FILE* fout = NULL; + char* finname; + char* ofilename; + char defofilename[] = "grib_ccsds_perf.out"; + double* values = NULL; + int append = 0; + size_t nvalues = 0; + int count, e = 0; + int repeatccsds = 1; + int repeatsimple = 1; + grib_timer *tes, *tds, *tej, *tdj; + char grid_ccsds[] = "grid_ccsds"; + size_t grid_ccsds_l = strlen(grid_ccsds); + char grid_simple[] = "grid_simple"; + size_t grid_simple_l = strlen(grid_simple); + char packingType[50] = { + 0, + }; + size_t len = 50; + char param[50] = { + 0, + }; + char gridType[50] = { + 0, + }; + char outfilename[255] = { + 0, + }; + size_t filesize_ccsds = 0; + size_t filesize_simple = 0; + double perc = 0; + long bitsPerValue = 0; + int iarg = 1; + char grid[40] = { + 0, + }; + char shortName[20] = { + 0, + }; + long level; + char levelType[20] = { + 0, + }; + + tes = grib_get_timer(0, "encoding simple", 0, 0); + tds = grib_get_timer(0, "decoding simple", 0, 0); + tej = grib_get_timer(0, "encoding ccsds", 0, 0); + tdj = grib_get_timer(0, "decoding ccsds", 0, 0); + + if (argc != 4 && argc != 6) usage(argv[0]); + if (!strcmp(argv[iarg], "-w")) { + append = 0; + iarg++; + ofilename = argv[iarg]; + iarg++; + } + else if (!strcmp(argv[iarg], "-a")) { + append = 1; + iarg++; + ofilename = argv[iarg]; + iarg++; + } + else { + append = 0; + ofilename = defofilename; + } + finname = argv[iarg++]; + repeatsimple = atoi(argv[iarg++]); + bitsPerValue = atoi(argv[iarg++]); + + fin = fopen(finname, "rb"); + if (!fin) { + perror(finname); + exit(1); + } + + if (append) + fout = fopen(ofilename, "ab"); + else + fout = fopen(ofilename, "wb"); + + if (!fout) { + perror(ofilename); + exit(1); + } + + c = grib_context_get_default(); + e = 0; + h = grib_handle_new_from_file(c, fin, &e); + fclose(fin); + + GRIB_CHECK(e, 0); + + len = 50; + grib_get_string(h, "shortName", param, &len); + + len = 20; + grib_get_string(h, "levelType", levelType, &len); + + if (!strcmp(levelType, "pl")) { + GRIB_CHECK(grib_get_long(h, "level", &level), 0); + sprintf(shortName, "%s%ld", param, level); + } + else { + sprintf(shortName, "%s", param); + } + + + grib_set_long(h, "editionNumber", 2); + GRIB_CHECK(grib_get_size(h, "values", &nvalues), 0); + values = (double*)grib_context_malloc(c, sizeof(double) * nvalues); + if (!values) { + printf("%s: memory allocation error\n", argv[0]); + exit(1); + } + + len = 50; + grib_get_string(h, "gridType", gridType, &len); + + len = 50; + grib_get_string(h, "packingType", packingType, &len); + + GRIB_CHECK(grib_get_double_array(h, "values", values, &nvalues), 0); + grib_set_long(h, "bitsPerValue", bitsPerValue); + GRIB_CHECK(grib_set_double_array(h, "values", values, nvalues), 0); + + printf("--------------------------------\n"); + printf("- %s - gridType=%s packingType=%s numberOfValues=%ld bitsPerValue=%ld\n", + param, gridType, packingType, (long)nvalues, bitsPerValue); + + if (!strcmp(packingType, "spectral_complex") || !strcmp(packingType, "spectral_simple")) { + printf("unable to process spectral data\n"); + exit(1); + } + + if (!strcmp(gridType, "reduced_gg") || !strcmp(gridType, "regular_gg")) { + long N; + grib_get_long(h, "N", &N); + printf(" N=%ld\n", N); + sprintf(grid, "%ld", N); + } + if (!strcmp(gridType, "regular_ll")) { + double Di, Dj; + grib_get_double(h, "DiInDegrees", &Di); + grib_get_double(h, "DjInDegrees", &Dj); + printf(" Di=%g Dj=%g\n", Di, Dj); + sprintf(grid, "%g/%g", Di, Dj); + } + + + if (!append) + fprintf(fout, + "shortName gridType numberOfValues bitsPerValue grid sizeSimple sizeccsds encodeccsds encodeSimple decodeccsds decodeSimple\n"); + + /* decode values grid_simple */ + if (strcmp(packingType, grid_simple)) + grib_set_string(h, "packingType", grid_simple, &grid_simple_l); + /* printf("decoding simple\n"); */ + grib_timer_start(tds); + for (count = 0; count < repeatsimple; count++) + GRIB_CHECK(grib_get_double_array(h, "values", values, &nvalues), 0); + grib_timer_stop(tds, 0); + /* printf("%d messages decoded\n\n",count); */ + + *outfilename = '\0'; + sprintf(outfilename, "%s_%s_%ld_simple.grib2", param, gridType, bitsPerValue); + filesize_simple = grib_handle_write(h, outfilename); + printf("file size simple = %ld\n", (long)filesize_simple); + + /* encode values grid_simple*/ + /* printf("encoding simple\n"); */ + grib_timer_start(tes); + for (count = 0; count < repeatsimple; count++) + GRIB_CHECK(grib_set_double_array(h, "values", values, nvalues), 0); + grib_timer_stop(tes, 0); + /* printf("%d messages encoded \n\n",count); */ + + /* decode values grid_ccsds */ + grib_set_string(h, "packingType", grid_ccsds, &grid_ccsds_l); + /* printf("decoding ccsds\n"); */ + grib_timer_start(tdj); + for (count = 0; count < repeatccsds; count++) + GRIB_CHECK(grib_get_double_array(h, "values", values, &nvalues), 0); + grib_timer_stop(tdj, 0); + /* printf("%d messages decoded\n\n",count); */ + + *outfilename = '\0'; + sprintf(outfilename, "%s_%s_%ld_ccsds.grib2", param, gridType, bitsPerValue); + filesize_ccsds = grib_handle_write(h, outfilename); + printf("file size ccsds = %ld\n", (long)filesize_ccsds); + + perc = (double)filesize_simple / (double)filesize_ccsds; + + printf("compression ratio = %g \n", perc); + printf("space savings = %g \n", (1.0 - 1.0 / perc) * 100); + + /* encode values grid_ccsds*/ + /* printf("encoding ccsds\n"); */ + grib_timer_start(tej); + for (count = 0; count < repeatccsds; count++) + GRIB_CHECK(grib_set_double_array(h, "values", values, nvalues), 0); + grib_timer_stop(tej, 0); + /* printf("%d messages encoded \n\n",count); */ + + grib_handle_delete(h); + grib_context_free(c, values); + + print_timer(tej, repeatccsds); + print_timer(tdj, repeatccsds); + print_timer(tes, repeatsimple); + print_timer(tds, repeatsimple); + printf("--------------------------------\n\n"); + fprintf(fout, "%s %s %ld %ld %s %ld %ld %g %g %g %g\n", + shortName, gridType, (long)nvalues, bitsPerValue, + grid, (long)filesize_simple, (long)filesize_ccsds, tej->timer_ / repeatccsds, tes->timer_ / repeatsimple, tdj->timer_ / repeatccsds, tds->timer_ / repeatsimple); + + return 0; } #else -int main(int argc,char* argv[]) { -return 0; +int main(int argc, char* argv[]) +{ + return 0; } #endif diff --git a/tests/grib_double_cmp.c b/tests/grib_double_cmp.c index 367ba67f0..2f943f1a6 100644 --- a/tests/grib_double_cmp.c +++ b/tests/grib_double_cmp.c @@ -17,50 +17,51 @@ */ #include "grib_api.h" -static void usage(const char* prog) { - printf("usage: %s filename\n",prog); +static void usage(const char* prog) +{ + printf("usage: %s filename\n", prog); exit(1); } int main(int argc, char** argv) { - int err = 0,i = 0; - double *values = NULL; - size_t values_len= 0; - double element_value=0; + int err = 0, i = 0; + double* values = NULL; + size_t values_len = 0; + double element_value = 0; - FILE* in = NULL; + FILE* in = NULL; char* filename = NULL; - grib_handle *h = NULL; + grib_handle* h = NULL; - if (argc<2) usage(argv[0]); - filename=argv[1]; + if (argc < 2) usage(argv[0]); + filename = argv[1]; - in = fopen(filename,"rb"); - if(!in) { - printf("ERROR: unable to open file %s\n",filename); + in = fopen(filename, "rb"); + if (!in) { + printf("ERROR: unable to open file %s\n", filename); return 1; } /* create new handle from a message in a file*/ - h = grib_handle_new_from_file(0,in,&err); + h = grib_handle_new_from_file(0, in, &err); if (h == NULL) { - printf("Error: unable to create handle from file %s\n",filename); + printf("Error: unable to create handle from file %s\n", filename); return 1; } /* get the size of the values array */ - GRIB_CHECK(grib_get_size(h,"values",&values_len),0); - values = (double*)malloc(values_len*sizeof(double)); + GRIB_CHECK(grib_get_size(h, "values", &values_len), 0); + values = (double*)malloc(values_len * sizeof(double)); /* get data values*/ - GRIB_CHECK(grib_get_double_array(h,"values",values,&values_len),0); + GRIB_CHECK(grib_get_double_array(h, "values", values, &values_len), 0); if (values_len < 100) exit(1); for (i = 0; i < 100; i++) { /* get a particular data value */ - GRIB_CHECK(grib_get_double_element(h, "values", i, &element_value),0); + GRIB_CHECK(grib_get_double_element(h, "values", i, &element_value), 0); if (element_value != values[i]) { exit(1); diff --git a/tests/grib_ecc-386.c b/tests/grib_ecc-386.c index 0bcb41513..d2b166866 100644 --- a/tests/grib_ecc-386.c +++ b/tests/grib_ecc-386.c @@ -15,51 +15,52 @@ #include #include "grib_api_internal.h" -static void usage(const char* prog) { - printf("usage: %s filename\n",prog); +static void usage(const char* prog) +{ + printf("usage: %s filename\n", prog); exit(1); } #ifdef GRIB_TIMER int main(int argc, char** argv) { - grib_timer *tes = grib_get_timer(0,"decoding", 0, 0); - FILE *in = NULL; + grib_timer* tes = grib_get_timer(0, "decoding", 0, 0); + FILE* in = NULL; int err = 0, i = 0; - grib_handle *h = NULL; - size_t values_len = 0; - double *values = NULL; - double duration_actual = 0; + grib_handle* h = NULL; + size_t values_len = 0; + double* values = NULL; + double duration_actual = 0; const double duration_max = 3; /* seconds */ const int num_repetitions = 1000; - if (argc<2) usage(argv[0]); + if (argc < 2) usage(argv[0]); - in = fopen(argv[1],"rb"); - if(!in) { - printf("ERROR: unable to open file %s\n",argv[1]); + in = fopen(argv[1], "rb"); + if (!in) { + printf("ERROR: unable to open file %s\n", argv[1]); return 1; } /* create new handle */ err = 0; - h = grib_handle_new_from_file(0,in,&err); + h = grib_handle_new_from_file(0, in, &err); if (h == NULL) { printf("Error: unable to create handle from file.\n"); return 1; } /* get the size of the values array*/ - GRIB_CHECK(grib_get_size(h,"values",&values_len),0); + GRIB_CHECK(grib_get_size(h, "values", &values_len), 0); - values = malloc(values_len*sizeof(double)); + values = malloc(values_len * sizeof(double)); /* get data values*/ grib_timer_start(tes); - for (i=0; i duration_max) { fprintf(stderr, "Decoding took longer than expected! actual time=%g, expected to take less than %g seconds", @@ -73,5 +74,8 @@ int main(int argc, char** argv) return 0; } #else -int main(int argc, char** argv) { return 0; } +int main(int argc, char** argv) +{ + return 0; +} #endif diff --git a/tests/grib_ecc-604-encode.c b/tests/grib_ecc-604-encode.c index c5280ddd1..3c1bc88c7 100644 --- a/tests/grib_ecc-604-encode.c +++ b/tests/grib_ecc-604-encode.c @@ -10,127 +10,137 @@ /* These are passed in via argv */ static size_t NUM_THREADS = 0; static size_t FILES_PER_ITERATION = 0; -static char* INPUT_FILE = NULL; -int opt_dump = 0; /* If 1 then dump handle to /dev/null */ -int opt_clone = 0; /* If 1 then clone source handle */ -int opt_write = 0; /* If 1 write handle to file */ +static char* INPUT_FILE = NULL; +int opt_dump = 0; /* If 1 then dump handle to /dev/null */ +int opt_clone = 0; /* If 1 then clone source handle */ +int opt_write = 0; /* If 1 write handle to file */ -static int encode_values(grib_handle* h, char *output_file) +static int encode_values(grib_handle* h, char* output_file) { - double *values; + double* values; const size_t DIM = 1000; - size_t size = DIM * DIM; - size_t i = 0; - values = (double*)malloc(size*sizeof(double)); - for (i=0; i7) { + if (argc < 5 || argc > 7) { fprintf(stderr, "Usage:\n\t%s [options] seq sample numRuns numIter\nOr\n\t%s [options] par sample numThreads numIter\n", prog, prog); return 1; } - - while ((c = getopt (argc, argv, "dcw")) != -1) { + + while ((c = getopt(argc, argv, "dcw")) != -1) { switch (c) { - case 'd': opt_dump=1; break; - case 'c': opt_clone=1; break; - case 'w': opt_write=1; break; + case 'd': + opt_dump = 1; + break; + case 'c': + opt_clone = 1; + break; + case 'w': + opt_write = 1; + break; } } - index = optind; - mode = argv[index]; - INPUT_FILE = argv[index+1]; /* Has to be the name of a sample file (without tmpl extension) */ - NUM_THREADS = atol(argv[index+2]); - FILES_PER_ITERATION = atol(argv[index+3]); + index = optind; + mode = argv[index]; + INPUT_FILE = argv[index + 1]; /* Has to be the name of a sample file (without tmpl extension) */ + NUM_THREADS = atol(argv[index + 2]); + FILES_PER_ITERATION = atol(argv[index + 3]); - if (strcmp(mode,"seq")==0) { + if (strcmp(mode, "seq") == 0) { parallel = 0; } if (parallel) { - printf("Running parallel in %ld threads. %ld iterations (prod=%ld)\n", NUM_THREADS, FILES_PER_ITERATION, NUM_THREADS*FILES_PER_ITERATION); + printf("Running parallel in %ld threads. %ld iterations (prod=%ld)\n", NUM_THREADS, FILES_PER_ITERATION, NUM_THREADS * FILES_PER_ITERATION); printf("Options: dump=%d, clone=%d, write=%d\n", opt_dump, opt_clone, opt_write); - } else { + } + else { printf("Running sequentially in %ld runs. %ld iterations\n", NUM_THREADS, FILES_PER_ITERATION); } { pthread_t* workers = malloc(NUM_THREADS * sizeof(pthread_t)); for (i = 0; i < NUM_THREADS; i++) { - struct v *data = (struct v *) malloc(sizeof(struct v)); - data->number = i; - data->data = NULL; + struct v* data = (struct v*)malloc(sizeof(struct v)); + data->number = i; + data->data = NULL; if (parallel) { /* Now we will create the thread passing it data as an argument */ pthread_create(&workers[thread_counter], NULL, runner, data); thread_counter++; - } else { + } + else { do_encode(data); } } if (parallel) { - for (i = 0; i < NUM_THREADS; i++) { + for (i = 0; i < NUM_THREADS; i++) { pthread_join(workers[i], NULL); } } - free (workers); + free(workers); } return 0; } -void *runner(void *ptr) +void* runner(void* ptr) { do_encode(ptr); pthread_exit(0); } -void do_encode(void *ptr) +void do_encode(void* ptr) { /* Cast argument to struct v pointer */ - struct v *data = ptr; + struct v* data = ptr; size_t i; char output_file[50]; time_t ltime; struct tm result; char stime[32]; - grib_handle *hs = NULL; + grib_handle* hs = NULL; hs = grib_handle_new_from_samples(0, INPUT_FILE); - for (i=0; inumber, i); - encode_values(h,output_file); - } else { - encode_values(h,NULL); + sprintf(output_file, "output/output_file_%ld-%ld.grib", data->number, i); + encode_values(h, output_file); + } + else { + encode_values(h, NULL); } grib_handle_delete(h); } diff --git a/tests/grib_ecc-604.c b/tests/grib_ecc-604.c index eb87441d2..7ff78b4b1 100644 --- a/tests/grib_ecc-604.c +++ b/tests/grib_ecc-604.c @@ -11,67 +11,70 @@ /* These are passed in via argv */ static size_t NUM_THREADS = 0; static size_t FILES_PER_ITERATION = 0; -static char* INPUT_FILE = NULL; -int opt_dump = 0; /* If 1 then dump handle to /dev/null */ -int opt_clone = 0; /* If 1 then clone source handle */ -int opt_write = 0; /* If 1 write handle to file */ +static char* INPUT_FILE = NULL; +int opt_dump = 0; /* If 1 then dump handle to /dev/null */ +int opt_clone = 0; /* If 1 then clone source handle */ +int opt_write = 0; /* If 1 write handle to file */ -static int encode_file(char *template_file, char *output_file) +static int encode_file(char* template_file, char* output_file) { - FILE *in, *out=NULL; - grib_handle *source_handle = NULL; - const void *buffer = NULL; - size_t size = 0; - int err = 0; - double *values; - - in = fopen(template_file,"rb"); assert(in); - if (opt_write) { - out = fopen(output_file,"wb"); assert(out); + FILE *in, *out = NULL; + grib_handle* source_handle = NULL; + const void* buffer = NULL; + size_t size = 0; + int err = 0; + double* values; + + in = fopen(template_file, "rb"); + assert(in); + if (opt_write && output_file) { + out = fopen(output_file, "wb"); + assert(out); } /* loop over the messages in the source GRIB and clone them */ - while ((source_handle = grib_handle_new_from_file(0, in, &err))!=NULL) { + while ((source_handle = grib_handle_new_from_file(0, in, &err)) != NULL) { int i; size_t values_len = 0; - size_t str_len = 20; - grib_handle *h = source_handle; - + size_t str_len = 20; + grib_handle* h = source_handle; + if (opt_clone) { - h = grib_handle_clone(source_handle); assert(h); + h = grib_handle_clone(source_handle); + assert(h); } - GRIB_CHECK(grib_get_size(h, "values", &values_len),0); + GRIB_CHECK(grib_get_size(h, "values", &values_len), 0); - values = (double*)malloc(values_len*sizeof(double)); - GRIB_CHECK(grib_get_double_array(h, "values", values, &values_len),0); + values = (double*)malloc(values_len * sizeof(double)); + GRIB_CHECK(grib_get_double_array(h, "values", values, &values_len), 0); - for (i=0;i8) { + if (argc < 5 || argc > 8) { fprintf(stderr, "Usage:\n\t%s [options] seq file numRuns numIter\nOr\n\t%s [options] par file numThreads numIter\n", prog, prog); return 1; } - - while ((c = getopt (argc, argv, "dcw")) != -1) { + + while ((c = getopt(argc, argv, "dcw")) != -1) { switch (c) { - case 'd': opt_dump=1; break; - case 'c': opt_clone=1; break; - case 'w': opt_write=1; break; + case 'd': + opt_dump = 1; + break; + case 'c': + opt_clone = 1; + break; + case 'w': + opt_write = 1; + break; } } - index = optind; - mode = argv[index]; - INPUT_FILE = argv[index+1]; - NUM_THREADS = atol(argv[index+2]); - FILES_PER_ITERATION = atol(argv[index+3]); + index = optind; + mode = argv[index]; + INPUT_FILE = argv[index + 1]; + NUM_THREADS = atol(argv[index + 2]); + FILES_PER_ITERATION = atol(argv[index + 3]); - if (strcmp(mode,"seq")==0) { + if (strcmp(mode, "seq") == 0) { parallel = 0; } if (parallel) { - printf("Running parallel in %ld threads. %ld iterations (prod=%ld)\n", NUM_THREADS, FILES_PER_ITERATION, NUM_THREADS*FILES_PER_ITERATION); + printf("Running parallel in %ld threads. %ld iterations (prod=%ld)\n", NUM_THREADS, FILES_PER_ITERATION, NUM_THREADS * FILES_PER_ITERATION); printf("Options: dump=%d, clone=%d, write=%d\n", opt_dump, opt_clone, opt_write); - } else { + } + else { printf("Running sequentially in %ld runs. %ld iterations\n", NUM_THREADS, FILES_PER_ITERATION); } { pthread_t* workers = malloc(NUM_THREADS * sizeof(pthread_t)); for (i = 0; i < NUM_THREADS; i++) { - struct v *data = (struct v *) malloc(sizeof(struct v)); - data->number = i; - data->data = NULL; + struct v* data = (struct v*)malloc(sizeof(struct v)); + data->number = i; + data->data = NULL; if (parallel) { /* Now we will create the thread passing it data as an argument */ pthread_create(&workers[thread_counter], NULL, runner, data); /*pthread_join(workers[thread_counter], NULL);*/ thread_counter++; - } else { + } + else { do_stuff(data); } } if (parallel) { - for (i = 0; i < NUM_THREADS; i++) { + for (i = 0; i < NUM_THREADS; i++) { pthread_join(workers[i], NULL); } } - free (workers); + free(workers); } return 0; } -void *runner(void *ptr) +void* runner(void* ptr) { do_stuff(ptr); pthread_exit(0); } -void do_stuff(void *ptr) +void do_stuff(void* ptr) { /* Cast argument to struct v pointer */ - struct v *data = ptr; + struct v* data = ptr; size_t i; char output_file[50]; time_t ltime; struct tm result; char stime[32]; - for (i=0; inumber, i); - encode_file(INPUT_FILE,output_file); - } else { - encode_file(INPUT_FILE,NULL); + sprintf(output_file, "output/output_file_%ld-%ld.grib", data->number, i); + encode_file(INPUT_FILE, output_file); + } + else { + encode_file(INPUT_FILE, NULL); } } diff --git a/tests/grib_ecc-604.sh b/tests/grib_ecc-604.sh index 94bcd5c3d..8b226f5bb 100755 --- a/tests/grib_ecc-604.sh +++ b/tests/grib_ecc-604.sh @@ -1,5 +1,5 @@ #!/bin/sh -# (C) Copyright 2005-2018 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_encode_pthreads.c b/tests/grib_encode_pthreads.c index c3c1234d5..0fe2460d6 100644 --- a/tests/grib_encode_pthreads.c +++ b/tests/grib_encode_pthreads.c @@ -18,17 +18,17 @@ #define FILES_PER_ITERATION 10 char* INPUT_FILE = NULL; -void do_stuff(void *data); +void do_stuff(void* data); -void *runner(void *ptr); /* the thread function */ +void* runner(void* ptr); /* the thread function */ -int main(int argc, char **argv) +int main(int argc, char** argv) { long i; int thread_counter = 0; pthread_t workers[NUM_THREADS]; INPUT_FILE = argv[1]; - + /* Create worker threads */ for (i = 0; i < NUM_THREADS; i++) { /* Now we will create the thread passing it data as a paramater*/ @@ -38,59 +38,61 @@ int main(int argc, char **argv) /* Waiting for threads to complete */ for (i = 0; i < NUM_THREADS; i++) { - pthread_join(workers[i], NULL); + pthread_join(workers[i], NULL); } return 0; } -void *runner(void *ptr) -{ +void* runner(void* ptr) +{ do_stuff(ptr); pthread_exit(0); } -static int encode_file(char *input_file, char *output_file) +static int encode_file(char* input_file, char* output_file) { - grib_handle *source_handle = NULL; - const void *buffer = NULL; - int err = 0; - - FILE* in = fopen(input_file,"rb"); - FILE* out = fopen(output_file,"wb"); + grib_handle* source_handle = NULL; + const void* buffer = NULL; + int err = 0; + + FILE* in = fopen(input_file, "rb"); + FILE* out = fopen(output_file, "wb"); assert(in); assert(out); - while ((source_handle = grib_handle_new_from_file(0, in, &err))!=NULL) - { - size_t size=0, values_len=0; + while ((source_handle = grib_handle_new_from_file(0, in, &err)) != NULL) { + size_t size = 0, values_len = 0; int i; - double *values = NULL; + double* values = NULL; long count; - double d,e; + double d, e; - grib_handle *clone_handle = grib_handle_clone(source_handle); + grib_handle* clone_handle = grib_handle_clone(source_handle); assert(clone_handle); - - GRIB_CHECK(grib_get_size(clone_handle, "values", &values_len),0); - values = (double*)malloc(values_len*sizeof(double)); - - d=10e-10; - e=d; - count=1; - for (i=0;i1000) {e*=2; count=1;} - values[i]=d; - d+=e; + + GRIB_CHECK(grib_get_size(clone_handle, "values", &values_len), 0); + values = (double*)malloc(values_len * sizeof(double)); + + d = 10e-10; + e = d; + count = 1; + for (i = 0; i < values_len; i++) { + if (count > 1000) { + e *= 2; + count = 1; + } + values[i] = d; + d += e; count++; } - GRIB_CHECK(grib_set_long(clone_handle,"bitsPerValue",16),0); - GRIB_CHECK(grib_set_double_array(clone_handle,"values",values,values_len),0); - + GRIB_CHECK(grib_set_long(clone_handle, "bitsPerValue", 16), 0); + GRIB_CHECK(grib_set_double_array(clone_handle, "values", values, values_len), 0); + /* get the coded message in a buffer */ - GRIB_CHECK(grib_get_message(clone_handle,&buffer,&size),0); + GRIB_CHECK(grib_get_message(clone_handle, &buffer, &size), 0); /* write the buffer to a file */ - if(fwrite(buffer,1,size,out) != size) { + if (fwrite(buffer, 1, size, out) != size) { perror(output_file); return 1; } @@ -98,21 +100,21 @@ static int encode_file(char *input_file, char *output_file) grib_handle_delete(source_handle); free(values); } - + fclose(out); fclose(in); - + return 0; } -void do_stuff(void *arg) +void do_stuff(void* arg) { long number = (long)arg; char output_file[50]; int i; - for (i=0; i 0.0001) { - fprintf (stderr, "Error too large! norm=%g\n", norm); + fprintf(stderr, "Error too large! norm=%g\n", norm); return 1; } - fclose (fp); + fclose(fp); - GRIB_CHECK (grib_get_long (h, "biFourierResolutionParameterN", &nsmax), 0); - GRIB_CHECK (grib_get_long (h, "biFourierResolutionParameterM", &nmsmax), 0); + GRIB_CHECK(grib_get_long(h, "biFourierResolutionParameterN", &nsmax), 0); + GRIB_CHECK(grib_get_long(h, "biFourierResolutionParameterM", &nmsmax), 0); - GRIB_CHECK (grib_get_long (h, "LxInMetres", &LxInMetres), 0); - GRIB_CHECK (grib_get_long (h, "LyInMetres", &LyInMetres), 0); + GRIB_CHECK(grib_get_long(h, "LxInMetres", &LxInMetres), 0); + GRIB_CHECK(grib_get_long(h, "LyInMetres", &LyInMetres), 0); - GRIB_CHECK (grib_get_long (h, "LuxInMetres", &LuxInMetres), 0); - GRIB_CHECK (grib_get_long (h, "LuyInMetres", &LuyInMetres), 0); + GRIB_CHECK(grib_get_long(h, "LuxInMetres", &LuxInMetres), 0); + GRIB_CHECK(grib_get_long(h, "LuyInMetres", &LuyInMetres), 0); - GRIB_CHECK (grib_get_long (h, "LcxInMetres", &LcxInMetres), 0); - GRIB_CHECK (grib_get_long (h, "LcyInMetres", &LcyInMetres), 0); + GRIB_CHECK(grib_get_long(h, "LcxInMetres", &LcxInMetres), 0); + GRIB_CHECK(grib_get_long(h, "LcyInMetres", &LcyInMetres), 0); if (LxInMetres != 2000 || LyInMetres != 2000 || LuxInMetres != 1800 || LuyInMetres != 1800 || LcxInMetres != 100 || LcyInMetres != 100 || - NSMAX != nsmax || NMSMAX != nmsmax) - { - fprintf (stderr, "Geometry is incorrect\n"); + NSMAX != nsmax || NMSMAX != nmsmax) { + fprintf(stderr, "Geometry is incorrect\n"); return 1; } geometry_len = 128; - GRIB_CHECK (grib_get_string (h, "gridType", geometry, &geometry_len), 0); - if (strcmp (geometry, grids[igrid])) { - printf ("Geometry is incorrect\n"); + GRIB_CHECK(grib_get_string(h, "gridType", geometry, &geometry_len), 0); + if (strcmp(geometry, grids[igrid])) { + printf("Geometry is incorrect\n"); return 1; } - GRIB_CHECK (grib_handle_delete (h), 0); + GRIB_CHECK(grib_handle_delete(h), 0); } } } - free (trunc[1].values); + free(trunc[1].values); return 0; } diff --git a/tests/grib_lam_bf.sh b/tests/grib_lam_bf.sh index 333bd7e42..be4b8fad7 100755 --- a/tests/grib_lam_bf.sh +++ b/tests/grib_lam_bf.sh @@ -1,5 +1,5 @@ #!/bin/sh -# (C) Copyright 2005-2018 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_lam_gp.c b/tests/grib_lam_gp.c index eeb8fd2c6..5708bb6b4 100644 --- a/tests/grib_lam_gp.c +++ b/tests/grib_lam_gp.c @@ -835,133 +835,130 @@ static double values[] = { }; -int main (int argc, char *argv[]) +int main(int argc, char* argv[]) { - grib_handle *h; + grib_handle* h; size_t len; - const char *grids[] = { "lambert_lam", "mercator_lam", "polar_stereographic_lam" }; + const char* grids[] = { "lambert_lam", "mercator_lam", "polar_stereographic_lam" }; int igrid; - for (igrid = 0; igrid < 3; igrid++) - { - GRIB_CHECK (((h = grib_handle_new_from_samples (NULL, "regular_ll_pl_grib2")) == NULL), 0); - len = strlen ("lambert_lam"); - GRIB_CHECK (grib_set_string (h, "gridType", "lambert_lam", &len), 0); - GRIB_CHECK (grib_set_long (h, "centre", 85), 0); - len = strlen (grids[igrid]); - GRIB_CHECK (grib_set_string (h, "gridType", grids[igrid], &len), 0); - GRIB_CHECK (grib_set_long (h, "Nx", 64), 0); - GRIB_CHECK (grib_set_long (h, "Ny", 64), 0); - GRIB_CHECK (grib_set_long (h, "iScansNegatively", 0), 0); - GRIB_CHECK (grib_set_long (h, "jScansPositively", 1), 0); - GRIB_CHECK (grib_set_long (h, "jPointsAreConsecutive", 0), 0); - GRIB_CHECK (grib_set_long (h, "Nux", 53), 0); - GRIB_CHECK (grib_set_long (h, "Nuy", 53), 0); - GRIB_CHECK (grib_set_long (h, "Ncx", 8), 0); - GRIB_CHECK (grib_set_long (h, "Ncy", 8), 0); + for (igrid = 0; igrid < 3; igrid++) { + GRIB_CHECK(((h = grib_handle_new_from_samples(NULL, "regular_ll_pl_grib2")) == NULL), 0); + len = strlen("lambert_lam"); + GRIB_CHECK(grib_set_string(h, "gridType", "lambert_lam", &len), 0); + GRIB_CHECK(grib_set_long(h, "centre", 85), 0); + len = strlen(grids[igrid]); + GRIB_CHECK(grib_set_string(h, "gridType", grids[igrid], &len), 0); + GRIB_CHECK(grib_set_long(h, "Nx", 64), 0); + GRIB_CHECK(grib_set_long(h, "Ny", 64), 0); + GRIB_CHECK(grib_set_long(h, "iScansNegatively", 0), 0); + GRIB_CHECK(grib_set_long(h, "jScansPositively", 1), 0); + GRIB_CHECK(grib_set_long(h, "jPointsAreConsecutive", 0), 0); + GRIB_CHECK(grib_set_long(h, "Nux", 53), 0); + GRIB_CHECK(grib_set_long(h, "Nuy", 53), 0); + GRIB_CHECK(grib_set_long(h, "Ncx", 8), 0); + GRIB_CHECK(grib_set_long(h, "Ncy", 8), 0); if (igrid == 0) { - GRIB_CHECK (grib_set_double (h, "DxInMetres", 2500.00000000000), 0); - GRIB_CHECK (grib_set_double (h, "DyInMetres", 2500.00000000000), 0); - GRIB_CHECK (grib_set_double (h, "latitudeOfFirstGridPointInDegrees", 66.7684949529709), 0); - GRIB_CHECK (grib_set_double (h, "longitudeOfFirstGridPointInDegrees", 25.1580207144963), 0); - GRIB_CHECK (grib_set_double (h, "latitudeOfSouthernPoleInDegrees", 0.000000000000000E+000), 0); - GRIB_CHECK (grib_set_double (h, "longitudeOfSouthernPoleInDegrees", 0.000000000000000E+000), 0); - GRIB_CHECK (grib_set_double (h, "LaDInDegrees", 67.3600000000000), 0); - GRIB_CHECK (grib_set_double (h, "LoVInDegrees", 26.6400000000000), 0); - GRIB_CHECK (grib_set_double (h, "Latin1InDegrees", 67.3600000000000), 0); - GRIB_CHECK (grib_set_double (h, "Latin2InDegrees", 67.3600000000000), 0); - GRIB_CHECK (grib_set_long (h, "projectionCentreFlag", 0), 0); - GRIB_CHECK (grib_set_long (h, "uvRelativeToGrid", 1), 0); + GRIB_CHECK(grib_set_double(h, "DxInMetres", 2500.00000000000), 0); + GRIB_CHECK(grib_set_double(h, "DyInMetres", 2500.00000000000), 0); + GRIB_CHECK(grib_set_double(h, "latitudeOfFirstGridPointInDegrees", 66.7684949529709), 0); + GRIB_CHECK(grib_set_double(h, "longitudeOfFirstGridPointInDegrees", 25.1580207144963), 0); + GRIB_CHECK(grib_set_double(h, "latitudeOfSouthernPoleInDegrees", 0.000000000000000E+000), 0); + GRIB_CHECK(grib_set_double(h, "longitudeOfSouthernPoleInDegrees", 0.000000000000000E+000), 0); + GRIB_CHECK(grib_set_double(h, "LaDInDegrees", 67.3600000000000), 0); + GRIB_CHECK(grib_set_double(h, "LoVInDegrees", 26.6400000000000), 0); + GRIB_CHECK(grib_set_double(h, "Latin1InDegrees", 67.3600000000000), 0); + GRIB_CHECK(grib_set_double(h, "Latin2InDegrees", 67.3600000000000), 0); + GRIB_CHECK(grib_set_long(h, "projectionCentreFlag", 0), 0); + GRIB_CHECK(grib_set_long(h, "uvRelativeToGrid", 1), 0); } else if (igrid == 1) { - GRIB_CHECK (grib_set_double (h, "latitudeOfFirstGridPointInDegrees", 67.9372009520603), 0); - GRIB_CHECK (grib_set_double (h, "longitudeOfFirstGridPointInDegrees", 25.1580207144963), 0); - GRIB_CHECK (grib_set_double (h, "LaDInDegrees", 0.), 0); - GRIB_CHECK (grib_set_double (h, "latitudeOfLastGridPointInDegrees", 72.9372009520603), 0); - GRIB_CHECK (grib_set_double (h, "longitudeOfLastGridPointInDegrees", 29.1580207144963), 0); - GRIB_CHECK (grib_set_double (h, "orientationOfTheGridInDegrees", 0.), 0); - GRIB_CHECK (grib_set_long (h, "uvRelativeToGrid", 1), 0); + GRIB_CHECK(grib_set_double(h, "latitudeOfFirstGridPointInDegrees", 67.9372009520603), 0); + GRIB_CHECK(grib_set_double(h, "longitudeOfFirstGridPointInDegrees", 25.1580207144963), 0); + GRIB_CHECK(grib_set_double(h, "LaDInDegrees", 0.), 0); + GRIB_CHECK(grib_set_double(h, "latitudeOfLastGridPointInDegrees", 72.9372009520603), 0); + GRIB_CHECK(grib_set_double(h, "longitudeOfLastGridPointInDegrees", 29.1580207144963), 0); + GRIB_CHECK(grib_set_double(h, "orientationOfTheGridInDegrees", 0.), 0); + GRIB_CHECK(grib_set_long(h, "uvRelativeToGrid", 1), 0); } else if (igrid == 2) { - GRIB_CHECK (grib_set_double (h, "DxInMetres", 2500.00000000000), 0); - GRIB_CHECK (grib_set_double (h, "DyInMetres", 2500.00000000000), 0); - GRIB_CHECK (grib_set_double (h, "latitudeOfFirstGridPointInDegrees", 67.9372009520603), 0); - GRIB_CHECK (grib_set_double (h, "longitudeOfFirstGridPointInDegrees", 25.1580207144963), 0); - GRIB_CHECK (grib_set_double (h, "LaDInDegrees", 0.), 0); - GRIB_CHECK (grib_set_double (h, "orientationOfTheGridInDegrees", 0.), 0); + GRIB_CHECK(grib_set_double(h, "DxInMetres", 2500.00000000000), 0); + GRIB_CHECK(grib_set_double(h, "DyInMetres", 2500.00000000000), 0); + GRIB_CHECK(grib_set_double(h, "latitudeOfFirstGridPointInDegrees", 67.9372009520603), 0); + GRIB_CHECK(grib_set_double(h, "longitudeOfFirstGridPointInDegrees", 25.1580207144963), 0); + GRIB_CHECK(grib_set_double(h, "LaDInDegrees", 0.), 0); + GRIB_CHECK(grib_set_double(h, "orientationOfTheGridInDegrees", 0.), 0); } - GRIB_CHECK (grib_set_long (h, "NV", 0), 0); - GRIB_CHECK (grib_set_long (h, "year", 2009), 0); - GRIB_CHECK (grib_set_long (h, "month", 5), 0); - GRIB_CHECK (grib_set_long (h, "day", 28), 0); - GRIB_CHECK (grib_set_long (h, "hour", 0), 0); - GRIB_CHECK (grib_set_long (h, "minute", 0), 0); - GRIB_CHECK (grib_set_long (h, "second", 0), 0); - len = strlen ("s"); - GRIB_CHECK (grib_set_string (h, "indicatorOfUnitOfTimeRange", "s", &len), 0); - len = strlen ("s"); - GRIB_CHECK (grib_set_string (h, "stepUnits", "s", &len), 0); - GRIB_CHECK (grib_set_long (h, "endStep", 3600), 0); - GRIB_CHECK (grib_set_long (h, "bitsPerValue", 16), 0); - len = strlen ("grid_simple"); - GRIB_CHECK (grib_set_string (h, "packingType", "grid_simple", &len), 0); - GRIB_CHECK (grib_set_long (h, "numberOfDataPoints", 4096), 0); + GRIB_CHECK(grib_set_long(h, "NV", 0), 0); + GRIB_CHECK(grib_set_long(h, "year", 2009), 0); + GRIB_CHECK(grib_set_long(h, "month", 5), 0); + GRIB_CHECK(grib_set_long(h, "day", 28), 0); + GRIB_CHECK(grib_set_long(h, "hour", 0), 0); + GRIB_CHECK(grib_set_long(h, "minute", 0), 0); + GRIB_CHECK(grib_set_long(h, "second", 0), 0); + len = strlen("s"); + GRIB_CHECK(grib_set_string(h, "indicatorOfUnitOfTimeRange", "s", &len), 0); + len = strlen("s"); + GRIB_CHECK(grib_set_string(h, "stepUnits", "s", &len), 0); + GRIB_CHECK(grib_set_long(h, "endStep", 3600), 0); + GRIB_CHECK(grib_set_long(h, "bitsPerValue", 16), 0); + len = strlen("grid_simple"); + GRIB_CHECK(grib_set_string(h, "packingType", "grid_simple", &len), 0); + GRIB_CHECK(grib_set_long(h, "numberOfDataPoints", 4096), 0); len = 4096; - GRIB_CHECK (grib_set_double_array (h, "values", values, len), 0); + GRIB_CHECK(grib_set_double_array(h, "values", values, len), 0); if (1) { char f[128]; - FILE *fp; + FILE* fp; size_t size; - const void *buffer = NULL; - sprintf (f, "lam_gp_%s.grib", grids[igrid]); - fp = fopen (f, "wb"); - GRIB_CHECK (grib_get_message (h, &buffer, &size), 0); - if (fwrite (buffer, 1, size, fp) != size) - { - perror (f); + const void* buffer = NULL; + sprintf(f, "lam_gp_%s.grib", grids[igrid]); + fp = fopen(f, "wb"); + GRIB_CHECK(grib_get_message(h, &buffer, &size), 0); + if (fwrite(buffer, 1, size, fp) != size) { + perror(f); return 1; } - fclose (fp); + fclose(fp); } - GRIB_CHECK (grib_handle_delete (h), 0); + GRIB_CHECK(grib_handle_delete(h), 0); /* Check message correctness */ { char f[128]; - FILE *fp; - double *vals; + FILE* fp; + double* vals; double norm = 0.; int i, err; size_t values_len, geometry_len; long int Nux, Nuy, Ncx, Ncy; char geometry[128]; - sprintf (f, "lam_gp_%s.grib", grids[igrid]); - fp = fopen (f, "rb"); - h = grib_handle_new_from_file (0, fp, &err); - vals = (double *) malloc (sizeof (double) * 4096); + sprintf(f, "lam_gp_%s.grib", grids[igrid]); + fp = fopen(f, "rb"); + h = grib_handle_new_from_file(0, fp, &err); + vals = (double*)malloc(sizeof(double) * 4096); values_len = 4096; - GRIB_CHECK (grib_get_double_array (h, "values", vals, &values_len), 0); + GRIB_CHECK(grib_get_double_array(h, "values", vals, &values_len), 0); for (i = 0; i < 4096; i++) norm += (values[i] - vals[i]) * (values[i] - vals[i]); - norm = sqrt (norm / 4096); - free (vals); - printf ("%s : %lf\n", grids[igrid], norm); - if (norm > 0.0001) - { + norm = sqrt(norm / 4096); + free(vals); + printf("%s : %lf\n", grids[igrid], norm); + if (norm > 0.0001) { fprintf(stderr, "Error too large !\n"); return 1; } - fclose (fp); + fclose(fp); - GRIB_CHECK (grib_get_long (h, "Nux", &Nux), 0); - GRIB_CHECK (grib_get_long (h, "Nuy", &Nuy), 0); - GRIB_CHECK (grib_get_long (h, "Ncx", &Ncx), 0); - GRIB_CHECK (grib_get_long (h, "Ncy", &Ncy), 0); + GRIB_CHECK(grib_get_long(h, "Nux", &Nux), 0); + GRIB_CHECK(grib_get_long(h, "Nuy", &Nuy), 0); + GRIB_CHECK(grib_get_long(h, "Ncx", &Ncx), 0); + GRIB_CHECK(grib_get_long(h, "Ncy", &Ncy), 0); if (Nux != 53 || Nuy != 53 || Ncx != 8 || Ncy != 8) { fprintf(stderr, "Geometry is incorrect\n"); @@ -969,13 +966,13 @@ int main (int argc, char *argv[]) } geometry_len = 128; - GRIB_CHECK (grib_get_string (h, "gridType", geometry, &geometry_len), 0); - if (strcmp (geometry, grids[igrid])) { + GRIB_CHECK(grib_get_string(h, "gridType", geometry, &geometry_len), 0); + if (strcmp(geometry, grids[igrid])) { fprintf(stderr, "Geometry is incorrect\n"); return 1; } - GRIB_CHECK (grib_handle_delete (h), 0); + GRIB_CHECK(grib_handle_delete(h), 0); } } return 0; diff --git a/tests/grib_lam_gp.sh b/tests/grib_lam_gp.sh index b36734bf0..e7d7d5615 100755 --- a/tests/grib_lam_gp.sh +++ b/tests/grib_lam_gp.sh @@ -1,5 +1,5 @@ #!/bin/sh -# (C) Copyright 2005-2018 ECMWF. +# (C) Copyright 2005- 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. diff --git a/tests/grib_local_MeteoFrance.c b/tests/grib_local_MeteoFrance.c index 35a619082..5acacb426 100644 --- a/tests/grib_local_MeteoFrance.c +++ b/tests/grib_local_MeteoFrance.c @@ -16,902 +16,902 @@ */ static double values[] = { - 276.857846883478, 276.794176778727, 277.181087123710, 277.271328891367, 277.738150007595, - 277.811501271569, 277.782801498740, 277.720243049346, 277.697362352800, 277.645937156907, - 277.434690429892, 277.479415166828, 277.480779740851, 277.470370683483, 277.466233617218, - 277.519636477424, 277.546507075768, 277.533196530853, 277.638535538066, 277.660223799155, - 277.516239354148, 277.435042994882, 277.233848743540, 277.204873528392, 277.217411121384, - 277.145056043542, 277.359707505178, 277.563426568591, 277.359606573371, 277.302689400583, - 277.135925984483, 277.013670202527, 277.249004656066, 277.362196243717, 277.472882266866, - 277.551374864505, 277.332048151829, 277.879973060166, 277.925942918285, 278.260846010953, - 278.144732099878, 278.206939585072, 277.936934540523, 278.025569678971, 278.307756924958, - 278.369318574429, 278.609267078466, 278.634490902502, 278.686706704875, 278.328553888493, - 278.418908930386, 279.060194431430, 279.114168787979, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 276.922836958812, - 276.932069336471, 277.225397205068, 277.545476457484, 277.807111956190, 277.768185575062, - 277.713814690105, 277.662213334460, 277.653334089351, 277.591821807616, 277.519290878870, - 277.499671640950, 277.471580060430, 277.398162354734, 277.371544952255, 277.453879058484, - 277.474032112632, 277.458747675572, 277.588871038908, 277.540124772655, 277.464264615292, - 277.039835665510, 277.050815441941, 277.165791541588, 277.284327024201, 277.353876090779, - 277.399785414714, 277.512330802008, 277.438449711794, 277.419894070553, 277.165764618769, - 277.034846715507, 277.230872118099, 277.277310155004, 277.272952146249, 277.486209474088, - 277.453656185210, 277.613143953527, 278.070672412350, 278.079989482462, 278.338031969208, - 278.163685044856, 278.214343856183, 278.255744502346, 277.941149161137, 278.165921759503, - 278.022894706983, 278.499780589025, 278.158397461806, 278.611643581705, 278.438079674786, - 278.816122996613, 278.628190436440, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 277.048057829677, 277.280372081890, - 277.423859756998, 277.465672699176, 277.728939006340, 277.726575834584, 277.688480429396, - 277.635385647721, 277.626062350091, 277.604239400215, 277.556926439833, 277.519394378669, - 277.425044031161, 277.318865067295, 277.309205651263, 277.348943116883, 277.361861210203, - 277.430978988228, 277.477408565654, 277.638923535542, 277.418799606607, 277.017513285449, - 276.976808425920, 277.159242736589, 277.315106840602, 277.327868258207, 277.390541905514, - 277.608373786211, 277.473011211489, 277.578037079299, 277.353975261579, 277.253195520645, - 277.219244477693, 277.303161046293, 277.197720889628, 277.568280002996, 277.565774183730, - 278.056333010069, 278.360857981015, 278.182020399473, 278.393376099219, 278.363774312832, - 278.203283980677, 278.146185013281, 278.348861342242, 278.330399393385, 278.059284960522, - 277.920499351734, 278.030061320993, 278.226766351540, 278.217750387710, 278.516389162421, - 278.535938385310, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 277.255920436446, 277.480949345724, 277.444597425498, - 277.647882845088, 277.496111688818, 277.670322939349, 277.765213822002, 277.666760657851, - 277.656928637994, 277.678906056191, 277.667906868059, 277.539641562735, 277.369487702737, - 277.285648882293, 277.326341650870, 277.351600146853, 277.359573895370, 277.493766228910, - 277.649003177440, 277.460872384943, 277.243514998577, 277.056578101319, 277.226617780177, - 277.271740370610, 277.294132332584, 277.308093611741, 277.378433184955, 277.570114302521, - 277.548859645865, 277.723889890260, 277.429263433352, 277.272737053512, 277.398599847739, - 277.309448997716, 277.328344724582, 277.207058029377, 277.696248070705, 277.835043755662, - 278.062452681475, 277.850550227440, 278.265559859820, 278.272872090840, 278.465229599008, - 278.217031341802, 278.386132964535, 278.224365564792, 278.232702192636, 278.099733855522, - 278.082038386312, 278.064057694079, 278.385342869231, 278.700953905968, 278.673157999290, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 277.459327717938, 277.559547836427, 277.422638507574, 277.572825627337, - 277.571463907280, 277.548694860479, 277.544037804342, 277.524653326012, 277.693130140178, - 277.706143234839, 277.497931516767, 277.349914202908, 277.161676307980, 277.258114023397, - 277.410663587516, 277.481076538026, 277.519833710823, 277.631696408897, 277.418308903785, - 277.304804629716, 277.259147844963, 277.382350427133, 277.299040041596, 277.256710875078, - 277.280373232168, 277.342518042564, 277.164290846344, 277.428166532894, 277.401545619979, - 277.739369780501, 277.395945166703, 277.460368035024, 277.476322888924, 277.493513518766, - 277.351824398612, 277.358401183558, 277.509306514214, 278.029530363332, 278.214265489018, - 278.152451178774, 278.452249056059, 278.282135844771, 278.031146456185, 278.126155437803, - 278.340924990343, 278.274408568623, 278.095792700955, 278.045155910991, 278.044971189736, - 278.227690671411, 278.277414153890, 278.322932576059, 278.574745416009, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 277.352885697217, 277.465676965878, 277.313718088585, 277.571636446583, 277.752813057885, - 277.876072319293, 277.600399390414, 277.629804333290, 277.509786900336, 277.350032286595, - 277.710697230771, 277.302689293788, 276.964102591939, 277.129868245471, 277.506377821286, - 277.620243311629, 277.670677617944, 277.590396381881, 277.259332104000, 277.282466682171, - 277.510494889930, 277.420372093899, 277.372440940559, 277.334025248344, 277.133405320679, - 277.432373537602, 277.458193421654, 277.573994485106, 277.560836748035, 277.504546294795, - 277.722963359918, 277.429148743501, 277.415671650080, 277.296250262619, 277.426094729653, - 277.013478567167, 277.173619712680, 277.722720050144, 278.152541665310, 278.471048817117, - 278.595955610324, 278.466217631891, 278.437646585921, 278.321089675788, 278.198112904595, - 277.952153564447, 278.065664545600, 278.357066253341, 277.965448681613, 278.124513612433, - 278.162667811909, 278.277405316586, 278.574537792479, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 277.390479450263, - 277.345673673084, 277.364302907561, 277.605928275352, 277.789929872344, 277.903984493908, - 277.966933216759, 277.912882971090, 277.703988459187, 277.351015681331, 277.674063100141, - 277.408395530420, 277.007259003699, 276.877336007904, 277.057623772846, 277.601455267293, - 277.323874590069, 277.238673158792, 277.337325747808, 277.439493917521, 277.541788857115, - 277.749810750892, 277.278504087019, 277.414256185858, 277.429899941764, 277.493551649852, - 277.511929075685, 277.190651115649, 277.443504438646, 277.605668250438, 277.771466436681, - 277.767262688689, 277.716100034677, 277.618374865972, 277.415460290735, 277.086306373890, - 277.176226842383, 277.650329975958, 277.765271071796, 278.463221024006, 278.702998001410, - 278.624355987396, 278.467009674144, 278.568028046137, 278.284237092204, 278.456297664446, - 278.609188468591, 278.571107283134, 278.248413926530, 278.155161517380, 278.404700226527, - 278.246987177160, 278.091060834030, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 277.419054703888, 277.313454081577, - 277.427414463702, 277.682584699189, 277.791193561005, 277.837885785253, 277.920062626646, - 277.919899324178, 277.689677224346, 277.410500912168, 277.630756408261, 277.629189004816, - 277.397411408199, 277.319060037245, 277.402102256687, 277.322768000649, 277.822242558531, - 277.887351499372, 277.454007146918, 277.676721339532, 277.602004218075, 277.714201570065, - 277.566677175978, 277.587799289763, 277.530615330753, 277.556498697055, 277.452480002766, - 277.522252203614, 277.645085515486, 277.845531596217, 277.946658451859, 277.602481754126, - 277.727335587639, 277.560791900289, 277.284230600351, 277.484662737021, 277.763836962967, - 277.845000815162, 278.010847594804, 278.693344887027, 278.809251065654, 278.723035732378, - 278.424896815390, 278.623465372965, 278.347354282196, 278.788885219380, 278.765666653428, - 278.053095427463, 278.334108537083, 278.163143059112, 278.791210402345, 278.564612083899, - 278.156097707067, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 277.260418446226, 277.335071352700, 277.491938938790, - 277.691206395263, 277.704209378278, 277.669286596309, 277.754719412166, 277.870079071509, - 277.502780644528, 277.754473095834, 277.727974436459, 277.557807112427, 277.336457025286, - 277.383919705566, 277.656951776528, 277.778531969694, 277.546679431981, 277.433886594239, - 277.849054763829, 277.827905512882, 277.852324775739, 277.715592971272, 277.705949179344, - 277.784233780020, 277.513796321220, 277.651505656888, 277.679417351708, 277.712133821933, - 277.640023428435, 277.845573550891, 277.939074922095, 277.983471194163, 277.686692172136, - 277.654194453924, 277.864032570137, 277.868319164885, 277.949388853803, 278.090141829888, - 278.064378565379, 278.473111038064, 278.567543171754, 278.829326294043, 278.294846275015, - 278.860106433048, 278.796593070403, 278.824386010090, 278.760223015153, 278.048034602279, - 278.456786976534, 278.270707527732, 278.883481216381, 278.331828953117, 278.594265837323, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 277.265976322594, 277.170431045594, 277.485489657589, 277.518150163777, - 277.594346099824, 277.525106574839, 277.660446242218, 277.653585064744, 277.344627321906, - 277.549004645704, 277.850802344347, 277.583257392330, 277.353933834212, 277.483162324227, - 277.802093742320, 277.620873269675, 277.778845766219, 277.705264213562, 277.541346709049, - 277.429472445857, 277.832567758240, 277.874496054447, 277.713531133238, 277.960569830321, - 277.669206881492, 277.755260958946, 277.586916719101, 277.841135564379, 277.718811273917, - 277.786742393662, 277.829134182740, 277.760954990401, 277.727290357312, 277.802718821044, - 277.926844650633, 277.940517920966, 277.860498676370, 277.948632515039, 278.482136788291, - 278.576025918865, 278.759903750249, 278.682290037298, 278.803929269590, 278.813600952805, - 278.879253548731, 278.646151177629, 278.776315233178, 278.693319468861, 278.379375494188, - 278.648541321932, 278.852157864598, 278.997643614525, 279.027698942229, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 277.366680878019, 277.381150787692, 277.486313780854, 277.312232782158, 277.401101882668, - 277.567697032357, 277.761418956830, 277.631564641376, 277.355216207498, 277.579622423646, - 277.946803922538, 277.745864795866, 277.554670208171, 277.653554412702, 277.886277698790, - 277.865648942958, 277.749235588755, 277.653323813329, 277.549350491474, 277.771809470937, - 277.894339690909, 277.969462462647, 278.118951046477, 278.108173032796, 277.923612184096, - 277.725656808996, 277.917004359488, 278.013510348155, 277.903413295852, 277.848269398192, - 277.837731396906, 277.733960635088, 277.766101554254, 277.546687146201, 277.856867293302, - 277.905478550194, 277.736223835135, 278.472986192106, 278.717220540209, 278.760841954155, - 278.638659440517, 278.681901711759, 278.363012975511, 278.807884722018, 278.838462052377, - 278.928798765744, 278.952453872397, 278.865733112592, 278.729566964511, 278.884998970494, - 278.942907006798, 278.960762454434, 278.688569887665, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 277.591550421937, - 277.499030877279, 277.305275168613, 277.541796080983, 277.195139366615, 277.331665964937, - 277.445626505916, 277.215335680856, 277.530907774801, 277.843341282378, 277.963214149135, - 277.927219319293, 277.797424178773, 277.813442210719, 277.933664495794, 277.858047474598, - 277.696277323311, 277.361473125741, 277.479932829295, 277.389415841575, 277.553020377427, - 277.924940171380, 278.159459379598, 278.037019105043, 277.914055069608, 277.647200588818, - 277.916937939818, 277.909534469069, 277.749633166238, 277.904591816623, 277.826866398276, - 277.903480594745, 277.699082807175, 277.688363481753, 277.605172407277, 277.842865865160, - 278.021216292518, 278.414517122505, 278.681556989763, 278.680320091635, 278.574125022233, - 278.370197434153, 278.734504756703, 278.493143759543, 278.779235286269, 278.935546444982, - 278.663643683160, 278.899996705338, 278.900791563301, 278.879832866026, 278.858705900529, - 278.815825789004, 278.824798215775, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 277.567216721718, 277.522475814565, - 277.303456918119, 277.208997427907, 277.424224609638, 277.567326891009, 277.516826173608, - 277.498907180864, 277.469773038402, 277.832555441150, 277.982833034908, 278.034185232461, - 277.939076079863, 277.902634532238, 277.970739026974, 277.895772802147, 277.735591951345, - 277.571305898374, 277.401061840836, 277.802603400487, 277.964968147081, 278.120946309288, - 278.120357306337, 278.027951015641, 277.674224913903, 277.745718315661, 277.676284056601, - 277.869144896292, 277.970562609159, 277.897871250900, 277.988896836592, 277.828464108029, - 277.787944526233, 277.592034339979, 277.887975166605, 277.726333366592, 278.031409362000, - 278.341449368467, 278.429430372404, 278.651974989787, 278.066148305173, 278.615426251337, - 278.658109595447, 278.764842621618, 278.797171571925, 278.930322025553, 278.589836306622, - 278.878563250804, 278.928365819420, 278.890061138998, 278.711334675770, 278.384119162997, - 278.646351915830, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 277.663311094642, 277.507469698425, 277.389870268662, - 277.406179041586, 277.420737084474, 277.458518864884, 277.735139471721, 277.538528827908, - 277.851206036120, 277.883910964943, 277.957774069964, 277.977068942386, 277.944430734847, - 277.548495261116, 277.973300201287, 277.918203113366, 277.766347699266, 277.602195991588, - 277.779284913253, 277.876179934937, 277.970720881483, 278.083009243663, 278.104572434708, - 277.809070170494, 277.861807626314, 277.891365545407, 277.598480819644, 277.808955771559, - 277.877037325444, 277.848094780278, 277.931719704904, 277.914973085381, 277.584619210738, - 277.926657140828, 278.195616408992, 278.085463190691, 277.980335449674, 278.380371866981, - 278.427298049019, 278.662228114450, 278.596051250816, 278.616744598565, 278.803046455795, - 278.791647475311, 278.497809355494, 278.866809060531, 278.869411961323, 278.852587248998, - 278.873678034993, 278.840736102112, 278.718548564065, 278.079520049554, 278.242255144442, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 277.663037557399, 277.570818671989, 277.407747457760, 277.335813345664, - 277.408696086859, 277.372137478768, 277.687262360450, 277.795853080682, 277.908241927909, - 277.869637561962, 277.892224175058, 277.606701811400, 277.922429208801, 277.536273731865, - 277.514854228159, 277.491556490133, 277.238066098239, 277.372640648916, 277.841348851264, - 277.929444260057, 277.976213790096, 278.044032057611, 277.835719155503, 277.767503822122, - 277.843943315539, 277.920171435982, 277.647907981291, 277.916193738411, 277.839013360636, - 277.803033017271, 277.864319377224, 277.746027317625, 277.651770176824, 278.063583343182, - 278.140685366536, 278.122090447834, 278.051809880199, 278.142408676546, 278.306266717218, - 278.732451854741, 278.748488287575, 278.749619678915, 278.800360568621, 278.706276462243, - 278.492046737934, 278.862935429038, 278.836729260372, 278.789661732480, 278.792523085067, - 278.785266852082, 278.004813712433, 278.206206534037, 278.268595922962, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 277.655861325454, 277.470105519071, 277.399821904234, 277.079715748819, 277.206531740859, - 277.468381791645, 277.363994499400, 277.823385911566, 277.933105323249, 277.866664229846, - 277.852775583871, 277.877579704086, 277.963875663629, 277.928717010393, 277.828398792983, - 277.296954832861, 277.401013285608, 277.627465823518, 277.658221668447, 277.774377222669, - 277.868027943365, 278.023351410815, 277.746712993709, 278.009216578254, 277.993159001656, - 277.680853664988, 277.661928822189, 277.876061141195, 277.861750611024, 277.598049579725, - 277.828212743813, 277.655101339813, 277.951762031896, 277.838019817885, 278.179159164042, - 278.237226454496, 278.178567686687, 278.271357845148, 278.743948910507, 278.860705502890, - 278.683448271915, 278.784519721920, 278.823631988977, 278.720806055127, 278.798185740840, - 278.751147075398, 278.657468304086, 278.445253830843, 278.647530368995, 278.649158962300, - 278.320344550426, 278.521904549617, 278.418647841440, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 277.402768933310, - 277.337648751023, 277.288997139047, 277.307430980466, 277.273543109168, 277.307022035080, - 277.641453325741, 277.844770093515, 277.953627149863, 277.942556409526, 278.215884948157, - 277.975149183501, 277.975145850398, 277.900981141501, 277.505402827533, 277.362760181571, - 277.548236940679, 277.664353875572, 277.502568484867, 277.584445002441, 277.713270317726, - 277.965355998582, 277.690792988212, 278.006179713121, 278.001384579859, 277.828691144649, - 277.561216736042, 277.889988864492, 277.754326137754, 277.904050492162, 277.709121972134, - 277.690236890821, 278.007302124024, 278.153784599132, 278.279221305941, 278.375074001404, - 278.132932590898, 278.527166347114, 278.731939115244, 278.786940471844, 278.668914201410, - 278.548949997938, 278.592784358004, 278.703220908555, 278.607776530910, 278.504228677905, - 278.163645789480, 278.248484564569, 278.501193898172, 278.642560007634, 278.370053886907, - 278.408249992376, 278.403262082509, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 277.207648756580, 277.331137219044, - 277.479780517975, 277.377551184413, 277.272600399963, 277.500350726646, 277.705863349177, - 277.864606993211, 277.966389026012, 278.042544067771, 278.322542195089, 278.031457007641, - 277.941373758310, 277.636410155692, 277.858031016031, 277.252349029484, 277.532160327080, - 277.374767480318, 277.358447349268, 277.596000095572, 277.677202591650, 277.510417183120, - 277.771541403309, 277.999812504068, 277.710912956346, 277.651416447672, 277.782845548063, - 277.920184623648, 278.100817677521, 277.830890386789, 277.549163570987, 277.924816153170, - 277.939889612067, 278.226842544695, 278.334446154499, 278.384165815707, 278.595962695245, - 278.279446869139, 278.639495704751, 278.773812076980, 278.436948614430, 278.920203762416, - 278.841422131634, 278.427836855974, 278.741570912682, 278.508545454593, 278.339874209391, - 278.557063084230, 278.416922724100, 278.706534660227, 278.334083779964, 278.643830203774, - 278.639844363161, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 277.374416670460, 277.500945802563, 277.426407890967, - 277.396874709479, 277.318086237064, 277.616856624914, 277.899994797892, 277.698238913389, - 277.977172419143, 278.341279558064, 278.388060688379, 278.293360918814, 277.904418999468, - 277.876108809024, 277.943923864864, 277.721133375911, 277.442202818399, 277.253739466136, - 277.509607250232, 277.667492305596, 277.591852155885, 277.835292482825, 277.968936425109, - 277.955535101385, 277.936720370208, 277.583707892174, 277.868800957519, 277.945079514213, - 278.033236526786, 277.903343895031, 278.056619912872, 278.157071041598, 278.283239136885, - 278.176795659042, 278.214399736990, 278.377534497257, 278.505800329270, 278.397309694119, - 278.669295404261, 278.768294086585, 278.677030612244, 278.800406330589, 278.667560270694, - 278.786628105936, 278.570032149640, 278.492115471478, 278.447513823625, 278.631423391505, - 278.397821811388, 278.495161908060, 278.272485916042, 278.556447973070, 278.677966110168, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 277.317281721922, 277.505968584604, 277.114499942864, 277.204273695860, - 277.333957324466, 277.623957317731, 277.644603479615, 278.000151120404, 277.641642354499, - 278.324675421874, 278.417063688056, 278.331839246209, 277.968470256881, 277.964794190107, - 278.037060222090, 277.649723985672, 277.168203186638, 277.143187050201, 277.273553266251, - 277.552393261269, 277.634517104997, 277.802271465379, 277.881739212292, 277.940910603072, - 277.879001692426, 277.745720318329, 277.913410218013, 278.101729803357, 277.802314274772, - 277.915739600581, 278.217977656900, 278.416638900017, 278.379485432682, 278.328422581059, - 278.343399135787, 278.412171676156, 278.436343517073, 278.543604914389, 278.063377717316, - 278.540875146925, 278.533646068312, 278.735677942685, 278.780712168233, 278.761366160987, - 278.038154721897, 277.866532120266, 278.165321893048, 278.680388296020, 278.573200036194, - 278.586831345728, 278.488241868816, 278.717947283378, 278.836911122056, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 277.480116247201, 277.368756132519, 277.384832941860, 277.308509322704, 277.345442414908, - 277.590676884641, 277.990539450091, 278.008983298761, 277.523442305010, 277.718274275941, - 277.715931444292, 277.879291396559, 277.831199273422, 277.864571039565, 277.936717108059, - 277.383879543378, 277.479777256307, 277.499848020363, 277.547859827789, 277.305533315021, - 277.482950172282, 277.774397519738, 277.898868170053, 277.817079364159, 277.711025079660, - 277.980058933637, 278.099658611097, 278.100938650431, 278.142922246411, 277.996704723186, - 278.305020752925, 278.407688919361, 278.163649151564, 278.023096003471, 278.332110722164, - 278.268480918882, 278.421591670262, 278.546119434891, 278.568382938671, 278.587036101537, - 278.647194694244, 278.632463274801, 278.809178187614, 278.560416104309, 278.581259006153, - 278.321975280033, 278.397446094076, 278.464681382615, 278.596423306474, 278.667946458021, - 278.738020433360, 278.814420875995, 279.011631604617, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 277.428218736626, - 277.508626172290, 277.415642785172, 277.326956949725, 277.422044581352, 277.628551397821, - 278.032568055647, 277.613158572540, 277.713901836099, 277.885738420719, 277.917749048996, - 278.013884830796, 277.837463066963, 278.076080916673, 277.808832386222, 277.917564486129, - 277.577955670404, 277.241692902309, 277.577689403392, 277.226372942221, 277.416783611213, - 277.772320420235, 277.599211176025, 277.836487250781, 277.809253831983, 277.951052110206, - 278.127684219100, 277.805451324327, 278.205782665344, 277.865170697282, 278.375832904428, - 278.485020997838, 278.294257990030, 277.778871781181, 278.041861178526, 278.230259905805, - 278.579538089333, 278.512225093511, 278.620858449128, 278.484717004610, 278.559119647309, - 278.617542855681, 278.820763331162, 278.736385000030, 278.489854683578, 278.188909713201, - 278.004895490409, 278.007836877641, 278.638253545765, 278.730478954238, 278.787710783790, - 278.859125519494, 279.227392202470, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 277.393891145112, 277.465694686045, - 277.467507921517, 277.411878635866, 277.504059151580, 277.630651160882, 277.879970074861, - 277.995167439470, 277.902552985162, 277.839877260391, 277.886479575329, 277.964201298207, - 277.748472501319, 278.029116825528, 278.009583787838, 277.934526840383, 277.918798670404, - 277.415532843179, 277.226805056122, 277.387098345780, 277.370489382575, 277.592402088486, - 277.700296833394, 277.892605230371, 277.891485508185, 278.129626663091, 278.237884596150, - 278.280404041963, 278.283057722739, 278.176984809500, 278.428645957507, 278.109976506484, - 278.299865428307, 277.995343116520, 277.977547389843, 278.172188036825, 278.514038655551, - 278.675018218984, 278.625249773115, 278.608351762487, 278.536197132141, 278.726854763747, - 278.805234471385, 278.674105241850, 278.663153403020, 278.298350908914, 278.124861199903, - 278.252964651486, 278.482059693182, 278.696680548966, 278.654309837275, 278.837647755382, - 278.841089485443, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 277.328655950263, 277.427619472960, 277.487446231366, - 277.482177271494, 277.494902394691, 277.591252248805, 277.971747475921, 278.009447854320, - 277.958400013211, 277.920394743774, 277.910344201103, 277.904280958818, 277.937158186883, - 278.076707899491, 278.062378531395, 277.668974757625, 277.800233651596, 277.541009600309, - 277.635857852503, 277.317816179233, 277.324195107430, 277.304573477618, 277.583966858675, - 277.801468375244, 277.858184963214, 278.015052891651, 278.279565568836, 278.150440976593, - 278.333103904681, 278.001182976533, 278.378488809734, 278.398697539971, 278.106032442229, - 277.965961371387, 278.143415892015, 278.377058446346, 278.574510298617, 278.436449113920, - 278.556672883167, 278.474960861679, 277.671139137360, 278.608670196079, 278.823152806552, - 278.860633331916, 278.712151986816, 278.295366943143, 277.973512496151, 278.147084138199, - 278.272905044223, 278.608690016513, 278.742172545861, 278.836415342435, 278.950088390739, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 277.310255947307, 277.438715269565, 277.535027802511, 277.514844555789, - 277.462658101701, 277.525339149085, 277.905885035111, 278.029200074722, 278.012440418427, - 277.996696426728, 277.957260620693, 277.882273913448, 277.923722117905, 278.057432597146, - 278.044128097293, 277.761271445925, 277.825323905342, 277.691879001328, 277.446628829196, - 277.285529192993, 277.207992853587, 277.564191085190, 277.712353241969, 277.873266532172, - 278.065423477158, 278.272705886866, 278.158741722804, 278.295227598450, 278.196699266996, - 278.353184502646, 278.349997851807, 278.141054038599, 277.886475692701, 277.859485979835, - 277.988073922406, 278.056957014442, 278.165448109257, 278.437202004743, 278.532793916627, - 278.729865755553, 278.336824160806, 278.305882985596, 278.713096825648, 278.851216364801, - 278.766735587507, 278.187401602110, 277.936089073750, 278.098752788839, 278.239953058972, - 278.622711192950, 278.843801280644, 278.884179584854, 278.970925282742, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 277.333993153785, 277.421151644708, 277.494771266272, 277.504859778772, 277.471450172707, - 277.495380050697, 277.897156708496, 278.087047727013, 278.045437799738, 278.056224065926, - 278.016178427298, 277.909517544432, 277.875464078132, 277.670207024597, 277.846114070057, - 277.728674807606, 277.481683080213, 277.678434290214, 277.452220611572, 277.118933743421, - 277.289809580767, 277.553585984918, 277.846040916297, 277.958533555517, 277.851453386475, - 277.929222688602, 278.241588928175, 278.028359727517, 278.357330703968, 278.540247369890, - 278.402603488606, 278.262877702620, 278.294646895428, 278.106029411922, 277.786973188420, - 277.901937357612, 278.009410152606, 278.354845055124, 278.644262693781, 278.840216526960, - 278.726204045146, 278.600937232653, 278.803160024776, 278.814239641429, 278.406107089989, - 278.204915060477, 278.086114594041, 277.967943887986, 278.030839062421, 278.631386341730, - 278.299910112812, 278.884560848832, 278.886180066033, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 277.403818020342, - 277.385736612011, 277.419079763626, 277.484883608931, 277.520716730724, 277.513550730617, - 277.891587970187, 278.087015712643, 278.064211437361, 278.083756882686, 278.081608204113, - 278.004930191931, 277.667983116988, 277.465515703008, 277.770465817560, 277.486273012311, - 277.812487190729, 277.521348154187, 277.263007792215, 277.559643310698, 277.428266858300, - 277.713431147430, 277.934927582205, 278.100297973144, 278.141264584283, 278.086993250781, - 278.379658327306, 278.359962783622, 278.333521305086, 278.570844647226, 278.406928088404, - 278.423636196882, 278.392152949565, 278.201452070097, 277.856477990354, 277.873435248789, - 278.096769778375, 278.407680402316, 278.908043981651, 278.827575506572, 278.712139062362, - 278.769591044403, 278.756261553376, 278.826156376636, 278.419163229658, 278.090389246096, - 278.124356160438, 278.035593626588, 278.254910218263, 277.366924718560, 278.253233151469, - 278.902280750162, 279.023193013234, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 277.489905843838, 277.288144403828, - 277.451382178926, 277.543372549140, 277.562640697184, 277.535439380058, 277.787699174599, - 277.995109516110, 278.012353528589, 278.018214990669, 278.026842232206, 278.025758889394, - 278.001468911932, 277.958981418954, 277.934824068020, 277.751018859661, 277.513289938194, - 277.478190521822, 277.696713037172, 277.504466132445, 277.486066884529, 277.853056781128, - 278.077295875773, 278.234774297493, 278.327662456752, 278.433621081338, 278.296684198791, - 278.342578057961, 278.285379040344, 277.983925074627, 278.248926266098, 278.525007446921, - 278.445876128392, 278.104398493173, 277.910536085917, 277.940945008878, 278.081826796893, - 278.529637105590, 278.698715957456, 278.794762804276, 278.861716433298, 278.335244079482, - 278.692137237630, 278.680804581213, 278.556629862749, 278.398770705898, 278.455259276313, - 278.292491405216, 278.409341863253, 278.567127873446, 278.775114227671, 278.952795140027, - 279.084767747687, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 277.524648375830, 277.496311267119, 277.564912458774, - 277.619013556894, 277.606746819707, 277.595920519719, 277.854151971529, 278.023987432708, - 278.002073841870, 277.986021680999, 278.024941876269, 278.000914649286, 277.592433020840, - 277.681860660305, 277.885631704720, 277.778259318705, 277.871014021210, 277.876428015559, - 277.788723284443, 277.787820645805, 277.938530551964, 277.864376078717, 278.173275923391, - 278.289334853041, 278.451226379450, 278.501430038586, 278.374869508469, 278.453566275875, - 278.262940769041, 278.201339865362, 278.504357434437, 278.550458514972, 278.415280015529, - 278.309083469218, 278.099364666955, 278.034272070086, 278.181290664566, 278.418559586295, - 278.627322595506, 278.729885168807, 278.788171788983, 278.676468137618, 278.430465953748, - 278.583736392926, 278.738818934276, 278.497103463576, 278.513281650723, 278.121679354076, - 278.516294602332, 278.829577561129, 278.956682360007, 279.057955060579, 279.348107461088, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 277.474572686648, 277.620526101819, 277.579876191216, 277.360462826964, - 277.549474136816, 277.588274409193, 277.894949427885, 278.083728110620, 277.555347984217, - 277.733247247895, 278.015445953589, 277.664549184972, 277.226566090387, 277.319835583899, - 277.669759532369, 277.815087621214, 277.874161852679, 278.107783063761, 278.140316595456, - 278.161088443851, 278.102908173169, 278.119213950167, 278.224356967513, 278.368545269317, - 278.424386685907, 278.174769159603, 278.434721663051, 278.475700763337, 278.510069020504, - 278.551175436030, 278.571361830045, 278.638092447369, 278.646605205673, 278.513270253124, - 278.141327144780, 278.115950680075, 278.337373363097, 278.274464616686, 278.499148651879, - 278.595423351542, 278.569133302757, 278.443504364184, 278.470116786663, 278.405474202063, - 278.476174607142, 278.351734796539, 278.057044240619, 278.525864307774, 278.636236054564, - 278.673533956426, 278.958480628853, 279.107513277297, 279.177226197697, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 277.580570122543, 277.634318472725, 277.659616485035, 277.618057346549, 277.522030659488, - 277.362267071782, 277.372186333198, 278.055229170801, 277.784391394722, 277.537574683026, - 277.784340466299, 277.547947537627, 277.451990151210, 277.480643933265, 277.666856164943, - 277.711808172746, 277.673179528355, 278.161015825933, 277.956039470577, 278.147107822033, - 277.923934558538, 278.104047544295, 277.992356939665, 278.206672410603, 278.508947854374, - 278.256305068195, 278.356204246512, 278.556714187128, 278.604795250140, 278.664440436865, - 278.766423700238, 278.736535640997, 278.720042846867, 278.499145050840, 278.185061618328, - 278.500779492250, 278.288933571022, 278.296811610179, 278.411719697789, 278.517980608444, - 278.463145591579, 278.387209307015, 278.498542676419, 278.586457379716, 278.312529862807, - 278.273753392221, 278.452376606509, 278.515187531602, 278.424686213262, 278.745884182673, - 279.143006916710, 278.919075152226, 279.321139034238, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 277.662378493687, - 277.678435934163, 277.662375895032, 277.591158494953, 277.510569010252, 277.571350359624, - 277.754121208130, 277.990973977522, 277.757628494100, 277.561287021943, 277.486634316690, - 277.525042945477, 277.532619439937, 277.572471674363, 277.443489464657, 277.644319445620, - 277.665981899947, 278.128702193914, 278.134993079919, 277.939643867877, 277.829674444778, - 277.920407262541, 278.225109521812, 278.454420846245, 278.335636048648, 278.439755866968, - 278.556282205556, 278.641783528936, 278.681789272875, 278.705946366072, 278.807551296203, - 278.775139246657, 278.816740548483, 278.723779732785, 278.140623274423, 278.551611396458, - 278.438468292334, 278.371046387243, 278.432387336449, 278.271114366293, 278.280713350360, - 278.328592293660, 278.509010393596, 278.315046309223, 278.168349319322, 278.279893722304, - 278.388489929202, 278.028546414610, 278.067008312878, 278.735603677916, 278.875197099938, - 278.916380807791, 279.081185555734, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 277.675564771386, 277.635443490043, - 277.555593388636, 277.474215655524, 277.508785537502, 277.559272826965, 277.898963108355, - 278.160478537993, 277.698446328836, 277.535506294291, 277.650670399939, 277.713715654254, - 277.734628640441, 277.634344419146, 277.955083825013, 277.839312734512, 278.032298048669, - 277.878980044522, 277.940977547635, 278.228734022884, 278.183322722407, 278.317956053497, - 278.223938712345, 278.281454807630, 278.286552318883, 278.286369796342, 278.414024043537, - 278.659360323843, 278.716814326172, 278.768624030203, 278.839142757595, 278.825723621249, - 278.854881582904, 278.492476448520, 278.560515417031, 278.575788272122, 278.498507193087, - 278.406864865871, 278.466947148140, 278.325092661631, 278.469051212641, 278.408787619500, - 278.661902048190, 278.661367318075, 278.459305901808, 278.222284106910, 278.377818887784, - 277.959327267209, 278.623834307258, 278.738685964726, 278.800554549259, 278.851954436327, - 278.995254298110, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 277.584969222118, 277.627926693726, 277.432600717237, - 277.459047042982, 277.597393070604, 277.234297430406, 277.627802486716, 277.768761653507, - 277.858521156621, 277.718058564950, 277.536424253963, 277.886264022321, 277.953425182639, - 277.898146408245, 277.845543290783, 278.043517097872, 278.101299101003, 278.285342963779, - 278.272056517909, 277.993274994819, 277.857694108392, 278.387036994248, 278.124588570184, - 278.166963674206, 278.394923902234, 278.402876708228, 277.959213287923, 278.570898673058, - 278.714369994443, 278.790925545959, 278.865460063705, 278.887653108598, 278.925165577904, - 278.445683950808, 278.454662353423, 278.661881572607, 278.503970146357, 278.416849170500, - 278.313604733026, 278.551157387306, 278.536725681615, 278.621164456571, 278.693420303848, - 278.659085456184, 278.410157301715, 278.248100222314, 278.068519937287, 277.489258886793, - 278.582901560003, 278.758730417454, 278.753965383538, 278.760787016072, 279.095432709613, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 277.617881541072, 277.711309115784, 277.528121492641, 277.692656014265, - 277.729855515134, 277.324286569399, 277.806867446539, 277.771307124788, 277.941974315568, - 277.793422663721, 277.560140843400, 277.640329086171, 277.719016393704, 277.775996718354, - 277.776543735559, 278.069109429862, 278.047555848040, 278.042547866743, 277.879970814221, - 278.078945404616, 278.172068463404, 278.338754643149, 278.107330216076, 278.112910048865, - 278.445453513808, 278.413972889685, 278.281435948761, 278.688102249953, 278.748755950831, - 278.825775954851, 278.864385587829, 278.887954649503, 278.923518570963, 278.497911197741, - 278.577311671993, 278.567434824410, 278.538279003744, 278.579915443113, 278.528959489854, - 278.497061723077, 278.590410175821, 278.685518588178, 278.714343026087, 278.633658175898, - 278.394357807741, 278.239312017157, 278.085722164932, 278.380059590956, 278.739705486505, - 278.694694263682, 278.672923745762, 278.696715687286, 278.853484672915, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 277.864490745271, 277.943292827263, 277.719654098130, 277.620485639589, 277.472319039130, - 277.693129006556, 278.133689973093, 277.965457344363, 278.104287602920, 277.823621279948, - 277.618839688350, 277.615190026184, 277.755976640115, 277.813120706528, 277.967931066943, - 277.982623081629, 277.997140146694, 277.975617671251, 278.039568336506, 277.889611169291, - 278.218105661708, 278.124968954386, 278.376454955636, 278.278665136291, 278.301183298592, - 278.397428714062, 278.196778796572, 278.746656377329, 278.846907930532, 278.786561698973, - 278.841304821452, 278.874397654021, 278.909276839009, 278.143937356126, 278.097256838341, - 278.545815137404, 278.494309833488, 278.700417405390, 278.612579318198, 278.560830208376, - 278.548054206682, 278.619008303868, 278.609079484424, 278.483923041726, 278.208681314237, - 278.090402297370, 278.747716499947, 278.515614144343, 278.526325760542, 278.605377647849, - 278.717274877437, 278.819420463325, 278.599577926182, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 278.068675398310, - 277.997973826578, 277.749167591392, 277.971702730095, 277.895766091276, 277.766323744104, - 278.114006780512, 278.215465587629, 277.865744497808, 277.621846139857, 277.619176720160, - 277.665176866961, 277.892488116900, 277.825831734535, 277.991463449834, 277.928833353682, - 277.746440198884, 277.792686927302, 277.910135077567, 277.533121937113, 278.131357931757, - 278.388181942261, 278.402417692803, 278.227304284300, 278.415814342073, 278.378254025897, - 278.601248279164, 278.758242092388, 278.847426423313, 278.280248973563, 278.725834255314, - 278.842186363034, 278.868778923155, 278.494225795144, 278.020128379151, 278.679498884784, - 278.912318616850, 278.814308937895, 278.701152379232, 278.573422817796, 278.532102069194, - 278.542072630317, 278.495785291661, 278.388540928046, 277.931685199925, 278.182962322534, - 278.499946233316, 278.539211829192, 278.586336069633, 278.553089371418, 278.596056981041, - 278.533478404021, 278.457299600740, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 278.084632811174, 277.820012443785, - 277.847308696263, 277.849503278643, 277.798568623574, 277.797575835420, 278.095663099731, - 278.176160746854, 278.055153965908, 277.658857926577, 277.600990658349, 277.654026836536, - 277.704990323093, 277.793048321917, 277.910121578336, 277.820873697740, 277.745501713345, - 277.917800418041, 277.944391515021, 278.049145512055, 278.043694650275, 278.359223099294, - 278.070771695770, 278.214994954607, 278.330759821265, 278.205028068094, 278.559361787443, - 278.733217829340, 278.744268100279, 278.596208016795, 278.640483841563, 278.694916381717, - 278.907613386036, 278.818024141397, 278.832740735832, 278.864929258857, 279.066035941021, - 278.954370093400, 278.808689512194, 278.608053707239, 278.495744514278, 278.455081259502, - 278.372791655716, 278.141900258419, 278.157538472382, 278.129509127672, 278.226019505944, - 278.517786152116, 278.439174014992, 278.709414812548, 278.622228174999, 278.479038464346, - 278.411419063810, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 278.059317675418, 277.775909541424, 277.981685147100, - 277.820433102725, 277.757691649352, 277.791125337952, 278.114244862593, 278.017847302545, - 277.739587601083, 277.595204498445, 277.444481155752, 277.508867798333, 277.654580807842, - 277.801555631030, 277.946216001618, 277.717518898982, 277.766353468943, 277.682654248428, - 277.981754049258, 278.135151366502, 278.237042418896, 278.307870507241, 278.340706625625, - 278.321035354200, 278.320273358697, 278.158571181206, 278.405855009476, 278.698752162175, - 278.489714021957, 278.447399946515, 278.208281541154, 278.274999857765, 278.742819250719, - 278.267292067544, 278.472633364801, 278.954199073712, 278.507525942737, 278.740647038251, - 278.712056316088, 278.578495872832, 278.539513494423, 278.291124747294, 278.285971725264, - 278.217669844021, 278.204961536595, 278.111539468452, 277.987196715585, 278.301219174750, - 278.308770143463, 278.450474529455, 278.387913656980, 278.345354979068, 278.308192795967, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 278.078766967738, 278.054694472586, 277.996546131957, 277.478107514078, - 277.498293431515, 277.439272646630, 278.170812997380, 278.031766350648, 277.926719630068, - 277.660631490707, 277.405466505229, 277.448131221500, 277.639980374018, 277.771980499881, - 277.699632610951, 277.872363280302, 277.869398539167, 277.927769742648, 277.856196077938, - 278.052767006803, 278.215030316361, 277.961917700862, 278.291818910231, 278.337805197442, - 278.117323423329, 278.455733028684, 278.701018948664, 278.676322213600, 278.350822146256, - 278.266243351366, 278.328051517560, 278.614915559626, 278.558300997375, 278.813314535584, - 278.881108562772, 278.123693523522, 278.802821050470, 278.781438747715, 278.621781876457, - 278.564387365762, 278.583461368131, 278.350036130682, 278.383351889379, 278.383019058144, - 278.217555758541, 278.167422809838, 278.238477919987, 278.226153636247, 278.084761209123, - 278.088484041540, 278.083492218972, 278.205027655804, 278.230216899737, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 278.045557859900, 277.849040307617, 277.906197759880, 277.593465692124, 277.699758481137, - 277.871410461793, 278.058125626538, 278.204525836660, 277.952696685466, 277.738482364071, - 277.391817333672, 277.414211293355, 277.713291394110, 277.795254016927, 277.757654239367, - 277.707136929518, 277.820516499087, 277.833903133206, 277.958888974124, 277.727592050621, - 277.979297315556, 278.041516057377, 278.241728050372, 278.352662301885, 278.378421828891, - 278.668011089711, 278.720413573120, 278.293463018845, 278.471858803908, 278.456120759094, - 278.451834597551, 278.400966141086, 278.228702595541, 278.199778173421, 278.229599019782, - 278.763504882934, 278.797467161442, 278.406340958912, 278.639263357618, 278.738466024170, - 278.356147734832, 278.377301134964, 278.324739430270, 278.365219303220, 278.277074392752, - 278.246691447173, 278.325438536989, 278.410510194260, 278.004569449865, 277.972537483973, - 277.956821946510, 278.172942728027, 278.345344049598, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 277.996969175390, - 277.862497775047, 277.649762377272, 277.559149409384, 277.580356760509, 277.718009367429, - 278.068756822897, 277.878009666029, 277.969360198421, 277.610090666218, 277.828347857057, - 277.544325721216, 277.732583265551, 278.116016214294, 277.972299696618, 277.687262934771, - 277.957182102556, 277.863999567218, 278.051999720662, 278.158060596001, 278.155762387840, - 278.127890904723, 278.223511374158, 278.356916537157, 278.639719890896, 278.714037786705, - 278.558389050067, 278.315362526995, 278.636748281842, 278.421360309160, 278.615746331257, - 278.298886265158, 278.533659911339, 278.333792298766, 278.643055170670, 278.858025832867, - 279.020835079354, 278.870273814320, 278.740600676717, 278.482283444293, 278.534910048501, - 278.346778954967, 278.353117018506, 278.419908994646, 278.281125729824, 278.285144148911, - 278.365767158905, 278.333351670498, 277.972629892376, 277.989686782478, 278.095826308077, - 278.302698360631, 278.382668003966, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 277.875713517719, 277.634128413762, - 277.832973471346, 277.448621515103, 277.593144967346, 277.620070785560, 278.022268231048, - 277.650661530718, 277.728550931249, 277.789574269136, 277.607135652596, 277.558983827518, - 277.867823445271, 277.980868124118, 278.152155038418, 277.872425545108, 278.032213134824, - 278.055596269546, 277.794984263919, 277.846180947964, 278.137493702594, 278.095071965260, - 278.130969913741, 278.103726648322, 278.796162214483, 278.772300848655, 278.550498461136, - 278.394793765962, 278.623206154742, 278.611024899396, 278.578628218960, 278.276590748045, - 278.468413343561, 278.450779339504, 278.554459701664, 278.806252974651, 279.013699273923, - 278.748514001816, 278.788419863602, 278.642315613660, 278.454524896995, 278.491218667764, - 278.463773729676, 278.435969444734, 278.300796479766, 278.136749416946, 278.373140364489, - 278.132948804942, 278.027912210990, 278.148274414281, 278.336173789580, 278.280453796923, - 278.416601405752, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 277.958466871634, 277.914274026264, 277.771935237925, - 277.604840373088, 277.681191841525, 277.734814857704, 277.836253334677, 277.790546207519, - 277.679698274453, 277.762322999726, 277.735323729530, 277.547356221084, 277.724659181931, - 278.062792028695, 277.919073079645, 277.773076074541, 278.020996741625, 278.022325061818, - 277.919346621275, 277.950865675377, 278.008524131751, 278.023480753982, 277.924336723588, - 278.332258375312, 278.736366682898, 278.523695501482, 278.502092576710, 278.225439092820, - 278.256232776798, 278.449499552010, 278.137549943998, 278.422050300432, 278.431511965178, - 278.274661992411, 278.431568551580, 278.753808621318, 278.761885574921, 278.415607975957, - 278.555121959527, 278.654993170504, 278.544139116180, 278.520795378936, 278.533770309691, - 278.547957275597, 278.407434870158, 278.298762571130, 278.487164079960, 278.392357298054, - 278.268034972770, 278.187199824354, 278.276694644393, 278.256517908057, 278.378067854440, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 277.976299775529, 278.042031136275, 277.464188145920, 277.771621894762, - 277.784361473567, 277.859883815950, 277.814022087487, 277.852386883815, 277.843778414429, - 277.700529593730, 277.720782097285, 277.895752429155, 278.233578251075, 278.276392982912, - 277.953661711230, 277.591545218148, 277.985804556808, 277.938997069968, 277.916409711425, - 277.888611552732, 277.925456871836, 277.977042887254, 278.082218353152, 278.472003946117, - 278.646240659087, 278.404855822350, 278.163989456392, 277.954560473176, 278.556236453466, - 278.296451614769, 278.277688882445, 278.374637286269, 278.332791290590, 278.203289210287, - 278.562584129166, 278.329198281083, 278.823530241748, 278.763160870026, 278.543114999088, - 278.556718492736, 278.657498589218, 278.499789731658, 278.592487422433, 278.649244580966, - 278.669257850905, 278.201148346028, 278.586350077861, 278.457878133903, 278.245990792454, - 278.112034510986, 278.055946777769, 278.159436781041, 278.294828313829, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 278.055463728037, 277.938769906207, 277.908616747506, 277.697182984726, 277.767438599440, - 277.618954673948, 277.849284086165, 277.888500733412, 277.803726801356, 277.887984809149, - 277.963831684250, 278.063254030007, 278.264222060266, 278.247209209771, 278.010146150856, - 277.737515908542, 277.889412006510, 277.981344866797, 277.913904542254, 277.836061245756, - 277.808859499689, 277.970758433246, 278.239527080226, 278.275624726729, 278.397363141215, - 278.343527616747, 278.259845839951, 278.368292580968, 278.583172394714, 278.290379278148, - 278.385955212872, 278.352217326569, 278.420090515247, 278.134725529508, 278.418675419067, - 278.363034465810, 278.431779148022, 278.438454682849, 278.264539348808, 278.429698158323, - 278.607118714023, 278.464672697985, 278.443469155020, 278.604002661624, 278.807929770258, - 278.629594459038, 278.763699668360, 278.301897413578, 278.088831652212, 277.971815866599, - 277.908876996953, 277.949580119805, 277.929385688745, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 278.164247814763, - 278.017634128271, 278.126496201983, 278.041275562602, 277.963103307992, 277.882098915321, - 277.832817052899, 278.194630071008, 277.940734107132, 278.028855985157, 277.589337692257, - 278.007707016965, 278.159356263938, 278.097452374726, 277.964902829032, 277.890310856301, - 277.995095341973, 277.660207908446, 277.786361546086, 277.815119589775, 277.914655235766, - 278.276761510933, 278.028707200239, 278.334143087463, 278.232784850170, 278.182589303626, - 278.197293256951, 278.305926587915, 278.318792747211, 278.484167044288, 278.357400768639, - 278.328509261854, 278.448253183213, 278.163374893923, 278.104866385859, 278.044914087322, - 278.173224770928, 278.338413210359, 278.380896912261, 278.730673471804, 278.450424564609, - 278.503155223128, 278.491430165703, 278.474964969620, 278.246765035551, 278.931615118388, - 278.559599207653, 278.156636961710, 278.008740658705, 277.932135871154, 277.822627679854, - 277.736249285180, 277.878138412578, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 278.082480645173, 278.043241069493, - 277.697041095551, 277.989863518743, 277.717897740312, 277.701839125518, 277.861708621096, - 278.280953208980, 277.804372502188, 277.704826013697, 277.596403430525, 277.712365023901, - 278.034041843709, 277.947346670070, 277.846022907482, 277.820870191912, 277.874461715493, - 277.769161099427, 277.750268832592, 277.850701911325, 277.878534019060, 278.027904999404, - 278.090516114696, 278.109187477565, 278.190939004850, 278.278788556568, 278.380627825278, - 278.407390272678, 278.511725032938, 278.506674787575, 278.442874478011, 278.405398330435, - 278.395518040659, 278.357905587250, 278.210737031126, 278.122068999623, 278.170689655080, - 278.152435924905, 278.236404166308, 278.676963499355, 278.364031374287, 278.396399598455, - 278.375591815009, 278.342047071761, 278.407524619964, 278.529076426794, 278.148144221518, - 278.042521318864, 277.942078734795, 277.821562712711, 277.728530388654, 277.736969229001, - 277.907471093473, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 277.819603551272, 277.828647314803, 277.754535652466, - 277.824122707543, 277.762454320427, 277.748628587305, 278.031167797444, 277.857054897891, - 277.780437750936, 277.673341198976, 277.580777138276, 277.728655867446, 277.897137734936, - 277.750051876006, 277.442585133617, 277.536109280911, 277.666042104756, 277.637084619762, - 277.954517294964, 277.933011800326, 277.638355177335, 277.771459546012, 277.907366166404, - 278.038032680944, 278.223370782900, 278.077760957702, 278.513395348027, 278.519194273139, - 278.542309039934, 278.482080267916, 278.340394482155, 278.341759181533, 278.301704207586, - 278.255804929780, 278.195762993763, 278.152065600453, 278.109495057418, 278.225701450697, - 278.493902456915, 278.637437629165, 278.359832350456, 278.305034727926, 278.296015493113, - 278.356150546679, 278.036917652359, 277.636846916859, 278.031252957091, 278.053317552121, - 277.856967881711, 277.828489726312, 277.819981618468, 277.859938918796, 277.956551311373, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 277.884653219230, 277.884698802114, 277.844277877433, 277.934802186492, - 277.864463150351, 277.803952962222, 277.862512817816, 278.030331030810, 277.751952165263, - 277.680464702272, 277.585446567641, 277.958894193742, 277.524642689383, 277.589772555767, - 277.547487191290, 277.553287779719, 277.547903182893, 277.780326455565, 278.007585878669, - 277.822118711121, 277.682976359764, 277.843136947080, 277.894178961775, 277.954909292289, - 278.221226702389, 278.236512222249, 278.471628587781, 278.517076530718, 278.553486136797, - 278.548068978131, 278.394215898281, 278.289120256620, 278.234843510822, 278.157199428167, - 278.206792433064, 278.242705298579, 278.226263767876, 278.437906673139, 278.580162411397, - 278.567277080119, 278.296662334949, 278.275257848275, 278.404346162035, 278.002008395328, - 277.160000000000, 277.422452606158, 278.124308422995, 278.212576318432, 278.016005178567, - 277.861666847072, 277.831807919342, 277.987901581353, 278.061939469824, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 277.932091130649, 277.951064758320, 277.839412458507, 277.841315615141, 277.806577252520, - 277.842248927079, 277.988730868827, 277.881229491595, 277.827771128070, 277.852117171922, - 277.977131550724, 277.890734880932, 277.363447936035, 277.674357318546, 277.874045802482, - 277.619616361043, 277.959695749966, 278.034434774544, 278.011503092349, 277.792532523158, - 277.883473108928, 277.906659808602, 277.859039495732, 277.950830457718, 278.150472303852, - 278.280666827875, 278.497788485655, 278.510726053483, 278.601565268380, 278.496480151954, - 278.430095137542, 278.316738350851, 278.171640925745, 278.099215960220, 278.139092052815, - 278.217292849195, 278.260283772674, 278.395024109814, 278.411196388457, 278.432581257165, - 278.381536736126, 278.363111710685, 278.429680484566, 277.793989872273, 277.160000000000, - 277.160000000000, 278.256273592222, 278.264019723457, 278.140777061859, 277.960057434051, - 277.915191160621, 277.936547331889, 278.099249337367, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 277.917465588048, - 277.806536213298, 277.829468329766, 277.894769654517, 277.878874487338, 278.213198285885, - 277.882881751217, 277.892374439465, 277.858339532912, 277.923051748953, 277.681370662730, - 277.510761769121, 277.346031782172, 277.635591850736, 277.505752171465, 277.838565919297, - 278.145230449989, 278.110256581579, 277.857261961129, 277.892771986443, 277.933046869362, - 277.858290703051, 277.761688955039, 277.868954215183, 278.100209314485, 278.316913494119, - 278.444218906419, 278.557360529658, 278.561171208143, 278.461978486569, 278.557371359122, - 278.268552022994, 278.168263392393, 278.004287261093, 278.100378738598, 278.174276275285, - 278.571381129483, 278.432024829889, 278.351912980210, 278.426658874171, 278.422291931680, - 278.425551948989, 278.455607158869, 278.142898669707, 277.160000000000, 277.160000000000, - 278.358691525700, 278.271973931751, 278.175217065772, 278.113413453687, 278.060115945570, - 278.072147299547, 278.221325526498, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 277.947472331137, 277.986181501038, - 277.984568003653, 278.110290656444, 277.897470824458, 277.874164089902, 277.898939913517, - 277.902875083266, 277.889547948396, 277.798750008214, 277.895056427821, 277.559027635660, - 277.397787394390, 277.415750853834, 277.795000812736, 278.022111292969, 278.209968407002, - 278.081682250882, 278.091845240573, 277.941999949457, 277.909072268308, 277.784844781870, - 277.659181293741, 277.950679245143, 278.025258482602, 278.291405558634, 278.461051894477, - 278.543413260710, 278.637341256470, 278.536026584681, 278.345094023061, 278.314548843661, - 278.141679812436, 277.941455855832, 278.086647453443, 278.112323026882, 278.109913998848, - 278.098115462881, 278.381213778877, 278.424512212838, 278.401413477507, 278.394564786766, - 277.894149214730, 277.375874807682, 277.160000000000, 278.149965464308, 278.077148773966, - 278.225807651780, 278.284892879974, 278.351353534523, 278.240233215773, 278.349246487147, - 278.349466760844, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, - 288.000000000000, 288.000000000000, 279.240455299468, 279.223818551588, 279.285849037670, - 279.376293488344, 279.461192356391, 279.551808319930, 279.628646083334, 279.652829397263, - 279.616525840893, 279.502069589155, 279.291108765522, 279.053106080215, 278.902689297837, - 278.875704607117, 278.947740010309, 279.107704342158, 279.293681458493, 279.389614320839, - 279.411224941796, 279.444212582782, 279.386698602138, 279.136632845345, 278.940936666674, - 279.114221831018, 279.555753115819, 279.953434278201, 280.226196904095, 280.405256334886, - 280.410401720828, 280.251580808077, 280.098019623178, 279.974301676744, 279.757509415710, - 279.521564884780, 279.499039528544, 279.701996418489, 279.925134655518, 280.065775204607, - 280.157363074379, 280.210875088178, 280.228483742292, 280.242147600516, 280.253696133409, - 280.268103214047, 280.320185953974, 280.334307179838, 280.179831259660, 279.974644702474, - 279.996541178206, 280.236144650250, 280.430297213138, 280.482837320704, 280.457167561948, - 280.368438239921, 280.237631095078, 280.139468565491, 280.058914690017, 279.931995170108, - 279.790325543831, 279.694221168621, 279.601661392615, 279.495094732655, 279.400305289408, - 279.315406421361, 279.170992589248, 279.122968987120, 279.185857037526, 279.307459658628, - 279.447414156257, 279.576963540092, 279.657803270340, 279.678727839839, 279.638593829489, - 279.510130693798, 279.301628221226, 279.100500801839, 278.988560072117, 278.974724701028, - 279.039385051036, 279.169048776781, 279.318322140061, 279.420543807447, 279.465423007055, - 279.468796093395, 279.383211173889, 279.191917158746, 279.053391934990, 279.156356824790, - 279.471311615411, 279.820168782296, 280.098305477953, 280.261471383277, 280.248379234602, - 280.089100954212, 279.926106561752, 279.809077617043, 279.659975766627, 279.501440708651, - 279.482574293529, 279.633677127367, 279.825485681103, 279.976645685896, 280.097276400764, - 280.174628702763, 280.192294527831, 280.188521244807, 280.196296494675, 280.219850928100, - 280.263243682879, 280.275020899592, 280.180917507803, 280.066804281795, 280.125290168672, - 280.362949828249, 280.587574510106, 280.668985949904, 280.616788868068, 280.490498228663, - 280.363864563528, 280.257412245478, 280.131064435118, 279.982362781387, 279.855843458162, - 279.757509415710, 279.634477520736, 279.518134627486, 279.422430448960, 279.301399537407, - 279.066598425575, 279.006454581005, 279.065626519341, 279.211698309147, 279.406079555854, - 279.575362753355, 279.659346886123, 279.668951606549, 279.614810712245, 279.477714762361, - 279.291623304116, 279.135260742427, 279.045559514167, 279.027379150504, 279.089638320405, - 279.211583967237, 279.338331974281, 279.433350101348, 279.488062705201, 279.486633431328, - 279.403907059567, 279.254061986738, 279.134288836193, 279.172764888850, 279.399447725084, - 279.708456736394, 279.964353930589, 280.087328654609, 280.053540620255, 279.905525017983, - 279.744302925125, 279.629846673388, 279.535743281599, 279.456733021908, 279.457876441006, - 279.562213433724, 279.709028445943, 279.857215561080, 280.002143931787, 280.100420803284, - 280.113627293870, 280.091559305273, 280.106995463100, 280.164566614698, 280.221223031018, - 280.227511836058, 280.166796281940, 280.117915115488, 280.205157992687, 280.436986214863, - 280.676989883592, 280.785042988379, 280.731302290760, 280.595006734245, 280.462141435025, - 280.330190871084, 280.161879579817, 280.001686564148, 279.887230312410, 279.769572487197, - 279.608579078159, 279.472969573104, 279.366345742189, 279.220731320023, 278.926872611765, - 278.881364531654, 278.941165350494, 279.107361316429, 279.349823336219, 279.555124235315, - 279.648370062780, 279.657231560791, 279.594858048980, 279.449300797769, 279.279102864990, - 279.156814192429, 279.084607276373, 279.061052842948, 279.111248941363, 279.216443498405, - 279.328441399081, 279.431749314611, 279.511274112896, 279.525624022579, 279.454617696576, - 279.326783441388, 279.211183770552, 279.203065494955, 279.353482277333, 279.594915219935, - 279.794384681630, 279.871851325538, 279.829087451263, 279.710686403636, 279.579536233063, - 279.486233234644, 279.434950888086, 279.410081522698, 279.424259919517, 279.498524989950, - 279.624358261716, 279.778090959479, 279.931023263874, 280.032330195982, 280.046737276620, - 280.015807790012, 280.018609166803, 280.078867353282, 280.150102363105, 280.176515344275, - 280.155247749047, 280.155933800506, 280.263815392429, 280.485638697495, 280.723469869937, - 280.847759525920, 280.806825122202, 280.666184573113, 280.512566217259, 280.352087346816, - 280.173428112710, 280.012091677942, 279.876825198616, 279.728295057749, 279.552723055209, - 279.402363443785, 279.254576525332, 279.074545188308, 278.792063500078, 278.765650518908, - 278.830882578465, 279.019032191087, 279.293738629448, 279.517277063162, 279.622357278294, - 279.646254737448, 279.592056672189, 279.448328891536, 279.283562199474, 279.169791999195, - 279.110905915633, 279.105703358736, 279.159043859671, 279.239997931829, 279.325754364200, - 279.426489586758, 279.520307123772, 279.551522465155, 279.502412614884, 279.403907059567, - 279.305458675206, 279.267725844962, 279.333072246429, 279.477371736632, 279.617554918081, - 279.673753966761, 279.623843723122, 279.509902009978, 279.398532989806, 279.334215665527, - 279.320437465393, 279.333072246429, 279.360399962878, 279.425917877209, 279.551751148975, - 279.712973241832, 279.857558586810, 279.950404217590, 279.981390875154, 279.965840375417, - 279.949546653266, 279.977160224490, 280.044278925559, 280.106423753550, 280.144328096658, - 280.197382742819, 280.319728586334, 280.514567200681, 280.716094816753, 280.831294290905, - 280.809912353767, 280.682078098579, 280.512966413944, 280.338595001456, 280.166338914300, - 279.997684597304, 279.819425559882, 279.641966915829, 279.479658574828, 279.323296013139, - 279.126284902505, 278.919611900491, 278.663943390116, 278.635872451253, 278.714768369034, - 278.939335879936, 279.234966887797, 279.462164262625, 279.579536233063, 279.613667293147, - 279.557754099241, 279.422258936095, 279.273099914724, 279.160301620679, 279.104045401044, - 279.120339123194, 279.186371576120, 279.254633696287, 279.324610945102, 279.415912960099, - 279.503327350163, 279.544947805340, 279.525223825895, 279.451873490740, 279.359942595239, - 279.299512895895, 279.299970263534, 279.366460084099, 279.468510238620, 279.518877849899, - 279.450730071642, 279.310718403058, 279.198949186201, 279.159386885400, 279.179282377710, - 279.227706176523, 279.276816026794, 279.339704077199, 279.455246577080, 279.610637232536, - 279.746761276187, 279.834861717709, 279.879798088271, 279.885629525673, 279.875395924743, - 279.895577271828, 279.960923673294, 280.039133539617, 280.106137898776, 280.185090987512, - 280.316469841904, 280.499531239539, 280.676532515953, 280.779268721933, 280.774980900315, - 280.668928778949, 280.494271511687, 280.303091838455, 280.126605100635, 279.943315019181, - 279.733497614647, 279.533456443403, 279.369032777070, 279.193232090709, 278.974724701028, - 278.776684513206, 278.477337393277, 278.425769191944, 278.545142145805, 278.845003804328, - 279.186257234210, 279.442668966999, 279.589884175903, 279.616983208532, 279.523623039157, - 279.377551249352, 279.241884573341, 279.128514569747, 279.069113947591, 279.093354432475, - 279.156013799060, 279.215357250261, 279.294424680907, 279.396417664474, 279.488805927615, - 279.561470211310, 279.584338593276, 279.506586094593, 279.365716861685, 279.260465133688, - 279.228049202252, 279.263152168569, 279.346850446563, 279.384926302536, 279.287735679182, - 279.118681165502, 279.009884838300, 278.999765579281, 279.055793115096, 279.139091196406, - 279.206552923204, 279.259093030770, 279.356112141259, 279.517105550297, 279.681186190900, - 279.784379764520, 279.807991368899, 279.779234378578, 279.764598614120, 279.813822806301, - 279.907468830450, 279.993796972370, 280.053540620255, 280.119458731271, 280.251409295212, - 280.463342025078, 280.675217583990, 280.789616664772, 280.782813321138, 280.675389096854, - 280.489526322429, 280.273134258080, 280.072292693467, 279.874195334690, 279.652486371533, - 279.437866606786, 279.233594784879, 279.015659104747, 278.793149748221, 278.609916837722, - 278.278039444447, 278.221211515262, 278.401014168466, 278.772568204452, 279.153212422270, - 279.444384095647, 279.618984191954, 279.628074373785, 279.498410648040, 279.344049069773, - 279.206610094159, 279.080376625709, 279.029322962971, 279.074373675443, 279.126685099190, - 279.162645629830, 279.242742137665, 279.351767148686, 279.452445200289, 279.569245461179, - 279.648770259464, 279.570846247916, 279.375721778795, 279.219645071880, 279.156013799060, - 279.166704767629, 279.232965904375, 279.254862380107, 279.131601801312, 278.940307786170, - 278.834598690534, 278.852035831783, 278.945624684977, 279.059509227166, 279.135375084336, - 279.175966462325, 279.264581442442, 279.446042053339, 279.658031954160, 279.793812972081, - 279.790782911470, 279.698680503104, 279.650028020472, 279.710629232681, 279.826171732562, - 279.931480631514, 280.008375565873, 280.071149274369, 280.185319671332, 280.405427847751, - 280.652120518204, 280.782241611589, 280.760745332541, 280.639542908123, 280.451907834096, - 280.226482758870, 280.002544128472, 279.780835165315, 279.552780226163, 279.330785408232, - 279.096041467356, 278.847748010164, 278.625009969819, 278.440576469267, 278.096350149730, - 278.070394536199, 278.305481502805, 278.723172499407, 279.140120273594, 279.458219466736, - 279.619441559593, 279.587482995796, 279.450272704003, 279.311976164066, 279.151897490307, - 278.991590132728, 278.964262416279, 279.057565414699, 279.110848744678, 279.115708275846, - 279.175451923731, 279.273671624273, 279.378923352270, 279.532427366214, 279.652257687714, - 279.582966490358, 279.372234350545, 279.184370592698, 279.073115914435, 279.055564431277, - 279.140348957414, 279.183455857419, 279.030009014430, 278.774740700739, 278.632785219688, - 278.674634358685, 278.827795346899, 278.977697590684, 279.039842418675, 279.051848319207, - 279.138576657812, 279.348279720436, 279.602690469803, 279.771058932025, 279.762711972608, - 279.633848640231, 279.556153312503, 279.607664342881, 279.721663226979, 279.841322035614, - 279.946287908836, 280.009804839746, 280.088243389888, 280.289885347869, 280.563848563817, - 280.727185982006, 280.709577327893, 280.579627747373, 280.394736879182, 280.175657779951, - 279.933024247296, 279.673182257212, 279.415970131054, 279.180025600124, 278.938421144658, - 278.683210001922, 278.455841114229, 278.261631380386, 277.941131007138, 277.966000372526, - 278.239391878925, 278.690642226061, 279.154870379962, 279.488577243795, 279.591484962640, - 279.499382554274, 279.378065787946, 279.270984589392, 279.083235173455, 278.890283200620, - 278.882622292662, 279.001137682198, 279.046359907535, 279.033553613635, 279.073458940165, - 279.153498277044, 279.279102864990, 279.478858181460, 279.608007368610, 279.522536791014, - 279.321638055446, 279.132745220410, 278.967120964025, 278.916810523700, 279.055735944141, - 279.162588458876, 278.986158892011, 278.647764009875, 278.455212233725, 278.525875533999, - 278.751586463999, 278.936991870785, 278.962775971451, 278.923213670651, 279.010285034985, - 279.265381835811, 279.562499288499, 279.744017070351, 279.719890927377, 279.567816187306, - 279.484632447906, 279.544033070062, 279.658603663709, 279.771058932025, 279.864419101400, - 279.899522067717, 279.941314035759, 280.136266992016, 280.447905867252, 280.660295964757, - 280.667213650302, 280.534005325352, 280.343283019759, 280.121574056603, 279.869335803522, - 279.580336626432, 279.282304438465, 279.009084444932, 278.747527326200, 278.486313233198, - 278.257286387813, 278.072967229170, 277.832734876621, 277.928782080877, 278.259516055054, - 278.741524375934, 279.215242908351, 279.510416548572, 279.531626972845, 279.398304305986, - 279.305801700935, 279.217586917503, 279.013715292280, 278.826308902072, 278.825336995838, - 278.901088511099, 278.911836650623, 278.914523685504, 278.944767120653, 278.984443763364, - 279.143607701844, 279.421115516997, 279.532198682394, 279.369490144709, 279.175623436596, - 279.045273659392, 278.877476906720, 278.808128538409, 278.992847893736, 279.154127157548, - 278.970494050365, 278.596996201912, 278.388550900295, 278.466303398978, 278.711623966514, - 278.898973185767, 278.883880053670, 278.801782562413, 278.914009146910, 279.254004815783, - 279.617497747126, 279.797872109880, 279.722920987987, 279.523508697248, 279.433064246574, - 279.512074506265, 279.634420349781, 279.724636116635, 279.773059915447, 279.762197434013, - 279.783636542106, 279.992196185632, 280.333335273604, 280.578827354005, 280.616388671383, - 280.501589393916, 280.301891248401, 280.061601724898, 279.796328494097, 279.497438741807, - 279.181626386862, 278.861812065073, 278.555661601509, 278.284156736622, 278.068336381822, - 277.909000930477 + 276.857846883478, 276.794176778727, 277.181087123710, 277.271328891367, 277.738150007595, + 277.811501271569, 277.782801498740, 277.720243049346, 277.697362352800, 277.645937156907, + 277.434690429892, 277.479415166828, 277.480779740851, 277.470370683483, 277.466233617218, + 277.519636477424, 277.546507075768, 277.533196530853, 277.638535538066, 277.660223799155, + 277.516239354148, 277.435042994882, 277.233848743540, 277.204873528392, 277.217411121384, + 277.145056043542, 277.359707505178, 277.563426568591, 277.359606573371, 277.302689400583, + 277.135925984483, 277.013670202527, 277.249004656066, 277.362196243717, 277.472882266866, + 277.551374864505, 277.332048151829, 277.879973060166, 277.925942918285, 278.260846010953, + 278.144732099878, 278.206939585072, 277.936934540523, 278.025569678971, 278.307756924958, + 278.369318574429, 278.609267078466, 278.634490902502, 278.686706704875, 278.328553888493, + 278.418908930386, 279.060194431430, 279.114168787979, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 276.922836958812, + 276.932069336471, 277.225397205068, 277.545476457484, 277.807111956190, 277.768185575062, + 277.713814690105, 277.662213334460, 277.653334089351, 277.591821807616, 277.519290878870, + 277.499671640950, 277.471580060430, 277.398162354734, 277.371544952255, 277.453879058484, + 277.474032112632, 277.458747675572, 277.588871038908, 277.540124772655, 277.464264615292, + 277.039835665510, 277.050815441941, 277.165791541588, 277.284327024201, 277.353876090779, + 277.399785414714, 277.512330802008, 277.438449711794, 277.419894070553, 277.165764618769, + 277.034846715507, 277.230872118099, 277.277310155004, 277.272952146249, 277.486209474088, + 277.453656185210, 277.613143953527, 278.070672412350, 278.079989482462, 278.338031969208, + 278.163685044856, 278.214343856183, 278.255744502346, 277.941149161137, 278.165921759503, + 278.022894706983, 278.499780589025, 278.158397461806, 278.611643581705, 278.438079674786, + 278.816122996613, 278.628190436440, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 277.048057829677, 277.280372081890, + 277.423859756998, 277.465672699176, 277.728939006340, 277.726575834584, 277.688480429396, + 277.635385647721, 277.626062350091, 277.604239400215, 277.556926439833, 277.519394378669, + 277.425044031161, 277.318865067295, 277.309205651263, 277.348943116883, 277.361861210203, + 277.430978988228, 277.477408565654, 277.638923535542, 277.418799606607, 277.017513285449, + 276.976808425920, 277.159242736589, 277.315106840602, 277.327868258207, 277.390541905514, + 277.608373786211, 277.473011211489, 277.578037079299, 277.353975261579, 277.253195520645, + 277.219244477693, 277.303161046293, 277.197720889628, 277.568280002996, 277.565774183730, + 278.056333010069, 278.360857981015, 278.182020399473, 278.393376099219, 278.363774312832, + 278.203283980677, 278.146185013281, 278.348861342242, 278.330399393385, 278.059284960522, + 277.920499351734, 278.030061320993, 278.226766351540, 278.217750387710, 278.516389162421, + 278.535938385310, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 277.255920436446, 277.480949345724, 277.444597425498, + 277.647882845088, 277.496111688818, 277.670322939349, 277.765213822002, 277.666760657851, + 277.656928637994, 277.678906056191, 277.667906868059, 277.539641562735, 277.369487702737, + 277.285648882293, 277.326341650870, 277.351600146853, 277.359573895370, 277.493766228910, + 277.649003177440, 277.460872384943, 277.243514998577, 277.056578101319, 277.226617780177, + 277.271740370610, 277.294132332584, 277.308093611741, 277.378433184955, 277.570114302521, + 277.548859645865, 277.723889890260, 277.429263433352, 277.272737053512, 277.398599847739, + 277.309448997716, 277.328344724582, 277.207058029377, 277.696248070705, 277.835043755662, + 278.062452681475, 277.850550227440, 278.265559859820, 278.272872090840, 278.465229599008, + 278.217031341802, 278.386132964535, 278.224365564792, 278.232702192636, 278.099733855522, + 278.082038386312, 278.064057694079, 278.385342869231, 278.700953905968, 278.673157999290, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 277.459327717938, 277.559547836427, 277.422638507574, 277.572825627337, + 277.571463907280, 277.548694860479, 277.544037804342, 277.524653326012, 277.693130140178, + 277.706143234839, 277.497931516767, 277.349914202908, 277.161676307980, 277.258114023397, + 277.410663587516, 277.481076538026, 277.519833710823, 277.631696408897, 277.418308903785, + 277.304804629716, 277.259147844963, 277.382350427133, 277.299040041596, 277.256710875078, + 277.280373232168, 277.342518042564, 277.164290846344, 277.428166532894, 277.401545619979, + 277.739369780501, 277.395945166703, 277.460368035024, 277.476322888924, 277.493513518766, + 277.351824398612, 277.358401183558, 277.509306514214, 278.029530363332, 278.214265489018, + 278.152451178774, 278.452249056059, 278.282135844771, 278.031146456185, 278.126155437803, + 278.340924990343, 278.274408568623, 278.095792700955, 278.045155910991, 278.044971189736, + 278.227690671411, 278.277414153890, 278.322932576059, 278.574745416009, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 277.352885697217, 277.465676965878, 277.313718088585, 277.571636446583, 277.752813057885, + 277.876072319293, 277.600399390414, 277.629804333290, 277.509786900336, 277.350032286595, + 277.710697230771, 277.302689293788, 276.964102591939, 277.129868245471, 277.506377821286, + 277.620243311629, 277.670677617944, 277.590396381881, 277.259332104000, 277.282466682171, + 277.510494889930, 277.420372093899, 277.372440940559, 277.334025248344, 277.133405320679, + 277.432373537602, 277.458193421654, 277.573994485106, 277.560836748035, 277.504546294795, + 277.722963359918, 277.429148743501, 277.415671650080, 277.296250262619, 277.426094729653, + 277.013478567167, 277.173619712680, 277.722720050144, 278.152541665310, 278.471048817117, + 278.595955610324, 278.466217631891, 278.437646585921, 278.321089675788, 278.198112904595, + 277.952153564447, 278.065664545600, 278.357066253341, 277.965448681613, 278.124513612433, + 278.162667811909, 278.277405316586, 278.574537792479, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 277.390479450263, + 277.345673673084, 277.364302907561, 277.605928275352, 277.789929872344, 277.903984493908, + 277.966933216759, 277.912882971090, 277.703988459187, 277.351015681331, 277.674063100141, + 277.408395530420, 277.007259003699, 276.877336007904, 277.057623772846, 277.601455267293, + 277.323874590069, 277.238673158792, 277.337325747808, 277.439493917521, 277.541788857115, + 277.749810750892, 277.278504087019, 277.414256185858, 277.429899941764, 277.493551649852, + 277.511929075685, 277.190651115649, 277.443504438646, 277.605668250438, 277.771466436681, + 277.767262688689, 277.716100034677, 277.618374865972, 277.415460290735, 277.086306373890, + 277.176226842383, 277.650329975958, 277.765271071796, 278.463221024006, 278.702998001410, + 278.624355987396, 278.467009674144, 278.568028046137, 278.284237092204, 278.456297664446, + 278.609188468591, 278.571107283134, 278.248413926530, 278.155161517380, 278.404700226527, + 278.246987177160, 278.091060834030, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 277.419054703888, 277.313454081577, + 277.427414463702, 277.682584699189, 277.791193561005, 277.837885785253, 277.920062626646, + 277.919899324178, 277.689677224346, 277.410500912168, 277.630756408261, 277.629189004816, + 277.397411408199, 277.319060037245, 277.402102256687, 277.322768000649, 277.822242558531, + 277.887351499372, 277.454007146918, 277.676721339532, 277.602004218075, 277.714201570065, + 277.566677175978, 277.587799289763, 277.530615330753, 277.556498697055, 277.452480002766, + 277.522252203614, 277.645085515486, 277.845531596217, 277.946658451859, 277.602481754126, + 277.727335587639, 277.560791900289, 277.284230600351, 277.484662737021, 277.763836962967, + 277.845000815162, 278.010847594804, 278.693344887027, 278.809251065654, 278.723035732378, + 278.424896815390, 278.623465372965, 278.347354282196, 278.788885219380, 278.765666653428, + 278.053095427463, 278.334108537083, 278.163143059112, 278.791210402345, 278.564612083899, + 278.156097707067, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 277.260418446226, 277.335071352700, 277.491938938790, + 277.691206395263, 277.704209378278, 277.669286596309, 277.754719412166, 277.870079071509, + 277.502780644528, 277.754473095834, 277.727974436459, 277.557807112427, 277.336457025286, + 277.383919705566, 277.656951776528, 277.778531969694, 277.546679431981, 277.433886594239, + 277.849054763829, 277.827905512882, 277.852324775739, 277.715592971272, 277.705949179344, + 277.784233780020, 277.513796321220, 277.651505656888, 277.679417351708, 277.712133821933, + 277.640023428435, 277.845573550891, 277.939074922095, 277.983471194163, 277.686692172136, + 277.654194453924, 277.864032570137, 277.868319164885, 277.949388853803, 278.090141829888, + 278.064378565379, 278.473111038064, 278.567543171754, 278.829326294043, 278.294846275015, + 278.860106433048, 278.796593070403, 278.824386010090, 278.760223015153, 278.048034602279, + 278.456786976534, 278.270707527732, 278.883481216381, 278.331828953117, 278.594265837323, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 277.265976322594, 277.170431045594, 277.485489657589, 277.518150163777, + 277.594346099824, 277.525106574839, 277.660446242218, 277.653585064744, 277.344627321906, + 277.549004645704, 277.850802344347, 277.583257392330, 277.353933834212, 277.483162324227, + 277.802093742320, 277.620873269675, 277.778845766219, 277.705264213562, 277.541346709049, + 277.429472445857, 277.832567758240, 277.874496054447, 277.713531133238, 277.960569830321, + 277.669206881492, 277.755260958946, 277.586916719101, 277.841135564379, 277.718811273917, + 277.786742393662, 277.829134182740, 277.760954990401, 277.727290357312, 277.802718821044, + 277.926844650633, 277.940517920966, 277.860498676370, 277.948632515039, 278.482136788291, + 278.576025918865, 278.759903750249, 278.682290037298, 278.803929269590, 278.813600952805, + 278.879253548731, 278.646151177629, 278.776315233178, 278.693319468861, 278.379375494188, + 278.648541321932, 278.852157864598, 278.997643614525, 279.027698942229, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 277.366680878019, 277.381150787692, 277.486313780854, 277.312232782158, 277.401101882668, + 277.567697032357, 277.761418956830, 277.631564641376, 277.355216207498, 277.579622423646, + 277.946803922538, 277.745864795866, 277.554670208171, 277.653554412702, 277.886277698790, + 277.865648942958, 277.749235588755, 277.653323813329, 277.549350491474, 277.771809470937, + 277.894339690909, 277.969462462647, 278.118951046477, 278.108173032796, 277.923612184096, + 277.725656808996, 277.917004359488, 278.013510348155, 277.903413295852, 277.848269398192, + 277.837731396906, 277.733960635088, 277.766101554254, 277.546687146201, 277.856867293302, + 277.905478550194, 277.736223835135, 278.472986192106, 278.717220540209, 278.760841954155, + 278.638659440517, 278.681901711759, 278.363012975511, 278.807884722018, 278.838462052377, + 278.928798765744, 278.952453872397, 278.865733112592, 278.729566964511, 278.884998970494, + 278.942907006798, 278.960762454434, 278.688569887665, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 277.591550421937, + 277.499030877279, 277.305275168613, 277.541796080983, 277.195139366615, 277.331665964937, + 277.445626505916, 277.215335680856, 277.530907774801, 277.843341282378, 277.963214149135, + 277.927219319293, 277.797424178773, 277.813442210719, 277.933664495794, 277.858047474598, + 277.696277323311, 277.361473125741, 277.479932829295, 277.389415841575, 277.553020377427, + 277.924940171380, 278.159459379598, 278.037019105043, 277.914055069608, 277.647200588818, + 277.916937939818, 277.909534469069, 277.749633166238, 277.904591816623, 277.826866398276, + 277.903480594745, 277.699082807175, 277.688363481753, 277.605172407277, 277.842865865160, + 278.021216292518, 278.414517122505, 278.681556989763, 278.680320091635, 278.574125022233, + 278.370197434153, 278.734504756703, 278.493143759543, 278.779235286269, 278.935546444982, + 278.663643683160, 278.899996705338, 278.900791563301, 278.879832866026, 278.858705900529, + 278.815825789004, 278.824798215775, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 277.567216721718, 277.522475814565, + 277.303456918119, 277.208997427907, 277.424224609638, 277.567326891009, 277.516826173608, + 277.498907180864, 277.469773038402, 277.832555441150, 277.982833034908, 278.034185232461, + 277.939076079863, 277.902634532238, 277.970739026974, 277.895772802147, 277.735591951345, + 277.571305898374, 277.401061840836, 277.802603400487, 277.964968147081, 278.120946309288, + 278.120357306337, 278.027951015641, 277.674224913903, 277.745718315661, 277.676284056601, + 277.869144896292, 277.970562609159, 277.897871250900, 277.988896836592, 277.828464108029, + 277.787944526233, 277.592034339979, 277.887975166605, 277.726333366592, 278.031409362000, + 278.341449368467, 278.429430372404, 278.651974989787, 278.066148305173, 278.615426251337, + 278.658109595447, 278.764842621618, 278.797171571925, 278.930322025553, 278.589836306622, + 278.878563250804, 278.928365819420, 278.890061138998, 278.711334675770, 278.384119162997, + 278.646351915830, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 277.663311094642, 277.507469698425, 277.389870268662, + 277.406179041586, 277.420737084474, 277.458518864884, 277.735139471721, 277.538528827908, + 277.851206036120, 277.883910964943, 277.957774069964, 277.977068942386, 277.944430734847, + 277.548495261116, 277.973300201287, 277.918203113366, 277.766347699266, 277.602195991588, + 277.779284913253, 277.876179934937, 277.970720881483, 278.083009243663, 278.104572434708, + 277.809070170494, 277.861807626314, 277.891365545407, 277.598480819644, 277.808955771559, + 277.877037325444, 277.848094780278, 277.931719704904, 277.914973085381, 277.584619210738, + 277.926657140828, 278.195616408992, 278.085463190691, 277.980335449674, 278.380371866981, + 278.427298049019, 278.662228114450, 278.596051250816, 278.616744598565, 278.803046455795, + 278.791647475311, 278.497809355494, 278.866809060531, 278.869411961323, 278.852587248998, + 278.873678034993, 278.840736102112, 278.718548564065, 278.079520049554, 278.242255144442, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 277.663037557399, 277.570818671989, 277.407747457760, 277.335813345664, + 277.408696086859, 277.372137478768, 277.687262360450, 277.795853080682, 277.908241927909, + 277.869637561962, 277.892224175058, 277.606701811400, 277.922429208801, 277.536273731865, + 277.514854228159, 277.491556490133, 277.238066098239, 277.372640648916, 277.841348851264, + 277.929444260057, 277.976213790096, 278.044032057611, 277.835719155503, 277.767503822122, + 277.843943315539, 277.920171435982, 277.647907981291, 277.916193738411, 277.839013360636, + 277.803033017271, 277.864319377224, 277.746027317625, 277.651770176824, 278.063583343182, + 278.140685366536, 278.122090447834, 278.051809880199, 278.142408676546, 278.306266717218, + 278.732451854741, 278.748488287575, 278.749619678915, 278.800360568621, 278.706276462243, + 278.492046737934, 278.862935429038, 278.836729260372, 278.789661732480, 278.792523085067, + 278.785266852082, 278.004813712433, 278.206206534037, 278.268595922962, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 277.655861325454, 277.470105519071, 277.399821904234, 277.079715748819, 277.206531740859, + 277.468381791645, 277.363994499400, 277.823385911566, 277.933105323249, 277.866664229846, + 277.852775583871, 277.877579704086, 277.963875663629, 277.928717010393, 277.828398792983, + 277.296954832861, 277.401013285608, 277.627465823518, 277.658221668447, 277.774377222669, + 277.868027943365, 278.023351410815, 277.746712993709, 278.009216578254, 277.993159001656, + 277.680853664988, 277.661928822189, 277.876061141195, 277.861750611024, 277.598049579725, + 277.828212743813, 277.655101339813, 277.951762031896, 277.838019817885, 278.179159164042, + 278.237226454496, 278.178567686687, 278.271357845148, 278.743948910507, 278.860705502890, + 278.683448271915, 278.784519721920, 278.823631988977, 278.720806055127, 278.798185740840, + 278.751147075398, 278.657468304086, 278.445253830843, 278.647530368995, 278.649158962300, + 278.320344550426, 278.521904549617, 278.418647841440, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 277.402768933310, + 277.337648751023, 277.288997139047, 277.307430980466, 277.273543109168, 277.307022035080, + 277.641453325741, 277.844770093515, 277.953627149863, 277.942556409526, 278.215884948157, + 277.975149183501, 277.975145850398, 277.900981141501, 277.505402827533, 277.362760181571, + 277.548236940679, 277.664353875572, 277.502568484867, 277.584445002441, 277.713270317726, + 277.965355998582, 277.690792988212, 278.006179713121, 278.001384579859, 277.828691144649, + 277.561216736042, 277.889988864492, 277.754326137754, 277.904050492162, 277.709121972134, + 277.690236890821, 278.007302124024, 278.153784599132, 278.279221305941, 278.375074001404, + 278.132932590898, 278.527166347114, 278.731939115244, 278.786940471844, 278.668914201410, + 278.548949997938, 278.592784358004, 278.703220908555, 278.607776530910, 278.504228677905, + 278.163645789480, 278.248484564569, 278.501193898172, 278.642560007634, 278.370053886907, + 278.408249992376, 278.403262082509, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 277.207648756580, 277.331137219044, + 277.479780517975, 277.377551184413, 277.272600399963, 277.500350726646, 277.705863349177, + 277.864606993211, 277.966389026012, 278.042544067771, 278.322542195089, 278.031457007641, + 277.941373758310, 277.636410155692, 277.858031016031, 277.252349029484, 277.532160327080, + 277.374767480318, 277.358447349268, 277.596000095572, 277.677202591650, 277.510417183120, + 277.771541403309, 277.999812504068, 277.710912956346, 277.651416447672, 277.782845548063, + 277.920184623648, 278.100817677521, 277.830890386789, 277.549163570987, 277.924816153170, + 277.939889612067, 278.226842544695, 278.334446154499, 278.384165815707, 278.595962695245, + 278.279446869139, 278.639495704751, 278.773812076980, 278.436948614430, 278.920203762416, + 278.841422131634, 278.427836855974, 278.741570912682, 278.508545454593, 278.339874209391, + 278.557063084230, 278.416922724100, 278.706534660227, 278.334083779964, 278.643830203774, + 278.639844363161, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 277.374416670460, 277.500945802563, 277.426407890967, + 277.396874709479, 277.318086237064, 277.616856624914, 277.899994797892, 277.698238913389, + 277.977172419143, 278.341279558064, 278.388060688379, 278.293360918814, 277.904418999468, + 277.876108809024, 277.943923864864, 277.721133375911, 277.442202818399, 277.253739466136, + 277.509607250232, 277.667492305596, 277.591852155885, 277.835292482825, 277.968936425109, + 277.955535101385, 277.936720370208, 277.583707892174, 277.868800957519, 277.945079514213, + 278.033236526786, 277.903343895031, 278.056619912872, 278.157071041598, 278.283239136885, + 278.176795659042, 278.214399736990, 278.377534497257, 278.505800329270, 278.397309694119, + 278.669295404261, 278.768294086585, 278.677030612244, 278.800406330589, 278.667560270694, + 278.786628105936, 278.570032149640, 278.492115471478, 278.447513823625, 278.631423391505, + 278.397821811388, 278.495161908060, 278.272485916042, 278.556447973070, 278.677966110168, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 277.317281721922, 277.505968584604, 277.114499942864, 277.204273695860, + 277.333957324466, 277.623957317731, 277.644603479615, 278.000151120404, 277.641642354499, + 278.324675421874, 278.417063688056, 278.331839246209, 277.968470256881, 277.964794190107, + 278.037060222090, 277.649723985672, 277.168203186638, 277.143187050201, 277.273553266251, + 277.552393261269, 277.634517104997, 277.802271465379, 277.881739212292, 277.940910603072, + 277.879001692426, 277.745720318329, 277.913410218013, 278.101729803357, 277.802314274772, + 277.915739600581, 278.217977656900, 278.416638900017, 278.379485432682, 278.328422581059, + 278.343399135787, 278.412171676156, 278.436343517073, 278.543604914389, 278.063377717316, + 278.540875146925, 278.533646068312, 278.735677942685, 278.780712168233, 278.761366160987, + 278.038154721897, 277.866532120266, 278.165321893048, 278.680388296020, 278.573200036194, + 278.586831345728, 278.488241868816, 278.717947283378, 278.836911122056, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 277.480116247201, 277.368756132519, 277.384832941860, 277.308509322704, 277.345442414908, + 277.590676884641, 277.990539450091, 278.008983298761, 277.523442305010, 277.718274275941, + 277.715931444292, 277.879291396559, 277.831199273422, 277.864571039565, 277.936717108059, + 277.383879543378, 277.479777256307, 277.499848020363, 277.547859827789, 277.305533315021, + 277.482950172282, 277.774397519738, 277.898868170053, 277.817079364159, 277.711025079660, + 277.980058933637, 278.099658611097, 278.100938650431, 278.142922246411, 277.996704723186, + 278.305020752925, 278.407688919361, 278.163649151564, 278.023096003471, 278.332110722164, + 278.268480918882, 278.421591670262, 278.546119434891, 278.568382938671, 278.587036101537, + 278.647194694244, 278.632463274801, 278.809178187614, 278.560416104309, 278.581259006153, + 278.321975280033, 278.397446094076, 278.464681382615, 278.596423306474, 278.667946458021, + 278.738020433360, 278.814420875995, 279.011631604617, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 277.428218736626, + 277.508626172290, 277.415642785172, 277.326956949725, 277.422044581352, 277.628551397821, + 278.032568055647, 277.613158572540, 277.713901836099, 277.885738420719, 277.917749048996, + 278.013884830796, 277.837463066963, 278.076080916673, 277.808832386222, 277.917564486129, + 277.577955670404, 277.241692902309, 277.577689403392, 277.226372942221, 277.416783611213, + 277.772320420235, 277.599211176025, 277.836487250781, 277.809253831983, 277.951052110206, + 278.127684219100, 277.805451324327, 278.205782665344, 277.865170697282, 278.375832904428, + 278.485020997838, 278.294257990030, 277.778871781181, 278.041861178526, 278.230259905805, + 278.579538089333, 278.512225093511, 278.620858449128, 278.484717004610, 278.559119647309, + 278.617542855681, 278.820763331162, 278.736385000030, 278.489854683578, 278.188909713201, + 278.004895490409, 278.007836877641, 278.638253545765, 278.730478954238, 278.787710783790, + 278.859125519494, 279.227392202470, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 277.393891145112, 277.465694686045, + 277.467507921517, 277.411878635866, 277.504059151580, 277.630651160882, 277.879970074861, + 277.995167439470, 277.902552985162, 277.839877260391, 277.886479575329, 277.964201298207, + 277.748472501319, 278.029116825528, 278.009583787838, 277.934526840383, 277.918798670404, + 277.415532843179, 277.226805056122, 277.387098345780, 277.370489382575, 277.592402088486, + 277.700296833394, 277.892605230371, 277.891485508185, 278.129626663091, 278.237884596150, + 278.280404041963, 278.283057722739, 278.176984809500, 278.428645957507, 278.109976506484, + 278.299865428307, 277.995343116520, 277.977547389843, 278.172188036825, 278.514038655551, + 278.675018218984, 278.625249773115, 278.608351762487, 278.536197132141, 278.726854763747, + 278.805234471385, 278.674105241850, 278.663153403020, 278.298350908914, 278.124861199903, + 278.252964651486, 278.482059693182, 278.696680548966, 278.654309837275, 278.837647755382, + 278.841089485443, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 277.328655950263, 277.427619472960, 277.487446231366, + 277.482177271494, 277.494902394691, 277.591252248805, 277.971747475921, 278.009447854320, + 277.958400013211, 277.920394743774, 277.910344201103, 277.904280958818, 277.937158186883, + 278.076707899491, 278.062378531395, 277.668974757625, 277.800233651596, 277.541009600309, + 277.635857852503, 277.317816179233, 277.324195107430, 277.304573477618, 277.583966858675, + 277.801468375244, 277.858184963214, 278.015052891651, 278.279565568836, 278.150440976593, + 278.333103904681, 278.001182976533, 278.378488809734, 278.398697539971, 278.106032442229, + 277.965961371387, 278.143415892015, 278.377058446346, 278.574510298617, 278.436449113920, + 278.556672883167, 278.474960861679, 277.671139137360, 278.608670196079, 278.823152806552, + 278.860633331916, 278.712151986816, 278.295366943143, 277.973512496151, 278.147084138199, + 278.272905044223, 278.608690016513, 278.742172545861, 278.836415342435, 278.950088390739, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 277.310255947307, 277.438715269565, 277.535027802511, 277.514844555789, + 277.462658101701, 277.525339149085, 277.905885035111, 278.029200074722, 278.012440418427, + 277.996696426728, 277.957260620693, 277.882273913448, 277.923722117905, 278.057432597146, + 278.044128097293, 277.761271445925, 277.825323905342, 277.691879001328, 277.446628829196, + 277.285529192993, 277.207992853587, 277.564191085190, 277.712353241969, 277.873266532172, + 278.065423477158, 278.272705886866, 278.158741722804, 278.295227598450, 278.196699266996, + 278.353184502646, 278.349997851807, 278.141054038599, 277.886475692701, 277.859485979835, + 277.988073922406, 278.056957014442, 278.165448109257, 278.437202004743, 278.532793916627, + 278.729865755553, 278.336824160806, 278.305882985596, 278.713096825648, 278.851216364801, + 278.766735587507, 278.187401602110, 277.936089073750, 278.098752788839, 278.239953058972, + 278.622711192950, 278.843801280644, 278.884179584854, 278.970925282742, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 277.333993153785, 277.421151644708, 277.494771266272, 277.504859778772, 277.471450172707, + 277.495380050697, 277.897156708496, 278.087047727013, 278.045437799738, 278.056224065926, + 278.016178427298, 277.909517544432, 277.875464078132, 277.670207024597, 277.846114070057, + 277.728674807606, 277.481683080213, 277.678434290214, 277.452220611572, 277.118933743421, + 277.289809580767, 277.553585984918, 277.846040916297, 277.958533555517, 277.851453386475, + 277.929222688602, 278.241588928175, 278.028359727517, 278.357330703968, 278.540247369890, + 278.402603488606, 278.262877702620, 278.294646895428, 278.106029411922, 277.786973188420, + 277.901937357612, 278.009410152606, 278.354845055124, 278.644262693781, 278.840216526960, + 278.726204045146, 278.600937232653, 278.803160024776, 278.814239641429, 278.406107089989, + 278.204915060477, 278.086114594041, 277.967943887986, 278.030839062421, 278.631386341730, + 278.299910112812, 278.884560848832, 278.886180066033, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 277.403818020342, + 277.385736612011, 277.419079763626, 277.484883608931, 277.520716730724, 277.513550730617, + 277.891587970187, 278.087015712643, 278.064211437361, 278.083756882686, 278.081608204113, + 278.004930191931, 277.667983116988, 277.465515703008, 277.770465817560, 277.486273012311, + 277.812487190729, 277.521348154187, 277.263007792215, 277.559643310698, 277.428266858300, + 277.713431147430, 277.934927582205, 278.100297973144, 278.141264584283, 278.086993250781, + 278.379658327306, 278.359962783622, 278.333521305086, 278.570844647226, 278.406928088404, + 278.423636196882, 278.392152949565, 278.201452070097, 277.856477990354, 277.873435248789, + 278.096769778375, 278.407680402316, 278.908043981651, 278.827575506572, 278.712139062362, + 278.769591044403, 278.756261553376, 278.826156376636, 278.419163229658, 278.090389246096, + 278.124356160438, 278.035593626588, 278.254910218263, 277.366924718560, 278.253233151469, + 278.902280750162, 279.023193013234, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 277.489905843838, 277.288144403828, + 277.451382178926, 277.543372549140, 277.562640697184, 277.535439380058, 277.787699174599, + 277.995109516110, 278.012353528589, 278.018214990669, 278.026842232206, 278.025758889394, + 278.001468911932, 277.958981418954, 277.934824068020, 277.751018859661, 277.513289938194, + 277.478190521822, 277.696713037172, 277.504466132445, 277.486066884529, 277.853056781128, + 278.077295875773, 278.234774297493, 278.327662456752, 278.433621081338, 278.296684198791, + 278.342578057961, 278.285379040344, 277.983925074627, 278.248926266098, 278.525007446921, + 278.445876128392, 278.104398493173, 277.910536085917, 277.940945008878, 278.081826796893, + 278.529637105590, 278.698715957456, 278.794762804276, 278.861716433298, 278.335244079482, + 278.692137237630, 278.680804581213, 278.556629862749, 278.398770705898, 278.455259276313, + 278.292491405216, 278.409341863253, 278.567127873446, 278.775114227671, 278.952795140027, + 279.084767747687, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 277.524648375830, 277.496311267119, 277.564912458774, + 277.619013556894, 277.606746819707, 277.595920519719, 277.854151971529, 278.023987432708, + 278.002073841870, 277.986021680999, 278.024941876269, 278.000914649286, 277.592433020840, + 277.681860660305, 277.885631704720, 277.778259318705, 277.871014021210, 277.876428015559, + 277.788723284443, 277.787820645805, 277.938530551964, 277.864376078717, 278.173275923391, + 278.289334853041, 278.451226379450, 278.501430038586, 278.374869508469, 278.453566275875, + 278.262940769041, 278.201339865362, 278.504357434437, 278.550458514972, 278.415280015529, + 278.309083469218, 278.099364666955, 278.034272070086, 278.181290664566, 278.418559586295, + 278.627322595506, 278.729885168807, 278.788171788983, 278.676468137618, 278.430465953748, + 278.583736392926, 278.738818934276, 278.497103463576, 278.513281650723, 278.121679354076, + 278.516294602332, 278.829577561129, 278.956682360007, 279.057955060579, 279.348107461088, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 277.474572686648, 277.620526101819, 277.579876191216, 277.360462826964, + 277.549474136816, 277.588274409193, 277.894949427885, 278.083728110620, 277.555347984217, + 277.733247247895, 278.015445953589, 277.664549184972, 277.226566090387, 277.319835583899, + 277.669759532369, 277.815087621214, 277.874161852679, 278.107783063761, 278.140316595456, + 278.161088443851, 278.102908173169, 278.119213950167, 278.224356967513, 278.368545269317, + 278.424386685907, 278.174769159603, 278.434721663051, 278.475700763337, 278.510069020504, + 278.551175436030, 278.571361830045, 278.638092447369, 278.646605205673, 278.513270253124, + 278.141327144780, 278.115950680075, 278.337373363097, 278.274464616686, 278.499148651879, + 278.595423351542, 278.569133302757, 278.443504364184, 278.470116786663, 278.405474202063, + 278.476174607142, 278.351734796539, 278.057044240619, 278.525864307774, 278.636236054564, + 278.673533956426, 278.958480628853, 279.107513277297, 279.177226197697, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 277.580570122543, 277.634318472725, 277.659616485035, 277.618057346549, 277.522030659488, + 277.362267071782, 277.372186333198, 278.055229170801, 277.784391394722, 277.537574683026, + 277.784340466299, 277.547947537627, 277.451990151210, 277.480643933265, 277.666856164943, + 277.711808172746, 277.673179528355, 278.161015825933, 277.956039470577, 278.147107822033, + 277.923934558538, 278.104047544295, 277.992356939665, 278.206672410603, 278.508947854374, + 278.256305068195, 278.356204246512, 278.556714187128, 278.604795250140, 278.664440436865, + 278.766423700238, 278.736535640997, 278.720042846867, 278.499145050840, 278.185061618328, + 278.500779492250, 278.288933571022, 278.296811610179, 278.411719697789, 278.517980608444, + 278.463145591579, 278.387209307015, 278.498542676419, 278.586457379716, 278.312529862807, + 278.273753392221, 278.452376606509, 278.515187531602, 278.424686213262, 278.745884182673, + 279.143006916710, 278.919075152226, 279.321139034238, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 277.662378493687, + 277.678435934163, 277.662375895032, 277.591158494953, 277.510569010252, 277.571350359624, + 277.754121208130, 277.990973977522, 277.757628494100, 277.561287021943, 277.486634316690, + 277.525042945477, 277.532619439937, 277.572471674363, 277.443489464657, 277.644319445620, + 277.665981899947, 278.128702193914, 278.134993079919, 277.939643867877, 277.829674444778, + 277.920407262541, 278.225109521812, 278.454420846245, 278.335636048648, 278.439755866968, + 278.556282205556, 278.641783528936, 278.681789272875, 278.705946366072, 278.807551296203, + 278.775139246657, 278.816740548483, 278.723779732785, 278.140623274423, 278.551611396458, + 278.438468292334, 278.371046387243, 278.432387336449, 278.271114366293, 278.280713350360, + 278.328592293660, 278.509010393596, 278.315046309223, 278.168349319322, 278.279893722304, + 278.388489929202, 278.028546414610, 278.067008312878, 278.735603677916, 278.875197099938, + 278.916380807791, 279.081185555734, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 277.675564771386, 277.635443490043, + 277.555593388636, 277.474215655524, 277.508785537502, 277.559272826965, 277.898963108355, + 278.160478537993, 277.698446328836, 277.535506294291, 277.650670399939, 277.713715654254, + 277.734628640441, 277.634344419146, 277.955083825013, 277.839312734512, 278.032298048669, + 277.878980044522, 277.940977547635, 278.228734022884, 278.183322722407, 278.317956053497, + 278.223938712345, 278.281454807630, 278.286552318883, 278.286369796342, 278.414024043537, + 278.659360323843, 278.716814326172, 278.768624030203, 278.839142757595, 278.825723621249, + 278.854881582904, 278.492476448520, 278.560515417031, 278.575788272122, 278.498507193087, + 278.406864865871, 278.466947148140, 278.325092661631, 278.469051212641, 278.408787619500, + 278.661902048190, 278.661367318075, 278.459305901808, 278.222284106910, 278.377818887784, + 277.959327267209, 278.623834307258, 278.738685964726, 278.800554549259, 278.851954436327, + 278.995254298110, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 277.584969222118, 277.627926693726, 277.432600717237, + 277.459047042982, 277.597393070604, 277.234297430406, 277.627802486716, 277.768761653507, + 277.858521156621, 277.718058564950, 277.536424253963, 277.886264022321, 277.953425182639, + 277.898146408245, 277.845543290783, 278.043517097872, 278.101299101003, 278.285342963779, + 278.272056517909, 277.993274994819, 277.857694108392, 278.387036994248, 278.124588570184, + 278.166963674206, 278.394923902234, 278.402876708228, 277.959213287923, 278.570898673058, + 278.714369994443, 278.790925545959, 278.865460063705, 278.887653108598, 278.925165577904, + 278.445683950808, 278.454662353423, 278.661881572607, 278.503970146357, 278.416849170500, + 278.313604733026, 278.551157387306, 278.536725681615, 278.621164456571, 278.693420303848, + 278.659085456184, 278.410157301715, 278.248100222314, 278.068519937287, 277.489258886793, + 278.582901560003, 278.758730417454, 278.753965383538, 278.760787016072, 279.095432709613, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 277.617881541072, 277.711309115784, 277.528121492641, 277.692656014265, + 277.729855515134, 277.324286569399, 277.806867446539, 277.771307124788, 277.941974315568, + 277.793422663721, 277.560140843400, 277.640329086171, 277.719016393704, 277.775996718354, + 277.776543735559, 278.069109429862, 278.047555848040, 278.042547866743, 277.879970814221, + 278.078945404616, 278.172068463404, 278.338754643149, 278.107330216076, 278.112910048865, + 278.445453513808, 278.413972889685, 278.281435948761, 278.688102249953, 278.748755950831, + 278.825775954851, 278.864385587829, 278.887954649503, 278.923518570963, 278.497911197741, + 278.577311671993, 278.567434824410, 278.538279003744, 278.579915443113, 278.528959489854, + 278.497061723077, 278.590410175821, 278.685518588178, 278.714343026087, 278.633658175898, + 278.394357807741, 278.239312017157, 278.085722164932, 278.380059590956, 278.739705486505, + 278.694694263682, 278.672923745762, 278.696715687286, 278.853484672915, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 277.864490745271, 277.943292827263, 277.719654098130, 277.620485639589, 277.472319039130, + 277.693129006556, 278.133689973093, 277.965457344363, 278.104287602920, 277.823621279948, + 277.618839688350, 277.615190026184, 277.755976640115, 277.813120706528, 277.967931066943, + 277.982623081629, 277.997140146694, 277.975617671251, 278.039568336506, 277.889611169291, + 278.218105661708, 278.124968954386, 278.376454955636, 278.278665136291, 278.301183298592, + 278.397428714062, 278.196778796572, 278.746656377329, 278.846907930532, 278.786561698973, + 278.841304821452, 278.874397654021, 278.909276839009, 278.143937356126, 278.097256838341, + 278.545815137404, 278.494309833488, 278.700417405390, 278.612579318198, 278.560830208376, + 278.548054206682, 278.619008303868, 278.609079484424, 278.483923041726, 278.208681314237, + 278.090402297370, 278.747716499947, 278.515614144343, 278.526325760542, 278.605377647849, + 278.717274877437, 278.819420463325, 278.599577926182, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 278.068675398310, + 277.997973826578, 277.749167591392, 277.971702730095, 277.895766091276, 277.766323744104, + 278.114006780512, 278.215465587629, 277.865744497808, 277.621846139857, 277.619176720160, + 277.665176866961, 277.892488116900, 277.825831734535, 277.991463449834, 277.928833353682, + 277.746440198884, 277.792686927302, 277.910135077567, 277.533121937113, 278.131357931757, + 278.388181942261, 278.402417692803, 278.227304284300, 278.415814342073, 278.378254025897, + 278.601248279164, 278.758242092388, 278.847426423313, 278.280248973563, 278.725834255314, + 278.842186363034, 278.868778923155, 278.494225795144, 278.020128379151, 278.679498884784, + 278.912318616850, 278.814308937895, 278.701152379232, 278.573422817796, 278.532102069194, + 278.542072630317, 278.495785291661, 278.388540928046, 277.931685199925, 278.182962322534, + 278.499946233316, 278.539211829192, 278.586336069633, 278.553089371418, 278.596056981041, + 278.533478404021, 278.457299600740, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 278.084632811174, 277.820012443785, + 277.847308696263, 277.849503278643, 277.798568623574, 277.797575835420, 278.095663099731, + 278.176160746854, 278.055153965908, 277.658857926577, 277.600990658349, 277.654026836536, + 277.704990323093, 277.793048321917, 277.910121578336, 277.820873697740, 277.745501713345, + 277.917800418041, 277.944391515021, 278.049145512055, 278.043694650275, 278.359223099294, + 278.070771695770, 278.214994954607, 278.330759821265, 278.205028068094, 278.559361787443, + 278.733217829340, 278.744268100279, 278.596208016795, 278.640483841563, 278.694916381717, + 278.907613386036, 278.818024141397, 278.832740735832, 278.864929258857, 279.066035941021, + 278.954370093400, 278.808689512194, 278.608053707239, 278.495744514278, 278.455081259502, + 278.372791655716, 278.141900258419, 278.157538472382, 278.129509127672, 278.226019505944, + 278.517786152116, 278.439174014992, 278.709414812548, 278.622228174999, 278.479038464346, + 278.411419063810, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 278.059317675418, 277.775909541424, 277.981685147100, + 277.820433102725, 277.757691649352, 277.791125337952, 278.114244862593, 278.017847302545, + 277.739587601083, 277.595204498445, 277.444481155752, 277.508867798333, 277.654580807842, + 277.801555631030, 277.946216001618, 277.717518898982, 277.766353468943, 277.682654248428, + 277.981754049258, 278.135151366502, 278.237042418896, 278.307870507241, 278.340706625625, + 278.321035354200, 278.320273358697, 278.158571181206, 278.405855009476, 278.698752162175, + 278.489714021957, 278.447399946515, 278.208281541154, 278.274999857765, 278.742819250719, + 278.267292067544, 278.472633364801, 278.954199073712, 278.507525942737, 278.740647038251, + 278.712056316088, 278.578495872832, 278.539513494423, 278.291124747294, 278.285971725264, + 278.217669844021, 278.204961536595, 278.111539468452, 277.987196715585, 278.301219174750, + 278.308770143463, 278.450474529455, 278.387913656980, 278.345354979068, 278.308192795967, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 278.078766967738, 278.054694472586, 277.996546131957, 277.478107514078, + 277.498293431515, 277.439272646630, 278.170812997380, 278.031766350648, 277.926719630068, + 277.660631490707, 277.405466505229, 277.448131221500, 277.639980374018, 277.771980499881, + 277.699632610951, 277.872363280302, 277.869398539167, 277.927769742648, 277.856196077938, + 278.052767006803, 278.215030316361, 277.961917700862, 278.291818910231, 278.337805197442, + 278.117323423329, 278.455733028684, 278.701018948664, 278.676322213600, 278.350822146256, + 278.266243351366, 278.328051517560, 278.614915559626, 278.558300997375, 278.813314535584, + 278.881108562772, 278.123693523522, 278.802821050470, 278.781438747715, 278.621781876457, + 278.564387365762, 278.583461368131, 278.350036130682, 278.383351889379, 278.383019058144, + 278.217555758541, 278.167422809838, 278.238477919987, 278.226153636247, 278.084761209123, + 278.088484041540, 278.083492218972, 278.205027655804, 278.230216899737, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 278.045557859900, 277.849040307617, 277.906197759880, 277.593465692124, 277.699758481137, + 277.871410461793, 278.058125626538, 278.204525836660, 277.952696685466, 277.738482364071, + 277.391817333672, 277.414211293355, 277.713291394110, 277.795254016927, 277.757654239367, + 277.707136929518, 277.820516499087, 277.833903133206, 277.958888974124, 277.727592050621, + 277.979297315556, 278.041516057377, 278.241728050372, 278.352662301885, 278.378421828891, + 278.668011089711, 278.720413573120, 278.293463018845, 278.471858803908, 278.456120759094, + 278.451834597551, 278.400966141086, 278.228702595541, 278.199778173421, 278.229599019782, + 278.763504882934, 278.797467161442, 278.406340958912, 278.639263357618, 278.738466024170, + 278.356147734832, 278.377301134964, 278.324739430270, 278.365219303220, 278.277074392752, + 278.246691447173, 278.325438536989, 278.410510194260, 278.004569449865, 277.972537483973, + 277.956821946510, 278.172942728027, 278.345344049598, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 277.996969175390, + 277.862497775047, 277.649762377272, 277.559149409384, 277.580356760509, 277.718009367429, + 278.068756822897, 277.878009666029, 277.969360198421, 277.610090666218, 277.828347857057, + 277.544325721216, 277.732583265551, 278.116016214294, 277.972299696618, 277.687262934771, + 277.957182102556, 277.863999567218, 278.051999720662, 278.158060596001, 278.155762387840, + 278.127890904723, 278.223511374158, 278.356916537157, 278.639719890896, 278.714037786705, + 278.558389050067, 278.315362526995, 278.636748281842, 278.421360309160, 278.615746331257, + 278.298886265158, 278.533659911339, 278.333792298766, 278.643055170670, 278.858025832867, + 279.020835079354, 278.870273814320, 278.740600676717, 278.482283444293, 278.534910048501, + 278.346778954967, 278.353117018506, 278.419908994646, 278.281125729824, 278.285144148911, + 278.365767158905, 278.333351670498, 277.972629892376, 277.989686782478, 278.095826308077, + 278.302698360631, 278.382668003966, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 277.875713517719, 277.634128413762, + 277.832973471346, 277.448621515103, 277.593144967346, 277.620070785560, 278.022268231048, + 277.650661530718, 277.728550931249, 277.789574269136, 277.607135652596, 277.558983827518, + 277.867823445271, 277.980868124118, 278.152155038418, 277.872425545108, 278.032213134824, + 278.055596269546, 277.794984263919, 277.846180947964, 278.137493702594, 278.095071965260, + 278.130969913741, 278.103726648322, 278.796162214483, 278.772300848655, 278.550498461136, + 278.394793765962, 278.623206154742, 278.611024899396, 278.578628218960, 278.276590748045, + 278.468413343561, 278.450779339504, 278.554459701664, 278.806252974651, 279.013699273923, + 278.748514001816, 278.788419863602, 278.642315613660, 278.454524896995, 278.491218667764, + 278.463773729676, 278.435969444734, 278.300796479766, 278.136749416946, 278.373140364489, + 278.132948804942, 278.027912210990, 278.148274414281, 278.336173789580, 278.280453796923, + 278.416601405752, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 277.958466871634, 277.914274026264, 277.771935237925, + 277.604840373088, 277.681191841525, 277.734814857704, 277.836253334677, 277.790546207519, + 277.679698274453, 277.762322999726, 277.735323729530, 277.547356221084, 277.724659181931, + 278.062792028695, 277.919073079645, 277.773076074541, 278.020996741625, 278.022325061818, + 277.919346621275, 277.950865675377, 278.008524131751, 278.023480753982, 277.924336723588, + 278.332258375312, 278.736366682898, 278.523695501482, 278.502092576710, 278.225439092820, + 278.256232776798, 278.449499552010, 278.137549943998, 278.422050300432, 278.431511965178, + 278.274661992411, 278.431568551580, 278.753808621318, 278.761885574921, 278.415607975957, + 278.555121959527, 278.654993170504, 278.544139116180, 278.520795378936, 278.533770309691, + 278.547957275597, 278.407434870158, 278.298762571130, 278.487164079960, 278.392357298054, + 278.268034972770, 278.187199824354, 278.276694644393, 278.256517908057, 278.378067854440, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 277.976299775529, 278.042031136275, 277.464188145920, 277.771621894762, + 277.784361473567, 277.859883815950, 277.814022087487, 277.852386883815, 277.843778414429, + 277.700529593730, 277.720782097285, 277.895752429155, 278.233578251075, 278.276392982912, + 277.953661711230, 277.591545218148, 277.985804556808, 277.938997069968, 277.916409711425, + 277.888611552732, 277.925456871836, 277.977042887254, 278.082218353152, 278.472003946117, + 278.646240659087, 278.404855822350, 278.163989456392, 277.954560473176, 278.556236453466, + 278.296451614769, 278.277688882445, 278.374637286269, 278.332791290590, 278.203289210287, + 278.562584129166, 278.329198281083, 278.823530241748, 278.763160870026, 278.543114999088, + 278.556718492736, 278.657498589218, 278.499789731658, 278.592487422433, 278.649244580966, + 278.669257850905, 278.201148346028, 278.586350077861, 278.457878133903, 278.245990792454, + 278.112034510986, 278.055946777769, 278.159436781041, 278.294828313829, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 278.055463728037, 277.938769906207, 277.908616747506, 277.697182984726, 277.767438599440, + 277.618954673948, 277.849284086165, 277.888500733412, 277.803726801356, 277.887984809149, + 277.963831684250, 278.063254030007, 278.264222060266, 278.247209209771, 278.010146150856, + 277.737515908542, 277.889412006510, 277.981344866797, 277.913904542254, 277.836061245756, + 277.808859499689, 277.970758433246, 278.239527080226, 278.275624726729, 278.397363141215, + 278.343527616747, 278.259845839951, 278.368292580968, 278.583172394714, 278.290379278148, + 278.385955212872, 278.352217326569, 278.420090515247, 278.134725529508, 278.418675419067, + 278.363034465810, 278.431779148022, 278.438454682849, 278.264539348808, 278.429698158323, + 278.607118714023, 278.464672697985, 278.443469155020, 278.604002661624, 278.807929770258, + 278.629594459038, 278.763699668360, 278.301897413578, 278.088831652212, 277.971815866599, + 277.908876996953, 277.949580119805, 277.929385688745, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 278.164247814763, + 278.017634128271, 278.126496201983, 278.041275562602, 277.963103307992, 277.882098915321, + 277.832817052899, 278.194630071008, 277.940734107132, 278.028855985157, 277.589337692257, + 278.007707016965, 278.159356263938, 278.097452374726, 277.964902829032, 277.890310856301, + 277.995095341973, 277.660207908446, 277.786361546086, 277.815119589775, 277.914655235766, + 278.276761510933, 278.028707200239, 278.334143087463, 278.232784850170, 278.182589303626, + 278.197293256951, 278.305926587915, 278.318792747211, 278.484167044288, 278.357400768639, + 278.328509261854, 278.448253183213, 278.163374893923, 278.104866385859, 278.044914087322, + 278.173224770928, 278.338413210359, 278.380896912261, 278.730673471804, 278.450424564609, + 278.503155223128, 278.491430165703, 278.474964969620, 278.246765035551, 278.931615118388, + 278.559599207653, 278.156636961710, 278.008740658705, 277.932135871154, 277.822627679854, + 277.736249285180, 277.878138412578, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 278.082480645173, 278.043241069493, + 277.697041095551, 277.989863518743, 277.717897740312, 277.701839125518, 277.861708621096, + 278.280953208980, 277.804372502188, 277.704826013697, 277.596403430525, 277.712365023901, + 278.034041843709, 277.947346670070, 277.846022907482, 277.820870191912, 277.874461715493, + 277.769161099427, 277.750268832592, 277.850701911325, 277.878534019060, 278.027904999404, + 278.090516114696, 278.109187477565, 278.190939004850, 278.278788556568, 278.380627825278, + 278.407390272678, 278.511725032938, 278.506674787575, 278.442874478011, 278.405398330435, + 278.395518040659, 278.357905587250, 278.210737031126, 278.122068999623, 278.170689655080, + 278.152435924905, 278.236404166308, 278.676963499355, 278.364031374287, 278.396399598455, + 278.375591815009, 278.342047071761, 278.407524619964, 278.529076426794, 278.148144221518, + 278.042521318864, 277.942078734795, 277.821562712711, 277.728530388654, 277.736969229001, + 277.907471093473, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 277.819603551272, 277.828647314803, 277.754535652466, + 277.824122707543, 277.762454320427, 277.748628587305, 278.031167797444, 277.857054897891, + 277.780437750936, 277.673341198976, 277.580777138276, 277.728655867446, 277.897137734936, + 277.750051876006, 277.442585133617, 277.536109280911, 277.666042104756, 277.637084619762, + 277.954517294964, 277.933011800326, 277.638355177335, 277.771459546012, 277.907366166404, + 278.038032680944, 278.223370782900, 278.077760957702, 278.513395348027, 278.519194273139, + 278.542309039934, 278.482080267916, 278.340394482155, 278.341759181533, 278.301704207586, + 278.255804929780, 278.195762993763, 278.152065600453, 278.109495057418, 278.225701450697, + 278.493902456915, 278.637437629165, 278.359832350456, 278.305034727926, 278.296015493113, + 278.356150546679, 278.036917652359, 277.636846916859, 278.031252957091, 278.053317552121, + 277.856967881711, 277.828489726312, 277.819981618468, 277.859938918796, 277.956551311373, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 277.884653219230, 277.884698802114, 277.844277877433, 277.934802186492, + 277.864463150351, 277.803952962222, 277.862512817816, 278.030331030810, 277.751952165263, + 277.680464702272, 277.585446567641, 277.958894193742, 277.524642689383, 277.589772555767, + 277.547487191290, 277.553287779719, 277.547903182893, 277.780326455565, 278.007585878669, + 277.822118711121, 277.682976359764, 277.843136947080, 277.894178961775, 277.954909292289, + 278.221226702389, 278.236512222249, 278.471628587781, 278.517076530718, 278.553486136797, + 278.548068978131, 278.394215898281, 278.289120256620, 278.234843510822, 278.157199428167, + 278.206792433064, 278.242705298579, 278.226263767876, 278.437906673139, 278.580162411397, + 278.567277080119, 278.296662334949, 278.275257848275, 278.404346162035, 278.002008395328, + 277.160000000000, 277.422452606158, 278.124308422995, 278.212576318432, 278.016005178567, + 277.861666847072, 277.831807919342, 277.987901581353, 278.061939469824, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 277.932091130649, 277.951064758320, 277.839412458507, 277.841315615141, 277.806577252520, + 277.842248927079, 277.988730868827, 277.881229491595, 277.827771128070, 277.852117171922, + 277.977131550724, 277.890734880932, 277.363447936035, 277.674357318546, 277.874045802482, + 277.619616361043, 277.959695749966, 278.034434774544, 278.011503092349, 277.792532523158, + 277.883473108928, 277.906659808602, 277.859039495732, 277.950830457718, 278.150472303852, + 278.280666827875, 278.497788485655, 278.510726053483, 278.601565268380, 278.496480151954, + 278.430095137542, 278.316738350851, 278.171640925745, 278.099215960220, 278.139092052815, + 278.217292849195, 278.260283772674, 278.395024109814, 278.411196388457, 278.432581257165, + 278.381536736126, 278.363111710685, 278.429680484566, 277.793989872273, 277.160000000000, + 277.160000000000, 278.256273592222, 278.264019723457, 278.140777061859, 277.960057434051, + 277.915191160621, 277.936547331889, 278.099249337367, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 277.917465588048, + 277.806536213298, 277.829468329766, 277.894769654517, 277.878874487338, 278.213198285885, + 277.882881751217, 277.892374439465, 277.858339532912, 277.923051748953, 277.681370662730, + 277.510761769121, 277.346031782172, 277.635591850736, 277.505752171465, 277.838565919297, + 278.145230449989, 278.110256581579, 277.857261961129, 277.892771986443, 277.933046869362, + 277.858290703051, 277.761688955039, 277.868954215183, 278.100209314485, 278.316913494119, + 278.444218906419, 278.557360529658, 278.561171208143, 278.461978486569, 278.557371359122, + 278.268552022994, 278.168263392393, 278.004287261093, 278.100378738598, 278.174276275285, + 278.571381129483, 278.432024829889, 278.351912980210, 278.426658874171, 278.422291931680, + 278.425551948989, 278.455607158869, 278.142898669707, 277.160000000000, 277.160000000000, + 278.358691525700, 278.271973931751, 278.175217065772, 278.113413453687, 278.060115945570, + 278.072147299547, 278.221325526498, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 277.947472331137, 277.986181501038, + 277.984568003653, 278.110290656444, 277.897470824458, 277.874164089902, 277.898939913517, + 277.902875083266, 277.889547948396, 277.798750008214, 277.895056427821, 277.559027635660, + 277.397787394390, 277.415750853834, 277.795000812736, 278.022111292969, 278.209968407002, + 278.081682250882, 278.091845240573, 277.941999949457, 277.909072268308, 277.784844781870, + 277.659181293741, 277.950679245143, 278.025258482602, 278.291405558634, 278.461051894477, + 278.543413260710, 278.637341256470, 278.536026584681, 278.345094023061, 278.314548843661, + 278.141679812436, 277.941455855832, 278.086647453443, 278.112323026882, 278.109913998848, + 278.098115462881, 278.381213778877, 278.424512212838, 278.401413477507, 278.394564786766, + 277.894149214730, 277.375874807682, 277.160000000000, 278.149965464308, 278.077148773966, + 278.225807651780, 278.284892879974, 278.351353534523, 278.240233215773, 278.349246487147, + 278.349466760844, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, 288.000000000000, + 288.000000000000, 288.000000000000, 279.240455299468, 279.223818551588, 279.285849037670, + 279.376293488344, 279.461192356391, 279.551808319930, 279.628646083334, 279.652829397263, + 279.616525840893, 279.502069589155, 279.291108765522, 279.053106080215, 278.902689297837, + 278.875704607117, 278.947740010309, 279.107704342158, 279.293681458493, 279.389614320839, + 279.411224941796, 279.444212582782, 279.386698602138, 279.136632845345, 278.940936666674, + 279.114221831018, 279.555753115819, 279.953434278201, 280.226196904095, 280.405256334886, + 280.410401720828, 280.251580808077, 280.098019623178, 279.974301676744, 279.757509415710, + 279.521564884780, 279.499039528544, 279.701996418489, 279.925134655518, 280.065775204607, + 280.157363074379, 280.210875088178, 280.228483742292, 280.242147600516, 280.253696133409, + 280.268103214047, 280.320185953974, 280.334307179838, 280.179831259660, 279.974644702474, + 279.996541178206, 280.236144650250, 280.430297213138, 280.482837320704, 280.457167561948, + 280.368438239921, 280.237631095078, 280.139468565491, 280.058914690017, 279.931995170108, + 279.790325543831, 279.694221168621, 279.601661392615, 279.495094732655, 279.400305289408, + 279.315406421361, 279.170992589248, 279.122968987120, 279.185857037526, 279.307459658628, + 279.447414156257, 279.576963540092, 279.657803270340, 279.678727839839, 279.638593829489, + 279.510130693798, 279.301628221226, 279.100500801839, 278.988560072117, 278.974724701028, + 279.039385051036, 279.169048776781, 279.318322140061, 279.420543807447, 279.465423007055, + 279.468796093395, 279.383211173889, 279.191917158746, 279.053391934990, 279.156356824790, + 279.471311615411, 279.820168782296, 280.098305477953, 280.261471383277, 280.248379234602, + 280.089100954212, 279.926106561752, 279.809077617043, 279.659975766627, 279.501440708651, + 279.482574293529, 279.633677127367, 279.825485681103, 279.976645685896, 280.097276400764, + 280.174628702763, 280.192294527831, 280.188521244807, 280.196296494675, 280.219850928100, + 280.263243682879, 280.275020899592, 280.180917507803, 280.066804281795, 280.125290168672, + 280.362949828249, 280.587574510106, 280.668985949904, 280.616788868068, 280.490498228663, + 280.363864563528, 280.257412245478, 280.131064435118, 279.982362781387, 279.855843458162, + 279.757509415710, 279.634477520736, 279.518134627486, 279.422430448960, 279.301399537407, + 279.066598425575, 279.006454581005, 279.065626519341, 279.211698309147, 279.406079555854, + 279.575362753355, 279.659346886123, 279.668951606549, 279.614810712245, 279.477714762361, + 279.291623304116, 279.135260742427, 279.045559514167, 279.027379150504, 279.089638320405, + 279.211583967237, 279.338331974281, 279.433350101348, 279.488062705201, 279.486633431328, + 279.403907059567, 279.254061986738, 279.134288836193, 279.172764888850, 279.399447725084, + 279.708456736394, 279.964353930589, 280.087328654609, 280.053540620255, 279.905525017983, + 279.744302925125, 279.629846673388, 279.535743281599, 279.456733021908, 279.457876441006, + 279.562213433724, 279.709028445943, 279.857215561080, 280.002143931787, 280.100420803284, + 280.113627293870, 280.091559305273, 280.106995463100, 280.164566614698, 280.221223031018, + 280.227511836058, 280.166796281940, 280.117915115488, 280.205157992687, 280.436986214863, + 280.676989883592, 280.785042988379, 280.731302290760, 280.595006734245, 280.462141435025, + 280.330190871084, 280.161879579817, 280.001686564148, 279.887230312410, 279.769572487197, + 279.608579078159, 279.472969573104, 279.366345742189, 279.220731320023, 278.926872611765, + 278.881364531654, 278.941165350494, 279.107361316429, 279.349823336219, 279.555124235315, + 279.648370062780, 279.657231560791, 279.594858048980, 279.449300797769, 279.279102864990, + 279.156814192429, 279.084607276373, 279.061052842948, 279.111248941363, 279.216443498405, + 279.328441399081, 279.431749314611, 279.511274112896, 279.525624022579, 279.454617696576, + 279.326783441388, 279.211183770552, 279.203065494955, 279.353482277333, 279.594915219935, + 279.794384681630, 279.871851325538, 279.829087451263, 279.710686403636, 279.579536233063, + 279.486233234644, 279.434950888086, 279.410081522698, 279.424259919517, 279.498524989950, + 279.624358261716, 279.778090959479, 279.931023263874, 280.032330195982, 280.046737276620, + 280.015807790012, 280.018609166803, 280.078867353282, 280.150102363105, 280.176515344275, + 280.155247749047, 280.155933800506, 280.263815392429, 280.485638697495, 280.723469869937, + 280.847759525920, 280.806825122202, 280.666184573113, 280.512566217259, 280.352087346816, + 280.173428112710, 280.012091677942, 279.876825198616, 279.728295057749, 279.552723055209, + 279.402363443785, 279.254576525332, 279.074545188308, 278.792063500078, 278.765650518908, + 278.830882578465, 279.019032191087, 279.293738629448, 279.517277063162, 279.622357278294, + 279.646254737448, 279.592056672189, 279.448328891536, 279.283562199474, 279.169791999195, + 279.110905915633, 279.105703358736, 279.159043859671, 279.239997931829, 279.325754364200, + 279.426489586758, 279.520307123772, 279.551522465155, 279.502412614884, 279.403907059567, + 279.305458675206, 279.267725844962, 279.333072246429, 279.477371736632, 279.617554918081, + 279.673753966761, 279.623843723122, 279.509902009978, 279.398532989806, 279.334215665527, + 279.320437465393, 279.333072246429, 279.360399962878, 279.425917877209, 279.551751148975, + 279.712973241832, 279.857558586810, 279.950404217590, 279.981390875154, 279.965840375417, + 279.949546653266, 279.977160224490, 280.044278925559, 280.106423753550, 280.144328096658, + 280.197382742819, 280.319728586334, 280.514567200681, 280.716094816753, 280.831294290905, + 280.809912353767, 280.682078098579, 280.512966413944, 280.338595001456, 280.166338914300, + 279.997684597304, 279.819425559882, 279.641966915829, 279.479658574828, 279.323296013139, + 279.126284902505, 278.919611900491, 278.663943390116, 278.635872451253, 278.714768369034, + 278.939335879936, 279.234966887797, 279.462164262625, 279.579536233063, 279.613667293147, + 279.557754099241, 279.422258936095, 279.273099914724, 279.160301620679, 279.104045401044, + 279.120339123194, 279.186371576120, 279.254633696287, 279.324610945102, 279.415912960099, + 279.503327350163, 279.544947805340, 279.525223825895, 279.451873490740, 279.359942595239, + 279.299512895895, 279.299970263534, 279.366460084099, 279.468510238620, 279.518877849899, + 279.450730071642, 279.310718403058, 279.198949186201, 279.159386885400, 279.179282377710, + 279.227706176523, 279.276816026794, 279.339704077199, 279.455246577080, 279.610637232536, + 279.746761276187, 279.834861717709, 279.879798088271, 279.885629525673, 279.875395924743, + 279.895577271828, 279.960923673294, 280.039133539617, 280.106137898776, 280.185090987512, + 280.316469841904, 280.499531239539, 280.676532515953, 280.779268721933, 280.774980900315, + 280.668928778949, 280.494271511687, 280.303091838455, 280.126605100635, 279.943315019181, + 279.733497614647, 279.533456443403, 279.369032777070, 279.193232090709, 278.974724701028, + 278.776684513206, 278.477337393277, 278.425769191944, 278.545142145805, 278.845003804328, + 279.186257234210, 279.442668966999, 279.589884175903, 279.616983208532, 279.523623039157, + 279.377551249352, 279.241884573341, 279.128514569747, 279.069113947591, 279.093354432475, + 279.156013799060, 279.215357250261, 279.294424680907, 279.396417664474, 279.488805927615, + 279.561470211310, 279.584338593276, 279.506586094593, 279.365716861685, 279.260465133688, + 279.228049202252, 279.263152168569, 279.346850446563, 279.384926302536, 279.287735679182, + 279.118681165502, 279.009884838300, 278.999765579281, 279.055793115096, 279.139091196406, + 279.206552923204, 279.259093030770, 279.356112141259, 279.517105550297, 279.681186190900, + 279.784379764520, 279.807991368899, 279.779234378578, 279.764598614120, 279.813822806301, + 279.907468830450, 279.993796972370, 280.053540620255, 280.119458731271, 280.251409295212, + 280.463342025078, 280.675217583990, 280.789616664772, 280.782813321138, 280.675389096854, + 280.489526322429, 280.273134258080, 280.072292693467, 279.874195334690, 279.652486371533, + 279.437866606786, 279.233594784879, 279.015659104747, 278.793149748221, 278.609916837722, + 278.278039444447, 278.221211515262, 278.401014168466, 278.772568204452, 279.153212422270, + 279.444384095647, 279.618984191954, 279.628074373785, 279.498410648040, 279.344049069773, + 279.206610094159, 279.080376625709, 279.029322962971, 279.074373675443, 279.126685099190, + 279.162645629830, 279.242742137665, 279.351767148686, 279.452445200289, 279.569245461179, + 279.648770259464, 279.570846247916, 279.375721778795, 279.219645071880, 279.156013799060, + 279.166704767629, 279.232965904375, 279.254862380107, 279.131601801312, 278.940307786170, + 278.834598690534, 278.852035831783, 278.945624684977, 279.059509227166, 279.135375084336, + 279.175966462325, 279.264581442442, 279.446042053339, 279.658031954160, 279.793812972081, + 279.790782911470, 279.698680503104, 279.650028020472, 279.710629232681, 279.826171732562, + 279.931480631514, 280.008375565873, 280.071149274369, 280.185319671332, 280.405427847751, + 280.652120518204, 280.782241611589, 280.760745332541, 280.639542908123, 280.451907834096, + 280.226482758870, 280.002544128472, 279.780835165315, 279.552780226163, 279.330785408232, + 279.096041467356, 278.847748010164, 278.625009969819, 278.440576469267, 278.096350149730, + 278.070394536199, 278.305481502805, 278.723172499407, 279.140120273594, 279.458219466736, + 279.619441559593, 279.587482995796, 279.450272704003, 279.311976164066, 279.151897490307, + 278.991590132728, 278.964262416279, 279.057565414699, 279.110848744678, 279.115708275846, + 279.175451923731, 279.273671624273, 279.378923352270, 279.532427366214, 279.652257687714, + 279.582966490358, 279.372234350545, 279.184370592698, 279.073115914435, 279.055564431277, + 279.140348957414, 279.183455857419, 279.030009014430, 278.774740700739, 278.632785219688, + 278.674634358685, 278.827795346899, 278.977697590684, 279.039842418675, 279.051848319207, + 279.138576657812, 279.348279720436, 279.602690469803, 279.771058932025, 279.762711972608, + 279.633848640231, 279.556153312503, 279.607664342881, 279.721663226979, 279.841322035614, + 279.946287908836, 280.009804839746, 280.088243389888, 280.289885347869, 280.563848563817, + 280.727185982006, 280.709577327893, 280.579627747373, 280.394736879182, 280.175657779951, + 279.933024247296, 279.673182257212, 279.415970131054, 279.180025600124, 278.938421144658, + 278.683210001922, 278.455841114229, 278.261631380386, 277.941131007138, 277.966000372526, + 278.239391878925, 278.690642226061, 279.154870379962, 279.488577243795, 279.591484962640, + 279.499382554274, 279.378065787946, 279.270984589392, 279.083235173455, 278.890283200620, + 278.882622292662, 279.001137682198, 279.046359907535, 279.033553613635, 279.073458940165, + 279.153498277044, 279.279102864990, 279.478858181460, 279.608007368610, 279.522536791014, + 279.321638055446, 279.132745220410, 278.967120964025, 278.916810523700, 279.055735944141, + 279.162588458876, 278.986158892011, 278.647764009875, 278.455212233725, 278.525875533999, + 278.751586463999, 278.936991870785, 278.962775971451, 278.923213670651, 279.010285034985, + 279.265381835811, 279.562499288499, 279.744017070351, 279.719890927377, 279.567816187306, + 279.484632447906, 279.544033070062, 279.658603663709, 279.771058932025, 279.864419101400, + 279.899522067717, 279.941314035759, 280.136266992016, 280.447905867252, 280.660295964757, + 280.667213650302, 280.534005325352, 280.343283019759, 280.121574056603, 279.869335803522, + 279.580336626432, 279.282304438465, 279.009084444932, 278.747527326200, 278.486313233198, + 278.257286387813, 278.072967229170, 277.832734876621, 277.928782080877, 278.259516055054, + 278.741524375934, 279.215242908351, 279.510416548572, 279.531626972845, 279.398304305986, + 279.305801700935, 279.217586917503, 279.013715292280, 278.826308902072, 278.825336995838, + 278.901088511099, 278.911836650623, 278.914523685504, 278.944767120653, 278.984443763364, + 279.143607701844, 279.421115516997, 279.532198682394, 279.369490144709, 279.175623436596, + 279.045273659392, 278.877476906720, 278.808128538409, 278.992847893736, 279.154127157548, + 278.970494050365, 278.596996201912, 278.388550900295, 278.466303398978, 278.711623966514, + 278.898973185767, 278.883880053670, 278.801782562413, 278.914009146910, 279.254004815783, + 279.617497747126, 279.797872109880, 279.722920987987, 279.523508697248, 279.433064246574, + 279.512074506265, 279.634420349781, 279.724636116635, 279.773059915447, 279.762197434013, + 279.783636542106, 279.992196185632, 280.333335273604, 280.578827354005, 280.616388671383, + 280.501589393916, 280.301891248401, 280.061601724898, 279.796328494097, 279.497438741807, + 279.181626386862, 278.861812065073, 278.555661601509, 278.284156736622, 278.068336381822, + 277.909000930477 }; -#define ILCHAM 3128 -#define NSTRON 10 -#define NSMAX 31 -#define NMSMAX 31 +#define ILCHAM 3128 +#define NSTRON 10 +#define NSMAX 31 +#define NMSMAX 31 -int main (int argc, char * argv[]) +int main(int argc, char* argv[]) { grib_handle* h = NULL; - size_t len = 0; + size_t len = 0; const char* outfile; - assert(argc==2); + assert(argc == 2); outfile = argv[1]; - GRIB_CHECK (((h = grib_handle_new_from_samples (NULL, "regular_ll_pl_grib2")) == NULL), 0); + GRIB_CHECK(((h = grib_handle_new_from_samples(NULL, "regular_ll_pl_grib2")) == NULL), 0); /*GRIB_CHECK (((h = grib_handle_new_from_samples (NULL, "reduced_gg_ml_grib2")) == NULL), 0);*/ - len = strlen ("lambert"); - GRIB_CHECK (grib_set_string (h, "gridType", "lambert", &len), 0); - - GRIB_CHECK (grib_set_long (h, "centre", 85), 0); + len = strlen("lambert"); + GRIB_CHECK(grib_set_string(h, "gridType", "lambert", &len), 0); - GRIB_CHECK (grib_set_long (h, "grib2LocalSectionPresent", 1), 0); - GRIB_CHECK (grib_set_long (h, "grib2LocalSectionNumber", 1), 0); - len = strlen ("SURFTEMPERATURE"); - GRIB_CHECK (grib_set_string (h, "faFieldName", "SURFTEMPERATURE", &len), 0); + GRIB_CHECK(grib_set_long(h, "centre", 85), 0); - GRIB_CHECK (grib_set_long (h, "Nx", 64), 0); - GRIB_CHECK (grib_set_long (h, "Ny", 64), 0); - GRIB_CHECK (grib_set_double (h, "DxInMetres", 2500.00000000000), 0); - GRIB_CHECK (grib_set_double (h, "DyInMetres", 2500.00000000000), 0); - GRIB_CHECK (grib_set_long (h, "iScansNegatively", 0), 0); - GRIB_CHECK (grib_set_long (h, "jScansPositively", 1), 0); - GRIB_CHECK (grib_set_long (h, "jPointsAreConsecutive", 0), 0); - GRIB_CHECK (grib_set_long (h, "uvRelativeToGrid", 1), 0); - GRIB_CHECK (grib_set_double (h, "latitudeOfFirstGridPointInDegrees", 66.7684949529709), 0); - GRIB_CHECK (grib_set_double (h, "longitudeOfFirstGridPointInDegrees", 25.1580207144963), 0); - GRIB_CHECK (grib_set_double (h, "latitudeOfSouthernPoleInDegrees", 0.000000000000000E+000), 0); - GRIB_CHECK (grib_set_double (h, "longitudeOfSouthernPoleInDegrees", 0.000000000000000E+000), 0); - GRIB_CHECK (grib_set_double (h, "LaDInDegrees", 67.3600000000000), 0); - GRIB_CHECK (grib_set_double (h, "LoVInDegrees", 26.6400000000000), 0); - GRIB_CHECK (grib_set_double (h, "Latin1InDegrees", 67.3600000000000), 0); - GRIB_CHECK (grib_set_double (h, "Latin2InDegrees", 67.3600000000000), 0); - GRIB_CHECK (grib_set_long (h, "projectionCentreFlag", 0), 0); - GRIB_CHECK (grib_set_long (h, "NV", 0), 0); - GRIB_CHECK (grib_set_long (h, "year", 2009), 0); - GRIB_CHECK (grib_set_long (h, "month", 5), 0); - GRIB_CHECK (grib_set_long (h, "day", 28), 0); - GRIB_CHECK (grib_set_long (h, "hour", 0), 0); - GRIB_CHECK (grib_set_long (h, "minute", 0), 0); - GRIB_CHECK (grib_set_long (h, "second", 0), 0); - len = strlen ("s"); - GRIB_CHECK (grib_set_string (h, "indicatorOfUnitOfTimeRange", "s", &len), 0); - - GRIB_CHECK (grib_set_long (h, "scaledValueOfFirstFixedSurface", 0), 0); + GRIB_CHECK(grib_set_long(h, "grib2LocalSectionPresent", 1), 0); + GRIB_CHECK(grib_set_long(h, "grib2LocalSectionNumber", 1), 0); + len = strlen("SURFTEMPERATURE"); + GRIB_CHECK(grib_set_string(h, "faFieldName", "SURFTEMPERATURE", &len), 0); - len = strlen ("s"); - GRIB_CHECK (grib_set_string (h, "stepUnits", "s", &len), 0); - GRIB_CHECK (grib_set_long (h, "endStep", 3600), 0); - GRIB_CHECK (grib_set_long (h, "bitsPerValue", 16), 0); - len = strlen ("grid_simple"); - GRIB_CHECK (grib_set_string (h, "packingType", "grid_simple", &len), 0); - GRIB_CHECK (grib_set_long (h, "numberOfDataPoints", 4096), 0); - - len = sizeof(values)/sizeof(values[0]); - GRIB_CHECK (grib_set_double_array (h, "values", values, len), 0); - len = strlen ("SURFTEMPERATURE"); - GRIB_CHECK (grib_set_string (h, "CLNOMA", "SURFTEMPERATURE", &len), 0); - GRIB_CHECK (grib_set_long (h, "INGRIB", 120), 0); - GRIB_CHECK (grib_set_long (h, "LLCOSP", 0), 0); - GRIB_CHECK (grib_set_long (h, "INBITS", 16), 0); + GRIB_CHECK(grib_set_long(h, "Nx", 64), 0); + GRIB_CHECK(grib_set_long(h, "Ny", 64), 0); + GRIB_CHECK(grib_set_double(h, "DxInMetres", 2500.00000000000), 0); + GRIB_CHECK(grib_set_double(h, "DyInMetres", 2500.00000000000), 0); + GRIB_CHECK(grib_set_long(h, "iScansNegatively", 0), 0); + GRIB_CHECK(grib_set_long(h, "jScansPositively", 1), 0); + GRIB_CHECK(grib_set_long(h, "jPointsAreConsecutive", 0), 0); + GRIB_CHECK(grib_set_long(h, "uvRelativeToGrid", 1), 0); + GRIB_CHECK(grib_set_double(h, "latitudeOfFirstGridPointInDegrees", 66.7684949529709), 0); + GRIB_CHECK(grib_set_double(h, "longitudeOfFirstGridPointInDegrees", 25.1580207144963), 0); + GRIB_CHECK(grib_set_double(h, "latitudeOfSouthernPoleInDegrees", 0.000000000000000E+000), 0); + GRIB_CHECK(grib_set_double(h, "longitudeOfSouthernPoleInDegrees", 0.000000000000000E+000), 0); + GRIB_CHECK(grib_set_double(h, "LaDInDegrees", 67.3600000000000), 0); + GRIB_CHECK(grib_set_double(h, "LoVInDegrees", 26.6400000000000), 0); + GRIB_CHECK(grib_set_double(h, "Latin1InDegrees", 67.3600000000000), 0); + GRIB_CHECK(grib_set_double(h, "Latin2InDegrees", 67.3600000000000), 0); + GRIB_CHECK(grib_set_long(h, "projectionCentreFlag", 0), 0); + GRIB_CHECK(grib_set_long(h, "NV", 0), 0); + GRIB_CHECK(grib_set_long(h, "year", 2009), 0); + GRIB_CHECK(grib_set_long(h, "month", 5), 0); + GRIB_CHECK(grib_set_long(h, "day", 28), 0); + GRIB_CHECK(grib_set_long(h, "hour", 0), 0); + GRIB_CHECK(grib_set_long(h, "minute", 0), 0); + GRIB_CHECK(grib_set_long(h, "second", 0), 0); + len = strlen("s"); + GRIB_CHECK(grib_set_string(h, "indicatorOfUnitOfTimeRange", "s", &len), 0); + + GRIB_CHECK(grib_set_long(h, "scaledValueOfFirstFixedSurface", 0), 0); + + len = strlen("s"); + GRIB_CHECK(grib_set_string(h, "stepUnits", "s", &len), 0); + GRIB_CHECK(grib_set_long(h, "endStep", 3600), 0); + GRIB_CHECK(grib_set_long(h, "bitsPerValue", 16), 0); + len = strlen("grid_simple"); + GRIB_CHECK(grib_set_string(h, "packingType", "grid_simple", &len), 0); + GRIB_CHECK(grib_set_long(h, "numberOfDataPoints", 4096), 0); + + len = sizeof(values) / sizeof(values[0]); + GRIB_CHECK(grib_set_double_array(h, "values", values, len), 0); + len = strlen("SURFTEMPERATURE"); + GRIB_CHECK(grib_set_string(h, "CLNOMA", "SURFTEMPERATURE", &len), 0); + GRIB_CHECK(grib_set_long(h, "INGRIB", 120), 0); + GRIB_CHECK(grib_set_long(h, "LLCOSP", 0), 0); + GRIB_CHECK(grib_set_long(h, "INBITS", 16), 0); GRIB_CHECK(grib_write_message(h, outfile, "w"), 0); - GRIB_CHECK (grib_handle_delete (h), 0); + GRIB_CHECK(grib_handle_delete(h), 0); printf("ALL OK\n"); return 0; diff --git a/tests/grib_multi_from_message.c b/tests/grib_multi_from_message.c index c81415e7c..5c75dfefd 100644 --- a/tests/grib_multi_from_message.c +++ b/tests/grib_multi_from_message.c @@ -26,58 +26,65 @@ static void usage(const char* prog) exit(1); } -int main(int argc,char* argv[]) +int main(int argc, char* argv[]) { struct stat finfo; - char shortName[20]={0,}; + char shortName[20] = { + 0, + }; size_t len; - grib_handle* h=NULL; + grib_handle* h = NULL; size_t fsize; - unsigned char* data=NULL; - unsigned char* p=NULL; - void* pdata=NULL; - int error=0; - int count=0; - char* filename=NULL; - FILE* f=NULL; - long level=0; - grib_context* c=grib_context_get_default(); + unsigned char* data = NULL; + unsigned char* p = NULL; + void* pdata = NULL; + int error = 0; + int count = 0; + char* filename = NULL; + FILE* f = NULL; + long level = 0; + grib_context* c = grib_context_get_default(); - if (argc==3 && !strcmp(argv[1],"-m")) { + if (argc == 3 && !strcmp(argv[1], "-m")) { grib_multi_support_on(0); - filename=argv[2]; + filename = argv[2]; } - else if (argc==2) filename=argv[1]; - else usage(argv[0]); + else if (argc == 2) + filename = argv[1]; + else + usage(argv[0]); assert(filename); - f=fopen(filename,"rb"); - if (!f) {perror(filename);exit(1);} + f = fopen(filename, "rb"); + if (!f) { + perror(filename); + exit(1); + } stat(filename, &finfo); - fsize=finfo.st_size; + fsize = finfo.st_size; - data=(unsigned char*)malloc(fsize); - p=data; + data = (unsigned char*)malloc(fsize); + p = data; if (!data) { - fprintf(stderr,"unable to allocate %ld bytes\n",(long)fsize); + fprintf(stderr, "unable to allocate %ld bytes\n", (long)fsize); exit(1); } - if( fread(data, 1, fsize, f) != fsize) { + if (fread(data, 1, fsize, f) != fsize) { perror(filename); exit(1); } fclose(f); - pdata=&data; + pdata = &data; - while ((h=grib_handle_new_from_multi_message(c,(void**)pdata,&fsize,&error))!=NULL) { + while ((h = grib_handle_new_from_multi_message(c, (void**)pdata, &fsize, &error)) != NULL) { count++; - len=20; - GRIB_CHECK(grib_get_string(h,"shortName",shortName,&len),"shortName"); - GRIB_CHECK(grib_get_long(h,"level",&level),"level"); - printf("%d %s %ld\n",count,shortName,level); + len = 20; + GRIB_CHECK(grib_get_string(h, "shortName", shortName, &len), "shortName"); + GRIB_CHECK(grib_get_long(h, "level", &level), "level"); + printf("%d %s %ld\n", count, shortName, level); grib_handle_delete(h); } diff --git a/tests/grib_nearest_test.c b/tests/grib_nearest_test.c index ac52f0c4c..65372f448 100644 --- a/tests/grib_nearest_test.c +++ b/tests/grib_nearest_test.c @@ -21,79 +21,84 @@ #include "eccodes.h" -static void usage(const char* prog) { - printf("Usage: %s [-n] grib_file grib_file ...\n",prog); +static void usage(const char* prog) +{ + printf("Usage: %s [-n] grib_file grib_file ...\n", prog); exit(1); } int main(int argc, char** argv) { - int err = 0; - long step=0; - size_t nfiles=0; - size_t i=0, j=0; - codes_fieldset* set=NULL; + int err = 0; + long step = 0; + size_t nfiles = 0; + size_t i = 0, j = 0; + codes_fieldset* set = NULL; const size_t max_numfiles = 100; - codes_handle* h=NULL; - char param[20]={0,}; - size_t len=20; - double lats[4]={0,}; - double lons[4]={0,}; - double values[4]={0,}; - double distances[4]={0,}; - int indexes[4]={0,}; - char* order_by="param,step"; + codes_handle* h = NULL; + char param[20] = {0,}; + size_t len = 20; + double lats[4] = {0,}; + double lons[4] = {0,}; + double values[4] = {0,}; + double distances[4] = {0,}; + int indexes[4] = {0,}; + char* order_by = "param,step"; double* pValues = values; /* Default: decode the values */ - size_t size=4; - double lat=-40,lon=15; - int mode=0; + size_t size = 4; + double lat = -40, lon = 15; + int mode = 0; int count; char** filenames; - codes_nearest* nearest=NULL; + codes_nearest* nearest = NULL; if (argc < 2) usage(argv[0]); - filenames=(char**)malloc(sizeof(char*)*max_numfiles); + filenames = (char**)malloc(sizeof(char*) * max_numfiles); - for(i=1; i= max_numfiles) break; - filenames[j++]=(char*)strdup(argv[i]); + filenames[j++] = (char*)strdup(argv[i]); } } nfiles = j; - set=codes_fieldset_new_from_files(0,filenames,nfiles,0,0,0,order_by,&err); - CODES_CHECK(err,0); + set = codes_fieldset_new_from_files(0, filenames, nfiles, 0, 0, 0, order_by, &err); + CODES_CHECK(err, 0); - printf("ordering by %s\n",order_by); - printf("%d fields in the fieldset\n",codes_fieldset_count(set)); + printf("ordering by %s\n", order_by); + printf("%d fields in the fieldset\n", codes_fieldset_count(set)); printf("n,step,param\n"); - mode=CODES_NEAREST_SAME_GRID | CODES_NEAREST_SAME_POINT; - count=1; + mode = CODES_NEAREST_SAME_GRID | CODES_NEAREST_SAME_POINT; + count = 1; - while ((h=codes_fieldset_next_handle(set,&err))!=NULL) { - CODES_CHECK(codes_get_long(h,"step",&step),0); - len=20; - CODES_CHECK(codes_get_string(h,"shortName",param,&len),0); + while ((h = codes_fieldset_next_handle(set, &err)) != NULL) { + CODES_CHECK(codes_get_long(h, "step", &step), 0); + len = 20; + CODES_CHECK(codes_get_string(h, "shortName", param, &len), 0); - printf("%d %ld %s ",count,step,param); - if (!nearest) nearest=codes_grib_nearest_new(h,&err); - CODES_CHECK(err,0); - CODES_CHECK(codes_grib_nearest_find(nearest,h,lat,lon,mode,lats,lons,pValues,distances,indexes,&size),0); + printf("%d %ld %s ", count, step, param); + if (!nearest) nearest = codes_grib_nearest_new(h, &err); + CODES_CHECK(err, 0); + CODES_CHECK(codes_grib_nearest_find(nearest, h, lat, lon, mode, lats, lons, pValues, distances, indexes, &size), 0); if (!pValues) { printf("\nIdx\tlat\tlon\tdist\n"); - for (i=0;i<4;i++) printf("%d\t%.2f\t%.2f\t%g\n", - (int)indexes[i],lats[i],lons[i],distances[i]); - } else { + for (i = 0; i < 4; i++) + printf("%d\t%.2f\t%.2f\t%g\n", + (int)indexes[i], lats[i], lons[i], distances[i]); + } + else { printf("\nIdx\tlat\tlon\tdist\tval\n"); - for (i=0;i<4;i++) printf("%d\t%.2f\t%.2f\t%g\t%g\n", - (int)indexes[i],lats[i],lons[i],distances[i],pValues[i]); + for (i = 0; i < 4; i++) + printf("%d\t%.2f\t%.2f\t%g\t%g\n", + (int)indexes[i], lats[i], lons[i], distances[i], pValues[i]); } printf("\n"); diff --git a/tests/grib_optimize_scaling.c b/tests/grib_optimize_scaling.c index 40f83ca8c..7f0b325f6 100644 --- a/tests/grib_optimize_scaling.c +++ b/tests/grib_optimize_scaling.c @@ -18,2722 +18,2722 @@ */ static double values[] = { - 0.101300032966540894E+06, 0.101300537463512766E+06, 0.101300575340236785E+06, 0.101300006392703450E+06, 0.101298681683129777E+06, - 0.101296357626198034E+06, 0.101291429037962458E+06, 0.101285211396584113E+06, 0.101277811769244916E+06, 0.101269604202318660E+06, - 0.101261086325391967E+06, 0.101252536774223816E+06, 0.101244258202072262E+06, 0.101236292863086681E+06, 0.101228818038673067E+06, - 0.101222576320632390E+06, 0.101217951101617422E+06, 0.101215281498123208E+06, 0.101214831830208335E+06, 0.101216756641191008E+06, - 0.101220329473252321E+06, 0.101229814720005656E+06, 0.101242852565120862E+06, 0.101257243179816374E+06, 0.101272242223526715E+06, - 0.101287023899284890E+06, 0.101300727324330161E+06, 0.101312508880994021E+06, 0.101321304787958841E+06, 0.101323045492054458E+06, - 0.101323689235454440E+06, 0.101322654817980932E+06, 0.101318546143449697E+06, 0.101311446435368038E+06, 0.101301582670344171E+06, - 0.101289313645048256E+06, 0.101272976739770951E+06, 0.101254670123119533E+06, 0.101236204711241953E+06, 0.101218525147353255E+06, - 0.101203644914472199E+06, 0.101191859002529978E+06, 0.101183427645969176E+06, 0.101178788732659857E+06, 0.101176248776911350E+06, - 0.101174781987763519E+06, 0.101173755414963452E+06, 0.101172549028196707E+06, 0.101170596810517556E+06, 0.101164899003713479E+06, - 0.101158419589045283E+06, 0.101152491572940358E+06, 0.101147843517789603E+06, 0.101145017464391334E+06, 0.101144350744426047E+06, - 0.101145965622140546E+06, 0.101150160852645960E+06, 0.101156489280060341E+06, 0.101164999288937499E+06, 0.101174680757722846E+06, - 0.101184614700939375E+06, 0.101194476866903220E+06, 0.101203847071805940E+06, 0.101212793693367261E+06, 0.101221210811864396E+06, - 0.101228967667653473E+06, 0.101235941297612240E+06, 0.101241825830798407E+06, 0.101246384813952725E+06, 0.101250233289149895E+06, - 0.101253625288606709E+06, 0.101256829767974210E+06, 0.101260135466684485E+06, 0.101263922730170481E+06, 0.101268258457290780E+06, - 0.101273173871677092E+06, 0.101278603318462468E+06, 0.101284438572224244E+06, 0.101291451901038017E+06, 0.101298825789695678E+06, - 0.101305583597361008E+06, 0.101311198590170257E+06, 0.101313106869633571E+06, 0.101311964918650119E+06, 0.101309609217350633E+06, - 0.101306588009722152E+06, 0.101303789827421686E+06, 0.101303204229508177E+06, 0.101302539808644782E+06, 0.101301748136565366E+06, - 0.101300889588588965E+06, 0.101301524026314495E+06, 0.101302253276609670E+06, 0.101302463210049027E+06, 0.101302292202795681E+06, - 0.101298302559037387E+06, 0.101291449427361382E+06, 0.101283550209983820E+06, 0.101275343284659903E+06, 0.101268451030137920E+06, - 0.101263440167506284E+06, 0.101259681043976845E+06, 0.101257275584439689E+06, 0.101255817294926324E+06, 0.101255329151085723E+06, - 0.101256832423130865E+06, 0.101260699063277454E+06, 0.101270225601657599E+06, 0.101287312191364559E+06, 0.101303455630186116E+06, - 0.101316029699689170E+06, 0.101320758891846766E+06, 0.101311100182774215E+06, 0.101294901290088586E+06, 0.101273081896347416E+06, - 0.101246397937256072E+06, 0.101214175532589943E+06, 0.101180475299171711E+06, 0.101147446887522659E+06, 0.101117364487217361E+06, - 0.101093085915674965E+06, 0.101075700452174933E+06, 0.101066299886712630E+06, 0.101066158368806296E+06, 0.101078251612071312E+06, - 0.101107333429588485E+06, 0.101145577197960345E+06, 0.101190184433163799E+06, 0.101238249723994639E+06, 0.101280682092796589E+06, - 0.101316576899162261E+06, 0.101349617253023622E+06, 0.101379226791601075E+06, 0.101404833281466810E+06, 0.101426608723689307E+06, - 0.101443265324151027E+06, 0.101453984963411596E+06, 0.101458728599400347E+06, 0.101457810163301183E+06, 0.101452773264225369E+06, - 0.101443352159658025E+06, 0.101428700824100233E+06, 0.101409534671443689E+06, 0.101387066094169772E+06, 0.101362901532581192E+06, - 0.101342428907368536E+06, 0.101323657976273273E+06, 0.101307125752964450E+06, 0.101293183514770688E+06, 0.101280868902945120E+06, - 0.101268909632403243E+06, 0.101254864133468844E+06, 0.101241751785266810E+06, 0.101229873732095890E+06, 0.101219507414652238E+06, - 0.101210854622372586E+06, 0.101203998200015136E+06, 0.101202118817604176E+06, 0.101204115282818020E+06, 0.101207394659720041E+06, - 0.101211469101194845E+06, 0.101215801913933246E+06, 0.101219837912576768E+06, 0.101222821880958276E+06, 0.101223619521153145E+06, - 0.101223119359168049E+06, 0.101279933976388784E+06, 0.101280230886902951E+06, 0.101280173829517254E+06, 0.101279628905657766E+06, - 0.101278452724477320E+06, 0.101276500130166445E+06, 0.101273279706602567E+06, 0.101267225127293903E+06, 0.101259879400551043E+06, - 0.101251952874409501E+06, 0.101243674039727790E+06, 0.101235303075196876E+06, 0.101227122345847776E+06, 0.101219423613287974E+06, - 0.101212178882549546E+06, 0.101205696806113177E+06, 0.101200710454399567E+06, 0.101197550054666615E+06, 0.101196424920055710E+06, - 0.101196682426928426E+06, 0.101199196544638864E+06, 0.101204111882830854E+06, 0.101214864879095490E+06, 0.101228568680570461E+06, - 0.101243289081509487E+06, 0.101258220436669624E+06, 0.101272521063369320E+06, 0.101285366950491778E+06, 0.101296012419061328E+06, - 0.101305658540617282E+06, 0.101309682063797125E+06, 0.101310624244857565E+06, 0.101308433795484656E+06, 0.101303210985482059E+06, - 0.101295198335334237E+06, 0.101284767756201632E+06, 0.101272403737592205E+06, 0.101256113788140079E+06, 0.101238847669926457E+06, - 0.101222589159180454E+06, 0.101208629956686913E+06, 0.101197517909479167E+06, 0.101189497449897433E+06, 0.101184456694785782E+06, - 0.101181649500138068E+06, 0.101179750491125887E+06, 0.101178046404878522E+06, 0.101175885037415414E+06, 0.101168022154143066E+06, - 0.101159966065713801E+06, 0.101152331174549618E+06, 0.101145627588820978E+06, 0.101140536375719617E+06, 0.101137554875074289E+06, - 0.101136964384819003E+06, 0.101138821605761070E+06, 0.101143054186604160E+06, 0.101151654753774303E+06, 0.101161075130481171E+06, - 0.101170963288776737E+06, 0.101180942106852366E+06, 0.101190660642090996E+06, 0.101199851697929174E+06, 0.101208579711314771E+06, - 0.101216763897321827E+06, 0.101224252677880388E+06, 0.101230718188980885E+06, 0.101236243573164116E+06, 0.101240451206177866E+06, - 0.101243892699987075E+06, 0.101246988344102370E+06, 0.101250044906442185E+06, 0.101253348298035868E+06, 0.101257374370298217E+06, - 0.101262251561231329E+06, 0.101267895803787687E+06, 0.101275473367753089E+06, 0.101283709026768585E+06, 0.101292283625024313E+06, - 0.101300598737905675E+06, 0.101308093199018083E+06, 0.101314220495369867E+06, 0.101317565250665139E+06, 0.101316383038650820E+06, - 0.101313738332474823E+06, 0.101310203262582130E+06, 0.101306334680532935E+06, 0.101304140173899126E+06, 0.101302185066315011E+06, - 0.101301166929963205E+06, 0.101300627409982437E+06, 0.101301442301666364E+06, 0.101302674870566902E+06, 0.101303021785214194E+06, - 0.101301874610097177E+06, 0.101297234163742920E+06, 0.101289212662159043E+06, 0.101280201810217695E+06, 0.101271153345172788E+06, - 0.101264093160240271E+06, 0.101259964551924568E+06, 0.101257527008254954E+06, 0.101256779297676592E+06, 0.101257083402693010E+06, - 0.101258345876766994E+06, 0.101261741195912517E+06, 0.101267637196925745E+06, 0.101280255542587736E+06, 0.101300219472217796E+06, - 0.101318811431023903E+06, 0.101333064281329105E+06, 0.101337822826176372E+06, 0.101329633927901843E+06, 0.101313842956693508E+06, - 0.101291773913463257E+06, 0.101264248822328038E+06, 0.101231681402834831E+06, 0.101198711256044262E+06, 0.101165944729817566E+06, - 0.101135663129340406E+06, 0.101112149821393570E+06, 0.101094336258872077E+06, 0.101083754934829689E+06, 0.101081962838100400E+06, - 0.101094161177945804E+06, 0.101119463798994111E+06, 0.101153379508463855E+06, 0.101193466772876971E+06, 0.101236864297787688E+06, - 0.101271319749684611E+06, 0.101304810719710440E+06, 0.101336529049048593E+06, 0.101365547226062699E+06, 0.101391403447243065E+06, - 0.101414233987549960E+06, 0.101431699751902197E+06, 0.101443249701215464E+06, 0.101448694379159249E+06, 0.101448342945639379E+06, - 0.101444949497289897E+06, 0.101434983683722516E+06, 0.101420339588228075E+06, 0.101400782009497547E+06, 0.101377357223598548E+06, - 0.101353445824612878E+06, 0.101331105881366500E+06, 0.101310391048972291E+06, 0.101292023316921361E+06, 0.101276408630823629E+06, - 0.101263594338449708E+06, 0.101249134886344415E+06, 0.101234892154251414E+06, 0.101221982151018121E+06, 0.101210641209280395E+06, - 0.101201103409364907E+06, 0.101193542381486463E+06, 0.101189530184913005E+06, 0.101188943141927884E+06, 0.101190369535781749E+06, - 0.101194174658495293E+06, 0.101198877046582638E+06, 0.101203781726436631E+06, 0.101208345081553751E+06, 0.101210641923420510E+06, - 0.101211907924376195E+06, 0.101211894158448660E+06, 0.101261542396602526E+06, 0.101261524602459496E+06, 0.101261271962264684E+06, - 0.101260655467705859E+06, 0.101259535677996173E+06, 0.101257770460092695E+06, 0.101254858567248273E+06, 0.101250130827152869E+06, - 0.101243199529206220E+06, 0.101235660710148513E+06, 0.101227727082598372E+06, 0.101219642017676335E+06, 0.101211669747645647E+06, - 0.101204082204654842E+06, 0.101197142166519814E+06, 0.101190828836761386E+06, 0.101185622952613427E+06, 0.101182084994122983E+06, - 0.101179819644487143E+06, 0.101179386785722192E+06, 0.101181037231546885E+06, 0.101184921544816825E+06, 0.101191071708805684E+06, - 0.101202963344456002E+06, 0.101217214661309525E+06, 0.101232127096539611E+06, 0.101246868435665092E+06, 0.101260623299959872E+06, - 0.101275012912500446E+06, 0.101287927630361359E+06, 0.101297156607966986E+06, 0.101300022279744313E+06, 0.101299658882873831E+06, - 0.101296185125092088E+06, 0.101289860769760111E+06, 0.101281072853932870E+06, 0.101270317685887567E+06, 0.101257849866728764E+06, - 0.101241620969336713E+06, 0.101226620289076629E+06, 0.101213719159152053E+06, 0.101203448100139896E+06, 0.101196030165699893E+06, - 0.101191332050565718E+06, 0.101188825460235021E+06, 0.101186627930786824E+06, 0.101183177496864155E+06, 0.101175055095382006E+06, - 0.101166325451567565E+06, 0.101157506572639366E+06, 0.101149141784503256E+06, 0.101141882059824522E+06, 0.101136611424843984E+06, - 0.101133780517071078E+06, 0.101133612778250375E+06, 0.101137015702474586E+06, 0.101144048000326933E+06, 0.101152946100252506E+06, - 0.101162592544671337E+06, 0.101172594122147348E+06, 0.101182525914593833E+06, 0.101192006688188281E+06, 0.101200731545306888E+06, - 0.101208949653701755E+06, 0.101216776035106115E+06, 0.101223643986761963E+06, 0.101229495275078225E+06, 0.101234397106283810E+06, - 0.101238325186287970E+06, 0.101241245958931366E+06, 0.101243986310471693E+06, 0.101246885079730608E+06, 0.101250239965938381E+06, - 0.101254497783043873E+06, 0.101260948534770170E+06, 0.101268693386766550E+06, 0.101277410860750868E+06, 0.101286673004684562E+06, - 0.101296037156777587E+06, 0.101304973100759889E+06, 0.101312836471203336E+06, 0.101319077100166265E+06, 0.101323200714451756E+06, - 0.101322250124293394E+06, 0.101319426400325508E+06, 0.101315327879672026E+06, 0.101311379409400208E+06, 0.101308929715621984E+06, - 0.101307576201749136E+06, 0.101306752066909641E+06, 0.101306276681202202E+06, 0.101306450951061837E+06, 0.101306928825287003E+06, - 0.101306304370611891E+06, 0.101304071949983219E+06, 0.101298726444911401E+06, 0.101289556844688181E+06, 0.101279573549734007E+06, - 0.101269900918276995E+06, 0.101262737639210711E+06, 0.101259533404357528E+06, 0.101258456904325285E+06, 0.101259373853730853E+06, - 0.101261455254273096E+06, 0.101264486663057716E+06, 0.101269671494430630E+06, 0.101277337091813301E+06, 0.101292476984397377E+06, - 0.101314252890570002E+06, 0.101334243526143560E+06, 0.101349257112687643E+06, 0.101353348220742904E+06, 0.101345316081726181E+06, - 0.101329205683580891E+06, 0.101306196398575121E+06, 0.101276157501052992E+06, 0.101241050683782683E+06, 0.101205878990180805E+06, - 0.101173117425566874E+06, 0.101145231775263543E+06, 0.101124829234029152E+06, 0.101110142836540865E+06, 0.101099009983212847E+06, - 0.101095931793603289E+06, 0.101107937055714152E+06, 0.101129557639286853E+06, 0.101159016947845914E+06, 0.101194290171214365E+06, - 0.101229194191076458E+06, 0.101259884907642350E+06, 0.101290909335772027E+06, 0.101321534960278805E+06, 0.101350933609778935E+06, - 0.101378619763291339E+06, 0.101402515553940961E+06, 0.101421126437325220E+06, 0.101433759893184542E+06, 0.101440081432142906E+06, - 0.101442774222367792E+06, 0.101440175371796868E+06, 0.101430382938397539E+06, 0.101414195446914280E+06, 0.101393183882853962E+06, - 0.101368556280786899E+06, 0.101342857987377705E+06, 0.101318002031737051E+06, 0.101294900480304379E+06, 0.101274304523903862E+06, - 0.101256697091383176E+06, 0.101240541623616038E+06, 0.101225909818463362E+06, 0.101213299349493405E+06, 0.101200928172660904E+06, - 0.101190501742025459E+06, 0.101182213405811461E+06, 0.101176901403817319E+06, 0.101175245583661221E+06, 0.101175762446152599E+06, - 0.101178005333581008E+06, 0.101181392651505157E+06, 0.101186087494527630E+06, 0.101191405412103719E+06, 0.101195091837111089E+06, - 0.101197730891759726E+06, 0.101199364382066880E+06, 0.101199730209935369E+06, 0.101245004040932326E+06, 0.101244559135352756E+06, - 0.101244006361693333E+06, 0.101243220164091719E+06, 0.101242063426875131E+06, 0.101239785127296316E+06, 0.101236357261140554E+06, - 0.101232655165141550E+06, 0.101227802625625860E+06, 0.101220780822386791E+06, 0.101213322053334618E+06, 0.101205654745465290E+06, - 0.101198027406206093E+06, 0.101190695138277268E+06, 0.101183902374283105E+06, 0.101177861446733092E+06, 0.101172715839318174E+06, - 0.101168727915036332E+06, 0.101166083677619172E+06, 0.101165120300427254E+06, 0.101166097664782996E+06, 0.101169176642534818E+06, - 0.101174400762938254E+06, 0.101181681695578300E+06, 0.101194628149370954E+06, 0.101209354172510837E+06, 0.101224384543212596E+06, - 0.101241003377192639E+06, 0.101256971279536912E+06, 0.101271325762838256E+06, 0.101283302907598583E+06, 0.101290837888259193E+06, - 0.101292188600320253E+06, 0.101290316399723524E+06, 0.101285500501916889E+06, 0.101278145707370568E+06, 0.101268063741988299E+06, - 0.101255992666718317E+06, 0.101243630289196284E+06, 0.101230020660095543E+06, 0.101218300352418431E+06, 0.101208996070145775E+06, - 0.101202318103285957E+06, 0.101198115125068754E+06, 0.101195865072430563E+06, 0.101192485973754709E+06, 0.101184883550562605E+06, - 0.101176252043943983E+06, 0.101167064140836461E+06, 0.101157837055866650E+06, 0.101149111932572778E+06, 0.101141425669095363E+06, - 0.101136096494374695E+06, 0.101133772515929886E+06, 0.101136278536261714E+06, 0.101141790910123251E+06, 0.101149565058361550E+06, - 0.101159158826086161E+06, 0.101169280924233710E+06, 0.101179364339541717E+06, 0.101189214375348573E+06, 0.101198419330631325E+06, - 0.101206662421100802E+06, 0.101214110977152406E+06, 0.101221277683224456E+06, 0.101227361193735371E+06, 0.101232391962857888E+06, - 0.101236456240121115E+06, 0.101239696448804534E+06, 0.101242131415364871E+06, 0.101244485321801025E+06, 0.101247206329288369E+06, - 0.101250813340918423E+06, 0.101256254483921584E+06, 0.101263638654577793E+06, 0.101272420586206106E+06, 0.101282081390786785E+06, - 0.101292093147014763E+06, 0.101301886889219619E+06, 0.101311011635127215E+06, 0.101318745388787589E+06, 0.101324552511834278E+06, - 0.101327137099599713E+06, 0.101325798652594996E+06, 0.101322370281172494E+06, 0.101318873214067411E+06, 0.101316033453167009E+06, - 0.101314254241750285E+06, 0.101313290040590538E+06, 0.101312777489808956E+06, 0.101312426972162124E+06, 0.101312077043907979E+06, - 0.101311637613854371E+06, 0.101309930679532728E+06, 0.101306604219150962E+06, 0.101300708574919438E+06, 0.101290667766194849E+06, - 0.101280103453056901E+06, 0.101270238174615952E+06, 0.101263265305097812E+06, 0.101261210282368877E+06, 0.101261635280168994E+06, - 0.101264259503469541E+06, 0.101268188459234763E+06, 0.101273120782915241E+06, 0.101280081032422138E+06, 0.101289326234345950E+06, - 0.101306137507821695E+06, 0.101328331726916280E+06, 0.101348454606262691E+06, 0.101363243724620203E+06, 0.101365228148856142E+06, - 0.101355701191101674E+06, 0.101338137535693226E+06, 0.101313442343172661E+06, 0.101279893686959578E+06, 0.101241766771608411E+06, - 0.101204166019317592E+06, 0.101170013105795253E+06, 0.101142432350644231E+06, 0.101122231791865343E+06, 0.101108816561727523E+06, - 0.101102229721379510E+06, 0.101103813368451665E+06, 0.101116580337189007E+06, 0.101134920647456835E+06, 0.101160141230191730E+06, - 0.101190695983823272E+06, 0.101217581338673946E+06, 0.101244990949544663E+06, 0.101273917316553634E+06, 0.101303572896501239E+06, - 0.101333544453130846E+06, 0.101364877370781323E+06, 0.101391063816659895E+06, 0.101411237101045277E+06, 0.101425278782258334E+06, - 0.101433519934200929E+06, 0.101439158935259431E+06, 0.101436999045160905E+06, 0.101426916105024720E+06, 0.101409617969188068E+06, - 0.101386542831537823E+06, 0.101358099179373283E+06, 0.101329104321193983E+06, 0.101301390131810738E+06, 0.101275584184176812E+06, - 0.101252450915750233E+06, 0.101231887457535791E+06, 0.101212090768716560E+06, 0.101196447068532798E+06, 0.101185068443023629E+06, - 0.101177384135667060E+06, 0.101168309967723544E+06, 0.101161992541140848E+06, 0.101159852630578913E+06, 0.101159796489626082E+06, - 0.101161597602608847E+06, 0.101164838510229980E+06, 0.101168957886595192E+06, 0.101173308450019656E+06, 0.101177043737997461E+06, - 0.101180725542300570E+06, 0.101183638211952741E+06, 0.101185541375514644E+06, 0.101186177771331219E+06, 0.101231389269493171E+06, - 0.101229452023944614E+06, 0.101228492450459045E+06, 0.101227437857730562E+06, 0.101225272919369032E+06, 0.101222115782736248E+06, - 0.101218895852368762E+06, 0.101215584732123752E+06, 0.101212116636056322E+06, 0.101207354097621472E+06, 0.101200521838921966E+06, - 0.101193426713001274E+06, 0.101186304142571476E+06, 0.101179395677309934E+06, 0.101172931379861388E+06, 0.101167151828382484E+06, - 0.101162308500518877E+06, 0.101158300144806009E+06, 0.101155408258388663E+06, 0.101154070184498851E+06, 0.101154559752015484E+06, - 0.101157052466433044E+06, 0.101161607131965604E+06, 0.101168151354609319E+06, 0.101176471448160533E+06, 0.101190446255643255E+06, - 0.101207546249739040E+06, 0.101224869025537133E+06, 0.101241629266362957E+06, 0.101257034534386199E+06, 0.101270300423290071E+06, - 0.101280701804350014E+06, 0.101286032850469506E+06, 0.101285592385854572E+06, 0.101282085195034277E+06, 0.101274697798302746E+06, - 0.101264580591891121E+06, 0.101253728075986262E+06, 0.101242929317346643E+06, 0.101232485866013521E+06, 0.101222025672053554E+06, - 0.101213765521939480E+06, 0.101207908438247250E+06, 0.101204284122239580E+06, 0.101199927839590950E+06, 0.101194734819518329E+06, - 0.101188456889903726E+06, 0.101179666542616309E+06, 0.101170394407501270E+06, 0.101161163472120141E+06, 0.101152520749703152E+06, - 0.101145006252468942E+06, 0.101139495861547286E+06, 0.101140801932908304E+06, 0.101144658005535239E+06, 0.101150950782672968E+06, - 0.101159402010231061E+06, 0.101169516352869221E+06, 0.101180618870833394E+06, 0.101190857796199096E+06, 0.101200641550543587E+06, - 0.101209362327359180E+06, 0.101217130139796180E+06, 0.101224049008589936E+06, 0.101230122753387783E+06, 0.101235212462695199E+06, - 0.101239229954162147E+06, 0.101242277095199534E+06, 0.101244507835626879E+06, 0.101246153185945266E+06, 0.101247135672995661E+06, - 0.101249606832741643E+06, 0.101254017340448758E+06, 0.101260512682501125E+06, 0.101268912159280037E+06, 0.101278581961162170E+06, - 0.101288935630890279E+06, 0.101299344634514127E+06, 0.101309165575948311E+06, 0.101317556887074039E+06, 0.101323172703937016E+06, - 0.101326358447397986E+06, 0.101327232302474091E+06, 0.101325894572504010E+06, 0.101322706535794525E+06, 0.101319932108380584E+06, - 0.101318115839731938E+06, 0.101317374329348502E+06, 0.101316802412196412E+06, 0.101316539167573457E+06, 0.101316220872659469E+06, - 0.101315472541661889E+06, 0.101313988991298058E+06, 0.101311143303248988E+06, 0.101306823565026949E+06, 0.101300909517459571E+06, - 0.101291139156745485E+06, 0.101281432901143096E+06, 0.101272931024738762E+06, 0.101267480423988032E+06, 0.101267406598649904E+06, - 0.101269963384954986E+06, 0.101274800002130170E+06, 0.101281233237463195E+06, 0.101288842618392577E+06, 0.101297886975346977E+06, - 0.101308296387334616E+06, 0.101325624485844790E+06, 0.101346166178142783E+06, 0.101363441252856501E+06, 0.101374801583022883E+06, - 0.101371478339382054E+06, 0.101357965915636902E+06, 0.101337616663800756E+06, 0.101310513973449386E+06, 0.101272307541573202E+06, - 0.101230865550039016E+06, 0.101190791911869368E+06, 0.101155350687670492E+06, 0.101129224427448615E+06, 0.101110583343861392E+06, - 0.101099020700267734E+06, 0.101094724119735372E+06, 0.101099023269690821E+06, 0.101111662707600757E+06, 0.101130628382792580E+06, - 0.101154442701152686E+06, 0.101179514522985817E+06, 0.101201379997560478E+06, 0.101226265787734679E+06, 0.101253796882664625E+06, - 0.101283225572595169E+06, 0.101317124967778669E+06, 0.101350989077608407E+06, 0.101379921717535108E+06, 0.101402381642000008E+06, - 0.101417742462739217E+06, 0.101429901727416946E+06, 0.101436203470310473E+06, 0.101434079341425662E+06, 0.101423164600191842E+06, - 0.101404037685293821E+06, 0.101376818918793375E+06, 0.101344589194113520E+06, 0.101311531147971255E+06, 0.101279820675164505E+06, - 0.101251153362574143E+06, 0.101225285333396270E+06, 0.101199764562447148E+06, 0.101178262360150809E+06, 0.101161772194779478E+06, - 0.101150434481179953E+06, 0.101143909494338062E+06, 0.101141390141577620E+06, 0.101140639767941699E+06, 0.101140632648710569E+06, - 0.101142372620975060E+06, 0.101145663398052158E+06, 0.101150107990777600E+06, 0.101155154940690569E+06, 0.101159369531278891E+06, - 0.101162295247948568E+06, 0.101164893804552295E+06, 0.101168002876310085E+06, 0.101170082535517562E+06, 0.101170879828210964E+06, - 0.101219861459639709E+06, 0.101217353733850920E+06, 0.101214813662341927E+06, 0.101212272616671195E+06, 0.101208980334428372E+06, - 0.101205795685889956E+06, 0.101202734659769427E+06, 0.101199769990954403E+06, 0.101196834984741159E+06, 0.101193828164992272E+06, - 0.101189376363543503E+06, 0.101183028116295318E+06, 0.101176590659241221E+06, 0.101170295511546516E+06, 0.101164459781001147E+06, - 0.101159272837843542E+06, 0.101154626508349247E+06, 0.101150830978481536E+06, 0.101147940393322046E+06, 0.101146374185143752E+06, - 0.101146551350105059E+06, 0.101148666345078062E+06, 0.101152796928674230E+06, 0.101158889620899077E+06, 0.101166802022490039E+06, - 0.101178035305259487E+06, 0.101194860122035752E+06, 0.101212325551695918E+06, 0.101229507831180323E+06, 0.101245588075390231E+06, - 0.101259749204794090E+06, 0.101271227064842373E+06, 0.101279354568716226E+06, 0.101282023041620065E+06, 0.101277735417878983E+06, - 0.101270065940430606E+06, 0.101260942221718724E+06, 0.101251183302667749E+06, 0.101241580790420048E+06, 0.101232817663754860E+06, - 0.101224865544509375E+06, 0.101217678236240463E+06, 0.101212672610467605E+06, 0.101207368061914924E+06, 0.101202142949429748E+06, - 0.101197200360827206E+06, 0.101192321056135959E+06, 0.101185312042045203E+06, 0.101176366919002583E+06, 0.101167575306740793E+06, - 0.101159499887747690E+06, 0.101153693581619635E+06, 0.101151632492099627E+06, 0.101152648343697670E+06, 0.101157198969257923E+06, - 0.101164178808173063E+06, 0.101173247856793882E+06, 0.101183857272265639E+06, 0.101195294072408884E+06, 0.101206439742155373E+06, - 0.101215821840872028E+06, 0.101224223508709707E+06, 0.101231582323487324E+06, 0.101237823030360581E+06, 0.101242874318770337E+06, - 0.101246774089702827E+06, 0.101249620201836733E+06, 0.101251514633922707E+06, 0.101250998739460556E+06, 0.101250350564701104E+06, - 0.101251192192736547E+06, 0.101254126969565099E+06, 0.101259362363834385E+06, 0.101266888172729494E+06, 0.101276372037240624E+06, - 0.101286838617996444E+06, 0.101297573246049607E+06, 0.101307533698699568E+06, 0.101315884770704040E+06, 0.101322262940598855E+06, - 0.101325965760392661E+06, 0.101327074410681467E+06, 0.101325913256045969E+06, 0.101323124870245505E+06, 0.101319702236701676E+06, - 0.101317199019545646E+06, 0.101315951598744505E+06, 0.101315806747022463E+06, 0.101315575437492836E+06, 0.101314907982108765E+06, - 0.101313877512845647E+06, 0.101312479697057366E+06, 0.101309803618787570E+06, 0.101306072028328548E+06, 0.101301517809186698E+06, - 0.101296222398532715E+06, 0.101287978736962512E+06, 0.101280134483104775E+06, 0.101273858730883643E+06, 0.101270559684999607E+06, - 0.101272646114663905E+06, 0.101277445816036910E+06, 0.101284587711525965E+06, 0.101293877343276210E+06, 0.101304839668757166E+06, - 0.101316528257227954E+06, 0.101328366576771165E+06, 0.101345969486117698E+06, 0.101364186088572969E+06, 0.101377148495963469E+06, - 0.101382093829553254E+06, 0.101370766337072331E+06, 0.101349741353763951E+06, 0.101321811510905638E+06, 0.101288468123698593E+06, - 0.101244965303345511E+06, 0.101202004776977919E+06, 0.101162860285996649E+06, 0.101126851606302604E+06, 0.101104372225545885E+06, - 0.101088557676466924E+06, 0.101079807482518576E+06, 0.101078498448923550E+06, 0.101085445131155400E+06, 0.101098827324377111E+06, - 0.101117379276230466E+06, 0.101139770652544976E+06, 0.101160113557297649E+06, 0.101180387504904938E+06, 0.101203886596317709E+06, - 0.101230902181368132E+06, 0.101261803558958476E+06, 0.101300608660476937E+06, 0.101337274184836075E+06, 0.101369125977644289E+06, - 0.101394267041929546E+06, 0.101413158265606093E+06, 0.101427330114929093E+06, 0.101432361057773902E+06, 0.101429910859225725E+06, - 0.101417624134461643E+06, 0.101395314188587567E+06, 0.101362172145086661E+06, 0.101325960646168634E+06, 0.101289070977803320E+06, - 0.101253544677021608E+06, 0.101220938962399465E+06, 0.101189935258524172E+06, 0.101161696612905507E+06, 0.101138721820111517E+06, - 0.101121644349305658E+06, 0.101110649141410599E+06, 0.101105415636551304E+06, 0.101106709372907222E+06, 0.101112684473039320E+06, - 0.101118393699309789E+06, 0.101122164751330070E+06, 0.101127188453840165E+06, 0.101133080620089138E+06, 0.101138746974859983E+06, - 0.101142873479913527E+06, 0.101146389620966002E+06, 0.101149025184660437E+06, 0.101150587859464547E+06, 0.101152755345234560E+06, - 0.101153603260132426E+06, 0.101210525717246186E+06, 0.101207548474999538E+06, 0.101202904596832290E+06, 0.101197951386655157E+06, - 0.101194386519771622E+06, 0.101191122015514105E+06, 0.101188175657561296E+06, 0.101185519945178385E+06, 0.101183085746111174E+06, - 0.101180766773284515E+06, 0.101178424993241424E+06, 0.101174517040993989E+06, 0.101168962341147722E+06, 0.101163714253363345E+06, - 0.101158948557658077E+06, 0.101154261182255184E+06, 0.101149950932639709E+06, 0.101146327181315632E+06, 0.101143687040794233E+06, - 0.101142126337276364E+06, 0.101142152044085655E+06, 0.101144083527112423E+06, 0.101148021171421016E+06, 0.101154000779215450E+06, - 0.101162760282120405E+06, 0.101173711396198050E+06, 0.101186611484798021E+06, 0.101203854792520258E+06, 0.101221108630801245E+06, - 0.101237514909808757E+06, 0.101252212005649548E+06, 0.101264385838287199E+06, 0.101273313773670612E+06, 0.101275991122254636E+06, - 0.101272633847169331E+06, 0.101265839223746094E+06, 0.101257619395513131E+06, 0.101248828329997094E+06, 0.101240269262524962E+06, - 0.101232609922544550E+06, 0.101226305719316471E+06, 0.101221001261636731E+06, 0.101215325578545016E+06, 0.101210148330884782E+06, - 0.101205386910296002E+06, 0.101200913609812837E+06, 0.101196557499459639E+06, 0.101192094621711993E+06, 0.101184939627293686E+06, - 0.101177056092112194E+06, 0.101171384998373789E+06, 0.101168077457142164E+06, 0.101167062491365999E+06, 0.101168742847490139E+06, - 0.101173481015017140E+06, 0.101181062252591364E+06, 0.101190688726292763E+06, 0.101201754487460537E+06, 0.101213053590803727E+06, - 0.101224458950927612E+06, 0.101234613260145692E+06, 0.101242743726390036E+06, 0.101249595831817132E+06, 0.101255046289272010E+06, - 0.101258984767052723E+06, 0.101261363785577109E+06, 0.101261779254400128E+06, 0.101259695740838331E+06, 0.101257723355522670E+06, - 0.101256712782620496E+06, 0.101257390131988577E+06, 0.101260812728128207E+06, 0.101266865110914150E+06, 0.101275356425384583E+06, - 0.101285757165198593E+06, 0.101297005109519319E+06, 0.101307222441895385E+06, 0.101316130802742104E+06, 0.101323131432448601E+06, - 0.101327755554835458E+06, 0.101329091060690815E+06, 0.101327426676222676E+06, 0.101323405755774875E+06, 0.101317808009742424E+06, - 0.101312695092861308E+06, 0.101309644418928467E+06, 0.101307843097245379E+06, 0.101307258014776118E+06, 0.101306396062738830E+06, - 0.101304392989299769E+06, 0.101302318926388383E+06, 0.101300146974100906E+06, 0.101296693003163877E+06, 0.101292171838443071E+06, - 0.101287472873098537E+06, 0.101282787197424317E+06, 0.101276691890622955E+06, 0.101271343380570586E+06, 0.101267971439309680E+06, - 0.101267491024100920E+06, 0.101272069334797809E+06, 0.101279335267968272E+06, 0.101288917788163279E+06, 0.101301241225878053E+06, - 0.101315819189724789E+06, 0.101330320177330534E+06, 0.101343606724499783E+06, 0.101360277666390102E+06, 0.101374651937569957E+06, - 0.101381948044541350E+06, 0.101379139254734604E+06, 0.101357829215456179E+06, 0.101327280040149271E+06, 0.101289941888269532E+06, - 0.101246108522415467E+06, 0.101194796632095546E+06, 0.101146024288208340E+06, 0.101103656741928615E+06, 0.101073141515266252E+06, - 0.101057806173447316E+06, 0.101051682514418280E+06, 0.101049406076037965E+06, 0.101052339673225651E+06, 0.101063115066462298E+06, - 0.101078506068417060E+06, 0.101097590566484258E+06, 0.101118771179471136E+06, 0.101135489318013730E+06, 0.101154758424584812E+06, - 0.101177654242688412E+06, 0.101205061131610448E+06, 0.101242230976538951E+06, 0.101283647903067162E+06, 0.101323242160821901E+06, - 0.101358087742294330E+06, 0.101385937955843910E+06, 0.101409794381458749E+06, 0.101425117131910592E+06, 0.101429997042675925E+06, - 0.101424225668113679E+06, 0.101409012607044147E+06, 0.101378645916584719E+06, 0.101341017521829854E+06, 0.101300635121866770E+06, - 0.101259780015675904E+06, 0.101220490612824302E+06, 0.101183385014229250E+06, 0.101147969487759023E+06, 0.101117685992608021E+06, - 0.101093539937281050E+06, 0.101076195561657238E+06, 0.101065910310074483E+06, 0.101063435753359998E+06, 0.101067804628520898E+06, - 0.101076221687106154E+06, 0.101087269872699864E+06, 0.101098388777976448E+06, 0.101105436139853176E+06, 0.101112874451142532E+06, - 0.101118849015061031E+06, 0.101124113984576659E+06, 0.101128454272832299E+06, 0.101131632912711430E+06, 0.101133440671438293E+06, - 0.101133742258942963E+06, 0.101133420481460824E+06, 0.101203377126110252E+06, 0.101198268613597073E+06, 0.101192518049139719E+06, - 0.101186803252296639E+06, 0.101181813758537333E+06, 0.101178421999043727E+06, 0.101175553435103371E+06, 0.101173179030172672E+06, - 0.101171225754259809E+06, 0.101169580857152410E+06, 0.101168097072006873E+06, 0.101166598871645896E+06, 0.101163936200708034E+06, - 0.101160319529115644E+06, 0.101156350070871646E+06, 0.101152298957045554E+06, 0.101148469397518347E+06, 0.101145174878879858E+06, - 0.101142716121090431E+06, 0.101141356671128422E+06, 0.101141393983984628E+06, 0.101143318014807519E+06, 0.101147349641468565E+06, - 0.101153926105170540E+06, 0.101162646354183598E+06, 0.101173404206242340E+06, 0.101185918183552916E+06, 0.101199863730921250E+06, - 0.101216872253279580E+06, 0.101233295276471807E+06, 0.101248215030952546E+06, 0.101260757021715341E+06, 0.101267495548934719E+06, - 0.101269706371902867E+06, 0.101268204478453976E+06, 0.101262805085999877E+06, 0.101255380826612120E+06, 0.101247430865831397E+06, - 0.101239780825202557E+06, 0.101233090454269026E+06, 0.101227802760140185E+06, 0.101223571816330572E+06, 0.101219066722623626E+06, - 0.101214540599785731E+06, 0.101210406057645538E+06, 0.101206592274863258E+06, 0.101202981532469319E+06, 0.101199400726594919E+06, - 0.101195627874287937E+06, 0.101191227720762778E+06, 0.101187565739316706E+06, 0.101185464827996155E+06, 0.101185511851585936E+06, - 0.101188073018881041E+06, 0.101193228150490002E+06, 0.101201132185450770E+06, 0.101211253103469411E+06, 0.101221691007216708E+06, - 0.101232930515629778E+06, 0.101244622455395234E+06, 0.101256099137093290E+06, 0.101264336488988658E+06, 0.101270613718010951E+06, - 0.101275186944850837E+06, 0.101277911712320536E+06, 0.101275720871891084E+06, 0.101272701050287156E+06, 0.101269530015498065E+06, - 0.101266916775846155E+06, 0.101265667085305176E+06, 0.101266412423480491E+06, 0.101269963618393420E+06, 0.101276824074798991E+06, - 0.101286538984123661E+06, 0.101297754584716895E+06, 0.101309268788473608E+06, 0.101319049570761636E+06, 0.101326688370924327E+06, - 0.101331858743319128E+06, 0.101334118663267698E+06, 0.101332850026087355E+06, 0.101327763563889297E+06, 0.101320054486635490E+06, - 0.101310581963123463E+06, 0.101301464042469088E+06, 0.101296071475081029E+06, 0.101292351628835357E+06, 0.101290169534329834E+06, - 0.101288302766939916E+06, 0.101284014152439850E+06, 0.101279941996829206E+06, 0.101276061598442378E+06, 0.101271538120976256E+06, - 0.101266097326113042E+06, 0.101261239127189925E+06, 0.101257245251898741E+06, 0.101253483641709958E+06, 0.101251125639619684E+06, - 0.101251189762292764E+06, 0.101253695416316186E+06, 0.101260342754598576E+06, 0.101269818597965233E+06, 0.101281786685942599E+06, - 0.101297267888598697E+06, 0.101315752383087500E+06, 0.101333588295053938E+06, 0.101349152940472399E+06, 0.101363783604825469E+06, - 0.101372978867465237E+06, 0.101373889912201208E+06, 0.101361962340075130E+06, 0.101329656482126462E+06, 0.101288577681367635E+06, - 0.101241353955692000E+06, 0.101187015186283301E+06, 0.101128342669573714E+06, 0.101074249019373397E+06, 0.101029162958810339E+06, - 0.101000523612843142E+06, 0.100987089359594960E+06, 0.100984958621042068E+06, 0.100992130612266148E+06, 0.101008448898443559E+06, - 0.101030521667859153E+06, 0.101051007866767963E+06, 0.101071664234935859E+06, 0.101090175915114785E+06, 0.101106549855269026E+06, - 0.101125443846952985E+06, 0.101148128478478480E+06, 0.101176649869573142E+06, 0.101219367480301720E+06, 0.101264169410245595E+06, - 0.101307902998138612E+06, 0.101345704641115881E+06, 0.101377820901637606E+06, 0.101403851472658702E+06, 0.101419708524997433E+06, - 0.101423957150136412E+06, 0.101416125366734399E+06, 0.101392821386149662E+06, 0.101354118286926780E+06, 0.101311952791900418E+06, - 0.101267586958551430E+06, 0.101222923148393995E+06, 0.101179984606825063E+06, 0.101137775123404324E+06, 0.101100052058991307E+06, - 0.101068211877007227E+06, 0.101043182495123227E+06, 0.101025887119877370E+06, 0.101017441028948917E+06, 0.101018646999727091E+06, - 0.101025249625575729E+06, 0.101036067916060245E+06, 0.101049702828005305E+06, 0.101064676552964025E+06, 0.101079565938465035E+06, - 0.101088532594576784E+06, 0.101096312478571519E+06, 0.101102983223382442E+06, 0.101108374984337381E+06, 0.101112280329396730E+06, - 0.101114507038743657E+06, 0.101114428830065517E+06, 0.101111055246130432E+06, 0.101196406538596522E+06, 0.101190461736979341E+06, - 0.101184419171533169E+06, 0.101178438759959274E+06, 0.101172694307587532E+06, 0.101168042459568693E+06, 0.101165224780188713E+06, - 0.101163116738625147E+06, 0.101161640044718297E+06, 0.101160673934197897E+06, 0.101160060130737882E+06, 0.101160308872814785E+06, - 0.101161160328086728E+06, 0.101159852318196237E+06, 0.101156811572228151E+06, 0.101153532829243355E+06, 0.101150328623015521E+06, - 0.101147521674777250E+06, 0.101145421670737880E+06, 0.101144300600728122E+06, 0.101144366524547018E+06, 0.101146453358106490E+06, - 0.101151154760197140E+06, 0.101157852536650826E+06, 0.101166593375939396E+06, 0.101177254193880435E+06, 0.101189538295227583E+06, - 0.101202976381101937E+06, 0.101217143841964367E+06, 0.101233326011591271E+06, 0.101248211830283530E+06, 0.101258376645531374E+06, - 0.101264582921753405E+06, 0.101267070734474910E+06, 0.101266001194085227E+06, 0.101261820132445268E+06, 0.101255225790946322E+06, - 0.101247986960119670E+06, 0.101241132826118715E+06, 0.101235589817356347E+06, 0.101231742691396459E+06, 0.101228190519347510E+06, - 0.101224868811623688E+06, 0.101221346956982394E+06, 0.101217966212733285E+06, 0.101214970532675288E+06, 0.101212299627427041E+06, - 0.101209926653408853E+06, 0.101209182347595939E+06, 0.101208894928154026E+06, 0.101206557077161851E+06, 0.101205653829090777E+06, - 0.101206766501731909E+06, 0.101210234953384323E+06, 0.101216093544594405E+06, 0.101223864474518923E+06, 0.101233270650245788E+06, - 0.101243919236364745E+06, 0.101255411905531102E+06, 0.101267215651558581E+06, 0.101278589053053409E+06, 0.101288326667672663E+06, - 0.101293977254483369E+06, 0.101295988963460462E+06, 0.101293942850610052E+06, 0.101290379977981182E+06, 0.101286211796570817E+06, - 0.101282157951643720E+06, 0.101279101833166642E+06, 0.101277814046354848E+06, 0.101278807487432292E+06, 0.101282938226413549E+06, - 0.101291273361035273E+06, 0.101301583582921769E+06, 0.101312849202165788E+06, 0.101324002651453309E+06, 0.101333489244781522E+06, - 0.101339488921891199E+06, 0.101342369325021820E+06, 0.101341720289730991E+06, 0.101337127319298394E+06, 0.101327791615567519E+06, - 0.101315437423608601E+06, 0.101301282640627105E+06, 0.101286811802460725E+06, 0.101276747879297676E+06, 0.101269331760055575E+06, - 0.101263643990522745E+06, 0.101258989523824217E+06, 0.101251456119543334E+06, 0.101244182196566340E+06, 0.101237348106484831E+06, - 0.101228692607444944E+06, 0.101218585751885927E+06, 0.101210928314959441E+06, 0.101206232353375613E+06, 0.101203871455940549E+06, - 0.101203999533384937E+06, 0.101207475042430247E+06, 0.101214320092416674E+06, 0.101224147807091678E+06, 0.101236699974733609E+06, - 0.101251676274940794E+06, 0.101270825632959895E+06, 0.101293545270099348E+06, 0.101314419599624249E+06, 0.101330994497954525E+06, - 0.101343242305169362E+06, 0.101347429834497641E+06, 0.101341255518135789E+06, 0.101319524205864262E+06, 0.101278200143226626E+06, - 0.101228562906559484E+06, 0.101174212317573372E+06, 0.101112623030610339E+06, 0.101048222350508891E+06, 0.100990099190183420E+06, - 0.100943211786408705E+06, 0.100918044317067266E+06, 0.100907611661432689E+06, 0.100910107183064712E+06, 0.100923917070401818E+06, - 0.100948850301936414E+06, 0.100978281786140433E+06, 0.101008728042257979E+06, 0.101037658211344344E+06, 0.101057364399701371E+06, - 0.101074391235513976E+06, 0.101093594285308805E+06, 0.101116488413099345E+06, 0.101150558690399863E+06, 0.101193914933389984E+06, - 0.101239758121016799E+06, 0.101285323747319708E+06, 0.101327925492475028E+06, 0.101365565138565944E+06, 0.101392573640838629E+06, - 0.101408539383438299E+06, 0.101411604282492801E+06, 0.101400582930128410E+06, 0.101366946069406418E+06, 0.101324287192622069E+06, - 0.101276101666633986E+06, 0.101226619258282910E+06, 0.101178585432356136E+06, 0.101130984262627506E+06, 0.101086307783769356E+06, - 0.101046851053375387E+06, 0.101014063196888950E+06, 0.100988908271188513E+06, 0.100971785835137707E+06, 0.100968245753203373E+06, - 0.100971380696101813E+06, 0.100980060807918417E+06, 0.100993169646215858E+06, 0.101009312468744305E+06, 0.101026966655764860E+06, - 0.101044366184895640E+06, 0.101060339563627815E+06, 0.101071158866529076E+06, 0.101079488812984200E+06, 0.101086153913575283E+06, - 0.101090971172654899E+06, 0.101093525999388585E+06, 0.101092846852564820E+06, 0.101089780957355411E+06, 0.101191123249149765E+06, - 0.101184975896710632E+06, 0.101178781171733193E+06, 0.101172687284701038E+06, 0.101166856628363908E+06, 0.101161463025241668E+06, - 0.101157556719236236E+06, 0.101155715658911155E+06, 0.101154729896713383E+06, 0.101154469238441612E+06, 0.101155775624535832E+06, - 0.101158121462038107E+06, 0.101160042093184384E+06, 0.101161344855236384E+06, 0.101160448275110015E+06, 0.101158071590188309E+06, - 0.101155631532086059E+06, 0.101153465356088433E+06, 0.101151897289994900E+06, 0.101151213659422618E+06, 0.101151737576582789E+06, - 0.101154199170773107E+06, 0.101158985005759008E+06, 0.101165841396522868E+06, 0.101174673234837159E+06, 0.101185340894024586E+06, - 0.101197532040988634E+06, 0.101210762902995120E+06, 0.101224385238204501E+06, 0.101237894404589199E+06, 0.101250772227856185E+06, - 0.101260411029266310E+06, 0.101266591706174368E+06, 0.101269204187456722E+06, 0.101268397182717250E+06, 0.101264588122030676E+06, - 0.101258438511883942E+06, 0.101251623403392019E+06, 0.101246063118456994E+06, 0.101242417800723517E+06, 0.101239166549985050E+06, - 0.101236254306650939E+06, 0.101233631773944420E+06, 0.101231248894982156E+06, 0.101228825720597553E+06, 0.101226772928204024E+06, - 0.101225473798737570E+06, 0.101225516278296083E+06, 0.101226043519455008E+06, 0.101227093486833808E+06, 0.101228289760449348E+06, - 0.101228546951147655E+06, 0.101230707510254171E+06, 0.101235093253586310E+06, 0.101241126677553519E+06, 0.101248645598633651E+06, - 0.101258142018320970E+06, 0.101268933306888299E+06, 0.101280513500391826E+06, 0.101292262732881034E+06, 0.101303355465601169E+06, - 0.101312817264586003E+06, 0.101316400177874268E+06, 0.101315483458758521E+06, 0.101312277984593762E+06, 0.101307698621808959E+06, - 0.101302673951913355E+06, 0.101298053010945936E+06, 0.101294840530663249E+06, 0.101294065839099727E+06, 0.101296783533959431E+06, - 0.101302065639223511E+06, 0.101310033568624291E+06, 0.101320378178744606E+06, 0.101331366932783130E+06, 0.101341800425977897E+06, - 0.101350415611308272E+06, 0.101354800042096002E+06, 0.101354718500839095E+06, 0.101350294315183972E+06, 0.101341487001001398E+06, - 0.101327926160731338E+06, 0.101310260858651716E+06, 0.101290273767883307E+06, 0.101269495556410489E+06, 0.101251846238950835E+06, - 0.101238682635122401E+06, 0.101227174341821534E+06, 0.101213482647208613E+06, 0.101195603009729079E+06, 0.101177872156641286E+06, - 0.101162325618075352E+06, 0.101149982165601716E+06, 0.101139852149278217E+06, 0.101134024565056650E+06, 0.101132753824598782E+06, - 0.101135032680571021E+06, 0.101140084766430024E+06, 0.101148877574289698E+06, 0.101161005262514984E+06, 0.101174747769146576E+06, - 0.101190713232751208E+06, 0.101208811802622309E+06, 0.101231640660711972E+06, 0.101258571723189729E+06, 0.101282336017681446E+06, - 0.101299629439163051E+06, 0.101308040998087759E+06, 0.101305555171365690E+06, 0.101290435343250807E+06, 0.101256519799893256E+06, - 0.101204322883293091E+06, 0.101144321216045384E+06, 0.101080811870748948E+06, 0.101014238668434729E+06, 0.100950513534181708E+06, - 0.100894391363170798E+06, 0.100851829575523923E+06, 0.100832142921501421E+06, 0.100825615789308096E+06, 0.100832955840479583E+06, - 0.100854821405899405E+06, 0.100888239967709887E+06, 0.100925422763286362E+06, 0.100962602314510819E+06, 0.100994687767612981E+06, - 0.101018445383155631E+06, 0.101039638130810010E+06, 0.101060824122542370E+06, 0.101084945514884181E+06, 0.101122354145820311E+06, - 0.101165147778325379E+06, 0.101210847657910417E+06, 0.101256682236652778E+06, 0.101301382158490291E+06, 0.101341411155713809E+06, - 0.101372219111328362E+06, 0.101389231784620119E+06, 0.101390880863434664E+06, 0.101369226261351185E+06, 0.101331834231281726E+06, - 0.101285779545129859E+06, 0.101234345503529141E+06, 0.101180743690781746E+06, 0.101127223607977256E+06, 0.101076620915575957E+06, - 0.101030138146362922E+06, 0.100989582250385356E+06, 0.100956503181212684E+06, 0.100931937764084651E+06, 0.100920299784557195E+06, - 0.100918057371207338E+06, 0.100922770743209869E+06, 0.100933261994784887E+06, 0.100948483778151451E+06, 0.100967026543898348E+06, - 0.100987282070977919E+06, 0.101007276882737569E+06, 0.101025807002176851E+06, 0.101042092544874176E+06, 0.101053732614110791E+06, - 0.101061889868345606E+06, 0.101067702910314212E+06, 0.101070224192290465E+06, 0.101070263142884942E+06, 0.101067836061994312E+06, - 0.101188101877120876E+06, 0.101181904204517952E+06, 0.101175721080675750E+06, 0.101169689701016847E+06, 0.101163962332899173E+06, - 0.101158703372389791E+06, 0.101154083105507743E+06, 0.101151357736191479E+06, 0.101150899044327409E+06, 0.101152824487497259E+06, - 0.101156224838871945E+06, 0.101159507416219887E+06, 0.101162417168140935E+06, 0.101164756494849746E+06, 0.101166400553546104E+06, - 0.101165982684454619E+06, 0.101164433293333408E+06, 0.101163049411835455E+06, 0.101162175585306977E+06, 0.101162128095756125E+06, - 0.101163361425100273E+06, 0.101166227742201969E+06, 0.101170937924715152E+06, 0.101177913034471421E+06, 0.101186917319165936E+06, - 0.101197704545258457E+06, 0.101209946031686050E+06, 0.101223141837685776E+06, 0.101236628019135329E+06, 0.101248564959035430E+06, - 0.101259061289307880E+06, 0.101268404236147617E+06, 0.101274449875235630E+06, 0.101277082514349167E+06, 0.101276437786749404E+06, - 0.101272910152209646E+06, 0.101267124457491314E+06, 0.101260716984134080E+06, 0.101256743164844607E+06, 0.101253604663335806E+06, - 0.101250897345323741E+06, 0.101248591593381454E+06, 0.101246654559015689E+06, 0.101245041613427515E+06, 0.101243680788220503E+06, - 0.101243097273199470E+06, 0.101243781512439353E+06, 0.101244948599458978E+06, 0.101246597302939059E+06, 0.101248747416430124E+06, - 0.101251423906546814E+06, 0.101254153427662954E+06, 0.101257318705204321E+06, 0.101261887373189515E+06, 0.101267979989058746E+06, - 0.101275948774720324E+06, 0.101285713213097159E+06, 0.101296774828760288E+06, 0.101308302668075557E+06, 0.101319850467473152E+06, - 0.101329837083710619E+06, 0.101335921303205963E+06, 0.101339123113933456E+06, 0.101337898637374194E+06, 0.101333773323031986E+06, - 0.101328456667992868E+06, 0.101322897112772887E+06, 0.101317900606162963E+06, 0.101315889108461066E+06, 0.101316599306327043E+06, - 0.101319758730558635E+06, 0.101325424301052059E+06, 0.101333284991047447E+06, 0.101343211873693581E+06, 0.101353644944564134E+06, - 0.101363021317380320E+06, 0.101370049287251401E+06, 0.101372596455484265E+06, 0.101369268865042672E+06, 0.101360883616870342E+06, - 0.101347449435595729E+06, 0.101329133164082014E+06, 0.101305327141900649E+06, 0.101278380398203022E+06, 0.101249743471045615E+06, - 0.101219239546209603E+06, 0.101192352888002861E+06, 0.101165652475197479E+06, 0.101139697586887822E+06, 0.101114494511137265E+06, - 0.101090858686180072E+06, 0.101071576294283674E+06, 0.101057575297732197E+06, 0.101048074783742806E+06, 0.101044336258060692E+06, - 0.101046551193469917E+06, 0.101053556962642004E+06, 0.101063713831673056E+06, 0.101077829626709223E+06, 0.101095071852015652E+06, - 0.101113125151151267E+06, 0.101132720710483336E+06, 0.101154045391176667E+06, 0.101180390285880436E+06, 0.101211142948122884E+06, - 0.101237614514436951E+06, 0.101255726302408526E+06, 0.101259492448119025E+06, 0.101250509056824711E+06, 0.101227395084634161E+06, - 0.101182035261948520E+06, 0.101119630114631931E+06, 0.101050635848782738E+06, 0.100979922793482459E+06, 0.100910697623495973E+06, - 0.100847357213499476E+06, 0.100794166368117731E+06, 0.100758894445481623E+06, 0.100744322296544080E+06, 0.100745120848886974E+06, - 0.100759352059448109E+06, 0.100791294801023934E+06, 0.100833112039419531E+06, 0.100877562571698305E+06, 0.100920779246866339E+06, - 0.100955025798225848E+06, 0.100982525754081420E+06, 0.101006044587505748E+06, 0.101028143007870822E+06, 0.101055611280174300E+06, - 0.101091320427340703E+06, 0.101132355621430252E+06, 0.101176767088174020E+06, 0.101222102616479577E+06, 0.101267504098879013E+06, - 0.101307233300950669E+06, 0.101337730007502250E+06, 0.101356132691262712E+06, 0.101355517504656993E+06, 0.101326703347885734E+06, - 0.101286746249401243E+06, 0.101238373176205030E+06, 0.101184685036191077E+06, 0.101128907484998796E+06, 0.101073391747240559E+06, - 0.101019454525129811E+06, 0.100970871910515343E+06, 0.100929826661987419E+06, 0.100897105571455861E+06, 0.100876831879007659E+06, - 0.100867962906273533E+06, 0.100867330421829305E+06, 0.100873728684090966E+06, 0.100885749735442761E+06, 0.100902849954122852E+06, - 0.100924138951177738E+06, 0.100946961851234868E+06, 0.100969279025770302E+06, 0.100990033557581031E+06, 0.101008477654044342E+06, - 0.101024214908302165E+06, 0.101035732998499894E+06, 0.101041912961714450E+06, 0.101045642366251923E+06, 0.101046792406885972E+06, - 0.101045365333532347E+06, 0.101187355100872199E+06, 0.101181283838042174E+06, 0.101175299671037268E+06, 0.101169529662610788E+06, - 0.101164117431673949E+06, 0.101159220075809775E+06, 0.101155001817589582E+06, 0.101151624022777440E+06, 0.101152497595067340E+06, - 0.101156451659840226E+06, 0.101160648061411019E+06, 0.101164790528929152E+06, 0.101168618147906396E+06, 0.101171926049179310E+06, - 0.101174580360364256E+06, 0.101176526712674633E+06, 0.101176736224529814E+06, 0.101176257363116325E+06, 0.101176166983752380E+06, - 0.101176807287626842E+06, 0.101178681128324213E+06, 0.101182078251181316E+06, 0.101187204570596310E+06, 0.101194163269585537E+06, - 0.101203334524264646E+06, 0.101214364937736551E+06, 0.101226809413448165E+06, 0.101240149829298927E+06, 0.101253261358725853E+06, - 0.101265100089497806E+06, 0.101275120974395875E+06, 0.101282996940042518E+06, 0.101288828111014154E+06, 0.101291420149586207E+06, - 0.101290897222999163E+06, 0.101287639377078289E+06, 0.101283002528089506E+06, 0.101278193857728707E+06, 0.101273020512430914E+06, - 0.101269901051284018E+06, 0.101267678623295869E+06, 0.101265950449211479E+06, 0.101264703039611326E+06, 0.101263900879826906E+06, - 0.101263923607509249E+06, 0.101265004562038375E+06, 0.101266684912193334E+06, 0.101268855296950496E+06, 0.101271506964180182E+06, - 0.101274640173084292E+06, 0.101278241537383161E+06, 0.101282245825992912E+06, 0.101286353240369135E+06, 0.101291355828485597E+06, - 0.101297931619035255E+06, 0.101306253371424813E+06, 0.101316214078965480E+06, 0.101327380285913983E+06, 0.101338920669929619E+06, - 0.101349293450103680E+06, 0.101357122930671496E+06, 0.101362252520088790E+06, 0.101364464771970830E+06, 0.101363785192026829E+06, - 0.101359089181177871E+06, 0.101353368594169064E+06, 0.101348059285105599E+06, 0.101344504609358351E+06, 0.101342802273270747E+06, - 0.101343694674300015E+06, 0.101347186594235303E+06, 0.101353156284255645E+06, 0.101361135003142495E+06, 0.101370388484892959E+06, - 0.101380640458787442E+06, 0.101388946718752617E+06, 0.101393651801589484E+06, 0.101393499019751704E+06, 0.101386884558896083E+06, - 0.101374143979384535E+06, 0.101355609362859250E+06, 0.101331626780358332E+06, 0.101301083582183201E+06, 0.101263353354839783E+06, - 0.101221306897352624E+06, 0.101176993466944725E+06, 0.101136539903244993E+06, 0.101098204242251013E+06, 0.101061761330862719E+06, - 0.101028266665796909E+06, 0.100998589290583972E+06, 0.100975333400938267E+06, 0.100959068131358043E+06, 0.100949766177223195E+06, - 0.100947806353674678E+06, 0.100952626346498961E+06, 0.100962758032929953E+06, 0.100976213788639361E+06, 0.100993663080123253E+06, - 0.101014486892675981E+06, 0.101035822837299012E+06, 0.101058579399157214E+06, 0.101083303211150094E+06, 0.101113186489526008E+06, - 0.101147351565124962E+06, 0.101176652682216401E+06, 0.101196193972918787E+06, 0.101198569776344622E+06, 0.101186160134931008E+06, - 0.101157868126258880E+06, 0.101103141394806822E+06, 0.101031831614193070E+06, 0.100956733996206865E+06, 0.100882403087983286E+06, - 0.100813473138545116E+06, 0.100752516407046714E+06, 0.100703757785565627E+06, 0.100676218536944187E+06, 0.100667431274046598E+06, - 0.100674873519601999E+06, 0.100697658618489222E+06, 0.100739841159568794E+06, 0.100789068474863947E+06, 0.100839720710070338E+06, - 0.100886379550526690E+06, 0.100923029883014446E+06, 0.100953143284320337E+06, 0.100977639241319004E+06, 0.100999128395021136E+06, - 0.101024581691416737E+06, 0.101055845921262473E+06, 0.101093715024692676E+06, 0.101137145750038864E+06, 0.101181709309337297E+06, - 0.101225325474523444E+06, 0.101263559713032722E+06, 0.101292474677031365E+06, 0.101308682549641118E+06, 0.101297475120822361E+06, - 0.101271409211849808E+06, 0.101232040601299872E+06, 0.101182869285470704E+06, 0.101128290980360704E+06, 0.101072929755581790E+06, - 0.101016889073163620E+06, 0.100962491541966170E+06, 0.100912327910715336E+06, 0.100869361400221751E+06, 0.100839775977090918E+06, - 0.100823441492130820E+06, 0.100816113342184137E+06, 0.100817094874734074E+06, 0.100825233759279654E+06, 0.100839074432490510E+06, - 0.100858082771811969E+06, 0.100882174552001874E+06, 0.100906977487573211E+06, 0.100931151837540980E+06, 0.100953671595204651E+06, - 0.100973813441941427E+06, 0.100991208365737388E+06, 0.101004593996319396E+06, 0.101014464426847393E+06, 0.101019840305871679E+06, - 0.101022516216040211E+06, 0.101022479820383916E+06, 0.101189306237606637E+06, 0.101183099563423224E+06, 0.101177524645541649E+06, - 0.101172236435105573E+06, 0.101167371532973528E+06, 0.101163082020276575E+06, 0.101159529060147339E+06, 0.101159316447558173E+06, - 0.101160894564677219E+06, 0.101164348300187223E+06, 0.101169261422140553E+06, 0.101174195290734366E+06, 0.101178879818970003E+06, - 0.101183100812083387E+06, 0.101186714675334646E+06, 0.101189656703835382E+06, 0.101191942124414170E+06, 0.101192917377320977E+06, - 0.101193593575982464E+06, 0.101195069630171711E+06, 0.101197693383898673E+06, 0.101201751769885639E+06, 0.101207449602623747E+06, - 0.101214890679059696E+06, 0.101224061589853489E+06, 0.101235336912347877E+06, 0.101248190104239126E+06, 0.101262427935202722E+06, - 0.101275786221996692E+06, 0.101287697523967043E+06, 0.101297635973110140E+06, 0.101305160473319178E+06, 0.101310051693956630E+06, - 0.101312576731523863E+06, 0.101312178530984005E+06, 0.101309704462442271E+06, 0.101306154021924303E+06, 0.101301740366064056E+06, - 0.101296951709652378E+06, 0.101292269396465854E+06, 0.101290108113855764E+06, 0.101288928548419208E+06, 0.101288387917089291E+06, - 0.101288777866387623E+06, 0.101290116771842790E+06, 0.101292139767421628E+06, 0.101294723268304471E+06, 0.101297795211849851E+06, - 0.101301366709605994E+06, 0.101305420330384557E+06, 0.101309869927812077E+06, 0.101314312823006214E+06, 0.101319116997910372E+06, - 0.101324617109151222E+06, 0.101331532615370001E+06, 0.101340103637168490E+06, 0.101350201834497682E+06, 0.101361344371531173E+06, - 0.101372418886796950E+06, 0.101381948875157381E+06, 0.101388923839096911E+06, 0.101393136106285616E+06, 0.101394429864949576E+06, - 0.101392894622174237E+06, 0.101388710803148075E+06, 0.101383777236252092E+06, 0.101379295952832908E+06, 0.101375940276367168E+06, - 0.101374441230547527E+06, 0.101375326622697306E+06, 0.101379093018278771E+06, 0.101385343361571824E+06, 0.101393971058482173E+06, - 0.101404050563811383E+06, 0.101413309721598285E+06, 0.101419590399406094E+06, 0.101421556394179410E+06, 0.101418021431235960E+06, - 0.101407974515161055E+06, 0.101390537479077990E+06, 0.101366032709315157E+06, 0.101334626683717870E+06, 0.101295933958054040E+06, - 0.101248443893183838E+06, 0.101195557967522065E+06, 0.101139585544601810E+06, 0.101085211343045346E+06, 0.101035266930195139E+06, - 0.100988241812145512E+06, 0.100945367896748721E+06, 0.100910497202633036E+06, 0.100884702886764164E+06, 0.100866517649476897E+06, - 0.100856014684083144E+06, 0.100852787000617667E+06, 0.100856653557479323E+06, 0.100867163372326730E+06, 0.100881111266454434E+06, - 0.100900315195405696E+06, 0.100923976750114074E+06, 0.100948598119614544E+06, 0.100974781704195004E+06, 0.101003202157587060E+06, - 0.101036407590628412E+06, 0.101073193182310031E+06, 0.101104736474453239E+06, 0.101125695287679831E+06, 0.101129453279073452E+06, - 0.101117773581594010E+06, 0.101089185532541305E+06, 0.101034032199054171E+06, 0.100963945545633382E+06, 0.100886699328991119E+06, - 0.100810636627241329E+06, 0.100740715610179395E+06, 0.100679191246166200E+06, 0.100632989251138570E+06, 0.100613781871159343E+06, - 0.100610871530594683E+06, 0.100624379990977119E+06, 0.100656925116010229E+06, 0.100705935141557828E+06, 0.100761070879974053E+06, - 0.100816622699684551E+06, 0.100864793595773081E+06, 0.100902967646118850E+06, 0.100932714749620762E+06, 0.100956310150092322E+06, - 0.100973624358999965E+06, 0.100992241483773090E+06, 0.101016637765204548E+06, 0.101048154107647293E+06, 0.101087466334016062E+06, - 0.101132339254048915E+06, 0.101174823812832328E+06, 0.101210761915469266E+06, 0.101237271423401384E+06, 0.101243002885737078E+06, - 0.101230131791106003E+06, 0.101203940299668466E+06, 0.101166656487591579E+06, 0.101121119041289232E+06, 0.101069073832594047E+06, - 0.101014700223724387E+06, 0.100959265268248433E+06, 0.100905468112225586E+06, 0.100856040902612105E+06, 0.100814460428244129E+06, - 0.100787259237540056E+06, 0.100772005863003345E+06, 0.100765985352267919E+06, 0.100768479113289053E+06, 0.100778366997407138E+06, - 0.100794945598743492E+06, 0.100817620478677374E+06, 0.100842147859125718E+06, 0.100867955315801722E+06, 0.100893394586128459E+06, - 0.100917107047287223E+06, 0.100938380004807230E+06, 0.100955347801049342E+06, 0.100970101009214006E+06, 0.100982904354844184E+06, - 0.100992784717252944E+06, 0.100997426697573173E+06, 0.100999203666720758E+06, 0.101193726602745155E+06, 0.101187754050723946E+06, - 0.101182357442443288E+06, 0.101177791388126643E+06, 0.101173723996436573E+06, 0.101170304719806183E+06, 0.101170612153776412E+06, - 0.101172440371721386E+06, 0.101174837075875621E+06, 0.101177672254314428E+06, 0.101182161160034389E+06, 0.101187828651191783E+06, - 0.101193320301503438E+06, 0.101198410730358519E+06, 0.101202946144533795E+06, 0.101206852558810875E+06, 0.101210007801575470E+06, - 0.101212489910168282E+06, 0.101214469378389869E+06, 0.101216878002924321E+06, 0.101220363461237575E+06, 0.101225214136769951E+06, - 0.101231637580600829E+06, 0.101239741560505950E+06, 0.101249517808410572E+06, 0.101260983023677167E+06, 0.101275957870551239E+06, - 0.101290656294668952E+06, 0.101304333702323362E+06, 0.101316427532517599E+06, 0.101326426428850100E+06, 0.101333915035895625E+06, - 0.101338611708287717E+06, 0.101340492859798338E+06, 0.101340362563395611E+06, 0.101338449476013702E+06, 0.101335257523435517E+06, - 0.101331249861504504E+06, 0.101326886093198918E+06, 0.101322617484757109E+06, 0.101318867500197564E+06, 0.101317900452591755E+06, - 0.101318314786954928E+06, 0.101319723768116164E+06, 0.101321959881412520E+06, 0.101324889048512938E+06, 0.101328347647524672E+06, - 0.101332174840765205E+06, 0.101336616060312401E+06, 0.101341556829236884E+06, 0.101346573413864826E+06, 0.101351603295543347E+06, - 0.101356815104860521E+06, 0.101362438373961399E+06, 0.101369371088361426E+06, 0.101378082295762331E+06, 0.101388314410706720E+06, - 0.101399372327800622E+06, 0.101410061836120745E+06, 0.101419580351030396E+06, 0.101425913537260407E+06, 0.101429293259021812E+06, - 0.101429804412116951E+06, 0.101427672924137820E+06, 0.101424080437455879E+06, 0.101419619212416699E+06, 0.101415230974183942E+06, - 0.101412067965185430E+06, 0.101410791086110883E+06, 0.101411739073867124E+06, 0.101415639705951602E+06, 0.101423312622668134E+06, - 0.101432474045874798E+06, 0.101442051195699867E+06, 0.101450469188552204E+06, 0.101454491373749755E+06, 0.101453440137517347E+06, - 0.101446281387837167E+06, 0.101431595048405667E+06, 0.101408886711617088E+06, 0.101378784184722594E+06, 0.101341184770978914E+06, - 0.101295889547724786E+06, 0.101240328400627433E+06, 0.101177652284460986E+06, 0.101111150684114546E+06, 0.101044053118300144E+06, - 0.100984918740243505E+06, 0.100930374090685815E+06, 0.100881582472409573E+06, 0.100841112633375247E+06, 0.100809768362702191E+06, - 0.100786799243457121E+06, 0.100772143085301912E+06, 0.100764968278141983E+06, 0.100765770745809103E+06, 0.100774102380776618E+06, - 0.100787701814049200E+06, 0.100807502103195773E+06, 0.100832717694658859E+06, 0.100860249536352872E+06, 0.100889852423407749E+06, - 0.100921848628126099E+06, 0.100957861355781963E+06, 0.100996433916241411E+06, 0.101029829562515966E+06, 0.101052485930506547E+06, - 0.101058372937639273E+06, 0.101049548410078569E+06, 0.101024243456762211E+06, 0.100972590760278690E+06, 0.100908281417167527E+06, - 0.100837060983074800E+06, 0.100768161325613342E+06, 0.100704714640766149E+06, 0.100649980401007386E+06, 0.100610226186345069E+06, - 0.100590748020045430E+06, 0.100587436259410169E+06, 0.100600313080586799E+06, 0.100641206195168561E+06, 0.100694783185600594E+06, - 0.100753395339411843E+06, 0.100811221255729251E+06, 0.100860359364136690E+06, 0.100899824043495319E+06, 0.100928315410134717E+06, - 0.100945425133485944E+06, 0.100949685705930868E+06, 0.100959203677864440E+06, 0.100974757114044391E+06, 0.100998131833821230E+06, - 0.101033920715517670E+06, 0.101074219109624129E+06, 0.101114091820176982E+06, 0.101149405994865883E+06, 0.101170348641579942E+06, - 0.101169807298637141E+06, 0.101156298476682292E+06, 0.101130628971099330E+06, 0.101094643437300154E+06, 0.101052492078486888E+06, - 0.101007253119503090E+06, 0.100955907017813224E+06, 0.100902084595712833E+06, 0.100849827379669470E+06, 0.100802083544595851E+06, - 0.100765913220995702E+06, 0.100739572869835451E+06, 0.100723779479156976E+06, 0.100718506421119528E+06, 0.100722320980193326E+06, - 0.100734436110120514E+06, 0.100755329206052033E+06, 0.100779519272158068E+06, 0.100805173540144926E+06, 0.100830784490592530E+06, - 0.100856189170746162E+06, 0.100880432886013805E+06, 0.100899949784039432E+06, 0.100917438620547167E+06, 0.100933522862752710E+06, - 0.100948109352301544E+06, 0.100961044329522949E+06, 0.100971373211325132E+06, 0.100975423948777170E+06, 0.101200152192834488E+06, - 0.101194982325493736E+06, 0.101190103263664205E+06, 0.101186138559247396E+06, 0.101183134221834189E+06, 0.101184216681154692E+06, - 0.101186521041798725E+06, 0.101189436060083317E+06, 0.101192802546943451E+06, 0.101196478796712297E+06, 0.101200354354545649E+06, - 0.101205668611732151E+06, 0.101211929159398627E+06, 0.101217855930562437E+06, 0.101223284560094209E+06, 0.101227968215825720E+06, - 0.101231889676374194E+06, 0.101235394681567603E+06, 0.101238691342655846E+06, 0.101242180145337508E+06, 0.101246637252434826E+06, - 0.101252408136256170E+06, 0.101259706939182157E+06, 0.101268648761024378E+06, 0.101279505402642011E+06, 0.101294343975882977E+06, - 0.101309563533686218E+06, 0.101324641711895500E+06, 0.101338688391072021E+06, 0.101351044389960793E+06, 0.101361207159967045E+06, - 0.101368783445243811E+06, 0.101373529077171552E+06, 0.101374957490127519E+06, 0.101374464042535998E+06, 0.101372814207710297E+06, - 0.101369991240096075E+06, 0.101366429702577938E+06, 0.101362562430391059E+06, 0.101358815668015828E+06, 0.101355589086463762E+06, - 0.101353446673457220E+06, 0.101354379072032898E+06, 0.101356568662050558E+06, 0.101359675232751892E+06, 0.101363521918530183E+06, - 0.101367901119934351E+06, 0.101372596354978567E+06, 0.101377679630817802E+06, 0.101383555064504282E+06, 0.101389214201889146E+06, - 0.101394747283543154E+06, 0.101400304955646759E+06, 0.101406085277459220E+06, 0.101412285840230092E+06, 0.101421118963008921E+06, - 0.101431763041225102E+06, 0.101442507714153820E+06, 0.101452705296310087E+06, 0.101461587946274274E+06, 0.101468308697248838E+06, - 0.101470980618346424E+06, 0.101470729759961876E+06, 0.101468260238464049E+06, 0.101464485269084631E+06, 0.101460142280246233E+06, - 0.101455922507406227E+06, 0.101452998879112638E+06, 0.101452045655453316E+06, 0.101454002525278673E+06, 0.101458795222069632E+06, - 0.101466167386261062E+06, 0.101474834484365027E+06, 0.101483448321051124E+06, 0.101490293297485317E+06, 0.101492761571887779E+06, - 0.101487122913431667E+06, 0.101474656695076628E+06, 0.101456224507296021E+06, 0.101430664509854570E+06, 0.101396241168372988E+06, - 0.101353344458271313E+06, 0.101301873429881321E+06, 0.101240809982906721E+06, 0.101170237649192510E+06, 0.101096056635001150E+06, - 0.101022326149495057E+06, 0.100954494264510751E+06, 0.100892663983306251E+06, 0.100837194485465618E+06, 0.100789854158125687E+06, - 0.100752681688232609E+06, 0.100724050472389747E+06, 0.100703743253736306E+06, 0.100691513151292049E+06, 0.100687489061012806E+06, - 0.100691112445670500E+06, 0.100703488782601926E+06, 0.100723515984008409E+06, 0.100749686437924174E+06, 0.100779862035053753E+06, - 0.100812870466228749E+06, 0.100848356219152789E+06, 0.100886618033728999E+06, 0.100925814700154908E+06, 0.100959913340029161E+06, - 0.100983841408427761E+06, 0.100992708938197888E+06, 0.100988038726636543E+06, 0.100967451749821237E+06, 0.100923773661071609E+06, - 0.100869154347678006E+06, 0.100808293671752166E+06, 0.100749950128448239E+06, 0.100695742144580625E+06, 0.100650055466795442E+06, - 0.100620543751264457E+06, 0.100607774629359716E+06, 0.100609856499218455E+06, 0.100627731512123690E+06, 0.100665827330432643E+06, - 0.100713727303578300E+06, 0.100768972922192886E+06, 0.100825101449405265E+06, 0.100873709631678183E+06, 0.100911910907812446E+06, - 0.100937425920985901E+06, 0.100943826278808614E+06, 0.100938923612846338E+06, 0.100932772703382885E+06, 0.100933209681834254E+06, - 0.100949942917228545E+06, 0.100978390439217677E+06, 0.101012218238497939E+06, 0.101047001443362271E+06, 0.101078030320958118E+06, - 0.101092528178749781E+06, 0.101092763600199483E+06, 0.101079667768304178E+06, 0.101055363093306296E+06, 0.101021923023798488E+06, - 0.100985043918944197E+06, 0.100942576674115116E+06, 0.100896142310934607E+06, 0.100846740359288175E+06, 0.100796745756417309E+06, - 0.100754281013923188E+06, 0.100719661969801513E+06, 0.100694202095497239E+06, 0.100678990016565542E+06, 0.100674159552381345E+06, - 0.100679144362130333E+06, 0.100696517057853678E+06, 0.100718723297862292E+06, 0.100743828966135392E+06, 0.100770038155539907E+06, - 0.100795879753092362E+06, 0.100820314666932885E+06, 0.100840279171251284E+06, 0.100859249879902098E+06, 0.100877455365052447E+06, - 0.100894767625869688E+06, 0.100911051050858092E+06, 0.100926113687447752E+06, 0.100939677540915931E+06, 0.100954098051095163E+06, - 0.101208266074669766E+06, 0.101204147301312958E+06, 0.101200416332034234E+06, 0.101197391022381067E+06, 0.101199181271863577E+06, - 0.101202094479608772E+06, 0.101205718922681015E+06, 0.101209868079757638E+06, 0.101214363087133126E+06, 0.101219049217859545E+06, - 0.101223809934456556E+06, 0.101228578149758148E+06, 0.101234563424877633E+06, 0.101241302361129114E+06, 0.101247428820028508E+06, - 0.101252833705618847E+06, 0.101257741214607289E+06, 0.101262268791874914E+06, 0.101266621965163562E+06, 0.101271104202253337E+06, - 0.101276449761759577E+06, 0.101283261996570189E+06, 0.101291578552841063E+06, 0.101301921001578070E+06, 0.101316864610287244E+06, - 0.101332633397110185E+06, 0.101348565409528048E+06, 0.101363970375545556E+06, 0.101378339950166031E+06, 0.101391005184961628E+06, - 0.101401390238182328E+06, 0.101409118811233842E+06, 0.101412813852507519E+06, 0.101413916622343488E+06, 0.101413648249779086E+06, - 0.101412262363096830E+06, 0.101409843816287481E+06, 0.101406792118611833E+06, 0.101403515263375913E+06, 0.101400419883465394E+06, - 0.101397648089374270E+06, 0.101396200071828469E+06, 0.101396462464251483E+06, 0.101399249041504649E+06, 0.101403242459244415E+06, - 0.101408064521844237E+06, 0.101413460579763079E+06, 0.101419299541355576E+06, 0.101425515902185769E+06, 0.101431872156549493E+06, - 0.101438092345517420E+06, 0.101444082593329236E+06, 0.101449980221889302E+06, 0.101455962961780679E+06, 0.101462741205452243E+06, - 0.101470817291088752E+06, 0.101480892587434573E+06, 0.101491089133211004E+06, 0.101500643428374140E+06, 0.101508817670985038E+06, - 0.101514860224122342E+06, 0.101517434476198061E+06, 0.101516541747761323E+06, 0.101513815068472235E+06, 0.101509904719619197E+06, - 0.101505507654049128E+06, 0.101501313463842132E+06, 0.101498849002981064E+06, 0.101499159934514231E+06, 0.101501693020130377E+06, - 0.101506338552975649E+06, 0.101512651659291208E+06, 0.101520288072555239E+06, 0.101527432009874057E+06, 0.101531192551327069E+06, - 0.101528423709889583E+06, 0.101519435532333911E+06, 0.101504734513441072E+06, 0.101484004484384001E+06, 0.101456280732745858E+06, - 0.101419035179553714E+06, 0.101371837096264266E+06, 0.101315248944149382E+06, 0.101249891741609565E+06, 0.101174205010685138E+06, - 0.101095025216710172E+06, 0.101016603839094241E+06, 0.100942714517862012E+06, 0.100875651961458614E+06, 0.100815206600637175E+06, - 0.100762266129504540E+06, 0.100719792923412402E+06, 0.100688381242510412E+06, 0.100664315202569429E+06, 0.100646899315571907E+06, - 0.100636389190856382E+06, 0.100633921317728295E+06, 0.100640986745192960E+06, 0.100657927960284273E+06, 0.100683603999329847E+06, - 0.100715139361547874E+06, 0.100750464071587950E+06, 0.100789001781336541E+06, 0.100828980626378441E+06, 0.100867904881876937E+06, - 0.100901941917073651E+06, 0.100927518925117751E+06, 0.100941703370720032E+06, 0.100943313763502156E+06, 0.100929483993483183E+06, - 0.100897899422321643E+06, 0.100855144068640948E+06, 0.100806216832129357E+06, 0.100757963881253396E+06, 0.100713882396988687E+06, - 0.100678037239657642E+06, 0.100660578064393208E+06, 0.100655660139403961E+06, 0.100663394611081239E+06, 0.100687757803070126E+06, - 0.100726360544964817E+06, 0.100771737117872792E+06, 0.100819550423355045E+06, 0.100863789606076709E+06, 0.100903960982124961E+06, - 0.100937933974381580E+06, 0.100955929021348216E+06, 0.100950002084778927E+06, 0.100936336168784517E+06, 0.100920611799506456E+06, - 0.100908792443247541E+06, 0.100909956087163751E+06, 0.100924519937428529E+06, 0.100950317855032117E+06, 0.100978637481090613E+06, - 0.101001785171553231E+06, 0.101014600980588948E+06, 0.101015533816949537E+06, 0.101004399554267075E+06, 0.100982402170127083E+06, - 0.100954472767269413E+06, 0.100920498290662959E+06, 0.100881272186000555E+06, 0.100838252143924561E+06, 0.100793001524282852E+06, - 0.100749722238879811E+06, 0.100710007831689465E+06, 0.100676561452258436E+06, 0.100651754156739727E+06, 0.100637016515992684E+06, - 0.100632797680647462E+06, 0.100643122435673547E+06, 0.100662040946369423E+06, 0.100684765371038040E+06, 0.100710073382574032E+06, - 0.100736158886730540E+06, 0.100761558107963079E+06, 0.100780935166741401E+06, 0.100798370121153508E+06, 0.100816555152162895E+06, - 0.100835390903751701E+06, 0.100853847765655024E+06, 0.100871757501481305E+06, 0.100888895778612612E+06, 0.100908175229415137E+06, - 0.100925669047910487E+06, 0.101217702072300162E+06, 0.101214879429494846E+06, 0.101212918203238412E+06, 0.101215072363802130E+06, - 0.101218250672383481E+06, 0.101222522132735277E+06, 0.101227622288938786E+06, 0.101233167267756522E+06, 0.101238956389902218E+06, - 0.101244820309774892E+06, 0.101250635435466815E+06, 0.101256335683556361E+06, 0.101261921151622766E+06, 0.101268342600560762E+06, - 0.101275163933372678E+06, 0.101281497833931266E+06, 0.101287383286156546E+06, 0.101292932525330558E+06, 0.101298347923196663E+06, - 0.101303932128846092E+06, 0.101310090422888767E+06, 0.101317693616226330E+06, 0.101327652607175361E+06, 0.101342480557763687E+06, - 0.101358556451299402E+06, 0.101375279086523937E+06, 0.101391978870831925E+06, 0.101407971443584844E+06, 0.101422613121423448E+06, - 0.101435506823643867E+06, 0.101446124078218185E+06, 0.101452234738676838E+06, 0.101455284023688801E+06, 0.101456737369482420E+06, - 0.101456865445288451E+06, 0.101455916182255954E+06, 0.101454121953738781E+06, 0.101451661773156113E+06, 0.101449081947506013E+06, - 0.101446228059309360E+06, 0.101444208961239303E+06, 0.101443612932188233E+06, 0.101444705011359765E+06, 0.101447541270001515E+06, - 0.101452383501387390E+06, 0.101458282693875270E+06, 0.101464997464114887E+06, 0.101472100710916289E+06, 0.101479273864667499E+06, - 0.101486350419971670E+06, 0.101493152086614995E+06, 0.101499576717366377E+06, 0.101505843270561643E+06, 0.101512436676125639E+06, - 0.101519641676807107E+06, 0.101527434410592061E+06, 0.101535644765811841E+06, 0.101545029301612725E+06, 0.101553754432012545E+06, - 0.101560956040866411E+06, 0.101564550165702050E+06, 0.101566892094339870E+06, 0.101567035078111294E+06, 0.101564167039659485E+06, - 0.101560257949168226E+06, 0.101555969226616333E+06, 0.101552313766367617E+06, 0.101550452021603851E+06, 0.101550963150145908E+06, - 0.101553454481203808E+06, 0.101557594737071355E+06, 0.101562591960326725E+06, 0.101568055832384678E+06, 0.101570018237429336E+06, - 0.101568806715803599E+06, 0.101563796324326468E+06, 0.101553825571776295E+06, 0.101537561122490020E+06, 0.101515230788797810E+06, - 0.101485862600308523E+06, 0.101448189650402157E+06, 0.101397681000099896E+06, 0.101336913516701141E+06, 0.101267241010695536E+06, - 0.101189600658946001E+06, 0.101107785950000631E+06, 0.101027329917614610E+06, 0.100951013494106854E+06, 0.100883020611558357E+06, - 0.100825246076290889E+06, 0.100775271676367163E+06, 0.100732070018118597E+06, 0.100693807828755365E+06, 0.100660471847562090E+06, - 0.100632198820324600E+06, 0.100610336348454613E+06, 0.100597445568148105E+06, 0.100596347705297740E+06, 0.100608739289963560E+06, - 0.100632312399144867E+06, 0.100664180492312080E+06, 0.100701580165578795E+06, 0.100742885809197804E+06, 0.100784251808581277E+06, - 0.100822721504335888E+06, 0.100857114729781009E+06, 0.100884974331454141E+06, 0.100904296005382625E+06, 0.100913525976403209E+06, - 0.100909880311948247E+06, 0.100892635225440783E+06, 0.100865034092500646E+06, 0.100830041776689235E+06, 0.100792635237818962E+06, - 0.100758858691726316E+06, 0.100734424708176390E+06, 0.100726153683192097E+06, 0.100729591906647329E+06, 0.100742469628359380E+06, - 0.100772373108355430E+06, 0.100810039805286127E+06, 0.100850865902025442E+06, 0.100889839249818047E+06, 0.100924291493751982E+06, - 0.100954018166122405E+06, 0.100976020229241141E+06, 0.100977598211779696E+06, 0.100962801120868462E+06, 0.100940325812200113E+06, - 0.100915300637579014E+06, 0.100897607613392654E+06, 0.100888545266499175E+06, 0.100887361365753401E+06, 0.100894417619390835E+06, - 0.100914107950286358E+06, 0.100931864535990011E+06, 0.100942729300749750E+06, 0.100943712413188565E+06, 0.100933999633237443E+06, - 0.100915953837210676E+06, 0.100891962587812566E+06, 0.100861290497928669E+06, 0.100825794229352119E+06, 0.100786805648525173E+06, - 0.100747059949918155E+06, 0.100708052571343884E+06, 0.100670389177752746E+06, 0.100637438856290988E+06, 0.100612791553316754E+06, - 0.100598161054412602E+06, 0.100597616745557592E+06, 0.100608245258248513E+06, 0.100627589752602711E+06, 0.100652501052796259E+06, - 0.100677256390096882E+06, 0.100702485105916334E+06, 0.100721371071945381E+06, 0.100737732280855227E+06, 0.100754743779602475E+06, - 0.100772593580461515E+06, 0.100791374419969914E+06, 0.100810897025248196E+06, 0.100830367089737425E+06, 0.100852737881952431E+06, - 0.100874075837282377E+06, 0.100893534157121714E+06, 0.101228070489269143E+06, 0.101227544665406953E+06, 0.101230349746524807E+06, - 0.101234269851944497E+06, 0.101239184467959683E+06, 0.101244939450664504E+06, 0.101251545017166776E+06, 0.101258662705518451E+06, - 0.101265918196699597E+06, 0.101273125560589353E+06, 0.101280152736103031E+06, 0.101286933875186733E+06, 0.101293407125996848E+06, - 0.101299586824039099E+06, 0.101306376779591956E+06, 0.101313623028716072E+06, 0.101320476967868250E+06, 0.101327043370354135E+06, - 0.101333520713772232E+06, 0.101340211822319048E+06, 0.101347526837547412E+06, 0.101356523012281294E+06, 0.101370533287668499E+06, - 0.101386582740267011E+06, 0.101403758993542797E+06, 0.101421430602220105E+06, 0.101438909393433467E+06, 0.101455505881131437E+06, - 0.101470586854150286E+06, 0.101483635012064580E+06, 0.101492144560654036E+06, 0.101497362403152074E+06, 0.101500801900675287E+06, - 0.101502736875093309E+06, 0.101503413235270535E+06, 0.101503062612840484E+06, 0.101501914512809366E+06, 0.101500206465205003E+06, - 0.101497831592138784E+06, 0.101495767534276791E+06, 0.101494714546066039E+06, 0.101495119352637426E+06, 0.101497237786485115E+06, - 0.101501125674684867E+06, 0.101506644060371764E+06, 0.101514150312748505E+06, 0.101522320784248848E+06, 0.101530563331544297E+06, - 0.101538706294350879E+06, 0.101546559377466736E+06, 0.101553946547580461E+06, 0.101560765945043371E+06, 0.101567653265792658E+06, - 0.101574587210003941E+06, 0.101581752742970988E+06, 0.101589174518686996E+06, 0.101596642355671458E+06, 0.101603818859754785E+06, - 0.101610799838750623E+06, 0.101614811522755466E+06, 0.101617790546373333E+06, 0.101619757440904345E+06, 0.101620562545717650E+06, - 0.101618884459059045E+06, 0.101615191240677028E+06, 0.101611483339551589E+06, 0.101608375965291722E+06, 0.101606589668011176E+06, - 0.101606767311590491E+06, 0.101608967585915860E+06, 0.101612347393029107E+06, 0.101614810665037265E+06, 0.101614446811429036E+06, - 0.101613127583126843E+06, 0.101609516694027276E+06, 0.101602475273863849E+06, 0.101591105455035053E+06, 0.101574139304303288E+06, - 0.101552261616850359E+06, 0.101522964529426812E+06, 0.101483809256113498E+06, 0.101431803333729331E+06, 0.101367984772122625E+06, - 0.101295216781381270E+06, 0.101216180859079337E+06, 0.101134418945842335E+06, 0.101057719484696820E+06, 0.100987761361816083E+06, - 0.100925129407695815E+06, 0.100869076127166059E+06, 0.100819148307903684E+06, 0.100772602660554068E+06, 0.100726367887494707E+06, - 0.100682387602061091E+06, 0.100642046686646194E+06, 0.100608073036628615E+06, 0.100583165331615121E+06, 0.100571567333927058E+06, - 0.100579161681519065E+06, 0.100599831523424771E+06, 0.100631457444745640E+06, 0.100671162741316628E+06, 0.100715517300559659E+06, - 0.100759196447210823E+06, 0.100798644466533326E+06, 0.100834218092755124E+06, 0.100864022068452279E+06, 0.100886844670119492E+06, - 0.100903072952249466E+06, 0.100910324635737983E+06, 0.100907110564502160E+06, 0.100894913649374212E+06, 0.100873485872527890E+06, - 0.100847908218072756E+06, 0.100825028815845202E+06, 0.100812235195442801E+06, 0.100811789392154620E+06, 0.100821477468724654E+06, - 0.100842188280174509E+06, 0.100874882105417564E+06, 0.100910352034741096E+06, 0.100944613694273561E+06, 0.100970573806106200E+06, - 0.100992876564753780E+06, 0.101010256709896377E+06, 0.101017365734439736E+06, 0.101004642180764087E+06, 0.100981216767300502E+06, - 0.100950670557522288E+06, 0.100918693714911191E+06, 0.100893168282002865E+06, 0.100873786774855747E+06, 0.100862092518860401E+06, - 0.100858765389723776E+06, 0.100863848594959985E+06, 0.100872455106490743E+06, 0.100880727391939872E+06, 0.100881060958518239E+06, - 0.100871581642927995E+06, 0.100854982629453050E+06, 0.100833968938175327E+06, 0.100809126941723182E+06, 0.100777926015906574E+06, - 0.100744862813125714E+06, 0.100711030659190204E+06, 0.100674920663551122E+06, 0.100638665812651045E+06, 0.100604613640158801E+06, - 0.100577951755037328E+06, 0.100565299257314167E+06, 0.100564490794773781E+06, 0.100574070775104672E+06, 0.100592267906427369E+06, - 0.100616576592620535E+06, 0.100643954138155808E+06, 0.100661679785274406E+06, 0.100676519993234426E+06, 0.100692101751513052E+06, - 0.100708845098980164E+06, 0.100726890359751837E+06, 0.100746088291053093E+06, 0.100766274118497415E+06, 0.100790485020117267E+06, - 0.100814283052694198E+06, 0.100836998900601233E+06, 0.100857834251143926E+06, 0.101239951294366925E+06, 0.101243511198018721E+06, - 0.101248266604097182E+06, 0.101254120739513630E+06, 0.101260940255995316E+06, 0.101268566543099048E+06, 0.101276830453567702E+06, - 0.101285622454819968E+06, 0.101294523809254446E+06, 0.101303237484829937E+06, 0.101311620976720500E+06, 0.101319644374765689E+06, - 0.101327259549206297E+06, 0.101334480948853117E+06, 0.101341388354789131E+06, 0.101348710884544664E+06, 0.101356521517190282E+06, - 0.101364093945627537E+06, 0.101371621643877312E+06, 0.101379408199202080E+06, 0.101388443315429948E+06, 0.101401687552132498E+06, - 0.101416572004818678E+06, 0.101433189992554107E+06, 0.101451428970825116E+06, 0.101470024045938291E+06, 0.101488255659360628E+06, - 0.101505416028128879E+06, 0.101520868917434069E+06, 0.101531842805264969E+06, 0.101539245769958565E+06, 0.101544605958666289E+06, - 0.101548569302459247E+06, 0.101551134535491103E+06, 0.101552518676128384E+06, 0.101552933361419549E+06, 0.101552598628048305E+06, - 0.101551346091754502E+06, 0.101549620534837697E+06, 0.101548503290274006E+06, 0.101548531268210281E+06, 0.101550086213979870E+06, - 0.101553415865284071E+06, 0.101558574308658994E+06, 0.101566141420655156E+06, 0.101575323430362041E+06, 0.101584790524686381E+06, - 0.101594148506046142E+06, 0.101603272905442951E+06, 0.101611945735174741E+06, 0.101619979003416622E+06, 0.101627204805596586E+06, - 0.101634427668451928E+06, 0.101641404911077247E+06, 0.101648381901037224E+06, 0.101655340222651532E+06, 0.101662034474683896E+06, - 0.101666783103935741E+06, 0.101669591715802919E+06, 0.101672592019255666E+06, 0.101674896474706766E+06, 0.101676486613950226E+06, - 0.101677173545713507E+06, 0.101676735064566892E+06, 0.101674421820609132E+06, 0.101671063643987713E+06, 0.101668202552547300E+06, - 0.101666520557556054E+06, 0.101666348434875123E+06, 0.101667923680669555E+06, 0.101669351667803800E+06, 0.101668978131977754E+06, - 0.101666110028333933E+06, 0.101660538752964931E+06, 0.101654594444694463E+06, 0.101645738692219165E+06, 0.101634351733125281E+06, - 0.101619445806351592E+06, 0.101597486529762551E+06, 0.101566963080607631E+06, 0.101526313623151611E+06, 0.101474414132893216E+06, - 0.101408806070782084E+06, 0.101334676336432865E+06, 0.101255967485764850E+06, 0.101177930379907673E+06, 0.101105923487214692E+06, - 0.101041528067973224E+06, 0.100984421243628807E+06, 0.100931366999700622E+06, 0.100882259035952666E+06, 0.100834318510275116E+06, - 0.100780975023316409E+06, 0.100725029283105585E+06, 0.100672125573187601E+06, 0.100626333648281943E+06, 0.100591108252538659E+06, - 0.100571154519613207E+06, 0.100572764811242494E+06, 0.100590644123334263E+06, 0.100622114840101916E+06, 0.100663170419413218E+06, - 0.100711109304953105E+06, 0.100759450274770090E+06, 0.100803668821019484E+06, 0.100843723009858411E+06, 0.100878065056743988E+06, - 0.100905193898488564E+06, 0.100924238150348683E+06, 0.100935705112497482E+06, 0.100940040808540827E+06, 0.100938611611957211E+06, - 0.100929132041696241E+06, 0.100917754954705204E+06, 0.100905818223427166E+06, 0.100905472653716875E+06, 0.100913513200435162E+06, - 0.100929234171202479E+06, 0.100956672791980032E+06, 0.100989933744260285E+06, 0.101021721049159081E+06, 0.101045261345619481E+06, - 0.101056484086316414E+06, 0.101064376750130497E+06, 0.101068662292293593E+06, 0.101058850049314118E+06, 0.101036734626105259E+06, - 0.101005396099047648E+06, 0.100967551751069492E+06, 0.100930584068150943E+06, 0.100895049839971194E+06, 0.100865689126530953E+06, - 0.100843766391791884E+06, 0.100833519035555830E+06, 0.100830429319700765E+06, 0.100830534716874317E+06, 0.100831218872075027E+06, - 0.100828733033744793E+06, 0.100816736999957517E+06, 0.100801115692818625E+06, 0.100782650624359696E+06, 0.100761638271208169E+06, - 0.100739079948099330E+06, 0.100715508303584225E+06, 0.100685570121976882E+06, 0.100651926936336182E+06, 0.100616808436076797E+06, - 0.100582738088950529E+06, 0.100553609533300842E+06, 0.100536151852068826E+06, 0.100533191840017098E+06, 0.100540563795043839E+06, - 0.100556547268302660E+06, 0.100578647827983019E+06, 0.100597845282151320E+06, 0.100615643951716338E+06, 0.100629644958407152E+06, - 0.100644649717624998E+06, 0.100661314686951257E+06, 0.100679739011681770E+06, 0.100699923738231213E+06, 0.100724000291545439E+06, - 0.100748935934403649E+06, 0.100773460147275109E+06, 0.100796886100017015E+06, 0.100818431742268527E+06, 0.101253250319671861E+06, - 0.101258941275491015E+06, 0.101265825984074268E+06, 0.101273785992740712E+06, 0.101282673338371926E+06, 0.101292322337458594E+06, - 0.101302564811119126E+06, 0.101313249084015886E+06, 0.101324039732978374E+06, 0.101334420443956798E+06, 0.101344441355969844E+06, - 0.101353937804033951E+06, 0.101362853548466621E+06, 0.101371239996888005E+06, 0.101379195223571107E+06, 0.101386868114858662E+06, - 0.101394863418320267E+06, 0.101403421459721620E+06, 0.101411971625535502E+06, 0.101421328676152989E+06, 0.101434052612144369E+06, - 0.101448448578493975E+06, 0.101464428560022046E+06, 0.101481780318751698E+06, 0.101500377161328623E+06, 0.101519861969620310E+06, - 0.101538794301281392E+06, 0.101556432572582416E+06, 0.101569913275213607E+06, 0.101580111679331065E+06, 0.101588077608188687E+06, - 0.101593761388586005E+06, 0.101597743292873696E+06, 0.101601111211300595E+06, 0.101603375473686290E+06, 0.101604722386775393E+06, - 0.101605277974446421E+06, 0.101605137189286179E+06, 0.101604583774228318E+06, 0.101604027662526438E+06, 0.101605032612257637E+06, - 0.101607890648949600E+06, 0.101612610274943596E+06, 0.101620190413487217E+06, 0.101629709918692257E+06, 0.101640274485895483E+06, - 0.101651366271263018E+06, 0.101662017372317307E+06, 0.101672127532921921E+06, 0.101681639836175294E+06, 0.101689695653715113E+06, - 0.101697371401130935E+06, 0.101704816287710346E+06, 0.101711959261812881E+06, 0.101718592829194225E+06, 0.101724976617920722E+06, - 0.101729049321389990E+06, 0.101731107282530153E+06, 0.101732743234520705E+06, 0.101734177642089810E+06, 0.101735792298410903E+06, - 0.101737051523103568E+06, 0.101737813506062157E+06, 0.101737771770358304E+06, 0.101736766611527375E+06, 0.101733998643601444E+06, - 0.101731285447018498E+06, 0.101729657615879667E+06, 0.101729463824108592E+06, 0.101730467776220365E+06, 0.101730634889909721E+06, - 0.101728530424326527E+06, 0.101723478773003560E+06, 0.101715128998538450E+06, 0.101705173881448645E+06, 0.101697065128410613E+06, - 0.101686174729378530E+06, 0.101670746397321127E+06, 0.101648602916028351E+06, 0.101617289856162359E+06, 0.101575677936215157E+06, - 0.101523549414822643E+06, 0.101459384090740117E+06, 0.101385766535040675E+06, 0.101307806220871105E+06, 0.101230532040925333E+06, - 0.101163615695121596E+06, 0.101105144301163149E+06, 0.101053953064553687E+06, 0.101004506092646785E+06, 0.100954394425546445E+06, - 0.100903265851270029E+06, 0.100843568326323351E+06, 0.100779909310060830E+06, 0.100718507897475429E+06, 0.100663227538561507E+06, - 0.100619196470881463E+06, 0.100590878309716514E+06, 0.100585918330994056E+06, 0.100599670235220139E+06, 0.100629367268692309E+06, - 0.100671559948193928E+06, 0.100722625470161831E+06, 0.100775876461740903E+06, 0.100826307692812305E+06, 0.100872731273009820E+06, - 0.100911769660482067E+06, 0.100942401025764135E+06, 0.100964392752327054E+06, 0.100978678374194351E+06, 0.100986716960824007E+06, - 0.100990258819483715E+06, 0.100986859094204920E+06, 0.100984358423690996E+06, 0.100986880945730183E+06, 0.101001308030144719E+06, - 0.101021911204537639E+06, 0.101045314756852677E+06, 0.101079374563270016E+06, 0.101112057664106265E+06, 0.101138492426304845E+06, - 0.101147264582452117E+06, 0.101146181575950890E+06, 0.101139597898295426E+06, 0.101126956426191653E+06, 0.101104207044017559E+06, - 0.101074184746976593E+06, 0.101036351784390296E+06, 0.100994839802225833E+06, 0.100951701131987342E+06, 0.100907802015808338E+06, - 0.100866623322513595E+06, 0.100836261177509557E+06, 0.100817609325104844E+06, 0.100806057949370603E+06, 0.100799101756952587E+06, - 0.100794178922864405E+06, 0.100782586521973222E+06, 0.100770278560914870E+06, 0.100755730874395027E+06, 0.100740174567162278E+06, - 0.100724221891415305E+06, 0.100711960802472036E+06, 0.100695201938734870E+06, 0.100670904548085469E+06, 0.100639130264881242E+06, - 0.100604667725497551E+06, 0.100569533181772116E+06, 0.100538827586813903E+06, 0.100515863557522040E+06, 0.100504283432544311E+06, - 0.100508208880423437E+06, 0.100520846592849106E+06, 0.100533319890499857E+06, 0.100546979620563667E+06, 0.100563406036921282E+06, - 0.100581336883139578E+06, 0.100596479945475046E+06, 0.100613263609396352E+06, 0.100632606505272503E+06, 0.100655737101977575E+06, - 0.100680377627359165E+06, 0.100705693019706334E+06, 0.100730567542817560E+06, 0.100753963268230000E+06, 0.100775475443369112E+06, - 0.101264306669592683E+06, 0.101273005643247234E+06, 0.101282212261941575E+06, 0.101292455230279535E+06, 0.101303569666892407E+06, - 0.101315379627821021E+06, 0.101327713762651794E+06, 0.101340424766245633E+06, 0.101353413011349316E+06, 0.101366215214067837E+06, - 0.101378003241061873E+06, 0.101389048142805594E+06, 0.101399358057326695E+06, 0.101408993909155237E+06, 0.101418071350073515E+06, - 0.101426765747085621E+06, 0.101435320572288721E+06, 0.101444230417056518E+06, 0.101454115342003613E+06, 0.101466281775386233E+06, - 0.101480018815107192E+06, 0.101495370152025978E+06, 0.101512249092142942E+06, 0.101530457200416044E+06, 0.101549717357720714E+06, - 0.101569710093644739E+06, 0.101589282549966229E+06, 0.101605011230739328E+06, 0.101617835360473735E+06, 0.101628768238586897E+06, - 0.101637571031423722E+06, 0.101644166338589697E+06, 0.101648697806602591E+06, 0.101651881208006424E+06, 0.101655220484862148E+06, - 0.101657859335835557E+06, 0.101659761085947117E+06, 0.101661032940759702E+06, 0.101661921699332699E+06, 0.101662809971163108E+06, - 0.101664227024246793E+06, 0.101667989933228542E+06, 0.101675508452427108E+06, 0.101685268933038969E+06, 0.101696374945899413E+06, - 0.101708376350831662E+06, 0.101720741353243910E+06, 0.101732914311869565E+06, 0.101744191311434886E+06, 0.101753679207339199E+06, - 0.101762383198229145E+06, 0.101770484632283566E+06, 0.101778058653469430E+06, 0.101785052189110153E+06, 0.101791286685933344E+06, - 0.101795171487182030E+06, 0.101797156941597103E+06, 0.101798421280143026E+06, 0.101799261614609830E+06, 0.101799803038408485E+06, - 0.101800210895802447E+06, 0.101801683280290250E+06, 0.101802630829050468E+06, 0.101802543397740184E+06, 0.101801482357017914E+06, - 0.101799624587932572E+06, 0.101797066559983883E+06, 0.101795799625004249E+06, 0.101795785922852519E+06, 0.101796374037248344E+06, - 0.101796548441705847E+06, 0.101793091799900605E+06, 0.101786346983049574E+06, 0.101776575607877137E+06, 0.101765049283969143E+06, - 0.101754303368654233E+06, 0.101742481241294314E+06, 0.101726517364683619E+06, 0.101704526213350880E+06, 0.101673251963278643E+06, - 0.101631549642581842E+06, 0.101579630218674371E+06, 0.101517751331919892E+06, 0.101445587957413649E+06, 0.101369276534187840E+06, - 0.101293749197962985E+06, 0.101228845743408630E+06, 0.101175974072217723E+06, 0.101128069068520213E+06, 0.101080672101220363E+06, - 0.101030554297062597E+06, 0.100978255877595599E+06, 0.100917786384446328E+06, 0.100848380590802917E+06, 0.100779685419598463E+06, - 0.100716993576480047E+06, 0.100665449877585226E+06, 0.100628730188585745E+06, 0.100616768912061103E+06, 0.100625017647516172E+06, - 0.100651010955717982E+06, 0.100693983128488617E+06, 0.100748028718061119E+06, 0.100807126354548294E+06, 0.100865743222122503E+06, - 0.100920280263948240E+06, 0.100963697339721592E+06, 0.100996625031755175E+06, 0.101020588466931018E+06, 0.101034801756696354E+06, - 0.101044107550953762E+06, 0.101050001068824189E+06, 0.101053046373654055E+06, 0.101058552912032319E+06, 0.101072171257776601E+06, - 0.101095588999532294E+06, 0.101124462408449937E+06, 0.101159998252541394E+06, 0.101199939829214418E+06, 0.101233511940909040E+06, - 0.101250548981260363E+06, 0.101245238633873159E+06, 0.101231967019851887E+06, 0.101212524735667932E+06, 0.101187116747768814E+06, - 0.101155254569723096E+06, 0.101117728069520774E+06, 0.101075849861174778E+06, 0.101031454770778844E+06, 0.100982633468066182E+06, - 0.100931817382534617E+06, 0.100883044212189372E+06, 0.100842431678571462E+06, 0.100810753030772234E+06, 0.100790307235783985E+06, - 0.100775641660991605E+06, 0.100758065719658363E+06, 0.100742431929372280E+06, 0.100730276589137924E+06, 0.100719950891765460E+06, - 0.100707897196450547E+06, 0.100704034450479885E+06, 0.100696304475012279E+06, 0.100682955042842383E+06, 0.100662970635189646E+06, - 0.100635257255516670E+06, 0.100598919177042175E+06, 0.100561998994079375E+06, 0.100529207116205667E+06, 0.100503120931424841E+06, - 0.100485371253469493E+06, 0.100478084387816067E+06, 0.100480161528695491E+06, 0.100486330170588408E+06, 0.100497656033703854E+06, - 0.100512793940874559E+06, 0.100530267502319883E+06, 0.100548674998529634E+06, 0.100566870164484106E+06, 0.100588713074028346E+06, - 0.100612035752629497E+06, 0.100636570551070865E+06, 0.100661555413946771E+06, 0.100685975940573393E+06, 0.100708805081237850E+06, - 0.100728426698084644E+06, 0.101271996036762896E+06, 0.101284449704480561E+06, 0.101296689346213228E+06, 0.101309400454198360E+06, - 0.101322901055611903E+06, 0.101337001192974072E+06, 0.101351521575208899E+06, 0.101366313393139906E+06, 0.101382034494546009E+06, - 0.101397351776588475E+06, 0.101411443443270473E+06, 0.101424117470686309E+06, 0.101435883616085790E+06, 0.101446811616959909E+06, - 0.101457033181746156E+06, 0.101466747751913790E+06, 0.101476231696805597E+06, 0.101486021283400187E+06, 0.101497396375811921E+06, - 0.101510400207985600E+06, 0.101524923388815208E+06, 0.101540994381505661E+06, 0.101558520228044814E+06, 0.101577305318149651E+06, - 0.101597084529118074E+06, 0.101617572913645636E+06, 0.101635935716414897E+06, 0.101650985317801838E+06, 0.101664666828709975E+06, - 0.101676613583561295E+06, 0.101686531498022989E+06, 0.101694300750966708E+06, 0.101700039232711759E+06, 0.101704155496819658E+06, - 0.101707559871844016E+06, 0.101711706616868032E+06, 0.101715220819953611E+06, 0.101718183769718671E+06, 0.101720797579619655E+06, - 0.101723413797095534E+06, 0.101726548168837966E+06, 0.101732421109602874E+06, 0.101741180387240456E+06, 0.101752626090808626E+06, - 0.101765327683930620E+06, 0.101778794125947126E+06, 0.101792465254962983E+06, 0.101805759257347163E+06, 0.101817578749370528E+06, - 0.101828002210067600E+06, 0.101837310759124710E+06, 0.101845770211075462E+06, 0.101853420566787143E+06, 0.101860181736826940E+06, - 0.101864213062694500E+06, 0.101866574115216965E+06, 0.101867875008511299E+06, 0.101868524705411764E+06, 0.101868825959176160E+06, - 0.101868919433276926E+06, 0.101869678539425964E+06, 0.101870695483190138E+06, 0.101871330785532584E+06, 0.101870979213963699E+06, - 0.101869675931957303E+06, 0.101867574002842535E+06, 0.101865625644742016E+06, 0.101864444239763863E+06, 0.101864129871809724E+06, - 0.101864253411905665E+06, 0.101863863423935647E+06, 0.101861147095331355E+06, 0.101853046503827805E+06, 0.101842469691830149E+06, - 0.101829793173113096E+06, 0.101815148158582204E+06, 0.101801721489973846E+06, 0.101784969966993638E+06, 0.101762516553084497E+06, - 0.101733198141890345E+06, 0.101692387931239413E+06, 0.101641579160683832E+06, 0.101581604629232388E+06, 0.101513447361368249E+06, - 0.101440920474624741E+06, 0.101370696075984946E+06, 0.101305428265875380E+06, 0.101254160309156374E+06, 0.101207383873920160E+06, - 0.101161789898628529E+06, 0.101111489873579616E+06, 0.101058073620173833E+06, 0.100998431410120465E+06, 0.100925178881860134E+06, - 0.100851277940204382E+06, 0.100782887728638991E+06, 0.100724637342850445E+06, 0.100681654247053943E+06, 0.100660743763258797E+06, - 0.100662241191619672E+06, 0.100684600997945701E+06, 0.100726431789378737E+06, 0.100783621753223240E+06, 0.100850165592330639E+06, - 0.100919393459606828E+06, 0.100984663126731160E+06, 0.101035581217426865E+06, 0.101073289555574971E+06, 0.101097883508170984E+06, - 0.101109275635634360E+06, 0.101115535689499287E+06, 0.101120721213043289E+06, 0.101127445332507938E+06, 0.101138555650677066E+06, - 0.101162386128591490E+06, 0.101193764958060041E+06, 0.101229324100487633E+06, 0.101272586038755646E+06, 0.101314017050708091E+06, - 0.101345307647537833E+06, 0.101350681405921583E+06, 0.101336274552223433E+06, 0.101312002659208913E+06, 0.101282108941999220E+06, - 0.101247511268828879E+06, 0.101208775326433519E+06, 0.101166118942493005E+06, 0.101124324087716755E+06, 0.101077097855417393E+06, - 0.101023493736806588E+06, 0.100966370678116829E+06, 0.100910649732596605E+06, 0.100860956183662900E+06, 0.100818859583747035E+06, - 0.100784487610509677E+06, 0.100755633857502806E+06, 0.100730268695456398E+06, 0.100710865638861083E+06, 0.100697679049610029E+06, - 0.100690061794109570E+06, 0.100696089852752222E+06, 0.100696921102593260E+06, 0.100692632540626320E+06, 0.100681762801710865E+06, - 0.100663264802660036E+06, 0.100633791904004815E+06, 0.100597430688150896E+06, 0.100559133196241281E+06, 0.100524051576254133E+06, - 0.100494743325319461E+06, 0.100472843717532320E+06, 0.100453469270866597E+06, 0.100441938855850953E+06, 0.100444602587366870E+06, - 0.100453700278505523E+06, 0.100467703647186674E+06, 0.100484865751373640E+06, 0.100504556800278908E+06, 0.100526747147881411E+06, - 0.100548342492759344E+06, 0.100570928110482331E+06, 0.100594499129673175E+06, 0.100618314768352022E+06, 0.100641358389098648E+06, - 0.100661048545089099E+06, 0.100674922441404182E+06, 0.101277440454925483E+06, 0.101292275045881630E+06, 0.101308217918252703E+06, - 0.101324032641650105E+06, 0.101340083417949048E+06, 0.101356599817204507E+06, 0.101373389242319026E+06, 0.101391680572806275E+06, - 0.101409655246696246E+06, 0.101426966070523806E+06, 0.101443353143514600E+06, 0.101458277199001546E+06, 0.101471528522387307E+06, - 0.101483748681189623E+06, 0.101495083125874895E+06, 0.101505752090554262E+06, 0.101516050089151657E+06, 0.101526815975076141E+06, - 0.101538795327266271E+06, 0.101552338028206417E+06, 0.101567404995926277E+06, 0.101583932457588046E+06, 0.101601812845274559E+06, - 0.101620841504076889E+06, 0.101640749378202716E+06, 0.101659290500403222E+06, 0.101676771795349603E+06, 0.101693884723980591E+06, - 0.101708998663612001E+06, 0.101722276078936207E+06, 0.101733606252533034E+06, 0.101742808520292456E+06, 0.101749958233873534E+06, - 0.101756733187784732E+06, 0.101761976313215302E+06, 0.101765600227458519E+06, 0.101770624962746049E+06, 0.101775587804667244E+06, - 0.101780223730697457E+06, 0.101784845963681015E+06, 0.101792019560120360E+06, 0.101800861910829000E+06, 0.101810238167576026E+06, - 0.101821334626365482E+06, 0.101835649384848730E+06, 0.101850599319270405E+06, 0.101865571025550424E+06, 0.101879726510542314E+06, - 0.101892673462390783E+06, 0.101903975174055988E+06, 0.101913651691837455E+06, 0.101922403262289721E+06, 0.101930066269132934E+06, - 0.101934959838625931E+06, 0.101938013574382479E+06, 0.101939867945920269E+06, 0.101940768404829549E+06, 0.101940976512875422E+06, - 0.101940974808985324E+06, 0.101941915218950715E+06, 0.101942796779357042E+06, 0.101943325071244180E+06, 0.101943321289824438E+06, - 0.101942520685581403E+06, 0.101940795734215877E+06, 0.101938328485986989E+06, 0.101936102913573559E+06, 0.101934189161022412E+06, - 0.101933270983365946E+06, 0.101932726854111810E+06, 0.101931071080041162E+06, 0.101927390375963005E+06, 0.101920782487591568E+06, - 0.101909599976852041E+06, 0.101896034018928112E+06, 0.101880121030327078E+06, 0.101861777722108454E+06, 0.101843441866567693E+06, - 0.101821175828396939E+06, 0.101793162871491804E+06, 0.101756243381197477E+06, 0.101707526053893132E+06, 0.101651390637597418E+06, - 0.101591096250860501E+06, 0.101525066978488496E+06, 0.101457842460151805E+06, 0.101392749867658815E+06, 0.101338205739929384E+06, - 0.101290789521037383E+06, 0.101243732978547458E+06, 0.101191560328100386E+06, 0.101135333560209707E+06, 0.101074991868799916E+06, - 0.101002789603246347E+06, 0.100928035016280875E+06, 0.100857779212484500E+06, 0.100794984785666602E+06, 0.100746221294778152E+06, - 0.100717266126841918E+06, 0.100710869212579069E+06, 0.100726313373954297E+06, 0.100765862955971417E+06, 0.100824009621681325E+06, - 0.100896074483335498E+06, 0.100975156087370415E+06, 0.101050862045185830E+06, 0.101108616996395343E+06, 0.101151397540630162E+06, - 0.101177118649863274E+06, 0.101187234876946401E+06, 0.101192189574432836E+06, 0.101198920872520132E+06, 0.101209271572763842E+06, - 0.101225853188380381E+06, 0.101255763867716960E+06, 0.101292205782835576E+06, 0.101333769433737034E+06, 0.101380487686360808E+06, - 0.101421196585383368E+06, 0.101445943578677994E+06, 0.101442593076884281E+06, 0.101422753739062216E+06, 0.101390520324852318E+06, - 0.101350761888702051E+06, 0.101308120360709363E+06, 0.101265074031475204E+06, 0.101223556150358476E+06, 0.101181059083197164E+06, - 0.101131282154724337E+06, 0.101073985674786556E+06, 0.101009316519365500E+06, 0.100945620806578852E+06, 0.100887564966803198E+06, - 0.100836870701820939E+06, 0.100791306568270127E+06, 0.100748587002241606E+06, 0.100714275195360678E+06, 0.100691096015225994E+06, - 0.100677036214206237E+06, 0.100679656532840978E+06, 0.100689403954963505E+06, 0.100699806241966638E+06, 0.100699758014009334E+06, - 0.100690385161567290E+06, 0.100668712287826143E+06, 0.100636906386880102E+06, 0.100599766534639755E+06, 0.100560426804608782E+06, - 0.100523011227441762E+06, 0.100490487333571364E+06, 0.100458484377625064E+06, 0.100433836484664062E+06, 0.100418321599970062E+06, - 0.100412076649917391E+06, 0.100419080629848453E+06, 0.100432241000389156E+06, 0.100450792482229837E+06, 0.100472305642769512E+06, - 0.100493869619492121E+06, 0.100514430080734746E+06, 0.100535036793476407E+06, 0.100556629184451856E+06, 0.100578314394928922E+06, - 0.100596991295179905E+06, 0.100611500340730694E+06, 0.100623274306907668E+06, 0.101280196625301396E+06, 0.101297364868656936E+06, - 0.101315860426329833E+06, 0.101335437548964052E+06, 0.101354738212366676E+06, 0.101373945822871654E+06, 0.101394704590563779E+06, - 0.101415369573864707E+06, 0.101435547066077095E+06, 0.101454900560777067E+06, 0.101473156717428967E+06, 0.101490111858949429E+06, - 0.101505426648419336E+06, 0.101518896733282789E+06, 0.101531260767964472E+06, 0.101542531309453814E+06, 0.101553164954199878E+06, - 0.101564411925864319E+06, 0.101576767311889984E+06, 0.101590613786174377E+06, 0.101606186426911474E+06, 0.101622949542643095E+06, - 0.101640870734518088E+06, 0.101659778611533140E+06, 0.101677671599300767E+06, 0.101695145189232746E+06, 0.101713022490742442E+06, - 0.101730968458130665E+06, 0.101748633328473559E+06, 0.101764332593418454E+06, 0.101777415582760368E+06, 0.101788327636173344E+06, - 0.101798745459491343E+06, 0.101807854686651277E+06, 0.101815215507054876E+06, 0.101821043040616947E+06, 0.101825884968623417E+06, - 0.101832189148969264E+06, 0.101839168448648401E+06, 0.101848045440598347E+06, 0.101858730804693652E+06, 0.101869959329435806E+06, - 0.101881533268110448E+06, 0.101893454722194554E+06, 0.101906437265534973E+06, 0.101922905509709031E+06, 0.101939197745689977E+06, - 0.101954795923734462E+06, 0.101969009671704334E+06, 0.101981310726737574E+06, 0.101991415766123711E+06, 0.101999594743156573E+06, - 0.102005976491342561E+06, 0.102010334316063047E+06, 0.102013157295944911E+06, 0.102014722383416287E+06, 0.102015313093490025E+06, - 0.102015201185307524E+06, 0.102016512237083880E+06, 0.102017510782104568E+06, 0.102018055903560264E+06, 0.102018084579591843E+06, - 0.102017466339170613E+06, 0.102015842014936527E+06, 0.102013009808558825E+06, 0.102010188377710918E+06, 0.102007504920719613E+06, - 0.102004842449303280E+06, 0.102002010784629019E+06, 0.101999472815438930E+06, 0.101995912864510945E+06, 0.101991527724094442E+06, - 0.101985699759707655E+06, 0.101975812995855114E+06, 0.101961537246313150E+06, 0.101943695019863866E+06, 0.101923033375715851E+06, - 0.101901362121280530E+06, 0.101879075837123033E+06, 0.101852284874085046E+06, 0.101819539147717020E+06, 0.101776999589703846E+06, - 0.101726785900868257E+06, 0.101671557646898407E+06, 0.101612042588822980E+06, 0.101548622762663115E+06, 0.101485284216076703E+06, - 0.101425147441038411E+06, 0.101373420817102917E+06, 0.101321191476503751E+06, 0.101266538752380700E+06, 0.101208938335707280E+06, - 0.101148533319442722E+06, 0.101080582757091557E+06, 0.101007172321080754E+06, 0.100937106866050381E+06, 0.100872650853732252E+06, - 0.100818490092161403E+06, 0.100780581038449120E+06, 0.100763989069985822E+06, 0.100769172528104478E+06, 0.100801781036641652E+06, - 0.100856282722816642E+06, 0.100929221528193739E+06, 0.101013884730459817E+06, 0.101097563707576744E+06, 0.101162534274172547E+06, - 0.101213486478638646E+06, 0.101244516559525029E+06, 0.101257648408437890E+06, 0.101263733502884890E+06, 0.101275510052246449E+06, - 0.101290762661853529E+06, 0.101314197491016195E+06, 0.101347943558257903E+06, 0.101386651316440679E+06, 0.101430443429601510E+06, - 0.101475669896804160E+06, 0.101514950055520574E+06, 0.101531515938051540E+06, 0.101524788957272292E+06, 0.101501664340208648E+06, - 0.101465580088908755E+06, 0.101421732802947983E+06, 0.101374184582676520E+06, 0.101328046898908578E+06, 0.101289807901878230E+06, - 0.101246491413997268E+06, 0.101194778317482283E+06, 0.101131646224091921E+06, 0.101060205833383836E+06, 0.100988174374432070E+06, - 0.100922370979696687E+06, 0.100863854824209222E+06, 0.100809964699915654E+06, 0.100761271524313197E+06, 0.100719104259046479E+06, - 0.100686430395430245E+06, 0.100678847862221184E+06, 0.100683138663107515E+06, 0.100693073794055832E+06, 0.100704133264039236E+06, - 0.100711587564049987E+06, 0.100702838554374641E+06, 0.100679156446423745E+06, 0.100646910483054933E+06, 0.100608627281804467E+06, - 0.100567412671928309E+06, 0.100526528285293534E+06, 0.100483943399388023E+06, 0.100448443665773972E+06, 0.100421899539395425E+06, - 0.100404924203073868E+06, 0.100397063255380912E+06, 0.100397195586259491E+06, 0.100412985650041403E+06, 0.100432834475288488E+06, - 0.100453366207182436E+06, 0.100473356439391355E+06, 0.100491742373035304E+06, 0.100507905429383289E+06, 0.100525814076571885E+06, - 0.100542096974396103E+06, 0.100555812166254138E+06, 0.100567395231908740E+06, 0.100576579149565121E+06, 0.101279908089260382E+06, - 0.101299372851355220E+06, 0.101320345227797603E+06, 0.101342568251312987E+06, 0.101366203167707048E+06, 0.101390159455080997E+06, - 0.101413541104309363E+06, 0.101436670068180945E+06, 0.101459134145086064E+06, 0.101480579621756508E+06, 0.101500717501762701E+06, - 0.101519330301993643E+06, 0.101536279443531355E+06, 0.101551434684382868E+06, 0.101564255195383463E+06, 0.101575422887434994E+06, - 0.101586445548099669E+06, 0.101597902131166629E+06, 0.101610316943178666E+06, 0.101624105975331244E+06, 0.101639540620591506E+06, - 0.101656731770743747E+06, 0.101674690803331439E+06, 0.101691335236531100E+06, 0.101707821449698851E+06, 0.101725245164068649E+06, - 0.101743396815362881E+06, 0.101762005533747782E+06, 0.101780794703432257E+06, 0.101799566956391791E+06, 0.101816729089967106E+06, - 0.101830810115947446E+06, 0.101843847767199652E+06, 0.101855309960108818E+06, 0.101865083082604426E+06, 0.101873349177960990E+06, - 0.101880647099664595E+06, 0.101887932618480903E+06, 0.101897799286328358E+06, 0.101910318475203370E+06, 0.101923741945953618E+06, - 0.101937617512615703E+06, 0.101951634884124011E+06, 0.101965709346062926E+06, 0.101980052214833602E+06, 0.101995075682068244E+06, - 0.102012705906177565E+06, 0.102029916826673259E+06, 0.102045578980748891E+06, 0.102059048316380504E+06, 0.102069947174644665E+06, - 0.102077684357740349E+06, 0.102082147312762972E+06, 0.102086500261915091E+06, 0.102089248935513198E+06, 0.102090698933738371E+06, - 0.102091178364924752E+06, 0.102092701245381337E+06, 0.102093815457381104E+06, 0.102094368575754212E+06, 0.102094331459262947E+06, - 0.102093649378548696E+06, 0.102091495160413397E+06, 0.102088077118329078E+06, 0.102085266715555787E+06, 0.102082068081696532E+06, - 0.102078934857918081E+06, 0.102075562114887900E+06, 0.102070631820974115E+06, 0.102064438122544176E+06, 0.102059414174384161E+06, - 0.102053827822841413E+06, 0.102047097203453392E+06, 0.102038205276517619E+06, 0.102023970080276820E+06, 0.102005255572377879E+06, - 0.101983545280989390E+06, 0.101959239559772468E+06, 0.101934934813177606E+06, 0.101909416211695381E+06, 0.101879530216405619E+06, - 0.101843729384204227E+06, 0.101798771374156902E+06, 0.101749131431232046E+06, 0.101696435747962270E+06, 0.101638597439857098E+06, - 0.101576958615739393E+06, 0.101514239708325505E+06, 0.101456190833159548E+06, 0.101399554349585407E+06, 0.101340424142701784E+06, - 0.101280446676456311E+06, 0.101219442303719290E+06, 0.101155802903883246E+06, 0.101085010925495619E+06, 0.101016127520053677E+06, - 0.100949559692596478E+06, 0.100889898302085116E+06, 0.100844209040313392E+06, 0.100816129681629769E+06, 0.100810501379105452E+06, - 0.100832591111220638E+06, 0.100879523722449056E+06, 0.100948063089510324E+06, 0.101031460853947981E+06, 0.101115973986060417E+06, - 0.101184231818201646E+06, 0.101240245990651732E+06, 0.101276004337181133E+06, 0.101297693264287940E+06, 0.101316108838536718E+06, - 0.101339338207326771E+06, 0.101364838726589573E+06, 0.101398212697034352E+06, 0.101435020262566584E+06, 0.101474120214935858E+06, - 0.101515374742090018E+06, 0.101554913896900893E+06, 0.101585525309637247E+06, 0.101596313029333352E+06, 0.101591763310596391E+06, - 0.101572063905601564E+06, 0.101533915795807872E+06, 0.101488864498615381E+06, 0.101440950048410057E+06, 0.101401964815710235E+06, - 0.101362939393266570E+06, 0.101319118725317487E+06, 0.101264253224874032E+06, 0.101194604583161839E+06, 0.101119529697804493E+06, - 0.101043148821796305E+06, 0.100969817218776385E+06, 0.100904222807714512E+06, 0.100845424566366739E+06, 0.100792297539129795E+06, - 0.100746429506127941E+06, 0.100716119483396033E+06, 0.100699086889567552E+06, 0.100699855109205411E+06, 0.100707310375888119E+06, - 0.100716570575528633E+06, 0.100720007898216936E+06, 0.100714797932772417E+06, 0.100695727134459230E+06, 0.100662985850684985E+06, - 0.100623495462979961E+06, 0.100579571082265902E+06, 0.100528287659914175E+06, 0.100483047690553038E+06, 0.100446858129451386E+06, - 0.100420432087088702E+06, 0.100404117469529898E+06, 0.100397105480157465E+06, 0.100403234638665162E+06, 0.100415020179178769E+06, - 0.100433067114222082E+06, 0.100451452530888302E+06, 0.100468854497717490E+06, 0.100484113018387754E+06, 0.100496513635322510E+06, - 0.100504396642556661E+06, 0.100514796346128511E+06, 0.100524493045942218E+06, 0.100532404153307187E+06, 0.100538289704171490E+06, - 0.101276336252575435E+06, 0.101298080414544456E+06, 0.101321469561098274E+06, 0.101347127563797287E+06, 0.101375017595738012E+06, - 0.101402741686854177E+06, 0.101429372639699533E+06, 0.101455094154428705E+06, 0.101479936738935212E+06, 0.101503527247806051E+06, - 0.101525558424067625E+06, 0.101545795970329476E+06, 0.101564086253569083E+06, 0.101579860400036196E+06, 0.101592656313919491E+06, - 0.101604222243081458E+06, 0.101615370617936293E+06, 0.101626717204329048E+06, 0.101638824013794816E+06, 0.101652144675515985E+06, - 0.101666986413953739E+06, 0.101683491567268982E+06, 0.101699730410034434E+06, 0.101715308981035720E+06, 0.101731361440654102E+06, - 0.101748589449732390E+06, 0.101766824698764540E+06, 0.101785841910313233E+06, 0.101805411629659066E+06, 0.101825381837012450E+06, - 0.101846839764007193E+06, 0.101867081140515147E+06, 0.101882747001865355E+06, 0.101896903928888263E+06, 0.101909362288120537E+06, - 0.101920245934517079E+06, 0.101930058238641242E+06, 0.101941637442764200E+06, 0.101954785426383867E+06, 0.101968215450878924E+06, - 0.101984710778129607E+06, 0.102001549965592465E+06, 0.102018275841846422E+06, 0.102034683222590960E+06, 0.102052401989689286E+06, - 0.102069645673240069E+06, 0.102086007650836211E+06, 0.102103768116502732E+06, 0.102121127630333416E+06, 0.102135973777942898E+06, - 0.102147987937177197E+06, 0.102156601874315427E+06, 0.102161672760610920E+06, 0.102163612354316181E+06, 0.102165768392921964E+06, - 0.102167214431077227E+06, 0.102169260247518920E+06, 0.102170746287005837E+06, 0.102171480626503515E+06, 0.102171269145651808E+06, - 0.102170214520413967E+06, 0.102167256562754847E+06, 0.102162479386098232E+06, 0.102158371150627951E+06, 0.102155244448894475E+06, - 0.102152875264177637E+06, 0.102149492287714515E+06, 0.102145495391175835E+06, 0.102139392366010521E+06, 0.102131234162350753E+06, - 0.102121845495369198E+06, 0.102114444604303775E+06, 0.102106462190456019E+06, 0.102096364075651625E+06, 0.102082958297694466E+06, - 0.102064065966768365E+06, 0.102041420899050965E+06, 0.102016297892142000E+06, 0.101989261194259234E+06, 0.101963193901333740E+06, - 0.101934697827006079E+06, 0.101902018630394974E+06, 0.101863893013675159E+06, 0.101820477410193009E+06, 0.101774528513823985E+06, - 0.101724002882111308E+06, 0.101665763047983230E+06, 0.101603648801794363E+06, 0.101540096977050402E+06, 0.101478947206942044E+06, - 0.101415470097827929E+06, 0.101351609294201058E+06, 0.101289469642166499E+06, 0.101226537327552069E+06, 0.101158605139549531E+06, - 0.101091671283985226E+06, 0.101026501778518956E+06, 0.100963906622713315E+06, 0.100912235109733156E+06, 0.100875156448926034E+06, - 0.100858092199168052E+06, 0.100869196724643829E+06, 0.100906258192389359E+06, 0.100966643545000639E+06, 0.101044871026198045E+06, - 0.101126128294873750E+06, 0.101195519846174895E+06, 0.101255659962385485E+06, 0.101297057174446716E+06, 0.101328131549875659E+06, - 0.101358621176643224E+06, 0.101392239138290606E+06, 0.101427359701943147E+06, 0.101468500213009858E+06, 0.101510703720686288E+06, - 0.101550908563824967E+06, 0.101587166287520682E+06, 0.101619760493459311E+06, 0.101640375989610111E+06, 0.101647164822681414E+06, - 0.101640476796716728E+06, 0.101620225665346763E+06, 0.101589549071868416E+06, 0.101551044697311809E+06, 0.101511563682290900E+06, - 0.101475939268223781E+06, 0.101437438003792078E+06, 0.101392805212183681E+06, 0.101332702985176016E+06, 0.101262976832194923E+06, - 0.101186444126810515E+06, 0.101108333464266703E+06, 0.101034512676034472E+06, 0.100963849818957518E+06, 0.100898562106253885E+06, - 0.100842056459041982E+06, 0.100798749608423153E+06, 0.100767148703609448E+06, 0.100745027122654850E+06, 0.100731425417328996E+06, - 0.100731821012642424E+06, 0.100734592849697350E+06, 0.100733986756515151E+06, 0.100727026999971698E+06, 0.100711618349869153E+06, - 0.100683470368124676E+06, 0.100640250766840603E+06, 0.100586314437398818E+06, 0.100534961959011474E+06, 0.100490642055552060E+06, - 0.100456264076438296E+06, 0.100432289810027520E+06, 0.100419632142970615E+06, 0.100423645734029778E+06, 0.100432024957258123E+06, - 0.100442709528904365E+06, 0.100454138069834065E+06, 0.100469282754753091E+06, 0.100483179206656147E+06, 0.100494317659240289E+06, - 0.100501048475271105E+06, 0.100503737147053136E+06, 0.100502939624753810E+06, 0.100506864511892840E+06, 0.100510205922212830E+06, - 0.100511985008099888E+06, 0.101269395817640194E+06, 0.101293433370600033E+06, 0.101320709064215349E+06, 0.101350720216622271E+06, - 0.101381363474586935E+06, 0.101411901774678990E+06, 0.101441702408660596E+06, 0.101470286272251309E+06, 0.101497612121933402E+06, - 0.101523409436511720E+06, 0.101547349710601979E+06, 0.101569178391354450E+06, 0.101588382552830284E+06, 0.101604424454005639E+06, - 0.101617806496970152E+06, 0.101629009202247544E+06, 0.101639790736640862E+06, 0.101650653799515901E+06, 0.101662034467563892E+06, - 0.101674429962589624E+06, 0.101688184881771667E+06, 0.101701776789907686E+06, 0.101715632368359467E+06, 0.101731005396025357E+06, - 0.101747619021182472E+06, 0.101764475149160600E+06, 0.101782565451806455E+06, 0.101801692572504733E+06, 0.101821649291101741E+06, - 0.101844372908615100E+06, 0.101868013490669473E+06, 0.101890926735153276E+06, 0.101912734436730447E+06, 0.101930521333358061E+06, - 0.101945955049482625E+06, 0.101959618341155976E+06, 0.101973842306752718E+06, 0.101990092943988522E+06, 0.102006492234429417E+06, - 0.102022981199823858E+06, 0.102039845835770568E+06, 0.102059553276874620E+06, 0.102079331788742449E+06, 0.102099902964415654E+06, - 0.102120532959564909E+06, 0.102140448801236460E+06, 0.102159255793075747E+06, 0.102176879448503649E+06, 0.102194365868866342E+06, - 0.102211106097444455E+06, 0.102224803244153038E+06, 0.102234823789642047E+06, 0.102240968923527806E+06, 0.102243570541519104E+06, - 0.102243519688579676E+06, 0.102244750868611838E+06, 0.102246759472131700E+06, 0.102247988131721504E+06, 0.102248209161490959E+06, - 0.102247170632681489E+06, 0.102243247319650705E+06, 0.102236753031268512E+06, 0.102230982493940493E+06, 0.102226187707310237E+06, - 0.102222666096639834E+06, 0.102220567141386651E+06, 0.102219855956292071E+06, 0.102215511479397683E+06, 0.102208434908867741E+06, - 0.102198721169081880E+06, 0.102186789184960857E+06, 0.102174609249495770E+06, 0.102164550205667154E+06, 0.102152502370517235E+06, - 0.102137501608386214E+06, 0.102118919702411848E+06, 0.102095889999392573E+06, 0.102070100404917495E+06, 0.102041997958624415E+06, - 0.102012090612610089E+06, 0.101983710969351829E+06, 0.101953137519082840E+06, 0.101920734120792738E+06, 0.101883717982373681E+06, - 0.101842973734119500E+06, 0.101798428245916861E+06, 0.101747102066966778E+06, 0.101687602338869881E+06, 0.101624664318831565E+06, - 0.101559707946739305E+06, 0.101491658640950249E+06, 0.101420567276357397E+06, 0.101354355882096454E+06, 0.101289435543346961E+06, - 0.101224098024003702E+06, 0.101159952737485408E+06, 0.101097956680038245E+06, 0.101035227047009626E+06, 0.100981546520210177E+06, - 0.100939244847484995E+06, 0.100914786575781181E+06, 0.100915867157493747E+06, 0.100942559164277671E+06, 0.100993021366280096E+06, - 0.101062207385378511E+06, 0.101136754321606641E+06, 0.101205153055716102E+06, 0.101267549676815237E+06, 0.101315566331653798E+06, - 0.101356986952566978E+06, 0.101400109049254897E+06, 0.101444047042664242E+06, 0.101488513133860251E+06, 0.101534593023339607E+06, - 0.101578862893253303E+06, 0.101617989104461085E+06, 0.101651469070145307E+06, 0.101676676962902973E+06, 0.101688426206951568E+06, - 0.101690699198194692E+06, 0.101681585082600272E+06, 0.101660802224054729E+06, 0.101632322368388574E+06, 0.101602214382015110E+06, - 0.101577248018812563E+06, 0.101546577483431887E+06, 0.101509347660459607E+06, 0.101460277851145336E+06, 0.101400695177468675E+06, - 0.101333061941295062E+06, 0.101259893373003069E+06, 0.101185498750814251E+06, 0.101111060613673137E+06, 0.101038806163680754E+06, - 0.100970853556921851E+06, 0.100913205537255504E+06, 0.100868081185120318E+06, 0.100831661076531760E+06, 0.100803490881640522E+06, - 0.100782858759036229E+06, 0.100767010800255986E+06, 0.100760517927946479E+06, 0.100755313595541767E+06, 0.100745011420950410E+06, - 0.100727337942231010E+06, 0.100696437123156371E+06, 0.100650083823098379E+06, 0.100597278983266224E+06, 0.100548413676936747E+06, - 0.100507765427222563E+06, 0.100477948430878227E+06, 0.100463614942480534E+06, 0.100466404104801695E+06, 0.100473340681007379E+06, - 0.100482742216284692E+06, 0.100492637659898319E+06, 0.100501306119762710E+06, 0.100508155310289090E+06, 0.100517896956254641E+06, - 0.100523967020314361E+06, 0.100525551437862276E+06, 0.100522692726944748E+06, 0.100516008939190593E+06, 0.100506617021169775E+06, - 0.100504130401290677E+06, 0.100500855757604397E+06, 0.101259195015618316E+06, 0.101287394131248599E+06, 0.101318624387393094E+06, - 0.101351388311065471E+06, 0.101384848445848693E+06, 0.101418230695586331E+06, 0.101450864090695264E+06, 0.101482215379592511E+06, - 0.101512000328888942E+06, 0.101540081556911420E+06, 0.101565958007626774E+06, 0.101589239793549044E+06, 0.101609354590231524E+06, - 0.101626245425942194E+06, 0.101640116415258730E+06, 0.101651384047841973E+06, 0.101660624537901342E+06, 0.101669864682349900E+06, - 0.101680046518619303E+06, 0.101691016789836227E+06, 0.101701600972581538E+06, 0.101712344116073305E+06, 0.101724596034016693E+06, - 0.101738626214170567E+06, 0.101754578760972465E+06, 0.101772464174383247E+06, 0.101790289256249525E+06, 0.101809225095436283E+06, - 0.101831409086778760E+06, 0.101855713865937665E+06, 0.101880304248738481E+06, 0.101904708267321548E+06, 0.101928659429272666E+06, - 0.101952215895369998E+06, 0.101973129343184191E+06, 0.101990492819853054E+06, 0.102009155453432861E+06, 0.102028626658851339E+06, - 0.102048465714061036E+06, 0.102068480817810836E+06, 0.102088846460710702E+06, 0.102110232566220016E+06, 0.102133295641766570E+06, - 0.102157356921516912E+06, 0.102181314870907911E+06, 0.102204374004590238E+06, 0.102226000444488978E+06, 0.102246017656184413E+06, - 0.102265607213167954E+06, 0.102282589184103534E+06, 0.102298432423255334E+06, 0.102310352702715958E+06, 0.102317999706446251E+06, - 0.102321598850661234E+06, 0.102323515138576258E+06, 0.102323197704490987E+06, 0.102322212878332677E+06, 0.102323063816814887E+06, - 0.102322646091264614E+06, 0.102319439183542258E+06, 0.102312970911412354E+06, 0.102304997794601848E+06, 0.102296841478971372E+06, - 0.102291418130089238E+06, 0.102288360395478667E+06, 0.102288552237265947E+06, 0.102287701703575425E+06, 0.102284538846590702E+06, - 0.102276897495121520E+06, 0.102265740813761135E+06, 0.102252134571836228E+06, 0.102237131022390793E+06, 0.102221272996986561E+06, - 0.102206507054624482E+06, 0.102189132554294789E+06, 0.102168602609417649E+06, 0.102145544389345145E+06, 0.102118566149667124E+06, - 0.102089083952633140E+06, 0.102057798140960163E+06, 0.102026969995698295E+06, 0.101997794023706476E+06, 0.101966743922712252E+06, - 0.101933057167765714E+06, 0.101896592945729586E+06, 0.101857371791885336E+06, 0.101815607416803119E+06, 0.101763023383776948E+06, - 0.101702407436462090E+06, 0.101635116047538351E+06, 0.101562945833011370E+06, 0.101485822606547168E+06, 0.101411005039628857E+06, - 0.101339835091662317E+06, 0.101272689532459044E+06, 0.101210368076346276E+06, 0.101154473004817381E+06, 0.101097829928473817E+06, - 0.101048482059940754E+06, 0.101007048910648111E+06, 0.100979473833055905E+06, 0.100973447727585182E+06, 0.100990584221201716E+06, - 0.101029960997994902E+06, 0.101087951257948895E+06, 0.101153695183268181E+06, 0.101219018003879406E+06, 0.101282293838312820E+06, - 0.101338465984178547E+06, 0.101391368230947162E+06, 0.101446772222011277E+06, 0.101500085973176334E+06, 0.101550853250171887E+06, - 0.101598573456663202E+06, 0.101641988898670184E+06, 0.101679214186169236E+06, 0.101710098564568776E+06, 0.101732780885386266E+06, - 0.101743179226637279E+06, 0.101740055966295447E+06, 0.101722994425650759E+06, 0.101700469255730888E+06, 0.101674123165238838E+06, - 0.101653160060864204E+06, 0.101631596453806415E+06, 0.101607075787893336E+06, 0.101574486424828559E+06, 0.101526976419999381E+06, - 0.101469612332252946E+06, 0.101404225279481514E+06, 0.101336714868594907E+06, 0.101267916935403031E+06, 0.101195492908750399E+06, - 0.101123687793417601E+06, 0.101058751346724224E+06, 0.101000171416406578E+06, 0.100947653236097554E+06, 0.100904324965127365E+06, - 0.100869022485961759E+06, 0.100838631774334179E+06, 0.100814997040174785E+06, 0.100796371893838630E+06, 0.100782994420463059E+06, - 0.100767931078048772E+06, 0.100738709347425858E+06, 0.100699551218149616E+06, 0.100657848886243373E+06, 0.100613930496747955E+06, - 0.100570328091677089E+06, 0.100536417956577148E+06, 0.100522106220241680E+06, 0.100523981788664518E+06, 0.100534576173254580E+06, - 0.100544607428678122E+06, 0.100555100707554739E+06, 0.100564477570051735E+06, 0.100571044680449282E+06, 0.100573984997784108E+06, - 0.100574098036419746E+06, 0.100574969682196417E+06, 0.100570985693230745E+06, 0.100562235725965831E+06, 0.100549403090203457E+06, - 0.100533663303323410E+06, 0.100514985690890928E+06, 0.100501506969102309E+06, 0.101247028543607215E+06, 0.101279000272323727E+06, - 0.101313044900483452E+06, 0.101348706117229129E+06, 0.101385099864543183E+06, 0.101421406335684835E+06, 0.101456908730823867E+06, - 0.101491027169870344E+06, 0.101523346965489472E+06, 0.101553641131603319E+06, 0.101581591041353255E+06, 0.101606456037034135E+06, - 0.101627802489960915E+06, 0.101645553091339185E+06, 0.101659871959589625E+06, 0.101671125963614424E+06, 0.101679833672676948E+06, - 0.101686600287344059E+06, 0.101693249899754504E+06, 0.101700828771449567E+06, 0.101708214676399468E+06, 0.101716786788727914E+06, - 0.101726994188702083E+06, 0.101739189978545895E+06, 0.101753597010140846E+06, 0.101770294478413707E+06, 0.101789229323241438E+06, - 0.101810439881563492E+06, 0.101833551125124432E+06, 0.101857745342370516E+06, 0.101882520275840274E+06, 0.101907489508364233E+06, - 0.101932461599410264E+06, 0.101957552146214075E+06, 0.101983305456973438E+06, 0.102008579834297911E+06, 0.102030494060992147E+06, - 0.102053548115608966E+06, 0.102077104427164624E+06, 0.102100783210934751E+06, 0.102124584361851768E+06, 0.102151618960978216E+06, - 0.102178487299050277E+06, 0.102203837934088209E+06, 0.102231789811787370E+06, 0.102258565924026567E+06, 0.102283435612743153E+06, - 0.102308168911264584E+06, 0.102331519967324959E+06, 0.102351306090243161E+06, 0.102367344163488393E+06, 0.102380956720203612E+06, - 0.102390540926741916E+06, 0.102396561280422888E+06, 0.102399644414793191E+06, 0.102399967479044542E+06, 0.102398097050173761E+06, - 0.102394877934586664E+06, 0.102392579382061362E+06, 0.102387437885771593E+06, 0.102380474134807795E+06, 0.102372089234619867E+06, - 0.102363087167973557E+06, 0.102355720695108947E+06, 0.102355336216227777E+06, 0.102355244528026058E+06, 0.102353863384518510E+06, - 0.102349945815737563E+06, 0.102342442703922468E+06, 0.102329934370864139E+06, 0.102314612359457431E+06, 0.102297370131901000E+06, - 0.102278388120427626E+06, 0.102257491551240819E+06, 0.102236307907230104E+06, 0.102213097347429662E+06, 0.102187800432568954E+06, - 0.102160229919730293E+06, 0.102129097981842890E+06, 0.102096889363146300E+06, 0.102063827052134482E+06, 0.102031184486610946E+06, - 0.101999264622467439E+06, 0.101966221591490219E+06, 0.101931754343580265E+06, 0.101897700536754972E+06, 0.101861993529889558E+06, - 0.101819636716650479E+06, 0.101763615901241341E+06, 0.101697976370488861E+06, 0.101620393736143524E+06, 0.101535102872161384E+06, - 0.101449253069692393E+06, 0.101374420264238244E+06, 0.101306501858255855E+06, 0.101247778577939956E+06, 0.101198381473636808E+06, - 0.101152064836353820E+06, 0.101110344624142366E+06, 0.101075281561938828E+06, 0.101049407554255304E+06, 0.101040768998780331E+06, - 0.101052199471517510E+06, 0.101082392815890635E+06, 0.101129144157533199E+06, 0.101184092780294726E+06, 0.101243772906750455E+06, - 0.101307121999288836E+06, 0.101369991062098430E+06, 0.101433698297000723E+06, 0.101498903828178067E+06, 0.101560474018943947E+06, - 0.101615857050411636E+06, 0.101665138596523073E+06, 0.101705590047241931E+06, 0.101738943786932854E+06, 0.101767114003134644E+06, - 0.101789192730629773E+06, 0.101799147989736230E+06, 0.101794735430608300E+06, 0.101777146397531964E+06, 0.101750372193384130E+06, - 0.101723141667504169E+06, 0.101702833712477848E+06, 0.101682678205011733E+06, 0.101660302359832262E+06, 0.101630633216063026E+06, - 0.101590584748240784E+06, 0.101537939783765964E+06, 0.101477184750419154E+06, 0.101412613988421668E+06, 0.101346432956553763E+06, - 0.101280354991399392E+06, 0.101215950742003886E+06, 0.101152407700542390E+06, 0.101091630971862964E+06, 0.101034381306262483E+06, - 0.100980581565512359E+06, 0.100932607474756849E+06, 0.100894526231033058E+06, 0.100863524006721316E+06, 0.100837940986693153E+06, - 0.100815616712752075E+06, 0.100783831314269482E+06, 0.100747340055464098E+06, 0.100708359519305974E+06, 0.100669700349442544E+06, - 0.100634134123292621E+06, 0.100602055798299742E+06, 0.100591037034284673E+06, 0.100590664657868474E+06, 0.100599127748830913E+06, - 0.100614596189110918E+06, 0.100634150489947802E+06, 0.100646345748706677E+06, 0.100655865724535965E+06, 0.100661116257080008E+06, - 0.100661028163947834E+06, 0.100655523835145024E+06, 0.100646490601253885E+06, 0.100636711851892294E+06, 0.100621894936014534E+06, - 0.100602810704563395E+06, 0.100576368488764041E+06, 0.100548286166395032E+06, 0.100522977180969814E+06, 0.101228903510937074E+06, - 0.101265781795862422E+06, 0.101303509185958625E+06, 0.101342284425688282E+06, 0.101381796177970391E+06, 0.101421170386188518E+06, - 0.101459636817675681E+06, 0.101496562449942183E+06, 0.101531479594885182E+06, 0.101564960000747014E+06, 0.101594803080993937E+06, - 0.101621355790812595E+06, 0.101644027594565501E+06, 0.101662677874236993E+06, 0.101677441926593165E+06, 0.101688651352830973E+06, - 0.101696785059940390E+06, 0.101702406683447451E+06, 0.101704728868073435E+06, 0.101705248359237783E+06, 0.101710033061244059E+06, - 0.101715986265950589E+06, 0.101723653592966657E+06, 0.101733480291010681E+06, 0.101745772459652580E+06, 0.101760677660607515E+06, - 0.101780220410703594E+06, 0.101803075598452182E+06, 0.101826488604444239E+06, 0.101849820362239523E+06, 0.101873892351949500E+06, - 0.101898378960095564E+06, 0.101923130766489805E+06, 0.101948518897807691E+06, 0.101975696258303404E+06, 0.102004061929304342E+06, - 0.102033460145040677E+06, 0.102061651327409054E+06, 0.102089414327740989E+06, 0.102117077133701037E+06, 0.102147883501053424E+06, - 0.102180718015203005E+06, 0.102212493723892243E+06, 0.102242559046992334E+06, 0.102271049350391899E+06, 0.102300915058795246E+06, - 0.102331227250506359E+06, 0.102361003675242988E+06, 0.102387797529886448E+06, 0.102410738749007287E+06, 0.102429543001075872E+06, - 0.102444601309541205E+06, 0.102455934113666241E+06, 0.102463826248762096E+06, 0.102468461440316110E+06, 0.102469870975073049E+06, - 0.102468446450288320E+06, 0.102464798290121791E+06, 0.102458449322550092E+06, 0.102451735051873286E+06, 0.102444849067868476E+06, - 0.102436636367539046E+06, 0.102428988993985171E+06, 0.102425331914020266E+06, 0.102421620005855337E+06, 0.102419560924305013E+06, - 0.102417115927208128E+06, 0.102411283378863518E+06, 0.102401124644854805E+06, 0.102388294546935547E+06, 0.102372130138911380E+06, - 0.102352872703988251E+06, 0.102330900792506814E+06, 0.102305906692453034E+06, 0.102278836660343848E+06, 0.102251891886031619E+06, - 0.102223352000414103E+06, 0.102193067106830058E+06, 0.102161078903831076E+06, 0.102125912821954276E+06, 0.102089510678556544E+06, - 0.102052507421496150E+06, 0.102015228902546209E+06, 0.101978931284532373E+06, 0.101944546111379605E+06, 0.101912474602996255E+06, - 0.101881505541306557E+06, 0.101847220983536259E+06, 0.101796545763435774E+06, 0.101731194445780915E+06, 0.101655521374345393E+06, - 0.101570254785904996E+06, 0.101481522317187802E+06, 0.101401331116195521E+06, 0.101332141668882890E+06, 0.101273993470810659E+06, - 0.101228638656778901E+06, 0.101190604276845741E+06, 0.101158196197344718E+06, 0.101133936056759660E+06, 0.101117981664703751E+06, - 0.101116933850947476E+06, 0.101131399795691948E+06, 0.101160604644423380E+06, 0.101201518443580746E+06, 0.101248903707713456E+06, - 0.101300592974865489E+06, 0.101357214090897702E+06, 0.101418441744321666E+06, 0.101485557443350626E+06, 0.101555445746166064E+06, - 0.101621303501475879E+06, 0.101679228518906544E+06, 0.101728241686716501E+06, 0.101766854072509333E+06, 0.101798436487011495E+06, - 0.101826906634104991E+06, 0.101847291990324695E+06, 0.101856878275200172E+06, 0.101852227620230362E+06, 0.101834698267214306E+06, - 0.101809239675292964E+06, 0.101781969547875371E+06, 0.101755152512939356E+06, 0.101732931589822008E+06, 0.101712653074247995E+06, - 0.101684830999865546E+06, 0.101647239704296619E+06, 0.101599826041378212E+06, 0.101544653396053778E+06, 0.101483464700333992E+06, - 0.101420696082338764E+06, 0.101361355157000173E+06, 0.101303077019503457E+06, 0.101242949922489031E+06, 0.101180470229611776E+06, - 0.101117365765681796E+06, 0.101054059738264114E+06, 0.100995066688862426E+06, 0.100946512981860345E+06, 0.100908291761953325E+06, - 0.100873905402216697E+06, 0.100835045455127693E+06, 0.100798873170272855E+06, 0.100762695696108858E+06, 0.100726025871425081E+06, - 0.100692734909454986E+06, 0.100668902864702948E+06, 0.100663213502720391E+06, 0.100664621390201341E+06, 0.100671374502519597E+06, - 0.100685680453359950E+06, 0.100705798123986984E+06, 0.100728995575579524E+06, 0.100751658112675097E+06, 0.100762519462763623E+06, - 0.100767027529124854E+06, 0.100764553224004907E+06, 0.100755187738630775E+06, 0.100739605979863540E+06, 0.100720551089520799E+06, - 0.100698313533178705E+06, 0.100666865056198847E+06, 0.100634031483894869E+06, 0.100601785153826728E+06, 0.100571987820731039E+06, - 0.101206374045435979E+06, 0.101245886159229500E+06, 0.101288633787391896E+06, 0.101331822184275137E+06, 0.101374720391458119E+06, - 0.101417383823794662E+06, 0.101458981013573735E+06, 0.101498818874093005E+06, 0.101538685205643225E+06, 0.101575422468180957E+06, - 0.101607594064004836E+06, 0.101634787525358639E+06, 0.101658391829702683E+06, 0.101677992927276675E+06, 0.101693216382147584E+06, - 0.101704372381742840E+06, 0.101711917535928253E+06, 0.101714961207000641E+06, 0.101714465004361307E+06, 0.101712311040969114E+06, - 0.101709673671424040E+06, 0.101711218999391320E+06, 0.101715783535561670E+06, 0.101722657082666818E+06, 0.101732238893442816E+06, - 0.101747062236834958E+06, 0.101766365174287086E+06, 0.101787109475394507E+06, 0.101808925705709073E+06, 0.101831553485340701E+06, - 0.101854101136956699E+06, 0.101876977318564983E+06, 0.101900071328279475E+06, 0.101924414875452247E+06, 0.101951462468272264E+06, - 0.101980975232741199E+06, 0.102012836826491402E+06, 0.102047258491401968E+06, 0.102083474297558190E+06, 0.102117469380506620E+06, - 0.102154658530511195E+06, 0.102192659983700083E+06, 0.102229894335694480E+06, 0.102265384438205918E+06, 0.102298947455958070E+06, - 0.102332733340180333E+06, 0.102366161911789881E+06, 0.102400223366988168E+06, 0.102430989231899657E+06, 0.102457385343324306E+06, - 0.102478953671150099E+06, 0.102497140263958892E+06, 0.102511039792962809E+06, 0.102520299291871444E+06, 0.102526846630820248E+06, - 0.102529945588383314E+06, 0.102529752833756676E+06, 0.102527108906249603E+06, 0.102521410242623388E+06, 0.102513405849115865E+06, - 0.102504764193898140E+06, 0.102498120743343170E+06, 0.102494756241843366E+06, 0.102491412904970945E+06, 0.102487349910826408E+06, - 0.102482003045019752E+06, 0.102474975478072651E+06, 0.102465362858837878E+06, 0.102453624922867719E+06, 0.102439388282147716E+06, - 0.102422313370157048E+06, 0.102401857750208626E+06, 0.102377162061003954E+06, 0.102349188460773526E+06, 0.102318424237125233E+06, - 0.102285363297180986E+06, 0.102252385208010586E+06, 0.102218029776633513E+06, 0.102181810380545387E+06, 0.102143591228429039E+06, - 0.102102341867038209E+06, 0.102057770995654748E+06, 0.102012593759546347E+06, 0.101970748503609808E+06, 0.101933725108693834E+06, - 0.101900789684666524E+06, 0.101867979870800904E+06, 0.101834235978935918E+06, 0.101794954568116285E+06, 0.101739484665823096E+06, - 0.101671789500483821E+06, 0.101593418617286006E+06, 0.101506698290483502E+06, 0.101422237896336897E+06, 0.101350833220772416E+06, - 0.101290575286891341E+06, 0.101248402171152557E+06, 0.101218529092999917E+06, 0.101197447450399108E+06, 0.101187612570890138E+06, - 0.101185871864261528E+06, 0.101196499134288402E+06, 0.101218353571942265E+06, 0.101249194623964548E+06, 0.101286372345386742E+06, - 0.101326464875508391E+06, 0.101369986766969960E+06, 0.101419749853660280E+06, 0.101476722498559480E+06, 0.101542829739890207E+06, - 0.101612522924097197E+06, 0.101678721249810798E+06, 0.101737575823144638E+06, 0.101785395492746917E+06, 0.101823368561408701E+06, - 0.101856014056084430E+06, 0.101884313206989173E+06, 0.101903695929922687E+06, 0.101912969317636380E+06, 0.101908832298462992E+06, - 0.101892237038585794E+06, 0.101866203497664581E+06, 0.101837081196005645E+06, 0.101809606048398258E+06, 0.101786840568731568E+06, - 0.101762564033379982E+06, 0.101734680154915579E+06, 0.101696592635540685E+06, 0.101650662453849189E+06, 0.101599162120752633E+06, - 0.101544343001196743E+06, 0.101488647544765059E+06, 0.101433089123172278E+06, 0.101377125096785036E+06, 0.101320042947392227E+06, - 0.101256674805424394E+06, 0.101187987297748215E+06, 0.101120641997896339E+06, 0.101056247927954246E+06, 0.100996331972370142E+06, - 0.100943232428022544E+06, 0.100895353842840079E+06, 0.100852555312220196E+06, 0.100815337064243067E+06, 0.100783799781542155E+06, - 0.100753868748835012E+06, 0.100736637044447663E+06, 0.100730650096307727E+06, 0.100733232093861763E+06, 0.100743913291446443E+06, - 0.100758835470579754E+06, 0.100778259316407013E+06, 0.100802567061591370E+06, 0.100828283762383522E+06, 0.100855135515023372E+06, - 0.100877691529341333E+06, 0.100882602938691591E+06, 0.100878787688210650E+06, 0.100866582130667157E+06, 0.100846949291204379E+06, - 0.100815418882725819E+06, 0.100780247866813195E+06, 0.100745087245795497E+06, 0.100709396490561645E+06, 0.100675020472311327E+06, - 0.100643622948665085E+06, 0.101179250397845899E+06, 0.101221149498052953E+06, 0.101266816356343159E+06, 0.101315335097978430E+06, - 0.101363838550262313E+06, 0.101410108301517408E+06, 0.101455090720967710E+06, 0.101501448789654576E+06, 0.101545139345543692E+06, - 0.101584741389399278E+06, 0.101619452976458153E+06, 0.101648772604086349E+06, 0.101672509578882498E+06, 0.101691865395895249E+06, - 0.101707555892752804E+06, 0.101718643945821881E+06, 0.101724156365132570E+06, 0.101724941937858879E+06, 0.101722568702130273E+06, - 0.101718069834871334E+06, 0.101712578971246767E+06, 0.101707223787895346E+06, 0.101704839789861668E+06, 0.101708104689497137E+06, - 0.101716865742578157E+06, 0.101731053443752840E+06, 0.101746952161869922E+06, 0.101764257279303914E+06, 0.101782706182959490E+06, - 0.101802123848941148E+06, 0.101822482313672357E+06, 0.101842936616784311E+06, 0.101860934973268697E+06, 0.101882854305976114E+06, - 0.101908552344231415E+06, 0.101937813400383588E+06, 0.101970499454458186E+06, 0.102006741063404974E+06, 0.102048298491096837E+06, - 0.102094559383243701E+06, 0.102138864116678858E+06, 0.102182980858368159E+06, 0.102226517702417070E+06, 0.102268076174545422E+06, - 0.102309052474061144E+06, 0.102352381321886001E+06, 0.102391102131696549E+06, 0.102425199358256839E+06, 0.102458541492672259E+06, - 0.102488862618142084E+06, 0.102514290917361213E+06, 0.102535791702452596E+06, 0.102552503476764061E+06, 0.102564543232835902E+06, - 0.102572720164328770E+06, 0.102578198051091356E+06, 0.102580323990135614E+06, 0.102579265394634727E+06, 0.102574962647335808E+06, - 0.102568059504060235E+06, 0.102560319977754334E+06, 0.102556118504191676E+06, 0.102553057067685237E+06, 0.102550069919232395E+06, - 0.102545676460258372E+06, 0.102538438321503912E+06, 0.102526558414006213E+06, 0.102512331043456594E+06, 0.102498934035030790E+06, - 0.102483367837719314E+06, 0.102465528571415576E+06, 0.102444019300123240E+06, 0.102417539855634386E+06, 0.102386941153851396E+06, - 0.102352803854769852E+06, 0.102315908735629360E+06, 0.102276253891919623E+06, 0.102235698643740441E+06, 0.102193754813942534E+06, - 0.102149197092732255E+06, 0.102100466547888893E+06, 0.102048387340808171E+06, 0.101995636407850165E+06, 0.101944784700201388E+06, - 0.101899202783926419E+06, 0.101857839910913841E+06, 0.101822276933475470E+06, 0.101792037001853430E+06, 0.101761456733915693E+06, - 0.101723124817417673E+06, 0.101667540093368385E+06, 0.101602052196997916E+06, 0.101524286713149719E+06, 0.101443448254745468E+06, - 0.101372151184877337E+06, 0.101312547429677303E+06, 0.101270741733953284E+06, 0.101245862300696550E+06, 0.101237403284129323E+06, - 0.101240955267019526E+06, 0.101253727619962054E+06, 0.101276647528408124E+06, 0.101307289777398546E+06, 0.101342096503173772E+06, - 0.101377440256415284E+06, 0.101410859947128090E+06, 0.101445291144028568E+06, 0.101485896954639960E+06, 0.101536034363702740E+06, - 0.101598275532425832E+06, 0.101665271864468625E+06, 0.101730455163620383E+06, 0.101789053839460757E+06, 0.101836451975671342E+06, - 0.101875114449402914E+06, 0.101909841821580325E+06, 0.101937388731349492E+06, 0.101957316621074744E+06, 0.101965726747313485E+06, - 0.101960066223235612E+06, 0.101941333444338321E+06, 0.101914153314528972E+06, 0.101884034639169928E+06, 0.101858023754631969E+06, - 0.101832589987368483E+06, 0.101805510097226972E+06, 0.101772567651719524E+06, 0.101733410070028302E+06, 0.101687946616198518E+06, - 0.101638303259297347E+06, 0.101588584508090702E+06, 0.101540424262528119E+06, 0.101488738611497931E+06, 0.101435260593399056E+06, - 0.101375735107437940E+06, 0.101312542555417007E+06, 0.101246134029601395E+06, 0.101177277643560679E+06, 0.101109587858444022E+06, - 0.101039831433180021E+06, 0.100972865937903305E+06, 0.100917142934489922E+06, 0.100872742649287640E+06, 0.100836992191858386E+06, - 0.100811317083979215E+06, 0.100803167641532855E+06, 0.100798970012812904E+06, 0.100800172827859802E+06, 0.100809159254650964E+06, - 0.100825090132632613E+06, 0.100846063732092007E+06, 0.100868925096583727E+06, 0.100895209549142979E+06, 0.100924583482422255E+06, - 0.100954767114643226E+06, 0.100982762726865476E+06, 0.101000126944911273E+06, 0.100996312696391295E+06, 0.100980278059754797E+06, - 0.100948675007578538E+06, 0.100912131109198177E+06, 0.100873893055713954E+06, 0.100836895686632663E+06, 0.100800840190763440E+06, - 0.100766824999287084E+06, 0.100736390306808840E+06, 0.101147547908848283E+06, 0.101191548413107710E+06, 0.101239813004555443E+06, - 0.101291456639815791E+06, 0.101345618815623297E+06, 0.101399848017628567E+06, 0.101452120246013321E+06, 0.101502531147260263E+06, - 0.101549713655955595E+06, 0.101592520742368200E+06, 0.101630069264663078E+06, 0.101661769202013544E+06, 0.101687336031179409E+06, - 0.101706783718499020E+06, 0.101720752729463624E+06, 0.101730352171304155E+06, 0.101734303682047248E+06, 0.101733803712048772E+06, - 0.101729673880940856E+06, 0.101722933683541196E+06, 0.101714707079396278E+06, 0.101706119415995257E+06, 0.101698183703231305E+06, - 0.101694443401773460E+06, 0.101701997679200067E+06, 0.101711622212974413E+06, 0.101722702839184887E+06, 0.101735051927557608E+06, - 0.101748506288605597E+06, 0.101762966981866150E+06, 0.101778437616403622E+06, 0.101789127619601830E+06, 0.101803967912821841E+06, - 0.101822592115495441E+06, 0.101845777685417066E+06, 0.101873478314957349E+06, 0.101905482242767845E+06, 0.101942888324591171E+06, - 0.101988404530944768E+06, 0.102038702733784274E+06, 0.102092474242398283E+06, 0.102148032734040069E+06, 0.102199248899464394E+06, - 0.102248915596860126E+06, 0.102302591874664358E+06, 0.102352656965704402E+06, 0.102397731646050539E+06, 0.102437448450124619E+06, - 0.102472449474120032E+06, 0.102503421423363616E+06, 0.102532064367287210E+06, 0.102556777288245488E+06, 0.102576671821794167E+06, - 0.102591572855277176E+06, 0.102602228863800672E+06, 0.102612279279788083E+06, 0.102616851593614643E+06, 0.102617893333235930E+06, - 0.102615765691172550E+06, 0.102610441888248854E+06, 0.102607301386114821E+06, 0.102603993592939412E+06, 0.102600663908017392E+06, - 0.102597488187445881E+06, 0.102592493791941044E+06, 0.102582466666192224E+06, 0.102569826273933562E+06, 0.102554713868615829E+06, - 0.102537648672080177E+06, 0.102521039168448478E+06, 0.102503173475915130E+06, 0.102480635537613605E+06, 0.102452652573625455E+06, - 0.102419350874903001E+06, 0.102382346399272821E+06, 0.102341612134553201E+06, 0.102297029075732309E+06, 0.102248948564059086E+06, - 0.102198720030139870E+06, 0.102145758870677353E+06, 0.102088950595530157E+06, 0.102029051584965782E+06, 0.101967199226732264E+06, - 0.101903210271600808E+06, 0.101842958311824055E+06, 0.101794271532633502E+06, 0.101756533651972539E+06, 0.101727257623922851E+06, - 0.101703822910323244E+06, 0.101679786232533574E+06, 0.101644516695705548E+06, 0.101595106427152612E+06, 0.101536504683202511E+06, - 0.101467865301457467E+06, 0.101405006154835806E+06, 0.101354849767181862E+06, 0.101317686662273423E+06, 0.101296595665381508E+06, - 0.101290414819946876E+06, 0.101298257504082198E+06, 0.101319018351106934E+06, 0.101351193190044753E+06, 0.101389882715506814E+06, - 0.101429774758297252E+06, 0.101465327153650665E+06, 0.101493697248690820E+06, 0.101519475777882981E+06, 0.101549278536429629E+06, - 0.101589674862889879E+06, 0.101644437539602266E+06, 0.101707639653092512E+06, 0.101773446880721283E+06, 0.101832627929812195E+06, - 0.101881326017934320E+06, 0.101922991773475122E+06, 0.101958375717528819E+06, 0.101986274837340650E+06, 0.102005491030983016E+06, - 0.102011686815100737E+06, 0.102002038930530602E+06, 0.101979844500374034E+06, 0.101949713592872038E+06, 0.101919794688969385E+06, - 0.101890097820657014E+06, 0.101860915631872151E+06, 0.101828511020572609E+06, 0.101792400720458652E+06, 0.101751700978283421E+06, - 0.101705424659848417E+06, 0.101656344874022790E+06, 0.101609238060088639E+06, 0.101564980684227325E+06, 0.101522208207649019E+06, - 0.101469412985671690E+06, 0.101412347630207965E+06, 0.101351832558558221E+06, 0.101288709894130297E+06, 0.101222062151738224E+06, - 0.101149874038784459E+06, 0.101078002130177440E+06, 0.101009088984990114E+06, 0.100945974661293003E+06, 0.100898762938745946E+06, - 0.100870562536964586E+06, 0.100856855516523385E+06, 0.100855450035140704E+06, 0.100864081929396765E+06, 0.100872263570757554E+06, - 0.100886283473303847E+06, 0.100905686340654982E+06, 0.100926632293872623E+06, 0.100951268783756459E+06, 0.100980364613721176E+06, - 0.101012594678026580E+06, 0.101045448177269616E+06, 0.101076054483113505E+06, 0.101101140326098612E+06, 0.101100763828566429E+06, - 0.101077946327603815E+06, 0.101047158711316821E+06, 0.101011715736067359E+06, 0.100974871631289832E+06, 0.100939265943285602E+06, - 0.100905758734950185E+06, 0.100874978764764266E+06, 0.100855175471442562E+06, 0.101111520792912168E+06, 0.101157325849907211E+06, - 0.101207855335016298E+06, 0.101262234561872421E+06, 0.101320453238625094E+06, 0.101383611932041124E+06, 0.101446021580746979E+06, - 0.101500639373333164E+06, 0.101551782605323038E+06, 0.101598222486408573E+06, 0.101638989420395039E+06, 0.101673403579343765E+06, - 0.101701089807805052E+06, 0.101721974472240297E+06, 0.101735419880771398E+06, 0.101741369945130849E+06, 0.101743897808629612E+06, - 0.101742267006478505E+06, 0.101736494037811004E+06, 0.101727612235604785E+06, 0.101716766590943007E+06, 0.101705114503249541E+06, - 0.101695691907190470E+06, 0.101691082917827283E+06, 0.101688492565094857E+06, 0.101689693834759819E+06, 0.101694319117847946E+06, - 0.101699984888099891E+06, 0.101706624023230441E+06, 0.101714209290037295E+06, 0.101714886189053461E+06, 0.101718477607258348E+06, - 0.101727166805334680E+06, 0.101741942812281210E+06, 0.101762884060961267E+06, 0.101787922016469936E+06, 0.101818124304470504E+06, - 0.101856144652932824E+06, 0.101902274632393572E+06, 0.101955219215111909E+06, 0.102013545239481187E+06, 0.102075989637765349E+06, - 0.102141825734524129E+06, 0.102209412008951840E+06, 0.102271101455590702E+06, 0.102328905451065119E+06, 0.102380997966748007E+06, - 0.102426592472327698E+06, 0.102466679017069036E+06, 0.102502492265674373E+06, 0.102531828163015132E+06, 0.102557693337524877E+06, - 0.102581562159738140E+06, 0.102599817594232780E+06, 0.102617360456048831E+06, 0.102630533755776734E+06, 0.102638413398652745E+06, - 0.102641585059017671E+06, 0.102641643207641609E+06, 0.102639909103140890E+06, 0.102637870663539637E+06, 0.102635390209430159E+06, - 0.102632452553768846E+06, 0.102629055188468876E+06, 0.102622883797323870E+06, 0.102613396703866238E+06, 0.102601167982128070E+06, - 0.102586228500797864E+06, 0.102570641502416736E+06, 0.102554342163336842E+06, 0.102534088219572732E+06, 0.102511041429401579E+06, - 0.102481963706129696E+06, 0.102447121630716501E+06, 0.102407091340582192E+06, 0.102362401740888643E+06, 0.102313427305605088E+06, - 0.102259555941640690E+06, 0.102201038299707958E+06, 0.102138783904224241E+06, 0.102073015852343407E+06, 0.102003417942998523E+06, - 0.101925865118624715E+06, 0.101850155355117560E+06, 0.101780650482480312E+06, 0.101721528392427077E+06, 0.101678592950691062E+06, - 0.101649600593305571E+06, 0.101630406458717945E+06, 0.101617445713840047E+06, 0.101603733747246617E+06, 0.101577149951594518E+06, - 0.101547743780961551E+06, 0.101507738128132827E+06, 0.101462001737325336E+06, 0.101417253659172507E+06, 0.101379673252643261E+06, - 0.101354722198341828E+06, 0.101344083982961922E+06, 0.101350090319994677E+06, 0.101372932240478462E+06, 0.101408874721438551E+06, - 0.101453217513073498E+06, 0.101497802352511892E+06, 0.101536224569247846E+06, 0.101563019361021943E+06, 0.101582620293203203E+06, - 0.101603379870639314E+06, 0.101634664417891821E+06, 0.101681132562699248E+06, 0.101739502773358443E+06, 0.101803164120008223E+06, - 0.101863683127456912E+06, 0.101917393438978630E+06, 0.101963558171047160E+06, 0.101999276960053059E+06, 0.102027732037148526E+06, - 0.102044731025719229E+06, 0.102045431775095058E+06, 0.102030705033808161E+06, 0.102003666856825570E+06, 0.101970343646836016E+06, - 0.101935360181740762E+06, 0.101900669036632447E+06, 0.101865688643875081E+06, 0.101829409780582253E+06, 0.101790176042387873E+06, - 0.101745151599830831E+06, 0.101696472660873420E+06, 0.101648060959889524E+06, 0.101603410369994090E+06, 0.101561835852602439E+06, - 0.101521855998799132E+06, 0.101482037163334768E+06, 0.101431340410975914E+06, 0.101375699870779092E+06, 0.101314779976223654E+06, - 0.101251712502201844E+06, 0.101185784883436660E+06, 0.101116517257030340E+06, 0.101049883113580014E+06, 0.100989563385332454E+06, - 0.100941765093850961E+06, 0.100916306862933794E+06, 0.100906980056579865E+06, 0.100910197269982164E+06, 0.100922958161069488E+06, - 0.100941314458770998E+06, 0.100957519326146881E+06, 0.100976831072572779E+06, 0.100999605735160003E+06, 0.101025582535843947E+06, - 0.101054164787686663E+06, 0.101087890451072817E+06, 0.101122283479534453E+06, 0.101149350938674921E+06, 0.101166873408313593E+06, - 0.101177821152178367E+06, 0.101167655432610394E+06, 0.101141220410113790E+06, 0.101110321588459745E+06, 0.101078361586283063E+06, - 0.101047967121170557E+06, 0.101023734539325480E+06, 0.101008383694813747E+06, 0.100996781521485842E+06, 0.101071681166949435E+06, - 0.101119012263039112E+06, 0.101171496350808069E+06, 0.101230050130927513E+06, 0.101294972556584413E+06, 0.101361718999132645E+06, - 0.101428515451916319E+06, 0.101493595145979649E+06, 0.101550612440880213E+06, 0.101601210858501552E+06, 0.101645666556374214E+06, - 0.101683206121268653E+06, 0.101713363718937704E+06, 0.101736031118329251E+06, 0.101750515944612693E+06, 0.101757053628392736E+06, - 0.101756382807271759E+06, 0.101751079781741602E+06, 0.101743715819909994E+06, 0.101732729519215369E+06, 0.101719316686245147E+06, - 0.101706213959027606E+06, 0.101695984176562313E+06, 0.101686190677071994E+06, 0.101677301261342131E+06, 0.101669511529871947E+06, - 0.101662644903393695E+06, 0.101659294762388396E+06, 0.101657066043437371E+06, 0.101647001805639928E+06, 0.101637372304767356E+06, - 0.101632049251178221E+06, 0.101632583495971994E+06, 0.101640198281276986E+06, 0.101655810259860154E+06, 0.101680028481804649E+06, - 0.101706638821039131E+06, 0.101742286180341995E+06, 0.101788109417502055E+06, 0.101842726554478882E+06, 0.101904504042995715E+06, - 0.101971839066862056E+06, 0.102051325178151485E+06, 0.102132183694597014E+06, 0.102209672996832567E+06, 0.102278148214885616E+06, - 0.102338448224708001E+06, 0.102390873033725249E+06, 0.102438626144456910E+06, 0.102479259552033545E+06, 0.102513206393975473E+06, - 0.102541824188105747E+06, 0.102567198188429233E+06, 0.102591367917437441E+06, 0.102612619776373147E+06, 0.102629292784196412E+06, - 0.102640555112501301E+06, 0.102646561280503796E+06, 0.102650072544106879E+06, 0.102650385076837265E+06, 0.102648623310889074E+06, - 0.102647398290377925E+06, 0.102645017994891765E+06, 0.102642292476577204E+06, 0.102637067835034904E+06, 0.102629000591322547E+06, - 0.102618729003435990E+06, 0.102606585296063713E+06, 0.102594489398555161E+06, 0.102579129366844747E+06, 0.102559288929741029E+06, - 0.102534463674515951E+06, 0.102503683064059122E+06, 0.102467677027648388E+06, 0.102425952698371388E+06, 0.102378489696413220E+06, - 0.102325464394964612E+06, 0.102266592853272959E+06, 0.102201770963158517E+06, 0.102131402230157837E+06, 0.102054746212255937E+06, - 0.101968929014764348E+06, 0.101881350922099227E+06, 0.101796528814235106E+06, 0.101718540575217223E+06, 0.101652169308423996E+06, - 0.101599956132104824E+06, 0.101567900805891448E+06, 0.101551935071902582E+06, 0.101547427861477787E+06, 0.101554419426909473E+06, - 0.101561600978615184E+06, 0.101559452993868224E+06, 0.101543318540946057E+06, 0.101516046490907509E+06, 0.101480708475794294E+06, - 0.101442199752635075E+06, 0.101409794893836297E+06, 0.101389114738180739E+06, 0.101385262237127725E+06, 0.101400028248419621E+06, - 0.101431176088229637E+06, 0.101474781214988048E+06, 0.101522572921117302E+06, 0.101566852249736243E+06, 0.101600450643120159E+06, - 0.101625889986676848E+06, 0.101647907487096571E+06, 0.101675661997654053E+06, 0.101714463575179296E+06, 0.101767306549608373E+06, - 0.101829328954263532E+06, 0.101890507206039634E+06, 0.101946066216170686E+06, 0.101992520848846892E+06, 0.102030925636120199E+06, - 0.102058119932572736E+06, 0.102069397218130180E+06, 0.102063960577488731E+06, 0.102043326123970241E+06, 0.102008553848255615E+06, - 0.101967472871147096E+06, 0.101926394136031289E+06, 0.101886043970172454E+06, 0.101846744426466306E+06, 0.101807275512743188E+06, - 0.101761955344090966E+06, 0.101713799217710359E+06, 0.101665117193273894E+06, 0.101617359026062331E+06, 0.101572592180247302E+06, - 0.101533981842693742E+06, 0.101499194744985522E+06, 0.101466415578573593E+06, 0.101432243614177438E+06, 0.101381882914991351E+06, - 0.101327735566313961E+06, 0.101272085428944469E+06, 0.101216117169049772E+06, 0.101156916040190554E+06, 0.101098197832462072E+06, - 0.101045083251186894E+06, 0.101001341900752319E+06, 0.100969631972021365E+06, 0.100962352822747649E+06, 0.100968513387743296E+06, - 0.100983909597780104E+06, 0.101002878032770619E+06, 0.101021997578890048E+06, 0.101041366902723443E+06, 0.101063829282811043E+06, - 0.101089246526039147E+06, 0.101117245287077734E+06, 0.101145180487582722E+06, 0.101169961535366980E+06, 0.101193870243324593E+06, - 0.101214945572481010E+06, 0.101231265902229890E+06, 0.101240946166576672E+06, 0.101226758959788902E+06, 0.101203801319224774E+06, - 0.101180554692105070E+06, 0.101163284364848339E+06, 0.101153028319845049E+06, 0.101150355172476586E+06, 0.101145580058182692E+06, - 0.101028800627874574E+06, 0.101077428684324259E+06, 0.101134167142638209E+06, 0.101197990565301836E+06, 0.101265722975280849E+06, - 0.101335709112544850E+06, 0.101406209334330430E+06, 0.101475487925550115E+06, 0.101541907493692343E+06, 0.101600856889744842E+06, - 0.101649573257523298E+06, 0.101690733358275495E+06, 0.101724376638615926E+06, 0.101749510141425519E+06, 0.101765791117457280E+06, - 0.101773452578481490E+06, 0.101773114885158633E+06, 0.101765715127990101E+06, 0.101752413867995332E+06, 0.101738692514285227E+06, - 0.101723904619569148E+06, 0.101710227930270819E+06, 0.101695310346281782E+06, 0.101679758838352922E+06, 0.101664029621015856E+06, - 0.101648327607929226E+06, 0.101632507008869143E+06, 0.101615973949263309E+06, 0.101591834033789346E+06, 0.101568495570761865E+06, - 0.101547691859404833E+06, 0.101531530936334253E+06, 0.101521827887484746E+06, 0.101520050854732108E+06, 0.101527313513054993E+06, - 0.101537145982894304E+06, 0.101560590862112396E+06, 0.101599562166824646E+06, 0.101645766826557534E+06, 0.101701752618078797E+06, - 0.101766692067664408E+06, 0.101846710834492522E+06, 0.101935405126349360E+06, 0.102024396175872622E+06, 0.102110867349092339E+06, - 0.102192853218211705E+06, 0.102269413494696259E+06, 0.102330281542130935E+06, 0.102383945506085889E+06, 0.102430199256480380E+06, - 0.102469066393364890E+06, 0.102501583023640342E+06, 0.102532817139689723E+06, 0.102561960069998779E+06, 0.102585754372647149E+06, - 0.102606277240311640E+06, 0.102621561801826407E+06, 0.102631876834385388E+06, 0.102638884194148588E+06, 0.102641934388380745E+06, - 0.102641959420915780E+06, 0.102640521654950935E+06, 0.102639686428696965E+06, 0.102638253506522131E+06, 0.102634465365988304E+06, - 0.102627915114268661E+06, 0.102619787557100746E+06, 0.102613378349844119E+06, 0.102603999870031650E+06, 0.102590631585167415E+06, - 0.102572103225089755E+06, 0.102547313635873026E+06, 0.102516398885249058E+06, 0.102479446900462790E+06, 0.102437237325361522E+06, - 0.102388874413479600E+06, 0.102333718028784861E+06, 0.102271049401030890E+06, 0.102201028861754414E+06, 0.102122663528859397E+06, - 0.102032876851637207E+06, 0.101938463410692304E+06, 0.101842660210214104E+06, 0.101749957344606999E+06, 0.101664764507437576E+06, - 0.101591439187819764E+06, 0.101533919460466379E+06, 0.101494271575071776E+06, 0.101478987993255127E+06, 0.101485263674090980E+06, - 0.101506279443945081E+06, 0.101532941096559764E+06, 0.101553896677561657E+06, 0.101563917085832989E+06, 0.101552692436306723E+06, - 0.101526766068070108E+06, 0.101490572300548680E+06, 0.101454740971174542E+06, 0.101425776324883132E+06, 0.101411062568111098E+06, - 0.101413866812942622E+06, 0.101435131474614493E+06, 0.101474051380900128E+06, 0.101522941427092213E+06, 0.101574152032058948E+06, - 0.101618098831177398E+06, 0.101654170137284003E+06, 0.101684054984246599E+06, 0.101716539075889523E+06, 0.101756604551361495E+06, - 0.101806467761705877E+06, 0.101862424100462653E+06, 0.101918408568819126E+06, 0.101971439624029648E+06, 0.102015800714595636E+06, - 0.102049385208646127E+06, 0.102069908714661666E+06, 0.102076032068515779E+06, 0.102064732659179368E+06, 0.102034093795762514E+06, - 0.101992630086863239E+06, 0.101944780810628261E+06, 0.101894141477159937E+06, 0.101849042057571452E+06, 0.101805808680122878E+06, - 0.101760916109816302E+06, 0.101714291793644923E+06, 0.101666393705850103E+06, 0.101619297696421156E+06, 0.101573598742667251E+06, - 0.101529420471224686E+06, 0.101490381423561645E+06, 0.101460489541744115E+06, 0.101432531917615197E+06, 0.101405679166028422E+06, - 0.101376758400729959E+06, 0.101333014356477448E+06, 0.101288061869102195E+06, 0.101243137897010267E+06, 0.101200014773099698E+06, - 0.101153035601030700E+06, 0.101107255027280131E+06, 0.101068975039667697E+06, 0.101040318598185462E+06, 0.101026239021205620E+06, - 0.101036150724925217E+06, 0.101050786638747362E+06, 0.101066960176317720E+06, 0.101082545023658342E+06, 0.101098187778212945E+06, - 0.101117678130985703E+06, 0.101139021760228803E+06, 0.101155522461091532E+06, 0.101175020122667425E+06, 0.101198265495543150E+06, - 0.101224832562545693E+06, 0.101250329820757150E+06, 0.101272684085133165E+06, 0.101289811161881575E+06, 0.101299701614067628E+06, - 0.101289739336630024E+06, 0.101279678002747503E+06, 0.101273826681569160E+06, 0.101274570526567550E+06, 0.101282465694758634E+06, - 0.101293902962443753E+06, 0.100983835656151976E+06, 0.101036388934372706E+06, 0.101096497142358145E+06, 0.101162397946509547E+06, - 0.101232608232112354E+06, 0.101305480982330599E+06, 0.101379283841868455E+06, 0.101452283197187178E+06, 0.101522834159475562E+06, - 0.101589476875808105E+06, 0.101650386759155634E+06, 0.101696210127681858E+06, 0.101733613430271813E+06, 0.101761832290367092E+06, - 0.101780569821559126E+06, 0.101789961901369534E+06, 0.101790532679209500E+06, 0.101783131653860866E+06, 0.101768849808582265E+06, - 0.101750041068809616E+06, 0.101731803246356489E+06, 0.101713921895166000E+06, 0.101693731889764837E+06, 0.101671835744684708E+06, - 0.101648705771986570E+06, 0.101624585079514640E+06, 0.101599389025969096E+06, 0.101563768387053642E+06, 0.101522704766848532E+06, - 0.101483489785699712E+06, 0.101448687013231232E+06, 0.101419615240213854E+06, 0.101397479525329196E+06, 0.101384028029676760E+06, - 0.101370836998047147E+06, 0.101368370266732833E+06, 0.101383065641375812E+06, 0.101416090998647196E+06, 0.101467290265164353E+06, - 0.101534882313080263E+06, 0.101609445319890510E+06, 0.101699733235880441E+06, 0.101794859855521834E+06, 0.101891101060966321E+06, - 0.101985315130313480E+06, 0.102075076914327306E+06, 0.102159945052938041E+06, 0.102235771297951098E+06, 0.102301477656430769E+06, - 0.102354930558367778E+06, 0.102399782724316072E+06, 0.102438694369211255E+06, 0.102476839111309280E+06, 0.102509751156878236E+06, - 0.102537521783681077E+06, 0.102560895469354815E+06, 0.102580819063130271E+06, 0.102594854584419911E+06, 0.102605160074562926E+06, - 0.102611577337313051E+06, 0.102614486702620023E+06, 0.102617674490494959E+06, 0.102619973525111447E+06, 0.102618324460179618E+06, - 0.102615416266488261E+06, 0.102610851205396946E+06, 0.102607299216665502E+06, 0.102602572628475973E+06, 0.102595515104050908E+06, - 0.102585432283621078E+06, 0.102569550312714797E+06, 0.102546496599273247E+06, 0.102517612581426918E+06, 0.102482362007529839E+06, - 0.102441544642516921E+06, 0.102393921375066857E+06, 0.102338338767732290E+06, 0.102273827698305467E+06, 0.102199580759235032E+06, - 0.102112717239415593E+06, 0.102017541011033652E+06, 0.101917267901995700E+06, 0.101815758981969469E+06, 0.101717854365049221E+06, - 0.101627270343615834E+06, 0.101547308817353100E+06, 0.101483765146806487E+06, 0.101441943712900873E+06, 0.101423999856314156E+06, - 0.101430776328316933E+06, 0.101457783973006139E+06, 0.101497023306538365E+06, 0.101538146597104598E+06, 0.101564980031804182E+06, - 0.101571345079031700E+06, 0.101556555710264554E+06, 0.101527227279379993E+06, 0.101491242458124063E+06, 0.101455431195561541E+06, - 0.101427222639413303E+06, 0.101413952789479707E+06, 0.101420016873493543E+06, 0.101448672726717166E+06, 0.101494479796940665E+06, - 0.101550679225448213E+06, 0.101607025893701604E+06, 0.101659304835337243E+06, 0.101705889950175377E+06, 0.101749787609497245E+06, - 0.101793551387452957E+06, 0.101844793551510127E+06, 0.101899113907290477E+06, 0.101951953582127840E+06, 0.101997167012573933E+06, - 0.102030191525044342E+06, 0.102053787395966574E+06, 0.102064887574337728E+06, 0.102060267944376203E+06, 0.102039749700523636E+06, - 0.102005081906476669E+06, 0.101957654047840246E+06, 0.101904801258523614E+06, 0.101850843726662788E+06, 0.101798946363995929E+06, - 0.101751878064897523E+06, 0.101705939443378287E+06, 0.101659768391705205E+06, 0.101615380159911743E+06, 0.101570783461705709E+06, - 0.101526947551755860E+06, 0.101484787939652975E+06, 0.101445231219594032E+06, 0.101413345817087800E+06, 0.101391047300393111E+06, - 0.101372584877227360E+06, 0.101355566853485740E+06, 0.101335220992961375E+06, 0.101303837716816255E+06, 0.101271525370591757E+06, - 0.101240298133351855E+06, 0.101211003024413338E+06, 0.101175839364889063E+06, 0.101146665774628709E+06, 0.101127801050420749E+06, - 0.101116214564623544E+06, 0.101115217567181709E+06, 0.101124992952320288E+06, 0.101134962605509543E+06, 0.101143290627816998E+06, - 0.101149282865567409E+06, 0.101151001731697805E+06, 0.101160080279956310E+06, 0.101174468885292459E+06, 0.101194158852267166E+06, - 0.101218629627263130E+06, 0.101247610934086246E+06, 0.101278139638903813E+06, 0.101306993640526780E+06, 0.101332857422239162E+06, - 0.101352835922766695E+06, 0.101364854062282961E+06, 0.101366215681609348E+06, 0.101371982657827277E+06, 0.101384204628605657E+06, - 0.101403123567578412E+06, 0.101427293507956012E+06, 0.100939699761507189E+06, 0.100993926545564740E+06, 0.101055617446205957E+06, - 0.101123302505147047E+06, 0.101195700951661318E+06, 0.101271150132425566E+06, 0.101347899405442047E+06, 0.101424189839355866E+06, - 0.101498339603613043E+06, 0.101568835452811982E+06, 0.101636401101424097E+06, 0.101695457584751377E+06, 0.101740082571501800E+06, - 0.101772165987128828E+06, 0.101794061760174460E+06, 0.101805821721959510E+06, 0.101807890769523758E+06, 0.101801052084176001E+06, - 0.101787222143099047E+06, 0.101769333451322513E+06, 0.101746134751190912E+06, 0.101718716143227328E+06, 0.101691356809011646E+06, - 0.101662464249923956E+06, 0.101631298348493656E+06, 0.101598170677190283E+06, 0.101554964683279206E+06, 0.101502331999436428E+06, - 0.101449056042133889E+06, 0.101396847279871756E+06, 0.101347056172201555E+06, 0.101300460882216124E+06, 0.101262584703042259E+06, - 0.101225780265849375E+06, 0.101194459775717551E+06, 0.101179417053502169E+06, 0.101183702376592380E+06, 0.101209076499852017E+06, - 0.101255909037280071E+06, 0.101326640203920455E+06, 0.101424239758254218E+06, 0.101531367651623077E+06, 0.101632910073723979E+06, - 0.101736158570445637E+06, 0.101837656744184424E+06, 0.101936360666710083E+06, 0.102029774479476604E+06, 0.102113550935132720E+06, - 0.102187275245992423E+06, 0.102251742085495353E+06, 0.102308744854441014E+06, 0.102354056548559587E+06, 0.102395496326958368E+06, - 0.102432085609497080E+06, 0.102463450245845990E+06, 0.102489865598489851E+06, 0.102514853262571502E+06, 0.102534082770129738E+06, - 0.102548592777604266E+06, 0.102559883810599669E+06, 0.102568794081739034E+06, 0.102579021392062437E+06, 0.102585007107402751E+06, - 0.102586497457448539E+06, 0.102584376842419224E+06, 0.102580903181294503E+06, 0.102577151681759657E+06, 0.102573827515381417E+06, - 0.102568538059750121E+06, 0.102560561364228692E+06, 0.102548460310359820E+06, 0.102530289426340809E+06, 0.102505861568008157E+06, - 0.102475498063954670E+06, 0.102440643792700503E+06, 0.102396241614374099E+06, 0.102341446243588929E+06, 0.102276649353635905E+06, - 0.102199862029058393E+06, 0.102111863644497949E+06, 0.102014314786398143E+06, 0.101910607455440113E+06, 0.101806306816961252E+06, - 0.101704399917697054E+06, 0.101609603981306922E+06, 0.101526211311625375E+06, 0.101459322473350869E+06, 0.101412795838567283E+06, - 0.101389618525710335E+06, 0.101393845554395113E+06, 0.101424357742906359E+06, 0.101472713797786171E+06, 0.101522607587252613E+06, - 0.101559998357663775E+06, 0.101576743781235520E+06, 0.101573310646049868E+06, 0.101549833954751783E+06, 0.101514456685338067E+06, - 0.101472694191529066E+06, 0.101434208011361596E+06, 0.101406914911600485E+06, 0.101398454904380153E+06, 0.101415253675564527E+06, - 0.101455136695375608E+06, 0.101512719547979839E+06, 0.101577237869349250E+06, 0.101641152022720256E+06, 0.101700396834169049E+06, - 0.101757567947174000E+06, 0.101815111575731135E+06, 0.101874014294397304E+06, 0.101930155420364375E+06, 0.101979578233631371E+06, - 0.102017827567168875E+06, 0.102041453032023797E+06, 0.102049181677356071E+06, 0.102042624564991027E+06, 0.102027458526470917E+06, - 0.101998856271186160E+06, 0.101958763385915998E+06, 0.101909825004560786E+06, 0.101855834630693556E+06, 0.101803471305377156E+06, - 0.101751840395667561E+06, 0.101701669671223848E+06, 0.101657371568089962E+06, 0.101614737302306821E+06, 0.101571808841198203E+06, - 0.101529035182503387E+06, 0.101487836291383923E+06, 0.101448187429775586E+06, 0.101410201287687276E+06, 0.101375725543945955E+06, - 0.101354091334976038E+06, 0.101343701275904139E+06, 0.101337958790157587E+06, 0.101334014323027164E+06, 0.101323058410853802E+06, - 0.101303680281432564E+06, 0.101285071086934273E+06, 0.101269046902558985E+06, 0.101256912292666253E+06, 0.101239485050412128E+06, - 0.101225094542196108E+06, 0.101214114558167246E+06, 0.101206300766355242E+06, 0.101205366180458252E+06, 0.101205376802251209E+06, - 0.101196436467417006E+06, 0.101184014918681118E+06, 0.101170971956995039E+06, 0.101173896703063627E+06, 0.101186778426832985E+06, - 0.101207425966799259E+06, 0.101235075391491133E+06, 0.101268299800364039E+06, 0.101308063493844020E+06, 0.101344788336284473E+06, - 0.101376389450400151E+06, 0.101402378295128001E+06, 0.101423140134659829E+06, 0.101438782026730638E+06, 0.101455746728587110E+06, - 0.101479368387625509E+06, 0.101509546030359561E+06, 0.101546739387306210E+06, 0.100893625093361974E+06, 0.100948455392464501E+06, - 0.101011317645263582E+06, 0.101080913011082172E+06, 0.101155302174425058E+06, 0.101233112731396410E+06, 0.101312551980581891E+06, - 0.101391810121618284E+06, 0.101469643740293817E+06, 0.101547894952444782E+06, 0.101619713078854009E+06, 0.101683304064554628E+06, - 0.101737232999154556E+06, 0.101779617777438179E+06, 0.101805388291197829E+06, 0.101820150398714570E+06, 0.101824280737551730E+06, - 0.101819067925622789E+06, 0.101806980910888844E+06, 0.101787436214918198E+06, 0.101761287349566453E+06, 0.101729423465328233E+06, - 0.101692622608612961E+06, 0.101651573936670728E+06, 0.101611590783753491E+06, 0.101562833006838278E+06, 0.101502364394767414E+06, - 0.101438724936641054E+06, 0.101373805958635741E+06, 0.101309369954324357E+06, 0.101246873385268977E+06, 0.101187267453513661E+06, - 0.101122914968029043E+06, 0.101055428119650373E+06, 0.101008249772026029E+06, 0.100979473982631680E+06, 0.100972177967227311E+06, - 0.100988832853860484E+06, 0.101031262783445170E+06, 0.101112202656024601E+06, 0.101211093846252057E+06, 0.101323155130905317E+06, - 0.101443212391304434E+06, 0.101565274984548159E+06, 0.101675064133449094E+06, 0.101783046764746541E+06, 0.101883427362778093E+06, - 0.101974048605326316E+06, 0.102054089915572622E+06, 0.102123916001737191E+06, 0.102185138506351650E+06, 0.102239277647944138E+06, - 0.102288043635062262E+06, 0.102329848961112002E+06, 0.102365570526105090E+06, 0.102398175565311816E+06, 0.102427118018994763E+06, - 0.102451215888181687E+06, 0.102470889959435211E+06, 0.102487322259304128E+06, 0.102507363262553656E+06, 0.102522539511451090E+06, - 0.102533202617323841E+06, 0.102538447738773189E+06, 0.102539366679125000E+06, 0.102537806325041631E+06, 0.102534134338413278E+06, - 0.102529616480806799E+06, 0.102525504718401397E+06, 0.102520340764588414E+06, 0.102512361946182253E+06, 0.102499685852779818E+06, - 0.102481370178637997E+06, 0.102461804458447645E+06, 0.102433116211535496E+06, 0.102394820498302695E+06, 0.102344806742965229E+06, - 0.102282869771580241E+06, 0.102208190347609911E+06, 0.102122230232017173E+06, 0.102026360478078772E+06, 0.101922376088166435E+06, - 0.101815964790077211E+06, 0.101712553837059808E+06, 0.101615912730210781E+06, 0.101531538428717235E+06, 0.101462015329520931E+06, - 0.101411095529211190E+06, 0.101383553801811446E+06, 0.101387868686696354E+06, 0.101419065450411930E+06, 0.101465197763774107E+06, - 0.101514122624701689E+06, 0.101554157750064871E+06, 0.101577510533460605E+06, 0.101578561408166206E+06, 0.101561717136454608E+06, - 0.101527942832344896E+06, 0.101485492708933743E+06, 0.101442040681691869E+06, 0.101407214730937660E+06, 0.101391475969427891E+06, - 0.101402057936737707E+06, 0.101438129992839313E+06, 0.101494675186752138E+06, 0.101561405991801003E+06, 0.101631832958464947E+06, - 0.101700764128050694E+06, 0.101765471244284083E+06, 0.101829298739144535E+06, 0.101891487805957440E+06, 0.101949649930012936E+06, - 0.101996983260441179E+06, 0.102028825999188412E+06, 0.102041977726062381E+06, 0.102037063043873364E+06, 0.102018484271153007E+06, - 0.101987519813082123E+06, 0.101953322744109144E+06, 0.101911210582393775E+06, 0.101863879485885569E+06, 0.101813868935175255E+06, - 0.101763558865488987E+06, 0.101714781421884982E+06, 0.101669784944327868E+06, 0.101626116114336663E+06, 0.101583855166139518E+06, - 0.101542346971029430E+06, 0.101502633877275308E+06, 0.101464939559164166E+06, 0.101426766367174598E+06, 0.101390458857219390E+06, - 0.101358471458522574E+06, 0.101334112694217969E+06, 0.101328407691393310E+06, 0.101330874497622441E+06, 0.101337110359200757E+06, - 0.101343736678259927E+06, 0.101343244142495707E+06, 0.101341300900043818E+06, 0.101339844172589394E+06, 0.101338724330486657E+06, - 0.101333664918719776E+06, 0.101322891249048946E+06, 0.101311826452015521E+06, 0.101299221594776434E+06, 0.101282571152943405E+06, - 0.101266530780531204E+06, 0.101246643011162712E+06, 0.101224150063358495E+06, 0.101202571591745436E+06, 0.101188612840670292E+06, - 0.101199966484071061E+06, 0.101222097051704724E+06, 0.101260233588647054E+06, 0.101304129252313578E+06, 0.101350161554908336E+06, - 0.101389652624068185E+06, 0.101424551417429771E+06, 0.101454274075586436E+06, 0.101479148917351384E+06, 0.101500388782067501E+06, - 0.101525545796928971E+06, 0.101562513561929518E+06, 0.101606090475506091E+06, 0.101653619386718725E+06, 0.100845507039246062E+06, - 0.100900566753226827E+06, 0.100964147998307293E+06, 0.101035004760987780E+06, 0.101111734714359307E+06, 0.101192123809297234E+06, - 0.101274156352906692E+06, 0.101357605885697238E+06, 0.101443671119726976E+06, 0.101525544557033369E+06, 0.101601182677887831E+06, - 0.101668789681363778E+06, 0.101726898348598319E+06, 0.101774441929614739E+06, 0.101810815552412794E+06, 0.101832035149566495E+06, - 0.101838765440822797E+06, 0.101835596101807649E+06, 0.101823419644672496E+06, 0.101802715728713345E+06, 0.101774151142095492E+06, - 0.101738457612419079E+06, 0.101696295926065533E+06, 0.101648104911459959E+06, 0.101590285842002006E+06, 0.101521209919707282E+06, - 0.101450839575846665E+06, 0.101376697188940336E+06, 0.101300744148618498E+06, 0.101224863840720194E+06, 0.101150697403150189E+06, - 0.101073301607053800E+06, 0.100983235760375988E+06, 0.100901684378507489E+06, 0.100833101972986929E+06, 0.100781373167571786E+06, - 0.100760772506158712E+06, 0.100768040826660945E+06, 0.100819963855216105E+06, 0.100898361962391151E+06, 0.100996401252706506E+06, - 0.101109805590524003E+06, 0.101233684034863138E+06, 0.101362757333502159E+06, 0.101494642793831357E+06, 0.101619684005633680E+06, - 0.101728129058541483E+06, 0.101825059560781054E+06, 0.101910320070122136E+06, 0.101982389350624275E+06, 0.102044412115271698E+06, - 0.102100145695870931E+06, 0.102151182120026933E+06, 0.102199014246850449E+06, 0.102244844616859526E+06, 0.102284509458517772E+06, - 0.102318215421307876E+06, 0.102347902960885476E+06, 0.102373421335254781E+06, 0.102401951332123936E+06, 0.102429181477717284E+06, - 0.102450532016644735E+06, 0.102465997336774948E+06, 0.102475777963121422E+06, 0.102478313815590023E+06, 0.102478110250759957E+06, - 0.102475657036715347E+06, 0.102471918321198871E+06, 0.102469939192222024E+06, 0.102467007436977176E+06, 0.102462490014742158E+06, - 0.102456722431479779E+06, 0.102450737615132341E+06, 0.102440335034919917E+06, 0.102420575011656954E+06, 0.102389812989896382E+06, - 0.102347122683242473E+06, 0.102292275082950306E+06, 0.102224438636867562E+06, 0.102143836217952965E+06, 0.102050866494433591E+06, - 0.101949943411085245E+06, 0.101845736377779569E+06, 0.101742816153747364E+06, 0.101647911129982123E+06, 0.101563216996056130E+06, - 0.101491604823778136E+06, 0.101437861556007003E+06, 0.101412287502927546E+06, 0.101412856551671823E+06, 0.101435247443498505E+06, - 0.101472966599928535E+06, 0.101514519271643498E+06, 0.101550307716508367E+06, 0.101572773831424129E+06, 0.101577300876503461E+06, - 0.101561783761491213E+06, 0.101528832671536744E+06, 0.101487621468217170E+06, 0.101449333621855301E+06, 0.101421572690143163E+06, - 0.101412849368901254E+06, 0.101428815273143569E+06, 0.101468452704213269E+06, 0.101526342258825374E+06, 0.101593070240422909E+06, - 0.101660293633886846E+06, 0.101724359259873541E+06, 0.101785772418607943E+06, 0.101847556062125179E+06, 0.101908363003809383E+06, - 0.101961701914240010E+06, 0.102002429874153109E+06, 0.102025185688122059E+06, 0.102030228237618969E+06, 0.102016392623057240E+06, - 0.101989203583738155E+06, 0.101954215596148948E+06, 0.101916658897302012E+06, 0.101876815696310456E+06, 0.101833071043157586E+06, - 0.101787308476072212E+06, 0.101741539193291770E+06, 0.101697630101558476E+06, 0.101654119182481736E+06, 0.101610960850170581E+06, - 0.101569179414185535E+06, 0.101528773468682877E+06, 0.101490142318063241E+06, 0.101454189911789217E+06, 0.101420537325155994E+06, - 0.101387196165512592E+06, 0.101359208745426033E+06, 0.101338989486127597E+06, 0.101329695327606096E+06, 0.101338867992364074E+06, - 0.101355871810450670E+06, 0.101375430345140587E+06, 0.101394209504973755E+06, 0.101402919751202760E+06, 0.101410688334029808E+06, - 0.101416920285657412E+06, 0.101420489242522977E+06, 0.101413658635510583E+06, 0.101399351916641783E+06, 0.101380364637205465E+06, - 0.101357315413079603E+06, 0.101331383086953632E+06, 0.101302463143222500E+06, 0.101271861027862804E+06, 0.101243797629858222E+06, - 0.101225102912379341E+06, 0.101230895188582799E+06, 0.101260967028080006E+06, 0.101301126414935963E+06, 0.101347821784489817E+06, - 0.101397550525323837E+06, 0.101444003541722705E+06, 0.101480976560253359E+06, 0.101512946357403111E+06, 0.101540212183607568E+06, - 0.101567953884550225E+06, 0.101594468785546575E+06, 0.101637676393726375E+06, 0.101688399693186482E+06, 0.101742930184759069E+06, - 0.100795882153115017E+06, 0.100850797431345025E+06, 0.100914750948998306E+06, 0.100986523708389999E+06, 0.101064741053657359E+06, - 0.101147944583867647E+06, 0.101236474647069423E+06, 0.101327593382317646E+06, 0.101416818345205553E+06, 0.101501970105562199E+06, - 0.101581006340059568E+06, 0.101652107178935606E+06, 0.101713753841424812E+06, 0.101764799350409041E+06, 0.101804529976921447E+06, - 0.101832451081090258E+06, 0.101847567048303332E+06, 0.101846442214230046E+06, 0.101834900151378431E+06, 0.101813744156519519E+06, - 0.101783490044669117E+06, 0.101744750228076155E+06, 0.101698109004179641E+06, 0.101641364118676778E+06, 0.101569583201128436E+06, - 0.101490816574609969E+06, 0.101406531256311253E+06, 0.101319625817001812E+06, 0.101233091961074242E+06, 0.101146347584902731E+06, - 0.101058989124578555E+06, 0.100953964690316512E+06, 0.100852899705475327E+06, 0.100760578698964149E+06, 0.100681685450575751E+06, - 0.100620492778267973E+06, 0.100580496608869158E+06, 0.100579462774121028E+06, 0.100625977088063315E+06, 0.100699672061534206E+06, - 0.100794647180633037E+06, 0.100907249288633233E+06, 0.101033016501104474E+06, 0.101170532820658074E+06, 0.101310202043631813E+06, - 0.101443951517617694E+06, 0.101566665342990047E+06, 0.101674561727816923E+06, 0.101762857707379371E+06, 0.101831050817027455E+06, - 0.101892059674295087E+06, 0.101947353598683054E+06, 0.101998507084363489E+06, 0.102047351014086569E+06, 0.102096770563981801E+06, - 0.102143221374936838E+06, 0.102186890306655871E+06, 0.102228196597294736E+06, 0.102264105567156759E+06, 0.102302445150954794E+06, - 0.102336246787148004E+06, 0.102363781472504663E+06, 0.102384291162903231E+06, 0.102397430622010026E+06, 0.102403312624922473E+06, - 0.102403832627536103E+06, 0.102402612769131738E+06, 0.102401390930183130E+06, 0.102401466546220196E+06, 0.102401874865610895E+06, - 0.102402100027913009E+06, 0.102404524182350739E+06, 0.102408945753433436E+06, 0.102408228479075435E+06, 0.102399207567720179E+06, - 0.102378727543360583E+06, 0.102346081419689654E+06, 0.102300584036716507E+06, 0.102242408524207058E+06, 0.102170172560628038E+06, - 0.102084827969266131E+06, 0.101990466580006148E+06, 0.101891305283198890E+06, 0.101794051647235989E+06, 0.101701758202335564E+06, - 0.101617607399452128E+06, 0.101545673956610553E+06, 0.101493920019806435E+06, 0.101463389589686616E+06, 0.101454707404169429E+06, - 0.101465784796775130E+06, 0.101489404864046577E+06, 0.101519701691131908E+06, 0.101547620610180951E+06, 0.101565576165996550E+06, - 0.101562026624260950E+06, 0.101539419490073633E+06, 0.101508015501831396E+06, 0.101475602714955035E+06, 0.101449209652947975E+06, - 0.101436251410560508E+06, 0.101442877175111498E+06, 0.101471341372345414E+06, 0.101518178052896081E+06, 0.101577355032239313E+06, - 0.101641314782584261E+06, 0.101703564541155953E+06, 0.101762362987943518E+06, 0.101818379277178246E+06, 0.101872714548978096E+06, - 0.101924119264252775E+06, 0.101966776195386803E+06, 0.101995500768842219E+06, 0.102007086660768691E+06, 0.102002030153628395E+06, - 0.101985038462701981E+06, 0.101956611217972633E+06, 0.101924174284332606E+06, 0.101890531345005773E+06, 0.101858684611865552E+06, - 0.101821867670641383E+06, 0.101781442886233301E+06, 0.101738169818174909E+06, 0.101693020445221118E+06, 0.101649533509090848E+06, - 0.101606065252630258E+06, 0.101563356987927487E+06, 0.101522196794781717E+06, 0.101483000104046587E+06, 0.101448492093986119E+06, - 0.101420196255985837E+06, 0.101395294590973572E+06, 0.101373162271020163E+06, 0.101359621762719311E+06, 0.101356933368830039E+06, - 0.101368947980949306E+06, 0.101392192190573551E+06, 0.101417779659041989E+06, 0.101442531040709990E+06, 0.101462476541542521E+06, - 0.101476476704636079E+06, 0.101486973325915984E+06, 0.101492708978460287E+06, 0.101491506327010982E+06, 0.101476163566485891E+06, - 0.101454012045195879E+06, 0.101426588508176050E+06, 0.101395767868210212E+06, 0.101361555520167341E+06, 0.101327388871009054E+06, - 0.101300667576237203E+06, 0.101284994174892112E+06, 0.101283350959747040E+06, 0.101309210052713708E+06, 0.101350688755181967E+06, - 0.101399465772761600E+06, 0.101451857069433157E+06, 0.101504338927611956E+06, 0.101548087731741456E+06, 0.101585173851711908E+06, - 0.101617418107249265E+06, 0.101645918462371425E+06, 0.101672368866688703E+06, 0.101702644054264791E+06, 0.101756834440843944E+06, - 0.101815020493009375E+06, 0.100745394112667054E+06, 0.100799832870823317E+06, 0.100863855953311213E+06, 0.100936251298315474E+06, - 0.101015648499264644E+06, 0.101104654341683374E+06, 0.101200128443110370E+06, 0.101296361142831636E+06, 0.101389195762127056E+06, - 0.101477275829104881E+06, 0.101559295351936235E+06, 0.101633387586243814E+06, 0.101697961740723156E+06, 0.101751772598623953E+06, - 0.101793901427349119E+06, 0.101823866729636080E+06, 0.101841583691637163E+06, 0.101847052782340179E+06, 0.101840097601263231E+06, - 0.101819364884434224E+06, 0.101788292383590582E+06, 0.101747405137351147E+06, 0.101695621343299601E+06, 0.101627436111935327E+06, - 0.101550322384277897E+06, 0.101465476616664964E+06, 0.101374194733789423E+06, 0.101277718928660746E+06, 0.101177047947947533E+06, - 0.101075621770040874E+06, 0.100963507971772880E+06, 0.100850151599165794E+06, 0.100741049456883455E+06, 0.100641201275214524E+06, - 0.100555640521779089E+06, 0.100489164793431541E+06, 0.100453712051746988E+06, 0.100455966233873114E+06, 0.100484341033634380E+06, - 0.100537490332318921E+06, 0.100620003905902136E+06, 0.100729309835612949E+06, 0.100858870023752374E+06, 0.101002649715674357E+06, - 0.101147678361066428E+06, 0.101287802540963821E+06, 0.101417496539417145E+06, 0.101532273896933402E+06, 0.101613683175199098E+06, - 0.101680723164626179E+06, 0.101737444859119263E+06, 0.101791182708811306E+06, 0.101841314940347904E+06, 0.101891796533315224E+06, - 0.101941590080887530E+06, 0.101990059211011772E+06, 0.102037355306302023E+06, 0.102083701488133767E+06, 0.102136891332944331E+06, - 0.102186806386969169E+06, 0.102230479823408270E+06, 0.102264774535572782E+06, 0.102290420308268731E+06, 0.102307702555592783E+06, - 0.102317766904831617E+06, 0.102321662148245741E+06, 0.102321498408406202E+06, 0.102320441248726507E+06, 0.102319523718290511E+06, - 0.102322447750704567E+06, 0.102327503158949214E+06, 0.102340754529364640E+06, 0.102353506384693246E+06, 0.102362358688122375E+06, - 0.102364445626707267E+06, 0.102355674159446760E+06, 0.102335040551811529E+06, 0.102301981999839074E+06, 0.102255676163442389E+06, - 0.102195798314690837E+06, 0.102122639698007450E+06, 0.102039086723219865E+06, 0.101949840960878224E+06, 0.101859938889724974E+06, - 0.101771880315094095E+06, 0.101689691466275064E+06, 0.101619553461018091E+06, 0.101564784382206009E+06, 0.101527063676792590E+06, - 0.101506865347517232E+06, 0.101503522390084341E+06, 0.101512744653858725E+06, 0.101529231308459130E+06, 0.101545937638918578E+06, - 0.101543746232650679E+06, 0.101529149091683401E+06, 0.101505036617385034E+06, 0.101477259643610611E+06, 0.101452985842091570E+06, - 0.101443019818922796E+06, 0.101450005107018835E+06, 0.101477223491849247E+06, 0.101523231314288976E+06, 0.101581629450517838E+06, - 0.101644098508760901E+06, 0.101703051093558723E+06, 0.101755080739197074E+06, 0.101801349748540073E+06, 0.101847343504094184E+06, - 0.101892088842664132E+06, 0.101930776572625342E+06, 0.101959972929516225E+06, 0.101973275480066382E+06, 0.101972016851233420E+06, - 0.101959747868463455E+06, 0.101940685784926434E+06, 0.101919336338791196E+06, 0.101894507185877927E+06, 0.101871113669696017E+06, - 0.101847657889249851E+06, 0.101820887903955852E+06, 0.101784170021964572E+06, 0.101741602583369866E+06, 0.101694747059338464E+06, - 0.101647292622998575E+06, 0.101600773270067424E+06, 0.101554052329806203E+06, 0.101509997350416306E+06, 0.101472107321641699E+06, - 0.101442071551669200E+06, 0.101420240877131699E+06, 0.101406891473258380E+06, 0.101396015807551084E+06, 0.101392164060749914E+06, - 0.101397198621684831E+06, 0.101410725481402653E+06, 0.101436168965154429E+06, 0.101464448461599168E+06, 0.101491134274545591E+06, - 0.101513817760506034E+06, 0.101531534488231206E+06, 0.101544658070101810E+06, 0.101551681755858954E+06, 0.101551216434335554E+06, - 0.101539195357785327E+06, 0.101514919199184893E+06, 0.101483010220912314E+06, 0.101448007466093870E+06, 0.101414858070553688E+06, - 0.101383218898751307E+06, 0.101359262217297684E+06, 0.101346709055278770E+06, 0.101347915439013712E+06, 0.101365119587774912E+06, - 0.101407924765819262E+06, 0.101458658683875430E+06, 0.101515675014729291E+06, 0.101573920518004117E+06, 0.101629788706552135E+06, - 0.101668434413804149E+06, 0.101700504314289530E+06, 0.101727848552964642E+06, 0.101752288382924846E+06, 0.101776226460626523E+06, - 0.101814361167678813E+06, 0.101872139466116685E+06, 0.100694816386903738E+06, 0.100748531064111390E+06, 0.100812413075077391E+06, - 0.100885240325433202E+06, 0.100971984589634725E+06, 0.101066079836500590E+06, 0.101163332246353209E+06, 0.101261519892330936E+06, - 0.101358385768427062E+06, 0.101451421123224791E+06, 0.101536054276749637E+06, 0.101612689419430462E+06, 0.101679641914763270E+06, - 0.101735174644287632E+06, 0.101778750617147758E+06, 0.101810665166487233E+06, 0.101830410029895895E+06, 0.101837810772118624E+06, - 0.101833022665443903E+06, 0.101816510393020842E+06, 0.101787854012666052E+06, 0.101744823421577603E+06, 0.101683938556403096E+06, - 0.101613036597664483E+06, 0.101532884942156001E+06, 0.101444504410039342E+06, 0.101349069651044396E+06, 0.101247781610335631E+06, - 0.101141708506075884E+06, 0.101021202144232695E+06, 0.100894721062327983E+06, 0.100769982600624178E+06, 0.100655427823023274E+06, - 0.100550770964121868E+06, 0.100461477319971644E+06, 0.100396193533225101E+06, 0.100370475160386210E+06, 0.100369362731624045E+06, - 0.100393088104568509E+06, 0.100440996230512974E+06, 0.100511511049115361E+06, 0.100603846780177613E+06, 0.100726574426591877E+06, - 0.100871208402494914E+06, 0.101018016887883554E+06, 0.101160944293748136E+06, 0.101294154343677379E+06, 0.101398406532467285E+06, - 0.101478074072107382E+06, 0.101546049324473512E+06, 0.101603974418745871E+06, 0.101653727077973454E+06, 0.101697954544609078E+06, - 0.101741376690074656E+06, 0.101789988330066262E+06, 0.101838680208411213E+06, 0.101887795803836605E+06, 0.101942598855672841E+06, - 0.102000837418646348E+06, 0.102056277940396962E+06, 0.102106768405713607E+06, 0.102150535774670396E+06, 0.102182996899048041E+06, - 0.102206750157000613E+06, 0.102221201245532342E+06, 0.102228757950974235E+06, 0.102230269318708335E+06, 0.102229908214737996E+06, - 0.102230221444085299E+06, 0.102233117647704858E+06, 0.102243955867660014E+06, 0.102261169827573845E+06, 0.102280623025385154E+06, - 0.102298710646779829E+06, 0.102311720481040116E+06, 0.102316483254606297E+06, 0.102310329085876278E+06, 0.102292054686377145E+06, - 0.102261582445110776E+06, 0.102217278999264774E+06, 0.102159938958497296E+06, 0.102090651836751262E+06, 0.102014420809727890E+06, - 0.101933158619991009E+06, 0.101851325383247095E+06, 0.101773700996606422E+06, 0.101704655579852813E+06, 0.101645470306280142E+06, - 0.101599387487163476E+06, 0.101568762309086727E+06, 0.101551200721109650E+06, 0.101544950055199806E+06, 0.101545234940555893E+06, - 0.101536151271568684E+06, 0.101520957074193793E+06, 0.101499514166347813E+06, 0.101472481430049040E+06, 0.101447481037651174E+06, - 0.101431698928562022E+06, 0.101432519665399988E+06, 0.101455989679772596E+06, 0.101503867701139068E+06, 0.101569707321795955E+06, - 0.101641541183263049E+06, 0.101707359784777087E+06, 0.101760909663319078E+06, 0.101802944092112913E+06, 0.101837429073186562E+06, - 0.101868490058515003E+06, 0.101895999089963501E+06, 0.101921719560774494E+06, 0.101935208629263929E+06, 0.101934734847469299E+06, - 0.101921789770189804E+06, 0.101905337918664198E+06, 0.101889233907825823E+06, 0.101876223533093609E+06, 0.101864529046626514E+06, - 0.101850666495852842E+06, 0.101835575764428810E+06, 0.101815211112956240E+06, 0.101783740571016519E+06, 0.101739678309719806E+06, - 0.101689041718466135E+06, 0.101634899667157661E+06, 0.101583884425190394E+06, 0.101535509776931387E+06, 0.101491128441498251E+06, - 0.101453011421685966E+06, 0.101428708334432333E+06, 0.101415133080661239E+06, 0.101411902195392497E+06, 0.101415741142001993E+06, - 0.101421700628259656E+06, 0.101434916879656914E+06, 0.101454096376128975E+06, 0.101478884585159176E+06, 0.101507961817356219E+06, - 0.101534772926637874E+06, 0.101557090728886120E+06, 0.101574113620330667E+06, 0.101587280909418565E+06, 0.101593317203057959E+06, - 0.101589233196906163E+06, 0.101574814776511601E+06, 0.101547332581751762E+06, 0.101514869284270651E+06, 0.101481998192358122E+06, - 0.101452150550811974E+06, 0.101427572510067519E+06, 0.101409813743047896E+06, 0.101403676308175665E+06, 0.101410943983370715E+06, - 0.101433007929108295E+06, 0.101473704830047689E+06, 0.101528968358056605E+06, 0.101588585098966272E+06, 0.101648865730780017E+06, - 0.101706538485246449E+06, 0.101754905727487509E+06, 0.101785976200502380E+06, 0.101811017148794053E+06, 0.101832089114193281E+06, - 0.101851827047180632E+06, 0.101871848271984418E+06, 0.101914442748880043E+06, 0.100645050821058583E+06, 0.100697921098829320E+06, - 0.100761591261288675E+06, 0.100844244243942405E+06, 0.100934005537327830E+06, 0.101028963380699686E+06, 0.101127123691640561E+06, - 0.101226361187462535E+06, 0.101324505036089657E+06, 0.101419431488063798E+06, 0.101509163971173737E+06, 0.101590063785101636E+06, - 0.101657671467199980E+06, 0.101713396702810118E+06, 0.101758515364488485E+06, 0.101792091325616479E+06, 0.101813481673006056E+06, - 0.101822350253392695E+06, 0.101818668615804971E+06, 0.101802702749391727E+06, 0.101774619027333058E+06, 0.101728109831474241E+06, - 0.101668908134665704E+06, 0.101597584119515159E+06, 0.101516856663981162E+06, 0.101427599824837293E+06, 0.101330896414631075E+06, - 0.101227935201261804E+06, 0.101113372919066416E+06, 0.100989129696766337E+06, 0.100861373889168084E+06, 0.100733678225485171E+06, - 0.100610105917794019E+06, 0.100495004451233079E+06, 0.100402578780181022E+06, 0.100353109983544055E+06, 0.100326440206043859E+06, - 0.100322735531117156E+06, 0.100342802276422299E+06, 0.100386646482634504E+06, 0.100453451962470805E+06, 0.100549574897853177E+06, - 0.100666205550992949E+06, 0.100795807241975184E+06, 0.100931381874395069E+06, 0.101067411193584325E+06, 0.101192762302618430E+06, - 0.101283622761741586E+06, 0.101362350787791220E+06, 0.101430423297678528E+06, 0.101489314399921583E+06, 0.101540641111512159E+06, - 0.101585585061290316E+06, 0.101627410996723280E+06, 0.101667724011934901E+06, 0.101707970653555123E+06, 0.101751269935565215E+06, - 0.101811021944586406E+06, 0.101870809774501089E+06, 0.101928469764575537E+06, 0.101981732364511379E+06, 0.102026310772180412E+06, - 0.102061898497918446E+06, 0.102089845634957077E+06, 0.102110105242362508E+06, 0.102121882127719451E+06, 0.102124061355970684E+06, - 0.102123733324673376E+06, 0.102124546125847337E+06, 0.102129219082775890E+06, 0.102145351303200790E+06, 0.102166260171440692E+06, - 0.102190433845960331E+06, 0.102216291023032318E+06, 0.102242152119835548E+06, 0.102260901292175229E+06, 0.102271019053290802E+06, - 0.102270194336435845E+06, 0.102258376332468251E+06, 0.102232740434276260E+06, 0.102193082447496578E+06, 0.102140339518538545E+06, - 0.102077291761659100E+06, 0.102007943796066291E+06, 0.101934901694509579E+06, 0.101863769251748963E+06, 0.101795867039438526E+06, - 0.101734634917306947E+06, 0.101683465453549536E+06, 0.101643719755611994E+06, 0.101613589850316028E+06, 0.101591266195843433E+06, - 0.101568063676064237E+06, 0.101544190597726789E+06, 0.101518173523634308E+06, 0.101489293133355706E+06, 0.101456969224960791E+06, - 0.101429471204937334E+06, 0.101413477375518429E+06, 0.101417790921687454E+06, 0.101450822395921219E+06, 0.101510233193849519E+06, - 0.101585841462266966E+06, 0.101664438788265412E+06, 0.101733920550829818E+06, 0.101788706066789920E+06, 0.101825829329588349E+06, - 0.101850405636027645E+06, 0.101871083937706790E+06, 0.101887382097668247E+06, 0.101896455049501354E+06, 0.101897289413654769E+06, - 0.101886248870001597E+06, 0.101867415759247539E+06, 0.101847995171556977E+06, 0.101838485076295401E+06, 0.101834100858943464E+06, - 0.101832686427819717E+06, 0.101828063075528247E+06, 0.101816399093795466E+06, 0.101796719243765314E+06, 0.101767216502717842E+06, - 0.101721966250064579E+06, 0.101668953652310433E+06, 0.101611959093829370E+06, 0.101556227036786251E+06, 0.101506414279391960E+06, - 0.101461971390057777E+06, 0.101425468706421860E+06, 0.101404163733341426E+06, 0.101399096476539751E+06, 0.101405522879150667E+06, - 0.101421050121819761E+06, 0.101438689378578158E+06, 0.101460180927881505E+06, 0.101485796004159551E+06, 0.101513713918150577E+06, - 0.101542550860272706E+06, 0.101568068025141562E+06, 0.101588331740948968E+06, 0.101600913455480535E+06, 0.101607630152187616E+06, - 0.101607407012941694E+06, 0.101598607139348926E+06, 0.101581645287700347E+06, 0.101557205094100689E+06, 0.101527626140599372E+06, - 0.101498954813168501E+06, 0.101474478229909684E+06, 0.101456851592814171E+06, 0.101447916547657107E+06, 0.101451532249133510E+06, - 0.101469023039587555E+06, 0.101500095660945575E+06, 0.101543265481331633E+06, 0.101599989966535504E+06, 0.101661394639400824E+06, - 0.101722843298708525E+06, 0.101781217785530855E+06, 0.101833962893083750E+06, 0.101869504665579036E+06, 0.101891006131465809E+06, - 0.101907724224272592E+06, 0.101922174311177543E+06, 0.101935867942354409E+06, 0.101950426065447158E+06, 0.100607098755765037E+06, - 0.100655240281701743E+06, 0.100726600376942501E+06, 0.100809356254825645E+06, 0.100899004634437370E+06, 0.100993829979357848E+06, - 0.101091906852125423E+06, 0.101191172811513417E+06, 0.101289507328918466E+06, 0.101384817108912728E+06, 0.101475128234200398E+06, - 0.101556622026723067E+06, 0.101627508170991190E+06, 0.101685968687809233E+06, 0.101732567539073978E+06, 0.101767665006896481E+06, - 0.101790488350008833E+06, 0.101800548295886649E+06, 0.101797644943693944E+06, 0.101781861361740375E+06, 0.101747873759633774E+06, - 0.101701859594637368E+06, 0.101644745116156497E+06, 0.101577648617696381E+06, 0.101501095515959882E+06, 0.101413668608079461E+06, - 0.101318547892610906E+06, 0.101214143017131020E+06, 0.101099338905386365E+06, 0.100978397278849705E+06, 0.100854041321450713E+06, - 0.100729710648106629E+06, 0.100609462614676057E+06, 0.100497826949930561E+06, 0.100414459388165211E+06, 0.100356511886266162E+06, - 0.100322777395156372E+06, 0.100316042351856522E+06, 0.100332097081535409E+06, 0.100371561029088683E+06, 0.100439298341075264E+06, - 0.100532568922400489E+06, 0.100643002914990837E+06, 0.100765387761929349E+06, 0.100893492581718543E+06, 0.101020399500629603E+06, - 0.101112706098134367E+06, 0.101194570041727216E+06, 0.101269273413618284E+06, 0.101335562528605122E+06, 0.101394060212437602E+06, - 0.101445483977905038E+06, 0.101491335215433006E+06, 0.101533800970901357E+06, 0.101574594133775521E+06, 0.101615314066683874E+06, - 0.101662259781339875E+06, 0.101713149881755875E+06, 0.101764653351764238E+06, 0.101815034877485959E+06, 0.101864609985221337E+06, - 0.101906670614871124E+06, 0.101942016196974146E+06, 0.101970135166829859E+06, 0.101990609169172516E+06, 0.101996950610404732E+06, - 0.101996810049367472E+06, 0.101996317886868128E+06, 0.101998445642552077E+06, 0.102008824591142213E+06, 0.102027635971959302E+06, - 0.102051641514833580E+06, 0.102080850665324571E+06, 0.102117904503131693E+06, 0.102157634194590821E+06, 0.102192504721610734E+06, - 0.102219235460459910E+06, 0.102236777347130861E+06, 0.102242902162718834E+06, 0.102236355155139478E+06, 0.102216651883876315E+06, - 0.102180426444035780E+06, 0.102133083528179093E+06, 0.102077034681391349E+06, 0.102016323324797893E+06, 0.101953628282518228E+06, - 0.101890856388452012E+06, 0.101830915333128054E+06, 0.101779447310396441E+06, 0.101734080624489550E+06, 0.101693870504157734E+06, - 0.101656684022070389E+06, 0.101619340499046710E+06, 0.101584139894536143E+06, 0.101548750508560886E+06, 0.101508927593507731E+06, - 0.101469477866382847E+06, 0.101436805815304979E+06, 0.101415993387059803E+06, 0.101423466131997789E+06, 0.101453632286171531E+06, - 0.101508029375078389E+06, 0.101580823336132147E+06, 0.101656593588021438E+06, 0.101722011470405239E+06, 0.101771508397742451E+06, - 0.101807913013677957E+06, 0.101834964343916130E+06, 0.101850402618856344E+06, 0.101859186985402383E+06, 0.101860587418252151E+06, - 0.101854518941434624E+06, 0.101838720084331697E+06, 0.101819824582356232E+06, 0.101803402458019846E+06, 0.101796893209118367E+06, - 0.101799592648883248E+06, 0.101802452116411427E+06, 0.101801265547130839E+06, 0.101788566176828695E+06, 0.101765879286445153E+06, - 0.101732953696931960E+06, 0.101687950182710265E+06, 0.101633167492824286E+06, 0.101575598313827417E+06, 0.101518917024984054E+06, - 0.101468456845219422E+06, 0.101425013728590406E+06, 0.101390361593186084E+06, 0.101368216911030337E+06, 0.101370279495935785E+06, - 0.101384930299833504E+06, 0.101409208395769369E+06, 0.101438468993645060E+06, 0.101467787546390668E+06, 0.101499453696433935E+06, - 0.101530518538351142E+06, 0.101558938309742618E+06, 0.101581645149348537E+06, 0.101598207551499479E+06, 0.101607649285544889E+06, - 0.101609802844516307E+06, 0.101605573988511765E+06, 0.101593037714059843E+06, 0.101573514674016667E+06, 0.101549196000671189E+06, - 0.101522849664976588E+06, 0.101498330261054754E+06, 0.101479889987571310E+06, 0.101470097853539497E+06, 0.101471225349216998E+06, - 0.101486588535369752E+06, 0.101515334980482352E+06, 0.101556357596876667E+06, 0.101607560846124834E+06, 0.101666443968593783E+06, - 0.101729419441298363E+06, 0.101791387702929569E+06, 0.101848011454613385E+06, 0.101897514583017852E+06, 0.101939642427183790E+06, - 0.101960271009820077E+06, 0.101975158780464568E+06, 0.101986424653725320E+06, 0.101995822513432664E+06, 0.102004992120982162E+06, - 0.100578411052675729E+06, 0.100635318784110554E+06, 0.100702588041198120E+06, 0.100778983082032035E+06, 0.100867372014784603E+06, - 0.100961003291497836E+06, 0.101057944061462069E+06, 0.101156164506401896E+06, 0.101253562485936651E+06, 0.101348041518852056E+06, - 0.101435305736620867E+06, 0.101514565773677881E+06, 0.101585969098869886E+06, 0.101648080408071197E+06, 0.101699676885091831E+06, - 0.101737081890784044E+06, 0.101761287426791518E+06, 0.101772434840921720E+06, 0.101770158786062922E+06, 0.101748537453835859E+06, - 0.101714770053279746E+06, 0.101669742860261249E+06, 0.101614251954373656E+06, 0.101549290791504973E+06, 0.101476027861641691E+06, - 0.101395781087328636E+06, 0.101309332351133024E+06, 0.101208930191804626E+06, 0.101100827344175617E+06, 0.100987036454510526E+06, - 0.100870048278151575E+06, 0.100753131768219901E+06, 0.100640279785382925E+06, 0.100543839073244162E+06, 0.100470119984832578E+06, - 0.100412920571785522E+06, 0.100374418672954038E+06, 0.100356321711452154E+06, 0.100359754832890321E+06, 0.100393037545625295E+06, - 0.100461456665693026E+06, 0.100548040695085903E+06, 0.100649774320544951E+06, 0.100762231735881898E+06, 0.100879810004682629E+06, - 0.100978944107382951E+06, 0.101056139035317683E+06, 0.101129122973660080E+06, 0.101197131809436498E+06, 0.101259400864402109E+06, - 0.101315369721067444E+06, 0.101366567376128267E+06, 0.101413068730518760E+06, 0.101456050767495792E+06, 0.101497394979706776E+06, - 0.101540388547235518E+06, 0.101589723482442452E+06, 0.101639287384227951E+06, 0.101688119127630343E+06, 0.101734881227949692E+06, - 0.101774055633342999E+06, 0.101806176343790416E+06, 0.101833758016756707E+06, 0.101855867301477920E+06, 0.101869669516056863E+06, - 0.101867423844660036E+06, 0.101862185064065459E+06, 0.101857648911106618E+06, 0.101857166947219768E+06, 0.101869453362050233E+06, - 0.101889395994667357E+06, 0.101917145273055416E+06, 0.101952665990595080E+06, 0.102005113066678605E+06, 0.102059201352783610E+06, - 0.102110590092891594E+06, 0.102155134120450733E+06, 0.102189008661845161E+06, 0.102212893719536674E+06, 0.102224794573552019E+06, - 0.102221917283866860E+06, 0.102203717818992911E+06, 0.102173729797711843E+06, 0.102134066117315539E+06, 0.102088155198460590E+06, - 0.102037322504280150E+06, 0.101983804157969324E+06, 0.101930882216981918E+06, 0.101882568835916391E+06, 0.101835848097687121E+06, - 0.101791045975844638E+06, 0.101745969221785286E+06, 0.101701401299452598E+06, 0.101658034247290489E+06, 0.101613792586539625E+06, - 0.101566658381616784E+06, 0.101523107840297394E+06, 0.101485865057037794E+06, 0.101467196461575470E+06, 0.101465231282475186E+06, - 0.101481792269703801E+06, 0.101521171184929379E+06, 0.101584362409188645E+06, 0.101654606382538637E+06, 0.101708085889500013E+06, - 0.101750884319908815E+06, 0.101781151271932016E+06, 0.101802265119226417E+06, 0.101814660749166302E+06, 0.101818059160636913E+06, - 0.101815376584443497E+06, 0.101808025978518664E+06, 0.101796093709958877E+06, 0.101783205967926551E+06, 0.101773519465245452E+06, - 0.101768347262196490E+06, 0.101772318875173907E+06, 0.101774032894583841E+06, 0.101769304008539359E+06, 0.101752736287782580E+06, - 0.101724576811767562E+06, 0.101687606667018787E+06, 0.101642832213384885E+06, 0.101588413046507747E+06, 0.101532052789407389E+06, - 0.101477089478998780E+06, 0.101426937636667906E+06, 0.101383983337104524E+06, 0.101350070067916895E+06, 0.101327894217902314E+06, - 0.101330294767154453E+06, 0.101349863124191863E+06, 0.101379498558547202E+06, 0.101415335536042723E+06, 0.101450570253408456E+06, - 0.101486617503024216E+06, 0.101521790468661828E+06, 0.101553679702050722E+06, 0.101576951634593526E+06, 0.101592599322586801E+06, - 0.101600882539355007E+06, 0.101601982296252419E+06, 0.101593711037322297E+06, 0.101576295595724252E+06, 0.101552760225610255E+06, - 0.101525860012702775E+06, 0.101500304746004782E+06, 0.101482529221745732E+06, 0.101472615361795470E+06, 0.101472486373178777E+06, - 0.101483501295817390E+06, 0.101509279618775763E+06, 0.101549321581216165E+06, 0.101600205319342873E+06, 0.101659295372980385E+06, - 0.101721590076149907E+06, 0.101783337171577281E+06, 0.101842427132610639E+06, 0.101897333754838794E+06, 0.101946395082493676E+06, - 0.101988236942542819E+06, 0.102017526821220177E+06, 0.102031828714653369E+06, 0.102041305631011754E+06, 0.102047936605813040E+06, - 0.102053545022376406E+06, 0.100561618890645521E+06, 0.100618675407796312E+06, 0.100685232428278308E+06, 0.100760148812781379E+06, - 0.100842043992347171E+06, 0.100930626779751663E+06, 0.101025380770443604E+06, 0.101121496737499227E+06, 0.101216863489791329E+06, - 0.101306591907260168E+06, 0.101390820508431876E+06, 0.101469198549494278E+06, 0.101540194252744899E+06, 0.101602382440106187E+06, - 0.101654511301229999E+06, 0.101695567045773627E+06, 0.101724835997739530E+06, 0.101738206502799672E+06, 0.101728469792924647E+06, - 0.101706705766990082E+06, 0.101673943944349550E+06, 0.101630654689779229E+06, 0.101577521269946941E+06, 0.101515423259462186E+06, - 0.101445417400194085E+06, 0.101369301689578249E+06, 0.101289207179891833E+06, 0.101202291357723705E+06, 0.101109840862024794E+06, - 0.101010060536526478E+06, 0.100903624985256116E+06, 0.100797206247763170E+06, 0.100697721229483854E+06, 0.100617879166639119E+06, - 0.100549334862444375E+06, 0.100494554672908853E+06, 0.100455829928310864E+06, 0.100435159192249281E+06, 0.100434140902790139E+06, - 0.100463827743078145E+06, 0.100516682399563157E+06, 0.100588924784875649E+06, 0.100677081454071609E+06, 0.100775641942890885E+06, - 0.100875619518922729E+06, 0.100945870321605689E+06, 0.101013133541299816E+06, 0.101077503451870405E+06, 0.101138697419382283E+06, - 0.101196245970018281E+06, 0.101247478059058092E+06, 0.101295381961911495E+06, 0.101341293286219021E+06, 0.101385520658941925E+06, - 0.101428507369388099E+06, 0.101477628384924552E+06, 0.101527439265766385E+06, 0.101575625370267109E+06, 0.101621502298168052E+06, - 0.101663832962092813E+06, 0.101694866512688139E+06, 0.101720503961646493E+06, 0.101740691340596662E+06, 0.101755087321406769E+06, - 0.101753809082437700E+06, 0.101741526291839808E+06, 0.101728608499199152E+06, 0.101718502985755840E+06, 0.101716703972249219E+06, - 0.101727329002141589E+06, 0.101746865685733879E+06, 0.101776394054624689E+06, 0.101821041668101156E+06, 0.101883903619016666E+06, - 0.101950707313021689E+06, 0.102016579439056790E+06, 0.102074857884153607E+06, 0.102122966684235507E+06, 0.102162229375958646E+06, - 0.102191070936530305E+06, 0.102205291241337400E+06, 0.102205781057829736E+06, 0.102194562190391560E+06, 0.102173148282368042E+06, - 0.102144343637741913E+06, 0.102108830373893230E+06, 0.102068178268037620E+06, 0.102026306869767315E+06, 0.101984352807968040E+06, - 0.101941207962857719E+06, 0.101897306791024865E+06, 0.101851675563811092E+06, 0.101805566459294409E+06, 0.101759497966033654E+06, - 0.101711369603787127E+06, 0.101663340792011426E+06, 0.101619227450208040E+06, 0.101582695699032221E+06, 0.101558695579259147E+06, - 0.101546029798913645E+06, 0.101545588074274448E+06, 0.101567771713567665E+06, 0.101607748589558381E+06, 0.101688531278736336E+06, - 0.101712604992569381E+06, 0.101743096832469848E+06, 0.101760620836449103E+06, 0.101769961191482769E+06, 0.101772822414354494E+06, - 0.101770897529126829E+06, 0.101765958574697099E+06, 0.101759443212774597E+06, 0.101753267088761611E+06, 0.101750523367411457E+06, - 0.101749706624054088E+06, 0.101749678109808025E+06, 0.101749285406108000E+06, 0.101744523322546709E+06, 0.101733022628531995E+06, - 0.101711787295703034E+06, 0.101679008351294804E+06, 0.101639130834085285E+06, 0.101593625025334943E+06, 0.101541393928166348E+06, - 0.101487105460277933E+06, 0.101434417444056598E+06, 0.101385551046964029E+06, 0.101342006161188154E+06, 0.101307140291916905E+06, - 0.101283659047930778E+06, 0.101280818499683781E+06, 0.101302531797972479E+06, 0.101335121595155433E+06, 0.101374651651055479E+06, - 0.101415853089015101E+06, 0.101456337388213346E+06, 0.101495434796083166E+06, 0.101530692665964845E+06, 0.101556780887815577E+06, - 0.101572252524485899E+06, 0.101580348283763422E+06, 0.101581288046389862E+06, 0.101573497525049606E+06, 0.101553231842264839E+06, - 0.101527699101148173E+06, 0.101500366015751919E+06, 0.101475147159402040E+06, 0.101462872833845016E+06, 0.101461553787802579E+06, - 0.101470899121458526E+06, 0.101491574771335596E+06, 0.101526109462851629E+06, 0.101575993595638676E+06, 0.101633539000189689E+06, - 0.101696017474012726E+06, 0.101760468358366721E+06, 0.101823741442191822E+06, 0.101882328042741588E+06, 0.101936367528451112E+06, - 0.101984427337493747E+06, 0.102025414498975340E+06, 0.102058638462272647E+06, 0.102075739484648249E+06, 0.102084208298001584E+06, - 0.102090352048999324E+06, 0.102097473483009948E+06, 0.100548208007167515E+06, 0.100605095427047316E+06, 0.100670706010579946E+06, - 0.100743978438203791E+06, 0.100823629545142438E+06, 0.100908178696427160E+06, 0.100995982580288008E+06, 0.101087314481146692E+06, - 0.101176414116338347E+06, 0.101262458356531424E+06, 0.101344547676157905E+06, 0.101421163164599711E+06, 0.101490796631980134E+06, - 0.101552014265238700E+06, 0.101603518886931997E+06, 0.101644210460807284E+06, 0.101673244462872826E+06, 0.101680735386759538E+06, - 0.101674706326058280E+06, 0.101655388783202914E+06, 0.101624670690422980E+06, 0.101584138623298597E+06, 0.101534372942937815E+06, - 0.101476149074961329E+06, 0.101410568098193849E+06, 0.101343974609530458E+06, 0.101270896963409337E+06, 0.101192137510717424E+06, - 0.101108880683603289E+06, 0.101022724309234283E+06, 0.100935715390839119E+06, 0.100850390680374665E+06, 0.100774745624155403E+06, - 0.100703597598235123E+06, 0.100641200968575649E+06, 0.100589854186508950E+06, 0.100551830710988637E+06, 0.100529267606730675E+06, - 0.100528295556730111E+06, 0.100549682448172025E+06, 0.100589658714417616E+06, 0.100646339245096955E+06, 0.100716647083594595E+06, - 0.100796330849082777E+06, 0.100862509969368170E+06, 0.100921980592583743E+06, 0.100978572070364797E+06, 0.101033342690100937E+06, - 0.101086524659137300E+06, 0.101137201268390738E+06, 0.101183872284207260E+06, 0.101229010938212319E+06, 0.101273109489612165E+06, - 0.101316619892713090E+06, 0.101361395459038307E+06, 0.101412097251747749E+06, 0.101462443230712757E+06, 0.101510984330326377E+06, - 0.101556016862365155E+06, 0.101593723038725308E+06, 0.101622224707454676E+06, 0.101642725690420295E+06, 0.101656123946685548E+06, - 0.101662476115757090E+06, 0.101646779923387396E+06, 0.101626132803217159E+06, 0.101605491482854268E+06, 0.101589147781629013E+06, - 0.101585251139149026E+06, 0.101593208937773641E+06, 0.101612184718608827E+06, 0.101643206312575028E+06, 0.101695818816071987E+06, - 0.101764928221785813E+06, 0.101840193899589591E+06, 0.101916494038259974E+06, 0.101982907500618603E+06, 0.102040970845980133E+06, - 0.102091837845918839E+06, 0.102134078254784647E+06, 0.102164394058369740E+06, 0.102183887971255608E+06, 0.102192909965391460E+06, - 0.102191628213096585E+06, 0.102180725302393228E+06, 0.102161729213580154E+06, 0.102136138522838941E+06, 0.102107142982990175E+06, - 0.102074807010027405E+06, 0.102039103318180598E+06, 0.102000767273371166E+06, 0.101960362993373739E+06, 0.101918302600709168E+06, - 0.101875356744285367E+06, 0.101830760544282428E+06, 0.101787058843222650E+06, 0.101746854946198102E+06, 0.101712081627763269E+06, - 0.101684170852595838E+06, 0.101663959106856215E+06, 0.101652494286064044E+06, 0.101669560085676902E+06, 0.101704444840698343E+06, - 0.101700571875176043E+06, 0.101721535240709272E+06, 0.101745779185469408E+06, 0.101743873285487498E+06, 0.101738112527286779E+06, - 0.101730354652939321E+06, 0.101722249363334777E+06, 0.101714810079808434E+06, 0.101708639567806546E+06, 0.101706113756708350E+06, - 0.101714036658689380E+06, 0.101722369687996295E+06, 0.101728359378835914E+06, 0.101725407412529981E+06, 0.101714092896974922E+06, - 0.101695958827062772E+06, 0.101670373525743838E+06, 0.101635678816692453E+06, 0.101595418488830386E+06, 0.101550830010831283E+06, - 0.101501001127021242E+06, 0.101448446456819016E+06, 0.101396954698346424E+06, 0.101348845039631386E+06, 0.101304062386825870E+06, - 0.101267451987425215E+06, 0.101242193004994537E+06, 0.101233636404356381E+06, 0.101254846780972948E+06, 0.101287816325990920E+06, - 0.101328479900242310E+06, 0.101372263340125617E+06, 0.101414617472293321E+06, 0.101455579958959497E+06, 0.101492853465017077E+06, - 0.101523278594798670E+06, 0.101540885808085994E+06, 0.101551450070809791E+06, 0.101555278183125236E+06, 0.101552538038431827E+06, - 0.101533468414678850E+06, 0.101508500675057512E+06, 0.101482796927905787E+06, 0.101462379842144772E+06, 0.101454892688142470E+06, - 0.101464325466535738E+06, 0.101484135316789325E+06, 0.101513829601535981E+06, 0.101552601163330517E+06, 0.101603687744035284E+06, - 0.101663791684624332E+06, 0.101727767774695865E+06, 0.101792762408730807E+06, 0.101856171640086162E+06, 0.101914393070144404E+06, - 0.101966522189743861E+06, 0.102012469486766611E+06, 0.102051444457628037E+06, 0.102084940153698932E+06, 0.102109046172999864E+06, - 0.102120432478447823E+06, 0.102128404810622902E+06, 0.102134103220031029E+06, 0.100537775584916468E+06, 0.100594064464056602E+06, - 0.100658361556240663E+06, 0.100729672253821584E+06, 0.100806792979668055E+06, 0.100888331818478662E+06, 0.100972640703881028E+06, - 0.101054356923499276E+06, 0.101136218305642746E+06, 0.101218059282136164E+06, 0.101297128938538604E+06, 0.101371075949467442E+06, - 0.101438396724319813E+06, 0.101497631946100053E+06, 0.101547424352719638E+06, 0.101586575081165560E+06, 0.101605344305898223E+06, - 0.101611802560867160E+06, 0.101607062825132700E+06, 0.101591492022024759E+06, 0.101565740711957988E+06, 0.101530433274754861E+06, - 0.101485334233030881E+06, 0.101432291750987933E+06, 0.101377329376169117E+06, 0.101317207789115375E+06, 0.101251671625233779E+06, - 0.101181417558871472E+06, 0.101107498655681804E+06, 0.101031350521440603E+06, 0.100954821051961742E+06, 0.100889588668171375E+06, - 0.100831564213864112E+06, 0.100778330447916189E+06, 0.100731315465427993E+06, 0.100686629349019524E+06, 0.100649847468544394E+06, - 0.100626941602005361E+06, 0.100623247975728824E+06, 0.100634858419738637E+06, 0.100661484011766472E+06, 0.100701891329741135E+06, - 0.100753800334865009E+06, 0.100807541818709986E+06, 0.100848659308669099E+06, 0.100892548219874385E+06, 0.100938268977634565E+06, - 0.100984815257879964E+06, 0.101031244555508310E+06, 0.101077229148432787E+06, 0.101120811543651638E+06, 0.101163080762204729E+06, - 0.101205133328227632E+06, 0.101247555470727515E+06, 0.101295212705033598E+06, 0.101345677435592734E+06, 0.101395414916676789E+06, - 0.101443142113523310E+06, 0.101487391928729412E+06, 0.101523112860496927E+06, 0.101551091220213115E+06, 0.101571202362138647E+06, - 0.101582765233024111E+06, 0.101580576420733298E+06, 0.101559006090641735E+06, 0.101532638260340871E+06, 0.101505636854472148E+06, - 0.101482925905383032E+06, 0.101478221569192814E+06, 0.101483749961331385E+06, 0.101500913638159356E+06, 0.101531272427147036E+06, - 0.101587537367870260E+06, 0.101657752923680528E+06, 0.101735341257440305E+06, 0.101815392189158199E+06, 0.101883415778570139E+06, - 0.101946670918334348E+06, 0.102005217869353437E+06, 0.102057696492837160E+06, 0.102103056512906318E+06, 0.102140317424393026E+06, - 0.102168554530401248E+06, 0.102186118819968382E+06, 0.102192209463688341E+06, 0.102189750578587409E+06, 0.102179864477714669E+06, - 0.102164622014063440E+06, 0.102144222519251431E+06, 0.102119031801210527E+06, 0.102090001778615697E+06, 0.102058500322085427E+06, - 0.102024456224525828E+06, 0.101988984142914618E+06, 0.101952414757101811E+06, 0.101915891308398845E+06, 0.101881589770049075E+06, - 0.101851270386932039E+06, 0.101822396029631869E+06, 0.101797879312661476E+06, 0.101778855518825338E+06, 0.101766764384149530E+06, - 0.101767117846749301E+06, 0.101765125533417420E+06, 0.101764893632733350E+06, 0.101755791518637372E+06, 0.101738415072208983E+06, - 0.101717693412627370E+06, 0.101697849566573597E+06, 0.101679653680022544E+06, 0.101666036116405725E+06, 0.101657802915804903E+06, - 0.101659358381537619E+06, 0.101675042132274451E+06, 0.101690591932105221E+06, 0.101702102691112683E+06, 0.101698890266004499E+06, - 0.101685170063431069E+06, 0.101664399827034271E+06, 0.101636981850683907E+06, 0.101602430202209493E+06, 0.101562887328751778E+06, - 0.101519409569218289E+06, 0.101470958313536248E+06, 0.101419317694792786E+06, 0.101368660117972962E+06, 0.101321145110236859E+06, - 0.101276071087296979E+06, 0.101238240695380387E+06, 0.101211277007847661E+06, 0.101197902530338179E+06, 0.101215581555680212E+06, - 0.101246094621904544E+06, 0.101284825497456564E+06, 0.101328072813235674E+06, 0.101370225701783012E+06, 0.101411514155655474E+06, - 0.101449747457354388E+06, 0.101482930506732373E+06, 0.101505336383574511E+06, 0.101520932260299305E+06, 0.101530875621757339E+06, - 0.101535660531138637E+06, 0.101527586118792417E+06, 0.101509422337400800E+06, 0.101491464951296075E+06, 0.101477501245060659E+06, - 0.101471117495995146E+06, 0.101486007619632292E+06, 0.101510757134502812E+06, 0.101544449952577212E+06, 0.101586055913800505E+06, - 0.101635695535260849E+06, 0.101695729268481853E+06, 0.101758721424995805E+06, 0.101822050355179599E+06, 0.101883639102236455E+06, - 0.101943513401448537E+06, 0.101994845858460889E+06, 0.102039591261445501E+06, 0.102076829661285185E+06, 0.102105964877399136E+06, - 0.102126794141653125E+06, 0.102139212624906431E+06, 0.102146437567661822E+06, 0.102150500772487969E+06, 0.100529766660700814E+06, - 0.100584936771645967E+06, 0.100647449978120101E+06, 0.100716367627817162E+06, 0.100790551176116554E+06, 0.100867761991881081E+06, - 0.100944392016551021E+06, 0.101022283363768598E+06, 0.101100094859150340E+06, 0.101176390860314190E+06, 0.101249683961219664E+06, - 0.101319429056106397E+06, 0.101383533080313195E+06, 0.101439851116198683E+06, 0.101486953091034593E+06, 0.101514035380600777E+06, - 0.101530274350960754E+06, 0.101536503930903316E+06, 0.101532791192708028E+06, 0.101519414459226711E+06, 0.101496896545514726E+06, - 0.101466032997577611E+06, 0.101427914819550628E+06, 0.101386928031759133E+06, 0.101339510051842895E+06, 0.101286534144961479E+06, - 0.101229073267725224E+06, 0.101167697805292846E+06, 0.101103306882333491E+06, 0.101037149535454111E+06, 0.100976699320003900E+06, - 0.100924651148493227E+06, 0.100875357695395811E+06, 0.100829790933326149E+06, 0.100789063316662927E+06, 0.100754382631035871E+06, - 0.100727001544673127E+06, 0.100712812235705482E+06, 0.100707393276471601E+06, 0.100709250582931563E+06, 0.100722573388958059E+06, - 0.100746645734061545E+06, 0.100779895700786001E+06, 0.100804396943602027E+06, 0.100830073367685545E+06, 0.100859556300720957E+06, - 0.100892387870409642E+06, 0.100927975633083144E+06, 0.100965551602012056E+06, 0.101004683619487085E+06, 0.101045330597207460E+06, - 0.101087013008305672E+06, 0.101129446011777312E+06, 0.101173089623770706E+06, 0.101224746709176397E+06, 0.101276086346010212E+06, - 0.101326149198708168E+06, 0.101374129662616979E+06, 0.101418481717269460E+06, 0.101456308681409500E+06, 0.101487100471046055E+06, - 0.101509891159304345E+06, 0.101523887972284254E+06, 0.101519085107067789E+06, 0.101499035636973305E+06, 0.101474107212159681E+06, - 0.101448532598947975E+06, 0.101428087461135481E+06, 0.101420183587270294E+06, 0.101421890388346379E+06, 0.101434924963140438E+06, - 0.101461175739645623E+06, 0.101512942173575240E+06, 0.101576674737662266E+06, 0.101648311032956131E+06, 0.101723489882150840E+06, - 0.101787480132178534E+06, 0.101850028038504926E+06, 0.101910282046108841E+06, 0.101967661149882086E+06, 0.102023524732844948E+06, - 0.102074242265323439E+06, 0.102118210977073832E+06, 0.102152171123111169E+06, 0.102173114540454029E+06, 0.102185669537254769E+06, - 0.102190716001940251E+06, 0.102189608656019511E+06, 0.102183136999173483E+06, 0.102171644521202223E+06, 0.102155743904811548E+06, - 0.102135288964191917E+06, 0.102110694874428111E+06, 0.102083194402445937E+06, 0.102053140888443799E+06, 0.102023029614340878E+06, - 0.101994305634375618E+06, 0.101968130490490352E+06, 0.101944981816832049E+06, 0.101917533305451230E+06, 0.101891792228334729E+06, - 0.101867962161627947E+06, 0.101846942835226117E+06, 0.101828399128989535E+06, 0.101808349218342468E+06, 0.101783185169399527E+06, - 0.101752129728330387E+06, 0.101717730687555537E+06, 0.101682415904166002E+06, 0.101651064189548269E+06, 0.101628214835530569E+06, - 0.101615101470726600E+06, 0.101622078677434256E+06, 0.101640462768905272E+06, 0.101659951220889372E+06, 0.101675418801938606E+06, - 0.101673225878615136E+06, 0.101661928138148622E+06, 0.101642662123728296E+06, 0.101615888022248750E+06, 0.101582080924031965E+06, - 0.101543348953446970E+06, 0.101500631267208417E+06, 0.101452586432289259E+06, 0.101401256146737229E+06, 0.101350655526253569E+06, - 0.101302884790491065E+06, 0.101258041134635379E+06, 0.101219975854280870E+06, 0.101192075948155878E+06, 0.101176911767419486E+06, - 0.101189137340948175E+06, 0.101215695508690798E+06, 0.101250828629981872E+06, 0.101291224981271953E+06, 0.101331080207125036E+06, - 0.101370380504028988E+06, 0.101408081153893057E+06, 0.101442820210735677E+06, 0.101470980944890180E+06, 0.101493569638212546E+06, - 0.101512139169726375E+06, 0.101526611096755121E+06, 0.101532495997983948E+06, 0.101522627542459595E+06, 0.101512420265735462E+06, - 0.101505304745591246E+06, 0.101504334695817597E+06, 0.101519650872094615E+06, 0.101547899391185740E+06, 0.101583965970937570E+06, - 0.101627433236286277E+06, 0.101678082609776582E+06, 0.101737298190423375E+06, 0.101799968663717998E+06, 0.101862212637869627E+06, - 0.101921525254885390E+06, 0.101975615485969174E+06, 0.102022129365600340E+06, 0.102060753757629835E+06, 0.102091435012152549E+06, - 0.102114037703653419E+06, 0.102128864386004381E+06, 0.102136712377933785E+06, 0.102141341896670521E+06, 0.102142376150148193E+06, - 0.100523535976660394E+06, 0.100577052820581303E+06, 0.100637236479140498E+06, 0.100703252727134633E+06, 0.100772552025250538E+06, - 0.100843355148487011E+06, 0.100916200005643404E+06, 0.100989978980367348E+06, 0.101063458978865412E+06, 0.101135313180651341E+06, - 0.101204158192835064E+06, 0.101268596961150513E+06, 0.101327267803054579E+06, 0.101379219393509498E+06, 0.101411658551840825E+06, - 0.101435013304419204E+06, 0.101449723991433348E+06, 0.101455671589434161E+06, 0.101452876078218949E+06, 0.101441532989260799E+06, - 0.101422046210621003E+06, 0.101395056661309005E+06, 0.101365757780455795E+06, 0.101332677387078918E+06, 0.101293673363073496E+06, - 0.101249457127459696E+06, 0.101201011753970408E+06, 0.101149108558075517E+06, 0.101094587629913221E+06, 0.101040779590145175E+06, - 0.100995382496306906E+06, 0.100951579695860622E+06, 0.100909850434587090E+06, 0.100870858422985533E+06, 0.100835419863702089E+06, - 0.100804467614276640E+06, 0.100781685669042199E+06, 0.100767335396187831E+06, 0.100759289879836622E+06, 0.100757866722066232E+06, - 0.100763078005519506E+06, 0.100774506516805646E+06, 0.100786062954307781E+06, 0.100793269206959361E+06, 0.100804822422906916E+06, - 0.100820834091496698E+06, 0.100841255618750598E+06, 0.100865889078778535E+06, 0.100894749198775666E+06, 0.100927416956011424E+06, - 0.100963395796724551E+06, 0.101002315623510774E+06, 0.101043887250100248E+06, 0.101091039191901757E+06, 0.101144066547046401E+06, - 0.101197932497966991E+06, 0.101251195535936524E+06, 0.101302429885710808E+06, 0.101350642114984890E+06, 0.101394018940216731E+06, - 0.101430608604817069E+06, 0.101459057570376521E+06, 0.101478044590623220E+06, 0.101475387865733283E+06, 0.101461856537208994E+06, - 0.101443018892087159E+06, 0.101422586718123261E+06, 0.101406882059484167E+06, 0.101400350668646613E+06, 0.101401136819027641E+06, - 0.101411047287252732E+06, 0.101432998273655045E+06, 0.101475019664207721E+06, 0.101526976345226532E+06, 0.101585936905203198E+06, - 0.101648470322235924E+06, 0.101703644183282871E+06, 0.101759331828263079E+06, 0.101814866055730265E+06, 0.101869901220545507E+06, - 0.101928914084517004E+06, 0.101985712555209233E+06, 0.102038213057230983E+06, 0.102083503006818413E+06, 0.102116318481194263E+06, - 0.102142478770143352E+06, 0.102162510227578357E+06, 0.102176745632176331E+06, 0.102185382260760132E+06, 0.102189351865029588E+06, - 0.102188985060908250E+06, 0.102181978502190381E+06, 0.102166343098074416E+06, 0.102144949217122790E+06, 0.102118539343817305E+06, - 0.102090320241642432E+06, 0.102064949154931208E+06, 0.102041510471142406E+06, 0.102020894051233234E+06, 0.102002076919490239E+06, - 0.101978687982916701E+06, 0.101949947159686926E+06, 0.101920721729201105E+06, 0.101890840787188339E+06, 0.101858502442174227E+06, - 0.101821787050020226E+06, 0.101779170614060145E+06, 0.101731633607835785E+06, 0.101683872606227975E+06, 0.101641706250363815E+06, - 0.101609757163432500E+06, 0.101594408710602715E+06, 0.101599861763739507E+06, 0.101615600568650814E+06, 0.101634792862023707E+06, - 0.101649560822422354E+06, 0.101653324074520948E+06, 0.101647718645786255E+06, 0.101632892509714380E+06, 0.101607498410070068E+06, - 0.101573604987650251E+06, 0.101534332171428061E+06, 0.101490882315485491E+06, 0.101441914985506301E+06, 0.101390598505943577E+06, - 0.101340225499994325E+06, 0.101292893172337470E+06, 0.101249121490931240E+06, 0.101212206615971038E+06, 0.101184803983927792E+06, - 0.101169090523178049E+06, 0.101177216406820677E+06, 0.101199121436619549E+06, 0.101229487274117826E+06, 0.101265433425285810E+06, - 0.101301460838134211E+06, 0.101337546551032807E+06, 0.101373572179327981E+06, 0.101408481747705810E+06, 0.101441269413672373E+06, - 0.101471589979924611E+06, 0.101499094210238720E+06, 0.101523046431578827E+06, 0.101542483002773370E+06, 0.101543831013172356E+06, - 0.101544064378257113E+06, 0.101546276856648081E+06, 0.101553107004487800E+06, 0.101570758226424994E+06, 0.101603899362922981E+06, - 0.101643466171828870E+06, 0.101688020902613556E+06, 0.101736066489577410E+06, 0.101788778651382352E+06, 0.101846229772819366E+06, - 0.101902087545993330E+06, 0.101954243560902876E+06, 0.102000912067655503E+06, 0.102040460468150268E+06, 0.102070397922830496E+06, - 0.102092123176266672E+06, 0.102106027606901625E+06, 0.102112955537274407E+06, 0.102114233430400913E+06, 0.102110160726652859E+06, - 0.102103564706523437E+06, 0.100518689604693471E+06, 0.100570188968489383E+06, 0.100627085580226092E+06, 0.100688425846865008E+06, - 0.100752801664219747E+06, 0.100819711434372482E+06, 0.100888275239485200E+06, 0.100957467842034559E+06, 0.101026141537060103E+06, - 0.101093053338000958E+06, 0.101156896762082222E+06, 0.101216338486683555E+06, 0.101270050228910055E+06, 0.101303959592322863E+06, - 0.101331155104026548E+06, 0.101351367252466414E+06, 0.101364631606699608E+06, 0.101370354947362532E+06, 0.101368511938952593E+06, - 0.101359219879845390E+06, 0.101342770712901329E+06, 0.101323279228074665E+06, 0.101301442257920979E+06, 0.101274216777385765E+06, - 0.101241963101549714E+06, 0.101205245491941663E+06, 0.101164856326946916E+06, 0.101121839477416492E+06, 0.101077512757932636E+06, - 0.101040769978266762E+06, 0.101003816768457153E+06, 0.100967482943484662E+06, 0.100932599047362921E+06, 0.100899538621347674E+06, - 0.100868835073115974E+06, 0.100841822788138859E+06, 0.100822146543393857E+06, 0.100806275342578825E+06, 0.100794425676255967E+06, - 0.100786746583171247E+06, 0.100783223558698664E+06, 0.100783580356914550E+06, 0.100777240593710594E+06, 0.100772797244677698E+06, - 0.100771995893256535E+06, 0.100775628518037935E+06, 0.100784330892865575E+06, 0.100798832415402489E+06, 0.100819830174998613E+06, - 0.100845869940026445E+06, 0.100876821716840641E+06, 0.100912505059014773E+06, 0.100952732377084161E+06, 0.101002888396750073E+06, - 0.101057716858402928E+06, 0.101114463416698447E+06, 0.101171669964558023E+06, 0.101227895955215106E+06, 0.101283382095900626E+06, - 0.101334958226825765E+06, 0.101380444142405948E+06, 0.101418245220739525E+06, 0.101446407440058887E+06, 0.101450870781566424E+06, - 0.101446840525337553E+06, 0.101437171069169228E+06, 0.101424931486162226E+06, 0.101415799787063268E+06, 0.101412071436230064E+06, - 0.101412950725123417E+06, 0.101420014842418866E+06, 0.101435968083775937E+06, 0.101466352271600088E+06, 0.101503661068658505E+06, - 0.101546063702057072E+06, 0.101591631627750539E+06, 0.101633780932880036E+06, 0.101677233535571504E+06, 0.101722001382731454E+06, - 0.101768084603012278E+06, 0.101821697636718192E+06, 0.101876504987276159E+06, 0.101929725277785576E+06, 0.101979436992402916E+06, - 0.102021048948978249E+06, 0.102058738337406423E+06, 0.102093407361196325E+06, 0.102125483850517805E+06, 0.102150396359340550E+06, - 0.102169939569479524E+06, 0.102183985952502859E+06, 0.102191376525420768E+06, 0.102185685603385369E+06, 0.102169450367412603E+06, - 0.102146358644484295E+06, 0.102119842646822071E+06, 0.102094075555721618E+06, 0.102073636097204362E+06, 0.102056299206566269E+06, - 0.102039605800132485E+06, 0.102021374390271580E+06, 0.101998770599080817E+06, 0.101970853166201807E+06, 0.101937971227922506E+06, - 0.101900413338984057E+06, 0.101857321774920129E+06, 0.101808436773914334E+06, 0.101755010517902134E+06, 0.101701108954033160E+06, - 0.101652170013780356E+06, 0.101614009141804403E+06, 0.101594396568573589E+06, 0.101591391668390439E+06, 0.101601222158549106E+06, - 0.101618244864968845E+06, 0.101635666146591233E+06, 0.101645911116270872E+06, 0.101646699642323045E+06, 0.101636431221179548E+06, - 0.101609654908569675E+06, 0.101575048385323738E+06, 0.101534330175456344E+06, 0.101489532139668852E+06, 0.101438185377782967E+06, - 0.101385959560380783E+06, 0.101335194667244825E+06, 0.101287926354806812E+06, 0.101245203663320397E+06, 0.101209646717536321E+06, - 0.101183113534233489E+06, 0.101167399256673903E+06, 0.101173255047212093E+06, 0.101191266867459737E+06, 0.101217555082850216E+06, - 0.101249738922742486E+06, 0.101282540292244405E+06, 0.101316175523455371E+06, 0.101351248733287808E+06, 0.101387035478988051E+06, - 0.101423676548066695E+06, 0.101461316613871037E+06, 0.101497507316982592E+06, 0.101531170814716766E+06, 0.101561263551730270E+06, - 0.101576206116756410E+06, 0.101586714996634080E+06, 0.101597778963160541E+06, 0.101611464789349586E+06, 0.101630169532632644E+06, - 0.101664927306783313E+06, 0.101704113353483583E+06, 0.101746416585083251E+06, 0.101790584390523509E+06, 0.101835630759291264E+06, - 0.101885286326592308E+06, 0.101932452931491775E+06, 0.101975582690834839E+06, 0.102013491689891205E+06, 0.102045391567770363E+06, - 0.102064776694095723E+06, 0.102074647376751818E+06, 0.102077355461506435E+06, 0.102073009372423272E+06, 0.102062037114194260E+06, - 0.102045197475351029E+06, 0.102032862053345467E+06, 0.100516203599419721E+06, 0.100565218916304395E+06, 0.100617260891664730E+06, - 0.100673956912948721E+06, 0.100734470974993252E+06, 0.100796865106346027E+06, 0.100860518975916333E+06, 0.100924514220946570E+06, - 0.100987769915576093E+06, 0.101049106773664753E+06, 0.101107273840837661E+06, 0.101159905161335395E+06, 0.101194545284544540E+06, - 0.101223680392232840E+06, 0.101247089234949191E+06, 0.101264590537126525E+06, 0.101276076890375974E+06, 0.101281552099694847E+06, - 0.101280982310362175E+06, 0.101273943686812767E+06, 0.101262940282394411E+06, 0.101250027136122240E+06, 0.101232503141791327E+06, - 0.101210483653828545E+06, 0.101184228737493526E+06, 0.101154165002910086E+06, 0.101120906752935975E+06, 0.101085276329601198E+06, - 0.101055059197187191E+06, 0.101026747435691374E+06, 0.100998039675420368E+06, 0.100969366867174089E+06, 0.100941239345533730E+06, - 0.100914229378812437E+06, 0.100888324815689179E+06, 0.100866108957016506E+06, 0.100846788167441075E+06, 0.100829635550168416E+06, - 0.100814589974162533E+06, 0.100801624509251793E+06, 0.100790670060632678E+06, 0.100777235449754880E+06, 0.100759761272309115E+06, - 0.100744498201414157E+06, 0.100732510380326974E+06, 0.100724806452672536E+06, 0.100722312648745443E+06, 0.100727124797232929E+06, - 0.100739250727341408E+06, 0.100757924088756554E+06, 0.100783210335334952E+06, 0.100815143464493012E+06, 0.100854893070929611E+06, - 0.100907659832364327E+06, 0.100964923673006793E+06, 0.101024919613124526E+06, 0.101086575092280807E+06, 0.101148693938726588E+06, - 0.101212491181683130E+06, 0.101273236178490639E+06, 0.101328963344270000E+06, 0.101377761563192791E+06, 0.101415272026218052E+06, - 0.101431876200949133E+06, 0.101440210101162083E+06, 0.101442472419936472E+06, 0.101441025799434588E+06, 0.101440273436921474E+06, - 0.101441412028859413E+06, 0.101444242700126299E+06, 0.101450026358596937E+06, 0.101460476599565445E+06, 0.101479171248484825E+06, - 0.101501585380914767E+06, 0.101526832551874162E+06, 0.101554045751632453E+06, 0.101581088175181358E+06, 0.101609436210866566E+06, - 0.101639553558900094E+06, 0.101671699640266219E+06, 0.101712219603055011E+06, 0.101758423241378463E+06, 0.101805738585399682E+06, - 0.101852962314692355E+06, 0.101899310754771403E+06, 0.101946265190960024E+06, 0.101994211955312698E+06, 0.102041986736160048E+06, - 0.102085797585756969E+06, 0.102118247218596109E+06, 0.102143944256965377E+06, 0.102160780837746963E+06, 0.102166943569605079E+06, - 0.102158326056491831E+06, 0.102140886616651740E+06, 0.102119658913957755E+06, 0.102098499930418155E+06, 0.102080904999102844E+06, - 0.102066516422517074E+06, 0.102054504472527260E+06, 0.102039748545332608E+06, 0.102020600907278713E+06, 0.101995196360471018E+06, - 0.101963875490564329E+06, 0.101926792596088359E+06, 0.101883686482137069E+06, 0.101834681537134267E+06, 0.101781342698296125E+06, - 0.101725325815194636E+06, 0.101672635846780700E+06, 0.101631506833831096E+06, 0.101606236395939879E+06, 0.101597475949642787E+06, - 0.101603731801431582E+06, 0.101625616805930535E+06, 0.101646355193644980E+06, 0.101660903200991379E+06, 0.101665697733909154E+06, - 0.101654090491919997E+06, 0.101628201204639379E+06, 0.101592718579965003E+06, 0.101550440364196067E+06, 0.101501865690094695E+06, - 0.101447993110863157E+06, 0.101394085224710812E+06, 0.101342099839650211E+06, 0.101293810362817196E+06, 0.101250946740538144E+06, - 0.101215426073013630E+06, 0.101188872150540003E+06, 0.101172928312290038E+06, 0.101177855232292422E+06, 0.101192799356549629E+06, - 0.101215813274799773E+06, 0.101244944643138500E+06, 0.101275131726042877E+06, 0.101307174081444085E+06, 0.101341749283816956E+06, - 0.101378289914467692E+06, 0.101417332589792815E+06, 0.101459925058367837E+06, 0.101502062670976826E+06, 0.101542401965262659E+06, - 0.101579707707947498E+06, 0.101605443608385016E+06, 0.101624638835457939E+06, 0.101643143897028465E+06, 0.101662631727210814E+06, - 0.101684583160134658E+06, 0.101717073342919160E+06, 0.101753756733753267E+06, 0.101791888041425977E+06, 0.101829704004501327E+06, - 0.101866836453342432E+06, 0.101904943611418348E+06, 0.101941838182645661E+06, 0.101974805182480457E+06, 0.102002312012851093E+06, - 0.102022951004307251E+06, 0.102034588422611414E+06, 0.102035115083442288E+06, 0.102027670824049870E+06, 0.102012988929236992E+06, - 0.101992061827493861E+06, 0.101966142466949459E+06, 0.101941390128694227E+06, 0.100514970796833106E+06, 0.100558835077606142E+06, - 0.100607260398477549E+06, 0.100659655071357542E+06, 0.100715265417817398E+06, 0.100773178786940116E+06, 0.100832331209467477E+06, - 0.100890717506978282E+06, 0.100947860531606886E+06, 0.101002917974898708E+06, 0.101052195859970219E+06, 0.101086008388641625E+06, - 0.101115273930014009E+06, 0.101139857117029198E+06, 0.101159622269959131E+06, 0.101174458955507551E+06, 0.101184310219007501E+06, - 0.101189203551941042E+06, 0.101189284643897758E+06, 0.101186114007991724E+06, 0.101181270068826241E+06, 0.101171908271853448E+06, - 0.101158297091944536E+06, 0.101141013465808763E+06, 0.101120226925708761E+06, 0.101096239397641839E+06, 0.101069503529764173E+06, - 0.101044711943530012E+06, 0.101023498931715556E+06, 0.101001656961748697E+06, 0.100979308414565210E+06, 0.100956646567351941E+06, - 0.100933930245713549E+06, 0.100911474196776457E+06, 0.100891471408871366E+06, 0.100874184642035718E+06, 0.100856582877880370E+06, - 0.100838800023023141E+06, 0.100821055717833835E+06, 0.100804211342234223E+06, 0.100787393558680691E+06, 0.100761008720101294E+06, - 0.100734732500141792E+06, 0.100710174312875781E+06, 0.100688451173672947E+06, 0.100670708926784253E+06, 0.100658093134885828E+06, - 0.100653547542059678E+06, 0.100656000772829168E+06, 0.100665921580032358E+06, 0.100683713857153736E+06, 0.100709718860814537E+06, - 0.100748801228508208E+06, 0.100801823503565058E+06, 0.100861225414351109E+06, 0.100925234962917515E+06, 0.100992162379509042E+06, - 0.101061180367843728E+06, 0.101132825200904612E+06, 0.101202551905614309E+06, 0.101268249128093084E+06, 0.101327796560415067E+06, - 0.101375435871056281E+06, 0.101404641442907785E+06, 0.101425758115715638E+06, 0.101440394650381306E+06, 0.101450217422559756E+06, - 0.101458727822546076E+06, 0.101466619611513932E+06, 0.101473463661342525E+06, 0.101480183000528341E+06, 0.101487645084924108E+06, - 0.101498004691627488E+06, 0.101508871394480026E+06, 0.101520205876727661E+06, 0.101532083912951843E+06, 0.101544647478942308E+06, - 0.101558096380653675E+06, 0.101573050568899664E+06, 0.101590428478391070E+06, 0.101613972514299414E+06, 0.101648920007989669E+06, - 0.101687381188284504E+06, 0.101728410452743919E+06, 0.101771447499673959E+06, 0.101823102602039115E+06, 0.101880173737650490E+06, - 0.101939952057504197E+06, 0.101998671132745076E+06, 0.102047778748635392E+06, 0.102081283700837084E+06, 0.102104626314851310E+06, - 0.102117132803555040E+06, 0.102118423258010647E+06, 0.102110210033883151E+06, 0.102097574911021075E+06, 0.102084451243621195E+06, - 0.102073635202554215E+06, 0.102064362043080371E+06, 0.102055076068754133E+06, 0.102042482878204013E+06, 0.102025288372749041E+06, - 0.102001685111197468E+06, 0.101971967159961292E+06, 0.101935955157193923E+06, 0.101893991729276575E+06, 0.101846831752592378E+06, - 0.101795519670136433E+06, 0.101743547706146055E+06, 0.101695867126943878E+06, 0.101657509946900449E+06, 0.101633507015335563E+06, - 0.101630312812292759E+06, 0.101646392192630388E+06, 0.101668889131485266E+06, 0.101690704618882228E+06, 0.101706951776862203E+06, - 0.101710803657395867E+06, 0.101698215938497582E+06, 0.101672792047461742E+06, 0.101636565396570542E+06, 0.101592796399993240E+06, - 0.101539557371443312E+06, 0.101482505549964961E+06, 0.101424993232468783E+06, 0.101369854642081831E+06, 0.101318588912198626E+06, - 0.101273234899637857E+06, 0.101235886605930398E+06, 0.101207937266056106E+06, 0.101192654572110885E+06, 0.101195023201913122E+06, - 0.101207165308628755E+06, 0.101227217799392965E+06, 0.101253372828479289E+06, 0.101281097568006837E+06, 0.101311856149601605E+06, - 0.101345648585710995E+06, 0.101381904947258168E+06, 0.101421272631944972E+06, 0.101465042995991040E+06, 0.101508835313142772E+06, - 0.101551196503329018E+06, 0.101590747790927970E+06, 0.101621682377021876E+06, 0.101645776231220763E+06, 0.101668026172758953E+06, - 0.101689491310640093E+06, 0.101711039834481373E+06, 0.101739312046503386E+06, 0.101772112447843610E+06, 0.101804858575323728E+06, - 0.101836540790179512E+06, 0.101866167898941654E+06, 0.101895518959796798E+06, 0.101925181845865300E+06, 0.101950074886373186E+06, - 0.101969061543749413E+06, 0.101981139844382837E+06, 0.101985462621642117E+06, 0.101977051366888656E+06, 0.101959701573010476E+06, - 0.101935377351789808E+06, 0.101905526341066099E+06, 0.101871781260336036E+06, 0.101835950124052295E+06, 0.100513581366792612E+06, - 0.100554019513422492E+06, 0.100598330045055409E+06, 0.100645982440550681E+06, 0.100696296648474527E+06, 0.100748444268485124E+06, - 0.100801453596632928E+06, 0.100854218792530621E+06, 0.100905513420273754E+06, 0.100949903492433834E+06, 0.100981652101286920E+06, - 0.101009573882022771E+06, 0.101033642379315977E+06, 0.101053802681678295E+06, 0.101069990410599494E+06, 0.101082152783372076E+06, - 0.101090271780979238E+06, 0.101094389439540580E+06, 0.101095654589873608E+06, 0.101096426446181518E+06, 0.101093666576257223E+06, - 0.101087429979991794E+06, 0.101077885304853742E+06, 0.101065339866105438E+06, 0.101050264366095507E+06, 0.101032061623940666E+06, - 0.101012844290179608E+06, 0.100996964302313558E+06, 0.100980770382518007E+06, 0.100964167390490678E+06, 0.100947108284160218E+06, - 0.100929597010366851E+06, 0.100911688070060860E+06, 0.100893582156858451E+06, 0.100881499094758808E+06, 0.100868335774262508E+06, - 0.100853829088449522E+06, 0.100837798044627038E+06, 0.100820106254778977E+06, 0.100800619132333683E+06, 0.100775042434612522E+06, - 0.100741873481754403E+06, 0.100707732498585203E+06, 0.100674198173852987E+06, 0.100642873485934600E+06, 0.100616787946543613E+06, - 0.100595574493244218E+06, 0.100580853452354946E+06, 0.100573369371954352E+06, 0.100573991194533155E+06, 0.100583507950136642E+06, - 0.100602650207284896E+06, 0.100640744734742359E+06, 0.100692244893923940E+06, 0.100751760770043053E+06, 0.100817532941637197E+06, - 0.100887787830291069E+06, 0.100962050144272376E+06, 0.101039744081827113E+06, 0.101116778936214221E+06, 0.101190892544115282E+06, - 0.101259778024939151E+06, 0.101317175633898092E+06, 0.101357978697233921E+06, 0.101390994520218446E+06, 0.101417406025828648E+06, - 0.101438439369066997E+06, 0.101456877295130529E+06, 0.101473268310223793E+06, 0.101486701484946811E+06, 0.101497860785624449E+06, - 0.101507276039524368E+06, 0.101514237723266677E+06, 0.101518949933443597E+06, 0.101522085026395580E+06, 0.101524243387710812E+06, - 0.101525990459469860E+06, 0.101528194232853784E+06, 0.101531700114421837E+06, 0.101537410817429205E+06, 0.101546492305229593E+06, - 0.101567903398293696E+06, 0.101597046994887613E+06, 0.101630996885802393E+06, 0.101669578744430226E+06, 0.101714590729228381E+06, - 0.101773403370424989E+06, 0.101836874445576148E+06, 0.101900881795697991E+06, 0.101960687121667026E+06, 0.102008686461021774E+06, - 0.102037960319300764E+06, 0.102056196723826288E+06, 0.102065273055902842E+06, 0.102066914347914004E+06, 0.102063547681288721E+06, - 0.102059509493393372E+06, 0.102055314339710254E+06, 0.102050951292832178E+06, 0.102044111461623615E+06, 0.102032193928193665E+06, - 0.102014558041099997E+06, 0.101990243188425869E+06, 0.101960364538554975E+06, 0.101925773749474116E+06, 0.101887402236031689E+06, - 0.101845900309227552E+06, 0.101802685936693102E+06, 0.101760172705529054E+06, 0.101722211673123806E+06, 0.101698120911338105E+06, - 0.101693242621827798E+06, 0.101701200555816351E+06, 0.101719376001235738E+06, 0.101743123574903206E+06, 0.101765016750218143E+06, - 0.101780249253377129E+06, 0.101783141086790420E+06, 0.101773015434274668E+06, 0.101749944711398595E+06, 0.101715364981995837E+06, - 0.101666832632786492E+06, 0.101609705385936162E+06, 0.101549151532732372E+06, 0.101488088183680564E+06, 0.101428826013168145E+06, - 0.101371975824192647E+06, 0.101321130368394268E+06, 0.101278514950626632E+06, 0.101245823084732416E+06, 0.101229713571326531E+06, - 0.101228252523962350E+06, 0.101236240082679593E+06, 0.101252202249213733E+06, 0.101274554004038626E+06, 0.101299571284751277E+06, - 0.101328619250470016E+06, 0.101360846988672172E+06, 0.101395461438518367E+06, 0.101432766703864487E+06, 0.101473307204623023E+06, - 0.101514010222445781E+06, 0.101553562190150420E+06, 0.101590717887284656E+06, 0.101621853851409600E+06, 0.101647543893485548E+06, - 0.101671058814602424E+06, 0.101693056210828203E+06, 0.101714129349830531E+06, 0.101738767714405170E+06, 0.101767638107703999E+06, - 0.101795424880191335E+06, 0.101821375190827370E+06, 0.101844797381800585E+06, 0.101865803928462847E+06, 0.101887241456978605E+06, - 0.101903742329332832E+06, 0.101914505259923375E+06, 0.101918870822307275E+06, 0.101916337996088478E+06, 0.101901784739594950E+06, - 0.101874548045828633E+06, 0.101841292001167923E+06, 0.101803678665118787E+06, 0.101762946401782145E+06, 0.101720412831625683E+06, - 0.100515408142486602E+06, 0.100551771547175376E+06, 0.100591372710722571E+06, 0.100633738189236901E+06, 0.100678255595108407E+06, - 0.100724173138854574E+06, 0.100770602351690526E+06, 0.100816524184232330E+06, 0.100854077383907817E+06, 0.100882309305546267E+06, - 0.100908312612091744E+06, 0.100931760805658370E+06, 0.100951200960303162E+06, 0.100967005250871938E+06, 0.100979637398817140E+06, - 0.100989094128378885E+06, 0.100995390483498064E+06, 0.100999335048962457E+06, 0.101003623776222332E+06, 0.101005037852830981E+06, - 0.101003566011062838E+06, 0.100999260214490059E+06, 0.100992254677997669E+06, 0.100982785569327156E+06, 0.100971211282625562E+06, - 0.100958033151982832E+06, 0.100947713227353204E+06, 0.100936845226361344E+06, 0.100925586455398079E+06, 0.100913386427886144E+06, - 0.100900970885727584E+06, 0.100888200173575184E+06, 0.100874969576689109E+06, 0.100865322504112410E+06, 0.100857431942648880E+06, - 0.100848190571948653E+06, 0.100837041611588123E+06, 0.100823522652975458E+06, 0.100807245058683751E+06, 0.100787869439158167E+06, - 0.100757391684316404E+06, 0.100722719302699363E+06, 0.100685949398277124E+06, 0.100648508643416208E+06, 0.100611886678086536E+06, - 0.100577601709138020E+06, 0.100546746024841152E+06, 0.100520863816718731E+06, 0.100501704292206879E+06, 0.100490795320886566E+06, - 0.100489573337377500E+06, 0.100499397978964334E+06, 0.100534016438231076E+06, 0.100580634795179663E+06, 0.100636771821988543E+06, - 0.100700900349775504E+06, 0.100771475161532377E+06, 0.100847971681032548E+06, 0.100928796704597553E+06, 0.101010401416626322E+06, - 0.101090599925904797E+06, 0.101167170271662733E+06, 0.101233921628300508E+06, 0.101285179817018958E+06, 0.101329796645055787E+06, - 0.101368459516926756E+06, 0.101402063972120028E+06, 0.101431554233350747E+06, 0.101457605089509292E+06, 0.101479887700559731E+06, - 0.101498521383338972E+06, 0.101513550784224833E+06, 0.101523174827992611E+06, 0.101527475564510401E+06, 0.101528428909431837E+06, - 0.101526914423630384E+06, 0.101523962459723334E+06, 0.101520309815973524E+06, 0.101516483972158181E+06, 0.101514002315449485E+06, - 0.101514722417862809E+06, 0.101522283068780089E+06, 0.101544056083037300E+06, 0.101571190634249404E+06, 0.101603956939872005E+06, - 0.101642017592925840E+06, 0.101688020789515867E+06, 0.101748771464749283E+06, 0.101810913304749745E+06, 0.101870419614457860E+06, - 0.101923449267402393E+06, 0.101967012984100948E+06, 0.101994050943781331E+06, 0.102011245751808630E+06, 0.102022174558490107E+06, - 0.102029125315834375E+06, 0.102033037791472336E+06, 0.102034394101747268E+06, 0.102032647951692605E+06, 0.102026060860393205E+06, - 0.102014286206869132E+06, 0.101997287902874697E+06, 0.101973908129249903E+06, 0.101945685744995091E+06, 0.101913755487835835E+06, - 0.101879518050633123E+06, 0.101845462413359521E+06, 0.101814438244852194E+06, 0.101787626131292665E+06, 0.101769079269016060E+06, - 0.101760662506367516E+06, 0.101763690025728793E+06, 0.101778245812273221E+06, 0.101800769364128020E+06, 0.101825464810029356E+06, - 0.101849318133198423E+06, 0.101866690516569448E+06, 0.101874423097137915E+06, 0.101868322033511577E+06, 0.101847631400323429E+06, - 0.101809657617465651E+06, 0.101759023134988529E+06, 0.101701048933469734E+06, 0.101638831844116052E+06, 0.101574555754104877E+06, - 0.101509980617449197E+06, 0.101449449533488441E+06, 0.101394594035173650E+06, 0.101347377713062888E+06, 0.101309681379202666E+06, - 0.101289625678805663E+06, 0.101280310168622382E+06, 0.101280601256181355E+06, 0.101289183040688731E+06, 0.101304405647058535E+06, - 0.101324688438220604E+06, 0.101349563357044477E+06, 0.101377976699525767E+06, 0.101409028339016470E+06, 0.101442179995567261E+06, - 0.101476777887449236E+06, 0.101511738303380160E+06, 0.101546126683052818E+06, 0.101579196765551533E+06, 0.101607991498285395E+06, - 0.101632611269017507E+06, 0.101655502605639515E+06, 0.101677080810846644E+06, 0.101697768628730599E+06, 0.101719316740837268E+06, - 0.101742656846947124E+06, 0.101764837611636452E+06, 0.101785178883928776E+06, 0.101802942432164040E+06, 0.101817351144786313E+06, - 0.101829733328404807E+06, 0.101837655847121932E+06, 0.101840093420000965E+06, 0.101836302876360205E+06, 0.101825658934804160E+06, - 0.101806477102295394E+06, 0.101772591154458947E+06, 0.101732979877375386E+06, 0.101689114392674877E+06, 0.101642472350711148E+06, - 0.101594527408217124E+06, 0.100521483098622790E+06, 0.100553034374379175E+06, 0.100587237837357708E+06, 0.100623674982973011E+06, - 0.100661797732431733E+06, 0.100700926585977664E+06, 0.100740251364819997E+06, 0.100769102422238415E+06, 0.100792034055430398E+06, - 0.100813412935669796E+06, 0.100833061354508041E+06, 0.100850766087262135E+06, 0.100866291971468818E+06, 0.100879397215573350E+06, - 0.100889850447447578E+06, 0.100896874983048474E+06, 0.100901879624732552E+06, 0.100908045012513743E+06, 0.100911845008177756E+06, - 0.100913263133695262E+06, 0.100912309117336132E+06, 0.100909033352763217E+06, 0.100903541829518552E+06, 0.100896011438153932E+06, - 0.100886705535507586E+06, 0.100878478741165993E+06, 0.100870518698868997E+06, 0.100862258577488697E+06, 0.100853850267061993E+06, - 0.100845456536039332E+06, 0.100837262111476593E+06, 0.100829483975533818E+06, 0.100823560640713331E+06, 0.100821677296257287E+06, - 0.100817550375560750E+06, 0.100812145039498006E+06, 0.100804659355862575E+06, 0.100794378660273913E+06, 0.100780665915676014E+06, - 0.100760028631593887E+06, 0.100729776405452620E+06, 0.100695664007384359E+06, 0.100658676701707998E+06, 0.100619966898071216E+06, - 0.100580820672301052E+06, 0.100542567168908456E+06, 0.100504377972890885E+06, 0.100469914337100665E+06, 0.100440979221872039E+06, - 0.100419342752137061E+06, 0.100406745142411062E+06, 0.100406705150974245E+06, 0.100432011566503701E+06, 0.100468676779983842E+06, - 0.100515495509657252E+06, 0.100571181275147042E+06, 0.100634390994595859E+06, 0.100706784795550964E+06, 0.100786680087649889E+06, - 0.100869494529497810E+06, 0.100952905038971541E+06, 0.101034572199124057E+06, 0.101109749894571214E+06, 0.101172314783061069E+06, - 0.101229755518492922E+06, 0.101282350507230105E+06, 0.101330323821815167E+06, 0.101373763209774886E+06, 0.101412160049147336E+06, - 0.101445520624250392E+06, 0.101474055469030995E+06, 0.101497872459806793E+06, 0.101516095634979050E+06, 0.101525003393313920E+06, - 0.101529087732478598E+06, 0.101529555701643461E+06, 0.101527554535439689E+06, 0.101523924716972469E+06, 0.101519184588702949E+06, - 0.101515359052858228E+06, 0.101513419431477203E+06, 0.101515061119696038E+06, 0.101524365504439338E+06, 0.101545492952323460E+06, - 0.101572260216870665E+06, 0.101604062662735640E+06, 0.101640454999672467E+06, 0.101681140705924787E+06, 0.101736471342456469E+06, - 0.101791820815604107E+06, 0.101843025813835338E+06, 0.101888338055426750E+06, 0.101926497388645425E+06, 0.101956523951729410E+06, - 0.101977389503551763E+06, 0.101992863624521677E+06, 0.102004636055621828E+06, 0.102012873990628723E+06, 0.102016923944167502E+06, - 0.102015589894533594E+06, 0.102008242524494635E+06, 0.101994805733422399E+06, 0.101975527326879805E+06, 0.101951699623577006E+06, - 0.101924648595227743E+06, 0.101896134378200717E+06, 0.101868181223228035E+06, 0.101842690796364026E+06, 0.101823518800336897E+06, - 0.101810966006917995E+06, 0.101810361562174381E+06, 0.101819625326231835E+06, 0.101837655873780983E+06, 0.101862056783833701E+06, - 0.101890848697784473E+06, 0.101919025148523811E+06, 0.101942604878219718E+06, 0.101953732079914320E+06, 0.101952348959737385E+06, - 0.101930393928014251E+06, 0.101894531594142769E+06, 0.101847206824460780E+06, 0.101792255748977870E+06, 0.101731720782488774E+06, - 0.101667410578914118E+06, 0.101601955467176056E+06, 0.101538353512944566E+06, 0.101479206063803722E+06, 0.101426875382686587E+06, - 0.101386679687780139E+06, 0.101358881267937715E+06, 0.101340978693972764E+06, 0.101332100373616413E+06, 0.101331377677835859E+06, - 0.101337757250038121E+06, 0.101350176595795769E+06, 0.101367529237839539E+06, 0.101388710034061514E+06, 0.101412656335492444E+06, - 0.101438146564572395E+06, 0.101465030990242507E+06, 0.101492743759273944E+06, 0.101520528048576030E+06, 0.101547656089289187E+06, - 0.101573646733203917E+06, 0.101598176409242311E+06, 0.101621015547307805E+06, 0.101642090999262466E+06, 0.101661344187207244E+06, - 0.101680048117579805E+06, 0.101700060142799775E+06, 0.101717676267340707E+06, 0.101732293239297534E+06, 0.101743299867593101E+06, - 0.101750084174098316E+06, 0.101754164408332057E+06, 0.101753815772929738E+06, 0.101747787368181351E+06, 0.101735699407228763E+06, - 0.101717273900884597E+06, 0.101692348035134710E+06, 0.101654861811602153E+06, 0.101610673295375120E+06, 0.101562751614357956E+06, - 0.101512638519625150E+06, 0.101461813597627668E+06, 0.100533318325900138E+06, 0.100559018706234609E+06, 0.100586667516233734E+06, - 0.100616430509356855E+06, 0.100647457772304173E+06, 0.100679140607943787E+06, 0.100698527261697847E+06, 0.100715798167830915E+06, - 0.100731931694921790E+06, 0.100746896633405166E+06, 0.100760616569955790E+06, 0.100772979417731243E+06, 0.100783848302944942E+06, - 0.100793073809534399E+06, 0.100800507571478287E+06, 0.100806483772806212E+06, 0.100813801762586605E+06, 0.100819127022868051E+06, - 0.100822124828140237E+06, 0.100822902466370797E+06, 0.100821716855826366E+06, 0.100818621189554789E+06, 0.100813702346186765E+06, - 0.100807092657524059E+06, 0.100799795563032545E+06, 0.100792638500522866E+06, 0.100785284309503724E+06, 0.100777874398839282E+06, - 0.100770527259340961E+06, 0.100763347669699418E+06, 0.100756435329570639E+06, 0.100749892793592095E+06, 0.100749373875165576E+06, - 0.100750222933888348E+06, 0.100750603463785985E+06, 0.100749864242144642E+06, 0.100747320689053289E+06, 0.100742256076426071E+06, - 0.100733920852957395E+06, 0.100715113795294979E+06, 0.100689064952966379E+06, 0.100657845711542803E+06, 0.100623250918292935E+06, - 0.100586038000497676E+06, 0.100547134348203457E+06, 0.100506028825088957E+06, 0.100462291432826620E+06, 0.100421048783818245E+06, - 0.100384122683633468E+06, 0.100353368412380165E+06, 0.100330670880394246E+06, 0.100321776442990944E+06, 0.100334624094787185E+06, - 0.100358437666044687E+06, 0.100392488442372807E+06, 0.100435977221972600E+06, 0.100488073955800399E+06, 0.100552415559277870E+06, - 0.100627255810881121E+06, 0.100707092289738357E+06, 0.100789756856378794E+06, 0.100873101113792349E+06, 0.100954216801293107E+06, - 0.101025863759345229E+06, 0.101094584610272868E+06, 0.101160235498342692E+06, 0.101222606811297053E+06, 0.101281370962640489E+06, - 0.101332163642811851E+06, 0.101376972618262807E+06, 0.101416728366496085E+06, 0.101451473910749541E+06, 0.101480959555488313E+06, - 0.101500381551832834E+06, 0.101512210195641775E+06, 0.101519514244373393E+06, 0.101523444803633465E+06, 0.101525155563451161E+06, - 0.101524617344664759E+06, 0.101522395272590235E+06, 0.101521151212846860E+06, 0.101522340865174643E+06, 0.101527072168721963E+06, - 0.101537882062393008E+06, 0.101559080181885220E+06, 0.101584526114373686E+06, 0.101614244538571933E+06, 0.101647894372795839E+06, - 0.101684681982032082E+06, 0.101726895995367770E+06, 0.101774312937747018E+06, 0.101818830342195433E+06, 0.101858335228138851E+06, - 0.101893176738273338E+06, 0.101922949034176403E+06, 0.101947508183230893E+06, 0.101967684274917294E+06, 0.101983202615811271E+06, - 0.101993442131563672E+06, 0.101998812147038072E+06, 0.101998613039324773E+06, 0.101992329378160532E+06, 0.101980249760691964E+06, - 0.101962626054339082E+06, 0.101940465078019130E+06, 0.101915907622174098E+06, 0.101890478407916715E+06, 0.101866977689826570E+06, - 0.101849754719304707E+06, 0.101837665745559920E+06, 0.101833602586389810E+06, 0.101841599729967784E+06, 0.101859775477370218E+06, - 0.101886984424902446E+06, 0.101919867690970117E+06, 0.101951746477934430E+06, 0.101978482983373731E+06, 0.101993393892969194E+06, - 0.101991412250034802E+06, 0.101974123414601141E+06, 0.101945239434022718E+06, 0.101905684392780662E+06, 0.101856949799144815E+06, - 0.101801731134592686E+06, 0.101742504741481811E+06, 0.101681038790539489E+06, 0.101619356067038418E+06, 0.101559380452289755E+06, - 0.101505641285490463E+06, 0.101461701752299428E+06, 0.101426005705293821E+06, 0.101398896334048623E+06, 0.101380282180095601E+06, - 0.101369836995025384E+06, 0.101367277170112575E+06, 0.101370986941406809E+06, 0.101379906423074499E+06, 0.101392831033495459E+06, - 0.101408554312665205E+06, 0.101424869582900283E+06, 0.101443182567207696E+06, 0.101462968409184250E+06, 0.101483671134433898E+06, - 0.101504732894123474E+06, 0.101527421913474638E+06, 0.101550095820920280E+06, 0.101571562110317216E+06, 0.101591355780169426E+06, - 0.101609078015251362E+06, 0.101625097194956237E+06, 0.101640337310256451E+06, 0.101652605117688974E+06, 0.101661397415208048E+06, - 0.101666225004107662E+06, 0.101666619975683658E+06, 0.101662556408727090E+06, 0.101653580628123964E+06, 0.101639218203126409E+06, - 0.101619381357809092E+06, 0.101594063768788052E+06, 0.101563351510846944E+06, 0.101523851133020638E+06, 0.101476807405962056E+06, - 0.101426978369828445E+06, 0.101375797428347505E+06, 0.101324598573980998E+06, 0.100551530203326562E+06, 0.100571727120900570E+06, - 0.100593051779557791E+06, 0.100614868997312486E+06, 0.100634144763448072E+06, 0.100645833089619511E+06, 0.100657235284227281E+06, - 0.100667686387769805E+06, 0.100677292913672762E+06, 0.100686112073701530E+06, 0.100694158258119947E+06, 0.100701410586929007E+06, - 0.100707821531117806E+06, 0.100713326592793543E+06, 0.100718292448464927E+06, 0.100725135313074701E+06, 0.100730736036059810E+06, - 0.100734776949494801E+06, 0.100736983079004160E+06, 0.100737142689159882E+06, 0.100735125062421313E+06, 0.100730895453973062E+06, - 0.100724936089312163E+06, 0.100718101716589372E+06, 0.100710128659467940E+06, 0.100701978143640532E+06, 0.100693854728853868E+06, - 0.100685917546278361E+06, 0.100678288281938949E+06, 0.100671058793584918E+06, 0.100664298277410649E+06, 0.100660712381595760E+06, - 0.100661723426356752E+06, 0.100663150264819735E+06, 0.100664393149270531E+06, 0.100664799968549007E+06, 0.100663672287188572E+06, - 0.100660269896986065E+06, 0.100653054372944243E+06, 0.100638919308817800E+06, 0.100620188598009743E+06, 0.100597036492593310E+06, - 0.100569788712949841E+06, 0.100538901380231502E+06, 0.100504939031211514E+06, 0.100464616545740675E+06, 0.100420082357890147E+06, - 0.100376069547844643E+06, 0.100334560389268605E+06, 0.100297550195584583E+06, 0.100267038173233668E+06, 0.100249183652606138E+06, - 0.100248031291493899E+06, 0.100256756900526307E+06, 0.100275250996069168E+06, 0.100303318888992886E+06, 0.100340733860613560E+06, - 0.100392668457859341E+06, 0.100458197469974984E+06, 0.100530344725997711E+06, 0.100607247564767138E+06, 0.100687079608666914E+06, - 0.100768076831136714E+06, 0.100845286817167653E+06, 0.100921915425536106E+06, 0.100997896081585553E+06, 0.101072548063258917E+06, - 0.101144965887108527E+06, 0.101210711249507964E+06, 0.101267759563819229E+06, 0.101319932991058231E+06, 0.101367121820533270E+06, - 0.101409115377035181E+06, 0.101445063624758288E+06, 0.101467868269852072E+06, 0.101485221941439115E+06, 0.101498187544558168E+06, - 0.101507881316604296E+06, 0.101515310949875333E+06, 0.101519599975213365E+06, 0.101522106701145909E+06, 0.101524851878856789E+06, - 0.101529230085351330E+06, 0.101536191323789782E+06, 0.101546697524065807E+06, 0.101566224388216360E+06, 0.101589918902257763E+06, - 0.101616845515287452E+06, 0.101647215589828833E+06, 0.101680341115790361E+06, 0.101715366089036543E+06, 0.101752316168779886E+06, - 0.101791176678952732E+06, 0.101827052748008107E+06, 0.101859044996505589E+06, 0.101887670526199319E+06, 0.101913122414070647E+06, - 0.101934463666524054E+06, 0.101952632860506710E+06, 0.101966700037415663E+06, 0.101975525710702976E+06, 0.101978461989723088E+06, - 0.101975173899271627E+06, 0.101964823473388897E+06, 0.101947665044748559E+06, 0.101926227690128857E+06, 0.101900561072349257E+06, - 0.101874251008341424E+06, 0.101851830347918643E+06, 0.101836189738381829E+06, 0.101828888260193082E+06, 0.101835000054969831E+06, - 0.101851733006117443E+06, 0.101877232568018531E+06, 0.101909510086827300E+06, 0.101940989073697696E+06, 0.101965528537313672E+06, - 0.101979608526400712E+06, 0.101982970036656799E+06, 0.101975240583827399E+06, 0.101955388827734365E+06, 0.101924654892196661E+06, - 0.101887578699447098E+06, 0.101842186561714494E+06, 0.101789317463778367E+06, 0.101732832688802417E+06, 0.101675288481823532E+06, - 0.101619263688587671E+06, 0.101568048094496247E+06, 0.101521062700628769E+06, 0.101479654154784279E+06, 0.101445221739311222E+06, - 0.101418076416901371E+06, 0.101399045923829544E+06, 0.101387018859001342E+06, 0.101381135963448469E+06, 0.101380650007871780E+06, - 0.101384722424981679E+06, 0.101391720295262028E+06, 0.101400396876228624E+06, 0.101411346068523795E+06, 0.101424155121034681E+06, - 0.101438457710905030E+06, 0.101453929199892154E+06, 0.101472913422971527E+06, 0.101492074099173711E+06, 0.101510560767898467E+06, - 0.101527744434993336E+06, 0.101543054611759319E+06, 0.101555675557276962E+06, 0.101564929191696821E+06, 0.101571016898623420E+06, - 0.101573544015567939E+06, 0.101572121672385867E+06, 0.101566370463087485E+06, 0.101554662308102721E+06, 0.101536629786898047E+06, - 0.101513803810128695E+06, 0.101486361735486105E+06, 0.101454563654390658E+06, 0.101418767627698660E+06, 0.101378013088347099E+06, - 0.101330707820646552E+06, 0.101282264555356756E+06, 0.101234028760920090E+06, 0.101187294700704195E+06, 0.100576965529563255E+06, - 0.100591678218711211E+06, 0.100607008383076420E+06, 0.100616323103987481E+06, 0.100620258552074985E+06, 0.100623651287353903E+06, - 0.100626463751429124E+06, 0.100628648078344573E+06, 0.100631378331016531E+06, 0.100634129163284262E+06, 0.100636562070289394E+06, - 0.100638738873227092E+06, 0.100640693964837556E+06, 0.100643049230926015E+06, 0.100648185229669587E+06, 0.100652678597624064E+06, - 0.100656261255894686E+06, 0.100658660860211399E+06, 0.100659622834889029E+06, 0.100658930196984991E+06, 0.100656421096238220E+06, - 0.100652004015325234E+06, 0.100645400203396595E+06, 0.100634943591599571E+06, 0.100623790772243461E+06, 0.100612166299320219E+06, - 0.100600323220825783E+06, 0.100589367539107639E+06, 0.100580442279124138E+06, 0.100572243324848969E+06, 0.100564857703730217E+06, - 0.100563322531964557E+06, 0.100563065402201857E+06, 0.100563607762748041E+06, 0.100564433779967017E+06, 0.100564965723689515E+06, - 0.100564572517680892E+06, 0.100562577288210698E+06, 0.100558128795487573E+06, 0.100550306656448985E+06, 0.100538784205606309E+06, - 0.100523395229331582E+06, 0.100504107960399502E+06, 0.100481009310527326E+06, 0.100454286649172413E+06, 0.100417998848613410E+06, - 0.100377654481256992E+06, 0.100336323265197076E+06, 0.100295695643989733E+06, 0.100257502669341542E+06, 0.100223497751048752E+06, - 0.100198365893325012E+06, 0.100183895883056030E+06, 0.100176748173119719E+06, 0.100177409781642637E+06, 0.100186348863375271E+06, - 0.100204071706916817E+06, 0.100236974921233719E+06, 0.100288202283773542E+06, 0.100347584962604393E+06, 0.100413567810885099E+06, - 0.100484685800612540E+06, 0.100559609376774941E+06, 0.100637786676389092E+06, 0.100719143709254829E+06, 0.100802573207076450E+06, - 0.100886953694736978E+06, 0.100970981281993736E+06, 0.101053137277853224E+06, 0.101122114850514685E+06, 0.101186021991939982E+06, - 0.101244880734986247E+06, 0.101298842483030225E+06, 0.101347976726965513E+06, 0.101388865316328054E+06, 0.101417494561782441E+06, - 0.101441011237599363E+06, 0.101460308434203442E+06, 0.101476142058636950E+06, 0.101489111828680267E+06, 0.101498177707129027E+06, - 0.101504275218907074E+06, 0.101509888353816961E+06, 0.101516205429889771E+06, 0.101524373025953057E+06, 0.101535544403108914E+06, - 0.101550771587497264E+06, 0.101572228401773711E+06, 0.101596922610232752E+06, 0.101624267341491490E+06, 0.101653892197854148E+06, - 0.101685371964174541E+06, 0.101717744368668005E+06, 0.101749825128001146E+06, 0.101781782699506482E+06, 0.101812709382600748E+06, - 0.101841353313321029E+06, 0.101867900490832937E+06, 0.101893188014203624E+06, 0.101915193984979924E+06, 0.101933169418903170E+06, - 0.101945970442238802E+06, 0.101952233644425200E+06, 0.101949989638197949E+06, 0.101938812116678397E+06, 0.101921309771955755E+06, - 0.101897306204910492E+06, 0.101870511994013577E+06, 0.101845727987357284E+06, 0.101827162893394896E+06, 0.101815741469126820E+06, - 0.101815347936997394E+06, 0.101829035456973521E+06, 0.101849227052658054E+06, 0.101873947210599901E+06, 0.101900166979187969E+06, - 0.101922501433547208E+06, 0.101938537730062933E+06, 0.101945622505927895E+06, 0.101943220759731354E+06, 0.101933233593028053E+06, - 0.101913480508279812E+06, 0.101884226864883196E+06, 0.101847880125950556E+06, 0.101805028700279145E+06, 0.101757073613196655E+06, - 0.101706590973509752E+06, 0.101656335498895467E+06, 0.101607292592687139E+06, 0.101560626743744360E+06, 0.101517500638364392E+06, - 0.101478925847553910E+06, 0.101446343700160927E+06, 0.101419879250754559E+06, 0.101398958955256283E+06, 0.101383710029623602E+06, - 0.101374588904196891E+06, 0.101370168865842439E+06, 0.101369105684779628E+06, 0.101370929669406774E+06, 0.101375271898136503E+06, - 0.101381760968333765E+06, 0.101390061699633865E+06, 0.101400585700279218E+06, 0.101414338736935577E+06, 0.101428328122293344E+06, - 0.101441772517097343E+06, 0.101453941211612226E+06, 0.101464150240094372E+06, 0.101470694861331591E+06, 0.101472993001670693E+06, - 0.101472098749250043E+06, 0.101467692245319617E+06, 0.101459459863983502E+06, 0.101447099986294808E+06, 0.101428337148487699E+06, - 0.101402273058774066E+06, 0.101372210423711062E+06, 0.101338601145403256E+06, 0.101301942982120236E+06, 0.101262793506100817E+06, - 0.101221677786233748E+06, 0.101176731503889008E+06, 0.101131973913656722E+06, 0.101088479543089110E+06, 0.101047269615024925E+06, - 0.100610222449967056E+06, 0.100619368346169198E+06, 0.100619051340248508E+06, 0.100617580194349401E+06, 0.100615500249746110E+06, - 0.100612844510783863E+06, 0.100609637715591729E+06, 0.100605899629696811E+06, 0.100601648181252385E+06, 0.100596902436962919E+06, - 0.100591685422206356E+06, 0.100587098052459361E+06, 0.100585436102778738E+06, 0.100587603438895458E+06, 0.100589520780671664E+06, - 0.100591027689952418E+06, 0.100591916118502122E+06, 0.100591952568608729E+06, 0.100590898493088505E+06, 0.100588528847269830E+06, - 0.100584648718839380E+06, 0.100579107975368854E+06, 0.100568181408087505E+06, 0.100556028233350124E+06, 0.100543329111321902E+06, - 0.100530292741429832E+06, 0.100517138305172819E+06, 0.100504104046550317E+06, 0.100491454262540399E+06, 0.100479484740824249E+06, - 0.100470155044772182E+06, 0.100463687256117119E+06, 0.100458896797118272E+06, 0.100455620879032227E+06, 0.100454260984570079E+06, - 0.100454114005490293E+06, 0.100453954401208190E+06, 0.100453246548017763E+06, 0.100453544534649671E+06, 0.100451784335522374E+06, - 0.100447402272511725E+06, 0.100439945313556469E+06, 0.100429058870933281E+06, 0.100414474145118424E+06, 0.100395971880822995E+06, - 0.100364627363950829E+06, 0.100330069619100730E+06, 0.100293517928604648E+06, 0.100256250274621154E+06, 0.100219578502905337E+06, - 0.100184821369736295E+06, 0.100153602788173128E+06, 0.100126759271301082E+06, 0.100104736505522000E+06, 0.100088530813236051E+06, - 0.100079174170628597E+06, 0.100077782208942881E+06, 0.100089384583247156E+06, 0.100124675759422840E+06, 0.100169171328412835E+06, - 0.100221720050477204E+06, 0.100281293603445694E+06, 0.100347032197583365E+06, 0.100419381954596480E+06, 0.100501100689285435E+06, - 0.100587123759395632E+06, 0.100676265830202465E+06, 0.100767041531711700E+06, 0.100857717751965523E+06, 0.100942425402787208E+06, - 0.101015252626361835E+06, 0.101084506455799405E+06, 0.101149930187516162E+06, 0.101211031351648766E+06, 0.101267093811678642E+06, - 0.101313485842090842E+06, 0.101347864445685816E+06, 0.101377348186801406E+06, 0.101401563075397265E+06, 0.101421152746379506E+06, - 0.101436703379514453E+06, 0.101448418323353719E+06, 0.101455739244278491E+06, 0.101461288984514365E+06, 0.101466634842994637E+06, - 0.101474204912937290E+06, 0.101485236375258624E+06, 0.101500599693197641E+06, 0.101519974341673922E+06, 0.101542425947491516E+06, - 0.101567705013514729E+06, 0.101595287754062447E+06, 0.101623559085342917E+06, 0.101653300863473152E+06, 0.101684268370484802E+06, - 0.101715396578327011E+06, 0.101746648790418796E+06, 0.101778157009654227E+06, 0.101810294427225992E+06, 0.101840186138904261E+06, - 0.101866664724512098E+06, 0.101888829801923304E+06, 0.101904365840783910E+06, 0.101910875981687976E+06, 0.101907623411986046E+06, - 0.101897747215346535E+06, 0.101880196785050444E+06, 0.101858268156208374E+06, 0.101836776997478300E+06, 0.101819952813389187E+06, - 0.101808320250000223E+06, 0.101803197426602317E+06, 0.101808609816872282E+06, 0.101820932164050100E+06, 0.101835981686293468E+06, - 0.101853975694054869E+06, 0.101871402202830723E+06, 0.101884750589340591E+06, 0.101893763845945417E+06, 0.101896316342375110E+06, - 0.101891679490974697E+06, 0.101879011465031377E+06, 0.101858040507289596E+06, 0.101829415896828315E+06, 0.101794099063775866E+06, - 0.101754870334758903E+06, 0.101712830221134776E+06, 0.101668524343052632E+06, 0.101623305627111258E+06, 0.101578731565899987E+06, - 0.101536822594720084E+06, 0.101498255706646247E+06, 0.101464056159653454E+06, 0.101434228357694403E+06, 0.101408947230003760E+06, - 0.101388258426133107E+06, 0.101372054750796451E+06, 0.101360489212098575E+06, 0.101352621134682369E+06, 0.101347535522944934E+06, - 0.101344862604306050E+06, 0.101344225484927229E+06, 0.101345820651379589E+06, 0.101351700849621455E+06, 0.101359530806993411E+06, - 0.101367464680662029E+06, 0.101374791985950258E+06, 0.101380818284913359E+06, 0.101384869714943547E+06, 0.101384236152984289E+06, - 0.101379411934677875E+06, 0.101371434785651902E+06, 0.101360085004396402E+06, 0.101345137105284986E+06, 0.101326366500254488E+06, - 0.101300808610161446E+06, 0.101267227431123814E+06, 0.101230448890002648E+06, 0.101191134568648122E+06, 0.101149957676138991E+06, - 0.101107616865909265E+06, 0.101064847159165423E+06, 0.101022580301005539E+06, 0.100981724783641272E+06, 0.100943032631428388E+06, - 0.100907229742725089E+06, 0.100647986354424997E+06, 0.100642715659511494E+06, 0.100636609969385099E+06, 0.100629766959429631E+06, - 0.100622273153360293E+06, 0.100614207409999959E+06, 0.100605644320867577E+06, 0.100596657511128040E+06, 0.100587322839384142E+06, - 0.100577721494929676E+06, 0.100567942994422949E+06, 0.100559032457675799E+06, 0.100552977775159990E+06, 0.100548029023239913E+06, - 0.100543925649759869E+06, 0.100540775676255420E+06, 0.100537926202230563E+06, 0.100534526225857189E+06, 0.100530349204130558E+06, - 0.100525160024924175E+06, 0.100518730289664294E+06, 0.100507262057308282E+06, 0.100493351445575739E+06, 0.100478812420309798E+06, - 0.100463863563753723E+06, 0.100448706735957079E+06, 0.100433537133342616E+06, 0.100418551953121700E+06, 0.100403957667064577E+06, - 0.100390113818734360E+06, 0.100378283224859435E+06, 0.100368019408275955E+06, 0.100359348113145898E+06, 0.100352231413445901E+06, - 0.100346572462762793E+06, 0.100342221388570266E+06, 0.100338982151060118E+06, 0.100338392782828159E+06, 0.100341188152017450E+06, - 0.100343374795880460E+06, 0.100344284175602748E+06, 0.100343279804720136E+06, 0.100339754195549598E+06, 0.100333123950383713E+06, - 0.100321286971674039E+06, 0.100297287465905509E+06, 0.100269835508128133E+06, 0.100239714419667638E+06, 0.100207741409672206E+06, - 0.100174751447097195E+06, 0.100141579771693956E+06, 0.100106755441371904E+06, 0.100069912900784475E+06, 0.100035704844720982E+06, - 0.100005528642180579E+06, 0.999808555037528422E+05, 0.999632723451110069E+05, 0.999545236439836153E+05, 0.999736658577992639E+05, - 0.100003353333015431E+06, 0.100042064117430200E+06, 0.100089071041598727E+06, 0.100143778848621456E+06, 0.100205754250853075E+06, - 0.100280664932831889E+06, 0.100364704219084786E+06, 0.100454126970714191E+06, 0.100547163719590288E+06, 0.100641885410501171E+06, - 0.100736224731986324E+06, 0.100821668363604142E+06, 0.100899090295081827E+06, 0.100973330050358534E+06, 0.101044570047650093E+06, - 0.101111101684352281E+06, 0.101171922832138123E+06, 0.101223284014747289E+06, 0.101260000146915598E+06, 0.101290169362142216E+06, - 0.101314373328620830E+06, 0.101333177003506280E+06, 0.101345070024148474E+06, 0.101353392220116293E+06, 0.101359052838648713E+06, - 0.101363820978951000E+06, 0.101369812488926094E+06, 0.101377607762478350E+06, 0.101388432240829963E+06, 0.101403721097234418E+06, - 0.101423686495689355E+06, 0.101447911692908267E+06, 0.101474956233570803E+06, 0.101501708578459278E+06, 0.101530416403443902E+06, - 0.101560731988182699E+06, 0.101592331907465996E+06, 0.101625384375889567E+06, 0.101660463766652349E+06, 0.101696287937694025E+06, - 0.101731505165402195E+06, 0.101765373671168942E+06, 0.101795889760683582E+06, 0.101821575901139222E+06, 0.101839426770240534E+06, - 0.101848304582011391E+06, 0.101850674932157766E+06, 0.101845563338820590E+06, 0.101833662450669886E+06, 0.101819729736987734E+06, - 0.101806525676924168E+06, 0.101796235624030873E+06, 0.101788878921415002E+06, 0.101786474628160606E+06, 0.101791411418041462E+06, - 0.101799155363379643E+06, 0.101808395203049906E+06, 0.101819645577764153E+06, 0.101830409662230682E+06, 0.101837554446248556E+06, - 0.101839744105951162E+06, 0.101836170755967585E+06, 0.101826399135349377E+06, 0.101810169058729633E+06, 0.101787697095879019E+06, - 0.101760376393189144E+06, 0.101728853043894385E+06, 0.101693851935638726E+06, 0.101656211520082943E+06, 0.101616790158213262E+06, - 0.101576704560053928E+06, 0.101537500986694940E+06, 0.101500335696260430E+06, 0.101465878362827381E+06, 0.101434840756723977E+06, - 0.101408292472182264E+06, 0.101385653681886775E+06, 0.101367773762272278E+06, 0.101355060936308873E+06, 0.101344865614149967E+06, - 0.101336866601978196E+06, 0.101330803221953858E+06, 0.101326445157375012E+06, 0.101323705025865274E+06, 0.101323151766299212E+06, - 0.101323317919074820E+06, 0.101323609309034800E+06, 0.101323383998279736E+06, 0.101321968519799790E+06, 0.101318674829698095E+06, - 0.101309557473271183E+06, 0.101297255318789845E+06, 0.101282004506700381E+06, 0.101263593826286131E+06, 0.101241822534985287E+06, - 0.101216505434514431E+06, 0.101183763113335532E+06, 0.101143062284304673E+06, 0.101099958082106066E+06, 0.101055260378077917E+06, - 0.101009770107324861E+06, 0.100964289722992879E+06, 0.100919631222605836E+06, 0.100878395229792455E+06, 0.100840230418695966E+06, - 0.100804814065610379E+06, 0.100772660269162792E+06, 0.100687581879727732E+06, 0.100677327145079587E+06, 0.100666160693170401E+06, - 0.100654207341057889E+06, 0.100641583937123549E+06, 0.100628402623918475E+06, 0.100614774045043421E+06, 0.100600810488184259E+06, - 0.100586628958508634E+06, 0.100572354178803900E+06, 0.100558377265734845E+06, 0.100545518784321612E+06, 0.100533722529582723E+06, - 0.100522910171807918E+06, 0.100512931196078469E+06, 0.100503576020145658E+06, 0.100494590303307457E+06, 0.100485690264560879E+06, - 0.100476578798775605E+06, 0.100466962148914608E+06, 0.100453831814755409E+06, 0.100437250927331042E+06, 0.100419883924672962E+06, - 0.100402010894887906E+06, 0.100383869790613491E+06, 0.100365667294769126E+06, 0.100347588515499185E+06, 0.100329805497802925E+06, - 0.100312484547517117E+06, 0.100295677938969020E+06, 0.100279971482571520E+06, 0.100265646792895117E+06, 0.100252835911466231E+06, - 0.100241624480511469E+06, 0.100232054881627162E+06, 0.100224130808306480E+06, 0.100217823206996967E+06, 0.100218259667894425E+06, - 0.100221888558547784E+06, 0.100225662634090608E+06, 0.100228894178654795E+06, 0.100230909476646018E+06, 0.100231046622607246E+06, - 0.100228652435841679E+06, 0.100220736457496634E+06, 0.100203006988572233E+06, 0.100182026084597936E+06, 0.100158298000477531E+06, - 0.100132350369893451E+06, 0.100104715520267695E+06, 0.100075909358704739E+06, 0.100043124770855982E+06, 0.100002028989072438E+06, - 0.999616642547620577E+05, 0.999236877809293510E+05, 0.998898266920593742E+05, 0.998618945050216280E+05, 0.998418030619178171E+05, - 0.998423833568641858E+05, 0.998594396345241257E+05, 0.998857662121956964E+05, 0.999209046169008070E+05, 0.999644862724064005E+05, - 0.100016242187354641E+06, 0.100077317810256820E+06, 0.100156061627195784E+06, 0.100241897409154641E+06, 0.100332874470688155E+06, - 0.100428637026128985E+06, 0.100526117084385623E+06, 0.100622332108951261E+06, 0.100709061724389190E+06, 0.100788527255290071E+06, - 0.100863969991383987E+06, 0.100934619610214693E+06, 0.100999507530848088E+06, 0.101057589879684849E+06, 0.101107912118639942E+06, - 0.101140898046464674E+06, 0.101165194334426677E+06, 0.101183324487668549E+06, 0.101196455912974372E+06, 0.101205787756098696E+06, - 0.101212555660780359E+06, 0.101217307428240179E+06, 0.101221221076374510E+06, 0.101226815969850082E+06, 0.101235775469520071E+06, - 0.101249089517923203E+06, 0.101267499119154090E+06, 0.101290114155802439E+06, 0.101316108973235343E+06, 0.101344864351232871E+06, - 0.101376027068939133E+06, 0.101409318557868275E+06, 0.101444185441017980E+06, 0.101479505555003896E+06, 0.101516882009007721E+06, - 0.101555258888103534E+06, 0.101593997928136538E+06, 0.101632899844262269E+06, 0.101670115604274892E+06, 0.101703897209036979E+06, - 0.101731821696663668E+06, 0.101752696747597220E+06, 0.101767805557897402E+06, 0.101776451771069726E+06, 0.101776669469582252E+06, - 0.101773409436917937E+06, 0.101768516316242836E+06, 0.101762622025664066E+06, 0.101757375988241824E+06, 0.101753826825127559E+06, - 0.101753403149395934E+06, 0.101756975828023817E+06, 0.101760728893977721E+06, 0.101764213695991348E+06, 0.101767251659026326E+06, - 0.101770663081707637E+06, 0.101770424123169345E+06, 0.101766072271416459E+06, 0.101755995409002455E+06, 0.101740345666592038E+06, - 0.101721298174118318E+06, 0.101699043646416510E+06, 0.101673714396835901E+06, 0.101645709970302123E+06, 0.101615709217670097E+06, - 0.101584438818864903E+06, 0.101549071157331651E+06, 0.101514367930820241E+06, 0.101481015481659371E+06, 0.101449616141240651E+06, - 0.101420749509000205E+06, 0.101394921878986992E+06, 0.101373676775729036E+06, 0.101359486676981818E+06, 0.101347304837422518E+06, - 0.101336841360518913E+06, 0.101328023341265842E+06, 0.101320386045212057E+06, 0.101313764510643596E+06, 0.101308434768293082E+06, - 0.101303621069785135E+06, 0.101298777855350723E+06, 0.101293531204510582E+06, 0.101287470834921696E+06, 0.101280152845400124E+06, - 0.101270201669037211E+06, 0.101254701725787949E+06, 0.101236553755882080E+06, 0.101215630660361639E+06, 0.101191802985207483E+06, - 0.101164939977834394E+06, 0.101134911067020425E+06, 0.101095221983884170E+06, 0.101047509096163092E+06, 0.100998010357585692E+06, - 0.100947641730482603E+06, 0.100897282218335793E+06, 0.100847785377602457E+06, 0.100799988650482410E+06, 0.100756067172860465E+06, - 0.100716404949108095E+06, 0.100680394601797932E+06, 0.100648426393021538E+06, 0.100745881471474568E+06, 0.100728142553068014E+06, - 0.100709625290291020E+06, 0.100690810595279676E+06, 0.100673015913888710E+06, 0.100654662696282932E+06, 0.100635883098483231E+06, - 0.100616812156066226E+06, 0.100597590570947941E+06, 0.100577923093225269E+06, 0.100558481382763435E+06, 0.100539763749561054E+06, - 0.100521848971490384E+06, 0.100504736841997088E+06, 0.100488356281683067E+06, 0.100472574428834167E+06, 0.100457206575664590E+06, - 0.100442026795809623E+06, 0.100426779086875598E+06, 0.100408173847290411E+06, 0.100384737995668649E+06, 0.100361938241868149E+06, - 0.100339809752568588E+06, 0.100318341944825661E+06, 0.100297490120403570E+06, 0.100277187624826533E+06, 0.100256847285368276E+06, - 0.100235365725066120E+06, 0.100214436988323068E+06, 0.100194015395758135E+06, 0.100174603679756343E+06, 0.100156451770575964E+06, - 0.100139783864459299E+06, 0.100124799136242582E+06, 0.100111674036540222E+06, 0.100100566149749706E+06, 0.100091646133474802E+06, - 0.100094268080595342E+06, 0.100098360646490051E+06, 0.100103245417476035E+06, 0.100108251398645036E+06, 0.100112713737688697E+06, - 0.100115972074298101E+06, 0.100117368468727698E+06, 0.100113713047268437E+06, 0.100102264314479005E+06, 0.100088001440509222E+06, - 0.100071163974188516E+06, 0.100051996036882978E+06, 0.100030726477270320E+06, 0.100007546295320470E+06, 0.999807647979038738E+05, - 0.999391989552558807E+05, 0.998969708781520749E+05, 0.998557810370234511E+05, 0.998173700956349639E+05, 0.997835138413437380E+05, - 0.997560107381300622E+05, 0.997399269866001996E+05, 0.997470920864752261E+05, 0.997634292598558095E+05, 0.997888964555621351E+05, - 0.998253139512354246E+05, 0.998703081483062851E+05, 0.999237330223304161E+05, 0.999900673422841937E+05, 0.100071098592214898E+06, - 0.100157786095159157E+06, 0.100248141148947368E+06, 0.100340095617225234E+06, 0.100431568456538211E+06, 0.100520552982271765E+06, - 0.100601957172444119E+06, 0.100676277857242458E+06, 0.100746000837763233E+06, 0.100808736668317229E+06, 0.100864485886548777E+06, - 0.100912656357667453E+06, 0.100952804425252194E+06, 0.100983458937089512E+06, 0.101002905816960556E+06, 0.101017076739301760E+06, - 0.101025919304932366E+06, 0.101031319629252597E+06, 0.101035629307633033E+06, 0.101040244934609727E+06, 0.101046393155694794E+06, - 0.101055516125687020E+06, 0.101070906234944094E+06, 0.101089614225348079E+06, 0.101111577432790844E+06, 0.101136727145279292E+06, - 0.101164845396941935E+06, 0.101195505773623969E+06, 0.101228307857940395E+06, 0.101262885478130513E+06, 0.101298695011647855E+06, - 0.101336323186784808E+06, 0.101375617863355365E+06, 0.101416132308550543E+06, 0.101458486694783467E+06, 0.101500186893265898E+06, - 0.101539835500673144E+06, 0.101576113752189529E+06, 0.101608148989054069E+06, 0.101635731083729115E+06, 0.101658502412969741E+06, - 0.101672883340000117E+06, 0.101682956248776158E+06, 0.101690136156231834E+06, 0.101694729692935623E+06, 0.101695555850151519E+06, - 0.101694985210699713E+06, 0.101693812129123311E+06, 0.101693039728607808E+06, 0.101693715283905956E+06, 0.101692868849250488E+06, - 0.101690508890417783E+06, 0.101685212790082718E+06, 0.101676311144040446E+06, 0.101666676329463662E+06, 0.101655232931092047E+06, - 0.101641717109236590E+06, 0.101625993005500495E+06, 0.101608164735537764E+06, 0.101588188219044227E+06, 0.101565919017002117E+06, - 0.101541334705616158E+06, 0.101515224870468810E+06, 0.101488328834034881E+06, 0.101461275807381404E+06, 0.101434883687913665E+06, - 0.101409484965064941E+06, 0.101385820779280519E+06, 0.101366650582102375E+06, 0.101354446840173172E+06, 0.101343919272935833E+06, - 0.101334580534699839E+06, 0.101326051033725802E+06, 0.101318025772555571E+06, 0.101310244905231491E+06, 0.101303240884958926E+06, - 0.101296508440228543E+06, 0.101288703571071324E+06, 0.101279586340018883E+06, 0.101269869694777401E+06, 0.101258981910571456E+06, - 0.101246361574452327E+06, 0.101230052909366845E+06, 0.101210205538298207E+06, 0.101187520180750522E+06, 0.101161911206820834E+06, - 0.101133290201435040E+06, 0.101101563145659631E+06, 0.101066628653128937E+06, 0.101019252959455625E+06, 0.100965746706630394E+06, - 0.100910740992734136E+06, 0.100855238817428384E+06, 0.100800186778776610E+06, 0.100746485895287333E+06, 0.100695000750680716E+06, - 0.100647864656014091E+06, 0.100605793755290593E+06, 0.100567897173808713E+06, 0.100534547818198989E+06, 0.100814127595255733E+06, - 0.100792022069682134E+06, 0.100768906676945466E+06, 0.100744859019167008E+06, 0.100719947172904969E+06, 0.100694229203288138E+06, - 0.100667752842392147E+06, 0.100641747076966523E+06, 0.100616187623394333E+06, 0.100590421603492592E+06, 0.100564843816162116E+06, - 0.100539661442132914E+06, 0.100515003622905657E+06, 0.100490925990557327E+06, 0.100467416019604236E+06, 0.100444399107853926E+06, - 0.100421745278230635E+06, 0.100399276378565366E+06, 0.100374479059296529E+06, 0.100342341387721070E+06, 0.100310819294281551E+06, - 0.100280122297496389E+06, 0.100250406051737154E+06, 0.100221779328347242E+06, 0.100194311780137796E+06, 0.100168042299398876E+06, - 0.100142987772136228E+06, 0.100119152028053810E+06, 0.100096071569344102E+06, 0.100074127372371906E+06, 0.100053458844250679E+06, - 0.100034145590099070E+06, 0.100016303683140140E+06, 0.100000086204841966E+06, 0.999856841527353536E+05, 0.999733278135488799E+05, - 0.999663531822283549E+05, 0.999693777575280983E+05, 0.999741959503276157E+05, 0.999802590538802469E+05, 0.999870378916889313E+05, - 0.999938949144795042E+05, 0.100000191518739506E+06, 0.100005286991947069E+06, 0.100006317487418550E+06, 0.100001195017387858E+06, - 0.999937624881289375E+05, 0.999840228227615153E+05, 0.999719630030743720E+05, 0.999577541117163637E+05, 0.999414190489595931E+05, - 0.999227353126357775E+05, 0.998873066933161899E+05, 0.998482442672230973E+05, 0.998092392179712187E+05, 0.997720171343442780E+05, - 0.997383602763239178E+05, 0.997100954593149654E+05, 0.996890738866330212E+05, 0.996865348971301573E+05, 0.996979284283922898E+05, - 0.997178025858917244E+05, 0.997459381653020537E+05, 0.997821174181933602E+05, 0.998261113921440992E+05, 0.998776597193271737E+05, - 0.999420283421857603E+05, 0.100017917957394646E+06, 0.100097878242084247E+06, 0.100179897231054711E+06, 0.100262024118021669E+06, - 0.100342632647495484E+06, 0.100419763744213284E+06, 0.100491241165072570E+06, 0.100554990596539108E+06, 0.100613108372608185E+06, - 0.100664964935558615E+06, 0.100710050488669251E+06, 0.100748062257432917E+06, 0.100778981129089982E+06, 0.100801136588479072E+06, - 0.100816775933362136E+06, 0.100825979191023362E+06, 0.100833035761093313E+06, 0.100839384072879693E+06, 0.100846373089390050E+06, - 0.100857951736503237E+06, 0.100872302980121356E+06, 0.100888680627202251E+06, 0.100907092306334001E+06, 0.100927501559027049E+06, - 0.100950662310288419E+06, 0.100977294658870305E+06, 0.101006277386327682E+06, 0.101036971461367139E+06, 0.101068254496147259E+06, - 0.101099848827670517E+06, 0.101133511540723193E+06, 0.101169399010245761E+06, 0.101207870174907031E+06, 0.101248846664781042E+06, - 0.101290872607848010E+06, 0.101333141189654139E+06, 0.101375246051365641E+06, 0.101416446476650075E+06, 0.101455302158143284E+06, - 0.101490839830927347E+06, 0.101520107656443550E+06, 0.101543517742126453E+06, 0.101563037513223637E+06, 0.101578855351202437E+06, - 0.101589294440855650E+06, 0.101594084692158984E+06, 0.101595811485579121E+06, 0.101594522898840631E+06, 0.101587783852875349E+06, - 0.101580434348492054E+06, 0.101571251185715577E+06, 0.101560523496472335E+06, 0.101548552694418337E+06, 0.101535867827232971E+06, - 0.101525413599061823E+06, 0.101514059084604145E+06, 0.101501599931887249E+06, 0.101487982453526070E+06, 0.101472687979190014E+06, - 0.101455256212675624E+06, 0.101436599458446668E+06, 0.101417421871714148E+06, 0.101397941747779230E+06, 0.101378563636379375E+06, - 0.101359842874464084E+06, 0.101342462840995518E+06, 0.101332246224379633E+06, 0.101325840252083945E+06, 0.101320103689658979E+06, - 0.101314877253089740E+06, 0.101310111834561045E+06, 0.101305378666758857E+06, 0.101300345803243748E+06, 0.101295776170531011E+06, - 0.101292199871251156E+06, 0.101287082936946317E+06, 0.101280060941132921E+06, 0.101270852280511215E+06, 0.101259228389922413E+06, - 0.101244988802512118E+06, 0.101227740446083306E+06, 0.101206586899449845E+06, 0.101182271497207475E+06, 0.101154765725986566E+06, - 0.101124017218970926E+06, 0.101089948851124151E+06, 0.101052459983455323E+06, 0.101011429271982197E+06, 0.100955245737388075E+06, - 0.100896292883737755E+06, 0.100836289133349041E+06, 0.100776402552628671E+06, 0.100717117782225978E+06, 0.100659365283430379E+06, - 0.100604025319315682E+06, 0.100553449734939946E+06, 0.100508407522918642E+06, 0.100467703215460322E+06, 0.100431774319843782E+06, - 0.100887777028820332E+06, 0.100861720047367722E+06, 0.100834436753951144E+06, 0.100806009321876336E+06, 0.100776515387351727E+06, - 0.100746027719175327E+06, 0.100714128174464058E+06, 0.100678835400336873E+06, 0.100643940658424166E+06, 0.100609599439615049E+06, - 0.100575890439937211E+06, 0.100542814645689868E+06, 0.100510647118237335E+06, 0.100478852228419142E+06, 0.100447427441828680E+06, - 0.100416345678542421E+06, 0.100385524391706378E+06, 0.100353710114660586E+06, 0.100313330006065604E+06, 0.100273215809488320E+06, - 0.100233726851702537E+06, 0.100195172710990315E+06, 0.100157816918484707E+06, 0.100121881575408392E+06, 0.100087552777137244E+06, - 0.100054986731522251E+06, 0.100024316458513829E+06, 0.999958188555688102E+05, 0.999694587498323526E+05, 0.999449162204764725E+05, - 0.999222572991156194E+05, 0.999015841003048117E+05, 0.998830358793447813E+05, 0.998667901084829064E+05, 0.998530636160492868E+05, - 0.998421138196279935E+05, 0.998399548826702376E+05, 0.998456341634458367E+05, 0.998536660057044792E+05, 0.998634438903502014E+05, - 0.998743637363783346E+05, 0.998858203733583359E+05, 0.998972031892049272E+05, 0.999078909209750127E+05, 0.999149362451545312E+05, - 0.999155853988857416E+05, 0.999144713123037072E+05, 0.999115094947106991E+05, 0.999066084422268032E+05, 0.998996635379296931E+05, - 0.998905505086211051E+05, 0.998791187039132201E+05, 0.998553009292081260E+05, 0.998211706427201134E+05, 0.997864909210314072E+05, - 0.997528267554746853E+05, 0.997217498141473916E+05, 0.996948180668799905E+05, 0.996735491411857802E+05, 0.996593866015884996E+05, - 0.996655234255323448E+05, 0.996793806269131601E+05, 0.997006480667150026E+05, 0.997291101032920706E+05, 0.997645101820020791E+05, - 0.998065302642879251E+05, 0.998547900089741306E+05, 0.999134103376733110E+05, 0.999816545378570445E+05, 0.100052123784172887E+06, - 0.100122995502983205E+06, 0.100192554793170464E+06, 0.100259253657548237E+06, 0.100321770579711141E+06, 0.100379066111299660E+06, - 0.100430565790236928E+06, 0.100476507405646029E+06, 0.100515199549242738E+06, 0.100547257296906639E+06, 0.100573671260601302E+06, - 0.100594920234367688E+06, 0.100611741953639648E+06, 0.100625093360959523E+06, 0.100636085854106641E+06, 0.100648539226327353E+06, - 0.100663110344216606E+06, 0.100678485576473686E+06, 0.100694991774415132E+06, 0.100712835683178113E+06, 0.100732147548005290E+06, - 0.100753127553809449E+06, 0.100775525773403977E+06, 0.100799178062266757E+06, 0.100823896465442915E+06, 0.100848973735924432E+06, - 0.100871627589741343E+06, 0.100896325593451635E+06, 0.100923508440905760E+06, 0.100953444968081341E+06, 0.100987803936626107E+06, - 0.101025452874861629E+06, 0.101064958354120550E+06, 0.101105934719207362E+06, 0.101149656229281260E+06, 0.101195955740066449E+06, - 0.101241312234646321E+06, 0.101284295970940017E+06, 0.101322838039260794E+06, 0.101354503959834561E+06, 0.101381602347716602E+06, - 0.101404011754918669E+06, 0.101421551762267889E+06, 0.101430360992792368E+06, 0.101432922117767157E+06, 0.101431497700586173E+06, - 0.101426925441668209E+06, 0.101419967655507149E+06, 0.101411983040633873E+06, 0.101402716970667971E+06, 0.101392421375849139E+06, - 0.101381472260780953E+06, 0.101370274940234522E+06, 0.101359740662010270E+06, 0.101350634658367329E+06, 0.101341143517682387E+06, - 0.101330923240958698E+06, 0.101319823874219393E+06, 0.101307931163203728E+06, 0.101295590108053555E+06, 0.101283554840952769E+06, - 0.101272503805782646E+06, 0.101264230996134676E+06, 0.101263165987784392E+06, 0.101263248071743699E+06, 0.101263968423840182E+06, - 0.101264949849351571E+06, 0.101265950281725454E+06, 0.101266859267559164E+06, 0.101267688820318188E+06, 0.101269586773692979E+06, - 0.101271200254654817E+06, 0.101270843870590616E+06, 0.101268468005190778E+06, 0.101263583383249803E+06, 0.101255809203046563E+06, - 0.101244849341628564E+06, 0.101230469880693592E+06, 0.101211897835992699E+06, 0.101189677118595791E+06, 0.101163874725058151E+06, - 0.101134452948665217E+06, 0.101101374466219480E+06, 0.101064596222306151E+06, 0.101024065194136114E+06, 0.100976094439065258E+06, - 0.100916143828112647E+06, 0.100853769181501484E+06, 0.100790071236260570E+06, 0.100726087398982490E+06, 0.100662794662010128E+06, - 0.100601113224382003E+06, 0.100541910367744073E+06, 0.100487274737311833E+06, 0.100437683864829785E+06, 0.100392394095480457E+06, - 0.100351867577605750E+06, 0.100962168045125494E+06, 0.100932365352918903E+06, 0.100901110935450168E+06, 0.100868480358099798E+06, - 0.100834547574790442E+06, 0.100796703363587934E+06, 0.100755267960995203E+06, 0.100713570472402876E+06, 0.100671854726096004E+06, - 0.100630308500112806E+06, 0.100589060133053688E+06, 0.100548176434007823E+06, 0.100507661857319457E+06, 0.100467458892467330E+06, - 0.100427449603971385E+06, 0.100387458241177985E+06, 0.100347067293918182E+06, 0.100298654635154177E+06, 0.100250789888946878E+06, - 0.100203094461237808E+06, 0.100156000274838036E+06, 0.100109901773151054E+06, 0.100065158238268661E+06, 0.100022096993949221E+06, - 0.999810174333996401E+05, 0.999421958115488960E+05, 0.999058907435752189E+05, 0.998749313841952826E+05, 0.998464722705311870E+05, - 0.998203417981312523E+05, 0.997966268545406929E+05, 0.997754458911707188E+05, 0.997569500594004494E+05, 0.997413241542494943E+05, - 0.997287873670089612E+05, 0.997195938347852207E+05, 0.997219848697613779E+05, 0.997302647271703609E+05, 0.997413201843605202E+05, - 0.997545532545877795E+05, 0.997693575270145375E+05, 0.997851155398511037E+05, 0.998011953959217790E+05, 0.998169466903843859E+05, - 0.998299082101016102E+05, 0.998356142670790869E+05, 0.998398422284621047E+05, 0.998424522644160897E+05, 0.998432923817324918E+05, - 0.998421955048720556E+05, 0.998389770375031076E+05, 0.998334333807975636E+05, 0.998233671652358898E+05, 0.997961670290865004E+05, - 0.997678973047597101E+05, 0.997399010170866677E+05, 0.997134966342892585E+05, 0.996899556689095043E+05, 0.996704759993049811E+05, - 0.996561506699569145E+05, 0.996500136858785991E+05, 0.996586427100675064E+05, 0.996741311696416087E+05, 0.996962994894855947E+05, - 0.997249142503650510E+05, 0.997596639024193428E+05, 0.998001312580039958E+05, 0.998457643772705051E+05, 0.998968741052847909E+05, - 0.999554058789066621E+05, 0.100014421175045645E+06, 0.100072433938662172E+06, 0.100128122411163247E+06, 0.100180369857232887E+06, - 0.100226565707743983E+06, 0.100267364450542242E+06, 0.100303437234851634E+06, 0.100335667091963755E+06, 0.100364067822408935E+06, - 0.100388352892750874E+06, 0.100408979571248361E+06, 0.100426614584295938E+06, 0.100443740449263758E+06, 0.100461134998395326E+06, - 0.100478174321635088E+06, 0.100495256991003844E+06, 0.100512619944850769E+06, 0.100530318011748270E+06, 0.100548816195507636E+06, - 0.100568537852548383E+06, 0.100588688433695279E+06, 0.100609168368209503E+06, 0.100629814904332350E+06, 0.100650416237038749E+06, - 0.100665634418575515E+06, 0.100681296503981284E+06, 0.100698501345687095E+06, 0.100717920340627403E+06, 0.100740215249176472E+06, - 0.100766890514599916E+06, 0.100796657224606606E+06, 0.100829306693609207E+06, 0.100864641226465828E+06, 0.100904494038338991E+06, - 0.100948883593760926E+06, 0.100993670283464584E+06, 0.101037518284592399E+06, 0.101079215492193092E+06, 0.101115268009655614E+06, - 0.101146790223207165E+06, 0.101174201341284715E+06, 0.101197180680782549E+06, 0.101215405063571248E+06, 0.101223672236876388E+06, - 0.101227039458753206E+06, 0.101226892310118274E+06, 0.101223972224575875E+06, 0.101218953111666357E+06, 0.101212937481870860E+06, - 0.101205841402347578E+06, 0.101198438153766576E+06, 0.101191337677150907E+06, 0.101184775501605473E+06, 0.101178859738651910E+06, - 0.101173861836438504E+06, 0.101169688625135837E+06, 0.101165295165053874E+06, 0.101160720689472480E+06, 0.101156205118519152E+06, - 0.101153904081471745E+06, 0.101157778313312563E+06, 0.101162376363148098E+06, 0.101167695990116554E+06, 0.101174407609201837E+06, - 0.101181289698729292E+06, 0.101187910343826748E+06, 0.101193938755009076E+06, 0.101199145593254492E+06, 0.101206932922006279E+06, - 0.101215167455344184E+06, 0.101221538641997948E+06, 0.101225600948191553E+06, 0.101227025345643400E+06, 0.101225591909201801E+06, - 0.101221179118605258E+06, 0.101213750568578733E+06, 0.101199646966405868E+06, 0.101180697627794187E+06, 0.101158105995225807E+06, - 0.101131732247750042E+06, 0.101101468150223940E+06, 0.101067227518597691E+06, 0.101028937999906033E+06, 0.100986534229694924E+06, - 0.100931637537634888E+06, 0.100870116212888723E+06, 0.100806172230221506E+06, 0.100740814221331588E+06, 0.100675010844437245E+06, - 0.100609686876287946E+06, 0.100545721239012084E+06, 0.100483946382944894E+06, 0.100426130298766730E+06, 0.100372432821891009E+06, - 0.100322757504134090E+06, 0.100277638455664739E+06, 0.101031760825673671E+06, 0.100998271623218010E+06, 0.100963081981794705E+06, - 0.100926251398063658E+06, 0.100882116391194853E+06, 0.100836110949086375E+06, 0.100789196010976768E+06, 0.100741656022242169E+06, - 0.100693739602509639E+06, 0.100645654807320738E+06, 0.100597565425804190E+06, 0.100549588305930272E+06, 0.100501791687992096E+06, - 0.100454194516198477E+06, 0.100406766687836353E+06, 0.100359430189551465E+06, 0.100303106797204193E+06, 0.100246577208372706E+06, - 0.100190531822652643E+06, 0.100135266216653603E+06, 0.100081062875707968E+06, 0.100028192493603376E+06, 0.999769161960119818E+05, - 0.999274886616365693E+05, 0.998801621121565840E+05, 0.998351911400472018E+05, 0.997962094163349393E+05, 0.997640534483473457E+05, - 0.997345240177219384E+05, 0.997076990988948673E+05, 0.996836794307263772E+05, 0.996625896600271371E+05, 0.996445791479565378E+05, - 0.996298224252568762E+05, 0.996185192726470996E+05, 0.996108943913202529E+05, 0.996171044733596500E+05, 0.996274341933858086E+05, - 0.996407368485686020E+05, 0.996564433077199938E+05, 0.996739662819337100E+05, 0.996926995456860750E+05, 0.997120167510192841E+05, - 0.997312700110226870E+05, 0.997492720049924683E+05, 0.997589945357419347E+05, 0.997672950870170171E+05, 0.997740082631510304E+05, - 0.997789569418504107E+05, 0.997819534179343900E+05, 0.997828018434580008E+05, 0.997813025467889238E+05, 0.997761547542830958E+05, - 0.997606903751367063E+05, 0.997380039112137747E+05, 0.997148807783809316E+05, 0.996925793721139198E+05, 0.996723316187614837E+05, - 0.996553186696160265E+05, 0.996426434711866459E+05, 0.996353006212308683E+05, 0.996360089851673401E+05, 0.996493081867637520E+05, - 0.996683800195190997E+05, 0.996929780547397386E+05, 0.997227658669395460E+05, 0.997573001543519495E+05, 0.997960150791931374E+05, - 0.998382096557535260E+05, 0.998830404070649238E+05, 0.999298323121304275E+05, 0.999742523604048474E+05, 0.100016965326181715E+06, - 0.100057253131543956E+06, 0.100094584675305145E+06, 0.100128612542877818E+06, 0.100159162106115866E+06, 0.100186212494174571E+06, - 0.100209869217876141E+06, 0.100230664541801205E+06, 0.100252215827535721E+06, 0.100272507526162837E+06, 0.100291578842935764E+06, - 0.100309849731348106E+06, 0.100327689967233746E+06, 0.100345394170965068E+06, 0.100363163535270942E+06, 0.100381092592034052E+06, - 0.100399259031973241E+06, 0.100417513798931104E+06, 0.100435580822035801E+06, 0.100453091252954211E+06, 0.100469603339999827E+06, - 0.100480151507121773E+06, 0.100489254638568047E+06, 0.100498595808049067E+06, 0.100508951548301586E+06, 0.100521040443233302E+06, - 0.100536087694824993E+06, 0.100554481106296153E+06, 0.100575842199618433E+06, 0.100600284600435130E+06, 0.100627894363922838E+06, - 0.100660998742818352E+06, 0.100699900685942383E+06, 0.100740240979155365E+06, 0.100780773089326132E+06, 0.100820325888548046E+06, - 0.100857002425394050E+06, 0.100889306549680012E+06, 0.100918410465244044E+06, 0.100943855527829830E+06, 0.100965216993375041E+06, - 0.100982104369596826E+06, 0.100988787448417890E+06, 0.100992039290643908E+06, 0.100992851817592629E+06, 0.100992148367721486E+06, - 0.100990754377491627E+06, 0.100989328864528783E+06, 0.100987939282731590E+06, 0.100987019598780156E+06, 0.100986810224360001E+06, - 0.100987461015865600E+06, 0.100989052975663959E+06, 0.100991630597561802E+06, 0.100995163025901697E+06, 0.101001875722349461E+06, - 0.101011088720900429E+06, 0.101021084899088091E+06, 0.101031663037972830E+06, 0.101042638294081626E+06, 0.101053858103835970E+06, - 0.101065218626100279E+06, 0.101076680586933391E+06, 0.101088283485301858E+06, 0.101099874970037970E+06, 0.101113089326713816E+06, - 0.101125428039884195E+06, 0.101136196176455385E+06, 0.101144782354753406E+06, 0.101150661981462021E+06, 0.101153397040916956E+06, - 0.101152632849470392E+06, 0.101148092219151222E+06, 0.101138825885236918E+06, 0.101125297346996245E+06, 0.101107998631323659E+06, - 0.101086896343469081E+06, 0.101061954484055474E+06, 0.101033133620494526E+06, 0.101000389988487950E+06, 0.100963674428856495E+06, - 0.100920035249967157E+06, 0.100864002050084426E+06, 0.100802954127500183E+06, 0.100739491656333426E+06, 0.100674607806506479E+06, - 0.100609142818467881E+06, 0.100543918229119721E+06, 0.100479729438758746E+06, 0.100417340423775575E+06, 0.100357818911458060E+06, - 0.100301549120910859E+06, 0.100249027161521051E+06, 0.100200821670612902E+06, 0.101087517829558172E+06, 0.101052015003826687E+06, - 0.101011788745108162E+06, 0.100964536778963855E+06, 0.100915488137692053E+06, 0.100864943012846241E+06, 0.100813190048196135E+06, - 0.100760500256302723E+06, 0.100707121731364154E+06, 0.100653275174801398E+06, 0.100599150242222226E+06, 0.100544902712618306E+06, - 0.100490652473024573E+06, 0.100436482304513964E+06, 0.100382437448442113E+06, 0.100320280351299210E+06, 0.100257427382579408E+06, - 0.100194846079550756E+06, 0.100132891655021755E+06, 0.100071918796184837E+06, 0.100012281557507449E+06, 0.999543340473443968E+05, - 0.998984318951125897E+05, 0.998449344820776314E+05, 0.997942079153267550E+05, 0.997466460297804297E+05, 0.997094928681285237E+05, - 0.996756279012622545E+05, 0.996450218538222252E+05, 0.996176735384205385E+05, 0.995936103776563396E+05, 0.995728884174646664E+05, - 0.995555917894421727E+05, 0.995418315732738702E+05, 0.995317440033937164E+05, 0.995262628136555868E+05, 0.995329410864949314E+05, - 0.995433141117427585E+05, 0.995568197318211314E+05, 0.995728823939344729E+05, 0.995909116272487881E+05, 0.996102999545491039E+05, - 0.996304204174830811E+05, 0.996506239397997124E+05, 0.996702368021630245E+05, 0.996815718025470851E+05, 0.996899469928969920E+05, - 0.996967323341972806E+05, 0.997018093255459680E+05, 0.997050766826754843E+05, 0.997064543685055542E+05, 0.997058891541211779E+05, - 0.997033620388164272E+05, 0.996988978495463380E+05, 0.996831868676393642E+05, 0.996664226445127570E+05, 0.996504367351514375E+05, - 0.996361908772876632E+05, 0.996245860820844246E+05, 0.996164411729444837E+05, 0.996124708057612588E+05, 0.996132638091558620E+05, - 0.996196649575229239E+05, 0.996367110923675500E+05, 0.996583825556631200E+05, 0.996843326520396949E+05, 0.997128691088688356E+05, - 0.997429147876210773E+05, 0.997758051592909760E+05, 0.998110107603276119E+05, 0.998478942000829556E+05, 0.998857114279977977E+05, - 0.999214491155317955E+05, 0.999550948845939129E+05, 0.999866837454055931E+05, 0.100015951080814193E+06, 0.100042763152220112E+06, - 0.100066833155271277E+06, 0.100088158247781059E+06, 0.100108078185884762E+06, 0.100126927297932227E+06, 0.100144951073682430E+06, - 0.100162306504082269E+06, 0.100179972902585811E+06, 0.100197255514410528E+06, 0.100214513504718459E+06, 0.100231716678680328E+06, - 0.100248516891677820E+06, 0.100264879167597144E+06, 0.100280677931150029E+06, 0.100295703143529230E+06, 0.100309668678237373E+06, - 0.100317822458752169E+06, 0.100323698725186405E+06, 0.100328766123466703E+06, 0.100333617686529382E+06, 0.100338870421945830E+06, - 0.100345146510504768E+06, 0.100353505811859010E+06, 0.100364091412822730E+06, 0.100377219192028511E+06, 0.100393145224109379E+06, - 0.100412076822805961E+06, 0.100436536362016341E+06, 0.100466993027333549E+06, 0.100499128955239808E+06, 0.100531867585847620E+06, - 0.100564210070354224E+06, 0.100595268938737849E+06, 0.100623389505981249E+06, 0.100648875381678285E+06, 0.100671545265182722E+06, - 0.100691215991390258E+06, 0.100707855569253967E+06, 0.100721531568851729E+06, 0.100729765774870320E+06, 0.100736382308921660E+06, - 0.100742049357786149E+06, 0.100747338931632839E+06, 0.100752699996680560E+06, 0.100758437644766876E+06, 0.100764492369211905E+06, - 0.100771174162651805E+06, 0.100778897781122723E+06, 0.100791202238176033E+06, 0.100805304746492911E+06, 0.100820453141876555E+06, - 0.100836553977341420E+06, 0.100853433691068960E+06, 0.100869804352758074E+06, 0.100885565873248357E+06, 0.100901263434718436E+06, - 0.100916755649211860E+06, 0.100931925490762223E+06, 0.100946862129343805E+06, 0.100964994999554750E+06, 0.100982379998277524E+06, - 0.100998599729598267E+06, 0.101013259118967748E+06, 0.101025997621651855E+06, 0.101036183051793079E+06, 0.101042991775159331E+06, - 0.101046219174794693E+06, 0.101045436783694371E+06, 0.101037979396283830E+06, 0.101026389136987622E+06, 0.101011353849770458E+06, - 0.100992765156084381E+06, 0.100970520839387638E+06, 0.100944522980413691E+06, 0.100914676733503889E+06, 0.100880889510173438E+06, - 0.100843070409204898E+06, 0.100794195318855112E+06, 0.100740849916230014E+06, 0.100684368608276331E+06, 0.100625515617689191E+06, - 0.100565057571482292E+06, 0.100503753672499588E+06, 0.100442348146381337E+06, 0.100381564680888332E+06, 0.100322120082476831E+06, - 0.100265427081164002E+06, 0.100211108587006820E+06, 0.100159852906932778E+06, 0.100112309293580329E+06, 0.101124201328911135E+06, - 0.101079108320663814E+06, 0.101031809144729792E+06, 0.100982479818601947E+06, 0.100931296727433786E+06, 0.100878431465452362E+06, - 0.100824045759680885E+06, 0.100768286540631874E+06, 0.100710530566360118E+06, 0.100651851143405918E+06, 0.100592641779612633E+06, - 0.100533088300546049E+06, 0.100473351995987294E+06, 0.100413568226339557E+06, 0.100347374189164038E+06, 0.100280419558277266E+06, - 0.100213466642138825E+06, 0.100146884874704396E+06, 0.100081054126754942E+06, 0.100016363564741026E+06, 0.999532111494706915E+05, - 0.998920037667682045E+05, 0.998331579776468134E+05, 0.997771013708717801E+05, 0.997242744959584961E+05, 0.996794911425569007E+05, - 0.996421673866169731E+05, 0.996083624063458992E+05, 0.995780558571076108E+05, 0.995512438908386830E+05, 0.995279390599935141E+05, - 0.995081697090995876E+05, 0.994919788171798573E+05, 0.994794222509916144E+05, 0.994705663858296175E+05, 0.994666304399983201E+05, - 0.994716729317709396E+05, 0.994803098980725772E+05, 0.994920284915772354E+05, 0.995062941002977459E+05, 0.995225510997954116E+05, - 0.995402235083560226E+05, 0.995587157137078175E+05, 0.995774134724761680E+05, 0.995956854178548674E+05, 0.996082099438724399E+05, - 0.996146714115503564E+05, 0.996198917096476653E+05, 0.996237772972328385E+05, 0.996262556600006501E+05, 0.996272811679797160E+05, - 0.996268420791924145E+05, 0.996249688472863927E+05, 0.996217438673883153E+05, 0.996165665480622556E+05, 0.996053672464558331E+05, - 0.995949919441781822E+05, 0.995861528017038072E+05, 0.995795026742108748E+05, 0.995756196555683418E+05, 0.995749923295157205E+05, - 0.995764918417123117E+05, 0.995811371618628909E+05, 0.995900021812679042E+05, 0.996053443416097725E+05, 0.996253126869847765E+05, - 0.996485392863536254E+05, 0.996747275639752770E+05, 0.997034975235640304E+05, 0.997343816924544808E+05, 0.997668244608898967E+05, - 0.998001857951137499E+05, 0.998337502953590738E+05, 0.998667425003782409E+05, 0.998964382191309269E+05, 0.999219732315580331E+05, - 0.999453769704884326E+05, 0.999669632680838986E+05, 0.999870458961453260E+05, 0.100005916456012012E+06, 0.100023824889774987E+06, - 0.100040963571971195E+06, 0.100057455775243085E+06, 0.100073413986486979E+06, 0.100089335775104671E+06, 0.100104815244426631E+06, - 0.100119703191363587E+06, 0.100134379227022902E+06, 0.100148369375800728E+06, 0.100161370783191393E+06, 0.100173213642796953E+06, - 0.100180378799944810E+06, 0.100185526497069281E+06, 0.100189324284954535E+06, 0.100192153267272603E+06, 0.100194434190503976E+06, - 0.100196610662858875E+06, 0.100198905421094794E+06, 0.100201850991823914E+06, 0.100206163107215340E+06, 0.100212230663632377E+06, - 0.100220378132198122E+06, 0.100230869811071767E+06, 0.100245444302250398E+06, 0.100264473811748554E+06, 0.100285188354245533E+06, - 0.100306907645131752E+06, 0.100328990026887506E+06, 0.100350863943610893E+06, 0.100371839758985952E+06, 0.100391444833452260E+06, - 0.100409831169643890E+06, 0.100426823791286341E+06, 0.100442350551841242E+06, 0.100456434485740057E+06, 0.100469179887128601E+06, - 0.100480095078871280E+06, 0.100490844862516460E+06, 0.100501773469729742E+06, 0.100513473090107072E+06, 0.100529036405637875E+06, - 0.100544944618372494E+06, 0.100561407314039185E+06, 0.100578441255079553E+06, 0.100596158161423402E+06, 0.100614688506316757E+06, - 0.100634037456854698E+06, 0.100654132781311564E+06, 0.100674831301503669E+06, 0.100695930204477670E+06, 0.100717182634869590E+06, - 0.100738316734543623E+06, 0.100757949561458212E+06, 0.100778269263575014E+06, 0.100798138776316147E+06, 0.100817212656416305E+06, - 0.100835135245772617E+06, 0.100851545416907000E+06, 0.100866083297882986E+06, 0.100878398135237148E+06, 0.100888156496614407E+06, - 0.100895050095971907E+06, 0.100897946875170004E+06, 0.100893038607802475E+06, 0.100884438418173842E+06, 0.100872056807847897E+06, - 0.100855733686039923E+06, 0.100836196267254127E+06, 0.100813309503127763E+06, 0.100786948600525633E+06, 0.100756997497101227E+06, - 0.100723347939641535E+06, 0.100681497385685245E+06, 0.100634489632593322E+06, 0.100584469640955329E+06, 0.100531975070484972E+06, - 0.100477580490852386E+06, 0.100421885399875624E+06, 0.100365503956835804E+06, 0.100309056337240749E+06, 0.100253161585176160E+06, - 0.100199112753698049E+06, 0.100147837599931416E+06, 0.100098570404209735E+06, 0.100051904767761502E+06, 0.100008417383464068E+06, - 0.101133829804470908E+06, 0.101086063734912168E+06, 0.101036163378778583E+06, 0.100984272823056410E+06, 0.100930541473297533E+06, - 0.100875120408097937E+06, 0.100818158832696005E+06, 0.100759800682388610E+06, 0.100700181428799915E+06, 0.100639425144117529E+06, - 0.100577641880169904E+06, 0.100514925420599073E+06, 0.100451351465310479E+06, 0.100382775391041228E+06, 0.100313407558045423E+06, - 0.100244124043691409E+06, 0.100175160300200252E+06, 0.100106643005048623E+06, 0.100038955227867787E+06, 0.999724957502307661E+05, - 0.999076781431158888E+05, 0.998449303055831406E+05, 0.997846944474534976E+05, 0.997274274929867825E+05, 0.996741803525597352E+05, - 0.996341923290063423E+05, 0.995977652427823923E+05, 0.995648719529626542E+05, 0.995354913787664409E+05, 0.995096084222995123E+05, - 0.994872134460891248E+05, 0.994683012796486000E+05, 0.994528697284307418E+05, 0.994409175579627627E+05, 0.994324419258456037E+05, - 0.994284685420939932E+05, 0.994314645232595940E+05, 0.994376508028579119E+05, 0.994465880324430618E+05, 0.994578122019961011E+05, - 0.994708370980191394E+05, 0.994851569440643361E+05, 0.995002493657292362E+05, 0.995155788435459253E+05, 0.995306008387735346E+05, - 0.995442855494334071E+05, 0.995482724169068970E+05, 0.995511559961705934E+05, 0.995528872179506288E+05, 0.995534386606523331E+05, - 0.995528106454166118E+05, 0.995510380683528929E+05, 0.995481980155677447E+05, 0.995444181794313772E+05, 0.995389426918443642E+05, - 0.995326299748121528E+05, 0.995248068651720969E+05, 0.995181203502452699E+05, 0.995131485287031392E+05, 0.995104093839186244E+05, - 0.995103487778951967E+05, 0.995133292577804386E+05, 0.995196200330811116E+05, 0.995293885226779821E+05, 0.995426939068978973E+05, - 0.995594831481808505E+05, 0.995804466354603064E+05, 0.996042013257502404E+05, 0.996303970501146687E+05, 0.996586123005633417E+05, - 0.996883528051014437E+05, 0.997188265847352159E+05, 0.997490367113701504E+05, 0.997788526495865081E+05, 0.998078707819837873E+05, - 0.998356993938613014E+05, 0.998619800562695164E+05, 0.998837326032437413E+05, 0.999030588156207523E+05, 0.999213959026974480E+05, - 0.999389528776631778E+05, 0.999559737390779337E+05, 0.999728528505193826E+05, 0.999889548460716323E+05, 0.100004292017804837E+06, - 0.100018822423468373E+06, 0.100032457501698547E+06, 0.100045070251751036E+06, 0.100056503593779649E+06, 0.100066444229329674E+06, - 0.100073267298309525E+06, 0.100078208907556284E+06, 0.100081428306994378E+06, 0.100083145646425299E+06, 0.100084490398295631E+06, - 0.100085214798590619E+06, 0.100085235536889129E+06, 0.100083644141418641E+06, 0.100082296767241191E+06, 0.100081573165770096E+06, - 0.100081814208376789E+06, 0.100083316094140551E+06, 0.100086326553815597E+06, 0.100092077248113128E+06, 0.100100913993150592E+06, - 0.100111107468981296E+06, 0.100122323217253404E+06, 0.100134231875447673E+06, 0.100146529461883110E+06, 0.100158953738958458E+06, - 0.100172103739167927E+06, 0.100185442550333013E+06, 0.100198870033114930E+06, 0.100214743046030431E+06, 0.100230501702414200E+06, - 0.100246186063517438E+06, 0.100261900880765723E+06, 0.100278280962620207E+06, 0.100294975745097370E+06, 0.100311878419328103E+06, - 0.100329065054564679E+06, 0.100346610730169734E+06, 0.100364576981339662E+06, 0.100382997190169379E+06, 0.100401860048637522E+06, - 0.100421460558640218E+06, 0.100441987614432976E+06, 0.100463274519939529E+06, 0.100485156332498926E+06, 0.100507667562079601E+06, - 0.100531755712309474E+06, 0.100555537683995659E+06, 0.100578784151641899E+06, 0.100601239956125326E+06, 0.100622628756313949E+06, - 0.100641873088256354E+06, 0.100658680264014634E+06, 0.100673598187900920E+06, 0.100686312726101605E+06, 0.100696503456104270E+06, - 0.100703849613094353E+06, 0.100704152415214849E+06, 0.100700762505721214E+06, 0.100694332357036590E+06, 0.100684801738842943E+06, - 0.100672137064367969E+06, 0.100656329651135165E+06, 0.100637393206196401E+06, 0.100615360755861184E+06, 0.100590281222544916E+06, - 0.100562215831141861E+06, 0.100526781016220033E+06, 0.100486348156266336E+06, 0.100442798181998849E+06, 0.100397163429546563E+06, - 0.100349807344903311E+06, 0.100301139976506107E+06, 0.100251607747954069E+06, 0.100201684250218939E+06, 0.100151862062679153E+06, - 0.100102645581508201E+06, 0.100056044918004729E+06, 0.100011301942910883E+06, 0.999684520456376777E+05, 0.999279531311431929E+05, - 0.998902646792392770E+05, 0.101126663346454399E+06, 0.101077325354608969E+06, 0.101025975734916894E+06, 0.100972737972671399E+06, - 0.100917744423974829E+06, 0.100861133803490855E+06, 0.100803048766821448E+06, 0.100743633625432005E+06, 0.100683032233185906E+06, - 0.100621386084403202E+06, 0.100558832663878042E+06, 0.100495211427552291E+06, 0.100428081646754872E+06, 0.100360053702616802E+06, - 0.100291421804985934E+06, 0.100222501857581025E+06, 0.100153629396011398E+06, 0.100085157752426705E+06, 0.100017456492403435E+06, - 0.999509101650603116E+05, 0.998859174013813172E+05, 0.998228903882164013E+05, 0.997622547363343474E+05, 0.997044497501409787E+05, - 0.996565808532324445E+05, 0.996171954030033376E+05, 0.995813735590216529E+05, 0.995490780595074320E+05, 0.995202664706442010E+05, - 0.994948916653312772E+05, 0.994731497863732366E+05, 0.994547373765991215E+05, 0.994395024448596523E+05, 0.994273918334258487E+05, - 0.994183417080185318E+05, 0.994131115873192466E+05, 0.994138210062121798E+05, 0.994170868554473127E+05, 0.994225572846895811E+05, - 0.994298923767942179E+05, 0.994385978253560606E+05, 0.994482495116238133E+05, 0.994584440096453618E+05, 0.994687785322086420E+05, - 0.994788546658055129E+05, 0.994882828035313869E+05, 0.994927040708071727E+05, 0.994917547439376503E+05, 0.994895539007886109E+05, - 0.994862075166797877E+05, 0.994818501581585733E+05, 0.994766470759525691E+05, 0.994707963627129502E+05, 0.994645310337857954E+05, - 0.994581208250226337E+05, 0.994518734280974313E+05, 0.994461348017268174E+05, 0.994415182672292285E+05, 0.994388346879257297E+05, - 0.994384357346413162E+05, 0.994406125032009149E+05, 0.994455917032776051E+05, 0.994535286747415666E+05, 0.994645016916688619E+05, - 0.994785078337676387E+05, 0.994954607091662765E+05, 0.995151903074341826E+05, 0.995379744989390892E+05, 0.995645762978403654E+05, - 0.995919660907828365E+05, 0.996199268533732247E+05, 0.996482101418556267E+05, 0.996765332991438627E+05, 0.997045938426658686E+05, - 0.997320840835444978E+05, 0.997587053657859215E+05, 0.997841813092843222E+05, 0.998082694645679585E+05, 0.998307708426059398E+05, - 0.998521847777656949E+05, 0.998731316336951131E+05, 0.998915223579208832E+05, 0.999088069900928822E+05, 0.999250655468217301E+05, - 0.999403321942196199E+05, 0.999545992766920099E+05, 0.999678219791941956E+05, 0.999799234377201792E+05, 0.999908557408674824E+05, - 0.100000288315772239E+06, 0.100007974659642932E+06, 0.100013912274213857E+06, 0.100018152445268570E+06, 0.100020792433534516E+06, - 0.100021965384116600E+06, 0.100021828600707202E+06, 0.100018978825766098E+06, 0.100014638020503815E+06, 0.100010038309740252E+06, - 0.100005576575099418E+06, 0.100001604858675491E+06, 0.999984320892866672E+05, 0.999963266886948113E+05, 0.999958737477183749E+05, - 0.999972975927051302E+05, 0.100000048030566773E+06, 0.100004042344745598E+06, 0.100009194673973179E+06, 0.100015426118827090E+06, - 0.100022673026545686E+06, 0.100031009563329135E+06, 0.100040766570146734E+06, 0.100051217540583049E+06, 0.100062248668533124E+06, - 0.100073786795171531E+06, 0.100085797503990121E+06, 0.100098280610450573E+06, 0.100111262656178049E+06, 0.100125001802413579E+06, - 0.100139645695878644E+06, 0.100154900063508263E+06, 0.100170710309353148E+06, 0.100187004814548171E+06, 0.100203682971120987E+06, - 0.100220602392753455E+06, 0.100237565502663623E+06, 0.100256278549938754E+06, 0.100276900404893633E+06, 0.100298794291387065E+06, - 0.100320557514765664E+06, 0.100342058165774986E+06, 0.100363130678741916E+06, 0.100383577435456726E+06, 0.100403171366828377E+06, - 0.100421659429775435E+06, 0.100438766794516225E+06, 0.100454201546808938E+06, 0.100467659691497232E+06, 0.100478830237807808E+06, - 0.100481024801078907E+06, 0.100479810484167552E+06, 0.100476403382797740E+06, 0.100470673041393165E+06, 0.100462504496619513E+06, - 0.100451800234604845E+06, 0.100438481209722173E+06, 0.100422487058078696E+06, 0.100403775642287073E+06, 0.100382322062990715E+06, - 0.100358117267813446E+06, 0.100327534199358997E+06, 0.100293850879764213E+06, 0.100257806725219358E+06, 0.100219741686727677E+06, - 0.100180023194298759E+06, 0.100139040711945461E+06, 0.100097200477411025E+06, 0.100054920551059535E+06, 0.100012626265403043E+06, - 0.999707461374165723E+05, 0.999303503014407033E+05, 0.998922229704366764E+05, 0.998554721656402544E+05, 0.998204850080980395E+05, - 0.997876409225251264E+05, 0.997573084048583696E+05, 0.101103863341862932E+06, 0.101054198041262367E+06, 0.101002678396138304E+06, - 0.100949414469850730E+06, 0.100894527371675096E+06, 0.100838147558637153E+06, 0.100780413214267071E+06, 0.100721468731159111E+06, - 0.100661463324523051E+06, 0.100600549803942500E+06, 0.100538495641508489E+06, 0.100474499779926511E+06, 0.100409614880186520E+06, - 0.100344074690081019E+06, 0.100278137807477731E+06, 0.100212086086552372E+06, 0.100146223109295490E+06, 0.100080872747272268E+06, - 0.100016377835126099E+06, 0.999530989729176799E+05, 0.998914134690468200E+05, 0.998317144291724107E+05, 0.997744099892116501E+05, - 0.997208338934957865E+05, 0.996799309689324291E+05, 0.996422327801534993E+05, 0.996077247089604498E+05, 0.995763830833266111E+05, - 0.995481752007196337E+05, 0.995230592311468208E+05, 0.995009839760444302E+05, 0.994818884619951277E+05, 0.994657013515687577E+05, - 0.994523401572802686E+05, 0.994417102486785589E+05, 0.994338127166474005E+05, 0.994291184813256987E+05, 0.994266081659517949E+05, - 0.994259833524572168E+05, 0.994269351914163999E+05, 0.994291475057475909E+05, 0.994323001129119220E+05, 0.994360724062380032E+05, - 0.994401472289394151E+05, 0.994442150616938598E+05, 0.994479785254193557E+05, 0.994511571742526139E+05, 0.994472284598653205E+05, - 0.994408965796853736E+05, 0.994339336034472362E+05, 0.994264710020695638E+05, 0.994186660048548511E+05, 0.994107025256855122E+05, - 0.994027916086733312E+05, 0.993951711926945572E+05, 0.993881049497915083E+05, 0.993818799057818542E+05, 0.993768025040628709E+05, - 0.993745371453054540E+05, 0.993758273945832625E+05, 0.993797480709728989E+05, 0.993864179439653672E+05, 0.993959015946626314E+05, - 0.994106666848780587E+05, 0.994280957797027659E+05, 0.994479062249146809E+05, 0.994699024606817256E+05, 0.994938326370272989E+05, - 0.995193970618178137E+05, 0.995462575961586117E+05, 0.995732238058578514E+05, 0.995996836683722795E+05, 0.996264076540508540E+05, - 0.996531520384603791E+05, 0.996796729134591151E+05, 0.997057352581914602E+05, 0.997311214531925361E+05, 0.997565307292698708E+05, - 0.997809628500159452E+05, 0.998041926037547237E+05, 0.998260922842872533E+05, 0.998465616497438023E+05, 0.998655323213428928E+05, - 0.998829702013785281E+05, 0.998988759405013552E+05, 0.999132835855504527E+05, 0.999267531384376343E+05, 0.999401187534305645E+05, - 0.999522829859957856E+05, 0.999629705900948175E+05, 0.999720750719777716E+05, 0.999795225775888684E+05, 0.999852704402040836E+05, - 0.999893033756584045E+05, 0.999916276698245056E+05, 0.999912215328864258E+05, 0.999874978505536856E+05, 0.999827294697511534E+05, - 0.999772668831095216E+05, 0.999714403004270425E+05, 0.999655543840146129E+05, 0.999598844544293243E+05, 0.999546738384171913E+05, - 0.999501503361758805E+05, 0.999464612795733119E+05, 0.999436472754112765E+05, 0.999417478240415512E+05, 0.999407845190346270E+05, - 0.999407674168311496E+05, 0.999417003681598144E+05, 0.999435850419050112E+05, 0.999466778359479795E+05, 0.999509741170870548E+05, - 0.999561184478715149E+05, 0.999620266396879451E+05, 0.999686260435519798E+05, 0.999758509523019893E+05, 0.999836356497705565E+05, - 0.999919049957114039E+05, 0.100000562486864073E+06, 0.100011784952549118E+06, 0.100025750768122278E+06, 0.100039950549839836E+06, - 0.100054145017178846E+06, 0.100068316891848794E+06, 0.100082450146767165E+06, 0.100096523400557431E+06, 0.100110501610887819E+06, - 0.100124326095454249E+06, 0.100137903024072584E+06, 0.100153035210029513E+06, 0.100168028234449826E+06, 0.100182528489386037E+06, - 0.100196311615898419E+06, 0.100209129758123207E+06, 0.100220714305906484E+06, 0.100227674075086179E+06, 0.100228582862959636E+06, - 0.100228182141282334E+06, 0.100226441566948473E+06, 0.100223301716988630E+06, 0.100218680617939594E+06, 0.100212480375930187E+06, - 0.100204593660852275E+06, 0.100193237399701000E+06, 0.100179608999797390E+06, 0.100163806561057383E+06, 0.100145763706322687E+06, - 0.100124166108882637E+06, 0.100097853920290698E+06, 0.100069603397772837E+06, 0.100039598196173276E+06, 0.100008052525304520E+06, - 0.999752085984543955E+05, 0.999413336779185047E+05, 0.999067168729345140E+05, 0.998716658233869821E+05, 0.998365033809807937E+05, - 0.998015643788216548E+05, 0.997673503212209471E+05, 0.997368095318123815E+05, 0.997072417009385681E+05, 0.996789372306682053E+05, - 0.996521942416031088E+05, 0.996273141486202512E+05, 0.996045978845247591E+05, 0.101067589111213412E+06, 0.101018770688517165E+06, - 0.100968154311929655E+06, 0.100916004392167699E+06, 0.100862587963118029E+06, 0.100807829042751429E+06, 0.100751860689524168E+06, - 0.100694824678955032E+06, 0.100636870575220571E+06, 0.100578085861079686E+06, 0.100518387120511878E+06, 0.100457910498338359E+06, - 0.100396827710058526E+06, 0.100335334776766380E+06, 0.100273650785659062E+06, 0.100212016619918053E+06, 0.100150693670614579E+06, - 0.100089962540906286E+06, 0.100030121749858867E+06, 0.999714864397286292E+05, 0.999143870864777564E+05, 0.998591682086720684E+05, - 0.998061870647466858E+05, 0.997614041189860436E+05, 0.997232133410041570E+05, 0.996877601571912237E+05, 0.996550329117300425E+05, - 0.996250097998356068E+05, 0.995976585142769036E+05, 0.995729358349222894E+05, 0.995507871467952355E+05, 0.995311458738776855E+05, - 0.995139328178480646E+05, 0.994990553930397000E+05, 0.994864067510919558E+05, 0.994758647909620777E+05, 0.994662936172032933E+05, - 0.994584116138104437E+05, 0.994520440064580325E+05, 0.994469670430250553E+05, 0.994429511205758317E+05, 0.994397638951787376E+05, - 0.994371735196124209E+05, 0.994349519828108314E+05, 0.994328785098660155E+05, 0.994307429622300406E+05, 0.994283491541375697E+05, - 0.994255179730021191E+05, 0.994164893114872393E+05, 0.994067289084808290E+05, 0.993968888922061742E+05, 0.993871232560968492E+05, - 0.993776052903232921E+05, 0.993685268314349669E+05, 0.993600967438642401E+05, 0.993525384531912714E+05, 0.993461969112091901E+05, - 0.993435709722199681E+05, 0.993430289823759958E+05, 0.993448240458555374E+05, 0.993518125064813066E+05, 0.993620332314667612E+05, - 0.993746322170980275E+05, 0.993895541802843509E+05, 0.994066995366652700E+05, 0.994259271220238734E+05, 0.994470579336317896E+05, - 0.994698797554098419E+05, 0.994941524985713913E+05, 0.995196140617028141E+05, 0.995459864926176379E+05, 0.995729822203312797E+05, - 0.996003101205446874E+05, 0.996273070851956145E+05, 0.996547798040555062E+05, 0.996819738131592894E+05, 0.997085378998868837E+05, - 0.997343278080748278E+05, 0.997592022275180498E+05, 0.997830289890008135E+05, 0.998056904289906088E+05, 0.998270877683784638E+05, - 0.998471443932554248E+05, 0.998658079734391795E+05, 0.998830514038870024E+05, 0.998996025676379795E+05, 0.999153229697452334E+05, - 0.999295566639472963E+05, 0.999422722019988432E+05, 0.999534500054842792E+05, 0.999630795823789667E+05, 0.999711562553596450E+05, - 0.999776774721563124E+05, 0.999826387612595136E+05, 0.999854644320731022E+05, 0.999828794177739328E+05, 0.999789847225893318E+05, - 0.999739838414557307E+05, 0.999680998532223457E+05, 0.999615553821963986E+05, 0.999545658866950980E+05, 0.999473341203756863E+05, - 0.999400456392968772E+05, 0.999327953721481608E+05, 0.999256989141568774E+05, 0.999189700236989156E+05, 0.999127048128768074E+05, - 0.999069798769329791E+05, 0.999018544683639047E+05, 0.998973722234758170E+05, 0.998935621850836178E+05, 0.998904388907014218E+05, - 0.998896448727687675E+05, 0.998900344972452294E+05, 0.998911970826382749E+05, 0.998931396187662176E+05, 0.998958769268335309E+05, - 0.998994275255013781E+05, 0.999038084460577520E+05, 0.999090289824781794E+05, 0.999150833667861443E+05, 0.999217240524284571E+05, - 0.999282473433497362E+05, 0.999348833579850179E+05, 0.999415375242985901E+05, 0.999481154404054105E+05, 0.999545171017064131E+05, - 0.999606302661866066E+05, 0.999663230149861483E+05, 0.999714356178636663E+05, 0.999757718627941504E+05, 0.999790900530105428E+05, - 0.999810939111108019E+05, 0.999819561511524662E+05, 0.999789948862129386E+05, 0.999752827398946683E+05, 0.999708888630344300E+05, - 0.999658466886194801E+05, 0.999601566475907457E+05, 0.999537895884533064E+05, 0.999466907368066168E+05, 0.999387840276392963E+05, - 0.999299766462147236E+05, 0.999201636218782805E+05, 0.999092323322767916E+05, 0.998970667923400615E+05, 0.998831789013588714E+05, - 0.998636939941647142E+05, 0.998431119746374316E+05, 0.998214963412640354E+05, 0.997970862666926550E+05, 0.997712444170942908E+05, - 0.997445906917362154E+05, 0.997173029439411330E+05, 0.996895795051780588E+05, 0.996616375682111830E+05, 0.996337113354519679E+05, - 0.996060500180081726E+05, 0.995789157595469587E+05, 0.995557562522905791E+05, 0.995337048495515774E+05, 0.995126888312002120E+05, - 0.994929130817774712E+05, 0.994745951235418033E+05, 0.994579612022724759E+05, 0.994432427594338078E+05, 0.101021034351216382E+06, - 0.100974523158164724E+06, 0.100926407272977900E+06, 0.100876804093661282E+06, 0.100825841471867636E+06, 0.100773656698396328E+06, - 0.100720395485641522E+06, 0.100666210969990992E+06, 0.100612099345619077E+06, 0.100557249279083626E+06, 0.100501677971650905E+06, - 0.100445572670880414E+06, 0.100389253853780203E+06, 0.100332968905338319E+06, 0.100276665148379936E+06, 0.100220537893264976E+06, - 0.100164799821054621E+06, 0.100109679736971462E+06, 0.100055421257730064E+06, 0.100002281430952105E+06, 0.999505292822571937E+05, - 0.999004442827473104E+05, 0.998530843548639095E+05, 0.998156761219489854E+05, 0.997805278523404413E+05, 0.997476323427424795E+05, - 0.997169731242686539E+05, 0.996885239311042969E+05, 0.996622481616842706E+05, 0.996380983225617529E+05, 0.996160154459489713E+05, - 0.995959284728124476E+05, 0.995777535943772964E+05, 0.995613935458951310E+05, 0.995467368475156691E+05, 0.995336569880241732E+05, - 0.995208266243795515E+05, 0.995087482639954542E+05, 0.994977965334250039E+05, 0.994878249241337762E+05, 0.994786826211323350E+05, - 0.994702168427006691E+05, 0.994622751834644587E+05, 0.994547079083998542E+05, 0.994473701327138842E+05, 0.994401238077413873E+05, - 0.994328394160198222E+05, 0.994254188335577346E+05, 0.994184404922492249E+05, 0.994087127432848210E+05, 0.993987930235803360E+05, - 0.993894574291334138E+05, 0.993808966627234331E+05, 0.993733080854502186E+05, 0.993668924009867187E+05, 0.993618498078672274E+05, - 0.993583756460734730E+05, 0.993566555807828554E+05, 0.993568603838800627E+05, 0.993591403923829785E+05, 0.993636197419046657E+05, - 0.993703904921866488E+05, 0.993811197203903430E+05, 0.993950856599565304E+05, 0.994111457979586703E+05, 0.994291602554974379E+05, - 0.994489675444759632E+05, 0.994703876196585625E+05, 0.994932253351752443E+05, 0.995172741944998997E+05, 0.995426559018634871E+05, - 0.995694776827033347E+05, 0.995970389008766942E+05, 0.996251091056232981E+05, 0.996534496905636333E+05, 0.996818187512539298E+05, - 0.997099760279327893E+05, 0.997374141751707793E+05, 0.997622618739524623E+05, 0.997862435467323085E+05, 0.998092414887019404E+05, - 0.998311505958143825E+05, 0.998518805596518214E+05, 0.998718102890837035E+05, 0.998910750046514877E+05, 0.999090219912788452E+05, - 0.999255559670365765E+05, 0.999405919139345788E+05, 0.999540538378546335E+05, 0.999658730563341524E+05, 0.999759860512857849E+05, - 0.999843319314751134E+05, 0.999908495555851987E+05, 0.999954743712658383E+05, 0.999944404784162907E+05, 0.999915968456238916E+05, - 0.999872439634975599E+05, 0.999816171531630534E+05, 0.999749362615833961E+05, 0.999674042229870247E+05, 0.999592064518093102E+05, - 0.999505109123499715E+05, 0.999414687118180882E+05, 0.999323665105546679E+05, 0.999233975283402833E+05, 0.999144981369005836E+05, - 0.999058003303556034E+05, 0.998974241845954093E+05, 0.998894782591478870E+05, 0.998820595750179200E+05, 0.998752530846157169E+05, - 0.998691305778080132E+05, 0.998637489957377547E+05, 0.998586746844062873E+05, 0.998541772928227729E+05, 0.998502966627068381E+05, - 0.998469966131329420E+05, 0.998442320106148400E+05, 0.998419453691209637E+05, 0.998400626589490130E+05, 0.998384883490106731E+05, - 0.998370997211475333E+05, 0.998357405118142487E+05, 0.998339247931384743E+05, 0.998316580178510631E+05, 0.998293639855545480E+05, - 0.998269017565975373E+05, 0.998241201967542729E+05, 0.998208528853709577E+05, 0.998098081032783375E+05, 0.997954370825381193E+05, - 0.997808296869748592E+05, 0.997662255405725009E+05, 0.997518145513712225E+05, 0.997377288090598740E+05, 0.997240360167264153E+05, - 0.997115902471897134E+05, 0.997002807779587602E+05, 0.996889928911353927E+05, 0.996776906921413611E+05, 0.996663184120892256E+05, - 0.996548031405013462E+05, 0.996430577981460665E+05, 0.996309842516777717E+05, 0.996172720856796950E+05, 0.995989960463366879E+05, - 0.995803026148819772E+05, 0.995612677891255880E+05, 0.995419614978694444E+05, 0.995224517021402135E+05, 0.995028080337064894E+05, - 0.994831049415358284E+05, 0.994634243322594411E+05, 0.994438577049017331E+05, 0.994245077928505052E+05, 0.994054897371244297E+05, - 0.993869318243143207E+05, 0.993690043020055746E+05, 0.993554308490509575E+05, 0.993412332136938494E+05, 0.993276308539287711E+05, - 0.993151162456799066E+05, 0.993038276851009432E+05, 0.992939167429839872E+05, 0.992855451787946949E+05, 0.992788820449725754E+05, - 0.100964847544612581E+06, 0.100921528597807934E+06, 0.100876819617514033E+06, 0.100830819119977881E+06, 0.100783635790840315E+06, - 0.100735387872604493E+06, 0.100686849362626730E+06, 0.100638850722815405E+06, 0.100589987206303587E+06, 0.100540391690949080E+06, - 0.100490207838124057E+06, 0.100439589213655403E+06, 0.100388698427470110E+06, 0.100337706295036201E+06, 0.100286791022897989E+06, - 0.100236137419730803E+06, 0.100185936133379830E+06, 0.100136382913311769E+06, 0.100087677896791603E+06, 0.100040024915916016E+06, - 0.999936308213850425E+05, 0.999487048175969685E+05, 0.999098959263045108E+05, 0.998760905821691704E+05, 0.998440744381323602E+05, - 0.998138388707919803E+05, 0.997853639904371375E+05, 0.997586190608742472E+05, 0.997335630315415328E+05, 0.997101451748205582E+05, - 0.996883058208672010E+05, 0.996679771815481945E+05, 0.996490842541338643E+05, 0.996315457942174835E+05, 0.996152753458579973E+05, - 0.996001823151213321E+05, 0.995855679555827810E+05, 0.995705558364965109E+05, 0.995563634129148850E+05, 0.995429286082849721E+05, - 0.995301928975228802E+05, 0.995181034121451230E+05, 0.995066149374921079E+05, 0.994956917495421949E+05, 0.994853092368055950E+05, - 0.994754552514231473E+05, 0.994661311329740856E+05, 0.994573523487461207E+05, 0.994491486954472930E+05, 0.994415640096655407E+05, - 0.994332401191460376E+05, 0.994242851325149240E+05, 0.994162875697421550E+05, 0.994093942955236271E+05, 0.994037502528714977E+05, - 0.993994957235938200E+05, 0.993967633485402912E+05, 0.993956749460767023E+05, 0.993963381773120200E+05, 0.993988431167032832E+05, - 0.994032587965396087E+05, 0.994096298031491460E+05, 0.994179730111528625E+05, 0.994282745493404218E+05, 0.994404870973938814E+05, - 0.994568186139204772E+05, 0.994754658271223161E+05, 0.994958964449326450E+05, 0.995177045414582390E+05, 0.995407458140571835E+05, - 0.995648609237595665E+05, 0.995898777201360062E+05, 0.996156137473152776E+05, 0.996418789751202567E+05, 0.996684786927591776E+05, - 0.996952164972683240E+05, 0.997218973051197536E+05, 0.997483303132390720E+05, 0.997743318352098577E+05, 0.997997279397391831E+05, - 0.998243568215117266E+05, 0.998484029817739647E+05, 0.998715185643880104E+05, 0.998929709407826740E+05, 0.999121391071011894E+05, - 0.999300598538423073E+05, 0.999466118827012979E+05, 0.999616803026846756E+05, 0.999751558213879034E+05, 0.999869336418048333E+05, - 0.999969120922718139E+05, 0.100004991024896648E+06, 0.100011070025070803E+06, 0.100011361902027944E+06, 0.100009689874259901E+06, - 0.100006354866167210E+06, 0.100001521961853068E+06, 0.999953569047140481E+05, 0.999880229251482233E+05, 0.999796782529097254E+05, - 0.999704742484093149E+05, 0.999605540801449097E+05, 0.999500518713602651E+05, 0.999395620634615480E+05, 0.999293797224061564E+05, - 0.999189780037119199E+05, 0.999084634603603772E+05, 0.998979305732036155E+05, 0.998874607924644370E+05, 0.998771215026191203E+05, - 0.998669648551638238E+05, 0.998570264274643996E+05, 0.998473236800365266E+05, 0.998378541987464268E+05, 0.998280094515223464E+05, - 0.998183015118441253E+05, 0.998087584599398106E+05, 0.997993088922536845E+05, 0.997898632369703118E+05, 0.997803110261358233E+05, - 0.997705176970055909E+05, 0.997603209573400527E+05, 0.997495267616314668E+05, 0.997338504371996823E+05, 0.997144148866953765E+05, - 0.996946194589021616E+05, 0.996748889962201501E+05, 0.996543973099300492E+05, 0.996333799061114987E+05, 0.996120632551793096E+05, - 0.995906575155593600E+05, 0.995693496108486434E+05, 0.995482968337894126E+05, 0.995276211300861032E+05, 0.995074041910853848E+05, - 0.994876834578204434E+05, 0.994684491110481467E+05, 0.994496420937635121E+05, 0.994311531852242333E+05, 0.994128231195840344E+05, - 0.993950629246981553E+05, 0.993796705843183881E+05, 0.993609699415756186E+05, 0.993418055421917088E+05, 0.993226794637357671E+05, - 0.993037059687493893E+05, 0.992849845648908376E+05, 0.992666033190360467E+05, 0.992486420429716236E+05, 0.992311752996093419E+05, - 0.992142751883332967E+05, 0.991980138777397078E+05, 0.991824658634138323E+05, 0.991677099373037345E+05, 0.991538308635238063E+05, - 0.991409207629147422E+05, 0.991303845164175582E+05, 0.991233478553789610E+05, 0.991173123854586884E+05, 0.991122941300806997E+05, - 0.991083274217430298E+05, 0.991054636978437338E+05, 0.991037699911700765E+05, 0.991033272031231463E+05, 0.991042282352598704E+05, - 0.991065760427079076E+05, 0.100899327711180042E+06, 0.100860014589195416E+06, 0.100819531202107522E+06, 0.100777959510744709E+06, - 0.100735390607726556E+06, 0.100694036465613695E+06, 0.100652089405901919E+06, 0.100609367247066592E+06, 0.100565963600471325E+06, - 0.100521982301190656E+06, 0.100477536683349797E+06, 0.100432748853070138E+06, 0.100387748961175384E+06, 0.100342674477306704E+06, - 0.100297669466538631E+06, 0.100252883868987425E+06, 0.100208472782261073E+06, 0.100164595745919316E+06, 0.100121416026401625E+06, - 0.100079099900142377E+06, 0.100037815931840771E+06, 0.999981416469988617E+05, 0.999662389876496309E+05, 0.999356748708466621E+05, - 0.999064575822306797E+05, 0.998785877324428584E+05, 0.998520583580002858E+05, 0.998268551135048328E+05, 0.998029565487271466E+05, - 0.997803344633126544E+05, 0.997589543309666333E+05, 0.997387757839643018E+05, 0.997197531476882141E+05, 0.997018360135869007E+05, - 0.996849698374662257E+05, 0.996690965483438340E+05, 0.996541551512074802E+05, 0.996382689559327409E+05, 0.996225861026435014E+05, - 0.996075569737299666E+05, 0.995931690202676109E+05, 0.995794128974490304E+05, 0.995662834351470083E+05, 0.995537804808199580E+05, - 0.995419095816340414E+05, 0.995306824727639178E+05, 0.995201173394836951E+05, 0.995102388219246932E+05, 0.995010777333177539E+05, - 0.994926704652096669E+05, 0.994850580565927958E+05, 0.994782849081547320E+05, 0.994712945317966660E+05, 0.994652135801002441E+05, - 0.994603804881314572E+05, 0.994568932856863394E+05, 0.994548423780885496E+05, 0.994543085284921108E+05, 0.994553608083860745E+05, - 0.994580545552721160E+05, 0.994624293810699601E+05, 0.994689205148530309E+05, 0.994771599445407046E+05, 0.994871232315969537E+05, - 0.994987933987223369E+05, 0.995121358180468815E+05, 0.995270974554495333E+05, 0.995436065119199775E+05, 0.995623452046183083E+05, - 0.995829609157189843E+05, 0.996045871363499173E+05, 0.996270734208106005E+05, 0.996502628846515872E+05, 0.996739938804089179E+05, - 0.996981017517049913E+05, 0.997224206254554738E+05, 0.997467852001343563E+05, 0.997710324871725461E+05, 0.997951466602976434E+05, - 0.998195365345201863E+05, 0.998432686447168817E+05, 0.998661797675172566E+05, 0.998881192989034753E+05, 0.999089497794278432E+05, - 0.999285470134942298E+05, 0.999467997752335650E+05, 0.999636091025751084E+05, 0.999788871899545629E+05, 0.999925558984901872E+05, - 0.100004544910230834E+06, 0.100014789560105870E+06, 0.100022807416958167E+06, 0.100024265952704969E+06, 0.100023783498597622E+06, - 0.100021339437537274E+06, 0.100017269778783608E+06, 0.100011871918673860E+06, 0.100005243624383627E+06, 0.999974886843563872E+05, - 0.999887143337349553E+05, 0.999790290942598513E+05, 0.999685409989449690E+05, 0.999573561671147618E+05, 0.999457665900857537E+05, - 0.999339297350767738E+05, 0.999216537925987359E+05, 0.999089986755408318E+05, 0.998960156700364460E+05, 0.998827458376240684E+05, - 0.998692184851955972E+05, 0.998554496711306274E+05, 0.998414407220986322E+05, 0.998266607131311466E+05, 0.998100194463602238E+05, - 0.997926225952954846E+05, 0.997741943883323111E+05, 0.997546758201429911E+05, 0.997340957313024119E+05, 0.997124527623238246E+05, - 0.996897658681415196E+05, 0.996660748766462057E+05, 0.996414402768971777E+05, 0.996159421531026164E+05, 0.995896781945527619E+05, - 0.995627607309631567E+05, 0.995353127665240754E+05, 0.995074630135256157E+05, 0.994793399566985754E+05, 0.994514054125879338E+05, - 0.994238487412724935E+05, 0.993966902679466439E+05, 0.993700475395201356E+05, 0.993440177799105440E+05, 0.993186743649216805E+05, - 0.992940638036397431E+05, 0.992702032829608506E+05, 0.992470788181921816E+05, 0.992246440384727030E+05, 0.992011645870204229E+05, - 0.991746701100545615E+05, 0.991489545634662645E+05, 0.991241218039765226E+05, 0.991002500071589602E+05, 0.990773923979805404E+05, - 0.990555784783537238E+05, 0.990348157029355934E+05, 0.990159736965085758E+05, 0.989981835313982592E+05, 0.989814199610305950E+05, - 0.989657585620708269E+05, 0.989512713805230014E+05, 0.989380287548638735E+05, 0.989261010103145527E+05, 0.989155600070171640E+05, - 0.989065271083586849E+05, 0.989035472935256403E+05, 0.989017382893972535E+05, 0.989010885106625501E+05, 0.989015950018414442E+05, - 0.989032643180148880E+05, 0.989061129372854630E+05, 0.989101672753579624E+05, 0.989154633681022387E+05, 0.989220462827519368E+05, - 0.989299693127524224E+05, 0.989392930054068274E+05, 0.100824204136130124E+06, 0.100789629875414903E+06, 0.100754101269738283E+06, - 0.100718965766187423E+06, 0.100683784943369043E+06, 0.100647901733698469E+06, 0.100611367338035154E+06, 0.100574242617115160E+06, - 0.100536597536512694E+06, 0.100498510595931759E+06, 0.100460068244709808E+06, 0.100421364285146075E+06, 0.100382499264969942E+06, - 0.100343579859943900E+06, 0.100304718247249199E+06, 0.100266031469940950E+06, 0.100227640792377366E+06, 0.100189671046138596E+06, - 0.100152249965554060E+06, 0.100115507511560325E+06, 0.100079575182221481E+06, 0.100047602801154819E+06, 0.100019322376832803E+06, - 0.999920409995853261E+05, 0.999657674355637573E+05, 0.999405058915761474E+05, 0.999162559646318405E+05, 0.998930126550737332E+05, - 0.998707664374257292E+05, 0.998495033822863334E+05, 0.998292053217475768E+05, 0.998098500498988724E+05, 0.997914115489896358E+05, - 0.997738602307620895E+05, 0.997571631813267886E+05, 0.997412843967411318E+05, 0.997261849951640761E+05, 0.997116241750995250E+05, - 0.996956516613714484E+05, 0.996802443385057850E+05, 0.996654141346137912E+05, 0.996511746410201595E+05, 0.996375414807133056E+05, - 0.996245325880948803E+05, 0.996121683814974822E+05, 0.996004718105865177E+05, 0.995894682617738144E+05, 0.995791853061816655E+05, - 0.995696522765213740E+05, 0.995608996615122596E+05, 0.995529583091799286E+05, 0.995458584335334599E+05, 0.995396284227406868E+05, - 0.995343367855710967E+05, 0.995305561580702051E+05, 0.995281233336275036E+05, 0.995270277929425938E+05, 0.995273063084702299E+05, - 0.995289897428417025E+05, 0.995321019769720151E+05, 0.995366588694784150E+05, 0.995426672761023801E+05, 0.995501241589093697E+05, - 0.995590158153962548E+05, 0.995693172571642208E+05, 0.995809917664462992E+05, 0.995939906564428093E+05, 0.996082532580851985E+05, - 0.996237071514999261E+05, 0.996402686551040679E+05, 0.996578435789826035E+05, 0.996763282420650648E+05, 0.996956299728876329E+05, - 0.997162410862197139E+05, 0.997372387307632453E+05, 0.997586353656998253E+05, 0.997808433601890720E+05, 0.998030187608370179E+05, - 0.998249872889569233E+05, 0.998465794208683947E+05, 0.998676313277232548E+05, 0.998879856224390824E+05, 0.999074918951320724E+05, - 0.999260070231147402E+05, 0.999433952465451439E+05, 0.999595280060564692E+05, 0.999742835440646595E+05, 0.999875462768208236E+05, - 0.999992059495608264E+05, 0.100009156592205647E+06, 0.100016063172606460E+06, 0.100019024917317467E+06, 0.100020084175617667E+06, - 0.100019327613303438E+06, 0.100016848817808917E+06, 0.100012745044390162E+06, 0.100007114161981110E+06, 0.100000051820447916E+06, - 0.999916488518789411E+05, 0.999819889104085451E+05, 0.999711463483044645E+05, 0.999591843210265215E+05, 0.999461531109617499E+05, - 0.999321525809828890E+05, 0.999172469778668019E+05, 0.999013989306642325E+05, 0.998846455567706289E+05, 0.998670119376398798E+05, - 0.998485130268999492E+05, 0.998291555936072982E+05, 0.998089401641651202E+05, 0.997878629283593327E+05, 0.997659175757975609E+05, - 0.997430970289848337E+05, 0.997193950386116485E+05, 0.996948076057053986E+05, 0.996688019987970183E+05, 0.996412728663371527E+05, - 0.996128531282160839E+05, 0.995835822131826571E+05, 0.995535100083936413E+05, 0.995226963046177698E+05, 0.994912096890770918E+05, - 0.994591258685886423E+05, 0.994265254172218556E+05, 0.993934909557864739E+05, 0.993601037847762636E+05, 0.993264400074980804E+05, - 0.992925661955399555E+05, 0.992585346639741329E+05, 0.992243784382298763E+05, 0.991926785386021656E+05, 0.991631423960881948E+05, - 0.991346701590620942E+05, 0.991043957205902552E+05, 0.990738404866020282E+05, 0.990437385072277393E+05, 0.990142493709584378E+05, - 0.989855195191612147E+05, 0.989576810877346288E+05, 0.989308511084253696E+05, 0.989051310684979690E+05, 0.988806068206827622E+05, - 0.988573488291608082E+05, 0.988354127318868268E+05, 0.988148401948802202E+05, 0.987956600302788138E+05, 0.987778895469693816E+05, - 0.987615361004738952E+05, 0.987465988074585912E+05, 0.987330703896907362E+05, 0.987209391124356771E+05, 0.987108234055703360E+05, - 0.987097019913824042E+05, 0.987103429529451387E+05, 0.987122111650228762E+05, 0.987153073516145814E+05, 0.987196321217762743E+05, - 0.987251875827369804E+05, 0.987319785667343094E+05, 0.987400135082831985E+05, 0.987493050090511242E+05, 0.987598701271371101E+05, - 0.987717304264797713E+05, 0.987849118205066625E+05, 0.987994442421061685E+05, 0.100725315299336173E+06, 0.100698574995327697E+06, - 0.100671977068823689E+06, 0.100644595052366465E+06, 0.100616468093977863E+06, 0.100587642901921921E+06, 0.100558173361375360E+06, - 0.100528120104899528E+06, 0.100497550042423565E+06, 0.100466272904751735E+06, 0.100434015096099785E+06, 0.100401562459773442E+06, - 0.100368989820934105E+06, 0.100336376879503077E+06, 0.100303807689072302E+06, 0.100271370122519947E+06, 0.100239155324566673E+06, - 0.100207257151323618E+06, 0.100175771596705425E+06, 0.100144796205413048E+06, 0.100114429472040734E+06, 0.100088940515445298E+06, - 0.100064277849083956E+06, 0.100040376776062651E+06, 0.100017243413296688E+06, 0.999948816446533019E+05, 0.999732929686431889E+05, - 0.999524763863759727E+05, 0.999324283249947912E+05, 0.999131425911760016E+05, 0.998946103486297798E+05, 0.998768201128693472E+05, - 0.998597577558295598E+05, 0.998434065122163738E+05, 0.998277469787591108E+05, 0.998127570968272776E+05, 0.997984121081719059E+05, - 0.997846844728672440E+05, 0.997711641937448148E+05, 0.997562547182444541E+05, 0.997418715469619347E+05, 0.997280378138771339E+05, - 0.997149197421024874E+05, 0.997024870178837737E+05, 0.996907061322415975E+05, 0.996795848806745926E+05, 0.996691347733205621E+05, - 0.996593714260480774E+05, 0.996503148183509184E+05, 0.996419894088608416E+05, 0.996344241017298482E+05, 0.996276520598402276E+05, - 0.996217103637612599E+05, 0.996166395185360743E+05, 0.996124828137155564E+05, 0.996092855454927922E+05, 0.996072490608482622E+05, - 0.996076113749229989E+05, 0.996091697144805221E+05, 0.996119324075692421E+05, 0.996159015340781625E+05, 0.996210724174448842E+05, - 0.996274331797853811E+05, 0.996349643746027868E+05, 0.996436387104583700E+05, 0.996534208777727908E+05, 0.996642674892599607E+05, - 0.996761271423777071E+05, 0.996889406096304010E+05, 0.997026411596077960E+05, 0.997171550083373149E+05, 0.997324018969322351E+05, - 0.997493713951271493E+05, 0.997669298086039198E+05, 0.997847561118552549E+05, 0.998027246306509041E+05, 0.998207116516734968E+05, - 0.998385964503245486E+05, 0.998562622533936083E+05, 0.998740649961419404E+05, 0.998916906165886030E+05, 0.999087089343172702E+05, - 0.999249770553750277E+05, 0.999403560696216737E+05, 0.999547111717594089E+05, 0.999679116588610341E+05, 0.999798308071318752E+05, - 0.999903456338236865E+05, 0.999993365533926699E+05, 0.100004220125714884E+06, 0.100007207317976179E+06, 0.100008572293640507E+06, - 0.100008322094038289E+06, 0.100006474067698131E+06, 0.100003053654514384E+06, 0.999980922203631635E+05, 0.999916249686873634E+05, - 0.999836889524048456E+05, 0.999743212064066029E+05, 0.999635570180646901E+05, 0.999514283507113723E+05, 0.999379624331032392E+05, - 0.999231805265346338E+05, 0.999068710521996836E+05, 0.998889830637409177E+05, 0.998698844492443604E+05, 0.998496268247692351E+05, - 0.998282550606056902E+05, 0.998058081407207792E+05, 0.997823201056188700E+05, 0.997578210428315797E+05, 0.997323380908236431E+05, - 0.997058964236216998E+05, 0.996785201849737350E+05, 0.996502333423933014E+05, 0.996210604331023060E+05, 0.995910271757503942E+05, - 0.995601609239409008E+05, 0.995275572850741737E+05, 0.994942010526460217E+05, 0.994602086162104097E+05, 0.994256424562004540E+05, - 0.993905674250224547E+05, 0.993550495610398939E+05, 0.993191545857771562E+05, 0.992829460972773086E+05, 0.992464834802344849E+05, - 0.992093627746182028E+05, 0.991704192318807618E+05, 0.991313574404489191E+05, 0.990923405318182195E+05, 0.990535358095906413E+05, - 0.990151121756168286E+05, 0.989772373919561505E+05, 0.989400752255912812E+05, 0.989077617710938066E+05, 0.988763612273478793E+05, - 0.988459508623079601E+05, 0.988166439660097676E+05, 0.987885464355162840E+05, 0.987617561295779306E+05, 0.987363624383705755E+05, - 0.987124460655073344E+05, 0.986900790161369223E+05, 0.986693247818405216E+05, 0.986502387102765642E+05, 0.986328685451310157E+05, - 0.986172551199377485E+05, 0.986034331877511868E+05, 0.985914323674813641E+05, 0.985849022212989948E+05, 0.985815381689221977E+05, - 0.985799833097597439E+05, 0.985801745721993211E+05, 0.985820463347552868E+05, 0.985855324877461535E+05, 0.985905682465279388E+05, - 0.985970917144189152E+05, 0.986050451971537113E+05, 0.986143762739106751E+05, 0.986250386326789885E+05, 0.986369926800004905E+05, - 0.986502059369656636E+05, 0.986646532347960892E+05, 0.986803686823803437E+05, 0.986978893846687570E+05, 0.100614832696455240E+06, - 0.100593867821148029E+06, 0.100572316446986515E+06, 0.100550197550235505E+06, 0.100527535703133908E+06, 0.100504360904461792E+06, - 0.100480708372667563E+06, 0.100456618304392017E+06, 0.100432135601374786E+06, 0.100407309568833982E+06, 0.100382193588466369E+06, - 0.100356844769226343E+06, 0.100331323579001226E+06, 0.100305693460217895E+06, 0.100280020432285120E+06, 0.100254372683605921E+06, - 0.100228820155686772E+06, 0.100203434121630358E+06, 0.100178286761032883E+06, 0.100153450733022924E+06, 0.100130475669895299E+06, - 0.100109956889046269E+06, 0.100089889070985242E+06, 0.100070296914338702E+06, 0.100051202164876013E+06, 0.100032623579079911E+06, - 0.100014576934231576E+06, 0.999970750815462088E+05, 0.999801280379814852E+05, 0.999637431114950741E+05, 0.999479250537698827E+05, - 0.999326762337752152E+05, 0.999179968250171223E+05, 0.999038849989644077E+05, 0.998903371169458405E+05, 0.998773479128125327E+05, - 0.998649106588674185E+05, 0.998530173079915839E+05, 0.998416586055586959E+05, 0.998308241656294995E+05, 0.998183931314519723E+05, - 0.998063026544255990E+05, 0.997946768033270637E+05, 0.997835353574148758E+05, 0.997728988116216497E+05, 0.997627886474906263E+05, - 0.997532275467060972E+05, 0.997442395412217011E+05, 0.997358500950898597E+05, 0.997280861143391958E+05, 0.997209758826208854E+05, - 0.997145489218259900E+05, 0.997088357784521941E+05, 0.997038677381365414E+05, 0.996996764724488748E+05, 0.996962936237215035E+05, - 0.996937503353465436E+05, 0.996920767365576030E+05, 0.996913013921977254E+05, 0.996914507293131610E+05, 0.996938892044791864E+05, - 0.996979235599974199E+05, 0.997029058021154924E+05, 0.997088141832942201E+05, 0.997156214047231770E+05, 0.997232945456081070E+05, - 0.997317950535919081E+05, 0.997416867970129533E+05, 0.997530959050235106E+05, 0.997652059203542885E+05, 0.997779192013086576E+05, - 0.997911354948921798E+05, 0.998047524629107502E+05, 0.998186662279794255E+05, 0.998327719289349043E+05, 0.998469642740837880E+05, - 0.998611380798811879E+05, 0.998751887820599950E+05, 0.998890129059611209E+05, 0.999025084828911640E+05, 0.999155753997843713E+05, - 0.999281156702924636E+05, 0.999400336166881025E+05, 0.999512359536410950E+05, 0.999616317670096760E+05, 0.999711323832548660E+05, - 0.999796511279028782E+05, 0.999849269357346784E+05, 0.999879656837563089E+05, 0.999896251175745128E+05, 0.999900253003605030E+05, - 0.999893361854775139E+05, 0.999873542140159407E+05, 0.999840556297011499E+05, 0.999794245840091753E+05, 0.999734518744631496E+05, - 0.999661337157758971E+05, 0.999574705623641785E+05, 0.999474659997932467E+05, 0.999361257217314414E+05, 0.999234566080410732E+05, - 0.999094659187412326E+05, 0.998941606177814683E+05, 0.998764809352623415E+05, 0.998560560817922524E+05, 0.998343967946635821E+05, - 0.998115510889874568E+05, 0.997875653304692096E+05, 0.997624843255732849E+05, 0.997363514996802405E+05, 0.997092091386610118E+05, - 0.996810986700549984E+05, 0.996520609610099054E+05, 0.996221366113048280E+05, 0.995913662211383053E+05, 0.995597906149207993E+05, - 0.995273916799414146E+05, 0.994941482859833632E+05, 0.994601365478679945E+05, 0.994253058448178053E+05, 0.993891469979643734E+05, - 0.993522589965478983E+05, 0.993147135957212886E+05, 0.992765913082987827E+05, 0.992379812368316198E+05, 0.991989807125657680E+05, - 0.991596947441791563E+05, 0.991202352822574612E+05, 0.990807203086648369E+05, 0.990412727632243623E+05, 0.990020193233719183E+05, - 0.989630890556004597E+05, 0.989246119604841224E+05, 0.988867174357804033E+05, 0.988495326844704396E+05, 0.988131810965392942E+05, - 0.987777806347563455E+05, 0.987434422556348145E+05, 0.987102683970903163E+05, 0.986800386904530314E+05, 0.986539370199152036E+05, - 0.986295226205249346E+05, 0.986068636404624995E+05, 0.985860239517589507E+05, 0.985670631337701197E+05, 0.985500365691113984E+05, - 0.985358556718200416E+05, 0.985278808654735767E+05, 0.985216145256253949E+05, 0.985170549437755544E+05, 0.985141907191163773E+05, - 0.985130023621957516E+05, 0.985134638334888878E+05, 0.985155439987927239E+05, 0.985192079865073320E+05, 0.985244184348827694E+05, - 0.985311366201568162E+05, 0.985393234591571963E+05, 0.985489403823850007E+05, 0.985599500758101349E+05, 0.985723170916025701E+05, - 0.985860083297847013E+05, 0.986009933943283249E+05, 0.986172448285415594E+05, 0.986347382357068564E+05, 0.986534522918489238E+05, - 0.100501068864754794E+06, 0.100484535396120875E+06, 0.100467601980879481E+06, 0.100450280398188552E+06, 0.100432586236747622E+06, - 0.100414538813697291E+06, 0.100396161067221547E+06, 0.100377479424244724E+06, 0.100358523644725865E+06, 0.100339326644139262E+06, - 0.100319924295798162E+06, 0.100300355214719486E+06, 0.100280660524754756E+06, 0.100260883610713514E+06, 0.100241069857193317E+06, - 0.100221266375801104E+06, 0.100201521722408346E+06, 0.100181885606032156E+06, 0.100162408590875246E+06, 0.100143141793000657E+06, - 0.100126731204709198E+06, 0.100111095964644017E+06, 0.100095755686584438E+06, 0.100080729264227775E+06, 0.100066034373636823E+06, - 0.100051687390123538E+06, 0.100037703324969872E+06, 0.100024095780550211E+06, 0.100010876922054129E+06, 0.999980574636844394E+05, - 0.999856466669404908E+05, 0.999736523483940109E+05, 0.999620808942374570E+05, 0.999509372788386972E+05, 0.999402250845782837E+05, - 0.999299465203828877E+05, 0.999201024366045604E+05, 0.999106923342315858E+05, 0.999017143668564822E+05, 0.998931653343625367E+05, - 0.998850406679233711E+05, 0.998765024783978733E+05, 0.998667989571770595E+05, 0.998574263414941233E+05, 0.998484104846885893E+05, - 0.998397772139483568E+05, 0.998315523922983994E+05, 0.998237619509676297E+05, 0.998164318901620281E+05, 0.998095882469221542E+05, - 0.998032570294378238E+05, 0.997974641179290484E+05, 0.997922351329589583E+05, 0.997875952728177945E+05, 0.997835691223818721E+05, - 0.997801804366022552E+05, 0.997774519024890033E+05, 0.997754048841174226E+05, 0.997740591557720181E+05, 0.997734326288465818E+05, - 0.997735410785172280E+05, 0.997747073495277582E+05, 0.997769755457649590E+05, 0.997800038461367949E+05, 0.997839110555756342E+05, - 0.997903666077980015E+05, 0.997975557260811329E+05, 0.998054075409305369E+05, 0.998138481350147340E+05, 0.998228007968337915E+05, - 0.998321862933507946E+05, 0.998419231581400672E+05, 0.998519279910743644E+05, 0.998621157651026879E+05, 0.998724001352771593E+05, - 0.998826937448957033E+05, 0.998929085234460072E+05, 0.999029559709882014E+05, 0.999127474237070273E+05, 0.999221942956127314E+05, - 0.999312082917789958E+05, 0.999397015890797338E+05, 0.999475869811254670E+05, 0.999547779849950166E+05, 0.999611889084034483E+05, - 0.999655508333875332E+05, 0.999687521058104176E+05, 0.999708756209590647E+05, 0.999718892905484245E+05, 0.999717672485314106E+05, - 0.999704891389138356E+05, 0.999680393573227484E+05, 0.999644062616458687E+05, 0.999595813666838658E+05, 0.999535585371076886E+05, - 0.999463331921408535E+05, 0.999379015343325445E+05, 0.999282598136142769E+05, 0.999174036365871580E+05, 0.999053273297332198E+05, - 0.998920233640268561E+05, 0.998774818472951010E+05, 0.998616900896773586E+05, 0.998432094200693391E+05, 0.998215258930813725E+05, - 0.997986442532860819E+05, 0.997746159978670912E+05, 0.997494898657428857E+05, 0.997233122677003994E+05, 0.996961277569055965E+05, - 0.996679795269207534E+05, 0.996389099249155406E+05, 0.996089609684258903E+05, 0.995781748547828611E+05, 0.995465944531801651E+05, - 0.995142637702681968E+05, 0.994812283811399975E+05, 0.994475358185973892E+05, 0.994132359146495874E+05, 0.993783810892878100E+05, - 0.993430265826917603E+05, 0.993072306281462952E+05, 0.992699361805924273E+05, 0.992322369590151648E+05, 0.991942880496349680E+05, - 0.991561790488717525E+05, 0.991180035697510175E+05, 0.990798588542613288E+05, 0.990418452912010980E+05, 0.990040658471643255E+05, - 0.989666254199359537E+05, 0.989296301250896213E+05, 0.988931865279689664E+05, 0.988574008344593603E+05, 0.988223780549877847E+05, - 0.987882211569994834E+05, 0.987550302217251592E+05, 0.987229016213559953E+05, 0.986919272327695508E+05, 0.986621937036891904E+05, - 0.986337817866148835E+05, 0.986067657550310105E+05, 0.985855251179539773E+05, 0.985675277620845591E+05, 0.985515831726142933E+05, - 0.985391751050558669E+05, 0.985310659201639937E+05, 0.985245080408891663E+05, 0.985195088048070465E+05, 0.985160685473306512E+05, - 0.985141813574870466E+05, 0.985138358391387155E+05, 0.985150158641151211E+05, 0.985177013051926042E+05, 0.985218687383599317E+05, - 0.985274921053063881E+05, 0.985345433285448526E+05, 0.985429928730166866E+05, 0.985528102493964543E+05, 0.985639644556170097E+05, - 0.985764243543491611E+05, 0.985901589852987236E+05, 0.986051378122090100E+05, 0.986213309053895937E+05, 0.986387090614195185E+05, - 0.986574141307979880E+05 + 0.101300032966540894E+06, 0.101300537463512766E+06, 0.101300575340236785E+06, 0.101300006392703450E+06, 0.101298681683129777E+06, + 0.101296357626198034E+06, 0.101291429037962458E+06, 0.101285211396584113E+06, 0.101277811769244916E+06, 0.101269604202318660E+06, + 0.101261086325391967E+06, 0.101252536774223816E+06, 0.101244258202072262E+06, 0.101236292863086681E+06, 0.101228818038673067E+06, + 0.101222576320632390E+06, 0.101217951101617422E+06, 0.101215281498123208E+06, 0.101214831830208335E+06, 0.101216756641191008E+06, + 0.101220329473252321E+06, 0.101229814720005656E+06, 0.101242852565120862E+06, 0.101257243179816374E+06, 0.101272242223526715E+06, + 0.101287023899284890E+06, 0.101300727324330161E+06, 0.101312508880994021E+06, 0.101321304787958841E+06, 0.101323045492054458E+06, + 0.101323689235454440E+06, 0.101322654817980932E+06, 0.101318546143449697E+06, 0.101311446435368038E+06, 0.101301582670344171E+06, + 0.101289313645048256E+06, 0.101272976739770951E+06, 0.101254670123119533E+06, 0.101236204711241953E+06, 0.101218525147353255E+06, + 0.101203644914472199E+06, 0.101191859002529978E+06, 0.101183427645969176E+06, 0.101178788732659857E+06, 0.101176248776911350E+06, + 0.101174781987763519E+06, 0.101173755414963452E+06, 0.101172549028196707E+06, 0.101170596810517556E+06, 0.101164899003713479E+06, + 0.101158419589045283E+06, 0.101152491572940358E+06, 0.101147843517789603E+06, 0.101145017464391334E+06, 0.101144350744426047E+06, + 0.101145965622140546E+06, 0.101150160852645960E+06, 0.101156489280060341E+06, 0.101164999288937499E+06, 0.101174680757722846E+06, + 0.101184614700939375E+06, 0.101194476866903220E+06, 0.101203847071805940E+06, 0.101212793693367261E+06, 0.101221210811864396E+06, + 0.101228967667653473E+06, 0.101235941297612240E+06, 0.101241825830798407E+06, 0.101246384813952725E+06, 0.101250233289149895E+06, + 0.101253625288606709E+06, 0.101256829767974210E+06, 0.101260135466684485E+06, 0.101263922730170481E+06, 0.101268258457290780E+06, + 0.101273173871677092E+06, 0.101278603318462468E+06, 0.101284438572224244E+06, 0.101291451901038017E+06, 0.101298825789695678E+06, + 0.101305583597361008E+06, 0.101311198590170257E+06, 0.101313106869633571E+06, 0.101311964918650119E+06, 0.101309609217350633E+06, + 0.101306588009722152E+06, 0.101303789827421686E+06, 0.101303204229508177E+06, 0.101302539808644782E+06, 0.101301748136565366E+06, + 0.101300889588588965E+06, 0.101301524026314495E+06, 0.101302253276609670E+06, 0.101302463210049027E+06, 0.101302292202795681E+06, + 0.101298302559037387E+06, 0.101291449427361382E+06, 0.101283550209983820E+06, 0.101275343284659903E+06, 0.101268451030137920E+06, + 0.101263440167506284E+06, 0.101259681043976845E+06, 0.101257275584439689E+06, 0.101255817294926324E+06, 0.101255329151085723E+06, + 0.101256832423130865E+06, 0.101260699063277454E+06, 0.101270225601657599E+06, 0.101287312191364559E+06, 0.101303455630186116E+06, + 0.101316029699689170E+06, 0.101320758891846766E+06, 0.101311100182774215E+06, 0.101294901290088586E+06, 0.101273081896347416E+06, + 0.101246397937256072E+06, 0.101214175532589943E+06, 0.101180475299171711E+06, 0.101147446887522659E+06, 0.101117364487217361E+06, + 0.101093085915674965E+06, 0.101075700452174933E+06, 0.101066299886712630E+06, 0.101066158368806296E+06, 0.101078251612071312E+06, + 0.101107333429588485E+06, 0.101145577197960345E+06, 0.101190184433163799E+06, 0.101238249723994639E+06, 0.101280682092796589E+06, + 0.101316576899162261E+06, 0.101349617253023622E+06, 0.101379226791601075E+06, 0.101404833281466810E+06, 0.101426608723689307E+06, + 0.101443265324151027E+06, 0.101453984963411596E+06, 0.101458728599400347E+06, 0.101457810163301183E+06, 0.101452773264225369E+06, + 0.101443352159658025E+06, 0.101428700824100233E+06, 0.101409534671443689E+06, 0.101387066094169772E+06, 0.101362901532581192E+06, + 0.101342428907368536E+06, 0.101323657976273273E+06, 0.101307125752964450E+06, 0.101293183514770688E+06, 0.101280868902945120E+06, + 0.101268909632403243E+06, 0.101254864133468844E+06, 0.101241751785266810E+06, 0.101229873732095890E+06, 0.101219507414652238E+06, + 0.101210854622372586E+06, 0.101203998200015136E+06, 0.101202118817604176E+06, 0.101204115282818020E+06, 0.101207394659720041E+06, + 0.101211469101194845E+06, 0.101215801913933246E+06, 0.101219837912576768E+06, 0.101222821880958276E+06, 0.101223619521153145E+06, + 0.101223119359168049E+06, 0.101279933976388784E+06, 0.101280230886902951E+06, 0.101280173829517254E+06, 0.101279628905657766E+06, + 0.101278452724477320E+06, 0.101276500130166445E+06, 0.101273279706602567E+06, 0.101267225127293903E+06, 0.101259879400551043E+06, + 0.101251952874409501E+06, 0.101243674039727790E+06, 0.101235303075196876E+06, 0.101227122345847776E+06, 0.101219423613287974E+06, + 0.101212178882549546E+06, 0.101205696806113177E+06, 0.101200710454399567E+06, 0.101197550054666615E+06, 0.101196424920055710E+06, + 0.101196682426928426E+06, 0.101199196544638864E+06, 0.101204111882830854E+06, 0.101214864879095490E+06, 0.101228568680570461E+06, + 0.101243289081509487E+06, 0.101258220436669624E+06, 0.101272521063369320E+06, 0.101285366950491778E+06, 0.101296012419061328E+06, + 0.101305658540617282E+06, 0.101309682063797125E+06, 0.101310624244857565E+06, 0.101308433795484656E+06, 0.101303210985482059E+06, + 0.101295198335334237E+06, 0.101284767756201632E+06, 0.101272403737592205E+06, 0.101256113788140079E+06, 0.101238847669926457E+06, + 0.101222589159180454E+06, 0.101208629956686913E+06, 0.101197517909479167E+06, 0.101189497449897433E+06, 0.101184456694785782E+06, + 0.101181649500138068E+06, 0.101179750491125887E+06, 0.101178046404878522E+06, 0.101175885037415414E+06, 0.101168022154143066E+06, + 0.101159966065713801E+06, 0.101152331174549618E+06, 0.101145627588820978E+06, 0.101140536375719617E+06, 0.101137554875074289E+06, + 0.101136964384819003E+06, 0.101138821605761070E+06, 0.101143054186604160E+06, 0.101151654753774303E+06, 0.101161075130481171E+06, + 0.101170963288776737E+06, 0.101180942106852366E+06, 0.101190660642090996E+06, 0.101199851697929174E+06, 0.101208579711314771E+06, + 0.101216763897321827E+06, 0.101224252677880388E+06, 0.101230718188980885E+06, 0.101236243573164116E+06, 0.101240451206177866E+06, + 0.101243892699987075E+06, 0.101246988344102370E+06, 0.101250044906442185E+06, 0.101253348298035868E+06, 0.101257374370298217E+06, + 0.101262251561231329E+06, 0.101267895803787687E+06, 0.101275473367753089E+06, 0.101283709026768585E+06, 0.101292283625024313E+06, + 0.101300598737905675E+06, 0.101308093199018083E+06, 0.101314220495369867E+06, 0.101317565250665139E+06, 0.101316383038650820E+06, + 0.101313738332474823E+06, 0.101310203262582130E+06, 0.101306334680532935E+06, 0.101304140173899126E+06, 0.101302185066315011E+06, + 0.101301166929963205E+06, 0.101300627409982437E+06, 0.101301442301666364E+06, 0.101302674870566902E+06, 0.101303021785214194E+06, + 0.101301874610097177E+06, 0.101297234163742920E+06, 0.101289212662159043E+06, 0.101280201810217695E+06, 0.101271153345172788E+06, + 0.101264093160240271E+06, 0.101259964551924568E+06, 0.101257527008254954E+06, 0.101256779297676592E+06, 0.101257083402693010E+06, + 0.101258345876766994E+06, 0.101261741195912517E+06, 0.101267637196925745E+06, 0.101280255542587736E+06, 0.101300219472217796E+06, + 0.101318811431023903E+06, 0.101333064281329105E+06, 0.101337822826176372E+06, 0.101329633927901843E+06, 0.101313842956693508E+06, + 0.101291773913463257E+06, 0.101264248822328038E+06, 0.101231681402834831E+06, 0.101198711256044262E+06, 0.101165944729817566E+06, + 0.101135663129340406E+06, 0.101112149821393570E+06, 0.101094336258872077E+06, 0.101083754934829689E+06, 0.101081962838100400E+06, + 0.101094161177945804E+06, 0.101119463798994111E+06, 0.101153379508463855E+06, 0.101193466772876971E+06, 0.101236864297787688E+06, + 0.101271319749684611E+06, 0.101304810719710440E+06, 0.101336529049048593E+06, 0.101365547226062699E+06, 0.101391403447243065E+06, + 0.101414233987549960E+06, 0.101431699751902197E+06, 0.101443249701215464E+06, 0.101448694379159249E+06, 0.101448342945639379E+06, + 0.101444949497289897E+06, 0.101434983683722516E+06, 0.101420339588228075E+06, 0.101400782009497547E+06, 0.101377357223598548E+06, + 0.101353445824612878E+06, 0.101331105881366500E+06, 0.101310391048972291E+06, 0.101292023316921361E+06, 0.101276408630823629E+06, + 0.101263594338449708E+06, 0.101249134886344415E+06, 0.101234892154251414E+06, 0.101221982151018121E+06, 0.101210641209280395E+06, + 0.101201103409364907E+06, 0.101193542381486463E+06, 0.101189530184913005E+06, 0.101188943141927884E+06, 0.101190369535781749E+06, + 0.101194174658495293E+06, 0.101198877046582638E+06, 0.101203781726436631E+06, 0.101208345081553751E+06, 0.101210641923420510E+06, + 0.101211907924376195E+06, 0.101211894158448660E+06, 0.101261542396602526E+06, 0.101261524602459496E+06, 0.101261271962264684E+06, + 0.101260655467705859E+06, 0.101259535677996173E+06, 0.101257770460092695E+06, 0.101254858567248273E+06, 0.101250130827152869E+06, + 0.101243199529206220E+06, 0.101235660710148513E+06, 0.101227727082598372E+06, 0.101219642017676335E+06, 0.101211669747645647E+06, + 0.101204082204654842E+06, 0.101197142166519814E+06, 0.101190828836761386E+06, 0.101185622952613427E+06, 0.101182084994122983E+06, + 0.101179819644487143E+06, 0.101179386785722192E+06, 0.101181037231546885E+06, 0.101184921544816825E+06, 0.101191071708805684E+06, + 0.101202963344456002E+06, 0.101217214661309525E+06, 0.101232127096539611E+06, 0.101246868435665092E+06, 0.101260623299959872E+06, + 0.101275012912500446E+06, 0.101287927630361359E+06, 0.101297156607966986E+06, 0.101300022279744313E+06, 0.101299658882873831E+06, + 0.101296185125092088E+06, 0.101289860769760111E+06, 0.101281072853932870E+06, 0.101270317685887567E+06, 0.101257849866728764E+06, + 0.101241620969336713E+06, 0.101226620289076629E+06, 0.101213719159152053E+06, 0.101203448100139896E+06, 0.101196030165699893E+06, + 0.101191332050565718E+06, 0.101188825460235021E+06, 0.101186627930786824E+06, 0.101183177496864155E+06, 0.101175055095382006E+06, + 0.101166325451567565E+06, 0.101157506572639366E+06, 0.101149141784503256E+06, 0.101141882059824522E+06, 0.101136611424843984E+06, + 0.101133780517071078E+06, 0.101133612778250375E+06, 0.101137015702474586E+06, 0.101144048000326933E+06, 0.101152946100252506E+06, + 0.101162592544671337E+06, 0.101172594122147348E+06, 0.101182525914593833E+06, 0.101192006688188281E+06, 0.101200731545306888E+06, + 0.101208949653701755E+06, 0.101216776035106115E+06, 0.101223643986761963E+06, 0.101229495275078225E+06, 0.101234397106283810E+06, + 0.101238325186287970E+06, 0.101241245958931366E+06, 0.101243986310471693E+06, 0.101246885079730608E+06, 0.101250239965938381E+06, + 0.101254497783043873E+06, 0.101260948534770170E+06, 0.101268693386766550E+06, 0.101277410860750868E+06, 0.101286673004684562E+06, + 0.101296037156777587E+06, 0.101304973100759889E+06, 0.101312836471203336E+06, 0.101319077100166265E+06, 0.101323200714451756E+06, + 0.101322250124293394E+06, 0.101319426400325508E+06, 0.101315327879672026E+06, 0.101311379409400208E+06, 0.101308929715621984E+06, + 0.101307576201749136E+06, 0.101306752066909641E+06, 0.101306276681202202E+06, 0.101306450951061837E+06, 0.101306928825287003E+06, + 0.101306304370611891E+06, 0.101304071949983219E+06, 0.101298726444911401E+06, 0.101289556844688181E+06, 0.101279573549734007E+06, + 0.101269900918276995E+06, 0.101262737639210711E+06, 0.101259533404357528E+06, 0.101258456904325285E+06, 0.101259373853730853E+06, + 0.101261455254273096E+06, 0.101264486663057716E+06, 0.101269671494430630E+06, 0.101277337091813301E+06, 0.101292476984397377E+06, + 0.101314252890570002E+06, 0.101334243526143560E+06, 0.101349257112687643E+06, 0.101353348220742904E+06, 0.101345316081726181E+06, + 0.101329205683580891E+06, 0.101306196398575121E+06, 0.101276157501052992E+06, 0.101241050683782683E+06, 0.101205878990180805E+06, + 0.101173117425566874E+06, 0.101145231775263543E+06, 0.101124829234029152E+06, 0.101110142836540865E+06, 0.101099009983212847E+06, + 0.101095931793603289E+06, 0.101107937055714152E+06, 0.101129557639286853E+06, 0.101159016947845914E+06, 0.101194290171214365E+06, + 0.101229194191076458E+06, 0.101259884907642350E+06, 0.101290909335772027E+06, 0.101321534960278805E+06, 0.101350933609778935E+06, + 0.101378619763291339E+06, 0.101402515553940961E+06, 0.101421126437325220E+06, 0.101433759893184542E+06, 0.101440081432142906E+06, + 0.101442774222367792E+06, 0.101440175371796868E+06, 0.101430382938397539E+06, 0.101414195446914280E+06, 0.101393183882853962E+06, + 0.101368556280786899E+06, 0.101342857987377705E+06, 0.101318002031737051E+06, 0.101294900480304379E+06, 0.101274304523903862E+06, + 0.101256697091383176E+06, 0.101240541623616038E+06, 0.101225909818463362E+06, 0.101213299349493405E+06, 0.101200928172660904E+06, + 0.101190501742025459E+06, 0.101182213405811461E+06, 0.101176901403817319E+06, 0.101175245583661221E+06, 0.101175762446152599E+06, + 0.101178005333581008E+06, 0.101181392651505157E+06, 0.101186087494527630E+06, 0.101191405412103719E+06, 0.101195091837111089E+06, + 0.101197730891759726E+06, 0.101199364382066880E+06, 0.101199730209935369E+06, 0.101245004040932326E+06, 0.101244559135352756E+06, + 0.101244006361693333E+06, 0.101243220164091719E+06, 0.101242063426875131E+06, 0.101239785127296316E+06, 0.101236357261140554E+06, + 0.101232655165141550E+06, 0.101227802625625860E+06, 0.101220780822386791E+06, 0.101213322053334618E+06, 0.101205654745465290E+06, + 0.101198027406206093E+06, 0.101190695138277268E+06, 0.101183902374283105E+06, 0.101177861446733092E+06, 0.101172715839318174E+06, + 0.101168727915036332E+06, 0.101166083677619172E+06, 0.101165120300427254E+06, 0.101166097664782996E+06, 0.101169176642534818E+06, + 0.101174400762938254E+06, 0.101181681695578300E+06, 0.101194628149370954E+06, 0.101209354172510837E+06, 0.101224384543212596E+06, + 0.101241003377192639E+06, 0.101256971279536912E+06, 0.101271325762838256E+06, 0.101283302907598583E+06, 0.101290837888259193E+06, + 0.101292188600320253E+06, 0.101290316399723524E+06, 0.101285500501916889E+06, 0.101278145707370568E+06, 0.101268063741988299E+06, + 0.101255992666718317E+06, 0.101243630289196284E+06, 0.101230020660095543E+06, 0.101218300352418431E+06, 0.101208996070145775E+06, + 0.101202318103285957E+06, 0.101198115125068754E+06, 0.101195865072430563E+06, 0.101192485973754709E+06, 0.101184883550562605E+06, + 0.101176252043943983E+06, 0.101167064140836461E+06, 0.101157837055866650E+06, 0.101149111932572778E+06, 0.101141425669095363E+06, + 0.101136096494374695E+06, 0.101133772515929886E+06, 0.101136278536261714E+06, 0.101141790910123251E+06, 0.101149565058361550E+06, + 0.101159158826086161E+06, 0.101169280924233710E+06, 0.101179364339541717E+06, 0.101189214375348573E+06, 0.101198419330631325E+06, + 0.101206662421100802E+06, 0.101214110977152406E+06, 0.101221277683224456E+06, 0.101227361193735371E+06, 0.101232391962857888E+06, + 0.101236456240121115E+06, 0.101239696448804534E+06, 0.101242131415364871E+06, 0.101244485321801025E+06, 0.101247206329288369E+06, + 0.101250813340918423E+06, 0.101256254483921584E+06, 0.101263638654577793E+06, 0.101272420586206106E+06, 0.101282081390786785E+06, + 0.101292093147014763E+06, 0.101301886889219619E+06, 0.101311011635127215E+06, 0.101318745388787589E+06, 0.101324552511834278E+06, + 0.101327137099599713E+06, 0.101325798652594996E+06, 0.101322370281172494E+06, 0.101318873214067411E+06, 0.101316033453167009E+06, + 0.101314254241750285E+06, 0.101313290040590538E+06, 0.101312777489808956E+06, 0.101312426972162124E+06, 0.101312077043907979E+06, + 0.101311637613854371E+06, 0.101309930679532728E+06, 0.101306604219150962E+06, 0.101300708574919438E+06, 0.101290667766194849E+06, + 0.101280103453056901E+06, 0.101270238174615952E+06, 0.101263265305097812E+06, 0.101261210282368877E+06, 0.101261635280168994E+06, + 0.101264259503469541E+06, 0.101268188459234763E+06, 0.101273120782915241E+06, 0.101280081032422138E+06, 0.101289326234345950E+06, + 0.101306137507821695E+06, 0.101328331726916280E+06, 0.101348454606262691E+06, 0.101363243724620203E+06, 0.101365228148856142E+06, + 0.101355701191101674E+06, 0.101338137535693226E+06, 0.101313442343172661E+06, 0.101279893686959578E+06, 0.101241766771608411E+06, + 0.101204166019317592E+06, 0.101170013105795253E+06, 0.101142432350644231E+06, 0.101122231791865343E+06, 0.101108816561727523E+06, + 0.101102229721379510E+06, 0.101103813368451665E+06, 0.101116580337189007E+06, 0.101134920647456835E+06, 0.101160141230191730E+06, + 0.101190695983823272E+06, 0.101217581338673946E+06, 0.101244990949544663E+06, 0.101273917316553634E+06, 0.101303572896501239E+06, + 0.101333544453130846E+06, 0.101364877370781323E+06, 0.101391063816659895E+06, 0.101411237101045277E+06, 0.101425278782258334E+06, + 0.101433519934200929E+06, 0.101439158935259431E+06, 0.101436999045160905E+06, 0.101426916105024720E+06, 0.101409617969188068E+06, + 0.101386542831537823E+06, 0.101358099179373283E+06, 0.101329104321193983E+06, 0.101301390131810738E+06, 0.101275584184176812E+06, + 0.101252450915750233E+06, 0.101231887457535791E+06, 0.101212090768716560E+06, 0.101196447068532798E+06, 0.101185068443023629E+06, + 0.101177384135667060E+06, 0.101168309967723544E+06, 0.101161992541140848E+06, 0.101159852630578913E+06, 0.101159796489626082E+06, + 0.101161597602608847E+06, 0.101164838510229980E+06, 0.101168957886595192E+06, 0.101173308450019656E+06, 0.101177043737997461E+06, + 0.101180725542300570E+06, 0.101183638211952741E+06, 0.101185541375514644E+06, 0.101186177771331219E+06, 0.101231389269493171E+06, + 0.101229452023944614E+06, 0.101228492450459045E+06, 0.101227437857730562E+06, 0.101225272919369032E+06, 0.101222115782736248E+06, + 0.101218895852368762E+06, 0.101215584732123752E+06, 0.101212116636056322E+06, 0.101207354097621472E+06, 0.101200521838921966E+06, + 0.101193426713001274E+06, 0.101186304142571476E+06, 0.101179395677309934E+06, 0.101172931379861388E+06, 0.101167151828382484E+06, + 0.101162308500518877E+06, 0.101158300144806009E+06, 0.101155408258388663E+06, 0.101154070184498851E+06, 0.101154559752015484E+06, + 0.101157052466433044E+06, 0.101161607131965604E+06, 0.101168151354609319E+06, 0.101176471448160533E+06, 0.101190446255643255E+06, + 0.101207546249739040E+06, 0.101224869025537133E+06, 0.101241629266362957E+06, 0.101257034534386199E+06, 0.101270300423290071E+06, + 0.101280701804350014E+06, 0.101286032850469506E+06, 0.101285592385854572E+06, 0.101282085195034277E+06, 0.101274697798302746E+06, + 0.101264580591891121E+06, 0.101253728075986262E+06, 0.101242929317346643E+06, 0.101232485866013521E+06, 0.101222025672053554E+06, + 0.101213765521939480E+06, 0.101207908438247250E+06, 0.101204284122239580E+06, 0.101199927839590950E+06, 0.101194734819518329E+06, + 0.101188456889903726E+06, 0.101179666542616309E+06, 0.101170394407501270E+06, 0.101161163472120141E+06, 0.101152520749703152E+06, + 0.101145006252468942E+06, 0.101139495861547286E+06, 0.101140801932908304E+06, 0.101144658005535239E+06, 0.101150950782672968E+06, + 0.101159402010231061E+06, 0.101169516352869221E+06, 0.101180618870833394E+06, 0.101190857796199096E+06, 0.101200641550543587E+06, + 0.101209362327359180E+06, 0.101217130139796180E+06, 0.101224049008589936E+06, 0.101230122753387783E+06, 0.101235212462695199E+06, + 0.101239229954162147E+06, 0.101242277095199534E+06, 0.101244507835626879E+06, 0.101246153185945266E+06, 0.101247135672995661E+06, + 0.101249606832741643E+06, 0.101254017340448758E+06, 0.101260512682501125E+06, 0.101268912159280037E+06, 0.101278581961162170E+06, + 0.101288935630890279E+06, 0.101299344634514127E+06, 0.101309165575948311E+06, 0.101317556887074039E+06, 0.101323172703937016E+06, + 0.101326358447397986E+06, 0.101327232302474091E+06, 0.101325894572504010E+06, 0.101322706535794525E+06, 0.101319932108380584E+06, + 0.101318115839731938E+06, 0.101317374329348502E+06, 0.101316802412196412E+06, 0.101316539167573457E+06, 0.101316220872659469E+06, + 0.101315472541661889E+06, 0.101313988991298058E+06, 0.101311143303248988E+06, 0.101306823565026949E+06, 0.101300909517459571E+06, + 0.101291139156745485E+06, 0.101281432901143096E+06, 0.101272931024738762E+06, 0.101267480423988032E+06, 0.101267406598649904E+06, + 0.101269963384954986E+06, 0.101274800002130170E+06, 0.101281233237463195E+06, 0.101288842618392577E+06, 0.101297886975346977E+06, + 0.101308296387334616E+06, 0.101325624485844790E+06, 0.101346166178142783E+06, 0.101363441252856501E+06, 0.101374801583022883E+06, + 0.101371478339382054E+06, 0.101357965915636902E+06, 0.101337616663800756E+06, 0.101310513973449386E+06, 0.101272307541573202E+06, + 0.101230865550039016E+06, 0.101190791911869368E+06, 0.101155350687670492E+06, 0.101129224427448615E+06, 0.101110583343861392E+06, + 0.101099020700267734E+06, 0.101094724119735372E+06, 0.101099023269690821E+06, 0.101111662707600757E+06, 0.101130628382792580E+06, + 0.101154442701152686E+06, 0.101179514522985817E+06, 0.101201379997560478E+06, 0.101226265787734679E+06, 0.101253796882664625E+06, + 0.101283225572595169E+06, 0.101317124967778669E+06, 0.101350989077608407E+06, 0.101379921717535108E+06, 0.101402381642000008E+06, + 0.101417742462739217E+06, 0.101429901727416946E+06, 0.101436203470310473E+06, 0.101434079341425662E+06, 0.101423164600191842E+06, + 0.101404037685293821E+06, 0.101376818918793375E+06, 0.101344589194113520E+06, 0.101311531147971255E+06, 0.101279820675164505E+06, + 0.101251153362574143E+06, 0.101225285333396270E+06, 0.101199764562447148E+06, 0.101178262360150809E+06, 0.101161772194779478E+06, + 0.101150434481179953E+06, 0.101143909494338062E+06, 0.101141390141577620E+06, 0.101140639767941699E+06, 0.101140632648710569E+06, + 0.101142372620975060E+06, 0.101145663398052158E+06, 0.101150107990777600E+06, 0.101155154940690569E+06, 0.101159369531278891E+06, + 0.101162295247948568E+06, 0.101164893804552295E+06, 0.101168002876310085E+06, 0.101170082535517562E+06, 0.101170879828210964E+06, + 0.101219861459639709E+06, 0.101217353733850920E+06, 0.101214813662341927E+06, 0.101212272616671195E+06, 0.101208980334428372E+06, + 0.101205795685889956E+06, 0.101202734659769427E+06, 0.101199769990954403E+06, 0.101196834984741159E+06, 0.101193828164992272E+06, + 0.101189376363543503E+06, 0.101183028116295318E+06, 0.101176590659241221E+06, 0.101170295511546516E+06, 0.101164459781001147E+06, + 0.101159272837843542E+06, 0.101154626508349247E+06, 0.101150830978481536E+06, 0.101147940393322046E+06, 0.101146374185143752E+06, + 0.101146551350105059E+06, 0.101148666345078062E+06, 0.101152796928674230E+06, 0.101158889620899077E+06, 0.101166802022490039E+06, + 0.101178035305259487E+06, 0.101194860122035752E+06, 0.101212325551695918E+06, 0.101229507831180323E+06, 0.101245588075390231E+06, + 0.101259749204794090E+06, 0.101271227064842373E+06, 0.101279354568716226E+06, 0.101282023041620065E+06, 0.101277735417878983E+06, + 0.101270065940430606E+06, 0.101260942221718724E+06, 0.101251183302667749E+06, 0.101241580790420048E+06, 0.101232817663754860E+06, + 0.101224865544509375E+06, 0.101217678236240463E+06, 0.101212672610467605E+06, 0.101207368061914924E+06, 0.101202142949429748E+06, + 0.101197200360827206E+06, 0.101192321056135959E+06, 0.101185312042045203E+06, 0.101176366919002583E+06, 0.101167575306740793E+06, + 0.101159499887747690E+06, 0.101153693581619635E+06, 0.101151632492099627E+06, 0.101152648343697670E+06, 0.101157198969257923E+06, + 0.101164178808173063E+06, 0.101173247856793882E+06, 0.101183857272265639E+06, 0.101195294072408884E+06, 0.101206439742155373E+06, + 0.101215821840872028E+06, 0.101224223508709707E+06, 0.101231582323487324E+06, 0.101237823030360581E+06, 0.101242874318770337E+06, + 0.101246774089702827E+06, 0.101249620201836733E+06, 0.101251514633922707E+06, 0.101250998739460556E+06, 0.101250350564701104E+06, + 0.101251192192736547E+06, 0.101254126969565099E+06, 0.101259362363834385E+06, 0.101266888172729494E+06, 0.101276372037240624E+06, + 0.101286838617996444E+06, 0.101297573246049607E+06, 0.101307533698699568E+06, 0.101315884770704040E+06, 0.101322262940598855E+06, + 0.101325965760392661E+06, 0.101327074410681467E+06, 0.101325913256045969E+06, 0.101323124870245505E+06, 0.101319702236701676E+06, + 0.101317199019545646E+06, 0.101315951598744505E+06, 0.101315806747022463E+06, 0.101315575437492836E+06, 0.101314907982108765E+06, + 0.101313877512845647E+06, 0.101312479697057366E+06, 0.101309803618787570E+06, 0.101306072028328548E+06, 0.101301517809186698E+06, + 0.101296222398532715E+06, 0.101287978736962512E+06, 0.101280134483104775E+06, 0.101273858730883643E+06, 0.101270559684999607E+06, + 0.101272646114663905E+06, 0.101277445816036910E+06, 0.101284587711525965E+06, 0.101293877343276210E+06, 0.101304839668757166E+06, + 0.101316528257227954E+06, 0.101328366576771165E+06, 0.101345969486117698E+06, 0.101364186088572969E+06, 0.101377148495963469E+06, + 0.101382093829553254E+06, 0.101370766337072331E+06, 0.101349741353763951E+06, 0.101321811510905638E+06, 0.101288468123698593E+06, + 0.101244965303345511E+06, 0.101202004776977919E+06, 0.101162860285996649E+06, 0.101126851606302604E+06, 0.101104372225545885E+06, + 0.101088557676466924E+06, 0.101079807482518576E+06, 0.101078498448923550E+06, 0.101085445131155400E+06, 0.101098827324377111E+06, + 0.101117379276230466E+06, 0.101139770652544976E+06, 0.101160113557297649E+06, 0.101180387504904938E+06, 0.101203886596317709E+06, + 0.101230902181368132E+06, 0.101261803558958476E+06, 0.101300608660476937E+06, 0.101337274184836075E+06, 0.101369125977644289E+06, + 0.101394267041929546E+06, 0.101413158265606093E+06, 0.101427330114929093E+06, 0.101432361057773902E+06, 0.101429910859225725E+06, + 0.101417624134461643E+06, 0.101395314188587567E+06, 0.101362172145086661E+06, 0.101325960646168634E+06, 0.101289070977803320E+06, + 0.101253544677021608E+06, 0.101220938962399465E+06, 0.101189935258524172E+06, 0.101161696612905507E+06, 0.101138721820111517E+06, + 0.101121644349305658E+06, 0.101110649141410599E+06, 0.101105415636551304E+06, 0.101106709372907222E+06, 0.101112684473039320E+06, + 0.101118393699309789E+06, 0.101122164751330070E+06, 0.101127188453840165E+06, 0.101133080620089138E+06, 0.101138746974859983E+06, + 0.101142873479913527E+06, 0.101146389620966002E+06, 0.101149025184660437E+06, 0.101150587859464547E+06, 0.101152755345234560E+06, + 0.101153603260132426E+06, 0.101210525717246186E+06, 0.101207548474999538E+06, 0.101202904596832290E+06, 0.101197951386655157E+06, + 0.101194386519771622E+06, 0.101191122015514105E+06, 0.101188175657561296E+06, 0.101185519945178385E+06, 0.101183085746111174E+06, + 0.101180766773284515E+06, 0.101178424993241424E+06, 0.101174517040993989E+06, 0.101168962341147722E+06, 0.101163714253363345E+06, + 0.101158948557658077E+06, 0.101154261182255184E+06, 0.101149950932639709E+06, 0.101146327181315632E+06, 0.101143687040794233E+06, + 0.101142126337276364E+06, 0.101142152044085655E+06, 0.101144083527112423E+06, 0.101148021171421016E+06, 0.101154000779215450E+06, + 0.101162760282120405E+06, 0.101173711396198050E+06, 0.101186611484798021E+06, 0.101203854792520258E+06, 0.101221108630801245E+06, + 0.101237514909808757E+06, 0.101252212005649548E+06, 0.101264385838287199E+06, 0.101273313773670612E+06, 0.101275991122254636E+06, + 0.101272633847169331E+06, 0.101265839223746094E+06, 0.101257619395513131E+06, 0.101248828329997094E+06, 0.101240269262524962E+06, + 0.101232609922544550E+06, 0.101226305719316471E+06, 0.101221001261636731E+06, 0.101215325578545016E+06, 0.101210148330884782E+06, + 0.101205386910296002E+06, 0.101200913609812837E+06, 0.101196557499459639E+06, 0.101192094621711993E+06, 0.101184939627293686E+06, + 0.101177056092112194E+06, 0.101171384998373789E+06, 0.101168077457142164E+06, 0.101167062491365999E+06, 0.101168742847490139E+06, + 0.101173481015017140E+06, 0.101181062252591364E+06, 0.101190688726292763E+06, 0.101201754487460537E+06, 0.101213053590803727E+06, + 0.101224458950927612E+06, 0.101234613260145692E+06, 0.101242743726390036E+06, 0.101249595831817132E+06, 0.101255046289272010E+06, + 0.101258984767052723E+06, 0.101261363785577109E+06, 0.101261779254400128E+06, 0.101259695740838331E+06, 0.101257723355522670E+06, + 0.101256712782620496E+06, 0.101257390131988577E+06, 0.101260812728128207E+06, 0.101266865110914150E+06, 0.101275356425384583E+06, + 0.101285757165198593E+06, 0.101297005109519319E+06, 0.101307222441895385E+06, 0.101316130802742104E+06, 0.101323131432448601E+06, + 0.101327755554835458E+06, 0.101329091060690815E+06, 0.101327426676222676E+06, 0.101323405755774875E+06, 0.101317808009742424E+06, + 0.101312695092861308E+06, 0.101309644418928467E+06, 0.101307843097245379E+06, 0.101307258014776118E+06, 0.101306396062738830E+06, + 0.101304392989299769E+06, 0.101302318926388383E+06, 0.101300146974100906E+06, 0.101296693003163877E+06, 0.101292171838443071E+06, + 0.101287472873098537E+06, 0.101282787197424317E+06, 0.101276691890622955E+06, 0.101271343380570586E+06, 0.101267971439309680E+06, + 0.101267491024100920E+06, 0.101272069334797809E+06, 0.101279335267968272E+06, 0.101288917788163279E+06, 0.101301241225878053E+06, + 0.101315819189724789E+06, 0.101330320177330534E+06, 0.101343606724499783E+06, 0.101360277666390102E+06, 0.101374651937569957E+06, + 0.101381948044541350E+06, 0.101379139254734604E+06, 0.101357829215456179E+06, 0.101327280040149271E+06, 0.101289941888269532E+06, + 0.101246108522415467E+06, 0.101194796632095546E+06, 0.101146024288208340E+06, 0.101103656741928615E+06, 0.101073141515266252E+06, + 0.101057806173447316E+06, 0.101051682514418280E+06, 0.101049406076037965E+06, 0.101052339673225651E+06, 0.101063115066462298E+06, + 0.101078506068417060E+06, 0.101097590566484258E+06, 0.101118771179471136E+06, 0.101135489318013730E+06, 0.101154758424584812E+06, + 0.101177654242688412E+06, 0.101205061131610448E+06, 0.101242230976538951E+06, 0.101283647903067162E+06, 0.101323242160821901E+06, + 0.101358087742294330E+06, 0.101385937955843910E+06, 0.101409794381458749E+06, 0.101425117131910592E+06, 0.101429997042675925E+06, + 0.101424225668113679E+06, 0.101409012607044147E+06, 0.101378645916584719E+06, 0.101341017521829854E+06, 0.101300635121866770E+06, + 0.101259780015675904E+06, 0.101220490612824302E+06, 0.101183385014229250E+06, 0.101147969487759023E+06, 0.101117685992608021E+06, + 0.101093539937281050E+06, 0.101076195561657238E+06, 0.101065910310074483E+06, 0.101063435753359998E+06, 0.101067804628520898E+06, + 0.101076221687106154E+06, 0.101087269872699864E+06, 0.101098388777976448E+06, 0.101105436139853176E+06, 0.101112874451142532E+06, + 0.101118849015061031E+06, 0.101124113984576659E+06, 0.101128454272832299E+06, 0.101131632912711430E+06, 0.101133440671438293E+06, + 0.101133742258942963E+06, 0.101133420481460824E+06, 0.101203377126110252E+06, 0.101198268613597073E+06, 0.101192518049139719E+06, + 0.101186803252296639E+06, 0.101181813758537333E+06, 0.101178421999043727E+06, 0.101175553435103371E+06, 0.101173179030172672E+06, + 0.101171225754259809E+06, 0.101169580857152410E+06, 0.101168097072006873E+06, 0.101166598871645896E+06, 0.101163936200708034E+06, + 0.101160319529115644E+06, 0.101156350070871646E+06, 0.101152298957045554E+06, 0.101148469397518347E+06, 0.101145174878879858E+06, + 0.101142716121090431E+06, 0.101141356671128422E+06, 0.101141393983984628E+06, 0.101143318014807519E+06, 0.101147349641468565E+06, + 0.101153926105170540E+06, 0.101162646354183598E+06, 0.101173404206242340E+06, 0.101185918183552916E+06, 0.101199863730921250E+06, + 0.101216872253279580E+06, 0.101233295276471807E+06, 0.101248215030952546E+06, 0.101260757021715341E+06, 0.101267495548934719E+06, + 0.101269706371902867E+06, 0.101268204478453976E+06, 0.101262805085999877E+06, 0.101255380826612120E+06, 0.101247430865831397E+06, + 0.101239780825202557E+06, 0.101233090454269026E+06, 0.101227802760140185E+06, 0.101223571816330572E+06, 0.101219066722623626E+06, + 0.101214540599785731E+06, 0.101210406057645538E+06, 0.101206592274863258E+06, 0.101202981532469319E+06, 0.101199400726594919E+06, + 0.101195627874287937E+06, 0.101191227720762778E+06, 0.101187565739316706E+06, 0.101185464827996155E+06, 0.101185511851585936E+06, + 0.101188073018881041E+06, 0.101193228150490002E+06, 0.101201132185450770E+06, 0.101211253103469411E+06, 0.101221691007216708E+06, + 0.101232930515629778E+06, 0.101244622455395234E+06, 0.101256099137093290E+06, 0.101264336488988658E+06, 0.101270613718010951E+06, + 0.101275186944850837E+06, 0.101277911712320536E+06, 0.101275720871891084E+06, 0.101272701050287156E+06, 0.101269530015498065E+06, + 0.101266916775846155E+06, 0.101265667085305176E+06, 0.101266412423480491E+06, 0.101269963618393420E+06, 0.101276824074798991E+06, + 0.101286538984123661E+06, 0.101297754584716895E+06, 0.101309268788473608E+06, 0.101319049570761636E+06, 0.101326688370924327E+06, + 0.101331858743319128E+06, 0.101334118663267698E+06, 0.101332850026087355E+06, 0.101327763563889297E+06, 0.101320054486635490E+06, + 0.101310581963123463E+06, 0.101301464042469088E+06, 0.101296071475081029E+06, 0.101292351628835357E+06, 0.101290169534329834E+06, + 0.101288302766939916E+06, 0.101284014152439850E+06, 0.101279941996829206E+06, 0.101276061598442378E+06, 0.101271538120976256E+06, + 0.101266097326113042E+06, 0.101261239127189925E+06, 0.101257245251898741E+06, 0.101253483641709958E+06, 0.101251125639619684E+06, + 0.101251189762292764E+06, 0.101253695416316186E+06, 0.101260342754598576E+06, 0.101269818597965233E+06, 0.101281786685942599E+06, + 0.101297267888598697E+06, 0.101315752383087500E+06, 0.101333588295053938E+06, 0.101349152940472399E+06, 0.101363783604825469E+06, + 0.101372978867465237E+06, 0.101373889912201208E+06, 0.101361962340075130E+06, 0.101329656482126462E+06, 0.101288577681367635E+06, + 0.101241353955692000E+06, 0.101187015186283301E+06, 0.101128342669573714E+06, 0.101074249019373397E+06, 0.101029162958810339E+06, + 0.101000523612843142E+06, 0.100987089359594960E+06, 0.100984958621042068E+06, 0.100992130612266148E+06, 0.101008448898443559E+06, + 0.101030521667859153E+06, 0.101051007866767963E+06, 0.101071664234935859E+06, 0.101090175915114785E+06, 0.101106549855269026E+06, + 0.101125443846952985E+06, 0.101148128478478480E+06, 0.101176649869573142E+06, 0.101219367480301720E+06, 0.101264169410245595E+06, + 0.101307902998138612E+06, 0.101345704641115881E+06, 0.101377820901637606E+06, 0.101403851472658702E+06, 0.101419708524997433E+06, + 0.101423957150136412E+06, 0.101416125366734399E+06, 0.101392821386149662E+06, 0.101354118286926780E+06, 0.101311952791900418E+06, + 0.101267586958551430E+06, 0.101222923148393995E+06, 0.101179984606825063E+06, 0.101137775123404324E+06, 0.101100052058991307E+06, + 0.101068211877007227E+06, 0.101043182495123227E+06, 0.101025887119877370E+06, 0.101017441028948917E+06, 0.101018646999727091E+06, + 0.101025249625575729E+06, 0.101036067916060245E+06, 0.101049702828005305E+06, 0.101064676552964025E+06, 0.101079565938465035E+06, + 0.101088532594576784E+06, 0.101096312478571519E+06, 0.101102983223382442E+06, 0.101108374984337381E+06, 0.101112280329396730E+06, + 0.101114507038743657E+06, 0.101114428830065517E+06, 0.101111055246130432E+06, 0.101196406538596522E+06, 0.101190461736979341E+06, + 0.101184419171533169E+06, 0.101178438759959274E+06, 0.101172694307587532E+06, 0.101168042459568693E+06, 0.101165224780188713E+06, + 0.101163116738625147E+06, 0.101161640044718297E+06, 0.101160673934197897E+06, 0.101160060130737882E+06, 0.101160308872814785E+06, + 0.101161160328086728E+06, 0.101159852318196237E+06, 0.101156811572228151E+06, 0.101153532829243355E+06, 0.101150328623015521E+06, + 0.101147521674777250E+06, 0.101145421670737880E+06, 0.101144300600728122E+06, 0.101144366524547018E+06, 0.101146453358106490E+06, + 0.101151154760197140E+06, 0.101157852536650826E+06, 0.101166593375939396E+06, 0.101177254193880435E+06, 0.101189538295227583E+06, + 0.101202976381101937E+06, 0.101217143841964367E+06, 0.101233326011591271E+06, 0.101248211830283530E+06, 0.101258376645531374E+06, + 0.101264582921753405E+06, 0.101267070734474910E+06, 0.101266001194085227E+06, 0.101261820132445268E+06, 0.101255225790946322E+06, + 0.101247986960119670E+06, 0.101241132826118715E+06, 0.101235589817356347E+06, 0.101231742691396459E+06, 0.101228190519347510E+06, + 0.101224868811623688E+06, 0.101221346956982394E+06, 0.101217966212733285E+06, 0.101214970532675288E+06, 0.101212299627427041E+06, + 0.101209926653408853E+06, 0.101209182347595939E+06, 0.101208894928154026E+06, 0.101206557077161851E+06, 0.101205653829090777E+06, + 0.101206766501731909E+06, 0.101210234953384323E+06, 0.101216093544594405E+06, 0.101223864474518923E+06, 0.101233270650245788E+06, + 0.101243919236364745E+06, 0.101255411905531102E+06, 0.101267215651558581E+06, 0.101278589053053409E+06, 0.101288326667672663E+06, + 0.101293977254483369E+06, 0.101295988963460462E+06, 0.101293942850610052E+06, 0.101290379977981182E+06, 0.101286211796570817E+06, + 0.101282157951643720E+06, 0.101279101833166642E+06, 0.101277814046354848E+06, 0.101278807487432292E+06, 0.101282938226413549E+06, + 0.101291273361035273E+06, 0.101301583582921769E+06, 0.101312849202165788E+06, 0.101324002651453309E+06, 0.101333489244781522E+06, + 0.101339488921891199E+06, 0.101342369325021820E+06, 0.101341720289730991E+06, 0.101337127319298394E+06, 0.101327791615567519E+06, + 0.101315437423608601E+06, 0.101301282640627105E+06, 0.101286811802460725E+06, 0.101276747879297676E+06, 0.101269331760055575E+06, + 0.101263643990522745E+06, 0.101258989523824217E+06, 0.101251456119543334E+06, 0.101244182196566340E+06, 0.101237348106484831E+06, + 0.101228692607444944E+06, 0.101218585751885927E+06, 0.101210928314959441E+06, 0.101206232353375613E+06, 0.101203871455940549E+06, + 0.101203999533384937E+06, 0.101207475042430247E+06, 0.101214320092416674E+06, 0.101224147807091678E+06, 0.101236699974733609E+06, + 0.101251676274940794E+06, 0.101270825632959895E+06, 0.101293545270099348E+06, 0.101314419599624249E+06, 0.101330994497954525E+06, + 0.101343242305169362E+06, 0.101347429834497641E+06, 0.101341255518135789E+06, 0.101319524205864262E+06, 0.101278200143226626E+06, + 0.101228562906559484E+06, 0.101174212317573372E+06, 0.101112623030610339E+06, 0.101048222350508891E+06, 0.100990099190183420E+06, + 0.100943211786408705E+06, 0.100918044317067266E+06, 0.100907611661432689E+06, 0.100910107183064712E+06, 0.100923917070401818E+06, + 0.100948850301936414E+06, 0.100978281786140433E+06, 0.101008728042257979E+06, 0.101037658211344344E+06, 0.101057364399701371E+06, + 0.101074391235513976E+06, 0.101093594285308805E+06, 0.101116488413099345E+06, 0.101150558690399863E+06, 0.101193914933389984E+06, + 0.101239758121016799E+06, 0.101285323747319708E+06, 0.101327925492475028E+06, 0.101365565138565944E+06, 0.101392573640838629E+06, + 0.101408539383438299E+06, 0.101411604282492801E+06, 0.101400582930128410E+06, 0.101366946069406418E+06, 0.101324287192622069E+06, + 0.101276101666633986E+06, 0.101226619258282910E+06, 0.101178585432356136E+06, 0.101130984262627506E+06, 0.101086307783769356E+06, + 0.101046851053375387E+06, 0.101014063196888950E+06, 0.100988908271188513E+06, 0.100971785835137707E+06, 0.100968245753203373E+06, + 0.100971380696101813E+06, 0.100980060807918417E+06, 0.100993169646215858E+06, 0.101009312468744305E+06, 0.101026966655764860E+06, + 0.101044366184895640E+06, 0.101060339563627815E+06, 0.101071158866529076E+06, 0.101079488812984200E+06, 0.101086153913575283E+06, + 0.101090971172654899E+06, 0.101093525999388585E+06, 0.101092846852564820E+06, 0.101089780957355411E+06, 0.101191123249149765E+06, + 0.101184975896710632E+06, 0.101178781171733193E+06, 0.101172687284701038E+06, 0.101166856628363908E+06, 0.101161463025241668E+06, + 0.101157556719236236E+06, 0.101155715658911155E+06, 0.101154729896713383E+06, 0.101154469238441612E+06, 0.101155775624535832E+06, + 0.101158121462038107E+06, 0.101160042093184384E+06, 0.101161344855236384E+06, 0.101160448275110015E+06, 0.101158071590188309E+06, + 0.101155631532086059E+06, 0.101153465356088433E+06, 0.101151897289994900E+06, 0.101151213659422618E+06, 0.101151737576582789E+06, + 0.101154199170773107E+06, 0.101158985005759008E+06, 0.101165841396522868E+06, 0.101174673234837159E+06, 0.101185340894024586E+06, + 0.101197532040988634E+06, 0.101210762902995120E+06, 0.101224385238204501E+06, 0.101237894404589199E+06, 0.101250772227856185E+06, + 0.101260411029266310E+06, 0.101266591706174368E+06, 0.101269204187456722E+06, 0.101268397182717250E+06, 0.101264588122030676E+06, + 0.101258438511883942E+06, 0.101251623403392019E+06, 0.101246063118456994E+06, 0.101242417800723517E+06, 0.101239166549985050E+06, + 0.101236254306650939E+06, 0.101233631773944420E+06, 0.101231248894982156E+06, 0.101228825720597553E+06, 0.101226772928204024E+06, + 0.101225473798737570E+06, 0.101225516278296083E+06, 0.101226043519455008E+06, 0.101227093486833808E+06, 0.101228289760449348E+06, + 0.101228546951147655E+06, 0.101230707510254171E+06, 0.101235093253586310E+06, 0.101241126677553519E+06, 0.101248645598633651E+06, + 0.101258142018320970E+06, 0.101268933306888299E+06, 0.101280513500391826E+06, 0.101292262732881034E+06, 0.101303355465601169E+06, + 0.101312817264586003E+06, 0.101316400177874268E+06, 0.101315483458758521E+06, 0.101312277984593762E+06, 0.101307698621808959E+06, + 0.101302673951913355E+06, 0.101298053010945936E+06, 0.101294840530663249E+06, 0.101294065839099727E+06, 0.101296783533959431E+06, + 0.101302065639223511E+06, 0.101310033568624291E+06, 0.101320378178744606E+06, 0.101331366932783130E+06, 0.101341800425977897E+06, + 0.101350415611308272E+06, 0.101354800042096002E+06, 0.101354718500839095E+06, 0.101350294315183972E+06, 0.101341487001001398E+06, + 0.101327926160731338E+06, 0.101310260858651716E+06, 0.101290273767883307E+06, 0.101269495556410489E+06, 0.101251846238950835E+06, + 0.101238682635122401E+06, 0.101227174341821534E+06, 0.101213482647208613E+06, 0.101195603009729079E+06, 0.101177872156641286E+06, + 0.101162325618075352E+06, 0.101149982165601716E+06, 0.101139852149278217E+06, 0.101134024565056650E+06, 0.101132753824598782E+06, + 0.101135032680571021E+06, 0.101140084766430024E+06, 0.101148877574289698E+06, 0.101161005262514984E+06, 0.101174747769146576E+06, + 0.101190713232751208E+06, 0.101208811802622309E+06, 0.101231640660711972E+06, 0.101258571723189729E+06, 0.101282336017681446E+06, + 0.101299629439163051E+06, 0.101308040998087759E+06, 0.101305555171365690E+06, 0.101290435343250807E+06, 0.101256519799893256E+06, + 0.101204322883293091E+06, 0.101144321216045384E+06, 0.101080811870748948E+06, 0.101014238668434729E+06, 0.100950513534181708E+06, + 0.100894391363170798E+06, 0.100851829575523923E+06, 0.100832142921501421E+06, 0.100825615789308096E+06, 0.100832955840479583E+06, + 0.100854821405899405E+06, 0.100888239967709887E+06, 0.100925422763286362E+06, 0.100962602314510819E+06, 0.100994687767612981E+06, + 0.101018445383155631E+06, 0.101039638130810010E+06, 0.101060824122542370E+06, 0.101084945514884181E+06, 0.101122354145820311E+06, + 0.101165147778325379E+06, 0.101210847657910417E+06, 0.101256682236652778E+06, 0.101301382158490291E+06, 0.101341411155713809E+06, + 0.101372219111328362E+06, 0.101389231784620119E+06, 0.101390880863434664E+06, 0.101369226261351185E+06, 0.101331834231281726E+06, + 0.101285779545129859E+06, 0.101234345503529141E+06, 0.101180743690781746E+06, 0.101127223607977256E+06, 0.101076620915575957E+06, + 0.101030138146362922E+06, 0.100989582250385356E+06, 0.100956503181212684E+06, 0.100931937764084651E+06, 0.100920299784557195E+06, + 0.100918057371207338E+06, 0.100922770743209869E+06, 0.100933261994784887E+06, 0.100948483778151451E+06, 0.100967026543898348E+06, + 0.100987282070977919E+06, 0.101007276882737569E+06, 0.101025807002176851E+06, 0.101042092544874176E+06, 0.101053732614110791E+06, + 0.101061889868345606E+06, 0.101067702910314212E+06, 0.101070224192290465E+06, 0.101070263142884942E+06, 0.101067836061994312E+06, + 0.101188101877120876E+06, 0.101181904204517952E+06, 0.101175721080675750E+06, 0.101169689701016847E+06, 0.101163962332899173E+06, + 0.101158703372389791E+06, 0.101154083105507743E+06, 0.101151357736191479E+06, 0.101150899044327409E+06, 0.101152824487497259E+06, + 0.101156224838871945E+06, 0.101159507416219887E+06, 0.101162417168140935E+06, 0.101164756494849746E+06, 0.101166400553546104E+06, + 0.101165982684454619E+06, 0.101164433293333408E+06, 0.101163049411835455E+06, 0.101162175585306977E+06, 0.101162128095756125E+06, + 0.101163361425100273E+06, 0.101166227742201969E+06, 0.101170937924715152E+06, 0.101177913034471421E+06, 0.101186917319165936E+06, + 0.101197704545258457E+06, 0.101209946031686050E+06, 0.101223141837685776E+06, 0.101236628019135329E+06, 0.101248564959035430E+06, + 0.101259061289307880E+06, 0.101268404236147617E+06, 0.101274449875235630E+06, 0.101277082514349167E+06, 0.101276437786749404E+06, + 0.101272910152209646E+06, 0.101267124457491314E+06, 0.101260716984134080E+06, 0.101256743164844607E+06, 0.101253604663335806E+06, + 0.101250897345323741E+06, 0.101248591593381454E+06, 0.101246654559015689E+06, 0.101245041613427515E+06, 0.101243680788220503E+06, + 0.101243097273199470E+06, 0.101243781512439353E+06, 0.101244948599458978E+06, 0.101246597302939059E+06, 0.101248747416430124E+06, + 0.101251423906546814E+06, 0.101254153427662954E+06, 0.101257318705204321E+06, 0.101261887373189515E+06, 0.101267979989058746E+06, + 0.101275948774720324E+06, 0.101285713213097159E+06, 0.101296774828760288E+06, 0.101308302668075557E+06, 0.101319850467473152E+06, + 0.101329837083710619E+06, 0.101335921303205963E+06, 0.101339123113933456E+06, 0.101337898637374194E+06, 0.101333773323031986E+06, + 0.101328456667992868E+06, 0.101322897112772887E+06, 0.101317900606162963E+06, 0.101315889108461066E+06, 0.101316599306327043E+06, + 0.101319758730558635E+06, 0.101325424301052059E+06, 0.101333284991047447E+06, 0.101343211873693581E+06, 0.101353644944564134E+06, + 0.101363021317380320E+06, 0.101370049287251401E+06, 0.101372596455484265E+06, 0.101369268865042672E+06, 0.101360883616870342E+06, + 0.101347449435595729E+06, 0.101329133164082014E+06, 0.101305327141900649E+06, 0.101278380398203022E+06, 0.101249743471045615E+06, + 0.101219239546209603E+06, 0.101192352888002861E+06, 0.101165652475197479E+06, 0.101139697586887822E+06, 0.101114494511137265E+06, + 0.101090858686180072E+06, 0.101071576294283674E+06, 0.101057575297732197E+06, 0.101048074783742806E+06, 0.101044336258060692E+06, + 0.101046551193469917E+06, 0.101053556962642004E+06, 0.101063713831673056E+06, 0.101077829626709223E+06, 0.101095071852015652E+06, + 0.101113125151151267E+06, 0.101132720710483336E+06, 0.101154045391176667E+06, 0.101180390285880436E+06, 0.101211142948122884E+06, + 0.101237614514436951E+06, 0.101255726302408526E+06, 0.101259492448119025E+06, 0.101250509056824711E+06, 0.101227395084634161E+06, + 0.101182035261948520E+06, 0.101119630114631931E+06, 0.101050635848782738E+06, 0.100979922793482459E+06, 0.100910697623495973E+06, + 0.100847357213499476E+06, 0.100794166368117731E+06, 0.100758894445481623E+06, 0.100744322296544080E+06, 0.100745120848886974E+06, + 0.100759352059448109E+06, 0.100791294801023934E+06, 0.100833112039419531E+06, 0.100877562571698305E+06, 0.100920779246866339E+06, + 0.100955025798225848E+06, 0.100982525754081420E+06, 0.101006044587505748E+06, 0.101028143007870822E+06, 0.101055611280174300E+06, + 0.101091320427340703E+06, 0.101132355621430252E+06, 0.101176767088174020E+06, 0.101222102616479577E+06, 0.101267504098879013E+06, + 0.101307233300950669E+06, 0.101337730007502250E+06, 0.101356132691262712E+06, 0.101355517504656993E+06, 0.101326703347885734E+06, + 0.101286746249401243E+06, 0.101238373176205030E+06, 0.101184685036191077E+06, 0.101128907484998796E+06, 0.101073391747240559E+06, + 0.101019454525129811E+06, 0.100970871910515343E+06, 0.100929826661987419E+06, 0.100897105571455861E+06, 0.100876831879007659E+06, + 0.100867962906273533E+06, 0.100867330421829305E+06, 0.100873728684090966E+06, 0.100885749735442761E+06, 0.100902849954122852E+06, + 0.100924138951177738E+06, 0.100946961851234868E+06, 0.100969279025770302E+06, 0.100990033557581031E+06, 0.101008477654044342E+06, + 0.101024214908302165E+06, 0.101035732998499894E+06, 0.101041912961714450E+06, 0.101045642366251923E+06, 0.101046792406885972E+06, + 0.101045365333532347E+06, 0.101187355100872199E+06, 0.101181283838042174E+06, 0.101175299671037268E+06, 0.101169529662610788E+06, + 0.101164117431673949E+06, 0.101159220075809775E+06, 0.101155001817589582E+06, 0.101151624022777440E+06, 0.101152497595067340E+06, + 0.101156451659840226E+06, 0.101160648061411019E+06, 0.101164790528929152E+06, 0.101168618147906396E+06, 0.101171926049179310E+06, + 0.101174580360364256E+06, 0.101176526712674633E+06, 0.101176736224529814E+06, 0.101176257363116325E+06, 0.101176166983752380E+06, + 0.101176807287626842E+06, 0.101178681128324213E+06, 0.101182078251181316E+06, 0.101187204570596310E+06, 0.101194163269585537E+06, + 0.101203334524264646E+06, 0.101214364937736551E+06, 0.101226809413448165E+06, 0.101240149829298927E+06, 0.101253261358725853E+06, + 0.101265100089497806E+06, 0.101275120974395875E+06, 0.101282996940042518E+06, 0.101288828111014154E+06, 0.101291420149586207E+06, + 0.101290897222999163E+06, 0.101287639377078289E+06, 0.101283002528089506E+06, 0.101278193857728707E+06, 0.101273020512430914E+06, + 0.101269901051284018E+06, 0.101267678623295869E+06, 0.101265950449211479E+06, 0.101264703039611326E+06, 0.101263900879826906E+06, + 0.101263923607509249E+06, 0.101265004562038375E+06, 0.101266684912193334E+06, 0.101268855296950496E+06, 0.101271506964180182E+06, + 0.101274640173084292E+06, 0.101278241537383161E+06, 0.101282245825992912E+06, 0.101286353240369135E+06, 0.101291355828485597E+06, + 0.101297931619035255E+06, 0.101306253371424813E+06, 0.101316214078965480E+06, 0.101327380285913983E+06, 0.101338920669929619E+06, + 0.101349293450103680E+06, 0.101357122930671496E+06, 0.101362252520088790E+06, 0.101364464771970830E+06, 0.101363785192026829E+06, + 0.101359089181177871E+06, 0.101353368594169064E+06, 0.101348059285105599E+06, 0.101344504609358351E+06, 0.101342802273270747E+06, + 0.101343694674300015E+06, 0.101347186594235303E+06, 0.101353156284255645E+06, 0.101361135003142495E+06, 0.101370388484892959E+06, + 0.101380640458787442E+06, 0.101388946718752617E+06, 0.101393651801589484E+06, 0.101393499019751704E+06, 0.101386884558896083E+06, + 0.101374143979384535E+06, 0.101355609362859250E+06, 0.101331626780358332E+06, 0.101301083582183201E+06, 0.101263353354839783E+06, + 0.101221306897352624E+06, 0.101176993466944725E+06, 0.101136539903244993E+06, 0.101098204242251013E+06, 0.101061761330862719E+06, + 0.101028266665796909E+06, 0.100998589290583972E+06, 0.100975333400938267E+06, 0.100959068131358043E+06, 0.100949766177223195E+06, + 0.100947806353674678E+06, 0.100952626346498961E+06, 0.100962758032929953E+06, 0.100976213788639361E+06, 0.100993663080123253E+06, + 0.101014486892675981E+06, 0.101035822837299012E+06, 0.101058579399157214E+06, 0.101083303211150094E+06, 0.101113186489526008E+06, + 0.101147351565124962E+06, 0.101176652682216401E+06, 0.101196193972918787E+06, 0.101198569776344622E+06, 0.101186160134931008E+06, + 0.101157868126258880E+06, 0.101103141394806822E+06, 0.101031831614193070E+06, 0.100956733996206865E+06, 0.100882403087983286E+06, + 0.100813473138545116E+06, 0.100752516407046714E+06, 0.100703757785565627E+06, 0.100676218536944187E+06, 0.100667431274046598E+06, + 0.100674873519601999E+06, 0.100697658618489222E+06, 0.100739841159568794E+06, 0.100789068474863947E+06, 0.100839720710070338E+06, + 0.100886379550526690E+06, 0.100923029883014446E+06, 0.100953143284320337E+06, 0.100977639241319004E+06, 0.100999128395021136E+06, + 0.101024581691416737E+06, 0.101055845921262473E+06, 0.101093715024692676E+06, 0.101137145750038864E+06, 0.101181709309337297E+06, + 0.101225325474523444E+06, 0.101263559713032722E+06, 0.101292474677031365E+06, 0.101308682549641118E+06, 0.101297475120822361E+06, + 0.101271409211849808E+06, 0.101232040601299872E+06, 0.101182869285470704E+06, 0.101128290980360704E+06, 0.101072929755581790E+06, + 0.101016889073163620E+06, 0.100962491541966170E+06, 0.100912327910715336E+06, 0.100869361400221751E+06, 0.100839775977090918E+06, + 0.100823441492130820E+06, 0.100816113342184137E+06, 0.100817094874734074E+06, 0.100825233759279654E+06, 0.100839074432490510E+06, + 0.100858082771811969E+06, 0.100882174552001874E+06, 0.100906977487573211E+06, 0.100931151837540980E+06, 0.100953671595204651E+06, + 0.100973813441941427E+06, 0.100991208365737388E+06, 0.101004593996319396E+06, 0.101014464426847393E+06, 0.101019840305871679E+06, + 0.101022516216040211E+06, 0.101022479820383916E+06, 0.101189306237606637E+06, 0.101183099563423224E+06, 0.101177524645541649E+06, + 0.101172236435105573E+06, 0.101167371532973528E+06, 0.101163082020276575E+06, 0.101159529060147339E+06, 0.101159316447558173E+06, + 0.101160894564677219E+06, 0.101164348300187223E+06, 0.101169261422140553E+06, 0.101174195290734366E+06, 0.101178879818970003E+06, + 0.101183100812083387E+06, 0.101186714675334646E+06, 0.101189656703835382E+06, 0.101191942124414170E+06, 0.101192917377320977E+06, + 0.101193593575982464E+06, 0.101195069630171711E+06, 0.101197693383898673E+06, 0.101201751769885639E+06, 0.101207449602623747E+06, + 0.101214890679059696E+06, 0.101224061589853489E+06, 0.101235336912347877E+06, 0.101248190104239126E+06, 0.101262427935202722E+06, + 0.101275786221996692E+06, 0.101287697523967043E+06, 0.101297635973110140E+06, 0.101305160473319178E+06, 0.101310051693956630E+06, + 0.101312576731523863E+06, 0.101312178530984005E+06, 0.101309704462442271E+06, 0.101306154021924303E+06, 0.101301740366064056E+06, + 0.101296951709652378E+06, 0.101292269396465854E+06, 0.101290108113855764E+06, 0.101288928548419208E+06, 0.101288387917089291E+06, + 0.101288777866387623E+06, 0.101290116771842790E+06, 0.101292139767421628E+06, 0.101294723268304471E+06, 0.101297795211849851E+06, + 0.101301366709605994E+06, 0.101305420330384557E+06, 0.101309869927812077E+06, 0.101314312823006214E+06, 0.101319116997910372E+06, + 0.101324617109151222E+06, 0.101331532615370001E+06, 0.101340103637168490E+06, 0.101350201834497682E+06, 0.101361344371531173E+06, + 0.101372418886796950E+06, 0.101381948875157381E+06, 0.101388923839096911E+06, 0.101393136106285616E+06, 0.101394429864949576E+06, + 0.101392894622174237E+06, 0.101388710803148075E+06, 0.101383777236252092E+06, 0.101379295952832908E+06, 0.101375940276367168E+06, + 0.101374441230547527E+06, 0.101375326622697306E+06, 0.101379093018278771E+06, 0.101385343361571824E+06, 0.101393971058482173E+06, + 0.101404050563811383E+06, 0.101413309721598285E+06, 0.101419590399406094E+06, 0.101421556394179410E+06, 0.101418021431235960E+06, + 0.101407974515161055E+06, 0.101390537479077990E+06, 0.101366032709315157E+06, 0.101334626683717870E+06, 0.101295933958054040E+06, + 0.101248443893183838E+06, 0.101195557967522065E+06, 0.101139585544601810E+06, 0.101085211343045346E+06, 0.101035266930195139E+06, + 0.100988241812145512E+06, 0.100945367896748721E+06, 0.100910497202633036E+06, 0.100884702886764164E+06, 0.100866517649476897E+06, + 0.100856014684083144E+06, 0.100852787000617667E+06, 0.100856653557479323E+06, 0.100867163372326730E+06, 0.100881111266454434E+06, + 0.100900315195405696E+06, 0.100923976750114074E+06, 0.100948598119614544E+06, 0.100974781704195004E+06, 0.101003202157587060E+06, + 0.101036407590628412E+06, 0.101073193182310031E+06, 0.101104736474453239E+06, 0.101125695287679831E+06, 0.101129453279073452E+06, + 0.101117773581594010E+06, 0.101089185532541305E+06, 0.101034032199054171E+06, 0.100963945545633382E+06, 0.100886699328991119E+06, + 0.100810636627241329E+06, 0.100740715610179395E+06, 0.100679191246166200E+06, 0.100632989251138570E+06, 0.100613781871159343E+06, + 0.100610871530594683E+06, 0.100624379990977119E+06, 0.100656925116010229E+06, 0.100705935141557828E+06, 0.100761070879974053E+06, + 0.100816622699684551E+06, 0.100864793595773081E+06, 0.100902967646118850E+06, 0.100932714749620762E+06, 0.100956310150092322E+06, + 0.100973624358999965E+06, 0.100992241483773090E+06, 0.101016637765204548E+06, 0.101048154107647293E+06, 0.101087466334016062E+06, + 0.101132339254048915E+06, 0.101174823812832328E+06, 0.101210761915469266E+06, 0.101237271423401384E+06, 0.101243002885737078E+06, + 0.101230131791106003E+06, 0.101203940299668466E+06, 0.101166656487591579E+06, 0.101121119041289232E+06, 0.101069073832594047E+06, + 0.101014700223724387E+06, 0.100959265268248433E+06, 0.100905468112225586E+06, 0.100856040902612105E+06, 0.100814460428244129E+06, + 0.100787259237540056E+06, 0.100772005863003345E+06, 0.100765985352267919E+06, 0.100768479113289053E+06, 0.100778366997407138E+06, + 0.100794945598743492E+06, 0.100817620478677374E+06, 0.100842147859125718E+06, 0.100867955315801722E+06, 0.100893394586128459E+06, + 0.100917107047287223E+06, 0.100938380004807230E+06, 0.100955347801049342E+06, 0.100970101009214006E+06, 0.100982904354844184E+06, + 0.100992784717252944E+06, 0.100997426697573173E+06, 0.100999203666720758E+06, 0.101193726602745155E+06, 0.101187754050723946E+06, + 0.101182357442443288E+06, 0.101177791388126643E+06, 0.101173723996436573E+06, 0.101170304719806183E+06, 0.101170612153776412E+06, + 0.101172440371721386E+06, 0.101174837075875621E+06, 0.101177672254314428E+06, 0.101182161160034389E+06, 0.101187828651191783E+06, + 0.101193320301503438E+06, 0.101198410730358519E+06, 0.101202946144533795E+06, 0.101206852558810875E+06, 0.101210007801575470E+06, + 0.101212489910168282E+06, 0.101214469378389869E+06, 0.101216878002924321E+06, 0.101220363461237575E+06, 0.101225214136769951E+06, + 0.101231637580600829E+06, 0.101239741560505950E+06, 0.101249517808410572E+06, 0.101260983023677167E+06, 0.101275957870551239E+06, + 0.101290656294668952E+06, 0.101304333702323362E+06, 0.101316427532517599E+06, 0.101326426428850100E+06, 0.101333915035895625E+06, + 0.101338611708287717E+06, 0.101340492859798338E+06, 0.101340362563395611E+06, 0.101338449476013702E+06, 0.101335257523435517E+06, + 0.101331249861504504E+06, 0.101326886093198918E+06, 0.101322617484757109E+06, 0.101318867500197564E+06, 0.101317900452591755E+06, + 0.101318314786954928E+06, 0.101319723768116164E+06, 0.101321959881412520E+06, 0.101324889048512938E+06, 0.101328347647524672E+06, + 0.101332174840765205E+06, 0.101336616060312401E+06, 0.101341556829236884E+06, 0.101346573413864826E+06, 0.101351603295543347E+06, + 0.101356815104860521E+06, 0.101362438373961399E+06, 0.101369371088361426E+06, 0.101378082295762331E+06, 0.101388314410706720E+06, + 0.101399372327800622E+06, 0.101410061836120745E+06, 0.101419580351030396E+06, 0.101425913537260407E+06, 0.101429293259021812E+06, + 0.101429804412116951E+06, 0.101427672924137820E+06, 0.101424080437455879E+06, 0.101419619212416699E+06, 0.101415230974183942E+06, + 0.101412067965185430E+06, 0.101410791086110883E+06, 0.101411739073867124E+06, 0.101415639705951602E+06, 0.101423312622668134E+06, + 0.101432474045874798E+06, 0.101442051195699867E+06, 0.101450469188552204E+06, 0.101454491373749755E+06, 0.101453440137517347E+06, + 0.101446281387837167E+06, 0.101431595048405667E+06, 0.101408886711617088E+06, 0.101378784184722594E+06, 0.101341184770978914E+06, + 0.101295889547724786E+06, 0.101240328400627433E+06, 0.101177652284460986E+06, 0.101111150684114546E+06, 0.101044053118300144E+06, + 0.100984918740243505E+06, 0.100930374090685815E+06, 0.100881582472409573E+06, 0.100841112633375247E+06, 0.100809768362702191E+06, + 0.100786799243457121E+06, 0.100772143085301912E+06, 0.100764968278141983E+06, 0.100765770745809103E+06, 0.100774102380776618E+06, + 0.100787701814049200E+06, 0.100807502103195773E+06, 0.100832717694658859E+06, 0.100860249536352872E+06, 0.100889852423407749E+06, + 0.100921848628126099E+06, 0.100957861355781963E+06, 0.100996433916241411E+06, 0.101029829562515966E+06, 0.101052485930506547E+06, + 0.101058372937639273E+06, 0.101049548410078569E+06, 0.101024243456762211E+06, 0.100972590760278690E+06, 0.100908281417167527E+06, + 0.100837060983074800E+06, 0.100768161325613342E+06, 0.100704714640766149E+06, 0.100649980401007386E+06, 0.100610226186345069E+06, + 0.100590748020045430E+06, 0.100587436259410169E+06, 0.100600313080586799E+06, 0.100641206195168561E+06, 0.100694783185600594E+06, + 0.100753395339411843E+06, 0.100811221255729251E+06, 0.100860359364136690E+06, 0.100899824043495319E+06, 0.100928315410134717E+06, + 0.100945425133485944E+06, 0.100949685705930868E+06, 0.100959203677864440E+06, 0.100974757114044391E+06, 0.100998131833821230E+06, + 0.101033920715517670E+06, 0.101074219109624129E+06, 0.101114091820176982E+06, 0.101149405994865883E+06, 0.101170348641579942E+06, + 0.101169807298637141E+06, 0.101156298476682292E+06, 0.101130628971099330E+06, 0.101094643437300154E+06, 0.101052492078486888E+06, + 0.101007253119503090E+06, 0.100955907017813224E+06, 0.100902084595712833E+06, 0.100849827379669470E+06, 0.100802083544595851E+06, + 0.100765913220995702E+06, 0.100739572869835451E+06, 0.100723779479156976E+06, 0.100718506421119528E+06, 0.100722320980193326E+06, + 0.100734436110120514E+06, 0.100755329206052033E+06, 0.100779519272158068E+06, 0.100805173540144926E+06, 0.100830784490592530E+06, + 0.100856189170746162E+06, 0.100880432886013805E+06, 0.100899949784039432E+06, 0.100917438620547167E+06, 0.100933522862752710E+06, + 0.100948109352301544E+06, 0.100961044329522949E+06, 0.100971373211325132E+06, 0.100975423948777170E+06, 0.101200152192834488E+06, + 0.101194982325493736E+06, 0.101190103263664205E+06, 0.101186138559247396E+06, 0.101183134221834189E+06, 0.101184216681154692E+06, + 0.101186521041798725E+06, 0.101189436060083317E+06, 0.101192802546943451E+06, 0.101196478796712297E+06, 0.101200354354545649E+06, + 0.101205668611732151E+06, 0.101211929159398627E+06, 0.101217855930562437E+06, 0.101223284560094209E+06, 0.101227968215825720E+06, + 0.101231889676374194E+06, 0.101235394681567603E+06, 0.101238691342655846E+06, 0.101242180145337508E+06, 0.101246637252434826E+06, + 0.101252408136256170E+06, 0.101259706939182157E+06, 0.101268648761024378E+06, 0.101279505402642011E+06, 0.101294343975882977E+06, + 0.101309563533686218E+06, 0.101324641711895500E+06, 0.101338688391072021E+06, 0.101351044389960793E+06, 0.101361207159967045E+06, + 0.101368783445243811E+06, 0.101373529077171552E+06, 0.101374957490127519E+06, 0.101374464042535998E+06, 0.101372814207710297E+06, + 0.101369991240096075E+06, 0.101366429702577938E+06, 0.101362562430391059E+06, 0.101358815668015828E+06, 0.101355589086463762E+06, + 0.101353446673457220E+06, 0.101354379072032898E+06, 0.101356568662050558E+06, 0.101359675232751892E+06, 0.101363521918530183E+06, + 0.101367901119934351E+06, 0.101372596354978567E+06, 0.101377679630817802E+06, 0.101383555064504282E+06, 0.101389214201889146E+06, + 0.101394747283543154E+06, 0.101400304955646759E+06, 0.101406085277459220E+06, 0.101412285840230092E+06, 0.101421118963008921E+06, + 0.101431763041225102E+06, 0.101442507714153820E+06, 0.101452705296310087E+06, 0.101461587946274274E+06, 0.101468308697248838E+06, + 0.101470980618346424E+06, 0.101470729759961876E+06, 0.101468260238464049E+06, 0.101464485269084631E+06, 0.101460142280246233E+06, + 0.101455922507406227E+06, 0.101452998879112638E+06, 0.101452045655453316E+06, 0.101454002525278673E+06, 0.101458795222069632E+06, + 0.101466167386261062E+06, 0.101474834484365027E+06, 0.101483448321051124E+06, 0.101490293297485317E+06, 0.101492761571887779E+06, + 0.101487122913431667E+06, 0.101474656695076628E+06, 0.101456224507296021E+06, 0.101430664509854570E+06, 0.101396241168372988E+06, + 0.101353344458271313E+06, 0.101301873429881321E+06, 0.101240809982906721E+06, 0.101170237649192510E+06, 0.101096056635001150E+06, + 0.101022326149495057E+06, 0.100954494264510751E+06, 0.100892663983306251E+06, 0.100837194485465618E+06, 0.100789854158125687E+06, + 0.100752681688232609E+06, 0.100724050472389747E+06, 0.100703743253736306E+06, 0.100691513151292049E+06, 0.100687489061012806E+06, + 0.100691112445670500E+06, 0.100703488782601926E+06, 0.100723515984008409E+06, 0.100749686437924174E+06, 0.100779862035053753E+06, + 0.100812870466228749E+06, 0.100848356219152789E+06, 0.100886618033728999E+06, 0.100925814700154908E+06, 0.100959913340029161E+06, + 0.100983841408427761E+06, 0.100992708938197888E+06, 0.100988038726636543E+06, 0.100967451749821237E+06, 0.100923773661071609E+06, + 0.100869154347678006E+06, 0.100808293671752166E+06, 0.100749950128448239E+06, 0.100695742144580625E+06, 0.100650055466795442E+06, + 0.100620543751264457E+06, 0.100607774629359716E+06, 0.100609856499218455E+06, 0.100627731512123690E+06, 0.100665827330432643E+06, + 0.100713727303578300E+06, 0.100768972922192886E+06, 0.100825101449405265E+06, 0.100873709631678183E+06, 0.100911910907812446E+06, + 0.100937425920985901E+06, 0.100943826278808614E+06, 0.100938923612846338E+06, 0.100932772703382885E+06, 0.100933209681834254E+06, + 0.100949942917228545E+06, 0.100978390439217677E+06, 0.101012218238497939E+06, 0.101047001443362271E+06, 0.101078030320958118E+06, + 0.101092528178749781E+06, 0.101092763600199483E+06, 0.101079667768304178E+06, 0.101055363093306296E+06, 0.101021923023798488E+06, + 0.100985043918944197E+06, 0.100942576674115116E+06, 0.100896142310934607E+06, 0.100846740359288175E+06, 0.100796745756417309E+06, + 0.100754281013923188E+06, 0.100719661969801513E+06, 0.100694202095497239E+06, 0.100678990016565542E+06, 0.100674159552381345E+06, + 0.100679144362130333E+06, 0.100696517057853678E+06, 0.100718723297862292E+06, 0.100743828966135392E+06, 0.100770038155539907E+06, + 0.100795879753092362E+06, 0.100820314666932885E+06, 0.100840279171251284E+06, 0.100859249879902098E+06, 0.100877455365052447E+06, + 0.100894767625869688E+06, 0.100911051050858092E+06, 0.100926113687447752E+06, 0.100939677540915931E+06, 0.100954098051095163E+06, + 0.101208266074669766E+06, 0.101204147301312958E+06, 0.101200416332034234E+06, 0.101197391022381067E+06, 0.101199181271863577E+06, + 0.101202094479608772E+06, 0.101205718922681015E+06, 0.101209868079757638E+06, 0.101214363087133126E+06, 0.101219049217859545E+06, + 0.101223809934456556E+06, 0.101228578149758148E+06, 0.101234563424877633E+06, 0.101241302361129114E+06, 0.101247428820028508E+06, + 0.101252833705618847E+06, 0.101257741214607289E+06, 0.101262268791874914E+06, 0.101266621965163562E+06, 0.101271104202253337E+06, + 0.101276449761759577E+06, 0.101283261996570189E+06, 0.101291578552841063E+06, 0.101301921001578070E+06, 0.101316864610287244E+06, + 0.101332633397110185E+06, 0.101348565409528048E+06, 0.101363970375545556E+06, 0.101378339950166031E+06, 0.101391005184961628E+06, + 0.101401390238182328E+06, 0.101409118811233842E+06, 0.101412813852507519E+06, 0.101413916622343488E+06, 0.101413648249779086E+06, + 0.101412262363096830E+06, 0.101409843816287481E+06, 0.101406792118611833E+06, 0.101403515263375913E+06, 0.101400419883465394E+06, + 0.101397648089374270E+06, 0.101396200071828469E+06, 0.101396462464251483E+06, 0.101399249041504649E+06, 0.101403242459244415E+06, + 0.101408064521844237E+06, 0.101413460579763079E+06, 0.101419299541355576E+06, 0.101425515902185769E+06, 0.101431872156549493E+06, + 0.101438092345517420E+06, 0.101444082593329236E+06, 0.101449980221889302E+06, 0.101455962961780679E+06, 0.101462741205452243E+06, + 0.101470817291088752E+06, 0.101480892587434573E+06, 0.101491089133211004E+06, 0.101500643428374140E+06, 0.101508817670985038E+06, + 0.101514860224122342E+06, 0.101517434476198061E+06, 0.101516541747761323E+06, 0.101513815068472235E+06, 0.101509904719619197E+06, + 0.101505507654049128E+06, 0.101501313463842132E+06, 0.101498849002981064E+06, 0.101499159934514231E+06, 0.101501693020130377E+06, + 0.101506338552975649E+06, 0.101512651659291208E+06, 0.101520288072555239E+06, 0.101527432009874057E+06, 0.101531192551327069E+06, + 0.101528423709889583E+06, 0.101519435532333911E+06, 0.101504734513441072E+06, 0.101484004484384001E+06, 0.101456280732745858E+06, + 0.101419035179553714E+06, 0.101371837096264266E+06, 0.101315248944149382E+06, 0.101249891741609565E+06, 0.101174205010685138E+06, + 0.101095025216710172E+06, 0.101016603839094241E+06, 0.100942714517862012E+06, 0.100875651961458614E+06, 0.100815206600637175E+06, + 0.100762266129504540E+06, 0.100719792923412402E+06, 0.100688381242510412E+06, 0.100664315202569429E+06, 0.100646899315571907E+06, + 0.100636389190856382E+06, 0.100633921317728295E+06, 0.100640986745192960E+06, 0.100657927960284273E+06, 0.100683603999329847E+06, + 0.100715139361547874E+06, 0.100750464071587950E+06, 0.100789001781336541E+06, 0.100828980626378441E+06, 0.100867904881876937E+06, + 0.100901941917073651E+06, 0.100927518925117751E+06, 0.100941703370720032E+06, 0.100943313763502156E+06, 0.100929483993483183E+06, + 0.100897899422321643E+06, 0.100855144068640948E+06, 0.100806216832129357E+06, 0.100757963881253396E+06, 0.100713882396988687E+06, + 0.100678037239657642E+06, 0.100660578064393208E+06, 0.100655660139403961E+06, 0.100663394611081239E+06, 0.100687757803070126E+06, + 0.100726360544964817E+06, 0.100771737117872792E+06, 0.100819550423355045E+06, 0.100863789606076709E+06, 0.100903960982124961E+06, + 0.100937933974381580E+06, 0.100955929021348216E+06, 0.100950002084778927E+06, 0.100936336168784517E+06, 0.100920611799506456E+06, + 0.100908792443247541E+06, 0.100909956087163751E+06, 0.100924519937428529E+06, 0.100950317855032117E+06, 0.100978637481090613E+06, + 0.101001785171553231E+06, 0.101014600980588948E+06, 0.101015533816949537E+06, 0.101004399554267075E+06, 0.100982402170127083E+06, + 0.100954472767269413E+06, 0.100920498290662959E+06, 0.100881272186000555E+06, 0.100838252143924561E+06, 0.100793001524282852E+06, + 0.100749722238879811E+06, 0.100710007831689465E+06, 0.100676561452258436E+06, 0.100651754156739727E+06, 0.100637016515992684E+06, + 0.100632797680647462E+06, 0.100643122435673547E+06, 0.100662040946369423E+06, 0.100684765371038040E+06, 0.100710073382574032E+06, + 0.100736158886730540E+06, 0.100761558107963079E+06, 0.100780935166741401E+06, 0.100798370121153508E+06, 0.100816555152162895E+06, + 0.100835390903751701E+06, 0.100853847765655024E+06, 0.100871757501481305E+06, 0.100888895778612612E+06, 0.100908175229415137E+06, + 0.100925669047910487E+06, 0.101217702072300162E+06, 0.101214879429494846E+06, 0.101212918203238412E+06, 0.101215072363802130E+06, + 0.101218250672383481E+06, 0.101222522132735277E+06, 0.101227622288938786E+06, 0.101233167267756522E+06, 0.101238956389902218E+06, + 0.101244820309774892E+06, 0.101250635435466815E+06, 0.101256335683556361E+06, 0.101261921151622766E+06, 0.101268342600560762E+06, + 0.101275163933372678E+06, 0.101281497833931266E+06, 0.101287383286156546E+06, 0.101292932525330558E+06, 0.101298347923196663E+06, + 0.101303932128846092E+06, 0.101310090422888767E+06, 0.101317693616226330E+06, 0.101327652607175361E+06, 0.101342480557763687E+06, + 0.101358556451299402E+06, 0.101375279086523937E+06, 0.101391978870831925E+06, 0.101407971443584844E+06, 0.101422613121423448E+06, + 0.101435506823643867E+06, 0.101446124078218185E+06, 0.101452234738676838E+06, 0.101455284023688801E+06, 0.101456737369482420E+06, + 0.101456865445288451E+06, 0.101455916182255954E+06, 0.101454121953738781E+06, 0.101451661773156113E+06, 0.101449081947506013E+06, + 0.101446228059309360E+06, 0.101444208961239303E+06, 0.101443612932188233E+06, 0.101444705011359765E+06, 0.101447541270001515E+06, + 0.101452383501387390E+06, 0.101458282693875270E+06, 0.101464997464114887E+06, 0.101472100710916289E+06, 0.101479273864667499E+06, + 0.101486350419971670E+06, 0.101493152086614995E+06, 0.101499576717366377E+06, 0.101505843270561643E+06, 0.101512436676125639E+06, + 0.101519641676807107E+06, 0.101527434410592061E+06, 0.101535644765811841E+06, 0.101545029301612725E+06, 0.101553754432012545E+06, + 0.101560956040866411E+06, 0.101564550165702050E+06, 0.101566892094339870E+06, 0.101567035078111294E+06, 0.101564167039659485E+06, + 0.101560257949168226E+06, 0.101555969226616333E+06, 0.101552313766367617E+06, 0.101550452021603851E+06, 0.101550963150145908E+06, + 0.101553454481203808E+06, 0.101557594737071355E+06, 0.101562591960326725E+06, 0.101568055832384678E+06, 0.101570018237429336E+06, + 0.101568806715803599E+06, 0.101563796324326468E+06, 0.101553825571776295E+06, 0.101537561122490020E+06, 0.101515230788797810E+06, + 0.101485862600308523E+06, 0.101448189650402157E+06, 0.101397681000099896E+06, 0.101336913516701141E+06, 0.101267241010695536E+06, + 0.101189600658946001E+06, 0.101107785950000631E+06, 0.101027329917614610E+06, 0.100951013494106854E+06, 0.100883020611558357E+06, + 0.100825246076290889E+06, 0.100775271676367163E+06, 0.100732070018118597E+06, 0.100693807828755365E+06, 0.100660471847562090E+06, + 0.100632198820324600E+06, 0.100610336348454613E+06, 0.100597445568148105E+06, 0.100596347705297740E+06, 0.100608739289963560E+06, + 0.100632312399144867E+06, 0.100664180492312080E+06, 0.100701580165578795E+06, 0.100742885809197804E+06, 0.100784251808581277E+06, + 0.100822721504335888E+06, 0.100857114729781009E+06, 0.100884974331454141E+06, 0.100904296005382625E+06, 0.100913525976403209E+06, + 0.100909880311948247E+06, 0.100892635225440783E+06, 0.100865034092500646E+06, 0.100830041776689235E+06, 0.100792635237818962E+06, + 0.100758858691726316E+06, 0.100734424708176390E+06, 0.100726153683192097E+06, 0.100729591906647329E+06, 0.100742469628359380E+06, + 0.100772373108355430E+06, 0.100810039805286127E+06, 0.100850865902025442E+06, 0.100889839249818047E+06, 0.100924291493751982E+06, + 0.100954018166122405E+06, 0.100976020229241141E+06, 0.100977598211779696E+06, 0.100962801120868462E+06, 0.100940325812200113E+06, + 0.100915300637579014E+06, 0.100897607613392654E+06, 0.100888545266499175E+06, 0.100887361365753401E+06, 0.100894417619390835E+06, + 0.100914107950286358E+06, 0.100931864535990011E+06, 0.100942729300749750E+06, 0.100943712413188565E+06, 0.100933999633237443E+06, + 0.100915953837210676E+06, 0.100891962587812566E+06, 0.100861290497928669E+06, 0.100825794229352119E+06, 0.100786805648525173E+06, + 0.100747059949918155E+06, 0.100708052571343884E+06, 0.100670389177752746E+06, 0.100637438856290988E+06, 0.100612791553316754E+06, + 0.100598161054412602E+06, 0.100597616745557592E+06, 0.100608245258248513E+06, 0.100627589752602711E+06, 0.100652501052796259E+06, + 0.100677256390096882E+06, 0.100702485105916334E+06, 0.100721371071945381E+06, 0.100737732280855227E+06, 0.100754743779602475E+06, + 0.100772593580461515E+06, 0.100791374419969914E+06, 0.100810897025248196E+06, 0.100830367089737425E+06, 0.100852737881952431E+06, + 0.100874075837282377E+06, 0.100893534157121714E+06, 0.101228070489269143E+06, 0.101227544665406953E+06, 0.101230349746524807E+06, + 0.101234269851944497E+06, 0.101239184467959683E+06, 0.101244939450664504E+06, 0.101251545017166776E+06, 0.101258662705518451E+06, + 0.101265918196699597E+06, 0.101273125560589353E+06, 0.101280152736103031E+06, 0.101286933875186733E+06, 0.101293407125996848E+06, + 0.101299586824039099E+06, 0.101306376779591956E+06, 0.101313623028716072E+06, 0.101320476967868250E+06, 0.101327043370354135E+06, + 0.101333520713772232E+06, 0.101340211822319048E+06, 0.101347526837547412E+06, 0.101356523012281294E+06, 0.101370533287668499E+06, + 0.101386582740267011E+06, 0.101403758993542797E+06, 0.101421430602220105E+06, 0.101438909393433467E+06, 0.101455505881131437E+06, + 0.101470586854150286E+06, 0.101483635012064580E+06, 0.101492144560654036E+06, 0.101497362403152074E+06, 0.101500801900675287E+06, + 0.101502736875093309E+06, 0.101503413235270535E+06, 0.101503062612840484E+06, 0.101501914512809366E+06, 0.101500206465205003E+06, + 0.101497831592138784E+06, 0.101495767534276791E+06, 0.101494714546066039E+06, 0.101495119352637426E+06, 0.101497237786485115E+06, + 0.101501125674684867E+06, 0.101506644060371764E+06, 0.101514150312748505E+06, 0.101522320784248848E+06, 0.101530563331544297E+06, + 0.101538706294350879E+06, 0.101546559377466736E+06, 0.101553946547580461E+06, 0.101560765945043371E+06, 0.101567653265792658E+06, + 0.101574587210003941E+06, 0.101581752742970988E+06, 0.101589174518686996E+06, 0.101596642355671458E+06, 0.101603818859754785E+06, + 0.101610799838750623E+06, 0.101614811522755466E+06, 0.101617790546373333E+06, 0.101619757440904345E+06, 0.101620562545717650E+06, + 0.101618884459059045E+06, 0.101615191240677028E+06, 0.101611483339551589E+06, 0.101608375965291722E+06, 0.101606589668011176E+06, + 0.101606767311590491E+06, 0.101608967585915860E+06, 0.101612347393029107E+06, 0.101614810665037265E+06, 0.101614446811429036E+06, + 0.101613127583126843E+06, 0.101609516694027276E+06, 0.101602475273863849E+06, 0.101591105455035053E+06, 0.101574139304303288E+06, + 0.101552261616850359E+06, 0.101522964529426812E+06, 0.101483809256113498E+06, 0.101431803333729331E+06, 0.101367984772122625E+06, + 0.101295216781381270E+06, 0.101216180859079337E+06, 0.101134418945842335E+06, 0.101057719484696820E+06, 0.100987761361816083E+06, + 0.100925129407695815E+06, 0.100869076127166059E+06, 0.100819148307903684E+06, 0.100772602660554068E+06, 0.100726367887494707E+06, + 0.100682387602061091E+06, 0.100642046686646194E+06, 0.100608073036628615E+06, 0.100583165331615121E+06, 0.100571567333927058E+06, + 0.100579161681519065E+06, 0.100599831523424771E+06, 0.100631457444745640E+06, 0.100671162741316628E+06, 0.100715517300559659E+06, + 0.100759196447210823E+06, 0.100798644466533326E+06, 0.100834218092755124E+06, 0.100864022068452279E+06, 0.100886844670119492E+06, + 0.100903072952249466E+06, 0.100910324635737983E+06, 0.100907110564502160E+06, 0.100894913649374212E+06, 0.100873485872527890E+06, + 0.100847908218072756E+06, 0.100825028815845202E+06, 0.100812235195442801E+06, 0.100811789392154620E+06, 0.100821477468724654E+06, + 0.100842188280174509E+06, 0.100874882105417564E+06, 0.100910352034741096E+06, 0.100944613694273561E+06, 0.100970573806106200E+06, + 0.100992876564753780E+06, 0.101010256709896377E+06, 0.101017365734439736E+06, 0.101004642180764087E+06, 0.100981216767300502E+06, + 0.100950670557522288E+06, 0.100918693714911191E+06, 0.100893168282002865E+06, 0.100873786774855747E+06, 0.100862092518860401E+06, + 0.100858765389723776E+06, 0.100863848594959985E+06, 0.100872455106490743E+06, 0.100880727391939872E+06, 0.100881060958518239E+06, + 0.100871581642927995E+06, 0.100854982629453050E+06, 0.100833968938175327E+06, 0.100809126941723182E+06, 0.100777926015906574E+06, + 0.100744862813125714E+06, 0.100711030659190204E+06, 0.100674920663551122E+06, 0.100638665812651045E+06, 0.100604613640158801E+06, + 0.100577951755037328E+06, 0.100565299257314167E+06, 0.100564490794773781E+06, 0.100574070775104672E+06, 0.100592267906427369E+06, + 0.100616576592620535E+06, 0.100643954138155808E+06, 0.100661679785274406E+06, 0.100676519993234426E+06, 0.100692101751513052E+06, + 0.100708845098980164E+06, 0.100726890359751837E+06, 0.100746088291053093E+06, 0.100766274118497415E+06, 0.100790485020117267E+06, + 0.100814283052694198E+06, 0.100836998900601233E+06, 0.100857834251143926E+06, 0.101239951294366925E+06, 0.101243511198018721E+06, + 0.101248266604097182E+06, 0.101254120739513630E+06, 0.101260940255995316E+06, 0.101268566543099048E+06, 0.101276830453567702E+06, + 0.101285622454819968E+06, 0.101294523809254446E+06, 0.101303237484829937E+06, 0.101311620976720500E+06, 0.101319644374765689E+06, + 0.101327259549206297E+06, 0.101334480948853117E+06, 0.101341388354789131E+06, 0.101348710884544664E+06, 0.101356521517190282E+06, + 0.101364093945627537E+06, 0.101371621643877312E+06, 0.101379408199202080E+06, 0.101388443315429948E+06, 0.101401687552132498E+06, + 0.101416572004818678E+06, 0.101433189992554107E+06, 0.101451428970825116E+06, 0.101470024045938291E+06, 0.101488255659360628E+06, + 0.101505416028128879E+06, 0.101520868917434069E+06, 0.101531842805264969E+06, 0.101539245769958565E+06, 0.101544605958666289E+06, + 0.101548569302459247E+06, 0.101551134535491103E+06, 0.101552518676128384E+06, 0.101552933361419549E+06, 0.101552598628048305E+06, + 0.101551346091754502E+06, 0.101549620534837697E+06, 0.101548503290274006E+06, 0.101548531268210281E+06, 0.101550086213979870E+06, + 0.101553415865284071E+06, 0.101558574308658994E+06, 0.101566141420655156E+06, 0.101575323430362041E+06, 0.101584790524686381E+06, + 0.101594148506046142E+06, 0.101603272905442951E+06, 0.101611945735174741E+06, 0.101619979003416622E+06, 0.101627204805596586E+06, + 0.101634427668451928E+06, 0.101641404911077247E+06, 0.101648381901037224E+06, 0.101655340222651532E+06, 0.101662034474683896E+06, + 0.101666783103935741E+06, 0.101669591715802919E+06, 0.101672592019255666E+06, 0.101674896474706766E+06, 0.101676486613950226E+06, + 0.101677173545713507E+06, 0.101676735064566892E+06, 0.101674421820609132E+06, 0.101671063643987713E+06, 0.101668202552547300E+06, + 0.101666520557556054E+06, 0.101666348434875123E+06, 0.101667923680669555E+06, 0.101669351667803800E+06, 0.101668978131977754E+06, + 0.101666110028333933E+06, 0.101660538752964931E+06, 0.101654594444694463E+06, 0.101645738692219165E+06, 0.101634351733125281E+06, + 0.101619445806351592E+06, 0.101597486529762551E+06, 0.101566963080607631E+06, 0.101526313623151611E+06, 0.101474414132893216E+06, + 0.101408806070782084E+06, 0.101334676336432865E+06, 0.101255967485764850E+06, 0.101177930379907673E+06, 0.101105923487214692E+06, + 0.101041528067973224E+06, 0.100984421243628807E+06, 0.100931366999700622E+06, 0.100882259035952666E+06, 0.100834318510275116E+06, + 0.100780975023316409E+06, 0.100725029283105585E+06, 0.100672125573187601E+06, 0.100626333648281943E+06, 0.100591108252538659E+06, + 0.100571154519613207E+06, 0.100572764811242494E+06, 0.100590644123334263E+06, 0.100622114840101916E+06, 0.100663170419413218E+06, + 0.100711109304953105E+06, 0.100759450274770090E+06, 0.100803668821019484E+06, 0.100843723009858411E+06, 0.100878065056743988E+06, + 0.100905193898488564E+06, 0.100924238150348683E+06, 0.100935705112497482E+06, 0.100940040808540827E+06, 0.100938611611957211E+06, + 0.100929132041696241E+06, 0.100917754954705204E+06, 0.100905818223427166E+06, 0.100905472653716875E+06, 0.100913513200435162E+06, + 0.100929234171202479E+06, 0.100956672791980032E+06, 0.100989933744260285E+06, 0.101021721049159081E+06, 0.101045261345619481E+06, + 0.101056484086316414E+06, 0.101064376750130497E+06, 0.101068662292293593E+06, 0.101058850049314118E+06, 0.101036734626105259E+06, + 0.101005396099047648E+06, 0.100967551751069492E+06, 0.100930584068150943E+06, 0.100895049839971194E+06, 0.100865689126530953E+06, + 0.100843766391791884E+06, 0.100833519035555830E+06, 0.100830429319700765E+06, 0.100830534716874317E+06, 0.100831218872075027E+06, + 0.100828733033744793E+06, 0.100816736999957517E+06, 0.100801115692818625E+06, 0.100782650624359696E+06, 0.100761638271208169E+06, + 0.100739079948099330E+06, 0.100715508303584225E+06, 0.100685570121976882E+06, 0.100651926936336182E+06, 0.100616808436076797E+06, + 0.100582738088950529E+06, 0.100553609533300842E+06, 0.100536151852068826E+06, 0.100533191840017098E+06, 0.100540563795043839E+06, + 0.100556547268302660E+06, 0.100578647827983019E+06, 0.100597845282151320E+06, 0.100615643951716338E+06, 0.100629644958407152E+06, + 0.100644649717624998E+06, 0.100661314686951257E+06, 0.100679739011681770E+06, 0.100699923738231213E+06, 0.100724000291545439E+06, + 0.100748935934403649E+06, 0.100773460147275109E+06, 0.100796886100017015E+06, 0.100818431742268527E+06, 0.101253250319671861E+06, + 0.101258941275491015E+06, 0.101265825984074268E+06, 0.101273785992740712E+06, 0.101282673338371926E+06, 0.101292322337458594E+06, + 0.101302564811119126E+06, 0.101313249084015886E+06, 0.101324039732978374E+06, 0.101334420443956798E+06, 0.101344441355969844E+06, + 0.101353937804033951E+06, 0.101362853548466621E+06, 0.101371239996888005E+06, 0.101379195223571107E+06, 0.101386868114858662E+06, + 0.101394863418320267E+06, 0.101403421459721620E+06, 0.101411971625535502E+06, 0.101421328676152989E+06, 0.101434052612144369E+06, + 0.101448448578493975E+06, 0.101464428560022046E+06, 0.101481780318751698E+06, 0.101500377161328623E+06, 0.101519861969620310E+06, + 0.101538794301281392E+06, 0.101556432572582416E+06, 0.101569913275213607E+06, 0.101580111679331065E+06, 0.101588077608188687E+06, + 0.101593761388586005E+06, 0.101597743292873696E+06, 0.101601111211300595E+06, 0.101603375473686290E+06, 0.101604722386775393E+06, + 0.101605277974446421E+06, 0.101605137189286179E+06, 0.101604583774228318E+06, 0.101604027662526438E+06, 0.101605032612257637E+06, + 0.101607890648949600E+06, 0.101612610274943596E+06, 0.101620190413487217E+06, 0.101629709918692257E+06, 0.101640274485895483E+06, + 0.101651366271263018E+06, 0.101662017372317307E+06, 0.101672127532921921E+06, 0.101681639836175294E+06, 0.101689695653715113E+06, + 0.101697371401130935E+06, 0.101704816287710346E+06, 0.101711959261812881E+06, 0.101718592829194225E+06, 0.101724976617920722E+06, + 0.101729049321389990E+06, 0.101731107282530153E+06, 0.101732743234520705E+06, 0.101734177642089810E+06, 0.101735792298410903E+06, + 0.101737051523103568E+06, 0.101737813506062157E+06, 0.101737771770358304E+06, 0.101736766611527375E+06, 0.101733998643601444E+06, + 0.101731285447018498E+06, 0.101729657615879667E+06, 0.101729463824108592E+06, 0.101730467776220365E+06, 0.101730634889909721E+06, + 0.101728530424326527E+06, 0.101723478773003560E+06, 0.101715128998538450E+06, 0.101705173881448645E+06, 0.101697065128410613E+06, + 0.101686174729378530E+06, 0.101670746397321127E+06, 0.101648602916028351E+06, 0.101617289856162359E+06, 0.101575677936215157E+06, + 0.101523549414822643E+06, 0.101459384090740117E+06, 0.101385766535040675E+06, 0.101307806220871105E+06, 0.101230532040925333E+06, + 0.101163615695121596E+06, 0.101105144301163149E+06, 0.101053953064553687E+06, 0.101004506092646785E+06, 0.100954394425546445E+06, + 0.100903265851270029E+06, 0.100843568326323351E+06, 0.100779909310060830E+06, 0.100718507897475429E+06, 0.100663227538561507E+06, + 0.100619196470881463E+06, 0.100590878309716514E+06, 0.100585918330994056E+06, 0.100599670235220139E+06, 0.100629367268692309E+06, + 0.100671559948193928E+06, 0.100722625470161831E+06, 0.100775876461740903E+06, 0.100826307692812305E+06, 0.100872731273009820E+06, + 0.100911769660482067E+06, 0.100942401025764135E+06, 0.100964392752327054E+06, 0.100978678374194351E+06, 0.100986716960824007E+06, + 0.100990258819483715E+06, 0.100986859094204920E+06, 0.100984358423690996E+06, 0.100986880945730183E+06, 0.101001308030144719E+06, + 0.101021911204537639E+06, 0.101045314756852677E+06, 0.101079374563270016E+06, 0.101112057664106265E+06, 0.101138492426304845E+06, + 0.101147264582452117E+06, 0.101146181575950890E+06, 0.101139597898295426E+06, 0.101126956426191653E+06, 0.101104207044017559E+06, + 0.101074184746976593E+06, 0.101036351784390296E+06, 0.100994839802225833E+06, 0.100951701131987342E+06, 0.100907802015808338E+06, + 0.100866623322513595E+06, 0.100836261177509557E+06, 0.100817609325104844E+06, 0.100806057949370603E+06, 0.100799101756952587E+06, + 0.100794178922864405E+06, 0.100782586521973222E+06, 0.100770278560914870E+06, 0.100755730874395027E+06, 0.100740174567162278E+06, + 0.100724221891415305E+06, 0.100711960802472036E+06, 0.100695201938734870E+06, 0.100670904548085469E+06, 0.100639130264881242E+06, + 0.100604667725497551E+06, 0.100569533181772116E+06, 0.100538827586813903E+06, 0.100515863557522040E+06, 0.100504283432544311E+06, + 0.100508208880423437E+06, 0.100520846592849106E+06, 0.100533319890499857E+06, 0.100546979620563667E+06, 0.100563406036921282E+06, + 0.100581336883139578E+06, 0.100596479945475046E+06, 0.100613263609396352E+06, 0.100632606505272503E+06, 0.100655737101977575E+06, + 0.100680377627359165E+06, 0.100705693019706334E+06, 0.100730567542817560E+06, 0.100753963268230000E+06, 0.100775475443369112E+06, + 0.101264306669592683E+06, 0.101273005643247234E+06, 0.101282212261941575E+06, 0.101292455230279535E+06, 0.101303569666892407E+06, + 0.101315379627821021E+06, 0.101327713762651794E+06, 0.101340424766245633E+06, 0.101353413011349316E+06, 0.101366215214067837E+06, + 0.101378003241061873E+06, 0.101389048142805594E+06, 0.101399358057326695E+06, 0.101408993909155237E+06, 0.101418071350073515E+06, + 0.101426765747085621E+06, 0.101435320572288721E+06, 0.101444230417056518E+06, 0.101454115342003613E+06, 0.101466281775386233E+06, + 0.101480018815107192E+06, 0.101495370152025978E+06, 0.101512249092142942E+06, 0.101530457200416044E+06, 0.101549717357720714E+06, + 0.101569710093644739E+06, 0.101589282549966229E+06, 0.101605011230739328E+06, 0.101617835360473735E+06, 0.101628768238586897E+06, + 0.101637571031423722E+06, 0.101644166338589697E+06, 0.101648697806602591E+06, 0.101651881208006424E+06, 0.101655220484862148E+06, + 0.101657859335835557E+06, 0.101659761085947117E+06, 0.101661032940759702E+06, 0.101661921699332699E+06, 0.101662809971163108E+06, + 0.101664227024246793E+06, 0.101667989933228542E+06, 0.101675508452427108E+06, 0.101685268933038969E+06, 0.101696374945899413E+06, + 0.101708376350831662E+06, 0.101720741353243910E+06, 0.101732914311869565E+06, 0.101744191311434886E+06, 0.101753679207339199E+06, + 0.101762383198229145E+06, 0.101770484632283566E+06, 0.101778058653469430E+06, 0.101785052189110153E+06, 0.101791286685933344E+06, + 0.101795171487182030E+06, 0.101797156941597103E+06, 0.101798421280143026E+06, 0.101799261614609830E+06, 0.101799803038408485E+06, + 0.101800210895802447E+06, 0.101801683280290250E+06, 0.101802630829050468E+06, 0.101802543397740184E+06, 0.101801482357017914E+06, + 0.101799624587932572E+06, 0.101797066559983883E+06, 0.101795799625004249E+06, 0.101795785922852519E+06, 0.101796374037248344E+06, + 0.101796548441705847E+06, 0.101793091799900605E+06, 0.101786346983049574E+06, 0.101776575607877137E+06, 0.101765049283969143E+06, + 0.101754303368654233E+06, 0.101742481241294314E+06, 0.101726517364683619E+06, 0.101704526213350880E+06, 0.101673251963278643E+06, + 0.101631549642581842E+06, 0.101579630218674371E+06, 0.101517751331919892E+06, 0.101445587957413649E+06, 0.101369276534187840E+06, + 0.101293749197962985E+06, 0.101228845743408630E+06, 0.101175974072217723E+06, 0.101128069068520213E+06, 0.101080672101220363E+06, + 0.101030554297062597E+06, 0.100978255877595599E+06, 0.100917786384446328E+06, 0.100848380590802917E+06, 0.100779685419598463E+06, + 0.100716993576480047E+06, 0.100665449877585226E+06, 0.100628730188585745E+06, 0.100616768912061103E+06, 0.100625017647516172E+06, + 0.100651010955717982E+06, 0.100693983128488617E+06, 0.100748028718061119E+06, 0.100807126354548294E+06, 0.100865743222122503E+06, + 0.100920280263948240E+06, 0.100963697339721592E+06, 0.100996625031755175E+06, 0.101020588466931018E+06, 0.101034801756696354E+06, + 0.101044107550953762E+06, 0.101050001068824189E+06, 0.101053046373654055E+06, 0.101058552912032319E+06, 0.101072171257776601E+06, + 0.101095588999532294E+06, 0.101124462408449937E+06, 0.101159998252541394E+06, 0.101199939829214418E+06, 0.101233511940909040E+06, + 0.101250548981260363E+06, 0.101245238633873159E+06, 0.101231967019851887E+06, 0.101212524735667932E+06, 0.101187116747768814E+06, + 0.101155254569723096E+06, 0.101117728069520774E+06, 0.101075849861174778E+06, 0.101031454770778844E+06, 0.100982633468066182E+06, + 0.100931817382534617E+06, 0.100883044212189372E+06, 0.100842431678571462E+06, 0.100810753030772234E+06, 0.100790307235783985E+06, + 0.100775641660991605E+06, 0.100758065719658363E+06, 0.100742431929372280E+06, 0.100730276589137924E+06, 0.100719950891765460E+06, + 0.100707897196450547E+06, 0.100704034450479885E+06, 0.100696304475012279E+06, 0.100682955042842383E+06, 0.100662970635189646E+06, + 0.100635257255516670E+06, 0.100598919177042175E+06, 0.100561998994079375E+06, 0.100529207116205667E+06, 0.100503120931424841E+06, + 0.100485371253469493E+06, 0.100478084387816067E+06, 0.100480161528695491E+06, 0.100486330170588408E+06, 0.100497656033703854E+06, + 0.100512793940874559E+06, 0.100530267502319883E+06, 0.100548674998529634E+06, 0.100566870164484106E+06, 0.100588713074028346E+06, + 0.100612035752629497E+06, 0.100636570551070865E+06, 0.100661555413946771E+06, 0.100685975940573393E+06, 0.100708805081237850E+06, + 0.100728426698084644E+06, 0.101271996036762896E+06, 0.101284449704480561E+06, 0.101296689346213228E+06, 0.101309400454198360E+06, + 0.101322901055611903E+06, 0.101337001192974072E+06, 0.101351521575208899E+06, 0.101366313393139906E+06, 0.101382034494546009E+06, + 0.101397351776588475E+06, 0.101411443443270473E+06, 0.101424117470686309E+06, 0.101435883616085790E+06, 0.101446811616959909E+06, + 0.101457033181746156E+06, 0.101466747751913790E+06, 0.101476231696805597E+06, 0.101486021283400187E+06, 0.101497396375811921E+06, + 0.101510400207985600E+06, 0.101524923388815208E+06, 0.101540994381505661E+06, 0.101558520228044814E+06, 0.101577305318149651E+06, + 0.101597084529118074E+06, 0.101617572913645636E+06, 0.101635935716414897E+06, 0.101650985317801838E+06, 0.101664666828709975E+06, + 0.101676613583561295E+06, 0.101686531498022989E+06, 0.101694300750966708E+06, 0.101700039232711759E+06, 0.101704155496819658E+06, + 0.101707559871844016E+06, 0.101711706616868032E+06, 0.101715220819953611E+06, 0.101718183769718671E+06, 0.101720797579619655E+06, + 0.101723413797095534E+06, 0.101726548168837966E+06, 0.101732421109602874E+06, 0.101741180387240456E+06, 0.101752626090808626E+06, + 0.101765327683930620E+06, 0.101778794125947126E+06, 0.101792465254962983E+06, 0.101805759257347163E+06, 0.101817578749370528E+06, + 0.101828002210067600E+06, 0.101837310759124710E+06, 0.101845770211075462E+06, 0.101853420566787143E+06, 0.101860181736826940E+06, + 0.101864213062694500E+06, 0.101866574115216965E+06, 0.101867875008511299E+06, 0.101868524705411764E+06, 0.101868825959176160E+06, + 0.101868919433276926E+06, 0.101869678539425964E+06, 0.101870695483190138E+06, 0.101871330785532584E+06, 0.101870979213963699E+06, + 0.101869675931957303E+06, 0.101867574002842535E+06, 0.101865625644742016E+06, 0.101864444239763863E+06, 0.101864129871809724E+06, + 0.101864253411905665E+06, 0.101863863423935647E+06, 0.101861147095331355E+06, 0.101853046503827805E+06, 0.101842469691830149E+06, + 0.101829793173113096E+06, 0.101815148158582204E+06, 0.101801721489973846E+06, 0.101784969966993638E+06, 0.101762516553084497E+06, + 0.101733198141890345E+06, 0.101692387931239413E+06, 0.101641579160683832E+06, 0.101581604629232388E+06, 0.101513447361368249E+06, + 0.101440920474624741E+06, 0.101370696075984946E+06, 0.101305428265875380E+06, 0.101254160309156374E+06, 0.101207383873920160E+06, + 0.101161789898628529E+06, 0.101111489873579616E+06, 0.101058073620173833E+06, 0.100998431410120465E+06, 0.100925178881860134E+06, + 0.100851277940204382E+06, 0.100782887728638991E+06, 0.100724637342850445E+06, 0.100681654247053943E+06, 0.100660743763258797E+06, + 0.100662241191619672E+06, 0.100684600997945701E+06, 0.100726431789378737E+06, 0.100783621753223240E+06, 0.100850165592330639E+06, + 0.100919393459606828E+06, 0.100984663126731160E+06, 0.101035581217426865E+06, 0.101073289555574971E+06, 0.101097883508170984E+06, + 0.101109275635634360E+06, 0.101115535689499287E+06, 0.101120721213043289E+06, 0.101127445332507938E+06, 0.101138555650677066E+06, + 0.101162386128591490E+06, 0.101193764958060041E+06, 0.101229324100487633E+06, 0.101272586038755646E+06, 0.101314017050708091E+06, + 0.101345307647537833E+06, 0.101350681405921583E+06, 0.101336274552223433E+06, 0.101312002659208913E+06, 0.101282108941999220E+06, + 0.101247511268828879E+06, 0.101208775326433519E+06, 0.101166118942493005E+06, 0.101124324087716755E+06, 0.101077097855417393E+06, + 0.101023493736806588E+06, 0.100966370678116829E+06, 0.100910649732596605E+06, 0.100860956183662900E+06, 0.100818859583747035E+06, + 0.100784487610509677E+06, 0.100755633857502806E+06, 0.100730268695456398E+06, 0.100710865638861083E+06, 0.100697679049610029E+06, + 0.100690061794109570E+06, 0.100696089852752222E+06, 0.100696921102593260E+06, 0.100692632540626320E+06, 0.100681762801710865E+06, + 0.100663264802660036E+06, 0.100633791904004815E+06, 0.100597430688150896E+06, 0.100559133196241281E+06, 0.100524051576254133E+06, + 0.100494743325319461E+06, 0.100472843717532320E+06, 0.100453469270866597E+06, 0.100441938855850953E+06, 0.100444602587366870E+06, + 0.100453700278505523E+06, 0.100467703647186674E+06, 0.100484865751373640E+06, 0.100504556800278908E+06, 0.100526747147881411E+06, + 0.100548342492759344E+06, 0.100570928110482331E+06, 0.100594499129673175E+06, 0.100618314768352022E+06, 0.100641358389098648E+06, + 0.100661048545089099E+06, 0.100674922441404182E+06, 0.101277440454925483E+06, 0.101292275045881630E+06, 0.101308217918252703E+06, + 0.101324032641650105E+06, 0.101340083417949048E+06, 0.101356599817204507E+06, 0.101373389242319026E+06, 0.101391680572806275E+06, + 0.101409655246696246E+06, 0.101426966070523806E+06, 0.101443353143514600E+06, 0.101458277199001546E+06, 0.101471528522387307E+06, + 0.101483748681189623E+06, 0.101495083125874895E+06, 0.101505752090554262E+06, 0.101516050089151657E+06, 0.101526815975076141E+06, + 0.101538795327266271E+06, 0.101552338028206417E+06, 0.101567404995926277E+06, 0.101583932457588046E+06, 0.101601812845274559E+06, + 0.101620841504076889E+06, 0.101640749378202716E+06, 0.101659290500403222E+06, 0.101676771795349603E+06, 0.101693884723980591E+06, + 0.101708998663612001E+06, 0.101722276078936207E+06, 0.101733606252533034E+06, 0.101742808520292456E+06, 0.101749958233873534E+06, + 0.101756733187784732E+06, 0.101761976313215302E+06, 0.101765600227458519E+06, 0.101770624962746049E+06, 0.101775587804667244E+06, + 0.101780223730697457E+06, 0.101784845963681015E+06, 0.101792019560120360E+06, 0.101800861910829000E+06, 0.101810238167576026E+06, + 0.101821334626365482E+06, 0.101835649384848730E+06, 0.101850599319270405E+06, 0.101865571025550424E+06, 0.101879726510542314E+06, + 0.101892673462390783E+06, 0.101903975174055988E+06, 0.101913651691837455E+06, 0.101922403262289721E+06, 0.101930066269132934E+06, + 0.101934959838625931E+06, 0.101938013574382479E+06, 0.101939867945920269E+06, 0.101940768404829549E+06, 0.101940976512875422E+06, + 0.101940974808985324E+06, 0.101941915218950715E+06, 0.101942796779357042E+06, 0.101943325071244180E+06, 0.101943321289824438E+06, + 0.101942520685581403E+06, 0.101940795734215877E+06, 0.101938328485986989E+06, 0.101936102913573559E+06, 0.101934189161022412E+06, + 0.101933270983365946E+06, 0.101932726854111810E+06, 0.101931071080041162E+06, 0.101927390375963005E+06, 0.101920782487591568E+06, + 0.101909599976852041E+06, 0.101896034018928112E+06, 0.101880121030327078E+06, 0.101861777722108454E+06, 0.101843441866567693E+06, + 0.101821175828396939E+06, 0.101793162871491804E+06, 0.101756243381197477E+06, 0.101707526053893132E+06, 0.101651390637597418E+06, + 0.101591096250860501E+06, 0.101525066978488496E+06, 0.101457842460151805E+06, 0.101392749867658815E+06, 0.101338205739929384E+06, + 0.101290789521037383E+06, 0.101243732978547458E+06, 0.101191560328100386E+06, 0.101135333560209707E+06, 0.101074991868799916E+06, + 0.101002789603246347E+06, 0.100928035016280875E+06, 0.100857779212484500E+06, 0.100794984785666602E+06, 0.100746221294778152E+06, + 0.100717266126841918E+06, 0.100710869212579069E+06, 0.100726313373954297E+06, 0.100765862955971417E+06, 0.100824009621681325E+06, + 0.100896074483335498E+06, 0.100975156087370415E+06, 0.101050862045185830E+06, 0.101108616996395343E+06, 0.101151397540630162E+06, + 0.101177118649863274E+06, 0.101187234876946401E+06, 0.101192189574432836E+06, 0.101198920872520132E+06, 0.101209271572763842E+06, + 0.101225853188380381E+06, 0.101255763867716960E+06, 0.101292205782835576E+06, 0.101333769433737034E+06, 0.101380487686360808E+06, + 0.101421196585383368E+06, 0.101445943578677994E+06, 0.101442593076884281E+06, 0.101422753739062216E+06, 0.101390520324852318E+06, + 0.101350761888702051E+06, 0.101308120360709363E+06, 0.101265074031475204E+06, 0.101223556150358476E+06, 0.101181059083197164E+06, + 0.101131282154724337E+06, 0.101073985674786556E+06, 0.101009316519365500E+06, 0.100945620806578852E+06, 0.100887564966803198E+06, + 0.100836870701820939E+06, 0.100791306568270127E+06, 0.100748587002241606E+06, 0.100714275195360678E+06, 0.100691096015225994E+06, + 0.100677036214206237E+06, 0.100679656532840978E+06, 0.100689403954963505E+06, 0.100699806241966638E+06, 0.100699758014009334E+06, + 0.100690385161567290E+06, 0.100668712287826143E+06, 0.100636906386880102E+06, 0.100599766534639755E+06, 0.100560426804608782E+06, + 0.100523011227441762E+06, 0.100490487333571364E+06, 0.100458484377625064E+06, 0.100433836484664062E+06, 0.100418321599970062E+06, + 0.100412076649917391E+06, 0.100419080629848453E+06, 0.100432241000389156E+06, 0.100450792482229837E+06, 0.100472305642769512E+06, + 0.100493869619492121E+06, 0.100514430080734746E+06, 0.100535036793476407E+06, 0.100556629184451856E+06, 0.100578314394928922E+06, + 0.100596991295179905E+06, 0.100611500340730694E+06, 0.100623274306907668E+06, 0.101280196625301396E+06, 0.101297364868656936E+06, + 0.101315860426329833E+06, 0.101335437548964052E+06, 0.101354738212366676E+06, 0.101373945822871654E+06, 0.101394704590563779E+06, + 0.101415369573864707E+06, 0.101435547066077095E+06, 0.101454900560777067E+06, 0.101473156717428967E+06, 0.101490111858949429E+06, + 0.101505426648419336E+06, 0.101518896733282789E+06, 0.101531260767964472E+06, 0.101542531309453814E+06, 0.101553164954199878E+06, + 0.101564411925864319E+06, 0.101576767311889984E+06, 0.101590613786174377E+06, 0.101606186426911474E+06, 0.101622949542643095E+06, + 0.101640870734518088E+06, 0.101659778611533140E+06, 0.101677671599300767E+06, 0.101695145189232746E+06, 0.101713022490742442E+06, + 0.101730968458130665E+06, 0.101748633328473559E+06, 0.101764332593418454E+06, 0.101777415582760368E+06, 0.101788327636173344E+06, + 0.101798745459491343E+06, 0.101807854686651277E+06, 0.101815215507054876E+06, 0.101821043040616947E+06, 0.101825884968623417E+06, + 0.101832189148969264E+06, 0.101839168448648401E+06, 0.101848045440598347E+06, 0.101858730804693652E+06, 0.101869959329435806E+06, + 0.101881533268110448E+06, 0.101893454722194554E+06, 0.101906437265534973E+06, 0.101922905509709031E+06, 0.101939197745689977E+06, + 0.101954795923734462E+06, 0.101969009671704334E+06, 0.101981310726737574E+06, 0.101991415766123711E+06, 0.101999594743156573E+06, + 0.102005976491342561E+06, 0.102010334316063047E+06, 0.102013157295944911E+06, 0.102014722383416287E+06, 0.102015313093490025E+06, + 0.102015201185307524E+06, 0.102016512237083880E+06, 0.102017510782104568E+06, 0.102018055903560264E+06, 0.102018084579591843E+06, + 0.102017466339170613E+06, 0.102015842014936527E+06, 0.102013009808558825E+06, 0.102010188377710918E+06, 0.102007504920719613E+06, + 0.102004842449303280E+06, 0.102002010784629019E+06, 0.101999472815438930E+06, 0.101995912864510945E+06, 0.101991527724094442E+06, + 0.101985699759707655E+06, 0.101975812995855114E+06, 0.101961537246313150E+06, 0.101943695019863866E+06, 0.101923033375715851E+06, + 0.101901362121280530E+06, 0.101879075837123033E+06, 0.101852284874085046E+06, 0.101819539147717020E+06, 0.101776999589703846E+06, + 0.101726785900868257E+06, 0.101671557646898407E+06, 0.101612042588822980E+06, 0.101548622762663115E+06, 0.101485284216076703E+06, + 0.101425147441038411E+06, 0.101373420817102917E+06, 0.101321191476503751E+06, 0.101266538752380700E+06, 0.101208938335707280E+06, + 0.101148533319442722E+06, 0.101080582757091557E+06, 0.101007172321080754E+06, 0.100937106866050381E+06, 0.100872650853732252E+06, + 0.100818490092161403E+06, 0.100780581038449120E+06, 0.100763989069985822E+06, 0.100769172528104478E+06, 0.100801781036641652E+06, + 0.100856282722816642E+06, 0.100929221528193739E+06, 0.101013884730459817E+06, 0.101097563707576744E+06, 0.101162534274172547E+06, + 0.101213486478638646E+06, 0.101244516559525029E+06, 0.101257648408437890E+06, 0.101263733502884890E+06, 0.101275510052246449E+06, + 0.101290762661853529E+06, 0.101314197491016195E+06, 0.101347943558257903E+06, 0.101386651316440679E+06, 0.101430443429601510E+06, + 0.101475669896804160E+06, 0.101514950055520574E+06, 0.101531515938051540E+06, 0.101524788957272292E+06, 0.101501664340208648E+06, + 0.101465580088908755E+06, 0.101421732802947983E+06, 0.101374184582676520E+06, 0.101328046898908578E+06, 0.101289807901878230E+06, + 0.101246491413997268E+06, 0.101194778317482283E+06, 0.101131646224091921E+06, 0.101060205833383836E+06, 0.100988174374432070E+06, + 0.100922370979696687E+06, 0.100863854824209222E+06, 0.100809964699915654E+06, 0.100761271524313197E+06, 0.100719104259046479E+06, + 0.100686430395430245E+06, 0.100678847862221184E+06, 0.100683138663107515E+06, 0.100693073794055832E+06, 0.100704133264039236E+06, + 0.100711587564049987E+06, 0.100702838554374641E+06, 0.100679156446423745E+06, 0.100646910483054933E+06, 0.100608627281804467E+06, + 0.100567412671928309E+06, 0.100526528285293534E+06, 0.100483943399388023E+06, 0.100448443665773972E+06, 0.100421899539395425E+06, + 0.100404924203073868E+06, 0.100397063255380912E+06, 0.100397195586259491E+06, 0.100412985650041403E+06, 0.100432834475288488E+06, + 0.100453366207182436E+06, 0.100473356439391355E+06, 0.100491742373035304E+06, 0.100507905429383289E+06, 0.100525814076571885E+06, + 0.100542096974396103E+06, 0.100555812166254138E+06, 0.100567395231908740E+06, 0.100576579149565121E+06, 0.101279908089260382E+06, + 0.101299372851355220E+06, 0.101320345227797603E+06, 0.101342568251312987E+06, 0.101366203167707048E+06, 0.101390159455080997E+06, + 0.101413541104309363E+06, 0.101436670068180945E+06, 0.101459134145086064E+06, 0.101480579621756508E+06, 0.101500717501762701E+06, + 0.101519330301993643E+06, 0.101536279443531355E+06, 0.101551434684382868E+06, 0.101564255195383463E+06, 0.101575422887434994E+06, + 0.101586445548099669E+06, 0.101597902131166629E+06, 0.101610316943178666E+06, 0.101624105975331244E+06, 0.101639540620591506E+06, + 0.101656731770743747E+06, 0.101674690803331439E+06, 0.101691335236531100E+06, 0.101707821449698851E+06, 0.101725245164068649E+06, + 0.101743396815362881E+06, 0.101762005533747782E+06, 0.101780794703432257E+06, 0.101799566956391791E+06, 0.101816729089967106E+06, + 0.101830810115947446E+06, 0.101843847767199652E+06, 0.101855309960108818E+06, 0.101865083082604426E+06, 0.101873349177960990E+06, + 0.101880647099664595E+06, 0.101887932618480903E+06, 0.101897799286328358E+06, 0.101910318475203370E+06, 0.101923741945953618E+06, + 0.101937617512615703E+06, 0.101951634884124011E+06, 0.101965709346062926E+06, 0.101980052214833602E+06, 0.101995075682068244E+06, + 0.102012705906177565E+06, 0.102029916826673259E+06, 0.102045578980748891E+06, 0.102059048316380504E+06, 0.102069947174644665E+06, + 0.102077684357740349E+06, 0.102082147312762972E+06, 0.102086500261915091E+06, 0.102089248935513198E+06, 0.102090698933738371E+06, + 0.102091178364924752E+06, 0.102092701245381337E+06, 0.102093815457381104E+06, 0.102094368575754212E+06, 0.102094331459262947E+06, + 0.102093649378548696E+06, 0.102091495160413397E+06, 0.102088077118329078E+06, 0.102085266715555787E+06, 0.102082068081696532E+06, + 0.102078934857918081E+06, 0.102075562114887900E+06, 0.102070631820974115E+06, 0.102064438122544176E+06, 0.102059414174384161E+06, + 0.102053827822841413E+06, 0.102047097203453392E+06, 0.102038205276517619E+06, 0.102023970080276820E+06, 0.102005255572377879E+06, + 0.101983545280989390E+06, 0.101959239559772468E+06, 0.101934934813177606E+06, 0.101909416211695381E+06, 0.101879530216405619E+06, + 0.101843729384204227E+06, 0.101798771374156902E+06, 0.101749131431232046E+06, 0.101696435747962270E+06, 0.101638597439857098E+06, + 0.101576958615739393E+06, 0.101514239708325505E+06, 0.101456190833159548E+06, 0.101399554349585407E+06, 0.101340424142701784E+06, + 0.101280446676456311E+06, 0.101219442303719290E+06, 0.101155802903883246E+06, 0.101085010925495619E+06, 0.101016127520053677E+06, + 0.100949559692596478E+06, 0.100889898302085116E+06, 0.100844209040313392E+06, 0.100816129681629769E+06, 0.100810501379105452E+06, + 0.100832591111220638E+06, 0.100879523722449056E+06, 0.100948063089510324E+06, 0.101031460853947981E+06, 0.101115973986060417E+06, + 0.101184231818201646E+06, 0.101240245990651732E+06, 0.101276004337181133E+06, 0.101297693264287940E+06, 0.101316108838536718E+06, + 0.101339338207326771E+06, 0.101364838726589573E+06, 0.101398212697034352E+06, 0.101435020262566584E+06, 0.101474120214935858E+06, + 0.101515374742090018E+06, 0.101554913896900893E+06, 0.101585525309637247E+06, 0.101596313029333352E+06, 0.101591763310596391E+06, + 0.101572063905601564E+06, 0.101533915795807872E+06, 0.101488864498615381E+06, 0.101440950048410057E+06, 0.101401964815710235E+06, + 0.101362939393266570E+06, 0.101319118725317487E+06, 0.101264253224874032E+06, 0.101194604583161839E+06, 0.101119529697804493E+06, + 0.101043148821796305E+06, 0.100969817218776385E+06, 0.100904222807714512E+06, 0.100845424566366739E+06, 0.100792297539129795E+06, + 0.100746429506127941E+06, 0.100716119483396033E+06, 0.100699086889567552E+06, 0.100699855109205411E+06, 0.100707310375888119E+06, + 0.100716570575528633E+06, 0.100720007898216936E+06, 0.100714797932772417E+06, 0.100695727134459230E+06, 0.100662985850684985E+06, + 0.100623495462979961E+06, 0.100579571082265902E+06, 0.100528287659914175E+06, 0.100483047690553038E+06, 0.100446858129451386E+06, + 0.100420432087088702E+06, 0.100404117469529898E+06, 0.100397105480157465E+06, 0.100403234638665162E+06, 0.100415020179178769E+06, + 0.100433067114222082E+06, 0.100451452530888302E+06, 0.100468854497717490E+06, 0.100484113018387754E+06, 0.100496513635322510E+06, + 0.100504396642556661E+06, 0.100514796346128511E+06, 0.100524493045942218E+06, 0.100532404153307187E+06, 0.100538289704171490E+06, + 0.101276336252575435E+06, 0.101298080414544456E+06, 0.101321469561098274E+06, 0.101347127563797287E+06, 0.101375017595738012E+06, + 0.101402741686854177E+06, 0.101429372639699533E+06, 0.101455094154428705E+06, 0.101479936738935212E+06, 0.101503527247806051E+06, + 0.101525558424067625E+06, 0.101545795970329476E+06, 0.101564086253569083E+06, 0.101579860400036196E+06, 0.101592656313919491E+06, + 0.101604222243081458E+06, 0.101615370617936293E+06, 0.101626717204329048E+06, 0.101638824013794816E+06, 0.101652144675515985E+06, + 0.101666986413953739E+06, 0.101683491567268982E+06, 0.101699730410034434E+06, 0.101715308981035720E+06, 0.101731361440654102E+06, + 0.101748589449732390E+06, 0.101766824698764540E+06, 0.101785841910313233E+06, 0.101805411629659066E+06, 0.101825381837012450E+06, + 0.101846839764007193E+06, 0.101867081140515147E+06, 0.101882747001865355E+06, 0.101896903928888263E+06, 0.101909362288120537E+06, + 0.101920245934517079E+06, 0.101930058238641242E+06, 0.101941637442764200E+06, 0.101954785426383867E+06, 0.101968215450878924E+06, + 0.101984710778129607E+06, 0.102001549965592465E+06, 0.102018275841846422E+06, 0.102034683222590960E+06, 0.102052401989689286E+06, + 0.102069645673240069E+06, 0.102086007650836211E+06, 0.102103768116502732E+06, 0.102121127630333416E+06, 0.102135973777942898E+06, + 0.102147987937177197E+06, 0.102156601874315427E+06, 0.102161672760610920E+06, 0.102163612354316181E+06, 0.102165768392921964E+06, + 0.102167214431077227E+06, 0.102169260247518920E+06, 0.102170746287005837E+06, 0.102171480626503515E+06, 0.102171269145651808E+06, + 0.102170214520413967E+06, 0.102167256562754847E+06, 0.102162479386098232E+06, 0.102158371150627951E+06, 0.102155244448894475E+06, + 0.102152875264177637E+06, 0.102149492287714515E+06, 0.102145495391175835E+06, 0.102139392366010521E+06, 0.102131234162350753E+06, + 0.102121845495369198E+06, 0.102114444604303775E+06, 0.102106462190456019E+06, 0.102096364075651625E+06, 0.102082958297694466E+06, + 0.102064065966768365E+06, 0.102041420899050965E+06, 0.102016297892142000E+06, 0.101989261194259234E+06, 0.101963193901333740E+06, + 0.101934697827006079E+06, 0.101902018630394974E+06, 0.101863893013675159E+06, 0.101820477410193009E+06, 0.101774528513823985E+06, + 0.101724002882111308E+06, 0.101665763047983230E+06, 0.101603648801794363E+06, 0.101540096977050402E+06, 0.101478947206942044E+06, + 0.101415470097827929E+06, 0.101351609294201058E+06, 0.101289469642166499E+06, 0.101226537327552069E+06, 0.101158605139549531E+06, + 0.101091671283985226E+06, 0.101026501778518956E+06, 0.100963906622713315E+06, 0.100912235109733156E+06, 0.100875156448926034E+06, + 0.100858092199168052E+06, 0.100869196724643829E+06, 0.100906258192389359E+06, 0.100966643545000639E+06, 0.101044871026198045E+06, + 0.101126128294873750E+06, 0.101195519846174895E+06, 0.101255659962385485E+06, 0.101297057174446716E+06, 0.101328131549875659E+06, + 0.101358621176643224E+06, 0.101392239138290606E+06, 0.101427359701943147E+06, 0.101468500213009858E+06, 0.101510703720686288E+06, + 0.101550908563824967E+06, 0.101587166287520682E+06, 0.101619760493459311E+06, 0.101640375989610111E+06, 0.101647164822681414E+06, + 0.101640476796716728E+06, 0.101620225665346763E+06, 0.101589549071868416E+06, 0.101551044697311809E+06, 0.101511563682290900E+06, + 0.101475939268223781E+06, 0.101437438003792078E+06, 0.101392805212183681E+06, 0.101332702985176016E+06, 0.101262976832194923E+06, + 0.101186444126810515E+06, 0.101108333464266703E+06, 0.101034512676034472E+06, 0.100963849818957518E+06, 0.100898562106253885E+06, + 0.100842056459041982E+06, 0.100798749608423153E+06, 0.100767148703609448E+06, 0.100745027122654850E+06, 0.100731425417328996E+06, + 0.100731821012642424E+06, 0.100734592849697350E+06, 0.100733986756515151E+06, 0.100727026999971698E+06, 0.100711618349869153E+06, + 0.100683470368124676E+06, 0.100640250766840603E+06, 0.100586314437398818E+06, 0.100534961959011474E+06, 0.100490642055552060E+06, + 0.100456264076438296E+06, 0.100432289810027520E+06, 0.100419632142970615E+06, 0.100423645734029778E+06, 0.100432024957258123E+06, + 0.100442709528904365E+06, 0.100454138069834065E+06, 0.100469282754753091E+06, 0.100483179206656147E+06, 0.100494317659240289E+06, + 0.100501048475271105E+06, 0.100503737147053136E+06, 0.100502939624753810E+06, 0.100506864511892840E+06, 0.100510205922212830E+06, + 0.100511985008099888E+06, 0.101269395817640194E+06, 0.101293433370600033E+06, 0.101320709064215349E+06, 0.101350720216622271E+06, + 0.101381363474586935E+06, 0.101411901774678990E+06, 0.101441702408660596E+06, 0.101470286272251309E+06, 0.101497612121933402E+06, + 0.101523409436511720E+06, 0.101547349710601979E+06, 0.101569178391354450E+06, 0.101588382552830284E+06, 0.101604424454005639E+06, + 0.101617806496970152E+06, 0.101629009202247544E+06, 0.101639790736640862E+06, 0.101650653799515901E+06, 0.101662034467563892E+06, + 0.101674429962589624E+06, 0.101688184881771667E+06, 0.101701776789907686E+06, 0.101715632368359467E+06, 0.101731005396025357E+06, + 0.101747619021182472E+06, 0.101764475149160600E+06, 0.101782565451806455E+06, 0.101801692572504733E+06, 0.101821649291101741E+06, + 0.101844372908615100E+06, 0.101868013490669473E+06, 0.101890926735153276E+06, 0.101912734436730447E+06, 0.101930521333358061E+06, + 0.101945955049482625E+06, 0.101959618341155976E+06, 0.101973842306752718E+06, 0.101990092943988522E+06, 0.102006492234429417E+06, + 0.102022981199823858E+06, 0.102039845835770568E+06, 0.102059553276874620E+06, 0.102079331788742449E+06, 0.102099902964415654E+06, + 0.102120532959564909E+06, 0.102140448801236460E+06, 0.102159255793075747E+06, 0.102176879448503649E+06, 0.102194365868866342E+06, + 0.102211106097444455E+06, 0.102224803244153038E+06, 0.102234823789642047E+06, 0.102240968923527806E+06, 0.102243570541519104E+06, + 0.102243519688579676E+06, 0.102244750868611838E+06, 0.102246759472131700E+06, 0.102247988131721504E+06, 0.102248209161490959E+06, + 0.102247170632681489E+06, 0.102243247319650705E+06, 0.102236753031268512E+06, 0.102230982493940493E+06, 0.102226187707310237E+06, + 0.102222666096639834E+06, 0.102220567141386651E+06, 0.102219855956292071E+06, 0.102215511479397683E+06, 0.102208434908867741E+06, + 0.102198721169081880E+06, 0.102186789184960857E+06, 0.102174609249495770E+06, 0.102164550205667154E+06, 0.102152502370517235E+06, + 0.102137501608386214E+06, 0.102118919702411848E+06, 0.102095889999392573E+06, 0.102070100404917495E+06, 0.102041997958624415E+06, + 0.102012090612610089E+06, 0.101983710969351829E+06, 0.101953137519082840E+06, 0.101920734120792738E+06, 0.101883717982373681E+06, + 0.101842973734119500E+06, 0.101798428245916861E+06, 0.101747102066966778E+06, 0.101687602338869881E+06, 0.101624664318831565E+06, + 0.101559707946739305E+06, 0.101491658640950249E+06, 0.101420567276357397E+06, 0.101354355882096454E+06, 0.101289435543346961E+06, + 0.101224098024003702E+06, 0.101159952737485408E+06, 0.101097956680038245E+06, 0.101035227047009626E+06, 0.100981546520210177E+06, + 0.100939244847484995E+06, 0.100914786575781181E+06, 0.100915867157493747E+06, 0.100942559164277671E+06, 0.100993021366280096E+06, + 0.101062207385378511E+06, 0.101136754321606641E+06, 0.101205153055716102E+06, 0.101267549676815237E+06, 0.101315566331653798E+06, + 0.101356986952566978E+06, 0.101400109049254897E+06, 0.101444047042664242E+06, 0.101488513133860251E+06, 0.101534593023339607E+06, + 0.101578862893253303E+06, 0.101617989104461085E+06, 0.101651469070145307E+06, 0.101676676962902973E+06, 0.101688426206951568E+06, + 0.101690699198194692E+06, 0.101681585082600272E+06, 0.101660802224054729E+06, 0.101632322368388574E+06, 0.101602214382015110E+06, + 0.101577248018812563E+06, 0.101546577483431887E+06, 0.101509347660459607E+06, 0.101460277851145336E+06, 0.101400695177468675E+06, + 0.101333061941295062E+06, 0.101259893373003069E+06, 0.101185498750814251E+06, 0.101111060613673137E+06, 0.101038806163680754E+06, + 0.100970853556921851E+06, 0.100913205537255504E+06, 0.100868081185120318E+06, 0.100831661076531760E+06, 0.100803490881640522E+06, + 0.100782858759036229E+06, 0.100767010800255986E+06, 0.100760517927946479E+06, 0.100755313595541767E+06, 0.100745011420950410E+06, + 0.100727337942231010E+06, 0.100696437123156371E+06, 0.100650083823098379E+06, 0.100597278983266224E+06, 0.100548413676936747E+06, + 0.100507765427222563E+06, 0.100477948430878227E+06, 0.100463614942480534E+06, 0.100466404104801695E+06, 0.100473340681007379E+06, + 0.100482742216284692E+06, 0.100492637659898319E+06, 0.100501306119762710E+06, 0.100508155310289090E+06, 0.100517896956254641E+06, + 0.100523967020314361E+06, 0.100525551437862276E+06, 0.100522692726944748E+06, 0.100516008939190593E+06, 0.100506617021169775E+06, + 0.100504130401290677E+06, 0.100500855757604397E+06, 0.101259195015618316E+06, 0.101287394131248599E+06, 0.101318624387393094E+06, + 0.101351388311065471E+06, 0.101384848445848693E+06, 0.101418230695586331E+06, 0.101450864090695264E+06, 0.101482215379592511E+06, + 0.101512000328888942E+06, 0.101540081556911420E+06, 0.101565958007626774E+06, 0.101589239793549044E+06, 0.101609354590231524E+06, + 0.101626245425942194E+06, 0.101640116415258730E+06, 0.101651384047841973E+06, 0.101660624537901342E+06, 0.101669864682349900E+06, + 0.101680046518619303E+06, 0.101691016789836227E+06, 0.101701600972581538E+06, 0.101712344116073305E+06, 0.101724596034016693E+06, + 0.101738626214170567E+06, 0.101754578760972465E+06, 0.101772464174383247E+06, 0.101790289256249525E+06, 0.101809225095436283E+06, + 0.101831409086778760E+06, 0.101855713865937665E+06, 0.101880304248738481E+06, 0.101904708267321548E+06, 0.101928659429272666E+06, + 0.101952215895369998E+06, 0.101973129343184191E+06, 0.101990492819853054E+06, 0.102009155453432861E+06, 0.102028626658851339E+06, + 0.102048465714061036E+06, 0.102068480817810836E+06, 0.102088846460710702E+06, 0.102110232566220016E+06, 0.102133295641766570E+06, + 0.102157356921516912E+06, 0.102181314870907911E+06, 0.102204374004590238E+06, 0.102226000444488978E+06, 0.102246017656184413E+06, + 0.102265607213167954E+06, 0.102282589184103534E+06, 0.102298432423255334E+06, 0.102310352702715958E+06, 0.102317999706446251E+06, + 0.102321598850661234E+06, 0.102323515138576258E+06, 0.102323197704490987E+06, 0.102322212878332677E+06, 0.102323063816814887E+06, + 0.102322646091264614E+06, 0.102319439183542258E+06, 0.102312970911412354E+06, 0.102304997794601848E+06, 0.102296841478971372E+06, + 0.102291418130089238E+06, 0.102288360395478667E+06, 0.102288552237265947E+06, 0.102287701703575425E+06, 0.102284538846590702E+06, + 0.102276897495121520E+06, 0.102265740813761135E+06, 0.102252134571836228E+06, 0.102237131022390793E+06, 0.102221272996986561E+06, + 0.102206507054624482E+06, 0.102189132554294789E+06, 0.102168602609417649E+06, 0.102145544389345145E+06, 0.102118566149667124E+06, + 0.102089083952633140E+06, 0.102057798140960163E+06, 0.102026969995698295E+06, 0.101997794023706476E+06, 0.101966743922712252E+06, + 0.101933057167765714E+06, 0.101896592945729586E+06, 0.101857371791885336E+06, 0.101815607416803119E+06, 0.101763023383776948E+06, + 0.101702407436462090E+06, 0.101635116047538351E+06, 0.101562945833011370E+06, 0.101485822606547168E+06, 0.101411005039628857E+06, + 0.101339835091662317E+06, 0.101272689532459044E+06, 0.101210368076346276E+06, 0.101154473004817381E+06, 0.101097829928473817E+06, + 0.101048482059940754E+06, 0.101007048910648111E+06, 0.100979473833055905E+06, 0.100973447727585182E+06, 0.100990584221201716E+06, + 0.101029960997994902E+06, 0.101087951257948895E+06, 0.101153695183268181E+06, 0.101219018003879406E+06, 0.101282293838312820E+06, + 0.101338465984178547E+06, 0.101391368230947162E+06, 0.101446772222011277E+06, 0.101500085973176334E+06, 0.101550853250171887E+06, + 0.101598573456663202E+06, 0.101641988898670184E+06, 0.101679214186169236E+06, 0.101710098564568776E+06, 0.101732780885386266E+06, + 0.101743179226637279E+06, 0.101740055966295447E+06, 0.101722994425650759E+06, 0.101700469255730888E+06, 0.101674123165238838E+06, + 0.101653160060864204E+06, 0.101631596453806415E+06, 0.101607075787893336E+06, 0.101574486424828559E+06, 0.101526976419999381E+06, + 0.101469612332252946E+06, 0.101404225279481514E+06, 0.101336714868594907E+06, 0.101267916935403031E+06, 0.101195492908750399E+06, + 0.101123687793417601E+06, 0.101058751346724224E+06, 0.101000171416406578E+06, 0.100947653236097554E+06, 0.100904324965127365E+06, + 0.100869022485961759E+06, 0.100838631774334179E+06, 0.100814997040174785E+06, 0.100796371893838630E+06, 0.100782994420463059E+06, + 0.100767931078048772E+06, 0.100738709347425858E+06, 0.100699551218149616E+06, 0.100657848886243373E+06, 0.100613930496747955E+06, + 0.100570328091677089E+06, 0.100536417956577148E+06, 0.100522106220241680E+06, 0.100523981788664518E+06, 0.100534576173254580E+06, + 0.100544607428678122E+06, 0.100555100707554739E+06, 0.100564477570051735E+06, 0.100571044680449282E+06, 0.100573984997784108E+06, + 0.100574098036419746E+06, 0.100574969682196417E+06, 0.100570985693230745E+06, 0.100562235725965831E+06, 0.100549403090203457E+06, + 0.100533663303323410E+06, 0.100514985690890928E+06, 0.100501506969102309E+06, 0.101247028543607215E+06, 0.101279000272323727E+06, + 0.101313044900483452E+06, 0.101348706117229129E+06, 0.101385099864543183E+06, 0.101421406335684835E+06, 0.101456908730823867E+06, + 0.101491027169870344E+06, 0.101523346965489472E+06, 0.101553641131603319E+06, 0.101581591041353255E+06, 0.101606456037034135E+06, + 0.101627802489960915E+06, 0.101645553091339185E+06, 0.101659871959589625E+06, 0.101671125963614424E+06, 0.101679833672676948E+06, + 0.101686600287344059E+06, 0.101693249899754504E+06, 0.101700828771449567E+06, 0.101708214676399468E+06, 0.101716786788727914E+06, + 0.101726994188702083E+06, 0.101739189978545895E+06, 0.101753597010140846E+06, 0.101770294478413707E+06, 0.101789229323241438E+06, + 0.101810439881563492E+06, 0.101833551125124432E+06, 0.101857745342370516E+06, 0.101882520275840274E+06, 0.101907489508364233E+06, + 0.101932461599410264E+06, 0.101957552146214075E+06, 0.101983305456973438E+06, 0.102008579834297911E+06, 0.102030494060992147E+06, + 0.102053548115608966E+06, 0.102077104427164624E+06, 0.102100783210934751E+06, 0.102124584361851768E+06, 0.102151618960978216E+06, + 0.102178487299050277E+06, 0.102203837934088209E+06, 0.102231789811787370E+06, 0.102258565924026567E+06, 0.102283435612743153E+06, + 0.102308168911264584E+06, 0.102331519967324959E+06, 0.102351306090243161E+06, 0.102367344163488393E+06, 0.102380956720203612E+06, + 0.102390540926741916E+06, 0.102396561280422888E+06, 0.102399644414793191E+06, 0.102399967479044542E+06, 0.102398097050173761E+06, + 0.102394877934586664E+06, 0.102392579382061362E+06, 0.102387437885771593E+06, 0.102380474134807795E+06, 0.102372089234619867E+06, + 0.102363087167973557E+06, 0.102355720695108947E+06, 0.102355336216227777E+06, 0.102355244528026058E+06, 0.102353863384518510E+06, + 0.102349945815737563E+06, 0.102342442703922468E+06, 0.102329934370864139E+06, 0.102314612359457431E+06, 0.102297370131901000E+06, + 0.102278388120427626E+06, 0.102257491551240819E+06, 0.102236307907230104E+06, 0.102213097347429662E+06, 0.102187800432568954E+06, + 0.102160229919730293E+06, 0.102129097981842890E+06, 0.102096889363146300E+06, 0.102063827052134482E+06, 0.102031184486610946E+06, + 0.101999264622467439E+06, 0.101966221591490219E+06, 0.101931754343580265E+06, 0.101897700536754972E+06, 0.101861993529889558E+06, + 0.101819636716650479E+06, 0.101763615901241341E+06, 0.101697976370488861E+06, 0.101620393736143524E+06, 0.101535102872161384E+06, + 0.101449253069692393E+06, 0.101374420264238244E+06, 0.101306501858255855E+06, 0.101247778577939956E+06, 0.101198381473636808E+06, + 0.101152064836353820E+06, 0.101110344624142366E+06, 0.101075281561938828E+06, 0.101049407554255304E+06, 0.101040768998780331E+06, + 0.101052199471517510E+06, 0.101082392815890635E+06, 0.101129144157533199E+06, 0.101184092780294726E+06, 0.101243772906750455E+06, + 0.101307121999288836E+06, 0.101369991062098430E+06, 0.101433698297000723E+06, 0.101498903828178067E+06, 0.101560474018943947E+06, + 0.101615857050411636E+06, 0.101665138596523073E+06, 0.101705590047241931E+06, 0.101738943786932854E+06, 0.101767114003134644E+06, + 0.101789192730629773E+06, 0.101799147989736230E+06, 0.101794735430608300E+06, 0.101777146397531964E+06, 0.101750372193384130E+06, + 0.101723141667504169E+06, 0.101702833712477848E+06, 0.101682678205011733E+06, 0.101660302359832262E+06, 0.101630633216063026E+06, + 0.101590584748240784E+06, 0.101537939783765964E+06, 0.101477184750419154E+06, 0.101412613988421668E+06, 0.101346432956553763E+06, + 0.101280354991399392E+06, 0.101215950742003886E+06, 0.101152407700542390E+06, 0.101091630971862964E+06, 0.101034381306262483E+06, + 0.100980581565512359E+06, 0.100932607474756849E+06, 0.100894526231033058E+06, 0.100863524006721316E+06, 0.100837940986693153E+06, + 0.100815616712752075E+06, 0.100783831314269482E+06, 0.100747340055464098E+06, 0.100708359519305974E+06, 0.100669700349442544E+06, + 0.100634134123292621E+06, 0.100602055798299742E+06, 0.100591037034284673E+06, 0.100590664657868474E+06, 0.100599127748830913E+06, + 0.100614596189110918E+06, 0.100634150489947802E+06, 0.100646345748706677E+06, 0.100655865724535965E+06, 0.100661116257080008E+06, + 0.100661028163947834E+06, 0.100655523835145024E+06, 0.100646490601253885E+06, 0.100636711851892294E+06, 0.100621894936014534E+06, + 0.100602810704563395E+06, 0.100576368488764041E+06, 0.100548286166395032E+06, 0.100522977180969814E+06, 0.101228903510937074E+06, + 0.101265781795862422E+06, 0.101303509185958625E+06, 0.101342284425688282E+06, 0.101381796177970391E+06, 0.101421170386188518E+06, + 0.101459636817675681E+06, 0.101496562449942183E+06, 0.101531479594885182E+06, 0.101564960000747014E+06, 0.101594803080993937E+06, + 0.101621355790812595E+06, 0.101644027594565501E+06, 0.101662677874236993E+06, 0.101677441926593165E+06, 0.101688651352830973E+06, + 0.101696785059940390E+06, 0.101702406683447451E+06, 0.101704728868073435E+06, 0.101705248359237783E+06, 0.101710033061244059E+06, + 0.101715986265950589E+06, 0.101723653592966657E+06, 0.101733480291010681E+06, 0.101745772459652580E+06, 0.101760677660607515E+06, + 0.101780220410703594E+06, 0.101803075598452182E+06, 0.101826488604444239E+06, 0.101849820362239523E+06, 0.101873892351949500E+06, + 0.101898378960095564E+06, 0.101923130766489805E+06, 0.101948518897807691E+06, 0.101975696258303404E+06, 0.102004061929304342E+06, + 0.102033460145040677E+06, 0.102061651327409054E+06, 0.102089414327740989E+06, 0.102117077133701037E+06, 0.102147883501053424E+06, + 0.102180718015203005E+06, 0.102212493723892243E+06, 0.102242559046992334E+06, 0.102271049350391899E+06, 0.102300915058795246E+06, + 0.102331227250506359E+06, 0.102361003675242988E+06, 0.102387797529886448E+06, 0.102410738749007287E+06, 0.102429543001075872E+06, + 0.102444601309541205E+06, 0.102455934113666241E+06, 0.102463826248762096E+06, 0.102468461440316110E+06, 0.102469870975073049E+06, + 0.102468446450288320E+06, 0.102464798290121791E+06, 0.102458449322550092E+06, 0.102451735051873286E+06, 0.102444849067868476E+06, + 0.102436636367539046E+06, 0.102428988993985171E+06, 0.102425331914020266E+06, 0.102421620005855337E+06, 0.102419560924305013E+06, + 0.102417115927208128E+06, 0.102411283378863518E+06, 0.102401124644854805E+06, 0.102388294546935547E+06, 0.102372130138911380E+06, + 0.102352872703988251E+06, 0.102330900792506814E+06, 0.102305906692453034E+06, 0.102278836660343848E+06, 0.102251891886031619E+06, + 0.102223352000414103E+06, 0.102193067106830058E+06, 0.102161078903831076E+06, 0.102125912821954276E+06, 0.102089510678556544E+06, + 0.102052507421496150E+06, 0.102015228902546209E+06, 0.101978931284532373E+06, 0.101944546111379605E+06, 0.101912474602996255E+06, + 0.101881505541306557E+06, 0.101847220983536259E+06, 0.101796545763435774E+06, 0.101731194445780915E+06, 0.101655521374345393E+06, + 0.101570254785904996E+06, 0.101481522317187802E+06, 0.101401331116195521E+06, 0.101332141668882890E+06, 0.101273993470810659E+06, + 0.101228638656778901E+06, 0.101190604276845741E+06, 0.101158196197344718E+06, 0.101133936056759660E+06, 0.101117981664703751E+06, + 0.101116933850947476E+06, 0.101131399795691948E+06, 0.101160604644423380E+06, 0.101201518443580746E+06, 0.101248903707713456E+06, + 0.101300592974865489E+06, 0.101357214090897702E+06, 0.101418441744321666E+06, 0.101485557443350626E+06, 0.101555445746166064E+06, + 0.101621303501475879E+06, 0.101679228518906544E+06, 0.101728241686716501E+06, 0.101766854072509333E+06, 0.101798436487011495E+06, + 0.101826906634104991E+06, 0.101847291990324695E+06, 0.101856878275200172E+06, 0.101852227620230362E+06, 0.101834698267214306E+06, + 0.101809239675292964E+06, 0.101781969547875371E+06, 0.101755152512939356E+06, 0.101732931589822008E+06, 0.101712653074247995E+06, + 0.101684830999865546E+06, 0.101647239704296619E+06, 0.101599826041378212E+06, 0.101544653396053778E+06, 0.101483464700333992E+06, + 0.101420696082338764E+06, 0.101361355157000173E+06, 0.101303077019503457E+06, 0.101242949922489031E+06, 0.101180470229611776E+06, + 0.101117365765681796E+06, 0.101054059738264114E+06, 0.100995066688862426E+06, 0.100946512981860345E+06, 0.100908291761953325E+06, + 0.100873905402216697E+06, 0.100835045455127693E+06, 0.100798873170272855E+06, 0.100762695696108858E+06, 0.100726025871425081E+06, + 0.100692734909454986E+06, 0.100668902864702948E+06, 0.100663213502720391E+06, 0.100664621390201341E+06, 0.100671374502519597E+06, + 0.100685680453359950E+06, 0.100705798123986984E+06, 0.100728995575579524E+06, 0.100751658112675097E+06, 0.100762519462763623E+06, + 0.100767027529124854E+06, 0.100764553224004907E+06, 0.100755187738630775E+06, 0.100739605979863540E+06, 0.100720551089520799E+06, + 0.100698313533178705E+06, 0.100666865056198847E+06, 0.100634031483894869E+06, 0.100601785153826728E+06, 0.100571987820731039E+06, + 0.101206374045435979E+06, 0.101245886159229500E+06, 0.101288633787391896E+06, 0.101331822184275137E+06, 0.101374720391458119E+06, + 0.101417383823794662E+06, 0.101458981013573735E+06, 0.101498818874093005E+06, 0.101538685205643225E+06, 0.101575422468180957E+06, + 0.101607594064004836E+06, 0.101634787525358639E+06, 0.101658391829702683E+06, 0.101677992927276675E+06, 0.101693216382147584E+06, + 0.101704372381742840E+06, 0.101711917535928253E+06, 0.101714961207000641E+06, 0.101714465004361307E+06, 0.101712311040969114E+06, + 0.101709673671424040E+06, 0.101711218999391320E+06, 0.101715783535561670E+06, 0.101722657082666818E+06, 0.101732238893442816E+06, + 0.101747062236834958E+06, 0.101766365174287086E+06, 0.101787109475394507E+06, 0.101808925705709073E+06, 0.101831553485340701E+06, + 0.101854101136956699E+06, 0.101876977318564983E+06, 0.101900071328279475E+06, 0.101924414875452247E+06, 0.101951462468272264E+06, + 0.101980975232741199E+06, 0.102012836826491402E+06, 0.102047258491401968E+06, 0.102083474297558190E+06, 0.102117469380506620E+06, + 0.102154658530511195E+06, 0.102192659983700083E+06, 0.102229894335694480E+06, 0.102265384438205918E+06, 0.102298947455958070E+06, + 0.102332733340180333E+06, 0.102366161911789881E+06, 0.102400223366988168E+06, 0.102430989231899657E+06, 0.102457385343324306E+06, + 0.102478953671150099E+06, 0.102497140263958892E+06, 0.102511039792962809E+06, 0.102520299291871444E+06, 0.102526846630820248E+06, + 0.102529945588383314E+06, 0.102529752833756676E+06, 0.102527108906249603E+06, 0.102521410242623388E+06, 0.102513405849115865E+06, + 0.102504764193898140E+06, 0.102498120743343170E+06, 0.102494756241843366E+06, 0.102491412904970945E+06, 0.102487349910826408E+06, + 0.102482003045019752E+06, 0.102474975478072651E+06, 0.102465362858837878E+06, 0.102453624922867719E+06, 0.102439388282147716E+06, + 0.102422313370157048E+06, 0.102401857750208626E+06, 0.102377162061003954E+06, 0.102349188460773526E+06, 0.102318424237125233E+06, + 0.102285363297180986E+06, 0.102252385208010586E+06, 0.102218029776633513E+06, 0.102181810380545387E+06, 0.102143591228429039E+06, + 0.102102341867038209E+06, 0.102057770995654748E+06, 0.102012593759546347E+06, 0.101970748503609808E+06, 0.101933725108693834E+06, + 0.101900789684666524E+06, 0.101867979870800904E+06, 0.101834235978935918E+06, 0.101794954568116285E+06, 0.101739484665823096E+06, + 0.101671789500483821E+06, 0.101593418617286006E+06, 0.101506698290483502E+06, 0.101422237896336897E+06, 0.101350833220772416E+06, + 0.101290575286891341E+06, 0.101248402171152557E+06, 0.101218529092999917E+06, 0.101197447450399108E+06, 0.101187612570890138E+06, + 0.101185871864261528E+06, 0.101196499134288402E+06, 0.101218353571942265E+06, 0.101249194623964548E+06, 0.101286372345386742E+06, + 0.101326464875508391E+06, 0.101369986766969960E+06, 0.101419749853660280E+06, 0.101476722498559480E+06, 0.101542829739890207E+06, + 0.101612522924097197E+06, 0.101678721249810798E+06, 0.101737575823144638E+06, 0.101785395492746917E+06, 0.101823368561408701E+06, + 0.101856014056084430E+06, 0.101884313206989173E+06, 0.101903695929922687E+06, 0.101912969317636380E+06, 0.101908832298462992E+06, + 0.101892237038585794E+06, 0.101866203497664581E+06, 0.101837081196005645E+06, 0.101809606048398258E+06, 0.101786840568731568E+06, + 0.101762564033379982E+06, 0.101734680154915579E+06, 0.101696592635540685E+06, 0.101650662453849189E+06, 0.101599162120752633E+06, + 0.101544343001196743E+06, 0.101488647544765059E+06, 0.101433089123172278E+06, 0.101377125096785036E+06, 0.101320042947392227E+06, + 0.101256674805424394E+06, 0.101187987297748215E+06, 0.101120641997896339E+06, 0.101056247927954246E+06, 0.100996331972370142E+06, + 0.100943232428022544E+06, 0.100895353842840079E+06, 0.100852555312220196E+06, 0.100815337064243067E+06, 0.100783799781542155E+06, + 0.100753868748835012E+06, 0.100736637044447663E+06, 0.100730650096307727E+06, 0.100733232093861763E+06, 0.100743913291446443E+06, + 0.100758835470579754E+06, 0.100778259316407013E+06, 0.100802567061591370E+06, 0.100828283762383522E+06, 0.100855135515023372E+06, + 0.100877691529341333E+06, 0.100882602938691591E+06, 0.100878787688210650E+06, 0.100866582130667157E+06, 0.100846949291204379E+06, + 0.100815418882725819E+06, 0.100780247866813195E+06, 0.100745087245795497E+06, 0.100709396490561645E+06, 0.100675020472311327E+06, + 0.100643622948665085E+06, 0.101179250397845899E+06, 0.101221149498052953E+06, 0.101266816356343159E+06, 0.101315335097978430E+06, + 0.101363838550262313E+06, 0.101410108301517408E+06, 0.101455090720967710E+06, 0.101501448789654576E+06, 0.101545139345543692E+06, + 0.101584741389399278E+06, 0.101619452976458153E+06, 0.101648772604086349E+06, 0.101672509578882498E+06, 0.101691865395895249E+06, + 0.101707555892752804E+06, 0.101718643945821881E+06, 0.101724156365132570E+06, 0.101724941937858879E+06, 0.101722568702130273E+06, + 0.101718069834871334E+06, 0.101712578971246767E+06, 0.101707223787895346E+06, 0.101704839789861668E+06, 0.101708104689497137E+06, + 0.101716865742578157E+06, 0.101731053443752840E+06, 0.101746952161869922E+06, 0.101764257279303914E+06, 0.101782706182959490E+06, + 0.101802123848941148E+06, 0.101822482313672357E+06, 0.101842936616784311E+06, 0.101860934973268697E+06, 0.101882854305976114E+06, + 0.101908552344231415E+06, 0.101937813400383588E+06, 0.101970499454458186E+06, 0.102006741063404974E+06, 0.102048298491096837E+06, + 0.102094559383243701E+06, 0.102138864116678858E+06, 0.102182980858368159E+06, 0.102226517702417070E+06, 0.102268076174545422E+06, + 0.102309052474061144E+06, 0.102352381321886001E+06, 0.102391102131696549E+06, 0.102425199358256839E+06, 0.102458541492672259E+06, + 0.102488862618142084E+06, 0.102514290917361213E+06, 0.102535791702452596E+06, 0.102552503476764061E+06, 0.102564543232835902E+06, + 0.102572720164328770E+06, 0.102578198051091356E+06, 0.102580323990135614E+06, 0.102579265394634727E+06, 0.102574962647335808E+06, + 0.102568059504060235E+06, 0.102560319977754334E+06, 0.102556118504191676E+06, 0.102553057067685237E+06, 0.102550069919232395E+06, + 0.102545676460258372E+06, 0.102538438321503912E+06, 0.102526558414006213E+06, 0.102512331043456594E+06, 0.102498934035030790E+06, + 0.102483367837719314E+06, 0.102465528571415576E+06, 0.102444019300123240E+06, 0.102417539855634386E+06, 0.102386941153851396E+06, + 0.102352803854769852E+06, 0.102315908735629360E+06, 0.102276253891919623E+06, 0.102235698643740441E+06, 0.102193754813942534E+06, + 0.102149197092732255E+06, 0.102100466547888893E+06, 0.102048387340808171E+06, 0.101995636407850165E+06, 0.101944784700201388E+06, + 0.101899202783926419E+06, 0.101857839910913841E+06, 0.101822276933475470E+06, 0.101792037001853430E+06, 0.101761456733915693E+06, + 0.101723124817417673E+06, 0.101667540093368385E+06, 0.101602052196997916E+06, 0.101524286713149719E+06, 0.101443448254745468E+06, + 0.101372151184877337E+06, 0.101312547429677303E+06, 0.101270741733953284E+06, 0.101245862300696550E+06, 0.101237403284129323E+06, + 0.101240955267019526E+06, 0.101253727619962054E+06, 0.101276647528408124E+06, 0.101307289777398546E+06, 0.101342096503173772E+06, + 0.101377440256415284E+06, 0.101410859947128090E+06, 0.101445291144028568E+06, 0.101485896954639960E+06, 0.101536034363702740E+06, + 0.101598275532425832E+06, 0.101665271864468625E+06, 0.101730455163620383E+06, 0.101789053839460757E+06, 0.101836451975671342E+06, + 0.101875114449402914E+06, 0.101909841821580325E+06, 0.101937388731349492E+06, 0.101957316621074744E+06, 0.101965726747313485E+06, + 0.101960066223235612E+06, 0.101941333444338321E+06, 0.101914153314528972E+06, 0.101884034639169928E+06, 0.101858023754631969E+06, + 0.101832589987368483E+06, 0.101805510097226972E+06, 0.101772567651719524E+06, 0.101733410070028302E+06, 0.101687946616198518E+06, + 0.101638303259297347E+06, 0.101588584508090702E+06, 0.101540424262528119E+06, 0.101488738611497931E+06, 0.101435260593399056E+06, + 0.101375735107437940E+06, 0.101312542555417007E+06, 0.101246134029601395E+06, 0.101177277643560679E+06, 0.101109587858444022E+06, + 0.101039831433180021E+06, 0.100972865937903305E+06, 0.100917142934489922E+06, 0.100872742649287640E+06, 0.100836992191858386E+06, + 0.100811317083979215E+06, 0.100803167641532855E+06, 0.100798970012812904E+06, 0.100800172827859802E+06, 0.100809159254650964E+06, + 0.100825090132632613E+06, 0.100846063732092007E+06, 0.100868925096583727E+06, 0.100895209549142979E+06, 0.100924583482422255E+06, + 0.100954767114643226E+06, 0.100982762726865476E+06, 0.101000126944911273E+06, 0.100996312696391295E+06, 0.100980278059754797E+06, + 0.100948675007578538E+06, 0.100912131109198177E+06, 0.100873893055713954E+06, 0.100836895686632663E+06, 0.100800840190763440E+06, + 0.100766824999287084E+06, 0.100736390306808840E+06, 0.101147547908848283E+06, 0.101191548413107710E+06, 0.101239813004555443E+06, + 0.101291456639815791E+06, 0.101345618815623297E+06, 0.101399848017628567E+06, 0.101452120246013321E+06, 0.101502531147260263E+06, + 0.101549713655955595E+06, 0.101592520742368200E+06, 0.101630069264663078E+06, 0.101661769202013544E+06, 0.101687336031179409E+06, + 0.101706783718499020E+06, 0.101720752729463624E+06, 0.101730352171304155E+06, 0.101734303682047248E+06, 0.101733803712048772E+06, + 0.101729673880940856E+06, 0.101722933683541196E+06, 0.101714707079396278E+06, 0.101706119415995257E+06, 0.101698183703231305E+06, + 0.101694443401773460E+06, 0.101701997679200067E+06, 0.101711622212974413E+06, 0.101722702839184887E+06, 0.101735051927557608E+06, + 0.101748506288605597E+06, 0.101762966981866150E+06, 0.101778437616403622E+06, 0.101789127619601830E+06, 0.101803967912821841E+06, + 0.101822592115495441E+06, 0.101845777685417066E+06, 0.101873478314957349E+06, 0.101905482242767845E+06, 0.101942888324591171E+06, + 0.101988404530944768E+06, 0.102038702733784274E+06, 0.102092474242398283E+06, 0.102148032734040069E+06, 0.102199248899464394E+06, + 0.102248915596860126E+06, 0.102302591874664358E+06, 0.102352656965704402E+06, 0.102397731646050539E+06, 0.102437448450124619E+06, + 0.102472449474120032E+06, 0.102503421423363616E+06, 0.102532064367287210E+06, 0.102556777288245488E+06, 0.102576671821794167E+06, + 0.102591572855277176E+06, 0.102602228863800672E+06, 0.102612279279788083E+06, 0.102616851593614643E+06, 0.102617893333235930E+06, + 0.102615765691172550E+06, 0.102610441888248854E+06, 0.102607301386114821E+06, 0.102603993592939412E+06, 0.102600663908017392E+06, + 0.102597488187445881E+06, 0.102592493791941044E+06, 0.102582466666192224E+06, 0.102569826273933562E+06, 0.102554713868615829E+06, + 0.102537648672080177E+06, 0.102521039168448478E+06, 0.102503173475915130E+06, 0.102480635537613605E+06, 0.102452652573625455E+06, + 0.102419350874903001E+06, 0.102382346399272821E+06, 0.102341612134553201E+06, 0.102297029075732309E+06, 0.102248948564059086E+06, + 0.102198720030139870E+06, 0.102145758870677353E+06, 0.102088950595530157E+06, 0.102029051584965782E+06, 0.101967199226732264E+06, + 0.101903210271600808E+06, 0.101842958311824055E+06, 0.101794271532633502E+06, 0.101756533651972539E+06, 0.101727257623922851E+06, + 0.101703822910323244E+06, 0.101679786232533574E+06, 0.101644516695705548E+06, 0.101595106427152612E+06, 0.101536504683202511E+06, + 0.101467865301457467E+06, 0.101405006154835806E+06, 0.101354849767181862E+06, 0.101317686662273423E+06, 0.101296595665381508E+06, + 0.101290414819946876E+06, 0.101298257504082198E+06, 0.101319018351106934E+06, 0.101351193190044753E+06, 0.101389882715506814E+06, + 0.101429774758297252E+06, 0.101465327153650665E+06, 0.101493697248690820E+06, 0.101519475777882981E+06, 0.101549278536429629E+06, + 0.101589674862889879E+06, 0.101644437539602266E+06, 0.101707639653092512E+06, 0.101773446880721283E+06, 0.101832627929812195E+06, + 0.101881326017934320E+06, 0.101922991773475122E+06, 0.101958375717528819E+06, 0.101986274837340650E+06, 0.102005491030983016E+06, + 0.102011686815100737E+06, 0.102002038930530602E+06, 0.101979844500374034E+06, 0.101949713592872038E+06, 0.101919794688969385E+06, + 0.101890097820657014E+06, 0.101860915631872151E+06, 0.101828511020572609E+06, 0.101792400720458652E+06, 0.101751700978283421E+06, + 0.101705424659848417E+06, 0.101656344874022790E+06, 0.101609238060088639E+06, 0.101564980684227325E+06, 0.101522208207649019E+06, + 0.101469412985671690E+06, 0.101412347630207965E+06, 0.101351832558558221E+06, 0.101288709894130297E+06, 0.101222062151738224E+06, + 0.101149874038784459E+06, 0.101078002130177440E+06, 0.101009088984990114E+06, 0.100945974661293003E+06, 0.100898762938745946E+06, + 0.100870562536964586E+06, 0.100856855516523385E+06, 0.100855450035140704E+06, 0.100864081929396765E+06, 0.100872263570757554E+06, + 0.100886283473303847E+06, 0.100905686340654982E+06, 0.100926632293872623E+06, 0.100951268783756459E+06, 0.100980364613721176E+06, + 0.101012594678026580E+06, 0.101045448177269616E+06, 0.101076054483113505E+06, 0.101101140326098612E+06, 0.101100763828566429E+06, + 0.101077946327603815E+06, 0.101047158711316821E+06, 0.101011715736067359E+06, 0.100974871631289832E+06, 0.100939265943285602E+06, + 0.100905758734950185E+06, 0.100874978764764266E+06, 0.100855175471442562E+06, 0.101111520792912168E+06, 0.101157325849907211E+06, + 0.101207855335016298E+06, 0.101262234561872421E+06, 0.101320453238625094E+06, 0.101383611932041124E+06, 0.101446021580746979E+06, + 0.101500639373333164E+06, 0.101551782605323038E+06, 0.101598222486408573E+06, 0.101638989420395039E+06, 0.101673403579343765E+06, + 0.101701089807805052E+06, 0.101721974472240297E+06, 0.101735419880771398E+06, 0.101741369945130849E+06, 0.101743897808629612E+06, + 0.101742267006478505E+06, 0.101736494037811004E+06, 0.101727612235604785E+06, 0.101716766590943007E+06, 0.101705114503249541E+06, + 0.101695691907190470E+06, 0.101691082917827283E+06, 0.101688492565094857E+06, 0.101689693834759819E+06, 0.101694319117847946E+06, + 0.101699984888099891E+06, 0.101706624023230441E+06, 0.101714209290037295E+06, 0.101714886189053461E+06, 0.101718477607258348E+06, + 0.101727166805334680E+06, 0.101741942812281210E+06, 0.101762884060961267E+06, 0.101787922016469936E+06, 0.101818124304470504E+06, + 0.101856144652932824E+06, 0.101902274632393572E+06, 0.101955219215111909E+06, 0.102013545239481187E+06, 0.102075989637765349E+06, + 0.102141825734524129E+06, 0.102209412008951840E+06, 0.102271101455590702E+06, 0.102328905451065119E+06, 0.102380997966748007E+06, + 0.102426592472327698E+06, 0.102466679017069036E+06, 0.102502492265674373E+06, 0.102531828163015132E+06, 0.102557693337524877E+06, + 0.102581562159738140E+06, 0.102599817594232780E+06, 0.102617360456048831E+06, 0.102630533755776734E+06, 0.102638413398652745E+06, + 0.102641585059017671E+06, 0.102641643207641609E+06, 0.102639909103140890E+06, 0.102637870663539637E+06, 0.102635390209430159E+06, + 0.102632452553768846E+06, 0.102629055188468876E+06, 0.102622883797323870E+06, 0.102613396703866238E+06, 0.102601167982128070E+06, + 0.102586228500797864E+06, 0.102570641502416736E+06, 0.102554342163336842E+06, 0.102534088219572732E+06, 0.102511041429401579E+06, + 0.102481963706129696E+06, 0.102447121630716501E+06, 0.102407091340582192E+06, 0.102362401740888643E+06, 0.102313427305605088E+06, + 0.102259555941640690E+06, 0.102201038299707958E+06, 0.102138783904224241E+06, 0.102073015852343407E+06, 0.102003417942998523E+06, + 0.101925865118624715E+06, 0.101850155355117560E+06, 0.101780650482480312E+06, 0.101721528392427077E+06, 0.101678592950691062E+06, + 0.101649600593305571E+06, 0.101630406458717945E+06, 0.101617445713840047E+06, 0.101603733747246617E+06, 0.101577149951594518E+06, + 0.101547743780961551E+06, 0.101507738128132827E+06, 0.101462001737325336E+06, 0.101417253659172507E+06, 0.101379673252643261E+06, + 0.101354722198341828E+06, 0.101344083982961922E+06, 0.101350090319994677E+06, 0.101372932240478462E+06, 0.101408874721438551E+06, + 0.101453217513073498E+06, 0.101497802352511892E+06, 0.101536224569247846E+06, 0.101563019361021943E+06, 0.101582620293203203E+06, + 0.101603379870639314E+06, 0.101634664417891821E+06, 0.101681132562699248E+06, 0.101739502773358443E+06, 0.101803164120008223E+06, + 0.101863683127456912E+06, 0.101917393438978630E+06, 0.101963558171047160E+06, 0.101999276960053059E+06, 0.102027732037148526E+06, + 0.102044731025719229E+06, 0.102045431775095058E+06, 0.102030705033808161E+06, 0.102003666856825570E+06, 0.101970343646836016E+06, + 0.101935360181740762E+06, 0.101900669036632447E+06, 0.101865688643875081E+06, 0.101829409780582253E+06, 0.101790176042387873E+06, + 0.101745151599830831E+06, 0.101696472660873420E+06, 0.101648060959889524E+06, 0.101603410369994090E+06, 0.101561835852602439E+06, + 0.101521855998799132E+06, 0.101482037163334768E+06, 0.101431340410975914E+06, 0.101375699870779092E+06, 0.101314779976223654E+06, + 0.101251712502201844E+06, 0.101185784883436660E+06, 0.101116517257030340E+06, 0.101049883113580014E+06, 0.100989563385332454E+06, + 0.100941765093850961E+06, 0.100916306862933794E+06, 0.100906980056579865E+06, 0.100910197269982164E+06, 0.100922958161069488E+06, + 0.100941314458770998E+06, 0.100957519326146881E+06, 0.100976831072572779E+06, 0.100999605735160003E+06, 0.101025582535843947E+06, + 0.101054164787686663E+06, 0.101087890451072817E+06, 0.101122283479534453E+06, 0.101149350938674921E+06, 0.101166873408313593E+06, + 0.101177821152178367E+06, 0.101167655432610394E+06, 0.101141220410113790E+06, 0.101110321588459745E+06, 0.101078361586283063E+06, + 0.101047967121170557E+06, 0.101023734539325480E+06, 0.101008383694813747E+06, 0.100996781521485842E+06, 0.101071681166949435E+06, + 0.101119012263039112E+06, 0.101171496350808069E+06, 0.101230050130927513E+06, 0.101294972556584413E+06, 0.101361718999132645E+06, + 0.101428515451916319E+06, 0.101493595145979649E+06, 0.101550612440880213E+06, 0.101601210858501552E+06, 0.101645666556374214E+06, + 0.101683206121268653E+06, 0.101713363718937704E+06, 0.101736031118329251E+06, 0.101750515944612693E+06, 0.101757053628392736E+06, + 0.101756382807271759E+06, 0.101751079781741602E+06, 0.101743715819909994E+06, 0.101732729519215369E+06, 0.101719316686245147E+06, + 0.101706213959027606E+06, 0.101695984176562313E+06, 0.101686190677071994E+06, 0.101677301261342131E+06, 0.101669511529871947E+06, + 0.101662644903393695E+06, 0.101659294762388396E+06, 0.101657066043437371E+06, 0.101647001805639928E+06, 0.101637372304767356E+06, + 0.101632049251178221E+06, 0.101632583495971994E+06, 0.101640198281276986E+06, 0.101655810259860154E+06, 0.101680028481804649E+06, + 0.101706638821039131E+06, 0.101742286180341995E+06, 0.101788109417502055E+06, 0.101842726554478882E+06, 0.101904504042995715E+06, + 0.101971839066862056E+06, 0.102051325178151485E+06, 0.102132183694597014E+06, 0.102209672996832567E+06, 0.102278148214885616E+06, + 0.102338448224708001E+06, 0.102390873033725249E+06, 0.102438626144456910E+06, 0.102479259552033545E+06, 0.102513206393975473E+06, + 0.102541824188105747E+06, 0.102567198188429233E+06, 0.102591367917437441E+06, 0.102612619776373147E+06, 0.102629292784196412E+06, + 0.102640555112501301E+06, 0.102646561280503796E+06, 0.102650072544106879E+06, 0.102650385076837265E+06, 0.102648623310889074E+06, + 0.102647398290377925E+06, 0.102645017994891765E+06, 0.102642292476577204E+06, 0.102637067835034904E+06, 0.102629000591322547E+06, + 0.102618729003435990E+06, 0.102606585296063713E+06, 0.102594489398555161E+06, 0.102579129366844747E+06, 0.102559288929741029E+06, + 0.102534463674515951E+06, 0.102503683064059122E+06, 0.102467677027648388E+06, 0.102425952698371388E+06, 0.102378489696413220E+06, + 0.102325464394964612E+06, 0.102266592853272959E+06, 0.102201770963158517E+06, 0.102131402230157837E+06, 0.102054746212255937E+06, + 0.101968929014764348E+06, 0.101881350922099227E+06, 0.101796528814235106E+06, 0.101718540575217223E+06, 0.101652169308423996E+06, + 0.101599956132104824E+06, 0.101567900805891448E+06, 0.101551935071902582E+06, 0.101547427861477787E+06, 0.101554419426909473E+06, + 0.101561600978615184E+06, 0.101559452993868224E+06, 0.101543318540946057E+06, 0.101516046490907509E+06, 0.101480708475794294E+06, + 0.101442199752635075E+06, 0.101409794893836297E+06, 0.101389114738180739E+06, 0.101385262237127725E+06, 0.101400028248419621E+06, + 0.101431176088229637E+06, 0.101474781214988048E+06, 0.101522572921117302E+06, 0.101566852249736243E+06, 0.101600450643120159E+06, + 0.101625889986676848E+06, 0.101647907487096571E+06, 0.101675661997654053E+06, 0.101714463575179296E+06, 0.101767306549608373E+06, + 0.101829328954263532E+06, 0.101890507206039634E+06, 0.101946066216170686E+06, 0.101992520848846892E+06, 0.102030925636120199E+06, + 0.102058119932572736E+06, 0.102069397218130180E+06, 0.102063960577488731E+06, 0.102043326123970241E+06, 0.102008553848255615E+06, + 0.101967472871147096E+06, 0.101926394136031289E+06, 0.101886043970172454E+06, 0.101846744426466306E+06, 0.101807275512743188E+06, + 0.101761955344090966E+06, 0.101713799217710359E+06, 0.101665117193273894E+06, 0.101617359026062331E+06, 0.101572592180247302E+06, + 0.101533981842693742E+06, 0.101499194744985522E+06, 0.101466415578573593E+06, 0.101432243614177438E+06, 0.101381882914991351E+06, + 0.101327735566313961E+06, 0.101272085428944469E+06, 0.101216117169049772E+06, 0.101156916040190554E+06, 0.101098197832462072E+06, + 0.101045083251186894E+06, 0.101001341900752319E+06, 0.100969631972021365E+06, 0.100962352822747649E+06, 0.100968513387743296E+06, + 0.100983909597780104E+06, 0.101002878032770619E+06, 0.101021997578890048E+06, 0.101041366902723443E+06, 0.101063829282811043E+06, + 0.101089246526039147E+06, 0.101117245287077734E+06, 0.101145180487582722E+06, 0.101169961535366980E+06, 0.101193870243324593E+06, + 0.101214945572481010E+06, 0.101231265902229890E+06, 0.101240946166576672E+06, 0.101226758959788902E+06, 0.101203801319224774E+06, + 0.101180554692105070E+06, 0.101163284364848339E+06, 0.101153028319845049E+06, 0.101150355172476586E+06, 0.101145580058182692E+06, + 0.101028800627874574E+06, 0.101077428684324259E+06, 0.101134167142638209E+06, 0.101197990565301836E+06, 0.101265722975280849E+06, + 0.101335709112544850E+06, 0.101406209334330430E+06, 0.101475487925550115E+06, 0.101541907493692343E+06, 0.101600856889744842E+06, + 0.101649573257523298E+06, 0.101690733358275495E+06, 0.101724376638615926E+06, 0.101749510141425519E+06, 0.101765791117457280E+06, + 0.101773452578481490E+06, 0.101773114885158633E+06, 0.101765715127990101E+06, 0.101752413867995332E+06, 0.101738692514285227E+06, + 0.101723904619569148E+06, 0.101710227930270819E+06, 0.101695310346281782E+06, 0.101679758838352922E+06, 0.101664029621015856E+06, + 0.101648327607929226E+06, 0.101632507008869143E+06, 0.101615973949263309E+06, 0.101591834033789346E+06, 0.101568495570761865E+06, + 0.101547691859404833E+06, 0.101531530936334253E+06, 0.101521827887484746E+06, 0.101520050854732108E+06, 0.101527313513054993E+06, + 0.101537145982894304E+06, 0.101560590862112396E+06, 0.101599562166824646E+06, 0.101645766826557534E+06, 0.101701752618078797E+06, + 0.101766692067664408E+06, 0.101846710834492522E+06, 0.101935405126349360E+06, 0.102024396175872622E+06, 0.102110867349092339E+06, + 0.102192853218211705E+06, 0.102269413494696259E+06, 0.102330281542130935E+06, 0.102383945506085889E+06, 0.102430199256480380E+06, + 0.102469066393364890E+06, 0.102501583023640342E+06, 0.102532817139689723E+06, 0.102561960069998779E+06, 0.102585754372647149E+06, + 0.102606277240311640E+06, 0.102621561801826407E+06, 0.102631876834385388E+06, 0.102638884194148588E+06, 0.102641934388380745E+06, + 0.102641959420915780E+06, 0.102640521654950935E+06, 0.102639686428696965E+06, 0.102638253506522131E+06, 0.102634465365988304E+06, + 0.102627915114268661E+06, 0.102619787557100746E+06, 0.102613378349844119E+06, 0.102603999870031650E+06, 0.102590631585167415E+06, + 0.102572103225089755E+06, 0.102547313635873026E+06, 0.102516398885249058E+06, 0.102479446900462790E+06, 0.102437237325361522E+06, + 0.102388874413479600E+06, 0.102333718028784861E+06, 0.102271049401030890E+06, 0.102201028861754414E+06, 0.102122663528859397E+06, + 0.102032876851637207E+06, 0.101938463410692304E+06, 0.101842660210214104E+06, 0.101749957344606999E+06, 0.101664764507437576E+06, + 0.101591439187819764E+06, 0.101533919460466379E+06, 0.101494271575071776E+06, 0.101478987993255127E+06, 0.101485263674090980E+06, + 0.101506279443945081E+06, 0.101532941096559764E+06, 0.101553896677561657E+06, 0.101563917085832989E+06, 0.101552692436306723E+06, + 0.101526766068070108E+06, 0.101490572300548680E+06, 0.101454740971174542E+06, 0.101425776324883132E+06, 0.101411062568111098E+06, + 0.101413866812942622E+06, 0.101435131474614493E+06, 0.101474051380900128E+06, 0.101522941427092213E+06, 0.101574152032058948E+06, + 0.101618098831177398E+06, 0.101654170137284003E+06, 0.101684054984246599E+06, 0.101716539075889523E+06, 0.101756604551361495E+06, + 0.101806467761705877E+06, 0.101862424100462653E+06, 0.101918408568819126E+06, 0.101971439624029648E+06, 0.102015800714595636E+06, + 0.102049385208646127E+06, 0.102069908714661666E+06, 0.102076032068515779E+06, 0.102064732659179368E+06, 0.102034093795762514E+06, + 0.101992630086863239E+06, 0.101944780810628261E+06, 0.101894141477159937E+06, 0.101849042057571452E+06, 0.101805808680122878E+06, + 0.101760916109816302E+06, 0.101714291793644923E+06, 0.101666393705850103E+06, 0.101619297696421156E+06, 0.101573598742667251E+06, + 0.101529420471224686E+06, 0.101490381423561645E+06, 0.101460489541744115E+06, 0.101432531917615197E+06, 0.101405679166028422E+06, + 0.101376758400729959E+06, 0.101333014356477448E+06, 0.101288061869102195E+06, 0.101243137897010267E+06, 0.101200014773099698E+06, + 0.101153035601030700E+06, 0.101107255027280131E+06, 0.101068975039667697E+06, 0.101040318598185462E+06, 0.101026239021205620E+06, + 0.101036150724925217E+06, 0.101050786638747362E+06, 0.101066960176317720E+06, 0.101082545023658342E+06, 0.101098187778212945E+06, + 0.101117678130985703E+06, 0.101139021760228803E+06, 0.101155522461091532E+06, 0.101175020122667425E+06, 0.101198265495543150E+06, + 0.101224832562545693E+06, 0.101250329820757150E+06, 0.101272684085133165E+06, 0.101289811161881575E+06, 0.101299701614067628E+06, + 0.101289739336630024E+06, 0.101279678002747503E+06, 0.101273826681569160E+06, 0.101274570526567550E+06, 0.101282465694758634E+06, + 0.101293902962443753E+06, 0.100983835656151976E+06, 0.101036388934372706E+06, 0.101096497142358145E+06, 0.101162397946509547E+06, + 0.101232608232112354E+06, 0.101305480982330599E+06, 0.101379283841868455E+06, 0.101452283197187178E+06, 0.101522834159475562E+06, + 0.101589476875808105E+06, 0.101650386759155634E+06, 0.101696210127681858E+06, 0.101733613430271813E+06, 0.101761832290367092E+06, + 0.101780569821559126E+06, 0.101789961901369534E+06, 0.101790532679209500E+06, 0.101783131653860866E+06, 0.101768849808582265E+06, + 0.101750041068809616E+06, 0.101731803246356489E+06, 0.101713921895166000E+06, 0.101693731889764837E+06, 0.101671835744684708E+06, + 0.101648705771986570E+06, 0.101624585079514640E+06, 0.101599389025969096E+06, 0.101563768387053642E+06, 0.101522704766848532E+06, + 0.101483489785699712E+06, 0.101448687013231232E+06, 0.101419615240213854E+06, 0.101397479525329196E+06, 0.101384028029676760E+06, + 0.101370836998047147E+06, 0.101368370266732833E+06, 0.101383065641375812E+06, 0.101416090998647196E+06, 0.101467290265164353E+06, + 0.101534882313080263E+06, 0.101609445319890510E+06, 0.101699733235880441E+06, 0.101794859855521834E+06, 0.101891101060966321E+06, + 0.101985315130313480E+06, 0.102075076914327306E+06, 0.102159945052938041E+06, 0.102235771297951098E+06, 0.102301477656430769E+06, + 0.102354930558367778E+06, 0.102399782724316072E+06, 0.102438694369211255E+06, 0.102476839111309280E+06, 0.102509751156878236E+06, + 0.102537521783681077E+06, 0.102560895469354815E+06, 0.102580819063130271E+06, 0.102594854584419911E+06, 0.102605160074562926E+06, + 0.102611577337313051E+06, 0.102614486702620023E+06, 0.102617674490494959E+06, 0.102619973525111447E+06, 0.102618324460179618E+06, + 0.102615416266488261E+06, 0.102610851205396946E+06, 0.102607299216665502E+06, 0.102602572628475973E+06, 0.102595515104050908E+06, + 0.102585432283621078E+06, 0.102569550312714797E+06, 0.102546496599273247E+06, 0.102517612581426918E+06, 0.102482362007529839E+06, + 0.102441544642516921E+06, 0.102393921375066857E+06, 0.102338338767732290E+06, 0.102273827698305467E+06, 0.102199580759235032E+06, + 0.102112717239415593E+06, 0.102017541011033652E+06, 0.101917267901995700E+06, 0.101815758981969469E+06, 0.101717854365049221E+06, + 0.101627270343615834E+06, 0.101547308817353100E+06, 0.101483765146806487E+06, 0.101441943712900873E+06, 0.101423999856314156E+06, + 0.101430776328316933E+06, 0.101457783973006139E+06, 0.101497023306538365E+06, 0.101538146597104598E+06, 0.101564980031804182E+06, + 0.101571345079031700E+06, 0.101556555710264554E+06, 0.101527227279379993E+06, 0.101491242458124063E+06, 0.101455431195561541E+06, + 0.101427222639413303E+06, 0.101413952789479707E+06, 0.101420016873493543E+06, 0.101448672726717166E+06, 0.101494479796940665E+06, + 0.101550679225448213E+06, 0.101607025893701604E+06, 0.101659304835337243E+06, 0.101705889950175377E+06, 0.101749787609497245E+06, + 0.101793551387452957E+06, 0.101844793551510127E+06, 0.101899113907290477E+06, 0.101951953582127840E+06, 0.101997167012573933E+06, + 0.102030191525044342E+06, 0.102053787395966574E+06, 0.102064887574337728E+06, 0.102060267944376203E+06, 0.102039749700523636E+06, + 0.102005081906476669E+06, 0.101957654047840246E+06, 0.101904801258523614E+06, 0.101850843726662788E+06, 0.101798946363995929E+06, + 0.101751878064897523E+06, 0.101705939443378287E+06, 0.101659768391705205E+06, 0.101615380159911743E+06, 0.101570783461705709E+06, + 0.101526947551755860E+06, 0.101484787939652975E+06, 0.101445231219594032E+06, 0.101413345817087800E+06, 0.101391047300393111E+06, + 0.101372584877227360E+06, 0.101355566853485740E+06, 0.101335220992961375E+06, 0.101303837716816255E+06, 0.101271525370591757E+06, + 0.101240298133351855E+06, 0.101211003024413338E+06, 0.101175839364889063E+06, 0.101146665774628709E+06, 0.101127801050420749E+06, + 0.101116214564623544E+06, 0.101115217567181709E+06, 0.101124992952320288E+06, 0.101134962605509543E+06, 0.101143290627816998E+06, + 0.101149282865567409E+06, 0.101151001731697805E+06, 0.101160080279956310E+06, 0.101174468885292459E+06, 0.101194158852267166E+06, + 0.101218629627263130E+06, 0.101247610934086246E+06, 0.101278139638903813E+06, 0.101306993640526780E+06, 0.101332857422239162E+06, + 0.101352835922766695E+06, 0.101364854062282961E+06, 0.101366215681609348E+06, 0.101371982657827277E+06, 0.101384204628605657E+06, + 0.101403123567578412E+06, 0.101427293507956012E+06, 0.100939699761507189E+06, 0.100993926545564740E+06, 0.101055617446205957E+06, + 0.101123302505147047E+06, 0.101195700951661318E+06, 0.101271150132425566E+06, 0.101347899405442047E+06, 0.101424189839355866E+06, + 0.101498339603613043E+06, 0.101568835452811982E+06, 0.101636401101424097E+06, 0.101695457584751377E+06, 0.101740082571501800E+06, + 0.101772165987128828E+06, 0.101794061760174460E+06, 0.101805821721959510E+06, 0.101807890769523758E+06, 0.101801052084176001E+06, + 0.101787222143099047E+06, 0.101769333451322513E+06, 0.101746134751190912E+06, 0.101718716143227328E+06, 0.101691356809011646E+06, + 0.101662464249923956E+06, 0.101631298348493656E+06, 0.101598170677190283E+06, 0.101554964683279206E+06, 0.101502331999436428E+06, + 0.101449056042133889E+06, 0.101396847279871756E+06, 0.101347056172201555E+06, 0.101300460882216124E+06, 0.101262584703042259E+06, + 0.101225780265849375E+06, 0.101194459775717551E+06, 0.101179417053502169E+06, 0.101183702376592380E+06, 0.101209076499852017E+06, + 0.101255909037280071E+06, 0.101326640203920455E+06, 0.101424239758254218E+06, 0.101531367651623077E+06, 0.101632910073723979E+06, + 0.101736158570445637E+06, 0.101837656744184424E+06, 0.101936360666710083E+06, 0.102029774479476604E+06, 0.102113550935132720E+06, + 0.102187275245992423E+06, 0.102251742085495353E+06, 0.102308744854441014E+06, 0.102354056548559587E+06, 0.102395496326958368E+06, + 0.102432085609497080E+06, 0.102463450245845990E+06, 0.102489865598489851E+06, 0.102514853262571502E+06, 0.102534082770129738E+06, + 0.102548592777604266E+06, 0.102559883810599669E+06, 0.102568794081739034E+06, 0.102579021392062437E+06, 0.102585007107402751E+06, + 0.102586497457448539E+06, 0.102584376842419224E+06, 0.102580903181294503E+06, 0.102577151681759657E+06, 0.102573827515381417E+06, + 0.102568538059750121E+06, 0.102560561364228692E+06, 0.102548460310359820E+06, 0.102530289426340809E+06, 0.102505861568008157E+06, + 0.102475498063954670E+06, 0.102440643792700503E+06, 0.102396241614374099E+06, 0.102341446243588929E+06, 0.102276649353635905E+06, + 0.102199862029058393E+06, 0.102111863644497949E+06, 0.102014314786398143E+06, 0.101910607455440113E+06, 0.101806306816961252E+06, + 0.101704399917697054E+06, 0.101609603981306922E+06, 0.101526211311625375E+06, 0.101459322473350869E+06, 0.101412795838567283E+06, + 0.101389618525710335E+06, 0.101393845554395113E+06, 0.101424357742906359E+06, 0.101472713797786171E+06, 0.101522607587252613E+06, + 0.101559998357663775E+06, 0.101576743781235520E+06, 0.101573310646049868E+06, 0.101549833954751783E+06, 0.101514456685338067E+06, + 0.101472694191529066E+06, 0.101434208011361596E+06, 0.101406914911600485E+06, 0.101398454904380153E+06, 0.101415253675564527E+06, + 0.101455136695375608E+06, 0.101512719547979839E+06, 0.101577237869349250E+06, 0.101641152022720256E+06, 0.101700396834169049E+06, + 0.101757567947174000E+06, 0.101815111575731135E+06, 0.101874014294397304E+06, 0.101930155420364375E+06, 0.101979578233631371E+06, + 0.102017827567168875E+06, 0.102041453032023797E+06, 0.102049181677356071E+06, 0.102042624564991027E+06, 0.102027458526470917E+06, + 0.101998856271186160E+06, 0.101958763385915998E+06, 0.101909825004560786E+06, 0.101855834630693556E+06, 0.101803471305377156E+06, + 0.101751840395667561E+06, 0.101701669671223848E+06, 0.101657371568089962E+06, 0.101614737302306821E+06, 0.101571808841198203E+06, + 0.101529035182503387E+06, 0.101487836291383923E+06, 0.101448187429775586E+06, 0.101410201287687276E+06, 0.101375725543945955E+06, + 0.101354091334976038E+06, 0.101343701275904139E+06, 0.101337958790157587E+06, 0.101334014323027164E+06, 0.101323058410853802E+06, + 0.101303680281432564E+06, 0.101285071086934273E+06, 0.101269046902558985E+06, 0.101256912292666253E+06, 0.101239485050412128E+06, + 0.101225094542196108E+06, 0.101214114558167246E+06, 0.101206300766355242E+06, 0.101205366180458252E+06, 0.101205376802251209E+06, + 0.101196436467417006E+06, 0.101184014918681118E+06, 0.101170971956995039E+06, 0.101173896703063627E+06, 0.101186778426832985E+06, + 0.101207425966799259E+06, 0.101235075391491133E+06, 0.101268299800364039E+06, 0.101308063493844020E+06, 0.101344788336284473E+06, + 0.101376389450400151E+06, 0.101402378295128001E+06, 0.101423140134659829E+06, 0.101438782026730638E+06, 0.101455746728587110E+06, + 0.101479368387625509E+06, 0.101509546030359561E+06, 0.101546739387306210E+06, 0.100893625093361974E+06, 0.100948455392464501E+06, + 0.101011317645263582E+06, 0.101080913011082172E+06, 0.101155302174425058E+06, 0.101233112731396410E+06, 0.101312551980581891E+06, + 0.101391810121618284E+06, 0.101469643740293817E+06, 0.101547894952444782E+06, 0.101619713078854009E+06, 0.101683304064554628E+06, + 0.101737232999154556E+06, 0.101779617777438179E+06, 0.101805388291197829E+06, 0.101820150398714570E+06, 0.101824280737551730E+06, + 0.101819067925622789E+06, 0.101806980910888844E+06, 0.101787436214918198E+06, 0.101761287349566453E+06, 0.101729423465328233E+06, + 0.101692622608612961E+06, 0.101651573936670728E+06, 0.101611590783753491E+06, 0.101562833006838278E+06, 0.101502364394767414E+06, + 0.101438724936641054E+06, 0.101373805958635741E+06, 0.101309369954324357E+06, 0.101246873385268977E+06, 0.101187267453513661E+06, + 0.101122914968029043E+06, 0.101055428119650373E+06, 0.101008249772026029E+06, 0.100979473982631680E+06, 0.100972177967227311E+06, + 0.100988832853860484E+06, 0.101031262783445170E+06, 0.101112202656024601E+06, 0.101211093846252057E+06, 0.101323155130905317E+06, + 0.101443212391304434E+06, 0.101565274984548159E+06, 0.101675064133449094E+06, 0.101783046764746541E+06, 0.101883427362778093E+06, + 0.101974048605326316E+06, 0.102054089915572622E+06, 0.102123916001737191E+06, 0.102185138506351650E+06, 0.102239277647944138E+06, + 0.102288043635062262E+06, 0.102329848961112002E+06, 0.102365570526105090E+06, 0.102398175565311816E+06, 0.102427118018994763E+06, + 0.102451215888181687E+06, 0.102470889959435211E+06, 0.102487322259304128E+06, 0.102507363262553656E+06, 0.102522539511451090E+06, + 0.102533202617323841E+06, 0.102538447738773189E+06, 0.102539366679125000E+06, 0.102537806325041631E+06, 0.102534134338413278E+06, + 0.102529616480806799E+06, 0.102525504718401397E+06, 0.102520340764588414E+06, 0.102512361946182253E+06, 0.102499685852779818E+06, + 0.102481370178637997E+06, 0.102461804458447645E+06, 0.102433116211535496E+06, 0.102394820498302695E+06, 0.102344806742965229E+06, + 0.102282869771580241E+06, 0.102208190347609911E+06, 0.102122230232017173E+06, 0.102026360478078772E+06, 0.101922376088166435E+06, + 0.101815964790077211E+06, 0.101712553837059808E+06, 0.101615912730210781E+06, 0.101531538428717235E+06, 0.101462015329520931E+06, + 0.101411095529211190E+06, 0.101383553801811446E+06, 0.101387868686696354E+06, 0.101419065450411930E+06, 0.101465197763774107E+06, + 0.101514122624701689E+06, 0.101554157750064871E+06, 0.101577510533460605E+06, 0.101578561408166206E+06, 0.101561717136454608E+06, + 0.101527942832344896E+06, 0.101485492708933743E+06, 0.101442040681691869E+06, 0.101407214730937660E+06, 0.101391475969427891E+06, + 0.101402057936737707E+06, 0.101438129992839313E+06, 0.101494675186752138E+06, 0.101561405991801003E+06, 0.101631832958464947E+06, + 0.101700764128050694E+06, 0.101765471244284083E+06, 0.101829298739144535E+06, 0.101891487805957440E+06, 0.101949649930012936E+06, + 0.101996983260441179E+06, 0.102028825999188412E+06, 0.102041977726062381E+06, 0.102037063043873364E+06, 0.102018484271153007E+06, + 0.101987519813082123E+06, 0.101953322744109144E+06, 0.101911210582393775E+06, 0.101863879485885569E+06, 0.101813868935175255E+06, + 0.101763558865488987E+06, 0.101714781421884982E+06, 0.101669784944327868E+06, 0.101626116114336663E+06, 0.101583855166139518E+06, + 0.101542346971029430E+06, 0.101502633877275308E+06, 0.101464939559164166E+06, 0.101426766367174598E+06, 0.101390458857219390E+06, + 0.101358471458522574E+06, 0.101334112694217969E+06, 0.101328407691393310E+06, 0.101330874497622441E+06, 0.101337110359200757E+06, + 0.101343736678259927E+06, 0.101343244142495707E+06, 0.101341300900043818E+06, 0.101339844172589394E+06, 0.101338724330486657E+06, + 0.101333664918719776E+06, 0.101322891249048946E+06, 0.101311826452015521E+06, 0.101299221594776434E+06, 0.101282571152943405E+06, + 0.101266530780531204E+06, 0.101246643011162712E+06, 0.101224150063358495E+06, 0.101202571591745436E+06, 0.101188612840670292E+06, + 0.101199966484071061E+06, 0.101222097051704724E+06, 0.101260233588647054E+06, 0.101304129252313578E+06, 0.101350161554908336E+06, + 0.101389652624068185E+06, 0.101424551417429771E+06, 0.101454274075586436E+06, 0.101479148917351384E+06, 0.101500388782067501E+06, + 0.101525545796928971E+06, 0.101562513561929518E+06, 0.101606090475506091E+06, 0.101653619386718725E+06, 0.100845507039246062E+06, + 0.100900566753226827E+06, 0.100964147998307293E+06, 0.101035004760987780E+06, 0.101111734714359307E+06, 0.101192123809297234E+06, + 0.101274156352906692E+06, 0.101357605885697238E+06, 0.101443671119726976E+06, 0.101525544557033369E+06, 0.101601182677887831E+06, + 0.101668789681363778E+06, 0.101726898348598319E+06, 0.101774441929614739E+06, 0.101810815552412794E+06, 0.101832035149566495E+06, + 0.101838765440822797E+06, 0.101835596101807649E+06, 0.101823419644672496E+06, 0.101802715728713345E+06, 0.101774151142095492E+06, + 0.101738457612419079E+06, 0.101696295926065533E+06, 0.101648104911459959E+06, 0.101590285842002006E+06, 0.101521209919707282E+06, + 0.101450839575846665E+06, 0.101376697188940336E+06, 0.101300744148618498E+06, 0.101224863840720194E+06, 0.101150697403150189E+06, + 0.101073301607053800E+06, 0.100983235760375988E+06, 0.100901684378507489E+06, 0.100833101972986929E+06, 0.100781373167571786E+06, + 0.100760772506158712E+06, 0.100768040826660945E+06, 0.100819963855216105E+06, 0.100898361962391151E+06, 0.100996401252706506E+06, + 0.101109805590524003E+06, 0.101233684034863138E+06, 0.101362757333502159E+06, 0.101494642793831357E+06, 0.101619684005633680E+06, + 0.101728129058541483E+06, 0.101825059560781054E+06, 0.101910320070122136E+06, 0.101982389350624275E+06, 0.102044412115271698E+06, + 0.102100145695870931E+06, 0.102151182120026933E+06, 0.102199014246850449E+06, 0.102244844616859526E+06, 0.102284509458517772E+06, + 0.102318215421307876E+06, 0.102347902960885476E+06, 0.102373421335254781E+06, 0.102401951332123936E+06, 0.102429181477717284E+06, + 0.102450532016644735E+06, 0.102465997336774948E+06, 0.102475777963121422E+06, 0.102478313815590023E+06, 0.102478110250759957E+06, + 0.102475657036715347E+06, 0.102471918321198871E+06, 0.102469939192222024E+06, 0.102467007436977176E+06, 0.102462490014742158E+06, + 0.102456722431479779E+06, 0.102450737615132341E+06, 0.102440335034919917E+06, 0.102420575011656954E+06, 0.102389812989896382E+06, + 0.102347122683242473E+06, 0.102292275082950306E+06, 0.102224438636867562E+06, 0.102143836217952965E+06, 0.102050866494433591E+06, + 0.101949943411085245E+06, 0.101845736377779569E+06, 0.101742816153747364E+06, 0.101647911129982123E+06, 0.101563216996056130E+06, + 0.101491604823778136E+06, 0.101437861556007003E+06, 0.101412287502927546E+06, 0.101412856551671823E+06, 0.101435247443498505E+06, + 0.101472966599928535E+06, 0.101514519271643498E+06, 0.101550307716508367E+06, 0.101572773831424129E+06, 0.101577300876503461E+06, + 0.101561783761491213E+06, 0.101528832671536744E+06, 0.101487621468217170E+06, 0.101449333621855301E+06, 0.101421572690143163E+06, + 0.101412849368901254E+06, 0.101428815273143569E+06, 0.101468452704213269E+06, 0.101526342258825374E+06, 0.101593070240422909E+06, + 0.101660293633886846E+06, 0.101724359259873541E+06, 0.101785772418607943E+06, 0.101847556062125179E+06, 0.101908363003809383E+06, + 0.101961701914240010E+06, 0.102002429874153109E+06, 0.102025185688122059E+06, 0.102030228237618969E+06, 0.102016392623057240E+06, + 0.101989203583738155E+06, 0.101954215596148948E+06, 0.101916658897302012E+06, 0.101876815696310456E+06, 0.101833071043157586E+06, + 0.101787308476072212E+06, 0.101741539193291770E+06, 0.101697630101558476E+06, 0.101654119182481736E+06, 0.101610960850170581E+06, + 0.101569179414185535E+06, 0.101528773468682877E+06, 0.101490142318063241E+06, 0.101454189911789217E+06, 0.101420537325155994E+06, + 0.101387196165512592E+06, 0.101359208745426033E+06, 0.101338989486127597E+06, 0.101329695327606096E+06, 0.101338867992364074E+06, + 0.101355871810450670E+06, 0.101375430345140587E+06, 0.101394209504973755E+06, 0.101402919751202760E+06, 0.101410688334029808E+06, + 0.101416920285657412E+06, 0.101420489242522977E+06, 0.101413658635510583E+06, 0.101399351916641783E+06, 0.101380364637205465E+06, + 0.101357315413079603E+06, 0.101331383086953632E+06, 0.101302463143222500E+06, 0.101271861027862804E+06, 0.101243797629858222E+06, + 0.101225102912379341E+06, 0.101230895188582799E+06, 0.101260967028080006E+06, 0.101301126414935963E+06, 0.101347821784489817E+06, + 0.101397550525323837E+06, 0.101444003541722705E+06, 0.101480976560253359E+06, 0.101512946357403111E+06, 0.101540212183607568E+06, + 0.101567953884550225E+06, 0.101594468785546575E+06, 0.101637676393726375E+06, 0.101688399693186482E+06, 0.101742930184759069E+06, + 0.100795882153115017E+06, 0.100850797431345025E+06, 0.100914750948998306E+06, 0.100986523708389999E+06, 0.101064741053657359E+06, + 0.101147944583867647E+06, 0.101236474647069423E+06, 0.101327593382317646E+06, 0.101416818345205553E+06, 0.101501970105562199E+06, + 0.101581006340059568E+06, 0.101652107178935606E+06, 0.101713753841424812E+06, 0.101764799350409041E+06, 0.101804529976921447E+06, + 0.101832451081090258E+06, 0.101847567048303332E+06, 0.101846442214230046E+06, 0.101834900151378431E+06, 0.101813744156519519E+06, + 0.101783490044669117E+06, 0.101744750228076155E+06, 0.101698109004179641E+06, 0.101641364118676778E+06, 0.101569583201128436E+06, + 0.101490816574609969E+06, 0.101406531256311253E+06, 0.101319625817001812E+06, 0.101233091961074242E+06, 0.101146347584902731E+06, + 0.101058989124578555E+06, 0.100953964690316512E+06, 0.100852899705475327E+06, 0.100760578698964149E+06, 0.100681685450575751E+06, + 0.100620492778267973E+06, 0.100580496608869158E+06, 0.100579462774121028E+06, 0.100625977088063315E+06, 0.100699672061534206E+06, + 0.100794647180633037E+06, 0.100907249288633233E+06, 0.101033016501104474E+06, 0.101170532820658074E+06, 0.101310202043631813E+06, + 0.101443951517617694E+06, 0.101566665342990047E+06, 0.101674561727816923E+06, 0.101762857707379371E+06, 0.101831050817027455E+06, + 0.101892059674295087E+06, 0.101947353598683054E+06, 0.101998507084363489E+06, 0.102047351014086569E+06, 0.102096770563981801E+06, + 0.102143221374936838E+06, 0.102186890306655871E+06, 0.102228196597294736E+06, 0.102264105567156759E+06, 0.102302445150954794E+06, + 0.102336246787148004E+06, 0.102363781472504663E+06, 0.102384291162903231E+06, 0.102397430622010026E+06, 0.102403312624922473E+06, + 0.102403832627536103E+06, 0.102402612769131738E+06, 0.102401390930183130E+06, 0.102401466546220196E+06, 0.102401874865610895E+06, + 0.102402100027913009E+06, 0.102404524182350739E+06, 0.102408945753433436E+06, 0.102408228479075435E+06, 0.102399207567720179E+06, + 0.102378727543360583E+06, 0.102346081419689654E+06, 0.102300584036716507E+06, 0.102242408524207058E+06, 0.102170172560628038E+06, + 0.102084827969266131E+06, 0.101990466580006148E+06, 0.101891305283198890E+06, 0.101794051647235989E+06, 0.101701758202335564E+06, + 0.101617607399452128E+06, 0.101545673956610553E+06, 0.101493920019806435E+06, 0.101463389589686616E+06, 0.101454707404169429E+06, + 0.101465784796775130E+06, 0.101489404864046577E+06, 0.101519701691131908E+06, 0.101547620610180951E+06, 0.101565576165996550E+06, + 0.101562026624260950E+06, 0.101539419490073633E+06, 0.101508015501831396E+06, 0.101475602714955035E+06, 0.101449209652947975E+06, + 0.101436251410560508E+06, 0.101442877175111498E+06, 0.101471341372345414E+06, 0.101518178052896081E+06, 0.101577355032239313E+06, + 0.101641314782584261E+06, 0.101703564541155953E+06, 0.101762362987943518E+06, 0.101818379277178246E+06, 0.101872714548978096E+06, + 0.101924119264252775E+06, 0.101966776195386803E+06, 0.101995500768842219E+06, 0.102007086660768691E+06, 0.102002030153628395E+06, + 0.101985038462701981E+06, 0.101956611217972633E+06, 0.101924174284332606E+06, 0.101890531345005773E+06, 0.101858684611865552E+06, + 0.101821867670641383E+06, 0.101781442886233301E+06, 0.101738169818174909E+06, 0.101693020445221118E+06, 0.101649533509090848E+06, + 0.101606065252630258E+06, 0.101563356987927487E+06, 0.101522196794781717E+06, 0.101483000104046587E+06, 0.101448492093986119E+06, + 0.101420196255985837E+06, 0.101395294590973572E+06, 0.101373162271020163E+06, 0.101359621762719311E+06, 0.101356933368830039E+06, + 0.101368947980949306E+06, 0.101392192190573551E+06, 0.101417779659041989E+06, 0.101442531040709990E+06, 0.101462476541542521E+06, + 0.101476476704636079E+06, 0.101486973325915984E+06, 0.101492708978460287E+06, 0.101491506327010982E+06, 0.101476163566485891E+06, + 0.101454012045195879E+06, 0.101426588508176050E+06, 0.101395767868210212E+06, 0.101361555520167341E+06, 0.101327388871009054E+06, + 0.101300667576237203E+06, 0.101284994174892112E+06, 0.101283350959747040E+06, 0.101309210052713708E+06, 0.101350688755181967E+06, + 0.101399465772761600E+06, 0.101451857069433157E+06, 0.101504338927611956E+06, 0.101548087731741456E+06, 0.101585173851711908E+06, + 0.101617418107249265E+06, 0.101645918462371425E+06, 0.101672368866688703E+06, 0.101702644054264791E+06, 0.101756834440843944E+06, + 0.101815020493009375E+06, 0.100745394112667054E+06, 0.100799832870823317E+06, 0.100863855953311213E+06, 0.100936251298315474E+06, + 0.101015648499264644E+06, 0.101104654341683374E+06, 0.101200128443110370E+06, 0.101296361142831636E+06, 0.101389195762127056E+06, + 0.101477275829104881E+06, 0.101559295351936235E+06, 0.101633387586243814E+06, 0.101697961740723156E+06, 0.101751772598623953E+06, + 0.101793901427349119E+06, 0.101823866729636080E+06, 0.101841583691637163E+06, 0.101847052782340179E+06, 0.101840097601263231E+06, + 0.101819364884434224E+06, 0.101788292383590582E+06, 0.101747405137351147E+06, 0.101695621343299601E+06, 0.101627436111935327E+06, + 0.101550322384277897E+06, 0.101465476616664964E+06, 0.101374194733789423E+06, 0.101277718928660746E+06, 0.101177047947947533E+06, + 0.101075621770040874E+06, 0.100963507971772880E+06, 0.100850151599165794E+06, 0.100741049456883455E+06, 0.100641201275214524E+06, + 0.100555640521779089E+06, 0.100489164793431541E+06, 0.100453712051746988E+06, 0.100455966233873114E+06, 0.100484341033634380E+06, + 0.100537490332318921E+06, 0.100620003905902136E+06, 0.100729309835612949E+06, 0.100858870023752374E+06, 0.101002649715674357E+06, + 0.101147678361066428E+06, 0.101287802540963821E+06, 0.101417496539417145E+06, 0.101532273896933402E+06, 0.101613683175199098E+06, + 0.101680723164626179E+06, 0.101737444859119263E+06, 0.101791182708811306E+06, 0.101841314940347904E+06, 0.101891796533315224E+06, + 0.101941590080887530E+06, 0.101990059211011772E+06, 0.102037355306302023E+06, 0.102083701488133767E+06, 0.102136891332944331E+06, + 0.102186806386969169E+06, 0.102230479823408270E+06, 0.102264774535572782E+06, 0.102290420308268731E+06, 0.102307702555592783E+06, + 0.102317766904831617E+06, 0.102321662148245741E+06, 0.102321498408406202E+06, 0.102320441248726507E+06, 0.102319523718290511E+06, + 0.102322447750704567E+06, 0.102327503158949214E+06, 0.102340754529364640E+06, 0.102353506384693246E+06, 0.102362358688122375E+06, + 0.102364445626707267E+06, 0.102355674159446760E+06, 0.102335040551811529E+06, 0.102301981999839074E+06, 0.102255676163442389E+06, + 0.102195798314690837E+06, 0.102122639698007450E+06, 0.102039086723219865E+06, 0.101949840960878224E+06, 0.101859938889724974E+06, + 0.101771880315094095E+06, 0.101689691466275064E+06, 0.101619553461018091E+06, 0.101564784382206009E+06, 0.101527063676792590E+06, + 0.101506865347517232E+06, 0.101503522390084341E+06, 0.101512744653858725E+06, 0.101529231308459130E+06, 0.101545937638918578E+06, + 0.101543746232650679E+06, 0.101529149091683401E+06, 0.101505036617385034E+06, 0.101477259643610611E+06, 0.101452985842091570E+06, + 0.101443019818922796E+06, 0.101450005107018835E+06, 0.101477223491849247E+06, 0.101523231314288976E+06, 0.101581629450517838E+06, + 0.101644098508760901E+06, 0.101703051093558723E+06, 0.101755080739197074E+06, 0.101801349748540073E+06, 0.101847343504094184E+06, + 0.101892088842664132E+06, 0.101930776572625342E+06, 0.101959972929516225E+06, 0.101973275480066382E+06, 0.101972016851233420E+06, + 0.101959747868463455E+06, 0.101940685784926434E+06, 0.101919336338791196E+06, 0.101894507185877927E+06, 0.101871113669696017E+06, + 0.101847657889249851E+06, 0.101820887903955852E+06, 0.101784170021964572E+06, 0.101741602583369866E+06, 0.101694747059338464E+06, + 0.101647292622998575E+06, 0.101600773270067424E+06, 0.101554052329806203E+06, 0.101509997350416306E+06, 0.101472107321641699E+06, + 0.101442071551669200E+06, 0.101420240877131699E+06, 0.101406891473258380E+06, 0.101396015807551084E+06, 0.101392164060749914E+06, + 0.101397198621684831E+06, 0.101410725481402653E+06, 0.101436168965154429E+06, 0.101464448461599168E+06, 0.101491134274545591E+06, + 0.101513817760506034E+06, 0.101531534488231206E+06, 0.101544658070101810E+06, 0.101551681755858954E+06, 0.101551216434335554E+06, + 0.101539195357785327E+06, 0.101514919199184893E+06, 0.101483010220912314E+06, 0.101448007466093870E+06, 0.101414858070553688E+06, + 0.101383218898751307E+06, 0.101359262217297684E+06, 0.101346709055278770E+06, 0.101347915439013712E+06, 0.101365119587774912E+06, + 0.101407924765819262E+06, 0.101458658683875430E+06, 0.101515675014729291E+06, 0.101573920518004117E+06, 0.101629788706552135E+06, + 0.101668434413804149E+06, 0.101700504314289530E+06, 0.101727848552964642E+06, 0.101752288382924846E+06, 0.101776226460626523E+06, + 0.101814361167678813E+06, 0.101872139466116685E+06, 0.100694816386903738E+06, 0.100748531064111390E+06, 0.100812413075077391E+06, + 0.100885240325433202E+06, 0.100971984589634725E+06, 0.101066079836500590E+06, 0.101163332246353209E+06, 0.101261519892330936E+06, + 0.101358385768427062E+06, 0.101451421123224791E+06, 0.101536054276749637E+06, 0.101612689419430462E+06, 0.101679641914763270E+06, + 0.101735174644287632E+06, 0.101778750617147758E+06, 0.101810665166487233E+06, 0.101830410029895895E+06, 0.101837810772118624E+06, + 0.101833022665443903E+06, 0.101816510393020842E+06, 0.101787854012666052E+06, 0.101744823421577603E+06, 0.101683938556403096E+06, + 0.101613036597664483E+06, 0.101532884942156001E+06, 0.101444504410039342E+06, 0.101349069651044396E+06, 0.101247781610335631E+06, + 0.101141708506075884E+06, 0.101021202144232695E+06, 0.100894721062327983E+06, 0.100769982600624178E+06, 0.100655427823023274E+06, + 0.100550770964121868E+06, 0.100461477319971644E+06, 0.100396193533225101E+06, 0.100370475160386210E+06, 0.100369362731624045E+06, + 0.100393088104568509E+06, 0.100440996230512974E+06, 0.100511511049115361E+06, 0.100603846780177613E+06, 0.100726574426591877E+06, + 0.100871208402494914E+06, 0.101018016887883554E+06, 0.101160944293748136E+06, 0.101294154343677379E+06, 0.101398406532467285E+06, + 0.101478074072107382E+06, 0.101546049324473512E+06, 0.101603974418745871E+06, 0.101653727077973454E+06, 0.101697954544609078E+06, + 0.101741376690074656E+06, 0.101789988330066262E+06, 0.101838680208411213E+06, 0.101887795803836605E+06, 0.101942598855672841E+06, + 0.102000837418646348E+06, 0.102056277940396962E+06, 0.102106768405713607E+06, 0.102150535774670396E+06, 0.102182996899048041E+06, + 0.102206750157000613E+06, 0.102221201245532342E+06, 0.102228757950974235E+06, 0.102230269318708335E+06, 0.102229908214737996E+06, + 0.102230221444085299E+06, 0.102233117647704858E+06, 0.102243955867660014E+06, 0.102261169827573845E+06, 0.102280623025385154E+06, + 0.102298710646779829E+06, 0.102311720481040116E+06, 0.102316483254606297E+06, 0.102310329085876278E+06, 0.102292054686377145E+06, + 0.102261582445110776E+06, 0.102217278999264774E+06, 0.102159938958497296E+06, 0.102090651836751262E+06, 0.102014420809727890E+06, + 0.101933158619991009E+06, 0.101851325383247095E+06, 0.101773700996606422E+06, 0.101704655579852813E+06, 0.101645470306280142E+06, + 0.101599387487163476E+06, 0.101568762309086727E+06, 0.101551200721109650E+06, 0.101544950055199806E+06, 0.101545234940555893E+06, + 0.101536151271568684E+06, 0.101520957074193793E+06, 0.101499514166347813E+06, 0.101472481430049040E+06, 0.101447481037651174E+06, + 0.101431698928562022E+06, 0.101432519665399988E+06, 0.101455989679772596E+06, 0.101503867701139068E+06, 0.101569707321795955E+06, + 0.101641541183263049E+06, 0.101707359784777087E+06, 0.101760909663319078E+06, 0.101802944092112913E+06, 0.101837429073186562E+06, + 0.101868490058515003E+06, 0.101895999089963501E+06, 0.101921719560774494E+06, 0.101935208629263929E+06, 0.101934734847469299E+06, + 0.101921789770189804E+06, 0.101905337918664198E+06, 0.101889233907825823E+06, 0.101876223533093609E+06, 0.101864529046626514E+06, + 0.101850666495852842E+06, 0.101835575764428810E+06, 0.101815211112956240E+06, 0.101783740571016519E+06, 0.101739678309719806E+06, + 0.101689041718466135E+06, 0.101634899667157661E+06, 0.101583884425190394E+06, 0.101535509776931387E+06, 0.101491128441498251E+06, + 0.101453011421685966E+06, 0.101428708334432333E+06, 0.101415133080661239E+06, 0.101411902195392497E+06, 0.101415741142001993E+06, + 0.101421700628259656E+06, 0.101434916879656914E+06, 0.101454096376128975E+06, 0.101478884585159176E+06, 0.101507961817356219E+06, + 0.101534772926637874E+06, 0.101557090728886120E+06, 0.101574113620330667E+06, 0.101587280909418565E+06, 0.101593317203057959E+06, + 0.101589233196906163E+06, 0.101574814776511601E+06, 0.101547332581751762E+06, 0.101514869284270651E+06, 0.101481998192358122E+06, + 0.101452150550811974E+06, 0.101427572510067519E+06, 0.101409813743047896E+06, 0.101403676308175665E+06, 0.101410943983370715E+06, + 0.101433007929108295E+06, 0.101473704830047689E+06, 0.101528968358056605E+06, 0.101588585098966272E+06, 0.101648865730780017E+06, + 0.101706538485246449E+06, 0.101754905727487509E+06, 0.101785976200502380E+06, 0.101811017148794053E+06, 0.101832089114193281E+06, + 0.101851827047180632E+06, 0.101871848271984418E+06, 0.101914442748880043E+06, 0.100645050821058583E+06, 0.100697921098829320E+06, + 0.100761591261288675E+06, 0.100844244243942405E+06, 0.100934005537327830E+06, 0.101028963380699686E+06, 0.101127123691640561E+06, + 0.101226361187462535E+06, 0.101324505036089657E+06, 0.101419431488063798E+06, 0.101509163971173737E+06, 0.101590063785101636E+06, + 0.101657671467199980E+06, 0.101713396702810118E+06, 0.101758515364488485E+06, 0.101792091325616479E+06, 0.101813481673006056E+06, + 0.101822350253392695E+06, 0.101818668615804971E+06, 0.101802702749391727E+06, 0.101774619027333058E+06, 0.101728109831474241E+06, + 0.101668908134665704E+06, 0.101597584119515159E+06, 0.101516856663981162E+06, 0.101427599824837293E+06, 0.101330896414631075E+06, + 0.101227935201261804E+06, 0.101113372919066416E+06, 0.100989129696766337E+06, 0.100861373889168084E+06, 0.100733678225485171E+06, + 0.100610105917794019E+06, 0.100495004451233079E+06, 0.100402578780181022E+06, 0.100353109983544055E+06, 0.100326440206043859E+06, + 0.100322735531117156E+06, 0.100342802276422299E+06, 0.100386646482634504E+06, 0.100453451962470805E+06, 0.100549574897853177E+06, + 0.100666205550992949E+06, 0.100795807241975184E+06, 0.100931381874395069E+06, 0.101067411193584325E+06, 0.101192762302618430E+06, + 0.101283622761741586E+06, 0.101362350787791220E+06, 0.101430423297678528E+06, 0.101489314399921583E+06, 0.101540641111512159E+06, + 0.101585585061290316E+06, 0.101627410996723280E+06, 0.101667724011934901E+06, 0.101707970653555123E+06, 0.101751269935565215E+06, + 0.101811021944586406E+06, 0.101870809774501089E+06, 0.101928469764575537E+06, 0.101981732364511379E+06, 0.102026310772180412E+06, + 0.102061898497918446E+06, 0.102089845634957077E+06, 0.102110105242362508E+06, 0.102121882127719451E+06, 0.102124061355970684E+06, + 0.102123733324673376E+06, 0.102124546125847337E+06, 0.102129219082775890E+06, 0.102145351303200790E+06, 0.102166260171440692E+06, + 0.102190433845960331E+06, 0.102216291023032318E+06, 0.102242152119835548E+06, 0.102260901292175229E+06, 0.102271019053290802E+06, + 0.102270194336435845E+06, 0.102258376332468251E+06, 0.102232740434276260E+06, 0.102193082447496578E+06, 0.102140339518538545E+06, + 0.102077291761659100E+06, 0.102007943796066291E+06, 0.101934901694509579E+06, 0.101863769251748963E+06, 0.101795867039438526E+06, + 0.101734634917306947E+06, 0.101683465453549536E+06, 0.101643719755611994E+06, 0.101613589850316028E+06, 0.101591266195843433E+06, + 0.101568063676064237E+06, 0.101544190597726789E+06, 0.101518173523634308E+06, 0.101489293133355706E+06, 0.101456969224960791E+06, + 0.101429471204937334E+06, 0.101413477375518429E+06, 0.101417790921687454E+06, 0.101450822395921219E+06, 0.101510233193849519E+06, + 0.101585841462266966E+06, 0.101664438788265412E+06, 0.101733920550829818E+06, 0.101788706066789920E+06, 0.101825829329588349E+06, + 0.101850405636027645E+06, 0.101871083937706790E+06, 0.101887382097668247E+06, 0.101896455049501354E+06, 0.101897289413654769E+06, + 0.101886248870001597E+06, 0.101867415759247539E+06, 0.101847995171556977E+06, 0.101838485076295401E+06, 0.101834100858943464E+06, + 0.101832686427819717E+06, 0.101828063075528247E+06, 0.101816399093795466E+06, 0.101796719243765314E+06, 0.101767216502717842E+06, + 0.101721966250064579E+06, 0.101668953652310433E+06, 0.101611959093829370E+06, 0.101556227036786251E+06, 0.101506414279391960E+06, + 0.101461971390057777E+06, 0.101425468706421860E+06, 0.101404163733341426E+06, 0.101399096476539751E+06, 0.101405522879150667E+06, + 0.101421050121819761E+06, 0.101438689378578158E+06, 0.101460180927881505E+06, 0.101485796004159551E+06, 0.101513713918150577E+06, + 0.101542550860272706E+06, 0.101568068025141562E+06, 0.101588331740948968E+06, 0.101600913455480535E+06, 0.101607630152187616E+06, + 0.101607407012941694E+06, 0.101598607139348926E+06, 0.101581645287700347E+06, 0.101557205094100689E+06, 0.101527626140599372E+06, + 0.101498954813168501E+06, 0.101474478229909684E+06, 0.101456851592814171E+06, 0.101447916547657107E+06, 0.101451532249133510E+06, + 0.101469023039587555E+06, 0.101500095660945575E+06, 0.101543265481331633E+06, 0.101599989966535504E+06, 0.101661394639400824E+06, + 0.101722843298708525E+06, 0.101781217785530855E+06, 0.101833962893083750E+06, 0.101869504665579036E+06, 0.101891006131465809E+06, + 0.101907724224272592E+06, 0.101922174311177543E+06, 0.101935867942354409E+06, 0.101950426065447158E+06, 0.100607098755765037E+06, + 0.100655240281701743E+06, 0.100726600376942501E+06, 0.100809356254825645E+06, 0.100899004634437370E+06, 0.100993829979357848E+06, + 0.101091906852125423E+06, 0.101191172811513417E+06, 0.101289507328918466E+06, 0.101384817108912728E+06, 0.101475128234200398E+06, + 0.101556622026723067E+06, 0.101627508170991190E+06, 0.101685968687809233E+06, 0.101732567539073978E+06, 0.101767665006896481E+06, + 0.101790488350008833E+06, 0.101800548295886649E+06, 0.101797644943693944E+06, 0.101781861361740375E+06, 0.101747873759633774E+06, + 0.101701859594637368E+06, 0.101644745116156497E+06, 0.101577648617696381E+06, 0.101501095515959882E+06, 0.101413668608079461E+06, + 0.101318547892610906E+06, 0.101214143017131020E+06, 0.101099338905386365E+06, 0.100978397278849705E+06, 0.100854041321450713E+06, + 0.100729710648106629E+06, 0.100609462614676057E+06, 0.100497826949930561E+06, 0.100414459388165211E+06, 0.100356511886266162E+06, + 0.100322777395156372E+06, 0.100316042351856522E+06, 0.100332097081535409E+06, 0.100371561029088683E+06, 0.100439298341075264E+06, + 0.100532568922400489E+06, 0.100643002914990837E+06, 0.100765387761929349E+06, 0.100893492581718543E+06, 0.101020399500629603E+06, + 0.101112706098134367E+06, 0.101194570041727216E+06, 0.101269273413618284E+06, 0.101335562528605122E+06, 0.101394060212437602E+06, + 0.101445483977905038E+06, 0.101491335215433006E+06, 0.101533800970901357E+06, 0.101574594133775521E+06, 0.101615314066683874E+06, + 0.101662259781339875E+06, 0.101713149881755875E+06, 0.101764653351764238E+06, 0.101815034877485959E+06, 0.101864609985221337E+06, + 0.101906670614871124E+06, 0.101942016196974146E+06, 0.101970135166829859E+06, 0.101990609169172516E+06, 0.101996950610404732E+06, + 0.101996810049367472E+06, 0.101996317886868128E+06, 0.101998445642552077E+06, 0.102008824591142213E+06, 0.102027635971959302E+06, + 0.102051641514833580E+06, 0.102080850665324571E+06, 0.102117904503131693E+06, 0.102157634194590821E+06, 0.102192504721610734E+06, + 0.102219235460459910E+06, 0.102236777347130861E+06, 0.102242902162718834E+06, 0.102236355155139478E+06, 0.102216651883876315E+06, + 0.102180426444035780E+06, 0.102133083528179093E+06, 0.102077034681391349E+06, 0.102016323324797893E+06, 0.101953628282518228E+06, + 0.101890856388452012E+06, 0.101830915333128054E+06, 0.101779447310396441E+06, 0.101734080624489550E+06, 0.101693870504157734E+06, + 0.101656684022070389E+06, 0.101619340499046710E+06, 0.101584139894536143E+06, 0.101548750508560886E+06, 0.101508927593507731E+06, + 0.101469477866382847E+06, 0.101436805815304979E+06, 0.101415993387059803E+06, 0.101423466131997789E+06, 0.101453632286171531E+06, + 0.101508029375078389E+06, 0.101580823336132147E+06, 0.101656593588021438E+06, 0.101722011470405239E+06, 0.101771508397742451E+06, + 0.101807913013677957E+06, 0.101834964343916130E+06, 0.101850402618856344E+06, 0.101859186985402383E+06, 0.101860587418252151E+06, + 0.101854518941434624E+06, 0.101838720084331697E+06, 0.101819824582356232E+06, 0.101803402458019846E+06, 0.101796893209118367E+06, + 0.101799592648883248E+06, 0.101802452116411427E+06, 0.101801265547130839E+06, 0.101788566176828695E+06, 0.101765879286445153E+06, + 0.101732953696931960E+06, 0.101687950182710265E+06, 0.101633167492824286E+06, 0.101575598313827417E+06, 0.101518917024984054E+06, + 0.101468456845219422E+06, 0.101425013728590406E+06, 0.101390361593186084E+06, 0.101368216911030337E+06, 0.101370279495935785E+06, + 0.101384930299833504E+06, 0.101409208395769369E+06, 0.101438468993645060E+06, 0.101467787546390668E+06, 0.101499453696433935E+06, + 0.101530518538351142E+06, 0.101558938309742618E+06, 0.101581645149348537E+06, 0.101598207551499479E+06, 0.101607649285544889E+06, + 0.101609802844516307E+06, 0.101605573988511765E+06, 0.101593037714059843E+06, 0.101573514674016667E+06, 0.101549196000671189E+06, + 0.101522849664976588E+06, 0.101498330261054754E+06, 0.101479889987571310E+06, 0.101470097853539497E+06, 0.101471225349216998E+06, + 0.101486588535369752E+06, 0.101515334980482352E+06, 0.101556357596876667E+06, 0.101607560846124834E+06, 0.101666443968593783E+06, + 0.101729419441298363E+06, 0.101791387702929569E+06, 0.101848011454613385E+06, 0.101897514583017852E+06, 0.101939642427183790E+06, + 0.101960271009820077E+06, 0.101975158780464568E+06, 0.101986424653725320E+06, 0.101995822513432664E+06, 0.102004992120982162E+06, + 0.100578411052675729E+06, 0.100635318784110554E+06, 0.100702588041198120E+06, 0.100778983082032035E+06, 0.100867372014784603E+06, + 0.100961003291497836E+06, 0.101057944061462069E+06, 0.101156164506401896E+06, 0.101253562485936651E+06, 0.101348041518852056E+06, + 0.101435305736620867E+06, 0.101514565773677881E+06, 0.101585969098869886E+06, 0.101648080408071197E+06, 0.101699676885091831E+06, + 0.101737081890784044E+06, 0.101761287426791518E+06, 0.101772434840921720E+06, 0.101770158786062922E+06, 0.101748537453835859E+06, + 0.101714770053279746E+06, 0.101669742860261249E+06, 0.101614251954373656E+06, 0.101549290791504973E+06, 0.101476027861641691E+06, + 0.101395781087328636E+06, 0.101309332351133024E+06, 0.101208930191804626E+06, 0.101100827344175617E+06, 0.100987036454510526E+06, + 0.100870048278151575E+06, 0.100753131768219901E+06, 0.100640279785382925E+06, 0.100543839073244162E+06, 0.100470119984832578E+06, + 0.100412920571785522E+06, 0.100374418672954038E+06, 0.100356321711452154E+06, 0.100359754832890321E+06, 0.100393037545625295E+06, + 0.100461456665693026E+06, 0.100548040695085903E+06, 0.100649774320544951E+06, 0.100762231735881898E+06, 0.100879810004682629E+06, + 0.100978944107382951E+06, 0.101056139035317683E+06, 0.101129122973660080E+06, 0.101197131809436498E+06, 0.101259400864402109E+06, + 0.101315369721067444E+06, 0.101366567376128267E+06, 0.101413068730518760E+06, 0.101456050767495792E+06, 0.101497394979706776E+06, + 0.101540388547235518E+06, 0.101589723482442452E+06, 0.101639287384227951E+06, 0.101688119127630343E+06, 0.101734881227949692E+06, + 0.101774055633342999E+06, 0.101806176343790416E+06, 0.101833758016756707E+06, 0.101855867301477920E+06, 0.101869669516056863E+06, + 0.101867423844660036E+06, 0.101862185064065459E+06, 0.101857648911106618E+06, 0.101857166947219768E+06, 0.101869453362050233E+06, + 0.101889395994667357E+06, 0.101917145273055416E+06, 0.101952665990595080E+06, 0.102005113066678605E+06, 0.102059201352783610E+06, + 0.102110590092891594E+06, 0.102155134120450733E+06, 0.102189008661845161E+06, 0.102212893719536674E+06, 0.102224794573552019E+06, + 0.102221917283866860E+06, 0.102203717818992911E+06, 0.102173729797711843E+06, 0.102134066117315539E+06, 0.102088155198460590E+06, + 0.102037322504280150E+06, 0.101983804157969324E+06, 0.101930882216981918E+06, 0.101882568835916391E+06, 0.101835848097687121E+06, + 0.101791045975844638E+06, 0.101745969221785286E+06, 0.101701401299452598E+06, 0.101658034247290489E+06, 0.101613792586539625E+06, + 0.101566658381616784E+06, 0.101523107840297394E+06, 0.101485865057037794E+06, 0.101467196461575470E+06, 0.101465231282475186E+06, + 0.101481792269703801E+06, 0.101521171184929379E+06, 0.101584362409188645E+06, 0.101654606382538637E+06, 0.101708085889500013E+06, + 0.101750884319908815E+06, 0.101781151271932016E+06, 0.101802265119226417E+06, 0.101814660749166302E+06, 0.101818059160636913E+06, + 0.101815376584443497E+06, 0.101808025978518664E+06, 0.101796093709958877E+06, 0.101783205967926551E+06, 0.101773519465245452E+06, + 0.101768347262196490E+06, 0.101772318875173907E+06, 0.101774032894583841E+06, 0.101769304008539359E+06, 0.101752736287782580E+06, + 0.101724576811767562E+06, 0.101687606667018787E+06, 0.101642832213384885E+06, 0.101588413046507747E+06, 0.101532052789407389E+06, + 0.101477089478998780E+06, 0.101426937636667906E+06, 0.101383983337104524E+06, 0.101350070067916895E+06, 0.101327894217902314E+06, + 0.101330294767154453E+06, 0.101349863124191863E+06, 0.101379498558547202E+06, 0.101415335536042723E+06, 0.101450570253408456E+06, + 0.101486617503024216E+06, 0.101521790468661828E+06, 0.101553679702050722E+06, 0.101576951634593526E+06, 0.101592599322586801E+06, + 0.101600882539355007E+06, 0.101601982296252419E+06, 0.101593711037322297E+06, 0.101576295595724252E+06, 0.101552760225610255E+06, + 0.101525860012702775E+06, 0.101500304746004782E+06, 0.101482529221745732E+06, 0.101472615361795470E+06, 0.101472486373178777E+06, + 0.101483501295817390E+06, 0.101509279618775763E+06, 0.101549321581216165E+06, 0.101600205319342873E+06, 0.101659295372980385E+06, + 0.101721590076149907E+06, 0.101783337171577281E+06, 0.101842427132610639E+06, 0.101897333754838794E+06, 0.101946395082493676E+06, + 0.101988236942542819E+06, 0.102017526821220177E+06, 0.102031828714653369E+06, 0.102041305631011754E+06, 0.102047936605813040E+06, + 0.102053545022376406E+06, 0.100561618890645521E+06, 0.100618675407796312E+06, 0.100685232428278308E+06, 0.100760148812781379E+06, + 0.100842043992347171E+06, 0.100930626779751663E+06, 0.101025380770443604E+06, 0.101121496737499227E+06, 0.101216863489791329E+06, + 0.101306591907260168E+06, 0.101390820508431876E+06, 0.101469198549494278E+06, 0.101540194252744899E+06, 0.101602382440106187E+06, + 0.101654511301229999E+06, 0.101695567045773627E+06, 0.101724835997739530E+06, 0.101738206502799672E+06, 0.101728469792924647E+06, + 0.101706705766990082E+06, 0.101673943944349550E+06, 0.101630654689779229E+06, 0.101577521269946941E+06, 0.101515423259462186E+06, + 0.101445417400194085E+06, 0.101369301689578249E+06, 0.101289207179891833E+06, 0.101202291357723705E+06, 0.101109840862024794E+06, + 0.101010060536526478E+06, 0.100903624985256116E+06, 0.100797206247763170E+06, 0.100697721229483854E+06, 0.100617879166639119E+06, + 0.100549334862444375E+06, 0.100494554672908853E+06, 0.100455829928310864E+06, 0.100435159192249281E+06, 0.100434140902790139E+06, + 0.100463827743078145E+06, 0.100516682399563157E+06, 0.100588924784875649E+06, 0.100677081454071609E+06, 0.100775641942890885E+06, + 0.100875619518922729E+06, 0.100945870321605689E+06, 0.101013133541299816E+06, 0.101077503451870405E+06, 0.101138697419382283E+06, + 0.101196245970018281E+06, 0.101247478059058092E+06, 0.101295381961911495E+06, 0.101341293286219021E+06, 0.101385520658941925E+06, + 0.101428507369388099E+06, 0.101477628384924552E+06, 0.101527439265766385E+06, 0.101575625370267109E+06, 0.101621502298168052E+06, + 0.101663832962092813E+06, 0.101694866512688139E+06, 0.101720503961646493E+06, 0.101740691340596662E+06, 0.101755087321406769E+06, + 0.101753809082437700E+06, 0.101741526291839808E+06, 0.101728608499199152E+06, 0.101718502985755840E+06, 0.101716703972249219E+06, + 0.101727329002141589E+06, 0.101746865685733879E+06, 0.101776394054624689E+06, 0.101821041668101156E+06, 0.101883903619016666E+06, + 0.101950707313021689E+06, 0.102016579439056790E+06, 0.102074857884153607E+06, 0.102122966684235507E+06, 0.102162229375958646E+06, + 0.102191070936530305E+06, 0.102205291241337400E+06, 0.102205781057829736E+06, 0.102194562190391560E+06, 0.102173148282368042E+06, + 0.102144343637741913E+06, 0.102108830373893230E+06, 0.102068178268037620E+06, 0.102026306869767315E+06, 0.101984352807968040E+06, + 0.101941207962857719E+06, 0.101897306791024865E+06, 0.101851675563811092E+06, 0.101805566459294409E+06, 0.101759497966033654E+06, + 0.101711369603787127E+06, 0.101663340792011426E+06, 0.101619227450208040E+06, 0.101582695699032221E+06, 0.101558695579259147E+06, + 0.101546029798913645E+06, 0.101545588074274448E+06, 0.101567771713567665E+06, 0.101607748589558381E+06, 0.101688531278736336E+06, + 0.101712604992569381E+06, 0.101743096832469848E+06, 0.101760620836449103E+06, 0.101769961191482769E+06, 0.101772822414354494E+06, + 0.101770897529126829E+06, 0.101765958574697099E+06, 0.101759443212774597E+06, 0.101753267088761611E+06, 0.101750523367411457E+06, + 0.101749706624054088E+06, 0.101749678109808025E+06, 0.101749285406108000E+06, 0.101744523322546709E+06, 0.101733022628531995E+06, + 0.101711787295703034E+06, 0.101679008351294804E+06, 0.101639130834085285E+06, 0.101593625025334943E+06, 0.101541393928166348E+06, + 0.101487105460277933E+06, 0.101434417444056598E+06, 0.101385551046964029E+06, 0.101342006161188154E+06, 0.101307140291916905E+06, + 0.101283659047930778E+06, 0.101280818499683781E+06, 0.101302531797972479E+06, 0.101335121595155433E+06, 0.101374651651055479E+06, + 0.101415853089015101E+06, 0.101456337388213346E+06, 0.101495434796083166E+06, 0.101530692665964845E+06, 0.101556780887815577E+06, + 0.101572252524485899E+06, 0.101580348283763422E+06, 0.101581288046389862E+06, 0.101573497525049606E+06, 0.101553231842264839E+06, + 0.101527699101148173E+06, 0.101500366015751919E+06, 0.101475147159402040E+06, 0.101462872833845016E+06, 0.101461553787802579E+06, + 0.101470899121458526E+06, 0.101491574771335596E+06, 0.101526109462851629E+06, 0.101575993595638676E+06, 0.101633539000189689E+06, + 0.101696017474012726E+06, 0.101760468358366721E+06, 0.101823741442191822E+06, 0.101882328042741588E+06, 0.101936367528451112E+06, + 0.101984427337493747E+06, 0.102025414498975340E+06, 0.102058638462272647E+06, 0.102075739484648249E+06, 0.102084208298001584E+06, + 0.102090352048999324E+06, 0.102097473483009948E+06, 0.100548208007167515E+06, 0.100605095427047316E+06, 0.100670706010579946E+06, + 0.100743978438203791E+06, 0.100823629545142438E+06, 0.100908178696427160E+06, 0.100995982580288008E+06, 0.101087314481146692E+06, + 0.101176414116338347E+06, 0.101262458356531424E+06, 0.101344547676157905E+06, 0.101421163164599711E+06, 0.101490796631980134E+06, + 0.101552014265238700E+06, 0.101603518886931997E+06, 0.101644210460807284E+06, 0.101673244462872826E+06, 0.101680735386759538E+06, + 0.101674706326058280E+06, 0.101655388783202914E+06, 0.101624670690422980E+06, 0.101584138623298597E+06, 0.101534372942937815E+06, + 0.101476149074961329E+06, 0.101410568098193849E+06, 0.101343974609530458E+06, 0.101270896963409337E+06, 0.101192137510717424E+06, + 0.101108880683603289E+06, 0.101022724309234283E+06, 0.100935715390839119E+06, 0.100850390680374665E+06, 0.100774745624155403E+06, + 0.100703597598235123E+06, 0.100641200968575649E+06, 0.100589854186508950E+06, 0.100551830710988637E+06, 0.100529267606730675E+06, + 0.100528295556730111E+06, 0.100549682448172025E+06, 0.100589658714417616E+06, 0.100646339245096955E+06, 0.100716647083594595E+06, + 0.100796330849082777E+06, 0.100862509969368170E+06, 0.100921980592583743E+06, 0.100978572070364797E+06, 0.101033342690100937E+06, + 0.101086524659137300E+06, 0.101137201268390738E+06, 0.101183872284207260E+06, 0.101229010938212319E+06, 0.101273109489612165E+06, + 0.101316619892713090E+06, 0.101361395459038307E+06, 0.101412097251747749E+06, 0.101462443230712757E+06, 0.101510984330326377E+06, + 0.101556016862365155E+06, 0.101593723038725308E+06, 0.101622224707454676E+06, 0.101642725690420295E+06, 0.101656123946685548E+06, + 0.101662476115757090E+06, 0.101646779923387396E+06, 0.101626132803217159E+06, 0.101605491482854268E+06, 0.101589147781629013E+06, + 0.101585251139149026E+06, 0.101593208937773641E+06, 0.101612184718608827E+06, 0.101643206312575028E+06, 0.101695818816071987E+06, + 0.101764928221785813E+06, 0.101840193899589591E+06, 0.101916494038259974E+06, 0.101982907500618603E+06, 0.102040970845980133E+06, + 0.102091837845918839E+06, 0.102134078254784647E+06, 0.102164394058369740E+06, 0.102183887971255608E+06, 0.102192909965391460E+06, + 0.102191628213096585E+06, 0.102180725302393228E+06, 0.102161729213580154E+06, 0.102136138522838941E+06, 0.102107142982990175E+06, + 0.102074807010027405E+06, 0.102039103318180598E+06, 0.102000767273371166E+06, 0.101960362993373739E+06, 0.101918302600709168E+06, + 0.101875356744285367E+06, 0.101830760544282428E+06, 0.101787058843222650E+06, 0.101746854946198102E+06, 0.101712081627763269E+06, + 0.101684170852595838E+06, 0.101663959106856215E+06, 0.101652494286064044E+06, 0.101669560085676902E+06, 0.101704444840698343E+06, + 0.101700571875176043E+06, 0.101721535240709272E+06, 0.101745779185469408E+06, 0.101743873285487498E+06, 0.101738112527286779E+06, + 0.101730354652939321E+06, 0.101722249363334777E+06, 0.101714810079808434E+06, 0.101708639567806546E+06, 0.101706113756708350E+06, + 0.101714036658689380E+06, 0.101722369687996295E+06, 0.101728359378835914E+06, 0.101725407412529981E+06, 0.101714092896974922E+06, + 0.101695958827062772E+06, 0.101670373525743838E+06, 0.101635678816692453E+06, 0.101595418488830386E+06, 0.101550830010831283E+06, + 0.101501001127021242E+06, 0.101448446456819016E+06, 0.101396954698346424E+06, 0.101348845039631386E+06, 0.101304062386825870E+06, + 0.101267451987425215E+06, 0.101242193004994537E+06, 0.101233636404356381E+06, 0.101254846780972948E+06, 0.101287816325990920E+06, + 0.101328479900242310E+06, 0.101372263340125617E+06, 0.101414617472293321E+06, 0.101455579958959497E+06, 0.101492853465017077E+06, + 0.101523278594798670E+06, 0.101540885808085994E+06, 0.101551450070809791E+06, 0.101555278183125236E+06, 0.101552538038431827E+06, + 0.101533468414678850E+06, 0.101508500675057512E+06, 0.101482796927905787E+06, 0.101462379842144772E+06, 0.101454892688142470E+06, + 0.101464325466535738E+06, 0.101484135316789325E+06, 0.101513829601535981E+06, 0.101552601163330517E+06, 0.101603687744035284E+06, + 0.101663791684624332E+06, 0.101727767774695865E+06, 0.101792762408730807E+06, 0.101856171640086162E+06, 0.101914393070144404E+06, + 0.101966522189743861E+06, 0.102012469486766611E+06, 0.102051444457628037E+06, 0.102084940153698932E+06, 0.102109046172999864E+06, + 0.102120432478447823E+06, 0.102128404810622902E+06, 0.102134103220031029E+06, 0.100537775584916468E+06, 0.100594064464056602E+06, + 0.100658361556240663E+06, 0.100729672253821584E+06, 0.100806792979668055E+06, 0.100888331818478662E+06, 0.100972640703881028E+06, + 0.101054356923499276E+06, 0.101136218305642746E+06, 0.101218059282136164E+06, 0.101297128938538604E+06, 0.101371075949467442E+06, + 0.101438396724319813E+06, 0.101497631946100053E+06, 0.101547424352719638E+06, 0.101586575081165560E+06, 0.101605344305898223E+06, + 0.101611802560867160E+06, 0.101607062825132700E+06, 0.101591492022024759E+06, 0.101565740711957988E+06, 0.101530433274754861E+06, + 0.101485334233030881E+06, 0.101432291750987933E+06, 0.101377329376169117E+06, 0.101317207789115375E+06, 0.101251671625233779E+06, + 0.101181417558871472E+06, 0.101107498655681804E+06, 0.101031350521440603E+06, 0.100954821051961742E+06, 0.100889588668171375E+06, + 0.100831564213864112E+06, 0.100778330447916189E+06, 0.100731315465427993E+06, 0.100686629349019524E+06, 0.100649847468544394E+06, + 0.100626941602005361E+06, 0.100623247975728824E+06, 0.100634858419738637E+06, 0.100661484011766472E+06, 0.100701891329741135E+06, + 0.100753800334865009E+06, 0.100807541818709986E+06, 0.100848659308669099E+06, 0.100892548219874385E+06, 0.100938268977634565E+06, + 0.100984815257879964E+06, 0.101031244555508310E+06, 0.101077229148432787E+06, 0.101120811543651638E+06, 0.101163080762204729E+06, + 0.101205133328227632E+06, 0.101247555470727515E+06, 0.101295212705033598E+06, 0.101345677435592734E+06, 0.101395414916676789E+06, + 0.101443142113523310E+06, 0.101487391928729412E+06, 0.101523112860496927E+06, 0.101551091220213115E+06, 0.101571202362138647E+06, + 0.101582765233024111E+06, 0.101580576420733298E+06, 0.101559006090641735E+06, 0.101532638260340871E+06, 0.101505636854472148E+06, + 0.101482925905383032E+06, 0.101478221569192814E+06, 0.101483749961331385E+06, 0.101500913638159356E+06, 0.101531272427147036E+06, + 0.101587537367870260E+06, 0.101657752923680528E+06, 0.101735341257440305E+06, 0.101815392189158199E+06, 0.101883415778570139E+06, + 0.101946670918334348E+06, 0.102005217869353437E+06, 0.102057696492837160E+06, 0.102103056512906318E+06, 0.102140317424393026E+06, + 0.102168554530401248E+06, 0.102186118819968382E+06, 0.102192209463688341E+06, 0.102189750578587409E+06, 0.102179864477714669E+06, + 0.102164622014063440E+06, 0.102144222519251431E+06, 0.102119031801210527E+06, 0.102090001778615697E+06, 0.102058500322085427E+06, + 0.102024456224525828E+06, 0.101988984142914618E+06, 0.101952414757101811E+06, 0.101915891308398845E+06, 0.101881589770049075E+06, + 0.101851270386932039E+06, 0.101822396029631869E+06, 0.101797879312661476E+06, 0.101778855518825338E+06, 0.101766764384149530E+06, + 0.101767117846749301E+06, 0.101765125533417420E+06, 0.101764893632733350E+06, 0.101755791518637372E+06, 0.101738415072208983E+06, + 0.101717693412627370E+06, 0.101697849566573597E+06, 0.101679653680022544E+06, 0.101666036116405725E+06, 0.101657802915804903E+06, + 0.101659358381537619E+06, 0.101675042132274451E+06, 0.101690591932105221E+06, 0.101702102691112683E+06, 0.101698890266004499E+06, + 0.101685170063431069E+06, 0.101664399827034271E+06, 0.101636981850683907E+06, 0.101602430202209493E+06, 0.101562887328751778E+06, + 0.101519409569218289E+06, 0.101470958313536248E+06, 0.101419317694792786E+06, 0.101368660117972962E+06, 0.101321145110236859E+06, + 0.101276071087296979E+06, 0.101238240695380387E+06, 0.101211277007847661E+06, 0.101197902530338179E+06, 0.101215581555680212E+06, + 0.101246094621904544E+06, 0.101284825497456564E+06, 0.101328072813235674E+06, 0.101370225701783012E+06, 0.101411514155655474E+06, + 0.101449747457354388E+06, 0.101482930506732373E+06, 0.101505336383574511E+06, 0.101520932260299305E+06, 0.101530875621757339E+06, + 0.101535660531138637E+06, 0.101527586118792417E+06, 0.101509422337400800E+06, 0.101491464951296075E+06, 0.101477501245060659E+06, + 0.101471117495995146E+06, 0.101486007619632292E+06, 0.101510757134502812E+06, 0.101544449952577212E+06, 0.101586055913800505E+06, + 0.101635695535260849E+06, 0.101695729268481853E+06, 0.101758721424995805E+06, 0.101822050355179599E+06, 0.101883639102236455E+06, + 0.101943513401448537E+06, 0.101994845858460889E+06, 0.102039591261445501E+06, 0.102076829661285185E+06, 0.102105964877399136E+06, + 0.102126794141653125E+06, 0.102139212624906431E+06, 0.102146437567661822E+06, 0.102150500772487969E+06, 0.100529766660700814E+06, + 0.100584936771645967E+06, 0.100647449978120101E+06, 0.100716367627817162E+06, 0.100790551176116554E+06, 0.100867761991881081E+06, + 0.100944392016551021E+06, 0.101022283363768598E+06, 0.101100094859150340E+06, 0.101176390860314190E+06, 0.101249683961219664E+06, + 0.101319429056106397E+06, 0.101383533080313195E+06, 0.101439851116198683E+06, 0.101486953091034593E+06, 0.101514035380600777E+06, + 0.101530274350960754E+06, 0.101536503930903316E+06, 0.101532791192708028E+06, 0.101519414459226711E+06, 0.101496896545514726E+06, + 0.101466032997577611E+06, 0.101427914819550628E+06, 0.101386928031759133E+06, 0.101339510051842895E+06, 0.101286534144961479E+06, + 0.101229073267725224E+06, 0.101167697805292846E+06, 0.101103306882333491E+06, 0.101037149535454111E+06, 0.100976699320003900E+06, + 0.100924651148493227E+06, 0.100875357695395811E+06, 0.100829790933326149E+06, 0.100789063316662927E+06, 0.100754382631035871E+06, + 0.100727001544673127E+06, 0.100712812235705482E+06, 0.100707393276471601E+06, 0.100709250582931563E+06, 0.100722573388958059E+06, + 0.100746645734061545E+06, 0.100779895700786001E+06, 0.100804396943602027E+06, 0.100830073367685545E+06, 0.100859556300720957E+06, + 0.100892387870409642E+06, 0.100927975633083144E+06, 0.100965551602012056E+06, 0.101004683619487085E+06, 0.101045330597207460E+06, + 0.101087013008305672E+06, 0.101129446011777312E+06, 0.101173089623770706E+06, 0.101224746709176397E+06, 0.101276086346010212E+06, + 0.101326149198708168E+06, 0.101374129662616979E+06, 0.101418481717269460E+06, 0.101456308681409500E+06, 0.101487100471046055E+06, + 0.101509891159304345E+06, 0.101523887972284254E+06, 0.101519085107067789E+06, 0.101499035636973305E+06, 0.101474107212159681E+06, + 0.101448532598947975E+06, 0.101428087461135481E+06, 0.101420183587270294E+06, 0.101421890388346379E+06, 0.101434924963140438E+06, + 0.101461175739645623E+06, 0.101512942173575240E+06, 0.101576674737662266E+06, 0.101648311032956131E+06, 0.101723489882150840E+06, + 0.101787480132178534E+06, 0.101850028038504926E+06, 0.101910282046108841E+06, 0.101967661149882086E+06, 0.102023524732844948E+06, + 0.102074242265323439E+06, 0.102118210977073832E+06, 0.102152171123111169E+06, 0.102173114540454029E+06, 0.102185669537254769E+06, + 0.102190716001940251E+06, 0.102189608656019511E+06, 0.102183136999173483E+06, 0.102171644521202223E+06, 0.102155743904811548E+06, + 0.102135288964191917E+06, 0.102110694874428111E+06, 0.102083194402445937E+06, 0.102053140888443799E+06, 0.102023029614340878E+06, + 0.101994305634375618E+06, 0.101968130490490352E+06, 0.101944981816832049E+06, 0.101917533305451230E+06, 0.101891792228334729E+06, + 0.101867962161627947E+06, 0.101846942835226117E+06, 0.101828399128989535E+06, 0.101808349218342468E+06, 0.101783185169399527E+06, + 0.101752129728330387E+06, 0.101717730687555537E+06, 0.101682415904166002E+06, 0.101651064189548269E+06, 0.101628214835530569E+06, + 0.101615101470726600E+06, 0.101622078677434256E+06, 0.101640462768905272E+06, 0.101659951220889372E+06, 0.101675418801938606E+06, + 0.101673225878615136E+06, 0.101661928138148622E+06, 0.101642662123728296E+06, 0.101615888022248750E+06, 0.101582080924031965E+06, + 0.101543348953446970E+06, 0.101500631267208417E+06, 0.101452586432289259E+06, 0.101401256146737229E+06, 0.101350655526253569E+06, + 0.101302884790491065E+06, 0.101258041134635379E+06, 0.101219975854280870E+06, 0.101192075948155878E+06, 0.101176911767419486E+06, + 0.101189137340948175E+06, 0.101215695508690798E+06, 0.101250828629981872E+06, 0.101291224981271953E+06, 0.101331080207125036E+06, + 0.101370380504028988E+06, 0.101408081153893057E+06, 0.101442820210735677E+06, 0.101470980944890180E+06, 0.101493569638212546E+06, + 0.101512139169726375E+06, 0.101526611096755121E+06, 0.101532495997983948E+06, 0.101522627542459595E+06, 0.101512420265735462E+06, + 0.101505304745591246E+06, 0.101504334695817597E+06, 0.101519650872094615E+06, 0.101547899391185740E+06, 0.101583965970937570E+06, + 0.101627433236286277E+06, 0.101678082609776582E+06, 0.101737298190423375E+06, 0.101799968663717998E+06, 0.101862212637869627E+06, + 0.101921525254885390E+06, 0.101975615485969174E+06, 0.102022129365600340E+06, 0.102060753757629835E+06, 0.102091435012152549E+06, + 0.102114037703653419E+06, 0.102128864386004381E+06, 0.102136712377933785E+06, 0.102141341896670521E+06, 0.102142376150148193E+06, + 0.100523535976660394E+06, 0.100577052820581303E+06, 0.100637236479140498E+06, 0.100703252727134633E+06, 0.100772552025250538E+06, + 0.100843355148487011E+06, 0.100916200005643404E+06, 0.100989978980367348E+06, 0.101063458978865412E+06, 0.101135313180651341E+06, + 0.101204158192835064E+06, 0.101268596961150513E+06, 0.101327267803054579E+06, 0.101379219393509498E+06, 0.101411658551840825E+06, + 0.101435013304419204E+06, 0.101449723991433348E+06, 0.101455671589434161E+06, 0.101452876078218949E+06, 0.101441532989260799E+06, + 0.101422046210621003E+06, 0.101395056661309005E+06, 0.101365757780455795E+06, 0.101332677387078918E+06, 0.101293673363073496E+06, + 0.101249457127459696E+06, 0.101201011753970408E+06, 0.101149108558075517E+06, 0.101094587629913221E+06, 0.101040779590145175E+06, + 0.100995382496306906E+06, 0.100951579695860622E+06, 0.100909850434587090E+06, 0.100870858422985533E+06, 0.100835419863702089E+06, + 0.100804467614276640E+06, 0.100781685669042199E+06, 0.100767335396187831E+06, 0.100759289879836622E+06, 0.100757866722066232E+06, + 0.100763078005519506E+06, 0.100774506516805646E+06, 0.100786062954307781E+06, 0.100793269206959361E+06, 0.100804822422906916E+06, + 0.100820834091496698E+06, 0.100841255618750598E+06, 0.100865889078778535E+06, 0.100894749198775666E+06, 0.100927416956011424E+06, + 0.100963395796724551E+06, 0.101002315623510774E+06, 0.101043887250100248E+06, 0.101091039191901757E+06, 0.101144066547046401E+06, + 0.101197932497966991E+06, 0.101251195535936524E+06, 0.101302429885710808E+06, 0.101350642114984890E+06, 0.101394018940216731E+06, + 0.101430608604817069E+06, 0.101459057570376521E+06, 0.101478044590623220E+06, 0.101475387865733283E+06, 0.101461856537208994E+06, + 0.101443018892087159E+06, 0.101422586718123261E+06, 0.101406882059484167E+06, 0.101400350668646613E+06, 0.101401136819027641E+06, + 0.101411047287252732E+06, 0.101432998273655045E+06, 0.101475019664207721E+06, 0.101526976345226532E+06, 0.101585936905203198E+06, + 0.101648470322235924E+06, 0.101703644183282871E+06, 0.101759331828263079E+06, 0.101814866055730265E+06, 0.101869901220545507E+06, + 0.101928914084517004E+06, 0.101985712555209233E+06, 0.102038213057230983E+06, 0.102083503006818413E+06, 0.102116318481194263E+06, + 0.102142478770143352E+06, 0.102162510227578357E+06, 0.102176745632176331E+06, 0.102185382260760132E+06, 0.102189351865029588E+06, + 0.102188985060908250E+06, 0.102181978502190381E+06, 0.102166343098074416E+06, 0.102144949217122790E+06, 0.102118539343817305E+06, + 0.102090320241642432E+06, 0.102064949154931208E+06, 0.102041510471142406E+06, 0.102020894051233234E+06, 0.102002076919490239E+06, + 0.101978687982916701E+06, 0.101949947159686926E+06, 0.101920721729201105E+06, 0.101890840787188339E+06, 0.101858502442174227E+06, + 0.101821787050020226E+06, 0.101779170614060145E+06, 0.101731633607835785E+06, 0.101683872606227975E+06, 0.101641706250363815E+06, + 0.101609757163432500E+06, 0.101594408710602715E+06, 0.101599861763739507E+06, 0.101615600568650814E+06, 0.101634792862023707E+06, + 0.101649560822422354E+06, 0.101653324074520948E+06, 0.101647718645786255E+06, 0.101632892509714380E+06, 0.101607498410070068E+06, + 0.101573604987650251E+06, 0.101534332171428061E+06, 0.101490882315485491E+06, 0.101441914985506301E+06, 0.101390598505943577E+06, + 0.101340225499994325E+06, 0.101292893172337470E+06, 0.101249121490931240E+06, 0.101212206615971038E+06, 0.101184803983927792E+06, + 0.101169090523178049E+06, 0.101177216406820677E+06, 0.101199121436619549E+06, 0.101229487274117826E+06, 0.101265433425285810E+06, + 0.101301460838134211E+06, 0.101337546551032807E+06, 0.101373572179327981E+06, 0.101408481747705810E+06, 0.101441269413672373E+06, + 0.101471589979924611E+06, 0.101499094210238720E+06, 0.101523046431578827E+06, 0.101542483002773370E+06, 0.101543831013172356E+06, + 0.101544064378257113E+06, 0.101546276856648081E+06, 0.101553107004487800E+06, 0.101570758226424994E+06, 0.101603899362922981E+06, + 0.101643466171828870E+06, 0.101688020902613556E+06, 0.101736066489577410E+06, 0.101788778651382352E+06, 0.101846229772819366E+06, + 0.101902087545993330E+06, 0.101954243560902876E+06, 0.102000912067655503E+06, 0.102040460468150268E+06, 0.102070397922830496E+06, + 0.102092123176266672E+06, 0.102106027606901625E+06, 0.102112955537274407E+06, 0.102114233430400913E+06, 0.102110160726652859E+06, + 0.102103564706523437E+06, 0.100518689604693471E+06, 0.100570188968489383E+06, 0.100627085580226092E+06, 0.100688425846865008E+06, + 0.100752801664219747E+06, 0.100819711434372482E+06, 0.100888275239485200E+06, 0.100957467842034559E+06, 0.101026141537060103E+06, + 0.101093053338000958E+06, 0.101156896762082222E+06, 0.101216338486683555E+06, 0.101270050228910055E+06, 0.101303959592322863E+06, + 0.101331155104026548E+06, 0.101351367252466414E+06, 0.101364631606699608E+06, 0.101370354947362532E+06, 0.101368511938952593E+06, + 0.101359219879845390E+06, 0.101342770712901329E+06, 0.101323279228074665E+06, 0.101301442257920979E+06, 0.101274216777385765E+06, + 0.101241963101549714E+06, 0.101205245491941663E+06, 0.101164856326946916E+06, 0.101121839477416492E+06, 0.101077512757932636E+06, + 0.101040769978266762E+06, 0.101003816768457153E+06, 0.100967482943484662E+06, 0.100932599047362921E+06, 0.100899538621347674E+06, + 0.100868835073115974E+06, 0.100841822788138859E+06, 0.100822146543393857E+06, 0.100806275342578825E+06, 0.100794425676255967E+06, + 0.100786746583171247E+06, 0.100783223558698664E+06, 0.100783580356914550E+06, 0.100777240593710594E+06, 0.100772797244677698E+06, + 0.100771995893256535E+06, 0.100775628518037935E+06, 0.100784330892865575E+06, 0.100798832415402489E+06, 0.100819830174998613E+06, + 0.100845869940026445E+06, 0.100876821716840641E+06, 0.100912505059014773E+06, 0.100952732377084161E+06, 0.101002888396750073E+06, + 0.101057716858402928E+06, 0.101114463416698447E+06, 0.101171669964558023E+06, 0.101227895955215106E+06, 0.101283382095900626E+06, + 0.101334958226825765E+06, 0.101380444142405948E+06, 0.101418245220739525E+06, 0.101446407440058887E+06, 0.101450870781566424E+06, + 0.101446840525337553E+06, 0.101437171069169228E+06, 0.101424931486162226E+06, 0.101415799787063268E+06, 0.101412071436230064E+06, + 0.101412950725123417E+06, 0.101420014842418866E+06, 0.101435968083775937E+06, 0.101466352271600088E+06, 0.101503661068658505E+06, + 0.101546063702057072E+06, 0.101591631627750539E+06, 0.101633780932880036E+06, 0.101677233535571504E+06, 0.101722001382731454E+06, + 0.101768084603012278E+06, 0.101821697636718192E+06, 0.101876504987276159E+06, 0.101929725277785576E+06, 0.101979436992402916E+06, + 0.102021048948978249E+06, 0.102058738337406423E+06, 0.102093407361196325E+06, 0.102125483850517805E+06, 0.102150396359340550E+06, + 0.102169939569479524E+06, 0.102183985952502859E+06, 0.102191376525420768E+06, 0.102185685603385369E+06, 0.102169450367412603E+06, + 0.102146358644484295E+06, 0.102119842646822071E+06, 0.102094075555721618E+06, 0.102073636097204362E+06, 0.102056299206566269E+06, + 0.102039605800132485E+06, 0.102021374390271580E+06, 0.101998770599080817E+06, 0.101970853166201807E+06, 0.101937971227922506E+06, + 0.101900413338984057E+06, 0.101857321774920129E+06, 0.101808436773914334E+06, 0.101755010517902134E+06, 0.101701108954033160E+06, + 0.101652170013780356E+06, 0.101614009141804403E+06, 0.101594396568573589E+06, 0.101591391668390439E+06, 0.101601222158549106E+06, + 0.101618244864968845E+06, 0.101635666146591233E+06, 0.101645911116270872E+06, 0.101646699642323045E+06, 0.101636431221179548E+06, + 0.101609654908569675E+06, 0.101575048385323738E+06, 0.101534330175456344E+06, 0.101489532139668852E+06, 0.101438185377782967E+06, + 0.101385959560380783E+06, 0.101335194667244825E+06, 0.101287926354806812E+06, 0.101245203663320397E+06, 0.101209646717536321E+06, + 0.101183113534233489E+06, 0.101167399256673903E+06, 0.101173255047212093E+06, 0.101191266867459737E+06, 0.101217555082850216E+06, + 0.101249738922742486E+06, 0.101282540292244405E+06, 0.101316175523455371E+06, 0.101351248733287808E+06, 0.101387035478988051E+06, + 0.101423676548066695E+06, 0.101461316613871037E+06, 0.101497507316982592E+06, 0.101531170814716766E+06, 0.101561263551730270E+06, + 0.101576206116756410E+06, 0.101586714996634080E+06, 0.101597778963160541E+06, 0.101611464789349586E+06, 0.101630169532632644E+06, + 0.101664927306783313E+06, 0.101704113353483583E+06, 0.101746416585083251E+06, 0.101790584390523509E+06, 0.101835630759291264E+06, + 0.101885286326592308E+06, 0.101932452931491775E+06, 0.101975582690834839E+06, 0.102013491689891205E+06, 0.102045391567770363E+06, + 0.102064776694095723E+06, 0.102074647376751818E+06, 0.102077355461506435E+06, 0.102073009372423272E+06, 0.102062037114194260E+06, + 0.102045197475351029E+06, 0.102032862053345467E+06, 0.100516203599419721E+06, 0.100565218916304395E+06, 0.100617260891664730E+06, + 0.100673956912948721E+06, 0.100734470974993252E+06, 0.100796865106346027E+06, 0.100860518975916333E+06, 0.100924514220946570E+06, + 0.100987769915576093E+06, 0.101049106773664753E+06, 0.101107273840837661E+06, 0.101159905161335395E+06, 0.101194545284544540E+06, + 0.101223680392232840E+06, 0.101247089234949191E+06, 0.101264590537126525E+06, 0.101276076890375974E+06, 0.101281552099694847E+06, + 0.101280982310362175E+06, 0.101273943686812767E+06, 0.101262940282394411E+06, 0.101250027136122240E+06, 0.101232503141791327E+06, + 0.101210483653828545E+06, 0.101184228737493526E+06, 0.101154165002910086E+06, 0.101120906752935975E+06, 0.101085276329601198E+06, + 0.101055059197187191E+06, 0.101026747435691374E+06, 0.100998039675420368E+06, 0.100969366867174089E+06, 0.100941239345533730E+06, + 0.100914229378812437E+06, 0.100888324815689179E+06, 0.100866108957016506E+06, 0.100846788167441075E+06, 0.100829635550168416E+06, + 0.100814589974162533E+06, 0.100801624509251793E+06, 0.100790670060632678E+06, 0.100777235449754880E+06, 0.100759761272309115E+06, + 0.100744498201414157E+06, 0.100732510380326974E+06, 0.100724806452672536E+06, 0.100722312648745443E+06, 0.100727124797232929E+06, + 0.100739250727341408E+06, 0.100757924088756554E+06, 0.100783210335334952E+06, 0.100815143464493012E+06, 0.100854893070929611E+06, + 0.100907659832364327E+06, 0.100964923673006793E+06, 0.101024919613124526E+06, 0.101086575092280807E+06, 0.101148693938726588E+06, + 0.101212491181683130E+06, 0.101273236178490639E+06, 0.101328963344270000E+06, 0.101377761563192791E+06, 0.101415272026218052E+06, + 0.101431876200949133E+06, 0.101440210101162083E+06, 0.101442472419936472E+06, 0.101441025799434588E+06, 0.101440273436921474E+06, + 0.101441412028859413E+06, 0.101444242700126299E+06, 0.101450026358596937E+06, 0.101460476599565445E+06, 0.101479171248484825E+06, + 0.101501585380914767E+06, 0.101526832551874162E+06, 0.101554045751632453E+06, 0.101581088175181358E+06, 0.101609436210866566E+06, + 0.101639553558900094E+06, 0.101671699640266219E+06, 0.101712219603055011E+06, 0.101758423241378463E+06, 0.101805738585399682E+06, + 0.101852962314692355E+06, 0.101899310754771403E+06, 0.101946265190960024E+06, 0.101994211955312698E+06, 0.102041986736160048E+06, + 0.102085797585756969E+06, 0.102118247218596109E+06, 0.102143944256965377E+06, 0.102160780837746963E+06, 0.102166943569605079E+06, + 0.102158326056491831E+06, 0.102140886616651740E+06, 0.102119658913957755E+06, 0.102098499930418155E+06, 0.102080904999102844E+06, + 0.102066516422517074E+06, 0.102054504472527260E+06, 0.102039748545332608E+06, 0.102020600907278713E+06, 0.101995196360471018E+06, + 0.101963875490564329E+06, 0.101926792596088359E+06, 0.101883686482137069E+06, 0.101834681537134267E+06, 0.101781342698296125E+06, + 0.101725325815194636E+06, 0.101672635846780700E+06, 0.101631506833831096E+06, 0.101606236395939879E+06, 0.101597475949642787E+06, + 0.101603731801431582E+06, 0.101625616805930535E+06, 0.101646355193644980E+06, 0.101660903200991379E+06, 0.101665697733909154E+06, + 0.101654090491919997E+06, 0.101628201204639379E+06, 0.101592718579965003E+06, 0.101550440364196067E+06, 0.101501865690094695E+06, + 0.101447993110863157E+06, 0.101394085224710812E+06, 0.101342099839650211E+06, 0.101293810362817196E+06, 0.101250946740538144E+06, + 0.101215426073013630E+06, 0.101188872150540003E+06, 0.101172928312290038E+06, 0.101177855232292422E+06, 0.101192799356549629E+06, + 0.101215813274799773E+06, 0.101244944643138500E+06, 0.101275131726042877E+06, 0.101307174081444085E+06, 0.101341749283816956E+06, + 0.101378289914467692E+06, 0.101417332589792815E+06, 0.101459925058367837E+06, 0.101502062670976826E+06, 0.101542401965262659E+06, + 0.101579707707947498E+06, 0.101605443608385016E+06, 0.101624638835457939E+06, 0.101643143897028465E+06, 0.101662631727210814E+06, + 0.101684583160134658E+06, 0.101717073342919160E+06, 0.101753756733753267E+06, 0.101791888041425977E+06, 0.101829704004501327E+06, + 0.101866836453342432E+06, 0.101904943611418348E+06, 0.101941838182645661E+06, 0.101974805182480457E+06, 0.102002312012851093E+06, + 0.102022951004307251E+06, 0.102034588422611414E+06, 0.102035115083442288E+06, 0.102027670824049870E+06, 0.102012988929236992E+06, + 0.101992061827493861E+06, 0.101966142466949459E+06, 0.101941390128694227E+06, 0.100514970796833106E+06, 0.100558835077606142E+06, + 0.100607260398477549E+06, 0.100659655071357542E+06, 0.100715265417817398E+06, 0.100773178786940116E+06, 0.100832331209467477E+06, + 0.100890717506978282E+06, 0.100947860531606886E+06, 0.101002917974898708E+06, 0.101052195859970219E+06, 0.101086008388641625E+06, + 0.101115273930014009E+06, 0.101139857117029198E+06, 0.101159622269959131E+06, 0.101174458955507551E+06, 0.101184310219007501E+06, + 0.101189203551941042E+06, 0.101189284643897758E+06, 0.101186114007991724E+06, 0.101181270068826241E+06, 0.101171908271853448E+06, + 0.101158297091944536E+06, 0.101141013465808763E+06, 0.101120226925708761E+06, 0.101096239397641839E+06, 0.101069503529764173E+06, + 0.101044711943530012E+06, 0.101023498931715556E+06, 0.101001656961748697E+06, 0.100979308414565210E+06, 0.100956646567351941E+06, + 0.100933930245713549E+06, 0.100911474196776457E+06, 0.100891471408871366E+06, 0.100874184642035718E+06, 0.100856582877880370E+06, + 0.100838800023023141E+06, 0.100821055717833835E+06, 0.100804211342234223E+06, 0.100787393558680691E+06, 0.100761008720101294E+06, + 0.100734732500141792E+06, 0.100710174312875781E+06, 0.100688451173672947E+06, 0.100670708926784253E+06, 0.100658093134885828E+06, + 0.100653547542059678E+06, 0.100656000772829168E+06, 0.100665921580032358E+06, 0.100683713857153736E+06, 0.100709718860814537E+06, + 0.100748801228508208E+06, 0.100801823503565058E+06, 0.100861225414351109E+06, 0.100925234962917515E+06, 0.100992162379509042E+06, + 0.101061180367843728E+06, 0.101132825200904612E+06, 0.101202551905614309E+06, 0.101268249128093084E+06, 0.101327796560415067E+06, + 0.101375435871056281E+06, 0.101404641442907785E+06, 0.101425758115715638E+06, 0.101440394650381306E+06, 0.101450217422559756E+06, + 0.101458727822546076E+06, 0.101466619611513932E+06, 0.101473463661342525E+06, 0.101480183000528341E+06, 0.101487645084924108E+06, + 0.101498004691627488E+06, 0.101508871394480026E+06, 0.101520205876727661E+06, 0.101532083912951843E+06, 0.101544647478942308E+06, + 0.101558096380653675E+06, 0.101573050568899664E+06, 0.101590428478391070E+06, 0.101613972514299414E+06, 0.101648920007989669E+06, + 0.101687381188284504E+06, 0.101728410452743919E+06, 0.101771447499673959E+06, 0.101823102602039115E+06, 0.101880173737650490E+06, + 0.101939952057504197E+06, 0.101998671132745076E+06, 0.102047778748635392E+06, 0.102081283700837084E+06, 0.102104626314851310E+06, + 0.102117132803555040E+06, 0.102118423258010647E+06, 0.102110210033883151E+06, 0.102097574911021075E+06, 0.102084451243621195E+06, + 0.102073635202554215E+06, 0.102064362043080371E+06, 0.102055076068754133E+06, 0.102042482878204013E+06, 0.102025288372749041E+06, + 0.102001685111197468E+06, 0.101971967159961292E+06, 0.101935955157193923E+06, 0.101893991729276575E+06, 0.101846831752592378E+06, + 0.101795519670136433E+06, 0.101743547706146055E+06, 0.101695867126943878E+06, 0.101657509946900449E+06, 0.101633507015335563E+06, + 0.101630312812292759E+06, 0.101646392192630388E+06, 0.101668889131485266E+06, 0.101690704618882228E+06, 0.101706951776862203E+06, + 0.101710803657395867E+06, 0.101698215938497582E+06, 0.101672792047461742E+06, 0.101636565396570542E+06, 0.101592796399993240E+06, + 0.101539557371443312E+06, 0.101482505549964961E+06, 0.101424993232468783E+06, 0.101369854642081831E+06, 0.101318588912198626E+06, + 0.101273234899637857E+06, 0.101235886605930398E+06, 0.101207937266056106E+06, 0.101192654572110885E+06, 0.101195023201913122E+06, + 0.101207165308628755E+06, 0.101227217799392965E+06, 0.101253372828479289E+06, 0.101281097568006837E+06, 0.101311856149601605E+06, + 0.101345648585710995E+06, 0.101381904947258168E+06, 0.101421272631944972E+06, 0.101465042995991040E+06, 0.101508835313142772E+06, + 0.101551196503329018E+06, 0.101590747790927970E+06, 0.101621682377021876E+06, 0.101645776231220763E+06, 0.101668026172758953E+06, + 0.101689491310640093E+06, 0.101711039834481373E+06, 0.101739312046503386E+06, 0.101772112447843610E+06, 0.101804858575323728E+06, + 0.101836540790179512E+06, 0.101866167898941654E+06, 0.101895518959796798E+06, 0.101925181845865300E+06, 0.101950074886373186E+06, + 0.101969061543749413E+06, 0.101981139844382837E+06, 0.101985462621642117E+06, 0.101977051366888656E+06, 0.101959701573010476E+06, + 0.101935377351789808E+06, 0.101905526341066099E+06, 0.101871781260336036E+06, 0.101835950124052295E+06, 0.100513581366792612E+06, + 0.100554019513422492E+06, 0.100598330045055409E+06, 0.100645982440550681E+06, 0.100696296648474527E+06, 0.100748444268485124E+06, + 0.100801453596632928E+06, 0.100854218792530621E+06, 0.100905513420273754E+06, 0.100949903492433834E+06, 0.100981652101286920E+06, + 0.101009573882022771E+06, 0.101033642379315977E+06, 0.101053802681678295E+06, 0.101069990410599494E+06, 0.101082152783372076E+06, + 0.101090271780979238E+06, 0.101094389439540580E+06, 0.101095654589873608E+06, 0.101096426446181518E+06, 0.101093666576257223E+06, + 0.101087429979991794E+06, 0.101077885304853742E+06, 0.101065339866105438E+06, 0.101050264366095507E+06, 0.101032061623940666E+06, + 0.101012844290179608E+06, 0.100996964302313558E+06, 0.100980770382518007E+06, 0.100964167390490678E+06, 0.100947108284160218E+06, + 0.100929597010366851E+06, 0.100911688070060860E+06, 0.100893582156858451E+06, 0.100881499094758808E+06, 0.100868335774262508E+06, + 0.100853829088449522E+06, 0.100837798044627038E+06, 0.100820106254778977E+06, 0.100800619132333683E+06, 0.100775042434612522E+06, + 0.100741873481754403E+06, 0.100707732498585203E+06, 0.100674198173852987E+06, 0.100642873485934600E+06, 0.100616787946543613E+06, + 0.100595574493244218E+06, 0.100580853452354946E+06, 0.100573369371954352E+06, 0.100573991194533155E+06, 0.100583507950136642E+06, + 0.100602650207284896E+06, 0.100640744734742359E+06, 0.100692244893923940E+06, 0.100751760770043053E+06, 0.100817532941637197E+06, + 0.100887787830291069E+06, 0.100962050144272376E+06, 0.101039744081827113E+06, 0.101116778936214221E+06, 0.101190892544115282E+06, + 0.101259778024939151E+06, 0.101317175633898092E+06, 0.101357978697233921E+06, 0.101390994520218446E+06, 0.101417406025828648E+06, + 0.101438439369066997E+06, 0.101456877295130529E+06, 0.101473268310223793E+06, 0.101486701484946811E+06, 0.101497860785624449E+06, + 0.101507276039524368E+06, 0.101514237723266677E+06, 0.101518949933443597E+06, 0.101522085026395580E+06, 0.101524243387710812E+06, + 0.101525990459469860E+06, 0.101528194232853784E+06, 0.101531700114421837E+06, 0.101537410817429205E+06, 0.101546492305229593E+06, + 0.101567903398293696E+06, 0.101597046994887613E+06, 0.101630996885802393E+06, 0.101669578744430226E+06, 0.101714590729228381E+06, + 0.101773403370424989E+06, 0.101836874445576148E+06, 0.101900881795697991E+06, 0.101960687121667026E+06, 0.102008686461021774E+06, + 0.102037960319300764E+06, 0.102056196723826288E+06, 0.102065273055902842E+06, 0.102066914347914004E+06, 0.102063547681288721E+06, + 0.102059509493393372E+06, 0.102055314339710254E+06, 0.102050951292832178E+06, 0.102044111461623615E+06, 0.102032193928193665E+06, + 0.102014558041099997E+06, 0.101990243188425869E+06, 0.101960364538554975E+06, 0.101925773749474116E+06, 0.101887402236031689E+06, + 0.101845900309227552E+06, 0.101802685936693102E+06, 0.101760172705529054E+06, 0.101722211673123806E+06, 0.101698120911338105E+06, + 0.101693242621827798E+06, 0.101701200555816351E+06, 0.101719376001235738E+06, 0.101743123574903206E+06, 0.101765016750218143E+06, + 0.101780249253377129E+06, 0.101783141086790420E+06, 0.101773015434274668E+06, 0.101749944711398595E+06, 0.101715364981995837E+06, + 0.101666832632786492E+06, 0.101609705385936162E+06, 0.101549151532732372E+06, 0.101488088183680564E+06, 0.101428826013168145E+06, + 0.101371975824192647E+06, 0.101321130368394268E+06, 0.101278514950626632E+06, 0.101245823084732416E+06, 0.101229713571326531E+06, + 0.101228252523962350E+06, 0.101236240082679593E+06, 0.101252202249213733E+06, 0.101274554004038626E+06, 0.101299571284751277E+06, + 0.101328619250470016E+06, 0.101360846988672172E+06, 0.101395461438518367E+06, 0.101432766703864487E+06, 0.101473307204623023E+06, + 0.101514010222445781E+06, 0.101553562190150420E+06, 0.101590717887284656E+06, 0.101621853851409600E+06, 0.101647543893485548E+06, + 0.101671058814602424E+06, 0.101693056210828203E+06, 0.101714129349830531E+06, 0.101738767714405170E+06, 0.101767638107703999E+06, + 0.101795424880191335E+06, 0.101821375190827370E+06, 0.101844797381800585E+06, 0.101865803928462847E+06, 0.101887241456978605E+06, + 0.101903742329332832E+06, 0.101914505259923375E+06, 0.101918870822307275E+06, 0.101916337996088478E+06, 0.101901784739594950E+06, + 0.101874548045828633E+06, 0.101841292001167923E+06, 0.101803678665118787E+06, 0.101762946401782145E+06, 0.101720412831625683E+06, + 0.100515408142486602E+06, 0.100551771547175376E+06, 0.100591372710722571E+06, 0.100633738189236901E+06, 0.100678255595108407E+06, + 0.100724173138854574E+06, 0.100770602351690526E+06, 0.100816524184232330E+06, 0.100854077383907817E+06, 0.100882309305546267E+06, + 0.100908312612091744E+06, 0.100931760805658370E+06, 0.100951200960303162E+06, 0.100967005250871938E+06, 0.100979637398817140E+06, + 0.100989094128378885E+06, 0.100995390483498064E+06, 0.100999335048962457E+06, 0.101003623776222332E+06, 0.101005037852830981E+06, + 0.101003566011062838E+06, 0.100999260214490059E+06, 0.100992254677997669E+06, 0.100982785569327156E+06, 0.100971211282625562E+06, + 0.100958033151982832E+06, 0.100947713227353204E+06, 0.100936845226361344E+06, 0.100925586455398079E+06, 0.100913386427886144E+06, + 0.100900970885727584E+06, 0.100888200173575184E+06, 0.100874969576689109E+06, 0.100865322504112410E+06, 0.100857431942648880E+06, + 0.100848190571948653E+06, 0.100837041611588123E+06, 0.100823522652975458E+06, 0.100807245058683751E+06, 0.100787869439158167E+06, + 0.100757391684316404E+06, 0.100722719302699363E+06, 0.100685949398277124E+06, 0.100648508643416208E+06, 0.100611886678086536E+06, + 0.100577601709138020E+06, 0.100546746024841152E+06, 0.100520863816718731E+06, 0.100501704292206879E+06, 0.100490795320886566E+06, + 0.100489573337377500E+06, 0.100499397978964334E+06, 0.100534016438231076E+06, 0.100580634795179663E+06, 0.100636771821988543E+06, + 0.100700900349775504E+06, 0.100771475161532377E+06, 0.100847971681032548E+06, 0.100928796704597553E+06, 0.101010401416626322E+06, + 0.101090599925904797E+06, 0.101167170271662733E+06, 0.101233921628300508E+06, 0.101285179817018958E+06, 0.101329796645055787E+06, + 0.101368459516926756E+06, 0.101402063972120028E+06, 0.101431554233350747E+06, 0.101457605089509292E+06, 0.101479887700559731E+06, + 0.101498521383338972E+06, 0.101513550784224833E+06, 0.101523174827992611E+06, 0.101527475564510401E+06, 0.101528428909431837E+06, + 0.101526914423630384E+06, 0.101523962459723334E+06, 0.101520309815973524E+06, 0.101516483972158181E+06, 0.101514002315449485E+06, + 0.101514722417862809E+06, 0.101522283068780089E+06, 0.101544056083037300E+06, 0.101571190634249404E+06, 0.101603956939872005E+06, + 0.101642017592925840E+06, 0.101688020789515867E+06, 0.101748771464749283E+06, 0.101810913304749745E+06, 0.101870419614457860E+06, + 0.101923449267402393E+06, 0.101967012984100948E+06, 0.101994050943781331E+06, 0.102011245751808630E+06, 0.102022174558490107E+06, + 0.102029125315834375E+06, 0.102033037791472336E+06, 0.102034394101747268E+06, 0.102032647951692605E+06, 0.102026060860393205E+06, + 0.102014286206869132E+06, 0.101997287902874697E+06, 0.101973908129249903E+06, 0.101945685744995091E+06, 0.101913755487835835E+06, + 0.101879518050633123E+06, 0.101845462413359521E+06, 0.101814438244852194E+06, 0.101787626131292665E+06, 0.101769079269016060E+06, + 0.101760662506367516E+06, 0.101763690025728793E+06, 0.101778245812273221E+06, 0.101800769364128020E+06, 0.101825464810029356E+06, + 0.101849318133198423E+06, 0.101866690516569448E+06, 0.101874423097137915E+06, 0.101868322033511577E+06, 0.101847631400323429E+06, + 0.101809657617465651E+06, 0.101759023134988529E+06, 0.101701048933469734E+06, 0.101638831844116052E+06, 0.101574555754104877E+06, + 0.101509980617449197E+06, 0.101449449533488441E+06, 0.101394594035173650E+06, 0.101347377713062888E+06, 0.101309681379202666E+06, + 0.101289625678805663E+06, 0.101280310168622382E+06, 0.101280601256181355E+06, 0.101289183040688731E+06, 0.101304405647058535E+06, + 0.101324688438220604E+06, 0.101349563357044477E+06, 0.101377976699525767E+06, 0.101409028339016470E+06, 0.101442179995567261E+06, + 0.101476777887449236E+06, 0.101511738303380160E+06, 0.101546126683052818E+06, 0.101579196765551533E+06, 0.101607991498285395E+06, + 0.101632611269017507E+06, 0.101655502605639515E+06, 0.101677080810846644E+06, 0.101697768628730599E+06, 0.101719316740837268E+06, + 0.101742656846947124E+06, 0.101764837611636452E+06, 0.101785178883928776E+06, 0.101802942432164040E+06, 0.101817351144786313E+06, + 0.101829733328404807E+06, 0.101837655847121932E+06, 0.101840093420000965E+06, 0.101836302876360205E+06, 0.101825658934804160E+06, + 0.101806477102295394E+06, 0.101772591154458947E+06, 0.101732979877375386E+06, 0.101689114392674877E+06, 0.101642472350711148E+06, + 0.101594527408217124E+06, 0.100521483098622790E+06, 0.100553034374379175E+06, 0.100587237837357708E+06, 0.100623674982973011E+06, + 0.100661797732431733E+06, 0.100700926585977664E+06, 0.100740251364819997E+06, 0.100769102422238415E+06, 0.100792034055430398E+06, + 0.100813412935669796E+06, 0.100833061354508041E+06, 0.100850766087262135E+06, 0.100866291971468818E+06, 0.100879397215573350E+06, + 0.100889850447447578E+06, 0.100896874983048474E+06, 0.100901879624732552E+06, 0.100908045012513743E+06, 0.100911845008177756E+06, + 0.100913263133695262E+06, 0.100912309117336132E+06, 0.100909033352763217E+06, 0.100903541829518552E+06, 0.100896011438153932E+06, + 0.100886705535507586E+06, 0.100878478741165993E+06, 0.100870518698868997E+06, 0.100862258577488697E+06, 0.100853850267061993E+06, + 0.100845456536039332E+06, 0.100837262111476593E+06, 0.100829483975533818E+06, 0.100823560640713331E+06, 0.100821677296257287E+06, + 0.100817550375560750E+06, 0.100812145039498006E+06, 0.100804659355862575E+06, 0.100794378660273913E+06, 0.100780665915676014E+06, + 0.100760028631593887E+06, 0.100729776405452620E+06, 0.100695664007384359E+06, 0.100658676701707998E+06, 0.100619966898071216E+06, + 0.100580820672301052E+06, 0.100542567168908456E+06, 0.100504377972890885E+06, 0.100469914337100665E+06, 0.100440979221872039E+06, + 0.100419342752137061E+06, 0.100406745142411062E+06, 0.100406705150974245E+06, 0.100432011566503701E+06, 0.100468676779983842E+06, + 0.100515495509657252E+06, 0.100571181275147042E+06, 0.100634390994595859E+06, 0.100706784795550964E+06, 0.100786680087649889E+06, + 0.100869494529497810E+06, 0.100952905038971541E+06, 0.101034572199124057E+06, 0.101109749894571214E+06, 0.101172314783061069E+06, + 0.101229755518492922E+06, 0.101282350507230105E+06, 0.101330323821815167E+06, 0.101373763209774886E+06, 0.101412160049147336E+06, + 0.101445520624250392E+06, 0.101474055469030995E+06, 0.101497872459806793E+06, 0.101516095634979050E+06, 0.101525003393313920E+06, + 0.101529087732478598E+06, 0.101529555701643461E+06, 0.101527554535439689E+06, 0.101523924716972469E+06, 0.101519184588702949E+06, + 0.101515359052858228E+06, 0.101513419431477203E+06, 0.101515061119696038E+06, 0.101524365504439338E+06, 0.101545492952323460E+06, + 0.101572260216870665E+06, 0.101604062662735640E+06, 0.101640454999672467E+06, 0.101681140705924787E+06, 0.101736471342456469E+06, + 0.101791820815604107E+06, 0.101843025813835338E+06, 0.101888338055426750E+06, 0.101926497388645425E+06, 0.101956523951729410E+06, + 0.101977389503551763E+06, 0.101992863624521677E+06, 0.102004636055621828E+06, 0.102012873990628723E+06, 0.102016923944167502E+06, + 0.102015589894533594E+06, 0.102008242524494635E+06, 0.101994805733422399E+06, 0.101975527326879805E+06, 0.101951699623577006E+06, + 0.101924648595227743E+06, 0.101896134378200717E+06, 0.101868181223228035E+06, 0.101842690796364026E+06, 0.101823518800336897E+06, + 0.101810966006917995E+06, 0.101810361562174381E+06, 0.101819625326231835E+06, 0.101837655873780983E+06, 0.101862056783833701E+06, + 0.101890848697784473E+06, 0.101919025148523811E+06, 0.101942604878219718E+06, 0.101953732079914320E+06, 0.101952348959737385E+06, + 0.101930393928014251E+06, 0.101894531594142769E+06, 0.101847206824460780E+06, 0.101792255748977870E+06, 0.101731720782488774E+06, + 0.101667410578914118E+06, 0.101601955467176056E+06, 0.101538353512944566E+06, 0.101479206063803722E+06, 0.101426875382686587E+06, + 0.101386679687780139E+06, 0.101358881267937715E+06, 0.101340978693972764E+06, 0.101332100373616413E+06, 0.101331377677835859E+06, + 0.101337757250038121E+06, 0.101350176595795769E+06, 0.101367529237839539E+06, 0.101388710034061514E+06, 0.101412656335492444E+06, + 0.101438146564572395E+06, 0.101465030990242507E+06, 0.101492743759273944E+06, 0.101520528048576030E+06, 0.101547656089289187E+06, + 0.101573646733203917E+06, 0.101598176409242311E+06, 0.101621015547307805E+06, 0.101642090999262466E+06, 0.101661344187207244E+06, + 0.101680048117579805E+06, 0.101700060142799775E+06, 0.101717676267340707E+06, 0.101732293239297534E+06, 0.101743299867593101E+06, + 0.101750084174098316E+06, 0.101754164408332057E+06, 0.101753815772929738E+06, 0.101747787368181351E+06, 0.101735699407228763E+06, + 0.101717273900884597E+06, 0.101692348035134710E+06, 0.101654861811602153E+06, 0.101610673295375120E+06, 0.101562751614357956E+06, + 0.101512638519625150E+06, 0.101461813597627668E+06, 0.100533318325900138E+06, 0.100559018706234609E+06, 0.100586667516233734E+06, + 0.100616430509356855E+06, 0.100647457772304173E+06, 0.100679140607943787E+06, 0.100698527261697847E+06, 0.100715798167830915E+06, + 0.100731931694921790E+06, 0.100746896633405166E+06, 0.100760616569955790E+06, 0.100772979417731243E+06, 0.100783848302944942E+06, + 0.100793073809534399E+06, 0.100800507571478287E+06, 0.100806483772806212E+06, 0.100813801762586605E+06, 0.100819127022868051E+06, + 0.100822124828140237E+06, 0.100822902466370797E+06, 0.100821716855826366E+06, 0.100818621189554789E+06, 0.100813702346186765E+06, + 0.100807092657524059E+06, 0.100799795563032545E+06, 0.100792638500522866E+06, 0.100785284309503724E+06, 0.100777874398839282E+06, + 0.100770527259340961E+06, 0.100763347669699418E+06, 0.100756435329570639E+06, 0.100749892793592095E+06, 0.100749373875165576E+06, + 0.100750222933888348E+06, 0.100750603463785985E+06, 0.100749864242144642E+06, 0.100747320689053289E+06, 0.100742256076426071E+06, + 0.100733920852957395E+06, 0.100715113795294979E+06, 0.100689064952966379E+06, 0.100657845711542803E+06, 0.100623250918292935E+06, + 0.100586038000497676E+06, 0.100547134348203457E+06, 0.100506028825088957E+06, 0.100462291432826620E+06, 0.100421048783818245E+06, + 0.100384122683633468E+06, 0.100353368412380165E+06, 0.100330670880394246E+06, 0.100321776442990944E+06, 0.100334624094787185E+06, + 0.100358437666044687E+06, 0.100392488442372807E+06, 0.100435977221972600E+06, 0.100488073955800399E+06, 0.100552415559277870E+06, + 0.100627255810881121E+06, 0.100707092289738357E+06, 0.100789756856378794E+06, 0.100873101113792349E+06, 0.100954216801293107E+06, + 0.101025863759345229E+06, 0.101094584610272868E+06, 0.101160235498342692E+06, 0.101222606811297053E+06, 0.101281370962640489E+06, + 0.101332163642811851E+06, 0.101376972618262807E+06, 0.101416728366496085E+06, 0.101451473910749541E+06, 0.101480959555488313E+06, + 0.101500381551832834E+06, 0.101512210195641775E+06, 0.101519514244373393E+06, 0.101523444803633465E+06, 0.101525155563451161E+06, + 0.101524617344664759E+06, 0.101522395272590235E+06, 0.101521151212846860E+06, 0.101522340865174643E+06, 0.101527072168721963E+06, + 0.101537882062393008E+06, 0.101559080181885220E+06, 0.101584526114373686E+06, 0.101614244538571933E+06, 0.101647894372795839E+06, + 0.101684681982032082E+06, 0.101726895995367770E+06, 0.101774312937747018E+06, 0.101818830342195433E+06, 0.101858335228138851E+06, + 0.101893176738273338E+06, 0.101922949034176403E+06, 0.101947508183230893E+06, 0.101967684274917294E+06, 0.101983202615811271E+06, + 0.101993442131563672E+06, 0.101998812147038072E+06, 0.101998613039324773E+06, 0.101992329378160532E+06, 0.101980249760691964E+06, + 0.101962626054339082E+06, 0.101940465078019130E+06, 0.101915907622174098E+06, 0.101890478407916715E+06, 0.101866977689826570E+06, + 0.101849754719304707E+06, 0.101837665745559920E+06, 0.101833602586389810E+06, 0.101841599729967784E+06, 0.101859775477370218E+06, + 0.101886984424902446E+06, 0.101919867690970117E+06, 0.101951746477934430E+06, 0.101978482983373731E+06, 0.101993393892969194E+06, + 0.101991412250034802E+06, 0.101974123414601141E+06, 0.101945239434022718E+06, 0.101905684392780662E+06, 0.101856949799144815E+06, + 0.101801731134592686E+06, 0.101742504741481811E+06, 0.101681038790539489E+06, 0.101619356067038418E+06, 0.101559380452289755E+06, + 0.101505641285490463E+06, 0.101461701752299428E+06, 0.101426005705293821E+06, 0.101398896334048623E+06, 0.101380282180095601E+06, + 0.101369836995025384E+06, 0.101367277170112575E+06, 0.101370986941406809E+06, 0.101379906423074499E+06, 0.101392831033495459E+06, + 0.101408554312665205E+06, 0.101424869582900283E+06, 0.101443182567207696E+06, 0.101462968409184250E+06, 0.101483671134433898E+06, + 0.101504732894123474E+06, 0.101527421913474638E+06, 0.101550095820920280E+06, 0.101571562110317216E+06, 0.101591355780169426E+06, + 0.101609078015251362E+06, 0.101625097194956237E+06, 0.101640337310256451E+06, 0.101652605117688974E+06, 0.101661397415208048E+06, + 0.101666225004107662E+06, 0.101666619975683658E+06, 0.101662556408727090E+06, 0.101653580628123964E+06, 0.101639218203126409E+06, + 0.101619381357809092E+06, 0.101594063768788052E+06, 0.101563351510846944E+06, 0.101523851133020638E+06, 0.101476807405962056E+06, + 0.101426978369828445E+06, 0.101375797428347505E+06, 0.101324598573980998E+06, 0.100551530203326562E+06, 0.100571727120900570E+06, + 0.100593051779557791E+06, 0.100614868997312486E+06, 0.100634144763448072E+06, 0.100645833089619511E+06, 0.100657235284227281E+06, + 0.100667686387769805E+06, 0.100677292913672762E+06, 0.100686112073701530E+06, 0.100694158258119947E+06, 0.100701410586929007E+06, + 0.100707821531117806E+06, 0.100713326592793543E+06, 0.100718292448464927E+06, 0.100725135313074701E+06, 0.100730736036059810E+06, + 0.100734776949494801E+06, 0.100736983079004160E+06, 0.100737142689159882E+06, 0.100735125062421313E+06, 0.100730895453973062E+06, + 0.100724936089312163E+06, 0.100718101716589372E+06, 0.100710128659467940E+06, 0.100701978143640532E+06, 0.100693854728853868E+06, + 0.100685917546278361E+06, 0.100678288281938949E+06, 0.100671058793584918E+06, 0.100664298277410649E+06, 0.100660712381595760E+06, + 0.100661723426356752E+06, 0.100663150264819735E+06, 0.100664393149270531E+06, 0.100664799968549007E+06, 0.100663672287188572E+06, + 0.100660269896986065E+06, 0.100653054372944243E+06, 0.100638919308817800E+06, 0.100620188598009743E+06, 0.100597036492593310E+06, + 0.100569788712949841E+06, 0.100538901380231502E+06, 0.100504939031211514E+06, 0.100464616545740675E+06, 0.100420082357890147E+06, + 0.100376069547844643E+06, 0.100334560389268605E+06, 0.100297550195584583E+06, 0.100267038173233668E+06, 0.100249183652606138E+06, + 0.100248031291493899E+06, 0.100256756900526307E+06, 0.100275250996069168E+06, 0.100303318888992886E+06, 0.100340733860613560E+06, + 0.100392668457859341E+06, 0.100458197469974984E+06, 0.100530344725997711E+06, 0.100607247564767138E+06, 0.100687079608666914E+06, + 0.100768076831136714E+06, 0.100845286817167653E+06, 0.100921915425536106E+06, 0.100997896081585553E+06, 0.101072548063258917E+06, + 0.101144965887108527E+06, 0.101210711249507964E+06, 0.101267759563819229E+06, 0.101319932991058231E+06, 0.101367121820533270E+06, + 0.101409115377035181E+06, 0.101445063624758288E+06, 0.101467868269852072E+06, 0.101485221941439115E+06, 0.101498187544558168E+06, + 0.101507881316604296E+06, 0.101515310949875333E+06, 0.101519599975213365E+06, 0.101522106701145909E+06, 0.101524851878856789E+06, + 0.101529230085351330E+06, 0.101536191323789782E+06, 0.101546697524065807E+06, 0.101566224388216360E+06, 0.101589918902257763E+06, + 0.101616845515287452E+06, 0.101647215589828833E+06, 0.101680341115790361E+06, 0.101715366089036543E+06, 0.101752316168779886E+06, + 0.101791176678952732E+06, 0.101827052748008107E+06, 0.101859044996505589E+06, 0.101887670526199319E+06, 0.101913122414070647E+06, + 0.101934463666524054E+06, 0.101952632860506710E+06, 0.101966700037415663E+06, 0.101975525710702976E+06, 0.101978461989723088E+06, + 0.101975173899271627E+06, 0.101964823473388897E+06, 0.101947665044748559E+06, 0.101926227690128857E+06, 0.101900561072349257E+06, + 0.101874251008341424E+06, 0.101851830347918643E+06, 0.101836189738381829E+06, 0.101828888260193082E+06, 0.101835000054969831E+06, + 0.101851733006117443E+06, 0.101877232568018531E+06, 0.101909510086827300E+06, 0.101940989073697696E+06, 0.101965528537313672E+06, + 0.101979608526400712E+06, 0.101982970036656799E+06, 0.101975240583827399E+06, 0.101955388827734365E+06, 0.101924654892196661E+06, + 0.101887578699447098E+06, 0.101842186561714494E+06, 0.101789317463778367E+06, 0.101732832688802417E+06, 0.101675288481823532E+06, + 0.101619263688587671E+06, 0.101568048094496247E+06, 0.101521062700628769E+06, 0.101479654154784279E+06, 0.101445221739311222E+06, + 0.101418076416901371E+06, 0.101399045923829544E+06, 0.101387018859001342E+06, 0.101381135963448469E+06, 0.101380650007871780E+06, + 0.101384722424981679E+06, 0.101391720295262028E+06, 0.101400396876228624E+06, 0.101411346068523795E+06, 0.101424155121034681E+06, + 0.101438457710905030E+06, 0.101453929199892154E+06, 0.101472913422971527E+06, 0.101492074099173711E+06, 0.101510560767898467E+06, + 0.101527744434993336E+06, 0.101543054611759319E+06, 0.101555675557276962E+06, 0.101564929191696821E+06, 0.101571016898623420E+06, + 0.101573544015567939E+06, 0.101572121672385867E+06, 0.101566370463087485E+06, 0.101554662308102721E+06, 0.101536629786898047E+06, + 0.101513803810128695E+06, 0.101486361735486105E+06, 0.101454563654390658E+06, 0.101418767627698660E+06, 0.101378013088347099E+06, + 0.101330707820646552E+06, 0.101282264555356756E+06, 0.101234028760920090E+06, 0.101187294700704195E+06, 0.100576965529563255E+06, + 0.100591678218711211E+06, 0.100607008383076420E+06, 0.100616323103987481E+06, 0.100620258552074985E+06, 0.100623651287353903E+06, + 0.100626463751429124E+06, 0.100628648078344573E+06, 0.100631378331016531E+06, 0.100634129163284262E+06, 0.100636562070289394E+06, + 0.100638738873227092E+06, 0.100640693964837556E+06, 0.100643049230926015E+06, 0.100648185229669587E+06, 0.100652678597624064E+06, + 0.100656261255894686E+06, 0.100658660860211399E+06, 0.100659622834889029E+06, 0.100658930196984991E+06, 0.100656421096238220E+06, + 0.100652004015325234E+06, 0.100645400203396595E+06, 0.100634943591599571E+06, 0.100623790772243461E+06, 0.100612166299320219E+06, + 0.100600323220825783E+06, 0.100589367539107639E+06, 0.100580442279124138E+06, 0.100572243324848969E+06, 0.100564857703730217E+06, + 0.100563322531964557E+06, 0.100563065402201857E+06, 0.100563607762748041E+06, 0.100564433779967017E+06, 0.100564965723689515E+06, + 0.100564572517680892E+06, 0.100562577288210698E+06, 0.100558128795487573E+06, 0.100550306656448985E+06, 0.100538784205606309E+06, + 0.100523395229331582E+06, 0.100504107960399502E+06, 0.100481009310527326E+06, 0.100454286649172413E+06, 0.100417998848613410E+06, + 0.100377654481256992E+06, 0.100336323265197076E+06, 0.100295695643989733E+06, 0.100257502669341542E+06, 0.100223497751048752E+06, + 0.100198365893325012E+06, 0.100183895883056030E+06, 0.100176748173119719E+06, 0.100177409781642637E+06, 0.100186348863375271E+06, + 0.100204071706916817E+06, 0.100236974921233719E+06, 0.100288202283773542E+06, 0.100347584962604393E+06, 0.100413567810885099E+06, + 0.100484685800612540E+06, 0.100559609376774941E+06, 0.100637786676389092E+06, 0.100719143709254829E+06, 0.100802573207076450E+06, + 0.100886953694736978E+06, 0.100970981281993736E+06, 0.101053137277853224E+06, 0.101122114850514685E+06, 0.101186021991939982E+06, + 0.101244880734986247E+06, 0.101298842483030225E+06, 0.101347976726965513E+06, 0.101388865316328054E+06, 0.101417494561782441E+06, + 0.101441011237599363E+06, 0.101460308434203442E+06, 0.101476142058636950E+06, 0.101489111828680267E+06, 0.101498177707129027E+06, + 0.101504275218907074E+06, 0.101509888353816961E+06, 0.101516205429889771E+06, 0.101524373025953057E+06, 0.101535544403108914E+06, + 0.101550771587497264E+06, 0.101572228401773711E+06, 0.101596922610232752E+06, 0.101624267341491490E+06, 0.101653892197854148E+06, + 0.101685371964174541E+06, 0.101717744368668005E+06, 0.101749825128001146E+06, 0.101781782699506482E+06, 0.101812709382600748E+06, + 0.101841353313321029E+06, 0.101867900490832937E+06, 0.101893188014203624E+06, 0.101915193984979924E+06, 0.101933169418903170E+06, + 0.101945970442238802E+06, 0.101952233644425200E+06, 0.101949989638197949E+06, 0.101938812116678397E+06, 0.101921309771955755E+06, + 0.101897306204910492E+06, 0.101870511994013577E+06, 0.101845727987357284E+06, 0.101827162893394896E+06, 0.101815741469126820E+06, + 0.101815347936997394E+06, 0.101829035456973521E+06, 0.101849227052658054E+06, 0.101873947210599901E+06, 0.101900166979187969E+06, + 0.101922501433547208E+06, 0.101938537730062933E+06, 0.101945622505927895E+06, 0.101943220759731354E+06, 0.101933233593028053E+06, + 0.101913480508279812E+06, 0.101884226864883196E+06, 0.101847880125950556E+06, 0.101805028700279145E+06, 0.101757073613196655E+06, + 0.101706590973509752E+06, 0.101656335498895467E+06, 0.101607292592687139E+06, 0.101560626743744360E+06, 0.101517500638364392E+06, + 0.101478925847553910E+06, 0.101446343700160927E+06, 0.101419879250754559E+06, 0.101398958955256283E+06, 0.101383710029623602E+06, + 0.101374588904196891E+06, 0.101370168865842439E+06, 0.101369105684779628E+06, 0.101370929669406774E+06, 0.101375271898136503E+06, + 0.101381760968333765E+06, 0.101390061699633865E+06, 0.101400585700279218E+06, 0.101414338736935577E+06, 0.101428328122293344E+06, + 0.101441772517097343E+06, 0.101453941211612226E+06, 0.101464150240094372E+06, 0.101470694861331591E+06, 0.101472993001670693E+06, + 0.101472098749250043E+06, 0.101467692245319617E+06, 0.101459459863983502E+06, 0.101447099986294808E+06, 0.101428337148487699E+06, + 0.101402273058774066E+06, 0.101372210423711062E+06, 0.101338601145403256E+06, 0.101301942982120236E+06, 0.101262793506100817E+06, + 0.101221677786233748E+06, 0.101176731503889008E+06, 0.101131973913656722E+06, 0.101088479543089110E+06, 0.101047269615024925E+06, + 0.100610222449967056E+06, 0.100619368346169198E+06, 0.100619051340248508E+06, 0.100617580194349401E+06, 0.100615500249746110E+06, + 0.100612844510783863E+06, 0.100609637715591729E+06, 0.100605899629696811E+06, 0.100601648181252385E+06, 0.100596902436962919E+06, + 0.100591685422206356E+06, 0.100587098052459361E+06, 0.100585436102778738E+06, 0.100587603438895458E+06, 0.100589520780671664E+06, + 0.100591027689952418E+06, 0.100591916118502122E+06, 0.100591952568608729E+06, 0.100590898493088505E+06, 0.100588528847269830E+06, + 0.100584648718839380E+06, 0.100579107975368854E+06, 0.100568181408087505E+06, 0.100556028233350124E+06, 0.100543329111321902E+06, + 0.100530292741429832E+06, 0.100517138305172819E+06, 0.100504104046550317E+06, 0.100491454262540399E+06, 0.100479484740824249E+06, + 0.100470155044772182E+06, 0.100463687256117119E+06, 0.100458896797118272E+06, 0.100455620879032227E+06, 0.100454260984570079E+06, + 0.100454114005490293E+06, 0.100453954401208190E+06, 0.100453246548017763E+06, 0.100453544534649671E+06, 0.100451784335522374E+06, + 0.100447402272511725E+06, 0.100439945313556469E+06, 0.100429058870933281E+06, 0.100414474145118424E+06, 0.100395971880822995E+06, + 0.100364627363950829E+06, 0.100330069619100730E+06, 0.100293517928604648E+06, 0.100256250274621154E+06, 0.100219578502905337E+06, + 0.100184821369736295E+06, 0.100153602788173128E+06, 0.100126759271301082E+06, 0.100104736505522000E+06, 0.100088530813236051E+06, + 0.100079174170628597E+06, 0.100077782208942881E+06, 0.100089384583247156E+06, 0.100124675759422840E+06, 0.100169171328412835E+06, + 0.100221720050477204E+06, 0.100281293603445694E+06, 0.100347032197583365E+06, 0.100419381954596480E+06, 0.100501100689285435E+06, + 0.100587123759395632E+06, 0.100676265830202465E+06, 0.100767041531711700E+06, 0.100857717751965523E+06, 0.100942425402787208E+06, + 0.101015252626361835E+06, 0.101084506455799405E+06, 0.101149930187516162E+06, 0.101211031351648766E+06, 0.101267093811678642E+06, + 0.101313485842090842E+06, 0.101347864445685816E+06, 0.101377348186801406E+06, 0.101401563075397265E+06, 0.101421152746379506E+06, + 0.101436703379514453E+06, 0.101448418323353719E+06, 0.101455739244278491E+06, 0.101461288984514365E+06, 0.101466634842994637E+06, + 0.101474204912937290E+06, 0.101485236375258624E+06, 0.101500599693197641E+06, 0.101519974341673922E+06, 0.101542425947491516E+06, + 0.101567705013514729E+06, 0.101595287754062447E+06, 0.101623559085342917E+06, 0.101653300863473152E+06, 0.101684268370484802E+06, + 0.101715396578327011E+06, 0.101746648790418796E+06, 0.101778157009654227E+06, 0.101810294427225992E+06, 0.101840186138904261E+06, + 0.101866664724512098E+06, 0.101888829801923304E+06, 0.101904365840783910E+06, 0.101910875981687976E+06, 0.101907623411986046E+06, + 0.101897747215346535E+06, 0.101880196785050444E+06, 0.101858268156208374E+06, 0.101836776997478300E+06, 0.101819952813389187E+06, + 0.101808320250000223E+06, 0.101803197426602317E+06, 0.101808609816872282E+06, 0.101820932164050100E+06, 0.101835981686293468E+06, + 0.101853975694054869E+06, 0.101871402202830723E+06, 0.101884750589340591E+06, 0.101893763845945417E+06, 0.101896316342375110E+06, + 0.101891679490974697E+06, 0.101879011465031377E+06, 0.101858040507289596E+06, 0.101829415896828315E+06, 0.101794099063775866E+06, + 0.101754870334758903E+06, 0.101712830221134776E+06, 0.101668524343052632E+06, 0.101623305627111258E+06, 0.101578731565899987E+06, + 0.101536822594720084E+06, 0.101498255706646247E+06, 0.101464056159653454E+06, 0.101434228357694403E+06, 0.101408947230003760E+06, + 0.101388258426133107E+06, 0.101372054750796451E+06, 0.101360489212098575E+06, 0.101352621134682369E+06, 0.101347535522944934E+06, + 0.101344862604306050E+06, 0.101344225484927229E+06, 0.101345820651379589E+06, 0.101351700849621455E+06, 0.101359530806993411E+06, + 0.101367464680662029E+06, 0.101374791985950258E+06, 0.101380818284913359E+06, 0.101384869714943547E+06, 0.101384236152984289E+06, + 0.101379411934677875E+06, 0.101371434785651902E+06, 0.101360085004396402E+06, 0.101345137105284986E+06, 0.101326366500254488E+06, + 0.101300808610161446E+06, 0.101267227431123814E+06, 0.101230448890002648E+06, 0.101191134568648122E+06, 0.101149957676138991E+06, + 0.101107616865909265E+06, 0.101064847159165423E+06, 0.101022580301005539E+06, 0.100981724783641272E+06, 0.100943032631428388E+06, + 0.100907229742725089E+06, 0.100647986354424997E+06, 0.100642715659511494E+06, 0.100636609969385099E+06, 0.100629766959429631E+06, + 0.100622273153360293E+06, 0.100614207409999959E+06, 0.100605644320867577E+06, 0.100596657511128040E+06, 0.100587322839384142E+06, + 0.100577721494929676E+06, 0.100567942994422949E+06, 0.100559032457675799E+06, 0.100552977775159990E+06, 0.100548029023239913E+06, + 0.100543925649759869E+06, 0.100540775676255420E+06, 0.100537926202230563E+06, 0.100534526225857189E+06, 0.100530349204130558E+06, + 0.100525160024924175E+06, 0.100518730289664294E+06, 0.100507262057308282E+06, 0.100493351445575739E+06, 0.100478812420309798E+06, + 0.100463863563753723E+06, 0.100448706735957079E+06, 0.100433537133342616E+06, 0.100418551953121700E+06, 0.100403957667064577E+06, + 0.100390113818734360E+06, 0.100378283224859435E+06, 0.100368019408275955E+06, 0.100359348113145898E+06, 0.100352231413445901E+06, + 0.100346572462762793E+06, 0.100342221388570266E+06, 0.100338982151060118E+06, 0.100338392782828159E+06, 0.100341188152017450E+06, + 0.100343374795880460E+06, 0.100344284175602748E+06, 0.100343279804720136E+06, 0.100339754195549598E+06, 0.100333123950383713E+06, + 0.100321286971674039E+06, 0.100297287465905509E+06, 0.100269835508128133E+06, 0.100239714419667638E+06, 0.100207741409672206E+06, + 0.100174751447097195E+06, 0.100141579771693956E+06, 0.100106755441371904E+06, 0.100069912900784475E+06, 0.100035704844720982E+06, + 0.100005528642180579E+06, 0.999808555037528422E+05, 0.999632723451110069E+05, 0.999545236439836153E+05, 0.999736658577992639E+05, + 0.100003353333015431E+06, 0.100042064117430200E+06, 0.100089071041598727E+06, 0.100143778848621456E+06, 0.100205754250853075E+06, + 0.100280664932831889E+06, 0.100364704219084786E+06, 0.100454126970714191E+06, 0.100547163719590288E+06, 0.100641885410501171E+06, + 0.100736224731986324E+06, 0.100821668363604142E+06, 0.100899090295081827E+06, 0.100973330050358534E+06, 0.101044570047650093E+06, + 0.101111101684352281E+06, 0.101171922832138123E+06, 0.101223284014747289E+06, 0.101260000146915598E+06, 0.101290169362142216E+06, + 0.101314373328620830E+06, 0.101333177003506280E+06, 0.101345070024148474E+06, 0.101353392220116293E+06, 0.101359052838648713E+06, + 0.101363820978951000E+06, 0.101369812488926094E+06, 0.101377607762478350E+06, 0.101388432240829963E+06, 0.101403721097234418E+06, + 0.101423686495689355E+06, 0.101447911692908267E+06, 0.101474956233570803E+06, 0.101501708578459278E+06, 0.101530416403443902E+06, + 0.101560731988182699E+06, 0.101592331907465996E+06, 0.101625384375889567E+06, 0.101660463766652349E+06, 0.101696287937694025E+06, + 0.101731505165402195E+06, 0.101765373671168942E+06, 0.101795889760683582E+06, 0.101821575901139222E+06, 0.101839426770240534E+06, + 0.101848304582011391E+06, 0.101850674932157766E+06, 0.101845563338820590E+06, 0.101833662450669886E+06, 0.101819729736987734E+06, + 0.101806525676924168E+06, 0.101796235624030873E+06, 0.101788878921415002E+06, 0.101786474628160606E+06, 0.101791411418041462E+06, + 0.101799155363379643E+06, 0.101808395203049906E+06, 0.101819645577764153E+06, 0.101830409662230682E+06, 0.101837554446248556E+06, + 0.101839744105951162E+06, 0.101836170755967585E+06, 0.101826399135349377E+06, 0.101810169058729633E+06, 0.101787697095879019E+06, + 0.101760376393189144E+06, 0.101728853043894385E+06, 0.101693851935638726E+06, 0.101656211520082943E+06, 0.101616790158213262E+06, + 0.101576704560053928E+06, 0.101537500986694940E+06, 0.101500335696260430E+06, 0.101465878362827381E+06, 0.101434840756723977E+06, + 0.101408292472182264E+06, 0.101385653681886775E+06, 0.101367773762272278E+06, 0.101355060936308873E+06, 0.101344865614149967E+06, + 0.101336866601978196E+06, 0.101330803221953858E+06, 0.101326445157375012E+06, 0.101323705025865274E+06, 0.101323151766299212E+06, + 0.101323317919074820E+06, 0.101323609309034800E+06, 0.101323383998279736E+06, 0.101321968519799790E+06, 0.101318674829698095E+06, + 0.101309557473271183E+06, 0.101297255318789845E+06, 0.101282004506700381E+06, 0.101263593826286131E+06, 0.101241822534985287E+06, + 0.101216505434514431E+06, 0.101183763113335532E+06, 0.101143062284304673E+06, 0.101099958082106066E+06, 0.101055260378077917E+06, + 0.101009770107324861E+06, 0.100964289722992879E+06, 0.100919631222605836E+06, 0.100878395229792455E+06, 0.100840230418695966E+06, + 0.100804814065610379E+06, 0.100772660269162792E+06, 0.100687581879727732E+06, 0.100677327145079587E+06, 0.100666160693170401E+06, + 0.100654207341057889E+06, 0.100641583937123549E+06, 0.100628402623918475E+06, 0.100614774045043421E+06, 0.100600810488184259E+06, + 0.100586628958508634E+06, 0.100572354178803900E+06, 0.100558377265734845E+06, 0.100545518784321612E+06, 0.100533722529582723E+06, + 0.100522910171807918E+06, 0.100512931196078469E+06, 0.100503576020145658E+06, 0.100494590303307457E+06, 0.100485690264560879E+06, + 0.100476578798775605E+06, 0.100466962148914608E+06, 0.100453831814755409E+06, 0.100437250927331042E+06, 0.100419883924672962E+06, + 0.100402010894887906E+06, 0.100383869790613491E+06, 0.100365667294769126E+06, 0.100347588515499185E+06, 0.100329805497802925E+06, + 0.100312484547517117E+06, 0.100295677938969020E+06, 0.100279971482571520E+06, 0.100265646792895117E+06, 0.100252835911466231E+06, + 0.100241624480511469E+06, 0.100232054881627162E+06, 0.100224130808306480E+06, 0.100217823206996967E+06, 0.100218259667894425E+06, + 0.100221888558547784E+06, 0.100225662634090608E+06, 0.100228894178654795E+06, 0.100230909476646018E+06, 0.100231046622607246E+06, + 0.100228652435841679E+06, 0.100220736457496634E+06, 0.100203006988572233E+06, 0.100182026084597936E+06, 0.100158298000477531E+06, + 0.100132350369893451E+06, 0.100104715520267695E+06, 0.100075909358704739E+06, 0.100043124770855982E+06, 0.100002028989072438E+06, + 0.999616642547620577E+05, 0.999236877809293510E+05, 0.998898266920593742E+05, 0.998618945050216280E+05, 0.998418030619178171E+05, + 0.998423833568641858E+05, 0.998594396345241257E+05, 0.998857662121956964E+05, 0.999209046169008070E+05, 0.999644862724064005E+05, + 0.100016242187354641E+06, 0.100077317810256820E+06, 0.100156061627195784E+06, 0.100241897409154641E+06, 0.100332874470688155E+06, + 0.100428637026128985E+06, 0.100526117084385623E+06, 0.100622332108951261E+06, 0.100709061724389190E+06, 0.100788527255290071E+06, + 0.100863969991383987E+06, 0.100934619610214693E+06, 0.100999507530848088E+06, 0.101057589879684849E+06, 0.101107912118639942E+06, + 0.101140898046464674E+06, 0.101165194334426677E+06, 0.101183324487668549E+06, 0.101196455912974372E+06, 0.101205787756098696E+06, + 0.101212555660780359E+06, 0.101217307428240179E+06, 0.101221221076374510E+06, 0.101226815969850082E+06, 0.101235775469520071E+06, + 0.101249089517923203E+06, 0.101267499119154090E+06, 0.101290114155802439E+06, 0.101316108973235343E+06, 0.101344864351232871E+06, + 0.101376027068939133E+06, 0.101409318557868275E+06, 0.101444185441017980E+06, 0.101479505555003896E+06, 0.101516882009007721E+06, + 0.101555258888103534E+06, 0.101593997928136538E+06, 0.101632899844262269E+06, 0.101670115604274892E+06, 0.101703897209036979E+06, + 0.101731821696663668E+06, 0.101752696747597220E+06, 0.101767805557897402E+06, 0.101776451771069726E+06, 0.101776669469582252E+06, + 0.101773409436917937E+06, 0.101768516316242836E+06, 0.101762622025664066E+06, 0.101757375988241824E+06, 0.101753826825127559E+06, + 0.101753403149395934E+06, 0.101756975828023817E+06, 0.101760728893977721E+06, 0.101764213695991348E+06, 0.101767251659026326E+06, + 0.101770663081707637E+06, 0.101770424123169345E+06, 0.101766072271416459E+06, 0.101755995409002455E+06, 0.101740345666592038E+06, + 0.101721298174118318E+06, 0.101699043646416510E+06, 0.101673714396835901E+06, 0.101645709970302123E+06, 0.101615709217670097E+06, + 0.101584438818864903E+06, 0.101549071157331651E+06, 0.101514367930820241E+06, 0.101481015481659371E+06, 0.101449616141240651E+06, + 0.101420749509000205E+06, 0.101394921878986992E+06, 0.101373676775729036E+06, 0.101359486676981818E+06, 0.101347304837422518E+06, + 0.101336841360518913E+06, 0.101328023341265842E+06, 0.101320386045212057E+06, 0.101313764510643596E+06, 0.101308434768293082E+06, + 0.101303621069785135E+06, 0.101298777855350723E+06, 0.101293531204510582E+06, 0.101287470834921696E+06, 0.101280152845400124E+06, + 0.101270201669037211E+06, 0.101254701725787949E+06, 0.101236553755882080E+06, 0.101215630660361639E+06, 0.101191802985207483E+06, + 0.101164939977834394E+06, 0.101134911067020425E+06, 0.101095221983884170E+06, 0.101047509096163092E+06, 0.100998010357585692E+06, + 0.100947641730482603E+06, 0.100897282218335793E+06, 0.100847785377602457E+06, 0.100799988650482410E+06, 0.100756067172860465E+06, + 0.100716404949108095E+06, 0.100680394601797932E+06, 0.100648426393021538E+06, 0.100745881471474568E+06, 0.100728142553068014E+06, + 0.100709625290291020E+06, 0.100690810595279676E+06, 0.100673015913888710E+06, 0.100654662696282932E+06, 0.100635883098483231E+06, + 0.100616812156066226E+06, 0.100597590570947941E+06, 0.100577923093225269E+06, 0.100558481382763435E+06, 0.100539763749561054E+06, + 0.100521848971490384E+06, 0.100504736841997088E+06, 0.100488356281683067E+06, 0.100472574428834167E+06, 0.100457206575664590E+06, + 0.100442026795809623E+06, 0.100426779086875598E+06, 0.100408173847290411E+06, 0.100384737995668649E+06, 0.100361938241868149E+06, + 0.100339809752568588E+06, 0.100318341944825661E+06, 0.100297490120403570E+06, 0.100277187624826533E+06, 0.100256847285368276E+06, + 0.100235365725066120E+06, 0.100214436988323068E+06, 0.100194015395758135E+06, 0.100174603679756343E+06, 0.100156451770575964E+06, + 0.100139783864459299E+06, 0.100124799136242582E+06, 0.100111674036540222E+06, 0.100100566149749706E+06, 0.100091646133474802E+06, + 0.100094268080595342E+06, 0.100098360646490051E+06, 0.100103245417476035E+06, 0.100108251398645036E+06, 0.100112713737688697E+06, + 0.100115972074298101E+06, 0.100117368468727698E+06, 0.100113713047268437E+06, 0.100102264314479005E+06, 0.100088001440509222E+06, + 0.100071163974188516E+06, 0.100051996036882978E+06, 0.100030726477270320E+06, 0.100007546295320470E+06, 0.999807647979038738E+05, + 0.999391989552558807E+05, 0.998969708781520749E+05, 0.998557810370234511E+05, 0.998173700956349639E+05, 0.997835138413437380E+05, + 0.997560107381300622E+05, 0.997399269866001996E+05, 0.997470920864752261E+05, 0.997634292598558095E+05, 0.997888964555621351E+05, + 0.998253139512354246E+05, 0.998703081483062851E+05, 0.999237330223304161E+05, 0.999900673422841937E+05, 0.100071098592214898E+06, + 0.100157786095159157E+06, 0.100248141148947368E+06, 0.100340095617225234E+06, 0.100431568456538211E+06, 0.100520552982271765E+06, + 0.100601957172444119E+06, 0.100676277857242458E+06, 0.100746000837763233E+06, 0.100808736668317229E+06, 0.100864485886548777E+06, + 0.100912656357667453E+06, 0.100952804425252194E+06, 0.100983458937089512E+06, 0.101002905816960556E+06, 0.101017076739301760E+06, + 0.101025919304932366E+06, 0.101031319629252597E+06, 0.101035629307633033E+06, 0.101040244934609727E+06, 0.101046393155694794E+06, + 0.101055516125687020E+06, 0.101070906234944094E+06, 0.101089614225348079E+06, 0.101111577432790844E+06, 0.101136727145279292E+06, + 0.101164845396941935E+06, 0.101195505773623969E+06, 0.101228307857940395E+06, 0.101262885478130513E+06, 0.101298695011647855E+06, + 0.101336323186784808E+06, 0.101375617863355365E+06, 0.101416132308550543E+06, 0.101458486694783467E+06, 0.101500186893265898E+06, + 0.101539835500673144E+06, 0.101576113752189529E+06, 0.101608148989054069E+06, 0.101635731083729115E+06, 0.101658502412969741E+06, + 0.101672883340000117E+06, 0.101682956248776158E+06, 0.101690136156231834E+06, 0.101694729692935623E+06, 0.101695555850151519E+06, + 0.101694985210699713E+06, 0.101693812129123311E+06, 0.101693039728607808E+06, 0.101693715283905956E+06, 0.101692868849250488E+06, + 0.101690508890417783E+06, 0.101685212790082718E+06, 0.101676311144040446E+06, 0.101666676329463662E+06, 0.101655232931092047E+06, + 0.101641717109236590E+06, 0.101625993005500495E+06, 0.101608164735537764E+06, 0.101588188219044227E+06, 0.101565919017002117E+06, + 0.101541334705616158E+06, 0.101515224870468810E+06, 0.101488328834034881E+06, 0.101461275807381404E+06, 0.101434883687913665E+06, + 0.101409484965064941E+06, 0.101385820779280519E+06, 0.101366650582102375E+06, 0.101354446840173172E+06, 0.101343919272935833E+06, + 0.101334580534699839E+06, 0.101326051033725802E+06, 0.101318025772555571E+06, 0.101310244905231491E+06, 0.101303240884958926E+06, + 0.101296508440228543E+06, 0.101288703571071324E+06, 0.101279586340018883E+06, 0.101269869694777401E+06, 0.101258981910571456E+06, + 0.101246361574452327E+06, 0.101230052909366845E+06, 0.101210205538298207E+06, 0.101187520180750522E+06, 0.101161911206820834E+06, + 0.101133290201435040E+06, 0.101101563145659631E+06, 0.101066628653128937E+06, 0.101019252959455625E+06, 0.100965746706630394E+06, + 0.100910740992734136E+06, 0.100855238817428384E+06, 0.100800186778776610E+06, 0.100746485895287333E+06, 0.100695000750680716E+06, + 0.100647864656014091E+06, 0.100605793755290593E+06, 0.100567897173808713E+06, 0.100534547818198989E+06, 0.100814127595255733E+06, + 0.100792022069682134E+06, 0.100768906676945466E+06, 0.100744859019167008E+06, 0.100719947172904969E+06, 0.100694229203288138E+06, + 0.100667752842392147E+06, 0.100641747076966523E+06, 0.100616187623394333E+06, 0.100590421603492592E+06, 0.100564843816162116E+06, + 0.100539661442132914E+06, 0.100515003622905657E+06, 0.100490925990557327E+06, 0.100467416019604236E+06, 0.100444399107853926E+06, + 0.100421745278230635E+06, 0.100399276378565366E+06, 0.100374479059296529E+06, 0.100342341387721070E+06, 0.100310819294281551E+06, + 0.100280122297496389E+06, 0.100250406051737154E+06, 0.100221779328347242E+06, 0.100194311780137796E+06, 0.100168042299398876E+06, + 0.100142987772136228E+06, 0.100119152028053810E+06, 0.100096071569344102E+06, 0.100074127372371906E+06, 0.100053458844250679E+06, + 0.100034145590099070E+06, 0.100016303683140140E+06, 0.100000086204841966E+06, 0.999856841527353536E+05, 0.999733278135488799E+05, + 0.999663531822283549E+05, 0.999693777575280983E+05, 0.999741959503276157E+05, 0.999802590538802469E+05, 0.999870378916889313E+05, + 0.999938949144795042E+05, 0.100000191518739506E+06, 0.100005286991947069E+06, 0.100006317487418550E+06, 0.100001195017387858E+06, + 0.999937624881289375E+05, 0.999840228227615153E+05, 0.999719630030743720E+05, 0.999577541117163637E+05, 0.999414190489595931E+05, + 0.999227353126357775E+05, 0.998873066933161899E+05, 0.998482442672230973E+05, 0.998092392179712187E+05, 0.997720171343442780E+05, + 0.997383602763239178E+05, 0.997100954593149654E+05, 0.996890738866330212E+05, 0.996865348971301573E+05, 0.996979284283922898E+05, + 0.997178025858917244E+05, 0.997459381653020537E+05, 0.997821174181933602E+05, 0.998261113921440992E+05, 0.998776597193271737E+05, + 0.999420283421857603E+05, 0.100017917957394646E+06, 0.100097878242084247E+06, 0.100179897231054711E+06, 0.100262024118021669E+06, + 0.100342632647495484E+06, 0.100419763744213284E+06, 0.100491241165072570E+06, 0.100554990596539108E+06, 0.100613108372608185E+06, + 0.100664964935558615E+06, 0.100710050488669251E+06, 0.100748062257432917E+06, 0.100778981129089982E+06, 0.100801136588479072E+06, + 0.100816775933362136E+06, 0.100825979191023362E+06, 0.100833035761093313E+06, 0.100839384072879693E+06, 0.100846373089390050E+06, + 0.100857951736503237E+06, 0.100872302980121356E+06, 0.100888680627202251E+06, 0.100907092306334001E+06, 0.100927501559027049E+06, + 0.100950662310288419E+06, 0.100977294658870305E+06, 0.101006277386327682E+06, 0.101036971461367139E+06, 0.101068254496147259E+06, + 0.101099848827670517E+06, 0.101133511540723193E+06, 0.101169399010245761E+06, 0.101207870174907031E+06, 0.101248846664781042E+06, + 0.101290872607848010E+06, 0.101333141189654139E+06, 0.101375246051365641E+06, 0.101416446476650075E+06, 0.101455302158143284E+06, + 0.101490839830927347E+06, 0.101520107656443550E+06, 0.101543517742126453E+06, 0.101563037513223637E+06, 0.101578855351202437E+06, + 0.101589294440855650E+06, 0.101594084692158984E+06, 0.101595811485579121E+06, 0.101594522898840631E+06, 0.101587783852875349E+06, + 0.101580434348492054E+06, 0.101571251185715577E+06, 0.101560523496472335E+06, 0.101548552694418337E+06, 0.101535867827232971E+06, + 0.101525413599061823E+06, 0.101514059084604145E+06, 0.101501599931887249E+06, 0.101487982453526070E+06, 0.101472687979190014E+06, + 0.101455256212675624E+06, 0.101436599458446668E+06, 0.101417421871714148E+06, 0.101397941747779230E+06, 0.101378563636379375E+06, + 0.101359842874464084E+06, 0.101342462840995518E+06, 0.101332246224379633E+06, 0.101325840252083945E+06, 0.101320103689658979E+06, + 0.101314877253089740E+06, 0.101310111834561045E+06, 0.101305378666758857E+06, 0.101300345803243748E+06, 0.101295776170531011E+06, + 0.101292199871251156E+06, 0.101287082936946317E+06, 0.101280060941132921E+06, 0.101270852280511215E+06, 0.101259228389922413E+06, + 0.101244988802512118E+06, 0.101227740446083306E+06, 0.101206586899449845E+06, 0.101182271497207475E+06, 0.101154765725986566E+06, + 0.101124017218970926E+06, 0.101089948851124151E+06, 0.101052459983455323E+06, 0.101011429271982197E+06, 0.100955245737388075E+06, + 0.100896292883737755E+06, 0.100836289133349041E+06, 0.100776402552628671E+06, 0.100717117782225978E+06, 0.100659365283430379E+06, + 0.100604025319315682E+06, 0.100553449734939946E+06, 0.100508407522918642E+06, 0.100467703215460322E+06, 0.100431774319843782E+06, + 0.100887777028820332E+06, 0.100861720047367722E+06, 0.100834436753951144E+06, 0.100806009321876336E+06, 0.100776515387351727E+06, + 0.100746027719175327E+06, 0.100714128174464058E+06, 0.100678835400336873E+06, 0.100643940658424166E+06, 0.100609599439615049E+06, + 0.100575890439937211E+06, 0.100542814645689868E+06, 0.100510647118237335E+06, 0.100478852228419142E+06, 0.100447427441828680E+06, + 0.100416345678542421E+06, 0.100385524391706378E+06, 0.100353710114660586E+06, 0.100313330006065604E+06, 0.100273215809488320E+06, + 0.100233726851702537E+06, 0.100195172710990315E+06, 0.100157816918484707E+06, 0.100121881575408392E+06, 0.100087552777137244E+06, + 0.100054986731522251E+06, 0.100024316458513829E+06, 0.999958188555688102E+05, 0.999694587498323526E+05, 0.999449162204764725E+05, + 0.999222572991156194E+05, 0.999015841003048117E+05, 0.998830358793447813E+05, 0.998667901084829064E+05, 0.998530636160492868E+05, + 0.998421138196279935E+05, 0.998399548826702376E+05, 0.998456341634458367E+05, 0.998536660057044792E+05, 0.998634438903502014E+05, + 0.998743637363783346E+05, 0.998858203733583359E+05, 0.998972031892049272E+05, 0.999078909209750127E+05, 0.999149362451545312E+05, + 0.999155853988857416E+05, 0.999144713123037072E+05, 0.999115094947106991E+05, 0.999066084422268032E+05, 0.998996635379296931E+05, + 0.998905505086211051E+05, 0.998791187039132201E+05, 0.998553009292081260E+05, 0.998211706427201134E+05, 0.997864909210314072E+05, + 0.997528267554746853E+05, 0.997217498141473916E+05, 0.996948180668799905E+05, 0.996735491411857802E+05, 0.996593866015884996E+05, + 0.996655234255323448E+05, 0.996793806269131601E+05, 0.997006480667150026E+05, 0.997291101032920706E+05, 0.997645101820020791E+05, + 0.998065302642879251E+05, 0.998547900089741306E+05, 0.999134103376733110E+05, 0.999816545378570445E+05, 0.100052123784172887E+06, + 0.100122995502983205E+06, 0.100192554793170464E+06, 0.100259253657548237E+06, 0.100321770579711141E+06, 0.100379066111299660E+06, + 0.100430565790236928E+06, 0.100476507405646029E+06, 0.100515199549242738E+06, 0.100547257296906639E+06, 0.100573671260601302E+06, + 0.100594920234367688E+06, 0.100611741953639648E+06, 0.100625093360959523E+06, 0.100636085854106641E+06, 0.100648539226327353E+06, + 0.100663110344216606E+06, 0.100678485576473686E+06, 0.100694991774415132E+06, 0.100712835683178113E+06, 0.100732147548005290E+06, + 0.100753127553809449E+06, 0.100775525773403977E+06, 0.100799178062266757E+06, 0.100823896465442915E+06, 0.100848973735924432E+06, + 0.100871627589741343E+06, 0.100896325593451635E+06, 0.100923508440905760E+06, 0.100953444968081341E+06, 0.100987803936626107E+06, + 0.101025452874861629E+06, 0.101064958354120550E+06, 0.101105934719207362E+06, 0.101149656229281260E+06, 0.101195955740066449E+06, + 0.101241312234646321E+06, 0.101284295970940017E+06, 0.101322838039260794E+06, 0.101354503959834561E+06, 0.101381602347716602E+06, + 0.101404011754918669E+06, 0.101421551762267889E+06, 0.101430360992792368E+06, 0.101432922117767157E+06, 0.101431497700586173E+06, + 0.101426925441668209E+06, 0.101419967655507149E+06, 0.101411983040633873E+06, 0.101402716970667971E+06, 0.101392421375849139E+06, + 0.101381472260780953E+06, 0.101370274940234522E+06, 0.101359740662010270E+06, 0.101350634658367329E+06, 0.101341143517682387E+06, + 0.101330923240958698E+06, 0.101319823874219393E+06, 0.101307931163203728E+06, 0.101295590108053555E+06, 0.101283554840952769E+06, + 0.101272503805782646E+06, 0.101264230996134676E+06, 0.101263165987784392E+06, 0.101263248071743699E+06, 0.101263968423840182E+06, + 0.101264949849351571E+06, 0.101265950281725454E+06, 0.101266859267559164E+06, 0.101267688820318188E+06, 0.101269586773692979E+06, + 0.101271200254654817E+06, 0.101270843870590616E+06, 0.101268468005190778E+06, 0.101263583383249803E+06, 0.101255809203046563E+06, + 0.101244849341628564E+06, 0.101230469880693592E+06, 0.101211897835992699E+06, 0.101189677118595791E+06, 0.101163874725058151E+06, + 0.101134452948665217E+06, 0.101101374466219480E+06, 0.101064596222306151E+06, 0.101024065194136114E+06, 0.100976094439065258E+06, + 0.100916143828112647E+06, 0.100853769181501484E+06, 0.100790071236260570E+06, 0.100726087398982490E+06, 0.100662794662010128E+06, + 0.100601113224382003E+06, 0.100541910367744073E+06, 0.100487274737311833E+06, 0.100437683864829785E+06, 0.100392394095480457E+06, + 0.100351867577605750E+06, 0.100962168045125494E+06, 0.100932365352918903E+06, 0.100901110935450168E+06, 0.100868480358099798E+06, + 0.100834547574790442E+06, 0.100796703363587934E+06, 0.100755267960995203E+06, 0.100713570472402876E+06, 0.100671854726096004E+06, + 0.100630308500112806E+06, 0.100589060133053688E+06, 0.100548176434007823E+06, 0.100507661857319457E+06, 0.100467458892467330E+06, + 0.100427449603971385E+06, 0.100387458241177985E+06, 0.100347067293918182E+06, 0.100298654635154177E+06, 0.100250789888946878E+06, + 0.100203094461237808E+06, 0.100156000274838036E+06, 0.100109901773151054E+06, 0.100065158238268661E+06, 0.100022096993949221E+06, + 0.999810174333996401E+05, 0.999421958115488960E+05, 0.999058907435752189E+05, 0.998749313841952826E+05, 0.998464722705311870E+05, + 0.998203417981312523E+05, 0.997966268545406929E+05, 0.997754458911707188E+05, 0.997569500594004494E+05, 0.997413241542494943E+05, + 0.997287873670089612E+05, 0.997195938347852207E+05, 0.997219848697613779E+05, 0.997302647271703609E+05, 0.997413201843605202E+05, + 0.997545532545877795E+05, 0.997693575270145375E+05, 0.997851155398511037E+05, 0.998011953959217790E+05, 0.998169466903843859E+05, + 0.998299082101016102E+05, 0.998356142670790869E+05, 0.998398422284621047E+05, 0.998424522644160897E+05, 0.998432923817324918E+05, + 0.998421955048720556E+05, 0.998389770375031076E+05, 0.998334333807975636E+05, 0.998233671652358898E+05, 0.997961670290865004E+05, + 0.997678973047597101E+05, 0.997399010170866677E+05, 0.997134966342892585E+05, 0.996899556689095043E+05, 0.996704759993049811E+05, + 0.996561506699569145E+05, 0.996500136858785991E+05, 0.996586427100675064E+05, 0.996741311696416087E+05, 0.996962994894855947E+05, + 0.997249142503650510E+05, 0.997596639024193428E+05, 0.998001312580039958E+05, 0.998457643772705051E+05, 0.998968741052847909E+05, + 0.999554058789066621E+05, 0.100014421175045645E+06, 0.100072433938662172E+06, 0.100128122411163247E+06, 0.100180369857232887E+06, + 0.100226565707743983E+06, 0.100267364450542242E+06, 0.100303437234851634E+06, 0.100335667091963755E+06, 0.100364067822408935E+06, + 0.100388352892750874E+06, 0.100408979571248361E+06, 0.100426614584295938E+06, 0.100443740449263758E+06, 0.100461134998395326E+06, + 0.100478174321635088E+06, 0.100495256991003844E+06, 0.100512619944850769E+06, 0.100530318011748270E+06, 0.100548816195507636E+06, + 0.100568537852548383E+06, 0.100588688433695279E+06, 0.100609168368209503E+06, 0.100629814904332350E+06, 0.100650416237038749E+06, + 0.100665634418575515E+06, 0.100681296503981284E+06, 0.100698501345687095E+06, 0.100717920340627403E+06, 0.100740215249176472E+06, + 0.100766890514599916E+06, 0.100796657224606606E+06, 0.100829306693609207E+06, 0.100864641226465828E+06, 0.100904494038338991E+06, + 0.100948883593760926E+06, 0.100993670283464584E+06, 0.101037518284592399E+06, 0.101079215492193092E+06, 0.101115268009655614E+06, + 0.101146790223207165E+06, 0.101174201341284715E+06, 0.101197180680782549E+06, 0.101215405063571248E+06, 0.101223672236876388E+06, + 0.101227039458753206E+06, 0.101226892310118274E+06, 0.101223972224575875E+06, 0.101218953111666357E+06, 0.101212937481870860E+06, + 0.101205841402347578E+06, 0.101198438153766576E+06, 0.101191337677150907E+06, 0.101184775501605473E+06, 0.101178859738651910E+06, + 0.101173861836438504E+06, 0.101169688625135837E+06, 0.101165295165053874E+06, 0.101160720689472480E+06, 0.101156205118519152E+06, + 0.101153904081471745E+06, 0.101157778313312563E+06, 0.101162376363148098E+06, 0.101167695990116554E+06, 0.101174407609201837E+06, + 0.101181289698729292E+06, 0.101187910343826748E+06, 0.101193938755009076E+06, 0.101199145593254492E+06, 0.101206932922006279E+06, + 0.101215167455344184E+06, 0.101221538641997948E+06, 0.101225600948191553E+06, 0.101227025345643400E+06, 0.101225591909201801E+06, + 0.101221179118605258E+06, 0.101213750568578733E+06, 0.101199646966405868E+06, 0.101180697627794187E+06, 0.101158105995225807E+06, + 0.101131732247750042E+06, 0.101101468150223940E+06, 0.101067227518597691E+06, 0.101028937999906033E+06, 0.100986534229694924E+06, + 0.100931637537634888E+06, 0.100870116212888723E+06, 0.100806172230221506E+06, 0.100740814221331588E+06, 0.100675010844437245E+06, + 0.100609686876287946E+06, 0.100545721239012084E+06, 0.100483946382944894E+06, 0.100426130298766730E+06, 0.100372432821891009E+06, + 0.100322757504134090E+06, 0.100277638455664739E+06, 0.101031760825673671E+06, 0.100998271623218010E+06, 0.100963081981794705E+06, + 0.100926251398063658E+06, 0.100882116391194853E+06, 0.100836110949086375E+06, 0.100789196010976768E+06, 0.100741656022242169E+06, + 0.100693739602509639E+06, 0.100645654807320738E+06, 0.100597565425804190E+06, 0.100549588305930272E+06, 0.100501791687992096E+06, + 0.100454194516198477E+06, 0.100406766687836353E+06, 0.100359430189551465E+06, 0.100303106797204193E+06, 0.100246577208372706E+06, + 0.100190531822652643E+06, 0.100135266216653603E+06, 0.100081062875707968E+06, 0.100028192493603376E+06, 0.999769161960119818E+05, + 0.999274886616365693E+05, 0.998801621121565840E+05, 0.998351911400472018E+05, 0.997962094163349393E+05, 0.997640534483473457E+05, + 0.997345240177219384E+05, 0.997076990988948673E+05, 0.996836794307263772E+05, 0.996625896600271371E+05, 0.996445791479565378E+05, + 0.996298224252568762E+05, 0.996185192726470996E+05, 0.996108943913202529E+05, 0.996171044733596500E+05, 0.996274341933858086E+05, + 0.996407368485686020E+05, 0.996564433077199938E+05, 0.996739662819337100E+05, 0.996926995456860750E+05, 0.997120167510192841E+05, + 0.997312700110226870E+05, 0.997492720049924683E+05, 0.997589945357419347E+05, 0.997672950870170171E+05, 0.997740082631510304E+05, + 0.997789569418504107E+05, 0.997819534179343900E+05, 0.997828018434580008E+05, 0.997813025467889238E+05, 0.997761547542830958E+05, + 0.997606903751367063E+05, 0.997380039112137747E+05, 0.997148807783809316E+05, 0.996925793721139198E+05, 0.996723316187614837E+05, + 0.996553186696160265E+05, 0.996426434711866459E+05, 0.996353006212308683E+05, 0.996360089851673401E+05, 0.996493081867637520E+05, + 0.996683800195190997E+05, 0.996929780547397386E+05, 0.997227658669395460E+05, 0.997573001543519495E+05, 0.997960150791931374E+05, + 0.998382096557535260E+05, 0.998830404070649238E+05, 0.999298323121304275E+05, 0.999742523604048474E+05, 0.100016965326181715E+06, + 0.100057253131543956E+06, 0.100094584675305145E+06, 0.100128612542877818E+06, 0.100159162106115866E+06, 0.100186212494174571E+06, + 0.100209869217876141E+06, 0.100230664541801205E+06, 0.100252215827535721E+06, 0.100272507526162837E+06, 0.100291578842935764E+06, + 0.100309849731348106E+06, 0.100327689967233746E+06, 0.100345394170965068E+06, 0.100363163535270942E+06, 0.100381092592034052E+06, + 0.100399259031973241E+06, 0.100417513798931104E+06, 0.100435580822035801E+06, 0.100453091252954211E+06, 0.100469603339999827E+06, + 0.100480151507121773E+06, 0.100489254638568047E+06, 0.100498595808049067E+06, 0.100508951548301586E+06, 0.100521040443233302E+06, + 0.100536087694824993E+06, 0.100554481106296153E+06, 0.100575842199618433E+06, 0.100600284600435130E+06, 0.100627894363922838E+06, + 0.100660998742818352E+06, 0.100699900685942383E+06, 0.100740240979155365E+06, 0.100780773089326132E+06, 0.100820325888548046E+06, + 0.100857002425394050E+06, 0.100889306549680012E+06, 0.100918410465244044E+06, 0.100943855527829830E+06, 0.100965216993375041E+06, + 0.100982104369596826E+06, 0.100988787448417890E+06, 0.100992039290643908E+06, 0.100992851817592629E+06, 0.100992148367721486E+06, + 0.100990754377491627E+06, 0.100989328864528783E+06, 0.100987939282731590E+06, 0.100987019598780156E+06, 0.100986810224360001E+06, + 0.100987461015865600E+06, 0.100989052975663959E+06, 0.100991630597561802E+06, 0.100995163025901697E+06, 0.101001875722349461E+06, + 0.101011088720900429E+06, 0.101021084899088091E+06, 0.101031663037972830E+06, 0.101042638294081626E+06, 0.101053858103835970E+06, + 0.101065218626100279E+06, 0.101076680586933391E+06, 0.101088283485301858E+06, 0.101099874970037970E+06, 0.101113089326713816E+06, + 0.101125428039884195E+06, 0.101136196176455385E+06, 0.101144782354753406E+06, 0.101150661981462021E+06, 0.101153397040916956E+06, + 0.101152632849470392E+06, 0.101148092219151222E+06, 0.101138825885236918E+06, 0.101125297346996245E+06, 0.101107998631323659E+06, + 0.101086896343469081E+06, 0.101061954484055474E+06, 0.101033133620494526E+06, 0.101000389988487950E+06, 0.100963674428856495E+06, + 0.100920035249967157E+06, 0.100864002050084426E+06, 0.100802954127500183E+06, 0.100739491656333426E+06, 0.100674607806506479E+06, + 0.100609142818467881E+06, 0.100543918229119721E+06, 0.100479729438758746E+06, 0.100417340423775575E+06, 0.100357818911458060E+06, + 0.100301549120910859E+06, 0.100249027161521051E+06, 0.100200821670612902E+06, 0.101087517829558172E+06, 0.101052015003826687E+06, + 0.101011788745108162E+06, 0.100964536778963855E+06, 0.100915488137692053E+06, 0.100864943012846241E+06, 0.100813190048196135E+06, + 0.100760500256302723E+06, 0.100707121731364154E+06, 0.100653275174801398E+06, 0.100599150242222226E+06, 0.100544902712618306E+06, + 0.100490652473024573E+06, 0.100436482304513964E+06, 0.100382437448442113E+06, 0.100320280351299210E+06, 0.100257427382579408E+06, + 0.100194846079550756E+06, 0.100132891655021755E+06, 0.100071918796184837E+06, 0.100012281557507449E+06, 0.999543340473443968E+05, + 0.998984318951125897E+05, 0.998449344820776314E+05, 0.997942079153267550E+05, 0.997466460297804297E+05, 0.997094928681285237E+05, + 0.996756279012622545E+05, 0.996450218538222252E+05, 0.996176735384205385E+05, 0.995936103776563396E+05, 0.995728884174646664E+05, + 0.995555917894421727E+05, 0.995418315732738702E+05, 0.995317440033937164E+05, 0.995262628136555868E+05, 0.995329410864949314E+05, + 0.995433141117427585E+05, 0.995568197318211314E+05, 0.995728823939344729E+05, 0.995909116272487881E+05, 0.996102999545491039E+05, + 0.996304204174830811E+05, 0.996506239397997124E+05, 0.996702368021630245E+05, 0.996815718025470851E+05, 0.996899469928969920E+05, + 0.996967323341972806E+05, 0.997018093255459680E+05, 0.997050766826754843E+05, 0.997064543685055542E+05, 0.997058891541211779E+05, + 0.997033620388164272E+05, 0.996988978495463380E+05, 0.996831868676393642E+05, 0.996664226445127570E+05, 0.996504367351514375E+05, + 0.996361908772876632E+05, 0.996245860820844246E+05, 0.996164411729444837E+05, 0.996124708057612588E+05, 0.996132638091558620E+05, + 0.996196649575229239E+05, 0.996367110923675500E+05, 0.996583825556631200E+05, 0.996843326520396949E+05, 0.997128691088688356E+05, + 0.997429147876210773E+05, 0.997758051592909760E+05, 0.998110107603276119E+05, 0.998478942000829556E+05, 0.998857114279977977E+05, + 0.999214491155317955E+05, 0.999550948845939129E+05, 0.999866837454055931E+05, 0.100015951080814193E+06, 0.100042763152220112E+06, + 0.100066833155271277E+06, 0.100088158247781059E+06, 0.100108078185884762E+06, 0.100126927297932227E+06, 0.100144951073682430E+06, + 0.100162306504082269E+06, 0.100179972902585811E+06, 0.100197255514410528E+06, 0.100214513504718459E+06, 0.100231716678680328E+06, + 0.100248516891677820E+06, 0.100264879167597144E+06, 0.100280677931150029E+06, 0.100295703143529230E+06, 0.100309668678237373E+06, + 0.100317822458752169E+06, 0.100323698725186405E+06, 0.100328766123466703E+06, 0.100333617686529382E+06, 0.100338870421945830E+06, + 0.100345146510504768E+06, 0.100353505811859010E+06, 0.100364091412822730E+06, 0.100377219192028511E+06, 0.100393145224109379E+06, + 0.100412076822805961E+06, 0.100436536362016341E+06, 0.100466993027333549E+06, 0.100499128955239808E+06, 0.100531867585847620E+06, + 0.100564210070354224E+06, 0.100595268938737849E+06, 0.100623389505981249E+06, 0.100648875381678285E+06, 0.100671545265182722E+06, + 0.100691215991390258E+06, 0.100707855569253967E+06, 0.100721531568851729E+06, 0.100729765774870320E+06, 0.100736382308921660E+06, + 0.100742049357786149E+06, 0.100747338931632839E+06, 0.100752699996680560E+06, 0.100758437644766876E+06, 0.100764492369211905E+06, + 0.100771174162651805E+06, 0.100778897781122723E+06, 0.100791202238176033E+06, 0.100805304746492911E+06, 0.100820453141876555E+06, + 0.100836553977341420E+06, 0.100853433691068960E+06, 0.100869804352758074E+06, 0.100885565873248357E+06, 0.100901263434718436E+06, + 0.100916755649211860E+06, 0.100931925490762223E+06, 0.100946862129343805E+06, 0.100964994999554750E+06, 0.100982379998277524E+06, + 0.100998599729598267E+06, 0.101013259118967748E+06, 0.101025997621651855E+06, 0.101036183051793079E+06, 0.101042991775159331E+06, + 0.101046219174794693E+06, 0.101045436783694371E+06, 0.101037979396283830E+06, 0.101026389136987622E+06, 0.101011353849770458E+06, + 0.100992765156084381E+06, 0.100970520839387638E+06, 0.100944522980413691E+06, 0.100914676733503889E+06, 0.100880889510173438E+06, + 0.100843070409204898E+06, 0.100794195318855112E+06, 0.100740849916230014E+06, 0.100684368608276331E+06, 0.100625515617689191E+06, + 0.100565057571482292E+06, 0.100503753672499588E+06, 0.100442348146381337E+06, 0.100381564680888332E+06, 0.100322120082476831E+06, + 0.100265427081164002E+06, 0.100211108587006820E+06, 0.100159852906932778E+06, 0.100112309293580329E+06, 0.101124201328911135E+06, + 0.101079108320663814E+06, 0.101031809144729792E+06, 0.100982479818601947E+06, 0.100931296727433786E+06, 0.100878431465452362E+06, + 0.100824045759680885E+06, 0.100768286540631874E+06, 0.100710530566360118E+06, 0.100651851143405918E+06, 0.100592641779612633E+06, + 0.100533088300546049E+06, 0.100473351995987294E+06, 0.100413568226339557E+06, 0.100347374189164038E+06, 0.100280419558277266E+06, + 0.100213466642138825E+06, 0.100146884874704396E+06, 0.100081054126754942E+06, 0.100016363564741026E+06, 0.999532111494706915E+05, + 0.998920037667682045E+05, 0.998331579776468134E+05, 0.997771013708717801E+05, 0.997242744959584961E+05, 0.996794911425569007E+05, + 0.996421673866169731E+05, 0.996083624063458992E+05, 0.995780558571076108E+05, 0.995512438908386830E+05, 0.995279390599935141E+05, + 0.995081697090995876E+05, 0.994919788171798573E+05, 0.994794222509916144E+05, 0.994705663858296175E+05, 0.994666304399983201E+05, + 0.994716729317709396E+05, 0.994803098980725772E+05, 0.994920284915772354E+05, 0.995062941002977459E+05, 0.995225510997954116E+05, + 0.995402235083560226E+05, 0.995587157137078175E+05, 0.995774134724761680E+05, 0.995956854178548674E+05, 0.996082099438724399E+05, + 0.996146714115503564E+05, 0.996198917096476653E+05, 0.996237772972328385E+05, 0.996262556600006501E+05, 0.996272811679797160E+05, + 0.996268420791924145E+05, 0.996249688472863927E+05, 0.996217438673883153E+05, 0.996165665480622556E+05, 0.996053672464558331E+05, + 0.995949919441781822E+05, 0.995861528017038072E+05, 0.995795026742108748E+05, 0.995756196555683418E+05, 0.995749923295157205E+05, + 0.995764918417123117E+05, 0.995811371618628909E+05, 0.995900021812679042E+05, 0.996053443416097725E+05, 0.996253126869847765E+05, + 0.996485392863536254E+05, 0.996747275639752770E+05, 0.997034975235640304E+05, 0.997343816924544808E+05, 0.997668244608898967E+05, + 0.998001857951137499E+05, 0.998337502953590738E+05, 0.998667425003782409E+05, 0.998964382191309269E+05, 0.999219732315580331E+05, + 0.999453769704884326E+05, 0.999669632680838986E+05, 0.999870458961453260E+05, 0.100005916456012012E+06, 0.100023824889774987E+06, + 0.100040963571971195E+06, 0.100057455775243085E+06, 0.100073413986486979E+06, 0.100089335775104671E+06, 0.100104815244426631E+06, + 0.100119703191363587E+06, 0.100134379227022902E+06, 0.100148369375800728E+06, 0.100161370783191393E+06, 0.100173213642796953E+06, + 0.100180378799944810E+06, 0.100185526497069281E+06, 0.100189324284954535E+06, 0.100192153267272603E+06, 0.100194434190503976E+06, + 0.100196610662858875E+06, 0.100198905421094794E+06, 0.100201850991823914E+06, 0.100206163107215340E+06, 0.100212230663632377E+06, + 0.100220378132198122E+06, 0.100230869811071767E+06, 0.100245444302250398E+06, 0.100264473811748554E+06, 0.100285188354245533E+06, + 0.100306907645131752E+06, 0.100328990026887506E+06, 0.100350863943610893E+06, 0.100371839758985952E+06, 0.100391444833452260E+06, + 0.100409831169643890E+06, 0.100426823791286341E+06, 0.100442350551841242E+06, 0.100456434485740057E+06, 0.100469179887128601E+06, + 0.100480095078871280E+06, 0.100490844862516460E+06, 0.100501773469729742E+06, 0.100513473090107072E+06, 0.100529036405637875E+06, + 0.100544944618372494E+06, 0.100561407314039185E+06, 0.100578441255079553E+06, 0.100596158161423402E+06, 0.100614688506316757E+06, + 0.100634037456854698E+06, 0.100654132781311564E+06, 0.100674831301503669E+06, 0.100695930204477670E+06, 0.100717182634869590E+06, + 0.100738316734543623E+06, 0.100757949561458212E+06, 0.100778269263575014E+06, 0.100798138776316147E+06, 0.100817212656416305E+06, + 0.100835135245772617E+06, 0.100851545416907000E+06, 0.100866083297882986E+06, 0.100878398135237148E+06, 0.100888156496614407E+06, + 0.100895050095971907E+06, 0.100897946875170004E+06, 0.100893038607802475E+06, 0.100884438418173842E+06, 0.100872056807847897E+06, + 0.100855733686039923E+06, 0.100836196267254127E+06, 0.100813309503127763E+06, 0.100786948600525633E+06, 0.100756997497101227E+06, + 0.100723347939641535E+06, 0.100681497385685245E+06, 0.100634489632593322E+06, 0.100584469640955329E+06, 0.100531975070484972E+06, + 0.100477580490852386E+06, 0.100421885399875624E+06, 0.100365503956835804E+06, 0.100309056337240749E+06, 0.100253161585176160E+06, + 0.100199112753698049E+06, 0.100147837599931416E+06, 0.100098570404209735E+06, 0.100051904767761502E+06, 0.100008417383464068E+06, + 0.101133829804470908E+06, 0.101086063734912168E+06, 0.101036163378778583E+06, 0.100984272823056410E+06, 0.100930541473297533E+06, + 0.100875120408097937E+06, 0.100818158832696005E+06, 0.100759800682388610E+06, 0.100700181428799915E+06, 0.100639425144117529E+06, + 0.100577641880169904E+06, 0.100514925420599073E+06, 0.100451351465310479E+06, 0.100382775391041228E+06, 0.100313407558045423E+06, + 0.100244124043691409E+06, 0.100175160300200252E+06, 0.100106643005048623E+06, 0.100038955227867787E+06, 0.999724957502307661E+05, + 0.999076781431158888E+05, 0.998449303055831406E+05, 0.997846944474534976E+05, 0.997274274929867825E+05, 0.996741803525597352E+05, + 0.996341923290063423E+05, 0.995977652427823923E+05, 0.995648719529626542E+05, 0.995354913787664409E+05, 0.995096084222995123E+05, + 0.994872134460891248E+05, 0.994683012796486000E+05, 0.994528697284307418E+05, 0.994409175579627627E+05, 0.994324419258456037E+05, + 0.994284685420939932E+05, 0.994314645232595940E+05, 0.994376508028579119E+05, 0.994465880324430618E+05, 0.994578122019961011E+05, + 0.994708370980191394E+05, 0.994851569440643361E+05, 0.995002493657292362E+05, 0.995155788435459253E+05, 0.995306008387735346E+05, + 0.995442855494334071E+05, 0.995482724169068970E+05, 0.995511559961705934E+05, 0.995528872179506288E+05, 0.995534386606523331E+05, + 0.995528106454166118E+05, 0.995510380683528929E+05, 0.995481980155677447E+05, 0.995444181794313772E+05, 0.995389426918443642E+05, + 0.995326299748121528E+05, 0.995248068651720969E+05, 0.995181203502452699E+05, 0.995131485287031392E+05, 0.995104093839186244E+05, + 0.995103487778951967E+05, 0.995133292577804386E+05, 0.995196200330811116E+05, 0.995293885226779821E+05, 0.995426939068978973E+05, + 0.995594831481808505E+05, 0.995804466354603064E+05, 0.996042013257502404E+05, 0.996303970501146687E+05, 0.996586123005633417E+05, + 0.996883528051014437E+05, 0.997188265847352159E+05, 0.997490367113701504E+05, 0.997788526495865081E+05, 0.998078707819837873E+05, + 0.998356993938613014E+05, 0.998619800562695164E+05, 0.998837326032437413E+05, 0.999030588156207523E+05, 0.999213959026974480E+05, + 0.999389528776631778E+05, 0.999559737390779337E+05, 0.999728528505193826E+05, 0.999889548460716323E+05, 0.100004292017804837E+06, + 0.100018822423468373E+06, 0.100032457501698547E+06, 0.100045070251751036E+06, 0.100056503593779649E+06, 0.100066444229329674E+06, + 0.100073267298309525E+06, 0.100078208907556284E+06, 0.100081428306994378E+06, 0.100083145646425299E+06, 0.100084490398295631E+06, + 0.100085214798590619E+06, 0.100085235536889129E+06, 0.100083644141418641E+06, 0.100082296767241191E+06, 0.100081573165770096E+06, + 0.100081814208376789E+06, 0.100083316094140551E+06, 0.100086326553815597E+06, 0.100092077248113128E+06, 0.100100913993150592E+06, + 0.100111107468981296E+06, 0.100122323217253404E+06, 0.100134231875447673E+06, 0.100146529461883110E+06, 0.100158953738958458E+06, + 0.100172103739167927E+06, 0.100185442550333013E+06, 0.100198870033114930E+06, 0.100214743046030431E+06, 0.100230501702414200E+06, + 0.100246186063517438E+06, 0.100261900880765723E+06, 0.100278280962620207E+06, 0.100294975745097370E+06, 0.100311878419328103E+06, + 0.100329065054564679E+06, 0.100346610730169734E+06, 0.100364576981339662E+06, 0.100382997190169379E+06, 0.100401860048637522E+06, + 0.100421460558640218E+06, 0.100441987614432976E+06, 0.100463274519939529E+06, 0.100485156332498926E+06, 0.100507667562079601E+06, + 0.100531755712309474E+06, 0.100555537683995659E+06, 0.100578784151641899E+06, 0.100601239956125326E+06, 0.100622628756313949E+06, + 0.100641873088256354E+06, 0.100658680264014634E+06, 0.100673598187900920E+06, 0.100686312726101605E+06, 0.100696503456104270E+06, + 0.100703849613094353E+06, 0.100704152415214849E+06, 0.100700762505721214E+06, 0.100694332357036590E+06, 0.100684801738842943E+06, + 0.100672137064367969E+06, 0.100656329651135165E+06, 0.100637393206196401E+06, 0.100615360755861184E+06, 0.100590281222544916E+06, + 0.100562215831141861E+06, 0.100526781016220033E+06, 0.100486348156266336E+06, 0.100442798181998849E+06, 0.100397163429546563E+06, + 0.100349807344903311E+06, 0.100301139976506107E+06, 0.100251607747954069E+06, 0.100201684250218939E+06, 0.100151862062679153E+06, + 0.100102645581508201E+06, 0.100056044918004729E+06, 0.100011301942910883E+06, 0.999684520456376777E+05, 0.999279531311431929E+05, + 0.998902646792392770E+05, 0.101126663346454399E+06, 0.101077325354608969E+06, 0.101025975734916894E+06, 0.100972737972671399E+06, + 0.100917744423974829E+06, 0.100861133803490855E+06, 0.100803048766821448E+06, 0.100743633625432005E+06, 0.100683032233185906E+06, + 0.100621386084403202E+06, 0.100558832663878042E+06, 0.100495211427552291E+06, 0.100428081646754872E+06, 0.100360053702616802E+06, + 0.100291421804985934E+06, 0.100222501857581025E+06, 0.100153629396011398E+06, 0.100085157752426705E+06, 0.100017456492403435E+06, + 0.999509101650603116E+05, 0.998859174013813172E+05, 0.998228903882164013E+05, 0.997622547363343474E+05, 0.997044497501409787E+05, + 0.996565808532324445E+05, 0.996171954030033376E+05, 0.995813735590216529E+05, 0.995490780595074320E+05, 0.995202664706442010E+05, + 0.994948916653312772E+05, 0.994731497863732366E+05, 0.994547373765991215E+05, 0.994395024448596523E+05, 0.994273918334258487E+05, + 0.994183417080185318E+05, 0.994131115873192466E+05, 0.994138210062121798E+05, 0.994170868554473127E+05, 0.994225572846895811E+05, + 0.994298923767942179E+05, 0.994385978253560606E+05, 0.994482495116238133E+05, 0.994584440096453618E+05, 0.994687785322086420E+05, + 0.994788546658055129E+05, 0.994882828035313869E+05, 0.994927040708071727E+05, 0.994917547439376503E+05, 0.994895539007886109E+05, + 0.994862075166797877E+05, 0.994818501581585733E+05, 0.994766470759525691E+05, 0.994707963627129502E+05, 0.994645310337857954E+05, + 0.994581208250226337E+05, 0.994518734280974313E+05, 0.994461348017268174E+05, 0.994415182672292285E+05, 0.994388346879257297E+05, + 0.994384357346413162E+05, 0.994406125032009149E+05, 0.994455917032776051E+05, 0.994535286747415666E+05, 0.994645016916688619E+05, + 0.994785078337676387E+05, 0.994954607091662765E+05, 0.995151903074341826E+05, 0.995379744989390892E+05, 0.995645762978403654E+05, + 0.995919660907828365E+05, 0.996199268533732247E+05, 0.996482101418556267E+05, 0.996765332991438627E+05, 0.997045938426658686E+05, + 0.997320840835444978E+05, 0.997587053657859215E+05, 0.997841813092843222E+05, 0.998082694645679585E+05, 0.998307708426059398E+05, + 0.998521847777656949E+05, 0.998731316336951131E+05, 0.998915223579208832E+05, 0.999088069900928822E+05, 0.999250655468217301E+05, + 0.999403321942196199E+05, 0.999545992766920099E+05, 0.999678219791941956E+05, 0.999799234377201792E+05, 0.999908557408674824E+05, + 0.100000288315772239E+06, 0.100007974659642932E+06, 0.100013912274213857E+06, 0.100018152445268570E+06, 0.100020792433534516E+06, + 0.100021965384116600E+06, 0.100021828600707202E+06, 0.100018978825766098E+06, 0.100014638020503815E+06, 0.100010038309740252E+06, + 0.100005576575099418E+06, 0.100001604858675491E+06, 0.999984320892866672E+05, 0.999963266886948113E+05, 0.999958737477183749E+05, + 0.999972975927051302E+05, 0.100000048030566773E+06, 0.100004042344745598E+06, 0.100009194673973179E+06, 0.100015426118827090E+06, + 0.100022673026545686E+06, 0.100031009563329135E+06, 0.100040766570146734E+06, 0.100051217540583049E+06, 0.100062248668533124E+06, + 0.100073786795171531E+06, 0.100085797503990121E+06, 0.100098280610450573E+06, 0.100111262656178049E+06, 0.100125001802413579E+06, + 0.100139645695878644E+06, 0.100154900063508263E+06, 0.100170710309353148E+06, 0.100187004814548171E+06, 0.100203682971120987E+06, + 0.100220602392753455E+06, 0.100237565502663623E+06, 0.100256278549938754E+06, 0.100276900404893633E+06, 0.100298794291387065E+06, + 0.100320557514765664E+06, 0.100342058165774986E+06, 0.100363130678741916E+06, 0.100383577435456726E+06, 0.100403171366828377E+06, + 0.100421659429775435E+06, 0.100438766794516225E+06, 0.100454201546808938E+06, 0.100467659691497232E+06, 0.100478830237807808E+06, + 0.100481024801078907E+06, 0.100479810484167552E+06, 0.100476403382797740E+06, 0.100470673041393165E+06, 0.100462504496619513E+06, + 0.100451800234604845E+06, 0.100438481209722173E+06, 0.100422487058078696E+06, 0.100403775642287073E+06, 0.100382322062990715E+06, + 0.100358117267813446E+06, 0.100327534199358997E+06, 0.100293850879764213E+06, 0.100257806725219358E+06, 0.100219741686727677E+06, + 0.100180023194298759E+06, 0.100139040711945461E+06, 0.100097200477411025E+06, 0.100054920551059535E+06, 0.100012626265403043E+06, + 0.999707461374165723E+05, 0.999303503014407033E+05, 0.998922229704366764E+05, 0.998554721656402544E+05, 0.998204850080980395E+05, + 0.997876409225251264E+05, 0.997573084048583696E+05, 0.101103863341862932E+06, 0.101054198041262367E+06, 0.101002678396138304E+06, + 0.100949414469850730E+06, 0.100894527371675096E+06, 0.100838147558637153E+06, 0.100780413214267071E+06, 0.100721468731159111E+06, + 0.100661463324523051E+06, 0.100600549803942500E+06, 0.100538495641508489E+06, 0.100474499779926511E+06, 0.100409614880186520E+06, + 0.100344074690081019E+06, 0.100278137807477731E+06, 0.100212086086552372E+06, 0.100146223109295490E+06, 0.100080872747272268E+06, + 0.100016377835126099E+06, 0.999530989729176799E+05, 0.998914134690468200E+05, 0.998317144291724107E+05, 0.997744099892116501E+05, + 0.997208338934957865E+05, 0.996799309689324291E+05, 0.996422327801534993E+05, 0.996077247089604498E+05, 0.995763830833266111E+05, + 0.995481752007196337E+05, 0.995230592311468208E+05, 0.995009839760444302E+05, 0.994818884619951277E+05, 0.994657013515687577E+05, + 0.994523401572802686E+05, 0.994417102486785589E+05, 0.994338127166474005E+05, 0.994291184813256987E+05, 0.994266081659517949E+05, + 0.994259833524572168E+05, 0.994269351914163999E+05, 0.994291475057475909E+05, 0.994323001129119220E+05, 0.994360724062380032E+05, + 0.994401472289394151E+05, 0.994442150616938598E+05, 0.994479785254193557E+05, 0.994511571742526139E+05, 0.994472284598653205E+05, + 0.994408965796853736E+05, 0.994339336034472362E+05, 0.994264710020695638E+05, 0.994186660048548511E+05, 0.994107025256855122E+05, + 0.994027916086733312E+05, 0.993951711926945572E+05, 0.993881049497915083E+05, 0.993818799057818542E+05, 0.993768025040628709E+05, + 0.993745371453054540E+05, 0.993758273945832625E+05, 0.993797480709728989E+05, 0.993864179439653672E+05, 0.993959015946626314E+05, + 0.994106666848780587E+05, 0.994280957797027659E+05, 0.994479062249146809E+05, 0.994699024606817256E+05, 0.994938326370272989E+05, + 0.995193970618178137E+05, 0.995462575961586117E+05, 0.995732238058578514E+05, 0.995996836683722795E+05, 0.996264076540508540E+05, + 0.996531520384603791E+05, 0.996796729134591151E+05, 0.997057352581914602E+05, 0.997311214531925361E+05, 0.997565307292698708E+05, + 0.997809628500159452E+05, 0.998041926037547237E+05, 0.998260922842872533E+05, 0.998465616497438023E+05, 0.998655323213428928E+05, + 0.998829702013785281E+05, 0.998988759405013552E+05, 0.999132835855504527E+05, 0.999267531384376343E+05, 0.999401187534305645E+05, + 0.999522829859957856E+05, 0.999629705900948175E+05, 0.999720750719777716E+05, 0.999795225775888684E+05, 0.999852704402040836E+05, + 0.999893033756584045E+05, 0.999916276698245056E+05, 0.999912215328864258E+05, 0.999874978505536856E+05, 0.999827294697511534E+05, + 0.999772668831095216E+05, 0.999714403004270425E+05, 0.999655543840146129E+05, 0.999598844544293243E+05, 0.999546738384171913E+05, + 0.999501503361758805E+05, 0.999464612795733119E+05, 0.999436472754112765E+05, 0.999417478240415512E+05, 0.999407845190346270E+05, + 0.999407674168311496E+05, 0.999417003681598144E+05, 0.999435850419050112E+05, 0.999466778359479795E+05, 0.999509741170870548E+05, + 0.999561184478715149E+05, 0.999620266396879451E+05, 0.999686260435519798E+05, 0.999758509523019893E+05, 0.999836356497705565E+05, + 0.999919049957114039E+05, 0.100000562486864073E+06, 0.100011784952549118E+06, 0.100025750768122278E+06, 0.100039950549839836E+06, + 0.100054145017178846E+06, 0.100068316891848794E+06, 0.100082450146767165E+06, 0.100096523400557431E+06, 0.100110501610887819E+06, + 0.100124326095454249E+06, 0.100137903024072584E+06, 0.100153035210029513E+06, 0.100168028234449826E+06, 0.100182528489386037E+06, + 0.100196311615898419E+06, 0.100209129758123207E+06, 0.100220714305906484E+06, 0.100227674075086179E+06, 0.100228582862959636E+06, + 0.100228182141282334E+06, 0.100226441566948473E+06, 0.100223301716988630E+06, 0.100218680617939594E+06, 0.100212480375930187E+06, + 0.100204593660852275E+06, 0.100193237399701000E+06, 0.100179608999797390E+06, 0.100163806561057383E+06, 0.100145763706322687E+06, + 0.100124166108882637E+06, 0.100097853920290698E+06, 0.100069603397772837E+06, 0.100039598196173276E+06, 0.100008052525304520E+06, + 0.999752085984543955E+05, 0.999413336779185047E+05, 0.999067168729345140E+05, 0.998716658233869821E+05, 0.998365033809807937E+05, + 0.998015643788216548E+05, 0.997673503212209471E+05, 0.997368095318123815E+05, 0.997072417009385681E+05, 0.996789372306682053E+05, + 0.996521942416031088E+05, 0.996273141486202512E+05, 0.996045978845247591E+05, 0.101067589111213412E+06, 0.101018770688517165E+06, + 0.100968154311929655E+06, 0.100916004392167699E+06, 0.100862587963118029E+06, 0.100807829042751429E+06, 0.100751860689524168E+06, + 0.100694824678955032E+06, 0.100636870575220571E+06, 0.100578085861079686E+06, 0.100518387120511878E+06, 0.100457910498338359E+06, + 0.100396827710058526E+06, 0.100335334776766380E+06, 0.100273650785659062E+06, 0.100212016619918053E+06, 0.100150693670614579E+06, + 0.100089962540906286E+06, 0.100030121749858867E+06, 0.999714864397286292E+05, 0.999143870864777564E+05, 0.998591682086720684E+05, + 0.998061870647466858E+05, 0.997614041189860436E+05, 0.997232133410041570E+05, 0.996877601571912237E+05, 0.996550329117300425E+05, + 0.996250097998356068E+05, 0.995976585142769036E+05, 0.995729358349222894E+05, 0.995507871467952355E+05, 0.995311458738776855E+05, + 0.995139328178480646E+05, 0.994990553930397000E+05, 0.994864067510919558E+05, 0.994758647909620777E+05, 0.994662936172032933E+05, + 0.994584116138104437E+05, 0.994520440064580325E+05, 0.994469670430250553E+05, 0.994429511205758317E+05, 0.994397638951787376E+05, + 0.994371735196124209E+05, 0.994349519828108314E+05, 0.994328785098660155E+05, 0.994307429622300406E+05, 0.994283491541375697E+05, + 0.994255179730021191E+05, 0.994164893114872393E+05, 0.994067289084808290E+05, 0.993968888922061742E+05, 0.993871232560968492E+05, + 0.993776052903232921E+05, 0.993685268314349669E+05, 0.993600967438642401E+05, 0.993525384531912714E+05, 0.993461969112091901E+05, + 0.993435709722199681E+05, 0.993430289823759958E+05, 0.993448240458555374E+05, 0.993518125064813066E+05, 0.993620332314667612E+05, + 0.993746322170980275E+05, 0.993895541802843509E+05, 0.994066995366652700E+05, 0.994259271220238734E+05, 0.994470579336317896E+05, + 0.994698797554098419E+05, 0.994941524985713913E+05, 0.995196140617028141E+05, 0.995459864926176379E+05, 0.995729822203312797E+05, + 0.996003101205446874E+05, 0.996273070851956145E+05, 0.996547798040555062E+05, 0.996819738131592894E+05, 0.997085378998868837E+05, + 0.997343278080748278E+05, 0.997592022275180498E+05, 0.997830289890008135E+05, 0.998056904289906088E+05, 0.998270877683784638E+05, + 0.998471443932554248E+05, 0.998658079734391795E+05, 0.998830514038870024E+05, 0.998996025676379795E+05, 0.999153229697452334E+05, + 0.999295566639472963E+05, 0.999422722019988432E+05, 0.999534500054842792E+05, 0.999630795823789667E+05, 0.999711562553596450E+05, + 0.999776774721563124E+05, 0.999826387612595136E+05, 0.999854644320731022E+05, 0.999828794177739328E+05, 0.999789847225893318E+05, + 0.999739838414557307E+05, 0.999680998532223457E+05, 0.999615553821963986E+05, 0.999545658866950980E+05, 0.999473341203756863E+05, + 0.999400456392968772E+05, 0.999327953721481608E+05, 0.999256989141568774E+05, 0.999189700236989156E+05, 0.999127048128768074E+05, + 0.999069798769329791E+05, 0.999018544683639047E+05, 0.998973722234758170E+05, 0.998935621850836178E+05, 0.998904388907014218E+05, + 0.998896448727687675E+05, 0.998900344972452294E+05, 0.998911970826382749E+05, 0.998931396187662176E+05, 0.998958769268335309E+05, + 0.998994275255013781E+05, 0.999038084460577520E+05, 0.999090289824781794E+05, 0.999150833667861443E+05, 0.999217240524284571E+05, + 0.999282473433497362E+05, 0.999348833579850179E+05, 0.999415375242985901E+05, 0.999481154404054105E+05, 0.999545171017064131E+05, + 0.999606302661866066E+05, 0.999663230149861483E+05, 0.999714356178636663E+05, 0.999757718627941504E+05, 0.999790900530105428E+05, + 0.999810939111108019E+05, 0.999819561511524662E+05, 0.999789948862129386E+05, 0.999752827398946683E+05, 0.999708888630344300E+05, + 0.999658466886194801E+05, 0.999601566475907457E+05, 0.999537895884533064E+05, 0.999466907368066168E+05, 0.999387840276392963E+05, + 0.999299766462147236E+05, 0.999201636218782805E+05, 0.999092323322767916E+05, 0.998970667923400615E+05, 0.998831789013588714E+05, + 0.998636939941647142E+05, 0.998431119746374316E+05, 0.998214963412640354E+05, 0.997970862666926550E+05, 0.997712444170942908E+05, + 0.997445906917362154E+05, 0.997173029439411330E+05, 0.996895795051780588E+05, 0.996616375682111830E+05, 0.996337113354519679E+05, + 0.996060500180081726E+05, 0.995789157595469587E+05, 0.995557562522905791E+05, 0.995337048495515774E+05, 0.995126888312002120E+05, + 0.994929130817774712E+05, 0.994745951235418033E+05, 0.994579612022724759E+05, 0.994432427594338078E+05, 0.101021034351216382E+06, + 0.100974523158164724E+06, 0.100926407272977900E+06, 0.100876804093661282E+06, 0.100825841471867636E+06, 0.100773656698396328E+06, + 0.100720395485641522E+06, 0.100666210969990992E+06, 0.100612099345619077E+06, 0.100557249279083626E+06, 0.100501677971650905E+06, + 0.100445572670880414E+06, 0.100389253853780203E+06, 0.100332968905338319E+06, 0.100276665148379936E+06, 0.100220537893264976E+06, + 0.100164799821054621E+06, 0.100109679736971462E+06, 0.100055421257730064E+06, 0.100002281430952105E+06, 0.999505292822571937E+05, + 0.999004442827473104E+05, 0.998530843548639095E+05, 0.998156761219489854E+05, 0.997805278523404413E+05, 0.997476323427424795E+05, + 0.997169731242686539E+05, 0.996885239311042969E+05, 0.996622481616842706E+05, 0.996380983225617529E+05, 0.996160154459489713E+05, + 0.995959284728124476E+05, 0.995777535943772964E+05, 0.995613935458951310E+05, 0.995467368475156691E+05, 0.995336569880241732E+05, + 0.995208266243795515E+05, 0.995087482639954542E+05, 0.994977965334250039E+05, 0.994878249241337762E+05, 0.994786826211323350E+05, + 0.994702168427006691E+05, 0.994622751834644587E+05, 0.994547079083998542E+05, 0.994473701327138842E+05, 0.994401238077413873E+05, + 0.994328394160198222E+05, 0.994254188335577346E+05, 0.994184404922492249E+05, 0.994087127432848210E+05, 0.993987930235803360E+05, + 0.993894574291334138E+05, 0.993808966627234331E+05, 0.993733080854502186E+05, 0.993668924009867187E+05, 0.993618498078672274E+05, + 0.993583756460734730E+05, 0.993566555807828554E+05, 0.993568603838800627E+05, 0.993591403923829785E+05, 0.993636197419046657E+05, + 0.993703904921866488E+05, 0.993811197203903430E+05, 0.993950856599565304E+05, 0.994111457979586703E+05, 0.994291602554974379E+05, + 0.994489675444759632E+05, 0.994703876196585625E+05, 0.994932253351752443E+05, 0.995172741944998997E+05, 0.995426559018634871E+05, + 0.995694776827033347E+05, 0.995970389008766942E+05, 0.996251091056232981E+05, 0.996534496905636333E+05, 0.996818187512539298E+05, + 0.997099760279327893E+05, 0.997374141751707793E+05, 0.997622618739524623E+05, 0.997862435467323085E+05, 0.998092414887019404E+05, + 0.998311505958143825E+05, 0.998518805596518214E+05, 0.998718102890837035E+05, 0.998910750046514877E+05, 0.999090219912788452E+05, + 0.999255559670365765E+05, 0.999405919139345788E+05, 0.999540538378546335E+05, 0.999658730563341524E+05, 0.999759860512857849E+05, + 0.999843319314751134E+05, 0.999908495555851987E+05, 0.999954743712658383E+05, 0.999944404784162907E+05, 0.999915968456238916E+05, + 0.999872439634975599E+05, 0.999816171531630534E+05, 0.999749362615833961E+05, 0.999674042229870247E+05, 0.999592064518093102E+05, + 0.999505109123499715E+05, 0.999414687118180882E+05, 0.999323665105546679E+05, 0.999233975283402833E+05, 0.999144981369005836E+05, + 0.999058003303556034E+05, 0.998974241845954093E+05, 0.998894782591478870E+05, 0.998820595750179200E+05, 0.998752530846157169E+05, + 0.998691305778080132E+05, 0.998637489957377547E+05, 0.998586746844062873E+05, 0.998541772928227729E+05, 0.998502966627068381E+05, + 0.998469966131329420E+05, 0.998442320106148400E+05, 0.998419453691209637E+05, 0.998400626589490130E+05, 0.998384883490106731E+05, + 0.998370997211475333E+05, 0.998357405118142487E+05, 0.998339247931384743E+05, 0.998316580178510631E+05, 0.998293639855545480E+05, + 0.998269017565975373E+05, 0.998241201967542729E+05, 0.998208528853709577E+05, 0.998098081032783375E+05, 0.997954370825381193E+05, + 0.997808296869748592E+05, 0.997662255405725009E+05, 0.997518145513712225E+05, 0.997377288090598740E+05, 0.997240360167264153E+05, + 0.997115902471897134E+05, 0.997002807779587602E+05, 0.996889928911353927E+05, 0.996776906921413611E+05, 0.996663184120892256E+05, + 0.996548031405013462E+05, 0.996430577981460665E+05, 0.996309842516777717E+05, 0.996172720856796950E+05, 0.995989960463366879E+05, + 0.995803026148819772E+05, 0.995612677891255880E+05, 0.995419614978694444E+05, 0.995224517021402135E+05, 0.995028080337064894E+05, + 0.994831049415358284E+05, 0.994634243322594411E+05, 0.994438577049017331E+05, 0.994245077928505052E+05, 0.994054897371244297E+05, + 0.993869318243143207E+05, 0.993690043020055746E+05, 0.993554308490509575E+05, 0.993412332136938494E+05, 0.993276308539287711E+05, + 0.993151162456799066E+05, 0.993038276851009432E+05, 0.992939167429839872E+05, 0.992855451787946949E+05, 0.992788820449725754E+05, + 0.100964847544612581E+06, 0.100921528597807934E+06, 0.100876819617514033E+06, 0.100830819119977881E+06, 0.100783635790840315E+06, + 0.100735387872604493E+06, 0.100686849362626730E+06, 0.100638850722815405E+06, 0.100589987206303587E+06, 0.100540391690949080E+06, + 0.100490207838124057E+06, 0.100439589213655403E+06, 0.100388698427470110E+06, 0.100337706295036201E+06, 0.100286791022897989E+06, + 0.100236137419730803E+06, 0.100185936133379830E+06, 0.100136382913311769E+06, 0.100087677896791603E+06, 0.100040024915916016E+06, + 0.999936308213850425E+05, 0.999487048175969685E+05, 0.999098959263045108E+05, 0.998760905821691704E+05, 0.998440744381323602E+05, + 0.998138388707919803E+05, 0.997853639904371375E+05, 0.997586190608742472E+05, 0.997335630315415328E+05, 0.997101451748205582E+05, + 0.996883058208672010E+05, 0.996679771815481945E+05, 0.996490842541338643E+05, 0.996315457942174835E+05, 0.996152753458579973E+05, + 0.996001823151213321E+05, 0.995855679555827810E+05, 0.995705558364965109E+05, 0.995563634129148850E+05, 0.995429286082849721E+05, + 0.995301928975228802E+05, 0.995181034121451230E+05, 0.995066149374921079E+05, 0.994956917495421949E+05, 0.994853092368055950E+05, + 0.994754552514231473E+05, 0.994661311329740856E+05, 0.994573523487461207E+05, 0.994491486954472930E+05, 0.994415640096655407E+05, + 0.994332401191460376E+05, 0.994242851325149240E+05, 0.994162875697421550E+05, 0.994093942955236271E+05, 0.994037502528714977E+05, + 0.993994957235938200E+05, 0.993967633485402912E+05, 0.993956749460767023E+05, 0.993963381773120200E+05, 0.993988431167032832E+05, + 0.994032587965396087E+05, 0.994096298031491460E+05, 0.994179730111528625E+05, 0.994282745493404218E+05, 0.994404870973938814E+05, + 0.994568186139204772E+05, 0.994754658271223161E+05, 0.994958964449326450E+05, 0.995177045414582390E+05, 0.995407458140571835E+05, + 0.995648609237595665E+05, 0.995898777201360062E+05, 0.996156137473152776E+05, 0.996418789751202567E+05, 0.996684786927591776E+05, + 0.996952164972683240E+05, 0.997218973051197536E+05, 0.997483303132390720E+05, 0.997743318352098577E+05, 0.997997279397391831E+05, + 0.998243568215117266E+05, 0.998484029817739647E+05, 0.998715185643880104E+05, 0.998929709407826740E+05, 0.999121391071011894E+05, + 0.999300598538423073E+05, 0.999466118827012979E+05, 0.999616803026846756E+05, 0.999751558213879034E+05, 0.999869336418048333E+05, + 0.999969120922718139E+05, 0.100004991024896648E+06, 0.100011070025070803E+06, 0.100011361902027944E+06, 0.100009689874259901E+06, + 0.100006354866167210E+06, 0.100001521961853068E+06, 0.999953569047140481E+05, 0.999880229251482233E+05, 0.999796782529097254E+05, + 0.999704742484093149E+05, 0.999605540801449097E+05, 0.999500518713602651E+05, 0.999395620634615480E+05, 0.999293797224061564E+05, + 0.999189780037119199E+05, 0.999084634603603772E+05, 0.998979305732036155E+05, 0.998874607924644370E+05, 0.998771215026191203E+05, + 0.998669648551638238E+05, 0.998570264274643996E+05, 0.998473236800365266E+05, 0.998378541987464268E+05, 0.998280094515223464E+05, + 0.998183015118441253E+05, 0.998087584599398106E+05, 0.997993088922536845E+05, 0.997898632369703118E+05, 0.997803110261358233E+05, + 0.997705176970055909E+05, 0.997603209573400527E+05, 0.997495267616314668E+05, 0.997338504371996823E+05, 0.997144148866953765E+05, + 0.996946194589021616E+05, 0.996748889962201501E+05, 0.996543973099300492E+05, 0.996333799061114987E+05, 0.996120632551793096E+05, + 0.995906575155593600E+05, 0.995693496108486434E+05, 0.995482968337894126E+05, 0.995276211300861032E+05, 0.995074041910853848E+05, + 0.994876834578204434E+05, 0.994684491110481467E+05, 0.994496420937635121E+05, 0.994311531852242333E+05, 0.994128231195840344E+05, + 0.993950629246981553E+05, 0.993796705843183881E+05, 0.993609699415756186E+05, 0.993418055421917088E+05, 0.993226794637357671E+05, + 0.993037059687493893E+05, 0.992849845648908376E+05, 0.992666033190360467E+05, 0.992486420429716236E+05, 0.992311752996093419E+05, + 0.992142751883332967E+05, 0.991980138777397078E+05, 0.991824658634138323E+05, 0.991677099373037345E+05, 0.991538308635238063E+05, + 0.991409207629147422E+05, 0.991303845164175582E+05, 0.991233478553789610E+05, 0.991173123854586884E+05, 0.991122941300806997E+05, + 0.991083274217430298E+05, 0.991054636978437338E+05, 0.991037699911700765E+05, 0.991033272031231463E+05, 0.991042282352598704E+05, + 0.991065760427079076E+05, 0.100899327711180042E+06, 0.100860014589195416E+06, 0.100819531202107522E+06, 0.100777959510744709E+06, + 0.100735390607726556E+06, 0.100694036465613695E+06, 0.100652089405901919E+06, 0.100609367247066592E+06, 0.100565963600471325E+06, + 0.100521982301190656E+06, 0.100477536683349797E+06, 0.100432748853070138E+06, 0.100387748961175384E+06, 0.100342674477306704E+06, + 0.100297669466538631E+06, 0.100252883868987425E+06, 0.100208472782261073E+06, 0.100164595745919316E+06, 0.100121416026401625E+06, + 0.100079099900142377E+06, 0.100037815931840771E+06, 0.999981416469988617E+05, 0.999662389876496309E+05, 0.999356748708466621E+05, + 0.999064575822306797E+05, 0.998785877324428584E+05, 0.998520583580002858E+05, 0.998268551135048328E+05, 0.998029565487271466E+05, + 0.997803344633126544E+05, 0.997589543309666333E+05, 0.997387757839643018E+05, 0.997197531476882141E+05, 0.997018360135869007E+05, + 0.996849698374662257E+05, 0.996690965483438340E+05, 0.996541551512074802E+05, 0.996382689559327409E+05, 0.996225861026435014E+05, + 0.996075569737299666E+05, 0.995931690202676109E+05, 0.995794128974490304E+05, 0.995662834351470083E+05, 0.995537804808199580E+05, + 0.995419095816340414E+05, 0.995306824727639178E+05, 0.995201173394836951E+05, 0.995102388219246932E+05, 0.995010777333177539E+05, + 0.994926704652096669E+05, 0.994850580565927958E+05, 0.994782849081547320E+05, 0.994712945317966660E+05, 0.994652135801002441E+05, + 0.994603804881314572E+05, 0.994568932856863394E+05, 0.994548423780885496E+05, 0.994543085284921108E+05, 0.994553608083860745E+05, + 0.994580545552721160E+05, 0.994624293810699601E+05, 0.994689205148530309E+05, 0.994771599445407046E+05, 0.994871232315969537E+05, + 0.994987933987223369E+05, 0.995121358180468815E+05, 0.995270974554495333E+05, 0.995436065119199775E+05, 0.995623452046183083E+05, + 0.995829609157189843E+05, 0.996045871363499173E+05, 0.996270734208106005E+05, 0.996502628846515872E+05, 0.996739938804089179E+05, + 0.996981017517049913E+05, 0.997224206254554738E+05, 0.997467852001343563E+05, 0.997710324871725461E+05, 0.997951466602976434E+05, + 0.998195365345201863E+05, 0.998432686447168817E+05, 0.998661797675172566E+05, 0.998881192989034753E+05, 0.999089497794278432E+05, + 0.999285470134942298E+05, 0.999467997752335650E+05, 0.999636091025751084E+05, 0.999788871899545629E+05, 0.999925558984901872E+05, + 0.100004544910230834E+06, 0.100014789560105870E+06, 0.100022807416958167E+06, 0.100024265952704969E+06, 0.100023783498597622E+06, + 0.100021339437537274E+06, 0.100017269778783608E+06, 0.100011871918673860E+06, 0.100005243624383627E+06, 0.999974886843563872E+05, + 0.999887143337349553E+05, 0.999790290942598513E+05, 0.999685409989449690E+05, 0.999573561671147618E+05, 0.999457665900857537E+05, + 0.999339297350767738E+05, 0.999216537925987359E+05, 0.999089986755408318E+05, 0.998960156700364460E+05, 0.998827458376240684E+05, + 0.998692184851955972E+05, 0.998554496711306274E+05, 0.998414407220986322E+05, 0.998266607131311466E+05, 0.998100194463602238E+05, + 0.997926225952954846E+05, 0.997741943883323111E+05, 0.997546758201429911E+05, 0.997340957313024119E+05, 0.997124527623238246E+05, + 0.996897658681415196E+05, 0.996660748766462057E+05, 0.996414402768971777E+05, 0.996159421531026164E+05, 0.995896781945527619E+05, + 0.995627607309631567E+05, 0.995353127665240754E+05, 0.995074630135256157E+05, 0.994793399566985754E+05, 0.994514054125879338E+05, + 0.994238487412724935E+05, 0.993966902679466439E+05, 0.993700475395201356E+05, 0.993440177799105440E+05, 0.993186743649216805E+05, + 0.992940638036397431E+05, 0.992702032829608506E+05, 0.992470788181921816E+05, 0.992246440384727030E+05, 0.992011645870204229E+05, + 0.991746701100545615E+05, 0.991489545634662645E+05, 0.991241218039765226E+05, 0.991002500071589602E+05, 0.990773923979805404E+05, + 0.990555784783537238E+05, 0.990348157029355934E+05, 0.990159736965085758E+05, 0.989981835313982592E+05, 0.989814199610305950E+05, + 0.989657585620708269E+05, 0.989512713805230014E+05, 0.989380287548638735E+05, 0.989261010103145527E+05, 0.989155600070171640E+05, + 0.989065271083586849E+05, 0.989035472935256403E+05, 0.989017382893972535E+05, 0.989010885106625501E+05, 0.989015950018414442E+05, + 0.989032643180148880E+05, 0.989061129372854630E+05, 0.989101672753579624E+05, 0.989154633681022387E+05, 0.989220462827519368E+05, + 0.989299693127524224E+05, 0.989392930054068274E+05, 0.100824204136130124E+06, 0.100789629875414903E+06, 0.100754101269738283E+06, + 0.100718965766187423E+06, 0.100683784943369043E+06, 0.100647901733698469E+06, 0.100611367338035154E+06, 0.100574242617115160E+06, + 0.100536597536512694E+06, 0.100498510595931759E+06, 0.100460068244709808E+06, 0.100421364285146075E+06, 0.100382499264969942E+06, + 0.100343579859943900E+06, 0.100304718247249199E+06, 0.100266031469940950E+06, 0.100227640792377366E+06, 0.100189671046138596E+06, + 0.100152249965554060E+06, 0.100115507511560325E+06, 0.100079575182221481E+06, 0.100047602801154819E+06, 0.100019322376832803E+06, + 0.999920409995853261E+05, 0.999657674355637573E+05, 0.999405058915761474E+05, 0.999162559646318405E+05, 0.998930126550737332E+05, + 0.998707664374257292E+05, 0.998495033822863334E+05, 0.998292053217475768E+05, 0.998098500498988724E+05, 0.997914115489896358E+05, + 0.997738602307620895E+05, 0.997571631813267886E+05, 0.997412843967411318E+05, 0.997261849951640761E+05, 0.997116241750995250E+05, + 0.996956516613714484E+05, 0.996802443385057850E+05, 0.996654141346137912E+05, 0.996511746410201595E+05, 0.996375414807133056E+05, + 0.996245325880948803E+05, 0.996121683814974822E+05, 0.996004718105865177E+05, 0.995894682617738144E+05, 0.995791853061816655E+05, + 0.995696522765213740E+05, 0.995608996615122596E+05, 0.995529583091799286E+05, 0.995458584335334599E+05, 0.995396284227406868E+05, + 0.995343367855710967E+05, 0.995305561580702051E+05, 0.995281233336275036E+05, 0.995270277929425938E+05, 0.995273063084702299E+05, + 0.995289897428417025E+05, 0.995321019769720151E+05, 0.995366588694784150E+05, 0.995426672761023801E+05, 0.995501241589093697E+05, + 0.995590158153962548E+05, 0.995693172571642208E+05, 0.995809917664462992E+05, 0.995939906564428093E+05, 0.996082532580851985E+05, + 0.996237071514999261E+05, 0.996402686551040679E+05, 0.996578435789826035E+05, 0.996763282420650648E+05, 0.996956299728876329E+05, + 0.997162410862197139E+05, 0.997372387307632453E+05, 0.997586353656998253E+05, 0.997808433601890720E+05, 0.998030187608370179E+05, + 0.998249872889569233E+05, 0.998465794208683947E+05, 0.998676313277232548E+05, 0.998879856224390824E+05, 0.999074918951320724E+05, + 0.999260070231147402E+05, 0.999433952465451439E+05, 0.999595280060564692E+05, 0.999742835440646595E+05, 0.999875462768208236E+05, + 0.999992059495608264E+05, 0.100009156592205647E+06, 0.100016063172606460E+06, 0.100019024917317467E+06, 0.100020084175617667E+06, + 0.100019327613303438E+06, 0.100016848817808917E+06, 0.100012745044390162E+06, 0.100007114161981110E+06, 0.100000051820447916E+06, + 0.999916488518789411E+05, 0.999819889104085451E+05, 0.999711463483044645E+05, 0.999591843210265215E+05, 0.999461531109617499E+05, + 0.999321525809828890E+05, 0.999172469778668019E+05, 0.999013989306642325E+05, 0.998846455567706289E+05, 0.998670119376398798E+05, + 0.998485130268999492E+05, 0.998291555936072982E+05, 0.998089401641651202E+05, 0.997878629283593327E+05, 0.997659175757975609E+05, + 0.997430970289848337E+05, 0.997193950386116485E+05, 0.996948076057053986E+05, 0.996688019987970183E+05, 0.996412728663371527E+05, + 0.996128531282160839E+05, 0.995835822131826571E+05, 0.995535100083936413E+05, 0.995226963046177698E+05, 0.994912096890770918E+05, + 0.994591258685886423E+05, 0.994265254172218556E+05, 0.993934909557864739E+05, 0.993601037847762636E+05, 0.993264400074980804E+05, + 0.992925661955399555E+05, 0.992585346639741329E+05, 0.992243784382298763E+05, 0.991926785386021656E+05, 0.991631423960881948E+05, + 0.991346701590620942E+05, 0.991043957205902552E+05, 0.990738404866020282E+05, 0.990437385072277393E+05, 0.990142493709584378E+05, + 0.989855195191612147E+05, 0.989576810877346288E+05, 0.989308511084253696E+05, 0.989051310684979690E+05, 0.988806068206827622E+05, + 0.988573488291608082E+05, 0.988354127318868268E+05, 0.988148401948802202E+05, 0.987956600302788138E+05, 0.987778895469693816E+05, + 0.987615361004738952E+05, 0.987465988074585912E+05, 0.987330703896907362E+05, 0.987209391124356771E+05, 0.987108234055703360E+05, + 0.987097019913824042E+05, 0.987103429529451387E+05, 0.987122111650228762E+05, 0.987153073516145814E+05, 0.987196321217762743E+05, + 0.987251875827369804E+05, 0.987319785667343094E+05, 0.987400135082831985E+05, 0.987493050090511242E+05, 0.987598701271371101E+05, + 0.987717304264797713E+05, 0.987849118205066625E+05, 0.987994442421061685E+05, 0.100725315299336173E+06, 0.100698574995327697E+06, + 0.100671977068823689E+06, 0.100644595052366465E+06, 0.100616468093977863E+06, 0.100587642901921921E+06, 0.100558173361375360E+06, + 0.100528120104899528E+06, 0.100497550042423565E+06, 0.100466272904751735E+06, 0.100434015096099785E+06, 0.100401562459773442E+06, + 0.100368989820934105E+06, 0.100336376879503077E+06, 0.100303807689072302E+06, 0.100271370122519947E+06, 0.100239155324566673E+06, + 0.100207257151323618E+06, 0.100175771596705425E+06, 0.100144796205413048E+06, 0.100114429472040734E+06, 0.100088940515445298E+06, + 0.100064277849083956E+06, 0.100040376776062651E+06, 0.100017243413296688E+06, 0.999948816446533019E+05, 0.999732929686431889E+05, + 0.999524763863759727E+05, 0.999324283249947912E+05, 0.999131425911760016E+05, 0.998946103486297798E+05, 0.998768201128693472E+05, + 0.998597577558295598E+05, 0.998434065122163738E+05, 0.998277469787591108E+05, 0.998127570968272776E+05, 0.997984121081719059E+05, + 0.997846844728672440E+05, 0.997711641937448148E+05, 0.997562547182444541E+05, 0.997418715469619347E+05, 0.997280378138771339E+05, + 0.997149197421024874E+05, 0.997024870178837737E+05, 0.996907061322415975E+05, 0.996795848806745926E+05, 0.996691347733205621E+05, + 0.996593714260480774E+05, 0.996503148183509184E+05, 0.996419894088608416E+05, 0.996344241017298482E+05, 0.996276520598402276E+05, + 0.996217103637612599E+05, 0.996166395185360743E+05, 0.996124828137155564E+05, 0.996092855454927922E+05, 0.996072490608482622E+05, + 0.996076113749229989E+05, 0.996091697144805221E+05, 0.996119324075692421E+05, 0.996159015340781625E+05, 0.996210724174448842E+05, + 0.996274331797853811E+05, 0.996349643746027868E+05, 0.996436387104583700E+05, 0.996534208777727908E+05, 0.996642674892599607E+05, + 0.996761271423777071E+05, 0.996889406096304010E+05, 0.997026411596077960E+05, 0.997171550083373149E+05, 0.997324018969322351E+05, + 0.997493713951271493E+05, 0.997669298086039198E+05, 0.997847561118552549E+05, 0.998027246306509041E+05, 0.998207116516734968E+05, + 0.998385964503245486E+05, 0.998562622533936083E+05, 0.998740649961419404E+05, 0.998916906165886030E+05, 0.999087089343172702E+05, + 0.999249770553750277E+05, 0.999403560696216737E+05, 0.999547111717594089E+05, 0.999679116588610341E+05, 0.999798308071318752E+05, + 0.999903456338236865E+05, 0.999993365533926699E+05, 0.100004220125714884E+06, 0.100007207317976179E+06, 0.100008572293640507E+06, + 0.100008322094038289E+06, 0.100006474067698131E+06, 0.100003053654514384E+06, 0.999980922203631635E+05, 0.999916249686873634E+05, + 0.999836889524048456E+05, 0.999743212064066029E+05, 0.999635570180646901E+05, 0.999514283507113723E+05, 0.999379624331032392E+05, + 0.999231805265346338E+05, 0.999068710521996836E+05, 0.998889830637409177E+05, 0.998698844492443604E+05, 0.998496268247692351E+05, + 0.998282550606056902E+05, 0.998058081407207792E+05, 0.997823201056188700E+05, 0.997578210428315797E+05, 0.997323380908236431E+05, + 0.997058964236216998E+05, 0.996785201849737350E+05, 0.996502333423933014E+05, 0.996210604331023060E+05, 0.995910271757503942E+05, + 0.995601609239409008E+05, 0.995275572850741737E+05, 0.994942010526460217E+05, 0.994602086162104097E+05, 0.994256424562004540E+05, + 0.993905674250224547E+05, 0.993550495610398939E+05, 0.993191545857771562E+05, 0.992829460972773086E+05, 0.992464834802344849E+05, + 0.992093627746182028E+05, 0.991704192318807618E+05, 0.991313574404489191E+05, 0.990923405318182195E+05, 0.990535358095906413E+05, + 0.990151121756168286E+05, 0.989772373919561505E+05, 0.989400752255912812E+05, 0.989077617710938066E+05, 0.988763612273478793E+05, + 0.988459508623079601E+05, 0.988166439660097676E+05, 0.987885464355162840E+05, 0.987617561295779306E+05, 0.987363624383705755E+05, + 0.987124460655073344E+05, 0.986900790161369223E+05, 0.986693247818405216E+05, 0.986502387102765642E+05, 0.986328685451310157E+05, + 0.986172551199377485E+05, 0.986034331877511868E+05, 0.985914323674813641E+05, 0.985849022212989948E+05, 0.985815381689221977E+05, + 0.985799833097597439E+05, 0.985801745721993211E+05, 0.985820463347552868E+05, 0.985855324877461535E+05, 0.985905682465279388E+05, + 0.985970917144189152E+05, 0.986050451971537113E+05, 0.986143762739106751E+05, 0.986250386326789885E+05, 0.986369926800004905E+05, + 0.986502059369656636E+05, 0.986646532347960892E+05, 0.986803686823803437E+05, 0.986978893846687570E+05, 0.100614832696455240E+06, + 0.100593867821148029E+06, 0.100572316446986515E+06, 0.100550197550235505E+06, 0.100527535703133908E+06, 0.100504360904461792E+06, + 0.100480708372667563E+06, 0.100456618304392017E+06, 0.100432135601374786E+06, 0.100407309568833982E+06, 0.100382193588466369E+06, + 0.100356844769226343E+06, 0.100331323579001226E+06, 0.100305693460217895E+06, 0.100280020432285120E+06, 0.100254372683605921E+06, + 0.100228820155686772E+06, 0.100203434121630358E+06, 0.100178286761032883E+06, 0.100153450733022924E+06, 0.100130475669895299E+06, + 0.100109956889046269E+06, 0.100089889070985242E+06, 0.100070296914338702E+06, 0.100051202164876013E+06, 0.100032623579079911E+06, + 0.100014576934231576E+06, 0.999970750815462088E+05, 0.999801280379814852E+05, 0.999637431114950741E+05, 0.999479250537698827E+05, + 0.999326762337752152E+05, 0.999179968250171223E+05, 0.999038849989644077E+05, 0.998903371169458405E+05, 0.998773479128125327E+05, + 0.998649106588674185E+05, 0.998530173079915839E+05, 0.998416586055586959E+05, 0.998308241656294995E+05, 0.998183931314519723E+05, + 0.998063026544255990E+05, 0.997946768033270637E+05, 0.997835353574148758E+05, 0.997728988116216497E+05, 0.997627886474906263E+05, + 0.997532275467060972E+05, 0.997442395412217011E+05, 0.997358500950898597E+05, 0.997280861143391958E+05, 0.997209758826208854E+05, + 0.997145489218259900E+05, 0.997088357784521941E+05, 0.997038677381365414E+05, 0.996996764724488748E+05, 0.996962936237215035E+05, + 0.996937503353465436E+05, 0.996920767365576030E+05, 0.996913013921977254E+05, 0.996914507293131610E+05, 0.996938892044791864E+05, + 0.996979235599974199E+05, 0.997029058021154924E+05, 0.997088141832942201E+05, 0.997156214047231770E+05, 0.997232945456081070E+05, + 0.997317950535919081E+05, 0.997416867970129533E+05, 0.997530959050235106E+05, 0.997652059203542885E+05, 0.997779192013086576E+05, + 0.997911354948921798E+05, 0.998047524629107502E+05, 0.998186662279794255E+05, 0.998327719289349043E+05, 0.998469642740837880E+05, + 0.998611380798811879E+05, 0.998751887820599950E+05, 0.998890129059611209E+05, 0.999025084828911640E+05, 0.999155753997843713E+05, + 0.999281156702924636E+05, 0.999400336166881025E+05, 0.999512359536410950E+05, 0.999616317670096760E+05, 0.999711323832548660E+05, + 0.999796511279028782E+05, 0.999849269357346784E+05, 0.999879656837563089E+05, 0.999896251175745128E+05, 0.999900253003605030E+05, + 0.999893361854775139E+05, 0.999873542140159407E+05, 0.999840556297011499E+05, 0.999794245840091753E+05, 0.999734518744631496E+05, + 0.999661337157758971E+05, 0.999574705623641785E+05, 0.999474659997932467E+05, 0.999361257217314414E+05, 0.999234566080410732E+05, + 0.999094659187412326E+05, 0.998941606177814683E+05, 0.998764809352623415E+05, 0.998560560817922524E+05, 0.998343967946635821E+05, + 0.998115510889874568E+05, 0.997875653304692096E+05, 0.997624843255732849E+05, 0.997363514996802405E+05, 0.997092091386610118E+05, + 0.996810986700549984E+05, 0.996520609610099054E+05, 0.996221366113048280E+05, 0.995913662211383053E+05, 0.995597906149207993E+05, + 0.995273916799414146E+05, 0.994941482859833632E+05, 0.994601365478679945E+05, 0.994253058448178053E+05, 0.993891469979643734E+05, + 0.993522589965478983E+05, 0.993147135957212886E+05, 0.992765913082987827E+05, 0.992379812368316198E+05, 0.991989807125657680E+05, + 0.991596947441791563E+05, 0.991202352822574612E+05, 0.990807203086648369E+05, 0.990412727632243623E+05, 0.990020193233719183E+05, + 0.989630890556004597E+05, 0.989246119604841224E+05, 0.988867174357804033E+05, 0.988495326844704396E+05, 0.988131810965392942E+05, + 0.987777806347563455E+05, 0.987434422556348145E+05, 0.987102683970903163E+05, 0.986800386904530314E+05, 0.986539370199152036E+05, + 0.986295226205249346E+05, 0.986068636404624995E+05, 0.985860239517589507E+05, 0.985670631337701197E+05, 0.985500365691113984E+05, + 0.985358556718200416E+05, 0.985278808654735767E+05, 0.985216145256253949E+05, 0.985170549437755544E+05, 0.985141907191163773E+05, + 0.985130023621957516E+05, 0.985134638334888878E+05, 0.985155439987927239E+05, 0.985192079865073320E+05, 0.985244184348827694E+05, + 0.985311366201568162E+05, 0.985393234591571963E+05, 0.985489403823850007E+05, 0.985599500758101349E+05, 0.985723170916025701E+05, + 0.985860083297847013E+05, 0.986009933943283249E+05, 0.986172448285415594E+05, 0.986347382357068564E+05, 0.986534522918489238E+05, + 0.100501068864754794E+06, 0.100484535396120875E+06, 0.100467601980879481E+06, 0.100450280398188552E+06, 0.100432586236747622E+06, + 0.100414538813697291E+06, 0.100396161067221547E+06, 0.100377479424244724E+06, 0.100358523644725865E+06, 0.100339326644139262E+06, + 0.100319924295798162E+06, 0.100300355214719486E+06, 0.100280660524754756E+06, 0.100260883610713514E+06, 0.100241069857193317E+06, + 0.100221266375801104E+06, 0.100201521722408346E+06, 0.100181885606032156E+06, 0.100162408590875246E+06, 0.100143141793000657E+06, + 0.100126731204709198E+06, 0.100111095964644017E+06, 0.100095755686584438E+06, 0.100080729264227775E+06, 0.100066034373636823E+06, + 0.100051687390123538E+06, 0.100037703324969872E+06, 0.100024095780550211E+06, 0.100010876922054129E+06, 0.999980574636844394E+05, + 0.999856466669404908E+05, 0.999736523483940109E+05, 0.999620808942374570E+05, 0.999509372788386972E+05, 0.999402250845782837E+05, + 0.999299465203828877E+05, 0.999201024366045604E+05, 0.999106923342315858E+05, 0.999017143668564822E+05, 0.998931653343625367E+05, + 0.998850406679233711E+05, 0.998765024783978733E+05, 0.998667989571770595E+05, 0.998574263414941233E+05, 0.998484104846885893E+05, + 0.998397772139483568E+05, 0.998315523922983994E+05, 0.998237619509676297E+05, 0.998164318901620281E+05, 0.998095882469221542E+05, + 0.998032570294378238E+05, 0.997974641179290484E+05, 0.997922351329589583E+05, 0.997875952728177945E+05, 0.997835691223818721E+05, + 0.997801804366022552E+05, 0.997774519024890033E+05, 0.997754048841174226E+05, 0.997740591557720181E+05, 0.997734326288465818E+05, + 0.997735410785172280E+05, 0.997747073495277582E+05, 0.997769755457649590E+05, 0.997800038461367949E+05, 0.997839110555756342E+05, + 0.997903666077980015E+05, 0.997975557260811329E+05, 0.998054075409305369E+05, 0.998138481350147340E+05, 0.998228007968337915E+05, + 0.998321862933507946E+05, 0.998419231581400672E+05, 0.998519279910743644E+05, 0.998621157651026879E+05, 0.998724001352771593E+05, + 0.998826937448957033E+05, 0.998929085234460072E+05, 0.999029559709882014E+05, 0.999127474237070273E+05, 0.999221942956127314E+05, + 0.999312082917789958E+05, 0.999397015890797338E+05, 0.999475869811254670E+05, 0.999547779849950166E+05, 0.999611889084034483E+05, + 0.999655508333875332E+05, 0.999687521058104176E+05, 0.999708756209590647E+05, 0.999718892905484245E+05, 0.999717672485314106E+05, + 0.999704891389138356E+05, 0.999680393573227484E+05, 0.999644062616458687E+05, 0.999595813666838658E+05, 0.999535585371076886E+05, + 0.999463331921408535E+05, 0.999379015343325445E+05, 0.999282598136142769E+05, 0.999174036365871580E+05, 0.999053273297332198E+05, + 0.998920233640268561E+05, 0.998774818472951010E+05, 0.998616900896773586E+05, 0.998432094200693391E+05, 0.998215258930813725E+05, + 0.997986442532860819E+05, 0.997746159978670912E+05, 0.997494898657428857E+05, 0.997233122677003994E+05, 0.996961277569055965E+05, + 0.996679795269207534E+05, 0.996389099249155406E+05, 0.996089609684258903E+05, 0.995781748547828611E+05, 0.995465944531801651E+05, + 0.995142637702681968E+05, 0.994812283811399975E+05, 0.994475358185973892E+05, 0.994132359146495874E+05, 0.993783810892878100E+05, + 0.993430265826917603E+05, 0.993072306281462952E+05, 0.992699361805924273E+05, 0.992322369590151648E+05, 0.991942880496349680E+05, + 0.991561790488717525E+05, 0.991180035697510175E+05, 0.990798588542613288E+05, 0.990418452912010980E+05, 0.990040658471643255E+05, + 0.989666254199359537E+05, 0.989296301250896213E+05, 0.988931865279689664E+05, 0.988574008344593603E+05, 0.988223780549877847E+05, + 0.987882211569994834E+05, 0.987550302217251592E+05, 0.987229016213559953E+05, 0.986919272327695508E+05, 0.986621937036891904E+05, + 0.986337817866148835E+05, 0.986067657550310105E+05, 0.985855251179539773E+05, 0.985675277620845591E+05, 0.985515831726142933E+05, + 0.985391751050558669E+05, 0.985310659201639937E+05, 0.985245080408891663E+05, 0.985195088048070465E+05, 0.985160685473306512E+05, + 0.985141813574870466E+05, 0.985138358391387155E+05, 0.985150158641151211E+05, 0.985177013051926042E+05, 0.985218687383599317E+05, + 0.985274921053063881E+05, 0.985345433285448526E+05, 0.985429928730166866E+05, 0.985528102493964543E+05, 0.985639644556170097E+05, + 0.985764243543491611E+05, 0.985901589852987236E+05, 0.986051378122090100E+05, 0.986213309053895937E+05, 0.986387090614195185E+05, + 0.986574141307979880E+05 }; -#define NLON 81 +#define NLON 81 #define NLAT 166 -static void encode_decode (double * zval, const char * packingType, const int bitsPerValue, const int ioptimizeScaleFactor) +static void encode_decode(double* zval, const char* packingType, const int bitsPerValue, const int ioptimizeScaleFactor) { size_t len, slen; - grib_handle * h; + grib_handle* h; - GRIB_CHECK (((h = grib_handle_new_from_samples (NULL, "regular_ll_pl_grib2")) == NULL), 0); - GRIB_CHECK (grib_set_long (h, "Ni", NLON), 0); - GRIB_CHECK (grib_set_long (h, "Nj", NLAT), 0); - slen = strlen (packingType); - GRIB_CHECK (grib_set_string (h, "packingType", packingType, &slen), 0); - GRIB_CHECK (grib_set_long (h, "bitsPerValue", bitsPerValue), 0); - GRIB_CHECK (grib_set_long (h, "optimizeScaleFactor", ioptimizeScaleFactor), 0); + GRIB_CHECK(((h = grib_handle_new_from_samples(NULL, "regular_ll_pl_grib2")) == NULL), 0); + GRIB_CHECK(grib_set_long(h, "Ni", NLON), 0); + GRIB_CHECK(grib_set_long(h, "Nj", NLAT), 0); + slen = strlen(packingType); + GRIB_CHECK(grib_set_string(h, "packingType", packingType, &slen), 0); + GRIB_CHECK(grib_set_long(h, "bitsPerValue", bitsPerValue), 0); + GRIB_CHECK(grib_set_long(h, "optimizeScaleFactor", ioptimizeScaleFactor), 0); len = NLON * NLAT; - GRIB_CHECK (grib_set_double_array (h, "values", values, len), 0); - GRIB_CHECK (grib_get_double_array (h, "values", zval, &len), 0); + GRIB_CHECK(grib_set_double_array(h, "values", values, len), 0); + GRIB_CHECK(grib_get_double_array(h, "values", zval, &len), 0); - GRIB_CHECK (grib_handle_delete (h), 0); + GRIB_CHECK(grib_handle_delete(h), 0); } -static double calc_error (double * zval1, double * zval2) +static double calc_error(double* zval1, double* zval2) { int i; double zerr = 0; @@ -2741,56 +2741,49 @@ static double calc_error (double * zval1, double * zval2) for (i = 0; i < NLON * NLAT; i++) zerr += (zval2[i] - zval1[i]) * (zval2[i] - zval1[i]); - return sqrt (zerr); + return sqrt(zerr); } -int main (int argc, char * argv[]) +int main(int argc, char* argv[]) { - int bitsPerValue[11] = {8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18}; + int bitsPerValue[11] = { 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 }; int ipackingType, ibitsPerValue, ioptimizeScaleFactor; for (ibitsPerValue = 0; ibitsPerValue < 11; ibitsPerValue++) - for (ipackingType = 0; ipackingType < 2; ipackingType++) - { + for (ipackingType = 0; ipackingType < 2; ipackingType++) { double zval_simple[NLAT * NLON]; double zval_second[NLAT * NLON]; double zerr; - encode_decode (zval_simple, "grid_simple", bitsPerValue[ibitsPerValue], 1); - encode_decode (zval_second, "grid_second_order", bitsPerValue[ibitsPerValue], 1); + encode_decode(zval_simple, "grid_simple", bitsPerValue[ibitsPerValue], 1); + encode_decode(zval_second, "grid_second_order", bitsPerValue[ibitsPerValue], 1); - zerr = calc_error (zval_simple, zval_second); + zerr = calc_error(zval_simple, zval_second); - if (zerr > 0.) - { - printf ("Second order packing does not reproduce simple packing with optimizeScaleFactor=1\n"); + if (zerr > 0.) { + printf("Second order packing does not reproduce simple packing with optimizeScaleFactor=1\n"); return 1; } - } - printf (" %30s %30s %30s %s\n", "bitsPerValue", "error(optimizeScaleFactor=0)", "error(optimizeScaleFactor=1)", "ratio"); - for (ibitsPerValue = 0; ibitsPerValue < 11; ibitsPerValue++) - { + printf(" %30s %30s %30s %s\n", "bitsPerValue", "error(optimizeScaleFactor=0)", "error(optimizeScaleFactor=1)", "ratio"); + for (ibitsPerValue = 0; ibitsPerValue < 11; ibitsPerValue++) { double zerr[2]; double ratio = 0; - for (ioptimizeScaleFactor = 0; ioptimizeScaleFactor < 2; ioptimizeScaleFactor++) - { + for (ioptimizeScaleFactor = 0; ioptimizeScaleFactor < 2; ioptimizeScaleFactor++) { double zval[NLAT * NLON]; - encode_decode (zval, "grid_simple", bitsPerValue[ibitsPerValue], ioptimizeScaleFactor); - zerr[ioptimizeScaleFactor] = calc_error (zval, values); + encode_decode(zval, "grid_simple", bitsPerValue[ibitsPerValue], ioptimizeScaleFactor); + zerr[ioptimizeScaleFactor] = calc_error(zval, values); } - ratio = zerr[0]/zerr[1]; - printf (" %30d %30.9e %30.9e %g\n", bitsPerValue[ibitsPerValue], zerr[0], zerr[1], ratio); + ratio = zerr[0] / zerr[1]; + printf(" %30d %30.9e %30.9e %g\n", bitsPerValue[ibitsPerValue], zerr[0], zerr[1], ratio); - if ((ratio < 1.90) || (ratio > 2.00)) - { - printf ("Packing error too big: optimizeScaleFactor appears to be broken (zerr[0]/zerr[1]=%g)\n", ratio); + if ((ratio < 1.90) || (ratio > 2.00)) { + printf("Packing error too big: optimizeScaleFactor appears to be broken (zerr[0]/zerr[1]=%g)\n", ratio); return 1; } - } return 0; diff --git a/tests/grib_optimize_scaling_sh.c b/tests/grib_optimize_scaling_sh.c index 1536942cd..a4cf7d770 100644 --- a/tests/grib_optimize_scaling_sh.c +++ b/tests/grib_optimize_scaling_sh.c @@ -16,286 +16,279 @@ */ static double values[] = { - 2.78565217180879301395e+02, 0.00000000000000000000e+00, 8.38367712240454920902e-01, 0.00000000000000000000e+00, -7.22151022768738215518e-01, - 0.00000000000000000000e+00, 1.54447137639483056404e+00, 0.00000000000000000000e+00, -8.10351659720698336287e-01, 0.00000000000000000000e+00, - 6.45930713064333694717e-01, 0.00000000000000000000e+00, -1.73417955255619204991e-01, 0.00000000000000000000e+00, -9.09351867483918913093e-02, - 0.00000000000000000000e+00, -3.00845517613623769648e-02, 0.00000000000000000000e+00, -1.97522108657794209785e-01, 0.00000000000000000000e+00, - 1.45006392199800160370e-01, 0.00000000000000000000e+00, -6.92319525648382033678e-02, 0.00000000000000000000e+00, -3.37495245995370396486e-01, - 0.00000000000000000000e+00, 2.93969252845082296144e-01, 0.00000000000000000000e+00, 5.22791676917648828748e-02, 0.00000000000000000000e+00, - -4.31020055899014042922e-02, 0.00000000000000000000e+00, -5.34277055570271386387e-02, 0.00000000000000000000e+00, 1.57725778753141337996e-01, - 0.00000000000000000000e+00, -1.38048966071163903280e-01, 0.00000000000000000000e+00, 7.95936533884674390915e-02, 0.00000000000000000000e+00, - -5.08988096408558021722e-03, 0.00000000000000000000e+00, -3.17356690459940984916e-02, 0.00000000000000000000e+00, -7.97854100625838141836e-02, - 0.00000000000000000000e+00, -1.25759522048120825355e-01, 0.00000000000000000000e+00, 1.41095505007377608475e-01, 0.00000000000000000000e+00, - -2.90041709701537933630e-02, 0.00000000000000000000e+00, 1.16118748810570035501e-01, 0.00000000000000000000e+00, -1.42650207377574778089e-01, - 0.00000000000000000000e+00, 6.63859656709936268859e-02, 0.00000000000000000000e+00, -8.43008351127146754456e-02, 0.00000000000000000000e+00, - 8.11805506119530340126e-02, 0.00000000000000000000e+00, -2.92579106275835476580e+00, -2.73257362252726822283e-02, -2.31503061096297768628e+00, - 2.98481883110496337697e-01, 2.32422954464165210098e+00, -9.36624989809203695179e-02, -1.13647173814196378316e+00, -4.24970312443540054748e-01, - 1.26754821773852066613e+00, -7.20859094680278700285e-02, -9.51306475614490221204e-01, 6.14867632012408793507e-01, -9.85091038732955892598e-02, - -6.34523215803268758606e-02, -6.78708060411115782218e-02, -1.35311523427619539994e-01, -9.04935301775932621204e-02, -9.78101007785831533248e-02, - -9.81097374871810895547e-04, 1.80616098092357818539e-02, -2.64791786212412172397e-02, -4.76558495508507054539e-02, -1.96341419265033012564e-01, - 3.40906457596743608929e-02, -7.81262194523913988675e-02, -1.90201799489863598858e-01, 2.25178750048809411810e-01, 2.86704542482240504198e-03, - -1.19805102746233238520e-02, 1.68969022321052431135e-02, 5.64738950483129331648e-02, -1.39757566954298140249e-01, -7.44084433787887133960e-02, - -1.79448737058076172868e-02, 6.14333363921325120716e-02, 4.42090839521651901567e-02, -1.59177621940344016238e-02, -2.45259140787589882682e-02, - 4.14722887926062475095e-02, -9.08467249754976585718e-02, 7.32634132869659504550e-02, 3.98083190502361433660e-02, -6.23330309466623433412e-02, - 3.23061735747387016038e-02, 5.24308078374175548508e-02, -6.52853670335678676340e-02, -4.74582205706168894221e-02, -2.57646217050176394581e-02, - 4.85326601320503064896e-02, 4.57836316487753580695e-02, -1.61395013977115135695e-02, -4.31399408593192076888e-02, -1.72982609465274252136e-02, - 2.05141743795376405024e-02, 5.13479785723864323721e-02, 2.02753965345298277356e-02, -9.62325942856205422682e-03, -1.21013000039295196344e-03, - 4.61377663687331032727e-02, -6.90153405245983028390e-04, -1.66104804699747843344e+00, 1.79666906865138087390e-01, 7.23133875761683864170e-01, - 4.15103729262486009777e-01, -3.04359433047895144853e-01, -1.33601223735748869670e-01, 1.11896993727331572899e+00, -5.97930191729183602156e-01, - -3.21482407719980045613e-01, -6.44440729482515239912e-02, -1.39643167588630684461e-01, -7.87344252201049310536e-02, -2.74194962741515224636e-01, - 3.16014987883590156570e-02, 2.61916687188788577245e-01, -2.29041295889389484586e-01, 1.37413993896893793512e-02, 1.02848928276271345261e-01, - -8.45943398257167356036e-02, -8.55836430183285895579e-02, -2.14692485939022847941e-02, -5.00660400534810728912e-02, 4.10286932308298671335e-02, - 5.98356967342531728682e-02, -6.87268417209678655899e-02, -1.00834342061879356223e-01, 2.89946855441678558174e-02, 6.84096422422015987275e-02, - 7.90905646811665974383e-02, 1.22761627402924594632e-02, -7.19296897992387496146e-02, -1.19563518571031840443e-01, 3.53949764125303933948e-02, - 3.49389806984224948749e-02, -1.34556768717593006057e-01, 1.30036738800839157815e-01, 1.47453022488737178763e-01, -1.75187106897877128975e-02, - -5.71655857598896560701e-02, -2.22513683371899778640e-02, 5.11984135243400070858e-02, 4.32198440146361120839e-02, -3.79006811678369512353e-02, - -1.61948869817943215399e-02, 5.87864730303968852088e-02, 7.56143666040565154418e-03, 3.79735451815043784096e-02, 4.88357571184367539319e-03, - -3.44600211423619568266e-03, 8.45175251030964858057e-03, 2.06501052974025246789e-02, -2.27945980601942863042e-02, 7.52792623890808781928e-02, - -4.07335076464383702421e-02, -1.22373247319515162691e-03, 7.12818582736400585542e-03, -2.08797409246280901707e-02, 2.35344435031375059930e-02, - 5.38553837448995376125e-02, 2.29385900837120154661e-01, -3.60512186055045147359e-01, 4.09262094434219958483e-01, -1.43204915316633707434e-01, - 1.76661646314910159017e-01, 1.59424540157772631765e-01, 1.19996653025061628117e-01, 9.74032138671445946176e-02, 8.01756516767066496065e-02, - -4.22092435868048232450e-01, 3.42598707334977881089e-01, 7.26427774784764446192e-02, -1.92869792680440410582e-04, -9.14800737566894561770e-02, - 1.86904852575672325576e-01, 9.03785536307215725538e-02, -8.70628859333670845899e-02, -1.20357023393743836626e-01, 1.30276821268167974921e-01, - -5.50418496727855255379e-02, -1.39930929689677463479e-01, -4.10997318303747902202e-02, 1.66027061444833590187e-01, -3.31025873454900559922e-02, - 5.45967001368218574076e-02, -1.86051192758042188702e-01, 3.57669212138109621213e-02, 1.96823682403928168494e-01, 1.12736638944959083330e-01, - -1.18563060708320622272e-01, -7.11264215849067293895e-02, -3.33098969956449747487e-02, 4.88100702343404121986e-02, 2.04094083090545080905e-02, - 7.78285563663724117012e-02, -4.14113893806803898268e-02, 1.26375672481289953730e-02, 1.38745116741378599068e-01, -8.57558938152793923115e-03, - -9.29289689333271246019e-02, -8.27276771926104548260e-02, 5.84956615429012907748e-02, 2.29399633044502938156e-03, -2.09824524198216422546e-03, - -2.30538708704958079931e-02, 3.77132043821169771203e-02, 6.53337758882697045015e-02, -3.06667712165429387494e-02, -1.14650515581519504144e-02, - 1.46194883433694872849e-02, 3.46636747707448856712e-03, -4.35546278336838635359e-02, 6.29051255528407793349e-02, 6.12210568933847180256e-03, - 2.07571937975545607602e-02, 3.35768305063385619214e-01, 7.46266949448459948613e-01, -6.72463631746016698987e-02, -1.94536700956528363360e-01, - -2.75088750614828209118e-02, 1.42328699967799371384e-01, 3.35288125725375085739e-01, 1.29661987766008346412e-01, 2.90956042046801172107e-02, - -2.05442280573112395770e-01, -9.57252926974513779212e-02, -9.10355774240597659386e-02, -1.25784172798783761005e-01, 1.12460127036075691054e-01, - 9.44013754824246931197e-02, -6.05135930061245497225e-02, 9.42673278665148578481e-02, 2.00615512602382500829e-01, -5.92185875904504069323e-02, - -2.28592246943101873313e-01, -1.07412950490968162054e-01, 2.20172956055192214908e-01, 3.33294698669218958376e-01, -4.44283179185198731642e-02, - -1.01766394690480529994e-01, 1.17472184755037761805e-01, 1.04892483649878465179e-01, -6.62468314716531808672e-02, -2.45565086356498013531e-03, - 4.79072727765457034854e-02, -7.97766729243851169251e-04, -2.33714338875874692858e-02, -2.56642787088907850523e-02, -9.62514763421860042314e-02, - 3.99383399281938444858e-02, 2.88865653017884548015e-02, -5.15182520475396393822e-02, 8.26498791523299636275e-02, -2.98742841129583554249e-02, - -8.28182978045203938011e-02, 3.14455026979475749105e-02, -1.53345808562610789669e-03, -3.62400610998830294274e-02, -2.51728077975302867719e-02, - -3.02379015962623703961e-02, 2.68910770206758423240e-02, -8.22634968902352312070e-03, 3.66544933660152699728e-02, 1.32356634436242674713e-02, - 3.21880247207419244518e-03, -1.97571016662111687001e-02, 5.93796945717029508310e-03, -4.31413602924163308572e-02, -2.72339719264069676785e-02, - -1.87274725743593273286e-01, 1.39283127485721136551e-01, 4.74963034217010249272e-01, -3.42073553333540392174e-01, 4.83885077044606606855e-02, - -2.59068005795831224347e-01, -2.13264680765766156956e-01, -7.36008484860203593403e-02, -8.13152420843461926081e-02, -1.21927665578479005326e-02, - 1.79904544651649317411e-01, -1.09959740517953624694e-01, -2.22065490779929819443e-01, 7.14015849729179447047e-02, -5.85031872787839662964e-03, - 9.72943249874637094976e-02, 1.58464145663301525513e-01, -6.23660570620122936547e-02, -2.05086286960385583145e-01, -5.07929431274403847540e-02, - 4.21897204870116185327e-02, -6.99935466206487028051e-02, -6.71348953496629374804e-02, 1.65743074443523596972e-01, 8.56850642116062655163e-02, - -1.19953810412321809631e-01, -7.40173516101229334030e-02, 1.18865945768013535344e-02, -7.71584669380707965924e-02, -6.31283399388396088137e-02, - -1.45882854372074655114e-01, 6.29307315713034526317e-02, 1.48912624660626508738e-02, -6.72819324032104260080e-02, 3.22547499735358483841e-02, - 4.97387743825052491831e-02, -5.43073271907661761504e-02, 1.52590958854153246893e-02, 2.92721489192738311066e-03, -1.87663839736718872364e-02, - -3.80050872053503069684e-03, 5.91273447672226934446e-02, -2.83684585809016896404e-03, 1.70512827209476636181e-02, -1.44259815516434488497e-02, - -8.06597987912826830392e-02, 5.19954562777717940736e-02, 1.09504480128524081528e-02, 1.26439885486616093030e-02, -2.34593647937779382559e-03, - 2.47413111762442641806e-02, -6.13559850860111253429e-03, -6.05626633742831349538e-02, -1.98467175793774985859e-01, 3.18979113074946862838e-01, - 6.23356771079433893967e-02, 1.30138108749532965813e-01, -1.05230501466137910116e-01, -6.87754575227078057686e-02, -4.22436887367944324811e-02, - 7.57926459563205562331e-02, 4.78504387573109452036e-02, -2.22681497547184761854e-02, 8.46951897073950493722e-02, -7.44317622658197293462e-03, - -1.89157622212636281067e-02, -6.19719693803440774271e-02, -8.37644347918033160827e-03, 1.32514981682897603488e-01, -1.09126775888557903116e-01, - -6.47849222903969929055e-03, 4.65591560634076861991e-02, -2.24234845462696341656e-01, 7.29582023256248463072e-02, 2.23965783883813690514e-03, - -5.19349169152241198211e-03, 2.25395864383192284786e-02, 9.10694488527918760701e-02, 7.36945737152017443794e-02, -2.16337158651918673447e-02, - -5.35436418307164291308e-02, 2.40342905027485786995e-02, 4.81946656785084762142e-02, -3.06521617296798450092e-02, -4.07904977042986977009e-02, - 6.32948267919029999851e-02, 4.53192474361057834331e-02, -2.29008122631283589365e-02, 1.62576382380966721897e-02, 3.82842631619570161750e-02, - 3.52346794652655739832e-02, -3.95023093184828782976e-02, -3.15659719925446974331e-02, 4.02431236080928178556e-02, 2.45684617558553607120e-02, - -1.93194945947791144047e-02, -2.48322169406506726430e-02, -1.13621415403786386183e-02, -3.31487361399904478798e-02, 1.68675563537488623633e-02, - 4.01325091519489432490e-02, 4.14338905584917469027e-02, 1.31273776950603299207e-01, 7.16276979245435152510e-03, 5.02985992698696121606e-02, - 1.78045915098635626483e-01, -1.86314001159308406663e-01, -1.35151434606926579285e-01, 1.69947309928447143346e-01, -8.37791941109623933270e-02, - 2.41195207762586322220e-02, 1.26309574838379373718e-01, -2.00571859613532021971e-01, -1.63465438373802895988e-01, -6.96363659600393730686e-02, - 1.14524330229191645403e-01, 7.12890316169484949960e-02, 5.80381889626466196397e-03, 4.93537868059431283907e-02, -8.44257746020753430116e-02, - -1.41929196365875275043e-02, 8.22387462453117029648e-02, -8.50093260265970818157e-02, 2.71192346905003156543e-02, 9.03395551304754379496e-02, - -1.71516448697893314490e-02, 8.18953521749132690166e-02, 1.11511604557867297777e-02, -4.78373059022189212053e-03, -9.53023452930306103070e-02, - 5.38686323249407891800e-02, -3.84678611713600085431e-02, -5.04713920668615947246e-03, 6.80811773653991481048e-02, -3.33049215638338835799e-02, - -5.28099294606356045589e-02, -7.54699335274512245197e-02, -5.40781758032556764126e-03, 8.29793590010352716257e-02, -5.97312971039127629802e-02, - -2.71427292677366080453e-02, -6.36007393417800138968e-03, -6.21102608067901958838e-03, 1.20982775517295207401e-02, -1.17366629581995736420e-02, - 3.79477291991657597614e-02, 4.16172556173764890408e-02, -4.15482630953573559007e-02, -2.10178763811884848633e-02, 2.25384141584651191692e-02, - 3.26544906456272876483e-01, 1.14875244914279722730e-01, -1.66631737648658934114e-01, -6.36733988328790686401e-03, 1.05207112351735077027e-01, - -2.56656713269180158932e-01, 6.60485459910778310855e-02, 4.17130045127815929362e-02, -7.37791748174861372611e-02, 7.60523512741725499220e-02, - -4.55959006761720783696e-02, -2.36680526647207629953e-02, 1.10634117950077798254e-01, -2.08651727388676766495e-02, -7.64711683504649686327e-02, - 8.13422913278145920390e-03, 7.93342835009738511776e-02, -1.36145811582776665727e-01, 3.71088391279384144372e-02, 3.21562962981391253781e-02, - -1.14387894243613869039e-01, -1.51631103622234392203e-03, 5.78217444722389575795e-02, -4.71124806075210594836e-03, 1.51729749910356030707e-02, - 9.74258177618566034717e-02, -1.10011849267590264279e-01, -9.55723084321756233273e-02, 5.40108889439728720450e-02, 2.20372759806924181647e-02, - -3.12940070328804331723e-02, 7.31829279647891323135e-02, -5.03897879848870661190e-02, 3.56857218059479508465e-02, 2.77447201596329011408e-02, - -2.09552594775335998545e-02, 1.43951419283830060747e-02, 5.39902985778747748769e-02, 2.12233791683978864628e-02, -1.06021857317053335573e-02, - -1.29173575974317281917e-02, 2.33645540297061204277e-03, 2.61896609343018451146e-03, -1.14595932568608803448e-02, 3.56767949738183843926e-04, - 2.01246788122515993247e-02, 1.99364141245472692443e-01, 1.02386975283006720350e-02, 1.46491539292862016364e-01, -2.92173375533333390397e-01, - -2.79882649001711690528e-02, 7.89598614348374083782e-02, 1.73932768517874730696e-02, -1.69430993280276553925e-01, -3.49439319604140236075e-02, - -2.41776119023419042153e-02, -1.19007451411664612329e-02, 7.52785183419538428407e-02, 8.00732324924654653708e-02, 5.80254140930885203842e-02, - -2.99344525092792301812e-02, 2.00701049258613407889e-02, -4.85173141225875570459e-02, -1.24597145763424926868e-01, -1.51901004582441958440e-02, - -1.61680779553563594431e-02, 6.85542113027582250551e-02, 4.25745326736892623631e-02, -1.06278911193231559440e-04, 9.76285197536541464458e-03, - 3.87428701891937912749e-02, -2.30639988244256723127e-02, 6.36890026034679732764e-03, 3.02413182033626840028e-02, 3.88836672433736253024e-03, - -9.08662711955680046927e-02, 4.01745378306784250988e-02, 1.03266559093635329480e-01, 2.14979137912293429002e-03, -5.41722635351460576891e-02, - 2.61282597269434195553e-02, -1.88195226737477086520e-03, -2.19435523135619973967e-02, 1.32921056129775890658e-02, -1.39584001825611234843e-02, - -2.33277834487258597940e-02, 3.20387242392535485924e-03, -2.56605748623718842027e-02, 3.00558911102263848214e-02, 3.05648112133436906934e-02, - -2.59104772664633942192e-03, -3.60234150814368395133e-02, 1.89051474579463585357e-01, 7.67659810167127809599e-02, -1.24703387595890141659e-01, - 1.16494243349512860419e-01, -1.23273291315800521267e-02, -8.52472265397304362899e-02, 4.85995814815475199455e-02, -4.91533864052588892468e-02, - 7.09392924651690154336e-02, 3.86918200904741022006e-02, -6.05870726251201280332e-02, 1.26662290542081668043e-01, -1.26300238339170367574e-02, - -2.77371050405810226636e-02, -5.43586513698262885352e-02, -7.86459616541178574423e-02, 6.23528587727540037355e-02, -4.79677851814970662714e-02, - -6.51687150996678454806e-04, 5.76336385114276719688e-02, 1.44542478484825671209e-02, 3.16928492510423695516e-02, 1.45017405736592441823e-02, - 3.77649866255029068030e-02, 2.76488049642000443748e-04, -6.60577998684190731415e-02, -1.43760686140608738570e-02, 3.59108661833638931338e-02, - -1.96544252969081192917e-02, -3.14635605928988426605e-02, 2.73136448740384021883e-02, 4.81895944089887409700e-02, -1.41798371596522010049e-03, - -2.76940211432370950173e-02, -1.79321359038478039816e-02, -8.04857916575939247306e-03, 6.12601355103674924743e-04, -3.04826514707566033346e-02, - 3.97737096905840994271e-03, 2.93070515299252015717e-02, -1.68977509366934480761e-01, 3.32231696372570911580e-03, 1.25024830498748684704e-01, - 1.14603027997231002311e-01, -1.00188353252315814901e-01, -9.84663913699934667534e-03, 4.24578628782099620764e-02, -1.37172078837733080192e-01, - -3.49285758694722614504e-02, 5.10266827849673310080e-02, -8.71727496405721724582e-02, 6.53026570180906262841e-03, 8.81977524226997683376e-02, - -6.34979748614215300240e-02, -6.75922576223946108831e-02, -9.09058087393600777748e-03, 8.58354921744265697559e-02, -3.11903783366274736655e-02, - 2.00028673474334506288e-02, 2.51992069666158204078e-02, -1.15065874504069552003e-02, 1.90952708533619654185e-02, -1.42994317615683774053e-02, - 8.38885300224805237346e-04, -3.82027498742033497225e-02, -3.67441895491770198490e-02, 2.50992455595355073994e-02, 7.01187400269996513602e-02, - -5.54375280311450654991e-02, -4.38519736099493434578e-02, -7.84180536804670973161e-03, 2.15733075413469983783e-02, -1.13430180042112986952e-03, - 1.43263625967320618049e-02, 3.38406892444173892920e-02, 2.61661740894084809961e-02, 1.89963433472952851477e-02, 4.11523810167366797808e-03, - -4.07083694738235874616e-03, -2.14250124636823323365e-02, -2.51950730394823532721e-02, 3.42343547054715646727e-02, -1.60995215305804545425e-01, - 1.46286861154573760713e-01, -1.42470612032240401268e-02, -8.74980046536548150549e-02, -4.25453860188948623788e-02, 1.17182553786398857554e-01, - -1.00991016453327253632e-01, -7.91738577441953306213e-02, 5.29573588185536445194e-02, -2.21614298461902045623e-02, 3.58602587208211864844e-02, - 2.52438926833398191718e-02, 9.41877819477729971709e-02, -6.48116676539685077074e-02, -6.92622200130770665494e-02, 3.44271533520238565140e-02, - -2.14712430694437191037e-02, 1.72316382693014427674e-02, -2.66608743584075963406e-02, -2.10082338877249467923e-02, 8.91565305172099635544e-03, - -1.23413533420058361967e-02, -6.55699200671947673991e-03, -6.50539642022832619028e-03, 1.51124007337151353147e-02, 5.20370287348198221067e-03, - 2.44544519960917354495e-02, 8.17735780033393942767e-03, -3.77816692303542945967e-04, -2.75580902253722351269e-02, 1.61366174765763085996e-02, - -2.54225642602667507852e-02, -5.68510449978476550825e-02, 1.03315681722852791002e-02, 5.48232041684815468024e-03, -3.22722809472682503618e-02, - 1.68859338049149008965e-02, 6.21665123569529881609e-02, -1.49734091796970530952e-01, -1.69848035269845681894e-01, 7.28166844225807269320e-02, - -9.38546660994197951000e-02, -5.98972210309676594830e-02, 1.60189670628219316129e-01, 9.68228235109596380159e-02, -1.14699218288179388692e-01, - 5.22495478003770982833e-02, -2.50191304829539204468e-02, 2.77221049132821764638e-02, 5.25053174572039649259e-02, 4.67049795137407172674e-02, - -4.25063623233455645245e-02, -7.79015735544906322285e-03, 8.35061691171900405406e-02, -2.77565926301914164820e-02, -3.55176007501909543618e-02, - 5.22884040187019810686e-02, 4.47524306813492939866e-03, 3.34858736182796073999e-02, 2.18065090398272508343e-02, 3.96249948248765804237e-02, - -1.75050000687652293485e-02, -5.30639824787136182155e-03, 1.31658536276919365532e-02, -3.54893637807925724226e-02, 1.44838563901157494143e-03, - 2.53219139441511024990e-02, 1.51209661740110620776e-02, -3.18928979311501516886e-03, 8.08035892351891861518e-03, 1.49482343348299774599e-02, - -4.67401524501743839690e-02, 8.81785937471118302922e-02, 1.09443858484468511949e-01, 9.61675669132599497679e-02, -7.39592182705455791769e-02, - 8.87508822651789097691e-02, -7.91714174638406542606e-02, -1.25898861391198962911e-01, 8.84171948090256565322e-02, 3.93482215277929509023e-02, - -6.26211797345710557972e-02, 3.11866892937116280127e-02, 1.54206070094080910371e-01, -7.15962414998223273255e-02, 4.04187883182457047271e-02, - 3.87320351160306483584e-02, -2.13087169719965857650e-02, 2.04352330201420621936e-02, 3.60324068311299108847e-02, -6.71927151509099790383e-02, - -5.86355402262732916530e-02, 1.95738272971190847838e-02, 1.19986570986449735121e-02, -4.16517345466257682407e-02, 4.57582247311850084937e-02, - -5.64919874467361762815e-02, -2.96306742467898837426e-03, 3.45918894384134034681e-02, 9.37965919443191353810e-03, -5.31266846947417263614e-03, - 7.44645101900219368030e-03, -8.16779483872519251886e-03, -1.49486275306286754694e-02, 5.40961754497425346966e-03, -6.07743621110200162722e-03, - -2.86027271239626297572e-02, 9.28607307596479303324e-02, 1.15334393912762608880e-01, 2.22619048233438435180e-02, -2.81988516854455167904e-02, - -3.27953711282213400402e-02, -7.26623103447188861681e-02, -6.21318073281297983401e-02, 8.15860644657136341307e-02, 1.79600966703069159225e-02, - -8.26984672948943289050e-02, 2.66922837734803533594e-02, -5.62012642483699781382e-02, -7.54479658771655264937e-02, 5.63921972458279810447e-02, - -8.88808665037604112014e-03, 4.49098738994229513752e-04, -1.64624335502902702233e-02, 5.00902714527058645633e-02, 1.06477908341492902983e-02, - 2.19722684831073211686e-02, 9.27897245497274342219e-03, -1.38071463629181757221e-02, -3.25812324194547434097e-02, -3.02235182235052954325e-02, - 2.70211283173303479233e-02, 1.78695725115783597692e-02, -1.97856995310294429824e-02, 2.14583909244959528118e-02, 8.31160096115654556392e-03, - -7.96044059263601583298e-03, -7.03711411983747731069e-03, -7.52245974116911853002e-02, -7.17896739726268801052e-02, 1.07396425196690896431e-02, - 7.25906809169843403318e-02, -9.45023972725838740105e-02, -6.71199808984563744962e-02, 7.35264690791543329418e-02, 2.98610952212447697263e-02, - -7.52442146662268135371e-04, 9.23976694955527116937e-02, 4.60854381027500578649e-02, -5.81010137429742931636e-02, 5.19935015121687146844e-02, - -4.28751313838296663206e-02, 2.68412731409498166169e-02, 9.92974085166531926505e-03, -1.41649957602334279627e-02, 8.49484772510930227774e-03, - 1.60608334268962397659e-03, 1.53969582107269485627e-02, 2.53654424332110106644e-02, 2.20836817019017840613e-02, -4.96400766026642691758e-03, - -4.63895546537213768895e-03, -3.69755978269468085773e-02, -4.24220279369531480529e-02, -2.80842055465305032516e-03, 3.43511446156298310903e-03, - 1.50427480682660263955e-02, -7.64781824357823984684e-03, 1.55431405065905338392e-02, -5.28685500234718219748e-02, -4.81425552620864186104e-02, - -6.98904426260522071424e-02, -5.69063762150740712342e-02, -2.01599484306710097226e-02, -7.08142573082899164094e-03, 1.60387886663503793916e-02, - -8.26785713680359968247e-02, 2.82003440014560874394e-02, 2.73932418290509169245e-02, -3.17992788170617102228e-02, 5.85714331111230612770e-02, - 5.86577384557991701741e-02, -2.75299012996250893476e-03, -8.45195718330371027760e-03, -1.36279044444791216234e-02, -1.13870143130110085955e-02, - -9.47170994530230694886e-03, 8.38589777991547574709e-03, -2.44907795135516845320e-02, -1.88112311627625997112e-02, 1.66825300517051550164e-02, - -1.40472696715355817310e-02, 4.07602998308370448322e-02, 4.52331228574007898624e-03, -7.41516905358174677892e-03, -1.90839799893427405908e-02, - 1.37235319648593090402e-01, -5.07166887609150802974e-03, 1.66347985382777688312e-02, -8.94058332794331472870e-02, -9.96617048317507969735e-03, - -3.39998201752246195784e-02, -2.72752305938337435975e-02, 1.41116199971288980557e-04, 1.20136294077674496417e-02, 1.21046096252801875515e-02, - 4.67374536088999582156e-03, 1.76093997807116745338e-03, -6.49132489663982719524e-03, 6.34253853067380107822e-02, 4.20234078454048282092e-02, - -3.39907942260764435460e-03, -3.13684078013621997494e-02, -5.59725664044557688626e-03, 1.46041344723689698465e-02, 8.15628093364801319554e-03, - 8.81123245682426982361e-03, -5.36576704715815769320e-02, 4.13564181087699121731e-03, 6.66570175208870251832e-03, -3.06753731552251258582e-03, - 3.24260047333155276839e-02, 3.78357123622976698057e-03, 1.22559252382635042178e-01, -3.26726534731656623189e-02, -4.57263244390499479231e-02, - 1.23161267442891183416e-02, 5.60898223233850107272e-02, -2.07946281596515653023e-02, 3.30973059009364162231e-02, 3.79099335956614089116e-02, - 3.02099801034241572523e-03, -4.11260349557933183040e-02, -2.09662321613402133358e-02, -1.35059512400454856396e-02, 2.11033519015176411482e-02, - 2.49738730383721862366e-03, 1.80042474049896738739e-03, -4.21972590754290111104e-02, 7.84304881856809008034e-03, 1.28611420258033324476e-02, - 1.53304442551651341764e-02, 1.14809771240723442615e-02, 5.45508167269171534430e-03, 6.03486224308978115582e-03, -6.17922023172545829134e-03, - -1.06402780093771354153e-01, -1.06566854283863088337e-01, -1.56672555450536946098e-02, -4.17617234129553371869e-02, -5.84327485785076233826e-02, - 1.72707037153512245331e-02, -4.27180361478920241763e-03, 3.83975587930814599158e-02, 7.18917519991502662613e-02, 1.73599075858622414748e-02, - -5.06102136889801795805e-02, -2.28302899957008066656e-02, 4.05449577890660689539e-02, 6.05903063932164507449e-03, 1.42495320779388468663e-02, - -1.46505630681158707102e-02, -5.51579872998721708333e-03, -2.03950903125686006101e-02, 1.71600095189964607645e-02, 3.10141280680510215972e-02, - -6.92078952483923121042e-03, -1.25723580586239959064e-03, 4.83571917759556130223e-02, -1.08848884748079619000e-01, -7.62227492845969547414e-03, - 3.98614872899268266049e-02, 2.51496883852979809248e-02, -7.45157236466782307849e-02, -2.54315956467565489063e-02, 5.86785913495517369443e-02, - 6.07261945507166309849e-03, 2.37710782485035070077e-02, 2.40958099664499367232e-03, 8.00723308014901838381e-03, 5.57202821065413758661e-02, - -6.18738592105032812751e-03, 1.57471692604664484198e-03, -2.08797558382940772262e-03, -2.73200765442419279960e-02, -2.06208586891517380024e-02, - 6.40309150046379439887e-04, 3.34147637908005640250e-02, -2.31245128603038314907e-02, 3.13805487530873783442e-02, -3.76503956682762222496e-02, - 3.82033717675601958152e-02, 6.08549869979059313008e-02, -1.40664950951139375995e-02, 1.20432450888018800772e-02, 4.11120541709728091334e-03, - -1.31431111647770104689e-02, -2.16767866450208908369e-02, 2.36444182462271527620e-03, 4.15518391649481646372e-03, -7.19797119986096724242e-03, - 3.63099914737792378583e-02, -1.71114207061806439247e-02, 9.12094809288829279359e-03, -2.00581984724530065778e-02, 4.18093901030532240359e-03, - -1.54353999486445108563e-02, 3.77632145097120189292e-02, -8.67412239218371683425e-02, 3.74024476837445662980e-02, 7.02791955646850374784e-03, - -3.07387087745127421390e-03, 1.26170642077405754933e-02, 7.19502473862098246987e-03, 5.00348237158451253359e-02, 6.05821676660315069918e-03, - 2.81657375913338843543e-02, -2.75046494305255621871e-02, -3.32847608680125889302e-02, 4.92458523340539092161e-03, -6.97895182233836727098e-03, - -1.84078432809154611538e-02, -2.55254058040131799612e-02, 4.38596283726821068588e-03, 7.97305689082921688338e-03, -6.65251068675700718558e-02, - -2.43074168732615144076e-03, -3.21551055785660854641e-03, -2.14057386820096506863e-02, 1.73404829493880863200e-02, -2.21788279126988834011e-02, - 3.67289476360874028726e-02, 2.88921423109056961509e-02, -4.36590369050650264210e-03, -3.38015966458028857197e-03, -1.47872402615952351634e-02, - -2.67937691397940741522e-02, -4.01628891758317591032e-02, 5.37104159736995767638e-02, 3.38881421250558784175e-02, -1.94731556323654853013e-02, - 6.80080451079642287447e-04, -1.16224021866609874415e-02, -2.84314312441163938305e-02, -3.10403528556473483346e-02, -1.52614844050795953750e-02, - 1.46865039960839046523e-02, 7.74337973212646264037e-03, -2.75213939675030445919e-02, -3.12476741289728875139e-02, -3.75401476285800936306e-02, - 4.53067917901101985256e-02, 4.75497506720418041531e-03, 1.25627944556748021021e-02, 4.03046169919628882727e-02, -3.29378978115561424356e-02, - -2.51499548928088654393e-03, -1.99564144518295516484e-02, -2.63938123636600005528e-02, -1.84979990476826575141e-02, -4.75891539387540141171e-02, - 1.70189645456799328038e-02, 2.90621732209333551167e-02, 1.69695748997654785595e-02, 6.00578109434020054880e-03, 3.77405846672976205691e-02, - 1.04426223615697640751e-02, -7.42237607930411715310e-04, -1.51118572042552353624e-02, 1.29952623161545995079e-03, 1.26799047323642617713e-02, - 1.05278997248968164691e-02, 2.29682654055416574090e-02, 1.28888330591014361320e-02, -1.03014730669756075787e-02, -4.83421710205830541113e-03, - -1.90040068302814585399e-02, -4.31802671175361696410e-03 + 2.78565217180879301395e+02, 0.00000000000000000000e+00, 8.38367712240454920902e-01, 0.00000000000000000000e+00, -7.22151022768738215518e-01, + 0.00000000000000000000e+00, 1.54447137639483056404e+00, 0.00000000000000000000e+00, -8.10351659720698336287e-01, 0.00000000000000000000e+00, + 6.45930713064333694717e-01, 0.00000000000000000000e+00, -1.73417955255619204991e-01, 0.00000000000000000000e+00, -9.09351867483918913093e-02, + 0.00000000000000000000e+00, -3.00845517613623769648e-02, 0.00000000000000000000e+00, -1.97522108657794209785e-01, 0.00000000000000000000e+00, + 1.45006392199800160370e-01, 0.00000000000000000000e+00, -6.92319525648382033678e-02, 0.00000000000000000000e+00, -3.37495245995370396486e-01, + 0.00000000000000000000e+00, 2.93969252845082296144e-01, 0.00000000000000000000e+00, 5.22791676917648828748e-02, 0.00000000000000000000e+00, + -4.31020055899014042922e-02, 0.00000000000000000000e+00, -5.34277055570271386387e-02, 0.00000000000000000000e+00, 1.57725778753141337996e-01, + 0.00000000000000000000e+00, -1.38048966071163903280e-01, 0.00000000000000000000e+00, 7.95936533884674390915e-02, 0.00000000000000000000e+00, + -5.08988096408558021722e-03, 0.00000000000000000000e+00, -3.17356690459940984916e-02, 0.00000000000000000000e+00, -7.97854100625838141836e-02, + 0.00000000000000000000e+00, -1.25759522048120825355e-01, 0.00000000000000000000e+00, 1.41095505007377608475e-01, 0.00000000000000000000e+00, + -2.90041709701537933630e-02, 0.00000000000000000000e+00, 1.16118748810570035501e-01, 0.00000000000000000000e+00, -1.42650207377574778089e-01, + 0.00000000000000000000e+00, 6.63859656709936268859e-02, 0.00000000000000000000e+00, -8.43008351127146754456e-02, 0.00000000000000000000e+00, + 8.11805506119530340126e-02, 0.00000000000000000000e+00, -2.92579106275835476580e+00, -2.73257362252726822283e-02, -2.31503061096297768628e+00, + 2.98481883110496337697e-01, 2.32422954464165210098e+00, -9.36624989809203695179e-02, -1.13647173814196378316e+00, -4.24970312443540054748e-01, + 1.26754821773852066613e+00, -7.20859094680278700285e-02, -9.51306475614490221204e-01, 6.14867632012408793507e-01, -9.85091038732955892598e-02, + -6.34523215803268758606e-02, -6.78708060411115782218e-02, -1.35311523427619539994e-01, -9.04935301775932621204e-02, -9.78101007785831533248e-02, + -9.81097374871810895547e-04, 1.80616098092357818539e-02, -2.64791786212412172397e-02, -4.76558495508507054539e-02, -1.96341419265033012564e-01, + 3.40906457596743608929e-02, -7.81262194523913988675e-02, -1.90201799489863598858e-01, 2.25178750048809411810e-01, 2.86704542482240504198e-03, + -1.19805102746233238520e-02, 1.68969022321052431135e-02, 5.64738950483129331648e-02, -1.39757566954298140249e-01, -7.44084433787887133960e-02, + -1.79448737058076172868e-02, 6.14333363921325120716e-02, 4.42090839521651901567e-02, -1.59177621940344016238e-02, -2.45259140787589882682e-02, + 4.14722887926062475095e-02, -9.08467249754976585718e-02, 7.32634132869659504550e-02, 3.98083190502361433660e-02, -6.23330309466623433412e-02, + 3.23061735747387016038e-02, 5.24308078374175548508e-02, -6.52853670335678676340e-02, -4.74582205706168894221e-02, -2.57646217050176394581e-02, + 4.85326601320503064896e-02, 4.57836316487753580695e-02, -1.61395013977115135695e-02, -4.31399408593192076888e-02, -1.72982609465274252136e-02, + 2.05141743795376405024e-02, 5.13479785723864323721e-02, 2.02753965345298277356e-02, -9.62325942856205422682e-03, -1.21013000039295196344e-03, + 4.61377663687331032727e-02, -6.90153405245983028390e-04, -1.66104804699747843344e+00, 1.79666906865138087390e-01, 7.23133875761683864170e-01, + 4.15103729262486009777e-01, -3.04359433047895144853e-01, -1.33601223735748869670e-01, 1.11896993727331572899e+00, -5.97930191729183602156e-01, + -3.21482407719980045613e-01, -6.44440729482515239912e-02, -1.39643167588630684461e-01, -7.87344252201049310536e-02, -2.74194962741515224636e-01, + 3.16014987883590156570e-02, 2.61916687188788577245e-01, -2.29041295889389484586e-01, 1.37413993896893793512e-02, 1.02848928276271345261e-01, + -8.45943398257167356036e-02, -8.55836430183285895579e-02, -2.14692485939022847941e-02, -5.00660400534810728912e-02, 4.10286932308298671335e-02, + 5.98356967342531728682e-02, -6.87268417209678655899e-02, -1.00834342061879356223e-01, 2.89946855441678558174e-02, 6.84096422422015987275e-02, + 7.90905646811665974383e-02, 1.22761627402924594632e-02, -7.19296897992387496146e-02, -1.19563518571031840443e-01, 3.53949764125303933948e-02, + 3.49389806984224948749e-02, -1.34556768717593006057e-01, 1.30036738800839157815e-01, 1.47453022488737178763e-01, -1.75187106897877128975e-02, + -5.71655857598896560701e-02, -2.22513683371899778640e-02, 5.11984135243400070858e-02, 4.32198440146361120839e-02, -3.79006811678369512353e-02, + -1.61948869817943215399e-02, 5.87864730303968852088e-02, 7.56143666040565154418e-03, 3.79735451815043784096e-02, 4.88357571184367539319e-03, + -3.44600211423619568266e-03, 8.45175251030964858057e-03, 2.06501052974025246789e-02, -2.27945980601942863042e-02, 7.52792623890808781928e-02, + -4.07335076464383702421e-02, -1.22373247319515162691e-03, 7.12818582736400585542e-03, -2.08797409246280901707e-02, 2.35344435031375059930e-02, + 5.38553837448995376125e-02, 2.29385900837120154661e-01, -3.60512186055045147359e-01, 4.09262094434219958483e-01, -1.43204915316633707434e-01, + 1.76661646314910159017e-01, 1.59424540157772631765e-01, 1.19996653025061628117e-01, 9.74032138671445946176e-02, 8.01756516767066496065e-02, + -4.22092435868048232450e-01, 3.42598707334977881089e-01, 7.26427774784764446192e-02, -1.92869792680440410582e-04, -9.14800737566894561770e-02, + 1.86904852575672325576e-01, 9.03785536307215725538e-02, -8.70628859333670845899e-02, -1.20357023393743836626e-01, 1.30276821268167974921e-01, + -5.50418496727855255379e-02, -1.39930929689677463479e-01, -4.10997318303747902202e-02, 1.66027061444833590187e-01, -3.31025873454900559922e-02, + 5.45967001368218574076e-02, -1.86051192758042188702e-01, 3.57669212138109621213e-02, 1.96823682403928168494e-01, 1.12736638944959083330e-01, + -1.18563060708320622272e-01, -7.11264215849067293895e-02, -3.33098969956449747487e-02, 4.88100702343404121986e-02, 2.04094083090545080905e-02, + 7.78285563663724117012e-02, -4.14113893806803898268e-02, 1.26375672481289953730e-02, 1.38745116741378599068e-01, -8.57558938152793923115e-03, + -9.29289689333271246019e-02, -8.27276771926104548260e-02, 5.84956615429012907748e-02, 2.29399633044502938156e-03, -2.09824524198216422546e-03, + -2.30538708704958079931e-02, 3.77132043821169771203e-02, 6.53337758882697045015e-02, -3.06667712165429387494e-02, -1.14650515581519504144e-02, + 1.46194883433694872849e-02, 3.46636747707448856712e-03, -4.35546278336838635359e-02, 6.29051255528407793349e-02, 6.12210568933847180256e-03, + 2.07571937975545607602e-02, 3.35768305063385619214e-01, 7.46266949448459948613e-01, -6.72463631746016698987e-02, -1.94536700956528363360e-01, + -2.75088750614828209118e-02, 1.42328699967799371384e-01, 3.35288125725375085739e-01, 1.29661987766008346412e-01, 2.90956042046801172107e-02, + -2.05442280573112395770e-01, -9.57252926974513779212e-02, -9.10355774240597659386e-02, -1.25784172798783761005e-01, 1.12460127036075691054e-01, + 9.44013754824246931197e-02, -6.05135930061245497225e-02, 9.42673278665148578481e-02, 2.00615512602382500829e-01, -5.92185875904504069323e-02, + -2.28592246943101873313e-01, -1.07412950490968162054e-01, 2.20172956055192214908e-01, 3.33294698669218958376e-01, -4.44283179185198731642e-02, + -1.01766394690480529994e-01, 1.17472184755037761805e-01, 1.04892483649878465179e-01, -6.62468314716531808672e-02, -2.45565086356498013531e-03, + 4.79072727765457034854e-02, -7.97766729243851169251e-04, -2.33714338875874692858e-02, -2.56642787088907850523e-02, -9.62514763421860042314e-02, + 3.99383399281938444858e-02, 2.88865653017884548015e-02, -5.15182520475396393822e-02, 8.26498791523299636275e-02, -2.98742841129583554249e-02, + -8.28182978045203938011e-02, 3.14455026979475749105e-02, -1.53345808562610789669e-03, -3.62400610998830294274e-02, -2.51728077975302867719e-02, + -3.02379015962623703961e-02, 2.68910770206758423240e-02, -8.22634968902352312070e-03, 3.66544933660152699728e-02, 1.32356634436242674713e-02, + 3.21880247207419244518e-03, -1.97571016662111687001e-02, 5.93796945717029508310e-03, -4.31413602924163308572e-02, -2.72339719264069676785e-02, + -1.87274725743593273286e-01, 1.39283127485721136551e-01, 4.74963034217010249272e-01, -3.42073553333540392174e-01, 4.83885077044606606855e-02, + -2.59068005795831224347e-01, -2.13264680765766156956e-01, -7.36008484860203593403e-02, -8.13152420843461926081e-02, -1.21927665578479005326e-02, + 1.79904544651649317411e-01, -1.09959740517953624694e-01, -2.22065490779929819443e-01, 7.14015849729179447047e-02, -5.85031872787839662964e-03, + 9.72943249874637094976e-02, 1.58464145663301525513e-01, -6.23660570620122936547e-02, -2.05086286960385583145e-01, -5.07929431274403847540e-02, + 4.21897204870116185327e-02, -6.99935466206487028051e-02, -6.71348953496629374804e-02, 1.65743074443523596972e-01, 8.56850642116062655163e-02, + -1.19953810412321809631e-01, -7.40173516101229334030e-02, 1.18865945768013535344e-02, -7.71584669380707965924e-02, -6.31283399388396088137e-02, + -1.45882854372074655114e-01, 6.29307315713034526317e-02, 1.48912624660626508738e-02, -6.72819324032104260080e-02, 3.22547499735358483841e-02, + 4.97387743825052491831e-02, -5.43073271907661761504e-02, 1.52590958854153246893e-02, 2.92721489192738311066e-03, -1.87663839736718872364e-02, + -3.80050872053503069684e-03, 5.91273447672226934446e-02, -2.83684585809016896404e-03, 1.70512827209476636181e-02, -1.44259815516434488497e-02, + -8.06597987912826830392e-02, 5.19954562777717940736e-02, 1.09504480128524081528e-02, 1.26439885486616093030e-02, -2.34593647937779382559e-03, + 2.47413111762442641806e-02, -6.13559850860111253429e-03, -6.05626633742831349538e-02, -1.98467175793774985859e-01, 3.18979113074946862838e-01, + 6.23356771079433893967e-02, 1.30138108749532965813e-01, -1.05230501466137910116e-01, -6.87754575227078057686e-02, -4.22436887367944324811e-02, + 7.57926459563205562331e-02, 4.78504387573109452036e-02, -2.22681497547184761854e-02, 8.46951897073950493722e-02, -7.44317622658197293462e-03, + -1.89157622212636281067e-02, -6.19719693803440774271e-02, -8.37644347918033160827e-03, 1.32514981682897603488e-01, -1.09126775888557903116e-01, + -6.47849222903969929055e-03, 4.65591560634076861991e-02, -2.24234845462696341656e-01, 7.29582023256248463072e-02, 2.23965783883813690514e-03, + -5.19349169152241198211e-03, 2.25395864383192284786e-02, 9.10694488527918760701e-02, 7.36945737152017443794e-02, -2.16337158651918673447e-02, + -5.35436418307164291308e-02, 2.40342905027485786995e-02, 4.81946656785084762142e-02, -3.06521617296798450092e-02, -4.07904977042986977009e-02, + 6.32948267919029999851e-02, 4.53192474361057834331e-02, -2.29008122631283589365e-02, 1.62576382380966721897e-02, 3.82842631619570161750e-02, + 3.52346794652655739832e-02, -3.95023093184828782976e-02, -3.15659719925446974331e-02, 4.02431236080928178556e-02, 2.45684617558553607120e-02, + -1.93194945947791144047e-02, -2.48322169406506726430e-02, -1.13621415403786386183e-02, -3.31487361399904478798e-02, 1.68675563537488623633e-02, + 4.01325091519489432490e-02, 4.14338905584917469027e-02, 1.31273776950603299207e-01, 7.16276979245435152510e-03, 5.02985992698696121606e-02, + 1.78045915098635626483e-01, -1.86314001159308406663e-01, -1.35151434606926579285e-01, 1.69947309928447143346e-01, -8.37791941109623933270e-02, + 2.41195207762586322220e-02, 1.26309574838379373718e-01, -2.00571859613532021971e-01, -1.63465438373802895988e-01, -6.96363659600393730686e-02, + 1.14524330229191645403e-01, 7.12890316169484949960e-02, 5.80381889626466196397e-03, 4.93537868059431283907e-02, -8.44257746020753430116e-02, + -1.41929196365875275043e-02, 8.22387462453117029648e-02, -8.50093260265970818157e-02, 2.71192346905003156543e-02, 9.03395551304754379496e-02, + -1.71516448697893314490e-02, 8.18953521749132690166e-02, 1.11511604557867297777e-02, -4.78373059022189212053e-03, -9.53023452930306103070e-02, + 5.38686323249407891800e-02, -3.84678611713600085431e-02, -5.04713920668615947246e-03, 6.80811773653991481048e-02, -3.33049215638338835799e-02, + -5.28099294606356045589e-02, -7.54699335274512245197e-02, -5.40781758032556764126e-03, 8.29793590010352716257e-02, -5.97312971039127629802e-02, + -2.71427292677366080453e-02, -6.36007393417800138968e-03, -6.21102608067901958838e-03, 1.20982775517295207401e-02, -1.17366629581995736420e-02, + 3.79477291991657597614e-02, 4.16172556173764890408e-02, -4.15482630953573559007e-02, -2.10178763811884848633e-02, 2.25384141584651191692e-02, + 3.26544906456272876483e-01, 1.14875244914279722730e-01, -1.66631737648658934114e-01, -6.36733988328790686401e-03, 1.05207112351735077027e-01, + -2.56656713269180158932e-01, 6.60485459910778310855e-02, 4.17130045127815929362e-02, -7.37791748174861372611e-02, 7.60523512741725499220e-02, + -4.55959006761720783696e-02, -2.36680526647207629953e-02, 1.10634117950077798254e-01, -2.08651727388676766495e-02, -7.64711683504649686327e-02, + 8.13422913278145920390e-03, 7.93342835009738511776e-02, -1.36145811582776665727e-01, 3.71088391279384144372e-02, 3.21562962981391253781e-02, + -1.14387894243613869039e-01, -1.51631103622234392203e-03, 5.78217444722389575795e-02, -4.71124806075210594836e-03, 1.51729749910356030707e-02, + 9.74258177618566034717e-02, -1.10011849267590264279e-01, -9.55723084321756233273e-02, 5.40108889439728720450e-02, 2.20372759806924181647e-02, + -3.12940070328804331723e-02, 7.31829279647891323135e-02, -5.03897879848870661190e-02, 3.56857218059479508465e-02, 2.77447201596329011408e-02, + -2.09552594775335998545e-02, 1.43951419283830060747e-02, 5.39902985778747748769e-02, 2.12233791683978864628e-02, -1.06021857317053335573e-02, + -1.29173575974317281917e-02, 2.33645540297061204277e-03, 2.61896609343018451146e-03, -1.14595932568608803448e-02, 3.56767949738183843926e-04, + 2.01246788122515993247e-02, 1.99364141245472692443e-01, 1.02386975283006720350e-02, 1.46491539292862016364e-01, -2.92173375533333390397e-01, + -2.79882649001711690528e-02, 7.89598614348374083782e-02, 1.73932768517874730696e-02, -1.69430993280276553925e-01, -3.49439319604140236075e-02, + -2.41776119023419042153e-02, -1.19007451411664612329e-02, 7.52785183419538428407e-02, 8.00732324924654653708e-02, 5.80254140930885203842e-02, + -2.99344525092792301812e-02, 2.00701049258613407889e-02, -4.85173141225875570459e-02, -1.24597145763424926868e-01, -1.51901004582441958440e-02, + -1.61680779553563594431e-02, 6.85542113027582250551e-02, 4.25745326736892623631e-02, -1.06278911193231559440e-04, 9.76285197536541464458e-03, + 3.87428701891937912749e-02, -2.30639988244256723127e-02, 6.36890026034679732764e-03, 3.02413182033626840028e-02, 3.88836672433736253024e-03, + -9.08662711955680046927e-02, 4.01745378306784250988e-02, 1.03266559093635329480e-01, 2.14979137912293429002e-03, -5.41722635351460576891e-02, + 2.61282597269434195553e-02, -1.88195226737477086520e-03, -2.19435523135619973967e-02, 1.32921056129775890658e-02, -1.39584001825611234843e-02, + -2.33277834487258597940e-02, 3.20387242392535485924e-03, -2.56605748623718842027e-02, 3.00558911102263848214e-02, 3.05648112133436906934e-02, + -2.59104772664633942192e-03, -3.60234150814368395133e-02, 1.89051474579463585357e-01, 7.67659810167127809599e-02, -1.24703387595890141659e-01, + 1.16494243349512860419e-01, -1.23273291315800521267e-02, -8.52472265397304362899e-02, 4.85995814815475199455e-02, -4.91533864052588892468e-02, + 7.09392924651690154336e-02, 3.86918200904741022006e-02, -6.05870726251201280332e-02, 1.26662290542081668043e-01, -1.26300238339170367574e-02, + -2.77371050405810226636e-02, -5.43586513698262885352e-02, -7.86459616541178574423e-02, 6.23528587727540037355e-02, -4.79677851814970662714e-02, + -6.51687150996678454806e-04, 5.76336385114276719688e-02, 1.44542478484825671209e-02, 3.16928492510423695516e-02, 1.45017405736592441823e-02, + 3.77649866255029068030e-02, 2.76488049642000443748e-04, -6.60577998684190731415e-02, -1.43760686140608738570e-02, 3.59108661833638931338e-02, + -1.96544252969081192917e-02, -3.14635605928988426605e-02, 2.73136448740384021883e-02, 4.81895944089887409700e-02, -1.41798371596522010049e-03, + -2.76940211432370950173e-02, -1.79321359038478039816e-02, -8.04857916575939247306e-03, 6.12601355103674924743e-04, -3.04826514707566033346e-02, + 3.97737096905840994271e-03, 2.93070515299252015717e-02, -1.68977509366934480761e-01, 3.32231696372570911580e-03, 1.25024830498748684704e-01, + 1.14603027997231002311e-01, -1.00188353252315814901e-01, -9.84663913699934667534e-03, 4.24578628782099620764e-02, -1.37172078837733080192e-01, + -3.49285758694722614504e-02, 5.10266827849673310080e-02, -8.71727496405721724582e-02, 6.53026570180906262841e-03, 8.81977524226997683376e-02, + -6.34979748614215300240e-02, -6.75922576223946108831e-02, -9.09058087393600777748e-03, 8.58354921744265697559e-02, -3.11903783366274736655e-02, + 2.00028673474334506288e-02, 2.51992069666158204078e-02, -1.15065874504069552003e-02, 1.90952708533619654185e-02, -1.42994317615683774053e-02, + 8.38885300224805237346e-04, -3.82027498742033497225e-02, -3.67441895491770198490e-02, 2.50992455595355073994e-02, 7.01187400269996513602e-02, + -5.54375280311450654991e-02, -4.38519736099493434578e-02, -7.84180536804670973161e-03, 2.15733075413469983783e-02, -1.13430180042112986952e-03, + 1.43263625967320618049e-02, 3.38406892444173892920e-02, 2.61661740894084809961e-02, 1.89963433472952851477e-02, 4.11523810167366797808e-03, + -4.07083694738235874616e-03, -2.14250124636823323365e-02, -2.51950730394823532721e-02, 3.42343547054715646727e-02, -1.60995215305804545425e-01, + 1.46286861154573760713e-01, -1.42470612032240401268e-02, -8.74980046536548150549e-02, -4.25453860188948623788e-02, 1.17182553786398857554e-01, + -1.00991016453327253632e-01, -7.91738577441953306213e-02, 5.29573588185536445194e-02, -2.21614298461902045623e-02, 3.58602587208211864844e-02, + 2.52438926833398191718e-02, 9.41877819477729971709e-02, -6.48116676539685077074e-02, -6.92622200130770665494e-02, 3.44271533520238565140e-02, + -2.14712430694437191037e-02, 1.72316382693014427674e-02, -2.66608743584075963406e-02, -2.10082338877249467923e-02, 8.91565305172099635544e-03, + -1.23413533420058361967e-02, -6.55699200671947673991e-03, -6.50539642022832619028e-03, 1.51124007337151353147e-02, 5.20370287348198221067e-03, + 2.44544519960917354495e-02, 8.17735780033393942767e-03, -3.77816692303542945967e-04, -2.75580902253722351269e-02, 1.61366174765763085996e-02, + -2.54225642602667507852e-02, -5.68510449978476550825e-02, 1.03315681722852791002e-02, 5.48232041684815468024e-03, -3.22722809472682503618e-02, + 1.68859338049149008965e-02, 6.21665123569529881609e-02, -1.49734091796970530952e-01, -1.69848035269845681894e-01, 7.28166844225807269320e-02, + -9.38546660994197951000e-02, -5.98972210309676594830e-02, 1.60189670628219316129e-01, 9.68228235109596380159e-02, -1.14699218288179388692e-01, + 5.22495478003770982833e-02, -2.50191304829539204468e-02, 2.77221049132821764638e-02, 5.25053174572039649259e-02, 4.67049795137407172674e-02, + -4.25063623233455645245e-02, -7.79015735544906322285e-03, 8.35061691171900405406e-02, -2.77565926301914164820e-02, -3.55176007501909543618e-02, + 5.22884040187019810686e-02, 4.47524306813492939866e-03, 3.34858736182796073999e-02, 2.18065090398272508343e-02, 3.96249948248765804237e-02, + -1.75050000687652293485e-02, -5.30639824787136182155e-03, 1.31658536276919365532e-02, -3.54893637807925724226e-02, 1.44838563901157494143e-03, + 2.53219139441511024990e-02, 1.51209661740110620776e-02, -3.18928979311501516886e-03, 8.08035892351891861518e-03, 1.49482343348299774599e-02, + -4.67401524501743839690e-02, 8.81785937471118302922e-02, 1.09443858484468511949e-01, 9.61675669132599497679e-02, -7.39592182705455791769e-02, + 8.87508822651789097691e-02, -7.91714174638406542606e-02, -1.25898861391198962911e-01, 8.84171948090256565322e-02, 3.93482215277929509023e-02, + -6.26211797345710557972e-02, 3.11866892937116280127e-02, 1.54206070094080910371e-01, -7.15962414998223273255e-02, 4.04187883182457047271e-02, + 3.87320351160306483584e-02, -2.13087169719965857650e-02, 2.04352330201420621936e-02, 3.60324068311299108847e-02, -6.71927151509099790383e-02, + -5.86355402262732916530e-02, 1.95738272971190847838e-02, 1.19986570986449735121e-02, -4.16517345466257682407e-02, 4.57582247311850084937e-02, + -5.64919874467361762815e-02, -2.96306742467898837426e-03, 3.45918894384134034681e-02, 9.37965919443191353810e-03, -5.31266846947417263614e-03, + 7.44645101900219368030e-03, -8.16779483872519251886e-03, -1.49486275306286754694e-02, 5.40961754497425346966e-03, -6.07743621110200162722e-03, + -2.86027271239626297572e-02, 9.28607307596479303324e-02, 1.15334393912762608880e-01, 2.22619048233438435180e-02, -2.81988516854455167904e-02, + -3.27953711282213400402e-02, -7.26623103447188861681e-02, -6.21318073281297983401e-02, 8.15860644657136341307e-02, 1.79600966703069159225e-02, + -8.26984672948943289050e-02, 2.66922837734803533594e-02, -5.62012642483699781382e-02, -7.54479658771655264937e-02, 5.63921972458279810447e-02, + -8.88808665037604112014e-03, 4.49098738994229513752e-04, -1.64624335502902702233e-02, 5.00902714527058645633e-02, 1.06477908341492902983e-02, + 2.19722684831073211686e-02, 9.27897245497274342219e-03, -1.38071463629181757221e-02, -3.25812324194547434097e-02, -3.02235182235052954325e-02, + 2.70211283173303479233e-02, 1.78695725115783597692e-02, -1.97856995310294429824e-02, 2.14583909244959528118e-02, 8.31160096115654556392e-03, + -7.96044059263601583298e-03, -7.03711411983747731069e-03, -7.52245974116911853002e-02, -7.17896739726268801052e-02, 1.07396425196690896431e-02, + 7.25906809169843403318e-02, -9.45023972725838740105e-02, -6.71199808984563744962e-02, 7.35264690791543329418e-02, 2.98610952212447697263e-02, + -7.52442146662268135371e-04, 9.23976694955527116937e-02, 4.60854381027500578649e-02, -5.81010137429742931636e-02, 5.19935015121687146844e-02, + -4.28751313838296663206e-02, 2.68412731409498166169e-02, 9.92974085166531926505e-03, -1.41649957602334279627e-02, 8.49484772510930227774e-03, + 1.60608334268962397659e-03, 1.53969582107269485627e-02, 2.53654424332110106644e-02, 2.20836817019017840613e-02, -4.96400766026642691758e-03, + -4.63895546537213768895e-03, -3.69755978269468085773e-02, -4.24220279369531480529e-02, -2.80842055465305032516e-03, 3.43511446156298310903e-03, + 1.50427480682660263955e-02, -7.64781824357823984684e-03, 1.55431405065905338392e-02, -5.28685500234718219748e-02, -4.81425552620864186104e-02, + -6.98904426260522071424e-02, -5.69063762150740712342e-02, -2.01599484306710097226e-02, -7.08142573082899164094e-03, 1.60387886663503793916e-02, + -8.26785713680359968247e-02, 2.82003440014560874394e-02, 2.73932418290509169245e-02, -3.17992788170617102228e-02, 5.85714331111230612770e-02, + 5.86577384557991701741e-02, -2.75299012996250893476e-03, -8.45195718330371027760e-03, -1.36279044444791216234e-02, -1.13870143130110085955e-02, + -9.47170994530230694886e-03, 8.38589777991547574709e-03, -2.44907795135516845320e-02, -1.88112311627625997112e-02, 1.66825300517051550164e-02, + -1.40472696715355817310e-02, 4.07602998308370448322e-02, 4.52331228574007898624e-03, -7.41516905358174677892e-03, -1.90839799893427405908e-02, + 1.37235319648593090402e-01, -5.07166887609150802974e-03, 1.66347985382777688312e-02, -8.94058332794331472870e-02, -9.96617048317507969735e-03, + -3.39998201752246195784e-02, -2.72752305938337435975e-02, 1.41116199971288980557e-04, 1.20136294077674496417e-02, 1.21046096252801875515e-02, + 4.67374536088999582156e-03, 1.76093997807116745338e-03, -6.49132489663982719524e-03, 6.34253853067380107822e-02, 4.20234078454048282092e-02, + -3.39907942260764435460e-03, -3.13684078013621997494e-02, -5.59725664044557688626e-03, 1.46041344723689698465e-02, 8.15628093364801319554e-03, + 8.81123245682426982361e-03, -5.36576704715815769320e-02, 4.13564181087699121731e-03, 6.66570175208870251832e-03, -3.06753731552251258582e-03, + 3.24260047333155276839e-02, 3.78357123622976698057e-03, 1.22559252382635042178e-01, -3.26726534731656623189e-02, -4.57263244390499479231e-02, + 1.23161267442891183416e-02, 5.60898223233850107272e-02, -2.07946281596515653023e-02, 3.30973059009364162231e-02, 3.79099335956614089116e-02, + 3.02099801034241572523e-03, -4.11260349557933183040e-02, -2.09662321613402133358e-02, -1.35059512400454856396e-02, 2.11033519015176411482e-02, + 2.49738730383721862366e-03, 1.80042474049896738739e-03, -4.21972590754290111104e-02, 7.84304881856809008034e-03, 1.28611420258033324476e-02, + 1.53304442551651341764e-02, 1.14809771240723442615e-02, 5.45508167269171534430e-03, 6.03486224308978115582e-03, -6.17922023172545829134e-03, + -1.06402780093771354153e-01, -1.06566854283863088337e-01, -1.56672555450536946098e-02, -4.17617234129553371869e-02, -5.84327485785076233826e-02, + 1.72707037153512245331e-02, -4.27180361478920241763e-03, 3.83975587930814599158e-02, 7.18917519991502662613e-02, 1.73599075858622414748e-02, + -5.06102136889801795805e-02, -2.28302899957008066656e-02, 4.05449577890660689539e-02, 6.05903063932164507449e-03, 1.42495320779388468663e-02, + -1.46505630681158707102e-02, -5.51579872998721708333e-03, -2.03950903125686006101e-02, 1.71600095189964607645e-02, 3.10141280680510215972e-02, + -6.92078952483923121042e-03, -1.25723580586239959064e-03, 4.83571917759556130223e-02, -1.08848884748079619000e-01, -7.62227492845969547414e-03, + 3.98614872899268266049e-02, 2.51496883852979809248e-02, -7.45157236466782307849e-02, -2.54315956467565489063e-02, 5.86785913495517369443e-02, + 6.07261945507166309849e-03, 2.37710782485035070077e-02, 2.40958099664499367232e-03, 8.00723308014901838381e-03, 5.57202821065413758661e-02, + -6.18738592105032812751e-03, 1.57471692604664484198e-03, -2.08797558382940772262e-03, -2.73200765442419279960e-02, -2.06208586891517380024e-02, + 6.40309150046379439887e-04, 3.34147637908005640250e-02, -2.31245128603038314907e-02, 3.13805487530873783442e-02, -3.76503956682762222496e-02, + 3.82033717675601958152e-02, 6.08549869979059313008e-02, -1.40664950951139375995e-02, 1.20432450888018800772e-02, 4.11120541709728091334e-03, + -1.31431111647770104689e-02, -2.16767866450208908369e-02, 2.36444182462271527620e-03, 4.15518391649481646372e-03, -7.19797119986096724242e-03, + 3.63099914737792378583e-02, -1.71114207061806439247e-02, 9.12094809288829279359e-03, -2.00581984724530065778e-02, 4.18093901030532240359e-03, + -1.54353999486445108563e-02, 3.77632145097120189292e-02, -8.67412239218371683425e-02, 3.74024476837445662980e-02, 7.02791955646850374784e-03, + -3.07387087745127421390e-03, 1.26170642077405754933e-02, 7.19502473862098246987e-03, 5.00348237158451253359e-02, 6.05821676660315069918e-03, + 2.81657375913338843543e-02, -2.75046494305255621871e-02, -3.32847608680125889302e-02, 4.92458523340539092161e-03, -6.97895182233836727098e-03, + -1.84078432809154611538e-02, -2.55254058040131799612e-02, 4.38596283726821068588e-03, 7.97305689082921688338e-03, -6.65251068675700718558e-02, + -2.43074168732615144076e-03, -3.21551055785660854641e-03, -2.14057386820096506863e-02, 1.73404829493880863200e-02, -2.21788279126988834011e-02, + 3.67289476360874028726e-02, 2.88921423109056961509e-02, -4.36590369050650264210e-03, -3.38015966458028857197e-03, -1.47872402615952351634e-02, + -2.67937691397940741522e-02, -4.01628891758317591032e-02, 5.37104159736995767638e-02, 3.38881421250558784175e-02, -1.94731556323654853013e-02, + 6.80080451079642287447e-04, -1.16224021866609874415e-02, -2.84314312441163938305e-02, -3.10403528556473483346e-02, -1.52614844050795953750e-02, + 1.46865039960839046523e-02, 7.74337973212646264037e-03, -2.75213939675030445919e-02, -3.12476741289728875139e-02, -3.75401476285800936306e-02, + 4.53067917901101985256e-02, 4.75497506720418041531e-03, 1.25627944556748021021e-02, 4.03046169919628882727e-02, -3.29378978115561424356e-02, + -2.51499548928088654393e-03, -1.99564144518295516484e-02, -2.63938123636600005528e-02, -1.84979990476826575141e-02, -4.75891539387540141171e-02, + 1.70189645456799328038e-02, 2.90621732209333551167e-02, 1.69695748997654785595e-02, 6.00578109434020054880e-03, 3.77405846672976205691e-02, + 1.04426223615697640751e-02, -7.42237607930411715310e-04, -1.51118572042552353624e-02, 1.29952623161545995079e-03, 1.26799047323642617713e-02, + 1.05278997248968164691e-02, 2.29682654055416574090e-02, 1.28888330591014361320e-02, -1.03014730669756075787e-02, -4.83421710205830541113e-03, + -1.90040068302814585399e-02, -4.31802671175361696410e-03 }; #define ILCHAM 992 -#define MTRONC 30 -#define STRONC 10 +#define MTRONC 30 +#define STRONC 10 -int main (int argc, char * argv[]) +int main(int argc, char* argv[]) { size_t len; - grib_handle * h; + grib_handle* h; double zval[ILCHAM]; int ioptimizeScaleFactor; - double zerr[2] = {0,0}; + double zerr[2] = { 0, 0 }; int i, m, n, k; - for (ioptimizeScaleFactor = 0; ioptimizeScaleFactor < 2; ioptimizeScaleFactor++) - { - GRIB_CHECK (((h = grib_handle_new_from_samples (NULL, "sh_ml_grib2")) == NULL), 0); + for (ioptimizeScaleFactor = 0; ioptimizeScaleFactor < 2; ioptimizeScaleFactor++) { + GRIB_CHECK(((h = grib_handle_new_from_samples(NULL, "sh_ml_grib2")) == NULL), 0); /* Meteo-France settings */ - GRIB_CHECK (grib_set_long (h, "centre", 85), 0); - len = strlen ("stretched_rotated_sh"); - GRIB_CHECK (grib_set_string (h, "gridType", "stretched_rotated_sh", &len), 0); - GRIB_CHECK (grib_set_long (h, "pentagonalResolutionParameterJ", MTRONC), 0); - GRIB_CHECK (grib_set_long (h, "pentagonalResolutionParameterK", MTRONC), 0); - GRIB_CHECK (grib_set_long (h, "pentagonalResolutionParameterM", MTRONC), 0); + GRIB_CHECK(grib_set_long(h, "centre", 85), 0); + len = strlen("stretched_rotated_sh"); + GRIB_CHECK(grib_set_string(h, "gridType", "stretched_rotated_sh", &len), 0); + GRIB_CHECK(grib_set_long(h, "pentagonalResolutionParameterJ", MTRONC), 0); + GRIB_CHECK(grib_set_long(h, "pentagonalResolutionParameterK", MTRONC), 0); + GRIB_CHECK(grib_set_long(h, "pentagonalResolutionParameterM", MTRONC), 0); - GRIB_CHECK (grib_set_double (h,"stretchingFactor", 2.40000000000000), 0); - GRIB_CHECK (grib_set_double (h,"latitudeOfStretchingPoleInDegrees", 46.4688478326275), 0); - GRIB_CHECK (grib_set_double (h,"longitudeOfStretchingPoleInDegrees", 2.57831007808864), 0); + GRIB_CHECK(grib_set_double(h, "stretchingFactor", 2.40000000000000), 0); + GRIB_CHECK(grib_set_double(h, "latitudeOfStretchingPoleInDegrees", 46.4688478326275), 0); + GRIB_CHECK(grib_set_double(h, "longitudeOfStretchingPoleInDegrees", 2.57831007808864), 0); - GRIB_CHECK (grib_set_long (h, "bitsPerValue", 16), 0); - len = strlen ("spectral_complex"); - GRIB_CHECK (grib_set_string (h, "packingType", "spectral_complex", &len), 0); - GRIB_CHECK (grib_set_long (h, "optimizeScaleFactor", ioptimizeScaleFactor), 0); + GRIB_CHECK(grib_set_long(h, "bitsPerValue", 16), 0); + len = strlen("spectral_complex"); + GRIB_CHECK(grib_set_string(h, "packingType", "spectral_complex", &len), 0); + GRIB_CHECK(grib_set_long(h, "optimizeScaleFactor", ioptimizeScaleFactor), 0); - GRIB_CHECK (grib_set_long (h, "subSetJ", STRONC), 0); - GRIB_CHECK (grib_set_long (h, "subSetK", STRONC), 0); - GRIB_CHECK (grib_set_long (h, "subSetM", STRONC), 0); - GRIB_CHECK (grib_set_long (h, "unpackedSubsetPrecision", 1), 0); + GRIB_CHECK(grib_set_long(h, "subSetJ", STRONC), 0); + GRIB_CHECK(grib_set_long(h, "subSetK", STRONC), 0); + GRIB_CHECK(grib_set_long(h, "subSetM", STRONC), 0); + GRIB_CHECK(grib_set_long(h, "unpackedSubsetPrecision", 1), 0); - GRIB_CHECK (grib_set_double_array (h, "values", values, ILCHAM), 0); + GRIB_CHECK(grib_set_double_array(h, "values", values, ILCHAM), 0); len = ILCHAM; - GRIB_CHECK (grib_get_double_array (h, "values", zval, &len), 0); + GRIB_CHECK(grib_get_double_array(h, "values", zval, &len), 0); /* Compare our values */ - for(i=0; i 1e-5) { - fprintf(stderr,"Unpacked value different: i=%d values[i]=%g zval[i]=%g\n", i, values[i], zval[i]); + fprintf(stderr, "Unpacked value different: i=%d values[i]=%g zval[i]=%g\n", i, values[i], zval[i]); return 1; } } - for (m = 0, k = 0; m < MTRONC+1; m++) - { - for (n = m; n < MTRONC+1; k++, n++) - { + for (m = 0, k = 0; m < MTRONC + 1; m++) { + for (n = m; n < MTRONC + 1; k++, n++) { /* Check sub-truncation was fully preserved in IEEE-32 */ - if ((m < STRONC+1) && (n < STRONC+1) && (((float)zval[2*k] != (float)values[2*k]) || ((float)zval[2*k+1] != (float)values[2*k+1]))) - { - printf ("Unpacked sub-truncation was not fully preserved; coefficients for wave number (m=%d,n=%d) have been modified\n", m, n); + if ((m < STRONC + 1) && (n < STRONC + 1) && (((float)zval[2 * k] != (float)values[2 * k]) || ((float)zval[2 * k + 1] != (float)values[2 * k + 1]))) { + printf("Unpacked sub-truncation was not fully preserved; coefficients for wave number (m=%d,n=%d) have been modified\n", m, n); return 1; } } } - for (i = 0; i < ILCHAM; i++) - { + for (i = 0; i < ILCHAM; i++) { zerr[ioptimizeScaleFactor] += (zval[i] - values[i]) * (zval[i] - values[i]); } - zerr[ioptimizeScaleFactor] = sqrt (zerr[ioptimizeScaleFactor]); + zerr[ioptimizeScaleFactor] = sqrt(zerr[ioptimizeScaleFactor]); - GRIB_CHECK (grib_handle_delete (h), 0); + GRIB_CHECK(grib_handle_delete(h), 0); } - if (zerr[0] < zerr[1]) - { - printf ("Packing error too big: optimizeScaleFactor appears to be broken\n"); + if (zerr[0] < zerr[1]) { + printf("Packing error too big: optimizeScaleFactor appears to be broken\n"); return 1; } printf("OK\n"); diff --git a/tests/grib_sh_ieee64.c b/tests/grib_sh_ieee64.c index 84fad6a93..0adb16082 100644 --- a/tests/grib_sh_ieee64.c +++ b/tests/grib_sh_ieee64.c @@ -19,257 +19,255 @@ */ static double values[] = { - 2.78565217180879301395e+02, 0.00000000000000000000e+00, 8.38367712240454920902e-01, 0.00000000000000000000e+00, -7.22151022768738215518e-01, - 0.00000000000000000000e+00, 1.54447137639483056404e+00, 0.00000000000000000000e+00, -8.10351659720698336287e-01, 0.00000000000000000000e+00, - 6.45930713064333694717e-01, 0.00000000000000000000e+00, -1.73417955255619204991e-01, 0.00000000000000000000e+00, -9.09351867483918913093e-02, - 0.00000000000000000000e+00, -3.00845517613623769648e-02, 0.00000000000000000000e+00, -1.97522108657794209785e-01, 0.00000000000000000000e+00, - 1.45006392199800160370e-01, 0.00000000000000000000e+00, -6.92319525648382033678e-02, 0.00000000000000000000e+00, -3.37495245995370396486e-01, - 0.00000000000000000000e+00, 2.93969252845082296144e-01, 0.00000000000000000000e+00, 5.22791676917648828748e-02, 0.00000000000000000000e+00, - -4.31020055899014042922e-02, 0.00000000000000000000e+00, -5.34277055570271386387e-02, 0.00000000000000000000e+00, 1.57725778753141337996e-01, - 0.00000000000000000000e+00, -1.38048966071163903280e-01, 0.00000000000000000000e+00, 7.95936533884674390915e-02, 0.00000000000000000000e+00, - -5.08988096408558021722e-03, 0.00000000000000000000e+00, -3.17356690459940984916e-02, 0.00000000000000000000e+00, -7.97854100625838141836e-02, - 0.00000000000000000000e+00, -1.25759522048120825355e-01, 0.00000000000000000000e+00, 1.41095505007377608475e-01, 0.00000000000000000000e+00, - -2.90041709701537933630e-02, 0.00000000000000000000e+00, 1.16118748810570035501e-01, 0.00000000000000000000e+00, -1.42650207377574778089e-01, - 0.00000000000000000000e+00, 6.63859656709936268859e-02, 0.00000000000000000000e+00, -8.43008351127146754456e-02, 0.00000000000000000000e+00, - 8.11805506119530340126e-02, 0.00000000000000000000e+00, -2.92579106275835476580e+00, -2.73257362252726822283e-02, -2.31503061096297768628e+00, - 2.98481883110496337697e-01, 2.32422954464165210098e+00, -9.36624989809203695179e-02, -1.13647173814196378316e+00, -4.24970312443540054748e-01, - 1.26754821773852066613e+00, -7.20859094680278700285e-02, -9.51306475614490221204e-01, 6.14867632012408793507e-01, -9.85091038732955892598e-02, - -6.34523215803268758606e-02, -6.78708060411115782218e-02, -1.35311523427619539994e-01, -9.04935301775932621204e-02, -9.78101007785831533248e-02, - -9.81097374871810895547e-04, 1.80616098092357818539e-02, -2.64791786212412172397e-02, -4.76558495508507054539e-02, -1.96341419265033012564e-01, - 3.40906457596743608929e-02, -7.81262194523913988675e-02, -1.90201799489863598858e-01, 2.25178750048809411810e-01, 2.86704542482240504198e-03, - -1.19805102746233238520e-02, 1.68969022321052431135e-02, 5.64738950483129331648e-02, -1.39757566954298140249e-01, -7.44084433787887133960e-02, - -1.79448737058076172868e-02, 6.14333363921325120716e-02, 4.42090839521651901567e-02, -1.59177621940344016238e-02, -2.45259140787589882682e-02, - 4.14722887926062475095e-02, -9.08467249754976585718e-02, 7.32634132869659504550e-02, 3.98083190502361433660e-02, -6.23330309466623433412e-02, - 3.23061735747387016038e-02, 5.24308078374175548508e-02, -6.52853670335678676340e-02, -4.74582205706168894221e-02, -2.57646217050176394581e-02, - 4.85326601320503064896e-02, 4.57836316487753580695e-02, -1.61395013977115135695e-02, -4.31399408593192076888e-02, -1.72982609465274252136e-02, - 2.05141743795376405024e-02, 5.13479785723864323721e-02, 2.02753965345298277356e-02, -9.62325942856205422682e-03, -1.21013000039295196344e-03, - 4.61377663687331032727e-02, -6.90153405245983028390e-04, -1.66104804699747843344e+00, 1.79666906865138087390e-01, 7.23133875761683864170e-01, - 4.15103729262486009777e-01, -3.04359433047895144853e-01, -1.33601223735748869670e-01, 1.11896993727331572899e+00, -5.97930191729183602156e-01, - -3.21482407719980045613e-01, -6.44440729482515239912e-02, -1.39643167588630684461e-01, -7.87344252201049310536e-02, -2.74194962741515224636e-01, - 3.16014987883590156570e-02, 2.61916687188788577245e-01, -2.29041295889389484586e-01, 1.37413993896893793512e-02, 1.02848928276271345261e-01, - -8.45943398257167356036e-02, -8.55836430183285895579e-02, -2.14692485939022847941e-02, -5.00660400534810728912e-02, 4.10286932308298671335e-02, - 5.98356967342531728682e-02, -6.87268417209678655899e-02, -1.00834342061879356223e-01, 2.89946855441678558174e-02, 6.84096422422015987275e-02, - 7.90905646811665974383e-02, 1.22761627402924594632e-02, -7.19296897992387496146e-02, -1.19563518571031840443e-01, 3.53949764125303933948e-02, - 3.49389806984224948749e-02, -1.34556768717593006057e-01, 1.30036738800839157815e-01, 1.47453022488737178763e-01, -1.75187106897877128975e-02, - -5.71655857598896560701e-02, -2.22513683371899778640e-02, 5.11984135243400070858e-02, 4.32198440146361120839e-02, -3.79006811678369512353e-02, - -1.61948869817943215399e-02, 5.87864730303968852088e-02, 7.56143666040565154418e-03, 3.79735451815043784096e-02, 4.88357571184367539319e-03, - -3.44600211423619568266e-03, 8.45175251030964858057e-03, 2.06501052974025246789e-02, -2.27945980601942863042e-02, 7.52792623890808781928e-02, - -4.07335076464383702421e-02, -1.22373247319515162691e-03, 7.12818582736400585542e-03, -2.08797409246280901707e-02, 2.35344435031375059930e-02, - 5.38553837448995376125e-02, 2.29385900837120154661e-01, -3.60512186055045147359e-01, 4.09262094434219958483e-01, -1.43204915316633707434e-01, - 1.76661646314910159017e-01, 1.59424540157772631765e-01, 1.19996653025061628117e-01, 9.74032138671445946176e-02, 8.01756516767066496065e-02, - -4.22092435868048232450e-01, 3.42598707334977881089e-01, 7.26427774784764446192e-02, -1.92869792680440410582e-04, -9.14800737566894561770e-02, - 1.86904852575672325576e-01, 9.03785536307215725538e-02, -8.70628859333670845899e-02, -1.20357023393743836626e-01, 1.30276821268167974921e-01, - -5.50418496727855255379e-02, -1.39930929689677463479e-01, -4.10997318303747902202e-02, 1.66027061444833590187e-01, -3.31025873454900559922e-02, - 5.45967001368218574076e-02, -1.86051192758042188702e-01, 3.57669212138109621213e-02, 1.96823682403928168494e-01, 1.12736638944959083330e-01, - -1.18563060708320622272e-01, -7.11264215849067293895e-02, -3.33098969956449747487e-02, 4.88100702343404121986e-02, 2.04094083090545080905e-02, - 7.78285563663724117012e-02, -4.14113893806803898268e-02, 1.26375672481289953730e-02, 1.38745116741378599068e-01, -8.57558938152793923115e-03, - -9.29289689333271246019e-02, -8.27276771926104548260e-02, 5.84956615429012907748e-02, 2.29399633044502938156e-03, -2.09824524198216422546e-03, - -2.30538708704958079931e-02, 3.77132043821169771203e-02, 6.53337758882697045015e-02, -3.06667712165429387494e-02, -1.14650515581519504144e-02, - 1.46194883433694872849e-02, 3.46636747707448856712e-03, -4.35546278336838635359e-02, 6.29051255528407793349e-02, 6.12210568933847180256e-03, - 2.07571937975545607602e-02, 3.35768305063385619214e-01, 7.46266949448459948613e-01, -6.72463631746016698987e-02, -1.94536700956528363360e-01, - -2.75088750614828209118e-02, 1.42328699967799371384e-01, 3.35288125725375085739e-01, 1.29661987766008346412e-01, 2.90956042046801172107e-02, - -2.05442280573112395770e-01, -9.57252926974513779212e-02, -9.10355774240597659386e-02, -1.25784172798783761005e-01, 1.12460127036075691054e-01, - 9.44013754824246931197e-02, -6.05135930061245497225e-02, 9.42673278665148578481e-02, 2.00615512602382500829e-01, -5.92185875904504069323e-02, - -2.28592246943101873313e-01, -1.07412950490968162054e-01, 2.20172956055192214908e-01, 3.33294698669218958376e-01, -4.44283179185198731642e-02, - -1.01766394690480529994e-01, 1.17472184755037761805e-01, 1.04892483649878465179e-01, -6.62468314716531808672e-02, -2.45565086356498013531e-03, - 4.79072727765457034854e-02, -7.97766729243851169251e-04, -2.33714338875874692858e-02, -2.56642787088907850523e-02, -9.62514763421860042314e-02, - 3.99383399281938444858e-02, 2.88865653017884548015e-02, -5.15182520475396393822e-02, 8.26498791523299636275e-02, -2.98742841129583554249e-02, - -8.28182978045203938011e-02, 3.14455026979475749105e-02, -1.53345808562610789669e-03, -3.62400610998830294274e-02, -2.51728077975302867719e-02, - -3.02379015962623703961e-02, 2.68910770206758423240e-02, -8.22634968902352312070e-03, 3.66544933660152699728e-02, 1.32356634436242674713e-02, - 3.21880247207419244518e-03, -1.97571016662111687001e-02, 5.93796945717029508310e-03, -4.31413602924163308572e-02, -2.72339719264069676785e-02, - -1.87274725743593273286e-01, 1.39283127485721136551e-01, 4.74963034217010249272e-01, -3.42073553333540392174e-01, 4.83885077044606606855e-02, - -2.59068005795831224347e-01, -2.13264680765766156956e-01, -7.36008484860203593403e-02, -8.13152420843461926081e-02, -1.21927665578479005326e-02, - 1.79904544651649317411e-01, -1.09959740517953624694e-01, -2.22065490779929819443e-01, 7.14015849729179447047e-02, -5.85031872787839662964e-03, - 9.72943249874637094976e-02, 1.58464145663301525513e-01, -6.23660570620122936547e-02, -2.05086286960385583145e-01, -5.07929431274403847540e-02, - 4.21897204870116185327e-02, -6.99935466206487028051e-02, -6.71348953496629374804e-02, 1.65743074443523596972e-01, 8.56850642116062655163e-02, - -1.19953810412321809631e-01, -7.40173516101229334030e-02, 1.18865945768013535344e-02, -7.71584669380707965924e-02, -6.31283399388396088137e-02, - -1.45882854372074655114e-01, 6.29307315713034526317e-02, 1.48912624660626508738e-02, -6.72819324032104260080e-02, 3.22547499735358483841e-02, - 4.97387743825052491831e-02, -5.43073271907661761504e-02, 1.52590958854153246893e-02, 2.92721489192738311066e-03, -1.87663839736718872364e-02, - -3.80050872053503069684e-03, 5.91273447672226934446e-02, -2.83684585809016896404e-03, 1.70512827209476636181e-02, -1.44259815516434488497e-02, - -8.06597987912826830392e-02, 5.19954562777717940736e-02, 1.09504480128524081528e-02, 1.26439885486616093030e-02, -2.34593647937779382559e-03, - 2.47413111762442641806e-02, -6.13559850860111253429e-03, -6.05626633742831349538e-02, -1.98467175793774985859e-01, 3.18979113074946862838e-01, - 6.23356771079433893967e-02, 1.30138108749532965813e-01, -1.05230501466137910116e-01, -6.87754575227078057686e-02, -4.22436887367944324811e-02, - 7.57926459563205562331e-02, 4.78504387573109452036e-02, -2.22681497547184761854e-02, 8.46951897073950493722e-02, -7.44317622658197293462e-03, - -1.89157622212636281067e-02, -6.19719693803440774271e-02, -8.37644347918033160827e-03, 1.32514981682897603488e-01, -1.09126775888557903116e-01, - -6.47849222903969929055e-03, 4.65591560634076861991e-02, -2.24234845462696341656e-01, 7.29582023256248463072e-02, 2.23965783883813690514e-03, - -5.19349169152241198211e-03, 2.25395864383192284786e-02, 9.10694488527918760701e-02, 7.36945737152017443794e-02, -2.16337158651918673447e-02, - -5.35436418307164291308e-02, 2.40342905027485786995e-02, 4.81946656785084762142e-02, -3.06521617296798450092e-02, -4.07904977042986977009e-02, - 6.32948267919029999851e-02, 4.53192474361057834331e-02, -2.29008122631283589365e-02, 1.62576382380966721897e-02, 3.82842631619570161750e-02, - 3.52346794652655739832e-02, -3.95023093184828782976e-02, -3.15659719925446974331e-02, 4.02431236080928178556e-02, 2.45684617558553607120e-02, - -1.93194945947791144047e-02, -2.48322169406506726430e-02, -1.13621415403786386183e-02, -3.31487361399904478798e-02, 1.68675563537488623633e-02, - 4.01325091519489432490e-02, 4.14338905584917469027e-02, 1.31273776950603299207e-01, 7.16276979245435152510e-03, 5.02985992698696121606e-02, - 1.78045915098635626483e-01, -1.86314001159308406663e-01, -1.35151434606926579285e-01, 1.69947309928447143346e-01, -8.37791941109623933270e-02, - 2.41195207762586322220e-02, 1.26309574838379373718e-01, -2.00571859613532021971e-01, -1.63465438373802895988e-01, -6.96363659600393730686e-02, - 1.14524330229191645403e-01, 7.12890316169484949960e-02, 5.80381889626466196397e-03, 4.93537868059431283907e-02, -8.44257746020753430116e-02, - -1.41929196365875275043e-02, 8.22387462453117029648e-02, -8.50093260265970818157e-02, 2.71192346905003156543e-02, 9.03395551304754379496e-02, - -1.71516448697893314490e-02, 8.18953521749132690166e-02, 1.11511604557867297777e-02, -4.78373059022189212053e-03, -9.53023452930306103070e-02, - 5.38686323249407891800e-02, -3.84678611713600085431e-02, -5.04713920668615947246e-03, 6.80811773653991481048e-02, -3.33049215638338835799e-02, - -5.28099294606356045589e-02, -7.54699335274512245197e-02, -5.40781758032556764126e-03, 8.29793590010352716257e-02, -5.97312971039127629802e-02, - -2.71427292677366080453e-02, -6.36007393417800138968e-03, -6.21102608067901958838e-03, 1.20982775517295207401e-02, -1.17366629581995736420e-02, - 3.79477291991657597614e-02, 4.16172556173764890408e-02, -4.15482630953573559007e-02, -2.10178763811884848633e-02, 2.25384141584651191692e-02, - 3.26544906456272876483e-01, 1.14875244914279722730e-01, -1.66631737648658934114e-01, -6.36733988328790686401e-03, 1.05207112351735077027e-01, - -2.56656713269180158932e-01, 6.60485459910778310855e-02, 4.17130045127815929362e-02, -7.37791748174861372611e-02, 7.60523512741725499220e-02, - -4.55959006761720783696e-02, -2.36680526647207629953e-02, 1.10634117950077798254e-01, -2.08651727388676766495e-02, -7.64711683504649686327e-02, - 8.13422913278145920390e-03, 7.93342835009738511776e-02, -1.36145811582776665727e-01, 3.71088391279384144372e-02, 3.21562962981391253781e-02, - -1.14387894243613869039e-01, -1.51631103622234392203e-03, 5.78217444722389575795e-02, -4.71124806075210594836e-03, 1.51729749910356030707e-02, - 9.74258177618566034717e-02, -1.10011849267590264279e-01, -9.55723084321756233273e-02, 5.40108889439728720450e-02, 2.20372759806924181647e-02, - -3.12940070328804331723e-02, 7.31829279647891323135e-02, -5.03897879848870661190e-02, 3.56857218059479508465e-02, 2.77447201596329011408e-02, - -2.09552594775335998545e-02, 1.43951419283830060747e-02, 5.39902985778747748769e-02, 2.12233791683978864628e-02, -1.06021857317053335573e-02, - -1.29173575974317281917e-02, 2.33645540297061204277e-03, 2.61896609343018451146e-03, -1.14595932568608803448e-02, 3.56767949738183843926e-04, - 2.01246788122515993247e-02, 1.99364141245472692443e-01, 1.02386975283006720350e-02, 1.46491539292862016364e-01, -2.92173375533333390397e-01, - -2.79882649001711690528e-02, 7.89598614348374083782e-02, 1.73932768517874730696e-02, -1.69430993280276553925e-01, -3.49439319604140236075e-02, - -2.41776119023419042153e-02, -1.19007451411664612329e-02, 7.52785183419538428407e-02, 8.00732324924654653708e-02, 5.80254140930885203842e-02, - -2.99344525092792301812e-02, 2.00701049258613407889e-02, -4.85173141225875570459e-02, -1.24597145763424926868e-01, -1.51901004582441958440e-02, - -1.61680779553563594431e-02, 6.85542113027582250551e-02, 4.25745326736892623631e-02, -1.06278911193231559440e-04, 9.76285197536541464458e-03, - 3.87428701891937912749e-02, -2.30639988244256723127e-02, 6.36890026034679732764e-03, 3.02413182033626840028e-02, 3.88836672433736253024e-03, - -9.08662711955680046927e-02, 4.01745378306784250988e-02, 1.03266559093635329480e-01, 2.14979137912293429002e-03, -5.41722635351460576891e-02, - 2.61282597269434195553e-02, -1.88195226737477086520e-03, -2.19435523135619973967e-02, 1.32921056129775890658e-02, -1.39584001825611234843e-02, - -2.33277834487258597940e-02, 3.20387242392535485924e-03, -2.56605748623718842027e-02, 3.00558911102263848214e-02, 3.05648112133436906934e-02, - -2.59104772664633942192e-03, -3.60234150814368395133e-02, 1.89051474579463585357e-01, 7.67659810167127809599e-02, -1.24703387595890141659e-01, - 1.16494243349512860419e-01, -1.23273291315800521267e-02, -8.52472265397304362899e-02, 4.85995814815475199455e-02, -4.91533864052588892468e-02, - 7.09392924651690154336e-02, 3.86918200904741022006e-02, -6.05870726251201280332e-02, 1.26662290542081668043e-01, -1.26300238339170367574e-02, - -2.77371050405810226636e-02, -5.43586513698262885352e-02, -7.86459616541178574423e-02, 6.23528587727540037355e-02, -4.79677851814970662714e-02, - -6.51687150996678454806e-04, 5.76336385114276719688e-02, 1.44542478484825671209e-02, 3.16928492510423695516e-02, 1.45017405736592441823e-02, - 3.77649866255029068030e-02, 2.76488049642000443748e-04, -6.60577998684190731415e-02, -1.43760686140608738570e-02, 3.59108661833638931338e-02, - -1.96544252969081192917e-02, -3.14635605928988426605e-02, 2.73136448740384021883e-02, 4.81895944089887409700e-02, -1.41798371596522010049e-03, - -2.76940211432370950173e-02, -1.79321359038478039816e-02, -8.04857916575939247306e-03, 6.12601355103674924743e-04, -3.04826514707566033346e-02, - 3.97737096905840994271e-03, 2.93070515299252015717e-02, -1.68977509366934480761e-01, 3.32231696372570911580e-03, 1.25024830498748684704e-01, - 1.14603027997231002311e-01, -1.00188353252315814901e-01, -9.84663913699934667534e-03, 4.24578628782099620764e-02, -1.37172078837733080192e-01, - -3.49285758694722614504e-02, 5.10266827849673310080e-02, -8.71727496405721724582e-02, 6.53026570180906262841e-03, 8.81977524226997683376e-02, - -6.34979748614215300240e-02, -6.75922576223946108831e-02, -9.09058087393600777748e-03, 8.58354921744265697559e-02, -3.11903783366274736655e-02, - 2.00028673474334506288e-02, 2.51992069666158204078e-02, -1.15065874504069552003e-02, 1.90952708533619654185e-02, -1.42994317615683774053e-02, - 8.38885300224805237346e-04, -3.82027498742033497225e-02, -3.67441895491770198490e-02, 2.50992455595355073994e-02, 7.01187400269996513602e-02, - -5.54375280311450654991e-02, -4.38519736099493434578e-02, -7.84180536804670973161e-03, 2.15733075413469983783e-02, -1.13430180042112986952e-03, - 1.43263625967320618049e-02, 3.38406892444173892920e-02, 2.61661740894084809961e-02, 1.89963433472952851477e-02, 4.11523810167366797808e-03, - -4.07083694738235874616e-03, -2.14250124636823323365e-02, -2.51950730394823532721e-02, 3.42343547054715646727e-02, -1.60995215305804545425e-01, - 1.46286861154573760713e-01, -1.42470612032240401268e-02, -8.74980046536548150549e-02, -4.25453860188948623788e-02, 1.17182553786398857554e-01, - -1.00991016453327253632e-01, -7.91738577441953306213e-02, 5.29573588185536445194e-02, -2.21614298461902045623e-02, 3.58602587208211864844e-02, - 2.52438926833398191718e-02, 9.41877819477729971709e-02, -6.48116676539685077074e-02, -6.92622200130770665494e-02, 3.44271533520238565140e-02, - -2.14712430694437191037e-02, 1.72316382693014427674e-02, -2.66608743584075963406e-02, -2.10082338877249467923e-02, 8.91565305172099635544e-03, - -1.23413533420058361967e-02, -6.55699200671947673991e-03, -6.50539642022832619028e-03, 1.51124007337151353147e-02, 5.20370287348198221067e-03, - 2.44544519960917354495e-02, 8.17735780033393942767e-03, -3.77816692303542945967e-04, -2.75580902253722351269e-02, 1.61366174765763085996e-02, - -2.54225642602667507852e-02, -5.68510449978476550825e-02, 1.03315681722852791002e-02, 5.48232041684815468024e-03, -3.22722809472682503618e-02, - 1.68859338049149008965e-02, 6.21665123569529881609e-02, -1.49734091796970530952e-01, -1.69848035269845681894e-01, 7.28166844225807269320e-02, - -9.38546660994197951000e-02, -5.98972210309676594830e-02, 1.60189670628219316129e-01, 9.68228235109596380159e-02, -1.14699218288179388692e-01, - 5.22495478003770982833e-02, -2.50191304829539204468e-02, 2.77221049132821764638e-02, 5.25053174572039649259e-02, 4.67049795137407172674e-02, - -4.25063623233455645245e-02, -7.79015735544906322285e-03, 8.35061691171900405406e-02, -2.77565926301914164820e-02, -3.55176007501909543618e-02, - 5.22884040187019810686e-02, 4.47524306813492939866e-03, 3.34858736182796073999e-02, 2.18065090398272508343e-02, 3.96249948248765804237e-02, - -1.75050000687652293485e-02, -5.30639824787136182155e-03, 1.31658536276919365532e-02, -3.54893637807925724226e-02, 1.44838563901157494143e-03, - 2.53219139441511024990e-02, 1.51209661740110620776e-02, -3.18928979311501516886e-03, 8.08035892351891861518e-03, 1.49482343348299774599e-02, - -4.67401524501743839690e-02, 8.81785937471118302922e-02, 1.09443858484468511949e-01, 9.61675669132599497679e-02, -7.39592182705455791769e-02, - 8.87508822651789097691e-02, -7.91714174638406542606e-02, -1.25898861391198962911e-01, 8.84171948090256565322e-02, 3.93482215277929509023e-02, - -6.26211797345710557972e-02, 3.11866892937116280127e-02, 1.54206070094080910371e-01, -7.15962414998223273255e-02, 4.04187883182457047271e-02, - 3.87320351160306483584e-02, -2.13087169719965857650e-02, 2.04352330201420621936e-02, 3.60324068311299108847e-02, -6.71927151509099790383e-02, - -5.86355402262732916530e-02, 1.95738272971190847838e-02, 1.19986570986449735121e-02, -4.16517345466257682407e-02, 4.57582247311850084937e-02, - -5.64919874467361762815e-02, -2.96306742467898837426e-03, 3.45918894384134034681e-02, 9.37965919443191353810e-03, -5.31266846947417263614e-03, - 7.44645101900219368030e-03, -8.16779483872519251886e-03, -1.49486275306286754694e-02, 5.40961754497425346966e-03, -6.07743621110200162722e-03, - -2.86027271239626297572e-02, 9.28607307596479303324e-02, 1.15334393912762608880e-01, 2.22619048233438435180e-02, -2.81988516854455167904e-02, - -3.27953711282213400402e-02, -7.26623103447188861681e-02, -6.21318073281297983401e-02, 8.15860644657136341307e-02, 1.79600966703069159225e-02, - -8.26984672948943289050e-02, 2.66922837734803533594e-02, -5.62012642483699781382e-02, -7.54479658771655264937e-02, 5.63921972458279810447e-02, - -8.88808665037604112014e-03, 4.49098738994229513752e-04, -1.64624335502902702233e-02, 5.00902714527058645633e-02, 1.06477908341492902983e-02, - 2.19722684831073211686e-02, 9.27897245497274342219e-03, -1.38071463629181757221e-02, -3.25812324194547434097e-02, -3.02235182235052954325e-02, - 2.70211283173303479233e-02, 1.78695725115783597692e-02, -1.97856995310294429824e-02, 2.14583909244959528118e-02, 8.31160096115654556392e-03, - -7.96044059263601583298e-03, -7.03711411983747731069e-03, -7.52245974116911853002e-02, -7.17896739726268801052e-02, 1.07396425196690896431e-02, - 7.25906809169843403318e-02, -9.45023972725838740105e-02, -6.71199808984563744962e-02, 7.35264690791543329418e-02, 2.98610952212447697263e-02, - -7.52442146662268135371e-04, 9.23976694955527116937e-02, 4.60854381027500578649e-02, -5.81010137429742931636e-02, 5.19935015121687146844e-02, - -4.28751313838296663206e-02, 2.68412731409498166169e-02, 9.92974085166531926505e-03, -1.41649957602334279627e-02, 8.49484772510930227774e-03, - 1.60608334268962397659e-03, 1.53969582107269485627e-02, 2.53654424332110106644e-02, 2.20836817019017840613e-02, -4.96400766026642691758e-03, - -4.63895546537213768895e-03, -3.69755978269468085773e-02, -4.24220279369531480529e-02, -2.80842055465305032516e-03, 3.43511446156298310903e-03, - 1.50427480682660263955e-02, -7.64781824357823984684e-03, 1.55431405065905338392e-02, -5.28685500234718219748e-02, -4.81425552620864186104e-02, - -6.98904426260522071424e-02, -5.69063762150740712342e-02, -2.01599484306710097226e-02, -7.08142573082899164094e-03, 1.60387886663503793916e-02, - -8.26785713680359968247e-02, 2.82003440014560874394e-02, 2.73932418290509169245e-02, -3.17992788170617102228e-02, 5.85714331111230612770e-02, - 5.86577384557991701741e-02, -2.75299012996250893476e-03, -8.45195718330371027760e-03, -1.36279044444791216234e-02, -1.13870143130110085955e-02, - -9.47170994530230694886e-03, 8.38589777991547574709e-03, -2.44907795135516845320e-02, -1.88112311627625997112e-02, 1.66825300517051550164e-02, - -1.40472696715355817310e-02, 4.07602998308370448322e-02, 4.52331228574007898624e-03, -7.41516905358174677892e-03, -1.90839799893427405908e-02, - 1.37235319648593090402e-01, -5.07166887609150802974e-03, 1.66347985382777688312e-02, -8.94058332794331472870e-02, -9.96617048317507969735e-03, - -3.39998201752246195784e-02, -2.72752305938337435975e-02, 1.41116199971288980557e-04, 1.20136294077674496417e-02, 1.21046096252801875515e-02, - 4.67374536088999582156e-03, 1.76093997807116745338e-03, -6.49132489663982719524e-03, 6.34253853067380107822e-02, 4.20234078454048282092e-02, - -3.39907942260764435460e-03, -3.13684078013621997494e-02, -5.59725664044557688626e-03, 1.46041344723689698465e-02, 8.15628093364801319554e-03, - 8.81123245682426982361e-03, -5.36576704715815769320e-02, 4.13564181087699121731e-03, 6.66570175208870251832e-03, -3.06753731552251258582e-03, - 3.24260047333155276839e-02, 3.78357123622976698057e-03, 1.22559252382635042178e-01, -3.26726534731656623189e-02, -4.57263244390499479231e-02, - 1.23161267442891183416e-02, 5.60898223233850107272e-02, -2.07946281596515653023e-02, 3.30973059009364162231e-02, 3.79099335956614089116e-02, - 3.02099801034241572523e-03, -4.11260349557933183040e-02, -2.09662321613402133358e-02, -1.35059512400454856396e-02, 2.11033519015176411482e-02, - 2.49738730383721862366e-03, 1.80042474049896738739e-03, -4.21972590754290111104e-02, 7.84304881856809008034e-03, 1.28611420258033324476e-02, - 1.53304442551651341764e-02, 1.14809771240723442615e-02, 5.45508167269171534430e-03, 6.03486224308978115582e-03, -6.17922023172545829134e-03, - -1.06402780093771354153e-01, -1.06566854283863088337e-01, -1.56672555450536946098e-02, -4.17617234129553371869e-02, -5.84327485785076233826e-02, - 1.72707037153512245331e-02, -4.27180361478920241763e-03, 3.83975587930814599158e-02, 7.18917519991502662613e-02, 1.73599075858622414748e-02, - -5.06102136889801795805e-02, -2.28302899957008066656e-02, 4.05449577890660689539e-02, 6.05903063932164507449e-03, 1.42495320779388468663e-02, - -1.46505630681158707102e-02, -5.51579872998721708333e-03, -2.03950903125686006101e-02, 1.71600095189964607645e-02, 3.10141280680510215972e-02, - -6.92078952483923121042e-03, -1.25723580586239959064e-03, 4.83571917759556130223e-02, -1.08848884748079619000e-01, -7.62227492845969547414e-03, - 3.98614872899268266049e-02, 2.51496883852979809248e-02, -7.45157236466782307849e-02, -2.54315956467565489063e-02, 5.86785913495517369443e-02, - 6.07261945507166309849e-03, 2.37710782485035070077e-02, 2.40958099664499367232e-03, 8.00723308014901838381e-03, 5.57202821065413758661e-02, - -6.18738592105032812751e-03, 1.57471692604664484198e-03, -2.08797558382940772262e-03, -2.73200765442419279960e-02, -2.06208586891517380024e-02, - 6.40309150046379439887e-04, 3.34147637908005640250e-02, -2.31245128603038314907e-02, 3.13805487530873783442e-02, -3.76503956682762222496e-02, - 3.82033717675601958152e-02, 6.08549869979059313008e-02, -1.40664950951139375995e-02, 1.20432450888018800772e-02, 4.11120541709728091334e-03, - -1.31431111647770104689e-02, -2.16767866450208908369e-02, 2.36444182462271527620e-03, 4.15518391649481646372e-03, -7.19797119986096724242e-03, - 3.63099914737792378583e-02, -1.71114207061806439247e-02, 9.12094809288829279359e-03, -2.00581984724530065778e-02, 4.18093901030532240359e-03, - -1.54353999486445108563e-02, 3.77632145097120189292e-02, -8.67412239218371683425e-02, 3.74024476837445662980e-02, 7.02791955646850374784e-03, - -3.07387087745127421390e-03, 1.26170642077405754933e-02, 7.19502473862098246987e-03, 5.00348237158451253359e-02, 6.05821676660315069918e-03, - 2.81657375913338843543e-02, -2.75046494305255621871e-02, -3.32847608680125889302e-02, 4.92458523340539092161e-03, -6.97895182233836727098e-03, - -1.84078432809154611538e-02, -2.55254058040131799612e-02, 4.38596283726821068588e-03, 7.97305689082921688338e-03, -6.65251068675700718558e-02, - -2.43074168732615144076e-03, -3.21551055785660854641e-03, -2.14057386820096506863e-02, 1.73404829493880863200e-02, -2.21788279126988834011e-02, - 3.67289476360874028726e-02, 2.88921423109056961509e-02, -4.36590369050650264210e-03, -3.38015966458028857197e-03, -1.47872402615952351634e-02, - -2.67937691397940741522e-02, -4.01628891758317591032e-02, 5.37104159736995767638e-02, 3.38881421250558784175e-02, -1.94731556323654853013e-02, - 6.80080451079642287447e-04, -1.16224021866609874415e-02, -2.84314312441163938305e-02, -3.10403528556473483346e-02, -1.52614844050795953750e-02, - 1.46865039960839046523e-02, 7.74337973212646264037e-03, -2.75213939675030445919e-02, -3.12476741289728875139e-02, -3.75401476285800936306e-02, - 4.53067917901101985256e-02, 4.75497506720418041531e-03, 1.25627944556748021021e-02, 4.03046169919628882727e-02, -3.29378978115561424356e-02, - -2.51499548928088654393e-03, -1.99564144518295516484e-02, -2.63938123636600005528e-02, -1.84979990476826575141e-02, -4.75891539387540141171e-02, - 1.70189645456799328038e-02, 2.90621732209333551167e-02, 1.69695748997654785595e-02, 6.00578109434020054880e-03, 3.77405846672976205691e-02, - 1.04426223615697640751e-02, -7.42237607930411715310e-04, -1.51118572042552353624e-02, 1.29952623161545995079e-03, 1.26799047323642617713e-02, - 1.05278997248968164691e-02, 2.29682654055416574090e-02, 1.28888330591014361320e-02, -1.03014730669756075787e-02, -4.83421710205830541113e-03, - -1.90040068302814585399e-02, -4.31802671175361696410e-03 + 2.78565217180879301395e+02, 0.00000000000000000000e+00, 8.38367712240454920902e-01, 0.00000000000000000000e+00, -7.22151022768738215518e-01, + 0.00000000000000000000e+00, 1.54447137639483056404e+00, 0.00000000000000000000e+00, -8.10351659720698336287e-01, 0.00000000000000000000e+00, + 6.45930713064333694717e-01, 0.00000000000000000000e+00, -1.73417955255619204991e-01, 0.00000000000000000000e+00, -9.09351867483918913093e-02, + 0.00000000000000000000e+00, -3.00845517613623769648e-02, 0.00000000000000000000e+00, -1.97522108657794209785e-01, 0.00000000000000000000e+00, + 1.45006392199800160370e-01, 0.00000000000000000000e+00, -6.92319525648382033678e-02, 0.00000000000000000000e+00, -3.37495245995370396486e-01, + 0.00000000000000000000e+00, 2.93969252845082296144e-01, 0.00000000000000000000e+00, 5.22791676917648828748e-02, 0.00000000000000000000e+00, + -4.31020055899014042922e-02, 0.00000000000000000000e+00, -5.34277055570271386387e-02, 0.00000000000000000000e+00, 1.57725778753141337996e-01, + 0.00000000000000000000e+00, -1.38048966071163903280e-01, 0.00000000000000000000e+00, 7.95936533884674390915e-02, 0.00000000000000000000e+00, + -5.08988096408558021722e-03, 0.00000000000000000000e+00, -3.17356690459940984916e-02, 0.00000000000000000000e+00, -7.97854100625838141836e-02, + 0.00000000000000000000e+00, -1.25759522048120825355e-01, 0.00000000000000000000e+00, 1.41095505007377608475e-01, 0.00000000000000000000e+00, + -2.90041709701537933630e-02, 0.00000000000000000000e+00, 1.16118748810570035501e-01, 0.00000000000000000000e+00, -1.42650207377574778089e-01, + 0.00000000000000000000e+00, 6.63859656709936268859e-02, 0.00000000000000000000e+00, -8.43008351127146754456e-02, 0.00000000000000000000e+00, + 8.11805506119530340126e-02, 0.00000000000000000000e+00, -2.92579106275835476580e+00, -2.73257362252726822283e-02, -2.31503061096297768628e+00, + 2.98481883110496337697e-01, 2.32422954464165210098e+00, -9.36624989809203695179e-02, -1.13647173814196378316e+00, -4.24970312443540054748e-01, + 1.26754821773852066613e+00, -7.20859094680278700285e-02, -9.51306475614490221204e-01, 6.14867632012408793507e-01, -9.85091038732955892598e-02, + -6.34523215803268758606e-02, -6.78708060411115782218e-02, -1.35311523427619539994e-01, -9.04935301775932621204e-02, -9.78101007785831533248e-02, + -9.81097374871810895547e-04, 1.80616098092357818539e-02, -2.64791786212412172397e-02, -4.76558495508507054539e-02, -1.96341419265033012564e-01, + 3.40906457596743608929e-02, -7.81262194523913988675e-02, -1.90201799489863598858e-01, 2.25178750048809411810e-01, 2.86704542482240504198e-03, + -1.19805102746233238520e-02, 1.68969022321052431135e-02, 5.64738950483129331648e-02, -1.39757566954298140249e-01, -7.44084433787887133960e-02, + -1.79448737058076172868e-02, 6.14333363921325120716e-02, 4.42090839521651901567e-02, -1.59177621940344016238e-02, -2.45259140787589882682e-02, + 4.14722887926062475095e-02, -9.08467249754976585718e-02, 7.32634132869659504550e-02, 3.98083190502361433660e-02, -6.23330309466623433412e-02, + 3.23061735747387016038e-02, 5.24308078374175548508e-02, -6.52853670335678676340e-02, -4.74582205706168894221e-02, -2.57646217050176394581e-02, + 4.85326601320503064896e-02, 4.57836316487753580695e-02, -1.61395013977115135695e-02, -4.31399408593192076888e-02, -1.72982609465274252136e-02, + 2.05141743795376405024e-02, 5.13479785723864323721e-02, 2.02753965345298277356e-02, -9.62325942856205422682e-03, -1.21013000039295196344e-03, + 4.61377663687331032727e-02, -6.90153405245983028390e-04, -1.66104804699747843344e+00, 1.79666906865138087390e-01, 7.23133875761683864170e-01, + 4.15103729262486009777e-01, -3.04359433047895144853e-01, -1.33601223735748869670e-01, 1.11896993727331572899e+00, -5.97930191729183602156e-01, + -3.21482407719980045613e-01, -6.44440729482515239912e-02, -1.39643167588630684461e-01, -7.87344252201049310536e-02, -2.74194962741515224636e-01, + 3.16014987883590156570e-02, 2.61916687188788577245e-01, -2.29041295889389484586e-01, 1.37413993896893793512e-02, 1.02848928276271345261e-01, + -8.45943398257167356036e-02, -8.55836430183285895579e-02, -2.14692485939022847941e-02, -5.00660400534810728912e-02, 4.10286932308298671335e-02, + 5.98356967342531728682e-02, -6.87268417209678655899e-02, -1.00834342061879356223e-01, 2.89946855441678558174e-02, 6.84096422422015987275e-02, + 7.90905646811665974383e-02, 1.22761627402924594632e-02, -7.19296897992387496146e-02, -1.19563518571031840443e-01, 3.53949764125303933948e-02, + 3.49389806984224948749e-02, -1.34556768717593006057e-01, 1.30036738800839157815e-01, 1.47453022488737178763e-01, -1.75187106897877128975e-02, + -5.71655857598896560701e-02, -2.22513683371899778640e-02, 5.11984135243400070858e-02, 4.32198440146361120839e-02, -3.79006811678369512353e-02, + -1.61948869817943215399e-02, 5.87864730303968852088e-02, 7.56143666040565154418e-03, 3.79735451815043784096e-02, 4.88357571184367539319e-03, + -3.44600211423619568266e-03, 8.45175251030964858057e-03, 2.06501052974025246789e-02, -2.27945980601942863042e-02, 7.52792623890808781928e-02, + -4.07335076464383702421e-02, -1.22373247319515162691e-03, 7.12818582736400585542e-03, -2.08797409246280901707e-02, 2.35344435031375059930e-02, + 5.38553837448995376125e-02, 2.29385900837120154661e-01, -3.60512186055045147359e-01, 4.09262094434219958483e-01, -1.43204915316633707434e-01, + 1.76661646314910159017e-01, 1.59424540157772631765e-01, 1.19996653025061628117e-01, 9.74032138671445946176e-02, 8.01756516767066496065e-02, + -4.22092435868048232450e-01, 3.42598707334977881089e-01, 7.26427774784764446192e-02, -1.92869792680440410582e-04, -9.14800737566894561770e-02, + 1.86904852575672325576e-01, 9.03785536307215725538e-02, -8.70628859333670845899e-02, -1.20357023393743836626e-01, 1.30276821268167974921e-01, + -5.50418496727855255379e-02, -1.39930929689677463479e-01, -4.10997318303747902202e-02, 1.66027061444833590187e-01, -3.31025873454900559922e-02, + 5.45967001368218574076e-02, -1.86051192758042188702e-01, 3.57669212138109621213e-02, 1.96823682403928168494e-01, 1.12736638944959083330e-01, + -1.18563060708320622272e-01, -7.11264215849067293895e-02, -3.33098969956449747487e-02, 4.88100702343404121986e-02, 2.04094083090545080905e-02, + 7.78285563663724117012e-02, -4.14113893806803898268e-02, 1.26375672481289953730e-02, 1.38745116741378599068e-01, -8.57558938152793923115e-03, + -9.29289689333271246019e-02, -8.27276771926104548260e-02, 5.84956615429012907748e-02, 2.29399633044502938156e-03, -2.09824524198216422546e-03, + -2.30538708704958079931e-02, 3.77132043821169771203e-02, 6.53337758882697045015e-02, -3.06667712165429387494e-02, -1.14650515581519504144e-02, + 1.46194883433694872849e-02, 3.46636747707448856712e-03, -4.35546278336838635359e-02, 6.29051255528407793349e-02, 6.12210568933847180256e-03, + 2.07571937975545607602e-02, 3.35768305063385619214e-01, 7.46266949448459948613e-01, -6.72463631746016698987e-02, -1.94536700956528363360e-01, + -2.75088750614828209118e-02, 1.42328699967799371384e-01, 3.35288125725375085739e-01, 1.29661987766008346412e-01, 2.90956042046801172107e-02, + -2.05442280573112395770e-01, -9.57252926974513779212e-02, -9.10355774240597659386e-02, -1.25784172798783761005e-01, 1.12460127036075691054e-01, + 9.44013754824246931197e-02, -6.05135930061245497225e-02, 9.42673278665148578481e-02, 2.00615512602382500829e-01, -5.92185875904504069323e-02, + -2.28592246943101873313e-01, -1.07412950490968162054e-01, 2.20172956055192214908e-01, 3.33294698669218958376e-01, -4.44283179185198731642e-02, + -1.01766394690480529994e-01, 1.17472184755037761805e-01, 1.04892483649878465179e-01, -6.62468314716531808672e-02, -2.45565086356498013531e-03, + 4.79072727765457034854e-02, -7.97766729243851169251e-04, -2.33714338875874692858e-02, -2.56642787088907850523e-02, -9.62514763421860042314e-02, + 3.99383399281938444858e-02, 2.88865653017884548015e-02, -5.15182520475396393822e-02, 8.26498791523299636275e-02, -2.98742841129583554249e-02, + -8.28182978045203938011e-02, 3.14455026979475749105e-02, -1.53345808562610789669e-03, -3.62400610998830294274e-02, -2.51728077975302867719e-02, + -3.02379015962623703961e-02, 2.68910770206758423240e-02, -8.22634968902352312070e-03, 3.66544933660152699728e-02, 1.32356634436242674713e-02, + 3.21880247207419244518e-03, -1.97571016662111687001e-02, 5.93796945717029508310e-03, -4.31413602924163308572e-02, -2.72339719264069676785e-02, + -1.87274725743593273286e-01, 1.39283127485721136551e-01, 4.74963034217010249272e-01, -3.42073553333540392174e-01, 4.83885077044606606855e-02, + -2.59068005795831224347e-01, -2.13264680765766156956e-01, -7.36008484860203593403e-02, -8.13152420843461926081e-02, -1.21927665578479005326e-02, + 1.79904544651649317411e-01, -1.09959740517953624694e-01, -2.22065490779929819443e-01, 7.14015849729179447047e-02, -5.85031872787839662964e-03, + 9.72943249874637094976e-02, 1.58464145663301525513e-01, -6.23660570620122936547e-02, -2.05086286960385583145e-01, -5.07929431274403847540e-02, + 4.21897204870116185327e-02, -6.99935466206487028051e-02, -6.71348953496629374804e-02, 1.65743074443523596972e-01, 8.56850642116062655163e-02, + -1.19953810412321809631e-01, -7.40173516101229334030e-02, 1.18865945768013535344e-02, -7.71584669380707965924e-02, -6.31283399388396088137e-02, + -1.45882854372074655114e-01, 6.29307315713034526317e-02, 1.48912624660626508738e-02, -6.72819324032104260080e-02, 3.22547499735358483841e-02, + 4.97387743825052491831e-02, -5.43073271907661761504e-02, 1.52590958854153246893e-02, 2.92721489192738311066e-03, -1.87663839736718872364e-02, + -3.80050872053503069684e-03, 5.91273447672226934446e-02, -2.83684585809016896404e-03, 1.70512827209476636181e-02, -1.44259815516434488497e-02, + -8.06597987912826830392e-02, 5.19954562777717940736e-02, 1.09504480128524081528e-02, 1.26439885486616093030e-02, -2.34593647937779382559e-03, + 2.47413111762442641806e-02, -6.13559850860111253429e-03, -6.05626633742831349538e-02, -1.98467175793774985859e-01, 3.18979113074946862838e-01, + 6.23356771079433893967e-02, 1.30138108749532965813e-01, -1.05230501466137910116e-01, -6.87754575227078057686e-02, -4.22436887367944324811e-02, + 7.57926459563205562331e-02, 4.78504387573109452036e-02, -2.22681497547184761854e-02, 8.46951897073950493722e-02, -7.44317622658197293462e-03, + -1.89157622212636281067e-02, -6.19719693803440774271e-02, -8.37644347918033160827e-03, 1.32514981682897603488e-01, -1.09126775888557903116e-01, + -6.47849222903969929055e-03, 4.65591560634076861991e-02, -2.24234845462696341656e-01, 7.29582023256248463072e-02, 2.23965783883813690514e-03, + -5.19349169152241198211e-03, 2.25395864383192284786e-02, 9.10694488527918760701e-02, 7.36945737152017443794e-02, -2.16337158651918673447e-02, + -5.35436418307164291308e-02, 2.40342905027485786995e-02, 4.81946656785084762142e-02, -3.06521617296798450092e-02, -4.07904977042986977009e-02, + 6.32948267919029999851e-02, 4.53192474361057834331e-02, -2.29008122631283589365e-02, 1.62576382380966721897e-02, 3.82842631619570161750e-02, + 3.52346794652655739832e-02, -3.95023093184828782976e-02, -3.15659719925446974331e-02, 4.02431236080928178556e-02, 2.45684617558553607120e-02, + -1.93194945947791144047e-02, -2.48322169406506726430e-02, -1.13621415403786386183e-02, -3.31487361399904478798e-02, 1.68675563537488623633e-02, + 4.01325091519489432490e-02, 4.14338905584917469027e-02, 1.31273776950603299207e-01, 7.16276979245435152510e-03, 5.02985992698696121606e-02, + 1.78045915098635626483e-01, -1.86314001159308406663e-01, -1.35151434606926579285e-01, 1.69947309928447143346e-01, -8.37791941109623933270e-02, + 2.41195207762586322220e-02, 1.26309574838379373718e-01, -2.00571859613532021971e-01, -1.63465438373802895988e-01, -6.96363659600393730686e-02, + 1.14524330229191645403e-01, 7.12890316169484949960e-02, 5.80381889626466196397e-03, 4.93537868059431283907e-02, -8.44257746020753430116e-02, + -1.41929196365875275043e-02, 8.22387462453117029648e-02, -8.50093260265970818157e-02, 2.71192346905003156543e-02, 9.03395551304754379496e-02, + -1.71516448697893314490e-02, 8.18953521749132690166e-02, 1.11511604557867297777e-02, -4.78373059022189212053e-03, -9.53023452930306103070e-02, + 5.38686323249407891800e-02, -3.84678611713600085431e-02, -5.04713920668615947246e-03, 6.80811773653991481048e-02, -3.33049215638338835799e-02, + -5.28099294606356045589e-02, -7.54699335274512245197e-02, -5.40781758032556764126e-03, 8.29793590010352716257e-02, -5.97312971039127629802e-02, + -2.71427292677366080453e-02, -6.36007393417800138968e-03, -6.21102608067901958838e-03, 1.20982775517295207401e-02, -1.17366629581995736420e-02, + 3.79477291991657597614e-02, 4.16172556173764890408e-02, -4.15482630953573559007e-02, -2.10178763811884848633e-02, 2.25384141584651191692e-02, + 3.26544906456272876483e-01, 1.14875244914279722730e-01, -1.66631737648658934114e-01, -6.36733988328790686401e-03, 1.05207112351735077027e-01, + -2.56656713269180158932e-01, 6.60485459910778310855e-02, 4.17130045127815929362e-02, -7.37791748174861372611e-02, 7.60523512741725499220e-02, + -4.55959006761720783696e-02, -2.36680526647207629953e-02, 1.10634117950077798254e-01, -2.08651727388676766495e-02, -7.64711683504649686327e-02, + 8.13422913278145920390e-03, 7.93342835009738511776e-02, -1.36145811582776665727e-01, 3.71088391279384144372e-02, 3.21562962981391253781e-02, + -1.14387894243613869039e-01, -1.51631103622234392203e-03, 5.78217444722389575795e-02, -4.71124806075210594836e-03, 1.51729749910356030707e-02, + 9.74258177618566034717e-02, -1.10011849267590264279e-01, -9.55723084321756233273e-02, 5.40108889439728720450e-02, 2.20372759806924181647e-02, + -3.12940070328804331723e-02, 7.31829279647891323135e-02, -5.03897879848870661190e-02, 3.56857218059479508465e-02, 2.77447201596329011408e-02, + -2.09552594775335998545e-02, 1.43951419283830060747e-02, 5.39902985778747748769e-02, 2.12233791683978864628e-02, -1.06021857317053335573e-02, + -1.29173575974317281917e-02, 2.33645540297061204277e-03, 2.61896609343018451146e-03, -1.14595932568608803448e-02, 3.56767949738183843926e-04, + 2.01246788122515993247e-02, 1.99364141245472692443e-01, 1.02386975283006720350e-02, 1.46491539292862016364e-01, -2.92173375533333390397e-01, + -2.79882649001711690528e-02, 7.89598614348374083782e-02, 1.73932768517874730696e-02, -1.69430993280276553925e-01, -3.49439319604140236075e-02, + -2.41776119023419042153e-02, -1.19007451411664612329e-02, 7.52785183419538428407e-02, 8.00732324924654653708e-02, 5.80254140930885203842e-02, + -2.99344525092792301812e-02, 2.00701049258613407889e-02, -4.85173141225875570459e-02, -1.24597145763424926868e-01, -1.51901004582441958440e-02, + -1.61680779553563594431e-02, 6.85542113027582250551e-02, 4.25745326736892623631e-02, -1.06278911193231559440e-04, 9.76285197536541464458e-03, + 3.87428701891937912749e-02, -2.30639988244256723127e-02, 6.36890026034679732764e-03, 3.02413182033626840028e-02, 3.88836672433736253024e-03, + -9.08662711955680046927e-02, 4.01745378306784250988e-02, 1.03266559093635329480e-01, 2.14979137912293429002e-03, -5.41722635351460576891e-02, + 2.61282597269434195553e-02, -1.88195226737477086520e-03, -2.19435523135619973967e-02, 1.32921056129775890658e-02, -1.39584001825611234843e-02, + -2.33277834487258597940e-02, 3.20387242392535485924e-03, -2.56605748623718842027e-02, 3.00558911102263848214e-02, 3.05648112133436906934e-02, + -2.59104772664633942192e-03, -3.60234150814368395133e-02, 1.89051474579463585357e-01, 7.67659810167127809599e-02, -1.24703387595890141659e-01, + 1.16494243349512860419e-01, -1.23273291315800521267e-02, -8.52472265397304362899e-02, 4.85995814815475199455e-02, -4.91533864052588892468e-02, + 7.09392924651690154336e-02, 3.86918200904741022006e-02, -6.05870726251201280332e-02, 1.26662290542081668043e-01, -1.26300238339170367574e-02, + -2.77371050405810226636e-02, -5.43586513698262885352e-02, -7.86459616541178574423e-02, 6.23528587727540037355e-02, -4.79677851814970662714e-02, + -6.51687150996678454806e-04, 5.76336385114276719688e-02, 1.44542478484825671209e-02, 3.16928492510423695516e-02, 1.45017405736592441823e-02, + 3.77649866255029068030e-02, 2.76488049642000443748e-04, -6.60577998684190731415e-02, -1.43760686140608738570e-02, 3.59108661833638931338e-02, + -1.96544252969081192917e-02, -3.14635605928988426605e-02, 2.73136448740384021883e-02, 4.81895944089887409700e-02, -1.41798371596522010049e-03, + -2.76940211432370950173e-02, -1.79321359038478039816e-02, -8.04857916575939247306e-03, 6.12601355103674924743e-04, -3.04826514707566033346e-02, + 3.97737096905840994271e-03, 2.93070515299252015717e-02, -1.68977509366934480761e-01, 3.32231696372570911580e-03, 1.25024830498748684704e-01, + 1.14603027997231002311e-01, -1.00188353252315814901e-01, -9.84663913699934667534e-03, 4.24578628782099620764e-02, -1.37172078837733080192e-01, + -3.49285758694722614504e-02, 5.10266827849673310080e-02, -8.71727496405721724582e-02, 6.53026570180906262841e-03, 8.81977524226997683376e-02, + -6.34979748614215300240e-02, -6.75922576223946108831e-02, -9.09058087393600777748e-03, 8.58354921744265697559e-02, -3.11903783366274736655e-02, + 2.00028673474334506288e-02, 2.51992069666158204078e-02, -1.15065874504069552003e-02, 1.90952708533619654185e-02, -1.42994317615683774053e-02, + 8.38885300224805237346e-04, -3.82027498742033497225e-02, -3.67441895491770198490e-02, 2.50992455595355073994e-02, 7.01187400269996513602e-02, + -5.54375280311450654991e-02, -4.38519736099493434578e-02, -7.84180536804670973161e-03, 2.15733075413469983783e-02, -1.13430180042112986952e-03, + 1.43263625967320618049e-02, 3.38406892444173892920e-02, 2.61661740894084809961e-02, 1.89963433472952851477e-02, 4.11523810167366797808e-03, + -4.07083694738235874616e-03, -2.14250124636823323365e-02, -2.51950730394823532721e-02, 3.42343547054715646727e-02, -1.60995215305804545425e-01, + 1.46286861154573760713e-01, -1.42470612032240401268e-02, -8.74980046536548150549e-02, -4.25453860188948623788e-02, 1.17182553786398857554e-01, + -1.00991016453327253632e-01, -7.91738577441953306213e-02, 5.29573588185536445194e-02, -2.21614298461902045623e-02, 3.58602587208211864844e-02, + 2.52438926833398191718e-02, 9.41877819477729971709e-02, -6.48116676539685077074e-02, -6.92622200130770665494e-02, 3.44271533520238565140e-02, + -2.14712430694437191037e-02, 1.72316382693014427674e-02, -2.66608743584075963406e-02, -2.10082338877249467923e-02, 8.91565305172099635544e-03, + -1.23413533420058361967e-02, -6.55699200671947673991e-03, -6.50539642022832619028e-03, 1.51124007337151353147e-02, 5.20370287348198221067e-03, + 2.44544519960917354495e-02, 8.17735780033393942767e-03, -3.77816692303542945967e-04, -2.75580902253722351269e-02, 1.61366174765763085996e-02, + -2.54225642602667507852e-02, -5.68510449978476550825e-02, 1.03315681722852791002e-02, 5.48232041684815468024e-03, -3.22722809472682503618e-02, + 1.68859338049149008965e-02, 6.21665123569529881609e-02, -1.49734091796970530952e-01, -1.69848035269845681894e-01, 7.28166844225807269320e-02, + -9.38546660994197951000e-02, -5.98972210309676594830e-02, 1.60189670628219316129e-01, 9.68228235109596380159e-02, -1.14699218288179388692e-01, + 5.22495478003770982833e-02, -2.50191304829539204468e-02, 2.77221049132821764638e-02, 5.25053174572039649259e-02, 4.67049795137407172674e-02, + -4.25063623233455645245e-02, -7.79015735544906322285e-03, 8.35061691171900405406e-02, -2.77565926301914164820e-02, -3.55176007501909543618e-02, + 5.22884040187019810686e-02, 4.47524306813492939866e-03, 3.34858736182796073999e-02, 2.18065090398272508343e-02, 3.96249948248765804237e-02, + -1.75050000687652293485e-02, -5.30639824787136182155e-03, 1.31658536276919365532e-02, -3.54893637807925724226e-02, 1.44838563901157494143e-03, + 2.53219139441511024990e-02, 1.51209661740110620776e-02, -3.18928979311501516886e-03, 8.08035892351891861518e-03, 1.49482343348299774599e-02, + -4.67401524501743839690e-02, 8.81785937471118302922e-02, 1.09443858484468511949e-01, 9.61675669132599497679e-02, -7.39592182705455791769e-02, + 8.87508822651789097691e-02, -7.91714174638406542606e-02, -1.25898861391198962911e-01, 8.84171948090256565322e-02, 3.93482215277929509023e-02, + -6.26211797345710557972e-02, 3.11866892937116280127e-02, 1.54206070094080910371e-01, -7.15962414998223273255e-02, 4.04187883182457047271e-02, + 3.87320351160306483584e-02, -2.13087169719965857650e-02, 2.04352330201420621936e-02, 3.60324068311299108847e-02, -6.71927151509099790383e-02, + -5.86355402262732916530e-02, 1.95738272971190847838e-02, 1.19986570986449735121e-02, -4.16517345466257682407e-02, 4.57582247311850084937e-02, + -5.64919874467361762815e-02, -2.96306742467898837426e-03, 3.45918894384134034681e-02, 9.37965919443191353810e-03, -5.31266846947417263614e-03, + 7.44645101900219368030e-03, -8.16779483872519251886e-03, -1.49486275306286754694e-02, 5.40961754497425346966e-03, -6.07743621110200162722e-03, + -2.86027271239626297572e-02, 9.28607307596479303324e-02, 1.15334393912762608880e-01, 2.22619048233438435180e-02, -2.81988516854455167904e-02, + -3.27953711282213400402e-02, -7.26623103447188861681e-02, -6.21318073281297983401e-02, 8.15860644657136341307e-02, 1.79600966703069159225e-02, + -8.26984672948943289050e-02, 2.66922837734803533594e-02, -5.62012642483699781382e-02, -7.54479658771655264937e-02, 5.63921972458279810447e-02, + -8.88808665037604112014e-03, 4.49098738994229513752e-04, -1.64624335502902702233e-02, 5.00902714527058645633e-02, 1.06477908341492902983e-02, + 2.19722684831073211686e-02, 9.27897245497274342219e-03, -1.38071463629181757221e-02, -3.25812324194547434097e-02, -3.02235182235052954325e-02, + 2.70211283173303479233e-02, 1.78695725115783597692e-02, -1.97856995310294429824e-02, 2.14583909244959528118e-02, 8.31160096115654556392e-03, + -7.96044059263601583298e-03, -7.03711411983747731069e-03, -7.52245974116911853002e-02, -7.17896739726268801052e-02, 1.07396425196690896431e-02, + 7.25906809169843403318e-02, -9.45023972725838740105e-02, -6.71199808984563744962e-02, 7.35264690791543329418e-02, 2.98610952212447697263e-02, + -7.52442146662268135371e-04, 9.23976694955527116937e-02, 4.60854381027500578649e-02, -5.81010137429742931636e-02, 5.19935015121687146844e-02, + -4.28751313838296663206e-02, 2.68412731409498166169e-02, 9.92974085166531926505e-03, -1.41649957602334279627e-02, 8.49484772510930227774e-03, + 1.60608334268962397659e-03, 1.53969582107269485627e-02, 2.53654424332110106644e-02, 2.20836817019017840613e-02, -4.96400766026642691758e-03, + -4.63895546537213768895e-03, -3.69755978269468085773e-02, -4.24220279369531480529e-02, -2.80842055465305032516e-03, 3.43511446156298310903e-03, + 1.50427480682660263955e-02, -7.64781824357823984684e-03, 1.55431405065905338392e-02, -5.28685500234718219748e-02, -4.81425552620864186104e-02, + -6.98904426260522071424e-02, -5.69063762150740712342e-02, -2.01599484306710097226e-02, -7.08142573082899164094e-03, 1.60387886663503793916e-02, + -8.26785713680359968247e-02, 2.82003440014560874394e-02, 2.73932418290509169245e-02, -3.17992788170617102228e-02, 5.85714331111230612770e-02, + 5.86577384557991701741e-02, -2.75299012996250893476e-03, -8.45195718330371027760e-03, -1.36279044444791216234e-02, -1.13870143130110085955e-02, + -9.47170994530230694886e-03, 8.38589777991547574709e-03, -2.44907795135516845320e-02, -1.88112311627625997112e-02, 1.66825300517051550164e-02, + -1.40472696715355817310e-02, 4.07602998308370448322e-02, 4.52331228574007898624e-03, -7.41516905358174677892e-03, -1.90839799893427405908e-02, + 1.37235319648593090402e-01, -5.07166887609150802974e-03, 1.66347985382777688312e-02, -8.94058332794331472870e-02, -9.96617048317507969735e-03, + -3.39998201752246195784e-02, -2.72752305938337435975e-02, 1.41116199971288980557e-04, 1.20136294077674496417e-02, 1.21046096252801875515e-02, + 4.67374536088999582156e-03, 1.76093997807116745338e-03, -6.49132489663982719524e-03, 6.34253853067380107822e-02, 4.20234078454048282092e-02, + -3.39907942260764435460e-03, -3.13684078013621997494e-02, -5.59725664044557688626e-03, 1.46041344723689698465e-02, 8.15628093364801319554e-03, + 8.81123245682426982361e-03, -5.36576704715815769320e-02, 4.13564181087699121731e-03, 6.66570175208870251832e-03, -3.06753731552251258582e-03, + 3.24260047333155276839e-02, 3.78357123622976698057e-03, 1.22559252382635042178e-01, -3.26726534731656623189e-02, -4.57263244390499479231e-02, + 1.23161267442891183416e-02, 5.60898223233850107272e-02, -2.07946281596515653023e-02, 3.30973059009364162231e-02, 3.79099335956614089116e-02, + 3.02099801034241572523e-03, -4.11260349557933183040e-02, -2.09662321613402133358e-02, -1.35059512400454856396e-02, 2.11033519015176411482e-02, + 2.49738730383721862366e-03, 1.80042474049896738739e-03, -4.21972590754290111104e-02, 7.84304881856809008034e-03, 1.28611420258033324476e-02, + 1.53304442551651341764e-02, 1.14809771240723442615e-02, 5.45508167269171534430e-03, 6.03486224308978115582e-03, -6.17922023172545829134e-03, + -1.06402780093771354153e-01, -1.06566854283863088337e-01, -1.56672555450536946098e-02, -4.17617234129553371869e-02, -5.84327485785076233826e-02, + 1.72707037153512245331e-02, -4.27180361478920241763e-03, 3.83975587930814599158e-02, 7.18917519991502662613e-02, 1.73599075858622414748e-02, + -5.06102136889801795805e-02, -2.28302899957008066656e-02, 4.05449577890660689539e-02, 6.05903063932164507449e-03, 1.42495320779388468663e-02, + -1.46505630681158707102e-02, -5.51579872998721708333e-03, -2.03950903125686006101e-02, 1.71600095189964607645e-02, 3.10141280680510215972e-02, + -6.92078952483923121042e-03, -1.25723580586239959064e-03, 4.83571917759556130223e-02, -1.08848884748079619000e-01, -7.62227492845969547414e-03, + 3.98614872899268266049e-02, 2.51496883852979809248e-02, -7.45157236466782307849e-02, -2.54315956467565489063e-02, 5.86785913495517369443e-02, + 6.07261945507166309849e-03, 2.37710782485035070077e-02, 2.40958099664499367232e-03, 8.00723308014901838381e-03, 5.57202821065413758661e-02, + -6.18738592105032812751e-03, 1.57471692604664484198e-03, -2.08797558382940772262e-03, -2.73200765442419279960e-02, -2.06208586891517380024e-02, + 6.40309150046379439887e-04, 3.34147637908005640250e-02, -2.31245128603038314907e-02, 3.13805487530873783442e-02, -3.76503956682762222496e-02, + 3.82033717675601958152e-02, 6.08549869979059313008e-02, -1.40664950951139375995e-02, 1.20432450888018800772e-02, 4.11120541709728091334e-03, + -1.31431111647770104689e-02, -2.16767866450208908369e-02, 2.36444182462271527620e-03, 4.15518391649481646372e-03, -7.19797119986096724242e-03, + 3.63099914737792378583e-02, -1.71114207061806439247e-02, 9.12094809288829279359e-03, -2.00581984724530065778e-02, 4.18093901030532240359e-03, + -1.54353999486445108563e-02, 3.77632145097120189292e-02, -8.67412239218371683425e-02, 3.74024476837445662980e-02, 7.02791955646850374784e-03, + -3.07387087745127421390e-03, 1.26170642077405754933e-02, 7.19502473862098246987e-03, 5.00348237158451253359e-02, 6.05821676660315069918e-03, + 2.81657375913338843543e-02, -2.75046494305255621871e-02, -3.32847608680125889302e-02, 4.92458523340539092161e-03, -6.97895182233836727098e-03, + -1.84078432809154611538e-02, -2.55254058040131799612e-02, 4.38596283726821068588e-03, 7.97305689082921688338e-03, -6.65251068675700718558e-02, + -2.43074168732615144076e-03, -3.21551055785660854641e-03, -2.14057386820096506863e-02, 1.73404829493880863200e-02, -2.21788279126988834011e-02, + 3.67289476360874028726e-02, 2.88921423109056961509e-02, -4.36590369050650264210e-03, -3.38015966458028857197e-03, -1.47872402615952351634e-02, + -2.67937691397940741522e-02, -4.01628891758317591032e-02, 5.37104159736995767638e-02, 3.38881421250558784175e-02, -1.94731556323654853013e-02, + 6.80080451079642287447e-04, -1.16224021866609874415e-02, -2.84314312441163938305e-02, -3.10403528556473483346e-02, -1.52614844050795953750e-02, + 1.46865039960839046523e-02, 7.74337973212646264037e-03, -2.75213939675030445919e-02, -3.12476741289728875139e-02, -3.75401476285800936306e-02, + 4.53067917901101985256e-02, 4.75497506720418041531e-03, 1.25627944556748021021e-02, 4.03046169919628882727e-02, -3.29378978115561424356e-02, + -2.51499548928088654393e-03, -1.99564144518295516484e-02, -2.63938123636600005528e-02, -1.84979990476826575141e-02, -4.75891539387540141171e-02, + 1.70189645456799328038e-02, 2.90621732209333551167e-02, 1.69695748997654785595e-02, 6.00578109434020054880e-03, 3.77405846672976205691e-02, + 1.04426223615697640751e-02, -7.42237607930411715310e-04, -1.51118572042552353624e-02, 1.29952623161545995079e-03, 1.26799047323642617713e-02, + 1.05278997248968164691e-02, 2.29682654055416574090e-02, 1.28888330591014361320e-02, -1.03014730669756075787e-02, -4.83421710205830541113e-03, + -1.90040068302814585399e-02, -4.31802671175361696410e-03 }; #define ILCHAM 992 -#define MTRONC 30 -#define STRONC 10 +#define MTRONC 30 +#define STRONC 10 -int main (int argc, char * argv[]) +int main(int argc, char* argv[]) { size_t len; - grib_handle * h; + grib_handle* h; double zval[ILCHAM]; int m, n, k; - GRIB_CHECK (((h = grib_handle_new_from_samples (NULL, "sh_ml_grib2")) == NULL), 0); + GRIB_CHECK(((h = grib_handle_new_from_samples(NULL, "sh_ml_grib2")) == NULL), 0); /* Meteo-France settings */ - GRIB_CHECK (grib_set_long (h, "centre", 85), 0); - len = strlen ("stretched_rotated_sh"); - GRIB_CHECK (grib_set_string (h, "gridType", "stretched_rotated_sh", &len), 0); - GRIB_CHECK (grib_set_long (h, "pentagonalResolutionParameterJ", MTRONC), 0); - GRIB_CHECK (grib_set_long (h, "pentagonalResolutionParameterK", MTRONC), 0); - GRIB_CHECK (grib_set_long (h, "pentagonalResolutionParameterM", MTRONC), 0); + GRIB_CHECK(grib_set_long(h, "centre", 85), 0); + len = strlen("stretched_rotated_sh"); + GRIB_CHECK(grib_set_string(h, "gridType", "stretched_rotated_sh", &len), 0); + GRIB_CHECK(grib_set_long(h, "pentagonalResolutionParameterJ", MTRONC), 0); + GRIB_CHECK(grib_set_long(h, "pentagonalResolutionParameterK", MTRONC), 0); + GRIB_CHECK(grib_set_long(h, "pentagonalResolutionParameterM", MTRONC), 0); - GRIB_CHECK (grib_set_double (h,"stretchingFactor", 2.40000000000000), 0); - GRIB_CHECK (grib_set_double (h,"latitudeOfStretchingPoleInDegrees", 46.4688478326275), 0); - GRIB_CHECK (grib_set_double (h,"longitudeOfStretchingPoleInDegrees", 2.57831007808864), 0); + GRIB_CHECK(grib_set_double(h, "stretchingFactor", 2.40000000000000), 0); + GRIB_CHECK(grib_set_double(h, "latitudeOfStretchingPoleInDegrees", 46.4688478326275), 0); + GRIB_CHECK(grib_set_double(h, "longitudeOfStretchingPoleInDegrees", 2.57831007808864), 0); - GRIB_CHECK (grib_set_long (h, "bitsPerValue", 16), 0); - len = strlen ("spectral_complex"); - GRIB_CHECK (grib_set_string (h, "packingType", "spectral_complex", &len), 0); + GRIB_CHECK(grib_set_long(h, "bitsPerValue", 16), 0); + len = strlen("spectral_complex"); + GRIB_CHECK(grib_set_string(h, "packingType", "spectral_complex", &len), 0); - GRIB_CHECK (grib_set_long (h, "subSetJ", STRONC), 0); - GRIB_CHECK (grib_set_long (h, "subSetK", STRONC), 0); - GRIB_CHECK (grib_set_long (h, "subSetM", STRONC), 0); - GRIB_CHECK (grib_set_long (h, "unpackedSubsetPrecision", 2), 0); + GRIB_CHECK(grib_set_long(h, "subSetJ", STRONC), 0); + GRIB_CHECK(grib_set_long(h, "subSetK", STRONC), 0); + GRIB_CHECK(grib_set_long(h, "subSetM", STRONC), 0); + GRIB_CHECK(grib_set_long(h, "unpackedSubsetPrecision", 2), 0); - GRIB_CHECK (grib_set_double_array (h, "values", values, ILCHAM), 0); + GRIB_CHECK(grib_set_double_array(h, "values", values, ILCHAM), 0); len = ILCHAM; - GRIB_CHECK (grib_get_double_array (h, "values", zval, &len), 0); + GRIB_CHECK(grib_get_double_array(h, "values", zval, &len), 0); - for (m = 0, k = 0; m < MTRONC+1; m++) - for (n = m; n < MTRONC+1; k++, n++) - { + for (m = 0, k = 0; m < MTRONC + 1; m++) + for (n = m; n < MTRONC + 1; k++, n++) { /* Check sub-truncaton was fully preserved */ - if ((m < STRONC+1) && (n < STRONC+1) && ((zval[2*k] != values[2*k]) || (zval[2*k+1] != values[2*k+1]))) - { - printf ("Unpacked sub-truncation was not fully preserved; coefficients for wavenumber (m=%d,n=%d) have been modified\n", m, n); + if ((m < STRONC + 1) && (n < STRONC + 1) && ((zval[2 * k] != values[2 * k]) || (zval[2 * k + 1] != values[2 * k + 1]))) { + printf("Unpacked sub-truncation was not fully preserved; coefficients for wavenumber (m=%d,n=%d) have been modified\n", m, n); return 1; } } - GRIB_CHECK (grib_handle_delete (h), 0); + GRIB_CHECK(grib_handle_delete(h), 0); return 0; } diff --git a/tests/grib_sh_imag.c b/tests/grib_sh_imag.c index 400cad4d2..bac8a5d82 100644 --- a/tests/grib_sh_imag.c +++ b/tests/grib_sh_imag.c @@ -17,263 +17,261 @@ */ static double values[] = { - 2.78565217180879301395e+02, 0.00000000000000000000e+00, 8.38367712240454920902e-01, 0.00000000000000000000e+00, -7.22151022768738215518e-01, - 0.00000000000000000000e+00, 1.54447137639483056404e+00, 0.00000000000000000000e+00, -8.10351659720698336287e-01, 0.00000000000000000000e+00, - 6.45930713064333694717e-01, 0.00000000000000000000e+00, -1.73417955255619204991e-01, 0.00000000000000000000e+00, -9.09351867483918913093e-02, - 0.00000000000000000000e+00, -3.00845517613623769648e-02, 0.00000000000000000000e+00, -1.97522108657794209785e-01, 0.00000000000000000000e+00, - 1.45006392199800160370e-01, 0.00000000000000000000e+00, -6.92319525648382033678e-02, 0.00000000000000000000e+00, -3.37495245995370396486e-01, - 0.00000000000000000000e+00, 2.93969252845082296144e-01, 0.00000000000000000000e+00, 5.22791676917648828748e-02, 0.00000000000000000000e+00, - -4.31020055899014042922e-02, 0.00000000000000000000e+00, -5.34277055570271386387e-02, 0.00000000000000000000e+00, 1.57725778753141337996e-01, - 0.00000000000000000000e+00, -1.38048966071163903280e-01, 0.00000000000000000000e+00, 7.95936533884674390915e-02, 0.00000000000000000000e+00, - -5.08988096408558021722e-03, 0.00000000000000000000e+00, -3.17356690459940984916e-02, 0.00000000000000000000e+00, -7.97854100625838141836e-02, - 0.00000000000000000000e+00, -1.25759522048120825355e-01, 0.00000000000000000000e+00, 1.41095505007377608475e-01, 0.00000000000000000000e+00, - -2.90041709701537933630e-02, 0.00000000000000000000e+00, 1.16118748810570035501e-01, 0.00000000000000000000e+00, -1.42650207377574778089e-01, - 0.00000000000000000000e+00, 6.63859656709936268859e-02, 0.00000000000000000000e+00, -8.43008351127146754456e-02, 0.00000000000000000000e+00, - 8.11805506119530340126e-02, 0.00000000000000000000e+00, -2.92579106275835476580e+00, -2.73257362252726822283e-02, -2.31503061096297768628e+00, - 2.98481883110496337697e-01, 2.32422954464165210098e+00, -9.36624989809203695179e-02, -1.13647173814196378316e+00, -4.24970312443540054748e-01, - 1.26754821773852066613e+00, -7.20859094680278700285e-02, -9.51306475614490221204e-01, 6.14867632012408793507e-01, -9.85091038732955892598e-02, - -6.34523215803268758606e-02, -6.78708060411115782218e-02, -1.35311523427619539994e-01, -9.04935301775932621204e-02, -9.78101007785831533248e-02, - -9.81097374871810895547e-04, 1.80616098092357818539e-02, -2.64791786212412172397e-02, -4.76558495508507054539e-02, -1.96341419265033012564e-01, - 3.40906457596743608929e-02, -7.81262194523913988675e-02, -1.90201799489863598858e-01, 2.25178750048809411810e-01, 2.86704542482240504198e-03, - -1.19805102746233238520e-02, 1.68969022321052431135e-02, 5.64738950483129331648e-02, -1.39757566954298140249e-01, -7.44084433787887133960e-02, - -1.79448737058076172868e-02, 6.14333363921325120716e-02, 4.42090839521651901567e-02, -1.59177621940344016238e-02, -2.45259140787589882682e-02, - 4.14722887926062475095e-02, -9.08467249754976585718e-02, 7.32634132869659504550e-02, 3.98083190502361433660e-02, -6.23330309466623433412e-02, - 3.23061735747387016038e-02, 5.24308078374175548508e-02, -6.52853670335678676340e-02, -4.74582205706168894221e-02, -2.57646217050176394581e-02, - 4.85326601320503064896e-02, 4.57836316487753580695e-02, -1.61395013977115135695e-02, -4.31399408593192076888e-02, -1.72982609465274252136e-02, - 2.05141743795376405024e-02, 5.13479785723864323721e-02, 2.02753965345298277356e-02, -9.62325942856205422682e-03, -1.21013000039295196344e-03, - 4.61377663687331032727e-02, -6.90153405245983028390e-04, -1.66104804699747843344e+00, 1.79666906865138087390e-01, 7.23133875761683864170e-01, - 4.15103729262486009777e-01, -3.04359433047895144853e-01, -1.33601223735748869670e-01, 1.11896993727331572899e+00, -5.97930191729183602156e-01, - -3.21482407719980045613e-01, -6.44440729482515239912e-02, -1.39643167588630684461e-01, -7.87344252201049310536e-02, -2.74194962741515224636e-01, - 3.16014987883590156570e-02, 2.61916687188788577245e-01, -2.29041295889389484586e-01, 1.37413993896893793512e-02, 1.02848928276271345261e-01, - -8.45943398257167356036e-02, -8.55836430183285895579e-02, -2.14692485939022847941e-02, -5.00660400534810728912e-02, 4.10286932308298671335e-02, - 5.98356967342531728682e-02, -6.87268417209678655899e-02, -1.00834342061879356223e-01, 2.89946855441678558174e-02, 6.84096422422015987275e-02, - 7.90905646811665974383e-02, 1.22761627402924594632e-02, -7.19296897992387496146e-02, -1.19563518571031840443e-01, 3.53949764125303933948e-02, - 3.49389806984224948749e-02, -1.34556768717593006057e-01, 1.30036738800839157815e-01, 1.47453022488737178763e-01, -1.75187106897877128975e-02, - -5.71655857598896560701e-02, -2.22513683371899778640e-02, 5.11984135243400070858e-02, 4.32198440146361120839e-02, -3.79006811678369512353e-02, - -1.61948869817943215399e-02, 5.87864730303968852088e-02, 7.56143666040565154418e-03, 3.79735451815043784096e-02, 4.88357571184367539319e-03, - -3.44600211423619568266e-03, 8.45175251030964858057e-03, 2.06501052974025246789e-02, -2.27945980601942863042e-02, 7.52792623890808781928e-02, - -4.07335076464383702421e-02, -1.22373247319515162691e-03, 7.12818582736400585542e-03, -2.08797409246280901707e-02, 2.35344435031375059930e-02, - 5.38553837448995376125e-02, 2.29385900837120154661e-01, -3.60512186055045147359e-01, 4.09262094434219958483e-01, -1.43204915316633707434e-01, - 1.76661646314910159017e-01, 1.59424540157772631765e-01, 1.19996653025061628117e-01, 9.74032138671445946176e-02, 8.01756516767066496065e-02, - -4.22092435868048232450e-01, 3.42598707334977881089e-01, 7.26427774784764446192e-02, -1.92869792680440410582e-04, -9.14800737566894561770e-02, - 1.86904852575672325576e-01, 9.03785536307215725538e-02, -8.70628859333670845899e-02, -1.20357023393743836626e-01, 1.30276821268167974921e-01, - -5.50418496727855255379e-02, -1.39930929689677463479e-01, -4.10997318303747902202e-02, 1.66027061444833590187e-01, -3.31025873454900559922e-02, - 5.45967001368218574076e-02, -1.86051192758042188702e-01, 3.57669212138109621213e-02, 1.96823682403928168494e-01, 1.12736638944959083330e-01, - -1.18563060708320622272e-01, -7.11264215849067293895e-02, -3.33098969956449747487e-02, 4.88100702343404121986e-02, 2.04094083090545080905e-02, - 7.78285563663724117012e-02, -4.14113893806803898268e-02, 1.26375672481289953730e-02, 1.38745116741378599068e-01, -8.57558938152793923115e-03, - -9.29289689333271246019e-02, -8.27276771926104548260e-02, 5.84956615429012907748e-02, 2.29399633044502938156e-03, -2.09824524198216422546e-03, - -2.30538708704958079931e-02, 3.77132043821169771203e-02, 6.53337758882697045015e-02, -3.06667712165429387494e-02, -1.14650515581519504144e-02, - 1.46194883433694872849e-02, 3.46636747707448856712e-03, -4.35546278336838635359e-02, 6.29051255528407793349e-02, 6.12210568933847180256e-03, - 2.07571937975545607602e-02, 3.35768305063385619214e-01, 7.46266949448459948613e-01, -6.72463631746016698987e-02, -1.94536700956528363360e-01, - -2.75088750614828209118e-02, 1.42328699967799371384e-01, 3.35288125725375085739e-01, 1.29661987766008346412e-01, 2.90956042046801172107e-02, - -2.05442280573112395770e-01, -9.57252926974513779212e-02, -9.10355774240597659386e-02, -1.25784172798783761005e-01, 1.12460127036075691054e-01, - 9.44013754824246931197e-02, -6.05135930061245497225e-02, 9.42673278665148578481e-02, 2.00615512602382500829e-01, -5.92185875904504069323e-02, - -2.28592246943101873313e-01, -1.07412950490968162054e-01, 2.20172956055192214908e-01, 3.33294698669218958376e-01, -4.44283179185198731642e-02, - -1.01766394690480529994e-01, 1.17472184755037761805e-01, 1.04892483649878465179e-01, -6.62468314716531808672e-02, -2.45565086356498013531e-03, - 4.79072727765457034854e-02, -7.97766729243851169251e-04, -2.33714338875874692858e-02, -2.56642787088907850523e-02, -9.62514763421860042314e-02, - 3.99383399281938444858e-02, 2.88865653017884548015e-02, -5.15182520475396393822e-02, 8.26498791523299636275e-02, -2.98742841129583554249e-02, - -8.28182978045203938011e-02, 3.14455026979475749105e-02, -1.53345808562610789669e-03, -3.62400610998830294274e-02, -2.51728077975302867719e-02, - -3.02379015962623703961e-02, 2.68910770206758423240e-02, -8.22634968902352312070e-03, 3.66544933660152699728e-02, 1.32356634436242674713e-02, - 3.21880247207419244518e-03, -1.97571016662111687001e-02, 5.93796945717029508310e-03, -4.31413602924163308572e-02, -2.72339719264069676785e-02, - -1.87274725743593273286e-01, 1.39283127485721136551e-01, 4.74963034217010249272e-01, -3.42073553333540392174e-01, 4.83885077044606606855e-02, - -2.59068005795831224347e-01, -2.13264680765766156956e-01, -7.36008484860203593403e-02, -8.13152420843461926081e-02, -1.21927665578479005326e-02, - 1.79904544651649317411e-01, -1.09959740517953624694e-01, -2.22065490779929819443e-01, 7.14015849729179447047e-02, -5.85031872787839662964e-03, - 9.72943249874637094976e-02, 1.58464145663301525513e-01, -6.23660570620122936547e-02, -2.05086286960385583145e-01, -5.07929431274403847540e-02, - 4.21897204870116185327e-02, -6.99935466206487028051e-02, -6.71348953496629374804e-02, 1.65743074443523596972e-01, 8.56850642116062655163e-02, - -1.19953810412321809631e-01, -7.40173516101229334030e-02, 1.18865945768013535344e-02, -7.71584669380707965924e-02, -6.31283399388396088137e-02, - -1.45882854372074655114e-01, 6.29307315713034526317e-02, 1.48912624660626508738e-02, -6.72819324032104260080e-02, 3.22547499735358483841e-02, - 4.97387743825052491831e-02, -5.43073271907661761504e-02, 1.52590958854153246893e-02, 2.92721489192738311066e-03, -1.87663839736718872364e-02, - -3.80050872053503069684e-03, 5.91273447672226934446e-02, -2.83684585809016896404e-03, 1.70512827209476636181e-02, -1.44259815516434488497e-02, - -8.06597987912826830392e-02, 5.19954562777717940736e-02, 1.09504480128524081528e-02, 1.26439885486616093030e-02, -2.34593647937779382559e-03, - 2.47413111762442641806e-02, -6.13559850860111253429e-03, -6.05626633742831349538e-02, -1.98467175793774985859e-01, 3.18979113074946862838e-01, - 6.23356771079433893967e-02, 1.30138108749532965813e-01, -1.05230501466137910116e-01, -6.87754575227078057686e-02, -4.22436887367944324811e-02, - 7.57926459563205562331e-02, 4.78504387573109452036e-02, -2.22681497547184761854e-02, 8.46951897073950493722e-02, -7.44317622658197293462e-03, - -1.89157622212636281067e-02, -6.19719693803440774271e-02, -8.37644347918033160827e-03, 1.32514981682897603488e-01, -1.09126775888557903116e-01, - -6.47849222903969929055e-03, 4.65591560634076861991e-02, -2.24234845462696341656e-01, 7.29582023256248463072e-02, 2.23965783883813690514e-03, - -5.19349169152241198211e-03, 2.25395864383192284786e-02, 9.10694488527918760701e-02, 7.36945737152017443794e-02, -2.16337158651918673447e-02, - -5.35436418307164291308e-02, 2.40342905027485786995e-02, 4.81946656785084762142e-02, -3.06521617296798450092e-02, -4.07904977042986977009e-02, - 6.32948267919029999851e-02, 4.53192474361057834331e-02, -2.29008122631283589365e-02, 1.62576382380966721897e-02, 3.82842631619570161750e-02, - 3.52346794652655739832e-02, -3.95023093184828782976e-02, -3.15659719925446974331e-02, 4.02431236080928178556e-02, 2.45684617558553607120e-02, - -1.93194945947791144047e-02, -2.48322169406506726430e-02, -1.13621415403786386183e-02, -3.31487361399904478798e-02, 1.68675563537488623633e-02, - 4.01325091519489432490e-02, 4.14338905584917469027e-02, 1.31273776950603299207e-01, 7.16276979245435152510e-03, 5.02985992698696121606e-02, - 1.78045915098635626483e-01, -1.86314001159308406663e-01, -1.35151434606926579285e-01, 1.69947309928447143346e-01, -8.37791941109623933270e-02, - 2.41195207762586322220e-02, 1.26309574838379373718e-01, -2.00571859613532021971e-01, -1.63465438373802895988e-01, -6.96363659600393730686e-02, - 1.14524330229191645403e-01, 7.12890316169484949960e-02, 5.80381889626466196397e-03, 4.93537868059431283907e-02, -8.44257746020753430116e-02, - -1.41929196365875275043e-02, 8.22387462453117029648e-02, -8.50093260265970818157e-02, 2.71192346905003156543e-02, 9.03395551304754379496e-02, - -1.71516448697893314490e-02, 8.18953521749132690166e-02, 1.11511604557867297777e-02, -4.78373059022189212053e-03, -9.53023452930306103070e-02, - 5.38686323249407891800e-02, -3.84678611713600085431e-02, -5.04713920668615947246e-03, 6.80811773653991481048e-02, -3.33049215638338835799e-02, - -5.28099294606356045589e-02, -7.54699335274512245197e-02, -5.40781758032556764126e-03, 8.29793590010352716257e-02, -5.97312971039127629802e-02, - -2.71427292677366080453e-02, -6.36007393417800138968e-03, -6.21102608067901958838e-03, 1.20982775517295207401e-02, -1.17366629581995736420e-02, - 3.79477291991657597614e-02, 4.16172556173764890408e-02, -4.15482630953573559007e-02, -2.10178763811884848633e-02, 2.25384141584651191692e-02, - 3.26544906456272876483e-01, 1.14875244914279722730e-01, -1.66631737648658934114e-01, -6.36733988328790686401e-03, 1.05207112351735077027e-01, - -2.56656713269180158932e-01, 6.60485459910778310855e-02, 4.17130045127815929362e-02, -7.37791748174861372611e-02, 7.60523512741725499220e-02, - -4.55959006761720783696e-02, -2.36680526647207629953e-02, 1.10634117950077798254e-01, -2.08651727388676766495e-02, -7.64711683504649686327e-02, - 8.13422913278145920390e-03, 7.93342835009738511776e-02, -1.36145811582776665727e-01, 3.71088391279384144372e-02, 3.21562962981391253781e-02, - -1.14387894243613869039e-01, -1.51631103622234392203e-03, 5.78217444722389575795e-02, -4.71124806075210594836e-03, 1.51729749910356030707e-02, - 9.74258177618566034717e-02, -1.10011849267590264279e-01, -9.55723084321756233273e-02, 5.40108889439728720450e-02, 2.20372759806924181647e-02, - -3.12940070328804331723e-02, 7.31829279647891323135e-02, -5.03897879848870661190e-02, 3.56857218059479508465e-02, 2.77447201596329011408e-02, - -2.09552594775335998545e-02, 1.43951419283830060747e-02, 5.39902985778747748769e-02, 2.12233791683978864628e-02, -1.06021857317053335573e-02, - -1.29173575974317281917e-02, 2.33645540297061204277e-03, 2.61896609343018451146e-03, -1.14595932568608803448e-02, 3.56767949738183843926e-04, - 2.01246788122515993247e-02, 1.99364141245472692443e-01, 1.02386975283006720350e-02, 1.46491539292862016364e-01, -2.92173375533333390397e-01, - -2.79882649001711690528e-02, 7.89598614348374083782e-02, 1.73932768517874730696e-02, -1.69430993280276553925e-01, -3.49439319604140236075e-02, - -2.41776119023419042153e-02, -1.19007451411664612329e-02, 7.52785183419538428407e-02, 8.00732324924654653708e-02, 5.80254140930885203842e-02, - -2.99344525092792301812e-02, 2.00701049258613407889e-02, -4.85173141225875570459e-02, -1.24597145763424926868e-01, -1.51901004582441958440e-02, - -1.61680779553563594431e-02, 6.85542113027582250551e-02, 4.25745326736892623631e-02, -1.06278911193231559440e-04, 9.76285197536541464458e-03, - 3.87428701891937912749e-02, -2.30639988244256723127e-02, 6.36890026034679732764e-03, 3.02413182033626840028e-02, 3.88836672433736253024e-03, - -9.08662711955680046927e-02, 4.01745378306784250988e-02, 1.03266559093635329480e-01, 2.14979137912293429002e-03, -5.41722635351460576891e-02, - 2.61282597269434195553e-02, -1.88195226737477086520e-03, -2.19435523135619973967e-02, 1.32921056129775890658e-02, -1.39584001825611234843e-02, - -2.33277834487258597940e-02, 3.20387242392535485924e-03, -2.56605748623718842027e-02, 3.00558911102263848214e-02, 3.05648112133436906934e-02, - -2.59104772664633942192e-03, -3.60234150814368395133e-02, 1.89051474579463585357e-01, 7.67659810167127809599e-02, -1.24703387595890141659e-01, - 1.16494243349512860419e-01, -1.23273291315800521267e-02, -8.52472265397304362899e-02, 4.85995814815475199455e-02, -4.91533864052588892468e-02, - 7.09392924651690154336e-02, 3.86918200904741022006e-02, -6.05870726251201280332e-02, 1.26662290542081668043e-01, -1.26300238339170367574e-02, - -2.77371050405810226636e-02, -5.43586513698262885352e-02, -7.86459616541178574423e-02, 6.23528587727540037355e-02, -4.79677851814970662714e-02, - -6.51687150996678454806e-04, 5.76336385114276719688e-02, 1.44542478484825671209e-02, 3.16928492510423695516e-02, 1.45017405736592441823e-02, - 3.77649866255029068030e-02, 2.76488049642000443748e-04, -6.60577998684190731415e-02, -1.43760686140608738570e-02, 3.59108661833638931338e-02, - -1.96544252969081192917e-02, -3.14635605928988426605e-02, 2.73136448740384021883e-02, 4.81895944089887409700e-02, -1.41798371596522010049e-03, - -2.76940211432370950173e-02, -1.79321359038478039816e-02, -8.04857916575939247306e-03, 6.12601355103674924743e-04, -3.04826514707566033346e-02, - 3.97737096905840994271e-03, 2.93070515299252015717e-02, -1.68977509366934480761e-01, 3.32231696372570911580e-03, 1.25024830498748684704e-01, - 1.14603027997231002311e-01, -1.00188353252315814901e-01, -9.84663913699934667534e-03, 4.24578628782099620764e-02, -1.37172078837733080192e-01, - -3.49285758694722614504e-02, 5.10266827849673310080e-02, -8.71727496405721724582e-02, 6.53026570180906262841e-03, 8.81977524226997683376e-02, - -6.34979748614215300240e-02, -6.75922576223946108831e-02, -9.09058087393600777748e-03, 8.58354921744265697559e-02, -3.11903783366274736655e-02, - 2.00028673474334506288e-02, 2.51992069666158204078e-02, -1.15065874504069552003e-02, 1.90952708533619654185e-02, -1.42994317615683774053e-02, - 8.38885300224805237346e-04, -3.82027498742033497225e-02, -3.67441895491770198490e-02, 2.50992455595355073994e-02, 7.01187400269996513602e-02, - -5.54375280311450654991e-02, -4.38519736099493434578e-02, -7.84180536804670973161e-03, 2.15733075413469983783e-02, -1.13430180042112986952e-03, - 1.43263625967320618049e-02, 3.38406892444173892920e-02, 2.61661740894084809961e-02, 1.89963433472952851477e-02, 4.11523810167366797808e-03, - -4.07083694738235874616e-03, -2.14250124636823323365e-02, -2.51950730394823532721e-02, 3.42343547054715646727e-02, -1.60995215305804545425e-01, - 1.46286861154573760713e-01, -1.42470612032240401268e-02, -8.74980046536548150549e-02, -4.25453860188948623788e-02, 1.17182553786398857554e-01, - -1.00991016453327253632e-01, -7.91738577441953306213e-02, 5.29573588185536445194e-02, -2.21614298461902045623e-02, 3.58602587208211864844e-02, - 2.52438926833398191718e-02, 9.41877819477729971709e-02, -6.48116676539685077074e-02, -6.92622200130770665494e-02, 3.44271533520238565140e-02, - -2.14712430694437191037e-02, 1.72316382693014427674e-02, -2.66608743584075963406e-02, -2.10082338877249467923e-02, 8.91565305172099635544e-03, - -1.23413533420058361967e-02, -6.55699200671947673991e-03, -6.50539642022832619028e-03, 1.51124007337151353147e-02, 5.20370287348198221067e-03, - 2.44544519960917354495e-02, 8.17735780033393942767e-03, -3.77816692303542945967e-04, -2.75580902253722351269e-02, 1.61366174765763085996e-02, - -2.54225642602667507852e-02, -5.68510449978476550825e-02, 1.03315681722852791002e-02, 5.48232041684815468024e-03, -3.22722809472682503618e-02, - 1.68859338049149008965e-02, 6.21665123569529881609e-02, -1.49734091796970530952e-01, -1.69848035269845681894e-01, 7.28166844225807269320e-02, - -9.38546660994197951000e-02, -5.98972210309676594830e-02, 1.60189670628219316129e-01, 9.68228235109596380159e-02, -1.14699218288179388692e-01, - 5.22495478003770982833e-02, -2.50191304829539204468e-02, 2.77221049132821764638e-02, 5.25053174572039649259e-02, 4.67049795137407172674e-02, - -4.25063623233455645245e-02, -7.79015735544906322285e-03, 8.35061691171900405406e-02, -2.77565926301914164820e-02, -3.55176007501909543618e-02, - 5.22884040187019810686e-02, 4.47524306813492939866e-03, 3.34858736182796073999e-02, 2.18065090398272508343e-02, 3.96249948248765804237e-02, - -1.75050000687652293485e-02, -5.30639824787136182155e-03, 1.31658536276919365532e-02, -3.54893637807925724226e-02, 1.44838563901157494143e-03, - 2.53219139441511024990e-02, 1.51209661740110620776e-02, -3.18928979311501516886e-03, 8.08035892351891861518e-03, 1.49482343348299774599e-02, - -4.67401524501743839690e-02, 8.81785937471118302922e-02, 1.09443858484468511949e-01, 9.61675669132599497679e-02, -7.39592182705455791769e-02, - 8.87508822651789097691e-02, -7.91714174638406542606e-02, -1.25898861391198962911e-01, 8.84171948090256565322e-02, 3.93482215277929509023e-02, - -6.26211797345710557972e-02, 3.11866892937116280127e-02, 1.54206070094080910371e-01, -7.15962414998223273255e-02, 4.04187883182457047271e-02, - 3.87320351160306483584e-02, -2.13087169719965857650e-02, 2.04352330201420621936e-02, 3.60324068311299108847e-02, -6.71927151509099790383e-02, - -5.86355402262732916530e-02, 1.95738272971190847838e-02, 1.19986570986449735121e-02, -4.16517345466257682407e-02, 4.57582247311850084937e-02, - -5.64919874467361762815e-02, -2.96306742467898837426e-03, 3.45918894384134034681e-02, 9.37965919443191353810e-03, -5.31266846947417263614e-03, - 7.44645101900219368030e-03, -8.16779483872519251886e-03, -1.49486275306286754694e-02, 5.40961754497425346966e-03, -6.07743621110200162722e-03, - -2.86027271239626297572e-02, 9.28607307596479303324e-02, 1.15334393912762608880e-01, 2.22619048233438435180e-02, -2.81988516854455167904e-02, - -3.27953711282213400402e-02, -7.26623103447188861681e-02, -6.21318073281297983401e-02, 8.15860644657136341307e-02, 1.79600966703069159225e-02, - -8.26984672948943289050e-02, 2.66922837734803533594e-02, -5.62012642483699781382e-02, -7.54479658771655264937e-02, 5.63921972458279810447e-02, - -8.88808665037604112014e-03, 4.49098738994229513752e-04, -1.64624335502902702233e-02, 5.00902714527058645633e-02, 1.06477908341492902983e-02, - 2.19722684831073211686e-02, 9.27897245497274342219e-03, -1.38071463629181757221e-02, -3.25812324194547434097e-02, -3.02235182235052954325e-02, - 2.70211283173303479233e-02, 1.78695725115783597692e-02, -1.97856995310294429824e-02, 2.14583909244959528118e-02, 8.31160096115654556392e-03, - -7.96044059263601583298e-03, -7.03711411983747731069e-03, -7.52245974116911853002e-02, -7.17896739726268801052e-02, 1.07396425196690896431e-02, - 7.25906809169843403318e-02, -9.45023972725838740105e-02, -6.71199808984563744962e-02, 7.35264690791543329418e-02, 2.98610952212447697263e-02, - -7.52442146662268135371e-04, 9.23976694955527116937e-02, 4.60854381027500578649e-02, -5.81010137429742931636e-02, 5.19935015121687146844e-02, - -4.28751313838296663206e-02, 2.68412731409498166169e-02, 9.92974085166531926505e-03, -1.41649957602334279627e-02, 8.49484772510930227774e-03, - 1.60608334268962397659e-03, 1.53969582107269485627e-02, 2.53654424332110106644e-02, 2.20836817019017840613e-02, -4.96400766026642691758e-03, - -4.63895546537213768895e-03, -3.69755978269468085773e-02, -4.24220279369531480529e-02, -2.80842055465305032516e-03, 3.43511446156298310903e-03, - 1.50427480682660263955e-02, -7.64781824357823984684e-03, 1.55431405065905338392e-02, -5.28685500234718219748e-02, -4.81425552620864186104e-02, - -6.98904426260522071424e-02, -5.69063762150740712342e-02, -2.01599484306710097226e-02, -7.08142573082899164094e-03, 1.60387886663503793916e-02, - -8.26785713680359968247e-02, 2.82003440014560874394e-02, 2.73932418290509169245e-02, -3.17992788170617102228e-02, 5.85714331111230612770e-02, - 5.86577384557991701741e-02, -2.75299012996250893476e-03, -8.45195718330371027760e-03, -1.36279044444791216234e-02, -1.13870143130110085955e-02, - -9.47170994530230694886e-03, 8.38589777991547574709e-03, -2.44907795135516845320e-02, -1.88112311627625997112e-02, 1.66825300517051550164e-02, - -1.40472696715355817310e-02, 4.07602998308370448322e-02, 4.52331228574007898624e-03, -7.41516905358174677892e-03, -1.90839799893427405908e-02, - 1.37235319648593090402e-01, -5.07166887609150802974e-03, 1.66347985382777688312e-02, -8.94058332794331472870e-02, -9.96617048317507969735e-03, - -3.39998201752246195784e-02, -2.72752305938337435975e-02, 1.41116199971288980557e-04, 1.20136294077674496417e-02, 1.21046096252801875515e-02, - 4.67374536088999582156e-03, 1.76093997807116745338e-03, -6.49132489663982719524e-03, 6.34253853067380107822e-02, 4.20234078454048282092e-02, - -3.39907942260764435460e-03, -3.13684078013621997494e-02, -5.59725664044557688626e-03, 1.46041344723689698465e-02, 8.15628093364801319554e-03, - 8.81123245682426982361e-03, -5.36576704715815769320e-02, 4.13564181087699121731e-03, 6.66570175208870251832e-03, -3.06753731552251258582e-03, - 3.24260047333155276839e-02, 3.78357123622976698057e-03, 1.22559252382635042178e-01, -3.26726534731656623189e-02, -4.57263244390499479231e-02, - 1.23161267442891183416e-02, 5.60898223233850107272e-02, -2.07946281596515653023e-02, 3.30973059009364162231e-02, 3.79099335956614089116e-02, - 3.02099801034241572523e-03, -4.11260349557933183040e-02, -2.09662321613402133358e-02, -1.35059512400454856396e-02, 2.11033519015176411482e-02, - 2.49738730383721862366e-03, 1.80042474049896738739e-03, -4.21972590754290111104e-02, 7.84304881856809008034e-03, 1.28611420258033324476e-02, - 1.53304442551651341764e-02, 1.14809771240723442615e-02, 5.45508167269171534430e-03, 6.03486224308978115582e-03, -6.17922023172545829134e-03, - -1.06402780093771354153e-01, -1.06566854283863088337e-01, -1.56672555450536946098e-02, -4.17617234129553371869e-02, -5.84327485785076233826e-02, - 1.72707037153512245331e-02, -4.27180361478920241763e-03, 3.83975587930814599158e-02, 7.18917519991502662613e-02, 1.73599075858622414748e-02, - -5.06102136889801795805e-02, -2.28302899957008066656e-02, 4.05449577890660689539e-02, 6.05903063932164507449e-03, 1.42495320779388468663e-02, - -1.46505630681158707102e-02, -5.51579872998721708333e-03, -2.03950903125686006101e-02, 1.71600095189964607645e-02, 3.10141280680510215972e-02, - -6.92078952483923121042e-03, -1.25723580586239959064e-03, 4.83571917759556130223e-02, -1.08848884748079619000e-01, -7.62227492845969547414e-03, - 3.98614872899268266049e-02, 2.51496883852979809248e-02, -7.45157236466782307849e-02, -2.54315956467565489063e-02, 5.86785913495517369443e-02, - 6.07261945507166309849e-03, 2.37710782485035070077e-02, 2.40958099664499367232e-03, 8.00723308014901838381e-03, 5.57202821065413758661e-02, - -6.18738592105032812751e-03, 1.57471692604664484198e-03, -2.08797558382940772262e-03, -2.73200765442419279960e-02, -2.06208586891517380024e-02, - 6.40309150046379439887e-04, 3.34147637908005640250e-02, -2.31245128603038314907e-02, 3.13805487530873783442e-02, -3.76503956682762222496e-02, - 3.82033717675601958152e-02, 6.08549869979059313008e-02, -1.40664950951139375995e-02, 1.20432450888018800772e-02, 4.11120541709728091334e-03, - -1.31431111647770104689e-02, -2.16767866450208908369e-02, 2.36444182462271527620e-03, 4.15518391649481646372e-03, -7.19797119986096724242e-03, - 3.63099914737792378583e-02, -1.71114207061806439247e-02, 9.12094809288829279359e-03, -2.00581984724530065778e-02, 4.18093901030532240359e-03, - -1.54353999486445108563e-02, 3.77632145097120189292e-02, -8.67412239218371683425e-02, 3.74024476837445662980e-02, 7.02791955646850374784e-03, - -3.07387087745127421390e-03, 1.26170642077405754933e-02, 7.19502473862098246987e-03, 5.00348237158451253359e-02, 6.05821676660315069918e-03, - 2.81657375913338843543e-02, -2.75046494305255621871e-02, -3.32847608680125889302e-02, 4.92458523340539092161e-03, -6.97895182233836727098e-03, - -1.84078432809154611538e-02, -2.55254058040131799612e-02, 4.38596283726821068588e-03, 7.97305689082921688338e-03, -6.65251068675700718558e-02, - -2.43074168732615144076e-03, -3.21551055785660854641e-03, -2.14057386820096506863e-02, 1.73404829493880863200e-02, -2.21788279126988834011e-02, - 3.67289476360874028726e-02, 2.88921423109056961509e-02, -4.36590369050650264210e-03, -3.38015966458028857197e-03, -1.47872402615952351634e-02, - -2.67937691397940741522e-02, -4.01628891758317591032e-02, 5.37104159736995767638e-02, 3.38881421250558784175e-02, -1.94731556323654853013e-02, - 6.80080451079642287447e-04, -1.16224021866609874415e-02, -2.84314312441163938305e-02, -3.10403528556473483346e-02, -1.52614844050795953750e-02, - 1.46865039960839046523e-02, 7.74337973212646264037e-03, -2.75213939675030445919e-02, -3.12476741289728875139e-02, -3.75401476285800936306e-02, - 4.53067917901101985256e-02, 4.75497506720418041531e-03, 1.25627944556748021021e-02, 4.03046169919628882727e-02, -3.29378978115561424356e-02, - -2.51499548928088654393e-03, -1.99564144518295516484e-02, -2.63938123636600005528e-02, -1.84979990476826575141e-02, -4.75891539387540141171e-02, - 1.70189645456799328038e-02, 2.90621732209333551167e-02, 1.69695748997654785595e-02, 6.00578109434020054880e-03, 3.77405846672976205691e-02, - 1.04426223615697640751e-02, -7.42237607930411715310e-04, -1.51118572042552353624e-02, 1.29952623161545995079e-03, 1.26799047323642617713e-02, - 1.05278997248968164691e-02, 2.29682654055416574090e-02, 1.28888330591014361320e-02, -1.03014730669756075787e-02, -4.83421710205830541113e-03, - -1.90040068302814585399e-02, -4.31802671175361696410e-03 + 2.78565217180879301395e+02, 0.00000000000000000000e+00, 8.38367712240454920902e-01, 0.00000000000000000000e+00, -7.22151022768738215518e-01, + 0.00000000000000000000e+00, 1.54447137639483056404e+00, 0.00000000000000000000e+00, -8.10351659720698336287e-01, 0.00000000000000000000e+00, + 6.45930713064333694717e-01, 0.00000000000000000000e+00, -1.73417955255619204991e-01, 0.00000000000000000000e+00, -9.09351867483918913093e-02, + 0.00000000000000000000e+00, -3.00845517613623769648e-02, 0.00000000000000000000e+00, -1.97522108657794209785e-01, 0.00000000000000000000e+00, + 1.45006392199800160370e-01, 0.00000000000000000000e+00, -6.92319525648382033678e-02, 0.00000000000000000000e+00, -3.37495245995370396486e-01, + 0.00000000000000000000e+00, 2.93969252845082296144e-01, 0.00000000000000000000e+00, 5.22791676917648828748e-02, 0.00000000000000000000e+00, + -4.31020055899014042922e-02, 0.00000000000000000000e+00, -5.34277055570271386387e-02, 0.00000000000000000000e+00, 1.57725778753141337996e-01, + 0.00000000000000000000e+00, -1.38048966071163903280e-01, 0.00000000000000000000e+00, 7.95936533884674390915e-02, 0.00000000000000000000e+00, + -5.08988096408558021722e-03, 0.00000000000000000000e+00, -3.17356690459940984916e-02, 0.00000000000000000000e+00, -7.97854100625838141836e-02, + 0.00000000000000000000e+00, -1.25759522048120825355e-01, 0.00000000000000000000e+00, 1.41095505007377608475e-01, 0.00000000000000000000e+00, + -2.90041709701537933630e-02, 0.00000000000000000000e+00, 1.16118748810570035501e-01, 0.00000000000000000000e+00, -1.42650207377574778089e-01, + 0.00000000000000000000e+00, 6.63859656709936268859e-02, 0.00000000000000000000e+00, -8.43008351127146754456e-02, 0.00000000000000000000e+00, + 8.11805506119530340126e-02, 0.00000000000000000000e+00, -2.92579106275835476580e+00, -2.73257362252726822283e-02, -2.31503061096297768628e+00, + 2.98481883110496337697e-01, 2.32422954464165210098e+00, -9.36624989809203695179e-02, -1.13647173814196378316e+00, -4.24970312443540054748e-01, + 1.26754821773852066613e+00, -7.20859094680278700285e-02, -9.51306475614490221204e-01, 6.14867632012408793507e-01, -9.85091038732955892598e-02, + -6.34523215803268758606e-02, -6.78708060411115782218e-02, -1.35311523427619539994e-01, -9.04935301775932621204e-02, -9.78101007785831533248e-02, + -9.81097374871810895547e-04, 1.80616098092357818539e-02, -2.64791786212412172397e-02, -4.76558495508507054539e-02, -1.96341419265033012564e-01, + 3.40906457596743608929e-02, -7.81262194523913988675e-02, -1.90201799489863598858e-01, 2.25178750048809411810e-01, 2.86704542482240504198e-03, + -1.19805102746233238520e-02, 1.68969022321052431135e-02, 5.64738950483129331648e-02, -1.39757566954298140249e-01, -7.44084433787887133960e-02, + -1.79448737058076172868e-02, 6.14333363921325120716e-02, 4.42090839521651901567e-02, -1.59177621940344016238e-02, -2.45259140787589882682e-02, + 4.14722887926062475095e-02, -9.08467249754976585718e-02, 7.32634132869659504550e-02, 3.98083190502361433660e-02, -6.23330309466623433412e-02, + 3.23061735747387016038e-02, 5.24308078374175548508e-02, -6.52853670335678676340e-02, -4.74582205706168894221e-02, -2.57646217050176394581e-02, + 4.85326601320503064896e-02, 4.57836316487753580695e-02, -1.61395013977115135695e-02, -4.31399408593192076888e-02, -1.72982609465274252136e-02, + 2.05141743795376405024e-02, 5.13479785723864323721e-02, 2.02753965345298277356e-02, -9.62325942856205422682e-03, -1.21013000039295196344e-03, + 4.61377663687331032727e-02, -6.90153405245983028390e-04, -1.66104804699747843344e+00, 1.79666906865138087390e-01, 7.23133875761683864170e-01, + 4.15103729262486009777e-01, -3.04359433047895144853e-01, -1.33601223735748869670e-01, 1.11896993727331572899e+00, -5.97930191729183602156e-01, + -3.21482407719980045613e-01, -6.44440729482515239912e-02, -1.39643167588630684461e-01, -7.87344252201049310536e-02, -2.74194962741515224636e-01, + 3.16014987883590156570e-02, 2.61916687188788577245e-01, -2.29041295889389484586e-01, 1.37413993896893793512e-02, 1.02848928276271345261e-01, + -8.45943398257167356036e-02, -8.55836430183285895579e-02, -2.14692485939022847941e-02, -5.00660400534810728912e-02, 4.10286932308298671335e-02, + 5.98356967342531728682e-02, -6.87268417209678655899e-02, -1.00834342061879356223e-01, 2.89946855441678558174e-02, 6.84096422422015987275e-02, + 7.90905646811665974383e-02, 1.22761627402924594632e-02, -7.19296897992387496146e-02, -1.19563518571031840443e-01, 3.53949764125303933948e-02, + 3.49389806984224948749e-02, -1.34556768717593006057e-01, 1.30036738800839157815e-01, 1.47453022488737178763e-01, -1.75187106897877128975e-02, + -5.71655857598896560701e-02, -2.22513683371899778640e-02, 5.11984135243400070858e-02, 4.32198440146361120839e-02, -3.79006811678369512353e-02, + -1.61948869817943215399e-02, 5.87864730303968852088e-02, 7.56143666040565154418e-03, 3.79735451815043784096e-02, 4.88357571184367539319e-03, + -3.44600211423619568266e-03, 8.45175251030964858057e-03, 2.06501052974025246789e-02, -2.27945980601942863042e-02, 7.52792623890808781928e-02, + -4.07335076464383702421e-02, -1.22373247319515162691e-03, 7.12818582736400585542e-03, -2.08797409246280901707e-02, 2.35344435031375059930e-02, + 5.38553837448995376125e-02, 2.29385900837120154661e-01, -3.60512186055045147359e-01, 4.09262094434219958483e-01, -1.43204915316633707434e-01, + 1.76661646314910159017e-01, 1.59424540157772631765e-01, 1.19996653025061628117e-01, 9.74032138671445946176e-02, 8.01756516767066496065e-02, + -4.22092435868048232450e-01, 3.42598707334977881089e-01, 7.26427774784764446192e-02, -1.92869792680440410582e-04, -9.14800737566894561770e-02, + 1.86904852575672325576e-01, 9.03785536307215725538e-02, -8.70628859333670845899e-02, -1.20357023393743836626e-01, 1.30276821268167974921e-01, + -5.50418496727855255379e-02, -1.39930929689677463479e-01, -4.10997318303747902202e-02, 1.66027061444833590187e-01, -3.31025873454900559922e-02, + 5.45967001368218574076e-02, -1.86051192758042188702e-01, 3.57669212138109621213e-02, 1.96823682403928168494e-01, 1.12736638944959083330e-01, + -1.18563060708320622272e-01, -7.11264215849067293895e-02, -3.33098969956449747487e-02, 4.88100702343404121986e-02, 2.04094083090545080905e-02, + 7.78285563663724117012e-02, -4.14113893806803898268e-02, 1.26375672481289953730e-02, 1.38745116741378599068e-01, -8.57558938152793923115e-03, + -9.29289689333271246019e-02, -8.27276771926104548260e-02, 5.84956615429012907748e-02, 2.29399633044502938156e-03, -2.09824524198216422546e-03, + -2.30538708704958079931e-02, 3.77132043821169771203e-02, 6.53337758882697045015e-02, -3.06667712165429387494e-02, -1.14650515581519504144e-02, + 1.46194883433694872849e-02, 3.46636747707448856712e-03, -4.35546278336838635359e-02, 6.29051255528407793349e-02, 6.12210568933847180256e-03, + 2.07571937975545607602e-02, 3.35768305063385619214e-01, 7.46266949448459948613e-01, -6.72463631746016698987e-02, -1.94536700956528363360e-01, + -2.75088750614828209118e-02, 1.42328699967799371384e-01, 3.35288125725375085739e-01, 1.29661987766008346412e-01, 2.90956042046801172107e-02, + -2.05442280573112395770e-01, -9.57252926974513779212e-02, -9.10355774240597659386e-02, -1.25784172798783761005e-01, 1.12460127036075691054e-01, + 9.44013754824246931197e-02, -6.05135930061245497225e-02, 9.42673278665148578481e-02, 2.00615512602382500829e-01, -5.92185875904504069323e-02, + -2.28592246943101873313e-01, -1.07412950490968162054e-01, 2.20172956055192214908e-01, 3.33294698669218958376e-01, -4.44283179185198731642e-02, + -1.01766394690480529994e-01, 1.17472184755037761805e-01, 1.04892483649878465179e-01, -6.62468314716531808672e-02, -2.45565086356498013531e-03, + 4.79072727765457034854e-02, -7.97766729243851169251e-04, -2.33714338875874692858e-02, -2.56642787088907850523e-02, -9.62514763421860042314e-02, + 3.99383399281938444858e-02, 2.88865653017884548015e-02, -5.15182520475396393822e-02, 8.26498791523299636275e-02, -2.98742841129583554249e-02, + -8.28182978045203938011e-02, 3.14455026979475749105e-02, -1.53345808562610789669e-03, -3.62400610998830294274e-02, -2.51728077975302867719e-02, + -3.02379015962623703961e-02, 2.68910770206758423240e-02, -8.22634968902352312070e-03, 3.66544933660152699728e-02, 1.32356634436242674713e-02, + 3.21880247207419244518e-03, -1.97571016662111687001e-02, 5.93796945717029508310e-03, -4.31413602924163308572e-02, -2.72339719264069676785e-02, + -1.87274725743593273286e-01, 1.39283127485721136551e-01, 4.74963034217010249272e-01, -3.42073553333540392174e-01, 4.83885077044606606855e-02, + -2.59068005795831224347e-01, -2.13264680765766156956e-01, -7.36008484860203593403e-02, -8.13152420843461926081e-02, -1.21927665578479005326e-02, + 1.79904544651649317411e-01, -1.09959740517953624694e-01, -2.22065490779929819443e-01, 7.14015849729179447047e-02, -5.85031872787839662964e-03, + 9.72943249874637094976e-02, 1.58464145663301525513e-01, -6.23660570620122936547e-02, -2.05086286960385583145e-01, -5.07929431274403847540e-02, + 4.21897204870116185327e-02, -6.99935466206487028051e-02, -6.71348953496629374804e-02, 1.65743074443523596972e-01, 8.56850642116062655163e-02, + -1.19953810412321809631e-01, -7.40173516101229334030e-02, 1.18865945768013535344e-02, -7.71584669380707965924e-02, -6.31283399388396088137e-02, + -1.45882854372074655114e-01, 6.29307315713034526317e-02, 1.48912624660626508738e-02, -6.72819324032104260080e-02, 3.22547499735358483841e-02, + 4.97387743825052491831e-02, -5.43073271907661761504e-02, 1.52590958854153246893e-02, 2.92721489192738311066e-03, -1.87663839736718872364e-02, + -3.80050872053503069684e-03, 5.91273447672226934446e-02, -2.83684585809016896404e-03, 1.70512827209476636181e-02, -1.44259815516434488497e-02, + -8.06597987912826830392e-02, 5.19954562777717940736e-02, 1.09504480128524081528e-02, 1.26439885486616093030e-02, -2.34593647937779382559e-03, + 2.47413111762442641806e-02, -6.13559850860111253429e-03, -6.05626633742831349538e-02, -1.98467175793774985859e-01, 3.18979113074946862838e-01, + 6.23356771079433893967e-02, 1.30138108749532965813e-01, -1.05230501466137910116e-01, -6.87754575227078057686e-02, -4.22436887367944324811e-02, + 7.57926459563205562331e-02, 4.78504387573109452036e-02, -2.22681497547184761854e-02, 8.46951897073950493722e-02, -7.44317622658197293462e-03, + -1.89157622212636281067e-02, -6.19719693803440774271e-02, -8.37644347918033160827e-03, 1.32514981682897603488e-01, -1.09126775888557903116e-01, + -6.47849222903969929055e-03, 4.65591560634076861991e-02, -2.24234845462696341656e-01, 7.29582023256248463072e-02, 2.23965783883813690514e-03, + -5.19349169152241198211e-03, 2.25395864383192284786e-02, 9.10694488527918760701e-02, 7.36945737152017443794e-02, -2.16337158651918673447e-02, + -5.35436418307164291308e-02, 2.40342905027485786995e-02, 4.81946656785084762142e-02, -3.06521617296798450092e-02, -4.07904977042986977009e-02, + 6.32948267919029999851e-02, 4.53192474361057834331e-02, -2.29008122631283589365e-02, 1.62576382380966721897e-02, 3.82842631619570161750e-02, + 3.52346794652655739832e-02, -3.95023093184828782976e-02, -3.15659719925446974331e-02, 4.02431236080928178556e-02, 2.45684617558553607120e-02, + -1.93194945947791144047e-02, -2.48322169406506726430e-02, -1.13621415403786386183e-02, -3.31487361399904478798e-02, 1.68675563537488623633e-02, + 4.01325091519489432490e-02, 4.14338905584917469027e-02, 1.31273776950603299207e-01, 7.16276979245435152510e-03, 5.02985992698696121606e-02, + 1.78045915098635626483e-01, -1.86314001159308406663e-01, -1.35151434606926579285e-01, 1.69947309928447143346e-01, -8.37791941109623933270e-02, + 2.41195207762586322220e-02, 1.26309574838379373718e-01, -2.00571859613532021971e-01, -1.63465438373802895988e-01, -6.96363659600393730686e-02, + 1.14524330229191645403e-01, 7.12890316169484949960e-02, 5.80381889626466196397e-03, 4.93537868059431283907e-02, -8.44257746020753430116e-02, + -1.41929196365875275043e-02, 8.22387462453117029648e-02, -8.50093260265970818157e-02, 2.71192346905003156543e-02, 9.03395551304754379496e-02, + -1.71516448697893314490e-02, 8.18953521749132690166e-02, 1.11511604557867297777e-02, -4.78373059022189212053e-03, -9.53023452930306103070e-02, + 5.38686323249407891800e-02, -3.84678611713600085431e-02, -5.04713920668615947246e-03, 6.80811773653991481048e-02, -3.33049215638338835799e-02, + -5.28099294606356045589e-02, -7.54699335274512245197e-02, -5.40781758032556764126e-03, 8.29793590010352716257e-02, -5.97312971039127629802e-02, + -2.71427292677366080453e-02, -6.36007393417800138968e-03, -6.21102608067901958838e-03, 1.20982775517295207401e-02, -1.17366629581995736420e-02, + 3.79477291991657597614e-02, 4.16172556173764890408e-02, -4.15482630953573559007e-02, -2.10178763811884848633e-02, 2.25384141584651191692e-02, + 3.26544906456272876483e-01, 1.14875244914279722730e-01, -1.66631737648658934114e-01, -6.36733988328790686401e-03, 1.05207112351735077027e-01, + -2.56656713269180158932e-01, 6.60485459910778310855e-02, 4.17130045127815929362e-02, -7.37791748174861372611e-02, 7.60523512741725499220e-02, + -4.55959006761720783696e-02, -2.36680526647207629953e-02, 1.10634117950077798254e-01, -2.08651727388676766495e-02, -7.64711683504649686327e-02, + 8.13422913278145920390e-03, 7.93342835009738511776e-02, -1.36145811582776665727e-01, 3.71088391279384144372e-02, 3.21562962981391253781e-02, + -1.14387894243613869039e-01, -1.51631103622234392203e-03, 5.78217444722389575795e-02, -4.71124806075210594836e-03, 1.51729749910356030707e-02, + 9.74258177618566034717e-02, -1.10011849267590264279e-01, -9.55723084321756233273e-02, 5.40108889439728720450e-02, 2.20372759806924181647e-02, + -3.12940070328804331723e-02, 7.31829279647891323135e-02, -5.03897879848870661190e-02, 3.56857218059479508465e-02, 2.77447201596329011408e-02, + -2.09552594775335998545e-02, 1.43951419283830060747e-02, 5.39902985778747748769e-02, 2.12233791683978864628e-02, -1.06021857317053335573e-02, + -1.29173575974317281917e-02, 2.33645540297061204277e-03, 2.61896609343018451146e-03, -1.14595932568608803448e-02, 3.56767949738183843926e-04, + 2.01246788122515993247e-02, 1.99364141245472692443e-01, 1.02386975283006720350e-02, 1.46491539292862016364e-01, -2.92173375533333390397e-01, + -2.79882649001711690528e-02, 7.89598614348374083782e-02, 1.73932768517874730696e-02, -1.69430993280276553925e-01, -3.49439319604140236075e-02, + -2.41776119023419042153e-02, -1.19007451411664612329e-02, 7.52785183419538428407e-02, 8.00732324924654653708e-02, 5.80254140930885203842e-02, + -2.99344525092792301812e-02, 2.00701049258613407889e-02, -4.85173141225875570459e-02, -1.24597145763424926868e-01, -1.51901004582441958440e-02, + -1.61680779553563594431e-02, 6.85542113027582250551e-02, 4.25745326736892623631e-02, -1.06278911193231559440e-04, 9.76285197536541464458e-03, + 3.87428701891937912749e-02, -2.30639988244256723127e-02, 6.36890026034679732764e-03, 3.02413182033626840028e-02, 3.88836672433736253024e-03, + -9.08662711955680046927e-02, 4.01745378306784250988e-02, 1.03266559093635329480e-01, 2.14979137912293429002e-03, -5.41722635351460576891e-02, + 2.61282597269434195553e-02, -1.88195226737477086520e-03, -2.19435523135619973967e-02, 1.32921056129775890658e-02, -1.39584001825611234843e-02, + -2.33277834487258597940e-02, 3.20387242392535485924e-03, -2.56605748623718842027e-02, 3.00558911102263848214e-02, 3.05648112133436906934e-02, + -2.59104772664633942192e-03, -3.60234150814368395133e-02, 1.89051474579463585357e-01, 7.67659810167127809599e-02, -1.24703387595890141659e-01, + 1.16494243349512860419e-01, -1.23273291315800521267e-02, -8.52472265397304362899e-02, 4.85995814815475199455e-02, -4.91533864052588892468e-02, + 7.09392924651690154336e-02, 3.86918200904741022006e-02, -6.05870726251201280332e-02, 1.26662290542081668043e-01, -1.26300238339170367574e-02, + -2.77371050405810226636e-02, -5.43586513698262885352e-02, -7.86459616541178574423e-02, 6.23528587727540037355e-02, -4.79677851814970662714e-02, + -6.51687150996678454806e-04, 5.76336385114276719688e-02, 1.44542478484825671209e-02, 3.16928492510423695516e-02, 1.45017405736592441823e-02, + 3.77649866255029068030e-02, 2.76488049642000443748e-04, -6.60577998684190731415e-02, -1.43760686140608738570e-02, 3.59108661833638931338e-02, + -1.96544252969081192917e-02, -3.14635605928988426605e-02, 2.73136448740384021883e-02, 4.81895944089887409700e-02, -1.41798371596522010049e-03, + -2.76940211432370950173e-02, -1.79321359038478039816e-02, -8.04857916575939247306e-03, 6.12601355103674924743e-04, -3.04826514707566033346e-02, + 3.97737096905840994271e-03, 2.93070515299252015717e-02, -1.68977509366934480761e-01, 3.32231696372570911580e-03, 1.25024830498748684704e-01, + 1.14603027997231002311e-01, -1.00188353252315814901e-01, -9.84663913699934667534e-03, 4.24578628782099620764e-02, -1.37172078837733080192e-01, + -3.49285758694722614504e-02, 5.10266827849673310080e-02, -8.71727496405721724582e-02, 6.53026570180906262841e-03, 8.81977524226997683376e-02, + -6.34979748614215300240e-02, -6.75922576223946108831e-02, -9.09058087393600777748e-03, 8.58354921744265697559e-02, -3.11903783366274736655e-02, + 2.00028673474334506288e-02, 2.51992069666158204078e-02, -1.15065874504069552003e-02, 1.90952708533619654185e-02, -1.42994317615683774053e-02, + 8.38885300224805237346e-04, -3.82027498742033497225e-02, -3.67441895491770198490e-02, 2.50992455595355073994e-02, 7.01187400269996513602e-02, + -5.54375280311450654991e-02, -4.38519736099493434578e-02, -7.84180536804670973161e-03, 2.15733075413469983783e-02, -1.13430180042112986952e-03, + 1.43263625967320618049e-02, 3.38406892444173892920e-02, 2.61661740894084809961e-02, 1.89963433472952851477e-02, 4.11523810167366797808e-03, + -4.07083694738235874616e-03, -2.14250124636823323365e-02, -2.51950730394823532721e-02, 3.42343547054715646727e-02, -1.60995215305804545425e-01, + 1.46286861154573760713e-01, -1.42470612032240401268e-02, -8.74980046536548150549e-02, -4.25453860188948623788e-02, 1.17182553786398857554e-01, + -1.00991016453327253632e-01, -7.91738577441953306213e-02, 5.29573588185536445194e-02, -2.21614298461902045623e-02, 3.58602587208211864844e-02, + 2.52438926833398191718e-02, 9.41877819477729971709e-02, -6.48116676539685077074e-02, -6.92622200130770665494e-02, 3.44271533520238565140e-02, + -2.14712430694437191037e-02, 1.72316382693014427674e-02, -2.66608743584075963406e-02, -2.10082338877249467923e-02, 8.91565305172099635544e-03, + -1.23413533420058361967e-02, -6.55699200671947673991e-03, -6.50539642022832619028e-03, 1.51124007337151353147e-02, 5.20370287348198221067e-03, + 2.44544519960917354495e-02, 8.17735780033393942767e-03, -3.77816692303542945967e-04, -2.75580902253722351269e-02, 1.61366174765763085996e-02, + -2.54225642602667507852e-02, -5.68510449978476550825e-02, 1.03315681722852791002e-02, 5.48232041684815468024e-03, -3.22722809472682503618e-02, + 1.68859338049149008965e-02, 6.21665123569529881609e-02, -1.49734091796970530952e-01, -1.69848035269845681894e-01, 7.28166844225807269320e-02, + -9.38546660994197951000e-02, -5.98972210309676594830e-02, 1.60189670628219316129e-01, 9.68228235109596380159e-02, -1.14699218288179388692e-01, + 5.22495478003770982833e-02, -2.50191304829539204468e-02, 2.77221049132821764638e-02, 5.25053174572039649259e-02, 4.67049795137407172674e-02, + -4.25063623233455645245e-02, -7.79015735544906322285e-03, 8.35061691171900405406e-02, -2.77565926301914164820e-02, -3.55176007501909543618e-02, + 5.22884040187019810686e-02, 4.47524306813492939866e-03, 3.34858736182796073999e-02, 2.18065090398272508343e-02, 3.96249948248765804237e-02, + -1.75050000687652293485e-02, -5.30639824787136182155e-03, 1.31658536276919365532e-02, -3.54893637807925724226e-02, 1.44838563901157494143e-03, + 2.53219139441511024990e-02, 1.51209661740110620776e-02, -3.18928979311501516886e-03, 8.08035892351891861518e-03, 1.49482343348299774599e-02, + -4.67401524501743839690e-02, 8.81785937471118302922e-02, 1.09443858484468511949e-01, 9.61675669132599497679e-02, -7.39592182705455791769e-02, + 8.87508822651789097691e-02, -7.91714174638406542606e-02, -1.25898861391198962911e-01, 8.84171948090256565322e-02, 3.93482215277929509023e-02, + -6.26211797345710557972e-02, 3.11866892937116280127e-02, 1.54206070094080910371e-01, -7.15962414998223273255e-02, 4.04187883182457047271e-02, + 3.87320351160306483584e-02, -2.13087169719965857650e-02, 2.04352330201420621936e-02, 3.60324068311299108847e-02, -6.71927151509099790383e-02, + -5.86355402262732916530e-02, 1.95738272971190847838e-02, 1.19986570986449735121e-02, -4.16517345466257682407e-02, 4.57582247311850084937e-02, + -5.64919874467361762815e-02, -2.96306742467898837426e-03, 3.45918894384134034681e-02, 9.37965919443191353810e-03, -5.31266846947417263614e-03, + 7.44645101900219368030e-03, -8.16779483872519251886e-03, -1.49486275306286754694e-02, 5.40961754497425346966e-03, -6.07743621110200162722e-03, + -2.86027271239626297572e-02, 9.28607307596479303324e-02, 1.15334393912762608880e-01, 2.22619048233438435180e-02, -2.81988516854455167904e-02, + -3.27953711282213400402e-02, -7.26623103447188861681e-02, -6.21318073281297983401e-02, 8.15860644657136341307e-02, 1.79600966703069159225e-02, + -8.26984672948943289050e-02, 2.66922837734803533594e-02, -5.62012642483699781382e-02, -7.54479658771655264937e-02, 5.63921972458279810447e-02, + -8.88808665037604112014e-03, 4.49098738994229513752e-04, -1.64624335502902702233e-02, 5.00902714527058645633e-02, 1.06477908341492902983e-02, + 2.19722684831073211686e-02, 9.27897245497274342219e-03, -1.38071463629181757221e-02, -3.25812324194547434097e-02, -3.02235182235052954325e-02, + 2.70211283173303479233e-02, 1.78695725115783597692e-02, -1.97856995310294429824e-02, 2.14583909244959528118e-02, 8.31160096115654556392e-03, + -7.96044059263601583298e-03, -7.03711411983747731069e-03, -7.52245974116911853002e-02, -7.17896739726268801052e-02, 1.07396425196690896431e-02, + 7.25906809169843403318e-02, -9.45023972725838740105e-02, -6.71199808984563744962e-02, 7.35264690791543329418e-02, 2.98610952212447697263e-02, + -7.52442146662268135371e-04, 9.23976694955527116937e-02, 4.60854381027500578649e-02, -5.81010137429742931636e-02, 5.19935015121687146844e-02, + -4.28751313838296663206e-02, 2.68412731409498166169e-02, 9.92974085166531926505e-03, -1.41649957602334279627e-02, 8.49484772510930227774e-03, + 1.60608334268962397659e-03, 1.53969582107269485627e-02, 2.53654424332110106644e-02, 2.20836817019017840613e-02, -4.96400766026642691758e-03, + -4.63895546537213768895e-03, -3.69755978269468085773e-02, -4.24220279369531480529e-02, -2.80842055465305032516e-03, 3.43511446156298310903e-03, + 1.50427480682660263955e-02, -7.64781824357823984684e-03, 1.55431405065905338392e-02, -5.28685500234718219748e-02, -4.81425552620864186104e-02, + -6.98904426260522071424e-02, -5.69063762150740712342e-02, -2.01599484306710097226e-02, -7.08142573082899164094e-03, 1.60387886663503793916e-02, + -8.26785713680359968247e-02, 2.82003440014560874394e-02, 2.73932418290509169245e-02, -3.17992788170617102228e-02, 5.85714331111230612770e-02, + 5.86577384557991701741e-02, -2.75299012996250893476e-03, -8.45195718330371027760e-03, -1.36279044444791216234e-02, -1.13870143130110085955e-02, + -9.47170994530230694886e-03, 8.38589777991547574709e-03, -2.44907795135516845320e-02, -1.88112311627625997112e-02, 1.66825300517051550164e-02, + -1.40472696715355817310e-02, 4.07602998308370448322e-02, 4.52331228574007898624e-03, -7.41516905358174677892e-03, -1.90839799893427405908e-02, + 1.37235319648593090402e-01, -5.07166887609150802974e-03, 1.66347985382777688312e-02, -8.94058332794331472870e-02, -9.96617048317507969735e-03, + -3.39998201752246195784e-02, -2.72752305938337435975e-02, 1.41116199971288980557e-04, 1.20136294077674496417e-02, 1.21046096252801875515e-02, + 4.67374536088999582156e-03, 1.76093997807116745338e-03, -6.49132489663982719524e-03, 6.34253853067380107822e-02, 4.20234078454048282092e-02, + -3.39907942260764435460e-03, -3.13684078013621997494e-02, -5.59725664044557688626e-03, 1.46041344723689698465e-02, 8.15628093364801319554e-03, + 8.81123245682426982361e-03, -5.36576704715815769320e-02, 4.13564181087699121731e-03, 6.66570175208870251832e-03, -3.06753731552251258582e-03, + 3.24260047333155276839e-02, 3.78357123622976698057e-03, 1.22559252382635042178e-01, -3.26726534731656623189e-02, -4.57263244390499479231e-02, + 1.23161267442891183416e-02, 5.60898223233850107272e-02, -2.07946281596515653023e-02, 3.30973059009364162231e-02, 3.79099335956614089116e-02, + 3.02099801034241572523e-03, -4.11260349557933183040e-02, -2.09662321613402133358e-02, -1.35059512400454856396e-02, 2.11033519015176411482e-02, + 2.49738730383721862366e-03, 1.80042474049896738739e-03, -4.21972590754290111104e-02, 7.84304881856809008034e-03, 1.28611420258033324476e-02, + 1.53304442551651341764e-02, 1.14809771240723442615e-02, 5.45508167269171534430e-03, 6.03486224308978115582e-03, -6.17922023172545829134e-03, + -1.06402780093771354153e-01, -1.06566854283863088337e-01, -1.56672555450536946098e-02, -4.17617234129553371869e-02, -5.84327485785076233826e-02, + 1.72707037153512245331e-02, -4.27180361478920241763e-03, 3.83975587930814599158e-02, 7.18917519991502662613e-02, 1.73599075858622414748e-02, + -5.06102136889801795805e-02, -2.28302899957008066656e-02, 4.05449577890660689539e-02, 6.05903063932164507449e-03, 1.42495320779388468663e-02, + -1.46505630681158707102e-02, -5.51579872998721708333e-03, -2.03950903125686006101e-02, 1.71600095189964607645e-02, 3.10141280680510215972e-02, + -6.92078952483923121042e-03, -1.25723580586239959064e-03, 4.83571917759556130223e-02, -1.08848884748079619000e-01, -7.62227492845969547414e-03, + 3.98614872899268266049e-02, 2.51496883852979809248e-02, -7.45157236466782307849e-02, -2.54315956467565489063e-02, 5.86785913495517369443e-02, + 6.07261945507166309849e-03, 2.37710782485035070077e-02, 2.40958099664499367232e-03, 8.00723308014901838381e-03, 5.57202821065413758661e-02, + -6.18738592105032812751e-03, 1.57471692604664484198e-03, -2.08797558382940772262e-03, -2.73200765442419279960e-02, -2.06208586891517380024e-02, + 6.40309150046379439887e-04, 3.34147637908005640250e-02, -2.31245128603038314907e-02, 3.13805487530873783442e-02, -3.76503956682762222496e-02, + 3.82033717675601958152e-02, 6.08549869979059313008e-02, -1.40664950951139375995e-02, 1.20432450888018800772e-02, 4.11120541709728091334e-03, + -1.31431111647770104689e-02, -2.16767866450208908369e-02, 2.36444182462271527620e-03, 4.15518391649481646372e-03, -7.19797119986096724242e-03, + 3.63099914737792378583e-02, -1.71114207061806439247e-02, 9.12094809288829279359e-03, -2.00581984724530065778e-02, 4.18093901030532240359e-03, + -1.54353999486445108563e-02, 3.77632145097120189292e-02, -8.67412239218371683425e-02, 3.74024476837445662980e-02, 7.02791955646850374784e-03, + -3.07387087745127421390e-03, 1.26170642077405754933e-02, 7.19502473862098246987e-03, 5.00348237158451253359e-02, 6.05821676660315069918e-03, + 2.81657375913338843543e-02, -2.75046494305255621871e-02, -3.32847608680125889302e-02, 4.92458523340539092161e-03, -6.97895182233836727098e-03, + -1.84078432809154611538e-02, -2.55254058040131799612e-02, 4.38596283726821068588e-03, 7.97305689082921688338e-03, -6.65251068675700718558e-02, + -2.43074168732615144076e-03, -3.21551055785660854641e-03, -2.14057386820096506863e-02, 1.73404829493880863200e-02, -2.21788279126988834011e-02, + 3.67289476360874028726e-02, 2.88921423109056961509e-02, -4.36590369050650264210e-03, -3.38015966458028857197e-03, -1.47872402615952351634e-02, + -2.67937691397940741522e-02, -4.01628891758317591032e-02, 5.37104159736995767638e-02, 3.38881421250558784175e-02, -1.94731556323654853013e-02, + 6.80080451079642287447e-04, -1.16224021866609874415e-02, -2.84314312441163938305e-02, -3.10403528556473483346e-02, -1.52614844050795953750e-02, + 1.46865039960839046523e-02, 7.74337973212646264037e-03, -2.75213939675030445919e-02, -3.12476741289728875139e-02, -3.75401476285800936306e-02, + 4.53067917901101985256e-02, 4.75497506720418041531e-03, 1.25627944556748021021e-02, 4.03046169919628882727e-02, -3.29378978115561424356e-02, + -2.51499548928088654393e-03, -1.99564144518295516484e-02, -2.63938123636600005528e-02, -1.84979990476826575141e-02, -4.75891539387540141171e-02, + 1.70189645456799328038e-02, 2.90621732209333551167e-02, 1.69695748997654785595e-02, 6.00578109434020054880e-03, 3.77405846672976205691e-02, + 1.04426223615697640751e-02, -7.42237607930411715310e-04, -1.51118572042552353624e-02, 1.29952623161545995079e-03, 1.26799047323642617713e-02, + 1.05278997248968164691e-02, 2.29682654055416574090e-02, 1.28888330591014361320e-02, -1.03014730669756075787e-02, -4.83421710205830541113e-03, + -1.90040068302814585399e-02, -4.31802671175361696410e-03 }; #define ILCHAM 992 -#define MTRONC 30 -#define STRONC 10 +#define MTRONC 30 +#define STRONC 10 -int main (int argc, char * argv[]) +int main(int argc, char* argv[]) { size_t len; - grib_handle * h; + grib_handle* h; double zval[ILCHAM]; int m, n, k; const char* outfile; - assert(argc==2); + assert(argc == 2); outfile = argv[1]; - GRIB_CHECK (((h = grib_handle_new_from_samples (NULL, "sh_ml_grib2")) == NULL), 0); + GRIB_CHECK(((h = grib_handle_new_from_samples(NULL, "sh_ml_grib2")) == NULL), 0); /* Meteo-France settings */ - GRIB_CHECK (grib_set_long (h, "centre", 85), 0); - len = strlen ("stretched_rotated_sh"); - GRIB_CHECK (grib_set_string (h, "gridType", "stretched_rotated_sh", &len), 0); - GRIB_CHECK (grib_set_long (h, "pentagonalResolutionParameterJ", MTRONC), 0); - GRIB_CHECK (grib_set_long (h, "pentagonalResolutionParameterK", MTRONC), 0); - GRIB_CHECK (grib_set_long (h, "pentagonalResolutionParameterM", MTRONC), 0); + GRIB_CHECK(grib_set_long(h, "centre", 85), 0); + len = strlen("stretched_rotated_sh"); + GRIB_CHECK(grib_set_string(h, "gridType", "stretched_rotated_sh", &len), 0); + GRIB_CHECK(grib_set_long(h, "pentagonalResolutionParameterJ", MTRONC), 0); + GRIB_CHECK(grib_set_long(h, "pentagonalResolutionParameterK", MTRONC), 0); + GRIB_CHECK(grib_set_long(h, "pentagonalResolutionParameterM", MTRONC), 0); - GRIB_CHECK (grib_set_double (h,"stretchingFactor", 2.40000000000000), 0); - GRIB_CHECK (grib_set_double (h,"latitudeOfStretchingPoleInDegrees", 46.4688478326275), 0); - GRIB_CHECK (grib_set_double (h,"longitudeOfStretchingPoleInDegrees", 2.57831007808864), 0); + GRIB_CHECK(grib_set_double(h, "stretchingFactor", 2.40000000000000), 0); + GRIB_CHECK(grib_set_double(h, "latitudeOfStretchingPoleInDegrees", 46.4688478326275), 0); + GRIB_CHECK(grib_set_double(h, "longitudeOfStretchingPoleInDegrees", 2.57831007808864), 0); - GRIB_CHECK (grib_set_long (h, "bitsPerValue", 16), 0); - len = strlen ("spectral_complex"); - GRIB_CHECK (grib_set_string (h, "packingType", "spectral_complex", &len), 0); + GRIB_CHECK(grib_set_long(h, "bitsPerValue", 16), 0); + len = strlen("spectral_complex"); + GRIB_CHECK(grib_set_string(h, "packingType", "spectral_complex", &len), 0); - GRIB_CHECK (grib_set_long (h, "subSetJ", STRONC), 0); - GRIB_CHECK (grib_set_long (h, "subSetK", STRONC), 0); - GRIB_CHECK (grib_set_long (h, "subSetM", STRONC), 0); - GRIB_CHECK (grib_set_long (h, "unpackedSubsetPrecision", 1), 0); + GRIB_CHECK(grib_set_long(h, "subSetJ", STRONC), 0); + GRIB_CHECK(grib_set_long(h, "subSetK", STRONC), 0); + GRIB_CHECK(grib_set_long(h, "subSetM", STRONC), 0); + GRIB_CHECK(grib_set_long(h, "unpackedSubsetPrecision", 1), 0); - GRIB_CHECK (grib_set_double_array (h, "values", values, ILCHAM), 0); + GRIB_CHECK(grib_set_double_array(h, "values", values, ILCHAM), 0); len = ILCHAM; - GRIB_CHECK (grib_get_double_array (h, "values", zval, &len), 0); + GRIB_CHECK(grib_get_double_array(h, "values", zval, &len), 0); - for (m = 0, k = 0; m < MTRONC+1; m++) { - for (n = MTRONC - m; n < MTRONC+1; k++, n++) - { + for (m = 0, k = 0; m < MTRONC + 1; m++) { + for (n = MTRONC - m; n < MTRONC + 1; k++, n++) { /* Check that imaginary part of first coefficients is zero */ - if ((m == 0) && (zval[2*k+1] != 0.)) - { - printf ("Imaginary part of coefficient (m=%d,n=%d) should be zero\n", m, n); + if ((m == 0) && (zval[2 * k + 1] != 0.)) { + printf("Imaginary part of coefficient (m=%d,n=%d) should be zero\n", m, n); return 1; } } } GRIB_CHECK(grib_write_message(h, outfile, "w"), 0); - GRIB_CHECK (grib_handle_delete (h), 0); + GRIB_CHECK(grib_handle_delete(h), 0); printf("ALL OK\n"); return 0; diff --git a/tests/grib_util_set_spec.c b/tests/grib_util_set_spec.c index 5a4862da9..af530867a 100644 --- a/tests/grib_util_set_spec.c +++ b/tests/grib_util_set_spec.c @@ -17,7 +17,7 @@ static int get_packing_type_code(const char* packingType) { int result = GRIB_UTIL_PACKING_TYPE_GRID_SIMPLE; - if (packingType==NULL) + if (packingType == NULL) return result; if (STR_EQUAL(packingType, "grid_jpeg")) @@ -33,61 +33,64 @@ static int get_packing_type_code(const char* packingType) } static void test_reduced_gg(int remove_local_def, int edition, const char* packingType, - const char* input_filename, const char* output_filename) + const char* input_filename, const char* output_filename) { /* based on copy_spec_from_ksec */ - int err = 0; + int err = 0; size_t slen = 32, inlen = 0, outlen = 0; - size_t i=0, size=0; - int set_spec_flags=0; - double* values = NULL; - FILE* in = NULL; - FILE* out = NULL; + size_t i = 0, size = 0; + int set_spec_flags = 0; + double* values = NULL; + FILE* in = NULL; + FILE* out = NULL; const void* buffer = NULL; char gridType[128] = {0,}; - codes_handle *handle = 0; - codes_handle *finalh = 0; - grib_util_grid_spec spec={0,}; - grib_util_packing_spec packing_spec={0,}; + codes_handle* handle = 0; + codes_handle* finalh = 0; + grib_util_grid_spec spec = {0,}; + grib_util_packing_spec packing_spec = {0,}; assert(input_filename); - in = fopen(input_filename,"rb"); assert(in); - handle = grib_handle_new_from_file(0,in,&err); assert(handle); + in = fopen(input_filename, "rb"); + assert(in); + handle = grib_handle_new_from_file(0, in, &err); + assert(handle); - CODES_CHECK(grib_get_string(handle, "gridType", gridType, &slen),0); + CODES_CHECK(grib_get_string(handle, "gridType", gridType, &slen), 0); if (!STR_EQUAL(gridType, "reduced_gg")) { grib_handle_delete(handle); return; } assert(output_filename); - out = fopen(output_filename,"wb"); assert(out); + out = fopen(output_filename, "wb"); + assert(out); - CODES_CHECK(grib_get_size(handle,"values",&inlen), 0); - values = (double*)malloc(sizeof(double)*inlen); - CODES_CHECK(grib_get_double_array(handle, "values", values,&inlen), 0); - for(i=0; i8) usage(prog); + + if (argc == 1 || argc > 8) usage(prog); for (i = 1; i < argc; i++) { - if (strcmp(argv[i],"-p")==0) { - packingType = argv[i+1]; + if (strcmp(argv[i], "-p") == 0) { + packingType = argv[i + 1]; ++i; - } else if (strcmp(argv[i],"-e")==0) { - edition = atoi( argv[i+1] ); + } + else if (strcmp(argv[i], "-e") == 0) { + edition = atoi(argv[i + 1]); ++i; - } else if (strcmp(argv[i],"-r")==0) { + } + else if (strcmp(argv[i], "-r") == 0) { remove_local_def = 1; - } else { + } + else { /* Expect 2 filenames */ - infile_name = argv[i]; - outfile_name = argv[i+1]; + infile_name = argv[i]; + outfile_name = argv[i + 1]; break; } } diff --git a/tests/ibm.c b/tests/ibm.c old mode 100755 new mode 100644 index aa7a4f66f..82f725029 --- a/tests/ibm.c +++ b/tests/ibm.c @@ -14,24 +14,22 @@ #include "grib_api_internal.h" -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - unsigned long i = 0; + unsigned long i = 0; - assert(grib_ibm_to_long(grib_long_to_ibm(i)) == i); + assert(grib_ibm_to_long(grib_long_to_ibm(i)) == i); - for(i = 1; i < 0x7fffffff; i++) - { - unsigned long j = i | 0x80000000; - if(grib_ibm_to_long(grib_long_to_ibm(i)) != i) - { - printf("i=%ld i=%lx e=%g x=%lx\n",i,i,grib_long_to_ibm(i),grib_ibm_to_long(grib_long_to_ibm(i))); - assert(grib_ibm_to_long(grib_long_to_ibm(i)) == i); - } - assert(grib_ibm_to_long(grib_long_to_ibm(j)) == j); - if((i%100000) == 0) - printf("i = %08lx %08lx %g %g\n",i,j,grib_long_to_ibm(i),grib_long_to_ibm(j)); - } + for (i = 1; i < 0x7fffffff; i++) { + unsigned long j = i | 0x80000000; + if (grib_ibm_to_long(grib_long_to_ibm(i)) != i) { + printf("i=%ld i=%lx e=%g x=%lx\n", i, i, grib_long_to_ibm(i), grib_ibm_to_long(grib_long_to_ibm(i))); + assert(grib_ibm_to_long(grib_long_to_ibm(i)) == i); + } + assert(grib_ibm_to_long(grib_long_to_ibm(j)) == j); + if ((i % 100000) == 0) + printf("i = %08lx %08lx %g %g\n", i, j, grib_long_to_ibm(i), grib_long_to_ibm(j)); + } - return 0; + return 0; } diff --git a/tests/ieee.c b/tests/ieee.c old mode 100755 new mode 100644 index 14089c79b..3dcd6bf89 --- a/tests/ieee.c +++ b/tests/ieee.c @@ -14,12 +14,12 @@ #include "grib_api_internal.h" -double min = -1.0000000001; -double max = -1.00000000001; -double scale ; +double min = -1.0000000001; +double max = -1.00000000001; +double scale; -typedef unsigned long (*ieee_to_long_proc) (double); -typedef double (*long_to_ieee_proc) (unsigned long); +typedef unsigned long (*ieee_to_long_proc)(double); +typedef double (*long_to_ieee_proc)(unsigned long); #if 0 static void test(unsigned long input, ieee_to_long_proc ieee_to_long, long_to_ieee_proc long_to_ieee) @@ -52,7 +52,7 @@ double p(double ref1,double ref2) static double randfrom(double minimum, double maximum) { double range = (maximum - minimum); - double div = RAND_MAX / range; + double div = RAND_MAX / range; return minimum + (rand() / div); } /* Return 1 on success, 0 on failure */ @@ -62,81 +62,80 @@ static int test_doubles(ieee_to_long_proc ieee_to_long, long_to_ieee_proc long_t const double increment = 1; const double max_value = 10 * 1000 * 1000; const double min_value = -max_value; - double d = max_value; - int num_errors = 0; - int num_trials = 0; - double max_reldiff = -DBL_MAX; + double d = max_value; + int num_errors = 0; + int num_trials = 0; + double max_reldiff = -DBL_MAX; while (d > min_value) { - double start = randfrom(0.7,1) * d; + double start = randfrom(0.7, 1) * d; unsigned long a = ieee_to_long(start); double end = long_to_ieee(a); num_trials++; if (start != 0.0) { - double reldiff = fabs(end - start)/start; + double reldiff = fabs(end - start) / start; if (reldiff > tolerance) { printf("Error: %.10f (diff=%.10f)\n", start, reldiff); - num_errors ++; - } else { + num_errors++; + } + else { /*printf("Success: %.10f (diff=%.10f)\n", start, reldiff);*/ } if (reldiff > max_reldiff) max_reldiff = reldiff; } d -= increment; } - printf("trials = %d, errors = %d\n", num_trials,num_errors); + printf("trials = %d, errors = %d\n", num_trials, num_errors); printf("max reldiff = %g\n", max_reldiff); - return num_errors==0 ? 1 : 0; + return num_errors == 0 ? 1 : 0; } -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { #if 1 - unsigned long i = 0; - printf("Test doubles with grib_ieee_to_long/grib_long_to_ieee...\n"); - assert( test_doubles(grib_ieee_to_long, grib_long_to_ieee)==1 ); + unsigned long i = 0; + printf("Test doubles with grib_ieee_to_long/grib_long_to_ieee...\n"); + assert(test_doubles(grib_ieee_to_long, grib_long_to_ieee) == 1); - printf("Test doubles with grib_ieee64_to_long/grib_long_to_ieee64...\n"); - assert( test_doubles(grib_ieee64_to_long, grib_long_to_ieee64)==1 ); + printf("Test doubles with grib_ieee64_to_long/grib_long_to_ieee64...\n"); + assert(test_doubles(grib_ieee64_to_long, grib_long_to_ieee64) == 1); printf("Test integers...\n"); - /* test(3242539564, grib_ieee_to_long, grib_long_to_ieee); This fails! */ - assert(grib_ieee_to_long(grib_long_to_ieee(i)) == i); - - /* The minimum value for which we can convert a long to ieee and back is 0x800000 */ - /* The maximum value for which we can convert a long to ieee and back is 0x7f800000 */ - for(i = 0x800000; i < 0x7f800000; i++) - { - /*unsigned long j = i | 0x80000000;*/ - - if(grib_ieee_to_long(grib_long_to_ieee(i)) != i) - { - printf("i=%lu i=%lx e=%g x=%lx\n",i,i,grib_long_to_ieee(i),grib_ieee_to_long(grib_long_to_ieee(i))); - /*assert(grib_ieee_to_long(grib_long_to_ieee(i)) == i);*/ - assert(0); - } - /*if(grib_ieee_to_long(grib_long_to_ieee(j)) != j) + /* test(3242539564, grib_ieee_to_long, grib_long_to_ieee); This fails! */ + assert(grib_ieee_to_long(grib_long_to_ieee(i)) == i); + + /* The minimum value for which we can convert a long to ieee and back is 0x800000 */ + /* The maximum value for which we can convert a long to ieee and back is 0x7f800000 */ + for (i = 0x800000; i < 0x7f800000; i++) { + /*unsigned long j = i | 0x80000000;*/ + + if (grib_ieee_to_long(grib_long_to_ieee(i)) != i) { + printf("i=%lu i=%lx e=%g x=%lx\n", i, i, grib_long_to_ieee(i), grib_ieee_to_long(grib_long_to_ieee(i))); + /*assert(grib_ieee_to_long(grib_long_to_ieee(i)) == i);*/ + assert(0); + } + /*if(grib_ieee_to_long(grib_long_to_ieee(j)) != j) { printf("j=%ld i=%lx e=%g x=%lx\n",j,j,grib_long_to_ieee(j),grib_ieee_to_long(grib_long_to_ieee(j))); } if ((i%1000000) == 0) { printf("i = %08lx(%ld) %08lx(%ld) %g %g\n", i,i,j,j,grib_long_to_ieee(i),grib_long_to_ieee(j)); }*/ - } + } #else - double ref1 = grib_long_to_ieee(grib_ieee_to_long(min)); - double ref2 = grib_nearest_smaller_ieee_float(min); + double ref1 = grib_long_to_ieee(grib_ieee_to_long(min)); + double ref2 = grib_nearest_smaller_ieee_float(min); - double a = p(min,ref1); - double b = p(min,ref2); - double c = p(ref1,ref1); - double d = p(ref2,ref2); + double a = p(min, ref1); + double b = p(min, ref2); + double c = p(ref1, ref1); + double d = p(ref2, ref2); - assert(minname_,t->timer_/repeat); +static void print_timer(grib_timer* t, int repeat) +{ + printf("%s : %g cpu\n", t->name_, t->timer_ / repeat); } -int main(int argc, char* argv[]) { - grib_handle *h=NULL; - grib_context* c=NULL; - FILE* fin=NULL; - FILE* fout=NULL; - char* finname; - char* ofilename; - char defofilename[]="jpeg_perf.out"; - double *values=NULL; - int append=0; - size_t nvalues=0; - int count,e=0; - int repeatjpeg=1; - int repeatsimple=1; - grib_timer *tes,*tds,*tej,*tdj; - char grid_jpeg[]="grid_jpeg"; - size_t grid_jpeg_l=strlen(grid_jpeg); - char grid_simple[]="grid_simple"; - size_t grid_simple_l=strlen(grid_simple); - char packingType[50]={0,}; - size_t len=50; - char param[50]={0,}; - char gridType[50]={0,}; - char outfilename[255]={0,}; - size_t filesize_jpeg=0; - size_t filesize_simple=0; - double perc=0; - long bitsPerValue=0; - int iarg=1; - char grid[20]={0,}; - char shortName[20]={0,}; - long level; - char levelType[20]={0,}; - - tes=grib_get_timer(0,"encoding simple", 0, 0); - tds=grib_get_timer(0,"decoding simple", 0, 0); - tej=grib_get_timer(0,"encoding jpeg", 0, 0); - tdj=grib_get_timer(0,"decoding jpeg", 0, 0); - - if (argc != 4 && argc != 6 ) usage(argv[0]); - if (!strcmp(argv[iarg],"-w")) { - append=0; - iarg++; - ofilename=argv[iarg]; - iarg++; - } else if (!strcmp(argv[iarg],"-a")) { - append=1; - iarg++; - ofilename=argv[iarg]; - iarg++; - } else { - append=0; - ofilename=defofilename; - } - finname=argv[iarg++]; - repeatsimple=atoi(argv[iarg++]); - bitsPerValue=atoi(argv[iarg++]); - - fin = fopen(finname,"rb"); - if(!fin) {perror(finname);exit(1);} - - if (append) - fout = fopen(ofilename,"ab"); - else - fout = fopen(ofilename,"wb"); - - if(!fout) {perror(ofilename);exit(1);} - - c=grib_context_get_default(); - e=0; - h=grib_handle_new_from_file(c,fin,&e); - fclose(fin); - - GRIB_CHECK(e,0); - - len=50; - grib_get_string(h,"shortName",param,&len); - - len=20; - grib_get_string(h,"levelType",levelType,&len); - - if (!strcmp(levelType,"pl")) { - GRIB_CHECK(grib_get_long(h,"level",&level),0); - sprintf(shortName,"%s%ld",param,level); - } else { - sprintf(shortName,"%s",param); - } - - - grib_set_long(h,"editionNumber",2); - GRIB_CHECK(grib_get_size(h,"values",&nvalues),0); - values=(double*)grib_context_malloc(c,sizeof(double)*nvalues); - if (!values) { printf("%s: memory allocation error\n",argv[0]); exit(1); } - - len=50; - grib_get_string(h,"gridType",gridType,&len); - - len=50; - grib_get_string(h,"packingType",packingType,&len); - - GRIB_CHECK(grib_get_double_array(h,"values",values,&nvalues),0); - grib_set_long(h,"bitsPerValue",bitsPerValue); - GRIB_CHECK(grib_set_double_array(h,"values",values,nvalues),0); - - printf("--------------------------------\n"); - printf("- %s - gridType=%s packingType=%s numberOfValues=%ld bitsPerValue=%ld\n", - param,gridType,packingType,(long)nvalues,bitsPerValue); - - if (!strcmp(packingType,"spectral_complex") || !strcmp(packingType,"spectral_simple")) { - printf("unable to process spectral data\n"); - exit(1); - } - - if (!strcmp(gridType,"reduced_gg") || !strcmp(gridType,"regular_gg")) { - long N; - grib_get_long(h,"N",&N); - printf(" N=%ld\n",N); - sprintf(grid,"%ld",N); - } - if (!strcmp(gridType,"regular_ll")) { - double Di,Dj; - grib_get_double(h,"DiInDegrees",&Di); - grib_get_double(h,"DjInDegrees",&Dj); - printf(" Di=%g Dj=%g\n",Di,Dj); - sprintf(grid,"%g/%g",Di,Dj); - } - - - if (!append) - fprintf(fout, - "shortName gridType numberOfValues bitsPerValue grid sizeSimple sizeJpeg encodeJpeg encodeSimple decodeJpeg decodeSimple\n"); - - /* decode values grid_simple */ - if (strcmp(packingType,grid_simple)) - grib_set_string(h,"packingType",grid_simple,&grid_simple_l); - /* printf("decoding simple\n"); */ - grib_timer_start(tds); - for (count=0;counttimer_/repeatjpeg,tes->timer_/repeatsimple,tdj->timer_/repeatjpeg,tds->timer_/repeatsimple); - - return 0; +int main(int argc, char* argv[]) +{ + grib_handle* h = NULL; + grib_context* c = NULL; + FILE* fin = NULL; + FILE* fout = NULL; + char* finname; + char* ofilename; + char defofilename[] = "jpeg_perf.out"; + double* values = NULL; + int append = 0; + size_t nvalues = 0; + int count, e = 0; + int repeatjpeg = 1; + int repeatsimple = 1; + grib_timer *tes, *tds, *tej, *tdj; + char grid_jpeg[] = "grid_jpeg"; + size_t grid_jpeg_l = strlen(grid_jpeg); + char grid_simple[] = "grid_simple"; + size_t grid_simple_l = strlen(grid_simple); + char packingType[50] = {0,}; + size_t len = 50; + char param[50] = {0,}; + char gridType[50] = {0,}; + char outfilename[255] = {0,}; + size_t filesize_jpeg = 0; + size_t filesize_simple = 0; + double perc = 0; + long bitsPerValue = 0; + int iarg = 1; + char grid[20] = {0,}; + char shortName[20] = {0,}; + long level; + char levelType[20] = {0,}; + + tes = grib_get_timer(0, "encoding simple", 0, 0); + tds = grib_get_timer(0, "decoding simple", 0, 0); + tej = grib_get_timer(0, "encoding jpeg", 0, 0); + tdj = grib_get_timer(0, "decoding jpeg", 0, 0); + + if (argc != 4 && argc != 6) usage(argv[0]); + if (!strcmp(argv[iarg], "-w")) { + append = 0; + iarg++; + ofilename = argv[iarg]; + iarg++; + } + else if (!strcmp(argv[iarg], "-a")) { + append = 1; + iarg++; + ofilename = argv[iarg]; + iarg++; + } + else { + append = 0; + ofilename = defofilename; + } + finname = argv[iarg++]; + repeatsimple = atoi(argv[iarg++]); + bitsPerValue = atoi(argv[iarg++]); + + fin = fopen(finname, "rb"); + if (!fin) { + perror(finname); + exit(1); + } + + if (append) + fout = fopen(ofilename, "ab"); + else + fout = fopen(ofilename, "wb"); + + if (!fout) { + perror(ofilename); + exit(1); + } + + c = grib_context_get_default(); + e = 0; + h = grib_handle_new_from_file(c, fin, &e); + fclose(fin); + + GRIB_CHECK(e, 0); + + len = 50; + grib_get_string(h, "shortName", param, &len); + + len = 20; + grib_get_string(h, "levelType", levelType, &len); + + if (!strcmp(levelType, "pl")) { + GRIB_CHECK(grib_get_long(h, "level", &level), 0); + sprintf(shortName, "%s%ld", param, level); + } + else { + sprintf(shortName, "%s", param); + } + + + grib_set_long(h, "editionNumber", 2); + GRIB_CHECK(grib_get_size(h, "values", &nvalues), 0); + values = (double*)grib_context_malloc(c, sizeof(double) * nvalues); + if (!values) { + printf("%s: memory allocation error\n", argv[0]); + exit(1); + } + + len = 50; + grib_get_string(h, "gridType", gridType, &len); + + len = 50; + grib_get_string(h, "packingType", packingType, &len); + + GRIB_CHECK(grib_get_double_array(h, "values", values, &nvalues), 0); + grib_set_long(h, "bitsPerValue", bitsPerValue); + GRIB_CHECK(grib_set_double_array(h, "values", values, nvalues), 0); + + printf("--------------------------------\n"); + printf("- %s - gridType=%s packingType=%s numberOfValues=%ld bitsPerValue=%ld\n", + param, gridType, packingType, (long)nvalues, bitsPerValue); + + if (!strcmp(packingType, "spectral_complex") || !strcmp(packingType, "spectral_simple")) { + printf("unable to process spectral data\n"); + exit(1); + } + + if (!strcmp(gridType, "reduced_gg") || !strcmp(gridType, "regular_gg")) { + long N; + grib_get_long(h, "N", &N); + printf(" N=%ld\n", N); + sprintf(grid, "%ld", N); + } + if (!strcmp(gridType, "regular_ll")) { + double Di, Dj; + grib_get_double(h, "DiInDegrees", &Di); + grib_get_double(h, "DjInDegrees", &Dj); + printf(" Di=%g Dj=%g\n", Di, Dj); + sprintf(grid, "%g/%g", Di, Dj); + } + + + if (!append) + fprintf(fout, + "shortName gridType numberOfValues bitsPerValue grid sizeSimple sizeJpeg encodeJpeg encodeSimple decodeJpeg decodeSimple\n"); + + /* decode values grid_simple */ + if (strcmp(packingType, grid_simple)) + grib_set_string(h, "packingType", grid_simple, &grid_simple_l); + /* printf("decoding simple\n"); */ + grib_timer_start(tds); + for (count = 0; count < repeatsimple; count++) + GRIB_CHECK(grib_get_double_array(h, "values", values, &nvalues), 0); + grib_timer_stop(tds, 0); + /* printf("%d messages decoded\n\n",count); */ + + *outfilename = '\0'; + sprintf(outfilename, "%s_%s_%ld_simple.grib2", param, gridType, bitsPerValue); + filesize_simple = grib_handle_write(h, outfilename); + printf("file size simple = %ld\n", (long)filesize_simple); + + /* encode values grid_simple*/ + /* printf("encoding simple\n"); */ + grib_timer_start(tes); + for (count = 0; count < repeatsimple; count++) + GRIB_CHECK(grib_set_double_array(h, "values", values, nvalues), 0); + grib_timer_stop(tes, 0); + /* printf("%d messages encoded \n\n",count); */ + + /* decode values grid_jpeg */ + grib_set_string(h, "packingType", grid_jpeg, &grid_jpeg_l); + /* printf("decoding jpeg\n"); */ + grib_timer_start(tdj); + for (count = 0; count < repeatjpeg; count++) + GRIB_CHECK(grib_get_double_array(h, "values", values, &nvalues), 0); + grib_timer_stop(tdj, 0); + /* printf("%d messages decoded\n\n",count); */ + + *outfilename = '\0'; + sprintf(outfilename, "%s_%s_%ld_jpeg.grib2", param, gridType, bitsPerValue); + filesize_jpeg = grib_handle_write(h, outfilename); + printf("file size jpeg = %ld\n", (long)filesize_jpeg); + + perc = (double)filesize_simple / (double)filesize_jpeg; + + printf("compression ratio = %g \n", perc); + printf("space savings = %g \n", (1.0 - 1.0 / perc) * 100); + + /* encode values grid_jpeg*/ + /* printf("encoding jpeg\n"); */ + grib_timer_start(tej); + for (count = 0; count < repeatjpeg; count++) + GRIB_CHECK(grib_set_double_array(h, "values", values, nvalues), 0); + grib_timer_stop(tej, 0); + /* printf("%d messages encoded \n\n",count); */ + + grib_handle_delete(h); + grib_context_free(c, values); + + print_timer(tej, repeatjpeg); + print_timer(tdj, repeatjpeg); + print_timer(tes, repeatsimple); + print_timer(tds, repeatsimple); + printf("--------------------------------\n\n"); + fprintf(fout, "%s %s %ld %ld %s %ld %ld %g %g %g %g\n", + shortName, gridType, (long)nvalues, bitsPerValue, + grid, (long)filesize_simple, (long)filesize_jpeg, tej->timer_ / repeatjpeg, tes->timer_ / repeatsimple, tdj->timer_ / repeatjpeg, tds->timer_ / repeatsimple); + + return 0; } #else -int main(int argc,char* argv[]) { -return 0; +int main(int argc, char* argv[]) +{ + return 0; } #endif - diff --git a/tests/julian.c b/tests/julian.c index c91c4f8f4..9c723b0bc 100644 --- a/tests/julian.c +++ b/tests/julian.c @@ -12,15 +12,15 @@ #include #define EPSILON 1e-12 -#define DBL_EQUAL(a,b) (fabs((a)-(b))<=(EPSILON)*fabs((a))) +#define DBL_EQUAL(a, b) (fabs((a) - (b)) <= (EPSILON)*fabs((a))) -#define BOOL int -#define TRUE 1 +#define BOOL int +#define TRUE 1 #define FALSE 0 static BOOL Check( - const long year1, const long month1, const long day1, const long hour1, const long min1, const long sec1, - const long year2, const long month2, const long day2, const long hour2, const long min2, const long sec2) + const long year1, const long month1, const long day1, const long hour1, const long min1, const long sec1, + const long year2, const long month2, const long day2, const long hour2, const long min2, const long sec2) { if (year1 != year2 || month1 != month2 || day1 != day2 || hour1 != hour2 || min1 != min2 || sec1 != sec2) { return FALSE; @@ -35,27 +35,28 @@ static void TestDateTime(const long year, const long month, const long day, cons long jdlong1, jdlong2, date; /* Convert the input values to a double */ - grib_datetime_to_julian(year,month,day,hour,min,sec, &jd); + grib_datetime_to_julian(year, month, day, hour, min, sec, &jd); /* Convert the double back to the input values and compare */ - grib_julian_to_datetime(jd, &year1,&month1,&day1,&hour1,&min1,&sec1); + grib_julian_to_datetime(jd, &year1, &month1, &day1, &hour1, &min1, &sec1); - if (!Check(year,month,day,hour,min,sec, year1,month1,day1,hour1,min1,sec1)) { - fprintf(stderr, "Failed julian<->datetime\nInput: year=%ld mon=%ld day=%ld time=%ld:%ld:%ld\n" + if (!Check(year, month, day, hour, min, sec, year1, month1, day1, hour1, min1, sec1)) { + fprintf(stderr, + "Failed julian<->datetime\nInput: year=%ld mon=%ld day=%ld time=%ld:%ld:%ld\n" "Output: year=%ld mon=%ld day=%ld time=%ld:%ld:%ld\n", year, month, day, hour, min, sec, - year1,month1,day1,hour1,min1,sec1); - exit (1); + year1, month1, day1, hour1, min1, sec1); + exit(1); } /* Now test the conversion from long -> long */ - jdlong1=(long)(jd+0.5); /* round up */ - date=grib_julian_to_date(jdlong1); - jdlong2=grib_date_to_julian(date); - if ( jdlong1 != jdlong2 ) { + jdlong1 = (long)(jd + 0.5); /* round up */ + date = grib_julian_to_date(jdlong1); + jdlong2 = grib_date_to_julian(date); + if (jdlong1 != jdlong2) { fprintf(stderr, "Failed julian<->date\nInput: year=%ld mon=%ld day=%ld time=%ld:%ld:%ld\n", year, month, day, hour, min, sec); - exit (1); + exit(1); } } @@ -73,18 +74,18 @@ static void Test0() min = 26; sec = 24; - grib_datetime_to_julian(year, month, day, hour,min, sec, &jd); - assert( DBL_EQUAL(jd, 2378891.268333) ); - printf("%ld %ld %ld %ld:%ld:%ld -> %f\n",year,month,day,hour,min,sec,jd); - - grib_julian_to_datetime(jd, &year, &month, &day, &hour,&min, &sec); - assert( year == 1801 ); - assert( month == 1 ); - assert( day == 30 ); - assert( hour == 18 ); - assert( min == 26 ); - assert( sec == 24 ); - printf("%ld %ld %ld %ld:%ld:%ld -> %f\n",year,month,day,hour,min,sec,jd); + grib_datetime_to_julian(year, month, day, hour, min, sec, &jd); + assert(DBL_EQUAL(jd, 2378891.268333)); + printf("%ld %ld %ld %ld:%ld:%ld -> %f\n", year, month, day, hour, min, sec, jd); + + grib_julian_to_datetime(jd, &year, &month, &day, &hour, &min, &sec); + assert(year == 1801); + assert(month == 1); + assert(day == 30); + assert(hour == 18); + assert(min == 26); + assert(sec == 24); + printf("%ld %ld %ld %ld:%ld:%ld -> %f\n", year, month, day, hour, min, sec, jd); } static void Test1() @@ -94,68 +95,69 @@ static void Test1() /* Test a specific date */ printf("Test1...\n"); - year = 1957; + year = 1957; month = 10; - day = 4; - hour = 19; - min = 26; - sec = 24; - - grib_datetime_to_julian(year, month, day, hour,min, sec, &jd); - assert( DBL_EQUAL(jd, 2436116.31) ); - printf("%ld %ld %ld %ld:%ld:%ld -> %f\n",year,month,day,hour,min,sec,jd); - - grib_julian_to_datetime(jd, &year, &month, &day, &hour,&min, &sec); - assert( year == 1957 ); - assert( month == 10 ); - assert( day == 4 ); - assert( hour == 19 ); - assert( min == 26 ); - assert( sec == 24 ); - printf("%ld %ld %ld %ld:%ld:%ld -> %f\n",year,month,day,hour,min,sec,jd); + day = 4; + hour = 19; + min = 26; + sec = 24; + + grib_datetime_to_julian(year, month, day, hour, min, sec, &jd); + assert(DBL_EQUAL(jd, 2436116.31)); + printf("%ld %ld %ld %ld:%ld:%ld -> %f\n", year, month, day, hour, min, sec, jd); + + grib_julian_to_datetime(jd, &year, &month, &day, &hour, &min, &sec); + assert(year == 1957); + assert(month == 10); + assert(day == 4); + assert(hour == 19); + assert(min == 26); + assert(sec == 24); + printf("%ld %ld %ld %ld:%ld:%ld -> %f\n", year, month, day, hour, min, sec, jd); } static void Test2() { long year, month, day, hour, minute, second; - int i,last; + int i, last; double jd; - long jdl,date; + long jdl, date; /* Test specific julian values */ - double jds[]={ - 2451545.0, - 2446822.5, - 2446966.0, - 2447187.5, - 2447332.0, - 2415020.5, - 2305447.5, - 2305812.5, - 2205512.5, - 2026871.8, - 0.0}; - - last=sizeof(jds)/sizeof(double); + double jds[] = { + 2451545.0, + 2446822.5, + 2446966.0, + 2447187.5, + 2447332.0, + 2415020.5, + 2305447.5, + 2305812.5, + 2205512.5, + 2026871.8, + 0.0 + }; + + last = sizeof(jds) / sizeof(double); printf("\n"); printf("Test2...\n"); - for (i=0;i %f\n",year,month,day,hour,minute,second,jd); - grib_datetime_to_julian(year,month,day,hour,minute,second,&jd); - printf("- %ld %ld %ld %ld:%ld:%ld -> %f\n",year,month,day,hour,minute,second,jd); - - if ( !DBL_EQUAL(jd, jds[i]) ) { + for (i = 0; i < last; i++) { + jd = jds[i]; + grib_julian_to_datetime(jd, &year, &month, &day, &hour, &minute, &second); + printf("+ %ld %ld %ld %ld:%ld:%ld -> %f\n", year, month, day, hour, minute, second, jd); + grib_datetime_to_julian(year, month, day, hour, minute, second, &jd); + printf("- %ld %ld %ld %ld:%ld:%ld -> %f\n", year, month, day, hour, minute, second, jd); + + if (!DBL_EQUAL(jd, jds[i])) { fprintf(stderr, "i=%d: Got: %f, expected: %f\n", i, jd, jds[i]); assert(0); } - jdl=(long)(jd+0.5); - date=grib_julian_to_date(jdl); - printf("+ %ld -> %ld\n",date,jdl); - jdl=grib_date_to_julian(date); - printf("- %ld -> %ld\n",date,jdl); + jdl = (long)(jd + 0.5); + date = grib_julian_to_date(jdl); + printf("+ %ld -> %ld\n", date, jdl); + jdl = grib_date_to_julian(date); + printf("- %ld -> %ld\n", date, jdl); printf("\n"); } } @@ -164,12 +166,12 @@ static void Test3() { long iyear, imnth, iday, ihr, imin, isec; printf("Test3...\n"); - for (iyear=1950; iyear<=2015; iyear+=5) { - for (imnth=1; imnth<=12; imnth+=1) { - for (iday=1; iday<=28; iday+=1) { - for (ihr=1; ihr<=23; ihr+=2) { - for (imin=1; imin<=59; imin+=3) { - for(isec=1; isec<=59; isec+=5) { + for (iyear = 1950; iyear <= 2015; iyear += 5) { + for (imnth = 1; imnth <= 12; imnth += 1) { + for (iday = 1; iday <= 28; iday += 1) { + for (ihr = 1; ihr <= 23; ihr += 2) { + for (imin = 1; imin <= 59; imin += 3) { + for (isec = 1; isec <= 59; isec += 5) { TestDateTime(iyear, imnth, iday, ihr, imin, isec); } } @@ -179,7 +181,7 @@ static void Test3() } } -int main(int argc,char* argv[]) +int main(int argc, char* argv[]) { Test0(); Test1(); diff --git a/tests/largefile.c b/tests/largefile.c index 8aff7521c..3d5098ad4 100644 --- a/tests/largefile.c +++ b/tests/largefile.c @@ -15,54 +15,56 @@ #include #endif -void usage(char* prog) { - printf("usage: %s filename\n",prog); - exit(1); +void usage(char* prog) +{ + printf("usage: %s filename\n", prog); + exit(1); } -int main(int argc,char* argv[]) { - off_t offsetin=0,offsetout=0; - off_t size=100000000; - size_t rsizein=10,rsizeout=0; - double doff=0; - FILE* f=0; - char str[10]; - int i; +int main(int argc, char* argv[]) +{ + off_t offsetin = 0, offsetout = 0; + off_t size = 100000000; + size_t rsizein = 10, rsizeout = 0; + double doff = 0; + FILE* f = 0; + char str[10]; + int i; - if (argc != 2) usage(argv[0]); + if (argc != 2) usage(argv[0]); - printf("sizeof(off_t)=%d sizeof(long)=%d\n",sizeof(off_t),sizeof(long)); + printf("sizeof(off_t)=%d sizeof(long)=%d\n", sizeof(off_t), sizeof(long)); - f=fopen(argv[1],"r"); - if (!f) { - printf("%s\n",strerror(errno)); - exit(errno); - } + f = fopen(argv[1], "r"); + if (!f) { + printf("%s\n", strerror(errno)); + exit(errno); + } - offsetin=size; - for (i=0;i<100000;i++) { - printf("i=%d ",i); - if (fseeko(f,offsetin,SEEK_SET) ) { - printf("fseeko error\n"); - printf("- %d - %s\n",errno,strerror(errno)); - exit(1); - } - rsizeout=fread(str,1,rsizein,f); - if (rsizeout != rsizein ) { - printf("rsizein=%d rsizeout=%d\n",rsizein,rsizeout); - printf("end of file\n"); - exit(1); - } - offsetout=ftello(f); - doff=(double)offsetout; - printf("%20.0f \n",doff); - if (offsetout != offsetin+rsizeout) { - printf("offset error: offsetout=%jd offsetin=%jd\n",offsetout,offsetin+rsizeout); - exit(1); - } - offsetin=offsetout+size; - } + offsetin = size; + for (i = 0; i < 100000; i++) { + printf("i=%d ", i); + if (fseeko(f, offsetin, SEEK_SET)) { + printf("fseeko error\n"); + printf("- %d - %s\n", errno, strerror(errno)); + exit(1); + } + rsizeout = fread(str, 1, rsizein, f); + if (rsizeout != rsizein) { + printf("rsizein=%d rsizeout=%d\n", rsizein, rsizeout); + printf("end of file\n"); + exit(1); + } + offsetout = ftello(f); + doff = (double)offsetout; + printf("%20.0f \n", doff); + if (offsetout != offsetin + rsizeout) { + printf("offset error: offsetout=%jd offsetin=%jd\n", offsetout, offsetin + rsizeout); + exit(1); + } + offsetin = offsetout + size; + } - fclose(f); - return 0; + fclose(f); + return 0; } diff --git a/tests/png_perf.c b/tests/png_perf.c index 34492e0f7..f39e36c43 100644 --- a/tests/png_perf.c +++ b/tests/png_perf.c @@ -12,236 +12,252 @@ #if GRIB_TIMER -void usage(char* prog) { - printf("usage: %s [-a outfile | -w outfile ] grib_file repetitions bitsPerValue\n",prog); - exit(1); -} - -size_t grib_handle_write(grib_handle* h,char* filename) { - FILE* of=NULL; - const void *buffer; size_t size; - - of = fopen(filename,"wb"); - if(!of) { - perror(filename); - exit(1); - } - GRIB_CHECK(grib_get_message(h,&buffer,&size),0); - if(fwrite(buffer,1,size,of) != size) { - perror(filename); +void usage(char* prog) +{ + printf("usage: %s [-a outfile | -w outfile ] grib_file repetitions bitsPerValue\n", prog); exit(1); - } - fclose(of); - - return size; +} +size_t grib_handle_write(grib_handle* h, char* filename) +{ + FILE* of = NULL; + const void* buffer; + size_t size; + + of = fopen(filename, "wb"); + if (!of) { + perror(filename); + exit(1); + } + GRIB_CHECK(grib_get_message(h, &buffer, &size), 0); + if (fwrite(buffer, 1, size, of) != size) { + perror(filename); + exit(1); + } + fclose(of); + + return size; } -static void print_timer(grib_timer* t,int repeat) { - printf("%s : %g cpu\n",t->name_,t->timer_/repeat); +static void print_timer(grib_timer* t, int repeat) +{ + printf("%s : %g cpu\n", t->name_, t->timer_ / repeat); } -int main(int argc, char* argv[]) { - grib_handle *h=NULL; - grib_context* c=NULL; - FILE* fin=NULL; - FILE* fout=NULL; - char* finname; - char* ofilename; - char defofilename[]="png_perf.out"; - double *values=NULL; - int append=0; - size_t nvalues=0; - int count,e=0; - int repeatpng=1; - int repeatsimple=1; - grib_timer *tes,*tds,*tej,*tdj; - char grid_png[]="grid_png"; - size_t grid_png_l=strlen(grid_png); - char grid_simple[]="grid_simple"; - size_t grid_simple_l=strlen(grid_simple); - char packingType[50]={0,}; - size_t len=50; - char param[50]={0,}; - char gridType[50]={0,}; - char outfilename[255]={0,}; - size_t filesize_png=0; - size_t filesize_simple=0; - double perc=0; - long bitsPerValue=0; - int iarg=1; - char grid[40]={0,}; - char shortName[20]={0,}; - long level; - char levelType[20]={0,}; - - tes=grib_get_timer(0,"encoding simple", 0, 0); - tds=grib_get_timer(0,"decoding simple", 0, 0); - tej=grib_get_timer(0,"encoding png", 0, 0); - tdj=grib_get_timer(0,"decoding png", 0, 0); - - if (argc != 4 && argc != 6 ) usage(argv[0]); - if (!strcmp(argv[iarg],"-w")) { - append=0; - iarg++; - ofilename=argv[iarg]; - iarg++; - } else if (!strcmp(argv[iarg],"-a")) { - append=1; - iarg++; - ofilename=argv[iarg]; - iarg++; - } else { - append=0; - ofilename=defofilename; - } - finname=argv[iarg++]; - repeatsimple=atoi(argv[iarg++]); - bitsPerValue=atoi(argv[iarg++]); - - fin = fopen(finname,"rb"); - if(!fin) {perror(finname);exit(1);} - - if (append) - fout = fopen(ofilename,"ab"); - else - fout = fopen(ofilename,"wb"); - - if(!fout) {perror(ofilename);exit(1);} - - c=grib_context_get_default(); - e=0; - h=grib_handle_new_from_file(c,fin,&e); - fclose(fin); - - GRIB_CHECK(e,0); - - len=50; - grib_get_string(h,"shortName",param,&len); - - len=20; - grib_get_string(h,"levelType",levelType,&len); - - if (!strcmp(levelType,"pl")) { - GRIB_CHECK(grib_get_long(h,"level",&level),0); - sprintf(shortName,"%s%ld",param,level); - } else { - sprintf(shortName,"%s",param); - } - - - grib_set_long(h,"editionNumber",2); - GRIB_CHECK(grib_get_size(h,"values",&nvalues),0); - values=(double*)grib_context_malloc(c,sizeof(double)*nvalues); - if (!values) { printf("%s: memory allocation error\n",argv[0]); exit(1); } - - len=50; - grib_get_string(h,"gridType",gridType,&len); - - len=50; - grib_get_string(h,"packingType",packingType,&len); - - GRIB_CHECK(grib_get_double_array(h,"values",values,&nvalues),0); - grib_set_long(h,"bitsPerValue",bitsPerValue); - GRIB_CHECK(grib_set_double_array(h,"values",values,nvalues),0); - - printf("--------------------------------\n"); - printf("- %s - gridType=%s packingType=%s numberOfValues=%ld bitsPerValue=%ld\n", - param,gridType,packingType,(long)nvalues,bitsPerValue); - - if (!strcmp(packingType,"spectral_complex") || !strcmp(packingType,"spectral_simple")) { - printf("unable to process spectral data\n"); - exit(1); - } - - if (!strcmp(gridType,"reduced_gg") || !strcmp(gridType,"regular_gg")) { - long N; - grib_get_long(h,"N",&N); - printf(" N=%ld\n",N); - sprintf(grid,"%ld",N); - } - if (!strcmp(gridType,"regular_ll")) { - double Di,Dj; - grib_get_double(h,"DiInDegrees",&Di); - grib_get_double(h,"DjInDegrees",&Dj); - printf(" Di=%g Dj=%g\n",Di,Dj); - sprintf(grid,"%g/%g",Di,Dj); - } - - - if (!append) - fprintf(fout, - "shortName gridType numberOfValues bitsPerValue grid sizeSimple sizepng encodepng encodeSimple decodepng decodeSimple\n"); - - /* decode values grid_simple */ - if (strcmp(packingType,grid_simple)) - grib_set_string(h,"packingType",grid_simple,&grid_simple_l); - /* printf("decoding simple\n"); */ - grib_timer_start(tds); - for (count=0;counttimer_/repeatpng,tes->timer_/repeatsimple,tdj->timer_/repeatpng,tds->timer_/repeatsimple); - - return 0; +int main(int argc, char* argv[]) +{ + grib_handle* h = NULL; + grib_context* c = NULL; + FILE* fin = NULL; + FILE* fout = NULL; + char* finname; + char* ofilename; + char defofilename[] = "png_perf.out"; + double* values = NULL; + int append = 0; + size_t nvalues = 0; + int count, e = 0; + int repeatpng = 1; + int repeatsimple = 1; + grib_timer *tes, *tds, *tej, *tdj; + char grid_png[] = "grid_png"; + size_t grid_png_l = strlen(grid_png); + char grid_simple[] = "grid_simple"; + size_t grid_simple_l = strlen(grid_simple); + char packingType[50] = {0,}; + size_t len = 50; + char param[50] = {0,}; + char gridType[50] = {0,}; + char outfilename[255] = {0,}; + size_t filesize_png = 0; + size_t filesize_simple = 0; + double perc = 0; + long bitsPerValue = 0; + int iarg = 1; + char grid[40] = {0,}; + char shortName[20] = {0,}; + long level; + char levelType[20] = {0,}; + + tes = grib_get_timer(0, "encoding simple", 0, 0); + tds = grib_get_timer(0, "decoding simple", 0, 0); + tej = grib_get_timer(0, "encoding png", 0, 0); + tdj = grib_get_timer(0, "decoding png", 0, 0); + + if (argc != 4 && argc != 6) usage(argv[0]); + if (!strcmp(argv[iarg], "-w")) { + append = 0; + iarg++; + ofilename = argv[iarg]; + iarg++; + } + else if (!strcmp(argv[iarg], "-a")) { + append = 1; + iarg++; + ofilename = argv[iarg]; + iarg++; + } + else { + append = 0; + ofilename = defofilename; + } + finname = argv[iarg++]; + repeatsimple = atoi(argv[iarg++]); + bitsPerValue = atoi(argv[iarg++]); + + fin = fopen(finname, "rb"); + if (!fin) { + perror(finname); + exit(1); + } + + if (append) + fout = fopen(ofilename, "ab"); + else + fout = fopen(ofilename, "wb"); + + if (!fout) { + perror(ofilename); + exit(1); + } + + c = grib_context_get_default(); + e = 0; + h = grib_handle_new_from_file(c, fin, &e); + fclose(fin); + + GRIB_CHECK(e, 0); + + len = 50; + grib_get_string(h, "shortName", param, &len); + + len = 20; + grib_get_string(h, "levelType", levelType, &len); + + if (!strcmp(levelType, "pl")) { + GRIB_CHECK(grib_get_long(h, "level", &level), 0); + sprintf(shortName, "%s%ld", param, level); + } + else { + sprintf(shortName, "%s", param); + } + + + grib_set_long(h, "editionNumber", 2); + GRIB_CHECK(grib_get_size(h, "values", &nvalues), 0); + values = (double*)grib_context_malloc(c, sizeof(double) * nvalues); + if (!values) { + printf("%s: memory allocation error\n", argv[0]); + exit(1); + } + + len = 50; + grib_get_string(h, "gridType", gridType, &len); + + len = 50; + grib_get_string(h, "packingType", packingType, &len); + + GRIB_CHECK(grib_get_double_array(h, "values", values, &nvalues), 0); + grib_set_long(h, "bitsPerValue", bitsPerValue); + GRIB_CHECK(grib_set_double_array(h, "values", values, nvalues), 0); + + printf("--------------------------------\n"); + printf("- %s - gridType=%s packingType=%s numberOfValues=%ld bitsPerValue=%ld\n", + param, gridType, packingType, (long)nvalues, bitsPerValue); + + if (!strcmp(packingType, "spectral_complex") || !strcmp(packingType, "spectral_simple")) { + printf("unable to process spectral data\n"); + exit(1); + } + + if (!strcmp(gridType, "reduced_gg") || !strcmp(gridType, "regular_gg")) { + long N; + grib_get_long(h, "N", &N); + printf(" N=%ld\n", N); + sprintf(grid, "%ld", N); + } + if (!strcmp(gridType, "regular_ll")) { + double Di, Dj; + grib_get_double(h, "DiInDegrees", &Di); + grib_get_double(h, "DjInDegrees", &Dj); + printf(" Di=%g Dj=%g\n", Di, Dj); + sprintf(grid, "%g/%g", Di, Dj); + } + + + if (!append) + fprintf(fout, + "shortName gridType numberOfValues bitsPerValue grid sizeSimple sizepng encodepng encodeSimple decodepng decodeSimple\n"); + + /* decode values grid_simple */ + if (strcmp(packingType, grid_simple)) + grib_set_string(h, "packingType", grid_simple, &grid_simple_l); + /* printf("decoding simple\n"); */ + grib_timer_start(tds); + for (count = 0; count < repeatsimple; count++) + GRIB_CHECK(grib_get_double_array(h, "values", values, &nvalues), 0); + grib_timer_stop(tds, 0); + /* printf("%d messages decoded\n\n",count); */ + + *outfilename = '\0'; + sprintf(outfilename, "%s_%s_%ld_simple.grib2", param, gridType, bitsPerValue); + filesize_simple = grib_handle_write(h, outfilename); + printf("file size simple = %ld\n", (long)filesize_simple); + + /* encode values grid_simple*/ + /* printf("encoding simple\n"); */ + grib_timer_start(tes); + for (count = 0; count < repeatsimple; count++) + GRIB_CHECK(grib_set_double_array(h, "values", values, nvalues), 0); + grib_timer_stop(tes, 0); + /* printf("%d messages encoded \n\n",count); */ + + /* decode values grid_png */ + grib_set_string(h, "packingType", grid_png, &grid_png_l); + /* printf("decoding png\n"); */ + grib_timer_start(tdj); + for (count = 0; count < repeatpng; count++) + GRIB_CHECK(grib_get_double_array(h, "values", values, &nvalues), 0); + grib_timer_stop(tdj, 0); + /* printf("%d messages decoded\n\n",count); */ + + *outfilename = '\0'; + sprintf(outfilename, "%s_%s_%ld_png.grib2", param, gridType, bitsPerValue); + filesize_png = grib_handle_write(h, outfilename); + printf("file size png = %ld\n", (long)filesize_png); + + perc = (double)filesize_simple / (double)filesize_png; + + printf("compression ratio = %g \n", perc); + printf("space savings = %g \n", (1.0 - 1.0 / perc) * 100); + + /* encode values grid_png*/ + /* printf("encoding png\n"); */ + grib_timer_start(tej); + for (count = 0; count < repeatpng; count++) + GRIB_CHECK(grib_set_double_array(h, "values", values, nvalues), 0); + grib_timer_stop(tej, 0); + /* printf("%d messages encoded \n\n",count); */ + + grib_handle_delete(h); + grib_context_free(c, values); + + print_timer(tej, repeatpng); + print_timer(tdj, repeatpng); + print_timer(tes, repeatsimple); + print_timer(tds, repeatsimple); + printf("--------------------------------\n\n"); + fprintf(fout, "%s %s %ld %ld %s %ld %ld %g %g %g %g\n", + shortName, gridType, (long)nvalues, bitsPerValue, + grid, (long)filesize_simple, (long)filesize_png, tej->timer_ / repeatpng, tes->timer_ / repeatsimple, tdj->timer_ / repeatpng, tds->timer_ / repeatsimple); + + return 0; } #else -int main(int argc,char* argv[]) { -return 0; +int main(int argc, char* argv[]) +{ + return 0; } #endif - diff --git a/tests/read_any.c b/tests/read_any.c index e1c931f9c..849ae39ba 100644 --- a/tests/read_any.c +++ b/tests/read_any.c @@ -9,70 +9,70 @@ */ #include "grib_api.h" -static void usage (const char *prog) +static void usage(const char* prog) { - printf ("usage: %s infile\n", prog); - exit (1); + printf("usage: %s infile\n", prog); + exit(1); } static unsigned char buffer[50000000]; -int main (int argc, char *argv[]) +int main(int argc, char* argv[]) { - char *filename; - FILE *f; - grib_handle *h = NULL; - grib_context *c; - size_t size = 0; - int ret = 0; - size_t bufsize = sizeof (buffer); + char* filename; + FILE* f; + grib_handle* h = NULL; + grib_context* c; + size_t size = 0; + int ret = 0; + size_t bufsize = sizeof(buffer); long count, step, edition, totalLength; char gridType[50], levelType[50], level[50], shortName[50]; - size_t gridTypelen = sizeof (gridType); - size_t levelTypelen = sizeof (levelType); - size_t levellen = sizeof (level); - size_t shortNamelen = sizeof (shortName); + size_t gridTypelen = sizeof(gridType); + size_t levelTypelen = sizeof(levelType); + size_t levellen = sizeof(level); + size_t shortNamelen = sizeof(shortName); size_t len; if (argc != 2) - usage (argv[0]); + usage(argv[0]); filename = argv[1]; - f = fopen (filename, "rb"); + f = fopen(filename, "rb"); if (!f) { - perror (filename); - exit (1); + perror(filename); + exit(1); } - c = grib_context_get_default (); + c = grib_context_get_default(); - size = bufsize; + size = bufsize; count = 1; - while ((ret = grib_read_any_from_file (c, f, buffer, &size)) == GRIB_SUCCESS) { + while ((ret = grib_read_any_from_file(c, f, buffer, &size)) == GRIB_SUCCESS) { if ((1)) { - h = grib_handle_new_from_message_copy (c, buffer, size); + h = grib_handle_new_from_message_copy(c, buffer, size); if (!h) { - printf ("unable to new from message\n"); - exit (1); + printf("unable to new from message\n"); + exit(1); } else { - grib_get_long (h, "edition", &edition); - grib_get_long (h, "step", &step); - grib_get_long (h, "totalLength", &totalLength); + grib_get_long(h, "edition", &edition); + grib_get_long(h, "step", &step); + grib_get_long(h, "totalLength", &totalLength); len = gridTypelen; - grib_get_string (h, "gridType", gridType, &len); + grib_get_string(h, "gridType", gridType, &len); len = levelTypelen; - GRIB_CHECK (grib_get_string (h, "levelType", levelType, &len), 0); + GRIB_CHECK(grib_get_string(h, "levelType", levelType, &len), 0); len = levellen; - grib_get_string (h, "level", level, &len); + grib_get_string(h, "level", level, &len); len = shortNamelen; - grib_get_string (h, "shortName", shortName, &len); - printf ("- %3ld -\t ed=%ld\t size=%8ld totalLength=%8ld \t %s\t %s\t %s\t level=%s\t step=%ld\n", - count, edition, (long) size, totalLength, shortName, gridType, levelType, level, step); - grib_handle_delete (h); + grib_get_string(h, "shortName", shortName, &len); + printf("- %3ld -\t ed=%ld\t size=%8ld totalLength=%8ld \t %s\t %s\t %s\t level=%s\t step=%ld\n", + count, edition, (long)size, totalLength, shortName, gridType, levelType, level, step); + grib_handle_delete(h); } } else { - printf ("MESSAGE #%ld\n", count); + printf("MESSAGE #%ld\n", count); } size = bufsize; count++; diff --git a/tests/read_index.c b/tests/read_index.c index 41f3343b1..6a6fb9fd1 100644 --- a/tests/read_index.c +++ b/tests/read_index.c @@ -10,119 +10,129 @@ #include "grib_api.h" -static void usage(char* prog) { - printf("usage: %s infile\n",prog); - exit(1); +static void usage(char* prog) +{ + printf("usage: %s infile\n", prog); + exit(1); } -int main(int argc,char* argv[]) +int main(int argc, char* argv[]) { - grib_index* index=NULL; - grib_handle* h=NULL; - long *step,*level,*number; - char** shortName=NULL; - int i,j,k,l; - size_t stepSize,levelSize,shortNameSize,numberSize; - long ostep,olevel,onumber; - char oshortName[200]; - size_t lenshortName=200; - int ret=0,count=0; - - if (argc != 2) usage(argv[0]); - - printf("indexing...\n"); - - index=grib_index_read(0,"out.gribidx",&ret); - GRIB_CHECK(ret,0); - - printf("end indexing...\n"); - - /* get the number of distinct values of "step" in the index */ - GRIB_CHECK(grib_index_get_size(index,"step",&stepSize),0); - step=(long*)malloc(sizeof(long)*stepSize); - if (!step) exit(1); - /* get the list of distinct steps from the index */ - /* the list is in ascending order */ - GRIB_CHECK(grib_index_get_long(index,"step",step,&stepSize),0); - printf("stepSize=%ld\n",(long)stepSize); - for (i=0;i 1) - in = fopen(argv[1],"rb"); - else{ - printf("usage : gribvals filename [format]\n"); - exit(1); - } - if(!in){ - printf("error file not found"); - return 1; - } - - if(argc > 2) - strcpy(format,argv[2]); - else - strcpy(format,"%g "); - - - h = grib_handle_new_from_file(0,in); - while(h){ - - if((err = grib_get_long(h,"ni",&ni)) != GRIB_SUCCESS) - printf("error %d : %s",err,grib_get_error_message(err)); - - if((err = grib_get_size(h,"values",&values_len)) != GRIB_SUCCESS){ - printf("error %d : %s",err,grib_get_error_message(err)); - return 1; - } - - values = malloc(values_len*sizeof(double)); - - if((err = grib_get_double_array(h,"values",values,&values_len)) != GRIB_SUCCESS) - printf("error %d : %s",err,grib_get_error_message(err)); - - for(i = 0; i < values_len; i++){ - if(i!=0 && (i%ni == 0))printf("\n"); - printf(format,values[i]); +int main(int argc, char** argv) +{ + int err = 0; + double* values = NULL; + char format[1024]; + size_t values_len = 0; + + size_t i = 0; + + long ni; + double a; + long d; + FILE* in = NULL; + + grib_handle* h = NULL; + + + if (argc > 1) + in = fopen(argv[1], "rb"); + else { + printf("usage : gribvals filename [format]\n"); + exit(1); + } + if (!in) { + printf("error file not found"); + return 1; } - printf("\n"); - fprintf(stderr,"%d values\n",i); - free(values); - grib_handle_delete(h); + if (argc > 2) + strcpy(format, argv[2]); + else + strcpy(format, "%g "); + - h = grib_handle_new_from_file(0,in); + h = grib_handle_new_from_file(0, in); + while (h) { + if ((err = grib_get_long(h, "ni", &ni)) != GRIB_SUCCESS) + printf("error %d : %s", err, grib_get_error_message(err)); - if(h) - printf("************************************************************\n"); - - } - fclose(in); - return 0; + if ((err = grib_get_size(h, "values", &values_len)) != GRIB_SUCCESS) { + printf("error %d : %s", err, grib_get_error_message(err)); + return 1; + } + + values = malloc(values_len * sizeof(double)); + + if ((err = grib_get_double_array(h, "values", values, &values_len)) != GRIB_SUCCESS) + printf("error %d : %s", err, grib_get_error_message(err)); + + for (i = 0; i < values_len; i++) { + if (i != 0 && (i % ni == 0)) printf("\n"); + printf(format, values[i]); + } + printf("\n"); + fprintf(stderr, "%d values\n", i); + free(values); + + grib_handle_delete(h); + + h = grib_handle_new_from_file(0, in); + + if (h) + printf("************************************************************\n"); + } + fclose(in); + return 0; } diff --git a/tools/grib_filter.h b/tools/grib_filter.h index d183eecb9..b2b3e6830 100644 --- a/tools/grib_filter.h +++ b/tools/grib_filter.h @@ -18,53 +18,54 @@ See http://www.delorie.com/gnu/docs/automake/automake_48.html */ -#define yymaxdepth grib_filter_maxdepth -#define yyparse grib_filter_parse -#define yylex grib_filter_lex -#define yyerror grib_filter_error -#define yylval grib_filter_lval -#define yychar grib_filter_char -#define yydebug grib_filter_debug -#define yypact grib_filter_pact -#define yyr1 grib_filter_r1 -#define yyr2 grib_filter_r2 -#define yydef grib_filter_def -#define yychk grib_filter_chk -#define yypgo grib_filter_pgo -#define yyact grib_filter_act -#define yyexca grib_filter_exca +#define yymaxdepth grib_filter_maxdepth +#define yyparse grib_filter_parse +#define yylex grib_filter_lex +#define yyerror grib_filter_error +#define yylval grib_filter_lval +#define yychar grib_filter_char +#define yydebug grib_filter_debug +#define yypact grib_filter_pact +#define yyr1 grib_filter_r1 +#define yyr2 grib_filter_r2 +#define yydef grib_filter_def +#define yychk grib_filter_chk +#define yypgo grib_filter_pgo +#define yyact grib_filter_act +#define yyexca grib_filter_exca #define yyerrflag grib_filter_errflag -#define yynerrs grib_filter_nerrs -#define yyps grib_filter_ps -#define yypv grib_filter_pv -#define yys grib_filter_s -#define yy_yys grib_filter_yys -#define yystate grib_filter_state -#define yytmp grib_filter_tmp -#define yyv grib_filter_v -#define yy_yyv grib_filter_yyv -#define yyval grib_filter_val -#define yylloc grib_filter_lloc -#define yyreds grib_filter_reds -#define yytoks grib_filter_toks -#define yylhs grib_filter_yylhs -#define yylen grib_filter_yylen +#define yynerrs grib_filter_nerrs +#define yyps grib_filter_ps +#define yypv grib_filter_pv +#define yys grib_filter_s +#define yy_yys grib_filter_yys +#define yystate grib_filter_state +#define yytmp grib_filter_tmp +#define yyv grib_filter_v +#define yy_yyv grib_filter_yyv +#define yyval grib_filter_val +#define yylloc grib_filter_lloc +#define yyreds grib_filter_reds +#define yytoks grib_filter_toks +#define yylhs grib_filter_yylhs +#define yylen grib_filter_yylen #define yydefred grib_filter_yydefred -#define yydgoto grib_filter_yydgoto +#define yydgoto grib_filter_yydgoto #define yysindex grib_filter_yysindex #define yyrindex grib_filter_yyrindex #define yygindex grib_filter_yygindex -#define yytable grib_filter_yytable -#define yycheck grib_filter_yycheck -#define yyname grib_filter_yyname -#define yyrule grib_filter_yyrule +#define yytable grib_filter_yytable +#define yycheck grib_filter_yycheck +#define yyname grib_filter_yyname +#define yyrule grib_filter_yyrule #define MAX_KEYS 40 #define MAX_RULES 40 -#define MAX_SET 40 +#define MAX_SET 40 typedef struct key_value key_value; -struct key_value { - char* key; - grib_runtime_type value; +struct key_value +{ + char* key; + grib_runtime_type value; } diff --git a/tools/grib_tools.h b/tools/grib_tools.h index 8ec586e7e..b49e86f6b 100644 --- a/tools/grib_tools.h +++ b/tools/grib_tools.h @@ -9,24 +9,24 @@ */ #ifdef __gnu_hurd__ - #define _FILE_OFFSET_BITS 64 /* 64-bit offsets off_t not the default on Hurd/i386 */ +#define _FILE_OFFSET_BITS 64 /* 64-bit offsets off_t not the default on Hurd/i386 */ #endif #include "grib_api_internal.h" #include #ifndef ECCODES_ON_WINDOWS -# include +#include #endif #ifndef GRIB_TOOLS_H #define GRIB_TOOLS_H #ifndef S_IFMT -#define S_IFMT 0170000 /* type of file */ +#define S_IFMT 0170000 /* type of file */ #endif #ifndef S_IFLNK -#define S_IFLNK 0120000 /* symbolic link */ +#define S_IFLNK 0120000 /* symbolic link */ #endif #ifndef S_ISLNK @@ -34,21 +34,22 @@ #endif #define MAX_KEYS 1000 -#define MAX_STRING_LEN 512 -#define MAX_FAILED 1024 +#define MAX_STRING_LEN 512 +#define MAX_FAILED 1024 #define MAX_CONSTRAINT_VALUES 500 -#define MODE_GRIB 0 -#define MODE_GTS 1 -#define MODE_BUFR 2 -#define MODE_METAR 3 -#define MODE_TAF 5 -#define MODE_ANY 6 - -typedef union grib_typed_value { - long* long_value; - double* double_value; - const char* string_value; +#define MODE_GRIB 0 +#define MODE_GTS 1 +#define MODE_BUFR 2 +#define MODE_METAR 3 +#define MODE_TAF 5 +#define MODE_ANY 6 + +typedef union grib_typed_value +{ + long* long_value; + double* double_value; + const char* string_value; } grib_typed_value; /* @@ -62,107 +63,112 @@ typedef struct grib_constraints { } grib_constraints; */ -typedef struct grib_options_help { - const char* id; - const char* args; - const char* help; +typedef struct grib_options_help +{ + const char* id; + const char* args; + const char* help; } grib_options_help; -typedef struct grib_option { - char* id; - char* args; - char* help; - int on; - int command_line; - char* value; +typedef struct grib_option +{ + char* id; + char* args; + char* help; + int on; + int command_line; + char* value; } grib_option; typedef struct grib_failed grib_failed; -struct grib_failed { - int count; - int error; - grib_failed* next; +struct grib_failed +{ + int count; + int error; + grib_failed* next; }; typedef struct grib_tools_file grib_tools_file; -struct grib_tools_file { - FILE* file; - char* name; - int handle_count; - int filter_handle_count; - grib_failed* failed; - grib_tools_file* next; +struct grib_tools_file +{ + FILE* file; + char* name; + int handle_count; + int filter_handle_count; + grib_failed* failed; + grib_tools_file* next; }; -typedef struct grib_runtime_options { - int verbose; - int fail; - int skip; - int default_print_width; - int print_header; - char* name_space; - int print_number; - int print_statistics; - grib_values requested_print_keys[MAX_KEYS]; - int requested_print_keys_count; - grib_values print_keys[MAX_KEYS]; - int print_keys_count; - int strict; - int multi_support; - int set_values_count; - grib_values set_values[MAX_KEYS]; - grib_values constraints[MAX_KEYS]; - int constraints_count; - grib_values compare[MAX_KEYS]; - int compare_count; - int handle_count; - int filter_handle_count; - int file_count; - grib_tools_file* infile_extra; - grib_tools_file* current_infile; - grib_tools_file* infile; - grib_tools_file* outfile; - grib_action* action; - grib_rule* rules; - int dump_flags; - char* dump_mode; - int repack; - int error; - int gts; - char* orderby; - char* latlon; - double lats[4]; - double lons[4]; - double values[4]; - double distances[4]; - int indexes[4]; - int latlon_mode; - char* latlon_mask; - int latlon_idx; - double mask_values[4]; - int index; - int index_on; - double constant; - char* dump_filename; - grib_fieldset* idx; - int random; - char* format; - int onlyfiles; - int tolerance_count; - int through_index; - grib_index* index1; - grib_index* index2; - grib_context* context; - int stop; - int mode; - int headers_only; - int skip_all; - grib_values tolerance[MAX_KEYS]; - off_t infile_offset; - int json_output; +typedef struct grib_runtime_options +{ + int verbose; + int fail; + int skip; + int default_print_width; + int print_header; + char* name_space; + int print_number; + int print_statistics; + grib_values requested_print_keys[MAX_KEYS]; + int requested_print_keys_count; + grib_values print_keys[MAX_KEYS]; + int print_keys_count; + int strict; + int multi_support; + int set_values_count; + grib_values set_values[MAX_KEYS]; + grib_values constraints[MAX_KEYS]; + int constraints_count; + grib_values compare[MAX_KEYS]; + int compare_count; + int handle_count; + int filter_handle_count; + int file_count; + grib_tools_file* infile_extra; + grib_tools_file* current_infile; + grib_tools_file* infile; + grib_tools_file* outfile; + grib_action* action; + grib_rule* rules; + int dump_flags; + char* dump_mode; + int repack; + int error; + int gts; + char* orderby; + char* latlon; + double lats[4]; + double lons[4]; + double values[4]; + double distances[4]; + int indexes[4]; + int latlon_mode; + char* latlon_mask; + int latlon_idx; + double mask_values[4]; + int index; + int index_on; + double constant; + char* dump_filename; + grib_fieldset* idx; + int random; + char* format; + int onlyfiles; + int tolerance_count; + int through_index; + grib_index* index1; + grib_index* index2; + grib_context* context; + int stop; + int mode; + int headers_only; + int skip_all; + grib_values tolerance[MAX_KEYS]; + off_t infile_offset; + int json_output; } grib_runtime_options; extern grib_option grib_options[]; @@ -175,9 +181,9 @@ extern FILE* dump_file; char* grib_options_get_option(const char* id); int grib_options_on(const char* id); -int grib_options_get(int argc,char** argv); -int grib_options_get_values(int argc,char** argv,int values_required,int default_type, grib_values values[],int* n,int* optind); -int grib_tool(int argc, char **argv); +int grib_options_get(int argc, char** argv); +int grib_options_get_values(int argc, char** argv, int values_required, int default_type, grib_values values[], int* n, int* optind); +int grib_tool(int argc, char** argv); char* grib_options_get_help(char* id); char* grib_options_get_args(char* id); int grib_options_command_line(const char* id); @@ -185,21 +191,20 @@ void usage(void); void usage_doxygen(void); int grib_tool_before_getopt(grib_runtime_options* options); int grib_tool_init(grib_runtime_options* options); -int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file); +int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* file); int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h); int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h); -void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h); +void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h); int grib_tool_finalise_action(grib_runtime_options* options); -void grib_skip_check(grib_runtime_options* options,grib_handle* h); -void grib_print_key_values(grib_runtime_options* options,grib_handle* h); -void grib_print_file_statistics(grib_runtime_options* options,grib_tools_file* file); +void grib_skip_check(grib_runtime_options* options, grib_handle* h); +void grib_print_key_values(grib_runtime_options* options, grib_handle* h); +void grib_print_file_statistics(grib_runtime_options* options, grib_tools_file* file); void grib_print_full_statistics(grib_runtime_options* options); -int grib_get_runtime_options(int argc,char** argv,grib_runtime_options* options); -int grib_process_runtime_options(grib_context* c,int argc,char** argv,grib_runtime_options* options); +int grib_get_runtime_options(int argc, char** argv, grib_runtime_options* options); +int grib_process_runtime_options(grib_context* c, int argc, char** argv, grib_runtime_options* options); void grib_tools_write_message(grib_runtime_options* options, grib_handle* h); -int grib_tool_new_filename_action(grib_runtime_options* options,const char* file); -int grib_no_handle_action(grib_runtime_options* options,int err); +int grib_tool_new_filename_action(grib_runtime_options* options, const char* file); +int grib_no_handle_action(grib_runtime_options* options, int err); int exit_if_input_is_directory(const char* tool_name, const char* filename); #endif - diff --git a/tools/load.h b/tools/load.h index f241eb343..488b1669f 100644 --- a/tools/load.h +++ b/tools/load.h @@ -8,16 +8,16 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -extern char *prog; +extern char* prog; -int load_file(const char*,const char*); -int dump_file(const char*,const char*); +int load_file(const char*, const char*); +int dump_file(const char*, const char*); void load_finish(); -void load_long(const char* name,long value) ; +void load_long(const char* name, long value); void load_missing(const char* name); -void load_string(const char* name,const char* value); -void load_double(const char* name,double value); +void load_string(const char* name, const char* value); +void load_double(const char* name, double value); void load_start_array(); void load_end_array(const char* name); void load_double_value(double value); diff --git a/tools/wingetopt.h b/tools/wingetopt.h index f7f7c2c03..ef075bbc0 100644 --- a/tools/wingetopt.h +++ b/tools/wingetopt.h @@ -15,9 +15,8 @@ #ifdef ECCODES_ON_WINDOWS extern int optind, opterr; -extern char *optarg; -int getopt(int argc, char *argv[], const char *optstring); +extern char* optarg; +int getopt(int argc, char* argv[], const char* optstring); #endif #endif - From d628be23b7aca4f55482799edb81469e98f18833 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 6 Feb 2020 11:39:46 +0000 Subject: [PATCH 54/82] Latest updates from develop (10) --- tests/lsan-leap42.supp | 1 + 1 file changed, 1 insertion(+) create mode 100644 tests/lsan-leap42.supp diff --git a/tests/lsan-leap42.supp b/tests/lsan-leap42.supp new file mode 100644 index 000000000..fd5c809e5 --- /dev/null +++ b/tests/lsan-leap42.supp @@ -0,0 +1 @@ +leak:tools/grib_filter.c From 9fecfd33ceea59d2d0aa6c5cfcf45cee0c08b434 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 6 Feb 2020 11:39:59 +0000 Subject: [PATCH 55/82] Latest updates from develop (10) --- definitions/param_limits.def | 36 ----------------------------- examples/C/grib_copy_message.c | 1 - examples/C/grib_nearest_multiple.c | 10 ++++++++ examples/C/grib_nearest_multiple.sh | 1 + examples/C/grib_precision.c | 2 ++ tests/grib_bitsPerValue.sh | 15 +++++++++++- tests/grib_data_quality_checks.sh | 13 +++++++---- tests/grib_nearest_test.c | 5 ++++ 8 files changed, 40 insertions(+), 43 deletions(-) diff --git a/definitions/param_limits.def b/definitions/param_limits.def index cd1c0b127..3b7199a38 100644 --- a/definitions/param_limits.def +++ b/definitions/param_limits.def @@ -11,18 +11,13 @@ concept param_value_min(default_min_val) { 25 = { pid=168; } 0 = { pid=260242; } 160 = { pid=167; } - -0.1 = { pid=260428; } - -0.1 = { pid=260423; } - -1e+09 = { pid=260427; } 0 = { pid=260509; } 5 = { pid=151175; } 0 = { pid=260257; } 0 = { pid=59; } -60000 = { pid=228001; } - -0.05 = { pid=228143; } 0 = { pid=151163; } -3.5 = { pid=151131; } - -100000 = { pid=180; } -10 = { pid=260259; } -13000 = { pid=129; } -1300 = { pid=156; } @@ -40,7 +35,6 @@ concept param_value_min(default_min_val) { 150 = { pid=122; } 0 = { pid=140214; } -3.5 = { pid=151132; } - -100000 = { pid=181; } 0 = { pid=151225; } -1300 = { pid=228002; } 0 = { pid=140231; } @@ -60,7 +54,6 @@ concept param_value_min(default_min_val) { 10 = { pid=33; } 0 = { pid=3066; } -1e-10 = { pid=228141; } - -1 = { pid=228144; } 0.005 = { pid=260367; } -1000 = { pid=260364; } 0 = { pid=228039; } @@ -75,26 +68,15 @@ concept param_value_min(default_min_val) { 0 = { pid=246; } -0.1 = { pid=133; } 0 = { pid=189; } - -1e+08 = { pid=147; } - -1e+07 = { pid=176; } - -1e+08 = { pid=177; } 43000 = { pid=134; } 0 = { pid=173; } - -0.001 = { pid=174008; } - -1e+08 = { pid=146; } - -10 = { pid=169; } 140 = { pid=130; } - -0.1 = { pid=260264; } - -1e+08 = { pid=179; } - -1e-06 = { pid=228164; } -3 = { pid=260057; } -50 = { pid=136; } - -0.05 = { pid=228228; } -250 = { pid=131; } -250 = { pid=132; } -30 = { pid=135; } 0 = { pid=260199; } - -0.001 = { pid=228205; } 0 = { pid=3031; } 0 = { pid=10; } } : double_type, hidden; @@ -109,18 +91,13 @@ concept param_value_max(default_max_val) { 350 = { pid=168; } 160 = { pid=260242; } 370 = { pid=167; } - 1e+09 = { pid=260428; } - 1e+09 = { pid=260423; } - 0.1 = { pid=260427; } 100 = { pid=260509; } 50 = { pid=151175; } 100 = { pid=260257; } 40000 = { pid=59; } 5 = { pid=228001; } - 130 = { pid=228143; } 1500 = { pid=151163; } 3.5 = { pid=151131; } - 100000 = { pid=180; } 5 = { pid=260259; } 350000 = { pid=129; } 35000 = { pid=156; } @@ -138,7 +115,6 @@ concept param_value_max(default_max_val) { 330 = { pid=122; } 35 = { pid=140214; } 3.5 = { pid=151132; } - 100000 = { pid=181; } 4000 = { pid=151225; } 8888 = { pid=228002; } 50 = { pid=140231; } @@ -158,7 +134,6 @@ concept param_value_max(default_max_val) { 1000 = { pid=33; } 5 = { pid=3066; } 15000 = { pid=228141; } - 50 = { pid=228144; } 100 = { pid=260367; } 1000 = { pid=260364; } 2000 = { pid=228039; } @@ -173,26 +148,15 @@ concept param_value_max(default_max_val) { 1e+06 = { pid=246; } 0.1 = { pid=133; } 3600 = { pid=189; } - 1e+08 = { pid=147; } - 1e+07 = { pid=176; } - 1e+06 = { pid=177; } 115000 = { pid=134; } 10 = { pid=173; } - 100 = { pid=174008; } - 1e+08 = { pid=146; } - 1e+09 = { pid=169; } 400 = { pid=130; } - 1e+09 = { pid=260264; } - -1000 = { pid=179; } - 101 = { pid=228164; } 150 = { pid=260057; } 220 = { pid=136; } - 130 = { pid=228228; } 250 = { pid=131; } 250 = { pid=132; } 30 = { pid=135; } 1 = { pid=260199; } - 30 = { pid=228205; } 360.1 = { pid=3031; } 300 = { pid=10; } } : double_type, hidden; diff --git a/examples/C/grib_copy_message.c b/examples/C/grib_copy_message.c index 6aabe31aa..461bf4ea6 100644 --- a/examples/C/grib_copy_message.c +++ b/examples/C/grib_copy_message.c @@ -48,7 +48,6 @@ int main(int argc, char* argv[]) codes_handle* new_handle = NULL; CODES_CHECK(codes_get_message_size(source_handle, &totalLength), 0); - buffer = (unsigned char*)malloc(totalLength * sizeof(char)); CODES_CHECK(codes_get_message(source_handle, &buffer, &size), 0); assert(size == totalLength); diff --git a/examples/C/grib_nearest_multiple.c b/examples/C/grib_nearest_multiple.c index c96cdcf69..c3bb2d1d8 100644 --- a/examples/C/grib_nearest_multiple.c +++ b/examples/C/grib_nearest_multiple.c @@ -172,5 +172,15 @@ int main(int argc, char** argv) fclose(fin); } + free(id); + free(vlat); + free(vlon); + free(outlats); + free(outlons); + free(values); + free(lsm_values); + free(distances); + free(indexes); + return ret; } diff --git a/examples/C/grib_nearest_multiple.sh b/examples/C/grib_nearest_multiple.sh index 73e8c7eab..baef18574 100755 --- a/examples/C/grib_nearest_multiple.sh +++ b/examples/C/grib_nearest_multiple.sh @@ -24,6 +24,7 @@ input_pts=$temp1 input_lsm=${data_dir}/reduced_gaussian_lsm.grib1 input_grb=${data_dir}/reduced_gaussian_pressure_level.grib1 +cat $input_pts ${examples_dir}/c_grib_nearest_multiple $input_pts $input_lsm $input_grb > $temp2 cat > $tempRef <$tempErr stat1=$? diff --git a/tests/grib_nearest_test.c b/tests/grib_nearest_test.c index 65372f448..f5b1df4fb 100644 --- a/tests/grib_nearest_test.c +++ b/tests/grib_nearest_test.c @@ -110,5 +110,10 @@ int main(int argc, char** argv) if (set) codes_fieldset_delete(set); + for (i = 0; i < nfiles; ++i) { + free(filenames[i]); + } + free(filenames); + return 0; } From 6b2bc13ee3c800a4e5c0ac63bc46a03052897858 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 6 Feb 2020 16:05:12 +0000 Subject: [PATCH 56/82] Latest updates from develop (11) --- src/grib_util.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/grib_util.c b/src/grib_util.c index cc6be90ad..50b5d7ff5 100644 --- a/src/grib_util.c +++ b/src/grib_util.c @@ -2179,12 +2179,12 @@ int grib_is_earth_oblate(grib_handle* h) int grib_util_grib_data_quality_check(grib_handle* h, double min_val, double max_val) { - int err = 0; + int err = 0; double min_field_value_allowed = 0, max_field_value_allowed = 0; - long paramId = 0; - double dmin_allowed = 0, dmax_allowed = 0; - grib_context* ctx = h->context; - int is_error = 1; + long paramId = 0; + grib_context* ctx = h->context; + int is_error = 1; + char description[1024] = {0,}; /* * If grib_data_quality_checks == 1, limits failure results in an error * If grib_data_quality_checks == 2, limits failure results in a warning @@ -2204,35 +2204,37 @@ int grib_util_grib_data_quality_check(grib_handle* h, double min_val, double max return err; } - dmin_allowed = min_field_value_allowed; - dmax_allowed = max_field_value_allowed; + if (ctx->debug) { + if (get_concept_condition_string(h, "param_value_max", NULL, description) == GRIB_SUCCESS) { + printf("ECCODES DEBUG grib_data_quality_check: Checking condition '%s' (min=%g, max=%g)\n", + description, min_field_value_allowed, max_field_value_allowed); + } + } - if (min_val < dmin_allowed) { - char description[1024] = {0,}; + if (min_val < min_field_value_allowed) { if (get_concept_condition_string(h, "param_value_min", NULL, description) == GRIB_SUCCESS) { fprintf(stderr, "ECCODES %s : (%s): minimum (%g) is less than the allowable limit (%g)\n", - (is_error ? "ERROR" : "WARNING"), description, min_val, dmin_allowed); + (is_error ? "ERROR" : "WARNING"), description, min_val, min_field_value_allowed); } else { if (grib_get_long(h, "paramId", ¶mId) == GRIB_SUCCESS) { fprintf(stderr, "ECCODES %s : (paramId=%ld): minimum (%g) is less than the default allowable limit (%g)\n", - (is_error ? "ERROR" : "WARNING"), paramId, min_val, dmin_allowed); + (is_error ? "ERROR" : "WARNING"), paramId, min_val, min_field_value_allowed); } } if (is_error) { return GRIB_OUT_OF_RANGE; /* Failure */ } } - if (max_val > dmax_allowed) { - char description[1024] = {0,}; + if (max_val > max_field_value_allowed) { if (get_concept_condition_string(h, "param_value_max", NULL, description) == GRIB_SUCCESS) { fprintf(stderr, "ECCODES %s : (%s): maximum (%g) is more than the allowable limit (%g)\n", - (is_error ? "ERROR" : "WARNING"), description, max_val, dmax_allowed); + (is_error ? "ERROR" : "WARNING"), description, max_val, max_field_value_allowed); } else { if (grib_get_long(h, "paramId", ¶mId) == GRIB_SUCCESS) { fprintf(stderr, "ECCODES %s : (paramId=%ld): maximum (%g) is more than the default allowable limit (%g)\n", - (is_error ? "ERROR" : "WARNING"), paramId, max_val, dmax_allowed); + (is_error ? "ERROR" : "WARNING"), paramId, max_val, max_field_value_allowed); } } if (is_error) { From fa7669be498bbfca63d2126ccdb3437fe9dde3c8 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 7 Feb 2020 17:21:52 +0000 Subject: [PATCH 57/82] Latest updates from develop (12) --- definitions/grib1/section.1.def | 2 +- definitions/grib2/cfVarName.def | 66 +++++ definitions/grib2/name.def | 66 +++++ definitions/grib2/paramId.def | 66 +++++ definitions/grib2/parameters.def | 2 +- definitions/grib2/shortName.def | 66 +++++ definitions/grib2/units.def | 66 +++++ definitions/param_limits.def | 308 ++++++++++----------- src/grib_accessor_class_concept.c | 2 +- src/grib_context.c | 46 +-- src/grib_expression_class_accessor.c | 3 +- src/grib_expression_class_string_compare.c | 8 +- src/grib_fieldset.c | 1 + src/grib_handle.c | 16 +- tests/grib_data_quality_checks.sh | 3 + tests/lsan-leap42.supp | 3 + tools/codes_info.c | 4 +- 17 files changed, 541 insertions(+), 187 deletions(-) diff --git a/definitions/grib1/section.1.def b/definitions/grib1/section.1.def index 30f8fa627..5e116c985 100644 --- a/definitions/grib1/section.1.def +++ b/definitions/grib1/section.1.def @@ -149,7 +149,7 @@ if(table2Version >= 128) { concept paramIdECMF (defaultParameter,"paramId.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy; concept paramId (paramIdECMF,"paramId.def",conceptsMasterDir,conceptsLocalDirAll): long_type,dump; -transient pid = paramId : hidden; +# transient pid = paramId : hidden; concept cfNameECMF(defaultName,"cfName.def",conceptsMasterDir,conceptsLocalDirECMF) : dump,no_copy,read_only; concept cfName(cfNameECMF,"cfName.def",conceptsMasterDir,conceptsLocalDirAll) : dump,no_copy,read_only; diff --git a/definitions/grib2/cfVarName.def b/definitions/grib2/cfVarName.def index 97814a304..d76027b4f 100644 --- a/definitions/grib2/cfVarName.def +++ b/definitions/grib2/cfVarName.def @@ -1421,6 +1421,72 @@ parameterCategory = 0 ; parameterNumber = 1 ; } +#Malaria cases +'mal_cases' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 0 ; + } +#Malaria circumsporozoite protein rate +'mal_prot_rate' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 1 ; + } +#Plasmodium falciparum entomological inoculation rate +'mal_innoc_rate' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 2 ; + } +#Human bite rate by anopheles vectors +'mal_hbite_rate' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 3 ; + } +#Malaria immunity +'mal_immun' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 4 ; + } +#Falciparum parasite rates +'mal_para_rate' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 5 ; + } +#Detectable falciparum parasite ratio (after day 10) +'mal_para_ratio' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 6 ; + } +#Anopheles vector to host ratio +'mal_host_ratio' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 7 ; + } +#Anopheles vector number +'mal_vect_dens' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 8 ; + } +#Fraction of malarial vector reproductive habitat +'mal_hab_frac' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 9 ; + } +#Population density +'pop_dens' = { + discipline = 20 ; + parameterCategory = 2 ; + parameterNumber = 0 ; + } #Virtual temperature 'vtmp' = { discipline = 0 ; diff --git a/definitions/grib2/name.def b/definitions/grib2/name.def index 92b1e36f6..acf965192 100644 --- a/definitions/grib2/name.def +++ b/definitions/grib2/name.def @@ -1421,6 +1421,72 @@ parameterCategory = 0 ; parameterNumber = 1 ; } +#Malaria cases +'Malaria cases' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 0 ; + } +#Malaria circumsporozoite protein rate +'Malaria circumsporozoite protein rate' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 1 ; + } +#Plasmodium falciparum entomological inoculation rate +'Plasmodium falciparum entomological inoculation rate' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 2 ; + } +#Human bite rate by anopheles vectors +'Human bite rate by anopheles vectors' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 3 ; + } +#Malaria immunity +'Malaria immunity' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 4 ; + } +#Falciparum parasite rates +'Falciparum parasite rates' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 5 ; + } +#Detectable falciparum parasite ratio (after day 10) +'Detectable falciparum parasite ratio (after day 10)' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 6 ; + } +#Anopheles vector to host ratio +'Anopheles vector to host ratio' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 7 ; + } +#Anopheles vector number +'Anopheles vector number' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 8 ; + } +#Fraction of malarial vector reproductive habitat +'Fraction of malarial vector reproductive habitat' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 9 ; + } +#Population density +'Population density' = { + discipline = 20 ; + parameterCategory = 2 ; + parameterNumber = 0 ; + } #Virtual temperature 'Virtual temperature' = { discipline = 0 ; diff --git a/definitions/grib2/paramId.def b/definitions/grib2/paramId.def index 46cb35b69..923072e1a 100644 --- a/definitions/grib2/paramId.def +++ b/definitions/grib2/paramId.def @@ -1421,6 +1421,72 @@ parameterCategory = 0 ; parameterNumber = 1 ; } +#Malaria cases +'261003' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 0 ; + } +#Malaria circumsporozoite protein rate +'261004' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 1 ; + } +#Plasmodium falciparum entomological inoculation rate +'261005' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 2 ; + } +#Human bite rate by anopheles vectors +'261006' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 3 ; + } +#Malaria immunity +'261007' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 4 ; + } +#Falciparum parasite rates +'261008' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 5 ; + } +#Detectable falciparum parasite ratio (after day 10) +'261009' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 6 ; + } +#Anopheles vector to host ratio +'261010' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 7 ; + } +#Anopheles vector number +'261011' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 8 ; + } +#Fraction of malarial vector reproductive habitat +'261012' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 9 ; + } +#Population density +'261013' = { + discipline = 20 ; + parameterCategory = 2 ; + parameterNumber = 0 ; + } #Virtual temperature '300012' = { discipline = 0 ; diff --git a/definitions/grib2/parameters.def b/definitions/grib2/parameters.def index 2b29da1ba..500c6d27c 100644 --- a/definitions/grib2/parameters.def +++ b/definitions/grib2/parameters.def @@ -7,7 +7,7 @@ constant conceptsLocalDirECMF="grib2/localConcepts/ecmf" : hidden; concept paramIdECMF (defaultParameter,"paramId.def",conceptsMasterDir,conceptsLocalDirECMF): long_type,no_copy; concept paramId (paramIdECMF,"paramId.def",conceptsMasterDir,conceptsLocalDirAll): long_type; -transient pid = paramId : hidden; +# transient pid = paramId : hidden; concept shortNameECMF (defaultShortName,"shortName.def",conceptsMasterDir,conceptsLocalDirECMF) : no_copy,dump; concept ls.shortName (shortNameECMF,"shortName.def",conceptsMasterDir,conceptsLocalDirAll) : no_copy,dump; diff --git a/definitions/grib2/shortName.def b/definitions/grib2/shortName.def index b7531089f..a2f403a0f 100644 --- a/definitions/grib2/shortName.def +++ b/definitions/grib2/shortName.def @@ -1421,6 +1421,72 @@ parameterCategory = 0 ; parameterNumber = 1 ; } +#Malaria cases +'mal_cases' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 0 ; + } +#Malaria circumsporozoite protein rate +'mal_prot_rate' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 1 ; + } +#Plasmodium falciparum entomological inoculation rate +'mal_innoc_rate' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 2 ; + } +#Human bite rate by anopheles vectors +'mal_hbite_rate' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 3 ; + } +#Malaria immunity +'mal_immun' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 4 ; + } +#Falciparum parasite rates +'mal_para_rate' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 5 ; + } +#Detectable falciparum parasite ratio (after day 10) +'mal_para_ratio' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 6 ; + } +#Anopheles vector to host ratio +'mal_host_ratio' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 7 ; + } +#Anopheles vector number +'mal_vect_dens' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 8 ; + } +#Fraction of malarial vector reproductive habitat +'mal_hab_frac' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 9 ; + } +#Population density +'pop_dens' = { + discipline = 20 ; + parameterCategory = 2 ; + parameterNumber = 0 ; + } #Virtual temperature 'vtmp' = { discipline = 0 ; diff --git a/definitions/grib2/units.def b/definitions/grib2/units.def index 9b975528e..d42ef0f8d 100644 --- a/definitions/grib2/units.def +++ b/definitions/grib2/units.def @@ -1421,6 +1421,72 @@ parameterCategory = 0 ; parameterNumber = 1 ; } +#Malaria cases +'Fraction' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 0 ; + } +#Malaria circumsporozoite protein rate +'Fraction' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 1 ; + } +#Plasmodium falciparum entomological inoculation rate +'Bites per day per person' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 2 ; + } +#Human bite rate by anopheles vectors +'Bites per day per person' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 3 ; + } +#Malaria immunity +'Fraction' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 4 ; + } +#Falciparum parasite rates +'Fraction' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 5 ; + } +#Detectable falciparum parasite ratio (after day 10) +'Fraction' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 6 ; + } +#Anopheles vector to host ratio +'Fraction' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 7 ; + } +#Anopheles vector number +'Number m**-2' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 8 ; + } +#Fraction of malarial vector reproductive habitat +'Fraction' = { + discipline = 20 ; + parameterCategory = 1 ; + parameterNumber = 9 ; + } +#Population density +'Person m**-2' = { + discipline = 20 ; + parameterCategory = 2 ; + parameterNumber = 0 ; + } #Virtual temperature 'K' = { discipline = 0 ; diff --git a/definitions/param_limits.def b/definitions/param_limits.def index 3b7199a38..8d57fea11 100644 --- a/definitions/param_limits.def +++ b/definitions/param_limits.def @@ -2,161 +2,161 @@ constant default_min_val = -1e9 : double_type, hidden; constant default_max_val = +1e9 : double_type, hidden; concept param_value_min(default_min_val) { - -150 = { pid=165; } - -100 = { pid=166; } - 0 = { pid=260260; } - 0 = { pid=228028; } - 0 = { pid=49; } - 0 = { pid=207; } - 25 = { pid=168; } - 0 = { pid=260242; } - 160 = { pid=167; } - 0 = { pid=260509; } - 5 = { pid=151175; } - 0 = { pid=260257; } - 0 = { pid=59; } - -60000 = { pid=228001; } - 0 = { pid=151163; } - -3.5 = { pid=151131; } - -10 = { pid=260259; } - -13000 = { pid=129; } - -1300 = { pid=156; } - 0 = { pid=3075; } - 0 = { pid=172; } - -0.05 = { pid=3062; } - 0 = { pid=260210; } - 0 = { pid=3073; } - 160 = { pid=121; } - 85000 = { pid=151; } - 270 = { pid=151126; } - -1 = { pid=140230; } - 0 = { pid=140221; } - 0 = { pid=3074; } - 150 = { pid=122; } - 0 = { pid=140214; } - -3.5 = { pid=151132; } - 0 = { pid=151225; } - -1300 = { pid=228002; } - 0 = { pid=140231; } - 0 = { pid=260430; } - 170 = { pid=3; } - -1 = { pid=60; } - 100 = { pid=54; } - 0 = { pid=157; } - -4 = { pid=151145; } - 0 = { pid=151219; } - 160 = { pid=34; } - 0 = { pid=31; } - 0 = { pid=174098; } - 0 = { pid=140229; } - 120 = { pid=235; } - 20 = { pid=228032; } - 10 = { pid=33; } - 0 = { pid=3066; } - -1e-10 = { pid=228141; } - 0.005 = { pid=260367; } - -1000 = { pid=260364; } - 0 = { pid=228039; } - 0 = { pid=228087; } - -20 = { pid=228086; } - 170 = { pid=260360; } - 170 = { pid=228139; } - 170 = { pid=228096; } - 170 = { pid=228095; } - 0 = { pid=43; } - 0 = { pid=247; } - 0 = { pid=246; } - -0.1 = { pid=133; } - 0 = { pid=189; } - 43000 = { pid=134; } - 0 = { pid=173; } - 140 = { pid=130; } - -3 = { pid=260057; } - -50 = { pid=136; } - -250 = { pid=131; } - -250 = { pid=132; } - -30 = { pid=135; } - 0 = { pid=260199; } - 0 = { pid=3031; } - 0 = { pid=10; } + -150 = { paramId=165; } + -100 = { paramId=166; } + 0 = { paramId=260260; } + 0 = { paramId=228028; } + 0 = { paramId=49; } + 0 = { paramId=207; } + 25 = { paramId=168; } + 0 = { paramId=260242; } + 160 = { paramId=167; } + 0 = { paramId=260509; } + 5 = { paramId=151175; } + 0 = { paramId=260257; } + 0 = { paramId=59; } + -60000 = { paramId=228001; } + 0 = { paramId=151163; } + -3.5 = { paramId=151131; } + -10 = { paramId=260259; } + -13000 = { paramId=129; } + -1300 = { paramId=156; } + 0 = { paramId=3075; } + 0 = { paramId=172; } + -0.05 = { paramId=3062; } + 0 = { paramId=260210; } + 0 = { paramId=3073; } + 160 = { paramId=121; } + 85000 = { paramId=151; } + 270 = { paramId=151126; } + -1 = { paramId=140230; } + 0 = { paramId=140221; } + 0 = { paramId=3074; } + 150 = { paramId=122; } + 0 = { paramId=140214; } + -3.5 = { paramId=151132; } + 0 = { paramId=151225; } + -1300 = { paramId=228002; } + 0 = { paramId=140231; } + 0 = { paramId=260430; } + 170 = { paramId=3; } + -1 = { paramId=60; } + 100 = { paramId=54; } + 0 = { paramId=157; } + -4 = { paramId=151145; } + 0 = { paramId=151219; } + 160 = { paramId=34; } + 0 = { paramId=31; } + 0 = { paramId=174098; } + 0 = { paramId=140229; } + 120 = { paramId=235; } + 20 = { paramId=228032; } + 10 = { paramId=33; } + 0 = { paramId=3066; } + -1e-10 = { paramId=228141; } + 0.005 = { paramId=260367; } + -1000 = { paramId=260364; } + 0 = { paramId=228039; } + 0 = { paramId=228087; } + -20 = { paramId=228086; } + 170 = { paramId=260360; } + 170 = { paramId=228139; } + 170 = { paramId=228096; } + 170 = { paramId=228095; } + 0 = { paramId=43; } + 0 = { paramId=247; } + 0 = { paramId=246; } + -0.1 = { paramId=133; } + 0 = { paramId=189; } + 43000 = { paramId=134; } + 0 = { paramId=173; } + 140 = { paramId=130; } + -3 = { paramId=260057; } + -50 = { paramId=136; } + -250 = { paramId=131; } + -250 = { paramId=132; } + -30 = { paramId=135; } + 0 = { paramId=260199; } + 0 = { paramId=3031; } + 0 = { paramId=10; } } : double_type, hidden; concept param_value_max(default_max_val) { - 150 = { pid=165; } - 100 = { pid=166; } - 360.1 = { pid=260260; } - 140 = { pid=228028; } - 100 = { pid=49; } - 300 = { pid=207; } - 350 = { pid=168; } - 160 = { pid=260242; } - 370 = { pid=167; } - 100 = { pid=260509; } - 50 = { pid=151175; } - 100 = { pid=260257; } - 40000 = { pid=59; } - 5 = { pid=228001; } - 1500 = { pid=151163; } - 3.5 = { pid=151131; } - 5 = { pid=260259; } - 350000 = { pid=129; } - 35000 = { pid=156; } - 100 = { pid=3075; } - 1 = { pid=172; } - 130 = { pid=3062; } - 1 = { pid=260210; } - 100 = { pid=3073; } - 380 = { pid=121; } - 125000 = { pid=151; } - 308 = { pid=151126; } - 360.5 = { pid=140230; } - 35 = { pid=140221; } - 100 = { pid=3074; } - 330 = { pid=122; } - 35 = { pid=140214; } - 3.5 = { pid=151132; } - 4000 = { pid=151225; } - 8888 = { pid=228002; } - 50 = { pid=140231; } - 30 = { pid=260430; } - 1200 = { pid=3; } - 1 = { pid=60; } - 108000 = { pid=54; } - 180 = { pid=157; } - 4 = { pid=151145; } - 50 = { pid=151219; } - 320 = { pid=34; } - 1.001 = { pid=31; } - 15 = { pid=174098; } - 35 = { pid=140229; } - 380 = { pid=235; } - 100 = { pid=228032; } - 1000 = { pid=33; } - 5 = { pid=3066; } - 15000 = { pid=228141; } - 100 = { pid=260367; } - 1000 = { pid=260364; } - 2000 = { pid=228039; } - 2000 = { pid=228087; } - 2000 = { pid=228086; } - 350 = { pid=260360; } - 350 = { pid=228139; } - 350 = { pid=228096; } - 350 = { pid=228095; } - 10 = { pid=43; } - 0.01 = { pid=247; } - 1e+06 = { pid=246; } - 0.1 = { pid=133; } - 3600 = { pid=189; } - 115000 = { pid=134; } - 10 = { pid=173; } - 400 = { pid=130; } - 150 = { pid=260057; } - 220 = { pid=136; } - 250 = { pid=131; } - 250 = { pid=132; } - 30 = { pid=135; } - 1 = { pid=260199; } - 360.1 = { pid=3031; } - 300 = { pid=10; } + 150 = { paramId=165; } + 100 = { paramId=166; } + 360.1 = { paramId=260260; } + 140 = { paramId=228028; } + 100 = { paramId=49; } + 300 = { paramId=207; } + 350 = { paramId=168; } + 160 = { paramId=260242; } + 370 = { paramId=167; } + 100 = { paramId=260509; } + 50 = { paramId=151175; } + 100 = { paramId=260257; } + 40000 = { paramId=59; } + 5 = { paramId=228001; } + 1500 = { paramId=151163; } + 3.5 = { paramId=151131; } + 5 = { paramId=260259; } + 350000 = { paramId=129; } + 35000 = { paramId=156; } + 100 = { paramId=3075; } + 1 = { paramId=172; } + 130 = { paramId=3062; } + 1 = { paramId=260210; } + 100 = { paramId=3073; } + 380 = { paramId=121; } + 125000 = { paramId=151; } + 308 = { paramId=151126; } + 360.5 = { paramId=140230; } + 35 = { paramId=140221; } + 100 = { paramId=3074; } + 330 = { paramId=122; } + 35 = { paramId=140214; } + 3.5 = { paramId=151132; } + 4000 = { paramId=151225; } + 8888 = { paramId=228002; } + 50 = { paramId=140231; } + 30 = { paramId=260430; } + 1200 = { paramId=3; } + 1 = { paramId=60; } + 108000 = { paramId=54; } + 180 = { paramId=157; } + 4 = { paramId=151145; } + 50 = { paramId=151219; } + 320 = { paramId=34; } + 1.001 = { paramId=31; } + 15 = { paramId=174098; } + 35 = { paramId=140229; } + 380 = { paramId=235; } + 100 = { paramId=228032; } + 1000 = { paramId=33; } + 5 = { paramId=3066; } + 15000 = { paramId=228141; } + 100 = { paramId=260367; } + 1000 = { paramId=260364; } + 2000 = { paramId=228039; } + 2000 = { paramId=228087; } + 2000 = { paramId=228086; } + 350 = { paramId=260360; } + 350 = { paramId=228139; } + 350 = { paramId=228096; } + 350 = { paramId=228095; } + 10 = { paramId=43; } + 0.01 = { paramId=247; } + 1e+06 = { paramId=246; } + 0.1 = { paramId=133; } + 3600 = { paramId=189; } + 115000 = { paramId=134; } + 10 = { paramId=173; } + 400 = { paramId=130; } + 150 = { paramId=260057; } + 220 = { paramId=136; } + 250 = { paramId=131; } + 250 = { paramId=132; } + 30 = { paramId=135; } + 1 = { paramId=260199; } + 360.1 = { paramId=3031; } + 300 = { paramId=10; } } : double_type, hidden; diff --git a/src/grib_accessor_class_concept.c b/src/grib_accessor_class_concept.c index e581ba613..af1ddf6e1 100644 --- a/src/grib_accessor_class_concept.c +++ b/src/grib_accessor_class_concept.c @@ -437,7 +437,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) int ret = 0; if (a->flags & GRIB_ACCESSOR_FLAG_LONG_TYPE) { long lval = 0; - int ret = unpack_long(a, &lval, len); + ret = unpack_long(a, &lval, len); if (ret == GRIB_SUCCESS) { *val = lval; } diff --git a/src/grib_context.c b/src/grib_context.c index 357e98707..415f9e990 100644 --- a/src/grib_context.c +++ b/src/grib_context.c @@ -27,13 +27,13 @@ int feenableexcept(int excepts); grib_string_list grib_file_not_found; /* Windows always has a colon in pathnames e.g. C:\temp\file. So instead we use semi-colons as delimiter */ -/* in order to have multiple definitions directories */ +/* in order to have multiple definitions/samples directories */ #ifdef ECCODES_ON_WINDOWS -#define DEFS_PATH_DELIMITER_CHAR ';' -#define DEFS_PATH_DELIMITER_STR ";" +#define ECC_PATH_DELIMITER_CHAR ';' +#define ECC_PATH_DELIMITER_STR ";" #else -#define DEFS_PATH_DELIMITER_CHAR ':' -#define DEFS_PATH_DELIMITER_STR ":" +#define ECC_PATH_DELIMITER_CHAR ':' +#define ECC_PATH_DELIMITER_STR ":" #endif #if GRIB_PTHREADS @@ -371,8 +371,8 @@ static grib_context default_grib_context = { #endif }; -/* Hopefully big enough. Note: GRIB_DEFINITION_PATH can contain SEVERAL colon-separated sub-paths */ -#define DEF_PATH_MAXLEN 8192 +/* Hopefully big enough. Note: Definitions and samples path environment variables can contain SEVERAL colon-separated directories */ +#define ECC_PATH_MAXLEN 8192 grib_context* grib_context_get_default() { @@ -470,14 +470,14 @@ grib_context* grib_context_get_default() const char* test_defs = codes_getenv("_ECCODES_ECMWF_TEST_DEFINITION_PATH"); const char* test_samp = codes_getenv("_ECCODES_ECMWF_TEST_SAMPLES_PATH"); if (test_defs) { - char buffer[DEF_PATH_MAXLEN]; + char buffer[ECC_PATH_MAXLEN]; strcpy(buffer, default_grib_context.grib_definition_files_path); strcat(buffer, ":"); strcat(buffer, strdup(test_defs)); default_grib_context.grib_definition_files_path = strdup(buffer); } if (test_samp) { - char buffer[DEF_PATH_MAXLEN]; + char buffer[ECC_PATH_MAXLEN]; strcpy(buffer, default_grib_context.grib_samples_path); strcat(buffer, ":"); strcat(buffer, strdup(test_samp)); @@ -489,12 +489,22 @@ grib_context* grib_context_get_default() { const char* defs_extra = getenv("ECCODES_EXTRA_DEFINITION_PATH"); if (defs_extra) { - char buffer[DEF_PATH_MAXLEN]; - ecc_snprintf(buffer, DEF_PATH_MAXLEN, "%s%c%s", defs_extra, DEFS_PATH_DELIMITER_CHAR, default_grib_context.grib_definition_files_path); + char buffer[ECC_PATH_MAXLEN]; + ecc_snprintf(buffer, ECC_PATH_MAXLEN, "%s%c%s", defs_extra, ECC_PATH_DELIMITER_CHAR, default_grib_context.grib_definition_files_path); default_grib_context.grib_definition_files_path = strdup(buffer); } } + /* Samples path extra: Added at the head of (i.e. before) existing path */ + { + const char* samples_extra = getenv("ECCODES_EXTRA_SAMPLES_PATH"); + if (samples_extra) { + char buffer[ECC_PATH_MAXLEN]; + ecc_snprintf(buffer, ECC_PATH_MAXLEN, "%s%c%s", samples_extra, ECC_PATH_DELIMITER_CHAR, default_grib_context.grib_samples_path); + default_grib_context.grib_samples_path = strdup(buffer); + } + } + grib_context_log(&default_grib_context, GRIB_LOG_DEBUG, "Definitions path: %s", default_grib_context.grib_definition_files_path); grib_context_log(&default_grib_context, GRIB_LOG_DEBUG, "Samples path: %s", @@ -576,7 +586,7 @@ static char* resolve_path(grib_context* c, char* path) #ifdef ECCODES_ON_WINDOWS result = grib_context_strdup(c, path); #else - char resolved[DEF_PATH_MAXLEN + 1]; + char resolved[ECC_PATH_MAXLEN + 1]; if (!realpath(path, resolved)) { result = grib_context_strdup(c, path); /* Failed to resolve. Use original path */ } @@ -590,7 +600,7 @@ static char* resolve_path(grib_context* c, char* path) static int init_definition_files_dir(grib_context* c) { int err = 0; - char path[DEF_PATH_MAXLEN]; + char path[ECC_PATH_MAXLEN]; char* p = NULL; grib_string_list* next = NULL; @@ -603,17 +613,17 @@ static int init_definition_files_dir(grib_context* c) return GRIB_NO_DEFINITIONS; /* Note: strtok modifies its first argument so we copy */ - strncpy(path, c->grib_definition_files_path, DEF_PATH_MAXLEN); + strncpy(path, c->grib_definition_files_path, ECC_PATH_MAXLEN); GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex_c); p = path; - while (*p != DEFS_PATH_DELIMITER_CHAR && *p != '\0') + while (*p != ECC_PATH_DELIMITER_CHAR && *p != '\0') p++; - if (*p != DEFS_PATH_DELIMITER_CHAR) { + if (*p != ECC_PATH_DELIMITER_CHAR) { /* No delimiter found so this is a single directory */ c->grib_definition_files_dir = (grib_string_list*)grib_context_malloc_clear_persistent(c, sizeof(grib_string_list)); c->grib_definition_files_dir->value = resolve_path(c, path); @@ -621,7 +631,7 @@ static int init_definition_files_dir(grib_context* c) else { /* Definitions path contains multiple directories */ char* dir = NULL; - dir = strtok(path, DEFS_PATH_DELIMITER_STR); + dir = strtok(path, ECC_PATH_DELIMITER_STR); while (dir != NULL) { if (next) { @@ -633,7 +643,7 @@ static int init_definition_files_dir(grib_context* c) next = c->grib_definition_files_dir; } next->value = resolve_path(c, dir); - dir = strtok(NULL, DEFS_PATH_DELIMITER_STR); + dir = strtok(NULL, ECC_PATH_DELIMITER_STR); } } diff --git a/src/grib_expression_class_accessor.c b/src/grib_expression_class_accessor.c index 07c9159a7..b46603b30 100644 --- a/src/grib_expression_class_accessor.c +++ b/src/grib_expression_class_accessor.c @@ -125,7 +125,8 @@ static string evaluate_string(grib_expression* g, grib_handle* h, char* buf, siz start += *size; if (e->length != 0) { - memcpy(buf, mybuf + start, e->length); + if (start >= 0) + memcpy(buf, mybuf + start, e->length); buf[e->length] = 0; } else { diff --git a/src/grib_expression_class_string_compare.c b/src/grib_expression_class_string_compare.c index cdae91f55..20909f67f 100644 --- a/src/grib_expression_class_string_compare.c +++ b/src/grib_expression_class_string_compare.c @@ -107,19 +107,19 @@ static int evaluate_long(grib_expression* g, grib_handle* h, long* lres) size_t l1 = sizeof(b1); char b2[1024]; size_t l2 = sizeof(b2); - const char* v1; - const char* v2; + const char* v1 = NULL; + const char* v2 = NULL; grib_expression_string_compare* e = (grib_expression_string_compare*)g; v1 = grib_expression_evaluate_string(h, e->left, b1, &l1, &ret); - if (!v1) { + if (!v1 || ret) { *lres = 0; return ret; } v2 = grib_expression_evaluate_string(h, e->right, b2, &l2, &ret); - if (!v2) { + if (!v2 || ret) { *lres = 0; return ret; } diff --git a/src/grib_fieldset.c b/src/grib_fieldset.c index 224e85e14..9243fc353 100644 --- a/src/grib_fieldset.c +++ b/src/grib_fieldset.c @@ -142,6 +142,7 @@ static void grib_fieldset_delete_columns(grib_fieldset* set) case GRIB_TYPE_STRING: for (j = 0; j < set->columns[i].size; j++) grib_context_free(c, set->columns[i].string_values[j]); + grib_context_free(c, set->columns[i].string_values); break; default: grib_context_log(c, GRIB_LOG_ERROR, diff --git a/src/grib_handle.c b/src/grib_handle.c index 723595fb3..165b2f8ab 100644 --- a/src/grib_handle.c +++ b/src/grib_handle.c @@ -265,8 +265,11 @@ grib_handle* grib_handle_new_from_samples(grib_context* c, const char* name) g = grib_external_template(c, name); if (!g) - grib_context_log(c, GRIB_LOG_ERROR, "Unable to load sample file %s.tmpl\n in %s", - name, c->grib_samples_path); + grib_context_log(c, GRIB_LOG_ERROR, + "Unable to load sample file '%s.tmpl'\n" + " from %s\n" + " (ecCodes Version=%s)", + name, c->grib_samples_path, ECCODES_VERSION_STR); return g; } @@ -284,13 +287,16 @@ grib_handle* codes_bufr_handle_new_from_samples(grib_context* c, const char* nam * if(g) return g; */ if (c->debug) { - fprintf(stderr, "ECCODES DEBUG: grib_handle_new_from_samples '%s'\n", name); + fprintf(stderr, "ECCODES DEBUG: codes_bufr_handle_new_from_samples '%s'\n", name); } g = bufr_external_template(c, name); if (!g) - grib_context_log(c, GRIB_LOG_ERROR, "Unable to load sample file %s.tmpl\n in %s", - name, c->grib_samples_path); + grib_context_log(c, GRIB_LOG_ERROR, + "Unable to load sample file '%s.tmpl'\n" + " from %s\n" + " (ecCodes Version=%s)", + name, c->grib_samples_path, ECCODES_VERSION_STR); return g; } diff --git a/tests/grib_data_quality_checks.sh b/tests/grib_data_quality_checks.sh index a3cae1196..b3a38c686 100755 --- a/tests/grib_data_quality_checks.sh +++ b/tests/grib_data_quality_checks.sh @@ -101,6 +101,9 @@ set -e [ $stat1 -ne 0 ] [ $stat2 -ne 0 ] +# Should succeed. Change paramId first and then scale all values down +${tools_dir}/grib_set -s paramId=$pid,scaleValuesBy=0.01 $input1 $tempOut +${tools_dir}/grib_set -s paramId=$pid,scaleValuesBy=0.01 $input2 $tempOut echo "Test close to the limit..." # --------------------------------- diff --git a/tests/lsan-leap42.supp b/tests/lsan-leap42.supp index fd5c809e5..c97673a77 100644 --- a/tests/lsan-leap42.supp +++ b/tests/lsan-leap42.supp @@ -1 +1,4 @@ leak:tools/grib_filter.c +leak:tools/bufr_filter.c +leak:tools/gts_filter.c +leak:src/action_class_rename.c diff --git a/tools/codes_info.c b/tools/codes_info.c index cc47c9980..b3d2ab0f9 100644 --- a/tools/codes_info.c +++ b/tools/codes_info.c @@ -113,7 +113,7 @@ int main(int argc, char* argv[]) "It is recommended you use ECCODES_SAMPLES_PATH instead!)\n"); } else { - printf("Default SAMPLES path is used: %s\n", ECCODES_SAMPLES_PATH); + printf("Default SAMPLES path is used: %s\n", context->grib_samples_path); printf("SAMPLES path can be changed by setting ECCODES_SAMPLES_PATH environment variable\n"); } printf("\n"); @@ -137,7 +137,7 @@ int main(int argc, char* argv[]) printf("%s", path); } else { - printf("%s", ECCODES_SAMPLES_PATH); + printf("%s", context->grib_samples_path); } } From 0f33a73e6c9b9ba0a24dba62dcfd0d6be898ecc5 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 10 Feb 2020 11:52:08 +0000 Subject: [PATCH 58/82] Latest updates from develop (13) --- definitions/param_limits.def | 6 +++--- src/TODO | 2 ++ src/grib_util.c | 21 +++++++++++++-------- tests/grib_util_set_spec.c | 1 + tests/index.c | 20 +++++++++++++------- 5 files changed, 32 insertions(+), 18 deletions(-) diff --git a/definitions/param_limits.def b/definitions/param_limits.def index 8d57fea11..6b20ebc29 100644 --- a/definitions/param_limits.def +++ b/definitions/param_limits.def @@ -110,10 +110,10 @@ concept param_value_max(default_max_val) { 125000 = { paramId=151; } 308 = { paramId=151126; } 360.5 = { paramId=140230; } - 35 = { paramId=140221; } + 50 = { paramId=140221; } 100 = { paramId=3074; } 330 = { paramId=122; } - 35 = { paramId=140214; } + 150 = { paramId=140214; } 3.5 = { paramId=151132; } 4000 = { paramId=151225; } 8888 = { paramId=228002; } @@ -128,7 +128,7 @@ concept param_value_max(default_max_val) { 320 = { paramId=34; } 1.001 = { paramId=31; } 15 = { paramId=174098; } - 35 = { paramId=140229; } + 100 = { paramId=140229; } 380 = { paramId=235; } 100 = { paramId=228032; } 1000 = { paramId=33; } diff --git a/src/TODO b/src/TODO index 9b9bb5d24..ffe7595f7 100644 --- a/src/TODO +++ b/src/TODO @@ -20,3 +20,5 @@ gribex and missing local definition SST dats Don't repack unecessary values in packers grid 90 + +GRIB_LOG_WARNING: does not work unless ctx.debug>=2 diff --git a/src/grib_util.c b/src/grib_util.c index 50b5d7ff5..39846a587 100644 --- a/src/grib_util.c +++ b/src/grib_util.c @@ -1463,6 +1463,7 @@ grib_handle* grib_util_set_spec2(grib_handle* h, default: fprintf(stderr, "invalid packing_spec->accuracy = %ld\n", (long)packing_spec->accuracy); + grib_handle_delete(tmp); *err = GRIB_INTERNAL_ERROR; goto cleanup; break; @@ -2185,6 +2186,8 @@ int grib_util_grib_data_quality_check(grib_handle* h, double min_val, double max grib_context* ctx = h->context; int is_error = 1; char description[1024] = {0,}; + char step[32] = "unknown"; + size_t len = 32; /* * If grib_data_quality_checks == 1, limits failure results in an error * If grib_data_quality_checks == 2, limits failure results in a warning @@ -2212,14 +2215,15 @@ int grib_util_grib_data_quality_check(grib_handle* h, double min_val, double max } if (min_val < min_field_value_allowed) { + grib_get_string(h, "step", step, &len); if (get_concept_condition_string(h, "param_value_min", NULL, description) == GRIB_SUCCESS) { - fprintf(stderr, "ECCODES %s : (%s): minimum (%g) is less than the allowable limit (%g)\n", - (is_error ? "ERROR" : "WARNING"), description, min_val, min_field_value_allowed); + fprintf(stderr, "ECCODES %s : (%s, step=%s): minimum (%g) is less than the allowable limit (%g)\n", + (is_error ? "ERROR" : "WARNING"), description, step, min_val, min_field_value_allowed); } else { if (grib_get_long(h, "paramId", ¶mId) == GRIB_SUCCESS) { - fprintf(stderr, "ECCODES %s : (paramId=%ld): minimum (%g) is less than the default allowable limit (%g)\n", - (is_error ? "ERROR" : "WARNING"), paramId, min_val, min_field_value_allowed); + fprintf(stderr, "ECCODES %s : (paramId=%ld, step=%s): minimum (%g) is less than the default allowable limit (%g)\n", + (is_error ? "ERROR" : "WARNING"), paramId, step, min_val, min_field_value_allowed); } } if (is_error) { @@ -2227,14 +2231,15 @@ int grib_util_grib_data_quality_check(grib_handle* h, double min_val, double max } } if (max_val > max_field_value_allowed) { + grib_get_string(h, "step", step, &len); if (get_concept_condition_string(h, "param_value_max", NULL, description) == GRIB_SUCCESS) { - fprintf(stderr, "ECCODES %s : (%s): maximum (%g) is more than the allowable limit (%g)\n", - (is_error ? "ERROR" : "WARNING"), description, max_val, max_field_value_allowed); + fprintf(stderr, "ECCODES %s : (%s, step=%s): maximum (%g) is more than the allowable limit (%g)\n", + (is_error ? "ERROR" : "WARNING"), description, step, max_val, max_field_value_allowed); } else { if (grib_get_long(h, "paramId", ¶mId) == GRIB_SUCCESS) { - fprintf(stderr, "ECCODES %s : (paramId=%ld): maximum (%g) is more than the default allowable limit (%g)\n", - (is_error ? "ERROR" : "WARNING"), paramId, max_val, max_field_value_allowed); + fprintf(stderr, "ECCODES %s : (paramId=%ld, step=%s): maximum (%g) is more than the default allowable limit (%g)\n", + (is_error ? "ERROR" : "WARNING"), paramId, step, max_val, max_field_value_allowed); } } if (is_error) { diff --git a/tests/grib_util_set_spec.c b/tests/grib_util_set_spec.c index af530867a..9bf1d9b1a 100644 --- a/tests/grib_util_set_spec.c +++ b/tests/grib_util_set_spec.c @@ -242,6 +242,7 @@ static void test_regular_ll(int remove_local_def, int edition, const char* packi } codes_handle_delete(handle); codes_handle_delete(finalh); + free(values); fclose(in); fclose(out); } diff --git a/tests/index.c b/tests/index.c index 282e88aea..98b20756d 100644 --- a/tests/index.c +++ b/tests/index.c @@ -21,7 +21,7 @@ int main(int argc, char* argv[]) grib_handle* h = NULL; char* infile = NULL; long *steps, *levels, *numbers; /* arrays */ - char** shortName = NULL; + char** shortNames = NULL; int i, j, k, l; size_t stepSize, levelSize, shortNameSize, numberSize; long oStep, oLevel, oNumber; @@ -85,21 +85,21 @@ int main(int argc, char* argv[]) /*same as for "step"*/ GRIB_CHECK(grib_index_get_size(index, "shortName", &shortNameSize), 0); - shortName = (char**)malloc(sizeof(char*) * shortNameSize); - if (!shortName) exit(1); + shortNames = (char**)malloc(sizeof(char*) * shortNameSize); + if (!shortNames) exit(1); /*same as for "step"*/ - GRIB_CHECK(grib_index_get_string(index, "shortName", shortName, &shortNameSize), 0); + GRIB_CHECK(grib_index_get_string(index, "shortName", shortNames, &shortNameSize), 0); printf("shortNameSize=%ld\n", (long)shortNameSize); for (i = 0; i < shortNameSize; i++) - printf("%s ", shortName[i]); + printf("%s ", shortNames[i]); printf("\n"); count = 0; /* nested loops on the keys values of the index */ /* different order of the nested loops doesn't affect performance*/ for (i = 0; i < shortNameSize; i++) { - /* select the GRIB with shortName=shortName[i] */ - grib_index_select_string(index, "shortName", shortName[i]); + /* select the GRIB with shortName=shortNames[i] */ + grib_index_select_string(index, "shortName", shortNames[i]); for (l = 0; l < levelSize; l++) { /* select the GRIB with level=levels[i] */ @@ -146,6 +146,12 @@ int main(int argc, char* argv[]) grib_index_write(index, "out.gribidx"); grib_index_delete(index); + free(levels); + free(numbers); + free(steps); + for (i = 0; i < shortNameSize; i++) + free(shortNames[i]); + free(shortNames); return 0; } From 15f3612785591599fcc5ef6ffdc01b1e9dfbb15d Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 10 Feb 2020 14:38:00 +0000 Subject: [PATCH 59/82] Latest updates from develop (14) --- definitions/param_limits.def | 2 -- src/grib_dumper_class_wmo.c | 9 ++++----- tests/bufr_dump_data.sh | 8 +++----- tests/lsan-leap42.supp | 1 + tools/bufr_dump.c | 12 ------------ 5 files changed, 8 insertions(+), 24 deletions(-) diff --git a/definitions/param_limits.def b/definitions/param_limits.def index 6b20ebc29..cf4bc1989 100644 --- a/definitions/param_limits.def +++ b/definitions/param_limits.def @@ -67,7 +67,6 @@ concept param_value_min(default_min_val) { 0 = { paramId=247; } 0 = { paramId=246; } -0.1 = { paramId=133; } - 0 = { paramId=189; } 43000 = { paramId=134; } 0 = { paramId=173; } 140 = { paramId=130; } @@ -147,7 +146,6 @@ concept param_value_max(default_max_val) { 0.01 = { paramId=247; } 1e+06 = { paramId=246; } 0.1 = { paramId=133; } - 3600 = { paramId=189; } 115000 = { paramId=134; } 10 = { paramId=173; } 400 = { paramId=130; } diff --git a/src/grib_dumper_class_wmo.c b/src/grib_dumper_class_wmo.c index 7815468d9..6db7f423c 100644 --- a/src/grib_dumper_class_wmo.c +++ b/src/grib_dumper_class_wmo.c @@ -605,8 +605,10 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm int tab = 0; long count = 0; - c = a->context; + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) + return; + c = a->context; grib_value_count(a, &count); if (count == 0) return; @@ -624,10 +626,6 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm err = grib_unpack_string_array(a, values, &size); - if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) - return; - - /* print_offset(self->dumper.out,d,a); */ print_offset(self->dumper.out, self->begin, self->theEnd); @@ -662,5 +660,6 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm } fprintf(self->dumper.out, "\n"); + for (i=0; i/dev/null done @@ -45,11 +43,11 @@ file="aaen_55.bufr" export ECCODES_DEBUG=1 # By default debug output goes to stderr -${tools_dir}/bufr_dump -O ${data_dir}/bufr/$file 2>&1 | grep -q "BUFR data .*ing" +${tools_dir}/bufr_dump -O ${data_dir}/bufr/$file 2>&1 | grep -q "parsing include file" # Redirect it to stdout export ECCODES_LOG_STREAM=stdout -${tools_dir}/bufr_dump -O ${data_dir}/bufr/$file | grep -q "BUFR data .*ing" +${tools_dir}/bufr_dump -O ${data_dir}/bufr/$file | grep -q "parsing include file" unset ECCODES_DEBUG unset ECCODES_LOG_STREAM diff --git a/tests/lsan-leap42.supp b/tests/lsan-leap42.supp index c97673a77..640d0d9d2 100644 --- a/tests/lsan-leap42.supp +++ b/tests/lsan-leap42.supp @@ -2,3 +2,4 @@ leak:tools/grib_filter.c leak:tools/bufr_filter.c leak:tools/gts_filter.c leak:src/action_class_rename.c +leak:tools/grib_to_netcdf.c diff --git a/tools/bufr_dump.c b/tools/bufr_dump.c index abd14fa00..482a1099b 100644 --- a/tools/bufr_dump.c +++ b/tools/bufr_dump.c @@ -506,18 +506,6 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) sprintf(tmp, "MESSAGE %d ( length=%ld )", options->handle_count, length); if (!grib_options_on("C")) fprintf(stdout, "#============== %-38s ==============\n", tmp); - err = grib_set_long(h, "unpack", 1); - if (err) { - if (options->fail) { - fprintf(stderr, "ERROR: unable to unpack data section: %s\n", grib_get_error_message(err)); - exit(err); - } - else { - fprintf(stdout, "ERROR: unable to unpack data section\n"); - options->error = err; - /*return err; See ECC-723*/ - } - } grib_dump_content(h, stdout, options->dump_mode, options->dump_flags, 0); } else if (dump_descriptors) { From 99d77209adce5dc1288a6583f433357557199d23 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 11 Feb 2020 18:02:11 +0000 Subject: [PATCH 60/82] Latest updates from develop (15) --- examples/C/grib_get_keys.c | 2 +- examples/C/grib_nearest_multiple.c | 22 +- src/grib_accessor_class_bufr_data_array.c | 2 +- src/grib_accessor_class_concept.c | 8 +- src/grib_accessor_class_dictionary.c | 7 +- ...accessor_class_number_of_points_gaussian.c | 23 +- src/grib_dumper_class_bufr_encode_fortran.c | 18 +- src/grib_geography.c | 3864 ++++++++++++++++- src/grib_handle.c | 9 +- src/grib_iterator_class_gaussian_reduced.c | 2 +- src/grib_jasper_encoding.c | 4 +- src/grib_openjpeg_encoding.c | 6 +- tests/grib_copy.sh | 25 +- 13 files changed, 3928 insertions(+), 64 deletions(-) diff --git a/examples/C/grib_get_keys.c b/examples/C/grib_get_keys.c index d7af778cc..916a48171 100644 --- a/examples/C/grib_get_keys.c +++ b/examples/C/grib_get_keys.c @@ -136,7 +136,7 @@ int main(int argc, char** argv) unsigned char* byte_val = NULL; size_t keySize = 0; CODES_CHECK(codes_get_size(h, name, &keySize), 0); - byte_val = (unsigned char*)malloc(keySize * sizeof(char)); + byte_val = (unsigned char*)malloc(keySize * sizeof(unsigned char)); GRIB_CHECK(codes_get_bytes(h, name, byte_val, &keySize), name); free(byte_val); } diff --git a/examples/C/grib_nearest_multiple.c b/examples/C/grib_nearest_multiple.c index c3bb2d1d8..c32bc9b93 100644 --- a/examples/C/grib_nearest_multiple.c +++ b/examples/C/grib_nearest_multiple.c @@ -60,49 +60,49 @@ int main(int argc, char** argv) npoints++; fclose(fin); - id = (long*)malloc(npoints * sizeof(long)); + id = (long*)calloc(npoints, sizeof(long)); if (!id) { printf("unable to allocate %ld bytes\n", (long)(npoints * sizeof(long))); exit(1); } - vlat = (double*)malloc(npoints * sizeof(double)); + vlat = (double*)calloc(npoints, sizeof(double)); if (!vlat) { printf("unable to allocate %ld bytes\n", (long)(npoints * sizeof(double))); exit(1); } - vlon = (double*)malloc(npoints * sizeof(double)); + vlon = (double*)calloc(npoints, sizeof(double)); if (!vlon) { printf("unable to allocate %ld bytes\n", (long)(npoints * sizeof(double))); exit(1); } - outlats = (double*)malloc(npoints * sizeof(double)); + outlats = (double*)calloc(npoints, sizeof(double)); if (!outlats) { printf("unable to allocate %ld bytes\n", (long)(npoints * sizeof(double))); exit(1); } - outlons = (double*)malloc(npoints * sizeof(double)); + outlons = (double*)calloc(npoints, sizeof(double)); if (!outlons) { printf("unable to allocate %ld bytes\n", (long)(npoints * sizeof(double))); exit(1); } - values = (double*)malloc(npoints * sizeof(double)); + values = (double*)calloc(npoints, sizeof(double)); if (!values) { printf("unable to allocate %ld bytes\n", (long)(npoints * sizeof(double))); exit(1); } - lsm_values = (double*)malloc(npoints * sizeof(double)); + lsm_values = (double*)calloc(npoints, sizeof(double)); if (!lsm_values) { printf("unable to allocate %ld bytes\n", (long)(npoints * sizeof(double))); exit(1); } - distances = (double*)malloc(npoints * sizeof(double)); + distances = (double*)calloc(npoints, sizeof(double)); if (!distances) { printf("unable to allocate %ld bytes\n", (long)(npoints * sizeof(double))); exit(1); } - indexes = (int*)malloc(npoints * sizeof(int)); + indexes = (int*)calloc(npoints, sizeof(int)); if (!indexes) { - printf("unable to allocate %ld bytes\n", (long)(npoints * sizeof(double))); + printf("unable to allocate %ld bytes\n", (long)(npoints * sizeof(int))); exit(1); } @@ -113,7 +113,7 @@ int main(int argc, char** argv) exit(1); } i = 0; - while (fscanf(fin, "%ld %g %g", &iid, &lat, &lon) != EOF) { + while (i < npoints && fscanf(fin, "%ld %g %g", &iid, &lat, &lon) != EOF) { id[i] = iid; vlat[i] = lat; while (lon < 0) diff --git a/src/grib_accessor_class_bufr_data_array.c b/src/grib_accessor_class_bufr_data_array.c index 740863489..6632ade8b 100644 --- a/src/grib_accessor_class_bufr_data_array.c +++ b/src/grib_accessor_class_bufr_data_array.c @@ -1003,7 +1003,7 @@ static int encode_double_value(grib_context* c, grib_buffer* buff, long* pos, bu "ECCODES WARNING : encode_double_value: %s. Value (%g) out of range (minAllowed=%g, maxAllowed=%g)." " Setting it to missing value\n", bd->shortName, value, minAllowed, maxAllowed); - value = GRIB_MISSING_DOUBLE; /* Ignore the bad value and instead use 'missing' */ + /* Ignore the bad value and instead use 'missing' */ grib_set_bits_on(buff->data, pos, modifiedWidth); } else { diff --git a/src/grib_accessor_class_concept.c b/src/grib_accessor_class_concept.c index af1ddf6e1..00c6e0b20 100644 --- a/src/grib_accessor_class_concept.c +++ b/src/grib_accessor_class_concept.c @@ -356,13 +356,17 @@ static int grib_concept_apply(grib_accessor* a, const char* name) err = nofail ? GRIB_SUCCESS : GRIB_CONCEPT_NO_MATCH; if (err) { size_t i = 0, concept_count = 0; - long editionNumber = 0; + long dummy = 0, editionNumber = 0; char* all_concept_vals[MAX_NUM_CONCEPT_VALUES] = { NULL, }; /* sorted array containing concept values */ grib_concept_value* pCon = concepts; grib_context_log(h->context, GRIB_LOG_ERROR, "concept: no match for %s=%s", act->name, name); + if (strcmp(act->name, "paramId")==0 && string_to_long(name, &dummy)==GRIB_SUCCESS) { + grib_context_log(h->context, GRIB_LOG_ERROR, + "Please check the Parameter Database 'https://apps.ecmwf.int/codes/grib/param-db/?id=%s'", name); + } if (grib_get_long(h, "edition", &editionNumber) == GRIB_SUCCESS) { grib_context_log(h->context, GRIB_LOG_ERROR, "concept: input handle edition=%ld", editionNumber); } @@ -383,7 +387,7 @@ static int grib_concept_apply(grib_accessor* a, const char* name) for (i = 0; i < concept_count; ++i) { if (all_concept_vals[i]) { int print_it = 1; - if (i > 0 && strcmp(all_concept_vals[i], all_concept_vals[i - 1]) == 0) { + if (i > 0 && all_concept_vals[i - 1] && strcmp(all_concept_vals[i], all_concept_vals[i - 1]) == 0) { print_it = 0; /* skip duplicate entries */ } if (print_it) diff --git a/src/grib_accessor_class_dictionary.c b/src/grib_accessor_class_dictionary.c index 1c88d6905..725926c5d 100644 --- a/src/grib_accessor_class_dictionary.c +++ b/src/grib_accessor_class_dictionary.c @@ -329,9 +329,10 @@ static int unpack_string(grib_accessor* a, char* buffer, size_t* len) } *len = rsize; - Assert(buffer); - memcpy(buffer, start, rsize); - buffer[rsize] = 0; + if (buffer && start) + memcpy(buffer, start, rsize); + if (buffer) + buffer[rsize] = 0; /* grib_trie_delete(dictionary); */ diff --git a/src/grib_accessor_class_number_of_points_gaussian.c b/src/grib_accessor_class_number_of_points_gaussian.c index cc84a1ea3..128234feb 100644 --- a/src/grib_accessor_class_number_of_points_gaussian.c +++ b/src/grib_accessor_class_number_of_points_gaussian.c @@ -338,7 +338,6 @@ static int unpack_long_new(grib_accessor* a, long* val, size_t* len) int is_global = 0; long ni = 0, nj = 0, plpresent = 0, order = 0; size_t plsize = 0; - double* lats = {0,}; double lat_first, lat_last, lon_first, lon_last; long* pl = NULL; long* plsave = NULL; @@ -370,7 +369,6 @@ static int unpack_long_new(grib_accessor* a, long* val, size_t* len) if (plpresent) { long max_pl = 0; - float d = 0; int j = 0; double lon_first_row = 0, lon_last_row = 0; @@ -386,10 +384,6 @@ static int unpack_long_new(grib_accessor* a, long* val, size_t* len) if ((ret = grib_get_double_internal(h, self->lon_last, &lon_last)) != GRIB_SUCCESS) return ret; - lats = (double*)grib_context_malloc(a->context, sizeof(double) * order * 2); - if ((ret = grib_get_gaussian_latitudes(order, lats)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_size(h, self->pl, &plsize)) != GRIB_SUCCESS) return ret; @@ -410,14 +404,12 @@ static int unpack_long_new(grib_accessor* a, long* val, size_t* len) max_pl = pl[j]; } - d = fabs(lats[0] - lats[1]); is_global = 0; /* ECC-445 */ correctWestEast(max_pl, angular_precision, &lon_first, &lon_last); if (!is_global) { /*sub area*/ - (void)d; *val = 0; for (j = 0; j < nj; j++) { row_count = 0; @@ -440,8 +432,6 @@ static int unpack_long_new(grib_accessor* a, long* val, size_t* len) /*regular*/ *val = ni * nj; } - if (lats) - grib_context_free(c, lats); if (plsave) grib_context_free(c, plsave); @@ -455,7 +445,6 @@ static int unpack_long_with_legacy_support(grib_accessor* a, long* val, size_t* int is_global = 0; long ni = 0, nj = 0, plpresent = 0, order = 0; size_t plsize = 0; - double* lats = {0,}; double lat_first, lat_last, lon_first, lon_last; long* pl = NULL; long* plsave = NULL; @@ -487,8 +476,7 @@ static int unpack_long_with_legacy_support(grib_accessor* a, long* val, size_t* } if (plpresent) { - long max_pl = 0; - float d = 0; + long max_pl = 0; int j = 0; double lon_first_row = 0, lon_last_row = 0; @@ -504,10 +492,6 @@ static int unpack_long_with_legacy_support(grib_accessor* a, long* val, size_t* if ((ret = grib_get_double_internal(h, self->lon_last, &lon_last)) != GRIB_SUCCESS) return ret; - lats = (double*)grib_context_malloc(a->context, sizeof(double) * order * 2); - if ((ret = grib_get_gaussian_latitudes(order, lats)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_size(h, self->pl, &plsize)) != GRIB_SUCCESS) return ret; @@ -529,14 +513,12 @@ static int unpack_long_with_legacy_support(grib_accessor* a, long* val, size_t* } /*is_global=is_gaussian_global(lat_first,lat_last,lon_first,lon_last,max_pl,lats,angular_precision);*/ - d = fabs(lats[0] - lats[1]); is_global = 0; /* ECC-445 */ correctWestEast(max_pl, angular_precision, &lon_first, &lon_last); if (!is_global) { /*sub area*/ - (void)d; #if EFDEBUG printf("-------- subarea fabs(lat_first-lats[0])=%g d=%g\n", fabs(lat_first - lats[0]), d); printf("-------- subarea fabs(lat_last+lats[0])=%g d=%g\n", fabs(lat_last + lats[0]), d); @@ -584,8 +566,7 @@ static int unpack_long_with_legacy_support(grib_accessor* a, long* val, size_t* for (i = 0; i < plsize; i++) printf(" DEBUG: pl[%d]=%ld\n", i, pl[i]); #endif - if (lats) - grib_context_free(c, lats); + if (plsave) grib_context_free(c, plsave); diff --git a/src/grib_dumper_class_bufr_encode_fortran.c b/src/grib_dumper_class_bufr_encode_fortran.c index 5bf86c199..3d08852f0 100644 --- a/src/grib_dumper_class_bufr_encode_fortran.c +++ b/src/grib_dumper_class_bufr_encode_fortran.c @@ -139,7 +139,7 @@ static int destroy(grib_dumper* d) { grib_dumper_bufr_encode_fortran* self = (grib_dumper_bufr_encode_fortran*)d; grib_string_list* next = self->keys; - grib_string_list* cur = self->keys; + grib_string_list* cur = NULL; grib_context* c = d->handle->context; while (next) { cur = next; @@ -266,9 +266,8 @@ static void dump_values(grib_dumper* d, grib_accessor* a) } if (icount > cols || i == 0) { fprintf(self->dumper.out, " &\n "); - icount = 0; } - sval = dval_to_string(c, values[i]); + sval = dval_to_string(c, values[size - 1]); fprintf(self->dumper.out, "%s", sval); grib_context_free(c, sval); @@ -360,9 +359,8 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* } if (icount > cols || i == 0) { fprintf(self->dumper.out, " &\n "); - icount = 0; } - sval = dval_to_string(c, values[i]); + sval = dval_to_string(c, values[size - 1]); fprintf(self->dumper.out, "%s", sval); grib_context_free(c, sval); @@ -465,7 +463,7 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) fprintf(self->dumper.out, " &\n "); icount = 0; } - fprintf(self->dumper.out, "%ld ", values[i]); + fprintf(self->dumper.out, "%ld ", values[size - 1]); depth -= 2; fprintf(self->dumper.out, "/)\n"); @@ -573,9 +571,8 @@ static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* pr } if (icount > cols || i == 0) { fprintf(self->dumper.out, " &\n "); - icount = 0; } - fprintf(self->dumper.out, "%ld ", values[i]); + fprintf(self->dumper.out, "%ld ", values[size - 1]); depth -= 2; fprintf(self->dumper.out, "/)\n"); @@ -692,7 +689,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm for (i = 0; i < size - 1; i++) { fprintf(self->dumper.out, " \"%s\", &\n", values[i]); } - fprintf(self->dumper.out, " \"%s\" /)\n", values[i]); + fprintf(self->dumper.out, " \"%s\" /)\n", values[size - 1]); if (self->isLeaf == 0) { if ((r = compute_bufr_key_rank(h, self->keys, a->name)) != 0) @@ -731,10 +728,11 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) size_t size = 0; grib_context* c = a->context; int r; - int err = _grib_get_string_length(a, &size); + int err = 0; grib_handle* h = grib_handle_of_accessor(a); const char* acc_name = a->name; + _grib_get_string_length(a, &size); if (size == 0) return; diff --git a/src/grib_geography.c b/src/grib_geography.c index f993952ee..a7cb2e0e7 100644 --- a/src/grib_geography.c +++ b/src/grib_geography.c @@ -99,9 +99,3861 @@ static void gauss_first_guess(long trunc, double* vals) } } +/* Performance: return the precomputed latitudes for N=1280 */ +static int get_precomputed_latitudes_N1280(double* lats) +{ + lats[0]=89.946187715665616; + lats[1]=89.876478353332288; + lats[2]=89.806357319542244; + lats[3]=89.736143271609578; + lats[4]=89.6658939412157; + lats[5]=89.595627537554492; + lats[6]=89.525351592371393; + lats[7]=89.45506977912261; + lats[8]=89.3847841013921; + lats[9]=89.314495744374256; + lats[10]=89.24420545380525; + lats[11]=89.173913722284126; + lats[12]=89.103620888238879; + lats[13]=89.033327191845927; + lats[14]=88.96303280826325; + lats[15]=88.892737868230952; + lats[16]=88.822442471310097; + lats[17]=88.752146694650691; + lats[18]=88.681850598961759; + lats[19]=88.611554232668382; + lats[20]=88.541257634868515; + lats[21]=88.470960837474877; + lats[22]=88.40066386679355; + lats[23]=88.330366744702559; + lats[24]=88.26006948954614; + lats[25]=88.189772116820762; + lats[26]=88.119474639706425; + lats[27]=88.049177069484486; + lats[28]=87.978879415867283; + lats[29]=87.908581687261687; + lats[30]=87.838283890981543; + lats[31]=87.767986033419561; + lats[32]=87.697688120188062; + lats[33]=87.627390156234085; + lats[34]=87.557092145935584; + lats[35]=87.486794093180748; + lats[36]=87.416496001434894; + lats[37]=87.346197873795816; + lats[38]=87.275899713041966; + lats[39]=87.205601521672108; + lats[40]=87.135303301939786; + lats[41]=87.065005055882821; + lats[42]=86.994706785348129; + lats[43]=86.924408492014166; + lats[44]=86.854110177408927; + lats[45]=86.783811842927179; + lats[46]=86.713513489844246; + lats[47]=86.643215119328573; + lats[48]=86.572916732453024; + lats[49]=86.502618330203831; + lats[50]=86.432319913489792; + lats[51]=86.362021483149363; + lats[52]=86.291723039957418; + lats[53]=86.221424584631109; + lats[54]=86.151126117835304; + lats[55]=86.080827640187209; + lats[56]=86.010529152260403; + lats[57]=85.940230654588888; + lats[58]=85.869932147670127; + lats[59]=85.799633631968391; + lats[60]=85.729335107917464; + lats[61]=85.659036575922883; + lats[62]=85.588738036364362; + lats[63]=85.518439489597966; + lats[64]=85.448140935957483; + lats[65]=85.377842375756586; + lats[66]=85.307543809290152; + lats[67]=85.237245236835548; + lats[68]=85.16694665865414; + lats[69]=85.09664807499216; + lats[70]=85.026349486081983; + lats[71]=84.95605089214304; + lats[72]=84.885752293382765; + lats[73]=84.81545368999717; + lats[74]=84.745155082171991; + lats[75]=84.674856470082915; + lats[76]=84.604557853896708; + lats[77]=84.534259233771479; + lats[78]=84.463960609857125; + lats[79]=84.393661982296322; + lats[80]=84.323363351224444; + lats[81]=84.253064716770425; + lats[82]=84.18276607905679; + lats[83]=84.112467438200326; + lats[84]=84.042168794312317; + lats[85]=83.971870147498763; + lats[86]=83.901571497860914; + lats[87]=83.831272845495249; + lats[88]=83.760974190494011; + lats[89]=83.690675532945292; + lats[90]=83.620376872933264; + lats[91]=83.550078210538487; + lats[92]=83.479779545838113; + lats[93]=83.409480878905782; + lats[94]=83.339182209812321; + lats[95]=83.268883538625232; + lats[96]=83.198584865409657; + lats[97]=83.128286190227698; + lats[98]=83.057987513139125; + lats[99]=82.987688834201322; + lats[100]=82.917390153469313; + lats[101]=82.84709147099602; + lats[102]=82.77679278683226; + lats[103]=82.706494101026948; + lats[104]=82.63619541362705; + lats[105]=82.56589672467787; + lats[106]=82.495598034222837; + lats[107]=82.425299342304029; + lats[108]=82.355000648961692; + lats[109]=82.284701954234833; + lats[110]=82.214403258160871; + lats[111]=82.144104560776; + lats[112]=82.073805862115165; + lats[113]=82.003507162211946; + lats[114]=81.933208461098829; + lats[115]=81.862909758807191; + lats[116]=81.792611055367345; + lats[117]=81.722312350808508; + lats[118]=81.652013645158945; + lats[119]=81.581714938445955; + lats[120]=81.511416230696042; + lats[121]=81.441117521934686; + lats[122]=81.370818812186627; + lats[123]=81.300520101475826; + lats[124]=81.230221389825374; + lats[125]=81.159922677257711; + lats[126]=81.089623963794551; + lats[127]=81.019325249456955; + lats[128]=80.949026534265244; + lats[129]=80.878727818239184; + lats[130]=80.808429101397948; + lats[131]=80.73813038376008; + lats[132]=80.667831665343556; + lats[133]=80.59753294616587; + lats[134]=80.527234226243991; + lats[135]=80.456935505594302; + lats[136]=80.386636784232863; + lats[137]=80.316338062175078; + lats[138]=80.246039339436052; + lats[139]=80.175740616030438; + lats[140]=80.105441891972376; + lats[141]=80.035143167275749; + lats[142]=79.9648444419539; + lats[143]=79.894545716019948; + lats[144]=79.824246989486554; + lats[145]=79.753948262366038; + lats[146]=79.683649534670437; + lats[147]=79.61335080641139; + lats[148]=79.543052077600308; + lats[149]=79.472753348248219; + lats[150]=79.402454618365894; + lats[151]=79.332155887963822; + lats[152]=79.261857157052191; + lats[153]=79.191558425640977; + lats[154]=79.121259693739859; + lats[155]=79.050960961358285; + lats[156]=78.980662228505423; + lats[157]=78.910363495190211; + lats[158]=78.840064761421445; + lats[159]=78.769766027207638; + lats[160]=78.699467292557102; + lats[161]=78.629168557477882; + lats[162]=78.558869821977908; + lats[163]=78.488571086064923; + lats[164]=78.418272349746417; + lats[165]=78.347973613029708; + lats[166]=78.277674875922045; + lats[167]=78.207376138430348; + lats[168]=78.137077400561424; + lats[169]=78.066778662322022; + lats[170]=77.996479923718596; + lats[171]=77.926181184757539; + lats[172]=77.855882445445019; + lats[173]=77.785583705787161; + lats[174]=77.71528496578982; + lats[175]=77.644986225458879; + lats[176]=77.574687484799924; + lats[177]=77.504388743818524; + lats[178]=77.434090002520122; + lats[179]=77.363791260909963; + lats[180]=77.293492518993247; + lats[181]=77.22319377677502; + lats[182]=77.15289503426024; + lats[183]=77.082596291453768; + lats[184]=77.012297548360323; + lats[185]=76.941998804984564; + lats[186]=76.871700061330955; + lats[187]=76.801401317404; + lats[188]=76.731102573208048; + lats[189]=76.660803828747362; + lats[190]=76.59050508402602; + lats[191]=76.520206339048215; + lats[192]=76.449907593817869; + lats[193]=76.379608848338933; + lats[194]=76.3093101026152; + lats[195]=76.239011356650423; + lats[196]=76.16871261044831; + lats[197]=76.098413864012443; + lats[198]=76.028115117346374; + lats[199]=75.957816370453543; + lats[200]=75.887517623337317; + lats[201]=75.81721887600105; + lats[202]=75.746920128447996; + lats[203]=75.67662138068134; + lats[204]=75.60632263270422; + lats[205]=75.536023884519707; + lats[206]=75.465725136130786; + lats[207]=75.395426387540439; + lats[208]=75.325127638751567; + lats[209]=75.254828889766983; + lats[210]=75.184530140589501; + lats[211]=75.114231391221821; + lats[212]=75.043932641666672; + lats[213]=74.973633891926625; + lats[214]=74.903335142004323; + lats[215]=74.833036391902269; + lats[216]=74.762737641622991; + lats[217]=74.692438891168877; + lats[218]=74.622140140542356; + lats[219]=74.551841389745761; + lats[220]=74.481542638781434; + lats[221]=74.411243887651622; + lats[222]=74.340945136358584; + lats[223]=74.270646384904481; + lats[224]=74.200347633291472; + lats[225]=74.13004888152166; + lats[226]=74.059750129597163; + lats[227]=73.98945137751997; + lats[228]=73.919152625292114; + lats[229]=73.848853872915541; + lats[230]=73.778555120392184; + lats[231]=73.70825636772399; + lats[232]=73.637957614912779; + lats[233]=73.567658861960396; + lats[234]=73.497360108868662; + lats[235]=73.427061355639339; + lats[236]=73.356762602274188; + lats[237]=73.2864638487749; + lats[238]=73.216165095143182; + lats[239]=73.145866341380668; + lats[240]=73.075567587489019; + lats[241]=73.005268833469799; + lats[242]=72.934970079324657; + lats[243]=72.864671325055056; + lats[244]=72.794372570662574; + lats[245]=72.724073816148703; + lats[246]=72.653775061514935; + lats[247]=72.583476306762691; + lats[248]=72.513177551893421; + lats[249]=72.442878796908545; + lats[250]=72.3725800418094; + lats[251]=72.302281286597392; + lats[252]=72.231982531273843; + lats[253]=72.161683775840089; + lats[254]=72.091385020297409; + lats[255]=72.02108626464711; + lats[256]=71.950787508890414; + lats[257]=71.880488753028587; + lats[258]=71.810189997062835; + lats[259]=71.739891240994368; + lats[260]=71.669592484824364; + lats[261]=71.599293728553988; + lats[262]=71.528994972184378; + lats[263]=71.458696215716685; + lats[264]=71.388397459152031; + lats[265]=71.318098702491469; + lats[266]=71.247799945736105; + lats[267]=71.177501188887007; + lats[268]=71.107202431945211; + lats[269]=71.036903674911756; + lats[270]=70.966604917787635; + lats[271]=70.896306160573886; + lats[272]=70.826007403271475; + lats[273]=70.755708645881384; + lats[274]=70.685409888404578; + lats[275]=70.615111130841967; + lats[276]=70.544812373194532; + lats[277]=70.474513615463138; + lats[278]=70.404214857648739; + lats[279]=70.333916099752187; + lats[280]=70.263617341774406; + lats[281]=70.193318583716191; + lats[282]=70.123019825578467; + lats[283]=70.052721067362043; + lats[284]=69.982422309067744; + lats[285]=69.912123550696421; + lats[286]=69.841824792248843; + lats[287]=69.771526033725834; + lats[288]=69.701227275128161; + lats[289]=69.630928516456592; + lats[290]=69.560629757711908; + lats[291]=69.490330998894862; + lats[292]=69.420032240006194; + lats[293]=69.349733481046613; + lats[294]=69.279434722016902; + lats[295]=69.209135962917699; + lats[296]=69.138837203749759; + lats[297]=69.068538444513763; + lats[298]=68.998239685210365; + lats[299]=68.927940925840304; + lats[300]=68.85764216640419; + lats[301]=68.787343406902693; + lats[302]=68.717044647336493; + lats[303]=68.646745887706189; + lats[304]=68.576447128012447; + lats[305]=68.506148368255865; + lats[306]=68.435849608437067; + lats[307]=68.365550848556666; + lats[308]=68.295252088615257; + lats[309]=68.224953328613438; + lats[310]=68.154654568551791; + lats[311]=68.084355808430871; + lats[312]=68.014057048251274; + lats[313]=67.943758288013555; + lats[314]=67.873459527718282; + lats[315]=67.803160767365966; + lats[316]=67.732862006957205; + lats[317]=67.662563246492482; + lats[318]=67.592264485972336; + lats[319]=67.521965725397308; + lats[320]=67.451666964767895; + lats[321]=67.381368204084609; + lats[322]=67.311069443347961; + lats[323]=67.240770682558434; + lats[324]=67.170471921716526; + lats[325]=67.100173160822706; + lats[326]=67.029874399877471; + lats[327]=66.95957563888129; + lats[328]=66.889276877834618; + lats[329]=66.818978116737924; + lats[330]=66.748679355591662; + lats[331]=66.678380594396273; + lats[332]=66.608081833152212; + lats[333]=66.537783071859891; + lats[334]=66.467484310519808; + lats[335]=66.397185549132331; + lats[336]=66.326886787697887; + lats[337]=66.256588026216932; + lats[338]=66.186289264689833; + lats[339]=66.115990503117033; + lats[340]=66.045691741498899; + lats[341]=65.975392979835888; + lats[342]=65.905094218128355; + lats[343]=65.834795456376696; + lats[344]=65.764496694581283; + lats[345]=65.694197932742526; + lats[346]=65.623899170860767; + lats[347]=65.553600408936404; + lats[348]=65.483301646969792; + lats[349]=65.413002884961315; + lats[350]=65.342704122911286; + lats[351]=65.272405360820116; + lats[352]=65.202106598688133; + lats[353]=65.131807836515677; + lats[354]=65.061509074303089; + lats[355]=64.991210312050711; + lats[356]=64.920911549758912; + lats[357]=64.850612787427963; + lats[358]=64.780314025058246; + lats[359]=64.710015262650074; + lats[360]=64.639716500203733; + lats[361]=64.569417737719576; + lats[362]=64.499118975197902; + lats[363]=64.428820212639039; + lats[364]=64.358521450043284; + lats[365]=64.288222687410922; + lats[366]=64.21792392474228; + lats[367]=64.147625162037642; + lats[368]=64.07732639929732; + lats[369]=64.00702763652157; + lats[370]=63.93672887371072; + lats[371]=63.866430110865004; + lats[372]=63.796131347984762; + lats[373]=63.725832585070251; + lats[374]=63.655533822121711; + lats[375]=63.585235059139464; + lats[376]=63.514936296123757; + lats[377]=63.444637533074854; + lats[378]=63.374338769993031; + lats[379]=63.304040006878537; + lats[380]=63.23374124373165; + lats[381]=63.163442480552604; + lats[382]=63.093143717341647; + lats[383]=63.022844954099064; + lats[384]=62.952546190825068; + lats[385]=62.882247427519928; + lats[386]=62.811948664183866; + lats[387]=62.741649900817137; + lats[388]=62.67135113741999; + lats[389]=62.60105237399263; + lats[390]=62.530753610535321; + lats[391]=62.460454847048261; + lats[392]=62.3901560835317; + lats[393]=62.319857319985871; + lats[394]=62.249558556410982; + lats[395]=62.179259792807258; + lats[396]=62.108961029174914; + lats[397]=62.038662265514176; + lats[398]=61.968363501825259; + lats[399]=61.898064738108381; + lats[400]=61.827765974363729; + lats[401]=61.757467210591535; + lats[402]=61.687168446791986; + lats[403]=61.616869682965287; + lats[404]=61.546570919111666; + lats[405]=61.476272155231321; + lats[406]=61.405973391324409; + lats[407]=61.335674627391185; + lats[408]=61.265375863431785; + lats[409]=61.195077099446451; + lats[410]=61.124778335435344; + lats[411]=61.054479571398652; + lats[412]=60.984180807336578; + lats[413]=60.913882043249295; + lats[414]=60.843583279137007; + lats[415]=60.773284514999872; + lats[416]=60.702985750838074; + lats[417]=60.632686986651805; + lats[418]=60.562388222441243; + lats[419]=60.492089458206543; + lats[420]=60.421790693947884; + lats[421]=60.35149192966545; + lats[422]=60.28119316535939; + lats[423]=60.21089440102989; + lats[424]=60.140595636677112; + lats[425]=60.070296872301235; + lats[426]=59.999998107902378; + lats[427]=59.929699343480763; + lats[428]=59.859400579036503; + lats[429]=59.78910181456979; + lats[430]=59.718803050080759; + lats[431]=59.64850428556958; + lats[432]=59.578205521036402; + lats[433]=59.507906756481383; + lats[434]=59.43760799190467; + lats[435]=59.3673092273064; + lats[436]=59.29701046268675; + lats[437]=59.226711698045854; + lats[438]=59.156412933383855; + lats[439]=59.086114168700909; + lats[440]=59.015815403997145; + lats[441]=58.945516639272725; + lats[442]=58.875217874527763; + lats[443]=58.804919109762423; + lats[444]=58.73462034497684; + lats[445]=58.664321580171141; + lats[446]=58.594022815345468; + lats[447]=58.523724050499972; + lats[448]=58.453425285634758; + lats[449]=58.383126520749968; + lats[450]=58.312827755845746; + lats[451]=58.242528990922203; + lats[452]=58.172230225979497; + lats[453]=58.101931461017728; + lats[454]=58.031632696037022; + lats[455]=57.961333931037537; + lats[456]=57.891035166019364; + lats[457]=57.820736400982646; + lats[458]=57.75043763592749; + lats[459]=57.680138870854037; + lats[460]=57.60984010576238; + lats[461]=57.539541340652676; + lats[462]=57.469242575525016; + lats[463]=57.398943810379521; + lats[464]=57.328645045216312; + lats[465]=57.258346280035504; + lats[466]=57.188047514837208; + lats[467]=57.117748749621541; + lats[468]=57.047449984388614; + lats[469]=56.977151219138541; + lats[470]=56.90685245387143; + lats[471]=56.836553688587379; + lats[472]=56.766254923286517; + lats[473]=56.695956157968951; + lats[474]=56.625657392634771; + lats[475]=56.555358627284086; + lats[476]=56.485059861917016; + lats[477]=56.41476109653366; + lats[478]=56.34446233113411; + lats[479]=56.274163565718467; + lats[480]=56.203864800286865; + lats[481]=56.133566034839362; + lats[482]=56.063267269376091; + lats[483]=55.992968503897131; + lats[484]=55.922669738402583; + lats[485]=55.852370972892551; + lats[486]=55.782072207367136; + lats[487]=55.711773441826416; + lats[488]=55.641474676270505; + lats[489]=55.571175910699488; + lats[490]=55.500877145113449; + lats[491]=55.430578379512511; + lats[492]=55.360279613896743; + lats[493]=55.289980848266232; + lats[494]=55.219682082621084; + lats[495]=55.149383316961377; + lats[496]=55.07908455128721; + lats[497]=55.008785785598668; + lats[498]=54.938487019895831; + lats[499]=54.868188254178797; + lats[500]=54.797889488447652; + lats[501]=54.727590722702473; + lats[502]=54.657291956943347; + lats[503]=54.586993191170357; + lats[504]=54.516694425383605; + lats[505]=54.446395659583146; + lats[506]=54.376096893769081; + lats[507]=54.305798127941479; + lats[508]=54.235499362100448; + lats[509]=54.165200596246031; + lats[510]=54.094901830378333; + lats[511]=54.024603064497434; + lats[512]=53.954304298603383; + lats[513]=53.884005532696307; + lats[514]=53.813706766776235; + lats[515]=53.743408000843282; + lats[516]=53.673109234897495; + lats[517]=53.602810468938962; + lats[518]=53.53251170296776; + lats[519]=53.462212936983953; + lats[520]=53.391914170987633; + lats[521]=53.321615404978871; + lats[522]=53.251316638957725; + lats[523]=53.181017872924265; + lats[524]=53.110719106878584; + lats[525]=53.040420340820731; + lats[526]=52.970121574750792; + lats[527]=52.899822808668837; + lats[528]=52.829524042574917; + lats[529]=52.759225276469131; + lats[530]=52.688926510351514; + lats[531]=52.618627744222159; + lats[532]=52.548328978081123; + lats[533]=52.478030211928477; + lats[534]=52.407731445764284; + lats[535]=52.337432679588609; + lats[536]=52.26713391340153; + lats[537]=52.196835147203096; + lats[538]=52.126536380993372; + lats[539]=52.056237614772435; + lats[540]=51.985938848540336; + lats[541]=51.915640082297152; + lats[542]=51.845341316042933; + lats[543]=51.775042549777737; + lats[544]=51.704743783501634; + lats[545]=51.634445017214695; + lats[546]=51.56414625091697; + lats[547]=51.493847484608516; + lats[548]=51.423548718289396; + lats[549]=51.353249951959683; + lats[550]=51.282951185619417; + lats[551]=51.21265241926865; + lats[552]=51.14235365290746; + lats[553]=51.072054886535909; + lats[554]=51.001756120154049; + lats[555]=50.931457353761914; + lats[556]=50.86115858735959; + lats[557]=50.790859820947119; + lats[558]=50.720561054524559; + lats[559]=50.650262288091959; + lats[560]=50.579963521649397; + lats[561]=50.509664755196901; + lats[562]=50.439365988734544; + lats[563]=50.369067222262359; + lats[564]=50.298768455780426; + lats[565]=50.228469689288779; + lats[566]=50.158170922787484; + lats[567]=50.087872156276575; + lats[568]=50.017573389756123; + lats[569]=49.947274623226157; + lats[570]=49.876975856686762; + lats[571]=49.80667709013796; + lats[572]=49.736378323579807; + lats[573]=49.66607955701236; + lats[574]=49.595780790435676; + lats[575]=49.525482023849783; + lats[576]=49.455183257254745; + lats[577]=49.384884490650613; + lats[578]=49.314585724037435; + lats[579]=49.244286957415234; + lats[580]=49.173988190784094; + lats[581]=49.103689424144044; + lats[582]=49.03339065749514; + lats[583]=48.963091890837418; + lats[584]=48.892793124170929; + lats[585]=48.822494357495721; + lats[586]=48.752195590811837; + lats[587]=48.681896824119335; + lats[588]=48.611598057418242; + lats[589]=48.541299290708608; + lats[590]=48.47100052399049; + lats[591]=48.400701757263917; + lats[592]=48.330402990528938; + lats[593]=48.260104223785596; + lats[594]=48.189805457033941; + lats[595]=48.119506690274015; + lats[596]=48.049207923505868; + lats[597]=47.978909156729507; + lats[598]=47.908610389945018; + lats[599]=47.838311623152421; + lats[600]=47.76801285635176; + lats[601]=47.697714089543084; + lats[602]=47.627415322726435; + lats[603]=47.557116555901828; + lats[604]=47.486817789069342; + lats[605]=47.416519022228997; + lats[606]=47.346220255380835; + lats[607]=47.275921488524894; + lats[608]=47.205622721661214; + lats[609]=47.13532395478984; + lats[610]=47.065025187910805; + lats[611]=46.994726421024154; + lats[612]=46.924427654129929; + lats[613]=46.85412888722815; + lats[614]=46.783830120318882; + lats[615]=46.713531353402139; + lats[616]=46.643232586477971; + lats[617]=46.572933819546414; + lats[618]=46.502635052607502; + lats[619]=46.432336285661272; + lats[620]=46.362037518707766; + lats[621]=46.291738751747012; + lats[622]=46.221439984779053; + lats[623]=46.151141217803925; + lats[624]=46.080842450821663; + lats[625]=46.01054368383231; + lats[626]=45.94024491683588; + lats[627]=45.869946149832437; + lats[628]=45.799647382821995; + lats[629]=45.729348615804589; + lats[630]=45.659049848780263; + lats[631]=45.588751081749038; + lats[632]=45.51845231471097; + lats[633]=45.448153547666081; + lats[634]=45.377854780614399; + lats[635]=45.30755601355596; + lats[636]=45.237257246490813; + lats[637]=45.166958479418959; + lats[638]=45.096659712340461; + lats[639]=45.026360945255341; + lats[640]=44.956062178163634; + lats[641]=44.885763411065362; + lats[642]=44.81546464396056; + lats[643]=44.745165876849271; + lats[644]=44.674867109731515; + lats[645]=44.604568342607337; + lats[646]=44.534269575476756; + lats[647]=44.463970808339802; + lats[648]=44.39367204119651; + lats[649]=44.323373274046915; + lats[650]=44.253074506891046; + lats[651]=44.182775739728925; + lats[652]=44.112476972560586; + lats[653]=44.042178205386072; + lats[654]=43.971879438205391; + lats[655]=43.9015806710186; + lats[656]=43.831281903825705; + lats[657]=43.760983136626741; + lats[658]=43.690684369421732; + lats[659]=43.620385602210717; + lats[660]=43.550086834993728; + lats[661]=43.479788067770777; + lats[662]=43.409489300541907; + lats[663]=43.339190533307139; + lats[664]=43.26889176606651; + lats[665]=43.19859299882004; + lats[666]=43.128294231567757; + lats[667]=43.057995464309691; + lats[668]=42.987696697045862; + lats[669]=42.917397929776307; + lats[670]=42.847099162501053; + lats[671]=42.776800395220121; + lats[672]=42.706501627933541; + lats[673]=42.63620286064134; + lats[674]=42.565904093343548; + lats[675]=42.495605326040177; + lats[676]=42.425306558731272; + lats[677]=42.355007791416853; + lats[678]=42.284709024096927; + lats[679]=42.214410256771551; + lats[680]=42.144111489440725; + lats[681]=42.073812722104492; + lats[682]=42.003513954762873; + lats[683]=41.933215187415882; + lats[684]=41.862916420063563; + lats[685]=41.792617652705921; + lats[686]=41.722318885343; + lats[687]=41.6520201179748; + lats[688]=41.581721350601363; + lats[689]=41.511422583222718; + lats[690]=41.441123815838885; + lats[691]=41.370825048449873; + lats[692]=41.300526281055724; + lats[693]=41.230227513656445; + lats[694]=41.159928746252085; + lats[695]=41.089629978842645; + lats[696]=41.01933121142816; + lats[697]=40.949032444008644; + lats[698]=40.878733676584126; + lats[699]=40.808434909154634; + lats[700]=40.738136141720176; + lats[701]=40.667837374280786; + lats[702]=40.597538606836487; + lats[703]=40.527239839387299; + lats[704]=40.456941071933244; + lats[705]=40.386642304474343; + lats[706]=40.316343537010617; + lats[707]=40.246044769542102; + lats[708]=40.175746002068806; + lats[709]=40.105447234590748; + lats[710]=40.035148467107952; + lats[711]=39.964849699620437; + lats[712]=39.894550932128247; + lats[713]=39.824252164631375; + lats[714]=39.753953397129855; + lats[715]=39.683654629623703; + lats[716]=39.613355862112947; + lats[717]=39.543057094597607; + lats[718]=39.472758327077692; + lats[719]=39.402459559553229; + lats[720]=39.332160792024254; + lats[721]=39.261862024490775; + lats[722]=39.191563256952804; + lats[723]=39.121264489410365; + lats[724]=39.050965721863491; + lats[725]=38.980666954312184; + lats[726]=38.910368186756479; + lats[727]=38.840069419196389; + lats[728]=38.769770651631937; + lats[729]=38.699471884063136; + lats[730]=38.629173116490001; + lats[731]=38.558874348912568; + lats[732]=38.488575581330842; + lats[733]=38.418276813744846; + lats[734]=38.347978046154608; + lats[735]=38.277679278560143; + lats[736]=38.20738051096145; + lats[737]=38.137081743358586; + lats[738]=38.066782975751536; + lats[739]=37.99648420814033; + lats[740]=37.926185440524989; + lats[741]=37.855886672905527; + lats[742]=37.785587905281965; + lats[743]=37.715289137654317; + lats[744]=37.644990370022605; + lats[745]=37.574691602386856; + lats[746]=37.504392834747065; + lats[747]=37.434094067103274; + lats[748]=37.363795299455489; + lats[749]=37.293496531803719; + lats[750]=37.223197764147997; + lats[751]=37.152898996488332; + lats[752]=37.082600228824752; + lats[753]=37.012301461157264; + lats[754]=36.942002693485883; + lats[755]=36.871703925810628; + lats[756]=36.801405158131523; + lats[757]=36.731106390448581; + lats[758]=36.660807622761808; + lats[759]=36.590508855071242; + lats[760]=36.520210087376888; + lats[761]=36.449911319678755; + lats[762]=36.379612551976876; + lats[763]=36.309313784271254; + lats[764]=36.239015016561908; + lats[765]=36.16871624884886; + lats[766]=36.098417481132117; + lats[767]=36.028118713411708; + lats[768]=35.957819945687639; + lats[769]=35.887521177959933; + lats[770]=35.817222410228595; + lats[771]=35.746923642493655; + lats[772]=35.676624874755113; + lats[773]=35.606326107012997; + lats[774]=35.536027339267314; + lats[775]=35.465728571518085; + lats[776]=35.395429803765317; + lats[777]=35.325131036009047; + lats[778]=35.254832268249267; + lats[779]=35.184533500486005; + lats[780]=35.114234732719261; + lats[781]=35.043935964949064; + lats[782]=34.973637197175435; + lats[783]=34.903338429398374; + lats[784]=34.833039661617903; + lats[785]=34.762740893834028; + lats[786]=34.692442126046771; + lats[787]=34.622143358256153; + lats[788]=34.551844590462188; + lats[789]=34.481545822664863; + lats[790]=34.411247054864234; + lats[791]=34.340948287060286; + lats[792]=34.270649519253041; + lats[793]=34.200350751442521; + lats[794]=34.130051983628725; + lats[795]=34.059753215811682; + lats[796]=33.989454447991392; + lats[797]=33.919155680167876; + lats[798]=33.848856912341155; + lats[799]=33.778558144511237; + lats[800]=33.708259376678136; + lats[801]=33.637960608841851; + lats[802]=33.567661841002426; + lats[803]=33.497363073159853; + lats[804]=33.42706430531414; + lats[805]=33.356765537465314; + lats[806]=33.286466769613391; + lats[807]=33.216168001758369; + lats[808]=33.145869233900278; + lats[809]=33.075570466039117; + lats[810]=33.005271698174909; + lats[811]=32.934972930307666; + lats[812]=32.864674162437396; + lats[813]=32.794375394564113; + lats[814]=32.724076626687825; + lats[815]=32.653777858808567; + lats[816]=32.583479090926325; + lats[817]=32.513180323041112; + lats[818]=32.442881555152965; + lats[819]=32.372582787261891; + lats[820]=32.302284019367875; + lats[821]=32.231985251470959; + lats[822]=32.161686483571145; + lats[823]=32.091387715668439; + lats[824]=32.021088947762863; + lats[825]=31.950790179854422; + lats[826]=31.880491411943137; + lats[827]=31.810192644029012; + lats[828]=31.739893876112063; + lats[829]=31.669595108192297; + lats[830]=31.599296340269738; + lats[831]=31.528997572344384; + lats[832]=31.458698804416255; + lats[833]=31.388400036485361; + lats[834]=31.318101268551715; + lats[835]=31.247802500615318; + lats[836]=31.177503732676204; + lats[837]=31.107204964734358; + lats[838]=31.036906196789811; + lats[839]=30.966607428842572; + lats[840]=30.896308660892647; + lats[841]=30.826009892940046; + lats[842]=30.755711124984781; + lats[843]=30.685412357026873; + lats[844]=30.615113589066322; + lats[845]=30.544814821103138; + lats[846]=30.47451605313735; + lats[847]=30.404217285168947; + lats[848]=30.333918517197947; + lats[849]=30.263619749224372; + lats[850]=30.19332098124822; + lats[851]=30.123022213269511; + lats[852]=30.052723445288244; + lats[853]=29.98242467730444; + lats[854]=29.91212590931811; + lats[855]=29.841827141329258; + lats[856]=29.771528373337894; + lats[857]=29.701229605344039; + lats[858]=29.630930837347698; + lats[859]=29.560632069348884; + lats[860]=29.490333301347597; + lats[861]=29.420034533343859; + lats[862]=29.349735765337677; + lats[863]=29.279436997329057; + lats[864]=29.209138229318015; + lats[865]=29.138839461304556; + lats[866]=29.068540693288696; + lats[867]=28.998241925270449; + lats[868]=28.927943157249814; + lats[869]=28.857644389226806; + lats[870]=28.787345621201432; + lats[871]=28.717046853173709; + lats[872]=28.646748085143642; + lats[873]=28.576449317111244; + lats[874]=28.506150549076519; + lats[875]=28.435851781039485; + lats[876]=28.365553013000145; + lats[877]=28.29525424495851; + lats[878]=28.224955476914594; + lats[879]=28.154656708868405; + lats[880]=28.084357940819952; + lats[881]=28.014059172769244; + lats[882]=27.94376040471629; + lats[883]=27.873461636661098; + lats[884]=27.803162868603682; + lats[885]=27.732864100544052; + lats[886]=27.662565332482213; + lats[887]=27.592266564418171; + lats[888]=27.521967796351948; + lats[889]=27.451669028283543; + lats[890]=27.381370260212968; + lats[891]=27.311071492140236; + lats[892]=27.240772724065348; + lats[893]=27.170473955988321; + lats[894]=27.100175187909159; + lats[895]=27.029876419827872; + lats[896]=26.959577651744471; + lats[897]=26.889278883658971; + lats[898]=26.818980115571364; + lats[899]=26.748681347481678; + lats[900]=26.678382579389908; + lats[901]=26.608083811296069; + lats[902]=26.53778504320017; + lats[903]=26.467486275102218; + lats[904]=26.397187507002222; + lats[905]=26.326888738900195; + lats[906]=26.256589970796135; + lats[907]=26.186291202690064; + lats[908]=26.115992434581983; + lats[909]=26.045693666471902; + lats[910]=25.975394898359827; + lats[911]=25.90509613024577; + lats[912]=25.834797362129745; + lats[913]=25.764498594011751; + lats[914]=25.694199825891793; + lats[915]=25.623901057769892; + lats[916]=25.553602289646051; + lats[917]=25.483303521520277; + lats[918]=25.413004753392578; + lats[919]=25.342705985262967; + lats[920]=25.272407217131445; + lats[921]=25.202108448998025; + lats[922]=25.13180968086272; + lats[923]=25.061510912725527; + lats[924]=24.991212144586456; + lats[925]=24.920913376445526; + lats[926]=24.850614608302738; + lats[927]=24.780315840158096; + lats[928]=24.710017072011613; + lats[929]=24.639718303863294; + lats[930]=24.569419535713152; + lats[931]=24.499120767561195; + lats[932]=24.428821999407425; + lats[933]=24.358523231251851; + lats[934]=24.288224463094483; + lats[935]=24.217925694935328; + lats[936]=24.1476269267744; + lats[937]=24.077328158611696; + lats[938]=24.007029390447226; + lats[939]=23.936730622281004; + lats[940]=23.866431854113038; + lats[941]=23.796133085943328; + lats[942]=23.725834317771888; + lats[943]=23.655535549598721; + lats[944]=23.585236781423838; + lats[945]=23.514938013247242; + lats[946]=23.444639245068949; + lats[947]=23.374340476888957; + lats[948]=23.304041708707278; + lats[949]=23.233742940523921; + lats[950]=23.163444172338895; + lats[951]=23.0931454041522; + lats[952]=23.022846635963852; + lats[953]=22.952547867773848; + lats[954]=22.882249099582204; + lats[955]=22.811950331388925; + lats[956]=22.741651563194019; + lats[957]=22.671352794997489; + lats[958]=22.60105402679935; + lats[959]=22.530755258599601; + lats[960]=22.460456490398254; + lats[961]=22.390157722195315; + lats[962]=22.319858953990789; + lats[963]=22.249560185784691; + lats[964]=22.179261417577013; + lats[965]=22.108962649367779; + lats[966]=22.038663881156989; + lats[967]=21.968365112944642; + lats[968]=21.898066344730758; + lats[969]=21.827767576515338; + lats[970]=21.757468808298391; + lats[971]=21.687170040079913; + lats[972]=21.616871271859928; + lats[973]=21.546572503638437; + lats[974]=21.47627373541544; + lats[975]=21.40597496719095; + lats[976]=21.335676198964972; + lats[977]=21.265377430737512; + lats[978]=21.195078662508585; + lats[979]=21.124779894278181; + lats[980]=21.054481126046323; + lats[981]=20.984182357813012; + lats[982]=20.913883589578251; + lats[983]=20.843584821342048; + lats[984]=20.773286053104417; + lats[985]=20.702987284865355; + lats[986]=20.632688516624874; + lats[987]=20.562389748382977; + lats[988]=20.492090980139672; + lats[989]=20.421792211894967; + lats[990]=20.35149344364887; + lats[991]=20.28119467540138; + lats[992]=20.210895907152516; + lats[993]=20.140597138902272; + lats[994]=20.070298370650661; + lats[995]=19.999999602397686; + lats[996]=19.929700834143357; + lats[997]=19.859402065887682; + lats[998]=19.789103297630657; + lats[999]=19.718804529372303; + lats[1000]=19.648505761112613; + lats[1001]=19.578206992851602; + lats[1002]=19.507908224589269; + lats[1003]=19.437609456325632; + lats[1004]=19.367310688060684; + lats[1005]=19.297011919794439; + lats[1006]=19.226713151526898; + lats[1007]=19.15641438325807; + lats[1008]=19.086115614987968; + lats[1009]=19.015816846716586; + lats[1010]=18.945518078443939; + lats[1011]=18.875219310170031; + lats[1012]=18.804920541894862; + lats[1013]=18.734621773618446; + lats[1014]=18.664323005340787; + lats[1015]=18.594024237061891; + lats[1016]=18.523725468781763; + lats[1017]=18.453426700500408; + lats[1018]=18.383127932217832; + lats[1019]=18.312829163934047; + lats[1020]=18.242530395649048; + lats[1021]=18.172231627362851; + lats[1022]=18.101932859075458; + lats[1023]=18.031634090786874; + lats[1024]=17.96133532249711; + lats[1025]=17.89103655420616; + lats[1026]=17.820737785914044; + lats[1027]=17.75043901762076; + lats[1028]=17.680140249326314; + lats[1029]=17.60984148103071; + lats[1030]=17.539542712733962; + lats[1031]=17.469243944436066; + lats[1032]=17.39894517613704; + lats[1033]=17.328646407836878; + lats[1034]=17.258347639535586; + lats[1035]=17.188048871233182; + lats[1036]=17.117750102929655; + lats[1037]=17.04745133462502; + lats[1038]=16.977152566319283; + lats[1039]=16.906853798012452; + lats[1040]=16.836555029704527; + lats[1041]=16.766256261395515; + lats[1042]=16.69595749308542; + lats[1043]=16.625658724774254; + lats[1044]=16.555359956462013; + lats[1045]=16.485061188148713; + lats[1046]=16.41476241983435; + lats[1047]=16.344463651518936; + lats[1048]=16.274164883202477; + lats[1049]=16.203866114884974; + lats[1050]=16.133567346566434; + lats[1051]=16.063268578246863; + lats[1052]=15.992969809926265; + lats[1053]=15.922671041604652; + lats[1054]=15.852372273282016; + lats[1055]=15.78207350495838; + lats[1056]=15.711774736633735; + lats[1057]=15.641475968308091; + lats[1058]=15.571177199981456; + lats[1059]=15.500878431653829; + lats[1060]=15.430579663325226; + lats[1061]=15.360280894995643; + lats[1062]=15.289982126665089; + lats[1063]=15.219683358333569; + lats[1064]=15.149384590001089; + lats[1065]=15.07908582166765; + lats[1066]=15.008787053333259; + lats[1067]=14.938488284997929; + lats[1068]=14.868189516661655; + lats[1069]=14.797890748324447; + lats[1070]=14.727591979986309; + lats[1071]=14.657293211647247; + lats[1072]=14.586994443307265; + lats[1073]=14.516695674966371; + lats[1074]=14.446396906624567; + lats[1075]=14.376098138281863; + lats[1076]=14.305799369938256; + lats[1077]=14.23550060159376; + lats[1078]=14.165201833248371; + lats[1079]=14.0949030649021; + lats[1080]=14.024604296554955; + lats[1081]=13.954305528206934; + lats[1082]=13.884006759858046; + lats[1083]=13.813707991508297; + lats[1084]=13.743409223157688; + lats[1085]=13.673110454806226; + lats[1086]=13.602811686453919; + lats[1087]=13.532512918100766; + lats[1088]=13.46221414974678; + lats[1089]=13.391915381391959; + lats[1090]=13.32161661303631; + lats[1091]=13.251317844679837; + lats[1092]=13.181019076322551; + lats[1093]=13.110720307964451; + lats[1094]=13.040421539605545; + lats[1095]=12.970122771245832; + lats[1096]=12.899824002885323; + lats[1097]=12.829525234524022; + lats[1098]=12.759226466161934; + lats[1099]=12.688927697799061; + lats[1100]=12.618628929435411; + lats[1101]=12.548330161070988; + lats[1102]=12.478031392705796; + lats[1103]=12.407732624339841; + lats[1104]=12.337433855973126; + lats[1105]=12.267135087605659; + lats[1106]=12.196836319237443; + lats[1107]=12.126537550868482; + lats[1108]=12.056238782498781; + lats[1109]=11.985940014128348; + lats[1110]=11.915641245757183; + lats[1111]=11.845342477385294; + lats[1112]=11.775043709012685; + lats[1113]=11.704744940639358; + lats[1114]=11.634446172265324; + lats[1115]=11.564147403890583; + lats[1116]=11.493848635515141; + lats[1117]=11.423549867139002; + lats[1118]=11.35325109876217; + lats[1119]=11.282952330384653; + lats[1120]=11.212653562006453; + lats[1121]=11.142354793627575; + lats[1122]=11.072056025248026; + lats[1123]=11.001757256867807; + lats[1124]=10.931458488486923; + lats[1125]=10.861159720105382; + lats[1126]=10.790860951723188; + lats[1127]=10.720562183340341; + lats[1128]=10.65026341495685; + lats[1129]=10.579964646572719; + lats[1130]=10.509665878187954; + lats[1131]=10.439367109802557; + lats[1132]=10.369068341416533; + lats[1133]=10.298769573029887; + lats[1134]=10.228470804642624; + lats[1135]=10.158172036254747; + lats[1136]=10.087873267866264; + lats[1137]=10.017574499477174; + lats[1138]=9.9472757310874869; + lats[1139]=9.8769769626972046; + lats[1140]=9.8066781943063344; + lats[1141]=9.7363794259148779; + lats[1142]=9.6660806575228388; + lats[1143]=9.5957818891302242; + lats[1144]=9.5254831207370376; + lats[1145]=9.4551843523432826; + lats[1146]=9.3848855839489662; + lats[1147]=9.3145868155540921; + lats[1148]=9.2442880471586619; + lats[1149]=9.1739892787626829; + lats[1150]=9.1036905103661585; + lats[1151]=9.0333917419690941; + lats[1152]=8.963092973571495; + lats[1153]=8.8927942051733631; + lats[1154]=8.8224954367747017; + lats[1155]=8.7521966683755217; + lats[1156]=8.6818978999758194; + lats[1157]=8.6115991315756055; + lats[1158]=8.5413003631748801; + lats[1159]=8.4710015947736537; + lats[1160]=8.4007028263719228; + lats[1161]=8.3304040579696963; + lats[1162]=8.2601052895669778; + lats[1163]=8.1898065211637725; + lats[1164]=8.1195077527600841; + lats[1165]=8.049208984355916; + lats[1166]=7.9789102159512737; + lats[1167]=7.9086114475461606; + lats[1168]=7.8383126791405831; + lats[1169]=7.7680139107345463; + lats[1170]=7.6977151423280494; + lats[1171]=7.6274163739210996; + lats[1172]=7.557117605513703; + lats[1173]=7.4868188371058624; + lats[1174]=7.4165200686975803; + lats[1175]=7.3462213002888648; + lats[1176]=7.2759225318797176; + lats[1177]=7.2056237634701441; + lats[1178]=7.1353249950601469; + lats[1179]=7.0650262266497315; + lats[1180]=6.994727458238903; + lats[1181]=6.924428689827665; + lats[1182]=6.8541299214160212; + lats[1183]=6.7838311530039768; + lats[1184]=6.7135323845915353; + lats[1185]=6.6432336161787013; + lats[1186]=6.5729348477654792; + lats[1187]=6.5026360793518734; + lats[1188]=6.4323373109378874; + lats[1189]=6.3620385425235257; + lats[1190]=6.2917397741087928; + lats[1191]=6.2214410056936931; + lats[1192]=6.151142237278231; + lats[1193]=6.0808434688624091; + lats[1194]=6.0105447004462347; + lats[1195]=5.9402459320297085; + lats[1196]=5.869947163612836; + lats[1197]=5.7996483951956233; + lats[1198]=5.729349626778073; + lats[1199]=5.6590508583601888; + lats[1200]=5.5887520899419751; + lats[1201]=5.5184533215234373; + lats[1202]=5.4481545531045787; + lats[1203]=5.3778557846854023; + lats[1204]=5.3075570162659149; + lats[1205]=5.2372582478461194; + lats[1206]=5.1669594794260192; + lats[1207]=5.0966607110056197; + lats[1208]=5.0263619425849244; + lats[1209]=4.9560631741639369; + lats[1210]=4.8857644057426626; + lats[1211]=4.8154656373211049; + lats[1212]=4.7451668688992683; + lats[1213]=4.6748681004771564; + lats[1214]=4.6045693320547736; + lats[1215]=4.5342705636321252; + lats[1216]=4.4639717952092139; + lats[1217]=4.3936730267860451; + lats[1218]=4.3233742583626205; + lats[1219]=4.2530754899389471; + lats[1220]=4.1827767215150269; + lats[1221]=4.1124779530908659; + lats[1222]=4.0421791846664661; + lats[1223]=3.9718804162418326; + lats[1224]=3.90158164781697; + lats[1225]=3.8312828793918823; + lats[1226]=3.7609841109665734; + lats[1227]=3.6906853425410477; + lats[1228]=3.6203865741153085; + lats[1229]=3.5500878056893601; + lats[1230]=3.4797890372632065; + lats[1231]=3.4094902688368531; + lats[1232]=3.339191500410303; + lats[1233]=3.2688927319835597; + lats[1234]=3.1985939635566285; + lats[1235]=3.1282951951295126; + lats[1236]=3.0579964267022164; + lats[1237]=2.9876976582747439; + lats[1238]=2.9173988898470999; + lats[1239]=2.8471001214192873; + lats[1240]=2.7768013529913107; + lats[1241]=2.7065025845631743; + lats[1242]=2.6362038161348824; + lats[1243]=2.5659050477064382; + lats[1244]=2.4956062792778466; + lats[1245]=2.4253075108491116; + lats[1246]=2.3550087424202366; + lats[1247]=2.2847099739912267; + lats[1248]=2.2144112055620848; + lats[1249]=2.1441124371328155; + lats[1250]=2.0738136687034232; + lats[1251]=2.0035149002739114; + lats[1252]=1.9332161318442849; + lats[1253]=1.8629173634145471; + lats[1254]=1.792618594984702; + lats[1255]=1.7223198265547539; + lats[1256]=1.6520210581247066; + lats[1257]=1.5817222896945646; + lats[1258]=1.5114235212643317; + lats[1259]=1.4411247528340119; + lats[1260]=1.3708259844036093; + lats[1261]=1.300527215973128; + lats[1262]=1.2302284475425722; + lats[1263]=1.1599296791119456; + lats[1264]=1.0896309106812523; + lats[1265]=1.0193321422504964; + lats[1266]=0.949033373819682; + lats[1267]=0.87873460538881287; + lats[1268]=0.80843583695789356; + lats[1269]=0.73813706852692773; + lats[1270]=0.66783830009591949; + lats[1271]=0.59753953166487306; + lats[1272]=0.52724076323379232; + lats[1273]=0.45694199480268116; + lats[1274]=0.3866432263715438; + lats[1275]=0.31634445794038429; + lats[1276]=0.24604568950920663; + lats[1277]=0.17574692107801482; + lats[1278]=0.10544815264681295; + lats[1279]=0.035149384215604956; + lats[1280]=-0.035149384215604956; + lats[1281]=-0.10544815264681295; + lats[1282]=-0.17574692107801482; + lats[1283]=-0.24604568950920663; + lats[1284]=-0.31634445794038429; + lats[1285]=-0.3866432263715438; + lats[1286]=-0.45694199480268116; + lats[1287]=-0.52724076323379232; + lats[1288]=-0.59753953166487306; + lats[1289]=-0.66783830009591949; + lats[1290]=-0.73813706852692773; + lats[1291]=-0.80843583695789356; + lats[1292]=-0.87873460538881287; + lats[1293]=-0.949033373819682; + lats[1294]=-1.0193321422504964; + lats[1295]=-1.0896309106812523; + lats[1296]=-1.1599296791119456; + lats[1297]=-1.2302284475425722; + lats[1298]=-1.300527215973128; + lats[1299]=-1.3708259844036093; + lats[1300]=-1.4411247528340119; + lats[1301]=-1.5114235212643317; + lats[1302]=-1.5817222896945646; + lats[1303]=-1.6520210581247066; + lats[1304]=-1.7223198265547539; + lats[1305]=-1.792618594984702; + lats[1306]=-1.8629173634145471; + lats[1307]=-1.9332161318442849; + lats[1308]=-2.0035149002739114; + lats[1309]=-2.0738136687034232; + lats[1310]=-2.1441124371328155; + lats[1311]=-2.2144112055620848; + lats[1312]=-2.2847099739912267; + lats[1313]=-2.3550087424202366; + lats[1314]=-2.4253075108491116; + lats[1315]=-2.4956062792778466; + lats[1316]=-2.5659050477064382; + lats[1317]=-2.6362038161348824; + lats[1318]=-2.7065025845631743; + lats[1319]=-2.7768013529913107; + lats[1320]=-2.8471001214192873; + lats[1321]=-2.9173988898470999; + lats[1322]=-2.9876976582747439; + lats[1323]=-3.0579964267022164; + lats[1324]=-3.1282951951295126; + lats[1325]=-3.1985939635566285; + lats[1326]=-3.2688927319835597; + lats[1327]=-3.339191500410303; + lats[1328]=-3.4094902688368531; + lats[1329]=-3.4797890372632065; + lats[1330]=-3.5500878056893601; + lats[1331]=-3.6203865741153085; + lats[1332]=-3.6906853425410477; + lats[1333]=-3.7609841109665734; + lats[1334]=-3.8312828793918823; + lats[1335]=-3.90158164781697; + lats[1336]=-3.9718804162418326; + lats[1337]=-4.0421791846664661; + lats[1338]=-4.1124779530908659; + lats[1339]=-4.1827767215150269; + lats[1340]=-4.2530754899389471; + lats[1341]=-4.3233742583626205; + lats[1342]=-4.3936730267860451; + lats[1343]=-4.4639717952092139; + lats[1344]=-4.5342705636321252; + lats[1345]=-4.6045693320547736; + lats[1346]=-4.6748681004771564; + lats[1347]=-4.7451668688992683; + lats[1348]=-4.8154656373211049; + lats[1349]=-4.8857644057426626; + lats[1350]=-4.9560631741639369; + lats[1351]=-5.0263619425849244; + lats[1352]=-5.0966607110056197; + lats[1353]=-5.1669594794260192; + lats[1354]=-5.2372582478461194; + lats[1355]=-5.3075570162659149; + lats[1356]=-5.3778557846854023; + lats[1357]=-5.4481545531045787; + lats[1358]=-5.5184533215234373; + lats[1359]=-5.5887520899419751; + lats[1360]=-5.6590508583601888; + lats[1361]=-5.729349626778073; + lats[1362]=-5.7996483951956233; + lats[1363]=-5.869947163612836; + lats[1364]=-5.9402459320297085; + lats[1365]=-6.0105447004462347; + lats[1366]=-6.0808434688624091; + lats[1367]=-6.151142237278231; + lats[1368]=-6.2214410056936931; + lats[1369]=-6.2917397741087928; + lats[1370]=-6.3620385425235257; + lats[1371]=-6.4323373109378874; + lats[1372]=-6.5026360793518734; + lats[1373]=-6.5729348477654792; + lats[1374]=-6.6432336161787013; + lats[1375]=-6.7135323845915353; + lats[1376]=-6.7838311530039768; + lats[1377]=-6.8541299214160212; + lats[1378]=-6.924428689827665; + lats[1379]=-6.994727458238903; + lats[1380]=-7.0650262266497315; + lats[1381]=-7.1353249950601469; + lats[1382]=-7.2056237634701441; + lats[1383]=-7.2759225318797176; + lats[1384]=-7.3462213002888648; + lats[1385]=-7.4165200686975803; + lats[1386]=-7.4868188371058624; + lats[1387]=-7.557117605513703; + lats[1388]=-7.6274163739210996; + lats[1389]=-7.6977151423280494; + lats[1390]=-7.7680139107345463; + lats[1391]=-7.8383126791405831; + lats[1392]=-7.9086114475461606; + lats[1393]=-7.9789102159512737; + lats[1394]=-8.049208984355916; + lats[1395]=-8.1195077527600841; + lats[1396]=-8.1898065211637725; + lats[1397]=-8.2601052895669778; + lats[1398]=-8.3304040579696963; + lats[1399]=-8.4007028263719228; + lats[1400]=-8.4710015947736537; + lats[1401]=-8.5413003631748801; + lats[1402]=-8.6115991315756055; + lats[1403]=-8.6818978999758194; + lats[1404]=-8.7521966683755217; + lats[1405]=-8.8224954367747017; + lats[1406]=-8.8927942051733631; + lats[1407]=-8.963092973571495; + lats[1408]=-9.0333917419690941; + lats[1409]=-9.1036905103661585; + lats[1410]=-9.1739892787626829; + lats[1411]=-9.2442880471586619; + lats[1412]=-9.3145868155540921; + lats[1413]=-9.3848855839489662; + lats[1414]=-9.4551843523432826; + lats[1415]=-9.5254831207370376; + lats[1416]=-9.5957818891302242; + lats[1417]=-9.6660806575228388; + lats[1418]=-9.7363794259148779; + lats[1419]=-9.8066781943063344; + lats[1420]=-9.8769769626972046; + lats[1421]=-9.9472757310874869; + lats[1422]=-10.017574499477174; + lats[1423]=-10.087873267866264; + lats[1424]=-10.158172036254747; + lats[1425]=-10.228470804642624; + lats[1426]=-10.298769573029887; + lats[1427]=-10.369068341416533; + lats[1428]=-10.439367109802557; + lats[1429]=-10.509665878187954; + lats[1430]=-10.579964646572719; + lats[1431]=-10.65026341495685; + lats[1432]=-10.720562183340341; + lats[1433]=-10.790860951723188; + lats[1434]=-10.861159720105382; + lats[1435]=-10.931458488486923; + lats[1436]=-11.001757256867807; + lats[1437]=-11.072056025248026; + lats[1438]=-11.142354793627575; + lats[1439]=-11.212653562006453; + lats[1440]=-11.282952330384653; + lats[1441]=-11.35325109876217; + lats[1442]=-11.423549867139002; + lats[1443]=-11.493848635515141; + lats[1444]=-11.564147403890583; + lats[1445]=-11.634446172265324; + lats[1446]=-11.704744940639358; + lats[1447]=-11.775043709012685; + lats[1448]=-11.845342477385294; + lats[1449]=-11.915641245757183; + lats[1450]=-11.985940014128348; + lats[1451]=-12.056238782498781; + lats[1452]=-12.126537550868482; + lats[1453]=-12.196836319237443; + lats[1454]=-12.267135087605659; + lats[1455]=-12.337433855973126; + lats[1456]=-12.407732624339841; + lats[1457]=-12.478031392705796; + lats[1458]=-12.548330161070988; + lats[1459]=-12.618628929435411; + lats[1460]=-12.688927697799061; + lats[1461]=-12.759226466161934; + lats[1462]=-12.829525234524022; + lats[1463]=-12.899824002885323; + lats[1464]=-12.970122771245832; + lats[1465]=-13.040421539605545; + lats[1466]=-13.110720307964451; + lats[1467]=-13.181019076322551; + lats[1468]=-13.251317844679837; + lats[1469]=-13.32161661303631; + lats[1470]=-13.391915381391959; + lats[1471]=-13.46221414974678; + lats[1472]=-13.532512918100766; + lats[1473]=-13.602811686453919; + lats[1474]=-13.673110454806226; + lats[1475]=-13.743409223157688; + lats[1476]=-13.813707991508297; + lats[1477]=-13.884006759858046; + lats[1478]=-13.954305528206934; + lats[1479]=-14.024604296554955; + lats[1480]=-14.0949030649021; + lats[1481]=-14.165201833248371; + lats[1482]=-14.23550060159376; + lats[1483]=-14.305799369938256; + lats[1484]=-14.376098138281863; + lats[1485]=-14.446396906624567; + lats[1486]=-14.516695674966371; + lats[1487]=-14.586994443307265; + lats[1488]=-14.657293211647247; + lats[1489]=-14.727591979986309; + lats[1490]=-14.797890748324447; + lats[1491]=-14.868189516661655; + lats[1492]=-14.938488284997929; + lats[1493]=-15.008787053333259; + lats[1494]=-15.07908582166765; + lats[1495]=-15.149384590001089; + lats[1496]=-15.219683358333569; + lats[1497]=-15.289982126665089; + lats[1498]=-15.360280894995643; + lats[1499]=-15.430579663325226; + lats[1500]=-15.500878431653829; + lats[1501]=-15.571177199981456; + lats[1502]=-15.641475968308091; + lats[1503]=-15.711774736633735; + lats[1504]=-15.78207350495838; + lats[1505]=-15.852372273282016; + lats[1506]=-15.922671041604652; + lats[1507]=-15.992969809926265; + lats[1508]=-16.063268578246863; + lats[1509]=-16.133567346566434; + lats[1510]=-16.203866114884974; + lats[1511]=-16.274164883202477; + lats[1512]=-16.344463651518936; + lats[1513]=-16.41476241983435; + lats[1514]=-16.485061188148713; + lats[1515]=-16.555359956462013; + lats[1516]=-16.625658724774254; + lats[1517]=-16.69595749308542; + lats[1518]=-16.766256261395515; + lats[1519]=-16.836555029704527; + lats[1520]=-16.906853798012452; + lats[1521]=-16.977152566319283; + lats[1522]=-17.04745133462502; + lats[1523]=-17.117750102929655; + lats[1524]=-17.188048871233182; + lats[1525]=-17.258347639535586; + lats[1526]=-17.328646407836878; + lats[1527]=-17.39894517613704; + lats[1528]=-17.469243944436066; + lats[1529]=-17.539542712733962; + lats[1530]=-17.60984148103071; + lats[1531]=-17.680140249326314; + lats[1532]=-17.75043901762076; + lats[1533]=-17.820737785914044; + lats[1534]=-17.89103655420616; + lats[1535]=-17.96133532249711; + lats[1536]=-18.031634090786874; + lats[1537]=-18.101932859075458; + lats[1538]=-18.172231627362851; + lats[1539]=-18.242530395649048; + lats[1540]=-18.312829163934047; + lats[1541]=-18.383127932217832; + lats[1542]=-18.453426700500408; + lats[1543]=-18.523725468781763; + lats[1544]=-18.594024237061891; + lats[1545]=-18.664323005340787; + lats[1546]=-18.734621773618446; + lats[1547]=-18.804920541894862; + lats[1548]=-18.875219310170031; + lats[1549]=-18.945518078443939; + lats[1550]=-19.015816846716586; + lats[1551]=-19.086115614987968; + lats[1552]=-19.15641438325807; + lats[1553]=-19.226713151526898; + lats[1554]=-19.297011919794439; + lats[1555]=-19.367310688060684; + lats[1556]=-19.437609456325632; + lats[1557]=-19.507908224589269; + lats[1558]=-19.578206992851602; + lats[1559]=-19.648505761112613; + lats[1560]=-19.718804529372303; + lats[1561]=-19.789103297630657; + lats[1562]=-19.859402065887682; + lats[1563]=-19.929700834143357; + lats[1564]=-19.999999602397686; + lats[1565]=-20.070298370650661; + lats[1566]=-20.140597138902272; + lats[1567]=-20.210895907152516; + lats[1568]=-20.28119467540138; + lats[1569]=-20.35149344364887; + lats[1570]=-20.421792211894967; + lats[1571]=-20.492090980139672; + lats[1572]=-20.562389748382977; + lats[1573]=-20.632688516624874; + lats[1574]=-20.702987284865355; + lats[1575]=-20.773286053104417; + lats[1576]=-20.843584821342048; + lats[1577]=-20.913883589578251; + lats[1578]=-20.984182357813012; + lats[1579]=-21.054481126046323; + lats[1580]=-21.124779894278181; + lats[1581]=-21.195078662508585; + lats[1582]=-21.265377430737512; + lats[1583]=-21.335676198964972; + lats[1584]=-21.40597496719095; + lats[1585]=-21.47627373541544; + lats[1586]=-21.546572503638437; + lats[1587]=-21.616871271859928; + lats[1588]=-21.687170040079913; + lats[1589]=-21.757468808298391; + lats[1590]=-21.827767576515338; + lats[1591]=-21.898066344730758; + lats[1592]=-21.968365112944642; + lats[1593]=-22.038663881156989; + lats[1594]=-22.108962649367779; + lats[1595]=-22.179261417577013; + lats[1596]=-22.249560185784691; + lats[1597]=-22.319858953990789; + lats[1598]=-22.390157722195315; + lats[1599]=-22.460456490398254; + lats[1600]=-22.530755258599601; + lats[1601]=-22.60105402679935; + lats[1602]=-22.671352794997489; + lats[1603]=-22.741651563194019; + lats[1604]=-22.811950331388925; + lats[1605]=-22.882249099582204; + lats[1606]=-22.952547867773848; + lats[1607]=-23.022846635963852; + lats[1608]=-23.0931454041522; + lats[1609]=-23.163444172338895; + lats[1610]=-23.233742940523921; + lats[1611]=-23.304041708707278; + lats[1612]=-23.374340476888957; + lats[1613]=-23.444639245068949; + lats[1614]=-23.514938013247242; + lats[1615]=-23.585236781423838; + lats[1616]=-23.655535549598721; + lats[1617]=-23.725834317771888; + lats[1618]=-23.796133085943328; + lats[1619]=-23.866431854113038; + lats[1620]=-23.936730622281004; + lats[1621]=-24.007029390447226; + lats[1622]=-24.077328158611696; + lats[1623]=-24.1476269267744; + lats[1624]=-24.217925694935328; + lats[1625]=-24.288224463094483; + lats[1626]=-24.358523231251851; + lats[1627]=-24.428821999407425; + lats[1628]=-24.499120767561195; + lats[1629]=-24.569419535713152; + lats[1630]=-24.639718303863294; + lats[1631]=-24.710017072011613; + lats[1632]=-24.780315840158096; + lats[1633]=-24.850614608302738; + lats[1634]=-24.920913376445526; + lats[1635]=-24.991212144586456; + lats[1636]=-25.061510912725527; + lats[1637]=-25.13180968086272; + lats[1638]=-25.202108448998025; + lats[1639]=-25.272407217131445; + lats[1640]=-25.342705985262967; + lats[1641]=-25.413004753392578; + lats[1642]=-25.483303521520277; + lats[1643]=-25.553602289646051; + lats[1644]=-25.623901057769892; + lats[1645]=-25.694199825891793; + lats[1646]=-25.764498594011751; + lats[1647]=-25.834797362129745; + lats[1648]=-25.90509613024577; + lats[1649]=-25.975394898359827; + lats[1650]=-26.045693666471902; + lats[1651]=-26.115992434581983; + lats[1652]=-26.186291202690064; + lats[1653]=-26.256589970796135; + lats[1654]=-26.326888738900195; + lats[1655]=-26.397187507002222; + lats[1656]=-26.467486275102218; + lats[1657]=-26.53778504320017; + lats[1658]=-26.608083811296069; + lats[1659]=-26.678382579389908; + lats[1660]=-26.748681347481678; + lats[1661]=-26.818980115571364; + lats[1662]=-26.889278883658971; + lats[1663]=-26.959577651744471; + lats[1664]=-27.029876419827872; + lats[1665]=-27.100175187909159; + lats[1666]=-27.170473955988321; + lats[1667]=-27.240772724065348; + lats[1668]=-27.311071492140236; + lats[1669]=-27.381370260212968; + lats[1670]=-27.451669028283543; + lats[1671]=-27.521967796351948; + lats[1672]=-27.592266564418171; + lats[1673]=-27.662565332482213; + lats[1674]=-27.732864100544052; + lats[1675]=-27.803162868603682; + lats[1676]=-27.873461636661098; + lats[1677]=-27.94376040471629; + lats[1678]=-28.014059172769244; + lats[1679]=-28.084357940819952; + lats[1680]=-28.154656708868405; + lats[1681]=-28.224955476914594; + lats[1682]=-28.29525424495851; + lats[1683]=-28.365553013000145; + lats[1684]=-28.435851781039485; + lats[1685]=-28.506150549076519; + lats[1686]=-28.576449317111244; + lats[1687]=-28.646748085143642; + lats[1688]=-28.717046853173709; + lats[1689]=-28.787345621201432; + lats[1690]=-28.857644389226806; + lats[1691]=-28.927943157249814; + lats[1692]=-28.998241925270449; + lats[1693]=-29.068540693288696; + lats[1694]=-29.138839461304556; + lats[1695]=-29.209138229318015; + lats[1696]=-29.279436997329057; + lats[1697]=-29.349735765337677; + lats[1698]=-29.420034533343859; + lats[1699]=-29.490333301347597; + lats[1700]=-29.560632069348884; + lats[1701]=-29.630930837347698; + lats[1702]=-29.701229605344039; + lats[1703]=-29.771528373337894; + lats[1704]=-29.841827141329258; + lats[1705]=-29.91212590931811; + lats[1706]=-29.98242467730444; + lats[1707]=-30.052723445288244; + lats[1708]=-30.123022213269511; + lats[1709]=-30.19332098124822; + lats[1710]=-30.263619749224372; + lats[1711]=-30.333918517197947; + lats[1712]=-30.404217285168947; + lats[1713]=-30.47451605313735; + lats[1714]=-30.544814821103138; + lats[1715]=-30.615113589066322; + lats[1716]=-30.685412357026873; + lats[1717]=-30.755711124984781; + lats[1718]=-30.826009892940046; + lats[1719]=-30.896308660892647; + lats[1720]=-30.966607428842572; + lats[1721]=-31.036906196789811; + lats[1722]=-31.107204964734358; + lats[1723]=-31.177503732676204; + lats[1724]=-31.247802500615318; + lats[1725]=-31.318101268551715; + lats[1726]=-31.388400036485361; + lats[1727]=-31.458698804416255; + lats[1728]=-31.528997572344384; + lats[1729]=-31.599296340269738; + lats[1730]=-31.669595108192297; + lats[1731]=-31.739893876112063; + lats[1732]=-31.810192644029012; + lats[1733]=-31.880491411943137; + lats[1734]=-31.950790179854422; + lats[1735]=-32.021088947762863; + lats[1736]=-32.091387715668439; + lats[1737]=-32.161686483571145; + lats[1738]=-32.231985251470959; + lats[1739]=-32.302284019367875; + lats[1740]=-32.372582787261891; + lats[1741]=-32.442881555152965; + lats[1742]=-32.513180323041112; + lats[1743]=-32.583479090926325; + lats[1744]=-32.653777858808567; + lats[1745]=-32.724076626687825; + lats[1746]=-32.794375394564113; + lats[1747]=-32.864674162437396; + lats[1748]=-32.934972930307666; + lats[1749]=-33.005271698174909; + lats[1750]=-33.075570466039117; + lats[1751]=-33.145869233900278; + lats[1752]=-33.216168001758369; + lats[1753]=-33.286466769613391; + lats[1754]=-33.356765537465314; + lats[1755]=-33.42706430531414; + lats[1756]=-33.497363073159853; + lats[1757]=-33.567661841002426; + lats[1758]=-33.637960608841851; + lats[1759]=-33.708259376678136; + lats[1760]=-33.778558144511237; + lats[1761]=-33.848856912341155; + lats[1762]=-33.919155680167876; + lats[1763]=-33.989454447991392; + lats[1764]=-34.059753215811682; + lats[1765]=-34.130051983628725; + lats[1766]=-34.200350751442521; + lats[1767]=-34.270649519253041; + lats[1768]=-34.340948287060286; + lats[1769]=-34.411247054864234; + lats[1770]=-34.481545822664863; + lats[1771]=-34.551844590462188; + lats[1772]=-34.622143358256153; + lats[1773]=-34.692442126046771; + lats[1774]=-34.762740893834028; + lats[1775]=-34.833039661617903; + lats[1776]=-34.903338429398374; + lats[1777]=-34.973637197175435; + lats[1778]=-35.043935964949064; + lats[1779]=-35.114234732719261; + lats[1780]=-35.184533500486005; + lats[1781]=-35.254832268249267; + lats[1782]=-35.325131036009047; + lats[1783]=-35.395429803765317; + lats[1784]=-35.465728571518085; + lats[1785]=-35.536027339267314; + lats[1786]=-35.606326107012997; + lats[1787]=-35.676624874755113; + lats[1788]=-35.746923642493655; + lats[1789]=-35.817222410228595; + lats[1790]=-35.887521177959933; + lats[1791]=-35.957819945687639; + lats[1792]=-36.028118713411708; + lats[1793]=-36.098417481132117; + lats[1794]=-36.16871624884886; + lats[1795]=-36.239015016561908; + lats[1796]=-36.309313784271254; + lats[1797]=-36.379612551976876; + lats[1798]=-36.449911319678755; + lats[1799]=-36.520210087376888; + lats[1800]=-36.590508855071242; + lats[1801]=-36.660807622761808; + lats[1802]=-36.731106390448581; + lats[1803]=-36.801405158131523; + lats[1804]=-36.871703925810628; + lats[1805]=-36.942002693485883; + lats[1806]=-37.012301461157264; + lats[1807]=-37.082600228824752; + lats[1808]=-37.152898996488332; + lats[1809]=-37.223197764147997; + lats[1810]=-37.293496531803719; + lats[1811]=-37.363795299455489; + lats[1812]=-37.434094067103274; + lats[1813]=-37.504392834747065; + lats[1814]=-37.574691602386856; + lats[1815]=-37.644990370022605; + lats[1816]=-37.715289137654317; + lats[1817]=-37.785587905281965; + lats[1818]=-37.855886672905527; + lats[1819]=-37.926185440524989; + lats[1820]=-37.99648420814033; + lats[1821]=-38.066782975751536; + lats[1822]=-38.137081743358586; + lats[1823]=-38.20738051096145; + lats[1824]=-38.277679278560143; + lats[1825]=-38.347978046154608; + lats[1826]=-38.418276813744846; + lats[1827]=-38.488575581330842; + lats[1828]=-38.558874348912568; + lats[1829]=-38.629173116490001; + lats[1830]=-38.699471884063136; + lats[1831]=-38.769770651631937; + lats[1832]=-38.840069419196389; + lats[1833]=-38.910368186756479; + lats[1834]=-38.980666954312184; + lats[1835]=-39.050965721863491; + lats[1836]=-39.121264489410365; + lats[1837]=-39.191563256952804; + lats[1838]=-39.261862024490775; + lats[1839]=-39.332160792024254; + lats[1840]=-39.402459559553229; + lats[1841]=-39.472758327077692; + lats[1842]=-39.543057094597607; + lats[1843]=-39.613355862112947; + lats[1844]=-39.683654629623703; + lats[1845]=-39.753953397129855; + lats[1846]=-39.824252164631375; + lats[1847]=-39.894550932128247; + lats[1848]=-39.964849699620437; + lats[1849]=-40.035148467107952; + lats[1850]=-40.105447234590748; + lats[1851]=-40.175746002068806; + lats[1852]=-40.246044769542102; + lats[1853]=-40.316343537010617; + lats[1854]=-40.386642304474343; + lats[1855]=-40.456941071933244; + lats[1856]=-40.527239839387299; + lats[1857]=-40.597538606836487; + lats[1858]=-40.667837374280786; + lats[1859]=-40.738136141720176; + lats[1860]=-40.808434909154634; + lats[1861]=-40.878733676584126; + lats[1862]=-40.949032444008644; + lats[1863]=-41.01933121142816; + lats[1864]=-41.089629978842645; + lats[1865]=-41.159928746252085; + lats[1866]=-41.230227513656445; + lats[1867]=-41.300526281055724; + lats[1868]=-41.370825048449873; + lats[1869]=-41.441123815838885; + lats[1870]=-41.511422583222718; + lats[1871]=-41.581721350601363; + lats[1872]=-41.6520201179748; + lats[1873]=-41.722318885343; + lats[1874]=-41.792617652705921; + lats[1875]=-41.862916420063563; + lats[1876]=-41.933215187415882; + lats[1877]=-42.003513954762873; + lats[1878]=-42.073812722104492; + lats[1879]=-42.144111489440725; + lats[1880]=-42.214410256771551; + lats[1881]=-42.284709024096927; + lats[1882]=-42.355007791416853; + lats[1883]=-42.425306558731272; + lats[1884]=-42.495605326040177; + lats[1885]=-42.565904093343548; + lats[1886]=-42.63620286064134; + lats[1887]=-42.706501627933541; + lats[1888]=-42.776800395220121; + lats[1889]=-42.847099162501053; + lats[1890]=-42.917397929776307; + lats[1891]=-42.987696697045862; + lats[1892]=-43.057995464309691; + lats[1893]=-43.128294231567757; + lats[1894]=-43.19859299882004; + lats[1895]=-43.26889176606651; + lats[1896]=-43.339190533307139; + lats[1897]=-43.409489300541907; + lats[1898]=-43.479788067770777; + lats[1899]=-43.550086834993728; + lats[1900]=-43.620385602210717; + lats[1901]=-43.690684369421732; + lats[1902]=-43.760983136626741; + lats[1903]=-43.831281903825705; + lats[1904]=-43.9015806710186; + lats[1905]=-43.971879438205391; + lats[1906]=-44.042178205386072; + lats[1907]=-44.112476972560586; + lats[1908]=-44.182775739728925; + lats[1909]=-44.253074506891046; + lats[1910]=-44.323373274046915; + lats[1911]=-44.39367204119651; + lats[1912]=-44.463970808339802; + lats[1913]=-44.534269575476756; + lats[1914]=-44.604568342607337; + lats[1915]=-44.674867109731515; + lats[1916]=-44.745165876849271; + lats[1917]=-44.81546464396056; + lats[1918]=-44.885763411065362; + lats[1919]=-44.956062178163634; + lats[1920]=-45.026360945255341; + lats[1921]=-45.096659712340461; + lats[1922]=-45.166958479418959; + lats[1923]=-45.237257246490813; + lats[1924]=-45.30755601355596; + lats[1925]=-45.377854780614399; + lats[1926]=-45.448153547666081; + lats[1927]=-45.51845231471097; + lats[1928]=-45.588751081749038; + lats[1929]=-45.659049848780263; + lats[1930]=-45.729348615804589; + lats[1931]=-45.799647382821995; + lats[1932]=-45.869946149832437; + lats[1933]=-45.94024491683588; + lats[1934]=-46.01054368383231; + lats[1935]=-46.080842450821663; + lats[1936]=-46.151141217803925; + lats[1937]=-46.221439984779053; + lats[1938]=-46.291738751747012; + lats[1939]=-46.362037518707766; + lats[1940]=-46.432336285661272; + lats[1941]=-46.502635052607502; + lats[1942]=-46.572933819546414; + lats[1943]=-46.643232586477971; + lats[1944]=-46.713531353402139; + lats[1945]=-46.783830120318882; + lats[1946]=-46.85412888722815; + lats[1947]=-46.924427654129929; + lats[1948]=-46.994726421024154; + lats[1949]=-47.065025187910805; + lats[1950]=-47.13532395478984; + lats[1951]=-47.205622721661214; + lats[1952]=-47.275921488524894; + lats[1953]=-47.346220255380835; + lats[1954]=-47.416519022228997; + lats[1955]=-47.486817789069342; + lats[1956]=-47.557116555901828; + lats[1957]=-47.627415322726435; + lats[1958]=-47.697714089543084; + lats[1959]=-47.76801285635176; + lats[1960]=-47.838311623152421; + lats[1961]=-47.908610389945018; + lats[1962]=-47.978909156729507; + lats[1963]=-48.049207923505868; + lats[1964]=-48.119506690274015; + lats[1965]=-48.189805457033941; + lats[1966]=-48.260104223785596; + lats[1967]=-48.330402990528938; + lats[1968]=-48.400701757263917; + lats[1969]=-48.47100052399049; + lats[1970]=-48.541299290708608; + lats[1971]=-48.611598057418242; + lats[1972]=-48.681896824119335; + lats[1973]=-48.752195590811837; + lats[1974]=-48.822494357495721; + lats[1975]=-48.892793124170929; + lats[1976]=-48.963091890837418; + lats[1977]=-49.03339065749514; + lats[1978]=-49.103689424144044; + lats[1979]=-49.173988190784094; + lats[1980]=-49.244286957415234; + lats[1981]=-49.314585724037435; + lats[1982]=-49.384884490650613; + lats[1983]=-49.455183257254745; + lats[1984]=-49.525482023849783; + lats[1985]=-49.595780790435676; + lats[1986]=-49.66607955701236; + lats[1987]=-49.736378323579807; + lats[1988]=-49.80667709013796; + lats[1989]=-49.876975856686762; + lats[1990]=-49.947274623226157; + lats[1991]=-50.017573389756123; + lats[1992]=-50.087872156276575; + lats[1993]=-50.158170922787484; + lats[1994]=-50.228469689288779; + lats[1995]=-50.298768455780426; + lats[1996]=-50.369067222262359; + lats[1997]=-50.439365988734544; + lats[1998]=-50.509664755196901; + lats[1999]=-50.579963521649397; + lats[2000]=-50.650262288091959; + lats[2001]=-50.720561054524559; + lats[2002]=-50.790859820947119; + lats[2003]=-50.86115858735959; + lats[2004]=-50.931457353761914; + lats[2005]=-51.001756120154049; + lats[2006]=-51.072054886535909; + lats[2007]=-51.14235365290746; + lats[2008]=-51.21265241926865; + lats[2009]=-51.282951185619417; + lats[2010]=-51.353249951959683; + lats[2011]=-51.423548718289396; + lats[2012]=-51.493847484608516; + lats[2013]=-51.56414625091697; + lats[2014]=-51.634445017214695; + lats[2015]=-51.704743783501634; + lats[2016]=-51.775042549777737; + lats[2017]=-51.845341316042933; + lats[2018]=-51.915640082297152; + lats[2019]=-51.985938848540336; + lats[2020]=-52.056237614772435; + lats[2021]=-52.126536380993372; + lats[2022]=-52.196835147203096; + lats[2023]=-52.26713391340153; + lats[2024]=-52.337432679588609; + lats[2025]=-52.407731445764284; + lats[2026]=-52.478030211928477; + lats[2027]=-52.548328978081123; + lats[2028]=-52.618627744222159; + lats[2029]=-52.688926510351514; + lats[2030]=-52.759225276469131; + lats[2031]=-52.829524042574917; + lats[2032]=-52.899822808668837; + lats[2033]=-52.970121574750792; + lats[2034]=-53.040420340820731; + lats[2035]=-53.110719106878584; + lats[2036]=-53.181017872924265; + lats[2037]=-53.251316638957725; + lats[2038]=-53.321615404978871; + lats[2039]=-53.391914170987633; + lats[2040]=-53.462212936983953; + lats[2041]=-53.53251170296776; + lats[2042]=-53.602810468938962; + lats[2043]=-53.673109234897495; + lats[2044]=-53.743408000843282; + lats[2045]=-53.813706766776235; + lats[2046]=-53.884005532696307; + lats[2047]=-53.954304298603383; + lats[2048]=-54.024603064497434; + lats[2049]=-54.094901830378333; + lats[2050]=-54.165200596246031; + lats[2051]=-54.235499362100448; + lats[2052]=-54.305798127941479; + lats[2053]=-54.376096893769081; + lats[2054]=-54.446395659583146; + lats[2055]=-54.516694425383605; + lats[2056]=-54.586993191170357; + lats[2057]=-54.657291956943347; + lats[2058]=-54.727590722702473; + lats[2059]=-54.797889488447652; + lats[2060]=-54.868188254178797; + lats[2061]=-54.938487019895831; + lats[2062]=-55.008785785598668; + lats[2063]=-55.07908455128721; + lats[2064]=-55.149383316961377; + lats[2065]=-55.219682082621084; + lats[2066]=-55.289980848266232; + lats[2067]=-55.360279613896743; + lats[2068]=-55.430578379512511; + lats[2069]=-55.500877145113449; + lats[2070]=-55.571175910699488; + lats[2071]=-55.641474676270505; + lats[2072]=-55.711773441826416; + lats[2073]=-55.782072207367136; + lats[2074]=-55.852370972892551; + lats[2075]=-55.922669738402583; + lats[2076]=-55.992968503897131; + lats[2077]=-56.063267269376091; + lats[2078]=-56.133566034839362; + lats[2079]=-56.203864800286865; + lats[2080]=-56.274163565718467; + lats[2081]=-56.34446233113411; + lats[2082]=-56.41476109653366; + lats[2083]=-56.485059861917016; + lats[2084]=-56.555358627284086; + lats[2085]=-56.625657392634771; + lats[2086]=-56.695956157968951; + lats[2087]=-56.766254923286517; + lats[2088]=-56.836553688587379; + lats[2089]=-56.90685245387143; + lats[2090]=-56.977151219138541; + lats[2091]=-57.047449984388614; + lats[2092]=-57.117748749621541; + lats[2093]=-57.188047514837208; + lats[2094]=-57.258346280035504; + lats[2095]=-57.328645045216312; + lats[2096]=-57.398943810379521; + lats[2097]=-57.469242575525016; + lats[2098]=-57.539541340652676; + lats[2099]=-57.60984010576238; + lats[2100]=-57.680138870854037; + lats[2101]=-57.75043763592749; + lats[2102]=-57.820736400982646; + lats[2103]=-57.891035166019364; + lats[2104]=-57.961333931037537; + lats[2105]=-58.031632696037022; + lats[2106]=-58.101931461017728; + lats[2107]=-58.172230225979497; + lats[2108]=-58.242528990922203; + lats[2109]=-58.312827755845746; + lats[2110]=-58.383126520749968; + lats[2111]=-58.453425285634758; + lats[2112]=-58.523724050499972; + lats[2113]=-58.594022815345468; + lats[2114]=-58.664321580171141; + lats[2115]=-58.73462034497684; + lats[2116]=-58.804919109762423; + lats[2117]=-58.875217874527763; + lats[2118]=-58.945516639272725; + lats[2119]=-59.015815403997145; + lats[2120]=-59.086114168700909; + lats[2121]=-59.156412933383855; + lats[2122]=-59.226711698045854; + lats[2123]=-59.29701046268675; + lats[2124]=-59.3673092273064; + lats[2125]=-59.43760799190467; + lats[2126]=-59.507906756481383; + lats[2127]=-59.578205521036402; + lats[2128]=-59.64850428556958; + lats[2129]=-59.718803050080759; + lats[2130]=-59.78910181456979; + lats[2131]=-59.859400579036503; + lats[2132]=-59.929699343480763; + lats[2133]=-59.999998107902378; + lats[2134]=-60.070296872301235; + lats[2135]=-60.140595636677112; + lats[2136]=-60.21089440102989; + lats[2137]=-60.28119316535939; + lats[2138]=-60.35149192966545; + lats[2139]=-60.421790693947884; + lats[2140]=-60.492089458206543; + lats[2141]=-60.562388222441243; + lats[2142]=-60.632686986651805; + lats[2143]=-60.702985750838074; + lats[2144]=-60.773284514999872; + lats[2145]=-60.843583279137007; + lats[2146]=-60.913882043249295; + lats[2147]=-60.984180807336578; + lats[2148]=-61.054479571398652; + lats[2149]=-61.124778335435344; + lats[2150]=-61.195077099446451; + lats[2151]=-61.265375863431785; + lats[2152]=-61.335674627391185; + lats[2153]=-61.405973391324409; + lats[2154]=-61.476272155231321; + lats[2155]=-61.546570919111666; + lats[2156]=-61.616869682965287; + lats[2157]=-61.687168446791986; + lats[2158]=-61.757467210591535; + lats[2159]=-61.827765974363729; + lats[2160]=-61.898064738108381; + lats[2161]=-61.968363501825259; + lats[2162]=-62.038662265514176; + lats[2163]=-62.108961029174914; + lats[2164]=-62.179259792807258; + lats[2165]=-62.249558556410982; + lats[2166]=-62.319857319985871; + lats[2167]=-62.3901560835317; + lats[2168]=-62.460454847048261; + lats[2169]=-62.530753610535321; + lats[2170]=-62.60105237399263; + lats[2171]=-62.67135113741999; + lats[2172]=-62.741649900817137; + lats[2173]=-62.811948664183866; + lats[2174]=-62.882247427519928; + lats[2175]=-62.952546190825068; + lats[2176]=-63.022844954099064; + lats[2177]=-63.093143717341647; + lats[2178]=-63.163442480552604; + lats[2179]=-63.23374124373165; + lats[2180]=-63.304040006878537; + lats[2181]=-63.374338769993031; + lats[2182]=-63.444637533074854; + lats[2183]=-63.514936296123757; + lats[2184]=-63.585235059139464; + lats[2185]=-63.655533822121711; + lats[2186]=-63.725832585070251; + lats[2187]=-63.796131347984762; + lats[2188]=-63.866430110865004; + lats[2189]=-63.93672887371072; + lats[2190]=-64.00702763652157; + lats[2191]=-64.07732639929732; + lats[2192]=-64.147625162037642; + lats[2193]=-64.21792392474228; + lats[2194]=-64.288222687410922; + lats[2195]=-64.358521450043284; + lats[2196]=-64.428820212639039; + lats[2197]=-64.499118975197902; + lats[2198]=-64.569417737719576; + lats[2199]=-64.639716500203733; + lats[2200]=-64.710015262650074; + lats[2201]=-64.780314025058246; + lats[2202]=-64.850612787427963; + lats[2203]=-64.920911549758912; + lats[2204]=-64.991210312050711; + lats[2205]=-65.061509074303089; + lats[2206]=-65.131807836515677; + lats[2207]=-65.202106598688133; + lats[2208]=-65.272405360820116; + lats[2209]=-65.342704122911286; + lats[2210]=-65.413002884961315; + lats[2211]=-65.483301646969792; + lats[2212]=-65.553600408936404; + lats[2213]=-65.623899170860767; + lats[2214]=-65.694197932742526; + lats[2215]=-65.764496694581283; + lats[2216]=-65.834795456376696; + lats[2217]=-65.905094218128355; + lats[2218]=-65.975392979835888; + lats[2219]=-66.045691741498899; + lats[2220]=-66.115990503117033; + lats[2221]=-66.186289264689833; + lats[2222]=-66.256588026216932; + lats[2223]=-66.326886787697887; + lats[2224]=-66.397185549132331; + lats[2225]=-66.467484310519808; + lats[2226]=-66.537783071859891; + lats[2227]=-66.608081833152212; + lats[2228]=-66.678380594396273; + lats[2229]=-66.748679355591662; + lats[2230]=-66.818978116737924; + lats[2231]=-66.889276877834618; + lats[2232]=-66.95957563888129; + lats[2233]=-67.029874399877471; + lats[2234]=-67.100173160822706; + lats[2235]=-67.170471921716526; + lats[2236]=-67.240770682558434; + lats[2237]=-67.311069443347961; + lats[2238]=-67.381368204084609; + lats[2239]=-67.451666964767895; + lats[2240]=-67.521965725397308; + lats[2241]=-67.592264485972336; + lats[2242]=-67.662563246492482; + lats[2243]=-67.732862006957205; + lats[2244]=-67.803160767365966; + lats[2245]=-67.873459527718282; + lats[2246]=-67.943758288013555; + lats[2247]=-68.014057048251274; + lats[2248]=-68.084355808430871; + lats[2249]=-68.154654568551791; + lats[2250]=-68.224953328613438; + lats[2251]=-68.295252088615257; + lats[2252]=-68.365550848556666; + lats[2253]=-68.435849608437067; + lats[2254]=-68.506148368255865; + lats[2255]=-68.576447128012447; + lats[2256]=-68.646745887706189; + lats[2257]=-68.717044647336493; + lats[2258]=-68.787343406902693; + lats[2259]=-68.85764216640419; + lats[2260]=-68.927940925840304; + lats[2261]=-68.998239685210365; + lats[2262]=-69.068538444513763; + lats[2263]=-69.138837203749759; + lats[2264]=-69.209135962917699; + lats[2265]=-69.279434722016902; + lats[2266]=-69.349733481046613; + lats[2267]=-69.420032240006194; + lats[2268]=-69.490330998894862; + lats[2269]=-69.560629757711908; + lats[2270]=-69.630928516456592; + lats[2271]=-69.701227275128161; + lats[2272]=-69.771526033725834; + lats[2273]=-69.841824792248843; + lats[2274]=-69.912123550696421; + lats[2275]=-69.982422309067744; + lats[2276]=-70.052721067362043; + lats[2277]=-70.123019825578467; + lats[2278]=-70.193318583716191; + lats[2279]=-70.263617341774406; + lats[2280]=-70.333916099752187; + lats[2281]=-70.404214857648739; + lats[2282]=-70.474513615463138; + lats[2283]=-70.544812373194532; + lats[2284]=-70.615111130841967; + lats[2285]=-70.685409888404578; + lats[2286]=-70.755708645881384; + lats[2287]=-70.826007403271475; + lats[2288]=-70.896306160573886; + lats[2289]=-70.966604917787635; + lats[2290]=-71.036903674911756; + lats[2291]=-71.107202431945211; + lats[2292]=-71.177501188887007; + lats[2293]=-71.247799945736105; + lats[2294]=-71.318098702491469; + lats[2295]=-71.388397459152031; + lats[2296]=-71.458696215716685; + lats[2297]=-71.528994972184378; + lats[2298]=-71.599293728553988; + lats[2299]=-71.669592484824364; + lats[2300]=-71.739891240994368; + lats[2301]=-71.810189997062835; + lats[2302]=-71.880488753028587; + lats[2303]=-71.950787508890414; + lats[2304]=-72.02108626464711; + lats[2305]=-72.091385020297409; + lats[2306]=-72.161683775840089; + lats[2307]=-72.231982531273843; + lats[2308]=-72.302281286597392; + lats[2309]=-72.3725800418094; + lats[2310]=-72.442878796908545; + lats[2311]=-72.513177551893421; + lats[2312]=-72.583476306762691; + lats[2313]=-72.653775061514935; + lats[2314]=-72.724073816148703; + lats[2315]=-72.794372570662574; + lats[2316]=-72.864671325055056; + lats[2317]=-72.934970079324657; + lats[2318]=-73.005268833469799; + lats[2319]=-73.075567587489019; + lats[2320]=-73.145866341380668; + lats[2321]=-73.216165095143182; + lats[2322]=-73.2864638487749; + lats[2323]=-73.356762602274188; + lats[2324]=-73.427061355639339; + lats[2325]=-73.497360108868662; + lats[2326]=-73.567658861960396; + lats[2327]=-73.637957614912779; + lats[2328]=-73.70825636772399; + lats[2329]=-73.778555120392184; + lats[2330]=-73.848853872915541; + lats[2331]=-73.919152625292114; + lats[2332]=-73.98945137751997; + lats[2333]=-74.059750129597163; + lats[2334]=-74.13004888152166; + lats[2335]=-74.200347633291472; + lats[2336]=-74.270646384904481; + lats[2337]=-74.340945136358584; + lats[2338]=-74.411243887651622; + lats[2339]=-74.481542638781434; + lats[2340]=-74.551841389745761; + lats[2341]=-74.622140140542356; + lats[2342]=-74.692438891168877; + lats[2343]=-74.762737641622991; + lats[2344]=-74.833036391902269; + lats[2345]=-74.903335142004323; + lats[2346]=-74.973633891926625; + lats[2347]=-75.043932641666672; + lats[2348]=-75.114231391221821; + lats[2349]=-75.184530140589501; + lats[2350]=-75.254828889766983; + lats[2351]=-75.325127638751567; + lats[2352]=-75.395426387540439; + lats[2353]=-75.465725136130786; + lats[2354]=-75.536023884519707; + lats[2355]=-75.60632263270422; + lats[2356]=-75.67662138068134; + lats[2357]=-75.746920128447996; + lats[2358]=-75.81721887600105; + lats[2359]=-75.887517623337317; + lats[2360]=-75.957816370453543; + lats[2361]=-76.028115117346374; + lats[2362]=-76.098413864012443; + lats[2363]=-76.16871261044831; + lats[2364]=-76.239011356650423; + lats[2365]=-76.3093101026152; + lats[2366]=-76.379608848338933; + lats[2367]=-76.449907593817869; + lats[2368]=-76.520206339048215; + lats[2369]=-76.59050508402602; + lats[2370]=-76.660803828747362; + lats[2371]=-76.731102573208048; + lats[2372]=-76.801401317404; + lats[2373]=-76.871700061330955; + lats[2374]=-76.941998804984564; + lats[2375]=-77.012297548360323; + lats[2376]=-77.082596291453768; + lats[2377]=-77.15289503426024; + lats[2378]=-77.22319377677502; + lats[2379]=-77.293492518993247; + lats[2380]=-77.363791260909963; + lats[2381]=-77.434090002520122; + lats[2382]=-77.504388743818524; + lats[2383]=-77.574687484799924; + lats[2384]=-77.644986225458879; + lats[2385]=-77.71528496578982; + lats[2386]=-77.785583705787161; + lats[2387]=-77.855882445445019; + lats[2388]=-77.926181184757539; + lats[2389]=-77.996479923718596; + lats[2390]=-78.066778662322022; + lats[2391]=-78.137077400561424; + lats[2392]=-78.207376138430348; + lats[2393]=-78.277674875922045; + lats[2394]=-78.347973613029708; + lats[2395]=-78.418272349746417; + lats[2396]=-78.488571086064923; + lats[2397]=-78.558869821977908; + lats[2398]=-78.629168557477882; + lats[2399]=-78.699467292557102; + lats[2400]=-78.769766027207638; + lats[2401]=-78.840064761421445; + lats[2402]=-78.910363495190211; + lats[2403]=-78.980662228505423; + lats[2404]=-79.050960961358285; + lats[2405]=-79.121259693739859; + lats[2406]=-79.191558425640977; + lats[2407]=-79.261857157052191; + lats[2408]=-79.332155887963822; + lats[2409]=-79.402454618365894; + lats[2410]=-79.472753348248219; + lats[2411]=-79.543052077600308; + lats[2412]=-79.61335080641139; + lats[2413]=-79.683649534670437; + lats[2414]=-79.753948262366038; + lats[2415]=-79.824246989486554; + lats[2416]=-79.894545716019948; + lats[2417]=-79.9648444419539; + lats[2418]=-80.035143167275749; + lats[2419]=-80.105441891972376; + lats[2420]=-80.175740616030438; + lats[2421]=-80.246039339436052; + lats[2422]=-80.316338062175078; + lats[2423]=-80.386636784232863; + lats[2424]=-80.456935505594302; + lats[2425]=-80.527234226243991; + lats[2426]=-80.59753294616587; + lats[2427]=-80.667831665343556; + lats[2428]=-80.73813038376008; + lats[2429]=-80.808429101397948; + lats[2430]=-80.878727818239184; + lats[2431]=-80.949026534265244; + lats[2432]=-81.019325249456955; + lats[2433]=-81.089623963794551; + lats[2434]=-81.159922677257711; + lats[2435]=-81.230221389825374; + lats[2436]=-81.300520101475826; + lats[2437]=-81.370818812186627; + lats[2438]=-81.441117521934686; + lats[2439]=-81.511416230696042; + lats[2440]=-81.581714938445955; + lats[2441]=-81.652013645158945; + lats[2442]=-81.722312350808508; + lats[2443]=-81.792611055367345; + lats[2444]=-81.862909758807191; + lats[2445]=-81.933208461098829; + lats[2446]=-82.003507162211946; + lats[2447]=-82.073805862115165; + lats[2448]=-82.144104560776; + lats[2449]=-82.214403258160871; + lats[2450]=-82.284701954234833; + lats[2451]=-82.355000648961692; + lats[2452]=-82.425299342304029; + lats[2453]=-82.495598034222837; + lats[2454]=-82.56589672467787; + lats[2455]=-82.63619541362705; + lats[2456]=-82.706494101026948; + lats[2457]=-82.77679278683226; + lats[2458]=-82.84709147099602; + lats[2459]=-82.917390153469313; + lats[2460]=-82.987688834201322; + lats[2461]=-83.057987513139125; + lats[2462]=-83.128286190227698; + lats[2463]=-83.198584865409657; + lats[2464]=-83.268883538625232; + lats[2465]=-83.339182209812321; + lats[2466]=-83.409480878905782; + lats[2467]=-83.479779545838113; + lats[2468]=-83.550078210538487; + lats[2469]=-83.620376872933264; + lats[2470]=-83.690675532945292; + lats[2471]=-83.760974190494011; + lats[2472]=-83.831272845495249; + lats[2473]=-83.901571497860914; + lats[2474]=-83.971870147498763; + lats[2475]=-84.042168794312317; + lats[2476]=-84.112467438200326; + lats[2477]=-84.18276607905679; + lats[2478]=-84.253064716770425; + lats[2479]=-84.323363351224444; + lats[2480]=-84.393661982296322; + lats[2481]=-84.463960609857125; + lats[2482]=-84.534259233771479; + lats[2483]=-84.604557853896708; + lats[2484]=-84.674856470082915; + lats[2485]=-84.745155082171991; + lats[2486]=-84.81545368999717; + lats[2487]=-84.885752293382765; + lats[2488]=-84.95605089214304; + lats[2489]=-85.026349486081983; + lats[2490]=-85.09664807499216; + lats[2491]=-85.16694665865414; + lats[2492]=-85.237245236835548; + lats[2493]=-85.307543809290152; + lats[2494]=-85.377842375756586; + lats[2495]=-85.448140935957483; + lats[2496]=-85.518439489597966; + lats[2497]=-85.588738036364362; + lats[2498]=-85.659036575922883; + lats[2499]=-85.729335107917464; + lats[2500]=-85.799633631968391; + lats[2501]=-85.869932147670127; + lats[2502]=-85.940230654588888; + lats[2503]=-86.010529152260403; + lats[2504]=-86.080827640187209; + lats[2505]=-86.151126117835304; + lats[2506]=-86.221424584631109; + lats[2507]=-86.291723039957418; + lats[2508]=-86.362021483149363; + lats[2509]=-86.432319913489792; + lats[2510]=-86.502618330203831; + lats[2511]=-86.572916732453024; + lats[2512]=-86.643215119328573; + lats[2513]=-86.713513489844246; + lats[2514]=-86.783811842927179; + lats[2515]=-86.854110177408927; + lats[2516]=-86.924408492014166; + lats[2517]=-86.994706785348129; + lats[2518]=-87.065005055882821; + lats[2519]=-87.135303301939786; + lats[2520]=-87.205601521672108; + lats[2521]=-87.275899713041966; + lats[2522]=-87.346197873795816; + lats[2523]=-87.416496001434894; + lats[2524]=-87.486794093180748; + lats[2525]=-87.557092145935584; + lats[2526]=-87.627390156234085; + lats[2527]=-87.697688120188062; + lats[2528]=-87.767986033419561; + lats[2529]=-87.838283890981543; + lats[2530]=-87.908581687261687; + lats[2531]=-87.978879415867283; + lats[2532]=-88.049177069484486; + lats[2533]=-88.119474639706425; + lats[2534]=-88.189772116820762; + lats[2535]=-88.26006948954614; + lats[2536]=-88.330366744702559; + lats[2537]=-88.40066386679355; + lats[2538]=-88.470960837474877; + lats[2539]=-88.541257634868515; + lats[2540]=-88.611554232668382; + lats[2541]=-88.681850598961759; + lats[2542]=-88.752146694650691; + lats[2543]=-88.822442471310097; + lats[2544]=-88.892737868230952; + lats[2545]=-88.96303280826325; + lats[2546]=-89.033327191845927; + lats[2547]=-89.103620888238879; + lats[2548]=-89.173913722284126; + lats[2549]=-89.24420545380525; + lats[2550]=-89.314495744374256; + lats[2551]=-89.3847841013921; + lats[2552]=-89.45506977912261; + lats[2553]=-89.525351592371393; + lats[2554]=-89.595627537554492; + lats[2555]=-89.6658939412157; + lats[2556]=-89.736143271609578; + lats[2557]=-89.806357319542244; + lats[2558]=-89.876478353332288; + lats[2559]=-89.946187715665616; + return GRIB_SUCCESS; +} + +/* Performance: return the precomputed latitudes for N=640 */ +static int get_precomputed_latitudes_N640(double* lats) +{ + lats[0] = 89.892396445590066; + lats[1] = 89.753004943174034; + lats[2] = 89.612790258599077; + lats[3] = 89.472389582061126; + lats[4] = 89.331918354381827; + lats[5] = 89.191412986832432; + lats[6] = 89.050888539966436; + lats[7] = 88.91035235926023; + lats[8] = 88.76980845110036; + lats[9] = 88.629259185411627; + lats[10] = 88.488706053376362; + lats[11] = 88.348150039999084; + lats[12] = 88.207591822004105; + lats[13] = 88.067031879650926; + lats[14] = 87.926470563186442; + lats[15] = 87.785908134040668; + lats[16] = 87.645344791295628; + lats[17] = 87.504780689222315; + lats[18] = 87.364215949214667; + lats[19] = 87.223650668104085; + lats[20] = 87.083084924070917; + lats[21] = 86.942518780928566; + lats[22] = 86.801952291278369; + lats[23] = 86.661385498868242; + lats[24] = 86.520818440379529; + lats[25] = 86.380251146798656; + lats[26] = 86.239683644481104; + lats[27] = 86.0991159559849; + lats[28] = 85.958548100730781; + lats[29] = 85.817980095529578; + lats[30] = 85.677411955006008; + lats[31] = 85.536843691942948; + lats[32] = 85.396275317562669; + lats[33] = 85.255706841757572; + lats[34] = 85.115138273281829; + lats[35] = 84.974569619910426; + lats[36] = 84.834000888572191; + lats[37] = 84.693432085462035; + lats[38] = 84.552863216135577; + lats[39] = 84.412294285589354; + lats[40] = 84.271725298329656; + lats[41] = 84.131156258431133; + lats[42] = 83.990587169587158; + lats[43] = 83.850018035153667; + lats[44] = 83.709448858186462; + lats[45] = 83.568879641474325; + lats[46] = 83.428310387567549; + lats[47] = 83.287741098802584; + lats[48] = 83.147171777324388; + lats[49] = 83.006602425105484; + lats[50] = 82.866033043962815; + lats[51] = 82.725463635573107; + lats[52] = 82.584894201485696; + lats[53] = 82.444324743134914; + lats[54] = 82.303755261850071; + lats[55] = 82.163185758865239; + lats[56] = 82.022616235327504; + lats[57] = 81.882046692304485; + lats[58] = 81.741477130791196; + lats[59] = 81.600907551715878; + lats[60] = 81.460337955945846; + lats[61] = 81.319768344292086; + lats[62] = 81.179198717514012; + lats[63] = 81.038629076323318; + lats[64] = 80.898059421387785; + lats[65] = 80.757489753334553; + lats[66] = 80.616920072753146; + lats[67] = 80.47635038019834; + lats[68] = 80.335780676192584; + lats[69] = 80.195210961228469; + lats[70] = 80.054641235770603; + lats[71] = 79.914071500257819; + lats[72] = 79.773501755104689; + lats[73] = 79.632932000703448; + lats[74] = 79.492362237425226; + lats[75] = 79.351792465621628; + lats[76] = 79.211222685625927; + lats[77] = 79.070652897754229; + lats[78] = 78.930083102306568; + lats[79] = 78.789513299567957; + lats[80] = 78.648943489809355; + lats[81] = 78.508373673288318; + lats[82] = 78.367803850250056; + lats[83] = 78.227234020928066; + lats[84] = 78.086664185544819; + lats[85] = 77.946094344312371; + lats[86] = 77.805524497433041; + lats[87] = 77.664954645099883; + lats[88] = 77.524384787497311; + lats[89] = 77.383814924801513; + lats[90] = 77.243245057180829; + lats[91] = 77.102675184796354; + lats[92] = 76.962105307802219; + lats[93] = 76.821535426345932; + lats[94] = 76.680965540568806; + lats[95] = 76.540395650606285; + lats[96] = 76.399825756588143; + lats[97] = 76.259255858638895; + lats[98] = 76.118685956877997; + lats[99] = 75.978116051420102; + lats[100] = 75.837546142375359; + lats[101] = 75.69697622984954; + lats[102] = 75.556406313944308; + lats[103] = 75.41583639475742; + lats[104] = 75.275266472382896; + lats[105] = 75.134696546911186; + lats[106] = 74.994126618429377; + lats[107] = 74.853556687021296; + lats[108] = 74.712986752767719; + lats[109] = 74.57241681574645; + lats[110] = 74.431846876032495; + lats[111] = 74.291276933698185; + lats[112] = 74.150706988813226; + lats[113] = 74.010137041445006; + lats[114] = 73.869567091658411; + lats[115] = 73.728997139516167; + lats[116] = 73.588427185078871; + lats[117] = 73.447857228405013; + lats[118] = 73.307287269551111; + lats[119] = 73.166717308571819; + lats[120] = 73.026147345520002; + lats[121] = 72.885577380446747; + lats[122] = 72.745007413401481; + lats[123] = 72.604437444432065; + lats[124] = 72.463867473584784; + lats[125] = 72.323297500904502; + lats[126] = 72.182727526434604; + lats[127] = 72.042157550217183; + lats[128] = 71.901587572292982; + lats[129] = 71.761017592701492; + lats[130] = 71.620447611481026; + lats[131] = 71.47987762866866; + lats[132] = 71.339307644300462; + lats[133] = 71.198737658411332; + lats[134] = 71.058167671035164; + lats[135] = 70.917597682204899; + lats[136] = 70.777027691952398; + lats[137] = 70.636457700308753; + lats[138] = 70.495887707304007; + lats[139] = 70.355317712967462; + lats[140] = 70.214747717327526; + lats[141] = 70.074177720411782; + lats[142] = 69.933607722247146; + lats[143] = 69.793037722859665; + lats[144] = 69.65246772227475; + lats[145] = 69.511897720517084; + lats[146] = 69.37132771761064; + lats[147] = 69.230757713578825; + lats[148] = 69.090187708444333; + lats[149] = 68.949617702229318; + lats[150] = 68.809047694955296; + lats[151] = 68.668477686643286; + lats[152] = 68.52790767731365; + lats[153] = 68.387337666986312; + lats[154] = 68.246767655680657; + lats[155] = 68.106197643415527; + lats[156] = 67.965627630209354; + lats[157] = 67.825057616080073; + lats[158] = 67.684487601045149; + lats[159] = 67.543917585121662; + lats[160] = 67.403347568326168; + lats[161] = 67.262777550674912; + lats[162] = 67.122207532183722; + lats[163] = 66.981637512867991; + lats[164] = 66.841067492742795; + lats[165] = 66.700497471822814; + lats[166] = 66.559927450122359; + lats[167] = 66.41935742765547; + lats[168] = 66.278787404435761; + lats[169] = 66.138217380476604; + lats[170] = 65.997647355791017; + lats[171] = 65.85707733039176; + lats[172] = 65.716507304291198; + lats[173] = 65.575937277501538; + lats[174] = 65.435367250034616; + lats[175] = 65.294797221902016; + lats[176] = 65.154227193115119; + lats[177] = 65.013657163684968; + lats[178] = 64.873087133622406; + lats[179] = 64.732517102938033; + lats[180] = 64.591947071642196; + lats[181] = 64.451377039745026; + lats[182] = 64.310807007256443; + lats[183] = 64.170236974186125; + lats[184] = 64.029666940543564; + lats[185] = 63.889096906338061; + lats[186] = 63.748526871578648; + lats[187] = 63.607956836274255; + lats[188] = 63.467386800433559; + lats[189] = 63.326816764065093; + lats[190] = 63.186246727177178; + lats[191] = 63.045676689778013; + lats[192] = 62.905106651875542; + lats[193] = 62.764536613477638; + lats[194] = 62.62396657459194; + lats[195] = 62.483396535225978; + lats[196] = 62.342826495387122; + lats[197] = 62.202256455082583; + lats[198] = 62.061686414319418; + lats[199] = 61.921116373104539; + lats[200] = 61.780546331444761; + lats[201] = 61.639976289346727; + lats[202] = 61.499406246816953; + lats[203] = 61.358836203861841; + lats[204] = 61.21826616048768; + lats[205] = 61.077696116700601; + lats[206] = 60.937126072506608; + lats[207] = 60.796556027911663; + lats[208] = 60.655985982921543; + lats[209] = 60.515415937541938; + lats[210] = 60.374845891778421; + lats[211] = 60.234275845636503; + lats[212] = 60.093705799121537; + lats[213] = 59.953135752238794; + lats[214] = 59.812565704993467; + lats[215] = 59.671995657390596; + lats[216] = 59.531425609435225; + lats[217] = 59.390855561132213; + lats[218] = 59.250285512486386; + lats[219] = 59.10971546350244; + lats[220] = 58.96914541418505; + lats[221] = 58.828575364538722; + lats[222] = 58.688005314567938; + lats[223] = 58.547435264277105; + lats[224] = 58.406865213670514; + lats[225] = 58.266295162752428; + lats[226] = 58.125725111526968; + lats[227] = 57.985155059998249; + lats[228] = 57.844585008170284; + lats[229] = 57.704014956047033; + lats[230] = 57.563444903632337; + lats[231] = 57.422874850930043; + lats[232] = 57.282304797943887; + lats[233] = 57.141734744677549; + lats[234] = 57.001164691134662; + lats[235] = 56.860594637318769; + lats[236] = 56.720024583233375; + lats[237] = 56.579454528881925; + lats[238] = 56.438884474267795; + lats[239] = 56.29831441939433; + lats[240] = 56.157744364264779; + lats[241] = 56.017174308882367; + lats[242] = 55.876604253250278; + lats[243] = 55.736034197371588; + lats[244] = 55.595464141249401; + lats[245] = 55.45489408488671; + lats[246] = 55.314324028286471; + lats[247] = 55.173753971451625; + lats[248] = 55.033183914385013; + lats[249] = 54.892613857089486; + lats[250] = 54.752043799567822; + lats[251] = 54.611473741822735; + lats[252] = 54.470903683856939; + lats[253] = 54.330333625673063; + lats[254] = 54.189763567273758; + lats[255] = 54.049193508661538; + lats[256] = 53.90862344983897; + lats[257] = 53.768053390808532; + lats[258] = 53.627483331572677; + lats[259] = 53.486913272133812; + lats[260] = 53.346343212494332; + lats[261] = 53.205773152656562; + lats[262] = 53.065203092622802; + lats[263] = 52.924633032395342; + lats[264] = 52.784062971976404; + lats[265] = 52.643492911368206; + lats[266] = 52.502922850572908; + lats[267] = 52.362352789592649; + lats[268] = 52.221782728429538; + lats[269] = 52.081212667085637; + lats[270] = 51.940642605563028; + lats[271] = 51.800072543863692; + lats[272] = 51.659502481989627; + lats[273] = 51.518932419942786; + lats[274] = 51.378362357725095; + lats[275] = 51.237792295338465; + lats[276] = 51.097222232784773; + lats[277] = 50.956652170065858; + lats[278] = 50.81608210718354; + lats[279] = 50.675512044139623; + lats[280] = 50.534941980935862; + lats[281] = 50.39437191757402; + lats[282] = 50.253801854055808; + lats[283] = 50.113231790382912; + lats[284] = 49.972661726557028; + lats[285] = 49.832091662579785; + lats[286] = 49.691521598452823; + lats[287] = 49.550951534177734; + lats[288] = 49.410381469756118; + lats[289] = 49.269811405189529; + lats[290] = 49.129241340479489; + lats[291] = 48.988671275627539; + lats[292] = 48.848101210635171; + lats[293] = 48.707531145503857; + lats[294] = 48.56696108023506; + lats[295] = 48.42639101483023; + lats[296] = 48.285820949290759; + lats[297] = 48.145250883618075; + lats[298] = 48.004680817813544; + lats[299] = 47.864110751878535; + lats[300] = 47.723540685814392; + lats[301] = 47.582970619622444; + lats[302] = 47.442400553303997; + lats[303] = 47.301830486860368; + lats[304] = 47.161260420292813; + lats[305] = 47.020690353602596; + lats[306] = 46.880120286790955; + lats[307] = 46.73955021985914; + lats[308] = 46.598980152808338; + lats[309] = 46.458410085639763; + lats[310] = 46.317840018354602; + lats[311] = 46.177269950954006; + lats[312] = 46.036699883439134; + lats[313] = 45.896129815811136; + lats[314] = 45.755559748071114; + lats[315] = 45.614989680220205; + lats[316] = 45.474419612259481; + lats[317] = 45.333849544190024; + lats[318] = 45.193279476012933; + lats[319] = 45.052709407729239; + lats[320] = 44.912139339339987; + lats[321] = 44.771569270846214; + lats[322] = 44.630999202248923; + lats[323] = 44.490429133549149; + lats[324] = 44.349859064747854; + lats[325] = 44.209288995846045; + lats[326] = 44.068718926844674; + lats[327] = 43.928148857744716; + lats[328] = 43.787578788547094; + lats[329] = 43.64700871925276; + lats[330] = 43.506438649862638; + lats[331] = 43.365868580377636; + lats[332] = 43.225298510798666; + lats[333] = 43.0847284411266; + lats[334] = 42.944158371362349; + lats[335] = 42.803588301506764; + lats[336] = 42.663018231560706; + lats[337] = 42.522448161525034; + lats[338] = 42.381878091400594; + lats[339] = 42.241308021188203; + lats[340] = 42.100737950888686; + lats[341] = 41.960167880502873; + lats[342] = 41.819597810031553; + lats[343] = 41.679027739475522; + lats[344] = 41.538457668835562; + lats[345] = 41.397887598112455; + lats[346] = 41.257317527306981; + lats[347] = 41.116747456419873; + lats[348] = 40.976177385451912; + lats[349] = 40.835607314403816; + lats[350] = 40.695037243276325; + lats[351] = 40.554467172070169; + lats[352] = 40.41389710078608; + lats[353] = 40.273327029424742; + lats[354] = 40.132756957986885; + lats[355] = 39.992186886473185; + lats[356] = 39.851616814884331; + lats[357] = 39.711046743220997; + lats[358] = 39.570476671483874; + lats[359] = 39.429906599673615; + lats[360] = 39.289336527790894; + lats[361] = 39.148766455836338; + lats[362] = 39.008196383810613; + lats[363] = 38.867626311714339; + lats[364] = 38.727056239548169; + lats[365] = 38.5864861673127; + lats[366] = 38.44591609500857; + lats[367] = 38.305346022636385; + lats[368] = 38.164775950196741; + lats[369] = 38.02420587769025; + lats[370] = 37.883635805117493; + lats[371] = 37.743065732479067; + lats[372] = 37.602495659775542; + lats[373] = 37.461925587007492; + lats[374] = 37.321355514175501; + lats[375] = 37.180785441280122; + lats[376] = 37.040215368321896; + lats[377] = 36.899645295301404; + lats[378] = 36.759075222219167; + lats[379] = 36.618505149075737; + lats[380] = 36.477935075871656; + lats[381] = 36.33736500260742; + lats[382] = 36.196794929283605; + lats[383] = 36.056224855900687; + lats[384] = 35.9156547824592; + lats[385] = 35.775084708959632; + lats[386] = 35.634514635402525; + lats[387] = 35.493944561788332; + lats[388] = 35.353374488117588; + lats[389] = 35.21280441439076; + lats[390] = 35.072234340608333; + lats[391] = 34.931664266770788; + lats[392] = 34.79109419287861; + lats[393] = 34.650524118932253; + lats[394] = 34.509954044932208; + lats[395] = 34.369383970878907; + lats[396] = 34.228813896772813; + lats[397] = 34.088243822614395; + lats[398] = 33.9476737484041; + lats[399] = 33.807103674142361; + lats[400] = 33.66653359982962; + lats[401] = 33.525963525466317; + lats[402] = 33.385393451052892; + lats[403] = 33.244823376589757; + lats[404] = 33.104253302077339; + lats[405] = 32.963683227516071; + lats[406] = 32.823113152906366; + lats[407] = 32.682543078248621; + lats[408] = 32.541973003543255; + lats[409] = 32.401402928790681; + lats[410] = 32.260832853991289; + lats[411] = 32.120262779145477; + lats[412] = 31.979692704253651; + lats[413] = 31.839122629316183; + lats[414] = 31.698552554333489; + lats[415] = 31.55798247930592; + lats[416] = 31.417412404233875; + lats[417] = 31.276842329117731; + lats[418] = 31.136272253957859; + lats[419] = 30.99570217875463; + lats[420] = 30.855132103508407; + lats[421] = 30.71456202821955; + lats[422] = 30.573991952888438; + lats[423] = 30.433421877515418; + lats[424] = 30.292851802100841; + lats[425] = 30.152281726645064; + lats[426] = 30.011711651148435; + lats[427] = 29.87114157561129; + lats[428] = 29.730571500033992; + lats[429] = 29.590001424416862; + lats[430] = 29.449431348760253; + lats[431] = 29.308861273064483; + lats[432] = 29.168291197329893; + lats[433] = 29.027721121556816; + lats[434] = 28.887151045745565; + lats[435] = 28.746580969896474; + lats[436] = 28.606010894009859; + lats[437] = 28.465440818086037; + lats[438] = 28.324870742125327; + lats[439] = 28.184300666128038; + lats[440] = 28.043730590094491; + lats[441] = 27.903160514024975; + lats[442] = 27.762590437919812; + lats[443] = 27.622020361779295; + lats[444] = 27.481450285603731; + lats[445] = 27.340880209393415; + lats[446] = 27.200310133148644; + lats[447] = 27.05974005686971; + lats[448] = 26.919169980556905; + lats[449] = 26.778599904210516; + lats[450] = 26.638029827830831; + lats[451] = 26.497459751418134; + lats[452] = 26.356889674972713; + lats[453] = 26.216319598494842; + lats[454] = 26.075749521984797; + lats[455] = 25.935179445442859; + lats[456] = 25.794609368869299; + lats[457] = 25.654039292264386; + lats[458] = 25.513469215628398; + lats[459] = 25.3728991389616; + lats[460] = 25.232329062264245; + lats[461] = 25.091758985536615; + lats[462] = 24.951188908778963; + lats[463] = 24.810618831991551; + lats[464] = 24.670048755174633; + lats[465] = 24.529478678328466; + lats[466] = 24.388908601453309; + lats[467] = 24.248338524549407; + lats[468] = 24.107768447617016; + lats[469] = 23.96719837065638; + lats[470] = 23.826628293667756; + lats[471] = 23.686058216651375; + lats[472] = 23.545488139607492; + lats[473] = 23.404918062536346; + lats[474] = 23.264347985438178; + lats[475] = 23.123777908313219; + lats[476] = 22.98320783116171; + lats[477] = 22.84263775398389; + lats[478] = 22.70206767677999; + lats[479] = 22.561497599550243; + lats[480] = 22.420927522294875; + lats[481] = 22.280357445014126; + lats[482] = 22.139787367708202; + lats[483] = 21.999217290377352; + lats[484] = 21.858647213021786; + lats[485] = 21.718077135641735; + lats[486] = 21.577507058237412; + lats[487] = 21.436936980809044; + lats[488] = 21.296366903356844; + lats[489] = 21.155796825881037; + lats[490] = 21.015226748381831; + lats[491] = 20.874656670859444; + lats[492] = 20.734086593314085; + lats[493] = 20.593516515745968; + lats[494] = 20.452946438155308; + lats[495] = 20.312376360542309; + lats[496] = 20.171806282907177; + lats[497] = 20.031236205250121; + lats[498] = 19.890666127571347; + lats[499] = 19.750096049871054; + lats[500] = 19.609525972149449; + lats[501] = 19.468955894406733; + lats[502] = 19.328385816643106; + lats[503] = 19.187815738858767; + lats[504] = 19.04724566105391; + lats[505] = 18.906675583228736; + lats[506] = 18.766105505383443; + lats[507] = 18.625535427518219; + lats[508] = 18.484965349633256; + lats[509] = 18.344395271728757; + lats[510] = 18.203825193804899; + lats[511] = 18.063255115861882; + lats[512] = 17.922685037899889; + lats[513] = 17.782114959919113; + lats[514] = 17.641544881919739; + lats[515] = 17.500974803901951; + lats[516] = 17.360404725865926; + lats[517] = 17.219834647811862; + lats[518] = 17.079264569739937; + lats[519] = 16.938694491650331; + lats[520] = 16.798124413543224; + lats[521] = 16.657554335418794; + lats[522] = 16.516984257277226; + lats[523] = 16.376414179118694; + lats[524] = 16.235844100943371; + lats[525] = 16.09527402275144; + lats[526] = 15.954703944543072; + lats[527] = 15.814133866318445; + lats[528] = 15.673563788077727; + lats[529] = 15.532993709821094; + lats[530] = 15.392423631548718; + lats[531] = 15.251853553260768; + lats[532] = 15.111283474957411; + lats[533] = 14.970713396638821; + lats[534] = 14.830143318305167; + lats[535] = 14.689573239956617; + lats[536] = 14.549003161593328; + lats[537] = 14.408433083215476; + lats[538] = 14.267863004823225; + lats[539] = 14.127292926416734; + lats[540] = 13.986722847996173; + lats[541] = 13.8461527695617; + lats[542] = 13.705582691113481; + lats[543] = 13.565012612651675; + lats[544] = 13.424442534176441; + lats[545] = 13.283872455687943; + lats[546] = 13.143302377186339; + lats[547] = 13.002732298671786; + lats[548] = 12.862162220144443; + lats[549] = 12.72159214160447; + lats[550] = 12.58102206305202; + lats[551] = 12.440451984487247; + lats[552] = 12.299881905910311; + lats[553] = 12.159311827321366; + lats[554] = 12.018741748720567; + lats[555] = 11.878171670108063; + lats[556] = 11.73760159148401; + lats[557] = 11.597031512848561; + lats[558] = 11.456461434201868; + lats[559] = 11.315891355544077; + lats[560] = 11.175321276875344; + lats[561] = 11.034751198195819; + lats[562] = 10.894181119505649; + lats[563] = 10.753611040804984; + lats[564] = 10.613040962093971; + lats[565] = 10.472470883372759; + lats[566] = 10.331900804641496; + lats[567] = 10.191330725900327; + lats[568] = 10.050760647149401; + lats[569] = 9.9101905683888614; + lats[570] = 9.7696204896188554; + lats[571] = 9.6290504108395272; + lats[572] = 9.4884803320510205; + lats[573] = 9.3479102532534792; + lats[574] = 9.2073401744470491; + lats[575] = 9.0667700956318686; + lats[576] = 8.9262000168080871; + lats[577] = 8.7856299379758411; + lats[578] = 8.645059859135273; + lats[579] = 8.5044897802865282; + lats[580] = 8.3639197014297419; + lats[581] = 8.223349622565058; + lats[582] = 8.0827795436926184; + lats[583] = 7.9422094648125583; + lats[584] = 7.8016393859250206; + lats[585] = 7.661069307030143; + lats[586] = 7.5204992281280649; + lats[587] = 7.3799291492189223; + lats[588] = 7.2393590703028563; + lats[589] = 7.098788991380002; + lats[590] = 6.9582189124504987; + lats[591] = 6.8176488335144816; + lats[592] = 6.6770787545720891; + lats[593] = 6.5365086756234554; + lats[594] = 6.3959385966687181; + lats[595] = 6.2553685177080123; + lats[596] = 6.1147984387414738; + lats[597] = 5.9742283597692367; + lats[598] = 5.833658280791437; + lats[599] = 5.6930882018082087; + lats[600] = 5.5525181228196869; + lats[601] = 5.4119480438260039; + lats[602] = 5.2713779648272956; + lats[603] = 5.1308078858236934; + lats[604] = 4.9902378068153324; + lats[605] = 4.8496677278023448; + lats[606] = 4.7090976487848639; + lats[607] = 4.5685275697630221; + lats[608] = 4.4279574907369508; + lats[609] = 4.2873874117067841; + lats[610] = 4.1468173326726534; + lats[611] = 4.0062472536346903; + lats[612] = 3.8656771745930261; + lats[613] = 3.7251070955477918; + lats[614] = 3.5845370164991213; + lats[615] = 3.4439669374471427; + lats[616] = 3.3033968583919884; + lats[617] = 3.1628267793337885; + lats[618] = 3.0222567002726746; + lats[619] = 2.8816866212087762; + lats[620] = 2.7411165421422243; + lats[621] = 2.6005464630731496; + lats[622] = 2.4599763840016813; + lats[623] = 2.3194063049279499; + lats[624] = 2.1788362258520855; + lats[625] = 2.0382661467742174; + lats[626] = 1.8976960676944756; + lats[627] = 1.7571259886129893; + lats[628] = 1.6165559095298885; + lats[629] = 1.4759858304453026; + lats[630] = 1.3354157513593612; + lats[631] = 1.194845672272193; + lats[632] = 1.0542755931839276; + lats[633] = 0.91370551409469447; + lats[634] = 0.77313543500462234; + lats[635] = 0.63256535591384055; + lats[636] = 0.49199527682247807; + lats[637] = 0.351425197730664; + lats[638] = 0.21085511863852741; + lats[639] = 0.070285039546197275; + lats[640] = -0.070285039546197275; + lats[641] = -0.21085511863852741; + lats[642] = -0.351425197730664; + lats[643] = -0.49199527682247807; + lats[644] = -0.63256535591384055; + lats[645] = -0.77313543500462234; + lats[646] = -0.91370551409469447; + lats[647] = -1.0542755931839276; + lats[648] = -1.194845672272193; + lats[649] = -1.3354157513593612; + lats[650] = -1.4759858304453026; + lats[651] = -1.6165559095298885; + lats[652] = -1.7571259886129893; + lats[653] = -1.8976960676944756; + lats[654] = -2.0382661467742174; + lats[655] = -2.1788362258520855; + lats[656] = -2.3194063049279499; + lats[657] = -2.4599763840016813; + lats[658] = -2.6005464630731496; + lats[659] = -2.7411165421422243; + lats[660] = -2.8816866212087762; + lats[661] = -3.0222567002726746; + lats[662] = -3.1628267793337885; + lats[663] = -3.3033968583919884; + lats[664] = -3.4439669374471427; + lats[665] = -3.5845370164991213; + lats[666] = -3.7251070955477918; + lats[667] = -3.8656771745930261; + lats[668] = -4.0062472536346903; + lats[669] = -4.1468173326726534; + lats[670] = -4.2873874117067841; + lats[671] = -4.4279574907369508; + lats[672] = -4.5685275697630221; + lats[673] = -4.7090976487848639; + lats[674] = -4.8496677278023448; + lats[675] = -4.9902378068153324; + lats[676] = -5.1308078858236934; + lats[677] = -5.2713779648272956; + lats[678] = -5.4119480438260039; + lats[679] = -5.5525181228196869; + lats[680] = -5.6930882018082087; + lats[681] = -5.833658280791437; + lats[682] = -5.9742283597692367; + lats[683] = -6.1147984387414738; + lats[684] = -6.2553685177080123; + lats[685] = -6.3959385966687181; + lats[686] = -6.5365086756234554; + lats[687] = -6.6770787545720891; + lats[688] = -6.8176488335144816; + lats[689] = -6.9582189124504987; + lats[690] = -7.098788991380002; + lats[691] = -7.2393590703028563; + lats[692] = -7.3799291492189223; + lats[693] = -7.5204992281280649; + lats[694] = -7.661069307030143; + lats[695] = -7.8016393859250206; + lats[696] = -7.9422094648125583; + lats[697] = -8.0827795436926184; + lats[698] = -8.223349622565058; + lats[699] = -8.3639197014297419; + lats[700] = -8.5044897802865282; + lats[701] = -8.645059859135273; + lats[702] = -8.7856299379758411; + lats[703] = -8.9262000168080871; + lats[704] = -9.0667700956318686; + lats[705] = -9.2073401744470491; + lats[706] = -9.3479102532534792; + lats[707] = -9.4884803320510205; + lats[708] = -9.6290504108395272; + lats[709] = -9.7696204896188554; + lats[710] = -9.9101905683888614; + lats[711] = -10.050760647149401; + lats[712] = -10.191330725900327; + lats[713] = -10.331900804641496; + lats[714] = -10.472470883372759; + lats[715] = -10.613040962093971; + lats[716] = -10.753611040804984; + lats[717] = -10.894181119505649; + lats[718] = -11.034751198195819; + lats[719] = -11.175321276875344; + lats[720] = -11.315891355544077; + lats[721] = -11.456461434201868; + lats[722] = -11.597031512848561; + lats[723] = -11.73760159148401; + lats[724] = -11.878171670108063; + lats[725] = -12.018741748720567; + lats[726] = -12.159311827321366; + lats[727] = -12.299881905910311; + lats[728] = -12.440451984487247; + lats[729] = -12.58102206305202; + lats[730] = -12.72159214160447; + lats[731] = -12.862162220144443; + lats[732] = -13.002732298671786; + lats[733] = -13.143302377186339; + lats[734] = -13.283872455687943; + lats[735] = -13.424442534176441; + lats[736] = -13.565012612651675; + lats[737] = -13.705582691113481; + lats[738] = -13.8461527695617; + lats[739] = -13.986722847996173; + lats[740] = -14.127292926416734; + lats[741] = -14.267863004823225; + lats[742] = -14.408433083215476; + lats[743] = -14.549003161593328; + lats[744] = -14.689573239956617; + lats[745] = -14.830143318305167; + lats[746] = -14.970713396638821; + lats[747] = -15.111283474957411; + lats[748] = -15.251853553260768; + lats[749] = -15.392423631548718; + lats[750] = -15.532993709821094; + lats[751] = -15.673563788077727; + lats[752] = -15.814133866318445; + lats[753] = -15.954703944543072; + lats[754] = -16.09527402275144; + lats[755] = -16.235844100943371; + lats[756] = -16.376414179118694; + lats[757] = -16.516984257277226; + lats[758] = -16.657554335418794; + lats[759] = -16.798124413543224; + lats[760] = -16.938694491650331; + lats[761] = -17.079264569739937; + lats[762] = -17.219834647811862; + lats[763] = -17.360404725865926; + lats[764] = -17.500974803901951; + lats[765] = -17.641544881919739; + lats[766] = -17.782114959919113; + lats[767] = -17.922685037899889; + lats[768] = -18.063255115861882; + lats[769] = -18.203825193804899; + lats[770] = -18.344395271728757; + lats[771] = -18.484965349633256; + lats[772] = -18.625535427518219; + lats[773] = -18.766105505383443; + lats[774] = -18.906675583228736; + lats[775] = -19.04724566105391; + lats[776] = -19.187815738858767; + lats[777] = -19.328385816643106; + lats[778] = -19.468955894406733; + lats[779] = -19.609525972149449; + lats[780] = -19.750096049871054; + lats[781] = -19.890666127571347; + lats[782] = -20.031236205250121; + lats[783] = -20.171806282907177; + lats[784] = -20.312376360542309; + lats[785] = -20.452946438155308; + lats[786] = -20.593516515745968; + lats[787] = -20.734086593314085; + lats[788] = -20.874656670859444; + lats[789] = -21.015226748381831; + lats[790] = -21.155796825881037; + lats[791] = -21.296366903356844; + lats[792] = -21.436936980809044; + lats[793] = -21.577507058237412; + lats[794] = -21.718077135641735; + lats[795] = -21.858647213021786; + lats[796] = -21.999217290377352; + lats[797] = -22.139787367708202; + lats[798] = -22.280357445014126; + lats[799] = -22.420927522294875; + lats[800] = -22.561497599550243; + lats[801] = -22.70206767677999; + lats[802] = -22.84263775398389; + lats[803] = -22.98320783116171; + lats[804] = -23.123777908313219; + lats[805] = -23.264347985438178; + lats[806] = -23.404918062536346; + lats[807] = -23.545488139607492; + lats[808] = -23.686058216651375; + lats[809] = -23.826628293667756; + lats[810] = -23.96719837065638; + lats[811] = -24.107768447617016; + lats[812] = -24.248338524549407; + lats[813] = -24.388908601453309; + lats[814] = -24.529478678328466; + lats[815] = -24.670048755174633; + lats[816] = -24.810618831991551; + lats[817] = -24.951188908778963; + lats[818] = -25.091758985536615; + lats[819] = -25.232329062264245; + lats[820] = -25.3728991389616; + lats[821] = -25.513469215628398; + lats[822] = -25.654039292264386; + lats[823] = -25.794609368869299; + lats[824] = -25.935179445442859; + lats[825] = -26.075749521984797; + lats[826] = -26.216319598494842; + lats[827] = -26.356889674972713; + lats[828] = -26.497459751418134; + lats[829] = -26.638029827830831; + lats[830] = -26.778599904210516; + lats[831] = -26.919169980556905; + lats[832] = -27.05974005686971; + lats[833] = -27.200310133148644; + lats[834] = -27.340880209393415; + lats[835] = -27.481450285603731; + lats[836] = -27.622020361779295; + lats[837] = -27.762590437919812; + lats[838] = -27.903160514024975; + lats[839] = -28.043730590094491; + lats[840] = -28.184300666128038; + lats[841] = -28.324870742125327; + lats[842] = -28.465440818086037; + lats[843] = -28.606010894009859; + lats[844] = -28.746580969896474; + lats[845] = -28.887151045745565; + lats[846] = -29.027721121556816; + lats[847] = -29.168291197329893; + lats[848] = -29.308861273064483; + lats[849] = -29.449431348760253; + lats[850] = -29.590001424416862; + lats[851] = -29.730571500033992; + lats[852] = -29.87114157561129; + lats[853] = -30.011711651148435; + lats[854] = -30.152281726645064; + lats[855] = -30.292851802100841; + lats[856] = -30.433421877515418; + lats[857] = -30.573991952888438; + lats[858] = -30.71456202821955; + lats[859] = -30.855132103508407; + lats[860] = -30.99570217875463; + lats[861] = -31.136272253957859; + lats[862] = -31.276842329117731; + lats[863] = -31.417412404233875; + lats[864] = -31.55798247930592; + lats[865] = -31.698552554333489; + lats[866] = -31.839122629316183; + lats[867] = -31.979692704253651; + lats[868] = -32.120262779145477; + lats[869] = -32.260832853991289; + lats[870] = -32.401402928790681; + lats[871] = -32.541973003543255; + lats[872] = -32.682543078248621; + lats[873] = -32.823113152906366; + lats[874] = -32.963683227516071; + lats[875] = -33.104253302077339; + lats[876] = -33.244823376589757; + lats[877] = -33.385393451052892; + lats[878] = -33.525963525466317; + lats[879] = -33.66653359982962; + lats[880] = -33.807103674142361; + lats[881] = -33.9476737484041; + lats[882] = -34.088243822614395; + lats[883] = -34.228813896772813; + lats[884] = -34.369383970878907; + lats[885] = -34.509954044932208; + lats[886] = -34.650524118932253; + lats[887] = -34.79109419287861; + lats[888] = -34.931664266770788; + lats[889] = -35.072234340608333; + lats[890] = -35.21280441439076; + lats[891] = -35.353374488117588; + lats[892] = -35.493944561788332; + lats[893] = -35.634514635402525; + lats[894] = -35.775084708959632; + lats[895] = -35.9156547824592; + lats[896] = -36.056224855900687; + lats[897] = -36.196794929283605; + lats[898] = -36.33736500260742; + lats[899] = -36.477935075871656; + lats[900] = -36.618505149075737; + lats[901] = -36.759075222219167; + lats[902] = -36.899645295301404; + lats[903] = -37.040215368321896; + lats[904] = -37.180785441280122; + lats[905] = -37.321355514175501; + lats[906] = -37.461925587007492; + lats[907] = -37.602495659775542; + lats[908] = -37.743065732479067; + lats[909] = -37.883635805117493; + lats[910] = -38.02420587769025; + lats[911] = -38.164775950196741; + lats[912] = -38.305346022636385; + lats[913] = -38.44591609500857; + lats[914] = -38.5864861673127; + lats[915] = -38.727056239548169; + lats[916] = -38.867626311714339; + lats[917] = -39.008196383810613; + lats[918] = -39.148766455836338; + lats[919] = -39.289336527790894; + lats[920] = -39.429906599673615; + lats[921] = -39.570476671483874; + lats[922] = -39.711046743220997; + lats[923] = -39.851616814884331; + lats[924] = -39.992186886473185; + lats[925] = -40.132756957986885; + lats[926] = -40.273327029424742; + lats[927] = -40.41389710078608; + lats[928] = -40.554467172070169; + lats[929] = -40.695037243276325; + lats[930] = -40.835607314403816; + lats[931] = -40.976177385451912; + lats[932] = -41.116747456419873; + lats[933] = -41.257317527306981; + lats[934] = -41.397887598112455; + lats[935] = -41.538457668835562; + lats[936] = -41.679027739475522; + lats[937] = -41.819597810031553; + lats[938] = -41.960167880502873; + lats[939] = -42.100737950888686; + lats[940] = -42.241308021188203; + lats[941] = -42.381878091400594; + lats[942] = -42.522448161525034; + lats[943] = -42.663018231560706; + lats[944] = -42.803588301506764; + lats[945] = -42.944158371362349; + lats[946] = -43.0847284411266; + lats[947] = -43.225298510798666; + lats[948] = -43.365868580377636; + lats[949] = -43.506438649862638; + lats[950] = -43.64700871925276; + lats[951] = -43.787578788547094; + lats[952] = -43.928148857744716; + lats[953] = -44.068718926844674; + lats[954] = -44.209288995846045; + lats[955] = -44.349859064747854; + lats[956] = -44.490429133549149; + lats[957] = -44.630999202248923; + lats[958] = -44.771569270846214; + lats[959] = -44.912139339339987; + lats[960] = -45.052709407729239; + lats[961] = -45.193279476012933; + lats[962] = -45.333849544190024; + lats[963] = -45.474419612259481; + lats[964] = -45.614989680220205; + lats[965] = -45.755559748071114; + lats[966] = -45.896129815811136; + lats[967] = -46.036699883439134; + lats[968] = -46.177269950954006; + lats[969] = -46.317840018354602; + lats[970] = -46.458410085639763; + lats[971] = -46.598980152808338; + lats[972] = -46.73955021985914; + lats[973] = -46.880120286790955; + lats[974] = -47.020690353602596; + lats[975] = -47.161260420292813; + lats[976] = -47.301830486860368; + lats[977] = -47.442400553303997; + lats[978] = -47.582970619622444; + lats[979] = -47.723540685814392; + lats[980] = -47.864110751878535; + lats[981] = -48.004680817813544; + lats[982] = -48.145250883618075; + lats[983] = -48.285820949290759; + lats[984] = -48.42639101483023; + lats[985] = -48.56696108023506; + lats[986] = -48.707531145503857; + lats[987] = -48.848101210635171; + lats[988] = -48.988671275627539; + lats[989] = -49.129241340479489; + lats[990] = -49.269811405189529; + lats[991] = -49.410381469756118; + lats[992] = -49.550951534177734; + lats[993] = -49.691521598452823; + lats[994] = -49.832091662579785; + lats[995] = -49.972661726557028; + lats[996] = -50.113231790382912; + lats[997] = -50.253801854055808; + lats[998] = -50.39437191757402; + lats[999] = -50.534941980935862; + lats[1000] = -50.675512044139623; + lats[1001] = -50.81608210718354; + lats[1002] = -50.956652170065858; + lats[1003] = -51.097222232784773; + lats[1004] = -51.237792295338465; + lats[1005] = -51.378362357725095; + lats[1006] = -51.518932419942786; + lats[1007] = -51.659502481989627; + lats[1008] = -51.800072543863692; + lats[1009] = -51.940642605563028; + lats[1010] = -52.081212667085637; + lats[1011] = -52.221782728429538; + lats[1012] = -52.362352789592649; + lats[1013] = -52.502922850572908; + lats[1014] = -52.643492911368206; + lats[1015] = -52.784062971976404; + lats[1016] = -52.924633032395342; + lats[1017] = -53.065203092622802; + lats[1018] = -53.205773152656562; + lats[1019] = -53.346343212494332; + lats[1020] = -53.486913272133812; + lats[1021] = -53.627483331572677; + lats[1022] = -53.768053390808532; + lats[1023] = -53.90862344983897; + lats[1024] = -54.049193508661538; + lats[1025] = -54.189763567273758; + lats[1026] = -54.330333625673063; + lats[1027] = -54.470903683856939; + lats[1028] = -54.611473741822735; + lats[1029] = -54.752043799567822; + lats[1030] = -54.892613857089486; + lats[1031] = -55.033183914385013; + lats[1032] = -55.173753971451625; + lats[1033] = -55.314324028286471; + lats[1034] = -55.45489408488671; + lats[1035] = -55.595464141249401; + lats[1036] = -55.736034197371588; + lats[1037] = -55.876604253250278; + lats[1038] = -56.017174308882367; + lats[1039] = -56.157744364264779; + lats[1040] = -56.29831441939433; + lats[1041] = -56.438884474267795; + lats[1042] = -56.579454528881925; + lats[1043] = -56.720024583233375; + lats[1044] = -56.860594637318769; + lats[1045] = -57.001164691134662; + lats[1046] = -57.141734744677549; + lats[1047] = -57.282304797943887; + lats[1048] = -57.422874850930043; + lats[1049] = -57.563444903632337; + lats[1050] = -57.704014956047033; + lats[1051] = -57.844585008170284; + lats[1052] = -57.985155059998249; + lats[1053] = -58.125725111526968; + lats[1054] = -58.266295162752428; + lats[1055] = -58.406865213670514; + lats[1056] = -58.547435264277105; + lats[1057] = -58.688005314567938; + lats[1058] = -58.828575364538722; + lats[1059] = -58.96914541418505; + lats[1060] = -59.10971546350244; + lats[1061] = -59.250285512486386; + lats[1062] = -59.390855561132213; + lats[1063] = -59.531425609435225; + lats[1064] = -59.671995657390596; + lats[1065] = -59.812565704993467; + lats[1066] = -59.953135752238794; + lats[1067] = -60.093705799121537; + lats[1068] = -60.234275845636503; + lats[1069] = -60.374845891778421; + lats[1070] = -60.515415937541938; + lats[1071] = -60.655985982921543; + lats[1072] = -60.796556027911663; + lats[1073] = -60.937126072506608; + lats[1074] = -61.077696116700601; + lats[1075] = -61.21826616048768; + lats[1076] = -61.358836203861841; + lats[1077] = -61.499406246816953; + lats[1078] = -61.639976289346727; + lats[1079] = -61.780546331444761; + lats[1080] = -61.921116373104539; + lats[1081] = -62.061686414319418; + lats[1082] = -62.202256455082583; + lats[1083] = -62.342826495387122; + lats[1084] = -62.483396535225978; + lats[1085] = -62.62396657459194; + lats[1086] = -62.764536613477638; + lats[1087] = -62.905106651875542; + lats[1088] = -63.045676689778013; + lats[1089] = -63.186246727177178; + lats[1090] = -63.326816764065093; + lats[1091] = -63.467386800433559; + lats[1092] = -63.607956836274255; + lats[1093] = -63.748526871578648; + lats[1094] = -63.889096906338061; + lats[1095] = -64.029666940543564; + lats[1096] = -64.170236974186125; + lats[1097] = -64.310807007256443; + lats[1098] = -64.451377039745026; + lats[1099] = -64.591947071642196; + lats[1100] = -64.732517102938033; + lats[1101] = -64.873087133622406; + lats[1102] = -65.013657163684968; + lats[1103] = -65.154227193115119; + lats[1104] = -65.294797221902016; + lats[1105] = -65.435367250034616; + lats[1106] = -65.575937277501538; + lats[1107] = -65.716507304291198; + lats[1108] = -65.85707733039176; + lats[1109] = -65.997647355791017; + lats[1110] = -66.138217380476604; + lats[1111] = -66.278787404435761; + lats[1112] = -66.41935742765547; + lats[1113] = -66.559927450122359; + lats[1114] = -66.700497471822814; + lats[1115] = -66.841067492742795; + lats[1116] = -66.981637512867991; + lats[1117] = -67.122207532183722; + lats[1118] = -67.262777550674912; + lats[1119] = -67.403347568326168; + lats[1120] = -67.543917585121662; + lats[1121] = -67.684487601045149; + lats[1122] = -67.825057616080073; + lats[1123] = -67.965627630209354; + lats[1124] = -68.106197643415527; + lats[1125] = -68.246767655680657; + lats[1126] = -68.387337666986312; + lats[1127] = -68.52790767731365; + lats[1128] = -68.668477686643286; + lats[1129] = -68.809047694955296; + lats[1130] = -68.949617702229318; + lats[1131] = -69.090187708444333; + lats[1132] = -69.230757713578825; + lats[1133] = -69.37132771761064; + lats[1134] = -69.511897720517084; + lats[1135] = -69.65246772227475; + lats[1136] = -69.793037722859665; + lats[1137] = -69.933607722247146; + lats[1138] = -70.074177720411782; + lats[1139] = -70.214747717327526; + lats[1140] = -70.355317712967462; + lats[1141] = -70.495887707304007; + lats[1142] = -70.636457700308753; + lats[1143] = -70.777027691952398; + lats[1144] = -70.917597682204899; + lats[1145] = -71.058167671035164; + lats[1146] = -71.198737658411332; + lats[1147] = -71.339307644300462; + lats[1148] = -71.47987762866866; + lats[1149] = -71.620447611481026; + lats[1150] = -71.761017592701492; + lats[1151] = -71.901587572292982; + lats[1152] = -72.042157550217183; + lats[1153] = -72.182727526434604; + lats[1154] = -72.323297500904502; + lats[1155] = -72.463867473584784; + lats[1156] = -72.604437444432065; + lats[1157] = -72.745007413401481; + lats[1158] = -72.885577380446747; + lats[1159] = -73.026147345520002; + lats[1160] = -73.166717308571819; + lats[1161] = -73.307287269551111; + lats[1162] = -73.447857228405013; + lats[1163] = -73.588427185078871; + lats[1164] = -73.728997139516167; + lats[1165] = -73.869567091658411; + lats[1166] = -74.010137041445006; + lats[1167] = -74.150706988813226; + lats[1168] = -74.291276933698185; + lats[1169] = -74.431846876032495; + lats[1170] = -74.57241681574645; + lats[1171] = -74.712986752767719; + lats[1172] = -74.853556687021296; + lats[1173] = -74.994126618429377; + lats[1174] = -75.134696546911186; + lats[1175] = -75.275266472382896; + lats[1176] = -75.41583639475742; + lats[1177] = -75.556406313944308; + lats[1178] = -75.69697622984954; + lats[1179] = -75.837546142375359; + lats[1180] = -75.978116051420102; + lats[1181] = -76.118685956877997; + lats[1182] = -76.259255858638895; + lats[1183] = -76.399825756588143; + lats[1184] = -76.540395650606285; + lats[1185] = -76.680965540568806; + lats[1186] = -76.821535426345932; + lats[1187] = -76.962105307802219; + lats[1188] = -77.102675184796354; + lats[1189] = -77.243245057180829; + lats[1190] = -77.383814924801513; + lats[1191] = -77.524384787497311; + lats[1192] = -77.664954645099883; + lats[1193] = -77.805524497433041; + lats[1194] = -77.946094344312371; + lats[1195] = -78.086664185544819; + lats[1196] = -78.227234020928066; + lats[1197] = -78.367803850250056; + lats[1198] = -78.508373673288318; + lats[1199] = -78.648943489809355; + lats[1200] = -78.789513299567957; + lats[1201] = -78.930083102306568; + lats[1202] = -79.070652897754229; + lats[1203] = -79.211222685625927; + lats[1204] = -79.351792465621628; + lats[1205] = -79.492362237425226; + lats[1206] = -79.632932000703448; + lats[1207] = -79.773501755104689; + lats[1208] = -79.914071500257819; + lats[1209] = -80.054641235770603; + lats[1210] = -80.195210961228469; + lats[1211] = -80.335780676192584; + lats[1212] = -80.47635038019834; + lats[1213] = -80.616920072753146; + lats[1214] = -80.757489753334553; + lats[1215] = -80.898059421387785; + lats[1216] = -81.038629076323318; + lats[1217] = -81.179198717514012; + lats[1218] = -81.319768344292086; + lats[1219] = -81.460337955945846; + lats[1220] = -81.600907551715878; + lats[1221] = -81.741477130791196; + lats[1222] = -81.882046692304485; + lats[1223] = -82.022616235327504; + lats[1224] = -82.163185758865239; + lats[1225] = -82.303755261850071; + lats[1226] = -82.444324743134914; + lats[1227] = -82.584894201485696; + lats[1228] = -82.725463635573107; + lats[1229] = -82.866033043962815; + lats[1230] = -83.006602425105484; + lats[1231] = -83.147171777324388; + lats[1232] = -83.287741098802584; + lats[1233] = -83.428310387567549; + lats[1234] = -83.568879641474325; + lats[1235] = -83.709448858186462; + lats[1236] = -83.850018035153667; + lats[1237] = -83.990587169587158; + lats[1238] = -84.131156258431133; + lats[1239] = -84.271725298329656; + lats[1240] = -84.412294285589354; + lats[1241] = -84.552863216135577; + lats[1242] = -84.693432085462035; + lats[1243] = -84.834000888572191; + lats[1244] = -84.974569619910426; + lats[1245] = -85.115138273281829; + lats[1246] = -85.255706841757572; + lats[1247] = -85.396275317562669; + lats[1248] = -85.536843691942948; + lats[1249] = -85.677411955006008; + lats[1250] = -85.817980095529578; + lats[1251] = -85.958548100730781; + lats[1252] = -86.0991159559849; + lats[1253] = -86.239683644481104; + lats[1254] = -86.380251146798656; + lats[1255] = -86.520818440379529; + lats[1256] = -86.661385498868242; + lats[1257] = -86.801952291278369; + lats[1258] = -86.942518780928566; + lats[1259] = -87.083084924070917; + lats[1260] = -87.223650668104085; + lats[1261] = -87.364215949214667; + lats[1262] = -87.504780689222315; + lats[1263] = -87.645344791295628; + lats[1264] = -87.785908134040668; + lats[1265] = -87.926470563186442; + lats[1266] = -88.067031879650926; + lats[1267] = -88.207591822004105; + lats[1268] = -88.348150039999084; + lats[1269] = -88.488706053376362; + lats[1270] = -88.629259185411627; + lats[1271] = -88.76980845110036; + lats[1272] = -88.91035235926023; + lats[1273] = -89.050888539966436; + lats[1274] = -89.191412986832432; + lats[1275] = -89.331918354381827; + lats[1276] = -89.472389582061126; + lats[1277] = -89.612790258599077; + lats[1278] = -89.753004943174034; + lats[1279] = -89.892396445590066; + return GRIB_SUCCESS; +} + /* 'trunc' is the Gaussian number (or order) */ /* i.e. Number of parallels between a pole and the equator */ -int grib_get_gaussian_latitudes(long trunc, double* lats) +static int _grib_get_gaussian_latitudes(long trunc, double* lats) { long jlat, iter, legi; double rad2deg, convval, root, legfonc = 0; @@ -156,6 +4008,16 @@ int grib_get_gaussian_latitudes(long trunc, double* lats) return GRIB_SUCCESS; } +int grib_get_gaussian_latitudes(long trunc, double* lats) +{ + if (trunc == 1280) + return get_precomputed_latitudes_N1280(lats); + if (trunc == 640) + return get_precomputed_latitudes_N640(lats); + else + return _grib_get_gaussian_latitudes(trunc, lats); +} + /* Boolean return type: 1 if the reduced gaussian field is global, 0 for sub area */ int is_gaussian_global( double lat1, double lat2, double lon1, double lon2, /* bounding box*/ diff --git a/src/grib_handle.c b/src/grib_handle.c index 165b2f8ab..b9762c09c 100644 --- a/src/grib_handle.c +++ b/src/grib_handle.c @@ -779,7 +779,8 @@ static grib_handle* grib_handle_new_from_file_multi(grib_context* c, FILE* f, in if (c->gts_header_on && gtslen >= 8) { gl->gts_header = (char*)grib_context_malloc_clear(c, sizeof(unsigned char) * gtslen); - memcpy(gl->gts_header, gts_header, gtslen); + DebugAssert(gts_header); + if (gts_header) memcpy(gl->gts_header, gts_header, gtslen); gl->gts_header_len = gtslen; grib_context_free(c, save_gts_header); gtslen = 0; @@ -1012,7 +1013,8 @@ grib_handle* bufr_new_from_file(grib_context* c, FILE* f, int* error) if (c->gts_header_on && gtslen >= 8) { gl->gts_header = (char*)grib_context_malloc(c, sizeof(unsigned char) * gtslen); - memcpy(gl->gts_header, gts_header, gtslen); + DebugAssert(gts_header); + if (gts_header) memcpy(gl->gts_header, gts_header, gtslen); gl->gts_header_len = gtslen; grib_context_free(c, save_gts_header); gtslen = 0; @@ -1135,7 +1137,8 @@ static grib_handle* grib_handle_new_from_file_no_multi(grib_context* c, FILE* f, if (c->gts_header_on && gtslen >= 8) { gl->gts_header = (char*)grib_context_malloc(c, sizeof(unsigned char) * gtslen); - memcpy(gl->gts_header, gts_header, gtslen); + DebugAssert(gts_header); + if (gts_header) memcpy(gl->gts_header, gts_header, gtslen); gl->gts_header_len = gtslen; grib_context_free(c, save_gts_header); gtslen = 0; diff --git a/src/grib_iterator_class_gaussian_reduced.c b/src/grib_iterator_class_gaussian_reduced.c index 67ce64d4a..627a0b316 100644 --- a/src/grib_iterator_class_gaussian_reduced.c +++ b/src/grib_iterator_class_gaussian_reduced.c @@ -92,7 +92,7 @@ static int next(grib_iterator* i, double* lat, double* lon, double* val) { grib_iterator_gaussian_reduced* self = (grib_iterator_gaussian_reduced*)i; - if ((long)i->e >= (long)(i->nv - 1)) + if (i->e >= (long)(i->nv - 1)) return 0; i->e++; diff --git a/src/grib_jasper_encoding.c b/src/grib_jasper_encoding.c index d795ece08..f51155929 100644 --- a/src/grib_jasper_encoding.c +++ b/src/grib_jasper_encoding.c @@ -199,9 +199,9 @@ int grib_jasper_encode(grib_context* c, j2k_encode_helper* helper) } helper->jpeg_length = jpcstream->rwcnt_; - jaserr = jas_stream_close(istream); + jas_stream_close(istream); istream = 0; - jaserr = jas_stream_close(jpcstream); + jas_stream_close(jpcstream); jpcstream = 0; cleanup: diff --git a/src/grib_openjpeg_encoding.c b/src/grib_openjpeg_encoding.c index 3503b9ce8..ecee220e9 100644 --- a/src/grib_openjpeg_encoding.c +++ b/src/grib_openjpeg_encoding.c @@ -280,9 +280,9 @@ static OPJ_OFF_T opj_memory_stream_skip(OPJ_OFF_T nb_bytes, void* user_data) l_nb_bytes = (OPJ_SIZE_T)nb_bytes; /* Allowed because it is positive */ /* Do not allow jumping past the end */ if (l_nb_bytes > mstream->dataSize - mstream->offset) - nb_bytes = mstream->dataSize - mstream->offset; - mstream->offset += l_nb_bytes; - return l_nb_bytes; /* Returm how far we jumped */ + l_nb_bytes = mstream->dataSize - mstream->offset; /* Jump the max. */ + mstream->offset += l_nb_bytes; /* Make the jump */ + return l_nb_bytes; /* Return how far we jumped */ } /* Sets the pointer to anywhere in the memory */ diff --git a/tests/grib_copy.sh b/tests/grib_copy.sh index b01511fd7..525a94a79 100755 --- a/tests/grib_copy.sh +++ b/tests/grib_copy.sh @@ -10,8 +10,6 @@ . ./include.sh -#set -x - #Enter data dir cd ${data_dir} @@ -19,9 +17,26 @@ cd ${data_dir} label="grib_copy_test" temp=${label}".grib.tmp" -#------------------------------------------------------------------- -# Test: The -X option -#------------------------------------------------------------------- + +echo "Test: The -g option..." +# ----------------------------------- +input=gts.grib +${tools_dir}/grib_copy -w count=1 -g $input $temp +val1=`${tools_dir}/gts_get -wcount=1 -p AA $input` +val2=`${tools_dir}/gts_get -p AA $temp` +[ "$val1" = "$val2" ] +[ "$val1" = "XK" ] + +${tools_dir}/grib_copy -w count=1 $input $temp +set +e +${tools_dir}/gts_get -p AA $temp +status=$? +set -e +[ $status -ne 0 ] + + +echo "Test: The -X option..." +# ------------------------------- echo "Test: use of -X option" input=tigge_pf_ecmwf.grib2 ${tools_dir}/grib_copy -w count=1 -X 0 $input $temp #First msg From 31178546b27aede8f787c9fed6c8aac1bb4ce97d Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 17 Feb 2020 17:18:58 +0000 Subject: [PATCH 61/82] Latest updates from develop (16) --- .appveyor.yml | 14 ++++++ definitions/grib1/data.grid_simple_matrix.def | 2 +- definitions/param_limits.def | 12 +++-- examples/C/bufr_read_temp.c | 23 ++++++---- python/grib_interface.c | 2 +- src/action_class_concept.c | 6 +-- src/action_class_section.c | 2 +- src/bufr_util.c | 1 + src/eccodes.h | 4 ++ src/grib_accessor_class_data_2order_packing.c | 10 ++--- ..._g1second_order_general_extended_packing.c | 6 ++- ..._accessor_class_data_g2bifourier_packing.c | 23 +++++----- src/grib_accessor_class_g1step_range.c | 1 + src/grib_accessor_class_latlonvalues.c | 1 - ..._class_number_of_values_data_raw_packing.c | 10 ++++- src/grib_accessor_class_spd.c | 4 ++ src/grib_accessor_class_statistics_spectral.c | 1 - src/grib_api.h | 5 +++ src/grib_box_class.c | 1 - src/grib_dumper_class_bufr_encode_C.c | 12 +++-- src/grib_dumper_class_bufr_encode_filter.c | 12 +++-- src/grib_dumper_class_bufr_encode_fortran.c | 17 ++++--- src/grib_dumper_class_bufr_encode_python.c | 12 +++-- src/grib_dumper_class_bufr_simple.c | 5 +-- src/grib_dumper_class_debug.c | 2 +- src/grib_dumper_class_json.c | 9 ++-- src/grib_dumper_class_wmo.c | 2 +- src/grib_gaussian_reduced.c | 2 + src/grib_handle.c | 6 --- src/grib_iterator_class_space_view.c | 2 +- src/grib_itrie.c | 26 +++++++---- src/grib_parse_utils.c | 2 + src/grib_query.c | 1 - src/grib_trie.c | 10 +++++ src/grib_trie_with_rank.c | 5 +++ tests/bpv_limit.sh | 2 +- tests/bufr_ecc-517.c | 10 ++--- tests/grib_lam_bf.sh | 2 +- tests/grib_lam_gp.sh | 2 +- tests/grib_optimize_scaling.sh | 2 +- tests/grib_sh_ieee64.sh | 2 +- tests/ieee.sh | 45 +++++++++++++++++++ tests/unit_tests.sh | 2 +- tools/bufr_compare.c | 1 + tools/bufr_ls.c | 4 ++ tools/grib_get.c | 1 - tools/grib_ls.c | 5 ++- tools/grib_to_netcdf.c | 11 ++--- tools/gts_compare.c | 1 + tools/metar_compare.c | 1 + 50 files changed, 229 insertions(+), 115 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 7ae9c60a9..30e615667 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -92,3 +92,17 @@ test_script: - cmd: codes_info - cmd: for /F "tokens=* USEBACKQ" %%F IN (`codes_info -s`) DO (ls %%F) - cmd: for /F "tokens=* USEBACKQ" %%F IN (`codes_info -d`) DO (ls %%F) + +#---------------------------------# +# notifications # +#---------------------------------# + +notifications: + + # Email + - provider: Email + to: + - shahram.najm@ecmwf.int + subject: 'Build {{status}}' # optional + message: "{{message}}, {{commitId}}, ..." # optional + on_build_status_changed: true diff --git a/definitions/grib1/data.grid_simple_matrix.def b/definitions/grib1/data.grid_simple_matrix.def index d63a19826..9ef578005 100644 --- a/definitions/grib1/data.grid_simple_matrix.def +++ b/definitions/grib1/data.grid_simple_matrix.def @@ -107,7 +107,7 @@ if(matrixOfValues == 0) alias data.packedValues = values; } } else { - if(secondaryBitmapPresent == 0) { meta error not_implemented(); } + #if(secondaryBitmapPresent == 0) { meta error not_implemented(); } constant matrixBitmapsPresent = 1; constant bitMapIndicator = 0; diff --git a/definitions/param_limits.def b/definitions/param_limits.def index cf4bc1989..6b5c95af7 100644 --- a/definitions/param_limits.def +++ b/definitions/param_limits.def @@ -26,13 +26,19 @@ concept param_value_min(default_min_val) { -0.05 = { paramId=3062; } 0 = { paramId=260210; } 0 = { paramId=3073; } - 160 = { paramId=121; } + 160 = { + one=(step > 0); + paramId=121; + } + 150 = { + one=(step > 0); + paramId=122; + } 85000 = { paramId=151; } 270 = { paramId=151126; } -1 = { paramId=140230; } 0 = { paramId=140221; } 0 = { paramId=3074; } - 150 = { paramId=122; } 0 = { paramId=140214; } -3.5 = { paramId=151132; } 0 = { paramId=151225; } @@ -94,7 +100,7 @@ concept param_value_max(default_max_val) { 50 = { paramId=151175; } 100 = { paramId=260257; } 40000 = { paramId=59; } - 5 = { paramId=228001; } + 1000 = { paramId=228001; } 1500 = { paramId=151163; } 3.5 = { paramId=151131; } 5 = { paramId=260259; } diff --git a/examples/C/bufr_read_temp.c b/examples/C/bufr_read_temp.c index 125506f89..2b8247459 100644 --- a/examples/C/bufr_read_temp.c +++ b/examples/C/bufr_read_temp.c @@ -12,7 +12,6 @@ * C Implementation: bufr_read_temp * * Description: how to read temperature significant levels from TEMP BUFR messages. - * */ /* @@ -23,6 +22,14 @@ #include "eccodes.h" +static void free_memory(double* sigt_pres, double* sigt_geo, double* sigt_t, double* sigt_td) +{ + free(sigt_pres); + free(sigt_geo); + free(sigt_t); + free(sigt_td); +} + int main(int argc, char* argv[]) { FILE* in = NULL; @@ -98,6 +105,7 @@ int main(int argc, char* argv[]) CODES_CHECK(codes_get_size(h, key_name, &len), 0); if (len != sigt_len) { printf("inconsistent number of geopotential values found!\n"); + free_memory(sigt_pres, sigt_geo, sigt_t, sigt_td); return 1; } @@ -105,9 +113,9 @@ int main(int argc, char* argv[]) CODES_CHECK(codes_get_double_array(h, key_name, sigt_geo, &len), 0); /* Get temperature */ - if (len != sigt_len) /* Check the size */ - { + if (len != sigt_len) { /* Check the size */ printf("inconsistent number of temperature values found!\n"); + free_memory(sigt_pres, sigt_geo, sigt_t, sigt_td); return 1; } @@ -116,9 +124,9 @@ int main(int argc, char* argv[]) CODES_CHECK(codes_get_double_array(h, key_name, sigt_t, &len), 0); /* Get dew point */ - if (len != sigt_len) /* Check the size */ - { + if (len != sigt_len) { /* Check the size */ printf("inconsistent number of dewpoint temperature values found!\n"); + free_memory(sigt_pres, sigt_geo, sigt_t, sigt_td); return 1; } @@ -139,10 +147,7 @@ int main(int argc, char* argv[]) codes_handle_delete(h); /* Release memory */ - free(sigt_pres); - free(sigt_geo); - free(sigt_t); - free(sigt_td); + free_memory(sigt_pres, sigt_geo, sigt_t, sigt_td); cnt++; } diff --git a/python/grib_interface.c b/python/grib_interface.c index 285e50616..d07efd5fc 100644 --- a/python/grib_interface.c +++ b/python/grib_interface.c @@ -163,7 +163,7 @@ static int push_file(FILE* f){ } } - new = malloc(sizeof(l_grib_handle)); + new = malloc(sizeof(l_grib_file)); new->id = myindex; new->f = f; new->next = current; diff --git a/src/action_class_concept.c b/src/action_class_concept.c index e6991b849..6694410d4 100644 --- a/src/action_class_concept.c +++ b/src/action_class_concept.c @@ -393,14 +393,14 @@ int get_concept_condition_string(grib_handle* h, const char* key, const char* va concept_value = action_concept_get_concept(acc); while (concept_value) { grib_concept_condition* concept_condition = concept_value->conditions; - if (strcmp(pValue, concept_value->name) == 0) { while (concept_condition) { grib_expression* expression = concept_condition->expression; + const char* condition_name = concept_condition->name; Assert(expression); - if (concept_condition_expression_true(h, concept_condition, exprVal)) { + if (concept_condition_expression_true(h, concept_condition, exprVal) && strcmp(condition_name, "one") != 0) { length += sprintf(result + length, "%s%s=%s", - (length == 0 ? "" : ","), concept_condition->name, exprVal); + (length == 0 ? "" : ","), condition_name, exprVal); } concept_condition = concept_condition->next; } diff --git a/src/action_class_section.c b/src/action_class_section.c index 2af2bef51..cc6ca27a5 100644 --- a/src/action_class_section.c +++ b/src/action_class_section.c @@ -118,7 +118,7 @@ static int notify_change(grib_action* act, grib_accessor* notified, la = grib_action_reparse(act, notified, &doit); old_section = notified->sub_section; - Assert(old_section); + if (!old_section) return GRIB_INTERNAL_ERROR; Assert(old_section->h == h); diff --git a/src/bufr_util.c b/src/bufr_util.c index 8fdb6bada..8211d9b41 100644 --- a/src/bufr_util.c +++ b/src/bufr_util.c @@ -539,6 +539,7 @@ static int bufr_decode_header(grib_context* c, const void* message, off_t offset hdr->message_size = (unsigned long)size; err = bufr_extract_edition(message, &hdr->edition); + if (err) return err; if (hdr->edition == 3) { err = bufr_decode_edition3(message, hdr); diff --git a/src/eccodes.h b/src/eccodes.h index 44d299744..f13cbaf88 100644 --- a/src/eccodes.h +++ b/src/eccodes.h @@ -1199,8 +1199,12 @@ void codes_check(const char* call, const char* file, int line, int e, const char int codes_set_values(codes_handle* h, codes_values* codes_values, size_t arg_count); codes_handle* codes_handle_new_from_partial_message_copy(codes_context* c, const void* data, size_t size); codes_handle* codes_handle_new_from_partial_message(codes_context* c, const void* data, size_t buflen); + +/* Returns a bool i.e. 0 or 1. The error code is an argument */ int codes_is_missing(const codes_handle* h, const char* key, int* err); +/* Returns a bool i.e. 0 or 1 */ int codes_is_defined(const codes_handle* h, const char* key); + int codes_set_missing(codes_handle* h, const char* key); /* The truncation is the Gaussian number (or order) */ int codes_get_gaussian_latitudes(long truncation, double* latitudes); diff --git a/src/grib_accessor_class_data_2order_packing.c b/src/grib_accessor_class_data_2order_packing.c index 53381762f..8c0e6bf28 100644 --- a/src/grib_accessor_class_data_2order_packing.c +++ b/src/grib_accessor_class_data_2order_packing.c @@ -455,9 +455,6 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) double s = 0; double d = 0; - double max = 0; - double min = 0; - unsigned long* sec_val = NULL; long ref_vals = 0; short n_sp_diff = 0; @@ -475,7 +472,8 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) grib_accessor* abitmap = NULL; size_t bitmap_len = 0; - err = grib_value_count(a, &nn); + err = grib_value_count(a, &nn); + if (err) return err; n_vals = nn; if ((err = grib_get_long_internal(gh, self->offsetsection, &offsetsection)) != GRIB_SUCCESS) @@ -652,7 +650,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) for (i = 0; i < n_vals; i++) val[i] = (double)((((double)sec_val[i]) * s) + reference_value) * d; - max = val[0]; + /*max = val[0]; min = max; for (i = 0; i < n_vals; i++) { if (val[i] > max) @@ -661,7 +659,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) min = val[i]; } min *= d; - max *= d; + max *= d;*/ grib_context_free(a->context, sec_val); if (bitmap != NULL) diff --git a/src/grib_accessor_class_data_g1second_order_general_extended_packing.c b/src/grib_accessor_class_data_g1second_order_general_extended_packing.c index 6effa25fe..af8c3f44b 100644 --- a/src/grib_accessor_class_data_g1second_order_general_extended_packing.c +++ b/src/grib_accessor_class_data_g1second_order_general_extended_packing.c @@ -1310,8 +1310,8 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) decimal = grib_power(decimal_scale_factor, 10); divisor = grib_power(-binary_scale_factor, 2); - min = min * decimal; - max = max * decimal; + /*min = min * decimal;*/ + /*max = max * decimal;*/ if ((ret = grib_set_long_internal(handle, self->decimal_scale_factor, decimal_scale_factor)) != GRIB_SUCCESS) @@ -1855,7 +1855,9 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) Xp = X + orderOfSPD; pos = 0; +#if EFDEBUG count = 0; +#endif for (i = 0; i < numberOfGroups; i++) { if (groupWidths[i] > 0) { for (j = 0; j < groupLengths[i]; j++) { diff --git a/src/grib_accessor_class_data_g2bifourier_packing.c b/src/grib_accessor_class_data_g2bifourier_packing.c index b5961e69d..d947118e7 100644 --- a/src/grib_accessor_class_data_g2bifourier_packing.c +++ b/src/grib_accessor_class_data_g2bifourier_packing.c @@ -383,12 +383,9 @@ static double laplam(bif_trunc_t* bt, const double val[]) int i, j, k, l, isp; double zxmw, zymw, zwsum, zx, zy, zsum1, zsum2, zbeta1, zp; - itab1 = (int*)malloc(sizeof(int) * kmax); + itab1 = (int*)calloc(kmax, sizeof(int)); itab2 = (int*)malloc(sizeof(int) * ((1 + bt->bif_i) * (1 + bt->bif_j))); - for (k = 0; k < kmax; k++) - itab1[k] = 0; - /* * Keep record of the possible values of i**2+j**2 outside the non-packed truncation */ @@ -405,28 +402,26 @@ static double laplam(bif_trunc_t* bt, const double val[]) } l = 0; - for (k = 0; k < kmax; k++) + for (k = 0; k < kmax; k++) { if (itab1[k]) { itab2[l] = k; itab1[k] = l; l++; } + } lmax = l; /* * Now, itab2 contains all possible values of i*i+j*j, and itab1 contains * the rank of all i*i+j*j */ - znorm = (double*)malloc(sizeof(double) * lmax); + znorm = (double*)calloc(lmax, sizeof(double)); zw = (double*)malloc(sizeof(double) * lmax); /* * Compute norms of input field, gathered by values of i**2+j**2; we have to * go through the unpacked truncation again */ - for (l = 0; l < lmax; l++) - znorm[l] = 0.; - isp = 0; for_ij() { @@ -439,8 +434,13 @@ static double laplam(bif_trunc_t* bt, const double val[]) } else { int m, ll = itab1[i * i + j * j]; - for (m = 0; m < 4; m++, isp++) - znorm[ll] = MAX(znorm[ll], fabs(val[isp])); + for (m = 0; m < 4; m++, isp++) { + DebugAssertAccess(znorm, (long)ll, (long)lmax); + DebugAssertAccess(val, (long)isp, (long)bt->n_vals_bif); + if (ll < lmax && isp < bt->n_vals_bif) { + znorm[ll] = MAX(znorm[ll], fabs(val[isp])); + } + } } } @@ -624,6 +624,7 @@ static bif_trunc_t* new_bif_trunc(grib_accessor* a, grib_accessor_data_g2bifouri cleanup: free_bif_trunc(bt, a); + if (ret) fprintf(stderr, "ERROR: new_bif_trunc: %s\n", grib_get_error_message(ret)); return NULL; } diff --git a/src/grib_accessor_class_g1step_range.c b/src/grib_accessor_class_g1step_range.c index ff610a9a7..4dea9a15c 100644 --- a/src/grib_accessor_class_g1step_range.c +++ b/src/grib_accessor_class_g1step_range.c @@ -266,6 +266,7 @@ int grib_g1_step_get_steps(grib_accessor* a, long* start, long* theEnd) /* TODO move to the def file */ err = grib_get_long(hand, "timeRangeIndicatorFromStepRange", &timeRangeIndicatorFromStepRange); + if (err) return err; if (timeRangeIndicatorFromStepRange == 10) timeRangeIndicator = timeRangeIndicatorFromStepRange; diff --git a/src/grib_accessor_class_latlonvalues.c b/src/grib_accessor_class_latlonvalues.c index 358932829..571c81042 100644 --- a/src/grib_accessor_class_latlonvalues.c +++ b/src/grib_accessor_class_latlonvalues.c @@ -163,7 +163,6 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return ret; } - size = 0; ret = value_count(a, &count); if (ret) return ret; diff --git a/src/grib_accessor_class_number_of_values_data_raw_packing.c b/src/grib_accessor_class_number_of_values_data_raw_packing.c index a3fa2c669..955647b52 100644 --- a/src/grib_accessor_class_number_of_values_data_raw_packing.c +++ b/src/grib_accessor_class_number_of_values_data_raw_packing.c @@ -29,6 +29,7 @@ SUPER = grib_accessor_class_gen IMPLEMENTS = init IMPLEMENTS = unpack_long + IMPLEMENTS = get_native_type MEMBERS=const char* values MEMBERS=const char* precision END_CLASS_DEF @@ -45,6 +46,7 @@ or edit "accessor.class" and rerun ./make_class.pl */ +static int get_native_type(grib_accessor*); static int unpack_long(grib_accessor*, long* val, size_t* len); static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); @@ -75,7 +77,7 @@ static grib_accessor_class _grib_accessor_class_number_of_values_data_raw_packin 0, /* get number of values */ 0, /* get number of bytes */ 0, /* get offset to bytes */ - 0, /* get native type */ + &get_native_type, /* get native type */ 0, /* get sub_section */ 0, /* grib_pack procedures long */ 0, /* grib_pack procedures long */ @@ -115,7 +117,6 @@ static void init_class(grib_accessor_class* c) c->value_count = (*(c->super))->value_count; c->byte_count = (*(c->super))->byte_count; c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; c->sub_section = (*(c->super))->sub_section; c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; @@ -189,3 +190,8 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) return err; } + +static int get_native_type(grib_accessor* a) +{ + return GRIB_TYPE_LONG; +} diff --git a/src/grib_accessor_class_spd.c b/src/grib_accessor_class_spd.c index 5e005f2f8..f27a0f5c9 100644 --- a/src/grib_accessor_class_spd.c +++ b/src/grib_accessor_class_spd.c @@ -206,6 +206,10 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfBits, &numberOfBits); if (ret) return ret; + if (numberOfBits > 64) { + grib_context_log(a->context, GRIB_LOG_ERROR,"Invalid number of bits: %ld",numberOfBits); + return GRIB_DECODING_ERROR; + } for (i = 0; i < rlen - 1; i++) val[i] = grib_decode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, &pos, numberOfBits); diff --git a/src/grib_accessor_class_statistics_spectral.c b/src/grib_accessor_class_statistics_spectral.c index 440580357..13f2c2ca5 100644 --- a/src/grib_accessor_class_statistics_spectral.c +++ b/src/grib_accessor_class_statistics_spectral.c @@ -218,7 +218,6 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) } avg = values[0]; - enorm = 0; sd = 0; for (i = 2; i < 2 * J; i += 2) diff --git a/src/grib_api.h b/src/grib_api.h index 228e3f3dd..44b0e7ebd 100644 --- a/src/grib_api.h +++ b/src/grib_api.h @@ -1345,8 +1345,13 @@ void grib_check(const char* call, const char* file, int line, int e, const char* int grib_set_values(grib_handle* h, grib_values* grib_values, size_t arg_count); grib_handle* grib_handle_new_from_partial_message_copy(grib_context* c, const void* data, size_t size); grib_handle* grib_handle_new_from_partial_message(grib_context* c, const void* data, size_t buflen); + +/* Returns a bool i.e. 0 or 1. The error code is an argument */ int grib_is_missing(const grib_handle* h, const char* key, int* err); + +/* Returns a bool i.e. 0 or 1 */ int grib_is_defined(const grib_handle* h, const char* key); + int grib_set_missing(grib_handle* h, const char* key); /* The truncation is the Gaussian number (or order) */ int grib_get_gaussian_latitudes(long truncation, double* latitudes); diff --git a/src/grib_box_class.c b/src/grib_box_class.c index 86283ab86..eaf263d84 100644 --- a/src/grib_box_class.c +++ b/src/grib_box_class.c @@ -37,7 +37,6 @@ grib_box* grib_box_factory(grib_handle* h, grib_arguments* args) grib_box_class* c = *(table[i].cclass); grib_box* it = (grib_box*)grib_context_malloc_clear(h->context, c->size); it->cclass = c; - ret = GRIB_SUCCESS; ret = grib_box_init(it, h, args); if (ret == GRIB_SUCCESS) return it; diff --git a/src/grib_dumper_class_bufr_encode_C.c b/src/grib_dumper_class_bufr_encode_C.c index a1e052d70..b77691a71 100644 --- a/src/grib_dumper_class_bufr_encode_C.c +++ b/src/grib_dumper_class_bufr_encode_C.c @@ -218,7 +218,6 @@ static void dump_values(grib_dumper* d, grib_accessor* a) } if (icount > cols || i == 0) { fprintf(self->dumper.out, "\n "); - icount = 0; } sval = dval_to_string(c, values[i]); fprintf(self->dumper.out, "rvalues[%d]=%s;", i, sval); @@ -268,7 +267,7 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* { grib_dumper_bufr_encode_C* self = (grib_dumper_bufr_encode_C*)d; double value = 0; - size_t size = 0; + size_t size = 0, size2 = 0; double* values = NULL; int err = 0; int i, icount; @@ -282,14 +281,16 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* grib_value_count(a, &count); size = count; + size2 = size; if (size > 1) { values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); - err = grib_unpack_double(a, values, &size); + err = grib_unpack_double(a, values, &size2); } else { - err = grib_unpack_double(a, &value, &size); + err = grib_unpack_double(a, &value, &size2); } + Assert(size == size2); self->empty = 0; @@ -312,7 +313,6 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* } if (icount > cols || i == 0) { fprintf(self->dumper.out, "\n "); - icount = 0; } sval = dval_to_string(c, values[i]); fprintf(self->dumper.out, "rvalues[%d]=%s;", i, sval); @@ -416,7 +416,6 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) } if (icount > cols || i == 0) { fprintf(self->dumper.out, "\n "); - icount = 0; } fprintf(self->dumper.out, "ivalues[%d]=%ld;", i, values[i]); @@ -522,7 +521,6 @@ static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* pr } if (icount > cols || i == 0) { fprintf(self->dumper.out, "\n "); - icount = 0; } fprintf(self->dumper.out, "ivalues[%d]=%ld;", i, values[i]); diff --git a/src/grib_dumper_class_bufr_encode_filter.c b/src/grib_dumper_class_bufr_encode_filter.c index a61dfe6b2..84e2a7de2 100644 --- a/src/grib_dumper_class_bufr_encode_filter.c +++ b/src/grib_dumper_class_bufr_encode_filter.c @@ -200,7 +200,6 @@ static void dump_values(grib_dumper* d, grib_accessor* a) } if (icount > cols || i == 0) { fprintf(self->dumper.out, "\n "); - icount = 0; } fprintf(self->dumper.out, "%.18e", values[i]); @@ -245,7 +244,7 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* { grib_dumper_bufr_encode_filter* self = (grib_dumper_bufr_encode_filter*)d; double value = 0; - size_t size = 0; + size_t size = 0, size2 = 0; double* values = NULL; int err = 0; int i, icount; @@ -258,14 +257,16 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* grib_value_count(a, &count); size = count; + size2 = size; if (size > 1) { values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); - err = grib_unpack_double(a, values, &size); + err = grib_unpack_double(a, values, &size2); } else { - err = grib_unpack_double(a, &value, &size); + err = grib_unpack_double(a, &value, &size2); } + Assert(size == size2); self->empty = 0; @@ -282,7 +283,6 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* } if (icount > cols || i == 0) { fprintf(self->dumper.out, "\n "); - icount = 0; } fprintf(self->dumper.out, "%.18e", values[i]); @@ -383,7 +383,6 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) } if (icount > cols || i == 0) { fprintf(self->dumper.out, "\n "); - icount = 0; } fprintf(self->dumper.out, "%ld ", values[i]); @@ -464,7 +463,6 @@ static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* pr } if (icount > cols || i == 0) { fprintf(self->dumper.out, "\n "); - icount = 0; } fprintf(self->dumper.out, "%ld ", values[i]); depth -= 2; diff --git a/src/grib_dumper_class_bufr_encode_fortran.c b/src/grib_dumper_class_bufr_encode_fortran.c index 3d08852f0..b8a2cff78 100644 --- a/src/grib_dumper_class_bufr_encode_fortran.c +++ b/src/grib_dumper_class_bufr_encode_fortran.c @@ -315,7 +315,7 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* { grib_dumper_bufr_encode_fortran* self = (grib_dumper_bufr_encode_fortran*)d; double value = 0; - size_t size = 0; + size_t size = 0, size2 = 0; double* values = NULL; int err = 0; int i, icount; @@ -329,14 +329,16 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* grib_value_count(a, &count); size = count; + size2 = size; if (size > 1) { values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); - err = grib_unpack_double(a, values, &size); + err = grib_unpack_double(a, values, &size2); } else { - err = grib_unpack_double(a, &value, &size); + err = grib_unpack_double(a, &value, &size2); } + Assert(size == size2); self->empty = 0; @@ -461,7 +463,6 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) } if (icount > cols || i == 0) { fprintf(self->dumper.out, " &\n "); - icount = 0; } fprintf(self->dumper.out, "%ld ", values[size - 1]); @@ -526,7 +527,7 @@ static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* pr { grib_dumper_bufr_encode_fortran* self = (grib_dumper_bufr_encode_fortran*)d; long value = 0; - size_t size = 0; + size_t size = 0, size2 = 0; long* values = NULL; int err = 0; int i, icount; @@ -540,14 +541,16 @@ static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* pr grib_value_count(a, &count); size = count; + size2 = size; if (size > 1) { values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); - err = grib_unpack_long(a, values, &size); + err = grib_unpack_long(a, values, &size2); } else { - err = grib_unpack_long(a, &value, &size); + err = grib_unpack_long(a, &value, &size2); } + Assert(size == size2); self->empty = 0; diff --git a/src/grib_dumper_class_bufr_encode_python.c b/src/grib_dumper_class_bufr_encode_python.c index 4ddd50290..49ea56968 100644 --- a/src/grib_dumper_class_bufr_encode_python.c +++ b/src/grib_dumper_class_bufr_encode_python.c @@ -215,7 +215,6 @@ static void dump_values(grib_dumper* d, grib_accessor* a) } if (icount > cols || i == 0) { fprintf(self->dumper.out, "\n "); - icount = 0; } sval = dval_to_string(c, values[i]); fprintf(self->dumper.out, "%s", sval); @@ -269,7 +268,7 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* { grib_dumper_bufr_encode_python* self = (grib_dumper_bufr_encode_python*)d; double value = 0; - size_t size = 0; + size_t size = 0, size2 = 0; double* values = NULL; int err = 0; int i, icount; @@ -283,14 +282,16 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* grib_value_count(a, &count); size = count; + size2 = size; if (size > 1) { values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); - err = grib_unpack_double(a, values, &size); + err = grib_unpack_double(a, values, &size2); } else { - err = grib_unpack_double(a, &value, &size); + err = grib_unpack_double(a, &value, &size2); } + Assert(size == size2); self->empty = 0; @@ -310,7 +311,6 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* } if (icount > cols || i == 0) { fprintf(self->dumper.out, "\n "); - icount = 0; } sval = dval_to_string(c, values[i]); fprintf(self->dumper.out, "%s", sval); @@ -414,7 +414,6 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) } if (icount > cols || i == 0) { fprintf(self->dumper.out, "\n "); - icount = 0; } fprintf(self->dumper.out, "%ld", values[i]); @@ -520,7 +519,6 @@ static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* pr } if (icount > cols || i == 0) { fprintf(self->dumper.out, " \n "); - icount = 0; } fprintf(self->dumper.out, "%ld ", values[i]); diff --git a/src/grib_dumper_class_bufr_simple.c b/src/grib_dumper_class_bufr_simple.c index 2a00dbc7e..28d3b5462 100644 --- a/src/grib_dumper_class_bufr_simple.c +++ b/src/grib_dumper_class_bufr_simple.c @@ -199,7 +199,6 @@ static void dump_values(grib_dumper* d, grib_accessor* a) } if (icount > cols || i == 0) { fprintf(self->dumper.out, "\n "); - icount = 0; } fprintf(self->dumper.out, "%g", values[i]); @@ -282,7 +281,6 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* } if (icount > cols || i == 0) { fprintf(self->dumper.out, "\n "); - icount = 0; } fprintf(self->dumper.out, "%g", values[i]); @@ -343,6 +341,7 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) DebugAssert(!err); fprintf(self->dumper.out, "%s=%ld\n", a->name, value); DebugAssert(!grib_is_missing_long(a, value)); + (void)err; return; } @@ -398,7 +397,6 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) } if (icount > cols || i == 0) { fprintf(self->dumper.out, "\n "); - icount = 0; } if (doing_unexpandedDescriptors) fprintf(self->dumper.out, "%06ld ", values[i]); @@ -483,7 +481,6 @@ static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* pr } if (icount > cols || i == 0) { fprintf(self->dumper.out, "\n "); - icount = 0; } fprintf(self->dumper.out, "%ld ", values[i]); fprintf(self->dumper.out, "}\n"); diff --git a/src/grib_dumper_class_debug.c b/src/grib_dumper_class_debug.c index 1d350a573..b3cc69e9e 100644 --- a/src/grib_dumper_class_debug.c +++ b/src/grib_dumper_class_debug.c @@ -281,7 +281,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) char* value = NULL; char* p = NULL; - err = _grib_get_string_length(a, &size); + _grib_get_string_length(a, &size); if ((size < 2) && grib_is_missing_internal(a)) { /* GRIB-302: transients and missing keys. Need to re-adjust the size */ size = 10; /* big enough to hold the string "missing" */ diff --git a/src/grib_dumper_class_json.c b/src/grib_dumper_class_json.c index 8c0abb36e..5defedad4 100644 --- a/src/grib_dumper_class_json.c +++ b/src/grib_dumper_class_json.c @@ -130,7 +130,7 @@ static void dump_values(grib_dumper* d, grib_accessor* a) { grib_dumper_json* self = (grib_dumper_json*)d; double value = 0; - size_t size = 1; + size_t size = 1, size2 = 0; double* values = NULL; int err = 0; int i; @@ -145,14 +145,17 @@ static void dump_values(grib_dumper* d, grib_accessor* a) h = grib_handle_of_accessor(a); grib_value_count(a, &count); size = count; + size2 = size; if (size > 1) { values = (double*)grib_context_malloc_clear(a->context, sizeof(double) * size); - err = grib_unpack_double(a, values, &size); + err = grib_unpack_double(a, values, &size2); } else { - err = grib_unpack_double(a, &value, &size); + err = grib_unpack_double(a, &value, &size2); } + Assert(size == size2); + (void)err; /* TODO */ if (self->begin == 0 && self->empty == 0 && self->isAttribute == 0) fprintf(self->dumper.out, ","); diff --git a/src/grib_dumper_class_wmo.c b/src/grib_dumper_class_wmo.c index 6db7f423c..13350bc70 100644 --- a/src/grib_dumper_class_wmo.c +++ b/src/grib_dumper_class_wmo.c @@ -304,7 +304,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) return; } - err = _grib_get_string_length(a, &size); + _grib_get_string_length(a, &size); value = (char*)grib_context_malloc_clear(a->context, size); if (!value) { grib_context_log(a->context, GRIB_LOG_FATAL, "unable to allocate %d bytes", (int)size); diff --git a/src/grib_gaussian_reduced.c b/src/grib_gaussian_reduced.c index 334b736d6..7d9aeac75 100644 --- a/src/grib_gaussian_reduced.c +++ b/src/grib_gaussian_reduced.c @@ -146,6 +146,8 @@ static Fraction_type fraction_construct_from_double(double x) static Fraction_value_type fraction_integralPart(const Fraction_type frac) { + Assert(frac.bottom_); + if (frac.bottom_ == 0) return frac.top_; return frac.top_ / frac.bottom_; } diff --git a/src/grib_handle.c b/src/grib_handle.c index b9762c09c..26e1fe557 100644 --- a/src/grib_handle.c +++ b/src/grib_handle.c @@ -1449,7 +1449,6 @@ grib_action* grib_action_from_filter(const char* filter) int grib_handle_apply_action(grib_handle* h, grib_action* a) { int err; - grib_action* ao = a; if (!a) return GRIB_SUCCESS; /* TODO: return error */ @@ -1461,15 +1460,12 @@ int grib_handle_apply_action(grib_handle* h, grib_action* a) a = a->next; } - a = ao; - return GRIB_SUCCESS; } int grib_handle_prepare_action(grib_handle* h, grib_action* a) { int err; - grib_action* ao = a; if (!a) return GRIB_SUCCESS; /* TODO: return error */ @@ -1481,8 +1477,6 @@ int grib_handle_prepare_action(grib_handle* h, grib_action* a) a = a->next; } - a = ao; - return GRIB_SUCCESS; } diff --git a/src/grib_iterator_class_space_view.c b/src/grib_iterator_class_space_view.c index e3119b607..2c26dcc93 100644 --- a/src/grib_iterator_class_space_view.c +++ b/src/grib_iterator_class_space_view.c @@ -221,7 +221,7 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) lop *= 1e-6; if (lap != 0.0) return GRIB_NOT_IMPLEMENTED; - lap *= DEG2RAD; + /*lap *= DEG2RAD;*/ lop *= DEG2RAD; orient_angle = orientationInDegrees; diff --git a/src/grib_itrie.c b/src/grib_itrie.c index 74a13c86a..b6c0dc105 100644 --- a/src/grib_itrie.c +++ b/src/grib_itrie.c @@ -320,7 +320,7 @@ grib_itrie* grib_itrie_new(grib_context* c, int* count) void grib_itrie_delete(grib_itrie* t) { GRIB_MUTEX_INIT_ONCE(&once, &init) - GRIB_MUTEX_LOCK(&mutex) + GRIB_MUTEX_LOCK(&mutex); if (t) { int i; @@ -331,27 +331,31 @@ void grib_itrie_delete(grib_itrie* t) grib_context_free(t->context, t); } - GRIB_MUTEX_UNLOCK(&mutex) + GRIB_MUTEX_UNLOCK(&mutex); } int grib_itrie_get_id(grib_itrie* t, const char* key) { const char* k = key; grib_itrie* last = t; + if (!t) { + Assert(!"grib_itrie_get_id: grib_trie==NULL"); + return -1; + } - GRIB_MUTEX_INIT_ONCE(&once, &init) - GRIB_MUTEX_LOCK(&mutex) + GRIB_MUTEX_INIT_ONCE(&once, &init); + GRIB_MUTEX_LOCK(&mutex); while (*k && t) t = t->next[mapping[(int)*k++]]; if (t != NULL && t->id != -1) { - GRIB_MUTEX_UNLOCK(&mutex) + GRIB_MUTEX_UNLOCK(&mutex); return t->id; } else { int ret = grib_itrie_insert(last, key); - GRIB_MUTEX_UNLOCK(&mutex) + GRIB_MUTEX_UNLOCK(&mutex); return ret; } } @@ -362,9 +366,13 @@ int grib_itrie_insert(grib_itrie* t, const char* key) grib_itrie* last = t; int* count; - GRIB_MUTEX_INIT_ONCE(&once, &init) + if (!t) { + Assert(!"grib_itrie_insert: grib_trie==NULL"); + return -1; + } - GRIB_MUTEX_LOCK(&mutex) + GRIB_MUTEX_INIT_ONCE(&once, &init); + GRIB_MUTEX_LOCK(&mutex); count = t->count; @@ -393,7 +401,7 @@ int grib_itrie_insert(grib_itrie* t, const char* key) Assert(*(t->count) < MAX_NUM_CONCEPTS); } - GRIB_MUTEX_UNLOCK(&mutex) + GRIB_MUTEX_UNLOCK(&mutex); /*printf("grib_itrie_get_id: %s -> %d\n",key,t->id);*/ diff --git a/src/grib_parse_utils.c b/src/grib_parse_utils.c index bb73bed20..0b74b16ef 100644 --- a/src/grib_parse_utils.c +++ b/src/grib_parse_utils.c @@ -210,6 +210,7 @@ int grib_accessor_print(grib_accessor* a, const char* name, int type, const char else { ret = _grib_get_size(h, a, &size); } + if (ret) return ret; dval = (double*)grib_context_malloc_clear(h->context, sizeof(double) * size); if (name[0] == '/' || name[0] == '#') { replen = size; @@ -250,6 +251,7 @@ int grib_accessor_print(grib_accessor* a, const char* name, int type, const char else { ret = _grib_get_size(h, a, &size); } + if (ret) return ret; lval = (long*)grib_context_malloc_clear(h->context, sizeof(long) * size); if (name[0] == '/' || name[0] == '#') { replen = size; diff --git a/src/grib_query.c b/src/grib_query.c index 479d002bf..5fcf013fc 100644 --- a/src/grib_query.c +++ b/src/grib_query.c @@ -618,7 +618,6 @@ grib_accessor* grib_find_accessor_fast(grib_handle* h, const char* name) int i = 0, len = 0; char name_space[MAX_NAMESPACE_LEN]; p--; - i = 0; len = p - name + 1; for (i = 0; i < len; i++) diff --git a/src/grib_trie.c b/src/grib_trie.c index 90e21ba56..7c122e062 100644 --- a/src/grib_trie.c +++ b/src/grib_trie.c @@ -394,6 +394,11 @@ void* grib_trie_insert(grib_trie* t, const char* key, void* data) const char* k = key; void* old = NULL; + if (!t) { + Assert(!"grib_trie_insert: grib_trie==NULL"); + return NULL; + } + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex); @@ -433,6 +438,11 @@ void* grib_trie_insert_no_replace(grib_trie* t, const char* key, void* data) grib_trie* last = t; const char* k = key; + if (!t) { + Assert(!"grib_trie_insert_no_replace: grib_trie==NULL"); + return NULL; + } + while (*k && t) { last = t; DebugCheckBounds((int)*k, key); diff --git a/src/grib_trie_with_rank.c b/src/grib_trie_with_rank.c index c9db33b68..93859a9a7 100644 --- a/src/grib_trie_with_rank.c +++ b/src/grib_trie_with_rank.c @@ -453,6 +453,11 @@ int grib_trie_with_rank_insert(grib_trie_with_rank* t, const char* key, void* da grib_trie_with_rank* last = t; const char* k = key; + if (!t) { + Assert(!"grib_trie_with_rank_insert: grib_trie==NULL"); + return -1; + } + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex); diff --git a/tests/bpv_limit.sh b/tests/bpv_limit.sh index 3cfc29906..1b7485fb5 100755 --- a/tests/bpv_limit.sh +++ b/tests/bpv_limit.sh @@ -17,7 +17,7 @@ REDIRECT=/dev/null -./bpv_limit ${data_dir}/regular_latlon_surface.grib2 +$EXEC ./bpv_limit ${data_dir}/regular_latlon_surface.grib2 # TODO: grib1 does not work yet. bpv=64 but decode does not fail as expected #for file in ${data_dir}/regular_latlon_surface.grib?; do diff --git a/tests/bufr_ecc-517.c b/tests/bufr_ecc-517.c index d71c33350..4c1ed0187 100644 --- a/tests/bufr_ecc-517.c +++ b/tests/bufr_ecc-517.c @@ -17,8 +17,6 @@ int main(int argc, char** argv) FILE* fout = NULL; codes_handle* h = NULL; long* ivalues = NULL; - char** svalues = NULL; - double* rvalues = NULL; const char* sampleName = "BUFR3_local"; char* outfilename = NULL; @@ -37,6 +35,7 @@ int main(int argc, char** argv) ivalues[0] = 1; CODES_CHECK(codes_set_long_array(h, "inputDelayedDescriptorReplicationFactor", ivalues, size), 0); + free(ivalues); ivalues = (long*)malloc(1 * sizeof(long)); size = 1; ivalues[0] = 486; @@ -81,9 +80,8 @@ int main(int argc, char** argv) CODES_CHECK(codes_set_double(h, "localLongitude", -6.343119999999999870e+00), 0); CODES_CHECK(codes_set_long(h, "observedData", 1), 0); CODES_CHECK(codes_set_long(h, "compressedData", 0), 0); - free(ivalues); - ivalues = NULL; + free(ivalues); ivalues = (long*)malloc(9 * sizeof(long)); if (!ivalues) { fprintf(stderr, "Failed to allocate memory (ivalues).\n"); @@ -102,6 +100,7 @@ int main(int argc, char** argv) fout = fopen(outfilename, "wb"); if (!fout) { fprintf(stderr, "Failed to open (create) output file.\n"); + free(ivalues); return 1; } CODES_CHECK(codes_get_message(h, &buffer, &size), 0); @@ -110,14 +109,13 @@ int main(int argc, char** argv) if (fwrite(buffer, 1, size, fout) != size) { fclose(fout); fprintf(stderr, "Failed to write data.\n"); + free(ivalues); return 1; } fclose(fout); codes_handle_delete(h); free(ivalues); - free(rvalues); - free(svalues); return 0; } diff --git a/tests/grib_lam_bf.sh b/tests/grib_lam_bf.sh index be4b8fad7..1ad596ea8 100755 --- a/tests/grib_lam_bf.sh +++ b/tests/grib_lam_bf.sh @@ -34,7 +34,7 @@ dump_and_check() # Spectral LAM fields (Bi-Fourier) # Run the test which generates the GRIB files -${test_dir}/grib_lam_bf +$EXEC ${test_dir}/grib_lam_bf dump_and_check lam_bf_lambert_bf_ellipse_diamond.grib 3128 dump_and_check lam_bf_mercator_bf_ellipse_diamond.grib 3128 diff --git a/tests/grib_lam_gp.sh b/tests/grib_lam_gp.sh index e7d7d5615..dcc55c029 100755 --- a/tests/grib_lam_gp.sh +++ b/tests/grib_lam_gp.sh @@ -32,7 +32,7 @@ dump_and_check() # Grid-point LAM fields # Run the test which generates the GRIB files -${test_dir}/grib_lam_gp +$EXEC ${test_dir}/grib_lam_gp dump_and_check lam_gp_lambert_lam.grib dump_and_check lam_gp_mercator_lam.grib diff --git a/tests/grib_optimize_scaling.sh b/tests/grib_optimize_scaling.sh index 10b7e3d46..f23390bf6 100755 --- a/tests/grib_optimize_scaling.sh +++ b/tests/grib_optimize_scaling.sh @@ -10,4 +10,4 @@ . ./include.sh -exec $test_dir/grib_optimize_scaling +$EXEC $test_dir/grib_optimize_scaling diff --git a/tests/grib_sh_ieee64.sh b/tests/grib_sh_ieee64.sh index 9c91cc617..63e32c518 100755 --- a/tests/grib_sh_ieee64.sh +++ b/tests/grib_sh_ieee64.sh @@ -10,4 +10,4 @@ . ./include.sh -exec $test_dir/grib_sh_ieee64 +$EXEC $test_dir/grib_sh_ieee64 diff --git a/tests/ieee.sh b/tests/ieee.sh index 6006a3e4e..2f1c1735c 100755 --- a/tests/ieee.sh +++ b/tests/ieee.sh @@ -67,6 +67,51 @@ ${tools_dir}/grib_filter r.filter ${shdata}_ieee > $shdata.txt diff $shdata.txt $shdata.good rm -f ${shdata}_ieee + +echo "Test ECC-1075: grib_dump error on GRIB1 with raw packing" +# ------------------------------------------------------------- +temp=temp.grib_ieee.grib +infile=${data_dir}/reduced_gaussian_surface.grib1 +grib_check_key_equals $infile numberOfMissing 0 +${tools_dir}/grib_set -r -s packingType=grid_ieee $infile $temp +grib_check_key_equals $temp 'numberOfEffectiveValues,numberOfValues' '6114 6114' +${tools_dir}/grib_get -p numberOfEffectiveValues,numberOfValues $temp +#${tools_dir}/grib_dump -O $temp + +stats1=`${tools_dir}/grib_get -M -F%.3f -p min,max,avg $infile` +stats2=`${tools_dir}/grib_get -M -F%.3f -p min,max,avg $temp` +[ "$stats1" = "$stats2" ] + +echo "Test raw packing on GRIB2 with bitmap..." +# --------------------------------------------- +infile=${data_dir}/reduced_latlon_surface.grib2 +grib_check_key_equals $infile numberOfMissing,const '98701 0' +${tools_dir}/grib_set -r -s packingType=grid_ieee $infile $temp +${tools_dir}/grib_get -p numberOfEffectiveValues,numberOfValues,numberOfMissing $temp +stats1=`${tools_dir}/grib_get -M -F%.3f -p min,max,avg $infile` +stats2=`${tools_dir}/grib_get -M -F%.3f -p min,max,avg $temp` +[ "$stats1" = "$stats2" ] +grib_check_key_equals $temp numberOfEffectiveValues,numberOfValues,numberOfMissing '214661 214661 98701' +grib_check_key_equals $temp totalLength 899004 + + + +echo "Test raw packing on GRIB1 with bitmap..." +# --------------------------------------------- +# TODO: This test is currently failing +# grib1 with a bitmap -> raw packing +infile=${data_dir}/reduced_latlon_surface.grib1 +grib_check_key_equals $infile numberOfMissing 98701 +${tools_dir}/grib_set -r -s packingType=grid_ieee $infile $temp +${tools_dir}/grib_get -p numberOfEffectiveValues,numberOfValues,numberOfMissing $temp +stats1=`${tools_dir}/grib_get -M -F%.3f -p min,max,avg $infile` +stats2=`${tools_dir}/grib_get -M -F%.3f -p min,max,avg $temp` +# [ "$stats1" = "$stats2" ] + + +rm -f $temp + + ################################## # Disabled for now. Infinite loop #GRIB_IEEE_PACKING=32 diff --git a/tests/unit_tests.sh b/tests/unit_tests.sh index dbae5254e..5a8b6905c 100755 --- a/tests/unit_tests.sh +++ b/tests/unit_tests.sh @@ -10,4 +10,4 @@ . ./include.sh -exec ${test_dir}/unit_tests +$EXEC ${test_dir}/unit_tests diff --git a/tools/bufr_compare.c b/tools/bufr_compare.c index 2f5e5b572..3102ec6bb 100644 --- a/tools/bufr_compare.c +++ b/tools/bufr_compare.c @@ -180,6 +180,7 @@ static double compare_double_relative(double* a, double* b, double* err) static int blacklisted(const char* name) { grib_string_list* b = blacklist; + if (!name) return 0; while (b) { Assert(b->value); if (!strcmp(name, b->value)) diff --git a/tools/bufr_ls.c b/tools/bufr_ls.c index eb09335f2..8ba250f49 100644 --- a/tools/bufr_ls.c +++ b/tools/bufr_ls.c @@ -105,6 +105,10 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) exit(err); } if (options->json_output) { + if (options->current_infile && options->current_infile->name) { + size_t len = strlen(options->current_infile->name); + grib_set_string(h, "file", options->current_infile->name, &len); + } if (!first_handle && options->handle_count > 1) { fprintf(stdout, ",\n"); } diff --git a/tools/grib_get.c b/tools/grib_get.c index 9926bd533..7444d48ea 100644 --- a/tools/grib_get.c +++ b/tools/grib_get.c @@ -195,7 +195,6 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) 0); min = options->distances[0]; options->latlon_idx = 0; - i = 0; for (i = 1; i < 4; i++) { if (min > options->distances[i]) { min = options->distances[i]; diff --git a/tools/grib_ls.c b/tools/grib_ls.c index f4fad0c11..be95e4c4f 100644 --- a/tools/grib_ls.c +++ b/tools/grib_ls.c @@ -306,7 +306,6 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) if (!options->latlon_mask) { min = options->distances[0]; options->latlon_idx = 0; - i = 0; for (i = 1; i < 4; i++) { if (min > options->distances[i]) { min = options->distances[i]; @@ -360,6 +359,10 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) } if (!json_latlon && options->json_output) { + if (options->current_infile && options->current_infile->name) { + size_t len = strlen(options->current_infile->name); + grib_set_string(h, "file", options->current_infile->name, &len); + } if (!first_handle && options->handle_count > 1) { fprintf(stdout, ",\n"); } diff --git a/tools/grib_to_netcdf.c b/tools/grib_to_netcdf.c index 06226c45e..67e8de3e4 100644 --- a/tools/grib_to_netcdf.c +++ b/tools/grib_to_netcdf.c @@ -2241,7 +2241,6 @@ static int def_latlon(int ncid, fieldset* fs) { int n = 0; size_t nlats = 0, nlons = 0; - int var_id = 0; err e = 0; field* g = get_field(fs, 0, expand_mem); @@ -2255,16 +2254,15 @@ static int def_latlon(int ncid, fieldset* fs) /* Define longitude */ n = (int)nlons; - var_id = set_dimension(ncid, "longitude", n, NC_FLOAT, "degrees_east", "longitude"); + set_dimension(ncid, "longitude", n, NC_FLOAT, "degrees_east", "longitude"); /* Define latitude */ n = nlats; - var_id = set_dimension(ncid, "latitude", n, NC_FLOAT, "degrees_north", "latitude"); + set_dimension(ncid, "latitude", n, NC_FLOAT, "degrees_north", "latitude"); /* g->purge_header = TRUE; */ release_field(g); - (void)var_id; /* suppress gcc warning */ return e; } @@ -2629,7 +2627,10 @@ static void scale(double* vals, long n, void* data, dataset_t* g) grib_context_log(ctx,GRIB_LOG_DEBUG,"No scale required"); return; } - */ + */ + DebugAssert(vals); + DebugAssert(n>0); + if(!vals) return; switch (nctype) { case NC_BYTE: { diff --git a/tools/gts_compare.c b/tools/gts_compare.c index 70ef54e24..024a80e96 100644 --- a/tools/gts_compare.c +++ b/tools/gts_compare.c @@ -93,6 +93,7 @@ static void write_messages(grib_handle* h1, grib_handle* h2) static int blacklisted(const char* name) { grib_string_list* b = blacklist; + if (!name) return 0; while (b) { Assert(b->value); if (!strcmp(name, b->value)) diff --git a/tools/metar_compare.c b/tools/metar_compare.c index 7f758c3ea..9af1c9d28 100644 --- a/tools/metar_compare.c +++ b/tools/metar_compare.c @@ -140,6 +140,7 @@ static double compare_double_relative(double* a, double* b, double* err) static int blacklisted(const char* name) { grib_string_list* b = blacklist; + if (!name) return 0; while (b) { Assert(b->value); if (!strcmp(name, b->value)) From 80c3ad72b9d8df3b75fc865bad18efeb862e9de9 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 19 Feb 2020 12:18:44 +0000 Subject: [PATCH 62/82] Latest updates from develop (17) --- definitions/boot.def | 2 - definitions/common/c-1.table | 2 +- definitions/common/c-11.table | 2 +- definitions/grib1/boot.def | 1 - definitions/grib2/boot.def | 1 - definitions/grib2/template.3.grid.def | 2 - definitions/grib3/boot.def | 1 - definitions/grib3/template.component.4.1.def | 2 - definitions/metar/boot.def | 3 +- definitions/taf/boot.def | 2 + src/eccodes.h | 54 +- ...grib_accessor_class_data_complex_packing.c | 2 - src/grib_accessor_class_data_sh_packed.c | 4 +- src/grib_accessor_class_data_sh_unpacked.c | 13 +- src/grib_accessor_class_g2level.c | 1 - src/grib_accessor_class_unsigned_bits.c | 7 +- src/grib_hash_keys.c | 9203 +++++++++-------- src/grib_query.c | 1 - tests/bufr_ecc-517.c | 1 - tests/keys | 4663 ++++----- tools/grib_histogram.c | 2 +- 21 files changed, 7023 insertions(+), 6946 deletions(-) diff --git a/definitions/boot.def b/definitions/boot.def index 5287c0308..ca68cf583 100644 --- a/definitions/boot.def +++ b/definitions/boot.def @@ -28,8 +28,6 @@ GRIBEX_boustrophedonic = getenv("ECCODES_GRIBEX_BOUSTROPHEDONIC","0") :hidden; constant zero=0 : hidden; constant one=1 : hidden; constant hundred=100 : hidden; -constant true="true" :hidden; -constant false="false" : hidden; transient truncateLaplacian=0 : hidden; constant marsDir="mars" : no_copy,hidden; constant present=1 : hidden; diff --git a/definitions/common/c-1.table b/definitions/common/c-1.table index 7a44dc743..5abb3f8ef 100644 --- a/definitions/common/c-1.table +++ b/definitions/common/c-1.table @@ -75,7 +75,7 @@ 211 211 Lannion 212 212 Lisboa 213 213 Reykjavik -214 lemm INM +214 lemm INM Madrid 215 lssw Zurich 216 216 Service ARGOS Toulouse 218 habp Budapest diff --git a/definitions/common/c-11.table b/definitions/common/c-11.table index 5b4c96cdd..503b78f7b 100644 --- a/definitions/common/c-11.table +++ b/definitions/common/c-11.table @@ -74,7 +74,7 @@ 211 211 Lannion 212 212 Lisboa 213 213 Reykjavik -214 lemm INM +214 lemm INM Madrid 215 lssw Zurich 216 216 Service ARGOS Toulouse 217 217 Bratislava diff --git a/definitions/grib1/boot.def b/definitions/grib1/boot.def index df8ea9aa9..7c76d27d8 100644 --- a/definitions/grib1/boot.def +++ b/definitions/grib1/boot.def @@ -55,7 +55,6 @@ alias bitmapSectionPresent=bitmapPresent; alias geography.bitmapPresent=bitmapPresent; alias missingValuesPresent=bitmapPresent : read_only; transient angleSubdivisions=1000; # milli degrees -alias angularPrecision=angleSubdivisions : hidden; if(gridDescriptionSectionPresent){ template section_2 "grib1/section.2.def" ; diff --git a/definitions/grib2/boot.def b/definitions/grib2/boot.def index 97ef6f90a..cc820fb27 100644 --- a/definitions/grib2/boot.def +++ b/definitions/grib2/boot.def @@ -18,7 +18,6 @@ alias is_tigge = zero; alias is_s2s = zero; transient is_efas = 0; transient angleSubdivisions=grib2divider; # micro degrees -alias angularPrecision=angleSubdivisions : hidden; meta gts_header gts_header() : no_copy,hidden,read_only; meta gts_TTAAii gts_header(20,6) : no_copy,hidden,read_only; diff --git a/definitions/grib2/template.3.grid.def b/definitions/grib2/template.3.grid.def index 98ede4f9a..f0d586dec 100644 --- a/definitions/grib2/template.3.grid.def +++ b/definitions/grib2/template.3.grid.def @@ -30,10 +30,8 @@ unsigned[4] subdivisionsOfBasicAngle = missing() : can_be_missing; transient angleDivisor = 1000000; when (missing(subdivisionsOfBasicAngle) || subdivisionsOfBasicAngle == 0) { set angleDivisor = 1000000; - set angularPrecision = 1000000; } else { set angleDivisor = subdivisionsOfBasicAngle; - set angularPrecision = subdivisionsOfBasicAngle; } # La1 - latitude of first grid point diff --git a/definitions/grib3/boot.def b/definitions/grib3/boot.def index 34cf69829..92a16c2c0 100644 --- a/definitions/grib3/boot.def +++ b/definitions/grib3/boot.def @@ -14,7 +14,6 @@ alias extraDimensionPresent=zero; alias is_tigge = zero; alias is_s2s = zero; transient angleSubdivisions=grib3divider; # micro degrees -alias angularPrecision=angleSubdivisions : hidden; meta gts_header gts_header() : no_copy,hidden,read_only; meta gts_TTAAii gts_header(20,6) : no_copy,hidden,read_only; diff --git a/definitions/grib3/template.component.4.1.def b/definitions/grib3/template.component.4.1.def index c308129c1..3fc6ff0c1 100644 --- a/definitions/grib3/template.component.4.1.def +++ b/definitions/grib3/template.component.4.1.def @@ -32,10 +32,8 @@ unsigned[4] subdivisionsOfBasicAngle = missing() : can_be_missing; transient angleDivisor = 1000000; when (missing(subdivisionsOfBasicAngle) || subdivisionsOfBasicAngle == 0) { set angleDivisor = 1000000; - set angularPrecision = 1000000; } else { set angleDivisor = subdivisionsOfBasicAngle; - set angularPrecision = subdivisionsOfBasicAngle; } # Note: Basic angle of the initial production domain and subdivisions of this basic angle are diff --git a/definitions/metar/boot.def b/definitions/metar/boot.def index 59c3f4c0c..d35cedf83 100644 --- a/definitions/metar/boot.def +++ b/definitions/metar/boot.def @@ -9,6 +9,8 @@ constant normal="NORMAL"; constant correction="CORRECTION"; +constant true="true" :hidden; +constant false="false" : hidden; #meta out sprintf("metar_%s.xml",count); alias temperatureAndDewpointPresent=zero; @@ -155,4 +157,3 @@ meta lengthOfMessage evaluate( endOfMessage-startOfMessage); meta md5Headers md5(startOfMessage,lengthOfMessage); alias ls.totalLength=totalLength; - diff --git a/definitions/taf/boot.def b/definitions/taf/boot.def index a9557208f..19af85827 100644 --- a/definitions/taf/boot.def +++ b/definitions/taf/boot.def @@ -9,6 +9,8 @@ constant normal="NORMAL"; constant correction="CORRECTION"; +constant true="true" :hidden; +constant false="false" : hidden; #meta out sprintf("metar_%s.xml",count); alias temperatureAndDewpointPresent=zero; diff --git a/src/eccodes.h b/src/eccodes.h index f13cbaf88..a310dbbfb 100644 --- a/src/eccodes.h +++ b/src/eccodes.h @@ -1231,31 +1231,35 @@ int codes_points_get_values(codes_handle* h, codes_points* points, double* val); /* --------------------------------------- */ -#define CODES_UTIL_GRID_SPEC_REGULAR_LL GRIB_UTIL_GRID_SPEC_REGULAR_LL -#define CODES_UTIL_GRID_SPEC_ROTATED_LL GRIB_UTIL_GRID_SPEC_ROTATED_LL -#define CODES_UTIL_GRID_SPEC_REGULAR_GG GRIB_UTIL_GRID_SPEC_REGULAR_GG -#define CODES_UTIL_GRID_SPEC_ROTATED_GG GRIB_UTIL_GRID_SPEC_ROTATED_GG -#define CODES_UTIL_GRID_SPEC_REDUCED_GG GRIB_UTIL_GRID_SPEC_REDUCED_GG -#define CODES_UTIL_GRID_SPEC_SH GRIB_UTIL_GRID_SPEC_SH -#define CODES_UTIL_GRID_SPEC_REDUCED_LL GRIB_UTIL_GRID_SPEC_REDUCED_LL -#define CODES_UTIL_GRID_SPEC_POLAR_STEREOGRAPHIC GRIB_UTIL_GRID_SPEC_POLAR_STEREOGRAPHIC -#define CODES_UTIL_GRID_SPEC_LAMBERT_AZIMUTHAL_EQUAL_AREA GRIB_UTIL_GRID_SPEC_LAMBERT_AZIMUTHAL_EQUAL_AREA -#define CODES_UTIL_GRID_SPEC_LAMBERT_CONFORMAL GRIB_UTIL_GRID_SPEC_LAMBERT_CONFORMAL -#define CODES_UTIL_GRID_SPEC_UNSTRUCTURED GRIB_UTIL_GRID_SPEC_UNSTRUCTURED - -#define CODES_UTIL_PACKING_TYPE_SPECTRAL_COMPLEX GRIB_UTIL_PACKING_TYPE_SPECTRAL_COMPLEX -#define CODES_UTIL_PACKING_TYPE_SPECTRAL_SIMPLE GRIB_UTIL_PACKING_TYPE_SPECTRAL_SIMPLE -#define CODES_UTIL_PACKING_TYPE_JPEG GRIB_UTIL_PACKING_TYPE_JPEG -#define CODES_UTIL_PACKING_TYPE_GRID_COMPLEX GRIB_UTIL_PACKING_TYPE_GRID_COMPLEX -#define CODES_UTIL_PACKING_TYPE_GRID_SIMPLE GRIB_UTIL_PACKING_TYPE_GRID_SIMPLE -#define CODES_UTIL_PACKING_TYPE_GRID_SIMPLE_MATRIX GRIB_UTIL_PACKING_TYPE_GRID_SIMPLE_MATRIX -#define CODES_UTIL_PACKING_TYPE_GRID_SECOND_ORDER GRIB_UTIL_PACKING_TYPE_GRID_SECOND_ORDER -#define CODES_UTIL_PACKING_SAME_AS_INPUT GRIB_UTIL_PACKING_SAME_AS_INPUT -#define CODES_UTIL_PACKING_USE_PROVIDED GRIB_UTIL_PACKING_USE_PROVIDED -#define CODES_UTIL_ACCURACY_SAME_BITS_PER_VALUES_AS_INPUT GRIB_UTIL_ACCURACY_SAME_BITS_PER_VALUES_AS_INPUT -#define CODES_UTIL_ACCURACY_USE_PROVIDED_BITS_PER_VALUES GRIB_UTIL_ACCURACY_USE_PROVIDED_BITS_PER_VALUES -#define CODES_UTIL_ACCURACY_SAME_DECIMAL_SCALE_FACTOR_AS_INPUT GRIB_UTIL_ACCURACY_SAME_DECIMAL_SCALE_FACTOR_AS_INPUT -#define CODES_UTIL_ACCURACY_USE_PROVIDED_DECIMAL_SCALE_FACTOR GRIB_UTIL_ACCURACY_USE_PROVIDED_DECIMAL_SCALE_FACTOR +#define CODES_UTIL_GRID_SPEC_REGULAR_LL GRIB_UTIL_GRID_SPEC_REGULAR_LL +#define CODES_UTIL_GRID_SPEC_ROTATED_LL GRIB_UTIL_GRID_SPEC_ROTATED_LL +#define CODES_UTIL_GRID_SPEC_REGULAR_GG GRIB_UTIL_GRID_SPEC_REGULAR_GG +#define CODES_UTIL_GRID_SPEC_ROTATED_GG GRIB_UTIL_GRID_SPEC_ROTATED_GG +#define CODES_UTIL_GRID_SPEC_REDUCED_GG GRIB_UTIL_GRID_SPEC_REDUCED_GG +#define CODES_UTIL_GRID_SPEC_SH GRIB_UTIL_GRID_SPEC_SH +#define CODES_UTIL_GRID_SPEC_REDUCED_LL GRIB_UTIL_GRID_SPEC_REDUCED_LL +#define CODES_UTIL_GRID_SPEC_POLAR_STEREOGRAPHIC GRIB_UTIL_GRID_SPEC_POLAR_STEREOGRAPHIC +#define CODES_UTIL_GRID_SPEC_REDUCED_ROTATED_GG GRIB_UTIL_GRID_SPEC_REDUCED_ROTATED_GG +#define CODES_UTIL_GRID_SPEC_LAMBERT_AZIMUTHAL_EQUAL_AREA GRIB_UTIL_GRID_SPEC_LAMBERT_AZIMUTHAL_EQUAL_AREA +#define CODES_UTIL_GRID_SPEC_LAMBERT_CONFORMAL GRIB_UTIL_GRID_SPEC_LAMBERT_CONFORMAL +#define CODES_UTIL_GRID_SPEC_UNSTRUCTURED GRIB_UTIL_GRID_SPEC_UNSTRUCTURED + +#define CODES_UTIL_PACKING_TYPE_SAME_AS_INPUT GRIB_UTIL_PACKING_TYPE_SAME_AS_INPUT +#define CODES_UTIL_PACKING_TYPE_SPECTRAL_COMPLEX GRIB_UTIL_PACKING_TYPE_SPECTRAL_COMPLEX +#define CODES_UTIL_PACKING_TYPE_SPECTRAL_SIMPLE GRIB_UTIL_PACKING_TYPE_SPECTRAL_SIMPLE +#define CODES_UTIL_PACKING_TYPE_JPEG GRIB_UTIL_PACKING_TYPE_JPEG +#define CODES_UTIL_PACKING_TYPE_GRID_COMPLEX GRIB_UTIL_PACKING_TYPE_GRID_COMPLEX +#define CODES_UTIL_PACKING_TYPE_GRID_SIMPLE GRIB_UTIL_PACKING_TYPE_GRID_SIMPLE +#define CODES_UTIL_PACKING_TYPE_GRID_SIMPLE_MATRIX GRIB_UTIL_PACKING_TYPE_GRID_SIMPLE_MATRIX +#define CODES_UTIL_PACKING_TYPE_GRID_SECOND_ORDER GRIB_UTIL_PACKING_TYPE_GRID_SECOND_ORDER +#define CODES_UTIL_PACKING_TYPE_CCSDS GRIB_UTIL_PACKING_TYPE_CCSDS +#define CODES_UTIL_PACKING_SAME_AS_INPUT GRIB_UTIL_PACKING_SAME_AS_INPUT +#define CODES_UTIL_PACKING_USE_PROVIDED GRIB_UTIL_PACKING_USE_PROVIDED + +#define CODES_UTIL_ACCURACY_SAME_BITS_PER_VALUES_AS_INPUT GRIB_UTIL_ACCURACY_SAME_BITS_PER_VALUES_AS_INPUT +#define CODES_UTIL_ACCURACY_USE_PROVIDED_BITS_PER_VALUES GRIB_UTIL_ACCURACY_USE_PROVIDED_BITS_PER_VALUES +#define CODES_UTIL_ACCURACY_SAME_DECIMAL_SCALE_FACTOR_AS_INPUT GRIB_UTIL_ACCURACY_SAME_DECIMAL_SCALE_FACTOR_AS_INPUT +#define CODES_UTIL_ACCURACY_USE_PROVIDED_DECIMAL_SCALE_FACTOR GRIB_UTIL_ACCURACY_USE_PROVIDED_DECIMAL_SCALE_FACTOR codes_handle* codes_grib_util_set_spec(codes_handle* h, diff --git a/src/grib_accessor_class_data_complex_packing.c b/src/grib_accessor_class_data_complex_packing.c index 7a8637b61..b1c5bc0e9 100644 --- a/src/grib_accessor_class_data_complex_packing.c +++ b/src/grib_accessor_class_data_complex_packing.c @@ -721,8 +721,6 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) for (i = 1; i < maxv; i++) scals[i] = ((double)pow(i * (i + 1), laplacianOperator)); - i = 0; - mmax = 0; maxv = pen_j + 1; i = 0; diff --git a/src/grib_accessor_class_data_sh_packed.c b/src/grib_accessor_class_data_sh_packed.c index b7b3b7e76..28f3336e4 100644 --- a/src/grib_accessor_class_data_sh_packed.c +++ b/src/grib_accessor_class_data_sh_packed.c @@ -377,7 +377,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) for (hcount = 0; hcount < sub_k + 1; hcount++) { dummy = decode_float(grib_decode_unsigned_long(hres, &hpos, 8 * bytes)); dummy = decode_float(grib_decode_unsigned_long(hres, &hpos, 8 * bytes)); - + (void)dummy; lup++; } sub_k--; @@ -406,8 +406,6 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) Assert(*len >= i); *len = n_vals; - - (void)dummy; /* suppress gcc warning */ grib_context_free(a->context, scals); return ret; diff --git a/src/grib_accessor_class_data_sh_unpacked.c b/src/grib_accessor_class_data_sh_unpacked.c index 41448fb61..31485bedd 100644 --- a/src/grib_accessor_class_data_sh_unpacked.c +++ b/src/grib_accessor_class_data_sh_unpacked.c @@ -370,14 +370,9 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) /* pscals=scals+lup; */ for (lcount = hcount; lcount < maxv; lcount++) { - dummy = d * (double)((grib_decode_unsigned_long(lres, &lpos, - bits_per_value) * - s) + - reference_value); - dummy = d * (double)((grib_decode_unsigned_long(lres, &lpos, - bits_per_value) * - s) + - reference_value); + dummy = d * (double)((grib_decode_unsigned_long(lres, &lpos, bits_per_value) * s) + reference_value); + dummy = d * (double)((grib_decode_unsigned_long(lres, &lpos, bits_per_value) * s) + reference_value); + (void)dummy; /* suppress gcc warning */ lup++; } @@ -389,8 +384,6 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) Assert(*len >= i); *len = n_vals; - - (void)dummy; /* suppress gcc warning */ grib_context_free(a->context, scals); return ret; diff --git a/src/grib_accessor_class_g2level.c b/src/grib_accessor_class_g2level.c index ec3c60079..777e6ce2f 100644 --- a/src/grib_accessor_class_g2level.c +++ b/src/grib_accessor_class_g2level.c @@ -257,7 +257,6 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) switch (type_first) { case 100: /* Pa */ - scale_first = 0; if (!strcmp(pressure_units, "hPa")) value_first *= 100; break; diff --git a/src/grib_accessor_class_unsigned_bits.c b/src/grib_accessor_class_unsigned_bits.c index 8dfcfeb2a..33580a7a8 100644 --- a/src/grib_accessor_class_unsigned_bits.c +++ b/src/grib_accessor_class_unsigned_bits.c @@ -226,8 +226,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) unsigned long i = 0; long rlen = 0; ret = value_count(a, &rlen); - if (ret) - return ret; + if (ret) return ret; /* if(*len < rlen) @@ -239,10 +238,10 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) */ if (*len != rlen) ret = grib_set_long(grib_handle_of_accessor(a), self->numberOfElements, *len); + if (ret) return ret; ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfBits, &numberOfBits); - if (ret) - return ret; + if (ret) return ret; if (numberOfBits == 0) { grib_buffer_replace(a, NULL, 0, 1, 1); return GRIB_SUCCESS; diff --git a/src/grib_hash_keys.c b/src/grib_hash_keys.c index b23f1ffbe..772c52420 100644 --- a/src/grib_hash_keys.c +++ b/src/grib_hash_keys.c @@ -34,12 +34,12 @@ error "gperf generated tables don't work with this execution character set. Plea struct grib_keys_hash { char* name; int id;}; #include -#define TOTAL_KEYWORDS 2354 +#define TOTAL_KEYWORDS 2359 #define MIN_WORD_LENGTH 1 #define MAX_WORD_LENGTH 74 -#define MIN_HASH_VALUE 3 -#define MAX_HASH_VALUE 30002 -/* maximum key range = 30000, duplicates = 0 */ +#define MIN_HASH_VALUE 5 +#define MAX_HASH_VALUE 30459 +/* maximum key range = 30455, duplicates = 0 */ #ifdef __GNUC__ @@ -49,36 +49,36 @@ struct grib_keys_hash { char* name; int id;}; #endif #endif static unsigned int -hash_keys (const char *str, unsigned int len) +hash_keys (const char* str, unsigned int len) { static const unsigned short asso_values[] = { - 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, - 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, - 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, - 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, - 30003, 30003, 1, 30003, 30003, 2, 30003, 30003, 50, 2141, - 2352, 1970, 2247, 1858, 2819, 2952, 291, 34, 2, 1, - 1, 1, 30003, 30003, 30003, 1610, 4227, 1971, 109, 1060, - 435, 2632, 3787, 1463, 1108, 302, 426, 1218, 345, 225, - 561, 421, 316, 150, 86, 3850, 1462, 2482, 774, 4019, - 35, 2, 5, 30003, 1, 2421, 30003, 5, 26, 59, - 1, 2, 486, 130, 73, 10, 2432, 2834, 78, 7, - 1, 20, 29, 997, 1, 8, 4, 61, 174, 564, - 124, 22, 2231, 55, 1487, 7, 30003, 30003, 30003, 30003, - 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, - 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, - 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, - 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, - 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, - 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, - 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, - 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, - 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, - 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, - 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, - 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, - 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003, 30003 + 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, + 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, + 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, + 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, + 30460, 30460, 3, 30460, 30460, 2, 30460, 30460, 159, 2174, + 2478, 1797, 1710, 2393, 2659, 2924, 43, 9, 3, 2, + 2, 2, 30460, 30460, 30460, 944, 4153, 1649, 195, 872, + 345, 2381, 3228, 1901, 2474, 458, 309, 1236, 261, 111, + 945, 35, 427, 193, 63, 4079, 583, 1907, 744, 3546, + 45, 2, 3, 30460, 2, 2917, 30460, 4, 91, 46, + 2, 7, 545, 103, 100, 7, 2018, 2216, 69, 8, + 2, 21, 23, 874, 9, 9, 3, 63, 216, 285, + 77, 79, 571, 53, 3561, 8, 30460, 30460, 30460, 30460, + 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, + 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, + 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, + 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, + 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, + 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, + 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, + 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, + 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, + 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, + 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, + 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, + 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460 }; register int hval = len; @@ -163,1044 +163,1019 @@ hash_keys (const char *str, unsigned int len) static const unsigned char lengthtable[] = { - 0, 0, 0, 1, 0, 2, 2, 3, 2, 1, 0, 2, 2, 2, - 0, 1, 0, 0, 4, 0, 0, 4, 3, 0, 4, 0, 0, 5, - 3, 4, 0, 5, 0, 4, 0, 4, 5, 0, 4, 0, 6, 4, - 0, 5, 0, 0, 8, 2, 0, 0, 3, 6, 5, 3, 0, 0, - 7, 4, 7, 5, 7, 0, 0, 4, 6, 0, 9, 9, 0, 9, - 9, 0, 0, 0, 4, 3, 4, 6, 0, 0, 0, 0, 10, 0, - 10, 7, 6, 0, 4, 5, 0, 6, 5, 6, 7, 0, 0, 5, - 6, 0, 6, 5, 0, 0, 6, 6, 0, 0, 0, 0, 10, 0, - 7, 10, 6, 0, 6, 7, 9, 8, 7, 0, 0, 7, 5, 5, - 0, 8, 0, 8, 8, 2, 0, 0, 0, 0, 0, 0, 10, 3, - 0, 6, 7, 4, 0, 8, 5, 4, 7, 7, 9, 0, 8, 0, - 5, 2, 0, 9, 0, 0, 4, 0, 0, 3, 8, 0, 0, 0, - 0, 0, 8, 5, 0, 0, 0, 8, 7, 0, 0, 6, 0, 0, - 8, 5, 10, 9, 7, 2, 10, 0, 9, 5, 8, 6, 5, 0, - 6, 7, 0, 0, 8, 10, 11, 0, 0, 0, 0, 10, 10, 0, - 0, 0, 7, 0, 0, 0, 0, 0, 0, 10, 10, 0, 6, 0, - 7, 7, 5, 0, 5, 0, 10, 8, 0, 9, 13, 7, 0, 0, - 10, 0, 11, 0, 0, 8, 0, 9, 0, 0, 0, 0, 0, 2, - 0, 10, 0, 11, 10, 0, 0, 10, 2, 1, 0, 3, 0, 0, - 6, 0, 0, 14, 9, 0, 17, 0, 0, 0, 0, 8, 0, 8, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, - 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 7, 10, 9, 0, - 0, 0, 0, 0, 0, 11, 7, 0, 0, 10, 9, 0, 7, 0, - 0, 5, 0, 0, 0, 0, 7, 0, 0, 0, 0, 10, 10, 0, - 9, 11, 0, 6, 0, 0, 6, 0, 0, 0, 0, 9, 0, 2, - 0, 0, 0, 0, 0, 0, 6, 11, 0, 2, 0, 0, 0, 0, - 0, 8, 0, 2, 8, 8, 0, 11, 0, 0, 0, 10, 0, 0, - 0, 2, 12, 0, 0, 13, 10, 0, 0, 0, 2, 12, 0, 2, - 2, 0, 0, 0, 11, 0, 11, 2, 0, 0, 0, 10, 13, 10, - 8, 0, 0, 0, 0, 11, 0, 0, 13, 0, 0, 5, 0, 11, - 0, 6, 0, 0, 0, 0, 10, 0, 0, 13, 0, 3, 0, 4, - 0, 11, 0, 0, 0, 0, 0, 0, 3, 0, 0, 17, 12, 0, - 13, 0, 0, 3, 5, 3, 0, 9, 0, 0, 0, 0, 0, 15, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 5, 0, - 9, 0, 9, 0, 0, 0, 0, 10, 9, 0, 9, 8, 0, 0, - 6, 12, 3, 0, 0, 0, 0, 0, 0, 12, 0, 0, 6, 0, - 0, 0, 0, 0, 9, 0, 7, 8, 0, 0, 0, 0, 12, 0, - 0, 2, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 3, 19, 3, 11, 6, 18, 10, 0, 0, 0, 0, 0, 0, 0, - 10, 0, 10, 0, 0, 13, 0, 0, 0, 0, 0, 20, 0, 0, - 0, 24, 0, 0, 0, 0, 0, 9, 0, 0, 13, 0, 0, 0, - 0, 0, 5, 0, 0, 0, 0, 14, 4, 0, 10, 0, 5, 0, - 10, 0, 15, 0, 6, 10, 0, 2, 0, 0, 0, 0, 0, 0, - 12, 0, 2, 1, 0, 13, 0, 0, 0, 3, 23, 0, 11, 0, - 9, 8, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 17, 11, - 12, 12, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, - 0, 8, 13, 8, 14, 0, 0, 0, 3, 0, 0, 3, 0, 3, - 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 8, 0, 0, - 0, 0, 0, 0, 2, 0, 0, 0, 11, 0, 0, 0, 0, 9, - 17, 0, 0, 0, 0, 1, 0, 12, 8, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 21, - 0, 0, 13, 0, 0, 0, 5, 0, 13, 0, 0, 17, 0, 0, - 0, 6, 7, 0, 17, 10, 10, 0, 3, 8, 3, 0, 0, 0, - 0, 0, 6, 0, 8, 0, 12, 0, 0, 12, 0, 0, 0, 0, - 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, - 9, 0, 15, 15, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 9, 14, 0, 0, 11, 0, 0, 12, - 0, 0, 15, 8, 0, 0, 13, 0, 0, 25, 0, 10, 0, 0, - 0, 0, 0, 0, 2, 0, 14, 0, 0, 8, 0, 0, 15, 0, - 0, 0, 0, 0, 0, 0, 0, 4, 2, 0, 11, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, - 0, 13, 0, 0, 0, 0, 0, 0, 7, 12, 0, 0, 0, 0, - 0, 0, 0, 24, 13, 10, 0, 0, 0, 0, 26, 0, 0, 0, - 0, 13, 20, 0, 13, 0, 0, 0, 0, 22, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 11, 10, 0, 0, 15, 10, 0, - 0, 0, 6, 0, 16, 21, 0, 0, 0, 0, 0, 0, 13, 0, - 0, 0, 14, 14, 0, 0, 12, 0, 3, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 11, 0, 0, + 0, 0, 0, 0, 0, 1, 0, 1, 2, 2, 2, 3, 2, 2, + 0, 2, 0, 1, 0, 0, 0, 4, 3, 0, 0, 0, 0, 4, + 0, 5, 0, 0, 4, 0, 0, 0, 4, 0, 0, 0, 3, 0, + 0, 4, 5, 0, 0, 8, 0, 4, 0, 3, 6, 0, 6, 0, + 0, 0, 7, 3, 5, 5, 0, 0, 5, 0, 0, 0, 0, 4, + 7, 0, 0, 4, 9, 0, 9, 0, 0, 0, 6, 0, 9, 0, + 0, 0, 7, 6, 0, 5, 0, 0, 9, 4, 4, 6, 0, 0, + 5, 0, 0, 7, 10, 6, 7, 4, 6, 10, 10, 6, 0, 0, + 4, 8, 0, 9, 8, 0, 7, 10, 7, 0, 8, 4, 0, 0, + 10, 4, 5, 6, 3, 0, 0, 0, 0, 0, 0, 5, 5, 0, + 7, 7, 9, 5, 0, 0, 0, 0, 0, 6, 0, 5, 0, 8, + 3, 5, 0, 6, 2, 0, 0, 0, 2, 2, 0, 6, 0, 3, + 0, 3, 0, 0, 4, 8, 5, 0, 0, 7, 0, 0, 0, 5, + 0, 10, 0, 9, 9, 0, 6, 8, 7, 2, 7, 0, 7, 6, + 10, 0, 0, 0, 8, 0, 0, 0, 8, 0, 4, 1, 0, 0, + 0, 2, 6, 0, 8, 0, 0, 8, 0, 0, 0, 0, 0, 9, + 0, 0, 0, 0, 5, 8, 0, 0, 6, 0, 13, 10, 0, 8, + 0, 5, 0, 0, 6, 0, 5, 0, 0, 7, 14, 0, 0, 0, + 0, 7, 11, 10, 0, 7, 6, 0, 10, 10, 0, 8, 10, 0, + 0, 7, 0, 9, 0, 0, 10, 0, 0, 0, 8, 2, 5, 10, + 7, 2, 0, 5, 12, 0, 9, 8, 7, 0, 0, 0, 0, 9, + 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 10, 7, 0, + 8, 7, 0, 2, 8, 0, 0, 0, 6, 0, 10, 0, 0, 0, + 0, 11, 0, 0, 8, 0, 0, 0, 0, 9, 5, 3, 0, 0, + 0, 0, 11, 0, 0, 0, 11, 0, 0, 0, 0, 9, 0, 0, + 0, 2, 0, 0, 6, 2, 0, 0, 0, 0, 0, 0, 3, 0, + 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, + 10, 0, 0, 0, 0, 6, 0, 9, 0, 13, 0, 2, 0, 0, + 6, 0, 0, 0, 0, 0, 8, 9, 0, 0, 12, 9, 0, 0, + 13, 9, 11, 6, 5, 0, 5, 10, 0, 9, 8, 2, 7, 12, + 0, 2, 0, 11, 0, 0, 0, 11, 17, 3, 0, 0, 6, 13, + 0, 0, 0, 8, 9, 0, 12, 0, 5, 0, 0, 2, 0, 11, + 0, 0, 11, 2, 0, 13, 10, 0, 0, 2, 0, 6, 0, 6, + 0, 0, 3, 2, 0, 11, 3, 2, 0, 0, 10, 6, 0, 0, + 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 11, + 0, 0, 0, 0, 10, 14, 10, 0, 10, 0, 20, 0, 0, 0, + 0, 0, 14, 11, 0, 0, 16, 3, 3, 0, 4, 0, 3, 0, + 0, 13, 0, 0, 0, 1, 10, 17, 18, 12, 0, 3, 0, 0, + 0, 3, 0, 0, 0, 0, 0, 9, 0, 0, 12, 13, 0, 0, + 0, 0, 0, 15, 0, 11, 0, 0, 0, 0, 9, 0, 0, 17, + 0, 0, 0, 0, 0, 13, 0, 0, 10, 18, 8, 0, 0, 17, + 8, 0, 0, 13, 10, 13, 0, 0, 0, 8, 10, 0, 11, 0, + 0, 9, 0, 7, 0, 0, 11, 0, 0, 24, 10, 12, 13, 9, + 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 11, 0, 10, + 0, 0, 0, 0, 0, 0, 10, 8, 0, 0, 0, 10, 0, 0, + 0, 0, 15, 4, 0, 0, 9, 12, 0, 4, 0, 12, 14, 0, + 0, 8, 5, 10, 0, 0, 0, 0, 12, 0, 0, 9, 0, 0, + 13, 0, 0, 10, 0, 0, 19, 0, 0, 0, 0, 0, 8, 0, + 0, 0, 0, 0, 13, 0, 13, 0, 0, 0, 13, 0, 0, 10, + 0, 11, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 8, 0, + 13, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 12, 0, + 8, 0, 9, 0, 0, 0, 0, 0, 12, 0, 0, 20, 0, 0, + 23, 0, 0, 0, 8, 0, 0, 0, 0, 12, 10, 0, 0, 0, + 13, 0, 5, 0, 6, 0, 12, 0, 13, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 10, 15, 11, 15, 0, 0, 10, 0, 0, + 10, 0, 0, 15, 22, 0, 17, 0, 15, 0, 13, 0, 13, 0, + 0, 0, 21, 11, 2, 0, 0, 0, 2, 0, 0, 0, 0, 17, + 0, 0, 0, 0, 14, 15, 0, 0, 0, 0, 0, 0, 12, 0, + 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 13, 4, 0, 0, 13, 7, 10, 0, 0, 0, 20, 0, 0, + 0, 24, 9, 0, 0, 14, 2, 0, 0, 0, 0, 0, 0, 23, + 25, 11, 12, 15, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, + 0, 0, 6, 0, 0, 0, 9, 0, 0, 15, 0, 13, 0, 2, + 0, 0, 6, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, + 0, 19, 0, 10, 0, 0, 0, 1, 0, 0, 0, 18, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 12, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, + 12, 18, 0, 0, 15, 0, 0, 19, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, + 13, 0, 0, 0, 0, 0, 14, 0, 0, 0, 12, 0, 0, 0, + 0, 0, 0, 12, 0, 0, 0, 0, 13, 0, 0, 0, 13, 0, + 0, 0, 0, 0, 0, 11, 10, 0, 0, 9, 0, 12, 0, 0, + 0, 0, 0, 0, 15, 0, 8, 0, 0, 0, 0, 0, 19, 0, + 0, 0, 17, 6, 11, 0, 9, 14, 8, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 11, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, + 0, 3, 26, 0, 0, 0, 11, 0, 0, 0, 0, 0, 14, 0, + 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 13, 15, 0, 0, 0, 0, 0, 0, 0, 20, 14, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, + 9, 0, 0, 0, 0, 6, 0, 0, 0, 0, 17, 0, 0, 8, + 13, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 12, + 0, 11, 0, 0, 24, 0, 0, 0, 3, 0, 0, 0, 0, 0, + 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 31, 3, 0, 12, + 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 12, 0, 0, + 11, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, + 0, 0, 0, 9, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 18, 17, 0, 0, 0, 18, 0, 13, + 0, 6, 13, 14, 0, 0, 0, 0, 0, 0, 0, 0, 12, 11, + 0, 7, 0, 0, 13, 0, 18, 0, 14, 0, 30, 0, 16, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, + 17, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 14, 24, 0, 0, 23, 0, 0, 0, + 0, 0, 24, 0, 0, 32, 0, 0, 0, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 12, 0, 0, 0, 0, 21, 17, 0, 11, 0, + 0, 15, 0, 8, 12, 13, 15, 0, 0, 15, 0, 0, 0, 16, + 20, 9, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, + 0, 0, 0, 0, 23, 0, 13, 0, 11, 0, 23, 0, 0, 27, + 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 16, + 19, 2, 0, 0, 0, 0, 14, 0, 3, 0, 0, 0, 0, 0, + 23, 9, 0, 0, 0, 0, 15, 0, 0, 0, 0, 12, 0, 23, + 0, 37, 0, 13, 0, 0, 0, 16, 12, 0, 0, 0, 14, 0, + 0, 0, 0, 0, 25, 0, 0, 0, 15, 0, 0, 15, 0, 9, + 0, 0, 43, 0, 14, 23, 0, 14, 0, 0, 0, 0, 0, 19, + 0, 3, 0, 0, 10, 0, 0, 0, 0, 14, 0, 0, 24, 0, + 0, 0, 0, 21, 0, 0, 0, 21, 0, 0, 0, 18, 0, 0, + 19, 0, 0, 0, 0, 3, 3, 30, 0, 0, 23, 0, 0, 14, + 23, 0, 12, 24, 0, 0, 0, 8, 11, 0, 48, 0, 0, 0, + 13, 0, 20, 22, 0, 14, 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 11, 0, 0, 27, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 16, 19, 0, 27, 2, 0, 0, 0, 11, 14, 11, 0, 0, 0, + 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 19, 27, 14, 0, 0, 15, 15, 0, 0, 10, + 11, 14, 26, 0, 18, 17, 17, 0, 47, 12, 16, 12, 0, 0, + 14, 0, 12, 23, 0, 0, 0, 0, 0, 27, 0, 0, 0, 20, + 0, 0, 0, 22, 0, 0, 0, 14, 0, 0, 21, 0, 31, 0, + 0, 10, 0, 0, 21, 14, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 30, 0, 3, 0, 0, 0, 22, 0, 0, 0, + 15, 0, 0, 0, 23, 14, 0, 19, 0, 0, 0, 0, 9, 13, + 10, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 21, 13, 0, + 0, 21, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 27, + 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 13, 21, 20, + 0, 0, 0, 14, 0, 0, 14, 0, 0, 0, 32, 0, 0, 0, + 0, 0, 0, 16, 0, 0, 0, 0, 13, 0, 9, 0, 0, 14, + 0, 22, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, + 0, 14, 26, 0, 0, 0, 12, 0, 0, 27, 0, 0, 0, 0, + 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 15, + 0, 0, 19, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 19, + 13, 0, 0, 13, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, + 0, 25, 0, 0, 0, 17, 23, 26, 0, 0, 0, 0, 0, 25, + 0, 1, 0, 0, 0, 22, 0, 0, 15, 0, 0, 28, 0, 17, + 0, 0, 18, 15, 0, 0, 0, 16, 22, 0, 16, 0, 0, 0, + 15, 0, 15, 0, 0, 12, 0, 14, 0, 0, 18, 0, 0, 0, + 0, 0, 21, 0, 0, 6, 0, 0, 0, 0, 0, 0, 20, 13, + 0, 0, 0, 0, 12, 0, 0, 0, 19, 0, 0, 9, 19, 0, + 7, 21, 28, 0, 0, 12, 30, 0, 0, 0, 0, 10, 0, 0, + 0, 0, 16, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, + 0, 0, 28, 0, 0, 0, 0, 28, 0, 15, 31, 0, 0, 0, + 16, 0, 16, 10, 0, 0, 0, 25, 0, 11, 0, 0, 9, 19, + 24, 0, 17, 11, 0, 15, 0, 0, 0, 0, 0, 0, 13, 0, + 0, 0, 0, 0, 0, 0, 18, 0, 0, 25, 15, 0, 16, 0, + 0, 24, 0, 0, 0, 0, 0, 21, 16, 0, 0, 0, 35, 0, + 12, 0, 18, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 25, 0, 15, 26, 32, 22, 0, 0, 18, 0, 0, 24, 0, + 0, 23, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 13, + 0, 9, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 18, 0, 0, + 0, 0, 0, 0, 16, 16, 0, 0, 0, 0, 0, 0, 0, 16, + 16, 30, 26, 13, 19, 0, 18, 29, 0, 0, 0, 2, 0, 13, + 0, 0, 0, 0, 0, 9, 42, 0, 0, 13, 0, 16, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 27, 15, 21, + 0, 0, 0, 18, 0, 0, 13, 0, 0, 20, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 8, 0, 0, 14, 0, 25, 0, 0, 0, 0, 5, 6, + 0, 0, 0, 21, 0, 0, 0, 0, 22, 0, 15, 0, 0, 0, + 15, 0, 10, 0, 0, 0, 0, 37, 9, 0, 0, 0, 0, 0, + 34, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, + 0, 22, 0, 0, 0, 27, 0, 11, 20, 31, 0, 0, 0, 0, + 0, 0, 24, 14, 0, 0, 17, 0, 0, 0, 17, 12, 39, 0, + 0, 15, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, + 0, 0, 0, 17, 0, 17, 0, 0, 0, 0, 15, 18, 31, 0, + 0, 0, 38, 29, 0, 0, 0, 15, 0, 0, 18, 0, 0, 0, + 16, 19, 0, 0, 0, 27, 0, 39, 0, 0, 10, 23, 18, 0, + 15, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 28, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, + 14, 28, 0, 14, 0, 0, 0, 0, 0, 0, 22, 14, 0, 21, + 13, 0, 22, 0, 18, 15, 0, 23, 0, 17, 30, 0, 0, 10, + 0, 0, 0, 12, 0, 0, 0, 0, 40, 0, 14, 20, 0, 0, + 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 19, 0, 0, 0, + 0, 0, 0, 0, 15, 0, 0, 30, 22, 1, 11, 0, 0, 0, + 9, 0, 0, 0, 30, 0, 15, 0, 15, 0, 0, 3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 0, 0, 0, 0, + 14, 15, 0, 15, 0, 6, 0, 0, 0, 0, 0, 0, 0, 7, + 20, 0, 9, 0, 0, 32, 15, 35, 0, 9, 29, 0, 24, 0, + 0, 0, 0, 3, 0, 15, 0, 16, 0, 0, 0, 0, 0, 0, + 0, 14, 19, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 8, + 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 22, 0, 23, + 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 23, 0, 0, 0, + 0, 10, 0, 0, 0, 42, 0, 0, 0, 0, 7, 0, 0, 44, + 0, 0, 0, 0, 0, 0, 23, 0, 30, 0, 0, 0, 0, 16, + 13, 0, 7, 0, 25, 22, 24, 14, 16, 0, 0, 0, 0, 17, + 0, 0, 0, 16, 22, 0, 0, 30, 0, 0, 0, 0, 0, 28, + 0, 0, 0, 11, 0, 0, 0, 20, 0, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 12, 0, 14, 17, 0, 11, 0, 0, 16, 6, + 0, 0, 0, 0, 0, 17, 0, 13, 0, 0, 11, 0, 0, 0, + 22, 19, 0, 26, 0, 0, 0, 0, 0, 0, 24, 0, 0, 17, + 0, 0, 11, 0, 21, 0, 0, 20, 6, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 14, 11, 11, 0, 11, 0, 15, + 0, 0, 0, 20, 0, 31, 0, 15, 0, 16, 0, 0, 0, 0, + 0, 17, 0, 0, 21, 8, 0, 0, 0, 24, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 13, 0, 14, 0, 9, 0, 14, 0, + 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, + 11, 0, 12, 0, 0, 0, 4, 0, 0, 0, 0, 0, 31, 0, + 0, 20, 0, 0, 0, 0, 35, 13, 0, 23, 7, 0, 0, 0, + 0, 0, 0, 0, 25, 3, 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 7, 29, 0, 16, 0, 0, 11, 0, 15, 0, 0, + 0, 18, 27, 0, 0, 0, 2, 0, 0, 15, 35, 21, 0, 0, + 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, + 0, 15, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, + 25, 0, 24, 0, 24, 0, 18, 23, 24, 20, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 15, 11, 0, + 0, 0, 0, 25, 0, 25, 0, 0, 42, 0, 0, 0, 0, 32, + 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 18, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, + 0, 0, 20, 0, 0, 20, 23, 0, 22, 24, 0, 0, 0, 13, + 0, 0, 18, 0, 0, 0, 0, 34, 0, 13, 0, 31, 25, 0, + 34, 0, 20, 0, 0, 0, 0, 0, 14, 0, 0, 37, 0, 0, + 0, 0, 0, 0, 0, 0, 24, 0, 0, 26, 0, 23, 29, 0, + 0, 0, 0, 22, 0, 23, 0, 0, 0, 0, 26, 0, 0, 8, + 0, 0, 0, 0, 0, 0, 23, 2, 0, 0, 0, 0, 16, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 22, 0, 26, 12, 21, 0, 31, 0, 0, 27, 0, 0, 0, 24, + 0, 0, 0, 0, 25, 0, 0, 14, 0, 0, 22, 0, 0, 0, + 0, 0, 12, 10, 18, 0, 17, 21, 0, 0, 0, 0, 12, 9, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 18, + 0, 23, 0, 14, 0, 0, 0, 17, 17, 15, 0, 31, 27, 0, + 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 28, 36, + 0, 22, 10, 20, 20, 0, 0, 0, 17, 0, 0, 0, 23, 0, + 0, 22, 0, 0, 0, 0, 0, 8, 22, 29, 0, 0, 0, 0, + 10, 10, 10, 18, 0, 0, 0, 0, 14, 22, 29, 0, 0, 0, + 21, 0, 0, 0, 0, 18, 11, 10, 0, 0, 31, 0, 0, 0, + 30, 0, 0, 0, 0, 0, 0, 17, 0, 19, 0, 0, 44, 17, + 9, 9, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 39, 40, 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 21, 11, 0, 12, 0, 28, 0, 24, 0, 24, 12, + 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 13, 15, 23, + 0, 0, 26, 0, 0, 0, 22, 0, 0, 38, 0, 13, 22, 0, + 0, 0, 14, 18, 0, 0, 0, 0, 0, 0, 15, 0, 0, 25, + 0, 0, 0, 0, 10, 0, 18, 14, 0, 0, 16, 20, 19, 15, + 0, 21, 0, 0, 0, 0, 18, 0, 0, 15, 0, 0, 10, 0, + 31, 0, 34, 0, 0, 0, 0, 0, 28, 0, 0, 0, 13, 31, + 37, 13, 0, 0, 0, 0, 0, 0, 12, 13, 0, 0, 0, 19, + 21, 0, 0, 0, 0, 0, 0, 14, 3, 3, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 12, 0, 10, 15, 0, 0, 35, 0, 0, + 17, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 24, 0, 0, 0, 29, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 30, 0, 0, 20, 26, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 50, 23, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 10, 0, 10, 0, 18, 22, 0, + 25, 0, 12, 0, 23, 0, 0, 0, 0, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 19, 32, 0, 32, 0, 10, 0, 0, 0, 0, 14, 17, 0, 0, + 7, 0, 20, 0, 0, 24, 18, 0, 11, 8, 0, 19, 0, 0, + 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 29, 32, + 0, 0, 0, 30, 0, 0, 9, 15, 0, 16, 0, 0, 30, 0, + 0, 0, 0, 0, 19, 2, 0, 14, 0, 0, 0, 16, 40, 0, + 18, 0, 0, 28, 0, 20, 0, 0, 0, 10, 8, 10, 23, 0, + 25, 0, 0, 0, 0, 7, 2, 16, 0, 0, 2, 0, 0, 27, + 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, + 0, 0, 30, 17, 0, 0, 0, 0, 16, 0, 24, 27, 0, 16, + 11, 14, 0, 3, 0, 0, 0, 0, 0, 28, 0, 0, 0, 26, + 0, 0, 0, 34, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 30, 0, 0, 0, 0, 16, 0, 0, 30, 14, 0, 0, + 0, 24, 0, 0, 23, 0, 0, 0, 0, 16, 0, 0, 23, 0, + 0, 0, 14, 26, 0, 18, 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 26, 0, 0, 10, + 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, + 0, 0, 25, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 10, 0, + 0, 11, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 17, 0, 34, 0, 0, 0, 0, 0, 0, 0, 9, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, + 0, 0, 18, 28, 0, 0, 0, 22, 0, 0, 18, 0, 0, 0, + 0, 15, 0, 0, 0, 25, 0, 0, 0, 0, 0, 11, 0, 11, + 20, 0, 0, 18, 0, 0, 0, 0, 0, 0, 35, 0, 0, 32, + 11, 27, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 25, + 0, 0, 0, 0, 0, 9, 0, 11, 0, 0, 13, 15, 0, 0, + 0, 0, 0, 29, 0, 0, 22, 24, 0, 11, 0, 15, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, + 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 29, 17, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, + 24, 18, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 15, + 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, + 0, 38, 15, 0, 0, 0, 0, 0, 0, 11, 0, 0, 5, 0, + 12, 0, 0, 23, 0, 0, 0, 0, 0, 0, 31, 0, 0, 22, + 0, 24, 0, 0, 0, 21, 42, 29, 23, 12, 0, 15, 0, 0, + 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 10, 0, + 23, 0, 0, 0, 0, 0, 0, 16, 20, 0, 16, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 24, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 6, 0, 0, 0, 9, 11, 0, 0, 12, 0, 0, 0, 0, + 0, 0, 0, 0, 21, 0, 25, 0, 30, 0, 0, 0, 31, 15, + 0, 0, 0, 0, 35, 15, 0, 28, 0, 0, 0, 0, 0, 0, + 0, 12, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 20, 0, 24, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, - 0, 0, 0, 0, 0, 13, 12, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, - 0, 0, 8, 0, 0, 9, 0, 0, 0, 0, 0, 18, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 13, 12, 0, 0, 10, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 12, 0, 0, 0, 0, 15, 0, 0, 0, - 0, 0, 11, 3, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, - 0, 0, 0, 1, 0, 0, 0, 0, 5, 0, 0, 10, 0, 13, - 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 0, 0, 0, 0, 0, 0, 0, 12, 0, 9, 0, 18, 18, 0, - 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 9, 0, - 6, 0, 13, 0, 0, 10, 23, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, - 17, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, - 31, 0, 16, 0, 0, 0, 0, 0, 0, 0, 32, 13, 0, 0, - 0, 22, 0, 0, 0, 0, 0, 0, 15, 0, 0, 14, 0, 0, - 0, 13, 0, 0, 16, 0, 0, 0, 0, 0, 12, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, - 0, 13, 0, 31, 0, 0, 23, 0, 0, 0, 0, 0, 0, 11, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 27, 0, - 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 17, - 0, 0, 0, 2, 11, 0, 19, 14, 19, 0, 0, 0, 16, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 14, 0, 0, 17, 15, 0, 0, 0, 0, 9, 0, 0, 0, 37, - 0, 0, 0, 0, 15, 0, 0, 0, 11, 0, 15, 14, 0, 14, - 0, 0, 0, 0, 0, 20, 0, 0, 0, 11, 0, 0, 0, 0, - 0, 0, 0, 0, 30, 0, 17, 22, 2, 0, 2, 0, 0, 16, - 13, 14, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 9, - 0, 14, 0, 13, 12, 0, 0, 0, 0, 15, 14, 0, 0, 13, - 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 13, 0, 0, 0, - 0, 22, 0, 0, 11, 23, 0, 0, 10, 18, 0, 12, 0, 2, - 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 11, 0, 0, - 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 6, 21, 0, - 0, 0, 0, 0, 48, 0, 0, 9, 0, 0, 0, 23, 0, 0, - 12, 17, 17, 0, 0, 0, 0, 7, 2, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 12, 0, 0, 0, 14, 0, 0, 15, 0, 14, - 15, 0, 0, 0, 20, 19, 0, 0, 0, 0, 19, 18, 24, 0, - 16, 0, 0, 0, 0, 0, 25, 0, 0, 0, 10, 0, 12, 0, - 13, 0, 0, 0, 0, 0, 17, 0, 0, 23, 0, 9, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, - 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 18, 0, 17, 14, 0, 0, 11, 0, 0, 24, 11, 0, 18, 0, - 0, 15, 0, 22, 0, 0, 25, 27, 0, 0, 0, 0, 0, 0, - 0, 10, 0, 12, 0, 0, 0, 23, 0, 0, 14, 10, 12, 0, - 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 9, 27, 10, 0, - 0, 0, 0, 0, 12, 0, 0, 18, 0, 10, 0, 0, 0, 0, - 0, 13, 0, 10, 0, 0, 0, 0, 0, 0, 13, 27, 0, 23, - 0, 0, 0, 12, 14, 0, 0, 0, 0, 0, 0, 0, 17, 0, - 0, 14, 0, 6, 0, 13, 0, 20, 14, 0, 0, 0, 0, 0, - 0, 0, 21, 13, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, - 0, 0, 0, 6, 0, 0, 0, 0, 13, 0, 43, 0, 0, 0, - 15, 0, 30, 19, 26, 0, 0, 0, 0, 0, 0, 15, 0, 0, - 0, 0, 0, 0, 15, 0, 0, 0, 10, 0, 0, 19, 0, 0, - 0, 0, 24, 0, 0, 0, 0, 33, 22, 0, 0, 15, 0, 0, - 0, 0, 0, 0, 0, 47, 0, 0, 0, 15, 0, 0, 24, 22, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 15, 9, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 24, 25, 0, 0, 0, 0, - 11, 0, 0, 0, 31, 0, 0, 14, 0, 0, 0, 0, 0, 0, - 15, 0, 0, 0, 13, 0, 0, 23, 0, 11, 0, 26, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 15, 19, 12, 0, 0, 11, 26, 16, 17, 0, 0, - 39, 40, 0, 15, 0, 0, 14, 14, 0, 0, 19, 0, 0, 28, - 0, 16, 0, 19, 16, 0, 0, 0, 13, 0, 0, 0, 11, 0, - 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 21, 0, 12, 0, - 0, 0, 0, 0, 0, 11, 0, 20, 0, 0, 0, 19, 5, 21, - 0, 0, 0, 0, 17, 0, 0, 21, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 16, 23, 0, 0, 0, 0, 0, 13, 0, 15, - 0, 0, 15, 0, 21, 0, 22, 35, 0, 0, 0, 0, 29, 7, - 0, 0, 24, 0, 15, 0, 15, 0, 0, 0, 0, 0, 0, 18, - 0, 0, 0, 13, 0, 0, 11, 0, 0, 0, 0, 12, 0, 0, - 18, 32, 0, 0, 11, 14, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 30, 10, 0, 18, 0, 0, 0, 34, 0, 0, 0, 0, 42, - 15, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 14, 15, 0, - 0, 13, 0, 0, 0, 0, 10, 18, 0, 0, 0, 0, 0, 0, - 0, 9, 16, 23, 0, 0, 0, 0, 0, 17, 0, 0, 21, 0, - 17, 25, 0, 28, 0, 0, 0, 0, 9, 0, 0, 0, 14, 0, - 17, 0, 20, 0, 14, 16, 9, 0, 0, 0, 0, 0, 0, 0, - 0, 26, 3, 0, 0, 0, 0, 19, 11, 0, 0, 0, 27, 13, - 24, 0, 0, 20, 16, 0, 0, 0, 0, 6, 0, 0, 0, 0, - 37, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 13, 0, 0, 0, 13, 0, 0, 0, 0, - 0, 0, 0, 0, 9, 0, 0, 0, 0, 39, 0, 0, 0, 12, - 0, 0, 0, 0, 0, 18, 0, 0, 0, 21, 0, 32, 0, 0, - 0, 25, 0, 28, 0, 1, 0, 0, 0, 14, 20, 0, 8, 22, - 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 19, 13, 0, 18, - 18, 0, 3, 0, 0, 0, 0, 15, 0, 0, 23, 13, 0, 11, - 0, 30, 14, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 4, 0, 0, 0, - 0, 0, 14, 0, 0, 14, 0, 16, 18, 0, 0, 0, 21, 0, - 0, 0, 0, 0, 0, 0, 10, 26, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 12, 0, 27, 0, - 20, 0, 24, 31, 16, 0, 16, 0, 0, 0, 15, 0, 0, 15, - 0, 0, 0, 11, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, - 0, 0, 12, 0, 0, 0, 14, 9, 20, 0, 23, 0, 0, 0, - 24, 0, 12, 0, 13, 0, 0, 0, 0, 0, 24, 0, 13, 0, - 0, 0, 22, 9, 12, 0, 0, 0, 13, 0, 0, 0, 0, 0, - 11, 15, 0, 0, 0, 0, 0, 16, 0, 15, 0, 29, 0, 12, - 0, 0, 0, 0, 39, 0, 0, 11, 0, 0, 8, 18, 0, 0, - 19, 23, 0, 12, 0, 27, 0, 0, 0, 0, 0, 0, 42, 0, - 0, 1, 26, 0, 0, 19, 35, 17, 0, 0, 0, 17, 38, 16, - 0, 0, 14, 18, 0, 15, 0, 0, 0, 0, 0, 0, 0, 24, - 0, 9, 0, 13, 20, 14, 0, 0, 0, 0, 7, 0, 0, 0, - 0, 0, 12, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 35, 14, 0, 0, 18, 0, 0, 14, - 0, 23, 0, 0, 25, 0, 0, 20, 0, 12, 0, 0, 0, 0, - 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, - 0, 6, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, - 0, 22, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 18, 0, 0, 0, 3, 9, 0, 0, 0, 0, 0, - 0, 0, 0, 13, 0, 0, 0, 0, 28, 0, 0, 10, 0, 38, - 0, 0, 0, 0, 0, 2, 21, 16, 0, 0, 0, 0, 0, 16, - 0, 16, 0, 24, 0, 10, 0, 0, 11, 0, 0, 9, 0, 0, - 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 6, - 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 13, 0, 0, 0, 12, 23, 10, 0, 0, 0, 0, 10, 0, - 0, 10, 0, 16, 23, 0, 0, 0, 0, 0, 25, 0, 0, 0, - 8, 0, 16, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, - 0, 0, 11, 0, 0, 14, 7, 19, 0, 9, 0, 27, 0, 0, - 0, 0, 23, 0, 0, 0, 0, 21, 28, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 21, 25, 0, 15, 10, 8, 0, 0, 0, 15, - 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 9, - 0, 21, 0, 0, 0, 0, 0, 44, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 20, 0, 11, 0, 0, 0, 25, 25, 29, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 9, - 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 3, 0, 0, 0, - 0, 0, 18, 0, 0, 16, 0, 0, 0, 28, 0, 0, 0, 0, - 0, 0, 0, 0, 17, 0, 0, 0, 10, 0, 0, 0, 0, 0, - 0, 18, 0, 0, 0, 0, 10, 0, 12, 0, 0, 0, 0, 0, - 0, 0, 0, 15, 0, 0, 12, 0, 0, 17, 0, 0, 31, 21, - 0, 10, 0, 0, 0, 20, 10, 0, 14, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 6, 0, 0, 13, 0, 0, 10, 0, 0, 0, - 0, 18, 20, 0, 0, 0, 0, 0, 0, 20, 4, 0, 0, 0, - 11, 0, 0, 0, 0, 0, 16, 0, 0, 24, 0, 0, 15, 0, - 0, 0, 14, 0, 0, 0, 0, 0, 20, 0, 0, 0, 26, 0, - 0, 0, 0, 16, 13, 0, 7, 21, 0, 15, 10, 31, 0, 3, - 0, 7, 0, 0, 0, 0, 0, 13, 8, 0, 0, 0, 21, 0, - 0, 22, 0, 0, 0, 0, 27, 13, 0, 0, 0, 0, 0, 0, - 15, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, - 22, 14, 0, 18, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 37, 31, 29, 0, 0, 0, 3, 0, 0, - 0, 0, 0, 6, 16, 0, 22, 12, 0, 19, 0, 0, 0, 0, - 0, 0, 0, 23, 0, 0, 0, 13, 0, 22, 0, 0, 0, 13, - 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 35, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 16, 24, 0, 0, 0, 0, 15, - 0, 0, 0, 12, 22, 18, 0, 15, 0, 0, 0, 0, 0, 15, - 22, 0, 0, 0, 0, 0, 0, 0, 9, 0, 10, 19, 0, 0, - 31, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 18, 0, - 0, 23, 0, 0, 0, 30, 0, 0, 0, 0, 31, 0, 0, 22, - 0, 0, 0, 42, 0, 0, 30, 0, 0, 0, 22, 0, 0, 0, - 0, 10, 0, 10, 0, 0, 0, 0, 0, 0, 17, 0, 22, 0, - 0, 0, 0, 29, 0, 0, 0, 14, 0, 0, 0, 20, 0, 0, - 0, 26, 0, 25, 0, 0, 0, 25, 0, 0, 18, 0, 16, 0, - 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 14, 30, 0, 0, - 24, 14, 18, 0, 0, 12, 0, 0, 28, 0, 24, 0, 0, 0, - 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 19, 17, 10, 0, 0, 0, 2, 22, 0, 0, 0, - 0, 0, 23, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, - 16, 11, 0, 8, 15, 15, 0, 27, 0, 0, 18, 21, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 14, 0, - 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 15, 0, 0, 0, 16, 0, 0, 0, 44, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 24, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 34, 0, 11, 0, 0, 0, 3, - 0, 0, 0, 40, 0, 0, 0, 0, 0, 0, 28, 24, 0, 0, - 28, 0, 11, 11, 28, 11, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 13, 11, 0, 0, 0, 0, 0, 15, 0, 0, 16, 0, - 0, 0, 0, 17, 0, 0, 16, 10, 0, 0, 0, 14, 15, 0, + 0, 0, 17, 0, 0, 11, 73, 74, 0, 0, 0, 0, 0, 0, + 0, 0, 9, 0, 0, 24, 0, 0, 0, 14, 0, 0, 0, 16, + 30, 0, 30, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, + 19, 0, 20, 0, 20, 0, 28, 0, 0, 19, 0, 0, 0, 0, + 0, 20, 0, 0, 0, 26, 39, 37, 0, 0, 0, 0, 0, 0, + 0, 33, 13, 0, 0, 0, 0, 18, 0, 32, 0, 0, 0, 0, + 28, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 30, 0, 29, 29, 0, 0, 0, + 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, + 34, 2, 23, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 18, + 0, 0, 18, 0, 0, 0, 0, 13, 26, 0, 22, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 23, + 0, 0, 13, 0, 26, 0, 0, 0, 12, 13, 0, 0, 0, 0, + 0, 0, 0, 13, 0, 16, 0, 0, 21, 26, 10, 0, 0, 0, + 0, 12, 25, 0, 17, 0, 35, 27, 0, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 13, 12, 0, 0, 0, 0, 17, 0, 0, 15, + 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 25, + 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 8, + 0, 0, 0, 0, 0, 4, 0, 0, 0, 19, 0, 0, 0, 0, + 0, 6, 0, 3, 0, 0, 28, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, + 17, 0, 0, 0, 0, 0, 0, 13, 0, 30, 0, 0, 0, 27, + 29, 4, 0, 0, 0, 0, 6, 0, 0, 0, 0, 33, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 9, 0, 0, 0, 0, 0, 24, 0, 11, 13, + 23, 0, 28, 0, 0, 22, 0, 0, 0, 9, 29, 0, 32, 0, + 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 32, 6, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, + 0, 0, 0, 18, 0, 33, 0, 0, 0, 0, 13, 0, 0, 15, + 0, 0, 42, 0, 0, 2, 0, 17, 0, 0, 0, 0, 0, 0, + 34, 0, 0, 9, 0, 0, 0, 0, 26, 19, 0, 0, 0, 26, + 34, 19, 0, 34, 11, 16, 0, 33, 0, 0, 0, 0, 0, 15, + 0, 31, 0, 0, 0, 0, 0, 0, 0, 15, 16, 0, 0, 0, + 25, 0, 3, 0, 11, 0, 0, 20, 0, 0, 11, 0, 4, 0, + 0, 0, 0, 6, 11, 3, 0, 0, 0, 0, 0, 19, 0, 25, + 24, 4, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, + 23, 0, 0, 0, 30, 0, 16, 0, 31, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 13, 0, 0, 26, 3, 0, 0, 0, 0, + 15, 0, 13, 0, 0, 0, 15, 15, 0, 29, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 28, 0, 25, 0, + 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, + 0, 14, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 18, + 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, + 30, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 11, + 0, 0, 0, 0, 0, 7, 31, 0, 0, 0, 24, 0, 0, 18, + 0, 0, 0, 0, 0, 34, 0, 0, 0, 27, 15, 31, 27, 0, + 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 8, 0, 23, 16, 14, 0, 0, 0, 31, 0, 29, + 28, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, + 0, 0, 0, 15, 0, 0, 12, 0, 0, 0, 0, 22, 0, 0, + 16, 0, 18, 43, 0, 0, 0, 22, 0, 0, 0, 0, 0, 12, + 16, 0, 13, 0, 0, 0, 24, 1, 0, 26, 28, 0, 25, 0, + 0, 0, 0, 0, 2, 13, 0, 0, 0, 0, 24, 0, 13, 0, + 14, 0, 0, 0, 0, 8, 0, 0, 0, 16, 0, 0, 33, 0, + 0, 0, 23, 0, 0, 0, 0, 3, 0, 31, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 19, 0, 22, 21, 14, 0, 34, 0, 0, + 0, 0, 6, 0, 0, 0, 0, 31, 18, 0, 0, 0, 0, 2, + 0, 0, 0, 0, 29, 15, 0, 28, 0, 0, 0, 0, 21, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 11, + 6, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 12, 0, 14, + 13, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 14, 14, 0, + 0, 0, 14, 0, 0, 0, 0, 30, 0, 0, 0, 8, 2, 0, + 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 19, 0, 6, 0, + 0, 30, 0, 0, 27, 11, 22, 14, 0, 21, 0, 0, 11, 0, + 0, 0, 0, 13, 0, 0, 14, 22, 0, 0, 0, 0, 0, 22, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 35, + 0, 9, 0, 0, 0, 0, 4, 0, 0, 28, 0, 0, 15, 0, + 0, 14, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 27, 0, + 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 25, + 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, + 15, 0, 15, 0, 0, 0, 0, 0, 14, 9, 0, 37, 0, 0, + 0, 17, 0, 0, 28, 0, 0, 8, 0, 0, 0, 0, 13, 0, + 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 13, 0, 0, 0, 0, 43, 0, 3, 0, 0, 0, 0, 0, + 0, 27, 0, 0, 4, 0, 0, 19, 0, 6, 0, 3, 0, 0, + 0, 0, 19, 2, 0, 0, 0, 4, 0, 0, 27, 15, 0, 0, + 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, + 0, 7, 0, 0, 0, 0, 0, 28, 10, 0, 0, 0, 0, 0, + 0, 12, 0, 0, 0, 0, 15, 0, 36, 35, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 15, 12, 0, 0, 0, 0, 11, + 0, 0, 0, 0, 0, 28, 0, 28, 22, 0, 0, 0, 0, 23, + 11, 0, 0, 0, 0, 21, 16, 17, 0, 0, 0, 0, 0, 19, + 15, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, 21, 0, + 0, 0, 10, 7, 0, 0, 23, 0, 19, 0, 0, 0, 0, 0, + 0, 0, 0, 8, 34, 0, 22, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 6, 0, + 0, 0, 0, 26, 0, 0, 0, 0, 16, 0, 0, 22, 0, 0, + 6, 0, 0, 11, 17, 0, 0, 0, 0, 0, 17, 12, 0, 0, + 0, 0, 0, 13, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, + 18, 0, 6, 0, 0, 0, 15, 14, 0, 0, 33, 16, 33, 13, + 11, 0, 0, 0, 0, 14, 0, 0, 0, 0, 29, 21, 10, 12, + 14, 15, 12, 38, 0, 0, 20, 0, 0, 0, 18, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, - 0, 0, 9, 20, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, - 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, - 0, 0, 25, 0, 0, 0, 20, 0, 0, 22, 0, 50, 10, 0, - 0, 0, 0, 19, 7, 0, 0, 11, 28, 11, 0, 0, 0, 0, - 0, 0, 0, 0, 18, 0, 0, 21, 0, 0, 21, 28, 0, 0, - 22, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, - 0, 12, 42, 0, 0, 0, 16, 15, 0, 0, 35, 15, 0, 0, - 0, 13, 0, 0, 0, 38, 0, 0, 0, 0, 24, 0, 0, 0, - 0, 0, 0, 0, 0, 28, 23, 0, 33, 0, 0, 0, 0, 26, - 12, 21, 0, 0, 12, 23, 25, 0, 0, 0, 13, 29, 8, 23, - 0, 0, 0, 0, 0, 0, 0, 18, 11, 0, 0, 0, 0, 0, - 0, 30, 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, - 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 18, 0, - 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, - 0, 0, 29, 0, 29, 0, 0, 19, 0, 0, 0, 0, 17, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 33, 0, - 0, 0, 0, 31, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, - 12, 0, 0, 30, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, - 0, 27, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 24, - 0, 0, 0, 30, 0, 0, 0, 0, 13, 40, 0, 0, 0, 0, - 24, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, - 0, 22, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 29, - 17, 0, 4, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, - 0, 27, 17, 0, 23, 0, 0, 0, 22, 0, 0, 0, 0, 10, - 19, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 17, 0, - 0, 22, 0, 0, 0, 15, 8, 0, 0, 0, 12, 0, 17, 11, - 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 32, - 18, 0, 0, 0, 0, 32, 0, 0, 18, 0, 0, 0, 0, 0, - 3, 0, 42, 0, 23, 0, 0, 0, 0, 0, 0, 16, 0, 0, - 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 20, 18, - 0, 0, 23, 0, 20, 0, 0, 0, 0, 0, 30, 29, 0, 0, - 0, 10, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 27, - 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 22, 36, 9, - 24, 0, 0, 0, 0, 35, 0, 0, 0, 2, 0, 0, 0, 0, - 18, 0, 0, 0, 0, 0, 0, 22, 26, 0, 0, 0, 0, 0, - 0, 0, 31, 14, 0, 0, 0, 0, 17, 0, 14, 0, 18, 0, - 4, 0, 0, 13, 3, 19, 27, 0, 14, 0, 10, 0, 22, 0, - 0, 0, 11, 22, 0, 23, 12, 0, 22, 0, 0, 0, 0, 0, - 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 29, 29, - 0, 0, 16, 0, 0, 0, 0, 0, 11, 0, 0, 0, 21, 0, - 0, 0, 13, 0, 0, 23, 20, 0, 18, 0, 0, 0, 0, 13, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, - 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 15, 0, 0, 0, 2, 0, 28, 0, 0, 0, 0, 22, 0, - 0, 0, 0, 15, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 7, 0, 21, 37, 25, 0, 26, 14, - 0, 0, 14, 9, 0, 16, 0, 0, 33, 0, 29, 0, 0, 14, - 13, 0, 0, 24, 0, 0, 14, 0, 0, 0, 9, 0, 31, 0, - 0, 0, 0, 0, 11, 0, 11, 0, 0, 3, 0, 0, 0, 0, - 0, 14, 0, 0, 0, 14, 18, 0, 0, 0, 0, 0, 0, 26, - 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, - 0, 0, 0, 0, 0, 17, 0, 33, 20, 0, 30, 19, 0, 0, - 34, 23, 21, 15, 0, 12, 0, 0, 0, 0, 16, 28, 0, 0, - 0, 0, 23, 0, 0, 0, 0, 32, 0, 0, 0, 25, 0, 0, - 0, 19, 29, 0, 0, 0, 0, 26, 17, 34, 24, 0, 0, 33, - 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 24, 0, 0, - 15, 0, 0, 0, 0, 14, 0, 0, 27, 0, 0, 0, 0, 0, - 0, 0, 11, 0, 0, 0, 0, 9, 0, 0, 24, 0, 0, 0, - 0, 22, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, - 28, 0, 0, 0, 0, 0, 0, 0, 11, 0, 15, 0, 0, 0, - 8, 30, 0, 0, 0, 0, 0, 17, 0, 31, 3, 0, 0, 0, - 6, 0, 23, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, - 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 26, 9, 24, 0, - 0, 0, 0, 0, 0, 0, 17, 14, 0, 18, 0, 0, 0, 35, - 23, 0, 3, 0, 0, 0, 15, 31, 0, 0, 0, 0, 30, 0, - 28, 0, 23, 0, 6, 0, 0, 0, 20, 2, 0, 0, 8, 0, - 0, 0, 11, 0, 19, 0, 0, 0, 0, 0, 11, 0, 0, 24, - 0, 11, 24, 0, 0, 0, 14, 13, 20, 31, 0, 24, 26, 0, - 0, 0, 26, 0, 0, 0, 17, 0, 0, 0, 20, 0, 6, 0, - 0, 0, 0, 8, 0, 18, 11, 0, 25, 0, 0, 25, 0, 9, - 0, 30, 13, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, - 9, 0, 0, 13, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, - 0, 25, 9, 16, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 21, 0, 17, 0, 0, 0, 30, 0, 16, - 11, 0, 0, 24, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 19, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 19, 0, 0, 0, 15, 0, 0, 12, 0, 0, - 0, 0, 22, 34, 0, 26, 0, 0, 34, 0, 0, 0, 12, 0, - 0, 0, 0, 0, 21, 0, 0, 0, 14, 0, 0, 0, 11, 0, - 0, 0, 0, 0, 12, 19, 0, 0, 0, 0, 0, 11, 0, 16, - 0, 28, 0, 25, 0, 15, 0, 16, 0, 30, 0, 0, 26, 0, - 8, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 30, 0, - 13, 14, 0, 0, 35, 0, 15, 11, 0, 16, 0, 0, 20, 0, - 0, 0, 0, 32, 0, 2, 0, 29, 11, 0, 0, 0, 23, 0, - 0, 0, 0, 13, 0, 0, 20, 0, 23, 0, 31, 0, 0, 0, - 34, 0, 0, 0, 13, 0, 0, 19, 0, 0, 0, 13, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 12, 0, 0, 0, - 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, - 4, 0, 7, 0, 0, 25, 15, 0, 0, 22, 0, 0, 0, 3, - 24, 4, 6, 0, 0, 0, 30, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 0, 24, 0, 30, 0, 0, 0, 6, 0, 0, 0, 0, - 12, 14, 0, 37, 0, 0, 0, 0, 0, 0, 0, 13, 0, 12, - 0, 15, 10, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 21, 0, 29, 0, 0, 25, 0, - 15, 12, 0, 0, 23, 0, 6, 0, 0, 18, 0, 0, 0, 0, - 0, 0, 15, 15, 0, 6, 0, 0, 0, 0, 0, 0, 0, 29, - 0, 0, 2, 13, 0, 15, 22, 0, 0, 0, 0, 0, 0, 0, - 28, 2, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, - 0, 0, 19, 0, 0, 0, 0, 12, 0, 6, 0, 0, 0, 0, - 0, 9, 0, 22, 0, 0, 12, 0, 31, 0, 18, 0, 0, 0, - 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 15, 0, 0, 9, 0, 0, 8, 15, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, - 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 32, 0, 0, 15, 0, 0, 34, 0, 0, 0, 0, - 0, 0, 0, 16, 8, 26, 0, 0, 0, 0, 0, 32, 0, 0, - 0, 0, 0, 16, 0, 2, 11, 11, 22, 0, 0, 0, 29, 41, - 0, 0, 0, 0, 0, 0, 7, 17, 0, 31, 0, 0, 15, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, - 0, 0, 0, 14, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 14, 0, 0, 15, 17, 0, 0, 0, 0, - 21, 22, 0, 0, 0, 25, 29, 0, 15, 13, 0, 2, 0, 0, - 0, 15, 25, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, - 24, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 28, 0, 0, - 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 16, 0, 0, 23, - 0, 0, 0, 0, 0, 0, 0, 0, 6, 16, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, - 3, 0, 4, 0, 8, 0, 0, 0, 39, 0, 0, 0, 16, 0, - 0, 3, 0, 4, 6, 0, 0, 0, 30, 12, 0, 0, 0, 29, - 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 26, 0, 0, 42, 0, 0, 0, 0, 22, 0, 19, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 37, 14, - 0, 0, 0, 2, 9, 0, 0, 0, 13, 0, 0, 30, 13, 0, - 11, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 12, 0, 0, 0, 14, 0, 0, 0, 0, 14, 22, 0, 0, - 0, 0, 0, 20, 0, 14, 24, 0, 10, 0, 0, 0, 0, 0, - 17, 21, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 12, 11, 73, 74, 0, 0, 0, 0, 17, 0, 0, 0, 0, - 0, 0, 18, 25, 0, 0, 0, 0, 0, 0, 38, 0, 19, 0, - 0, 0, 0, 0, 0, 13, 16, 0, 19, 0, 0, 0, 0, 0, - 0, 0, 32, 0, 0, 35, 0, 0, 14, 0, 0, 0, 0, 0, - 0, 0, 7, 0, 0, 0, 33, 0, 0, 22, 0, 0, 0, 0, - 0, 0, 0, 25, 0, 28, 0, 0, 28, 0, 0, 0, 0, 0, - 0, 15, 0, 0, 0, 0, 7, 37, 12, 0, 0, 0, 8, 15, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 32, 11, 0, 0, - 0, 0, 0, 0, 0, 0, 19, 0, 0, 14, 0, 0, 41, 0, - 26, 0, 0, 0, 31, 34, 0, 0, 18, 0, 0, 0, 23, 14, - 18, 0, 0, 0, 19, 0, 0, 0, 0, 0, 25, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, - 0, 19, 0, 0, 0, 0, 2, 0, 0, 0, 13, 15, 8, 0, - 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 27, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 21, 0, 0, 0, 0, 24, 0, 0, 0, 3, 0, - 0, 13, 15, 0, 4, 0, 15, 0, 0, 0, 0, 32, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 30, - 13, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 11, 0, 12, - 0, 0, 0, 13, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 14, 14, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, - 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 14, 16, 0, - 0, 0, 29, 0, 23, 12, 0, 0, 0, 0, 0, 0, 0, 27, - 0, 0, 0, 0, 19, 0, 0, 34, 16, 0, 0, 0, 34, 43, - 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 30, 0, 0, - 0, 0, 27, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 19, 0, 12, 10, 0, 4, 0, 0, 18, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 24, 0, 0, - 0, 0, 0, 0, 23, 0, 0, 35, 0, 0, 0, 15, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 18, 0, - 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, - 15, 15, 0, 0, 0, 14, 0, 0, 0, 0, 0, 4, 23, 0, - 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, - 0, 0, 0, 14, 0, 0, 0, 0, 27, 0, 0, 0, 35, 0, - 30, 21, 0, 0, 18, 0, 0, 0, 12, 0, 0, 18, 0, 14, - 28, 25, 14, 0, 0, 0, 0, 0, 19, 0, 0, 24, 13, 0, - 0, 0, 0, 0, 0, 6, 0, 0, 15, 0, 0, 0, 0, 0, - 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 19, 0, 16, 0, 0, 0, 22, 0, - 0, 23, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, - 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, - 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 34, 15, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, + 0, 21, 0, 0, 0, 0, 0, 0, 16, 0, 0, 13, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, + 0, 0, 20, 0, 14, 0, 0, 0, 0, 32, 32, 24, 0, 0, + 15, 37, 0, 14, 15, 0, 0, 0, 0, 0, 0, 18, 0, 18, + 37, 19, 0, 0, 0, 0, 11, 0, 0, 0, 15, 38, 0, 0, + 18, 0, 0, 15, 14, 27, 32, 0, 0, 32, 0, 0, 0, 0, + 0, 0, 0, 23, 17, 15, 0, 0, 15, 0, 0, 0, 29, 0, + 31, 28, 21, 0, 16, 0, 0, 0, 0, 0, 0, 0, 19, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 15, 18, 24, 0, 0, 0, + 14, 0, 0, 0, 10, 0, 0, 0, 14, 0, 14, 0, 22, 0, + 0, 7, 0, 0, 2, 0, 28, 2, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, + 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, + 0, 3, 0, 0, 25, 24, 0, 0, 0, 14, 0, 0, 0, 15, + 0, 0, 0, 24, 0, 0, 15, 0, 17, 0, 0, 0, 0, 0, + 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, + 36, 0, 43, 0, 0, 0, 6, 0, 0, 16, 0, 0, 0, 0, + 0, 0, 0, 0, 8, 0, 24, 0, 0, 0, 0, 14, 0, 0, + 24, 0, 0, 0, 22, 0, 0, 0, 0, 0, 22, 0, 0, 25, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, + 0, 28, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 30, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, + 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 18, 0, 0, 14, 0, 0, 0, 0, 2, 18, 0, 0, 0, + 0, 0, 15, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, + 31, 0, 15, 0, 0, 0, 0, 0, 0, 0, 15, 27, 0, 14, + 0, 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, + 0, 8, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 15, 0, 17, 19, 0, 22, 0, 0, 0, 0, 0, + 18, 22, 20, 0, 0, 16, 0, 0, 0, 0, 29, 0, 18, 0, + 30, 0, 0, 0, 22, 19, 14, 0, 0, 0, 24, 0, 0, 0, + 24, 0, 28, 27, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, + 19, 0, 0, 0, 0, 23, 0, 0, 30, 14, 0, 37, 34, 0, + 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 19, 0, 0, 0, 0, 0, 0, 0, 27, 18, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 29, 15, 18, 0, 0, 0, + 0, 29, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, + 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 6, 21, 0, 0, 24, 30, 0, 31, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 29, + 0, 0, 0, 25, 0, 43, 22, 0, 15, 15, 0, 19, 18, 0, + 0, 0, 0, 0, 0, 17, 29, 0, 0, 0, 17, 0, 0, 0, + 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, + 15, 0, 0, 0, 0, 14, 0, 24, 0, 0, 0, 0, 0, 23, + 0, 28, 0, 0, 35, 0, 0, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 32, 0, 0, 0, 16, 0, 0, 19, 0, 0, 0, 0, 0, 0, + 0, 0, 28, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, + 30, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, + 0, 14, 36, 3, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 18, 15, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, + 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, + 0, 0, 0, 0, 24, 0, 0, 0, 34, 0, 0, 0, 0, 0, + 0, 0, 0, 7, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, + 11, 0, 29, 5, 12, 23, 0, 0, 23, 0, 25, 0, 0, 26, + 26, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, + 0, 0, 0, 35, 19, 0, 0, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 0, 14, 17, 0, 0, 0, 13, 0, 0, 0, 0, 0, + 0, 9, 0, 0, 14, 25, 0, 0, 0, 0, 0, 0, 0, 0, + 28, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 30, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 22, 18, 0, 0, + 0, 0, 0, 0, 23, 0, 0, 0, 11, 0, 11, 0, 0, 0, + 0, 18, 0, 0, 0, 14, 0, 0, 14, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 11, 18, 0, 0, 0, 36, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, + 0, 31, 0, 0, 0, 35, 0, 0, 0, 0, 19, 0, 0, 0, + 0, 0, 0, 0, 32, 0, 0, 10, 0, 21, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 9, 29, 0, 0, 0, 0, 0, + 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 20, 14, 0, 19, 0, 0, 0, 0, 0, 0, 16, + 27, 12, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 18, + 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 21, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 2, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, + 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, + 0, 3, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 10, + 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, + 0, 14, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, + 0, 0, 0, 21, 0, 15, 0, 18, 0, 20, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 31, 0, 15, 0, 14, 0, 0, 0, 0, 0, 28, - 18, 0, 13, 0, 0, 14, 0, 0, 18, 0, 0, 0, 0, 15, - 0, 21, 0, 10, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, - 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 14, - 0, 0, 0, 0, 14, 0, 0, 0, 0, 17, 0, 18, 23, 10, - 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 28, 8, 0, 0, 17, 15, - 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 22, 0, 0, - 0, 0, 29, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 14, 16, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 24, 24, - 0, 6, 0, 16, 0, 0, 0, 17, 0, 0, 0, 27, 0, 0, - 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, - 24, 19, 0, 13, 18, 0, 0, 15, 15, 0, 0, 0, 0, 0, - 14, 0, 0, 0, 0, 0, 0, 14, 15, 0, 0, 17, 0, 0, - 0, 18, 0, 0, 0, 22, 0, 0, 23, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, - 0, 30, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 16, - 0, 0, 0, 25, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 28, 0, 0, 23, - 0, 15, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, - 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 22, 0, 17, 0, 0, 0, 0, 0, 0, - 0, 10, 37, 34, 0, 0, 0, 0, 0, 0, 17, 0, 0, 26, - 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 25, 0, 0, 0, 11, 27, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 24, 0, 28, 0, 22, 0, 0, 0, 0, 23, 0, 0, 0, - 0, 0, 14, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 10, - 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, - 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 17, 0, 0, 0, 0, 31, 0, 0, 0, 28, - 0, 0, 0, 0, 0, 0, 14, 16, 0, 0, 0, 0, 23, 0, - 0, 0, 11, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 15, 0, 0, 22, 37, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 9, 0, 0, 14, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, - 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 15, 0, 0, 11, - 0, 11, 18, 0, 0, 0, 0, 0, 0, 21, 0, 17, 0, 0, - 0, 10, 0, 0, 0, 0, 12, 0, 0, 34, 0, 0, 0, 19, - 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 18, 0, - 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 31, 0, 22, 0, 0, 0, 0, 0, 0, 39, 0, 0, 30, 0, - 0, 0, 38, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 36, - 0, 28, 0, 8, 0, 16, 21, 0, 0, 0, 0, 0, 11, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 16, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 43, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 18, 0, 0, 0, 0, 0, 22, 0, 6, 0, 0, - 18, 23, 0, 0, 0, 18, 0, 18, 0, 0, 0, 18, 0, 21, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 18, - 0, 28, 15, 0, 19, 0, 0, 0, 0, 19, 0, 0, 0, 0, - 0, 0, 0, 33, 0, 0, 0, 0, 0, 18, 31, 0, 0, 0, - 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, - 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 27, 14, 0, - 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, - 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 24, 10, 0, 0, 0, 0, 18, 0, 0, 15, 0, 0, 9, 0, - 0, 0, 0, 8, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, - 0, 0, 24, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, - 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 36, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, - 27, 0, 0, 0, 0, 0, 18, 15, 0, 0, 0, 26, 0, 0, - 0, 7, 0, 21, 0, 0, 30, 0, 0, 25, 11, 0, 0, 25, - 0, 0, 24, 0, 0, 0, 0, 0, 0, 19, 0, 15, 0, 0, - 0, 22, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, - 14, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, - 0, 28, 0, 0, 0, 23, 0, 0, 0, 24, 0, 0, 0, 15, - 17, 0, 0, 0, 12, 29, 0, 0, 0, 0, 0, 0, 0, 0, - 14, 17, 0, 36, 0, 0, 0, 27, 0, 0, 0, 0, 29, 0, - 0, 0, 0, 29, 12, 31, 0, 0, 0, 0, 0, 0, 0, 0, - 30, 0, 0, 0, 0, 0, 0, 11, 0, 3, 0, 0, 0, 0, - 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, - 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 32, 0, 28, - 0, 0, 0, 0, 0, 0, 21, 14, 0, 10, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 31, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 18, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 21, 0, 14, 0, 0, 0, 0, 20, 0, 23, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, - 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 21, 0, 0, 0, 0, 0, 0, 0, 0, 21, 16, 0, 0, 0, - 14, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 32, 0, - 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 9, 0, 0, 0, 20, 0, 0, 0, 15, 0, 0, 0, 0, 0, - 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, - 0, 0, 0, 13, 31, 0, 0, 21, 0, 10, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 25, 13, - 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 11, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, - 0, 35, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 24, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 17, 29, 0, 0, 16, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 31, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 6, 0, 30, 0, 0, 11, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 20, - 14, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 0, 0, 24, 0, - 0, 0, 28, 0, 0, 15, 29, 0, 0, 0, 0, 0, 19, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, - 0, 0, 0, 23, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 32, 0, 0, 0, + 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 31, 41, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 25, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 72, 16, 0, 0, 0, 0, 29, 0, 0, 35, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 25, 0, 0, 18, 16, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, + 0, 26, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 30, 0, 0, 0, 0, 30, 0, 34, 0, 0, 0, 0, + 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, + 0, 0, 0, 0, 31, 0, 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 2, 0, 0, 0, 11, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 16, 10, 0, + 0, 0, 0, 0, 16, 15, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, + 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 19, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 39, 0, 15, 0, 0, 0, 0, + 20, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 14, + 0, 0, 0, 17, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 28, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 24, 0, + 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 17, 0, 0, + 0, 0, 0, 25, 0, 9, 0, 21, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 14, + 27, 15, 6, 22, 0, 0, 33, 0, 0, 0, 37, 0, 0, 0, + 0, 0, 14, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 28, 7, 24, 0, 0, 0, 22, 0, 0, 0, + 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, + 17, 25, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, + 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 25, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 37, + 0, 0, 0, 0, 0, 0, 13, 0, 20, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 16, 0, 0, 24, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 26, 20, 25, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 11, 0, 0, 27, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 36, 0, 0, 0, 35, 14, 0, 0, 7, 0, 0, + 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 19, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 72, 7, 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, - 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, + 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 18, 0, 15, 0, - 16, 0, 32, 0, 5, 0, 0, 0, 0, 0, 0, 0, 36, 0, + 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, + 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 11, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 28, 0, 0, 0, 0, 4, 9, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 17, + 0, 0, 0, 0, 0, 25, 27, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 0, 0, 33, 0, 33, 0, 0, 0, 37, 0, + 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, + 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, + 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, - 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, - 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, + 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, + 0, 10, 0, 0, 0, 25, 0, 0, 0, 0, 0, 9, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 13, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, + 0, 29, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, + 0, 0, 0, 15, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, + 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 24, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 17, 0, 28, + 0, 38, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 16, 0, 0, 0, 0, 0, 17, 0, 17, 0, 0, + 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 33, 0, 0, 0, 37, 0, 0, 37, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 20, + 17, 0, 0, 0, 0, 31, 0, 0, 25, 0, 0, 0, 0, 0, + 0, 0, 0, 15, 0, 0, 0, 0, 0, 20, 0, 15, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, + 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, + 0, 0, 0, 4, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, + 0, 0, 0, 0, 11, 0, 0, 0, 0, 24, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 25, 0, 22, 0, 0, 0, 16, + 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, + 0, 0, 28, 0, 0, 0, 0, 15, 0, 0, 29, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 35, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 27, 0, 24, 0, 0, 0, 0, 0, 0, 21, 0, 22, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, + 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 25, 0, 0, + 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 35, 0, 0, 21, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, + 0, 10, 0, 0, 0, 0, 2, 0, 0, 0, 17, 0, 6, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, + 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 17, - 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, - 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 2, 22, 0, + 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 17, + 0, 2, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, + 0, 15, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, - 3, 0, 0, 0, 0, 38, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 24, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, + 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 36, 15, 0, 0, 0, 0, + 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, + 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 16, 0, 24, 13, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, + 27, 0, 0, 0, 0, 0, 14, 6, 0, 0, 17, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 22, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 19, 0, 15, 0, 0, 30, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, - 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, - 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 17, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, + 0, 0, 11, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 15, + 0, 0, 0, 0, 0, 0, 0, 9, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 20, 0, 6, 0, 0, 0, 0, 0, 0, + 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, + 28, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 33, 0, + 0, 7, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 22, 27, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 28, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 10, + 0, 0, 0, 0, 20, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 24, 8, 0, 0, 0, 0, 0, 0, - 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 10, 0, 25, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 29, 0, 0, - 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 15, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 22, 0, 22, 0, 0, 0, 0, + 0, 17, 0, 26, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 2, 0, 33, 0, 0, 0, 24, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 17, - 0, 0, 35, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 25, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, + 0, 0, 15, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, + 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 18, 0, 0, 0, 0, 0, 0, 25, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 15, 36, 0, 0, 0, 0, 9, 0, 0, 0, - 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 6, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 27, - 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 29, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 26, 0, - 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 20, 25, - 0, 0, 0, 0, 0, 0, 6, 0, 0, 24, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, + 33, 0, 0, 28, 0, 13, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 7, 21, 0, 16, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, + 0, 28, 0, 0, 0, 17, 0, 0, 0, 0, 0, 36, 0, 0, + 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 28, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 24, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, - 0, 0, 17, 0, 0, 15, 0, 0, 0, 0, 11, 0, 0, 0, - 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 2, 9, 0, 0, 0, 0, 0, 0, 0, 0, 14, - 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 25, 0, 0, 35, 0, 0, 0, 0, 0, 0, 24, 0, 0, - 0, 28, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 33, 26, - 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 22, 0, 0, 0, 0, 27, 0, 0, 0, 0, 25, 0, 0, 0, - 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 28, 11, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 20, 16, 0, 0, 23, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 15, 33, 0, - 0, 14, 0, 25, 25, 0, 0, 0, 35, 0, 0, 0, 10, 17, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, - 0, 33, 0, 0, 0, 37, 0, 0, 0, 0, 0, 19, 0, 0, - 0, 25, 0, 0, 0, 0, 0, 31, 0, 0, 0, 24, 0, 0, - 0, 0, 0, 22, 0, 0, 0, 0, 0, 7, 0, 15, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, - 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 25, 0, - 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 17, - 0, 0, 0, 22, 0, 0, 28, 0, 0, 33, 0, 0, 0, 37, - 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 22, 0, 0, - 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 35, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 13, 0, - 20, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 33, - 0, 14, 17, 0, 25, 25, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, + 0, 0, 0, 0, 0, 0, 0, 0, 22, 18, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, - 0, 0, 33, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 15, - 0, 0, 13, 0, 0, 0, 0, 0, 0, 16, 0, 23, 0, 0, - 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 22, 25, 0, - 0, 0, 0, 0, 24, 35, 0, 0, 0, 0, 0, 0, 28, 0, - 0, 0, 17, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 25, 0, - 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 16, 17, - 0, 0, 0, 0, 0, 0, 26, 0, 0, 16, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 35, 0, - 0, 0, 0, 21, 0, 32, 0, 0, 0, 0, 17, 0, 0, 0, - 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 25, 0, 0, 14, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 13, 16, 0, 0, 0, 0, 0, 0, 0, 0, - 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 17, - 0, 0, 0, 0, 0, 0, 0, 0, 17, 36, 15, 0, 0, 0, - 0, 0, 0, 17, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, + 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 16, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, + 0, 0, 28, 0, 0, 13, 0, 0, 0, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 13, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 22, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 17, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 17, 0, 13, 0, 0, 0, 0, 0, - 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, - 0, 0, 16, 27, 0, 0, 0, 0, 31, 7, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, - 15, 22, 0, 0, 15, 0, 7, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, + 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 7, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, + 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 15, 0, 0, 0, 0, 32, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 16, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, - 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, + 38, 0, 16, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 19, + 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 22, 31, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 15, 0, 4, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 35, - 15, 0, 22, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 17, - 0, 0, 0, 0, 0, 0, 24, 17, 0, 0, 0, 0, 0, 0, - 0, 33, 0, 0, 15, 0, 0, 0, 0, 0, 13, 0, 22, 0, - 36, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, - 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, - 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, - 0, 25, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 7, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, - 0, 0, 0, 0, 0, 0, 0, 16, 17, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 13, - 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 22, - 0, 0, 0, 0, 0, 40, 0, 0, 0, 28, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, + 0, 0, 0, 22, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, + 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 17, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 22, 0, 18, 0, 0, 0, 0, 0, - 0, 0, 0, 28, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, - 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 28, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 6, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, - 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, + 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, - 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 17, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, + 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 24, + 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 30, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 17, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 17, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 14, 14, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 6, 0, 26, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, + 15, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 14, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 38, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 38, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, - 17, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, - 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 26, 0, + 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 6, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 15, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 28, 0, - 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 17, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 14, 0, 0, - 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 16, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, - 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 2, 0, 7, 17, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 17, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, - 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, - 16, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, - 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 15, 0, 0, - 0, 15, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, - 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 28, 0, 0, 3, 14, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 0, 0, 15, 0, 0, 14, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, - 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, - 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 4, + 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 16, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, + 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, + 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, + 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, + 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 15, + 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 14, 0, 0, + 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, + 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 25, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1208,34 +1183,37 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 15, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, + 0, 34, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1245,48 +1223,45 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 6, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1299,29 +1274,30 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1331,6 +1307,7 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1345,8 +1322,8 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1355,30 +1332,36 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 15, 0, 0, 20, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, + 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1400,6 +1383,7 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1418,6 +1402,7 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1436,6 +1421,7 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1464,7 +1450,6 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1478,6 +1463,7 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1515,7 +1501,6 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1560,10 +1545,13 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1575,6 +1563,7 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1583,7 +1572,6 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1599,21 +1587,20 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1624,10 +1611,10 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1665,6 +1652,7 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1699,6 +1687,7 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1709,7 +1698,6 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1788,7 +1776,6 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1850,6 +1837,7 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1977,7 +1965,6 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -2109,6 +2096,7 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -2118,7 +2106,6 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -2306,4132 +2293,4350 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 31 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 31 }; static const struct grib_keys_hash wordlist[] = { - {""}, {""}, {""}, - {"n",1299}, + {""}, {""}, {""}, {""}, {""}, + {"n",1302}, + {""}, + {"t",2100}, + {"nd",1311}, + {"td",2110}, + {"nt",1329}, + {"nnn",1315}, + {"na",1305}, + {"ed",710}, {""}, - {"nd",1308}, - {"ed",707}, - {"nnn",1312}, - {"td",2105}, - {"t",2095}, + {"sd",1898}, {""}, - {"nt",1326}, - {"sd",1893}, - {"na",1302}, + {"m",1183}, + {""}, {""}, {""}, + {"data",615}, + {"min",1265}, + {""}, {""}, {""}, {""}, + {"date",633}, {""}, - {"m",1180}, + {"ident",944}, {""}, {""}, - {"date",632}, + {"name",1306}, + {""}, {""}, {""}, + {"time",2136}, + {""}, {""}, {""}, + {"one",1497}, {""}, {""}, - {"name",1303}, - {"min",1262}, - {""}, - {"data",614}, + {"mars",1186}, + {"names",1310}, {""}, {""}, - {"ident",941}, - {"one",1494}, - {"time",2131}, + {"metadata",1261}, {""}, - {"error",760}, + {"sort",2022}, {""}, - {"mars",1183}, + {"eps",758}, + {"domain",693}, {""}, - {"year",2347}, - {"names",1307}, + {"stream",2073}, + {""}, {""}, {""}, + {"edition",711}, + {"cat",379}, + {"enorm",753}, + {"param",1606}, + {""}, {""}, + {"spare",2039}, + {""}, {""}, {""}, {""}, + {"step",2063}, + {"present",1655}, + {""}, {""}, + {"oper",1509}, + {"iteration",1015}, {""}, - {"band",323}, + {"dimension",676}, + {""}, {""}, {""}, + {"points",1645}, {""}, - {"stream",2068}, - {"sort",2017}, + {"assertion",312}, + {""}, {""}, {""}, + {"opttime",1516}, + {"centre",397}, {""}, - {"enorm",750}, + {"const",564}, + {""}, {""}, + {"parameter",1611}, + {"true",2169}, + {"core",590}, + {"second",1899}, {""}, {""}, - {"metadata",1258}, - {"dy",697}, + {"units",2229}, {""}, {""}, - {"eps",755}, - {"domain",690}, - {"spare",2034}, - {"day",643}, + {"rectime",1738}, + {"parameters",1619}, + {"minute",1267}, + {"section",1921}, + {"band",324}, + {"status",2062}, + {"partitions",1624}, + {"timerepres",2149}, + {"radius",1713}, {""}, {""}, - {"edition",708}, - {"oper",1506}, - {"present",1650}, - {"param",1603}, - {"rdbtime",1719}, + {"year",2352}, + {"dataTime",630}, + {""}, + {"direction",679}, + {"dateTime",642}, + {""}, + {"minimum",1266}, + {"statistics",2061}, + {"radials",1712}, + {""}, + {"leadtime",1076}, + {"type",2180}, {""}, {""}, - {"type",2175}, - {"system",2093}, + {"instrument",971}, + {"grid",895}, + {"hdate",917}, + {"system",2098}, + {"ucs",2222}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"range",1718}, + {"three",2123}, {""}, - {"parameter",1606}, - {"iteration",1012}, + {"process",1685}, + {"rdbtime",1724}, + {"precision",1651}, + {"count",604}, + {""}, {""}, {""}, {""}, {""}, + {"method",1262}, + {""}, + {"class",419}, {""}, - {"assertion",311}, - {"dimension",673}, + {"stepZero",2072}, + {"uco",2221}, + {"phase",1638}, + {""}, + {"origin",1521}, + {"dx",699}, {""}, {""}, {""}, - {"true",2164}, - {"cat",378}, - {"step",2058}, - {"centre",396}, - {""}, {""}, {""}, {""}, - {"parameters",1614}, + {"dy",700}, + {"pl",1642}, {""}, - {"timerepres",2144}, - {"opttime",1513}, - {"points",1640}, + {"bitmap",362}, {""}, - {"core",589}, - {"three",2118}, + {"day",644}, {""}, - {"mybits",1298}, - {"hdate",914}, - {"minute",1264}, - {"rectime",1733}, + {"max",1230}, {""}, {""}, - {"units",2224}, - {"second",1894}, - {""}, - {"radius",1708}, - {"const",563}, + {"char",416}, + {"latitude",1042}, + {"total",2151}, {""}, {""}, - {"status",2057}, - {"number",1327}, - {""}, {""}, {""}, {""}, - {"partitions",1619}, + {"product",1687}, + {""}, {""}, {""}, + {"model",1283}, + {""}, + {"correction",595}, {""}, - {"section",1916}, - {"instrument",968}, - {"method",1259}, + {"latitudes",1072}, + {"consensus",562}, {""}, - {"bitmap",361}, - {"minimum",1263}, - {"direction",676}, - {"leadtime",1073}, - {"obstype",1454}, + {"normal",1318}, + {"section8",1960}, + {"maximum",1231}, + {"TT",234}, + {"million",1264}, + {""}, + {"hundred",936}, + {"number",1330}, + {"discipline",685}, + {""}, {""}, {""}, + {"dataType",631}, + {""}, {""}, {""}, + {"landtype",1034}, + {""}, + {"hour",928}, + {"g",872}, + {""}, {""}, {""}, + {"Di",31}, + {"mybits",1301}, + {""}, + {"thousand",2122}, + {""}, {""}, + {"marsType",1214}, + {""}, {""}, {""}, {""}, {""}, + {"signature",2005}, + {""}, {""}, {""}, {""}, + {"eight",716}, + {"stepType",2068}, {""}, {""}, - {"radials",1707}, - {"phase",1633}, - {"dummy",692}, + {"Dstart",39}, {""}, - {"dateTime",641}, + {"elementsTable",717}, + {"categories",380}, {""}, - {"stepZero",2067}, - {"dataTime",629}, - {"Di",30}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"statistics",2056}, - {"ucs",2217}, + {"dataDate",618}, {""}, - {"Dstart",38}, - {"process",1680}, - {"char",415}, + {"month",1290}, + {""}, {""}, + {"isSens",999}, {""}, - {"dataDate",617}, - {"range",1713}, - {"grid",892}, - {"hundred",933}, - {"marsDir",1187}, - {"precision",1646}, + {"dummy",695}, + {""}, {""}, + {"obstype",1457}, + {"partitionTable",1623}, + {""}, {""}, {""}, {""}, + {"padding",1535}, + {"temperature",2112}, + {"dataStream",628}, {""}, - {"landtype",1031}, + {"marsDir",1190}, + {"dummyc",698}, {""}, - {"count",603}, - {"Dy",42}, + {"diagnostic",672}, + {"reportType",1758}, {""}, - {"masterDir",1216}, + {"codeType",544}, + {"dataOrigin",622}, {""}, {""}, - {"hour",925}, + {"endStep",745}, + {""}, + {"masterDir",1219}, {""}, {""}, - {"uco",2216}, - {"dataType",630}, - {""}, {""}, {""}, {""}, {""}, - {"marsType",1211}, - {"class",418}, + {"marsStream",1211}, {""}, {""}, {""}, - {"latitude",1039}, - {"rdbType",1717}, - {""}, {""}, - {"origin",1518}, + {"reserved",1762}, + {"Ni",194}, + {"varno",2273}, + {"marsDomain",1191}, + {"version",2278}, + {"Nr",196}, + {""}, + {"local",1113}, + {"marsQuantile",1207}, + {""}, + {"startStep",2055}, + {"marsStep",1210}, + {"rdbType",1722}, + {""}, {""}, {""}, {""}, + {"longitude",1145}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"operStream",1510}, {""}, {""}, - {"thousand",2117}, - {"month",1287}, - {"marsDomain",1188}, - {"consensus",561}, - {"product",1682}, - {"pl",1637}, - {"correction",594}, + {"longitudes",1174}, + {"channel",414}, {""}, - {"latitudes",1069}, - {"model",1280}, - {"stepType",2063}, - {"isSens",996}, - {"total",2146}, + {"gridType",904}, + {"country",608}, {""}, - {"normal",1315}, - {"country",607}, + {"gg",884}, + {"hideThis",922}, + {""}, {""}, {""}, + {"eleven",719}, + {""}, + {"notDecoded",1328}, + {""}, {""}, {""}, {""}, + {"rdbtimeTime",1731}, {""}, {""}, - {"reserved",1757}, - {"dataStream",627}, - {"temperature",2107}, + {"extraDim",784}, + {""}, {""}, {""}, {""}, + {"threshold",2124}, + {"Latin",113}, + {"two",2178}, {""}, {""}, {""}, {""}, - {"marsStream",1208}, - {"reportType",1753}, + {"oceanStream",1460}, {""}, {""}, {""}, - {"million",1261}, + {"endTimeStep",747}, + {""}, {""}, {""}, {""}, + {"elevation",718}, + {""}, {""}, {""}, + {"Dx",40}, + {""}, {""}, + {"expver",782}, + {"Dy",43}, {""}, {""}, {""}, {""}, {""}, {""}, - {"rdbtimeDay",1721}, - {"discipline",682}, - {""}, - {"dummyc",695}, + {"Lap",108}, {""}, - {"version",2273}, - {"endStep",742}, - {"varno",2268}, + {"average",316}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"countTotal",607}, + {""}, {""}, {""}, + {"conceptDir",556}, + {""}, {""}, {""}, {""}, + {"values",2261}, {""}, - {"eight",713}, + {"suiteName",2092}, {""}, - {"notDecoded",1325}, - {"codeType",543}, + {"parameterName",1616}, {""}, - {"signature",2000}, - {"elementsTable",714}, - {"maximum",1228}, + {"NT",186}, {""}, {""}, - {"operStream",1507}, - {""}, - {"rdbtimeTime",1726}, + {"levels",1096}, + {""}, {""}, {""}, {""}, {""}, + {"levelist",1095}, + {"matchSort",1226}, + {""}, {""}, + {"isOctahedral",996}, + {"modelName",1286}, {""}, {""}, - {"marsStep",1207}, + {"expandedTypes",775}, + {"auxiliary",315}, + {"oneThousand",1508}, + {"daLoop",614}, + {"xLast",2344}, {""}, - {"startStep",2050}, - {""}, {""}, {""}, {""}, {""}, - {"dx",696}, + {"yLast",2351}, + {"tubeDomain",2176}, {""}, - {"rectimeDay",1734}, + {"Nassigned",189}, + {"gridName",902}, + {"Nx",201}, + {"levtype",1097}, + {"indexingTime",958}, {""}, - {"rdbtimeDate",1720}, - {"tubeDomain",2171}, - {""}, {""}, - {"categories",379}, - {"TT",232}, - {"g",870}, + {"Ny",202}, {""}, - {"max",1227}, - {""}, {""}, - {"eleven",716}, + {"aerosolType",295}, + {""}, {""}, {""}, + {"typicalTime",2217}, + {"standardDeviation",2048}, + {"avg",320}, {""}, {""}, - {"partitionTable",1618}, - {"threshold",2119}, + {"global",885}, + {"dataSelection",627}, + {""}, {""}, {""}, + {"localDir",1121}, + {"shortName",2002}, {""}, - {"standardDeviation",2043}, - {""}, {""}, {""}, {""}, - {"extraDim",782}, + {"spectralType",2046}, {""}, - {"hideThis",919}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"level",1092}, {""}, {""}, - {"gridType",901}, - {""}, {""}, {""}, {""}, - {"oceanStream",1457}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"channel",413}, - {"conceptDir",555}, - {"elevation",715}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"endTimeStep",744}, - {"padding",1532}, + {"Nb",190}, + {""}, + {"rdbtimeDate",1725}, {""}, {""}, - {"diagnostic",669}, - {"longitude",1142}, + {"productType",1692}, + {"TS",232}, {""}, - {"levtype",1094}, + {"userTimeStart",2255}, + {"rectimeDay",1739}, {""}, {""}, - {"local",1110}, - {""}, {""}, {""}, {""}, - {"average",315}, - {""}, {""}, {""}, {""}, - {"longitudes",1171}, - {"rdbSubtype",1716}, + {"pv",1698}, + {""}, + {"xFirst",2343}, {""}, - {"matchSort",1223}, - {"rdbDateTime",1715}, + {"yFirst",2350}, + {""}, {""}, + {"Ncx",191}, + {"Lx",149}, {""}, - {"expver",780}, + {"recDateTime",1735}, + {"Ncy",192}, + {"Ly",151}, {""}, {""}, - {"values",2256}, + {"upperLimit",2246}, + {"TScalc",233}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"Nux",199}, + {""}, {""}, {""}, + {"Nuy",200}, + {""}, {""}, {""}, + {"isSatellite",997}, {""}, {""}, {""}, {""}, - {"auxiliary",314}, + {"rdbtimeDay",1726}, + {"longitudesList",1175}, + {"modeNumber",1282}, {""}, - {"Nr",194}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"levels",1093}, - {"aerosolType",293}, + {"ieeeFloats",949}, {""}, - {"Dx",39}, + {"indicatorOfParameter",959}, {""}, {""}, {""}, {""}, {""}, - {"dataKeys",619}, + {"aerosolpacking",297}, + {"rdbDateTime",1720}, + {""}, {""}, + {"diagnosticNumber",673}, + {"lev",1090}, + {"Lcx",118}, {""}, - {"Ni",192}, - {"levelist",1092}, - {"localDir",1118}, + {"nlev",1314}, {""}, - {"recDateTime",1730}, - {""}, {""}, {""}, - {"typicalDay",2207}, - {""}, {""}, {""}, - {"pv",1693}, - {"ensembleSize",753}, + {"Lcy",120}, {""}, {""}, - {"expandedTypes",773}, - {"visibility",2287}, + {"editionNumber",712}, {""}, {""}, {""}, - {"TS",230}, - {"spectralType",2041}, + {"N",169}, + {"energyNorm",752}, + {"centreDescription",398}, + {"representationMode",1759}, + {"ensembleSize",756}, {""}, - {"Ny",200}, - {"gg",882}, + {"Lux",145}, {""}, {""}, {""}, - {"typicalTime",2212}, + {"Luy",147}, + {""}, {""}, {""}, {""}, {""}, + {"windSpeed",2322}, + {""}, {""}, + {"categoryType",381}, + {"expandedNames",770}, + {""}, {""}, {""}, {""}, {""}, + {"overlayTemplate",1529}, {""}, - {"productType",1687}, - {"Nb",188}, - {""}, {""}, {""}, - {"dataOrigin",621}, - {"dataSelection",626}, - {"oldSubtype",1493}, - {"localDay",1112}, + {"typicalDate",2210}, {""}, {""}, {""}, {""}, - {"typicalDate",2205}, + {"levelType",1094}, {""}, {""}, - {"userTimeStart",2250}, + {"truncateLaplacian",2172}, + {""}, {""}, {""}, {""}, {""}, + {"sectionNumber",1969}, {""}, {""}, - {"level",1089}, - {""}, - {"oneThousand",1505}, - {""}, - {"global",883}, - {""}, {""}, {""}, {""}, - {"countTotal",606}, + {"oldSubtype",1496}, + {"statisticalProcess",2059}, + {"ccsdsRsi",387}, {""}, {""}, - {"userDateStart",2246}, - {""}, - {"lev",1087}, - {""}, - {"nlev",1311}, - {""}, - {"isSatellite",994}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"avg",319}, + {"laplacianOperator",1035}, + {"localDay",1115}, {""}, {""}, - {"centreDescription",397}, - {"categoryType",380}, + {"userDateStart",2251}, + {"rdbSubtype",1721}, + {"indexTemplate",954}, + {""}, {""}, {""}, + {"dataKeys",620}, + {"visibility",2292}, {""}, - {"parameterName",1611}, + {"unitsFactor",2235}, {""}, {""}, - {"Ncy",190}, - {"Latin",111}, - {"Nuy",198}, - {""}, - {"suiteName",2087}, - {""}, {""}, {""}, {""}, {""}, - {"overlayTemplate",1526}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"marsRange",1208}, {""}, - {"Ly",149}, + {"refdate",1744}, + {""}, {""}, + {"localSecond",1135}, + {""}, {""}, + {"statisticalProcessesList",2060}, + {"typicalDay",2212}, + {"validityTime",2260}, + {"localDateTime",1114}, + {"stepRange",2066}, + {""}, {""}, {""}, + {"clearTables",421}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"totalNumber",2155}, {""}, - {"yLast",2346}, + {"identifier",948}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"tubeNumber",2177}, + {"isFillup",994}, + {""}, {""}, {""}, + {"codeFigure",543}, + {""}, {""}, {""}, {""}, + {"boustrophedonic",369}, + {"zero",2359}, + {""}, {""}, + {"legNumber",1079}, + {"siteLatitude",2013}, {""}, - {"shortName",1997}, + {"file",837}, {""}, - {"modelName",1283}, + {"marsLatitude",1201}, + {"endDescriptors",724}, + {""}, {""}, + {"dataFlag",619}, + {"false",830}, + {"dataLength",621}, {""}, {""}, {""}, {""}, - {"modeNumber",1279}, - {"levelType",1091}, - {""}, - {"marsRange",1205}, - {"ccsdsRsi",386}, + {"optionalData",1515}, {""}, {""}, - {"yFirst",2345}, - {"indexingTime",955}, - {"Lap",106}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"isOctahedral",993}, + {"reference",1745}, + {""}, {""}, + {"windDirection",2311}, {""}, {""}, - {"TScalc",231}, + {"ccsdsFlags",386}, + {""}, {""}, + {"parameterDiscipline",1614}, + {""}, {""}, {""}, {""}, {""}, + {"fcperiod",834}, {""}, {""}, {""}, {""}, {""}, - {"stepRange",2061}, + {"clusterNumber",536}, {""}, - {"refdate",1739}, - {"gridName",899}, - {""}, {""}, {""}, {""}, - {"validityTime",2255}, + {"siteLongitude",2014}, + {""}, {""}, {""}, + {"marsLongitude",1204}, {""}, {""}, - {"NT",184}, - {"Nassigned",187}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"upperRange",2247}, + {""}, + {"tableNumber",2103}, {""}, {""}, - {"Lcy",118}, - {"parameterDiscipline",1609}, - {"Luy",145}, - {"clearTables",420}, - {"daLoop",613}, - {"statisticalProcess",2054}, - {"identifier",945}, + {"overlayTemplateNumber",1530}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"tubeNumber",2172}, + {"platform",1643}, {""}, - {"energyNorm",749}, - {""}, {""}, - {"editionNumber",709}, + {"channelNumber",415}, {""}, {""}, {""}, {""}, {""}, - {"indicatorOfParameter",956}, - {""}, {""}, {""}, - {"statisticalProcessesList",2055}, + {"LaD",105}, {""}, {""}, {""}, {""}, {""}, - {"reference",1740}, - {""}, {""}, - {"localDateTime",1111}, + {"angleDivisor",301}, + {""}, + {"efiOrder",715}, + {""}, + {"marsLevel",1202}, {""}, {""}, {""}, {""}, {""}, - {"xLast",2339}, + {"systemNumber",2099}, + {""}, {""}, + {"instrumentIdentifier",972}, + {""}, {""}, + {"unitsDecimalScaleFactor",2233}, + {""}, {""}, {""}, + {"topLevel",2150}, {""}, {""}, {""}, {""}, - {"aerosolpacking",295}, - {"file",835}, - {""}, - {"ieeeFloats",946}, + {"memberNumber",1259}, + {"lowerLimit",1177}, + {""}, {""}, {""}, + {"localLatitude",1126}, {""}, - {"false",828}, + {"flags",852}, {""}, - {"upperRange",2242}, + {"fgTime",836}, {""}, - {"boustrophedonic",368}, + {"methodNumber",1263}, {""}, - {"xFirst",2338}, - {"upperLimit",2241}, + {"startTimeStep",2057}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Nx",199}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"angleDivisor",299}, + {"waveDomain",2301}, + {"iterationNumber",1016}, + {"runwayState",1837}, + {"dimensionNumber",677}, + {""}, {""}, + {"dataValues",632}, + {""}, {""}, + {"newSubtype",1313}, + {""}, {""}, + {"parameterNumber",1617}, + {"laplacianOperatorIsSet",1036}, {""}, - {"KS",96}, - {"K",95}, + {"userDateTimeStart",2253}, {""}, - {"sectionNumber",1964}, - {""}, {""}, {""}, - {"two",2173}, - {"unitsDecimalScaleFactor",2228}, + {"partitionNumber",1622}, {""}, - {"localSecond",1132}, + {"latitudesList",1073}, {""}, - {"marsParam",1203}, - {"fcperiod",832}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"totalNumber",2150}, - {""}, {""}, - {"userDateTimeStart",2248}, - {"tableNumber",2098}, - {"marsQuantile",1204}, - {"memberNumber",1256}, - {""}, {""}, {""}, {""}, {""}, - {"systemNumber",2094}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"platform",1638}, - {"expandedNames",768}, - {"epsPoint",757}, - {"longitudesList",1172}, + {"pressureLevel",1675}, {""}, {""}, {""}, - {"LaD",103}, - {""}, {""}, - {"Ncx",189}, - {""}, - {"Nux",197}, - {""}, {""}, {""}, {""}, - {"legNumber",1076}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"realPart",1728}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"Lx",147}, + {"extraDimensionPresent",785}, + {"bottomLevel",368}, + {"Xo",268}, {""}, {""}, {""}, - {"unitsFactor",2230}, + {"Xp",269}, {""}, {""}, {""}, {""}, - {"probPoint",1676}, - {"truncateLaplacian",2167}, + {"lengthDescriptors",1081}, {""}, {""}, {""}, {""}, - {"N",167}, - {""}, - {"methodNumber",1260}, - {"section8",1955}, + {"secondLatitude",1903}, + {"directionNumber",680}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"indexingDate",957}, + {""}, {""}, {""}, + {"meanSize",1253}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"extractSubset",813}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"extraDimensionPresent",783}, - {""}, {""}, - {"clusterNumber",535}, {""}, {""}, {""}, - {"flags",850}, - {""}, - {"channelNumber",414}, + {"reservedOctet",1767}, + {"flag",847}, {""}, {""}, - {"laplacianOperator",1032}, + {"extractSubset",815}, + {"fcmonth",833}, + {"unitOfTime",2226}, {""}, {""}, {""}, - {"fgTime",834}, - {"fcmonth",831}, - {""}, - {"lengthDescriptors",1078}, - {"codeFigure",542}, - {"dataLength",620}, - {""}, - {"Lcx",116}, - {"efiOrder",712}, - {"Lux",143}, + {"representativeMember",1761}, + {""}, {""}, {""}, + {"numberingOrderOfDiamonds",1449}, + {"localFlag",1123}, + {""}, {""}, + {"forecastperiod",864}, + {"KS",97}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"localDecimalScaleFactor",1116}, + {"generatingProcessTemplate",881}, + {"levTypeName",1091}, + {"forecastTime",863}, + {"satelliteSeries",1842}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"observedData",1456}, {""}, {""}, {""}, {""}, {""}, - {"fgDate",833}, + {"fgDate",835}, + {""}, {""}, {""}, + {"datumSize",643}, + {""}, {""}, + {"satelliteNumber",1841}, {""}, - {"isFillup",991}, + {"marsStartStep",1209}, {""}, - {"marsLatitude",1198}, + {"NL",182}, {""}, {""}, - {"siteLatitude",2008}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"setDecimalPrecision",1991}, + {"cfName",404}, + {""}, + {"tablesVersion",2107}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"localDecimalScaleFactor",1113}, {""}, - {"windSpeed",2317}, + {"FirstLatitude",68}, + {""}, {""}, {""}, {""}, + {"setDecimalPrecision",1996}, {""}, - {"parameterNumber",1612}, - {"iterationNumber",1013}, + {"charValues",417}, + {""}, {""}, {""}, + {"K",96}, + {""}, {""}, {""}, + {"setLocalDefinition",1997}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"isEps",993}, {""}, {""}, - {"dimensionNumber",674}, + {"periodOfTime",1634}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"marsLevel",1199}, - {"forecastperiod",862}, - {""}, {""}, - {"bottomLevel",367}, + {"lowerRange",1178}, + {"logTransform",1144}, + {"coordinatesPresent",589}, {""}, {""}, - {"forecastTime",861}, + {"heightLevelName",919}, {""}, {""}, - {"partitionNumber",1617}, - {"dataFlag",618}, - {""}, {""}, - {"pressureLevel",1670}, + {"indexTemplateNumber",955}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"longitudeOfCenterPoint",1148}, + {"forecastSteps",862}, + {""}, {""}, {""}, {""}, {""}, + {"SecondLatitude",223}, + {""}, {""}, {""}, + {"validityDate",2259}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"missingValue",1276}, + {""}, {""}, {""}, {""}, + {"integerValues",978}, + {""}, {""}, {""}, + {"numericValues",1450}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"coefsSecond",549}, + {"coefsFirst",548}, {""}, {""}, - {"generatingProcessTemplate",879}, + {"marsParam",1206}, {""}, - {"ccsdsFlags",385}, + {"oceanLevName",1459}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Xo",266}, + {"internalVersion",979}, {""}, - {"endDescriptors",721}, - {""}, {""}, - {"topLevel",2145}, - {""}, {""}, - {"directionNumber",677}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"flag",845}, - {"Xp",267}, + {"epsPoint",760}, + {""}, {""}, {""}, {""}, {""}, + {"latitudeSexagesimal",1069}, + {""}, {""}, {""}, + {"distinctLatitudes",687}, + {"Adelta",13}, + {"codedValues",547}, {""}, - {"levTypeName",1088}, + {"sequences",1993}, + {"localLongitude",1129}, + {"quantile",1710}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"forecastSteps",860}, - {""}, {""}, {""}, {""}, {""}, - {"windDirection",2306}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"subSetK",2083}, - {"optionalData",1512}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberingOrderOfDiamonds",1446}, - {"latitudesList",1070}, - {"newSubtype",1310}, + {"realPart",1733}, + {"extraValues",788}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"isAuto",984}, {""}, {""}, {""}, {""}, - {"observablePropertyTemplate",1448}, + {"qnh",1703}, + {"observablePropertyTemplate",1451}, + {""}, {""}, {""}, + {"defaultName",656}, + {""}, {""}, {""}, {""}, {""}, + {"groupSplitting",908}, {""}, {""}, {""}, {""}, - {"marsLongitude",1201}, - {"instrumentIdentifier",969}, + {"clusterSize",537}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"siteLongitude",2009}, - {""}, {""}, {""}, {""}, - {"laplacianOperatorIsSet",1033}, + {"firstLatitude",842}, + {"matchTimeRepres",1227}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"longitudeSexagesimal",1173}, + {"firstDimension",839}, + {"NR",184}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"createNewData",610}, + {""}, + {"probPoint",1681}, + {""}, {""}, {""}, {""}, + {"offset",1462}, + {""}, {""}, {""}, {""}, + {"masterTableNumber",1220}, {""}, {""}, - {"runwayState",1832}, - {"unitOfTime",2221}, - {""}, {""}, - {"satelliteNumber",1836}, - {"waveDomain",2296}, + {"anoffset",307}, + {"referenceDate",1746}, {""}, {""}, {""}, - {"cfName",403}, + {"marsEndStep",1192}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"marsLevelist",1203}, {""}, - {"diagnosticNumber",670}, - {"overlayTemplateNumber",1527}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"indexTemplate",951}, - {""}, {""}, {""}, - {"firstDimension",837}, - {"neitherPresent",1309}, + {"userTimeEnd",2254}, {""}, {""}, - {"observedData",1453}, + {"groupSplittingMethodUsed",909}, + {""}, {""}, {""}, + {"LaR",107}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"dataAccessors",616}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"generatingProcessTemplateNumber",882}, + {"LoR",126}, {""}, - {"SPD",220}, + {"stringValues",2077}, {""}, - {"standardParallel",2044}, + {"libraryVersion",1098}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"logTransform",1141}, - {""}, {""}, {""}, {""}, - {"coefsSecond",548}, + {""}, {""}, {""}, + {"biFourierTruncationType",359}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"localLatitude",1123}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"endOfRange",744}, + {""}, + {"marsKeywords",1198}, + {""}, {""}, + {"crraSection",612}, + {"rectimeSecond",1742}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"NR",182}, + {"boustrophedonicOrdering",370}, {""}, {""}, {""}, {""}, {""}, - {"startTimeStep",2052}, - {"periodOfTime",1629}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"standardParallelInDegrees",2045}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"expoffset",781}, + {""}, {""}, {""}, + {"marsExpver",1194}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"integerScaleFactor",975}, + {"numberOfTimeSteps",1437}, + {""}, {""}, {""}, + {"decimalScaleFactor",652}, {""}, - {"offset",1459}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"anoffset",306}, + {"rdbtimeSecond",1730}, + {""}, + {"crcrlf",609}, + {"referenceStep",1753}, + {"gridDefinition",897}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"bufrTemplate",374}, + {"userDateEnd",2250}, + {""}, + {"subSetK",2088}, {""}, {""}, - {"localFlag",1120}, - {""}, {""}, {""}, {""}, {""}, - {"setLocalDefinition",1992}, + {"siteElevation",2011}, + {""}, + {"numberOfDirections",1367}, + {""}, + {"numberOfFloats",1377}, + {""}, + {"spectralDataRepresentationType",2044}, + {""}, + {"standardParallel",2049}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"marsStartStep",1206}, - {"indexingDate",954}, + {""}, {""}, {""}, + {"longitudinalDirectionGridLength",1176}, {""}, {""}, - {"coefsFirst",547}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"computeStatistics",555}, + {""}, {""}, {""}, + {"baseAddress",325}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"LaR",105}, - {""}, {""}, - {"validityDate",2254}, {""}, {""}, {""}, {""}, - {"satelliteSeries",1837}, + {"NAT",172}, + {""}, + {"referenceValue",1754}, + {"northernLatitudeOfDomain",1326}, + {""}, {""}, + {"deleteExtraLocalSection",667}, {""}, {""}, {""}, {""}, {""}, - {"defaultName",655}, - {"LoR",124}, - {""}, {""}, {""}, - {"longitudeSexagesimal",1170}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"extraLocalSectionPresent",787}, + {""}, {""}, + {"observablePropertyTemplateNumber",1452}, {""}, {""}, {""}, - {"ifsParam",947}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"coordinatesPresent",588}, + {"Nf",193}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"boustrophedonicOrdering",369}, + {"localSection",1136}, {""}, {""}, {""}, {""}, - {"P",204}, - {""}, {""}, {""}, {""}, - {"isEps",990}, + {"latitudeOfCenterPoint",1046}, + {"extractSubsetList",818}, + {""}, + {"faFieldName",827}, {""}, {""}, - {"lowerRange",1175}, + {"localDefinition",1119}, {""}, - {"reservedOctet",1762}, + {"floatVal",853}, + {"tiggeSection",2130}, + {"typicalSecond",2216}, + {"derivedForecast",670}, {""}, {""}, - {"lowerLimit",1174}, + {"analysisOffsets",300}, + {""}, {""}, {""}, + {"aerosolbinnumber",296}, + {"marsExperimentOffset",1193}, + {"molarMass",1289}, + {"TAFstr",230}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"qnh",1698}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"oceanLevName",1456}, - {""}, - {"sequences",1988}, - {""}, - {"numberOfDirections",1364}, - {"representationMode",1754}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"quantile",1705}, + {"southernLatitudeOfDomain",2033}, {""}, {""}, {""}, {""}, {""}, - {"expoffset",779}, + {"monthlyVerificationTime",1298}, {""}, - {"crcrlf",608}, + {"dayOfForecast",647}, {""}, - {"FirstLatitude",67}, + {"typeOfLevel",2194}, + {""}, + {"extraLocalSectionNumber",786}, {""}, {""}, - {"endOfRange",741}, - {"originalParameterNumber",1519}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"NL",180}, + {"generatingProcessIdentifier",880}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"longitudeOfStretchingPole",1164}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"numberOfDiamonds",1366}, + {"expandedDescriptors",769}, + {"NV",188}, {""}, {""}, {""}, {""}, - {"numberOfTimeSteps",1434}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"bitmapSectionPresent",363}, + {"neitherPresent",1312}, + {""}, + {"qfe",1700}, + {""}, {""}, {""}, {""}, {""}, + {"referenceSampleInterval",1752}, + {"marsModel",1205}, {""}, {""}, {""}, {""}, - {"generatingProcessTemplateNumber",880}, + {"secondDimension",1900}, + {""}, {""}, {""}, {""}, + {"freeFormData",867}, {""}, - {"clusteringMethod",538}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"observablePropertyTemplateNumber",1449}, - {"firstLatitude",840}, + {"iteratorDisableUnrotate",1017}, + {""}, + {"generatingProcessIdentificationNumber",879}, + {""}, + {"postAuxiliary",1646}, {""}, {""}, {""}, - {"longitudeOfCenterPoint",1145}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"matchTimeRepres",1224}, - {""}, {""}, - {"secondLatitude",1898}, + {"scaledDirections",1866}, + {"latLonValues",1041}, {""}, {""}, {""}, - {"referenceDate",1741}, - {""}, {""}, - {"numberOfDiamonds",1363}, + {"centreForLocal",399}, {""}, {""}, {""}, {""}, {""}, - {"marsKeywords",1195}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"averagingPeriod",318}, + {"standardParallelInDegrees",2050}, + {""}, {""}, {""}, + {"sectionPosition",1970}, {""}, {""}, - {"rdbtimeSecond",1725}, + {"userDateTimeEnd",2252}, {""}, - {"longitudinalDirectionGridLength",1173}, + {"cfVarName",406}, {""}, {""}, - {"iteratorDisableUnrotate",1014}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"marsEndStep",1189}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"identificationOfOriginatingGeneratingCentre",946}, {""}, - {"complexPacking",550}, + {"matrixOfValues",1229}, + {"ensembleForecastNumbers",754}, {""}, - {"generatingProcessIdentifier",878}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"rectimeSecond",1737}, + {"offsetSection9",1493}, {""}, {""}, {""}, {""}, {""}, - {"extractSubsetList",816}, - {""}, {""}, {""}, - {"Nf",191}, - {"crraSection",611}, + {"tablesVersionLatest",2108}, {""}, - {"latitudeSexagesimal",1066}, - {"forecastPeriod",856}, - {"indexTemplateNumber",952}, - {""}, {""}, {""}, - {"defaultParameter",656}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"LoV",127}, {""}, {""}, - {"numberOfFloats",1374}, + {"theMessage",2117}, + {""}, {""}, {""}, {""}, + {"lcwfvSuiteName",1075}, {""}, {""}, - {"masterTableNumber",1217}, - {"derivedForecast",667}, + {"extractAreaWestLongitude",794}, {""}, {""}, {""}, {""}, - {"molarMass",1286}, + {"expandedAbbreviations",764}, {""}, {""}, {""}, - {"generatingProcessIdentificationNumber",877}, - {""}, {""}, {""}, {""}, - {"heightLevelName",916}, + {"localDefinitionNumber",1120}, {""}, {""}, {""}, - {"userTimeEnd",2249}, + {"verticalVisibility",2290}, + {""}, {""}, + {"conceptsLocalDirAll",557}, + {""}, {""}, {""}, {""}, + {"SPD",222}, + {"Azi",15}, + {"horizontalCoordinateSupplement",924}, + {""}, {""}, + {"monthlyVerificationDate",1296}, + {""}, {""}, + {"complexPacking",551}, + {"originalParameterNumber",1522}, {""}, - {"sectionPosition",1965}, - {"offsetSection9",1490}, + {"globalDomain",886}, + {"computeLaplacianOperator",554}, + {""}, {""}, {""}, + {"ifsParam",950}, + {"faLevelName",828}, {""}, - {"SecondLatitude",221}, - {""}, {""}, {""}, {""}, {""}, - {"representativeMember",1756}, + {"typeOfStatisticalPostProcessingOfEnsembleMembers",2204}, {""}, {""}, {""}, - {"userDateEnd",2245}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"spectralDataRepresentationType",2039}, + {"operatingMode",1511}, {""}, - {"distinctLatitudes",684}, - {"changeDecimalPrecision",407}, - {"XR",264}, + {"identificationNumber",945}, + {"verticalDomainTemplate",2288}, {""}, - {"JS",94}, - {""}, {""}, - {"aerosolbinnumber",294}, - {"referenceStep",1748}, - {"offsetSection0",1479}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"marsExpver",1191}, + {"offsetSection8",1492}, + {"numberOfValues",1445}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"marsModel",1202}, + {"windPresent",2321}, + {""}, {""}, + {"simpleThinningMissingRadius",2008}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"clusteringMethod",539}, + {"iDirectionIncrement",937}, {""}, - {"groupSplitting",905}, + {"originalSubCentreIdentifier",1524}, + {"XR",266}, + {""}, {""}, {""}, + {"floatValues",854}, + {"clusterMember9",535}, + {"pvlLocation",1699}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"angleSubdivisions",306}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"MS",156}, + {""}, {""}, {""}, + {"sensitiveAreaDomain",1992}, + {"thisExperimentVersionNumber",2118}, + {"dateOfForecast",635}, + {""}, {""}, + {"angleOfRotation",303}, + {"numberOfSubsets",1434}, + {""}, {""}, + {"tiggeModel",2129}, + {"localMinute",1132}, + {"timeOfForecast",2143}, + {"indicatorOfUnitOfTimeRange",963}, {""}, - {"typicalSecond",2211}, - {"bufrTemplate",373}, - {""}, {""}, {""}, {""}, - {"secondDimension",1895}, - {"gridDefinition",894}, + {"dataRepresentation",623}, + {"offsetDescriptors",1476}, + {"doExtractDateTime",690}, + {""}, + {"inputExtendedDelayedDescriptorReplicationFactor",966}, + {"thisMarsType",2121}, + {"doExtractSubsets",691}, + {"spectralMode",2045}, {""}, {""}, - {"siteElevation",2006}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"offsetDescriptors",1473}, + {"isAccumulation",983}, {""}, - {"dayOfForecast",646}, - {""}, {""}, {""}, {""}, - {"verticalDomainTemplate",2283}, + {"scanningMode",1891}, + {"totalNumberOfdimensions",2167}, + {""}, {""}, {""}, {""}, {""}, + {"typeOfStatisticalProcessing",2205}, + {""}, {""}, {""}, + {"radialAngularSpacing",1711}, + {""}, {""}, {""}, + {"controlForecastCluster",568}, + {""}, {""}, {""}, + {"clusterMember8",534}, + {""}, {""}, + {"localExtensionPadding",1122}, + {""}, + {"numberOfOperationalForecastTube",1403}, {""}, {""}, - {"faFieldName",825}, - {"referenceSampleInterval",1747}, + {"localMonth",1133}, {""}, {""}, - {"theMessage",2112}, - {"epsStatisticsPoint",759}, + {"windVariableDirection",2332}, + {"earthMinorAxis",704}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"latitudeOfCenterPointInDegrees",1047}, {""}, - {"marsLevelist",1200}, + {"TAF",229}, + {""}, {""}, {""}, + {"treatmentOfMissingData",2168}, + {""}, {""}, {""}, + {"averagingPeriod",319}, + {""}, {""}, {""}, + {"listOfScaledFrequencies",1112}, + {"yearOfForecast",2356}, {""}, - {"NP",181}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"localSection",1133}, + {"dewPointTemperature",671}, {""}, {""}, {""}, {""}, - {"typeOfLevel",2189}, + {"frequency",868}, + {"rectimeMinute",1741}, + {"isConstant",990}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"qfe",1695}, - {""}, {""}, {""}, {""}, - {"siteId",2007}, - {"latitudeOfCenterPoint",1043}, - {""}, {""}, {""}, {""}, {""}, - {"typeOfStatisticalPostProcessingOfEnsembleMembers",2199}, + {"scaledFrequencies",1867}, + {""}, + {"stepTypeForConversion",2069}, + {"scanningMode8",1896}, {""}, {""}, - {"marsIdent",1194}, + {"applicationIdentifier",311}, {""}, {""}, {""}, - {"totalNumberOfdimensions",2162}, - {""}, {""}, - {"tiggeSection",2125}, - {"computeStatistics",554}, - {"gridPointPosition",900}, + {"totalNumberOfTubes",2165}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"meaningOfVerticalCoordinate",1258}, {""}, {""}, {""}, {""}, - {"paramId",1604}, - {"MS",154}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"thisMarsType",2116}, + {"bitmapSectionPresent",364}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"rdbtimeMinute",1728}, + {"Experiment_Identifier",56}, + {"climatologicalRegime",424}, {""}, {""}, {""}, - {"localLongitude",1126}, + {"forecastPeriod",858}, {""}, {""}, - {"localDefinition",1116}, - {""}, - {"earthMinorAxis",701}, - {"userDateTimeEnd",2247}, + {"thisMarsStream",2120}, {""}, {""}, {""}, - {"marsExperimentOffset",1190}, - {"conceptsLocalDirAll",556}, + {"extractedDateTimeNumberOfSubsets",820}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"defaultParameter",657}, {""}, {""}, {""}, {""}, - {"expandedDescriptors",767}, - {"totalNumberOfTubes",2160}, - {"northernLatitudeOfDomain",1323}, - {""}, - {"scaledDirections",1861}, - {""}, {""}, {""}, {""}, {""}, - {"inputDataPresentIndicator",961}, - {""}, {""}, {""}, - {"iIncrement",938}, + {"anoffsetFirst",308}, {""}, - {"globalDomain",884}, - {""}, - {"operatingMode",1508}, - {""}, {""}, {""}, {""}, {""}, - {"changingPrecision",412}, + {"marsClass",1187}, {""}, {""}, - {"biFourierTruncationType",358}, + {"offsetSection0",1482}, {""}, - {"PLPresent",207}, + {"dataRepresentationType",626}, + {""}, {""}, {""}, {""}, + {"inputDataPresentIndicator",964}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"hourOfForecast",931}, + {"dataRepresentationTemplate",624}, + {""}, {""}, {""}, + {"marsLamModel",1200}, + {""}, {""}, + {"ensembleForecastNumbersList",755}, + {""}, {""}, {""}, {""}, {""}, + {"numberOfRadials",1423}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"originalParameterTableNumber",1520}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"clusterMember9",534}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"integerScaleFactor",972}, {""}, - {"angleSubdivisions",304}, - {"centreForLocal",398}, + {"versionNumOfFilesFreeSpaceStorage",2279}, + {""}, {""}, {""}, {""}, {""}, + {"angleMultiplier",302}, {""}, {""}, - {"faLevelName",826}, + {"optimizeScaleFactor",1514}, + {""}, {""}, {""}, {""}, {""}, + {"subCentre",2078}, + {""}, {""}, {""}, {""}, + {"primaryMissingValue",1678}, + {"parameterCode",1613}, {""}, {""}, - {"southernLatitudeOfDomain",2028}, - {"localMinute",1129}, + {"typicalMinute",2214}, + {""}, {""}, {""}, + {"tableCode",2102}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"ensembleStandardDeviation",757}, + {""}, {""}, {""}, + {"minuteOfReference",1272}, + {"totalNumberOfDirections",2158}, + {"typeOfDistributionFunction",2185}, + {""}, {""}, {""}, {""}, {""}, + {"Sub-Experiment_Identifier",228}, {""}, - {"decimalScaleFactor",651}, + {"P",206}, + {""}, {""}, {""}, + {"numberOfVerticalPoints",1448}, {""}, {""}, - {"analysisOffsets",298}, - {""}, - {"treatmentOfMissingData",2163}, + {"dateOfReference",639}, {""}, {""}, - {"forecastProbabilityNumber",859}, - {"originalSubCentreIdentifier",1521}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"localMonth",1130}, + {"internationalDataSubCategory",980}, {""}, - {"spectralMode",2040}, - {""}, {""}, {""}, - {"totalNumberOfDirections",2153}, + {"productDefinition",1688}, {""}, {""}, - {"thisMarsStream",2115}, - {"dataValues",631}, - {"freeFormData",865}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"dimensionType",675}, + {"oneMillionConstant",1499}, + {"timeOfReference",2145}, {""}, {""}, {""}, - {"frequency",866}, - {"typeOfStatisticalProcessing",2200}, - {"qnhPresent",1700}, - {""}, {""}, {""}, {""}, {""}, - {"scanningMode",1886}, + {"secondOfForecast",1906}, + {"changeDecimalPrecision",408}, + {""}, + {"minuteOfForecast",1270}, + {""}, {""}, {""}, + {"monthOfForecast",1293}, + {""}, + {"numberOfSection",1430}, {""}, {""}, - {"dataRepresentation",622}, + {"bitsPerValue",365}, {""}, - {"orderOfSPD",1514}, + {"consensusCount",563}, + {""}, {""}, + {"epsStatisticsPoint",762}, {""}, {""}, {""}, {""}, {""}, - {"createNewData",609}, - {""}, - {"tiggeModel",2124}, + {"biFourierMakeTemplate",352}, + {""}, {""}, + {"siteId",2012}, {""}, {""}, {""}, {""}, {""}, {""}, - {"tablesVersion",2102}, - {"thisExperimentVersionNumber",2113}, - {""}, - {"deleteExtraLocalSection",664}, + {"typeOfEnsembleMember",2187}, + {"probContinous",1680}, + {""}, {""}, {""}, {""}, + {"scanPosition",1890}, {""}, {""}, {""}, - {"scanPosition",1885}, - {"dateOfForecast",634}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"minuteOfReference",1269}, + {"numberOfFrequencies",1383}, {""}, {""}, - {"timeOfForecast",2138}, - {""}, - {"Adelta",13}, + {"marsIdent",1197}, + {"roundedMarsLevelist",1783}, {""}, - {"anoffsetFirst",307}, - {""}, - {"identificationNumber",942}, - {"yearOfForecast",2351}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfReservedBytes",1424}, - {"perturbedType",1632}, + {"paramId",1607}, + {"numberOfReservedBytes",1427}, + {"extractedAreaNumberOfSubsets",819}, + {""}, {""}, + {"anoffsetLast",310}, + {"horizontalCoordinateDefinition",923}, + {""}, {""}, {""}, {""}, + {"qnhPresent",1705}, {""}, {""}, {""}, {""}, - {"windPresent",2316}, + {"defaultStepUnits",660}, + {""}, {""}, {""}, {""}, + {"yearOfReference",2358}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"isAuto",981}, + {"originalParameterTableNumber",1523}, {""}, {""}, {""}, {""}, - {"bitmapPresent",362}, + {"verticalDomainTemplateNumber",2289}, {""}, - {"identificationOfOriginatingGeneratingCentre",943}, + {"startingAzimuth",2058}, + {"numberOfVerticalGridDescriptors",1447}, {""}, {""}, {""}, - {"dateOfReference",638}, + {"streamOfAnalysis",2074}, {""}, - {"latitudeOfCenterPointInDegrees",1044}, - {"primaryMissingValue",1673}, - {"indicatorOfUnitOfTimeRange",960}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"timeOfReference",2140}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"yearOfReference",2353}, + {"modelVersionDate",1287}, + {"iIncrement",941}, {""}, {""}, {""}, - {"charValues",416}, - {""}, {""}, - {"iDirectionIncrement",934}, - {""}, {""}, {""}, {""}, - {"computeLaplacianOperator",553}, - {""}, {""}, {""}, {""}, - {"versionNumOfFilesFreeSpaceStorage",2274}, - {"dataRepresentationType",625}, + {"masterTablesVersionNumber",1221}, + {""}, + {"tiggeCentre",2126}, {""}, {""}, - {"numberOfSubsets",1431}, + {"corr4Data",594}, + {"roundedMarsLatitude",1782}, + {"reservedNeedNotBePresent",1766}, + {""}, + {"changingPrecision",413}, + {"oneConstant",1498}, + {""}, + {"defaultSequence",658}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"expandedCodes",765}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"inputExtendedDelayedDescriptorReplicationFactor",963}, - {""}, {""}, {""}, - {"tablesMasterDir",2101}, + {"numberOfDataValues",1364}, {""}, {""}, - {"totalNumberOfRepetitions",2158}, - {"controlForecastCluster",567}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"scaleFactorAtReferencePoint",1838}, + {"numberOfDistinctSection9s",1374}, + {"tablesMasterDir",2106}, {""}, - {"angleMultiplier",300}, - {"tileIndex",2130}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"groupSplittingMethodUsed",906}, - {"ensembleStandardDeviation",754}, - {""}, {""}, {""}, {""}, - {"pvlLocation",1694}, - {""}, {""}, {""}, - {"numberOfOperationalForecastTube",1400}, + {"optimisationTime",1513}, {""}, {""}, - {"hourOfForecast",928}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"internalVersion",976}, + {"numberOfLocalDefinitions",1392}, + {""}, {""}, {""}, {""}, {""}, + {"trueLengthOfLastGroup",2170}, + {"minuteOfAnalysis",1268}, {""}, {""}, {""}, - {"dataAccessors",615}, - {""}, {""}, - {"listOfScaledFrequencies",1109}, + {"secondDimensionPhysicalSignificance",1902}, {""}, - {"baseAddress",324}, + {"epsContinous",759}, {""}, - {"dataRepresentationTemplate",623}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"modelIdentifier",1282}, + {"defaultFaLevelName",654}, + {""}, + {"totalNumberOfRepetitions",2163}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"angleOfRotation",301}, - {"dewPointTemperature",668}, - {"marsLamModel",1197}, - {""}, {""}, - {"codedValues",546}, - {"typeOfDistributionFunction",2180}, - {"doExtractSubsets",688}, - {"productDefinition",1683}, - {""}, {""}, - {"integerScalingFactorAppliedToDirections",973}, - {"integerScalingFactorAppliedToFrequencies",974}, {""}, - {"hourOfReference",930}, + {"numberOfDistinctSection8s",1373}, + {""}, + {"hourOfReference",933}, + {"biFourierSubTruncationType",358}, + {"dataRepresentationTemplateNumber",625}, + {"targetCompressionRatio",2109}, {""}, {""}, - {"libraryVersion",1095}, - {"offsetSection8",1489}, + {"defaultFaFieldName",653}, {""}, {""}, - {"satelliteIdentifier",1835}, + {"angleOfRotationInDegrees",304}, {""}, {""}, - {"verticalDomainTemplateNumber",2284}, - {""}, - {"stretchingFactor",2070}, - {""}, - {"numberOfFrequencies",1380}, - {"defaultStepUnits",659}, - {""}, {""}, {""}, - {"numericValues",1447}, - {""}, {""}, {""}, - {"headersOnly",915}, + {"numberOfForecastsInTube",1382}, {""}, {""}, {""}, {""}, - {"integerValues",975}, + {"numberOfRows",1428}, {""}, {""}, {""}, {""}, {""}, {""}, - {"additionalFlagPresent",291}, + {"bitmapPresent",363}, {""}, - {"missingValue",1273}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"extraValues",786}, + {"corr3Data",593}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"unitOfTimeIncrement",2227}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfPackedValues",1401}, - {""}, {""}, {""}, - {"roundedMarsLevelist",1778}, - {"isEPS",989}, - {"biFourierMakeTemplate",351}, + {"scaleValuesBy",1865}, {""}, {""}, {""}, {""}, - {"scaledFrequencies",1862}, - {""}, {""}, - {"localExtensionPadding",1119}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"tileClassification",2134}, {""}, {""}, {""}, {""}, {""}, {""}, - {"monthOfReference",1292}, - {"ensembleForecastNumbers",751}, - {""}, {""}, {""}, {""}, {""}, - {"rdbtimeMinute",1723}, - {""}, - {"monthOfForecast",1290}, - {""}, {""}, - {"section9Pointer",1960}, + {"forecastLeadTime",855}, + {"verificationDate",2274}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"numberOfForcasts",1378}, + {"numberOfAnalysis",1337}, + {"scaleFactorOfStandardDeviation",1862}, + {"longitudeOfIcosahedronPole",1155}, + {"setCalendarId",1995}, + {"typeOfTimeIncrement",2206}, {""}, - {"localDefinitionNumber",1117}, + {"verticalCoordinate",2286}, + {"primaryMissingValueSubstitute",1679}, + {""}, {""}, {""}, + {"NP",183}, {""}, - {"stretchingFactorScaled",2071}, - {"secondDimensionPhysicalSignificance",1897}, - {""}, {""}, {""}, {""}, - {"primaryMissingValueSubstitute",1674}, - {"md5Data",1229}, + {"dayOfAnalysis",645}, + {""}, {""}, {""}, {""}, {""}, + {"tileIndex",2135}, + {"scaleFactorOfStandardDeviationInTheCluster",1863}, {""}, {""}, - {"numberOfLocalDefinitions",1389}, - {""}, - {"section0Pointer",1918}, + {"doExtractArea",689}, {""}, - {"numberOfRadials",1420}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"defaultFaLevelName",653}, + {"monthOfReference",1295}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"rectimeMinute",1736}, - {""}, {""}, - {"DiInDegrees",32}, - {""}, {""}, {""}, {""}, - {"stringValues",2072}, + {"crraLocalVersion",611}, + {"angleOfRotationOfProjection",305}, + {"correction1Part",597}, + {"conceptsMasterMarsDir",561}, + {""}, {""}, {""}, + {"numberOfPartitions",1407}, {""}, {""}, - {"oneMillionConstant",1496}, - {"extractedDateTimeNumberOfSubsets",818}, + {"falseNorthing",832}, {""}, {""}, - {"DyInDegrees",43}, - {"lcwfvSuiteName",1072}, + {"orientationOfTheGrid",1519}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"scaleFactorOfStandardDeviation",1857}, - {"isConstant",987}, + {""}, {""}, {""}, {""}, {""}, + {"secondsOfReference",1920}, + {""}, {""}, {""}, {""}, {""}, + {"deletePV",669}, + {""}, {""}, + {"tableReference",2104}, {""}, - {"numberOfPartitions",1404}, - {""}, {""}, {""}, - {"totalNumberOfForecastProbabilities",2154}, + {"forecastProbabilityNumber",861}, {""}, {""}, {""}, {""}, - {"scaleFactorOfStandardDeviationInTheCluster",1858}, - {"numberOfSection",1427}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"subcentreOfAnalysis",2085}, + {"isEPS",992}, + {"CDFstr",23}, {""}, {""}, {""}, - {"tableReference",2099}, - {"defaultSequence",657}, - {""}, {""}, - {"postAuxiliary",1641}, + {"numberOfRemaininChars",1425}, {""}, {""}, {""}, {""}, - {"qfePresent",1696}, - {"defaultFaFieldName",652}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"subCentre",2073}, - {"verificationDate",2269}, - {"latitudeOfLastGridPoint",1049}, - {""}, {""}, {""}, {""}, {""}, - {"doExtractDateTime",687}, - {""}, {""}, - {"expandedAbbreviations",762}, + {"scaleFactorOfFirstSize",1850}, {""}, - {"binaryScaleFactor",359}, - {"Sub-Experiment_Identifier",226}, + {"tsectionNumber4",2174}, + {""}, {""}, {""}, + {"isectionNumber4",1013}, {""}, - {"internationalDataSubCategory",977}, + {"orderOfSPD",1517}, {""}, {""}, {""}, {""}, - {"marsClass",1184}, + {"versionNumOfRootGroupSymbolTableEntry",2280}, + {"PLPresent",209}, + {""}, {""}, {""}, {""}, {""}, + {"totalNumberOfForecastProbabilities",2159}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"section9Pointer",1965}, + {""}, {""}, {""}, {""}, {""}, + {"missingValueManagement",1277}, {""}, {""}, {""}, - {"clusterMember8",533}, - {""}, - {"anoffsetFrequency",308}, + {"scaleFactorAtReferencePoint",1843}, {""}, - {"typeOfPostProcessing",2193}, - {""}, - {"referenceValue",1749}, - {"forecastPeriodTo",858}, - {"tableCode",2097}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"biFourierSubTruncationType",357}, - {"NAT",170}, - {""}, {""}, {""}, {""}, - {"sensitiveAreaDomain",1987}, - {"DxInDegrees",40}, + {"faModelName",829}, + {"missingValuesPresent",1279}, + {"productDefinitionTemplateNumber",1689}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"totalNumberOfFrequencies",2160}, + {"startOfMessage",2053}, + {""}, {""}, + {"parameterCategory",1612}, {""}, {""}, {""}, - {"simpleThinningMissingRadius",2003}, - {"typicalMinute",2209}, - {"totalNumberOfFrequencies",2155}, + {"dateOfForecastRun",636}, + {"nosigPresent",1327}, + {"inputDelayedDescriptorReplicationFactor",965}, {""}, {""}, - {"orientationOfTheGrid",1516}, - {"numberOfForcasts",1375}, - {""}, {""}, {""}, {""}, - {"TAFstr",228}, - {""}, {""}, {""}, {""}, - {"versionNumOfRootGroupSymbolTableEntry",2275}, - {""}, - {"md5Section9",1243}, + {"section8Pointer",1962}, + {"kurt",1031}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"parameterCode",1608}, + {""}, + {"additionalFlagPresent",293}, {""}, {""}, {""}, - {"matchLandType",1222}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"corr3Data",592}, + {"anoffsetFrequency",309}, + {""}, + {"gridPointPosition",903}, {""}, {""}, {""}, {""}, - {"inputDelayedDescriptorReplicationFactor",962}, - {""}, {""}, {""}, - {"anoffsetLast",309}, - {""}, {""}, {""}, {""}, {""}, - {"defaultTypeOfLevel",660}, + {"attributeOfTile",314}, + {"centuryOfReference",402}, + {"masterTablesVersionNumberLatest",1222}, {""}, {""}, {""}, - {"numberOfRemaininChars",1422}, - {""}, - {"dataRepresentationTemplateNumber",624}, + {"numberOfDistributionFunctionParameters",1375}, + {"gridDescriptionSectionPresent",901}, {""}, {""}, {""}, - {"numberInTheAuxiliaryArray",1330}, - {""}, - {"lengthOfProjectLocalTemplate",1085}, - {""}, - {"J",93}, + {"frequencyNumber",869}, + {""}, {""}, + {"perturbationNumber",1636}, {""}, {""}, {""}, - {"partitionItems",1616}, - {"yDirectionGridLength",2342}, - {""}, - {"floatVal",851}, - {"scaleFactorOfFirstSize",1845}, + {"stretchingFactor",2075}, + {"satelliteIdentifier",1840}, {""}, {""}, {""}, - {"totalNumberOfTileAttributePairs",2159}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"localSectionPresent",1134}, - {"probContinous",1675}, + {"scalingFactorForFrequencies",1889}, {""}, - {"secondsOfReference",1915}, - {"verticalVisibility",2285}, - {""}, - {"ITN",92}, - {""}, {""}, {""}, {""}, - {"section8Pointer",1957}, + {"productDefinitionTemplateNumberInternal",1690}, {""}, {""}, - {"heightOrPressureOfLevel",917}, - {"scanningMode8",1891}, + {"groupWidth",910}, + {"widthOfFirstOrderValues",2307}, + {"timeDomainTemplate",2138}, {""}, - {"faModelName",827}, + {"modelIdentifier",1285}, {""}, - {"interpretationOfNumberOfPoints",978}, - {"groupLeafNodeK",903}, - {""}, {""}, {""}, - {"standardParallelInMicrodegrees",2046}, + {"kurtosis",1032}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"applicationIdentifier",310}, {""}, {""}, {""}, - {"zero",2354}, - {""}, {""}, {""}, {""}, {""}, - {"startOfMessage",2048}, + {"lengthOfProjectLocalTemplate",1088}, {""}, {""}, - {"consensusCount",562}, + {"typeOfAuxiliaryInformation",2182}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"optimisationTime",1510}, - {"centuryOfReference",401}, + {"productionStatusOfProcessedData",1693}, {""}, {""}, {""}, - {"Experiment_Identifier",55}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"widthOfSPD",2304}, - {"longitudeOfIcosahedronPole",1152}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"roundedMarsLatitude",1777}, + {"groupLeafNodeK",906}, + {"verticalCoordinateDefinition",2287}, + {""}, + {"numberOfModels",1400}, {""}, {""}, {""}, {""}, {""}, {""}, - {"nosigPresent",1324}, + {"expandedOriginalWidths",774}, + {"partitionItems",1621}, {""}, - {"angleOfRotationOfProjection",303}, + {"expandedOriginalCodes",771}, + {"climateDateTo",423}, {""}, - {"xDirectionGridLength",2335}, + {"stretchingFactorScaled",2076}, {""}, - {"reservedNeedNotBePresent",1761}, - {"productDefinitionTemplateNumber",1684}, - {"forecastLeadTime",853}, + {"defaultTypeOfLevel",661}, + {"section0Pointer",1923}, {""}, - {"decimalPrecision",650}, - {""}, {""}, {""}, - {"correction2Part",598}, + {"originatorLocalTemplate",1527}, + {""}, + {"localDefNumberOne",1117}, + {"interpretationOfNumberOfPoints",981}, {""}, {""}, - {"bufrDataEncoded",370}, + {"qfePresent",1701}, {""}, {""}, {""}, - {"tiggeCentre",2121}, + {"grib3divider",891}, + {""}, {""}, {""}, {""}, + {"secondDimensionCoordinateValueDefinition",1901}, + {""}, + {"typicalCentury",2209}, + {"numberOfPackedValues",1404}, {""}, {""}, {""}, {""}, {""}, - {"frequencyNumber",867}, + {"marsGrid",1196}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"md5Structure",1244}, + {"latitudeOfLastGridPoint",1052}, + {""}, {""}, {""}, {""}, + {"matchAerosolPacking",1224}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"bufrDataEncoded",371}, + {""}, {""}, + {"spectralDataRepresentationMode",2043}, + {"expandedOriginalScales",773}, + {"M",153}, + {"groupWidths",911}, {""}, {""}, {""}, - {"numberOfModels",1397}, - {"corr1Data",590}, - {"radialAngularSpacing",1706}, - {""}, - {"scaleFactorOfSecondSize",1855}, + {"corr1Data",591}, {""}, {""}, {""}, - {"extraLocalSectionPresent",785}, + {"scaledValueOfStandardDeviation",1886}, {""}, - {"bitsPerValue",364}, + {"typicalDateTime",2211}, {""}, - {"falseNorthing",830}, - {""}, {""}, {""}, {""}, {""}, - {"extractAreaWestLongitude",792}, + {"constituentType",567}, + {""}, {""}, + {"ITN",93}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"scaledValueOfStandardDeviationInTheCluster",1887}, + {""}, {""}, {""}, {""}, + {"twoOrdersOfSPD",2179}, + {"ccccIdentifiers",383}, {""}, - {"endOfInterval",738}, - {""}, {""}, {""}, - {"targetCompressionRatio",2104}, - {"cfVarName",405}, - {"epsContinous",756}, - {""}, {""}, {""}, - {"expandedCodes",763}, - {""}, {""}, {""}, {""}, {""}, - {"floatValues",852}, - {"ccccIdentifiers",382}, - {""}, {""}, {""}, {""}, {""}, - {"stepTypeInternal",2065}, + {"isSatelliteType",998}, {""}, - {"listMembersUsed",1100}, + {"keySat",1029}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"keyData",1027}, + {"typeOfPostProcessing",2198}, {""}, - {"orientationOfTheGridInDegrees",1517}, + {"PVPresent",211}, + {""}, {""}, + {"numberOfVerticalCoordinateValues",1446}, + {"windSpeedTrend4",2326}, + {"scaleFactorOfRadiusOfSphericalEarth",1858}, {""}, - {"latLonValues",1038}, + {"julianDay",1025}, + {"orientationOfTheGridInDegrees",1520}, + {""}, + {"latitudeOfStretchingPole",1060}, {""}, {""}, {""}, {""}, - {"productDefinitionTemplateNumberInternal",1685}, - {""}, {""}, - {"md5Section8",1242}, - {""}, {""}, - {"meanSize",1250}, - {"verticalCoordinate",2281}, - {""}, {""}, - {"typeOfTimeIncrement",2201}, - {"extraLocalSectionNumber",784}, + {"CDF",22}, + {""}, + {"listMembersUsed",1103}, {""}, - {"endOfProduct",740}, + {"forecastPeriodTo",860}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"compressedData",553}, + {"localSectionPresent",1137}, {""}, - {"ensembleForecastNumbersList",752}, + {"endOfProduct",743}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"skewness",2020}, + {""}, {""}, {""}, {""}, + {"scaleFactorOfSecondSize",1860}, {""}, {""}, {""}, {""}, {""}, {""}, - {"scaleFactorOfDistributionFunctionParameter",1841}, - {""}, {""}, - {"M",151}, - {"southPoleOnProjectionPlane",2026}, - {""}, {""}, - {"unitOfTimeIncrement",2222}, - {"scaleFactorOfRadiusOfSphericalEarth",1853}, - {"localDefNumberOne",1114}, + {"scaledValueOfFirstSize",1874}, + {""}, + {"heightOrPressureOfLevel",920}, + {""}, {""}, {""}, {""}, {""}, + {"functionCode",871}, + {""}, {""}, {""}, {""}, + {"conceptsLocalMarsDirAll",559}, + {""}, {""}, {""}, {""}, + {"widthOfSPD",2309}, {""}, {""}, {""}, - {"spatialProcessing",2036}, - {"numberOfDistributionFunctionParameters",1372}, - {"angularPrecision",305}, + {"scaleFactorOfDistributionFunctionParameter",1846}, + {""}, {""}, {""}, {""}, + {"unknown",2238}, {""}, {""}, - {"numberOfValues",1442}, - {"numberOfIterations",1388}, + {"atmosphericChemicalOrPhysicalConstituentType",313}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"numberOfEffectiveValues",1376}, {""}, - {"tsectionNumber5",2170}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"angleOfRotationInDegrees",302}, + {"forecastOrSingularVectorNumber",857}, + {""}, {""}, {""}, {""}, + {"defaultShortName",659}, + {"earthIsOblate",701}, {""}, - {"corr4Data",593}, + {"md5Data",1232}, {""}, - {"earthIsOblate",698}, - {"typeOfEnsembleMember",2182}, - {"levelIndicator",1090}, + {"unitsOfSecondFixedSurface",2237}, + {"minutesAfterDataCutoff",1273}, + {"extractDateTimeYearStart",814}, + {"upperThreshold",2248}, + {"stepTypeInternal",2070}, {""}, {""}, {""}, {""}, - {"subSetJ",2082}, + {"marsForecastMonth",1195}, + {""}, {""}, {""}, + {"decimalPrecision",651}, + {"latitudeOfSouthernPole",1058}, + {""}, {""}, + {"standardParallelInMicrodegrees",2051}, {""}, {""}, {""}, {""}, {""}, - {"grib3divider",889}, + {"gridDefinitionTemplateNumber",900}, + {""}, {""}, {""}, + {"reducedGrid",1743}, + {""}, {""}, {""}, + {"plusOneinOrdersOfSPD",1644}, + {""}, {""}, + {"extendedFlag",783}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"isCorrection",991}, {""}, - {"datumSize",642}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"listOfDistributionFunctionParameter",1105}, - {"numberOfPoints",1405}, + {"levelIndicator",1093}, + {"binaryScaleFactor",360}, + {""}, + {"DiInDegrees",33}, {""}, {""}, - {"forecastPeriodFrom",857}, + {"modelVersionTime",1288}, + {"GTSstr",80}, + {""}, {""}, {""}, {""}, {""}, + {"localDefNumberTwo",1118}, + {""}, + {"numberOfChars",1348}, {""}, {""}, - {"matrixOfValues",1226}, + {"packingType",1534}, + {""}, {""}, {""}, + {"listOfModelIdentifiers",1110}, + {"upperThresholdValue",2249}, {""}, - {"monthlyVerificationTime",1295}, + {"southPoleOnProjectionPlane",2031}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"timeDomainTemplateNumber",2139}, {""}, {""}, - {"numberOfDistinctSection9s",1371}, + {"originatingCentre",1525}, {""}, {""}, - {"plusOneinOrdersOfSPD",1639}, + {"md5Section9",1246}, {""}, - {"LaDInDegrees",104}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"is_uerra",1007}, + {"typeOfCompressionUsed",2184}, + {""}, {""}, + {"addExtraLocalSection",292}, + {"g2grid",875}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"monthlyVerificationDate",1293}, - {""}, {""}, {""}, {""}, - {"CDFstr",23}, - {"spectralDataRepresentationMode",2038}, + {"yearOfCentury",2354}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"gridCoordinate",896}, + {"md5Section8",1245}, + {"DxInDegrees",41}, {""}, - {"tileClassification",2129}, - {""}, - {"preProcessingParameter",1645}, - {""}, {""}, {""}, {""}, - {"short_name",1999}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"DyInDegrees",44}, {""}, - {"perturbationNumber",1631}, + {"truncateDegrees",2171}, {""}, {""}, {""}, - {"TAF",227}, - {"corr2Data",591}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"setCalendarId",1990}, - {""}, {""}, {""}, {""}, - {"verticalCoordinateDefinition",2282}, - {""}, {""}, - {"md5Product",1233}, + {"numberOfDataMatrices",1361}, {""}, - {"observationGeneratingProcessIdentifier",1451}, - {""}, {""}, {""}, {""}, {""}, - {"_T",282}, - {"windVariableDirection",2327}, - {"minuteOfForecast",1267}, + {"referenceReflectivityForEchoTop",1751}, + {""}, + {"lengthOfMessage",1086}, + {""}, + {"mAngleMultiplier",1184}, {""}, {""}, {""}, {""}, {""}, - {"secondOfForecast",1901}, + {"spatialProcessing",2041}, + {""}, {""}, + {"unitsConversionOffset",2231}, + {"windGust",2316}, + {""}, {""}, {""}, + {"monthlyVerificationMonth",1297}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"streamOfAnalysis",2069}, + {"rootTablesDir",1781}, {""}, - {"longitudeOfLastGridPoint",1153}, + {"numberOfPoints",1408}, {""}, - {"diffInDays",671}, - {""}, {""}, - {"oneConstant",1495}, + {"corr2Data",592}, + {""}, + {"dayOfReference",649}, {""}, {""}, - {"PVPresent",209}, + {"endOfFileAddress",739}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"climatologicalRegime",423}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"g2grid",873}, - {""}, {""}, {""}, {""}, - {"isAccumulation",980}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"timeIncrement",2135}, + {"shapeOfVerificationArea",2001}, {""}, {""}, {""}, - {"grib1divider",885}, - {"numberOfEffectiveValues",1373}, - {"section_09",1974}, - {""}, {""}, {""}, {""}, - {"gts_header",912}, - {""}, {""}, - {"is_aerosol",997}, + {"baseTimeEPS",328}, {""}, - {"minuteOfAnalysis",1265}, - {"conceptsLocalMarsDirAll",558}, - {""}, {""}, {""}, {""}, {""}, - {"localNumberOfObservations",1131}, + {"grib1divider",887}, {""}, {""}, {""}, - {"marsGrid",1193}, - {""}, - {"numberOfAnalysis",1334}, + {"skew",2019}, {""}, {""}, {""}, {""}, {""}, - {"masterTablesVersionNumber",1218}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"clusterSize",536}, + {"totalNumberOfTileAttributePairs",2164}, {""}, {""}, - {"dayOfReference",648}, - {"subSetM",2084}, - {"tablesVersionLatest",2103}, - {""}, - {"cnmc_isac",541}, - {""}, - {"meaningOfVerticalCoordinate",1255}, + {"updateSequenceNumber",2245}, {""}, {""}, {""}, {""}, - {"numberOfForecastsInTube",1379}, - {""}, {""}, {""}, {""}, - {"conceptsMasterMarsDir",560}, - {"extractedAreaNumberOfSubsets",817}, + {"listOfDistributionFunctionParameter",1108}, + {"endOfInterval",741}, + {""}, + {"scaleFactorOfLowerLimit",1854}, + {"DiGiven",32}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"localNumberOfObservations",1134}, + {"GTS",79}, + {"AA",6}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"trueLengthOfLastGroup",2165}, - {"longitudeOfStretchingPole",1161}, {""}, - {"correction1Part",596}, - {"tigge_name",2127}, - {"is_tigge",1006}, - {""}, {""}, {""}, - {"lengthOfMessage",1083}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"dayOfAnalysis",644}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"local_use",1140}, + {"subSetM",2089}, + {"originatorLocalTemplateNumber",1528}, {""}, - {"periodOfTimeIntervals",1630}, - {""}, {""}, {""}, {""}, {""}, - {"atmosphericChemicalOrPhysicalConstituentType",312}, + {"centralLongitude",394}, {""}, {""}, - {"julianDay",1022}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"missingValuesPresent",1276}, + {"totalLength",2154}, {""}, - {"is_chemical",999}, + {"predefined_grid",1653}, {""}, {""}, {""}, - {"numberOfDistinctSection8s",1370}, - {"scanningModeForOneDiamond",1892}, - {"biFourierResolutionParameterN",354}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"matchAerosolPacking",1221}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"compressedData",552}, - {"cnmc_cmcc",540}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"unitsOfSecondFixedSurface",2232}, + {"incrementOfLengths",953}, + {"significanceOfReferenceTime",2007}, {""}, {""}, {""}, - {"_TS",283}, - {""}, {""}, {""}, {""}, {""}, - {"timeDomainTemplate",2133}, + {"JS",95}, {""}, {""}, - {"unsignedIntegers",2238}, - {""}, {""}, {""}, - {"gridDefinitionTemplateNumber",897}, + {"correction2Part",599}, + {"scaledValueOfRadiusOfSphericalEarth",1882}, + {"paleontologicalOffset",1605}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"parameterCategory",1607}, - {""}, {""}, {""}, - {"DiInMetres",33}, + {"sizeOfOffsets",2016}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"tsectionNumber5",2175}, + {""}, {""}, {""}, {""}, {""}, + {"lowerThreshold",1179}, {""}, {""}, {""}, {""}, {""}, {""}, - {"defaultFaModelName",654}, - {""}, {""}, {""}, {""}, - {"DyInMetres",44}, + {"scanningModeForOneDiamond",1897}, {""}, - {"functionCode",869}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"climateDateFrom",421}, - {""}, {""}, - {"grib2divider",888}, - {""}, {""}, - {"calendarIdPresent",375}, - {""}, {""}, - {"scaleFactorOfSecondFixedSurface",1854}, - {"unitsConversionOffset",2226}, + {"numberOfMembersInCluster",1394}, {""}, - {"gts_ddhh00",911}, - {""}, {""}, {""}, - {"md5TimeDomainSection",1245}, - {"lsdate_bug",1179}, + {"formatVersionMajorNumber",865}, {""}, - {"md5DataSection",1230}, + {"numberOfCharacters",1347}, + {"scaledValueOfSecondSize",1884}, + {"sampleSizeOfModelClimate",1838}, + {"projectionCenterFlag",1696}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"GTSstr",79}, + {""}, {""}, {""}, + {"defaultFaModelName",655}, {""}, {""}, - {"climateDateTo",422}, + {"numberOfColumns",1355}, + {"baseDateEPS",326}, + {""}, {""}, {""}, {""}, + {"numberOfMembersInEnsemble",1395}, + {""}, + {"longitudeOfFirstGridPoint",1153}, {""}, {""}, - {"groupWidth",907}, + {"scaledValueOfDistributionFunctionParameter",1870}, {""}, {""}, {""}, {""}, - {"listMembersMissing",1096}, - {"addExtraLocalSection",290}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"updateSequenceNumber",2240}, - {"kurt",1028}, - {""}, {""}, {""}, - {"reducedGrid",1738}, - {""}, {""}, {""}, {""}, {""}, - {"modelVersionDate",1284}, + {"longitudeOfNorthWestCornerOfArea",1158}, {""}, {""}, - {"extractSubsetIntervalEnd",814}, + {"coordinate1Start",576}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"typicalDateTime",2206}, - {""}, {""}, {""}, - {"typicalCentury",2204}, - {""}, {""}, {""}, {""}, {""}, - {"numberOfDataMatrices",1358}, + {"numberOfIterations",1391}, + {"lowerThresholdValue",1180}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"md5Structure",1247}, + {""}, {""}, {""}, {""}, + {"secondOfModelVersion",1907}, + {""}, {""}, + {"minuteOfModelVersion",1271}, + {"offsetAfterLocalSection",1466}, + {""}, + {"indicatorOfTypeOfLevel",960}, + {"easternLongitudeOfDomain",709}, {""}, {""}, {""}, - {"extractSubsetIntervalStart",815}, + {"messageLength",1260}, + {""}, {""}, + {"integerPointValues",974}, {""}, {""}, {""}, {""}, - {"defaultShortName",658}, - {"numberOfChars",1345}, + {"significanceOfReferenceDateAndTime",2006}, {""}, - {"DiGiven",31}, - {"lengthOfIndexTemplate",1082}, + {"timeIncrement",2140}, {""}, - {"attributeOfTile",313}, - {"DxInMetres",41}, - {"longitudeOfCenterPointInDegrees",1146}, + {"scaleFactorOfSecondFixedSurface",1859}, + {"numberInTheAuxiliaryArray",1333}, {""}, - {"CDF",22}, + {"powerOfTenUsedToScaleClimateWeight",1648}, {""}, - {"is_efas",1001}, + {"extractDateTimeStart",811}, {""}, {""}, {""}, {""}, {""}, - {"yearOfCentury",2349}, - {"kurtosis",1029}, - {""}, {""}, {""}, - {"expandedOriginalCodes",769}, - {""}, {""}, - {"expandedOriginalWidths",772}, - {""}, {""}, {""}, {""}, - {"scalingFactorForFrequencies",1884}, - {"rootTablesDir",1776}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"isSatelliteType",995}, + {"tablesLocalDir",2105}, {""}, {""}, - {"typeOfCompressionUsed",2179}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"keyData",1024}, + {"scaleFactorOfDistanceFromEnsembleMean",1845}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"extractDateTimeSecondEnd",808}, {""}, {""}, - {"clutterFilterIndicator",539}, - {"componentIndex",551}, + {"expandedOriginalReferences",772}, {""}, - {"representationType",1755}, + {"unpackedSubsetPrecision",2241}, + {"biFourierResolutionParameterN",355}, {""}, {""}, {""}, {""}, - {"groupWidths",908}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"directionScalingFactor",682}, {""}, - {"scaleFactorOfDistanceFromEnsembleMean",1840}, - {"referenceReflectivityForEchoTop",1746}, - {"gridDescriptionSectionPresent",898}, - {""}, {""}, {""}, - {"GTS",78}, - {""}, {""}, {""}, {""}, {""}, - {"keySat",1026}, - {"section10Pointer",1921}, + {"longitudeFirstInDegrees",1146}, + {""}, {""}, {""}, {""}, + {"extractDateTimeSecondStart",810}, + {""}, {""}, + {"is_uerra",1010}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"secondLatitudeInDegrees",1904}, + {"_T",284}, + {""}, {""}, {""}, {""}, + {"unsignedIntegers",2243}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"clutterFilterIndicator",540}, {""}, - {"numberOfVerticalPoints",1445}, - {"numberOfInts",1387}, + {"unitsConversionScaleFactor",2232}, + {"LaDInDegrees",106}, + {"unexpandedDescriptors",2223}, {""}, - {"typeOfPreProcessing",2194}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"widthOfFirstOrderValues",2302}, + {"northernLatitudeOfClusterDomain",1325}, + {""}, {""}, + {"numberOfForecastsInEnsemble",1380}, {""}, {""}, {""}, - {"doExtractArea",686}, + {"extractDateTimeHourStart",801}, + {""}, {""}, {""}, {""}, + {"centralLongitudeInDegrees",395}, + {""}, {""}, + {"unpackedValues",2242}, + {""}, {""}, + {"predefined_grid_values",1654}, + {""}, {""}, {""}, {""}, {""}, + {"groupLengths",907}, + {"short_name",2004}, + {"listMembersMissing",1099}, {""}, - {"expandedOriginalScales",771}, - {""}, {""}, {""}, - {"scaleValuesBy",1860}, + {"secondsOfAnalysis",1919}, + {"periodOfTimeIntervals",1635}, {""}, {""}, {""}, {""}, - {"productionStatusOfProcessedData",1688}, + {"grib2divider",890}, + {"section_8",1989}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"biFourierResolutionSubSetParameterN",356}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"dirty_statistics",680}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"iScansNegatively",939}, - {"extractDateTimeYearStart",812}, - {""}, {""}, {""}, {""}, - {"predefined_grid",1648}, + {""}, {""}, + {"tiggeLAMName",2127}, + {""}, + {"typeOfSizeInterval",2203}, + {""}, + {"verticalVisibilityCoded",2291}, + {""}, + {"azimuthalWidth",321}, {""}, {""}, {""}, - {"isCorrection",988}, - {"minutesAfterDataCutoff",1270}, - {"numberOfDataPoints",1359}, + {"backgroundProcess",323}, + {"referenceOfWidths",1750}, + {"correction3Part",601}, {""}, - {"tsectionNumber4",2169}, + {"southernLatitudeOfClusterDomain",2032}, + {"latitudeOfSubSatellitePoint",1062}, {""}, {""}, {""}, {""}, {""}, - {"isectionNumber4",1010}, - {"listOfModelIdentifiers",1107}, + {"cnmc_isac",542}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section_8",1984}, + {"unexpandedDescriptorsEncoded",2224}, + {"latitudeOfSubSatellitePointInDegrees",1063}, {""}, - {"efas_model",710}, - {"g1conceptsMasterDir",872}, - {""}, {""}, - {"masterTablesVersionNumberLatest",1219}, - {""}, {""}, {""}, {""}, {""}, - {"totalNumberOfIterations",2157}, - {""}, {""}, {""}, {""}, {""}, - {"numberOfDataValues",1361}, - {""}, {""}, - {"originatorLocalTemplate",1524}, + {"laplacianScalingFactor",1037}, + {"is_aerosol",1000}, + {"projectionCentreFlag",1697}, + {"SecondOfModelVersion",224}, {""}, {""}, {""}, - {"scaledValueOfStandardDeviation",1881}, - {""}, {""}, {""}, {""}, - {"numberOfVerticalGridDescriptors",1444}, - {""}, {""}, - {"typeOfEnsembleForecast",2181}, + {"normAtInitialTime",1317}, {""}, {""}, {""}, - {"scaledValueOfStandardDeviationInTheCluster",1882}, + {"scaledValueOfLowerLimit",1878}, {""}, {""}, - {"multiplicationFactorForLatLong",1297}, - {""}, {""}, {""}, - {"latitudeOfSouthernPole",1055}, + {"northLatitudeOfCluster",1319}, + {""}, {""}, {""}, {""}, {""}, + {"is_tigge",1009}, + {"eastLongitudeOfCluster",706}, + {"dayOfEndOfOverallTimeInterval",646}, {""}, {""}, {""}, {""}, - {"LyInMetres",150}, - {""}, - {"section_08",1973}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"marsForecastMonth",1192}, - {""}, - {"missingValueManagement",1274}, + {"tigge_name",2132}, + {"typeOfGrid",2190}, + {"gts_header",915}, + {"offsetAfterPadding",1467}, {""}, {""}, {""}, {""}, - {"dayOfEndOfOverallTimeInterval",645}, - {""}, {""}, {""}, - {"gridCoordinate",893}, + {"componentIndex",552}, + {"preProcessingParameter",1650}, + {"extremeClockwiseWindDirection",821}, {""}, {""}, {""}, - {"accumulationInterval",287}, + {"gribDataQualityChecks",892}, + {""}, {""}, {""}, {""}, + {"numberOfDataPoints",1362}, + {"qnhAPresent",1704}, + {"section_09",1979}, + {""}, {""}, + {"longitudeOfCenterPointInDegrees",1149}, {""}, {""}, {""}, - {"typeOfAuxiliaryInformation",2177}, + {"scaleFactorOfFirstFixedSurface",1849}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"centuryOfAnalysis",401}, {""}, - {"numberOfMembersInEnsemble",1392}, - {""}, {""}, {""}, - {"longitudeOfFirstGridPoint",1150}, + {"monthOfModelVersion",1294}, {""}, {""}, - {"numberOfCharacters",1344}, - {""}, - {"iScansPositively",940}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"paleontologicalOffset",1602}, + {"inputShortDelayedDescriptorReplicationFactor",970}, + {"calendarIdPresent",376}, + {"cnmc_cmcc",541}, + {"local_use",1143}, {""}, {""}, {""}, {""}, - {"verifyingMonth",2272}, - {"scaleFactorOfFirstFixedSurface",1844}, - {""}, {""}, - {"numberOfMembersInCluster",1391}, - {"upperThreshold",2243}, - {"is_aerosol_optical",998}, + {"southLatitudeOfCluster",2029}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"extendedFlag",781}, + {"integerScalingFactorAppliedToDirections",976}, + {"integerScalingFactorAppliedToFrequencies",977}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"md5DataSection",1233}, {""}, {""}, - {"centuryOfReferenceTimeOfData",402}, + {"lengthOfIndexTemplate",1085}, + {"is_chemical",1002}, {""}, - {"timeDomainTemplateNumber",2134}, - {""}, {""}, {""}, {""}, {""}, - {"horizontalCoordinateSupplement",921}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"startOfRange",2054}, {""}, - {"upperThresholdValue",2244}, - {"originatingCentre",1522}, - {"LxInMetres",148}, - {""}, {""}, {""}, - {"NV",186}, - {"predefined_grid_values",1649}, - {""}, {""}, {""}, {""}, {""}, - {"longitudeFirstInDegrees",1143}, - {""}, {""}, {""}, {""}, {""}, - {"dateOfForecastRun",635}, - {""}, {""}, {""}, {""}, {""}, - {"crraLocalVersion",610}, - {"packingType",1531}, + {"centuryOfReferenceTimeOfData",403}, {""}, - {"windGust",2311}, - {"constituentType",566}, - {"correction3Part",600}, + {"westernLongitudeOfDomain",2306}, {""}, - {"indicatorOfUnitForTimeRange",959}, + {"extractSubsetIntervalEnd",816}, + {"numberOfInts",1390}, + {""}, {""}, {""}, {""}, {""}, + {"section_08",1978}, + {""}, {""}, {""}, {""}, {""}, + {"forecastMonth",856}, + {"climateDateFrom",422}, + {"identificationOfProject",947}, {""}, {""}, - {"parameterIndicator",1610}, - {"unexpandedDescriptors",2218}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"tablesLocalDir",2100}, - {""}, {""}, {""}, {""}, - {"twoOrdersOfSPD",2174}, - {""}, {""}, {""}, {""}, - {"scaledValueOfFirstSize",1869}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"truncateDegrees",2166}, + {"extractSubsetIntervalStart",817}, {""}, {""}, {""}, - {"centralLongitude",393}, - {""}, {""}, {""}, - {"inputShortDelayedDescriptorReplicationFactor",967}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"inputOriginatingCentre",967}, {""}, {""}, - {"directionScalingFactor",679}, - {""}, {""}, {""}, - {"easternLongitudeOfDomain",706}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"basicAngleOfTheInitialProductionDomain",330}, {""}, - {"powerOfTenUsedToScaleClimateWeight",1643}, - {""}, - {"sfc_levtype",1994}, - {""}, {""}, {""}, - {"LoV",125}, + {"shortNameECMF",2003}, + {"extractDateTimeYearEnd",812}, {""}, {""}, {""}, - {"secondDimensionCoordinateValueDefinition",1896}, + {"qualityControl",1707}, + {"simpleThinningSkip",2009}, {""}, {""}, {""}, {""}, {""}, {""}, - {"unexpandedDescriptorsEncoded",2219}, - {"extractDateTimeHourStart",799}, + {"observationType",1455}, {""}, {""}, - {"iDirectionIncrementInDegrees",937}, - {""}, - {"baseTimeEPS",327}, - {"LcyInMetres",119}, - {"yDirectionGridLengthInMetres",2343}, - {"LuyInMetres",146}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"numberOfCoordinatesValues",1359}, + {""}, {""}, {""}, {""}, + {"diffInDays",674}, {""}, - {"shortNameECMF",1998}, - {"baseDateEPS",325}, - {""}, {""}, {""}, {""}, {""}, - {"section2Present",1931}, + {"numberOfCategories",1346}, + {"verifyingMonth",2277}, {""}, {""}, - {"numberOfIntegers",1386}, + {"numberOfClusters",1351}, + {"conceptsLocalDirECMF",558}, + {"referenceValueError",1755}, + {"normAtFinalTime",1316}, + {""}, + {"gridDefinitionSection",899}, {""}, {""}, {""}, {""}, - {"normAtInitialTime",1314}, + {"parameterIndicator",1615}, {""}, {""}, - {"startStepInHours",2051}, - {"typeOfGrid",2185}, - {""}, {""}, {""}, - {"radiusInMetres",1709}, - {"correction4Part",602}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"skewness",2015}, + {"endMinuteTrend4",734}, {""}, {""}, - {"_anoffset",284}, - {"projectionCenterFlag",1691}, + {"isHindcast",995}, + {""}, + {"scaledValueOfSecondFixedSurface",1883}, + {""}, + {"longitudeOfStretchingPoleInDegrees",1165}, + {""}, {""}, {""}, {""}, {""}, + {"rootGroupObjectHeaderAddress",1779}, {""}, {""}, {""}, - {"mAngleMultiplier",1181}, + {"thisMarsClass",2119}, + {"latitudeOfNorthWestCornerOfArea",1054}, + {"scaledValueOfDistanceFromEnsembleMean",1869}, + {"unpackedError",2240}, {""}, {""}, {""}, {""}, {""}, {""}, - {"scaledValueOfSecondSize",1879}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"bitMapIndicator",360}, - {""}, {""}, {""}, {""}, {""}, - {"centralLongitudeInDegrees",394}, + {"packedValues",1532}, + {"table2Version",2101}, {""}, {""}, {""}, - {"conceptsLocalDirECMF",557}, + {"numberOfCodedValues",1352}, + {"totalNumberOfClusters",2156}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"numberOfGroups",1386}, + {"WMO",259}, + {"_TS",285}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"indicatorOfTypeOfLevel",957}, - {""}, - {"totalNumberOfDataValuesMissingInStatisticalProcess",2152}, - {"GDSPresent",68}, - {""}, {""}, {""}, {""}, - {"optimizeScaleFactor",1511}, - {"unknown",2233}, + {"lsdate_bug",1182}, {""}, {""}, - {"LcxInMetres",117}, - {"xDirectionGridLengthInMetres",2336}, - {"LuxInMetres",144}, + {"packingError",1533}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"thresholdIndicator",2120}, + {"tiggeSuiteID",2131}, + {""}, + {"DiInMetres",34}, + {"correction4Part",603}, {""}, {""}, - {"coordinateIndexNumber",587}, + {"biFourierResolutionSubSetParameterN",357}, {""}, {""}, - {"stepTypeForConversion",2064}, - {"numberOfRepresentativeMember",1423}, + {"verificationMonth",2275}, {""}, {""}, - {"laplacianScalingFactor",1034}, - {"numberOfOctetsExtraDescriptors",1399}, + {"referenceOfLengths",1749}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"expandedOriginalReferences",770}, - {""}, {""}, - {"boot_edition",366}, - {"scaledValueOfDistributionFunctionParameter",1865}, - {""}, {""}, {""}, - {"numberOfClusters",1348}, - {"windSpeedTrend4",2321}, - {""}, {""}, - {"scaledValueOfRadiusOfSphericalEarth",1877}, - {"numberOfColumns",1352}, - {""}, {""}, {""}, - {"forecastMonth",854}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"extractDateTimeMinuteEnd",802}, {""}, {""}, {""}, - {"basicAngleOfTheInitialProductionDomain",329}, - {""}, {""}, {""}, {""}, - {"extractDateTimeMinuteEnd",800}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"rootGroupObjectHeaderAddress",1774}, - {"extractDateTimeMonthEnd",803}, - {""}, - {"yDirectionGridLengthInMillimetres",2344}, - {""}, {""}, {""}, {""}, - {"extractDateTimeMinuteStart",802}, - {"numberOfRows",1425}, - {"totalNumberOfClusters",2151}, + {"unitOfOffsetFromReferenceTime",2225}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"longitudeOfThePoleOfStretching",1169}, {""}, {""}, - {"startOfRange",2049}, - {"unpackedSubsetPrecision",2236}, - {"extractDateTimeMonthStart",805}, - {""}, {""}, {""}, - {"thisMarsClass",2114}, - {"originatorLocalTemplateNumber",1525}, - {"deletePV",666}, - {"offsetAfterLocalSection",1463}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"groupInternalNodeK",902}, - {"totalLength",2149}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"horizontalCoordinateDefinition",920}, + {"accumulationInterval",289}, + {"extractDateTimeMinuteStart",804}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"northernLatitudeOfClusterDomain",1322}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"secondLatitudeInDegrees",1899}, + {"westLongitudeOfCluster",2303}, + {"totalNumberOfDataValuesMissingInStatisticalProcess",2157}, + {"extractDateTimeMonthEnd",805}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"DxInMetres",42}, {""}, - {"projectionCentreFlag",1692}, - {"offsetAfterPadding",1464}, + {"DyInMetres",45}, {""}, - {"numberOfGroups",1383}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"numberOfComponents",1356}, + {"epsStatisticsContinous",761}, {""}, - {"backgroundProcess",322}, - {""}, {""}, {""}, {""}, - {"biFourierResolutionParameterM",353}, + {"extractDateTimeMonthStart",807}, {""}, - {"listOfEnsembleForecastNumbers",1106}, - {""}, {""}, - {"referenceValueError",1750}, - {""}, {""}, {""}, {""}, - {"verificationMonth",2270}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"significanceOfReferenceTime",2002}, + {"LoVInDegrees",128}, {""}, - {"xDirectionGridLengthInMillimetres",2337}, - {""}, {""}, {""}, {""}, - {"southernLatitudeOfClusterDomain",2027}, + {"longitudeOfThePolePoint",1170}, {""}, {""}, {""}, {""}, {""}, - {"latitudeOfLastGridPointInDegrees",1050}, - {""}, {""}, {""}, {""}, - {"tiggeSuiteID",2126}, - {""}, {""}, - {"distanceFromTubeToEnsembleMean",683}, - {"significanceOfReferenceDateAndTime",2001}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"rectimeHour",1740}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"stepRangeInHours",2062}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"timeRangeIndicator",2141}, - {""}, {""}, {""}, - {"indexedStorageInternalNodeK",953}, - {""}, {""}, {""}, - {"dataCategory",616}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"formatVersionMajorNumber",863}, - {""}, {""}, {""}, - {"yCoordinateOfSubSatellitePoint",2341}, - {""}, {""}, {""}, {""}, - {"messageLength",1257}, - {"numberMissingFromAveragesOrAccumulations",1333}, + {"g1conceptsMasterDir",874}, + {"xCoordinateOfOriginOfSectorImage",2338}, + {""}, + {"yCoordinateOfOriginOfSectorImage",2345}, + {""}, + {"md5Product",1236}, {""}, {""}, {""}, {""}, - {"latitudeOfStretchingPole",1057}, - {"yCoordinateOfOriginOfSectorImage",2340}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"typeOfCalendar",2183}, + {"numberOfTimeRange",1436}, + {""}, {""}, + {"is_efas",1004}, {""}, - {"lowerThreshold",1176}, + {"projectLocalTemplate",1694}, {""}, {""}, - {"earthMinorAxisInMetres",702}, - {""}, {""}, {""}, {""}, {""}, - {"modelVersionTime",1285}, - {""}, {""}, {""}, {""}, {""}, - {"unitOfOffsetFromReferenceTime",2220}, - {"numberOfTimeRange",1433}, + {"extractAreaNorthLatitude",792}, + {"distinctLongitudes",688}, {""}, - {"TIDE",229}, + {"rdbtimeHour",1727}, + {"section4",1943}, + {""}, + {"typeOfPreProcessing",2199}, {""}, {""}, {""}, - {"monthlyVerificationMonth",1294}, + {"section9Length",1964}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfForecastsInEnsemble",1377}, - {"productIdentifier",1686}, + {"resolutionAndComponentFlags",1771}, {""}, - {"longitudeOfThePolePoint",1167}, + {"offsetAfterCentreLocalSection",1464}, + {"longitudeOfSouthEastCornerOfArea",1161}, {""}, {""}, {""}, - {"totalInitialConditions",2148}, - {""}, {""}, {""}, {""}, - {"XRInMetres",265}, - {"lowerThresholdValue",1177}, - {""}, {""}, {""}, {""}, {""}, - {"section5Pointer",1945}, - {""}, {""}, {""}, {""}, {""}, - {"referenceOfWidths",1745}, + {"scaledValueOfFirstFixedSurface",1873}, + {""}, {""}, + {"localHour",1125}, + {"param_value_min",1610}, + {""}, + {"section10Pointer",1926}, {""}, {""}, - {"epsStatisticsContinous",758}, + {"distanceFromTubeToEnsembleMean",686}, + {""}, {""}, {""}, {""}, {""}, + {"simpleThinningStart",2010}, + {"NC",174}, + {""}, + {"section8Length",1961}, {""}, {""}, {""}, - {"observationType",1452}, - {"section5",1943}, + {"numberOfLogicals",1393}, + {"numberMissingFromAveragesOrAccumulations",1336}, + {""}, + {"thresholdIndicator",2125}, + {""}, {""}, + {"resolutionAndComponentFlags8",1778}, + {""}, + {"md5TimeDomainSection",1248}, {""}, {""}, {""}, - {"groupLengths",904}, + {"LxInMetres",150}, + {"METARstr",155}, + {"LyInMetres",152}, + {"referenceForGroupWidths",1748}, {""}, - {"clusterIdentifier",524}, - {"qnhAPresent",1699}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"xCoordinateOfSubSatellitePoint",2334}, - {""}, {""}, {""}, {""}, {""}, - {"scaleFactorOfPrimeMeridianOffset",1852}, - {"numberOfCategories",1343}, + {"postAuxiliaryArrayPresent",1647}, {""}, {""}, {""}, {""}, - {"xCoordinateOfOriginOfSectorImage",2333}, + {"keyMore",1028}, + {"Yo",279}, + {"doSimpleThinning",692}, + {""}, {""}, + {"Yp",280}, {""}, {""}, - {"is_chemical_distfn",1000}, + {"indicatorOfUnitForTimeRange",962}, + {"n3",1304}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"jDirectionIncrement",1018}, {""}, {""}, {""}, {""}, {""}, - {"Azi",15}, + {"latitudinalDirectionGridLength",1074}, + {"lengthOfTimeRange",1089}, + {""}, {""}, {""}, {""}, + {"clusteringDomain",538}, {""}, - {"numberOfParallelsBetweenAPoleAndTheEquator",1402}, + {"subdivisionsOfBasicAngle",2091}, + {"secondOrderOfDifferentWidth",1909}, {""}, - {"referenceForGroupWidths",1743}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"endOfFileAddress",736}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"LoVInDegrees",126}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"minuteOfModelVersion",1268}, - {"numberOfComponents",1353}, - {""}, {""}, - {"identificationOfProject",944}, + {"coordinate2Start",579}, + {"typicalHour",2213}, + {"radiusInMetres",1714}, {""}, - {"secondOfModelVersion",1902}, + {"sp3",2036}, {""}, {""}, {""}, {""}, {""}, - {"latitudinalDirectionGridLength",1071}, - {"numberInTheGridCoordinateList",1331}, - {""}, {""}, {""}, - {"isHindcast",992}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"westernLongitudeOfDomain",2301}, + {"numberOfRepresentativeMember",1426}, {""}, {""}, {""}, - {"latitudeOfSubSatellitePoint",1059}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"section3Pointer",1936}, - {""}, {""}, {""}, {""}, - {"northLatitudeOfCluster",1316}, - {"latitudeOfSubSatellitePointInDegrees",1060}, - {"stepUnits",2066}, - {"referenceForGroupLengths",1742}, - {""}, {""}, {""}, {""}, - {"biFourierResolutionSubSetParameterM",355}, + {"projectLocalTemplateNumber",1695}, {""}, {""}, {""}, - {"n3",1301}, + {"southEastLatitudeOfVerficationArea",2026}, + {""}, {""}, + {"iDirectionIncrementInDegrees",940}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"efas_model",713}, + {""}, + {"numberOfOctetsExtraDescriptors",1402}, {""}, {""}, {""}, {""}, - {"integerPointValues",971}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"inputOriginatingCentre",964}, - {"numberOfGroupsOfDataValues",1384}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"scaledValueOfSecondFixedSurface",1878}, - {"earthMajorAxis",699}, + {"dirty_statistics",683}, + {""}, {""}, + {"sectionLengthLimitForEnsembles",1967}, + {"section0Length",1922}, + {""}, {""}, {""}, + {"referenceForGroupLengths",1747}, + {""}, {""}, + {"latitudeLongitudeValues",1045}, {""}, {""}, {""}, {""}, - {"lengthOfTimeRange",1086}, - {""}, - {"typeOfCalendar",2178}, + {"numberOfIntegers",1389}, + {""}, {""}, + {"totalNumberOfIterations",2162}, + {""}, {""}, {""}, + {"earthMajorAxis",702}, + {"numberOfForecastsInCluster",1379}, {""}, - {"incrementOfLengths",950}, + {"sphericalHarmonics",2047}, + {"NEAREST",177}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"stepForClustering",2064}, + {""}, {""}, + {"southEastLatitudeOfLPOArea",2025}, + {""}, {""}, + {"gts_ddhh00",914}, {""}, - {"skew",2014}, + {"dimensionType",678}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"numberOfGroupsOfDataValues",1387}, + {""}, {""}, {""}, {""}, {""}, + {"numberOfDistinctSection4s",1369}, {""}, {""}, - {"mars_labeling",1214}, - {"sp3",2031}, - {"monthOfModelVersion",1291}, - {"secondOrderOfDifferentWidth",1904}, + {"extractDateTimeHourEnd",799}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"qualityControl",1702}, + {"cavokOrVisibility",382}, + {"GDSPresent",69}, + {""}, {""}, + {"rdbtimeYear",1732}, {""}, - {"jIncrement",1019}, + {"formatVersionMinorNumber",866}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"parametersVersion",1620}, {""}, - {"extractDateTimeYearEnd",810}, + {"firstDimensionPhysicalSignificance",841}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"localYear",1141}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"widthOfLengths",2308}, + {""}, {""}, {""}, + {"legacyGaussSubarea",1080}, + {"numberOfClusterLowResolution",1350}, {""}, {""}, {""}, - {"rdbtimeHour",1722}, - {"eastLongitudeOfCluster",703}, + {"earthMinorAxisInMetres",705}, + {""}, {""}, + {"timeRangeIndicator",2146}, + {""}, {""}, {""}, {""}, + {"swapScanningLon",2095}, + {""}, {""}, {""}, + {"numberOfDistinctSection3s",1368}, + {""}, {""}, {""}, {""}, {""}, + {"LcxInMetres",119}, {""}, - {"nameOfFirstFixedSurface",1305}, - {"tiggeLAMName",2122}, + {"LcyInMetres",121}, + {"directionOfVariation",681}, + {""}, {""}, + {"is_aerosol_optical",1001}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"southEastLongitudeOfVerficationArea",2028}, + {""}, {""}, + {"sectionLengthLimitForProbability",1968}, + {"LuxInMetres",146}, + {"indexedStorageInternalNodeK",956}, + {"LuyInMetres",148}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"is_chemical_distfn",1003}, + {"spatialSmoothingOfProduct",2042}, + {""}, {""}, {""}, {""}, {""}, + {"reserved3",1765}, {""}, - {"southLatitudeOfCluster",2024}, + {"typicalYear",2218}, + {""}, {""}, + {"perturbedType",1637}, + {"swapScanningLat",2094}, {""}, {""}, {""}, {""}, {""}, - {"addressOfFileFreeSpaceInfo",292}, + {"numberOfForecastsInTheCluster",1381}, + {""}, {""}, + {"totalInitialConditions",2153}, + {"sizeOfPostAuxiliaryArray",2017}, + {""}, + {"uuidOfVGrid",2257}, + {""}, + {"percentileValue",1633}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"secondaryMissingValue",1917}, + {""}, {""}, {""}, + {"TIDE",231}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"driverInformationBlockAddress",694}, + {"productIdentifier",1691}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"constantFieldHalfByte",566}, + {""}, {""}, + {"grib2LocalSectionPresent",889}, + {"groupInternalNodeK",905}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"experimentVersionNumber",777}, + {""}, {""}, {""}, + {"section2Present",1936}, + {""}, + {"multiplicationFactorForLatLong",1300}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"resolutionAndComponentFlags",1766}, + {""}, {""}, + {"clusterIdentifier",525}, {""}, - {"driverInformationBlockAddress",691}, - {"extremeClockwiseWindDirection",819}, + {"observationGeneratingProcessIdentifier",1454}, + {"section4Pointer",1946}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"headersOnly",918}, {""}, {""}, - {"clusteringDomain",537}, - {""}, {""}, {""}, {""}, {""}, - {"rectimeHour",1735}, + {"METAR",154}, + {""}, + {"boot_edition",367}, + {""}, {""}, + {"oceanAtmosphereCoupling",1458}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"lengthOfOriginatorLocalTemplate",1087}, + {""}, {""}, + {"radiusOfCentralCluster",1715}, + {""}, + {"iDirectionIncrementGiven",938}, + {""}, {""}, {""}, + {"biFourierCoefficients",351}, + {"numberOfParallelsBetweenAPoleAndTheEquator",1405}, + {"biFourierResolutionParameterM",354}, + {"grib2LocalSectionNumber",888}, + {"rdbtimeMonth",1729}, + {""}, + {"section10Length",1925}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"visibilityInKilometresTrend4",2296}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"jIncrement",1022}, + {""}, + {"nameOfFirstFixedSurface",1308}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"gaussianGridName",876}, + {"roundedMarsLongitude",1784}, + {""}, + {"startStepInHours",2056}, {""}, {""}, {""}, - {"gridDefinitionSection",896}, + {"sfc_levtype",1999}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"longitudeOfLastGridPoint",1156}, + {""}, + {"section3Pointer",1941}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"DELETE",25}, {""}, {""}, {""}, - {"table2Version",2096}, + {"_anoffset",286}, + {"correction1",596}, {""}, {""}, - {"typeOfFirstFixedSurface",2183}, - {"SecondOfModelVersion",222}, + {"endOfMessage",742}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"variationOfVisibility",2262}, {""}, - {"simpleThinningSkip",2004}, + {"latitudeOfIcosahedronPole",1051}, + {""}, + {"variationOfVisibilityDirection",2263}, + {""}, {""}, {""}, + {"secondaryMissingValueSubstitute",1918}, + {"bitMapIndicator",361}, {""}, {""}, {""}, {""}, - {"local_padding",1139}, + {"variationOfVisibilityDirectionAngle",2264}, + {"default_max_val",662}, + {""}, + {"visibilityInKilometresTrend3",2295}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"typicalMonth",2215}, + {""}, {""}, {""}, {""}, {""}, + {"typeOfFirstFixedSurface",2188}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"typeOfHorizontalLine",2191}, {""}, - {"numberOfLogicals",1390}, - {""}, {""}, {""}, {""}, - {"Yo",277}, + {"extractAreaSouthLatitude",793}, + {""}, {""}, + {"ijDirectionIncrementGiven",951}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"endMinuteTrend4",731}, + {"matchLandType",1225}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"endGridDefinition",725}, + {""}, {""}, + {"marsStream1",1212}, + {"numberOfCoefficientsOrValuesUsedToSpecifyFirstDimensionCoordinateFunction",1353}, + {"numberOfCoefficientsOrValuesUsedToSpecifySecondDimensionCoordinateFunction",1354}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"stepUnits",2071}, + {""}, {""}, + {"horizontalDomainTemplate",926}, + {""}, {""}, {""}, + {"startOfHeaders",2052}, + {""}, {""}, {""}, + {"deleteCalendarId",666}, + {"xCoordinateOfSubSatellitePoint",2339}, + {""}, + {"yCoordinateOfSubSatellitePoint",2346}, + {""}, {""}, + {"subcentreOfAnalysis",2090}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"codedNumberOfGroups",546}, + {""}, + {"xDirectionGridLength",2340}, + {""}, + {"yDirectionGridLength",2347}, + {""}, + {"longitudeOfSubSatellitePoint",1166}, + {""}, {""}, + {"gribTablesVersionNo",894}, + {""}, {""}, {""}, {""}, {""}, + {"MinuteOfModelVersion",157}, {""}, {""}, {""}, - {"Yp",278}, + {"numberOfDataPointsExpected",1363}, + {"firstDimensionCoordinateValueDefinition",840}, + {"longitudeOfSubSatellitePointInDegrees",1167}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"listOfParametersUsedForClustering",1111}, + {"remarkPresent",1757}, + {""}, {""}, {""}, {""}, + {"templatesMasterDir",2115}, {""}, - {"numberOfClusterLowResolution",1347}, + {"scaleFactorOfPrimeMeridianOffset",1857}, {""}, {""}, {""}, {""}, - {"inputProcessIdentifier",966}, + {"scaleFactorOfFirstWavelength",1851}, {""}, {""}, {""}, {""}, - {"section10Length",1920}, + {"Dj",35}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"centralLongitudeInMicrodegrees",396}, + {""}, + {"gribMasterTablesVersionNumber",893}, + {"numberOfClusterHighResolution",1349}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"WRAPstr",261}, {""}, {""}, {""}, {""}, {""}, - {"section1Pointer",1927}, + {"dataSubCategory",629}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"unitsBias",2230}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"sizeOfLength",2015}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"keyMore",1025}, + {"scaleFactorOfLengthOfSemiMajorAxis",1852}, + {""}, {""}, + {"scaleFactorOfLengthOfSemiMinorAxis",1853}, + {"Nj",195}, + {"totalNumberOfGridPoints",2161}, {""}, - {"biFourierCoefficients",350}, - {"scaledValueOfDistanceFromEnsembleMean",1864}, - {"spatialSmoothingOfProduct",2037}, + {"southEastLongitudeOfLPOArea",2027}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"coordAveragingTims",573}, + {""}, {""}, + {"forecastPeriodFrom",859}, + {""}, {""}, {""}, {""}, + {"local_padding",1142}, + {"operationalForecastCluster",1512}, {""}, - {"operationalForecastCluster",1509}, - {"instrumentType",970}, + {"typeOfEnsembleForecast",2186}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"cfVarNameECMF",407}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"longitudeOfSouthernPole",1162}, {""}, {""}, - {"dateOfAnalysis",633}, - {"localHour",1122}, + {"recentWeather",1736}, + {""}, + {"addressOfFileFreeSpaceInfo",294}, + {""}, {""}, {""}, + {"cloudsTitle1",505}, + {"mars_labeling",1217}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"section3Flags",1938}, {""}, - {"doSimpleThinning",689}, + {"stepRangeInHours",2067}, {""}, {""}, - {"listOfParametersUsedForClustering",1108}, + {"deleteLocalDefinition",668}, + {"coordinate3OfLastGridPoint",582}, + {"XRInMetres",267}, + {""}, {""}, {""}, {""}, + {"endDayTrend1",720}, + {"selectStepTemplateInstant",1990}, + {""}, + {"tiggeLocalVersion",2128}, {""}, - {"offsetAfterCentreLocalSection",1461}, + {"biFourierResolutionSubSetParameterM",356}, + {"originatingCentreOfAnalysis",1526}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"sp1",2034}, {""}, {""}, - {"timeOfAnalysis",2137}, - {"unpackedError",2235}, + {"primaryBitmap",1677}, + {"wrongPadding",2337}, + {""}, {""}, {""}, {""}, + {"templatesLocalDir",2114}, {""}, {""}, - {"unitsOfFirstFixedSurface",2231}, + {"shapeOfTheEarth",2000}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"YR",275}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"yearOfAnalysis",2348}, + {"windUnits",2327}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"numberOfDistinctSection5s",1370}, + {""}, {""}, {""}, {""}, + {"section1Pointer",1932}, + {""}, {""}, {""}, {""}, {""}, + {"expandBy",763}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"MonthOfModelVersion",168}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"section1",1924}, + {""}, {""}, {""}, {""}, {""}, + {"mask",1218}, {""}, {""}, {""}, - {"reserved3",1760}, - {""}, - {"latitudeOfNorthWestCornerOfArea",1051}, + {"windDirectionTrend4",2315}, {""}, {""}, {""}, {""}, {""}, - {"typicalHour",2208}, + {"LLCOSP",100}, {""}, - {"rdbtimeYear",1727}, + {"NUT",187}, {""}, {""}, - {"WMO",257}, - {""}, {""}, {""}, {""}, {""}, - {"section9Length",1959}, + {"visibilityInKilometresTrend1",2293}, {""}, {""}, {""}, - {"typeOfAnalysis",2176}, - {"distinctLongitudes",685}, + {"nameECMF",1307}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"offsetAfterBitmap",1463}, + {""}, {""}, {""}, + {"getNumberOfValues",883}, {""}, {""}, {""}, {""}, {""}, {""}, - {"unitsConversionScaleFactor",2227}, + {"kindOfProduct",1030}, + {""}, + {"horizontalDomainTemplateNumber",927}, {""}, {""}, {""}, - {"section0Length",1917}, + {"isotopeIdentificationNumber",1014}, + {"iDirectionIncrementGridLength",939}, + {"pack",1531}, + {""}, {""}, {""}, {""}, + {"dummy1",696}, + {""}, {""}, {""}, {""}, + {"numberOfContributingSpectralBands",1357}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"secondsOfAnalysis",1914}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"falseEasting",831}, + {""}, {""}, {""}, + {"unitsECMF",2234}, {""}, {""}, {""}, {""}, {""}, - {"parametersVersion",1615}, + {"numberOfPointsAlongXAxis",1415}, {""}, - {"longitudeOfLastGridPointInDegrees",1154}, - {"projectLocalTemplate",1689}, + {"legBaseTime",1078}, + {"presentTrend4",1659}, + {"numberIncludedInAverage",1335}, {""}, - {"longitudeOfThePoleOfStretching",1166}, - {"jDirectionIncrement",1015}, + {"horizontalDimensionProcessed",925}, {""}, {""}, - {"longitudeOfStretchingPoleInDegrees",1162}, - {"numberIncludedInAverage",1332}, - {"secondaryMissingValue",1912}, - {"section4Pointer",1941}, + {"frequencyScalingFactor",870}, + {""}, {""}, {""}, + {"marsType1",1215}, + {"scaleFactorOfSecondWavelength",1861}, {""}, - {"packingError",1530}, + {"scaledValueOfPrimeMeridianOffset",1881}, {""}, {""}, {""}, {""}, - {"coordinate2Start",578}, - {"visibilityInKilometresTrend3",2290}, + {"scaledValueOfFirstWavelength",1875}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"latitudeOfLastGridPointInDegrees",1053}, + {"unpack",2239}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"verticalVisibilityCoded",2286}, + {"expandedUnits",776}, {""}, {""}, {""}, {""}, - {"longitudeOfNorthWestCornerOfArea",1155}, - {""}, {""}, {""}, - {"heightPressureEtcOfLevels",918}, - {""}, {""}, {""}, - {"codedNumberOfGroups",545}, - {"numberOfClusterHighResolution",1346}, + {"localTablesVersion",1138}, + {""}, + {"longitudeOfFirstDiamondCenterLine",1151}, {""}, {""}, {""}, {""}, - {"projectLocalTemplateNumber",1690}, - {"centuryOfAnalysis",400}, - {"firstDimensionPhysicalSignificance",839}, - {"nameOfSecondFixedSurface",1306}, + {"pressureUnits",1676}, {""}, {""}, - {"lengthIncrementForTheGroupLengths",1079}, - {""}, {""}, {""}, {""}, - {"sphericalHarmonics",2042}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"latitudeOfFirstGridPoint",1046}, + {"lengthOfHeaders",1084}, {""}, {""}, - {"probabilityType",1678}, - {""}, {""}, {""}, {""}, - {"hourOfAnalysis",926}, + {"longitudeOfFirstDiamondCenterLineInDegrees",1152}, {""}, {""}, - {"isotopeIdentificationNumber",1011}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"md5Section5",1239}, - {""}, {""}, {""}, {""}, - {"localYear",1138}, + {"N1",170}, + {""}, + {"NrInRadiusOfEarth",197}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"northWestLatitudeOfVerficationArea",1322}, {""}, {""}, - {"typeOfSecondFixedSurface",2197}, + {"reserved1",1763}, {""}, {""}, {""}, {""}, - {"extractDateTimeHourEnd",797}, + {"coordinate4OfLastGridPoint",585}, + {"typeOfProcessedData",2200}, {""}, {""}, {""}, - {"NC",172}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"resolutionAndComponentFlags8",1773}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"typicalYear",2213}, + {"produceLargeConstantFields",1686}, + {"scaledValueOfLengthOfSemiMajorAxis",1876}, + {"windDirectionTrend3",2314}, {""}, - {"section2Pointer",1930}, - {""}, {""}, {""}, - {"METARstr",153}, - {"scaledValueOfFirstFixedSurface",1868}, + {"scaledValueOfLengthOfSemiMinorAxis",1877}, + {"correction3",600}, + {"firstOrderValues",846}, + {""}, + {"latitudeOfStretchingPoleInDegrees",1061}, {""}, {""}, {""}, {""}, {""}, - {"localDefNumberTwo",1115}, + {"section5Pointer",1950}, {""}, - {"secondaryMissingValueSubstitute",1913}, - {"sp1",2029}, + {"monthOfEndOfOverallTimeInterval",1292}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"missingDataFlag",1275}, + {"tigge_short_name",2133}, {""}, {""}, {""}, - {"LLCOSP",98}, + {"gridDefinitionDescription",898}, {""}, - {"latitudeLongitudeValues",1042}, - {""}, {""}, {""}, {""}, {""}, - {"numberOfDistinctSection5s",1367}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"startingAzimuth",2053}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfDataPointsExpected",1360}, - {"unitsBias",2225}, - {"sampleSizeOfModelClimate",1833}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"endGridDefinition",722}, - {"averaging1Flag",316}, + {"La1",102}, {""}, - {"templatesMasterDir",2110}, - {""}, {""}, {""}, - {"southEastLongitudeOfVerficationArea",2023}, - {"totalNumberOfGridPoints",2156}, + {"satelliteID",1839}, + {""}, {""}, + {"generalExtended2ordr",878}, + {""}, {""}, + {"legBaseDate",1077}, {""}, - {"NUT",185}, - {""}, {""}, {""}, - {"percentileValue",1628}, - {"indicatorOfUnitForTimeIncrement",958}, + {"Lar1",109}, {""}, {""}, {""}, {""}, - {"yearOfEndOfOverallTimeInterval",2350}, + {"Latin1",114}, + {"DjInDegrees",37}, + {"Lo1",123}, + {""}, {""}, {""}, {""}, {""}, + {"runwayDepositState4",1796}, {""}, - {"visibilityInKilometresTrend1",2288}, + {"numberOfDistinctSection6s",1371}, + {"extractAreaEastLongitude",789}, + {"Lor1",141}, + {""}, {""}, {""}, {""}, {""}, + {"northWestLatitudeOfLPOArea",1321}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"latitudeOfTangencyPoint",1064}, + {""}, {""}, {""}, + {"yearOfEndOfOverallTimeInterval",2355}, {""}, - {"experimentVersionNumber",775}, + {"secondOrderFlags",1908}, {""}, - {"dummy1",693}, - {""}, {""}, {""}, - {"extractDateTimeStart",809}, - {"II",88}, - {""}, {""}, - {"section1",1919}, - {""}, {""}, {""}, - {"correction2",597}, + {"easternLongitudeOfClusterDomain",708}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"typeOfProcessedData",2195}, - {""}, {""}, {""}, {""}, {""}, - {"satelliteID",1834}, + {"presentTrend3",1658}, {""}, {""}, - {"extractDateTimeSecondEnd",806}, + {"selectStepTemplateInterval",1991}, + {"NRj",185}, + {""}, {""}, {""}, {""}, + {"section2Pointer",1935}, {""}, - {"marsStream2",1210}, - {"iDirectionIncrementGiven",935}, + {"section1Flags",1929}, {""}, {""}, {""}, - {"section8Length",1956}, - {"primaryBitmap",1672}, - {"directionOfVariation",678}, - {"monthOfEndOfOverallTimeInterval",1289}, + {"_numberOfValues",288}, + {"secondaryBitmap",1912}, {""}, - {"subdivisionsOfBasicAngle",2086}, - {"coordinate3OfLastGridPoint",581}, - {""}, {""}, {""}, - {"extractDateTimeSecondStart",808}, - {""}, {""}, {""}, - {"NrInRadiusOfEarth",195}, + {"listOfEnsembleForecastNumbers",1109}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"generalExtended2ordr",876}, - {""}, - {"PUnset",208}, - {""}, {""}, {""}, {""}, - {"expandBy",761}, + {"bufrHeaderCentre",372}, {""}, - {"referenceOfLengths",1744}, - {"DjInDegrees",36}, + {"numberOfPointsAlongAMeridian",1409}, {""}, - {"numberOfDistinctSection3s",1365}, + {"heightPressureEtcOfLevels",921}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"spaceUnitFlag",2037}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"averaging1Flag",317}, + {"visibilityInKilometresTrend2",2294}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"scaleFactorOfCentralWaveNumber",1844}, + {"representationType",1760}, + {"versionOfModelClimate",2285}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfCoordinatesValues",1356}, - {""}, - {"marsType1",1212}, + {"temperatureAndDewpointPresent",2113}, {""}, - {"forecastOrSingularVectorNumber",855}, - {"Lar1InDegrees",108}, + {"hourOfEndOfOverallTimeInterval",930}, + {""}, {""}, {""}, {""}, {""}, + {"fileConsistencyFlags",838}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"selectStepTemplateInstant",1985}, + {"correction4",602}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"northWestLongitudeOfVerficationArea",1324}, + {""}, {""}, {""}, {""}, {""}, + {"crraSuiteID",613}, + {""}, {""}, {""}, {""}, {""}, + {"DjGiven",36}, + {"timeRangeIndicatorFromStepRange",2147}, {""}, {""}, {""}, - {"windUnits",2322}, + {"disableGrib1LocalSection",684}, {""}, {""}, - {"Lor1InDegrees",140}, + {"cloudsTitle1Trend4",509}, {""}, {""}, {""}, {""}, {""}, - {"endOfMessage",739}, - {""}, {""}, {""}, {""}, {""}, - {"postAuxiliaryArrayPresent",1642}, - {"reserved1",1758}, - {"tigge_short_name",2128}, + {"longitudeOfFirstGridPointInDegrees",1154}, + {""}, {""}, {""}, + {"scaleFactorOfEarthMajorAxis",1847}, + {"numberOfMissing",1396}, + {"latitudeOfSouthernPoleInDegrees",1059}, + {"scaleFactorOfEarthMinorAxis",1848}, {""}, {""}, {""}, {""}, - {"visibilityInKilometresTrend4",2291}, + {"runwayDepositState3",1795}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"meanRVR4",1252}, + {""}, {""}, + {"section5",1948}, {""}, - {"constantFieldHalfByte",565}, - {""}, - {"stepForClustering",2059}, + {"monthlyVerificationYear",1299}, + {"iScansNegatively",942}, + {"offsetSection4",1488}, {""}, {""}, {""}, - {"hourOfEndOfOverallTimeInterval",927}, + {"sizeOfPostAuxiliaryArrayPlusOne",2018}, {""}, - {"gaussianGridName",874}, - {"crraSuiteID",612}, + {"scaledValueOfSecondWavelength",1885}, + {"flagForAnyFurtherInformation",848}, {""}, {""}, - {"numberOfPointsAlongXAxis",1412}, - {""}, - {"remarkPresent",1752}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfCodedValues",1349}, - {"numberOfVerticalCoordinateValues",1443}, + {"numberOfPointsInDomain",1419}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"gribTablesVersionNo",891}, + {"section6Pointer",1954}, {""}, {""}, {""}, - {"monthOfAnalysis",1288}, + {"default_min_val",663}, {""}, {""}, - {"La1InDegrees",101}, + {"cloudsTitle3",515}, {""}, {""}, {""}, {""}, - {"westLongitudeOfCluster",2298}, - {"scaleFactorOfLengthOfSemiMajorAxis",1847}, - {""}, - {"coordinate4OfLastGridPoint",584}, + {"inputProcessIdentifier",969}, {""}, {""}, - {"scaleFactorOfLengthOfSemiMinorAxis",1848}, - {""}, {""}, {""}, - {"Lo1InDegrees",122}, - {""}, {""}, {""}, {""}, {""}, - {"variationOfVisibility",2257}, - {""}, {""}, {""}, - {"averaging2Flag",317}, + {"dayOfTheYearDate",650}, + {""}, + {"cloudsTitle1Trend3",508}, + {"scaleFactorOfMajorAxisOfOblateSpheroidEarth",1855}, {""}, {""}, {""}, - {"correction1",595}, + {"secondaryBitmapPresent",1913}, {""}, {""}, {""}, {""}, {""}, - {"endDayTrend2",718}, - {"simpleThinningStart",2005}, - {""}, {""}, {""}, {""}, {""}, - {"marsStream1",1209}, - {""}, - {"is_ocean3d_param",1003}, + {"endDayTrend3",722}, + {"secondaryBitmaps",1914}, {""}, - {"visibilityInKilometresTrend2",2289}, - {""}, - {"ijDirectionIncrementGiven",948}, + {"Lar1InDegrees",110}, + {""}, {""}, {""}, + {"localTablesVersionNumber",1139}, + {"J",94}, {""}, - {"classOfAnalysis",419}, + {"orderOfSpatialDifferencing",1518}, + {"numberOfPointsAlongAParallel",1410}, {""}, - {"coordinate1Start",575}, + {"numberOfDistinctSection7s",1372}, + {""}, {""}, {""}, {""}, {""}, + {"n2",1303}, + {"Lor1InDegrees",142}, + {""}, {""}, {""}, {""}, + {"mixedCoordinateFieldFlag",1281}, {""}, - {"sectionLengthLimitForEnsembles",1962}, - {""}, {""}, - {"numberOfForecastsInCluster",1376}, + {"swapScanningX",2096}, {""}, - {"section4",1938}, + {"beginDayTrend4",334}, {""}, {""}, {""}, {""}, - {"METAR",152}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"N1",168}, + {"halfByte",916}, + {""}, {""}, {""}, + {"is_ocean3d_param",1006}, {""}, {""}, - {"variationOfVisibilityDirection",2258}, + {"lengthIncrementForTheGroupLengths",1082}, + {""}, {""}, {""}, + {"extractDateTimeDayStart",797}, + {""}, {""}, {""}, {""}, + {"sp2",2035}, {""}, - {"pressureUnits",1671}, - {"unpackedValues",2237}, - {""}, {""}, - {"variationOfVisibilityDirectionAngle",2259}, + {"westernLongitudeOfClusterDomain",2305}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"expandedCrex_scales",766}, {""}, - {"normAtFinalTime",1313}, - {"legBaseTime",1075}, + {"localFlagLatestVersion",1124}, + {"secondaryBitmapsCount",1915}, + {"clusterMember4",530}, {""}, - {"deleteCalendarId",663}, - {""}, {""}, - {"typeOfHorizontalLine",2186}, + {"flagShowingPostAuxiliaryArrayInUse",851}, {""}, {""}, {""}, {""}, - {"sectionLengthLimitForProbability",1963}, - {""}, - {"YR",273}, + {"spare2",2040}, + {""}, {""}, {""}, {""}, + {"indicatorOfUnitForTimeIncrement",961}, + {"expandedCrex_units",767}, + {""}, {""}, {""}, {""}, + {"NG",178}, + {""}, {""}, {""}, {""}, + {"numberOfPointsAlongSecondAxis",1412}, + {"unitOfTimeRange",2228}, {""}, - {"gribMasterTablesVersionNumber",890}, - {"legBaseDate",1074}, - {""}, {""}, {""}, - {"shapeOfVerificationArea",1996}, + {"flagForNormalOrStaggeredGrid",850}, {""}, {""}, {""}, {""}, - {"Lar2InDegrees",110}, - {""}, {""}, - {"roundedMarsLongitude",1779}, + {"coordinateIndexNumber",588}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"La1InDegrees",103}, + {""}, {""}, {""}, {""}, + {"correction2",598}, + {"PUnset",210}, + {""}, {""}, {""}, {""}, {""}, + {"meanRVR3",1251}, + {""}, {""}, {""}, {""}, + {"Lo1InDegrees",124}, {""}, - {"scaleFactorOfLowerLimit",1849}, + {"offsetSection3",1487}, + {"scanningMode4",1892}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"gts_TTAAii",913}, {""}, - {"timeRangeIndicatorFromStepRange",2142}, + {"averaging2Flag",318}, + {"coordinate1End",574}, {""}, {""}, {""}, - {"longitudeOfFirstGridPointInDegrees",1151}, + {"localLatitude1",1127}, + {""}, {""}, {""}, {""}, + {"pentagonalResolutionParameterK",1631}, {""}, {""}, {""}, - {"Lor2InDegrees",142}, - {""}, {""}, - {"probabilityTypeName",1679}, + {"qnhUnits",1706}, + {"X1",262}, {""}, {""}, {""}, - {"expandedUnits",774}, + {"cloudsTitle4",520}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"offsetAfterData",1465}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"spaceUnitFlag",2032}, - {""}, {""}, - {"cloudsTitle2",509}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"n2",1300}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"La1",100}, + {""}, {""}, {""}, + {"endDayTrend4",723}, + {"cloudsAbbreviation4",440}, {""}, - {"Lar1",107}, + {"dummy2",697}, + {""}, {""}, + {"scaledValueOfCentralWaveNumber",1868}, + {""}, {""}, + {"windVariableDirectionTrend4",2336}, + {"md5Section5",1242}, + {"latitudeFirstInDegrees",1043}, + {"parameterUnits",1618}, {""}, - {"NEAREST",175}, + {"jPointsAreConsecutive",1023}, {""}, {""}, - {"numberOfDistinctSection4s",1366}, - {"swapScanningLon",2090}, + {"marsStream2",1213}, + {""}, {""}, {""}, {""}, + {"typeOfPacking",2197}, {""}, {""}, - {"numberOfPointsInDomain",1416}, - {""}, {""}, {""}, - {"Lo1",121}, - {"formatVersionMinorNumber",864}, - {"Lor1",139}, - {"Latin1",112}, - {""}, {""}, {""}, - {"centralLongitudeInMicrodegrees",395}, + {"beginDayTrend3",333}, + {"longitudeLastInDegrees",1147}, {""}, {""}, {""}, {""}, {""}, - {"sp2",2030}, - {""}, {""}, {""}, {""}, - {"grib2LocalSectionPresent",887}, - {""}, - {"pentagonalResolutionParameterK",1626}, + {"calendarIdentification",377}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"spare2",2035}, - {""}, {""}, {""}, {""}, - {"endDayTrend1",717}, - {"startOfHeaders",2047}, + {"dateSSTFieldUsed",641}, + {"numberOfMissingInStatisticalProcess",1397}, {""}, - {"backgroundGeneratingProcessIdentifier",321}, + {"marsType2",1216}, + {""}, {""}, {""}, {""}, + {"WRAP",260}, + {""}, {""}, + {"numberOfPointsAlongFirstAxis",1411}, + {""}, {""}, + {"section7Pointer",1958}, + {""}, {""}, + {"clusterMember3",529}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"kindOfProduct",1027}, - {""}, - {"rdbtimeMonth",1724}, - {""}, - {"section6Pointer",1949}, - {"section_10",1976}, + {"longitudeOfReferencePoint",1159}, + {""}, {""}, + {"scaledValueOfEarthMajorAxis",1871}, + {""}, {""}, + {"scaledValueOfEarthMinorAxis",1872}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"selectStepTemplateInterval",1986}, + {"tsectionNumber3",2173}, + {""}, {""}, + {"mixedCoordinateDefinition",1280}, + {"isectionNumber3",1012}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"deleteLocalDefinition",665}, {""}, - {"temperatureAndDewpointPresent",2108}, + {"N2",171}, {""}, {""}, - {"latitudeOfIcosahedronPole",1048}, + {"preBitmapValues",1649}, {""}, - {"dataSubCategory",628}, - {"packedValues",1529}, - {""}, {""}, - {"grib2LocalSectionNumber",886}, + {"is_rotated_grid",1007}, + {""}, {""}, {""}, {""}, {""}, + {"section4Length",1944}, + {"reserved2",1764}, {""}, - {"dummy2",694}, + {"latitudeOfCentralPointInClusterDomain",1048}, + {""}, {""}, {""}, + {"conceptsMasterDir",560}, {""}, {""}, - {"legacyGaussSubarea",1077}, + {"resolutionAndComponentFlags4",1775}, + {""}, {""}, + {"ITERATOR",92}, + {""}, {""}, {""}, {""}, + {"Lar2InDegrees",112}, {""}, {""}, {""}, {""}, {""}, {""}, - {"missingDataFlag",1272}, - {"subDefinitions1",2074}, + {"typeOfOriginalFieldValues",2196}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"Lor2InDegrees",144}, + {""}, {""}, {""}, {""}, + {"scaledValueOfMajorAxisOfOblateSpheroidEarth",1879}, {""}, - {"is_s2s",1005}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfForecastsInTheCluster",1378}, + {"La2",104}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"northWestLongitudeOfLPOArea",1323}, {""}, {""}, - {"AA",6}, - {"sizeOfOffsets",2011}, + {"Lar2",111}, + {""}, {""}, + {"expandedCrex_widths",768}, {""}, - {"swapScanningLat",2089}, - {"radiusOfCentralCluster",1710}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"scaleFactorOfFirstWavelength",1846}, - {"P1",205}, + {"Latin2",116}, + {""}, + {"Lo2",125}, + {""}, {""}, {""}, {""}, + {"cloudsAbbreviation3",435}, + {"P1",207}, + {""}, {""}, {""}, + {"Lor2",143}, + {""}, {""}, + {"windVariableDirectionTrend3",2335}, + {"section4Padding",1945}, + {""}, {""}, {""}, + {"cloudsTitle1Trend1",506}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"section3Length",1939}, + {""}, {""}, {""}, + {"subSetJ",2087}, + {""}, {""}, {""}, {""}, {""}, + {"resolutionAndComponentFlags3",1774}, + {"cfNameECMF",405}, {""}, {""}, {""}, {""}, {""}, {""}, - {"expandedCrex_units",765}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"expandedCrex_scales",764}, + {"cloudsTitle2",510}, {""}, {""}, {""}, {""}, - {"wrongPadding",2332}, + {"windSpeedTrend1",2323}, {""}, - {"DELETE",25}, + {"calendarIdentificationTemplateNumber",378}, + {"codedNumberOfFirstOrderPackedValues",545}, + {""}, {""}, {""}, {""}, + {"BufrTemplate",20}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"coordAveraging0",569}, + {"endDayTrend2",721}, + {""}, {""}, {""}, {""}, + {"md5Section6",1243}, {""}, {""}, {""}, {""}, {""}, - {"marsType2",1213}, + {"xDirectionGridLengthInMetres",2341}, {""}, - {"frequencyScalingFactor",868}, + {"yDirectionGridLengthInMetres",2348}, + {"runwayDesignatorState4",1812}, + {""}, {""}, {""}, {""}, + {"typeOfGeneratingProcess",2189}, + {"ls_labeling",1181}, + {""}, {""}, {""}, {""}, + {"probProductDefinition",1682}, + {"verificationYear",2276}, + {"beginMinuteTrend4",342}, + {""}, {""}, {""}, {""}, {""}, + {"windDirectionTrend1",2312}, + {"section3Padding",1940}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"numberOfSingularVectorsEvolved",1432}, + {""}, {""}, {""}, + {"radiusOfClusterDomain",1716}, + {""}, {""}, {""}, + {"DjInMetres",38}, + {"rdb_key",1723}, {""}, {""}, - {"cloudsTitle1",504}, - {""}, - {"latitudeOfSouthernPoleInDegrees",1056}, + {"qualityControlIndicator",1708}, {""}, - {"typeOfSizeInterval",2198}, + {"subLocalDefinition1",2081}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"widthOfLengths",2303}, + {"section6",1952}, + {"flagForIrregularGridCoordinateList",849}, + {""}, + {"firstLatitudeInDegrees",843}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"unitOfTimeRange",2223}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"md5GridSection",1234}, {""}, {""}, - {"reserved2",1759}, + {"is_s2s",1008}, + {""}, {""}, {""}, {""}, + {"numberOfUsedTileAttributes",1441}, + {""}, {""}, {""}, {""}, + {"uvRelativeToGrid",2258}, {""}, {""}, - {"halfByte",913}, - {"section7Pointer",1953}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"fileConsistencyFlags",836}, - {""}, - {"typicalMonth",2210}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"scaledValueOfPrimeMeridianOffset",1876}, + {"runwayDesignatorState3",1811}, {""}, {""}, - {"shapeOfTheEarth",1995}, + {"CLNOMA",24}, {""}, {""}, - {"southEastLatitudeOfVerficationArea",2021}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"secondOrderFlags",1903}, - {"qnhUnits",1701}, - {"southEastLatitudeOfLPOArea",2020}, + {"mBasicAngle",1185}, + {"offsetEndSection4",1477}, + {""}, {""}, {""}, {""}, {""}, + {"beginMinuteTrend3",341}, + {"realPartOf00",1734}, {""}, {""}, {""}, {""}, {""}, - {"latitudeWhereDxAndDyAreSpecified",1067}, + {"presentTrend1",1656}, {""}, {""}, {""}, {""}, {""}, - {"is_ocean2d_param",1002}, + {"inputOverriddenReferenceValues",968}, + {""}, {""}, {""}, {""}, + {"dateOfSSTFieldUsed",640}, {""}, - {"Dj",34}, - {"md5Section6",1240}, - {"correction3",599}, - {"latitudeFirstInDegrees",1040}, + {"RENAME",216}, {""}, {""}, {""}, - {"scaleFactorOfSecondWavelength",1856}, - {"latitudeWhereDxAndDyAreSpecifiedInDegrees",1068}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"WRAPstr",259}, - {"tiggeLocalVersion",2123}, - {""}, - {"lengthOfOriginatorLocalTemplate",1084}, + {"windSpeedTrend3",2325}, + {"endStepInHours",746}, {""}, {""}, - {"windSpeedTrend1",2318}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"xDirectionGridLengthInMillimetres",2342}, + {"iScansPositively",943}, + {"yDirectionGridLengthInMillimetres",2349}, + {"widthOfWidths",2310}, + {"stepInHours",2065}, {""}, {""}, {""}, {""}, - {"dateSSTFieldUsed",640}, + {"dateOfAnalysis",634}, + {""}, {""}, {""}, {""}, + {"numberOfUnexpandedDescriptors",1438}, + {"matchAerosolBinNumber",1223}, + {"section_10",1981}, + {"dataCategory",617}, + {"timeOfAnalysis",2142}, + {"offsetSection10",1484}, + {"numberOfBits",1338}, + {"longitudeOfCentralPointInClusterDomain",1150}, + {""}, {""}, + {"secondaryBitmapsSize",1916}, + {""}, {""}, {""}, + {"cloudsTitle2Trend4",514}, + {""}, {""}, + {"beginHourTrend4",338}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"parameterUnits",1613}, + {"qfeUnits",1702}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"experimentVersionNumberOfAnalysis",780}, + {""}, {""}, {""}, + {"theHindcastMarsStream",2116}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"section11Pointer",1928}, {""}, {""}, - {"templatesLocalDir",2109}, + {"marsKeywords1",1199}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"typeOfSSTFieldUsed",2201}, {""}, {""}, {""}, - {"offsetSection5",1486}, + {"matrixBitmapsPresent",1228}, + {""}, + {"yearOfAnalysis",2353}, + {""}, {""}, {""}, {""}, + {"numberOfOctectsForNumberOfPoints",1401}, + {"longitudeOfThePolePointInDegrees",1171}, + {"typeOfWavelengthInterval",2208}, {""}, {""}, - {"is_rotated_grid",1004}, - {"getNumberOfValues",881}, + {"subDefinitions1",2079}, + {"backgroundGeneratingProcessIdentifier",322}, + {""}, + {"typeOfAnalysis",2181}, + {"localLongitude1",1130}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"cloudsTitle1Trend2",507}, + {""}, + {"cloudsTitle2Trend3",513}, + {"minutesAfterReferenceTimeOfDataCutoff",1274}, + {"runwayDepositState1",1793}, {""}, {""}, {""}, {""}, - {"versionOfModelClimate",2280}, - {"longitudeLastInDegrees",1144}, + {"md5Section7",1244}, {""}, {""}, {""}, - {"typeOfOriginalFieldValues",2191}, - {"iDirectionIncrementGridLength",936}, + {"isectionNumber2",1011}, + {"longitudeOfTheSouthernPoleOfProjection",1172}, + {""}, {""}, + {"extractDateTimeEnd",798}, + {""}, {""}, + {"clusterMember10",527}, + {"instrumentType",973}, + {"numberOfPointsAlongTheXAxis",1413}, + {"secondOfEndOfOverallTimeInterval",1905}, + {""}, {""}, + {"minuteOfEndOfOverallTimeInterval",1269}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"totalAerosolBinsNumbers",2152}, + {"tempPressureUnits",2111}, + {"monthOfAnalysis",1291}, + {""}, {""}, + {"classOfAnalysis",420}, + {""}, {""}, {""}, + {"numberInTheGridCoordinateList",1334}, {""}, - {"secondaryBitmap",1907}, - {"section3Flags",1933}, + {"numberOfSecondOrderPackedValues",1429}, + {"jDirectionIncrementInDegrees",1021}, + {"extractDateTimeDayEnd",795}, {""}, - {"N2",169}, + {"is_ocean2d_param",1005}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"countOfGroupLengths",605}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"localUsePresent",1140}, + {"endOfHeadersMarker",740}, + {"longitudeOfTangencyPoint",1168}, + {""}, {""}, {""}, + {"hourOfAnalysis",929}, + {""}, {""}, {""}, + {"md5Headers",1235}, {""}, {""}, {""}, - {"localUsePresent",1137}, - {"longitudeOfReferencePoint",1156}, + {"localLatitude2",1128}, + {""}, + {"section1Length",1930}, + {""}, + {"sourceOfGridDefinition",2023}, + {""}, {""}, + {"endMark",730}, + {""}, {""}, + {"X2",264}, {""}, - {"X1",260}, + {"resolutionAndComponentFlags1",1772}, + {"II",89}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"md5Section7",1241}, - {""}, {""}, {""}, {""}, - {"mixedCoordinateFieldFlag",1278}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"uuidOfVGrid",2252}, {""}, - {"flagForAnyFurtherInformation",846}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"MinuteOfModelVersion",155}, - {""}, {""}, {""}, {""}, - {"firstOrderValues",844}, + {"section9UniqueIdentifier",1966}, {""}, {""}, - {"latitudeOfTangencyPoint",1061}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"P_INST",210}, - {"section11Pointer",1923}, + {"weightAppliedToClimateMonth1",2302}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"octetAtWichPackedDataBegins",1461}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"windDirectionTrend3",2309}, - {""}, {""}, {""}, {""}, - {"La2",102}, - {""}, - {"Lar2",109}, {""}, - {"nameECMF",1304}, + {"centreForTable2",400}, + {""}, {""}, {""}, {""}, {""}, + {"BOX",17}, + {""}, {""}, + {"subLocalDefinitionNumber1",2085}, + {"section8UniqueIdentifier",1963}, + {""}, {""}, {""}, + {"coordinate2End",577}, {""}, {""}, {""}, - {"firstDimensionCoordinateValueDefinition",838}, + {"section1Padding",1931}, {""}, {""}, {""}, - {"bufrHeaderCentre",371}, + {"unitsOfFirstFixedSurface",2236}, {""}, {""}, - {"Lo2",123}, + {"beginYearTrend4",350}, {""}, - {"Lor2",141}, - {"Latin2",114}, + {"dayOfModelVersion",648}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"cloudsCode1",485}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"cloudsTitle3Trend4",519}, {""}, {""}, {""}, - {"versionNumberOfGribLocalTables",2278}, - {"endDayTrend3",719}, + {"variationOfVisibilityDirectionTrend4",2268}, + {""}, + {"scaleFactorOfMinorAxisOfOblateSpheroidEarth",1856}, {""}, {""}, {""}, - {"numberOfUnexpandedDescriptors",1435}, + {"LIMITS",99}, + {""}, {""}, + {"reservedSection3",1769}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"meanRVR1",1249}, + {""}, + {"numberOfUsedSpatialTiles",1440}, {""}, {""}, {""}, {""}, - {"longitudeOfFirstDiamondCenterLine",1148}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"offsetSection1",1483}, {""}, {""}, - {"numberOfUsedTileAttributes",1438}, + {"centralClusterDefinition",393}, + {""}, {""}, {""}, + {"earthMajorAxisInMetres",703}, + {""}, {""}, {""}, {""}, {""}, + {"runwayDesignatorState1",1809}, {""}, {""}, - {"longitudeOfFirstDiamondCenterLineInDegrees",1149}, - {""}, {""}, {""}, {""}, - {"secondaryBitmapPresent",1908}, + {"subLocalDefinitionLength1",2083}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"beginMinuteTrend1",339}, + {""}, {""}, {""}, {""}, {""}, + {"numberOfDataBinsAlongRadials",1360}, {""}, - {"MonthOfModelVersion",166}, + {"endMonthTrend4",738}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"secondaryBitmaps",1909}, - {""}, {""}, {""}, - {"latitudeOfCentralPointInClusterDomain",1045}, - {"modelErrorType",1281}, - {""}, {""}, {""}, - {"Nj",193}, - {"unitsECMF",2229}, - {""}, {""}, {""}, - {"presentTrend3",1653}, {""}, {""}, - {"scaleFactorOfCentralWaveNumber",1839}, - {"section1Flags",1924}, + {"pentagonalResolutionParameterM",1632}, + {"numberOfStepsUsedForClustering",1433}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"_leg_number",285}, - {""}, {""}, - {"numberOfContributingSpectralBands",1354}, + {"cloudsTitle3Trend3",518}, + {""}, {""}, {""}, + {"variationOfVisibilityDirectionTrend3",2267}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"falseEasting",829}, - {""}, {""}, {""}, - {"localLatitude1",1124}, + {"dateOfModelVersion",638}, + {""}, {""}, + {"beginDayTrend1",331}, {""}, {""}, {""}, {""}, - {"clusterMember5",530}, - {"calendarIdentification",376}, + {"P2",208}, + {"timeOfModelVersion",2144}, {""}, {""}, {""}, {""}, {""}, - {"matrixBitmapsPresent",1225}, + {"windSpeedTrend2",2324}, + {""}, {""}, + {"section5Length",1949}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"numberOfSingularVectorsComputed",1431}, {""}, - {"offsetSection3",1484}, - {"extractAreaNorthLatitude",790}, + {"probabilityType",1683}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"offsetBSection9",1471}, + {"numberOfControlForecastTube",1358}, {""}, - {"DjInMetres",37}, - {""}, {""}, {""}, {""}, {""}, - {"tempPressureUnits",2106}, - {"secondaryBitmapsCount",1910}, + {"clusterMember1",526}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"versionNumOfSharedHeaderMessageFormat",2281}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"section7",1956}, {""}, - {"P2",206}, + {"numberInMixedCoordinateDefinition",1332}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"secondaryBitMap",1911}, + {""}, + {"DayOfModelVersion",30}, + {"probabilityTypeName",1684}, + {""}, + {"latitudeOfThePolePoint",1066}, + {""}, {""}, {""}, {""}, {""}, + {"yearOfModelVersion",2357}, + {"numberOfRadarSitesUsed",1422}, + {"checkInternalVersion",418}, {""}, {""}, - {"cloudsTitle3",514}, - {"ls_labeling",1178}, - {"numberOfCoefficientsOrValuesUsedToSpecifyFirstDimensionCoordinateFunction",1350}, - {"numberOfCoefficientsOrValuesUsedToSpecifySecondDimensionCoordinateFunction",1351}, + {"reservedSection4",1770}, {""}, {""}, {""}, {""}, - {"offsetAfterBitmap",1460}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"localTablesVersion",1135}, - {"numberOfDistinctSection6s",1368}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"longitudeOfCentralPointInClusterDomain",1147}, + {"constantAntennaElevationAngle",565}, + {""}, + {"cloudsTitle2Trend1",511}, + {""}, + {"versionNumberOfGribLocalTables",2283}, + {""}, {""}, {""}, + {"ceilingAndVisibilityOK",388}, + {"windDirectionTrend2",2313}, + {"section2Length",1933}, + {""}, {""}, {""}, + {"jDirectionIncrementGiven",1019}, + {""}, {""}, {""}, + {"timeCoordinateDefinition",2137}, {""}, - {"runwayDepositState3",1790}, + {"resolutionAndComponentFlags2",1773}, + {"Ensemble_Combination_Number",51}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cfVarNameECMF",406}, - {"dayOfTheYearDate",649}, + {"section11Length",1927}, + {""}, {""}, {""}, + {"subLocalDefinition2",2082}, + {""}, {""}, {""}, {""}, + {"scaleFactorOfUpperLimit",1864}, + {""}, {""}, + {"runwayDepthOfDepositCodeState4",1800}, + {"endMonthTrend3",737}, {""}, - {"Ensemble_Identifier",51}, + {"latitudeOfTheSouthernPoleOfProjection",1068}, + {"firstMonthUsedToBuildClimateMonth1",844}, + {""}, {""}, {""}, {""}, + {"numberOfGridInReference",1384}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"cloudsAbbreviation1",425}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"windVariableDirectionTrend1",2333}, + {"cloudsTitle4Trend4",524}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"northLatitudeOfDomainOfTubing",1320}, + {"section2Padding",1934}, + {"hourOfModelVersion",932}, + {""}, {""}, {""}, {""}, + {"eastLongitudeOfDomainOfTubing",707}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"longitudeOfSouthEastCornerOfArea",1158}, + {"presentTrend2",1657}, + {""}, {""}, {""}, {""}, + {"nameOfSecondFixedSurface",1309}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"ZLMULT",283}, + {"g1conceptsLocalDirAll",873}, {""}, {""}, - {"typeOfIntervalForFirstAndSecondSize",2187}, + {"numberOfHorizontalPoints",1388}, + {"runwayDepthOfDepositCodeState3",1799}, + {""}, + {"runwayFrictionCoefficientState4",1832}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"marsClass1",1188}, {""}, {""}, - {"azimuthalWidth",320}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"rdb_key",1718}, + {"southLatitudeOfDomainOfTubing",2030}, {""}, {""}, {""}, - {"latitudeOfStretchingPoleInDegrees",1058}, - {""}, {""}, - {"firstLatitudeInDegrees",841}, + {"bufrdcExpandedDescriptors",375}, + {""}, + {"scaledValueOfMinorAxisOfOblateSpheroidEarth",1880}, + {"runwayDesignatorState2",1810}, + {""}, + {"coordinate1Flag",575}, + {"endMinuteTrend1",731}, + {""}, + {"Ensemble_Identifier",52}, + {"cloudsTitle4Trend3",523}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"beginMinuteTrend2",340}, + {"runwayFrictionCodeValueState4",1824}, + {""}, {""}, {""}, + {"baseTimeOfThisLeg",329}, + {""}, {""}, {""}, {""}, {""}, + {"longitudeOfLastGridPointInDegrees",1157}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"gridDefinitionDescription",895}, + {"subDefinitions2",2080}, + {""}, {""}, {""}, + {"localLongitude2",1131}, + {""}, {""}, {""}, {""}, + {"section6Length",1953}, + {""}, + {"typeOfSecondFixedSurface",2202}, + {""}, {""}, {""}, {""}, {""}, + {"runwayDepositCodeState4",1792}, {""}, - {"numberOfPointsAlongAMeridian",1406}, + {"resolutionAndComponentFlags6",1776}, + {""}, {""}, + {"qualityValueAssociatedWithParameter",1709}, + {""}, {""}, {""}, {""}, {""}, + {"HDF5str",82}, + {""}, {""}, {""}, {""}, {""}, + {"runwayFrictionCoefficientState3",1831}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"versionNumberOfExperimentalSuite",2282}, + {""}, {""}, {""}, + {"reservedSection2",1768}, {""}, {""}, - {"longitudeOfSubSatellitePoint",1163}, + {"runwayDepositState2",1794}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"Model_Additional_Information",165}, {""}, {""}, {""}, {""}, {""}, {""}, - {"_numberOfValues",286}, + {"runwayFrictionCodeValueState3",1823}, {""}, {""}, {""}, {""}, - {"DjGiven",35}, - {"longitudeOfSubSatellitePointInDegrees",1164}, - {"realPartOf00",1729}, + {"implementationDateOfModelCycle",952}, + {""}, {""}, + {"latitudeLastInDegrees",1044}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"cloudsTitle3Trend1",516}, + {""}, {""}, + {"offsetSection5",1489}, + {"variationOfVisibilityDirectionTrend1",2265}, + {"NC1",175}, + {""}, {""}, {""}, {""}, {""}, + {"_leg_number",287}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"qfeUnits",1697}, - {"numberOfMissing",1393}, + {"baseDateOfThisLeg",327}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"cloudsTitle2Trend2",512}, + {"endMinuteTrend3",733}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"scanningMode5",1888}, - {"longitudeOfThePolePointInDegrees",1168}, - {"correction4",601}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"subLocalDefinition1",2076}, - {""}, {""}, - {"md5GridSection",1231}, + {"lengthOf4DvarWindow",1083}, + {""}, {""}, {""}, + {"offsetBeforeData",1473}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"numberOfModeOfDistribution",1399}, + {""}, {""}, {""}, {""}, {""}, + {"latitudeOfFirstGridPoint",1049}, + {""}, {""}, {""}, + {"firstMonthUsedToBuildClimateMonth2",845}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"isCavok",985}, + {""}, {""}, {""}, + {"P_INST",212}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"cloudsCode3",495}, + {""}, + {"westLongitudeOfDomainOfTubing",2304}, + {"ECMWF",46}, + {"md5Section10",1238}, + {"runwayDepositCodeState3",1791}, {""}, {""}, - {"typeOfIntervalForFirstAndSecondWavelength",2188}, + {"scaledValueOfUpperLimit",1888}, {""}, - {"produceLargeConstantFields",1681}, - {""}, {""}, {""}, - {"easternLongitudeOfClusterDomain",705}, - {"flagForIrregularGridCoordinateList",847}, + {"subLocalDefinitionNumber2",2086}, {""}, {""}, - {"coordAveragingTims",572}, - {""}, {""}, {""}, - {"oceanAtmosphereCoupling",1455}, - {"beginDayTrend3",332}, - {"cloudsTitle2Trend3",512}, + {"missingValueManagementUsed",1278}, + {"accuracyMultipliedByFactor",290}, + {""}, {""}, + {"clusterMember5",531}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"windUnitsTrend4",2331}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"extractAreaLatitudeRank",790}, {""}, {""}, {""}, - {"expandedCrex_widths",766}, + {"totalNumberOfValuesInUnpackedSubset",2166}, + {"listMembersMissing4",1102}, {""}, {""}, {""}, {""}, {""}, - {"numberOfDistinctSection7s",1369}, + {"meanRVR2",1250}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"offsetSection2",1486}, + {"julianForecastDay",1026}, + {""}, {""}, {""}, + {"scanningMode5",1893}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"section_4",1985}, + {""}, {""}, + {"section7Length",1957}, + {"subLocalDefinitionLength2",2084}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"resolutionAndComponentFlags7",1777}, + {"longitudeOfSouthernPoleInDegrees",1163}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"visibilityTrend1",2297}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"calendarIdentificationTemplateNumber",377}, {""}, {""}, {""}, {""}, {""}, {""}, - {"clusterMember3",528}, - {""}, {""}, {""}, {""}, - {"windDirectionTrend1",2307}, + {"offsetValuesBy",1495}, + {""}, + {"runwayDepthOfDepositCodeState1",1797}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"X2",262}, + {"beginDayTrend2",332}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"jDirectionIncrementGridLength",1020}, + {"definitionFilesVersion",665}, + {"cloudsTitle4Trend1",521}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"numberOfBytesPerInteger",1345}, {""}, {""}, {""}, - {"recentWeather",1731}, - {"tsectionNumber3",2168}, - {"ITERATOR",91}, + {"uuidOfHGrid",2256}, + {""}, + {"cloudsCode4",500}, {""}, {""}, {""}, {""}, - {"isectionNumber3",1009}, + {"numberOfPointsUsed",1420}, + {""}, {""}, {""}, + {"clusterMember2",528}, + {""}, {""}, + {"modelErrorType",1284}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"originatingCentreOfAnalysis",1523}, - {""}, {""}, {""}, {""}, - {"lengthOfHeaders",1081}, + {"diffInHours",675}, + {"cloudsTitle3Trend2",517}, + {""}, {""}, {""}, + {"variationOfVisibilityDirectionTrend2",2266}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"probProductDefinition",1677}, - {""}, {""}, {""}, {""}, - {"section9UniqueIdentifier",1961}, {""}, {""}, {""}, - {"NRj",183}, + {"md5Section1",1237}, + {""}, {""}, {""}, + {"runwayFrictionCoefficientState1",1829}, + {""}, {""}, {""}, + {"typeOfIntervalForFirstAndSecondSize",2192}, + {""}, {""}, {""}, {""}, + {"listMembersMissing3",1101}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"secondOrderValuesDifferentWidths",1910}, {""}, {""}, - {"marsKeywords1",1196}, - {"localLongitude1",1127}, - {""}, - {"WRAP",258}, + {"section_04",1974}, {""}, - {"endMinuteTrend1",728}, - {""}, {""}, {""}, {""}, - {"numberOfOctectsForNumberOfPoints",1398}, + {"changeIndicatorTrend4",412}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberInMixedCoordinateDefinition",1329}, - {""}, {""}, {""}, - {"pentagonalResolutionParameterJ",1625}, - {"presentTrend1",1651}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfPointsAlongAParallel",1407}, + {"section_3",1984}, + {"runwayFrictionCodeValueState1",1821}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"commonBlock",550}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"stepInHours",2060}, + {"runwaySideCodeState4",1836}, + {"efas_post_proc",714}, {""}, - {"endDayTrend4",720}, - {""}, {""}, {""}, - {"typeOfPacking",2192}, - {"cavokOrVisibility",381}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"cloudsTitle2Trend1",510}, + {"cloudsAbbreviation2",430}, {""}, {""}, {""}, {""}, {""}, {""}, - {"endStepInHours",743}, - {"offsetSection1",1480}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"radiusOfTheEarth",1717}, + {"windVariableDirectionTrend2",2334}, + {"timeUnitFlag",2148}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"************_PRODUCT_***************",3}, {""}, {""}, {""}, {""}, - {"NG",176}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"codedNumberOfFirstOrderPackedValues",544}, + {"offsetFreeFormData",1478}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"typeOfIntervalForFirstAndSecondWavelength",2193}, {""}, {""}, {""}, {""}, {""}, - {"efas_post_proc",711}, - {"jScansPositively",1021}, - {""}, {""}, {""}, - {"numberOfPointsAlongSecondAxis",1409}, - {""}, - {"longitudeOfSouthernPole",1159}, - {"BufrTemplate",20}, + {"changeIndicatorTrend3",411}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"endMinuteTrend2",732}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"southEastLongitudeOfLPOArea",2022}, + {"NH",179}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayDepositState1",1788}, + {"coordinateFlag1",586}, {""}, {""}, - {"scaledValueOfLengthOfSemiMajorAxis",1871}, - {"reservedSection2",1763}, + {"marsClass2",1189}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"patch_precip_fp",1629}, {""}, {""}, {""}, - {"scaledValueOfLengthOfSemiMinorAxis",1872}, - {"scaleFactorOfMajorAxisOfOblateSpheroidEarth",1850}, + {"SOH",221}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"localLatitude2",1125}, + {"cloudsCode2",490}, {""}, {""}, {""}, - {"pentagonalResolutionParameterM",1627}, - {""}, {""}, {""}, {""}, - {"scaleFactorOfEarthMajorAxis",1842}, + {"section_03",1973}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"endMonthTrend1",735}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"offsetSection6",1490}, {""}, {""}, {""}, {""}, - {"scaleFactorOfEarthMinorAxis",1843}, + {"runwayDepthOfDepositCodeState2",1798}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"windDirectionTrend4",2310}, + {"offsetFromReferenceOfFirstTime",1480}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"default_step_units",664}, + {""}, {""}, {""}, {""}, + {"observationDiagnostic",1453}, {""}, - {"cloudsTitle4",519}, - {"md5Headers",1232}, + {"coordinate2Flag",578}, {""}, - {"mask",1215}, - {""}, {""}, - {"cloudsTitle2Trend4",513}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"cloudsTitle4Trend2",522}, {""}, - {"disableGrib1LocalSection",681}, - {""}, {""}, - {"localTablesVersionNumber",1136}, + {"runwaySideCodeState3",1835}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"latitudeOfReferencePoint",1055}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"NC2",176}, + {"latitudeWhereDxAndDyAreSpecified",1070}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"section2Used",1937}, {""}, {""}, {""}, {""}, {""}, {""}, - {"extractDateTimeDayStart",795}, - {""}, {""}, - {"northWestLongitudeOfVerficationArea",1321}, - {""}, {""}, {""}, - {"patch_precip_fp",1624}, + {"runwayFrictionCoefficientState2",1830}, + {"latitudeWhereDxAndDyAreSpecifiedInDegrees",1071}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"cloudsAbbreviation4Trend4",444}, {""}, - {"sizeOfPostAuxiliaryArray",2012}, - {""}, {""}, {""}, - {"default_step_units",661}, - {""}, - {"isectionNumber2",1008}, + {"clusterMember6",532}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section6",1947}, - {""}, {""}, {""}, - {"offsetSection10",1481}, - {"coordinateFlag1",585}, - {""}, {""}, {""}, - {"beginDayTrend1",330}, {""}, {""}, {""}, {""}, {""}, - {"pack",1528}, - {"scaledValueOfLowerLimit",1873}, - {""}, {""}, {""}, - {"presentTrend4",1654}, + {"runwayFrictionCodeValueState2",1822}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"section8UniqueIdentifier",1958}, - {""}, {""}, {""}, - {"coordinate2End",576}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"typeOfTimeIncrementBetweenSuccessiveFieldsUsedInTheStatisticalProcessing",2207}, + {"addEmptySection2",291}, {""}, {""}, {""}, {""}, - {"Ensemble_Combination_Number",50}, - {""}, {""}, {""}, - {"numberOfMissingInStatisticalProcess",1394}, - {""}, - {"numberOfStepsUsedForClustering",1430}, - {"jPointsAreConsecutive",1020}, + {"latitudeOfThePoleOfStretching",1065}, {""}, {""}, - {"cloudsTitle2Trend2",511}, - {""}, {""}, {""}, - {"numberOfBits",1335}, - {""}, {""}, - {"cloudsTitle1Trend3",507}, + {"physicalMeaningOfVerticalCoordinate",1641}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"offsetSection4",1485}, - {"jDirectionIncrementInDegrees",1018}, - {"subLocalDefinitionNumber1",2080}, - {"clusterMember1",525}, + {"scanningMode6",1894}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"subLocalDefinition2",2077}, - {""}, {""}, - {"numberOfUsedSpatialTiles",1437}, - {"swapScanningX",2091}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"unpack",2234}, + {"cloudsAbbreviation3Trend4",439}, {""}, {""}, - {"offsetAfterData",1462}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"latitudeOfFirstGridPointInDegrees",1047}, + {"dateOfIceFieldUsed",637}, + {"listMembersUsed3",1105}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"Latin1InDegrees",115}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayDepositState4",1791}, {""}, - {"verificationYear",2271}, - {""}, {""}, {""}, - {"numberOfRadarSitesUsed",1419}, + {"visibilityTrend3",2299}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"scaleFactorOfUpperLimit",1859}, - {""}, - {"orderOfSpatialDifferencing",1515}, + {"changeIndicatorTrend1",409}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"cloudsAbbreviation4Trend3",443}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"superblockExtensionAddress",2093}, + {""}, {""}, {""}, + {"coordinate3Flag",580}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"centreForTable2",399}, + {"numberOfUsefulPointsAlongXAxis",1442}, + {""}, {""}, {""}, {""}, + {"pentagonalResolutionParameterJ",1630}, + {""}, + {"longitudeOfReferencePointInDegrees",1160}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"runwayDepositCodeState1",1789}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"presentWeather1Present",1660}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"latitudeOfSouthEastCornerOfArea",1057}, + {""}, + {"physicalFlag1",1639}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"GG",70}, + {""}, {""}, {""}, + {"md5Section3",1240}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"cloudsAbbreviation3Trend3",438}, + {"Model_Identifier",166}, + {"YRInMetres",276}, + {""}, {""}, {""}, {""}, {""}, + {"listMembersUsed4",1106}, + {"param_value_max",1609}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section3Padding",1935}, {""}, {""}, {""}, {""}, {""}, {""}, - {"windDirectionTrend2",2308}, + {"offsetICEFieldsUsed",1481}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"subLocalDefinitionLength1",2078}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfPointsAlongFirstAxis",1408}, - {""}, {""}, {""}, - {"firstMonthUsedToBuildClimateMonth1",842}, - {"windSpeedTrend3",2320}, + {"numberOfBitsForScaledGroupLengths",1340}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"visibilityTrend4",2300}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"windGustTrend4",2320}, + {""}, {""}, {""}, + {"extremeValuesRVR4",826}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"scaledValueOfFirstWavelength",1870}, + {"laplacianScalingFactorUnset",1038}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"mixedCoordinateDefinition",1277}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"westernLongitudeOfClusterDomain",2300}, - {""}, - {"clusterMember10",526}, - {""}, - {"beginDayTrend4",333}, {""}, {""}, {""}, {""}, {""}, - {"resolutionAndComponentFlags3",1769}, - {"cloudsTitle1Trend1",505}, + {"extractDateTimeYearRank",813}, + {""}, {""}, {""}, {""}, + {"bufrHeaderSubCentre",373}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"numberOfPressureLevelsUsedForClustering",1421}, {""}, - {"presentTrend2",1652}, - {""}, {""}, - {"section5Length",1944}, - {""}, {""}, - {"dateOfSSTFieldUsed",639}, + {"coordinateFlag2",587}, {""}, {""}, {""}, {""}, - {"subDefinitions2",2075}, + {"intervalBetweenTimes",982}, + {""}, {""}, {""}, + {"Latin2InDegrees",117}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"offsetSection7",1491}, + {""}, {""}, {""}, + {"extremeValuesRVR3",825}, {""}, - {"radiusOfClusterDomain",1711}, + {"md5Section4",1241}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"ceilingAndVisibilityOKTrend4",392}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"listOfContributingSpectralBands",1107}, + {""}, {""}, + {"numberOfPointsAlongYAxis",1417}, + {""}, {""}, {""}, {""}, {""}, + {"coordinate4Flag",583}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"cloudsCode1Trend4",489}, + {""}, {""}, {""}, {""}, {""}, + {"cloudsAbbreviation1Trend4",429}, + {""}, + {"section_1",1980}, {""}, - {"gts_TTAAii",910}, + {"changeIndicatorTrend2",410}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"BOX",17}, + {"presentWeather2Present",1665}, + {""}, {""}, + {"endMonthTrend2",736}, + {"biFourierPackingModeForAxes",353}, + {"rangeBinSpacing",1719}, + {"ZLBASE",282}, + {"alternativeRowScanning",298}, + {""}, {""}, + {"runwayExtentOfContaminationState4",1820}, + {""}, {""}, {""}, + {"runwayExtentOfContaminationCodeState4",1816}, + {""}, {""}, {""}, {""}, {""}, + {"windGustTrend3",2319}, + {"listMembersUsed2",1104}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"ceilingAndVisibilityOKTrend3",391}, + {"Date_E4",29}, + {"section4UniqueIdentifier",1947}, {""}, {""}, {""}, - {"horizontalDimensionProcessed",922}, + {"extractDateTimeDayRank",796}, + {""}, {""}, {""}, {""}, + {"clusterMember7",533}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"variationOfVisibilityTrend4",2272}, + {""}, {""}, + {"cloudsCode1Trend3",488}, + {"extractDateTimeSecondRank",809}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section7",1951}, + {"padding_grid90_1",1542}, {""}, {""}, - {"offsetSection2",1483}, - {""}, {""}, {""}, {""}, - {"clusterMember4",529}, + {"visibilityTrend2",2298}, {""}, {""}, {""}, {""}, - {"conceptsMasterDir",559}, + {"UseEcmfConventions",254}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"spacingOfBinsAlongRadials",2038}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"runwayExtentOfContaminationState3",1819}, + {""}, {""}, {""}, + {"runwayExtentOfContaminationCodeState3",1815}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"scanningMode7",1895}, {""}, - {"typeOfSSTFieldUsed",2196}, - {"typeOfGeneratingProcess",2184}, - {"cfNameECMF",404}, - {"numberOfSingularVectorsEvolved",1429}, + {"runwayDesignatorRVR4",1808}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"jScansPositively",1024}, + {""}, {""}, + {"section3UniqueIdentifier",1942}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"section_01",1971}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"runwayDepthOfDepositState4",1804}, + {"typicalYearOfCentury",2220}, + {"cloudsAbbreviation1Trend3",428}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"beginMonthTrend1",343}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfDataBinsAlongRadials",1357}, - {"meanRVR3",1248}, + {"md5Section2",1239}, {""}, {""}, - {"offsetEndSection4",1474}, - {"section1Padding",1926}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayDepositState2",1789}, + {"coordinate3OfFirstGridPoint",581}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"localFlagLatestVersion",1121}, + {"runwaySideCodeState1",1833}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"timeIncrementBetweenSuccessiveFields",2141}, + {""}, {""}, {""}, + {"runwayFrictionCoefficientCodeState4",1828}, + {"offsetBeforePL",1474}, + {""}, {""}, + {"Date_E3",28}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"countOfICEFieldsUsed",606}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"numberOfGridUsed",1385}, {""}, {""}, {""}, {""}, - {"scaledValueOfSecondWavelength",1880}, + {"variationOfVisibilityTrend3",2271}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"presentWeather3Present",1670}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"cloudsAbbreviation2Trend4",434}, + {"runwayDesignatorRVR3",1807}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"runwayFrictionCoefficientCodeState3",1827}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"extremeValuesRVR1",823}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"runwayDepthOfDepositState3",1803}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"runwayDepositCodeState2",1790}, {""}, {""}, {""}, {""}, {""}, - {"cloudsTitle1Trend4",508}, + {"extractDateTimeHourRank",800}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section3Length",1934}, - {"uvRelativeToGrid",2253}, + {"physicalFlag2",1640}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"FMULTE",66}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"ceilingAndVisibilityOKTrend1",389}, {""}, {""}, {""}, {""}, - {"flagShowingPostAuxiliaryArrayInUse",849}, + {"DIAG",26}, + {"section_5",1986}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"firstMonthUsedToBuildClimateMonth2",843}, - {"latitudeOfReferencePoint",1052}, - {"extractAreaEastLongitude",787}, - {""}, - {"ZLMULT",281}, - {""}, - {"offsetBeforeData",1470}, + {""}, {""}, {""}, {""}, + {"endHourTrend4",729}, {""}, {""}, {""}, - {"beginMinuteTrend3",340}, + {"cloudsCode1Trend1",486}, + {""}, {""}, {""}, {""}, {""}, + {"cloudsAbbreviation4Trend1",441}, + {"coordinate4OfFirstGridPoint",584}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfControlForecastTube",1355}, - {""}, {""}, {""}, {""}, - {"resolutionAndComponentFlags1",1767}, + {"cloudsAbbreviation2Trend3",433}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"offsetBSection9",1468}, - {""}, {""}, - {"horizontalDomainTemplate",923}, - {"cloudsAbbreviation3",434}, - {""}, - {"scanningMode4",1887}, - {"endOfHeadersMarker",737}, - {""}, {""}, - {"section4Padding",1940}, - {"windSpeedTrend2",2319}, + {"extractDateTimeMinuteRank",803}, {""}, {""}, {""}, {""}, {""}, - {"coordinate1End",573}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"beginDayTrend2",331}, - {"section11Length",1922}, - {""}, {""}, - {"dayOfModelVersion",647}, - {""}, {""}, {""}, - {"cloudsTitle1Trend2",506}, + {"sourceSinkChemicalPhysicalProcess",2024}, + {""}, + {"runwayExtentOfContaminationState1",1817}, {""}, {""}, {""}, - {"earthMajorAxisInMetres",700}, - {""}, {""}, - {"qualityControlIndicator",1703}, + {"runwayExtentOfContaminationCodeState1",1813}, + {""}, + {"ccsdsBlockSize",384}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"extractDateTimeMonthRank",806}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"Y1",271}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"HDF5str",81}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"inputOverriddenReferenceValues",965}, {""}, {""}, {""}, - {"mBasicAngle",1182}, + {"Total_Number_Members_Used",253}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"cloudsAbbreviation3Trend1",436}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"reservedSection3",1764}, - {""}, {""}, {""}, - {"subLocalDefinitionNumber2",2081}, - {"clusterMember2",527}, + {"oneMinuteMeanMaximumRVR4",1503}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"listMembersMissing2",1100}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"section_5",1981}, {""}, {""}, {""}, - {"resolutionAndComponentFlags4",1770}, - {""}, {""}, - {"totalAerosolBinsNumbers",2147}, + {"paramIdECMF",1608}, + {""}, + {"section_05",1975}, + {""}, {""}, {""}, + {"versionNumberOfSuperblock",2284}, + {""}, {""}, {""}, {""}, {""}, + {"section_2",1983}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"endHourTrend3",728}, {""}, - {"secondaryBitMap",1906}, + {"extractAreaLongitudeRank",791}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"extremeValuesRVR2",824}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"Total_Number_Members_Missing",251}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"Total_Number_Members_Possible",252}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section1Length",1925}, + {"cloudsCode2Trend4",494}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"coordAveraging1",570}, {""}, {""}, {""}, {""}, {""}, - {"section2Padding",1929}, + {"runwayFrictionCoefficientCodeState1",1825}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"endYearTrend4",751}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"numberInHorizontalCoordinates",1331}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayDesignatorState3",1806}, - {""}, - {"DayOfModelVersion",29}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section_05",1970}, - {"versionNumOfSharedHeaderMessageFormat",2276}, - {"northWestLatitudeOfVerficationArea",1319}, {""}, {""}, {""}, {""}, {""}, {""}, - {"beginMinuteTrend1",338}, + {"setToMissingIfOutOfRange",1998}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"oneMinuteMeanMaximumRVR3",1502}, {""}, {""}, - {"northWestLatitudeOfLPOArea",1318}, + {"ExtremeValuesRVR4",65}, {""}, - {"scaledValueOfCentralWaveNumber",1863}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"subLocalDefinitionLength2",2079}, - {""}, {""}, {""}, - {"md5Section2",1236}, - {"numberOfPointsAlongTheXAxis",1410}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"extractAreaSouthLatitude",791}, + {"ceilingAndVisibilityOKTrend2",390}, {""}, - {"resolutionAndComponentFlags2",1768}, + {"numberOfPointsAlongXAxisInCouplingArea",1416}, {""}, - {"sourceOfGridDefinition",2018}, + {"section5UniqueIdentifier",1951}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfBytesPerInteger",1342}, + {"beginMonthTrend3",345}, + {""}, {""}, {""}, {""}, {""}, + {"cloudsCode1Trend2",487}, + {""}, + {"cloudsCode2Trend3",493}, {""}, {""}, {""}, {""}, {""}, - {"section4Length",1939}, + {"section_02",1972}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsTitle3Trend3",517}, - {""}, {""}, {""}, - {"marsClass1",1185}, + {"offsetBeforePV",1475}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"md5Section10",1235}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"meanRVR1",1246}, + {"numberOfBytesInLocalDefinition",1343}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"beginMinuteTrend4",341}, - {""}, {""}, {""}, {""}, - {"sizeOfPostAuxiliaryArrayPlusOne",2013}, + {"windGustTrend1",2317}, {""}, {""}, {""}, - {"flagForNormalOrStaggeredGrid",848}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"endMonthTrend3",734}, - {"Model_Identifier",164}, - {""}, {""}, {""}, {""}, - {"monthlyVerificationYear",1296}, + {"runwayExtentOfContaminationState2",1818}, {""}, {""}, {""}, - {"cloudsCode2",489}, - {""}, {""}, {""}, {""}, - {"preBitmapValues",1644}, + {"runwayExtentOfContaminationCodeState2",1814}, + {""}, {""}, + {"numberOfReforecastYearsInModelClimate",1424}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"endMinuteTrend3",730}, + {"altitudeOfTheCameraFromTheEarthSCenterMeasuredInUnitsOfTheEarth",299}, + {""}, {""}, {""}, + {"runwaySideCodeState2",1834}, + {"ExtremeValuesRVR3",64}, + {""}, {""}, {""}, {""}, + {"latitudeOfThePolePointInDegrees",1067}, {""}, {""}, - {"runwayDesignatorState1",1804}, - {"minutesAfterReferenceTimeOfDataCutoff",1271}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"Local_Number_Members_Used",137}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"coordAveraging3",572}, + {""}, {""}, {""}, {""}, {""}, + {"hoursAfterDataCutoff",934}, {""}, - {"section_3",1979}, - {""}, {""}, - {"section2Length",1928}, + {"offsetSection11",1485}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"reflectivityCalibrationConstant",1756}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"endYearTrend3",750}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"CCCC",21}, + {""}, {""}, {""}, {""}, {""}, + {"recentWeatherTry",1737}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"hoursAfterReferenceTimeOfDataCutoff",935}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"offsetFromReferenceOfFirstTime",1477}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsAbbreviation1",424}, - {""}, {""}, - {"coordinate2Flag",577}, + {"cloudsBase1",445}, + {""}, {""}, {""}, {""}, + {"experimentVersionNumber1",778}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"diffInHours",672}, - {""}, - {"md5Section1",1234}, - {"cloudsTitle4Trend3",522}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"matchAerosolBinNumber",1220}, + {"cloudsAbbreviation1Trend1",426}, {""}, - {"beginMinuteTrend2",339}, + {"cloudsBaseCoded1Trend4",469}, {""}, {""}, {""}, - {"section_03",1968}, + {"beginMonthTrend4",346}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"cloudsCode3Trend4",499}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"Local_Number_Members_Missing",129}, {""}, {""}, {""}, {""}, - {"section2Used",1932}, + {"offsetBSection5",1469}, {""}, {""}, - {"longitudeOfReferencePointInDegrees",1157}, + {"Local_Number_Members_Possible",133}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"countOfGroupLengths",604}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"windVariableDirectionTrend3",2330}, + {"section_6",1987}, {""}, {""}, {""}, - {"cloudsTitle3Trend1",515}, - {""}, {""}, - {"longitudeOfTangencyPoint",1165}, + {"beginHourTrend1",335}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"numberOfSecondOrderPackedValues",1426}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"numberOfParametersUsedForClustering",1406}, {""}, - {"runwayDesignatorState4",1807}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfPressureLevelsUsedForClustering",1418}, - {""}, {""}, - {"horizontalDomainTemplateNumber",924}, - {""}, {""}, {""}, - {"longitudeOfTheSouthernPoleOfProjection",1169}, - {""}, {""}, {""}, {""}, {""}, - {"addEmptySection2",289}, + {"runwayFrictionCoefficientCodeState2",1826}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"NC1",173}, - {""}, {""}, {""}, {""}, {""}, - {"variationOfVisibilityDirectionTrend3",2262}, + {"variationOfVisibilityTrend1",2269}, {""}, - {"Model_Additional_Information",163}, + {"section6UniqueIdentifier",1955}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"numberOfMissingValues",1398}, {""}, - {"meanRVR4",1249}, + {"cloudsBaseCoded1Trend3",468}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"cloudsCode3Trend3",498}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"listMembersUsed2",1101}, - {"extractDateTimeDayEnd",793}, + {"numberOfVGridUsed",1444}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"runwayDesignatorRVR1",1805}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"numberOfPointsAlongTheYAxis",1414}, + {""}, {""}, {""}, + {"cloudsAbbreviation4Trend2",442}, {""}, {""}, {""}, {""}, {""}, - {"cloudsCode1",484}, + {"latitudeOfFirstGridPointInDegrees",1050}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"reservedSection4",1765}, - {"accuracyMultipliedByFactor",288}, + {""}, {""}, {""}, + {"runwayDepthOfDepositState1",1801}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"scaleFactorOfMinorAxisOfOblateSpheroidEarth",1851}, - {""}, {""}, {""}, {""}, {""}, - {"cloudsTitle3Trend4",518}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"dateOfModelVersion",637}, - {""}, {""}, {""}, {""}, {""}, - {"runwayDesignatorState2",1805}, - {""}, - {"RENAME",214}, {""}, {""}, - {"timeOfModelVersion",2139}, - {"numberOfGridInReference",1381}, - {""}, {""}, {""}, - {"cloudsTitle4Trend1",520}, + {"beginHourTrend3",337}, {""}, - {"yearOfModelVersion",2352}, + {"section_06",1976}, + {""}, {""}, {""}, {""}, + {"Y2",273}, {""}, {""}, {""}, - {"numberOfPointsUsed",1417}, + {"cloudsCode2Trend1",491}, {""}, - {"latitudeLastInDegrees",1041}, + {"FMULTM",67}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"localLongitude2",1128}, - {"extractDateTimeEnd",796}, - {""}, - {"weightAppliedToClimateMonth1",2297}, - {"endMinuteTrend2",729}, + {"skipExtraKeyAttributes",2021}, + {""}, {""}, + {"cloudsAbbreviation3Trend2",437}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"Minute_E4",160}, {""}, - {"listMembersMissing3",1098}, - {""}, {""}, {""}, {""}, - {"cloudsAbbreviation4",439}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"experimentVersionNumberOfAnalysis",778}, - {""}, {""}, {""}, {""}, {""}, - {"offsetFreeFormData",1475}, - {"numberOfSingularVectorsComputed",1428}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayDepthOfDepositCodeState3",1794}, + {"beginMonthTrend2",344}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"scaledValueOfMajorAxisOfOblateSpheroidEarth",1874}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsTitle3Trend2",516}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"scaledValueOfEarthMajorAxis",1866}, + {""}, + {"HDF5",81}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"ExtremeValuesRVR1",62}, + {""}, + {"NB",173}, + {""}, {""}, {""}, {""}, {""}, + {"cloudsCode4Trend4",504}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"offsetBSection6",1470}, {""}, {""}, {""}, {""}, - {"scaledValueOfEarthMinorAxis",1867}, - {"endMonthTrend1",732}, - {""}, {""}, {""}, - {"variationOfVisibilityDirectionTrend1",2260}, + {"beginYearTrend1",347}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsTitle4Trend4",523}, - {"definitionFilesVersion",662}, + {"cloudsAbbreviation2Trend1",431}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"typeOfWavelengthInterval",2203}, - {"marsClass2",1186}, - {""}, {""}, {""}, {""}, - {"hourOfModelVersion",929}, {""}, {""}, - {"beginHourTrend4",337}, + {"isCavokTrend4",989}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section_1",1975}, - {""}, {""}, {""}, {""}, - {"meanRVR2",1247}, - {""}, {""}, {""}, {""}, - {"resolutionAndComponentFlags6",1771}, + {"coordAveraging2",571}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"jDirectionIncrementGiven",1016}, - {""}, {""}, {""}, {""}, - {"latitudeOfThePolePoint",1063}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"coordAveraging0",568}, + {"section7UniqueIdentifier",1959}, + {"rootGroupSymbolTableEntry",1780}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section_01",1966}, + {"cloudsCode4Trend3",503}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"INBITS",90}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"*********_EXTRA_DATA_***************",4}, + {"XpInGridLengths",270}, {""}, {""}, {""}, {""}, {""}, - {"************_PRODUCT_***************",3}, + {"ICPLSIZE",88}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"variationOfVisibilityDirectionTrend4",2263}, - {""}, {""}, {""}, - {"windVariableDirectionTrend1",2328}, {""}, {""}, {""}, {""}, {""}, - {"cloudsTitle4Trend2",521}, - {"coordinate1Flag",574}, - {""}, {""}, {""}, - {"numberOfModeOfDistribution",1396}, + {"Minute_E3",159}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"typicalYear2",2219}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"beginYearTrend3",349}, {""}, {""}, {""}, - {"endMark",727}, + {"cloudsBaseCoded1",465}, {""}, - {"changeIndicatorTrend3",410}, - {""}, {""}, - {"runwayDepthOfDepositCodeState1",1792}, - {""}, {""}, - {"Total_Number_Members_Used",251}, - {"md5Section3",1237}, + {"oneMinuteMeanMinimumRVR4",1507}, + {"endHourTrend1",726}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"bufrdcExpandedDescriptors",374}, + {"cloudsBaseCoded1Trend1",466}, {""}, {""}, - {"centralClusterDefinition",392}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsAbbreviation2",429}, - {""}, - {"coordinateFlag2",586}, - {""}, {""}, {""}, - {"ceilingAndVisibilityOK",387}, - {""}, {""}, {""}, {""}, - {"northLatitudeOfDomainOfTubing",1317}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section6Length",1948}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"offsetSection6",1487}, + {"ccsdsCompressionOptionsMask",385}, {""}, {""}, {""}, {""}, {""}, - {"resolutionAndComponentFlags7",1772}, - {""}, {""}, {""}, - {"scaledValueOfUpperLimit",1883}, - {""}, {""}, {""}, - {"timeCoordinateDefinition",2132}, - {""}, {""}, {""}, - {"beginYearTrend4",349}, - {"baseTimeOfThisLeg",328}, - {""}, {""}, {""}, - {"timeUnitFlag",2143}, - {"Total_Number_Members_Possible",250}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"endMonthTrend4",735}, - {"baseDateOfThisLeg",326}, - {""}, - {"variationOfVisibilityDirectionTrend2",2261}, - {""}, {""}, {""}, - {"northWestLongitudeOfLPOArea",1320}, - {""}, {""}, {""}, {""}, - {"eastLongitudeOfDomainOfTubing",704}, - {""}, {""}, {""}, {""}, - {"southLatitudeOfDomainOfTubing",2025}, - {"sizeOfLength",2010}, - {"reflectivityCalibrationConstant",1751}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayDepthOfDepositCodeState4",1795}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsCode3",494}, + {"windGustTrend2",2318}, + {"LSTCUM",101}, + {""}, {""}, + {"cloudsCode3Trend1",496}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"NC2",174}, - {""}, {""}, {""}, {""}, - {"section_4",1980}, + {"isCavokTrend3",988}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"missingValueManagementUsed",1275}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"YRInMetres",274}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"minuteOfEndOfOverallTimeInterval",1266}, - {""}, {""}, {""}, {""}, {""}, - {"secondOfEndOfOverallTimeInterval",1900}, - {""}, - {"Total_Number_Members_Missing",249}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"changeIndicatorTrend1",408}, - {"section7Length",1952}, - {""}, - {"section_04",1969}, + {"cloudsCode2Trend2",492}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"windVariableDirectionTrend4",2331}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"runwayFrictionCoefficientState3",1826}, - {""}, {""}, {""}, {""}, {""}, - {"runwayDepthOfDepositCodeState2",1793}, - {""}, {""}, {""}, {""}, - {"dateOfIceFieldUsed",636}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"theHindcastMarsStream",2111}, {""}, - {"offsetValuesBy",1492}, - {""}, {""}, {""}, {""}, - {"checkInternalVersion",417}, + {"cloudsBase3",455}, + {""}, {""}, {""}, + {"oneMinuteMeanMaximumRVR1",1500}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"setBitsPerValue",1994}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"section_7",1988}, {""}, - {"runwayDepositCodeState3",1786}, + {"ExtremeValuesRVR2",63}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"experimentVersionNumber2",779}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"rootGroupSymbolTableEntry",1775}, {""}, {""}, - {"clusterMember6",531}, + {"cloudsAbbreviation1Trend2",427}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"beginHourTrend2",336}, {""}, {""}, {""}, {""}, - {"changeIndicatorTrend4",411}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"g1conceptsLocalDirAll",871}, - {"listMembersUsed3",1102}, + {"presentWeather1PresentTrend4",1664}, {""}, {""}, {""}, - {"endMonthTrend2",733}, - {"visibilityTrend2",2293}, + {"oneMinuteMeanMinimumRVR3",1506}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"offsetSection7",1488}, - {""}, {""}, - {"longitudeOfSouthernPoleInDegrees",1160}, {""}, - {"windUnitsTrend4",2326}, + {"padding_sec1_loc",1599}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"section_2",1978}, - {""}, {""}, {""}, - {"countOfICEFieldsUsed",605}, - {""}, {""}, {""}, - {"Latin1InDegrees",113}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"recentWeatherTry",1732}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"listMembersMissing4",1099}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"versionNumberOfExperimentalSuite",2277}, + {"ECMWF_s",47}, {""}, {""}, {""}, {""}, {""}, {""}, - {"widthOfWidths",2305}, - {"runwayFrictionCoefficientState1",1824}, + {"latitudeOfReferencePointInDegrees",1056}, {""}, {""}, - {"changeIndicatorTrend2",409}, - {""}, - {"section_02",1967}, + {"Date_E2",27}, + {""}, {""}, {""}, {""}, {""}, + {"padding_local_7_1",1598}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"offsetBeforePL",1471}, - {""}, {""}, {""}, - {"Local_Number_Members_Used",135}, - {"scanningMode6",1889}, - {""}, {""}, - {"windVariableDirectionTrend2",2329}, + {"cloudsBaseCoded2Trend4",474}, + {"variationOfVisibilityTrend2",2270}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"md5Section4",1238}, - {""}, {""}, {""}, {""}, {""}, - {"latitudeOfTheSouthernPoleOfProjection",1065}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"totalNumberOfValuesInUnpackedSubset",2161}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"commonBlock",549}, {""}, {""}, {""}, - {"section5UniqueIdentifier",1946}, + {"endYearTrend1",748}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"presentWeather1PresentTrend3",1663}, + {""}, + {"Product_Identifier",215}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"julianForecastDay",1023}, - {"Local_Number_Members_Possible",131}, - {""}, {""}, - {"visibilityTrend1",2292}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"laplacianScalingFactorUnset",1035}, - {""}, {""}, - {"runwayFrictionCoefficientState4",1827}, + {"cloudsBase4",460}, + {"section_07",1977}, + {""}, {""}, {""}, {""}, + {"runwayDesignatorRVR2",1806}, + {""}, {""}, {""}, {""}, + {"cloudsCode4Trend1",501}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"CLNOMA",24}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"cloudsBaseCoded1Trend2",467}, {""}, - {"implementationDateOfModelCycle",949}, - {""}, {""}, - {"uuidOfHGrid",2251}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"cloudsBaseCoded2Trend3",473}, {""}, {""}, {""}, {""}, {""}, - {"cloudsCode4",499}, + {"Time_Range_One_E4",247}, {""}, - {"secondaryBitmapsSize",1911}, - {"clusterMember7",532}, - {""}, {""}, - {"numberOfDaysInClimateSamplingWindow",1362}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"offsetSection11",1482}, - {"Latin2InDegrees",115}, - {""}, {""}, - {"section3UniqueIdentifier",1937}, - {""}, {""}, {""}, - {"Local_Number_Members_Missing",127}, + {"runwayDepthOfDepositState2",1802}, {""}, {""}, - {"coordinate3Flag",579}, - {"jDirectionIncrementGridLength",1017}, - {""}, {""}, {""}, {""}, {""}, - {"listMembersMissing2",1097}, + {"cloudsCode3Trend2",497}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_grid90_1",1539}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayDepositCodeState1",1784}, - {""}, - {"runwayFrictionCoefficientState2",1825}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"lastMonthUsedToBuildClimateMonth1",1039}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"coordinate3OfFirstGridPoint",580}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"offsetICEFieldsUsed",1478}, - {"physicalFlag1",1634}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"typeOfTimeIncrementBetweenSuccessiveFieldsUsedInTheStatisticalProcessing",2202}, - {"Date_E3",27}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"westLongitudeOfDomainOfTubing",2299}, - {""}, {""}, {""}, - {"numberOfUsefulPointsAlongXAxis",1439}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"scanningMode7",1890}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"octetAtWichPackedDataBegins",1458}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"UseEcmfConventions",252}, {""}, - {"coordinate4Flag",582}, - {""}, - {"listMembersUsed4",1103}, - {""}, - {"secondOrderValuesDifferentWidths",1905}, + {"TYPE_OF",240}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"beginYearTrend2",348}, {""}, - {"ECMWF",45}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"timeIncrementBetweenSuccessiveFields",2136}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"Time_Range_One_E3",246}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"offsetFromOriginToInnerBound",1479}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"coordinate4OfFirstGridPoint",583}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"presentWeather2PresentTrend4",1669}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfGridUsed",1382}, - {""}, {""}, {""}, - {"paramIdECMF",1605}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"HourOfModelVersion",83}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"cloudsAbbreviation2Trend2",432}, + {"windUnitsTrend1",2328}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayDepositCodeState4",1787}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"latitudeOfReferencePointInDegrees",1053}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"latitudeOfThePoleOfStretching",1062}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section4UniqueIdentifier",1942}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"scaledValueOfMinorAxisOfOblateSpheroidEarth",1875}, + {"cloudsBaseCoded3Trend4",479}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfPointsAlongYAxis",1414}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"cloudsBase2",450}, {""}, {""}, - {"listOfContributingSpectralBands",1104}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"visibilityTrend3",2294}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"numberOfUnusedBitsAtEndOfSection3",1439}, + {""}, {""}, + {"presentWeather2PresentTrend3",1668}, + {""}, + {"ICEFieldsUsed",87}, + {""}, + {"Number_Combination_Ensembles_1_none",198}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"skipExtraKeyAttributes",2016}, - {""}, {""}, {""}, {""}, - {"physicalMeaningOfVerticalCoordinate",1636}, - {""}, {""}, - {"observationDiagnostic",1450}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"TYPE_OR",241}, + {"bitsPerValueAndRepack",366}, + {""}, + {"cloudsBaseCoded3",475}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"isCavok",982}, + {"cloudsBaseCoded3Trend3",478}, + {""}, {""}, {""}, {""}, {""}, + {"precisionOfTheUnpackedSubset",1652}, {""}, {""}, {""}, - {"padding_local_7_1",1595}, - {""}, - {"radiusOfTheEarth",1712}, + {"cloudsCode4Trend2",502}, + {""}, {""}, {""}, {""}, {""}, + {"************_ENSEMBLE_**************",1}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"endHourTrend2",727}, + {""}, {""}, {""}, {""}, + {"windUnitsTrend3",2330}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"presentWeather1PresentTrend1",1661}, {""}, {""}, - {"INBITS",89}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"GG",69}, + {"TYPE_FF",238}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayDepositCodeState2",1785}, - {""}, {""}, {""}, {""}, {""}, - {"NH",177}, - {"alternativeRowScanning",296}, + {""}, {""}, {""}, {""}, + {"lastMonthUsedToBuildClimateMonth2",1040}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"physicalFlag2",1635}, - {""}, {""}, {""}, {""}, - {"SOH",219}, - {""}, {""}, {""}, {""}, - {"numberOfPointsAlongXAxisInCouplingArea",1413}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"BUFR",19}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"cloudsBaseCoded2Trend1",471}, + {"YearOfModelVersion",278}, + {""}, {""}, {""}, + {"presentWeather3PresentTrend4",1674}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"oneMinuteMeanMaximumRVR2",1501}, {""}, {""}, {""}, {""}, {""}, - {"presentWeather1Present",1655}, - {""}, {""}, {""}, {""}, - {"setToMissingIfOutOfRange",1993}, + {"padding_local40_1",1596}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"numberOfBitsContainingEachPackedValue",1339}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"cloudsBaseCoded4",480}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"cloudsBaseCoded4Trend4",484}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"lengthOf4DvarWindow",1080}, + {"padding_loc190_1",1557}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"offsetBSection5",1466}, + {"offsetBBitmap",1468}, + {""}, {""}, {""}, {""}, {""}, + {"presentWeather3PresentTrend3",1673}, {""}, {""}, - {"numberOfBytesInLocalDefinition",1340}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"rangeBinSpacing",1714}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfReforecastYearsInModelClimate",1421}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"HDF5",80}, + {"isCavokTrend1",986}, + {""}, {""}, {""}, {""}, + {"section_11",1982}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"numberOfDaysInClimateSamplingWindow",1365}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"extremeValuesRVR3",823}, - {""}, {""}, {""}, {""}, {""}, - {"runwayFrictionCodeValueState3",1818}, + {""}, {""}, {""}, {""}, + {"ExtremeValuesInMaximumRVR4",61}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"Date_E4",28}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"constantAntennaElevationAngle",564}, + {"cloudsBaseCoded4Trend3",483}, + {""}, {""}, {""}, + {"endYearTrend2",749}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"typicalYearOfCentury",2215}, - {""}, - {"FMULTE",65}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"numberOfParametersUsedForClustering",1403}, - {"section_6",1982}, + {"presentWeather2PresentTrend1",1666}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"visibilityTrend4",2295}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfHorizontalPoints",1385}, - {"ICPLSIZE",87}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Product_Identifier",213}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section_06",1971}, - {""}, - {"cloudsAbbreviation3Trend3",437}, + {"oneMinuteMeanMinimumRVR1",1504}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"presentWeather1PresentTrend2",1662}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"oneMinuteMeanMaximumRVR3",1499}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"extremeValuesRVR1",821}, {""}, {""}, {""}, {""}, {""}, - {"runwayFrictionCodeValueState1",1816}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"runwaySideCodeState3",1830}, + {"cloudsBaseCoded3Trend1",476}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"pastTendencyRVR1",1625}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"beginHourTrend1",334}, {""}, {""}, - {"qualityValueAssociatedWithParameter",1704}, + {"cloudsBaseCoded2",470}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"cloudsBaseCoded2Trend2",472}, + {""}, {""}, {""}, + {"ExtremeValuesInMaximumRVR3",60}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Y1",269}, - {""}, - {"sourceSinkChemicalPhysicalProcess",2019}, - {""}, {""}, {""}, - {"section6UniqueIdentifier",1950}, - {""}, {""}, - {"Date_E2",26}, + {"windUnitsTrend2",2329}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"beginMonthTrend2",343}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"spacingOfBinsAlongRadials",2033}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"extremeValuesRVR4",824}, - {""}, {""}, - {"hoursAfterReferenceTimeOfDataCutoff",932}, - {""}, {""}, - {"runwayFrictionCodeValueState4",1819}, + {""}, {""}, {""}, {""}, {""}, + {"unusedBitsInBitmap",2244}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"TYPE_AN",235}, + {""}, {""}, {""}, {""}, {""}, + {"P_TACC",213}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"windGustTrend3",2314}, - {""}, {""}, - {"cloudsAbbreviation1Trend3",427}, + {"Time_Range_One_E2",245}, + {"padding_grid50_1",1540}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_sec1_loc",1596}, + {"cloudsBase1Trend4",449}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"beginYearTrend1",346}, - {"Threshold_Or_Distribution_0_no_1_yes",241}, - {""}, {""}, {""}, {""}, - {"section_7",1983}, - {""}, {""}, {""}, - {"section7UniqueIdentifier",1954}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"numberOfTensOfThousandsOfYearsOfOffset",1435}, + {""}, + {"padding_local1_1",1594}, {""}, {""}, {""}, {""}, {""}, - {"FMULTM",66}, + {"extremeCounterClockwiseWindDirection",822}, {""}, {""}, {""}, {""}, - {"extremeValuesRVR2",822}, - {""}, {""}, {""}, {""}, {""}, - {"runwayFrictionCodeValueState2",1817}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"section_07",1972}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"variationOfVisibilityTrend3",2266}, + {"genVertHeightCoords",877}, {""}, {""}, {""}, {""}, - {"cloudsAbbreviation4Trend3",442}, - {""}, {""}, {""}, {""}, {""}, - {"beginMonthTrend1",342}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"Original_Parameter_Identifier",203}, - {"typicalYear2",2214}, + {"numberOfUsefulPointsAlongYAxis",1443}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfBitsForScaledGroupLengths",1337}, + {""}, + {"presentWeather3PresentTrend1",1671}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"coordAveraging1",569}, - {""}, {""}, {""}, - {"runwayDepthOfDepositState3",1798}, - {""}, {""}, {""}, {""}, - {"latitudeOfThePolePointInDegrees",1064}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayDesignatorRVR3",1802}, - {"cloudsAbbreviation3Trend1",435}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"ZLBASE",280}, - {""}, {""}, - {"oneMinuteMeanMaximumRVR1",1497}, + {"Local_Number_Members_Missing_E4",132}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"cloudsBase1Trend3",448}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"presentWeather2PresentTrend2",1667}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwaySideCodeState1",1828}, - {"cloudsAbbreviation2Trend3",432}, + {"Original_Parameter_Identifier",205}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"cloudsBaseCoded4Trend1",481}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"extractAreaLatitudeRank",788}, + {"TYPE_PF",242}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"cloudsBaseCoded3Trend2",477}, + {"Local_Number_Members_Missing_E3",131}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"experimentVersionNumber1",776}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"biFourierPackingModeForAxes",352}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsCode2Trend3",492}, - {""}, {""}, - {"windUnitsTrend1",2323}, - {""}, {""}, {""}, {""}, - {"cloudsBase2",449}, - {""}, {""}, {""}, {""}, {""}, - {"ceilingAndVisibilityOKTrend3",390}, + {"Local_Number_Members_Possible_E4",136}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"extractDateTimeDayRank",794}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Y2",271}, - {"Minute_E3",157}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"windGustTrend1",2312}, - {""}, {""}, - {"cloudsAbbreviation1Trend1",425}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"Minute_E2",158}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"numberOfBytesOfFreeFormatData",1344}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"cloudsAbbreviation3Trend4",438}, - {""}, {""}, - {"Number_Combination_Ensembles_1_none",196}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"oneMinuteMeanMaximumRVR4",1500}, - {""}, {""}, {""}, - {"offsetFromOriginToInnerBound",1476}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"NB",171}, - {""}, {""}, - {"runwayExtentOfContaminationState3",1814}, - {"superblockExtensionAddress",2088}, - {""}, {""}, - {"runwayExtentOfContaminationCodeState3",1810}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwaySideCodeState4",1831}, + {"Local_Number_Members_Possible_E3",135}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBaseCoded2Trend3",472}, - {""}, {""}, {""}, {""}, - {"variationOfVisibilityTrend1",2264}, - {""}, {""}, {""}, {""}, - {"cloudsAbbreviation4Trend1",440}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsCode2Trend1",490}, + {"numberOfBitsUsedForTheScaledGroupLengths",1342}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"isCavokTrend2",987}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"ceilingAndVisibilityOKTrend1",388}, - {"cloudsBase1",444}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"TYPE_FX",239}, {"************_EXPERIMENT_************",2}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayDepthOfDepositState1",1796}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"runwayDesignatorRVR1",1800}, - {"beginMonthTrend3",344}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"presentWeather3PresentTrend2",1672}, {""}, {""}, - {"extractDateTimeYearRank",811}, + {"P_TAVG",214}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"LSTCUM",99}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"presentWeather2Present",1660}, - {"offsetBSection6",1467}, - {"lastMonthUsedToBuildClimateMonth1",1036}, - {""}, {""}, - {"windGustTrend4",2315}, - {""}, - {"cloudsAbbreviation2Trend1",430}, - {"cloudsAbbreviation1Trend4",428}, - {""}, {""}, {""}, - {"runwayFrictionCoefficientCodeState3",1822}, - {""}, {""}, {""}, - {"section_11",1977}, - {"cloudsCode2Trend4",493}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"ceilingAndVisibilityOKTrend4",391}, - {""}, - {"runwayExtentOfContaminationState1",1812}, - {""}, {""}, {""}, - {"runwayExtentOfContaminationCodeState1",1808}, - {""}, {""}, {""}, {""}, {""}, - {"bufrHeaderSubCentre",372}, - {""}, {""}, {""}, - {"cloudsAbbreviation3Trend2",436}, - {""}, {""}, {""}, {""}, {""}, - {"latitudeOfSouthEastCornerOfArea",1054}, - {""}, {""}, {""}, - {"oneMinuteMeanMaximumRVR2",1498}, - {""}, {""}, {""}, {""}, {""}, - {"cloudsBaseCoded2Trend1",470}, - {""}, {""}, {""}, {""}, {""}, - {"TYPE_OR",239}, - {""}, - {"setBitsPerValue",1989}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"runwaySideCodeState2",1829}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"typeOfLevelECMF",2195}, + {""}, {""}, {""}, + {"cloudsBaseCoded4Trend2",482}, {""}, {""}, {""}, {""}, - {"endHourTrend3",725}, + {"oneMinuteMeanMinimumRVR2",1505}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"variationOfVisibilityTrend4",2267}, - {""}, {""}, {""}, {""}, - {"cloudsAbbreviation4Trend4",443}, + {"pastTendencyRVR3",1627}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsCode2Trend2",491}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsCode1Trend3",487}, - {""}, {""}, {""}, - {"presentWeather3Present",1665}, - {""}, {""}, - {"ceilingAndVisibilityOKTrend2",389}, - {""}, {""}, - {"runwayExtentOfContaminationState4",1815}, - {""}, {""}, {""}, - {"runwayExtentOfContaminationCodeState4",1811}, - {""}, {""}, - {"experimentVersionNumber2",777}, + {"cloudsBase1Trend1",446}, + {"offsetBeforeBitmap",1472}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayDepthOfDepositState4",1799}, - {""}, {""}, {""}, {""}, - {"cloudsBaseCoded2Trend4",473}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayDesignatorRVR4",1803}, - {""}, {""}, {""}, {""}, - {"runwayFrictionCoefficientCodeState1",1820}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"ExtremeValuesRVR3",63}, - {""}, - {"ICEFieldsUsed",86}, - {""}, - {"hoursAfterDataCutoff",931}, - {""}, {""}, {""}, {""}, {""}, - {"BUFR",19}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"lastMonthUsedToBuildClimateMonth2",1037}, - {""}, - {"windGustTrend2",2313}, - {"Time_Range_One_E3",244}, - {""}, - {"cloudsAbbreviation1Trend2",426}, - {"cloudsAbbreviation2Trend4",433}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"oneMinuteMeanMinimumRVR3",1503}, - {""}, {""}, {""}, - {"runwayExtentOfContaminationState2",1813}, - {""}, {""}, {""}, - {"runwayExtentOfContaminationCodeState2",1809}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"beginHourTrend3",336}, - {""}, {""}, - {"endYearTrend3",747}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBaseCoded2",469}, - {""}, - {"extractDateTimeHourRank",798}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBaseCoded2Trend2",471}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBaseCoded1Trend3",467}, - {"extractDateTimeMinuteRank",801}, - {""}, {""}, {""}, {""}, {""}, - {"extractDateTimeMonthRank",804}, - {"runwayFrictionCoefficientCodeState4",1823}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"Extra_Data_FreeFormat_0_none",56}, - {""}, {""}, {""}, - {"cloudsCode1Trend1",485}, {""}, {""}, {""}, {""}, {""}, {""}, - {"TYPE_OF",238}, + {"Threshold_Or_Distribution_0_no_1_yes",243}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"variationOfVisibilityTrend2",2265}, - {""}, {""}, {""}, {""}, - {"cloudsAbbreviation4Trend2",441}, - {""}, {""}, - {"cloudsBase3",454}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"Minute_E4",158}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Local_Number_Members_Missing_E3",129}, - {"padding_grid50_1",1537}, - {"ExtremeValuesRVR1",61}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayDepthOfDepositState2",1797}, - {""}, {""}, - {"beginMonthTrend4",345}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"runwayDesignatorRVR2",1801}, - {""}, {""}, {""}, {""}, {""}, - {"runwayFrictionCoefficientCodeState2",1821}, - {""}, {""}, {""}, {""}, - {"numberOfMissingValues",1395}, - {""}, - {"Local_Number_Members_Possible_E3",133}, - {""}, {""}, {""}, {""}, - {"cloudsCode1Trend4",488}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"beginYearTrend3",348}, + {"RVR4_1",220}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsAbbreviation2Trend2",431}, - {""}, {""}, - {"offsetBeforePV",1472}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"endHourTrend1",723}, - {"cloudsBaseCoded1",464}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBaseCoded1Trend1",465}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"ExtremeValuesRVR4",64}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"XpInGridLengths",268}, - {""}, {""}, - {"Time_Range_One_E4",245}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_local11_1",1590}, - {"*********_EXTRA_DATA_***************",4}, - {"beginHourTrend2",335}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsCode1Trend2",486}, - {""}, {""}, {""}, {""}, {""}, - {"TYPE_FF",236}, + {"pastTendencyRVR4",1628}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"coordAveraging3",571}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Minute_E2",156}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"RVR3_1",219}, + {"ExtremeValuesInMaximumRVR1",58}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBaseCoded1Trend4",468}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"ExtremeValuesRVR2",62}, {""}, {""}, {""}, - {"oneMinuteMeanMinimumRVR1",1501}, + {"Hour_E4",86}, + {"cloudsBase2Trend4",454}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"Original_CodeTable_2_Version_Number",203}, + {""}, {""}, {""}, {""}, {""}, + {"swapScanningY",2097}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Time_Range_One_E2",243}, + {"padding_local11_1",1593}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"cloudsBase1Trend2",447}, {""}, - {"endYearTrend1",745}, + {"cloudsBase2Trend3",453}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfVGridUsed",1441}, + {"YY",277}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"offsetBBitmap",1465}, - {""}, {""}, - {"pastTendencyRVR2",1621}, - {"numberOfPointsAlongTheYAxis",1411}, - {""}, {""}, {""}, {""}, - {"Local_Number_Members_Missing_E4",130}, - {"TYPE_PF",240}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"endHourTrend4",726}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"beginYearTrend2",347}, - {"cloudsBaseCoded1Trend2",466}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"TYPE_CF",236}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"Local_Number_Members_Missing_E2",130}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"windUnitsTrend3",2325}, + {"pastTendencyRVR2",1626}, + {"offsetToEndOf4DvarWindow",1494}, {""}, - {"ECMWF_s",46}, + {"Hour_E3",85}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Local_Number_Members_Possible_E4",134}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"cloudsCode3Trend3",497}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"Ensemble_Identifier_E4",55}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBase4",459}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Local_Number_Members_Missing_E2",128}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Ensemble_Identifier_E3",53}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"Local_Number_Members_Possible_E2",134}, {""}, {""}, {""}, - {"coordAveraging2",570}, - {""}, {""}, {""}, {""}, - {"Local_Number_Members_Possible_E2",132}, + {"cloudsBase3Trend4",459}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"oneMinuteMeanMinimumRVR4",1504}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"endYearTrend4",748}, - {""}, - {"pastTendencyRVR1",1620}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"padding_local1_31",1595}, + {""}, {""}, {""}, + {"X1InGridLengths",263}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"cloudsCode4Trend3",502}, + {"Time_Range_Two_E4",250}, + {"Ensemble_Identifier_E3",54}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBaseCoded3",474}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBaseCoded3Trend3",477}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"endHourTrend2",724}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsCode3Trend1",495}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"intervalBetweenTimes",979}, + {""}, {""}, {""}, + {"RVR1_1",217}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"cloudsBase3Trend3",458}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"numberOfPointsAlongYAxisInCouplingArea",1418}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"windUnitsTrend2",2324}, - {""}, - {"CCCC",21}, - {""}, {""}, {""}, {""}, {""}, - {"padding_local1_1",1591}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"Time_Range_Two_E3",249}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc9_1",1588}, - {"padding_loc7_1",1587}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsCode3Trend4",498}, - {""}, {""}, {""}, {""}, - {"Original_CodeTable_2_Version_Number",201}, - {"typeOfLevelECMF",2190}, - {""}, - {"cloudsBaseCoded4Trend3",482}, - {""}, {""}, {""}, {""}, - {"padding_loc6_1",1586}, - {""}, {""}, {""}, {""}, {""}, - {"padding_local40_1",1593}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"oneMinuteMeanMinimumRVR2",1502}, - {"cloudsCode4Trend1",500}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfUnusedBitsAtEndOfSection3",1436}, {""}, {""}, - {"padding_loc50_1",1584}, + {"padding_loc9_1",1591}, + {"padding_loc7_1",1590}, {""}, {""}, {""}, {""}, {""}, - {"endYearTrend2",746}, - {""}, - {"cloudsBaseCoded3Trend1",475}, - {""}, - {"************_ENSEMBLE_**************",1}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc190_1",1554}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Ensemble_Identifier_E4",54}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"altitudeOfTheCameraFromTheEarthSCenterMeasuredInUnitsOfTheEarth",297}, + {"padding_loc6_1",1589}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsCode3Trend2",496}, + {"cloudsBase2Trend1",451}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"padding_loc5_1",1588}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"presentWeather1PresentTrend3",1658}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsCode4Trend4",503}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBaseCoded3Trend4",478}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"extractDateTimeSecondRank",807}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Ensemble_Identifier_E2",52}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBaseCoded4Trend1",480}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"cloudsBase4Trend4",464}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"TYPE_FX",237}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"numberOfBitsContainingEachPackedValue",1336}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"pastTendencyRVR3",1622}, - {"cloudsCode4Trend2",501}, + {"ExtremeValuesInMaximumRVR2",59}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBaseCoded3Trend2",476}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"X2InGridLengths",265}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"Extra_Data_FreeFormat_0_none",57}, {""}, {""}, {""}, - {"padding_loc5_1",1585}, - {"isCavokTrend3",985}, - {""}, {""}, {""}, {""}, - {"cloudsBaseCoded4",479}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBaseCoded4Trend4",483}, - {""}, {""}, {""}, {""}, {""}, - {"numberOfBitsUsedForTheScaledGroupLengths",1339}, - {""}, {""}, {""}, - {"presentWeather1PresentTrend1",1656}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"cloudsBase4Trend3",463}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"unusedBitsInBitmap",2239}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"RVR2_1",218}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"cloudsBaseCoded4Trend2",481}, - {""}, - {"offsetBeforeBitmap",1469}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"presentWeather1PresentTrend4",1659}, - {"padding_loc9_2",1589}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"cloudsBase3Trend1",456}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"numberInHorizontalCoordinates",1328}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"ccsdsCompressionOptionsMask",384}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"gts_CCCC",912}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfBytesOfFreeFormatData",1341}, - {""}, - {"presentWeather1PresentTrend2",1657}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_local1_31",1592}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"TYPE_AN",233}, + {"cloudsBase2Trend2",452}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6439,22 +6644,15 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"HourOfModelVersion",82}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"isCavokTrend1",983}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"pastTendencyRVR4",1623}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_loc50_1",1587}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"P_TACC",211}, {""}, - {"versionNumberOfSuperblock",2279}, + {"GRIBEditionNumber",75}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6462,30 +6660,30 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"extractAreaLongitudeRank",789}, + {""}, {""}, + {"YpInGridLengths",281}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"YearOfModelVersion",276}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"Ensemble_Identifier_E2",53}, + {"cloudsBase4Trend1",461}, + {"padding_loc191_1",1558}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"isCavokTrend4",986}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"cloudsBase3Trend2",457}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"padding_loc9_2",1592}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"RVR3_1",217}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_local_35",1594}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfUsefulPointsAlongYAxis",1440}, - {"bitsPerValueAndRepack",365}, + {"Time_Range_Two_E2",248}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6499,103 +6697,59 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"cloudsBase2Trend3",452}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"RVR1_1",215}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"isCavokTrend2",984}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"TYPE_CF",234}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"presentWeather2PresentTrend3",1663}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"Less_Than_Or_To_Overall_Distribution",120}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"RVR4_1",218}, - {""}, - {"ExtremeValuesInMaximumRVR3",59}, + {""}, {""}, + {"cloudsBase4Trend2",462}, + {"padding_loc192_1",1561}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBase2Trend1",450}, + {"padding_loc13_4",1548}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"precisionOfTheUnpackedSubset",1647}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"presentWeather3PresentTrend3",1668}, - {""}, {""}, {""}, - {"ccsdsBlockSize",383}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"RVR2_1",216}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"presentWeather2PresentTrend1",1661}, - {""}, {""}, {""}, {""}, {""}, - {"numberOfTensOfThousandsOfYearsOfOffset",1432}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"numberOfPointsAlongYAxisInCouplingArea",1415}, - {""}, {""}, {""}, {""}, - {"cloudsBase2Trend4",453}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"padding_grid5_1",1538}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"TYPE_FC",237}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"presentWeather2PresentTrend4",1664}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"Hour_E3",84}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"presentWeather3PresentTrend1",1666}, - {""}, {""}, - {"cloudsBase2Trend2",451}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBase1Trend3",447}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_sec2_3",1599}, + {"padding_local_35",1597}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"padding_grid3_1",1535}, + {""}, {""}, {""}, {""}, + {"Hour_E2",84}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"Missing_Model_LBC",159}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"padding_loc191_3",1560}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"presentWeather2PresentTrend2",1662}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"ExtremeValuesInMaximumRVR1",57}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"P_TAVG",212}, - {""}, {""}, {""}, {""}, - {"presentWeather3PresentTrend4",1669}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6604,82 +6758,58 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"cloudsBase1Trend1",445}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc29_1",1572}, - {""}, {""}, {""}, - {"padding_grid1_1",1533}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"presentWeather3PresentTrend2",1667}, {""}, {""}, {""}, {""}, - {"padding_loc20_1",1560}, + {"Missing_Model_LBC",161}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"X1InGridLengths",261}, + {""}, {""}, {""}, + {"meanValueRVR4",1257}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBase1Trend4",448}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"ExtremeValuesInMaximumRVR4",60}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"padding_grid4_1",1536}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"numberOfBitsUsedForTheGroupWidths",1341}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"padding_sec2_1",1597}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"cloudsBase1Trend2",446}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc13_5",1546}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"meanValueRVR3",1256}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"X2InGridLengths",263}, - {""}, - {"padding_loc2_1",1575}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc28_1",1571}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"GRIBEditionNumber",74}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"ExtremeValuesInMaximumRVR2",58}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Hour_E4",85}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_loc191_2",1559}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"padding_loc191_2",1556}, - {""}, - {"cloudsBase3Trend3",457}, + {"lBB",1033}, + {""}, {""}, {""}, {""}, + {"padding_loc13_5",1549}, + {""}, {""}, + {"padding_sec2_3",1602}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Time_Range_Two_E3",247}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc10_1",1540}, + {"padding_grid4_1",1539}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6689,25 +6819,16 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"padding_grid3_1",1538}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"cloudsBase4Trend3",462}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"YY",275}, - {""}, - {"Hour_E2",83}, - {"cloudsBase3Trend1",455}, - {""}, {""}, {""}, {""}, - {"padding_loc191_1",1555}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"padding_sec2_2",1598}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6715,74 +6836,50 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc18_1",1552}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"cloudsBase3Trend4",458}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"padding_loc2_2",1576}, - {""}, {""}, - {"Time_Range_Two_E4",248}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"cloudsBase4Trend1",460}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"Threshold_Or_Distribution_Units",242}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"runwayBrakingActionState4",1788}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBase3Trend2",456}, - {""}, {""}, {""}, {""}, - {"padding_loc192_1",1558}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Time_Range_Two_E2",246}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"cloudsBase4Trend4",463}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"swapScanningY",2092}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"LBC_Initial_Conditions",98}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"extremeCounterClockwiseWindDirection",820}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"padding_loc18_1",1555}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"padding_loc13_4",1545}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"cloudsBase4Trend2",461}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_grid1_1",1536}, {""}, - {"gts_CCCC",909}, - {""}, {""}, {""}, {""}, {""}, - {"padding_loc29_3",1574}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"GRIB",71}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"runwayBrakingActionState3",1787}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc191_3",1557}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc30_1",1577}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_loc10_1",1543}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"TYPE_FC",235}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6790,55 +6887,42 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"Less_Than_Or_To_Overall_Distribution",122}, + {""}, + {"meanValueRVR1",1254}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_sec3_1",1600}, + {""}, {""}, {""}, {""}, {""}, + {"BUDG",18}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"numberOfBitsUsedForTheGroupWidths",1338}, + {"GRIBEXSection1Problem",72}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"YpInGridLengths",279}, - {""}, {""}, {""}, - {"padding_loc29_2",1573}, - {""}, {""}, {""}, - {"padding_grid1_2",1534}, - {"genVertHeightCoords",875}, + {"padding_grid5_1",1541}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"padding_loc3_1",1582}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc38_1",1581}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"Local_Number_Members_Used_E3",137}, - {""}, {""}, - {"lBB",1030}, - {"padding_sec4_1",1601}, {""}, {""}, - {"LBC_Initial_Conditions",97}, + {"padding_sec2_1",1600}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"offsetToEndOf4DvarWindow",1491}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"padding_loc2_1",1578}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"GRIB",70}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6846,82 +6930,103 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"padding_loc244_1",1566}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Ensemble_Combinat_Number_0_none_E3",48}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"padding_loc19_2",1562}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_loc18_2",1556}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Local_Number_Members_Used_E4",138}, + {"padding_sec3_1",1603}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc19_2",1559}, + {"padding_grid1_2",1537}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_loc29_1",1575}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_loc28_1",1574}, + {""}, {""}, + {"padding_loc3_1",1585}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"Y1InGridLengths",272}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Local_Number_Members_Used_E2",136}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"GRIBEXSection1Problem",71}, + {""}, + {"Local_Number_Members_Used_E4",140}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"padding_loc20_1",1563}, + {""}, {""}, {""}, + {"padding_loc29_3",1577}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Ensemble_Combinat_Number_0_none_E4",49}, + {"meanValueRVR2",1255}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"runwayBrakingActionState1",1785}, + {""}, {""}, {""}, {""}, + {"Local_Number_Members_Used_E3",139}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"padding_loc4_2",1583}, + {""}, {""}, + {"padding_sec4_1",1604}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"Ensemble_Combinat_Number_0_none_E4",50}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc18_2",1553}, - {""}, {""}, {""}, - {"Ensemble_Combinat_Number_0_none_E2",47}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"padding_loc38_1",1584}, + {""}, {""}, {""}, {""}, + {"padding_sec2_2",1601}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"Ensemble_Combinat_Number_0_none_E3",49}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"Y2InGridLengths",274}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"padding_loc2_2",1579}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc245_2",1567}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"padding_loc23_1",1562}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"BUDG",18}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_loc30_1",1580}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"padding_loc244_3",1568}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6934,17 +7039,16 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"padding_loc245_1",1569}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc245_1",1566}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc21_1",1561}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"padding_loc29_2",1576}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"padding_loc30_2",1578}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6952,62 +7056,60 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc15_1",1549}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"Threshold_Or_Distribution_Units",244}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"meanValueRVR3",1253}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"padding_loc244_2",1564}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"padding_loc13_1",1542}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"runwayBrakingActionState2",1786}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"NINT_RITZ_EXP",179}, + {"padding_loc244_2",1567}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"Local_Number_Members_Used_E2",138}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"padding_loc4_2",1586}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"padding_loc244_1",1563}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"padding_loc30_2",1581}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"padding_loc14_1",1550}, {""}, {""}, - {"Model_LBC_Member_Identifier",165}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"meanValueRVR1",1251}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc14_1",1547}, + {"Ensemble_Combinat_Number_0_none_E2",48}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"7777",5}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7016,11 +7118,11 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"padding_loc13_1",1545}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"padding_loc12_1",1541}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7029,29 +7131,21 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"padding_loc26_1",1568}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"meanValueRVR4",1254}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_loc13_3",1547}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"Missing_Model_LBC_E4",164}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Missing_Model_LBC_E3",161}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"padding_loc244_3",1565}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"padding_loc27_1",1569}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7062,11 +7156,11 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"meanValueRVR2",1252}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"Missing_Model_LBC_E3",163}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7075,16 +7169,19 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"Model_LBC_Member_Identifier",167}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_loc245_2",1570}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"INGRIB",90}, - {""}, {""}, {""}, - {"padding_loc16_1",1550}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"INGRIB",91}, + {"padding_loc14_2",1551}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7092,19 +7189,14 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"padding_loc13_3",1544}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"7777",5}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Original_Parameter_Iden_CodeTable2",202}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Y1InGridLengths",270}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_loc13_2",1546}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_loc15_1",1552}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7114,21 +7206,19 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"padding_loc12_1",1544}, + {""}, + {"padding_loc23_1",1565}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Missing_Model_LBC_E4",162}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"Y2InGridLengths",272}, - {""}, {""}, {""}, {""}, {""}, - {"padding_loc13_2",1543}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7139,13 +7229,14 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_loc16_1",1553}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Missing_Model_LBC_E2",160}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7154,34 +7245,34 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"Show_Combination_Ensem_E4_0_no_1_yes",227}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"Show_Combination_Ensem_E3_0_no_1_yes",224}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"padding_loc14_2",1548}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"padding_loc21_1",1564}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"Show_Combination_Ensem_E3_0_no_1_yes",226}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"runwayBrakingActionState3",1782}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc37_1",1579}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"NINT_RITZ_EXP",181}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7193,33 +7284,22 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Show_Combination_Ensem_E4_0_no_1_yes",225}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"Used_Model_LBC",255}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"padding_loc27_2",1570}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"NINT_LOG10_RITZ",178}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Show_Combination_Ensem_E2_0_no_1_yes",223}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"At_least__Or_Distribut_Proportion_Of",14}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"runwayBrakingActionState1",1780}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7233,6 +7313,8 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"padding_loc26_1",1571}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7243,41 +7325,47 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"runwayBrakingActionState4",1783}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_loc17_2",1554}, + {""}, {""}, + {"Missing_Model_LBC_E2",162}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"GRIBEX_boustrophedonic",74}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc17_2",1551}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"Show_Combination_Ensem_E2_0_no_1_yes",225}, + {""}, {""}, {""}, + {"Original_Parameter_Iden_CodeTable2",204}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"Used_Model_LBC",253}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"padding_loc27_1",1572}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayBrakingActionState2",1781}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"BBB",16}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7291,10 +7379,13 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"NINT_LOG10_RITZ",180}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_loc37_1",1582}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7321,8 +7412,6 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"padding_loc37_2",1580}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7330,6 +7419,8 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_loc27_2",1573}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7338,8 +7429,6 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"GRIBEX_boustrophedonic",73}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7361,10 +7450,10 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"padding_loc37_2",1583}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"BBB",16}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7393,6 +7482,8 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"GRIBEXShBugPresent",73}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7458,6 +7549,8 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"At_least__Or_Distribut_Proportion_Of",14}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7511,8 +7604,6 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"GRIBEXShBugPresent",72}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7587,17 +7678,20 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"Used_Model_LBC_E4",258}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"AEC_RESTRICTED_OPTION_MASK",12}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"AEC_PAD_RSI_OPTION_MASK",11}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"Used_Model_LBC_E3",257}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7616,6 +7710,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"AEC_PAD_RSI_OPTION_MASK",11}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7653,6 +7748,8 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"GRIB_LATITUDE",77}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7673,6 +7770,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"Used_Model_LBC_E2",256}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7694,12 +7792,12 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"GRIB_DEPTH",76}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"Used_Model_LBC_E3",255}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7730,24 +7828,17 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"Used_Model_LBC_E4",256}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"AEC_RESTRICTED_OPTION_MASK",12}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Used_Model_LBC_E2",254}, - {""}, {""}, {""}, - {"GRIB_LATITUDE",76}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7762,6 +7853,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"AEC_DATA_3BYTE_OPTION_MASK",7}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7769,7 +7861,6 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"GRIB_DEPTH",75}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7817,6 +7908,8 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"GRIB_LONGITUDE",78}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7902,8 +7995,6 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"GRIB_LONGITUDE",77}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -8026,8 +8117,6 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"AEC_DATA_3BYTE_OPTION_MASK",7}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -8054,6 +8143,8 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"AEC_DATA_MSB_OPTION_MASK",8}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -8321,8 +8412,6 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"AEC_DATA_MSB_OPTION_MASK",8}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -8458,6 +8547,8 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"AEC_DATA_SIGNED_OPTION_MASK",10}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -8543,8 +8634,6 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"AEC_DATA_SIGNED_OPTION_MASK",10}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -8836,17 +8925,12 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {"AEC_DATA_PREPROCESS_OPTION_MASK",9} }; -#ifdef __GNUC__ - -#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ -#endif -#endif const struct grib_keys_hash * -grib_keys_hash_get (const char *str, unsigned int len) +grib_keys_hash_get (const char* str, unsigned int len) { if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) { @@ -8878,277 +8962,277 @@ grib_keys_hash_get (const char *str, unsigned int len) **************************************/ static const int mapping[] = { -0, /* 00 */ -0, /* 01 */ -0, /* 02 */ -0, /* 03 */ -0, /* 04 */ -0, /* 05 */ -0, /* 06 */ -0, /* 07 */ -0, /* 08 */ -0, /* 09 */ -0, /* 0a */ -0, /* 0b */ -0, /* 0c */ -0, /* 0d */ -0, /* 0e */ -0, /* 0f */ -0, /* 10 */ -0, /* 11 */ -0, /* 12 */ -0, /* 13 */ -0, /* 14 */ -0, /* 15 */ -0, /* 16 */ -0, /* 17 */ -0, /* 18 */ -0, /* 19 */ -0, /* 1a */ -0, /* 1b */ -0, /* 1c */ -0, /* 1d */ -0, /* 1e */ -0, /* 1f */ -0, /* 20 */ -0, /* 21 */ -0, /* 22 */ -0, /* 23 */ -0, /* 24 */ -0, /* 25 */ -0, /* 26 */ -0, /* 27 */ -0, /* 28 */ -0, /* 29 */ -0, /* 2a */ -0, /* 2b */ -0, /* 2c */ -0, /* 2d */ -38, /* . */ -39, /* / */ -1, /* 0 */ -2, /* 1 */ -3, /* 2 */ -4, /* 3 */ -5, /* 4 */ -6, /* 5 */ -7, /* 6 */ -8, /* 7 */ -9, /* 8 */ -10, /* 9 */ -0, /* 3a */ -0, /* 3b */ -0, /* 3c */ -0, /* 3d */ -0, /* 3e */ -0, /* 3f */ -0, /* 40 */ -11, /* A */ -12, /* B */ -13, /* C */ -14, /* D */ -15, /* E */ -16, /* F */ -17, /* G */ -18, /* H */ -19, /* I */ -20, /* J */ -21, /* K */ -22, /* L */ -23, /* M */ -24, /* N */ -25, /* O */ -26, /* P */ -27, /* Q */ -28, /* R */ -29, /* S */ -30, /* T */ -31, /* U */ -32, /* V */ -33, /* W */ -34, /* X */ -35, /* Y */ -36, /* Z */ -0, /* 5b */ -0, /* 5c */ -0, /* 5d */ -0, /* 5e */ -37, /* _ */ -0, /* 60 */ -38, /* a */ -39, /* b */ -40, /* c */ -41, /* d */ -42, /* e */ -43, /* f */ -44, /* g */ -45, /* h */ -46, /* i */ -47, /* j */ -48, /* k */ -49, /* l */ -50, /* m */ -51, /* n */ -52, /* o */ -53, /* p */ -54, /* q */ -55, /* r */ -56, /* s */ -57, /* t */ -58, /* u */ -59, /* v */ -60, /* w */ -61, /* x */ -62, /* y */ -63, /* z */ -0, /* 7b */ -0, /* 7c */ -0, /* 7d */ -0, /* 7e */ -0, /* 7f */ -0, /* 80 */ -0, /* 81 */ -0, /* 82 */ -0, /* 83 */ -0, /* 84 */ -0, /* 85 */ -0, /* 86 */ -0, /* 87 */ -0, /* 88 */ -0, /* 89 */ -0, /* 8a */ -0, /* 8b */ -0, /* 8c */ -0, /* 8d */ -0, /* 8e */ -0, /* 8f */ -0, /* 90 */ -0, /* 91 */ -0, /* 92 */ -0, /* 93 */ -0, /* 94 */ -0, /* 95 */ -0, /* 96 */ -0, /* 97 */ -0, /* 98 */ -0, /* 99 */ -0, /* 9a */ -0, /* 9b */ -0, /* 9c */ -0, /* 9d */ -0, /* 9e */ -0, /* 9f */ -0, /* a0 */ -0, /* a1 */ -0, /* a2 */ -0, /* a3 */ -0, /* a4 */ -0, /* a5 */ -0, /* a6 */ -0, /* a7 */ -0, /* a8 */ -0, /* a9 */ -0, /* aa */ -0, /* ab */ -0, /* ac */ -0, /* ad */ -0, /* ae */ -0, /* af */ -0, /* b0 */ -0, /* b1 */ -0, /* b2 */ -0, /* b3 */ -0, /* b4 */ -0, /* b5 */ -0, /* b6 */ -0, /* b7 */ -0, /* b8 */ -0, /* b9 */ -0, /* ba */ -0, /* bb */ -0, /* bc */ -0, /* bd */ -0, /* be */ -0, /* bf */ -0, /* c0 */ -0, /* c1 */ -0, /* c2 */ -0, /* c3 */ -0, /* c4 */ -0, /* c5 */ -0, /* c6 */ -0, /* c7 */ -0, /* c8 */ -0, /* c9 */ -0, /* ca */ -0, /* cb */ -0, /* cc */ -0, /* cd */ -0, /* ce */ -0, /* cf */ -0, /* d0 */ -0, /* d1 */ -0, /* d2 */ -0, /* d3 */ -0, /* d4 */ -0, /* d5 */ -0, /* d6 */ -0, /* d7 */ -0, /* d8 */ -0, /* d9 */ -0, /* da */ -0, /* db */ -0, /* dc */ -0, /* dd */ -0, /* de */ -0, /* df */ -0, /* e0 */ -0, /* e1 */ -0, /* e2 */ -0, /* e3 */ -0, /* e4 */ -0, /* e5 */ -0, /* e6 */ -0, /* e7 */ -0, /* e8 */ -0, /* e9 */ -0, /* ea */ -0, /* eb */ -0, /* ec */ -0, /* ed */ -0, /* ee */ -0, /* ef */ -0, /* f0 */ -0, /* f1 */ -0, /* f2 */ -0, /* f3 */ -0, /* f4 */ -0, /* f5 */ -0, /* f6 */ -0, /* f7 */ -0, /* f8 */ -0, /* f9 */ -0, /* fa */ -0, /* fb */ -0, /* fc */ -0, /* fd */ -0, /* fe */ -0, /* ff */ + 0, /* 00 */ + 0, /* 01 */ + 0, /* 02 */ + 0, /* 03 */ + 0, /* 04 */ + 0, /* 05 */ + 0, /* 06 */ + 0, /* 07 */ + 0, /* 08 */ + 0, /* 09 */ + 0, /* 0a */ + 0, /* 0b */ + 0, /* 0c */ + 0, /* 0d */ + 0, /* 0e */ + 0, /* 0f */ + 0, /* 10 */ + 0, /* 11 */ + 0, /* 12 */ + 0, /* 13 */ + 0, /* 14 */ + 0, /* 15 */ + 0, /* 16 */ + 0, /* 17 */ + 0, /* 18 */ + 0, /* 19 */ + 0, /* 1a */ + 0, /* 1b */ + 0, /* 1c */ + 0, /* 1d */ + 0, /* 1e */ + 0, /* 1f */ + 0, /* 20 */ + 0, /* 21 */ + 0, /* 22 */ + 0, /* 23 */ + 0, /* 24 */ + 0, /* 25 */ + 0, /* 26 */ + 0, /* 27 */ + 0, /* 28 */ + 0, /* 29 */ + 0, /* 2a */ + 0, /* 2b */ + 0, /* 2c */ + 0, /* 2d */ + 38, /* . */ + 39, /* / */ + 1, /* 0 */ + 2, /* 1 */ + 3, /* 2 */ + 4, /* 3 */ + 5, /* 4 */ + 6, /* 5 */ + 7, /* 6 */ + 8, /* 7 */ + 9, /* 8 */ + 10, /* 9 */ + 0, /* 3a */ + 0, /* 3b */ + 0, /* 3c */ + 0, /* 3d */ + 0, /* 3e */ + 0, /* 3f */ + 0, /* 40 */ + 11, /* A */ + 12, /* B */ + 13, /* C */ + 14, /* D */ + 15, /* E */ + 16, /* F */ + 17, /* G */ + 18, /* H */ + 19, /* I */ + 20, /* J */ + 21, /* K */ + 22, /* L */ + 23, /* M */ + 24, /* N */ + 25, /* O */ + 26, /* P */ + 27, /* Q */ + 28, /* R */ + 29, /* S */ + 30, /* T */ + 31, /* U */ + 32, /* V */ + 33, /* W */ + 34, /* X */ + 35, /* Y */ + 36, /* Z */ + 0, /* 5b */ + 0, /* 5c */ + 0, /* 5d */ + 0, /* 5e */ + 37, /* _ */ + 0, /* 60 */ + 38, /* a */ + 39, /* b */ + 40, /* c */ + 41, /* d */ + 42, /* e */ + 43, /* f */ + 44, /* g */ + 45, /* h */ + 46, /* i */ + 47, /* j */ + 48, /* k */ + 49, /* l */ + 50, /* m */ + 51, /* n */ + 52, /* o */ + 53, /* p */ + 54, /* q */ + 55, /* r */ + 56, /* s */ + 57, /* t */ + 58, /* u */ + 59, /* v */ + 60, /* w */ + 61, /* x */ + 62, /* y */ + 63, /* z */ + 0, /* 7b */ + 0, /* 7c */ + 0, /* 7d */ + 0, /* 7e */ + 0, /* 7f */ + 0, /* 80 */ + 0, /* 81 */ + 0, /* 82 */ + 0, /* 83 */ + 0, /* 84 */ + 0, /* 85 */ + 0, /* 86 */ + 0, /* 87 */ + 0, /* 88 */ + 0, /* 89 */ + 0, /* 8a */ + 0, /* 8b */ + 0, /* 8c */ + 0, /* 8d */ + 0, /* 8e */ + 0, /* 8f */ + 0, /* 90 */ + 0, /* 91 */ + 0, /* 92 */ + 0, /* 93 */ + 0, /* 94 */ + 0, /* 95 */ + 0, /* 96 */ + 0, /* 97 */ + 0, /* 98 */ + 0, /* 99 */ + 0, /* 9a */ + 0, /* 9b */ + 0, /* 9c */ + 0, /* 9d */ + 0, /* 9e */ + 0, /* 9f */ + 0, /* a0 */ + 0, /* a1 */ + 0, /* a2 */ + 0, /* a3 */ + 0, /* a4 */ + 0, /* a5 */ + 0, /* a6 */ + 0, /* a7 */ + 0, /* a8 */ + 0, /* a9 */ + 0, /* aa */ + 0, /* ab */ + 0, /* ac */ + 0, /* ad */ + 0, /* ae */ + 0, /* af */ + 0, /* b0 */ + 0, /* b1 */ + 0, /* b2 */ + 0, /* b3 */ + 0, /* b4 */ + 0, /* b5 */ + 0, /* b6 */ + 0, /* b7 */ + 0, /* b8 */ + 0, /* b9 */ + 0, /* ba */ + 0, /* bb */ + 0, /* bc */ + 0, /* bd */ + 0, /* be */ + 0, /* bf */ + 0, /* c0 */ + 0, /* c1 */ + 0, /* c2 */ + 0, /* c3 */ + 0, /* c4 */ + 0, /* c5 */ + 0, /* c6 */ + 0, /* c7 */ + 0, /* c8 */ + 0, /* c9 */ + 0, /* ca */ + 0, /* cb */ + 0, /* cc */ + 0, /* cd */ + 0, /* ce */ + 0, /* cf */ + 0, /* d0 */ + 0, /* d1 */ + 0, /* d2 */ + 0, /* d3 */ + 0, /* d4 */ + 0, /* d5 */ + 0, /* d6 */ + 0, /* d7 */ + 0, /* d8 */ + 0, /* d9 */ + 0, /* da */ + 0, /* db */ + 0, /* dc */ + 0, /* dd */ + 0, /* de */ + 0, /* df */ + 0, /* e0 */ + 0, /* e1 */ + 0, /* e2 */ + 0, /* e3 */ + 0, /* e4 */ + 0, /* e5 */ + 0, /* e6 */ + 0, /* e7 */ + 0, /* e8 */ + 0, /* e9 */ + 0, /* ea */ + 0, /* eb */ + 0, /* ec */ + 0, /* ed */ + 0, /* ee */ + 0, /* ef */ + 0, /* f0 */ + 0, /* f1 */ + 0, /* f2 */ + 0, /* f3 */ + 0, /* f4 */ + 0, /* f5 */ + 0, /* f6 */ + 0, /* f7 */ + 0, /* f8 */ + 0, /* f9 */ + 0, /* fa */ + 0, /* fb */ + 0, /* fc */ + 0, /* fd */ + 0, /* fe */ + 0, /* ff */ }; #define SIZE 64 #if GRIB_PTHREADS -static pthread_once_t once = PTHREAD_ONCE_INIT; +static pthread_once_t once = PTHREAD_ONCE_INIT; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; -static void init() { - pthread_mutexattr_t attr; - pthread_mutexattr_init(&attr); - pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init(&mutex,&attr); - pthread_mutexattr_destroy(&attr); - +static void init() +{ + pthread_mutexattr_t attr; + pthread_mutexattr_init(&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&mutex, &attr); + pthread_mutexattr_destroy(&attr); } #elif GRIB_OMP_THREADS static int once = 0; @@ -9158,8 +9242,7 @@ static void init() { GRIB_OMP_CRITICAL(lock_grib_itrie_keys_c) { - if (once == 0) - { + if (once == 0) { omp_init_nest_lock(&mutex); once = 1; } @@ -9167,44 +9250,44 @@ static void init() } #endif -struct grib_itrie { - grib_itrie* next[SIZE]; - grib_context *context; - int id; - int* count; +struct grib_itrie +{ + grib_itrie* next[SIZE]; + grib_context* context; + int id; + int* count; }; -grib_itrie *grib_hash_keys_new(grib_context* c,int* count) +grib_itrie* grib_hash_keys_new(grib_context* c, int* count) { - grib_itrie* t = (grib_itrie*)grib_context_malloc_clear(c,sizeof(grib_itrie)); - t->context = c; - t->id=-1; - t->count=count; + grib_itrie* t = (grib_itrie*)grib_context_malloc_clear(c, sizeof(grib_itrie)); + t->context = c; + t->id = -1; + t->count = count; return t; } -void grib_hash_keys_delete(grib_itrie *t) +void grib_hash_keys_delete(grib_itrie* t) { - GRIB_MUTEX_INIT_ONCE(&once,&init); + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex); - if(t) { + if (t) { int i; - for(i = 0; i < SIZE; i++) + for (i = 0; i < SIZE; i++) if (t->next[i]) grib_hash_keys_delete(t->next[i]); - grib_context_free(t->context,t); - + grib_context_free(t->context, t); } GRIB_MUTEX_UNLOCK(&mutex); } -int grib_hash_keys_get_id(grib_itrie* t,const char* key) +int grib_hash_keys_get_id(grib_itrie* t, const char* key) { - const struct grib_keys_hash* hash=grib_keys_hash_get(key,strlen(key)); + const struct grib_keys_hash* hash = grib_keys_hash_get(key, strlen(key)); if (hash) { /* printf("%s found %s (%d)\n",key,hash->name,hash->id); */ @@ -9213,58 +9296,62 @@ int grib_hash_keys_get_id(grib_itrie* t,const char* key) /* printf("+++ \"%s\"\n",key); */ { - const char *k=key; - grib_itrie* last=t; + const char* k = key; + grib_itrie* last = t; - GRIB_MUTEX_INIT_ONCE(&once,&init); + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex); - while(*k && t) t = t->next[mapping[(int)*k++]]; + while (*k && t) + t = t->next[mapping[(int)*k++]]; - if(t != NULL && t->id != -1) { + if (t != NULL && t->id != -1) { GRIB_MUTEX_UNLOCK(&mutex); - return t->id+TOTAL_KEYWORDS+1; - } else { - int ret=grib_hash_keys_insert(last,key); + return t->id + TOTAL_KEYWORDS + 1; + } + else { + int ret = grib_hash_keys_insert(last, key); GRIB_MUTEX_UNLOCK(&mutex); - return ret+TOTAL_KEYWORDS+1; + return ret + TOTAL_KEYWORDS + 1; } } } -int grib_hash_keys_insert(grib_itrie* t,const char* key) +int grib_hash_keys_insert(grib_itrie* t, const char* key) { - const char *k = key; - grib_itrie *last = t; + const char* k = key; + grib_itrie* last = t; int* count; - GRIB_MUTEX_INIT_ONCE(&once,&init) + GRIB_MUTEX_INIT_ONCE(&once, &init) GRIB_MUTEX_LOCK(&mutex) - count=t->count; + count = t->count; - while(*k && t) { + while (*k && t) { last = t; - t = t->next[mapping[(int)*k]]; - if(t) k++; + t = t->next[mapping[(int)*k]]; + if (t) + k++; } - if (*k!=0) { - t=last; - while(*k) { - int j = mapping[(int)*k++]; - t->next[j] = grib_hash_keys_new(t->context,count); - t = t->next[j]; + if (*k != 0) { + t = last; + while (*k) { + int j = mapping[(int)*k++]; + t->next[j] = grib_hash_keys_new(t->context, count); + t = t->next[j]; } } - if (*(t->count)+TOTAL_KEYWORDS < ACCESSORS_ARRAY_SIZE) { - t->id=*(t->count); + if (*(t->count) + TOTAL_KEYWORDS < ACCESSORS_ARRAY_SIZE) { + t->id = *(t->count); (*(t->count))++; - } else { - grib_context_log(t->context,GRIB_LOG_ERROR, - "grib_hash_keys_insert: too many accessors, increase ACCESSORS_ARRAY_SIZE\n"); - Assert(*(t->count)+TOTAL_KEYWORDS < ACCESSORS_ARRAY_SIZE); + } + else { + grib_context_log(t->context, GRIB_LOG_ERROR, + "grib_hash_keys_insert: too many accessors, increase ACCESSORS_ARRAY_SIZE\n"); + Assert(*(t->count) + TOTAL_KEYWORDS < ACCESSORS_ARRAY_SIZE); } GRIB_MUTEX_UNLOCK(&mutex) @@ -9274,5 +9361,7 @@ int grib_hash_keys_insert(grib_itrie* t,const char* key) return t->id; } -int grib_hash_keys_get_size(grib_itrie* t) {return *(t->count);} - +int grib_hash_keys_get_size(grib_itrie* t) +{ + return *(t->count); +} diff --git a/src/grib_query.c b/src/grib_query.c index 5fcf013fc..9f0f13774 100644 --- a/src/grib_query.c +++ b/src/grib_query.c @@ -525,7 +525,6 @@ static grib_accessor* _grib_find_accessor(const grib_handle* ch, const char* nam char name_space[MAX_NAMESPACE_LEN]; char* basename = p + 1; p--; - i = 0; len = p - name + 1; for (i = 0; i < len; i++) diff --git a/tests/bufr_ecc-517.c b/tests/bufr_ecc-517.c index 4b8a8d867..4c1ed0187 100644 --- a/tests/bufr_ecc-517.c +++ b/tests/bufr_ecc-517.c @@ -82,7 +82,6 @@ int main(int argc, char** argv) CODES_CHECK(codes_set_long(h, "compressedData", 0), 0); free(ivalues); - ivalues = (long*)malloc(9 * sizeof(long)); if (!ivalues) { fprintf(stderr, "Failed to allocate memory (ivalues).\n"); diff --git a/tests/keys b/tests/keys index 938813ac2..38717d888 100644 --- a/tests/keys +++ b/tests/keys @@ -28,2332 +28,2337 @@ CDF,22 CDFstr,23 CLNOMA,24 DELETE,25 -Date_E2,26 -Date_E3,27 -Date_E4,28 -DayOfModelVersion,29 -Di,30 -DiGiven,31 -DiInDegrees,32 -DiInMetres,33 -Dj,34 -DjGiven,35 -DjInDegrees,36 -DjInMetres,37 -Dstart,38 -Dx,39 -DxInDegrees,40 -DxInMetres,41 -Dy,42 -DyInDegrees,43 -DyInMetres,44 -ECMWF,45 -ECMWF_s,46 -Ensemble_Combinat_Number_0_none_E2,47 -Ensemble_Combinat_Number_0_none_E3,48 -Ensemble_Combinat_Number_0_none_E4,49 -Ensemble_Combination_Number,50 -Ensemble_Identifier,51 -Ensemble_Identifier_E2,52 -Ensemble_Identifier_E3,53 -Ensemble_Identifier_E4,54 -Experiment_Identifier,55 -Extra_Data_FreeFormat_0_none,56 -ExtremeValuesInMaximumRVR1,57 -ExtremeValuesInMaximumRVR2,58 -ExtremeValuesInMaximumRVR3,59 -ExtremeValuesInMaximumRVR4,60 -ExtremeValuesRVR1,61 -ExtremeValuesRVR2,62 -ExtremeValuesRVR3,63 -ExtremeValuesRVR4,64 -FMULTE,65 -FMULTM,66 -FirstLatitude,67 -GDSPresent,68 -GG,69 -GRIB,70 -GRIBEXSection1Problem,71 -GRIBEXShBugPresent,72 -GRIBEX_boustrophedonic,73 -GRIBEditionNumber,74 -GRIB_DEPTH,75 -GRIB_LATITUDE,76 -GRIB_LONGITUDE,77 -GTS,78 -GTSstr,79 -HDF5,80 -HDF5str,81 -HourOfModelVersion,82 -Hour_E2,83 -Hour_E3,84 -Hour_E4,85 -ICEFieldsUsed,86 -ICPLSIZE,87 -II,88 -INBITS,89 -INGRIB,90 -ITERATOR,91 -ITN,92 -J,93 -JS,94 -K,95 -KS,96 -LBC_Initial_Conditions,97 -LLCOSP,98 -LSTCUM,99 -La1,100 -La1InDegrees,101 -La2,102 -LaD,103 -LaDInDegrees,104 -LaR,105 -Lap,106 -Lar1,107 -Lar1InDegrees,108 -Lar2,109 -Lar2InDegrees,110 -Latin,111 -Latin1,112 -Latin1InDegrees,113 -Latin2,114 -Latin2InDegrees,115 -Lcx,116 -LcxInMetres,117 -Lcy,118 -LcyInMetres,119 -Less_Than_Or_To_Overall_Distribution,120 -Lo1,121 -Lo1InDegrees,122 -Lo2,123 -LoR,124 -LoV,125 -LoVInDegrees,126 -Local_Number_Members_Missing,127 -Local_Number_Members_Missing_E2,128 -Local_Number_Members_Missing_E3,129 -Local_Number_Members_Missing_E4,130 -Local_Number_Members_Possible,131 -Local_Number_Members_Possible_E2,132 -Local_Number_Members_Possible_E3,133 -Local_Number_Members_Possible_E4,134 -Local_Number_Members_Used,135 -Local_Number_Members_Used_E2,136 -Local_Number_Members_Used_E3,137 -Local_Number_Members_Used_E4,138 -Lor1,139 -Lor1InDegrees,140 -Lor2,141 -Lor2InDegrees,142 -Lux,143 -LuxInMetres,144 -Luy,145 -LuyInMetres,146 -Lx,147 -LxInMetres,148 -Ly,149 -LyInMetres,150 -M,151 -METAR,152 -METARstr,153 -MS,154 -MinuteOfModelVersion,155 -Minute_E2,156 -Minute_E3,157 -Minute_E4,158 -Missing_Model_LBC,159 -Missing_Model_LBC_E2,160 -Missing_Model_LBC_E3,161 -Missing_Model_LBC_E4,162 -Model_Additional_Information,163 -Model_Identifier,164 -Model_LBC_Member_Identifier,165 -MonthOfModelVersion,166 -N,167 -N1,168 -N2,169 -NAT,170 -NB,171 -NC,172 -NC1,173 -NC2,174 -NEAREST,175 -NG,176 -NH,177 -NINT_LOG10_RITZ,178 -NINT_RITZ_EXP,179 -NL,180 -NP,181 -NR,182 -NRj,183 -NT,184 -NUT,185 -NV,186 -Nassigned,187 -Nb,188 -Ncx,189 -Ncy,190 -Nf,191 -Ni,192 -Nj,193 -Nr,194 -NrInRadiusOfEarth,195 -Number_Combination_Ensembles_1_none,196 -Nux,197 -Nuy,198 -Nx,199 -Ny,200 -Original_CodeTable_2_Version_Number,201 -Original_Parameter_Iden_CodeTable2,202 -Original_Parameter_Identifier,203 -P,204 -P1,205 -P2,206 -PLPresent,207 -PUnset,208 -PVPresent,209 -P_INST,210 -P_TACC,211 -P_TAVG,212 -Product_Identifier,213 -RENAME,214 -RVR1_1,215 -RVR2_1,216 -RVR3_1,217 -RVR4_1,218 -SOH,219 -SPD,220 -SecondLatitude,221 -SecondOfModelVersion,222 -Show_Combination_Ensem_E2_0_no_1_yes,223 -Show_Combination_Ensem_E3_0_no_1_yes,224 -Show_Combination_Ensem_E4_0_no_1_yes,225 -Sub-Experiment_Identifier,226 -TAF,227 -TAFstr,228 -TIDE,229 -TS,230 -TScalc,231 -TT,232 -TYPE_AN,233 -TYPE_CF,234 -TYPE_FC,235 -TYPE_FF,236 -TYPE_FX,237 -TYPE_OF,238 -TYPE_OR,239 -TYPE_PF,240 -Threshold_Or_Distribution_0_no_1_yes,241 -Threshold_Or_Distribution_Units,242 -Time_Range_One_E2,243 -Time_Range_One_E3,244 -Time_Range_One_E4,245 -Time_Range_Two_E2,246 -Time_Range_Two_E3,247 -Time_Range_Two_E4,248 -Total_Number_Members_Missing,249 -Total_Number_Members_Possible,250 -Total_Number_Members_Used,251 -UseEcmfConventions,252 -Used_Model_LBC,253 -Used_Model_LBC_E2,254 -Used_Model_LBC_E3,255 -Used_Model_LBC_E4,256 -WMO,257 -WRAP,258 -WRAPstr,259 -X1,260 -X1InGridLengths,261 -X2,262 -X2InGridLengths,263 -XR,264 -XRInMetres,265 -Xo,266 -Xp,267 -XpInGridLengths,268 -Y1,269 -Y1InGridLengths,270 -Y2,271 -Y2InGridLengths,272 -YR,273 -YRInMetres,274 -YY,275 -YearOfModelVersion,276 -Yo,277 -Yp,278 -YpInGridLengths,279 -ZLBASE,280 -ZLMULT,281 -_T,282 -_TS,283 -_anoffset,284 -_leg_number,285 -_numberOfValues,286 -accumulationInterval,287 -accuracyMultipliedByFactor,288 -addEmptySection2,289 -addExtraLocalSection,290 -additionalFlagPresent,291 -addressOfFileFreeSpaceInfo,292 -aerosolType,293 -aerosolbinnumber,294 -aerosolpacking,295 -alternativeRowScanning,296 -altitudeOfTheCameraFromTheEarthSCenterMeasuredInUnitsOfTheEarth,297 -analysisOffsets,298 -angleDivisor,299 -angleMultiplier,300 -angleOfRotation,301 -angleOfRotationInDegrees,302 -angleOfRotationOfProjection,303 -angleSubdivisions,304 -angularPrecision,305 -anoffset,306 -anoffsetFirst,307 -anoffsetFrequency,308 -anoffsetLast,309 -applicationIdentifier,310 -assertion,311 -atmosphericChemicalOrPhysicalConstituentType,312 -attributeOfTile,313 -auxiliary,314 -average,315 -averaging1Flag,316 -averaging2Flag,317 -averagingPeriod,318 -avg,319 -azimuthalWidth,320 -backgroundGeneratingProcessIdentifier,321 -backgroundProcess,322 -band,323 -baseAddress,324 -baseDateEPS,325 -baseDateOfThisLeg,326 -baseTimeEPS,327 -baseTimeOfThisLeg,328 -basicAngleOfTheInitialProductionDomain,329 -beginDayTrend1,330 -beginDayTrend2,331 -beginDayTrend3,332 -beginDayTrend4,333 -beginHourTrend1,334 -beginHourTrend2,335 -beginHourTrend3,336 -beginHourTrend4,337 -beginMinuteTrend1,338 -beginMinuteTrend2,339 -beginMinuteTrend3,340 -beginMinuteTrend4,341 -beginMonthTrend1,342 -beginMonthTrend2,343 -beginMonthTrend3,344 -beginMonthTrend4,345 -beginYearTrend1,346 -beginYearTrend2,347 -beginYearTrend3,348 -beginYearTrend4,349 -biFourierCoefficients,350 -biFourierMakeTemplate,351 -biFourierPackingModeForAxes,352 -biFourierResolutionParameterM,353 -biFourierResolutionParameterN,354 -biFourierResolutionSubSetParameterM,355 -biFourierResolutionSubSetParameterN,356 -biFourierSubTruncationType,357 -biFourierTruncationType,358 -binaryScaleFactor,359 -bitMapIndicator,360 -bitmap,361 -bitmapPresent,362 -bitmapSectionPresent,363 -bitsPerValue,364 -bitsPerValueAndRepack,365 -boot_edition,366 -bottomLevel,367 -boustrophedonic,368 -boustrophedonicOrdering,369 -bufrDataEncoded,370 -bufrHeaderCentre,371 -bufrHeaderSubCentre,372 -bufrTemplate,373 -bufrdcExpandedDescriptors,374 -calendarIdPresent,375 -calendarIdentification,376 -calendarIdentificationTemplateNumber,377 -cat,378 -categories,379 -categoryType,380 -cavokOrVisibility,381 -ccccIdentifiers,382 -ccsdsBlockSize,383 -ccsdsCompressionOptionsMask,384 -ccsdsFlags,385 -ccsdsRsi,386 -ceilingAndVisibilityOK,387 -ceilingAndVisibilityOKTrend1,388 -ceilingAndVisibilityOKTrend2,389 -ceilingAndVisibilityOKTrend3,390 -ceilingAndVisibilityOKTrend4,391 -centralClusterDefinition,392 -centralLongitude,393 -centralLongitudeInDegrees,394 -centralLongitudeInMicrodegrees,395 -centre,396 -centreDescription,397 -centreForLocal,398 -centreForTable2,399 -centuryOfAnalysis,400 -centuryOfReference,401 -centuryOfReferenceTimeOfData,402 -cfName,403 -cfNameECMF,404 -cfVarName,405 -cfVarNameECMF,406 -changeDecimalPrecision,407 -changeIndicatorTrend1,408 -changeIndicatorTrend2,409 -changeIndicatorTrend3,410 -changeIndicatorTrend4,411 -changingPrecision,412 -channel,413 -channelNumber,414 -char,415 -charValues,416 -checkInternalVersion,417 -class,418 -classOfAnalysis,419 -clearTables,420 -climateDateFrom,421 -climateDateTo,422 -climatologicalRegime,423 -cloudsAbbreviation1,424 -cloudsAbbreviation1Trend1,425 -cloudsAbbreviation1Trend2,426 -cloudsAbbreviation1Trend3,427 -cloudsAbbreviation1Trend4,428 -cloudsAbbreviation2,429 -cloudsAbbreviation2Trend1,430 -cloudsAbbreviation2Trend2,431 -cloudsAbbreviation2Trend3,432 -cloudsAbbreviation2Trend4,433 -cloudsAbbreviation3,434 -cloudsAbbreviation3Trend1,435 -cloudsAbbreviation3Trend2,436 -cloudsAbbreviation3Trend3,437 -cloudsAbbreviation3Trend4,438 -cloudsAbbreviation4,439 -cloudsAbbreviation4Trend1,440 -cloudsAbbreviation4Trend2,441 -cloudsAbbreviation4Trend3,442 -cloudsAbbreviation4Trend4,443 -cloudsBase1,444 -cloudsBase1Trend1,445 -cloudsBase1Trend2,446 -cloudsBase1Trend3,447 -cloudsBase1Trend4,448 -cloudsBase2,449 -cloudsBase2Trend1,450 -cloudsBase2Trend2,451 -cloudsBase2Trend3,452 -cloudsBase2Trend4,453 -cloudsBase3,454 -cloudsBase3Trend1,455 -cloudsBase3Trend2,456 -cloudsBase3Trend3,457 -cloudsBase3Trend4,458 -cloudsBase4,459 -cloudsBase4Trend1,460 -cloudsBase4Trend2,461 -cloudsBase4Trend3,462 -cloudsBase4Trend4,463 -cloudsBaseCoded1,464 -cloudsBaseCoded1Trend1,465 -cloudsBaseCoded1Trend2,466 -cloudsBaseCoded1Trend3,467 -cloudsBaseCoded1Trend4,468 -cloudsBaseCoded2,469 -cloudsBaseCoded2Trend1,470 -cloudsBaseCoded2Trend2,471 -cloudsBaseCoded2Trend3,472 -cloudsBaseCoded2Trend4,473 -cloudsBaseCoded3,474 -cloudsBaseCoded3Trend1,475 -cloudsBaseCoded3Trend2,476 -cloudsBaseCoded3Trend3,477 -cloudsBaseCoded3Trend4,478 -cloudsBaseCoded4,479 -cloudsBaseCoded4Trend1,480 -cloudsBaseCoded4Trend2,481 -cloudsBaseCoded4Trend3,482 -cloudsBaseCoded4Trend4,483 -cloudsCode1,484 -cloudsCode1Trend1,485 -cloudsCode1Trend2,486 -cloudsCode1Trend3,487 -cloudsCode1Trend4,488 -cloudsCode2,489 -cloudsCode2Trend1,490 -cloudsCode2Trend2,491 -cloudsCode2Trend3,492 -cloudsCode2Trend4,493 -cloudsCode3,494 -cloudsCode3Trend1,495 -cloudsCode3Trend2,496 -cloudsCode3Trend3,497 -cloudsCode3Trend4,498 -cloudsCode4,499 -cloudsCode4Trend1,500 -cloudsCode4Trend2,501 -cloudsCode4Trend3,502 -cloudsCode4Trend4,503 -cloudsTitle1,504 -cloudsTitle1Trend1,505 -cloudsTitle1Trend2,506 -cloudsTitle1Trend3,507 -cloudsTitle1Trend4,508 -cloudsTitle2,509 -cloudsTitle2Trend1,510 -cloudsTitle2Trend2,511 -cloudsTitle2Trend3,512 -cloudsTitle2Trend4,513 -cloudsTitle3,514 -cloudsTitle3Trend1,515 -cloudsTitle3Trend2,516 -cloudsTitle3Trend3,517 -cloudsTitle3Trend4,518 -cloudsTitle4,519 -cloudsTitle4Trend1,520 -cloudsTitle4Trend2,521 -cloudsTitle4Trend3,522 -cloudsTitle4Trend4,523 -clusterIdentifier,524 -clusterMember1,525 -clusterMember10,526 -clusterMember2,527 -clusterMember3,528 -clusterMember4,529 -clusterMember5,530 -clusterMember6,531 -clusterMember7,532 -clusterMember8,533 -clusterMember9,534 -clusterNumber,535 -clusterSize,536 -clusteringDomain,537 -clusteringMethod,538 -clutterFilterIndicator,539 -cnmc_cmcc,540 -cnmc_isac,541 -codeFigure,542 -codeType,543 -codedNumberOfFirstOrderPackedValues,544 -codedNumberOfGroups,545 -codedValues,546 -coefsFirst,547 -coefsSecond,548 -commonBlock,549 -complexPacking,550 -componentIndex,551 -compressedData,552 -computeLaplacianOperator,553 -computeStatistics,554 -conceptDir,555 -conceptsLocalDirAll,556 -conceptsLocalDirECMF,557 -conceptsLocalMarsDirAll,558 -conceptsMasterDir,559 -conceptsMasterMarsDir,560 -consensus,561 -consensusCount,562 -const,563 -constantAntennaElevationAngle,564 -constantFieldHalfByte,565 -constituentType,566 -controlForecastCluster,567 -coordAveraging0,568 -coordAveraging1,569 -coordAveraging2,570 -coordAveraging3,571 -coordAveragingTims,572 -coordinate1End,573 -coordinate1Flag,574 -coordinate1Start,575 -coordinate2End,576 -coordinate2Flag,577 -coordinate2Start,578 -coordinate3Flag,579 -coordinate3OfFirstGridPoint,580 -coordinate3OfLastGridPoint,581 -coordinate4Flag,582 -coordinate4OfFirstGridPoint,583 -coordinate4OfLastGridPoint,584 -coordinateFlag1,585 -coordinateFlag2,586 -coordinateIndexNumber,587 -coordinatesPresent,588 -core,589 -corr1Data,590 -corr2Data,591 -corr3Data,592 -corr4Data,593 -correction,594 -correction1,595 -correction1Part,596 -correction2,597 -correction2Part,598 -correction3,599 -correction3Part,600 -correction4,601 -correction4Part,602 -count,603 -countOfGroupLengths,604 -countOfICEFieldsUsed,605 -countTotal,606 -country,607 -crcrlf,608 -createNewData,609 -crraLocalVersion,610 -crraSection,611 -crraSuiteID,612 -daLoop,613 -data,614 -dataAccessors,615 -dataCategory,616 -dataDate,617 -dataFlag,618 -dataKeys,619 -dataLength,620 -dataOrigin,621 -dataRepresentation,622 -dataRepresentationTemplate,623 -dataRepresentationTemplateNumber,624 -dataRepresentationType,625 -dataSelection,626 -dataStream,627 -dataSubCategory,628 -dataTime,629 -dataType,630 -dataValues,631 -date,632 -dateOfAnalysis,633 -dateOfForecast,634 -dateOfForecastRun,635 -dateOfIceFieldUsed,636 -dateOfModelVersion,637 -dateOfReference,638 -dateOfSSTFieldUsed,639 -dateSSTFieldUsed,640 -dateTime,641 -datumSize,642 -day,643 -dayOfAnalysis,644 -dayOfEndOfOverallTimeInterval,645 -dayOfForecast,646 -dayOfModelVersion,647 -dayOfReference,648 -dayOfTheYearDate,649 -decimalPrecision,650 -decimalScaleFactor,651 -defaultFaFieldName,652 -defaultFaLevelName,653 -defaultFaModelName,654 -defaultName,655 -defaultParameter,656 -defaultSequence,657 -defaultShortName,658 -defaultStepUnits,659 -defaultTypeOfLevel,660 -default_step_units,661 -definitionFilesVersion,662 -deleteCalendarId,663 -deleteExtraLocalSection,664 -deleteLocalDefinition,665 -deletePV,666 -derivedForecast,667 -dewPointTemperature,668 -diagnostic,669 -diagnosticNumber,670 -diffInDays,671 -diffInHours,672 -dimension,673 -dimensionNumber,674 -dimensionType,675 -direction,676 -directionNumber,677 -directionOfVariation,678 -directionScalingFactor,679 -dirty_statistics,680 -disableGrib1LocalSection,681 -discipline,682 -distanceFromTubeToEnsembleMean,683 -distinctLatitudes,684 -distinctLongitudes,685 -doExtractArea,686 -doExtractDateTime,687 -doExtractSubsets,688 -doSimpleThinning,689 -domain,690 -driverInformationBlockAddress,691 -dummy,692 -dummy1,693 -dummy2,694 -dummyc,695 -dx,696 -dy,697 -earthIsOblate,698 -earthMajorAxis,699 -earthMajorAxisInMetres,700 -earthMinorAxis,701 -earthMinorAxisInMetres,702 -eastLongitudeOfCluster,703 -eastLongitudeOfDomainOfTubing,704 -easternLongitudeOfClusterDomain,705 -easternLongitudeOfDomain,706 -ed,707 -edition,708 -editionNumber,709 -efas_model,710 -efas_post_proc,711 -efiOrder,712 -eight,713 -elementsTable,714 -elevation,715 -eleven,716 -endDayTrend1,717 -endDayTrend2,718 -endDayTrend3,719 -endDayTrend4,720 -endDescriptors,721 -endGridDefinition,722 -endHourTrend1,723 -endHourTrend2,724 -endHourTrend3,725 -endHourTrend4,726 -endMark,727 -endMinuteTrend1,728 -endMinuteTrend2,729 -endMinuteTrend3,730 -endMinuteTrend4,731 -endMonthTrend1,732 -endMonthTrend2,733 -endMonthTrend3,734 -endMonthTrend4,735 -endOfFileAddress,736 -endOfHeadersMarker,737 -endOfInterval,738 -endOfMessage,739 -endOfProduct,740 -endOfRange,741 -endStep,742 -endStepInHours,743 -endTimeStep,744 -endYearTrend1,745 -endYearTrend2,746 -endYearTrend3,747 -endYearTrend4,748 -energyNorm,749 -enorm,750 -ensembleForecastNumbers,751 -ensembleForecastNumbersList,752 -ensembleSize,753 -ensembleStandardDeviation,754 -eps,755 -epsContinous,756 -epsPoint,757 -epsStatisticsContinous,758 -epsStatisticsPoint,759 -error,760 -expandBy,761 -expandedAbbreviations,762 -expandedCodes,763 -expandedCrex_scales,764 -expandedCrex_units,765 -expandedCrex_widths,766 -expandedDescriptors,767 -expandedNames,768 -expandedOriginalCodes,769 -expandedOriginalReferences,770 -expandedOriginalScales,771 -expandedOriginalWidths,772 -expandedTypes,773 -expandedUnits,774 -experimentVersionNumber,775 -experimentVersionNumber1,776 -experimentVersionNumber2,777 -experimentVersionNumberOfAnalysis,778 -expoffset,779 -expver,780 -extendedFlag,781 -extraDim,782 -extraDimensionPresent,783 -extraLocalSectionNumber,784 -extraLocalSectionPresent,785 -extraValues,786 -extractAreaEastLongitude,787 -extractAreaLatitudeRank,788 -extractAreaLongitudeRank,789 -extractAreaNorthLatitude,790 -extractAreaSouthLatitude,791 -extractAreaWestLongitude,792 -extractDateTimeDayEnd,793 -extractDateTimeDayRank,794 -extractDateTimeDayStart,795 -extractDateTimeEnd,796 -extractDateTimeHourEnd,797 -extractDateTimeHourRank,798 -extractDateTimeHourStart,799 -extractDateTimeMinuteEnd,800 -extractDateTimeMinuteRank,801 -extractDateTimeMinuteStart,802 -extractDateTimeMonthEnd,803 -extractDateTimeMonthRank,804 -extractDateTimeMonthStart,805 -extractDateTimeSecondEnd,806 -extractDateTimeSecondRank,807 -extractDateTimeSecondStart,808 -extractDateTimeStart,809 -extractDateTimeYearEnd,810 -extractDateTimeYearRank,811 -extractDateTimeYearStart,812 -extractSubset,813 -extractSubsetIntervalEnd,814 -extractSubsetIntervalStart,815 -extractSubsetList,816 -extractedAreaNumberOfSubsets,817 -extractedDateTimeNumberOfSubsets,818 -extremeClockwiseWindDirection,819 -extremeCounterClockwiseWindDirection,820 -extremeValuesRVR1,821 -extremeValuesRVR2,822 -extremeValuesRVR3,823 -extremeValuesRVR4,824 -faFieldName,825 -faLevelName,826 -faModelName,827 -false,828 -falseEasting,829 -falseNorthing,830 -fcmonth,831 -fcperiod,832 -fgDate,833 -fgTime,834 -file,835 -fileConsistencyFlags,836 -firstDimension,837 -firstDimensionCoordinateValueDefinition,838 -firstDimensionPhysicalSignificance,839 -firstLatitude,840 -firstLatitudeInDegrees,841 -firstMonthUsedToBuildClimateMonth1,842 -firstMonthUsedToBuildClimateMonth2,843 -firstOrderValues,844 -flag,845 -flagForAnyFurtherInformation,846 -flagForIrregularGridCoordinateList,847 -flagForNormalOrStaggeredGrid,848 -flagShowingPostAuxiliaryArrayInUse,849 -flags,850 -floatVal,851 -floatValues,852 -forecastLeadTime,853 -forecastMonth,854 -forecastOrSingularVectorNumber,855 -forecastPeriod,856 -forecastPeriodFrom,857 -forecastPeriodTo,858 -forecastProbabilityNumber,859 -forecastSteps,860 -forecastTime,861 -forecastperiod,862 -formatVersionMajorNumber,863 -formatVersionMinorNumber,864 -freeFormData,865 -frequency,866 -frequencyNumber,867 -frequencyScalingFactor,868 -functionCode,869 -g,870 -g1conceptsLocalDirAll,871 -g1conceptsMasterDir,872 -g2grid,873 -gaussianGridName,874 -genVertHeightCoords,875 -generalExtended2ordr,876 -generatingProcessIdentificationNumber,877 -generatingProcessIdentifier,878 -generatingProcessTemplate,879 -generatingProcessTemplateNumber,880 -getNumberOfValues,881 -gg,882 -global,883 -globalDomain,884 -grib1divider,885 -grib2LocalSectionNumber,886 -grib2LocalSectionPresent,887 -grib2divider,888 -grib3divider,889 -gribMasterTablesVersionNumber,890 -gribTablesVersionNo,891 -grid,892 -gridCoordinate,893 -gridDefinition,894 -gridDefinitionDescription,895 -gridDefinitionSection,896 -gridDefinitionTemplateNumber,897 -gridDescriptionSectionPresent,898 -gridName,899 -gridPointPosition,900 -gridType,901 -groupInternalNodeK,902 -groupLeafNodeK,903 -groupLengths,904 -groupSplitting,905 -groupSplittingMethodUsed,906 -groupWidth,907 -groupWidths,908 -gts_CCCC,909 -gts_TTAAii,910 -gts_ddhh00,911 -gts_header,912 -halfByte,913 -hdate,914 -headersOnly,915 -heightLevelName,916 -heightOrPressureOfLevel,917 -heightPressureEtcOfLevels,918 -hideThis,919 -horizontalCoordinateDefinition,920 -horizontalCoordinateSupplement,921 -horizontalDimensionProcessed,922 -horizontalDomainTemplate,923 -horizontalDomainTemplateNumber,924 -hour,925 -hourOfAnalysis,926 -hourOfEndOfOverallTimeInterval,927 -hourOfForecast,928 -hourOfModelVersion,929 -hourOfReference,930 -hoursAfterDataCutoff,931 -hoursAfterReferenceTimeOfDataCutoff,932 -hundred,933 -iDirectionIncrement,934 -iDirectionIncrementGiven,935 -iDirectionIncrementGridLength,936 -iDirectionIncrementInDegrees,937 -iIncrement,938 -iScansNegatively,939 -iScansPositively,940 -ident,941 -identificationNumber,942 -identificationOfOriginatingGeneratingCentre,943 -identificationOfProject,944 -identifier,945 -ieeeFloats,946 -ifsParam,947 -ijDirectionIncrementGiven,948 -implementationDateOfModelCycle,949 -incrementOfLengths,950 -indexTemplate,951 -indexTemplateNumber,952 -indexedStorageInternalNodeK,953 -indexingDate,954 -indexingTime,955 -indicatorOfParameter,956 -indicatorOfTypeOfLevel,957 -indicatorOfUnitForTimeIncrement,958 -indicatorOfUnitForTimeRange,959 -indicatorOfUnitOfTimeRange,960 -inputDataPresentIndicator,961 -inputDelayedDescriptorReplicationFactor,962 -inputExtendedDelayedDescriptorReplicationFactor,963 -inputOriginatingCentre,964 -inputOverriddenReferenceValues,965 -inputProcessIdentifier,966 -inputShortDelayedDescriptorReplicationFactor,967 -instrument,968 -instrumentIdentifier,969 -instrumentType,970 -integerPointValues,971 -integerScaleFactor,972 -integerScalingFactorAppliedToDirections,973 -integerScalingFactorAppliedToFrequencies,974 -integerValues,975 -internalVersion,976 -internationalDataSubCategory,977 -interpretationOfNumberOfPoints,978 -intervalBetweenTimes,979 -isAccumulation,980 -isAuto,981 -isCavok,982 -isCavokTrend1,983 -isCavokTrend2,984 -isCavokTrend3,985 -isCavokTrend4,986 -isConstant,987 -isCorrection,988 -isEPS,989 -isEps,990 -isFillup,991 -isHindcast,992 -isOctahedral,993 -isSatellite,994 -isSatelliteType,995 -isSens,996 -is_aerosol,997 -is_aerosol_optical,998 -is_chemical,999 -is_chemical_distfn,1000 -is_efas,1001 -is_ocean2d_param,1002 -is_ocean3d_param,1003 -is_rotated_grid,1004 -is_s2s,1005 -is_tigge,1006 -is_uerra,1007 -isectionNumber2,1008 -isectionNumber3,1009 -isectionNumber4,1010 -isotopeIdentificationNumber,1011 -iteration,1012 -iterationNumber,1013 -iteratorDisableUnrotate,1014 -jDirectionIncrement,1015 -jDirectionIncrementGiven,1016 -jDirectionIncrementGridLength,1017 -jDirectionIncrementInDegrees,1018 -jIncrement,1019 -jPointsAreConsecutive,1020 -jScansPositively,1021 -julianDay,1022 -julianForecastDay,1023 -keyData,1024 -keyMore,1025 -keySat,1026 -kindOfProduct,1027 -kurt,1028 -kurtosis,1029 -lBB,1030 -landtype,1031 -laplacianOperator,1032 -laplacianOperatorIsSet,1033 -laplacianScalingFactor,1034 -laplacianScalingFactorUnset,1035 -lastMonthUsedToBuildClimateMonth1,1036 -lastMonthUsedToBuildClimateMonth2,1037 -latLonValues,1038 -latitude,1039 -latitudeFirstInDegrees,1040 -latitudeLastInDegrees,1041 -latitudeLongitudeValues,1042 -latitudeOfCenterPoint,1043 -latitudeOfCenterPointInDegrees,1044 -latitudeOfCentralPointInClusterDomain,1045 -latitudeOfFirstGridPoint,1046 -latitudeOfFirstGridPointInDegrees,1047 -latitudeOfIcosahedronPole,1048 -latitudeOfLastGridPoint,1049 -latitudeOfLastGridPointInDegrees,1050 -latitudeOfNorthWestCornerOfArea,1051 -latitudeOfReferencePoint,1052 -latitudeOfReferencePointInDegrees,1053 -latitudeOfSouthEastCornerOfArea,1054 -latitudeOfSouthernPole,1055 -latitudeOfSouthernPoleInDegrees,1056 -latitudeOfStretchingPole,1057 -latitudeOfStretchingPoleInDegrees,1058 -latitudeOfSubSatellitePoint,1059 -latitudeOfSubSatellitePointInDegrees,1060 -latitudeOfTangencyPoint,1061 -latitudeOfThePoleOfStretching,1062 -latitudeOfThePolePoint,1063 -latitudeOfThePolePointInDegrees,1064 -latitudeOfTheSouthernPoleOfProjection,1065 -latitudeSexagesimal,1066 -latitudeWhereDxAndDyAreSpecified,1067 -latitudeWhereDxAndDyAreSpecifiedInDegrees,1068 -latitudes,1069 -latitudesList,1070 -latitudinalDirectionGridLength,1071 -lcwfvSuiteName,1072 -leadtime,1073 -legBaseDate,1074 -legBaseTime,1075 -legNumber,1076 -legacyGaussSubarea,1077 -lengthDescriptors,1078 -lengthIncrementForTheGroupLengths,1079 -lengthOf4DvarWindow,1080 -lengthOfHeaders,1081 -lengthOfIndexTemplate,1082 -lengthOfMessage,1083 -lengthOfOriginatorLocalTemplate,1084 -lengthOfProjectLocalTemplate,1085 -lengthOfTimeRange,1086 -lev,1087 -levTypeName,1088 -level,1089 -levelIndicator,1090 -levelType,1091 -levelist,1092 -levels,1093 -levtype,1094 -libraryVersion,1095 -listMembersMissing,1096 -listMembersMissing2,1097 -listMembersMissing3,1098 -listMembersMissing4,1099 -listMembersUsed,1100 -listMembersUsed2,1101 -listMembersUsed3,1102 -listMembersUsed4,1103 -listOfContributingSpectralBands,1104 -listOfDistributionFunctionParameter,1105 -listOfEnsembleForecastNumbers,1106 -listOfModelIdentifiers,1107 -listOfParametersUsedForClustering,1108 -listOfScaledFrequencies,1109 -local,1110 -localDateTime,1111 -localDay,1112 -localDecimalScaleFactor,1113 -localDefNumberOne,1114 -localDefNumberTwo,1115 -localDefinition,1116 -localDefinitionNumber,1117 -localDir,1118 -localExtensionPadding,1119 -localFlag,1120 -localFlagLatestVersion,1121 -localHour,1122 -localLatitude,1123 -localLatitude1,1124 -localLatitude2,1125 -localLongitude,1126 -localLongitude1,1127 -localLongitude2,1128 -localMinute,1129 -localMonth,1130 -localNumberOfObservations,1131 -localSecond,1132 -localSection,1133 -localSectionPresent,1134 -localTablesVersion,1135 -localTablesVersionNumber,1136 -localUsePresent,1137 -localYear,1138 -local_padding,1139 -local_use,1140 -logTransform,1141 -longitude,1142 -longitudeFirstInDegrees,1143 -longitudeLastInDegrees,1144 -longitudeOfCenterPoint,1145 -longitudeOfCenterPointInDegrees,1146 -longitudeOfCentralPointInClusterDomain,1147 -longitudeOfFirstDiamondCenterLine,1148 -longitudeOfFirstDiamondCenterLineInDegrees,1149 -longitudeOfFirstGridPoint,1150 -longitudeOfFirstGridPointInDegrees,1151 -longitudeOfIcosahedronPole,1152 -longitudeOfLastGridPoint,1153 -longitudeOfLastGridPointInDegrees,1154 -longitudeOfNorthWestCornerOfArea,1155 -longitudeOfReferencePoint,1156 -longitudeOfReferencePointInDegrees,1157 -longitudeOfSouthEastCornerOfArea,1158 -longitudeOfSouthernPole,1159 -longitudeOfSouthernPoleInDegrees,1160 -longitudeOfStretchingPole,1161 -longitudeOfStretchingPoleInDegrees,1162 -longitudeOfSubSatellitePoint,1163 -longitudeOfSubSatellitePointInDegrees,1164 -longitudeOfTangencyPoint,1165 -longitudeOfThePoleOfStretching,1166 -longitudeOfThePolePoint,1167 -longitudeOfThePolePointInDegrees,1168 -longitudeOfTheSouthernPoleOfProjection,1169 -longitudeSexagesimal,1170 -longitudes,1171 -longitudesList,1172 -longitudinalDirectionGridLength,1173 -lowerLimit,1174 -lowerRange,1175 -lowerThreshold,1176 -lowerThresholdValue,1177 -ls_labeling,1178 -lsdate_bug,1179 -m,1180 -mAngleMultiplier,1181 -mBasicAngle,1182 -mars,1183 -marsClass,1184 -marsClass1,1185 -marsClass2,1186 -marsDir,1187 -marsDomain,1188 -marsEndStep,1189 -marsExperimentOffset,1190 -marsExpver,1191 -marsForecastMonth,1192 -marsGrid,1193 -marsIdent,1194 -marsKeywords,1195 -marsKeywords1,1196 -marsLamModel,1197 -marsLatitude,1198 -marsLevel,1199 -marsLevelist,1200 -marsLongitude,1201 -marsModel,1202 -marsParam,1203 -marsQuantile,1204 -marsRange,1205 -marsStartStep,1206 -marsStep,1207 -marsStream,1208 -marsStream1,1209 -marsStream2,1210 -marsType,1211 -marsType1,1212 -marsType2,1213 -mars_labeling,1214 -mask,1215 -masterDir,1216 -masterTableNumber,1217 -masterTablesVersionNumber,1218 -masterTablesVersionNumberLatest,1219 -matchAerosolBinNumber,1220 -matchAerosolPacking,1221 -matchLandType,1222 -matchSort,1223 -matchTimeRepres,1224 -matrixBitmapsPresent,1225 -matrixOfValues,1226 -max,1227 -maximum,1228 -md5Data,1229 -md5DataSection,1230 -md5GridSection,1231 -md5Headers,1232 -md5Product,1233 -md5Section1,1234 -md5Section10,1235 -md5Section2,1236 -md5Section3,1237 -md5Section4,1238 -md5Section5,1239 -md5Section6,1240 -md5Section7,1241 -md5Section8,1242 -md5Section9,1243 -md5Structure,1244 -md5TimeDomainSection,1245 -meanRVR1,1246 -meanRVR2,1247 -meanRVR3,1248 -meanRVR4,1249 -meanSize,1250 -meanValueRVR1,1251 -meanValueRVR2,1252 -meanValueRVR3,1253 -meanValueRVR4,1254 -meaningOfVerticalCoordinate,1255 -memberNumber,1256 -messageLength,1257 -metadata,1258 -method,1259 -methodNumber,1260 -million,1261 -min,1262 -minimum,1263 -minute,1264 -minuteOfAnalysis,1265 -minuteOfEndOfOverallTimeInterval,1266 -minuteOfForecast,1267 -minuteOfModelVersion,1268 -minuteOfReference,1269 -minutesAfterDataCutoff,1270 -minutesAfterReferenceTimeOfDataCutoff,1271 -missingDataFlag,1272 -missingValue,1273 -missingValueManagement,1274 -missingValueManagementUsed,1275 -missingValuesPresent,1276 -mixedCoordinateDefinition,1277 -mixedCoordinateFieldFlag,1278 -modeNumber,1279 -model,1280 -modelErrorType,1281 -modelIdentifier,1282 -modelName,1283 -modelVersionDate,1284 -modelVersionTime,1285 -molarMass,1286 -month,1287 -monthOfAnalysis,1288 -monthOfEndOfOverallTimeInterval,1289 -monthOfForecast,1290 -monthOfModelVersion,1291 -monthOfReference,1292 -monthlyVerificationDate,1293 -monthlyVerificationMonth,1294 -monthlyVerificationTime,1295 -monthlyVerificationYear,1296 -multiplicationFactorForLatLong,1297 -mybits,1298 -n,1299 -n2,1300 -n3,1301 -na,1302 -name,1303 -nameECMF,1304 -nameOfFirstFixedSurface,1305 -nameOfSecondFixedSurface,1306 -names,1307 -nd,1308 -neitherPresent,1309 -newSubtype,1310 -nlev,1311 -nnn,1312 -normAtFinalTime,1313 -normAtInitialTime,1314 -normal,1315 -northLatitudeOfCluster,1316 -northLatitudeOfDomainOfTubing,1317 -northWestLatitudeOfLPOArea,1318 -northWestLatitudeOfVerficationArea,1319 -northWestLongitudeOfLPOArea,1320 -northWestLongitudeOfVerficationArea,1321 -northernLatitudeOfClusterDomain,1322 -northernLatitudeOfDomain,1323 -nosigPresent,1324 -notDecoded,1325 -nt,1326 -number,1327 -numberInHorizontalCoordinates,1328 -numberInMixedCoordinateDefinition,1329 -numberInTheAuxiliaryArray,1330 -numberInTheGridCoordinateList,1331 -numberIncludedInAverage,1332 -numberMissingFromAveragesOrAccumulations,1333 -numberOfAnalysis,1334 -numberOfBits,1335 -numberOfBitsContainingEachPackedValue,1336 -numberOfBitsForScaledGroupLengths,1337 -numberOfBitsUsedForTheGroupWidths,1338 -numberOfBitsUsedForTheScaledGroupLengths,1339 -numberOfBytesInLocalDefinition,1340 -numberOfBytesOfFreeFormatData,1341 -numberOfBytesPerInteger,1342 -numberOfCategories,1343 -numberOfCharacters,1344 -numberOfChars,1345 -numberOfClusterHighResolution,1346 -numberOfClusterLowResolution,1347 -numberOfClusters,1348 -numberOfCodedValues,1349 -numberOfCoefficientsOrValuesUsedToSpecifyFirstDimensionCoordinateFunction,1350 -numberOfCoefficientsOrValuesUsedToSpecifySecondDimensionCoordinateFunction,1351 -numberOfColumns,1352 -numberOfComponents,1353 -numberOfContributingSpectralBands,1354 -numberOfControlForecastTube,1355 -numberOfCoordinatesValues,1356 -numberOfDataBinsAlongRadials,1357 -numberOfDataMatrices,1358 -numberOfDataPoints,1359 -numberOfDataPointsExpected,1360 -numberOfDataValues,1361 -numberOfDaysInClimateSamplingWindow,1362 -numberOfDiamonds,1363 -numberOfDirections,1364 -numberOfDistinctSection3s,1365 -numberOfDistinctSection4s,1366 -numberOfDistinctSection5s,1367 -numberOfDistinctSection6s,1368 -numberOfDistinctSection7s,1369 -numberOfDistinctSection8s,1370 -numberOfDistinctSection9s,1371 -numberOfDistributionFunctionParameters,1372 -numberOfEffectiveValues,1373 -numberOfFloats,1374 -numberOfForcasts,1375 -numberOfForecastsInCluster,1376 -numberOfForecastsInEnsemble,1377 -numberOfForecastsInTheCluster,1378 -numberOfForecastsInTube,1379 -numberOfFrequencies,1380 -numberOfGridInReference,1381 -numberOfGridUsed,1382 -numberOfGroups,1383 -numberOfGroupsOfDataValues,1384 -numberOfHorizontalPoints,1385 -numberOfIntegers,1386 -numberOfInts,1387 -numberOfIterations,1388 -numberOfLocalDefinitions,1389 -numberOfLogicals,1390 -numberOfMembersInCluster,1391 -numberOfMembersInEnsemble,1392 -numberOfMissing,1393 -numberOfMissingInStatisticalProcess,1394 -numberOfMissingValues,1395 -numberOfModeOfDistribution,1396 -numberOfModels,1397 -numberOfOctectsForNumberOfPoints,1398 -numberOfOctetsExtraDescriptors,1399 -numberOfOperationalForecastTube,1400 -numberOfPackedValues,1401 -numberOfParallelsBetweenAPoleAndTheEquator,1402 -numberOfParametersUsedForClustering,1403 -numberOfPartitions,1404 -numberOfPoints,1405 -numberOfPointsAlongAMeridian,1406 -numberOfPointsAlongAParallel,1407 -numberOfPointsAlongFirstAxis,1408 -numberOfPointsAlongSecondAxis,1409 -numberOfPointsAlongTheXAxis,1410 -numberOfPointsAlongTheYAxis,1411 -numberOfPointsAlongXAxis,1412 -numberOfPointsAlongXAxisInCouplingArea,1413 -numberOfPointsAlongYAxis,1414 -numberOfPointsAlongYAxisInCouplingArea,1415 -numberOfPointsInDomain,1416 -numberOfPointsUsed,1417 -numberOfPressureLevelsUsedForClustering,1418 -numberOfRadarSitesUsed,1419 -numberOfRadials,1420 -numberOfReforecastYearsInModelClimate,1421 -numberOfRemaininChars,1422 -numberOfRepresentativeMember,1423 -numberOfReservedBytes,1424 -numberOfRows,1425 -numberOfSecondOrderPackedValues,1426 -numberOfSection,1427 -numberOfSingularVectorsComputed,1428 -numberOfSingularVectorsEvolved,1429 -numberOfStepsUsedForClustering,1430 -numberOfSubsets,1431 -numberOfTensOfThousandsOfYearsOfOffset,1432 -numberOfTimeRange,1433 -numberOfTimeSteps,1434 -numberOfUnexpandedDescriptors,1435 -numberOfUnusedBitsAtEndOfSection3,1436 -numberOfUsedSpatialTiles,1437 -numberOfUsedTileAttributes,1438 -numberOfUsefulPointsAlongXAxis,1439 -numberOfUsefulPointsAlongYAxis,1440 -numberOfVGridUsed,1441 -numberOfValues,1442 -numberOfVerticalCoordinateValues,1443 -numberOfVerticalGridDescriptors,1444 -numberOfVerticalPoints,1445 -numberingOrderOfDiamonds,1446 -numericValues,1447 -observablePropertyTemplate,1448 -observablePropertyTemplateNumber,1449 -observationDiagnostic,1450 -observationGeneratingProcessIdentifier,1451 -observationType,1452 -observedData,1453 -obstype,1454 -oceanAtmosphereCoupling,1455 -oceanLevName,1456 -oceanStream,1457 -octetAtWichPackedDataBegins,1458 -offset,1459 -offsetAfterBitmap,1460 -offsetAfterCentreLocalSection,1461 -offsetAfterData,1462 -offsetAfterLocalSection,1463 -offsetAfterPadding,1464 -offsetBBitmap,1465 -offsetBSection5,1466 -offsetBSection6,1467 -offsetBSection9,1468 -offsetBeforeBitmap,1469 -offsetBeforeData,1470 -offsetBeforePL,1471 -offsetBeforePV,1472 -offsetDescriptors,1473 -offsetEndSection4,1474 -offsetFreeFormData,1475 -offsetFromOriginToInnerBound,1476 -offsetFromReferenceOfFirstTime,1477 -offsetICEFieldsUsed,1478 -offsetSection0,1479 -offsetSection1,1480 -offsetSection10,1481 -offsetSection11,1482 -offsetSection2,1483 -offsetSection3,1484 -offsetSection4,1485 -offsetSection5,1486 -offsetSection6,1487 -offsetSection7,1488 -offsetSection8,1489 -offsetSection9,1490 -offsetToEndOf4DvarWindow,1491 -offsetValuesBy,1492 -oldSubtype,1493 -one,1494 -oneConstant,1495 -oneMillionConstant,1496 -oneMinuteMeanMaximumRVR1,1497 -oneMinuteMeanMaximumRVR2,1498 -oneMinuteMeanMaximumRVR3,1499 -oneMinuteMeanMaximumRVR4,1500 -oneMinuteMeanMinimumRVR1,1501 -oneMinuteMeanMinimumRVR2,1502 -oneMinuteMeanMinimumRVR3,1503 -oneMinuteMeanMinimumRVR4,1504 -oneThousand,1505 -oper,1506 -operStream,1507 -operatingMode,1508 -operationalForecastCluster,1509 -optimisationTime,1510 -optimizeScaleFactor,1511 -optionalData,1512 -opttime,1513 -orderOfSPD,1514 -orderOfSpatialDifferencing,1515 -orientationOfTheGrid,1516 -orientationOfTheGridInDegrees,1517 -origin,1518 -originalParameterNumber,1519 -originalParameterTableNumber,1520 -originalSubCentreIdentifier,1521 -originatingCentre,1522 -originatingCentreOfAnalysis,1523 -originatorLocalTemplate,1524 -originatorLocalTemplateNumber,1525 -overlayTemplate,1526 -overlayTemplateNumber,1527 -pack,1528 -packedValues,1529 -packingError,1530 -packingType,1531 -padding,1532 -padding_grid1_1,1533 -padding_grid1_2,1534 -padding_grid3_1,1535 -padding_grid4_1,1536 -padding_grid50_1,1537 -padding_grid5_1,1538 -padding_grid90_1,1539 -padding_loc10_1,1540 -padding_loc12_1,1541 -padding_loc13_1,1542 -padding_loc13_2,1543 -padding_loc13_3,1544 -padding_loc13_4,1545 -padding_loc13_5,1546 -padding_loc14_1,1547 -padding_loc14_2,1548 -padding_loc15_1,1549 -padding_loc16_1,1550 -padding_loc17_2,1551 -padding_loc18_1,1552 -padding_loc18_2,1553 -padding_loc190_1,1554 -padding_loc191_1,1555 -padding_loc191_2,1556 -padding_loc191_3,1557 -padding_loc192_1,1558 -padding_loc19_2,1559 -padding_loc20_1,1560 -padding_loc21_1,1561 -padding_loc23_1,1562 -padding_loc244_1,1563 -padding_loc244_2,1564 -padding_loc244_3,1565 -padding_loc245_1,1566 -padding_loc245_2,1567 -padding_loc26_1,1568 -padding_loc27_1,1569 -padding_loc27_2,1570 -padding_loc28_1,1571 -padding_loc29_1,1572 -padding_loc29_2,1573 -padding_loc29_3,1574 -padding_loc2_1,1575 -padding_loc2_2,1576 -padding_loc30_1,1577 -padding_loc30_2,1578 -padding_loc37_1,1579 -padding_loc37_2,1580 -padding_loc38_1,1581 -padding_loc3_1,1582 -padding_loc4_2,1583 -padding_loc50_1,1584 -padding_loc5_1,1585 -padding_loc6_1,1586 -padding_loc7_1,1587 -padding_loc9_1,1588 -padding_loc9_2,1589 -padding_local11_1,1590 -padding_local1_1,1591 -padding_local1_31,1592 -padding_local40_1,1593 -padding_local_35,1594 -padding_local_7_1,1595 -padding_sec1_loc,1596 -padding_sec2_1,1597 -padding_sec2_2,1598 -padding_sec2_3,1599 -padding_sec3_1,1600 -padding_sec4_1,1601 -paleontologicalOffset,1602 -param,1603 -paramId,1604 -paramIdECMF,1605 -parameter,1606 -parameterCategory,1607 -parameterCode,1608 -parameterDiscipline,1609 -parameterIndicator,1610 -parameterName,1611 -parameterNumber,1612 -parameterUnits,1613 -parameters,1614 -parametersVersion,1615 -partitionItems,1616 -partitionNumber,1617 -partitionTable,1618 -partitions,1619 -pastTendencyRVR1,1620 -pastTendencyRVR2,1621 -pastTendencyRVR3,1622 -pastTendencyRVR4,1623 -patch_precip_fp,1624 -pentagonalResolutionParameterJ,1625 -pentagonalResolutionParameterK,1626 -pentagonalResolutionParameterM,1627 -percentileValue,1628 -periodOfTime,1629 -periodOfTimeIntervals,1630 -perturbationNumber,1631 -perturbedType,1632 -phase,1633 -physicalFlag1,1634 -physicalFlag2,1635 -physicalMeaningOfVerticalCoordinate,1636 -pl,1637 -platform,1638 -plusOneinOrdersOfSPD,1639 -points,1640 -postAuxiliary,1641 -postAuxiliaryArrayPresent,1642 -powerOfTenUsedToScaleClimateWeight,1643 -preBitmapValues,1644 -preProcessingParameter,1645 -precision,1646 -precisionOfTheUnpackedSubset,1647 -predefined_grid,1648 -predefined_grid_values,1649 -present,1650 -presentTrend1,1651 -presentTrend2,1652 -presentTrend3,1653 -presentTrend4,1654 -presentWeather1Present,1655 -presentWeather1PresentTrend1,1656 -presentWeather1PresentTrend2,1657 -presentWeather1PresentTrend3,1658 -presentWeather1PresentTrend4,1659 -presentWeather2Present,1660 -presentWeather2PresentTrend1,1661 -presentWeather2PresentTrend2,1662 -presentWeather2PresentTrend3,1663 -presentWeather2PresentTrend4,1664 -presentWeather3Present,1665 -presentWeather3PresentTrend1,1666 -presentWeather3PresentTrend2,1667 -presentWeather3PresentTrend3,1668 -presentWeather3PresentTrend4,1669 -pressureLevel,1670 -pressureUnits,1671 -primaryBitmap,1672 -primaryMissingValue,1673 -primaryMissingValueSubstitute,1674 -probContinous,1675 -probPoint,1676 -probProductDefinition,1677 -probabilityType,1678 -probabilityTypeName,1679 -process,1680 -produceLargeConstantFields,1681 -product,1682 -productDefinition,1683 -productDefinitionTemplateNumber,1684 -productDefinitionTemplateNumberInternal,1685 -productIdentifier,1686 -productType,1687 -productionStatusOfProcessedData,1688 -projectLocalTemplate,1689 -projectLocalTemplateNumber,1690 -projectionCenterFlag,1691 -projectionCentreFlag,1692 -pv,1693 -pvlLocation,1694 -qfe,1695 -qfePresent,1696 -qfeUnits,1697 -qnh,1698 -qnhAPresent,1699 -qnhPresent,1700 -qnhUnits,1701 -qualityControl,1702 -qualityControlIndicator,1703 -qualityValueAssociatedWithParameter,1704 -quantile,1705 -radialAngularSpacing,1706 -radials,1707 -radius,1708 -radiusInMetres,1709 -radiusOfCentralCluster,1710 -radiusOfClusterDomain,1711 -radiusOfTheEarth,1712 -range,1713 -rangeBinSpacing,1714 -rdbDateTime,1715 -rdbSubtype,1716 -rdbType,1717 -rdb_key,1718 -rdbtime,1719 -rdbtimeDate,1720 -rdbtimeDay,1721 -rdbtimeHour,1722 -rdbtimeMinute,1723 -rdbtimeMonth,1724 -rdbtimeSecond,1725 -rdbtimeTime,1726 -rdbtimeYear,1727 -realPart,1728 -realPartOf00,1729 -recDateTime,1730 -recentWeather,1731 -recentWeatherTry,1732 -rectime,1733 -rectimeDay,1734 -rectimeHour,1735 -rectimeMinute,1736 -rectimeSecond,1737 -reducedGrid,1738 -refdate,1739 -reference,1740 -referenceDate,1741 -referenceForGroupLengths,1742 -referenceForGroupWidths,1743 -referenceOfLengths,1744 -referenceOfWidths,1745 -referenceReflectivityForEchoTop,1746 -referenceSampleInterval,1747 -referenceStep,1748 -referenceValue,1749 -referenceValueError,1750 -reflectivityCalibrationConstant,1751 -remarkPresent,1752 -reportType,1753 -representationMode,1754 -representationType,1755 -representativeMember,1756 -reserved,1757 -reserved1,1758 -reserved2,1759 -reserved3,1760 -reservedNeedNotBePresent,1761 -reservedOctet,1762 -reservedSection2,1763 -reservedSection3,1764 -reservedSection4,1765 -resolutionAndComponentFlags,1766 -resolutionAndComponentFlags1,1767 -resolutionAndComponentFlags2,1768 -resolutionAndComponentFlags3,1769 -resolutionAndComponentFlags4,1770 -resolutionAndComponentFlags6,1771 -resolutionAndComponentFlags7,1772 -resolutionAndComponentFlags8,1773 -rootGroupObjectHeaderAddress,1774 -rootGroupSymbolTableEntry,1775 -rootTablesDir,1776 -roundedMarsLatitude,1777 -roundedMarsLevelist,1778 -roundedMarsLongitude,1779 -runwayBrakingActionState1,1780 -runwayBrakingActionState2,1781 -runwayBrakingActionState3,1782 -runwayBrakingActionState4,1783 -runwayDepositCodeState1,1784 -runwayDepositCodeState2,1785 -runwayDepositCodeState3,1786 -runwayDepositCodeState4,1787 -runwayDepositState1,1788 -runwayDepositState2,1789 -runwayDepositState3,1790 -runwayDepositState4,1791 -runwayDepthOfDepositCodeState1,1792 -runwayDepthOfDepositCodeState2,1793 -runwayDepthOfDepositCodeState3,1794 -runwayDepthOfDepositCodeState4,1795 -runwayDepthOfDepositState1,1796 -runwayDepthOfDepositState2,1797 -runwayDepthOfDepositState3,1798 -runwayDepthOfDepositState4,1799 -runwayDesignatorRVR1,1800 -runwayDesignatorRVR2,1801 -runwayDesignatorRVR3,1802 -runwayDesignatorRVR4,1803 -runwayDesignatorState1,1804 -runwayDesignatorState2,1805 -runwayDesignatorState3,1806 -runwayDesignatorState4,1807 -runwayExtentOfContaminationCodeState1,1808 -runwayExtentOfContaminationCodeState2,1809 -runwayExtentOfContaminationCodeState3,1810 -runwayExtentOfContaminationCodeState4,1811 -runwayExtentOfContaminationState1,1812 -runwayExtentOfContaminationState2,1813 -runwayExtentOfContaminationState3,1814 -runwayExtentOfContaminationState4,1815 -runwayFrictionCodeValueState1,1816 -runwayFrictionCodeValueState2,1817 -runwayFrictionCodeValueState3,1818 -runwayFrictionCodeValueState4,1819 -runwayFrictionCoefficientCodeState1,1820 -runwayFrictionCoefficientCodeState2,1821 -runwayFrictionCoefficientCodeState3,1822 -runwayFrictionCoefficientCodeState4,1823 -runwayFrictionCoefficientState1,1824 -runwayFrictionCoefficientState2,1825 -runwayFrictionCoefficientState3,1826 -runwayFrictionCoefficientState4,1827 -runwaySideCodeState1,1828 -runwaySideCodeState2,1829 -runwaySideCodeState3,1830 -runwaySideCodeState4,1831 -runwayState,1832 -sampleSizeOfModelClimate,1833 -satelliteID,1834 -satelliteIdentifier,1835 -satelliteNumber,1836 -satelliteSeries,1837 -scaleFactorAtReferencePoint,1838 -scaleFactorOfCentralWaveNumber,1839 -scaleFactorOfDistanceFromEnsembleMean,1840 -scaleFactorOfDistributionFunctionParameter,1841 -scaleFactorOfEarthMajorAxis,1842 -scaleFactorOfEarthMinorAxis,1843 -scaleFactorOfFirstFixedSurface,1844 -scaleFactorOfFirstSize,1845 -scaleFactorOfFirstWavelength,1846 -scaleFactorOfLengthOfSemiMajorAxis,1847 -scaleFactorOfLengthOfSemiMinorAxis,1848 -scaleFactorOfLowerLimit,1849 -scaleFactorOfMajorAxisOfOblateSpheroidEarth,1850 -scaleFactorOfMinorAxisOfOblateSpheroidEarth,1851 -scaleFactorOfPrimeMeridianOffset,1852 -scaleFactorOfRadiusOfSphericalEarth,1853 -scaleFactorOfSecondFixedSurface,1854 -scaleFactorOfSecondSize,1855 -scaleFactorOfSecondWavelength,1856 -scaleFactorOfStandardDeviation,1857 -scaleFactorOfStandardDeviationInTheCluster,1858 -scaleFactorOfUpperLimit,1859 -scaleValuesBy,1860 -scaledDirections,1861 -scaledFrequencies,1862 -scaledValueOfCentralWaveNumber,1863 -scaledValueOfDistanceFromEnsembleMean,1864 -scaledValueOfDistributionFunctionParameter,1865 -scaledValueOfEarthMajorAxis,1866 -scaledValueOfEarthMinorAxis,1867 -scaledValueOfFirstFixedSurface,1868 -scaledValueOfFirstSize,1869 -scaledValueOfFirstWavelength,1870 -scaledValueOfLengthOfSemiMajorAxis,1871 -scaledValueOfLengthOfSemiMinorAxis,1872 -scaledValueOfLowerLimit,1873 -scaledValueOfMajorAxisOfOblateSpheroidEarth,1874 -scaledValueOfMinorAxisOfOblateSpheroidEarth,1875 -scaledValueOfPrimeMeridianOffset,1876 -scaledValueOfRadiusOfSphericalEarth,1877 -scaledValueOfSecondFixedSurface,1878 -scaledValueOfSecondSize,1879 -scaledValueOfSecondWavelength,1880 -scaledValueOfStandardDeviation,1881 -scaledValueOfStandardDeviationInTheCluster,1882 -scaledValueOfUpperLimit,1883 -scalingFactorForFrequencies,1884 -scanPosition,1885 -scanningMode,1886 -scanningMode4,1887 -scanningMode5,1888 -scanningMode6,1889 -scanningMode7,1890 -scanningMode8,1891 -scanningModeForOneDiamond,1892 -sd,1893 -second,1894 -secondDimension,1895 -secondDimensionCoordinateValueDefinition,1896 -secondDimensionPhysicalSignificance,1897 -secondLatitude,1898 -secondLatitudeInDegrees,1899 -secondOfEndOfOverallTimeInterval,1900 -secondOfForecast,1901 -secondOfModelVersion,1902 -secondOrderFlags,1903 -secondOrderOfDifferentWidth,1904 -secondOrderValuesDifferentWidths,1905 -secondaryBitMap,1906 -secondaryBitmap,1907 -secondaryBitmapPresent,1908 -secondaryBitmaps,1909 -secondaryBitmapsCount,1910 -secondaryBitmapsSize,1911 -secondaryMissingValue,1912 -secondaryMissingValueSubstitute,1913 -secondsOfAnalysis,1914 -secondsOfReference,1915 -section,1916 -section0Length,1917 -section0Pointer,1918 -section1,1919 -section10Length,1920 -section10Pointer,1921 -section11Length,1922 -section11Pointer,1923 -section1Flags,1924 -section1Length,1925 -section1Padding,1926 -section1Pointer,1927 -section2Length,1928 -section2Padding,1929 -section2Pointer,1930 -section2Present,1931 -section2Used,1932 -section3Flags,1933 -section3Length,1934 -section3Padding,1935 -section3Pointer,1936 -section3UniqueIdentifier,1937 -section4,1938 -section4Length,1939 -section4Padding,1940 -section4Pointer,1941 -section4UniqueIdentifier,1942 -section5,1943 -section5Length,1944 -section5Pointer,1945 -section5UniqueIdentifier,1946 -section6,1947 -section6Length,1948 -section6Pointer,1949 -section6UniqueIdentifier,1950 -section7,1951 -section7Length,1952 -section7Pointer,1953 -section7UniqueIdentifier,1954 -section8,1955 -section8Length,1956 -section8Pointer,1957 -section8UniqueIdentifier,1958 -section9Length,1959 -section9Pointer,1960 -section9UniqueIdentifier,1961 -sectionLengthLimitForEnsembles,1962 -sectionLengthLimitForProbability,1963 -sectionNumber,1964 -sectionPosition,1965 -section_01,1966 -section_02,1967 -section_03,1968 -section_04,1969 -section_05,1970 -section_06,1971 -section_07,1972 -section_08,1973 -section_09,1974 -section_1,1975 -section_10,1976 -section_11,1977 -section_2,1978 -section_3,1979 -section_4,1980 -section_5,1981 -section_6,1982 -section_7,1983 -section_8,1984 -selectStepTemplateInstant,1985 -selectStepTemplateInterval,1986 -sensitiveAreaDomain,1987 -sequences,1988 -setBitsPerValue,1989 -setCalendarId,1990 -setDecimalPrecision,1991 -setLocalDefinition,1992 -setToMissingIfOutOfRange,1993 -sfc_levtype,1994 -shapeOfTheEarth,1995 -shapeOfVerificationArea,1996 -shortName,1997 -shortNameECMF,1998 -short_name,1999 -signature,2000 -significanceOfReferenceDateAndTime,2001 -significanceOfReferenceTime,2002 -simpleThinningMissingRadius,2003 -simpleThinningSkip,2004 -simpleThinningStart,2005 -siteElevation,2006 -siteId,2007 -siteLatitude,2008 -siteLongitude,2009 -sizeOfLength,2010 -sizeOfOffsets,2011 -sizeOfPostAuxiliaryArray,2012 -sizeOfPostAuxiliaryArrayPlusOne,2013 -skew,2014 -skewness,2015 -skipExtraKeyAttributes,2016 -sort,2017 -sourceOfGridDefinition,2018 -sourceSinkChemicalPhysicalProcess,2019 -southEastLatitudeOfLPOArea,2020 -southEastLatitudeOfVerficationArea,2021 -southEastLongitudeOfLPOArea,2022 -southEastLongitudeOfVerficationArea,2023 -southLatitudeOfCluster,2024 -southLatitudeOfDomainOfTubing,2025 -southPoleOnProjectionPlane,2026 -southernLatitudeOfClusterDomain,2027 -southernLatitudeOfDomain,2028 -sp1,2029 -sp2,2030 -sp3,2031 -spaceUnitFlag,2032 -spacingOfBinsAlongRadials,2033 -spare,2034 -spare2,2035 -spatialProcessing,2036 -spatialSmoothingOfProduct,2037 -spectralDataRepresentationMode,2038 -spectralDataRepresentationType,2039 -spectralMode,2040 -spectralType,2041 -sphericalHarmonics,2042 -standardDeviation,2043 -standardParallel,2044 -standardParallelInDegrees,2045 -standardParallelInMicrodegrees,2046 -startOfHeaders,2047 -startOfMessage,2048 -startOfRange,2049 -startStep,2050 -startStepInHours,2051 -startTimeStep,2052 -startingAzimuth,2053 -statisticalProcess,2054 -statisticalProcessesList,2055 -statistics,2056 -status,2057 -step,2058 -stepForClustering,2059 -stepInHours,2060 -stepRange,2061 -stepRangeInHours,2062 -stepType,2063 -stepTypeForConversion,2064 -stepTypeInternal,2065 -stepUnits,2066 -stepZero,2067 -stream,2068 -streamOfAnalysis,2069 -stretchingFactor,2070 -stretchingFactorScaled,2071 -stringValues,2072 -subCentre,2073 -subDefinitions1,2074 -subDefinitions2,2075 -subLocalDefinition1,2076 -subLocalDefinition2,2077 -subLocalDefinitionLength1,2078 -subLocalDefinitionLength2,2079 -subLocalDefinitionNumber1,2080 -subLocalDefinitionNumber2,2081 -subSetJ,2082 -subSetK,2083 -subSetM,2084 -subcentreOfAnalysis,2085 -subdivisionsOfBasicAngle,2086 -suiteName,2087 -superblockExtensionAddress,2088 -swapScanningLat,2089 -swapScanningLon,2090 -swapScanningX,2091 -swapScanningY,2092 -system,2093 -systemNumber,2094 -t,2095 -table2Version,2096 -tableCode,2097 -tableNumber,2098 -tableReference,2099 -tablesLocalDir,2100 -tablesMasterDir,2101 -tablesVersion,2102 -tablesVersionLatest,2103 -targetCompressionRatio,2104 -td,2105 -tempPressureUnits,2106 -temperature,2107 -temperatureAndDewpointPresent,2108 -templatesLocalDir,2109 -templatesMasterDir,2110 -theHindcastMarsStream,2111 -theMessage,2112 -thisExperimentVersionNumber,2113 -thisMarsClass,2114 -thisMarsStream,2115 -thisMarsType,2116 -thousand,2117 -three,2118 -threshold,2119 -thresholdIndicator,2120 -tiggeCentre,2121 -tiggeLAMName,2122 -tiggeLocalVersion,2123 -tiggeModel,2124 -tiggeSection,2125 -tiggeSuiteID,2126 -tigge_name,2127 -tigge_short_name,2128 -tileClassification,2129 -tileIndex,2130 -time,2131 -timeCoordinateDefinition,2132 -timeDomainTemplate,2133 -timeDomainTemplateNumber,2134 -timeIncrement,2135 -timeIncrementBetweenSuccessiveFields,2136 -timeOfAnalysis,2137 -timeOfForecast,2138 -timeOfModelVersion,2139 -timeOfReference,2140 -timeRangeIndicator,2141 -timeRangeIndicatorFromStepRange,2142 -timeUnitFlag,2143 -timerepres,2144 -topLevel,2145 -total,2146 -totalAerosolBinsNumbers,2147 -totalInitialConditions,2148 -totalLength,2149 -totalNumber,2150 -totalNumberOfClusters,2151 -totalNumberOfDataValuesMissingInStatisticalProcess,2152 -totalNumberOfDirections,2153 -totalNumberOfForecastProbabilities,2154 -totalNumberOfFrequencies,2155 -totalNumberOfGridPoints,2156 -totalNumberOfIterations,2157 -totalNumberOfRepetitions,2158 -totalNumberOfTileAttributePairs,2159 -totalNumberOfTubes,2160 -totalNumberOfValuesInUnpackedSubset,2161 -totalNumberOfdimensions,2162 -treatmentOfMissingData,2163 -true,2164 -trueLengthOfLastGroup,2165 -truncateDegrees,2166 -truncateLaplacian,2167 -tsectionNumber3,2168 -tsectionNumber4,2169 -tsectionNumber5,2170 -tubeDomain,2171 -tubeNumber,2172 -two,2173 -twoOrdersOfSPD,2174 -type,2175 -typeOfAnalysis,2176 -typeOfAuxiliaryInformation,2177 -typeOfCalendar,2178 -typeOfCompressionUsed,2179 -typeOfDistributionFunction,2180 -typeOfEnsembleForecast,2181 -typeOfEnsembleMember,2182 -typeOfFirstFixedSurface,2183 -typeOfGeneratingProcess,2184 -typeOfGrid,2185 -typeOfHorizontalLine,2186 -typeOfIntervalForFirstAndSecondSize,2187 -typeOfIntervalForFirstAndSecondWavelength,2188 -typeOfLevel,2189 -typeOfLevelECMF,2190 -typeOfOriginalFieldValues,2191 -typeOfPacking,2192 -typeOfPostProcessing,2193 -typeOfPreProcessing,2194 -typeOfProcessedData,2195 -typeOfSSTFieldUsed,2196 -typeOfSecondFixedSurface,2197 -typeOfSizeInterval,2198 -typeOfStatisticalPostProcessingOfEnsembleMembers,2199 -typeOfStatisticalProcessing,2200 -typeOfTimeIncrement,2201 -typeOfTimeIncrementBetweenSuccessiveFieldsUsedInTheStatisticalProcessing,2202 -typeOfWavelengthInterval,2203 -typicalCentury,2204 -typicalDate,2205 -typicalDateTime,2206 -typicalDay,2207 -typicalHour,2208 -typicalMinute,2209 -typicalMonth,2210 -typicalSecond,2211 -typicalTime,2212 -typicalYear,2213 -typicalYear2,2214 -typicalYearOfCentury,2215 -uco,2216 -ucs,2217 -unexpandedDescriptors,2218 -unexpandedDescriptorsEncoded,2219 -unitOfOffsetFromReferenceTime,2220 -unitOfTime,2221 -unitOfTimeIncrement,2222 -unitOfTimeRange,2223 -units,2224 -unitsBias,2225 -unitsConversionOffset,2226 -unitsConversionScaleFactor,2227 -unitsDecimalScaleFactor,2228 -unitsECMF,2229 -unitsFactor,2230 -unitsOfFirstFixedSurface,2231 -unitsOfSecondFixedSurface,2232 -unknown,2233 -unpack,2234 -unpackedError,2235 -unpackedSubsetPrecision,2236 -unpackedValues,2237 -unsignedIntegers,2238 -unusedBitsInBitmap,2239 -updateSequenceNumber,2240 -upperLimit,2241 -upperRange,2242 -upperThreshold,2243 -upperThresholdValue,2244 -userDateEnd,2245 -userDateStart,2246 -userDateTimeEnd,2247 -userDateTimeStart,2248 -userTimeEnd,2249 -userTimeStart,2250 -uuidOfHGrid,2251 -uuidOfVGrid,2252 -uvRelativeToGrid,2253 -validityDate,2254 -validityTime,2255 -values,2256 -variationOfVisibility,2257 -variationOfVisibilityDirection,2258 -variationOfVisibilityDirectionAngle,2259 -variationOfVisibilityDirectionTrend1,2260 -variationOfVisibilityDirectionTrend2,2261 -variationOfVisibilityDirectionTrend3,2262 -variationOfVisibilityDirectionTrend4,2263 -variationOfVisibilityTrend1,2264 -variationOfVisibilityTrend2,2265 -variationOfVisibilityTrend3,2266 -variationOfVisibilityTrend4,2267 -varno,2268 -verificationDate,2269 -verificationMonth,2270 -verificationYear,2271 -verifyingMonth,2272 -version,2273 -versionNumOfFilesFreeSpaceStorage,2274 -versionNumOfRootGroupSymbolTableEntry,2275 -versionNumOfSharedHeaderMessageFormat,2276 -versionNumberOfExperimentalSuite,2277 -versionNumberOfGribLocalTables,2278 -versionNumberOfSuperblock,2279 -versionOfModelClimate,2280 -verticalCoordinate,2281 -verticalCoordinateDefinition,2282 -verticalDomainTemplate,2283 -verticalDomainTemplateNumber,2284 -verticalVisibility,2285 -verticalVisibilityCoded,2286 -visibility,2287 -visibilityInKilometresTrend1,2288 -visibilityInKilometresTrend2,2289 -visibilityInKilometresTrend3,2290 -visibilityInKilometresTrend4,2291 -visibilityTrend1,2292 -visibilityTrend2,2293 -visibilityTrend3,2294 -visibilityTrend4,2295 -waveDomain,2296 -weightAppliedToClimateMonth1,2297 -westLongitudeOfCluster,2298 -westLongitudeOfDomainOfTubing,2299 -westernLongitudeOfClusterDomain,2300 -westernLongitudeOfDomain,2301 -widthOfFirstOrderValues,2302 -widthOfLengths,2303 -widthOfSPD,2304 -widthOfWidths,2305 -windDirection,2306 -windDirectionTrend1,2307 -windDirectionTrend2,2308 -windDirectionTrend3,2309 -windDirectionTrend4,2310 -windGust,2311 -windGustTrend1,2312 -windGustTrend2,2313 -windGustTrend3,2314 -windGustTrend4,2315 -windPresent,2316 -windSpeed,2317 -windSpeedTrend1,2318 -windSpeedTrend2,2319 -windSpeedTrend3,2320 -windSpeedTrend4,2321 -windUnits,2322 -windUnitsTrend1,2323 -windUnitsTrend2,2324 -windUnitsTrend3,2325 -windUnitsTrend4,2326 -windVariableDirection,2327 -windVariableDirectionTrend1,2328 -windVariableDirectionTrend2,2329 -windVariableDirectionTrend3,2330 -windVariableDirectionTrend4,2331 -wrongPadding,2332 -xCoordinateOfOriginOfSectorImage,2333 -xCoordinateOfSubSatellitePoint,2334 -xDirectionGridLength,2335 -xDirectionGridLengthInMetres,2336 -xDirectionGridLengthInMillimetres,2337 -xFirst,2338 -xLast,2339 -yCoordinateOfOriginOfSectorImage,2340 -yCoordinateOfSubSatellitePoint,2341 -yDirectionGridLength,2342 -yDirectionGridLengthInMetres,2343 -yDirectionGridLengthInMillimetres,2344 -yFirst,2345 -yLast,2346 -year,2347 -yearOfAnalysis,2348 -yearOfCentury,2349 -yearOfEndOfOverallTimeInterval,2350 -yearOfForecast,2351 -yearOfModelVersion,2352 -yearOfReference,2353 -zero,2354 +DIAG,26 +Date_E2,27 +Date_E3,28 +Date_E4,29 +DayOfModelVersion,30 +Di,31 +DiGiven,32 +DiInDegrees,33 +DiInMetres,34 +Dj,35 +DjGiven,36 +DjInDegrees,37 +DjInMetres,38 +Dstart,39 +Dx,40 +DxInDegrees,41 +DxInMetres,42 +Dy,43 +DyInDegrees,44 +DyInMetres,45 +ECMWF,46 +ECMWF_s,47 +Ensemble_Combinat_Number_0_none_E2,48 +Ensemble_Combinat_Number_0_none_E3,49 +Ensemble_Combinat_Number_0_none_E4,50 +Ensemble_Combination_Number,51 +Ensemble_Identifier,52 +Ensemble_Identifier_E2,53 +Ensemble_Identifier_E3,54 +Ensemble_Identifier_E4,55 +Experiment_Identifier,56 +Extra_Data_FreeFormat_0_none,57 +ExtremeValuesInMaximumRVR1,58 +ExtremeValuesInMaximumRVR2,59 +ExtremeValuesInMaximumRVR3,60 +ExtremeValuesInMaximumRVR4,61 +ExtremeValuesRVR1,62 +ExtremeValuesRVR2,63 +ExtremeValuesRVR3,64 +ExtremeValuesRVR4,65 +FMULTE,66 +FMULTM,67 +FirstLatitude,68 +GDSPresent,69 +GG,70 +GRIB,71 +GRIBEXSection1Problem,72 +GRIBEXShBugPresent,73 +GRIBEX_boustrophedonic,74 +GRIBEditionNumber,75 +GRIB_DEPTH,76 +GRIB_LATITUDE,77 +GRIB_LONGITUDE,78 +GTS,79 +GTSstr,80 +HDF5,81 +HDF5str,82 +HourOfModelVersion,83 +Hour_E2,84 +Hour_E3,85 +Hour_E4,86 +ICEFieldsUsed,87 +ICPLSIZE,88 +II,89 +INBITS,90 +INGRIB,91 +ITERATOR,92 +ITN,93 +J,94 +JS,95 +K,96 +KS,97 +LBC_Initial_Conditions,98 +LIMITS,99 +LLCOSP,100 +LSTCUM,101 +La1,102 +La1InDegrees,103 +La2,104 +LaD,105 +LaDInDegrees,106 +LaR,107 +Lap,108 +Lar1,109 +Lar1InDegrees,110 +Lar2,111 +Lar2InDegrees,112 +Latin,113 +Latin1,114 +Latin1InDegrees,115 +Latin2,116 +Latin2InDegrees,117 +Lcx,118 +LcxInMetres,119 +Lcy,120 +LcyInMetres,121 +Less_Than_Or_To_Overall_Distribution,122 +Lo1,123 +Lo1InDegrees,124 +Lo2,125 +LoR,126 +LoV,127 +LoVInDegrees,128 +Local_Number_Members_Missing,129 +Local_Number_Members_Missing_E2,130 +Local_Number_Members_Missing_E3,131 +Local_Number_Members_Missing_E4,132 +Local_Number_Members_Possible,133 +Local_Number_Members_Possible_E2,134 +Local_Number_Members_Possible_E3,135 +Local_Number_Members_Possible_E4,136 +Local_Number_Members_Used,137 +Local_Number_Members_Used_E2,138 +Local_Number_Members_Used_E3,139 +Local_Number_Members_Used_E4,140 +Lor1,141 +Lor1InDegrees,142 +Lor2,143 +Lor2InDegrees,144 +Lux,145 +LuxInMetres,146 +Luy,147 +LuyInMetres,148 +Lx,149 +LxInMetres,150 +Ly,151 +LyInMetres,152 +M,153 +METAR,154 +METARstr,155 +MS,156 +MinuteOfModelVersion,157 +Minute_E2,158 +Minute_E3,159 +Minute_E4,160 +Missing_Model_LBC,161 +Missing_Model_LBC_E2,162 +Missing_Model_LBC_E3,163 +Missing_Model_LBC_E4,164 +Model_Additional_Information,165 +Model_Identifier,166 +Model_LBC_Member_Identifier,167 +MonthOfModelVersion,168 +N,169 +N1,170 +N2,171 +NAT,172 +NB,173 +NC,174 +NC1,175 +NC2,176 +NEAREST,177 +NG,178 +NH,179 +NINT_LOG10_RITZ,180 +NINT_RITZ_EXP,181 +NL,182 +NP,183 +NR,184 +NRj,185 +NT,186 +NUT,187 +NV,188 +Nassigned,189 +Nb,190 +Ncx,191 +Ncy,192 +Nf,193 +Ni,194 +Nj,195 +Nr,196 +NrInRadiusOfEarth,197 +Number_Combination_Ensembles_1_none,198 +Nux,199 +Nuy,200 +Nx,201 +Ny,202 +Original_CodeTable_2_Version_Number,203 +Original_Parameter_Iden_CodeTable2,204 +Original_Parameter_Identifier,205 +P,206 +P1,207 +P2,208 +PLPresent,209 +PUnset,210 +PVPresent,211 +P_INST,212 +P_TACC,213 +P_TAVG,214 +Product_Identifier,215 +RENAME,216 +RVR1_1,217 +RVR2_1,218 +RVR3_1,219 +RVR4_1,220 +SOH,221 +SPD,222 +SecondLatitude,223 +SecondOfModelVersion,224 +Show_Combination_Ensem_E2_0_no_1_yes,225 +Show_Combination_Ensem_E3_0_no_1_yes,226 +Show_Combination_Ensem_E4_0_no_1_yes,227 +Sub-Experiment_Identifier,228 +TAF,229 +TAFstr,230 +TIDE,231 +TS,232 +TScalc,233 +TT,234 +TYPE_AN,235 +TYPE_CF,236 +TYPE_FC,237 +TYPE_FF,238 +TYPE_FX,239 +TYPE_OF,240 +TYPE_OR,241 +TYPE_PF,242 +Threshold_Or_Distribution_0_no_1_yes,243 +Threshold_Or_Distribution_Units,244 +Time_Range_One_E2,245 +Time_Range_One_E3,246 +Time_Range_One_E4,247 +Time_Range_Two_E2,248 +Time_Range_Two_E3,249 +Time_Range_Two_E4,250 +Total_Number_Members_Missing,251 +Total_Number_Members_Possible,252 +Total_Number_Members_Used,253 +UseEcmfConventions,254 +Used_Model_LBC,255 +Used_Model_LBC_E2,256 +Used_Model_LBC_E3,257 +Used_Model_LBC_E4,258 +WMO,259 +WRAP,260 +WRAPstr,261 +X1,262 +X1InGridLengths,263 +X2,264 +X2InGridLengths,265 +XR,266 +XRInMetres,267 +Xo,268 +Xp,269 +XpInGridLengths,270 +Y1,271 +Y1InGridLengths,272 +Y2,273 +Y2InGridLengths,274 +YR,275 +YRInMetres,276 +YY,277 +YearOfModelVersion,278 +Yo,279 +Yp,280 +YpInGridLengths,281 +ZLBASE,282 +ZLMULT,283 +_T,284 +_TS,285 +_anoffset,286 +_leg_number,287 +_numberOfValues,288 +accumulationInterval,289 +accuracyMultipliedByFactor,290 +addEmptySection2,291 +addExtraLocalSection,292 +additionalFlagPresent,293 +addressOfFileFreeSpaceInfo,294 +aerosolType,295 +aerosolbinnumber,296 +aerosolpacking,297 +alternativeRowScanning,298 +altitudeOfTheCameraFromTheEarthSCenterMeasuredInUnitsOfTheEarth,299 +analysisOffsets,300 +angleDivisor,301 +angleMultiplier,302 +angleOfRotation,303 +angleOfRotationInDegrees,304 +angleOfRotationOfProjection,305 +angleSubdivisions,306 +anoffset,307 +anoffsetFirst,308 +anoffsetFrequency,309 +anoffsetLast,310 +applicationIdentifier,311 +assertion,312 +atmosphericChemicalOrPhysicalConstituentType,313 +attributeOfTile,314 +auxiliary,315 +average,316 +averaging1Flag,317 +averaging2Flag,318 +averagingPeriod,319 +avg,320 +azimuthalWidth,321 +backgroundGeneratingProcessIdentifier,322 +backgroundProcess,323 +band,324 +baseAddress,325 +baseDateEPS,326 +baseDateOfThisLeg,327 +baseTimeEPS,328 +baseTimeOfThisLeg,329 +basicAngleOfTheInitialProductionDomain,330 +beginDayTrend1,331 +beginDayTrend2,332 +beginDayTrend3,333 +beginDayTrend4,334 +beginHourTrend1,335 +beginHourTrend2,336 +beginHourTrend3,337 +beginHourTrend4,338 +beginMinuteTrend1,339 +beginMinuteTrend2,340 +beginMinuteTrend3,341 +beginMinuteTrend4,342 +beginMonthTrend1,343 +beginMonthTrend2,344 +beginMonthTrend3,345 +beginMonthTrend4,346 +beginYearTrend1,347 +beginYearTrend2,348 +beginYearTrend3,349 +beginYearTrend4,350 +biFourierCoefficients,351 +biFourierMakeTemplate,352 +biFourierPackingModeForAxes,353 +biFourierResolutionParameterM,354 +biFourierResolutionParameterN,355 +biFourierResolutionSubSetParameterM,356 +biFourierResolutionSubSetParameterN,357 +biFourierSubTruncationType,358 +biFourierTruncationType,359 +binaryScaleFactor,360 +bitMapIndicator,361 +bitmap,362 +bitmapPresent,363 +bitmapSectionPresent,364 +bitsPerValue,365 +bitsPerValueAndRepack,366 +boot_edition,367 +bottomLevel,368 +boustrophedonic,369 +boustrophedonicOrdering,370 +bufrDataEncoded,371 +bufrHeaderCentre,372 +bufrHeaderSubCentre,373 +bufrTemplate,374 +bufrdcExpandedDescriptors,375 +calendarIdPresent,376 +calendarIdentification,377 +calendarIdentificationTemplateNumber,378 +cat,379 +categories,380 +categoryType,381 +cavokOrVisibility,382 +ccccIdentifiers,383 +ccsdsBlockSize,384 +ccsdsCompressionOptionsMask,385 +ccsdsFlags,386 +ccsdsRsi,387 +ceilingAndVisibilityOK,388 +ceilingAndVisibilityOKTrend1,389 +ceilingAndVisibilityOKTrend2,390 +ceilingAndVisibilityOKTrend3,391 +ceilingAndVisibilityOKTrend4,392 +centralClusterDefinition,393 +centralLongitude,394 +centralLongitudeInDegrees,395 +centralLongitudeInMicrodegrees,396 +centre,397 +centreDescription,398 +centreForLocal,399 +centreForTable2,400 +centuryOfAnalysis,401 +centuryOfReference,402 +centuryOfReferenceTimeOfData,403 +cfName,404 +cfNameECMF,405 +cfVarName,406 +cfVarNameECMF,407 +changeDecimalPrecision,408 +changeIndicatorTrend1,409 +changeIndicatorTrend2,410 +changeIndicatorTrend3,411 +changeIndicatorTrend4,412 +changingPrecision,413 +channel,414 +channelNumber,415 +char,416 +charValues,417 +checkInternalVersion,418 +class,419 +classOfAnalysis,420 +clearTables,421 +climateDateFrom,422 +climateDateTo,423 +climatologicalRegime,424 +cloudsAbbreviation1,425 +cloudsAbbreviation1Trend1,426 +cloudsAbbreviation1Trend2,427 +cloudsAbbreviation1Trend3,428 +cloudsAbbreviation1Trend4,429 +cloudsAbbreviation2,430 +cloudsAbbreviation2Trend1,431 +cloudsAbbreviation2Trend2,432 +cloudsAbbreviation2Trend3,433 +cloudsAbbreviation2Trend4,434 +cloudsAbbreviation3,435 +cloudsAbbreviation3Trend1,436 +cloudsAbbreviation3Trend2,437 +cloudsAbbreviation3Trend3,438 +cloudsAbbreviation3Trend4,439 +cloudsAbbreviation4,440 +cloudsAbbreviation4Trend1,441 +cloudsAbbreviation4Trend2,442 +cloudsAbbreviation4Trend3,443 +cloudsAbbreviation4Trend4,444 +cloudsBase1,445 +cloudsBase1Trend1,446 +cloudsBase1Trend2,447 +cloudsBase1Trend3,448 +cloudsBase1Trend4,449 +cloudsBase2,450 +cloudsBase2Trend1,451 +cloudsBase2Trend2,452 +cloudsBase2Trend3,453 +cloudsBase2Trend4,454 +cloudsBase3,455 +cloudsBase3Trend1,456 +cloudsBase3Trend2,457 +cloudsBase3Trend3,458 +cloudsBase3Trend4,459 +cloudsBase4,460 +cloudsBase4Trend1,461 +cloudsBase4Trend2,462 +cloudsBase4Trend3,463 +cloudsBase4Trend4,464 +cloudsBaseCoded1,465 +cloudsBaseCoded1Trend1,466 +cloudsBaseCoded1Trend2,467 +cloudsBaseCoded1Trend3,468 +cloudsBaseCoded1Trend4,469 +cloudsBaseCoded2,470 +cloudsBaseCoded2Trend1,471 +cloudsBaseCoded2Trend2,472 +cloudsBaseCoded2Trend3,473 +cloudsBaseCoded2Trend4,474 +cloudsBaseCoded3,475 +cloudsBaseCoded3Trend1,476 +cloudsBaseCoded3Trend2,477 +cloudsBaseCoded3Trend3,478 +cloudsBaseCoded3Trend4,479 +cloudsBaseCoded4,480 +cloudsBaseCoded4Trend1,481 +cloudsBaseCoded4Trend2,482 +cloudsBaseCoded4Trend3,483 +cloudsBaseCoded4Trend4,484 +cloudsCode1,485 +cloudsCode1Trend1,486 +cloudsCode1Trend2,487 +cloudsCode1Trend3,488 +cloudsCode1Trend4,489 +cloudsCode2,490 +cloudsCode2Trend1,491 +cloudsCode2Trend2,492 +cloudsCode2Trend3,493 +cloudsCode2Trend4,494 +cloudsCode3,495 +cloudsCode3Trend1,496 +cloudsCode3Trend2,497 +cloudsCode3Trend3,498 +cloudsCode3Trend4,499 +cloudsCode4,500 +cloudsCode4Trend1,501 +cloudsCode4Trend2,502 +cloudsCode4Trend3,503 +cloudsCode4Trend4,504 +cloudsTitle1,505 +cloudsTitle1Trend1,506 +cloudsTitle1Trend2,507 +cloudsTitle1Trend3,508 +cloudsTitle1Trend4,509 +cloudsTitle2,510 +cloudsTitle2Trend1,511 +cloudsTitle2Trend2,512 +cloudsTitle2Trend3,513 +cloudsTitle2Trend4,514 +cloudsTitle3,515 +cloudsTitle3Trend1,516 +cloudsTitle3Trend2,517 +cloudsTitle3Trend3,518 +cloudsTitle3Trend4,519 +cloudsTitle4,520 +cloudsTitle4Trend1,521 +cloudsTitle4Trend2,522 +cloudsTitle4Trend3,523 +cloudsTitle4Trend4,524 +clusterIdentifier,525 +clusterMember1,526 +clusterMember10,527 +clusterMember2,528 +clusterMember3,529 +clusterMember4,530 +clusterMember5,531 +clusterMember6,532 +clusterMember7,533 +clusterMember8,534 +clusterMember9,535 +clusterNumber,536 +clusterSize,537 +clusteringDomain,538 +clusteringMethod,539 +clutterFilterIndicator,540 +cnmc_cmcc,541 +cnmc_isac,542 +codeFigure,543 +codeType,544 +codedNumberOfFirstOrderPackedValues,545 +codedNumberOfGroups,546 +codedValues,547 +coefsFirst,548 +coefsSecond,549 +commonBlock,550 +complexPacking,551 +componentIndex,552 +compressedData,553 +computeLaplacianOperator,554 +computeStatistics,555 +conceptDir,556 +conceptsLocalDirAll,557 +conceptsLocalDirECMF,558 +conceptsLocalMarsDirAll,559 +conceptsMasterDir,560 +conceptsMasterMarsDir,561 +consensus,562 +consensusCount,563 +const,564 +constantAntennaElevationAngle,565 +constantFieldHalfByte,566 +constituentType,567 +controlForecastCluster,568 +coordAveraging0,569 +coordAveraging1,570 +coordAveraging2,571 +coordAveraging3,572 +coordAveragingTims,573 +coordinate1End,574 +coordinate1Flag,575 +coordinate1Start,576 +coordinate2End,577 +coordinate2Flag,578 +coordinate2Start,579 +coordinate3Flag,580 +coordinate3OfFirstGridPoint,581 +coordinate3OfLastGridPoint,582 +coordinate4Flag,583 +coordinate4OfFirstGridPoint,584 +coordinate4OfLastGridPoint,585 +coordinateFlag1,586 +coordinateFlag2,587 +coordinateIndexNumber,588 +coordinatesPresent,589 +core,590 +corr1Data,591 +corr2Data,592 +corr3Data,593 +corr4Data,594 +correction,595 +correction1,596 +correction1Part,597 +correction2,598 +correction2Part,599 +correction3,600 +correction3Part,601 +correction4,602 +correction4Part,603 +count,604 +countOfGroupLengths,605 +countOfICEFieldsUsed,606 +countTotal,607 +country,608 +crcrlf,609 +createNewData,610 +crraLocalVersion,611 +crraSection,612 +crraSuiteID,613 +daLoop,614 +data,615 +dataAccessors,616 +dataCategory,617 +dataDate,618 +dataFlag,619 +dataKeys,620 +dataLength,621 +dataOrigin,622 +dataRepresentation,623 +dataRepresentationTemplate,624 +dataRepresentationTemplateNumber,625 +dataRepresentationType,626 +dataSelection,627 +dataStream,628 +dataSubCategory,629 +dataTime,630 +dataType,631 +dataValues,632 +date,633 +dateOfAnalysis,634 +dateOfForecast,635 +dateOfForecastRun,636 +dateOfIceFieldUsed,637 +dateOfModelVersion,638 +dateOfReference,639 +dateOfSSTFieldUsed,640 +dateSSTFieldUsed,641 +dateTime,642 +datumSize,643 +day,644 +dayOfAnalysis,645 +dayOfEndOfOverallTimeInterval,646 +dayOfForecast,647 +dayOfModelVersion,648 +dayOfReference,649 +dayOfTheYearDate,650 +decimalPrecision,651 +decimalScaleFactor,652 +defaultFaFieldName,653 +defaultFaLevelName,654 +defaultFaModelName,655 +defaultName,656 +defaultParameter,657 +defaultSequence,658 +defaultShortName,659 +defaultStepUnits,660 +defaultTypeOfLevel,661 +default_max_val,662 +default_min_val,663 +default_step_units,664 +definitionFilesVersion,665 +deleteCalendarId,666 +deleteExtraLocalSection,667 +deleteLocalDefinition,668 +deletePV,669 +derivedForecast,670 +dewPointTemperature,671 +diagnostic,672 +diagnosticNumber,673 +diffInDays,674 +diffInHours,675 +dimension,676 +dimensionNumber,677 +dimensionType,678 +direction,679 +directionNumber,680 +directionOfVariation,681 +directionScalingFactor,682 +dirty_statistics,683 +disableGrib1LocalSection,684 +discipline,685 +distanceFromTubeToEnsembleMean,686 +distinctLatitudes,687 +distinctLongitudes,688 +doExtractArea,689 +doExtractDateTime,690 +doExtractSubsets,691 +doSimpleThinning,692 +domain,693 +driverInformationBlockAddress,694 +dummy,695 +dummy1,696 +dummy2,697 +dummyc,698 +dx,699 +dy,700 +earthIsOblate,701 +earthMajorAxis,702 +earthMajorAxisInMetres,703 +earthMinorAxis,704 +earthMinorAxisInMetres,705 +eastLongitudeOfCluster,706 +eastLongitudeOfDomainOfTubing,707 +easternLongitudeOfClusterDomain,708 +easternLongitudeOfDomain,709 +ed,710 +edition,711 +editionNumber,712 +efas_model,713 +efas_post_proc,714 +efiOrder,715 +eight,716 +elementsTable,717 +elevation,718 +eleven,719 +endDayTrend1,720 +endDayTrend2,721 +endDayTrend3,722 +endDayTrend4,723 +endDescriptors,724 +endGridDefinition,725 +endHourTrend1,726 +endHourTrend2,727 +endHourTrend3,728 +endHourTrend4,729 +endMark,730 +endMinuteTrend1,731 +endMinuteTrend2,732 +endMinuteTrend3,733 +endMinuteTrend4,734 +endMonthTrend1,735 +endMonthTrend2,736 +endMonthTrend3,737 +endMonthTrend4,738 +endOfFileAddress,739 +endOfHeadersMarker,740 +endOfInterval,741 +endOfMessage,742 +endOfProduct,743 +endOfRange,744 +endStep,745 +endStepInHours,746 +endTimeStep,747 +endYearTrend1,748 +endYearTrend2,749 +endYearTrend3,750 +endYearTrend4,751 +energyNorm,752 +enorm,753 +ensembleForecastNumbers,754 +ensembleForecastNumbersList,755 +ensembleSize,756 +ensembleStandardDeviation,757 +eps,758 +epsContinous,759 +epsPoint,760 +epsStatisticsContinous,761 +epsStatisticsPoint,762 +expandBy,763 +expandedAbbreviations,764 +expandedCodes,765 +expandedCrex_scales,766 +expandedCrex_units,767 +expandedCrex_widths,768 +expandedDescriptors,769 +expandedNames,770 +expandedOriginalCodes,771 +expandedOriginalReferences,772 +expandedOriginalScales,773 +expandedOriginalWidths,774 +expandedTypes,775 +expandedUnits,776 +experimentVersionNumber,777 +experimentVersionNumber1,778 +experimentVersionNumber2,779 +experimentVersionNumberOfAnalysis,780 +expoffset,781 +expver,782 +extendedFlag,783 +extraDim,784 +extraDimensionPresent,785 +extraLocalSectionNumber,786 +extraLocalSectionPresent,787 +extraValues,788 +extractAreaEastLongitude,789 +extractAreaLatitudeRank,790 +extractAreaLongitudeRank,791 +extractAreaNorthLatitude,792 +extractAreaSouthLatitude,793 +extractAreaWestLongitude,794 +extractDateTimeDayEnd,795 +extractDateTimeDayRank,796 +extractDateTimeDayStart,797 +extractDateTimeEnd,798 +extractDateTimeHourEnd,799 +extractDateTimeHourRank,800 +extractDateTimeHourStart,801 +extractDateTimeMinuteEnd,802 +extractDateTimeMinuteRank,803 +extractDateTimeMinuteStart,804 +extractDateTimeMonthEnd,805 +extractDateTimeMonthRank,806 +extractDateTimeMonthStart,807 +extractDateTimeSecondEnd,808 +extractDateTimeSecondRank,809 +extractDateTimeSecondStart,810 +extractDateTimeStart,811 +extractDateTimeYearEnd,812 +extractDateTimeYearRank,813 +extractDateTimeYearStart,814 +extractSubset,815 +extractSubsetIntervalEnd,816 +extractSubsetIntervalStart,817 +extractSubsetList,818 +extractedAreaNumberOfSubsets,819 +extractedDateTimeNumberOfSubsets,820 +extremeClockwiseWindDirection,821 +extremeCounterClockwiseWindDirection,822 +extremeValuesRVR1,823 +extremeValuesRVR2,824 +extremeValuesRVR3,825 +extremeValuesRVR4,826 +faFieldName,827 +faLevelName,828 +faModelName,829 +false,830 +falseEasting,831 +falseNorthing,832 +fcmonth,833 +fcperiod,834 +fgDate,835 +fgTime,836 +file,837 +fileConsistencyFlags,838 +firstDimension,839 +firstDimensionCoordinateValueDefinition,840 +firstDimensionPhysicalSignificance,841 +firstLatitude,842 +firstLatitudeInDegrees,843 +firstMonthUsedToBuildClimateMonth1,844 +firstMonthUsedToBuildClimateMonth2,845 +firstOrderValues,846 +flag,847 +flagForAnyFurtherInformation,848 +flagForIrregularGridCoordinateList,849 +flagForNormalOrStaggeredGrid,850 +flagShowingPostAuxiliaryArrayInUse,851 +flags,852 +floatVal,853 +floatValues,854 +forecastLeadTime,855 +forecastMonth,856 +forecastOrSingularVectorNumber,857 +forecastPeriod,858 +forecastPeriodFrom,859 +forecastPeriodTo,860 +forecastProbabilityNumber,861 +forecastSteps,862 +forecastTime,863 +forecastperiod,864 +formatVersionMajorNumber,865 +formatVersionMinorNumber,866 +freeFormData,867 +frequency,868 +frequencyNumber,869 +frequencyScalingFactor,870 +functionCode,871 +g,872 +g1conceptsLocalDirAll,873 +g1conceptsMasterDir,874 +g2grid,875 +gaussianGridName,876 +genVertHeightCoords,877 +generalExtended2ordr,878 +generatingProcessIdentificationNumber,879 +generatingProcessIdentifier,880 +generatingProcessTemplate,881 +generatingProcessTemplateNumber,882 +getNumberOfValues,883 +gg,884 +global,885 +globalDomain,886 +grib1divider,887 +grib2LocalSectionNumber,888 +grib2LocalSectionPresent,889 +grib2divider,890 +grib3divider,891 +gribDataQualityChecks,892 +gribMasterTablesVersionNumber,893 +gribTablesVersionNo,894 +grid,895 +gridCoordinate,896 +gridDefinition,897 +gridDefinitionDescription,898 +gridDefinitionSection,899 +gridDefinitionTemplateNumber,900 +gridDescriptionSectionPresent,901 +gridName,902 +gridPointPosition,903 +gridType,904 +groupInternalNodeK,905 +groupLeafNodeK,906 +groupLengths,907 +groupSplitting,908 +groupSplittingMethodUsed,909 +groupWidth,910 +groupWidths,911 +gts_CCCC,912 +gts_TTAAii,913 +gts_ddhh00,914 +gts_header,915 +halfByte,916 +hdate,917 +headersOnly,918 +heightLevelName,919 +heightOrPressureOfLevel,920 +heightPressureEtcOfLevels,921 +hideThis,922 +horizontalCoordinateDefinition,923 +horizontalCoordinateSupplement,924 +horizontalDimensionProcessed,925 +horizontalDomainTemplate,926 +horizontalDomainTemplateNumber,927 +hour,928 +hourOfAnalysis,929 +hourOfEndOfOverallTimeInterval,930 +hourOfForecast,931 +hourOfModelVersion,932 +hourOfReference,933 +hoursAfterDataCutoff,934 +hoursAfterReferenceTimeOfDataCutoff,935 +hundred,936 +iDirectionIncrement,937 +iDirectionIncrementGiven,938 +iDirectionIncrementGridLength,939 +iDirectionIncrementInDegrees,940 +iIncrement,941 +iScansNegatively,942 +iScansPositively,943 +ident,944 +identificationNumber,945 +identificationOfOriginatingGeneratingCentre,946 +identificationOfProject,947 +identifier,948 +ieeeFloats,949 +ifsParam,950 +ijDirectionIncrementGiven,951 +implementationDateOfModelCycle,952 +incrementOfLengths,953 +indexTemplate,954 +indexTemplateNumber,955 +indexedStorageInternalNodeK,956 +indexingDate,957 +indexingTime,958 +indicatorOfParameter,959 +indicatorOfTypeOfLevel,960 +indicatorOfUnitForTimeIncrement,961 +indicatorOfUnitForTimeRange,962 +indicatorOfUnitOfTimeRange,963 +inputDataPresentIndicator,964 +inputDelayedDescriptorReplicationFactor,965 +inputExtendedDelayedDescriptorReplicationFactor,966 +inputOriginatingCentre,967 +inputOverriddenReferenceValues,968 +inputProcessIdentifier,969 +inputShortDelayedDescriptorReplicationFactor,970 +instrument,971 +instrumentIdentifier,972 +instrumentType,973 +integerPointValues,974 +integerScaleFactor,975 +integerScalingFactorAppliedToDirections,976 +integerScalingFactorAppliedToFrequencies,977 +integerValues,978 +internalVersion,979 +internationalDataSubCategory,980 +interpretationOfNumberOfPoints,981 +intervalBetweenTimes,982 +isAccumulation,983 +isAuto,984 +isCavok,985 +isCavokTrend1,986 +isCavokTrend2,987 +isCavokTrend3,988 +isCavokTrend4,989 +isConstant,990 +isCorrection,991 +isEPS,992 +isEps,993 +isFillup,994 +isHindcast,995 +isOctahedral,996 +isSatellite,997 +isSatelliteType,998 +isSens,999 +is_aerosol,1000 +is_aerosol_optical,1001 +is_chemical,1002 +is_chemical_distfn,1003 +is_efas,1004 +is_ocean2d_param,1005 +is_ocean3d_param,1006 +is_rotated_grid,1007 +is_s2s,1008 +is_tigge,1009 +is_uerra,1010 +isectionNumber2,1011 +isectionNumber3,1012 +isectionNumber4,1013 +isotopeIdentificationNumber,1014 +iteration,1015 +iterationNumber,1016 +iteratorDisableUnrotate,1017 +jDirectionIncrement,1018 +jDirectionIncrementGiven,1019 +jDirectionIncrementGridLength,1020 +jDirectionIncrementInDegrees,1021 +jIncrement,1022 +jPointsAreConsecutive,1023 +jScansPositively,1024 +julianDay,1025 +julianForecastDay,1026 +keyData,1027 +keyMore,1028 +keySat,1029 +kindOfProduct,1030 +kurt,1031 +kurtosis,1032 +lBB,1033 +landtype,1034 +laplacianOperator,1035 +laplacianOperatorIsSet,1036 +laplacianScalingFactor,1037 +laplacianScalingFactorUnset,1038 +lastMonthUsedToBuildClimateMonth1,1039 +lastMonthUsedToBuildClimateMonth2,1040 +latLonValues,1041 +latitude,1042 +latitudeFirstInDegrees,1043 +latitudeLastInDegrees,1044 +latitudeLongitudeValues,1045 +latitudeOfCenterPoint,1046 +latitudeOfCenterPointInDegrees,1047 +latitudeOfCentralPointInClusterDomain,1048 +latitudeOfFirstGridPoint,1049 +latitudeOfFirstGridPointInDegrees,1050 +latitudeOfIcosahedronPole,1051 +latitudeOfLastGridPoint,1052 +latitudeOfLastGridPointInDegrees,1053 +latitudeOfNorthWestCornerOfArea,1054 +latitudeOfReferencePoint,1055 +latitudeOfReferencePointInDegrees,1056 +latitudeOfSouthEastCornerOfArea,1057 +latitudeOfSouthernPole,1058 +latitudeOfSouthernPoleInDegrees,1059 +latitudeOfStretchingPole,1060 +latitudeOfStretchingPoleInDegrees,1061 +latitudeOfSubSatellitePoint,1062 +latitudeOfSubSatellitePointInDegrees,1063 +latitudeOfTangencyPoint,1064 +latitudeOfThePoleOfStretching,1065 +latitudeOfThePolePoint,1066 +latitudeOfThePolePointInDegrees,1067 +latitudeOfTheSouthernPoleOfProjection,1068 +latitudeSexagesimal,1069 +latitudeWhereDxAndDyAreSpecified,1070 +latitudeWhereDxAndDyAreSpecifiedInDegrees,1071 +latitudes,1072 +latitudesList,1073 +latitudinalDirectionGridLength,1074 +lcwfvSuiteName,1075 +leadtime,1076 +legBaseDate,1077 +legBaseTime,1078 +legNumber,1079 +legacyGaussSubarea,1080 +lengthDescriptors,1081 +lengthIncrementForTheGroupLengths,1082 +lengthOf4DvarWindow,1083 +lengthOfHeaders,1084 +lengthOfIndexTemplate,1085 +lengthOfMessage,1086 +lengthOfOriginatorLocalTemplate,1087 +lengthOfProjectLocalTemplate,1088 +lengthOfTimeRange,1089 +lev,1090 +levTypeName,1091 +level,1092 +levelIndicator,1093 +levelType,1094 +levelist,1095 +levels,1096 +levtype,1097 +libraryVersion,1098 +listMembersMissing,1099 +listMembersMissing2,1100 +listMembersMissing3,1101 +listMembersMissing4,1102 +listMembersUsed,1103 +listMembersUsed2,1104 +listMembersUsed3,1105 +listMembersUsed4,1106 +listOfContributingSpectralBands,1107 +listOfDistributionFunctionParameter,1108 +listOfEnsembleForecastNumbers,1109 +listOfModelIdentifiers,1110 +listOfParametersUsedForClustering,1111 +listOfScaledFrequencies,1112 +local,1113 +localDateTime,1114 +localDay,1115 +localDecimalScaleFactor,1116 +localDefNumberOne,1117 +localDefNumberTwo,1118 +localDefinition,1119 +localDefinitionNumber,1120 +localDir,1121 +localExtensionPadding,1122 +localFlag,1123 +localFlagLatestVersion,1124 +localHour,1125 +localLatitude,1126 +localLatitude1,1127 +localLatitude2,1128 +localLongitude,1129 +localLongitude1,1130 +localLongitude2,1131 +localMinute,1132 +localMonth,1133 +localNumberOfObservations,1134 +localSecond,1135 +localSection,1136 +localSectionPresent,1137 +localTablesVersion,1138 +localTablesVersionNumber,1139 +localUsePresent,1140 +localYear,1141 +local_padding,1142 +local_use,1143 +logTransform,1144 +longitude,1145 +longitudeFirstInDegrees,1146 +longitudeLastInDegrees,1147 +longitudeOfCenterPoint,1148 +longitudeOfCenterPointInDegrees,1149 +longitudeOfCentralPointInClusterDomain,1150 +longitudeOfFirstDiamondCenterLine,1151 +longitudeOfFirstDiamondCenterLineInDegrees,1152 +longitudeOfFirstGridPoint,1153 +longitudeOfFirstGridPointInDegrees,1154 +longitudeOfIcosahedronPole,1155 +longitudeOfLastGridPoint,1156 +longitudeOfLastGridPointInDegrees,1157 +longitudeOfNorthWestCornerOfArea,1158 +longitudeOfReferencePoint,1159 +longitudeOfReferencePointInDegrees,1160 +longitudeOfSouthEastCornerOfArea,1161 +longitudeOfSouthernPole,1162 +longitudeOfSouthernPoleInDegrees,1163 +longitudeOfStretchingPole,1164 +longitudeOfStretchingPoleInDegrees,1165 +longitudeOfSubSatellitePoint,1166 +longitudeOfSubSatellitePointInDegrees,1167 +longitudeOfTangencyPoint,1168 +longitudeOfThePoleOfStretching,1169 +longitudeOfThePolePoint,1170 +longitudeOfThePolePointInDegrees,1171 +longitudeOfTheSouthernPoleOfProjection,1172 +longitudeSexagesimal,1173 +longitudes,1174 +longitudesList,1175 +longitudinalDirectionGridLength,1176 +lowerLimit,1177 +lowerRange,1178 +lowerThreshold,1179 +lowerThresholdValue,1180 +ls_labeling,1181 +lsdate_bug,1182 +m,1183 +mAngleMultiplier,1184 +mBasicAngle,1185 +mars,1186 +marsClass,1187 +marsClass1,1188 +marsClass2,1189 +marsDir,1190 +marsDomain,1191 +marsEndStep,1192 +marsExperimentOffset,1193 +marsExpver,1194 +marsForecastMonth,1195 +marsGrid,1196 +marsIdent,1197 +marsKeywords,1198 +marsKeywords1,1199 +marsLamModel,1200 +marsLatitude,1201 +marsLevel,1202 +marsLevelist,1203 +marsLongitude,1204 +marsModel,1205 +marsParam,1206 +marsQuantile,1207 +marsRange,1208 +marsStartStep,1209 +marsStep,1210 +marsStream,1211 +marsStream1,1212 +marsStream2,1213 +marsType,1214 +marsType1,1215 +marsType2,1216 +mars_labeling,1217 +mask,1218 +masterDir,1219 +masterTableNumber,1220 +masterTablesVersionNumber,1221 +masterTablesVersionNumberLatest,1222 +matchAerosolBinNumber,1223 +matchAerosolPacking,1224 +matchLandType,1225 +matchSort,1226 +matchTimeRepres,1227 +matrixBitmapsPresent,1228 +matrixOfValues,1229 +max,1230 +maximum,1231 +md5Data,1232 +md5DataSection,1233 +md5GridSection,1234 +md5Headers,1235 +md5Product,1236 +md5Section1,1237 +md5Section10,1238 +md5Section2,1239 +md5Section3,1240 +md5Section4,1241 +md5Section5,1242 +md5Section6,1243 +md5Section7,1244 +md5Section8,1245 +md5Section9,1246 +md5Structure,1247 +md5TimeDomainSection,1248 +meanRVR1,1249 +meanRVR2,1250 +meanRVR3,1251 +meanRVR4,1252 +meanSize,1253 +meanValueRVR1,1254 +meanValueRVR2,1255 +meanValueRVR3,1256 +meanValueRVR4,1257 +meaningOfVerticalCoordinate,1258 +memberNumber,1259 +messageLength,1260 +metadata,1261 +method,1262 +methodNumber,1263 +million,1264 +min,1265 +minimum,1266 +minute,1267 +minuteOfAnalysis,1268 +minuteOfEndOfOverallTimeInterval,1269 +minuteOfForecast,1270 +minuteOfModelVersion,1271 +minuteOfReference,1272 +minutesAfterDataCutoff,1273 +minutesAfterReferenceTimeOfDataCutoff,1274 +missingDataFlag,1275 +missingValue,1276 +missingValueManagement,1277 +missingValueManagementUsed,1278 +missingValuesPresent,1279 +mixedCoordinateDefinition,1280 +mixedCoordinateFieldFlag,1281 +modeNumber,1282 +model,1283 +modelErrorType,1284 +modelIdentifier,1285 +modelName,1286 +modelVersionDate,1287 +modelVersionTime,1288 +molarMass,1289 +month,1290 +monthOfAnalysis,1291 +monthOfEndOfOverallTimeInterval,1292 +monthOfForecast,1293 +monthOfModelVersion,1294 +monthOfReference,1295 +monthlyVerificationDate,1296 +monthlyVerificationMonth,1297 +monthlyVerificationTime,1298 +monthlyVerificationYear,1299 +multiplicationFactorForLatLong,1300 +mybits,1301 +n,1302 +n2,1303 +n3,1304 +na,1305 +name,1306 +nameECMF,1307 +nameOfFirstFixedSurface,1308 +nameOfSecondFixedSurface,1309 +names,1310 +nd,1311 +neitherPresent,1312 +newSubtype,1313 +nlev,1314 +nnn,1315 +normAtFinalTime,1316 +normAtInitialTime,1317 +normal,1318 +northLatitudeOfCluster,1319 +northLatitudeOfDomainOfTubing,1320 +northWestLatitudeOfLPOArea,1321 +northWestLatitudeOfVerficationArea,1322 +northWestLongitudeOfLPOArea,1323 +northWestLongitudeOfVerficationArea,1324 +northernLatitudeOfClusterDomain,1325 +northernLatitudeOfDomain,1326 +nosigPresent,1327 +notDecoded,1328 +nt,1329 +number,1330 +numberInHorizontalCoordinates,1331 +numberInMixedCoordinateDefinition,1332 +numberInTheAuxiliaryArray,1333 +numberInTheGridCoordinateList,1334 +numberIncludedInAverage,1335 +numberMissingFromAveragesOrAccumulations,1336 +numberOfAnalysis,1337 +numberOfBits,1338 +numberOfBitsContainingEachPackedValue,1339 +numberOfBitsForScaledGroupLengths,1340 +numberOfBitsUsedForTheGroupWidths,1341 +numberOfBitsUsedForTheScaledGroupLengths,1342 +numberOfBytesInLocalDefinition,1343 +numberOfBytesOfFreeFormatData,1344 +numberOfBytesPerInteger,1345 +numberOfCategories,1346 +numberOfCharacters,1347 +numberOfChars,1348 +numberOfClusterHighResolution,1349 +numberOfClusterLowResolution,1350 +numberOfClusters,1351 +numberOfCodedValues,1352 +numberOfCoefficientsOrValuesUsedToSpecifyFirstDimensionCoordinateFunction,1353 +numberOfCoefficientsOrValuesUsedToSpecifySecondDimensionCoordinateFunction,1354 +numberOfColumns,1355 +numberOfComponents,1356 +numberOfContributingSpectralBands,1357 +numberOfControlForecastTube,1358 +numberOfCoordinatesValues,1359 +numberOfDataBinsAlongRadials,1360 +numberOfDataMatrices,1361 +numberOfDataPoints,1362 +numberOfDataPointsExpected,1363 +numberOfDataValues,1364 +numberOfDaysInClimateSamplingWindow,1365 +numberOfDiamonds,1366 +numberOfDirections,1367 +numberOfDistinctSection3s,1368 +numberOfDistinctSection4s,1369 +numberOfDistinctSection5s,1370 +numberOfDistinctSection6s,1371 +numberOfDistinctSection7s,1372 +numberOfDistinctSection8s,1373 +numberOfDistinctSection9s,1374 +numberOfDistributionFunctionParameters,1375 +numberOfEffectiveValues,1376 +numberOfFloats,1377 +numberOfForcasts,1378 +numberOfForecastsInCluster,1379 +numberOfForecastsInEnsemble,1380 +numberOfForecastsInTheCluster,1381 +numberOfForecastsInTube,1382 +numberOfFrequencies,1383 +numberOfGridInReference,1384 +numberOfGridUsed,1385 +numberOfGroups,1386 +numberOfGroupsOfDataValues,1387 +numberOfHorizontalPoints,1388 +numberOfIntegers,1389 +numberOfInts,1390 +numberOfIterations,1391 +numberOfLocalDefinitions,1392 +numberOfLogicals,1393 +numberOfMembersInCluster,1394 +numberOfMembersInEnsemble,1395 +numberOfMissing,1396 +numberOfMissingInStatisticalProcess,1397 +numberOfMissingValues,1398 +numberOfModeOfDistribution,1399 +numberOfModels,1400 +numberOfOctectsForNumberOfPoints,1401 +numberOfOctetsExtraDescriptors,1402 +numberOfOperationalForecastTube,1403 +numberOfPackedValues,1404 +numberOfParallelsBetweenAPoleAndTheEquator,1405 +numberOfParametersUsedForClustering,1406 +numberOfPartitions,1407 +numberOfPoints,1408 +numberOfPointsAlongAMeridian,1409 +numberOfPointsAlongAParallel,1410 +numberOfPointsAlongFirstAxis,1411 +numberOfPointsAlongSecondAxis,1412 +numberOfPointsAlongTheXAxis,1413 +numberOfPointsAlongTheYAxis,1414 +numberOfPointsAlongXAxis,1415 +numberOfPointsAlongXAxisInCouplingArea,1416 +numberOfPointsAlongYAxis,1417 +numberOfPointsAlongYAxisInCouplingArea,1418 +numberOfPointsInDomain,1419 +numberOfPointsUsed,1420 +numberOfPressureLevelsUsedForClustering,1421 +numberOfRadarSitesUsed,1422 +numberOfRadials,1423 +numberOfReforecastYearsInModelClimate,1424 +numberOfRemaininChars,1425 +numberOfRepresentativeMember,1426 +numberOfReservedBytes,1427 +numberOfRows,1428 +numberOfSecondOrderPackedValues,1429 +numberOfSection,1430 +numberOfSingularVectorsComputed,1431 +numberOfSingularVectorsEvolved,1432 +numberOfStepsUsedForClustering,1433 +numberOfSubsets,1434 +numberOfTensOfThousandsOfYearsOfOffset,1435 +numberOfTimeRange,1436 +numberOfTimeSteps,1437 +numberOfUnexpandedDescriptors,1438 +numberOfUnusedBitsAtEndOfSection3,1439 +numberOfUsedSpatialTiles,1440 +numberOfUsedTileAttributes,1441 +numberOfUsefulPointsAlongXAxis,1442 +numberOfUsefulPointsAlongYAxis,1443 +numberOfVGridUsed,1444 +numberOfValues,1445 +numberOfVerticalCoordinateValues,1446 +numberOfVerticalGridDescriptors,1447 +numberOfVerticalPoints,1448 +numberingOrderOfDiamonds,1449 +numericValues,1450 +observablePropertyTemplate,1451 +observablePropertyTemplateNumber,1452 +observationDiagnostic,1453 +observationGeneratingProcessIdentifier,1454 +observationType,1455 +observedData,1456 +obstype,1457 +oceanAtmosphereCoupling,1458 +oceanLevName,1459 +oceanStream,1460 +octetAtWichPackedDataBegins,1461 +offset,1462 +offsetAfterBitmap,1463 +offsetAfterCentreLocalSection,1464 +offsetAfterData,1465 +offsetAfterLocalSection,1466 +offsetAfterPadding,1467 +offsetBBitmap,1468 +offsetBSection5,1469 +offsetBSection6,1470 +offsetBSection9,1471 +offsetBeforeBitmap,1472 +offsetBeforeData,1473 +offsetBeforePL,1474 +offsetBeforePV,1475 +offsetDescriptors,1476 +offsetEndSection4,1477 +offsetFreeFormData,1478 +offsetFromOriginToInnerBound,1479 +offsetFromReferenceOfFirstTime,1480 +offsetICEFieldsUsed,1481 +offsetSection0,1482 +offsetSection1,1483 +offsetSection10,1484 +offsetSection11,1485 +offsetSection2,1486 +offsetSection3,1487 +offsetSection4,1488 +offsetSection5,1489 +offsetSection6,1490 +offsetSection7,1491 +offsetSection8,1492 +offsetSection9,1493 +offsetToEndOf4DvarWindow,1494 +offsetValuesBy,1495 +oldSubtype,1496 +one,1497 +oneConstant,1498 +oneMillionConstant,1499 +oneMinuteMeanMaximumRVR1,1500 +oneMinuteMeanMaximumRVR2,1501 +oneMinuteMeanMaximumRVR3,1502 +oneMinuteMeanMaximumRVR4,1503 +oneMinuteMeanMinimumRVR1,1504 +oneMinuteMeanMinimumRVR2,1505 +oneMinuteMeanMinimumRVR3,1506 +oneMinuteMeanMinimumRVR4,1507 +oneThousand,1508 +oper,1509 +operStream,1510 +operatingMode,1511 +operationalForecastCluster,1512 +optimisationTime,1513 +optimizeScaleFactor,1514 +optionalData,1515 +opttime,1516 +orderOfSPD,1517 +orderOfSpatialDifferencing,1518 +orientationOfTheGrid,1519 +orientationOfTheGridInDegrees,1520 +origin,1521 +originalParameterNumber,1522 +originalParameterTableNumber,1523 +originalSubCentreIdentifier,1524 +originatingCentre,1525 +originatingCentreOfAnalysis,1526 +originatorLocalTemplate,1527 +originatorLocalTemplateNumber,1528 +overlayTemplate,1529 +overlayTemplateNumber,1530 +pack,1531 +packedValues,1532 +packingError,1533 +packingType,1534 +padding,1535 +padding_grid1_1,1536 +padding_grid1_2,1537 +padding_grid3_1,1538 +padding_grid4_1,1539 +padding_grid50_1,1540 +padding_grid5_1,1541 +padding_grid90_1,1542 +padding_loc10_1,1543 +padding_loc12_1,1544 +padding_loc13_1,1545 +padding_loc13_2,1546 +padding_loc13_3,1547 +padding_loc13_4,1548 +padding_loc13_5,1549 +padding_loc14_1,1550 +padding_loc14_2,1551 +padding_loc15_1,1552 +padding_loc16_1,1553 +padding_loc17_2,1554 +padding_loc18_1,1555 +padding_loc18_2,1556 +padding_loc190_1,1557 +padding_loc191_1,1558 +padding_loc191_2,1559 +padding_loc191_3,1560 +padding_loc192_1,1561 +padding_loc19_2,1562 +padding_loc20_1,1563 +padding_loc21_1,1564 +padding_loc23_1,1565 +padding_loc244_1,1566 +padding_loc244_2,1567 +padding_loc244_3,1568 +padding_loc245_1,1569 +padding_loc245_2,1570 +padding_loc26_1,1571 +padding_loc27_1,1572 +padding_loc27_2,1573 +padding_loc28_1,1574 +padding_loc29_1,1575 +padding_loc29_2,1576 +padding_loc29_3,1577 +padding_loc2_1,1578 +padding_loc2_2,1579 +padding_loc30_1,1580 +padding_loc30_2,1581 +padding_loc37_1,1582 +padding_loc37_2,1583 +padding_loc38_1,1584 +padding_loc3_1,1585 +padding_loc4_2,1586 +padding_loc50_1,1587 +padding_loc5_1,1588 +padding_loc6_1,1589 +padding_loc7_1,1590 +padding_loc9_1,1591 +padding_loc9_2,1592 +padding_local11_1,1593 +padding_local1_1,1594 +padding_local1_31,1595 +padding_local40_1,1596 +padding_local_35,1597 +padding_local_7_1,1598 +padding_sec1_loc,1599 +padding_sec2_1,1600 +padding_sec2_2,1601 +padding_sec2_3,1602 +padding_sec3_1,1603 +padding_sec4_1,1604 +paleontologicalOffset,1605 +param,1606 +paramId,1607 +paramIdECMF,1608 +param_value_max,1609 +param_value_min,1610 +parameter,1611 +parameterCategory,1612 +parameterCode,1613 +parameterDiscipline,1614 +parameterIndicator,1615 +parameterName,1616 +parameterNumber,1617 +parameterUnits,1618 +parameters,1619 +parametersVersion,1620 +partitionItems,1621 +partitionNumber,1622 +partitionTable,1623 +partitions,1624 +pastTendencyRVR1,1625 +pastTendencyRVR2,1626 +pastTendencyRVR3,1627 +pastTendencyRVR4,1628 +patch_precip_fp,1629 +pentagonalResolutionParameterJ,1630 +pentagonalResolutionParameterK,1631 +pentagonalResolutionParameterM,1632 +percentileValue,1633 +periodOfTime,1634 +periodOfTimeIntervals,1635 +perturbationNumber,1636 +perturbedType,1637 +phase,1638 +physicalFlag1,1639 +physicalFlag2,1640 +physicalMeaningOfVerticalCoordinate,1641 +pl,1642 +platform,1643 +plusOneinOrdersOfSPD,1644 +points,1645 +postAuxiliary,1646 +postAuxiliaryArrayPresent,1647 +powerOfTenUsedToScaleClimateWeight,1648 +preBitmapValues,1649 +preProcessingParameter,1650 +precision,1651 +precisionOfTheUnpackedSubset,1652 +predefined_grid,1653 +predefined_grid_values,1654 +present,1655 +presentTrend1,1656 +presentTrend2,1657 +presentTrend3,1658 +presentTrend4,1659 +presentWeather1Present,1660 +presentWeather1PresentTrend1,1661 +presentWeather1PresentTrend2,1662 +presentWeather1PresentTrend3,1663 +presentWeather1PresentTrend4,1664 +presentWeather2Present,1665 +presentWeather2PresentTrend1,1666 +presentWeather2PresentTrend2,1667 +presentWeather2PresentTrend3,1668 +presentWeather2PresentTrend4,1669 +presentWeather3Present,1670 +presentWeather3PresentTrend1,1671 +presentWeather3PresentTrend2,1672 +presentWeather3PresentTrend3,1673 +presentWeather3PresentTrend4,1674 +pressureLevel,1675 +pressureUnits,1676 +primaryBitmap,1677 +primaryMissingValue,1678 +primaryMissingValueSubstitute,1679 +probContinous,1680 +probPoint,1681 +probProductDefinition,1682 +probabilityType,1683 +probabilityTypeName,1684 +process,1685 +produceLargeConstantFields,1686 +product,1687 +productDefinition,1688 +productDefinitionTemplateNumber,1689 +productDefinitionTemplateNumberInternal,1690 +productIdentifier,1691 +productType,1692 +productionStatusOfProcessedData,1693 +projectLocalTemplate,1694 +projectLocalTemplateNumber,1695 +projectionCenterFlag,1696 +projectionCentreFlag,1697 +pv,1698 +pvlLocation,1699 +qfe,1700 +qfePresent,1701 +qfeUnits,1702 +qnh,1703 +qnhAPresent,1704 +qnhPresent,1705 +qnhUnits,1706 +qualityControl,1707 +qualityControlIndicator,1708 +qualityValueAssociatedWithParameter,1709 +quantile,1710 +radialAngularSpacing,1711 +radials,1712 +radius,1713 +radiusInMetres,1714 +radiusOfCentralCluster,1715 +radiusOfClusterDomain,1716 +radiusOfTheEarth,1717 +range,1718 +rangeBinSpacing,1719 +rdbDateTime,1720 +rdbSubtype,1721 +rdbType,1722 +rdb_key,1723 +rdbtime,1724 +rdbtimeDate,1725 +rdbtimeDay,1726 +rdbtimeHour,1727 +rdbtimeMinute,1728 +rdbtimeMonth,1729 +rdbtimeSecond,1730 +rdbtimeTime,1731 +rdbtimeYear,1732 +realPart,1733 +realPartOf00,1734 +recDateTime,1735 +recentWeather,1736 +recentWeatherTry,1737 +rectime,1738 +rectimeDay,1739 +rectimeHour,1740 +rectimeMinute,1741 +rectimeSecond,1742 +reducedGrid,1743 +refdate,1744 +reference,1745 +referenceDate,1746 +referenceForGroupLengths,1747 +referenceForGroupWidths,1748 +referenceOfLengths,1749 +referenceOfWidths,1750 +referenceReflectivityForEchoTop,1751 +referenceSampleInterval,1752 +referenceStep,1753 +referenceValue,1754 +referenceValueError,1755 +reflectivityCalibrationConstant,1756 +remarkPresent,1757 +reportType,1758 +representationMode,1759 +representationType,1760 +representativeMember,1761 +reserved,1762 +reserved1,1763 +reserved2,1764 +reserved3,1765 +reservedNeedNotBePresent,1766 +reservedOctet,1767 +reservedSection2,1768 +reservedSection3,1769 +reservedSection4,1770 +resolutionAndComponentFlags,1771 +resolutionAndComponentFlags1,1772 +resolutionAndComponentFlags2,1773 +resolutionAndComponentFlags3,1774 +resolutionAndComponentFlags4,1775 +resolutionAndComponentFlags6,1776 +resolutionAndComponentFlags7,1777 +resolutionAndComponentFlags8,1778 +rootGroupObjectHeaderAddress,1779 +rootGroupSymbolTableEntry,1780 +rootTablesDir,1781 +roundedMarsLatitude,1782 +roundedMarsLevelist,1783 +roundedMarsLongitude,1784 +runwayBrakingActionState1,1785 +runwayBrakingActionState2,1786 +runwayBrakingActionState3,1787 +runwayBrakingActionState4,1788 +runwayDepositCodeState1,1789 +runwayDepositCodeState2,1790 +runwayDepositCodeState3,1791 +runwayDepositCodeState4,1792 +runwayDepositState1,1793 +runwayDepositState2,1794 +runwayDepositState3,1795 +runwayDepositState4,1796 +runwayDepthOfDepositCodeState1,1797 +runwayDepthOfDepositCodeState2,1798 +runwayDepthOfDepositCodeState3,1799 +runwayDepthOfDepositCodeState4,1800 +runwayDepthOfDepositState1,1801 +runwayDepthOfDepositState2,1802 +runwayDepthOfDepositState3,1803 +runwayDepthOfDepositState4,1804 +runwayDesignatorRVR1,1805 +runwayDesignatorRVR2,1806 +runwayDesignatorRVR3,1807 +runwayDesignatorRVR4,1808 +runwayDesignatorState1,1809 +runwayDesignatorState2,1810 +runwayDesignatorState3,1811 +runwayDesignatorState4,1812 +runwayExtentOfContaminationCodeState1,1813 +runwayExtentOfContaminationCodeState2,1814 +runwayExtentOfContaminationCodeState3,1815 +runwayExtentOfContaminationCodeState4,1816 +runwayExtentOfContaminationState1,1817 +runwayExtentOfContaminationState2,1818 +runwayExtentOfContaminationState3,1819 +runwayExtentOfContaminationState4,1820 +runwayFrictionCodeValueState1,1821 +runwayFrictionCodeValueState2,1822 +runwayFrictionCodeValueState3,1823 +runwayFrictionCodeValueState4,1824 +runwayFrictionCoefficientCodeState1,1825 +runwayFrictionCoefficientCodeState2,1826 +runwayFrictionCoefficientCodeState3,1827 +runwayFrictionCoefficientCodeState4,1828 +runwayFrictionCoefficientState1,1829 +runwayFrictionCoefficientState2,1830 +runwayFrictionCoefficientState3,1831 +runwayFrictionCoefficientState4,1832 +runwaySideCodeState1,1833 +runwaySideCodeState2,1834 +runwaySideCodeState3,1835 +runwaySideCodeState4,1836 +runwayState,1837 +sampleSizeOfModelClimate,1838 +satelliteID,1839 +satelliteIdentifier,1840 +satelliteNumber,1841 +satelliteSeries,1842 +scaleFactorAtReferencePoint,1843 +scaleFactorOfCentralWaveNumber,1844 +scaleFactorOfDistanceFromEnsembleMean,1845 +scaleFactorOfDistributionFunctionParameter,1846 +scaleFactorOfEarthMajorAxis,1847 +scaleFactorOfEarthMinorAxis,1848 +scaleFactorOfFirstFixedSurface,1849 +scaleFactorOfFirstSize,1850 +scaleFactorOfFirstWavelength,1851 +scaleFactorOfLengthOfSemiMajorAxis,1852 +scaleFactorOfLengthOfSemiMinorAxis,1853 +scaleFactorOfLowerLimit,1854 +scaleFactorOfMajorAxisOfOblateSpheroidEarth,1855 +scaleFactorOfMinorAxisOfOblateSpheroidEarth,1856 +scaleFactorOfPrimeMeridianOffset,1857 +scaleFactorOfRadiusOfSphericalEarth,1858 +scaleFactorOfSecondFixedSurface,1859 +scaleFactorOfSecondSize,1860 +scaleFactorOfSecondWavelength,1861 +scaleFactorOfStandardDeviation,1862 +scaleFactorOfStandardDeviationInTheCluster,1863 +scaleFactorOfUpperLimit,1864 +scaleValuesBy,1865 +scaledDirections,1866 +scaledFrequencies,1867 +scaledValueOfCentralWaveNumber,1868 +scaledValueOfDistanceFromEnsembleMean,1869 +scaledValueOfDistributionFunctionParameter,1870 +scaledValueOfEarthMajorAxis,1871 +scaledValueOfEarthMinorAxis,1872 +scaledValueOfFirstFixedSurface,1873 +scaledValueOfFirstSize,1874 +scaledValueOfFirstWavelength,1875 +scaledValueOfLengthOfSemiMajorAxis,1876 +scaledValueOfLengthOfSemiMinorAxis,1877 +scaledValueOfLowerLimit,1878 +scaledValueOfMajorAxisOfOblateSpheroidEarth,1879 +scaledValueOfMinorAxisOfOblateSpheroidEarth,1880 +scaledValueOfPrimeMeridianOffset,1881 +scaledValueOfRadiusOfSphericalEarth,1882 +scaledValueOfSecondFixedSurface,1883 +scaledValueOfSecondSize,1884 +scaledValueOfSecondWavelength,1885 +scaledValueOfStandardDeviation,1886 +scaledValueOfStandardDeviationInTheCluster,1887 +scaledValueOfUpperLimit,1888 +scalingFactorForFrequencies,1889 +scanPosition,1890 +scanningMode,1891 +scanningMode4,1892 +scanningMode5,1893 +scanningMode6,1894 +scanningMode7,1895 +scanningMode8,1896 +scanningModeForOneDiamond,1897 +sd,1898 +second,1899 +secondDimension,1900 +secondDimensionCoordinateValueDefinition,1901 +secondDimensionPhysicalSignificance,1902 +secondLatitude,1903 +secondLatitudeInDegrees,1904 +secondOfEndOfOverallTimeInterval,1905 +secondOfForecast,1906 +secondOfModelVersion,1907 +secondOrderFlags,1908 +secondOrderOfDifferentWidth,1909 +secondOrderValuesDifferentWidths,1910 +secondaryBitMap,1911 +secondaryBitmap,1912 +secondaryBitmapPresent,1913 +secondaryBitmaps,1914 +secondaryBitmapsCount,1915 +secondaryBitmapsSize,1916 +secondaryMissingValue,1917 +secondaryMissingValueSubstitute,1918 +secondsOfAnalysis,1919 +secondsOfReference,1920 +section,1921 +section0Length,1922 +section0Pointer,1923 +section1,1924 +section10Length,1925 +section10Pointer,1926 +section11Length,1927 +section11Pointer,1928 +section1Flags,1929 +section1Length,1930 +section1Padding,1931 +section1Pointer,1932 +section2Length,1933 +section2Padding,1934 +section2Pointer,1935 +section2Present,1936 +section2Used,1937 +section3Flags,1938 +section3Length,1939 +section3Padding,1940 +section3Pointer,1941 +section3UniqueIdentifier,1942 +section4,1943 +section4Length,1944 +section4Padding,1945 +section4Pointer,1946 +section4UniqueIdentifier,1947 +section5,1948 +section5Length,1949 +section5Pointer,1950 +section5UniqueIdentifier,1951 +section6,1952 +section6Length,1953 +section6Pointer,1954 +section6UniqueIdentifier,1955 +section7,1956 +section7Length,1957 +section7Pointer,1958 +section7UniqueIdentifier,1959 +section8,1960 +section8Length,1961 +section8Pointer,1962 +section8UniqueIdentifier,1963 +section9Length,1964 +section9Pointer,1965 +section9UniqueIdentifier,1966 +sectionLengthLimitForEnsembles,1967 +sectionLengthLimitForProbability,1968 +sectionNumber,1969 +sectionPosition,1970 +section_01,1971 +section_02,1972 +section_03,1973 +section_04,1974 +section_05,1975 +section_06,1976 +section_07,1977 +section_08,1978 +section_09,1979 +section_1,1980 +section_10,1981 +section_11,1982 +section_2,1983 +section_3,1984 +section_4,1985 +section_5,1986 +section_6,1987 +section_7,1988 +section_8,1989 +selectStepTemplateInstant,1990 +selectStepTemplateInterval,1991 +sensitiveAreaDomain,1992 +sequences,1993 +setBitsPerValue,1994 +setCalendarId,1995 +setDecimalPrecision,1996 +setLocalDefinition,1997 +setToMissingIfOutOfRange,1998 +sfc_levtype,1999 +shapeOfTheEarth,2000 +shapeOfVerificationArea,2001 +shortName,2002 +shortNameECMF,2003 +short_name,2004 +signature,2005 +significanceOfReferenceDateAndTime,2006 +significanceOfReferenceTime,2007 +simpleThinningMissingRadius,2008 +simpleThinningSkip,2009 +simpleThinningStart,2010 +siteElevation,2011 +siteId,2012 +siteLatitude,2013 +siteLongitude,2014 +sizeOfLength,2015 +sizeOfOffsets,2016 +sizeOfPostAuxiliaryArray,2017 +sizeOfPostAuxiliaryArrayPlusOne,2018 +skew,2019 +skewness,2020 +skipExtraKeyAttributes,2021 +sort,2022 +sourceOfGridDefinition,2023 +sourceSinkChemicalPhysicalProcess,2024 +southEastLatitudeOfLPOArea,2025 +southEastLatitudeOfVerficationArea,2026 +southEastLongitudeOfLPOArea,2027 +southEastLongitudeOfVerficationArea,2028 +southLatitudeOfCluster,2029 +southLatitudeOfDomainOfTubing,2030 +southPoleOnProjectionPlane,2031 +southernLatitudeOfClusterDomain,2032 +southernLatitudeOfDomain,2033 +sp1,2034 +sp2,2035 +sp3,2036 +spaceUnitFlag,2037 +spacingOfBinsAlongRadials,2038 +spare,2039 +spare2,2040 +spatialProcessing,2041 +spatialSmoothingOfProduct,2042 +spectralDataRepresentationMode,2043 +spectralDataRepresentationType,2044 +spectralMode,2045 +spectralType,2046 +sphericalHarmonics,2047 +standardDeviation,2048 +standardParallel,2049 +standardParallelInDegrees,2050 +standardParallelInMicrodegrees,2051 +startOfHeaders,2052 +startOfMessage,2053 +startOfRange,2054 +startStep,2055 +startStepInHours,2056 +startTimeStep,2057 +startingAzimuth,2058 +statisticalProcess,2059 +statisticalProcessesList,2060 +statistics,2061 +status,2062 +step,2063 +stepForClustering,2064 +stepInHours,2065 +stepRange,2066 +stepRangeInHours,2067 +stepType,2068 +stepTypeForConversion,2069 +stepTypeInternal,2070 +stepUnits,2071 +stepZero,2072 +stream,2073 +streamOfAnalysis,2074 +stretchingFactor,2075 +stretchingFactorScaled,2076 +stringValues,2077 +subCentre,2078 +subDefinitions1,2079 +subDefinitions2,2080 +subLocalDefinition1,2081 +subLocalDefinition2,2082 +subLocalDefinitionLength1,2083 +subLocalDefinitionLength2,2084 +subLocalDefinitionNumber1,2085 +subLocalDefinitionNumber2,2086 +subSetJ,2087 +subSetK,2088 +subSetM,2089 +subcentreOfAnalysis,2090 +subdivisionsOfBasicAngle,2091 +suiteName,2092 +superblockExtensionAddress,2093 +swapScanningLat,2094 +swapScanningLon,2095 +swapScanningX,2096 +swapScanningY,2097 +system,2098 +systemNumber,2099 +t,2100 +table2Version,2101 +tableCode,2102 +tableNumber,2103 +tableReference,2104 +tablesLocalDir,2105 +tablesMasterDir,2106 +tablesVersion,2107 +tablesVersionLatest,2108 +targetCompressionRatio,2109 +td,2110 +tempPressureUnits,2111 +temperature,2112 +temperatureAndDewpointPresent,2113 +templatesLocalDir,2114 +templatesMasterDir,2115 +theHindcastMarsStream,2116 +theMessage,2117 +thisExperimentVersionNumber,2118 +thisMarsClass,2119 +thisMarsStream,2120 +thisMarsType,2121 +thousand,2122 +three,2123 +threshold,2124 +thresholdIndicator,2125 +tiggeCentre,2126 +tiggeLAMName,2127 +tiggeLocalVersion,2128 +tiggeModel,2129 +tiggeSection,2130 +tiggeSuiteID,2131 +tigge_name,2132 +tigge_short_name,2133 +tileClassification,2134 +tileIndex,2135 +time,2136 +timeCoordinateDefinition,2137 +timeDomainTemplate,2138 +timeDomainTemplateNumber,2139 +timeIncrement,2140 +timeIncrementBetweenSuccessiveFields,2141 +timeOfAnalysis,2142 +timeOfForecast,2143 +timeOfModelVersion,2144 +timeOfReference,2145 +timeRangeIndicator,2146 +timeRangeIndicatorFromStepRange,2147 +timeUnitFlag,2148 +timerepres,2149 +topLevel,2150 +total,2151 +totalAerosolBinsNumbers,2152 +totalInitialConditions,2153 +totalLength,2154 +totalNumber,2155 +totalNumberOfClusters,2156 +totalNumberOfDataValuesMissingInStatisticalProcess,2157 +totalNumberOfDirections,2158 +totalNumberOfForecastProbabilities,2159 +totalNumberOfFrequencies,2160 +totalNumberOfGridPoints,2161 +totalNumberOfIterations,2162 +totalNumberOfRepetitions,2163 +totalNumberOfTileAttributePairs,2164 +totalNumberOfTubes,2165 +totalNumberOfValuesInUnpackedSubset,2166 +totalNumberOfdimensions,2167 +treatmentOfMissingData,2168 +true,2169 +trueLengthOfLastGroup,2170 +truncateDegrees,2171 +truncateLaplacian,2172 +tsectionNumber3,2173 +tsectionNumber4,2174 +tsectionNumber5,2175 +tubeDomain,2176 +tubeNumber,2177 +two,2178 +twoOrdersOfSPD,2179 +type,2180 +typeOfAnalysis,2181 +typeOfAuxiliaryInformation,2182 +typeOfCalendar,2183 +typeOfCompressionUsed,2184 +typeOfDistributionFunction,2185 +typeOfEnsembleForecast,2186 +typeOfEnsembleMember,2187 +typeOfFirstFixedSurface,2188 +typeOfGeneratingProcess,2189 +typeOfGrid,2190 +typeOfHorizontalLine,2191 +typeOfIntervalForFirstAndSecondSize,2192 +typeOfIntervalForFirstAndSecondWavelength,2193 +typeOfLevel,2194 +typeOfLevelECMF,2195 +typeOfOriginalFieldValues,2196 +typeOfPacking,2197 +typeOfPostProcessing,2198 +typeOfPreProcessing,2199 +typeOfProcessedData,2200 +typeOfSSTFieldUsed,2201 +typeOfSecondFixedSurface,2202 +typeOfSizeInterval,2203 +typeOfStatisticalPostProcessingOfEnsembleMembers,2204 +typeOfStatisticalProcessing,2205 +typeOfTimeIncrement,2206 +typeOfTimeIncrementBetweenSuccessiveFieldsUsedInTheStatisticalProcessing,2207 +typeOfWavelengthInterval,2208 +typicalCentury,2209 +typicalDate,2210 +typicalDateTime,2211 +typicalDay,2212 +typicalHour,2213 +typicalMinute,2214 +typicalMonth,2215 +typicalSecond,2216 +typicalTime,2217 +typicalYear,2218 +typicalYear2,2219 +typicalYearOfCentury,2220 +uco,2221 +ucs,2222 +unexpandedDescriptors,2223 +unexpandedDescriptorsEncoded,2224 +unitOfOffsetFromReferenceTime,2225 +unitOfTime,2226 +unitOfTimeIncrement,2227 +unitOfTimeRange,2228 +units,2229 +unitsBias,2230 +unitsConversionOffset,2231 +unitsConversionScaleFactor,2232 +unitsDecimalScaleFactor,2233 +unitsECMF,2234 +unitsFactor,2235 +unitsOfFirstFixedSurface,2236 +unitsOfSecondFixedSurface,2237 +unknown,2238 +unpack,2239 +unpackedError,2240 +unpackedSubsetPrecision,2241 +unpackedValues,2242 +unsignedIntegers,2243 +unusedBitsInBitmap,2244 +updateSequenceNumber,2245 +upperLimit,2246 +upperRange,2247 +upperThreshold,2248 +upperThresholdValue,2249 +userDateEnd,2250 +userDateStart,2251 +userDateTimeEnd,2252 +userDateTimeStart,2253 +userTimeEnd,2254 +userTimeStart,2255 +uuidOfHGrid,2256 +uuidOfVGrid,2257 +uvRelativeToGrid,2258 +validityDate,2259 +validityTime,2260 +values,2261 +variationOfVisibility,2262 +variationOfVisibilityDirection,2263 +variationOfVisibilityDirectionAngle,2264 +variationOfVisibilityDirectionTrend1,2265 +variationOfVisibilityDirectionTrend2,2266 +variationOfVisibilityDirectionTrend3,2267 +variationOfVisibilityDirectionTrend4,2268 +variationOfVisibilityTrend1,2269 +variationOfVisibilityTrend2,2270 +variationOfVisibilityTrend3,2271 +variationOfVisibilityTrend4,2272 +varno,2273 +verificationDate,2274 +verificationMonth,2275 +verificationYear,2276 +verifyingMonth,2277 +version,2278 +versionNumOfFilesFreeSpaceStorage,2279 +versionNumOfRootGroupSymbolTableEntry,2280 +versionNumOfSharedHeaderMessageFormat,2281 +versionNumberOfExperimentalSuite,2282 +versionNumberOfGribLocalTables,2283 +versionNumberOfSuperblock,2284 +versionOfModelClimate,2285 +verticalCoordinate,2286 +verticalCoordinateDefinition,2287 +verticalDomainTemplate,2288 +verticalDomainTemplateNumber,2289 +verticalVisibility,2290 +verticalVisibilityCoded,2291 +visibility,2292 +visibilityInKilometresTrend1,2293 +visibilityInKilometresTrend2,2294 +visibilityInKilometresTrend3,2295 +visibilityInKilometresTrend4,2296 +visibilityTrend1,2297 +visibilityTrend2,2298 +visibilityTrend3,2299 +visibilityTrend4,2300 +waveDomain,2301 +weightAppliedToClimateMonth1,2302 +westLongitudeOfCluster,2303 +westLongitudeOfDomainOfTubing,2304 +westernLongitudeOfClusterDomain,2305 +westernLongitudeOfDomain,2306 +widthOfFirstOrderValues,2307 +widthOfLengths,2308 +widthOfSPD,2309 +widthOfWidths,2310 +windDirection,2311 +windDirectionTrend1,2312 +windDirectionTrend2,2313 +windDirectionTrend3,2314 +windDirectionTrend4,2315 +windGust,2316 +windGustTrend1,2317 +windGustTrend2,2318 +windGustTrend3,2319 +windGustTrend4,2320 +windPresent,2321 +windSpeed,2322 +windSpeedTrend1,2323 +windSpeedTrend2,2324 +windSpeedTrend3,2325 +windSpeedTrend4,2326 +windUnits,2327 +windUnitsTrend1,2328 +windUnitsTrend2,2329 +windUnitsTrend3,2330 +windUnitsTrend4,2331 +windVariableDirection,2332 +windVariableDirectionTrend1,2333 +windVariableDirectionTrend2,2334 +windVariableDirectionTrend3,2335 +windVariableDirectionTrend4,2336 +wrongPadding,2337 +xCoordinateOfOriginOfSectorImage,2338 +xCoordinateOfSubSatellitePoint,2339 +xDirectionGridLength,2340 +xDirectionGridLengthInMetres,2341 +xDirectionGridLengthInMillimetres,2342 +xFirst,2343 +xLast,2344 +yCoordinateOfOriginOfSectorImage,2345 +yCoordinateOfSubSatellitePoint,2346 +yDirectionGridLength,2347 +yDirectionGridLengthInMetres,2348 +yDirectionGridLengthInMillimetres,2349 +yFirst,2350 +yLast,2351 +year,2352 +yearOfAnalysis,2353 +yearOfCentury,2354 +yearOfEndOfOverallTimeInterval,2355 +yearOfForecast,2356 +yearOfModelVersion,2357 +yearOfReference,2358 +zero,2359 diff --git a/tools/grib_histogram.c b/tools/grib_histogram.c index bee3ca0f6..9d6c8a585 100644 --- a/tools/grib_histogram.c +++ b/tools/grib_histogram.c @@ -89,7 +89,7 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) if (values) free(values); values = (double*)malloc(size * sizeof(double)); - last_size = size; + /*last_size = size;*/ if (!values) { fprintf(stderr, "Failed to allocate memory for values (%lu bytes)\n", size * sizeof(double)); exit(1); From 1067571e782e12c8aff977015ab51c73d655c584 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 20 Feb 2020 17:13:08 +0000 Subject: [PATCH 63/82] Latest updates from develop (18) --- .appveyor.yml | 2 +- definitions/grib1/grid_definition_90.def | 2 +- definitions/grib1/grid_definition_lambert.def | 1 - definitions/grib2/template.3.100.def | 4 +- definitions/grib2/template.3.110.def | 3 +- definitions/grib2/template.3.120.def | 20 +- definitions/grib2/template.3.90.def | 2 +- definitions/grib3/template.3.110.def | 2 +- definitions/param_limits.def | 4 +- examples/C/grib_nearest_multiple.c | 24 +- fortran/grib_fortran.c | 50 +- src/bufr_util.c | 6 +- src/grib_accessor.c | 2 +- src/grib_accessor_class.c | 4 +- src/grib_accessor_class_data_2order_packing.c | 2 +- ..._accessor_class_data_apply_gdsnotpresent.c | 6 +- ...rib_accessor_class_data_g2simple_packing.c | 12 +- ...data_g2simple_packing_with_preprocessing.c | 18 +- src/grib_accessor_class_data_png_packing.c | 1 - src/grib_accessor_class_g1_increment.c | 14 +- src/grib_accessor_class_laplacian.c | 12 +- src/grib_accessor_class_longitudes.c | 1 - src/grib_accessor_class_md5.c | 2 +- src/grib_accessor_class_scale.c | 12 +- src/grib_accessor_class_to_double.c | 2 +- src/grib_dumper_class_bufr_decode_C.c | 13 +- src/grib_dumper_class_bufr_decode_filter.c | 13 +- src/grib_dumper_class_bufr_decode_fortran.c | 13 +- src/grib_dumper_class_bufr_decode_python.c | 13 +- src/grib_dumper_class_bufr_encode_C.c | 8 +- src/grib_dumper_class_bufr_encode_filter.c | 23 +- src/grib_dumper_class_bufr_encode_python.c | 6 +- src/grib_dumper_class_bufr_simple.c | 20 +- src/grib_dumper_class_default.c | 15 +- src/grib_handle.c | 1 - src/grib_hash_keys.c | 8596 +++++++++-------- src/grib_ibmfloat.c | 2 +- tests/grib_change_packing.sh | 4 +- tests/grib_data_quality_checks.sh | 12 + tests/keys | 2431 ++--- tests/unit_tests.c | 3 + tools/bufr_compare.c | 2 +- 42 files changed, 5885 insertions(+), 5498 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 30e615667..09ff2b126 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -105,4 +105,4 @@ notifications: - shahram.najm@ecmwf.int subject: 'Build {{status}}' # optional message: "{{message}}, {{commitId}}, ..." # optional - on_build_status_changed: true + on_build_success: false diff --git a/definitions/grib1/grid_definition_90.def b/definitions/grib1/grid_definition_90.def index 8d338c535..63682ccb4 100644 --- a/definitions/grib1/grid_definition_90.def +++ b/definitions/grib1/grid_definition_90.def @@ -41,7 +41,7 @@ unsigned[3] orientationOfTheGrid : edition_specific ; meta geography.orientationOfTheGridInDegrees scale(orientationOfTheGrid,oneConstant,grib1divider,truncateDegrees) : dump; unsigned[3] NrInRadiusOfEarth : edition_specific,can_be_missing,no_copy; -alias altitudeOfTheCameraFromTheEarthSCenterMeasuredInUnitsOfTheEarth = NrInRadiusOfEarth; +alias altitudeOfTheCameraFromTheEarthsCentreMeasuredInUnitsOfTheEarthsRadius = NrInRadiusOfEarth; unsigned[2] Xo : dump; alias xCoordinateOfOriginOfSectorImage=Xo; diff --git a/definitions/grib1/grid_definition_lambert.def b/definitions/grib1/grid_definition_lambert.def index 3fc91a792..aca2b323d 100644 --- a/definitions/grib1/grid_definition_lambert.def +++ b/definitions/grib1/grid_definition_lambert.def @@ -49,7 +49,6 @@ alias geography.DyInMetres=DyInMetres; alias Dy= DyInMetres; alias Dj = DyInMetres; - unsigned[1] projectionCentreFlag : dump; # Also add the old spelling of "centre" for backward compatibility alias projectionCenterFlag=projectionCentreFlag; diff --git a/definitions/grib2/template.3.100.def b/definitions/grib2/template.3.100.def index 6fb478753..89b163406 100644 --- a/definitions/grib2/template.3.100.def +++ b/definitions/grib2/template.3.100.def @@ -24,8 +24,8 @@ unsigned[4] longitudeOfThePolePoint : dump ; meta geography.longitudeOfThePolePointInDegrees g2lon(longitudeOfThePolePoint); # Longitude of the centre line of the first diamond of the icosahedron on the sphere -unsigned[4] longitudeOfFirstDiamondCenterLine : dump ; -meta geography.longitudeOfFirstDiamondCenterLineInDegrees g2lon(longitudeOfFirstDiamondCenterLine); +unsigned[4] longitudeOfFirstDiamondCentreLine : dump ; +meta geography.longitudeOfFirstDiamondCentreLineInDegrees g2lon(longitudeOfFirstDiamondCentreLine); # Grid point position codetable[1] gridPointPosition ('3.8.table',masterDir,localDir); diff --git a/definitions/grib2/template.3.110.def b/definitions/grib2/template.3.110.def index ea12ada97..5d63071db 100644 --- a/definitions/grib2/template.3.110.def +++ b/definitions/grib2/template.3.110.def @@ -30,7 +30,6 @@ unsigned[4] Dx : dump ; unsigned[4] Dy : dump ; # Projection centre flag -unsigned[1] projectionCenterFlag : dump ; +unsigned[1] projectionCentreFlag : dump ; include "grib2/template.3.scanning_mode.def"; - diff --git a/definitions/grib2/template.3.120.def b/definitions/grib2/template.3.120.def index 430f3bdfb..49daa9756 100644 --- a/definitions/grib2/template.3.120.def +++ b/definitions/grib2/template.3.120.def @@ -10,18 +10,18 @@ unsigned[4] numberOfRadials ; alias Nr = numberOfRadials; # La1 - latitude of centre point -signed[4] latitudeOfCenterPoint ; -alias La1 = latitudeOfCenterPoint; -meta geography.latitudeOfCenterPointInDegrees - scale(latitudeOfCenterPoint,one,grib2divider,truncateDegrees) : dump; -alias La1InDegrees=latitudeOfCenterPointInDegrees; +signed[4] latitudeOfCentrePoint ; +alias La1 = latitudeOfCentrePoint; +meta geography.latitudeOfCentrePointInDegrees + scale(latitudeOfCentrePoint,one,grib2divider,truncateDegrees) : dump; +alias La1InDegrees=latitudeOfCentrePointInDegrees; # Lo1 - longitude of centre point -unsigned[4] longitudeOfCenterPoint ; -alias Lo1 = longitudeOfCenterPoint; -meta geography.longitudeOfCenterPointInDegrees - scale(longitudeOfCenterPoint,one,grib2divider,truncateDegrees) : dump; -alias Lo1InDegrees=longitudeOfCenterPointInDegrees; +unsigned[4] longitudeOfCentrePoint ; +alias Lo1 = longitudeOfCentrePoint; +meta geography.longitudeOfCentrePointInDegrees + scale(longitudeOfCentrePoint,one,grib2divider,truncateDegrees) : dump; +alias Lo1InDegrees=longitudeOfCentrePointInDegrees; # Dx - spacing of bins along radials unsigned[4] spacingOfBinsAlongRadials ; diff --git a/definitions/grib2/template.3.90.def b/definitions/grib2/template.3.90.def index 22f70e6da..d35f1dce4 100644 --- a/definitions/grib2/template.3.90.def +++ b/definitions/grib2/template.3.90.def @@ -55,7 +55,7 @@ meta geography.orientationOfTheGridInDegrees # Nr - altitude of the camera from the Earth's centre, measured in units of the Earth's # (equatorial) radius multiplied by a scale factor of 10^6 unsigned[4] Nr : edition_specific,can_be_missing,no_copy; -alias altitudeOfTheCameraFromTheEarthSCenterMeasuredInUnitsOfTheEarth = Nr; +alias altitudeOfTheCameraFromTheEarthsCentreMeasuredInUnitsOfTheEarthsRadius = Nr; meta geography.NrInRadiusOfEarth scale(Nr,oneConstant,oneMillionConstant,truncateDegrees) : dump; # Xo - X-coordinate of origin of sector image diff --git a/definitions/grib3/template.3.110.def b/definitions/grib3/template.3.110.def index 81cddc241..480f50459 100644 --- a/definitions/grib3/template.3.110.def +++ b/definitions/grib3/template.3.110.def @@ -38,7 +38,7 @@ unsigned[4] Dx : dump ; unsigned[4] Dy : dump ; # Projection centre flag -unsigned[1] projectionCenterFlag : dump ; +unsigned[1] projectionCentreFlag : dump ; include "grib2/template.3.scanning_mode.def"; diff --git a/definitions/param_limits.def b/definitions/param_limits.def index 6b5c95af7..b59c98662 100644 --- a/definitions/param_limits.def +++ b/definitions/param_limits.def @@ -70,8 +70,8 @@ concept param_value_min(default_min_val) { 170 = { paramId=228096; } 170 = { paramId=228095; } 0 = { paramId=43; } - 0 = { paramId=247; } - 0 = { paramId=246; } + -0.001 = { paramId=247; } + -0.001 = { paramId=246; } -0.1 = { paramId=133; } 43000 = { paramId=134; } 0 = { paramId=173; } diff --git a/examples/C/grib_nearest_multiple.c b/examples/C/grib_nearest_multiple.c index c32bc9b93..717936dc1 100644 --- a/examples/C/grib_nearest_multiple.c +++ b/examples/C/grib_nearest_multiple.c @@ -59,50 +59,54 @@ int main(int argc, char** argv) while (fscanf(fin, "%ld %g %g", &iid, &lat, &lon) != EOF) npoints++; fclose(fin); + if (npoints==0) { + fprintf(stderr, "No input points found!\n"); + exit(1); + } id = (long*)calloc(npoints, sizeof(long)); if (!id) { - printf("unable to allocate %ld bytes\n", (long)(npoints * sizeof(long))); + fprintf(stderr, "unable to allocate %ld bytes\n", (long)(npoints * sizeof(long))); exit(1); } vlat = (double*)calloc(npoints, sizeof(double)); if (!vlat) { - printf("unable to allocate %ld bytes\n", (long)(npoints * sizeof(double))); + fprintf(stderr, "unable to allocate %ld bytes\n", (long)(npoints * sizeof(double))); exit(1); } vlon = (double*)calloc(npoints, sizeof(double)); if (!vlon) { - printf("unable to allocate %ld bytes\n", (long)(npoints * sizeof(double))); + fprintf(stderr, "unable to allocate %ld bytes\n", (long)(npoints * sizeof(double))); exit(1); } outlats = (double*)calloc(npoints, sizeof(double)); if (!outlats) { - printf("unable to allocate %ld bytes\n", (long)(npoints * sizeof(double))); + fprintf(stderr, "unable to allocate %ld bytes\n", (long)(npoints * sizeof(double))); exit(1); } outlons = (double*)calloc(npoints, sizeof(double)); if (!outlons) { - printf("unable to allocate %ld bytes\n", (long)(npoints * sizeof(double))); + fprintf(stderr, "unable to allocate %ld bytes\n", (long)(npoints * sizeof(double))); exit(1); } values = (double*)calloc(npoints, sizeof(double)); if (!values) { - printf("unable to allocate %ld bytes\n", (long)(npoints * sizeof(double))); + fprintf(stderr, "unable to allocate %ld bytes\n", (long)(npoints * sizeof(double))); exit(1); } lsm_values = (double*)calloc(npoints, sizeof(double)); if (!lsm_values) { - printf("unable to allocate %ld bytes\n", (long)(npoints * sizeof(double))); + fprintf(stderr, "unable to allocate %ld bytes\n", (long)(npoints * sizeof(double))); exit(1); } distances = (double*)calloc(npoints, sizeof(double)); if (!distances) { - printf("unable to allocate %ld bytes\n", (long)(npoints * sizeof(double))); + fprintf(stderr, "unable to allocate %ld bytes\n", (long)(npoints * sizeof(double))); exit(1); } indexes = (int*)calloc(npoints, sizeof(int)); if (!indexes) { - printf("unable to allocate %ld bytes\n", (long)(npoints * sizeof(int))); + fprintf(stderr, "unable to allocate %ld bytes\n", (long)(npoints * sizeof(int))); exit(1); } @@ -132,7 +136,7 @@ int main(int argc, char** argv) } h = codes_handle_new_from_file(0, fin, PRODUCT_GRIB, &ret); if (!h || ret != CODES_SUCCESS) { - printf(" unable to create handle\n"); + fprintf(stderr, "unable to create handle\n"); exit(1); } diff --git a/fortran/grib_fortran.c b/fortran/grib_fortran.c index 1d6743f33..289e2c5b4 100644 --- a/fortran/grib_fortran.c +++ b/fortran/grib_fortran.c @@ -258,7 +258,7 @@ static int push_file(FILE* f,char* buffer) static void _push_handle(grib_handle *h,int *gid) { - l_grib_handle* current= handle_set; + l_grib_handle* current= NULL; l_grib_handle* previous= handle_set; l_grib_handle* the_new= NULL; int myindex= 1; @@ -316,24 +316,24 @@ static void _push_handle(grib_handle *h,int *gid) static void _push_index(grib_index *h,int *gid) { - l_grib_index* current= index_set; + l_grib_index* current= NULL; l_grib_index* previous= index_set; l_grib_index* the_new= NULL; int myindex= 1; /* - if (*gid > 0 ) { - while(current) { - if(current->id == *gid) break; - current = current->next; - } - if (current) { - grib_index_delete(current->h); - current->h=h; - return; + if (*gid > 0 ) { + while(current) { + if(current->id == *gid) break; + current = current->next; + } + if (current) { + grib_index_delete(current->h); + current->h=h; + return; + } } - } - */ + */ if(!index_set){ index_set = (l_grib_index*)malloc(sizeof(l_grib_index)); @@ -374,24 +374,24 @@ static void _push_index(grib_index *h,int *gid) static void _push_multi_handle(grib_multi_handle *h,int *gid) { - l_grib_multi_handle* current= multi_handle_set; + l_grib_multi_handle* current= NULL; l_grib_multi_handle* previous= multi_handle_set; l_grib_multi_handle* the_new= NULL; int myindex= 1; /* - if (*gid > 0 ) { - while(current) { - if(current->id == *gid) break; - current = current->next; - } - if (current) { - grib_multi_handle_delete(current->h); - current->h=h; - return; + if (*gid > 0 ) { + while(current) { + if(current->id == *gid) break; + current = current->next; + } + if (current) { + grib_multi_handle_delete(current->h); + current->h=h; + return; + } } - } - */ + */ if(!multi_handle_set){ multi_handle_set = (l_grib_multi_handle*)malloc(sizeof(l_grib_multi_handle)); diff --git a/src/bufr_util.c b/src/bufr_util.c index 8211d9b41..607d88a76 100644 --- a/src/bufr_util.c +++ b/src/bufr_util.c @@ -27,8 +27,10 @@ int compute_bufr_key_rank(grib_handle* h, grib_string_list* keys, const char* ke } if (!next) { DebugAssert(prev); - prev->next = (grib_string_list*)grib_context_malloc_clear(c, sizeof(grib_string_list)); - next = prev->next; + if (prev) { + prev->next = (grib_string_list*)grib_context_malloc_clear(c, sizeof(grib_string_list)); + next = prev->next; + } } if (!next->value) { next->value = strdup(key); diff --git a/src/grib_accessor.c b/src/grib_accessor.c index 4760fd954..b1be492cd 100644 --- a/src/grib_accessor.c +++ b/src/grib_accessor.c @@ -430,7 +430,7 @@ int grib_accessor_notify_change(grib_accessor* a, grib_accessor* changed) return c->notify_change(a, changed); c = c->super ? *(c->super) : NULL; } - if (a) + if (a && a->cclass) printf("notify_change not implemented for %s %s\n", a->cclass->name, a->name); Assert(0); return 0; diff --git a/src/grib_accessor_class.c b/src/grib_accessor_class.c index f21af388b..7b470f217 100644 --- a/src/grib_accessor_class.c +++ b/src/grib_accessor_class.c @@ -325,8 +325,10 @@ int grib_section_adjust_sizes(grib_section* s, int update, int depth) else { if (!s->h->partial) { if (length >= plen) { - grib_context_log(s->h->context, GRIB_LOG_ERROR, "Invalid size %ld found for %s, assuming %ld", + if (s->owner) { + grib_context_log(s->h->context, GRIB_LOG_ERROR, "Invalid size %ld found for %s, assuming %ld", (long)plen, s->owner->name, (long)length); + } plen = length; } s->padding = plen - length; diff --git a/src/grib_accessor_class_data_2order_packing.c b/src/grib_accessor_class_data_2order_packing.c index 8c0e6bf28..79fcff4e9 100644 --- a/src/grib_accessor_class_data_2order_packing.c +++ b/src/grib_accessor_class_data_2order_packing.c @@ -272,7 +272,7 @@ static int reverse_rows(unsigned long* data, long len, long number_along_paralle { long i = 0; long left = 0; - long right = number_along_parallel - 1; + long right = 0; long tmp = 0; long inc; diff --git a/src/grib_accessor_class_data_apply_gdsnotpresent.c b/src/grib_accessor_class_data_apply_gdsnotpresent.c index aa5adb5c4..7d6fec79d 100644 --- a/src/grib_accessor_class_data_apply_gdsnotpresent.c +++ b/src/grib_accessor_class_data_apply_gdsnotpresent.c @@ -283,14 +283,14 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) ret = grib_set_long(grib_handle_of_accessor(a), self->bitmap_present, bitmap_present); if (ret) { grib_context_log(a->context, GRIB_LOG_ERROR, - "Accessor %s cannont pack value for %s error %d \n", a->name, self->bitmap_present, ret); + "Accessor %s cannot pack value for %s error %d \n", a->name, self->bitmap_present, ret); return ret; } #if 0 if(!grib_find_accessor(grib_handle_of_accessor(a),self->bitmap)){ grib_context_log(a->context, GRIB_LOG_ERROR, - "Accessor %s cannont access bitmap \n", a->name, self->bitmap_present, ret); + "Accessor %s cannot access bitmap \n", a->name, self->bitmap_present, ret); return ret; } #endif @@ -298,7 +298,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) ret = grib_set_double_array_internal(grib_handle_of_accessor(a), self->coded_values, val, *len); if (ret) { grib_context_log(a->context, GRIB_LOG_ERROR, - "Accessor %s cannont pack value for %s error %d \n", a->name, self->coded_values, ret); + "Accessor %s cannot pack value for %s error %d \n", a->name, self->coded_values, ret); return ret; } diff --git a/src/grib_accessor_class_data_g2simple_packing.c b/src/grib_accessor_class_data_g2simple_packing.c index fda80b68e..2f500d4a1 100644 --- a/src/grib_accessor_class_data_g2simple_packing.c +++ b/src/grib_accessor_class_data_g2simple_packing.c @@ -216,7 +216,17 @@ static int pack_double(grib_accessor* a, const double* cval, size_t* len) for (i = 0; i < n_vals; i++) val[i] += units_bias; - ret = super->pack_double(a, val, len); + if (super != grib_accessor_class_data_g2simple_packing) { + /* Normal case: parent not same as me! */ + ret = super->pack_double(a, val, len); + } + else { + /* GRIB-364: simple packing with logarithm pre-processing */ + grib_accessor_class* super2 = NULL; + Assert(super->super); + super2 = *(super->super); + ret = super2->pack_double(a, val, len); + } switch (ret) { case GRIB_CONSTANT_FIELD: grib_buffer_replace(a, NULL, 0, 1, 1); diff --git a/src/grib_accessor_class_data_g2simple_packing_with_preprocessing.c b/src/grib_accessor_class_data_g2simple_packing_with_preprocessing.c index a3d2f6c14..6e205ca4b 100644 --- a/src/grib_accessor_class_data_g2simple_packing_with_preprocessing.c +++ b/src/grib_accessor_class_data_g2simple_packing_with_preprocessing.c @@ -183,6 +183,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) { grib_accessor_data_g2simple_packing_with_preprocessing* self = (grib_accessor_data_g2simple_packing_with_preprocessing*)a; grib_accessor_class* super = *(a->cclass->super); + grib_accessor_class* super2 = NULL; size_t n_vals = 0; long nn = 0; @@ -213,7 +214,9 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return err; } - err = super->unpack_double(a, val, &n_vals); + Assert(super->super); + super2 = *(super->super); + err = super2->unpack_double(a, val, &n_vals); /* GRIB-364 */ if (err != GRIB_SUCCESS) return err; @@ -266,6 +269,7 @@ static int pre_processing_func(double* values, long length, long pre_processing, int ret = 0; double min = values[0]; double next_min = values[0]; + Assert(length > 0); switch (pre_processing) { /* NONE */ @@ -286,15 +290,21 @@ static int pre_processing_func(double* values, long length, long pre_processing, } if (min > 0) { *pre_processing_parameter = 0; - for (i = 0; i < length; i++) + for (i = 0; i < length; i++) { + DebugAssert(values[i] > 0); values[i] = log(values[i]); + } } else { + double ppp = 0; *pre_processing_parameter = next_min - 2 * min; if (next_min == min) return ret; - for (i = 0; i < length; i++) - values[i] = log(values[i] + *pre_processing_parameter); + ppp = *pre_processing_parameter; + for (i = 0; i < length; i++) { + DebugAssert((values[i] + ppp) > 0); + values[i] = log(values[i] + ppp); + } } } else { diff --git a/src/grib_accessor_class_data_png_packing.c b/src/grib_accessor_class_data_png_packing.c index 1e452e4b3..7632bb403 100644 --- a/src/grib_accessor_class_data_png_packing.c +++ b/src/grib_accessor_class_data_png_packing.c @@ -249,7 +249,6 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) self->dirty = 0; - n_vals = 0; err = grib_value_count(a, &nn); n_vals = nn; if (err) diff --git a/src/grib_accessor_class_g1_increment.c b/src/grib_accessor_class_g1_increment.c index 280df2b4b..80d5f470d 100644 --- a/src/grib_accessor_class_g1_increment.c +++ b/src/grib_accessor_class_g1_increment.c @@ -167,7 +167,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) long numberOfPoints = 0; if (*len < 1) - ret = GRIB_ARRAY_TOO_SMALL; + return GRIB_ARRAY_TOO_SMALL; if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->directionIncrementGiven, &directionIncrementGiven)) != GRIB_SUCCESS) return ret; @@ -222,17 +222,17 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) ret = grib_get_double_internal(grib_handle_of_accessor(a), self->first, &first); if (ret != GRIB_SUCCESS) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannont gather value for %s error %d \n", a->name, self->first, ret); + grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannot gather value for %s error %d \n", a->name, self->first, ret); return ret; } ret = grib_get_double_internal(grib_handle_of_accessor(a), self->last, &last); if (ret != GRIB_SUCCESS) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannont gather value for %s error %d \n", a->name, self->last, ret); + grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannot gather value for %s error %d \n", a->name, self->last, ret); return ret; } if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->directionIncrementGiven, &directionIncrementGiven)) != GRIB_SUCCESS) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannont gather value for %s error %d \n", a->name, self->directionIncrementGiven, ret); + grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannot gather value for %s error %d \n", a->name, self->directionIncrementGiven, ret); return ret; } @@ -249,7 +249,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) ret = grib_set_long_internal(grib_handle_of_accessor(a), self->numberOfPoints, numberOfPoints); if (ret) - grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannont pack value for %s error %d \n", a->name, self->numberOfPoints, ret); + grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannot pack value for %s error %d \n", a->name, self->numberOfPoints, ret); grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints, &codedNumberOfPoints); @@ -257,11 +257,11 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) ret = grib_set_long_internal(grib_handle_of_accessor(a), self->directionIncrement, directionIncrement); if (ret) - grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannont pack value for %s error %d \n", a->name, self->directionIncrement, ret); + grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannot pack value for %s error %d \n", a->name, self->directionIncrement, ret); ret = grib_set_long_internal(grib_handle_of_accessor(a), self->directionIncrementGiven, directionIncrementGiven); if (ret) - grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannont pack value for %s error %d \n", a->name, self->directionIncrementGiven, ret); + grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannot pack value for %s error %d \n", a->name, self->directionIncrementGiven, ret); #if 0 printf("pack -- %s=%ld %s=%ld %s=%f %s=%f %s=%ld codedNumberOfPoints=%ld %s=%f\n", diff --git a/src/grib_accessor_class_laplacian.c b/src/grib_accessor_class_laplacian.c index ec70d4e44..f602ea2fa 100644 --- a/src/grib_accessor_class_laplacian.c +++ b/src/grib_accessor_class_laplacian.c @@ -215,24 +215,24 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) ret = grib_get_long_internal(grib_handle_of_accessor(a), self->divisor, &divisor); if (ret != GRIB_SUCCESS) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannont gather value for %s error %d \n", a->name, self->divisor, ret); + grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannot gather value for %s error %d \n", a->name, self->divisor, ret); return ret; } ret = grib_get_long_internal(grib_handle_of_accessor(a), self->multiplier, &multiplier); if (ret != GRIB_SUCCESS) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannont gather value for %s error %d \n", a->name, self->divisor, ret); + grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannot gather value for %s error %d \n", a->name, self->divisor, ret); return ret; } if (self->truncating) { ret = grib_get_long_internal(grib_handle_of_accessor(a), self->truncating, &truncating); if (ret != GRIB_SUCCESS) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannont gather value for %s error %d \n", a->name, self->truncating, ret); + grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannot gather value for %s error %d \n", a->name, self->truncating, ret); return ret; } } if (multiplier == 0) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannont divide by a zero multiplier %s error %d \n", a->name, self->multiplier, ret); + grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannot divide by a zero multiplier %s error %d \n", a->name, self->multiplier, ret); return GRIB_ENCODING_ERROR; } @@ -248,7 +248,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) ret = grib_set_long_internal(grib_handle_of_accessor(a), self->value, value); if (ret) - grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannont pack value for %s error %d \n", a->name, self->value, ret); + grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannot pack value for %s error %d \n", a->name, self->value, ret); if (ret == GRIB_SUCCESS) *len = 1; @@ -271,7 +271,7 @@ static int is_missing(grib_accessor* a) if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->value, &value) ) != GRIB_SUCCESS){ grib_context_log(a->context, GRIB_LOG_ERROR, - "Accessor %s cannont gather value for %s error %d \n", a->name, + "Accessor %s cannot gather value for %s error %d \n", a->name, self->value, ret); return 0; } diff --git a/src/grib_accessor_class_longitudes.c b/src/grib_accessor_class_longitudes.c index 9b3b40608..b64c3225e 100644 --- a/src/grib_accessor_class_longitudes.c +++ b/src/grib_accessor_class_longitudes.c @@ -174,7 +174,6 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) grib_iterator* iter = NULL; self->save = 1; - size = 0; ret = value_count(a, &count); if (ret) return ret; diff --git a/src/grib_accessor_class_md5.c b/src/grib_accessor_class_md5.c index 465851bf5..6c646b563 100644 --- a/src/grib_accessor_class_md5.c +++ b/src/grib_accessor_class_md5.c @@ -254,7 +254,7 @@ static void destroy(grib_context* c, grib_accessor* a) grib_accessor_md5* self = (grib_accessor_md5*)a; if (self->blacklist) { grib_string_list* next = self->blacklist; - grib_string_list* cur = self->blacklist; + grib_string_list* cur = NULL; while (next) { cur = next; next = next->next; diff --git a/src/grib_accessor_class_scale.c b/src/grib_accessor_class_scale.c index 03ddf2fc8..5e21c6185 100644 --- a/src/grib_accessor_class_scale.c +++ b/src/grib_accessor_class_scale.c @@ -210,24 +210,24 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) ret = grib_get_long_internal(grib_handle_of_accessor(a), self->divisor, &divisor); if (ret != GRIB_SUCCESS) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannont gather value for %s error %d \n", a->name, self->divisor, ret); + grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannot gather value for %s error %d \n", a->name, self->divisor, ret); return ret; } ret = grib_get_long_internal(grib_handle_of_accessor(a), self->multiplier, &multiplier); if (ret != GRIB_SUCCESS) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannont gather value for %s error %d \n", a->name, self->divisor, ret); + grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannot gather value for %s error %d \n", a->name, self->divisor, ret); return ret; } if (self->truncating) { ret = grib_get_long_internal(grib_handle_of_accessor(a), self->truncating, &truncating); if (ret != GRIB_SUCCESS) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannont gather value for %s error %d \n", a->name, self->truncating, ret); + grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannot gather value for %s error %d \n", a->name, self->truncating, ret); return ret; } } if (multiplier == 0) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannont divide by a zero multiplier %s error %d \n", a->name, self->multiplier, ret); + grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannot divide by a zero multiplier %s error %d \n", a->name, self->multiplier, ret); return GRIB_ENCODING_ERROR; } @@ -243,7 +243,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) ret = grib_set_long_internal(grib_handle_of_accessor(a), self->value, value); if (ret) - grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannont pack value for %s error %d \n", a->name, self->value, ret); + grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor %s cannot pack value for %s error %d \n", a->name, self->value, ret); if (ret == GRIB_SUCCESS) *len = 1; @@ -265,7 +265,7 @@ static int is_missing(grib_accessor* a) if((ret = grib_get_long_internal(grib_handle_of_accessor(a),self->value, &value))!= GRIB_SUCCESS){ grib_context_log(a->context, GRIB_LOG_ERROR, - "Accessor %s cannont gather value for %s error %d \n", a->name, + "Accessor %s cannot gather value for %s error %d \n", a->name, self->value, ret); return 0; } diff --git a/src/grib_accessor_class_to_double.c b/src/grib_accessor_class_to_double.c index b9ee9554f..4a55eec5d 100644 --- a/src/grib_accessor_class_to_double.c +++ b/src/grib_accessor_class_to_double.c @@ -227,7 +227,7 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) val[length] = 0; len[0] = length; - return GRIB_SUCCESS; + return err; } static int pack_string(grib_accessor* a, const char* val, size_t* len) diff --git a/src/grib_dumper_class_bufr_decode_C.c b/src/grib_dumper_class_bufr_decode_C.c index 691aedc32..58bf34ee1 100644 --- a/src/grib_dumper_class_bufr_decode_C.c +++ b/src/grib_dumper_class_bufr_decode_C.c @@ -139,7 +139,7 @@ static int destroy(grib_dumper* d) { grib_dumper_bufr_decode_C* self = (grib_dumper_bufr_decode_C*)d; grib_string_list* next = self->keys; - grib_string_list* cur = self->keys; + grib_string_list* cur = NULL; grib_context* c = d->handle->context; while (next) { cur = next; @@ -552,16 +552,15 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) char* value = NULL; char* p = NULL; size_t size = 0; - grib_context* c = NULL; - int r; - int err = _grib_get_string_length(a, &size); + grib_context* c = a->context; + int r = 0, err = 0; grib_handle* h = grib_handle_of_accessor(a); - c = a->context; - if (size == 0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + _grib_get_string_length(a, &size); + if (size == 0) return; value = (char*)grib_context_malloc_clear(c, size); diff --git a/src/grib_dumper_class_bufr_decode_filter.c b/src/grib_dumper_class_bufr_decode_filter.c index 766d14495..1dcd76876 100644 --- a/src/grib_dumper_class_bufr_decode_filter.c +++ b/src/grib_dumper_class_bufr_decode_filter.c @@ -137,7 +137,7 @@ static int destroy(grib_dumper* d) { grib_dumper_bufr_decode_filter* self = (grib_dumper_bufr_decode_filter*)d; grib_string_list* next = self->keys; - grib_string_list* cur = self->keys; + grib_string_list* cur = NULL; grib_context* c = d->handle->context; while (next) { cur = next; @@ -466,16 +466,15 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) char* value = NULL; char* p = NULL; size_t size = 0; - grib_context* c = NULL; - int r; - int err = _grib_get_string_length(a, &size); + grib_context* c = a->context; + int r =0, err = 0; grib_handle* h = grib_handle_of_accessor(a); - c = a->context; - if (size == 0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + _grib_get_string_length(a, &size); + if (size == 0) return; value = (char*)grib_context_malloc_clear(c, size); diff --git a/src/grib_dumper_class_bufr_decode_fortran.c b/src/grib_dumper_class_bufr_decode_fortran.c index 6eea3f372..70306d7ed 100644 --- a/src/grib_dumper_class_bufr_decode_fortran.c +++ b/src/grib_dumper_class_bufr_decode_fortran.c @@ -139,7 +139,7 @@ static int destroy(grib_dumper* d) { grib_dumper_bufr_decode_fortran* self = (grib_dumper_bufr_decode_fortran*)d; grib_string_list* next = self->keys; - grib_string_list* cur = self->keys; + grib_string_list* cur = NULL; grib_context* c = d->handle->context; while (next) { cur = next; @@ -495,16 +495,15 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) char* value = NULL; char* p = NULL; size_t size = 0; - grib_context* c = NULL; - int r; - int err = _grib_get_string_length(a, &size); + grib_context* c = a->context; + int r = 0, err = 0; grib_handle* h = grib_handle_of_accessor(a); - c = a->context; - if (size == 0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + _grib_get_string_length(a, &size); + if (size == 0) return; value = (char*)grib_context_malloc_clear(c, size); diff --git a/src/grib_dumper_class_bufr_decode_python.c b/src/grib_dumper_class_bufr_decode_python.c index 735760449..151b85a9f 100644 --- a/src/grib_dumper_class_bufr_decode_python.c +++ b/src/grib_dumper_class_bufr_decode_python.c @@ -139,7 +139,7 @@ static int destroy(grib_dumper* d) { grib_dumper_bufr_decode_python* self = (grib_dumper_bufr_decode_python*)d; grib_string_list* next = self->keys; - grib_string_list* cur = self->keys; + grib_string_list* cur = NULL; grib_context* c = d->handle->context; while (next) { cur = next; @@ -508,16 +508,15 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) char* value = NULL; char* p = NULL; size_t size = 0; - grib_context* c = NULL; - int r; - int err = _grib_get_string_length(a, &size); + grib_context* c = a->context; + int r = 0, err = 0; grib_handle* h = grib_handle_of_accessor(a); - c = a->context; - if (size == 0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + _grib_get_string_length(a, &size); + if (size == 0) return; value = (char*)grib_context_malloc_clear(c, size); diff --git a/src/grib_dumper_class_bufr_encode_C.c b/src/grib_dumper_class_bufr_encode_C.c index b77691a71..0409a9334 100644 --- a/src/grib_dumper_class_bufr_encode_C.c +++ b/src/grib_dumper_class_bufr_encode_C.c @@ -139,7 +139,7 @@ static int destroy(grib_dumper* d) { grib_dumper_bufr_encode_C* self = (grib_dumper_bufr_encode_C*)d; grib_string_list* next = self->keys; - grib_string_list* cur = self->keys; + grib_string_list* cur = NULL; grib_context* c = d->handle->context; while (next) { cur = next; @@ -674,11 +674,11 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) char* p = NULL; size_t size = 0; grib_context* c = a->context; - int r; - int err = _grib_get_string_length(a, &size); - grib_handle* h = grib_handle_of_accessor(a); + int r = 0, err = 0; + grib_handle* h = grib_handle_of_accessor(a); const char* acc_name = a->name; + _grib_get_string_length(a, &size); if (size == 0) return; diff --git a/src/grib_dumper_class_bufr_encode_filter.c b/src/grib_dumper_class_bufr_encode_filter.c index 84e2a7de2..259b1a617 100644 --- a/src/grib_dumper_class_bufr_encode_filter.c +++ b/src/grib_dumper_class_bufr_encode_filter.c @@ -139,7 +139,7 @@ static int destroy(grib_dumper* d) { grib_dumper_bufr_encode_filter* self = (grib_dumper_bufr_encode_filter*)d; grib_string_list* next = self->keys; - grib_string_list* cur = self->keys; + grib_string_list* cur = NULL; grib_context* c = d->handle->context; while (next) { cur = next; @@ -245,8 +245,8 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* grib_dumper_bufr_encode_filter* self = (grib_dumper_bufr_encode_filter*)d; double value = 0; size_t size = 0, size2 = 0; - double* values = NULL; - int err = 0; + double* values = NULL; + int err = 0; int i, icount; int cols = 2; long count = 0; @@ -256,7 +256,7 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* return; grib_value_count(a, &count); - size = count; + size = count; size2 = size; if (size > 1) { @@ -622,16 +622,15 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) char* value = NULL; char* p = NULL; size_t size = 0; - grib_context* c = NULL; - int r; - int err = _grib_get_string_length(a, &size); + grib_context* c = a->context; + int r = 0, err = 0; grib_handle* h = grib_handle_of_accessor(a); - c = a->context; - if (size == 0) + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) + _grib_get_string_length(a, &size); + if (size == 0) return; value = (char*)grib_context_malloc_clear(c, size); @@ -640,9 +639,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) return; } - else - self->begin = 0; - + self->begin = 0; self->empty = 0; err = grib_unpack_string(a, value, &size); diff --git a/src/grib_dumper_class_bufr_encode_python.c b/src/grib_dumper_class_bufr_encode_python.c index 49ea56968..94572253c 100644 --- a/src/grib_dumper_class_bufr_encode_python.c +++ b/src/grib_dumper_class_bufr_encode_python.c @@ -139,7 +139,7 @@ static int destroy(grib_dumper* d) { grib_dumper_bufr_encode_python* self = (grib_dumper_bufr_encode_python*)d; grib_string_list* next = self->keys; - grib_string_list* cur = self->keys; + grib_string_list* cur = NULL; grib_context* c = d->handle->context; while (next) { cur = next; @@ -675,11 +675,11 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) char* p = NULL; size_t size = 0; grib_context* c = a->context; - int r; - int err = _grib_get_string_length(a, &size); + int r = 0, err = 0; grib_handle* h = grib_handle_of_accessor(a); const char* acc_name = a->name; + _grib_get_string_length(a, &size); if (size == 0) return; diff --git a/src/grib_dumper_class_bufr_simple.c b/src/grib_dumper_class_bufr_simple.c index 28d3b5462..abff5602f 100644 --- a/src/grib_dumper_class_bufr_simple.c +++ b/src/grib_dumper_class_bufr_simple.c @@ -21,7 +21,6 @@ IMPLEMENTS = dump_label;dump_section IMPLEMENTS = init;destroy MEMBERS = long section_offset - MEMBERS = long begin MEMBERS = long empty MEMBERS = long end MEMBERS = long isLeaf @@ -61,7 +60,6 @@ typedef struct grib_dumper_bufr_simple grib_dumper dumper; /* Members defined in bufr_simple */ long section_offset; - long begin; long empty; long end; long isLeaf; @@ -138,7 +136,7 @@ static int destroy(grib_dumper* d) { grib_dumper_bufr_simple* self = (grib_dumper_bufr_simple*)d; grib_string_list* next = self->keys; - grib_string_list* cur = self->keys; + grib_string_list* cur = NULL; grib_context* c = d->handle->context; while (next) { cur = next; @@ -176,7 +174,6 @@ static void dump_values(grib_dumper* d, grib_accessor* a) err = grib_unpack_double(a, &value, &size); } - self->begin = 0; self->empty = 0; if (size > 1) { @@ -369,7 +366,6 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) err = grib_unpack_long(a, &value, &size); } - self->begin = 0; self->empty = 0; if (size > 1) { @@ -528,7 +524,6 @@ static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) grib_unpack_double(a, &value, &size); - self->begin = 0; self->empty = 0; r = compute_bufr_key_rank(h, self->keys, a->name); @@ -583,8 +578,6 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm return; } - self->begin = 0; - if (self->isLeaf == 0) { if ((r = compute_bufr_key_rank(h, self->keys, a->name)) != 0) fprintf(self->dumper.out, "#%d#%s=", r, a->name); @@ -637,14 +630,14 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) char* value = NULL; char* p = NULL; size_t size = 0; - grib_context* c = NULL; + grib_context* c = a->context; int r = 0; int is_missing = 0; - int err = _grib_get_string_length(a, &size); + int err = 0; grib_handle* h = grib_handle_of_accessor(a); const char* acc_name = a->name; - c = a->context; + _grib_get_string_length(a, &size); if (size == 0) return; @@ -667,9 +660,6 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) return; } - else - self->begin = 0; - self->empty = 0; err = grib_unpack_string(a, value, &size); @@ -763,7 +753,6 @@ static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accesso !grib_inline_strcmp(a->name, "META")) { int err = 0; grib_handle* h = grib_handle_of_accessor(a); - self->begin = 1; self->empty = 1; err = grib_get_long(h, "numberOfSubsets", &(self->numberOfSubsets)); @@ -779,7 +768,6 @@ static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accesso else if (!grib_inline_strcmp(a->name, "groupNumber")) { if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; - self->begin = 1; self->empty = 1; grib_dump_accessors_block(d, block); } diff --git a/src/grib_dumper_class_default.c b/src/grib_dumper_class_default.c index 70101b743..af84283f3 100644 --- a/src/grib_dumper_class_default.c +++ b/src/grib_dumper_class_default.c @@ -404,10 +404,14 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) char* value = NULL; char* p = NULL; size_t size = 0; - grib_context* c = NULL; - int err = _grib_get_string_length(a, &size); + grib_context* c = a->context; + int err = 0; - c = a->context; + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) { + return; + } + + _grib_get_string_length(a, &size); if (size == 0) return; @@ -420,11 +424,6 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) err = grib_unpack_string(a, value, &size); p = value; - if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) { - grib_context_free(c, value); - return; - } - while (*p) { if (!isprint(*p)) *p = '.'; diff --git a/src/grib_handle.c b/src/grib_handle.c index 26e1fe557..3d355012f 100644 --- a/src/grib_handle.c +++ b/src/grib_handle.c @@ -1141,7 +1141,6 @@ static grib_handle* grib_handle_new_from_file_no_multi(grib_context* c, FILE* f, if (gts_header) memcpy(gl->gts_header, gts_header, gtslen); gl->gts_header_len = gtslen; grib_context_free(c, save_gts_header); - gtslen = 0; } else { gl->gts_header = NULL; diff --git a/src/grib_hash_keys.c b/src/grib_hash_keys.c index 772c52420..bbd1f617b 100644 --- a/src/grib_hash_keys.c +++ b/src/grib_hash_keys.c @@ -1,6 +1,6 @@ /* C code produced by gperf version 3.0.4 */ /* Command-line: gperf -l -C -I -t -G -H hash_keys -N grib_keys_hash_get -m 3 ../tests/keys */ -/* Computed positions: -k'1-16,19-20,23-27,$' */ +/* Computed positions: -k'1-16,19-20,23-26,28,$' */ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ @@ -34,12 +34,12 @@ error "gperf generated tables don't work with this execution character set. Plea struct grib_keys_hash { char* name; int id;}; #include -#define TOTAL_KEYWORDS 2359 +#define TOTAL_KEYWORDS 2360 #define MIN_WORD_LENGTH 1 #define MAX_WORD_LENGTH 74 #define MIN_HASH_VALUE 5 -#define MAX_HASH_VALUE 30459 -/* maximum key range = 30455, duplicates = 0 */ +#define MAX_HASH_VALUE 32396 +/* maximum key range = 32392, duplicates = 0 */ #ifdef __GNUC__ @@ -53,40 +53,41 @@ hash_keys (const char* str, unsigned int len) { static const unsigned short asso_values[] = { - 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, - 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, - 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, - 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, - 30460, 30460, 3, 30460, 30460, 2, 30460, 30460, 159, 2174, - 2478, 1797, 1710, 2393, 2659, 2924, 43, 9, 3, 2, - 2, 2, 30460, 30460, 30460, 944, 4153, 1649, 195, 872, - 345, 2381, 3228, 1901, 2474, 458, 309, 1236, 261, 111, - 945, 35, 427, 193, 63, 4079, 583, 1907, 744, 3546, - 45, 2, 3, 30460, 2, 2917, 30460, 4, 91, 46, - 2, 7, 545, 103, 100, 7, 2018, 2216, 69, 8, - 2, 21, 23, 874, 9, 9, 3, 63, 216, 285, - 77, 79, 571, 53, 3561, 8, 30460, 30460, 30460, 30460, - 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, - 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, - 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, - 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, - 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, - 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, - 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, - 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, - 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, - 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, - 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, - 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, - 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460, 30460 + 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, + 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, + 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, + 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, + 32397, 32397, 2, 32397, 32397, 2, 32397, 32397, 84, 2259, + 2121, 1222, 1324, 3588, 2388, 3002, 137, 10, 3, 2, + 2, 32397, 32397, 32397, 32397, 1059, 2932, 2767, 4, 1660, + 56, 4851, 2406, 819, 155, 279, 789, 1453, 569, 16, + 1903, 38, 1238, 62, 64, 4654, 2064, 1156, 613, 5116, + 25, 2, 3, 32397, 32397, 3085, 32397, 4, 452, 46, + 2, 7, 271, 207, 97, 7, 2212, 3554, 69, 8, + 2, 21, 23, 1042, 9, 9, 3, 63, 206, 427, + 655, 79, 1266, 263, 531, 3, 32397, 32397, 32397, 32397, + 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, + 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, + 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, + 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, + 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, + 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, + 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, + 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, + 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, + 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, + 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, + 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, + 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397, 32397 }; register int hval = len; switch (hval) { default: - hval += asso_values[(unsigned char)str[26]]; + hval += asso_values[(unsigned char)str[27]]; /*FALLTHROUGH*/ + case 27: case 26: hval += asso_values[(unsigned char)str[25]]; /*FALLTHROUGH*/ @@ -113,7 +114,7 @@ hash_keys (const char* str, unsigned int len) hval += asso_values[(unsigned char)str[15]+3]; /*FALLTHROUGH*/ case 15: - hval += asso_values[(unsigned char)str[14]+4]; + hval += asso_values[(unsigned char)str[14]]; /*FALLTHROUGH*/ case 14: hval += asso_values[(unsigned char)str[13]]; @@ -164,840 +165,880 @@ hash_keys (const char* str, unsigned int len) static const unsigned char lengthtable[] = { 0, 0, 0, 0, 0, 1, 0, 1, 2, 2, 2, 3, 2, 2, - 0, 2, 0, 1, 0, 0, 0, 4, 3, 0, 0, 0, 0, 4, - 0, 5, 0, 0, 4, 0, 0, 0, 4, 0, 0, 0, 3, 0, - 0, 4, 5, 0, 0, 8, 0, 4, 0, 3, 6, 0, 6, 0, - 0, 0, 7, 3, 5, 5, 0, 0, 5, 0, 0, 0, 0, 4, - 7, 0, 0, 4, 9, 0, 9, 0, 0, 0, 6, 0, 9, 0, - 0, 0, 7, 6, 0, 5, 0, 0, 9, 4, 4, 6, 0, 0, - 5, 0, 0, 7, 10, 6, 7, 4, 6, 10, 10, 6, 0, 0, - 4, 8, 0, 9, 8, 0, 7, 10, 7, 0, 8, 4, 0, 0, - 10, 4, 5, 6, 3, 0, 0, 0, 0, 0, 0, 5, 5, 0, - 7, 7, 9, 5, 0, 0, 0, 0, 0, 6, 0, 5, 0, 8, - 3, 5, 0, 6, 2, 0, 0, 0, 2, 2, 0, 6, 0, 3, - 0, 3, 0, 0, 4, 8, 5, 0, 0, 7, 0, 0, 0, 5, - 0, 10, 0, 9, 9, 0, 6, 8, 7, 2, 7, 0, 7, 6, - 10, 0, 0, 0, 8, 0, 0, 0, 8, 0, 4, 1, 0, 0, - 0, 2, 6, 0, 8, 0, 0, 8, 0, 0, 0, 0, 0, 9, - 0, 0, 0, 0, 5, 8, 0, 0, 6, 0, 13, 10, 0, 8, - 0, 5, 0, 0, 6, 0, 5, 0, 0, 7, 14, 0, 0, 0, - 0, 7, 11, 10, 0, 7, 6, 0, 10, 10, 0, 8, 10, 0, - 0, 7, 0, 9, 0, 0, 10, 0, 0, 0, 8, 2, 5, 10, - 7, 2, 0, 5, 12, 0, 9, 8, 7, 0, 0, 0, 0, 9, - 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 10, 7, 0, - 8, 7, 0, 2, 8, 0, 0, 0, 6, 0, 10, 0, 0, 0, - 0, 11, 0, 0, 8, 0, 0, 0, 0, 9, 5, 3, 0, 0, - 0, 0, 11, 0, 0, 0, 11, 0, 0, 0, 0, 9, 0, 0, - 0, 2, 0, 0, 6, 2, 0, 0, 0, 0, 0, 0, 3, 0, - 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, - 10, 0, 0, 0, 0, 6, 0, 9, 0, 13, 0, 2, 0, 0, - 6, 0, 0, 0, 0, 0, 8, 9, 0, 0, 12, 9, 0, 0, - 13, 9, 11, 6, 5, 0, 5, 10, 0, 9, 8, 2, 7, 12, - 0, 2, 0, 11, 0, 0, 0, 11, 17, 3, 0, 0, 6, 13, - 0, 0, 0, 8, 9, 0, 12, 0, 5, 0, 0, 2, 0, 11, - 0, 0, 11, 2, 0, 13, 10, 0, 0, 2, 0, 6, 0, 6, - 0, 0, 3, 2, 0, 11, 3, 2, 0, 0, 10, 6, 0, 0, - 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 11, - 0, 0, 0, 0, 10, 14, 10, 0, 10, 0, 20, 0, 0, 0, - 0, 0, 14, 11, 0, 0, 16, 3, 3, 0, 4, 0, 3, 0, - 0, 13, 0, 0, 0, 1, 10, 17, 18, 12, 0, 3, 0, 0, - 0, 3, 0, 0, 0, 0, 0, 9, 0, 0, 12, 13, 0, 0, - 0, 0, 0, 15, 0, 11, 0, 0, 0, 0, 9, 0, 0, 17, - 0, 0, 0, 0, 0, 13, 0, 0, 10, 18, 8, 0, 0, 17, - 8, 0, 0, 13, 10, 13, 0, 0, 0, 8, 10, 0, 11, 0, - 0, 9, 0, 7, 0, 0, 11, 0, 0, 24, 10, 12, 13, 9, - 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 11, 0, 10, - 0, 0, 0, 0, 0, 0, 10, 8, 0, 0, 0, 10, 0, 0, - 0, 0, 15, 4, 0, 0, 9, 12, 0, 4, 0, 12, 14, 0, - 0, 8, 5, 10, 0, 0, 0, 0, 12, 0, 0, 9, 0, 0, - 13, 0, 0, 10, 0, 0, 19, 0, 0, 0, 0, 0, 8, 0, - 0, 0, 0, 0, 13, 0, 13, 0, 0, 0, 13, 0, 0, 10, - 0, 11, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 8, 0, - 13, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 12, 0, - 8, 0, 9, 0, 0, 0, 0, 0, 12, 0, 0, 20, 0, 0, - 23, 0, 0, 0, 8, 0, 0, 0, 0, 12, 10, 0, 0, 0, - 13, 0, 5, 0, 6, 0, 12, 0, 13, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 10, 15, 11, 15, 0, 0, 10, 0, 0, - 10, 0, 0, 15, 22, 0, 17, 0, 15, 0, 13, 0, 13, 0, - 0, 0, 21, 11, 2, 0, 0, 0, 2, 0, 0, 0, 0, 17, - 0, 0, 0, 0, 14, 15, 0, 0, 0, 0, 0, 0, 12, 0, - 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 13, 4, 0, 0, 13, 7, 10, 0, 0, 0, 20, 0, 0, - 0, 24, 9, 0, 0, 14, 2, 0, 0, 0, 0, 0, 0, 23, - 25, 11, 12, 15, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, - 0, 0, 6, 0, 0, 0, 9, 0, 0, 15, 0, 13, 0, 2, - 0, 0, 6, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, - 0, 19, 0, 10, 0, 0, 0, 1, 0, 0, 0, 18, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 12, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, - 12, 18, 0, 0, 15, 0, 0, 19, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, - 13, 0, 0, 0, 0, 0, 14, 0, 0, 0, 12, 0, 0, 0, - 0, 0, 0, 12, 0, 0, 0, 0, 13, 0, 0, 0, 13, 0, - 0, 0, 0, 0, 0, 11, 10, 0, 0, 9, 0, 12, 0, 0, - 0, 0, 0, 0, 15, 0, 8, 0, 0, 0, 0, 0, 19, 0, - 0, 0, 17, 6, 11, 0, 9, 14, 8, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 11, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, - 0, 3, 26, 0, 0, 0, 11, 0, 0, 0, 0, 0, 14, 0, - 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 13, 15, 0, 0, 0, 0, 0, 0, 0, 20, 14, 2, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, - 9, 0, 0, 0, 0, 6, 0, 0, 0, 0, 17, 0, 0, 8, - 13, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 12, - 0, 11, 0, 0, 24, 0, 0, 0, 3, 0, 0, 0, 0, 0, - 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 31, 3, 0, 12, - 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 12, 0, 0, - 11, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, - 0, 0, 0, 9, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 18, 17, 0, 0, 0, 18, 0, 13, - 0, 6, 13, 14, 0, 0, 0, 0, 0, 0, 0, 0, 12, 11, - 0, 7, 0, 0, 13, 0, 18, 0, 14, 0, 30, 0, 16, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, - 17, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 3, 0, 14, 24, 0, 0, 23, 0, 0, 0, - 0, 0, 24, 0, 0, 32, 0, 0, 0, 2, 0, 0, 0, 0, - 0, 0, 0, 0, 12, 0, 0, 0, 0, 21, 17, 0, 11, 0, - 0, 15, 0, 8, 12, 13, 15, 0, 0, 15, 0, 0, 0, 16, - 20, 9, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, - 0, 0, 0, 0, 23, 0, 13, 0, 11, 0, 23, 0, 0, 27, - 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 16, - 19, 2, 0, 0, 0, 0, 14, 0, 3, 0, 0, 0, 0, 0, - 23, 9, 0, 0, 0, 0, 15, 0, 0, 0, 0, 12, 0, 23, - 0, 37, 0, 13, 0, 0, 0, 16, 12, 0, 0, 0, 14, 0, - 0, 0, 0, 0, 25, 0, 0, 0, 15, 0, 0, 15, 0, 9, - 0, 0, 43, 0, 14, 23, 0, 14, 0, 0, 0, 0, 0, 19, - 0, 3, 0, 0, 10, 0, 0, 0, 0, 14, 0, 0, 24, 0, - 0, 0, 0, 21, 0, 0, 0, 21, 0, 0, 0, 18, 0, 0, - 19, 0, 0, 0, 0, 3, 3, 30, 0, 0, 23, 0, 0, 14, - 23, 0, 12, 24, 0, 0, 0, 8, 11, 0, 48, 0, 0, 0, - 13, 0, 20, 22, 0, 14, 14, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 11, 0, 0, 27, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 16, 19, 0, 27, 2, 0, 0, 0, 11, 14, 11, 0, 0, 0, - 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 2, 0, 0, 0, 19, 27, 14, 0, 0, 15, 15, 0, 0, 10, - 11, 14, 26, 0, 18, 17, 17, 0, 47, 12, 16, 12, 0, 0, - 14, 0, 12, 23, 0, 0, 0, 0, 0, 27, 0, 0, 0, 20, - 0, 0, 0, 22, 0, 0, 0, 14, 0, 0, 21, 0, 31, 0, - 0, 10, 0, 0, 21, 14, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 30, 0, 3, 0, 0, 0, 22, 0, 0, 0, - 15, 0, 0, 0, 23, 14, 0, 19, 0, 0, 0, 0, 9, 13, - 10, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 21, 13, 0, - 0, 21, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 27, - 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 13, 21, 20, - 0, 0, 0, 14, 0, 0, 14, 0, 0, 0, 32, 0, 0, 0, - 0, 0, 0, 16, 0, 0, 0, 0, 13, 0, 9, 0, 0, 14, - 0, 22, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, - 0, 14, 26, 0, 0, 0, 12, 0, 0, 27, 0, 0, 0, 0, - 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 15, - 0, 0, 19, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 19, - 13, 0, 0, 13, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, - 0, 25, 0, 0, 0, 17, 23, 26, 0, 0, 0, 0, 0, 25, - 0, 1, 0, 0, 0, 22, 0, 0, 15, 0, 0, 28, 0, 17, - 0, 0, 18, 15, 0, 0, 0, 16, 22, 0, 16, 0, 0, 0, - 15, 0, 15, 0, 0, 12, 0, 14, 0, 0, 18, 0, 0, 0, - 0, 0, 21, 0, 0, 6, 0, 0, 0, 0, 0, 0, 20, 13, - 0, 0, 0, 0, 12, 0, 0, 0, 19, 0, 0, 9, 19, 0, - 7, 21, 28, 0, 0, 12, 30, 0, 0, 0, 0, 10, 0, 0, - 0, 0, 16, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, - 0, 0, 28, 0, 0, 0, 0, 28, 0, 15, 31, 0, 0, 0, - 16, 0, 16, 10, 0, 0, 0, 25, 0, 11, 0, 0, 9, 19, - 24, 0, 17, 11, 0, 15, 0, 0, 0, 0, 0, 0, 13, 0, - 0, 0, 0, 0, 0, 0, 18, 0, 0, 25, 15, 0, 16, 0, - 0, 24, 0, 0, 0, 0, 0, 21, 16, 0, 0, 0, 35, 0, - 12, 0, 18, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 25, 0, 15, 26, 32, 22, 0, 0, 18, 0, 0, 24, 0, - 0, 23, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 13, - 0, 9, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 18, 0, 0, - 0, 0, 0, 0, 16, 16, 0, 0, 0, 0, 0, 0, 0, 16, - 16, 30, 26, 13, 19, 0, 18, 29, 0, 0, 0, 2, 0, 13, - 0, 0, 0, 0, 0, 9, 42, 0, 0, 13, 0, 16, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 27, 15, 21, - 0, 0, 0, 18, 0, 0, 13, 0, 0, 20, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, - 0, 0, 8, 0, 0, 14, 0, 25, 0, 0, 0, 0, 5, 6, - 0, 0, 0, 21, 0, 0, 0, 0, 22, 0, 15, 0, 0, 0, - 15, 0, 10, 0, 0, 0, 0, 37, 9, 0, 0, 0, 0, 0, - 34, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, - 0, 22, 0, 0, 0, 27, 0, 11, 20, 31, 0, 0, 0, 0, - 0, 0, 24, 14, 0, 0, 17, 0, 0, 0, 17, 12, 39, 0, - 0, 15, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, - 0, 0, 0, 17, 0, 17, 0, 0, 0, 0, 15, 18, 31, 0, - 0, 0, 38, 29, 0, 0, 0, 15, 0, 0, 18, 0, 0, 0, - 16, 19, 0, 0, 0, 27, 0, 39, 0, 0, 10, 23, 18, 0, - 15, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 28, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, - 14, 28, 0, 14, 0, 0, 0, 0, 0, 0, 22, 14, 0, 21, - 13, 0, 22, 0, 18, 15, 0, 23, 0, 17, 30, 0, 0, 10, - 0, 0, 0, 12, 0, 0, 0, 0, 40, 0, 14, 20, 0, 0, - 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 19, 0, 0, 0, - 0, 0, 0, 0, 15, 0, 0, 30, 22, 1, 11, 0, 0, 0, - 9, 0, 0, 0, 30, 0, 15, 0, 15, 0, 0, 3, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 0, 0, 0, 0, - 14, 15, 0, 15, 0, 6, 0, 0, 0, 0, 0, 0, 0, 7, - 20, 0, 9, 0, 0, 32, 15, 35, 0, 9, 29, 0, 24, 0, - 0, 0, 0, 3, 0, 15, 0, 16, 0, 0, 0, 0, 0, 0, - 0, 14, 19, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 8, - 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 22, 0, 23, - 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 23, 0, 0, 0, - 0, 10, 0, 0, 0, 42, 0, 0, 0, 0, 7, 0, 0, 44, - 0, 0, 0, 0, 0, 0, 23, 0, 30, 0, 0, 0, 0, 16, - 13, 0, 7, 0, 25, 22, 24, 14, 16, 0, 0, 0, 0, 17, - 0, 0, 0, 16, 22, 0, 0, 30, 0, 0, 0, 0, 0, 28, - 0, 0, 0, 11, 0, 0, 0, 20, 0, 0, 12, 0, 0, 0, - 0, 0, 0, 0, 12, 0, 14, 17, 0, 11, 0, 0, 16, 6, - 0, 0, 0, 0, 0, 17, 0, 13, 0, 0, 11, 0, 0, 0, - 22, 19, 0, 26, 0, 0, 0, 0, 0, 0, 24, 0, 0, 17, - 0, 0, 11, 0, 21, 0, 0, 20, 6, 0, 0, 0, 0, 0, + 0, 2, 0, 1, 0, 0, 2, 4, 3, 0, 0, 0, 0, 4, + 0, 5, 0, 0, 4, 0, 0, 0, 4, 0, 0, 0, 3, 6, + 0, 4, 5, 0, 8, 8, 0, 4, 0, 3, 6, 0, 6, 0, + 0, 0, 7, 3, 5, 5, 0, 0, 5, 0, 7, 0, 0, 4, + 7, 0, 0, 4, 9, 0, 9, 0, 9, 0, 6, 0, 9, 0, + 0, 0, 7, 6, 10, 5, 0, 0, 9, 4, 4, 6, 0, 0, + 5, 0, 0, 7, 10, 6, 7, 0, 6, 10, 10, 6, 0, 6, + 4, 0, 8, 9, 0, 8, 7, 10, 7, 0, 8, 4, 10, 5, + 10, 10, 0, 6, 3, 0, 0, 8, 0, 5, 7, 0, 0, 0, + 7, 10, 9, 5, 0, 0, 6, 0, 0, 0, 0, 5, 5, 0, + 3, 9, 8, 0, 0, 0, 0, 0, 2, 2, 2, 0, 0, 3, + 0, 4, 0, 10, 6, 8, 5, 0, 0, 7, 0, 0, 0, 5, + 0, 10, 0, 9, 9, 10, 6, 0, 2, 7, 7, 0, 2, 0, + 10, 0, 0, 0, 0, 8, 0, 4, 8, 0, 0, 11, 0, 10, + 0, 8, 11, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 8, 4, 0, 5, 0, 13, 17, 0, + 0, 0, 0, 5, 0, 0, 5, 0, 8, 0, 0, 14, 0, 11, + 0, 0, 0, 13, 0, 0, 6, 0, 0, 6, 10, 10, 8, 9, + 8, 0, 5, 0, 7, 20, 0, 10, 11, 0, 0, 0, 0, 0, + 0, 2, 0, 5, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 11, 0, 0, 0, 0, 13, 7, 12, 0, 6, 8, + 0, 7, 0, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, + 0, 13, 0, 9, 0, 9, 0, 5, 0, 0, 0, 17, 8, 0, + 0, 9, 0, 10, 0, 10, 0, 6, 0, 8, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 11, 0, 11, 0, 0, 0, 0, 0, 0, + 10, 4, 0, 0, 0, 0, 0, 0, 5, 6, 0, 10, 0, 8, + 18, 0, 0, 9, 6, 8, 0, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 8, 9, 0, 0, 0, 17, 0, 23, 8, 2, + 24, 10, 7, 10, 13, 0, 0, 8, 0, 1, 0, 0, 0, 0, + 0, 11, 0, 0, 8, 11, 0, 0, 0, 0, 0, 0, 5, 0, + 0, 0, 0, 2, 12, 0, 0, 0, 10, 0, 0, 0, 0, 15, + 11, 17, 0, 10, 0, 0, 0, 0, 0, 0, 7, 0, 0, 7, + 0, 0, 0, 10, 4, 0, 0, 0, 0, 22, 0, 0, 0, 3, + 10, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 7, 0, + 14, 0, 0, 0, 0, 6, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 23, 0, 0, 0, + 0, 18, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, + 0, 9, 0, 0, 9, 0, 7, 0, 0, 0, 6, 0, 0, 1, + 0, 0, 0, 0, 8, 0, 12, 11, 0, 0, 0, 14, 13, 6, + 5, 0, 0, 6, 19, 0, 12, 0, 0, 10, 0, 2, 0, 12, + 22, 2, 0, 6, 0, 14, 0, 0, 0, 0, 0, 8, 0, 0, + 0, 12, 0, 0, 0, 0, 7, 13, 0, 0, 0, 0, 11, 12, + 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, + 12, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 2, + 0, 0, 0, 2, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, + 0, 22, 0, 11, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 9, 0, 13, 13, 0, 14, 2, + 0, 0, 10, 0, 0, 0, 0, 14, 0, 0, 0, 9, 11, 8, + 14, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 15, 6, + 15, 2, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 22, 0, + 21, 9, 0, 0, 0, 0, 6, 12, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 13, 0, 9, 4, 0, 0, 0, 0, 0, 7, 0, + 0, 11, 0, 0, 0, 0, 3, 0, 0, 0, 0, 14, 0, 12, + 0, 0, 0, 0, 21, 0, 0, 0, 0, 3, 0, 0, 0, 0, + 10, 0, 18, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 13, + 0, 9, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 12, 3, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 6, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, + 0, 0, 13, 0, 14, 0, 0, 9, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 5, 0, 0, 0, + 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, + 0, 0, 0, 7, 0, 0, 17, 0, 6, 0, 0, 25, 6, 10, + 0, 0, 27, 0, 12, 0, 0, 0, 0, 18, 0, 10, 10, 0, + 0, 13, 0, 19, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, + 10, 0, 0, 0, 0, 11, 0, 39, 40, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 13, 13, 48, 30, 9, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 14, 0, 0, 13, 0, 0, 0, 0, 0, + 0, 0, 13, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 23, 0, 0, 0, 44, 0, 0, 0, 18, 0, 0, 0, + 0, 15, 17, 0, 0, 0, 0, 15, 0, 21, 0, 0, 0, 0, + 0, 0, 17, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 15, + 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, + 0, 0, 0, 27, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 11, 2, 0, 11, 16, 0, 0, 16, + 16, 0, 0, 16, 0, 0, 17, 0, 0, 0, 0, 0, 15, 0, + 0, 0, 18, 0, 24, 1, 0, 0, 10, 0, 0, 0, 0, 0, + 0, 15, 0, 11, 0, 0, 6, 0, 0, 0, 0, 0, 0, 7, + 0, 0, 0, 10, 12, 0, 0, 10, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 6, + 0, 0, 17, 0, 0, 0, 0, 27, 0, 0, 0, 0, 8, 0, + 0, 0, 13, 0, 0, 15, 9, 0, 8, 0, 0, 6, 25, 0, + 12, 18, 0, 0, 12, 0, 0, 10, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 20, 0, 14, 3, 0, 0, 3, 0, 0, 0, 0, + 0, 0, 0, 37, 13, 0, 21, 0, 0, 0, 0, 0, 0, 13, + 0, 0, 0, 0, 0, 0, 0, 0, 19, 11, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 9, 0, 0, 11, 0, 0, 0, 12, 0, + 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 11, 13, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, + 2, 35, 0, 0, 0, 26, 0, 0, 0, 3, 0, 0, 4, 0, + 3, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 16, 31, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 19, + 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 18, 16, 13, 11, + 0, 19, 17, 0, 0, 0, 8, 0, 0, 8, 0, 0, 0, 14, + 0, 0, 12, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, + 0, 0, 0, 0, 0, 0, 0, 0, 15, 9, 17, 12, 0, 14, + 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 12, 22, + 0, 0, 31, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 14, 13, 0, 0, 0, 0, 5, 0, + 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, + 23, 0, 16, 10, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 9, 0, 31, 0, 0, 11, 0, 0, + 0, 12, 16, 20, 9, 23, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 15, 0, 0, 0, 0, 0, 13, 18, 0, 0, 0, 0, 15, + 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 21, + 0, 0, 16, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 21, 0, 0, 16, 0, 0, 26, 0, 2, 0, 0, + 0, 15, 0, 0, 13, 0, 0, 0, 0, 15, 0, 0, 0, 0, + 0, 0, 0, 0, 10, 0, 0, 0, 9, 17, 0, 0, 0, 0, + 0, 0, 0, 0, 9, 0, 0, 0, 11, 0, 0, 12, 0, 0, + 15, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, + 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 23, 0, 11, 0, 0, 0, 9, 0, 26, 0, 24, 0, + 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, + 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 14, 11, 18, 23, 0, 0, + 5, 0, 25, 24, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, + 0, 16, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 18, 0, 0, 12, + 12, 0, 23, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, + 0, 13, 0, 0, 28, 0, 0, 23, 11, 16, 0, 0, 16, 0, + 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 15, 0, 15, 0, + 0, 0, 0, 11, 0, 0, 0, 15, 11, 0, 0, 0, 15, 0, + 10, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, + 0, 15, 0, 30, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, + 19, 0, 14, 14, 11, 0, 0, 0, 0, 0, 0, 12, 18, 0, + 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 15, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 13, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 15, + 14, 0, 0, 0, 22, 0, 0, 0, 0, 0, 3, 0, 0, 22, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 13, 3, + 0, 11, 13, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, + 0, 15, 0, 0, 0, 0, 0, 12, 0, 30, 0, 0, 19, 0, + 0, 9, 3, 0, 15, 13, 0, 20, 0, 0, 12, 0, 8, 0, + 11, 0, 0, 0, 0, 0, 13, 23, 0, 0, 0, 0, 0, 30, + 14, 29, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 8, 0, 0, 0, 0, 3, 0, 0, 0, 0, 12, + 0, 0, 0, 0, 0, 0, 0, 0, 30, 17, 0, 0, 0, 0, + 0, 0, 0, 24, 0, 11, 0, 0, 24, 0, 19, 14, 11, 0, + 25, 0, 19, 22, 10, 15, 0, 0, 0, 0, 0, 0, 13, 0, + 15, 0, 13, 14, 12, 0, 0, 25, 0, 0, 0, 0, 15, 0, + 18, 0, 0, 0, 15, 20, 0, 0, 0, 0, 30, 0, 16, 0, + 22, 2, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, + 0, 0, 18, 0, 24, 0, 0, 0, 0, 0, 0, 0, 24, 19, + 17, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 20, 0, 15, 0, 3, 2, 0, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 25, 38, 0, 3, 16, 0, 0, 23, + 0, 0, 0, 0, 17, 0, 12, 0, 0, 0, 30, 17, 27, 0, + 0, 25, 0, 0, 24, 0, 0, 17, 32, 22, 0, 0, 0, 0, + 0, 42, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 14, 0, 0, 0, 15, 0, 0, 0, 0, 14, 0, 21, 0, + 0, 14, 0, 0, 0, 8, 31, 0, 9, 9, 0, 15, 16, 0, + 0, 25, 0, 0, 11, 20, 0, 0, 10, 0, 0, 17, 0, 0, + 22, 26, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 19, 16, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 39, 0, 12, 12, 0, 18, 0, 22, 0, 14, + 0, 0, 0, 39, 15, 0, 0, 0, 10, 0, 0, 16, 0, 22, + 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, + 0, 10, 0, 0, 3, 0, 13, 0, 0, 14, 0, 18, 0, 0, + 0, 29, 0, 0, 0, 0, 0, 15, 0, 0, 17, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 9, 0, 29, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 20, 0, 0, 14, 0, 19, 0, 10, 15, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, + 0, 0, 0, 10, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, + 0, 14, 15, 9, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, + 32, 16, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, + 0, 3, 41, 0, 0, 0, 0, 0, 0, 22, 0, 0, 15, 0, + 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 10, 0, 0, 11, 0, 0, 33, 0, 0, 0, 0, 0, + 21, 0, 0, 11, 0, 23, 0, 0, 24, 0, 0, 0, 9, 0, + 0, 0, 0, 17, 33, 0, 0, 0, 0, 14, 18, 16, 0, 0, + 0, 0, 21, 0, 28, 0, 0, 0, 0, 31, 21, 0, 0, 6, + 34, 0, 0, 0, 0, 0, 0, 0, 22, 15, 20, 0, 0, 0, + 0, 0, 0, 0, 18, 21, 8, 0, 0, 0, 0, 16, 27, 0, + 0, 0, 0, 17, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 23, 10, 0, 0, 0, 0, 36, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, + 17, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, 42, 18, 25, 15, 0, 0, 13, 0, + 11, 0, 0, 0, 24, 0, 0, 23, 0, 0, 0, 29, 0, 0, + 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 27, 0, 0, 0, 0, 0, 0, 0, 22, 25, 13, 23, 0, 0, + 0, 0, 29, 0, 0, 14, 0, 9, 0, 26, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 38, 9, 0, 13, 0, + 22, 0, 20, 0, 0, 0, 0, 0, 17, 35, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 26, 0, 8, 0, 0, 0, 24, 0, 0, + 14, 0, 0, 12, 0, 15, 0, 0, 0, 15, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 32, 0, 15, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, + 24, 11, 13, 0, 11, 0, 10, 0, 0, 22, 0, 0, 0, 0, + 21, 18, 11, 0, 0, 0, 18, 0, 0, 17, 0, 0, 0, 0, + 23, 0, 0, 0, 0, 20, 0, 41, 0, 17, 0, 0, 10, 0, + 0, 0, 0, 21, 0, 0, 0, 0, 0, 17, 0, 16, 0, 0, + 0, 0, 0, 0, 23, 0, 0, 6, 0, 15, 0, 0, 0, 18, + 0, 0, 17, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, 0, 0, 28, 18, 0, 0, 23, 0, + 27, 0, 0, 0, 47, 17, 14, 0, 9, 1, 0, 0, 0, 17, + 0, 0, 19, 0, 28, 0, 0, 23, 20, 0, 0, 0, 20, 0, + 0, 0, 18, 0, 0, 22, 18, 22, 0, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, + 0, 19, 0, 0, 0, 0, 0, 17, 23, 0, 0, 0, 0, 0, + 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 10, 0, 0, 0, 24, 0, 0, 0, 0, + 0, 0, 9, 0, 0, 0, 0, 21, 0, 0, 23, 0, 0, 12, + 0, 0, 0, 0, 0, 0, 0, 20, 0, 27, 0, 0, 23, 14, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, + 0, 0, 0, 0, 0, 26, 0, 0, 33, 2, 0, 0, 0, 0, + 25, 20, 9, 0, 0, 0, 0, 13, 0, 11, 13, 0, 0, 0, + 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 12, 14, 22, 0, + 0, 21, 0, 0, 13, 0, 0, 0, 0, 0, 30, 2, 0, 0, + 10, 0, 0, 0, 24, 0, 0, 0, 15, 0, 0, 0, 0, 0, + 0, 0, 0, 11, 23, 0, 0, 0, 26, 14, 0, 0, 0, 0, + 0, 0, 27, 0, 0, 28, 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 15, 0, 0, 0, 0, 0, 21, 0, 22, 0, 0, 0, + 0, 22, 0, 18, 0, 0, 0, 12, 0, 0, 23, 0, 13, 0, + 14, 13, 0, 0, 0, 18, 0, 21, 0, 0, 29, 0, 20, 0, + 0, 2, 0, 0, 0, 15, 0, 0, 0, 0, 0, 16, 0, 0, + 0, 0, 0, 0, 10, 0, 0, 21, 0, 12, 0, 0, 0, 8, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 28, 0, 0, 0, + 0, 0, 15, 0, 15, 0, 15, 19, 0, 0, 0, 0, 0, 0, + 0, 15, 0, 0, 14, 15, 0, 0, 0, 12, 0, 26, 0, 0, + 0, 18, 0, 0, 0, 0, 0, 0, 27, 15, 0, 0, 0, 0, + 10, 0, 21, 15, 0, 0, 0, 15, 25, 0, 3, 10, 0, 0, + 3, 0, 18, 11, 14, 0, 0, 14, 0, 0, 28, 0, 32, 3, + 0, 0, 0, 0, 10, 0, 22, 0, 0, 0, 0, 0, 0, 0, + 0, 28, 0, 0, 9, 0, 15, 0, 0, 24, 0, 26, 0, 0, + 0, 0, 10, 0, 0, 0, 0, 20, 0, 0, 30, 0, 0, 0, + 0, 0, 11, 9, 0, 0, 0, 12, 0, 0, 0, 15, 0, 0, + 0, 0, 9, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, + 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 18, 33, 25, 0, + 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, + 9, 9, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 12, 29, 0, 0, + 0, 11, 0, 26, 0, 16, 0, 0, 0, 0, 0, 0, 0, 11, + 15, 19, 0, 0, 0, 0, 0, 24, 31, 15, 11, 0, 14, 15, + 25, 0, 24, 19, 0, 10, 0, 21, 0, 16, 0, 0, 0, 11, + 0, 0, 34, 0, 0, 9, 0, 0, 25, 0, 0, 0, 0, 0, + 0, 0, 16, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 16, + 0, 0, 30, 0, 11, 0, 0, 22, 0, 7, 14, 0, 0, 0, + 0, 0, 0, 16, 0, 0, 13, 0, 0, 0, 0, 0, 12, 0, + 0, 0, 0, 0, 14, 0, 0, 19, 0, 0, 27, 0, 0, 0, + 24, 0, 0, 0, 0, 8, 10, 29, 0, 0, 0, 14, 10, 0, + 0, 0, 32, 27, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 13, + 0, 0, 0, 0, 11, 0, 31, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 14, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 33, 0, 7, 35, + 0, 0, 0, 0, 28, 0, 0, 0, 22, 17, 4, 0, 0, 0, + 0, 0, 0, 13, 0, 0, 22, 40, 0, 0, 0, 19, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 12, 7, 0, + 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 20, 0, 15, 19, + 0, 0, 0, 9, 34, 13, 0, 0, 0, 0, 8, 0, 0, 0, + 20, 0, 0, 0, 0, 0, 0, 25, 0, 17, 0, 12, 5, 22, + 0, 17, 0, 0, 0, 0, 0, 11, 6, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, + 0, 0, 0, 23, 0, 13, 12, 22, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 14, 18, 0, 21, 0, 0, 0, 0, 10, 11, + 16, 0, 0, 11, 0, 0, 10, 0, 0, 0, 0, 0, 20, 0, + 0, 0, 24, 27, 28, 0, 0, 0, 13, 21, 0, 8, 11, 23, + 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 1, + 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, + 0, 0, 27, 13, 0, 0, 0, 0, 25, 15, 0, 0, 0, 0, + 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 13, 24, 37, 0, + 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 14, 16, 0, 0, 20, 0, + 30, 0, 0, 24, 0, 0, 24, 0, 34, 12, 0, 0, 35, 0, + 0, 0, 0, 13, 11, 0, 14, 0, 20, 0, 21, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 30, 16, 21, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, + 18, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, + 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 14, + 0, 0, 16, 0, 15, 0, 0, 0, 0, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 12, 0, 0, 22, 0, 0, 0, 0, + 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, + 21, 17, 16, 28, 0, 12, 0, 0, 24, 0, 0, 0, 11, 22, + 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 26, 0, + 0, 11, 18, 0, 0, 0, 14, 0, 0, 8, 0, 23, 0, 12, + 14, 0, 0, 0, 13, 0, 0, 0, 13, 0, 0, 15, 15, 0, + 25, 0, 18, 0, 0, 24, 0, 0, 0, 0, 0, 34, 12, 0, + 6, 0, 15, 31, 0, 24, 7, 0, 26, 0, 18, 0, 0, 0, + 0, 0, 0, 0, 0, 18, 0, 0, 0, 11, 0, 23, 0, 31, + 0, 0, 21, 0, 0, 0, 12, 0, 0, 0, 20, 0, 0, 0, + 0, 0, 10, 0, 0, 0, 0, 0, 11, 14, 25, 14, 0, 0, + 24, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 27, 0, + 0, 0, 0, 0, 26, 0, 38, 0, 0, 0, 0, 0, 0, 0, + 0, 23, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, + 30, 0, 0, 20, 0, 3, 15, 10, 0, 0, 0, 15, 14, 0, + 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 13, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 15, 0, 22, 0, 15, 0, 0, 0, 31, 18, 0, 0, 0, + 0, 0, 0, 14, 2, 0, 0, 0, 0, 0, 0, 12, 18, 0, + 0, 0, 0, 19, 0, 0, 23, 14, 0, 18, 0, 0, 0, 16, + 14, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 19, 0, + 0, 0, 30, 0, 29, 33, 0, 25, 0, 0, 0, 0, 0, 21, + 0, 0, 6, 0, 0, 0, 0, 42, 0, 0, 0, 30, 0, 0, + 0, 0, 0, 0, 0, 0, 16, 0, 0, 19, 0, 0, 17, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 13, 15, 0, 0, 0, 0, + 0, 0, 0, 17, 0, 0, 0, 37, 0, 0, 0, 13, 0, 0, + 0, 0, 0, 0, 0, 21, 0, 0, 0, 22, 0, 0, 14, 0, + 0, 14, 0, 0, 0, 0, 0, 32, 0, 2, 0, 13, 0, 33, + 0, 26, 23, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 15, + 0, 24, 0, 0, 20, 0, 0, 20, 0, 0, 0, 0, 6, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, + 0, 0, 0, 0, 4, 0, 2, 12, 0, 0, 14, 0, 25, 15, + 0, 18, 14, 0, 0, 0, 12, 15, 0, 0, 12, 14, 18, 27, + 18, 20, 9, 0, 18, 0, 11, 0, 0, 15, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 31, 0, 0, 0, 29, 18, 0, 0, 0, 0, 14, + 0, 0, 24, 15, 28, 17, 0, 0, 0, 0, 31, 0, 0, 9, + 11, 0, 27, 0, 33, 0, 33, 14, 0, 0, 0, 16, 0, 0, + 0, 0, 31, 42, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, + 0, 0, 0, 3, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 31, 15, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, + 0, 0, 15, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 23, 0, 0, 0, + 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 25, + 0, 0, 0, 0, 14, 22, 0, 0, 0, 0, 9, 0, 0, 19, + 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 30, 0, 0, + 0, 0, 21, 16, 13, 0, 0, 15, 0, 0, 0, 12, 0, 22, + 0, 37, 0, 16, 0, 35, 0, 0, 6, 0, 0, 0, 0, 0, + 0, 0, 31, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, + 13, 0, 14, 0, 0, 0, 13, 12, 0, 0, 0, 0, 9, 22, + 0, 0, 0, 9, 0, 0, 23, 0, 0, 0, 30, 0, 0, 0, + 0, 18, 0, 0, 0, 0, 0, 0, 0, 34, 0, 29, 42, 0, + 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, + 0, 16, 0, 0, 0, 0, 0, 0, 0, 9, 31, 15, 0, 0, + 12, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, + 0, 0, 0, 22, 0, 0, 0, 29, 0, 0, 0, 2, 23, 0, + 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 30, 0, 12, 0, 31, 0, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, + 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 23, 20, 0, + 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 19, 0, 0, 0, 0, 8, 0, 0, 0, 35, + 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 13, 0, + 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 3, + 0, 0, 0, 0, 0, 31, 0, 17, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 40, 0, 0, 26, 15, 21, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 6, 0, 0, 25, 0, 0, 14, 0, 0, 17, 0, 15, 19, + 0, 0, 0, 0, 0, 15, 0, 0, 0, 18, 14, 15, 3, 0, + 0, 0, 3, 0, 0, 0, 0, 0, 4, 0, 25, 0, 0, 6, + 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 14, 11, 11, 0, 11, 0, 15, - 0, 0, 0, 20, 0, 31, 0, 15, 0, 16, 0, 0, 0, 0, - 0, 17, 0, 0, 21, 8, 0, 0, 0, 24, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 13, 0, 14, 0, 9, 0, 14, 0, - 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, - 11, 0, 12, 0, 0, 0, 4, 0, 0, 0, 0, 0, 31, 0, - 0, 20, 0, 0, 0, 0, 35, 13, 0, 23, 7, 0, 0, 0, - 0, 0, 0, 0, 25, 3, 2, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 7, 29, 0, 16, 0, 0, 11, 0, 15, 0, 0, - 0, 18, 27, 0, 0, 0, 2, 0, 0, 15, 35, 21, 0, 0, - 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, - 0, 15, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, - 25, 0, 24, 0, 24, 0, 18, 23, 24, 20, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 15, 11, 0, - 0, 0, 0, 25, 0, 25, 0, 0, 42, 0, 0, 0, 0, 32, - 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 18, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, - 0, 0, 20, 0, 0, 20, 23, 0, 22, 24, 0, 0, 0, 13, - 0, 0, 18, 0, 0, 0, 0, 34, 0, 13, 0, 31, 25, 0, - 34, 0, 20, 0, 0, 0, 0, 0, 14, 0, 0, 37, 0, 0, - 0, 0, 0, 0, 0, 0, 24, 0, 0, 26, 0, 23, 29, 0, - 0, 0, 0, 22, 0, 23, 0, 0, 0, 0, 26, 0, 0, 8, - 0, 0, 0, 0, 0, 0, 23, 2, 0, 0, 0, 0, 16, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 22, 0, 26, 12, 21, 0, 31, 0, 0, 27, 0, 0, 0, 24, - 0, 0, 0, 0, 25, 0, 0, 14, 0, 0, 22, 0, 0, 0, - 0, 0, 12, 10, 18, 0, 17, 21, 0, 0, 0, 0, 12, 9, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 18, - 0, 23, 0, 14, 0, 0, 0, 17, 17, 15, 0, 31, 27, 0, - 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 28, 36, - 0, 22, 10, 20, 20, 0, 0, 0, 17, 0, 0, 0, 23, 0, - 0, 22, 0, 0, 0, 0, 0, 8, 22, 29, 0, 0, 0, 0, - 10, 10, 10, 18, 0, 0, 0, 0, 14, 22, 29, 0, 0, 0, - 21, 0, 0, 0, 0, 18, 11, 10, 0, 0, 31, 0, 0, 0, - 30, 0, 0, 0, 0, 0, 0, 17, 0, 19, 0, 0, 44, 17, - 9, 9, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 39, 40, 0, 0, 0, 0, 0, 0, 0, 0, - 14, 0, 0, 21, 11, 0, 12, 0, 28, 0, 24, 0, 24, 12, - 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 13, 15, 23, - 0, 0, 26, 0, 0, 0, 22, 0, 0, 38, 0, 13, 22, 0, - 0, 0, 14, 18, 0, 0, 0, 0, 0, 0, 15, 0, 0, 25, - 0, 0, 0, 0, 10, 0, 18, 14, 0, 0, 16, 20, 19, 15, - 0, 21, 0, 0, 0, 0, 18, 0, 0, 15, 0, 0, 10, 0, - 31, 0, 34, 0, 0, 0, 0, 0, 28, 0, 0, 0, 13, 31, - 37, 13, 0, 0, 0, 0, 0, 0, 12, 13, 0, 0, 0, 19, - 21, 0, 0, 0, 0, 0, 0, 14, 3, 3, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 12, 0, 0, 0, - 0, 0, 0, 0, 0, 12, 0, 10, 15, 0, 0, 35, 0, 0, - 17, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 24, 0, 0, 0, 29, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 30, 0, 0, 20, 26, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 50, 23, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 10, 0, 10, 0, 18, 22, 0, - 25, 0, 12, 0, 23, 0, 0, 0, 0, 0, 11, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 19, 32, 0, 32, 0, 10, 0, 0, 0, 0, 14, 17, 0, 0, - 7, 0, 20, 0, 0, 24, 18, 0, 11, 8, 0, 19, 0, 0, - 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 29, 32, - 0, 0, 0, 30, 0, 0, 9, 15, 0, 16, 0, 0, 30, 0, - 0, 0, 0, 0, 19, 2, 0, 14, 0, 0, 0, 16, 40, 0, - 18, 0, 0, 28, 0, 20, 0, 0, 0, 10, 8, 10, 23, 0, - 25, 0, 0, 0, 0, 7, 2, 16, 0, 0, 2, 0, 0, 27, - 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, - 0, 0, 30, 17, 0, 0, 0, 0, 16, 0, 24, 27, 0, 16, - 11, 14, 0, 3, 0, 0, 0, 0, 0, 28, 0, 0, 0, 26, - 0, 0, 0, 34, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 10, 0, 30, 0, 0, 0, 0, 16, 0, 0, 30, 14, 0, 0, - 0, 24, 0, 0, 23, 0, 0, 0, 0, 16, 0, 0, 23, 0, - 0, 0, 14, 26, 0, 18, 7, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 26, 0, 0, 10, - 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, - 0, 0, 25, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 10, 0, - 0, 11, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 17, 0, 34, 0, 0, 0, 0, 0, 0, 0, 9, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, - 0, 0, 18, 28, 0, 0, 0, 22, 0, 0, 18, 0, 0, 0, - 0, 15, 0, 0, 0, 25, 0, 0, 0, 0, 0, 11, 0, 11, - 20, 0, 0, 18, 0, 0, 0, 0, 0, 0, 35, 0, 0, 32, - 11, 27, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 25, - 0, 0, 0, 0, 0, 9, 0, 11, 0, 0, 13, 15, 0, 0, - 0, 0, 0, 29, 0, 0, 22, 24, 0, 11, 0, 15, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, - 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 29, 17, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, - 24, 18, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 15, - 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, - 0, 38, 15, 0, 0, 0, 0, 0, 0, 11, 0, 0, 5, 0, - 12, 0, 0, 23, 0, 0, 0, 0, 0, 0, 31, 0, 0, 22, - 0, 24, 0, 0, 0, 21, 42, 29, 23, 12, 0, 15, 0, 0, - 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 10, 0, - 23, 0, 0, 0, 0, 0, 0, 16, 20, 0, 16, 0, 0, 0, + 0, 31, 0, 0, 0, 0, 0, 2, 17, 0, 0, 7, 0, 0, + 26, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 19, 0, + 0, 0, 12, 15, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, + 0, 15, 0, 0, 20, 32, 0, 9, 0, 2, 0, 0, 0, 0, + 0, 0, 0, 30, 0, 25, 7, 0, 0, 0, 20, 0, 0, 0, + 0, 32, 0, 0, 32, 28, 0, 0, 2, 0, 0, 0, 2, 0, + 0, 0, 19, 0, 0, 15, 37, 18, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 20, 0, 28, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 15, 22, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 34, 0, 0, 35, 0, 19, 0, 0, 16, 0, + 0, 0, 25, 0, 13, 6, 0, 0, 0, 14, 0, 13, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 10, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, + 0, 0, 15, 0, 0, 0, 12, 0, 15, 19, 18, 0, 0, 0, + 0, 0, 34, 22, 20, 0, 14, 0, 3, 0, 0, 0, 0, 13, + 0, 0, 0, 0, 4, 0, 0, 0, 0, 6, 0, 3, 28, 6, + 0, 0, 0, 0, 0, 0, 0, 4, 15, 0, 0, 0, 0, 0, + 0, 17, 0, 23, 0, 0, 3, 0, 0, 27, 0, 0, 0, 15, + 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 8, + 15, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 7, 0, 16, 0, 16, 0, 0, 0, 0, 0, 0, + 35, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 15, 0, + 15, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, + 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, + 0, 0, 28, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, + 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 25, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 34, 0, 0, + 12, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 23, + 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 21, 0, + 0, 0, 0, 27, 0, 0, 30, 0, 0, 0, 26, 0, 0, 0, + 0, 0, 35, 15, 0, 0, 0, 0, 0, 0, 32, 0, 14, 0, + 0, 0, 0, 0, 0, 0, 14, 0, 0, 10, 0, 31, 0, 0, + 0, 0, 0, 0, 0, 0, 39, 36, 0, 0, 29, 0, 0, 32, + 0, 0, 0, 16, 0, 0, 31, 28, 30, 0, 13, 0, 0, 0, + 12, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 9, 0, 0, 25, 0, 0, 0, 26, 0, + 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, + 0, 0, 10, 0, 0, 0, 0, 0, 18, 0, 0, 0, 24, 0, + 0, 0, 0, 0, 0, 16, 0, 0, 0, 16, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, + 11, 0, 0, 0, 16, 0, 0, 0, 15, 0, 31, 0, 26, 0, + 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 28, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 35, 0, 0, 18, 0, 0, 0, 0, 0, 19, 0, + 0, 0, 20, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 26, + 13, 12, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 35, 0, + 0, 28, 0, 0, 18, 22, 0, 0, 0, 17, 0, 0, 0, 0, + 24, 0, 0, 21, 0, 16, 16, 0, 24, 8, 0, 0, 0, 9, + 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 20, 15, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 16, 0, 15, 0, 11, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 15, 0, 0, 0, + 32, 0, 19, 0, 0, 13, 0, 25, 0, 0, 0, 11, 0, 0, + 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, + 21, 0, 0, 0, 0, 0, 0, 43, 18, 22, 0, 9, 13, 0, + 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 37, 0, 24, 17, 0, 0, 0, 0, 0, 22, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 28, 0, 28, 0, 0, 0, 0, 0, 0, 24, 0, 27, 0, + 0, 0, 0, 0, 0, 0, 0, 24, 13, 0, 0, 0, 0, 0, + 22, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, + 0, 8, 0, 0, 0, 0, 0, 0, 0, 43, 0, 15, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 19, 30, 0, 0, + 19, 0, 0, 0, 0, 0, 12, 0, 0, 12, 23, 0, 0, 10, + 0, 23, 0, 15, 0, 42, 0, 0, 0, 0, 0, 0, 0, 34, + 0, 0, 0, 23, 15, 0, 0, 0, 22, 9, 0, 23, 0, 0, + 30, 7, 0, 0, 0, 38, 0, 0, 0, 18, 0, 0, 0, 15, + 0, 2, 22, 8, 12, 23, 0, 0, 0, 0, 0, 24, 0, 0, + 0, 0, 0, 72, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 8, 0, 14, 0, 0, 0, 14, 0, 16, 0, 32, 0, + 0, 2, 27, 0, 0, 0, 0, 38, 0, 11, 20, 0, 19, 0, + 12, 26, 0, 0, 0, 0, 0, 0, 0, 0, 29, 12, 0, 0, + 0, 15, 0, 24, 0, 0, 29, 17, 0, 0, 0, 0, 0, 0, + 0, 14, 11, 0, 0, 0, 0, 0, 0, 0, 0, 31, 25, 0, + 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 30, 0, + 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, + 0, 0, 14, 0, 3, 0, 16, 18, 0, 0, 0, 18, 0, 0, + 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 24, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 6, 0, 0, 0, 9, 11, 0, 0, 12, 0, 0, 0, 0, - 0, 0, 0, 0, 21, 0, 25, 0, 30, 0, 0, 0, 31, 15, - 0, 0, 0, 0, 35, 15, 0, 28, 0, 0, 0, 0, 0, 0, - 0, 12, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 20, 0, 24, 0, 0, 25, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, - 0, 0, 17, 0, 0, 11, 73, 74, 0, 0, 0, 0, 0, 0, - 0, 0, 9, 0, 0, 24, 0, 0, 0, 14, 0, 0, 0, 16, - 30, 0, 30, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, - 19, 0, 20, 0, 20, 0, 28, 0, 0, 19, 0, 0, 0, 0, - 0, 20, 0, 0, 0, 26, 39, 37, 0, 0, 0, 0, 0, 0, - 0, 33, 13, 0, 0, 0, 0, 18, 0, 32, 0, 0, 0, 0, - 28, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 30, 0, 29, 29, 0, 0, 0, - 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 15, 0, 0, 0, - 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, - 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, - 34, 2, 23, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 18, - 0, 0, 18, 0, 0, 0, 0, 13, 26, 0, 22, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 23, - 0, 0, 13, 0, 26, 0, 0, 0, 12, 13, 0, 0, 0, 0, - 0, 0, 0, 13, 0, 16, 0, 0, 21, 26, 10, 0, 0, 0, - 0, 12, 25, 0, 17, 0, 35, 27, 0, 0, 0, 0, 0, 0, - 0, 3, 0, 0, 13, 12, 0, 0, 0, 0, 17, 0, 0, 15, - 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 25, - 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 8, 0, 0, 0, - 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 8, - 0, 0, 0, 0, 0, 4, 0, 0, 0, 19, 0, 0, 0, 0, - 0, 6, 0, 3, 0, 0, 28, 0, 0, 0, 8, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, - 17, 0, 0, 0, 0, 0, 0, 13, 0, 30, 0, 0, 0, 27, - 29, 4, 0, 0, 0, 0, 6, 0, 0, 0, 0, 33, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 12, 0, 0, 0, 9, 0, 0, 0, 0, 0, 24, 0, 11, 13, - 23, 0, 28, 0, 0, 22, 0, 0, 0, 9, 29, 0, 32, 0, - 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 32, 6, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, - 0, 0, 0, 18, 0, 33, 0, 0, 0, 0, 13, 0, 0, 15, - 0, 0, 42, 0, 0, 2, 0, 17, 0, 0, 0, 0, 0, 0, - 34, 0, 0, 9, 0, 0, 0, 0, 26, 19, 0, 0, 0, 26, - 34, 19, 0, 34, 11, 16, 0, 33, 0, 0, 0, 0, 0, 15, - 0, 31, 0, 0, 0, 0, 0, 0, 0, 15, 16, 0, 0, 0, - 25, 0, 3, 0, 11, 0, 0, 20, 0, 0, 11, 0, 4, 0, - 0, 0, 0, 6, 11, 3, 0, 0, 0, 0, 0, 19, 0, 25, - 24, 4, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, - 23, 0, 0, 0, 30, 0, 16, 0, 31, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 13, 0, 0, 26, 3, 0, 0, 0, 0, - 15, 0, 13, 0, 0, 0, 15, 15, 0, 29, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 28, 0, 25, 0, - 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, - 0, 14, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 18, - 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, - 30, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, - 11, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 11, - 0, 0, 0, 0, 0, 7, 31, 0, 0, 0, 24, 0, 0, 18, - 0, 0, 0, 0, 0, 34, 0, 0, 0, 27, 15, 31, 27, 0, + 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 35, 0, 0, 0, 0, 0, 0, 24, 13, 0, 0, 0, + 0, 0, 25, 0, 0, 0, 0, 15, 21, 0, 37, 0, 0, 0, + 0, 14, 33, 0, 17, 14, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 15, 0, 0, 16, 34, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 29, 0, 0, + 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 29, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, + 0, 0, 23, 0, 12, 0, 0, 0, 0, 0, 0, 0, 23, 0, + 0, 0, 18, 0, 0, 0, 25, 26, 0, 14, 0, 73, 74, 0, + 0, 0, 0, 0, 14, 0, 16, 0, 0, 0, 0, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, + 0, 32, 0, 0, 22, 0, 0, 18, 0, 0, 24, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 19, 0, 0, 0, + 0, 0, 14, 0, 0, 16, 0, 25, 0, 0, 30, 24, 0, 0, + 0, 0, 0, 0, 13, 0, 18, 0, 0, 31, 25, 0, 14, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 25, 0, + 28, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 32, 14, 28, 0, + 0, 0, 0, 15, 0, 0, 0, 6, 19, 23, 23, 0, 0, 33, + 0, 0, 0, 26, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 17, 0, 14, 0, 0, 17, 0, 0, 0, + 31, 30, 0, 0, 17, 0, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 26, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 12, 27, 0, 0, 38, 0, 13, + 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 19, 18, + 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, + 0, 0, 0, 0, 0, 27, 0, 18, 22, 0, 14, 5, 0, 0, + 0, 0, 0, 17, 0, 34, 13, 0, 16, 0, 0, 0, 13, 0, + 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 15, + 11, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 36, 0, 16, 0, 0, 0, 0, 11, 25, 0, 0, 27, 0, 0, + 27, 33, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 25, 27, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 16, 0, 0, 0, 16, 15, 0, 0, 0, 0, 0, 23, 0, + 13, 0, 44, 0, 0, 18, 22, 0, 0, 0, 0, 0, 0, 15, + 0, 0, 0, 0, 16, 0, 15, 0, 18, 0, 10, 20, 0, 0, + 0, 0, 0, 0, 36, 22, 0, 0, 0, 0, 0, 0, 0, 28, + 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, + 24, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 17, 43, 0, 0, 0, 0, 0, + 23, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 19, 18, 0, 22, 36, 0, 0, 0, + 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 21, 0, 0, + 0, 30, 0, 0, 18, 0, 0, 0, 0, 0, 0, 17, 0, 0, + 0, 14, 0, 0, 25, 0, 30, 0, 0, 0, 0, 0, 11, 0, + 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, + 18, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, + 0, 25, 22, 0, 0, 0, 0, 0, 17, 16, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 28, 0, 18, 0, 0, 0, 15, 0, + 0, 0, 0, 0, 0, 0, 25, 4, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 5, + 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 8, 0, 0, 8, 0, 23, 16, 14, 0, 0, 0, 31, 0, 29, - 28, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, - 0, 0, 0, 15, 0, 0, 12, 0, 0, 0, 0, 22, 0, 0, - 16, 0, 18, 43, 0, 0, 0, 22, 0, 0, 0, 0, 0, 12, - 16, 0, 13, 0, 0, 0, 24, 1, 0, 26, 28, 0, 25, 0, - 0, 0, 0, 0, 2, 13, 0, 0, 0, 0, 24, 0, 13, 0, - 14, 0, 0, 0, 0, 8, 0, 0, 0, 16, 0, 0, 33, 0, - 0, 0, 23, 0, 0, 0, 0, 3, 0, 31, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 19, 0, 22, 21, 14, 0, 34, 0, 0, - 0, 0, 6, 0, 0, 0, 0, 31, 18, 0, 0, 0, 0, 2, - 0, 0, 0, 0, 29, 15, 0, 28, 0, 0, 0, 0, 21, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 11, - 6, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 12, 0, 14, - 13, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 14, 14, 0, - 0, 0, 14, 0, 0, 0, 0, 30, 0, 0, 0, 8, 2, 0, - 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 19, 0, 6, 0, - 0, 30, 0, 0, 27, 11, 22, 14, 0, 21, 0, 0, 11, 0, - 0, 0, 0, 13, 0, 0, 14, 22, 0, 0, 0, 0, 0, 22, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 35, - 0, 9, 0, 0, 0, 0, 4, 0, 0, 28, 0, 0, 15, 0, - 0, 14, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 27, 0, - 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 25, - 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, - 15, 0, 15, 0, 0, 0, 0, 0, 14, 9, 0, 37, 0, 0, - 0, 17, 0, 0, 28, 0, 0, 8, 0, 0, 0, 0, 13, 0, - 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 13, 0, 0, 0, 0, 43, 0, 3, 0, 0, 0, 0, 0, - 0, 27, 0, 0, 4, 0, 0, 19, 0, 6, 0, 3, 0, 0, - 0, 0, 19, 2, 0, 0, 0, 4, 0, 0, 27, 15, 0, 0, - 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, - 0, 7, 0, 0, 0, 0, 0, 28, 10, 0, 0, 0, 0, 0, - 0, 12, 0, 0, 0, 0, 15, 0, 36, 35, 0, 0, 0, 0, - 12, 0, 0, 0, 0, 0, 0, 15, 12, 0, 0, 0, 0, 11, - 0, 0, 0, 0, 0, 28, 0, 28, 22, 0, 0, 0, 0, 23, - 11, 0, 0, 0, 0, 21, 16, 17, 0, 0, 0, 0, 0, 19, - 15, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, 21, 0, - 0, 0, 10, 7, 0, 0, 23, 0, 19, 0, 0, 0, 0, 0, - 0, 0, 0, 8, 34, 0, 22, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 6, 0, - 0, 0, 0, 26, 0, 0, 0, 0, 16, 0, 0, 22, 0, 0, - 6, 0, 0, 11, 17, 0, 0, 0, 0, 0, 17, 12, 0, 0, - 0, 0, 0, 13, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, - 18, 0, 6, 0, 0, 0, 15, 14, 0, 0, 33, 16, 33, 13, - 11, 0, 0, 0, 0, 14, 0, 0, 0, 0, 29, 21, 10, 12, - 14, 15, 12, 38, 0, 0, 20, 0, 0, 0, 18, 0, 0, 15, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, - 0, 21, 0, 0, 0, 0, 0, 0, 16, 0, 0, 13, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, - 0, 0, 20, 0, 14, 0, 0, 0, 0, 32, 32, 24, 0, 0, - 15, 37, 0, 14, 15, 0, 0, 0, 0, 0, 0, 18, 0, 18, - 37, 19, 0, 0, 0, 0, 11, 0, 0, 0, 15, 38, 0, 0, - 18, 0, 0, 15, 14, 27, 32, 0, 0, 32, 0, 0, 0, 0, - 0, 0, 0, 23, 17, 15, 0, 0, 15, 0, 0, 0, 29, 0, - 31, 28, 21, 0, 16, 0, 0, 0, 0, 0, 0, 0, 19, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 15, 18, 24, 0, 0, 0, - 14, 0, 0, 0, 10, 0, 0, 0, 14, 0, 14, 0, 22, 0, - 0, 7, 0, 0, 2, 0, 28, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, - 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, - 0, 3, 0, 0, 25, 24, 0, 0, 0, 14, 0, 0, 0, 15, - 0, 0, 0, 24, 0, 0, 15, 0, 17, 0, 0, 0, 0, 0, - 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, - 36, 0, 43, 0, 0, 0, 6, 0, 0, 16, 0, 0, 0, 0, - 0, 0, 0, 0, 8, 0, 24, 0, 0, 0, 0, 14, 0, 0, - 24, 0, 0, 0, 22, 0, 0, 0, 0, 0, 22, 0, 0, 25, + 0, 0, 0, 4, 0, 0, 0, 0, 17, 0, 17, 0, 0, 0, + 0, 12, 0, 30, 24, 0, 0, 16, 13, 21, 0, 0, 17, 0, + 0, 18, 0, 0, 7, 0, 0, 8, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, + 6, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 4, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 8, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 7, 18, 31, 0, 24, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, - 0, 28, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 30, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, - 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 18, 0, 0, 14, 0, 0, 0, 0, 2, 18, 0, 0, 0, - 0, 0, 15, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, - 31, 0, 15, 0, 0, 0, 0, 0, 0, 0, 15, 27, 0, 14, - 0, 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, - 0, 8, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 15, 0, 17, 19, 0, 22, 0, 0, 0, 0, 0, - 18, 22, 20, 0, 0, 16, 0, 0, 0, 0, 29, 0, 18, 0, - 30, 0, 0, 0, 22, 19, 14, 0, 0, 0, 24, 0, 0, 0, - 24, 0, 28, 27, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, - 19, 0, 0, 0, 0, 23, 0, 0, 30, 14, 0, 37, 34, 0, - 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 19, 0, 0, 0, 0, 0, 0, 0, 27, 18, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 29, 15, 18, 0, 0, 0, - 0, 29, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, - 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 6, 21, 0, 0, 24, 30, 0, 31, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 29, - 0, 0, 0, 25, 0, 43, 22, 0, 15, 15, 0, 19, 18, 0, - 0, 0, 0, 0, 0, 17, 29, 0, 0, 0, 17, 0, 0, 0, - 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, - 15, 0, 0, 0, 0, 14, 0, 24, 0, 0, 0, 0, 0, 23, - 0, 28, 0, 0, 35, 0, 0, 0, 0, 0, 7, 0, 0, 0, - 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 32, 0, 0, 0, 16, 0, 0, 19, 0, 0, 0, 0, 0, 0, - 0, 0, 28, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, - 30, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, - 0, 14, 36, 3, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 18, 15, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, - 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, - 0, 0, 0, 0, 24, 0, 0, 0, 34, 0, 0, 0, 0, 0, - 0, 0, 0, 7, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, - 11, 0, 29, 5, 12, 23, 0, 0, 23, 0, 25, 0, 0, 26, - 26, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, - 0, 0, 0, 35, 19, 0, 0, 0, 0, 0, 8, 0, 0, 0, - 0, 0, 0, 14, 17, 0, 0, 0, 13, 0, 0, 0, 0, 0, - 0, 9, 0, 0, 14, 25, 0, 0, 0, 0, 0, 0, 0, 0, - 28, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 30, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 22, 18, 0, 0, - 0, 0, 0, 0, 23, 0, 0, 0, 11, 0, 11, 0, 0, 0, - 0, 18, 0, 0, 0, 14, 0, 0, 14, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 11, 18, 0, 0, 0, 36, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, - 0, 31, 0, 0, 0, 35, 0, 0, 0, 0, 19, 0, 0, 0, - 0, 0, 0, 0, 32, 0, 0, 10, 0, 21, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 9, 29, 0, 0, 0, 0, 0, - 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 20, 14, 0, 19, 0, 0, 0, 0, 0, 0, 16, - 27, 12, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 18, - 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 21, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 2, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, - 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, - 0, 3, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 10, - 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, - 0, 14, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, - 0, 0, 0, 21, 0, 15, 0, 18, 0, 20, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 31, + 0, 0, 0, 0, 11, 0, 23, 0, 11, 0, 0, 0, 23, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 35, 0, 0, + 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 29, 0, 20, 0, 0, 8, 28, + 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 10, 0, 7, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, + 0, 0, 0, 18, 0, 0, 0, 25, 0, 0, 13, 0, 0, 33, + 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 14, 18, 0, 22, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 24, 22, 0, 0, 0, 0, 0, 11, 0, 29, 0, 6, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 24, 0, 10, 0, + 34, 0, 0, 0, 24, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 32, 0, 0, 0, - 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 31, 41, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 11, + 0, 0, 0, 19, 0, 0, 16, 3, 0, 0, 0, 0, 22, 0, + 0, 0, 0, 0, 0, 0, 2, 22, 27, 0, 0, 0, 0, 19, + 0, 0, 27, 0, 25, 0, 0, 0, 27, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, + 20, 15, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 36, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 32, 0, 9, 24, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 25, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, + 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, + 0, 0, 15, 16, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, + 29, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, + 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 17, 0, 0, 0, + 0, 0, 0, 3, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 11, 22, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 15, 0, 0, + 0, 0, 0, 0, 30, 0, 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, + 0, 15, 0, 21, 14, 37, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 15, 17, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 17, 31, 0, 0, 0, 0, 43, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, + 10, 23, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, + 23, 22, 30, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 13, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 29, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 21, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 23, 0, 0, + 0, 0, 0, 0, 0, 22, 15, 0, 23, 0, 0, 0, 0, 0, + 0, 0, 0, 6, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 31, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 72, 16, 0, 0, 0, 0, 29, 0, 0, 35, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, + 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 25, 0, 0, 18, 16, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 26, 0, 17, 0, + 25, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, + 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, - 0, 26, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 30, 0, 0, 0, 0, 30, 0, 34, 0, 0, 0, 0, - 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, - 0, 0, 0, 0, 31, 0, 13, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 2, 0, 0, 0, 11, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 16, 10, 0, - 0, 0, 0, 0, 16, 15, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, - 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 19, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 39, 0, 15, 0, 0, 0, 0, - 20, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 14, - 0, 0, 0, 17, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 28, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 24, 0, - 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 17, 0, 0, - 0, 0, 0, 25, 0, 9, 0, 21, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 14, - 27, 15, 6, 22, 0, 0, 33, 0, 0, 0, 37, 0, 0, 0, - 0, 0, 14, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 28, 7, 24, 0, 0, 0, 22, 0, 0, 0, - 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, - 17, 25, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, - 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 25, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 37, - 0, 0, 0, 0, 0, 0, 13, 0, 20, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 16, 0, 0, 24, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 26, 20, 25, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 11, 0, 0, 27, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 36, 0, 0, 0, 35, 14, 0, 0, 7, 0, 0, - 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 16, 0, - 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 24, 0, 0, 0, 0, 0, 0, 33, 24, 0, 0, 0, 13, 0, + 0, 39, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 32, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 26, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, + 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, + 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, - 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, + 0, 29, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, - 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, + 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, + 0, 0, 30, 0, 16, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, + 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 28, 0, 0, 0, 0, 4, 9, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 17, - 0, 0, 0, 0, 0, 25, 27, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, - 25, 0, 0, 0, 0, 0, 33, 0, 33, 0, 0, 0, 37, 0, - 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, - 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, - 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, - 0, 10, 0, 0, 0, 25, 0, 0, 0, 0, 0, 9, 0, 0, + 0, 0, 10, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 13, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, + 0, 0, 0, 0, 0, 11, 0, 0, 0, 17, 0, 9, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, - 0, 29, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, - 0, 0, 0, 15, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, - 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 24, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 17, 0, 28, - 0, 38, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 16, 0, 0, 0, 0, 0, 17, 0, 17, 0, 0, - 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, - 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 14, 0, 0, 0, 33, 0, 0, 0, 37, 0, 0, 37, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 20, - 17, 0, 0, 0, 0, 31, 0, 0, 25, 0, 0, 0, 0, 0, - 0, 0, 0, 15, 0, 0, 0, 0, 0, 20, 0, 15, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, - 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, - 0, 0, 0, 4, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, - 0, 0, 0, 0, 11, 0, 0, 0, 0, 24, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 25, 0, 22, 0, 0, 0, 16, - 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, - 0, 0, 28, 0, 0, 0, 0, 15, 0, 0, 29, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 15, + 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 35, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 27, 0, 24, 0, 0, 0, 0, 0, 0, 21, 0, 22, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, + 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, + 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, + 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, - 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 25, 0, 0, - 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, + 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 17, 0, 0, 0, + 0, 0, 0, 27, 0, 0, 27, 25, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 33, 31, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, - 0, 10, 0, 0, 0, 0, 2, 0, 0, 0, 17, 0, 6, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, - 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 16, 0, + 0, 13, 0, 0, 0, 9, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 17, - 0, 2, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, - 0, 15, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, + 0, 28, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 14, 22, 0, 24, 0, 21, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 24, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, - 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 36, 15, 0, 0, 0, 0, - 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, - 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 16, 0, 24, 13, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, - 27, 0, 0, 0, 0, 0, 14, 6, 0, 0, 17, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 25, 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, + 43, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 17, 0, 0, + 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, + 0, 8, 0, 0, 0, 16, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 22, 14, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, + 0, 25, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, + 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 30, 0, 0, 0, 0, 9, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 21, 16, 17, 0, 0, 0, 0, + 35, 0, 0, 17, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, + 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, + 0, 25, 0, 0, 26, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 11, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 15, - 0, 0, 0, 0, 0, 0, 0, 9, 0, 17, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, - 28, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 33, 0, - 0, 7, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 22, 27, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 28, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 10, - 0, 0, 0, 0, 20, 0, 0, 0, 0, 17, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 22, 0, 22, 0, 0, 0, 0, - 0, 17, 0, 26, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 23, 0, 20, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 11, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, + 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, - 0, 0, 15, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, - 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 18, 0, 0, 0, 0, 0, 0, 25, 15, 0, 0, 0, + 18, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, + 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 24, 0, + 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 17, 0, 0, 18, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, + 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, - 33, 0, 0, 28, 0, 13, 0, 35, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 7, 21, 0, 16, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, - 0, 28, 0, 0, 0, 17, 0, 0, 0, 0, 0, 36, 0, 0, - 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 28, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, + 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, - 0, 0, 0, 0, 0, 0, 0, 0, 22, 18, 0, 0, 0, 28, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, - 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 16, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, - 0, 0, 28, 0, 0, 13, 0, 0, 0, 0, 10, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, + 0, 0, 6, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 13, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, + 0, 0, 28, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 26, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 29, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 22, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 17, 28, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 7, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, - 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, + 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 38, 0, 16, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 19, - 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 22, 31, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, + 0, 0, 19, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 26, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, + 0, 28, 0, 24, 0, 0, 0, 0, 28, 24, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 27, 0, 0, + 0, 0, 0, 0, 0, 9, 0, 36, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, + 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 7, 36, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 28, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, - 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, - 0, 0, 0, 22, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, - 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 17, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, + 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, + 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 6, 26, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 17, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, + 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, - 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 17, 0, 17, + 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 13, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, - 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 24, - 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 17, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, + 0, 0, 0, 0, 0, 0, 24, 0, 28, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, + 0, 0, 0, 0, 0, 0, 38, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, + 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 17, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 17, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 14, 14, 0, 0, 0, 0, 0, 0, 14, 0, 0, 32, 0, 0, + 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 15, + 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 14, 14, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 31, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, + 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, + 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 15, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, + 0, 0, 22, 31, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 28, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 17, 16, 0, + 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, + 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, + 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1006,214 +1047,230 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 17, 16, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 35, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 17, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, + 0, 0, 0, 0, 15, 0, 0, 0, 4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 3, 0, 0, 0, 0, 15, 0, 0, 14, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 17, 0, 0, 30, + 0, 0, 0, 0, 0, 0, 14, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 15, 0, 0, 4, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 4, - 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, + 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, - 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 7, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 6, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, + 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, - 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 14, 0, 0, - 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, - 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 25, 0, 0, 0, 0, 28, 0, 0, 0, 0, + 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, + 0, 0, 14, 0, 25, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 21, 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, + 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 15, 0, 4, 0, 0, 0, 0, 0, 0, 0, + 0, 15, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, + 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, - 0, 34, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1223,10 +1280,11 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1237,44 +1295,41 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 6, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 15, 0, + 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1282,32 +1337,35 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 16, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1323,54 +1381,59 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 15, 0, 0, 20, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, + 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, - 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, + 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1378,12 +1441,13 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1391,6 +1455,7 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1402,7 +1467,8 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1421,7 +1487,6 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1437,6 +1502,7 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1446,6 +1512,7 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1463,9 +1530,9 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1530,6 +1597,7 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1545,13 +1613,10 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1563,7 +1628,6 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1586,8 +1650,8 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1600,7 +1664,9 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1614,16 +1680,18 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1652,7 +1720,6 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1679,16 +1746,18 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1745,6 +1814,7 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1835,9 +1905,9 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1845,6 +1915,7 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1867,6 +1938,7 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1881,7 +1953,9 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -2001,6 +2075,47 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -2096,7 +2211,6 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -2155,6 +2269,7 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -2338,3885 +2453,4188 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 31 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 31 }; static const struct grib_keys_hash wordlist[] = { {""}, {""}, {""}, {""}, {""}, - {"n",1302}, + {"n",1303}, {""}, - {"t",2100}, - {"nd",1311}, - {"td",2110}, - {"nt",1329}, - {"nnn",1315}, - {"na",1305}, + {"t",2101}, + {"nd",1312}, + {"td",2111}, + {"nt",1330}, + {"nnn",1316}, + {"na",1306}, {"ed",710}, {""}, - {"sd",1898}, + {"sd",1899}, {""}, - {"m",1183}, - {""}, {""}, {""}, + {"m",1184}, + {""}, {""}, + {"Di",31}, {"data",615}, - {"min",1265}, + {"min",1266}, {""}, {""}, {""}, {""}, {"date",633}, {""}, {"ident",944}, {""}, {""}, - {"name",1306}, + {"name",1307}, {""}, {""}, {""}, - {"time",2136}, + {"time",2137}, {""}, {""}, {""}, - {"one",1497}, - {""}, {""}, - {"mars",1186}, - {"names",1310}, - {""}, {""}, - {"metadata",1261}, + {"one",1498}, + {"Dstart",39}, + {""}, + {"mars",1187}, + {"names",1311}, {""}, - {"sort",2022}, + {"dataDate",618}, + {"metadata",1262}, + {""}, + {"sort",2023}, {""}, {"eps",758}, {"domain",693}, {""}, - {"stream",2073}, + {"stream",2074}, {""}, {""}, {""}, {"edition",711}, {"cat",379}, {"enorm",753}, - {"param",1606}, + {"param",1607}, {""}, {""}, - {"spare",2039}, - {""}, {""}, {""}, {""}, - {"step",2063}, - {"present",1655}, + {"spare",2040}, + {""}, + {"marsDir",1191}, {""}, {""}, - {"oper",1509}, + {"step",2064}, + {"present",1656}, + {""}, {""}, + {"oper",1510}, {"iteration",1015}, {""}, {"dimension",676}, - {""}, {""}, {""}, - {"points",1645}, + {""}, + {"masterDir",1220}, + {""}, + {"points",1646}, {""}, {"assertion",312}, {""}, {""}, {""}, - {"opttime",1516}, + {"opttime",1517}, {"centre",397}, - {""}, + {"marsDomain",1192}, {"const",564}, {""}, {""}, - {"parameter",1611}, - {"true",2169}, + {"parameter",1612}, + {"true",2170}, {"core",590}, - {"second",1899}, - {""}, {""}, - {"units",2229}, + {"second",1900}, {""}, {""}, - {"rectime",1738}, - {"parameters",1619}, - {"minute",1267}, - {"section",1921}, - {"band",324}, - {"status",2062}, - {"partitions",1624}, - {"timerepres",2149}, - {"radius",1713}, + {"units",2230}, {""}, {""}, - {"year",2352}, - {"dataTime",630}, + {"rectime",1739}, + {"parameters",1620}, + {"minute",1268}, + {"section",1922}, {""}, + {"status",2063}, + {"partitions",1625}, + {"timerepres",2150}, + {"radius",1714}, + {""}, + {"isSens",999}, + {"year",2353}, + {""}, + {"dataTime",630}, {"direction",679}, - {"dateTime",642}, {""}, - {"minimum",1266}, - {"statistics",2061}, - {"radials",1712}, + {"dateTime",642}, + {"minimum",1267}, + {"statistics",2062}, + {"radials",1713}, {""}, {"leadtime",1076}, - {"type",2180}, - {""}, {""}, - {"instrument",971}, - {"grid",895}, + {"type",2181}, + {"dataStream",628}, {"hdate",917}, - {"system",2098}, - {"ucs",2222}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"range",1718}, - {"three",2123}, + {"instrument",971}, + {"notDecoded",1329}, {""}, - {"process",1685}, - {"rdbtime",1724}, - {"precision",1651}, - {"count",604}, - {""}, {""}, {""}, {""}, {""}, - {"method",1262}, + {"system",2099}, + {"ucs",2223}, + {""}, {""}, + {"stepZero",2073}, {""}, + {"three",2124}, + {"endStep",745}, + {""}, {""}, {""}, + {"process",1686}, + {"marsStream",1212}, + {"precision",1652}, + {"count",604}, + {""}, {""}, + {"method",1263}, + {""}, {""}, {""}, {""}, {"class",419}, + {"phase",1639}, {""}, - {"stepZero",2072}, - {"uco",2221}, - {"phase",1638}, - {""}, - {"origin",1521}, - {"dx",699}, - {""}, {""}, {""}, + {"uco",2222}, + {"startStep",2056}, + {"marsStep",1211}, + {""}, {""}, {""}, {""}, {""}, {"dy",700}, - {"pl",1642}, - {""}, - {"bitmap",362}, - {""}, + {"pl",1643}, + {"Dy",43}, + {""}, {""}, {"day",644}, {""}, - {"max",1230}, - {""}, {""}, {"char",416}, + {""}, + {"operStream",1511}, + {"yFirst",2351}, {"latitude",1042}, - {"total",2151}, + {"total",2152}, {""}, {""}, - {"product",1687}, + {"product",1688}, {""}, {""}, {""}, - {"model",1283}, + {"model",1284}, {""}, {"correction",595}, {""}, {"latitudes",1072}, {"consensus",562}, + {"conceptDir",556}, + {"normal",1319}, + {""}, + {"TS",232}, + {"hundred",936}, + {"million",1265}, {""}, - {"normal",1318}, - {"section8",1960}, - {"maximum",1231}, {"TT",234}, - {"million",1264}, {""}, - {"hundred",936}, - {"number",1330}, {"discipline",685}, - {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {"dataType",631}, - {""}, {""}, {""}, - {"landtype",1034}, {""}, {"hour",928}, - {"g",872}, - {""}, {""}, {""}, - {"Di",31}, - {"mybits",1301}, - {""}, - {"thousand",2122}, + {"landtype",1034}, {""}, {""}, - {"marsType",1214}, + {"oceanStream",1461}, + {""}, + {"ieeeFloats",949}, + {""}, + {"thousand",2123}, + {"endTimeStep",747}, {""}, {""}, {""}, {""}, {""}, - {"signature",2005}, - {""}, {""}, {""}, {""}, - {"eight",716}, - {"stepType",2068}, + {"marsType",1215}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Dstart",39}, - {""}, - {"elementsTable",717}, - {"categories",380}, + {"stepType",2069}, + {"grid",895}, {""}, - {"dataDate",618}, + {"month",1291}, {""}, - {"month",1290}, + {"elementsTable",717}, + {"standardDeviation",2049}, + {""}, {""}, {""}, {""}, + {"range",1719}, {""}, {""}, - {"isSens",999}, - {""}, {"dummy",695}, + {""}, + {"localDir",1121}, {""}, {""}, - {"obstype",1457}, - {"partitionTable",1623}, - {""}, {""}, {""}, {""}, - {"padding",1535}, - {"temperature",2112}, - {"dataStream",628}, + {"partitionTable",1624}, {""}, - {"marsDir",1190}, + {"temperature",2113}, + {""}, {""}, {""}, + {"userDateStart",2252}, + {""}, {""}, {"dummyc",698}, + {""}, {""}, + {"origin",1522}, + {"reportType",1759}, + {"rectimeDay",1740}, + {"codeType",544}, + {"matchSort",1227}, + {"reserved",1763}, {""}, - {"diagnostic",672}, - {"reportType",1758}, + {"varno",2274}, {""}, - {"codeType",544}, - {"dataOrigin",622}, - {""}, {""}, - {"endStep",745}, + {"version",2279}, + {"indicatorOfParameter",959}, {""}, - {"masterDir",1219}, - {""}, {""}, - {"marsStream",1211}, - {""}, {""}, {""}, - {"reserved",1762}, - {"Ni",194}, - {"varno",2273}, - {"marsDomain",1191}, - {"version",2278}, - {"Nr",196}, + {"dataOrigin",622}, + {"recDateTime",1736}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"JS",95}, {""}, {"local",1113}, - {"marsQuantile",1207}, - {""}, - {"startStep",2055}, - {"marsStep",1210}, - {"rdbType",1722}, + {"marsQuantile",1208}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"unitsFactor",2236}, {""}, {""}, {""}, {""}, - {"longitude",1145}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"operStream",1510}, - {""}, {""}, - {"longitudes",1174}, + {"dataSelection",627}, {"channel",414}, + {"isOctahedral",996}, + {""}, + {"eleven",719}, + {"hideThis",922}, {""}, - {"gridType",904}, {"country",608}, {""}, - {"gg",884}, - {"hideThis",922}, - {""}, {""}, {""}, - {"eleven",719}, + {"J",94}, + {""}, {""}, {""}, {""}, {""}, + {"refdate",1745}, + {""}, {""}, {""}, {""}, {""}, + {"userTimeStart",2256}, {""}, - {"notDecoded",1328}, - {""}, {""}, {""}, {""}, - {"rdbtimeTime",1731}, - {""}, {""}, - {"extraDim",784}, - {""}, {""}, {""}, {""}, - {"threshold",2124}, - {"Latin",113}, - {"two",2178}, - {""}, {""}, {""}, {""}, - {"oceanStream",1460}, - {""}, {""}, {""}, - {"endTimeStep",747}, - {""}, {""}, {""}, {""}, - {"elevation",718}, + {"threshold",2125}, + {""}, + {"signature",2006}, + {""}, + {"eight",716}, {""}, {""}, {""}, - {"Dx",40}, + {"centreDescription",398}, + {"isFillup",994}, {""}, {""}, - {"expver",782}, - {"Dy",43}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"Lap",108}, + {"elevation",718}, {""}, - {"average",316}, + {"categories",380}, + {""}, + {"identifier",948}, + {""}, + {"TScalc",233}, + {""}, + {"efiOrder",715}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"countTotal",607}, - {""}, {""}, {""}, - {"conceptDir",556}, - {""}, {""}, {""}, {""}, - {"values",2261}, + {"isSatellite",997}, {""}, - {"suiteName",2092}, + {"typicalDate",2211}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"diagnostic",672}, + {"file",837}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"false",830}, + {"values",2262}, {""}, - {"parameterName",1616}, + {"countTotal",607}, {""}, - {"NT",186}, + {"section8",1961}, + {"statisticalProcess",2060}, {""}, {""}, + {"reference",1746}, {"levels",1096}, - {""}, {""}, {""}, {""}, {""}, + {"localDay",1115}, + {""}, {""}, {""}, {""}, {"levelist",1095}, - {"matchSort",1226}, - {""}, {""}, - {"isOctahedral",996}, - {"modelName",1286}, - {""}, {""}, - {"expandedTypes",775}, - {"auxiliary",315}, - {"oneThousand",1508}, - {"daLoop",614}, - {"xLast",2344}, - {""}, - {"yLast",2351}, - {"tubeDomain",2176}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"fcperiod",834}, + {"longitude",1145}, + {""}, {""}, {""}, + {"laplacianOperator",1035}, {""}, - {"Nassigned",189}, - {"gridName",902}, - {"Nx",201}, + {"unitsDecimalScaleFactor",2234}, + {"dataKeys",620}, + {"KS",97}, + {"statisticalProcessesList",2061}, + {"typicalDay",2213}, {"levtype",1097}, - {"indexingTime",958}, - {""}, - {"Ny",202}, + {"longitudes",1175}, + {"localDateTime",1114}, + {""}, {""}, + {"gridType",904}, {""}, + {"g",872}, + {""}, {""}, {""}, {""}, {""}, {"aerosolType",295}, + {""}, {""}, + {"platform",1644}, + {"typicalTime",2218}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"level",1092}, + {""}, {""}, {""}, {""}, + {"pv",1699}, + {"spectralType",2047}, {""}, {""}, {""}, - {"typicalTime",2217}, - {"standardDeviation",2048}, - {"avg",320}, + {"codeFigure",543}, + {""}, {""}, {""}, {""}, + {"satelliteSeries",1843}, + {"productType",1693}, + {"userDateTimeStart",2254}, + {""}, + {"coefsFirst",548}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"average",316}, {""}, {""}, - {"global",885}, - {"dataSelection",627}, + {"padding",1536}, {""}, {""}, {""}, - {"localDir",1121}, - {"shortName",2002}, + {"unitOfTime",2227}, + {"band",324}, + {""}, {""}, {""}, {""}, + {"laplacianOperatorIsSet",1036}, + {""}, {""}, {""}, + {"two",2179}, + {"ccsdsFlags",386}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"parameterDiscipline",1615}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"lev",1090}, + {""}, {""}, + {"nlev",1315}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"rdbtime",1725}, {""}, - {"spectralType",2046}, + {"longitudesList",1176}, + {""}, {""}, {""}, {""}, + {"fgDate",835}, + {"oneThousand",1509}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"bitmap",362}, {""}, - {"level",1092}, + {"localDecimalScaleFactor",1116}, + {""}, {""}, {""}, {""}, + {"coordinatesPresent",589}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"overlayTemplate",1530}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"levelType",1094}, {""}, {""}, - {"Nb",190}, + {"windSpeed",2323}, {""}, - {"rdbtimeDate",1725}, + {"fcmonth",833}, + {""}, {""}, {""}, + {"number",1331}, {""}, {""}, - {"productType",1692}, - {"TS",232}, + {"K",96}, + {""}, {""}, {""}, {""}, + {"dataFlag",619}, {""}, - {"userTimeStart",2255}, - {"rectimeDay",1739}, + {"periodOfTime",1635}, + {"localSecond",1135}, + {""}, {""}, {""}, + {"forecastperiod",864}, + {"forecastSteps",862}, + {"mybits",1302}, + {"flags",852}, {""}, {""}, - {"pv",1698}, - {""}, - {"xFirst",2343}, + {"fgTime",836}, + {"setDecimalPrecision",1997}, {""}, - {"yFirst",2350}, + {"forecastTime",863}, {""}, {""}, - {"Ncx",191}, - {"Lx",149}, + {"tubeDomain",2177}, {""}, - {"recDateTime",1735}, - {"Ncy",192}, - {"Ly",151}, - {""}, {""}, - {"upperLimit",2246}, - {"TScalc",233}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Nux",199}, + {"Ni",194}, + {""}, + {"validityTime",2261}, + {"longitudeOfCentrePoint",1149}, + {"Nr",196}, + {""}, + {"offset",1463}, + {""}, + {"endDescriptors",724}, + {""}, {""}, {""}, {""}, {""}, + {"anoffset",307}, {""}, {""}, {""}, - {"Nuy",200}, + {"optionalData",1516}, + {""}, {""}, {""}, {""}, + {"obstype",1458}, + {"windDirection",2312}, + {""}, {""}, {""}, {""}, + {"rdbtimeDate",1726}, + {"angleDivisor",301}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"gg",884}, {""}, {""}, {""}, - {"isSatellite",997}, + {"avg",320}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"rdbtimeDay",1726}, - {"longitudesList",1175}, - {"modeNumber",1282}, - {""}, - {"ieeeFloats",949}, - {""}, - {"indicatorOfParameter",959}, + {"firstDimension",839}, + {""}, {""}, + {"categoryType",381}, {""}, {""}, {""}, {""}, {""}, - {"aerosolpacking",297}, - {"rdbDateTime",1720}, + {"rdbType",1723}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"Xo",268}, + {""}, {""}, {""}, + {"Xp",269}, {""}, {""}, - {"diagnosticNumber",673}, - {"lev",1090}, - {"Lcx",118}, + {"rdbtimeDay",1727}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"verticalDomainTemplate",2289}, {""}, - {"nlev",1314}, + {"rdbDateTime",1721}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"rdbtimeTime",1732}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Lcy",120}, + {"suiteName",2093}, + {""}, + {"parameterName",1617}, + {"dimensionType",678}, + {""}, + {"dateOfForecast",635}, + {"NT",186}, {""}, {""}, - {"editionNumber",712}, + {"waveDomain",2302}, + {""}, {""}, {""}, {""}, + {"timeOfForecast",2144}, {""}, {""}, {""}, - {"N",169}, - {"energyNorm",752}, - {"centreDescription",398}, - {"representationMode",1759}, - {"ensembleSize",756}, + {"modelName",1287}, + {"coefsSecond",549}, + {"extraDim",784}, + {"aerosolpacking",297}, + {""}, {""}, {""}, {""}, + {"lengthDescriptors",1081}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"analysisOffsets",300}, + {"crcrlf",609}, + {"derivedForecast",670}, + {"Ny",202}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"dayOfForecast",647}, {""}, - {"Lux",145}, - {""}, {""}, {""}, - {"Luy",147}, - {""}, {""}, {""}, {""}, {""}, - {"windSpeed",2322}, - {""}, {""}, - {"categoryType",381}, - {"expandedNames",770}, - {""}, {""}, {""}, {""}, {""}, - {"overlayTemplate",1529}, + {"controlForecastCluster",568}, {""}, - {"typicalDate",2210}, + {"latitudeOfCentrePoint",1047}, + {"shortName",2003}, {""}, {""}, {""}, {""}, - {"levelType",1094}, + {"xFirst",2344}, + {"ensembleSize",756}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"marsStartStep",1210}, {""}, {""}, - {"truncateLaplacian",2172}, + {"startTimeStep",2058}, + {""}, + {"localFlag",1123}, + {"flag",847}, {""}, {""}, {""}, {""}, {""}, - {"sectionNumber",1969}, - {""}, {""}, - {"oldSubtype",1496}, - {"statisticalProcess",2059}, - {"ccsdsRsi",387}, - {""}, {""}, - {"laplacianOperator",1035}, - {"localDay",1115}, + {"maximum",1232}, {""}, {""}, - {"userDateStart",2251}, - {"rdbSubtype",1721}, - {"indexTemplate",954}, - {""}, {""}, {""}, - {"dataKeys",620}, - {"visibility",2292}, + {"runwayState",1838}, + {""}, {""}, {""}, {""}, + {"Ncy",192}, + {""}, {""}, {""}, {""}, + {"yearOfForecast",2357}, {""}, - {"unitsFactor",2235}, - {""}, {""}, - {"marsRange",1208}, + {"logTransform",1144}, + {""}, {""}, {""}, {""}, + {"stepTypeForConversion",2070}, + {""}, {""}, {""}, {""}, + {"Nuy",200}, + {""}, {""}, {""}, {""}, + {"oldSubtype",1497}, {""}, - {"refdate",1744}, - {""}, {""}, - {"localSecond",1135}, - {""}, {""}, - {"statisticalProcessesList",2060}, - {"typicalDay",2212}, - {"validityTime",2260}, - {"localDateTime",1114}, - {"stepRange",2066}, + {"incrementOfLengths",953}, {""}, {""}, {""}, - {"clearTables",421}, + {"LaD",105}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"totalNumber",2155}, + {"Latin",113}, {""}, - {"identifier",948}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"tubeNumber",2177}, - {"isFillup",994}, + {"offsetSection9",1494}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"editionNumber",712}, + {"referenceDate",1747}, + {""}, + {"Nassigned",189}, + {"gridName",902}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"codeFigure",543}, - {""}, {""}, {""}, {""}, - {"boustrophedonic",369}, - {"zero",2359}, + {"freeFormData",867}, + {"Lap",108}, + {"headersOnly",918}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"legNumber",1079}, - {"siteLatitude",2013}, + {"siteId",2013}, + {""}, {""}, {""}, {""}, {""}, + {"reservedOctet",1768}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"sectionNumber",1970}, {""}, - {"file",837}, + {"hourOfForecast",931}, + {""}, {""}, + {"marsIdent",1198}, + {""}, {""}, + {"paramId",1608}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"marsLatitude",1201}, - {"endDescriptors",724}, + {"daLoop",614}, {""}, {""}, - {"dataFlag",619}, - {"false",830}, - {"dataLength",621}, + {"yLast",2352}, {""}, {""}, {""}, {""}, - {"optionalData",1515}, - {""}, {""}, - {"reference",1745}, + {"global",885}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"monthOfForecast",1294}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"subSetJ",2088}, {""}, {""}, - {"windDirection",2311}, + {"offsetDescriptors",1477}, + {""}, + {"cfName",404}, {""}, {""}, - {"ccsdsFlags",386}, + {"generatingProcessTemplate",881}, + {"expver",782}, + {"iIncrement",941}, {""}, {""}, - {"parameterDiscipline",1614}, - {""}, {""}, {""}, {""}, {""}, - {"fcperiod",834}, - {""}, {""}, {""}, {""}, {""}, - {"clusterNumber",536}, + {"originalSubCentreIdentifier",1525}, {""}, - {"siteLongitude",2014}, - {""}, {""}, {""}, - {"marsLongitude",1204}, - {""}, {""}, - {"upperRange",2247}, + {"validityDate",2260}, + {""}, {""}, {""}, {""}, + {"decimalScaleFactor",652}, {""}, - {"tableNumber",2103}, + {"visibility",2293}, + {"energyNorm",752}, {""}, {""}, - {"overlayTemplateNumber",1530}, + {"anoffsetFirst",308}, + {""}, + {"latitudeSexagesimal",1069}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"platform",1643}, + {"Ly",151}, + {""}, {""}, + {"upperLimit",2247}, + {""}, {""}, {""}, {""}, + {"clearTables",421}, {""}, - {"channelNumber",415}, - {""}, {""}, {""}, {""}, {""}, - {"LaD",105}, - {""}, {""}, {""}, {""}, {""}, - {"angleDivisor",301}, + {"integerScalingFactorAppliedToDirections",976}, + {"integerScalingFactorAppliedToFrequencies",977}, {""}, - {"efiOrder",715}, + {"offsetSection0",1483}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"clusterNumber",536}, + {"expandedTypes",775}, + {"typeOfStatisticalPostProcessingOfEnsembleMembers",2205}, + {"latitudeOfCentrePointInDegrees",1048}, + {"auxiliary",315}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"marsLevel",1202}, - {""}, {""}, {""}, {""}, {""}, - {"systemNumber",2099}, + {"Lcy",120}, {""}, {""}, - {"instrumentIdentifier",972}, + {"numberOfFloats",1378}, {""}, {""}, - {"unitsDecimalScaleFactor",2233}, + {"channelNumber",415}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"referenceStep",1754}, + {""}, {""}, + {"Luy",147}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"listOfScaledFrequencies",1112}, {""}, {""}, {""}, - {"topLevel",2150}, - {""}, {""}, {""}, {""}, - {"memberNumber",1259}, - {"lowerLimit",1177}, + {"atmosphericChemicalOrPhysicalConstituentType",313}, {""}, {""}, {""}, - {"localLatitude",1126}, + {"integerScaleFactor",975}, + {""}, {""}, {""}, {""}, + {"boustrophedonic",369}, + {"truncateLaplacian",2173}, + {""}, {""}, {""}, {""}, + {"localDefinition",1119}, {""}, - {"flags",852}, + {"overlayTemplateNumber",1531}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"computeStatistics",555}, + {""}, {""}, {""}, {""}, {""}, + {"gridDefinition",897}, + {""}, {""}, {""}, {""}, + {"modelIdentifier",1286}, + {""}, {""}, {""}, {""}, + {"offsetSection8",1493}, + {""}, {""}, {""}, {""}, {""}, + {"referenceOfLengths",1750}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"numberOfDirections",1368}, + {""}, {""}, {""}, + {"typeOfStatisticalProcessing",2206}, + {""}, {""}, {""}, + {"indexingTime",958}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"faFieldName",827}, + {"Nf",193}, {""}, - {"fgTime",836}, + {"defaultName",656}, + {"secondOfForecast",1907}, + {""}, {""}, + {"minuteOfForecast",1271}, + {"numberOfDiamonds",1367}, + {""}, {""}, + {"scaledDirections",1867}, + {""}, {""}, + {"numberOfTimeSteps",1438}, + {""}, {""}, {""}, {""}, {""}, + {"climateDateFrom",422}, + {""}, {""}, {""}, + {"setLocalDefinition",1998}, {""}, - {"methodNumber",1263}, + {"numberingOrderOfDiamonds",1450}, + {"N",169}, + {""}, {""}, + {"newSubtype",1314}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"ccccIdentifiers",383}, {""}, - {"startTimeStep",2057}, + {"levTypeName",1091}, + {""}, {""}, + {"Adelta",13}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"subSetK",2089}, + {""}, {""}, {""}, + {"modeNumber",1283}, + {"observedData",1457}, + {""}, {""}, + {"rdbSubtype",1722}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"waveDomain",2301}, - {"iterationNumber",1016}, - {"runwayState",1837}, - {"dimensionNumber",677}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"marsLevel",1203}, {""}, {""}, - {"dataValues",632}, + {"isAuto",984}, {""}, {""}, - {"newSubtype",1313}, + {"anoffsetFrequency",309}, + {""}, {""}, {""}, {""}, + {"generatingProcessIdentifier",880}, + {""}, {""}, {""}, {""}, + {"topLevel",2151}, + {""}, {""}, {""}, + {"perturbedType",1638}, {""}, {""}, - {"parameterNumber",1617}, - {"laplacianOperatorIsSet",1036}, + {"numberOfSubsets",1435}, + {"sequences",1994}, {""}, - {"userDateTimeStart",2253}, + {"quantile",1711}, + {""}, {""}, + {"TAFstr",230}, + {"gridDefinitionDescription",898}, {""}, - {"partitionNumber",1622}, + {"siteLatitude",2014}, + {"representationType",1761}, + {""}, {""}, + {"marsLatitude",1202}, + {""}, {""}, + {"dataLength",621}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"instrumentIdentifier",972}, {""}, + {"lcwfvSuiteName",1075}, + {"TAF",229}, + {""}, {""}, + {"qnh",1704}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"generatingProcessIdentificationNumber",879}, {"latitudesList",1073}, {""}, - {"pressureLevel",1675}, - {""}, {""}, {""}, - {"extraDimensionPresent",785}, - {"bottomLevel",368}, - {"Xo",268}, + {"gridDefinitionSection",899}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"pressureLevel",1676}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"subcentreOfAnalysis",2091}, + {"crraSection",612}, + {"rectimeSecond",1743}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"expoffset",781}, + {""}, {""}, + {"totalNumber",2156}, {""}, {""}, {""}, - {"Xp",269}, + {"marsKeywords",1199}, + {""}, {""}, {""}, {""}, {""}, + {"dataAccessors",616}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"DiInDegrees",33}, + {"indexTemplate",954}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"lengthDescriptors",1081}, + {"dx",699}, + {""}, + {"Dx",40}, + {"listOfDistributionFunctionParameter",1108}, + {""}, {""}, {""}, + {"typeOfDistributionFunction",2186}, + {""}, {""}, {""}, + {"max",1231}, + {""}, {""}, + {"zero",2360}, + {""}, + {"qfe",1701}, {""}, {""}, {""}, {""}, - {"secondLatitude",1903}, - {"directionNumber",680}, + {"corr3Data",593}, {""}, {""}, {""}, {""}, {""}, {""}, - {"indexingDate",957}, - {""}, {""}, {""}, - {"meanSize",1253}, + {"optimisationTime",1514}, + {"numberOfOperationalForecastTube",1404}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"reservedOctet",1767}, - {"flag",847}, + {"defaultStepUnits",660}, + {"satelliteIdentifier",1841}, {""}, {""}, - {"extractSubset",815}, - {"fcmonth",833}, - {"unitOfTime",2226}, - {""}, {""}, {""}, - {"representativeMember",1761}, + {"lowerLimit",1178}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"defaultFaFieldName",653}, + {"stretchingFactor",2076}, + {"endOfInterval",741}, + {"DyInDegrees",44}, + {""}, + {"numberOfFrequencies",1384}, + {"templatesLocalDir",2115}, {""}, {""}, {""}, - {"numberingOrderOfDiamonds",1449}, - {"localFlag",1123}, + {"meanSize",1254}, {""}, {""}, - {"forecastperiod",864}, - {"KS",97}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"localDecimalScaleFactor",1116}, - {"generatingProcessTemplate",881}, - {"levTypeName",1091}, - {"forecastTime",863}, - {"satelliteSeries",1842}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"observedData",1456}, - {""}, {""}, {""}, {""}, {""}, - {"fgDate",835}, + {"ccsdsRsi",387}, {""}, {""}, {""}, - {"datumSize",643}, + {"centreForLocal",399}, {""}, {""}, - {"satelliteNumber",1841}, - {""}, - {"marsStartStep",1209}, + {"systemNumber",2100}, + {"longitudeSexagesimal",1174}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"localSection",1136}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"secondDimension",1901}, + {"legNumber",1079}, + {"masterTableNumber",1221}, + {"methodNumber",1264}, {""}, - {"NL",182}, + {"groupSplitting",908}, + {"typicalSecond",2217}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cfName",404}, - {""}, - {"tablesVersion",2107}, + {"expandedNames",770}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"corr4Data",594}, + {"datumSize",643}, + {""}, + {"indexingDate",957}, + {"stretchingFactorScaled",2077}, + {""}, {""}, + {"longitudeOfCentrePointInDegrees",1150}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"timeDomainTemplate",2139}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"FirstLatitude",68}, + {"partitionItems",1622}, + {"climateDateTo",423}, {""}, {""}, {""}, {""}, - {"setDecimalPrecision",1996}, + {"xLast",2345}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"Nb",190}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"iteratorDisableUnrotate",1017}, {""}, - {"charValues",417}, - {""}, {""}, {""}, - {"K",96}, - {""}, {""}, {""}, - {"setLocalDefinition",1997}, + {"numberOfForcasts",1379}, + {"diffInDays",674}, + {"longitudinalDirectionGridLength",1177}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"isEps",993}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"marsRange",1209}, + {""}, + {"generatingProcessTemplateNumber",882}, {""}, {""}, - {"periodOfTime",1634}, + {"typeOfLevel",2195}, + {""}, {""}, {""}, + {"bufrTemplate",374}, + {"secondOrderFlags",1909}, + {"yDirectionGridLength",2348}, + {"stepRange",2067}, + {"referenceSampleInterval",1753}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"heightLevelName",919}, + {""}, {""}, {""}, {""}, {""}, + {"createNewData",610}, + {"offsetFreeFormData",1479}, {""}, {""}, {""}, {""}, - {"lowerRange",1178}, - {"logTransform",1144}, - {"coordinatesPresent",589}, + {"typicalDateTime",2212}, + {"conceptsLocalDirAll",557}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"sensitiveAreaDomain",1993}, + {""}, + {"localDefinitionNumber",1120}, {""}, {""}, - {"heightLevelName",919}, + {"diagnosticNumber",673}, {""}, {""}, - {"indexTemplateNumber",955}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"distinctLatitudes",687}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"periodOfTimeIntervals",1636}, + {""}, {""}, + {"forecastLeadTime",855}, + {""}, {""}, + {"orderOfSpatialDifferencing",1519}, {""}, - {"longitudeOfCenterPoint",1148}, - {"forecastSteps",862}, - {""}, {""}, {""}, {""}, {""}, - {"SecondLatitude",223}, + {"MS",156}, {""}, {""}, {""}, - {"validityDate",2259}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"missingValue",1276}, + {"missingDataFlag",1276}, + {""}, {""}, + {"matchLandType",1226}, {""}, {""}, {""}, {""}, - {"integerValues",978}, + {"correction1Part",597}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"upperRange",2248}, {""}, {""}, {""}, - {"numericValues",1450}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"coefsSecond",549}, - {"coefsFirst",548}, + {"molarMass",1290}, + {"productDefinition",1689}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"frequency",868}, + {""}, {""}, {""}, + {"bottomLevel",368}, + {""}, {""}, + {"tiggeSection",2131}, {""}, {""}, - {"marsParam",1206}, + {"isSatelliteType",998}, {""}, - {"oceanLevName",1459}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"internalVersion",979}, + {"extractSubset",815}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"epsPoint",760}, - {""}, {""}, {""}, {""}, {""}, - {"latitudeSexagesimal",1069}, + {"matchTimeRepres",1228}, + {""}, {""}, {""}, {""}, + {"numberOfSection",1431}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"tubeNumber",2178}, + {""}, + {"numberOfForecastsInTube",1383}, + {""}, + {"clusterSize",537}, {""}, {""}, {""}, - {"distinctLatitudes",687}, - {"Adelta",13}, - {"codedValues",547}, + {"marsModel",1206}, {""}, - {"sequences",1993}, - {"localLongitude",1129}, - {"quantile",1710}, + {"observablePropertyTemplate",1452}, + {""}, + {"northernLatitudeOfDomain",1327}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"rdbtimeSecond",1731}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"realPart",1733}, - {"extraValues",788}, + {"stepTypeInternal",2071}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"isAuto",984}, - {""}, {""}, {""}, {""}, - {"qnh",1703}, - {"observablePropertyTemplate",1451}, - {""}, {""}, {""}, - {"defaultName",656}, - {""}, {""}, {""}, {""}, {""}, - {"groupSplitting",908}, - {""}, {""}, {""}, {""}, - {"clusterSize",537}, + {"expandedDescriptors",769}, + {""}, + {"groupWidth",910}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"levelIndicator",1093}, + {"tableNumber",2104}, + {"simpleThinningSkip",2010}, + {"originatorLocalTemplate",1528}, + {""}, {""}, + {"isEps",993}, {""}, - {"firstLatitude",842}, - {"matchTimeRepres",1227}, + {"longitudeOfFirstGridPoint",1154}, + {"southernLatitudeOfDomain",2034}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"longitudeSexagesimal",1173}, - {"firstDimension",839}, - {"NR",184}, + {"observablePropertyTemplateNumber",1453}, + {""}, {""}, {""}, + {"streamOfAnalysis",2075}, + {"binaryScaleFactor",360}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"createNewData",610}, {""}, - {"probPoint",1681}, - {""}, {""}, {""}, {""}, - {"offset",1462}, - {""}, {""}, {""}, {""}, - {"masterTableNumber",1220}, + {"verificationDate",2275}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"NAT",172}, + {"oneMillionConstant",1500}, {""}, {""}, - {"anoffset",307}, - {"referenceDate",1746}, - {""}, {""}, {""}, - {"marsEndStep",1192}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"marsLevelist",1203}, + {"marsLevelist",1204}, + {"memberNumber",1260}, {""}, - {"userTimeEnd",2254}, + {"widthOfFirstOrderValues",2308}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"endOfRange",744}, + {""}, {""}, {""}, {""}, {""}, + {"FirstLatitude",68}, {""}, {""}, - {"groupSplittingMethodUsed",909}, + {"verticalDomainTemplateNumber",2290}, + {""}, {""}, + {"ensembleForecastNumbers",754}, + {"baseAddress",325}, + {"minuteOfAnalysis",1269}, + {""}, {""}, + {"defaultShortName",659}, {""}, {""}, {""}, - {"LaR",107}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"dataAccessors",616}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"generatingProcessTemplateNumber",882}, - {"LoR",126}, + {"oceanLevName",1460}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"iterationNumber",1016}, {""}, - {"stringValues",2077}, + {"dimensionNumber",677}, + {""}, {""}, {""}, {""}, + {"marsEndStep",1193}, + {""}, {""}, {""}, + {"parameterNumber",1618}, + {"groupWidths",911}, + {""}, {""}, {""}, + {"partitionNumber",1623}, {""}, - {"libraryVersion",1098}, + {"theMessage",2118}, + {"clusterMember9",535}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"addressOfFileFreeSpaceInfo",294}, {""}, {""}, {""}, - {"biFourierTruncationType",359}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"attributeOfTile",314}, + {""}, + {"horizontalCoordinateSupplement",924}, + {""}, {""}, {""}, {""}, {""}, + {"directionNumber",680}, {""}, {""}, {""}, {""}, - {"endOfRange",744}, + {"optimizeScaleFactor",1515}, {""}, - {"marsKeywords",1198}, + {"thisMarsStream",2121}, + {"instrumentType",973}, + {"localMinute",1132}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"thisMarsType",2122}, + {"numberOfIterations",1392}, {""}, {""}, - {"crraSection",612}, - {"rectimeSecond",1742}, + {"secondDimensionPhysicalSignificance",1903}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"boustrophedonicOrdering",370}, - {""}, {""}, {""}, {""}, {""}, - {"expoffset",781}, + {""}, {""}, {""}, {""}, + {"constituentType",567}, {""}, {""}, {""}, - {"marsExpver",1194}, + {"Nx",201}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"dayOfAnalysis",645}, + {"localMonth",1133}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"localLatitude",1126}, + {""}, {""}, {""}, {""}, + {"isAccumulation",983}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"satelliteNumber",1842}, + {"earthMinorAxis",704}, {""}, {""}, {""}, - {"integerScaleFactor",975}, - {"numberOfTimeSteps",1437}, - {""}, {""}, {""}, - {"decimalScaleFactor",652}, - {""}, - {"rdbtimeSecond",1730}, + {"minutesAfterDataCutoff",1274}, + {""}, {""}, {""}, {""}, {""}, + {"Ncx",191}, + {""}, {""}, + {"clutterFilterIndicator",540}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"earthIsOblate",701}, + {""}, {""}, + {"siteLongitude",2015}, + {"Nux",199}, {""}, - {"crcrlf",609}, - {"referenceStep",1753}, - {"gridDefinition",897}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"bufrTemplate",374}, - {"userDateEnd",2250}, + {"DxInDegrees",41}, + {"marsLongitude",1205}, + {""}, {""}, {""}, {""}, + {"powerOfTenUsedToScaleClimateWeight",1649}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"angleMultiplier",302}, + {""}, {""}, {""}, {""}, {""}, + {"spectralMode",2046}, {""}, - {"subSetK",2088}, + {"multiplicationFactorForLatLong",1301}, + {""}, {""}, + {"indexTemplateNumber",955}, {""}, {""}, - {"siteElevation",2011}, + {"marsParam",1207}, + {"SPD",222}, {""}, - {"numberOfDirections",1367}, + {"userDateTimeEnd",2253}, + {"operatingMode",1512}, {""}, - {"numberOfFloats",1377}, + {"radialAngularSpacing",1712}, + {""}, {""}, + {"globalDomain",886}, {""}, - {"spectralDataRepresentationType",2044}, + {"epsPoint",760}, {""}, - {"standardParallel",2049}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"longitudinalDirectionGridLength",1176}, - {""}, {""}, - {"computeStatistics",555}, - {""}, {""}, {""}, - {"baseAddress",325}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"userDateEnd",2251}, + {""}, {""}, {""}, {""}, {""}, + {"firstLatitude",842}, + {"biFourierTruncationType",359}, + {""}, {""}, {""}, {""}, {""}, + {"horizontalCoordinateDefinition",923}, + {"secondLatitude",1904}, + {"unitOfOffsetFromReferenceTime",2226}, {""}, {""}, {""}, {""}, - {"NAT",172}, + {"lowerRange",1179}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"referenceValue",1754}, - {"northernLatitudeOfDomain",1326}, - {""}, {""}, - {"deleteExtraLocalSection",667}, - {""}, {""}, {""}, {""}, {""}, - {"extraLocalSectionPresent",787}, - {""}, {""}, - {"observablePropertyTemplateNumber",1452}, - {""}, {""}, {""}, - {"Nf",193}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"localSection",1136}, + {"realPart",1734}, {""}, {""}, {""}, {""}, - {"latitudeOfCenterPoint",1046}, - {"extractSubsetList",818}, + {"ITN",93}, + {""}, {""}, {""}, {""}, + {"anoffsetLast",310}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"spectralDataRepresentationMode",2044}, + {"minuteOfReference",1273}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"unitsOfFirstFixedSurface",2237}, {""}, - {"faFieldName",827}, + {"faLevelName",828}, {""}, {""}, - {"localDefinition",1119}, + {"numberOfLocalDefinitions",1393}, {""}, - {"floatVal",853}, - {"tiggeSection",2130}, - {"typicalSecond",2216}, - {"derivedForecast",670}, - {""}, {""}, - {"analysisOffsets",300}, - {""}, {""}, {""}, - {"aerosolbinnumber",296}, - {"marsExperimentOffset",1193}, - {"molarMass",1289}, - {"TAFstr",230}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"southernLatitudeOfDomain",2033}, - {""}, {""}, {""}, {""}, {""}, - {"monthlyVerificationTime",1298}, + {"iDirectionIncrement",937}, + {"SecondLatitude",223}, + {"userTimeEnd",2255}, {""}, - {"dayOfForecast",647}, + {"numberOfDistinctSection9s",1375}, {""}, - {"typeOfLevel",2194}, + {"roundedMarsLevelist",1784}, + {"scaleFactorOfFirstSize",1851}, + {"tiggeModel",2130}, + {"dateOfReference",639}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"siteElevation",2012}, {""}, - {"extraLocalSectionNumber",786}, + {"timeOfReference",2146}, + {""}, + {"timeIncrement",2141}, + {"clusterMember8",534}, + {"scanningMode",1892}, {""}, {""}, - {"generatingProcessIdentifier",880}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"longitudeOfStretchingPole",1164}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfDiamonds",1366}, - {"expandedDescriptors",769}, - {"NV",188}, + {"unitsOfSecondFixedSurface",2238}, {""}, {""}, {""}, {""}, - {"neitherPresent",1312}, + {"monthOfAnalysis",1292}, {""}, - {"qfe",1700}, - {""}, {""}, {""}, {""}, {""}, - {"referenceSampleInterval",1752}, - {"marsModel",1205}, - {""}, {""}, {""}, {""}, - {"secondDimension",1900}, + {"representationMode",1760}, + {""}, {""}, {""}, + {"classOfAnalysis",420}, + {"xDirectionGridLength",2341}, {""}, {""}, {""}, {""}, - {"freeFormData",867}, - {""}, - {"iteratorDisableUnrotate",1017}, + {"spectralDataRepresentationType",2045}, {""}, - {"generatingProcessIdentificationNumber",879}, + {"unsignedIntegers",2244}, {""}, - {"postAuxiliary",1646}, - {""}, {""}, {""}, - {"scaledDirections",1866}, - {"latLonValues",1041}, - {""}, {""}, {""}, - {"centreForLocal",399}, + {"treatmentOfMissingData",2169}, + {"Lx",149}, {""}, {""}, {""}, {""}, {""}, - {"standardParallelInDegrees",2050}, - {""}, {""}, {""}, - {"sectionPosition",1970}, - {""}, {""}, - {"userDateTimeEnd",2252}, - {""}, - {"cfVarName",406}, - {""}, {""}, - {"identificationOfOriginatingGeneratingCentre",946}, - {""}, - {"matrixOfValues",1229}, - {"ensembleForecastNumbers",754}, + {"timeDomainTemplateNumber",2140}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"defaultFaLevelName",654}, {""}, - {"offsetSection9",1493}, + {"extractAreaWestLongitude",794}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"extractDateTimeYearStart",814}, + {"simpleThinningStart",2011}, + {"angleSubdivisions",306}, + {"roundedMarsLongitude",1785}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"tablesVersionLatest",2108}, + {"identificationNumber",945}, {""}, - {"LoV",127}, + {"yearOfReference",2359}, + {""}, + {"Lcx",118}, + {"NL",182}, {""}, {""}, - {"theMessage",2117}, - {""}, {""}, {""}, {""}, - {"lcwfvSuiteName",1075}, + {"postAuxiliary",1647}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"ensembleStandardDeviation",757}, + {"observationGeneratingProcessIdentifier",1455}, + {""}, + {"Lux",145}, + {"endOfFileAddress",739}, {""}, {""}, - {"extractAreaWestLongitude",794}, + {"offsetAfterLocalSection",1467}, {""}, {""}, {""}, {""}, - {"expandedAbbreviations",764}, - {""}, {""}, {""}, - {"localDefinitionNumber",1120}, + {"calendarIdPresent",376}, + {""}, + {"LaDInDegrees",106}, {""}, {""}, {""}, - {"verticalVisibility",2290}, - {""}, {""}, - {"conceptsLocalDirAll",557}, - {""}, {""}, {""}, {""}, - {"SPD",222}, - {"Azi",15}, - {"horizontalCoordinateSupplement",924}, + {"scaleFactorOfStandardDeviation",1863}, + {"scaledFrequencies",1868}, + {"scalingFactorForFrequencies",1890}, {""}, {""}, - {"monthlyVerificationDate",1296}, + {"numberOfDistinctSection8s",1374}, {""}, {""}, - {"complexPacking",551}, - {"originalParameterNumber",1522}, - {""}, - {"globalDomain",886}, {"computeLaplacianOperator",554}, + {""}, {""}, + {"normAtInitialTime",1318}, + {"extractedDateTimeNumberOfSubsets",820}, + {"northLatitudeOfCluster",1320}, + {""}, {""}, {""}, {""}, {""}, + {"scaleFactorOfStandardDeviationInTheCluster",1864}, {""}, {""}, {""}, - {"ifsParam",950}, - {"faLevelName",828}, + {"scaleFactorOfFirstFixedSurface",1850}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"dateOfAnalysis",634}, + {""}, {""}, {""}, + {"tablesMasterDir",2107}, + {""}, {""}, {""}, {""}, + {"timeOfAnalysis",2143}, {""}, - {"typeOfStatisticalPostProcessingOfEnsembleMembers",2204}, + {"biFourierMakeTemplate",352}, + {""}, {""}, + {"startOfMessage",2054}, {""}, {""}, {""}, - {"operatingMode",1511}, + {"ifsParam",950}, + {"productDefinitionTemplateNumber",1690}, {""}, - {"identificationNumber",945}, - {"verticalDomainTemplate",2288}, + {"corr2Data",592}, + {"tileIndex",2136}, {""}, - {"offsetSection8",1492}, - {"numberOfValues",1445}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"windPresent",2321}, + {"hourOfReference",933}, + {"numberOfAnalysis",1338}, {""}, {""}, - {"simpleThinningMissingRadius",2008}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"clusteringMethod",539}, - {"iDirectionIncrement",937}, - {""}, - {"originalSubCentreIdentifier",1524}, - {"XR",266}, - {""}, {""}, {""}, - {"floatValues",854}, - {"clusterMember9",535}, - {"pvlLocation",1699}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"angleSubdivisions",306}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"MS",156}, - {""}, {""}, {""}, - {"sensitiveAreaDomain",1992}, - {"thisExperimentVersionNumber",2118}, - {"dateOfForecast",635}, + {"standardParallelInDegrees",2051}, {""}, {""}, - {"angleOfRotation",303}, - {"numberOfSubsets",1434}, + {"pvlLocation",1700}, + {"climatologicalRegime",424}, {""}, {""}, - {"tiggeModel",2129}, - {"localMinute",1132}, - {"timeOfForecast",2143}, + {"dataValues",632}, + {""}, {""}, + {"localDefNumberOne",1117}, + {""}, {""}, + {"southLatitudeOfCluster",2030}, {"indicatorOfUnitOfTimeRange",963}, + {""}, {""}, + {"standardParallel",2050}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"roundedMarsLatitude",1783}, + {"monthOfReference",1296}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"scaleFactorOfSecondSize",1861}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"yearOfAnalysis",2354}, + {""}, {""}, {""}, + {"productDefinitionTemplateNumberInternal",1691}, {""}, - {"dataRepresentation",623}, - {"offsetDescriptors",1476}, - {"doExtractDateTime",690}, + {"grib3divider",891}, + {"numberOfInts",1391}, {""}, - {"inputExtendedDelayedDescriptorReplicationFactor",966}, - {"thisMarsType",2121}, - {"doExtractSubsets",691}, - {"spectralMode",2045}, - {""}, {""}, - {"isAccumulation",983}, + {"perturbationNumber",1637}, {""}, - {"scanningMode",1891}, - {"totalNumberOfdimensions",2167}, - {""}, {""}, {""}, {""}, {""}, - {"typeOfStatisticalProcessing",2205}, - {""}, {""}, {""}, - {"radialAngularSpacing",1711}, + {"eastLongitudeOfCluster",706}, + {""}, + {"typeOfAnalysis",2182}, {""}, {""}, {""}, - {"controlForecastCluster",568}, + {"inputDelayedDescriptorReplicationFactor",965}, + {"angleOfRotation",303}, {""}, {""}, {""}, - {"clusterMember8",534}, + {"orderOfSPD",1518}, {""}, {""}, - {"localExtensionPadding",1122}, + {"iScansNegatively",942}, {""}, - {"numberOfOperationalForecastTube",1403}, + {"typeOfEnsembleForecast",2187}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"temperatureAndDewpointPresent",2114}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"DiInMetres",34}, {""}, {""}, - {"localMonth",1133}, + {"Azi",15}, + {""}, + {"scanningMode8",1897}, {""}, {""}, - {"windVariableDirection",2332}, - {"earthMinorAxis",704}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"latitudeOfCenterPointInDegrees",1047}, + {"localLongitude",1129}, {""}, - {"TAF",229}, - {""}, {""}, {""}, - {"treatmentOfMissingData",2168}, + {"offsetAfterPadding",1468}, {""}, {""}, {""}, - {"averagingPeriod",319}, - {""}, {""}, {""}, - {"listOfScaledFrequencies",1112}, - {"yearOfForecast",2356}, + {"offsetAfterCentreLocalSection",1465}, + {""}, {""}, {""}, {""}, {""}, + {"defaultSequence",658}, + {""}, {""}, + {"conceptsMasterDir",560}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"corr1Data",591}, {""}, - {"dewPointTemperature",671}, - {""}, {""}, {""}, {""}, - {"frequency",868}, - {"rectimeMinute",1741}, - {"isConstant",990}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"scaledFrequencies",1867}, + {"originatorLocalTemplateNumber",1529}, {""}, - {"stepTypeForConversion",2069}, - {"scanningMode8",1896}, - {""}, {""}, - {"applicationIdentifier",311}, - {""}, {""}, {""}, - {"totalNumberOfTubes",2165}, + {"neitherPresent",1313}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"meaningOfVerticalCoordinate",1258}, - {""}, {""}, {""}, {""}, - {"bitmapSectionPresent",364}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"rdbtimeMinute",1728}, - {"Experiment_Identifier",56}, - {"climatologicalRegime",424}, - {""}, {""}, {""}, - {"forecastPeriod",858}, + {"representativeMember",1762}, {""}, {""}, - {"thisMarsStream",2120}, - {""}, {""}, {""}, - {"extractedDateTimeNumberOfSubsets",820}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"defaultParameter",657}, - {""}, {""}, {""}, {""}, - {"anoffsetFirst",308}, + {"hourOfAnalysis",929}, {""}, - {"marsClass",1187}, - {""}, {""}, - {"offsetSection0",1482}, + {"unitOfTimeIncrement",2228}, {""}, - {"dataRepresentationType",626}, - {""}, {""}, {""}, {""}, - {"inputDataPresentIndicator",964}, + {"charValues",417}, + {"normAtFinalTime",1317}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"extractDateTimeHourStart",801}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"hourOfForecast",931}, - {"dataRepresentationTemplate",624}, - {""}, {""}, {""}, - {"marsLamModel",1200}, + {"DyInMetres",45}, {""}, {""}, - {"ensembleForecastNumbersList",755}, - {""}, {""}, {""}, {""}, {""}, - {"numberOfRadials",1423}, + {"gridDefinitionTemplateNumber",900}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"typeOfTimeIncrement",2207}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"versionNumOfFilesFreeSpaceStorage",2279}, - {""}, {""}, {""}, {""}, {""}, - {"angleMultiplier",302}, {""}, {""}, - {"optimizeScaleFactor",1514}, + {"accumulationInterval",289}, + {"n3",1305}, + {"selectStepTemplateInstant",1991}, + {""}, + {"forecastPeriod",858}, + {"numberOfRadials",1424}, + {"probPoint",1682}, {""}, {""}, {""}, {""}, {""}, - {"subCentre",2078}, + {"II",89}, {""}, {""}, {""}, {""}, - {"primaryMissingValue",1678}, - {"parameterCode",1613}, - {""}, {""}, - {"typicalMinute",2214}, - {""}, {""}, {""}, - {"tableCode",2102}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"ensembleStandardDeviation",757}, - {""}, {""}, {""}, - {"minuteOfReference",1272}, - {"totalNumberOfDirections",2158}, - {"typeOfDistributionFunction",2185}, - {""}, {""}, {""}, {""}, {""}, - {"Sub-Experiment_Identifier",228}, - {""}, - {"P",206}, - {""}, {""}, {""}, - {"numberOfVerticalPoints",1448}, - {""}, {""}, - {"dateOfReference",639}, + {"latitudeWhereDxAndDyAreSpecified",1070}, + {"defaultParameter",657}, + {""}, {""}, {""}, {""}, + {"truncateDegrees",2172}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"sp3",2037}, + {"latitudeWhereDxAndDyAreSpecifiedInDegrees",1071}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"calendarIdentification",377}, {""}, {""}, - {"internationalDataSubCategory",980}, - {""}, - {"productDefinition",1688}, + {"internalVersion",979}, {""}, {""}, - {"oneMillionConstant",1499}, - {"timeOfReference",2145}, - {""}, {""}, {""}, - {"secondOfForecast",1906}, - {"changeDecimalPrecision",408}, - {""}, - {"minuteOfForecast",1270}, + {"epsStatisticsPoint",762}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"monthOfForecast",1293}, + {"marsLamModel",1201}, {""}, - {"numberOfSection",1430}, + {"isHindcast",995}, {""}, {""}, - {"bitsPerValue",365}, - {""}, - {"consensusCount",563}, + {"codedValues",547}, {""}, {""}, - {"epsStatisticsPoint",762}, + {"versionNumOfFilesFreeSpaceStorage",2280}, {""}, {""}, {""}, {""}, {""}, - {"biFourierMakeTemplate",352}, - {""}, {""}, - {"siteId",2012}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"typeOfEnsembleMember",2187}, - {"probContinous",1680}, - {""}, {""}, {""}, {""}, - {"scanPosition",1890}, - {""}, {""}, {""}, - {"numberOfFrequencies",1383}, + {"applicationIdentifier",311}, {""}, {""}, - {"marsIdent",1197}, - {"roundedMarsLevelist",1783}, + {"faModelName",829}, {""}, - {"paramId",1607}, - {"numberOfReservedBytes",1427}, - {"extractedAreaNumberOfSubsets",819}, + {"originalParameterNumber",1523}, {""}, {""}, - {"anoffsetLast",310}, - {"horizontalCoordinateDefinition",923}, - {""}, {""}, {""}, {""}, - {"qnhPresent",1705}, + {"longitudeOfLastGridPoint",1157}, + {""}, {""}, {""}, + {"julianDay",1025}, {""}, {""}, {""}, {""}, - {"defaultStepUnits",660}, + {"localDefNumberTwo",1118}, + {"lengthIncrementForTheGroupLengths",1082}, {""}, {""}, {""}, {""}, - {"yearOfReference",2358}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"originalParameterTableNumber",1523}, + {"referenceValue",1755}, + {"dataRepresentation",623}, + {"forecastPeriodTo",860}, {""}, {""}, {""}, {""}, - {"verticalDomainTemplateNumber",2289}, + {"latitudeLastInDegrees",1044}, {""}, - {"startingAzimuth",2058}, - {"numberOfVerticalGridDescriptors",1447}, + {"internationalDataSubCategory",980}, + {""}, {""}, {""}, {""}, + {"indicatorOfUnitForTimeIncrement",961}, + {"expandedAbbreviations",764}, + {""}, {""}, + {"g2grid",875}, + {"longitudeOfFirstGridPointInDegrees",1155}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"changeDecimalPrecision",408}, + {"sectionPosition",1971}, + {"marsExperimentOffset",1194}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"forecastPeriodFrom",859}, + {"lengthOfIndexTemplate",1085}, + {"floatVal",853}, + {""}, {""}, {""}, {""}, + {"startStepInHours",2057}, + {"ensembleForecastNumbersList",755}, + {""}, {""}, {""}, {""}, + {"dateOfForecastRun",636}, {""}, {""}, {""}, - {"streamOfAnalysis",2074}, + {"falseNorthing",832}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"modelVersionDate",1287}, - {"iIncrement",941}, + {"deleteExtraLocalSection",667}, + {"marsExpver",1195}, + {""}, {""}, {""}, {""}, + {"calendarIdentificationTemplateNumber",378}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"masterTablesVersionNumber",1221}, - {""}, - {"tiggeCentre",2126}, + {"numberOfIntegers",1390}, + {""}, {""}, {""}, {""}, + {"extractSubsetList",818}, + {""}, {""}, {""}, + {"originatingCentre",1526}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"WMO",259}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"scaleFactorOfDistributionFunctionParameter",1847}, + {"parameterIndicator",1616}, + {"numberInTheAuxiliaryArray",1334}, + {"correction3Part",601}, {""}, {""}, - {"corr4Data",594}, - {"roundedMarsLatitude",1782}, - {"reservedNeedNotBePresent",1766}, - {""}, - {"changingPrecision",413}, - {"oneConstant",1498}, + {"rectimeMinute",1742}, {""}, - {"defaultSequence",658}, + {"rectimeHour",1741}, + {""}, {""}, {""}, + {"nameOfSecondFixedSurface",1310}, + {""}, {""}, + {"boustrophedonicOrdering",370}, + {""}, {""}, {""}, + {"driverInformationBlockAddress",694}, {""}, {""}, {""}, {""}, {""}, {""}, - {"expandedCodes",765}, + {"scaleFactorOfSecondFixedSurface",1860}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"significanceOfReferenceTime",2008}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfDataValues",1364}, + {"dataRepresentationType",626}, + {"inputDataPresentIndicator",964}, + {"sizeOfOffsets",2017}, + {"longitudeFirstInDegrees",1146}, + {""}, {""}, {""}, {""}, + {"numberInTheGridCoordinateList",1335}, {""}, {""}, - {"numberOfDistinctSection9s",1374}, - {"tablesMasterDir",2106}, + {"numberOfModels",1401}, {""}, - {"optimisationTime",1513}, - {""}, {""}, - {"numberOfLocalDefinitions",1392}, + {"reserved3",1766}, + {""}, + {"dataRepresentationTemplate",624}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"numberOfDistributionFunctionParameters",1376}, + {"localHour",1125}, + {""}, + {"tablesVersion",2108}, + {""}, + {"westLongitudeOfCluster",2304}, + {""}, + {"bitmapSectionPresent",364}, {""}, {""}, {""}, {""}, {""}, - {"trueLengthOfLastGroup",2170}, - {"minuteOfAnalysis",1268}, + {"secondsOfAnalysis",1920}, + {"typeOfIntervalForFirstAndSecondSize",2193}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"biFourierSubTruncationType",358}, + {""}, + {"section4",1944}, {""}, {""}, {""}, - {"secondDimensionPhysicalSignificance",1902}, + {"typeOfSecondFixedSurface",2203}, + {""}, {""}, + {"groupLeafNodeK",906}, + {""}, {""}, + {"stringValues",2078}, {""}, - {"epsContinous",759}, + {"averagingPeriod",319}, + {""}, {""}, {""}, + {"coordinate1Flag",575}, + {"clusteringMethod",539}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"bufrDataEncoded",371}, {""}, - {"defaultFaLevelName",654}, + {"dataRepresentationTemplateNumber",625}, {""}, - {"totalNumberOfRepetitions",2163}, + {"lengthOfMessage",1086}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfDistinctSection8s",1373}, + {"selectStepTemplateInterval",1992}, + {""}, {""}, {""}, {""}, + {"groupSplittingMethodUsed",909}, + {"floatValues",854}, + {"typicalMinute",2215}, {""}, - {"hourOfReference",933}, - {"biFourierSubTruncationType",358}, - {"dataRepresentationTemplateNumber",625}, - {"targetCompressionRatio",2109}, - {""}, {""}, - {"defaultFaFieldName",653}, + {"typicalHour",2214}, + {""}, + {"widthOfSPD",2310}, {""}, {""}, - {"angleOfRotationInDegrees",304}, + {"directionScalingFactor",682}, + {""}, {""}, {""}, {""}, + {"constantFieldHalfByte",566}, + {"secondsOfReference",1921}, + {"windPresent",2322}, + {""}, {""}, {""}, + {"defaultFaModelName",655}, {""}, {""}, - {"numberOfForecastsInTube",1382}, + {"marsForecastMonth",1196}, {""}, {""}, {""}, {""}, - {"numberOfRows",1428}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"bitmapPresent",363}, + {"nameOfFirstFixedSurface",1309}, + {""}, {""}, {""}, {""}, + {"numberOfDataMatrices",1362}, {""}, - {"corr3Data",593}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"unitOfTimeIncrement",2227}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"typeOfIntervalForFirstAndSecondWavelength",2194}, {""}, - {"scaleValuesBy",1865}, + {"julianForecastDay",1026}, + {""}, {""}, + {"isConstant",990}, {""}, {""}, {""}, {""}, - {"tileClassification",2134}, + {"numberOfReservedBytes",1428}, + {""}, {""}, {""}, {""}, {""}, + {"centuryOfAnalysis",401}, + {""}, + {"aerosolbinnumber",296}, {""}, {""}, {""}, {""}, {""}, {""}, - {"forecastLeadTime",855}, - {"verificationDate",2274}, + {"totalNumberOfdimensions",2168}, + {""}, {""}, + {"CDFstr",23}, + {""}, + {"probabilityType",1684}, + {""}, {""}, {""}, + {"sphericalHarmonics",2048}, + {""}, {""}, + {"productIdentifier",1692}, + {""}, {""}, {""}, {""}, {""}, + {"listMembersUsed",1103}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfForcasts",1378}, - {"numberOfAnalysis",1337}, - {"scaleFactorOfStandardDeviation",1862}, - {"longitudeOfIcosahedronPole",1155}, - {"setCalendarId",1995}, - {"typeOfTimeIncrement",2206}, + {"CDF",22}, + {""}, {""}, {""}, {""}, {""}, + {"lengthOfProjectLocalTemplate",1088}, + {"thresholdIndicator",2126}, + {""}, {""}, + {"totalNumberOfDirections",2159}, {""}, - {"verticalCoordinate",2286}, - {"primaryMissingValueSubstitute",1679}, + {"meaningOfVerticalCoordinate",1259}, {""}, {""}, {""}, - {"NP",183}, + {"inputExtendedDelayedDescriptorReplicationFactor",966}, + {"changingPrecision",413}, + {"radiusInMetres",1715}, {""}, - {"dayOfAnalysis",645}, - {""}, {""}, {""}, {""}, {""}, - {"tileIndex",2135}, - {"scaleFactorOfStandardDeviationInTheCluster",1863}, + {"marsClass",1188}, + {"M",153}, + {""}, {""}, {""}, + {"clusterIdentifier",525}, {""}, {""}, - {"doExtractArea",689}, + {"probabilityTypeName",1685}, {""}, - {"monthOfReference",1295}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"yDirectionGridLengthInMetres",2349}, + {""}, {""}, + {"typeOfFirstFixedSurface",2189}, + {"typeOfHorizontalLine",2192}, {""}, {""}, {""}, - {"crraLocalVersion",611}, - {"angleOfRotationOfProjection",305}, - {"correction1Part",597}, - {"conceptsMasterMarsDir",561}, + {"orientationOfTheGrid",1520}, {""}, {""}, {""}, - {"numberOfPartitions",1407}, + {"centuryOfReference",402}, {""}, {""}, - {"falseNorthing",832}, + {"indicatorOfTypeOfLevel",960}, + {"totalNumberOfTubes",2166}, + {"laplacianScalingFactor",1037}, {""}, {""}, - {"orientationOfTheGrid",1519}, + {"startingAzimuth",2059}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"versionNumberOfGribLocalTables",2284}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"dewPointTemperature",671}, {""}, {""}, {""}, {""}, {""}, - {"secondsOfReference",1920}, + {"doExtractDateTime",690}, + {"monthlyVerificationDate",1297}, {""}, {""}, {""}, {""}, {""}, - {"deletePV",669}, - {""}, {""}, - {"tableReference",2104}, - {""}, - {"forecastProbabilityNumber",861}, - {""}, {""}, {""}, {""}, - {"isEPS",992}, - {"CDFstr",23}, + {"conceptsLocalDirECMF",558}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"DxInMetres",42}, {""}, {""}, {""}, - {"numberOfRemaininChars",1425}, + {"totalNumberOfFrequencies",2161}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"cfVarName",406}, {""}, {""}, {""}, {""}, - {"scaleFactorOfFirstSize",1850}, + {"extraDimensionPresent",785}, + {""}, {""}, + {"conceptsLocalMarsDirAll",559}, + {""}, {""}, + {"endOfProduct",743}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"projectionCenterFlag",1697}, {""}, - {"tsectionNumber4",2174}, + {"secondOrderOfDifferentWidth",1910}, + {""}, {""}, + {"monthlyVerificationTime",1299}, + {"libraryVersion",1098}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"isectionNumber4",1013}, - {""}, - {"orderOfSPD",1517}, + {"predefined_grid",1654}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"numberOfModeOfDistribution",1400}, + {""}, {""}, + {"yDirectionGridLengthInMillimetres",2350}, + {"NR",184}, {""}, {""}, {""}, {""}, - {"versionNumOfRootGroupSymbolTableEntry",2280}, - {"PLPresent",209}, + {"longitudeOfStretchingPole",1165}, + {"projectionCentreFlag",1698}, + {"unitsBias",2231}, + {""}, {""}, {""}, {""}, + {"rdbtimeMinute",1729}, + {""}, + {"rdbtimeHour",1728}, + {"numericValues",1451}, {""}, {""}, {""}, {""}, {""}, - {"totalNumberOfForecastProbabilities",2159}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section9Pointer",1965}, + {"observationType",1456}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"scanPosition",1891}, + {"startOfHeaders",2053}, + {"expandedOriginalWidths",774}, + {""}, {""}, + {"expandedOriginalCodes",771}, + {""}, {""}, + {"parameterCode",1614}, {""}, {""}, {""}, {""}, {""}, - {"missingValueManagement",1277}, - {""}, {""}, {""}, - {"scaleFactorAtReferencePoint",1843}, - {""}, - {"faModelName",829}, - {"missingValuesPresent",1279}, - {"productDefinitionTemplateNumber",1689}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"totalNumberOfFrequencies",2160}, - {"startOfMessage",2053}, + {"distanceFromTubeToEnsembleMean",686}, + {"XR",266}, {""}, {""}, - {"parameterCategory",1612}, + {"qnhPresent",1706}, {""}, {""}, {""}, - {"dateOfForecastRun",636}, - {"nosigPresent",1327}, - {"inputDelayedDescriptorReplicationFactor",965}, + {"extractSubsetIntervalEnd",816}, + {""}, {""}, {""}, + {"bitMapIndicator",361}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"extraValues",788}, + {"numberOfEffectiveValues",1377}, + {""}, {""}, {""}, + {"extractSubsetIntervalStart",817}, + {"dayOfReference",649}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"indicatorOfUnitForTimeRange",962}, {""}, {""}, - {"section8Pointer",1962}, - {"kurt",1031}, + {"iDirectionIncrementInDegrees",940}, + {"jIncrement",1022}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"numberOfMissing",1397}, + {""}, {""}, {""}, {""}, {""}, + {"coordinateIndexNumber",588}, {""}, - {"additionalFlagPresent",293}, - {""}, {""}, {""}, - {"anoffsetFrequency",309}, - {""}, - {"gridPointPosition",903}, + {"expandedOriginalScales",773}, {""}, {""}, {""}, {""}, - {"attributeOfTile",314}, - {"centuryOfReference",402}, - {"masterTablesVersionNumberLatest",1222}, - {""}, {""}, {""}, - {"numberOfDistributionFunctionParameters",1375}, - {"gridDescriptionSectionPresent",901}, - {""}, {""}, {""}, - {"frequencyNumber",869}, - {""}, {""}, - {"perturbationNumber",1636}, - {""}, {""}, {""}, - {"stretchingFactor",2075}, - {"satelliteIdentifier",1840}, - {""}, {""}, {""}, - {"scalingFactorForFrequencies",1889}, + {"listOfModelIdentifiers",1110}, {""}, - {"productDefinitionTemplateNumberInternal",1690}, + {"defaultTypeOfLevel",661}, + {""}, {""}, {""}, + {"missingValue",1277}, {""}, {""}, - {"groupWidth",910}, - {"widthOfFirstOrderValues",2307}, - {"timeDomainTemplate",2138}, + {"identificationOfProject",947}, {""}, - {"modelIdentifier",1285}, + {"integerValues",978}, {""}, - {"kurtosis",1032}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"azimuthalWidth",321}, + {"primaryBitmap",1678}, {""}, {""}, {""}, - {"lengthOfProjectLocalTemplate",1088}, + {"tileClassification",2135}, + {""}, + {"additionalFlagPresent",293}, {""}, {""}, - {"typeOfAuxiliaryInformation",2182}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"orientationOfTheGridInDegrees",1521}, {""}, - {"productionStatusOfProcessedData",1693}, + {"typeOfPostProcessing",2199}, + {""}, {""}, + {"AA",6}, {""}, {""}, {""}, - {"groupLeafNodeK",906}, - {"verticalCoordinateDefinition",2287}, - {""}, - {"numberOfModels",1400}, + {"section9Pointer",1966}, + {""}, {""}, {""}, {""}, {""}, + {"mAngleMultiplier",1185}, {""}, {""}, {""}, {""}, {""}, {""}, - {"expandedOriginalWidths",774}, - {"partitionItems",1621}, - {""}, - {"expandedOriginalCodes",771}, - {"climateDateTo",423}, - {""}, - {"stretchingFactorScaled",2076}, + {"LyInMetres",152}, + {""}, {""}, + {"numberOfRemaininChars",1426}, {""}, - {"defaultTypeOfLevel",661}, - {"section0Pointer",1923}, + {"grib2divider",890}, + {""}, {""}, {""}, + {"is_uerra",1010}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"_T",284}, + {"extractedAreaNumberOfSubsets",819}, + {""}, {""}, {""}, {""}, {""}, + {"offsetSection10",1485}, {""}, - {"originatorLocalTemplate",1527}, + {"shapeOfTheEarth",2001}, {""}, - {"localDefNumberOne",1117}, - {"interpretationOfNumberOfPoints",981}, + {"windSpeedTrend3",2326}, + {"windDirectionTrend3",2315}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"tsectionNumber3",2174}, {""}, {""}, - {"qfePresent",1701}, + {"offsetSection3",1488}, + {"isectionNumber3",1012}, {""}, {""}, {""}, - {"grib3divider",891}, - {""}, {""}, {""}, {""}, - {"secondDimensionCoordinateValueDefinition",1901}, + {"extendedFlag",783}, {""}, - {"typicalCentury",2209}, - {"numberOfPackedValues",1404}, - {""}, {""}, {""}, {""}, {""}, - {"marsGrid",1196}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"typeOfAuxiliaryInformation",2183}, + {""}, {""}, {""}, + {"verticalCoordinate",2287}, {""}, {""}, {""}, {""}, {""}, {""}, - {"latitudeOfLastGridPoint",1052}, + {"simpleThinningMissingRadius",2009}, + {"section0Pointer",1924}, {""}, {""}, {""}, {""}, - {"matchAerosolPacking",1224}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"bufrDataEncoded",371}, - {""}, {""}, - {"spectralDataRepresentationMode",2043}, - {"expandedOriginalScales",773}, - {"M",153}, - {"groupWidths",911}, - {""}, {""}, {""}, - {"corr1Data",591}, + {"short_name",2005}, + {""}, + {"windVariableDirection",2333}, + {"frequencyNumber",869}, {""}, {""}, {""}, - {"scaledValueOfStandardDeviation",1886}, + {"correction4Part",603}, + {"numberOfDistinctSection3s",1369}, {""}, - {"typicalDateTime",2211}, + {"LaR",107}, + {"qfePresent",1702}, + {""}, {""}, + {"_TS",285}, {""}, - {"constituentType",567}, + {"numberOfPartitions",1408}, + {"oneConstant",1499}, + {"tableReference",2105}, {""}, {""}, - {"ITN",93}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"complexPacking",551}, {""}, {""}, - {"scaledValueOfStandardDeviationInTheCluster",1887}, - {""}, {""}, {""}, {""}, - {"twoOrdersOfSPD",2179}, - {"ccccIdentifiers",383}, - {""}, - {"isSatelliteType",998}, + {"verticalCoordinateDefinition",2288}, {""}, - {"keySat",1029}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"keyData",1027}, - {"typeOfPostProcessing",2198}, + {"numberOfOctectsForNumberOfPoints",1402}, + {"LoR",126}, + {""}, {""}, {""}, {""}, + {"section_09",1980}, {""}, - {"PVPresent",211}, + {"targetCompressionRatio",2110}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"centuryOfReferenceTimeOfData",403}, {""}, {""}, - {"numberOfVerticalCoordinateValues",1446}, - {"windSpeedTrend4",2326}, - {"scaleFactorOfRadiusOfSphericalEarth",1858}, + {"cnmc_isac",542}, {""}, - {"julianDay",1025}, - {"orientationOfTheGridInDegrees",1520}, + {"section8Pointer",1963}, + {""}, {""}, + {"numberOfMembersInCluster",1395}, {""}, - {"latitudeOfStretchingPole",1060}, + {"longitudeOfIcosahedronPole",1156}, {""}, {""}, {""}, {""}, - {"CDF",22}, + {"is_aerosol",1000}, + {""}, {""}, {""}, {""}, + {"projectLocalTemplate",1695}, + {""}, {""}, + {"interpretationOfNumberOfPoints",981}, + {""}, {""}, {""}, {""}, {""}, + {"tiggeCentre",2127}, + {"subCentre",2079}, + {""}, {""}, {""}, + {"grib1divider",887}, + {""}, {""}, {""}, + {"lengthOfHeaders",1084}, + {""}, {""}, {""}, {""}, + {"tableCode",2103}, + {"angleOfRotationInDegrees",304}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"easternLongitudeOfDomain",709}, {""}, - {"listMembersUsed",1103}, + {"legBaseDate",1077}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"groupInternalNodeK",905}, + {"longitudeOfLastGridPointInDegrees",1158}, + {"numberOfDistinctSection4s",1370}, + {""}, {""}, {""}, {""}, + {"doExtractSubsets",691}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"modelVersionDate",1288}, + {""}, {""}, + {"cnmc_cmcc",541}, + {"local_use",1143}, {""}, - {"forecastPeriodTo",860}, + {"verticalVisibility",2291}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"compressedData",553}, - {"localSectionPresent",1137}, + {"is_efas",1004}, + {""}, {""}, {""}, + {"latLonValues",1041}, + {"listOfEnsembleForecastNumbers",1109}, + {""}, {""}, {""}, + {"is_chemical",1002}, {""}, - {"endOfProduct",743}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"skewness",2020}, - {""}, {""}, {""}, {""}, - {"scaleFactorOfSecondSize",1860}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"scaledValueOfFirstSize",1874}, + {"expandedOriginalReferences",772}, {""}, - {"heightOrPressureOfLevel",920}, + {"centralLongitude",394}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"legBaseTime",1078}, + {"windSpeedTrend4",2327}, + {"windDirectionTrend4",2316}, {""}, {""}, {""}, {""}, {""}, - {"functionCode",871}, - {""}, {""}, {""}, {""}, - {"conceptsLocalMarsDirAll",559}, - {""}, {""}, {""}, {""}, - {"widthOfSPD",2309}, - {""}, {""}, {""}, - {"scaleFactorOfDistributionFunctionParameter",1846}, - {""}, {""}, {""}, {""}, - {"unknown",2238}, - {""}, {""}, - {"atmosphericChemicalOrPhysicalConstituentType",313}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfEffectiveValues",1376}, + {"reservedNeedNotBePresent",1767}, + {"totalNumberOfTileAttributePairs",2165}, + {"tsectionNumber4",2175}, + {"LcyInMetres",121}, {""}, - {"forecastOrSingularVectorNumber",857}, - {""}, {""}, {""}, {""}, - {"defaultShortName",659}, - {"earthIsOblate",701}, + {"offsetSection4",1489}, + {"isectionNumber4",1013}, + {"scanningModeForOneDiamond",1898}, {""}, - {"md5Data",1232}, + {"latitudeOfFirstGridPoint",1049}, + {"runwayDepositState3",1796}, {""}, - {"unitsOfSecondFixedSurface",2237}, - {"minutesAfterDataCutoff",1273}, - {"extractDateTimeYearStart",814}, - {"upperThreshold",2248}, - {"stepTypeInternal",2070}, - {""}, {""}, {""}, {""}, - {"marsForecastMonth",1195}, + {"gts_header",915}, + {""}, + {"typeOfCompressionUsed",2185}, + {""}, + {"modelVersionTime",1289}, {""}, {""}, {""}, - {"decimalPrecision",651}, - {"latitudeOfSouthernPole",1058}, + {"LuyInMetres",148}, {""}, {""}, - {"standardParallelInMicrodegrees",2051}, - {""}, {""}, {""}, {""}, {""}, - {"gridDefinitionTemplateNumber",900}, - {""}, {""}, {""}, - {"reducedGrid",1743}, - {""}, {""}, {""}, - {"plusOneinOrdersOfSPD",1644}, + {"totalNumberOfForecastProbabilities",2160}, {""}, {""}, - {"extendedFlag",783}, + {"section_8",1990}, + {""}, {""}, + {"centralLongitudeInDegrees",395}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"isCorrection",991}, - {""}, - {"levelIndicator",1093}, - {"binaryScaleFactor",360}, - {""}, - {"DiInDegrees",33}, + {"iScansPositively",943}, {""}, {""}, - {"modelVersionTime",1288}, - {"GTSstr",80}, + {"halfByte",916}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"localDefNumberTwo",1118}, + {"xDirectionGridLengthInMetres",2342}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"decimalPrecision",651}, + {""}, {""}, + {"numberOfOctetsExtraDescriptors",1403}, {""}, - {"numberOfChars",1348}, + {"DjInDegrees",37}, {""}, {""}, - {"packingType",1534}, - {""}, {""}, {""}, - {"listOfModelIdentifiers",1110}, - {"upperThresholdValue",2249}, + {"numberOfVerticalPoints",1449}, {""}, - {"southPoleOnProjectionPlane",2031}, + {"subSetM",2090}, + {"verifyingMonth",2278}, {""}, {""}, {""}, {""}, {""}, {""}, - {"timeDomainTemplateNumber",2139}, + {"bufrHeaderCentre",372}, {""}, {""}, - {"originatingCentre",1525}, + {"forecastMonth",856}, + {""}, {""}, {""}, {""}, {""}, + {"functionCode",871}, + {""}, {""}, {""}, {""}, {""}, + {"componentIndex",552}, {""}, {""}, - {"md5Section9",1246}, - {""}, - {"typeOfCompressionUsed",2184}, + {"localSectionPresent",1137}, {""}, {""}, - {"addExtraLocalSection",292}, - {"g2grid",875}, + {"isotopeIdentificationNumber",1014}, + {""}, {""}, {""}, + {"latitudeOfStretchingPole",1060}, + {""}, {""}, {""}, {""}, + {"is_tigge",1009}, + {"section_08",1979}, + {"scaleFactorOfSecondWavelength",1862}, + {""}, {""}, {""}, + {"modelErrorType",1285}, + {"tigge_name",2133}, + {""}, {""}, {""}, + {"numberOfVerticalCoordinateValues",1447}, + {"scaleFactorAtReferencePoint",1844}, + {""}, {""}, + {"efas_model",713}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"numberOfRows",1429}, + {""}, {""}, + {"bitmapPresent",363}, + {""}, {""}, {""}, {""}, + {"stepInHours",2066}, + {""}, + {"numberOfVerticalGridDescriptors",1448}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"minutesAfterReferenceTimeOfDataCutoff",1275}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"yearOfCentury",2354}, + {"numberOfValues",1446}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"gridCoordinate",896}, - {"md5Section8",1245}, - {"DxInDegrees",41}, + {"consensusCount",563}, + {"xDirectionGridLengthInMillimetres",2343}, {""}, - {"DyInDegrees",44}, + {"md5Data",1233}, + {"scaleFactorOfRadiusOfSphericalEarth",1859}, + {""}, {""}, {""}, {""}, + {"scaleFactorOfFirstWavelength",1852}, + {""}, {""}, {""}, + {"predefined_grid_values",1655}, + {"verificationMonth",2276}, + {"kurt",1031}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"doExtractArea",689}, + {""}, {""}, + {"inputOriginatingCentre",967}, + {"secondDimensionCoordinateValueDefinition",1902}, + {""}, {""}, {""}, + {"runwayDepositState4",1797}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"parameterCategory",1613}, + {"nosigPresent",1328}, + {"keyData",1027}, + {""}, {""}, {""}, {""}, + {"angleOfRotationOfProjection",305}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"plusOneinOrdersOfSPD",1645}, {""}, - {"truncateDegrees",2171}, + {"secondaryBitmap",1913}, + {"matchAerosolPacking",1225}, + {""}, {""}, {""}, + {"_anoffset",286}, + {"significanceOfReferenceDateAndTime",2007}, + {"section3Flags",1939}, + {""}, {""}, {""}, {""}, + {"kurtosis",1032}, {""}, {""}, {""}, - {"numberOfDataMatrices",1361}, + {"runwaySideCodeState3",1836}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"numberOfMembersInEnsemble",1396}, {""}, - {"referenceReflectivityForEchoTop",1751}, + {"offsetAfterBitmap",1464}, {""}, - {"lengthOfMessage",1086}, + {"dataCategory",617}, + {"isEPS",992}, + {"extractDateTimeYearEnd",812}, {""}, - {"mAngleMultiplier",1184}, + {"spatialProcessing",2042}, {""}, {""}, {""}, {""}, {""}, - {"spatialProcessing",2041}, - {""}, {""}, - {"unitsConversionOffset",2231}, - {"windGust",2316}, - {""}, {""}, {""}, - {"monthlyVerificationMonth",1297}, + {"marsStream1",1213}, + {"keySat",1029}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"updateSequenceNumber",2246}, + {""}, {""}, {""}, + {"totalNumberOfIterations",2163}, {""}, - {"rootTablesDir",1781}, - {""}, - {"numberOfPoints",1408}, + {"setCalendarId",1996}, + {"epsContinous",759}, + {"secondaryBitmapPresent",1914}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"corr2Data",592}, + {"matrixOfValues",1230}, + {"typeOfSizeInterval",2204}, {""}, - {"dayOfReference",649}, + {"conceptsMasterMarsDir",561}, + {""}, {""}, {""}, {""}, + {"gts_ddhh00",914}, + {"correction1",596}, + {"dirty_statistics",683}, {""}, {""}, - {"endOfFileAddress",739}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"shapeOfVerificationArea",2001}, + {"md5Section9",1247}, + {""}, {""}, + {"LxInMetres",150}, + {""}, {""}, {""}, {""}, {""}, + {"typeOfEnsembleMember",2188}, {""}, {""}, {""}, - {"baseTimeEPS",328}, - {""}, - {"grib1divider",887}, + {"westernLongitudeOfDomain",2307}, + {"numberOfForecastsInEnsemble",1381}, + {"flagForAnyFurtherInformation",848}, {""}, {""}, {""}, - {"skew",2019}, - {""}, {""}, {""}, {""}, {""}, - {"totalNumberOfTileAttributePairs",2164}, - {""}, {""}, - {"updateSequenceNumber",2245}, - {""}, {""}, {""}, {""}, - {"listOfDistributionFunctionParameter",1108}, - {"endOfInterval",741}, + {"numberOfChars",1349}, + {"trueLengthOfLastGroup",2171}, {""}, - {"scaleFactorOfLowerLimit",1854}, - {"DiGiven",32}, + {"expandBy",763}, + {"correction3",600}, + {"heightOrPressureOfLevel",920}, + {""}, {""}, {""}, {""}, {""}, + {"earthMinorAxisInMetres",705}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"P",206}, + {""}, + {"projectLocalTemplateNumber",1696}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"dayOfEndOfOverallTimeInterval",646}, + {""}, {""}, {""}, {""}, + {"indexedStorageInternalNodeK",956}, + {"expandedCodes",765}, + {""}, {""}, {""}, {""}, {"localNumberOfObservations",1134}, - {"GTS",79}, - {"AA",6}, + {"coordinate3Flag",580}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"versionNumberOfExperimentalSuite",2283}, + {""}, {""}, {""}, {""}, {""}, + {"presentTrend3",1659}, + {"centralClusterDefinition",393}, + {"scaleFactorOfDistanceFromEnsembleMean",1846}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"correction2Part",599}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"coordinate1End",574}, + {"secondaryBitmaps",1915}, + {""}, {""}, + {"addExtraLocalSection",292}, {""}, - {"subSetM",2089}, - {"originatorLocalTemplateNumber",1528}, - {""}, - {"centralLongitude",394}, + {"implementationDateOfModelCycle",952}, + {""}, {""}, + {"extraLocalSectionPresent",787}, {""}, {""}, - {"totalLength",2154}, + {"longitudeOfTangencyPoint",1169}, {""}, - {"predefined_grid",1653}, - {""}, {""}, {""}, - {"incrementOfLengths",953}, - {"significanceOfReferenceTime",2007}, - {""}, {""}, {""}, - {"JS",95}, + {"longitudeOfStretchingPoleInDegrees",1166}, + {"startOfRange",2055}, {""}, {""}, - {"correction2Part",599}, - {"scaledValueOfRadiusOfSphericalEarth",1882}, - {"paleontologicalOffset",1605}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"sizeOfOffsets",2016}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"tsectionNumber5",2175}, - {""}, {""}, {""}, {""}, {""}, - {"lowerThreshold",1179}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"scanningModeForOneDiamond",1897}, + {"numberOfMissingInStatisticalProcess",1398}, + {""}, {""}, {""}, {""}, + {"messageLength",1261}, + {"md5Section8",1246}, {""}, - {"numberOfMembersInCluster",1394}, + {"numberOfPoints",1409}, {""}, - {"formatVersionMajorNumber",865}, + {"runwaySideCodeState4",1837}, {""}, - {"numberOfCharacters",1347}, - {"scaledValueOfSecondSize",1884}, - {"sampleSizeOfModelClimate",1838}, - {"projectionCenterFlag",1696}, + {"changeIndicatorTrend3",411}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"defaultFaModelName",655}, + {""}, + {"sfc_levtype",2000}, {""}, {""}, - {"numberOfColumns",1355}, - {"baseDateEPS",326}, + {"standardParallelInMicrodegrees",2052}, + {"doSimpleThinning",692}, + {"paleontologicalOffset",1606}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfMembersInEnsemble",1395}, + {"forecastProbabilityNumber",861}, {""}, - {"longitudeOfFirstGridPoint",1153}, + {"numberOfCharacters",1348}, {""}, {""}, - {"scaledValueOfDistributionFunctionParameter",1870}, + {"secondaryBitmapsCount",1916}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"extraLocalSectionNumber",786}, {""}, {""}, {""}, {""}, - {"longitudeOfNorthWestCornerOfArea",1158}, + {"isCorrection",991}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"tablesVersionLatest",2109}, {""}, {""}, + {"upperThreshold",2249}, + {""}, {""}, + {"stepRangeInHours",2068}, + {""}, + {"rangeBinSpacing",1720}, + {""}, {""}, {""}, {""}, {""}, {"coordinate1Start",576}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"endDayTrend1",720}, {""}, {""}, - {"numberOfIterations",1391}, - {"lowerThresholdValue",1180}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"md5Structure",1247}, - {""}, {""}, {""}, {""}, - {"secondOfModelVersion",1907}, + {"extractDateTimeHourEnd",799}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"BufrTemplate",20}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"probContinous",1681}, + {""}, + {"changeIndicatorTrend4",412}, + {"referenceOfWidths",1751}, + {"offsetBeforeData",1474}, + {"originalParameterTableNumber",1524}, + {""}, + {"endDayTrend3",722}, + {""}, {""}, + {"extractDateTimeMinuteEnd",802}, + {""}, {""}, {""}, + {"LcxInMetres",119}, + {"totalInitialConditions",2154}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"md5Structure",1248}, + {""}, {""}, {""}, + {"extractDateTimeMinuteStart",804}, + {""}, {""}, + {"LuxInMetres",146}, + {"coordAveragingTims",573}, + {""}, {""}, {""}, + {"endStepInHours",746}, {""}, {""}, - {"minuteOfModelVersion",1271}, - {"offsetAfterLocalSection",1466}, + {"skewness",2021}, {""}, - {"indicatorOfTypeOfLevel",960}, - {"easternLongitudeOfDomain",709}, + {"extractDateTimeMonthEnd",805}, + {""}, + {"cloudsTitle1",505}, + {"averaging2Flag",318}, {""}, {""}, {""}, - {"messageLength",1260}, + {"presentTrend4",1660}, + {""}, {""}, {""}, + {"yearOfCentury",2355}, {""}, {""}, - {"integerPointValues",974}, - {""}, {""}, {""}, {""}, - {"significanceOfReferenceDateAndTime",2006}, + {"coordAveraging0",569}, + {"param_value_min",1611}, + {""}, + {"extractDateTimeMonthStart",807}, {""}, - {"timeIncrement",2140}, + {"timeRangeIndicator",2147}, + {""}, {""}, + {"timeCoordinateDefinition",2138}, + {""}, {""}, {""}, {""}, {""}, + {"flagForIrregularGridCoordinateList",849}, + {"cloudsTitle3",515}, + {""}, + {"LIMITS",99}, + {""}, + {"section3Padding",1941}, + {"referenceReflectivityForEchoTop",1752}, + {""}, + {"totalNumberOfRepetitions",2164}, + {"unknown",2239}, {""}, - {"scaleFactorOfSecondFixedSurface",1859}, - {"numberInTheAuxiliaryArray",1333}, + {"operationalForecastCluster",1513}, {""}, - {"powerOfTenUsedToScaleClimateWeight",1648}, + {"numberOfDataValues",1365}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"is_aerosol_optical",1001}, + {""}, {""}, {""}, + {"diffInHours",675}, {""}, + {"secondLatitudeInDegrees",1905}, + {""}, + {"listOfContributingSpectralBands",1107}, + {""}, {""}, + {"Experiment_Identifier",56}, + {""}, {""}, {""}, + {"endOfMessage",742}, + {""}, {""}, {""}, {"extractDateTimeStart",811}, {""}, {""}, {""}, {""}, {""}, - {"tablesLocalDir",2105}, + {"lsdate_bug",1183}, + {""}, {""}, {""}, {""}, {""}, + {"packingType",1535}, + {"earthMajorAxis",702}, + {"typeOfOriginalFieldValues",2197}, + {"gridCoordinate",896}, {""}, {""}, - {"scaleFactorOfDistanceFromEnsembleMean",1845}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"extractDateTimeSecondEnd",808}, - {""}, {""}, - {"expandedOriginalReferences",772}, - {""}, - {"unpackedSubsetPrecision",2241}, - {"biFourierResolutionParameterN",355}, - {""}, {""}, {""}, {""}, - {"directionScalingFactor",682}, + {""}, {""}, {""}, {""}, {""}, + {"cloudsTitle1Trend3",508}, + {""}, {""}, {""}, {""}, {""}, + {"originatingCentreOfAnalysis",1527}, + {""}, {""}, {""}, {""}, {""}, + {"extractDateTimeSecondStart",810}, {""}, - {"longitudeFirstInDegrees",1146}, + {"longitudeOfTheSouthernPoleOfProjection",1173}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"shapeOfVerificationArea",2002}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"scaledValueOfFirstSize",1875}, {""}, {""}, {""}, {""}, - {"extractDateTimeSecondStart",810}, + {"longitudeOfThePoleOfStretching",1170}, {""}, {""}, - {"is_uerra",1010}, + {"md5TimeDomainSection",1249}, + {""}, + {"BOX",17}, + {"section4Padding",1946}, + {"XRInMetres",267}, + {""}, {""}, {""}, + {"offsetBSection9",1472}, + {"averaging1Flag",317}, {""}, {""}, {""}, {""}, {""}, {""}, - {"secondLatitudeInDegrees",1904}, - {"_T",284}, + {"primaryMissingValue",1679}, {""}, {""}, {""}, {""}, - {"unsignedIntegers",2243}, + {"Lar2InDegrees",112}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"TIDE",231}, + {""}, + {"Lor2InDegrees",144}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"clutterFilterIndicator",540}, + {"clusterMember10",527}, {""}, - {"unitsConversionScaleFactor",2232}, - {"LaDInDegrees",106}, - {"unexpandedDescriptors",2223}, + {"frequencyScalingFactor",870}, {""}, - {"northernLatitudeOfClusterDomain",1325}, - {""}, {""}, - {"numberOfForecastsInEnsemble",1380}, + {"endMinuteTrend3",733}, {""}, {""}, {""}, - {"extractDateTimeHourStart",801}, + {"timeRangeIndicatorFromStepRange",2148}, + {"cloudsTitle1Trend4",509}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"clusterMember3",529}, + {"n2",1304}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"LoVInDegrees",128}, + {"is_chemical_distfn",1003}, {""}, {""}, {""}, {""}, - {"centralLongitudeInDegrees",395}, - {""}, {""}, - {"unpackedValues",2242}, + {"jDirectionIncrement",1018}, {""}, {""}, - {"predefined_grid_values",1654}, - {""}, {""}, {""}, {""}, {""}, - {"groupLengths",907}, - {"short_name",2004}, - {"listMembersMissing",1099}, + {"numberIncludedInAverage",1336}, + {"md5DataSection",1234}, {""}, - {"secondsOfAnalysis",1919}, - {"periodOfTimeIntervals",1635}, + {"numberOfDataPoints",1363}, + {""}, {""}, {""}, + {"numberOfLogicals",1394}, + {"typicalCentury",2210}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"sp2",2036}, {""}, {""}, {""}, {""}, - {"grib2divider",890}, - {"section_8",1989}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"tiggeLAMName",2127}, - {""}, - {"typeOfSizeInterval",2203}, - {""}, - {"verticalVisibilityCoded",2291}, - {""}, - {"azimuthalWidth",321}, + {"referenceValueError",1756}, {""}, {""}, {""}, - {"backgroundProcess",323}, - {"referenceOfWidths",1750}, - {"correction3Part",601}, + {"scaledValueOfStandardDeviation",1887}, {""}, - {"southernLatitudeOfClusterDomain",2032}, - {"latitudeOfSubSatellitePoint",1062}, - {""}, {""}, {""}, {""}, {""}, - {"cnmc_isac",542}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"unexpandedDescriptorsEncoded",2224}, - {"latitudeOfSubSatellitePointInDegrees",1063}, + {"primaryMissingValueSubstitute",1680}, + {"latitudeOfFirstGridPointInDegrees",1050}, {""}, - {"laplacianScalingFactor",1037}, - {"is_aerosol",1000}, - {"projectionCentreFlag",1697}, - {"SecondOfModelVersion",224}, - {""}, {""}, {""}, - {"normAtInitialTime",1317}, - {""}, {""}, {""}, - {"scaledValueOfLowerLimit",1878}, - {""}, {""}, - {"northLatitudeOfCluster",1319}, + {"masterTablesVersionNumber",1222}, {""}, {""}, {""}, {""}, {""}, - {"is_tigge",1009}, - {"eastLongitudeOfCluster",706}, - {"dayOfEndOfOverallTimeInterval",646}, - {""}, {""}, {""}, {""}, - {"tigge_name",2132}, - {"typeOfGrid",2190}, - {"gts_header",915}, - {"offsetAfterPadding",1467}, + {"secondaryMissingValue",1918}, + {""}, {""}, + {"spare2",2041}, {""}, {""}, {""}, {""}, - {"componentIndex",552}, - {"preProcessingParameter",1650}, - {"extremeClockwiseWindDirection",821}, + {"scaledValueOfStandardDeviationInTheCluster",1888}, {""}, {""}, {""}, - {"gribDataQualityChecks",892}, - {""}, {""}, {""}, {""}, - {"numberOfDataPoints",1362}, - {"qnhAPresent",1704}, - {"section_09",1979}, + {"scaledValueOfFirstFixedSurface",1874}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"crraLocalVersion",611}, {""}, {""}, - {"longitudeOfCenterPointInDegrees",1149}, - {""}, {""}, {""}, - {"scaleFactorOfFirstFixedSurface",1849}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"centuryOfAnalysis",401}, - {""}, - {"monthOfModelVersion",1294}, + {"monthOfModelVersion",1295}, {""}, {""}, - {"inputShortDelayedDescriptorReplicationFactor",970}, - {"calendarIdPresent",376}, - {"cnmc_cmcc",541}, - {"local_use",1143}, - {""}, {""}, {""}, {""}, - {"southLatitudeOfCluster",2029}, + {"gridPointPosition",903}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"Lar1InDegrees",110}, + {"numberOfColumns",1356}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"lengthOfTimeRange",1089}, + {""}, {""}, {""}, + {"latitudeOfCentralPointInClusterDomain",1046}, + {""}, {""}, {""}, + {"Lor1InDegrees",142}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"biFourierCoefficients",351}, + {""}, {""}, {""}, + {"epsStatisticsContinous",761}, {""}, {""}, - {"integerScalingFactorAppliedToDirections",976}, - {"integerScalingFactorAppliedToFrequencies",977}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"md5DataSection",1233}, + {"section9Length",1965}, {""}, {""}, - {"lengthOfIndexTemplate",1085}, - {"is_chemical",1002}, + {"lowerThreshold",1180}, + {""}, {""}, {""}, {""}, {""}, + {"longitudeOfNorthWestCornerOfArea",1159}, {""}, - {"startOfRange",2054}, + {"NP",183}, {""}, - {"centuryOfReferenceTimeOfData",403}, + {"scaleValuesBy",1866}, {""}, - {"westernLongitudeOfDomain",2306}, + {"latitudeOfStretchingPoleInDegrees",1061}, {""}, - {"extractSubsetIntervalEnd",816}, - {"numberOfInts",1390}, - {""}, {""}, {""}, {""}, {""}, - {"section_08",1978}, + {"numberOfForecastsInCluster",1380}, + {"scaledValueOfSecondSize",1885}, + {""}, {""}, {""}, {""}, + {"widthOfLengths",2309}, {""}, {""}, {""}, {""}, {""}, - {"forecastMonth",856}, - {"climateDateFrom",422}, - {"identificationOfProject",947}, + {"section3Pointer",1942}, + {""}, + {"sampleSizeOfModelClimate",1839}, {""}, {""}, - {"extractSubsetIntervalStart",817}, - {""}, {""}, {""}, - {"inputOriginatingCentre",967}, + {"secondOfModelVersion",1908}, {""}, {""}, - {"basicAngleOfTheInitialProductionDomain",330}, - {""}, - {"shortNameECMF",2003}, - {"extractDateTimeYearEnd",812}, + {"minuteOfModelVersion",1272}, + {""}, {""}, {""}, {""}, + {"dummy2",697}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"qualityControl",1707}, - {"simpleThinningSkip",2009}, + {"numberOfBits",1339}, {""}, {""}, {""}, {""}, {""}, {""}, - {"observationType",1455}, + {"skew",2020}, + {""}, + {"Dj",35}, + {"La1InDegrees",103}, {""}, {""}, - {"numberOfCoordinatesValues",1359}, - {""}, {""}, {""}, {""}, - {"diffInDays",674}, + {"beginDayTrend3",333}, {""}, - {"numberOfCategories",1346}, - {"verifyingMonth",2277}, + {"numberOfDistinctSection6s",1372}, + {"endMinuteTrend4",734}, + {""}, + {"extractDateTimeEnd",798}, + {"section0Length",1923}, + {""}, {""}, {""}, + {"tiggeLAMName",2128}, + {"coordinate4Flag",583}, {""}, {""}, - {"numberOfClusters",1351}, - {"conceptsLocalDirECMF",558}, - {"referenceValueError",1755}, - {"normAtFinalTime",1316}, + {"Lo1InDegrees",124}, + {"clusterMember4",530}, + {"distinctLongitudes",688}, + {"resolutionAndComponentFlags",1772}, + {"listMembersMissing",1099}, + {"SecondOfModelVersion",224}, + {"marsType2",1217}, {""}, - {"gridDefinitionSection",899}, + {"numberOfCategories",1347}, + {""}, + {"mBasicAngle",1186}, + {""}, {""}, + {"section2Present",1937}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"shortNameECMF",2004}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"lengthOfOriginatorLocalTemplate",1087}, + {""}, {""}, {""}, + {"extremeClockwiseWindDirection",821}, + {"endOfHeadersMarker",740}, {""}, {""}, {""}, {""}, - {"parameterIndicator",1615}, + {"section8Length",1962}, {""}, {""}, - {"endMinuteTrend4",734}, + {"extractAreaEastLongitude",789}, + {"section4Pointer",1947}, + {"numberOfDataBinsAlongRadials",1361}, + {"numberOfTimeRange",1437}, + {""}, {""}, {""}, {""}, + {"northernLatitudeOfClusterDomain",1326}, {""}, {""}, - {"isHindcast",995}, + {"reserved2",1765}, + {"correction4",602}, {""}, - {"scaledValueOfSecondFixedSurface",1883}, + {"windVariableDirectionTrend3",2336}, {""}, - {"longitudeOfStretchingPoleInDegrees",1165}, - {""}, {""}, {""}, {""}, {""}, - {"rootGroupObjectHeaderAddress",1779}, + {"longitudeOfFirstDiamondCenterLine",1151}, + {""}, + {"longitudeOfFirstDiamondCentreLine",1152}, + {"twoOrdersOfSPD",2180}, {""}, {""}, {""}, - {"thisMarsClass",2119}, + {"section10Pointer",1927}, + {""}, {""}, {""}, {""}, {"latitudeOfNorthWestCornerOfArea",1054}, - {"scaledValueOfDistanceFromEnsembleMean",1869}, - {"unpackedError",2240}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"packedValues",1532}, - {"table2Version",2101}, - {""}, {""}, {""}, - {"numberOfCodedValues",1352}, - {"totalNumberOfClusters",2156}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfGroups",1386}, - {"WMO",259}, - {"_TS",285}, + {"longitudeOfFirstDiamondCentreLineInDegrees",1153}, + {""}, {""}, {""}, {""}, {""}, + {"typeOfCalendar",2184}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"lsdate_bug",1182}, - {""}, {""}, - {"packingError",1533}, + {""}, {""}, {""}, + {"DjInMetres",38}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"tiggeSuiteID",2131}, + {"sp1",2035}, {""}, - {"DiInMetres",34}, - {"correction4Part",603}, - {""}, {""}, - {"biFourierResolutionSubSetParameterN",357}, - {""}, {""}, - {"verificationMonth",2275}, - {""}, {""}, - {"referenceOfLengths",1749}, + {"ijDirectionIncrementGiven",951}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"extractDateTimeMinuteEnd",802}, + {"southernLatitudeOfClusterDomain",2033}, + {"centreForTable2",400}, {""}, {""}, {""}, - {"unitOfOffsetFromReferenceTime",2225}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"longitudeOfThePoleOfStretching",1169}, - {""}, {""}, - {"accumulationInterval",289}, - {"extractDateTimeMinuteStart",804}, + {"numberOfForecastsInTheCluster",1382}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"qnhAPresent",1705}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"gribDataQualityChecks",892}, {""}, {""}, {""}, {""}, - {"westLongitudeOfCluster",2303}, - {"totalNumberOfDataValuesMissingInStatisticalProcess",2157}, - {"extractDateTimeMonthEnd",805}, + {"default_max_val",662}, + {"monthlyVerificationMonth",1298}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"DxInMetres",42}, - {""}, - {"DyInMetres",45}, - {""}, - {"numberOfComponents",1356}, - {"epsStatisticsContinous",761}, - {""}, - {"extractDateTimeMonthStart",807}, - {""}, - {"LoVInDegrees",128}, - {""}, - {"longitudeOfThePolePoint",1170}, - {""}, {""}, {""}, {""}, {""}, - {"rectimeHour",1740}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"windVariableDirectionTrend4",2337}, + {""}, {""}, {""}, + {"latitudeLongitudeValues",1045}, + {""}, {""}, {""}, {""}, + {"section1",1925}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"g1conceptsMasterDir",874}, - {"xCoordinateOfOriginOfSectorImage",2338}, - {""}, - {"yCoordinateOfOriginOfSectorImage",2345}, + {"formatVersionMajorNumber",865}, {""}, - {"md5Product",1236}, + {"bufrdcExpandedDescriptors",375}, + {""}, {""}, {""}, {""}, + {"beginDayTrend4",334}, + {"missingValueManagement",1278}, {""}, {""}, {""}, {""}, - {"typeOfCalendar",2183}, - {"numberOfTimeRange",1436}, + {"PLPresent",209}, {""}, {""}, - {"is_efas",1004}, - {""}, - {"projectLocalTemplate",1694}, + {"g1conceptsMasterDir",874}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"swapScanningLat",2095}, + {""}, {""}, {""}, {""}, + {"sectionLengthLimitForEnsembles",1968}, + {""}, {""}, {""}, {""}, + {"unitsConversionOffset",2232}, + {"tigge_short_name",2134}, + {"thisMarsClass",2120}, {""}, {""}, - {"extractAreaNorthLatitude",792}, - {"distinctLongitudes",688}, + {"swapScanningLon",2096}, + {""}, {""}, {""}, + {"boot_edition",367}, {""}, - {"rdbtimeHour",1727}, - {"section4",1943}, + {"inputProcessIdentifier",969}, {""}, - {"typeOfPreProcessing",2199}, - {""}, {""}, {""}, - {"section9Length",1964}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"resolutionAndComponentFlags",1771}, + {"versionNumOfRootGroupSymbolTableEntry",2281}, {""}, - {"offsetAfterCentreLocalSection",1464}, - {"longitudeOfSouthEastCornerOfArea",1161}, - {""}, {""}, {""}, - {"scaledValueOfFirstFixedSurface",1873}, - {""}, {""}, - {"localHour",1125}, - {"param_value_min",1610}, + {"reservedSection3",1770}, {""}, - {"section10Pointer",1926}, + {"northWestLongitudeOfVerficationArea",1325}, {""}, {""}, - {"distanceFromTubeToEnsembleMean",686}, - {""}, {""}, {""}, {""}, {""}, - {"simpleThinningStart",2010}, - {"NC",174}, + {"dummy1",696}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"monthOfEndOfOverallTimeInterval",1293}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"NV",188}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"resolutionAndComponentFlags8",1779}, + {"scanningMode4",1893}, {""}, - {"section8Length",1961}, + {"qualityControl",1708}, {""}, {""}, {""}, - {"numberOfLogicals",1393}, - {"numberMissingFromAveragesOrAccumulations",1336}, - {""}, - {"thresholdIndicator",2125}, + {"section1Flags",1930}, + {"endDayTrend4",723}, + {""}, {""}, {""}, {""}, + {"marsType1",1216}, + {"latitudeOfSouthernPole",1058}, + {""}, {""}, {""}, + {"stepUnits",2072}, {""}, {""}, - {"resolutionAndComponentFlags8",1778}, - {""}, - {"md5TimeDomainSection",1248}, + {"scaleFactorOfLowerLimit",1855}, {""}, {""}, {""}, - {"LxInMetres",150}, - {"METARstr",155}, - {"LyInMetres",152}, - {"referenceForGroupWidths",1748}, + {"yearOfEndOfOverallTimeInterval",2356}, + {""}, {""}, {""}, {""}, + {"numberOfComponents",1357}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"flagShowingPostAuxiliaryArrayInUse",851}, {""}, - {"postAuxiliaryArrayPresent",1647}, + {"gribMasterTablesVersionNumber",893}, + {"scaledValueOfDistributionFunctionParameter",1871}, + {""}, {""}, + {"matchAerosolBinNumber",1224}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"totalLength",2155}, {""}, {""}, {""}, {""}, - {"keyMore",1028}, - {"Yo",279}, - {"doSimpleThinning",692}, + {"numberOfClusters",1352}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"reserved1",1764}, + {"scaledValueOfSecondFixedSurface",1884}, + {"section10Length",1926}, {""}, {""}, - {"Yp",280}, + {"cloudsTitle4",520}, {""}, {""}, - {"indicatorOfUnitForTimeRange",962}, - {"n3",1304}, + {"backgroundProcess",323}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"jDirectionIncrement",1018}, - {""}, {""}, {""}, {""}, {""}, - {"latitudinalDirectionGridLength",1074}, - {"lengthOfTimeRange",1089}, - {""}, {""}, {""}, {""}, - {"clusteringDomain",538}, - {""}, - {"subdivisionsOfBasicAngle",2091}, - {"secondOrderOfDifferentWidth",1909}, - {""}, - {"coordinate2Start",579}, - {"typicalHour",2213}, - {"radiusInMetres",1714}, - {""}, - {"sp3",2036}, - {""}, {""}, {""}, {""}, {""}, - {"numberOfRepresentativeMember",1426}, + {"changeIndicatorTrend2",410}, {""}, {""}, {""}, - {"projectLocalTemplateNumber",1695}, + {"radiusOfCentralCluster",1716}, + {""}, {""}, {""}, + {"gridDescriptionSectionPresent",901}, {""}, {""}, {""}, - {"southEastLatitudeOfVerficationArea",2026}, + {"N2",171}, + {"latitudeOfTangencyPoint",1064}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"totalNumberOfDataValuesMissingInStatisticalProcess",2158}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"hourOfEndOfOverallTimeInterval",930}, + {""}, + {"realPartOf00",1735}, + {""}, + {"secondaryMissingValueSubstitute",1919}, {""}, {""}, - {"iDirectionIncrementInDegrees",940}, + {"table2Version",2102}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"X2",264}, + {""}, {""}, {""}, {""}, {""}, + {"local_padding",1142}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"section6",1953}, {""}, {""}, {""}, - {"efas_model",713}, + {"totalAerosolBinsNumbers",2153}, + {"fileConsistencyFlags",838}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"SOH",221}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfOctetsExtraDescriptors",1402}, + {"cloudsAbbreviation3",435}, {""}, {""}, {""}, {""}, - {"dirty_statistics",683}, - {""}, {""}, - {"sectionLengthLimitForEnsembles",1967}, - {"section0Length",1922}, + {"marsGrid",1197}, {""}, {""}, {""}, - {"referenceForGroupLengths",1747}, - {""}, {""}, - {"latitudeLongitudeValues",1045}, - {""}, {""}, {""}, {""}, - {"numberOfIntegers",1389}, - {""}, {""}, - {"totalNumberOfIterations",2162}, + {"codedNumberOfFirstOrderPackedValues",545}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"beginMinuteTrend3",341}, + {""}, {""}, {""}, {""}, {""}, + {"recentWeather",1737}, {""}, {""}, {""}, - {"earthMajorAxis",702}, - {"numberOfForecastsInCluster",1379}, + {"is_ocean3d_param",1006}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"changeIndicatorTrend1",409}, {""}, - {"sphericalHarmonics",2047}, - {"NEAREST",177}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"LoV",127}, {""}, {""}, {""}, {""}, {""}, - {"stepForClustering",2064}, - {""}, {""}, - {"southEastLatitudeOfLPOArea",2025}, - {""}, {""}, - {"gts_ddhh00",914}, + {"productionStatusOfProcessedData",1694}, {""}, - {"dimensionType",678}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfGroupsOfDataValues",1387}, - {""}, {""}, {""}, {""}, {""}, - {"numberOfDistinctSection4s",1369}, - {""}, {""}, - {"extractDateTimeHourEnd",799}, + {"stepForClustering",2065}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"cavokOrVisibility",382}, - {"GDSPresent",69}, + {""}, {""}, {""}, + {"numberMissingFromAveragesOrAccumulations",1337}, {""}, {""}, - {"rdbtimeYear",1732}, - {""}, - {"formatVersionMinorNumber",866}, + {"northWestLatitudeOfLPOArea",1322}, + {"section2Padding",1935}, + {"localExtensionPadding",1122}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"parametersVersion",1620}, - {""}, - {"firstDimensionPhysicalSignificance",841}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"localYear",1141}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"typeOfPreProcessing",2200}, + {"Nj",195}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"GTSstr",80}, + {""}, {""}, + {"spatialSmoothingOfProduct",2043}, + {""}, {""}, + {"compressedData",553}, + {""}, {""}, + {"beginMinuteTrend4",342}, + {""}, + {"windSpeedTrend2",2325}, + {"windDirectionTrend2",2314}, + {""}, {""}, {""}, {""}, {""}, + {"coordinate2Flag",578}, {""}, {""}, {""}, - {"widthOfLengths",2308}, - {""}, {""}, {""}, - {"legacyGaussSubarea",1080}, - {"numberOfClusterLowResolution",1350}, + {"cloudsTitle1Trend2",507}, + {"offsetSection2",1487}, + {"isectionNumber2",1011}, + {"La2",104}, {""}, {""}, {""}, - {"earthMinorAxisInMetres",705}, + {"GTS",79}, + {""}, {""}, {""}, {""}, {""}, + {"Lar2",111}, + {""}, + {"numberOfDistinctSection7s",1373}, {""}, {""}, - {"timeRangeIndicator",2146}, + {"Latin2",116}, + {""}, + {"Lo2",125}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"Lor2",143}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"swapScanningLon",2095}, + {"swapScanningX",2097}, {""}, {""}, {""}, - {"numberOfDistinctSection3s",1368}, + {"masterTablesVersionNumberLatest",1223}, {""}, {""}, {""}, {""}, {""}, - {"LcxInMetres",119}, - {""}, - {"LcyInMetres",121}, - {"directionOfVariation",681}, + {"N1",170}, + {"offsetEndSection4",1478}, {""}, {""}, - {"is_aerosol_optical",1001}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"southEastLongitudeOfVerficationArea",2028}, + {"DiGiven",32}, {""}, {""}, - {"sectionLengthLimitForProbability",1968}, - {"LuxInMetres",146}, - {"indexedStorageInternalNodeK",956}, - {"LuyInMetres",148}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"is_chemical_distfn",1003}, - {"spatialSmoothingOfProduct",2042}, + {"coordinate3OfLastGridPoint",582}, {""}, {""}, {""}, {""}, {""}, - {"reserved3",1765}, - {""}, - {"typicalYear",2218}, - {""}, {""}, - {"perturbedType",1637}, - {"swapScanningLat",2094}, + {"firstMonthUsedToBuildClimateMonth2",845}, {""}, {""}, {""}, {""}, {""}, - {"numberOfForecastsInTheCluster",1381}, - {""}, {""}, - {"totalInitialConditions",2153}, - {"sizeOfPostAuxiliaryArray",2017}, - {""}, - {"uuidOfVGrid",2257}, - {""}, - {"percentileValue",1633}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"secondaryMissingValue",1917}, + {"cloudsAbbreviation4",440}, {""}, {""}, {""}, - {"TIDE",231}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"driverInformationBlockAddress",694}, - {"productIdentifier",1691}, + {"groupLengths",907}, + {"section1Padding",1932}, + {""}, {""}, + {"versionOfModelClimate",2286}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"constantFieldHalfByte",566}, + {"secondaryBitMap",1912}, {""}, {""}, - {"grib2LocalSectionPresent",889}, - {"groupInternalNodeK",905}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"experimentVersionNumber",777}, - {""}, {""}, {""}, - {"section2Present",1936}, + {"numberOfPackedValues",1405}, + {"sectionLengthLimitForProbability",1969}, {""}, - {"multiplicationFactorForLatLong",1300}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"clusterIdentifier",525}, + {"windUnits",2328}, {""}, - {"observationGeneratingProcessIdentifier",1454}, - {"section4Pointer",1946}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"headersOnly",918}, - {""}, {""}, - {"METAR",154}, + {"X1",262}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"centralLongitudeInMicrodegrees",396}, {""}, - {"boot_edition",367}, + {"postAuxiliaryArrayPresent",1648}, + {"keyMore",1028}, + {""}, {""}, {""}, + {"secondaryBitmapsSize",1917}, + {""}, {""}, {""}, {""}, + {"secondOfEndOfOverallTimeInterval",1906}, {""}, {""}, - {"oceanAtmosphereCoupling",1458}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"lengthOfOriginatorLocalTemplate",1087}, + {"minuteOfEndOfOverallTimeInterval",1270}, + {"longitudeOfSubSatellitePoint",1167}, {""}, {""}, - {"radiusOfCentralCluster",1715}, - {""}, - {"iDirectionIncrementGiven",938}, + {"Yo",279}, {""}, {""}, {""}, - {"biFourierCoefficients",351}, - {"numberOfParallelsBetweenAPoleAndTheEquator",1405}, - {"biFourierResolutionParameterM",354}, - {"grib2LocalSectionNumber",888}, - {"rdbtimeMonth",1729}, + {"Yp",280}, + {""}, {""}, {""}, + {"lengthOf4DvarWindow",1083}, + {""}, {""}, + {"subDefinitions2",2081}, + {"longitudeOfSubSatellitePointInDegrees",1168}, + {"cloudsTitle1Trend1",506}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section10Length",1925}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"visibilityInKilometresTrend4",2296}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"jIncrement",1022}, + {"missingValuesPresent",1280}, {""}, - {"nameOfFirstFixedSurface",1308}, + {"numberOfRepresentativeMember",1427}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"cloudsTitle3Trend3",518}, + {""}, {""}, {""}, {""}, {""}, + {"preBitmapValues",1650}, + {"runwayDesignatorState3",1812}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"gaussianGridName",876}, - {"roundedMarsLongitude",1784}, - {""}, - {"startStepInHours",2056}, - {""}, {""}, {""}, - {"sfc_levtype",1999}, + {"reducedGrid",1744}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"longitudeOfLastGridPoint",1156}, - {""}, - {"section3Pointer",1941}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"DELETE",25}, - {""}, {""}, {""}, - {"_anoffset",286}, - {"correction1",596}, + {"firstMonthUsedToBuildClimateMonth1",844}, {""}, {""}, - {"endOfMessage",742}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"variationOfVisibility",2262}, + {"southEastLongitudeOfVerficationArea",2029}, {""}, + {"runwayDepositState2",1795}, + {""}, {""}, + {"deleteCalendarId",666}, + {""}, {""}, {""}, {"latitudeOfIcosahedronPole",1051}, {""}, - {"variationOfVisibilityDirection",2263}, + {"mars_labeling",1218}, + {"is_s2s",1008}, {""}, {""}, {""}, - {"secondaryMissingValueSubstitute",1918}, - {"bitMapIndicator",361}, - {""}, {""}, {""}, {""}, - {"variationOfVisibilityDirectionAngle",2264}, - {"default_max_val",662}, + {"endMonthTrend3",737}, {""}, - {"visibilityInKilometresTrend3",2295}, + {"spaceUnitFlag",2038}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"typeOfGrid",2191}, + {""}, {""}, {""}, {""}, {""}, + {"biFourierResolutionParameterN",355}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"typicalMonth",2215}, + {"section2Pointer",1936}, + {""}, {""}, {""}, + {"bitsPerValue",365}, + {""}, + {"windSpeedTrend1",2324}, + {"windDirectionTrend1",2313}, + {"cloudsTitle3Trend4",519}, {""}, {""}, {""}, {""}, {""}, - {"typeOfFirstFixedSurface",2188}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"typeOfHorizontalLine",2191}, + {"scaleFactorOfLengthOfSemiMinorAxis",1854}, + {"runwayDesignatorState4",1813}, + {"directionOfVariation",681}, {""}, - {"extractAreaSouthLatitude",793}, - {""}, {""}, - {"ijDirectionIncrementGiven",951}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"offsetSection1",1484}, + {""}, + {"La1",102}, + {""}, {""}, {""}, {""}, + {"pressureUnits",1677}, {""}, {""}, {""}, {""}, - {"matchLandType",1225}, + {"Lar1",109}, + {""}, {""}, {""}, {""}, + {"Latin1",114}, + {""}, + {"Lo1",123}, + {"jDirectionIncrementInDegrees",1021}, + {"INBITS",90}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"endGridDefinition",725}, + {"Lor1",141}, + {"unitOfTimeRange",2229}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"parametersVersion",1621}, + {""}, + {"oceanAtmosphereCoupling",1459}, {""}, {""}, - {"marsStream1",1212}, - {"numberOfCoefficientsOrValuesUsedToSpecifyFirstDimensionCoordinateFunction",1353}, - {"numberOfCoefficientsOrValuesUsedToSpecifySecondDimensionCoordinateFunction",1354}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"stepUnits",2071}, + {"NUT",187}, {""}, {""}, - {"horizontalDomainTemplate",926}, + {"thisExperimentVersionNumber",2119}, {""}, {""}, {""}, - {"startOfHeaders",2052}, - {""}, {""}, {""}, - {"deleteCalendarId",666}, - {"xCoordinateOfSubSatellitePoint",2339}, + {"param_value_max",1610}, {""}, - {"yCoordinateOfSubSatellitePoint",2346}, - {""}, {""}, - {"subcentreOfAnalysis",2090}, + {"localYear",1141}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"codedNumberOfGroups",546}, + {"preProcessingParameter",1651}, + {""}, {""}, + {"windGust",2317}, + {"default_min_val",663}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"NH",179}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"WRAPstr",261}, + {""}, + {"reservedSection4",1771}, {""}, - {"xDirectionGridLength",2340}, + {"dateSSTFieldUsed",641}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"biFourierResolutionSubSetParameterN",357}, + {""}, {""}, {""}, {""}, + {"windVariableDirectionTrend2",2335}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"northWestLongitudeOfLPOArea",1324}, {""}, - {"yDirectionGridLength",2347}, + {"coordinateFlag2",587}, {""}, - {"longitudeOfSubSatellitePoint",1166}, + {"section1Pointer",1933}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"typicalYear",2219}, + {""}, {""}, {""}, {""}, {""}, + {"subDefinitions1",2080}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"gribTablesVersionNo",894}, + {"percentileValue",1634}, + {""}, {""}, + {"rootGroupObjectHeaderAddress",1780}, + {"endMonthTrend4",738}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"unpackedError",2241}, {""}, {""}, {""}, {""}, {""}, - {"MinuteOfModelVersion",157}, - {""}, {""}, {""}, - {"numberOfDataPointsExpected",1363}, - {"firstDimensionCoordinateValueDefinition",840}, - {"longitudeOfSubSatellitePointInDegrees",1167}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"listOfParametersUsedForClustering",1111}, - {"remarkPresent",1757}, + {"extractAreaNorthLatitude",792}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"constantAntennaElevationAngle",565}, + {""}, {""}, {""}, {""}, {""}, + {"runwaySideCodeState2",1835}, {""}, {""}, {""}, {""}, - {"templatesMasterDir",2115}, - {""}, - {"scaleFactorOfPrimeMeridianOffset",1857}, + {"longitudeOfReferencePoint",1160}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"METARstr",155}, + {"northWestLatitudeOfVerficationArea",1323}, + {""}, {""}, + {"falseEasting",831}, {""}, {""}, {""}, {""}, - {"scaleFactorOfFirstWavelength",1851}, + {"runwayDepositState1",1794}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"longitudeOfThePolePoint",1171}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"southEastLatitudeOfLPOArea",2026}, + {""}, {""}, {""}, {""}, {""}, + {"variationOfVisibility",2263}, {""}, {""}, {""}, {""}, - {"Dj",35}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"windVariableDirectionTrend1",2334}, + {""}, {""}, + {"variationOfVisibilityDirection",2264}, + {""}, {""}, {""}, + {"accuracyMultipliedByFactor",290}, + {""}, {""}, {""}, {""}, {""}, + {"variationOfVisibilityDirectionAngle",2265}, + {"section6Pointer",1955}, {""}, {""}, {""}, {""}, {""}, {""}, - {"centralLongitudeInMicrodegrees",396}, + {"yCoordinateOfOriginOfSectorImage",2346}, {""}, - {"gribMasterTablesVersionNumber",893}, - {"numberOfClusterHighResolution",1349}, + {"offsetSection6",1491}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"WRAPstr",261}, - {""}, {""}, {""}, {""}, {""}, - {"dataSubCategory",629}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"unitsBias",2230}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"sizeOfLength",2015}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"scaleFactorOfLengthOfSemiMajorAxis",1852}, + {"section3Length",1940}, {""}, {""}, - {"scaleFactorOfLengthOfSemiMinorAxis",1853}, - {"Nj",195}, - {"totalNumberOfGridPoints",2161}, + {"gts_TTAAii",913}, {""}, - {"southEastLongitudeOfLPOArea",2027}, + {"latitudeOfSouthernPoleInDegrees",1059}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"coordAveragingTims",573}, + {"firstDimensionCoordinateValueDefinition",840}, + {"timeIncrementBetweenSuccessiveFields",2142}, {""}, {""}, - {"forecastPeriodFrom",859}, - {""}, {""}, {""}, {""}, - {"local_padding",1142}, - {"operationalForecastCluster",1512}, + {"numberOfBytesOfFreeFormatData",1345}, + {""}, {""}, + {"scaleFactorOfPrimeMeridianOffset",1858}, + {""}, {""}, {""}, + {"recentWeatherTry",1738}, + {""}, {""}, + {"runwayFrictionCoefficientState3",1832}, + {"visibilityInKilometresTrend3",2296}, + {"numberOfBytesInLocalDefinition",1344}, {""}, - {"typeOfEnsembleForecast",2186}, + {"rootTablesDir",1782}, + {""}, {""}, {""}, + {"packingError",1534}, + {""}, {""}, + {"section_10",1982}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cfVarNameECMF",407}, {""}, {""}, {""}, {""}, {""}, {""}, - {"longitudeOfSouthernPole",1162}, + {"section_3",1985}, {""}, {""}, - {"recentWeather",1736}, - {""}, - {"addressOfFileFreeSpaceInfo",294}, + {"numberOfDistinctSection5s",1371}, {""}, {""}, {""}, - {"cloudsTitle1",505}, - {"mars_labeling",1217}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section3Flags",1938}, + {"unitsConversionScaleFactor",2233}, + {""}, {""}, {""}, + {"presentTrend2",1658}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"stepRangeInHours",2067}, + {"scaledValueOfSecondWavelength",1886}, {""}, {""}, - {"deleteLocalDefinition",668}, - {"coordinate3OfLastGridPoint",582}, - {"XRInMetres",267}, + {"md5Product",1237}, + {""}, {""}, {""}, {""}, {""}, + {"dateOfSSTFieldUsed",640}, + {""}, {""}, {""}, + {"formatVersionMinorNumber",866}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"visibilityTrend1",2298}, + {""}, {""}, {""}, + {"jScansPositively",1024}, + {"section4Length",1945}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"matrixBitmapsPresent",1229}, {""}, {""}, {""}, {""}, - {"endDayTrend1",720}, - {"selectStepTemplateInstant",1990}, + {"rdbtimeYear",1733}, + {""}, {""}, {""}, + {"visibilityTrend3",2300}, + {""}, {""}, {""}, + {"coordinateFlag1",586}, {""}, - {"tiggeLocalVersion",2128}, + {"runwayFrictionCoefficientState4",1833}, {""}, - {"biFourierResolutionSubSetParameterM",356}, - {"originatingCentreOfAnalysis",1526}, + {"coordinate4OfLastGridPoint",585}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"sp1",2034}, - {""}, {""}, - {"primaryBitmap",1677}, - {"wrongPadding",2337}, + {"section_03",1974}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"scaledValueOfRadiusOfSphericalEarth",1883}, {""}, {""}, {""}, {""}, - {"templatesLocalDir",2114}, - {""}, {""}, - {"shapeOfTheEarth",2000}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"YR",275}, + {"scaledValueOfFirstWavelength",1876}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"windUnits",2327}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfDistinctSection5s",1370}, - {""}, {""}, {""}, {""}, - {"section1Pointer",1932}, + {"numberOfDaysInClimateSamplingWindow",1366}, + {""}, {""}, + {"typeOfSSTFieldUsed",2202}, {""}, {""}, {""}, {""}, {""}, - {"expandBy",763}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"MonthOfModelVersion",168}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section1",1924}, - {""}, {""}, {""}, {""}, {""}, - {"mask",1218}, {""}, {""}, {""}, - {"windDirectionTrend4",2315}, - {""}, {""}, {""}, {""}, {""}, - {"LLCOSP",100}, + {"runwaySideCodeState1",1834}, {""}, - {"NUT",187}, + {"numberOfPointsInDomain",1420}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"backgroundGeneratingProcessIdentifier",322}, + {""}, {""}, {""}, {""}, {""}, + {"southPoleOnProjectionPlane",2032}, + {"marsKeywords1",1200}, + {"typicalMonth",2216}, {""}, {""}, - {"visibilityInKilometresTrend1",2293}, + {"listOfParametersUsedForClustering",1111}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"totalNumberOfValuesInUnpackedSubset",2167}, + {""}, {""}, + {"visibilityInKilometresTrend4",2297}, + {""}, {""}, + {"cloudsTitle4Trend3",523}, + {"cloudsBaseCoded1Trend3",468}, {""}, {""}, {""}, - {"nameECMF",1307}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"beginMinuteTrend2",340}, {""}, {""}, {""}, {""}, - {"offsetAfterBitmap",1463}, - {""}, {""}, {""}, - {"getNumberOfValues",883}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"kindOfProduct",1030}, + {"numberOfPointsAlongXAxis",1416}, + {""}, {""}, + {"jPointsAreConsecutive",1023}, {""}, - {"horizontalDomainTemplateNumber",927}, + {"is_ocean2d_param",1005}, + {"firstOrderValues",846}, + {""}, + {"typeOfWavelengthInterval",2209}, + {"qnhUnits",1707}, {""}, {""}, {""}, - {"isotopeIdentificationNumber",1014}, - {"iDirectionIncrementGridLength",939}, - {"pack",1531}, - {""}, {""}, {""}, {""}, - {"dummy1",696}, + {"section_4",1986}, + {""}, {""}, {""}, {""}, {""}, + {"marsStream2",1214}, {""}, {""}, {""}, {""}, - {"numberOfContributingSpectralBands",1357}, + {"MinuteOfModelVersion",157}, + {"is_rotated_grid",1007}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"falseEasting",831}, - {""}, {""}, {""}, - {"unitsECMF",2234}, - {""}, {""}, {""}, {""}, {""}, - {"numberOfPointsAlongXAxis",1415}, + {"dayOfTheYearDate",650}, {""}, - {"legBaseTime",1078}, - {"presentTrend4",1659}, - {"numberIncludedInAverage",1335}, + {"beginHourTrend3",337}, {""}, - {"horizontalDimensionProcessed",925}, + {"satelliteID",1840}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"parameterUnits",1619}, + {""}, + {"dataSubCategory",629}, + {""}, {""}, {""}, + {"secondOrderValuesDifferentWidths",1911}, + {""}, + {"subLocalDefinition2",2083}, {""}, {""}, - {"frequencyScalingFactor",870}, + {"expandedUnits",776}, + {""}, + {"numberOfCoordinatesValues",1360}, + {""}, {""}, {""}, + {"correction2",598}, {""}, {""}, {""}, - {"marsType1",1215}, - {"scaleFactorOfSecondWavelength",1861}, + {"crraSuiteID",613}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"offsetFromReferenceOfFirstTime",1481}, + {""}, + {"unexpandedDescriptors",2224}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"scaleFactorOfMajorAxisOfOblateSpheroidEarth",1856}, + {"cloudsTitle4Trend4",524}, + {"cloudsBaseCoded1Trend4",469}, + {""}, + {"PVPresent",211}, + {"presentTrend1",1657}, {""}, - {"scaledValueOfPrimeMeridianOffset",1881}, + {"section_04",1975}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"scaledValueOfFirstWavelength",1875}, + {"scaledValueOfDistanceFromEnsembleMean",1870}, + {""}, + {"mixedCoordinateFieldFlag",1282}, + {"beginMinuteTrend1",339}, + {""}, {""}, {""}, {""}, {""}, + {"sourceOfGridDefinition",2024}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"numberOfClusterLowResolution",1351}, + {""}, + {"unexpandedDescriptorsEncoded",2225}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"section9UniqueIdentifier",1967}, + {""}, + {"southEastLongitudeOfLPOArea",2028}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"grib2LocalSectionPresent",889}, + {"widthOfWidths",2311}, + {""}, {""}, {""}, {""}, {""}, + {"earthMajorAxisInMetres",703}, + {""}, {""}, {""}, {""}, {""}, + {"qfeUnits",1703}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"nameECMF",1308}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"latitudeOfLastGridPointInDegrees",1053}, - {"unpack",2239}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"expandedUnits",776}, - {""}, {""}, {""}, {""}, - {"localTablesVersion",1138}, + {"identificationOfOriginatingGeneratingCentre",946}, {""}, - {"longitudeOfFirstDiamondCenterLine",1151}, - {""}, {""}, {""}, {""}, - {"pressureUnits",1676}, + {"endMinuteTrend2",732}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"lengthOfHeaders",1084}, + {"clusterMember2",528}, + {"upperThresholdValue",2250}, + {"forecastOrSingularVectorNumber",857}, {""}, {""}, - {"longitudeOfFirstDiamondCenterLineInDegrees",1152}, + {"numberOfCodedValues",1353}, + {""}, {""}, {""}, {""}, {""}, + {"rdbtimeMonth",1730}, {""}, {""}, - {"N1",170}, - {""}, - {"NrInRadiusOfEarth",197}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"northWestLatitudeOfVerficationArea",1322}, + {"wrongPadding",2338}, + {"unpackedSubsetPrecision",2242}, {""}, {""}, - {"reserved1",1763}, - {""}, {""}, {""}, {""}, - {"coordinate4OfLastGridPoint",585}, - {"typeOfProcessedData",2200}, - {""}, {""}, {""}, - {"produceLargeConstantFields",1686}, - {"scaledValueOfLengthOfSemiMajorAxis",1876}, - {"windDirectionTrend3",2314}, + {"md5Headers",1236}, {""}, - {"scaledValueOfLengthOfSemiMinorAxis",1877}, - {"correction3",600}, - {"firstOrderValues",846}, + {"grib2LocalSectionNumber",888}, {""}, - {"latitudeOfStretchingPoleInDegrees",1061}, - {""}, {""}, {""}, {""}, {""}, - {"section5Pointer",1950}, + {"beginHourTrend4",338}, {""}, - {"monthOfEndOfOverallTimeInterval",1292}, + {"numberOfParallelsBetweenAPoleAndTheEquator",1406}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"missingDataFlag",1275}, - {"tigge_short_name",2133}, + {"southEastLatitudeOfVerficationArea",2027}, {""}, {""}, {""}, - {"gridDefinitionDescription",898}, - {""}, - {"La1",102}, + {"referenceForGroupWidths",1749}, + {"Latin2InDegrees",117}, + {""}, {""}, {""}, + {"alternativeRowScanning",298}, + {"unitsECMF",2235}, {""}, - {"satelliteID",1839}, - {""}, {""}, - {"generalExtended2ordr",878}, + {"experimentVersionNumber",777}, {""}, {""}, - {"legBaseDate",1077}, + {"pentagonalResolutionParameterJ",1631}, + {"HDF5str",82}, + {""}, {""}, {""}, + {"basicAngleOfTheInitialProductionDomain",330}, + {""}, {""}, {""}, + {"cloudsTitle3Trend2",517}, + {""}, {""}, {""}, + {"_numberOfValues",288}, {""}, - {"Lar1",109}, - {""}, {""}, {""}, {""}, - {"Latin1",114}, - {"DjInDegrees",37}, - {"Lo1",123}, + {"NC",174}, + {"runwayDesignatorState2",1811}, + {"section7",1957}, + {"endDayTrend2",721}, + {"verticalVisibilityCoded",2292}, {""}, {""}, {""}, {""}, {""}, - {"runwayDepositState4",1796}, - {""}, - {"numberOfDistinctSection6s",1371}, - {"extractAreaEastLongitude",789}, - {"Lor1",141}, + {"section8UniqueIdentifier",1964}, {""}, {""}, {""}, {""}, {""}, - {"northWestLatitudeOfLPOArea",1321}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"latitudeOfTangencyPoint",1064}, - {""}, {""}, {""}, - {"yearOfEndOfOverallTimeInterval",2355}, + {"typeOfTimeIncrementBetweenSuccessiveFieldsUsedInTheStatisticalProcessing",2208}, + {""}, {""}, + {"numberOfStepsUsedForClustering",1434}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"deletePV",669}, {""}, - {"secondOrderFlags",1908}, + {"coordinate2End",577}, + {""}, {""}, {""}, + {"localLatitude2",1128}, {""}, - {"easternLongitudeOfClusterDomain",708}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"gaussianGridName",876}, {""}, - {"presentTrend3",1658}, + {"xCoordinateOfOriginOfSectorImage",2339}, {""}, {""}, - {"selectStepTemplateInterval",1991}, - {"NRj",185}, + {"P2",208}, + {"latitudeOfSubSatellitePoint",1062}, {""}, {""}, {""}, {""}, - {"section2Pointer",1935}, + {"longitudeOfCentralPointInClusterDomain",1148}, {""}, - {"section1Flags",1929}, - {""}, {""}, {""}, - {"_numberOfValues",288}, - {"secondaryBitmap",1912}, - {""}, - {"listOfEnsembleForecastNumbers",1109}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"bufrHeaderCentre",372}, + {"md5Section6",1244}, + {"intervalBetweenTimes",982}, {""}, - {"numberOfPointsAlongAMeridian",1409}, + {"subLocalDefinition1",2082}, {""}, - {"heightPressureEtcOfLevels",921}, + {"packedValues",1533}, + {"numberOfUsedTileAttributes",1442}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"spaceUnitFlag",2037}, + {"biFourierResolutionParameterM",354}, + {"cloudsTitle2",510}, + {""}, {""}, {""}, + {"section7Pointer",1959}, + {""}, + {"referenceForGroupLengths",1748}, + {""}, {""}, + {"numberOfUnexpandedDescriptors",1439}, + {"NrInRadiusOfEarth",197}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"averaging1Flag",317}, - {"visibilityInKilometresTrend2",2294}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"scaleFactorOfCentralWaveNumber",1844}, - {"representationType",1760}, - {"versionOfModelClimate",2285}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"offsetValuesBy",1496}, + {"baseDateEPS",326}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"easternLongitudeOfClusterDomain",708}, + {"cloudsAbbreviation3Trend3",438}, {""}, {""}, - {"temperatureAndDewpointPresent",2113}, + {"ls_labeling",1182}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"latitudeFirstInDegrees",1043}, {""}, - {"hourOfEndOfOverallTimeInterval",930}, - {""}, {""}, {""}, {""}, {""}, - {"fileConsistencyFlags",838}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"correction4",602}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"northWestLongitudeOfVerficationArea",1324}, - {""}, {""}, {""}, {""}, {""}, - {"crraSuiteID",613}, - {""}, {""}, {""}, {""}, {""}, - {"DjGiven",36}, - {"timeRangeIndicatorFromStepRange",2147}, + {"pentagonalResolutionParameterK",1632}, {""}, {""}, {""}, - {"disableGrib1LocalSection",684}, + {"Latin1InDegrees",115}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"tiggeSuiteID",2132}, {""}, {""}, - {"cloudsTitle1Trend4",509}, - {""}, {""}, {""}, {""}, {""}, - {"longitudeOfFirstGridPointInDegrees",1154}, + {"beginDayTrend2",332}, + {""}, + {"NRj",185}, + {""}, + {"coordinate2Start",579}, + {"cloudsTitle3Trend1",516}, {""}, {""}, {""}, - {"scaleFactorOfEarthMajorAxis",1847}, - {"numberOfMissing",1396}, - {"latitudeOfSouthernPoleInDegrees",1059}, - {"scaleFactorOfEarthMinorAxis",1848}, + {"localTablesVersion",1138}, + {""}, {""}, + {"runwayDesignatorState1",1810}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayDepositState3",1795}, + {"baseTimeEPS",328}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"numberOfPointsAlongAMeridian",1410}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"biFourierResolutionSubSetParameterM",356}, {""}, {""}, {""}, {""}, {""}, {""}, - {"meanRVR4",1252}, - {""}, {""}, - {"section5",1948}, + {"sizeOfPostAuxiliaryArray",2018}, + {"endHourTrend3",728}, + {""}, {""}, {""}, {""}, {""}, + {"cloudsAbbreviation4Trend3",443}, + {""}, {""}, {""}, {""}, + {"endMinuteTrend1",731}, + {"totalNumberOfClusters",2157}, {""}, - {"monthlyVerificationYear",1299}, - {"iScansNegatively",942}, - {"offsetSection4",1488}, - {""}, {""}, {""}, - {"sizeOfPostAuxiliaryArrayPlusOne",2018}, + {"versionNumOfSharedHeaderMessageFormat",2282}, + {""}, {""}, {""}, {""}, + {"tablesLocalDir",2106}, + {"numberInMixedCoordinateDefinition",1333}, {""}, - {"scaledValueOfSecondWavelength",1885}, - {"flagForAnyFurtherInformation",848}, - {""}, {""}, - {"numberOfPointsInDomain",1419}, + {"endGridDefinition",725}, + {"clusterMember1",526}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section6Pointer",1954}, - {""}, {""}, {""}, - {"default_min_val",663}, + {""}, {""}, {""}, {""}, + {"coordAveraging3",572}, {""}, {""}, - {"cloudsTitle3",515}, + {"Model_Identifier",166}, + {"longitudeOfReferencePointInDegrees",1161}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"dateOfIceFieldUsed",637}, {""}, {""}, {""}, {""}, - {"inputProcessIdentifier",969}, + {"numberOfPointsAlongSecondAxis",1413}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"clusteringDomain",538}, + {""}, {""}, {""}, {""}, + {"numberOfClusterHighResolution",1350}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"NEAREST",177}, {""}, {""}, - {"dayOfTheYearDate",650}, + {"runwayDepositCodeState3",1792}, {""}, - {"cloudsTitle1Trend3",508}, - {"scaleFactorOfMajorAxisOfOblateSpheroidEarth",1855}, + {"md5Section10",1239}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"numberOfBytesPerInteger",1346}, {""}, {""}, {""}, - {"secondaryBitmapPresent",1913}, - {""}, {""}, {""}, {""}, {""}, - {"endDayTrend3",722}, - {"secondaryBitmaps",1914}, - {""}, - {"Lar1InDegrees",110}, + {"cloudsTitle2Trend3",513}, {""}, {""}, {""}, - {"localTablesVersionNumber",1139}, - {"J",94}, + {"cloudsAbbreviation3Trend4",439}, + {"produceLargeConstantFields",1687}, {""}, - {"orderOfSpatialDifferencing",1518}, - {"numberOfPointsAlongAParallel",1410}, + {"numberOfGroups",1387}, {""}, - {"numberOfDistinctSection7s",1372}, + {"numberOfCoefficientsOrValuesUsedToSpecifyFirstDimensionCoordinateFunction",1354}, + {"numberOfCoefficientsOrValuesUsedToSpecifySecondDimensionCoordinateFunction",1355}, {""}, {""}, {""}, {""}, {""}, - {"n2",1303}, - {"Lor1InDegrees",142}, - {""}, {""}, {""}, {""}, - {"mixedCoordinateFieldFlag",1281}, - {""}, - {"swapScanningX",2096}, + {"localLatitude1",1127}, {""}, - {"beginDayTrend4",334}, + {"visibilityTrend4",2301}, {""}, {""}, {""}, {""}, - {"halfByte",916}, - {""}, {""}, {""}, - {"is_ocean3d_param",1006}, + {"P1",207}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"lengthIncrementForTheGroupLengths",1082}, - {""}, {""}, {""}, - {"extractDateTimeDayStart",797}, - {""}, {""}, {""}, {""}, - {"sp2",2035}, - {""}, - {"westernLongitudeOfClusterDomain",2305}, + {"NB",173}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"expandedCrex_scales",766}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"lowerThresholdValue",1181}, + {""}, {""}, + {"longitudeOfSouthEastCornerOfArea",1162}, + {""}, {""}, + {"definitionFilesVersion",665}, + {""}, {""}, + {"integerPointValues",974}, + {""}, {""}, + {"subdivisionsOfBasicAngle",2092}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"section2Length",1934}, + {"Ensemble_Identifier",52}, + {""}, {""}, {""}, {""}, {""}, + {"unpackedValues",2243}, + {""}, {""}, + {"listMembersUsed3",1105}, {""}, - {"localFlagLatestVersion",1124}, - {"secondaryBitmapsCount",1915}, - {"clusterMember4",530}, + {"heightPressureEtcOfLevels",921}, + {""}, {""}, + {"latitudinalDirectionGridLength",1074}, + {"numberOfUsedSpatialTiles",1441}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"endHourTrend4",729}, {""}, - {"flagShowingPostAuxiliaryArrayInUse",851}, - {""}, {""}, {""}, {""}, - {"spare2",2040}, - {""}, {""}, {""}, {""}, - {"indicatorOfUnitForTimeIncrement",961}, - {"expandedCrex_units",767}, - {""}, {""}, {""}, {""}, - {"NG",178}, - {""}, {""}, {""}, {""}, - {"numberOfPointsAlongSecondAxis",1412}, - {"unitOfTimeRange",2228}, + {"cloudsTitle2Trend4",514}, + {""}, {""}, + {"runwayFrictionCoefficientState2",1831}, + {"cloudsAbbreviation4Trend4",444}, {""}, - {"flagForNormalOrStaggeredGrid",850}, - {""}, {""}, {""}, {""}, - {"coordinateIndexNumber",588}, + {"beginDayTrend1",331}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"La1InDegrees",103}, - {""}, {""}, {""}, {""}, - {"correction2",598}, - {"PUnset",210}, - {""}, {""}, {""}, {""}, {""}, - {"meanRVR3",1251}, - {""}, {""}, {""}, {""}, - {"Lo1InDegrees",124}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"numberOfSingularVectorsEvolved",1433}, + {""}, {""}, + {"subLocalDefinitionNumber2",2087}, {""}, - {"offsetSection3",1487}, - {"scanningMode4",1892}, + {"numberOfPointsAlongAParallel",1411}, + {""}, + {"offsetBBitmap",1469}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"gts_TTAAii",913}, + {"presentWeather3Present",1671}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"averaging2Flag",318}, - {"coordinate1End",574}, + {"qualityValueAssociatedWithParameter",1710}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"P_INST",212}, {""}, {""}, {""}, - {"localLatitude1",1127}, + {"longitudeOfThePolePointInDegrees",1172}, + {"clusterMember6",532}, + {"Model_Additional_Information",165}, {""}, {""}, {""}, {""}, - {"pentagonalResolutionParameterK",1631}, - {""}, {""}, {""}, - {"qnhUnits",1706}, - {"X1",262}, - {""}, {""}, {""}, - {"cloudsTitle4",520}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"offsetAfterData",1465}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"localLongitude2",1131}, {""}, {""}, {""}, - {"endDayTrend4",723}, - {"cloudsAbbreviation4",440}, - {""}, - {"dummy2",697}, + {"PUnset",210}, + {"gribTablesVersionNo",894}, + {"qualityControlIndicator",1709}, + {"runwayDepositCodeState4",1793}, {""}, {""}, - {"scaledValueOfCentralWaveNumber",1868}, + {"numberOfContributingSpectralBands",1358}, + {""}, {""}, {""}, + {"numberOfGroupsOfDataValues",1388}, + {""}, {""}, {""}, + {"cloudsCode1",485}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"windVariableDirectionTrend4",2336}, - {"md5Section5",1242}, - {"latitudeFirstInDegrees",1043}, - {"parameterUnits",1618}, + {"baseDateOfThisLeg",327}, {""}, - {"jPointsAreConsecutive",1023}, + {"section1Length",1931}, {""}, {""}, - {"marsStream2",1213}, - {""}, {""}, {""}, {""}, - {"typeOfPacking",2197}, + {"cavokOrVisibility",382}, + {""}, {""}, {""}, + {"westernLongitudeOfClusterDomain",2306}, + {"yCoordinateOfSubSatellitePoint",2347}, {""}, {""}, - {"beginDayTrend3",333}, - {"longitudeLastInDegrees",1147}, - {""}, {""}, {""}, {""}, {""}, - {"calendarIdentification",377}, + {"tiggeLocalVersion",2129}, + {""}, + {"cloudsCode3",495}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"dateSSTFieldUsed",641}, - {"numberOfMissingInStatisticalProcess",1397}, {""}, - {"marsType2",1216}, - {""}, {""}, {""}, {""}, - {"WRAP",260}, - {""}, {""}, - {"numberOfPointsAlongFirstAxis",1411}, + {"numberOfDataPointsExpected",1364}, + {""}, {""}, {""}, + {"runwayFrictionCoefficientState1",1830}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"sizeOfLength",2016}, + {"numberOfControlForecastTube",1359}, {""}, {""}, - {"section7Pointer",1958}, + {"numberOfPointsAlongXAxisInCouplingArea",1417}, + {""}, + {"remarkPresent",1758}, + {""}, {""}, {""}, + {"baseTimeOfThisLeg",329}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"listMembersMissing3",1101}, + {"templatesMasterDir",2116}, {""}, {""}, - {"clusterMember3",529}, + {"section11Pointer",1929}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"longitudeOfReferencePoint",1159}, - {""}, {""}, - {"scaledValueOfEarthMajorAxis",1871}, - {""}, {""}, - {"scaledValueOfEarthMinorAxis",1872}, + {"cloudsAbbreviation2",430}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"tsectionNumber3",2173}, - {""}, {""}, - {"mixedCoordinateDefinition",1280}, - {"isectionNumber3",1012}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"variationOfVisibilityTrend3",2272}, {""}, - {"N2",171}, - {""}, {""}, - {"preBitmapValues",1649}, + {"cloudsTitle4Trend2",522}, + {"cloudsBaseCoded1Trend2",467}, {""}, - {"is_rotated_grid",1007}, + {"efas_post_proc",714}, + {"METAR",154}, {""}, {""}, {""}, {""}, {""}, - {"section4Length",1944}, - {"reserved2",1764}, + {"getNumberOfValues",883}, + {""}, + {"firstDimensionPhysicalSignificance",841}, + {"cfVarNameECMF",407}, {""}, - {"latitudeOfCentralPointInClusterDomain",1048}, + {"radiusOfTheEarth",1718}, {""}, {""}, {""}, - {"conceptsMasterDir",560}, + {"kindOfProduct",1030}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"commonBlock",550}, {""}, {""}, - {"resolutionAndComponentFlags4",1775}, + {"section6Length",1954}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"ITERATOR",92}, + {"cloudsBase1",445}, {""}, {""}, {""}, {""}, - {"Lar2InDegrees",112}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"typeOfOriginalFieldValues",2196}, + {"section5Pointer",1951}, + {"md5Section7",1245}, + {""}, {""}, {""}, + {"offsetICEFieldsUsed",1482}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Lor2InDegrees",144}, - {""}, {""}, {""}, {""}, - {"scaledValueOfMajorAxisOfOblateSpheroidEarth",1879}, + {"variationOfVisibilityDirectionTrend3",2268}, {""}, - {"La2",104}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"northWestLongitudeOfLPOArea",1323}, + {"reservedSection2",1769}, + {""}, {""}, {""}, {""}, + {"cloudsBase3",455}, + {"subLocalDefinitionLength2",2085}, {""}, {""}, - {"Lar2",111}, + {"scaleFactorOfEarthMajorAxis",1848}, {""}, {""}, - {"expandedCrex_widths",768}, - {""}, - {"Latin2",116}, - {""}, - {"Lo2",125}, + {"scaleFactorOfEarthMinorAxis",1849}, + {"numberOfBitsForScaledGroupLengths",1341}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"offsetSection7",1492}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsAbbreviation3",435}, - {"P1",207}, - {""}, {""}, {""}, - {"Lor2",143}, - {""}, {""}, - {"windVariableDirectionTrend3",2335}, - {"section4Padding",1945}, - {""}, {""}, {""}, - {"cloudsTitle1Trend1",506}, + {"subLocalDefinitionNumber1",2086}, + {"variationOfVisibilityTrend4",2273}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section3Length",1939}, + {""}, + {"verificationYear",2277}, {""}, {""}, {""}, - {"subSetJ",2087}, + {"cloudsBaseCoded1",465}, + {"patch_precip_fp",1630}, {""}, {""}, {""}, {""}, {""}, - {"resolutionAndComponentFlags3",1774}, - {"cfNameECMF",405}, + {"scaledValueOfLowerLimit",1879}, + {""}, + {"scanningMode6",1895}, + {""}, + {"inputShortDelayedDescriptorReplicationFactor",970}, + {""}, {""}, + {"cloudsTitle4Trend1",521}, + {"cloudsBaseCoded1Trend1",466}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsTitle2",510}, + {"localLongitude1",1130}, {""}, {""}, {""}, {""}, - {"windSpeedTrend1",2323}, + {"cloudsBaseCoded3",475}, {""}, - {"calendarIdentificationTemplateNumber",378}, - {"codedNumberOfFirstOrderPackedValues",545}, - {""}, {""}, {""}, {""}, - {"BufrTemplate",20}, + {"offsetAfterData",1466}, + {""}, + {"default_step_units",664}, + {""}, + {"GDSPresent",69}, + {"countOfICEFieldsUsed",606}, {""}, {""}, {""}, {""}, {""}, {""}, - {"coordAveraging0",569}, - {"endDayTrend2",721}, + {"variationOfVisibilityDirectionTrend4",2269}, + {"cloudsBaseCoded3Trend3",478}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"resolutionAndComponentFlags3",1775}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"listMembersMissing4",1102}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"localTablesVersionNumber",1139}, {""}, {""}, {""}, {""}, - {"md5Section6",1243}, - {""}, {""}, {""}, {""}, {""}, - {"xDirectionGridLengthInMetres",2341}, + {"cfNameECMF",405}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"yDirectionGridLengthInMetres",2348}, - {"runwayDesignatorState4",1812}, - {""}, {""}, {""}, {""}, - {"typeOfGeneratingProcess",2189}, - {"ls_labeling",1181}, - {""}, {""}, {""}, {""}, - {"probProductDefinition",1682}, - {"verificationYear",2276}, - {"beginMinuteTrend4",342}, - {""}, {""}, {""}, {""}, {""}, - {"windDirectionTrend1",2312}, - {"section3Padding",1940}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfSingularVectorsEvolved",1432}, - {""}, {""}, {""}, - {"radiusOfClusterDomain",1716}, + {"iDirectionIncrementGiven",938}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"physicalFlag2",1641}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"localFlagLatestVersion",1124}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"DjInMetres",38}, - {"rdb_key",1723}, - {""}, {""}, - {"qualityControlIndicator",1708}, + {"cloudsCode1Trend3",488}, + {"scaleFactorOfMinorAxisOfOblateSpheroidEarth",1857}, + {""}, {""}, {""}, {""}, {""}, + {"extractDateTimeDayStart",797}, {""}, - {"subLocalDefinition1",2081}, + {"section11Length",1928}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section6",1952}, - {"flagForIrregularGridCoordinateList",849}, + {"cloudsAbbreviation1",425}, + {"offsetBeforeBitmap",1473}, {""}, - {"firstLatitudeInDegrees",843}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"cloudsBaseCoded3Trend4",479}, + {"latitudeOfSubSatellitePointInDegrees",1063}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"md5GridSection",1234}, - {""}, {""}, - {"is_s2s",1008}, - {""}, {""}, {""}, {""}, - {"numberOfUsedTileAttributes",1441}, - {""}, {""}, {""}, {""}, - {"uvRelativeToGrid",2258}, + {"numberOfPointsAlongFirstAxis",1412}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"Sub-Experiment_Identifier",228}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayDesignatorState3",1811}, + {"meanRVR3",1252}, + {""}, {""}, {""}, + {"expandedCrex_scales",766}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"dateOfModelVersion",638}, + {""}, + {"theHindcastMarsStream",2117}, + {""}, {""}, {""}, + {"runwayDepthOfDepositCodeState3",1800}, {""}, {""}, - {"CLNOMA",24}, + {"timeOfModelVersion",2145}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"cloudsCode1Trend4",489}, + {""}, {""}, {""}, + {"endMonthTrend2",736}, {""}, {""}, - {"mBasicAngle",1185}, - {"offsetEndSection4",1477}, - {""}, {""}, {""}, {""}, {""}, - {"beginMinuteTrend3",341}, - {"realPartOf00",1734}, + {"subLocalDefinitionLength1",2084}, + {""}, + {"scaleFactorOfCentralWaveNumber",1845}, {""}, {""}, {""}, {""}, {""}, - {"presentTrend1",1656}, + {"_leg_number",287}, + {""}, {""}, {""}, + {"numberOfHorizontalPoints",1389}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"beginMonthTrend1",343}, + {""}, {""}, {""}, + {"expandedCrex_units",767}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"resolutionAndComponentFlags4",1776}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"cloudsAbbreviation2Trend3",433}, + {"longitudeLastInDegrees",1147}, {""}, {""}, {""}, {""}, {""}, - {"inputOverriddenReferenceValues",968}, - {""}, {""}, {""}, {""}, - {"dateOfSSTFieldUsed",640}, + {"cloudsBase1Trend3",448}, + {"beginMonthTrend3",345}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"RENAME",216}, + {"offsetFromOriginToInnerBound",1480}, + {""}, + {"yearOfModelVersion",2358}, {""}, {""}, {""}, - {"windSpeedTrend3",2325}, - {"endStepInHours",746}, - {""}, {""}, - {"xDirectionGridLengthInMillimetres",2342}, - {"iScansPositively",943}, - {"yDirectionGridLengthInMillimetres",2349}, - {"widthOfWidths",2310}, - {"stepInHours",2065}, + {"localUsePresent",1140}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"spacingOfBinsAlongRadials",2039}, + {"mask",1219}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"marsClass2",1190}, {""}, {""}, {""}, {""}, - {"dateOfAnalysis",634}, + {"runwayDepthOfDepositCodeState4",1801}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"ECMWF",46}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"latitudeOfThePolePoint",1066}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"pack",1532}, {""}, {""}, {""}, {""}, - {"numberOfUnexpandedDescriptors",1438}, - {"matchAerosolBinNumber",1223}, - {"section_10",1981}, - {"dataCategory",617}, - {"timeOfAnalysis",2142}, - {"offsetSection10",1484}, - {"numberOfBits",1338}, - {"longitudeOfCentralPointInClusterDomain",1150}, + {"dayOfModelVersion",648}, + {""}, + {"DayOfModelVersion",30}, + {""}, {""}, {""}, {""}, + {"section2Used",1938}, + {""}, + {"xCoordinateOfSubSatellitePoint",2340}, + {"section3UniqueIdentifier",1943}, {""}, {""}, - {"secondaryBitmapsSize",1916}, - {""}, {""}, {""}, - {"cloudsTitle2Trend4",514}, + {"listMembersUsed4",1106}, + {"physicalFlag1",1640}, + {"deleteLocalDefinition",668}, {""}, {""}, - {"beginHourTrend4",338}, + {"cloudsBase1Trend4",449}, + {""}, {""}, + {"hourOfModelVersion",932}, + {""}, {""}, + {"Date_E3",28}, + {""}, {""}, + {"meanRVR4",1253}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"qfeUnits",1702}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"cloudsAbbreviation1Trend3",428}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"experimentVersionNumberOfAnalysis",780}, - {""}, {""}, {""}, - {"theHindcastMarsStream",2116}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"section11Pointer",1928}, + {"timeUnitFlag",2149}, {""}, {""}, - {"marsKeywords1",1199}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"unpack",2240}, + {""}, {""}, {""}, {""}, + {"physicalMeaningOfVerticalCoordinate",1642}, {""}, {""}, {""}, {""}, {""}, - {"typeOfSSTFieldUsed",2201}, - {""}, {""}, {""}, - {"matrixBitmapsPresent",1228}, + {"WRAP",260}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"yearOfAnalysis",2353}, + {"rdb_key",1724}, {""}, {""}, {""}, {""}, - {"numberOfOctectsForNumberOfPoints",1401}, - {"longitudeOfThePolePointInDegrees",1171}, - {"typeOfWavelengthInterval",2208}, - {""}, {""}, - {"subDefinitions1",2079}, - {"backgroundGeneratingProcessIdentifier",322}, + {"section5",1949}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"DjGiven",36}, + {"cloudsTitle2Trend2",512}, + {"numberOfSingularVectorsComputed",1432}, {""}, - {"typeOfAnalysis",2181}, - {"localLongitude1",1130}, + {"section4UniqueIdentifier",1948}, + {"cloudsAbbreviation2Trend4",434}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"tempPressureUnits",2112}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsTitle1Trend2",507}, + {"endMonthTrend1",735}, {""}, - {"cloudsTitle2Trend3",513}, - {"minutesAfterReferenceTimeOfDataCutoff",1274}, - {"runwayDepositState1",1793}, + {"reflectivityCalibrationConstant",1757}, {""}, {""}, {""}, {""}, - {"md5Section7",1244}, + {"md5Section1",1238}, + {""}, + {"latitudeOfLastGridPoint",1052}, + {""}, + {"cloudsCode4",500}, {""}, {""}, {""}, - {"isectionNumber2",1011}, - {"longitudeOfTheSouthernPoleOfProjection",1172}, - {""}, {""}, - {"extractDateTimeEnd",798}, + {"scaleFactorOfUpperLimit",1865}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"section7Length",1958}, {""}, {""}, - {"clusterMember10",527}, - {"instrumentType",973}, - {"numberOfPointsAlongTheXAxis",1413}, - {"secondOfEndOfOverallTimeInterval",1905}, + {"hoursAfterReferenceTimeOfDataCutoff",935}, + {""}, {""}, {""}, {""}, {""}, + {"md5Section3",1241}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"minuteOfEndOfOverallTimeInterval",1269}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"totalAerosolBinsNumbers",2152}, - {"tempPressureUnits",2111}, - {"monthOfAnalysis",1291}, + {"pentagonalResolutionParameterM",1633}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"runwayFrictionCodeValueState3",1824}, + {""}, + {"generalExtended2ordr",878}, {""}, {""}, - {"classOfAnalysis",420}, - {""}, {""}, {""}, - {"numberInTheGridCoordinateList",1334}, + {"ITERATOR",92}, + {"visibilityInKilometresTrend2",2295}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"scaledValueOfLengthOfSemiMinorAxis",1878}, {""}, - {"numberOfSecondOrderPackedValues",1429}, - {"jDirectionIncrementInDegrees",1021}, - {"extractDateTimeDayEnd",795}, + {"marsClass1",1189}, {""}, - {"is_ocean2d_param",1005}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"countOfGroupLengths",605}, + {"Date_E4",29}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"localUsePresent",1140}, - {"endOfHeadersMarker",740}, - {"longitudeOfTangencyPoint",1168}, - {""}, {""}, {""}, - {"hourOfAnalysis",929}, {""}, {""}, {""}, - {"md5Headers",1235}, + {"section_2",1984}, + {""}, {""}, {""}, {""}, {""}, + {"cloudsTitle2Trend1",511}, {""}, {""}, {""}, - {"localLatitude2",1128}, - {""}, - {"section1Length",1930}, - {""}, - {"sourceOfGridDefinition",2023}, + {"cloudsAbbreviation1Trend4",429}, {""}, {""}, - {"endMark",730}, + {"typeOfPacking",2198}, {""}, {""}, - {"X2",264}, - {""}, - {"resolutionAndComponentFlags1",1772}, - {"II",89}, + {"experimentVersionNumberOfAnalysis",780}, + {"presentWeather2Present",1666}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section9UniqueIdentifier",1966}, - {""}, {""}, - {"weightAppliedToClimateMonth1",2302}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"octetAtWichPackedDataBegins",1461}, + {"offsetBeforePL",1475}, + {"Product_Identifier",215}, + {""}, + {"numberOfRadarSitesUsed",1423}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"centreForTable2",400}, + {"md5Section5",1243}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"horizontalDomainTemplate",926}, + {"cloudsBaseCoded4Trend3",483}, {""}, {""}, {""}, {""}, {""}, - {"BOX",17}, - {""}, {""}, - {"subLocalDefinitionNumber1",2085}, - {"section8UniqueIdentifier",1963}, + {"cloudsBase4",460}, + {""}, + {"runwayFrictionCodeValueState4",1825}, + {""}, + {"DELETE",25}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"ceilingAndVisibilityOK",388}, + {"offsetToEndOf4DvarWindow",1495}, + {""}, + {"section_02",1973}, + {""}, + {"scaleFactorOfLengthOfSemiMajorAxis",1853}, {""}, {""}, {""}, - {"coordinate2End",577}, + {"latitudeOfReferencePoint",1055}, + {""}, {""}, + {"inputOverriddenReferenceValues",968}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"extractAreaSouthLatitude",793}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section1Padding",1931}, + {"offsetSection11",1486}, + {"uuidOfVGrid",2258}, {""}, {""}, {""}, - {"unitsOfFirstFixedSurface",2236}, + {"typeOfProcessedData",2201}, {""}, {""}, - {"beginYearTrend4",350}, - {""}, - {"dayOfModelVersion",648}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsCode1",485}, + {"cloudsBaseCoded4",480}, + {"NC2",176}, + {""}, {""}, {""}, {""}, + {"presentWeather1Present",1661}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsTitle3Trend4",519}, - {""}, {""}, {""}, - {"variationOfVisibilityDirectionTrend4",2268}, + {"YR",275}, + {"cloudsBaseCoded4Trend4",484}, + {"numberOfPointsAlongTheXAxis",1414}, + {""}, {""}, {""}, {""}, + {"expandedCrex_widths",768}, + {""}, {""}, + {"laplacianScalingFactorUnset",1038}, {""}, - {"scaleFactorOfMinorAxisOfOblateSpheroidEarth",1856}, + {"rootGroupSymbolTableEntry",1781}, {""}, {""}, {""}, - {"LIMITS",99}, - {""}, {""}, - {"reservedSection3",1769}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"meanRVR1",1249}, + {"variationOfVisibilityTrend2",2271}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"paramIdECMF",1609}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfUsedSpatialTiles",1440}, - {""}, {""}, {""}, {""}, - {"offsetSection1",1483}, + {"codedNumberOfGroups",546}, {""}, {""}, - {"centralClusterDefinition",393}, + {"runwayDesignatorRVR3",1808}, + {"beginHourTrend2",336}, {""}, {""}, {""}, - {"earthMajorAxisInMetres",703}, - {""}, {""}, {""}, {""}, {""}, - {"runwayDesignatorState1",1809}, - {""}, {""}, - {"subLocalDefinitionLength1",2083}, + {"typeOfGeneratingProcess",2190}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"beginMinuteTrend1",339}, + {""}, {""}, + {"variationOfVisibilityDirectionTrend2",2267}, {""}, {""}, {""}, {""}, {""}, - {"numberOfDataBinsAlongRadials",1360}, - {""}, - {"endMonthTrend4",738}, + {"visibilityInKilometresTrend1",2294}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"pentagonalResolutionParameterM",1632}, - {"numberOfStepsUsedForClustering",1433}, + {"firstLatitudeInDegrees",843}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"scaledValueOfPrimeMeridianOffset",1882}, {""}, - {"cloudsTitle3Trend3",518}, - {""}, {""}, {""}, - {"variationOfVisibilityDirectionTrend3",2267}, + {"section_1",1981}, + {"disableGrib1LocalSection",684}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"CLNOMA",24}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"dateOfModelVersion",638}, - {""}, {""}, - {"beginDayTrend1",331}, - {""}, {""}, {""}, {""}, - {"P2",208}, - {"timeOfModelVersion",2144}, - {""}, {""}, {""}, {""}, {""}, - {"windSpeedTrend2",2324}, + {"variationOfVisibilityTrend1",2270}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section5Length",1949}, + {"totalNumberOfGridPoints",2162}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfSingularVectorsComputed",1431}, - {""}, - {"probabilityType",1683}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"offsetBSection9",1471}, - {"numberOfControlForecastTube",1358}, - {""}, - {"clusterMember1",526}, + {"cloudsBaseCoded3Trend2",477}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"section_01",1972}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"versionNumOfSharedHeaderMessageFormat",2281}, + {"windUnitsTrend3",2331}, + {"visibilityTrend2",2299}, + {""}, {""}, {""}, + {"clusterMember7",533}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"iDirectionIncrementGridLength",939}, + {"variationOfVisibilityDirectionTrend1",2266}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"beginMonthTrend4",346}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section7",1956}, - {""}, - {"numberInMixedCoordinateDefinition",1332}, + {"latitudeOfThePoleOfStretching",1065}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"ZLMULT",283}, + {""}, {""}, {""}, {""}, {""}, + {"cloudsCode1Trend2",487}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"NC1",175}, {""}, {""}, {""}, {""}, - {"secondaryBitMap",1911}, - {""}, - {"DayOfModelVersion",30}, - {"probabilityTypeName",1684}, + {"runwayDesignatorRVR4",1809}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"latitudeOfThePolePoint",1066}, - {""}, {""}, {""}, {""}, {""}, - {"yearOfModelVersion",2357}, - {"numberOfRadarSitesUsed",1422}, {"checkInternalVersion",418}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_local40_1",1597}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"uuidOfHGrid",2257}, + {"cloudsBaseCoded3Trend1",476}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"unusedBitsInBitmap",2245}, + {"beginHourTrend1",335}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"runwayDepthOfDepositCodeState2",1799}, + {""}, + {"section5Length",1950}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"reservedSection4",1770}, - {""}, {""}, {""}, {""}, - {"constantAntennaElevationAngle",565}, + {"section_6",1988}, {""}, - {"cloudsTitle2Trend1",511}, + {"tsectionNumber5",2176}, {""}, - {"versionNumberOfGribLocalTables",2283}, - {""}, {""}, {""}, - {"ceilingAndVisibilityOK",388}, - {"windDirectionTrend2",2313}, - {"section2Length",1933}, - {""}, {""}, {""}, - {"jDirectionIncrementGiven",1019}, - {""}, {""}, {""}, - {"timeCoordinateDefinition",2137}, + {"observationDiagnostic",1454}, + {"offsetSection5",1490}, + {"latitudeOfTheSouthernPoleOfProjection",1068}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"cloudsCode1Trend1",486}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"cloudsAbbreviation3Trend2",437}, + {""}, {""}, {""}, {""}, {""}, + {"windUnitsTrend4",2332}, + {"cloudsBase1Trend2",447}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"cloudsCode3Trend3",498}, + {"latitudeOfThePolePointInDegrees",1067}, + {""}, {""}, {""}, {""}, + {"scaledValueOfMajorAxisOfOblateSpheroidEarth",1880}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"northLatitudeOfDomainOfTubing",1321}, + {""}, {""}, {""}, {""}, {""}, + {"section_06",1977}, + {"longitudeOfSouthernPole",1163}, + {""}, {""}, {""}, {""}, + {"skipExtraKeyAttributes",2022}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"resolutionAndComponentFlags2",1773}, - {"Ensemble_Combination_Number",51}, + {"uvRelativeToGrid",2259}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section11Length",1927}, + {"scanningMode7",1896}, {""}, {""}, {""}, - {"subLocalDefinition2",2082}, - {""}, {""}, {""}, {""}, - {"scaleFactorOfUpperLimit",1864}, + {"monthlyVerificationYear",1300}, + {"cloudsBaseCoded2Trend3",473}, + {"runwayDepthOfDepositCodeState1",1798}, {""}, {""}, - {"runwayDepthOfDepositCodeState4",1800}, - {"endMonthTrend3",737}, + {"md5Section4",1242}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"latitudeOfTheSouthernPoleOfProjection",1068}, - {"firstMonthUsedToBuildClimateMonth1",844}, + {"endHourTrend2",727}, + {""}, {""}, {""}, {""}, {""}, + {"cloudsAbbreviation4Trend2",442}, {""}, {""}, {""}, {""}, - {"numberOfGridInReference",1384}, + {"southLatitudeOfDomainOfTubing",2031}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"cloudsAbbreviation1",425}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"windVariableDirectionTrend1",2333}, - {"cloudsTitle4Trend4",524}, + {""}, {""}, + {"cloudsCode3Trend4",499}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"northLatitudeOfDomainOfTubing",1320}, - {"section2Padding",1934}, - {"hourOfModelVersion",932}, - {""}, {""}, {""}, {""}, - {"eastLongitudeOfDomainOfTubing",707}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"presentTrend2",1657}, {""}, {""}, {""}, {""}, - {"nameOfSecondFixedSurface",1309}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"coordAveraging2",571}, + {"numberOfMissingValues",1399}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"ZLMULT",283}, - {"g1conceptsLocalDirAll",873}, + {"cloudsBase1Trend1",446}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"eastLongitudeOfDomainOfTubing",707}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"cloudsBase3Trend3",458}, {""}, {""}, - {"numberOfHorizontalPoints",1388}, - {"runwayDepthOfDepositCodeState3",1799}, + {"numberOfGridInReference",1385}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"cloudsBaseCoded2Trend4",474}, + {"typeOfLevelECMF",2196}, {""}, - {"runwayFrictionCoefficientState4",1832}, + {"runwayDepositCodeState2",1791}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"ZLBASE",282}, + {""}, {""}, {""}, {""}, + {"runwayDepthOfDepositState3",1804}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"marsClass1",1188}, - {""}, {""}, - {"southLatitudeOfDomainOfTubing",2030}, {""}, {""}, {""}, - {"bufrdcExpandedDescriptors",375}, - {""}, - {"scaledValueOfMinorAxisOfOblateSpheroidEarth",1880}, - {"runwayDesignatorState2",1810}, + {"sizeOfPostAuxiliaryArrayPlusOne",2019}, {""}, - {"coordinate1Flag",575}, - {"endMinuteTrend1",731}, - {""}, - {"Ensemble_Identifier",52}, - {"cloudsTitle4Trend3",523}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"beginMinuteTrend2",340}, - {"runwayFrictionCodeValueState4",1824}, + {"legacyGaussSubarea",1080}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"baseTimeOfThisLeg",329}, + {"LLCOSP",100}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"longitudeOfLastGridPointInDegrees",1157}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"subDefinitions2",2080}, - {""}, {""}, {""}, - {"localLongitude2",1131}, - {""}, {""}, {""}, {""}, - {"section6Length",1953}, + {"weightAppliedToClimateMonth1",2303}, {""}, - {"typeOfSecondFixedSurface",2202}, - {""}, {""}, {""}, {""}, {""}, - {"runwayDepositCodeState4",1792}, + {"superblockExtensionAddress",2094}, {""}, - {"resolutionAndComponentFlags6",1776}, - {""}, {""}, - {"qualityValueAssociatedWithParameter",1709}, - {""}, {""}, {""}, {""}, {""}, - {"HDF5str",82}, - {""}, {""}, {""}, {""}, {""}, - {"runwayFrictionCoefficientState3",1831}, + {"cloudsBase3Trend4",459}, + {""}, + {"cloudsAbbreviation3Trend1",436}, + {"altitudeOfTheCameraFromTheEarthsCentreMeasuredInUnitsOfTheEarthsRadius",299}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"versionNumberOfExperimentalSuite",2282}, - {""}, {""}, {""}, - {"reservedSection2",1768}, - {""}, {""}, - {"runwayDepositState2",1794}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Model_Additional_Information",165}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayFrictionCodeValueState3",1823}, {""}, {""}, {""}, {""}, - {"implementationDateOfModelCycle",952}, - {""}, {""}, - {"latitudeLastInDegrees",1044}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsTitle3Trend1",516}, - {""}, {""}, - {"offsetSection5",1489}, - {"variationOfVisibilityDirectionTrend1",2265}, - {"NC1",175}, - {""}, {""}, {""}, {""}, {""}, - {"_leg_number",287}, + {"runwayFrictionCodeValueState2",1823}, + {""}, {""}, {""}, {""}, + {"addEmptySection2",291}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"runwayFrictionCoefficientCodeState3",1828}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"baseDateOfThisLeg",327}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"cloudsTitle2Trend2",512}, - {"endMinuteTrend3",733}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"lengthOf4DvarWindow",1083}, - {""}, {""}, {""}, - {"offsetBeforeData",1473}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfModeOfDistribution",1399}, - {""}, {""}, {""}, {""}, {""}, - {"latitudeOfFirstGridPoint",1049}, - {""}, {""}, {""}, - {"firstMonthUsedToBuildClimateMonth2",845}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"isCavok",985}, - {""}, {""}, {""}, - {"P_INST",212}, + {"setToMissingIfOutOfRange",1999}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsCode3",495}, - {""}, - {"westLongitudeOfDomainOfTubing",2304}, - {"ECMWF",46}, - {"md5Section10",1238}, - {"runwayDepositCodeState3",1791}, + {"latitudeOfReferencePointInDegrees",1056}, + {"section6UniqueIdentifier",1956}, + {""}, {""}, {""}, + {"endHourTrend1",726}, {""}, {""}, - {"scaledValueOfUpperLimit",1888}, - {""}, - {"subLocalDefinitionNumber2",2086}, + {"numberOfPressureLevelsUsedForClustering",1422}, {""}, {""}, - {"missingValueManagementUsed",1278}, - {"accuracyMultipliedByFactor",290}, + {"cloudsAbbreviation4Trend1",441}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"latitudeOfLastGridPointInDegrees",1053}, {""}, {""}, - {"clusterMember5",531}, + {"cloudsBaseCoded4Trend2",482}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"runwayDepthOfDepositState4",1805}, + {""}, {""}, {""}, {""}, + {"coordAveraging1",570}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"runwayFrictionCoefficientCodeState4",1829}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"windUnitsTrend4",2331}, + {"runwayFrictionCodeValueState1",1822}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"extractAreaLatitudeRank",790}, - {""}, {""}, {""}, - {"totalNumberOfValuesInUnpackedSubset",2166}, - {"listMembersMissing4",1102}, {""}, {""}, {""}, {""}, {""}, - {"meanRVR2",1250}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"offsetSection2",1486}, - {"julianForecastDay",1026}, - {""}, {""}, {""}, - {"scanningMode5",1893}, + {"padding_sec1_loc",1600}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"runwayDepositCodeState1",1790}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section_4",1985}, + {"numberInHorizontalCoordinates",1332}, {""}, {""}, - {"section7Length",1957}, - {"subLocalDefinitionLength2",2084}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"resolutionAndComponentFlags7",1777}, - {"longitudeOfSouthernPoleInDegrees",1163}, + {"listMembersMissing2",1100}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"beginYearTrend3",349}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"visibilityTrend1",2297}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"offsetValuesBy",1495}, - {""}, - {"runwayDepthOfDepositCodeState1",1797}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"beginDayTrend2",332}, + {"cloudsBaseCoded4Trend1",481}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"extractDateTimeDayEnd",795}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"jDirectionIncrementGridLength",1020}, - {"definitionFilesVersion",665}, - {"cloudsTitle4Trend1",521}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfBytesPerInteger",1345}, - {""}, {""}, {""}, - {"uuidOfHGrid",2256}, - {""}, - {"cloudsCode4",500}, - {""}, {""}, {""}, {""}, - {"numberOfPointsUsed",1420}, - {""}, {""}, {""}, - {"clusterMember2",528}, - {""}, {""}, - {"modelErrorType",1284}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"diffInHours",675}, - {"cloudsTitle3Trend2",517}, - {""}, {""}, {""}, - {"variationOfVisibilityDirectionTrend2",2266}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"md5Section1",1237}, - {""}, {""}, {""}, - {"runwayFrictionCoefficientState1",1829}, - {""}, {""}, {""}, - {"typeOfIntervalForFirstAndSecondSize",2192}, {""}, {""}, {""}, {""}, - {"listMembersMissing3",1101}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"secondOrderValuesDifferentWidths",1910}, + {"westLongitudeOfDomainOfTubing",2305}, {""}, {""}, - {"section_04",1974}, + {"horizontalDomainTemplateNumber",927}, {""}, - {"changeIndicatorTrend4",412}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"section_3",1984}, - {"runwayFrictionCodeValueState1",1821}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"commonBlock",550}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"listMembersUsed2",1104}, + {""}, {""}, {""}, {""}, {""}, + {"endMark",730}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"runwaySideCodeState4",1836}, - {"efas_post_proc",714}, - {""}, - {"cloudsAbbreviation2",430}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"radiusOfTheEarth",1717}, - {"windVariableDirectionTrend2",2334}, - {"timeUnitFlag",2148}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"************_PRODUCT_***************",3}, - {""}, {""}, {""}, {""}, - {"offsetFreeFormData",1478}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"typeOfIntervalForFirstAndSecondWavelength",2193}, {""}, {""}, {""}, {""}, {""}, - {"changeIndicatorTrend3",411}, + {"oneMinuteMeanMaximumRVR3",1503}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"cloudsCode4Trend3",503}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"endMinuteTrend2",732}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"NH",179}, + {"horizontalDimensionProcessed",925}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"coordinateFlag1",586}, - {""}, {""}, - {"marsClass2",1189}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"patch_precip_fp",1629}, - {""}, {""}, {""}, - {"SOH",221}, + {"YRInMetres",276}, + {""}, {""}, + {"resolutionAndComponentFlags2",1774}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"beginYearTrend4",350}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {"cloudsCode2",490}, {""}, {""}, {""}, - {"section_03",1973}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"endMonthTrend1",735}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"offsetSection6",1490}, - {""}, {""}, {""}, {""}, - {"runwayDepthOfDepositCodeState2",1798}, + {"cloudsCode4Trend4",504}, + {""}, + {"Minute_E3",159}, + {"flagForNormalOrStaggeredGrid",850}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"numberOfPointsUsed",1421}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"offsetFromReferenceOfFirstTime",1480}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"default_step_units",664}, - {""}, {""}, {""}, {""}, - {"observationDiagnostic",1453}, - {""}, - {"coordinate2Flag",578}, - {""}, - {"cloudsTitle4Trend2",522}, {""}, - {"runwaySideCodeState3",1835}, + {"cloudsBase4Trend3",463}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"runwayExtentOfContaminationState3",1820}, + {""}, {""}, {""}, {""}, {""}, + {"meanRVR2",1251}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"latitudeOfReferencePoint",1055}, + {"oneMinuteMeanMaximumRVR4",1504}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"g1conceptsLocalDirAll",873}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"NC2",176}, - {"latitudeWhereDxAndDyAreSpecified",1070}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section2Used",1937}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"lBB",1033}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"cloudsBase2",450}, + {""}, {""}, {""}, + {"cloudsBase4Trend4",464}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayFrictionCoefficientState2",1830}, - {"latitudeWhereDxAndDyAreSpecifiedInDegrees",1071}, + {"scaledValueOfEarthMajorAxis",1872}, + {""}, {""}, + {"scaledValueOfEarthMinorAxis",1873}, + {"cloudsAbbreviation2Trend2",432}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsAbbreviation4Trend4",444}, + {"runwayExtentOfContaminationState4",1821}, + {"numberOfSecondOrderPackedValues",1430}, + {""}, {""}, {""}, {""}, {""}, + {"cloudsCode3Trend2",497}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"endYearTrend3",750}, + {""}, {""}, {""}, + {"Minute_E4",160}, {""}, - {"clusterMember6",532}, + {"offsetBSection6",1471}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"runwayFrictionCodeValueState2",1822}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"resolutionAndComponentFlags1",1773}, + {""}, + {"cloudsBaseCoded2",470}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"typeOfTimeIncrementBetweenSuccessiveFieldsUsedInTheStatisticalProcessing",2207}, - {"addEmptySection2",291}, {""}, {""}, {""}, {""}, - {"latitudeOfThePoleOfStretching",1065}, + {"clusterMember5",531}, + {"cloudsBaseCoded2Trend2",472}, + {""}, + {"section7UniqueIdentifier",1960}, + {""}, + {"radiusOfClusterDomain",1717}, {""}, {""}, - {"physicalMeaningOfVerticalCoordinate",1641}, + {"latitudeOfSouthEastCornerOfArea",1057}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"Date_E2",27}, {""}, - {"scanningMode6",1894}, + {"countOfGroupLengths",605}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"cloudsAbbreviation3Trend4",439}, {""}, {""}, - {"dateOfIceFieldUsed",637}, - {"listMembersUsed3",1105}, + {"cloudsAbbreviation1Trend2",427}, + {"windGustTrend3",2320}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"cloudsCode3Trend1",496}, + {""}, {""}, {""}, {""}, {""}, + {"scaledValueOfMinorAxisOfOblateSpheroidEarth",1881}, + {""}, {""}, {""}, {""}, {""}, + {"pastTendencyRVR1",1626}, {""}, {""}, {""}, {""}, - {"Latin1InDegrees",115}, + {"cloudsBase3Trend2",457}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"presentWeather3PresentTrend3",1674}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"meanRVR1",1250}, + {""}, {""}, {""}, + {"pastTendencyRVR3",1628}, + {""}, {""}, + {"longitudeOfSouthernPoleInDegrees",1164}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"cloudsBaseCoded2Trend1",471}, + {"md5GridSection",1235}, + {""}, {""}, {""}, {""}, {""}, + {"jDirectionIncrementGiven",1019}, + {""}, {""}, {""}, {""}, {""}, + {"Total_Number_Members_Used",253}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"endYearTrend4",751}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"Ensemble_Combination_Number",51}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"visibilityTrend3",2299}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"scaledValueOfCentralWaveNumber",1869}, + {""}, {""}, {""}, {""}, + {"cloudsAbbreviation2Trend1",431}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"numberOfUsefulPointsAlongXAxis",1443}, + {""}, {""}, {""}, {""}, + {"section_7",1989}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"changeIndicatorTrend1",409}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsAbbreviation4Trend3",443}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"superblockExtensionAddress",2093}, + {"probProductDefinition",1683}, + {"beginMonthTrend2",344}, + {"cloudsBase3Trend1",456}, + {""}, {""}, {""}, {""}, + {"runwayFrictionCoefficientCodeState2",1827}, + {""}, {""}, + {"cloudsCode2Trend3",493}, {""}, {""}, {""}, - {"coordinate3Flag",580}, + {"resolutionAndComponentFlags6",1777}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"numberOfUsefulPointsAlongXAxis",1442}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"Total_Number_Members_Possible",252}, {""}, {""}, {""}, {""}, - {"pentagonalResolutionParameterJ",1630}, - {""}, - {"longitudeOfReferencePointInDegrees",1160}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayDepositCodeState1",1789}, + {"windGustTrend4",2321}, + {""}, {""}, {""}, {""}, {""}, + {"scanningMode5",1894}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"presentWeather1Present",1660}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"latitudeOfSouthEastCornerOfArea",1057}, - {""}, - {"physicalFlag1",1639}, + {"extractAreaLongitudeRank",791}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"section_07",1978}, {""}, {""}, {""}, - {"GG",70}, - {""}, {""}, {""}, - {"md5Section3",1240}, + {"presentWeather3PresentTrend4",1675}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"RENAME",216}, {""}, {""}, {""}, {""}, {""}, - {"cloudsAbbreviation3Trend3",438}, - {"Model_Identifier",166}, - {"YRInMetres",276}, + {"cloudsAbbreviation1Trend1",426}, + {""}, {""}, + {"missingValueManagementUsed",1279}, + {""}, {""}, + {"cloudsCode2Trend4",494}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"listMembersUsed4",1106}, - {"param_value_max",1609}, + {"runwayFrictionCoefficientCodeState1",1826}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"Y2",273}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"cloudsBase2Trend3",453}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"ccsdsCompressionOptionsMask",385}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"offsetICEFieldsUsed",1481}, + {"oneMinuteMeanMinimumRVR3",1507}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfBitsForScaledGroupLengths",1340}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"visibilityTrend4",2300}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"windGustTrend4",2320}, - {""}, {""}, {""}, - {"extremeValuesRVR4",826}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"laplacianScalingFactorUnset",1038}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"scaledValueOfUpperLimit",1889}, + {""}, + {"runwayDesignatorRVR2",1807}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"md5Section2",1240}, {""}, {""}, {""}, {""}, {""}, - {"extractDateTimeYearRank",813}, + {"cloudsBase2Trend4",454}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"numberOfBitsContainingEachPackedValue",1340}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"bufrHeaderSubCentre",373}, + {"*********_EXTRA_DATA_***************",4}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"HourOfModelVersion",83}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"cloudsCode4Trend2",502}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfPressureLevelsUsedForClustering",1421}, - {""}, - {"coordinateFlag2",587}, - {""}, {""}, {""}, {""}, - {"intervalBetweenTimes",982}, - {""}, {""}, {""}, - {"Latin2InDegrees",117}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"offsetSection7",1491}, - {""}, {""}, {""}, - {"extremeValuesRVR3",825}, - {""}, - {"md5Section4",1241}, + {"mixedCoordinateDefinition",1281}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"ceilingAndVisibilityOKTrend4",392}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"listOfContributingSpectralBands",1107}, - {""}, {""}, - {"numberOfPointsAlongYAxis",1417}, - {""}, {""}, {""}, {""}, {""}, - {"coordinate4Flag",583}, + {"Total_Number_Members_Missing",251}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"section5UniqueIdentifier",1952}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsCode1Trend4",489}, - {""}, {""}, {""}, {""}, {""}, - {"cloudsAbbreviation1Trend4",429}, - {""}, - {"section_1",1980}, - {""}, - {"changeIndicatorTrend2",410}, + {"numberOfBitsUsedForTheScaledGroupLengths",1343}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"presentWeather2Present",1665}, - {""}, {""}, - {"endMonthTrend2",736}, - {"biFourierPackingModeForAxes",353}, - {"rangeBinSpacing",1719}, - {"ZLBASE",282}, - {"alternativeRowScanning",298}, - {""}, {""}, - {"runwayExtentOfContaminationState4",1820}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"windUnitsTrend2",2330}, {""}, {""}, {""}, - {"runwayExtentOfContaminationCodeState4",1816}, - {""}, {""}, {""}, {""}, {""}, - {"windGustTrend3",2319}, - {"listMembersUsed2",1104}, + {"oneMinuteMeanMinimumRVR4",1508}, + {""}, {""}, + {"numberOfReforecastYearsInModelClimate",1425}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"ceilingAndVisibilityOKTrend3",391}, - {"Date_E4",29}, - {"section4UniqueIdentifier",1947}, - {""}, {""}, {""}, - {"extractDateTimeDayRank",796}, - {""}, {""}, {""}, {""}, - {"clusterMember7",533}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"variationOfVisibilityTrend4",2272}, + {"scaledValueOfLengthOfSemiMajorAxis",1877}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsCode1Trend3",488}, - {"extractDateTimeSecondRank",809}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_grid90_1",1542}, + {"Y1",271}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"HDF5",81}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"cloudsCode4Trend1",501}, {""}, {""}, - {"visibilityTrend2",2298}, - {""}, {""}, {""}, {""}, {"UseEcmfConventions",254}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"spacingOfBinsAlongRadials",2038}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayExtentOfContaminationState3",1819}, - {""}, {""}, {""}, - {"runwayExtentOfContaminationCodeState3",1815}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"scanningMode7",1895}, - {""}, - {"runwayDesignatorRVR4",1808}, + {""}, {""}, {""}, {""}, + {"cloudsBase4Trend2",462}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"jScansPositively",1024}, - {""}, {""}, - {"section3UniqueIdentifier",1942}, + {"Hour_E3",85}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"runwayExtentOfContaminationState2",1819}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"section_01",1971}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayDepthOfDepositState4",1804}, - {"typicalYearOfCentury",2220}, - {"cloudsAbbreviation1Trend3",428}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"beginMonthTrend1",343}, + {"runwayDesignatorRVR1",1806}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"md5Section2",1239}, - {""}, {""}, - {"coordinate3OfFirstGridPoint",581}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"runwaySideCodeState1",1833}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"timeIncrementBetweenSuccessiveFields",2141}, - {""}, {""}, {""}, - {"runwayFrictionCoefficientCodeState4",1828}, - {"offsetBeforePL",1474}, - {""}, {""}, - {"Date_E3",28}, {""}, {""}, {""}, {""}, {""}, {""}, - {"countOfICEFieldsUsed",606}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfGridUsed",1385}, + {"ceilingAndVisibilityOKTrend3",391}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"variationOfVisibilityTrend3",2271}, + {"pastTendencyRVR4",1629}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"cloudsBase4Trend1",461}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"presentWeather3Present",1670}, + {""}, {""}, + {"runwayExtentOfContaminationState1",1818}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsAbbreviation2Trend4",434}, - {"runwayDesignatorRVR3",1807}, + {"sourceSinkChemicalPhysicalProcess",2025}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayFrictionCoefficientCodeState3",1827}, + {""}, {""}, {""}, {""}, + {"windUnitsTrend1",2329}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"Local_Number_Members_Used",137}, {""}, - {"extremeValuesRVR1",823}, + {"Hour_E4",86}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"runwayDepthOfDepositState3",1803}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayDepositCodeState2",1790}, - {""}, {""}, {""}, {""}, {""}, - {"extractDateTimeHourRank",800}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"physicalFlag2",1640}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"FMULTM",67}, + {""}, {""}, {""}, {""}, {""}, + {"octetAtWichPackedDataBegins",1462}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"FMULTE",66}, + {"section_11",1983}, + {""}, {""}, + {"ceilingAndVisibilityOKTrend4",392}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"presentWeather2PresentTrend3",1669}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"ceilingAndVisibilityOKTrend1",389}, - {""}, {""}, {""}, {""}, - {"DIAG",26}, - {"section_5",1986}, + {"runwayDepthOfDepositState2",1803}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"Local_Number_Members_Possible",133}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"endHourTrend4",729}, - {""}, {""}, {""}, - {"cloudsCode1Trend1",486}, - {""}, {""}, {""}, {""}, {""}, - {"cloudsAbbreviation4Trend1",441}, - {"coordinate4OfFirstGridPoint",584}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"cloudsAbbreviation2Trend3",433}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"extractDateTimeMinuteRank",803}, - {""}, {""}, {""}, {""}, {""}, - {"sourceSinkChemicalPhysicalProcess",2024}, - {""}, - {"runwayExtentOfContaminationState1",1817}, - {""}, {""}, {""}, - {"runwayExtentOfContaminationCodeState1",1813}, - {""}, - {"ccsdsBlockSize",384}, + {"jDirectionIncrementGridLength",1020}, + {"offsetBeforePV",1476}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"extractDateTimeMonthRank",806}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Y1",271}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"Total_Number_Members_Used",253}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsAbbreviation3Trend1",436}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"oneMinuteMeanMaximumRVR4",1503}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"Original_Parameter_Identifier",205}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"listMembersMissing2",1100}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"paramIdECMF",1608}, - {""}, - {"section_05",1975}, - {""}, {""}, {""}, - {"versionNumberOfSuperblock",2284}, - {""}, {""}, {""}, {""}, {""}, - {"section_2",1983}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"endHourTrend3",728}, - {""}, - {"extractAreaLongitudeRank",791}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"extremeValuesRVR2",824}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"Total_Number_Members_Missing",251}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Total_Number_Members_Possible",252}, + {"cloudsCode2Trend2",492}, + {"presentWeather1PresentTrend3",1664}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsCode2Trend4",494}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"coordAveraging1",570}, - {""}, {""}, {""}, {""}, {""}, - {"runwayFrictionCoefficientCodeState1",1825}, + {"BUFR",19}, {""}, {""}, {""}, {""}, {""}, {""}, - {"endYearTrend4",751}, + {"isCavok",985}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberInHorizontalCoordinates",1331}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"setToMissingIfOutOfRange",1998}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"oneMinuteMeanMaximumRVR3",1502}, - {""}, {""}, - {"ExtremeValuesRVR4",65}, - {""}, - {"ceilingAndVisibilityOKTrend2",390}, - {""}, - {"numberOfPointsAlongXAxisInCouplingArea",1416}, - {""}, - {"section5UniqueIdentifier",1951}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"beginMonthTrend3",345}, - {""}, {""}, {""}, {""}, {""}, - {"cloudsCode1Trend2",487}, - {""}, - {"cloudsCode2Trend3",493}, - {""}, {""}, {""}, {""}, {""}, - {"section_02",1972}, + {"ccsdsBlockSize",384}, {""}, {""}, {""}, {""}, {""}, {""}, - {"offsetBeforePV",1475}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfBytesInLocalDefinition",1343}, + {"setBitsPerValue",1995}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"windGustTrend1",2317}, {""}, {""}, {""}, - {"runwayExtentOfContaminationState2",1818}, - {""}, {""}, {""}, - {"runwayExtentOfContaminationCodeState2",1814}, - {""}, {""}, - {"numberOfReforecastYearsInModelClimate",1424}, + {"presentWeather2PresentTrend4",1670}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"altitudeOfTheCameraFromTheEarthSCenterMeasuredInUnitsOfTheEarth",299}, - {""}, {""}, {""}, - {"runwaySideCodeState2",1834}, - {"ExtremeValuesRVR3",64}, - {""}, {""}, {""}, {""}, - {"latitudeOfThePolePointInDegrees",1067}, + {"ECMWF_s",47}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Local_Number_Members_Used",137}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"coordAveraging3",572}, - {""}, {""}, {""}, {""}, {""}, - {"hoursAfterDataCutoff",934}, + {"bufrHeaderSubCentre",373}, {""}, - {"offsetSection11",1485}, + {"cloudsCode2Trend1",491}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"cloudsBase2Trend2",452}, + {""}, {""}, + {"runwayDepthOfDepositState1",1802}, + {"NG",178}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"reflectivityCalibrationConstant",1756}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"endYearTrend3",750}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"CCCC",21}, - {""}, {""}, {""}, {""}, {""}, - {"recentWeatherTry",1737}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"hoursAfterReferenceTimeOfDataCutoff",935}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBase1",445}, + {"beginYearTrend2",348}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"experimentVersionNumber1",778}, + {"presentWeather1PresentTrend4",1665}, + {""}, + {"experimentVersionNumber2",779}, + {""}, {""}, {""}, {""}, + {"Local_Number_Members_Missing",129}, + {"numberOfPointsAlongYAxis",1418}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"FMULTE",66}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsAbbreviation1Trend1",426}, - {""}, - {"cloudsBaseCoded1Trend4",469}, - {""}, {""}, {""}, - {"beginMonthTrend4",346}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsCode3Trend4",499}, + {"isCavokTrend3",988}, + {""}, {""}, + {"biFourierPackingModeForAxes",353}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Local_Number_Members_Missing",129}, - {""}, {""}, {""}, {""}, - {"offsetBSection5",1469}, + {"section_5",1987}, + {""}, + {"************_PRODUCT_***************",3}, {""}, {""}, - {"Local_Number_Members_Possible",133}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"section_6",1987}, - {""}, {""}, {""}, - {"beginHourTrend1",335}, + {"ICEFieldsUsed",87}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfParametersUsedForClustering",1406}, - {""}, - {"runwayFrictionCoefficientCodeState2",1826}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"variationOfVisibilityTrend1",2269}, - {""}, - {"section6UniqueIdentifier",1955}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfMissingValues",1398}, - {""}, - {"cloudsBaseCoded1Trend3",468}, + {""}, {""}, {""}, {""}, {""}, + {"extractDateTimeYearRank",813}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsCode3Trend3",498}, + {"cloudsBase2Trend1",451}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"oneMinuteMeanMaximumRVR2",1502}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"numberOfVGridUsed",1444}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayDesignatorRVR1",1805}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfPointsAlongTheYAxis",1414}, - {""}, {""}, {""}, - {"cloudsAbbreviation4Trend2",442}, {""}, {""}, {""}, {""}, {""}, - {"latitudeOfFirstGridPointInDegrees",1050}, + {"resolutionAndComponentFlags7",1778}, + {""}, {""}, + {"section_05",1976}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"runwayDepthOfDepositState1",1801}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"beginHourTrend3",337}, - {""}, - {"section_06",1976}, - {""}, {""}, {""}, {""}, - {"Y2",273}, - {""}, {""}, {""}, - {"cloudsCode2Trend1",491}, - {""}, - {"FMULTM",67}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"skipExtraKeyAttributes",2021}, + {""}, {""}, {""}, {""}, + {"XpInGridLengths",270}, {""}, {""}, - {"cloudsAbbreviation3Trend2",437}, + {"ICPLSIZE",88}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Minute_E4",160}, - {""}, - {"beginMonthTrend2",344}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"Minute_E2",158}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"HDF5",81}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"ExtremeValuesRVR1",62}, - {""}, - {"NB",173}, - {""}, {""}, {""}, {""}, {""}, - {"cloudsCode4Trend4",504}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"offsetBSection6",1470}, + {"isCavokTrend4",989}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"beginYearTrend1",347}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"versionNumberOfSuperblock",2285}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"cloudsAbbreviation2Trend1",431}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"experimentVersionNumber1",778}, + {""}, {""}, {""}, {""}, + {"padding_grid90_1",1543}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"isCavokTrend4",989}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"coordAveraging2",571}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section7UniqueIdentifier",1959}, - {"rootGroupSymbolTableEntry",1780}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"extractAreaLatitudeRank",790}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"cloudsCode4Trend3",503}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"INBITS",90}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"*********_EXTRA_DATA_***************",4}, - {"XpInGridLengths",270}, - {""}, {""}, {""}, {""}, {""}, - {"ICPLSIZE",88}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"Minute_E3",159}, + {"hoursAfterDataCutoff",934}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"extractDateTimeHourRank",800}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"typicalYear2",2219}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"beginYearTrend3",349}, - {""}, {""}, {""}, - {"cloudsBaseCoded1",465}, {""}, - {"oneMinuteMeanMinimumRVR4",1507}, - {"endHourTrend1",726}, + {"oneMinuteMeanMaximumRVR1",1501}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"cloudsBaseCoded1Trend1",466}, - {""}, {""}, - {"ccsdsCompressionOptionsMask",385}, - {""}, {""}, {""}, {""}, {""}, - {"windGustTrend2",2318}, - {"LSTCUM",101}, - {""}, {""}, - {"cloudsCode3Trend1",496}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"isCavokTrend3",988}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsCode2Trend2",492}, + {""}, {""}, {""}, {""}, + {"endYearTrend2",749}, + {""}, {""}, {""}, {""}, + {"numberOfParametersUsedForClustering",1407}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"cloudsBase3",455}, - {""}, {""}, {""}, - {"oneMinuteMeanMaximumRVR1",1500}, {""}, {""}, {""}, {""}, {""}, {""}, - {"setBitsPerValue",1994}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section_7",1988}, + {"Ensemble_Identifier_E3",54}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"ExtremeValuesRVR2",63}, + {"Extra_Data_FreeFormat_0_none",57}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"experimentVersionNumber2",779}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"cloudsAbbreviation1Trend2",427}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"beginHourTrend2",336}, - {""}, {""}, {""}, {""}, - {"presentWeather1PresentTrend4",1664}, - {""}, {""}, {""}, - {"oneMinuteMeanMinimumRVR3",1506}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"windGustTrend2",2319}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"padding_sec1_loc",1599}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"ECMWF_s",47}, {""}, {""}, {""}, {""}, {""}, {""}, - {"latitudeOfReferencePointInDegrees",1056}, - {""}, {""}, - {"Date_E2",27}, - {""}, {""}, {""}, {""}, {""}, - {"padding_local_7_1",1598}, + {"numberOfGridUsed",1386}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"cloudsBaseCoded2Trend4",474}, - {"variationOfVisibilityTrend2",2270}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"presentWeather3PresentTrend2",1673}, + {""}, {""}, {""}, {""}, + {"Ensemble_Identifier_E4",55}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"endYearTrend1",748}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"presentWeather1PresentTrend3",1663}, - {""}, - {"Product_Identifier",215}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"************_EXPERIMENT_************",2}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"typicalYearOfCentury",2221}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"cloudsBase4",460}, - {"section_07",1977}, - {""}, {""}, {""}, {""}, - {"runwayDesignatorRVR2",1806}, - {""}, {""}, {""}, {""}, - {"cloudsCode4Trend1",501}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBaseCoded1Trend2",467}, - {""}, - {"cloudsBaseCoded2Trend3",473}, - {""}, {""}, {""}, {""}, {""}, - {"Time_Range_One_E4",247}, - {""}, - {"runwayDepthOfDepositState2",1802}, + {"coordinate3OfFirstGridPoint",581}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsCode3Trend2",497}, + {"endYearTrend1",748}, + {""}, {""}, + {"padding_local11_1",1594}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"lastMonthUsedToBuildClimateMonth1",1039}, + {"padding_loc9_2",1593}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6224,419 +6642,341 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"TYPE_OF",240}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"beginYearTrend2",348}, + {"windGustTrend1",2318}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Time_Range_One_E3",246}, + {"extractDateTimeMinuteRank",803}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"offsetFromOriginToInnerBound",1479}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"typicalYear2",2220}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"presentWeather2PresentTrend4",1669}, + {"extractDateTimeMonthRank",806}, + {""}, + {"presentWeather3PresentTrend1",1672}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"************_ENSEMBLE_**************",1}, {""}, {""}, {""}, {""}, {""}, {""}, - {"HourOfModelVersion",83}, + {"numberOfPointsAlongYAxisInCouplingArea",1419}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"pastTendencyRVR2",1627}, + {""}, {""}, {""}, {""}, {""}, + {"oneMinuteMeanMinimumRVR2",1506}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsAbbreviation2Trend2",432}, - {"windUnitsTrend1",2328}, + {"Local_Number_Members_Possible_E3",135}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"extractDateTimeSecondRank",809}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"LSTCUM",101}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"cloudsBaseCoded3Trend4",479}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBase2",450}, - {""}, {""}, - {"numberOfUnusedBitsAtEndOfSection3",1439}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_loc9_1",1592}, + {"padding_loc7_1",1591}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_loc6_1",1590}, {""}, {""}, - {"presentWeather2PresentTrend3",1668}, - {""}, - {"ICEFieldsUsed",87}, - {""}, - {"Number_Combination_Ensembles_1_none",198}, + {"Local_Number_Members_Possible_E4",136}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"precisionOfTheUnpackedSubset",1653}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"offsetBSection5",1470}, + {""}, {""}, {""}, {""}, + {"Local_Number_Members_Missing_E3",131}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"TYPE_OR",241}, - {"bitsPerValueAndRepack",366}, - {""}, - {"cloudsBaseCoded3",475}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"cloudsBaseCoded3Trend3",478}, - {""}, {""}, {""}, {""}, {""}, - {"precisionOfTheUnpackedSubset",1652}, - {""}, {""}, {""}, - {"cloudsCode4Trend2",502}, - {""}, {""}, {""}, {""}, {""}, - {"************_ENSEMBLE_**************",1}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"endHourTrend2",727}, - {""}, {""}, {""}, {""}, - {"windUnitsTrend3",2330}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"presentWeather1PresentTrend1",1661}, - {""}, {""}, - {"TYPE_FF",238}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"lastMonthUsedToBuildClimateMonth2",1040}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"BUFR",19}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBaseCoded2Trend1",471}, - {"YearOfModelVersion",278}, - {""}, {""}, {""}, - {"presentWeather3PresentTrend4",1674}, + {""}, {""}, + {"Local_Number_Members_Missing_E4",132}, + {"padding_loc5_1",1589}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"oneMinuteMeanMaximumRVR2",1501}, - {""}, {""}, {""}, {""}, {""}, - {"padding_local40_1",1596}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"numberOfBitsContainingEachPackedValue",1339}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"oneMinuteMeanMinimumRVR1",1505}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"cloudsBaseCoded4",480}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"cloudsBaseCoded4Trend4",484}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc190_1",1557}, + {""}, {""}, + {"Hour_E2",84}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"offsetBBitmap",1468}, - {""}, {""}, {""}, {""}, {""}, - {"presentWeather3PresentTrend3",1673}, {""}, {""}, - {"isCavokTrend1",986}, - {""}, {""}, {""}, {""}, - {"section_11",1982}, + {"runwayExtentOfContaminationCodeState3",1816}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"numberOfTensOfThousandsOfYearsOfOffset",1436}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"numberOfDaysInClimateSamplingWindow",1365}, + {"padding_loc50_1",1588}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"ExtremeValuesInMaximumRVR4",61}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"ceilingAndVisibilityOKTrend2",390}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"cloudsBaseCoded4Trend3",483}, - {""}, {""}, {""}, - {"endYearTrend2",749}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"coordinate4OfFirstGridPoint",584}, + {""}, {""}, {""}, {""}, {""}, + {"DIAG",26}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"runwayExtentOfContaminationCodeState4",1817}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"presentWeather2PresentTrend1",1666}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"oneMinuteMeanMinimumRVR1",1504}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"presentWeather1PresentTrend2",1662}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"Ensemble_Identifier_E2",53}, + {"Threshold_Or_Distribution_Units",244}, + {""}, {""}, + {"extractDateTimeDayRank",796}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"cloudsBaseCoded3Trend1",476}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"pastTendencyRVR1",1625}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"cloudsBaseCoded2",470}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"cloudsBaseCoded2Trend2",472}, {""}, {""}, {""}, - {"ExtremeValuesInMaximumRVR3",60}, + {"BBB",16}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"windUnitsTrend2",2329}, + {""}, {""}, {""}, {""}, {""}, + {"Original_CodeTable_2_Version_Number",203}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"unusedBitsInBitmap",2244}, + {""}, + {"presentWeather2PresentTrend2",1668}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_loc13_3",1548}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"TYPE_AN",235}, - {""}, {""}, {""}, {""}, {""}, - {"P_TACC",213}, + {""}, {""}, + {"padding_loc190_1",1558}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_local_35",1598}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Time_Range_One_E2",245}, - {"padding_grid50_1",1540}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"cloudsBase1Trend4",449}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"ceilingAndVisibilityOKTrend1",389}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"numberOfTensOfThousandsOfYearsOfOffset",1435}, - {""}, - {"padding_local1_1",1594}, - {""}, {""}, {""}, {""}, {""}, - {"extremeCounterClockwiseWindDirection",822}, - {""}, {""}, {""}, {""}, - {"genVertHeightCoords",877}, - {""}, {""}, {""}, {""}, - {"numberOfUsefulPointsAlongYAxis",1443}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"presentWeather3PresentTrend1",1671}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"Local_Number_Members_Missing_E4",132}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"cloudsBase1Trend3",448}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"presentWeather2PresentTrend2",1667}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"Original_Parameter_Identifier",205}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"cloudsBaseCoded4Trend1",481}, + {"presentWeather1PresentTrend2",1663}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"TYPE_PF",242}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"cloudsBaseCoded3Trend2",477}, - {"Local_Number_Members_Missing_E3",131}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Local_Number_Members_Possible_E4",136}, + {""}, {""}, {""}, {""}, + {"TYPE_OF",240}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"padding_loc13_4",1549}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"TYPE_FF",238}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"Minute_E2",158}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfBytesOfFreeFormatData",1344}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"presentWeather2PresentTrend1",1667}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"lastMonthUsedToBuildClimateMonth2",1040}, + {""}, {""}, {""}, + {"numberOfUnusedBitsAtEndOfSection3",1440}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Local_Number_Members_Possible_E3",135}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfBitsUsedForTheScaledGroupLengths",1342}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"isCavokTrend2",987}, + {"numberOfPointsAlongTheYAxis",1415}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"Local_Number_Members_Possible_E2",134}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"TYPE_FX",239}, - {"************_EXPERIMENT_************",2}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"isCavokTrend2",987}, + {""}, {""}, {""}, {""}, + {"YearOfModelVersion",278}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"presentWeather3PresentTrend2",1672}, - {""}, {""}, - {"P_TAVG",214}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"presentWeather1PresentTrend1",1662}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"lastMonthUsedToBuildClimateMonth1",1039}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"typeOfLevelECMF",2195}, {""}, {""}, {""}, - {"cloudsBaseCoded4Trend2",482}, - {""}, {""}, {""}, {""}, - {"oneMinuteMeanMinimumRVR2",1505}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"pastTendencyRVR3",1627}, + {"Local_Number_Members_Missing_E2",130}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBase1Trend1",446}, - {"offsetBeforeBitmap",1472}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"Threshold_Or_Distribution_0_no_1_yes",243}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"RVR4_1",220}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_loc19_2",1563}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"pastTendencyRVR4",1628}, + {"runwayExtentOfContaminationCodeState2",1815}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"isCavokTrend1",986}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"RVR3_1",219}, - {"ExtremeValuesInMaximumRVR1",58}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"Hour_E4",86}, - {"cloudsBase2Trend4",454}, + {""}, + {"Number_Combination_Ensembles_1_none",198}, + {"runwayBrakingActionState3",1788}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"padding_loc18_2",1557}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Original_CodeTable_2_Version_Number",203}, - {""}, {""}, {""}, {""}, {""}, - {"swapScanningY",2097}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_local11_1",1593}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBase1Trend2",447}, - {""}, - {"cloudsBase2Trend3",453}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"YY",277}, + {"runwayExtentOfContaminationCodeState1",1814}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_local_7_1",1599}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"TYPE_CF",236}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"Local_Number_Members_Missing_E2",130}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"pastTendencyRVR2",1626}, - {"offsetToEndOf4DvarWindow",1494}, - {""}, - {"Hour_E3",85}, + {"X2InGridLengths",265}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"numberOfVGridUsed",1445}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Ensemble_Identifier_E4",55}, + {"padding_grid3_1",1539}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"runwayBrakingActionState4",1789}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Local_Number_Members_Possible_E2",134}, - {""}, {""}, {""}, - {"cloudsBase3Trend4",459}, + {"padding_local1_1",1595}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"padding_loc10_1",1544}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"X1InGridLengths",263}, {""}, {""}, {""}, {""}, - {"padding_local1_31",1595}, + {"padding_sec2_3",1603}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_grid4_1",1540}, + {""}, {""}, {""}, {""}, {""}, + {"padding_loc18_1",1556}, {""}, {""}, {""}, - {"X1InGridLengths",263}, + {"GRIB",71}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Time_Range_Two_E4",250}, - {"Ensemble_Identifier_E3",54}, + {""}, {""}, {""}, + {"extremeValuesRVR3",825}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"RVR1_1",217}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBase3Trend3",458}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfPointsAlongYAxisInCouplingArea",1418}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_loc29_3",1578}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Time_Range_Two_E3",249}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"padding_loc9_1",1591}, - {"padding_loc7_1",1590}, - {""}, {""}, {""}, {""}, {""}, - {"padding_loc6_1",1589}, + {""}, + {"extremeValuesRVR4",826}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBase2Trend1",451}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"padding_loc5_1",1588}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBase4Trend4",464}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"ExtremeValuesInMaximumRVR2",59}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"extremeCounterClockwiseWindDirection",822}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"X2InGridLengths",265}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Extra_Data_FreeFormat_0_none",57}, - {""}, {""}, {""}, - {"cloudsBase4Trend3",463}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"Time_Range_One_E3",246}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"RVR2_1",218}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"TYPE_FX",239}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBase3Trend1",456}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"Time_Range_One_E4",247}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"gts_CCCC",912}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"cloudsBase2Trend2",452}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6645,45 +6985,45 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"GRIBEditionNumber",75}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc50_1",1587}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"GRIBEditionNumber",75}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"genVertHeightCoords",877}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"YpInGridLengths",281}, + {""}, {""}, {""}, + {"RVR3_1",219}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"Ensemble_Identifier_E2",53}, - {"cloudsBase4Trend1",461}, - {"padding_loc191_1",1558}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"Time_Range_Two_E3",249}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_grid1_2",1538}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"cloudsBase3Trend2",457}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc9_2",1592}, + {"RVR4_1",220}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Time_Range_Two_E2",248}, + {"padding_loc30_2",1582}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"Time_Range_Two_E4",250}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6691,35 +7031,61 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_loc13_2",1547}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_sec3_1",1604}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"Ensemble_Combinat_Number_0_none_E3",49}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"padding_loc14_2",1552}, + {""}, {""}, {""}, {""}, + {"extremeValuesRVR2",824}, + {""}, {""}, + {"numberOfUsefulPointsAlongYAxis",1444}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_loc3_1",1586}, + {""}, {""}, + {"padding_grid1_1",1537}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"Ensemble_Combinat_Number_0_none_E4",50}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"cloudsBase4Trend2",462}, - {"padding_loc192_1",1561}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_local1_31",1596}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"padding_loc30_1",1581}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"extremeValuesRVR1",823}, + {""}, {""}, {""}, {""}, {""}, + {"padding_loc192_1",1562}, {""}, {""}, {""}, - {"padding_loc13_4",1548}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_loc38_1",1585}, + {""}, {""}, + {"CCCC",21}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"TYPE_PF",242}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_loc13_1",1546}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6729,26 +7095,34 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"TYPE_FC",237}, + {""}, {""}, {""}, {""}, {""}, + {"LBC_Initial_Conditions",98}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"Time_Range_One_E2",245}, + {""}, + {"padding_loc14_1",1551}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"padding_loc191_1",1559}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_loc191_3",1561}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"padding_local_35",1597}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"TYPE_AN",235}, + {""}, {""}, {""}, + {"padding_loc4_2",1587}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"Hour_E2",84}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"padding_loc191_3",1560}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"swapScanningY",2098}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6757,27 +7131,35 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"INGRIB",91}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"padding_grid50_1",1541}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"Missing_Model_LBC",161}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"meanValueRVR4",1257}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"padding_sec4_1",1605}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"RVR2_1",218}, + {""}, {""}, {""}, + {"runwayBrakingActionState2",1787}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"numberOfBitsUsedForTheGroupWidths",1341}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"Time_Range_Two_E2",248}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"TYPE_OR",241}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6786,10 +7168,14 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"meanValueRVR3",1256}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"RVR1_1",217}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"P_TACC",213}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"ExtremeValuesRVR3",64}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6799,30 +7185,30 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc191_2",1559}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"lBB",1033}, - {""}, {""}, {""}, {""}, - {"padding_loc13_5",1549}, {""}, {""}, - {"padding_sec2_3",1602}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"Ensemble_Combinat_Number_0_none_E2",48}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"ExtremeValuesRVR4",65}, + {""}, {""}, {""}, + {"padding_sec2_2",1602}, + {""}, + {"runwayBrakingActionState1",1786}, {""}, {""}, {""}, {""}, - {"padding_grid4_1",1539}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"GG",70}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"padding_grid3_1",1538}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"bitsPerValueAndRepack",366}, + {"padding_loc2_2",1580}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"padding_loc29_2",1577}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6831,52 +7217,65 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"TYPE_CF",236}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"padding_loc12_1",1545}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"Threshold_Or_Distribution_0_no_1_yes",243}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"padding_sec2_1",1601}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"runwayBrakingActionState4",1788}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"LBC_Initial_Conditions",98}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"padding_loc2_1",1579}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"padding_loc29_1",1576}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"padding_loc18_1",1555}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"Missing_Model_LBC",161}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"padding_loc20_1",1564}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"ExtremeValuesInMaximumRVR3",60}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_grid1_1",1536}, + {"YpInGridLengths",281}, {""}, - {"GRIB",71}, + {"7777",5}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_loc16_1",1554}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayBrakingActionState3",1787}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_grid5_1",1542}, + {""}, {""}, {""}, {""}, {""}, + {"padding_loc28_1",1575}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc10_1",1543}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6887,40 +7286,37 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"Less_Than_Or_To_Overall_Distribution",122}, - {""}, - {"meanValueRVR1",1254}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"BUDG",18}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"GRIBEXSection1Problem",72}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"ExtremeValuesInMaximumRVR4",61}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"padding_grid5_1",1541}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"padding_sec2_1",1600}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"Less_Than_Or_To_Overall_Distribution",122}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"ExtremeValuesRVR2",63}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"YY",277}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc2_1",1578}, + {"padding_loc17_2",1555}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6928,105 +7324,69 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"Local_Number_Members_Used_E3",139}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"padding_loc244_1",1566}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"padding_loc19_2",1562}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc18_2",1556}, + {"ExtremeValuesRVR1",62}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"numberOfBitsUsedForTheGroupWidths",1342}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"padding_sec3_1",1603}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_grid1_2",1537}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc29_1",1575}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc28_1",1574}, - {""}, {""}, - {"padding_loc3_1",1585}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Y1InGridLengths",272}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, + {""}, {""}, {""}, {"Local_Number_Members_Used_E4",140}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"padding_loc20_1",1563}, - {""}, {""}, {""}, - {"padding_loc29_3",1577}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"meanValueRVR2",1255}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"meanValueRVR3",1257}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"runwayBrakingActionState1",1785}, - {""}, {""}, {""}, {""}, - {"Local_Number_Members_Used_E3",139}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"padding_sec4_1",1604}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"Ensemble_Combinat_Number_0_none_E4",50}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"padding_loc38_1",1584}, - {""}, {""}, {""}, {""}, - {"padding_sec2_2",1601}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Ensemble_Combinat_Number_0_none_E3",49}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Y2InGridLengths",274}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"padding_loc2_2",1579}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"meanValueRVR4",1258}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc30_1",1580}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"padding_loc244_3",1568}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7039,96 +7399,96 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"padding_loc245_1",1569}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"padding_loc29_2",1576}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_loc191_2",1560}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_loc23_1",1566}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"Threshold_Or_Distribution_Units",244}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"padding_loc15_1",1553}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"runwayBrakingActionState2",1786}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"Missing_Model_LBC_E3",163}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc244_2",1567}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"Local_Number_Members_Used_E2",138}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"padding_loc4_2",1586}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"padding_loc37_2",1584}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"padding_loc30_2",1581}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"Missing_Model_LBC_E4",164}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_loc13_5",1550}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"padding_loc14_1",1550}, - {""}, {""}, - {"Ensemble_Combinat_Number_0_none_E2",48}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"7777",5}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"NINT_RITZ_EXP",181}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"padding_loc13_1",1545}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"padding_loc244_1",1567}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_loc244_3",1569}, + {"GRIBEXSection1Problem",72}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"padding_loc37_1",1583}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7137,10 +7497,10 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc13_3",1547}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Missing_Model_LBC_E4",164}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"ExtremeValuesInMaximumRVR2",59}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7159,8 +7519,6 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"Missing_Model_LBC_E3",163}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7169,47 +7527,50 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"Model_LBC_Member_Identifier",167}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc245_2",1570}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"ExtremeValuesInMaximumRVR1",58}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"Model_LBC_Member_Identifier",167}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"INGRIB",91}, - {"padding_loc14_2",1551}, + {""}, {""}, {""}, {""}, {""}, + {"Y2InGridLengths",274}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"gts_CCCC",912}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"padding_loc21_1",1565}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"padding_loc13_2",1546}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc15_1",1552}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"Local_Number_Members_Used_E2",138}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"Y1InGridLengths",272}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"padding_loc26_1",1572}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"BUDG",18}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"padding_loc12_1",1544}, - {""}, - {"padding_loc23_1",1565}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7222,6 +7583,8 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"TYPE_FC",237}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7229,8 +7592,8 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc16_1",1553}, + {""}, {""}, + {"meanValueRVR2",1256}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7245,41 +7608,45 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"Show_Combination_Ensem_E4_0_no_1_yes",227}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_loc27_2",1574}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"GRIBEXShBugPresent",73}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, - {"padding_loc21_1",1564}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Show_Combination_Ensem_E3_0_no_1_yes",226}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"Original_Parameter_Iden_CodeTable2",204}, + {""}, {""}, {""}, {""}, {""}, + {"meanValueRVR1",1255}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"NINT_RITZ_EXP",181}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"P_TAVG",214}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"padding_loc27_1",1573}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7287,7 +7654,6 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Used_Model_LBC",255}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7301,6 +7667,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"Missing_Model_LBC_E2",162}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7313,8 +7680,6 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"padding_loc26_1",1571}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7322,6 +7687,8 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"Used_Model_LBC",255}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7331,28 +7698,17 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc17_2",1554}, - {""}, {""}, - {"Missing_Model_LBC_E2",162}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"GRIBEX_boustrophedonic",74}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"Show_Combination_Ensem_E2_0_no_1_yes",225}, - {""}, {""}, {""}, - {"Original_Parameter_Iden_CodeTable2",204}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"padding_loc27_1",1572}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7364,8 +7720,6 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"BBB",16}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7379,18 +7733,17 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"NINT_LOG10_RITZ",180}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc37_1",1582}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"padding_loc244_2",1568}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7406,6 +7759,8 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"padding_loc245_1",1570}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7419,8 +7774,6 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc27_2",1573}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7439,6 +7792,8 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"NINT_LOG10_RITZ",180}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7450,8 +7805,6 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"padding_loc37_2",1583}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7482,8 +7835,6 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"GRIBEXShBugPresent",73}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7543,14 +7894,14 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"GRIBEX_boustrophedonic",74}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"At_least__Or_Distribut_Proportion_Of",14}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7628,6 +7979,8 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"At_least__Or_Distribut_Proportion_Of",14}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7648,6 +8001,8 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"padding_loc245_2",1571}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7676,14 +8031,13 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, + {"Show_Combination_Ensem_E3_0_no_1_yes",226}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Used_Model_LBC_E4",258}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"AEC_RESTRICTED_OPTION_MASK",12}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7691,8 +8045,10 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Used_Model_LBC_E3",257}, + {"Show_Combination_Ensem_E4_0_no_1_yes",227}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"GRIB_DEPTH",76}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7710,7 +8066,6 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"AEC_PAD_RSI_OPTION_MASK",11}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7748,8 +8103,6 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"GRIB_LATITUDE",77}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7770,7 +8123,6 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"Used_Model_LBC_E2",256}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7783,17 +8135,19 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"Show_Combination_Ensem_E2_0_no_1_yes",225}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"Used_Model_LBC_E3",257}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"GRIB_DEPTH",76}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7801,6 +8155,8 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"Used_Model_LBC_E4",258}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7853,7 +8209,6 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"AEC_DATA_3BYTE_OPTION_MASK",7}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7890,6 +8245,8 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, + {"Used_Model_LBC_E2",256}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7908,8 +8265,6 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"GRIB_LONGITUDE",78}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -8033,6 +8388,8 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, + {"AEC_DATA_SIGNED_OPTION_MASK",10}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -8048,6 +8405,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"GRIB_LATITUDE",77}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -8084,6 +8442,8 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"AEC_RESTRICTED_OPTION_MASK",12}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -8107,8 +8467,12 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, + {"AEC_PAD_RSI_OPTION_MASK",11}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, + {"GRIB_LONGITUDE",78}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -8143,8 +8507,6 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, - {"AEC_DATA_MSB_OPTION_MASK",8}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -8298,6 +8660,8 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"AEC_DATA_3BYTE_OPTION_MASK",7}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -8547,8 +8911,6 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"AEC_DATA_SIGNED_OPTION_MASK",10}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -8601,6 +8963,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"AEC_DATA_MSB_OPTION_MASK",8}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -8925,10 +9288,15 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, + {""}, {""}, {"AEC_DATA_PREPROCESS_OPTION_MASK",9} }; +#ifdef __GNUC__ + +#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ +#endif +#endif const struct grib_keys_hash * grib_keys_hash_get (const char* str, unsigned int len) { diff --git a/src/grib_ibmfloat.c b/src/grib_ibmfloat.c index 5785bf2fd..fd62861e9 100644 --- a/src/grib_ibmfloat.c +++ b/src/grib_ibmfloat.c @@ -112,7 +112,7 @@ unsigned long grib_ibm_to_long(double x) unsigned long s = 0; unsigned long mmax = 0xffffff; unsigned long mmin = 0x800000; - unsigned long m = mmax; + unsigned long m = 0; unsigned long e = 0; double rmmax = mmax + 0.5; diff --git a/tests/grib_change_packing.sh b/tests/grib_change_packing.sh index 015aeca61..ed45eccfd 100755 --- a/tests/grib_change_packing.sh +++ b/tests/grib_change_packing.sh @@ -18,8 +18,8 @@ packing1=" packing2=" grid_ieee grid_simple - grid_simple_matrix" -#TODO: grid_simple_log_preprocessing + grid_simple_matrix + grid_simple_log_preprocessing" if [ $HAVE_JPEG -eq 1 ]; then packing2="grid_jpeg "$packing2 diff --git a/tests/grib_data_quality_checks.sh b/tests/grib_data_quality_checks.sh index b3a38c686..45c725f7b 100755 --- a/tests/grib_data_quality_checks.sh +++ b/tests/grib_data_quality_checks.sh @@ -122,6 +122,18 @@ set -e [ $status -ne 0 ] +echo "Test limits with steps..." +# ----------------------------- +input1=$ECCODES_SAMPLES_PATH/reduced_gg_pl_48_grib1.tmpl +# This sets the minimum to 1.1 but this should work for step=0 +${tools_dir}/grib_set -s step=0,paramId=121,scaleValuesBy=1.1 $input1 $tempOut + +# But it must fail when step > 0 +set +e +${tools_dir}/grib_set -s step=6,paramId=121,scaleValuesBy=1.1 $input1 $tempOut +set -e +[ $status -ne 0 ] + echo "Override the defaults..." # ------------------------------ diff --git a/tests/keys b/tests/keys index 38717d888..37b2e690e 100644 --- a/tests/keys +++ b/tests/keys @@ -301,7 +301,7 @@ aerosolType,295 aerosolbinnumber,296 aerosolpacking,297 alternativeRowScanning,298 -altitudeOfTheCameraFromTheEarthSCenterMeasuredInUnitsOfTheEarth,299 +altitudeOfTheCameraFromTheEarthsCentreMeasuredInUnitsOfTheEarthsRadius,299 analysisOffsets,300 angleDivisor,301 angleMultiplier,302 @@ -1048,9 +1048,9 @@ latitude,1042 latitudeFirstInDegrees,1043 latitudeLastInDegrees,1044 latitudeLongitudeValues,1045 -latitudeOfCenterPoint,1046 -latitudeOfCenterPointInDegrees,1047 -latitudeOfCentralPointInClusterDomain,1048 +latitudeOfCentralPointInClusterDomain,1046 +latitudeOfCentrePoint,1047 +latitudeOfCentrePointInDegrees,1048 latitudeOfFirstGridPoint,1049 latitudeOfFirstGridPointInDegrees,1050 latitudeOfIcosahedronPole,1051 @@ -1150,1215 +1150,1216 @@ logTransform,1144 longitude,1145 longitudeFirstInDegrees,1146 longitudeLastInDegrees,1147 -longitudeOfCenterPoint,1148 -longitudeOfCenterPointInDegrees,1149 -longitudeOfCentralPointInClusterDomain,1150 +longitudeOfCentralPointInClusterDomain,1148 +longitudeOfCentrePoint,1149 +longitudeOfCentrePointInDegrees,1150 longitudeOfFirstDiamondCenterLine,1151 -longitudeOfFirstDiamondCenterLineInDegrees,1152 -longitudeOfFirstGridPoint,1153 -longitudeOfFirstGridPointInDegrees,1154 -longitudeOfIcosahedronPole,1155 -longitudeOfLastGridPoint,1156 -longitudeOfLastGridPointInDegrees,1157 -longitudeOfNorthWestCornerOfArea,1158 -longitudeOfReferencePoint,1159 -longitudeOfReferencePointInDegrees,1160 -longitudeOfSouthEastCornerOfArea,1161 -longitudeOfSouthernPole,1162 -longitudeOfSouthernPoleInDegrees,1163 -longitudeOfStretchingPole,1164 -longitudeOfStretchingPoleInDegrees,1165 -longitudeOfSubSatellitePoint,1166 -longitudeOfSubSatellitePointInDegrees,1167 -longitudeOfTangencyPoint,1168 -longitudeOfThePoleOfStretching,1169 -longitudeOfThePolePoint,1170 -longitudeOfThePolePointInDegrees,1171 -longitudeOfTheSouthernPoleOfProjection,1172 -longitudeSexagesimal,1173 -longitudes,1174 -longitudesList,1175 -longitudinalDirectionGridLength,1176 -lowerLimit,1177 -lowerRange,1178 -lowerThreshold,1179 -lowerThresholdValue,1180 -ls_labeling,1181 -lsdate_bug,1182 -m,1183 -mAngleMultiplier,1184 -mBasicAngle,1185 -mars,1186 -marsClass,1187 -marsClass1,1188 -marsClass2,1189 -marsDir,1190 -marsDomain,1191 -marsEndStep,1192 -marsExperimentOffset,1193 -marsExpver,1194 -marsForecastMonth,1195 -marsGrid,1196 -marsIdent,1197 -marsKeywords,1198 -marsKeywords1,1199 -marsLamModel,1200 -marsLatitude,1201 -marsLevel,1202 -marsLevelist,1203 -marsLongitude,1204 -marsModel,1205 -marsParam,1206 -marsQuantile,1207 -marsRange,1208 -marsStartStep,1209 -marsStep,1210 -marsStream,1211 -marsStream1,1212 -marsStream2,1213 -marsType,1214 -marsType1,1215 -marsType2,1216 -mars_labeling,1217 -mask,1218 -masterDir,1219 -masterTableNumber,1220 -masterTablesVersionNumber,1221 -masterTablesVersionNumberLatest,1222 -matchAerosolBinNumber,1223 -matchAerosolPacking,1224 -matchLandType,1225 -matchSort,1226 -matchTimeRepres,1227 -matrixBitmapsPresent,1228 -matrixOfValues,1229 -max,1230 -maximum,1231 -md5Data,1232 -md5DataSection,1233 -md5GridSection,1234 -md5Headers,1235 -md5Product,1236 -md5Section1,1237 -md5Section10,1238 -md5Section2,1239 -md5Section3,1240 -md5Section4,1241 -md5Section5,1242 -md5Section6,1243 -md5Section7,1244 -md5Section8,1245 -md5Section9,1246 -md5Structure,1247 -md5TimeDomainSection,1248 -meanRVR1,1249 -meanRVR2,1250 -meanRVR3,1251 -meanRVR4,1252 -meanSize,1253 -meanValueRVR1,1254 -meanValueRVR2,1255 -meanValueRVR3,1256 -meanValueRVR4,1257 -meaningOfVerticalCoordinate,1258 -memberNumber,1259 -messageLength,1260 -metadata,1261 -method,1262 -methodNumber,1263 -million,1264 -min,1265 -minimum,1266 -minute,1267 -minuteOfAnalysis,1268 -minuteOfEndOfOverallTimeInterval,1269 -minuteOfForecast,1270 -minuteOfModelVersion,1271 -minuteOfReference,1272 -minutesAfterDataCutoff,1273 -minutesAfterReferenceTimeOfDataCutoff,1274 -missingDataFlag,1275 -missingValue,1276 -missingValueManagement,1277 -missingValueManagementUsed,1278 -missingValuesPresent,1279 -mixedCoordinateDefinition,1280 -mixedCoordinateFieldFlag,1281 -modeNumber,1282 -model,1283 -modelErrorType,1284 -modelIdentifier,1285 -modelName,1286 -modelVersionDate,1287 -modelVersionTime,1288 -molarMass,1289 -month,1290 -monthOfAnalysis,1291 -monthOfEndOfOverallTimeInterval,1292 -monthOfForecast,1293 -monthOfModelVersion,1294 -monthOfReference,1295 -monthlyVerificationDate,1296 -monthlyVerificationMonth,1297 -monthlyVerificationTime,1298 -monthlyVerificationYear,1299 -multiplicationFactorForLatLong,1300 -mybits,1301 -n,1302 -n2,1303 -n3,1304 -na,1305 -name,1306 -nameECMF,1307 -nameOfFirstFixedSurface,1308 -nameOfSecondFixedSurface,1309 -names,1310 -nd,1311 -neitherPresent,1312 -newSubtype,1313 -nlev,1314 -nnn,1315 -normAtFinalTime,1316 -normAtInitialTime,1317 -normal,1318 -northLatitudeOfCluster,1319 -northLatitudeOfDomainOfTubing,1320 -northWestLatitudeOfLPOArea,1321 -northWestLatitudeOfVerficationArea,1322 -northWestLongitudeOfLPOArea,1323 -northWestLongitudeOfVerficationArea,1324 -northernLatitudeOfClusterDomain,1325 -northernLatitudeOfDomain,1326 -nosigPresent,1327 -notDecoded,1328 -nt,1329 -number,1330 -numberInHorizontalCoordinates,1331 -numberInMixedCoordinateDefinition,1332 -numberInTheAuxiliaryArray,1333 -numberInTheGridCoordinateList,1334 -numberIncludedInAverage,1335 -numberMissingFromAveragesOrAccumulations,1336 -numberOfAnalysis,1337 -numberOfBits,1338 -numberOfBitsContainingEachPackedValue,1339 -numberOfBitsForScaledGroupLengths,1340 -numberOfBitsUsedForTheGroupWidths,1341 -numberOfBitsUsedForTheScaledGroupLengths,1342 -numberOfBytesInLocalDefinition,1343 -numberOfBytesOfFreeFormatData,1344 -numberOfBytesPerInteger,1345 -numberOfCategories,1346 -numberOfCharacters,1347 -numberOfChars,1348 -numberOfClusterHighResolution,1349 -numberOfClusterLowResolution,1350 -numberOfClusters,1351 -numberOfCodedValues,1352 -numberOfCoefficientsOrValuesUsedToSpecifyFirstDimensionCoordinateFunction,1353 -numberOfCoefficientsOrValuesUsedToSpecifySecondDimensionCoordinateFunction,1354 -numberOfColumns,1355 -numberOfComponents,1356 -numberOfContributingSpectralBands,1357 -numberOfControlForecastTube,1358 -numberOfCoordinatesValues,1359 -numberOfDataBinsAlongRadials,1360 -numberOfDataMatrices,1361 -numberOfDataPoints,1362 -numberOfDataPointsExpected,1363 -numberOfDataValues,1364 -numberOfDaysInClimateSamplingWindow,1365 -numberOfDiamonds,1366 -numberOfDirections,1367 -numberOfDistinctSection3s,1368 -numberOfDistinctSection4s,1369 -numberOfDistinctSection5s,1370 -numberOfDistinctSection6s,1371 -numberOfDistinctSection7s,1372 -numberOfDistinctSection8s,1373 -numberOfDistinctSection9s,1374 -numberOfDistributionFunctionParameters,1375 -numberOfEffectiveValues,1376 -numberOfFloats,1377 -numberOfForcasts,1378 -numberOfForecastsInCluster,1379 -numberOfForecastsInEnsemble,1380 -numberOfForecastsInTheCluster,1381 -numberOfForecastsInTube,1382 -numberOfFrequencies,1383 -numberOfGridInReference,1384 -numberOfGridUsed,1385 -numberOfGroups,1386 -numberOfGroupsOfDataValues,1387 -numberOfHorizontalPoints,1388 -numberOfIntegers,1389 -numberOfInts,1390 -numberOfIterations,1391 -numberOfLocalDefinitions,1392 -numberOfLogicals,1393 -numberOfMembersInCluster,1394 -numberOfMembersInEnsemble,1395 -numberOfMissing,1396 -numberOfMissingInStatisticalProcess,1397 -numberOfMissingValues,1398 -numberOfModeOfDistribution,1399 -numberOfModels,1400 -numberOfOctectsForNumberOfPoints,1401 -numberOfOctetsExtraDescriptors,1402 -numberOfOperationalForecastTube,1403 -numberOfPackedValues,1404 -numberOfParallelsBetweenAPoleAndTheEquator,1405 -numberOfParametersUsedForClustering,1406 -numberOfPartitions,1407 -numberOfPoints,1408 -numberOfPointsAlongAMeridian,1409 -numberOfPointsAlongAParallel,1410 -numberOfPointsAlongFirstAxis,1411 -numberOfPointsAlongSecondAxis,1412 -numberOfPointsAlongTheXAxis,1413 -numberOfPointsAlongTheYAxis,1414 -numberOfPointsAlongXAxis,1415 -numberOfPointsAlongXAxisInCouplingArea,1416 -numberOfPointsAlongYAxis,1417 -numberOfPointsAlongYAxisInCouplingArea,1418 -numberOfPointsInDomain,1419 -numberOfPointsUsed,1420 -numberOfPressureLevelsUsedForClustering,1421 -numberOfRadarSitesUsed,1422 -numberOfRadials,1423 -numberOfReforecastYearsInModelClimate,1424 -numberOfRemaininChars,1425 -numberOfRepresentativeMember,1426 -numberOfReservedBytes,1427 -numberOfRows,1428 -numberOfSecondOrderPackedValues,1429 -numberOfSection,1430 -numberOfSingularVectorsComputed,1431 -numberOfSingularVectorsEvolved,1432 -numberOfStepsUsedForClustering,1433 -numberOfSubsets,1434 -numberOfTensOfThousandsOfYearsOfOffset,1435 -numberOfTimeRange,1436 -numberOfTimeSteps,1437 -numberOfUnexpandedDescriptors,1438 -numberOfUnusedBitsAtEndOfSection3,1439 -numberOfUsedSpatialTiles,1440 -numberOfUsedTileAttributes,1441 -numberOfUsefulPointsAlongXAxis,1442 -numberOfUsefulPointsAlongYAxis,1443 -numberOfVGridUsed,1444 -numberOfValues,1445 -numberOfVerticalCoordinateValues,1446 -numberOfVerticalGridDescriptors,1447 -numberOfVerticalPoints,1448 -numberingOrderOfDiamonds,1449 -numericValues,1450 -observablePropertyTemplate,1451 -observablePropertyTemplateNumber,1452 -observationDiagnostic,1453 -observationGeneratingProcessIdentifier,1454 -observationType,1455 -observedData,1456 -obstype,1457 -oceanAtmosphereCoupling,1458 -oceanLevName,1459 -oceanStream,1460 -octetAtWichPackedDataBegins,1461 -offset,1462 -offsetAfterBitmap,1463 -offsetAfterCentreLocalSection,1464 -offsetAfterData,1465 -offsetAfterLocalSection,1466 -offsetAfterPadding,1467 -offsetBBitmap,1468 -offsetBSection5,1469 -offsetBSection6,1470 -offsetBSection9,1471 -offsetBeforeBitmap,1472 -offsetBeforeData,1473 -offsetBeforePL,1474 -offsetBeforePV,1475 -offsetDescriptors,1476 -offsetEndSection4,1477 -offsetFreeFormData,1478 -offsetFromOriginToInnerBound,1479 -offsetFromReferenceOfFirstTime,1480 -offsetICEFieldsUsed,1481 -offsetSection0,1482 -offsetSection1,1483 -offsetSection10,1484 -offsetSection11,1485 -offsetSection2,1486 -offsetSection3,1487 -offsetSection4,1488 -offsetSection5,1489 -offsetSection6,1490 -offsetSection7,1491 -offsetSection8,1492 -offsetSection9,1493 -offsetToEndOf4DvarWindow,1494 -offsetValuesBy,1495 -oldSubtype,1496 -one,1497 -oneConstant,1498 -oneMillionConstant,1499 -oneMinuteMeanMaximumRVR1,1500 -oneMinuteMeanMaximumRVR2,1501 -oneMinuteMeanMaximumRVR3,1502 -oneMinuteMeanMaximumRVR4,1503 -oneMinuteMeanMinimumRVR1,1504 -oneMinuteMeanMinimumRVR2,1505 -oneMinuteMeanMinimumRVR3,1506 -oneMinuteMeanMinimumRVR4,1507 -oneThousand,1508 -oper,1509 -operStream,1510 -operatingMode,1511 -operationalForecastCluster,1512 -optimisationTime,1513 -optimizeScaleFactor,1514 -optionalData,1515 -opttime,1516 -orderOfSPD,1517 -orderOfSpatialDifferencing,1518 -orientationOfTheGrid,1519 -orientationOfTheGridInDegrees,1520 -origin,1521 -originalParameterNumber,1522 -originalParameterTableNumber,1523 -originalSubCentreIdentifier,1524 -originatingCentre,1525 -originatingCentreOfAnalysis,1526 -originatorLocalTemplate,1527 -originatorLocalTemplateNumber,1528 -overlayTemplate,1529 -overlayTemplateNumber,1530 -pack,1531 -packedValues,1532 -packingError,1533 -packingType,1534 -padding,1535 -padding_grid1_1,1536 -padding_grid1_2,1537 -padding_grid3_1,1538 -padding_grid4_1,1539 -padding_grid50_1,1540 -padding_grid5_1,1541 -padding_grid90_1,1542 -padding_loc10_1,1543 -padding_loc12_1,1544 -padding_loc13_1,1545 -padding_loc13_2,1546 -padding_loc13_3,1547 -padding_loc13_4,1548 -padding_loc13_5,1549 -padding_loc14_1,1550 -padding_loc14_2,1551 -padding_loc15_1,1552 -padding_loc16_1,1553 -padding_loc17_2,1554 -padding_loc18_1,1555 -padding_loc18_2,1556 -padding_loc190_1,1557 -padding_loc191_1,1558 -padding_loc191_2,1559 -padding_loc191_3,1560 -padding_loc192_1,1561 -padding_loc19_2,1562 -padding_loc20_1,1563 -padding_loc21_1,1564 -padding_loc23_1,1565 -padding_loc244_1,1566 -padding_loc244_2,1567 -padding_loc244_3,1568 -padding_loc245_1,1569 -padding_loc245_2,1570 -padding_loc26_1,1571 -padding_loc27_1,1572 -padding_loc27_2,1573 -padding_loc28_1,1574 -padding_loc29_1,1575 -padding_loc29_2,1576 -padding_loc29_3,1577 -padding_loc2_1,1578 -padding_loc2_2,1579 -padding_loc30_1,1580 -padding_loc30_2,1581 -padding_loc37_1,1582 -padding_loc37_2,1583 -padding_loc38_1,1584 -padding_loc3_1,1585 -padding_loc4_2,1586 -padding_loc50_1,1587 -padding_loc5_1,1588 -padding_loc6_1,1589 -padding_loc7_1,1590 -padding_loc9_1,1591 -padding_loc9_2,1592 -padding_local11_1,1593 -padding_local1_1,1594 -padding_local1_31,1595 -padding_local40_1,1596 -padding_local_35,1597 -padding_local_7_1,1598 -padding_sec1_loc,1599 -padding_sec2_1,1600 -padding_sec2_2,1601 -padding_sec2_3,1602 -padding_sec3_1,1603 -padding_sec4_1,1604 -paleontologicalOffset,1605 -param,1606 -paramId,1607 -paramIdECMF,1608 -param_value_max,1609 -param_value_min,1610 -parameter,1611 -parameterCategory,1612 -parameterCode,1613 -parameterDiscipline,1614 -parameterIndicator,1615 -parameterName,1616 -parameterNumber,1617 -parameterUnits,1618 -parameters,1619 -parametersVersion,1620 -partitionItems,1621 -partitionNumber,1622 -partitionTable,1623 -partitions,1624 -pastTendencyRVR1,1625 -pastTendencyRVR2,1626 -pastTendencyRVR3,1627 -pastTendencyRVR4,1628 -patch_precip_fp,1629 -pentagonalResolutionParameterJ,1630 -pentagonalResolutionParameterK,1631 -pentagonalResolutionParameterM,1632 -percentileValue,1633 -periodOfTime,1634 -periodOfTimeIntervals,1635 -perturbationNumber,1636 -perturbedType,1637 -phase,1638 -physicalFlag1,1639 -physicalFlag2,1640 -physicalMeaningOfVerticalCoordinate,1641 -pl,1642 -platform,1643 -plusOneinOrdersOfSPD,1644 -points,1645 -postAuxiliary,1646 -postAuxiliaryArrayPresent,1647 -powerOfTenUsedToScaleClimateWeight,1648 -preBitmapValues,1649 -preProcessingParameter,1650 -precision,1651 -precisionOfTheUnpackedSubset,1652 -predefined_grid,1653 -predefined_grid_values,1654 -present,1655 -presentTrend1,1656 -presentTrend2,1657 -presentTrend3,1658 -presentTrend4,1659 -presentWeather1Present,1660 -presentWeather1PresentTrend1,1661 -presentWeather1PresentTrend2,1662 -presentWeather1PresentTrend3,1663 -presentWeather1PresentTrend4,1664 -presentWeather2Present,1665 -presentWeather2PresentTrend1,1666 -presentWeather2PresentTrend2,1667 -presentWeather2PresentTrend3,1668 -presentWeather2PresentTrend4,1669 -presentWeather3Present,1670 -presentWeather3PresentTrend1,1671 -presentWeather3PresentTrend2,1672 -presentWeather3PresentTrend3,1673 -presentWeather3PresentTrend4,1674 -pressureLevel,1675 -pressureUnits,1676 -primaryBitmap,1677 -primaryMissingValue,1678 -primaryMissingValueSubstitute,1679 -probContinous,1680 -probPoint,1681 -probProductDefinition,1682 -probabilityType,1683 -probabilityTypeName,1684 -process,1685 -produceLargeConstantFields,1686 -product,1687 -productDefinition,1688 -productDefinitionTemplateNumber,1689 -productDefinitionTemplateNumberInternal,1690 -productIdentifier,1691 -productType,1692 -productionStatusOfProcessedData,1693 -projectLocalTemplate,1694 -projectLocalTemplateNumber,1695 -projectionCenterFlag,1696 -projectionCentreFlag,1697 -pv,1698 -pvlLocation,1699 -qfe,1700 -qfePresent,1701 -qfeUnits,1702 -qnh,1703 -qnhAPresent,1704 -qnhPresent,1705 -qnhUnits,1706 -qualityControl,1707 -qualityControlIndicator,1708 -qualityValueAssociatedWithParameter,1709 -quantile,1710 -radialAngularSpacing,1711 -radials,1712 -radius,1713 -radiusInMetres,1714 -radiusOfCentralCluster,1715 -radiusOfClusterDomain,1716 -radiusOfTheEarth,1717 -range,1718 -rangeBinSpacing,1719 -rdbDateTime,1720 -rdbSubtype,1721 -rdbType,1722 -rdb_key,1723 -rdbtime,1724 -rdbtimeDate,1725 -rdbtimeDay,1726 -rdbtimeHour,1727 -rdbtimeMinute,1728 -rdbtimeMonth,1729 -rdbtimeSecond,1730 -rdbtimeTime,1731 -rdbtimeYear,1732 -realPart,1733 -realPartOf00,1734 -recDateTime,1735 -recentWeather,1736 -recentWeatherTry,1737 -rectime,1738 -rectimeDay,1739 -rectimeHour,1740 -rectimeMinute,1741 -rectimeSecond,1742 -reducedGrid,1743 -refdate,1744 -reference,1745 -referenceDate,1746 -referenceForGroupLengths,1747 -referenceForGroupWidths,1748 -referenceOfLengths,1749 -referenceOfWidths,1750 -referenceReflectivityForEchoTop,1751 -referenceSampleInterval,1752 -referenceStep,1753 -referenceValue,1754 -referenceValueError,1755 -reflectivityCalibrationConstant,1756 -remarkPresent,1757 -reportType,1758 -representationMode,1759 -representationType,1760 -representativeMember,1761 -reserved,1762 -reserved1,1763 -reserved2,1764 -reserved3,1765 -reservedNeedNotBePresent,1766 -reservedOctet,1767 -reservedSection2,1768 -reservedSection3,1769 -reservedSection4,1770 -resolutionAndComponentFlags,1771 -resolutionAndComponentFlags1,1772 -resolutionAndComponentFlags2,1773 -resolutionAndComponentFlags3,1774 -resolutionAndComponentFlags4,1775 -resolutionAndComponentFlags6,1776 -resolutionAndComponentFlags7,1777 -resolutionAndComponentFlags8,1778 -rootGroupObjectHeaderAddress,1779 -rootGroupSymbolTableEntry,1780 -rootTablesDir,1781 -roundedMarsLatitude,1782 -roundedMarsLevelist,1783 -roundedMarsLongitude,1784 -runwayBrakingActionState1,1785 -runwayBrakingActionState2,1786 -runwayBrakingActionState3,1787 -runwayBrakingActionState4,1788 -runwayDepositCodeState1,1789 -runwayDepositCodeState2,1790 -runwayDepositCodeState3,1791 -runwayDepositCodeState4,1792 -runwayDepositState1,1793 -runwayDepositState2,1794 -runwayDepositState3,1795 -runwayDepositState4,1796 -runwayDepthOfDepositCodeState1,1797 -runwayDepthOfDepositCodeState2,1798 -runwayDepthOfDepositCodeState3,1799 -runwayDepthOfDepositCodeState4,1800 -runwayDepthOfDepositState1,1801 -runwayDepthOfDepositState2,1802 -runwayDepthOfDepositState3,1803 -runwayDepthOfDepositState4,1804 -runwayDesignatorRVR1,1805 -runwayDesignatorRVR2,1806 -runwayDesignatorRVR3,1807 -runwayDesignatorRVR4,1808 -runwayDesignatorState1,1809 -runwayDesignatorState2,1810 -runwayDesignatorState3,1811 -runwayDesignatorState4,1812 -runwayExtentOfContaminationCodeState1,1813 -runwayExtentOfContaminationCodeState2,1814 -runwayExtentOfContaminationCodeState3,1815 -runwayExtentOfContaminationCodeState4,1816 -runwayExtentOfContaminationState1,1817 -runwayExtentOfContaminationState2,1818 -runwayExtentOfContaminationState3,1819 -runwayExtentOfContaminationState4,1820 -runwayFrictionCodeValueState1,1821 -runwayFrictionCodeValueState2,1822 -runwayFrictionCodeValueState3,1823 -runwayFrictionCodeValueState4,1824 -runwayFrictionCoefficientCodeState1,1825 -runwayFrictionCoefficientCodeState2,1826 -runwayFrictionCoefficientCodeState3,1827 -runwayFrictionCoefficientCodeState4,1828 -runwayFrictionCoefficientState1,1829 -runwayFrictionCoefficientState2,1830 -runwayFrictionCoefficientState3,1831 -runwayFrictionCoefficientState4,1832 -runwaySideCodeState1,1833 -runwaySideCodeState2,1834 -runwaySideCodeState3,1835 -runwaySideCodeState4,1836 -runwayState,1837 -sampleSizeOfModelClimate,1838 -satelliteID,1839 -satelliteIdentifier,1840 -satelliteNumber,1841 -satelliteSeries,1842 -scaleFactorAtReferencePoint,1843 -scaleFactorOfCentralWaveNumber,1844 -scaleFactorOfDistanceFromEnsembleMean,1845 -scaleFactorOfDistributionFunctionParameter,1846 -scaleFactorOfEarthMajorAxis,1847 -scaleFactorOfEarthMinorAxis,1848 -scaleFactorOfFirstFixedSurface,1849 -scaleFactorOfFirstSize,1850 -scaleFactorOfFirstWavelength,1851 -scaleFactorOfLengthOfSemiMajorAxis,1852 -scaleFactorOfLengthOfSemiMinorAxis,1853 -scaleFactorOfLowerLimit,1854 -scaleFactorOfMajorAxisOfOblateSpheroidEarth,1855 -scaleFactorOfMinorAxisOfOblateSpheroidEarth,1856 -scaleFactorOfPrimeMeridianOffset,1857 -scaleFactorOfRadiusOfSphericalEarth,1858 -scaleFactorOfSecondFixedSurface,1859 -scaleFactorOfSecondSize,1860 -scaleFactorOfSecondWavelength,1861 -scaleFactorOfStandardDeviation,1862 -scaleFactorOfStandardDeviationInTheCluster,1863 -scaleFactorOfUpperLimit,1864 -scaleValuesBy,1865 -scaledDirections,1866 -scaledFrequencies,1867 -scaledValueOfCentralWaveNumber,1868 -scaledValueOfDistanceFromEnsembleMean,1869 -scaledValueOfDistributionFunctionParameter,1870 -scaledValueOfEarthMajorAxis,1871 -scaledValueOfEarthMinorAxis,1872 -scaledValueOfFirstFixedSurface,1873 -scaledValueOfFirstSize,1874 -scaledValueOfFirstWavelength,1875 -scaledValueOfLengthOfSemiMajorAxis,1876 -scaledValueOfLengthOfSemiMinorAxis,1877 -scaledValueOfLowerLimit,1878 -scaledValueOfMajorAxisOfOblateSpheroidEarth,1879 -scaledValueOfMinorAxisOfOblateSpheroidEarth,1880 -scaledValueOfPrimeMeridianOffset,1881 -scaledValueOfRadiusOfSphericalEarth,1882 -scaledValueOfSecondFixedSurface,1883 -scaledValueOfSecondSize,1884 -scaledValueOfSecondWavelength,1885 -scaledValueOfStandardDeviation,1886 -scaledValueOfStandardDeviationInTheCluster,1887 -scaledValueOfUpperLimit,1888 -scalingFactorForFrequencies,1889 -scanPosition,1890 -scanningMode,1891 -scanningMode4,1892 -scanningMode5,1893 -scanningMode6,1894 -scanningMode7,1895 -scanningMode8,1896 -scanningModeForOneDiamond,1897 -sd,1898 -second,1899 -secondDimension,1900 -secondDimensionCoordinateValueDefinition,1901 -secondDimensionPhysicalSignificance,1902 -secondLatitude,1903 -secondLatitudeInDegrees,1904 -secondOfEndOfOverallTimeInterval,1905 -secondOfForecast,1906 -secondOfModelVersion,1907 -secondOrderFlags,1908 -secondOrderOfDifferentWidth,1909 -secondOrderValuesDifferentWidths,1910 -secondaryBitMap,1911 -secondaryBitmap,1912 -secondaryBitmapPresent,1913 -secondaryBitmaps,1914 -secondaryBitmapsCount,1915 -secondaryBitmapsSize,1916 -secondaryMissingValue,1917 -secondaryMissingValueSubstitute,1918 -secondsOfAnalysis,1919 -secondsOfReference,1920 -section,1921 -section0Length,1922 -section0Pointer,1923 -section1,1924 -section10Length,1925 -section10Pointer,1926 -section11Length,1927 -section11Pointer,1928 -section1Flags,1929 -section1Length,1930 -section1Padding,1931 -section1Pointer,1932 -section2Length,1933 -section2Padding,1934 -section2Pointer,1935 -section2Present,1936 -section2Used,1937 -section3Flags,1938 -section3Length,1939 -section3Padding,1940 -section3Pointer,1941 -section3UniqueIdentifier,1942 -section4,1943 -section4Length,1944 -section4Padding,1945 -section4Pointer,1946 -section4UniqueIdentifier,1947 -section5,1948 -section5Length,1949 -section5Pointer,1950 -section5UniqueIdentifier,1951 -section6,1952 -section6Length,1953 -section6Pointer,1954 -section6UniqueIdentifier,1955 -section7,1956 -section7Length,1957 -section7Pointer,1958 -section7UniqueIdentifier,1959 -section8,1960 -section8Length,1961 -section8Pointer,1962 -section8UniqueIdentifier,1963 -section9Length,1964 -section9Pointer,1965 -section9UniqueIdentifier,1966 -sectionLengthLimitForEnsembles,1967 -sectionLengthLimitForProbability,1968 -sectionNumber,1969 -sectionPosition,1970 -section_01,1971 -section_02,1972 -section_03,1973 -section_04,1974 -section_05,1975 -section_06,1976 -section_07,1977 -section_08,1978 -section_09,1979 -section_1,1980 -section_10,1981 -section_11,1982 -section_2,1983 -section_3,1984 -section_4,1985 -section_5,1986 -section_6,1987 -section_7,1988 -section_8,1989 -selectStepTemplateInstant,1990 -selectStepTemplateInterval,1991 -sensitiveAreaDomain,1992 -sequences,1993 -setBitsPerValue,1994 -setCalendarId,1995 -setDecimalPrecision,1996 -setLocalDefinition,1997 -setToMissingIfOutOfRange,1998 -sfc_levtype,1999 -shapeOfTheEarth,2000 -shapeOfVerificationArea,2001 -shortName,2002 -shortNameECMF,2003 -short_name,2004 -signature,2005 -significanceOfReferenceDateAndTime,2006 -significanceOfReferenceTime,2007 -simpleThinningMissingRadius,2008 -simpleThinningSkip,2009 -simpleThinningStart,2010 -siteElevation,2011 -siteId,2012 -siteLatitude,2013 -siteLongitude,2014 -sizeOfLength,2015 -sizeOfOffsets,2016 -sizeOfPostAuxiliaryArray,2017 -sizeOfPostAuxiliaryArrayPlusOne,2018 -skew,2019 -skewness,2020 -skipExtraKeyAttributes,2021 -sort,2022 -sourceOfGridDefinition,2023 -sourceSinkChemicalPhysicalProcess,2024 -southEastLatitudeOfLPOArea,2025 -southEastLatitudeOfVerficationArea,2026 -southEastLongitudeOfLPOArea,2027 -southEastLongitudeOfVerficationArea,2028 -southLatitudeOfCluster,2029 -southLatitudeOfDomainOfTubing,2030 -southPoleOnProjectionPlane,2031 -southernLatitudeOfClusterDomain,2032 -southernLatitudeOfDomain,2033 -sp1,2034 -sp2,2035 -sp3,2036 -spaceUnitFlag,2037 -spacingOfBinsAlongRadials,2038 -spare,2039 -spare2,2040 -spatialProcessing,2041 -spatialSmoothingOfProduct,2042 -spectralDataRepresentationMode,2043 -spectralDataRepresentationType,2044 -spectralMode,2045 -spectralType,2046 -sphericalHarmonics,2047 -standardDeviation,2048 -standardParallel,2049 -standardParallelInDegrees,2050 -standardParallelInMicrodegrees,2051 -startOfHeaders,2052 -startOfMessage,2053 -startOfRange,2054 -startStep,2055 -startStepInHours,2056 -startTimeStep,2057 -startingAzimuth,2058 -statisticalProcess,2059 -statisticalProcessesList,2060 -statistics,2061 -status,2062 -step,2063 -stepForClustering,2064 -stepInHours,2065 -stepRange,2066 -stepRangeInHours,2067 -stepType,2068 -stepTypeForConversion,2069 -stepTypeInternal,2070 -stepUnits,2071 -stepZero,2072 -stream,2073 -streamOfAnalysis,2074 -stretchingFactor,2075 -stretchingFactorScaled,2076 -stringValues,2077 -subCentre,2078 -subDefinitions1,2079 -subDefinitions2,2080 -subLocalDefinition1,2081 -subLocalDefinition2,2082 -subLocalDefinitionLength1,2083 -subLocalDefinitionLength2,2084 -subLocalDefinitionNumber1,2085 -subLocalDefinitionNumber2,2086 -subSetJ,2087 -subSetK,2088 -subSetM,2089 -subcentreOfAnalysis,2090 -subdivisionsOfBasicAngle,2091 -suiteName,2092 -superblockExtensionAddress,2093 -swapScanningLat,2094 -swapScanningLon,2095 -swapScanningX,2096 -swapScanningY,2097 -system,2098 -systemNumber,2099 -t,2100 -table2Version,2101 -tableCode,2102 -tableNumber,2103 -tableReference,2104 -tablesLocalDir,2105 -tablesMasterDir,2106 -tablesVersion,2107 -tablesVersionLatest,2108 -targetCompressionRatio,2109 -td,2110 -tempPressureUnits,2111 -temperature,2112 -temperatureAndDewpointPresent,2113 -templatesLocalDir,2114 -templatesMasterDir,2115 -theHindcastMarsStream,2116 -theMessage,2117 -thisExperimentVersionNumber,2118 -thisMarsClass,2119 -thisMarsStream,2120 -thisMarsType,2121 -thousand,2122 -three,2123 -threshold,2124 -thresholdIndicator,2125 -tiggeCentre,2126 -tiggeLAMName,2127 -tiggeLocalVersion,2128 -tiggeModel,2129 -tiggeSection,2130 -tiggeSuiteID,2131 -tigge_name,2132 -tigge_short_name,2133 -tileClassification,2134 -tileIndex,2135 -time,2136 -timeCoordinateDefinition,2137 -timeDomainTemplate,2138 -timeDomainTemplateNumber,2139 -timeIncrement,2140 -timeIncrementBetweenSuccessiveFields,2141 -timeOfAnalysis,2142 -timeOfForecast,2143 -timeOfModelVersion,2144 -timeOfReference,2145 -timeRangeIndicator,2146 -timeRangeIndicatorFromStepRange,2147 -timeUnitFlag,2148 -timerepres,2149 -topLevel,2150 -total,2151 -totalAerosolBinsNumbers,2152 -totalInitialConditions,2153 -totalLength,2154 -totalNumber,2155 -totalNumberOfClusters,2156 -totalNumberOfDataValuesMissingInStatisticalProcess,2157 -totalNumberOfDirections,2158 -totalNumberOfForecastProbabilities,2159 -totalNumberOfFrequencies,2160 -totalNumberOfGridPoints,2161 -totalNumberOfIterations,2162 -totalNumberOfRepetitions,2163 -totalNumberOfTileAttributePairs,2164 -totalNumberOfTubes,2165 -totalNumberOfValuesInUnpackedSubset,2166 -totalNumberOfdimensions,2167 -treatmentOfMissingData,2168 -true,2169 -trueLengthOfLastGroup,2170 -truncateDegrees,2171 -truncateLaplacian,2172 -tsectionNumber3,2173 -tsectionNumber4,2174 -tsectionNumber5,2175 -tubeDomain,2176 -tubeNumber,2177 -two,2178 -twoOrdersOfSPD,2179 -type,2180 -typeOfAnalysis,2181 -typeOfAuxiliaryInformation,2182 -typeOfCalendar,2183 -typeOfCompressionUsed,2184 -typeOfDistributionFunction,2185 -typeOfEnsembleForecast,2186 -typeOfEnsembleMember,2187 -typeOfFirstFixedSurface,2188 -typeOfGeneratingProcess,2189 -typeOfGrid,2190 -typeOfHorizontalLine,2191 -typeOfIntervalForFirstAndSecondSize,2192 -typeOfIntervalForFirstAndSecondWavelength,2193 -typeOfLevel,2194 -typeOfLevelECMF,2195 -typeOfOriginalFieldValues,2196 -typeOfPacking,2197 -typeOfPostProcessing,2198 -typeOfPreProcessing,2199 -typeOfProcessedData,2200 -typeOfSSTFieldUsed,2201 -typeOfSecondFixedSurface,2202 -typeOfSizeInterval,2203 -typeOfStatisticalPostProcessingOfEnsembleMembers,2204 -typeOfStatisticalProcessing,2205 -typeOfTimeIncrement,2206 -typeOfTimeIncrementBetweenSuccessiveFieldsUsedInTheStatisticalProcessing,2207 -typeOfWavelengthInterval,2208 -typicalCentury,2209 -typicalDate,2210 -typicalDateTime,2211 -typicalDay,2212 -typicalHour,2213 -typicalMinute,2214 -typicalMonth,2215 -typicalSecond,2216 -typicalTime,2217 -typicalYear,2218 -typicalYear2,2219 -typicalYearOfCentury,2220 -uco,2221 -ucs,2222 -unexpandedDescriptors,2223 -unexpandedDescriptorsEncoded,2224 -unitOfOffsetFromReferenceTime,2225 -unitOfTime,2226 -unitOfTimeIncrement,2227 -unitOfTimeRange,2228 -units,2229 -unitsBias,2230 -unitsConversionOffset,2231 -unitsConversionScaleFactor,2232 -unitsDecimalScaleFactor,2233 -unitsECMF,2234 -unitsFactor,2235 -unitsOfFirstFixedSurface,2236 -unitsOfSecondFixedSurface,2237 -unknown,2238 -unpack,2239 -unpackedError,2240 -unpackedSubsetPrecision,2241 -unpackedValues,2242 -unsignedIntegers,2243 -unusedBitsInBitmap,2244 -updateSequenceNumber,2245 -upperLimit,2246 -upperRange,2247 -upperThreshold,2248 -upperThresholdValue,2249 -userDateEnd,2250 -userDateStart,2251 -userDateTimeEnd,2252 -userDateTimeStart,2253 -userTimeEnd,2254 -userTimeStart,2255 -uuidOfHGrid,2256 -uuidOfVGrid,2257 -uvRelativeToGrid,2258 -validityDate,2259 -validityTime,2260 -values,2261 -variationOfVisibility,2262 -variationOfVisibilityDirection,2263 -variationOfVisibilityDirectionAngle,2264 -variationOfVisibilityDirectionTrend1,2265 -variationOfVisibilityDirectionTrend2,2266 -variationOfVisibilityDirectionTrend3,2267 -variationOfVisibilityDirectionTrend4,2268 -variationOfVisibilityTrend1,2269 -variationOfVisibilityTrend2,2270 -variationOfVisibilityTrend3,2271 -variationOfVisibilityTrend4,2272 -varno,2273 -verificationDate,2274 -verificationMonth,2275 -verificationYear,2276 -verifyingMonth,2277 -version,2278 -versionNumOfFilesFreeSpaceStorage,2279 -versionNumOfRootGroupSymbolTableEntry,2280 -versionNumOfSharedHeaderMessageFormat,2281 -versionNumberOfExperimentalSuite,2282 -versionNumberOfGribLocalTables,2283 -versionNumberOfSuperblock,2284 -versionOfModelClimate,2285 -verticalCoordinate,2286 -verticalCoordinateDefinition,2287 -verticalDomainTemplate,2288 -verticalDomainTemplateNumber,2289 -verticalVisibility,2290 -verticalVisibilityCoded,2291 -visibility,2292 -visibilityInKilometresTrend1,2293 -visibilityInKilometresTrend2,2294 -visibilityInKilometresTrend3,2295 -visibilityInKilometresTrend4,2296 -visibilityTrend1,2297 -visibilityTrend2,2298 -visibilityTrend3,2299 -visibilityTrend4,2300 -waveDomain,2301 -weightAppliedToClimateMonth1,2302 -westLongitudeOfCluster,2303 -westLongitudeOfDomainOfTubing,2304 -westernLongitudeOfClusterDomain,2305 -westernLongitudeOfDomain,2306 -widthOfFirstOrderValues,2307 -widthOfLengths,2308 -widthOfSPD,2309 -widthOfWidths,2310 -windDirection,2311 -windDirectionTrend1,2312 -windDirectionTrend2,2313 -windDirectionTrend3,2314 -windDirectionTrend4,2315 -windGust,2316 -windGustTrend1,2317 -windGustTrend2,2318 -windGustTrend3,2319 -windGustTrend4,2320 -windPresent,2321 -windSpeed,2322 -windSpeedTrend1,2323 -windSpeedTrend2,2324 -windSpeedTrend3,2325 -windSpeedTrend4,2326 -windUnits,2327 -windUnitsTrend1,2328 -windUnitsTrend2,2329 -windUnitsTrend3,2330 -windUnitsTrend4,2331 -windVariableDirection,2332 -windVariableDirectionTrend1,2333 -windVariableDirectionTrend2,2334 -windVariableDirectionTrend3,2335 -windVariableDirectionTrend4,2336 -wrongPadding,2337 -xCoordinateOfOriginOfSectorImage,2338 -xCoordinateOfSubSatellitePoint,2339 -xDirectionGridLength,2340 -xDirectionGridLengthInMetres,2341 -xDirectionGridLengthInMillimetres,2342 -xFirst,2343 -xLast,2344 -yCoordinateOfOriginOfSectorImage,2345 -yCoordinateOfSubSatellitePoint,2346 -yDirectionGridLength,2347 -yDirectionGridLengthInMetres,2348 -yDirectionGridLengthInMillimetres,2349 -yFirst,2350 -yLast,2351 -year,2352 -yearOfAnalysis,2353 -yearOfCentury,2354 -yearOfEndOfOverallTimeInterval,2355 -yearOfForecast,2356 -yearOfModelVersion,2357 -yearOfReference,2358 -zero,2359 +longitudeOfFirstDiamondCentreLine,1152 +longitudeOfFirstDiamondCentreLineInDegrees,1153 +longitudeOfFirstGridPoint,1154 +longitudeOfFirstGridPointInDegrees,1155 +longitudeOfIcosahedronPole,1156 +longitudeOfLastGridPoint,1157 +longitudeOfLastGridPointInDegrees,1158 +longitudeOfNorthWestCornerOfArea,1159 +longitudeOfReferencePoint,1160 +longitudeOfReferencePointInDegrees,1161 +longitudeOfSouthEastCornerOfArea,1162 +longitudeOfSouthernPole,1163 +longitudeOfSouthernPoleInDegrees,1164 +longitudeOfStretchingPole,1165 +longitudeOfStretchingPoleInDegrees,1166 +longitudeOfSubSatellitePoint,1167 +longitudeOfSubSatellitePointInDegrees,1168 +longitudeOfTangencyPoint,1169 +longitudeOfThePoleOfStretching,1170 +longitudeOfThePolePoint,1171 +longitudeOfThePolePointInDegrees,1172 +longitudeOfTheSouthernPoleOfProjection,1173 +longitudeSexagesimal,1174 +longitudes,1175 +longitudesList,1176 +longitudinalDirectionGridLength,1177 +lowerLimit,1178 +lowerRange,1179 +lowerThreshold,1180 +lowerThresholdValue,1181 +ls_labeling,1182 +lsdate_bug,1183 +m,1184 +mAngleMultiplier,1185 +mBasicAngle,1186 +mars,1187 +marsClass,1188 +marsClass1,1189 +marsClass2,1190 +marsDir,1191 +marsDomain,1192 +marsEndStep,1193 +marsExperimentOffset,1194 +marsExpver,1195 +marsForecastMonth,1196 +marsGrid,1197 +marsIdent,1198 +marsKeywords,1199 +marsKeywords1,1200 +marsLamModel,1201 +marsLatitude,1202 +marsLevel,1203 +marsLevelist,1204 +marsLongitude,1205 +marsModel,1206 +marsParam,1207 +marsQuantile,1208 +marsRange,1209 +marsStartStep,1210 +marsStep,1211 +marsStream,1212 +marsStream1,1213 +marsStream2,1214 +marsType,1215 +marsType1,1216 +marsType2,1217 +mars_labeling,1218 +mask,1219 +masterDir,1220 +masterTableNumber,1221 +masterTablesVersionNumber,1222 +masterTablesVersionNumberLatest,1223 +matchAerosolBinNumber,1224 +matchAerosolPacking,1225 +matchLandType,1226 +matchSort,1227 +matchTimeRepres,1228 +matrixBitmapsPresent,1229 +matrixOfValues,1230 +max,1231 +maximum,1232 +md5Data,1233 +md5DataSection,1234 +md5GridSection,1235 +md5Headers,1236 +md5Product,1237 +md5Section1,1238 +md5Section10,1239 +md5Section2,1240 +md5Section3,1241 +md5Section4,1242 +md5Section5,1243 +md5Section6,1244 +md5Section7,1245 +md5Section8,1246 +md5Section9,1247 +md5Structure,1248 +md5TimeDomainSection,1249 +meanRVR1,1250 +meanRVR2,1251 +meanRVR3,1252 +meanRVR4,1253 +meanSize,1254 +meanValueRVR1,1255 +meanValueRVR2,1256 +meanValueRVR3,1257 +meanValueRVR4,1258 +meaningOfVerticalCoordinate,1259 +memberNumber,1260 +messageLength,1261 +metadata,1262 +method,1263 +methodNumber,1264 +million,1265 +min,1266 +minimum,1267 +minute,1268 +minuteOfAnalysis,1269 +minuteOfEndOfOverallTimeInterval,1270 +minuteOfForecast,1271 +minuteOfModelVersion,1272 +minuteOfReference,1273 +minutesAfterDataCutoff,1274 +minutesAfterReferenceTimeOfDataCutoff,1275 +missingDataFlag,1276 +missingValue,1277 +missingValueManagement,1278 +missingValueManagementUsed,1279 +missingValuesPresent,1280 +mixedCoordinateDefinition,1281 +mixedCoordinateFieldFlag,1282 +modeNumber,1283 +model,1284 +modelErrorType,1285 +modelIdentifier,1286 +modelName,1287 +modelVersionDate,1288 +modelVersionTime,1289 +molarMass,1290 +month,1291 +monthOfAnalysis,1292 +monthOfEndOfOverallTimeInterval,1293 +monthOfForecast,1294 +monthOfModelVersion,1295 +monthOfReference,1296 +monthlyVerificationDate,1297 +monthlyVerificationMonth,1298 +monthlyVerificationTime,1299 +monthlyVerificationYear,1300 +multiplicationFactorForLatLong,1301 +mybits,1302 +n,1303 +n2,1304 +n3,1305 +na,1306 +name,1307 +nameECMF,1308 +nameOfFirstFixedSurface,1309 +nameOfSecondFixedSurface,1310 +names,1311 +nd,1312 +neitherPresent,1313 +newSubtype,1314 +nlev,1315 +nnn,1316 +normAtFinalTime,1317 +normAtInitialTime,1318 +normal,1319 +northLatitudeOfCluster,1320 +northLatitudeOfDomainOfTubing,1321 +northWestLatitudeOfLPOArea,1322 +northWestLatitudeOfVerficationArea,1323 +northWestLongitudeOfLPOArea,1324 +northWestLongitudeOfVerficationArea,1325 +northernLatitudeOfClusterDomain,1326 +northernLatitudeOfDomain,1327 +nosigPresent,1328 +notDecoded,1329 +nt,1330 +number,1331 +numberInHorizontalCoordinates,1332 +numberInMixedCoordinateDefinition,1333 +numberInTheAuxiliaryArray,1334 +numberInTheGridCoordinateList,1335 +numberIncludedInAverage,1336 +numberMissingFromAveragesOrAccumulations,1337 +numberOfAnalysis,1338 +numberOfBits,1339 +numberOfBitsContainingEachPackedValue,1340 +numberOfBitsForScaledGroupLengths,1341 +numberOfBitsUsedForTheGroupWidths,1342 +numberOfBitsUsedForTheScaledGroupLengths,1343 +numberOfBytesInLocalDefinition,1344 +numberOfBytesOfFreeFormatData,1345 +numberOfBytesPerInteger,1346 +numberOfCategories,1347 +numberOfCharacters,1348 +numberOfChars,1349 +numberOfClusterHighResolution,1350 +numberOfClusterLowResolution,1351 +numberOfClusters,1352 +numberOfCodedValues,1353 +numberOfCoefficientsOrValuesUsedToSpecifyFirstDimensionCoordinateFunction,1354 +numberOfCoefficientsOrValuesUsedToSpecifySecondDimensionCoordinateFunction,1355 +numberOfColumns,1356 +numberOfComponents,1357 +numberOfContributingSpectralBands,1358 +numberOfControlForecastTube,1359 +numberOfCoordinatesValues,1360 +numberOfDataBinsAlongRadials,1361 +numberOfDataMatrices,1362 +numberOfDataPoints,1363 +numberOfDataPointsExpected,1364 +numberOfDataValues,1365 +numberOfDaysInClimateSamplingWindow,1366 +numberOfDiamonds,1367 +numberOfDirections,1368 +numberOfDistinctSection3s,1369 +numberOfDistinctSection4s,1370 +numberOfDistinctSection5s,1371 +numberOfDistinctSection6s,1372 +numberOfDistinctSection7s,1373 +numberOfDistinctSection8s,1374 +numberOfDistinctSection9s,1375 +numberOfDistributionFunctionParameters,1376 +numberOfEffectiveValues,1377 +numberOfFloats,1378 +numberOfForcasts,1379 +numberOfForecastsInCluster,1380 +numberOfForecastsInEnsemble,1381 +numberOfForecastsInTheCluster,1382 +numberOfForecastsInTube,1383 +numberOfFrequencies,1384 +numberOfGridInReference,1385 +numberOfGridUsed,1386 +numberOfGroups,1387 +numberOfGroupsOfDataValues,1388 +numberOfHorizontalPoints,1389 +numberOfIntegers,1390 +numberOfInts,1391 +numberOfIterations,1392 +numberOfLocalDefinitions,1393 +numberOfLogicals,1394 +numberOfMembersInCluster,1395 +numberOfMembersInEnsemble,1396 +numberOfMissing,1397 +numberOfMissingInStatisticalProcess,1398 +numberOfMissingValues,1399 +numberOfModeOfDistribution,1400 +numberOfModels,1401 +numberOfOctectsForNumberOfPoints,1402 +numberOfOctetsExtraDescriptors,1403 +numberOfOperationalForecastTube,1404 +numberOfPackedValues,1405 +numberOfParallelsBetweenAPoleAndTheEquator,1406 +numberOfParametersUsedForClustering,1407 +numberOfPartitions,1408 +numberOfPoints,1409 +numberOfPointsAlongAMeridian,1410 +numberOfPointsAlongAParallel,1411 +numberOfPointsAlongFirstAxis,1412 +numberOfPointsAlongSecondAxis,1413 +numberOfPointsAlongTheXAxis,1414 +numberOfPointsAlongTheYAxis,1415 +numberOfPointsAlongXAxis,1416 +numberOfPointsAlongXAxisInCouplingArea,1417 +numberOfPointsAlongYAxis,1418 +numberOfPointsAlongYAxisInCouplingArea,1419 +numberOfPointsInDomain,1420 +numberOfPointsUsed,1421 +numberOfPressureLevelsUsedForClustering,1422 +numberOfRadarSitesUsed,1423 +numberOfRadials,1424 +numberOfReforecastYearsInModelClimate,1425 +numberOfRemaininChars,1426 +numberOfRepresentativeMember,1427 +numberOfReservedBytes,1428 +numberOfRows,1429 +numberOfSecondOrderPackedValues,1430 +numberOfSection,1431 +numberOfSingularVectorsComputed,1432 +numberOfSingularVectorsEvolved,1433 +numberOfStepsUsedForClustering,1434 +numberOfSubsets,1435 +numberOfTensOfThousandsOfYearsOfOffset,1436 +numberOfTimeRange,1437 +numberOfTimeSteps,1438 +numberOfUnexpandedDescriptors,1439 +numberOfUnusedBitsAtEndOfSection3,1440 +numberOfUsedSpatialTiles,1441 +numberOfUsedTileAttributes,1442 +numberOfUsefulPointsAlongXAxis,1443 +numberOfUsefulPointsAlongYAxis,1444 +numberOfVGridUsed,1445 +numberOfValues,1446 +numberOfVerticalCoordinateValues,1447 +numberOfVerticalGridDescriptors,1448 +numberOfVerticalPoints,1449 +numberingOrderOfDiamonds,1450 +numericValues,1451 +observablePropertyTemplate,1452 +observablePropertyTemplateNumber,1453 +observationDiagnostic,1454 +observationGeneratingProcessIdentifier,1455 +observationType,1456 +observedData,1457 +obstype,1458 +oceanAtmosphereCoupling,1459 +oceanLevName,1460 +oceanStream,1461 +octetAtWichPackedDataBegins,1462 +offset,1463 +offsetAfterBitmap,1464 +offsetAfterCentreLocalSection,1465 +offsetAfterData,1466 +offsetAfterLocalSection,1467 +offsetAfterPadding,1468 +offsetBBitmap,1469 +offsetBSection5,1470 +offsetBSection6,1471 +offsetBSection9,1472 +offsetBeforeBitmap,1473 +offsetBeforeData,1474 +offsetBeforePL,1475 +offsetBeforePV,1476 +offsetDescriptors,1477 +offsetEndSection4,1478 +offsetFreeFormData,1479 +offsetFromOriginToInnerBound,1480 +offsetFromReferenceOfFirstTime,1481 +offsetICEFieldsUsed,1482 +offsetSection0,1483 +offsetSection1,1484 +offsetSection10,1485 +offsetSection11,1486 +offsetSection2,1487 +offsetSection3,1488 +offsetSection4,1489 +offsetSection5,1490 +offsetSection6,1491 +offsetSection7,1492 +offsetSection8,1493 +offsetSection9,1494 +offsetToEndOf4DvarWindow,1495 +offsetValuesBy,1496 +oldSubtype,1497 +one,1498 +oneConstant,1499 +oneMillionConstant,1500 +oneMinuteMeanMaximumRVR1,1501 +oneMinuteMeanMaximumRVR2,1502 +oneMinuteMeanMaximumRVR3,1503 +oneMinuteMeanMaximumRVR4,1504 +oneMinuteMeanMinimumRVR1,1505 +oneMinuteMeanMinimumRVR2,1506 +oneMinuteMeanMinimumRVR3,1507 +oneMinuteMeanMinimumRVR4,1508 +oneThousand,1509 +oper,1510 +operStream,1511 +operatingMode,1512 +operationalForecastCluster,1513 +optimisationTime,1514 +optimizeScaleFactor,1515 +optionalData,1516 +opttime,1517 +orderOfSPD,1518 +orderOfSpatialDifferencing,1519 +orientationOfTheGrid,1520 +orientationOfTheGridInDegrees,1521 +origin,1522 +originalParameterNumber,1523 +originalParameterTableNumber,1524 +originalSubCentreIdentifier,1525 +originatingCentre,1526 +originatingCentreOfAnalysis,1527 +originatorLocalTemplate,1528 +originatorLocalTemplateNumber,1529 +overlayTemplate,1530 +overlayTemplateNumber,1531 +pack,1532 +packedValues,1533 +packingError,1534 +packingType,1535 +padding,1536 +padding_grid1_1,1537 +padding_grid1_2,1538 +padding_grid3_1,1539 +padding_grid4_1,1540 +padding_grid50_1,1541 +padding_grid5_1,1542 +padding_grid90_1,1543 +padding_loc10_1,1544 +padding_loc12_1,1545 +padding_loc13_1,1546 +padding_loc13_2,1547 +padding_loc13_3,1548 +padding_loc13_4,1549 +padding_loc13_5,1550 +padding_loc14_1,1551 +padding_loc14_2,1552 +padding_loc15_1,1553 +padding_loc16_1,1554 +padding_loc17_2,1555 +padding_loc18_1,1556 +padding_loc18_2,1557 +padding_loc190_1,1558 +padding_loc191_1,1559 +padding_loc191_2,1560 +padding_loc191_3,1561 +padding_loc192_1,1562 +padding_loc19_2,1563 +padding_loc20_1,1564 +padding_loc21_1,1565 +padding_loc23_1,1566 +padding_loc244_1,1567 +padding_loc244_2,1568 +padding_loc244_3,1569 +padding_loc245_1,1570 +padding_loc245_2,1571 +padding_loc26_1,1572 +padding_loc27_1,1573 +padding_loc27_2,1574 +padding_loc28_1,1575 +padding_loc29_1,1576 +padding_loc29_2,1577 +padding_loc29_3,1578 +padding_loc2_1,1579 +padding_loc2_2,1580 +padding_loc30_1,1581 +padding_loc30_2,1582 +padding_loc37_1,1583 +padding_loc37_2,1584 +padding_loc38_1,1585 +padding_loc3_1,1586 +padding_loc4_2,1587 +padding_loc50_1,1588 +padding_loc5_1,1589 +padding_loc6_1,1590 +padding_loc7_1,1591 +padding_loc9_1,1592 +padding_loc9_2,1593 +padding_local11_1,1594 +padding_local1_1,1595 +padding_local1_31,1596 +padding_local40_1,1597 +padding_local_35,1598 +padding_local_7_1,1599 +padding_sec1_loc,1600 +padding_sec2_1,1601 +padding_sec2_2,1602 +padding_sec2_3,1603 +padding_sec3_1,1604 +padding_sec4_1,1605 +paleontologicalOffset,1606 +param,1607 +paramId,1608 +paramIdECMF,1609 +param_value_max,1610 +param_value_min,1611 +parameter,1612 +parameterCategory,1613 +parameterCode,1614 +parameterDiscipline,1615 +parameterIndicator,1616 +parameterName,1617 +parameterNumber,1618 +parameterUnits,1619 +parameters,1620 +parametersVersion,1621 +partitionItems,1622 +partitionNumber,1623 +partitionTable,1624 +partitions,1625 +pastTendencyRVR1,1626 +pastTendencyRVR2,1627 +pastTendencyRVR3,1628 +pastTendencyRVR4,1629 +patch_precip_fp,1630 +pentagonalResolutionParameterJ,1631 +pentagonalResolutionParameterK,1632 +pentagonalResolutionParameterM,1633 +percentileValue,1634 +periodOfTime,1635 +periodOfTimeIntervals,1636 +perturbationNumber,1637 +perturbedType,1638 +phase,1639 +physicalFlag1,1640 +physicalFlag2,1641 +physicalMeaningOfVerticalCoordinate,1642 +pl,1643 +platform,1644 +plusOneinOrdersOfSPD,1645 +points,1646 +postAuxiliary,1647 +postAuxiliaryArrayPresent,1648 +powerOfTenUsedToScaleClimateWeight,1649 +preBitmapValues,1650 +preProcessingParameter,1651 +precision,1652 +precisionOfTheUnpackedSubset,1653 +predefined_grid,1654 +predefined_grid_values,1655 +present,1656 +presentTrend1,1657 +presentTrend2,1658 +presentTrend3,1659 +presentTrend4,1660 +presentWeather1Present,1661 +presentWeather1PresentTrend1,1662 +presentWeather1PresentTrend2,1663 +presentWeather1PresentTrend3,1664 +presentWeather1PresentTrend4,1665 +presentWeather2Present,1666 +presentWeather2PresentTrend1,1667 +presentWeather2PresentTrend2,1668 +presentWeather2PresentTrend3,1669 +presentWeather2PresentTrend4,1670 +presentWeather3Present,1671 +presentWeather3PresentTrend1,1672 +presentWeather3PresentTrend2,1673 +presentWeather3PresentTrend3,1674 +presentWeather3PresentTrend4,1675 +pressureLevel,1676 +pressureUnits,1677 +primaryBitmap,1678 +primaryMissingValue,1679 +primaryMissingValueSubstitute,1680 +probContinous,1681 +probPoint,1682 +probProductDefinition,1683 +probabilityType,1684 +probabilityTypeName,1685 +process,1686 +produceLargeConstantFields,1687 +product,1688 +productDefinition,1689 +productDefinitionTemplateNumber,1690 +productDefinitionTemplateNumberInternal,1691 +productIdentifier,1692 +productType,1693 +productionStatusOfProcessedData,1694 +projectLocalTemplate,1695 +projectLocalTemplateNumber,1696 +projectionCenterFlag,1697 +projectionCentreFlag,1698 +pv,1699 +pvlLocation,1700 +qfe,1701 +qfePresent,1702 +qfeUnits,1703 +qnh,1704 +qnhAPresent,1705 +qnhPresent,1706 +qnhUnits,1707 +qualityControl,1708 +qualityControlIndicator,1709 +qualityValueAssociatedWithParameter,1710 +quantile,1711 +radialAngularSpacing,1712 +radials,1713 +radius,1714 +radiusInMetres,1715 +radiusOfCentralCluster,1716 +radiusOfClusterDomain,1717 +radiusOfTheEarth,1718 +range,1719 +rangeBinSpacing,1720 +rdbDateTime,1721 +rdbSubtype,1722 +rdbType,1723 +rdb_key,1724 +rdbtime,1725 +rdbtimeDate,1726 +rdbtimeDay,1727 +rdbtimeHour,1728 +rdbtimeMinute,1729 +rdbtimeMonth,1730 +rdbtimeSecond,1731 +rdbtimeTime,1732 +rdbtimeYear,1733 +realPart,1734 +realPartOf00,1735 +recDateTime,1736 +recentWeather,1737 +recentWeatherTry,1738 +rectime,1739 +rectimeDay,1740 +rectimeHour,1741 +rectimeMinute,1742 +rectimeSecond,1743 +reducedGrid,1744 +refdate,1745 +reference,1746 +referenceDate,1747 +referenceForGroupLengths,1748 +referenceForGroupWidths,1749 +referenceOfLengths,1750 +referenceOfWidths,1751 +referenceReflectivityForEchoTop,1752 +referenceSampleInterval,1753 +referenceStep,1754 +referenceValue,1755 +referenceValueError,1756 +reflectivityCalibrationConstant,1757 +remarkPresent,1758 +reportType,1759 +representationMode,1760 +representationType,1761 +representativeMember,1762 +reserved,1763 +reserved1,1764 +reserved2,1765 +reserved3,1766 +reservedNeedNotBePresent,1767 +reservedOctet,1768 +reservedSection2,1769 +reservedSection3,1770 +reservedSection4,1771 +resolutionAndComponentFlags,1772 +resolutionAndComponentFlags1,1773 +resolutionAndComponentFlags2,1774 +resolutionAndComponentFlags3,1775 +resolutionAndComponentFlags4,1776 +resolutionAndComponentFlags6,1777 +resolutionAndComponentFlags7,1778 +resolutionAndComponentFlags8,1779 +rootGroupObjectHeaderAddress,1780 +rootGroupSymbolTableEntry,1781 +rootTablesDir,1782 +roundedMarsLatitude,1783 +roundedMarsLevelist,1784 +roundedMarsLongitude,1785 +runwayBrakingActionState1,1786 +runwayBrakingActionState2,1787 +runwayBrakingActionState3,1788 +runwayBrakingActionState4,1789 +runwayDepositCodeState1,1790 +runwayDepositCodeState2,1791 +runwayDepositCodeState3,1792 +runwayDepositCodeState4,1793 +runwayDepositState1,1794 +runwayDepositState2,1795 +runwayDepositState3,1796 +runwayDepositState4,1797 +runwayDepthOfDepositCodeState1,1798 +runwayDepthOfDepositCodeState2,1799 +runwayDepthOfDepositCodeState3,1800 +runwayDepthOfDepositCodeState4,1801 +runwayDepthOfDepositState1,1802 +runwayDepthOfDepositState2,1803 +runwayDepthOfDepositState3,1804 +runwayDepthOfDepositState4,1805 +runwayDesignatorRVR1,1806 +runwayDesignatorRVR2,1807 +runwayDesignatorRVR3,1808 +runwayDesignatorRVR4,1809 +runwayDesignatorState1,1810 +runwayDesignatorState2,1811 +runwayDesignatorState3,1812 +runwayDesignatorState4,1813 +runwayExtentOfContaminationCodeState1,1814 +runwayExtentOfContaminationCodeState2,1815 +runwayExtentOfContaminationCodeState3,1816 +runwayExtentOfContaminationCodeState4,1817 +runwayExtentOfContaminationState1,1818 +runwayExtentOfContaminationState2,1819 +runwayExtentOfContaminationState3,1820 +runwayExtentOfContaminationState4,1821 +runwayFrictionCodeValueState1,1822 +runwayFrictionCodeValueState2,1823 +runwayFrictionCodeValueState3,1824 +runwayFrictionCodeValueState4,1825 +runwayFrictionCoefficientCodeState1,1826 +runwayFrictionCoefficientCodeState2,1827 +runwayFrictionCoefficientCodeState3,1828 +runwayFrictionCoefficientCodeState4,1829 +runwayFrictionCoefficientState1,1830 +runwayFrictionCoefficientState2,1831 +runwayFrictionCoefficientState3,1832 +runwayFrictionCoefficientState4,1833 +runwaySideCodeState1,1834 +runwaySideCodeState2,1835 +runwaySideCodeState3,1836 +runwaySideCodeState4,1837 +runwayState,1838 +sampleSizeOfModelClimate,1839 +satelliteID,1840 +satelliteIdentifier,1841 +satelliteNumber,1842 +satelliteSeries,1843 +scaleFactorAtReferencePoint,1844 +scaleFactorOfCentralWaveNumber,1845 +scaleFactorOfDistanceFromEnsembleMean,1846 +scaleFactorOfDistributionFunctionParameter,1847 +scaleFactorOfEarthMajorAxis,1848 +scaleFactorOfEarthMinorAxis,1849 +scaleFactorOfFirstFixedSurface,1850 +scaleFactorOfFirstSize,1851 +scaleFactorOfFirstWavelength,1852 +scaleFactorOfLengthOfSemiMajorAxis,1853 +scaleFactorOfLengthOfSemiMinorAxis,1854 +scaleFactorOfLowerLimit,1855 +scaleFactorOfMajorAxisOfOblateSpheroidEarth,1856 +scaleFactorOfMinorAxisOfOblateSpheroidEarth,1857 +scaleFactorOfPrimeMeridianOffset,1858 +scaleFactorOfRadiusOfSphericalEarth,1859 +scaleFactorOfSecondFixedSurface,1860 +scaleFactorOfSecondSize,1861 +scaleFactorOfSecondWavelength,1862 +scaleFactorOfStandardDeviation,1863 +scaleFactorOfStandardDeviationInTheCluster,1864 +scaleFactorOfUpperLimit,1865 +scaleValuesBy,1866 +scaledDirections,1867 +scaledFrequencies,1868 +scaledValueOfCentralWaveNumber,1869 +scaledValueOfDistanceFromEnsembleMean,1870 +scaledValueOfDistributionFunctionParameter,1871 +scaledValueOfEarthMajorAxis,1872 +scaledValueOfEarthMinorAxis,1873 +scaledValueOfFirstFixedSurface,1874 +scaledValueOfFirstSize,1875 +scaledValueOfFirstWavelength,1876 +scaledValueOfLengthOfSemiMajorAxis,1877 +scaledValueOfLengthOfSemiMinorAxis,1878 +scaledValueOfLowerLimit,1879 +scaledValueOfMajorAxisOfOblateSpheroidEarth,1880 +scaledValueOfMinorAxisOfOblateSpheroidEarth,1881 +scaledValueOfPrimeMeridianOffset,1882 +scaledValueOfRadiusOfSphericalEarth,1883 +scaledValueOfSecondFixedSurface,1884 +scaledValueOfSecondSize,1885 +scaledValueOfSecondWavelength,1886 +scaledValueOfStandardDeviation,1887 +scaledValueOfStandardDeviationInTheCluster,1888 +scaledValueOfUpperLimit,1889 +scalingFactorForFrequencies,1890 +scanPosition,1891 +scanningMode,1892 +scanningMode4,1893 +scanningMode5,1894 +scanningMode6,1895 +scanningMode7,1896 +scanningMode8,1897 +scanningModeForOneDiamond,1898 +sd,1899 +second,1900 +secondDimension,1901 +secondDimensionCoordinateValueDefinition,1902 +secondDimensionPhysicalSignificance,1903 +secondLatitude,1904 +secondLatitudeInDegrees,1905 +secondOfEndOfOverallTimeInterval,1906 +secondOfForecast,1907 +secondOfModelVersion,1908 +secondOrderFlags,1909 +secondOrderOfDifferentWidth,1910 +secondOrderValuesDifferentWidths,1911 +secondaryBitMap,1912 +secondaryBitmap,1913 +secondaryBitmapPresent,1914 +secondaryBitmaps,1915 +secondaryBitmapsCount,1916 +secondaryBitmapsSize,1917 +secondaryMissingValue,1918 +secondaryMissingValueSubstitute,1919 +secondsOfAnalysis,1920 +secondsOfReference,1921 +section,1922 +section0Length,1923 +section0Pointer,1924 +section1,1925 +section10Length,1926 +section10Pointer,1927 +section11Length,1928 +section11Pointer,1929 +section1Flags,1930 +section1Length,1931 +section1Padding,1932 +section1Pointer,1933 +section2Length,1934 +section2Padding,1935 +section2Pointer,1936 +section2Present,1937 +section2Used,1938 +section3Flags,1939 +section3Length,1940 +section3Padding,1941 +section3Pointer,1942 +section3UniqueIdentifier,1943 +section4,1944 +section4Length,1945 +section4Padding,1946 +section4Pointer,1947 +section4UniqueIdentifier,1948 +section5,1949 +section5Length,1950 +section5Pointer,1951 +section5UniqueIdentifier,1952 +section6,1953 +section6Length,1954 +section6Pointer,1955 +section6UniqueIdentifier,1956 +section7,1957 +section7Length,1958 +section7Pointer,1959 +section7UniqueIdentifier,1960 +section8,1961 +section8Length,1962 +section8Pointer,1963 +section8UniqueIdentifier,1964 +section9Length,1965 +section9Pointer,1966 +section9UniqueIdentifier,1967 +sectionLengthLimitForEnsembles,1968 +sectionLengthLimitForProbability,1969 +sectionNumber,1970 +sectionPosition,1971 +section_01,1972 +section_02,1973 +section_03,1974 +section_04,1975 +section_05,1976 +section_06,1977 +section_07,1978 +section_08,1979 +section_09,1980 +section_1,1981 +section_10,1982 +section_11,1983 +section_2,1984 +section_3,1985 +section_4,1986 +section_5,1987 +section_6,1988 +section_7,1989 +section_8,1990 +selectStepTemplateInstant,1991 +selectStepTemplateInterval,1992 +sensitiveAreaDomain,1993 +sequences,1994 +setBitsPerValue,1995 +setCalendarId,1996 +setDecimalPrecision,1997 +setLocalDefinition,1998 +setToMissingIfOutOfRange,1999 +sfc_levtype,2000 +shapeOfTheEarth,2001 +shapeOfVerificationArea,2002 +shortName,2003 +shortNameECMF,2004 +short_name,2005 +signature,2006 +significanceOfReferenceDateAndTime,2007 +significanceOfReferenceTime,2008 +simpleThinningMissingRadius,2009 +simpleThinningSkip,2010 +simpleThinningStart,2011 +siteElevation,2012 +siteId,2013 +siteLatitude,2014 +siteLongitude,2015 +sizeOfLength,2016 +sizeOfOffsets,2017 +sizeOfPostAuxiliaryArray,2018 +sizeOfPostAuxiliaryArrayPlusOne,2019 +skew,2020 +skewness,2021 +skipExtraKeyAttributes,2022 +sort,2023 +sourceOfGridDefinition,2024 +sourceSinkChemicalPhysicalProcess,2025 +southEastLatitudeOfLPOArea,2026 +southEastLatitudeOfVerficationArea,2027 +southEastLongitudeOfLPOArea,2028 +southEastLongitudeOfVerficationArea,2029 +southLatitudeOfCluster,2030 +southLatitudeOfDomainOfTubing,2031 +southPoleOnProjectionPlane,2032 +southernLatitudeOfClusterDomain,2033 +southernLatitudeOfDomain,2034 +sp1,2035 +sp2,2036 +sp3,2037 +spaceUnitFlag,2038 +spacingOfBinsAlongRadials,2039 +spare,2040 +spare2,2041 +spatialProcessing,2042 +spatialSmoothingOfProduct,2043 +spectralDataRepresentationMode,2044 +spectralDataRepresentationType,2045 +spectralMode,2046 +spectralType,2047 +sphericalHarmonics,2048 +standardDeviation,2049 +standardParallel,2050 +standardParallelInDegrees,2051 +standardParallelInMicrodegrees,2052 +startOfHeaders,2053 +startOfMessage,2054 +startOfRange,2055 +startStep,2056 +startStepInHours,2057 +startTimeStep,2058 +startingAzimuth,2059 +statisticalProcess,2060 +statisticalProcessesList,2061 +statistics,2062 +status,2063 +step,2064 +stepForClustering,2065 +stepInHours,2066 +stepRange,2067 +stepRangeInHours,2068 +stepType,2069 +stepTypeForConversion,2070 +stepTypeInternal,2071 +stepUnits,2072 +stepZero,2073 +stream,2074 +streamOfAnalysis,2075 +stretchingFactor,2076 +stretchingFactorScaled,2077 +stringValues,2078 +subCentre,2079 +subDefinitions1,2080 +subDefinitions2,2081 +subLocalDefinition1,2082 +subLocalDefinition2,2083 +subLocalDefinitionLength1,2084 +subLocalDefinitionLength2,2085 +subLocalDefinitionNumber1,2086 +subLocalDefinitionNumber2,2087 +subSetJ,2088 +subSetK,2089 +subSetM,2090 +subcentreOfAnalysis,2091 +subdivisionsOfBasicAngle,2092 +suiteName,2093 +superblockExtensionAddress,2094 +swapScanningLat,2095 +swapScanningLon,2096 +swapScanningX,2097 +swapScanningY,2098 +system,2099 +systemNumber,2100 +t,2101 +table2Version,2102 +tableCode,2103 +tableNumber,2104 +tableReference,2105 +tablesLocalDir,2106 +tablesMasterDir,2107 +tablesVersion,2108 +tablesVersionLatest,2109 +targetCompressionRatio,2110 +td,2111 +tempPressureUnits,2112 +temperature,2113 +temperatureAndDewpointPresent,2114 +templatesLocalDir,2115 +templatesMasterDir,2116 +theHindcastMarsStream,2117 +theMessage,2118 +thisExperimentVersionNumber,2119 +thisMarsClass,2120 +thisMarsStream,2121 +thisMarsType,2122 +thousand,2123 +three,2124 +threshold,2125 +thresholdIndicator,2126 +tiggeCentre,2127 +tiggeLAMName,2128 +tiggeLocalVersion,2129 +tiggeModel,2130 +tiggeSection,2131 +tiggeSuiteID,2132 +tigge_name,2133 +tigge_short_name,2134 +tileClassification,2135 +tileIndex,2136 +time,2137 +timeCoordinateDefinition,2138 +timeDomainTemplate,2139 +timeDomainTemplateNumber,2140 +timeIncrement,2141 +timeIncrementBetweenSuccessiveFields,2142 +timeOfAnalysis,2143 +timeOfForecast,2144 +timeOfModelVersion,2145 +timeOfReference,2146 +timeRangeIndicator,2147 +timeRangeIndicatorFromStepRange,2148 +timeUnitFlag,2149 +timerepres,2150 +topLevel,2151 +total,2152 +totalAerosolBinsNumbers,2153 +totalInitialConditions,2154 +totalLength,2155 +totalNumber,2156 +totalNumberOfClusters,2157 +totalNumberOfDataValuesMissingInStatisticalProcess,2158 +totalNumberOfDirections,2159 +totalNumberOfForecastProbabilities,2160 +totalNumberOfFrequencies,2161 +totalNumberOfGridPoints,2162 +totalNumberOfIterations,2163 +totalNumberOfRepetitions,2164 +totalNumberOfTileAttributePairs,2165 +totalNumberOfTubes,2166 +totalNumberOfValuesInUnpackedSubset,2167 +totalNumberOfdimensions,2168 +treatmentOfMissingData,2169 +true,2170 +trueLengthOfLastGroup,2171 +truncateDegrees,2172 +truncateLaplacian,2173 +tsectionNumber3,2174 +tsectionNumber4,2175 +tsectionNumber5,2176 +tubeDomain,2177 +tubeNumber,2178 +two,2179 +twoOrdersOfSPD,2180 +type,2181 +typeOfAnalysis,2182 +typeOfAuxiliaryInformation,2183 +typeOfCalendar,2184 +typeOfCompressionUsed,2185 +typeOfDistributionFunction,2186 +typeOfEnsembleForecast,2187 +typeOfEnsembleMember,2188 +typeOfFirstFixedSurface,2189 +typeOfGeneratingProcess,2190 +typeOfGrid,2191 +typeOfHorizontalLine,2192 +typeOfIntervalForFirstAndSecondSize,2193 +typeOfIntervalForFirstAndSecondWavelength,2194 +typeOfLevel,2195 +typeOfLevelECMF,2196 +typeOfOriginalFieldValues,2197 +typeOfPacking,2198 +typeOfPostProcessing,2199 +typeOfPreProcessing,2200 +typeOfProcessedData,2201 +typeOfSSTFieldUsed,2202 +typeOfSecondFixedSurface,2203 +typeOfSizeInterval,2204 +typeOfStatisticalPostProcessingOfEnsembleMembers,2205 +typeOfStatisticalProcessing,2206 +typeOfTimeIncrement,2207 +typeOfTimeIncrementBetweenSuccessiveFieldsUsedInTheStatisticalProcessing,2208 +typeOfWavelengthInterval,2209 +typicalCentury,2210 +typicalDate,2211 +typicalDateTime,2212 +typicalDay,2213 +typicalHour,2214 +typicalMinute,2215 +typicalMonth,2216 +typicalSecond,2217 +typicalTime,2218 +typicalYear,2219 +typicalYear2,2220 +typicalYearOfCentury,2221 +uco,2222 +ucs,2223 +unexpandedDescriptors,2224 +unexpandedDescriptorsEncoded,2225 +unitOfOffsetFromReferenceTime,2226 +unitOfTime,2227 +unitOfTimeIncrement,2228 +unitOfTimeRange,2229 +units,2230 +unitsBias,2231 +unitsConversionOffset,2232 +unitsConversionScaleFactor,2233 +unitsDecimalScaleFactor,2234 +unitsECMF,2235 +unitsFactor,2236 +unitsOfFirstFixedSurface,2237 +unitsOfSecondFixedSurface,2238 +unknown,2239 +unpack,2240 +unpackedError,2241 +unpackedSubsetPrecision,2242 +unpackedValues,2243 +unsignedIntegers,2244 +unusedBitsInBitmap,2245 +updateSequenceNumber,2246 +upperLimit,2247 +upperRange,2248 +upperThreshold,2249 +upperThresholdValue,2250 +userDateEnd,2251 +userDateStart,2252 +userDateTimeEnd,2253 +userDateTimeStart,2254 +userTimeEnd,2255 +userTimeStart,2256 +uuidOfHGrid,2257 +uuidOfVGrid,2258 +uvRelativeToGrid,2259 +validityDate,2260 +validityTime,2261 +values,2262 +variationOfVisibility,2263 +variationOfVisibilityDirection,2264 +variationOfVisibilityDirectionAngle,2265 +variationOfVisibilityDirectionTrend1,2266 +variationOfVisibilityDirectionTrend2,2267 +variationOfVisibilityDirectionTrend3,2268 +variationOfVisibilityDirectionTrend4,2269 +variationOfVisibilityTrend1,2270 +variationOfVisibilityTrend2,2271 +variationOfVisibilityTrend3,2272 +variationOfVisibilityTrend4,2273 +varno,2274 +verificationDate,2275 +verificationMonth,2276 +verificationYear,2277 +verifyingMonth,2278 +version,2279 +versionNumOfFilesFreeSpaceStorage,2280 +versionNumOfRootGroupSymbolTableEntry,2281 +versionNumOfSharedHeaderMessageFormat,2282 +versionNumberOfExperimentalSuite,2283 +versionNumberOfGribLocalTables,2284 +versionNumberOfSuperblock,2285 +versionOfModelClimate,2286 +verticalCoordinate,2287 +verticalCoordinateDefinition,2288 +verticalDomainTemplate,2289 +verticalDomainTemplateNumber,2290 +verticalVisibility,2291 +verticalVisibilityCoded,2292 +visibility,2293 +visibilityInKilometresTrend1,2294 +visibilityInKilometresTrend2,2295 +visibilityInKilometresTrend3,2296 +visibilityInKilometresTrend4,2297 +visibilityTrend1,2298 +visibilityTrend2,2299 +visibilityTrend3,2300 +visibilityTrend4,2301 +waveDomain,2302 +weightAppliedToClimateMonth1,2303 +westLongitudeOfCluster,2304 +westLongitudeOfDomainOfTubing,2305 +westernLongitudeOfClusterDomain,2306 +westernLongitudeOfDomain,2307 +widthOfFirstOrderValues,2308 +widthOfLengths,2309 +widthOfSPD,2310 +widthOfWidths,2311 +windDirection,2312 +windDirectionTrend1,2313 +windDirectionTrend2,2314 +windDirectionTrend3,2315 +windDirectionTrend4,2316 +windGust,2317 +windGustTrend1,2318 +windGustTrend2,2319 +windGustTrend3,2320 +windGustTrend4,2321 +windPresent,2322 +windSpeed,2323 +windSpeedTrend1,2324 +windSpeedTrend2,2325 +windSpeedTrend3,2326 +windSpeedTrend4,2327 +windUnits,2328 +windUnitsTrend1,2329 +windUnitsTrend2,2330 +windUnitsTrend3,2331 +windUnitsTrend4,2332 +windVariableDirection,2333 +windVariableDirectionTrend1,2334 +windVariableDirectionTrend2,2335 +windVariableDirectionTrend3,2336 +windVariableDirectionTrend4,2337 +wrongPadding,2338 +xCoordinateOfOriginOfSectorImage,2339 +xCoordinateOfSubSatellitePoint,2340 +xDirectionGridLength,2341 +xDirectionGridLengthInMetres,2342 +xDirectionGridLengthInMillimetres,2343 +xFirst,2344 +xLast,2345 +yCoordinateOfOriginOfSectorImage,2346 +yCoordinateOfSubSatellitePoint,2347 +yDirectionGridLength,2348 +yDirectionGridLengthInMetres,2349 +yDirectionGridLengthInMillimetres,2350 +yFirst,2351 +yLast,2352 +year,2353 +yearOfAnalysis,2354 +yearOfCentury,2355 +yearOfEndOfOverallTimeInterval,2356 +yearOfForecast,2357 +yearOfModelVersion,2358 +yearOfReference,2359 +zero,2360 diff --git a/tests/unit_tests.c b/tests/unit_tests.c index db2f37a9f..b2bca6944 100644 --- a/tests/unit_tests.c +++ b/tests/unit_tests.c @@ -1378,6 +1378,7 @@ static void test_string_splitting() char input[80] = "Born|To|Be|Wild"; char** list = 0; list = string_split(input, "|"); + assert(list); for (i = 0; list[i] != NULL; ++i) {} /* count how many tokens */ assert(i == 4); if (strcmp(list[0], "Born") != 0) assert(0); @@ -1391,6 +1392,7 @@ static void test_string_splitting() strcpy(input, "12345|a gap|"); list = string_split(input, "|"); + assert(list); for (i = 0; list[i] != NULL; ++i) {} /* count how many tokens */ assert(i == 2); if (strcmp(list[0], "12345") != 0) assert(0); @@ -1402,6 +1404,7 @@ static void test_string_splitting() strcpy(input, "Steppenwolf"); list = string_split(input, ","); + assert(list); for (i = 0; list[i] != NULL; ++i) {} /* count how many tokens */ assert(i == 1); if (strcmp(list[0], "Steppenwolf") != 0) assert(0); diff --git a/tools/bufr_compare.c b/tools/bufr_compare.c index 3102ec6bb..8c2cae0de 100644 --- a/tools/bufr_compare.c +++ b/tools/bufr_compare.c @@ -104,7 +104,7 @@ static void new_keys_list() static void release_keys_list() { grib_string_list* next = keys_list; - grib_string_list* cur = keys_list; + grib_string_list* cur = NULL; grib_context* c = grib_context_get_default(); while (next) { cur = next; From c0b2aa692f0a857bf49779ead11482470a814aff Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 21 Feb 2020 10:24:25 +0000 Subject: [PATCH 64/82] Latest updates from develop (19) --- examples/python/include.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/python/include.sh b/examples/python/include.sh index c3aab0493..e91fdd3d6 100644 --- a/examples/python/include.sh +++ b/examples/python/include.sh @@ -21,6 +21,9 @@ else PYTHONPATH=$cpath/python:$cpath/python/.libs:$PYTHONPATH export PYTHONPATH + HAVE_MEMFS=0 + ECCODES_ON_WINDOWS=0 + # Download the data needed for tests ${data_dir}/download.sh "${data_dir}" From 5870baa486c0d4987fe7a06c39a427d60c9bbf2b Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 21 Feb 2020 10:27:23 +0000 Subject: [PATCH 65/82] AppVeyor notifications --- .appveyor.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 09ff2b126..645e9bf89 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -103,6 +103,7 @@ notifications: - provider: Email to: - shahram.najm@ecmwf.int - subject: 'Build {{status}}' # optional + subject: 'Build {{status}}: {{projectName}} {{buildVersion}}' # optional message: "{{message}}, {{commitId}}, ..." # optional - on_build_success: false + on_build_success: true + on_build_failure: true From 4166bdb50135ad9fff95fb71595bfbad1bfc2970 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 21 Feb 2020 12:18:36 +0000 Subject: [PATCH 66/82] AppVeyor notifications: print branch --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 8c5189bc4..2035f5d61 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -104,7 +104,7 @@ notifications: to: - shahram.najm@ecmwf.int subject: 'Build {{status}}: {{projectName}} {{buildVersion}}' # optional - message: "{{message}}, {{commitId}}, ..." # optional + message: "{{message}}, {{commitId}}, {{pull_request_head_repo_branch}},..." # optional on_build_success: true on_build_failure: true From 97efc46626dbde637b026c79dcd19e5e29922e4d Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 24 Feb 2020 13:12:47 +0000 Subject: [PATCH 67/82] Latest updates from develop (20) --- src/grib_bits_any_endian.c | 1 + src/grib_util.c | 21 +++++++++++---------- src/grib_value.c | 19 +++++++++++++++---- tests/grib1to2.sh | 20 ++++++++++++++++---- tools/CMakeLists.txt | 1 + 5 files changed, 44 insertions(+), 18 deletions(-) diff --git a/src/grib_bits_any_endian.c b/src/grib_bits_any_endian.c index a6906bf4a..c1bccfae9 100644 --- a/src/grib_bits_any_endian.c +++ b/src/grib_bits_any_endian.c @@ -373,6 +373,7 @@ int grib_encode_unsigned_longb(unsigned char* p, unsigned long val, long* bitp, if (nb > max_nbits) { fprintf(stderr, "Number of bits (%ld) exceeds maximum number of bits (%d)\n", nb, max_nbits); Assert(0); + return GRIB_INTERNAL_ERROR; } #ifdef DEBUG { diff --git a/src/grib_util.c b/src/grib_util.c index 39846a587..59760bc0f 100644 --- a/src/grib_util.c +++ b/src/grib_util.c @@ -601,17 +601,18 @@ static int check_handle_against_spec(grib_handle* handle, const long edition, int err = 0; int check_latitudes = 1; int check_longitudes = 1; - double angular_precision = 1.0/1000.0; /* millidegree */ - double tolerance = angular_precision/2.0; /* half a millidegree */ - + long angleSubdivisions = 0; + double angular_precision = 1.0/1000.0; /* millidegree by default */ + double tolerance = 0; + if (edition == 2) { - angular_precision = 1.0/1000000.0; /* microdegree */ - tolerance = angular_precision/2.0; + return GRIB_SUCCESS; /* For now only do checks on edition 1 */ } - if (edition == 2) { - return GRIB_SUCCESS; /* For now only do checks on edition 1 */ + if ((err = grib_get_long(handle, "angleSubdivisions", &angleSubdivisions))==GRIB_SUCCESS) { + angular_precision = 1.0/angleSubdivisions; } + tolerance = angular_precision/2.0; if (spec->grid_type == GRIB_UTIL_GRID_SPEC_POLAR_STEREOGRAPHIC || spec->grid_type == GRIB_UTIL_GRID_SPEC_SH) @@ -643,8 +644,8 @@ static int check_handle_against_spec(grib_handle* handle, const long edition, double lat1, lat2; const double lat1spec = normalise_angle(spec->latitudeOfFirstGridPointInDegrees); const double lat2spec = normalise_angle(spec->latitudeOfLastGridPointInDegrees); - if ((err = grib_get_double(handle, "latitudeOfFirstGridPointInDegrees", &lat1))!=0) return err; - if ((err = grib_get_double(handle, "latitudeOfLastGridPointInDegrees", &lat2))!=0) return err; + if ((err = grib_get_double(handle, "latitudeOfFirstGridPointInDegrees", &lat1))!=0) return err; + if ((err = grib_get_double(handle, "latitudeOfLastGridPointInDegrees", &lat2))!=0) return err; lat1 = normalise_angle(lat1); lat2 = normalise_angle(lat2); @@ -672,7 +673,7 @@ static int check_handle_against_spec(grib_handle* handle, const long edition, const double lon1spec = normalise_angle(spec->longitudeOfFirstGridPointInDegrees); const double lon2spec = normalise_angle(spec->longitudeOfLastGridPointInDegrees); if ((err = grib_get_double(handle, "longitudeOfFirstGridPointInDegrees", &lon1))!=0) return err; - if ((err = grib_get_double(handle, "longitudeOfLastGridPointInDegrees", &lon2))!=0) return err; + if ((err = grib_get_double(handle, "longitudeOfLastGridPointInDegrees", &lon2))!=0) return err; lon1 = normalise_angle(lon1); lon2 = normalise_angle(lon2); diff --git a/src/grib_value.c b/src/grib_value.c index 814651dab..3f8a30cca 100644 --- a/src/grib_value.c +++ b/src/grib_value.c @@ -12,6 +12,7 @@ * Enrico Fucile * ***************************************************************************/ #include "grib_api_internal.h" +#include /* Note: A fast cut-down version of strcmp which does NOT return -1 */ /* 0 means input strings are equal and 1 means not equal */ @@ -708,15 +709,25 @@ static int __grib_set_double_array(grib_handle* h, const char* name, const doubl if (h->context->debug) { size_t N = 5; + /*double minVal = DBL_MAX, maxVal = -DBL_MAX;*/ if (length <= N) N = length; fprintf(stderr, "ECCODES DEBUG grib_set_double_array key=%s %ld values (", name, (long)length); for (i = 0; i < N; ++i) fprintf(stderr, " %g,", val[i]); - if (N >= length) - fprintf(stderr, " )\n"); - else - fprintf(stderr, " ... )\n"); + if (N >= length) fprintf(stderr, " )\n"); + else fprintf(stderr, " ... )\n"); + /* + * if (N >= length) + * fprintf(stderr, " )\t"); + * else + * fprintf(stderr, " ... )\t"); + * for (i = 0; i < length; ++i) { + * if (val[i] < minVal) minVal = val[i]; + * if (val[i] > maxVal) maxVal = val[i]; + * } + * fprintf(stderr, "min=%g, max=%g\n",minVal,maxVal); + */ } if (length == 0) { diff --git a/tests/grib1to2.sh b/tests/grib1to2.sh index 8660683df..1eb37ecfe 100755 --- a/tests/grib1to2.sh +++ b/tests/grib1to2.sh @@ -50,8 +50,8 @@ do done -# ECC-457 ECMWF total precipitation -# ---------------------------------- +echo "ECC-457 ECMWF total precipitation..." +# ----------------------------------------- input=${data_dir}/tp_ecmwf.grib output=temp.grib1to2.grib ${tools_dir}/grib_set -s edition=2 $input $output @@ -59,8 +59,9 @@ res=`${tools_dir}/grib_get -w count=1 -p edition,paramId,units $output` [ "$res" = "2 228228 kg m**-2" ] rm -f $output -# Local Definition 30 -# -------------------- + +echo "Local Definition 30..." +# ---------------------------- sample_g1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl ${tools_dir}/grib_set -s setLocalDefinition=1,localDefinitionNumber=30,stepType=accum,edition=2 $sample_g1 $output grib_check_key_equals $output productDefinitionTemplateNumber 11 @@ -68,6 +69,17 @@ ${tools_dir}/grib_set -s setLocalDefinition=1,localDefinitionNumber=30,type=em,s grib_check_key_equals $output productDefinitionTemplateNumber 12 rm -f $output + +echo "Check global gaussian grids are preserved..." +# ------------------------------------------------- +# Input is global gaussian so converted output should also be global with the correct lat/lon +input=$data_dir/reduced_gaussian_surface.grib1 +${tools_dir}/grib_set -s edition=2 $input $output +grib_check_key_equals $output latitudeOfFirstGridPoint,longitudeOfLastGridPoint '87863799 357187500' +if [ -x "${tools_dir}/grib_check_gaussian_grid" ]; then + ${tools_dir}/grib_check_gaussian_grid $input $output +fi + #sed "s:toolsdir:${tools_dir}/:" ${tools_dir}/grib1to2.txt > ${tools_dir}/grib1to2.test #chmod +x ${tools_dir}/grib1to2.test #${tools_dir}/grib1to2.test -f ${data_dir}/test.grib1 ${data_dir}/test.grib2 diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 19591c749..ecf60298b 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -95,6 +95,7 @@ ecbuild_add_executable( TARGET codes_bufr_filter # grib1to2 script needs to be generated before installation if (ECCODES_INSTALL_EXTRA_TOOLS) + ecbuild_info("ECCODES_INSTALL_EXTRA_TOOLS enabled") configure_file( grib1to2.in grib1to2 ) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/grib1to2 DESTINATION ${INSTALL_BIN_DIR} From e42ca87a9fba602d7d36d6b7446e716b3e73d3ec Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 24 Feb 2020 14:15:37 +0000 Subject: [PATCH 68/82] AppVeyor notifications --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 2035f5d61..0fa903610 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -106,5 +106,5 @@ notifications: subject: 'Build {{status}}: {{projectName}} {{buildVersion}}' # optional message: "{{message}}, {{commitId}}, {{pull_request_head_repo_branch}},..." # optional on_build_success: true - on_build_failure: true + on_build_failure: false From a72aeaa5a49a5467f6bc383a0c07b08b934a12b7 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 24 Feb 2020 15:36:15 +0000 Subject: [PATCH 69/82] Latest updates from develop (21) --- src/action_class_section.c | 2 +- ...ssor_class_bufr_extract_datetime_subsets.c | 1 + ...grib_accessor_class_data_complex_packing.c | 3 -- src/grib_accessor_class_data_png_packing.c | 5 +-- src/grib_accessor_class_data_sh_packed.c | 6 ++-- src/grib_accessor_class_data_sh_unpacked.c | 1 + src/grib_accessor_class_latitudes.c | 1 - src/grib_dumper_class_bufr_encode_C.c | 23 ++++++------- src/grib_dumper_class_bufr_encode_filter.c | 32 ++++++++++--------- src/grib_dumper_class_bufr_encode_fortran.c | 28 ++++++++-------- src/grib_dumper_class_bufr_encode_python.c | 23 ++++++------- src/grib_dumper_class_bufr_simple.c | 27 +++++++++------- src/grib_dumper_class_json.c | 14 ++++---- src/grib_handle.c | 2 +- 14 files changed, 84 insertions(+), 84 deletions(-) diff --git a/src/action_class_section.c b/src/action_class_section.c index cc6ca27a5..5dd474929 100644 --- a/src/action_class_section.c +++ b/src/action_class_section.c @@ -177,7 +177,7 @@ static int notify_change(grib_action* act, grib_accessor* notified, if (err) { if (err == GRIB_NOT_FOUND && strcmp(act->name, "dataValues") == 0) { /* FIXME: Allow this error. Needed when changing some packingTypes e.g. CCSDS to Simple */ - err = GRIB_SUCCESS; + /*err = GRIB_SUCCESS;*/ } else { return err; diff --git a/src/grib_accessor_class_bufr_extract_datetime_subsets.c b/src/grib_accessor_class_bufr_extract_datetime_subsets.c index 500fa3b23..a8dd2ffb0 100644 --- a/src/grib_accessor_class_bufr_extract_datetime_subsets.c +++ b/src/grib_accessor_class_bufr_extract_datetime_subsets.c @@ -330,6 +330,7 @@ static int select_datetime(grib_accessor* a) ret = 0; second[0] = 0; n = 1; + (void)ret; } if (n != numberOfSubsets) { if (n == 1) { diff --git a/src/grib_accessor_class_data_complex_packing.c b/src/grib_accessor_class_data_complex_packing.c index b1c5bc0e9..fade0feb8 100644 --- a/src/grib_accessor_class_data_complex_packing.c +++ b/src/grib_accessor_class_data_complex_packing.c @@ -724,7 +724,6 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) mmax = 0; maxv = pen_j + 1; i = 0; - lcount = 0; hcount = 0; sub_k = sub_j; @@ -804,8 +803,6 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) mmax = 0; maxv = pen_j + 1; - i = 0; - lcount = 0; hcount = 0; sub_k = sub_j; diff --git a/src/grib_accessor_class_data_png_packing.c b/src/grib_accessor_class_data_png_packing.c index 7632bb403..cb7e2d04b 100644 --- a/src/grib_accessor_class_data_png_packing.c +++ b/src/grib_accessor_class_data_png_packing.c @@ -402,10 +402,8 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) long number_of_data_points; long nn = 0; - self->dirty = 1; - n_vals = 0; err = grib_value_count(a, &nn); n_vals = nn; if (err) @@ -542,8 +540,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) buflen++; } } - /* buflen = n_vals*(bits_per_value/8);*/ - + /* buflen = n_vals*(bits_per_value/8); */ grib_context_log(a->context, GRIB_LOG_DEBUG, "grib_accessor_data_png_packing : pack_double : packing %s, %d values", a->name, n_vals); buf = grib_context_buffer_malloc_clear(a->context, buflen); diff --git a/src/grib_accessor_class_data_sh_packed.c b/src/grib_accessor_class_data_sh_packed.c index 28f3336e4..ba30e1a3c 100644 --- a/src/grib_accessor_class_data_sh_packed.c +++ b/src/grib_accessor_class_data_sh_packed.c @@ -240,7 +240,6 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) long n_vals = 0; double* scals = NULL; /* double *pscals=NULL; */ - double dummy = 0; double s = 0; double d = 0; @@ -375,9 +374,8 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) lup = mmax; if (sub_k >= 0) { for (hcount = 0; hcount < sub_k + 1; hcount++) { - dummy = decode_float(grib_decode_unsigned_long(hres, &hpos, 8 * bytes)); - dummy = decode_float(grib_decode_unsigned_long(hres, &hpos, 8 * bytes)); - (void)dummy; + decode_float(grib_decode_unsigned_long(hres, &hpos, 8 * bytes)); + decode_float(grib_decode_unsigned_long(hres, &hpos, 8 * bytes)); lup++; } sub_k--; diff --git a/src/grib_accessor_class_data_sh_unpacked.c b/src/grib_accessor_class_data_sh_unpacked.c index 31485bedd..4e669f81f 100644 --- a/src/grib_accessor_class_data_sh_unpacked.c +++ b/src/grib_accessor_class_data_sh_unpacked.c @@ -371,6 +371,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) /* pscals=scals+lup; */ for (lcount = hcount; lcount < maxv; lcount++) { dummy = d * (double)((grib_decode_unsigned_long(lres, &lpos, bits_per_value) * s) + reference_value); + (void)dummy; dummy = d * (double)((grib_decode_unsigned_long(lres, &lpos, bits_per_value) * s) + reference_value); (void)dummy; /* suppress gcc warning */ lup++; diff --git a/src/grib_accessor_class_latitudes.c b/src/grib_accessor_class_latitudes.c index 522a6b262..b9490f63c 100644 --- a/src/grib_accessor_class_latitudes.c +++ b/src/grib_accessor_class_latitudes.c @@ -194,7 +194,6 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) grib_iterator* iter = NULL; self->save = 1; - size = 0; ret = value_count(a, &count); if (ret) return ret; diff --git a/src/grib_dumper_class_bufr_encode_C.c b/src/grib_dumper_class_bufr_encode_C.c index 0409a9334..23fb8bf2b 100644 --- a/src/grib_dumper_class_bufr_encode_C.c +++ b/src/grib_dumper_class_bufr_encode_C.c @@ -173,7 +173,7 @@ static void dump_values(grib_dumper* d, grib_accessor* a) { grib_dumper_bufr_encode_C* self = (grib_dumper_bufr_encode_C*)d; double value = 0; - size_t size = 0; + size_t size = 0, size2 = 0; double* values = NULL; int err = 0; int i, r, icount; @@ -187,15 +187,16 @@ static void dump_values(grib_dumper* d, grib_accessor* a) return; grib_value_count(a, &count); - size = count; + size = size2 = count; if (size > 1) { values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); - err = grib_unpack_double(a, values, &size); + err = grib_unpack_double(a, values, &size2); } else { - err = grib_unpack_double(a, &value, &size); + err = grib_unpack_double(a, &value, &size2); } + Assert(size2 == size); self->empty = 0; @@ -280,8 +281,7 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* return; grib_value_count(a, &count); - size = count; - size2 = size; + size = size2 = count; if (size > 1) { values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); @@ -290,7 +290,7 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* else { err = grib_unpack_double(a, &value, &size2); } - Assert(size == size2); + Assert(size2 == size); self->empty = 0; @@ -349,7 +349,7 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) { grib_dumper_bufr_encode_C* self = (grib_dumper_bufr_encode_C*)d; long value = 0; - size_t size = 0; + size_t size = 0, size2 = 0; long* values = NULL; int err = 0; int i, r, icount; @@ -365,7 +365,7 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) doing_unexpandedDescriptors = (strcmp(a->name, "unexpandedDescriptors") == 0); grib_value_count(a, &count); - size = count; + size = size2 = count; if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { if (self->isLeaf == 0) { @@ -391,11 +391,12 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) if (size > 1) { values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); - err = grib_unpack_long(a, values, &size); + err = grib_unpack_long(a, values, &size2); } else { - err = grib_unpack_long(a, &value, &size); + err = grib_unpack_long(a, &value, &size2); } + Assert(size2 == size); self->empty = 0; diff --git a/src/grib_dumper_class_bufr_encode_filter.c b/src/grib_dumper_class_bufr_encode_filter.c index 259b1a617..1c3d2bc8e 100644 --- a/src/grib_dumper_class_bufr_encode_filter.c +++ b/src/grib_dumper_class_bufr_encode_filter.c @@ -154,7 +154,7 @@ static void dump_values(grib_dumper* d, grib_accessor* a) { grib_dumper_bufr_encode_filter* self = (grib_dumper_bufr_encode_filter*)d; double value = 0; - size_t size = 0; + size_t size = 0, size2 = 0; double* values = NULL; int err = 0; int i, r; @@ -167,15 +167,16 @@ static void dump_values(grib_dumper* d, grib_accessor* a) return; grib_value_count(a, &count); - size = count; + size = size2 = count; if (size > 1) { values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); - err = grib_unpack_double(a, values, &size); + err = grib_unpack_double(a, values, &size2); } else { - err = grib_unpack_double(a, &value, &size); + err = grib_unpack_double(a, &value, &size2); } + Assert(size2 == size); self->begin = 0; self->empty = 0; @@ -256,8 +257,7 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* return; grib_value_count(a, &count); - size = count; - size2 = size; + size = size2 = count; if (size > 1) { values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); @@ -266,7 +266,7 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* else { err = grib_unpack_double(a, &value, &size2); } - Assert(size == size2); + Assert(size2 == size); self->empty = 0; @@ -316,7 +316,7 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) { grib_dumper_bufr_encode_filter* self = (grib_dumper_bufr_encode_filter*)d; long value = 0; - size_t size = 0; + size_t size = 0, size2 = 0; long* values = NULL; int err = 0; int i, r, icount; @@ -329,7 +329,7 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) return; grib_value_count(a, &count); - size = count; + size = size2 = count; if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { if (self->isLeaf == 0) { @@ -355,11 +355,12 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) if (size > 1) { values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); - err = grib_unpack_long(a, values, &size); + err = grib_unpack_long(a, values, &size2); } else { - err = grib_unpack_long(a, &value, &size); + err = grib_unpack_long(a, &value, &size2); } + Assert(size2 == size); self->begin = 0; self->empty = 0; @@ -426,7 +427,7 @@ static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* pr { grib_dumper_bufr_encode_filter* self = (grib_dumper_bufr_encode_filter*)d; long value = 0; - size_t size = 0; + size_t size = 0, size2 = 0; long* values = NULL; int err = 0; int i, icount; @@ -438,15 +439,16 @@ static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* pr return; grib_value_count(a, &count); - size = count; + size = size2 = count; if (size > 1) { values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); - err = grib_unpack_long(a, values, &size); + err = grib_unpack_long(a, values, &size2); } else { - err = grib_unpack_long(a, &value, &size); + err = grib_unpack_long(a, &value, &size2); } + Assert(size2 == size); self->empty = 0; diff --git a/src/grib_dumper_class_bufr_encode_fortran.c b/src/grib_dumper_class_bufr_encode_fortran.c index b8a2cff78..a3fcf5534 100644 --- a/src/grib_dumper_class_bufr_encode_fortran.c +++ b/src/grib_dumper_class_bufr_encode_fortran.c @@ -221,7 +221,7 @@ static void dump_values(grib_dumper* d, grib_accessor* a) { grib_dumper_bufr_encode_fortran* self = (grib_dumper_bufr_encode_fortran*)d; double value = 0; - size_t size = 0; + size_t size = 0, size2 = 0; double* values = NULL; int err = 0; int i, r, icount; @@ -235,15 +235,16 @@ static void dump_values(grib_dumper* d, grib_accessor* a) return; grib_value_count(a, &count); - size = count; + size = size2 = count; if (size > 1) { values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); - err = grib_unpack_double(a, values, &size); + err = grib_unpack_double(a, values, &size2); } else { - err = grib_unpack_double(a, &value, &size); + err = grib_unpack_double(a, &value, &size2); } + Assert(size2 == size); self->empty = 0; @@ -328,8 +329,7 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* return; grib_value_count(a, &count); - size = count; - size2 = size; + size = size2 = count; if (size > 1) { values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); @@ -338,7 +338,7 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* else { err = grib_unpack_double(a, &value, &size2); } - Assert(size == size2); + Assert(size2 == size); self->empty = 0; @@ -397,7 +397,7 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) { grib_dumper_bufr_encode_fortran* self = (grib_dumper_bufr_encode_fortran*)d; long value = 0; - size_t size = 0; + size_t size = 0, size2 = 0; long* values = NULL; int err = 0; int i, r, icount; @@ -413,7 +413,7 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) doing_unexpandedDescriptors = (strcmp(a->name, "unexpandedDescriptors") == 0); grib_value_count(a, &count); - size = count; + size = size2 = count; if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { if (self->isLeaf == 0) { @@ -439,11 +439,12 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) if (size > 1) { values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); - err = grib_unpack_long(a, values, &size); + err = grib_unpack_long(a, values, &size2); } else { - err = grib_unpack_long(a, &value, &size); + err = grib_unpack_long(a, &value, &size2); } + Assert(size2 == size); self->empty = 0; @@ -540,8 +541,7 @@ static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* pr return; grib_value_count(a, &count); - size = count; - size2 = size; + size = size2 = count; if (size > 1) { values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); @@ -550,7 +550,7 @@ static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* pr else { err = grib_unpack_long(a, &value, &size2); } - Assert(size == size2); + Assert(size2 == size); self->empty = 0; diff --git a/src/grib_dumper_class_bufr_encode_python.c b/src/grib_dumper_class_bufr_encode_python.c index 94572253c..57ddaa8b6 100644 --- a/src/grib_dumper_class_bufr_encode_python.c +++ b/src/grib_dumper_class_bufr_encode_python.c @@ -173,7 +173,7 @@ static void dump_values(grib_dumper* d, grib_accessor* a) { grib_dumper_bufr_encode_python* self = (grib_dumper_bufr_encode_python*)d; double value = 0; - size_t size = 0; + size_t size = 0, size2 = 0; double* values = NULL; int err = 0; int i, r, icount; @@ -187,15 +187,16 @@ static void dump_values(grib_dumper* d, grib_accessor* a) return; grib_value_count(a, &count); - size = count; + size = size2 = count; if (size > 1) { values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); - err = grib_unpack_double(a, values, &size); + err = grib_unpack_double(a, values, &size2); } else { - err = grib_unpack_double(a, &value, &size); + err = grib_unpack_double(a, &value, &size2); } + Assert(size2 == size); self->empty = 0; @@ -281,8 +282,7 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* return; grib_value_count(a, &count); - size = count; - size2 = size; + size = size2 = count; if (size > 1) { values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); @@ -291,7 +291,7 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* else { err = grib_unpack_double(a, &value, &size2); } - Assert(size == size2); + Assert(size2 == size); self->empty = 0; @@ -351,7 +351,7 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) { grib_dumper_bufr_encode_python* self = (grib_dumper_bufr_encode_python*)d; long value = 0; - size_t size = 0; + size_t size = 0, size2 = 0; long* values = NULL; int err = 0; int i, r, icount; @@ -367,7 +367,7 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) doing_unexpandedDescriptors = (strcmp(a->name, "unexpandedDescriptors") == 0); grib_value_count(a, &count); - size = count; + size = size2 = count; if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { if (self->isLeaf == 0) { @@ -393,11 +393,12 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) if (size > 1) { values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); - err = grib_unpack_long(a, values, &size); + err = grib_unpack_long(a, values, &size2); } else { - err = grib_unpack_long(a, &value, &size); + err = grib_unpack_long(a, &value, &size2); } + Assert(size2 == size); self->empty = 0; diff --git a/src/grib_dumper_class_bufr_simple.c b/src/grib_dumper_class_bufr_simple.c index abff5602f..e8e54b5d0 100644 --- a/src/grib_dumper_class_bufr_simple.c +++ b/src/grib_dumper_class_bufr_simple.c @@ -151,7 +151,7 @@ static void dump_values(grib_dumper* d, grib_accessor* a) { grib_dumper_bufr_simple* self = (grib_dumper_bufr_simple*)d; double value = 0; - size_t size = 0; + size_t size = 0, size2 = 0; double* values = NULL; int err = 0; int i, r; @@ -164,15 +164,16 @@ static void dump_values(grib_dumper* d, grib_accessor* a) return; grib_value_count(a, &count); - size = count; + size = size2 = count; if (size > 1) { values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); - err = grib_unpack_double(a, values, &size); + err = grib_unpack_double(a, values, &size2); } else { - err = grib_unpack_double(a, &value, &size); + err = grib_unpack_double(a, &value, &size2); } + Assert(size2 == size); self->empty = 0; @@ -241,7 +242,7 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* { grib_dumper_bufr_simple* self = (grib_dumper_bufr_simple*)d; double value = 0; - size_t size = 0; + size_t size = 0, size2 = 0; double* values = NULL; int err = 0; int i, icount; @@ -253,15 +254,16 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* return; grib_value_count(a, &count); - size = count; + size = size2 = count; if (size > 1) { values = (double*)grib_context_malloc_clear(c, sizeof(double) * size); - err = grib_unpack_double(a, values, &size); + err = grib_unpack_double(a, values, &size2); } else { - err = grib_unpack_double(a, &value, &size); + err = grib_unpack_double(a, &value, &size2); } + Assert(size2 == size); self->empty = 0; @@ -312,7 +314,7 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) { grib_dumper_bufr_simple* self = (grib_dumper_bufr_simple*)d; long value = 0; - size_t size = 0; + size_t size = 0, size2 = 0; long* values = NULL; int err = 0; int i, r, icount; @@ -325,7 +327,7 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) return; grib_value_count(a, &count); - size = count; + size = size2 = count; if ((a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) { if (self->isLeaf == 0) { @@ -360,11 +362,12 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) if (size > 1) { values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); - err = grib_unpack_long(a, values, &size); + err = grib_unpack_long(a, values, &size2); } else { - err = grib_unpack_long(a, &value, &size); + err = grib_unpack_long(a, &value, &size2); } + Assert(size2 == size); self->empty = 0; diff --git a/src/grib_dumper_class_json.c b/src/grib_dumper_class_json.c index 5defedad4..bd2dd0b97 100644 --- a/src/grib_dumper_class_json.c +++ b/src/grib_dumper_class_json.c @@ -144,8 +144,7 @@ static void dump_values(grib_dumper* d, grib_accessor* a) h = grib_handle_of_accessor(a); grib_value_count(a, &count); - size = count; - size2 = size; + size = size2 = count; if (size > 1) { values = (double*)grib_context_malloc_clear(a->context, sizeof(double) * size); @@ -154,7 +153,7 @@ static void dump_values(grib_dumper* d, grib_accessor* a) else { err = grib_unpack_double(a, &value, &size2); } - Assert(size == size2); + Assert(size2 == size); (void)err; /* TODO */ if (self->begin == 0 && self->empty == 0 && self->isAttribute == 0) @@ -227,7 +226,7 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) { grib_dumper_json* self = (grib_dumper_json*)d; long value = 0; - size_t size = 1; + size_t size = 1, size2 = 0; long* values = NULL; int err = 0; int i; @@ -238,15 +237,16 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) return; grib_value_count(a, &count); - size = count; + size = size2 = count; if (size > 1) { values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); - err = grib_unpack_long(a, values, &size); + err = grib_unpack_long(a, values, &size2); } else { - err = grib_unpack_long(a, &value, &size); + err = grib_unpack_long(a, &value, &size2); } + Assert(size2 == size); if (self->begin == 0 && self->empty == 0 && self->isAttribute == 0) fprintf(self->dumper.out, ","); diff --git a/src/grib_handle.c b/src/grib_handle.c index 3d355012f..84ea5a79e 100644 --- a/src/grib_handle.c +++ b/src/grib_handle.c @@ -1510,7 +1510,7 @@ static int grib2_has_next_section(unsigned char* msgbegin, size_t msglen, unsign return 0; } - secbegin += seclen; + /*secbegin += seclen;*/ return 1; } From ebc65ac202b6e77c70f220e9e8c71896a30a3199 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 27 Feb 2020 17:35:53 +0000 Subject: [PATCH 70/82] Latest updates from develop (22) --- definitions/grib2/cfVarName.def | 2 +- definitions/grib2/lcwfv_suiteName.table | 2 +- definitions/grib2/name.def | 4 +- definitions/grib2/paramId.def | 2 +- definitions/grib2/shortName.def | 2 +- definitions/grib2/units.def | 2 +- src/bufr_util.c | 12 ++++- ..._accessor_class_data_apply_gdsnotpresent.c | 10 ++-- ...s_data_g1second_order_row_by_row_packing.c | 8 +-- src/grib_accessor_class_g1step_range.c | 15 +++++- src/grib_accessor_class_gen.c | 3 +- src/grib_accessor_class_md5.c | 11 ++-- src/grib_accessor_class_spd.c | 1 + src/grib_box_class_reduced_gaussian.c | 6 ++- src/grib_dumper_class_bufr_encode_python.c | 28 +++++----- src/grib_expression.c | 2 +- src/grib_handle.c | 1 - src/grib_ieeefloat.c | 2 +- src/grib_util.c | 6 +-- tests/CMakeLists.txt | 1 + tests/Makefile.am | 1 + tests/bufr_extract_headers.sh | 8 +++ tests/grib_lambert_conformal.sh | 51 +++++++++++++++++++ tests/jpeg_perf.c | 2 +- tests/unit_tests.c | 20 +++++++- tigge/tigge_accumulations.c | 2 + tigge/tigge_check.c | 5 +- tools/grib_ls.c | 5 +- tools/grib_to_netcdf.c | 15 +++--- 29 files changed, 170 insertions(+), 59 deletions(-) create mode 100755 tests/grib_lambert_conformal.sh diff --git a/definitions/grib2/cfVarName.def b/definitions/grib2/cfVarName.def index d76027b4f..2ae3d0eaa 100644 --- a/definitions/grib2/cfVarName.def +++ b/definitions/grib2/cfVarName.def @@ -1451,7 +1451,7 @@ parameterCategory = 1 ; parameterNumber = 4 ; } -#Falciparum parasite rates +#Falciparum parasite ratio 'mal_para_rate' = { discipline = 20 ; parameterCategory = 1 ; diff --git a/definitions/grib2/lcwfv_suiteName.table b/definitions/grib2/lcwfv_suiteName.table index ad7bf9b95..95dba4c05 100644 --- a/definitions/grib2/lcwfv_suiteName.table +++ b/definitions/grib2/lcwfv_suiteName.table @@ -8,7 +8,7 @@ 6 lfpw Wave model run by METFR 7 edzw Wave model run by DWD 8 ammc Wave model run by BoM -# Note: code==84 and subcentre==202 +# Note: For MeteoFrance code==85 and subcentre==202 # lops = Laboratoire D'Oceanographie Physique et Spatiale 9 lops Wave model run by LOPS 10 rjtd Wave model run by JMA diff --git a/definitions/grib2/name.def b/definitions/grib2/name.def index acf965192..6b861ff47 100644 --- a/definitions/grib2/name.def +++ b/definitions/grib2/name.def @@ -1451,8 +1451,8 @@ parameterCategory = 1 ; parameterNumber = 4 ; } -#Falciparum parasite rates -'Falciparum parasite rates' = { +#Falciparum parasite ratio +'Falciparum parasite ratio' = { discipline = 20 ; parameterCategory = 1 ; parameterNumber = 5 ; diff --git a/definitions/grib2/paramId.def b/definitions/grib2/paramId.def index 923072e1a..3a06e318b 100644 --- a/definitions/grib2/paramId.def +++ b/definitions/grib2/paramId.def @@ -1451,7 +1451,7 @@ parameterCategory = 1 ; parameterNumber = 4 ; } -#Falciparum parasite rates +#Falciparum parasite ratio '261008' = { discipline = 20 ; parameterCategory = 1 ; diff --git a/definitions/grib2/shortName.def b/definitions/grib2/shortName.def index a2f403a0f..200a6efa9 100644 --- a/definitions/grib2/shortName.def +++ b/definitions/grib2/shortName.def @@ -1451,7 +1451,7 @@ parameterCategory = 1 ; parameterNumber = 4 ; } -#Falciparum parasite rates +#Falciparum parasite ratio 'mal_para_rate' = { discipline = 20 ; parameterCategory = 1 ; diff --git a/definitions/grib2/units.def b/definitions/grib2/units.def index d42ef0f8d..65bb74186 100644 --- a/definitions/grib2/units.def +++ b/definitions/grib2/units.def @@ -1451,7 +1451,7 @@ parameterCategory = 1 ; parameterNumber = 4 ; } -#Falciparum parasite rates +#Falciparum parasite ratio 'Fraction' = { discipline = 20 ; parameterCategory = 1 ; diff --git a/src/bufr_util.c b/src/bufr_util.c index 607d88a76..21842a3fe 100644 --- a/src/bufr_util.c +++ b/src/bufr_util.c @@ -571,7 +571,7 @@ static int count_bufr_messages(grib_context* c, FILE* f, int* n, int strict_mode while (!done) { mesg = wmo_read_bufr_from_file_malloc(f, 0, &size, &offset, &err); - /*printf("Count so far=%ld, mesg=%x, err=%d (%s)\n", *count, mesg, err, grib_get_error_message(err));*/ + /*printf("Count so far=%d, mesg=%x, err=%d (%s)\n", *n, mesg, err, grib_get_error_message(err));*/ if (!mesg) { if (err == GRIB_END_OF_FILE || err == GRIB_PREMATURE_END_OF_FILE) { done = 1; /* reached the end */ @@ -584,7 +584,13 @@ static int count_bufr_messages(grib_context* c, FILE* f, int* n, int strict_mode grib_context_free(c, mesg); } (*n)++; + if (*n >= INT_MAX/100) { + grib_context_log(c, GRIB_LOG_ERROR, "Limit reached: looped %d times without finding a valid BUFR message", *n); + done = 1; + err = GRIB_INTERNAL_ERROR; + } } + (void)done; rewind(f); if (err == GRIB_END_OF_FILE) err = GRIB_SUCCESS; @@ -601,6 +607,10 @@ int codes_bufr_extract_headers_malloc(grib_context* c, const char* filename, cod if (!c) c = grib_context_get_default(); + if (path_is_directory(filename)) { + grib_context_log(c, GRIB_LOG_ERROR, "codes_bufr_extract_headers_malloc: \"%s\" is a directory", filename); + return GRIB_IO_PROBLEM; + } fp = fopen(filename, "rb"); if (!fp) { grib_context_log(c, GRIB_LOG_ERROR, "codes_bufr_extract_headers_malloc: Unable to read file \"%s\"", filename); diff --git a/src/grib_accessor_class_data_apply_gdsnotpresent.c b/src/grib_accessor_class_data_apply_gdsnotpresent.c index 7d6fec79d..1d8e5284c 100644 --- a/src/grib_accessor_class_data_apply_gdsnotpresent.c +++ b/src/grib_accessor_class_data_apply_gdsnotpresent.c @@ -200,9 +200,8 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) long nn = 0; int err = 0; size_t size = 0; - long missing_value; - - double* coded_vals = NULL; + long missing_value = 0; + double* coded_vals = NULL; err = grib_value_count(a, &nn); n_vals = nn; @@ -231,7 +230,6 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) if (number_of_values > 0) { coded_vals = (double*)grib_context_malloc(a->context, number_of_values * sizeof(double)); - if (coded_vals == NULL) return GRIB_OUT_OF_MEMORY; } @@ -252,12 +250,16 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) a->name, number_of_points); if (latitude_of_first_point == 0) { + if (number_of_values && !coded_vals) + return GRIB_INTERNAL_ERROR; for (i = 0; i < number_of_values; i++) val[i] = coded_vals[i]; for (i = number_of_values; i < number_of_points; i++) val[i] = coded_vals[number_of_values - 1]; } else { + if ((ni-1) && !coded_vals) + return GRIB_INTERNAL_ERROR; for (i = 0; i < ni - 1; i++) val[i] = coded_vals[0]; for (i = ni - 1; i < number_of_points; i++) diff --git a/src/grib_accessor_class_data_g1second_order_row_by_row_packing.c b/src/grib_accessor_class_data_g1second_order_row_by_row_packing.c index ffabc88b1..c6c76fc5a 100644 --- a/src/grib_accessor_class_data_g1second_order_row_by_row_packing.c +++ b/src/grib_accessor_class_data_g1second_order_row_by_row_packing.c @@ -249,7 +249,7 @@ static int value_count(grib_accessor* a, long* count) long *bitmap, *pbitmap; size_t numberOfPoints = 0; - if (plSize) { + if (plSize && pl) { for (i = 0; i < numberOfRows; i++) numberOfPoints += pl[i]; grib_context_free(c, pl); @@ -342,7 +342,7 @@ static int unpack_double(grib_accessor* a, double* values, size_t* len) long *bitmap, *pbitmap; size_t numberOfPoints = Ni * Nj; - if (plSize) { + if (plSize && pl) { numberOfPoints = 0; for (i = 0; i < numberOfRows; i++) numberOfPoints += pl[i]; @@ -350,7 +350,7 @@ static int unpack_double(grib_accessor* a, double* values, size_t* len) bitmap = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfPoints); pbitmap = bitmap; grib_get_long_array(gh, self->bitmap, bitmap, &numberOfPoints); - if (plSize) { + if (plSize && pl) { for (i = 0; i < numberOfRows; i++) { for (j = 0; j < pl[i]; j++) { numbersPerRow[i] += *(bitmap++); @@ -369,7 +369,7 @@ static int unpack_double(grib_accessor* a, double* values, size_t* len) grib_context_free(a->context, pbitmap); } else { - if (plSize) { + if (plSize && pl) { for (i = 0; i < numberOfRows; i++) numbersPerRow[i] = pl[i]; } diff --git a/src/grib_accessor_class_g1step_range.c b/src/grib_accessor_class_g1step_range.c index 4dea9a15c..34559ce69 100644 --- a/src/grib_accessor_class_g1step_range.c +++ b/src/grib_accessor_class_g1step_range.c @@ -331,8 +331,8 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) long start = 0, theEnd = 0; long timeRangeIndicator = 0; long unit; - int err = 0; - char stepType[20] = {0,}; + int err = 0; + char stepType[20] = {0,}; size_t stepTypeLen = 20; grib_handle* hand = grib_handle_of_accessor(a); @@ -540,6 +540,9 @@ static int pack_string(grib_accessor* a, const char* val, size_t* len) } if (timeRangeIndicator == 10) { + /* + * timeRangeIndicator = 10 means 'P1 occupies octets 19 and 20' i.e. 16 bits + */ long off = 0; grib_accessor* p1_accessor = NULL; if (theEnd != start && !h->context->gribex_mode_on) { @@ -563,6 +566,9 @@ static int pack_string(grib_accessor* a, const char* val, size_t* len) return GRIB_NOT_FOUND; } off = p1_accessor->offset * 8; + /* Note: here we assume the key P2 is one octet and immediately follows P1. Hence 16 bits */ + if (h->context->debug) + fprintf(stderr, "ECCODES DEBUG grib_set_long %s=%ld (as two octets)\n", p1_accessor->name, P1); ret = grib_encode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, P1, &off, 16); if (ret != 0) return ret; @@ -602,6 +608,11 @@ static int pack_string(grib_accessor* a, const char* val, size_t* len) return GRIB_NOT_FOUND; } off = p1_accessor->offset * 8; + /* Note: case for timeRangeIndicator of 10 + * We assume the key P2 is one octet and immediately follows P1. Hence 16 bits + */ + if (h->context->debug) + fprintf(stderr, "ECCODES DEBUG grib_set_long %s=%ld (as two octets)\n", p1_accessor->name, P1); ret = grib_encode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, P1, &off, 16); if (ret != 0) return ret; diff --git a/src/grib_accessor_class_gen.c b/src/grib_accessor_class_gen.c index e6d51763a..797cf5145 100644 --- a/src/grib_accessor_class_gen.c +++ b/src/grib_accessor_class_gen.c @@ -593,8 +593,9 @@ static int is_missing(grib_accessor* a) if (a->flags & GRIB_ACCESSOR_FLAG_TRANSIENT) { if (a->vvalue == NULL) { grib_context_log(a->context, GRIB_LOG_ERROR, "%s internal error (flags=0x%X)", a->name, a->flags); + Assert(!"grib_accessor_class_gen::is_missing(): a->vvalue == NULL"); + return 0; } - Assert(a->vvalue != NULL); return a->vvalue->missing; } Assert(a->length >= 0); diff --git a/src/grib_accessor_class_md5.c b/src/grib_accessor_class_md5.c index 6c646b563..bb6603820 100644 --- a/src/grib_accessor_class_md5.c +++ b/src/grib_accessor_class_md5.c @@ -146,7 +146,7 @@ static void init(grib_accessor* a, const long len, grib_arguments* arg) self->offset = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); self->length = grib_arguments_get_expression(grib_handle_of_accessor(a), arg, n++); - self->blacklist = 0; + self->blacklist = NULL; while ((b = (char*)grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++)) != NULL) { if (!self->blacklist) { self->blacklist = (grib_string_list*)grib_context_malloc_clear(context, sizeof(grib_string_list)); @@ -154,9 +154,12 @@ static void init(grib_accessor* a, const long len, grib_arguments* arg) current = self->blacklist; } else { - current->next = (grib_string_list*)grib_context_malloc_clear(context, sizeof(grib_string_list)); - current->next->value = grib_context_strdup(context, b); - current = current->next; + Assert(current); + if (current) { + current->next = (grib_string_list*)grib_context_malloc_clear(context, sizeof(grib_string_list)); + current->next->value = grib_context_strdup(context, b); + current = current->next; + } } } a->length = 0; diff --git a/src/grib_accessor_class_spd.c b/src/grib_accessor_class_spd.c index f27a0f5c9..d1ff5e89e 100644 --- a/src/grib_accessor_class_spd.c +++ b/src/grib_accessor_class_spd.c @@ -238,6 +238,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) if (*len != rlen) { ret = grib_set_long(grib_handle_of_accessor(a), self->numberOfElements, (*len) - 1); + if (ret) return ret; } ret = grib_get_long(grib_handle_of_accessor(a), self->numberOfBits, &numberOfBits); diff --git a/src/grib_box_class_reduced_gaussian.c b/src/grib_box_class_reduced_gaussian.c index 151d170a0..fd7c8cc4c 100644 --- a/src/grib_box_class_reduced_gaussian.c +++ b/src/grib_box_class_reduced_gaussian.c @@ -208,8 +208,10 @@ static grib_points* get_points(grib_box* box, double north, double west, double grib_context* c = box->context; points = grib_points_new(c, self->size); - if (!points) - grib_context_log(c, GRIB_LOG_FATAL, "unable to create grib_points\n"); + if (!points) { + grib_context_log(c, GRIB_LOG_ERROR, "unable to create grib_points\n"); + return NULL; + } index = 0; l = 0; diff --git a/src/grib_dumper_class_bufr_encode_python.c b/src/grib_dumper_class_bufr_encode_python.c index 57ddaa8b6..01ca57b54 100644 --- a/src/grib_dumper_class_bufr_encode_python.c +++ b/src/grib_dumper_class_bufr_encode_python.c @@ -174,8 +174,8 @@ static void dump_values(grib_dumper* d, grib_accessor* a) grib_dumper_bufr_encode_python* self = (grib_dumper_bufr_encode_python*)d; double value = 0; size_t size = 0, size2 = 0; - double* values = NULL; - int err = 0; + double* values = NULL; + int err = 0; int i, r, icount; int cols = 2; long count = 0; @@ -270,9 +270,8 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* grib_dumper_bufr_encode_python* self = (grib_dumper_bufr_encode_python*)d; double value = 0; size_t size = 0, size2 = 0; - double* values = NULL; - int err = 0; - int i, icount; + double* values = NULL; + int err = 0, i = 0, icount = 0; int cols = 2; long count = 0; char* sval; @@ -352,9 +351,8 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) grib_dumper_bufr_encode_python* self = (grib_dumper_bufr_encode_python*)d; long value = 0; size_t size = 0, size2 = 0; - long* values = NULL; - int err = 0; - int i, r, icount; + long* values = NULL; + int err = 0, i = 0, r = 0, icount = 0; int cols = 4; long count = 0; char* sval = NULL; @@ -483,10 +481,9 @@ static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* pr { grib_dumper_bufr_encode_python* self = (grib_dumper_bufr_encode_python*)d; long value = 0; - size_t size = 0; - long* values = NULL; - int err = 0; - int i, icount; + size_t size = 0, size2 = 0; + long* values = NULL; + int err = 0, i = 0, icount = 0; int cols = 4; long count = 0; grib_context* c = a->context; @@ -495,15 +492,16 @@ static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* pr return; grib_value_count(a, &count); - size = count; + size = size2 = count; if (size > 1) { values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); - err = grib_unpack_long(a, values, &size); + err = grib_unpack_long(a, values, &size2); } else { - err = grib_unpack_long(a, &value, &size); + err = grib_unpack_long(a, &value, &size2); } + Assert(size2 == size); self->empty = 0; diff --git a/src/grib_expression.c b/src/grib_expression.c index 60580d942..b2fd9fdab 100644 --- a/src/grib_expression.c +++ b/src/grib_expression.c @@ -67,7 +67,7 @@ const char* grib_expression_get_name(grib_expression* g) return c->get_name(g); c = c->super ? *(c->super) : NULL; } - printf("No expression_get_name() in %s\n", g->cclass->name); + if (g->cclass) printf("No expression_get_name() in %s\n", g->cclass->name); Assert(1 == 0); return 0; } diff --git a/src/grib_handle.c b/src/grib_handle.c index 84ea5a79e..201262021 100644 --- a/src/grib_handle.c +++ b/src/grib_handle.c @@ -1017,7 +1017,6 @@ grib_handle* bufr_new_from_file(grib_context* c, FILE* f, int* error) if (gts_header) memcpy(gl->gts_header, gts_header, gtslen); gl->gts_header_len = gtslen; grib_context_free(c, save_gts_header); - gtslen = 0; } else { gl->gts_header = NULL; diff --git a/src/grib_ieeefloat.c b/src/grib_ieeefloat.c index c27aa4830..5e8851895 100644 --- a/src/grib_ieeefloat.c +++ b/src/grib_ieeefloat.c @@ -130,7 +130,7 @@ unsigned long grib_ieee_to_long(double x) unsigned long s = 0; unsigned long mmax = 0xffffff; unsigned long mmin = 0x800000; - unsigned long m = mmax; + unsigned long m = 0; unsigned long e = 0; double rmmax = mmax + 0.5; diff --git a/src/grib_util.c b/src/grib_util.c index 59760bc0f..7bbf774c5 100644 --- a/src/grib_util.c +++ b/src/grib_util.c @@ -1425,10 +1425,10 @@ grib_handle* grib_util_set_spec2(grib_handle* h, int ret; SET_STRING_VALUE("packingType", "grid_simple_matrix"); ret = grib_get_long(h, "numberOfDirections", &numberOfDirections); - if (!ret) { - ret = grib_get_long(h, "numberOfDirections", &numberOfDirections); + if (ret == GRIB_SUCCESS) { + grib_get_long(h, "numberOfDirections", &numberOfDirections); SET_LONG_VALUE("NC1", numberOfDirections); - ret = grib_get_long(h, "numberOfFrequencies", &numberOfFrequencies); + grib_get_long(h, "numberOfFrequencies", &numberOfFrequencies); SET_LONG_VALUE("NC2", numberOfFrequencies); SET_LONG_VALUE("physicalFlag1", 1); SET_LONG_VALUE("physicalFlag2", 2); diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index dbbf752f4..9bae32d2e 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -68,6 +68,7 @@ list( APPEND tests_no_data_reqd grib_efas grib_sh_imag diag + grib_lambert_conformal ) # These tests do require data downloads list( APPEND tests_data_reqd diff --git a/tests/Makefile.am b/tests/Makefile.am index 6649d1eb2..d52abe2d7 100755 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -54,6 +54,7 @@ TESTS = definitions.sh \ read_any.sh \ grib_padding.sh \ grib_lamb_az_eq_area.sh \ + grib_lambert_conformal.sh \ grib_to_netcdf.sh \ grib_dump_debug.sh \ grib_jpeg.sh \ diff --git a/tests/bufr_extract_headers.sh b/tests/bufr_extract_headers.sh index 9de31dd8a..fed3d479f 100755 --- a/tests/bufr_extract_headers.sh +++ b/tests/bufr_extract_headers.sh @@ -204,4 +204,12 @@ for bf in ${bufr_files}; do done +echo "Test with invalid inputs..." +# --------------------------------- +set +e +$EXEC ${test_dir}/bufr_extract_headers centre ${data_dir} +status=$? +set -e +[ $status -ne 0 ] + rm -f $temp1 $temp2 diff --git a/tests/grib_lambert_conformal.sh b/tests/grib_lambert_conformal.sh new file mode 100755 index 000000000..41f34d85a --- /dev/null +++ b/tests/grib_lambert_conformal.sh @@ -0,0 +1,51 @@ +#!/bin/sh +# (C) Copyright 2005- 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. + +. ./include.sh + +# Define a common label for all the tmp files +label="grib_lambert_conformal_test" +tempFilter="temp.${label}.filt" +tempGrib="temp.${label}.grib" +tempOut="temp.${label}.out" + +input=$ECCODES_SAMPLES_PATH/GRIB2.tmpl + +# Create a filter +cat > $tempFilter <&2 + exit 1 +fi +# Now get the data from the newly created GRIB file +${tools_dir}/grib_get_data $tempGrib > $tempOut + +${tools_dir}/grib_ls -l 50,0 $tempGrib + +# Clean up +rm -f $tempFilter $tempGrib $tempOut diff --git a/tests/jpeg_perf.c b/tests/jpeg_perf.c index 5f800bec1..adad04820 100644 --- a/tests/jpeg_perf.c +++ b/tests/jpeg_perf.c @@ -74,7 +74,7 @@ int main(int argc, char* argv[]) double perc = 0; long bitsPerValue = 0; int iarg = 1; - char grid[20] = {0,}; + char grid[32] = {0,}; char shortName[20] = {0,}; long level; char levelType[20] = {0,}; diff --git a/tests/unit_tests.c b/tests/unit_tests.c index b2bca6944..18445914f 100644 --- a/tests/unit_tests.c +++ b/tests/unit_tests.c @@ -38,8 +38,16 @@ static void check_float_representation(const double val, const double expected, compare_doubles(out, expected, tolerance); } +static void test_get_git_sha1() +{ + const char* sha1 = grib_get_git_sha1(); + printf("Testing: test_get_git_sha1...\n"); + assert(sha1 != NULL); +} + static void test_grib_nearest_smaller_ibmfloat() { + printf("Testing: test_grib_nearest_smaller_ibmfloat...\n"); check_float_representation(-1.0, -1.0, IBM_FLOAT); check_float_representation(0.0, 0.0, IBM_FLOAT); check_float_representation(1.0, 1.0, IBM_FLOAT); @@ -50,6 +58,7 @@ static void test_grib_nearest_smaller_ibmfloat() static void test_grib_nearest_smaller_ieeefloat() { + printf("Testing: test_grib_nearest_smaller_ieeefloat...\n"); check_float_representation(-1.0, -1.0, IEEE_FLOAT); check_float_representation(0.0, 0.0, IEEE_FLOAT); check_float_representation(1.0, 1.0, IEEE_FLOAT); @@ -63,9 +72,8 @@ static void test_gaussian_latitudes(int order) int ret = 0; const int num = 2 * order; double lat1 = 0, lat2 = 0; - double* lats = (double*)malloc(sizeof(double) * num); - + printf("Testing: test_gaussian_latitudes order=%d...\n", order); ret = grib_get_gaussian_latitudes(order, lats); Assert(ret == GRIB_SUCCESS); @@ -87,6 +95,7 @@ static void test_gaussian_latitude_640() double* lats = (double*)malloc(sizeof(double) * num); ret = grib_get_gaussian_latitudes(order, lats); Assert(ret == GRIB_SUCCESS); + printf("Testing: test_gaussian_latitude_640...\n"); compare_doubles(lats[0], 89.892396, tolerance); compare_doubles(lats[1], 89.753005, tolerance); @@ -1377,6 +1386,8 @@ static void test_string_splitting() int i = 0; char input[80] = "Born|To|Be|Wild"; char** list = 0; + printf("Testing: test_string_splitting...\n"); + list = string_split(input, "|"); assert(list); for (i = 0; list[i] != NULL; ++i) {} /* count how many tokens */ @@ -1432,6 +1443,8 @@ static void test_assertion_catching() int i = 0; assert(assertion_caught == 0); codes_set_codes_assertion_failed_proc(&my_assertion_proc); + + printf("Testing: test_assertion_catching...\n"); /* Do something illegal */ list = string_split(empty, " "); @@ -1453,6 +1466,8 @@ static void test_concept_condition_strings() char result[1024] = {0,}; grib_handle* h = grib_handle_new_from_samples(0, "GRIB2"); + printf("Testing: test_concept_condition_strings...\n"); + err = get_concept_condition_string(h, "typeOfLevel", NULL, result); assert(!err); assert(strcmp(result, "typeOfFirstFixedSurface=1,typeOfSecondFixedSurface=255") == 0); @@ -1476,6 +1491,7 @@ static void test_concept_condition_strings() int main(int argc, char** argv) { /*printf("Doing unit tests. ecCodes version = %ld\n", grib_get_api_version());*/ + test_get_git_sha1(); test_concept_condition_strings(); diff --git a/tigge/tigge_accumulations.c b/tigge/tigge_accumulations.c index a8d4180f9..f5d12151d 100755 --- a/tigge/tigge_accumulations.c +++ b/tigge/tigge_accumulations.c @@ -265,6 +265,8 @@ int main(int argc, char *argv[]) if(result) grib_handle_delete(result); + free(values); + if(fclose(out)) { perror(argv[argc-1]); diff --git a/tigge/tigge_check.c b/tigge/tigge_check.c index 9d718c1eb..fc9c232d7 100755 --- a/tigge/tigge_check.c +++ b/tigge/tigge_check.c @@ -247,7 +247,10 @@ static void gaussian_grid(grib_handle* h) last_n = n; } - values[0] = rint(values[0]*1e6)/1e6; + assert(values); + if (values) { + values[0] = rint(values[0]*1e6)/1e6; + } if ( !DBL_EQUAL(north, values[0], tolerance) || !DBL_EQUAL(south, -values[0], tolerance) ) printf("N=%ld north=%f south=%f v(=gauss_lat[0])=%f north-v=%0.30f south-v=%0.30f\n", diff --git a/tools/grib_ls.c b/tools/grib_ls.c index be95e4c4f..a035feb7e 100644 --- a/tools/grib_ls.c +++ b/tools/grib_ls.c @@ -100,7 +100,7 @@ int grib_tool_init(grib_runtime_options* options) if (options->latlon) { lat = strtod(options->latlon, &theEnd); if (*theEnd != ',') { - fprintf(stderr, "Error: wrong latitude value\n"); + fprintf(stderr, "Error %s: wrong latitude value. Please use 'latitude,longitude'\n",grib_tool_name); exit(1); } lon = strtod(++theEnd, &end1); @@ -124,7 +124,8 @@ int grib_tool_init(grib_runtime_options* options) exit(1); } } - if (*p == ',') { + Assert(p); + if (p && *p == ',') { p++; options->latlon_mask = strdup(p); } diff --git a/tools/grib_to_netcdf.c b/tools/grib_to_netcdf.c index 67e8de3e4..379fc24f1 100644 --- a/tools/grib_to_netcdf.c +++ b/tools/grib_to_netcdf.c @@ -2549,13 +2549,14 @@ static void scale_bitmap(double* vals, long n, void* data, dataset_t* subset) int i = 0; nc_type nctype = subset->att.nctype; - /* - if(!subset->bitmap) - { - grib_context_log(ctx,GRIB_LOG_DEBUG,"No scale of bitmap required"); - return; - } - */ + /* if(!subset->bitmap) { + grib_context_log(ctx,GRIB_LOG_DEBUG,"No scale of bitmap required"); + return; + } */ + if (n > 0 && !vals) { + Assert(!"scale_bitmap: n > 0 but vals == NULL"); + return; + } switch (nctype) { case NC_BYTE: { From 5ac99abe5e8a64cda9e2ebbce1599f466c863192 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 2 Mar 2020 17:36:46 +0000 Subject: [PATCH 71/82] Latest updates from develop (23) --- definitions/grib1/section.1.def | 2 +- definitions/grib2/cfVarName.def | 18 ++--- definitions/grib2/local.98.def | 2 +- definitions/grib2/name.def | 16 ++-- definitions/grib2/paramId.def | 8 +- definitions/grib2/shortName.def | 18 ++--- definitions/grib2/units.def | 8 +- src/bufr_util.c | 3 + src/grib_accessor_class_concept.c | 5 +- ..._accessor_class_data_apply_gdsnotpresent.c | 27 ++++--- src/grib_accessor_class_g1fcperiod.c | 2 +- src/grib_api_prototypes.h | 1 - src/grib_dumper_class_bufr_encode_C.c | 9 ++- src/grib_dumper_class_bufr_simple.c | 9 ++- src/grib_dumper_class_default.c | 13 ++-- src/grib_expression.c | 6 +- src/grib_hash_keys.c | 74 ++++++++++--------- src/grib_itrie_keys.c | 74 ++++++++++--------- tests/bufr_ecc-197.sh | 41 +++++++--- tests/grib_util_set_spec.c | 2 + tools/codes_info.c | 11 ++- tools/grib_get.c | 7 +- 22 files changed, 201 insertions(+), 155 deletions(-) diff --git a/definitions/grib1/section.1.def b/definitions/grib1/section.1.def index 5e116c985..9b042aae9 100644 --- a/definitions/grib1/section.1.def +++ b/definitions/grib1/section.1.def @@ -252,7 +252,7 @@ if(((section1Length > 40) or new() or setLocalDefinition> 0) and deleteLocalDefi { pad reservedNeedNotBePresent(12); codetable[1] localDefinitionNumber 'grib1/localDefinitionNumber.98.table' = 1 : dump; - template localDefinition "grib1/local.98.[localDefinitionNumber:l].def"; + template_nofail localDefinition "grib1/local.98.[localDefinitionNumber:l].def"; if (changed(localDefinitionNumber)) { if(!new() && localDefinitionNumber!=4 ) { section_padding localExtensionPadding : read_only; diff --git a/definitions/grib2/cfVarName.def b/definitions/grib2/cfVarName.def index 2ae3d0eaa..d49fe291b 100644 --- a/definitions/grib2/cfVarName.def +++ b/definitions/grib2/cfVarName.def @@ -1421,14 +1421,14 @@ parameterCategory = 0 ; parameterNumber = 1 ; } -#Malaria cases -'mal_cases' = { +#Fraction of Malaria cases +'mal_cases_frac' = { discipline = 20 ; parameterCategory = 1 ; parameterNumber = 0 ; } -#Malaria circumsporozoite protein rate -'mal_prot_rate' = { +#Malaria circumsporozoite protein ratio +'mal_prot_ratio' = { discipline = 20 ; parameterCategory = 1 ; parameterNumber = 1 ; @@ -1445,20 +1445,20 @@ parameterCategory = 1 ; parameterNumber = 3 ; } -#Malaria immunity -'mal_immun' = { +#Malaria immunity ratio +'mal_immun_ratio' = { discipline = 20 ; parameterCategory = 1 ; parameterNumber = 4 ; } #Falciparum parasite ratio -'mal_para_rate' = { +'mal_infect_ratio' = { discipline = 20 ; parameterCategory = 1 ; parameterNumber = 5 ; } #Detectable falciparum parasite ratio (after day 10) -'mal_para_ratio' = { +'mal_infect_d10_ratio' = { discipline = 20 ; parameterCategory = 1 ; parameterNumber = 6 ; @@ -1469,7 +1469,7 @@ parameterCategory = 1 ; parameterNumber = 7 ; } -#Anopheles vector number +#Anopheles vector density 'mal_vect_dens' = { discipline = 20 ; parameterCategory = 1 ; diff --git a/definitions/grib2/local.98.def b/definitions/grib2/local.98.def index 1de5ff9b8..2662e3272 100644 --- a/definitions/grib2/local.98.def +++ b/definitions/grib2/local.98.def @@ -19,7 +19,7 @@ meta eps g2_eps(productDefinitionTemplateNumber, stepType, derivedForecast); -template localSection "grib2/local.98.[grib2LocalSectionNumber:l].def"; +template_nofail localSection "grib2/local.98.[grib2LocalSectionNumber:l].def"; position offsetAfterLocalSection; transient addExtraLocalSection=0; transient deleteExtraLocalSection=0; diff --git a/definitions/grib2/name.def b/definitions/grib2/name.def index 6b861ff47..ee12edea1 100644 --- a/definitions/grib2/name.def +++ b/definitions/grib2/name.def @@ -1421,14 +1421,14 @@ parameterCategory = 0 ; parameterNumber = 1 ; } -#Malaria cases -'Malaria cases' = { +#Fraction of Malaria cases +'Fraction of Malaria cases' = { discipline = 20 ; parameterCategory = 1 ; parameterNumber = 0 ; } -#Malaria circumsporozoite protein rate -'Malaria circumsporozoite protein rate' = { +#Malaria circumsporozoite protein ratio +'Malaria circumsporozoite protein ratio' = { discipline = 20 ; parameterCategory = 1 ; parameterNumber = 1 ; @@ -1445,8 +1445,8 @@ parameterCategory = 1 ; parameterNumber = 3 ; } -#Malaria immunity -'Malaria immunity' = { +#Malaria immunity ratio +'Malaria immunity ratio' = { discipline = 20 ; parameterCategory = 1 ; parameterNumber = 4 ; @@ -1469,8 +1469,8 @@ parameterCategory = 1 ; parameterNumber = 7 ; } -#Anopheles vector number -'Anopheles vector number' = { +#Anopheles vector density +'Anopheles vector density' = { discipline = 20 ; parameterCategory = 1 ; parameterNumber = 8 ; diff --git a/definitions/grib2/paramId.def b/definitions/grib2/paramId.def index 3a06e318b..54d02e744 100644 --- a/definitions/grib2/paramId.def +++ b/definitions/grib2/paramId.def @@ -1421,13 +1421,13 @@ parameterCategory = 0 ; parameterNumber = 1 ; } -#Malaria cases +#Fraction of Malaria cases '261003' = { discipline = 20 ; parameterCategory = 1 ; parameterNumber = 0 ; } -#Malaria circumsporozoite protein rate +#Malaria circumsporozoite protein ratio '261004' = { discipline = 20 ; parameterCategory = 1 ; @@ -1445,7 +1445,7 @@ parameterCategory = 1 ; parameterNumber = 3 ; } -#Malaria immunity +#Malaria immunity ratio '261007' = { discipline = 20 ; parameterCategory = 1 ; @@ -1469,7 +1469,7 @@ parameterCategory = 1 ; parameterNumber = 7 ; } -#Anopheles vector number +#Anopheles vector density '261011' = { discipline = 20 ; parameterCategory = 1 ; diff --git a/definitions/grib2/shortName.def b/definitions/grib2/shortName.def index 200a6efa9..2ea6258c0 100644 --- a/definitions/grib2/shortName.def +++ b/definitions/grib2/shortName.def @@ -1421,14 +1421,14 @@ parameterCategory = 0 ; parameterNumber = 1 ; } -#Malaria cases -'mal_cases' = { +#Fraction of Malaria cases +'mal_cases_frac' = { discipline = 20 ; parameterCategory = 1 ; parameterNumber = 0 ; } -#Malaria circumsporozoite protein rate -'mal_prot_rate' = { +#Malaria circumsporozoite protein ratio +'mal_prot_ratio' = { discipline = 20 ; parameterCategory = 1 ; parameterNumber = 1 ; @@ -1445,20 +1445,20 @@ parameterCategory = 1 ; parameterNumber = 3 ; } -#Malaria immunity -'mal_immun' = { +#Malaria immunity ratio +'mal_immun_ratio' = { discipline = 20 ; parameterCategory = 1 ; parameterNumber = 4 ; } #Falciparum parasite ratio -'mal_para_rate' = { +'mal_infect_ratio' = { discipline = 20 ; parameterCategory = 1 ; parameterNumber = 5 ; } #Detectable falciparum parasite ratio (after day 10) -'mal_para_ratio' = { +'mal_infect_d10_ratio' = { discipline = 20 ; parameterCategory = 1 ; parameterNumber = 6 ; @@ -1469,7 +1469,7 @@ parameterCategory = 1 ; parameterNumber = 7 ; } -#Anopheles vector number +#Anopheles vector density 'mal_vect_dens' = { discipline = 20 ; parameterCategory = 1 ; diff --git a/definitions/grib2/units.def b/definitions/grib2/units.def index 65bb74186..0b3df9b97 100644 --- a/definitions/grib2/units.def +++ b/definitions/grib2/units.def @@ -1421,13 +1421,13 @@ parameterCategory = 0 ; parameterNumber = 1 ; } -#Malaria cases +#Fraction of Malaria cases 'Fraction' = { discipline = 20 ; parameterCategory = 1 ; parameterNumber = 0 ; } -#Malaria circumsporozoite protein rate +#Malaria circumsporozoite protein ratio 'Fraction' = { discipline = 20 ; parameterCategory = 1 ; @@ -1445,7 +1445,7 @@ parameterCategory = 1 ; parameterNumber = 3 ; } -#Malaria immunity +#Malaria immunity ratio 'Fraction' = { discipline = 20 ; parameterCategory = 1 ; @@ -1469,7 +1469,7 @@ parameterCategory = 1 ; parameterNumber = 7 ; } -#Anopheles vector number +#Anopheles vector density 'Number m**-2' = { discipline = 20 ; parameterCategory = 1 ; diff --git a/src/bufr_util.c b/src/bufr_util.c index 21842a3fe..3b0c29eaa 100644 --- a/src/bufr_util.c +++ b/src/bufr_util.c @@ -32,6 +32,9 @@ int compute_bufr_key_rank(grib_handle* h, grib_string_list* keys, const char* ke next = prev->next; } } + DebugAssert(next); + if (!next) return 0; + if (!next->value) { next->value = strdup(key); next->count = 0; diff --git a/src/grib_accessor_class_concept.c b/src/grib_accessor_class_concept.c index 00c6e0b20..afbd99318 100644 --- a/src/grib_accessor_class_concept.c +++ b/src/grib_accessor_class_concept.c @@ -648,6 +648,7 @@ static const char* get_ECMWF_local_parameter(grib_accessor* a, grib_handle* h) } return NULL; } + static int unpack_string(grib_accessor* a, char* val, size_t* len) { size_t slen; @@ -667,11 +668,11 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) slen = strlen(p) + 1; if (*len < slen) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Variable unpack_string Wrong size for %s it is %d bytes big (len=%d)", a->name, slen, *len); + grib_context_log(a->context, GRIB_LOG_ERROR, "Variable unpack_string. Wrong size for %s, it is %d bytes big (len=%d)", a->name, slen, *len); *len = slen; return GRIB_BUFFER_TOO_SMALL; } - strcpy(val, p); + strncpy(val, p, slen); *len = slen; #if 0 if (a->context->debug==1) { diff --git a/src/grib_accessor_class_data_apply_gdsnotpresent.c b/src/grib_accessor_class_data_apply_gdsnotpresent.c index 1d8e5284c..84e1e572c 100644 --- a/src/grib_accessor_class_data_apply_gdsnotpresent.c +++ b/src/grib_accessor_class_data_apply_gdsnotpresent.c @@ -250,20 +250,23 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) a->name, number_of_points); if (latitude_of_first_point == 0) { - if (number_of_values && !coded_vals) - return GRIB_INTERNAL_ERROR; - for (i = 0; i < number_of_values; i++) - val[i] = coded_vals[i]; - for (i = number_of_values; i < number_of_points; i++) - val[i] = coded_vals[number_of_values - 1]; + for (i = 0; i < number_of_values; i++) { + DebugAssert(coded_vals); + if (coded_vals) val[i] = coded_vals[i]; + } + for (i = number_of_values; i < number_of_points; i++) { + DebugAssert(coded_vals); + if (coded_vals) val[i] = coded_vals[number_of_values - 1]; + } } else { - if ((ni-1) && !coded_vals) - return GRIB_INTERNAL_ERROR; - for (i = 0; i < ni - 1; i++) - val[i] = coded_vals[0]; - for (i = ni - 1; i < number_of_points; i++) - val[i] = coded_vals[i - ni + 1]; + for (i = 0; i < ni - 1; i++) { + DebugAssert(coded_vals); + if (coded_vals) val[i] = coded_vals[0]; + } + for (i = ni - 1; i < number_of_points; i++) { + if (coded_vals && (i - ni + 1) < number_of_values) val[i] = coded_vals[i - ni + 1]; + } } *len = number_of_points; diff --git a/src/grib_accessor_class_g1fcperiod.c b/src/grib_accessor_class_g1fcperiod.c index 984223f7b..e8664d64a 100644 --- a/src/grib_accessor_class_g1fcperiod.c +++ b/src/grib_accessor_class_g1fcperiod.c @@ -159,7 +159,7 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) } *len = l; - strcpy(val, tmp); + strncpy(val, tmp, l); return GRIB_SUCCESS; } diff --git a/src/grib_api_prototypes.h b/src/grib_api_prototypes.h index 7eefcc17a..31c362d8c 100644 --- a/src/grib_api_prototypes.h +++ b/src/grib_api_prototypes.h @@ -1122,7 +1122,6 @@ const struct grib_keys_hash* grib_keys_hash_get(const char* str, unsigned int le grib_itrie* grib_hash_keys_new(grib_context* c, int* count); void grib_hash_keys_delete(grib_itrie* t); int grib_hash_keys_get_id(grib_itrie* t, const char* key); -int grib_hash_keys_insert(grib_itrie* t, const char* key); int grib_hash_keys_get_size(grib_itrie* t); /* grib_io.c */ diff --git a/src/grib_dumper_class_bufr_encode_C.c b/src/grib_dumper_class_bufr_encode_C.c index 23fb8bf2b..5576f140e 100644 --- a/src/grib_dumper_class_bufr_encode_C.c +++ b/src/grib_dumper_class_bufr_encode_C.c @@ -481,7 +481,7 @@ static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* pr { grib_dumper_bufr_encode_C* self = (grib_dumper_bufr_encode_C*)d; long value = 0; - size_t size = 0; + size_t size = 0, size2 = 0; long* values = NULL; int err = 0; int i, icount; @@ -493,15 +493,16 @@ static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* pr return; grib_value_count(a, &count); - size = count; + size = size2 = count; if (size > 1) { values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); - err = grib_unpack_long(a, values, &size); + err = grib_unpack_long(a, values, &size2); } else { - err = grib_unpack_long(a, &value, &size); + err = grib_unpack_long(a, &value, &size2); } + Assert(size2 == size); self->empty = 0; diff --git a/src/grib_dumper_class_bufr_simple.c b/src/grib_dumper_class_bufr_simple.c index e8e54b5d0..433001802 100644 --- a/src/grib_dumper_class_bufr_simple.c +++ b/src/grib_dumper_class_bufr_simple.c @@ -443,7 +443,7 @@ static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* pr { grib_dumper_bufr_simple* self = (grib_dumper_bufr_simple*)d; long value = 0; - size_t size = 0; + size_t size = 0, size2 = 0; long* values = NULL; int err = 0; int i, icount; @@ -455,15 +455,16 @@ static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* pr return; grib_value_count(a, &count); - size = count; + size = size2 = count; if (size > 1) { values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); - err = grib_unpack_long(a, values, &size); + err = grib_unpack_long(a, values, &size2); } else { - err = grib_unpack_long(a, &value, &size); + err = grib_unpack_long(a, &value, &size2); } + Assert(size2 == size); self->empty = 0; diff --git a/src/grib_dumper_class_default.c b/src/grib_dumper_class_default.c index af84283f3..849e27c24 100644 --- a/src/grib_dumper_class_default.c +++ b/src/grib_dumper_class_default.c @@ -139,18 +139,18 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) { grib_dumper_default* self = (grib_dumper_default*)d; long value = 0; - size_t size = 1; + size_t size = 1, size2 = 0; long* values = NULL; int err = 0; int i; long count = 0; - grib_value_count(a, &count); - size = count; - if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) return; + grib_value_count(a, &count); + size = size2 = count; + print_offset(self->dumper.out, d, a); if ((d->option_flags & GRIB_DUMP_FLAG_TYPE) != 0) { @@ -160,11 +160,12 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) if (size > 1) { values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * size); - err = grib_unpack_long(a, values, &size); + err = grib_unpack_long(a, values, &size2); } else { - err = grib_unpack_long(a, &value, &size); + err = grib_unpack_long(a, &value, &size2); } + Assert(size2 == size); aliases(d, a); if (comment) { diff --git a/src/grib_expression.c b/src/grib_expression.c index b2fd9fdab..43dcde427 100644 --- a/src/grib_expression.c +++ b/src/grib_expression.c @@ -18,7 +18,8 @@ int grib_expression_native_type(grib_handle* h, grib_expression* g) return c->native_type(g, h); c = c->super ? *(c->super) : NULL; } - grib_context_log(h->context, GRIB_LOG_ERROR, "No native_type() in %s\n", g->cclass->name); + if (g->cclass) + grib_context_log(h->context, GRIB_LOG_ERROR, "No native_type() in %s\n", g->cclass->name); Assert(1 == 0); return 0; } @@ -53,7 +54,8 @@ const char* grib_expression_evaluate_string(grib_handle* h, grib_expression* g, return c->evaluate_string(g, h, buf, size, err); c = c->super ? *(c->super) : NULL; } - grib_context_log(h->context, GRIB_LOG_ERROR, "No evaluate_string() in %s\n", g->cclass->name); + if (g->cclass) + grib_context_log(h->context, GRIB_LOG_ERROR, "No evaluate_string() in %s\n", g->cclass->name); *err = GRIB_INVALID_TYPE; return 0; diff --git a/src/grib_hash_keys.c b/src/grib_hash_keys.c index bbd1f617b..66397cdb1 100644 --- a/src/grib_hash_keys.c +++ b/src/grib_hash_keys.c @@ -9653,47 +9653,17 @@ void grib_hash_keys_delete(grib_itrie* t) GRIB_MUTEX_UNLOCK(&mutex); } -int grib_hash_keys_get_id(grib_itrie* t, const char* key) -{ - const struct grib_keys_hash* hash = grib_keys_hash_get(key, strlen(key)); - - if (hash) { - /* printf("%s found %s (%d)\n",key,hash->name,hash->id); */ - return hash->id; - } - - /* printf("+++ \"%s\"\n",key); */ - { - const char* k = key; - grib_itrie* last = t; - - GRIB_MUTEX_INIT_ONCE(&once, &init); - GRIB_MUTEX_LOCK(&mutex); - - while (*k && t) - t = t->next[mapping[(int)*k++]]; - - if (t != NULL && t->id != -1) { - GRIB_MUTEX_UNLOCK(&mutex); - return t->id + TOTAL_KEYWORDS + 1; - } - else { - int ret = grib_hash_keys_insert(last, key); - GRIB_MUTEX_UNLOCK(&mutex); - return ret + TOTAL_KEYWORDS + 1; - } - } -} - -int grib_hash_keys_insert(grib_itrie* t, const char* key) +static int grib_hash_keys_insert(grib_itrie* t, const char* key) { const char* k = key; grib_itrie* last = t; int* count; - GRIB_MUTEX_INIT_ONCE(&once, &init) + GRIB_MUTEX_INIT_ONCE(&once, &init); + GRIB_MUTEX_LOCK(&mutex); - GRIB_MUTEX_LOCK(&mutex) + Assert(t); + if (!t) return -1; count = t->count; @@ -9722,13 +9692,45 @@ int grib_hash_keys_insert(grib_itrie* t, const char* key) Assert(*(t->count) + TOTAL_KEYWORDS < ACCESSORS_ARRAY_SIZE); } - GRIB_MUTEX_UNLOCK(&mutex) + GRIB_MUTEX_UNLOCK(&mutex); /*printf("grib_hash_keys_get_id: %s -> %d\n",key,t->id);*/ return t->id; } +int grib_hash_keys_get_id(grib_itrie* t, const char* key) +{ + const struct grib_keys_hash* hash = grib_keys_hash_get(key, strlen(key)); + + if (hash) { + /* printf("%s found %s (%d)\n",key,hash->name,hash->id); */ + return hash->id; + } + + /* printf("+++ \"%s\"\n",key); */ + { + const char* k = key; + grib_itrie* last = t; + + GRIB_MUTEX_INIT_ONCE(&once, &init); + GRIB_MUTEX_LOCK(&mutex); + + while (*k && t) + t = t->next[mapping[(int)*k++]]; + + if (t != NULL && t->id != -1) { + GRIB_MUTEX_UNLOCK(&mutex); + return t->id + TOTAL_KEYWORDS + 1; + } + else { + int ret = grib_hash_keys_insert(last, key); + GRIB_MUTEX_UNLOCK(&mutex); + return ret + TOTAL_KEYWORDS + 1; + } + } +} + int grib_hash_keys_get_size(grib_itrie* t) { return *(t->count); diff --git a/src/grib_itrie_keys.c b/src/grib_itrie_keys.c index 5b34eaa67..64995dfa4 100644 --- a/src/grib_itrie_keys.c +++ b/src/grib_itrie_keys.c @@ -336,47 +336,17 @@ void grib_hash_keys_delete(grib_itrie* t) GRIB_MUTEX_UNLOCK(&mutex); } -int grib_hash_keys_get_id(grib_itrie* t, const char* key) -{ - const struct grib_keys_hash* hash = grib_keys_hash_get(key, strlen(key)); - - if (hash) { - /* printf("%s found %s (%d)\n",key,hash->name,hash->id); */ - return hash->id; - } - - /* printf("+++ \"%s\"\n",key); */ - { - const char* k = key; - grib_itrie* last = t; - - GRIB_MUTEX_INIT_ONCE(&once, &init); - GRIB_MUTEX_LOCK(&mutex); - - while (*k && t) - t = t->next[mapping[(int)*k++]]; - - if (t != NULL && t->id != -1) { - GRIB_MUTEX_UNLOCK(&mutex); - return t->id + TOTAL_KEYWORDS + 1; - } - else { - int ret = grib_hash_keys_insert(last, key); - GRIB_MUTEX_UNLOCK(&mutex); - return ret + TOTAL_KEYWORDS + 1; - } - } -} - -int grib_hash_keys_insert(grib_itrie* t, const char* key) +static int grib_hash_keys_insert(grib_itrie* t, const char* key) { const char* k = key; grib_itrie* last = t; int* count; - GRIB_MUTEX_INIT_ONCE(&once, &init) + GRIB_MUTEX_INIT_ONCE(&once, &init); + GRIB_MUTEX_LOCK(&mutex); - GRIB_MUTEX_LOCK(&mutex) + Assert(t); + if (!t) return -1; count = t->count; @@ -405,13 +375,45 @@ int grib_hash_keys_insert(grib_itrie* t, const char* key) Assert(*(t->count) + TOTAL_KEYWORDS < ACCESSORS_ARRAY_SIZE); } - GRIB_MUTEX_UNLOCK(&mutex) + GRIB_MUTEX_UNLOCK(&mutex); /*printf("grib_hash_keys_get_id: %s -> %d\n",key,t->id);*/ return t->id; } +int grib_hash_keys_get_id(grib_itrie* t, const char* key) +{ + const struct grib_keys_hash* hash = grib_keys_hash_get(key, strlen(key)); + + if (hash) { + /* printf("%s found %s (%d)\n",key,hash->name,hash->id); */ + return hash->id; + } + + /* printf("+++ \"%s\"\n",key); */ + { + const char* k = key; + grib_itrie* last = t; + + GRIB_MUTEX_INIT_ONCE(&once, &init); + GRIB_MUTEX_LOCK(&mutex); + + while (*k && t) + t = t->next[mapping[(int)*k++]]; + + if (t != NULL && t->id != -1) { + GRIB_MUTEX_UNLOCK(&mutex); + return t->id + TOTAL_KEYWORDS + 1; + } + else { + int ret = grib_hash_keys_insert(last, key); + GRIB_MUTEX_UNLOCK(&mutex); + return ret + TOTAL_KEYWORDS + 1; + } + } +} + int grib_hash_keys_get_size(grib_itrie* t) { return *(t->count); diff --git a/tests/bufr_ecc-197.sh b/tests/bufr_ecc-197.sh index ff6df8b62..2da2898bf 100755 --- a/tests/bufr_ecc-197.sh +++ b/tests/bufr_ecc-197.sh @@ -20,6 +20,18 @@ label="bufr_ecc-197-test" input=${data_dir}/bufr/vos308014_v3_26.bufr TEMP=${label}.temp LOG=${label}.log +set -u +decode_bufr() +{ + infile=$1 + ${tools_dir}/codes_info + ${tools_dir}/bufr_dump $infile > $TEMP + # Ensure output JSON has all the expected contents + # After calling 'wc' and 'set', $1 will be the line count + set `wc -l $TEMP` + [ $1 -gt 35700 ] + grep -q encryptedShipOrMobileLandStationIdentifier $TEMP +} # Get expanded descriptors @@ -36,22 +48,31 @@ TEMP_DIR=${label}.temp-dir.$$ rm -rf $TEMP_DIR mkdir -p $TEMP_DIR/definitions/bufr/tables/0/wmo/26 -# Copy the definition files needed to decode BUFR file +# Copy the definition files needed to decode our BUFR file def_files="${proj_dir}/tests/ECC-197/*" for df in ${def_files}; do cp -f $df $TEMP_DIR/definitions/bufr/tables/0/wmo/26 done -# Point ecCodes to look in this dir as well as standard one +# Point to dir containing the tables MY_DEFS=`pwd`/$TEMP_DIR/definitions -export ECCODES_DEFINITION_PATH=$MY_DEFS:$ECCODES_DEFINITION_PATH - -# Now decode -${tools_dir}/bufr_dump $input > $TEMP -# Ensure output JSON has all the expected contents -# After calling 'wc' and 'set', $1 will be the line count -set `wc -l $TEMP` -[ $1 -gt 35700 ] +export ECCODES_EXTRA_DEFINITION_PATH=$MY_DEFS +decode_bufr $input +unset ECCODES_EXTRA_DEFINITION_PATH + +if [ $HAVE_MEMFS -eq 1 ]; then + unset ECCODES_DEFINITION_PATH + std_defs=`${tools_dir}/codes_info -d` + export ECCODES_DEFINITION_PATH=$MY_DEFS:$std_defs + decode_bufr $input + unset ECCODES_DEFINITION_PATH + export ECCODES_EXTRA_DEFINITION_PATH=$MY_DEFS + decode_bufr $input +else + # Decode by extending the ECCODES_DEFINITION_PATH + export ECCODES_DEFINITION_PATH=$MY_DEFS:$ECCODES_DEFINITION_PATH + decode_bufr $input +fi rm -rf $TEMP_DIR rm -f $TEMP $LOG diff --git a/tests/grib_util_set_spec.c b/tests/grib_util_set_spec.c index 9bf1d9b1a..fdcccb01a 100644 --- a/tests/grib_util_set_spec.c +++ b/tests/grib_util_set_spec.c @@ -116,12 +116,14 @@ static void test_reduced_gg(int remove_local_def, int edition, const char* packi h2 = grib_util_set_spec(handle, &spec, &packing_spec, set_spec_flags, values, outlen, &err); assert(err == GRIB_INTERNAL_ERROR); assert(!h2); + if (h2) exit(1); #ifdef INFINITY packing_spec.accuracy = GRIB_UTIL_ACCURACY_USE_PROVIDED_BITS_PER_VALUES; values[0] = INFINITY; h2 = grib_util_set_spec(handle, &spec, &packing_spec, set_spec_flags, values, outlen, &err); assert(err == GRIB_ENCODING_ERROR); assert(!h2); + if (h2) exit(1); #endif } diff --git a/tools/codes_info.c b/tools/codes_info.c index b3d2ab0f9..4cfad50fc 100644 --- a/tools/codes_info.c +++ b/tools/codes_info.c @@ -97,7 +97,11 @@ int main(int argc, char* argv[]) } else { printf("Default definition files path is used: %s\n", context->grib_definition_files_path); - printf("Definition files path can be changed by setting ECCODES_DEFINITION_PATH environment variable\n"); + printf("Definition files path can be changed by setting the ECCODES_DEFINITION_PATH environment variable.\n"); + } + + if((path = getenv("ECCODES_EXTRA_DEFINITION_PATH")) != NULL) { + printf("Environment variable ECCODES_EXTRA_DEFINITION_PATH=%s\n", path); } printf("\n"); @@ -114,7 +118,10 @@ int main(int argc, char* argv[]) } else { printf("Default SAMPLES path is used: %s\n", context->grib_samples_path); - printf("SAMPLES path can be changed by setting ECCODES_SAMPLES_PATH environment variable\n"); + printf("SAMPLES path can be changed by setting the ECCODES_SAMPLES_PATH environment variable.\n"); + } + if ((path = getenv("ECCODES_EXTRA_SAMPLES_PATH")) != NULL) { + printf("Environment variable ECCODES_EXTRA_SAMPLES_PATH=%s\n", path); } printf("\n"); return 0; diff --git a/tools/grib_get.c b/tools/grib_get.c index 7444d48ea..c82240c37 100644 --- a/tools/grib_get.c +++ b/tools/grib_get.c @@ -75,7 +75,7 @@ int grib_tool_init(grib_runtime_options* options) if (options->latlon) { lat = strtod(options->latlon, &theEnd); if (*theEnd != ',') { - printf("ERROR: wrong latitude value\n"); + fprintf(stderr, "Error %s: wrong latitude value. Please use 'latitude,longitude'\n",grib_tool_name); exit(1); } lon = strtod(++theEnd, &end1); @@ -95,11 +95,12 @@ int grib_tool_init(grib_runtime_options* options) options->latlon_mode = 1; } else { - printf("ERROR %s: wrong mode given in option -l\n", grib_tool_name); + fprintf(stderr, "Error %s: wrong mode given in option -l\n", grib_tool_name); exit(1); } } - if (*p == ',') { + Assert(p); + if (p && *p == ',') { p++; options->latlon_mask = strdup(p); } From 115c6555a20920cde3d6d03a76b68887e0ffd0e5 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 3 Mar 2020 17:33:19 +0000 Subject: [PATCH 72/82] Latest updates from develop (24) --- src/grib_util.c | 1 - tests/badgrib.sh | 9 ++++++++- tests/grib_copy.sh | 28 ++++++++++++++++++++++++++++ tests/grib_ls_json.sh | 4 ++-- tests/tests.ecmwf/grib1to2.c | 6 +++--- tools/grib_tools.c | 8 +++++++- 6 files changed, 48 insertions(+), 8 deletions(-) diff --git a/src/grib_util.c b/src/grib_util.c index 7bbf774c5..744e826e6 100644 --- a/src/grib_util.c +++ b/src/grib_util.c @@ -985,7 +985,6 @@ grib_handle* grib_util_set_spec2(grib_handle* h, goto cleanup; break; } - packingTypeIsSet = 1; } switch (packing_spec->accuracy) { case GRIB_UTIL_ACCURACY_SAME_BITS_PER_VALUES_AS_INPUT: diff --git a/tests/badgrib.sh b/tests/badgrib.sh index d978199a9..15cba84c6 100755 --- a/tests/badgrib.sh +++ b/tests/badgrib.sh @@ -12,5 +12,12 @@ REDIRECT=/dev/null -${tools_dir}/grib_ls -7 ${data_dir}/bad.grib 2> $REDIRECT > $REDIRECT +# Do not fail on wrong length +$EXEC ${tools_dir}/grib_ls -7 ${data_dir}/bad.grib 2> $REDIRECT > $REDIRECT +# Do fail on wrong length +set +e +$EXEC ${tools_dir}/grib_ls ${data_dir}/bad.grib 2> $REDIRECT > $REDIRECT +status=$? +set -e +[ $status -ne 0 ] diff --git a/tests/grib_copy.sh b/tests/grib_copy.sh index 525a94a79..c814fc653 100755 --- a/tests/grib_copy.sh +++ b/tests/grib_copy.sh @@ -44,6 +44,34 @@ r1=`${tools_dir}/grib_get -w count=1 -n ls $input` r2=`${tools_dir}/grib_get -n ls $temp` [ "$r1" = "$r2" ] +echo "Test: ECC-1086..." +# ------------------------- +# This file is 179 bytes long. We chop the last byte to create +# an invalid GRIB message (Final 7777 is 777) +input=$ECCODES_SAMPLES_PATH/GRIB2.tmpl +badGrib=${label}".bad.grib" +head -c 178 $input > $badGrib +set +e +${tools_dir}/grib_copy $badGrib /dev/null # Only the bad GRIB +status=$? +set -e +[ $status -ne 0 ] + +set +e +${tools_dir}/grib_copy $input $badGrib /dev/null # Good followed by bad +status=$? +set -e +[ $status -ne 0 ] + +set +e +${tools_dir}/grib_copy $badGrib $input /dev/null # Bad followed by good +status=$? +set -e +[ $status -ne 0 ] + + + + #${tools_dir}/grib_copy -w count=1 -X 57143 $input $temp #Last msg #r1=`${tools_dir}/grib_get -w count=37 -n ls $input` #r2=`${tools_dir}/grib_get -n ls $temp` diff --git a/tests/grib_ls_json.sh b/tests/grib_ls_json.sh index 3cf6a4d46..a3e7a900e 100755 --- a/tests/grib_ls_json.sh +++ b/tests/grib_ls_json.sh @@ -88,8 +88,8 @@ grep -q '"latitudeOfLastGridPointInDegrees": -89.463' $tempLog # Check output from all our downloaded GRIBs # ---------------------------------------------------- grib_files=`cat ${data_dir}/grib_data_files.txt` -for file in ${grib_files} -do +for file in ${grib_files}; do + if [ "$file" = "bad.grib" ]; then continue; fi input=${data_dir}/$file ${tools_dir}/grib_ls -j $input > $tempLog if test "x$JSON_CHECK" != "x"; then diff --git a/tests/tests.ecmwf/grib1to2.c b/tests/tests.ecmwf/grib1to2.c index 255825ea7..d6d2049d5 100644 --- a/tests/tests.ecmwf/grib1to2.c +++ b/tests/tests.ecmwf/grib1to2.c @@ -12,7 +12,7 @@ int main(int argc,char** argv) int cnt = 0; extern const char* grib_get_accessor_class_name(grib_handle* , const char* ); int sample = getenv("SAMPLE") != NULL; - + f = fopen(argc > 1 ? argv[1]: "data" ,"r"); if(!f) { @@ -45,9 +45,9 @@ int main(int argc,char** argv) #if 0 if(result_class_name && (strcmp(result_class_name,"data_2order_packing") == 0 || - + strcmp(result_class_name,"data_g22order_packing") == 0) - + ) { cnt++; diff --git a/tools/grib_tools.c b/tools/grib_tools.c index d063a49a3..54637eced 100644 --- a/tools/grib_tools.c +++ b/tools/grib_tools.c @@ -358,7 +358,13 @@ static int grib_tool_without_orderby(grib_runtime_options* options) err != GRIB_SUCCESS)) { infile->handle_count++; options->handle_count++; - options->error = err; + + if (c->no_fail_on_wrong_length && (err == GRIB_PREMATURE_END_OF_FILE || err == GRIB_WRONG_LENGTH)) + err = 0; + if (!options->error) { + /* ECC-1086: Do not clear a previous error */ + options->error = err; + } if (!h) { /* fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); */ From bff210a7a0665cc52b7aabef0196576e6bd9b3ee Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 11 Mar 2020 17:48:53 +0000 Subject: [PATCH 73/82] Latest updates from develop (25) --- CMakeLists.txt | 6 ++--- INSTALL | 4 +-- README.md | 4 +-- definitions/grib1/grid_definition_0.def | 2 +- definitions/grib1/grid_definition_10.def | 2 +- definitions/grib1/grid_definition_20.def | 2 +- definitions/grib1/grid_definition_30.def | 2 +- definitions/mars/type.table | 1 + src/grib_accessor_class_concept.c | 8 +++--- src/grib_accessor_class_g2_mars_labeling.c | 1 + src/grib_context.c | 29 +++++++++++++++++++--- tests/grib_copy.sh | 15 ++++++++--- tools/grib_tools.c | 7 +++--- 13 files changed, 59 insertions(+), 24 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f49e5516..a2f85b123 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -123,7 +123,7 @@ ecbuild_add_option( FEATURE PYTHON REQUIRED_PACKAGES "Python VERSION 2.6 NO_LIBS" NumPy ) # For Python2 we build our own bindings (using SWIG) in the build directory -# but for Python3 one has to add the eccodes-python from pip3 AFTER the install +# but for Python3 one has to add the eccodes from pip3 AFTER the install if( PYTHON_VERSION_MAJOR EQUAL 3 ) set( HAVE_PYTHON 0 ) endif() @@ -404,7 +404,7 @@ add_subdirectory( fortran ) if (PYTHON_VERSION_MAJOR GREATER 2) # Python3 is no longer built with SWIG but is a separate - # package. User should do: pip3 install eccodes-python + # package. User should do: pip3 install eccodes #add_subdirectory( python3 ) set( ECCODES_PYTHON_DIR "python3" ) else() @@ -506,6 +506,6 @@ ecbuild_info(" | Please note: |") ecbuild_info(" | For Python3 support, first install |") ecbuild_info(" | ecCodes and then install the Python |") ecbuild_info(" | bindings from PyPI with: |") -ecbuild_info(" | $ pip3 install eccodes-python |") +ecbuild_info(" | $ pip3 install eccodes |") ecbuild_info(" +--------------------------------------+") ecbuild_info("") diff --git a/INSTALL b/INSTALL index 299775237..8250fdc10 100644 --- a/INSTALL +++ b/INSTALL @@ -34,9 +34,9 @@ However it requires that cmake be installed on your system. > make install To add the Python3 bindings, use pip3 install from PyPI as follows: - > pip3 install eccodes-python + > pip3 install eccodes or - > pip3 install --install-option="--prefix=/path/to/where/you/install/eccodes" eccodes-python + > pip3 install --install-option="--prefix=/path/to/where/you/install/eccodes" eccodes You can also pass options to the cmake command above. Some typical examples are: diff --git a/README.md b/README.md index 0ec2f214c..c6711cf96 100644 --- a/README.md +++ b/README.md @@ -55,11 +55,11 @@ INSTALLATION To add the Python3 bindings, use pip3 install from PyPI as follows: ``` - pip3 install eccodes-python + pip3 install eccodes ``` or ``` - pip3 install --install-option="--prefix=/path/to/where/you/install/eccodes" eccodes-python + pip3 install --install-option="--prefix=/path/to/where/you/install/eccodes" eccodes ``` diff --git a/definitions/grib1/grid_definition_0.def b/definitions/grib1/grid_definition_0.def index 1c7b4df6e..c30b702de 100644 --- a/definitions/grib1/grid_definition_0.def +++ b/definitions/grib1/grid_definition_0.def @@ -8,4 +8,4 @@ constant gridDefinitionTemplateNumber = 0; template commonBlock "grib1/grid_definition_latlon.def"; # Padding - See GRIB-370 -ascii[4] zero : read_only; +ascii[4] zeros : read_only; diff --git a/definitions/grib1/grid_definition_10.def b/definitions/grib1/grid_definition_10.def index 221dee564..8d5f75fda 100644 --- a/definitions/grib1/grid_definition_10.def +++ b/definitions/grib1/grid_definition_10.def @@ -6,7 +6,7 @@ constant gridDefinitionTemplateNumber = 1; template commonBlock "grib1/grid_definition_latlon.def"; -ascii[4] zero : read_only; +ascii[4] zeros : read_only; # Rotation parameters include "grib1/grid_rotation.def" diff --git a/definitions/grib1/grid_definition_20.def b/definitions/grib1/grid_definition_20.def index 9f742b254..1e3a81468 100644 --- a/definitions/grib1/grid_definition_20.def +++ b/definitions/grib1/grid_definition_20.def @@ -6,7 +6,7 @@ constant gridDefinitionTemplateNumber = 2; template commonBlock "grib1/grid_definition_latlon.def"; -ascii[4] zero : read_only; +ascii[4] zeros : read_only; # Stretching parameters include "grib1/grid_stretching.def" diff --git a/definitions/grib1/grid_definition_30.def b/definitions/grib1/grid_definition_30.def index e3b61a6e1..c3e4d1b4a 100644 --- a/definitions/grib1/grid_definition_30.def +++ b/definitions/grib1/grid_definition_30.def @@ -6,7 +6,7 @@ constant gridDefinitionTemplateNumber = 3; template commonBlock "grib1/grid_definition_latlon.def"; -ascii[4] zero : read_only; +ascii[4] zeros : read_only; # Rotation parameters include "grib1/grid_rotation.def" diff --git a/definitions/mars/type.table b/definitions/mars/type.table index c9dd876fa..2f28ede79 100644 --- a/definitions/mars/type.table +++ b/definitions/mars/type.table @@ -37,6 +37,7 @@ 36 pd Probability distribution 37 ci Cluster information 38 sot Shift of Tail +39 eme Ensemble data assimilation model errors 40 im Images 42 sim Simulated images 43 wem Weighted ensemble mean diff --git a/src/grib_accessor_class_concept.c b/src/grib_accessor_class_concept.c index afbd99318..7582e7a70 100644 --- a/src/grib_accessor_class_concept.c +++ b/src/grib_accessor_class_concept.c @@ -570,6 +570,8 @@ static int is_local_ecmwf_grib2_param_key(grib_accessor* a, long edition, long c static char* get_legacy_param_info(const char* key_name, long paramId) { + if (strcmp(key_name, "modelName") == 0) + return "unknown"; if (paramId == 210) { if (strcmp(key_name, "paramId") == 0) return "210"; @@ -581,7 +583,7 @@ static char* get_legacy_param_info(const char* key_name, long paramId) return "Surface net solar radiation, clear sky"; if (strcmp(key_name, "cfVarName") == 0) return "ssrc"; - if (strcmp(key_name, "cfName") == 0) + if (strncmp(key_name, "cfName", 6) == 0) return "surface_net_downward_shortwave_flux_assuming_clear_sky"; } else if (paramId == 211) { @@ -595,11 +597,11 @@ static char* get_legacy_param_info(const char* key_name, long paramId) return "Surface net thermal radiation, clear sky"; if (strcmp(key_name, "cfVarName") == 0) return "strc"; - if (strcmp(key_name, "cfName") == 0) + if (strncmp(key_name, "cfName", 6) == 0) return "surface_net_downward_longwave_flux_assuming_clear_sky"; } else if (paramId == 228051 || paramId == 228053 || paramId == 228057 || paramId == 228058 || paramId == 228059 || paramId == 228060) { - if (strcmp(key_name, "cfName") == 0) + if (strncmp(key_name, "cfName", 6) == 0) return "unknown"; } return NULL; diff --git a/src/grib_accessor_class_g2_mars_labeling.c b/src/grib_accessor_class_g2_mars_labeling.c index d758b4d43..2fb5b9d3c 100644 --- a/src/grib_accessor_class_g2_mars_labeling.c +++ b/src/grib_accessor_class_g2_mars_labeling.c @@ -353,6 +353,7 @@ static int extra_set(grib_accessor* a, long val) case 36: /* Probability distribution (pd) */ case 37: /* Cluster information (ci) */ case 38: /* Shift of Tail (sot) */ + case 39: /* Ensemble data assimilation model errors */ case 40: /* Images (im) */ case 42: /* Simulated images (sim) */ typeOfProcessedData = 255; diff --git a/src/grib_context.c b/src/grib_context.c index 415f9e990..217ccde8a 100644 --- a/src/grib_context.c +++ b/src/grib_context.c @@ -349,10 +349,10 @@ static grib_context default_grib_context = { 0, /* keys_count */ 0, /* concepts_index */ 0, /* concepts_count */ - {0,}, /* concepts */ - 0, /* hash_array_index */ - 0, /* hash_array_count */ - {0,}, /* hash_array */ + {0,}, /* concepts */ + 0, /* hash_array_index */ + 0, /* hash_array_count */ + {0,}, /* hash_array */ 0, /* def_files */ 0, /* blacklist */ 0, /* ieee_packing */ @@ -494,6 +494,17 @@ grib_context* grib_context_get_default() default_grib_context.grib_definition_files_path = strdup(buffer); } } +#ifdef ECCODES_DEFINITION_PATH + { + /* ECC-1088 */ + if (strstr(default_grib_context.grib_definition_files_path, ECCODES_DEFINITION_PATH) == NULL) { + char buffer[ECC_PATH_MAXLEN]; + ecc_snprintf(buffer, ECC_PATH_MAXLEN, "%s%c%s", default_grib_context.grib_definition_files_path, + ECC_PATH_DELIMITER_CHAR, ECCODES_DEFINITION_PATH); + default_grib_context.grib_definition_files_path = strdup(buffer); + } + } +#endif /* Samples path extra: Added at the head of (i.e. before) existing path */ { @@ -504,6 +515,16 @@ grib_context* grib_context_get_default() default_grib_context.grib_samples_path = strdup(buffer); } } +#ifdef ECCODES_SAMPLES_PATH + { + if (strstr(default_grib_context.grib_samples_path, ECCODES_SAMPLES_PATH) == NULL) { + char buffer[ECC_PATH_MAXLEN]; + ecc_snprintf(buffer, ECC_PATH_MAXLEN, "%s%c%s", default_grib_context.grib_samples_path, + ECC_PATH_DELIMITER_CHAR, ECCODES_SAMPLES_PATH); + default_grib_context.grib_samples_path = strdup(buffer); + } + } +#endif grib_context_log(&default_grib_context, GRIB_LOG_DEBUG, "Definitions path: %s", default_grib_context.grib_definition_files_path); diff --git a/tests/grib_copy.sh b/tests/grib_copy.sh index c814fc653..8c5f23849 100755 --- a/tests/grib_copy.sh +++ b/tests/grib_copy.sh @@ -44,6 +44,7 @@ r1=`${tools_dir}/grib_get -w count=1 -n ls $input` r2=`${tools_dir}/grib_get -n ls $temp` [ "$r1" = "$r2" ] + echo "Test: ECC-1086..." # ------------------------- # This file is 179 bytes long. We chop the last byte to create @@ -69,8 +70,16 @@ status=$? set -e [ $status -ne 0 ] - - +# If there is a bad message, make sure the rest (good ones) get copied +combinedGrib=${label}".combined.grib" +cat $badGrib tigge_cf_ecmwf.grib2 > $combinedGrib +set +e +${tools_dir}/grib_copy $combinedGrib $temp +status=$? +set -e +[ $status -ne 0 ] +count=`${tools_dir}/grib_count $temp` +[ $count -eq 43 ] #${tools_dir}/grib_copy -w count=1 -X 57143 $input $temp #Last msg #r1=`${tools_dir}/grib_get -w count=37 -n ls $input` @@ -89,4 +98,4 @@ set -e # Clean up #----------- -rm -f $temp +rm -f $temp $badGrib $combinedGrib diff --git a/tools/grib_tools.c b/tools/grib_tools.c index 54637eced..da9304a79 100644 --- a/tools/grib_tools.c +++ b/tools/grib_tools.c @@ -1265,9 +1265,10 @@ void grib_tools_write_message(grib_runtime_options* options, grib_handle* h) char filename[1024] = {0,}; Assert(options->outfile != NULL && options->outfile->name != NULL); - if (options->error == GRIB_WRONG_LENGTH) - return; - + /* See ECC-1086 + * if (options->error == GRIB_WRONG_LENGTH) + * return; + */ if ((err = grib_get_message(h, &buffer, &size)) != GRIB_SUCCESS) { grib_context_log(h->context, GRIB_LOG_ERROR, "unable to get binary message\n"); exit(err); From 42a0974dc579f2b92a451aea070e3697728a4121 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 12 Mar 2020 18:02:07 +0000 Subject: [PATCH 74/82] Add debug to see why tests fail --- tests/unit_tests.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unit_tests.sh b/tests/unit_tests.sh index 5a8b6905c..4947fef50 100755 --- a/tests/unit_tests.sh +++ b/tests/unit_tests.sh @@ -8,6 +8,7 @@ # virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. # +export ECCODES_DEBUG=1 . ./include.sh $EXEC ${test_dir}/unit_tests From 8b1c6df63b13d86b783d2d72a2212151a2e11885 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 13 Mar 2020 15:07:03 +0000 Subject: [PATCH 75/82] Add debug to see why tests fail (2) --- src/grib_templates.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/grib_templates.c b/src/grib_templates.c index a9d03ad6a..6d9fefa88 100644 --- a/src/grib_templates.c +++ b/src/grib_templates.c @@ -50,7 +50,7 @@ static grib_handle* try_template(grib_context* c, const char* dir, const char* n sprintf(path, "%s/%s.tmpl", dir, name); - if (c->debug == -1) { + if (c->debug) { fprintf(stderr, "ECCODES DEBUG: try_template path='%s'\n", path); } @@ -78,7 +78,7 @@ static grib_handle* try_bufr_template(grib_context* c, const char* dir, const ch sprintf(path, "%s/%s.tmpl", dir, name); - if (c->debug == -1) { + if (c->debug) { fprintf(stderr, "ECCODES DEBUG: try_template path='%s'\n", path); } From d3585769bcae3589c486cc26a9e1ea358d546e40 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 13 Mar 2020 16:17:14 +0000 Subject: [PATCH 76/82] Add debug to see why tests fail (3) --- .appveyor.yml | 10 ++++------ VERSION.cmake | 2 +- src/grib_date.c | 18 +++--------------- src/grib_templates.c | 14 +++++++++++--- tests/julian.c | 35 +++++++++++++++++++++++++++++++++++ tests/unit_tests.sh | 1 - version.sh | 2 +- 7 files changed, 55 insertions(+), 27 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 0fa903610..f54238c2e 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -2,7 +2,7 @@ # general configuration # #---------------------------------# -version: 2.17.0-{build}-{branch} +version: 2.18.0-{build}-{branch} branches: only: @@ -103,8 +103,6 @@ notifications: - provider: Email to: - shahram.najm@ecmwf.int - subject: 'Build {{status}}: {{projectName}} {{buildVersion}}' # optional - message: "{{message}}, {{commitId}}, {{pull_request_head_repo_branch}},..." # optional - on_build_success: true - on_build_failure: false - + subject: 'Build {{status}}' # optional + message: "{{message}}, {{commitId}}, ..." # optional + on_build_success: false diff --git a/VERSION.cmake b/VERSION.cmake index b4cbdd932..4cd1fa6d7 100644 --- a/VERSION.cmake +++ b/VERSION.cmake @@ -1 +1 @@ -set( ${PROJECT_NAME}_VERSION_STR "2.17.0" ) +set( ${PROJECT_NAME}_VERSION_STR "2.18.0" ) diff --git a/src/grib_date.c b/src/grib_date.c index c71d1a9da..0f3cb851c 100644 --- a/src/grib_date.c +++ b/src/grib_date.c @@ -82,7 +82,7 @@ int grib_datetime_to_julian_d( long year, long month, long day, long hour, long minute, double second, double* jd) { - double a, b, dday; + double a, b = 0, dday; long y, m; dday = (double)(hour * 3600 + minute * 60 + second) / 86400.0 + day; @@ -97,22 +97,10 @@ int grib_datetime_to_julian_d( } a = (long)(((double)y) / 100); - if (y > 1582) + if (y > 1582 || + (y == 1582 && ((m > 10) || (m == 10 && day > 14)))) { b = 2 - a + (long)(a / 4); - else if (y == 1582) { - if (m > 10) - b = 2 - a + (long)(a / 4); - else if (m == 10) { - if (day > 14) - b = 2 - a + (long)(a / 4); - else - b = 0; - } - else - b = 0; } - else - b = 0; *jd = (long)(365.25 * (y + 4716)) + (long)(30.6001 * (m + 1)) + dday + b - 1524.5; diff --git a/src/grib_templates.c b/src/grib_templates.c index 6d9fefa88..a9ea4785e 100644 --- a/src/grib_templates.c +++ b/src/grib_templates.c @@ -42,6 +42,14 @@ grib_handle* grib_internal_sample(grib_context* c,const char* name) } #endif +/* Windows always has a colon in pathnames e.g. C:\temp\file. So instead we use semi-colons as delimiter */ +/* in order to have multiple definitions/samples directories */ +#ifdef ECCODES_ON_WINDOWS + #define ECC_PATH_DELIMITER_CHAR ';' +#else + #define ECC_PATH_DELIMITER_CHAR ':' +#endif + static grib_handle* try_template(grib_context* c, const char* dir, const char* name) { char path[1024]; @@ -122,7 +130,7 @@ grib_handle* grib_external_template(grib_context* c, const char* name) return NULL; while (*base) { - if (*base == ':') { + if (*base == ECC_PATH_DELIMITER_CHAR) { *p = 0; g = try_template(c, buffer, name); if (g) @@ -148,7 +156,7 @@ grib_handle* bufr_external_template(grib_context* c, const char* name) return NULL; while (*base) { - if (*base == ':') { + if (*base == ECC_PATH_DELIMITER_CHAR) { *p = 0; g = try_bufr_template(c, buffer, name); if (g) @@ -175,7 +183,7 @@ char* grib_external_template_path(grib_context* c, const char* name) return NULL; while (*base) { - if (*base == ':') { + if (*base == ECC_PATH_DELIMITER_CHAR) { *p = 0; g = try_template_path(c, buffer, name); if (g) diff --git a/tests/julian.c b/tests/julian.c index 9c723b0bc..3910bc5cd 100644 --- a/tests/julian.c +++ b/tests/julian.c @@ -181,12 +181,47 @@ static void Test3() } } +static void Test4() +{ + const long iyear = 1582; + + TestDateTime(iyear, 9, 1, 1, 0, 0); + TestDateTime(iyear, 9, 2, 1, 0, 0); + TestDateTime(iyear, 9, 3, 1, 0, 0); + TestDateTime(iyear, 9, 4, 1, 0, 0); + TestDateTime(iyear, 9, 4, 16, 0, 0); + + /* TODO */ + /* TestDateTime(iyear, 10, 5, 1, 0, 0); */ + TestDateTime(iyear, 10, 1, 1, 0, 0); + TestDateTime(iyear, 10, 2, 1, 0, 0); + TestDateTime(iyear, 10, 3, 1, 0, 0); + TestDateTime(iyear, 10, 4, 1, 0, 0); + TestDateTime(iyear, 10, 15, 1, 0, 0); + + TestDateTime(iyear, 11, 1, 1, 0, 0); + TestDateTime(iyear, 11, 2, 1, 0, 0); + TestDateTime(iyear, 11, 3, 1, 0, 0); + TestDateTime(iyear, 11, 4, 1, 0, 0); + TestDateTime(iyear, 11, 5, 1, 0, 0); + TestDateTime(iyear, 11, 5, 15, 0, 0); + + /* TODO + * for (imnth = 1; imnth <= 12; imnth += 1) { + * for (iday = 1; iday <= 28; iday += 1) { + * TestDateTime(iyear, imnth, iday, 1, 0, 0); + * } + * } + */ +} + int main(int argc, char* argv[]) { Test0(); Test1(); Test2(); Test3(); + Test4(); printf("All OK\n"); return 0; } diff --git a/tests/unit_tests.sh b/tests/unit_tests.sh index 4947fef50..5a8b6905c 100755 --- a/tests/unit_tests.sh +++ b/tests/unit_tests.sh @@ -8,7 +8,6 @@ # virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. # -export ECCODES_DEBUG=1 . ./include.sh $EXEC ${test_dir}/unit_tests diff --git a/version.sh b/version.sh index aa1f5541e..d777c51f7 100644 --- a/version.sh +++ b/version.sh @@ -3,7 +3,7 @@ PACKAGE_NAME='eccodes' # Package version ECCODES_MAJOR_VERSION=2 -ECCODES_MINOR_VERSION=17 +ECCODES_MINOR_VERSION=18 ECCODES_REVISION_VERSION=0 ECCODES_CURRENT=1 From c1fbfd556cb2864e1066fe9273a8dc963bec687f Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 13 Mar 2020 16:48:59 +0000 Subject: [PATCH 77/82] Fix broken tests (samples path) --- CMakeLists.txt | 10 ++++++++++ definitions/CMakeLists.txt | 11 ++++++++++- memfs.py | 16 ++++++++++++++-- memfs/CMakeLists.txt | 7 +++++++ src/grib_templates.c | 7 +++---- 5 files changed, 44 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a2f85b123..b6ce30a8e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,6 +69,15 @@ ecbuild_info("Operating system=${CMAKE_SYSTEM} (${EC_OS_BITS} bits)") ############################################################################### # some variables/options of this project +ecbuild_add_option( FEATURE PRODUCT_GRIB + DESCRIPTION "Support for the product GRIB" + DEFAULT ON +) +ecbuild_add_option( FEATURE PRODUCT_BUFR + DESCRIPTION "Support for the product BUFR" + DEFAULT ON +) + ecbuild_add_option( FEATURE EXAMPLES DESCRIPTION "Build the examples" DEFAULT ON @@ -163,6 +172,7 @@ else() set( _will_install_defs_samples ON ) endif() + # controls installation of files in definitions/ -- note that it still creates the symlinks in the build dir # by default, if memfs is available, then we don't need to install definitions ecbuild_add_option( FEATURE INSTALL_ECCODES_DEFINITIONS diff --git a/definitions/CMakeLists.txt b/definitions/CMakeLists.txt index 4270b7cbf..85eb4e031 100644 --- a/definitions/CMakeLists.txt +++ b/definitions/CMakeLists.txt @@ -10,7 +10,16 @@ file( GLOB children RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*" ) set( dirlist "" ) foreach( child ${children} ) if( IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${child} ) - list( APPEND dirlist ${child} ) + set( add_child 1 ) + if( NOT HAVE_PRODUCT_BUFR AND child STREQUAL bufr ) + set( add_child 0 ) + endif() + if( NOT HAVE_PRODUCT_GRIB AND child MATCHES "^grib" ) + set( add_child 0 ) + endif() + if( add_child ) + list( APPEND dirlist ${child} ) + endif() endif() endforeach() diff --git a/memfs.py b/memfs.py index 52c471ced..07d422648 100755 --- a/memfs.py +++ b/memfs.py @@ -12,8 +12,20 @@ # METAR and TAF are also experimental EXCLUDED = ['grib3', 'codetables', 'taf', 'metar'] -dirs = [os.path.realpath(x) for x in sys.argv[1:-1]] -print(dirs) +pos=1 +if sys.argv[1] == '-exclude': + product = sys.argv[2] + if product == 'bufr': + EXCLUDED.append(product) + elif product == 'grib': + EXCLUDED.extend(['grib1', 'grib2']) + else: + assert False, 'Invalid product %s' % product + pos = 3 + +dirs = [os.path.realpath(x) for x in sys.argv[pos:-1]] +print('Directories: ', dirs) +print('Excluding: ', EXCLUDED) FILES = {} NAMES = [] diff --git a/memfs/CMakeLists.txt b/memfs/CMakeLists.txt index fd64e5079..48da54ad3 100644 --- a/memfs/CMakeLists.txt +++ b/memfs/CMakeLists.txt @@ -1,6 +1,13 @@ +set( exclude "" ) +if( NOT HAVE_PRODUCT_BUFR ) + set( exclude -exclude bufr ) +elseif( NOT HAVE_PRODUCT_GRIB ) + set( exclude -exclude grib ) +endif() add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/memfs.c COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/memfs.py + ${exclude} ${PROJECT_SOURCE_DIR}/definitions ${PROJECT_SOURCE_DIR}/samples ${PROJECT_SOURCE_DIR}/ifs_samples diff --git a/src/grib_templates.c b/src/grib_templates.c index a9ea4785e..b2a4298f8 100644 --- a/src/grib_templates.c +++ b/src/grib_templates.c @@ -42,12 +42,11 @@ grib_handle* grib_internal_sample(grib_context* c,const char* name) } #endif -/* Windows always has a colon in pathnames e.g. C:\temp\file. So instead we use semi-colons as delimiter */ -/* in order to have multiple definitions/samples directories */ +/* Windows always has a colon in pathnames e.g. C:\temp\file. It uses semi-colons as delimiter */ #ifdef ECCODES_ON_WINDOWS - #define ECC_PATH_DELIMITER_CHAR ';' +#define ECC_PATH_DELIMITER_CHAR ';' #else - #define ECC_PATH_DELIMITER_CHAR ':' +#define ECC_PATH_DELIMITER_CHAR ':' #endif static grib_handle* try_template(grib_context* c, const char* dir, const char* name) From bb6e8e624419906ca458e4cd0e42118acc27bdcc Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 18 Mar 2020 12:57:02 +0000 Subject: [PATCH 78/82] Latest updates from develop (26) --- definitions/grib1/grid_rotation.def | 2 +- definitions/grib1/local.98.192.def | 12 ++--- definitions/grib1/local.98.40.def | 10 ++--- definitions/grib1/section.2.def | 2 +- definitions/grib2/section.3.def | 2 +- definitions/grib2/template.3.rotation.def | 2 +- definitions/grib3/template.component.4.2.def | 2 +- src/action_class_gen.c | 13 ++++++ src/grib_accessor_class_data_2order_packing.c | 18 ++++---- src/grib_bits_any_endian.c | 7 +-- src/grib_bits_ibmpow.c | 3 +- src/grib_hash_keys.c | 44 +++++++++++-------- src/grib_iterator_class_gaussian.c | 8 ++-- src/grib_iterator_class_gaussian_reduced.c | 4 +- ...rator_class_lambert_azimuthal_equal_area.c | 4 +- src/grib_iterator_class_lambert_conformal.c | 4 +- src/grib_iterator_class_latlon.c | 18 ++++---- src/grib_iterator_class_polar_stereographic.c | 4 +- src/grib_iterator_class_regular.c | 22 +++++----- src/grib_iterator_class_space_view.c | 4 +- src/grib_nearest_class_regular.c | 2 +- tests/keys | 23 +++++----- 22 files changed, 112 insertions(+), 98 deletions(-) diff --git a/definitions/grib1/grid_rotation.def b/definitions/grib1/grid_rotation.def index d94cf8e8b..05d49bd29 100644 --- a/definitions/grib1/grid_rotation.def +++ b/definitions/grib1/grid_rotation.def @@ -9,4 +9,4 @@ meta geography.longitudeOfSouthernPoleInDegrees scale(longitudeOfSouthernPole ibmfloat geography.angleOfRotationInDegrees : dump; alias angleOfRotation =angleOfRotationInDegrees; -alias is_rotated_grid = one; +alias isRotatedGrid = one; diff --git a/definitions/grib1/local.98.192.def b/definitions/grib1/local.98.192.def index b822d1d89..7b0dd9295 100644 --- a/definitions/grib1/local.98.192.def +++ b/definitions/grib1/local.98.192.def @@ -5,9 +5,9 @@ constant GRIBEXSection1Problem = 0 ; -codetable[1] thisMarsClass "mars/class.table" = "od" : dump,lowercase; +codetable[1] thisMarsClass "mars/class.table" = "od" : dump,string_type,lowercase; codetable[1] thisMarsType "mars/type.table" = "an" : dump,string_type,lowercase; -codetable[2] thisMarsStream "mars/stream.table" = "oper" : dump,lowercase ; +codetable[2] thisMarsStream "mars/stream.table" = "oper" : dump,string_type,lowercase ; ksec1expver[4] thisExperimentVersionNumber = "0001" : dump; alias ls.dataType = thisMarsType; @@ -24,16 +24,16 @@ unsigned[1] numberOfLocalDefinitions = 2 : dump; if (numberOfLocalDefinitions == 2 ) { unsigned[2] subLocalDefinitionLength1 = 7 : dump; unsigned[1] subLocalDefinitionNumber1 = 1 : dump; - codetable[1] marsClass1 "mars/class.table" = "od" : dump,lowercase; + codetable[1] marsClass1 "mars/class.table" = "od" : dump,string_type,lowercase; codetable[1] marsType1 "mars/type.table" = "an" : dump,string_type,lowercase; - codetable[2] marsStream1 "mars/stream.table" = "oper" : dump,lowercase ; + codetable[2] marsStream1 "mars/stream.table" = "oper" : dump,string_type,lowercase; ksec1expver[4] experimentVersionNumber1 = "0001" : dump; template subDefinitions1 "grib1/local_no_mars.98.[subLocalDefinitionNumber1].def"; unsigned[2] subLocalDefinitionLength2 = 9 : dump; unsigned[1] subLocalDefinitionNumber2 = 24 : dump; - codetable[1] marsClass2 "mars/class.table" = "od" : dump,lowercase; + codetable[1] marsClass2 "mars/class.table" = "od" : dump,string_type,lowercase; codetable[1] marsType2 "mars/type.table" = "an" : dump,string_type,lowercase; - codetable[2] marsStream2 "mars/stream.table" = "oper" : dump,lowercase ; + codetable[2] marsStream2 "mars/stream.table" = "oper" : dump,string_type,lowercase; ksec1expver[4] experimentVersionNumber2 = "0001" : dump; template subDefinitions2 "grib1/local_no_mars.98.[subLocalDefinitionNumber2].def"; } diff --git a/definitions/grib1/local.98.40.def b/definitions/grib1/local.98.40.def index b32ba65b7..4e92d73eb 100644 --- a/definitions/grib1/local.98.40.def +++ b/definitions/grib1/local.98.40.def @@ -4,20 +4,20 @@ constant GRIBEXSection1Problem = 56 - section1Length ; template mars_labeling "grib1/mars_labeling.def"; -unsigned[1] perturbationNumber : dump; +unsigned[1] perturbationNumber : dump; alias number = perturbationNumber; -unsigned[1] numberOfForecastsInEnsemble : dump; +unsigned[1] numberOfForecastsInEnsemble : dump; alias totalNumber=numberOfForecastsInEnsemble; #1->2 alias grib2LocalSectionPresent=present; constant grib2LocalSectionNumber=1; -codetable[2] marsModel "mars/model.[centre:l].table" = "cosmo" : dump,lowercase ; -alias mars.model = marsModel; +codetable[2] marsModel "mars/model.[centre:l].table" = "cosmo": dump; +alias mars.model = marsModel; -codetable[2] marsDomain "mars/domain.[centre:l].table" = "s" : dump,lowercase ; +codetable[2] marsDomain "mars/domain.[centre:l].table" = "s": dump; alias mars.domain = marsDomain; pad padding_local40_1(1); diff --git a/definitions/grib1/section.2.def b/definitions/grib1/section.2.def index 40c4a9337..1256f1fdd 100644 --- a/definitions/grib1/section.2.def +++ b/definitions/grib1/section.2.def @@ -31,7 +31,7 @@ meta gridDefinitionDescription codetable_title(dataRepresentationType); # Grid definition # (according to data representation type - octet 6 above) -alias is_rotated_grid=zero; +alias isRotatedGrid=zero; if (dataRepresentationType < 192) { diff --git a/definitions/grib2/section.3.def b/definitions/grib2/section.3.def index 409bcf2c4..a9c06d38b 100644 --- a/definitions/grib2/section.3.def +++ b/definitions/grib2/section.3.def @@ -36,7 +36,7 @@ if(numberOfOctectsForNumberOfPoints == 0){ codetable[2] gridDefinitionTemplateNumber ('3.1.table',masterDir,localDir) =0 : dump,edition_specific; meta gridDefinitionDescription codetable_title(gridDefinitionTemplateNumber); -alias is_rotated_grid=zero; +alias isRotatedGrid=zero; template gridDefinitionSection "grib2/template.3.[gridDefinitionTemplateNumber:l].def"; diff --git a/definitions/grib2/template.3.rotation.def b/definitions/grib2/template.3.rotation.def index f35e005a6..f797170a5 100755 --- a/definitions/grib2/template.3.rotation.def +++ b/definitions/grib2/template.3.rotation.def @@ -18,4 +18,4 @@ alias geography.angleOfRotationInDegrees=angleOfRotation; alias angleOfRotationOfProjection=angleOfRotation; -alias is_rotated_grid=one; +alias isRotatedGrid=one; diff --git a/definitions/grib3/template.component.4.2.def b/definitions/grib3/template.component.4.2.def index 596fc7f67..fd314fea2 100644 --- a/definitions/grib3/template.component.4.2.def +++ b/definitions/grib3/template.component.4.2.def @@ -18,4 +18,4 @@ alias geography.angleOfRotationInDegrees=angleOfRotation; alias angleOfRotationOfProjection=angleOfRotation; -alias is_rotated_grid=one; +alias isRotatedGrid=one; diff --git a/src/action_class_gen.c b/src/action_class_gen.c index ffa305a5f..0068dae93 100644 --- a/src/action_class_gen.c +++ b/src/action_class_gen.c @@ -97,6 +97,19 @@ grib_action* grib_action_create_gen(grib_context* context, const char* name, con act->cclass = c; act->context = context; act->flags = flags; +#if CHECK_LOWERCASE_AND_STRING_TYPE + { + int flag_lowercase=0, flag_stringtype=0; + if (flags & GRIB_ACCESSOR_FLAG_LOWERCASE) + flag_lowercase = 1; + if (flags & GRIB_ACCESSOR_FLAG_STRING_TYPE) + flag_stringtype = 1; + if (flag_lowercase && !flag_stringtype) { + printf("grib_action_create_gen name=%s. Has lowercase but not string_type\n", name); + Assert(0); + } + } +#endif a = (grib_action_gen*)act; a->len = len; diff --git a/src/grib_accessor_class_data_2order_packing.c b/src/grib_accessor_class_data_2order_packing.c index 79fcff4e9..ae3434df0 100644 --- a/src/grib_accessor_class_data_2order_packing.c +++ b/src/grib_accessor_class_data_2order_packing.c @@ -41,7 +41,7 @@ MEMBERS=const char* width_lengths MEMBERS=const char* octet_start_group MEMBERS=const char* width_spd_sp_desc - MEMBERS=const char* nap + MEMBERS=const char* Ni MEMBERS=const char* bitmap END_CLASS_DEF @@ -96,7 +96,7 @@ typedef struct grib_accessor_data_2order_packing const char* width_lengths; const char* octet_start_group; const char* width_spd_sp_desc; - const char* nap; + const char* Ni; const char* bitmap; } grib_accessor_data_2order_packing; @@ -218,7 +218,7 @@ static void init(grib_accessor* a, const long v, grib_arguments* args) self->width_lengths = grib_arguments_get_name(gh, args, self->carg++); self->octet_start_group = grib_arguments_get_name(gh, args, self->carg++); self->width_spd_sp_desc = grib_arguments_get_name(gh, args, self->carg++); - self->nap = grib_arguments_get_name(gh, args, self->carg++); + self->Ni = grib_arguments_get_name(gh, args, self->carg++); self->bitmap = grib_arguments_get_name(gh, args, self->carg++); a->flags |= GRIB_ACCESSOR_FLAG_DATA; } @@ -466,7 +466,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) long pointer_of_group_size = 0; long pointer_of_group_width = 0; long refsp = 0; - long nap = 0; + long Ni = 0; long nn = 0; unsigned char* bitmap = NULL; grib_accessor* abitmap = NULL; @@ -523,7 +523,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) if ((err = grib_get_long_internal(gh, self->width_spd_sp_desc, &width_spd_sp_desc)) != GRIB_SUCCESS) width_spd_sp_desc = -1; - if ((err = grib_get_long_internal(gh, self->nap, &nap)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(gh, self->Ni, &Ni)) != GRIB_SUCCESS) return err; self->dirty = 0; @@ -642,7 +642,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) de_spatial_difference(a->context, sec_val, n_vals, n_sp_diff, bias); if (boustrophedonic) - reverse_rows(sec_val, n_vals, nap, bitmap, bitmap_len); + reverse_rows(sec_val, n_vals, Ni, bitmap, bitmap_len); s = grib_power(binary_scale_factor, 2); d = grib_power(-decimal_scale_factor, 10); @@ -731,7 +731,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) long pointer_of_group_size = 0; long pointer_of_group_width = 0; long refsp = 0; - long nap = 0; + long Ni = 0; long offsetdata = 0; double max; @@ -763,7 +763,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) return err; if ((err = grib_get_long_internal(gh, self->width_spd_sp_desc, &width_spd_sp_desc)) != GRIB_SUCCESS) return err; - if ((err = grib_get_long_internal(gh, self->nap, &nap)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(gh, self->Ni, &Ni)) != GRIB_SUCCESS) return err; if ((abitmap = grib_find_accessor(gh, self->bitmap)) != NULL) { @@ -816,7 +816,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) /* reverse the rows*/ if (boustrophedonic) - reverse_rows(sec_val, n_vals, nap, bitmap, bitmap_len); + reverse_rows(sec_val, n_vals, Ni, bitmap, bitmap_len); if (snd_ordr_wdiff) diff --git a/src/grib_bits_any_endian.c b/src/grib_bits_any_endian.c index c1bccfae9..1591fd5d1 100644 --- a/src/grib_bits_any_endian.c +++ b/src/grib_bits_any_endian.c @@ -280,12 +280,7 @@ int grib_encode_unsigned_long(unsigned char* p, unsigned long val, long* bitp, l else { tmp = ((val >> len) | ((*p) & dmasks[n])); } - *p = tmp; - (*p)++; - - /*Beware of code like this! compiler warning: operation may be undefined - Read GCC manual on -Wsequence-point*/ - /* *p = ((val << -len) | ((*p)++ & dmasks[n])); */ + *p++ = tmp; } /* write the middle words */ diff --git a/src/grib_bits_ibmpow.c b/src/grib_bits_ibmpow.c index 162a7e4a9..df2b7556a 100644 --- a/src/grib_bits_ibmpow.c +++ b/src/grib_bits_ibmpow.c @@ -107,8 +107,7 @@ int grib_encode_unsigned_long(unsigned char* p, unsigned long val, long* bitp, l else { tmp = ((val >> len) | ((*p) & dmasks[n])); } - *p = tmp; - (*p)++; + *p++ = tmp; } /* write the middle words */ diff --git a/src/grib_hash_keys.c b/src/grib_hash_keys.c index 66397cdb1..35fc25d12 100644 --- a/src/grib_hash_keys.c +++ b/src/grib_hash_keys.c @@ -34,7 +34,7 @@ error "gperf generated tables don't work with this execution character set. Plea struct grib_keys_hash { char* name; int id;}; #include -#define TOTAL_KEYWORDS 2360 +#define TOTAL_KEYWORDS 2361 #define MIN_WORD_LENGTH 1 #define MAX_WORD_LENGTH 74 #define MIN_HASH_VALUE 5 @@ -49,7 +49,9 @@ struct grib_keys_hash { char* name; int id;}; #endif #endif static unsigned int -hash_keys (const char* str, unsigned int len) +hash_keys (str, len) + register const char *str; + register unsigned int len; { static const unsigned short asso_values[] = { @@ -258,7 +260,7 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 9, 0, 0, 11, 0, 0, 0, 12, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 11, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, - 2, 35, 0, 0, 0, 26, 0, 0, 0, 3, 0, 0, 4, 0, + 2, 35, 0, 0, 0, 26, 0, 0, 0, 3, 5, 0, 4, 0, 3, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 16, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 19, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 18, 16, 13, 11, @@ -581,7 +583,7 @@ static const unsigned char lengthtable[] = 13, 12, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, 28, 0, 0, 18, 22, 0, 0, 0, 17, 0, 0, 0, 0, 24, 0, 0, 21, 0, 16, 16, 0, 24, 8, 0, 0, 0, 9, - 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 20, 15, 0, 0, + 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 15, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 15, 0, 0, 0, 32, 0, 19, 0, 0, 13, 0, 25, 0, 0, 0, 11, 0, 0, @@ -613,7 +615,7 @@ static const unsigned char lengthtable[] = 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 35, 0, 0, 0, 0, 0, 0, 24, 13, 0, 0, 0, + 0, 0, 35, 0, 0, 0, 0, 0, 13, 24, 13, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 15, 21, 0, 37, 0, 0, 0, 0, 14, 33, 0, 17, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 16, 34, 0, 0, 0, 0, @@ -2571,7 +2573,7 @@ static const struct grib_keys_hash wordlist[] = {"timerepres",2150}, {"radius",1714}, {""}, - {"isSens",999}, + {"isSens",1000}, {"year",2353}, {""}, {"dataTime",630}, @@ -2737,7 +2739,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {"efiOrder",715}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"isSatellite",997}, + {"isSatellite",998}, {""}, {"typicalDate",2211}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -3182,7 +3184,8 @@ static const struct grib_keys_hash wordlist[] = {"typeOfDistributionFunction",2186}, {""}, {""}, {""}, {"max",1231}, - {""}, {""}, + {"zeros",2361}, + {""}, {"zero",2360}, {""}, {"qfe",1701}, @@ -3309,7 +3312,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {"tiggeSection",2131}, {""}, {""}, - {"isSatelliteType",998}, + {"isSatelliteType",999}, {""}, {"extractSubset",815}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -4102,7 +4105,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {"longitudeOfIcosahedronPole",1156}, {""}, {""}, {""}, {""}, - {"is_aerosol",1000}, + {"is_aerosol",1001}, {""}, {""}, {""}, {""}, {"projectLocalTemplate",1695}, {""}, {""}, @@ -4136,12 +4139,12 @@ static const struct grib_keys_hash wordlist[] = {"verticalVisibility",2291}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"is_efas",1004}, + {"is_efas",1005}, {""}, {""}, {""}, {"latLonValues",1041}, {"listOfEnsembleForecastNumbers",1109}, {""}, {""}, {""}, - {"is_chemical",1002}, + {"is_chemical",1003}, {""}, {"expandedOriginalReferences",772}, {""}, @@ -4463,7 +4466,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {"numberOfDataValues",1365}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"is_aerosol_optical",1001}, + {"is_aerosol_optical",1002}, {""}, {""}, {""}, {"diffInHours",675}, {""}, @@ -4532,7 +4535,7 @@ static const struct grib_keys_hash wordlist[] = {"n2",1304}, {""}, {""}, {""}, {""}, {""}, {""}, {"LoVInDegrees",128}, - {"is_chemical_distfn",1003}, + {"is_chemical_distfn",1004}, {""}, {""}, {""}, {""}, {"jDirectionIncrement",1018}, {""}, {""}, @@ -4822,7 +4825,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {"recentWeather",1737}, {""}, {""}, {""}, - {"is_ocean3d_param",1006}, + {"is_ocean3d_param",1007}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"changeIndicatorTrend1",409}, {""}, @@ -5178,7 +5181,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {"jPointsAreConsecutive",1023}, {""}, - {"is_ocean2d_param",1005}, + {"is_ocean2d_param",1006}, {"firstOrderValues",846}, {""}, {"typeOfWavelengthInterval",2209}, @@ -5189,8 +5192,8 @@ static const struct grib_keys_hash wordlist[] = {"marsStream2",1214}, {""}, {""}, {""}, {""}, {"MinuteOfModelVersion",157}, - {"is_rotated_grid",1007}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {"dayOfTheYearDate",650}, {""}, {"beginHourTrend3",337}, @@ -5380,7 +5383,8 @@ static const struct grib_keys_hash wordlist[] = {"numberOfPointsAlongAMeridian",1410}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"biFourierResolutionSubSetParameterM",356}, - {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, + {"isRotatedGrid",997}, {"sizeOfPostAuxiliaryArray",2018}, {"endHourTrend3",728}, {""}, {""}, {""}, {""}, {""}, @@ -9298,7 +9302,9 @@ static const struct grib_keys_hash wordlist[] = #endif #endif const struct grib_keys_hash * -grib_keys_hash_get (const char* str, unsigned int len) +grib_keys_hash_get (str, len) + register const char *str; + register unsigned int len; { if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) { diff --git a/src/grib_iterator_class_gaussian.c b/src/grib_iterator_class_gaussian.c index 536d38b11..06fb66f8f 100644 --- a/src/grib_iterator_class_gaussian.c +++ b/src/grib_iterator_class_gaussian.c @@ -51,8 +51,8 @@ typedef struct grib_iterator_gaussian /* Members defined in regular */ double* las; double* los; - long nap; - long nam; + long Ni; + long Nj; long iScansNegatively; long isRotated; double angleOfRotation; @@ -146,13 +146,13 @@ static int init(grib_iterator* i, grib_handle* h, grib_arguments* args) Assert(istart < size); if (jScansPositively) { - for (lai = 0; lai < self->nam; lai++) { + for (lai = 0; lai < self->Nj; lai++) { self->las[lai] = lats[istart--]; /*if (istart<0) istart=size-1; this condition is always FALSE -- 'istart' is unsigned long */ } } else { - for (lai = 0; lai < self->nam; lai++) { + for (lai = 0; lai < self->Nj; lai++) { self->las[lai] = lats[istart++]; if (istart > size - 1) istart = 0; diff --git a/src/grib_iterator_class_gaussian_reduced.c b/src/grib_iterator_class_gaussian_reduced.c index 627a0b316..832b392d7 100644 --- a/src/grib_iterator_class_gaussian_reduced.c +++ b/src/grib_iterator_class_gaussian_reduced.c @@ -26,7 +26,7 @@ IMPLEMENTS = init;next MEMBERS = double *las MEMBERS = double *los - MEMBERS = long nam + MEMBERS = long Nj END_CLASS_DEF */ @@ -58,7 +58,7 @@ typedef struct grib_iterator_gaussian_reduced /* Members defined in gaussian_reduced */ double* las; double* los; - long nam; + long Nj; } grib_iterator_gaussian_reduced; extern grib_iterator_class* grib_iterator_class_gen; diff --git a/src/grib_iterator_class_lambert_azimuthal_equal_area.c b/src/grib_iterator_class_lambert_azimuthal_equal_area.c index 5d23253b2..2a5fb80cc 100644 --- a/src/grib_iterator_class_lambert_azimuthal_equal_area.c +++ b/src/grib_iterator_class_lambert_azimuthal_equal_area.c @@ -26,7 +26,7 @@ IMPLEMENTS = init;next MEMBERS = double *lats MEMBERS = double *lons - MEMBERS = long nam + MEMBERS = long Nj END_CLASS_DEF */ @@ -57,7 +57,7 @@ typedef struct grib_iterator_lambert_azimuthal_equal_area /* Members defined in lambert_azimuthal_equal_area */ double* lats; double* lons; - long nam; + long Nj; } grib_iterator_lambert_azimuthal_equal_area; extern grib_iterator_class* grib_iterator_class_gen; diff --git a/src/grib_iterator_class_lambert_conformal.c b/src/grib_iterator_class_lambert_conformal.c index e0f75d8fe..4ca01506e 100644 --- a/src/grib_iterator_class_lambert_conformal.c +++ b/src/grib_iterator_class_lambert_conformal.c @@ -21,7 +21,7 @@ IMPLEMENTS = init;next MEMBERS = double *lats MEMBERS = double *lons - MEMBERS = long nam + MEMBERS = long Nj END_CLASS_DEF */ @@ -52,7 +52,7 @@ typedef struct grib_iterator_lambert_conformal /* Members defined in lambert_conformal */ double* lats; double* lons; - long nam; + long Nj; } grib_iterator_lambert_conformal; extern grib_iterator_class* grib_iterator_class_gen; diff --git a/src/grib_iterator_class_latlon.c b/src/grib_iterator_class_latlon.c index 25b8fd52e..b28e13e22 100644 --- a/src/grib_iterator_class_latlon.c +++ b/src/grib_iterator_class_latlon.c @@ -47,8 +47,8 @@ typedef struct grib_iterator_latlon /* Members defined in regular */ double* las; double* los; - long nap; - long nam; + long Ni; + long Nj; long iScansNegatively; long isRotated; double angleOfRotation; @@ -102,14 +102,14 @@ static int next(grib_iterator* iter, double* lat, double* lon, double* val) */ if (!self->jPointsAreConsecutive) { /* Adjacent points in i (x) direction are consecutive */ - ret_lat = self->las[(long)floor(iter->e / self->nap)]; - ret_lon = self->los[(long)iter->e % self->nap]; + ret_lat = self->las[(long)floor(iter->e / self->Ni)]; + ret_lon = self->los[(long)iter->e % self->Ni]; ret_val = iter->data[iter->e]; } else { /* Adjacent points in j (y) direction is consecutive */ - ret_lon = self->los[(long)iter->e / self->nam]; - ret_lat = self->las[(long)floor(iter->e % self->nam)]; + ret_lon = self->los[(long)iter->e / self->Nj]; + ret_lat = self->las[(long)floor(iter->e % self->Nj)]; ret_val = iter->data[iter->e]; } @@ -148,7 +148,7 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) self->southPoleLon = 0; self->disableUnrotate = 0; /* unrotate enabled by default */ - if ((err = grib_get_long(h, "is_rotated_grid", &self->isRotated))) + if ((err = grib_get_long(h, "isRotatedGrid", &self->isRotated))) return err; if (self->isRotated) { if ((err = grib_get_double_internal(h, "angleOfRotation", &self->angleOfRotation))) @@ -175,7 +175,7 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) if (grib_is_missing(h, s_jdir, &err) && err == GRIB_SUCCESS) { double lat2; if ((err = grib_get_double_internal(h, "latitudeLastInDegrees", &lat2)) == GRIB_SUCCESS) { - const long Nj = self->nam; + const long Nj = self->Nj; Assert(Nj > 1); if (lat1 > lat2) { jdir = (lat1 - lat2) / (Nj - 1); @@ -190,7 +190,7 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) if (jScansPositively) jdir = -jdir; - for (lai = 0; lai < self->nam; lai++) { + for (lai = 0; lai < self->Nj; lai++) { self->las[lai] = lat1; lat1 -= jdir; } diff --git a/src/grib_iterator_class_polar_stereographic.c b/src/grib_iterator_class_polar_stereographic.c index 4bf22502a..93b2cd660 100644 --- a/src/grib_iterator_class_polar_stereographic.c +++ b/src/grib_iterator_class_polar_stereographic.c @@ -21,7 +21,7 @@ IMPLEMENTS = init;next MEMBERS = double *lats MEMBERS = double *lons - MEMBERS = long nam + MEMBERS = long Nj END_CLASS_DEF */ @@ -52,7 +52,7 @@ typedef struct grib_iterator_polar_stereographic /* Members defined in polar_stereographic */ double* lats; double* lons; - long nam; + long Nj; } grib_iterator_polar_stereographic; extern grib_iterator_class* grib_iterator_class_gen; diff --git a/src/grib_iterator_class_regular.c b/src/grib_iterator_class_regular.c index 64f04c3bf..6697b1eb2 100644 --- a/src/grib_iterator_class_regular.c +++ b/src/grib_iterator_class_regular.c @@ -21,8 +21,8 @@ IMPLEMENTS = init;destroy MEMBERS = double *las MEMBERS = double *los - MEMBERS = long nap - MEMBERS = long nam + MEMBERS = long Ni + MEMBERS = long Nj MEMBERS = long iScansNegatively MEMBERS = long isRotated MEMBERS = double angleOfRotation @@ -62,8 +62,8 @@ typedef struct grib_iterator_regular /* Members defined in regular */ double* las; double* los; - long nap; - long nam; + long Ni; + long Nj; long iScansNegatively; long isRotated; double angleOfRotation; @@ -109,8 +109,8 @@ static int next(grib_iterator* i, double* lat, double* lon, double* val) i->e++; - *lat = self->las[(long)floor(i->e / self->nap)]; - *lon = self->los[(long)i->e % self->nap]; + *lat = self->las[(long)floor(i->e / self->Ni)]; + *lon = self->los[(long)i->e % self->Ni]; *val = i->data[i->e]; return 1; @@ -122,8 +122,8 @@ static int previous(grib_iterator* i, double* lat, double* lon, double* val) if (i->e < 0) return 0; - *lat = self->las[(long)floor(i->e / self->nap)]; - *lon = self->los[i->e % self->nap]; + *lat = self->las[(long)floor(i->e / self->Ni)]; + *lon = self->los[i->e % self->Ni]; *val = i->data[i->e]; i->e--; @@ -168,7 +168,7 @@ static int init(grib_iterator* i, grib_handle* h, grib_arguments* args) if ((ret = grib_get_long_internal(h, s_iScansNeg, &self->iScansNegatively))) return ret; - /* GRIB-801: Careful of case with a single point! nap==1 */ + /* GRIB-801: Careful of case with a single point! Ni==1 */ if (Ni > 1) { /* Note: If first and last longitudes are equal I assume you wanna go round the globe */ if (self->iScansNegatively) { @@ -200,8 +200,8 @@ static int init(grib_iterator* i, grib_handle* h, grib_arguments* args) }*/ } - self->nap = Ni; - self->nam = Nj; + self->Ni = Ni; + self->Nj = Nj; self->las = (double*)grib_context_malloc(h->context, Nj * sizeof(double)); self->los = (double*)grib_context_malloc(h->context, Ni * sizeof(double)); diff --git a/src/grib_iterator_class_space_view.c b/src/grib_iterator_class_space_view.c index 2c26dcc93..99c441a2d 100644 --- a/src/grib_iterator_class_space_view.c +++ b/src/grib_iterator_class_space_view.c @@ -21,7 +21,7 @@ IMPLEMENTS = init;next MEMBERS = double *lats MEMBERS = double *lons - MEMBERS = long nam + MEMBERS = long Nj END_CLASS_DEF */ @@ -52,7 +52,7 @@ typedef struct grib_iterator_space_view /* Members defined in space_view */ double* lats; double* lons; - long nam; + long Nj; } grib_iterator_space_view; extern grib_iterator_class* grib_iterator_class_gen; diff --git a/src/grib_nearest_class_regular.c b/src/grib_nearest_class_regular.c index 75023845c..7e789cc8c 100644 --- a/src/grib_nearest_class_regular.c +++ b/src/grib_nearest_class_regular.c @@ -218,7 +218,7 @@ static int find(grib_nearest* nearest, grib_handle* h, static int is_rotated_grid(grib_handle* h) { long is_rotated = 0; - int err = grib_get_long(h, "is_rotated_grid", &is_rotated); + int err = grib_get_long(h, "isRotatedGrid", &is_rotated); if (!err && is_rotated) return 1; return 0; diff --git a/tests/keys b/tests/keys index 37b2e690e..354177ff1 100644 --- a/tests/keys +++ b/tests/keys @@ -999,17 +999,17 @@ isEps,993 isFillup,994 isHindcast,995 isOctahedral,996 -isSatellite,997 -isSatelliteType,998 -isSens,999 -is_aerosol,1000 -is_aerosol_optical,1001 -is_chemical,1002 -is_chemical_distfn,1003 -is_efas,1004 -is_ocean2d_param,1005 -is_ocean3d_param,1006 -is_rotated_grid,1007 +isRotatedGrid,997 +isSatellite,998 +isSatelliteType,999 +isSens,1000 +is_aerosol,1001 +is_aerosol_optical,1002 +is_chemical,1003 +is_chemical_distfn,1004 +is_efas,1005 +is_ocean2d_param,1006 +is_ocean3d_param,1007 is_s2s,1008 is_tigge,1009 is_uerra,1010 @@ -2363,3 +2363,4 @@ yearOfForecast,2357 yearOfModelVersion,2358 yearOfReference,2359 zero,2360 +zeros,2361 From 76cbb1b84cc99635f0e795efb6b8b89dfcd45282 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 16 May 2020 18:34:35 +0100 Subject: [PATCH 79/82] Latest updates from develop (27) --- CMakeLists.txt | 74 +- Makefile.am | 1 - bamboo/CMakeLists.txt | 6 +- data/CMakeLists.txt | 2 +- data/bufr/CMakeLists.txt | 12 +- data/grib_data_files.txt | 1 + data/gts/CMakeLists.txt | 11 +- data/metar/CMakeLists.txt | 12 +- data/tigge/CMakeLists.txt | 5 +- definitions/CMakeLists.txt | 40 +- definitions/grib1/grid_definition_1.def | 19 + definitions/grib1/grid_definition_193.98.def | 4 +- definitions/grib1/grid_definition_latlon.def | 5 +- .../grib1/localConcepts/ecmf/cfVarName.def | 2 +- .../grib1/localConcepts/ecmf/shortName.def | 2 +- definitions/grib1/section.1.def | 1 + .../localConcepts/ecmf/cfName.legacy.def | 42 + .../grib2/localConcepts/ecmf/cfVarName.def | 2 +- .../localConcepts/ecmf/cfVarName.legacy.def | 120 + .../grib2/localConcepts/ecmf/name.legacy.def | 120 + .../localConcepts/ecmf/paramId.legacy.def | 120 + .../grib2/localConcepts/ecmf/shortName.def | 2 +- .../localConcepts/ecmf/shortName.legacy.def | 120 + .../grib2/localConcepts/ecmf/units.legacy.def | 120 + definitions/grib2/parameters.def | 29 +- definitions/grib2/tables/1.0.table | 5 +- definitions/grib2/tables/25/0.0.table | 19 +- definitions/grib2/tables/25/1.0.table | 3 +- definitions/grib2/tables/25/1.3.table | 16 +- definitions/grib2/tables/25/3.2.table | 6 +- definitions/grib2/tables/25/4.0.table | 140 +- definitions/grib2/tables/25/4.1.20.table | 12 +- definitions/grib2/tables/25/4.1.4.table | 15 + definitions/grib2/tables/25/4.2.0.19.table | 3 +- definitions/grib2/tables/25/4.2.2.3.table | 3 +- definitions/grib2/tables/25/4.2.2.4.table | 14 +- definitions/grib2/tables/25/4.2.2.5.table | 4 + definitions/grib2/tables/25/4.2.20.0.table | 6 +- definitions/grib2/tables/25/4.2.20.1.table | 12 +- definitions/grib2/tables/25/4.2.20.2.table | 6 +- definitions/grib2/tables/25/4.2.4.0.table | 10 + definitions/grib2/tables/25/4.2.4.1.table | 8 + definitions/grib2/tables/25/4.2.4.10.table | 12 + definitions/grib2/tables/25/4.2.4.2.table | 18 + definitions/grib2/tables/25/4.2.4.3.table | 12 + definitions/grib2/tables/25/4.2.4.4.table | 11 + definitions/grib2/tables/25/4.2.4.5.table | 8 + definitions/grib2/tables/25/4.2.4.6.table | 11 + definitions/grib2/tables/25/4.2.4.7.table | 8 + definitions/grib2/tables/25/4.2.4.8.table | 12 + definitions/grib2/tables/25/4.2.4.9.table | 7 + definitions/grib2/tables/25/4.228.table | 8 + definitions/grib2/tables/25/4.240.table | 6 +- definitions/grib2/tables/25/4.5.table | 12 +- definitions/grib2/tables/25/5.0.table | 8 +- definitions/grib2/template.3.10.def | 23 +- definitions/grib2/template.3.140.def | 10 +- definitions/grib2/template.3.20.def | 9 +- definitions/grib2/template.3.30.def | 28 +- definitions/grib2/template.3.90.def | 21 +- definitions/grib2/template.3.latlon.def | 13 +- .../grib2/template.4.point_in_time.def | 1 + examples/C/CMakeLists.txt | 24 +- examples/C/bufr_attributes.c | 4 +- examples/C/bufr_copy_data.c | 8 +- examples/C/bufr_expanded.c | 4 +- examples/C/bufr_get_keys.c | 4 +- examples/C/bufr_get_keys.sh | 8 +- examples/C/bufr_get_string_array.c | 6 +- examples/C/bufr_keys_iterator.c | 6 +- examples/C/bufr_missing.c | 4 +- examples/C/bufr_pthreads.c | 7 +- examples/C/bufr_read_header.c | 4 +- examples/C/bufr_read_scatterometer.c | 10 +- examples/C/bufr_read_synop.c | 5 +- examples/C/bufr_read_temp.c | 10 +- examples/C/bufr_set_keys.c | 4 +- examples/C/bufr_subset.c | 4 +- examples/C/bufr_subset.sh | 18 +- examples/C/get_product_kind.c | 4 +- examples/C/grib_ensemble_index.c | 2 +- examples/C/grib_get_data.c | 10 +- examples/C/grib_get_keys.c | 4 +- examples/C/grib_index.c | 8 +- examples/C/grib_iterator.c | 2 +- examples/C/grib_keys_iterator.c | 4 +- examples/C/grib_list.c | 4 +- examples/C/grib_multi.c | 2 +- examples/C/grib_precipitation.c | 2 +- examples/C/grib_precision.c | 6 +- examples/C/grib_print_data.c | 4 +- examples/C/grib_set_bitmap.c | 9 +- examples/C/grib_set_data.c | 2 +- examples/C/grib_set_keys.c | 6 +- examples/C/include.ctest.sh.in | 2 + examples/C/set_missing.c | 6 +- examples/C/values_check.c | 6 +- examples/F90/CMakeLists.txt | 21 +- examples/F90/get_product_kind.f90 | 8 + examples/F90/include.ctest.sh.in | 2 + examples/python/CMakeLists.txt | 21 +- examples/python/include.ctest.sh.in | 2 + fortran/CMakeLists.txt | 5 +- fortran/eccodes_f90_head.f90 | 1 + fortran/eccodes_settings.h.in | 6 + ifs_samples/grib1/CMakeLists.txt | 3 +- ifs_samples/grib1_mlgrib2/CMakeLists.txt | 3 +- .../grib1_mlgrib2_ieee32/CMakeLists.txt | 3 +- .../grib1_mlgrib2_ieee64/CMakeLists.txt | 3 +- memfs.py | 72 +- memfs/CMakeLists.txt | 23 +- python/CMakeLists.txt | 10 +- python/grib_interface.c | 1825 +++++------ src/CMakeLists.txt | 22 +- src/Makefile.am | 2 + src/action_class_gen.c | 2 +- src/codes_util.c | 11 + src/grib_accessor_class.h | 1 + src/grib_accessor_class_bufr_data_array.c | 17 +- src/grib_accessor_class_bufr_data_element.c | 1 + src/grib_accessor_class_bufr_elements_table.c | 12 + ...cessor_class_bufrdc_expanded_descriptors.c | 1 + src/grib_accessor_class_concept.c | 68 +- ...s_data_g1second_order_row_by_row_packing.c | 1 + ..._accessor_class_data_g2bifourier_packing.c | 8 +- ...grib_accessor_class_expanded_descriptors.c | 4 +- src/grib_accessor_class_g2_mars_labeling.c | 4 +- src/grib_accessor_class_g2latlon.c | 14 +- src/grib_accessor_class_smart_table.c | 2 + src/grib_accessor_class_step_human_readable.c | 199 ++ src/grib_accessor_classes_hash.c | 822 ++--- src/grib_accessor_factory.h | 1 + src/grib_accessor_factory_hash_list | 1 + src/grib_api_prototypes.h | 1 + src/grib_context.c | 37 +- src/grib_dumper_class_bufr_decode_C.c | 19 +- src/grib_dumper_class_bufr_decode_filter.c | 4 +- src/grib_dumper_class_bufr_decode_fortran.c | 4 +- src/grib_dumper_class_bufr_decode_python.c | 4 +- src/grib_dumper_class_bufr_encode_C.c | 14 +- src/grib_dumper_class_bufr_encode_fortran.c | 13 +- src/grib_dumper_class_bufr_encode_python.c | 13 +- src/grib_dumper_class_json.c | 10 +- src/grib_filepool.c | 6 +- src/grib_handle.c | 2 +- src/grib_hash_keys.c | 599 ++-- src/grib_index.c | 4 + src/grib_io.c | 27 +- src/grib_iterator_class.h | 1 + src/grib_iterator_class_lambert_conformal.c | 422 ++- src/grib_iterator_class_latlon.c | 25 +- src/grib_iterator_class_mercator.c | 347 +++ src/grib_iterator_factory.h | 1 + src/grib_lex.c | 425 +-- src/grib_nearest_class_polar_stereographic.c | 5 +- src/grib_nearest_class_reduced.c | 5 +- src/grib_query.c | 6 +- src/grib_yacc.c | 2748 ++++++++--------- src/grib_yacc.h | 303 +- src/gribl.l | 2 +- src/griby.y | 4 +- src/makeyacc | 4 + tests/CMakeLists.txt | 100 +- tests/Makefile.am | 15 +- tests/badgrib.sh | 4 +- tests/bpv_limit.sh | 2 +- tests/bufr_dump_encode_filter.sh | 2 +- tests/bufr_ecc-765.sh | 207 +- tests/bufr_extract_headers.c | 2 +- tests/bufr_threads_ecc-604.c | 193 ++ tests/bufr_threads_ecc-604.sh | 69 + tests/grib1to2.sh | 2 + tests/grib_ecc-1053.sh | 27 + tests/grib_g1fcperiod.sh | 24 + tests/grib_get_fail.sh | 25 + tests/grib_indexing.c | 157 + tests/grib_indexing.sh | 115 + tests/grib_lambert_conformal.sh | 39 +- tests/grib_md5.sh | 29 + tests/grib_mercator.sh | 34 + tests/grib_multi_from_message.c | 10 +- tests/grib_read_index.c | 144 + tests/grib_threads_ecc-604-encode.c | 156 + tests/grib_threads_ecc-604.c | 202 ++ tests/grib_threads_ecc-604.sh | 88 + tests/grib_util_set_spec.sh | 1 + tests/ieee.sh | 3 + tests/include.ctest.sh.in | 6 +- tests/keys | 593 ++-- tests/pseudo_budg.sh | 18 + tests/pseudo_diag.sh | 89 + tests/unit_tests.c | 51 +- tigge/CMakeLists.txt | 14 +- tigge/tigge_check.c | 17 +- tigge/tigge_check.h | 46 +- tools/CMakeLists.txt | 31 +- tools/bufr_compare.c | 4 +- tools/bufr_dump.c | 5 +- tools/codes_count.c | 4 +- tools/grib_options.c | 13 +- tools/grib_to_netcdf.c | 26 +- tools/grib_tools.c | 4 +- .../msvc/grib_api_lib/grib_api_lib.vcxproj | 2 + 203 files changed, 7635 insertions(+), 4799 deletions(-) create mode 100644 definitions/grib2/localConcepts/ecmf/cfName.legacy.def create mode 100644 definitions/grib2/localConcepts/ecmf/cfVarName.legacy.def create mode 100644 definitions/grib2/localConcepts/ecmf/name.legacy.def create mode 100644 definitions/grib2/localConcepts/ecmf/paramId.legacy.def create mode 100644 definitions/grib2/localConcepts/ecmf/shortName.legacy.def create mode 100644 definitions/grib2/localConcepts/ecmf/units.legacy.def create mode 100644 definitions/grib2/tables/25/4.1.4.table create mode 100644 definitions/grib2/tables/25/4.2.4.0.table create mode 100644 definitions/grib2/tables/25/4.2.4.1.table create mode 100644 definitions/grib2/tables/25/4.2.4.10.table create mode 100644 definitions/grib2/tables/25/4.2.4.2.table create mode 100644 definitions/grib2/tables/25/4.2.4.3.table create mode 100644 definitions/grib2/tables/25/4.2.4.4.table create mode 100644 definitions/grib2/tables/25/4.2.4.5.table create mode 100644 definitions/grib2/tables/25/4.2.4.6.table create mode 100644 definitions/grib2/tables/25/4.2.4.7.table create mode 100644 definitions/grib2/tables/25/4.2.4.8.table create mode 100644 definitions/grib2/tables/25/4.2.4.9.table create mode 100644 definitions/grib2/tables/25/4.228.table create mode 100644 fortran/eccodes_settings.h.in create mode 100644 src/grib_accessor_class_step_human_readable.c create mode 100644 src/grib_iterator_class_mercator.c create mode 100644 tests/bufr_threads_ecc-604.c create mode 100755 tests/bufr_threads_ecc-604.sh create mode 100755 tests/grib_ecc-1053.sh create mode 100755 tests/grib_g1fcperiod.sh create mode 100755 tests/grib_get_fail.sh create mode 100644 tests/grib_indexing.c create mode 100755 tests/grib_indexing.sh create mode 100755 tests/grib_md5.sh create mode 100755 tests/grib_mercator.sh create mode 100644 tests/grib_read_index.c create mode 100644 tests/grib_threads_ecc-604-encode.c create mode 100644 tests/grib_threads_ecc-604.c create mode 100755 tests/grib_threads_ecc-604.sh create mode 100755 tests/pseudo_budg.sh create mode 100755 tests/pseudo_diag.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index b6ce30a8e..dd72eb902 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,9 +18,9 @@ cmake_minimum_required( VERSION 3.6 FATAL_ERROR ) -project( eccodes C ) +project( eccodes VERSION 2.18.0 LANGUAGES C ) -set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../ecbuild/cmake") +set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../ecbuild/cmake" ) include( ecbuild_system NO_POLICY_SCOPE ) @@ -34,16 +34,16 @@ ecbuild_declare_project() ############################################################################### # system checks needed for eccodes_config.h and some options like MEMFS -check_type_size( int ECCODES_SIZEOF_INT ) -check_type_size( long ECCODES_SIZEOF_LONG ) +check_type_size( int ECCODES_SIZEOF_INT ) +check_type_size( long ECCODES_SIZEOF_LONG ) check_type_size( size_t ECCODES_SIZEOF_SIZE_T ) -check_include_files( assert.h ECCODES_HAVE_ASSERT_H ) -check_include_files( string.h ECCODES_HAVE_STRING_H ) -check_include_files( sys/types.h ECCODES_HAVE_SYS_TYPES_H ) -check_include_files( sys/stat.h ECCODES_HAVE_SYS_STAT_H ) -check_include_files( fcntl.h ECCODES_HAVE_FCNTL_H ) -check_include_files( unistd.h ECCODES_HAVE_UNISTD_H ) +check_include_files( assert.h ECCODES_HAVE_ASSERT_H ) +check_include_files( string.h ECCODES_HAVE_STRING_H ) +check_include_files( sys/types.h ECCODES_HAVE_SYS_TYPES_H ) +check_include_files( sys/stat.h ECCODES_HAVE_SYS_STAT_H ) +check_include_files( fcntl.h ECCODES_HAVE_FCNTL_H ) +check_include_files( unistd.h ECCODES_HAVE_UNISTD_H ) check_symbol_exists( fseeko "stdio.h" ECCODES_HAVE_FSEEKO ) check_symbol_exists( posix_memalign "stdlib.h" ECCODES_HAVE_POSIX_MEMALIGN ) @@ -55,7 +55,8 @@ check_c_source_compiles( static inline foo_t static_foo(){return 0;} foo_t foo(){return 0;} int main(int argc, char *argv[]){return 0;} - " ECCODES_HAVE_C_INLINE ) + " ECCODES_HAVE_C_INLINE +) include(eccodes_test_endiness) if( EC_OS_NAME MATCHES "windows" ) @@ -71,40 +72,32 @@ ecbuild_info("Operating system=${CMAKE_SYSTEM} (${EC_OS_BITS} bits)") ecbuild_add_option( FEATURE PRODUCT_GRIB DESCRIPTION "Support for the product GRIB" - DEFAULT ON -) + DEFAULT ON ) ecbuild_add_option( FEATURE PRODUCT_BUFR DESCRIPTION "Support for the product BUFR" - DEFAULT ON -) + DEFAULT ON ) ecbuild_add_option( FEATURE EXAMPLES DESCRIPTION "Build the examples" - DEFAULT ON -) + DEFAULT ON ) ecbuild_add_option( FEATURE JPG DESCRIPTION "Support for JPG decoding/encoding" - DEFAULT ON -) + DEFAULT ON ) # Options related to JPG. The Jasper and OpenJPEG libraries ecbuild_add_option( FEATURE JPG_LIBJASPER DESCRIPTION "Support for JPG decoding/encoding with the Jasper library" CONDITION ENABLE_JPG - DEFAULT ON -) + DEFAULT ON ) ecbuild_add_option( FEATURE JPG_LIBOPENJPEG DESCRIPTION "Support for JPG decoding/encoding with the OpenJPEG library" CONDITION ENABLE_JPG - DEFAULT ON -) - + DEFAULT ON ) ecbuild_add_option( FEATURE PNG DESCRIPTION "Support for PNG decoding/encoding" DEFAULT OFF - REQUIRED_PACKAGES PNG -) + REQUIRED_PACKAGES PNG ) if( HAVE_PNG ) set( HAVE_LIBPNG 1 ) # compatibility with autotools @@ -117,31 +110,27 @@ ecbuild_add_option( FEATURE NETCDF DESCRIPTION "Support for GRIB to NetCDF conversion" DEFAULT ON REQUIRED_PACKAGES NetCDF - NO_TPL -) + NO_TPL ) ecbuild_add_option( FEATURE AEC DESCRIPTION "Support for Adaptive Entropy Coding" DEFAULT OFF - REQUIRED_PACKAGES AEC -) + REQUIRED_PACKAGES AEC ) ecbuild_add_option( FEATURE PYTHON DESCRIPTION "Build the ecCodes Python2 interface (deprecated)" DEFAULT ON - REQUIRED_PACKAGES "Python VERSION 2.6 NO_LIBS" NumPy -) + REQUIRED_PACKAGES "Python VERSION 2.6 NO_LIBS" NumPy ) # For Python2 we build our own bindings (using SWIG) in the build directory # but for Python3 one has to add the eccodes from pip3 AFTER the install if( PYTHON_VERSION_MAJOR EQUAL 3 ) set( HAVE_PYTHON 0 ) endif() +## TODO REQUIRED_LANGUAGES Fortran ecbuild_add_option( FEATURE FORTRAN DESCRIPTION "Build the ecCodes Fortran interface" - DEFAULT ON - # REQUIRED_LANGUAGES Fortran # TODO -) + DEFAULT ON ) # TODO Remove this after REQUIRED_LANGUAGES if( ENABLE_FORTRAN ) @@ -158,8 +147,7 @@ ecbuild_add_option( FEATURE MEMFS DESCRIPTION "Memory based access to definitions/samples" DEFAULT OFF CONDITION ECCODES_HAVE_FMEMOPEN OR ECCODES_HAVE_FUNOPEN OR (EC_OS_NAME MATCHES "windows") - REQUIRED_PACKAGES PythonInterp -) + REQUIRED_PACKAGES PythonInterp ) #if( HAVE_MEMFS AND "${CMAKE_C_COMPILER_ID}" STREQUAL "Cray") # set( HAVE_MEMFS OFF ) @@ -177,15 +165,13 @@ endif() # by default, if memfs is available, then we don't need to install definitions ecbuild_add_option( FEATURE INSTALL_ECCODES_DEFINITIONS DESCRIPTION "Install the ecCodes definitions" - DEFAULT ${_will_install_defs_samples} -) + DEFAULT ${_will_install_defs_samples} ) # controls installation of files in samples/ and ifs_samples/ -- note that it still creates the symlinks in the build dir # by default, if memfs is available, then we don't need to install samples ecbuild_add_option( FEATURE INSTALL_ECCODES_SAMPLES DESCRIPTION "Install the ecCodes samples, including IFS samples" - DEFAULT ${_will_install_defs_samples} -) + DEFAULT ${_will_install_defs_samples} ) # advanced options (not visible in cmake-gui ) @@ -213,7 +199,6 @@ set( HAVE_LIBJASPER 0 ) set( HAVE_LIBOPENJPEG 0 ) if( ENABLE_JPG ) - # Note: The function ecbuild_add_extra_search_paths is deprecated but we need it to find Jasper at ECMWF. # It modifies CMAKE_PREFIX_PATH # which can affect future package discovery if not undone by the caller. @@ -412,7 +397,7 @@ add_subdirectory( src ) add_subdirectory( tools ) add_subdirectory( fortran ) -if (PYTHON_VERSION_MAJOR GREATER 2) +if( PYTHON_VERSION_MAJOR GREATER 2 ) # Python3 is no longer built with SWIG but is a separate # package. User should do: pip3 install eccodes #add_subdirectory( python3 ) @@ -433,8 +418,7 @@ ecbuild_dont_pack( DIRS concepts tests.ecmwf doxygen confluence examples.dev templates parameters java perl config m4 rpms gaussian_experimental gribex examples/F77 examples/extra examples/deprecated bamboo fortran/fortranCtypes tigge/tools - share/eccodes .settings python3 -) + share/eccodes .settings python3 ) #ecbuild_dont_pack( DIRS data/bufr DONT_PACK_REGEX "*.bufr" ) #ecbuild_dont_pack( DIRS data/tigge DONT_PACK_REGEX "*.grib" ) diff --git a/Makefile.am b/Makefile.am index b1f45ae85..c2bb328f0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -77,7 +77,6 @@ EXTRA_DIST = README AUTHORS NOTICE LICENSE ChangeLog version.sh html \ perf/time.sh \ CMakeLists.txt \ project_summary.cmake \ - VERSION.cmake \ eccodes_config.h.in \ examples/CMakeLists.txt \ data/CMakeLists.txt \ diff --git a/bamboo/CMakeLists.txt b/bamboo/CMakeLists.txt index 18b8087af..e11c54f6a 100644 --- a/bamboo/CMakeLists.txt +++ b/bamboo/CMakeLists.txt @@ -1,4 +1,6 @@ file( GLOB_RECURSE bamboo_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*" ) -ecbuild_add_resources( TARGET ${PROJECT_NAME}_bamboo - SOURCES_DONT_PACK ${bamboo_files} ) +ecbuild_add_resources( + TARGET ${PROJECT_NAME}_bamboo + SOURCES_DONT_PACK ${bamboo_files} +) diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index fb7e145fc..263e1c32d 100644 --- a/data/CMakeLists.txt +++ b/data/CMakeLists.txt @@ -21,7 +21,7 @@ if( ENABLE_EXTRA_TESTS ) endif() # Copy other files - e.g. reference data, text files etc from the source data dir -LIST(APPEND other_files +list(APPEND other_files 60_model_levels bitmap.diff ieee_test.good diff --git a/data/bufr/CMakeLists.txt b/data/bufr/CMakeLists.txt index 35b33c9f1..148500ed9 100644 --- a/data/bufr/CMakeLists.txt +++ b/data/bufr/CMakeLists.txt @@ -2,17 +2,17 @@ # Download all the BUFR data and reference files from website # -FILE(READ "bufr_data_files.txt" bufr_files_to_download) +file(READ "bufr_data_files.txt" bufr_files_to_download) # Convert file contents into a CMake list (where each element in the list # is one line of the file) -STRING(REGEX REPLACE "\n" ";" bufr_files_to_download "${bufr_files_to_download}") +string(REGEX REPLACE "\n" ";" bufr_files_to_download "${bufr_files_to_download}") -FILE(READ "bufr_ref_files.txt" bufr_refs_to_download) -STRING(REGEX REPLACE "\n" ";" bufr_refs_to_download "${bufr_refs_to_download}") +file(READ "bufr_ref_files.txt" bufr_refs_to_download) +string(REGEX REPLACE "\n" ";" bufr_refs_to_download "${bufr_refs_to_download}") # Exceptional case: download bufr files which have to be treated specially -LIST(APPEND bufr_refs_to_download "vos308014_v3_26.bufr") # See test ecc-197 +list(APPEND bufr_refs_to_download "vos308014_v3_26.bufr") # See test ecc-197 if( ENABLE_EXTRA_TESTS ) ecbuild_get_test_multidata( @@ -23,7 +23,7 @@ if( ENABLE_EXTRA_TESTS ) endif() # Copy other files - e.g. text files etc from the source data/bufr dir -LIST(APPEND other_files +list(APPEND other_files bufr_data_files.txt bufr_ref_files.txt ) diff --git a/data/grib_data_files.txt b/data/grib_data_files.txt index 43b767449..2774f12c7 100644 --- a/data/grib_data_files.txt +++ b/data/grib_data_files.txt @@ -87,3 +87,4 @@ v.grib2 msl.octa.glob.grib1 test_file.grib2 gfs.complex.mvmu.grib2 +mercator.grib2 diff --git a/data/gts/CMakeLists.txt b/data/gts/CMakeLists.txt index ed537fbb4..417684f21 100644 --- a/data/gts/CMakeLists.txt +++ b/data/gts/CMakeLists.txt @@ -1,12 +1,11 @@ # data/gts/CMakeLists.txt # Download all the GTS data and reference files from website # +file(READ "gts_data_files.txt" gts_files_to_download) +string(REGEX REPLACE "\n" ";" gts_files_to_download "${gts_files_to_download}") -FILE(READ "gts_data_files.txt" gts_files_to_download) -STRING(REGEX REPLACE "\n" ";" gts_files_to_download "${gts_files_to_download}") - -FILE(READ "gts_ref_files.txt" gts_refs_to_download) -STRING(REGEX REPLACE "\n" ";" gts_refs_to_download "${gts_refs_to_download}") +file(READ "gts_ref_files.txt" gts_refs_to_download) +string(REGEX REPLACE "\n" ";" gts_refs_to_download "${gts_refs_to_download}") if( ENABLE_EXTRA_TESTS ) ecbuild_get_test_multidata( @@ -17,7 +16,7 @@ if( ENABLE_EXTRA_TESTS ) endif() # Copy other files - e.g. text files etc from the source data/gts dir -LIST(APPEND other_files +list(APPEND other_files gts_data_files.txt gts_ref_files.txt ) diff --git a/data/metar/CMakeLists.txt b/data/metar/CMakeLists.txt index feaa71ef3..9ed771b4a 100644 --- a/data/metar/CMakeLists.txt +++ b/data/metar/CMakeLists.txt @@ -2,15 +2,13 @@ # Download all the METAR data and reference files from website # -FILE(READ "metar_data_files.txt" metar_files_to_download) +file(READ "metar_data_files.txt" metar_files_to_download) # Convert file contents into a CMake list (where each element in the list # is one line of the file) -STRING(REGEX REPLACE "\n" ";" metar_files_to_download "${metar_files_to_download}") - - -FILE(READ "metar_ref_files.txt" metar_refs_to_download) -STRING(REGEX REPLACE "\n" ";" metar_refs_to_download "${metar_refs_to_download}") +string(REGEX REPLACE "\n" ";" metar_files_to_download "${metar_files_to_download}") +file(READ "metar_ref_files.txt" metar_refs_to_download) +string(REGEX REPLACE "\n" ";" metar_refs_to_download "${metar_refs_to_download}") if( ENABLE_EXTRA_TESTS ) ecbuild_get_test_multidata( @@ -21,7 +19,7 @@ if( ENABLE_EXTRA_TESTS ) endif() # Copy other files - e.g. text files etc from the source data/metar dir -LIST(APPEND other_files +list(APPEND other_files metar_data_files.txt metar_ref_files.txt ) diff --git a/data/tigge/CMakeLists.txt b/data/tigge/CMakeLists.txt index 0af0b0715..7e55920b0 100644 --- a/data/tigge/CMakeLists.txt +++ b/data/tigge/CMakeLists.txt @@ -13,9 +13,8 @@ endif() ####### # Copy other files - e.g. reference data, text files etc from the source data dir -LIST(APPEND other_files - tigge_data_files.txt -) +list(APPEND other_files + tigge_data_files.txt) foreach( file ${other_files} ) execute_process( COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/${file} ${CMAKE_CURRENT_BINARY_DIR} ) endforeach() diff --git a/definitions/CMakeLists.txt b/definitions/CMakeLists.txt index 85eb4e031..bd3864d6d 100644 --- a/definitions/CMakeLists.txt +++ b/definitions/CMakeLists.txt @@ -23,25 +23,23 @@ foreach( child ${children} ) endif() endforeach() -if(HAVE_INSTALL_ECCODES_DEFINITIONS) - +if( HAVE_INSTALL_ECCODES_DEFINITIONS ) install( FILES ${definition_files} ${table_files} ${text_files} DESTINATION ${ECCODES_DEFINITION_SUFF} PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ ) install( FILES installDefinitions.sh - DESTINATION ${ECCODES_DEFINITION_SUFF}) - - install( DIRECTORY ${dirlist} - DESTINATION ${ECCODES_DEFINITION_SUFF} - FILES_MATCHING - PATTERN "*.def" - PATTERN "*.txt" - PATTERN "*.list" - PATTERN "*.table" - PATTERN "4.2.192.*.table" EXCLUDE - PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ ) + DESTINATION ${ECCODES_DEFINITION_SUFF} ) + install( DIRECTORY ${dirlist} + DESTINATION ${ECCODES_DEFINITION_SUFF} + FILES_MATCHING + PATTERN "*.def" + PATTERN "*.txt" + PATTERN "*.list" + PATTERN "*.table" + PATTERN "4.2.192.*.table" EXCLUDE + PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ ) endif() # link to the definitions. See GRIB-786 @@ -55,11 +53,11 @@ endif() # copy the definitions to the build directory #file( COPY ${definition_files} ${table_files} ${text_files} # DESTINATION ${CMAKE_BINARY_DIR}/${ECCODES_DEFINITION_SUFF} ) -#file( COPY budg bufr cdf common grib1 grib2 grib3 gts mars metar tide hdf5 wrap -# DESTINATION ${CMAKE_BINARY_DIR}/${ECCODES_DEFINITION_SUFF} -# FILES_MATCHING -# PATTERN "*.def" -# PATTERN "*.txt" -# PATTERN "*.list" -# PATTERN "*.table" -# PATTERN "4.2.192.*.table" EXCLUDE ) +#file(COPY budg bufr cdf common grib1 grib2 grib3 gts mars metar tide hdf5 wrap +# DESTINATION ${CMAKE_BINARY_DIR}/${ECCODES_DEFINITION_SUFF} +# FILES_MATCHING +# PATTERN "*.def" +# PATTERN "*.txt" +# PATTERN "*.list" +# PATTERN "*.table" +# PATTERN "4.2.192.*.table" EXCLUDE ) diff --git a/definitions/grib1/grid_definition_1.def b/definitions/grib1/grid_definition_1.def index 5f179a108..d2439db9e 100644 --- a/definitions/grib1/grid_definition_1.def +++ b/definitions/grib1/grid_definition_1.def @@ -47,3 +47,22 @@ meta numberOfDataPoints number_of_points(Ni,Nj) : dump; alias numberOfPoints=numberOfDataPoints; meta numberOfValues number_of_values(values,bitsPerValue,numberOfDataPoints,bitmapPresent,bitmap,numberOfCodedValues) : dump; #alias ls.valuesCount=numberOfValues; + +iterator mercator(numberOfPoints,missingValue,values, + radius,Ni,Nj, + latitudeOfFirstGridPointInDegrees, longitudeOfFirstGridPointInDegrees, + LaDInDegrees, + latitudeOfLastGridPointInDegrees, longitudeOfLastGridPointInDegrees, + orientationOfTheGridInDegrees, + DiInMetres,DjInMetres, + iScansNegatively, + jScansPositively, + jPointsAreConsecutive, + alternativeRowScanning); + +meta latLonValues latlonvalues(values); +alias latitudeLongitudeValues=latLonValues; +meta latitudes latitudes(values,0); +meta longitudes longitudes(values,0); +meta distinctLatitudes latitudes(values,1); +meta distinctLongitudes longitudes(values,1); diff --git a/definitions/grib1/grid_definition_193.98.def b/definitions/grib1/grid_definition_193.98.def index c824b8465..534c51646 100644 --- a/definitions/grib1/grid_definition_193.98.def +++ b/definitions/grib1/grid_definition_193.98.def @@ -81,7 +81,9 @@ if(missing(Ni)){ transient iteratorDisableUnrotate = 0 : hidden; # ECC-808 iterator latlon(numberOfPoints,missingValue,values,longitudeFirstInDegrees,iInc , Ni,Nj,iScansNegatively , - latitudeFirstInDegrees,DjInDegrees,jScansPositively ); + latitudeFirstInDegrees,DjInDegrees,jScansPositively,jPointsAreConsecutive, + isRotatedGrid, angleOfRotation, + latitudeOfSouthernPoleInDegrees,longitudeOfSouthernPoleInDegrees); nearest regular(values,radius,Ni,Nj); } meta latLonValues latlonvalues(values); diff --git a/definitions/grib1/grid_definition_latlon.def b/definitions/grib1/grid_definition_latlon.def index e8fe6159c..552836fcf 100644 --- a/definitions/grib1/grid_definition_latlon.def +++ b/definitions/grib1/grid_definition_latlon.def @@ -50,7 +50,10 @@ if(missing(Ni)){ transient iteratorDisableUnrotate = 0 : hidden; # ECC-808 iterator latlon(numberOfPoints,missingValue,values,longitudeFirstInDegrees, DiInDegrees ,Ni,Nj,iScansNegatively , - latitudeFirstInDegrees,DjInDegrees,jScansPositively,jPointsAreConsecutive); + latitudeFirstInDegrees,DjInDegrees, + jScansPositively,jPointsAreConsecutive, + isRotatedGrid, angleOfRotation, + latitudeOfSouthernPoleInDegrees,longitudeOfSouthernPoleInDegrees); nearest regular(values,radius,Ni,Nj); } diff --git a/definitions/grib1/localConcepts/ecmf/cfVarName.def b/definitions/grib1/localConcepts/ecmf/cfVarName.def index 8d7a0369b..40549c858 100644 --- a/definitions/grib1/localConcepts/ecmf/cfVarName.def +++ b/definitions/grib1/localConcepts/ecmf/cfVarName.def @@ -13910,7 +13910,7 @@ indicatorOfParameter = 54 ; } #Mean 2 metre temperature in the last 24 hours anomaly -'mn2t24a' = { +'mean2t24a' = { table2Version = 171 ; indicatorOfParameter = 55 ; } diff --git a/definitions/grib1/localConcepts/ecmf/shortName.def b/definitions/grib1/localConcepts/ecmf/shortName.def index 01113ad30..c6bbdf88d 100644 --- a/definitions/grib1/localConcepts/ecmf/shortName.def +++ b/definitions/grib1/localConcepts/ecmf/shortName.def @@ -13910,7 +13910,7 @@ indicatorOfParameter = 54 ; } #Mean 2 metre temperature in the last 24 hours anomaly -'mn2t24a' = { +'mean2t24a' = { table2Version = 171 ; indicatorOfParameter = 55 ; } diff --git a/definitions/grib1/section.1.def b/definitions/grib1/section.1.def index 9b042aae9..91f891a41 100644 --- a/definitions/grib1/section.1.def +++ b/definitions/grib1/section.1.def @@ -210,6 +210,7 @@ _if (stepType is "instant" ) { meta stepRange g1step_range(P1,P2,timeRangeIndicator,unitOfTimeRange,stepUnits,stepType) : dump; meta startStep long_vector(stepRange,0) : dump,no_copy; meta endStep long_vector(stepRange,1) : dump,no_copy; +meta stepHumanReadable step_human_readable(stepUnits, stepRange): hidden,no_copy; alias stepInHours = endStep; alias ls.stepRange = stepRange; diff --git a/definitions/grib2/localConcepts/ecmf/cfName.legacy.def b/definitions/grib2/localConcepts/ecmf/cfName.legacy.def new file mode 100644 index 000000000..1596928bf --- /dev/null +++ b/definitions/grib2/localConcepts/ecmf/cfName.legacy.def @@ -0,0 +1,42 @@ +#Surface net solar radiation, clear sky +'surface_net_downward_shortwave_flux_assuming_clear_sky' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 210 ; +} +#Surface net thermal radiation, clear sky +'surface_net_downward_longwave_flux_assuming_clear_sky' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 211 ; +} +#Eastward sea water velocity +'eastward_sea_water_velocity' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 131 ; +} +#Northward sea water velocity +'northward_sea_water_velocity' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 132 ; +} +#Sea-ice thickness +'sea_ice_thickness' = { + discipline = 192 ; + parameterCategory = 174 ; + parameterNumber = 98 ; +} +#Sea surface height +'sea_surface_height_above_geoid' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 145 ; +} +#Depth of 20C isotherm +'depth_of_isosurface_of_sea_water_potential_temperature' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 163 ; +} diff --git a/definitions/grib2/localConcepts/ecmf/cfVarName.def b/definitions/grib2/localConcepts/ecmf/cfVarName.def index 75ca27689..5a4b2ab9b 100644 --- a/definitions/grib2/localConcepts/ecmf/cfVarName.def +++ b/definitions/grib2/localConcepts/ecmf/cfVarName.def @@ -17983,7 +17983,7 @@ parameterNumber = 54 ; } #Mean 2 metre temperature in the last 24 hours anomaly -'mn2t24a' = { +'mean2t24a' = { discipline = 192 ; parameterCategory = 171 ; parameterNumber = 55 ; diff --git a/definitions/grib2/localConcepts/ecmf/cfVarName.legacy.def b/definitions/grib2/localConcepts/ecmf/cfVarName.legacy.def new file mode 100644 index 000000000..40cabda6c --- /dev/null +++ b/definitions/grib2/localConcepts/ecmf/cfVarName.legacy.def @@ -0,0 +1,120 @@ +#Surface net solar radiation, clear sky +'ssrc' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 210 ; +} +#Surface net thermal radiation, clear sky +'strc' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 211 ; +} +#Eastward sea water velocity +'uoe' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 131 ; +} +#Northward sea water velocity +'von' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 132 ; +} +#Sea-ice thickness +'sithick' = { + discipline = 192 ; + parameterCategory = 174 ; + parameterNumber = 98 ; +} +#Sea surface height +'zos' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 145 ; +} +#100 metre U wind component +'u100' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 246 ; +} +#100 metre V wind component +'v100' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 247 ; +} +#100 metre wind speed +'si100' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 249 ; +} +#0 degrees C isothermal level (atm) +'deg0l' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 24 ; +} +#Depth of 20C isotherm +'t20d' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 163 ; +} +#Average salinity in the upper 300m +'sav300' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 175 ; +} +#Total precipitation of at least 1 mm +'tpg1' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 60 ; +} +#Total precipitation of at least 5 mm +'tpg5' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 61 ; +} +#Total precipitation of at least 40 mm +'tpg40' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 82 ; +} +#Total precipitation of at least 60 mm +'tpg60' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 83 ; +} +#Total precipitation of at least 80 mm +'tpg80' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 84 ; +} +#Total precipitation of at least 150 mm +'tpg150' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 86 ; +} +#Total precipitation of at least 200 mm +'tpg200' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 87 ; +} +#Total precipitation of at least 300 mm +'tpg300' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 88 ; +} diff --git a/definitions/grib2/localConcepts/ecmf/name.legacy.def b/definitions/grib2/localConcepts/ecmf/name.legacy.def new file mode 100644 index 000000000..76b0150ad --- /dev/null +++ b/definitions/grib2/localConcepts/ecmf/name.legacy.def @@ -0,0 +1,120 @@ +#Surface net solar radiation, clear sky +'Surface net solar radiation, clear sky' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 210 ; +} +#Surface net thermal radiation, clear sky +'Surface net thermal radiation, clear sky' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 211 ; +} +#Eastward sea water velocity +'Eastward sea water velocity' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 131 ; +} +#Northward sea water velocity +'Northward sea water velocity' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 132 ; +} +#Sea-ice thickness +'Sea-ice thickness' = { + discipline = 192 ; + parameterCategory = 174 ; + parameterNumber = 98 ; +} +#Sea surface height +'Sea surface height' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 145 ; +} +#100 metre U wind component +'100 metre U wind component' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 246 ; +} +#100 metre V wind component +'100 metre V wind component' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 247 ; +} +#100 metre wind speed +'100 metre wind speed' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 249 ; +} +#0 degrees C isothermal level (atm) +'0 degrees C isothermal level (atm)' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 24 ; +} +#Depth of 20C isotherm +'Depth of 20C isotherm' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 163 ; +} +#Average salinity in the upper 300m +'Average salinity in the upper 300m' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 175 ; +} +#Total precipitation of at least 1 mm +'Total precipitation of at least 1 mm' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 60 ; +} +#Total precipitation of at least 5 mm +'Total precipitation of at least 5 mm' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 61 ; +} +#Total precipitation of at least 40 mm +'Total precipitation of at least 40 mm' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 82 ; +} +#Total precipitation of at least 60 mm +'Total precipitation of at least 60 mm' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 83 ; +} +#Total precipitation of at least 80 mm +'Total precipitation of at least 80 mm' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 84 ; +} +#Total precipitation of at least 150 mm +'Total precipitation of at least 150 mm' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 86 ; +} +#Total precipitation of at least 200 mm +'Total precipitation of at least 200 mm' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 87 ; +} +#Total precipitation of at least 300 mm +'Total precipitation of at least 300 mm' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 88 ; +} diff --git a/definitions/grib2/localConcepts/ecmf/paramId.legacy.def b/definitions/grib2/localConcepts/ecmf/paramId.legacy.def new file mode 100644 index 000000000..541691902 --- /dev/null +++ b/definitions/grib2/localConcepts/ecmf/paramId.legacy.def @@ -0,0 +1,120 @@ +#Surface net solar radiation, clear sky +'210' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 210 ; +} +#Surface net thermal radiation, clear sky +'211' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 211 ; +} +#Eastward sea water velocity +'151131' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 131 ; +} +#Northward sea water velocity +'151132' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 132 ; +} +#Sea-ice thickness +'174098' = { + discipline = 192 ; + parameterCategory = 174 ; + parameterNumber = 98 ; +} +#Sea surface height +'151145' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 145 ; +} +#100 metre U wind component +'228246' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 246 ; +} +#100 metre V wind component +'228247' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 247 ; +} +#100 metre wind speed +'228249' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 249 ; +} +#0 degrees C isothermal level (atm) +'228024' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 24 ; +} +#Depth of 20C isotherm +'151163' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 163 ; +} +#Average salinity in the upper 300m +'151175' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 175 ; +} +#Total precipitation of at least 1 mm +'131060' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 60 ; +} +#Total precipitation of at least 5 mm +'131061' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 61 ; +} +#Total precipitation of at least 40 mm +'131082' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 82 ; +} +#Total precipitation of at least 60 mm +'131083' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 83 ; +} +#Total precipitation of at least 80 mm +'131084' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 84 ; +} +#Total precipitation of at least 150 mm +'131086' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 86 ; +} +#Total precipitation of at least 200 mm +'131087' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 87 ; +} +#Total precipitation of at least 300 mm +'131088' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 88 ; +} diff --git a/definitions/grib2/localConcepts/ecmf/shortName.def b/definitions/grib2/localConcepts/ecmf/shortName.def index c7d270334..78b8e5e70 100644 --- a/definitions/grib2/localConcepts/ecmf/shortName.def +++ b/definitions/grib2/localConcepts/ecmf/shortName.def @@ -17983,7 +17983,7 @@ parameterNumber = 54 ; } #Mean 2 metre temperature in the last 24 hours anomaly -'mn2t24a' = { +'mean2t24a' = { discipline = 192 ; parameterCategory = 171 ; parameterNumber = 55 ; diff --git a/definitions/grib2/localConcepts/ecmf/shortName.legacy.def b/definitions/grib2/localConcepts/ecmf/shortName.legacy.def new file mode 100644 index 000000000..866775017 --- /dev/null +++ b/definitions/grib2/localConcepts/ecmf/shortName.legacy.def @@ -0,0 +1,120 @@ +#Surface net solar radiation, clear sky +'ssrc' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 210 ; +} +#Surface net thermal radiation, clear sky +'strc' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 211 ; +} +#Eastward sea water velocity +'ocu' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 131 ; +} +#Northward sea water velocity +'ocv' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 132 ; +} +#Sea-ice thickness +'sithick' = { + discipline = 192 ; + parameterCategory = 174 ; + parameterNumber = 98 ; +} +#Sea surface height +'zos' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 145 ; +} +#100 metre U wind component +'100u' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 246 ; +} +#100 metre V wind component +'100v' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 247 ; +} +#100 metre wind speed +'100si' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 249 ; +} +#0 degrees C isothermal level (atm) +'deg0l' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 24 ; +} +#Depth of 20C isotherm +'t20d' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 163 ; +} +#Average salinity in the upper 300m +'sav300' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 175 ; +} +#Total precipitation of at least 1 mm +'tpg1' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 60 ; +} +#Total precipitation of at least 5 mm +'tpg5' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 61 ; +} +#Total precipitation of at least 40 mm +'tpg40' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 82 ; +} +#Total precipitation of at least 60 mm +'tpg60' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 83 ; +} +#Total precipitation of at least 80 mm +'tpg80' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 84 ; +} +#Total precipitation of at least 150 mm +'tpg150' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 86 ; +} +#Total precipitation of at least 200 mm +'tpg200' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 87 ; +} +#Total precipitation of at least 300 mm +'tpg300' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 88 ; +} diff --git a/definitions/grib2/localConcepts/ecmf/units.legacy.def b/definitions/grib2/localConcepts/ecmf/units.legacy.def new file mode 100644 index 000000000..74dcf7491 --- /dev/null +++ b/definitions/grib2/localConcepts/ecmf/units.legacy.def @@ -0,0 +1,120 @@ +#Surface net solar radiation, clear sky +'J m**-2' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 210 ; +} +#Surface net thermal radiation, clear sky +'J m**-2' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 211 ; +} +#Eastward sea water velocity +'m s**-1' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 131 ; +} +#Northward sea water velocity +'m s**-1' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 132 ; +} +#Sea-ice thickness +'m' = { + discipline = 192 ; + parameterCategory = 174 ; + parameterNumber = 98 ; +} +#Sea surface height +'m' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 145 ; +} +#100 metre U wind component +'m s**-1' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 246 ; +} +#100 metre V wind component +'m s**-1' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 247 ; +} +#100 metre wind speed +'m s**-1' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 249 ; +} +#0 degrees C isothermal level (atm) +'m' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 24 ; +} +#Depth of 20C isotherm +'m' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 163 ; +} +#Average salinity in the upper 300m +'psu' = { + discipline = 192 ; + parameterCategory = 151 ; + parameterNumber = 175 ; +} +#Total precipitation of at least 1 mm +'%' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 60 ; +} +#Total precipitation of at least 5 mm +'%' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 61 ; +} +#Total precipitation of at least 40 mm +'%' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 82 ; +} +#Total precipitation of at least 60 mm +'%' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 83 ; +} +#Total precipitation of at least 80 mm +'%' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 84 ; +} +#Total precipitation of at least 150 mm +'%' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 86 ; +} +#Total precipitation of at least 200 mm +'%' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 87 ; +} +#Total precipitation of at least 300 mm +'%' = { + discipline = 192 ; + parameterCategory = 131 ; + parameterNumber = 88 ; +} diff --git a/definitions/grib2/parameters.def b/definitions/grib2/parameters.def index 500c6d27c..03e3399ad 100644 --- a/definitions/grib2/parameters.def +++ b/definitions/grib2/parameters.def @@ -5,24 +5,29 @@ constant conceptsMasterDir="grib2" : hidden; constant conceptsLocalDirAll="grib2/localConcepts/[centre:s]" : hidden; constant conceptsLocalDirECMF="grib2/localConcepts/ecmf" : hidden; -concept paramIdECMF (defaultParameter,"paramId.def",conceptsMasterDir,conceptsLocalDirECMF): long_type,no_copy; +concept paramIdLegacyECMF(defaultParameter,"paramId.legacy.def",conceptsMasterDir,conceptsLocalDirECMF): long_type,no_copy,hidden; +concept paramIdECMF (paramIdLegacyECMF,"paramId.def",conceptsMasterDir,conceptsLocalDirECMF): long_type,no_copy; concept paramId (paramIdECMF,"paramId.def",conceptsMasterDir,conceptsLocalDirAll): long_type; -# transient pid = paramId : hidden; -concept shortNameECMF (defaultShortName,"shortName.def",conceptsMasterDir,conceptsLocalDirECMF) : no_copy,dump; -concept ls.shortName (shortNameECMF,"shortName.def",conceptsMasterDir,conceptsLocalDirAll) : no_copy,dump; +concept shortNameLegacyECMF(defaultShortName,"shortName.legacy.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy,dump,hidden; +concept shortNameECMF (shortNameLegacyECMF,"shortName.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy,dump; +concept ls.shortName (shortNameECMF,"shortName.def",conceptsMasterDir,conceptsLocalDirAll): no_copy,dump; -concept unitsECMF (defaultName,"units.def",conceptsMasterDir,conceptsLocalDirECMF) : no_copy; -concept units (unitsECMF,"units.def",conceptsMasterDir,conceptsLocalDirAll) : no_copy; +concept unitsLegacyECMF(defaultName,"units.legacy.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy,hidden; +concept unitsECMF (unitsLegacyECMF,"units.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy; +concept units (unitsECMF,"units.def",conceptsMasterDir,conceptsLocalDirAll): no_copy; -concept nameECMF (defaultName,"name.def",conceptsMasterDir,conceptsLocalDirECMF) : no_copy,dump; -concept name (nameECMF,"name.def",conceptsMasterDir,conceptsLocalDirAll) : no_copy,dump; +concept nameLegacyECMF(defaultName,"name.legacy.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy,dump,hidden; +concept nameECMF(nameLegacyECMF,"name.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy,dump; +concept name(nameECMF,"name.def",conceptsMasterDir,conceptsLocalDirAll): no_copy,dump; -concept cfNameECMF (defaultShortName,"cfName.def",conceptsMasterDir,conceptsLocalDirECMF) : no_copy,dump; -concept cfName (cfNameECMF,"cfName.def",conceptsMasterDir,conceptsLocalDirAll) : no_copy,dump; +concept cfNameLegacyECMF(defaultShortName,"cfName.legacy.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy,dump,hidden; +concept cfNameECMF(cfNameLegacyECMF,"cfName.def",conceptsMasterDir,conceptsLocalDirECMF) : no_copy,dump; +concept cfName(cfNameECMF,"cfName.def",conceptsMasterDir,conceptsLocalDirAll) : no_copy,dump; -concept cfVarNameECMF (defaultShortName,"cfVarName.def",conceptsMasterDir,conceptsLocalDirECMF) : no_copy,dump; -concept cfVarName (cfVarNameECMF,"cfVarName.def",conceptsMasterDir,conceptsLocalDirAll) : no_copy,dump; +concept cfVarNameLegacyECMF(defaultShortName,"cfVarName.legacy.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy,dump,hidden; +concept cfVarNameECMF (cfVarNameLegacyECMF,"cfVarName.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy,dump; +concept cfVarName (cfVarNameECMF,"cfVarName.def",conceptsMasterDir,conceptsLocalDirAll): no_copy,dump; # modelName: Contribution from Daniel Lee @ DWD concept modelName (defaultName,"modelName.def",conceptsMasterDir,conceptsLocalDirAll): no_copy,dump,read_only; diff --git a/definitions/grib2/tables/1.0.table b/definitions/grib2/tables/1.0.table index 10baa8a0a..8203f4bb9 100644 --- a/definitions/grib2/tables/1.0.table +++ b/definitions/grib2/tables/1.0.table @@ -24,6 +24,7 @@ 22 22 Version implemented on 7 November 2018 23 23 Version implemented on 15 May 2019 24 24 Version implemented on 6 November 2019 -25 25 Pre-operational to be implemented by next amendment -# 25-254 Future versions +25 25 Version implemented on 6 May 2020 +26 26 Pre-operational to be implemented by next amendment +# 27-254 Future versions 255 255 Master tables not used. Local table entries and local templates may use the entire range of the table, not just those sections marked Reserved for local used. diff --git a/definitions/grib2/tables/25/0.0.table b/definitions/grib2/tables/25/0.0.table index 56a45f249..a3097cd30 100644 --- a/definitions/grib2/tables/25/0.0.table +++ b/definitions/grib2/tables/25/0.0.table @@ -1,10 +1,13 @@ # Code table 0.0 - Discipline of processed data in the GRIB message, number of GRIB Master table -0 0 Meteorological products -1 1 Hydrological products -2 2 Land surface products -3 3 Satellite remote sensing products (formerly Space products) -4 4 Space weather products -10 10 Oceanographic products +0 0 Meteorological products +1 1 Hydrological products +2 2 Land surface products +3 3 Satellite remote sensing products (formerly Space products) +4 4 Space weather products +# 5-9 Reserved +10 10 Oceanographic products +# 11-19 Reserved 20 20 Health and socioeconomic impacts -# 192-254 Reserved for local use -255 255 Missing +# 21-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/1.0.table b/definitions/grib2/tables/25/1.0.table index e2fa20abe..a6e370f40 100644 --- a/definitions/grib2/tables/25/1.0.table +++ b/definitions/grib2/tables/25/1.0.table @@ -24,5 +24,6 @@ 22 22 Version implemented on 7 November 2018 23 23 Version implemented on 15 May 2019 24 24 Version implemented on 6 November 2019 -# 25-254 Future versions +25 25 Version implemented on 6 May 2020 +# 26-254 Future versions 255 255 Master tables not used. Local table entries and local templates may use the entire range of the table, not just those sections marked Reserved for local used. diff --git a/definitions/grib2/tables/25/1.3.table b/definitions/grib2/tables/25/1.3.table index dd7e68132..a5bd99e5b 100644 --- a/definitions/grib2/tables/25/1.3.table +++ b/definitions/grib2/tables/25/1.3.table @@ -1,16 +1,16 @@ # Code table 1.3 - Production status of data -0 0 Operational products -1 1 Operational test products -2 2 Research products -3 3 Re-analysis products -4 4 THORPEX Interactive Grand Global Ensemble (TIGGE) +0 0 Operational products +1 1 Operational test products +2 2 Research products +3 3 Re-analysis products +4 4 THORPEX Interactive Grand Global Ensemble (TIGGE) 5 5 THORPEX Interactive Grand Global Ensemble test (TIGGE) -6 6 S2S operational products -7 7 S2S test products +6 6 S2S operational products +7 7 S2S test products 8 8 Uncertainties in Ensembles of Regional ReAnalyses project (UERRA) 9 9 Uncertainties in Ensembles of Regional ReAnalyses project test (UERRA) 10 10 Copernicus regional reanalysis (CARRA/CERRA) 11 11 Copernicus regional reanalysis test (CARRA/CERRA) -# 12-191 Reserved +# 12-191 Reserved # 192-254 Reserved for local use 255 255 Missing diff --git a/definitions/grib2/tables/25/3.2.table b/definitions/grib2/tables/25/3.2.table index 1b5c8241d..4ad56569f 100644 --- a/definitions/grib2/tables/25/3.2.table +++ b/definitions/grib2/tables/25/3.2.table @@ -1,4 +1,4 @@ -# Code table 3.2 - Shape of the Earth +# Code table 3.2 - Shape of the reference system 0 0 Earth assumed spherical with radius = 6 367 470.0 m 1 1 Earth assumed spherical with radius specified (in m) by data producer 2 2 Earth assumed oblate spheroid with size as determined by IAU in 1965 (major axis = 6 378 160.0 m, minor axis = 6 356 775.0 m, f = 1/297.0) @@ -9,6 +9,8 @@ 7 7 Earth assumed oblate spheroid with major or minor axes specified (in m) by data producer 8 8 Earth model assumed spherical with radius of 6 371 200 m, but the horizontal datum of the resulting latitude/longitude field is the WGS-84 reference frame 9 9 Earth represented by the Ordnance Survey Great Britain 1936 Datum, using the Airy 1830 Spheroid, the Greenwich meridian as 0 longitude, and the Newlyn datum as mean sea level, 0 height -# 10-191 Reserved +10 10 Earth model assumed WGS84 with corrected geomagnetic coordinates (latitude and longitude) defined by Gustafsson et al., 1992 +11 11 Sun assumed spherical with radius = 695,990,000 m (Allen, C.W., 1976 Astrophysical Quantities (3rd Ed.; London: Athlone) and Stonyhurst latitude and longitude system with origin at the intersection of the solar central meridian (as seen from Earth) and the solar equator (Thompson, W, Coordinate systems for solar image data, A&A 449, 791–803 (2006)) +# 12-191 Reserved # 192-254 Reserved for local use 255 255 Missing diff --git a/definitions/grib2/tables/25/4.0.table b/definitions/grib2/tables/25/4.0.table index 0ea0af4ec..3b12b1a91 100644 --- a/definitions/grib2/tables/25/4.0.table +++ b/definitions/grib2/tables/25/4.0.table @@ -1,63 +1,63 @@ # Code table 4.0 - Product definition template number -0 0 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time -1 1 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time -2 2 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer at a point in time -3 3 Derived forecasts based on a cluster of ensemble members over a rectangular area at a horizontal level or in a horizontal layer at a point in time -4 4 Derived forecasts based on a cluster of ensemble members over a circular area at a horizontal level or in a horizontal layer at a point in time -5 5 Probability forecasts at a horizontal level or in a horizontal layer at a point in time -6 6 Percentile forecasts at a horizontal level or in a horizontal layer at a point in time -7 7 Analysis or forecast error at a horizontal level or in a horizontal layer at a point in time -8 8 Average, accumulation, extreme values or other statistically processed values at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -9 9 Probability forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -10 10 Percentile forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -11 11 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -12 12 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -13 13 Derived forecasts based on a cluster of ensemble members over a rectangular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -14 14 Derived forecasts based on a cluster of ensemble members over a circular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval -15 15 Average, accumulation, extreme values, or other statistically processed values over a spatial area at a horizontal level or in a horizontal layer at a point in time -# 16-19 Reserved -20 20 Radar product -# 21-29 Reserved -30 30 Satellite product (deprecated) -31 31 Satellite product -32 32 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data -33 33 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data -34 34 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data -35 35 Satellite product with or without associated quality values -# 36-39 Reserved -40 40 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents -41 41 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents -42 42 Average, accumulation and/or extreme values or other statistically processed values at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents -43 43 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents -44 44 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for aerosol -45 45 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for aerosol -46 46 Average, accumulation, and/or extreme values or other statistically processed values at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for aerosol -47 47 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for aerosol -48 48 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol -49 49 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol +0 0 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time +1 1 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time +2 2 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer at a point in time +3 3 Derived forecasts based on a cluster of ensemble members over a rectangular area at a horizontal level or in a horizontal layer at a point in time +4 4 Derived forecasts based on a cluster of ensemble members over a circular area at a horizontal level or in a horizontal layer at a point in time +5 5 Probability forecasts at a horizontal level or in a horizontal layer at a point in time +6 6 Percentile forecasts at a horizontal level or in a horizontal layer at a point in time +7 7 Analysis or forecast error at a horizontal level or in a horizontal layer at a point in time +8 8 Average, accumulation, extreme values or other statistically processed values at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +9 9 Probability forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +10 10 Percentile forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +11 11 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +12 12 Derived forecasts based on all ensemble members at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +13 13 Derived forecasts based on a cluster of ensemble members over a rectangular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +14 14 Derived forecasts based on a cluster of ensemble members over a circular area, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +15 15 Average, accumulation, extreme values, or other statistically processed values over a spatial area at a horizontal level or in a horizontal layer at a point in time +# 16-19 Reserved +20 20 Radar product +# 21-29 Reserved +30 30 Satellite product (deprecated) +31 31 Satellite product +32 32 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data +33 33 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data +34 34 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data +35 35 Satellite product with or without associated quality values +# 36-39 Reserved +40 40 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents +41 41 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents +42 42 Average, accumulation and/or extreme values or other statistically processed values at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents +43 43 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents +44 44 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for aerosol +45 45 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for aerosol +46 46 Average, accumulation, and/or extreme values or other statistically processed values at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for aerosol +47 47 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for aerosol +48 48 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol +49 49 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol # 50 Reserved -51 51 Categorical forecasts at a horizontal level or in a horizontal layer at a point in time +51 51 Categorical forecasts at a horizontal level or in a horizontal layer at a point in time # 52 Reserved -53 53 Partitioned parameters at a horizontal level or in a horizontal layer at a point in time -54 54 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for partitioned parameters -55 55 Spatio-temporal changing tiles at a horizontal level or horizontal layer at a point in time -56 56 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for spatio-temporal changing tile parameters (deprecated) -57 57 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents based on a distribution function -58 58 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents based on a distribution function -59 59 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for spatio-temporal changing tile parameters (corrected version of template 4.56) -60 60 Individual ensemble reforecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time -61 61 Individual ensemble reforecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous time interval -62 62 Average, accumulation and/or extreme values or other statistically processed values at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for spatio-temporal changing tiles at a horizontal level or horizontal layer at a point in time -63 63 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for spatio-temporal changing tiles -# 64-66 Reserved -67 67 Average, accumulation and/or extreme values or other statistically processed values at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents based on a distribution function -68 68 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents based on a distribution function +53 53 Partitioned parameters at a horizontal level or in a horizontal layer at a point in time +54 54 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for partitioned parameters +55 55 Spatio-temporal changing tiles at a horizontal level or horizontal layer at a point in time +56 56 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for spatio-temporal changing tile parameters (deprecated) +57 57 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents based on a distribution function +58 58 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents based on a distribution function +59 59 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for spatio-temporal changing tile parameters (corrected version of template 4.56) +60 60 Individual ensemble reforecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time +61 61 Individual ensemble reforecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous time interval +62 62 Average, accumulation and/or extreme values or other statistically processed values at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for spatio-temporal changing tiles at a horizontal level or horizontal layer at a point in time +63 63 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for spatio-temporal changing tiles +# 64-66 Reserved +67 67 Average, accumulation and/or extreme values or other statistically processed values at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents based on a distribution function +68 68 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents based on a distribution function # 69 Reserved -70 70 Post-processing analysis or forecast at a horizontal level or in a horizontal layer at a point in time -71 71 Post-processing individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time -72 72 Post-processing average, accumulation, extreme values or other statistically processed values at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -73 73 Post-processing individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous time interval -# 74-75 Reserved +70 70 Post-processing analysis or forecast at a horizontal level or in a horizontal layer at a point in time +71 71 Post-processing individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time +72 72 Post-processing average, accumulation, extreme values or other statistically processed values at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +73 73 Post-processing individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous time interval +# 74-75 Reserved 76 76 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents with source/sink 77 77 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for atmospheric chemical constituents with source/sink 78 78 Average, accumulation, and/or extreme values or other statistically processed values at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for atmospheric chemical constituents with source/sink @@ -66,21 +66,21 @@ 81 81 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol with source/sink 82 82 Average, accumulation, and/or extreme values or other statistically processed values at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for aerosol with source/sink 83 83 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for aerosol with source/sink -# 84-90 Reserved -91 91 Categorical forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval -# 92-253 Reserved -254 254 CCITT IA5 character string -# 255-999 Reserved -1000 1000 Cross-section of analysis and forecast at a point in time -1001 1001 Cross-section of averaged or otherwise statistically processed analysis or forecast over a range of time -1002 1002 Cross-section of analysis and forecast, averaged or otherwise statistically processed over latitude or longitude -# 1003-1099 Reserved -1100 1100 Hovmoller-type grid with no averaging or other statistical processing -1101 1101 Hovmoller-type grid with averaging or other statistical processing +# 84-90 Reserved +91 91 Categorical forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval +# 92-253 Reserved +254 254 CCITT IA5 character string +# 255-999 Reserved +1000 1000 Cross-section of analysis and forecast at a point in time +1001 1001 Cross-section of averaged or otherwise statistically processed analysis or forecast over a range of time +1002 1002 Cross-section of analysis and forecast, averaged or otherwise statistically processed over latitude or longitude +# 1003-1099 Reserved +1100 1100 Hovmoller-type grid with no averaging or other statistical processing +1101 1101 Hovmoller-type grid with averaging or other statistical processing 50001 50001 Forecasting Systems with Variable Resolution in a point in time 50011 50011 Forecasting Systems with Variable Resolution in a continous or non countinous time interval -# 1102-32767 Reserved -# 32768-65534 Reserved for local use +# 1102-32767 Reserved +# 32768-65534 Reserved for local use 40033 40033 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for simulated (synthetic) satellite data 40034 40034 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval for simulated (synthetic) satellite data -65535 65535 Missing +65535 65535 Missing diff --git a/definitions/grib2/tables/25/4.1.20.table b/definitions/grib2/tables/25/4.1.20.table index fe4362b3c..afad6c811 100644 --- a/definitions/grib2/tables/25/4.1.20.table +++ b/definitions/grib2/tables/25/4.1.20.table @@ -1,7 +1,7 @@ # Code table 4.1 - Parameter category by product discipline -0 0 Health indicators -1 1 Epidemiology -2 2 Socioeconomic indicators -# 3-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +0 0 Health indicators +1 1 Epidemiology +2 2 Socioeconomic indicators +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.1.4.table b/definitions/grib2/tables/25/4.1.4.table new file mode 100644 index 000000000..4d3e1cf2b --- /dev/null +++ b/definitions/grib2/tables/25/4.1.4.table @@ -0,0 +1,15 @@ +# Code table 4.1 - Parameter category by product discipline +0 0 Temperature +1 1 Momentum +2 2 Charged particle mass and number +3 3 Electric and magnetic fields +4 4 Energetic particles +5 5 Waves +6 6 Solar electromagnetic emissions +7 7 Terrestrial electromagnetic emissions +8 8 Imagery +9 9 Ion-neutral coupling +10 10 Space weather indices +# 11-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.0.19.table b/definitions/grib2/tables/25/4.2.0.19.table index 015a49a45..a99dc5d62 100644 --- a/definitions/grib2/tables/25/4.2.0.19.table +++ b/definitions/grib2/tables/25/4.2.0.19.table @@ -36,6 +36,7 @@ 34 34 Visibility through ice fog (m) 35 35 Visibility through blowing snow (m) 36 36 Presence of snow squalls (Code table 4.222) -# 37-191 Reserved +37 37 Icing severity (Code table 4.228) +# 38-191 Reserved # 192-254 Reserved for local use 255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.2.3.table b/definitions/grib2/tables/25/4.2.2.3.table index 690fab42b..fcb3ebd72 100644 --- a/definitions/grib2/tables/25/4.2.2.3.table +++ b/definitions/grib2/tables/25/4.2.2.3.table @@ -27,6 +27,7 @@ 25 25 Snow depth at elevation bands (kg m-2) 26 26 Soil heat flux (W m-2) 27 27 Soil depth (m) -# 28-191 Reserved +28 28 Snow temperature (K) +# 29-191 Reserved # 192-254 Reserved for local use 255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.2.4.table b/definitions/grib2/tables/25/4.2.2.4.table index bb54fac22..64ce58355 100644 --- a/definitions/grib2/tables/25/4.2.2.4.table +++ b/definitions/grib2/tables/25/4.2.2.4.table @@ -4,13 +4,13 @@ 2 2 Haines index (Numeric) 3 3 Fire burned area (%) 4 4 Fosberg index (Numeric) -5 5 Forest Fire Weather Index (Canadian Forest Service) (Numeric) -6 6 Fine Fuel Moisture Code (Canadian Forest Service) (Numeric) -7 7 Duff Moisture Code (Canadian Forest Service) (Numeric) -8 8 Drought Code (Canadian Forest Service) (Numeric) -9 9 Initial Fire Spread Index (Canadian Forest Service) (Numeric) -10 10 Fire Buildup Index (Canadian Forest Service) (Numeric) -11 11 Fire Daily Severity Rating (Canadian Forest Service) (Numeric) +5 5 Forest Fire Weather Index (as defined by the Canadian Forest Service) (Numeric) +6 6 Fine Fuel Moisture Code (as defined by the Canadian Forest Service) (Numeric) +7 7 Duff Moisture Code (as defined by the Canadian Forest Service) (Numeric) +8 8 Drought Code (as defined by the Canadian Forest Service) (Numeric) +9 9 Initial Fire Spread Index (as defined by the Canadian Forest Service) (Numeric) +10 10 Fire Buildup Index (as defined by the Canadian Forest Service) (Numeric) +11 11 Fire Daily Severity Rating (as defined by the Canadian Forest Service) (Numeric) # 12-191 Reserved # 192-254 Reserved for local use 255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.2.5.table b/definitions/grib2/tables/25/4.2.2.5.table index 10fb68956..a5a71dcd1 100644 --- a/definitions/grib2/tables/25/4.2.2.5.table +++ b/definitions/grib2/tables/25/4.2.2.5.table @@ -1,2 +1,6 @@ # Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Glacier cover (Proportion) 1 1 Glacier temperature (K) +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.20.0.table b/definitions/grib2/tables/25/4.2.20.0.table index cf842f6ea..9cd936387 100644 --- a/definitions/grib2/tables/25/4.2.20.0.table +++ b/definitions/grib2/tables/25/4.2.20.0.table @@ -1,6 +1,6 @@ # Code table 4.2 - Parameter number by product discipline and parameter category 0 0 Universal thermal climate index (K) 1 1 Mean radiant temperature (K) -# 2-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 2-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.20.1.table b/definitions/grib2/tables/25/4.2.20.1.table index 0c814e6d3..bdddca5f9 100644 --- a/definitions/grib2/tables/25/4.2.20.1.table +++ b/definitions/grib2/tables/25/4.2.20.1.table @@ -2,13 +2,13 @@ 0 0 Malaria cases (Fraction) 1 1 Malaria circumsporozoite protein rate (Fraction) 2 2 Plasmodium falciparum entomological inoculation rate (Bites per day per person) -3 3 Human bite rate by anopheles vectors (Bites per day per person) -4 4 Malaria immunity (Fraction) -5 5 Falciparum parasite rates (Fraction) +3 3 Human bite rate by anopheles vectors (Bites per day per person) +4 4 Malaria immunity (Fraction) +5 5 Falciparum parasite rates (Fraction) 6 6 Detectable falciparum parasite ratio (after day 10) (Fraction) 7 7 Anopheles vector to host ratio (Fraction) 8 8 Anopheles vector number (Number m-2) 9 9 Fraction of malarial vector reproductive habitat (Fraction) -# 10-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 10-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.20.2.table b/definitions/grib2/tables/25/4.2.20.2.table index 8a937c0d1..0804bcafd 100644 --- a/definitions/grib2/tables/25/4.2.20.2.table +++ b/definitions/grib2/tables/25/4.2.20.2.table @@ -1,5 +1,5 @@ # Code table 4.2 - Parameter number by product discipline and parameter category 0 0 Population density (Person m-2) -# 1-191 Reserved -# 192-254 Reserved for local use -255 255 Missing +# 1-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.4.0.table b/definitions/grib2/tables/25/4.2.4.0.table new file mode 100644 index 000000000..0b35aba26 --- /dev/null +++ b/definitions/grib2/tables/25/4.2.4.0.table @@ -0,0 +1,10 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Temperature (K) +1 1 Electron temperature (K) +2 2 Proton temperature (K) +3 3 Ion temperature (K) +4 4 Parallel temperature (K) +5 5 Perpendicular temperature (K) +# 6-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.4.1.table b/definitions/grib2/tables/25/4.2.4.1.table new file mode 100644 index 000000000..abd58440a --- /dev/null +++ b/definitions/grib2/tables/25/4.2.4.1.table @@ -0,0 +1,8 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Velocity magnitude (speed) (m s-1) +1 1 1st vector component of velocity (coordinate system dependent) (m s-1) +2 2 2nd vector component of velocity (coordinate system dependent) (m s-1) +3 3 3rd vector component of velocity (coordinate system dependent) (m s-1) +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.4.10.table b/definitions/grib2/tables/25/4.2.4.10.table new file mode 100644 index 000000000..420d2b43d --- /dev/null +++ b/definitions/grib2/tables/25/4.2.4.10.table @@ -0,0 +1,12 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Scintillation index (sigma phi) (rad) +1 1 Scintillation index S4 (Numeric) +2 2 Rate of Change of TEC Index (ROTI) (TECU/min) +3 3 Disturbance Ionosphere Index Spatial Gradient (DIXSG) (Numeric) +4 4 Along Arc TEC Rate (AATR) (TECU/min) +5 5 Kp (Numeric) +6 6 Equatorial disturbance storm time index (Dst) (nT) +7 7 Auroral Electrojet (AE) (nT) +# 8-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.4.2.table b/definitions/grib2/tables/25/4.2.4.2.table new file mode 100644 index 000000000..8dd05fcda --- /dev/null +++ b/definitions/grib2/tables/25/4.2.4.2.table @@ -0,0 +1,18 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Particle number density (m-3) +1 1 Electron density (m-3) +2 2 Proton density (m-3) +3 3 Ion density (m-3) +4 4 Vertical total electron content (TECU) +5 5 HF absorption frequency (Hz) +6 6 HF absorption (dB) +7 7 Spread F (m) +8 8 h’ (m) +9 9 Critical frequency (Hz) +10 10 Maximal usable frequency (MUF) (Hz) +11 11 Peak height (hm) (m) +12 12 Peak density (Nm) (m-3) +13 13 Equivalent slab thickness (tau) (km) +# 14-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.4.3.table b/definitions/grib2/tables/25/4.2.4.3.table new file mode 100644 index 000000000..a46f4a403 --- /dev/null +++ b/definitions/grib2/tables/25/4.2.4.3.table @@ -0,0 +1,12 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Magnetic field magnitude (T) +1 1 1st vector component of magnetic field (T) +2 2 2nd vector component of magnetic field (T) +3 3 3rd vector component of magnetic field (T) +4 4 Electric field magnitude (V m-1) +5 5 1st vector component of electric field (V m-1) +6 6 2nd vector component of electric field (V m-1) +7 7 3rd vector component of electric field (V m-1) +# 8-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.4.4.table b/definitions/grib2/tables/25/4.2.4.4.table new file mode 100644 index 000000000..b71abeb93 --- /dev/null +++ b/definitions/grib2/tables/25/4.2.4.4.table @@ -0,0 +1,11 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Proton flux (differential) ((m2 s sr eV)-1) +1 1 Proton flux (integral) ((m2 s sr )-1) +2 2 Electron flux (differential) ((m2 s sr eV)-1) +3 3 Electron flux (integral) ((m2 s sr)-1) +4 4 Heavy ion flux (differential) ((m2 s sr eV/nuc)-1) +5 5 Heavy ion flux (integral) ((m2 s sr)-1) +6 6 Cosmic ray neutron flux (/h) +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.4.5.table b/definitions/grib2/tables/25/4.2.4.5.table new file mode 100644 index 000000000..014ea22fa --- /dev/null +++ b/definitions/grib2/tables/25/4.2.4.5.table @@ -0,0 +1,8 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Amplitude (dB) +1 1 Phase (rad) +2 2 Frequency (Hz) +3 3 Wave length (m) +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.4.6.table b/definitions/grib2/tables/25/4.2.4.6.table new file mode 100644 index 000000000..67f551f7a --- /dev/null +++ b/definitions/grib2/tables/25/4.2.4.6.table @@ -0,0 +1,11 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Integrated solar irradiance (W m-2) +1 1 Solar X-ray flux (XRS long) (W m-2) +2 2 Solar X-ray flux (XRS short) (W m-2) +3 3 Solar EUV irradiance (W m-2) +4 4 Solar spectral irradiance (W m-2 nm-1) +5 5 F10.7 (W m-2 Hz-1) +6 6 Solar radio emissions (W m-2 Hz-1) +# 7-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.4.7.table b/definitions/grib2/tables/25/4.2.4.7.table new file mode 100644 index 000000000..9b93bcff1 --- /dev/null +++ b/definitions/grib2/tables/25/4.2.4.7.table @@ -0,0 +1,8 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Limb intensity (J m-2 s-1) +1 1 Disk intensity (J m-2 s-1) +2 2 Disk intensity day (J m-2 s-1) +3 3 Disk intensity night (J m-2 s-1) +# 4-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.4.8.table b/definitions/grib2/tables/25/4.2.4.8.table new file mode 100644 index 000000000..358b91ca7 --- /dev/null +++ b/definitions/grib2/tables/25/4.2.4.8.table @@ -0,0 +1,12 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 X-ray radiance (W sr-1 m-2) +1 1 EUV radiance (W sr-1 m-2) +2 2 H-alpha radiance (W sr-1 m-2) +3 3 White light radiance (W sr-1 m-2) +4 4 CaII-K radiance (W sr-1 m-2) +5 5 White light coronagraph radiance (W sr-1 m-2) +6 6 Heliospheric radiance (W sr-1 m-2) +7 7 Thematic mask (Numeric) +# 8-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.2.4.9.table b/definitions/grib2/tables/25/4.2.4.9.table new file mode 100644 index 000000000..e96c81ba3 --- /dev/null +++ b/definitions/grib2/tables/25/4.2.4.9.table @@ -0,0 +1,7 @@ +# Code table 4.2 - Parameter number by product discipline and parameter category +0 0 Pedersen conductivity (S m-1) +1 1 Hall conductivity (S m-1) +2 2 Parallel conductivity (S m-1) +# 3-191 Reserved +# 192-254 Reserved for local use +255 255 Missing diff --git a/definitions/grib2/tables/25/4.228.table b/definitions/grib2/tables/25/4.228.table new file mode 100644 index 000000000..559ae916a --- /dev/null +++ b/definitions/grib2/tables/25/4.228.table @@ -0,0 +1,8 @@ +# Code table 4.228 - Icing severity +0 0 None +1 1 Trace +2 2 Light +3 3 Moderate +4 4 Severe +# 5-254 Reserved +255 255 Missing value diff --git a/definitions/grib2/tables/25/4.240.table b/definitions/grib2/tables/25/4.240.table index f48c086e4..4daef3d13 100644 --- a/definitions/grib2/tables/25/4.240.table +++ b/definitions/grib2/tables/25/4.240.table @@ -1,9 +1,9 @@ # Code table 4.240 - Type of distribution function 0 0 No specific distribution function given -1 1 Delta functions with spatially variable concentration and fixed diameters Dl (p1) in metre -2 2 Delta functions with spatially variable concentration and fixed masses Ml (p1) in kg +1 1 Delta functions with spatially variable concentration and fixed diameters Dl (p1) in metre +2 2 Delta functions with spatially variable concentration and fixed masses Ml (p1) in kg 3 3 Gaussian (normal) distribution with spatially variable concentration and fixed mean diameter Dl(p1) and variance(p2) -4 4 Gaussian (normal) distribution with spatially variable concentration, mean diameter and variance +4 4 Gaussian (normal) distribution with spatially variable concentration, mean diameter and variance 5 5 Log-normal distribution with spatially variable number density, mean diameter and variance 6 6 Log-normal distribution with spatially variable number density, mean diameter and fixed variance(p1) 7 7 Log-normal distribution with spatially variable number density and mass density and fixed variance(p1) and fixed particle density(p2) diff --git a/definitions/grib2/tables/25/4.5.table b/definitions/grib2/tables/25/4.5.table index ec956a361..a600714b0 100644 --- a/definitions/grib2/tables/25/4.5.table +++ b/definitions/grib2/tables/25/4.5.table @@ -23,7 +23,14 @@ 23 23 Lowest level where air concentration exceeds the specified value (base for a given threshold of air concentration) (Bq m-3) 24 24 Highest level where air concentration exceeds the specified value (top for a given threshold of air concentration) (Bq m-3) 25 25 Highest level where radar reflectivity exceeds the specified value (echo top for a given threshold of reflectivity) (dBZ) -# 26-99 Reserved +# 26-29 Reserved +30 30 Specified radius from the center of the Sun (m) +31 31 Solar photosphere +32 32 Ionospheric D-region level +33 33 Ionospheric E-region level +34 34 Ionospheric F1-region level +35 35 Ionospheric F2-region level +# 36-99 Reserved 100 pl Isobaric surface (Pa) 101 sfc Mean sea level 102 102 Specific altitude above mean sea level (m) @@ -47,7 +54,8 @@ # 120-149 Reserved 150 150 Generalized vertical height coordinate 151 sol Soil level (Numeric) -# 152-159 Reserved +152 152 Sea ice level (Numeric) +# 153-159 Reserved 160 160 Depth below sea level (m) 161 161 Depth below water surface (m) 162 162 Lake or river bottom (-) diff --git a/definitions/grib2/tables/25/5.0.table b/definitions/grib2/tables/25/5.0.table index 27a9fbc97..74af6d38d 100644 --- a/definitions/grib2/tables/25/5.0.table +++ b/definitions/grib2/tables/25/5.0.table @@ -4,7 +4,7 @@ 2 2 Grid point data - complex packing 3 3 Grid point data - complex packing and spatial differencing 4 4 Grid point data - IEEE floating point data -# 5-39 Reserved +# 5-39 Reserved 40 40 Grid point data - JPEG 2000 code stream format 41 41 Grid point data - Portable Network Graphics (PNG) 42 42 Grid point and spectral data - CCSDS recommended lossless compression @@ -12,15 +12,15 @@ 50 50 Spectral data - simple packing 51 51 Spherical harmonics data - complex packing # 52 Reserved -53 53 Spectral data for limited area models - complex packing -# 54-60 Reserved +53 53 Spectral data for limited area models - complex packing +# 54-60 Reserved 61 61 Grid point data - simple packing with logarithm pre-processing # 62-199 Reserved 200 200 Run length packing with level values # 201-49151 Reserved # 49152-65534 Reserved for local use 40000 40000 JPEG2000 Packing -40010 40010 PNG pacling +40010 40010 PNG packing 50000 50000 Sperical harmonics ieee packing 50001 50001 Second order packing 50002 50002 Second order packing diff --git a/definitions/grib2/template.3.10.def b/definitions/grib2/template.3.10.def index 37cf9f7a1..8fb757a40 100644 --- a/definitions/grib2/template.3.10.def +++ b/definitions/grib2/template.3.10.def @@ -53,12 +53,27 @@ meta geography.orientationOfTheGridInDegrees # NOTE 2: Grid lengths are in units of 10**-3 m, at the latitude specified by LaD unsigned[4] Di : edition_specific,no_copy ; alias longitudinalDirectionGridLength = Di ; -meta geography.DiInMetres - scale(Di,oneConstant,thousand,truncateDegrees) : dump; +meta geography.DiInMetres scale(Di,oneConstant,thousand,truncateDegrees) : dump; # Dj - latitudinal direction grid length # NOTE 2: Grid lengths are in units of 10**-3 m, at the latitude specified by LaD unsigned[4] Dj : edition_specific,no_copy ; alias latitudinalDirectionGridLength = Dj; -meta geography.DjInMetres - scale(Dj,oneConstant,thousand,truncateDegrees) : dump; +meta geography.DjInMetres scale(Dj,oneConstant,thousand,truncateDegrees) : dump; + +iterator mercator(numberOfPoints,missingValue,values, + radius,Ni,Nj, + latitudeOfFirstGridPointInDegrees, longitudeOfFirstGridPointInDegrees, + LaDInDegrees, + latitudeOfLastGridPointInDegrees, longitudeOfLastGridPointInDegrees, + orientationOfTheGridInDegrees, + DiInMetres,DjInMetres, + iScansNegatively, jScansPositively, + jPointsAreConsecutive, alternativeRowScanning); + +meta latLonValues latlonvalues(values); +alias latitudeLongitudeValues=latLonValues; +meta latitudes latitudes(values,0); +meta longitudes longitudes(values,0); +meta distinctLatitudes latitudes(values,1); +meta distinctLongitudes longitudes(values,1); diff --git a/definitions/grib2/template.3.140.def b/definitions/grib2/template.3.140.def index a64b3826a..5f0c725f0 100644 --- a/definitions/grib2/template.3.140.def +++ b/definitions/grib2/template.3.140.def @@ -16,14 +16,14 @@ alias Nj = Ny; # La1 - latitude of first grid point signed[4] latitudeOfFirstGridPoint: edition_specific ; alias La1 = latitudeOfFirstGridPoint; -meta geography.latitudeOfFirstGridPointInDegrees scale(latitudeOfFirstGridPoint +meta geography.latitudeOfFirstGridPointInDegrees scale(latitudeOfFirstGridPoint ,one,grib2divider,truncateDegrees) : dump; #meta latitudeOfFirstGridPointInMicrodegrees times(latitudeOfFirstGridPoint,mAngleMultiplier,angleDivisor): no_copy; # Lo1 - longitude of first grid point signed[4] longitudeOfFirstGridPoint: edition_specific ; alias La1 = longitudeOfFirstGridPoint; -meta geography.longitudeOfFirstGridPointInDegrees scale(longitudeOfFirstGridPoint +meta geography.longitudeOfFirstGridPointInDegrees scale(longitudeOfFirstGridPoint ,one,grib2divider,truncateDegrees) : dump; #meta longitudeOfFirstGridPointInMicrodegrees times(longitudeOfFirstGridPoint,mAngleMultiplier,angleDivisor) : no_copy; @@ -55,10 +55,8 @@ iterator lambert_azimuthal_equal_area(numberOfPoints,missingValue,values, latitudeOfFirstGridPointInDegrees,longitudeOfFirstGridPointInDegrees, standardParallel,centralLongitude, Dx,Dy, - iScansNegatively, - jScansPositively, - jPointsAreConsecutive, - alternativeRowScanning); + iScansNegatively, jScansPositively, + jPointsAreConsecutive, alternativeRowScanning); meta latLonValues latlonvalues(values); alias latitudeLongitudeValues=latLonValues; diff --git a/definitions/grib2/template.3.20.def b/definitions/grib2/template.3.20.def index efee0046f..fb16d1bfc 100644 --- a/definitions/grib2/template.3.20.def +++ b/definitions/grib2/template.3.20.def @@ -63,7 +63,6 @@ flagbit southPoleOnProjectionPlane(projectionCentreFlag,7) : dump; # WMO bit 1 include "grib2/template.3.scanning_mode.def"; - iterator polar_stereographic(numberOfPoints,missingValue,values, radius,Nx,Ny, latitudeOfFirstGridPointInDegrees,longitudeOfFirstGridPointInDegrees, @@ -71,10 +70,8 @@ iterator polar_stereographic(numberOfPoints,missingValue,values, orientationOfTheGridInDegrees, LaDInDegrees, DxInMetres,DyInMetres, - iScansNegatively, - jScansPositively, - jPointsAreConsecutive, - alternativeRowScanning); + iScansNegatively, jScansPositively, + jPointsAreConsecutive, alternativeRowScanning); nearest polar_stereographic(values,radius,Nx,Ny); @@ -82,3 +79,5 @@ meta latLonValues latlonvalues(values); alias latitudeLongitudeValues=latLonValues; meta latitudes latitudes(values,0); meta longitudes longitudes(values,0); +meta distinctLatitudes latitudes(values,1); +meta distinctLongitudes longitudes(values,1); diff --git a/definitions/grib2/template.3.30.def b/definitions/grib2/template.3.30.def index 377883dc2..10b0392ca 100644 --- a/definitions/grib2/template.3.30.def +++ b/definitions/grib2/template.3.30.def @@ -16,7 +16,7 @@ alias geography.Ny=Ny; # La1 - latitude of first grid point signed[4] latitudeOfFirstGridPoint : edition_specific; alias La1 = latitudeOfFirstGridPoint; -meta geography.latitudeOfFirstGridPointInDegrees +meta geography.latitudeOfFirstGridPointInDegrees scale(latitudeOfFirstGridPoint,one,grib2divider,truncateDegrees) : dump; alias La1InDegrees=latitudeOfFirstGridPointInDegrees; #meta latitudeOfFirstGridPointInMicrodegrees times(latitudeOfFirstGridPointInDegrees,oneConstant): no_copy; @@ -24,7 +24,7 @@ alias La1InDegrees=latitudeOfFirstGridPointInDegrees; # Lo1 - longitude of first grid point unsigned[4] longitudeOfFirstGridPoint : edition_specific; alias Lo1 = longitudeOfFirstGridPoint; -meta geography.longitudeOfFirstGridPointInDegrees +meta geography.longitudeOfFirstGridPointInDegrees scale(longitudeOfFirstGridPoint,one,grib2divider,truncateDegrees) : dump; alias Lo1InDegrees = longitudeOfFirstGridPointInDegrees; #meta longitudeOfFirstGridPointInMicrodegrees times(longitudeOfFirstGridPoint,oneConstant) : no_copy; @@ -34,23 +34,23 @@ include "grib2/template.3.resolution_flags.def"; # LaD - Latitude where Dx and Dy are specified signed[4] LaD : edition_specific ; alias latitudeWhereDxAndDyAreSpecified=LaD; -meta geography.LaDInDegrees scale(LaD,one,grib2divider,truncateDegrees) : dump; +meta geography.LaDInDegrees scale(LaD,one,grib2divider,truncateDegrees) : dump; # LoV - Longitude of meridian parallel to Y-axis along which latitude increases as the Y-coordinate increases unsigned[4] LoV : edition_specific; -meta geography.LoVInDegrees scale(LoV,one,grib2divider,truncateDegrees) : dump; +meta geography.LoVInDegrees scale(LoV,one,grib2divider,truncateDegrees) : dump; # Dx - X-direction grid length (in units of millimetres) unsigned[4] Dx : edition_specific ; alias xDirectionGridLength=Dx; alias Di = Dx; -meta geography.DxInMetres scale(Dx,one,thousand) : dump; +meta geography.DxInMetres scale(Dx,one,thousand) : dump; # Dy - Y-direction grid length (in units of millimetres) unsigned[4] Dy : edition_specific ; alias yDirectionGridLength=Dy ; alias Dj = Dy; -meta geography.DyInMetres scale(Dy,one,thousand) : dump; +meta geography.DyInMetres scale(Dy,one,thousand) : dump; # Projection centre flag flags[1] projectionCentreFlag 'grib2/tables/[tablesVersion]/3.5.table' : dump; @@ -60,22 +60,22 @@ include "grib2/template.3.scanning_mode.def"; # Latin 1 - first latitude from the pole at which the secant cone cuts the sphere signed[4] Latin1 : edition_specific; alias FirstLatitude=Latin1; -meta geography.Latin1InDegrees scale(Latin1,one,grib2divider,truncateDegrees) : dump; +meta geography.Latin1InDegrees scale(Latin1,one,grib2divider,truncateDegrees) : dump; # Latin 2 - second latitude from the pole at which the secant cone cuts the sphere signed[4] Latin2 : dump; alias SecondLatitude=Latin2; -meta geography.Latin2InDegrees scale(Latin2,one,grib2divider,truncateDegrees) : dump; +meta geography.Latin2InDegrees scale(Latin2,one,grib2divider,truncateDegrees) : dump; # Latitude of the southern pole of projection signed[4] latitudeOfSouthernPole : edition_specific; alias latitudeOfTheSouthernPoleOfProjection=latitudeOfSouthernPole; -meta geography.latitudeOfSouthernPoleInDegrees scale(latitudeOfSouthernPole ,one,grib2divider,truncateDegrees) : dump; +meta geography.latitudeOfSouthernPoleInDegrees scale(latitudeOfSouthernPole,one,grib2divider,truncateDegrees) : dump; # Longitude of the southern pole of projection unsigned[4] longitudeOfSouthernPole : edition_specific; alias longitudeOfTheSouthernPoleOfProjection=longitudeOfSouthernPole; -meta geography.longitudeOfSouthernPoleInDegrees scale(longitudeOfSouthernPole,oneConstant,grib2divider,truncateDegrees) : dump; +meta geography.longitudeOfSouthernPoleInDegrees scale(longitudeOfSouthernPole,oneConstant,grib2divider,truncateDegrees) : dump; iterator lambert_conformal(numberOfPoints,missingValue,values, radius,Nx,Ny, @@ -83,10 +83,8 @@ iterator lambert_conformal(numberOfPoints,missingValue,values, Latin1InDegrees,Latin2InDegrees, latitudeOfFirstGridPointInDegrees,longitudeOfFirstGridPointInDegrees, DxInMetres,DyInMetres, - iScansNegatively, - jScansPositively, - jPointsAreConsecutive, - alternativeRowScanning); + iScansNegatively, jScansPositively, + jPointsAreConsecutive, alternativeRowScanning); nearest lambert_conformal(values,radius,Nx,Ny); @@ -94,3 +92,5 @@ meta latLonValues latlonvalues(values); alias latitudeLongitudeValues=latLonValues; meta latitudes latitudes(values,0); meta longitudes longitudes(values,0); +meta distinctLatitudes latitudes(values,1); +meta distinctLongitudes longitudes(values,1); diff --git a/definitions/grib2/template.3.90.def b/definitions/grib2/template.3.90.def index d35f1dce4..2904d1fe4 100644 --- a/definitions/grib2/template.3.90.def +++ b/definitions/grib2/template.3.90.def @@ -19,8 +19,8 @@ signed[4] latitudeOfSubSatellitePoint ; # Lop - longitude of sub-satellite point signed[4] longitudeOfSubSatellitePoint ; -meta geography.latitudeOfSubSatellitePointInDegrees scale(latitudeOfSubSatellitePoint,one,grib2divider,truncateDegrees) : dump; -meta geography.longitudeOfSubSatellitePointInDegrees scale(longitudeOfSubSatellitePoint,one,grib2divider,truncateDegrees) : dump; +meta geography.latitudeOfSubSatellitePointInDegrees scale(latitudeOfSubSatellitePoint,one,grib2divider,truncateDegrees) : dump; +meta geography.longitudeOfSubSatellitePointInDegrees scale(longitudeOfSubSatellitePoint,one,grib2divider,truncateDegrees) : dump; include "grib2/template.3.resolution_flags.def"; @@ -35,13 +35,13 @@ alias geography.dy=dy; # Xp - X-coordinate of sub-satellite point # (in units of 10^-3 grid length expressed as an integer) unsigned[4] Xp : no_copy; -meta geography.XpInGridLengths scale(Xp,one,thousand) : dump; +meta geography.XpInGridLengths scale(Xp,one,thousand) : dump; alias xCoordinateOfSubSatellitePoint=XpInGridLengths; # Yp - Y-coordinate of sub-satellite point # (in units of 10^-3 grid length expressed as an integer) unsigned[4] Yp : no_copy; -meta geography.YpInGridLengths scale(Yp,one,thousand) : dump; +meta geography.YpInGridLengths scale(Yp,one,thousand) : dump; alias yCoordinateOfSubSatellitePoint=YpInGridLengths; include "grib2/template.3.scanning_mode.def"; @@ -77,7 +77,12 @@ iterator space_view(numberOfPoints, missingValue, values, radius, dx, dy, XpInGridLengths, YpInGridLengths, orientationOfTheGridInDegrees, NrInRadiusOfEarth, Xo, Yo, - iScansNegatively, - jScansPositively, - jPointsAreConsecutive, - alternativeRowScanning); + iScansNegatively, jScansPositively, + jPointsAreConsecutive, alternativeRowScanning); + +meta latLonValues latlonvalues(values); +alias latitudeLongitudeValues=latLonValues; +meta latitudes latitudes(values,0); +meta longitudes longitudes(values,0); +meta distinctLatitudes latitudes(values,1); +meta distinctLongitudes longitudes(values,1); diff --git a/definitions/grib2/template.3.latlon.def b/definitions/grib2/template.3.latlon.def index fd3c874b4..cc3b8cc5f 100755 --- a/definitions/grib2/template.3.latlon.def +++ b/definitions/grib2/template.3.latlon.def @@ -27,10 +27,10 @@ meta g2grid g2grid( subdivisionsOfBasicAngle ); -meta geography.latitudeOfFirstGridPointInDegrees g2latlon(g2grid,0) : dump; -meta geography.longitudeOfFirstGridPointInDegrees g2latlon(g2grid,1) : dump; -meta geography.latitudeOfLastGridPointInDegrees g2latlon(g2grid,2) : dump; -meta geography.longitudeOfLastGridPointInDegrees g2latlon(g2grid,3) : dump; +meta geography.latitudeOfFirstGridPointInDegrees g2latlon(g2grid,0) : dump; +meta geography.longitudeOfFirstGridPointInDegrees g2latlon(g2grid,1) : dump; +meta geography.latitudeOfLastGridPointInDegrees g2latlon(g2grid,2) : dump; +meta geography.longitudeOfLastGridPointInDegrees g2latlon(g2grid,3) : dump; alias xFirst=longitudeOfFirstGridPointInDegrees; alias yFirst=latitudeOfFirstGridPointInDegrees; @@ -63,7 +63,10 @@ _if ( missing(Ni) && PLPresent == 1 ) { iterator latlon(numberOfPoints,missingValue,values, longitudeFirstInDegrees,DiInDegrees , Ni,Nj,iScansNegatively, - latitudeFirstInDegrees, DjInDegrees,jScansPositively, jPointsAreConsecutive); + latitudeFirstInDegrees, DjInDegrees, + jScansPositively, jPointsAreConsecutive, + isRotatedGrid, angleOfRotation, + latitudeOfSouthernPoleInDegrees,longitudeOfSouthernPoleInDegrees); nearest regular(values,radius,Ni,Nj); } meta latLonValues latlonvalues(values); diff --git a/definitions/grib2/template.4.point_in_time.def b/definitions/grib2/template.4.point_in_time.def index 649c338c4..f2e8606fd 100644 --- a/definitions/grib2/template.4.point_in_time.def +++ b/definitions/grib2/template.4.point_in_time.def @@ -16,6 +16,7 @@ alias ls.stepRange=stepRange; concept stepTypeInternal { "instant" = {dummy=1;} } +meta stepHumanReadable step_human_readable(stepUnits, stepRange): hidden,no_copy; alias time.stepType=stepType; alias time.stepRange=stepRange; diff --git a/examples/C/CMakeLists.txt b/examples/C/CMakeLists.txt index 83a97fea4..02d7db43c 100644 --- a/examples/C/CMakeLists.txt +++ b/examples/C/CMakeLists.txt @@ -49,26 +49,24 @@ list( APPEND test_bins bufr_read_synop bufr_read_temp bufr_set_keys - bufr_subset -) + bufr_subset ) foreach( tool ${test_bins} ) ecbuild_add_executable( TARGET c_${tool} NOINSTALL SOURCES ${tool}.c - LIBS eccodes - ) + LIBS eccodes ) endforeach() # Now add each test (shell scripts) ######################################################################## -list( APPEND tests_basic +list(APPEND tests_basic grib_multi grib_set_data large_grib1 grib_sections_copy get_product_kind_samples ) -list( APPEND tests_extra +list(APPEND tests_extra grib_iterator grib_get_keys grib_print_data @@ -105,34 +103,30 @@ list( APPEND tests_extra foreach( test ${tests_basic} ) ecbuild_add_test( TARGET eccodes_c_${test} TYPE SCRIPT - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${test}.sh - ) + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${test}.sh ) endforeach() foreach( test ${tests_extra} ) ecbuild_add_test( TARGET eccodes_c_${test} TYPE SCRIPT CONDITION ENABLE_EXTRA_TESTS COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${test}.sh - TEST_DEPENDS eccodes_download_gribs eccodes_download_bufrs - ) + TEST_DEPENDS eccodes_download_gribs eccodes_download_bufrs ) endforeach() ######################################################################## # Tests which are conditional if( ENABLE_EXTRA_TESTS AND HAVE_ECCODES_THREADS ) # For POSIX threads - LIST(APPEND pthread_tests grib_pthreads bufr_pthreads) + list(APPEND pthread_tests grib_pthreads bufr_pthreads) foreach( test ${pthread_tests} ) ecbuild_add_executable( TARGET c_${test} NOINSTALL SOURCES ${test}.c - LIBS eccodes - ) + LIBS eccodes ) ecbuild_add_test( TARGET eccodes_c_${test} TYPE SCRIPT COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${test}.sh - TEST_DEPENDS eccodes_download_gribs eccodes_download_bufrs - ) + TEST_DEPENDS eccodes_download_gribs eccodes_download_bufrs ) endforeach() endif() diff --git a/examples/C/bufr_attributes.c b/examples/C/bufr_attributes.c index d234a2b45..1fad88652 100644 --- a/examples/C/bufr_attributes.c +++ b/examples/C/bufr_attributes.c @@ -36,14 +36,14 @@ int main(int argc, char* argv[]) in = fopen(infile, "rb"); if (!in) { - printf("ERROR: unable to open file %s\n", infile); + fprintf(stderr, "Error: unable to open file %s\n", infile); return 1; } /* loop over the messages in the bufr file */ while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) { if (h == NULL) { - printf("Error: unable to create handle for message %d\n", cnt); + fprintf(stderr, "Error: unable to create handle for message %d\n", cnt); cnt++; continue; } diff --git a/examples/C/bufr_copy_data.c b/examples/C/bufr_copy_data.c index b2447c21f..eb816163f 100644 --- a/examples/C/bufr_copy_data.c +++ b/examples/C/bufr_copy_data.c @@ -53,7 +53,7 @@ int main(int argc, char* argv[]) } ho = codes_bufr_handle_new_from_samples(NULL, sampleName); if (ho == NULL) { - fprintf(stderr, "ERROR creating BUFR from %s\n", sampleName); + fprintf(stderr, "Error: creating BUFR from %s\n", sampleName); fclose(f); return 1; } @@ -80,14 +80,14 @@ int main(int argc, char* argv[]) while ((h = codes_handle_new_from_file(0, f, PRODUCT_BUFR, &err)) != NULL) { if (!h) { - printf("ERROR: Unable to create BUFR handle\n"); + fprintf(stderr, "Error: Unable to create BUFR handle\n"); return 1; } /* codes_copy_key(h,ho,"unexpandedDescriptors",0); */ err = codes_set_long(h, "unpack", 1); if (err) { - printf("ERROR: Unable to unpack BUFR message. Quitting\n"); - printf(" %s\n", codes_get_error_message(err)); + fprintf(stderr, "Error: Unable to unpack BUFR message. Quitting\n"); + fprintf(stderr, " %s\n", codes_get_error_message(err)); return 1; } diff --git a/examples/C/bufr_expanded.c b/examples/C/bufr_expanded.c index 53f393971..a18d1040c 100644 --- a/examples/C/bufr_expanded.c +++ b/examples/C/bufr_expanded.c @@ -43,14 +43,14 @@ int main(int argc, char* argv[]) /* open bufr file */ in = fopen(filename, "rb"); if (!in) { - printf("ERROR: unable to open file %s\n", filename); + fprintf(stderr, "Error: unable to open file %s\n", filename); return 1; } /* loop over the messages in the bufr file */ while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) { if (h == NULL) { - printf("Error: unable to create handle for message %d\n", cnt); + fprintf(stderr, "Error: unable to create handle for message %d\n", cnt); cnt++; continue; } diff --git a/examples/C/bufr_get_keys.c b/examples/C/bufr_get_keys.c index e12538c2a..c475c8c6b 100644 --- a/examples/C/bufr_get_keys.c +++ b/examples/C/bufr_get_keys.c @@ -36,14 +36,14 @@ int main(int argc, char* argv[]) in = fopen(infile, "rb"); if (!in) { - printf("ERROR: unable to open file %s\n", infile); + fprintf(stderr, "Error: unable to open file %s\n", infile); return 1; } /* loop over the messages in the bufr file */ while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) { if (h == NULL) { - printf("Error: unable to create handle for message %d\n", cnt); + fprintf(stderr, "Error: unable to create handle for message %d\n", cnt); cnt++; continue; } diff --git a/examples/C/bufr_get_keys.sh b/examples/C/bufr_get_keys.sh index d6f0c8857..cb6301550 100755 --- a/examples/C/bufr_get_keys.sh +++ b/examples/C/bufr_get_keys.sh @@ -16,7 +16,7 @@ label="bufr_get_keys_test_c" #Define tmp file fTmp=${label}.tmp.txt -rm -f $fTmp | true +rm -f $fTmp #We check "syno_multi.bufr". The path is #hardcoded in the example @@ -24,11 +24,11 @@ rm -f $fTmp | true REDIRECT=/dev/null #Write the key values into a file -${examples_dir}/c_bufr_get_keys 2> $REDIRECT > $fTmp +${examples_dir}/c_bufr_get_keys > $fTmp # 2> $REDIRECT #TODO: check the results -#cat $fTmp +#cat $fTmp #Clean up -rm -f $fTmp | true +rm -f $fTmp diff --git a/examples/C/bufr_get_string_array.c b/examples/C/bufr_get_string_array.c index 5c2eb1a0a..1220f04c7 100644 --- a/examples/C/bufr_get_string_array.c +++ b/examples/C/bufr_get_string_array.c @@ -29,14 +29,14 @@ int main(int argc, char* argv[]) FILE* in = fopen(infile, "rb"); if (!in) { - printf("ERROR: unable to open file %s\n", infile); + fprintf(stderr, "Error: unable to open file %s\n", infile); return 1; } /* loop over the messages in the bufr file */ while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) { if (h == NULL) { - printf("Error: unable to create handle for message %d\n", cnt); + fprintf(stderr, "Error: unable to create handle for message %d\n", cnt); cnt++; continue; } @@ -49,7 +49,7 @@ int main(int argc, char* argv[]) CODES_CHECK(codes_get_size(h, "stationOrSiteName", &len), 0); strArray = (char**)malloc(len * sizeof(char*)); if (!strArray) { - printf("Error: Could not allocate memory\n"); + fprintf(stderr, "Error: Could not allocate memory\n"); return 1; } CODES_CHECK(codes_get_string_array(h, "stationOrSiteName", strArray, &size), 0); diff --git a/examples/C/bufr_keys_iterator.c b/examples/C/bufr_keys_iterator.c index 780456333..d3544873a 100644 --- a/examples/C/bufr_keys_iterator.c +++ b/examples/C/bufr_keys_iterator.c @@ -47,7 +47,7 @@ int main(int argc, char* argv[]) in = fopen(filename, "rb"); if (!in) { - printf("ERROR: unable to open file %s\n", filename); + fprintf(stderr, "Error: unable to open file %s\n", filename); return 1; } @@ -55,7 +55,7 @@ int main(int argc, char* argv[]) while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) { codes_bufr_keys_iterator* kiter = NULL; if (h == NULL) { - printf("Error: unable to create handle for message %d\n", cnt); + fprintf(stderr, "Error: unable to create handle for message %d\n", cnt); cnt++; continue; } @@ -68,7 +68,7 @@ int main(int argc, char* argv[]) /* get BUFR key iterator */ kiter = codes_bufr_keys_iterator_new(h, 0); if (!kiter) { - printf("ERROR: Unable to create BUFR keys iterator\n"); + fprintf(stderr, "Error: Unable to create BUFR keys iterator\n"); exit(1); } diff --git a/examples/C/bufr_missing.c b/examples/C/bufr_missing.c index 10a582924..2ff58225f 100644 --- a/examples/C/bufr_missing.c +++ b/examples/C/bufr_missing.c @@ -31,14 +31,14 @@ int main(int argc, char* argv[]) in = fopen(infile, "rb"); if (!in) { - printf("ERROR: unable to open file %s\n", infile); + fprintf(stderr, "Error: unable to open file %s\n", infile); return 1; } /* loop over the messages in the bufr file */ while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) { if (h == NULL) { - printf("Error: unable to create handle for message %d\n", cnt); + fprintf(stderr, "Error: unable to create handle for message %d\n", cnt); cnt++; continue; } diff --git a/examples/C/bufr_pthreads.c b/examples/C/bufr_pthreads.c index a9fc1fcd7..e07a676b3 100644 --- a/examples/C/bufr_pthreads.c +++ b/examples/C/bufr_pthreads.c @@ -56,6 +56,7 @@ static void* process_bufr(void* arg) CODES_CHECK(codes_set_long(h, "#3#verticalSignificanceSurfaceObservations", 8), 0); CODES_CHECK(codes_set_long(h, "pack", 1), 0); + codes_handle_delete(h); pthread_exit(NULL); } @@ -70,13 +71,13 @@ int main(int argc, char** argv) assert(fin); err = pthread_create(&thread1, NULL, process_bufr, (void*)fin); - assert(!err); + if (err) return 1; err = pthread_create(&thread2, NULL, process_bufr, (void*)fin); - assert(!err); + if (err) return 1; err = pthread_create(&thread3, NULL, process_bufr, (void*)fin); - assert(!err); + if (err) return 1; pthread_join(thread1, NULL); pthread_join(thread2, NULL); diff --git a/examples/C/bufr_read_header.c b/examples/C/bufr_read_header.c index c29482117..125d521ca 100644 --- a/examples/C/bufr_read_header.c +++ b/examples/C/bufr_read_header.c @@ -39,14 +39,14 @@ int main(int argc, char* argv[]) in = fopen(filename, "rb"); if (!in) { - printf("ERROR: unable to open file %s\n", filename); + fprintf(stderr, "Error: unable to open file %s\n", filename); return 1; } /* loop over the messages in the bufr file */ while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) { if (h == NULL) { - printf("Error: unable to create handle for message %d\n", cnt); + fprintf(stderr, "Error: unable to create handle for message %d\n", cnt); cnt++; continue; } diff --git a/examples/C/bufr_read_scatterometer.c b/examples/C/bufr_read_scatterometer.c index 914fe0753..244d8878f 100644 --- a/examples/C/bufr_read_scatterometer.c +++ b/examples/C/bufr_read_scatterometer.c @@ -40,14 +40,14 @@ int main(int argc, char* argv[]) in = fopen(infile, "rb"); if (!in) { - printf("ERROR: unable to open file %s\n", infile); + fprintf(stderr, "Error: unable to open file %s\n", infile); return 1; } /* Loop over the messages in the bufr file */ while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) { if (h == NULL) { - printf("Error: unable to create handle for message %d\n", cnt); + fprintf(stderr, "Error: unable to create handle for message %d\n", cnt); cnt++; continue; } @@ -76,7 +76,7 @@ int main(int argc, char* argv[]) /* Check the size (including all the subsets) */ CODES_CHECK(codes_get_size(h, key_name, &len), 0); if (len != numObs) { - printf("inconsistent number of %s values found!\n", key_name); + fprintf(stderr, "Error: inconsistent number of %s values found!\n", key_name); return 1; } @@ -93,7 +93,7 @@ int main(int argc, char* argv[]) /* Check the size (including all the subsets) */ CODES_CHECK(codes_get_size(h, key_name, &len), 0); if (len != numObs) { - printf("inconsistent number of %s values found!\n", key_name); + fprintf(stderr, "Error: inconsistent number of %s values found!\n", key_name); return 1; } @@ -107,7 +107,7 @@ int main(int argc, char* argv[]) /* Check the size (including all the subsets) */ CODES_CHECK(codes_get_size(h, key_name, &len), 0); if (len != numObs) { - printf("inconsistent number of %s values found!\n", key_name); + fprintf(stderr, "Error: inconsistent number of %s values found!\n", key_name); return 1; } diff --git a/examples/C/bufr_read_synop.c b/examples/C/bufr_read_synop.c index 280c17bba..8e0d8557a 100644 --- a/examples/C/bufr_read_synop.c +++ b/examples/C/bufr_read_synop.c @@ -21,7 +21,6 @@ * example. It is advised to use bufr_dump to understand the structure of the messages. */ - #include "eccodes.h" int main(int argc, char* argv[]) @@ -39,14 +38,14 @@ int main(int argc, char* argv[]) in = fopen(infile, "rb"); if (!in) { - printf("ERROR: unable to open file %s\n", infile); + fprintf(stderr, "Error: unable to open file %s\n", infile); return 1; } /* loop over the messages in the bufr file */ while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) { if (h == NULL) { - printf("Error: unable to create handle for message %d\n", cnt); + fprintf(stderr, "Error: unable to create handle for message %d\n", cnt); cnt++; continue; } diff --git a/examples/C/bufr_read_temp.c b/examples/C/bufr_read_temp.c index 2b8247459..0e7056372 100644 --- a/examples/C/bufr_read_temp.c +++ b/examples/C/bufr_read_temp.c @@ -47,14 +47,14 @@ int main(int argc, char* argv[]) in = fopen(infile, "rb"); if (!in) { - printf("ERROR: unable to open file %s\n", infile); + fprintf(stderr, "Error: unable to open file %s\n", infile); return 1; } /* Loop over the messages in the bufr file */ while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) { if (h == NULL) { - printf("Error: unable to create handle for message %d\n", cnt); + fprintf(stderr, "Error: unable to create handle for message %d\n", cnt); cnt++; continue; } @@ -104,7 +104,7 @@ int main(int argc, char* argv[]) /* Check the size */ CODES_CHECK(codes_get_size(h, key_name, &len), 0); if (len != sigt_len) { - printf("inconsistent number of geopotential values found!\n"); + fprintf(stderr, "Error: inconsistent number of geopotential values found!\n"); free_memory(sigt_pres, sigt_geo, sigt_t, sigt_td); return 1; } @@ -114,7 +114,7 @@ int main(int argc, char* argv[]) /* Get temperature */ if (len != sigt_len) { /* Check the size */ - printf("inconsistent number of temperature values found!\n"); + fprintf(stderr, "Error: inconsistent number of temperature values found!\n"); free_memory(sigt_pres, sigt_geo, sigt_t, sigt_td); return 1; } @@ -125,7 +125,7 @@ int main(int argc, char* argv[]) /* Get dew point */ if (len != sigt_len) { /* Check the size */ - printf("inconsistent number of dewpoint temperature values found!\n"); + fprintf(stderr, "Error: inconsistent number of dewpoint temperature values found!\n"); free_memory(sigt_pres, sigt_geo, sigt_t, sigt_td); return 1; } diff --git a/examples/C/bufr_set_keys.c b/examples/C/bufr_set_keys.c index b56d490c3..a3f383d4d 100644 --- a/examples/C/bufr_set_keys.c +++ b/examples/C/bufr_set_keys.c @@ -48,7 +48,7 @@ int main(int argc, char* argv[]) out = fopen(argv[1], "wb"); if (!in || !out) { - perror("ERROR: unable to open files"); + perror("Error: unable to open files"); if (out) fclose(out); if (in) fclose(in); return 1; @@ -57,7 +57,7 @@ int main(int argc, char* argv[]) /* loop over the messages in the bufr file */ while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) { if (h == NULL) { - printf("Error: unable to create handle for message %d\n", cnt); + fprintf(stderr, "Error: unable to create handle for message %d\n", cnt); cnt++; continue; } diff --git a/examples/C/bufr_subset.c b/examples/C/bufr_subset.c index 3d10f8e51..b9a0972c5 100644 --- a/examples/C/bufr_subset.c +++ b/examples/C/bufr_subset.c @@ -37,14 +37,14 @@ int main(int argc, char* argv[]) in = fopen(infile, "rb"); if (!in) { - printf("ERROR: unable to open file %s\n", infile); + fprintf(stderr, "Error: unable to open file %s\n", infile); return 1; } /* loop over the messages in the bufr file */ while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) { if (h == NULL) { - printf("Error: unable to create handle for message %d\n", cnt); + fprintf(stderr, "Error: unable to create handle for message %d\n", cnt); cnt++; continue; } diff --git a/examples/C/bufr_subset.sh b/examples/C/bufr_subset.sh index 0e68c9e8d..334aff8ca 100755 --- a/examples/C/bufr_subset.sh +++ b/examples/C/bufr_subset.sh @@ -15,7 +15,7 @@ label="bufr_subset_test_c" #Prepare tmp file fTmp=${label}.tmp.txt -rm -f $fTmp | true +rm -f $fTmp #Prepare ref file fRef=${label}.ref @@ -36,16 +36,14 @@ message: 0 subsetNumber=12 blockNumber=1 stationNumber=485 stationOrSiteName="SANDE-GALLEBERG" airTemperature=275.45 EOF -#We check "synop_multi_subset.bufr". The path is -#hardcoded in the example +# We check "synop_multi_subset.bufr". The path is +# hard coded in the example -REDIRECT=/dev/null +# Write the values into a file and compare with reference +${examples_dir}/c_bufr_subset > $fTmp -#Write the values into a file and compare with reference -${examples_dir}/c_bufr_subset 2> $REDIRECT > $fTmp +# We compare output to the reference by ignoring the whitespaces +diff -w $fRef $fTmp -#We compare output to the reference by ignoring the whitespaces -diff -w $fRef $fTmp >$REDIRECT 2> $REDIRECT - -#Clean up +# Clean up rm -f $fTmp $fRef diff --git a/examples/C/get_product_kind.c b/examples/C/get_product_kind.c index 30b471352..6ce47d6d2 100644 --- a/examples/C/get_product_kind.c +++ b/examples/C/get_product_kind.c @@ -36,13 +36,13 @@ int main(int argc, char* argv[]) infile = argv[1]; in = fopen(infile, "rb"); if (!in) { - printf("ERROR: unable to open file %s\n", infile); + fprintf(stderr, "Error: unable to open file %s\n", infile); return 1; } while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_ANY, &err)) != NULL || err != CODES_SUCCESS) { if (h == NULL) { - printf("Error: unable to create handle for message %d\n", cnt); + fprintf(stderr, "Error: unable to create handle for message %d\n", cnt); cnt++; continue; } diff --git a/examples/C/grib_ensemble_index.c b/examples/C/grib_ensemble_index.c index 1d461f76c..0de9fc260 100644 --- a/examples/C/grib_ensemble_index.c +++ b/examples/C/grib_ensemble_index.c @@ -65,7 +65,7 @@ int main(int argc, char* argv[]) /* create handle for next GRIB message */ h = codes_handle_new_from_index(index, &ret); if (ret) { - printf("Error: %s\n", codes_get_error_message(ret)); + fprintf(stderr, "Error: %s\n", codes_get_error_message(ret)); exit(ret); } diff --git a/examples/C/grib_get_data.c b/examples/C/grib_get_data.c index 04ca6f14c..7670aa66e 100644 --- a/examples/C/grib_get_data.c +++ b/examples/C/grib_get_data.c @@ -32,14 +32,14 @@ int main(int argc, char** argv) in = fopen(filename, "rb"); if (!in) { - printf("ERROR: unable to open input file %s\n", filename); + fprintf(stderr, "Error: unable to open input file %s\n", filename); return 1; } /* create new handle from a message in a file */ h = codes_handle_new_from_file(0, in, PRODUCT_GRIB, &err); if (h == NULL) { - printf("Error: unable to create handle from file %s\n", filename); + fprintf(stderr, "Error: unable to create handle from file %s\n", filename); return 1; } @@ -48,18 +48,18 @@ int main(int argc, char** argv) lats = (double*)malloc(numberOfPoints * sizeof(double)); if (!lats) { - printf("unable to allocate %ld bytes\n", (long)(numberOfPoints * sizeof(double))); + fprintf(stderr, "Error: unable to allocate %ld bytes\n", (long)(numberOfPoints * sizeof(double))); return 1; } lons = (double*)malloc(numberOfPoints * sizeof(double)); if (!lons) { - printf("unable to allocate %ld bytes\n", (long)(numberOfPoints * sizeof(double))); + fprintf(stderr, "Error: unable to allocate %ld bytes\n", (long)(numberOfPoints * sizeof(double))); free(lats); return 1; } values = (double*)malloc(numberOfPoints * sizeof(double)); if (!values) { - printf("unable to allocate %ld bytes\n", (long)(numberOfPoints * sizeof(double))); + fprintf(stderr, "Error: unable to allocate %ld bytes\n", (long)(numberOfPoints * sizeof(double))); free(lats); free(lons); return 1; diff --git a/examples/C/grib_get_keys.c b/examples/C/grib_get_keys.c index 916a48171..59d5034fe 100644 --- a/examples/C/grib_get_keys.c +++ b/examples/C/grib_get_keys.c @@ -46,14 +46,14 @@ int main(int argc, char** argv) in = fopen(filename, "rb"); if (!in) { - printf("ERROR: unable to open file %s\n", filename); + fprintf(stderr, "Error: unable to open file %s\n", filename); return 1; } /* create new handle from the first message in the file*/ h = codes_handle_new_from_file(0, in, PRODUCT_GRIB, &err); if (h == NULL) { - printf("Error: unable to create handle from file %s\n", filename); + fprintf(stderr, "Error: unable to create handle from file %s\n", filename); return 1; } fclose(in); diff --git a/examples/C/grib_index.c b/examples/C/grib_index.c index 1faf3cd92..1967948d8 100644 --- a/examples/C/grib_index.c +++ b/examples/C/grib_index.c @@ -45,14 +45,14 @@ int main(int argc, char* argv[]) /* Create an index given set of keys*/ index = codes_index_new(0, "shortName,level,number,step", &ret); if (ret) { - printf("error: %s\n", codes_get_error_message(ret)); + fprintf(stderr, "Error: %s\n", codes_get_error_message(ret)); exit(ret); } /* Indexes a file */ ret = codes_index_add_file(index, infile); if (ret) { - printf("error: %s\n", codes_get_error_message(ret)); + fprintf(stderr, "Error: %s\n", codes_get_error_message(ret)); exit(ret); } printf("end indexing...\n"); @@ -128,7 +128,7 @@ int main(int argc, char* argv[]) while ((h = codes_handle_new_from_index(index, &ret)) != NULL) { count++; if (ret) { - printf("error: %d\n", ret); + fprintf(stderr, "Error: %d\n", ret); exit(ret); } lenshortName = 200; @@ -143,7 +143,7 @@ int main(int argc, char* argv[]) codes_handle_delete(h); } if (ret && ret != GRIB_END_OF_INDEX) { - printf("error: %s\n", codes_get_error_message(ret)); + fprintf(stderr, "Error: %s\n", codes_get_error_message(ret)); exit(ret); } } diff --git a/examples/C/grib_iterator.c b/examples/C/grib_iterator.c index 122160817..92d8650f6 100644 --- a/examples/C/grib_iterator.c +++ b/examples/C/grib_iterator.c @@ -46,7 +46,7 @@ int main(int argc, char** argv) in = fopen(filename, "rb"); if (!in) { - printf("ERROR: unable to open file %s\n", filename); + fprintf(stderr, "Error: unable to open file %s\n", filename); return 1; } diff --git a/examples/C/grib_keys_iterator.c b/examples/C/grib_keys_iterator.c index dcff27c21..62a71f8a8 100644 --- a/examples/C/grib_keys_iterator.c +++ b/examples/C/grib_keys_iterator.c @@ -69,13 +69,13 @@ int main(int argc, char* argv[]) msg_count++; printf("-- GRIB N. %d --\n", msg_count); if (!h) { - printf("ERROR: Unable to create grib handle\n"); + fprintf(stderr, "Error: Unable to create grib handle\n"); exit(1); } kiter = codes_keys_iterator_new(h, key_iterator_filter_flags, name_space); if (!kiter) { - printf("ERROR: Unable to create keys iterator\n"); + fprintf(stderr, "Error: Unable to create keys iterator\n"); exit(1); } diff --git a/examples/C/grib_list.c b/examples/C/grib_list.c index aabfc0381..9ce006919 100644 --- a/examples/C/grib_list.c +++ b/examples/C/grib_list.c @@ -37,14 +37,14 @@ int main(int argc, char** argv) in = fopen(filename, "rb"); if (!in) { - printf("ERROR: unable to open input file %s\n", filename); + fprintf(stderr, "Error: unable to open input file %s\n", filename); return 1; } /* create new handle from a message in a file*/ h = codes_handle_new_from_file(0, in, PRODUCT_GRIB, &err); if (h == NULL) { - printf("Error: unable to create handle from file %s\n", filename); + fprintf(stderr, "Error: unable to create handle from file %s\n", filename); } CODES_CHECK(codes_get_long(h, "numberOfContributingSpectralBands", &numberOfContributingSpectralBands), 0); diff --git a/examples/C/grib_multi.c b/examples/C/grib_multi.c index 1f29975a6..93ea8ad02 100644 --- a/examples/C/grib_multi.c +++ b/examples/C/grib_multi.c @@ -37,7 +37,7 @@ int main(int argc, char** argv) in = fopen(filename, "rb"); if (!in) { - printf("ERROR: unable to open file %s\n", filename); + fprintf(stderr, "Error: unable to open file %s\n", filename); return 1; } diff --git a/examples/C/grib_precipitation.c b/examples/C/grib_precipitation.c index 2a0431502..5e6297364 100644 --- a/examples/C/grib_precipitation.c +++ b/examples/C/grib_precipitation.c @@ -47,7 +47,7 @@ int main(int argc, char** argv) in = fopen(filename, "rb"); if (!in) { - printf("ERROR: unable to open file %s\n", filename); + fprintf(stderr, "ERROR: unable to open file %s\n", filename); return 1; } diff --git a/examples/C/grib_precision.c b/examples/C/grib_precision.c index a1838cf22..d24f20793 100644 --- a/examples/C/grib_precision.c +++ b/examples/C/grib_precision.c @@ -47,13 +47,13 @@ int main(int argc, char** argv) in = fopen(infile, "rb"); if (!in) { - printf("ERROR: unable to open input file %s\n", infile); + fprintf(stderr, "Error: unable to open input file %s\n", infile); return 1; } out = fopen(outfile, "wb"); if (!out) { - printf("ERROR: unable to open output file %s\n", outfile); + fprintf(stderr, "Error: unable to open output file %s\n", outfile); fclose(in); return 1; } @@ -61,7 +61,7 @@ int main(int argc, char** argv) /* create a new handle from a message in a file */ h = codes_handle_new_from_file(0, in, PRODUCT_GRIB, &err); if (h == NULL) { - printf("Error: unable to create handle from file %s\n", infile); + fprintf(stderr, "Error: unable to create handle from file %s\n", infile); } /* bitsPerValue before changing the packing parameters */ diff --git a/examples/C/grib_print_data.c b/examples/C/grib_print_data.c index 915ea4cac..beab7a4d6 100644 --- a/examples/C/grib_print_data.c +++ b/examples/C/grib_print_data.c @@ -41,14 +41,14 @@ int main(int argc, char** argv) in = fopen(filename, "rb"); if (!in) { - printf("ERROR: unable to open file %s\n", filename); + fprintf(stderr, "Error: unable to open file %s\n", filename); return 1; } /* create new handle from a message in a file*/ h = codes_handle_new_from_file(0, in, PRODUCT_GRIB, &err); if (h == NULL) { - printf("Error: unable to create handle from file %s\n", filename); + fprintf(stderr, "Error: unable to create handle from file %s\n", filename); } /* get the size of the values array*/ diff --git a/examples/C/grib_set_bitmap.c b/examples/C/grib_set_bitmap.c index aeac7fbe0..2db451cff 100644 --- a/examples/C/grib_set_bitmap.c +++ b/examples/C/grib_set_bitmap.c @@ -13,7 +13,6 @@ * * Description: how to set a bitmap in a GRIB message * - * */ #include @@ -39,20 +38,20 @@ int main(int argc, char** argv) in = fopen(infile, "rb"); if (!in) { - printf("ERROR: unable to open input file %s\n", infile); + fprintf(stderr, "Error: unable to open input file %s\n", infile); return 1; } out = fopen(outfile, "wb"); if (!out) { - printf("ERROR: unable to open output file %s\n", outfile); + fprintf(stderr, "Error: unable to open output file %s\n", outfile); fclose(in); return 1; } h = codes_handle_new_from_file(0, in, PRODUCT_GRIB, &err); if (h == NULL) { - printf("Error: unable to create handle from file %s\n", infile); + fprintf(stderr, "Error: unable to create handle from file %s\n", infile); } CODES_CHECK(codes_set_double(h, "missingValue", missing), 0); @@ -83,7 +82,7 @@ int main(int argc, char** argv) } codes_handle_delete(h); - + free(values); fclose(in); fclose(out); diff --git a/examples/C/grib_set_data.c b/examples/C/grib_set_data.c index 2b5918763..a23bdf0ac 100644 --- a/examples/C/grib_set_data.c +++ b/examples/C/grib_set_data.c @@ -49,7 +49,7 @@ int main(int argc, char** argv) printf("Using samples path: %s\n", samples_path); h = codes_grib_handle_new_from_samples(0, sample_filename); if (h == NULL) { - printf("Error: unable to create handle from sample file %s\n", sample_filename); + fprintf(stderr, "Error: unable to create handle from sample file %s\n", sample_filename); exit(1); } diff --git a/examples/C/grib_set_keys.c b/examples/C/grib_set_keys.c index f800dea93..bd623008f 100644 --- a/examples/C/grib_set_keys.c +++ b/examples/C/grib_set_keys.c @@ -38,13 +38,13 @@ int main(int argc, char** argv) in = fopen(infile, "rb"); if (!in) { - printf("ERROR: unable to open file %s\n", infile); + fprintf(stderr, "Error: unable to open file %s\n", infile); return 1; } out = fopen(outfile, "wb"); if (!out) { - printf("ERROR: unable to open file %s\n", outfile); + fprintf(stderr, "Error: unable to open file %s\n", outfile); fclose(in); return 1; } @@ -52,7 +52,7 @@ int main(int argc, char** argv) /* create a new handle from a message in a file */ h = codes_handle_new_from_file(0, in, PRODUCT_GRIB, &err); if (h == NULL) { - printf("Error: unable to create handle from file %s\n", infile); + fprintf(stderr, "Error: unable to create handle from file %s\n", infile); } /* set centre as a long */ diff --git a/examples/C/include.ctest.sh.in b/examples/C/include.ctest.sh.in index d221f0ddd..4e725db65 100644 --- a/examples/C/include.ctest.sh.in +++ b/examples/C/include.ctest.sh.in @@ -4,6 +4,8 @@ set -eax proj_dir=@PROJECT_SOURCE_DIR@ data_dir=@PROJECT_BINARY_DIR@/data +HAVE_PRODUCT_BUFR=@HAVE_PRODUCT_BUFR@ +HAVE_PRODUCT_GRIB=@HAVE_PRODUCT_GRIB@ HAVE_MEMFS=@HAVE_MEMFS@ # use definitions from binary dir to test if installation will be correct diff --git a/examples/C/set_missing.c b/examples/C/set_missing.c index cae2ab76a..487306999 100644 --- a/examples/C/set_missing.c +++ b/examples/C/set_missing.c @@ -36,13 +36,13 @@ int main(int argc, char** argv) in = fopen(infile, "rb"); if (!in) { - printf("ERROR: unable to open input file %s\n", infile); + fprintf(stderr, "Error: unable to open input file %s\n", infile); return 1; } out = fopen(outfile, "wb"); if (!out) { - printf("ERROR: unable to open output file %s\n", outfile); + fprintf(stderr, "Error: unable to open output file %s\n", outfile); fclose(in); return 1; } @@ -50,7 +50,7 @@ int main(int argc, char** argv) /* create a new handle from a message in a file */ h = codes_handle_new_from_file(0, in, PRODUCT_GRIB, &err); if (h == NULL) { - printf("Error: unable to create handle from file %s\n", infile); + fprintf(stderr, "Error: unable to create handle from file %s\n", infile); } CODES_CHECK(codes_set_string(h, "typeOfFirstFixedSurface", str, &str_len), 0); diff --git a/examples/C/values_check.c b/examples/C/values_check.c index abb155487..0db03e54d 100644 --- a/examples/C/values_check.c +++ b/examples/C/values_check.c @@ -29,7 +29,7 @@ int main(int argc, char* argv[]) h = codes_handle_new_from_file(c, f, PRODUCT_GRIB, &err); if (!h) { - printf("unable to create handle from file %s\n", infile); + fprintf(stderr, "unable to create handle from file %s\n", infile); exit(err); } fclose(f); @@ -48,7 +48,7 @@ int main(int argc, char* argv[]) for (i = 0; i < nvalues; i++) { if (values[i].error == err) name = (char*)values[i].name; } - printf("ERROR: \"%s\" %s\n", name, codes_get_error_message(err)); + fprintf(stderr, "Error: \"%s\" %s\n", name, codes_get_error_message(err)); } values[1].name = "levelll"; @@ -57,7 +57,7 @@ int main(int argc, char* argv[]) for (i = 0; i < nvalues; i++) { if (values[i].error == err) name = (char*)values[i].name; } - printf("ERROR: \"%s\" %s\n", name, codes_get_error_message(err)); + fprintf(stderr, "Error: \"%s\" %s\n", name, codes_get_error_message(err)); } return 0; diff --git a/examples/F90/CMakeLists.txt b/examples/F90/CMakeLists.txt index 45ebf151c..964a34603 100644 --- a/examples/F90/CMakeLists.txt +++ b/examples/F90/CMakeLists.txt @@ -10,8 +10,7 @@ execute_process( COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_S list( APPEND tests_basic grib_set_pv grib_set_data - grib_ecc-671 -) + grib_ecc-671 ) list( APPEND tests_extra grib_index grib_copy_message @@ -52,8 +51,7 @@ list( APPEND tests_extra bufr_set_keys bufr_copy_keys bufr_subset - get_product_kind -) + get_product_kind ) foreach( tool ${tests_basic} ) ecbuild_add_test( TARGET eccodes_f_${tool} @@ -62,8 +60,7 @@ foreach( tool ${tests_basic} ) LIBS eccodes_f90 eccodes CONDITION HAVE_FORTRAN RESOURCES bufr_read_scatterometer_f.ref - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${tool}.sh - ) + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${tool}.sh ) endforeach() foreach( tool ${tests_extra} ) ecbuild_add_test( TARGET eccodes_f_${tool} @@ -73,8 +70,7 @@ foreach( tool ${tests_extra} ) CONDITION HAVE_FORTRAN AND ENABLE_EXTRA_TESTS RESOURCES bufr_read_scatterometer_f.ref COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${tool}.sh - TEST_DEPENDS eccodes_download_gribs eccodes_download_bufrs - ) + TEST_DEPENDS eccodes_download_gribs eccodes_download_bufrs ) endforeach() # Executables without a shell script @@ -84,22 +80,19 @@ ecbuild_add_executable( TARGET eccodes_f_new_from_file SOURCES new_from_file.f90 CONDITION HAVE_FORTRAN LINKER_LANGUAGE Fortran - LIBS eccodes_f90 eccodes -) + LIBS eccodes_f90 eccodes ) ecbuild_add_executable( TARGET eccodes_f_grib_set_gvc NOINSTALL SOURCES grib_set_gvc.f90 CONDITION HAVE_FORTRAN LINKER_LANGUAGE Fortran - LIBS eccodes_f90 eccodes -) + LIBS eccodes_f90 eccodes ) ecbuild_add_executable( TARGET eccodes_f_grib_print_data_static NOINSTALL SOURCES grib_print_data_static.f90 CONDITION HAVE_FORTRAN LINKER_LANGUAGE Fortran - LIBS eccodes_f90 eccodes -) + LIBS eccodes_f90 eccodes ) # # Note extra dependency diff --git a/examples/F90/get_product_kind.f90 b/examples/F90/get_product_kind.f90 index d446fde6b..f04dd0edb 100644 --- a/examples/F90/get_product_kind.f90 +++ b/examples/F90/get_product_kind.f90 @@ -30,6 +30,14 @@ program get_product_kind call codes_get_api_version(version) write(*,*) 'API version: ',version + write(*,*) 'ecCodes settings: ' + write(*,*) ' ECCODES_POSIX_THREADS: ',ECCODES_SETTINGS_POSIX_THREADS + write(*,*) ' ECCODES_OMP_THREADS: ',ECCODES_SETTINGS_OMP_THREADS + write(*,*) ' ECCODES_SETTINGS_MEMFS: ',ECCODES_SETTINGS_MEMFS + write(*,*) ' ECCODES_SETTINGS_JPEG: ',ECCODES_SETTINGS_JPEG + write(*,*) ' ECCODES_SETTINGS_PNG: ',ECCODES_SETTINGS_PNG + write(*,*) ' ECCODES_SETTINGS_AEC: ',ECCODES_SETTINGS_AEC + ! the first message is loaded from file ! ihandle is the message id to be used in subsequent calls call codes_new_from_file(ifile,ihandle,CODES_PRODUCT_ANY,iret) diff --git a/examples/F90/include.ctest.sh.in b/examples/F90/include.ctest.sh.in index e73107145..510ec17aa 100644 --- a/examples/F90/include.ctest.sh.in +++ b/examples/F90/include.ctest.sh.in @@ -4,6 +4,8 @@ set -eax proj_dir=@PROJECT_SOURCE_DIR@ data_dir=@PROJECT_BINARY_DIR@/data +HAVE_PRODUCT_BUFR=@HAVE_PRODUCT_BUFR@ +HAVE_PRODUCT_GRIB=@HAVE_PRODUCT_GRIB@ HAVE_MEMFS=@HAVE_MEMFS@ # use definitions from binary dir to test if installation will be correct diff --git a/examples/python/CMakeLists.txt b/examples/python/CMakeLists.txt index 0a6b6a0cd..158b0629f 100644 --- a/examples/python/CMakeLists.txt +++ b/examples/python/CMakeLists.txt @@ -7,7 +7,7 @@ execute_process( COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_S # Build the executables used by test scripts ################################################ -list( APPEND test_bins +list(APPEND test_bins grib_keys_iterator grib_print_data grib_iterator @@ -19,21 +19,20 @@ foreach( tool ${test_bins} ) NOINSTALL SOURCES ${tool}.c CONDITION HAVE_PYTHON - LIBS eccodes - ) + LIBS eccodes ) list( APPEND ptools p_${tool} ) endforeach() # Now add each test ################################################# -list( APPEND tests_basic +list(APPEND tests_basic grib_set_pv grib_read_sample bufr_read_sample bufr_ecc-869 ) -list( APPEND tests_extra +list(APPEND tests_extra grib_clone grib_count_messages grib_get_message_offset @@ -81,8 +80,7 @@ foreach( test ${tests_basic} ) DEPENDS ${ptools} COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${test}.sh CONDITION HAVE_PYTHON - ENVIRONMENT PYTHON=${PYTHON_EXECUTABLE} - ) + ENVIRONMENT PYTHON=${PYTHON_EXECUTABLE} ) endforeach() foreach( test ${tests_extra} ) ecbuild_add_test( TARGET eccodes_p_${test}_test @@ -91,8 +89,7 @@ foreach( test ${tests_extra} ) COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${test}.sh CONDITION HAVE_PYTHON AND ENABLE_EXTRA_TESTS ENVIRONMENT PYTHON=${PYTHON_EXECUTABLE} - TEST_DEPENDS eccodes_download_gribs eccodes_download_tigge_gribs eccodes_download_bufrs - ) + TEST_DEPENDS eccodes_download_gribs eccodes_download_tigge_gribs eccodes_download_bufrs ) endforeach() # Add test which requires input CSV file @@ -103,8 +100,7 @@ ecbuild_add_test( TARGET eccodes_p_bufr_encode_flight_test CONDITION HAVE_PYTHON AND ENABLE_EXTRA_TESTS ENVIRONMENT PYTHON=${PYTHON_EXECUTABLE} RESOURCES flight_data.csv - TEST_DEPENDS eccodes_download_bufrs -) + TEST_DEPENDS eccodes_download_bufrs ) # Conditional tests ecbuild_add_test( TARGET eccodes_p_grib_ccsds_test @@ -113,5 +109,4 @@ ecbuild_add_test( TARGET eccodes_p_grib_ccsds_test COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_ccsds.sh CONDITION HAVE_PYTHON AND HAVE_AEC AND ENABLE_EXTRA_TESTS ENVIRONMENT PYTHON=${PYTHON_EXECUTABLE} - TEST_DEPENDS eccodes_download_gribs -) + TEST_DEPENDS eccodes_download_gribs ) diff --git a/examples/python/include.ctest.sh.in b/examples/python/include.ctest.sh.in index 5b651aece..eef69671a 100644 --- a/examples/python/include.ctest.sh.in +++ b/examples/python/include.ctest.sh.in @@ -3,6 +3,8 @@ set -eax data_dir=@PROJECT_BINARY_DIR@/data +HAVE_PRODUCT_BUFR=@HAVE_PRODUCT_BUFR@ +HAVE_PRODUCT_GRIB=@HAVE_PRODUCT_GRIB@ HAVE_MEMFS=@HAVE_MEMFS@ # use definitions from binary dir to test if installation will be correct diff --git a/fortran/CMakeLists.txt b/fortran/CMakeLists.txt index c0099c342..cfd9e7607 100644 --- a/fortran/CMakeLists.txt +++ b/fortran/CMakeLists.txt @@ -1,5 +1,7 @@ if( HAVE_FORTRAN ) + configure_file( eccodes_settings.h.in eccodes_settings.h @ONLY ) + set( srcdir ${CMAKE_CURRENT_SOURCE_DIR} ) set( bindir ${CMAKE_CURRENT_BINARY_DIR} ) @@ -56,8 +58,7 @@ if( HAVE_FORTRAN ) add_custom_command( TARGET eccodes_f90 POST_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/include COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_Fortran_MODULE_DIRECTORY}/${CMAKE_CFG_INTDIR}/eccodes.mod ${CMAKE_BINARY_DIR}/include - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_Fortran_MODULE_DIRECTORY}/${CMAKE_CFG_INTDIR}/grib_api.mod ${CMAKE_BINARY_DIR}/include - ) + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_Fortran_MODULE_DIRECTORY}/${CMAKE_CFG_INTDIR}/grib_api.mod ${CMAKE_BINARY_DIR}/include ) # Add the eccodes module file as well #set(_eccodes_mod "${CMAKE_Fortran_MODULE_DIRECTORY}/eccodes.mod" ) diff --git a/fortran/eccodes_f90_head.f90 b/fortran/eccodes_f90_head.f90 index a93c62faa..36e73b40d 100644 --- a/fortran/eccodes_f90_head.f90 +++ b/fortran/eccodes_f90_head.f90 @@ -15,6 +15,7 @@ module eccodes implicit none include "eccodes_constants.h" include "eccodes_visibility.h" + include "eccodes_settings.h" real(8), parameter,public :: CODES_MISSING_DOUBLE = -1.D+100 integer(4), parameter,public :: CODES_MISSING_LONG = 2147483647 diff --git a/fortran/eccodes_settings.h.in b/fortran/eccodes_settings.h.in new file mode 100644 index 000000000..2a0229726 --- /dev/null +++ b/fortran/eccodes_settings.h.in @@ -0,0 +1,6 @@ +integer, parameter, public :: ECCODES_SETTINGS_POSIX_THREADS = @HAVE_ECCODES_THREADS@ +integer, parameter, public :: ECCODES_SETTINGS_OMP_THREADS = @HAVE_ECCODES_OMP_THREADS@ +integer, parameter, public :: ECCODES_SETTINGS_MEMFS = @HAVE_MEMFS@ +integer, parameter, public :: ECCODES_SETTINGS_JPEG = @HAVE_JPEG@ +integer, parameter, public :: ECCODES_SETTINGS_PNG = @HAVE_PNG@ +integer, parameter, public :: ECCODES_SETTINGS_AEC = @HAVE_AEC@ diff --git a/ifs_samples/grib1/CMakeLists.txt b/ifs_samples/grib1/CMakeLists.txt index 42f9ea257..378c2b3f6 100644 --- a/ifs_samples/grib1/CMakeLists.txt +++ b/ifs_samples/grib1/CMakeLists.txt @@ -7,7 +7,6 @@ list( APPEND ifs_samples_${_basedir} ${CMAKE_CURRENT_SOURCE_DIR}/gg_sfc.tmpl ${CMAKE_CURRENT_SOURCE_DIR}/sh_ml.tmpl ${CMAKE_CURRENT_SOURCE_DIR}/sh_sfc.tmpl - ${ECCODES_SAMPLES_FILES} -) + ${ECCODES_SAMPLES_FILES} ) install_samples( ifs_samples_${_basedir} ${_destination_install} ${_destination_build} ) diff --git a/ifs_samples/grib1_mlgrib2/CMakeLists.txt b/ifs_samples/grib1_mlgrib2/CMakeLists.txt index 5b597ce7b..6ec0486a6 100644 --- a/ifs_samples/grib1_mlgrib2/CMakeLists.txt +++ b/ifs_samples/grib1_mlgrib2/CMakeLists.txt @@ -7,7 +7,6 @@ list( APPEND ifs_samples_${_basedir} ${CMAKE_CURRENT_SOURCE_DIR}/gg_sfc.tmpl ${CMAKE_CURRENT_SOURCE_DIR}/sh_ml.tmpl ${CMAKE_CURRENT_SOURCE_DIR}/sh_sfc.tmpl - ${ECCODES_SAMPLES_FILES} -) + ${ECCODES_SAMPLES_FILES} ) install_samples( ifs_samples_${_basedir} ${_destination_install} ${_destination_build} ) diff --git a/ifs_samples/grib1_mlgrib2_ieee32/CMakeLists.txt b/ifs_samples/grib1_mlgrib2_ieee32/CMakeLists.txt index 3b3e3b567..49fd08333 100644 --- a/ifs_samples/grib1_mlgrib2_ieee32/CMakeLists.txt +++ b/ifs_samples/grib1_mlgrib2_ieee32/CMakeLists.txt @@ -7,7 +7,6 @@ list( APPEND ifs_samples_${_basedir} ${CMAKE_CURRENT_SOURCE_DIR}/gg_sfc.tmpl ${CMAKE_CURRENT_SOURCE_DIR}/sh_ml.tmpl ${CMAKE_CURRENT_SOURCE_DIR}/sh_sfc.tmpl - ${ECCODES_SAMPLES_FILES} -) + ${ECCODES_SAMPLES_FILES} ) install_samples( ifs_samples_${_basedir} ${_destination_install} ${_destination_build} ) diff --git a/ifs_samples/grib1_mlgrib2_ieee64/CMakeLists.txt b/ifs_samples/grib1_mlgrib2_ieee64/CMakeLists.txt index efffb7446..16ec73dba 100644 --- a/ifs_samples/grib1_mlgrib2_ieee64/CMakeLists.txt +++ b/ifs_samples/grib1_mlgrib2_ieee64/CMakeLists.txt @@ -7,7 +7,6 @@ list( APPEND ifs_samples_${_basedir} ${CMAKE_CURRENT_SOURCE_DIR}/gg_sfc.tmpl ${CMAKE_CURRENT_SOURCE_DIR}/sh_ml.tmpl ${CMAKE_CURRENT_SOURCE_DIR}/sh_sfc.tmpl - ${ECCODES_SAMPLES_FILES} -) + ${ECCODES_SAMPLES_FILES} ) install_samples( ifs_samples_${_basedir} ${_destination_install} ${_destination_build} ) diff --git a/memfs.py b/memfs.py index 07d422648..484e14618 100755 --- a/memfs.py +++ b/memfs.py @@ -12,7 +12,7 @@ # METAR and TAF are also experimental EXCLUDED = ['grib3', 'codetables', 'taf', 'metar'] -pos=1 +pos = 1 if sys.argv[1] == '-exclude': product = sys.argv[2] if product == 'bufr': @@ -28,7 +28,9 @@ print('Excluding: ', EXCLUDED) FILES = {} +SIZES = {} NAMES = [] +CHUNK = 5500 * 1000 # chunk size in bytes # Binary to ASCII function. Different in Python 2 and 3 try: @@ -38,20 +40,28 @@ ascii = lambda x: str(x) # Python 2 -# The last argument is the path of the generated C file -output_file_path = sys.argv[-1] -g = open(output_file_path, "w") +def get_outfile_name(base, count): + return base + "_" + str(count).zfill(3) + ".c" + + +# The last argument is the base name of the generated C file(s) +output_file_base = sys.argv[-1] +totsize = 0 # amount written +fcount = 0 +opath = get_outfile_name(output_file_base, fcount) +print('MEMFS: Generating output: ', opath) +g = open(opath, "w") for directory in dirs: - # print("---->", directory) + # print("MEMFS: directory=", directory) dname = os.path.basename(directory) NAMES.append(dname) for dirpath, dirnames, files in os.walk(directory, followlinks=True): - for ex in EXCLUDED: - if ex in dirnames: - print('Note: eccodes memfs.py script: %s/%s will not be included.' % (dirpath,ex)) + # for ex in EXCLUDED: + # if ex in dirnames: + # print('Note: eccodes memfs.py script: %s/%s will not be included.' % (dirpath,ex)) # Prune the walk by modifying the dirnames in-place dirnames[:] = [dirname for dirname in dirnames if dirname not in EXCLUDED] @@ -61,34 +71,51 @@ if ext not in ['.def', '.table', '.tmpl']: continue - full = full.replace("\\","/") + fsize = os.path.getsize(full) + totsize += fsize + full = full.replace("\\", "/") fname = full[full.find("/%s/" % (dname,)):] - #print("MEMFS add", fname) + #print("MEMFS: Add ", fname) name = re.sub(r'\W', '_', fname) assert name not in FILES + assert name not in SIZES FILES[name] = fname + SIZES[name] = fsize - print('static const unsigned char %s[] = {' % (name,), file=g) + print('const unsigned char %s[] = {' % (name,), file=g) with open(full, 'rb') as f: i = 0 - #Python 2 - #fcont = f.read().encode("hex") + # Python 2 + #contents_hex = f.read().encode("hex") - #Python 2 and 3 - fcont = binascii.hexlify(f.read()) + # Python 2 and 3 + contents_hex = binascii.hexlify(f.read()) # Read two characters at a time and convert to C hex # e.g. 23 -> 0x23 - for n in range(0, len(fcont), 2): - twoChars = ascii(fcont[n:n+2]) + for n in range(0, len(contents_hex), 2): + twoChars = ascii(contents_hex[n:n + 2]) print("0x%s," % (twoChars,), end="", file=g) i += 1 if (i % 20) == 0: print("", file=g) print('};', file=g) + if totsize >= CHUNK: + g.close() + fcount += 1 + opath = get_outfile_name(output_file_base, fcount) + print('MEMFS: Generating output: ', opath) + g = open(opath, "w") + totsize = 0 + +g.close() +assert fcount == 3 +opath = output_file_base + "_final.c" +print('MEMFS: Generating output: ', opath) +g = open(opath, "w") print(""" #include "eccodes_config.h" @@ -101,7 +128,13 @@ #include #include #include "eccodes_windef.h" +""", file=g) +# Write extern variables with sizes +for k, v in SIZES.items(): + print('extern const unsigned char %s[%d];' % (k, v), file=g) + +print(""" struct entry { const char* path; const unsigned char* content; @@ -111,7 +144,7 @@ items = [(v, k) for k, v in FILES.items()] for k, v in sorted(items): - print ('{"/MEMFS%s", &%s[0], sizeof(%s) / sizeof(%s[0]) },' % (k, v, v, v), file=g) + print('{"/MEMFS%s", &%s[0], sizeof(%s) / sizeof(%s[0]) },' % (k, v, v, v), file=g) print("""}; @@ -264,4 +297,5 @@ } """, file=g) -print ('Created ',output_file_path) + +print('Finished') diff --git a/memfs/CMakeLists.txt b/memfs/CMakeLists.txt index 48da54ad3..0f5da4be9 100644 --- a/memfs/CMakeLists.txt +++ b/memfs/CMakeLists.txt @@ -4,17 +4,26 @@ if( NOT HAVE_PRODUCT_BUFR ) elseif( NOT HAVE_PRODUCT_GRIB ) set( exclude -exclude grib ) endif() + +set( generated_c_files + ${CMAKE_CURRENT_BINARY_DIR}/memfs_gen_000.c + ${CMAKE_CURRENT_BINARY_DIR}/memfs_gen_001.c + ${CMAKE_CURRENT_BINARY_DIR}/memfs_gen_002.c + ${CMAKE_CURRENT_BINARY_DIR}/memfs_gen_003.c + ${CMAKE_CURRENT_BINARY_DIR}/memfs_gen_final.c) + add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/memfs.c + OUTPUT ${generated_c_files} COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/memfs.py ${exclude} ${PROJECT_SOURCE_DIR}/definitions ${PROJECT_SOURCE_DIR}/samples ${PROJECT_SOURCE_DIR}/ifs_samples - ${CMAKE_CURRENT_BINARY_DIR}/memfs.c - DEPENDS ${PROJECT_SOURCE_DIR}/memfs.py ) + ${CMAKE_CURRENT_BINARY_DIR}/memfs_gen + DEPENDS ${PROJECT_SOURCE_DIR}/memfs.py) -set_source_files_properties( ${CMAKE_CURRENT_BINARY_DIR}/memfs.c PROPERTIES OBJECT_DEPENDS +set_source_files_properties( + ${generated_c_files} PROPERTIES OBJECT_DEPENDS "${PROJECT_SOURCE_DIR}/memfs.py" # "${PROJECT_SOURCE_DIR}/memfs.py" ${definition_files}" ) @@ -25,8 +34,8 @@ if( CMAKE_C_COMPILER_ID MATCHES Cray ) string( REGEX REPLACE "-g|-G[ 0-3]" " " CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE_CAPS} "${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE_CAPS}}" ) endif() -if (HAVE_MEMFS) +if( HAVE_MEMFS ) ecbuild_add_library(TARGET eccodes_memfs - SOURCES ${CMAKE_CURRENT_BINARY_DIR}/memfs.c - GENERATED ${CMAKE_CURRENT_BINARY_DIR}/memfs.c) + SOURCES ${generated_c_files} + GENERATED ${generated_c_files}) endif() diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 33aa1f0c1..08572574a 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -7,19 +7,19 @@ if( HAVE_PYTHON ) # preparing for generating setup.py if( HAVE_LIBJASPER ) - get_filename_component(JASPER_DIR ${JASPER_INCLUDE_DIR} PATH ) + get_filename_component( JASPER_DIR ${JASPER_INCLUDE_DIR} PATH ) endif() if( HAVE_LIBOPENJPEG ) # Get the name of the OpenJPEG library: version dependent! # E.g. openjpeg (version 1.5) or openjp2 (version 2.x) - get_filename_component(OPENJPEG_LIB_DIR ${OPENJPEG_LIBRARY} PATH ) - get_filename_component(OJ_NAME_WE ${OPENJPEG_LIBRARY} NAME_WE ) - STRING(REGEX REPLACE "^lib" "" OJ_WITHOUT_LIB ${OJ_NAME_WE}) + get_filename_component( OPENJPEG_LIB_DIR ${OPENJPEG_LIBRARY} PATH ) + get_filename_component( OJ_NAME_WE ${OPENJPEG_LIBRARY} NAME_WE ) + string(REGEX REPLACE "^lib" "" OJ_WITHOUT_LIB ${OJ_NAME_WE}) endif() if( HAVE_AEC ) - get_filename_component(AEC_DIR ${AEC_INCLUDE_DIR} PATH ) + get_filename_component( AEC_DIR ${AEC_INCLUDE_DIR} PATH ) endif() configure_file( setup.py.in setup.py ) diff --git a/python/grib_interface.c b/python/grib_interface.c index d07efd5fc..6934343e9 100644 --- a/python/grib_interface.c +++ b/python/grib_interface.c @@ -12,55 +12,54 @@ #include "assert.h" #if HAVE_SYS_TYPES_H -# include +#include #endif #if HAVE_SYS_STAT_H -# include +#include #endif #ifdef HAVE_FCNTL_H -# include +#include #endif #include #include #if GRIB_PTHREADS - static pthread_once_t once = PTHREAD_ONCE_INIT; - static pthread_mutex_t handle_mutex = PTHREAD_MUTEX_INITIALIZER; - static pthread_mutex_t index_mutex = PTHREAD_MUTEX_INITIALIZER; - static pthread_mutex_t multi_handle_mutex = PTHREAD_MUTEX_INITIALIZER; - static pthread_mutex_t iterator_mutex = PTHREAD_MUTEX_INITIALIZER; - static pthread_mutex_t keys_iterator_mutex = PTHREAD_MUTEX_INITIALIZER; - - static void init() { - pthread_mutexattr_t attr; - - pthread_mutexattr_init(&attr); - pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init(&handle_mutex,&attr); - pthread_mutex_init(&index_mutex,&attr); - pthread_mutex_init(&multi_handle_mutex,&attr); - pthread_mutex_init(&iterator_mutex,&attr); - pthread_mutex_init(&keys_iterator_mutex,&attr); - pthread_mutexattr_destroy(&attr); - - } +static pthread_once_t once = PTHREAD_ONCE_INIT; +static pthread_mutex_t handle_mutex = PTHREAD_MUTEX_INITIALIZER; +static pthread_mutex_t index_mutex = PTHREAD_MUTEX_INITIALIZER; +static pthread_mutex_t multi_handle_mutex = PTHREAD_MUTEX_INITIALIZER; +static pthread_mutex_t iterator_mutex = PTHREAD_MUTEX_INITIALIZER; +static pthread_mutex_t keys_iterator_mutex = PTHREAD_MUTEX_INITIALIZER; + +static void init() +{ + pthread_mutexattr_t attr; + + pthread_mutexattr_init(&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&handle_mutex, &attr); + pthread_mutex_init(&index_mutex, &attr); + pthread_mutex_init(&multi_handle_mutex, &attr); + pthread_mutex_init(&iterator_mutex, &attr); + pthread_mutex_init(&keys_iterator_mutex, &attr); + pthread_mutexattr_destroy(&attr); +} #elif GRIB_OMP_THREADS - static int once = 0; - static omp_nest_lock_t handle_mutex; - static omp_nest_lock_t index_mutex; - static omp_nest_lock_t multi_handle_mutex; - static omp_nest_lock_t iterator_mutex; - static omp_nest_lock_t keys_iterator_mutex; - - static void init() - { +static int once = 0; +static omp_nest_lock_t handle_mutex; +static omp_nest_lock_t index_mutex; +static omp_nest_lock_t multi_handle_mutex; +static omp_nest_lock_t iterator_mutex; +static omp_nest_lock_t keys_iterator_mutex; + +static void init() +{ GRIB_OMP_CRITICAL(lock_python) { - if (once == 0) - { + if (once == 0) { omp_init_nest_lock(&handle_mutex); omp_init_nest_lock(&index_mutex); omp_init_nest_lock(&multi_handle_mutex); @@ -69,15 +68,16 @@ once = 1; } } - } +} #endif -int GRIB_NULL=-1; -int GRIB_NULL_NEAREST=-1; +int GRIB_NULL = -1; +int GRIB_NULL_NEAREST = -1; typedef struct l_grib_file l_grib_file; -struct l_grib_file { +struct l_grib_file +{ int id; FILE* f; l_grib_file* next; @@ -85,7 +85,8 @@ struct l_grib_file { typedef struct l_grib_handle l_grib_handle; -struct l_grib_handle { +struct l_grib_handle +{ int id; grib_handle* h; l_grib_handle* next; @@ -93,7 +94,8 @@ struct l_grib_handle { typedef struct l_grib_index l_grib_index; -struct l_grib_index { +struct l_grib_index +{ int id; grib_index* h; l_grib_index* next; @@ -101,7 +103,8 @@ struct l_grib_index { typedef struct l_grib_multi_handle l_grib_multi_handle; -struct l_grib_multi_handle { +struct l_grib_multi_handle +{ int id; grib_multi_handle* h; l_grib_multi_handle* next; @@ -109,360 +112,365 @@ struct l_grib_multi_handle { typedef struct l_grib_iterator l_grib_iterator; -struct l_grib_iterator { +struct l_grib_iterator +{ int id; grib_iterator* i; l_grib_iterator* next; }; typedef struct l_grib_keys_iterator l_grib_keys_iterator; -struct l_grib_keys_iterator { +struct l_grib_keys_iterator +{ int id; grib_keys_iterator* i; l_grib_keys_iterator* next; }; typedef struct l_bufr_keys_iterator l_bufr_keys_iterator; -struct l_bufr_keys_iterator { +struct l_bufr_keys_iterator +{ int id; bufr_keys_iterator* i; l_bufr_keys_iterator* next; }; -static l_grib_handle* handle_set = NULL; -static l_grib_index* index_set = NULL; -static l_grib_multi_handle* multi_handle_set = NULL; -static l_grib_file* file_set = NULL; -static l_grib_iterator* iterator_set = NULL; -static l_grib_keys_iterator* keys_iterator_set = NULL; +static l_grib_handle* handle_set = NULL; +static l_grib_index* index_set = NULL; +static l_grib_multi_handle* multi_handle_set = NULL; +static l_grib_file* file_set = NULL; +static l_grib_iterator* iterator_set = NULL; +static l_grib_keys_iterator* keys_iterator_set = NULL; static l_bufr_keys_iterator* bufr_keys_iterator_set = NULL; -static int push_file(FILE* f){ +static int push_file(FILE* f) +{ l_grib_file* current = file_set; l_grib_file* previous = file_set; l_grib_file* new = NULL; - int myindex = 1; + int myindex = 1; - if(!file_set){ - file_set = malloc(sizeof(l_grib_file)); + if (!file_set) { + file_set = malloc(sizeof(l_grib_file)); file_set->id = myindex; file_set->f = f; file_set->next = NULL; return myindex; } - while(current){ - if(current->id < 0){ + while (current) { + if (current->id < 0) { current->id = -(current->id); - current->f = f; - return current->id ; - } else{ + current->f = f; + return current->id; + } + else { myindex++; previous = current; - current = current->next; + current = current->next; } } - new = malloc(sizeof(l_grib_file)); - new->id = myindex; - new->f = f; - new->next = current; + new = malloc(sizeof(l_grib_file)); + new->id = myindex; + new->f = f; + new->next = current; previous->next = new; return myindex; } -static void _push_handle(grib_handle *h,int *gid) +static void _push_handle(grib_handle* h, int* gid) { - l_grib_handle* current= handle_set; - l_grib_handle* previous= handle_set; - l_grib_handle* new= NULL; - int myindex= 1; + l_grib_handle* current = handle_set; + l_grib_handle* previous = handle_set; + l_grib_handle* new = NULL; + int myindex = 1; - if (*gid > 0 ) { - while(current) { - if(current->id == *gid) break; + if (*gid > 0) { + while (current) { + if (current->id == *gid) break; current = current->next; } if (current) { grib_handle_delete(current->h); - current->h=h; + current->h = h; return; } } - current= handle_set; + current = handle_set; - if(!handle_set){ - handle_set = malloc(sizeof(l_grib_handle)); + if (!handle_set) { + handle_set = malloc(sizeof(l_grib_handle)); handle_set->id = myindex; handle_set->h = h; handle_set->next = NULL; - *gid=myindex; + *gid = myindex; return; } - while(current){ - if(current->id < 0){ + while (current) { + if (current->id < 0) { current->id = -(current->id); current->h = h; - *gid=current->id; + *gid = current->id; return; } - else{ + else { myindex++; previous = current; - current = current->next; + current = current->next; } } - new = malloc(sizeof(l_grib_handle)); - new->id = myindex; - new->h = h; - new->next = current; + new = malloc(sizeof(l_grib_handle)); + new->id = myindex; + new->h = h; + new->next = current; previous->next = new; - *gid=myindex; + *gid = myindex; return; } -static void _push_index(grib_index *h,int *gid) +static void _push_index(grib_index* h, int* gid) { - l_grib_index* current= index_set; - l_grib_index* previous= index_set; - l_grib_index* new= NULL; - int myindex= 1; + l_grib_index* current = index_set; + l_grib_index* previous = index_set; + l_grib_index* new = NULL; + int myindex = 1; - if (*gid > 0 ) { - while(current) { - if(current->id == *gid) break; + if (*gid > 0) { + while (current) { + if (current->id == *gid) break; current = current->next; } if (current) { grib_index_delete(current->h); - current->h=h; + current->h = h; return; } } - current= index_set; + current = index_set; - if(!index_set){ - index_set = malloc(sizeof(l_grib_index)); + if (!index_set) { + index_set = malloc(sizeof(l_grib_index)); index_set->id = myindex; index_set->h = h; index_set->next = NULL; - *gid=myindex; + *gid = myindex; return; } - while(current){ - if(current->id < 0){ + while (current) { + if (current->id < 0) { current->id = -(current->id); current->h = h; - *gid=current->id; + *gid = current->id; return; } - else{ + else { myindex++; previous = current; - current = current->next; + current = current->next; } } - new = malloc(sizeof(l_grib_index)); - new->id = myindex; - new->h = h; - new->next = current; + new = malloc(sizeof(l_grib_index)); + new->id = myindex; + new->h = h; + new->next = current; previous->next = new; - *gid=myindex; + *gid = myindex; return; } -static void _push_multi_handle(grib_multi_handle *h,int *gid) +static void _push_multi_handle(grib_multi_handle* h, int* gid) { - l_grib_multi_handle* current= multi_handle_set; - l_grib_multi_handle* previous= multi_handle_set; - l_grib_multi_handle* new= NULL; - int myindex= 1; + l_grib_multi_handle* current = multi_handle_set; + l_grib_multi_handle* previous = multi_handle_set; + l_grib_multi_handle* new = NULL; + int myindex = 1; - if (*gid > 0 ) { - while(current) { - if(current->id == *gid) break; + if (*gid > 0) { + while (current) { + if (current->id == *gid) break; current = current->next; } if (current) { grib_multi_handle_delete(current->h); - current->h=h; + current->h = h; return; } } - current= multi_handle_set; + current = multi_handle_set; - if(!multi_handle_set){ - multi_handle_set = malloc(sizeof(l_grib_multi_handle)); + if (!multi_handle_set) { + multi_handle_set = malloc(sizeof(l_grib_multi_handle)); multi_handle_set->id = myindex; multi_handle_set->h = h; multi_handle_set->next = NULL; - *gid=myindex; + *gid = myindex; return; } - while(current){ - if(current->id < 0){ + while (current) { + if (current->id < 0) { current->id = -(current->id); current->h = h; - *gid=current->id; + *gid = current->id; return; } - else{ + else { myindex++; previous = current; - current = current->next; + current = current->next; } } - new = malloc(sizeof(l_grib_multi_handle)); - new->id = myindex; - new->h = h; - new->next = current; + new = malloc(sizeof(l_grib_multi_handle)); + new->id = myindex; + new->h = h; + new->next = current; previous->next = new; - *gid=myindex; + *gid = myindex; return; } -static void push_handle(grib_handle *h,int *gid) +static void push_handle(grib_handle* h, int* gid) { - GRIB_MUTEX_INIT_ONCE(&once,&init) + GRIB_MUTEX_INIT_ONCE(&once, &init) GRIB_MUTEX_LOCK(&handle_mutex) - _push_handle(h,gid); + _push_handle(h, gid); GRIB_MUTEX_UNLOCK(&handle_mutex) return; } -static void push_index(grib_index *h,int *gid) +static void push_index(grib_index* h, int* gid) { - GRIB_MUTEX_INIT_ONCE(&once,&init) + GRIB_MUTEX_INIT_ONCE(&once, &init) GRIB_MUTEX_LOCK(&index_mutex) - _push_index(h,gid); + _push_index(h, gid); GRIB_MUTEX_UNLOCK(&index_mutex) return; } -static void push_multi_handle(grib_multi_handle *h,int *gid) +static void push_multi_handle(grib_multi_handle* h, int* gid) { - GRIB_MUTEX_INIT_ONCE(&once,&init) + GRIB_MUTEX_INIT_ONCE(&once, &init) GRIB_MUTEX_LOCK(&multi_handle_mutex) - _push_multi_handle(h,gid); + _push_multi_handle(h, gid); GRIB_MUTEX_UNLOCK(&multi_handle_mutex) return; } -static int _push_iterator(grib_iterator *i) +static int _push_iterator(grib_iterator* i) { l_grib_iterator* current = iterator_set; l_grib_iterator* previous = iterator_set; l_grib_iterator* new = NULL; - int myindex = 1; + int myindex = 1; - if(!iterator_set){ - iterator_set = malloc(sizeof(l_grib_iterator)); + if (!iterator_set) { + iterator_set = malloc(sizeof(l_grib_iterator)); iterator_set->id = myindex; iterator_set->i = i; iterator_set->next = NULL; return myindex; } - while(current){ - if(current->id < 0){ + while (current) { + if (current->id < 0) { current->id = -(current->id); current->i = i; return current->id; } - else{ + else { myindex++; previous = current; - current = current->next; + current = current->next; } } - new = malloc(sizeof(l_grib_iterator)); - new->id = myindex; - new->i = i; - new->next = current; + new = malloc(sizeof(l_grib_iterator)); + new->id = myindex; + new->i = i; + new->next = current; previous->next = new; return myindex; } -static int push_iterator(grib_iterator *i) +static int push_iterator(grib_iterator* i) { - int ret=0; - GRIB_MUTEX_INIT_ONCE(&once,&init) + int ret = 0; + GRIB_MUTEX_INIT_ONCE(&once, &init) GRIB_MUTEX_LOCK(&iterator_mutex) - ret=_push_iterator(i); + ret = _push_iterator(i); GRIB_MUTEX_UNLOCK(&iterator_mutex) return ret; } -static int _push_keys_iterator(grib_keys_iterator *i) +static int _push_keys_iterator(grib_keys_iterator* i) { l_grib_keys_iterator* current = keys_iterator_set; l_grib_keys_iterator* previous = keys_iterator_set; l_grib_keys_iterator* new = NULL; - int myindex = 1; + int myindex = 1; - if(!keys_iterator_set){ - keys_iterator_set = malloc(sizeof(l_grib_keys_iterator)); + if (!keys_iterator_set) { + keys_iterator_set = malloc(sizeof(l_grib_keys_iterator)); keys_iterator_set->id = myindex; keys_iterator_set->i = i; keys_iterator_set->next = NULL; return myindex; } - while(current){ - if(current->id < 0){ + while (current) { + if (current->id < 0) { current->id = -(current->id); current->i = i; return current->id; } - else{ + else { myindex++; previous = current; - current = current->next; + current = current->next; } } - if(!previous) return -1; + if (!previous) return -1; - new = malloc(sizeof(l_grib_keys_iterator)); - new->id = myindex; - new->i = i; - new->next = current; + new = malloc(sizeof(l_grib_keys_iterator)); + new->id = myindex; + new->i = i; + new->next = current; previous->next = new; return myindex; } -static int push_keys_iterator(grib_keys_iterator *i) +static int push_keys_iterator(grib_keys_iterator* i) { - int ret=0; - GRIB_MUTEX_INIT_ONCE(&once,&init) + int ret = 0; + GRIB_MUTEX_INIT_ONCE(&once, &init) GRIB_MUTEX_LOCK(&keys_iterator_mutex) - ret=_push_keys_iterator(i); + ret = _push_keys_iterator(i); GRIB_MUTEX_UNLOCK(&keys_iterator_mutex) return ret; } //BUFR keys iterator -static int _push_bufr_keys_iterator(bufr_keys_iterator *i) +static int _push_bufr_keys_iterator(bufr_keys_iterator* i) { l_bufr_keys_iterator* current = bufr_keys_iterator_set; l_bufr_keys_iterator* previous = bufr_keys_iterator_set; - l_bufr_keys_iterator* the_new = NULL; - int myindex = 1; + l_bufr_keys_iterator* the_new = NULL; + int myindex = 1; - if(!bufr_keys_iterator_set){ + if (!bufr_keys_iterator_set) { bufr_keys_iterator_set = (l_bufr_keys_iterator*)malloc(sizeof(l_bufr_keys_iterator)); Assert(bufr_keys_iterator_set); bufr_keys_iterator_set->id = myindex; @@ -471,19 +479,19 @@ static int _push_bufr_keys_iterator(bufr_keys_iterator *i) return myindex; } - while(current){ - if(current->id < 0){ + while (current) { + if (current->id < 0) { current->id = -(current->id); current->i = i; return current->id; } - else{ + else { myindex++; previous = current; - current = current->next; + current = current->next; } } - if(!previous) return -1; + if (!previous) return -1; the_new = (l_bufr_keys_iterator*)malloc(sizeof(l_bufr_keys_iterator)); Assert(the_new); @@ -494,12 +502,12 @@ static int _push_bufr_keys_iterator(bufr_keys_iterator *i) return myindex; } -static int push_bufr_keys_iterator(bufr_keys_iterator *i) +static int push_bufr_keys_iterator(bufr_keys_iterator* i) { - int ret=0; - GRIB_MUTEX_INIT_ONCE(&once,&init); + int ret = 0; + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&keys_iterator_mutex); - ret=_push_bufr_keys_iterator(i); + ret = _push_bufr_keys_iterator(i); GRIB_MUTEX_UNLOCK(&keys_iterator_mutex); return ret; } @@ -507,10 +515,10 @@ static int push_bufr_keys_iterator(bufr_keys_iterator *i) static grib_handle* _get_handle(int handle_id) { - l_grib_handle* current= handle_set; + l_grib_handle* current = handle_set; - while(current){ - if(current->id == handle_id) return current->h; + while (current) { + if (current->id == handle_id) return current->h; current = current->next; } @@ -519,10 +527,10 @@ static grib_handle* _get_handle(int handle_id) static grib_index* _get_index(int index_id) { - l_grib_index* current= index_set; + l_grib_index* current = index_set; - while(current){ - if(current->id == index_id) return current->h; + while (current) { + if (current->id == index_id) return current->h; current = current->next; } @@ -531,10 +539,10 @@ static grib_index* _get_index(int index_id) static grib_multi_handle* _get_multi_handle(int multi_handle_id) { - l_grib_multi_handle* current= multi_handle_set; + l_grib_multi_handle* current = multi_handle_set; - while(current){ - if(current->id == multi_handle_id) return current->h; + while (current) { + if (current->id == multi_handle_id) return current->h; current = current->next; } @@ -543,39 +551,39 @@ static grib_multi_handle* _get_multi_handle(int multi_handle_id) static grib_handle* get_handle(int handle_id) { - grib_handle* h=NULL; - GRIB_MUTEX_INIT_ONCE(&once,&init) + grib_handle* h = NULL; + GRIB_MUTEX_INIT_ONCE(&once, &init) GRIB_MUTEX_LOCK(&handle_mutex) - h=_get_handle(handle_id); + h = _get_handle(handle_id); GRIB_MUTEX_UNLOCK(&handle_mutex) return h; } static grib_index* get_index(int index_id) { - grib_index* h=NULL; - GRIB_MUTEX_INIT_ONCE(&once,&init) + grib_index* h = NULL; + GRIB_MUTEX_INIT_ONCE(&once, &init) GRIB_MUTEX_LOCK(&index_mutex) - h=_get_index(index_id); + h = _get_index(index_id); GRIB_MUTEX_UNLOCK(&index_mutex) return h; } static grib_multi_handle* get_multi_handle(int multi_handle_id) { - grib_multi_handle* h=NULL; - GRIB_MUTEX_INIT_ONCE(&once,&init) + grib_multi_handle* h = NULL; + GRIB_MUTEX_INIT_ONCE(&once, &init) GRIB_MUTEX_LOCK(&multi_handle_mutex) - h=_get_multi_handle(multi_handle_id); + h = _get_multi_handle(multi_handle_id); GRIB_MUTEX_UNLOCK(&multi_handle_mutex) return h; } static FILE* get_file(int file_id) { - l_grib_file* current = file_set; - while(current){ - if(current->id == file_id) return current->f; + l_grib_file* current = file_set; + while (current) { + if (current->id == file_id) return current->f; current = current->next; } return NULL; @@ -583,40 +591,40 @@ static FILE* get_file(int file_id) static grib_iterator* _get_iterator(int iterator_id) { - l_grib_iterator* current = iterator_set; + l_grib_iterator* current = iterator_set; - while(current){ - if(current->id == iterator_id) return current->i; + while (current) { + if (current->id == iterator_id) return current->i; current = current->next; } return NULL; } static grib_iterator* get_iterator(int iterator_id) { - grib_iterator* i=NULL; - GRIB_MUTEX_INIT_ONCE(&once,&init) + grib_iterator* i = NULL; + GRIB_MUTEX_INIT_ONCE(&once, &init) GRIB_MUTEX_LOCK(&iterator_mutex) - i=_get_iterator(iterator_id); + i = _get_iterator(iterator_id); GRIB_MUTEX_UNLOCK(&iterator_mutex) return i; } static grib_keys_iterator* _get_keys_iterator(int keys_iterator_id) { - l_grib_keys_iterator* current = keys_iterator_set; + l_grib_keys_iterator* current = keys_iterator_set; - while(current){ - if(current->id == keys_iterator_id) return current->i; + while (current) { + if (current->id == keys_iterator_id) return current->i; current = current->next; } return NULL; } static grib_keys_iterator* get_keys_iterator(int keys_iterator_id) { - grib_keys_iterator* i=NULL; - GRIB_MUTEX_INIT_ONCE(&once,&init) + grib_keys_iterator* i = NULL; + GRIB_MUTEX_INIT_ONCE(&once, &init) GRIB_MUTEX_LOCK(&keys_iterator_mutex) - i=_get_keys_iterator(keys_iterator_id); + i = _get_keys_iterator(keys_iterator_id); GRIB_MUTEX_UNLOCK(&keys_iterator_mutex) return i; } @@ -624,20 +632,20 @@ static grib_keys_iterator* get_keys_iterator(int keys_iterator_id) //BUFR keys iterator static bufr_keys_iterator* _get_bufr_keys_iterator(int keys_iterator_id) { - l_bufr_keys_iterator* current = bufr_keys_iterator_set; + l_bufr_keys_iterator* current = bufr_keys_iterator_set; - while(current){ - if(current->id == keys_iterator_id) return current->i; + while (current) { + if (current->id == keys_iterator_id) return current->i; current = current->next; } return NULL; } static bufr_keys_iterator* get_bufr_keys_iterator(int keys_iterator_id) { - bufr_keys_iterator* i=NULL; - GRIB_MUTEX_INIT_ONCE(&once,&init) + bufr_keys_iterator* i = NULL; + GRIB_MUTEX_INIT_ONCE(&once, &init) GRIB_MUTEX_LOCK(&keys_iterator_mutex) - i=_get_bufr_keys_iterator(keys_iterator_id); + i = _get_bufr_keys_iterator(keys_iterator_id); GRIB_MUTEX_UNLOCK(&keys_iterator_mutex) return i; } @@ -646,15 +654,16 @@ static bufr_keys_iterator* get_bufr_keys_iterator(int keys_iterator_id) static int clear_file(int file_id) { l_grib_file* current = file_set; - int ret = 0; - while(current){ - if(current->id == file_id){ + int ret = 0; + while (current) { + if (current->id == file_id) { current->id = -(current->id); if (current->f) { ret = fclose(current->f); if (0 == ret) { return GRIB_SUCCESS; - } else { + } + else { return GRIB_IO_PROBLEM; } } @@ -667,13 +676,13 @@ static int clear_file(int file_id) static int _clear_handle(int handle_id) { - l_grib_handle* current = handle_set; + l_grib_handle* current = handle_set; /* look for the input grib id to release it */ - while(current){ - if(current->id == handle_id){ + while (current) { + if (current->id == handle_id) { current->id = -(current->id); - if(current->h) return grib_handle_delete(current->h); + if (current->h) return grib_handle_delete(current->h); } current = current->next; } @@ -684,10 +693,10 @@ static int _clear_handle(int handle_id) static int _clear_index(int index_id) { - l_grib_index* current = index_set; + l_grib_index* current = index_set; - while(current){ - if(current->id == index_id){ + while (current) { + if (current->id == index_id) { current->id = -(current->id); if (current->h) { grib_index_delete(current->h); @@ -701,12 +710,12 @@ static int _clear_index(int index_id) static int _clear_multi_handle(int multi_handle_id) { - l_grib_multi_handle* current = multi_handle_set; + l_grib_multi_handle* current = multi_handle_set; - while(current){ - if(current->id == multi_handle_id){ + while (current) { + if (current->id == multi_handle_id) { current->id = -(current->id); - if(current->h) return grib_multi_handle_delete(current->h); + if (current->h) return grib_multi_handle_delete(current->h); } current = current->next; } @@ -715,40 +724,40 @@ static int _clear_multi_handle(int multi_handle_id) static int clear_handle(int handle_id) { - int ret=0; - GRIB_MUTEX_INIT_ONCE(&once,&init) + int ret = 0; + GRIB_MUTEX_INIT_ONCE(&once, &init) GRIB_MUTEX_LOCK(&handle_mutex) - ret=_clear_handle(handle_id); + ret = _clear_handle(handle_id); GRIB_MUTEX_UNLOCK(&handle_mutex) return ret; } static int clear_index(int index_id) { - int ret=0; - GRIB_MUTEX_INIT_ONCE(&once,&init) + int ret = 0; + GRIB_MUTEX_INIT_ONCE(&once, &init) GRIB_MUTEX_LOCK(&index_mutex) - ret=_clear_index(index_id); + ret = _clear_index(index_id); GRIB_MUTEX_UNLOCK(&index_mutex) return ret; } static int clear_multi_handle(int multi_handle_id) { - int ret=0; - GRIB_MUTEX_INIT_ONCE(&once,&init) + int ret = 0; + GRIB_MUTEX_INIT_ONCE(&once, &init) GRIB_MUTEX_LOCK(&multi_handle_mutex) - ret=_clear_multi_handle(multi_handle_id); + ret = _clear_multi_handle(multi_handle_id); GRIB_MUTEX_UNLOCK(&multi_handle_mutex) return ret; } static int _clear_iterator(int iterator_id) { - l_grib_iterator* current = iterator_set; + l_grib_iterator* current = iterator_set; - while(current){ - if(current->id == iterator_id){ + while (current) { + if (current->id == iterator_id) { current->id = -(current->id); return grib_iterator_delete(current->i); } @@ -759,20 +768,20 @@ static int _clear_iterator(int iterator_id) static int clear_iterator(int iterator_id) { - int ret=0; - GRIB_MUTEX_INIT_ONCE(&once,&init) + int ret = 0; + GRIB_MUTEX_INIT_ONCE(&once, &init) GRIB_MUTEX_LOCK(&iterator_mutex) - ret=_clear_iterator(iterator_id); + ret = _clear_iterator(iterator_id); GRIB_MUTEX_UNLOCK(&iterator_mutex) return ret; } static int _clear_keys_iterator(int keys_iterator_id) { - l_grib_keys_iterator* current = keys_iterator_set; + l_grib_keys_iterator* current = keys_iterator_set; - while(current){ - if(current->id == keys_iterator_id){ + while (current) { + if (current->id == keys_iterator_id) { current->id = -(current->id); return grib_keys_iterator_delete(current->i); } @@ -782,10 +791,10 @@ static int _clear_keys_iterator(int keys_iterator_id) } static int clear_keys_iterator(int keys_iterator_id) { - int ret=0; - GRIB_MUTEX_INIT_ONCE(&once,&init) + int ret = 0; + GRIB_MUTEX_INIT_ONCE(&once, &init) GRIB_MUTEX_LOCK(&keys_iterator_mutex) - ret=_clear_keys_iterator(keys_iterator_id); + ret = _clear_keys_iterator(keys_iterator_id); GRIB_MUTEX_UNLOCK(&keys_iterator_mutex) return ret; } @@ -793,10 +802,10 @@ static int clear_keys_iterator(int keys_iterator_id) //BUFR keys iterator static int _clear_bufr_keys_iterator(int keys_iterator_id) { - l_bufr_keys_iterator* current = bufr_keys_iterator_set; + l_bufr_keys_iterator* current = bufr_keys_iterator_set; - while(current){ - if(current->id == keys_iterator_id){ + while (current) { + if (current->id == keys_iterator_id) { current->id = -(current->id); return codes_bufr_keys_iterator_delete(current->i); } @@ -806,10 +815,10 @@ static int _clear_bufr_keys_iterator(int keys_iterator_id) } static int clear_bufr_keys_iterator(int keys_iterator_id) { - int ret=0; - GRIB_MUTEX_INIT_ONCE(&once,&init); + int ret = 0; + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&keys_iterator_mutex); - ret=_clear_bufr_keys_iterator(keys_iterator_id); + ret = _clear_bufr_keys_iterator(keys_iterator_id); GRIB_MUTEX_UNLOCK(&keys_iterator_mutex); return ret; } @@ -817,16 +826,17 @@ static int clear_bufr_keys_iterator(int keys_iterator_id) int grib_c_read_any_from_file(int* fid, char* buffer, int* nbytes) { grib_context* c; - int err=0; - size_t size=(size_t)nbytes; - FILE* f=get_file(*fid); + int err = 0; + size_t size = (size_t)nbytes; + FILE* f = get_file(*fid); if (f) { - c=grib_context_get_default( ); - err=grib_read_any_from_file(c,f,buffer,&size); - *nbytes=size; + c = grib_context_get_default(); + err = grib_read_any_from_file(c, f, buffer, &size); + *nbytes = size; return err; - } else { + } + else { return GRIB_INVALID_FILE; } } @@ -834,18 +844,19 @@ int grib_c_read_any_from_file(int* fid, char* buffer, int* nbytes) int grib_c_write_file(int* fid, char* buffer, int* nbytes) { grib_context* c; - FILE* f=get_file(*fid); + FILE* f = get_file(*fid); if (f) { int ioerr; - c=grib_context_get_default( ); - if( fwrite(buffer, 1, *nbytes, f) != *nbytes) { - ioerr=errno; - grib_context_log(c,(GRIB_LOG_ERROR)|(GRIB_LOG_PERROR),"IO ERROR: %s",strerror(ioerr)); + c = grib_context_get_default(); + if (fwrite(buffer, 1, *nbytes, f) != *nbytes) { + ioerr = errno; + grib_context_log(c, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), "IO ERROR: %s", strerror(ioerr)); return GRIB_IO_PROBLEM; } return GRIB_SUCCESS; - } else { + } + else { return GRIB_INVALID_FILE; } } @@ -853,93 +864,98 @@ int grib_c_write_file(int* fid, char* buffer, int* nbytes) int grib_c_read_file(int* fid, char* buffer, int* nbytes) { grib_context* c; - FILE* f=get_file(*fid); + FILE* f = get_file(*fid); if (f) { int ioerr; - c=grib_context_get_default( ); - if( fread(buffer, 1, *nbytes, f) != *nbytes) { - ioerr=errno; - grib_context_log(c,(GRIB_LOG_ERROR)|(GRIB_LOG_PERROR),"IO ERROR: %s",strerror(ioerr)); + c = grib_context_get_default(); + if (fread(buffer, 1, *nbytes, f) != *nbytes) { + ioerr = errno; + grib_context_log(c, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), "IO ERROR: %s", strerror(ioerr)); return GRIB_IO_PROBLEM; } return GRIB_SUCCESS; - } else { + } + else { return GRIB_INVALID_FILE; } } -int grib_c_open_file(int* fid, char* name , char* op) +int grib_c_open_file(int* fid, char* name, char* op) { - FILE* f = NULL; - int ioerr=0; - int ret=GRIB_SUCCESS; + FILE* f = NULL; + int ioerr = 0; + int ret = GRIB_SUCCESS; /*TODO Proper context passed as external parameter */ - grib_context* context=grib_context_get_default(); + grib_context* context = grib_context_get_default(); - f = fopen(name,op); + f = fopen(name, op); - if(!f) { - ioerr=errno; - grib_context_log(context,(GRIB_LOG_ERROR)|(GRIB_LOG_PERROR),"IO ERROR: %s: %s",strerror(ioerr),name); + if (!f) { + ioerr = errno; + grib_context_log(context, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), "IO ERROR: %s: %s", strerror(ioerr), name); *fid = -1; - ret=GRIB_IO_PROBLEM; - } else { + ret = GRIB_IO_PROBLEM; + } + else { *fid = push_file(f); - ret=GRIB_SUCCESS; + ret = GRIB_SUCCESS; } return ret; } -int grib_c_close_file(int* fid){ +int grib_c_close_file(int* fid) +{ return clear_file(*fid); } -int grib_c_multi_support_on(void) { +int grib_c_multi_support_on(void) +{ grib_multi_support_on(0); return GRIB_SUCCESS; } -int grib_c_multi_support_off(void) { +int grib_c_multi_support_off(void) +{ grib_multi_support_off(0); return GRIB_SUCCESS; } -static int _grib_c_iterator_new_(int* gid,int* iterid,int* mode) +static int _grib_c_iterator_new_(int* gid, int* iterid, int* mode) { - int err=0; + int err = 0; grib_handle* h; grib_iterator* iter; - h=get_handle(*gid); + h = get_handle(*gid); if (!h) { - *iterid=-1; + *iterid = -1; return GRIB_NULL_HANDLE; } - iter=grib_iterator_new(h,*mode,&err); + iter = grib_iterator_new(h, *mode, &err); if (iter) - *iterid=push_iterator(iter); + *iterid = push_iterator(iter); else - *iterid=-1; + *iterid = -1; return err; } -int grib_c_iterator_new(int* gid,int* iterid,int* mode) +int grib_c_iterator_new(int* gid, int* iterid, int* mode) { - int ret=0; - GRIB_MUTEX_INIT_ONCE(&once,&init) + int ret = 0; + GRIB_MUTEX_INIT_ONCE(&once, &init) GRIB_MUTEX_LOCK(&iterator_mutex) - ret=_grib_c_iterator_new_(gid,iterid,mode); + ret = _grib_c_iterator_new_(gid, iterid, mode); GRIB_MUTEX_UNLOCK(&iterator_mutex) return ret; } -int grib_c_iterator_next(int* iterid,double* lat,double* lon,double* value) +int grib_c_iterator_next(int* iterid, double* lat, double* lon, double* value) { - grib_iterator* iter=get_iterator(*iterid); + grib_iterator* iter = get_iterator(*iterid); if (!iter) return GRIB_INVALID_ITERATOR; - return grib_iterator_next(iter,lat,lon,value); + return grib_iterator_next(iter, lat, lon, value); } int grib_c_iterator_delete(int* iterid) @@ -947,30 +963,30 @@ int grib_c_iterator_delete(int* iterid) return clear_iterator(*iterid); } -static int _grib_c_keys_iterator_new_(int* gid,int* iterid,char* name_space) +static int _grib_c_keys_iterator_new_(int* gid, int* iterid, char* name_space) { - int err=0; + int err = 0; grib_handle* h; grib_keys_iterator* iter; - h=get_handle(*gid); + h = get_handle(*gid); if (!h) { - *iterid=-1; + *iterid = -1; return GRIB_NULL_HANDLE; } - iter=grib_keys_iterator_new(h,0,name_space); + iter = grib_keys_iterator_new(h, 0, name_space); if (iter) - *iterid=push_keys_iterator(iter); + *iterid = push_keys_iterator(iter); else - *iterid=-1; + *iterid = -1; return err; } -int grib_c_keys_iterator_new(int* gid,int* iterid,char* name_space) +int grib_c_keys_iterator_new(int* gid, int* iterid, char* name_space) { - int ret=0; - GRIB_MUTEX_INIT_ONCE(&once,&init) + int ret = 0; + GRIB_MUTEX_INIT_ONCE(&once, &init) GRIB_MUTEX_LOCK(&keys_iterator_mutex) - ret=_grib_c_keys_iterator_new_(gid,iterid,name_space); + ret = _grib_c_keys_iterator_new_(gid, iterid, name_space); GRIB_MUTEX_UNLOCK(&keys_iterator_mutex) return ret; } @@ -978,7 +994,7 @@ int grib_c_keys_iterator_next(int* iterid) { int ret = 0; - grib_keys_iterator* iter= get_keys_iterator(*iterid); + grib_keys_iterator* iter = get_keys_iterator(*iterid); if (!iter) return GRIB_INVALID_KEYS_ITERATOR; @@ -990,68 +1006,68 @@ int grib_c_keys_iterator_delete(int* iterid) { return clear_keys_iterator(*iterid); } -int grib_c_keys_iterator_get_name(int* iterid,char* name,int len) +int grib_c_keys_iterator_get_name(int* iterid, char* name, int len) { - size_t lsize=len; - char buf[1024]={0,}; + size_t lsize = len; + char buf[1024] = {0,}; - grib_keys_iterator* kiter=get_keys_iterator(*iterid); + grib_keys_iterator* kiter = get_keys_iterator(*iterid); if (!kiter) return GRIB_INVALID_KEYS_ITERATOR; - if (grib_keys_iterator_get_accessor(kiter)==NULL) + if (grib_keys_iterator_get_accessor(kiter) == NULL) return GRIB_INVALID_KEYS_ITERATOR; - sprintf(buf,"%s",grib_keys_iterator_get_name(kiter)); - lsize=strlen(buf); + sprintf(buf, "%s", grib_keys_iterator_get_name(kiter)); + lsize = strlen(buf); if (len < lsize) return GRIB_ARRAY_TOO_SMALL; - memcpy(name,buf,lsize); + memcpy(name, buf, lsize); name[lsize] = '\0'; return 0; } int grib_c_keys_iterator_rewind(int* kiter) { - grib_keys_iterator* i=get_keys_iterator(*kiter); + grib_keys_iterator* i = get_keys_iterator(*kiter); if (!i) return GRIB_INVALID_KEYS_ITERATOR; return grib_keys_iterator_rewind(i); } /*BUFR keys iterator*/ -static int _codes_c_bufr_keys_iterator_new_(int* gid,int* iterid) +static int _codes_c_bufr_keys_iterator_new_(int* gid, int* iterid) { - int err=0; + int err = 0; grib_handle* h; bufr_keys_iterator* iter; - h=get_handle(*gid); + h = get_handle(*gid); if (!h) { - *iterid=-1; + *iterid = -1; return GRIB_NULL_HANDLE; } - iter=codes_bufr_keys_iterator_new(h,0); + iter = codes_bufr_keys_iterator_new(h, 0); if (iter) - *iterid=push_bufr_keys_iterator(iter); + *iterid = push_bufr_keys_iterator(iter); else - *iterid=-1; + *iterid = -1; return err; } -int codes_c_bufr_keys_iterator_new(int* gid,int* iterid) +int codes_c_bufr_keys_iterator_new(int* gid, int* iterid) { - int ret=0; - GRIB_MUTEX_INIT_ONCE(&once,&init) + int ret = 0; + GRIB_MUTEX_INIT_ONCE(&once, &init) GRIB_MUTEX_LOCK(&keys_iterator_mutex) - ret = _codes_c_bufr_keys_iterator_new_(gid,iterid); + ret = _codes_c_bufr_keys_iterator_new_(gid, iterid); GRIB_MUTEX_UNLOCK(&keys_iterator_mutex) return ret; } int codes_c_bufr_keys_iterator_next(int* iterid) { - int ret = 0; - bufr_keys_iterator* iter= get_bufr_keys_iterator(*iterid); + int ret = 0; + bufr_keys_iterator* iter = get_bufr_keys_iterator(*iterid); if (!iter) return GRIB_INVALID_KEYS_ITERATOR; @@ -1059,23 +1075,23 @@ int codes_c_bufr_keys_iterator_next(int* iterid) return ret; } -int codes_c_bufr_keys_iterator_get_name(int* iterid,char* name,int len) +int codes_c_bufr_keys_iterator_get_name(int* iterid, char* name, int len) { - size_t lsize=len; - char buf[1024]={0,}; + size_t lsize = len; + char buf[1024] = {0,}; - bufr_keys_iterator* kiter=get_bufr_keys_iterator(*iterid); + bufr_keys_iterator* kiter = get_bufr_keys_iterator(*iterid); if (!kiter) return GRIB_INVALID_KEYS_ITERATOR; - if (codes_bufr_keys_iterator_get_accessor(kiter)==NULL) - return GRIB_INVALID_KEYS_ITERATOR; + if (codes_bufr_keys_iterator_get_accessor(kiter) == NULL) + return GRIB_INVALID_KEYS_ITERATOR; - sprintf(buf,"%s",codes_bufr_keys_iterator_get_name(kiter)); - lsize=strlen(buf); + sprintf(buf, "%s", codes_bufr_keys_iterator_get_name(kiter)); + lsize = strlen(buf); if (len < lsize) return GRIB_ARRAY_TOO_SMALL; - memcpy(name,buf,lsize); + memcpy(name, buf, lsize); name[lsize] = '\0'; return 0; @@ -1083,7 +1099,7 @@ int codes_c_bufr_keys_iterator_get_name(int* iterid,char* name,int len) int codes_c_bufr_keys_iterator_rewind(int* kiter) { - bufr_keys_iterator* i=get_bufr_keys_iterator(*kiter); + bufr_keys_iterator* i = get_bufr_keys_iterator(*kiter); if (!i) return GRIB_INVALID_KEYS_ITERATOR; return codes_bufr_keys_iterator_rewind(i); @@ -1109,113 +1125,113 @@ int grib_c_gribex_mode_off(void) int grib_c_skip_computed(int* iterid) { - grib_keys_iterator* iter=get_keys_iterator(*iterid); + grib_keys_iterator* iter = get_keys_iterator(*iterid); if (!iter) return GRIB_INVALID_KEYS_ITERATOR; - return grib_keys_iterator_set_flags(iter,GRIB_KEYS_ITERATOR_SKIP_COMPUTED); + return grib_keys_iterator_set_flags(iter, GRIB_KEYS_ITERATOR_SKIP_COMPUTED); } int grib_c_skip_coded(int* iterid) { - grib_keys_iterator* iter=get_keys_iterator(*iterid); + grib_keys_iterator* iter = get_keys_iterator(*iterid); if (!iter) return GRIB_INVALID_KEYS_ITERATOR; - return grib_keys_iterator_set_flags(iter,GRIB_KEYS_ITERATOR_SKIP_CODED); + return grib_keys_iterator_set_flags(iter, GRIB_KEYS_ITERATOR_SKIP_CODED); } int grib_c_skip_edition_specific(int* iterid) { - grib_keys_iterator* iter=get_keys_iterator(*iterid); + grib_keys_iterator* iter = get_keys_iterator(*iterid); if (!iter) return GRIB_INVALID_KEYS_ITERATOR; - return grib_keys_iterator_set_flags(iter,GRIB_KEYS_ITERATOR_SKIP_EDITION_SPECIFIC); + return grib_keys_iterator_set_flags(iter, GRIB_KEYS_ITERATOR_SKIP_EDITION_SPECIFIC); } int grib_c_skip_duplicates(int* iterid) { - grib_keys_iterator* iter=get_keys_iterator(*iterid); + grib_keys_iterator* iter = get_keys_iterator(*iterid); if (!iter) return GRIB_INVALID_KEYS_ITERATOR; - return grib_keys_iterator_set_flags(iter,GRIB_KEYS_ITERATOR_SKIP_DUPLICATES); + return grib_keys_iterator_set_flags(iter, GRIB_KEYS_ITERATOR_SKIP_DUPLICATES); } int grib_c_skip_read_only(int* iterid) { - grib_keys_iterator* iter=get_keys_iterator(*iterid); + grib_keys_iterator* iter = get_keys_iterator(*iterid); if (!iter) return GRIB_INVALID_KEYS_ITERATOR; - return grib_keys_iterator_set_flags(iter,GRIB_KEYS_ITERATOR_SKIP_READ_ONLY); + return grib_keys_iterator_set_flags(iter, GRIB_KEYS_ITERATOR_SKIP_READ_ONLY); } int grib_c_skip_function(int* iterid) { - grib_keys_iterator* iter=get_keys_iterator(*iterid); + grib_keys_iterator* iter = get_keys_iterator(*iterid); if (!iter) return GRIB_INVALID_KEYS_ITERATOR; - return grib_keys_iterator_set_flags(iter,GRIB_KEYS_ITERATOR_SKIP_FUNCTION); + return grib_keys_iterator_set_flags(iter, GRIB_KEYS_ITERATOR_SKIP_FUNCTION); } -int grib_c_new_from_message(int* gid, void* buffer , size_t* bufsize) +int grib_c_new_from_message(int* gid, void* buffer, size_t* bufsize) { - grib_handle *h = NULL; - h = grib_handle_new_from_message_copy(0, buffer, *bufsize); - if(h){ - push_handle(h,gid); + grib_handle* h = NULL; + h = grib_handle_new_from_message_copy(0, buffer, *bufsize); + if (h) { + push_handle(h, gid); return GRIB_SUCCESS; } *gid = -1; - return GRIB_INTERNAL_ERROR; + return GRIB_INTERNAL_ERROR; } -int grib_c_new_from_message_copy(int* gid, void* buffer , size_t* bufsize) +int grib_c_new_from_message_copy(int* gid, void* buffer, size_t* bufsize) { - grib_handle *h = NULL; - h = grib_handle_new_from_message_copy(0, buffer, *bufsize); - if(h){ - push_handle(h,gid); + grib_handle* h = NULL; + h = grib_handle_new_from_message_copy(0, buffer, *bufsize); + if (h) { + push_handle(h, gid); return GRIB_SUCCESS; } *gid = -1; - return GRIB_INTERNAL_ERROR; + return GRIB_INTERNAL_ERROR; } int grib_c_grib_new_from_samples(int* gid, char* name) { - grib_handle *h = NULL; + grib_handle* h = NULL; - h = grib_handle_new_from_samples(NULL,name); + h = grib_handle_new_from_samples(NULL, name); /* grib_context_set_debug(h->context,1);*/ - if(h){ - push_handle(h,gid); + if (h) { + push_handle(h, gid); return GRIB_SUCCESS; } *gid = -1; - return GRIB_FILE_NOT_FOUND; + return GRIB_FILE_NOT_FOUND; } int grib_c_bufr_new_from_samples(int* gid, char* name) { - grib_handle *h = NULL; + grib_handle* h = NULL; - h = codes_bufr_handle_new_from_samples(NULL,name); + h = codes_bufr_handle_new_from_samples(NULL, name); /* grib_context_set_debug(h->context,1);*/ - if(h){ - push_handle(h,gid); + if (h) { + push_handle(h, gid); return GRIB_SUCCESS; } *gid = -1; - return GRIB_FILE_NOT_FOUND; + return GRIB_FILE_NOT_FOUND; } -int grib_c_clone(int* gidsrc,int* giddest) +int grib_c_clone(int* gidsrc, int* giddest) { - grib_handle *src = get_handle(*gidsrc); - grib_handle *dest = NULL; + grib_handle* src = get_handle(*gidsrc); + grib_handle* dest = NULL; - if(src){ + if (src) { dest = grib_handle_clone(src); - if(dest){ - push_handle(dest,giddest); + if (dest) { + push_handle(dest, giddest); return GRIB_SUCCESS; } } @@ -1224,533 +1240,571 @@ int grib_c_clone(int* gidsrc,int* giddest) return GRIB_INVALID_GRIB; } -int grib_c_copy_namespace(int* gidsrc,char* name,int* giddest) +int grib_c_copy_namespace(int* gidsrc, char* name, int* giddest) { - grib_handle *src = get_handle(*gidsrc); - grib_handle *dest = get_handle(*giddest); + grib_handle* src = get_handle(*gidsrc); + grib_handle* dest = get_handle(*giddest); - if(src && dest) - return grib_copy_namespace(dest,name,src); + if (src && dest) + return grib_copy_namespace(dest, name, src); return GRIB_INVALID_GRIB; } -int grib_c_count_in_file(FILE* f,int* n) +int grib_c_count_in_file(FILE* f, int* n) { int err = 0; - if (f) err=grib_count_in_file(0, f,n); + if (f) err = grib_count_in_file(0, f, n); return err; } -int grib_c_new_gts_from_file(FILE* f,int headers_only, int* gid) +int grib_c_new_gts_from_file(FILE* f, int headers_only, int* gid) { - grib_handle *h = NULL; - int err = 0; + grib_handle* h = NULL; + int err = 0; - if(f){ - h = gts_new_from_file(0,f,&err); + if (f) { + h = gts_new_from_file(0, f, &err); - if(h){ - push_handle(h,gid); + if (h) { + push_handle(h, gid); return GRIB_SUCCESS; - } else { - *gid=-1; + } + else { + *gid = -1; return GRIB_END_OF_FILE; } } - *gid=-1; + *gid = -1; return GRIB_INVALID_FILE; } -int grib_c_new_metar_from_file(FILE* f,int headers_only, int* gid) +int grib_c_new_metar_from_file(FILE* f, int headers_only, int* gid) { - grib_handle *h = NULL; - int err = 0; + grib_handle* h = NULL; + int err = 0; - if(f){ - h = metar_new_from_file(0,f,&err); + if (f) { + h = metar_new_from_file(0, f, &err); - if(h){ - push_handle(h,gid); + if (h) { + push_handle(h, gid); return GRIB_SUCCESS; - } else { - *gid=-1; + } + else { + *gid = -1; return GRIB_END_OF_FILE; } } - *gid=-1; + *gid = -1; return GRIB_INVALID_FILE; } -int grib_c_new_any_from_file(FILE* f,int headers_only,int* gid) +int grib_c_new_any_from_file(FILE* f, int headers_only, int* gid) { - grib_handle *h = NULL; - int err = 0; - if(f){ - h = codes_handle_new_from_file(0,f,PRODUCT_ANY, &err); - if(h){ - push_handle(h,gid); + grib_handle* h = NULL; + int err = 0; + if (f) { + h = codes_handle_new_from_file(0, f, PRODUCT_ANY, &err); + if (h) { + push_handle(h, gid); return GRIB_SUCCESS; - } else { - *gid=-1; + } + else { + *gid = -1; return GRIB_END_OF_FILE; } } - *gid=-1; + *gid = -1; return GRIB_INVALID_FILE; } -int grib_c_new_bufr_from_file(FILE* f,int headers_only,int* gid) +int grib_c_new_bufr_from_file(FILE* f, int headers_only, int* gid) { - grib_handle *h = NULL; - int err = 0; + grib_handle* h = NULL; + int err = 0; - if(f){ + if (f) { /* h = bufr_new_from_file(0,f,headers_only,&err); */ - h = codes_handle_new_from_file(0,f,PRODUCT_BUFR, &err); + h = codes_handle_new_from_file(0, f, PRODUCT_BUFR, &err); - if(h){ - push_handle(h,gid); + if (h) { + push_handle(h, gid); return GRIB_SUCCESS; - } else { - *gid=-1; + } + else { + *gid = -1; return GRIB_END_OF_FILE; } } - *gid=-1; + *gid = -1; return GRIB_INVALID_FILE; } int grib_c_new_from_file(FILE* f, int* gid, int headers_only) { - grib_handle *h = NULL; - int err = 0; + grib_handle* h = NULL; + int err = 0; - if(f){ - h=grib_new_from_file(0,f,headers_only,&err); + if (f) { + h = grib_new_from_file(0, f, headers_only, &err); - if(h){ - push_handle(h,gid); + if (h) { + push_handle(h, gid); return GRIB_SUCCESS; - } else { - *gid=-1; + } + else { + *gid = -1; if (err == GRIB_SUCCESS) { return GRIB_END_OF_FILE; - } else { + } + else { /* A real error occurred */ return err; } } } - *gid=-1; + *gid = -1; return GRIB_INVALID_FILE; } -int grib_c_new_from_index(int* iid, int* gid){ - int err = 0; +int grib_c_new_from_index(int* iid, int* gid) +{ + int err = 0; grib_index* i = get_index(*iid); - grib_handle *h = NULL; + grib_handle* h = NULL; - if(i){ - h = grib_handle_new_from_index(i,&err); - if(h){ - push_handle(h,gid); + if (i) { + h = grib_handle_new_from_index(i, &err); + if (h) { + push_handle(h, gid); return GRIB_SUCCESS; - } else { - *gid=-1; + } + else { + *gid = -1; return GRIB_END_OF_INDEX; } } - *gid=-1; + *gid = -1; return GRIB_INVALID_INDEX; } -int grib_c_index_new_from_file(char* file ,char* keys ,int* gid){ - int err = 0; - grib_index *i = NULL; +int grib_c_index_new_from_file(char* file, char* keys, int* gid) +{ + int err = 0; + grib_index* i = NULL; - if(*file){ - i = grib_index_new_from_file(0,file,keys,&err); - if(i){ - push_index(i,gid); + if (*file) { + i = grib_index_new_from_file(0, file, keys, &err); + if (i) { + push_index(i, gid); return GRIB_SUCCESS; - } else { - *gid=-1; + } + else { + *gid = -1; return GRIB_END_OF_FILE; } } - *gid=-1; + *gid = -1; return GRIB_INVALID_FILE; } -int grib_c_index_add_file(int* iid, char* file) { - grib_index *i = get_index(*iid); - int err = GRIB_SUCCESS; +int grib_c_index_add_file(int* iid, char* file) +{ + grib_index* i = get_index(*iid); + int err = GRIB_SUCCESS; if (!i) { return GRIB_INVALID_INDEX; - } else { - err = grib_index_add_file(i,file); + } + else { + err = grib_index_add_file(i, file); return err; } } -int grib_c_index_release(int* hid){ +int grib_c_index_release(int* hid) +{ return clear_index(*hid); } -int grib_c_multi_release(int* hid){ +int grib_c_multi_release(int* hid) +{ return clear_multi_handle(*hid); } -int grib_c_release(int* hid){ +int grib_c_release(int* hid) +{ return clear_handle(*hid); } -int grib_c_dump(int* gid){ - grib_handle *h = get_handle(*gid); +int grib_c_dump(int* gid) +{ + grib_handle* h = get_handle(*gid); - if(!h) + if (!h) return GRIB_INVALID_GRIB; else - grib_dump_content(h,stdout,"wmo",0,NULL); + grib_dump_content(h, stdout, "wmo", 0, NULL); return GRIB_SUCCESS; } -int grib_c_print(int* gid, char* key){ - grib_handle *h = get_handle(*gid); - int err = GRIB_SUCCESS; +int grib_c_print(int* gid, char* key) +{ + grib_handle* h = get_handle(*gid); + int err = GRIB_SUCCESS; grib_dumper* d = NULL; - if(!h){ + if (!h) { return GRIB_INVALID_GRIB; - }else{ - d = grib_dumper_factory("serialize",h,stdout,0,0); + } + else { + d = grib_dumper_factory("serialize", h, stdout, 0, 0); err = grib_print(h, key, d); grib_dumper_delete(d); - return err; + return err; } } -int grib_c_get_error_string(int* err, char* buf, int len){ +int grib_c_get_error_string(int* err, char* buf, int len) +{ const char* err_msg = grib_get_error_message(*err); - size_t erlen = strlen(err_msg); - if( len < erlen) return GRIB_ARRAY_TOO_SMALL; + size_t erlen = strlen(err_msg); + if (len <= erlen) return GRIB_ARRAY_TOO_SMALL; - strncpy(buf, err_msg,(size_t)erlen); + strncpy(buf, err_msg, (size_t)erlen); buf[erlen] = '\0'; return GRIB_SUCCESS; } -int grib_c_get_size_int(int* gid, char* key, int* val){ - grib_handle *h = get_handle(*gid); - int err = GRIB_SUCCESS; - size_t tsize = 0; +int grib_c_get_size_int(int* gid, char* key, int* val) +{ + grib_handle* h = get_handle(*gid); + int err = GRIB_SUCCESS; + size_t tsize = 0; - if(!h){ + if (!h) { return GRIB_INVALID_GRIB; - }else{ - err = grib_get_size(h, key, &tsize); + } + else { + err = grib_get_size(h, key, &tsize); *val = tsize; - return err; + return err; } } -int grib_c_get_message_offset(int* gid, size_t* offset){ +int grib_c_get_message_offset(int* gid, size_t* offset) +{ int err = GRIB_SUCCESS; off_t myoffset; - grib_handle *h = get_handle(*gid); + grib_handle* h = get_handle(*gid); - if(!h) + if (!h) return GRIB_INVALID_GRIB; else { - err=grib_get_message_offset(h, &myoffset); - *offset=myoffset; + err = grib_get_message_offset(h, &myoffset); + *offset = myoffset; return err; } } -int grib_c_get_message_size(int* gid, size_t* size){ - grib_handle *h = get_handle(*gid); +int grib_c_get_message_size(int* gid, size_t* size) +{ + grib_handle* h = get_handle(*gid); - if(!h) + if (!h) return GRIB_INVALID_GRIB; else return grib_get_message_size(h, size); } -int grib_c_get_string_length(int* gid, char* key, size_t* val){ - grib_handle *h = get_handle(*gid); +int grib_c_get_string_length(int* gid, char* key, size_t* val) +{ + grib_handle* h = get_handle(*gid); - if(!h) + if (!h) return GRIB_INVALID_GRIB; else return grib_get_string_length(h, key, val); - } -int grib_c_get_size_long(int* gid, char* key, long* val){ - grib_handle *h = get_handle(*gid); - int err = GRIB_SUCCESS; - size_t tsize = 0; +int grib_c_get_size_long(int* gid, char* key, long* val) +{ + grib_handle* h = get_handle(*gid); + int err = GRIB_SUCCESS; + size_t tsize = 0; - if(!h){ + if (!h) { return GRIB_INVALID_GRIB; - }else{ - err = grib_get_size(h, key, &tsize); + } + else { + err = grib_get_size(h, key, &tsize); *val = tsize; - return err; + return err; } } -int grib_c_index_get_size_int(int* gid, char* key, int* val){ - grib_index *h = get_index(*gid); - int err = GRIB_SUCCESS; - size_t tsize = 0; +int grib_c_index_get_size_int(int* gid, char* key, int* val) +{ + grib_index* h = get_index(*gid); + int err = GRIB_SUCCESS; + size_t tsize = 0; - if(!h){ + if (!h) { return GRIB_INVALID_GRIB; - }else{ - err = grib_index_get_size(h, key, &tsize); + } + else { + err = grib_index_get_size(h, key, &tsize); *val = tsize; - return err; + return err; } } -int grib_c_index_get_size_long(int* gid, char* key, long* val){ - grib_index *h = get_index(*gid); - int err = GRIB_SUCCESS; - size_t tsize = 0; +int grib_c_index_get_size_long(int* gid, char* key, long* val) +{ + grib_index* h = get_index(*gid); + int err = GRIB_SUCCESS; + size_t tsize = 0; - if(!h){ + if (!h) { return GRIB_INVALID_GRIB; - }else{ - err = grib_index_get_size(h, key, &tsize); + } + else { + err = grib_index_get_size(h, key, &tsize); *val = tsize; - return err; + return err; } } -int grib_c_get_int(int* gid, char* key, int* val){ - grib_handle *h = get_handle(*gid); +int grib_c_get_int(int* gid, char* key, int* val) +{ + grib_handle* h = get_handle(*gid); long long_val; int err = GRIB_SUCCESS; - if(!h) return GRIB_INVALID_GRIB; - err = grib_get_long(h, key,&long_val); + if (!h) return GRIB_INVALID_GRIB; + err = grib_get_long(h, key, &long_val); *val = long_val; return err; } -int grib_c_get_long(int* gid, char* key, long* val){ - grib_handle *h = get_handle(*gid); - int err = GRIB_SUCCESS; +int grib_c_get_long(int* gid, char* key, long* val) +{ + grib_handle* h = get_handle(*gid); + int err = GRIB_SUCCESS; - if(!h) return GRIB_INVALID_GRIB; + if (!h) return GRIB_INVALID_GRIB; err = grib_get_long(h, key, val); return err; } -int grib_c_get_double(int* gid, char* key, double* val){ - grib_handle *h = get_handle(*gid); - int err = GRIB_SUCCESS; +int grib_c_get_double(int* gid, char* key, double* val) +{ + grib_handle* h = get_handle(*gid); + int err = GRIB_SUCCESS; - if(!h) return GRIB_INVALID_GRIB; + if (!h) return GRIB_INVALID_GRIB; err = grib_get_double(h, key, val); return err; } -int grib_c_get_int_array(int* gid, char* key, int *val, int* size){ - - grib_handle *h = get_handle(*gid); +int grib_c_get_int_array(int* gid, char* key, int* val, int* size) +{ + grib_handle* h = get_handle(*gid); long* long_val = NULL; - int err = GRIB_SUCCESS; - size_t lsize = *size; + int err = GRIB_SUCCESS; + size_t lsize = *size; - if(!h) return GRIB_INVALID_GRIB; + if (!h) return GRIB_INVALID_GRIB; - if(sizeof(long) == sizeof(int)){ + if (sizeof(long) == sizeof(int)) { long_val = (long*)val; - err = grib_get_long_array(h, key, long_val, &lsize); - *size = lsize; - return err; + err = grib_get_long_array(h, key, long_val, &lsize); + *size = lsize; + return err; } - if(*size) - long_val = grib_context_malloc(h->context,(*size)*(sizeof(long))); + if (*size) + long_val = grib_context_malloc(h->context, (*size) * (sizeof(long))); else - long_val = grib_context_malloc(h->context,(sizeof(long))); + long_val = grib_context_malloc(h->context, (sizeof(long))); - if(!long_val) return GRIB_OUT_OF_MEMORY; + if (!long_val) return GRIB_OUT_OF_MEMORY; err = grib_get_long_array(h, key, long_val, &lsize); - for(*size=0;*sizecontext,long_val); - return err; + grib_context_free(h->context, long_val); + return err; } -int grib_c_get_long_array(int* gid, char* key, long *val, int* size){ - - grib_handle *h = get_handle(*gid); - int err = GRIB_SUCCESS; - size_t lsize = *size; +int grib_c_get_long_array(int* gid, char* key, long* val, int* size) +{ + grib_handle* h = get_handle(*gid); + int err = GRIB_SUCCESS; + size_t lsize = *size; - if(!h) return GRIB_INVALID_GRIB; + if (!h) return GRIB_INVALID_GRIB; - err = grib_get_long_array(h, key, val, &lsize); - *size=lsize; + err = grib_get_long_array(h, key, val, &lsize); + *size = lsize; - return err; + return err; } -int grib_c_index_get_string(int* gid, char* key, char* val, int *eachsize,int* size){ - - grib_index *h = get_index(*gid); - int err = GRIB_SUCCESS; +int grib_c_index_get_string(int* gid, char* key, char* val, int* eachsize, int* size) +{ + grib_index* h = get_index(*gid); + int err = GRIB_SUCCESS; int i; size_t lsize = *size; char** bufval; - char* p=val; + char* p = val; - if(!h) return GRIB_INVALID_GRIB; + if (!h) return GRIB_INVALID_GRIB; - bufval=(char**)grib_context_malloc_clear(h->context,sizeof(char*)* *size); + bufval = (char**)grib_context_malloc_clear(h->context, sizeof(char*) * *size); - err = grib_index_get_string(h, key, bufval, &lsize); + err = grib_index_get_string(h, key, bufval, &lsize); *size = lsize; if (err) return err; - for (i=0;icontext,bufval); - printf("eachsize=%d strlen(bufval[i])=%d\n",*eachsize,(unsigned int)strlen(bufval[i])); + if (*eachsize < l) { + grib_context_free(h->context, bufval); + printf("eachsize=%d strlen(bufval[i])=%d\n", *eachsize, (unsigned int)strlen(bufval[i])); return GRIB_ARRAY_TOO_SMALL; } - memcpy(p,bufval[i],l); - p+=l; - for (j=0;j<*eachsize-l;j++) *(p++)=' '; + memcpy(p, bufval[i], l); + p += l; + for (j = 0; j < *eachsize - l; j++) + *(p++) = ' '; } - grib_context_free(h->context,bufval); + grib_context_free(h->context, bufval); - return err; + return err; } -int grib_c_index_get_long(int* gid, char* key, long *val, int* size){ - - grib_index *h = get_index(*gid); - int err = GRIB_SUCCESS; - size_t lsize = *size; +int grib_c_index_get_long(int* gid, char* key, long* val, int* size) +{ + grib_index* h = get_index(*gid); + int err = GRIB_SUCCESS; + size_t lsize = *size; - if(!h) return GRIB_INVALID_GRIB; - err = grib_index_get_long(h, key, val, &lsize); + if (!h) return GRIB_INVALID_GRIB; + err = grib_index_get_long(h, key, val, &lsize); *size = lsize; - return err; + return err; } -int grib_c_index_get_int(int* gid, char* key, int *val, int* size){ - - grib_index *h = get_index(*gid); - int err = GRIB_SUCCESS; - size_t lsize = *size; - long* lval=0; +int grib_c_index_get_int(int* gid, char* key, int* val, int* size) +{ + grib_index* h = get_index(*gid); + int err = GRIB_SUCCESS; + size_t lsize = *size; + long* lval = 0; int i; - if(!h) return GRIB_INVALID_GRIB; + if (!h) return GRIB_INVALID_GRIB; - lval=grib_context_malloc(h->context,sizeof(long)* *size); + lval = grib_context_malloc(h->context, sizeof(long) * *size); if (!lval) return GRIB_OUT_OF_MEMORY; err = grib_index_get_long(h, key, lval, &lsize); - for (i=0;icontext,(lsize)*(sizeof(long))); + if (lsize) + long_val = grib_context_malloc(h->context, (lsize) * (sizeof(long))); else - long_val = grib_context_malloc(h->context,(sizeof(long))); + long_val = grib_context_malloc(h->context, (sizeof(long))); - if(!long_val) return GRIB_OUT_OF_MEMORY; + if (!long_val) return GRIB_OUT_OF_MEMORY; - for(lsize=0;lsize<(*size);lsize++) + for (lsize = 0; lsize < (*size); lsize++) long_val[lsize] = val[lsize]; err = grib_set_long_array(h, key, long_val, lsize); - grib_context_free(h->context,long_val); + grib_context_free(h->context, long_val); return err; } -int grib_c_set_long_array(int* gid, char* key, long* val, int* size){ - grib_handle *h = get_handle(*gid); - int err = GRIB_SUCCESS; - size_t lsize = *size; +int grib_c_set_long_array(int* gid, char* key, long* val, int* size) +{ + grib_handle* h = get_handle(*gid); + int err = GRIB_SUCCESS; + size_t lsize = *size; - if(!h) return GRIB_INVALID_GRIB; + if (!h) return GRIB_INVALID_GRIB; - return grib_set_long_array(h, key, val, lsize); + return grib_set_long_array(h, key, val, lsize); return err; } -int grib_c_set_int(int* gid, char* key, int* val){ - grib_handle *h = get_handle(*gid); - long long_val = *val; - if(!h) return GRIB_INVALID_GRIB; +int grib_c_set_int(int* gid, char* key, int* val) +{ + grib_handle* h = get_handle(*gid); + long long_val = *val; + if (!h) return GRIB_INVALID_GRIB; return grib_set_long(h, key, long_val); } -int grib_c_set_long(int* gid, char* key, long* val){ - grib_handle *h = get_handle(*gid); - if(!h) return GRIB_INVALID_GRIB; +int grib_c_set_long(int* gid, char* key, long* val) +{ + grib_handle* h = get_handle(*gid); + if (!h) return GRIB_INVALID_GRIB; return grib_set_long(h, key, *val); } -int grib_c_set_missing(int* gid, char* key){ - - grib_handle *h = get_handle(*gid); - if(!h) return GRIB_INVALID_GRIB; +int grib_c_set_missing(int* gid, char* key) +{ + grib_handle* h = get_handle(*gid); + if (!h) return GRIB_INVALID_GRIB; return grib_set_missing(h, key); } @@ -1765,398 +1819,399 @@ int grib_c_set_key_vals(int* gid, char* keyvals) grib_handle* h = get_handle(*gid); if (!h) return GRIB_INVALID_GRIB; { - int err = GRIB_SUCCESS; - grib_values values[1024]={{0,},}; + int err = GRIB_SUCCESS; + grib_values values[1024] = {{0,},}; int count = 1000; /* max. num key/val pairs */ if ((err = parse_keyval_string(NULL, keyvals, 1, GRIB_TYPE_UNDEFINED, values, &count)) != GRIB_SUCCESS) { return err; } - if ((err = grib_set_values(h,values,count)) != GRIB_SUCCESS) { + if ((err = grib_set_values(h, values, count)) != GRIB_SUCCESS) { return err; } } return GRIB_SUCCESS; } -int grib_c_is_missing(int* gid, char* key,int* isMissing) +int grib_c_is_missing(int* gid, char* key, int* isMissing) { - int err=0; - grib_handle *h = get_handle(*gid); - if(!h) return GRIB_INVALID_GRIB; + int err = 0; + grib_handle* h = get_handle(*gid); + if (!h) return GRIB_INVALID_GRIB; - *isMissing=grib_is_missing(h, key,&err); + *isMissing = grib_is_missing(h, key, &err); return err; } -int grib_c_is_defined(int* gid, char* key,int* isDefined) +int grib_c_is_defined(int* gid, char* key, int* isDefined) { - grib_handle *h = get_handle(*gid); - if(!h) return GRIB_INVALID_GRIB; + grib_handle* h = get_handle(*gid); + if (!h) return GRIB_INVALID_GRIB; - *isDefined=grib_is_defined(h, key); + *isDefined = grib_is_defined(h, key); return GRIB_SUCCESS; } int grib_c_set_real4(int* gid, char* key, float* val) { - grib_handle *h = get_handle(*gid); - double val8 = *val; - if(!h) return GRIB_INVALID_GRIB; + grib_handle* h = get_handle(*gid); + double val8 = *val; + if (!h) return GRIB_INVALID_GRIB; return grib_set_double(h, key, val8); } -int grib_c_get_real4_element(int* gid, char* key, int* index,float* val) +int grib_c_get_real4_element(int* gid, char* key, int* index, float* val) { - grib_handle *h = get_handle(*gid); - int err = GRIB_SUCCESS; - double val8 = 0; + grib_handle* h = get_handle(*gid); + int err = GRIB_SUCCESS; + double val8 = 0; - if(!h) return GRIB_INVALID_GRIB; + if (!h) return GRIB_INVALID_GRIB; - err = grib_get_double_element(h, key, *index,&val8); + err = grib_get_double_element(h, key, *index, &val8); *val = val8; return err; } -int grib_c_get_real4_elements(int* gid, char* key,int* index, float *val,int* size) +int grib_c_get_real4_elements(int* gid, char* key, int* index, float* val, int* size) { - grib_handle *h = get_handle(*gid); - int err = GRIB_SUCCESS; - size_t lsize = *size; - long i=0; - double* val8 = NULL; + grib_handle* h = get_handle(*gid); + int err = GRIB_SUCCESS; + size_t lsize = *size; + long i = 0; + double* val8 = NULL; - if(!h) return GRIB_INVALID_GRIB; + if (!h) return GRIB_INVALID_GRIB; - if(*size) - val8 = grib_context_malloc(h->context,(*size)*(sizeof(double))); + if (*size) + val8 = grib_context_malloc(h->context, (*size) * (sizeof(double))); else - val8 = grib_context_malloc(h->context,sizeof(double)); + val8 = grib_context_malloc(h->context, sizeof(double)); - if(!val8) return GRIB_OUT_OF_MEMORY; + if (!val8) return GRIB_OUT_OF_MEMORY; - err = grib_get_double_elements(h, key, index,(long)lsize,val8); + err = grib_get_double_elements(h, key, index, (long)lsize, val8); - for(i=0;icontext,val8); + grib_context_free(h->context, val8); - return err; + return err; } int grib_c_get_real4(int* gid, char* key, float* val) { - grib_handle *h = get_handle(*gid); - int err = GRIB_SUCCESS; - double val8 = 0; + grib_handle* h = get_handle(*gid); + int err = GRIB_SUCCESS; + double val8 = 0; - if(!h) return GRIB_INVALID_GRIB; + if (!h) return GRIB_INVALID_GRIB; - err = grib_get_double(h, key, &val8); + err = grib_get_double(h, key, &val8); *val = val8; return err; } -int grib_c_get_real4_array(int* gid, char* key, float *val, int* size) +int grib_c_get_real4_array(int* gid, char* key, float* val, int* size) { - grib_handle *h = get_handle(*gid); - int err = GRIB_SUCCESS; - size_t lsize = *size; - double* val8 = NULL; + grib_handle* h = get_handle(*gid); + int err = GRIB_SUCCESS; + size_t lsize = *size; + double* val8 = NULL; - if(!h) return GRIB_INVALID_GRIB; + if (!h) return GRIB_INVALID_GRIB; - if(*size) - val8 = grib_context_malloc(h->context,(*size)*(sizeof(double))); + if (*size) + val8 = grib_context_malloc(h->context, (*size) * (sizeof(double))); else - val8 = grib_context_malloc(h->context,sizeof(double)); + val8 = grib_context_malloc(h->context, sizeof(double)); - if(!val8) return GRIB_OUT_OF_MEMORY; + if (!val8) return GRIB_OUT_OF_MEMORY; - err = grib_get_double_array(h, key, val8, &lsize); + err = grib_get_double_array(h, key, val8, &lsize); - for(*size=0;*sizecontext,val8); + grib_context_free(h->context, val8); - return err; + return err; } -int grib_c_set_real4_array(int* gid, char* key, float*val, int* size) +int grib_c_set_real4_array(int* gid, char* key, float* val, int* size) { - grib_handle *h = get_handle(*gid); - int err = GRIB_SUCCESS; - size_t lsize = *size; - double* val8 = NULL; + grib_handle* h = get_handle(*gid); + int err = GRIB_SUCCESS; + size_t lsize = *size; + double* val8 = NULL; - if(!h) return GRIB_INVALID_GRIB; + if (!h) return GRIB_INVALID_GRIB; - if(*size) - val8 = grib_context_malloc(h->context,lsize*(sizeof(double))); + if (*size) + val8 = grib_context_malloc(h->context, lsize * (sizeof(double))); else - val8 = grib_context_malloc(h->context,sizeof(double)); + val8 = grib_context_malloc(h->context, sizeof(double)); - if(!val8) return GRIB_OUT_OF_MEMORY; + if (!val8) return GRIB_OUT_OF_MEMORY; - for(lsize=0;lsize<*size;lsize++) + for (lsize = 0; lsize < *size; lsize++) val8[lsize] = val[lsize]; err = grib_set_double_array(h, key, val8, lsize); - grib_context_free(h->context,val8); + grib_context_free(h->context, val8); return err; } int grib_c_index_select_real8(int* gid, char* key, double* val) { - grib_index *h = get_index(*gid); + grib_index* h = get_index(*gid); - if(!h) return GRIB_INVALID_GRIB; + if (!h) return GRIB_INVALID_GRIB; return grib_index_select_double(h, key, *val); } int grib_c_index_select_string(int* gid, char* key, char* val) { - grib_index *h = get_index(*gid); + grib_index* h = get_index(*gid); - if(!h) return GRIB_INVALID_GRIB; + if (!h) return GRIB_INVALID_GRIB; return grib_index_select_string(h, key, val); } int grib_c_index_select_int(int* gid, char* key, int* val) { - grib_index *h = get_index(*gid); - long lval=*val; + grib_index* h = get_index(*gid); + long lval = *val; - if(!h) return GRIB_INVALID_GRIB; + if (!h) return GRIB_INVALID_GRIB; return grib_index_select_long(h, key, lval); } int grib_c_index_select_long(int* gid, char* key, long* val) { - grib_index *h = get_index(*gid); + grib_index* h = get_index(*gid); - if(!h) return GRIB_INVALID_GRIB; + if (!h) return GRIB_INVALID_GRIB; return grib_index_select_long(h, key, *val); } int grib_c_set_real8(int* gid, char* key, double* val) { - grib_handle *h = get_handle(*gid); + grib_handle* h = get_handle(*gid); - if(!h) return GRIB_INVALID_GRIB; + if (!h) return GRIB_INVALID_GRIB; return grib_set_double(h, key, *val); } int grib_c_get_real8(int* gid, char* key, double* val) { - grib_handle *h = get_handle(*gid); + grib_handle* h = get_handle(*gid); - if(!h) return GRIB_INVALID_GRIB; + if (!h) return GRIB_INVALID_GRIB; return grib_get_double(h, key, val); } -int grib_c_set_double(int *gid, char *key, double *val) +int grib_c_set_double(int* gid, char* key, double* val) { - grib_handle *h = get_handle(*gid); + grib_handle* h = get_handle(*gid); - if(!h) return GRIB_INVALID_GRIB; + if (!h) return GRIB_INVALID_GRIB; return grib_set_double(h, key, *val); } -int grib_c_get_real8_element(int* gid, char* key,int* index, double* val) +int grib_c_get_real8_element(int* gid, char* key, int* index, double* val) { - grib_handle *h = get_handle(*gid); + grib_handle* h = get_handle(*gid); - if(!h) return GRIB_INVALID_GRIB; + if (!h) return GRIB_INVALID_GRIB; - return grib_get_double_element(h, key, *index,val); + return grib_get_double_element(h, key, *index, val); } -int grib_c_get_real8_elements(int* gid, char* key,int* index, double* val, int *size) +int grib_c_get_real8_elements(int* gid, char* key, int* index, double* val, int* size) { - grib_handle *h = get_handle(*gid); + grib_handle* h = get_handle(*gid); - if(!h) return GRIB_INVALID_GRIB; + if (!h) return GRIB_INVALID_GRIB; - return grib_get_double_elements(h, key, index,*size,val); + return grib_get_double_elements(h, key, index, *size, val); } -int grib_c_find_nearest_four_single(int* gid,int* is_lsm, - double* inlat,double* inlon, - double* outlats,double* outlons, - double* values,double* distances, - int* indexes) +int grib_c_find_nearest_four_single(int* gid, int* is_lsm, + double* inlat, double* inlon, + double* outlats, double* outlons, + double* values, double* distances, + int* indexes) { - grib_nearest* nearest=NULL; - int err=0, result=0; - unsigned long flags=0; - size_t len=4; - grib_handle *h = get_handle(*gid); + grib_nearest* nearest = NULL; + int err = 0, result = 0; + unsigned long flags = 0; + size_t len = 4; + grib_handle* h = get_handle(*gid); - if(!h) return GRIB_INVALID_GRIB; + if (!h) return GRIB_INVALID_GRIB; - nearest=grib_nearest_new(h,&err); - if (err!=GRIB_SUCCESS) return err; + nearest = grib_nearest_new(h, &err); + if (err != GRIB_SUCCESS) return err; - result = grib_nearest_find(nearest,h,*inlat,*inlon, - flags,outlats,outlons,values,distances,indexes,&len); + result = grib_nearest_find(nearest, h, *inlat, *inlon, + flags, outlats, outlons, values, distances, indexes, &len); grib_nearest_delete(nearest); return result; } -int grib_c_find_nearest_single(int* gid,int* is_lsm, - double* inlats,double* inlons, - double* outlats,double* outlons, - double* values,double* distances, - int* indexes) +int grib_c_find_nearest_single(int* gid, int* is_lsm, + double* inlats, double* inlons, + double* outlats, double* outlons, + double* values, double* distances, + int* indexes) { - grib_handle *h = get_handle(*gid); + grib_handle* h = get_handle(*gid); - if(!h) return GRIB_INVALID_GRIB; + if (!h) return GRIB_INVALID_GRIB; - return grib_nearest_find_multiple(h,*is_lsm, - inlats,inlons,1,outlats,outlons, - values,distances,indexes); + return grib_nearest_find_multiple(h, *is_lsm, + inlats, inlons, 1, outlats, outlons, + values, distances, indexes); } -int grib_c_find_nearest_multiple(int* gid,int* is_lsm, - double* inlats,double* inlons, - double* outlats,double* outlons, - double* values,double* distances, - int* indexes, int* npoints) +int grib_c_find_nearest_multiple(int* gid, int* is_lsm, + double* inlats, double* inlons, + double* outlats, double* outlons, + double* values, double* distances, + int* indexes, int* npoints) { - grib_handle *h = get_handle(*gid); + grib_handle* h = get_handle(*gid); - if(!h) return GRIB_INVALID_GRIB; + if (!h) return GRIB_INVALID_GRIB; - return grib_nearest_find_multiple(h,*is_lsm, - inlats,inlons,*npoints,outlats,outlons, - values,distances,indexes); + return grib_nearest_find_multiple(h, *is_lsm, + inlats, inlons, *npoints, outlats, outlons, + values, distances, indexes); } -int grib_c_get_real8_array(int* gid, char* key, double*val, int* size) +int grib_c_get_real8_array(int* gid, char* key, double* val, int* size) { - grib_handle *h = get_handle(*gid); - int err = GRIB_SUCCESS; - size_t lsize = *size; + grib_handle* h = get_handle(*gid); + int err = GRIB_SUCCESS; + size_t lsize = *size; - if(!h){ + if (!h) { return GRIB_INVALID_GRIB; - }else{ - err = grib_get_double_array(h, key, val, &lsize); + } + else { + err = grib_get_double_array(h, key, val, &lsize); *size = lsize; - return err; + return err; } } -int grib_c_set_real8_array(int* gid, char* key, double*val, int* size) +int grib_c_set_real8_array(int* gid, char* key, double* val, int* size) { - grib_handle *h = get_handle(*gid); + grib_handle* h = get_handle(*gid); size_t lsize = *size; - if(!h) return GRIB_INVALID_GRIB; + if (!h) return GRIB_INVALID_GRIB; return grib_set_double_array(h, key, val, lsize); } -int grib_c_set_double_array(int* gid, char* key, double*val, int* size) +int grib_c_set_double_array(int* gid, char* key, double* val, int* size) { - grib_handle *h = get_handle(*gid); + grib_handle* h = get_handle(*gid); size_t lsize = *size; - if(!h) return GRIB_INVALID_GRIB; + if (!h) return GRIB_INVALID_GRIB; return grib_set_double_array(h, key, val, lsize); } -int grib_c_get_string(int* gid, char* key, char* val, size_t *lsize) +int grib_c_get_string(int* gid, char* key, char* val, size_t* lsize) { - grib_handle *h = get_handle(*gid); - int err = GRIB_SUCCESS; + grib_handle* h = get_handle(*gid); + int err = GRIB_SUCCESS; - if(!h) return GRIB_INVALID_GRIB; + if (!h) return GRIB_INVALID_GRIB; err = grib_get_string(h, key, val, lsize); - return err; + return err; } -int grib_c_get_string_array(int* gid, char* key, char** val, size_t *lsize) +int grib_c_get_string_array(int* gid, char* key, char** val, size_t* lsize) { - grib_handle *h = get_handle(*gid); - int err = GRIB_SUCCESS; + grib_handle* h = get_handle(*gid); + int err = GRIB_SUCCESS; - if(!h) return GRIB_INVALID_GRIB; + if (!h) return GRIB_INVALID_GRIB; err = grib_get_string_array(h, key, val, lsize); - return err; + return err; } int grib_c_set_string(int* gid, char* key, char* val, int len2) { - grib_handle *h = get_handle(*gid); + grib_handle* h = get_handle(*gid); size_t lsize = len2; - if(!h) return GRIB_INVALID_GRIB; + if (!h) return GRIB_INVALID_GRIB; return grib_set_string(h, key, val, &lsize); } -int grib_c_set_string_array(int *gid, char *key, const char **val) +int grib_c_set_string_array(int* gid, char* key, const char** val) { - grib_handle *h = get_handle(*gid); - int err = GRIB_SUCCESS; - size_t lsize = 0; + grib_handle* h = get_handle(*gid); + int err = GRIB_SUCCESS; + size_t lsize = 0; - if(!h) return GRIB_INVALID_GRIB; + if (!h) return GRIB_INVALID_GRIB; /* Note: The array passed in will have its final entry as NULL */ /* so to find its size we just iterate thru it. */ /* See typemap for char** in swig interface file */ - while(val[lsize]) { + while (val[lsize]) { ++lsize; } err = grib_set_string_array(h, key, val, lsize); return err; } -int grib_c_get_data_real4(int* gid,float* lats, float* lons,float* values,size_t* size) +int grib_c_get_data_real4(int* gid, float* lats, float* lons, float* values, size_t* size) { - grib_handle *h = get_handle(*gid); - int err = GRIB_SUCCESS; - double *lat8=NULL,*lon8=NULL,*val8 = NULL; - size_t i=0; + grib_handle* h = get_handle(*gid); + int err = GRIB_SUCCESS; + double *lat8 = NULL, *lon8 = NULL, *val8 = NULL; + size_t i = 0; - if(!h) return GRIB_INVALID_GRIB; + if (!h) return GRIB_INVALID_GRIB; - val8 = grib_context_malloc(h->context,(*size)*(sizeof(double))); - if(!val8) return GRIB_OUT_OF_MEMORY; - lon8 = grib_context_malloc(h->context,(*size)*(sizeof(double))); - if(!lon8) return GRIB_OUT_OF_MEMORY; - lat8 = grib_context_malloc(h->context,(*size)*(sizeof(double))); - if(!lat8) return GRIB_OUT_OF_MEMORY; + val8 = grib_context_malloc(h->context, (*size) * (sizeof(double))); + if (!val8) return GRIB_OUT_OF_MEMORY; + lon8 = grib_context_malloc(h->context, (*size) * (sizeof(double))); + if (!lon8) return GRIB_OUT_OF_MEMORY; + lat8 = grib_context_malloc(h->context, (*size) * (sizeof(double))); + if (!lat8) return GRIB_OUT_OF_MEMORY; - err=grib_get_data(h,lat8,lon8,val8); + err = grib_get_data(h, lat8, lon8, val8); - for(i=0;i<*size;i++) { + for (i = 0; i < *size; i++) { values[i] = val8[i]; - lats[i] = lat8[i]; - lons[i] = lon8[i]; + lats[i] = lat8[i]; + lons[i] = lon8[i]; } - grib_context_free(h->context,val8); - grib_context_free(h->context,lat8); - grib_context_free(h->context,lon8); + grib_context_free(h->context, val8); + grib_context_free(h->context, lat8); + grib_context_free(h->context, lon8); return err; } @@ -2167,25 +2222,25 @@ int grib_c_get_data_real8(int* gid,double* lats, double* lons,double* values,siz return grib_get_data(h,lats,lons,values); } */ -int grib_c_copy_message(int* gid, void* mess,size_t* len) +int grib_c_copy_message(int* gid, void* mess, size_t* len) { - grib_handle *h = get_handle(*gid); - if(!h) + grib_handle* h = get_handle(*gid); + if (!h) return GRIB_INVALID_GRIB; - if(*len < h->buffer->ulength) { - grib_context_log(h->context,GRIB_LOG_ERROR,"grib_copy_message: buffer=%ld message size=%ld",*len,h->buffer->ulength); + if (*len < h->buffer->ulength) { + grib_context_log(h->context, GRIB_LOG_ERROR, "grib_copy_message: buffer=%ld message size=%ld", *len, h->buffer->ulength); return GRIB_BUFFER_TOO_SMALL; } - memcpy(mess,h->buffer->data,h->buffer->ulength); - *len=h->buffer->ulength; + memcpy(mess, h->buffer->data, h->buffer->ulength); + *len = h->buffer->ulength; return GRIB_SUCCESS; } -int grib_c_bufr_copy_data(int *msgid_src, int *msgid_dst) +int grib_c_bufr_copy_data(int* msgid_src, int* msgid_dst) { - int err = 0; + int err = 0; grib_handle* src = get_handle(*msgid_src); grib_handle* dest = get_handle(*msgid_dst); if (!src || !dest) { @@ -2196,26 +2251,26 @@ int grib_c_bufr_copy_data(int *msgid_src, int *msgid_dst) return err; } -void grib_c_check(int* err,char* call,char* str) +void grib_c_check(int* err, char* call, char* str) { - grib_context* c=grib_context_get_default(); - if ( *err == GRIB_SUCCESS || *err == GRIB_END_OF_FILE ) return; - grib_context_log(c,GRIB_LOG_ERROR,"%s: %s %s", - call,str,grib_get_error_message(*err)); + grib_context* c = grib_context_get_default(); + if (*err == GRIB_SUCCESS || *err == GRIB_END_OF_FILE) return; + grib_context_log(c, GRIB_LOG_ERROR, "%s: %s %s", + call, str, grib_get_error_message(*err)); exit(*err); } int grib_c_write(int* gid, FILE* f) { - grib_handle *h = get_handle(*gid); + grib_handle* h = get_handle(*gid); const void* mess = NULL; - size_t mess_len = 0; + size_t mess_len = 0; - if(!f) return GRIB_INVALID_FILE; + if (!f) return GRIB_INVALID_FILE; if (!h) return GRIB_INVALID_GRIB; - grib_get_message(h,&mess,&mess_len); - if(fwrite(mess,1, mess_len,f) != mess_len) { + grib_get_message(h, &mess, &mess_len); + if (fwrite(mess, 1, mess_len, f) != mess_len) { perror("grib_write"); return GRIB_IO_PROBLEM; } @@ -2225,40 +2280,40 @@ int grib_c_write(int* gid, FILE* f) int grib_c_multi_new(int* mgid) { - grib_multi_handle *mh = grib_multi_handle_new(0); + grib_multi_handle* mh = grib_multi_handle_new(0); if (!mh) return GRIB_INVALID_GRIB; - push_multi_handle(mh,mgid); + push_multi_handle(mh, mgid); return GRIB_SUCCESS; } int grib_c_multi_write(int* gid, FILE* f) { - grib_multi_handle *h = get_multi_handle(*gid); + grib_multi_handle* h = get_multi_handle(*gid); - if(!f) return GRIB_INVALID_FILE; + if (!f) return GRIB_INVALID_FILE; if (!h) return GRIB_INVALID_GRIB; - return grib_multi_handle_write(h,f); + return grib_multi_handle_write(h, f); } -int grib_c_multi_append(int* ingid, int* sec,int* mgid) +int grib_c_multi_append(int* ingid, int* sec, int* mgid) { - grib_handle *h = get_handle(*ingid); - grib_multi_handle *mh = get_multi_handle(*mgid); + grib_handle* h = get_handle(*ingid); + grib_multi_handle* mh = get_multi_handle(*mgid); if (!h) return GRIB_INVALID_GRIB; if (!mh) { - mh=grib_multi_handle_new(h->context); - push_multi_handle(mh,mgid); + mh = grib_multi_handle_new(h->context); + push_multi_handle(mh, mgid); } - return grib_multi_handle_append(h,*sec,mh); + return grib_multi_handle_append(h, *sec, mh); } int grib_c_get_native_type(int* gid, char* key, int* type) { - grib_handle *h = get_handle(*gid); + grib_handle* h = get_handle(*gid); if (!h) return GRIB_INVALID_GRIB; @@ -2267,56 +2322,58 @@ int grib_c_get_native_type(int* gid, char* key, int* type) int grib_c_index_write(int* gid, char* file) { - grib_index *i = get_index(*gid); - int err = GRIB_SUCCESS; + grib_index* i = get_index(*gid); + int err = GRIB_SUCCESS; if (!i) { return GRIB_INVALID_GRIB; - } else { - err = grib_index_write(i,file); + } + else { + err = grib_index_write(i, file); return err; } } int grib_c_index_read(char* file, int* gid) { - int err = 0; - grib_index *i = NULL; + int err = 0; + grib_index* i = NULL; if (*file) { - i = grib_index_read(0,file,&err); + i = grib_index_read(0, file, &err); if (i) { - push_index(i,gid); + push_index(i, gid); return GRIB_SUCCESS; - } else { + } + else { *gid = -1; return GRIB_END_OF_FILE; } } - *gid=-1; + *gid = -1; return GRIB_INVALID_FILE; } void no_fail_on_wrong_length(int flag) { - grib_context *c = grib_context_get_default(); + grib_context* c = grib_context_get_default(); int value; assert(c != NULL); - value = (flag != 0) ? 1 : 0; + value = (flag != 0) ? 1 : 0; c->no_fail_on_wrong_length = value; } void grib_c_gts_header_on(void) { - grib_context *c = grib_context_get_default(); + grib_context* c = grib_context_get_default(); assert(c != NULL); grib_gts_header_on(c); } void grib_c_gts_header_off(void) { - grib_context *c = grib_context_get_default(); + grib_context* c = grib_context_get_default(); assert(c != NULL); grib_gts_header_off(c); } @@ -2326,21 +2383,21 @@ long grib_c_get_api_version(void) return grib_get_api_version(); } -int grib_c_get_message(int *gid, const void **msg, size_t *size) +int grib_c_get_message(int* gid, const void** msg, size_t* size) { - grib_handle *h = get_handle(*gid); - return grib_get_message(h,msg,size); + grib_handle* h = get_handle(*gid); + return grib_get_message(h, msg, size); } void grib_c_set_definitions_path(const char* path) { - grib_context *c = grib_context_get_default(); + grib_context* c = grib_context_get_default(); grib_context_set_definitions_path(c, path); } void grib_c_set_samples_path(const char* path) { - grib_context *c = grib_context_get_default(); + grib_context* c = grib_context_get_default(); grib_context_set_samples_path(c, path); } diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6ebabd2db..4f04c7b4f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -96,6 +96,7 @@ list( APPEND grib_api_srcs grib_accessor_class_codetable.c grib_accessor_class_codetable_units.c grib_accessor_class_codetable_title.c + grib_accessor_class_step_human_readable.c grib_accessor_class_count_file.c grib_accessor_class_count_total.c grib_accessor_class_double.c @@ -348,6 +349,7 @@ list( APPEND grib_api_srcs grib_iterator_class_polar_stereographic.c grib_iterator_class_lambert_azimuthal_equal_area.c grib_iterator_class_lambert_conformal.c + grib_iterator_class_mercator.c grib_iterator.c grib_iterator_class.c grib_iterator_class_gaussian.c @@ -399,8 +401,7 @@ list( APPEND grib_api_srcs grib_accessor_class_data_g2bifourier_packing.c eccodes_windef.h # We ship our own generated lex/yacc C files - grib_yacc.c grib_lex.c -) + grib_yacc.c grib_lex.c ) list( APPEND grib_api_extra_srcs grib_bits_fast_big_endian.c grib_bits_any_endian.c @@ -410,8 +411,7 @@ list( APPEND grib_api_extra_srcs encode_double_array.c grib_bits_ibmpow.c grib_bits_ibmpow_opt.c - minmax_val.c -) + minmax_val.c ) configure_file( grib_api_version.c.in grib_api_version.c @ONLY ) configure_file( eccodes_version.h.in eccodes_version.h @ONLY ) @@ -426,19 +426,19 @@ configure_file( eccodes_version.h.in eccodes_version.h @ONLY ) # YACC_FLAGS "-y" # DEPENDANT action.c ) -if(HAVE_MEMFS) +if( HAVE_MEMFS ) list(APPEND ECCODES_EXTRA_LIBRARIES eccodes_memfs) endif() -ecbuild_add_library(TARGET eccodes - SOURCES grib_api_version.c +ecbuild_add_library( TARGET eccodes + SOURCES grib_api_version.c # griby.c gribl.c ${grib_api_srcs} - GENERATED grib_api_version.c - LIBS ${ECCODES_EXTRA_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${CMATH_LIBRARIES} - TEMPLATES ${grib_api_extra_srcs} - INSTALL_HEADERS_LIST + GENERATED grib_api_version.c + LIBS ${ECCODES_EXTRA_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${CMATH_LIBRARIES} + TEMPLATES ${grib_api_extra_srcs} + INSTALL_HEADERS_LIST grib_api.h eccodes.h eccodes_windef.h diff --git a/src/Makefile.am b/src/Makefile.am index db56774ea..40b491f21 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -187,6 +187,7 @@ libeccodes_la_prototypes= \ grib_accessor_class_signed.c \ grib_accessor_class_signed_bits.c \ grib_accessor_class_section.c \ + grib_accessor_class_step_human_readable.c \ grib_accessor_class_step_in_units.c \ grib_accessor_class_section_length.c \ grib_accessor_class_g1_message_length.c \ @@ -363,6 +364,7 @@ libeccodes_la_prototypes= \ grib_iterator_class_polar_stereographic.c \ grib_iterator_class_lambert_azimuthal_equal_area.c \ grib_iterator_class_lambert_conformal.c \ + grib_iterator_class_mercator.c \ grib_iterator.c \ grib_iterator_class.c \ grib_iterator_class_gaussian.c \ diff --git a/src/action_class_gen.c b/src/action_class_gen.c index 0068dae93..f1492b4d3 100644 --- a/src/action_class_gen.c +++ b/src/action_class_gen.c @@ -97,7 +97,7 @@ grib_action* grib_action_create_gen(grib_context* context, const char* name, con act->cclass = c; act->context = context; act->flags = flags; -#if CHECK_LOWERCASE_AND_STRING_TYPE +#ifdef CHECK_LOWERCASE_AND_STRING_TYPE { int flag_lowercase=0, flag_stringtype=0; if (flags & GRIB_ACCESSOR_FLAG_LOWERCASE) diff --git a/src/codes_util.c b/src/codes_util.c index 4772f2e89..ca54f9cd8 100644 --- a/src/codes_util.c +++ b/src/codes_util.c @@ -10,6 +10,17 @@ #include "grib_api_internal.h" +/* Input lon must be in degrees not radians */ +/* Not to be used for latitudes as they can be -ve */ +double normalise_longitude_in_degrees(double lon) +{ + while (lon < 0) + lon += 360; + while (lon > 360) + lon -= 360; + return lon; +} + #ifdef ECCODES_ON_WINDOWS /* Replace C99/Unix rint() for Windows Visual C++ (only before VC++ 2013 versions) */ diff --git a/src/grib_accessor_class.h b/src/grib_accessor_class.h index bca97bebd..51bcd634d 100644 --- a/src/grib_accessor_class.h +++ b/src/grib_accessor_class.h @@ -196,6 +196,7 @@ extern grib_accessor_class* grib_accessor_class_spectral_truncation; extern grib_accessor_class* grib_accessor_class_sprintf; extern grib_accessor_class* grib_accessor_class_statistics; extern grib_accessor_class* grib_accessor_class_statistics_spectral; +extern grib_accessor_class* grib_accessor_class_step_human_readable; extern grib_accessor_class* grib_accessor_class_step_in_units; extern grib_accessor_class* grib_accessor_class_sum; extern grib_accessor_class* grib_accessor_class_suppressed; diff --git a/src/grib_accessor_class_bufr_data_array.c b/src/grib_accessor_class_bufr_data_array.c index 6632ade8b..51c4217c4 100644 --- a/src/grib_accessor_class_bufr_data_array.c +++ b/src/grib_accessor_class_bufr_data_array.c @@ -412,7 +412,7 @@ static void init(grib_accessor* a, const long v, grib_arguments* params) a->length = 0; self->bitsToEndData = get_length(a) * 8; self->unpackMode = CODES_BUFR_UNPACK_STRUCTURE; - + self->inputBitmap = NULL; /* Assert(a->length>=0); */ } @@ -461,6 +461,7 @@ static void self_clear(grib_context* c, grib_accessor_bufr_data_array* self) self->refValIndex = 0; tableB_override_clear(c, self); self->set_to_missing_if_out_of_range = 0; + if (self->inputBitmap) grib_context_free(c, self->inputBitmap); } static int get_native_type(grib_accessor* a) @@ -543,6 +544,7 @@ static int get_descriptors(grib_accessor* a) return ret; numberOfDescriptors = grib_bufr_descriptors_array_used_size(self->expanded); + if (self->canBeMissing ) grib_context_free(c, self->canBeMissing); self->canBeMissing = (int*)grib_context_malloc_clear(c, numberOfDescriptors * sizeof(int)); for (i = 0; i < numberOfDescriptors; i++) self->canBeMissing[i] = grib_bufr_descriptor_can_be_missing(self->expanded->v[i]); @@ -860,6 +862,7 @@ static int encode_double_array(grib_context* c, grib_buffer* buff, long* pos, bu } grib_buffer_set_ulength_bits(c, buff, buff->ulength_bits + 6); grib_encode_unsigned_longb(buff->data, localWidth, pos, 6); + grib_context_free(c, values); return err; } @@ -2450,7 +2453,7 @@ static int create_keys(grib_accessor* a, long onlySubset, long startSubset, long grib_sarray_delete(c, self->tempStrings); self->tempStrings = NULL; } - self->tempStrings = grib_sarray_new(c, self->numberOfSubsets, 500); + self->tempStrings = self->numberOfSubsets? grib_sarray_new(c, self->numberOfSubsets, 500) : NULL; end = self->compressedData ? 1 : self->numberOfSubsets; groupNumber = 1; @@ -2878,6 +2881,10 @@ static int process_elements(grib_accessor* a, int flag, long onlySubset, long st return err; descriptors = self->expanded->v; + if (!descriptors) { + grib_context_log(c, GRIB_LOG_ERROR, "No descriptors found!"); + return GRIB_INTERNAL_ERROR; + } if (do_clean == 1 && self->numericValues) { grib_vdarray_delete_content(c, self->numericValues); @@ -2951,9 +2958,10 @@ static int process_elements(grib_accessor* a, int flag, long onlySubset, long st elementIndex = 0; numberOfNestedRepetitions = 0; - inr = 0; + for (i = 0; i < numberOfDescriptors; i++) { - grib_context_log(c, GRIB_LOG_DEBUG, "BUFR data processing: elementNumber=%ld code=%6.6ld", icount++, descriptors[i]->code); + if (c->debug) grib_context_log(c, GRIB_LOG_DEBUG, "BUFR data processing: elementNumber=%ld code=%6.6ld", + icount++, descriptors[i]->code); switch (descriptors[i]->F) { case 0: /* Table B element */ @@ -3415,4 +3423,5 @@ static void destroy(grib_context* c, grib_accessor* a) grib_sarray_delete_content(c, self->tempStrings); grib_sarray_delete(c, self->tempStrings); } + grib_iarray_delete(self->iss_list); } diff --git a/src/grib_accessor_class_bufr_data_element.c b/src/grib_accessor_class_bufr_data_element.c index a3fa0efca..c332b081f 100644 --- a/src/grib_accessor_class_bufr_data_element.c +++ b/src/grib_accessor_class_bufr_data_element.c @@ -384,6 +384,7 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) } if (str == 0 || strlen(str) == 0) { + grib_context_free(c, str); *len = 0; *val = 0; return ret; diff --git a/src/grib_accessor_class_bufr_elements_table.c b/src/grib_accessor_class_bufr_elements_table.c index 193c89228..615df7350 100644 --- a/src/grib_accessor_class_bufr_elements_table.c +++ b/src/grib_accessor_class_bufr_elements_table.c @@ -191,6 +191,7 @@ static grib_trie* load_bufr_elements_table(grib_accessor* a, int* err) char dictName[1024] = {0,}; char* localFilename = 0; char** list = 0; + char** cached_list = 0; size_t len = 1024; grib_trie* dictionary = NULL; FILE* f = NULL; @@ -261,6 +262,8 @@ static grib_trie* load_bufr_elements_table(grib_accessor* a, int* err) dictionary = grib_trie_new(c); while (fgets(line, sizeof(line) - 1, f)) { + DebugAssert( strlen(line) > 0 ); + if (line[0] == '#') continue; /* Ignore first line with column titles */ list = string_split(line, "|"); grib_trie_insert(dictionary, list[0], list); } @@ -276,7 +279,16 @@ static grib_trie* load_bufr_elements_table(grib_accessor* a, int* err) } while (fgets(line, sizeof(line) - 1, f)) { + DebugAssert( strlen(line) > 0 ); + if (line[0] == '#') continue; /* Ignore first line with column titles */ list = string_split(line, "|"); + /* Look for the descriptor code in the trie. It might be there from before */ + cached_list = (char**)grib_trie_get(dictionary, list[0]); + if (cached_list) { /* If found, we are about to overwrite it. So free memory */ + int i; + for (i = 0; cached_list[i] != NULL; ++i) free(cached_list[i]); + free(cached_list); + } grib_trie_insert(dictionary, list[0], list); } diff --git a/src/grib_accessor_class_bufrdc_expanded_descriptors.c b/src/grib_accessor_class_bufrdc_expanded_descriptors.c index 511f300f9..6177280c5 100644 --- a/src/grib_accessor_class_bufrdc_expanded_descriptors.c +++ b/src/grib_accessor_class_bufrdc_expanded_descriptors.c @@ -192,6 +192,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) val[rlen++] = v[i]; } *len = rlen; + grib_context_free(c,v); return GRIB_SUCCESS; } diff --git a/src/grib_accessor_class_concept.c b/src/grib_accessor_class_concept.c index 7582e7a70..2e35cb01d 100644 --- a/src/grib_accessor_class_concept.c +++ b/src/grib_accessor_class_concept.c @@ -356,14 +356,14 @@ static int grib_concept_apply(grib_accessor* a, const char* name) err = nofail ? GRIB_SUCCESS : GRIB_CONCEPT_NO_MATCH; if (err) { size_t i = 0, concept_count = 0; - long dummy = 0, editionNumber = 0; + long dummy = 0, editionNumber = 0; char* all_concept_vals[MAX_NUM_CONCEPT_VALUES] = { NULL, }; /* sorted array containing concept values */ grib_concept_value* pCon = concepts; grib_context_log(h->context, GRIB_LOG_ERROR, "concept: no match for %s=%s", act->name, name); - if (strcmp(act->name, "paramId")==0 && string_to_long(name, &dummy)==GRIB_SUCCESS) { + if (strcmp(act->name, "paramId") == 0 && string_to_long(name, &dummy) == GRIB_SUCCESS) { grib_context_log(h->context, GRIB_LOG_ERROR, "Please check the Parameter Database 'https://apps.ecmwf.int/codes/grib/param-db/?id=%s'", name); } @@ -441,11 +441,12 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) int ret = 0; if (a->flags & GRIB_ACCESSOR_FLAG_LONG_TYPE) { long lval = 0; - ret = unpack_long(a, &lval, len); + ret = unpack_long(a, &lval, len); if (ret == GRIB_SUCCESS) { *val = lval; } - } else if (a->flags & GRIB_ACCESSOR_FLAG_DOUBLE_TYPE) { + } + else if (a->flags & GRIB_ACCESSOR_FLAG_DOUBLE_TYPE) { const char* p = concept_evaluate(a); if (!p) { @@ -559,6 +560,7 @@ static void destroy(grib_context* c, grib_accessor* a) */ } +#if 0 static int is_local_ecmwf_grib2_param_key(grib_accessor* a, long edition, long centre) { if (edition == 2 && centre == 98) { @@ -567,46 +569,9 @@ static int is_local_ecmwf_grib2_param_key(grib_accessor* a, long edition, long c } return 0; } +#endif -static char* get_legacy_param_info(const char* key_name, long paramId) -{ - if (strcmp(key_name, "modelName") == 0) - return "unknown"; - if (paramId == 210) { - if (strcmp(key_name, "paramId") == 0) - return "210"; - if (strcmp(key_name, "shortName") == 0) - return "ssrc"; - if (strcmp(key_name, "units") == 0) - return "J m**-2"; - if (strcmp(key_name, "name") == 0) - return "Surface net solar radiation, clear sky"; - if (strcmp(key_name, "cfVarName") == 0) - return "ssrc"; - if (strncmp(key_name, "cfName", 6) == 0) - return "surface_net_downward_shortwave_flux_assuming_clear_sky"; - } - else if (paramId == 211) { - if (strcmp(key_name, "paramId") == 0) - return "211"; - if (strcmp(key_name, "shortName") == 0) - return "strc"; - if (strcmp(key_name, "units") == 0) - return "J m**-2"; - if (strcmp(key_name, "name") == 0) - return "Surface net thermal radiation, clear sky"; - if (strcmp(key_name, "cfVarName") == 0) - return "strc"; - if (strncmp(key_name, "cfName", 6) == 0) - return "surface_net_downward_longwave_flux_assuming_clear_sky"; - } - else if (paramId == 228051 || paramId == 228053 || paramId == 228057 || paramId == 228058 || paramId == 228059 || paramId == 228060) { - if (strncmp(key_name, "cfName", 6) == 0) - return "unknown"; - } - return NULL; -} - +#if 0 /* Try to get the name, shortName, units etc for a GRIB2 message with * local ECMWF coding i.e. discipline=192 etc */ @@ -624,18 +589,12 @@ static const char* get_ECMWF_local_parameter(grib_accessor* a, grib_handle* h) if (err) return NULL; if (is_local_ecmwf_grib2_param_key(a, edition, centre)) { - char* pLocalParam = NULL; /* Must be one of: 'name', 'shortName', 'units', 'cfName' etc */ grib_accessor* a2 = NULL; const long pid_guess = guess_paramId(h); if (pid_guess == -1) return NULL; - /* TODO: Need to revisit */ - pLocalParam = get_legacy_param_info(key_name, pid_guess); - if (pLocalParam) - return pLocalParam; - /* Change the paramId so we can get the other string key*/ err = grib_set_long(h, "paramId", pid_guess); if (err) @@ -650,6 +609,7 @@ static const char* get_ECMWF_local_parameter(grib_accessor* a, grib_handle* h) } return NULL; } +#endif static int unpack_string(grib_accessor* a, char* val, size_t* len) { @@ -658,14 +618,10 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) if (!p) { grib_handle* h = grib_handle_of_accessor(a); - p = get_ECMWF_local_parameter(a, h); - if (!p) { - if (a->creator->defaultkey) - return grib_get_string_internal(h, a->creator->defaultkey, val, len); + if (a->creator->defaultkey) + return grib_get_string_internal(h, a->creator->defaultkey, val, len); - return GRIB_NOT_FOUND; - } - grib_context_log(h->context, GRIB_LOG_DEBUG, "ECMWF local grib2 parameter: %s=%s", a->name, p); + return GRIB_NOT_FOUND; } slen = strlen(p) + 1; diff --git a/src/grib_accessor_class_data_g1second_order_row_by_row_packing.c b/src/grib_accessor_class_data_g1second_order_row_by_row_packing.c index c6c76fc5a..0d5e86856 100644 --- a/src/grib_accessor_class_data_g1second_order_row_by_row_packing.c +++ b/src/grib_accessor_class_data_g1second_order_row_by_row_packing.c @@ -267,6 +267,7 @@ static int value_count(grib_accessor* a, long* count) } else { if (plSize) { + if (numberOfRows && !pl) return GRIB_INTERNAL_ERROR; for (i = 0; i < numberOfRows; i++) n += pl[i]; grib_context_free(c, pl); diff --git a/src/grib_accessor_class_data_g2bifourier_packing.c b/src/grib_accessor_class_data_g2bifourier_packing.c index d947118e7..6a2b5575f 100644 --- a/src/grib_accessor_class_data_g2bifourier_packing.c +++ b/src/grib_accessor_class_data_g2bifourier_packing.c @@ -415,6 +415,12 @@ static double laplam(bif_trunc_t* bt, const double val[]) * Now, itab2 contains all possible values of i*i+j*j, and itab1 contains * the rank of all i*i+j*j */ + if (lmax <= 0) { + free(itab1); + free(itab2); + Assert(!"data_g2bifourier_packing::laplam: lmax must be > 0"); + return 0; + } znorm = (double*)calloc(lmax, sizeof(double)); zw = (double*)malloc(sizeof(double) * lmax); @@ -634,7 +640,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) grib_accessor_data_g2bifourier_packing* self = (grib_accessor_data_g2bifourier_packing*)a; grib_handle* gh = grib_handle_of_accessor(a); - unsigned char* buf = (unsigned char*)gh->buffer->data; + unsigned char* buf = NULL; unsigned char* hres = NULL; unsigned char* lres = NULL; unsigned long packed_offset; diff --git a/src/grib_accessor_class_expanded_descriptors.c b/src/grib_accessor_class_expanded_descriptors.c index 417c1beae..62b917d02 100644 --- a/src/grib_accessor_class_expanded_descriptors.c +++ b/src/grib_accessor_class_expanded_descriptors.c @@ -289,7 +289,7 @@ static void __expand(grib_accessor* a, bufr_descriptors_array* unexpanded, bufr_ } #endif size = BUFR_DESCRIPTORS_ARRAY_USED_SIZE(inner_expanded); - expanded = grib_bufr_descriptors_array_append(expanded, inner_expanded); + grib_bufr_descriptors_array_append(expanded, inner_expanded); break; case 1: @@ -388,7 +388,7 @@ static void __expand(grib_accessor* a, bufr_descriptors_array* unexpanded, bufr_ } #endif size = BUFR_DESCRIPTORS_ARRAY_USED_SIZE(inner_expanded); - expanded = grib_bufr_descriptors_array_append(expanded, inner_expanded); + grib_bufr_descriptors_array_append(expanded, inner_expanded); } break; diff --git a/src/grib_accessor_class_g2_mars_labeling.c b/src/grib_accessor_class_g2_mars_labeling.c index 2fb5b9d3c..b5ec66b59 100644 --- a/src/grib_accessor_class_g2_mars_labeling.c +++ b/src/grib_accessor_class_g2_mars_labeling.c @@ -403,8 +403,8 @@ static int extra_set(grib_accessor* a, long val) typeOfGeneratingProcess = 4; break; default: - grib_context_log(a->context, GRIB_LOG_ERROR, "unknown mars.type %d", (int)val); - return GRIB_ENCODING_ERROR; + grib_context_log(a->context, GRIB_LOG_WARNING, "g2_mars_labeling: unknown mars.type %d", (int)val); + /*return GRIB_ENCODING_ERROR;*/ } break; case 2: diff --git a/src/grib_accessor_class_g2latlon.c b/src/grib_accessor_class_g2latlon.c index 50b912c69..c1d3456ab 100644 --- a/src/grib_accessor_class_g2latlon.c +++ b/src/grib_accessor_class_g2latlon.c @@ -181,16 +181,6 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return GRIB_SUCCESS; } -static double normalise_longitude(double a_lon) -{ - /* WMO regulation: The longitude values shall be limited to the range 0 to 360 degrees inclusive */ - while (a_lon < 0) - a_lon += 360; - while (a_lon > 360) - a_lon -= 360; - return a_lon; -} - static int pack_double(grib_accessor* a, const double* val, size_t* len) { grib_accessor_g2latlon* self = (grib_accessor_g2latlon*)a; @@ -218,7 +208,9 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) * index 3 is longitudeOfLastGridPointInDegrees */ if ((self->index == 1 || self->index == 3)) { - new_val = normalise_longitude(*val); + /* WMO regulation for GRIB edition 2: + * The longitude values shall be limited to the range 0 to 360 degrees inclusive */ + new_val = normalise_longitude_in_degrees(*val); } grid[self->index] = new_val; diff --git a/src/grib_accessor_class_smart_table.c b/src/grib_accessor_class_smart_table.c index 099c20624..70fa29a6e 100644 --- a/src/grib_accessor_class_smart_table.c +++ b/src/grib_accessor_class_smart_table.c @@ -380,6 +380,8 @@ static int grib_load_smart_table(grib_context* c, const char* filename, numberOfColumns = 0; while (*s) { + char* tcol = t->entries[code].column[numberOfColumns]; + if ( tcol ) grib_context_free_persistent(c, tcol); t->entries[code].column[numberOfColumns] = grib_context_strdup_persistent(c, s); numberOfColumns++; Assert(numberOfColumns < MAX_SMART_TABLE_COLUMNS); diff --git a/src/grib_accessor_class_step_human_readable.c b/src/grib_accessor_class_step_human_readable.c new file mode 100644 index 000000000..3da2e495a --- /dev/null +++ b/src/grib_accessor_class_step_human_readable.c @@ -0,0 +1,199 @@ +/* + * (C) Copyright 2005- 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. + */ + +#include "grib_api_internal.h" + +/* + This is used by make_class.pl + + START_CLASS_DEF + CLASS = accessor + SUPER = grib_accessor_class_gen + IMPLEMENTS = init;unpack_string; get_native_type + MEMBERS = const char* stepUnits + MEMBERS = const char* step + END_CLASS_DEF + + */ + +/* START_CLASS_IMP */ + +/* + +Don't edit anything between START_CLASS_IMP and END_CLASS_IMP +Instead edit values between START_CLASS_DEF and END_CLASS_DEF +or edit "accessor.class" and rerun ./make_class.pl + +*/ + +static int get_native_type(grib_accessor*); +static int unpack_string(grib_accessor*, char*, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); +static void init_class(grib_accessor_class*); + +typedef struct grib_accessor_step_human_readable +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in step_human_readable */ + const char* stepUnits; + const char* step; +} grib_accessor_step_human_readable; + +extern grib_accessor_class* grib_accessor_class_gen; + +static grib_accessor_class _grib_accessor_class_step_human_readable = { + &grib_accessor_class_gen, /* super */ + "step_human_readable", /* name */ + sizeof(grib_accessor_step_human_readable), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ +}; + + +grib_accessor_class* grib_accessor_class_step_human_readable = &_grib_accessor_class_step_human_readable; + + +static void init_class(grib_accessor_class* c) +{ + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string = (*(c->super))->pack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; +} + +/* END_CLASS_IMP */ + +static void init(grib_accessor* a, const long len, grib_arguments* params) +{ + grib_accessor_step_human_readable* self = (grib_accessor_step_human_readable*)a; + int n = 0; + grib_handle* h = grib_handle_of_accessor(a); + + self->stepUnits = grib_arguments_get_name(h, params, n++); + self->step = grib_arguments_get_name(h, params, n++); + a->length = 0; + a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; +} + +static int get_native_type(grib_accessor* a) +{ + return GRIB_TYPE_STRING; +} + +static int get_step_human_readable(grib_handle* h, char* result, size_t* length) +{ + int err = 0; + size_t slen = 2; + long step, hour, minute, second; + + /* Change units to seconds (highest resolution) + * before computing the step value + */ + err = grib_set_string(h, "stepUnits", "s", &slen); + if (err) return err; + err = grib_get_long(h, "step", &step); + if (err) return err; + + hour = step/3600; + minute = step/60 % 60; + second = step % 60; + /* sprintf(result, "%ld:%ld:%ld", hour, minute, second); */ + + if (second) { + sprintf(result, "%ldh %ldm %lds", hour, minute, second); + } else { + if (minute) sprintf(result, "%ldh %ldm", hour, minute); + else sprintf(result, "%ldh", hour); + } + + *length = strlen(result); + return GRIB_SUCCESS; +} + +static int unpack_string(grib_accessor* a, char* buffer, size_t* len) +{ + grib_accessor_step_human_readable* self = (grib_accessor_step_human_readable*)a; + grib_handle* h = grib_handle_of_accessor(a); + long stepUnits; + int err = 0; + + /* Save the current value of stepUnits */ + err = grib_get_long_internal(h, self->stepUnits, &stepUnits); + if (err) return err; + + /* This will change stepUnits to seconds for its calculation */ + err = get_step_human_readable(h, buffer, len); + + /* Restore stepUnits */ + grib_set_long(h, self->stepUnits, stepUnits); + return err; +} diff --git a/src/grib_accessor_classes_hash.c b/src/grib_accessor_classes_hash.c index 0d094e8e2..edda41eea 100644 --- a/src/grib_accessor_classes_hash.c +++ b/src/grib_accessor_classes_hash.c @@ -37,12 +37,12 @@ error "gperf generated tables don't work with this execution character set. Plea #line 6 "accessor_class_list.gperf" struct accessor_class_hash { char *name; grib_accessor_class **cclass;}; -#define TOTAL_KEYWORDS 224 +#define TOTAL_KEYWORDS 225 #define MIN_WORD_LENGTH 1 #define MAX_WORD_LENGTH 44 #define MIN_HASH_VALUE 1 -#define MAX_HASH_VALUE 586 -/* maximum key range = 586, duplicates = 0 */ +#define MAX_HASH_VALUE 621 +/* maximum key range = 621, duplicates = 0 */ #ifdef __GNUC__ @@ -56,32 +56,32 @@ grib_accessor_classes_get_id (const char *str, unsigned int len) { static const unsigned short asso_values[] = { - 587, 587, 587, 587, 587, 587, 587, 587, 587, 587, - 587, 587, 587, 587, 587, 587, 587, 587, 587, 587, - 587, 587, 587, 587, 587, 587, 587, 587, 587, 587, - 587, 587, 0, 587, 587, 587, 587, 587, 587, 587, - 587, 587, 587, 587, 587, 587, 587, 587, 2, 44, - 14, 14, 9, 587, 0, 587, 11, 587, 587, 587, - 587, 587, 587, 587, 587, 587, 587, 587, 587, 587, - 587, 587, 587, 587, 587, 587, 587, 587, 587, 587, - 587, 587, 587, 587, 587, 587, 587, 587, 587, 587, - 587, 587, 587, 587, 587, 0, 587, 0, 104, 46, - 0, 0, 173, 29, 252, 1, 9, 3, 88, 155, - 13, 63, 20, 587, 196, 1, 53, 73, 160, 1, - 6, 5, 587, 587, 587, 587, 587, 587, 587, 587, - 587, 587, 587, 587, 587, 587, 587, 587, 587, 587, - 587, 587, 587, 587, 587, 587, 587, 587, 587, 587, - 587, 587, 587, 587, 587, 587, 587, 587, 587, 587, - 587, 587, 587, 587, 587, 587, 587, 587, 587, 587, - 587, 587, 587, 587, 587, 587, 587, 587, 587, 587, - 587, 587, 587, 587, 587, 587, 587, 587, 587, 587, - 587, 587, 587, 587, 587, 587, 587, 587, 587, 587, - 587, 587, 587, 587, 587, 587, 587, 587, 587, 587, - 587, 587, 587, 587, 587, 587, 587, 587, 587, 587, - 587, 587, 587, 587, 587, 587, 587, 587, 587, 587, - 587, 587, 587, 587, 587, 587, 587, 587, 587, 587, - 587, 587, 587, 587, 587, 587, 587, 587, 587, 587, - 587, 587, 587, 587, 587, 587 + 622, 622, 622, 622, 622, 622, 622, 622, 622, 622, + 622, 622, 622, 622, 622, 622, 622, 622, 622, 622, + 622, 622, 622, 622, 622, 622, 622, 622, 622, 622, + 622, 622, 0, 622, 622, 622, 622, 622, 622, 622, + 622, 622, 622, 622, 622, 622, 622, 622, 1, 60, + 18, 2, 5, 622, 27, 622, 1, 622, 622, 622, + 622, 622, 622, 622, 622, 622, 622, 622, 622, 622, + 622, 622, 622, 622, 622, 622, 622, 622, 622, 622, + 622, 622, 622, 622, 622, 622, 622, 622, 622, 622, + 622, 622, 622, 622, 622, 0, 622, 0, 121, 127, + 0, 3, 192, 28, 0, 1, 1, 5, 119, 244, + 14, 64, 55, 622, 147, 3, 2, 93, 158, 0, + 2, 145, 622, 622, 622, 622, 622, 622, 622, 622, + 622, 622, 622, 622, 622, 622, 622, 622, 622, 622, + 622, 622, 622, 622, 622, 622, 622, 622, 622, 622, + 622, 622, 622, 622, 622, 622, 622, 622, 622, 622, + 622, 622, 622, 622, 622, 622, 622, 622, 622, 622, + 622, 622, 622, 622, 622, 622, 622, 622, 622, 622, + 622, 622, 622, 622, 622, 622, 622, 622, 622, 622, + 622, 622, 622, 622, 622, 622, 622, 622, 622, 622, + 622, 622, 622, 622, 622, 622, 622, 622, 622, 622, + 622, 622, 622, 622, 622, 622, 622, 622, 622, 622, + 622, 622, 622, 622, 622, 622, 622, 622, 622, 622, + 622, 622, 622, 622, 622, 622, 622, 622, 622, 622, + 622, 622, 622, 622, 622, 622, 622, 622, 622, 622, + 622, 622, 622, 622, 622, 622 }; register int hval = len; @@ -117,565 +117,573 @@ static const struct accessor_class_hash classes[] = {""}, #line 9 "accessor_class_list.gperf" {" "}, - {""}, {""}, {""}, {""}, + {""}, {""}, +#line 233 "accessor_class_list.gperf" + {"when", &grib_accessor_class_when}, + {""}, {""}, +#line 210 "accessor_class_list.gperf" + {"time", &grib_accessor_class_time}, #line 198 "accessor_class_list.gperf" {"size", &grib_accessor_class_size}, #line 14 "accessor_class_list.gperf" {"ascii", &grib_accessor_class_ascii}, + {""}, +#line 211 "accessor_class_list.gperf" + {"times", &grib_accessor_class_times}, + {""}, #line 195 "accessor_class_list.gperf" {"signed", &grib_accessor_class_signed}, {""}, {""}, -#line 83 "accessor_class_list.gperf" - {"dirty", &grib_accessor_class_dirty}, - {""}, {""}, -#line 196 "accessor_class_list.gperf" - {"signed_bits", &grib_accessor_class_signed_bits}, - {""}, #line 75 "accessor_class_list.gperf" {"data_raw_packing", &grib_accessor_class_data_raw_packing}, {""}, +#line 204 "accessor_class_list.gperf" + {"statistics", &grib_accessor_class_statistics}, #line 142 "accessor_class_list.gperf" {"int8", &grib_accessor_class_int8}, -#line 136 "accessor_class_list.gperf" - {"int16", &grib_accessor_class_int16}, + {""}, +#line 196 "accessor_class_list.gperf" + {"signed_bits", &grib_accessor_class_signed_bits}, + {""}, #line 80 "accessor_class_list.gperf" {"data_simple_packing", &grib_accessor_class_data_simple_packing}, #line 76 "accessor_class_list.gperf" {"data_secondary_bitmap", &grib_accessor_class_data_secondary_bitmap}, -#line 189 "accessor_class_list.gperf" - {"section", &grib_accessor_class_section}, -#line 176 "accessor_class_list.gperf" - {"pad", &grib_accessor_class_pad}, -#line 201 "accessor_class_list.gperf" - {"spd", &grib_accessor_class_spd}, -#line 82 "accessor_class_list.gperf" - {"dictionary", &grib_accessor_class_dictionary}, - {""}, {""}, #line 140 "accessor_class_list.gperf" {"int64", &grib_accessor_class_int64}, +#line 82 "accessor_class_list.gperf" + {"dictionary", &grib_accessor_class_dictionary}, +#line 205 "accessor_class_list.gperf" + {"statistics_spectral", &grib_accessor_class_statistics_spectral}, +#line 189 "accessor_class_list.gperf" + {"section", &grib_accessor_class_section}, +#line 164 "accessor_class_list.gperf" + {"nearest", &grib_accessor_class_nearest}, #line 74 "accessor_class_list.gperf" {"data_png_packing", &grib_accessor_class_data_png_packing}, + {""}, {""}, +#line 207 "accessor_class_list.gperf" + {"step_in_units", &grib_accessor_class_step_in_units}, +#line 126 "accessor_class_list.gperf" + {"gen", &grib_accessor_class_gen}, + {""}, #line 191 "accessor_class_list.gperf" {"section_padding", &grib_accessor_class_section_padding}, #line 192 "accessor_class_list.gperf" {"section_pointer", &grib_accessor_class_section_pointer}, -#line 126 "accessor_class_list.gperf" - {"gen", &grib_accessor_class_gen}, #line 138 "accessor_class_list.gperf" {"int32", &grib_accessor_class_int32}, - {""}, #line 66 "accessor_class_list.gperf" {"data_g22order_packing", &grib_accessor_class_data_g22order_packing}, +#line 130 "accessor_class_list.gperf" + {"gts_header", &grib_accessor_class_gts_header}, {""}, -#line 50 "accessor_class_list.gperf" - {"data_apply_bitmap", &grib_accessor_class_data_apply_bitmap}, #line 70 "accessor_class_list.gperf" {"data_g2shsimple_packing", &grib_accessor_class_data_g2shsimple_packing}, + {""}, {""}, #line 88 "accessor_class_list.gperf" {"expanded_descriptors", &grib_accessor_class_expanded_descriptors}, - {""}, -#line 188 "accessor_class_list.gperf" - {"second_order_bits_per_value", &grib_accessor_class_second_order_bits_per_value}, -#line 190 "accessor_class_list.gperf" - {"section_length", &grib_accessor_class_section_length}, -#line 73 "accessor_class_list.gperf" - {"data_jpeg2000_packing", &grib_accessor_class_data_jpeg2000_packing}, -#line 53 "accessor_class_list.gperf" - {"data_apply_gdsnotpresent", &grib_accessor_class_data_apply_gdsnotpresent}, #line 124 "accessor_class_list.gperf" {"gds_is_present", &grib_accessor_class_gds_is_present}, -#line 51 "accessor_class_list.gperf" - {"data_apply_boustrophedonic", &grib_accessor_class_data_apply_boustrophedonic}, +#line 136 "accessor_class_list.gperf" + {"int16", &grib_accessor_class_int16}, {""}, +#line 190 "accessor_class_list.gperf" + {"section_length", &grib_accessor_class_section_length}, +#line 188 "accessor_class_list.gperf" + {"second_order_bits_per_value", &grib_accessor_class_second_order_bits_per_value}, #line 127 "accessor_class_list.gperf" {"getenv", &grib_accessor_class_getenv}, -#line 121 "accessor_class_list.gperf" - {"g2step", &grib_accessor_class_g2step}, + {""}, #line 117 "accessor_class_list.gperf" {"g2grid", &grib_accessor_class_g2grid}, +#line 115 "accessor_class_list.gperf" + {"g2date", &grib_accessor_class_g2date}, +#line 121 "accessor_class_list.gperf" + {"g2step", &grib_accessor_class_g2step}, +#line 113 "accessor_class_list.gperf" + {"g2bitmap", &grib_accessor_class_g2bitmap}, {""}, -#line 186 "accessor_class_list.gperf" - {"scale", &grib_accessor_class_scale}, -#line 52 "accessor_class_list.gperf" - {"data_apply_boustrophedonic_bitmap", &grib_accessor_class_data_apply_boustrophedonic_bitmap}, +#line 176 "accessor_class_list.gperf" + {"pad", &grib_accessor_class_pad}, #line 116 "accessor_class_list.gperf" {"g2end_step", &grib_accessor_class_g2end_step}, -#line 71 "accessor_class_list.gperf" - {"data_g2simple_packing", &grib_accessor_class_data_g2simple_packing}, -#line 68 "accessor_class_list.gperf" - {"data_g2complex_packing", &grib_accessor_class_data_g2complex_packing}, -#line 177 "accessor_class_list.gperf" - {"padding", &grib_accessor_class_padding}, -#line 209 "accessor_class_list.gperf" - {"time", &grib_accessor_class_time}, {""}, -#line 210 "accessor_class_list.gperf" - {"times", &grib_accessor_class_times}, +#line 201 "accessor_class_list.gperf" + {"spd", &grib_accessor_class_spd}, + {""}, {""}, {""}, #line 120 "accessor_class_list.gperf" {"g2lon", &grib_accessor_class_g2lon}, - {""}, {""}, -#line 54 "accessor_class_list.gperf" - {"data_ccsds_packing", &grib_accessor_class_data_ccsds_packing}, - {""}, {""}, {""}, -#line 64 "accessor_class_list.gperf" - {"data_g1shsimple_packing", &grib_accessor_class_data_g1shsimple_packing}, -#line 111 "accessor_class_list.gperf" - {"g2_eps", &grib_accessor_class_g2_eps}, {""}, {""}, {""}, -#line 164 "accessor_class_list.gperf" - {"nearest", &grib_accessor_class_nearest}, -#line 72 "accessor_class_list.gperf" - {"data_g2simple_packing_with_preprocessing", &grib_accessor_class_data_g2simple_packing_with_preprocessing}, +#line 125 "accessor_class_list.gperf" + {"gds_not_present_bitmap", &grib_accessor_class_gds_not_present_bitmap}, + {""}, +#line 78 "accessor_class_list.gperf" + {"data_sh_unpacked", &grib_accessor_class_data_sh_unpacked}, +#line 50 "accessor_class_list.gperf" + {"data_apply_bitmap", &grib_accessor_class_data_apply_bitmap}, {""}, {""}, -#line 207 "accessor_class_list.gperf" - {"sum", &grib_accessor_class_sum}, +#line 143 "accessor_class_list.gperf" + {"iterator", &grib_accessor_class_iterator}, +#line 79 "accessor_class_list.gperf" + {"data_shsimple_packing", &grib_accessor_class_data_shsimple_packing}, +#line 73 "accessor_class_list.gperf" + {"data_jpeg2000_packing", &grib_accessor_class_data_jpeg2000_packing}, +#line 214 "accessor_class_list.gperf" + {"to_string", &grib_accessor_class_to_string}, +#line 53 "accessor_class_list.gperf" + {"data_apply_gdsnotpresent", &grib_accessor_class_data_apply_gdsnotpresent}, + {""}, +#line 51 "accessor_class_list.gperf" + {"data_apply_boustrophedonic", &grib_accessor_class_data_apply_boustrophedonic}, {""}, -#line 95 "accessor_class_list.gperf" - {"g1area", &grib_accessor_class_g1area}, -#line 220 "accessor_class_list.gperf" - {"uint64", &grib_accessor_class_uint64}, -#line 206 "accessor_class_list.gperf" - {"step_in_units", &grib_accessor_class_step_in_units}, #line 56 "accessor_class_list.gperf" {"data_constant_field", &grib_accessor_class_data_constant_field}, +#line 64 "accessor_class_list.gperf" + {"data_g1shsimple_packing", &grib_accessor_class_data_g1shsimple_packing}, + {""}, {""}, #line 55 "accessor_class_list.gperf" {"data_complex_packing", &grib_accessor_class_data_complex_packing}, +#line 52 "accessor_class_list.gperf" + {"data_apply_boustrophedonic_bitmap", &grib_accessor_class_data_apply_boustrophedonic_bitmap}, #line 122 "accessor_class_list.gperf" {"g2step_range", &grib_accessor_class_g2step_range}, -#line 65 "accessor_class_list.gperf" - {"data_g1simple_packing", &grib_accessor_class_data_g1simple_packing}, -#line 58 "accessor_class_list.gperf" - {"data_g1complex_packing", &grib_accessor_class_data_g1complex_packing}, -#line 193 "accessor_class_list.gperf" - {"select_step_template", &grib_accessor_class_select_step_template}, -#line 178 "accessor_class_list.gperf" - {"padto", &grib_accessor_class_padto}, -#line 57 "accessor_class_list.gperf" - {"data_dummy_field", &grib_accessor_class_data_dummy_field}, -#line 222 "accessor_class_list.gperf" + {""}, +#line 177 "accessor_class_list.gperf" + {"padding", &grib_accessor_class_padding}, + {""}, +#line 213 "accessor_class_list.gperf" + {"to_integer", &grib_accessor_class_to_integer}, +#line 71 "accessor_class_list.gperf" + {"data_g2simple_packing", &grib_accessor_class_data_g2simple_packing}, +#line 68 "accessor_class_list.gperf" + {"data_g2complex_packing", &grib_accessor_class_data_g2complex_packing}, +#line 97 "accessor_class_list.gperf" + {"g1date", &grib_accessor_class_g1date}, +#line 95 "accessor_class_list.gperf" + {"g1area", &grib_accessor_class_g1area}, +#line 96 "accessor_class_list.gperf" + {"g1bitmap", &grib_accessor_class_g1bitmap}, +#line 208 "accessor_class_list.gperf" + {"sum", &grib_accessor_class_sum}, +#line 223 "accessor_class_list.gperf" {"uint8", &grib_accessor_class_uint8}, -#line 93 "accessor_class_list.gperf" - {"g1_message_length", &grib_accessor_class_g1_message_length}, + {""}, +#line 219 "accessor_class_list.gperf" + {"uint32", &grib_accessor_class_uint32}, + {""}, #line 145 "accessor_class_list.gperf" {"julian_day", &grib_accessor_class_julian_day}, -#line 144 "accessor_class_list.gperf" - {"julian_date", &grib_accessor_class_julian_date}, -#line 218 "accessor_class_list.gperf" - {"uint32", &grib_accessor_class_uint32}, - {""}, {""}, {""}, -#line 148 "accessor_class_list.gperf" - {"laplacian", &grib_accessor_class_laplacian}, -#line 105 "accessor_class_list.gperf" - {"g1p1p2", &grib_accessor_class_g1p1p2}, #line 69 "accessor_class_list.gperf" {"data_g2secondary_bitmap", &grib_accessor_class_data_g2secondary_bitmap}, #line 67 "accessor_class_list.gperf" {"data_g2bifourier_packing", &grib_accessor_class_data_g2bifourier_packing}, -#line 115 "accessor_class_list.gperf" - {"g2date", &grib_accessor_class_g2date}, -#line 12 "accessor_class_list.gperf" - {"apply_operators", &grib_accessor_class_apply_operators}, -#line 113 "accessor_class_list.gperf" - {"g2bitmap", &grib_accessor_class_g2bitmap}, -#line 165 "accessor_class_list.gperf" - {"non_alpha", &grib_accessor_class_non_alpha}, +#line 111 "accessor_class_list.gperf" + {"g2_eps", &grib_accessor_class_g2_eps}, +#line 144 "accessor_class_list.gperf" + {"julian_date", &grib_accessor_class_julian_date}, +#line 57 "accessor_class_list.gperf" + {"data_dummy_field", &grib_accessor_class_data_dummy_field}, + {""}, +#line 93 "accessor_class_list.gperf" + {"g1_message_length", &grib_accessor_class_g1_message_length}, + {""}, +#line 72 "accessor_class_list.gperf" + {"data_g2simple_packing_with_preprocessing", &grib_accessor_class_data_g2simple_packing_with_preprocessing}, + {""}, +#line 102 "accessor_class_list.gperf" + {"g1monthlydate", &grib_accessor_class_g1monthlydate}, +#line 94 "accessor_class_list.gperf" + {"g1_section4_length", &grib_accessor_class_g1_section4_length}, +#line 206 "accessor_class_list.gperf" + {"step_human_readable", &grib_accessor_class_step_human_readable}, +#line 220 "accessor_class_list.gperf" + {"uint32_little_endian", &grib_accessor_class_uint32_little_endian}, + {""}, +#line 118 "accessor_class_list.gperf" + {"g2latlon", &grib_accessor_class_g2latlon}, {""}, {""}, +#line 109 "accessor_class_list.gperf" + {"g2_aerosol", &grib_accessor_class_g2_aerosol}, +#line 178 "accessor_class_list.gperf" + {"padto", &grib_accessor_class_padto}, #line 16 "accessor_class_list.gperf" {"bit", &grib_accessor_class_bit}, #line 18 "accessor_class_list.gperf" {"bits", &grib_accessor_class_bits}, - {""}, +#line 221 "accessor_class_list.gperf" + {"uint64", &grib_accessor_class_uint64}, #line 17 "accessor_class_list.gperf" {"bitmap", &grib_accessor_class_bitmap}, - {""}, -#line 197 "accessor_class_list.gperf" - {"simple_packing_error", &grib_accessor_class_simple_packing_error}, +#line 148 "accessor_class_list.gperf" + {"laplacian", &grib_accessor_class_laplacian}, +#line 149 "accessor_class_list.gperf" + {"latitudes", &grib_accessor_class_latitudes}, #line 107 "accessor_class_list.gperf" {"g1step_range", &grib_accessor_class_g1step_range}, -#line 36 "accessor_class_list.gperf" - {"bytes", &grib_accessor_class_bytes}, -#line 109 "accessor_class_list.gperf" - {"g2_aerosol", &grib_accessor_class_g2_aerosol}, -#line 125 "accessor_class_list.gperf" - {"gds_not_present_bitmap", &grib_accessor_class_gds_not_present_bitmap}, -#line 204 "accessor_class_list.gperf" - {"statistics", &grib_accessor_class_statistics}, -#line 19 "accessor_class_list.gperf" - {"bits_per_value", &grib_accessor_class_bits_per_value}, {""}, {""}, -#line 167 "accessor_class_list.gperf" - {"number_of_points", &grib_accessor_class_number_of_points}, -#line 225 "accessor_class_list.gperf" - {"unsigned", &grib_accessor_class_unsigned}, -#line 216 "accessor_class_list.gperf" - {"uint16", &grib_accessor_class_uint16}, -#line 143 "accessor_class_list.gperf" - {"iterator", &grib_accessor_class_iterator}, +#line 86 "accessor_class_list.gperf" + {"element", &grib_accessor_class_element}, {""}, -#line 205 "accessor_class_list.gperf" - {"statistics_spectral", &grib_accessor_class_statistics_spectral}, +#line 65 "accessor_class_list.gperf" + {"data_g1simple_packing", &grib_accessor_class_data_g1simple_packing}, +#line 58 "accessor_class_list.gperf" + {"data_g1complex_packing", &grib_accessor_class_data_g1complex_packing}, +#line 186 "accessor_class_list.gperf" + {"scale", &grib_accessor_class_scale}, +#line 19 "accessor_class_list.gperf" + {"bits_per_value", &grib_accessor_class_bits_per_value}, +#line 132 "accessor_class_list.gperf" + {"headers_only", &grib_accessor_class_headers_only}, +#line 77 "accessor_class_list.gperf" + {"data_sh_packed", &grib_accessor_class_data_sh_packed}, +#line 165 "accessor_class_list.gperf" + {"non_alpha", &grib_accessor_class_non_alpha}, +#line 222 "accessor_class_list.gperf" + {"uint64_little_endian", &grib_accessor_class_uint64_little_endian}, {""}, +#line 54 "accessor_class_list.gperf" + {"data_ccsds_packing", &grib_accessor_class_data_ccsds_packing}, #line 226 "accessor_class_list.gperf" - {"unsigned_bits", &grib_accessor_class_unsigned_bits}, + {"unsigned", &grib_accessor_class_unsigned}, #line 63 "accessor_class_list.gperf" {"data_g1secondary_bitmap", &grib_accessor_class_data_g1secondary_bitmap}, -#line 168 "accessor_class_list.gperf" - {"number_of_points_gaussian", &grib_accessor_class_number_of_points_gaussian}, -#line 97 "accessor_class_list.gperf" - {"g1date", &grib_accessor_class_g1date}, -#line 128 "accessor_class_list.gperf" - {"global_gaussian", &grib_accessor_class_global_gaussian}, -#line 96 "accessor_class_list.gperf" - {"g1bitmap", &grib_accessor_class_g1bitmap}, +#line 197 "accessor_class_list.gperf" + {"simple_packing_error", &grib_accessor_class_simple_packing_error}, +#line 105 "accessor_class_list.gperf" + {"g1p1p2", &grib_accessor_class_g1p1p2}, +#line 182 "accessor_class_list.gperf" + {"raw", &grib_accessor_class_raw}, +#line 83 "accessor_class_list.gperf" + {"dirty", &grib_accessor_class_dirty}, +#line 227 "accessor_class_list.gperf" + {"unsigned_bits", &grib_accessor_class_unsigned_bits}, {""}, {""}, {""}, -#line 194 "accessor_class_list.gperf" - {"sexagesimal2decimal", &grib_accessor_class_sexagesimal2decimal}, -#line 212 "accessor_class_list.gperf" - {"to_integer", &grib_accessor_class_to_integer}, +#line 15 "accessor_class_list.gperf" + {"assert", &grib_accessor_class_assert}, +#line 131 "accessor_class_list.gperf" + {"hash_array", &grib_accessor_class_hash_array}, {""}, -#line 223 "accessor_class_list.gperf" - {"unexpanded_descriptors", &grib_accessor_class_unexpanded_descriptors}, #line 61 "accessor_class_list.gperf" {"data_g1second_order_general_packing", &grib_accessor_class_data_g1second_order_general_packing}, - {""}, {""}, +#line 217 "accessor_class_list.gperf" + {"uint16", &grib_accessor_class_uint16}, + {""}, #line 62 "accessor_class_list.gperf" {"data_g1second_order_row_by_row_packing", &grib_accessor_class_data_g1second_order_row_by_row_packing}, {""}, -#line 221 "accessor_class_list.gperf" - {"uint64_little_endian", &grib_accessor_class_uint64_little_endian}, -#line 86 "accessor_class_list.gperf" - {"element", &grib_accessor_class_element}, +#line 215 "accessor_class_list.gperf" + {"transient", &grib_accessor_class_transient}, +#line 128 "accessor_class_list.gperf" + {"global_gaussian", &grib_accessor_class_global_gaussian}, #line 59 "accessor_class_list.gperf" {"data_g1second_order_constant_width_packing", &grib_accessor_class_data_g1second_order_constant_width_packing}, -#line 149 "accessor_class_list.gperf" - {"latitudes", &grib_accessor_class_latitudes}, +#line 230 "accessor_class_list.gperf" + {"values", &grib_accessor_class_values}, #line 60 "accessor_class_list.gperf" {"data_g1second_order_general_extended_packing", &grib_accessor_class_data_g1second_order_general_extended_packing}, - {""}, -#line 94 "accessor_class_list.gperf" - {"g1_section4_length", &grib_accessor_class_g1_section4_length}, -#line 166 "accessor_class_list.gperf" - {"number_of_coded_values", &grib_accessor_class_number_of_coded_values}, -#line 154 "accessor_class_list.gperf" - {"long", &grib_accessor_class_long}, - {""}, -#line 85 "accessor_class_list.gperf" - {"double", &grib_accessor_class_double}, -#line 160 "accessor_class_list.gperf" - {"md5", &grib_accessor_class_md5}, {""}, {""}, -#line 219 "accessor_class_list.gperf" - {"uint32_little_endian", &grib_accessor_class_uint32_little_endian}, -#line 161 "accessor_class_list.gperf" - {"message", &grib_accessor_class_message}, - {""}, +#line 216 "accessor_class_list.gperf" + {"transient_darray", &grib_accessor_class_transient_darray}, +#line 183 "accessor_class_list.gperf" + {"rdbtime_guess_date", &grib_accessor_class_rdbtime_guess_date}, +#line 228 "accessor_class_list.gperf" + {"validity_date", &grib_accessor_class_validity_date}, +#line 229 "accessor_class_list.gperf" + {"validity_time", &grib_accessor_class_validity_time}, +#line 194 "accessor_class_list.gperf" + {"sexagesimal2decimal", &grib_accessor_class_sexagesimal2decimal}, +#line 218 "accessor_class_list.gperf" + {"uint16_little_endian", &grib_accessor_class_uint16_little_endian}, + {""}, {""}, {""}, {""}, +#line 167 "accessor_class_list.gperf" + {"number_of_points", &grib_accessor_class_number_of_points}, + {""}, {""}, {""}, {""}, #line 112 "accessor_class_list.gperf" {"g2_mars_labeling", &grib_accessor_class_g2_mars_labeling}, -#line 158 "accessor_class_list.gperf" - {"mars_param", &grib_accessor_class_mars_param}, -#line 229 "accessor_class_list.gperf" - {"values", &grib_accessor_class_values}, -#line 118 "accessor_class_list.gperf" - {"g2latlon", &grib_accessor_class_g2latlon}, - {""}, -#line 43 "accessor_class_list.gperf" - {"concept", &grib_accessor_class_concept}, +#line 154 "accessor_class_list.gperf" + {"long", &grib_accessor_class_long}, #line 21 "accessor_class_list.gperf" {"box", &grib_accessor_class_box}, - {""}, {""}, {""}, +#line 85 "accessor_class_list.gperf" + {"double", &grib_accessor_class_double}, +#line 168 "accessor_class_list.gperf" + {"number_of_points_gaussian", &grib_accessor_class_number_of_points_gaussian}, #line 99 "accessor_class_list.gperf" {"g1end_of_interval_monthly", &grib_accessor_class_g1end_of_interval_monthly}, - {""}, {""}, + {""}, +#line 181 "accessor_class_list.gperf" + {"position", &grib_accessor_class_position}, +#line 37 "accessor_class_list.gperf" + {"change_scanning_direction", &grib_accessor_class_change_scanning_direction}, #line 84 "accessor_class_list.gperf" {"divdouble", &grib_accessor_class_divdouble}, +#line 123 "accessor_class_list.gperf" + {"gaussian_grid_name", &grib_accessor_class_gaussian_grid_name}, {""}, -#line 213 "accessor_class_list.gperf" - {"to_string", &grib_accessor_class_to_string}, - {""}, -#line 147 "accessor_class_list.gperf" - {"label", &grib_accessor_class_label}, +#line 224 "accessor_class_list.gperf" + {"unexpanded_descriptors", &grib_accessor_class_unexpanded_descriptors}, + {""}, {""}, {""}, {""}, +#line 43 "accessor_class_list.gperf" + {"concept", &grib_accessor_class_concept}, + {""}, {""}, {""}, {""}, +#line 193 "accessor_class_list.gperf" + {"select_step_template", &grib_accessor_class_select_step_template}, {""}, +#line 171 "accessor_class_list.gperf" + {"octahedral_gaussian", &grib_accessor_class_octahedral_gaussian}, +#line 114 "accessor_class_list.gperf" + {"g2bitmap_present", &grib_accessor_class_g2bitmap_present}, + {""}, {""}, {""}, #line 44 "accessor_class_list.gperf" {"constant", &grib_accessor_class_constant}, - {""}, {""}, +#line 185 "accessor_class_list.gperf" + {"round", &grib_accessor_class_round}, + {""}, {""}, {""}, {""}, {""}, {""}, #line 24 "accessor_class_list.gperf" {"bufr_data", &grib_accessor_class_bufr_data}, -#line 162 "accessor_class_list.gperf" - {"message_copy", &grib_accessor_class_message_copy}, +#line 22 "accessor_class_list.gperf" + {"budgdate", &grib_accessor_class_budgdate}, {""}, -#line 180 "accessor_class_list.gperf" - {"padtomultiple", &grib_accessor_class_padtomultiple}, +#line 202 "accessor_class_list.gperf" + {"spectral_truncation", &grib_accessor_class_spectral_truncation}, {""}, -#line 217 "accessor_class_list.gperf" - {"uint16_little_endian", &grib_accessor_class_uint16_little_endian}, +#line 146 "accessor_class_list.gperf" + {"ksec1expver", &grib_accessor_class_ksec1expver}, #line 25 "accessor_class_list.gperf" {"bufr_data_array", &grib_accessor_class_bufr_data_array}, -#line 163 "accessor_class_list.gperf" - {"missing", &grib_accessor_class_missing}, +#line 48 "accessor_class_list.gperf" + {"data_2order_packing", &grib_accessor_class_data_2order_packing}, +#line 232 "accessor_class_list.gperf" + {"vector", &grib_accessor_class_vector}, + {""}, {""}, #line 26 "accessor_class_list.gperf" {"bufr_data_element", &grib_accessor_class_bufr_data_element}, - {""}, -#line 20 "accessor_class_list.gperf" - {"blob", &grib_accessor_class_blob}, +#line 129 "accessor_class_list.gperf" + {"group", &grib_accessor_class_group}, +#line 49 "accessor_class_list.gperf" + {"data_2order_packing_count", &grib_accessor_class_data_2order_packing_count}, {""}, #line 33 "accessor_class_list.gperf" {"bufr_simple_thinning", &grib_accessor_class_bufr_simple_thinning}, -#line 182 "accessor_class_list.gperf" - {"raw", &grib_accessor_class_raw}, - {""}, -#line 133 "accessor_class_list.gperf" - {"ibmfloat", &grib_accessor_class_ibmfloat}, - {""}, -#line 15 "accessor_class_list.gperf" - {"assert", &grib_accessor_class_assert}, + {""}, {""}, #line 35 "accessor_class_list.gperf" {"bufrdc_expanded_descriptors", &grib_accessor_class_bufrdc_expanded_descriptors}, + {""}, +#line 147 "accessor_class_list.gperf" + {"label", &grib_accessor_class_label}, +#line 20 "accessor_class_list.gperf" + {"blob", &grib_accessor_class_blob}, #line 32 "accessor_class_list.gperf" {"bufr_has_delayed_replication", &grib_accessor_class_bufr_has_delayed_replication}, -#line 13 "accessor_class_list.gperf" - {"array", &grib_accessor_class_array}, -#line 181 "accessor_class_list.gperf" - {"position", &grib_accessor_class_position}, {""}, -#line 137 "accessor_class_list.gperf" - {"int16_little_endian", &grib_accessor_class_int16_little_endian}, - {""}, {""}, {""}, {""}, -#line 203 "accessor_class_list.gperf" - {"sprintf", &grib_accessor_class_sprintf}, -#line 183 "accessor_class_list.gperf" - {"rdbtime_guess_date", &grib_accessor_class_rdbtime_guess_date}, +#line 160 "accessor_class_list.gperf" + {"md5", &grib_accessor_class_md5}, {""}, +#line 133 "accessor_class_list.gperf" + {"ibmfloat", &grib_accessor_class_ibmfloat}, + {""}, {""}, {""}, {""}, +#line 158 "accessor_class_list.gperf" + {"mars_param", &grib_accessor_class_mars_param}, #line 159 "accessor_class_list.gperf" {"mars_step", &grib_accessor_class_mars_step}, -#line 141 "accessor_class_list.gperf" - {"int64_little_endian", &grib_accessor_class_int64_little_endian}, -#line 187 "accessor_class_list.gperf" - {"scale_values", &grib_accessor_class_scale_values}, - {""}, {""}, {""}, -#line 139 "accessor_class_list.gperf" - {"int32_little_endian", &grib_accessor_class_int32_little_endian}, - {""}, {""}, -#line 227 "accessor_class_list.gperf" - {"validity_date", &grib_accessor_class_validity_date}, -#line 228 "accessor_class_list.gperf" - {"validity_time", &grib_accessor_class_validity_time}, +#line 209 "accessor_class_list.gperf" + {"suppressed", &grib_accessor_class_suppressed}, +#line 161 "accessor_class_list.gperf" + {"message", &grib_accessor_class_message}, {""}, -#line 231 "accessor_class_list.gperf" - {"vector", &grib_accessor_class_vector}, -#line 157 "accessor_class_list.gperf" - {"lookup", &grib_accessor_class_lookup}, - {""}, {""}, {""}, {""}, -#line 156 "accessor_class_list.gperf" - {"longitudes", &grib_accessor_class_longitudes}, - {""}, {""}, -#line 22 "accessor_class_list.gperf" - {"budgdate", &grib_accessor_class_budgdate}, - {""}, {""}, {""}, {""}, +#line 166 "accessor_class_list.gperf" + {"number_of_coded_values", &grib_accessor_class_number_of_coded_values}, +#line 212 "accessor_class_list.gperf" + {"to_double", &grib_accessor_class_to_double}, + {""}, +#line 34 "accessor_class_list.gperf" + {"bufr_string_values", &grib_accessor_class_bufr_string_values}, #line 89 "accessor_class_list.gperf" {"forward", &grib_accessor_class_forward}, -#line 123 "accessor_class_list.gperf" - {"gaussian_grid_name", &grib_accessor_class_gaussian_grid_name}, - {""}, +#line 87 "accessor_class_list.gperf" + {"evaluate", &grib_accessor_class_evaluate}, +#line 199 "accessor_class_list.gperf" + {"smart_table", &grib_accessor_class_smart_table}, + {""}, {""}, {""}, #line 134 "accessor_class_list.gperf" {"ieeefloat", &grib_accessor_class_ieeefloat}, + {""}, +#line 203 "accessor_class_list.gperf" + {"sprintf", &grib_accessor_class_sprintf}, +#line 200 "accessor_class_list.gperf" + {"smart_table_column", &grib_accessor_class_smart_table_column}, #line 173 "accessor_class_list.gperf" {"offset_file", &grib_accessor_class_offset_file}, +#line 36 "accessor_class_list.gperf" + {"bytes", &grib_accessor_class_bytes}, +#line 92 "accessor_class_list.gperf" + {"g1_increment", &grib_accessor_class_g1_increment}, {""}, -#line 30 "accessor_class_list.gperf" - {"bufr_extract_subsets", &grib_accessor_class_bufr_extract_subsets}, -#line 129 "accessor_class_list.gperf" - {"group", &grib_accessor_class_group}, - {""}, -#line 179 "accessor_class_list.gperf" - {"padtoeven", &grib_accessor_class_padtoeven}, +#line 141 "accessor_class_list.gperf" + {"int64_little_endian", &grib_accessor_class_int64_little_endian}, {""}, -#line 28 "accessor_class_list.gperf" - {"bufr_extract_area_subsets", &grib_accessor_class_bufr_extract_area_subsets}, +#line 12 "accessor_class_list.gperf" + {"apply_operators", &grib_accessor_class_apply_operators}, +#line 180 "accessor_class_list.gperf" + {"padtomultiple", &grib_accessor_class_padtomultiple}, +#line 163 "accessor_class_list.gperf" + {"missing", &grib_accessor_class_missing}, +#line 157 "accessor_class_list.gperf" + {"lookup", &grib_accessor_class_lookup}, {""}, -#line 230 "accessor_class_list.gperf" - {"variable", &grib_accessor_class_variable}, -#line 232 "accessor_class_list.gperf" - {"when", &grib_accessor_class_when}, -#line 29 "accessor_class_list.gperf" - {"bufr_extract_datetime_subsets", &grib_accessor_class_bufr_extract_datetime_subsets}, -#line 214 "accessor_class_list.gperf" - {"transient", &grib_accessor_class_transient}, -#line 81 "accessor_class_list.gperf" - {"decimal_precision", &grib_accessor_class_decimal_precision}, -#line 146 "accessor_class_list.gperf" - {"ksec1expver", &grib_accessor_class_ksec1expver}, #line 169 "accessor_class_list.gperf" {"number_of_values", &grib_accessor_class_number_of_values}, +#line 231 "accessor_class_list.gperf" + {"variable", &grib_accessor_class_variable}, +#line 179 "accessor_class_list.gperf" + {"padtoeven", &grib_accessor_class_padtoeven}, +#line 156 "accessor_class_list.gperf" + {"longitudes", &grib_accessor_class_longitudes}, + {""}, {""}, +#line 139 "accessor_class_list.gperf" + {"int32_little_endian", &grib_accessor_class_int32_little_endian}, + {""}, {""}, {""}, {""}, {""}, {""}, +#line 13 "accessor_class_list.gperf" + {"array", &grib_accessor_class_array}, {""}, -#line 185 "accessor_class_list.gperf" - {"round", &grib_accessor_class_round}, +#line 137 "accessor_class_list.gperf" + {"int16_little_endian", &grib_accessor_class_int16_little_endian}, +#line 100 "accessor_class_list.gperf" + {"g1fcperiod", &grib_accessor_class_g1fcperiod}, +#line 170 "accessor_class_list.gperf" + {"number_of_values_data_raw_packing", &grib_accessor_class_number_of_values_data_raw_packing}, +#line 38 "accessor_class_list.gperf" + {"check_internal_version", &grib_accessor_class_check_internal_version}, +#line 91 "accessor_class_list.gperf" + {"g1_half_byte_codeflag", &grib_accessor_class_g1_half_byte_codeflag}, + {""}, {""}, +#line 187 "accessor_class_list.gperf" + {"scale_values", &grib_accessor_class_scale_values}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 215 "accessor_class_list.gperf" - {"transient_darray", &grib_accessor_class_transient_darray}, +#line 162 "accessor_class_list.gperf" + {"message_copy", &grib_accessor_class_message_copy}, {""}, -#line 153 "accessor_class_list.gperf" - {"local_definition", &grib_accessor_class_local_definition}, +#line 98 "accessor_class_list.gperf" + {"g1day_of_the_year_date", &grib_accessor_class_g1day_of_the_year_date}, + {""}, {""}, #line 175 "accessor_class_list.gperf" {"pack_bufr_values", &grib_accessor_class_pack_bufr_values}, - {""}, {""}, -#line 172 "accessor_class_list.gperf" - {"octect_number", &grib_accessor_class_octect_number}, -#line 199 "accessor_class_list.gperf" - {"smart_table", &grib_accessor_class_smart_table}, - {""}, #line 40 "accessor_class_list.gperf" {"codetable", &grib_accessor_class_codetable}, {""}, -#line 34 "accessor_class_list.gperf" - {"bufr_string_values", &grib_accessor_class_bufr_string_values}, -#line 48 "accessor_class_list.gperf" - {"data_2order_packing", &grib_accessor_class_data_2order_packing}, -#line 170 "accessor_class_list.gperf" - {"number_of_values_data_raw_packing", &grib_accessor_class_number_of_values_data_raw_packing}, -#line 200 "accessor_class_list.gperf" - {"smart_table_column", &grib_accessor_class_smart_table_column}, -#line 208 "accessor_class_list.gperf" - {"suppressed", &grib_accessor_class_suppressed}, -#line 23 "accessor_class_list.gperf" - {"bufr_clear_tables", &grib_accessor_class_bufr_clear_tables}, - {""}, -#line 49 "accessor_class_list.gperf" - {"data_2order_packing_count", &grib_accessor_class_data_2order_packing_count}, - {""}, {""}, {""}, -#line 78 "accessor_class_list.gperf" - {"data_sh_unpacked", &grib_accessor_class_data_sh_unpacked}, -#line 202 "accessor_class_list.gperf" - {"spectral_truncation", &grib_accessor_class_spectral_truncation}, -#line 39 "accessor_class_list.gperf" - {"codeflag", &grib_accessor_class_codeflag}, - {""}, -#line 211 "accessor_class_list.gperf" - {"to_double", &grib_accessor_class_to_double}, -#line 79 "accessor_class_list.gperf" - {"data_shsimple_packing", &grib_accessor_class_data_shsimple_packing}, -#line 87 "accessor_class_list.gperf" - {"evaluate", &grib_accessor_class_evaluate}, - {""}, {""}, -#line 27 "accessor_class_list.gperf" - {"bufr_elements_table", &grib_accessor_class_bufr_elements_table}, +#line 47 "accessor_class_list.gperf" + {"count_total", &grib_accessor_class_count_total}, + {""}, {""}, {""}, {""}, #line 119 "accessor_class_list.gperf" {"g2level", &grib_accessor_class_g2level}, -#line 100 "accessor_class_list.gperf" - {"g1fcperiod", &grib_accessor_class_g1fcperiod}, - {""}, {""}, {""}, {""}, {""}, -#line 152 "accessor_class_list.gperf" - {"library_version", &grib_accessor_class_library_version}, +#line 41 "accessor_class_list.gperf" + {"codetable_title", &grib_accessor_class_codetable_title}, +#line 153 "accessor_class_list.gperf" + {"local_definition", &grib_accessor_class_local_definition}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, +#line 155 "accessor_class_list.gperf" + {"long_vector", &grib_accessor_class_long_vector}, {""}, -#line 92 "accessor_class_list.gperf" - {"g1_increment", &grib_accessor_class_g1_increment}, -#line 114 "accessor_class_list.gperf" - {"g2bitmap_present", &grib_accessor_class_g2bitmap_present}, +#line 150 "accessor_class_list.gperf" + {"latlon_increment", &grib_accessor_class_latlon_increment}, {""}, {""}, {""}, -#line 77 "accessor_class_list.gperf" - {"data_sh_packed", &grib_accessor_class_data_sh_packed}, - {""}, -#line 47 "accessor_class_list.gperf" - {"count_total", &grib_accessor_class_count_total}, +#line 23 "accessor_class_list.gperf" + {"bufr_clear_tables", &grib_accessor_class_bufr_clear_tables}, {""}, {""}, {""}, {""}, {""}, -#line 91 "accessor_class_list.gperf" - {"g1_half_byte_codeflag", &grib_accessor_class_g1_half_byte_codeflag}, +#line 151 "accessor_class_list.gperf" + {"latlonvalues", &grib_accessor_class_latlonvalues}, + {""}, {""}, {""}, {""}, {""}, {""}, +#line 30 "accessor_class_list.gperf" + {"bufr_extract_subsets", &grib_accessor_class_bufr_extract_subsets}, {""}, #line 174 "accessor_class_list.gperf" {"offset_values", &grib_accessor_class_offset_values}, -#line 151 "accessor_class_list.gperf" - {"latlonvalues", &grib_accessor_class_latlonvalues}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 46 "accessor_class_list.gperf" - {"count_missing", &grib_accessor_class_count_missing}, +#line 27 "accessor_class_list.gperf" + {"bufr_elements_table", &grib_accessor_class_bufr_elements_table}, + {""}, +#line 28 "accessor_class_list.gperf" + {"bufr_extract_area_subsets", &grib_accessor_class_bufr_extract_area_subsets}, {""}, {""}, -#line 41 "accessor_class_list.gperf" - {"codetable_title", &grib_accessor_class_codetable_title}, +#line 31 "accessor_class_list.gperf" + {"bufr_group", &grib_accessor_class_bufr_group}, +#line 29 "accessor_class_list.gperf" + {"bufr_extract_datetime_subsets", &grib_accessor_class_bufr_extract_datetime_subsets}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 130 "accessor_class_list.gperf" - {"gts_header", &grib_accessor_class_gts_header}, + {""}, {""}, {""}, {""}, +#line 81 "accessor_class_list.gperf" + {"decimal_precision", &grib_accessor_class_decimal_precision}, + {""}, {""}, {""}, {""}, +#line 39 "accessor_class_list.gperf" + {"codeflag", &grib_accessor_class_codeflag}, + {""}, {""}, {""}, #line 45 "accessor_class_list.gperf" {"count_file", &grib_accessor_class_count_file}, -#line 224 "accessor_class_list.gperf" + {""}, {""}, {""}, +#line 225 "accessor_class_list.gperf" {"unpack_bufr_values", &grib_accessor_class_unpack_bufr_values}, {""}, {""}, {""}, {""}, -#line 102 "accessor_class_list.gperf" - {"g1monthlydate", &grib_accessor_class_g1monthlydate}, - {""}, -#line 132 "accessor_class_list.gperf" - {"headers_only", &grib_accessor_class_headers_only}, -#line 42 "accessor_class_list.gperf" - {"codetable_units", &grib_accessor_class_codetable_units}, - {""}, {""}, {""}, -#line 155 "accessor_class_list.gperf" - {"long_vector", &grib_accessor_class_long_vector}, - {""}, {""}, +#line 135 "accessor_class_list.gperf" + {"ifs_param", &grib_accessor_class_ifs_param}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, #line 11 "accessor_class_list.gperf" {"abstract_vector", &grib_accessor_class_abstract_vector}, + {""}, {""}, {""}, {""}, {""}, {""}, +#line 110 "accessor_class_list.gperf" + {"g2_chemical", &grib_accessor_class_g2_chemical}, {""}, -#line 150 "accessor_class_list.gperf" - {"latlon_increment", &grib_accessor_class_latlon_increment}, - {""}, -#line 37 "accessor_class_list.gperf" - {"change_scanning_direction", &grib_accessor_class_change_scanning_direction}, +#line 42 "accessor_class_list.gperf" + {"codetable_units", &grib_accessor_class_codetable_units}, + {""}, {""}, {""}, {""}, +#line 152 "accessor_class_list.gperf" + {"library_version", &grib_accessor_class_library_version}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, -#line 171 "accessor_class_list.gperf" - {"octahedral_gaussian", &grib_accessor_class_octahedral_gaussian}, - {""}, {""}, -#line 31 "accessor_class_list.gperf" - {"bufr_group", &grib_accessor_class_bufr_group}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, -#line 135 "accessor_class_list.gperf" - {"ifs_param", &grib_accessor_class_ifs_param}, + {""}, +#line 108 "accessor_class_list.gperf" + {"g1verificationdate", &grib_accessor_class_g1verificationdate}, + {""}, {""}, {""}, +#line 46 "accessor_class_list.gperf" + {"count_missing", &grib_accessor_class_count_missing}, +#line 172 "accessor_class_list.gperf" + {"octect_number", &grib_accessor_class_octect_number}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, -#line 98 "accessor_class_list.gperf" - {"g1day_of_the_year_date", &grib_accessor_class_g1day_of_the_year_date}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, #line 10 "accessor_class_list.gperf" {"abstract_long_vector", &grib_accessor_class_abstract_long_vector}, - {""}, + {""}, {""}, {""}, {""}, {""}, {""}, #line 106 "accessor_class_list.gperf" {"g1param", &grib_accessor_class_g1param}, {""}, {""}, {""}, -#line 104 "accessor_class_list.gperf" - {"g1number_of_coded_values_sh_simple", &grib_accessor_class_g1number_of_coded_values_sh_simple}, -#line 103 "accessor_class_list.gperf" - {"g1number_of_coded_values_sh_complex", &grib_accessor_class_g1number_of_coded_values_sh_complex}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 184 "accessor_class_list.gperf" + {"reference_value_error", &grib_accessor_class_reference_value_error}, + {""}, {""}, {""}, {""}, {""}, #line 90 "accessor_class_list.gperf" {"from_scale_factor_scaled_value", &grib_accessor_class_from_scale_factor_scaled_value}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, -#line 131 "accessor_class_list.gperf" - {"hash_array", &grib_accessor_class_hash_array}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 101 "accessor_class_list.gperf" - {"g1forecastmonth", &grib_accessor_class_g1forecastmonth}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 108 "accessor_class_list.gperf" - {"g1verificationdate", &grib_accessor_class_g1verificationdate}, - {""}, {""}, {""}, {""}, {""}, {""}, -#line 38 "accessor_class_list.gperf" - {"check_internal_version", &grib_accessor_class_check_internal_version}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, +#line 104 "accessor_class_list.gperf" + {"g1number_of_coded_values_sh_simple", &grib_accessor_class_g1number_of_coded_values_sh_simple}, +#line 103 "accessor_class_list.gperf" + {"g1number_of_coded_values_sh_complex", &grib_accessor_class_g1number_of_coded_values_sh_complex}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, -#line 110 "accessor_class_list.gperf" - {"g2_chemical", &grib_accessor_class_g2_chemical}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 184 "accessor_class_list.gperf" - {"reference_value_error", &grib_accessor_class_reference_value_error} + {""}, {""}, {""}, {""}, +#line 101 "accessor_class_list.gperf" + {"g1forecastmonth", &grib_accessor_class_g1forecastmonth} }; static const struct accessor_class_hash * diff --git a/src/grib_accessor_factory.h b/src/grib_accessor_factory.h index 7f8ba46e2..5321d603e 100644 --- a/src/grib_accessor_factory.h +++ b/src/grib_accessor_factory.h @@ -195,6 +195,7 @@ { "sprintf", &grib_accessor_class_sprintf, }, { "statistics", &grib_accessor_class_statistics, }, { "statistics_spectral", &grib_accessor_class_statistics_spectral, }, +{ "step_human_readable", &grib_accessor_class_step_human_readable, }, { "step_in_units", &grib_accessor_class_step_in_units, }, { "sum", &grib_accessor_class_sum, }, { "suppressed", &grib_accessor_class_suppressed, }, diff --git a/src/grib_accessor_factory_hash_list b/src/grib_accessor_factory_hash_list index 03234ba2a..eb4115b6a 100644 --- a/src/grib_accessor_factory_hash_list +++ b/src/grib_accessor_factory_hash_list @@ -196,6 +196,7 @@ spectral_truncation, &grib_accessor_class_spectral_truncation sprintf, &grib_accessor_class_sprintf statistics, &grib_accessor_class_statistics statistics_spectral, &grib_accessor_class_statistics_spectral +step_human_readable, &grib_accessor_class_step_human_readable step_in_units, &grib_accessor_class_step_in_units sum, &grib_accessor_class_sum suppressed, &grib_accessor_class_suppressed diff --git a/src/grib_api_prototypes.h b/src/grib_api_prototypes.h index 31c362d8c..66c569132 100644 --- a/src/grib_api_prototypes.h +++ b/src/grib_api_prototypes.h @@ -1462,6 +1462,7 @@ double grib_arguments_get_double(grib_handle* h, grib_arguments* args, int n); grib_expression* grib_arguments_get_expression(grib_handle* h, grib_arguments* args, int n); /* codes_util.c */ +double normalise_longitude_in_degrees(double lon); char get_dir_separator_char(void); int path_is_directory(const char* filename); char* codes_getenv(const char* name); diff --git a/src/grib_context.c b/src/grib_context.c index 217ccde8a..e5c4808b7 100644 --- a/src/grib_context.c +++ b/src/grib_context.c @@ -349,10 +349,10 @@ static grib_context default_grib_context = { 0, /* keys_count */ 0, /* concepts_index */ 0, /* concepts_count */ - {0,}, /* concepts */ - 0, /* hash_array_index */ - 0, /* hash_array_count */ - {0,}, /* hash_array */ + {0,}, /* concepts */ + 0, /* hash_array_index */ + 0, /* hash_array_count */ + {0,}, /* hash_array */ 0, /* def_files */ 0, /* blacklist */ 0, /* ieee_packing */ @@ -456,10 +456,9 @@ grib_context* grib_context_get_default() default_grib_context.grib_definition_files_path = codes_getenv("ECCODES_DEFINITION_PATH"); #ifdef ECCODES_DEFINITION_PATH if (!default_grib_context.grib_definition_files_path) { - default_grib_context.grib_definition_files_path = ECCODES_DEFINITION_PATH; + default_grib_context.grib_definition_files_path = strdup(ECCODES_DEFINITION_PATH); } else { - /* Temp bug fix when putenv() is called from program that moves getenv() stuff around */ default_grib_context.grib_definition_files_path = strdup(default_grib_context.grib_definition_files_path); } #endif @@ -471,16 +470,21 @@ grib_context* grib_context_get_default() const char* test_samp = codes_getenv("_ECCODES_ECMWF_TEST_SAMPLES_PATH"); if (test_defs) { char buffer[ECC_PATH_MAXLEN]; - strcpy(buffer, default_grib_context.grib_definition_files_path); - strcat(buffer, ":"); - strcat(buffer, strdup(test_defs)); + if (default_grib_context.grib_definition_files_path) { + strcpy(buffer, default_grib_context.grib_definition_files_path); + strcat(buffer, ":"); + } + strcat(buffer, test_defs); + free(default_grib_context.grib_definition_files_path); default_grib_context.grib_definition_files_path = strdup(buffer); } if (test_samp) { char buffer[ECC_PATH_MAXLEN]; - strcpy(buffer, default_grib_context.grib_samples_path); - strcat(buffer, ":"); - strcat(buffer, strdup(test_samp)); + if (default_grib_context.grib_samples_path) { + strcpy(buffer, default_grib_context.grib_samples_path); + strcat(buffer, ":"); + } + strcat(buffer, test_samp); default_grib_context.grib_samples_path = strdup(buffer); } } @@ -491,6 +495,7 @@ grib_context* grib_context_get_default() if (defs_extra) { char buffer[ECC_PATH_MAXLEN]; ecc_snprintf(buffer, ECC_PATH_MAXLEN, "%s%c%s", defs_extra, ECC_PATH_DELIMITER_CHAR, default_grib_context.grib_definition_files_path); + free(default_grib_context.grib_definition_files_path); default_grib_context.grib_definition_files_path = strdup(buffer); } } @@ -501,6 +506,7 @@ grib_context* grib_context_get_default() char buffer[ECC_PATH_MAXLEN]; ecc_snprintf(buffer, ECC_PATH_MAXLEN, "%s%c%s", default_grib_context.grib_definition_files_path, ECC_PATH_DELIMITER_CHAR, ECCODES_DEFINITION_PATH); + free(default_grib_context.grib_definition_files_path); default_grib_context.grib_definition_files_path = strdup(buffer); } } @@ -1011,6 +1017,7 @@ void grib_context_log(const grib_context* c, int level, const char* fmt, ...) else { char msg[1024]; va_list list; + const int errsv = errno; va_start(list, fmt); vsprintf(msg, fmt, list); @@ -1022,12 +1029,12 @@ void grib_context_log(const grib_context* c, int level, const char* fmt, ...) /* #if HAS_STRERROR */ #if 1 strcat(msg, " ("); - strcat(msg, strerror(errno)); + strcat(msg, strerror(errsv)); strcat(msg, ")"); #else - if (errno > 0 && errno < sys_nerr) { + if (errsv > 0 && errsv < sys_nerr) { strcat(msg, " ("); - strcat(msg, sys_errlist[errno]); + strcat(msg, sys_errlist[errsv]); strcat(msg, " )"); } #endif diff --git a/src/grib_dumper_class_bufr_decode_C.c b/src/grib_dumper_class_bufr_decode_C.c index 58bf34ee1..50fddce18 100644 --- a/src/grib_dumper_class_bufr_decode_C.c +++ b/src/grib_dumper_class_bufr_decode_C.c @@ -482,13 +482,13 @@ static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comment) { grib_dumper_bufr_decode_C* self = (grib_dumper_bufr_decode_C*)d; - char** values = NULL; - size_t size = 0; - grib_context* c = NULL; - int err = 0; - long count = 0; - int r = 0; - grib_handle* h = grib_handle_of_accessor(a); + char** values; + size_t size = 0, i = 0; + grib_context* c = NULL; + int err = 0; + long count = 0; + int r = 0; + grib_handle* h = grib_handle_of_accessor(a); c = a->context; @@ -542,6 +542,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm depth -= 2; } + for (i = 0; i < size; i++) grib_context_free(c, values[i]); grib_context_free(c, values); (void)err; /* TODO */ } @@ -574,8 +575,10 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) err = grib_unpack_string(a, value, &size); p = value; r = compute_bufr_key_rank(h, self->keys, a->name); - if (grib_is_missing_string(a, (unsigned char*)value, size)) + if (grib_is_missing_string(a, (unsigned char*)value, size)) { + grib_context_free(c, value); return; + } while (*p) { if (!isprint(*p)) diff --git a/src/grib_dumper_class_bufr_decode_filter.c b/src/grib_dumper_class_bufr_decode_filter.c index 1dcd76876..45831464d 100644 --- a/src/grib_dumper_class_bufr_decode_filter.c +++ b/src/grib_dumper_class_bufr_decode_filter.c @@ -491,8 +491,10 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) err = grib_unpack_string(a, value, &size); p = value; r = compute_bufr_key_rank(h, self->keys, a->name); - if (grib_is_missing_string(a, (unsigned char*)value, size)) + if (grib_is_missing_string(a, (unsigned char*)value, size)) { + grib_context_free(c, value); return; + } while (*p) { if (!isprint(*p)) diff --git a/src/grib_dumper_class_bufr_decode_fortran.c b/src/grib_dumper_class_bufr_decode_fortran.c index 70306d7ed..f62642d62 100644 --- a/src/grib_dumper_class_bufr_decode_fortran.c +++ b/src/grib_dumper_class_bufr_decode_fortran.c @@ -517,8 +517,10 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) err = grib_unpack_string(a, value, &size); p = value; r = compute_bufr_key_rank(h, self->keys, a->name); - if (grib_is_missing_string(a, (unsigned char*)value, size)) + if (grib_is_missing_string(a, (unsigned char*)value, size)) { + grib_context_free(c, value); return; + } while (*p) { if (!isprint(*p)) diff --git a/src/grib_dumper_class_bufr_decode_python.c b/src/grib_dumper_class_bufr_decode_python.c index 151b85a9f..d50c11a27 100644 --- a/src/grib_dumper_class_bufr_decode_python.c +++ b/src/grib_dumper_class_bufr_decode_python.c @@ -530,8 +530,10 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) err = grib_unpack_string(a, value, &size); p = value; r = compute_bufr_key_rank(h, self->keys, a->name); - if (grib_is_missing_string(a, (unsigned char*)value, size)) + if (grib_is_missing_string(a, (unsigned char*)value, size)) { + grib_context_free(c, value); return; + } while (*p) { if (!isprint(*p)) diff --git a/src/grib_dumper_class_bufr_encode_C.c b/src/grib_dumper_class_bufr_encode_C.c index 5576f140e..1f9d98bb1 100644 --- a/src/grib_dumper_class_bufr_encode_C.c +++ b/src/grib_dumper_class_bufr_encode_C.c @@ -345,6 +345,11 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* (void)err; /* TODO */ } +static int is_hidden(grib_accessor* a) +{ + return ( (a->flags & GRIB_ACCESSOR_FLAG_HIDDEN) != 0 ); +} + static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) { grib_dumper_bufr_encode_C* self = (grib_dumper_bufr_encode_C*)d; @@ -360,8 +365,12 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) grib_handle* h = grib_handle_of_accessor(a); int doing_unexpandedDescriptors = 0; - if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) - return; + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) { /* key does not have the dump attribute */ + int skip = 1; + /* See ECC-1107 */ + if (!is_hidden(a) && strcmp(a->name, "messageLength") == 0) skip = 0; + if (skip) return; + } doing_unexpandedDescriptors = (strcmp(a->name, "unexpandedDescriptors") == 0); grib_value_count(a, &count); @@ -665,6 +674,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm depth -= 2; } + for (i = 0; i < size; i++) grib_context_free(c, values[i]); grib_context_free(c, values); (void)err; /* TODO */ } diff --git a/src/grib_dumper_class_bufr_encode_fortran.c b/src/grib_dumper_class_bufr_encode_fortran.c index a3fcf5534..8e73cc01f 100644 --- a/src/grib_dumper_class_bufr_encode_fortran.c +++ b/src/grib_dumper_class_bufr_encode_fortran.c @@ -393,6 +393,11 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* (void)err; /* TODO */ } +static int is_hidden(grib_accessor* a) +{ + return ( (a->flags & GRIB_ACCESSOR_FLAG_HIDDEN) != 0 ); +} + static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) { grib_dumper_bufr_encode_fortran* self = (grib_dumper_bufr_encode_fortran*)d; @@ -408,8 +413,12 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) grib_handle* h = grib_handle_of_accessor(a); int doing_unexpandedDescriptors = 0; - if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) - return; + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) { /* key does not have the dump attribute */ + int skip = 1; + /* See ECC-1107 */ + if (!is_hidden(a) && strcmp(a->name, "messageLength") == 0) skip = 0; + if (skip) return; + } doing_unexpandedDescriptors = (strcmp(a->name, "unexpandedDescriptors") == 0); grib_value_count(a, &count); diff --git a/src/grib_dumper_class_bufr_encode_python.c b/src/grib_dumper_class_bufr_encode_python.c index 01ca57b54..23ee16d61 100644 --- a/src/grib_dumper_class_bufr_encode_python.c +++ b/src/grib_dumper_class_bufr_encode_python.c @@ -346,6 +346,11 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char* (void)err; /* TODO */ } +static int is_hidden(grib_accessor* a) +{ + return ( (a->flags & GRIB_ACCESSOR_FLAG_HIDDEN) != 0 ); +} + static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) { grib_dumper_bufr_encode_python* self = (grib_dumper_bufr_encode_python*)d; @@ -360,8 +365,12 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) grib_handle* h = grib_handle_of_accessor(a); int doing_unexpandedDescriptors = 0; - if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) - return; + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) { /* key does not have the dump attribute */ + int skip = 1; + /* See ECC-1107 */ + if (!is_hidden(a) && strcmp(a->name, "messageLength") == 0) skip = 0; + if (skip) return; + } doing_unexpandedDescriptors = (strcmp(a->name, "unexpandedDescriptors") == 0); grib_value_count(a, &count); diff --git a/src/grib_dumper_class_json.c b/src/grib_dumper_class_json.c index bd2dd0b97..5d2f525eb 100644 --- a/src/grib_dumper_class_json.c +++ b/src/grib_dumper_class_json.c @@ -294,10 +294,14 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) } if (icount > cols) fprintf(self->dumper.out, "\n%-*s", depth, " "); - if (doing_unexpandedDescriptors) + if (doing_unexpandedDescriptors) { fprintf(self->dumper.out, "%06ld ", values[i]); - else - fprintf(self->dumper.out, "%ld ", values[i]); + } else { + if (grib_is_missing_long(a, values[i])) + fprintf(self->dumper.out, "%s", "null"); + else + fprintf(self->dumper.out, "%ld ", values[i]); + } depth -= 2; fprintf(self->dumper.out, "\n%-*s]", depth, " "); diff --git a/src/grib_filepool.c b/src/grib_filepool.c index 02d9e940d..d9bbe5101 100644 --- a/src/grib_filepool.c +++ b/src/grib_filepool.c @@ -238,28 +238,24 @@ grib_file* grib_file_open(const char* filename, const char* mode, int* err) GRIB_MUTEX_LOCK(&mutex1); if (!same_mode && file->handle) { - /*printf("========== mode=%s file->mode=%s\n",mode,file->mode);*/ fclose(file->handle); } if (!file->handle) { - /*printf("-- opening file %s %s\n",file->name,mode);*/ if (!is_new && *mode == 'w') { - /* fprintf(stderr,"++++ opening %s as append\n",file->name); */ file->handle = fopen(file->name, "a"); } else { file->handle = fopen(file->name, mode); - /* fprintf(stderr,"++++ opening %s as mode\n",file->name); */ } - file->mode = strdup(mode); if (!file->handle) { grib_context_log(file->context, GRIB_LOG_PERROR, "grib_file_open: cannot open file %s", file->name); *err = GRIB_IO_PROBLEM; GRIB_MUTEX_UNLOCK(&mutex1); return NULL; } + file->mode = strdup(mode); if (file_pool.context->io_buffer_size) { #ifdef POSIX_MEMALIGN if (posix_memalign((void**)&(file->buffer), sysconf(_SC_PAGESIZE), file_pool.context->io_buffer_size)) { diff --git a/src/grib_handle.c b/src/grib_handle.c index 201262021..92b82cac4 100644 --- a/src/grib_handle.c +++ b/src/grib_handle.c @@ -168,6 +168,7 @@ int grib_handle_delete(grib_handle* h) grib_buffer_delete(ct, h->buffer); grib_section_delete(ct, h->root); + grib_context_free(ct, h->gts_header); grib_context_log(ct, GRIB_LOG_DEBUG, "grib_handle_delete: deleting handle %p", h); grib_context_free(ct, h); @@ -783,7 +784,6 @@ static grib_handle* grib_handle_new_from_file_multi(grib_context* c, FILE* f, in if (gts_header) memcpy(gl->gts_header, gts_header, gtslen); gl->gts_header_len = gtslen; grib_context_free(c, save_gts_header); - gtslen = 0; } else { gl->gts_header = NULL; diff --git a/src/grib_hash_keys.c b/src/grib_hash_keys.c index 35fc25d12..72f39e85c 100644 --- a/src/grib_hash_keys.c +++ b/src/grib_hash_keys.c @@ -34,7 +34,7 @@ error "gperf generated tables don't work with this execution character set. Plea struct grib_keys_hash { char* name; int id;}; #include -#define TOTAL_KEYWORDS 2361 +#define TOTAL_KEYWORDS 2362 #define MIN_WORD_LENGTH 1 #define MAX_WORD_LENGTH 74 #define MIN_HASH_VALUE 5 @@ -477,7 +477,7 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 16, 0, 0, 19, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 15, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 37, 0, 0, 0, 13, 0, 0, - 0, 0, 0, 0, 0, 21, 0, 0, 0, 22, 0, 0, 14, 0, + 0, 0, 0, 0, 0, 21, 0, 0, 0, 22, 0, 17, 14, 0, 0, 14, 0, 0, 0, 0, 0, 32, 0, 2, 0, 13, 0, 33, 0, 26, 23, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 15, 0, 24, 0, 0, 20, 0, 0, 20, 0, 0, 0, 0, 6, 0, @@ -2488,9 +2488,9 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {"n",1303}, {""}, - {"t",2101}, + {"t",2102}, {"nd",1312}, - {"td",2111}, + {"td",2112}, {"nt",1330}, {"nnn",1316}, {"na",1306}, @@ -2510,7 +2510,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {"name",1307}, {""}, {""}, {""}, - {"time",2137}, + {"time",2138}, {""}, {""}, {""}, {"one",1498}, {"Dstart",39}, @@ -2526,7 +2526,7 @@ static const struct grib_keys_hash wordlist[] = {"eps",758}, {"domain",693}, {""}, - {"stream",2074}, + {"stream",2075}, {""}, {""}, {""}, {"edition",711}, {"cat",379}, @@ -2557,11 +2557,11 @@ static const struct grib_keys_hash wordlist[] = {"const",564}, {""}, {""}, {"parameter",1612}, - {"true",2170}, + {"true",2171}, {"core",590}, {"second",1900}, {""}, {""}, - {"units",2230}, + {"units",2231}, {""}, {""}, {"rectime",1739}, {"parameters",1620}, @@ -2570,11 +2570,11 @@ static const struct grib_keys_hash wordlist[] = {""}, {"status",2063}, {"partitions",1625}, - {"timerepres",2150}, + {"timerepres",2151}, {"radius",1714}, {""}, {"isSens",1000}, - {"year",2353}, + {"year",2354}, {""}, {"dataTime",630}, {"direction",679}, @@ -2585,18 +2585,18 @@ static const struct grib_keys_hash wordlist[] = {"radials",1713}, {""}, {"leadtime",1076}, - {"type",2181}, + {"type",2182}, {"dataStream",628}, {"hdate",917}, {"instrument",971}, {"notDecoded",1329}, {""}, - {"system",2099}, - {"ucs",2223}, + {"system",2100}, + {"ucs",2224}, {""}, {""}, - {"stepZero",2073}, + {"stepZero",2074}, {""}, - {"three",2124}, + {"three",2125}, {"endStep",745}, {""}, {""}, {""}, {"process",1686}, @@ -2609,7 +2609,7 @@ static const struct grib_keys_hash wordlist[] = {"class",419}, {"phase",1639}, {""}, - {"uco",2222}, + {"uco",2223}, {"startStep",2056}, {"marsStep",1211}, {""}, {""}, {""}, {""}, {""}, @@ -2622,9 +2622,9 @@ static const struct grib_keys_hash wordlist[] = {"char",416}, {""}, {"operStream",1511}, - {"yFirst",2351}, + {"yFirst",2352}, {"latitude",1042}, - {"total",2152}, + {"total",2153}, {""}, {""}, {"product",1688}, {""}, {""}, {""}, @@ -2654,13 +2654,13 @@ static const struct grib_keys_hash wordlist[] = {""}, {"ieeeFloats",949}, {""}, - {"thousand",2123}, + {"thousand",2124}, {"endTimeStep",747}, {""}, {""}, {""}, {""}, {""}, {"marsType",1215}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"stepType",2069}, + {"stepType",2070}, {"grid",895}, {""}, {"month",1291}, @@ -2676,9 +2676,9 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {"partitionTable",1624}, {""}, - {"temperature",2113}, + {"temperature",2114}, {""}, {""}, {""}, - {"userDateStart",2252}, + {"userDateStart",2253}, {""}, {""}, {"dummyc",698}, {""}, {""}, @@ -2689,9 +2689,9 @@ static const struct grib_keys_hash wordlist[] = {"matchSort",1227}, {"reserved",1763}, {""}, - {"varno",2274}, + {"varno",2275}, {""}, - {"version",2279}, + {"version",2280}, {"indicatorOfParameter",959}, {""}, {"dataOrigin",622}, @@ -2703,7 +2703,7 @@ static const struct grib_keys_hash wordlist[] = {"marsQuantile",1208}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"unitsFactor",2236}, + {"unitsFactor",2237}, {""}, {""}, {""}, {""}, {"dataSelection",627}, {"channel",414}, @@ -2718,9 +2718,9 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {"refdate",1745}, {""}, {""}, {""}, {""}, {""}, - {"userTimeStart",2256}, + {"userTimeStart",2257}, {""}, - {"threshold",2125}, + {"threshold",2126}, {""}, {"signature",2006}, {""}, @@ -2741,13 +2741,13 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"isSatellite",998}, {""}, - {"typicalDate",2211}, + {"typicalDate",2212}, {""}, {""}, {""}, {""}, {""}, {""}, {"diagnostic",672}, {"file",837}, {""}, {""}, {""}, {""}, {""}, {""}, {"false",830}, - {"values",2262}, + {"values",2263}, {""}, {"countTotal",607}, {""}, @@ -2765,11 +2765,11 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {"laplacianOperator",1035}, {""}, - {"unitsDecimalScaleFactor",2234}, + {"unitsDecimalScaleFactor",2235}, {"dataKeys",620}, {"KS",97}, {"statisticalProcessesList",2061}, - {"typicalDay",2213}, + {"typicalDay",2214}, {"levtype",1097}, {"longitudes",1175}, {"localDateTime",1114}, @@ -2781,7 +2781,7 @@ static const struct grib_keys_hash wordlist[] = {"aerosolType",295}, {""}, {""}, {"platform",1644}, - {"typicalTime",2218}, + {"typicalTime",2219}, {""}, {""}, {""}, {""}, {""}, {""}, {"level",1092}, {""}, {""}, {""}, {""}, @@ -2792,7 +2792,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {"satelliteSeries",1843}, {"productType",1693}, - {"userDateTimeStart",2254}, + {"userDateTimeStart",2255}, {""}, {"coefsFirst",548}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -2800,12 +2800,12 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {"padding",1536}, {""}, {""}, {""}, - {"unitOfTime",2227}, + {"unitOfTime",2228}, {"band",324}, {""}, {""}, {""}, {""}, {"laplacianOperatorIsSet",1036}, {""}, {""}, {""}, - {"two",2179}, + {"two",2180}, {"ccsdsFlags",386}, {""}, {""}, {""}, {""}, {""}, {""}, {"parameterDiscipline",1615}, @@ -2832,7 +2832,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {"levelType",1094}, {""}, {""}, - {"windSpeed",2323}, + {"windSpeed",2324}, {""}, {"fcmonth",833}, {""}, {""}, {""}, @@ -2855,11 +2855,11 @@ static const struct grib_keys_hash wordlist[] = {""}, {"forecastTime",863}, {""}, {""}, - {"tubeDomain",2177}, + {"tubeDomain",2178}, {""}, {"Ni",194}, {""}, - {"validityTime",2261}, + {"validityTime",2262}, {"longitudeOfCentrePoint",1149}, {"Nr",196}, {""}, @@ -2872,7 +2872,7 @@ static const struct grib_keys_hash wordlist[] = {"optionalData",1516}, {""}, {""}, {""}, {""}, {"obstype",1458}, - {"windDirection",2312}, + {"windDirection",2313}, {""}, {""}, {""}, {""}, {"rdbtimeDate",1726}, {"angleDivisor",301}, @@ -2894,14 +2894,14 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {"rdbtimeDay",1727}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"verticalDomainTemplate",2289}, + {"verticalDomainTemplate",2290}, {""}, {"rdbDateTime",1721}, {""}, {""}, {""}, {""}, {""}, {""}, {"rdbtimeTime",1732}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"suiteName",2093}, + {"suiteName",2094}, {""}, {"parameterName",1617}, {"dimensionType",678}, @@ -2909,9 +2909,9 @@ static const struct grib_keys_hash wordlist[] = {"dateOfForecast",635}, {"NT",186}, {""}, {""}, - {"waveDomain",2302}, + {"waveDomain",2303}, {""}, {""}, {""}, {""}, - {"timeOfForecast",2144}, + {"timeOfForecast",2145}, {""}, {""}, {""}, {"modelName",1287}, {"coefsSecond",549}, @@ -2932,7 +2932,7 @@ static const struct grib_keys_hash wordlist[] = {"latitudeOfCentrePoint",1047}, {"shortName",2003}, {""}, {""}, {""}, {""}, - {"xFirst",2344}, + {"xFirst",2345}, {"ensembleSize",756}, {""}, {""}, {""}, {""}, {""}, {""}, {"marsStartStep",1210}, @@ -2948,11 +2948,11 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {"Ncy",192}, {""}, {""}, {""}, {""}, - {"yearOfForecast",2357}, + {"yearOfForecast",2358}, {""}, {"logTransform",1144}, {""}, {""}, {""}, {""}, - {"stepTypeForConversion",2070}, + {"stepTypeForConversion",2071}, {""}, {""}, {""}, {""}, {"Nuy",200}, {""}, {""}, {""}, {""}, @@ -2993,13 +2993,13 @@ static const struct grib_keys_hash wordlist[] = {""}, {"daLoop",614}, {""}, {""}, - {"yLast",2352}, + {"yLast",2353}, {""}, {""}, {""}, {""}, {"global",885}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"monthOfForecast",1294}, {""}, {""}, {""}, {""}, {""}, {""}, - {"subSetJ",2088}, + {"subSetJ",2089}, {""}, {""}, {"offsetDescriptors",1477}, {""}, @@ -3011,11 +3011,11 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {"originalSubCentreIdentifier",1525}, {""}, - {"validityDate",2260}, + {"validityDate",2261}, {""}, {""}, {""}, {""}, {"decimalScaleFactor",652}, {""}, - {"visibility",2293}, + {"visibility",2294}, {"energyNorm",752}, {""}, {""}, {"anoffsetFirst",308}, @@ -3024,7 +3024,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"Ly",151}, {""}, {""}, - {"upperLimit",2247}, + {"upperLimit",2248}, {""}, {""}, {""}, {""}, {"clearTables",421}, {""}, @@ -3036,7 +3036,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"clusterNumber",536}, {"expandedTypes",775}, - {"typeOfStatisticalPostProcessingOfEnsembleMembers",2205}, + {"typeOfStatisticalPostProcessingOfEnsembleMembers",2206}, {"latitudeOfCentrePointInDegrees",1048}, {"auxiliary",315}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -3059,7 +3059,7 @@ static const struct grib_keys_hash wordlist[] = {"integerScaleFactor",975}, {""}, {""}, {""}, {""}, {"boustrophedonic",369}, - {"truncateLaplacian",2173}, + {"truncateLaplacian",2174}, {""}, {""}, {""}, {""}, {"localDefinition",1119}, {""}, @@ -3078,7 +3078,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"numberOfDirections",1368}, {""}, {""}, {""}, - {"typeOfStatisticalProcessing",2206}, + {"typeOfStatisticalProcessing",2207}, {""}, {""}, {""}, {"indexingTime",958}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -3111,7 +3111,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {"Adelta",13}, {""}, {""}, {""}, {""}, {""}, {""}, - {"subSetK",2089}, + {"subSetK",2090}, {""}, {""}, {""}, {"modeNumber",1283}, {"observedData",1457}, @@ -3127,7 +3127,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {"generatingProcessIdentifier",880}, {""}, {""}, {""}, {""}, - {"topLevel",2151}, + {"topLevel",2152}, {""}, {""}, {""}, {"perturbedType",1638}, {""}, {""}, @@ -3160,13 +3160,13 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {"pressureLevel",1676}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"subcentreOfAnalysis",2091}, + {"subcentreOfAnalysis",2092}, {"crraSection",612}, {"rectimeSecond",1743}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"expoffset",781}, {""}, {""}, - {"totalNumber",2156}, + {"totalNumber",2157}, {""}, {""}, {""}, {"marsKeywords",1199}, {""}, {""}, {""}, {""}, {""}, @@ -3181,12 +3181,12 @@ static const struct grib_keys_hash wordlist[] = {"Dx",40}, {"listOfDistributionFunctionParameter",1108}, {""}, {""}, {""}, - {"typeOfDistributionFunction",2186}, + {"typeOfDistributionFunction",2187}, {""}, {""}, {""}, {"max",1231}, - {"zeros",2361}, + {"zeros",2362}, {""}, - {"zero",2360}, + {"zero",2361}, {""}, {"qfe",1701}, {""}, {""}, {""}, {""}, @@ -3202,12 +3202,12 @@ static const struct grib_keys_hash wordlist[] = {"lowerLimit",1178}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"defaultFaFieldName",653}, - {"stretchingFactor",2076}, + {"stretchingFactor",2077}, {"endOfInterval",741}, {"DyInDegrees",44}, {""}, {"numberOfFrequencies",1384}, - {"templatesLocalDir",2115}, + {"templatesLocalDir",2116}, {""}, {""}, {""}, {"meanSize",1254}, {""}, {""}, @@ -3215,7 +3215,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {"centreForLocal",399}, {""}, {""}, - {"systemNumber",2100}, + {"systemNumber",2101}, {"longitudeSexagesimal",1174}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"localSection",1136}, @@ -3226,7 +3226,7 @@ static const struct grib_keys_hash wordlist[] = {"methodNumber",1264}, {""}, {"groupSplitting",908}, - {"typicalSecond",2217}, + {"typicalSecond",2218}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"expandedNames",770}, @@ -3236,17 +3236,17 @@ static const struct grib_keys_hash wordlist[] = {"datumSize",643}, {""}, {"indexingDate",957}, - {"stretchingFactorScaled",2077}, + {"stretchingFactorScaled",2078}, {""}, {""}, {"longitudeOfCentrePointInDegrees",1150}, {""}, {""}, {""}, {""}, {""}, {""}, - {"timeDomainTemplate",2139}, + {"timeDomainTemplate",2140}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"partitionItems",1622}, {"climateDateTo",423}, {""}, {""}, {""}, {""}, - {"xLast",2345}, + {"xLast",2346}, {""}, {""}, {""}, {""}, {""}, {""}, {"Nb",190}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -3261,12 +3261,12 @@ static const struct grib_keys_hash wordlist[] = {""}, {"generatingProcessTemplateNumber",882}, {""}, {""}, - {"typeOfLevel",2195}, + {"typeOfLevel",2196}, {""}, {""}, {""}, {"bufrTemplate",374}, {"secondOrderFlags",1909}, - {"yDirectionGridLength",2348}, - {"stepRange",2067}, + {"yDirectionGridLength",2349}, + {"stepRange",2068}, {"referenceSampleInterval",1753}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"heightLevelName",919}, @@ -3274,7 +3274,7 @@ static const struct grib_keys_hash wordlist[] = {"createNewData",610}, {"offsetFreeFormData",1479}, {""}, {""}, {""}, {""}, - {"typicalDateTime",2212}, + {"typicalDateTime",2213}, {"conceptsLocalDirAll",557}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -3301,7 +3301,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {"correction1Part",597}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"upperRange",2248}, + {"upperRange",2249}, {""}, {""}, {""}, {"molarMass",1290}, {"productDefinition",1689}, @@ -3310,7 +3310,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {"bottomLevel",368}, {""}, {""}, - {"tiggeSection",2131}, + {"tiggeSection",2132}, {""}, {""}, {"isSatelliteType",999}, {""}, @@ -3321,7 +3321,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {"numberOfSection",1431}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"tubeNumber",2178}, + {"tubeNumber",2179}, {""}, {"numberOfForecastsInTube",1383}, {""}, @@ -3335,7 +3335,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {"rdbtimeSecond",1731}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"stepTypeInternal",2071}, + {"stepTypeInternal",2072}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"expandedDescriptors",769}, @@ -3345,7 +3345,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"levelIndicator",1093}, - {"tableNumber",2104}, + {"tableNumber",2105}, {"simpleThinningSkip",2010}, {"originatorLocalTemplate",1528}, {""}, {""}, @@ -3356,11 +3356,11 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"observablePropertyTemplateNumber",1453}, {""}, {""}, {""}, - {"streamOfAnalysis",2075}, + {"streamOfAnalysis",2076}, {"binaryScaleFactor",360}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"verificationDate",2275}, + {"verificationDate",2276}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"NAT",172}, {"oneMillionConstant",1500}, @@ -3368,13 +3368,13 @@ static const struct grib_keys_hash wordlist[] = {"marsLevelist",1204}, {"memberNumber",1260}, {""}, - {"widthOfFirstOrderValues",2308}, + {"widthOfFirstOrderValues",2309}, {""}, {""}, {""}, {""}, {""}, {""}, {"endOfRange",744}, {""}, {""}, {""}, {""}, {""}, {"FirstLatitude",68}, {""}, {""}, - {"verticalDomainTemplateNumber",2290}, + {"verticalDomainTemplateNumber",2291}, {""}, {""}, {"ensembleForecastNumbers",754}, {"baseAddress",325}, @@ -3395,7 +3395,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {"partitionNumber",1623}, {""}, - {"theMessage",2118}, + {"theMessage",2119}, {"clusterMember9",535}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"addressOfFileFreeSpaceInfo",294}, @@ -3408,11 +3408,11 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {"optimizeScaleFactor",1515}, {""}, - {"thisMarsStream",2121}, + {"thisMarsStream",2122}, {"instrumentType",973}, {"localMinute",1132}, {""}, {""}, {""}, {""}, {""}, {""}, - {"thisMarsType",2122}, + {"thisMarsType",2123}, {"numberOfIterations",1392}, {""}, {""}, {"secondDimensionPhysicalSignificance",1903}, @@ -3460,7 +3460,7 @@ static const struct grib_keys_hash wordlist[] = {"marsParam",1207}, {"SPD",222}, {""}, - {"userDateTimeEnd",2253}, + {"userDateTimeEnd",2254}, {"operatingMode",1512}, {""}, {"radialAngularSpacing",1712}, @@ -3469,14 +3469,14 @@ static const struct grib_keys_hash wordlist[] = {""}, {"epsPoint",760}, {""}, - {"userDateEnd",2251}, + {"userDateEnd",2252}, {""}, {""}, {""}, {""}, {""}, {"firstLatitude",842}, {"biFourierTruncationType",359}, {""}, {""}, {""}, {""}, {""}, {"horizontalCoordinateDefinition",923}, {"secondLatitude",1904}, - {"unitOfOffsetFromReferenceTime",2226}, + {"unitOfOffsetFromReferenceTime",2227}, {""}, {""}, {""}, {""}, {"lowerRange",1179}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -3490,7 +3490,7 @@ static const struct grib_keys_hash wordlist[] = {"spectralDataRepresentationMode",2044}, {"minuteOfReference",1273}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"unitsOfFirstFixedSurface",2237}, + {"unitsOfFirstFixedSurface",2238}, {""}, {"faLevelName",828}, {""}, {""}, @@ -3498,40 +3498,40 @@ static const struct grib_keys_hash wordlist[] = {""}, {"iDirectionIncrement",937}, {"SecondLatitude",223}, - {"userTimeEnd",2255}, + {"userTimeEnd",2256}, {""}, {"numberOfDistinctSection9s",1375}, {""}, {"roundedMarsLevelist",1784}, {"scaleFactorOfFirstSize",1851}, - {"tiggeModel",2130}, + {"tiggeModel",2131}, {"dateOfReference",639}, {""}, {""}, {""}, {""}, {""}, {""}, {"siteElevation",2012}, {""}, - {"timeOfReference",2146}, + {"timeOfReference",2147}, {""}, - {"timeIncrement",2141}, + {"timeIncrement",2142}, {"clusterMember8",534}, {"scanningMode",1892}, {""}, {""}, - {"unitsOfSecondFixedSurface",2238}, + {"unitsOfSecondFixedSurface",2239}, {""}, {""}, {""}, {""}, {"monthOfAnalysis",1292}, {""}, {"representationMode",1760}, {""}, {""}, {""}, {"classOfAnalysis",420}, - {"xDirectionGridLength",2341}, + {"xDirectionGridLength",2342}, {""}, {""}, {""}, {""}, {"spectralDataRepresentationType",2045}, {""}, - {"unsignedIntegers",2244}, + {"unsignedIntegers",2245}, {""}, - {"treatmentOfMissingData",2169}, + {"treatmentOfMissingData",2170}, {"Lx",149}, {""}, {""}, {""}, {""}, {""}, - {"timeDomainTemplateNumber",2140}, + {"timeDomainTemplateNumber",2141}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"defaultFaLevelName",654}, {""}, @@ -3545,7 +3545,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {"identificationNumber",945}, {""}, - {"yearOfReference",2359}, + {"yearOfReference",2360}, {""}, {"Lcx",118}, {"NL",182}, @@ -3582,9 +3582,9 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"dateOfAnalysis",634}, {""}, {""}, {""}, - {"tablesMasterDir",2107}, + {"tablesMasterDir",2108}, {""}, {""}, {""}, {""}, - {"timeOfAnalysis",2143}, + {"timeOfAnalysis",2144}, {""}, {"biFourierMakeTemplate",352}, {""}, {""}, @@ -3594,7 +3594,7 @@ static const struct grib_keys_hash wordlist[] = {"productDefinitionTemplateNumber",1690}, {""}, {"corr2Data",592}, - {"tileIndex",2136}, + {"tileIndex",2137}, {""}, {"hourOfReference",933}, {"numberOfAnalysis",1338}, @@ -3619,7 +3619,7 @@ static const struct grib_keys_hash wordlist[] = {"scaleFactorOfSecondSize",1861}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"yearOfAnalysis",2354}, + {"yearOfAnalysis",2355}, {""}, {""}, {""}, {"productDefinitionTemplateNumberInternal",1691}, {""}, @@ -3630,7 +3630,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {"eastLongitudeOfCluster",706}, {""}, - {"typeOfAnalysis",2182}, + {"typeOfAnalysis",2183}, {""}, {""}, {""}, {"inputDelayedDescriptorReplicationFactor",965}, {"angleOfRotation",303}, @@ -3639,9 +3639,9 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {"iScansNegatively",942}, {""}, - {"typeOfEnsembleForecast",2187}, + {"typeOfEnsembleForecast",2188}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"temperatureAndDewpointPresent",2114}, + {"temperatureAndDewpointPresent",2115}, {""}, {""}, {""}, {""}, {""}, {""}, {"DiInMetres",34}, {""}, {""}, @@ -3669,7 +3669,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {"hourOfAnalysis",929}, {""}, - {"unitOfTimeIncrement",2228}, + {"unitOfTimeIncrement",2229}, {""}, {"charValues",417}, {"normAtFinalTime",1317}, @@ -3681,7 +3681,7 @@ static const struct grib_keys_hash wordlist[] = {"gridDefinitionTemplateNumber",900}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"typeOfTimeIncrement",2207}, + {"typeOfTimeIncrement",2208}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -3698,7 +3698,7 @@ static const struct grib_keys_hash wordlist[] = {"latitudeWhereDxAndDyAreSpecified",1070}, {"defaultParameter",657}, {""}, {""}, {""}, {""}, - {"truncateDegrees",2172}, + {"truncateDegrees",2173}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"sp3",2037}, {"latitudeWhereDxAndDyAreSpecifiedInDegrees",1071}, @@ -3716,7 +3716,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {"codedValues",547}, {""}, {""}, - {"versionNumOfFilesFreeSpaceStorage",2280}, + {"versionNumOfFilesFreeSpaceStorage",2281}, {""}, {""}, {""}, {""}, {""}, {"applicationIdentifier",311}, {""}, {""}, @@ -3811,24 +3811,24 @@ static const struct grib_keys_hash wordlist[] = {"numberOfDistributionFunctionParameters",1376}, {"localHour",1125}, {""}, - {"tablesVersion",2108}, + {"tablesVersion",2109}, {""}, - {"westLongitudeOfCluster",2304}, + {"westLongitudeOfCluster",2305}, {""}, {"bitmapSectionPresent",364}, {""}, {""}, {""}, {""}, {""}, {"secondsOfAnalysis",1920}, - {"typeOfIntervalForFirstAndSecondSize",2193}, + {"typeOfIntervalForFirstAndSecondSize",2194}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"biFourierSubTruncationType",358}, {""}, {"section4",1944}, {""}, {""}, {""}, - {"typeOfSecondFixedSurface",2203}, + {"typeOfSecondFixedSurface",2204}, {""}, {""}, {"groupLeafNodeK",906}, {""}, {""}, - {"stringValues",2078}, + {"stringValues",2079}, {""}, {"averagingPeriod",319}, {""}, {""}, {""}, @@ -3847,17 +3847,17 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {"groupSplittingMethodUsed",909}, {"floatValues",854}, - {"typicalMinute",2215}, + {"typicalMinute",2216}, {""}, - {"typicalHour",2214}, + {"typicalHour",2215}, {""}, - {"widthOfSPD",2310}, + {"widthOfSPD",2311}, {""}, {""}, {"directionScalingFactor",682}, {""}, {""}, {""}, {""}, {"constantFieldHalfByte",566}, {"secondsOfReference",1921}, - {"windPresent",2322}, + {"windPresent",2323}, {""}, {""}, {""}, {"defaultFaModelName",655}, {""}, {""}, @@ -3867,7 +3867,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {"numberOfDataMatrices",1362}, {""}, - {"typeOfIntervalForFirstAndSecondWavelength",2194}, + {"typeOfIntervalForFirstAndSecondWavelength",2195}, {""}, {"julianForecastDay",1026}, {""}, {""}, @@ -3879,7 +3879,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {"aerosolbinnumber",296}, {""}, {""}, {""}, {""}, {""}, {""}, - {"totalNumberOfdimensions",2168}, + {"totalNumberOfdimensions",2169}, {""}, {""}, {"CDFstr",23}, {""}, @@ -3894,9 +3894,9 @@ static const struct grib_keys_hash wordlist[] = {"CDF",22}, {""}, {""}, {""}, {""}, {""}, {"lengthOfProjectLocalTemplate",1088}, - {"thresholdIndicator",2126}, + {"thresholdIndicator",2127}, {""}, {""}, - {"totalNumberOfDirections",2159}, + {"totalNumberOfDirections",2160}, {""}, {"meaningOfVerticalCoordinate",1259}, {""}, {""}, {""}, @@ -3911,22 +3911,22 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {"probabilityTypeName",1685}, {""}, - {"yDirectionGridLengthInMetres",2349}, + {"yDirectionGridLengthInMetres",2350}, {""}, {""}, - {"typeOfFirstFixedSurface",2189}, - {"typeOfHorizontalLine",2192}, + {"typeOfFirstFixedSurface",2190}, + {"typeOfHorizontalLine",2193}, {""}, {""}, {""}, {"orientationOfTheGrid",1520}, {""}, {""}, {""}, {"centuryOfReference",402}, {""}, {""}, {"indicatorOfTypeOfLevel",960}, - {"totalNumberOfTubes",2166}, + {"totalNumberOfTubes",2167}, {"laplacianScalingFactor",1037}, {""}, {""}, {"startingAzimuth",2059}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"versionNumberOfGribLocalTables",2284}, + {"versionNumberOfGribLocalTables",2285}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"dewPointTemperature",671}, {""}, {""}, {""}, {""}, {""}, @@ -3938,7 +3938,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"DxInMetres",42}, {""}, {""}, {""}, - {"totalNumberOfFrequencies",2161}, + {"totalNumberOfFrequencies",2162}, {""}, {""}, {""}, {""}, {""}, {""}, {"cfVarName",406}, {""}, {""}, {""}, {""}, @@ -3960,12 +3960,12 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {"numberOfModeOfDistribution",1400}, {""}, {""}, - {"yDirectionGridLengthInMillimetres",2350}, + {"yDirectionGridLengthInMillimetres",2351}, {"NR",184}, {""}, {""}, {""}, {""}, {"longitudeOfStretchingPole",1165}, {"projectionCentreFlag",1698}, - {"unitsBias",2231}, + {"unitsBias",2232}, {""}, {""}, {""}, {""}, {"rdbtimeMinute",1729}, {""}, @@ -4021,13 +4021,13 @@ static const struct grib_keys_hash wordlist[] = {"azimuthalWidth",321}, {"primaryBitmap",1678}, {""}, {""}, {""}, - {"tileClassification",2135}, + {"tileClassification",2136}, {""}, {"additionalFlagPresent",293}, {""}, {""}, {"orientationOfTheGridInDegrees",1521}, {""}, - {"typeOfPostProcessing",2199}, + {"typeOfPostProcessing",2200}, {""}, {""}, {"AA",6}, {""}, {""}, {""}, @@ -4050,26 +4050,26 @@ static const struct grib_keys_hash wordlist[] = {""}, {"shapeOfTheEarth",2001}, {""}, - {"windSpeedTrend3",2326}, - {"windDirectionTrend3",2315}, + {"windSpeedTrend3",2327}, + {"windDirectionTrend3",2316}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"tsectionNumber3",2174}, + {"tsectionNumber3",2175}, {""}, {""}, {"offsetSection3",1488}, {"isectionNumber3",1012}, {""}, {""}, {""}, {"extendedFlag",783}, {""}, - {"typeOfAuxiliaryInformation",2183}, + {"typeOfAuxiliaryInformation",2184}, {""}, {""}, {""}, - {"verticalCoordinate",2287}, + {"verticalCoordinate",2288}, {""}, {""}, {""}, {""}, {""}, {""}, {"simpleThinningMissingRadius",2009}, {"section0Pointer",1924}, {""}, {""}, {""}, {""}, {"short_name",2005}, {""}, - {"windVariableDirection",2333}, + {"windVariableDirection",2334}, {"frequencyNumber",869}, {""}, {""}, {""}, {"correction4Part",603}, @@ -4082,18 +4082,18 @@ static const struct grib_keys_hash wordlist[] = {""}, {"numberOfPartitions",1408}, {"oneConstant",1499}, - {"tableReference",2105}, + {"tableReference",2106}, {""}, {""}, {"complexPacking",551}, {""}, {""}, - {"verticalCoordinateDefinition",2288}, + {"verticalCoordinateDefinition",2289}, {""}, {"numberOfOctectsForNumberOfPoints",1402}, {"LoR",126}, {""}, {""}, {""}, {""}, {"section_09",1980}, {""}, - {"targetCompressionRatio",2110}, + {"targetCompressionRatio",2111}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"centuryOfReferenceTimeOfData",403}, {""}, {""}, @@ -4111,14 +4111,14 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {"interpretationOfNumberOfPoints",981}, {""}, {""}, {""}, {""}, {""}, - {"tiggeCentre",2127}, - {"subCentre",2079}, + {"tiggeCentre",2128}, + {"subCentre",2080}, {""}, {""}, {""}, {"grib1divider",887}, {""}, {""}, {""}, {"lengthOfHeaders",1084}, {""}, {""}, {""}, {""}, - {"tableCode",2103}, + {"tableCode",2104}, {"angleOfRotationInDegrees",304}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"easternLongitudeOfDomain",709}, @@ -4136,7 +4136,7 @@ static const struct grib_keys_hash wordlist[] = {"cnmc_cmcc",541}, {"local_use",1143}, {""}, - {"verticalVisibility",2291}, + {"verticalVisibility",2292}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"is_efas",1005}, @@ -4151,12 +4151,12 @@ static const struct grib_keys_hash wordlist[] = {"centralLongitude",394}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"legBaseTime",1078}, - {"windSpeedTrend4",2327}, - {"windDirectionTrend4",2316}, + {"windSpeedTrend4",2328}, + {"windDirectionTrend4",2317}, {""}, {""}, {""}, {""}, {""}, {"reservedNeedNotBePresent",1767}, - {"totalNumberOfTileAttributePairs",2165}, - {"tsectionNumber4",2175}, + {"totalNumberOfTileAttributePairs",2166}, + {"tsectionNumber4",2176}, {"LcyInMetres",121}, {""}, {"offsetSection4",1489}, @@ -4168,13 +4168,13 @@ static const struct grib_keys_hash wordlist[] = {""}, {"gts_header",915}, {""}, - {"typeOfCompressionUsed",2185}, + {"typeOfCompressionUsed",2186}, {""}, {"modelVersionTime",1289}, {""}, {""}, {""}, {"LuyInMetres",148}, {""}, {""}, - {"totalNumberOfForecastProbabilities",2160}, + {"totalNumberOfForecastProbabilities",2161}, {""}, {""}, {"section_8",1990}, {""}, {""}, @@ -4185,7 +4185,7 @@ static const struct grib_keys_hash wordlist[] = {"halfByte",916}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"xDirectionGridLengthInMetres",2342}, + {"xDirectionGridLengthInMetres",2343}, {""}, {""}, {""}, {""}, {""}, {""}, {"decimalPrecision",651}, {""}, {""}, @@ -4195,8 +4195,8 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {"numberOfVerticalPoints",1449}, {""}, - {"subSetM",2090}, - {"verifyingMonth",2278}, + {"subSetM",2091}, + {"verifyingMonth",2279}, {""}, {""}, {""}, {""}, {""}, {""}, {"bufrHeaderCentre",372}, {""}, {""}, @@ -4217,7 +4217,7 @@ static const struct grib_keys_hash wordlist[] = {"scaleFactorOfSecondWavelength",1862}, {""}, {""}, {""}, {"modelErrorType",1285}, - {"tigge_name",2133}, + {"tigge_name",2134}, {""}, {""}, {""}, {"numberOfVerticalCoordinateValues",1447}, {"scaleFactorAtReferencePoint",1844}, @@ -4229,7 +4229,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {"bitmapPresent",363}, {""}, {""}, {""}, {""}, - {"stepInHours",2066}, + {"stepInHours",2067}, {""}, {"numberOfVerticalGridDescriptors",1448}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -4239,7 +4239,7 @@ static const struct grib_keys_hash wordlist[] = {"numberOfValues",1446}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"consensusCount",563}, - {"xDirectionGridLengthInMillimetres",2343}, + {"xDirectionGridLengthInMillimetres",2344}, {""}, {"md5Data",1233}, {"scaleFactorOfRadiusOfSphericalEarth",1859}, @@ -4247,7 +4247,7 @@ static const struct grib_keys_hash wordlist[] = {"scaleFactorOfFirstWavelength",1852}, {""}, {""}, {""}, {"predefined_grid_values",1655}, - {"verificationMonth",2276}, + {"verificationMonth",2277}, {"kurt",1031}, {""}, {""}, {""}, {""}, {""}, {""}, {"doExtractArea",689}, @@ -4291,9 +4291,9 @@ static const struct grib_keys_hash wordlist[] = {"keySat",1029}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"updateSequenceNumber",2246}, + {"updateSequenceNumber",2247}, {""}, {""}, {""}, - {"totalNumberOfIterations",2163}, + {"totalNumberOfIterations",2164}, {""}, {"setCalendarId",1996}, {"epsContinous",759}, @@ -4301,7 +4301,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"matrixOfValues",1230}, - {"typeOfSizeInterval",2204}, + {"typeOfSizeInterval",2205}, {""}, {"conceptsMasterMarsDir",561}, {""}, {""}, {""}, {""}, @@ -4313,14 +4313,14 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {"LxInMetres",150}, {""}, {""}, {""}, {""}, {""}, - {"typeOfEnsembleMember",2188}, + {"typeOfEnsembleMember",2189}, {""}, {""}, {""}, - {"westernLongitudeOfDomain",2307}, + {"westernLongitudeOfDomain",2308}, {"numberOfForecastsInEnsemble",1381}, {"flagForAnyFurtherInformation",848}, {""}, {""}, {""}, {"numberOfChars",1349}, - {"trueLengthOfLastGroup",2171}, + {"trueLengthOfLastGroup",2172}, {""}, {"expandBy",763}, {"correction3",600}, @@ -4340,7 +4340,7 @@ static const struct grib_keys_hash wordlist[] = {"localNumberOfObservations",1134}, {"coordinate3Flag",580}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"versionNumberOfExperimentalSuite",2283}, + {"versionNumberOfExperimentalSuite",2284}, {""}, {""}, {""}, {""}, {""}, {"presentTrend3",1659}, {"centralClusterDefinition",393}, @@ -4392,11 +4392,11 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {"isCorrection",991}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"tablesVersionLatest",2109}, + {"tablesVersionLatest",2110}, {""}, {""}, - {"upperThreshold",2249}, + {"upperThreshold",2250}, {""}, {""}, - {"stepRangeInHours",2068}, + {"stepRangeInHours",2069}, {""}, {"rangeBinSpacing",1720}, {""}, {""}, {""}, {""}, {""}, @@ -4420,7 +4420,7 @@ static const struct grib_keys_hash wordlist[] = {"extractDateTimeMinuteEnd",802}, {""}, {""}, {""}, {"LcxInMetres",119}, - {"totalInitialConditions",2154}, + {"totalInitialConditions",2155}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"md5Structure",1248}, {""}, {""}, {""}, @@ -4440,16 +4440,16 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {"presentTrend4",1660}, {""}, {""}, {""}, - {"yearOfCentury",2355}, + {"yearOfCentury",2356}, {""}, {""}, {"coordAveraging0",569}, {"param_value_min",1611}, {""}, {"extractDateTimeMonthStart",807}, {""}, - {"timeRangeIndicator",2147}, + {"timeRangeIndicator",2148}, {""}, {""}, - {"timeCoordinateDefinition",2138}, + {"timeCoordinateDefinition",2139}, {""}, {""}, {""}, {""}, {""}, {"flagForIrregularGridCoordinateList",849}, {"cloudsTitle3",515}, @@ -4459,8 +4459,8 @@ static const struct grib_keys_hash wordlist[] = {"section3Padding",1941}, {"referenceReflectivityForEchoTop",1752}, {""}, - {"totalNumberOfRepetitions",2164}, - {"unknown",2239}, + {"totalNumberOfRepetitions",2165}, + {"unknown",2240}, {""}, {"operationalForecastCluster",1513}, {""}, @@ -4484,7 +4484,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {"packingType",1535}, {"earthMajorAxis",702}, - {"typeOfOriginalFieldValues",2197}, + {"typeOfOriginalFieldValues",2198}, {"gridCoordinate",896}, {""}, {""}, {"extractDateTimeSecondEnd",808}, @@ -4528,7 +4528,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {"endMinuteTrend3",733}, {""}, {""}, {""}, - {"timeRangeIndicatorFromStepRange",2148}, + {"timeRangeIndicatorFromStepRange",2149}, {"cloudsTitle1Trend4",509}, {""}, {""}, {""}, {""}, {""}, {""}, {"clusterMember3",529}, @@ -4545,7 +4545,7 @@ static const struct grib_keys_hash wordlist[] = {"numberOfDataPoints",1363}, {""}, {""}, {""}, {"numberOfLogicals",1394}, - {"typicalCentury",2210}, + {"typicalCentury",2211}, {""}, {""}, {""}, {""}, {""}, {""}, {"sp2",2036}, {""}, {""}, {""}, {""}, @@ -4584,7 +4584,8 @@ static const struct grib_keys_hash wordlist[] = {"biFourierCoefficients",351}, {""}, {""}, {""}, {"epsStatisticsContinous",761}, - {""}, {""}, + {""}, + {"stepHumanReadable",2066}, {"section9Length",1965}, {""}, {""}, {"lowerThreshold",1180}, @@ -4600,7 +4601,7 @@ static const struct grib_keys_hash wordlist[] = {"numberOfForecastsInCluster",1380}, {"scaledValueOfSecondSize",1885}, {""}, {""}, {""}, {""}, - {"widthOfLengths",2309}, + {"widthOfLengths",2310}, {""}, {""}, {""}, {""}, {""}, {"section3Pointer",1942}, {""}, @@ -4628,7 +4629,7 @@ static const struct grib_keys_hash wordlist[] = {"extractDateTimeEnd",798}, {"section0Length",1923}, {""}, {""}, {""}, - {"tiggeLAMName",2128}, + {"tiggeLAMName",2129}, {"coordinate4Flag",583}, {""}, {""}, {"Lo1InDegrees",124}, @@ -4665,19 +4666,19 @@ static const struct grib_keys_hash wordlist[] = {"reserved2",1765}, {"correction4",602}, {""}, - {"windVariableDirectionTrend3",2336}, + {"windVariableDirectionTrend3",2337}, {""}, {"longitudeOfFirstDiamondCenterLine",1151}, {""}, {"longitudeOfFirstDiamondCentreLine",1152}, - {"twoOrdersOfSPD",2180}, + {"twoOrdersOfSPD",2181}, {""}, {""}, {""}, {"section10Pointer",1927}, {""}, {""}, {""}, {""}, {"latitudeOfNorthWestCornerOfArea",1054}, {"longitudeOfFirstDiamondCentreLineInDegrees",1153}, {""}, {""}, {""}, {""}, {""}, - {"typeOfCalendar",2184}, + {"typeOfCalendar",2185}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"DjInMetres",38}, @@ -4700,7 +4701,7 @@ static const struct grib_keys_hash wordlist[] = {"monthlyVerificationMonth",1298}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"windVariableDirectionTrend4",2337}, + {"windVariableDirectionTrend4",2338}, {""}, {""}, {""}, {"latitudeLongitudeValues",1045}, {""}, {""}, {""}, {""}, @@ -4717,21 +4718,21 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {"g1conceptsMasterDir",874}, {""}, {""}, {""}, {""}, {""}, {""}, - {"swapScanningLat",2095}, + {"swapScanningLat",2096}, {""}, {""}, {""}, {""}, {"sectionLengthLimitForEnsembles",1968}, {""}, {""}, {""}, {""}, - {"unitsConversionOffset",2232}, - {"tigge_short_name",2134}, - {"thisMarsClass",2120}, + {"unitsConversionOffset",2233}, + {"tigge_short_name",2135}, + {"thisMarsClass",2121}, {""}, {""}, - {"swapScanningLon",2096}, + {"swapScanningLon",2097}, {""}, {""}, {""}, {"boot_edition",367}, {""}, {"inputProcessIdentifier",969}, {""}, - {"versionNumOfRootGroupSymbolTableEntry",2281}, + {"versionNumOfRootGroupSymbolTableEntry",2282}, {""}, {"reservedSection3",1770}, {""}, @@ -4755,11 +4756,11 @@ static const struct grib_keys_hash wordlist[] = {"marsType1",1216}, {"latitudeOfSouthernPole",1058}, {""}, {""}, {""}, - {"stepUnits",2072}, + {"stepUnits",2073}, {""}, {""}, {"scaleFactorOfLowerLimit",1855}, {""}, {""}, {""}, - {"yearOfEndOfOverallTimeInterval",2356}, + {"yearOfEndOfOverallTimeInterval",2357}, {""}, {""}, {""}, {""}, {"numberOfComponents",1357}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -4770,7 +4771,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {"matchAerosolBinNumber",1224}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"totalLength",2155}, + {"totalLength",2156}, {""}, {""}, {""}, {""}, {"numberOfClusters",1352}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -4791,7 +4792,7 @@ static const struct grib_keys_hash wordlist[] = {"N2",171}, {"latitudeOfTangencyPoint",1064}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"totalNumberOfDataValuesMissingInStatisticalProcess",2158}, + {"totalNumberOfDataValuesMissingInStatisticalProcess",2159}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"hourOfEndOfOverallTimeInterval",930}, {""}, @@ -4799,7 +4800,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {"secondaryMissingValueSubstitute",1919}, {""}, {""}, - {"table2Version",2102}, + {"table2Version",2103}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"X2",264}, @@ -4809,7 +4810,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {"section6",1953}, {""}, {""}, {""}, - {"totalAerosolBinsNumbers",2153}, + {"totalAerosolBinsNumbers",2154}, {"fileConsistencyFlags",838}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"SOH",221}, @@ -4844,7 +4845,7 @@ static const struct grib_keys_hash wordlist[] = {"localExtensionPadding",1122}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"typeOfPreProcessing",2200}, + {"typeOfPreProcessing",2201}, {"Nj",195}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -4856,8 +4857,8 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {"beginMinuteTrend4",342}, {""}, - {"windSpeedTrend2",2325}, - {"windDirectionTrend2",2314}, + {"windSpeedTrend2",2326}, + {"windDirectionTrend2",2315}, {""}, {""}, {""}, {""}, {""}, {"coordinate2Flag",578}, {""}, {""}, {""}, @@ -4879,7 +4880,7 @@ static const struct grib_keys_hash wordlist[] = {"Lor2",143}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"swapScanningX",2097}, + {"swapScanningX",2098}, {""}, {""}, {""}, {"masterTablesVersionNumberLatest",1223}, {""}, {""}, {""}, {""}, {""}, @@ -4897,14 +4898,14 @@ static const struct grib_keys_hash wordlist[] = {"groupLengths",907}, {"section1Padding",1932}, {""}, {""}, - {"versionOfModelClimate",2286}, + {"versionOfModelClimate",2287}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"secondaryBitMap",1912}, {""}, {""}, {"numberOfPackedValues",1405}, {"sectionLengthLimitForProbability",1969}, {""}, - {"windUnits",2328}, + {"windUnits",2329}, {""}, {"X1",262}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -4926,7 +4927,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {"lengthOf4DvarWindow",1083}, {""}, {""}, - {"subDefinitions2",2081}, + {"subDefinitions2",2082}, {"longitudeOfSubSatellitePointInDegrees",1168}, {"cloudsTitle1Trend1",506}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -4963,7 +4964,7 @@ static const struct grib_keys_hash wordlist[] = {"spaceUnitFlag",2038}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"typeOfGrid",2191}, + {"typeOfGrid",2192}, {""}, {""}, {""}, {""}, {""}, {"biFourierResolutionParameterN",355}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -4971,8 +4972,8 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {"bitsPerValue",365}, {""}, - {"windSpeedTrend1",2324}, - {"windDirectionTrend1",2313}, + {"windSpeedTrend1",2325}, + {"windDirectionTrend1",2314}, {"cloudsTitle3Trend4",519}, {""}, {""}, {""}, {""}, {""}, {"scaleFactorOfLengthOfSemiMinorAxis",1854}, @@ -4994,7 +4995,7 @@ static const struct grib_keys_hash wordlist[] = {"INBITS",90}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"Lor1",141}, - {"unitOfTimeRange",2229}, + {"unitOfTimeRange",2230}, {""}, {""}, {""}, {""}, {""}, {""}, {"parametersVersion",1621}, {""}, @@ -5002,7 +5003,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {"NUT",187}, {""}, {""}, - {"thisExperimentVersionNumber",2119}, + {"thisExperimentVersionNumber",2120}, {""}, {""}, {""}, {"param_value_max",1610}, {""}, @@ -5010,7 +5011,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"preProcessingParameter",1651}, {""}, {""}, - {"windGust",2317}, + {"windGust",2318}, {"default_min_val",663}, {""}, {""}, {""}, {""}, {""}, {""}, {"NH",179}, @@ -5023,7 +5024,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {"biFourierResolutionSubSetParameterN",357}, {""}, {""}, {""}, {""}, - {"windVariableDirectionTrend2",2335}, + {"windVariableDirectionTrend2",2336}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"northWestLongitudeOfLPOArea",1324}, @@ -5032,9 +5033,9 @@ static const struct grib_keys_hash wordlist[] = {""}, {"section1Pointer",1933}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"typicalYear",2219}, + {"typicalYear",2220}, {""}, {""}, {""}, {""}, {""}, - {"subDefinitions1",2080}, + {"subDefinitions1",2081}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"percentileValue",1634}, @@ -5042,7 +5043,7 @@ static const struct grib_keys_hash wordlist[] = {"rootGroupObjectHeaderAddress",1780}, {"endMonthTrend4",738}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"unpackedError",2241}, + {"unpackedError",2242}, {""}, {""}, {""}, {""}, {""}, {"extractAreaNorthLatitude",792}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -5064,18 +5065,18 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {"southEastLatitudeOfLPOArea",2026}, {""}, {""}, {""}, {""}, {""}, - {"variationOfVisibility",2263}, + {"variationOfVisibility",2264}, {""}, {""}, {""}, {""}, - {"windVariableDirectionTrend1",2334}, + {"windVariableDirectionTrend1",2335}, {""}, {""}, - {"variationOfVisibilityDirection",2264}, + {"variationOfVisibilityDirection",2265}, {""}, {""}, {""}, {"accuracyMultipliedByFactor",290}, {""}, {""}, {""}, {""}, {""}, - {"variationOfVisibilityDirectionAngle",2265}, + {"variationOfVisibilityDirectionAngle",2266}, {"section6Pointer",1955}, {""}, {""}, {""}, {""}, {""}, {""}, - {"yCoordinateOfOriginOfSectorImage",2346}, + {"yCoordinateOfOriginOfSectorImage",2347}, {""}, {"offsetSection6",1491}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -5086,7 +5087,7 @@ static const struct grib_keys_hash wordlist[] = {"latitudeOfSouthernPoleInDegrees",1059}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"firstDimensionCoordinateValueDefinition",840}, - {"timeIncrementBetweenSuccessiveFields",2142}, + {"timeIncrementBetweenSuccessiveFields",2143}, {""}, {""}, {"numberOfBytesOfFreeFormatData",1345}, {""}, {""}, @@ -5095,7 +5096,7 @@ static const struct grib_keys_hash wordlist[] = {"recentWeatherTry",1738}, {""}, {""}, {"runwayFrictionCoefficientState3",1832}, - {"visibilityInKilometresTrend3",2296}, + {"visibilityInKilometresTrend3",2297}, {"numberOfBytesInLocalDefinition",1344}, {""}, {"rootTablesDir",1782}, @@ -5109,7 +5110,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {"numberOfDistinctSection5s",1371}, {""}, {""}, {""}, - {"unitsConversionScaleFactor",2233}, + {"unitsConversionScaleFactor",2234}, {""}, {""}, {""}, {"presentTrend2",1658}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -5122,7 +5123,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {"formatVersionMinorNumber",866}, {""}, {""}, {""}, {""}, {""}, {""}, - {"visibilityTrend1",2298}, + {"visibilityTrend1",2299}, {""}, {""}, {""}, {"jScansPositively",1024}, {"section4Length",1945}, @@ -5132,7 +5133,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {"rdbtimeYear",1733}, {""}, {""}, {""}, - {"visibilityTrend3",2300}, + {"visibilityTrend3",2301}, {""}, {""}, {""}, {"coordinateFlag1",586}, {""}, @@ -5151,7 +5152,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {"numberOfDaysInClimateSamplingWindow",1366}, {""}, {""}, - {"typeOfSSTFieldUsed",2202}, + {"typeOfSSTFieldUsed",2203}, {""}, {""}, {""}, {""}, {""}, {"MonthOfModelVersion",168}, {""}, {""}, {""}, @@ -5164,13 +5165,13 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {"southPoleOnProjectionPlane",2032}, {"marsKeywords1",1200}, - {"typicalMonth",2216}, + {"typicalMonth",2217}, {""}, {""}, {"listOfParametersUsedForClustering",1111}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"totalNumberOfValuesInUnpackedSubset",2167}, + {"totalNumberOfValuesInUnpackedSubset",2168}, {""}, {""}, - {"visibilityInKilometresTrend4",2297}, + {"visibilityInKilometresTrend4",2298}, {""}, {""}, {"cloudsTitle4Trend3",523}, {"cloudsBaseCoded1Trend3",468}, @@ -5184,7 +5185,7 @@ static const struct grib_keys_hash wordlist[] = {"is_ocean2d_param",1006}, {"firstOrderValues",846}, {""}, - {"typeOfWavelengthInterval",2209}, + {"typeOfWavelengthInterval",2210}, {"qnhUnits",1707}, {""}, {""}, {""}, {"section_4",1986}, @@ -5207,7 +5208,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {"secondOrderValuesDifferentWidths",1911}, {""}, - {"subLocalDefinition2",2083}, + {"subLocalDefinition2",2084}, {""}, {""}, {"expandedUnits",776}, {""}, @@ -5220,7 +5221,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {"offsetFromReferenceOfFirstTime",1481}, {""}, - {"unexpandedDescriptors",2224}, + {"unexpandedDescriptors",2225}, {""}, {""}, {""}, {""}, {""}, {""}, {"scaleFactorOfMajorAxisOfOblateSpheroidEarth",1856}, {"cloudsTitle4Trend4",524}, @@ -5244,14 +5245,14 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {"numberOfClusterLowResolution",1351}, {""}, - {"unexpandedDescriptorsEncoded",2225}, + {"unexpandedDescriptorsEncoded",2226}, {""}, {""}, {""}, {""}, {""}, {""}, {"section9UniqueIdentifier",1967}, {""}, {"southEastLongitudeOfLPOArea",2028}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"grib2LocalSectionPresent",889}, - {"widthOfWidths",2311}, + {"widthOfWidths",2312}, {""}, {""}, {""}, {""}, {""}, {"earthMajorAxisInMetres",703}, {""}, {""}, {""}, {""}, {""}, @@ -5265,15 +5266,15 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"clusterMember2",528}, - {"upperThresholdValue",2250}, + {"upperThresholdValue",2251}, {"forecastOrSingularVectorNumber",857}, {""}, {""}, {"numberOfCodedValues",1353}, {""}, {""}, {""}, {""}, {""}, {"rdbtimeMonth",1730}, {""}, {""}, - {"wrongPadding",2338}, - {"unpackedSubsetPrecision",2242}, + {"wrongPadding",2339}, + {"unpackedSubsetPrecision",2243}, {""}, {""}, {"md5Headers",1236}, {""}, @@ -5289,7 +5290,7 @@ static const struct grib_keys_hash wordlist[] = {"Latin2InDegrees",117}, {""}, {""}, {""}, {"alternativeRowScanning",298}, - {"unitsECMF",2235}, + {"unitsECMF",2236}, {""}, {"experimentVersionNumber",777}, {""}, {""}, @@ -5306,11 +5307,11 @@ static const struct grib_keys_hash wordlist[] = {"runwayDesignatorState2",1811}, {"section7",1957}, {"endDayTrend2",721}, - {"verticalVisibilityCoded",2292}, + {"verticalVisibilityCoded",2293}, {""}, {""}, {""}, {""}, {""}, {"section8UniqueIdentifier",1964}, {""}, {""}, {""}, {""}, {""}, - {"typeOfTimeIncrementBetweenSuccessiveFieldsUsedInTheStatisticalProcessing",2208}, + {"typeOfTimeIncrementBetweenSuccessiveFieldsUsedInTheStatisticalProcessing",2209}, {""}, {""}, {"numberOfStepsUsedForClustering",1434}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -5322,7 +5323,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {"gaussianGridName",876}, {""}, - {"xCoordinateOfOriginOfSectorImage",2339}, + {"xCoordinateOfOriginOfSectorImage",2340}, {""}, {""}, {"P2",208}, {"latitudeOfSubSatellitePoint",1062}, @@ -5332,7 +5333,7 @@ static const struct grib_keys_hash wordlist[] = {"md5Section6",1244}, {"intervalBetweenTimes",982}, {""}, - {"subLocalDefinition1",2082}, + {"subLocalDefinition1",2083}, {""}, {"packedValues",1533}, {"numberOfUsedTileAttributes",1442}, @@ -5362,7 +5363,7 @@ static const struct grib_keys_hash wordlist[] = {"Latin1InDegrees",115}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"tiggeSuiteID",2132}, + {"tiggeSuiteID",2133}, {""}, {""}, {"beginDayTrend2",332}, {""}, @@ -5391,11 +5392,11 @@ static const struct grib_keys_hash wordlist[] = {"cloudsAbbreviation4Trend3",443}, {""}, {""}, {""}, {""}, {"endMinuteTrend1",731}, - {"totalNumberOfClusters",2157}, + {"totalNumberOfClusters",2158}, {""}, - {"versionNumOfSharedHeaderMessageFormat",2282}, + {"versionNumOfSharedHeaderMessageFormat",2283}, {""}, {""}, {""}, {""}, - {"tablesLocalDir",2106}, + {"tablesLocalDir",2107}, {"numberInMixedCoordinateDefinition",1333}, {""}, {"endGridDefinition",725}, @@ -5437,7 +5438,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {"localLatitude1",1127}, {""}, - {"visibilityTrend4",2301}, + {"visibilityTrend4",2302}, {""}, {""}, {""}, {""}, {"P1",207}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -5453,13 +5454,13 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {"integerPointValues",974}, {""}, {""}, - {"subdivisionsOfBasicAngle",2092}, + {"subdivisionsOfBasicAngle",2093}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"section2Length",1934}, {"Ensemble_Identifier",52}, {""}, {""}, {""}, {""}, {""}, - {"unpackedValues",2243}, + {"unpackedValues",2244}, {""}, {""}, {"listMembersUsed3",1105}, {""}, @@ -5481,7 +5482,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {"numberOfSingularVectorsEvolved",1433}, {""}, {""}, - {"subLocalDefinitionNumber2",2087}, + {"subLocalDefinitionNumber2",2088}, {""}, {"numberOfPointsAlongAParallel",1411}, {""}, @@ -5519,10 +5520,10 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {"cavokOrVisibility",382}, {""}, {""}, {""}, - {"westernLongitudeOfClusterDomain",2306}, - {"yCoordinateOfSubSatellitePoint",2347}, + {"westernLongitudeOfClusterDomain",2307}, + {"yCoordinateOfSubSatellitePoint",2348}, {""}, {""}, - {"tiggeLocalVersion",2129}, + {"tiggeLocalVersion",2130}, {""}, {"cloudsCode3",495}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -5543,13 +5544,13 @@ static const struct grib_keys_hash wordlist[] = {"baseTimeOfThisLeg",329}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"listMembersMissing3",1101}, - {"templatesMasterDir",2116}, + {"templatesMasterDir",2117}, {""}, {""}, {"section11Pointer",1929}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"cloudsAbbreviation2",430}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"variationOfVisibilityTrend3",2272}, + {"variationOfVisibilityTrend3",2273}, {""}, {"cloudsTitle4Trend2",522}, {"cloudsBaseCoded1Trend2",467}, @@ -5578,12 +5579,12 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {"offsetICEFieldsUsed",1482}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"variationOfVisibilityDirectionTrend3",2268}, + {"variationOfVisibilityDirectionTrend3",2269}, {""}, {"reservedSection2",1769}, {""}, {""}, {""}, {""}, {"cloudsBase3",455}, - {"subLocalDefinitionLength2",2085}, + {"subLocalDefinitionLength2",2086}, {""}, {""}, {"scaleFactorOfEarthMajorAxis",1848}, {""}, {""}, @@ -5593,12 +5594,12 @@ static const struct grib_keys_hash wordlist[] = {"offsetSection7",1492}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"subLocalDefinitionNumber1",2086}, - {"variationOfVisibilityTrend4",2273}, + {"subLocalDefinitionNumber1",2087}, + {"variationOfVisibilityTrend4",2274}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"verificationYear",2277}, + {"verificationYear",2278}, {""}, {""}, {""}, {"cloudsBaseCoded1",465}, {"patch_precip_fp",1630}, @@ -5623,7 +5624,7 @@ static const struct grib_keys_hash wordlist[] = {"GDSPresent",69}, {"countOfICEFieldsUsed",606}, {""}, {""}, {""}, {""}, {""}, {""}, - {"variationOfVisibilityDirectionTrend4",2269}, + {"variationOfVisibilityDirectionTrend4",2270}, {"cloudsBaseCoded3Trend3",478}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"resolutionAndComponentFlags3",1775}, @@ -5670,17 +5671,17 @@ static const struct grib_keys_hash wordlist[] = {""}, {"dateOfModelVersion",638}, {""}, - {"theHindcastMarsStream",2117}, + {"theHindcastMarsStream",2118}, {""}, {""}, {""}, {"runwayDepthOfDepositCodeState3",1800}, {""}, {""}, - {"timeOfModelVersion",2145}, + {"timeOfModelVersion",2146}, {""}, {""}, {""}, {""}, {""}, {""}, {"cloudsCode1Trend4",489}, {""}, {""}, {""}, {"endMonthTrend2",736}, {""}, {""}, - {"subLocalDefinitionLength1",2084}, + {"subLocalDefinitionLength1",2085}, {""}, {"scaleFactorOfCentralWaveNumber",1845}, {""}, {""}, {""}, {""}, {""}, @@ -5703,7 +5704,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {"offsetFromOriginToInnerBound",1480}, {""}, - {"yearOfModelVersion",2358}, + {"yearOfModelVersion",2359}, {""}, {""}, {""}, {"localUsePresent",1140}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -5728,7 +5729,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {"section2Used",1938}, {""}, - {"xCoordinateOfSubSatellitePoint",2340}, + {"xCoordinateOfSubSatellitePoint",2341}, {"section3UniqueIdentifier",1943}, {""}, {""}, {"listMembersUsed4",1106}, @@ -5748,9 +5749,9 @@ static const struct grib_keys_hash wordlist[] = {"cloudsAbbreviation1Trend3",428}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"timeUnitFlag",2149}, + {"timeUnitFlag",2150}, {""}, {""}, - {"unpack",2240}, + {"unpack",2241}, {""}, {""}, {""}, {""}, {"physicalMeaningOfVerticalCoordinate",1642}, {""}, {""}, {""}, {""}, {""}, @@ -5770,7 +5771,7 @@ static const struct grib_keys_hash wordlist[] = {"cloudsAbbreviation2Trend4",434}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"tempPressureUnits",2112}, + {"tempPressureUnits",2113}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"endMonthTrend1",735}, @@ -5801,7 +5802,7 @@ static const struct grib_keys_hash wordlist[] = {"generalExtended2ordr",878}, {""}, {""}, {"ITERATOR",92}, - {"visibilityInKilometresTrend2",2295}, + {"visibilityInKilometresTrend2",2296}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"scaledValueOfLengthOfSemiMinorAxis",1878}, {""}, @@ -5816,7 +5817,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {"cloudsAbbreviation1Trend4",429}, {""}, {""}, - {"typeOfPacking",2198}, + {"typeOfPacking",2199}, {""}, {""}, {"experimentVersionNumberOfAnalysis",780}, {"presentWeather2Present",1666}, @@ -5858,9 +5859,9 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"offsetSection11",1486}, - {"uuidOfVGrid",2258}, + {"uuidOfVGrid",2259}, {""}, {""}, {""}, - {"typeOfProcessedData",2201}, + {"typeOfProcessedData",2202}, {""}, {""}, {"cloudsBaseCoded4",480}, {"NC2",176}, @@ -5877,7 +5878,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {"rootGroupSymbolTableEntry",1781}, {""}, {""}, {""}, - {"variationOfVisibilityTrend2",2271}, + {"variationOfVisibilityTrend2",2272}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -5890,12 +5891,12 @@ static const struct grib_keys_hash wordlist[] = {"runwayDesignatorRVR3",1808}, {"beginHourTrend2",336}, {""}, {""}, {""}, - {"typeOfGeneratingProcess",2190}, + {"typeOfGeneratingProcess",2191}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"variationOfVisibilityDirectionTrend2",2267}, + {"variationOfVisibilityDirectionTrend2",2268}, {""}, {""}, {""}, {""}, {""}, - {"visibilityInKilometresTrend1",2294}, + {"visibilityInKilometresTrend1",2295}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"firstLatitudeInDegrees",843}, @@ -5911,24 +5912,24 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"variationOfVisibilityTrend1",2270}, + {"variationOfVisibilityTrend1",2271}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"totalNumberOfGridPoints",2162}, + {"totalNumberOfGridPoints",2163}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"cloudsBaseCoded3Trend2",477}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"section_01",1972}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"windUnitsTrend3",2331}, - {"visibilityTrend2",2299}, + {"windUnitsTrend3",2332}, + {"visibilityTrend2",2300}, {""}, {""}, {""}, {"clusterMember7",533}, {""}, {""}, {""}, {""}, {""}, {""}, {"iDirectionIncrementGridLength",939}, - {"variationOfVisibilityDirectionTrend1",2266}, + {"variationOfVisibilityDirectionTrend1",2267}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"beginMonthTrend4",346}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -5951,11 +5952,11 @@ static const struct grib_keys_hash wordlist[] = {"padding_local40_1",1597}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"uuidOfHGrid",2257}, + {"uuidOfHGrid",2258}, {"cloudsBaseCoded3Trend1",476}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"unusedBitsInBitmap",2245}, + {"unusedBitsInBitmap",2246}, {"beginHourTrend1",335}, {""}, {""}, {""}, {""}, {""}, {""}, {"runwayDepthOfDepositCodeState2",1799}, @@ -5966,7 +5967,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {"section_6",1988}, {""}, - {"tsectionNumber5",2176}, + {"tsectionNumber5",2177}, {""}, {"observationDiagnostic",1454}, {"offsetSection5",1490}, @@ -5977,7 +5978,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"cloudsAbbreviation3Trend2",437}, {""}, {""}, {""}, {""}, {""}, - {"windUnitsTrend4",2332}, + {"windUnitsTrend4",2333}, {"cloudsBase1Trend2",447}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"cloudsCode3Trend3",498}, @@ -5995,7 +5996,7 @@ static const struct grib_keys_hash wordlist[] = {"skipExtraKeyAttributes",2022}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"uvRelativeToGrid",2259}, + {"uvRelativeToGrid",2260}, {""}, {""}, {""}, {""}, {""}, {""}, {"scanningMode7",1896}, {""}, {""}, {""}, @@ -6031,7 +6032,7 @@ static const struct grib_keys_hash wordlist[] = {"numberOfGridInReference",1385}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"cloudsBaseCoded2Trend4",474}, - {"typeOfLevelECMF",2196}, + {"typeOfLevelECMF",2197}, {""}, {"runwayDepositCodeState2",1791}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6051,9 +6052,9 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"weightAppliedToClimateMonth1",2303}, + {"weightAppliedToClimateMonth1",2304}, {""}, - {"superblockExtensionAddress",2094}, + {"superblockExtensionAddress",2095}, {""}, {"cloudsBase3Trend4",459}, {""}, @@ -6122,7 +6123,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"westLongitudeOfDomainOfTubing",2305}, + {"westLongitudeOfDomainOfTubing",2306}, {""}, {""}, {"horizontalDomainTemplateNumber",927}, {""}, @@ -6232,7 +6233,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"cloudsAbbreviation1Trend2",427}, - {"windGustTrend3",2320}, + {"windGustTrend3",2321}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"cloudsCode3Trend1",496}, @@ -6289,7 +6290,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {"Total_Number_Members_Possible",252}, {""}, {""}, {""}, {""}, - {"windGustTrend4",2321}, + {"windGustTrend4",2322}, {""}, {""}, {""}, {""}, {""}, {"scanningMode5",1894}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6362,7 +6363,7 @@ static const struct grib_keys_hash wordlist[] = {"numberOfBitsUsedForTheScaledGroupLengths",1343}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"windUnitsTrend2",2330}, + {"windUnitsTrend2",2331}, {""}, {""}, {""}, {"oneMinuteMeanMinimumRVR4",1508}, {""}, {""}, @@ -6416,7 +6417,7 @@ static const struct grib_keys_hash wordlist[] = {"sourceSinkChemicalPhysicalProcess",2025}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"windUnitsTrend1",2329}, + {"windUnitsTrend1",2330}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6559,7 +6560,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {"beginYearTrend1",347}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"versionNumberOfSuperblock",2285}, + {"versionNumberOfSuperblock",2286}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"experimentVersionNumber1",778}, @@ -6602,7 +6603,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"windGustTrend2",2319}, + {"windGustTrend2",2320}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6619,7 +6620,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"typicalYearOfCentury",2221}, + {"typicalYearOfCentury",2222}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6646,14 +6647,14 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"windGustTrend1",2318}, + {"windGustTrend1",2319}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"extractDateTimeMinuteRank",803}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"typicalYear2",2220}, + {"typicalYear2",2221}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"extractDateTimeMonthRank",806}, {""}, @@ -7126,7 +7127,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"swapScanningY",2098}, + {"swapScanningY",2099}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, diff --git a/src/grib_index.c b/src/grib_index.c index a52033207..d5ba582db 100644 --- a/src/grib_index.c +++ b/src/grib_index.c @@ -980,6 +980,7 @@ grib_index* grib_index_read(grib_context* c, const char* filename, int* err) index->count = index_count; fclose(fh); + grib_context_free(c, files); return index; } @@ -1775,8 +1776,11 @@ int grib_index_dump_file(FILE* fout, const char* filename) return err; f = file; while (f) { + grib_file *prev = f; fprintf(fout, "GRIB File: %s\n", f->name); + grib_context_free(c, f->name); f = f->next; + grib_context_free(c, prev); } fclose(fh); } diff --git a/src/grib_io.c b/src/grib_io.c index 208bfbb7c..ed8e171da 100644 --- a/src/grib_io.c +++ b/src/grib_io.c @@ -49,9 +49,9 @@ static void init() #define HDF5 0x89484446 #define WRAP 0x57524150 -#define GRIB_API_READS_BUFR 1 -#define GRIB_API_READS_HDF5 1 -#define GRIB_API_READS_WRAP 1 +#define ECCODES_READS_BUFR 1 +#define ECCODES_READS_HDF5 1 +#define ECCODES_READS_WRAP 1 typedef struct alloc_buffer @@ -399,6 +399,7 @@ static int read_GRIB(reader* r) default: r->seek_from_start(r->read_data, r->offset + 4); + grib_buffer_delete(c, buf); return GRIB_UNSUPPORTED_EDITION; break; } @@ -898,13 +899,25 @@ static int _read_any(reader* r, int grib_ok, int bufr_ok, int hdf5_ok, int wrap_ return err; } + static int read_any(reader* r, int grib_ok, int bufr_ok, int hdf5_ok, int wrap_ok) { int result = 0; + +#ifndef ECCODES_EACH_THREAD_OWN_FILE + /* If several threads can open the same file, then we need the locks + * so each thread gets its own message. Otherwise if threads are passed + * different files, then the lock is not needed + */ GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex1); +#endif + result = _read_any(r, grib_ok, bufr_ok, hdf5_ok, wrap_ok); + +#ifndef ECCODES_EACH_THREAD_OWN_FILE GRIB_MUTEX_UNLOCK(&mutex1); +#endif return result; } @@ -1517,7 +1530,7 @@ int grib_read_any_headers_only_from_file(grib_context* ctx, FILE* f, void* buffe r.alloc = &user_provider_buffer; r.headers_only = 1; - err = read_any(&r, 1, GRIB_API_READS_BUFR, GRIB_API_READS_HDF5, GRIB_API_READS_WRAP); + err = read_any(&r, 1, ECCODES_READS_BUFR, ECCODES_READS_HDF5, ECCODES_READS_WRAP); *len = r.message_size; @@ -1546,7 +1559,7 @@ int grib_read_any_from_file(grib_context* ctx, FILE* f, void* buffer, size_t* le offset = ftello(f); - err = read_any(&r, 1, GRIB_API_READS_BUFR, GRIB_API_READS_HDF5, GRIB_API_READS_WRAP); + err = read_any(&r, 1, ECCODES_READS_BUFR, ECCODES_READS_HDF5, ECCODES_READS_WRAP); if (err == GRIB_BUFFER_TOO_SMALL) { if (fseeko(f, offset, SEEK_SET)) @@ -1616,7 +1629,7 @@ int grib_read_any_from_memory_alloc(grib_context* ctx, unsigned char** data, siz r.alloc = &context_allocate_buffer; r.headers_only = 0; - err = read_any(&r, 1, GRIB_API_READS_BUFR, GRIB_API_READS_HDF5, GRIB_API_READS_WRAP); + err = read_any(&r, 1, ECCODES_READS_BUFR, ECCODES_READS_HDF5, ECCODES_READS_WRAP); *buffer = u.buffer; *length = u.length; @@ -1649,7 +1662,7 @@ int grib_read_any_from_memory(grib_context* ctx, unsigned char** data, size_t* d r.alloc = &user_provider_buffer; r.headers_only = 0; - err = read_any(&r, 1, GRIB_API_READS_BUFR, GRIB_API_READS_HDF5, GRIB_API_READS_WRAP); + err = read_any(&r, 1, ECCODES_READS_BUFR, ECCODES_READS_HDF5, ECCODES_READS_WRAP); *len = r.message_size; *data_length = m.data_len; diff --git a/src/grib_iterator_class.h b/src/grib_iterator_class.h index 043a201bd..62d3fd5c6 100644 --- a/src/grib_iterator_class.h +++ b/src/grib_iterator_class.h @@ -6,6 +6,7 @@ extern grib_iterator_class* grib_iterator_class_lambert_azimuthal_equal_area; extern grib_iterator_class* grib_iterator_class_lambert_conformal; extern grib_iterator_class* grib_iterator_class_latlon; extern grib_iterator_class* grib_iterator_class_latlon_reduced; +extern grib_iterator_class* grib_iterator_class_mercator; extern grib_iterator_class* grib_iterator_class_polar_stereographic; extern grib_iterator_class* grib_iterator_class_regular; extern grib_iterator_class* grib_iterator_class_space_view; diff --git a/src/grib_iterator_class_lambert_conformal.c b/src/grib_iterator_class_lambert_conformal.c index 4ca01506e..f1c9b1098 100644 --- a/src/grib_iterator_class_lambert_conformal.c +++ b/src/grib_iterator_class_lambert_conformal.c @@ -82,20 +82,7 @@ static void init_class(grib_iterator_class* c) } /* END_CLASS_IMP */ -static int next(grib_iterator* i, double* lat, double* lon, double* val) -{ - grib_iterator_lambert_conformal* self = (grib_iterator_lambert_conformal*)i; - - if ((long)i->e >= (long)(i->nv - 1)) - return 0; - i->e++; - - *lat = self->lats[i->e]; - *lon = self->lons[i->e]; - *val = i->data[i->e]; - - return 1; -} +#define EPSILON 1.0e-10 #ifndef M_PI #define M_PI 3.14159265358979323846 /* Whole pie */ @@ -112,16 +99,286 @@ static int next(grib_iterator* i, double* lat, double* lon, double* val) #define RAD2DEG 57.29577951308232087684 /* 180 over pi */ #define DEG2RAD 0.01745329251994329576 /* pi over 180 */ -static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) +/* Adjust longitude (in radians) to range -180 to 180 */ +static double adjust_lon_radians(double lon) +{ + if (lon > M_PI) lon -= 2 * M_PI; + if (lon < -M_PI) lon += 2 * M_PI; + return lon; +} + +/* Function to compute the latitude angle, phi2, for the inverse + * From the book "Map Projections-A Working Manual-John P. Snyder (1987)" + * Equation (7–9) involves rapidly converging iteration: Calculate t from (15-11) + * Then, assuming an initial trial phi equal to (pi/2 - 2*arctan t) in the right side of equation (7–9), + * calculate phi on the left side. Substitute the calculated phi) into the right side, + * calculate a new phi, etc., until phi does not change significantly from the preceding trial value of phi + */ +static double compute_phi( + double eccent, /* Spheroid eccentricity */ + double ts, /* Constant value t */ + int* error) +{ + double eccnth, phi, con, dphi, sinpi; + int i, MAX_ITER = 15; + + eccnth = 0.5 * eccent; + phi = M_PI_2 - 2 * atan(ts); + for (i = 0; i <= MAX_ITER; i++) { + sinpi = sin(phi); + con = eccent * sinpi; + dphi = M_PI_2 - 2 * atan(ts * (pow(((1.0 - con) / (1.0 + con)), eccnth))) - phi; + phi += dphi; + if (fabs(dphi) <= 0.0000000001) + return (phi); + } + *error = GRIB_INTERNAL_ERROR; + return 0; +} + +/* Compute the constant small m which is the radius of + a parallel of latitude, phi, divided by the semimajor axis */ +static double compute_m(double eccent, double sinphi, double cosphi) +{ + const double con = eccent * sinphi; + return ((cosphi / (sqrt(1.0 - con * con)))); +} + +/* Compute the constant small t for use in the forward computations */ +static double compute_t( + double eccent, /* Eccentricity of the spheroid */ + double phi, /* Latitude phi */ + double sinphi) /* Sine of the latitude */ +{ + double con = eccent * sinphi; + double com = 0.5 * eccent; + con = pow(((1.0 - con) / (1.0 + con)), com); + return (tan(0.5 * (M_PI_2 - phi)) / con); +} + +static double calculate_eccentricity(double minor, double major) +{ + const double temp = minor / major; + return sqrt(1.0 - temp * temp); +} + +static int init_sphere(grib_handle* h, + grib_iterator_lambert_conformal* self, + size_t nv, long nx, long ny, + double LoVInDegrees, + double Dx, double Dy, double radius, + double latFirstInRadians, double lonFirstInRadians, + double LoVInRadians, double Latin1InRadians, double Latin2InRadians, + double LaDInRadians, + long iScansNegatively, long jScansPositively, long jPointsAreConsecutive) +{ + int i, j; + double f, n, rho, rho0, angle, x0, y0, x, y, tmp, tmp2; + double latDeg, lonDeg, lonDiff; + + if (fabs(Latin1InRadians - Latin2InRadians) < 1E-09) { + n = sin(Latin1InRadians); + } else { + n = log(cos(Latin1InRadians) / cos(Latin2InRadians)) / + log(tan(M_PI_4 + Latin2InRadians / 2.0) / tan(M_PI_4 + Latin1InRadians / 2.0)); + } + + f = (cos(Latin1InRadians) * pow(tan(M_PI_4 + Latin1InRadians / 2.0), n)) / n; + rho = radius * f * pow(tan(M_PI_4 + latFirstInRadians / 2.0), -n); + rho0 = radius * f * pow(tan(M_PI_4 + LaDInRadians / 2.0), -n); + if (n < 0) /* adjustment for southern hemisphere */ + rho0 = -rho0; + lonDiff = lonFirstInRadians - LoVInRadians; + + /* Adjust longitude to range -180 to 180 */ + if (lonDiff > M_PI) + lonDiff -= 2 * M_PI; + if (lonDiff < -M_PI) + lonDiff += 2 * M_PI; + angle = n * lonDiff; + x0 = rho * sin(angle); + y0 = rho0 - rho * cos(angle); + /*Dx = iScansNegatively == 0 ? Dx : -Dx;*/ + /* GRIB-405: Don't change sign of Dy. Latitudes ALWAYS increase from latitudeOfFirstGridPoint */ + /*Dy = jScansPositively == 1 ? Dy : -Dy;*/ + + /* Allocate latitude and longitude arrays */ + self->lats = (double*)grib_context_malloc(h->context, nv * sizeof(double)); + if (!self->lats) { + grib_context_log(h->context, GRIB_LOG_ERROR, "Unable to allocate %ld bytes", nv * sizeof(double)); + return GRIB_OUT_OF_MEMORY; + } + self->lons = (double*)grib_context_malloc(h->context, nv * sizeof(double)); + if (!self->lats) { + grib_context_log(h->context, GRIB_LOG_ERROR, "Unable to allocate %ld bytes", nv * sizeof(double)); + return GRIB_OUT_OF_MEMORY; + } + + /* Populate our arrays */ + for (j = 0; j < ny; j++) { + y = y0 + j * Dy; + if (n < 0) { /* adjustment for southern hemisphere */ + y = -y; + } + tmp = rho0 - y; + tmp2 = tmp * tmp; + for (i = 0; i < nx; i++) { + int index = i + j * nx; + x = x0 + i * Dx; + if (n < 0) { /* adjustment for southern hemisphere */ + x = -x; + } + angle = atan2(x, tmp); /* See ECC-524 */ + rho = sqrt(x * x + tmp2); + if (n <= 0) rho = -rho; + lonDeg = LoVInDegrees + (angle / n) * RAD2DEG; + latDeg = (2.0 * atan(pow(radius * f / rho, 1.0 / n)) - M_PI_2) * RAD2DEG; + lonDeg = normalise_longitude_in_degrees(lonDeg); + self->lons[index] = lonDeg; + self->lats[index] = latDeg; + } + } + + return GRIB_SUCCESS; +} + +/* Oblate spheroid */ +static int init_oblate(grib_handle* h, + grib_iterator_lambert_conformal* self, + size_t nv, long nx, long ny, + double LoVInDegrees, + double Dx, double Dy, + double earthMinorAxisInMetres, double earthMajorAxisInMetres, + double latFirstInRadians, double lonFirstInRadians, + double LoVInRadians, double Latin1InRadians, double Latin2InRadians, + double LaDInRadians) { int i, j, err = 0; - double *lats, *lons; /* the lat/lon arrays to be populated */ + double x0, y0, x, y, latRad, lonRad, latDeg, lonDeg, sinphi, ts, rh1, theta; + double false_easting; /* x offset in meters */ + double false_northing; /* y offset in meters */ + + double ns; /* ratio of angle between meridian */ + double F; /* flattening of ellipsoid */ + double rh; /* height above ellipsoid */ + double sin_po; /* sin value */ + double cos_po; /* cos value */ + double con; /* temporary variable */ + double ms1; /* small m 1 */ + double ms2; /* small m 2 */ + double ts0; /* small t 0 */ + double ts1; /* small t 1 */ + double ts2; /* small t 2 */ + + double e = calculate_eccentricity(earthMinorAxisInMetres, earthMajorAxisInMetres); + + sin_po = sin(Latin1InRadians); + cos_po = cos(Latin1InRadians); + con = sin_po; + ms1 = compute_m(e, sin_po, cos_po); + ts1 = compute_t(e, Latin1InRadians, sin_po); + + sin_po = sin(Latin2InRadians); + cos_po = cos(Latin2InRadians); + ms2 = compute_m(e, sin_po, cos_po); + ts2 = compute_t(e, Latin2InRadians, sin_po); + sin_po = sin(LaDInRadians); + ts0 = compute_t(e, LaDInRadians, sin_po); + + if (fabs(Latin1InRadians - Latin2InRadians) > EPSILON) { + ns = log(ms1 / ms2) / log(ts1 / ts2); + } else { + ns = con; + } + F = ms1 / (ns * pow(ts1, ns)); + rh = earthMajorAxisInMetres * F * pow(ts0, ns); + + /* Forward projection: convert lat,lon to x,y */ + con = fabs(fabs(latFirstInRadians) - M_PI_2); + if (con > EPSILON) { + sinphi = sin(latFirstInRadians); + ts = compute_t(e, latFirstInRadians, sinphi); + rh1 = earthMajorAxisInMetres * F * pow(ts, ns); + } else { + con = latFirstInRadians * ns; + if (con <= 0) { + grib_context_log(h->context, GRIB_LOG_ERROR, "Point cannot be projected"); + return GRIB_GEOCALCULUS_PROBLEM; + } + rh1 = 0; + } + theta = ns * adjust_lon_radians(lonFirstInRadians - LoVInRadians); + x0 = rh1 * sin(theta); + y0 = rh - rh1 * cos(theta); + x0 = -x0; + y0 = -y0; + + /* Allocate latitude and longitude arrays */ + self->lats = (double*)grib_context_malloc(h->context, nv * sizeof(double)); + if (!self->lats) { + grib_context_log(h->context, GRIB_LOG_ERROR, "Unable to allocate %ld bytes", nv * sizeof(double)); + return GRIB_OUT_OF_MEMORY; + } + self->lons = (double*)grib_context_malloc(h->context, nv * sizeof(double)); + if (!self->lats) { + grib_context_log(h->context, GRIB_LOG_ERROR, "Unable to allocate %ld bytes", nv * sizeof(double)); + return GRIB_OUT_OF_MEMORY; + } + + /* Populate our arrays */ + false_easting = x0; + false_northing = y0; + for (j = 0; j < ny; j++) { + y = j * Dy; + for (i = 0; i < nx; i++) { + const int index = i + j * nx; + double _x, _y; + x = i * Dx; + /* Inverse projection to convert from x,y to lat,lon */ + _x = x - false_easting; + _y = rh - y + false_northing; + rh1 = sqrt(_x * _x + _y * _y); + con = 1.0; + if (ns <= 0) { + rh1 = -rh1; + con = -con; + } + theta = 0.0; + if (rh1 != 0) + theta = atan2((con * _x), (con * _y)); + if ((rh1 != 0) || (ns > 0.0)) { + con = 1.0 / ns; + ts = pow((rh1 / (earthMajorAxisInMetres * F)), con); + latRad = compute_phi(e, ts, &err); + if (err) { + grib_context_log(h->context, GRIB_LOG_ERROR, "Failed to compute the latitude angle, phi2, for the inverse"); + grib_context_free(h->context, self->lats); + grib_context_free(h->context, self->lons); + return err; + } + } else { + latRad = -M_PI_2; + } + lonRad = adjust_lon_radians(theta / ns + LoVInRadians); + latDeg = latRad * RAD2DEG; /* Convert to degrees */ + lonDeg = lonRad * RAD2DEG; + lonDeg = normalise_longitude_in_degrees(lonDeg); + self->lons[index] = lonDeg; + self->lats[index] = latDeg; + } + } + return GRIB_SUCCESS; +} + +static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) +{ + int err = 0, is_oblate = 0; long nx, ny, iScansNegatively, jScansPositively, jPointsAreConsecutive, alternativeRowScanning; double LoVInDegrees, LaDInDegrees, Latin1InDegrees, Latin2InDegrees, latFirstInDegrees, lonFirstInDegrees, Dx, Dy, radius = 0; double latFirstInRadians, lonFirstInRadians, LoVInRadians, Latin1InRadians, Latin2InRadians, - LaDInRadians, lonDiff, lonDeg, latDeg; - double f, n, rho, rho0, angle, x0, y0, x, y, tmp, tmp2; + LaDInRadians; + double earthMajorAxisInMetres=0, earthMinorAxisInMetres=0; grib_iterator_lambert_conformal* self = (grib_iterator_lambert_conformal*)iter; @@ -142,22 +399,23 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) const char* sjPointsAreConsecutive = grib_arguments_get_name(h, args, self->carg++); const char* salternativeRowScanning = grib_arguments_get_name(h, args, self->carg++); - if ((err = grib_get_long_internal(h, snx, &nx)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(h, sny, &ny)) != GRIB_SUCCESS) - return err; + if ((err = grib_get_long_internal(h, snx, &nx)) != GRIB_SUCCESS) return err; + if ((err = grib_get_long_internal(h, sny, &ny)) != GRIB_SUCCESS) return err; + + is_oblate = grib_is_earth_oblate(h); - if (grib_is_earth_oblate(h)) { - grib_context_log(h->context, GRIB_LOG_ERROR, "Lambert Conformal only supported for spherical earth."); - return GRIB_GEOCALCULUS_PROBLEM; + if (is_oblate) { + if ((err = grib_get_double_internal(h, "earthMinorAxisInMetres", &earthMinorAxisInMetres)) != GRIB_SUCCESS) return err; + if ((err = grib_get_double_internal(h, "earthMajorAxisInMetres", &earthMajorAxisInMetres)) != GRIB_SUCCESS) return err; + } else { + if ((err = grib_get_double_internal(h, sradius, &radius)) != GRIB_SUCCESS) return err; } if (iter->nv != nx * ny) { grib_context_log(h->context, GRIB_LOG_ERROR, "Wrong number of points (%ld!=%ldx%ld)", iter->nv, nx, ny); return GRIB_WRONG_GRID; } - if ((err = grib_get_double_internal(h, sradius, &radius)) != GRIB_SUCCESS) - return err; + if ((err = grib_get_double_internal(h, sLoVInDegrees, &LoVInDegrees)) != GRIB_SUCCESS) return err; if ((err = grib_get_double_internal(h, sLaDInDegrees, &LaDInDegrees)) != GRIB_SUCCESS) @@ -183,6 +441,13 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) if ((err = grib_get_long_internal(h, salternativeRowScanning, &alternativeRowScanning)) != GRIB_SUCCESS) return err; + /* Standard Parallels cannot be equal and on opposite sides of the equator */ + if (fabs(Latin1InDegrees + Latin2InDegrees) < EPSILON) { + grib_context_log(h->context, GRIB_LOG_ERROR, + "Cannot have equal latitudes for standard parallels on opposite sides of equator"); + return GRIB_WRONG_GRID; + } + /* * See Wolfram MathWorld: http://mathworld.wolfram.com/LambertConformalConicProjection.html */ @@ -193,77 +458,22 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) LaDInRadians = LaDInDegrees * DEG2RAD; LoVInRadians = LoVInDegrees * DEG2RAD; - if (fabs(Latin1InRadians - Latin2InRadians) < 1E-09) { - n = sin(Latin1InRadians); - } - else { - n = log(cos(Latin1InRadians) / cos(Latin2InRadians)) / - log(tan(M_PI_4 + Latin2InRadians / 2.0) / tan(M_PI_4 + Latin1InRadians / 2.0)); - } - - f = (cos(Latin1InRadians) * pow(tan(M_PI_4 + Latin1InRadians / 2.0), n)) / n; - rho = radius * f * pow(tan(M_PI_4 + latFirstInRadians / 2.0), -n); - rho0 = radius * f * pow(tan(M_PI_4 + LaDInRadians / 2.0), -n); - if (n < 0) /* adjustment for southern hemisphere */ - rho0 = -rho0; - lonDiff = lonFirstInRadians - LoVInRadians; - - /* Adjust longitude to range -180 to 180 */ - if (lonDiff > M_PI) - lonDiff -= 2 * M_PI; - if (lonDiff < -M_PI) - lonDiff += 2 * M_PI; - angle = n * lonDiff; - x0 = rho * sin(angle); - y0 = rho0 - rho * cos(angle); - /*Dx = iScansNegatively == 0 ? Dx : -Dx;*/ - /* GRIB-405: Don't change sign of Dy. Latitudes ALWAYS increase from latitudeOfFirstGridPoint */ - /*Dy = jScansPositively == 1 ? Dy : -Dy;*/ - - /* Allocate latitude and longitude arrays */ - self->lats = (double*)grib_context_malloc(h->context, iter->nv * sizeof(double)); - if (!self->lats) { - grib_context_log(h->context, GRIB_LOG_ERROR, "Unable to allocate %ld bytes", iter->nv * sizeof(double)); - return GRIB_OUT_OF_MEMORY; - } - self->lons = (double*)grib_context_malloc(h->context, iter->nv * sizeof(double)); - if (!self->lats) { - grib_context_log(h->context, GRIB_LOG_ERROR, "Unable to allocate %ld bytes", iter->nv * sizeof(double)); - return GRIB_OUT_OF_MEMORY; - } - lats = self->lats; - lons = self->lons; - - /* Populate our arrays */ - for (j = 0; j < ny; j++) { - y = y0 + j * Dy; - if (n < 0) { /* adjustment for southern hemisphere */ - y = -y; - } - tmp = rho0 - y; - tmp2 = tmp * tmp; - for (i = 0; i < nx; i++) { - int index = i + j * nx; - x = x0 + i * Dx; - if (n < 0) { /* adjustment for southern hemisphere */ - x = -x; - } - - angle = atan2(x, tmp); /* See ECC-524 */ - rho = sqrt(x * x + tmp2); - if (n <= 0) - rho = -rho; - lonDeg = LoVInDegrees + (angle / n) * RAD2DEG; - latDeg = (2.0 * atan(pow(radius * f / rho, 1.0 / n)) - M_PI_2) * RAD2DEG; - while (lonDeg >= 360.0) - lonDeg -= 360.0; - while (lonDeg < 0.0) - lonDeg += 360.0; - lons[index] = lonDeg; - lats[index] = latDeg; - /*printf("DBK: llat[%d] = %g \t llon[%d] = %g\n", index,lats[index], index,lons[index]);*/ - } + if (is_oblate) { + err = init_oblate(h, self, iter->nv, nx, ny, + LoVInDegrees, + Dx, Dy, earthMinorAxisInMetres, earthMajorAxisInMetres, + latFirstInRadians, lonFirstInRadians, + LoVInRadians, Latin1InRadians, Latin2InRadians, + LaDInRadians); + } else { + err = init_sphere(h, self, iter->nv, nx, ny, + LoVInDegrees, + Dx, Dy, radius, + latFirstInRadians, lonFirstInRadians, + LoVInRadians, Latin1InRadians, Latin2InRadians, LaDInRadians, + iScansNegatively, jScansPositively, jPointsAreConsecutive); } + if (err) return err; iter->e = -1; @@ -271,12 +481,24 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) err = transform_iterator_data(h, iter->data, iScansNegatively, jScansPositively, jPointsAreConsecutive, alternativeRowScanning, iter->nv, nx, ny); - if (err) - return err; - return err; } +static int next(grib_iterator* i, double* lat, double* lon, double* val) +{ + grib_iterator_lambert_conformal* self = (grib_iterator_lambert_conformal*)i; + + if ((long)i->e >= (long)(i->nv - 1)) + return 0; + i->e++; + + *lat = self->lats[i->e]; + *lon = self->lons[i->e]; + *val = i->data[i->e]; + + return 1; +} + static int destroy(grib_iterator* i) { grib_iterator_lambert_conformal* self = (grib_iterator_lambert_conformal*)i; diff --git a/src/grib_iterator_class_latlon.c b/src/grib_iterator_class_latlon.c index b28e13e22..59f883376 100644 --- a/src/grib_iterator_class_latlon.c +++ b/src/grib_iterator_class_latlon.c @@ -142,20 +142,25 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) const char* s_jdir = grib_arguments_get_name(h, args, self->carg++); const char* s_jScansPos = grib_arguments_get_name(h, args, self->carg++); const char* s_jPtsConsec = grib_arguments_get_name(h, args, self->carg++); - self->angleOfRotation = 0; - self->isRotated = 0; - self->southPoleLat = 0; - self->southPoleLon = 0; - self->disableUnrotate = 0; /* unrotate enabled by default */ - - if ((err = grib_get_long(h, "isRotatedGrid", &self->isRotated))) + const char* s_isRotatedGrid = grib_arguments_get_name(h, args, self->carg++); + const char* s_angleOfRotation= grib_arguments_get_name(h, args, self->carg++); + const char* s_latSouthernPole= grib_arguments_get_name(h, args, self->carg++); + const char* s_lonSouthernPole= grib_arguments_get_name(h, args, self->carg++); + + self->angleOfRotation = 0; + self->isRotated = 0; + self->southPoleLat = 0; + self->southPoleLon = 0; + self->disableUnrotate = 0; /* unrotate enabled by default */ + + if ((err = grib_get_long(h, s_isRotatedGrid, &self->isRotated))) return err; if (self->isRotated) { - if ((err = grib_get_double_internal(h, "angleOfRotation", &self->angleOfRotation))) + if ((err = grib_get_double_internal(h, s_angleOfRotation, &self->angleOfRotation))) return err; - if ((err = grib_get_double_internal(h, "latitudeOfSouthernPoleInDegrees", &self->southPoleLat))) + if ((err = grib_get_double_internal(h, s_latSouthernPole, &self->southPoleLat))) return err; - if ((err = grib_get_double_internal(h, "longitudeOfSouthernPoleInDegrees", &self->southPoleLon))) + if ((err = grib_get_double_internal(h, s_lonSouthernPole, &self->southPoleLon))) return err; } diff --git a/src/grib_iterator_class_mercator.c b/src/grib_iterator_class_mercator.c new file mode 100644 index 000000000..bc0e86749 --- /dev/null +++ b/src/grib_iterator_class_mercator.c @@ -0,0 +1,347 @@ +/* + * (C) Copyright 2005- 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. + */ + +#include "grib_api_internal.h" +#include + +/* + This is used by make_class.pl + + START_CLASS_DEF + CLASS = iterator + SUPER = grib_iterator_class_gen + IMPLEMENTS = destroy + IMPLEMENTS = init;next + MEMBERS = double *lats + MEMBERS = double *lons + MEMBERS = long Nj + END_CLASS_DEF +*/ + +/* START_CLASS_IMP */ + +/* + +Don't edit anything between START_CLASS_IMP and END_CLASS_IMP +Instead edit values between START_CLASS_DEF and END_CLASS_DEF +or edit "iterator.class" and rerun ./make_class.pl + +*/ + + +static void init_class(grib_iterator_class*); + +static int init(grib_iterator* i, grib_handle*, grib_arguments*); +static int next(grib_iterator* i, double* lat, double* lon, double* val); +static int destroy(grib_iterator* i); + + +typedef struct grib_iterator_mercator +{ + grib_iterator it; + /* Members defined in gen */ + long carg; + const char* missingValue; + /* Members defined in mercator */ + double* lats; + double* lons; + long Nj; +} grib_iterator_mercator; + +extern grib_iterator_class* grib_iterator_class_gen; + +static grib_iterator_class _grib_iterator_class_mercator = { + &grib_iterator_class_gen, /* super */ + "mercator", /* name */ + sizeof(grib_iterator_mercator), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* constructor */ + &destroy, /* destructor */ + &next, /* Next Value */ + 0, /* Previous Value */ + 0, /* Reset the counter */ + 0, /* has next values */ +}; + +grib_iterator_class* grib_iterator_class_mercator = &_grib_iterator_class_mercator; + + +static void init_class(grib_iterator_class* c) +{ + c->previous = (*(c->super))->previous; + c->reset = (*(c->super))->reset; + c->has_next = (*(c->super))->has_next; +} +/* END_CLASS_IMP */ + +#define EPSILON 1.0e-10 + +#ifndef M_PI +#define M_PI 3.14159265358979323846 /* Whole pie */ +#endif + +#ifndef M_PI_2 +#define M_PI_2 1.57079632679489661923 /* Half a pie */ +#endif + +#ifndef M_PI_4 +#define M_PI_4 0.78539816339744830962 /* Quarter of a pie */ +#endif + +#define RAD2DEG 57.29577951308232087684 /* 180 over pi */ +#define DEG2RAD 0.01745329251994329576 /* pi over 180 */ + +/* Adjust longitude (in radians) to range -180 to 180 */ +static double adjust_lon_radians(double lon) +{ + if (lon > M_PI) lon -= 2 * M_PI; + if (lon < -M_PI) lon += 2 * M_PI; + return lon; +} + +/* Function to compute the latitude angle, phi2, for the inverse + * From the book "Map Projections-A Working Manual-John P. Snyder (1987)" + * Equation (7–9) involves rapidly converging iteration: Calculate t from (15-11) + * Then, assuming an initial trial phi equal to (pi/2 - 2*arctan t) in the right side of equation (7–9), + * calculate phi on the left side. Substitute the calculated phi into the right side, + * calculate a new phi, etc., until phi does not change significantly from the preceding trial value of phi + */ +static double compute_phi( + double eccent, /* Spheroid eccentricity */ + double ts, /* Constant value t */ + int* error) +{ + double eccnth, phi, con, dphi, sinpi; + int i, MAX_ITER = 15; + + eccnth = 0.5 * eccent; + phi = M_PI_2 - 2 * atan(ts); + for (i = 0; i <= MAX_ITER; i++) { + sinpi = sin(phi); + con = eccent * sinpi; + dphi = M_PI_2 - 2 * atan(ts * (pow(((1.0 - con) / (1.0 + con)), eccnth))) - phi; + phi += dphi; + if (fabs(dphi) <= EPSILON) + return phi; + } + *error = GRIB_INTERNAL_ERROR; + return 0; +} + +/* Compute the constant small t for use in the forward computations */ +static double compute_t( + double eccent, /* Eccentricity of the spheroid */ + double phi, /* Latitude phi */ + double sinphi) /* Sine of the latitude */ +{ + double con = eccent * sinphi; + double com = 0.5 * eccent; + con = pow(((1.0 - con) / (1.0 + con)), com); + return (tan(0.5 * (M_PI_2 - phi)) / con); +} + +static int init_mercator(grib_handle* h, + grib_iterator_mercator* self, + size_t nv, long nx, long ny, + double DiInMetres, double DjInMetres, + double earthMinorAxisInMetres, double earthMajorAxisInMetres, + double latFirstInRadians, double lonFirstInRadians, + double latLastInRadians, double lonLastInRadians, + double LaDInRadians, double orientationInRadians) +{ + int i, j, err = 0; + double x0, y0, x, y, latRad, lonRad, latDeg, lonDeg, sinphi, ts; + double false_easting; /* x offset in meters */ + double false_northing; /* y offset in meters */ + double m1; /* small value m */ + double temp, e, es; + + temp = earthMinorAxisInMetres / earthMajorAxisInMetres; + es = 1.0 - (temp * temp); + e = sqrt(es); + m1 = cos(LaDInRadians) / (sqrt(1.0 - es * sin(LaDInRadians) * sin(LaDInRadians))); + + /* Forward projection: convert lat,lon to x,y */ + if (fabs(fabs(latFirstInRadians) - M_PI_2) <= EPSILON) { + grib_context_log(h->context, GRIB_LOG_ERROR, "Mercator: Transformation cannot be computed at the poles"); + return GRIB_GEOCALCULUS_PROBLEM; + } + else { + sinphi = sin(latFirstInRadians); + ts = compute_t(e, latFirstInRadians, sinphi); + x0 = earthMajorAxisInMetres * m1 * adjust_lon_radians(lonFirstInRadians - orientationInRadians); + y0 = 0 - earthMajorAxisInMetres * m1 * log(ts); + } + x0 = -x0; + y0 = -y0; + + /* Allocate latitude and longitude arrays */ + self->lats = (double*)grib_context_malloc(h->context, nv * sizeof(double)); + if (!self->lats) { + grib_context_log(h->context, GRIB_LOG_ERROR, "Unable to allocate %ld bytes", nv * sizeof(double)); + return GRIB_OUT_OF_MEMORY; + } + self->lons = (double*)grib_context_malloc(h->context, nv * sizeof(double)); + if (!self->lats) { + grib_context_log(h->context, GRIB_LOG_ERROR, "Unable to allocate %ld bytes", nv * sizeof(double)); + return GRIB_OUT_OF_MEMORY; + } + + /* Populate our arrays */ + false_easting = x0; + false_northing = y0; + for (j = 0; j < ny; j++) { + y = j * DiInMetres; + for (i = 0; i < nx; i++) { + const int index = i + j * nx; + double _x, _y; + x = i * DiInMetres; + /* Inverse projection to convert from x,y to lat,lon */ + _x = x - false_easting; + _y = y - false_northing; + ts = exp(-_y / (earthMajorAxisInMetres * m1)); + latRad = compute_phi(e, ts, &err); + if (err) { + grib_context_log(h->context, GRIB_LOG_ERROR, "Mercator: Failed to compute the latitude angle, phi2, for the inverse"); + grib_context_free(h->context, self->lats); + grib_context_free(h->context, self->lons); + return err; + } + lonRad = adjust_lon_radians(orientationInRadians + _x / (earthMajorAxisInMetres * m1)); + latDeg = latRad * RAD2DEG; /* Convert to degrees */ + lonDeg = lonRad * RAD2DEG; + lonDeg = normalise_longitude_in_degrees(lonDeg); + self->lons[index] = lonDeg; + self->lats[index] = latDeg; + } + } + return GRIB_SUCCESS; +} + +static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) +{ + int err = 0; + long ni, nj, iScansNegatively, jScansPositively, jPointsAreConsecutive, alternativeRowScanning; + double latFirstInDegrees, lonFirstInDegrees, LaDInDegrees; + double latLastInDegrees, lonLastInDegrees, orientationInDegrees, DiInMetres, DjInMetres, radius = 0; + double latFirstInRadians, lonFirstInRadians, latLastInRadians, lonLastInRadians, + LaDInRadians, orientationInRadians; + double earthMajorAxisInMetres = 0, earthMinorAxisInMetres = 0; + + grib_iterator_mercator* self = (grib_iterator_mercator*)iter; + + const char* sRadius = grib_arguments_get_name(h, args, self->carg++); + const char* sNi = grib_arguments_get_name(h, args, self->carg++); + const char* sNj = grib_arguments_get_name(h, args, self->carg++); + const char* sLatFirstInDegrees = grib_arguments_get_name(h, args, self->carg++); + const char* sLonFirstInDegrees = grib_arguments_get_name(h, args, self->carg++); + const char* sLaDInDegrees = grib_arguments_get_name(h, args, self->carg++); + const char* sLatLastInDegrees = grib_arguments_get_name(h, args, self->carg++); + const char* sLonLastInDegrees = grib_arguments_get_name(h, args, self->carg++); + const char* sOrientationInDegrees = grib_arguments_get_name(h, args, self->carg++); + /* Dx and Dy are in Metres */ + const char* sDi = grib_arguments_get_name(h, args, self->carg++); + const char* sDj = grib_arguments_get_name(h, args, self->carg++); + const char* siScansNegatively = grib_arguments_get_name(h, args, self->carg++); + const char* sjScansPositively = grib_arguments_get_name(h, args, self->carg++); + const char* sjPointsAreConsecutive = grib_arguments_get_name(h, args, self->carg++); + const char* sAlternativeRowScanning = grib_arguments_get_name(h, args, self->carg++); + + if ((err = grib_get_long_internal(h, sNi, &ni)) != GRIB_SUCCESS) return err; + if ((err = grib_get_long_internal(h, sNj, &nj)) != GRIB_SUCCESS) return err; + + if (grib_is_earth_oblate(h)) { + if ((err = grib_get_double_internal(h, "earthMinorAxisInMetres", &earthMinorAxisInMetres)) != GRIB_SUCCESS) return err; + if ((err = grib_get_double_internal(h, "earthMajorAxisInMetres", &earthMajorAxisInMetres)) != GRIB_SUCCESS) return err; + } + else { + if ((err = grib_get_double_internal(h, sRadius, &radius)) != GRIB_SUCCESS) return err; + earthMinorAxisInMetres = earthMajorAxisInMetres = radius; + } + + if (iter->nv != ni * nj) { + grib_context_log(h->context, GRIB_LOG_ERROR, "Wrong number of points (%ld!=%ldx%ld)", iter->nv, ni, nj); + return GRIB_WRONG_GRID; + } + + if ((err = grib_get_double_internal(h, sLaDInDegrees, &LaDInDegrees)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_double_internal(h, sLatFirstInDegrees, &latFirstInDegrees)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_double_internal(h, sLonFirstInDegrees, &lonFirstInDegrees)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_double_internal(h, sLatLastInDegrees, &latLastInDegrees)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_double_internal(h, sLonLastInDegrees, &lonLastInDegrees)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_double_internal(h, sOrientationInDegrees, &orientationInDegrees)) != GRIB_SUCCESS) + return err; + + if ((err = grib_get_double_internal(h, sDi, &DiInMetres)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_double_internal(h, sDj, &DjInMetres)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(h, sjPointsAreConsecutive, &jPointsAreConsecutive)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(h, sjScansPositively, &jScansPositively)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(h, siScansNegatively, &iScansNegatively)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(h, sAlternativeRowScanning, &alternativeRowScanning)) != GRIB_SUCCESS) + return err; + + latFirstInRadians = latFirstInDegrees * DEG2RAD; + lonFirstInRadians = lonFirstInDegrees * DEG2RAD; + latLastInRadians = latLastInDegrees * DEG2RAD; + lonLastInRadians = lonLastInDegrees * DEG2RAD; + LaDInRadians = LaDInDegrees * DEG2RAD; + orientationInRadians = orientationInDegrees * DEG2RAD; + + err = init_mercator(h, self, iter->nv, ni, nj, + DiInMetres, DjInMetres, earthMinorAxisInMetres, earthMajorAxisInMetres, + latFirstInRadians, lonFirstInRadians, + latLastInRadians, lonLastInRadians, + LaDInRadians, orientationInRadians); + if (err) return err; + + iter->e = -1; + + /* Apply the scanning mode flags which may require data array to be transformed */ + err = transform_iterator_data(h, iter->data, + iScansNegatively, jScansPositively, jPointsAreConsecutive, alternativeRowScanning, + iter->nv, ni, nj); + return err; +} + +static int next(grib_iterator* i, double* lat, double* lon, double* val) +{ + grib_iterator_mercator* self = (grib_iterator_mercator*)i; + + if ((long)i->e >= (long)(i->nv - 1)) + return 0; + i->e++; + + *lat = self->lats[i->e]; + *lon = self->lons[i->e]; + *val = i->data[i->e]; + + return 1; +} + +static int destroy(grib_iterator* i) +{ + grib_iterator_mercator* self = (grib_iterator_mercator*)i; + const grib_context* c = i->h->context; + + grib_context_free(c, self->lats); + grib_context_free(c, self->lons); + return 1; +} diff --git a/src/grib_iterator_factory.h b/src/grib_iterator_factory.h index 42587157a..ad46ced1e 100644 --- a/src/grib_iterator_factory.h +++ b/src/grib_iterator_factory.h @@ -6,6 +6,7 @@ { "lambert_conformal", &grib_iterator_class_lambert_conformal, }, { "latlon", &grib_iterator_class_latlon, }, { "latlon_reduced", &grib_iterator_class_latlon_reduced, }, +{ "mercator", &grib_iterator_class_mercator, }, { "polar_stereographic", &grib_iterator_class_polar_stereographic, }, { "regular", &grib_iterator_class_regular, }, { "space_view", &grib_iterator_class_space_view, }, diff --git a/src/grib_lex.c b/src/grib_lex.c index 8f47c6d7a..c94d46e05 100644 --- a/src/grib_lex.c +++ b/src/grib_lex.c @@ -1,6 +1,6 @@ -#line 2 "gribl.c" +#line 1 "gribl.c" -#line 4 "gribl.c" +#line 3 "gribl.c" #define YY_INT_ALIGNED short int @@ -8,8 +8,8 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 37 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -84,65 +84,61 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + #endif /* ! C99 */ #endif /* ! FLEXINT_H */ -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST +/* begin standard C++ headers. */ -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST +/* TODO: this is always defined, so inline it */ #define grib_yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define grib_yynoreturn __attribute__((__noreturn__)) #else -#define grib_yyconst +#define grib_yynoreturn #endif /* Returned upon end-of-file. */ #define YY_NULL 0 -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (grib_yy_start) = 1 + 2 * - /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((grib_yy_start) - 1) / 2) #define YYSTATE YY_START - /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE grib_yyrestart(grib_yyin ) - +#define YY_NEW_FILE grib_yyrestart( grib_yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -159,15 +155,16 @@ typedef struct grib_yy_buffer_state *YY_BUFFER_STATE; typedef size_t grib_yy_size_t; #endif -extern grib_yy_size_t grib_yyleng; +extern int grib_yyleng; extern FILE *grib_yyin, *grib_yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - + #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ #define grib_yyless(n) \ @@ -182,7 +179,6 @@ extern FILE *grib_yyin, *grib_yyout; YY_DO_BEFORE_ACTION; /* set up grib_yytext again */ \ } \ while ( 0 ) - #define unput(c) grib_yyunput( c, (grib_yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE @@ -225,7 +221,7 @@ struct grib_yy_buffer_state int grib_yy_bs_lineno; /**< The line count. */ int grib_yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -253,7 +249,7 @@ struct grib_yy_buffer_state /* Stack of input buffers. */ static size_t grib_yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t grib_yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * grib_yy_buffer_stack = 0; /**< Stack as an array. */ +static YY_BUFFER_STATE * grib_yy_buffer_stack = NULL; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general @@ -264,7 +260,6 @@ static YY_BUFFER_STATE * grib_yy_buffer_stack = 0; /**< Stack as an array. */ #define YY_CURRENT_BUFFER ( (grib_yy_buffer_stack) \ ? (grib_yy_buffer_stack)[(grib_yy_buffer_stack_top)] \ : NULL) - /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ @@ -273,10 +268,10 @@ static YY_BUFFER_STATE * grib_yy_buffer_stack = 0; /**< Stack as an array. */ /* grib_yy_hold_char holds the character lost when grib_yytext is formed. */ static char grib_yy_hold_char; static int grib_yy_n_chars; /* number of characters read into grib_yy_ch_buf */ -grib_yy_size_t grib_yyleng; +int grib_yyleng; /* Points to current character in buffer. */ -static char *grib_yy_c_buf_p = (char *) 0; +static char *grib_yy_c_buf_p = NULL; static int grib_yy_init = 0; /* whether we need to initialize */ static int grib_yy_start = 0; /* start state number */ @@ -285,71 +280,68 @@ static int grib_yy_start = 0; /* start state number */ */ static int grib_yy_did_buffer_switch_on_eof; -void grib_yyrestart (FILE *input_file ); -void grib_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE grib_yy_create_buffer (FILE *file,int size ); -void grib_yy_delete_buffer (YY_BUFFER_STATE b ); -void grib_yy_flush_buffer (YY_BUFFER_STATE b ); -void grib_yypush_buffer_state (YY_BUFFER_STATE new_buffer ); -void grib_yypop_buffer_state (void ); +void grib_yyrestart ( FILE *input_file ); +void grib_yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE grib_yy_create_buffer ( FILE *file, int size ); +void grib_yy_delete_buffer ( YY_BUFFER_STATE b ); +void grib_yy_flush_buffer ( YY_BUFFER_STATE b ); +void grib_yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); +void grib_yypop_buffer_state ( void ); -static void grib_yyensure_buffer_stack (void ); -static void grib_yy_load_buffer_state (void ); -static void grib_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); +static void grib_yyensure_buffer_stack ( void ); +static void grib_yy_load_buffer_state ( void ); +static void grib_yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); +#define YY_FLUSH_BUFFER grib_yy_flush_buffer( YY_CURRENT_BUFFER ) -#define YY_FLUSH_BUFFER grib_yy_flush_buffer(YY_CURRENT_BUFFER ) +YY_BUFFER_STATE grib_yy_scan_buffer ( char *base, grib_yy_size_t size ); +YY_BUFFER_STATE grib_yy_scan_string ( const char *grib_yy_str ); +YY_BUFFER_STATE grib_yy_scan_bytes ( const char *bytes, int len ); -YY_BUFFER_STATE grib_yy_scan_buffer (char *base,grib_yy_size_t size ); -YY_BUFFER_STATE grib_yy_scan_string (grib_yyconst char *grib_yy_str ); -YY_BUFFER_STATE grib_yy_scan_bytes (grib_yyconst char *bytes,grib_yy_size_t len ); - -void *grib_yyalloc (grib_yy_size_t ); -void *grib_yyrealloc (void *,grib_yy_size_t ); -void grib_yyfree (void * ); +void *grib_yyalloc ( grib_yy_size_t ); +void *grib_yyrealloc ( void *, grib_yy_size_t ); +void grib_yyfree ( void * ); #define grib_yy_new_buffer grib_yy_create_buffer - #define grib_yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ grib_yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - grib_yy_create_buffer(grib_yyin,YY_BUF_SIZE ); \ + grib_yy_create_buffer( grib_yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->grib_yy_is_interactive = is_interactive; \ } - #define grib_yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ grib_yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - grib_yy_create_buffer(grib_yyin,YY_BUF_SIZE ); \ + grib_yy_create_buffer( grib_yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->grib_yy_at_bol = at_bol; \ } - #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->grib_yy_at_bol) /* Begin user sect3 */ +typedef flex_uint8_t YY_CHAR; -typedef unsigned char YY_CHAR; - -FILE *grib_yyin = (FILE *) 0, *grib_yyout = (FILE *) 0; +FILE *grib_yyin = NULL, *grib_yyout = NULL; typedef int grib_yy_state_type; extern int grib_yylineno; - int grib_yylineno = 1; extern char *grib_yytext; +#ifdef grib_yytext_ptr +#undef grib_yytext_ptr +#endif #define grib_yytext_ptr grib_yytext -static grib_yy_state_type grib_yy_get_previous_state (void ); -static grib_yy_state_type grib_yy_try_NUL_trans (grib_yy_state_type current_state ); -static int grib_yy_get_next_buffer (void ); -static void grib_yy_fatal_error (grib_yyconst char msg[] ); +static grib_yy_state_type grib_yy_get_previous_state ( void ); +static grib_yy_state_type grib_yy_try_NUL_trans ( grib_yy_state_type current_state ); +static int grib_yy_get_next_buffer ( void ); +static void grib_yynoreturn grib_yy_fatal_error ( const char* msg ); /* Done after the current pattern has been matched and before the * corresponding action - sets up grib_yytext. @@ -360,7 +352,6 @@ static void grib_yy_fatal_error (grib_yyconst char msg[] ); (grib_yy_hold_char) = *grib_yy_cp; \ *grib_yy_cp = '\0'; \ (grib_yy_c_buf_p) = grib_yy_cp; - #define YY_NUM_RULES 138 #define YY_END_OF_BUFFER 139 /* This struct is not used in this scanner, @@ -370,7 +361,7 @@ struct grib_yy_trans_info flex_int32_t grib_yy_verify; flex_int32_t grib_yy_nxt; }; -static grib_yyconst flex_int16_t grib_yy_accept[798] = +static const flex_int16_t grib_yy_accept[798] = { 0, 135, 135, 139, 137, 135, 136, 12, 126, 134, 137, 137, 137, 137, 129, 5, 137, 3, 128, 128, 128, @@ -462,7 +453,7 @@ static grib_yyconst flex_int16_t grib_yy_accept[798] = } ; -static grib_yyconst flex_int32_t grib_yy_ec[256] = +static const YY_CHAR grib_yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, @@ -494,7 +485,7 @@ static grib_yyconst flex_int32_t grib_yy_ec[256] = 1, 1, 1, 1, 1 } ; -static grib_yyconst flex_int32_t grib_yy_meta[57] = +static const YY_CHAR grib_yy_meta[57] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 6, 6, 6, 6, 6, 6, 1, @@ -504,7 +495,7 @@ static grib_yyconst flex_int32_t grib_yy_meta[57] = 8, 8, 8, 8, 1, 1 } ; -static grib_yyconst flex_int16_t grib_yy_base[828] = +static const flex_int16_t grib_yy_base[828] = { 0, 0, 0, 1944, 1945, 1941, 1945, 1921, 1945, 44, 1934, 51, 58, 0, 69, 68, 1919, 1918, 81, 96, 76, @@ -599,7 +590,7 @@ static grib_yyconst flex_int16_t grib_yy_base[828] = 1876, 1880, 1888, 1893, 1894, 1902, 1903 } ; -static grib_yyconst flex_int16_t grib_yy_def[828] = +static const flex_int16_t grib_yy_def[828] = { 0, 797, 1, 797, 797, 797, 797, 797, 797, 797, 797, 797, 797, 798, 799, 797, 797, 797, 800, 800, 19, @@ -694,7 +685,7 @@ static grib_yyconst flex_int16_t grib_yy_def[828] = 797, 797, 797, 797, 797, 797, 797 } ; -static grib_yyconst flex_int16_t grib_yy_nxt[2002] = +static const flex_int16_t grib_yy_nxt[2002] = { 0, 4, 5, 6, 7, 8, 9, 10, 8, 11, 11, 12, 13, 14, 14, 14, 14, 14, 14, 14, 15, @@ -919,7 +910,7 @@ static grib_yyconst flex_int16_t grib_yy_nxt[2002] = 797 } ; -static grib_yyconst flex_int16_t grib_yy_chk[2002] = +static const flex_int16_t grib_yy_chk[2002] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -1187,7 +1178,7 @@ flex buffer optimization break the includes. #define YY_INPUT(buf,result,max_size) \ { \ - int c = getc(grib_yyin); \ + int c = getc(grib_yyin); (void)max_size; \ result = (c == EOF) ? YY_NULL : (buf[0] = c, 1); \ } @@ -1207,7 +1198,8 @@ void _grib_ignore_grib_yyunput_unused_error() { grib_yyunput(0,0); } #define GET_INPUT input #endif -#line 1211 "gribl.c" +#line 1201 "gribl.c" +#line 1202 "gribl.c" #define INITIAL 0 @@ -1223,36 +1215,36 @@ void _grib_ignore_grib_yyunput_unused_error() { grib_yyunput(0,0); } #define YY_EXTRA_TYPE void * #endif -static int grib_yy_init_globals (void ); +static int grib_yy_init_globals ( void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int grib_yylex_destroy (void ); +int grib_yylex_destroy ( void ); -int grib_yyget_debug (void ); +int grib_yyget_debug ( void ); -void grib_yyset_debug (int debug_flag ); +void grib_yyset_debug ( int debug_flag ); -YY_EXTRA_TYPE grib_yyget_extra (void ); +YY_EXTRA_TYPE grib_yyget_extra ( void ); -void grib_yyset_extra (YY_EXTRA_TYPE user_defined ); +void grib_yyset_extra ( YY_EXTRA_TYPE user_defined ); -FILE *grib_yyget_in (void ); +FILE *grib_yyget_in ( void ); -void grib_yyset_in (FILE * in_str ); +void grib_yyset_in ( FILE * _in_str ); -FILE *grib_yyget_out (void ); +FILE *grib_yyget_out ( void ); -void grib_yyset_out (FILE * out_str ); +void grib_yyset_out ( FILE * _out_str ); -grib_yy_size_t grib_yyget_leng (void ); + int grib_yyget_leng ( void ); -char *grib_yyget_text (void ); +char *grib_yyget_text ( void ); -int grib_yyget_lineno (void ); +int grib_yyget_lineno ( void ); -void grib_yyset_lineno (int line_number ); +void grib_yyset_lineno ( int _line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -1260,35 +1252,43 @@ void grib_yyset_lineno (int line_number ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int grib_yywrap (void ); +extern "C" int grib_yywrap ( void ); #else -extern int grib_yywrap (void ); +extern int grib_yywrap ( void ); #endif #endif - void grib_yyunput (int c,char *buf_ptr ); +#ifndef YY_NO_UNPUT + void grib_yyunput ( int c, char *buf_ptr ); + +#endif + #ifndef grib_yytext_ptr -static void grib_yy_flex_strncpy (char *,grib_yyconst char *,int ); +static void grib_yy_flex_strncpy ( char *, const char *, int ); #endif #ifdef YY_NEED_STRLEN -static int grib_yy_flex_strlen (grib_yyconst char * ); +static int grib_yy_flex_strlen ( const char * ); #endif #ifndef YY_NO_INPUT - #ifdef __cplusplus -static int grib_yyinput (void ); +static int grib_yyinput ( void ); #else -static int input (void ); +static int input ( void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -1296,7 +1296,7 @@ static int input (void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( grib_yytext, grib_yyleng, 1, grib_yyout )) {} } while (0) +#define ECHO do { if (fwrite( grib_yytext, (size_t) grib_yyleng, 1, grib_yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1307,7 +1307,7 @@ static int input (void ); if ( YY_CURRENT_BUFFER_LVALUE->grib_yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + int n; \ for ( n = 0; n < max_size && \ (c = getc( grib_yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -1320,7 +1320,7 @@ static int input (void ); else \ { \ errno=0; \ - while ( (result = (int) fread(buf, 1, max_size, grib_yyin))==0 && ferror(grib_yyin)) \ + while ( (result = (int) fread(buf, 1, (grib_yy_size_t) max_size, grib_yyin)) == 0 && ferror(grib_yyin)) \ { \ if( errno != EINTR) \ { \ @@ -1375,7 +1375,7 @@ extern int grib_yylex (void); /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK break; +#define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ @@ -1385,16 +1385,10 @@ extern int grib_yylex (void); */ YY_DECL { - register grib_yy_state_type grib_yy_current_state; - register char *grib_yy_cp, *grib_yy_bp; - register int grib_yy_act; + grib_yy_state_type grib_yy_current_state; + char *grib_yy_cp, *grib_yy_bp; + int grib_yy_act; -#line 71 "gribl.l" - - - -#line 1397 "gribl.c" - if ( !(grib_yy_init) ) { (grib_yy_init) = 1; @@ -1415,13 +1409,20 @@ YY_DECL if ( ! YY_CURRENT_BUFFER ) { grib_yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - grib_yy_create_buffer(grib_yyin,YY_BUF_SIZE ); + grib_yy_create_buffer( grib_yyin, YY_BUF_SIZE ); } - grib_yy_load_buffer_state( ); + grib_yy_load_buffer_state( ); } - while ( 1 ) /* loops until end-of-file is reached */ + { +#line 71 "gribl.l" + + + +#line 1423 "gribl.c" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { grib_yy_cp = (grib_yy_c_buf_p); @@ -1437,7 +1438,7 @@ YY_DECL grib_yy_match: do { - register YY_CHAR grib_yy_c = grib_yy_ec[YY_SC_TO_UI(*grib_yy_cp)]; + YY_CHAR grib_yy_c = grib_yy_ec[YY_SC_TO_UI(*grib_yy_cp)] ; if ( grib_yy_accept[grib_yy_current_state] ) { (grib_yy_last_accepting_state) = grib_yy_current_state; @@ -1447,9 +1448,9 @@ YY_DECL { grib_yy_current_state = (int) grib_yy_def[grib_yy_current_state]; if ( grib_yy_current_state >= 798 ) - grib_yy_c = grib_yy_meta[(unsigned int) grib_yy_c]; + grib_yy_c = grib_yy_meta[grib_yy_c]; } - grib_yy_current_state = grib_yy_nxt[grib_yy_base[grib_yy_current_state] + (flex_int16_t) grib_yy_c]; + grib_yy_current_state = grib_yy_nxt[grib_yy_base[grib_yy_current_state] + grib_yy_c]; ++grib_yy_cp; } while ( grib_yy_base[grib_yy_current_state] != 1945 ); @@ -2293,7 +2294,7 @@ case YY_STATE_EOF(INITIAL): { (grib_yy_did_buffer_switch_on_eof) = 0; - if ( grib_yywrap( ) ) + if ( grib_yywrap( ) ) { /* Note: because we've taken care in * grib_yy_get_next_buffer() to have set up @@ -2346,6 +2347,7 @@ case YY_STATE_EOF(INITIAL): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of grib_yylex */ /* grib_yy_get_next_buffer - try to read in a new buffer @@ -2357,9 +2359,9 @@ case YY_STATE_EOF(INITIAL): */ static int grib_yy_get_next_buffer (void) { - register char *dest = YY_CURRENT_BUFFER_LVALUE->grib_yy_ch_buf; - register char *source = (grib_yytext_ptr); - register int number_to_move, i; + char *dest = YY_CURRENT_BUFFER_LVALUE->grib_yy_ch_buf; + char *source = (grib_yytext_ptr); + int number_to_move, i; int ret_val; if ( (grib_yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->grib_yy_ch_buf[(grib_yy_n_chars) + 1] ) @@ -2388,7 +2390,7 @@ static int grib_yy_get_next_buffer (void) /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) ((grib_yy_c_buf_p) - (grib_yytext_ptr)) - 1; + number_to_move = (int) ((grib_yy_c_buf_p) - (grib_yytext_ptr) - 1); for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -2415,7 +2417,7 @@ static int grib_yy_get_next_buffer (void) if ( b->grib_yy_is_our_buffer ) { - grib_yy_size_t new_size = b->grib_yy_buf_size * 2; + int new_size = b->grib_yy_buf_size * 2; if ( new_size <= 0 ) b->grib_yy_buf_size += b->grib_yy_buf_size / 8; @@ -2424,11 +2426,12 @@ static int grib_yy_get_next_buffer (void) b->grib_yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - grib_yyrealloc((void *) b->grib_yy_ch_buf,b->grib_yy_buf_size + 2 ); + grib_yyrealloc( (void *) b->grib_yy_ch_buf, + (grib_yy_size_t) (b->grib_yy_buf_size + 2) ); } else /* Can't grow it, we don't own it. */ - b->grib_yy_ch_buf = 0; + b->grib_yy_ch_buf = NULL; if ( ! b->grib_yy_ch_buf ) YY_FATAL_ERROR( @@ -2436,7 +2439,7 @@ static int grib_yy_get_next_buffer (void) (grib_yy_c_buf_p) = &b->grib_yy_ch_buf[grib_yy_c_buf_p_offset]; - num_to_read = (int) YY_CURRENT_BUFFER_LVALUE->grib_yy_buf_size - + num_to_read = YY_CURRENT_BUFFER_LVALUE->grib_yy_buf_size - number_to_move - 1; } @@ -2456,7 +2459,7 @@ static int grib_yy_get_next_buffer (void) if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - grib_yyrestart(grib_yyin ); + grib_yyrestart( grib_yyin ); } else @@ -2470,12 +2473,15 @@ static int grib_yy_get_next_buffer (void) else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((int) ((grib_yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->grib_yy_buf_size) { + if (((grib_yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->grib_yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ int new_size = (grib_yy_n_chars) + number_to_move + ((grib_yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->grib_yy_ch_buf = (char *) grib_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->grib_yy_ch_buf,new_size ); + YY_CURRENT_BUFFER_LVALUE->grib_yy_ch_buf = (char *) grib_yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->grib_yy_ch_buf, (grib_yy_size_t) new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->grib_yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in grib_yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->grib_yy_buf_size = (int) (new_size - 2); } (grib_yy_n_chars) += number_to_move; @@ -2491,14 +2497,14 @@ static int grib_yy_get_next_buffer (void) static grib_yy_state_type grib_yy_get_previous_state (void) { - register grib_yy_state_type grib_yy_current_state; - register char *grib_yy_cp; + grib_yy_state_type grib_yy_current_state; + char *grib_yy_cp; grib_yy_current_state = (grib_yy_start); for ( grib_yy_cp = (grib_yytext_ptr) + YY_MORE_ADJ; grib_yy_cp < (grib_yy_c_buf_p); ++grib_yy_cp ) { - register YY_CHAR grib_yy_c = (*grib_yy_cp ? grib_yy_ec[YY_SC_TO_UI(*grib_yy_cp)] : 1); + YY_CHAR grib_yy_c = (*grib_yy_cp ? grib_yy_ec[YY_SC_TO_UI(*grib_yy_cp)] : 1); if ( grib_yy_accept[grib_yy_current_state] ) { (grib_yy_last_accepting_state) = grib_yy_current_state; @@ -2508,9 +2514,9 @@ static int grib_yy_get_next_buffer (void) { grib_yy_current_state = (int) grib_yy_def[grib_yy_current_state]; if ( grib_yy_current_state >= 798 ) - grib_yy_c = grib_yy_meta[(unsigned int) grib_yy_c]; + grib_yy_c = grib_yy_meta[grib_yy_c]; } - grib_yy_current_state = grib_yy_nxt[grib_yy_base[grib_yy_current_state] + (flex_int16_t) grib_yy_c]; + grib_yy_current_state = grib_yy_nxt[grib_yy_base[grib_yy_current_state] + grib_yy_c]; } return grib_yy_current_state; @@ -2523,10 +2529,10 @@ static int grib_yy_get_next_buffer (void) */ static grib_yy_state_type grib_yy_try_NUL_trans (grib_yy_state_type grib_yy_current_state ) { - register int grib_yy_is_jam; - register char *grib_yy_cp = (grib_yy_c_buf_p); + int grib_yy_is_jam; + char *grib_yy_cp = (grib_yy_c_buf_p); - register YY_CHAR grib_yy_c = 1; + YY_CHAR grib_yy_c = 1; if ( grib_yy_accept[grib_yy_current_state] ) { (grib_yy_last_accepting_state) = grib_yy_current_state; @@ -2536,17 +2542,19 @@ static int grib_yy_get_next_buffer (void) { grib_yy_current_state = (int) grib_yy_def[grib_yy_current_state]; if ( grib_yy_current_state >= 798 ) - grib_yy_c = grib_yy_meta[(unsigned int) grib_yy_c]; + grib_yy_c = grib_yy_meta[grib_yy_c]; } - grib_yy_current_state = grib_yy_nxt[grib_yy_base[grib_yy_current_state] + (flex_int16_t) grib_yy_c]; + grib_yy_current_state = grib_yy_nxt[grib_yy_base[grib_yy_current_state] + grib_yy_c]; grib_yy_is_jam = (grib_yy_current_state == 797); return grib_yy_is_jam ? 0 : grib_yy_current_state; } - void grib_yyunput (int c, register char * grib_yy_bp ) +#ifndef YY_NO_UNPUT + + void grib_yyunput (int c, char * grib_yy_bp ) { - register char *grib_yy_cp; + char *grib_yy_cp; grib_yy_cp = (grib_yy_c_buf_p); @@ -2556,10 +2564,10 @@ static int grib_yy_get_next_buffer (void) if ( grib_yy_cp < YY_CURRENT_BUFFER_LVALUE->grib_yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register int number_to_move = (grib_yy_n_chars) + 2; - register char *dest = &YY_CURRENT_BUFFER_LVALUE->grib_yy_ch_buf[ + int number_to_move = (grib_yy_n_chars) + 2; + char *dest = &YY_CURRENT_BUFFER_LVALUE->grib_yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->grib_yy_buf_size + 2]; - register char *source = + char *source = &YY_CURRENT_BUFFER_LVALUE->grib_yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->grib_yy_ch_buf ) @@ -2581,6 +2589,8 @@ static int grib_yy_get_next_buffer (void) (grib_yy_c_buf_p) = grib_yy_cp; } +#endif + #ifndef YY_NO_INPUT #ifdef __cplusplus static int grib_yyinput (void) @@ -2605,7 +2615,7 @@ static int grib_yy_get_next_buffer (void) else { /* need more input */ - grib_yy_size_t offset = (grib_yy_c_buf_p) - (grib_yytext_ptr); + int offset = (int) ((grib_yy_c_buf_p) - (grib_yytext_ptr)); ++(grib_yy_c_buf_p); switch ( grib_yy_get_next_buffer( ) ) @@ -2622,14 +2632,14 @@ static int grib_yy_get_next_buffer (void) */ /* Reset buffer status. */ - grib_yyrestart(grib_yyin ); + grib_yyrestart( grib_yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { - if ( grib_yywrap( ) ) - return EOF; + if ( grib_yywrap( ) ) + return 0; if ( ! (grib_yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -2666,11 +2676,11 @@ static int grib_yy_get_next_buffer (void) if ( ! YY_CURRENT_BUFFER ){ grib_yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - grib_yy_create_buffer(grib_yyin,YY_BUF_SIZE ); + grib_yy_create_buffer( grib_yyin, YY_BUF_SIZE ); } - grib_yy_init_buffer(YY_CURRENT_BUFFER,input_file ); - grib_yy_load_buffer_state( ); + grib_yy_init_buffer( YY_CURRENT_BUFFER, input_file ); + grib_yy_load_buffer_state( ); } /** Switch to a different input buffer. @@ -2698,7 +2708,7 @@ static int grib_yy_get_next_buffer (void) } YY_CURRENT_BUFFER_LVALUE = new_buffer; - grib_yy_load_buffer_state( ); + grib_yy_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (grib_yywrap()) processing, but the only time this flag @@ -2726,7 +2736,7 @@ static void grib_yy_load_buffer_state (void) { YY_BUFFER_STATE b; - b = (YY_BUFFER_STATE) grib_yyalloc(sizeof( struct grib_yy_buffer_state ) ); + b = (YY_BUFFER_STATE) grib_yyalloc( sizeof( struct grib_yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in grib_yy_create_buffer()" ); @@ -2735,13 +2745,13 @@ static void grib_yy_load_buffer_state (void) /* grib_yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->grib_yy_ch_buf = (char *) grib_yyalloc(b->grib_yy_buf_size + 2 ); + b->grib_yy_ch_buf = (char *) grib_yyalloc( (grib_yy_size_t) (b->grib_yy_buf_size + 2) ); if ( ! b->grib_yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in grib_yy_create_buffer()" ); b->grib_yy_is_our_buffer = 1; - grib_yy_init_buffer(b,file ); + grib_yy_init_buffer( b, file ); return b; } @@ -2760,9 +2770,9 @@ static void grib_yy_load_buffer_state (void) YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->grib_yy_is_our_buffer ) - grib_yyfree((void *) b->grib_yy_ch_buf ); + grib_yyfree( (void *) b->grib_yy_ch_buf ); - grib_yyfree((void *) b ); + grib_yyfree( (void *) b ); } /* Initializes or reinitializes a buffer. @@ -2774,7 +2784,7 @@ static void grib_yy_load_buffer_state (void) { int oerrno = errno; - grib_yy_flush_buffer(b ); + grib_yy_flush_buffer( b ); b->grib_yy_input_file = file; b->grib_yy_fill_buffer = 1; @@ -2817,7 +2827,7 @@ static void grib_yy_load_buffer_state (void) b->grib_yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) - grib_yy_load_buffer_state( ); + grib_yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes @@ -2848,7 +2858,7 @@ void grib_yypush_buffer_state (YY_BUFFER_STATE new_buffer ) YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from grib_yy_switch_to_buffer. */ - grib_yy_load_buffer_state( ); + grib_yy_load_buffer_state( ); (grib_yy_did_buffer_switch_on_eof) = 1; } @@ -2867,7 +2877,7 @@ void grib_yypop_buffer_state (void) --(grib_yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { - grib_yy_load_buffer_state( ); + grib_yy_load_buffer_state( ); (grib_yy_did_buffer_switch_on_eof) = 1; } } @@ -2885,15 +2895,15 @@ static void grib_yyensure_buffer_stack (void) * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ - num_to_alloc = 1; + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ (grib_yy_buffer_stack) = (struct grib_yy_buffer_state**)grib_yyalloc (num_to_alloc * sizeof(struct grib_yy_buffer_state*) ); if ( ! (grib_yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in grib_yyensure_buffer_stack()" ); - + memset((grib_yy_buffer_stack), 0, num_to_alloc * sizeof(struct grib_yy_buffer_state*)); - + (grib_yy_buffer_stack_max) = num_to_alloc; (grib_yy_buffer_stack_top) = 0; return; @@ -2902,7 +2912,7 @@ static void grib_yyensure_buffer_stack (void) if ((grib_yy_buffer_stack_top) >= ((grib_yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; + grib_yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = (grib_yy_buffer_stack_max) + grow_size; (grib_yy_buffer_stack) = (struct grib_yy_buffer_state**)grib_yyrealloc @@ -2922,7 +2932,7 @@ static void grib_yyensure_buffer_stack (void) * @param base the character buffer * @param size the size in bytes of the character buffer * - * @return the newly allocated buffer state object. + * @return the newly allocated buffer state object. */ YY_BUFFER_STATE grib_yy_scan_buffer (char * base, grib_yy_size_t size ) { @@ -2932,23 +2942,23 @@ YY_BUFFER_STATE grib_yy_scan_buffer (char * base, grib_yy_size_t size ) base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ - return 0; + return NULL; - b = (YY_BUFFER_STATE) grib_yyalloc(sizeof( struct grib_yy_buffer_state ) ); + b = (YY_BUFFER_STATE) grib_yyalloc( sizeof( struct grib_yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in grib_yy_scan_buffer()" ); - b->grib_yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->grib_yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ b->grib_yy_buf_pos = b->grib_yy_ch_buf = base; b->grib_yy_is_our_buffer = 0; - b->grib_yy_input_file = 0; + b->grib_yy_input_file = NULL; b->grib_yy_n_chars = b->grib_yy_buf_size; b->grib_yy_is_interactive = 0; b->grib_yy_at_bol = 1; b->grib_yy_fill_buffer = 0; b->grib_yy_buffer_status = YY_BUFFER_NEW; - grib_yy_switch_to_buffer(b ); + grib_yy_switch_to_buffer( b ); return b; } @@ -2961,10 +2971,10 @@ YY_BUFFER_STATE grib_yy_scan_buffer (char * base, grib_yy_size_t size ) * @note If you want to scan bytes that may contain NUL values, then use * grib_yy_scan_bytes() instead. */ -YY_BUFFER_STATE grib_yy_scan_string (grib_yyconst char * grib_yystr ) +YY_BUFFER_STATE grib_yy_scan_string (const char * grib_yystr ) { - return grib_yy_scan_bytes(grib_yystr,(int) strlen(grib_yystr) ); + return grib_yy_scan_bytes( grib_yystr, (int) strlen(grib_yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to grib_yylex() will @@ -2974,7 +2984,7 @@ YY_BUFFER_STATE grib_yy_scan_string (grib_yyconst char * grib_yystr ) * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE grib_yy_scan_bytes (grib_yyconst char * grib_yybytes, grib_yy_size_t _grib_yybytes_len ) +YY_BUFFER_STATE grib_yy_scan_bytes (const char * grib_yybytes, int _grib_yybytes_len ) { YY_BUFFER_STATE b; char *buf; @@ -2982,8 +2992,8 @@ YY_BUFFER_STATE grib_yy_scan_bytes (grib_yyconst char * grib_yybytes, grib_yy_s int i; /* Get memory for full buffer, including space for trailing EOB's. */ - n = (grib_yy_size_t) _grib_yybytes_len + 2; - buf = (char *) grib_yyalloc(n ); + n = (grib_yy_size_t) (_grib_yybytes_len + 2); + buf = (char *) grib_yyalloc( n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in grib_yy_scan_bytes()" ); @@ -2992,7 +3002,7 @@ YY_BUFFER_STATE grib_yy_scan_bytes (grib_yyconst char * grib_yybytes, grib_yy_s buf[_grib_yybytes_len] = buf[_grib_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - b = grib_yy_scan_buffer(buf,n ); + b = grib_yy_scan_buffer( buf, n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in grib_yy_scan_bytes()" ); @@ -3008,9 +3018,9 @@ YY_BUFFER_STATE grib_yy_scan_bytes (grib_yyconst char * grib_yybytes, grib_yy_s #define YY_EXIT_FAILURE 2 #endif -static void grib_yy_fatal_error (grib_yyconst char* msg ) +static void grib_yynoreturn grib_yy_fatal_error (const char* msg ) { - (void) fprintf( stderr, "%s\n", msg ); + fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -3038,7 +3048,7 @@ static void grib_yy_fatal_error (grib_yyconst char* msg ) */ int grib_yyget_lineno (void) { - + return grib_yylineno; } @@ -3061,7 +3071,7 @@ FILE *grib_yyget_out (void) /** Get the length of the current token. * */ -grib_yy_size_t grib_yyget_leng (void) +int grib_yyget_leng (void) { return grib_yyleng; } @@ -3076,29 +3086,29 @@ char *grib_yyget_text (void) } /** Set the current line number. - * @param line_number + * @param _line_number line number * */ -void grib_yyset_lineno (int line_number ) +void grib_yyset_lineno (int _line_number ) { - grib_yylineno = line_number; + grib_yylineno = _line_number; } /** Set the input stream. This does not discard the current * input buffer. - * @param in_str A readable stream. + * @param _in_str A readable stream. * * @see grib_yy_switch_to_buffer */ -void grib_yyset_in (FILE * in_str ) +void grib_yyset_in (FILE * _in_str ) { - grib_yyin = in_str ; + grib_yyin = _in_str ; } -void grib_yyset_out (FILE * out_str ) +void grib_yyset_out (FILE * _out_str ) { - grib_yyout = out_str ; + grib_yyout = _out_str ; } int grib_yyget_debug (void) @@ -3106,9 +3116,9 @@ int grib_yyget_debug (void) return grib_yy_flex_debug; } -void grib_yyset_debug (int bdebug ) +void grib_yyset_debug (int _bdebug ) { - grib_yy_flex_debug = bdebug ; + grib_yy_flex_debug = _bdebug ; } static int grib_yy_init_globals (void) @@ -3117,10 +3127,10 @@ static int grib_yy_init_globals (void) * This function is called from grib_yylex_destroy(), so don't allocate here. */ - (grib_yy_buffer_stack) = 0; + (grib_yy_buffer_stack) = NULL; (grib_yy_buffer_stack_top) = 0; (grib_yy_buffer_stack_max) = 0; - (grib_yy_c_buf_p) = (char *) 0; + (grib_yy_c_buf_p) = NULL; (grib_yy_init) = 0; (grib_yy_start) = 0; @@ -3129,8 +3139,8 @@ static int grib_yy_init_globals (void) grib_yyin = stdin; grib_yyout = stdout; #else - grib_yyin = (FILE *) 0; - grib_yyout = (FILE *) 0; + grib_yyin = NULL; + grib_yyout = NULL; #endif /* For future reference: Set errno on error, since we are called by @@ -3145,7 +3155,7 @@ int grib_yylex_destroy (void) /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ - grib_yy_delete_buffer(YY_CURRENT_BUFFER ); + grib_yy_delete_buffer( YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; grib_yypop_buffer_state(); } @@ -3166,18 +3176,19 @@ int grib_yylex_destroy (void) */ #ifndef grib_yytext_ptr -static void grib_yy_flex_strncpy (char* s1, grib_yyconst char * s2, int n ) +static void grib_yy_flex_strncpy (char* s1, const char * s2, int n ) { - register int i; + + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN -static int grib_yy_flex_strlen (grib_yyconst char * s ) +static int grib_yy_flex_strlen (const char * s ) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; @@ -3187,11 +3198,12 @@ static int grib_yy_flex_strlen (grib_yyconst char * s ) void *grib_yyalloc (grib_yy_size_t size ) { - return (void *) malloc( size ); + return malloc(size); } void *grib_yyrealloc (void * ptr, grib_yy_size_t size ) { + /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -3199,12 +3211,12 @@ void *grib_yyrealloc (void * ptr, grib_yy_size_t size ) * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ - return (void *) realloc( (char *) ptr, size ); + return realloc(ptr, size); } void grib_yyfree (void * ptr ) { - free( (char *) ptr ); /* see grib_yyrealloc() for (char *) cast */ + free( (char *) ptr ); /* see grib_yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "grib_yytables" @@ -3213,4 +3225,3 @@ void grib_yyfree (void * ptr ) - diff --git a/src/grib_nearest_class_polar_stereographic.c b/src/grib_nearest_class_polar_stereographic.c index 28077d4fc..e3f909e97 100644 --- a/src/grib_nearest_class_polar_stereographic.c +++ b/src/grib_nearest_class_polar_stereographic.c @@ -162,10 +162,7 @@ static int find(grib_nearest* nearest, grib_handle* h, /* array of candidates for nearest neighbours */ PointStore* neighbours = NULL; - while (inlon < 0) - inlon += 360; - while (inlon > 360) - inlon -= 360; + inlon = normalise_longitude_in_degrees(inlon); if ((ret = grib_get_size(h, self->values_key, &nvalues)) != GRIB_SUCCESS) return ret; diff --git a/src/grib_nearest_class_reduced.c b/src/grib_nearest_class_reduced.c index cbea92f0f..7467ea0cc 100644 --- a/src/grib_nearest_class_reduced.c +++ b/src/grib_nearest_class_reduced.c @@ -230,10 +230,7 @@ static int find(grib_nearest* nearest, grib_handle* h, long row_count, ilon_first, ilon_last; if (self->global) { - while (inlon < 0) - inlon += 360; - while (inlon > 360) - inlon -= 360; + inlon = normalise_longitude_in_degrees(inlon); } else { /* TODO: Experimental */ diff --git a/src/grib_query.c b/src/grib_query.c index 9f0f13774..662e75c41 100644 --- a/src/grib_query.c +++ b/src/grib_query.c @@ -368,8 +368,11 @@ static void search_from_accessors_list(grib_accessors_list* al, grib_accessors_l { char attribute_name[200] = {0,}; grib_accessor* accessor_result = 0; + grib_context* c = al->accessor->context; + int doFree = 1; - char* accessor_name = grib_split_name_attribute(al->accessor->context, name, attribute_name); + char* accessor_name = grib_split_name_attribute(c, name, attribute_name); + if (*attribute_name == 0) doFree = 0; while (al && al != end && al->accessor) { if (grib_inline_strcmp(al->accessor->name, accessor_name) == 0) { @@ -398,6 +401,7 @@ static void search_from_accessors_list(grib_accessors_list* al, grib_accessors_l } } } + if (doFree) grib_context_free(c, accessor_name); } static void search_accessors_list_by_condition(grib_accessors_list* al, const char* name, codes_condition* condition, grib_accessors_list* result) diff --git a/src/grib_yacc.c b/src/grib_yacc.c index a5fc9446d..980c00fcf 100644 --- a/src/grib_yacc.c +++ b/src/grib_yacc.c @@ -1,19 +1,20 @@ -/* A Bison parser, made by GNU Bison 2.7. */ +/* A Bison parser, made by GNU Bison 3.5.4. */ /* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation, + Inc. + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -26,7 +27,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -40,11 +41,14 @@ define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ +/* Undocumented macros, especially those whose name start with YY_, + are private implementation details. Do not rely on them. */ + /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.7" +#define YYBISON_VERSION "3.5.4" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -61,18 +65,17 @@ -/* Copy the first part of user declarations. */ -/* Line 371 of yacc.c */ +/* First part of user prologue. */ #line 12 "griby.y" #include "grib_api_internal.h" /* #include "grib_parser.h" */ -extern int grib_yylex(); +extern int grib_yylex(void); extern int grib_yyerror(const char*); extern int grib_yylineno; -extern char* file_being_parsed(); +extern char* file_being_parsed(void); extern grib_action* grib_parser_all_actions; extern grib_concept_value* grib_parser_concept; @@ -90,14 +93,26 @@ static grib_hash_array_value *_reverse_hash_array(grib_hash_array_value *r,grib_ -/* Line 371 of yacc.c */ -#line 95 "y.tab.c" +#line 97 "y.tab.c" -# ifndef YY_NULL -# if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULL nullptr +# ifndef YY_CAST +# ifdef __cplusplus +# define YY_CAST(Type, Val) static_cast (Val) +# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) +# else +# define YY_CAST(Type, Val) ((Type) (Val)) +# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) +# endif +# endif +# ifndef YY_NULLPTR +# if defined __cplusplus +# if 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif # else -# define YY_NULL 0 +# define YY_NULLPTR ((void*)0) # endif # endif @@ -109,11 +124,11 @@ static grib_hash_array_value *_reverse_hash_array(grib_hash_array_value *r,grib_ # define YYERROR_VERBOSE 0 #endif -/* In a future release of Bison, this section will be replaced - by #include "y.tab.h". */ +/* Use api.header.include to #include this header + instead of duplicating it here. */ #ifndef YY_YY_Y_TAB_H_INCLUDED # define YY_YY_Y_TAB_H_INCLUDED -/* Enabling traces. */ +/* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif @@ -121,137 +136,136 @@ static grib_hash_array_value *_reverse_hash_array(grib_hash_array_value *r,grib_ extern int grib_yydebug; #endif -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum grib_yytokentype { - LOWERCASE = 258, - IF = 259, - IF_TRANSIENT = 260, - ELSE = 261, - END = 262, - CLOSE = 263, - UNSIGNED = 264, - TEMPLATE = 265, - TEMPLATE_NOFAIL = 266, - TRIGGER = 267, - ASCII = 268, - GROUP = 269, - NON_ALPHA = 270, - KSEC1EXPVER = 271, - LABEL = 272, - LIST = 273, - IS_IN_LIST = 274, - IS_IN_DICT = 275, - IS_INTEGER = 276, - TO_INTEGER = 277, - TO_STRING = 278, - SEX2DEC = 279, - WHILE = 280, - IBMFLOAT = 281, - SIGNED = 282, - UINT8 = 283, - INT8 = 284, - UINT16 = 285, - INT16 = 286, - UINT16_LITTLE_ENDIAN = 287, - INT16_LITTLE_ENDIAN = 288, - UINT32 = 289, - INT32 = 290, - UINT32_LITTLE_ENDIAN = 291, - INT32_LITTLE_ENDIAN = 292, - UINT64 = 293, - INT64 = 294, - UINT64_LITTLE_ENDIAN = 295, - INT64_LITTLE_ENDIAN = 296, - BLOB = 297, - BYTE = 298, - CODETABLE = 299, - SMART_TABLE = 300, - DICTIONARY = 301, - COMPLEX_CODETABLE = 302, - LOOKUP = 303, - ALIAS = 304, - UNALIAS = 305, - META = 306, - POS = 307, - INTCONST = 308, - TRANS = 309, - FLAGBIT = 310, - CONCEPT = 311, - GETENV = 312, - HASH_ARRAY = 313, - CONCEPT_NOFAIL = 314, - NIL = 315, - DUMMY = 316, - MODIFY = 317, - READ_ONLY = 318, - STRING_TYPE = 319, - LONG_TYPE = 320, - DOUBLE_TYPE = 321, - NO_COPY = 322, - DUMP = 323, - JSON = 324, - XML = 325, - NO_FAIL = 326, - EDITION_SPECIFIC = 327, - OVERRIDE = 328, - HIDDEN = 329, - CAN_BE_MISSING = 330, - MISSING = 331, - CONSTRAINT = 332, - COPY_OK = 333, - WHEN = 334, - SET = 335, - SET_NOFAIL = 336, - WRITE = 337, - APPEND = 338, - PRINT = 339, - EXPORT = 340, - REMOVE = 341, - RENAME = 342, - SKIP = 343, - PAD = 344, - SECTION_PADDING = 345, - MESSAGE = 346, - MESSAGE_COPY = 347, - PADTO = 348, - PADTOEVEN = 349, - PADTOMULTIPLE = 350, - G1_HALF_BYTE = 351, - G1_MESSAGE_LENGTH = 352, - G1_SECTION4_LENGTH = 353, - SECTION_LENGTH = 354, - LENGTH = 355, - FLAG = 356, - ITERATOR = 357, - NEAREST = 358, - BOX = 359, - KSEC = 360, - ASSERT = 361, - SUBSTR = 362, - CASE = 363, - SWITCH = 364, - DEFAULT = 365, - EQ = 366, - NE = 367, - GE = 368, - LE = 369, - LT = 370, - GT = 371, - BIT = 372, - BITOFF = 373, - AND = 374, - OR = 375, - NOT = 376, - IS = 377, - IDENT = 378, - STRING = 379, - INTEGER = 380, - FLOAT = 381 - }; + enum grib_yytokentype + { + LOWERCASE = 258, + IF = 259, + IF_TRANSIENT = 260, + ELSE = 261, + END = 262, + CLOSE = 263, + UNSIGNED = 264, + TEMPLATE = 265, + TEMPLATE_NOFAIL = 266, + TRIGGER = 267, + ASCII = 268, + GROUP = 269, + NON_ALPHA = 270, + KSEC1EXPVER = 271, + LABEL = 272, + LIST = 273, + IS_IN_LIST = 274, + IS_IN_DICT = 275, + IS_INTEGER = 276, + TO_INTEGER = 277, + TO_STRING = 278, + SEX2DEC = 279, + WHILE = 280, + IBMFLOAT = 281, + SIGNED = 282, + UINT8 = 283, + INT8 = 284, + UINT16 = 285, + INT16 = 286, + UINT16_LITTLE_ENDIAN = 287, + INT16_LITTLE_ENDIAN = 288, + UINT32 = 289, + INT32 = 290, + UINT32_LITTLE_ENDIAN = 291, + INT32_LITTLE_ENDIAN = 292, + UINT64 = 293, + INT64 = 294, + UINT64_LITTLE_ENDIAN = 295, + INT64_LITTLE_ENDIAN = 296, + BLOB = 297, + BYTE = 298, + CODETABLE = 299, + SMART_TABLE = 300, + DICTIONARY = 301, + COMPLEX_CODETABLE = 302, + LOOKUP = 303, + ALIAS = 304, + UNALIAS = 305, + META = 306, + POS = 307, + INTCONST = 308, + TRANS = 309, + FLAGBIT = 310, + CONCEPT = 311, + GETENV = 312, + HASH_ARRAY = 313, + CONCEPT_NOFAIL = 314, + NIL = 315, + DUMMY = 316, + MODIFY = 317, + READ_ONLY = 318, + STRING_TYPE = 319, + LONG_TYPE = 320, + DOUBLE_TYPE = 321, + NO_COPY = 322, + DUMP = 323, + JSON = 324, + XML = 325, + NO_FAIL = 326, + EDITION_SPECIFIC = 327, + OVERRIDE = 328, + HIDDEN = 329, + CAN_BE_MISSING = 330, + MISSING = 331, + CONSTRAINT = 332, + COPY_OK = 333, + WHEN = 334, + SET = 335, + SET_NOFAIL = 336, + WRITE = 337, + APPEND = 338, + PRINT = 339, + EXPORT = 340, + REMOVE = 341, + RENAME = 342, + SKIP = 343, + PAD = 344, + SECTION_PADDING = 345, + MESSAGE = 346, + MESSAGE_COPY = 347, + PADTO = 348, + PADTOEVEN = 349, + PADTOMULTIPLE = 350, + G1_HALF_BYTE = 351, + G1_MESSAGE_LENGTH = 352, + G1_SECTION4_LENGTH = 353, + SECTION_LENGTH = 354, + LENGTH = 355, + FLAG = 356, + ITERATOR = 357, + NEAREST = 358, + BOX = 359, + KSEC = 360, + ASSERT = 361, + SUBSTR = 362, + CASE = 363, + SWITCH = 364, + DEFAULT = 365, + EQ = 366, + NE = 367, + GE = 368, + LE = 369, + LT = 370, + GT = 371, + BIT = 372, + BITOFF = 373, + AND = 374, + OR = 375, + NOT = 376, + IS = 377, + IDENT = 378, + STRING = 379, + INTEGER = 380, + FLOAT = 381 + }; #endif /* Tokens. */ #define LOWERCASE 258 @@ -379,12 +393,10 @@ extern int grib_yydebug; #define INTEGER 380 #define FLOAT 381 - - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE +union YYSTYPE { -/* Line 387 of yacc.c */ #line 39 "griby.y" char *str; @@ -403,67 +415,96 @@ typedef union YYSTYPE grib_rule *rules; grib_rule_entry *rule_entry; +#line 419 "y.tab.c" -/* Line 387 of yacc.c */ -#line 409 "y.tab.c" -} YYSTYPE; +}; +typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 -# define grib_yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif + extern YYSTYPE grib_yylval; -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int grib_yyparse (void *YYPARSE_PARAM); -#else -int grib_yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus int grib_yyparse (void); -#else -int grib_yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ #endif /* !YY_YY_Y_TAB_H_INCLUDED */ -/* Copy the second part of user declarations. */ -/* Line 390 of yacc.c */ -#line 437 "y.tab.c" #ifdef short # undef short #endif -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 grib_yytype_uint8; -#else -typedef unsigned char grib_yytype_uint8; +/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure + and (if available) are included + so that the code can choose integer types of a good width. */ + +#ifndef __PTRDIFF_MAX__ +# include /* INFRINGES ON USER NAME SPACE */ +# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_STDINT_H +# endif #endif -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 grib_yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +/* Narrow types that promote to a signed type and that can represent a + signed or unsigned integer of at least N bits. In tables they can + save space and decrease cache pressure. Promoting to a signed type + helps avoid bugs in integer arithmetic. */ + +#ifdef __INT_LEAST8_MAX__ +typedef __INT_LEAST8_TYPE__ grib_yytype_int8; +#elif defined YY_STDINT_H +typedef int_least8_t grib_yytype_int8; +#else typedef signed char grib_yytype_int8; +#endif + +#ifdef __INT_LEAST16_MAX__ +typedef __INT_LEAST16_TYPE__ grib_yytype_int16; +#elif defined YY_STDINT_H +typedef int_least16_t grib_yytype_int16; #else -typedef short int grib_yytype_int8; +typedef short grib_yytype_int16; #endif -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 grib_yytype_uint16; +#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ +typedef __UINT_LEAST8_TYPE__ grib_yytype_uint8; +#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ + && UINT_LEAST8_MAX <= INT_MAX) +typedef uint_least8_t grib_yytype_uint8; +#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX +typedef unsigned char grib_yytype_uint8; #else -typedef unsigned short int grib_yytype_uint16; +typedef short grib_yytype_uint8; #endif -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 grib_yytype_int16; +#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ +typedef __UINT_LEAST16_TYPE__ grib_yytype_uint16; +#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ + && UINT_LEAST16_MAX <= INT_MAX) +typedef uint_least16_t grib_yytype_uint16; +#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX +typedef unsigned short grib_yytype_uint16; #else -typedef short int grib_yytype_int16; +typedef int grib_yytype_uint16; +#endif + +#ifndef YYPTRDIFF_T +# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ +# define YYPTRDIFF_T __PTRDIFF_TYPE__ +# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ +# elif defined PTRDIFF_MAX +# ifndef ptrdiff_t +# include /* INFRINGES ON USER NAME SPACE */ +# endif +# define YYPTRDIFF_T ptrdiff_t +# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX +# else +# define YYPTRDIFF_T long +# define YYPTRDIFF_MAXIMUM LONG_MAX +# endif #endif #ifndef YYSIZE_T @@ -471,16 +512,27 @@ typedef short int grib_yytype_int16; # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else -# define YYSIZE_T unsigned int +# define YYSIZE_T unsigned # endif #endif -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) +#define YYSIZE_MAXIMUM \ + YY_CAST (YYPTRDIFF_T, \ + (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ + ? YYPTRDIFF_MAXIMUM \ + : YY_CAST (YYSIZE_T, -1))) + +#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) + +/* Stored state numbers (used for stacks). */ +typedef grib_yytype_int16 grib_yy_state_t; + +/* State numbers in computations. */ +typedef int grib_yy_state_fast_t; #ifndef YY_ # if defined YYENABLE_NLS && YYENABLE_NLS @@ -494,6 +546,22 @@ typedef short int grib_yytype_int16; # endif #endif +#ifndef YY_ATTRIBUTE_PURE +# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define YY_ATTRIBUTE_PURE +# endif +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +# else +# define YY_ATTRIBUTE_UNUSED +# endif +#endif + /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(E) ((void) (E)) @@ -501,24 +569,40 @@ typedef short int grib_yytype_int16; # define YYUSE(E) /* empty */ #endif -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(N) (N) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int grib_yyi) +#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about grib_yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") #else -static int -YYID (grib_yyi) - int grib_yyi; +# define YY_INITIAL_VALUE(Value) Value #endif -{ - return grib_yyi; -} +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif +#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ +# define YY_IGNORE_USELESS_CAST_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") +# define YY_IGNORE_USELESS_CAST_END \ + _Pragma ("GCC diagnostic pop") +#endif +#ifndef YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_END +#endif + + +#define YY_ASSERT(E) ((void) (0 && (E))) + #if ! defined grib_yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -536,8 +620,7 @@ YYID (grib_yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS @@ -549,8 +632,8 @@ YYID (grib_yyi) # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely @@ -566,7 +649,7 @@ YYID (grib_yyi) # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) + && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 @@ -574,15 +657,13 @@ YYID (grib_yyi) # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif @@ -592,22 +673,22 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ #if (! defined grib_yyoverflow \ && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union grib_yyalloc { - grib_yytype_int16 grib_yyss_alloc; + grib_yy_state_t grib_yyss_alloc; YYSTYPE grib_yyvs_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union grib_yyalloc) - 1) +# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union grib_yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ - ((N) * (sizeof (grib_yytype_int16) + sizeof (YYSTYPE)) \ + ((N) * (YYSIZEOF (grib_yy_state_t) + YYSIZEOF (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) # define YYCOPY_NEEDED 1 @@ -617,16 +698,16 @@ union grib_yyalloc elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T grib_yynewbytes; \ - YYCOPY (&grib_yyptr->Stack_alloc, Stack, grib_yysize); \ - Stack = &grib_yyptr->Stack_alloc; \ - grib_yynewbytes = grib_yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - grib_yyptr += grib_yynewbytes / sizeof (*grib_yyptr); \ - } \ - while (YYID (0)) +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYPTRDIFF_T grib_yynewbytes; \ + YYCOPY (&grib_yyptr->Stack_alloc, Stack, grib_yysize); \ + Stack = &grib_yyptr->Stack_alloc; \ + grib_yynewbytes = grib_yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ + grib_yyptr += grib_yynewbytes / YYSIZEOF (*grib_yyptr); \ + } \ + while (0) #endif @@ -636,16 +717,16 @@ union grib_yyalloc # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(Dst, Src, Count) \ - __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) + __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) # else # define YYCOPY(Dst, Src, Count) \ do \ { \ - YYSIZE_T grib_yyi; \ + YYPTRDIFF_T grib_yyi; \ for (grib_yyi = 0; grib_yyi < (Count); grib_yyi++) \ (Dst)[grib_yyi] = (Src)[grib_yyi]; \ } \ - while (YYID (0)) + while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ @@ -661,17 +742,20 @@ union grib_yyalloc #define YYNNTS 50 /* YYNRULES -- Number of rules. */ #define YYNRULES 267 -/* YYNRULES -- Number of states. */ +/* YYNSTATES -- Number of states. */ #define YYNSTATES 903 -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 381 -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? grib_yytranslate[YYX] : YYUNDEFTOK) -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM + as returned by grib_yylex, with out-of-bounds checking. */ +#define YYTRANSLATE(YYX) \ + (0 <= (YYX) && (YYX) <= YYMAXUTOK ? grib_yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by grib_yylex. */ static const grib_yytype_uint8 grib_yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -716,190 +800,8 @@ static const grib_yytype_uint8 grib_yytranslate[] = }; #if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const grib_yytype_uint16 grib_yyprhs[] = -{ - 0, 0, 3, 5, 7, 9, 11, 13, 15, 16, - 18, 22, 24, 28, 30, 34, 36, 40, 42, 45, - 49, 52, 55, 57, 59, 61, 63, 65, 67, 69, - 71, 73, 76, 78, 80, 82, 86, 88, 96, 107, - 115, 126, 134, 139, 147, 155, 163, 171, 176, 184, - 192, 203, 211, 219, 230, 238, 249, 258, 267, 280, - 291, 299, 308, 317, 326, 337, 346, 356, 364, 367, - 370, 375, 380, 385, 390, 395, 400, 405, 410, 415, - 420, 425, 430, 435, 440, 445, 453, 460, 468, 471, - 477, 483, 491, 496, 503, 511, 514, 521, 530, 539, - 543, 549, 555, 561, 567, 574, 578, 582, 586, 590, - 596, 599, 607, 612, 621, 632, 638, 644, 650, 656, - 659, 666, 671, 675, 680, 685, 692, 699, 704, 707, - 709, 715, 720, 723, 725, 731, 736, 741, 744, 750, - 756, 758, 766, 778, 786, 798, 805, 813, 825, 830, - 835, 838, 842, 844, 847, 849, 852, 854, 858, 860, - 862, 864, 866, 868, 870, 872, 874, 876, 878, 880, - 882, 884, 886, 895, 903, 911, 918, 928, 941, 956, - 967, 982, 995, 1004, 1016, 1023, 1033, 1046, 1057, 1072, - 1085, 1094, 1106, 1108, 1111, 1113, 1116, 1123, 1136, 1138, - 1141, 1146, 1157, 1167, 1175, 1181, 1187, 1193, 1199, 1201, - 1204, 1209, 1216, 1222, 1228, 1237, 1239, 1248, 1250, 1252, - 1254, 1256, 1258, 1260, 1264, 1267, 1271, 1276, 1280, 1282, - 1286, 1290, 1294, 1298, 1302, 1304, 1309, 1316, 1323, 1330, - 1339, 1344, 1348, 1352, 1354, 1358, 1362, 1366, 1370, 1374, - 1378, 1382, 1385, 1387, 1391, 1393, 1397, 1399, 1401, 1403, - 1405, 1410, 1413, 1415, 1418, 1420, 1428, 1430 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const grib_yytype_int16 grib_yyrhs[] = -{ - 145, 0, -1, 146, -1, 169, -1, 170, -1, 150, - -1, 193, -1, 1, -1, -1, 126, -1, 147, 127, - 126, -1, 125, -1, 147, 127, 125, -1, 124, -1, - 148, 127, 124, -1, 125, -1, 149, 127, 125, -1, - 151, -1, 151, 150, -1, 151, 128, 150, -1, 151, - 128, -1, 156, 128, -1, 157, -1, 165, -1, 166, - -1, 167, -1, 168, -1, 171, -1, 158, -1, 174, - -1, 128, -1, 152, 128, -1, 146, -1, 154, -1, - 155, -1, 155, 127, 154, -1, 187, -1, 9, 129, - 125, 130, 123, 161, 162, -1, 9, 129, 125, 130, - 123, 129, 153, 130, 161, 162, -1, 9, 131, 125, - 132, 123, 161, 162, -1, 9, 131, 125, 132, 123, - 129, 153, 130, 161, 162, -1, 13, 129, 125, 130, - 123, 161, 162, -1, 14, 123, 161, 162, -1, 14, - 123, 131, 153, 132, 161, 162, -1, 123, 133, 22, - 131, 153, 132, 162, -1, 123, 133, 24, 131, 153, - 132, 162, -1, 123, 133, 23, 131, 153, 132, 162, - -1, 15, 123, 161, 162, -1, 13, 129, 125, 130, - 124, 161, 162, -1, 43, 129, 125, 130, 123, 161, - 162, -1, 43, 129, 125, 130, 123, 129, 153, 130, - 161, 162, -1, 16, 129, 125, 130, 123, 161, 162, - -1, 27, 129, 125, 130, 123, 161, 162, -1, 27, - 129, 125, 130, 123, 129, 153, 130, 161, 162, -1, - 27, 131, 125, 132, 123, 161, 162, -1, 27, 131, - 125, 132, 123, 129, 153, 130, 161, 162, -1, 44, - 129, 125, 130, 123, 155, 161, 162, -1, 44, 129, - 123, 130, 123, 155, 161, 162, -1, 44, 129, 125, - 130, 123, 155, 161, 80, 131, 123, 132, 162, -1, - 44, 129, 125, 130, 123, 131, 153, 132, 161, 162, - -1, 45, 123, 131, 153, 132, 161, 162, -1, 123, - 133, 46, 131, 153, 132, 161, 162, -1, 123, 133, - 57, 131, 153, 132, 161, 162, -1, 47, 129, 125, - 130, 123, 155, 161, 162, -1, 47, 129, 125, 130, - 123, 131, 153, 132, 161, 162, -1, 101, 129, 125, - 130, 123, 155, 161, 162, -1, 48, 129, 125, 130, - 123, 131, 153, 132, 162, -1, 55, 123, 131, 153, - 132, 161, 162, -1, 17, 123, -1, 17, 124, -1, - 26, 123, 161, 162, -1, 29, 123, 161, 162, -1, - 28, 123, 161, 162, -1, 31, 123, 161, 162, -1, - 30, 123, 161, 162, -1, 33, 123, 161, 162, -1, - 32, 123, 161, 162, -1, 35, 123, 161, 162, -1, - 34, 123, 161, 162, -1, 37, 123, 161, 162, -1, - 36, 123, 161, 162, -1, 39, 123, 161, 162, -1, - 38, 123, 161, 162, -1, 41, 123, 161, 162, -1, - 40, 123, 161, 162, -1, 42, 123, 129, 153, 130, - 161, 162, -1, 26, 123, 134, 123, 161, 162, -1, - 26, 123, 129, 155, 130, 161, 162, -1, 52, 123, - -1, 53, 123, 133, 155, 162, -1, 54, 123, 133, - 155, 162, -1, 54, 123, 133, 135, 147, 136, 162, - -1, 126, 123, 161, 162, -1, 126, 123, 134, 123, - 161, 162, -1, 126, 123, 129, 155, 130, 161, 162, - -1, 96, 123, -1, 99, 129, 125, 130, 123, 161, - -1, 97, 129, 125, 130, 123, 131, 153, 132, -1, - 98, 129, 125, 130, 123, 131, 153, 132, -1, 105, - 123, 155, -1, 89, 123, 131, 153, 132, -1, 93, - 123, 131, 153, 132, -1, 94, 123, 131, 153, 132, - -1, 95, 123, 131, 153, 132, -1, 91, 129, 125, - 130, 123, 162, -1, 92, 123, 162, -1, 90, 123, - 162, -1, 10, 123, 124, -1, 11, 123, 124, -1, - 49, 123, 133, 123, 162, -1, 50, 123, -1, 49, - 123, 134, 123, 133, 123, 162, -1, 50, 123, 134, - 123, -1, 51, 123, 123, 131, 153, 132, 161, 162, - -1, 51, 123, 134, 123, 123, 131, 153, 132, 161, - 162, -1, 102, 123, 131, 153, 132, -1, 103, 123, - 131, 153, 132, -1, 104, 123, 131, 153, 132, -1, - 85, 123, 131, 153, 132, -1, 86, 153, -1, 87, - 131, 123, 127, 123, 132, -1, 106, 131, 187, 132, - -1, 62, 123, 162, -1, 80, 123, 133, 76, -1, - 80, 123, 133, 187, -1, 80, 123, 133, 135, 147, - 136, -1, 80, 123, 133, 135, 148, 136, -1, 81, - 123, 133, 187, -1, 82, 124, -1, 82, -1, 82, - 131, 125, 132, 124, -1, 82, 131, 125, 132, -1, - 83, 124, -1, 83, -1, 83, 131, 125, 132, 124, - -1, 83, 131, 125, 132, -1, 8, 131, 123, 132, - -1, 84, 124, -1, 84, 131, 124, 132, 124, -1, - 84, 131, 123, 132, 124, -1, 84, -1, 4, 131, - 187, 132, 135, 150, 136, -1, 4, 131, 187, 132, - 135, 150, 136, 6, 135, 150, 136, -1, 5, 131, - 187, 132, 135, 150, 136, -1, 5, 131, 187, 132, - 135, 150, 136, 6, 135, 150, 136, -1, 79, 131, - 187, 132, 159, 152, -1, 79, 131, 187, 132, 135, - 160, 136, -1, 79, 131, 187, 132, 135, 160, 136, - 6, 135, 160, 136, -1, 80, 123, 133, 187, -1, - 81, 123, 133, 187, -1, 159, 152, -1, 160, 159, - 152, -1, 146, -1, 133, 153, -1, 146, -1, 137, - 163, -1, 164, -1, 163, 127, 164, -1, 63, -1, - 3, -1, 68, -1, 67, -1, 71, -1, 74, -1, - 72, -1, 75, -1, 77, -1, 78, -1, 54, -1, - 64, -1, 65, -1, 66, -1, 123, 18, 131, 187, - 132, 135, 150, 136, -1, 25, 131, 187, 132, 135, - 150, 136, -1, 12, 131, 153, 132, 135, 150, 136, - -1, 56, 123, 135, 169, 136, 162, -1, 56, 123, - 131, 123, 132, 135, 169, 136, 162, -1, 56, 123, - 131, 123, 127, 124, 127, 123, 127, 123, 132, 162, - -1, 56, 123, 131, 123, 127, 124, 127, 123, 127, - 123, 127, 123, 132, 162, -1, 56, 123, 131, 123, - 127, 124, 127, 123, 132, 162, -1, 56, 123, 134, - 123, 131, 123, 127, 124, 127, 123, 127, 123, 132, - 162, -1, 56, 123, 134, 123, 131, 123, 127, 124, - 127, 123, 132, 162, -1, 56, 123, 134, 123, 135, - 169, 136, 162, -1, 56, 123, 134, 123, 131, 123, - 132, 135, 169, 136, 162, -1, 59, 123, 135, 169, - 136, 162, -1, 59, 123, 131, 123, 132, 135, 169, - 136, 162, -1, 59, 123, 131, 123, 127, 124, 127, - 123, 127, 123, 132, 162, -1, 59, 123, 131, 123, - 127, 124, 127, 123, 132, 162, -1, 59, 123, 134, - 123, 131, 123, 127, 124, 127, 123, 127, 123, 132, - 162, -1, 59, 123, 134, 123, 131, 123, 127, 124, - 127, 123, 132, 162, -1, 59, 123, 134, 123, 135, - 169, 136, 162, -1, 59, 123, 134, 123, 131, 123, - 132, 135, 169, 136, 162, -1, 175, -1, 169, 175, - -1, 178, -1, 170, 178, -1, 58, 123, 135, 170, - 136, 162, -1, 58, 123, 131, 123, 127, 124, 127, - 123, 127, 123, 132, 162, -1, 173, -1, 172, 173, - -1, 108, 154, 137, 150, -1, 109, 131, 153, 132, - 135, 172, 110, 137, 150, 136, -1, 109, 131, 153, - 132, 135, 172, 110, 137, 136, -1, 109, 131, 153, - 132, 135, 172, 136, -1, 124, 133, 135, 176, 136, - -1, 123, 133, 135, 176, 136, -1, 125, 133, 135, - 176, 136, -1, 126, 133, 135, 176, 136, -1, 177, - -1, 177, 176, -1, 123, 133, 187, 128, -1, 123, - 133, 129, 149, 130, 128, -1, 124, 133, 129, 149, - 130, -1, 123, 133, 129, 149, 130, -1, 107, 131, - 123, 127, 125, 127, 125, 132, -1, 123, -1, 107, - 131, 124, 127, 125, 127, 125, 132, -1, 124, -1, - 179, -1, 125, -1, 126, -1, 60, -1, 61, -1, - 131, 187, 132, -1, 138, 180, -1, 123, 131, 132, - -1, 123, 131, 153, 132, -1, 180, 139, 181, -1, - 180, -1, 182, 140, 181, -1, 182, 141, 181, -1, - 182, 142, 181, -1, 182, 117, 181, -1, 182, 118, - 181, -1, 181, -1, 100, 131, 123, 132, -1, 19, - 131, 123, 127, 124, 132, -1, 20, 131, 123, 127, - 124, 132, -1, 21, 131, 123, 127, 125, 132, -1, - 21, 131, 123, 127, 125, 127, 125, 132, -1, 21, - 131, 123, 132, -1, 183, 143, 182, -1, 183, 138, - 182, -1, 182, -1, 184, 116, 183, -1, 184, 111, - 183, -1, 184, 115, 183, -1, 184, 113, 183, -1, - 184, 114, 183, -1, 184, 112, 183, -1, 179, 122, - 179, -1, 121, 184, -1, 183, -1, 185, 119, 184, - -1, 184, -1, 186, 120, 185, -1, 185, -1, 186, - -1, 191, -1, 192, -1, 123, 133, 187, 128, -1, - 88, 128, -1, 189, -1, 189, 190, -1, 189, -1, - 4, 131, 187, 132, 135, 190, 136, -1, 188, -1, - 188, 193, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const grib_yytype_uint16 grib_yyrline[] = + /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ +static const grib_yytype_int16 grib_yyrline[] = { 0, 262, 262, 264, 265, 266, 267, 269, 273, 276, 277, 278, 279, 282, 283, 287, 288, 291, 292, 293, @@ -968,14 +870,14 @@ static const char *const grib_yytname[] = "concept_value", "concept_conditions", "concept_condition", "hash_array_value", "string_or_ident", "atom", "power", "factor", "term", "condition", "conjonction", "disjonction", "expression", "rule", - "rule_entry", "rule_entries", "fact", "conditional_rule", "rules", YY_NULL + "rule_entry", "rule_entries", "fact", "conditional_rule", "rules", YY_NULLPTR }; #endif # ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const grib_yytype_uint16 grib_yytoknum[] = +/* YYTOKNUM[NUM] -- (External) token number corresponding to the + (internal) symbol number NUM (which must be that of a token). */ +static const grib_yytype_int16 grib_yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, @@ -995,181 +897,18 @@ static const grib_yytype_uint16 grib_yytoknum[] = }; # endif -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const grib_yytype_uint8 grib_yyr1[] = -{ - 0, 144, 145, 145, 145, 145, 145, 145, 146, 147, - 147, 147, 147, 148, 148, 149, 149, 150, 150, 150, - 150, 151, 151, 151, 151, 151, 151, 151, 151, 151, - 152, 152, 153, 153, 154, 154, 155, 156, 156, 156, - 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, - 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, - 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, - 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, - 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, - 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, - 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, - 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, - 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, - 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, - 156, 157, 157, 157, 157, 158, 158, 158, 159, 159, - 160, 160, 161, 161, 162, 162, 163, 163, 164, 164, - 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, - 164, 164, 165, 166, 167, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 169, 169, 170, 170, 171, 171, 172, 172, - 173, 174, 174, 174, 175, 175, 175, 175, 176, 176, - 177, 177, 178, 178, 179, 179, 179, 179, 180, 180, - 180, 180, 180, 180, 180, 180, 180, 181, 181, 182, - 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, - 182, 183, 183, 183, 184, 184, 184, 184, 184, 184, - 184, 184, 184, 185, 185, 186, 186, 187, 188, 188, - 189, 189, 190, 190, 191, 192, 193, 193 -}; +#define YYPACT_NINF (-654) -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const grib_yytype_uint8 grib_yyr2[] = -{ - 0, 2, 1, 1, 1, 1, 1, 1, 0, 1, - 3, 1, 3, 1, 3, 1, 3, 1, 2, 3, - 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 1, 1, 1, 3, 1, 7, 10, 7, - 10, 7, 4, 7, 7, 7, 7, 4, 7, 7, - 10, 7, 7, 10, 7, 10, 8, 8, 12, 10, - 7, 8, 8, 8, 10, 8, 9, 7, 2, 2, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 7, 6, 7, 2, 5, - 5, 7, 4, 6, 7, 2, 6, 8, 8, 3, - 5, 5, 5, 5, 6, 3, 3, 3, 3, 5, - 2, 7, 4, 8, 10, 5, 5, 5, 5, 2, - 6, 4, 3, 4, 4, 6, 6, 4, 2, 1, - 5, 4, 2, 1, 5, 4, 4, 2, 5, 5, - 1, 7, 11, 7, 11, 6, 7, 11, 4, 4, - 2, 3, 1, 2, 1, 2, 1, 3, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 8, 7, 7, 6, 9, 12, 14, 10, - 14, 12, 8, 11, 6, 9, 12, 10, 14, 12, - 8, 11, 1, 2, 1, 2, 6, 12, 1, 2, - 4, 10, 9, 7, 5, 5, 5, 5, 1, 2, - 4, 6, 5, 5, 8, 1, 8, 1, 1, 1, - 1, 1, 1, 3, 2, 3, 4, 3, 1, 3, - 3, 3, 3, 3, 1, 4, 6, 6, 6, 8, - 4, 3, 3, 1, 3, 3, 3, 3, 3, 3, - 3, 2, 1, 3, 1, 3, 1, 1, 1, 1, - 4, 2, 1, 2, 1, 7, 1, 2 -}; +#define grib_yypact_value_is_default(Yyn) \ + ((Yyn) == YYPACT_NINF) -/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const grib_yytype_uint16 grib_yydefact[] = -{ - 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 129, 133, 140, 0, 8, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 2, 5, 17, 0, 22, 28, 23, 24, 25, - 26, 3, 4, 27, 29, 192, 194, 266, 264, 258, - 259, 6, 0, 0, 0, 0, 0, 0, 0, 8, - 0, 8, 8, 0, 68, 69, 0, 8, 0, 0, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, - 0, 110, 0, 88, 0, 0, 0, 0, 0, 0, - 8, 0, 0, 0, 128, 0, 132, 0, 137, 0, - 0, 0, 0, 0, 221, 222, 0, 0, 0, 215, - 217, 219, 220, 0, 0, 32, 119, 33, 34, 218, - 228, 234, 243, 252, 254, 256, 257, 36, 0, 261, - 0, 8, 0, 8, 0, 0, 0, 95, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, - 0, 0, 8, 0, 1, 0, 0, 0, 20, 18, - 21, 0, 0, 0, 193, 0, 0, 195, 0, 0, - 267, 0, 0, 0, 0, 0, 107, 108, 0, 0, - 8, 8, 152, 8, 8, 0, 0, 0, 0, 8, - 0, 0, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 0, 0, 0, - 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 154, 122, 0, 0, 0, 0, 0, 0, 0, 8, - 0, 0, 0, 0, 0, 251, 0, 0, 218, 224, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, - 106, 0, 105, 8, 8, 8, 0, 0, 0, 0, - 8, 8, 8, 99, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 8, 0, 0, 0, 19, 0, 0, 0, 0, 0, - 0, 0, 0, 136, 0, 0, 0, 0, 0, 153, - 42, 47, 0, 0, 0, 8, 70, 0, 0, 72, - 71, 74, 73, 76, 75, 78, 77, 80, 79, 82, - 81, 84, 83, 0, 0, 0, 0, 0, 0, 0, - 8, 0, 112, 8, 0, 8, 0, 8, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 159, 168, 158, - 169, 170, 171, 161, 160, 162, 164, 163, 165, 166, - 167, 155, 156, 0, 123, 0, 124, 127, 131, 135, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 225, - 0, 223, 35, 215, 250, 227, 232, 233, 229, 230, - 231, 242, 241, 245, 249, 247, 248, 246, 244, 253, - 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 121, 0, 0, 8, 8, 8, - 8, 8, 15, 0, 0, 0, 208, 260, 0, 0, - 0, 0, 8, 92, 0, 0, 0, 0, 0, 8, - 8, 0, 8, 8, 8, 8, 0, 8, 8, 8, - 8, 8, 8, 0, 0, 8, 0, 0, 109, 0, - 0, 0, 89, 11, 9, 0, 90, 8, 0, 0, - 0, 0, 8, 0, 8, 0, 0, 0, 0, 8, - 0, 0, 0, 0, 0, 13, 0, 0, 130, 134, - 139, 138, 118, 0, 0, 0, 240, 235, 0, 0, - 226, 0, 100, 8, 101, 102, 103, 0, 0, 8, - 0, 115, 116, 117, 0, 0, 0, 0, 0, 0, - 0, 0, 213, 0, 205, 209, 212, 204, 206, 8, - 8, 207, 0, 0, 0, 0, 262, 0, 0, 8, - 8, 8, 8, 0, 8, 8, 8, 8, 0, 8, - 86, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 0, 8, - 8, 0, 0, 0, 0, 175, 0, 196, 0, 0, - 0, 0, 184, 157, 0, 0, 0, 0, 30, 145, - 125, 0, 126, 0, 0, 0, 0, 0, 120, 104, - 8, 8, 96, 8, 0, 0, 198, 0, 8, 8, - 8, 8, 8, 16, 0, 0, 8, 93, 0, 0, - 0, 141, 263, 265, 143, 0, 37, 0, 39, 174, - 41, 48, 43, 51, 173, 87, 0, 52, 0, 54, - 85, 0, 49, 8, 0, 36, 8, 60, 0, 8, - 0, 111, 8, 0, 12, 10, 91, 67, 0, 0, - 0, 0, 8, 0, 0, 0, 0, 0, 8, 0, - 0, 150, 146, 0, 31, 14, 236, 237, 0, 238, - 0, 0, 0, 0, 8, 0, 0, 203, 199, 0, - 44, 46, 45, 8, 8, 0, 210, 94, 0, 0, - 8, 8, 8, 8, 8, 57, 8, 0, 56, 8, - 63, 8, 113, 8, 0, 8, 0, 0, 182, 0, - 0, 8, 0, 0, 190, 148, 149, 0, 151, 0, - 0, 0, 97, 98, 65, 0, 0, 172, 61, 62, - 0, 0, 0, 8, 8, 8, 8, 8, 8, 0, - 8, 66, 8, 0, 8, 176, 0, 0, 0, 0, - 8, 185, 0, 0, 0, 239, 214, 216, 200, 202, - 0, 211, 0, 0, 38, 40, 53, 55, 50, 59, - 0, 64, 114, 0, 179, 0, 8, 0, 0, 187, - 0, 8, 0, 201, 142, 144, 8, 0, 8, 0, - 8, 183, 8, 8, 0, 8, 191, 147, 58, 0, - 177, 0, 181, 197, 186, 0, 189, 8, 8, 8, - 178, 180, 188 -}; +#define YYTABLE_NINF (-9) -/* YYDEFGOTO[NTERM-NUM]. */ -static const grib_yytype_int16 grib_yydefgoto[] = -{ - -1, 80, 290, 545, 567, 503, 615, 83, 669, 176, - 177, 178, 84, 85, 86, 666, 667, 243, 291, 441, - 442, 87, 88, 89, 90, 91, 92, 93, 685, 686, - 94, 95, 505, 506, 96, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 97, 616, 617, 99, 100, 101 -}; +#define grib_yytable_value_is_error(Yyn) \ + 0 -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -654 + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ static const grib_yytype_int16 grib_yypact[] = { 1435, -654, -24, -10, 8, 65, -67, 115, 162, 147, @@ -1265,7 +1004,105 @@ static const grib_yytype_int16 grib_yypact[] = -654, -654, -654 }; -/* YYPGOTO[NTERM-NUM]. */ + /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const grib_yytype_int16 grib_yydefact[] = +{ + 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 129, 133, 140, 0, 8, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 2, 5, 17, 0, 22, 28, 23, 24, 25, + 26, 3, 4, 27, 29, 192, 194, 266, 264, 258, + 259, 6, 0, 0, 0, 0, 0, 0, 0, 8, + 0, 8, 8, 0, 68, 69, 0, 8, 0, 0, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, + 0, 110, 0, 88, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 128, 0, 132, 0, 137, 0, + 0, 0, 0, 0, 221, 222, 0, 0, 0, 215, + 217, 219, 220, 0, 0, 32, 119, 33, 34, 218, + 228, 234, 243, 252, 254, 256, 257, 36, 0, 261, + 0, 8, 0, 8, 0, 0, 0, 95, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, + 0, 0, 8, 0, 1, 0, 0, 0, 20, 18, + 21, 0, 0, 0, 193, 0, 0, 195, 0, 0, + 267, 0, 0, 0, 0, 0, 107, 108, 0, 0, + 8, 8, 152, 8, 8, 0, 0, 0, 0, 8, + 0, 0, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 154, 122, 0, 0, 0, 0, 0, 0, 0, 8, + 0, 0, 0, 0, 0, 251, 0, 0, 218, 224, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, + 106, 0, 105, 8, 8, 8, 0, 0, 0, 0, + 8, 8, 8, 99, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 19, 0, 0, 0, 0, 0, + 0, 0, 0, 136, 0, 0, 0, 0, 0, 153, + 42, 47, 0, 0, 0, 8, 70, 0, 0, 72, + 71, 74, 73, 76, 75, 78, 77, 80, 79, 82, + 81, 84, 83, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 112, 8, 0, 8, 0, 8, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 159, 168, 158, + 169, 170, 171, 161, 160, 162, 164, 163, 165, 166, + 167, 155, 156, 0, 123, 0, 124, 127, 131, 135, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 225, + 0, 223, 35, 215, 250, 227, 232, 233, 229, 230, + 231, 242, 241, 245, 249, 247, 248, 246, 244, 253, + 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 121, 0, 0, 8, 8, 8, + 8, 8, 15, 0, 0, 0, 208, 260, 0, 0, + 0, 0, 8, 92, 0, 0, 0, 0, 0, 8, + 8, 0, 8, 8, 8, 8, 0, 8, 8, 8, + 8, 8, 8, 0, 0, 8, 0, 0, 109, 0, + 0, 0, 89, 11, 9, 0, 90, 8, 0, 0, + 0, 0, 8, 0, 8, 0, 0, 0, 0, 8, + 0, 0, 0, 0, 0, 13, 0, 0, 130, 134, + 139, 138, 118, 0, 0, 0, 240, 235, 0, 0, + 226, 0, 100, 8, 101, 102, 103, 0, 0, 8, + 0, 115, 116, 117, 0, 0, 0, 0, 0, 0, + 0, 0, 213, 0, 205, 209, 212, 204, 206, 8, + 8, 207, 0, 0, 0, 0, 262, 0, 0, 8, + 8, 8, 8, 0, 8, 8, 8, 8, 0, 8, + 86, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 0, 8, + 8, 0, 0, 0, 0, 175, 0, 196, 0, 0, + 0, 0, 184, 157, 0, 0, 0, 0, 30, 145, + 125, 0, 126, 0, 0, 0, 0, 0, 120, 104, + 8, 8, 96, 8, 0, 0, 198, 0, 8, 8, + 8, 8, 8, 16, 0, 0, 8, 93, 0, 0, + 0, 141, 263, 265, 143, 0, 37, 0, 39, 174, + 41, 48, 43, 51, 173, 87, 0, 52, 0, 54, + 85, 0, 49, 8, 0, 36, 8, 60, 0, 8, + 0, 111, 8, 0, 12, 10, 91, 67, 0, 0, + 0, 0, 8, 0, 0, 0, 0, 0, 8, 0, + 0, 150, 146, 0, 31, 14, 236, 237, 0, 238, + 0, 0, 0, 0, 8, 0, 0, 203, 199, 0, + 44, 46, 45, 8, 8, 0, 210, 94, 0, 0, + 8, 8, 8, 8, 8, 57, 8, 0, 56, 8, + 63, 8, 113, 8, 0, 8, 0, 0, 182, 0, + 0, 8, 0, 0, 190, 148, 149, 0, 151, 0, + 0, 0, 97, 98, 65, 0, 0, 172, 61, 62, + 0, 0, 0, 8, 8, 8, 8, 8, 8, 0, + 8, 66, 8, 0, 8, 176, 0, 0, 0, 0, + 8, 185, 0, 0, 0, 239, 214, 216, 200, 202, + 0, 211, 0, 0, 38, 40, 53, 55, 50, 59, + 0, 64, 114, 0, 179, 0, 8, 0, 0, 187, + 0, 8, 0, 201, 142, 144, 8, 0, 8, 0, + 8, 183, 8, 8, 0, 8, 191, 147, 58, 0, + 177, 0, 181, 197, 186, 0, 189, 8, 8, 8, + 178, 180, 188 +}; + + /* YYPGOTO[NTERM-NUM]. */ static const grib_yytype_int16 grib_yypgoto[] = { -654, -654, 5, 564, -654, -351, 0, -654, -653, 242, @@ -1275,10 +1112,19 @@ static const grib_yytype_int16 grib_yypgoto[] = -160, 691, -654, -96, -654, 14, 392, -654, -654, 913 }; -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -9 + /* YYDEFGOTO[NTERM-NUM]. */ +static const grib_yytype_int16 grib_yydefgoto[] = +{ + -1, 80, 290, 545, 567, 503, 615, 83, 669, 176, + 177, 178, 84, 85, 86, 666, 667, 243, 291, 441, + 442, 87, 88, 89, 90, 91, 92, 93, 685, 686, + 94, 95, 505, 506, 96, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 97, 616, 617, 99, 100, 101 +}; + + /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ static const grib_yytype_int16 grib_yytable[] = { 82, 564, 224, 462, 508, 81, 231, 232, 305, 308, @@ -1473,12 +1319,6 @@ static const grib_yytype_int16 grib_yytable[] = 0, 0, 217 }; -#define grib_yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-654))) - -#define grib_yytable_value_is_error(Yytable_value) \ - YYID (0) - static const grib_yytype_int16 grib_yycheck[] = { 0, 443, 91, 310, 355, 0, 102, 103, 168, 174, @@ -1673,8 +1513,8 @@ static const grib_yytype_int16 grib_yycheck[] = -1, -1, 126 }; -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ static const grib_yytype_uint8 grib_yystos[] = { 0, 1, 4, 5, 8, 9, 10, 11, 12, 13, @@ -1770,67 +1610,105 @@ static const grib_yytype_uint8 grib_yystos[] = 162, 162, 162 }; -#define grib_yyerrok (grib_yyerrstatus = 0) -#define grib_yyclearin (grib_yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto grib_yyacceptlab -#define YYABORT goto grib_yyabortlab -#define YYERROR goto grib_yyerrorlab - - -/* Like YYERROR except do call grib_yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ - -#define YYFAIL goto grib_yyerrlab -#if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const grib_yytype_uint8 grib_yyr1[] = +{ + 0, 144, 145, 145, 145, 145, 145, 145, 146, 147, + 147, 147, 147, 148, 148, 149, 149, 150, 150, 150, + 150, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 152, 152, 153, 153, 154, 154, 155, 156, 156, 156, + 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, + 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, + 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, + 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, + 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, + 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, + 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, + 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, + 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, + 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, + 156, 157, 157, 157, 157, 158, 158, 158, 159, 159, + 160, 160, 161, 161, 162, 162, 163, 163, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 165, 166, 167, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 169, 169, 170, 170, 171, 171, 172, 172, + 173, 174, 174, 174, 175, 175, 175, 175, 176, 176, + 177, 177, 178, 178, 179, 179, 179, 179, 180, 180, + 180, 180, 180, 180, 180, 180, 180, 181, 181, 182, + 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, + 182, 183, 183, 183, 184, 184, 184, 184, 184, 184, + 184, 184, 184, 185, 185, 186, 186, 187, 188, 188, + 189, 189, 190, 190, 191, 192, 193, 193 +}; -#define YYRECOVERING() (!!grib_yyerrstatus) + /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +static const grib_yytype_int8 grib_yyr2[] = +{ + 0, 2, 1, 1, 1, 1, 1, 1, 0, 1, + 3, 1, 3, 1, 3, 1, 3, 1, 2, 3, + 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 1, 1, 1, 3, 1, 7, 10, 7, + 10, 7, 4, 7, 7, 7, 7, 4, 7, 7, + 10, 7, 7, 10, 7, 10, 8, 8, 12, 10, + 7, 8, 8, 8, 10, 8, 9, 7, 2, 2, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 7, 6, 7, 2, 5, + 5, 7, 4, 6, 7, 2, 6, 8, 8, 3, + 5, 5, 5, 5, 6, 3, 3, 3, 3, 5, + 2, 7, 4, 8, 10, 5, 5, 5, 5, 2, + 6, 4, 3, 4, 4, 6, 6, 4, 2, 1, + 5, 4, 2, 1, 5, 4, 4, 2, 5, 5, + 1, 7, 11, 7, 11, 6, 7, 11, 4, 4, + 2, 3, 1, 2, 1, 2, 1, 3, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 8, 7, 7, 6, 9, 12, 14, 10, + 14, 12, 8, 11, 6, 9, 12, 10, 14, 12, + 8, 11, 1, 2, 1, 2, 6, 12, 1, 2, + 4, 10, 9, 7, 5, 5, 5, 5, 1, 2, + 4, 6, 5, 5, 8, 1, 8, 1, 1, 1, + 1, 1, 1, 3, 2, 3, 4, 3, 1, 3, + 3, 3, 3, 3, 1, 4, 6, 6, 6, 8, + 4, 3, 3, 1, 3, 3, 3, 3, 3, 3, + 3, 2, 1, 3, 1, 3, 1, 1, 1, 1, + 4, 2, 1, 2, 1, 7, 1, 2 +}; -#define YYBACKUP(Token, Value) \ -do \ - if (grib_yychar == YYEMPTY) \ - { \ - grib_yychar = (Token); \ - grib_yylval = (Value); \ - YYPOPSTACK (grib_yylen); \ - grib_yystate = *grib_yyssp; \ - goto grib_yybackup; \ - } \ - else \ - { \ - grib_yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 +#define grib_yyerrok (grib_yyerrstatus = 0) +#define grib_yyclearin (grib_yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 +#define YYACCEPT goto grib_yyacceptlab +#define YYABORT goto grib_yyabortlab +#define YYERROR goto grib_yyerrorlab -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif + +#define YYRECOVERING() (!!grib_yyerrstatus) + +#define YYBACKUP(Token, Value) \ + do \ + if (grib_yychar == YYEMPTY) \ + { \ + grib_yychar = (Token); \ + grib_yylval = (Value); \ + YYPOPSTACK (grib_yylen); \ + grib_yystate = *grib_yyssp; \ + goto grib_yybackup; \ + } \ + else \ + { \ + grib_yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ + while (0) + +/* Error token number */ +#define YYTERROR 1 +#define YYERRCODE 256 -/* YYLEX -- calling `grib_yylex' with the right arguments. */ -#ifdef YYLEX_PARAM -# define YYLEX grib_yylex (YYLEX_PARAM) -#else -# define YYLEX grib_yylex () -#endif /* Enable debugging if requested. */ #if YYDEBUG @@ -1840,82 +1718,63 @@ while (YYID (0)) # define YYFPRINTF fprintf # endif -# define YYDPRINTF(Args) \ -do { \ - if (grib_yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (grib_yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - grib_yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -grib_yy_symbol_value_print (FILE *grib_yyoutput, int grib_yytype, YYSTYPE const * const grib_yyvaluep) -#else -static void -grib_yy_symbol_value_print (grib_yyoutput, grib_yytype, grib_yyvaluep) - FILE *grib_yyoutput; - int grib_yytype; - YYSTYPE const * const grib_yyvaluep; +# define YYDPRINTF(Args) \ +do { \ + if (grib_yydebug) \ + YYFPRINTF Args; \ +} while (0) + +/* This macro is provided for backward compatibility. */ +#ifndef YY_LOCATION_PRINT +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) #endif + + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (grib_yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + grib_yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + + +/*-----------------------------------. +| Print this symbol's value on YYO. | +`-----------------------------------*/ + +static void +grib_yy_symbol_value_print (FILE *grib_yyo, int grib_yytype, YYSTYPE const * const grib_yyvaluep) { - FILE *grib_yyo = grib_yyoutput; - YYUSE (grib_yyo); + FILE *grib_yyoutput = grib_yyo; + YYUSE (grib_yyoutput); if (!grib_yyvaluep) return; # ifdef YYPRINT if (grib_yytype < YYNTOKENS) - YYPRINT (grib_yyoutput, grib_yytoknum[grib_yytype], *grib_yyvaluep); -# else - YYUSE (grib_yyoutput); + YYPRINT (grib_yyo, grib_yytoknum[grib_yytype], *grib_yyvaluep); # endif - switch (grib_yytype) - { - default: - break; - } + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YYUSE (grib_yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END } -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ +/*---------------------------. +| Print this symbol on YYO. | +`---------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -grib_yy_symbol_print (FILE *grib_yyoutput, int grib_yytype, YYSTYPE const * const grib_yyvaluep) -#else static void -grib_yy_symbol_print (grib_yyoutput, grib_yytype, grib_yyvaluep) - FILE *grib_yyoutput; - int grib_yytype; - YYSTYPE const * const grib_yyvaluep; -#endif +grib_yy_symbol_print (FILE *grib_yyo, int grib_yytype, YYSTYPE const * const grib_yyvaluep) { - if (grib_yytype < YYNTOKENS) - YYFPRINTF (grib_yyoutput, "token %s (", grib_yytname[grib_yytype]); - else - YYFPRINTF (grib_yyoutput, "nterm %s (", grib_yytname[grib_yytype]); + YYFPRINTF (grib_yyo, "%s %s (", + grib_yytype < YYNTOKENS ? "token" : "nterm", grib_yytname[grib_yytype]); - grib_yy_symbol_value_print (grib_yyoutput, grib_yytype, grib_yyvaluep); - YYFPRINTF (grib_yyoutput, ")"); + grib_yy_symbol_value_print (grib_yyo, grib_yytype, grib_yyvaluep); + YYFPRINTF (grib_yyo, ")"); } /*------------------------------------------------------------------. @@ -1923,16 +1782,8 @@ grib_yy_symbol_print (grib_yyoutput, grib_yytype, grib_yyvaluep) | TOP (included). | `------------------------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void -grib_yy_stack_print (grib_yytype_int16 *grib_yybottom, grib_yytype_int16 *grib_yytop) -#else -static void -grib_yy_stack_print (grib_yybottom, grib_yytop) - grib_yytype_int16 *grib_yybottom; - grib_yytype_int16 *grib_yytop; -#endif +grib_yy_stack_print (grib_yy_state_t *grib_yybottom, grib_yy_state_t *grib_yytop) { YYFPRINTF (stderr, "Stack now"); for (; grib_yybottom <= grib_yytop; grib_yybottom++) @@ -1943,49 +1794,42 @@ grib_yy_stack_print (grib_yybottom, grib_yytop) YYFPRINTF (stderr, "\n"); } -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (grib_yydebug) \ - grib_yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (grib_yydebug) \ + grib_yy_stack_print ((Bottom), (Top)); \ +} while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -grib_yy_reduce_print (YYSTYPE *grib_yyvsp, int grib_yyrule) -#else static void -grib_yy_reduce_print (grib_yyvsp, grib_yyrule) - YYSTYPE *grib_yyvsp; - int grib_yyrule; -#endif +grib_yy_reduce_print (grib_yy_state_t *grib_yyssp, YYSTYPE *grib_yyvsp, int grib_yyrule) { + int grib_yylno = grib_yyrline[grib_yyrule]; int grib_yynrhs = grib_yyr2[grib_yyrule]; int grib_yyi; - unsigned long int grib_yylno = grib_yyrline[grib_yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - grib_yyrule - 1, grib_yylno); + YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", + grib_yyrule - 1, grib_yylno); /* The symbols being reduced. */ for (grib_yyi = 0; grib_yyi < grib_yynrhs; grib_yyi++) { YYFPRINTF (stderr, " $%d = ", grib_yyi + 1); - grib_yy_symbol_print (stderr, grib_yyrhs[grib_yyprhs[grib_yyrule] + grib_yyi], - &(grib_yyvsp[(grib_yyi + 1) - (grib_yynrhs)]) - ); + grib_yy_symbol_print (stderr, + grib_yystos[+grib_yyssp[grib_yyi + 1 - grib_yynrhs]], + &grib_yyvsp[(grib_yyi + 1) - (grib_yynrhs)] + ); YYFPRINTF (stderr, "\n"); } } -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (grib_yydebug) \ - grib_yy_reduce_print (grib_yyvsp, Rule); \ -} while (YYID (0)) +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (grib_yydebug) \ + grib_yy_reduce_print (grib_yyssp, grib_yyvsp, Rule); \ +} while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ @@ -1999,7 +1843,7 @@ int grib_yydebug; /* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH +#ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif @@ -2019,20 +1863,13 @@ int grib_yydebug; # ifndef grib_yystrlen # if defined __GLIBC__ && defined _STRING_H -# define grib_yystrlen strlen +# define grib_yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S))) # else /* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static YYSIZE_T +static YYPTRDIFF_T grib_yystrlen (const char *grib_yystr) -#else -static YYSIZE_T -grib_yystrlen (grib_yystr) - const char *grib_yystr; -#endif { - YYSIZE_T grib_yylen; + YYPTRDIFF_T grib_yylen; for (grib_yylen = 0; grib_yystr[grib_yylen]; grib_yylen++) continue; return grib_yylen; @@ -2046,16 +1883,8 @@ grib_yystrlen (grib_yystr) # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static char * grib_yystpcpy (char *grib_yydest, const char *grib_yysrc) -#else -static char * -grib_yystpcpy (grib_yydest, grib_yysrc) - char *grib_yydest; - const char *grib_yysrc; -#endif { char *grib_yyd = grib_yydest; const char *grib_yys = grib_yysrc; @@ -2076,43 +1905,46 @@ grib_yystpcpy (grib_yydest, grib_yysrc) backslash-backslash). YYSTR is taken from grib_yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ -static YYSIZE_T +static YYPTRDIFF_T grib_yytnamerr (char *grib_yyres, const char *grib_yystr) { if (*grib_yystr == '"') { - YYSIZE_T grib_yyn = 0; + YYPTRDIFF_T grib_yyn = 0; char const *grib_yyp = grib_yystr; for (;;) - switch (*++grib_yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++grib_yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (grib_yyres) - grib_yyres[grib_yyn] = *grib_yyp; - grib_yyn++; - break; - - case '"': - if (grib_yyres) - grib_yyres[grib_yyn] = '\0'; - return grib_yyn; - } + switch (*++grib_yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++grib_yyp != '\\') + goto do_not_strip_quotes; + else + goto append; + + append: + default: + if (grib_yyres) + grib_yyres[grib_yyn] = *grib_yyp; + grib_yyn++; + break; + + case '"': + if (grib_yyres) + grib_yyres[grib_yyn] = '\0'; + return grib_yyn; + } do_not_strip_quotes: ; } - if (! grib_yyres) + if (grib_yyres) + return grib_yystpcpy (grib_yyres, grib_yystr) - grib_yyres; + else return grib_yystrlen (grib_yystr); - - return grib_yystpcpy (grib_yyres, grib_yystr) - grib_yyres; } # endif @@ -2125,25 +1957,21 @@ grib_yytnamerr (char *grib_yyres, const char *grib_yystr) *YYMSG_ALLOC to the required number of bytes. Return 2 if the required number of bytes is too large to store. */ static int -grib_yysyntax_error (YYSIZE_T *grib_yymsg_alloc, char **grib_yymsg, - grib_yytype_int16 *grib_yyssp, int grib_yytoken) +grib_yysyntax_error (YYPTRDIFF_T *grib_yymsg_alloc, char **grib_yymsg, + grib_yy_state_t *grib_yyssp, int grib_yytoken) { - YYSIZE_T grib_yysize0 = grib_yytnamerr (YY_NULL, grib_yytname[grib_yytoken]); - YYSIZE_T grib_yysize = grib_yysize0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ - const char *grib_yyformat = YY_NULL; - /* Arguments of grib_yyformat. */ + const char *grib_yyformat = YY_NULLPTR; + /* Arguments of grib_yyformat: reported tokens (one for the "unexpected", + one per "expected"). */ char const *grib_yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ + /* Actual size of YYARG. */ int grib_yycount = 0; + /* Cumulated lengths of YYARG. */ + YYPTRDIFF_T grib_yysize = 0; /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - - for details. YYERROR is fine as it does not invoke this - function. - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected @@ -2168,7 +1996,9 @@ grib_yysyntax_error (YYSIZE_T *grib_yymsg_alloc, char **grib_yymsg, */ if (grib_yytoken != YYEMPTY) { - int grib_yyn = grib_yypact[*grib_yyssp]; + int grib_yyn = grib_yypact[+*grib_yyssp]; + YYPTRDIFF_T grib_yysize0 = grib_yytnamerr (YY_NULLPTR, grib_yytname[grib_yytoken]); + grib_yysize = grib_yysize0; grib_yyarg[grib_yycount++] = grib_yytname[grib_yytoken]; if (!grib_yypact_value_is_default (grib_yyn)) { @@ -2193,11 +2023,12 @@ grib_yysyntax_error (YYSIZE_T *grib_yymsg_alloc, char **grib_yymsg, } grib_yyarg[grib_yycount++] = grib_yytname[grib_yyx]; { - YYSIZE_T grib_yysize1 = grib_yysize + grib_yytnamerr (YY_NULL, grib_yytname[grib_yyx]); - if (! (grib_yysize <= grib_yysize1 - && grib_yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + YYPTRDIFF_T grib_yysize1 + = grib_yysize + grib_yytnamerr (YY_NULLPTR, grib_yytname[grib_yyx]); + if (grib_yysize <= grib_yysize1 && grib_yysize1 <= YYSTACK_ALLOC_MAXIMUM) + grib_yysize = grib_yysize1; + else return 2; - grib_yysize = grib_yysize1; } } } @@ -2209,6 +2040,7 @@ grib_yysyntax_error (YYSIZE_T *grib_yymsg_alloc, char **grib_yymsg, case N: \ grib_yyformat = S; \ break + default: /* Avoid compiler warnings. */ YYCASE_(0, YY_("syntax error")); YYCASE_(1, YY_("syntax error, unexpected %s")); YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); @@ -2219,10 +2051,13 @@ grib_yysyntax_error (YYSIZE_T *grib_yymsg_alloc, char **grib_yymsg, } { - YYSIZE_T grib_yysize1 = grib_yysize + grib_yystrlen (grib_yyformat); - if (! (grib_yysize <= grib_yysize1 && grib_yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + /* Don't count the "%s"s in the final size, but reserve room for + the terminator. */ + YYPTRDIFF_T grib_yysize1 = grib_yysize + (grib_yystrlen (grib_yyformat) - 2 * grib_yycount) + 1; + if (grib_yysize <= grib_yysize1 && grib_yysize1 <= YYSTACK_ALLOC_MAXIMUM) + grib_yysize = grib_yysize1; + else return 2; - grib_yysize = grib_yysize1; } if (*grib_yymsg_alloc < grib_yysize) @@ -2248,8 +2083,8 @@ grib_yysyntax_error (YYSIZE_T *grib_yymsg_alloc, char **grib_yymsg, } else { - grib_yyp++; - grib_yyformat++; + ++grib_yyp; + ++grib_yyformat; } } return 0; @@ -2260,31 +2095,17 @@ grib_yysyntax_error (YYSIZE_T *grib_yymsg_alloc, char **grib_yymsg, | Release the memory associated to this symbol. | `-----------------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void grib_yydestruct (const char *grib_yymsg, int grib_yytype, YYSTYPE *grib_yyvaluep) -#else -static void -grib_yydestruct (grib_yymsg, grib_yytype, grib_yyvaluep) - const char *grib_yymsg; - int grib_yytype; - YYSTYPE *grib_yyvaluep; -#endif { YYUSE (grib_yyvaluep); - if (!grib_yymsg) grib_yymsg = "Deleting"; YY_SYMBOL_PRINT (grib_yymsg, grib_yytype, grib_yyvaluep, grib_yylocationp); - switch (grib_yytype) - { - - default: - break; - } + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YYUSE (grib_yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -2293,18 +2114,8 @@ grib_yydestruct (grib_yymsg, grib_yytype, grib_yyvaluep) /* The lookahead symbol. */ int grib_yychar; - -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - /* The semantic value of the lookahead symbol. */ -YYSTYPE grib_yylval YY_INITIAL_VALUE(grib_yyval_default); - +YYSTYPE grib_yylval; /* Number of syntax errors so far. */ int grib_yynerrs; @@ -2313,50 +2124,31 @@ int grib_yynerrs; | grib_yyparse. | `----------*/ -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -grib_yyparse (void *YYPARSE_PARAM) -#else -int -grib_yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) int grib_yyparse (void) -#else -int -grib_yyparse () - -#endif -#endif { - int grib_yystate; + grib_yy_state_fast_t grib_yystate; /* Number of tokens to shift before error messages enabled. */ int grib_yyerrstatus; /* The stacks and their tools: - `grib_yyss': related to states. - `grib_yyvs': related to semantic values. + 'grib_yyss': related to states. + 'grib_yyvs': related to semantic values. Refer to the stacks through separate pointers, to allow grib_yyoverflow to reallocate them elsewhere. */ /* The state stack. */ - grib_yytype_int16 grib_yyssa[YYINITDEPTH]; - grib_yytype_int16 *grib_yyss; - grib_yytype_int16 *grib_yyssp; + grib_yy_state_t grib_yyssa[YYINITDEPTH]; + grib_yy_state_t *grib_yyss; + grib_yy_state_t *grib_yyssp; /* The semantic value stack. */ YYSTYPE grib_yyvsa[YYINITDEPTH]; YYSTYPE *grib_yyvs; YYSTYPE *grib_yyvsp; - YYSIZE_T grib_yystacksize; + YYPTRDIFF_T grib_yystacksize; int grib_yyn; int grib_yyresult; @@ -2370,7 +2162,7 @@ grib_yyparse () /* Buffer for error messages, and its allocated size. */ char grib_yymsgbuf[128]; char *grib_yymsg = grib_yymsgbuf; - YYSIZE_T grib_yymsg_alloc = sizeof grib_yymsgbuf; + YYPTRDIFF_T grib_yymsg_alloc = sizeof grib_yymsgbuf; #endif #define YYPOPSTACK(N) (grib_yyvsp -= (N), grib_yyssp -= (N)) @@ -2391,90 +2183,99 @@ grib_yyparse () grib_yychar = YYEMPTY; /* Cause a token to be read. */ goto grib_yysetstate; + /*------------------------------------------------------------. -| grib_yynewstate -- Push a new state, which is found in grib_yystate. | +| grib_yynewstate -- push a new state, which is found in grib_yystate. | `------------------------------------------------------------*/ - grib_yynewstate: +grib_yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ grib_yyssp++; - grib_yysetstate: - *grib_yyssp = grib_yystate; + +/*--------------------------------------------------------------------. +| grib_yysetstate -- set current state (the top of the stack) to grib_yystate. | +`--------------------------------------------------------------------*/ +grib_yysetstate: + YYDPRINTF ((stderr, "Entering state %d\n", grib_yystate)); + YY_ASSERT (0 <= grib_yystate && grib_yystate < YYNSTATES); + YY_IGNORE_USELESS_CAST_BEGIN + *grib_yyssp = YY_CAST (grib_yy_state_t, grib_yystate); + YY_IGNORE_USELESS_CAST_END if (grib_yyss + grib_yystacksize - 1 <= grib_yyssp) +#if !defined grib_yyoverflow && !defined YYSTACK_RELOCATE + goto grib_yyexhaustedlab; +#else { /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T grib_yysize = grib_yyssp - grib_yyss + 1; + YYPTRDIFF_T grib_yysize = grib_yyssp - grib_yyss + 1; -#ifdef grib_yyoverflow +# if defined grib_yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *grib_yyvs1 = grib_yyvs; - grib_yytype_int16 *grib_yyss1 = grib_yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if grib_yyoverflow is a macro. */ - grib_yyoverflow (YY_("memory exhausted"), - &grib_yyss1, grib_yysize * sizeof (*grib_yyssp), - &grib_yyvs1, grib_yysize * sizeof (*grib_yyvsp), - &grib_yystacksize); - - grib_yyss = grib_yyss1; - grib_yyvs = grib_yyvs1; + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + grib_yy_state_t *grib_yyss1 = grib_yyss; + YYSTYPE *grib_yyvs1 = grib_yyvs; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if grib_yyoverflow is a macro. */ + grib_yyoverflow (YY_("memory exhausted"), + &grib_yyss1, grib_yysize * YYSIZEOF (*grib_yyssp), + &grib_yyvs1, grib_yysize * YYSIZEOF (*grib_yyvsp), + &grib_yystacksize); + grib_yyss = grib_yyss1; + grib_yyvs = grib_yyvs1; } -#else /* no grib_yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto grib_yyexhaustedlab; -# else +# else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= grib_yystacksize) - goto grib_yyexhaustedlab; + goto grib_yyexhaustedlab; grib_yystacksize *= 2; if (YYMAXDEPTH < grib_yystacksize) - grib_yystacksize = YYMAXDEPTH; + grib_yystacksize = YYMAXDEPTH; { - grib_yytype_int16 *grib_yyss1 = grib_yyss; - union grib_yyalloc *grib_yyptr = - (union grib_yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (grib_yystacksize)); - if (! grib_yyptr) - goto grib_yyexhaustedlab; - YYSTACK_RELOCATE (grib_yyss_alloc, grib_yyss); - YYSTACK_RELOCATE (grib_yyvs_alloc, grib_yyvs); -# undef YYSTACK_RELOCATE - if (grib_yyss1 != grib_yyssa) - YYSTACK_FREE (grib_yyss1); + grib_yy_state_t *grib_yyss1 = grib_yyss; + union grib_yyalloc *grib_yyptr = + YY_CAST (union grib_yyalloc *, + YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (grib_yystacksize)))); + if (! grib_yyptr) + goto grib_yyexhaustedlab; + YYSTACK_RELOCATE (grib_yyss_alloc, grib_yyss); + YYSTACK_RELOCATE (grib_yyvs_alloc, grib_yyvs); +# undef YYSTACK_RELOCATE + if (grib_yyss1 != grib_yyssa) + YYSTACK_FREE (grib_yyss1); } # endif -#endif /* no grib_yyoverflow */ grib_yyssp = grib_yyss + grib_yysize - 1; grib_yyvsp = grib_yyvs + grib_yysize - 1; - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) grib_yystacksize)); + YY_IGNORE_USELESS_CAST_BEGIN + YYDPRINTF ((stderr, "Stack size increased to %ld\n", + YY_CAST (long, grib_yystacksize))); + YY_IGNORE_USELESS_CAST_END if (grib_yyss + grib_yystacksize - 1 <= grib_yyssp) - YYABORT; + YYABORT; } - - YYDPRINTF ((stderr, "Entering state %d\n", grib_yystate)); +#endif /* !defined grib_yyoverflow && !defined YYSTACK_RELOCATE */ if (grib_yystate == YYFINAL) YYACCEPT; goto grib_yybackup; + /*-----------. | grib_yybackup. | `-----------*/ grib_yybackup: - /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ @@ -2489,7 +2290,7 @@ grib_yyparse () if (grib_yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); - grib_yychar = YYLEX; + grib_yychar = grib_yylex (); } if (grib_yychar <= YYEOF) @@ -2524,15 +2325,13 @@ grib_yyparse () /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", grib_yytoken, &grib_yylval, &grib_yylloc); - - /* Discard the shifted token. */ - grib_yychar = YYEMPTY; - grib_yystate = grib_yyn; YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++grib_yyvsp = grib_yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END + /* Discard the shifted token. */ + grib_yychar = YYEMPTY; goto grib_yynewstate; @@ -2547,14 +2346,14 @@ grib_yyparse () /*-----------------------------. -| grib_yyreduce -- Do a reduction. | +| grib_yyreduce -- do a reduction. | `-----------------------------*/ grib_yyreduce: /* grib_yyn is the number of a rule to reduce with. */ grib_yylen = grib_yyr2[grib_yyn]; /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. + '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison @@ -2567,1458 +2366,1458 @@ grib_yyparse () YY_REDUCE_PRINT (grib_yyn); switch (grib_yyn) { - case 2: -/* Line 1792 of yacc.c */ + case 2: #line 262 "griby.y" - { grib_parser_all_actions = 0;grib_parser_concept=0; + { grib_parser_all_actions = 0;grib_parser_concept=0; grib_parser_hash_array=0;grib_parser_rules=0; } +#line 2374 "y.tab.c" break; case 3: -/* Line 1792 of yacc.c */ #line 264 "griby.y" - { grib_parser_concept = reverse_concept((grib_yyvsp[(1) - (1)].concept_value)); } + { grib_parser_concept = reverse_concept((grib_yyvsp[0].concept_value)); } +#line 2380 "y.tab.c" break; case 4: -/* Line 1792 of yacc.c */ #line 265 "griby.y" - { grib_parser_hash_array = reverse_hash_array((grib_yyvsp[(1) - (1)].hash_array_value)); } + { grib_parser_hash_array = reverse_hash_array((grib_yyvsp[0].hash_array_value)); } +#line 2386 "y.tab.c" break; case 5: -/* Line 1792 of yacc.c */ #line 266 "griby.y" - { grib_parser_all_actions = (grib_yyvsp[(1) - (1)].act); } + { grib_parser_all_actions = (grib_yyvsp[0].act); } +#line 2392 "y.tab.c" break; case 6: -/* Line 1792 of yacc.c */ #line 267 "griby.y" - { grib_parser_rules = (grib_yyvsp[(1) - (1)].rules); } + { grib_parser_rules = (grib_yyvsp[0].rules); } +#line 2398 "y.tab.c" break; case 7: -/* Line 1792 of yacc.c */ #line 269 "griby.y" - { grib_parser_all_actions = 0; grib_parser_concept=0; + { grib_parser_all_actions = 0; grib_parser_concept=0; grib_parser_hash_array=0; grib_parser_rules=0; } +#line 2405 "y.tab.c" break; case 9: -/* Line 1792 of yacc.c */ #line 276 "griby.y" - { (grib_yyval.dvalue)=grib_darray_push(grib_parser_context,0,(grib_yyvsp[(1) - (1)].dval));} + { (grib_yyval.dvalue)=grib_darray_push(grib_parser_context,0,(grib_yyvsp[0].dval));} +#line 2411 "y.tab.c" break; case 10: -/* Line 1792 of yacc.c */ #line 277 "griby.y" - { (grib_yyval.dvalue)=grib_darray_push(grib_parser_context,(grib_yyvsp[(1) - (3)].dvalue),(grib_yyvsp[(3) - (3)].dval));} + { (grib_yyval.dvalue)=grib_darray_push(grib_parser_context,(grib_yyvsp[-2].dvalue),(grib_yyvsp[0].dval));} +#line 2417 "y.tab.c" break; case 11: -/* Line 1792 of yacc.c */ #line 278 "griby.y" - { (grib_yyval.dvalue)=grib_darray_push(grib_parser_context,0,(grib_yyvsp[(1) - (1)].lval));} + { (grib_yyval.dvalue)=grib_darray_push(grib_parser_context,0,(grib_yyvsp[0].lval));} +#line 2423 "y.tab.c" break; case 12: -/* Line 1792 of yacc.c */ #line 279 "griby.y" - { (grib_yyval.dvalue)=grib_darray_push(grib_parser_context,(grib_yyvsp[(1) - (3)].dvalue),(grib_yyvsp[(3) - (3)].lval));} + { (grib_yyval.dvalue)=grib_darray_push(grib_parser_context,(grib_yyvsp[-2].dvalue),(grib_yyvsp[0].lval));} +#line 2429 "y.tab.c" break; case 13: -/* Line 1792 of yacc.c */ #line 282 "griby.y" - { (grib_yyval.svalue)=grib_sarray_push(grib_parser_context,0,(grib_yyvsp[(1) - (1)].str));} + { (grib_yyval.svalue)=grib_sarray_push(grib_parser_context,0,(grib_yyvsp[0].str));} +#line 2435 "y.tab.c" break; case 14: -/* Line 1792 of yacc.c */ #line 283 "griby.y" - { (grib_yyval.svalue)=grib_sarray_push(grib_parser_context,(grib_yyvsp[(1) - (3)].svalue),(grib_yyvsp[(3) - (3)].str));} + { (grib_yyval.svalue)=grib_sarray_push(grib_parser_context,(grib_yyvsp[-2].svalue),(grib_yyvsp[0].str));} +#line 2441 "y.tab.c" break; case 15: -/* Line 1792 of yacc.c */ #line 287 "griby.y" - { (grib_yyval.ivalue)=grib_iarray_push(0,(grib_yyvsp[(1) - (1)].lval));} + { (grib_yyval.ivalue)=grib_iarray_push(0,(grib_yyvsp[0].lval));} +#line 2447 "y.tab.c" break; case 16: -/* Line 1792 of yacc.c */ #line 288 "griby.y" - { (grib_yyval.ivalue)=grib_iarray_push((grib_yyvsp[(1) - (3)].ivalue),(grib_yyvsp[(3) - (3)].lval));} + { (grib_yyval.ivalue)=grib_iarray_push((grib_yyvsp[-2].ivalue),(grib_yyvsp[0].lval));} +#line 2453 "y.tab.c" break; case 18: -/* Line 1792 of yacc.c */ #line 292 "griby.y" - { (grib_yyvsp[(1) - (2)].act)->next = (grib_yyvsp[(2) - (2)].act); (grib_yyval.act) = (grib_yyvsp[(1) - (2)].act); } + { (grib_yyvsp[-1].act)->next = (grib_yyvsp[0].act); (grib_yyval.act) = (grib_yyvsp[-1].act); } +#line 2459 "y.tab.c" break; case 19: -/* Line 1792 of yacc.c */ #line 293 "griby.y" - { (grib_yyvsp[(1) - (3)].act)->next = (grib_yyvsp[(3) - (3)].act); (grib_yyval.act) = (grib_yyvsp[(1) - (3)].act); } + { (grib_yyvsp[-2].act)->next = (grib_yyvsp[0].act); (grib_yyval.act) = (grib_yyvsp[-2].act); } +#line 2465 "y.tab.c" break; case 20: -/* Line 1792 of yacc.c */ #line 294 "griby.y" - { (grib_yyval.act) = (grib_yyvsp[(1) - (2)].act);} + { (grib_yyval.act) = (grib_yyvsp[-1].act);} +#line 2471 "y.tab.c" break; case 32: -/* Line 1792 of yacc.c */ #line 313 "griby.y" - { (grib_yyval.explist) = 0; } + { (grib_yyval.explist) = 0; } +#line 2477 "y.tab.c" break; case 35: -/* Line 1792 of yacc.c */ #line 318 "griby.y" - { (grib_yyvsp[(1) - (3)].explist)->next = (grib_yyvsp[(3) - (3)].explist); (grib_yyval.explist) = (grib_yyvsp[(1) - (3)].explist); } + { (grib_yyvsp[-2].explist)->next = (grib_yyvsp[0].explist); (grib_yyval.explist) = (grib_yyvsp[-2].explist); } +#line 2483 "y.tab.c" break; case 36: -/* Line 1792 of yacc.c */ #line 321 "griby.y" - { (grib_yyval.explist) = grib_arguments_new(grib_parser_context,(grib_yyvsp[(1) - (1)].exp),NULL); } + { (grib_yyval.explist) = grib_arguments_new(grib_parser_context,(grib_yyvsp[0].exp),NULL); } +#line 2489 "y.tab.c" break; case 37: -/* Line 1792 of yacc.c */ #line 326 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(5) - (7)].str),"unsigned",(grib_yyvsp[(3) - (7)].lval),NULL,(grib_yyvsp[(6) - (7)].explist),(grib_yyvsp[(7) - (7)].lval),NULL,NULL); free((grib_yyvsp[(5) - (7)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"unsigned",(grib_yyvsp[-4].lval),NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-2].str)); } +#line 2495 "y.tab.c" break; case 38: -/* Line 1792 of yacc.c */ #line 329 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(5) - (10)].str),"unsigned",(grib_yyvsp[(3) - (10)].lval),(grib_yyvsp[(7) - (10)].explist),(grib_yyvsp[(9) - (10)].explist),(grib_yyvsp[(10) - (10)].lval),NULL,NULL); free((grib_yyvsp[(5) - (10)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-5].str),"unsigned",(grib_yyvsp[-7].lval),(grib_yyvsp[-3].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-5].str)); } +#line 2501 "y.tab.c" break; case 39: -/* Line 1792 of yacc.c */ #line 332 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(5) - (7)].str),"unsigned_bits",(grib_yyvsp[(3) - (7)].lval),NULL,(grib_yyvsp[(6) - (7)].explist),(grib_yyvsp[(7) - (7)].lval),NULL,NULL); free((grib_yyvsp[(5) - (7)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"unsigned_bits",(grib_yyvsp[-4].lval),NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-2].str)); } +#line 2507 "y.tab.c" break; case 40: -/* Line 1792 of yacc.c */ #line 335 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(5) - (10)].str),"unsigned_bits",(grib_yyvsp[(3) - (10)].lval),(grib_yyvsp[(7) - (10)].explist),(grib_yyvsp[(9) - (10)].explist),(grib_yyvsp[(10) - (10)].lval),NULL,NULL); free((grib_yyvsp[(5) - (10)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-5].str),"unsigned_bits",(grib_yyvsp[-7].lval),(grib_yyvsp[-3].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-5].str)); } +#line 2513 "y.tab.c" break; case 41: -/* Line 1792 of yacc.c */ #line 338 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(5) - (7)].str),"ascii",(grib_yyvsp[(3) - (7)].lval),NULL,(grib_yyvsp[(6) - (7)].explist),(grib_yyvsp[(7) - (7)].lval),NULL,NULL); free((grib_yyvsp[(5) - (7)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"ascii",(grib_yyvsp[-4].lval),NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-2].str)); } +#line 2519 "y.tab.c" break; case 42: -/* Line 1792 of yacc.c */ #line 341 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(2) - (4)].str),"group",0,NULL,(grib_yyvsp[(3) - (4)].explist),(grib_yyvsp[(4) - (4)].lval),NULL,NULL); free((grib_yyvsp[(2) - (4)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"group",0,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-2].str)); } +#line 2525 "y.tab.c" break; case 43: -/* Line 1792 of yacc.c */ #line 344 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(2) - (7)].str),"group",0,(grib_yyvsp[(4) - (7)].explist),(grib_yyvsp[(6) - (7)].explist),(grib_yyvsp[(7) - (7)].lval),NULL,NULL); free((grib_yyvsp[(2) - (7)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-5].str),"group",0,(grib_yyvsp[-3].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-5].str)); } +#line 2531 "y.tab.c" break; case 44: -/* Line 1792 of yacc.c */ #line 347 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(1) - (7)].str),"to_integer",0,(grib_yyvsp[(5) - (7)].explist),0,(grib_yyvsp[(7) - (7)].lval),NULL,NULL); free((grib_yyvsp[(1) - (7)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-6].str),"to_integer",0,(grib_yyvsp[-2].explist),0,(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-6].str)); } +#line 2537 "y.tab.c" break; case 45: -/* Line 1792 of yacc.c */ #line 350 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(1) - (7)].str),"sexagesimal2decimal",0,(grib_yyvsp[(5) - (7)].explist),0,(grib_yyvsp[(7) - (7)].lval),NULL,NULL); free((grib_yyvsp[(1) - (7)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-6].str),"sexagesimal2decimal",0,(grib_yyvsp[-2].explist),0,(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-6].str)); } +#line 2543 "y.tab.c" break; case 46: -/* Line 1792 of yacc.c */ #line 353 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(1) - (7)].str),"to_string",0,(grib_yyvsp[(5) - (7)].explist),0,(grib_yyvsp[(7) - (7)].lval),NULL,NULL); free((grib_yyvsp[(1) - (7)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-6].str),"to_string",0,(grib_yyvsp[-2].explist),0,(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-6].str)); } +#line 2549 "y.tab.c" break; case 47: -/* Line 1792 of yacc.c */ #line 356 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(2) - (4)].str),"non_alpha",0,NULL,(grib_yyvsp[(3) - (4)].explist),(grib_yyvsp[(4) - (4)].lval),NULL,NULL); free((grib_yyvsp[(2) - (4)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"non_alpha",0,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-2].str)); } +#line 2555 "y.tab.c" break; case 48: -/* Line 1792 of yacc.c */ #line 360 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(5) - (7)].str),"ascii",(grib_yyvsp[(3) - (7)].lval),NULL,(grib_yyvsp[(6) - (7)].explist),(grib_yyvsp[(7) - (7)].lval),NULL,NULL); free((grib_yyvsp[(5) - (7)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"ascii",(grib_yyvsp[-4].lval),NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-2].str)); } +#line 2561 "y.tab.c" break; case 49: -/* Line 1792 of yacc.c */ #line 363 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(5) - (7)].str),"bytes",(grib_yyvsp[(3) - (7)].lval),NULL,(grib_yyvsp[(6) - (7)].explist),(grib_yyvsp[(7) - (7)].lval),NULL,NULL); free((grib_yyvsp[(5) - (7)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"bytes",(grib_yyvsp[-4].lval),NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-2].str)); } +#line 2567 "y.tab.c" break; case 50: -/* Line 1792 of yacc.c */ #line 366 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(5) - (10)].str),"bytes",(grib_yyvsp[(3) - (10)].lval),(grib_yyvsp[(7) - (10)].explist),(grib_yyvsp[(9) - (10)].explist),(grib_yyvsp[(10) - (10)].lval),NULL,NULL); free((grib_yyvsp[(5) - (10)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-5].str),"bytes",(grib_yyvsp[-7].lval),(grib_yyvsp[-3].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-5].str)); } +#line 2573 "y.tab.c" break; case 51: -/* Line 1792 of yacc.c */ #line 369 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(5) - (7)].str),"ksec1expver",(grib_yyvsp[(3) - (7)].lval),NULL,(grib_yyvsp[(6) - (7)].explist),(grib_yyvsp[(7) - (7)].lval),NULL,NULL); free((grib_yyvsp[(5) - (7)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"ksec1expver",(grib_yyvsp[-4].lval),NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-2].str)); } +#line 2579 "y.tab.c" break; case 52: -/* Line 1792 of yacc.c */ #line 372 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(5) - (7)].str),"signed",(grib_yyvsp[(3) - (7)].lval),NULL,(grib_yyvsp[(6) - (7)].explist),(grib_yyvsp[(7) - (7)].lval),NULL,NULL); free((grib_yyvsp[(5) - (7)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"signed",(grib_yyvsp[-4].lval),NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-2].str)); } +#line 2585 "y.tab.c" break; case 53: -/* Line 1792 of yacc.c */ #line 375 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(5) - (10)].str),"signed",(grib_yyvsp[(3) - (10)].lval),(grib_yyvsp[(7) - (10)].explist),(grib_yyvsp[(9) - (10)].explist),(grib_yyvsp[(10) - (10)].lval),NULL,NULL); free((grib_yyvsp[(5) - (10)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-5].str),"signed",(grib_yyvsp[-7].lval),(grib_yyvsp[-3].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-5].str)); } +#line 2591 "y.tab.c" break; case 54: -/* Line 1792 of yacc.c */ #line 378 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(5) - (7)].str),"signed_bits",(grib_yyvsp[(3) - (7)].lval),NULL,(grib_yyvsp[(6) - (7)].explist),(grib_yyvsp[(7) - (7)].lval),NULL,NULL); free((grib_yyvsp[(5) - (7)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"signed_bits",(grib_yyvsp[-4].lval),NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-2].str)); } +#line 2597 "y.tab.c" break; case 55: -/* Line 1792 of yacc.c */ #line 381 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(5) - (10)].str),"signed_bits",(grib_yyvsp[(3) - (10)].lval),(grib_yyvsp[(7) - (10)].explist),(grib_yyvsp[(9) - (10)].explist),(grib_yyvsp[(10) - (10)].lval),NULL,NULL); free((grib_yyvsp[(5) - (10)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-5].str),"signed_bits",(grib_yyvsp[-7].lval),(grib_yyvsp[-3].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-5].str)); } +#line 2603 "y.tab.c" break; case 56: -/* Line 1792 of yacc.c */ #line 384 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(5) - (8)].str),"codetable",(grib_yyvsp[(3) - (8)].lval), (grib_yyvsp[(6) - (8)].explist),(grib_yyvsp[(7) - (8)].explist),(grib_yyvsp[(8) - (8)].lval),NULL,NULL); free((grib_yyvsp[(5) - (8)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-3].str),"codetable",(grib_yyvsp[-5].lval), (grib_yyvsp[-2].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-3].str)); } +#line 2609 "y.tab.c" break; case 57: -/* Line 1792 of yacc.c */ #line 387 "griby.y" { /* ECC-485: Set length to 0 and prepend the new argument */ - grib_arguments* a = grib_arguments_new(grib_parser_context, new_accessor_expression(grib_parser_context,(grib_yyvsp[(3) - (8)].str),0,0),NULL); - a->next = (grib_yyvsp[(6) - (8)].explist); - (grib_yyval.act) = grib_action_create_gen(grib_parser_context, (grib_yyvsp[(5) - (8)].str), "codetable", + grib_arguments* a = grib_arguments_new(grib_parser_context, new_accessor_expression(grib_parser_context,(grib_yyvsp[-5].str),0,0),NULL); + a->next = (grib_yyvsp[-2].explist); + (grib_yyval.act) = grib_action_create_gen(grib_parser_context, (grib_yyvsp[-3].str), "codetable", 0, a, /* length=0 and additional argument */ - (grib_yyvsp[(7) - (8)].explist), (grib_yyvsp[(8) - (8)].lval), NULL, NULL); - free((grib_yyvsp[(5) - (8)].str)); + (grib_yyvsp[-1].explist), (grib_yyvsp[0].lval), NULL, NULL); + free((grib_yyvsp[-3].str)); } +#line 2623 "y.tab.c" break; case 58: -/* Line 1792 of yacc.c */ #line 398 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(5) - (12)].str),"codetable",(grib_yyvsp[(3) - (12)].lval), (grib_yyvsp[(6) - (12)].explist),(grib_yyvsp[(7) - (12)].explist),(grib_yyvsp[(12) - (12)].lval),NULL,(grib_yyvsp[(10) - (12)].str)); - free((grib_yyvsp[(5) - (12)].str));free((grib_yyvsp[(10) - (12)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-7].str),"codetable",(grib_yyvsp[-9].lval), (grib_yyvsp[-6].explist),(grib_yyvsp[-5].explist),(grib_yyvsp[0].lval),NULL,(grib_yyvsp[-2].str)); + free((grib_yyvsp[-7].str));free((grib_yyvsp[-2].str)); } +#line 2630 "y.tab.c" break; case 59: -/* Line 1792 of yacc.c */ #line 402 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(5) - (10)].str),"codetable",(grib_yyvsp[(3) - (10)].lval), (grib_yyvsp[(7) - (10)].explist),(grib_yyvsp[(9) - (10)].explist),(grib_yyvsp[(10) - (10)].lval),NULL,NULL); free((grib_yyvsp[(5) - (10)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-5].str),"codetable",(grib_yyvsp[-7].lval), (grib_yyvsp[-3].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-5].str)); } +#line 2636 "y.tab.c" break; case 60: -/* Line 1792 of yacc.c */ #line 405 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(2) - (7)].str),"smart_table",0,(grib_yyvsp[(4) - (7)].explist),(grib_yyvsp[(6) - (7)].explist),(grib_yyvsp[(7) - (7)].lval),NULL,NULL); free((grib_yyvsp[(2) - (7)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-5].str),"smart_table",0,(grib_yyvsp[-3].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-5].str)); } +#line 2642 "y.tab.c" break; case 61: -/* Line 1792 of yacc.c */ #line 408 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(1) - (8)].str),"dictionary",0,(grib_yyvsp[(5) - (8)].explist),(grib_yyvsp[(7) - (8)].explist),(grib_yyvsp[(8) - (8)].lval),NULL,NULL); free((grib_yyvsp[(1) - (8)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-7].str),"dictionary",0,(grib_yyvsp[-3].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-7].str)); } +#line 2648 "y.tab.c" break; case 62: -/* Line 1792 of yacc.c */ #line 411 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(1) - (8)].str),"getenv",0,(grib_yyvsp[(5) - (8)].explist),(grib_yyvsp[(7) - (8)].explist),(grib_yyvsp[(8) - (8)].lval),NULL,NULL); free((grib_yyvsp[(1) - (8)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-7].str),"getenv",0,(grib_yyvsp[-3].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-7].str)); } +#line 2654 "y.tab.c" break; case 63: -/* Line 1792 of yacc.c */ #line 414 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(5) - (8)].str),"complex_codetable",(grib_yyvsp[(3) - (8)].lval), (grib_yyvsp[(6) - (8)].explist),(grib_yyvsp[(7) - (8)].explist),(grib_yyvsp[(8) - (8)].lval),NULL,NULL); free((grib_yyvsp[(5) - (8)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-3].str),"complex_codetable",(grib_yyvsp[-5].lval), (grib_yyvsp[-2].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-3].str)); } +#line 2660 "y.tab.c" break; case 64: -/* Line 1792 of yacc.c */ #line 417 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(5) - (10)].str),"complex_codetable",(grib_yyvsp[(3) - (10)].lval), (grib_yyvsp[(7) - (10)].explist),(grib_yyvsp[(9) - (10)].explist),(grib_yyvsp[(10) - (10)].lval),NULL,NULL); free((grib_yyvsp[(5) - (10)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-5].str),"complex_codetable",(grib_yyvsp[-7].lval), (grib_yyvsp[-3].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-5].str)); } +#line 2666 "y.tab.c" break; case 65: -/* Line 1792 of yacc.c */ #line 420 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(5) - (8)].str),"codeflag",(grib_yyvsp[(3) - (8)].lval), (grib_yyvsp[(6) - (8)].explist),(grib_yyvsp[(7) - (8)].explist),(grib_yyvsp[(8) - (8)].lval),NULL,NULL); free((grib_yyvsp[(5) - (8)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-3].str),"codeflag",(grib_yyvsp[-5].lval), (grib_yyvsp[-2].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-3].str)); } +#line 2672 "y.tab.c" break; case 66: -/* Line 1792 of yacc.c */ #line 423 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(5) - (9)].str),"lookup",(grib_yyvsp[(3) - (9)].lval),(grib_yyvsp[(7) - (9)].explist),NULL,(grib_yyvsp[(9) - (9)].lval),NULL,NULL); free((grib_yyvsp[(5) - (9)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-4].str),"lookup",(grib_yyvsp[-6].lval),(grib_yyvsp[-2].explist),NULL,(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-4].str)); } +#line 2678 "y.tab.c" break; case 67: -/* Line 1792 of yacc.c */ #line 426 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(2) - (7)].str),"bit",0,(grib_yyvsp[(4) - (7)].explist),(grib_yyvsp[(6) - (7)].explist),(grib_yyvsp[(7) - (7)].lval),NULL,NULL); free((grib_yyvsp[(2) - (7)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-5].str),"bit",0,(grib_yyvsp[-3].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-5].str)); } +#line 2684 "y.tab.c" break; case 68: -/* Line 1792 of yacc.c */ #line 429 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(2) - (2)].str),"label",0,NULL,NULL,0,NULL,NULL); free((grib_yyvsp[(2) - (2)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[0].str),"label",0,NULL,NULL,0,NULL,NULL); free((grib_yyvsp[0].str)); } +#line 2690 "y.tab.c" break; case 69: -/* Line 1792 of yacc.c */ #line 432 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(2) - (2)].str),"label",0,NULL,NULL,0,NULL,NULL); free((grib_yyvsp[(2) - (2)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[0].str),"label",0,NULL,NULL,0,NULL,NULL); free((grib_yyvsp[0].str)); } +#line 2696 "y.tab.c" break; case 70: -/* Line 1792 of yacc.c */ #line 435 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(2) - (4)].str),"ibmfloat",4,NULL,(grib_yyvsp[(3) - (4)].explist),(grib_yyvsp[(4) - (4)].lval),NULL,NULL);free((grib_yyvsp[(2) - (4)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"ibmfloat",4,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL);free((grib_yyvsp[-2].str)); } +#line 2702 "y.tab.c" break; case 71: -/* Line 1792 of yacc.c */ #line 439 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(2) - (4)].str),"int8",1,NULL,(grib_yyvsp[(3) - (4)].explist),(grib_yyvsp[(4) - (4)].lval),NULL,NULL);free((grib_yyvsp[(2) - (4)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"int8",1,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL);free((grib_yyvsp[-2].str)); } +#line 2708 "y.tab.c" break; case 72: -/* Line 1792 of yacc.c */ #line 442 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(2) - (4)].str),"uint8",1,NULL,(grib_yyvsp[(3) - (4)].explist),(grib_yyvsp[(4) - (4)].lval),NULL,NULL);free((grib_yyvsp[(2) - (4)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"uint8",1,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL);free((grib_yyvsp[-2].str)); } +#line 2714 "y.tab.c" break; case 73: -/* Line 1792 of yacc.c */ #line 445 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(2) - (4)].str),"int16",2,NULL,(grib_yyvsp[(3) - (4)].explist),(grib_yyvsp[(4) - (4)].lval),NULL,NULL);free((grib_yyvsp[(2) - (4)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"int16",2,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL);free((grib_yyvsp[-2].str)); } +#line 2720 "y.tab.c" break; case 74: -/* Line 1792 of yacc.c */ #line 448 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(2) - (4)].str),"uint16",2,NULL,(grib_yyvsp[(3) - (4)].explist),(grib_yyvsp[(4) - (4)].lval),NULL,NULL);free((grib_yyvsp[(2) - (4)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"uint16",2,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL);free((grib_yyvsp[-2].str)); } +#line 2726 "y.tab.c" break; case 75: -/* Line 1792 of yacc.c */ #line 451 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(2) - (4)].str),"int16_little_endian",2,NULL,(grib_yyvsp[(3) - (4)].explist),(grib_yyvsp[(4) - (4)].lval),NULL,NULL);free((grib_yyvsp[(2) - (4)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"int16_little_endian",2,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL);free((grib_yyvsp[-2].str)); } +#line 2732 "y.tab.c" break; case 76: -/* Line 1792 of yacc.c */ #line 454 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(2) - (4)].str),"uint16_little_endian",2,NULL,(grib_yyvsp[(3) - (4)].explist),(grib_yyvsp[(4) - (4)].lval),NULL,NULL);free((grib_yyvsp[(2) - (4)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"uint16_little_endian",2,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL);free((grib_yyvsp[-2].str)); } +#line 2738 "y.tab.c" break; case 77: -/* Line 1792 of yacc.c */ #line 457 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(2) - (4)].str),"int32",4,NULL,(grib_yyvsp[(3) - (4)].explist),(grib_yyvsp[(4) - (4)].lval),NULL,NULL);free((grib_yyvsp[(2) - (4)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"int32",4,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL);free((grib_yyvsp[-2].str)); } +#line 2744 "y.tab.c" break; case 78: -/* Line 1792 of yacc.c */ #line 460 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(2) - (4)].str),"uint32",4,NULL,(grib_yyvsp[(3) - (4)].explist),(grib_yyvsp[(4) - (4)].lval),NULL,NULL);free((grib_yyvsp[(2) - (4)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"uint32",4,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL);free((grib_yyvsp[-2].str)); } +#line 2750 "y.tab.c" break; case 79: -/* Line 1792 of yacc.c */ #line 463 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(2) - (4)].str),"int32_little_endian",4,NULL,(grib_yyvsp[(3) - (4)].explist),(grib_yyvsp[(4) - (4)].lval),NULL,NULL);free((grib_yyvsp[(2) - (4)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"int32_little_endian",4,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL);free((grib_yyvsp[-2].str)); } +#line 2756 "y.tab.c" break; case 80: -/* Line 1792 of yacc.c */ #line 466 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(2) - (4)].str),"uint32_little_endian",4,NULL,(grib_yyvsp[(3) - (4)].explist),(grib_yyvsp[(4) - (4)].lval),NULL,NULL);free((grib_yyvsp[(2) - (4)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"uint32_little_endian",4,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL);free((grib_yyvsp[-2].str)); } +#line 2762 "y.tab.c" break; case 81: -/* Line 1792 of yacc.c */ #line 469 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(2) - (4)].str),"int64",8,NULL,(grib_yyvsp[(3) - (4)].explist),(grib_yyvsp[(4) - (4)].lval),NULL,NULL);free((grib_yyvsp[(2) - (4)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"int64",8,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL);free((grib_yyvsp[-2].str)); } +#line 2768 "y.tab.c" break; case 82: -/* Line 1792 of yacc.c */ #line 472 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(2) - (4)].str),"uint64",8,NULL,(grib_yyvsp[(3) - (4)].explist),(grib_yyvsp[(4) - (4)].lval),NULL,NULL);free((grib_yyvsp[(2) - (4)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"uint64",8,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL);free((grib_yyvsp[-2].str)); } +#line 2774 "y.tab.c" break; case 83: -/* Line 1792 of yacc.c */ #line 475 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(2) - (4)].str),"int64_little_endian",8,NULL,(grib_yyvsp[(3) - (4)].explist),(grib_yyvsp[(4) - (4)].lval),NULL,NULL);free((grib_yyvsp[(2) - (4)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"int64_little_endian",8,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL);free((grib_yyvsp[-2].str)); } +#line 2780 "y.tab.c" break; case 84: -/* Line 1792 of yacc.c */ #line 478 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(2) - (4)].str),"uint64_little_endian",8,NULL,(grib_yyvsp[(3) - (4)].explist),(grib_yyvsp[(4) - (4)].lval),NULL,NULL);free((grib_yyvsp[(2) - (4)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"uint64_little_endian",8,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL);free((grib_yyvsp[-2].str)); } +#line 2786 "y.tab.c" break; case 85: -/* Line 1792 of yacc.c */ #line 481 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(2) - (7)].str),"blob",0,(grib_yyvsp[(4) - (7)].explist),(grib_yyvsp[(6) - (7)].explist),(grib_yyvsp[(7) - (7)].lval),NULL,NULL); free((grib_yyvsp[(2) - (7)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-5].str),"blob",0,(grib_yyvsp[-3].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-5].str)); } +#line 2792 "y.tab.c" break; case 86: -/* Line 1792 of yacc.c */ #line 485 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(4) - (6)].str),"ibmfloat",4,NULL,(grib_yyvsp[(5) - (6)].explist),(grib_yyvsp[(6) - (6)].lval),(grib_yyvsp[(2) - (6)].str),NULL);free((grib_yyvsp[(4) - (6)].str)); free((grib_yyvsp[(2) - (6)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"ibmfloat",4,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),(grib_yyvsp[-4].str),NULL);free((grib_yyvsp[-2].str)); free((grib_yyvsp[-4].str)); } +#line 2798 "y.tab.c" break; case 87: -/* Line 1792 of yacc.c */ #line 488 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(2) - (7)].str),"ibmfloat",4,(grib_yyvsp[(4) - (7)].explist),(grib_yyvsp[(6) - (7)].explist),(grib_yyvsp[(7) - (7)].lval),NULL,NULL);free((grib_yyvsp[(2) - (7)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-5].str),"ibmfloat",4,(grib_yyvsp[-3].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL);free((grib_yyvsp[-5].str)); } +#line 2804 "y.tab.c" break; case 88: -/* Line 1792 of yacc.c */ #line 491 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(2) - (2)].str),"position",0,NULL,NULL,0,NULL,NULL); free((grib_yyvsp[(2) - (2)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[0].str),"position",0,NULL,NULL,0,NULL,NULL); free((grib_yyvsp[0].str)); } +#line 2810 "y.tab.c" break; case 89: -/* Line 1792 of yacc.c */ #line 494 "griby.y" - { (grib_yyval.act) = grib_action_create_variable(grib_parser_context,(grib_yyvsp[(2) - (5)].str),"constant",0,(grib_yyvsp[(4) - (5)].explist),NULL,(grib_yyvsp[(5) - (5)].lval),NULL);free((grib_yyvsp[(2) - (5)].str)); } + { (grib_yyval.act) = grib_action_create_variable(grib_parser_context,(grib_yyvsp[-3].str),"constant",0,(grib_yyvsp[-1].explist),NULL,(grib_yyvsp[0].lval),NULL);free((grib_yyvsp[-3].str)); } +#line 2816 "y.tab.c" break; case 90: -/* Line 1792 of yacc.c */ #line 497 "griby.y" - { (grib_yyval.act) = grib_action_create_variable(grib_parser_context,(grib_yyvsp[(2) - (5)].str),"transient",0,(grib_yyvsp[(4) - (5)].explist),(grib_yyvsp[(4) - (5)].explist),(grib_yyvsp[(5) - (5)].lval),NULL); free((grib_yyvsp[(2) - (5)].str)); } + { (grib_yyval.act) = grib_action_create_variable(grib_parser_context,(grib_yyvsp[-3].str),"transient",0,(grib_yyvsp[-1].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL); free((grib_yyvsp[-3].str)); } +#line 2822 "y.tab.c" break; case 91: -/* Line 1792 of yacc.c */ #line 499 "griby.y" - { (grib_yyval.act) = grib_action_create_transient_darray(grib_parser_context,(grib_yyvsp[(2) - (7)].str),(grib_yyvsp[(5) - (7)].dvalue),(grib_yyvsp[(7) - (7)].lval)); free((grib_yyvsp[(2) - (7)].str)); } + { (grib_yyval.act) = grib_action_create_transient_darray(grib_parser_context,(grib_yyvsp[-5].str),(grib_yyvsp[-2].dvalue),(grib_yyvsp[0].lval)); free((grib_yyvsp[-5].str)); } +#line 2828 "y.tab.c" break; case 92: -/* Line 1792 of yacc.c */ #line 502 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(2) - (4)].str),"ieeefloat",4,NULL,(grib_yyvsp[(3) - (4)].explist),(grib_yyvsp[(4) - (4)].lval),NULL,NULL); free((grib_yyvsp[(2) - (4)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"ieeefloat",4,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-2].str)); } +#line 2834 "y.tab.c" break; case 93: -/* Line 1792 of yacc.c */ #line 505 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(4) - (6)].str),"ieeefloat",4,NULL,(grib_yyvsp[(5) - (6)].explist),(grib_yyvsp[(6) - (6)].lval),(grib_yyvsp[(2) - (6)].str),NULL); free((grib_yyvsp[(4) - (6)].str));free((grib_yyvsp[(2) - (6)].str));} + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"ieeefloat",4,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),(grib_yyvsp[-4].str),NULL); free((grib_yyvsp[-2].str));free((grib_yyvsp[-4].str));} +#line 2840 "y.tab.c" break; case 94: -/* Line 1792 of yacc.c */ #line 508 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(2) - (7)].str),"ieeefloat",4,(grib_yyvsp[(4) - (7)].explist),(grib_yyvsp[(6) - (7)].explist),(grib_yyvsp[(7) - (7)].lval),NULL,NULL);free((grib_yyvsp[(2) - (7)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-5].str),"ieeefloat",4,(grib_yyvsp[-3].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL);free((grib_yyvsp[-5].str)); } +#line 2846 "y.tab.c" break; case 95: -/* Line 1792 of yacc.c */ #line 511 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(2) - (2)].str),"g1_half_byte_codeflag",0,NULL,NULL,0,NULL,NULL);free((grib_yyvsp[(2) - (2)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[0].str),"g1_half_byte_codeflag",0,NULL,NULL,0,NULL,NULL);free((grib_yyvsp[0].str)); } +#line 2852 "y.tab.c" break; case 96: -/* Line 1792 of yacc.c */ #line 514 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(5) - (6)].str),"section_length",(grib_yyvsp[(3) - (6)].lval),NULL,(grib_yyvsp[(6) - (6)].explist),0,NULL,NULL);free((grib_yyvsp[(5) - (6)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-1].str),"section_length",(grib_yyvsp[-3].lval),NULL,(grib_yyvsp[0].explist),0,NULL,NULL);free((grib_yyvsp[-1].str)); } +#line 2858 "y.tab.c" break; case 97: -/* Line 1792 of yacc.c */ #line 517 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(5) - (8)].str),"g1_message_length",(grib_yyvsp[(3) - (8)].lval),(grib_yyvsp[(7) - (8)].explist),NULL,0,NULL,NULL);free((grib_yyvsp[(5) - (8)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-3].str),"g1_message_length",(grib_yyvsp[-5].lval),(grib_yyvsp[-1].explist),NULL,0,NULL,NULL);free((grib_yyvsp[-3].str)); } +#line 2864 "y.tab.c" break; case 98: -/* Line 1792 of yacc.c */ #line 520 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(5) - (8)].str),"g1_section4_length",(grib_yyvsp[(3) - (8)].lval),(grib_yyvsp[(7) - (8)].explist),NULL,0,NULL,NULL);free((grib_yyvsp[(5) - (8)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-3].str),"g1_section4_length",(grib_yyvsp[-5].lval),(grib_yyvsp[-1].explist),NULL,0,NULL,NULL);free((grib_yyvsp[-3].str)); } +#line 2870 "y.tab.c" break; case 99: -/* Line 1792 of yacc.c */ #line 523 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(2) - (3)].str),"ksec",0,(grib_yyvsp[(3) - (3)].explist),NULL,0,NULL,NULL);free((grib_yyvsp[(2) - (3)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-1].str),"ksec",0,(grib_yyvsp[0].explist),NULL,0,NULL,NULL);free((grib_yyvsp[-1].str)); } +#line 2876 "y.tab.c" break; case 100: -/* Line 1792 of yacc.c */ #line 526 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(2) - (5)].str),"pad",0,(grib_yyvsp[(4) - (5)].explist),0,0,NULL,NULL); free((grib_yyvsp[(2) - (5)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-3].str),"pad",0,(grib_yyvsp[-1].explist),0,0,NULL,NULL); free((grib_yyvsp[-3].str)); } +#line 2882 "y.tab.c" break; case 101: -/* Line 1792 of yacc.c */ #line 529 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(2) - (5)].str),"padto",0,(grib_yyvsp[(4) - (5)].explist),0,0,NULL,NULL); free((grib_yyvsp[(2) - (5)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-3].str),"padto",0,(grib_yyvsp[-1].explist),0,0,NULL,NULL); free((grib_yyvsp[-3].str)); } +#line 2888 "y.tab.c" break; case 102: -/* Line 1792 of yacc.c */ #line 532 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(2) - (5)].str),"padtoeven",0,(grib_yyvsp[(4) - (5)].explist),0,0,NULL,NULL); free((grib_yyvsp[(2) - (5)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-3].str),"padtoeven",0,(grib_yyvsp[-1].explist),0,0,NULL,NULL); free((grib_yyvsp[-3].str)); } +#line 2894 "y.tab.c" break; case 103: -/* Line 1792 of yacc.c */ #line 535 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(2) - (5)].str),"padtomultiple",0,(grib_yyvsp[(4) - (5)].explist),0,0,NULL,NULL); free((grib_yyvsp[(2) - (5)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-3].str),"padtomultiple",0,(grib_yyvsp[-1].explist),0,0,NULL,NULL); free((grib_yyvsp[-3].str)); } +#line 2900 "y.tab.c" break; case 104: -/* Line 1792 of yacc.c */ #line 538 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(5) - (6)].str),"message",(grib_yyvsp[(3) - (6)].lval),0,0,(grib_yyvsp[(6) - (6)].lval),NULL,NULL); free((grib_yyvsp[(5) - (6)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-1].str),"message",(grib_yyvsp[-3].lval),0,0,(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-1].str)); } +#line 2906 "y.tab.c" break; case 105: -/* Line 1792 of yacc.c */ #line 541 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(2) - (3)].str),"message_copy",0,0,0,(grib_yyvsp[(3) - (3)].lval),NULL,NULL); free((grib_yyvsp[(2) - (3)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-1].str),"message_copy",0,0,0,(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-1].str)); } +#line 2912 "y.tab.c" break; case 106: -/* Line 1792 of yacc.c */ #line 544 "griby.y" - { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[(2) - (3)].str),"section_padding",0,0,0,(grib_yyvsp[(3) - (3)].lval),NULL,NULL); free((grib_yyvsp[(2) - (3)].str)); } + { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-1].str),"section_padding",0,0,0,(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-1].str)); } +#line 2918 "y.tab.c" break; case 107: -/* Line 1792 of yacc.c */ #line 546 "griby.y" - { (grib_yyval.act) = grib_action_create_template(grib_parser_context,0,(grib_yyvsp[(2) - (3)].str),(grib_yyvsp[(3) - (3)].str)); free((grib_yyvsp[(2) - (3)].str)); free((grib_yyvsp[(3) - (3)].str));} + { (grib_yyval.act) = grib_action_create_template(grib_parser_context,0,(grib_yyvsp[-1].str),(grib_yyvsp[0].str)); free((grib_yyvsp[-1].str)); free((grib_yyvsp[0].str));} +#line 2924 "y.tab.c" break; case 108: -/* Line 1792 of yacc.c */ #line 548 "griby.y" - { (grib_yyval.act) = grib_action_create_template(grib_parser_context,1,(grib_yyvsp[(2) - (3)].str),(grib_yyvsp[(3) - (3)].str)); free((grib_yyvsp[(2) - (3)].str)); free((grib_yyvsp[(3) - (3)].str));} + { (grib_yyval.act) = grib_action_create_template(grib_parser_context,1,(grib_yyvsp[-1].str),(grib_yyvsp[0].str)); free((grib_yyvsp[-1].str)); free((grib_yyvsp[0].str));} +#line 2930 "y.tab.c" break; case 109: -/* Line 1792 of yacc.c */ #line 551 "griby.y" - { (grib_yyval.act) = grib_action_create_alias(grib_parser_context,(grib_yyvsp[(2) - (5)].str),(grib_yyvsp[(4) - (5)].str),NULL,(grib_yyvsp[(5) - (5)].lval)); free((grib_yyvsp[(2) - (5)].str)); free((grib_yyvsp[(4) - (5)].str)); } + { (grib_yyval.act) = grib_action_create_alias(grib_parser_context,(grib_yyvsp[-3].str),(grib_yyvsp[-1].str),NULL,(grib_yyvsp[0].lval)); free((grib_yyvsp[-3].str)); free((grib_yyvsp[-1].str)); } +#line 2936 "y.tab.c" break; case 110: -/* Line 1792 of yacc.c */ #line 554 "griby.y" - { (grib_yyval.act) = grib_action_create_alias(grib_parser_context,(grib_yyvsp[(2) - (2)].str),NULL,NULL,0); free((grib_yyvsp[(2) - (2)].str)); } + { (grib_yyval.act) = grib_action_create_alias(grib_parser_context,(grib_yyvsp[0].str),NULL,NULL,0); free((grib_yyvsp[0].str)); } +#line 2942 "y.tab.c" break; case 111: -/* Line 1792 of yacc.c */ #line 557 "griby.y" - { - (grib_yyval.act) = grib_action_create_alias(grib_parser_context,(grib_yyvsp[(4) - (7)].str),(grib_yyvsp[(6) - (7)].str),(grib_yyvsp[(2) - (7)].str),(grib_yyvsp[(7) - (7)].lval)); free((grib_yyvsp[(2) - (7)].str)); free((grib_yyvsp[(4) - (7)].str)); free((grib_yyvsp[(6) - (7)].str)); + { + (grib_yyval.act) = grib_action_create_alias(grib_parser_context,(grib_yyvsp[-3].str),(grib_yyvsp[-1].str),(grib_yyvsp[-5].str),(grib_yyvsp[0].lval)); free((grib_yyvsp[-5].str)); free((grib_yyvsp[-3].str)); free((grib_yyvsp[-1].str)); } +#line 2950 "y.tab.c" break; case 112: -/* Line 1792 of yacc.c */ #line 561 "griby.y" - { - (grib_yyval.act) = grib_action_create_alias(grib_parser_context,(grib_yyvsp[(4) - (4)].str),NULL,(grib_yyvsp[(2) - (4)].str),0); free((grib_yyvsp[(2) - (4)].str)); free((grib_yyvsp[(4) - (4)].str)); + { + (grib_yyval.act) = grib_action_create_alias(grib_parser_context,(grib_yyvsp[0].str),NULL,(grib_yyvsp[-2].str),0); free((grib_yyvsp[-2].str)); free((grib_yyvsp[0].str)); } +#line 2958 "y.tab.c" break; case 113: -/* Line 1792 of yacc.c */ #line 565 "griby.y" - { (grib_yyval.act) = grib_action_create_meta(grib_parser_context,(grib_yyvsp[(2) - (8)].str),(grib_yyvsp[(3) - (8)].str),(grib_yyvsp[(5) - (8)].explist),(grib_yyvsp[(7) - (8)].explist),(grib_yyvsp[(8) - (8)].lval),NULL); free((grib_yyvsp[(2) - (8)].str));free((grib_yyvsp[(3) - (8)].str));} + { (grib_yyval.act) = grib_action_create_meta(grib_parser_context,(grib_yyvsp[-6].str),(grib_yyvsp[-5].str),(grib_yyvsp[-3].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL); free((grib_yyvsp[-6].str));free((grib_yyvsp[-5].str));} +#line 2964 "y.tab.c" break; case 114: -/* Line 1792 of yacc.c */ #line 568 "griby.y" - { (grib_yyval.act) = grib_action_create_meta(grib_parser_context,(grib_yyvsp[(4) - (10)].str),(grib_yyvsp[(5) - (10)].str),(grib_yyvsp[(7) - (10)].explist),(grib_yyvsp[(9) - (10)].explist),(grib_yyvsp[(10) - (10)].lval),(grib_yyvsp[(2) - (10)].str)); free((grib_yyvsp[(4) - (10)].str));free((grib_yyvsp[(5) - (10)].str));free((grib_yyvsp[(2) - (10)].str));} + { (grib_yyval.act) = grib_action_create_meta(grib_parser_context,(grib_yyvsp[-6].str),(grib_yyvsp[-5].str),(grib_yyvsp[-3].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),(grib_yyvsp[-8].str)); free((grib_yyvsp[-6].str));free((grib_yyvsp[-5].str));free((grib_yyvsp[-8].str));} +#line 2970 "y.tab.c" break; case 115: -/* Line 1792 of yacc.c */ #line 571 "griby.y" - { + { grib_arguments* a = grib_arguments_new( grib_parser_context, - new_accessor_expression(grib_parser_context,(grib_yyvsp[(2) - (5)].str),0,0), + new_accessor_expression(grib_parser_context,(grib_yyvsp[-3].str),0,0), NULL ); - a->next=(grib_yyvsp[(4) - (5)].explist); + a->next=(grib_yyvsp[-1].explist); (grib_yyval.act) = grib_action_create_meta(grib_parser_context, "ITERATOR","iterator",a,NULL, - GRIB_ACCESSOR_FLAG_HIDDEN|GRIB_ACCESSOR_FLAG_READ_ONLY,NULL); free((grib_yyvsp[(2) - (5)].str)); + GRIB_ACCESSOR_FLAG_HIDDEN|GRIB_ACCESSOR_FLAG_READ_ONLY,NULL); free((grib_yyvsp[-3].str)); } +#line 2986 "y.tab.c" break; case 116: -/* Line 1792 of yacc.c */ #line 583 "griby.y" - { + { grib_arguments* a = grib_arguments_new( grib_parser_context, - new_accessor_expression(grib_parser_context,(grib_yyvsp[(2) - (5)].str),0,0), + new_accessor_expression(grib_parser_context,(grib_yyvsp[-3].str),0,0), NULL ); - a->next=(grib_yyvsp[(4) - (5)].explist); + a->next=(grib_yyvsp[-1].explist); (grib_yyval.act) = grib_action_create_meta(grib_parser_context, "NEAREST","nearest",a,NULL, - GRIB_ACCESSOR_FLAG_HIDDEN|GRIB_ACCESSOR_FLAG_READ_ONLY,NULL); free((grib_yyvsp[(2) - (5)].str)); + GRIB_ACCESSOR_FLAG_HIDDEN|GRIB_ACCESSOR_FLAG_READ_ONLY,NULL); free((grib_yyvsp[-3].str)); } +#line 3002 "y.tab.c" break; case 117: -/* Line 1792 of yacc.c */ #line 595 "griby.y" - { + { grib_arguments* a = grib_arguments_new( grib_parser_context, - new_accessor_expression(grib_parser_context,(grib_yyvsp[(2) - (5)].str),0,0), + new_accessor_expression(grib_parser_context,(grib_yyvsp[-3].str),0,0), NULL ); - a->next=(grib_yyvsp[(4) - (5)].explist); + a->next=(grib_yyvsp[-1].explist); (grib_yyval.act) = grib_action_create_meta(grib_parser_context, "BOX","box",a,NULL, - GRIB_ACCESSOR_FLAG_HIDDEN|GRIB_ACCESSOR_FLAG_READ_ONLY,NULL); free((grib_yyvsp[(2) - (5)].str)); + GRIB_ACCESSOR_FLAG_HIDDEN|GRIB_ACCESSOR_FLAG_READ_ONLY,NULL); free((grib_yyvsp[-3].str)); } +#line 3018 "y.tab.c" break; case 118: -/* Line 1792 of yacc.c */ #line 607 "griby.y" - { (grib_yyval.act) = grib_action_create_put(grib_parser_context,(grib_yyvsp[(2) - (5)].str),(grib_yyvsp[(4) - (5)].explist));free((grib_yyvsp[(2) - (5)].str));} + { (grib_yyval.act) = grib_action_create_put(grib_parser_context,(grib_yyvsp[-3].str),(grib_yyvsp[-1].explist));free((grib_yyvsp[-3].str));} +#line 3024 "y.tab.c" break; case 119: -/* Line 1792 of yacc.c */ #line 610 "griby.y" - { (grib_yyval.act) = grib_action_create_remove(grib_parser_context,(grib_yyvsp[(2) - (2)].explist));} + { (grib_yyval.act) = grib_action_create_remove(grib_parser_context,(grib_yyvsp[0].explist));} +#line 3030 "y.tab.c" break; case 120: -/* Line 1792 of yacc.c */ #line 612 "griby.y" - { (grib_yyval.act) = grib_action_create_rename(grib_parser_context,(grib_yyvsp[(3) - (6)].str),(grib_yyvsp[(5) - (6)].str));free((grib_yyvsp[(3) - (6)].str));free((grib_yyvsp[(5) - (6)].str));} + { (grib_yyval.act) = grib_action_create_rename(grib_parser_context,(grib_yyvsp[-3].str),(grib_yyvsp[-1].str));free((grib_yyvsp[-3].str));free((grib_yyvsp[-1].str));} +#line 3036 "y.tab.c" break; case 121: -/* Line 1792 of yacc.c */ #line 615 "griby.y" - { (grib_yyval.act) = grib_action_create_assert(grib_parser_context,(grib_yyvsp[(3) - (4)].exp));} + { (grib_yyval.act) = grib_action_create_assert(grib_parser_context,(grib_yyvsp[-1].exp));} +#line 3042 "y.tab.c" break; case 122: -/* Line 1792 of yacc.c */ #line 618 "griby.y" - { (grib_yyval.act) = grib_action_create_modify(grib_parser_context,(grib_yyvsp[(2) - (3)].str),(grib_yyvsp[(3) - (3)].lval)); free((grib_yyvsp[(2) - (3)].str));} + { (grib_yyval.act) = grib_action_create_modify(grib_parser_context,(grib_yyvsp[-1].str),(grib_yyvsp[0].lval)); free((grib_yyvsp[-1].str));} +#line 3048 "y.tab.c" break; case 123: -/* Line 1792 of yacc.c */ #line 620 "griby.y" - { (grib_yyval.act) = grib_action_create_set_missing(grib_parser_context,(grib_yyvsp[(2) - (4)].str)); free((grib_yyvsp[(2) - (4)].str)); } + { (grib_yyval.act) = grib_action_create_set_missing(grib_parser_context,(grib_yyvsp[-2].str)); free((grib_yyvsp[-2].str)); } +#line 3054 "y.tab.c" break; case 124: -/* Line 1792 of yacc.c */ #line 621 "griby.y" - { (grib_yyval.act) = grib_action_create_set(grib_parser_context,(grib_yyvsp[(2) - (4)].str),(grib_yyvsp[(4) - (4)].exp),0); free((grib_yyvsp[(2) - (4)].str)); } + { (grib_yyval.act) = grib_action_create_set(grib_parser_context,(grib_yyvsp[-2].str),(grib_yyvsp[0].exp),0); free((grib_yyvsp[-2].str)); } +#line 3060 "y.tab.c" break; case 125: -/* Line 1792 of yacc.c */ #line 622 "griby.y" - { (grib_yyval.act) = grib_action_create_set_darray(grib_parser_context,(grib_yyvsp[(2) - (6)].str),(grib_yyvsp[(5) - (6)].dvalue)); free((grib_yyvsp[(2) - (6)].str)); } + { (grib_yyval.act) = grib_action_create_set_darray(grib_parser_context,(grib_yyvsp[-4].str),(grib_yyvsp[-1].dvalue)); free((grib_yyvsp[-4].str)); } +#line 3066 "y.tab.c" break; case 126: -/* Line 1792 of yacc.c */ #line 623 "griby.y" - { (grib_yyval.act) = grib_action_create_set_sarray(grib_parser_context,(grib_yyvsp[(2) - (6)].str),(grib_yyvsp[(5) - (6)].svalue)); free((grib_yyvsp[(2) - (6)].str)); } + { (grib_yyval.act) = grib_action_create_set_sarray(grib_parser_context,(grib_yyvsp[-4].str),(grib_yyvsp[-1].svalue)); free((grib_yyvsp[-4].str)); } +#line 3072 "y.tab.c" break; case 127: -/* Line 1792 of yacc.c */ #line 625 "griby.y" - { (grib_yyval.act) = grib_action_create_set(grib_parser_context,(grib_yyvsp[(2) - (4)].str),(grib_yyvsp[(4) - (4)].exp),1); free((grib_yyvsp[(2) - (4)].str)); } + { (grib_yyval.act) = grib_action_create_set(grib_parser_context,(grib_yyvsp[-2].str),(grib_yyvsp[0].exp),1); free((grib_yyvsp[-2].str)); } +#line 3078 "y.tab.c" break; case 128: -/* Line 1792 of yacc.c */ #line 628 "griby.y" - { (grib_yyval.act) = grib_action_create_write(grib_parser_context,(grib_yyvsp[(2) - (2)].str),0,0); free((grib_yyvsp[(2) - (2)].str));} + { (grib_yyval.act) = grib_action_create_write(grib_parser_context,(grib_yyvsp[0].str),0,0); free((grib_yyvsp[0].str));} +#line 3084 "y.tab.c" break; case 129: -/* Line 1792 of yacc.c */ #line 629 "griby.y" - { (grib_yyval.act) = grib_action_create_write(grib_parser_context,"",0,0); } + { (grib_yyval.act) = grib_action_create_write(grib_parser_context,"",0,0); } +#line 3090 "y.tab.c" break; case 130: -/* Line 1792 of yacc.c */ #line 630 "griby.y" - { (grib_yyval.act) = grib_action_create_write(grib_parser_context,(grib_yyvsp[(5) - (5)].str),0,(grib_yyvsp[(3) - (5)].lval)); free((grib_yyvsp[(5) - (5)].str));} + { (grib_yyval.act) = grib_action_create_write(grib_parser_context,(grib_yyvsp[0].str),0,(grib_yyvsp[-2].lval)); free((grib_yyvsp[0].str));} +#line 3096 "y.tab.c" break; case 131: -/* Line 1792 of yacc.c */ #line 631 "griby.y" - { (grib_yyval.act) = grib_action_create_write(grib_parser_context,"",0,(grib_yyvsp[(3) - (4)].lval)); } + { (grib_yyval.act) = grib_action_create_write(grib_parser_context,"",0,(grib_yyvsp[-1].lval)); } +#line 3102 "y.tab.c" break; case 132: -/* Line 1792 of yacc.c */ #line 632 "griby.y" - { (grib_yyval.act) = grib_action_create_write(grib_parser_context,(grib_yyvsp[(2) - (2)].str),1,0); free((grib_yyvsp[(2) - (2)].str));} + { (grib_yyval.act) = grib_action_create_write(grib_parser_context,(grib_yyvsp[0].str),1,0); free((grib_yyvsp[0].str));} +#line 3108 "y.tab.c" break; case 133: -/* Line 1792 of yacc.c */ #line 633 "griby.y" - { (grib_yyval.act) = grib_action_create_write(grib_parser_context,"",1,0); } + { (grib_yyval.act) = grib_action_create_write(grib_parser_context,"",1,0); } +#line 3114 "y.tab.c" break; case 134: -/* Line 1792 of yacc.c */ #line 634 "griby.y" - { (grib_yyval.act) = grib_action_create_write(grib_parser_context,(grib_yyvsp[(5) - (5)].str),1,(grib_yyvsp[(3) - (5)].lval)); free((grib_yyvsp[(5) - (5)].str));} + { (grib_yyval.act) = grib_action_create_write(grib_parser_context,(grib_yyvsp[0].str),1,(grib_yyvsp[-2].lval)); free((grib_yyvsp[0].str));} +#line 3120 "y.tab.c" break; case 135: -/* Line 1792 of yacc.c */ #line 635 "griby.y" - { (grib_yyval.act) = grib_action_create_write(grib_parser_context,"",1,(grib_yyvsp[(3) - (4)].lval)); } + { (grib_yyval.act) = grib_action_create_write(grib_parser_context,"",1,(grib_yyvsp[-1].lval)); } +#line 3126 "y.tab.c" break; case 136: -/* Line 1792 of yacc.c */ #line 637 "griby.y" - { (grib_yyval.act) = grib_action_create_close(grib_parser_context,(grib_yyvsp[(3) - (4)].str)); free((grib_yyvsp[(3) - (4)].str));} + { (grib_yyval.act) = grib_action_create_close(grib_parser_context,(grib_yyvsp[-1].str)); free((grib_yyvsp[-1].str));} +#line 3132 "y.tab.c" break; case 137: -/* Line 1792 of yacc.c */ #line 638 "griby.y" - { (grib_yyval.act) = grib_action_create_print(grib_parser_context,(grib_yyvsp[(2) - (2)].str),0); free((grib_yyvsp[(2) - (2)].str)); } + { (grib_yyval.act) = grib_action_create_print(grib_parser_context,(grib_yyvsp[0].str),0); free((grib_yyvsp[0].str)); } +#line 3138 "y.tab.c" break; case 138: -/* Line 1792 of yacc.c */ #line 639 "griby.y" - { (grib_yyval.act) = grib_action_create_print(grib_parser_context,(grib_yyvsp[(5) - (5)].str),(grib_yyvsp[(3) - (5)].str)); free((grib_yyvsp[(5) - (5)].str)); free((grib_yyvsp[(3) - (5)].str));} + { (grib_yyval.act) = grib_action_create_print(grib_parser_context,(grib_yyvsp[0].str),(grib_yyvsp[-2].str)); free((grib_yyvsp[0].str)); free((grib_yyvsp[-2].str));} +#line 3144 "y.tab.c" break; case 139: -/* Line 1792 of yacc.c */ #line 640 "griby.y" - { (grib_yyval.act) = grib_action_create_print(grib_parser_context,(grib_yyvsp[(5) - (5)].str),(grib_yyvsp[(3) - (5)].str)); free((grib_yyvsp[(5) - (5)].str)); free((grib_yyvsp[(3) - (5)].str));} + { (grib_yyval.act) = grib_action_create_print(grib_parser_context,(grib_yyvsp[0].str),(grib_yyvsp[-2].str)); free((grib_yyvsp[0].str)); free((grib_yyvsp[-2].str));} +#line 3150 "y.tab.c" break; case 140: -/* Line 1792 of yacc.c */ #line 641 "griby.y" - { (grib_yyval.act) = grib_action_create_print(grib_parser_context,"",0); } + { (grib_yyval.act) = grib_action_create_print(grib_parser_context,"",0); } +#line 3156 "y.tab.c" break; case 141: -/* Line 1792 of yacc.c */ #line 645 "griby.y" - { (grib_yyval.act) = grib_action_create_if(grib_parser_context,(grib_yyvsp[(3) - (7)].exp),(grib_yyvsp[(6) - (7)].act),0,0,grib_yylineno,file_being_parsed()); } + { (grib_yyval.act) = grib_action_create_if(grib_parser_context,(grib_yyvsp[-4].exp),(grib_yyvsp[-1].act),0,0,grib_yylineno,file_being_parsed()); } +#line 3162 "y.tab.c" break; case 142: -/* Line 1792 of yacc.c */ #line 646 "griby.y" - { (grib_yyval.act) = grib_action_create_if(grib_parser_context,(grib_yyvsp[(3) - (11)].exp),(grib_yyvsp[(6) - (11)].act),(grib_yyvsp[(10) - (11)].act),0,grib_yylineno,file_being_parsed()); } + { (grib_yyval.act) = grib_action_create_if(grib_parser_context,(grib_yyvsp[-8].exp),(grib_yyvsp[-5].act),(grib_yyvsp[-1].act),0,grib_yylineno,file_being_parsed()); } +#line 3168 "y.tab.c" break; case 143: -/* Line 1792 of yacc.c */ #line 647 "griby.y" - { (grib_yyval.act) = grib_action_create_if(grib_parser_context,(grib_yyvsp[(3) - (7)].exp),(grib_yyvsp[(6) - (7)].act),0,1,grib_yylineno,file_being_parsed()); } + { (grib_yyval.act) = grib_action_create_if(grib_parser_context,(grib_yyvsp[-4].exp),(grib_yyvsp[-1].act),0,1,grib_yylineno,file_being_parsed()); } +#line 3174 "y.tab.c" break; case 144: -/* Line 1792 of yacc.c */ #line 648 "griby.y" - { (grib_yyval.act) = grib_action_create_if(grib_parser_context,(grib_yyvsp[(3) - (11)].exp),(grib_yyvsp[(6) - (11)].act),(grib_yyvsp[(10) - (11)].act),1,grib_yylineno,file_being_parsed()); } + { (grib_yyval.act) = grib_action_create_if(grib_parser_context,(grib_yyvsp[-8].exp),(grib_yyvsp[-5].act),(grib_yyvsp[-1].act),1,grib_yylineno,file_being_parsed()); } +#line 3180 "y.tab.c" break; case 145: -/* Line 1792 of yacc.c */ #line 652 "griby.y" - { (grib_yyval.act) = grib_action_create_when(grib_parser_context,(grib_yyvsp[(3) - (6)].exp),(grib_yyvsp[(5) - (6)].act),NULL); } + { (grib_yyval.act) = grib_action_create_when(grib_parser_context,(grib_yyvsp[-3].exp),(grib_yyvsp[-1].act),NULL); } +#line 3186 "y.tab.c" break; case 146: -/* Line 1792 of yacc.c */ #line 653 "griby.y" - { (grib_yyval.act) = grib_action_create_when(grib_parser_context,(grib_yyvsp[(3) - (7)].exp),(grib_yyvsp[(6) - (7)].act),NULL); } + { (grib_yyval.act) = grib_action_create_when(grib_parser_context,(grib_yyvsp[-4].exp),(grib_yyvsp[-1].act),NULL); } +#line 3192 "y.tab.c" break; case 147: -/* Line 1792 of yacc.c */ #line 654 "griby.y" - { (grib_yyval.act) = grib_action_create_when(grib_parser_context,(grib_yyvsp[(3) - (11)].exp),(grib_yyvsp[(6) - (11)].act),(grib_yyvsp[(10) - (11)].act)); } + { (grib_yyval.act) = grib_action_create_when(grib_parser_context,(grib_yyvsp[-8].exp),(grib_yyvsp[-5].act),(grib_yyvsp[-1].act)); } +#line 3198 "y.tab.c" break; case 148: -/* Line 1792 of yacc.c */ #line 657 "griby.y" - { (grib_yyval.act) = grib_action_create_set(grib_parser_context,(grib_yyvsp[(2) - (4)].str),(grib_yyvsp[(4) - (4)].exp),0); free((grib_yyvsp[(2) - (4)].str)); } + { (grib_yyval.act) = grib_action_create_set(grib_parser_context,(grib_yyvsp[-2].str),(grib_yyvsp[0].exp),0); free((grib_yyvsp[-2].str)); } +#line 3204 "y.tab.c" break; case 149: -/* Line 1792 of yacc.c */ #line 658 "griby.y" - { (grib_yyval.act) = grib_action_create_set(grib_parser_context,(grib_yyvsp[(2) - (4)].str),(grib_yyvsp[(4) - (4)].exp),1); free((grib_yyvsp[(2) - (4)].str)); } + { (grib_yyval.act) = grib_action_create_set(grib_parser_context,(grib_yyvsp[-2].str),(grib_yyvsp[0].exp),1); free((grib_yyvsp[-2].str)); } +#line 3210 "y.tab.c" break; case 151: -/* Line 1792 of yacc.c */ #line 662 "griby.y" - { (grib_yyvsp[(1) - (3)].act)->next = (grib_yyvsp[(2) - (3)].act); (grib_yyval.act) = (grib_yyvsp[(1) - (3)].act); } + { (grib_yyvsp[-2].act)->next = (grib_yyvsp[-1].act); (grib_yyval.act) = (grib_yyvsp[-2].act); } +#line 3216 "y.tab.c" break; case 152: -/* Line 1792 of yacc.c */ #line 666 "griby.y" - { (grib_yyval.explist) = NULL ;} + { (grib_yyval.explist) = NULL ;} +#line 3222 "y.tab.c" break; case 153: -/* Line 1792 of yacc.c */ #line 667 "griby.y" - { (grib_yyval.explist) = (grib_yyvsp[(2) - (2)].explist) ;} + { (grib_yyval.explist) = (grib_yyvsp[0].explist) ;} +#line 3228 "y.tab.c" break; case 154: -/* Line 1792 of yacc.c */ #line 670 "griby.y" - { (grib_yyval.lval) = 0 ; } + { (grib_yyval.lval) = 0 ; } +#line 3234 "y.tab.c" break; case 155: -/* Line 1792 of yacc.c */ #line 671 "griby.y" - { (grib_yyval.lval) = (grib_yyvsp[(2) - (2)].lval); } + { (grib_yyval.lval) = (grib_yyvsp[0].lval); } +#line 3240 "y.tab.c" break; case 157: -/* Line 1792 of yacc.c */ #line 675 "griby.y" - { (grib_yyval.lval) = (grib_yyvsp[(1) - (3)].lval) | (grib_yyvsp[(3) - (3)].lval); } + { (grib_yyval.lval) = (grib_yyvsp[-2].lval) | (grib_yyvsp[0].lval); } +#line 3246 "y.tab.c" break; case 158: -/* Line 1792 of yacc.c */ #line 678 "griby.y" - { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_READ_ONLY; } + { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_READ_ONLY; } +#line 3252 "y.tab.c" break; case 159: -/* Line 1792 of yacc.c */ #line 679 "griby.y" - { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_LOWERCASE; } + { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_LOWERCASE; } +#line 3258 "y.tab.c" break; case 160: -/* Line 1792 of yacc.c */ #line 680 "griby.y" - { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_DUMP; } + { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_DUMP; } +#line 3264 "y.tab.c" break; case 161: -/* Line 1792 of yacc.c */ #line 681 "griby.y" - { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_NO_COPY; } + { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_NO_COPY; } +#line 3270 "y.tab.c" break; case 162: -/* Line 1792 of yacc.c */ #line 682 "griby.y" - { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_NO_FAIL; } + { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_NO_FAIL; } +#line 3276 "y.tab.c" break; case 163: -/* Line 1792 of yacc.c */ #line 683 "griby.y" - { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_HIDDEN; } + { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_HIDDEN; } +#line 3282 "y.tab.c" break; case 164: -/* Line 1792 of yacc.c */ #line 684 "griby.y" - { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; } + { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; } +#line 3288 "y.tab.c" break; case 165: -/* Line 1792 of yacc.c */ #line 685 "griby.y" - { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_CAN_BE_MISSING; } + { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_CAN_BE_MISSING; } +#line 3294 "y.tab.c" break; case 166: -/* Line 1792 of yacc.c */ #line 686 "griby.y" - { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_CONSTRAINT; } + { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_CONSTRAINT; } +#line 3300 "y.tab.c" break; case 167: -/* Line 1792 of yacc.c */ #line 687 "griby.y" - { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_COPY_OK; } + { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_COPY_OK; } +#line 3306 "y.tab.c" break; case 168: -/* Line 1792 of yacc.c */ #line 688 "griby.y" - { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_TRANSIENT; } + { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_TRANSIENT; } +#line 3312 "y.tab.c" break; case 169: -/* Line 1792 of yacc.c */ #line 689 "griby.y" - { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_STRING_TYPE; } + { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_STRING_TYPE; } +#line 3318 "y.tab.c" break; case 170: -/* Line 1792 of yacc.c */ #line 690 "griby.y" - { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_LONG_TYPE; } + { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_LONG_TYPE; } +#line 3324 "y.tab.c" break; case 171: -/* Line 1792 of yacc.c */ #line 691 "griby.y" - { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_DOUBLE_TYPE; } + { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_DOUBLE_TYPE; } +#line 3330 "y.tab.c" break; case 172: -/* Line 1792 of yacc.c */ #line 694 "griby.y" - { (grib_yyval.act) = grib_action_create_list(grib_parser_context,(grib_yyvsp[(1) - (8)].str),(grib_yyvsp[(4) - (8)].exp),(grib_yyvsp[(7) - (8)].act)); free((grib_yyvsp[(1) - (8)].str)); } + { (grib_yyval.act) = grib_action_create_list(grib_parser_context,(grib_yyvsp[-7].str),(grib_yyvsp[-4].exp),(grib_yyvsp[-1].act)); free((grib_yyvsp[-7].str)); } +#line 3336 "y.tab.c" break; case 173: -/* Line 1792 of yacc.c */ #line 697 "griby.y" - { (grib_yyval.act) = grib_action_create_while(grib_parser_context,(grib_yyvsp[(3) - (7)].exp),(grib_yyvsp[(6) - (7)].act)); } + { (grib_yyval.act) = grib_action_create_while(grib_parser_context,(grib_yyvsp[-4].exp),(grib_yyvsp[-1].act)); } +#line 3342 "y.tab.c" break; case 174: -/* Line 1792 of yacc.c */ #line 700 "griby.y" - { (grib_yyval.act) = grib_action_create_trigger(grib_parser_context,(grib_yyvsp[(3) - (7)].explist),(grib_yyvsp[(6) - (7)].act)); } + { (grib_yyval.act) = grib_action_create_trigger(grib_parser_context,(grib_yyvsp[-4].explist),(grib_yyvsp[-1].act)); } +#line 3348 "y.tab.c" break; case 175: -/* Line 1792 of yacc.c */ #line 703 "griby.y" - { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[(2) - (6)].str),(grib_yyvsp[(4) - (6)].concept_value),0,0,0,0,0,0,(grib_yyvsp[(6) - (6)].lval),0); free((grib_yyvsp[(2) - (6)].str)); } + { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[-4].str),(grib_yyvsp[-2].concept_value),0,0,0,0,0,0,(grib_yyvsp[0].lval),0); free((grib_yyvsp[-4].str)); } +#line 3354 "y.tab.c" break; case 176: -/* Line 1792 of yacc.c */ #line 704 "griby.y" - { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[(2) - (9)].str),(grib_yyvsp[(7) - (9)].concept_value),0,0,(grib_yyvsp[(4) - (9)].str),0,0,0,(grib_yyvsp[(9) - (9)].lval),0); free((grib_yyvsp[(2) - (9)].str));free((grib_yyvsp[(4) - (9)].str)); } + { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[-7].str),(grib_yyvsp[-2].concept_value),0,0,(grib_yyvsp[-5].str),0,0,0,(grib_yyvsp[0].lval),0); free((grib_yyvsp[-7].str));free((grib_yyvsp[-5].str)); } +#line 3360 "y.tab.c" break; case 177: -/* Line 1792 of yacc.c */ #line 705 "griby.y" - { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[(2) - (12)].str),0,(grib_yyvsp[(6) - (12)].str),0,(grib_yyvsp[(4) - (12)].str),(grib_yyvsp[(8) - (12)].str),(grib_yyvsp[(10) - (12)].str),0,(grib_yyvsp[(12) - (12)].lval),0); free((grib_yyvsp[(2) - (12)].str));free((grib_yyvsp[(6) - (12)].str));free((grib_yyvsp[(4) - (12)].str));free((grib_yyvsp[(8) - (12)].str));free((grib_yyvsp[(10) - (12)].str)); } + { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[-10].str),0,(grib_yyvsp[-6].str),0,(grib_yyvsp[-8].str),(grib_yyvsp[-4].str),(grib_yyvsp[-2].str),0,(grib_yyvsp[0].lval),0); free((grib_yyvsp[-10].str));free((grib_yyvsp[-6].str));free((grib_yyvsp[-8].str));free((grib_yyvsp[-4].str));free((grib_yyvsp[-2].str)); } +#line 3366 "y.tab.c" break; case 178: -/* Line 1792 of yacc.c */ #line 706 "griby.y" - { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[(2) - (14)].str),0,(grib_yyvsp[(6) - (14)].str),0,(grib_yyvsp[(4) - (14)].str),(grib_yyvsp[(8) - (14)].str),(grib_yyvsp[(10) - (14)].str),(grib_yyvsp[(12) - (14)].str),(grib_yyvsp[(14) - (14)].lval),0); free((grib_yyvsp[(2) - (14)].str));free((grib_yyvsp[(6) - (14)].str));free((grib_yyvsp[(4) - (14)].str));free((grib_yyvsp[(8) - (14)].str));free((grib_yyvsp[(10) - (14)].str));free((grib_yyvsp[(12) - (14)].str)); } + { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[-12].str),0,(grib_yyvsp[-8].str),0,(grib_yyvsp[-10].str),(grib_yyvsp[-6].str),(grib_yyvsp[-4].str),(grib_yyvsp[-2].str),(grib_yyvsp[0].lval),0); free((grib_yyvsp[-12].str));free((grib_yyvsp[-8].str));free((grib_yyvsp[-10].str));free((grib_yyvsp[-6].str));free((grib_yyvsp[-4].str));free((grib_yyvsp[-2].str)); } +#line 3372 "y.tab.c" break; case 179: -/* Line 1792 of yacc.c */ #line 707 "griby.y" - { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[(2) - (10)].str),0,(grib_yyvsp[(6) - (10)].str),0,(grib_yyvsp[(4) - (10)].str),(grib_yyvsp[(8) - (10)].str),0,0,(grib_yyvsp[(10) - (10)].lval),0); free((grib_yyvsp[(2) - (10)].str));free((grib_yyvsp[(6) - (10)].str));free((grib_yyvsp[(4) - (10)].str));free((grib_yyvsp[(8) - (10)].str)); } + { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[-8].str),0,(grib_yyvsp[-4].str),0,(grib_yyvsp[-6].str),(grib_yyvsp[-2].str),0,0,(grib_yyvsp[0].lval),0); free((grib_yyvsp[-8].str));free((grib_yyvsp[-4].str));free((grib_yyvsp[-6].str));free((grib_yyvsp[-2].str)); } +#line 3378 "y.tab.c" break; case 180: -/* Line 1792 of yacc.c */ #line 708 "griby.y" - { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[(4) - (14)].str),0,(grib_yyvsp[(8) - (14)].str),(grib_yyvsp[(2) - (14)].str),(grib_yyvsp[(6) - (14)].str),(grib_yyvsp[(10) - (14)].str),(grib_yyvsp[(12) - (14)].str),0,(grib_yyvsp[(14) - (14)].lval),0); free((grib_yyvsp[(4) - (14)].str));free((grib_yyvsp[(8) - (14)].str));free((grib_yyvsp[(6) - (14)].str));free((grib_yyvsp[(10) - (14)].str)); free((grib_yyvsp[(12) - (14)].str)); free((grib_yyvsp[(2) - (14)].str));} + { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[-10].str),0,(grib_yyvsp[-6].str),(grib_yyvsp[-12].str),(grib_yyvsp[-8].str),(grib_yyvsp[-4].str),(grib_yyvsp[-2].str),0,(grib_yyvsp[0].lval),0); free((grib_yyvsp[-10].str));free((grib_yyvsp[-6].str));free((grib_yyvsp[-8].str));free((grib_yyvsp[-4].str)); free((grib_yyvsp[-2].str)); free((grib_yyvsp[-12].str));} +#line 3384 "y.tab.c" break; case 181: -/* Line 1792 of yacc.c */ #line 709 "griby.y" - { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[(4) - (12)].str),0,(grib_yyvsp[(8) - (12)].str),(grib_yyvsp[(2) - (12)].str),(grib_yyvsp[(6) - (12)].str),(grib_yyvsp[(10) - (12)].str),0,0,(grib_yyvsp[(12) - (12)].lval),0); free((grib_yyvsp[(4) - (12)].str));free((grib_yyvsp[(8) - (12)].str));free((grib_yyvsp[(6) - (12)].str));free((grib_yyvsp[(10) - (12)].str)); free((grib_yyvsp[(2) - (12)].str));} + { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[-8].str),0,(grib_yyvsp[-4].str),(grib_yyvsp[-10].str),(grib_yyvsp[-6].str),(grib_yyvsp[-2].str),0,0,(grib_yyvsp[0].lval),0); free((grib_yyvsp[-8].str));free((grib_yyvsp[-4].str));free((grib_yyvsp[-6].str));free((grib_yyvsp[-2].str)); free((grib_yyvsp[-10].str));} +#line 3390 "y.tab.c" break; case 182: -/* Line 1792 of yacc.c */ #line 710 "griby.y" - { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[(4) - (8)].str),(grib_yyvsp[(6) - (8)].concept_value),0,(grib_yyvsp[(2) - (8)].str),0,0,0,0,(grib_yyvsp[(8) - (8)].lval),0); free((grib_yyvsp[(2) - (8)].str));free((grib_yyvsp[(4) - (8)].str)); } + { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[-4].str),(grib_yyvsp[-2].concept_value),0,(grib_yyvsp[-6].str),0,0,0,0,(grib_yyvsp[0].lval),0); free((grib_yyvsp[-6].str));free((grib_yyvsp[-4].str)); } +#line 3396 "y.tab.c" break; case 183: -/* Line 1792 of yacc.c */ #line 711 "griby.y" - { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[(4) - (11)].str),(grib_yyvsp[(9) - (11)].concept_value),0,(grib_yyvsp[(2) - (11)].str),(grib_yyvsp[(6) - (11)].str),0,0,0,(grib_yyvsp[(11) - (11)].lval),0); free((grib_yyvsp[(2) - (11)].str));free((grib_yyvsp[(4) - (11)].str));free((grib_yyvsp[(6) - (11)].str)); } + { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[-7].str),(grib_yyvsp[-2].concept_value),0,(grib_yyvsp[-9].str),(grib_yyvsp[-5].str),0,0,0,(grib_yyvsp[0].lval),0); free((grib_yyvsp[-9].str));free((grib_yyvsp[-7].str));free((grib_yyvsp[-5].str)); } +#line 3402 "y.tab.c" break; case 184: -/* Line 1792 of yacc.c */ #line 712 "griby.y" - { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[(2) - (6)].str),(grib_yyvsp[(4) - (6)].concept_value),0,0,0,0,0,0,(grib_yyvsp[(6) - (6)].lval),1); free((grib_yyvsp[(2) - (6)].str)); } + { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[-4].str),(grib_yyvsp[-2].concept_value),0,0,0,0,0,0,(grib_yyvsp[0].lval),1); free((grib_yyvsp[-4].str)); } +#line 3408 "y.tab.c" break; case 185: -/* Line 1792 of yacc.c */ #line 713 "griby.y" - { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[(2) - (9)].str),(grib_yyvsp[(7) - (9)].concept_value),0,0,(grib_yyvsp[(4) - (9)].str),0,0,0,(grib_yyvsp[(9) - (9)].lval),1); free((grib_yyvsp[(2) - (9)].str));free((grib_yyvsp[(4) - (9)].str)); } + { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[-7].str),(grib_yyvsp[-2].concept_value),0,0,(grib_yyvsp[-5].str),0,0,0,(grib_yyvsp[0].lval),1); free((grib_yyvsp[-7].str));free((grib_yyvsp[-5].str)); } +#line 3414 "y.tab.c" break; case 186: -/* Line 1792 of yacc.c */ #line 714 "griby.y" - { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[(2) - (12)].str),0,(grib_yyvsp[(6) - (12)].str),0,(grib_yyvsp[(4) - (12)].str),(grib_yyvsp[(8) - (12)].str),(grib_yyvsp[(10) - (12)].str),0,(grib_yyvsp[(12) - (12)].lval),1); free((grib_yyvsp[(2) - (12)].str));free((grib_yyvsp[(6) - (12)].str));free((grib_yyvsp[(4) - (12)].str));free((grib_yyvsp[(8) - (12)].str));free((grib_yyvsp[(10) - (12)].str)); } + { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[-10].str),0,(grib_yyvsp[-6].str),0,(grib_yyvsp[-8].str),(grib_yyvsp[-4].str),(grib_yyvsp[-2].str),0,(grib_yyvsp[0].lval),1); free((grib_yyvsp[-10].str));free((grib_yyvsp[-6].str));free((grib_yyvsp[-8].str));free((grib_yyvsp[-4].str));free((grib_yyvsp[-2].str)); } +#line 3420 "y.tab.c" break; case 187: -/* Line 1792 of yacc.c */ #line 715 "griby.y" - { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[(2) - (10)].str),0,(grib_yyvsp[(6) - (10)].str),0,(grib_yyvsp[(4) - (10)].str),(grib_yyvsp[(8) - (10)].str),0,0,(grib_yyvsp[(10) - (10)].lval),1); free((grib_yyvsp[(2) - (10)].str));free((grib_yyvsp[(6) - (10)].str));free((grib_yyvsp[(4) - (10)].str));free((grib_yyvsp[(8) - (10)].str)); } + { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[-8].str),0,(grib_yyvsp[-4].str),0,(grib_yyvsp[-6].str),(grib_yyvsp[-2].str),0,0,(grib_yyvsp[0].lval),1); free((grib_yyvsp[-8].str));free((grib_yyvsp[-4].str));free((grib_yyvsp[-6].str));free((grib_yyvsp[-2].str)); } +#line 3426 "y.tab.c" break; case 188: -/* Line 1792 of yacc.c */ #line 716 "griby.y" - { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[(4) - (14)].str),0,(grib_yyvsp[(8) - (14)].str),(grib_yyvsp[(2) - (14)].str),(grib_yyvsp[(6) - (14)].str),(grib_yyvsp[(10) - (14)].str),(grib_yyvsp[(12) - (14)].str),0,(grib_yyvsp[(14) - (14)].lval),1); free((grib_yyvsp[(4) - (14)].str));free((grib_yyvsp[(8) - (14)].str));free((grib_yyvsp[(6) - (14)].str));free((grib_yyvsp[(10) - (14)].str));free((grib_yyvsp[(12) - (14)].str)); free((grib_yyvsp[(2) - (14)].str));} + { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[-10].str),0,(grib_yyvsp[-6].str),(grib_yyvsp[-12].str),(grib_yyvsp[-8].str),(grib_yyvsp[-4].str),(grib_yyvsp[-2].str),0,(grib_yyvsp[0].lval),1); free((grib_yyvsp[-10].str));free((grib_yyvsp[-6].str));free((grib_yyvsp[-8].str));free((grib_yyvsp[-4].str));free((grib_yyvsp[-2].str)); free((grib_yyvsp[-12].str));} +#line 3432 "y.tab.c" break; case 189: -/* Line 1792 of yacc.c */ #line 717 "griby.y" - { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[(4) - (12)].str),0,(grib_yyvsp[(8) - (12)].str),(grib_yyvsp[(2) - (12)].str),(grib_yyvsp[(6) - (12)].str),(grib_yyvsp[(10) - (12)].str),0,0,(grib_yyvsp[(12) - (12)].lval),1); free((grib_yyvsp[(4) - (12)].str));free((grib_yyvsp[(8) - (12)].str));free((grib_yyvsp[(6) - (12)].str));free((grib_yyvsp[(10) - (12)].str)); free((grib_yyvsp[(2) - (12)].str));} + { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[-8].str),0,(grib_yyvsp[-4].str),(grib_yyvsp[-10].str),(grib_yyvsp[-6].str),(grib_yyvsp[-2].str),0,0,(grib_yyvsp[0].lval),1); free((grib_yyvsp[-8].str));free((grib_yyvsp[-4].str));free((grib_yyvsp[-6].str));free((grib_yyvsp[-2].str)); free((grib_yyvsp[-10].str));} +#line 3438 "y.tab.c" break; case 190: -/* Line 1792 of yacc.c */ #line 718 "griby.y" - { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[(4) - (8)].str),(grib_yyvsp[(6) - (8)].concept_value),0,(grib_yyvsp[(2) - (8)].str),0,0,0,0,(grib_yyvsp[(8) - (8)].lval),1); free((grib_yyvsp[(2) - (8)].str));free((grib_yyvsp[(4) - (8)].str)); } + { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[-4].str),(grib_yyvsp[-2].concept_value),0,(grib_yyvsp[-6].str),0,0,0,0,(grib_yyvsp[0].lval),1); free((grib_yyvsp[-6].str));free((grib_yyvsp[-4].str)); } +#line 3444 "y.tab.c" break; case 191: -/* Line 1792 of yacc.c */ #line 719 "griby.y" - { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[(4) - (11)].str),(grib_yyvsp[(9) - (11)].concept_value),0,(grib_yyvsp[(2) - (11)].str),(grib_yyvsp[(6) - (11)].str),0,0,0,(grib_yyvsp[(11) - (11)].lval),1); free((grib_yyvsp[(2) - (11)].str));free((grib_yyvsp[(4) - (11)].str));free((grib_yyvsp[(6) - (11)].str)); } + { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[-7].str),(grib_yyvsp[-2].concept_value),0,(grib_yyvsp[-9].str),(grib_yyvsp[-5].str),0,0,0,(grib_yyvsp[0].lval),1); free((grib_yyvsp[-9].str));free((grib_yyvsp[-7].str));free((grib_yyvsp[-5].str)); } +#line 3450 "y.tab.c" break; case 193: -/* Line 1792 of yacc.c */ #line 724 "griby.y" - { (grib_yyval.concept_value) = (grib_yyvsp[(2) - (2)].concept_value); (grib_yyvsp[(2) - (2)].concept_value)->next = (grib_yyvsp[(1) - (2)].concept_value); } + { (grib_yyval.concept_value) = (grib_yyvsp[0].concept_value); (grib_yyvsp[0].concept_value)->next = (grib_yyvsp[-1].concept_value); } +#line 3456 "y.tab.c" break; case 195: -/* Line 1792 of yacc.c */ #line 728 "griby.y" - { (grib_yyval.hash_array_value) = (grib_yyvsp[(2) - (2)].hash_array_value); (grib_yyvsp[(2) - (2)].hash_array_value)->next = (grib_yyvsp[(1) - (2)].hash_array_value); } + { (grib_yyval.hash_array_value) = (grib_yyvsp[0].hash_array_value); (grib_yyvsp[0].hash_array_value)->next = (grib_yyvsp[-1].hash_array_value); } +#line 3462 "y.tab.c" break; case 196: -/* Line 1792 of yacc.c */ #line 731 "griby.y" - { (grib_yyval.act) = grib_action_create_hash_array(grib_parser_context,(grib_yyvsp[(2) - (6)].str),(grib_yyvsp[(4) - (6)].hash_array_value),0,0,0,0,0,0,(grib_yyvsp[(6) - (6)].lval),0); free((grib_yyvsp[(2) - (6)].str)); } + { (grib_yyval.act) = grib_action_create_hash_array(grib_parser_context,(grib_yyvsp[-4].str),(grib_yyvsp[-2].hash_array_value),0,0,0,0,0,0,(grib_yyvsp[0].lval),0); free((grib_yyvsp[-4].str)); } +#line 3468 "y.tab.c" break; case 197: -/* Line 1792 of yacc.c */ #line 732 "griby.y" - { (grib_yyval.act) = grib_action_create_hash_array(grib_parser_context,(grib_yyvsp[(2) - (12)].str),0,(grib_yyvsp[(6) - (12)].str),0,(grib_yyvsp[(4) - (12)].str),(grib_yyvsp[(8) - (12)].str),(grib_yyvsp[(10) - (12)].str),0,(grib_yyvsp[(12) - (12)].lval),0); free((grib_yyvsp[(2) - (12)].str));free((grib_yyvsp[(6) - (12)].str));free((grib_yyvsp[(4) - (12)].str));free((grib_yyvsp[(8) - (12)].str));free((grib_yyvsp[(10) - (12)].str)); } + { (grib_yyval.act) = grib_action_create_hash_array(grib_parser_context,(grib_yyvsp[-10].str),0,(grib_yyvsp[-6].str),0,(grib_yyvsp[-8].str),(grib_yyvsp[-4].str),(grib_yyvsp[-2].str),0,(grib_yyvsp[0].lval),0); free((grib_yyvsp[-10].str));free((grib_yyvsp[-6].str));free((grib_yyvsp[-8].str));free((grib_yyvsp[-4].str));free((grib_yyvsp[-2].str)); } +#line 3474 "y.tab.c" break; case 199: -/* Line 1792 of yacc.c */ #line 736 "griby.y" - { (grib_yyval.case_value) = (grib_yyvsp[(2) - (2)].case_value); (grib_yyvsp[(2) - (2)].case_value)->next = (grib_yyvsp[(1) - (2)].case_value); } + { (grib_yyval.case_value) = (grib_yyvsp[0].case_value); (grib_yyvsp[0].case_value)->next = (grib_yyvsp[-1].case_value); } +#line 3480 "y.tab.c" break; case 200: -/* Line 1792 of yacc.c */ #line 739 "griby.y" - { (grib_yyval.case_value) = grib_case_new(grib_parser_context,(grib_yyvsp[(2) - (4)].explist),(grib_yyvsp[(4) - (4)].act)); } + { (grib_yyval.case_value) = grib_case_new(grib_parser_context,(grib_yyvsp[-2].explist),(grib_yyvsp[0].act)); } +#line 3486 "y.tab.c" break; case 201: -/* Line 1792 of yacc.c */ #line 743 "griby.y" - { (grib_yyval.act) = grib_action_create_switch(grib_parser_context,(grib_yyvsp[(3) - (10)].explist),(grib_yyvsp[(6) - (10)].case_value),(grib_yyvsp[(9) - (10)].act)); } + { (grib_yyval.act) = grib_action_create_switch(grib_parser_context,(grib_yyvsp[-7].explist),(grib_yyvsp[-4].case_value),(grib_yyvsp[-1].act)); } +#line 3492 "y.tab.c" break; case 202: -/* Line 1792 of yacc.c */ #line 744 "griby.y" - { (grib_yyval.act) = grib_action_create_switch(grib_parser_context,(grib_yyvsp[(3) - (9)].explist),(grib_yyvsp[(6) - (9)].case_value),grib_action_create_noop(grib_parser_context,"continue")); } + { (grib_yyval.act) = grib_action_create_switch(grib_parser_context,(grib_yyvsp[-6].explist),(grib_yyvsp[-3].case_value),grib_action_create_noop(grib_parser_context,"continue")); } +#line 3498 "y.tab.c" break; case 203: -/* Line 1792 of yacc.c */ #line 745 "griby.y" - { (grib_yyval.act) = grib_action_create_switch(grib_parser_context,(grib_yyvsp[(3) - (7)].explist),(grib_yyvsp[(6) - (7)].case_value),0); } + { (grib_yyval.act) = grib_action_create_switch(grib_parser_context,(grib_yyvsp[-4].explist),(grib_yyvsp[-1].case_value),0); } +#line 3504 "y.tab.c" break; case 204: -/* Line 1792 of yacc.c */ #line 748 "griby.y" - { - (grib_yyval.concept_value) = grib_concept_value_new(grib_parser_context,(grib_yyvsp[(1) - (5)].str),(grib_yyvsp[(4) - (5)].concept_condition)); free((grib_yyvsp[(1) - (5)].str));} + { + (grib_yyval.concept_value) = grib_concept_value_new(grib_parser_context,(grib_yyvsp[-4].str),(grib_yyvsp[-1].concept_condition)); free((grib_yyvsp[-4].str));} +#line 3511 "y.tab.c" break; case 205: -/* Line 1792 of yacc.c */ #line 750 "griby.y" - { - (grib_yyval.concept_value) = grib_concept_value_new(grib_parser_context,(grib_yyvsp[(1) - (5)].str),(grib_yyvsp[(4) - (5)].concept_condition)); free((grib_yyvsp[(1) - (5)].str));} + { + (grib_yyval.concept_value) = grib_concept_value_new(grib_parser_context,(grib_yyvsp[-4].str),(grib_yyvsp[-1].concept_condition)); free((grib_yyvsp[-4].str));} +#line 3518 "y.tab.c" break; case 206: -/* Line 1792 of yacc.c */ #line 752 "griby.y" - { - char buf[80]; sprintf(buf,"%ld",(long)(grib_yyvsp[(1) - (5)].lval)); (grib_yyval.concept_value) = grib_concept_value_new(grib_parser_context,buf,(grib_yyvsp[(4) - (5)].concept_condition));} + { + char buf[80]; sprintf(buf,"%ld",(long)(grib_yyvsp[-4].lval)); (grib_yyval.concept_value) = grib_concept_value_new(grib_parser_context,buf,(grib_yyvsp[-1].concept_condition));} +#line 3525 "y.tab.c" break; case 207: -/* Line 1792 of yacc.c */ #line 754 "griby.y" - { - char buf[80]; sprintf(buf,"%g",(double)(grib_yyvsp[(1) - (5)].dval)); (grib_yyval.concept_value) = grib_concept_value_new(grib_parser_context,buf,(grib_yyvsp[(4) - (5)].concept_condition));} + { + char buf[80]; sprintf(buf,"%g",(double)(grib_yyvsp[-4].dval)); (grib_yyval.concept_value) = grib_concept_value_new(grib_parser_context,buf,(grib_yyvsp[-1].concept_condition));} +#line 3532 "y.tab.c" break; case 209: -/* Line 1792 of yacc.c */ #line 759 "griby.y" - { (grib_yyvsp[(1) - (2)].concept_condition)->next = (grib_yyvsp[(2) - (2)].concept_condition); (grib_yyval.concept_condition) = (grib_yyvsp[(1) - (2)].concept_condition); } + { (grib_yyvsp[-1].concept_condition)->next = (grib_yyvsp[0].concept_condition); (grib_yyval.concept_condition) = (grib_yyvsp[-1].concept_condition); } +#line 3538 "y.tab.c" break; case 210: -/* Line 1792 of yacc.c */ #line 762 "griby.y" - { (grib_yyval.concept_condition) = grib_concept_condition_new(grib_parser_context,(grib_yyvsp[(1) - (4)].str),(grib_yyvsp[(3) - (4)].exp),0); free((grib_yyvsp[(1) - (4)].str)); } + { (grib_yyval.concept_condition) = grib_concept_condition_new(grib_parser_context,(grib_yyvsp[-3].str),(grib_yyvsp[-1].exp),0); free((grib_yyvsp[-3].str)); } +#line 3544 "y.tab.c" break; case 211: -/* Line 1792 of yacc.c */ #line 763 "griby.y" - { (grib_yyval.concept_condition) = grib_concept_condition_new(grib_parser_context,(grib_yyvsp[(1) - (6)].str),0,(grib_yyvsp[(4) - (6)].ivalue)); free((grib_yyvsp[(1) - (6)].str)); } + { (grib_yyval.concept_condition) = grib_concept_condition_new(grib_parser_context,(grib_yyvsp[-5].str),0,(grib_yyvsp[-2].ivalue)); free((grib_yyvsp[-5].str)); } +#line 3550 "y.tab.c" break; case 212: -/* Line 1792 of yacc.c */ #line 767 "griby.y" - { - (grib_yyval.hash_array_value) = grib_integer_hash_array_value_new(grib_parser_context,(grib_yyvsp[(1) - (5)].str),(grib_yyvsp[(4) - (5)].ivalue)); free((grib_yyvsp[(1) - (5)].str));} + { + (grib_yyval.hash_array_value) = grib_integer_hash_array_value_new(grib_parser_context,(grib_yyvsp[-4].str),(grib_yyvsp[-1].ivalue)); free((grib_yyvsp[-4].str));} +#line 3557 "y.tab.c" break; case 213: -/* Line 1792 of yacc.c */ #line 769 "griby.y" - { - (grib_yyval.hash_array_value) = grib_integer_hash_array_value_new(grib_parser_context,(grib_yyvsp[(1) - (5)].str),(grib_yyvsp[(4) - (5)].ivalue)); free((grib_yyvsp[(1) - (5)].str));} + { + (grib_yyval.hash_array_value) = grib_integer_hash_array_value_new(grib_parser_context,(grib_yyvsp[-4].str),(grib_yyvsp[-1].ivalue)); free((grib_yyvsp[-4].str));} +#line 3564 "y.tab.c" break; case 214: -/* Line 1792 of yacc.c */ #line 773 "griby.y" - { (grib_yyval.exp) = new_accessor_expression(grib_parser_context,(grib_yyvsp[(3) - (8)].str),(grib_yyvsp[(5) - (8)].lval),(grib_yyvsp[(7) - (8)].lval)); free((grib_yyvsp[(3) - (8)].str)); } + { (grib_yyval.exp) = new_accessor_expression(grib_parser_context,(grib_yyvsp[-5].str),(grib_yyvsp[-3].lval),(grib_yyvsp[-1].lval)); free((grib_yyvsp[-5].str)); } +#line 3570 "y.tab.c" break; case 215: -/* Line 1792 of yacc.c */ #line 774 "griby.y" - { (grib_yyval.exp) = new_accessor_expression(grib_parser_context,(grib_yyvsp[(1) - (1)].str),0,0); free((grib_yyvsp[(1) - (1)].str)); } + { (grib_yyval.exp) = new_accessor_expression(grib_parser_context,(grib_yyvsp[0].str),0,0); free((grib_yyvsp[0].str)); } +#line 3576 "y.tab.c" break; case 216: -/* Line 1792 of yacc.c */ #line 775 "griby.y" - { (grib_yyval.exp) = new_sub_string_expression(grib_parser_context,(grib_yyvsp[(3) - (8)].str),(grib_yyvsp[(5) - (8)].lval),(grib_yyvsp[(7) - (8)].lval)); free((grib_yyvsp[(3) - (8)].str)); } + { (grib_yyval.exp) = new_sub_string_expression(grib_parser_context,(grib_yyvsp[-5].str),(grib_yyvsp[-3].lval),(grib_yyvsp[-1].lval)); free((grib_yyvsp[-5].str)); } +#line 3582 "y.tab.c" break; case 217: -/* Line 1792 of yacc.c */ #line 776 "griby.y" - { (grib_yyval.exp) = new_string_expression(grib_parser_context,(grib_yyvsp[(1) - (1)].str)); free((grib_yyvsp[(1) - (1)].str)); } + { (grib_yyval.exp) = new_string_expression(grib_parser_context,(grib_yyvsp[0].str)); free((grib_yyvsp[0].str)); } +#line 3588 "y.tab.c" break; case 219: -/* Line 1792 of yacc.c */ #line 780 "griby.y" - { (grib_yyval.exp) = new_long_expression(grib_parser_context,(grib_yyvsp[(1) - (1)].lval)); } + { (grib_yyval.exp) = new_long_expression(grib_parser_context,(grib_yyvsp[0].lval)); } +#line 3594 "y.tab.c" break; case 220: -/* Line 1792 of yacc.c */ #line 781 "griby.y" - { (grib_yyval.exp) = new_double_expression(grib_parser_context,(grib_yyvsp[(1) - (1)].dval)); /* TODO: change to new_float_expression*/} + { (grib_yyval.exp) = new_double_expression(grib_parser_context,(grib_yyvsp[0].dval)); /* TODO: change to new_float_expression*/} +#line 3600 "y.tab.c" break; case 221: -/* Line 1792 of yacc.c */ #line 783 "griby.y" - { (grib_yyval.exp) = NULL; } + { (grib_yyval.exp) = NULL; } +#line 3606 "y.tab.c" break; case 222: -/* Line 1792 of yacc.c */ #line 784 "griby.y" - { (grib_yyval.exp) = new_true_expression(grib_parser_context); } + { (grib_yyval.exp) = new_true_expression(grib_parser_context); } +#line 3612 "y.tab.c" break; case 223: -/* Line 1792 of yacc.c */ #line 785 "griby.y" - { (grib_yyval.exp) = (grib_yyvsp[(2) - (3)].exp); } + { (grib_yyval.exp) = (grib_yyvsp[-1].exp); } +#line 3618 "y.tab.c" break; case 224: -/* Line 1792 of yacc.c */ #line 786 "griby.y" - { (grib_yyval.exp) = new_unop_expression(grib_parser_context,&grib_op_neg,&grib_op_neg_d,(grib_yyvsp[(2) - (2)].exp)); } + { (grib_yyval.exp) = new_unop_expression(grib_parser_context,&grib_op_neg,&grib_op_neg_d,(grib_yyvsp[0].exp)); } +#line 3624 "y.tab.c" break; case 225: -/* Line 1792 of yacc.c */ #line 787 "griby.y" - { (grib_yyval.exp) = new_func_expression(grib_parser_context,(grib_yyvsp[(1) - (3)].str),NULL); free((grib_yyvsp[(1) - (3)].str));} + { (grib_yyval.exp) = new_func_expression(grib_parser_context,(grib_yyvsp[-2].str),NULL); free((grib_yyvsp[-2].str));} +#line 3630 "y.tab.c" break; case 226: -/* Line 1792 of yacc.c */ #line 788 "griby.y" - { (grib_yyval.exp) = new_func_expression(grib_parser_context,(grib_yyvsp[(1) - (4)].str),(grib_yyvsp[(3) - (4)].explist)); free((grib_yyvsp[(1) - (4)].str));} + { (grib_yyval.exp) = new_func_expression(grib_parser_context,(grib_yyvsp[-3].str),(grib_yyvsp[-1].explist)); free((grib_yyvsp[-3].str));} +#line 3636 "y.tab.c" break; case 227: -/* Line 1792 of yacc.c */ #line 792 "griby.y" - { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_pow,NULL,(grib_yyvsp[(1) - (3)].exp),(grib_yyvsp[(3) - (3)].exp)); } + { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_pow,NULL,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } +#line 3642 "y.tab.c" break; case 229: -/* Line 1792 of yacc.c */ #line 796 "griby.y" - { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_mul,&grib_op_mul_d,(grib_yyvsp[(1) - (3)].exp),(grib_yyvsp[(3) - (3)].exp)); } + { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_mul,&grib_op_mul_d,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } +#line 3648 "y.tab.c" break; case 230: -/* Line 1792 of yacc.c */ #line 797 "griby.y" - { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_div,&grib_op_div_d,(grib_yyvsp[(1) - (3)].exp),(grib_yyvsp[(3) - (3)].exp)); } + { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_div,&grib_op_div_d,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } +#line 3654 "y.tab.c" break; case 231: -/* Line 1792 of yacc.c */ #line 798 "griby.y" - { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_modulo,NULL,(grib_yyvsp[(1) - (3)].exp),(grib_yyvsp[(3) - (3)].exp)); } + { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_modulo,NULL,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } +#line 3660 "y.tab.c" break; case 232: -/* Line 1792 of yacc.c */ #line 799 "griby.y" - { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_bit,NULL,(grib_yyvsp[(1) - (3)].exp),(grib_yyvsp[(3) - (3)].exp)); } + { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_bit,NULL,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } +#line 3666 "y.tab.c" break; case 233: -/* Line 1792 of yacc.c */ #line 800 "griby.y" - { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_bitoff,NULL,(grib_yyvsp[(1) - (3)].exp),(grib_yyvsp[(3) - (3)].exp)); } + { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_bitoff,NULL,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } +#line 3672 "y.tab.c" break; case 235: -/* Line 1792 of yacc.c */ #line 802 "griby.y" - { (grib_yyval.exp) = new_length_expression(grib_parser_context,(grib_yyvsp[(3) - (4)].str)); free((grib_yyvsp[(3) - (4)].str));} + { (grib_yyval.exp) = new_length_expression(grib_parser_context,(grib_yyvsp[-1].str)); free((grib_yyvsp[-1].str));} +#line 3678 "y.tab.c" break; case 236: -/* Line 1792 of yacc.c */ #line 803 "griby.y" - { (grib_yyval.exp) = new_is_in_list_expression(grib_parser_context,(grib_yyvsp[(3) - (6)].str),(grib_yyvsp[(5) - (6)].str)); free((grib_yyvsp[(3) - (6)].str));free((grib_yyvsp[(5) - (6)].str));} + { (grib_yyval.exp) = new_is_in_list_expression(grib_parser_context,(grib_yyvsp[-3].str),(grib_yyvsp[-1].str)); free((grib_yyvsp[-3].str));free((grib_yyvsp[-1].str));} +#line 3684 "y.tab.c" break; case 237: -/* Line 1792 of yacc.c */ #line 804 "griby.y" - { (grib_yyval.exp) = new_is_in_dict_expression(grib_parser_context,(grib_yyvsp[(3) - (6)].str),(grib_yyvsp[(5) - (6)].str)); free((grib_yyvsp[(3) - (6)].str));free((grib_yyvsp[(5) - (6)].str));} + { (grib_yyval.exp) = new_is_in_dict_expression(grib_parser_context,(grib_yyvsp[-3].str),(grib_yyvsp[-1].str)); free((grib_yyvsp[-3].str));free((grib_yyvsp[-1].str));} +#line 3690 "y.tab.c" break; case 238: -/* Line 1792 of yacc.c */ #line 805 "griby.y" - { (grib_yyval.exp) = new_is_integer_expression(grib_parser_context,(grib_yyvsp[(3) - (6)].str),(grib_yyvsp[(5) - (6)].lval),0); free((grib_yyvsp[(3) - (6)].str));} + { (grib_yyval.exp) = new_is_integer_expression(grib_parser_context,(grib_yyvsp[-3].str),(grib_yyvsp[-1].lval),0); free((grib_yyvsp[-3].str));} +#line 3696 "y.tab.c" break; case 239: -/* Line 1792 of yacc.c */ #line 806 "griby.y" - { (grib_yyval.exp) = new_is_integer_expression(grib_parser_context,(grib_yyvsp[(3) - (8)].str),(grib_yyvsp[(5) - (8)].lval),(grib_yyvsp[(7) - (8)].lval)); free((grib_yyvsp[(3) - (8)].str));} + { (grib_yyval.exp) = new_is_integer_expression(grib_parser_context,(grib_yyvsp[-5].str),(grib_yyvsp[-3].lval),(grib_yyvsp[-1].lval)); free((grib_yyvsp[-5].str));} +#line 3702 "y.tab.c" break; case 240: -/* Line 1792 of yacc.c */ #line 807 "griby.y" - { (grib_yyval.exp) = new_is_integer_expression(grib_parser_context,(grib_yyvsp[(3) - (4)].str),0,0); free((grib_yyvsp[(3) - (4)].str));} + { (grib_yyval.exp) = new_is_integer_expression(grib_parser_context,(grib_yyvsp[-1].str),0,0); free((grib_yyvsp[-1].str));} +#line 3708 "y.tab.c" break; case 241: -/* Line 1792 of yacc.c */ #line 810 "griby.y" - { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_add,&grib_op_add_d,(grib_yyvsp[(1) - (3)].exp),(grib_yyvsp[(3) - (3)].exp)); } + { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_add,&grib_op_add_d,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } +#line 3714 "y.tab.c" break; case 242: -/* Line 1792 of yacc.c */ #line 811 "griby.y" - { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_sub,&grib_op_sub_d,(grib_yyvsp[(1) - (3)].exp),(grib_yyvsp[(3) - (3)].exp)); } + { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_sub,&grib_op_sub_d,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } +#line 3720 "y.tab.c" break; case 244: -/* Line 1792 of yacc.c */ #line 815 "griby.y" - { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_gt,&grib_op_gt_d,(grib_yyvsp[(1) - (3)].exp),(grib_yyvsp[(3) - (3)].exp)); } + { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_gt,&grib_op_gt_d,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } +#line 3726 "y.tab.c" break; case 245: -/* Line 1792 of yacc.c */ #line 817 "griby.y" - { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_eq,&grib_op_eq_d,(grib_yyvsp[(1) - (3)].exp),(grib_yyvsp[(3) - (3)].exp)); } + { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_eq,&grib_op_eq_d,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } +#line 3732 "y.tab.c" break; case 246: -/* Line 1792 of yacc.c */ #line 818 "griby.y" - { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_lt,&grib_op_lt_d,(grib_yyvsp[(1) - (3)].exp),(grib_yyvsp[(3) - (3)].exp)); } + { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_lt,&grib_op_lt_d,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } +#line 3738 "y.tab.c" break; case 247: -/* Line 1792 of yacc.c */ #line 819 "griby.y" - { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_ge,&grib_op_ge_d,(grib_yyvsp[(1) - (3)].exp),(grib_yyvsp[(3) - (3)].exp)); } + { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_ge,&grib_op_ge_d,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } +#line 3744 "y.tab.c" break; case 248: -/* Line 1792 of yacc.c */ #line 820 "griby.y" - { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_le,&grib_op_le_d,(grib_yyvsp[(1) - (3)].exp),(grib_yyvsp[(3) - (3)].exp)); } + { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_le,&grib_op_le_d,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } +#line 3750 "y.tab.c" break; case 249: -/* Line 1792 of yacc.c */ #line 821 "griby.y" - { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_ne,&grib_op_ne_d,(grib_yyvsp[(1) - (3)].exp),(grib_yyvsp[(3) - (3)].exp)); } + { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_ne,&grib_op_ne_d,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } +#line 3756 "y.tab.c" break; case 250: -/* Line 1792 of yacc.c */ #line 822 "griby.y" - { (grib_yyval.exp) = new_string_compare_expression(grib_parser_context,(grib_yyvsp[(1) - (3)].exp),(grib_yyvsp[(3) - (3)].exp)); } + { (grib_yyval.exp) = new_string_compare_expression(grib_parser_context,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } +#line 3762 "y.tab.c" break; case 251: -/* Line 1792 of yacc.c */ #line 827 "griby.y" - { (grib_yyval.exp) = new_unop_expression(grib_parser_context,&grib_op_not,NULL,(grib_yyvsp[(2) - (2)].exp)); } + { (grib_yyval.exp) = new_unop_expression(grib_parser_context,&grib_op_not,NULL,(grib_yyvsp[0].exp)); } +#line 3768 "y.tab.c" break; case 253: -/* Line 1792 of yacc.c */ #line 831 "griby.y" - { (grib_yyval.exp) = new_logical_and_expression(grib_parser_context,(grib_yyvsp[(1) - (3)].exp),(grib_yyvsp[(3) - (3)].exp)); } + { (grib_yyval.exp) = new_logical_and_expression(grib_parser_context,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } +#line 3774 "y.tab.c" break; case 255: -/* Line 1792 of yacc.c */ #line 835 "griby.y" - { (grib_yyval.exp) = new_logical_or_expression(grib_parser_context,(grib_yyvsp[(1) - (3)].exp),(grib_yyvsp[(3) - (3)].exp));} + { (grib_yyval.exp) = new_logical_or_expression(grib_parser_context,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp));} +#line 3780 "y.tab.c" break; case 260: -/* Line 1792 of yacc.c */ #line 849 "griby.y" - { (grib_yyval.rule_entry) = grib_new_rule_entry(grib_parser_context,(grib_yyvsp[(1) - (4)].str),(grib_yyvsp[(3) - (4)].exp)); free((grib_yyvsp[(1) - (4)].str)); } + { (grib_yyval.rule_entry) = grib_new_rule_entry(grib_parser_context,(grib_yyvsp[-3].str),(grib_yyvsp[-1].exp)); free((grib_yyvsp[-3].str)); } +#line 3786 "y.tab.c" break; case 261: -/* Line 1792 of yacc.c */ #line 850 "griby.y" - { (grib_yyval.rule_entry) = grib_new_rule_entry(grib_parser_context,"skip",0);} + { (grib_yyval.rule_entry) = grib_new_rule_entry(grib_parser_context,"skip",0);} +#line 3792 "y.tab.c" break; case 263: -/* Line 1792 of yacc.c */ #line 854 "griby.y" - { (grib_yyvsp[(1) - (2)].rule_entry)->next = (grib_yyvsp[(2) - (2)].rule_entry); (grib_yyval.rule_entry) = (grib_yyvsp[(1) - (2)].rule_entry); } + { (grib_yyvsp[-1].rule_entry)->next = (grib_yyvsp[0].rule_entry); (grib_yyval.rule_entry) = (grib_yyvsp[-1].rule_entry); } +#line 3798 "y.tab.c" break; case 264: -/* Line 1792 of yacc.c */ #line 857 "griby.y" - { (grib_yyval.rules) = grib_new_rule(grib_parser_context,NULL,(grib_yyvsp[(1) - (1)].rule_entry)); } + { (grib_yyval.rules) = grib_new_rule(grib_parser_context,NULL,(grib_yyvsp[0].rule_entry)); } +#line 3804 "y.tab.c" break; case 265: -/* Line 1792 of yacc.c */ #line 861 "griby.y" - { (grib_yyval.rules) = grib_new_rule(grib_parser_context,(grib_yyvsp[(3) - (7)].exp),(grib_yyvsp[(6) - (7)].rule_entry)); } + { (grib_yyval.rules) = grib_new_rule(grib_parser_context,(grib_yyvsp[-4].exp),(grib_yyvsp[-1].rule_entry)); } +#line 3810 "y.tab.c" break; case 267: -/* Line 1792 of yacc.c */ #line 865 "griby.y" - { (grib_yyvsp[(1) - (2)].rules)->next = (grib_yyvsp[(2) - (2)].rules); (grib_yyval.rules) = (grib_yyvsp[(1) - (2)].rules); } + { (grib_yyvsp[-1].rules)->next = (grib_yyvsp[0].rules); (grib_yyval.rules) = (grib_yyvsp[-1].rules); } +#line 3816 "y.tab.c" break; -/* Line 1792 of yacc.c */ -#line 4022 "y.tab.c" +#line 3820 "y.tab.c" + default: break; } /* User semantic actions sometimes alter grib_yychar, and that requires @@ -4040,24 +3839,23 @@ grib_yyparse () *++grib_yyvsp = grib_yyval; - /* Now `shift' the result of the reduction. Determine what state + /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ - - grib_yyn = grib_yyr1[grib_yyn]; - - grib_yystate = grib_yypgoto[grib_yyn - YYNTOKENS] + *grib_yyssp; - if (0 <= grib_yystate && grib_yystate <= YYLAST && grib_yycheck[grib_yystate] == *grib_yyssp) - grib_yystate = grib_yytable[grib_yystate]; - else - grib_yystate = grib_yydefgoto[grib_yyn - YYNTOKENS]; + { + const int grib_yylhs = grib_yyr1[grib_yyn] - YYNTOKENS; + const int grib_yyi = grib_yypgoto[grib_yylhs] + *grib_yyssp; + grib_yystate = (0 <= grib_yyi && grib_yyi <= YYLAST && grib_yycheck[grib_yyi] == *grib_yyssp + ? grib_yytable[grib_yyi] + : grib_yydefgoto[grib_yylhs]); + } goto grib_yynewstate; -/*------------------------------------. -| grib_yyerrlab -- here on detecting error | -`------------------------------------*/ +/*--------------------------------------. +| grib_yyerrlab -- here on detecting error. | +`--------------------------------------*/ grib_yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ @@ -4082,7 +3880,7 @@ grib_yyparse () { if (grib_yymsg != grib_yymsgbuf) YYSTACK_FREE (grib_yymsg); - grib_yymsg = (char *) YYSTACK_ALLOC (grib_yymsg_alloc); + grib_yymsg = YY_CAST (char *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, grib_yymsg_alloc))); if (!grib_yymsg) { grib_yymsg = grib_yymsgbuf; @@ -4108,20 +3906,20 @@ grib_yyparse () if (grib_yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an - error, discard it. */ + error, discard it. */ if (grib_yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (grib_yychar == YYEOF) - YYABORT; - } + { + /* Return failure if at end of input. */ + if (grib_yychar == YYEOF) + YYABORT; + } else - { - grib_yydestruct ("Error: discarding", - grib_yytoken, &grib_yylval); - grib_yychar = YYEMPTY; - } + { + grib_yydestruct ("Error: discarding", + grib_yytoken, &grib_yylval); + grib_yychar = YYEMPTY; + } } /* Else will try to reuse lookahead token after shifting the error @@ -4133,14 +3931,12 @@ grib_yyparse () | grib_yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ grib_yyerrorlab: + /* Pacify compilers when the user code never invokes YYERROR and the + label grib_yyerrorlab therefore never appears in user code. */ + if (0) + YYERROR; - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label grib_yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto grib_yyerrorlab; - - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (grib_yylen); grib_yylen = 0; @@ -4153,29 +3949,29 @@ grib_yyparse () | grib_yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ grib_yyerrlab1: - grib_yyerrstatus = 3; /* Each real token shifted decrements this. */ + grib_yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { grib_yyn = grib_yypact[grib_yystate]; if (!grib_yypact_value_is_default (grib_yyn)) - { - grib_yyn += YYTERROR; - if (0 <= grib_yyn && grib_yyn <= YYLAST && grib_yycheck[grib_yyn] == YYTERROR) - { - grib_yyn = grib_yytable[grib_yyn]; - if (0 < grib_yyn) - break; - } - } + { + grib_yyn += YYTERROR; + if (0 <= grib_yyn && grib_yyn <= YYLAST && grib_yycheck[grib_yyn] == YYTERROR) + { + grib_yyn = grib_yytable[grib_yyn]; + if (0 < grib_yyn) + break; + } + } /* Pop the current state because it cannot handle the error token. */ if (grib_yyssp == grib_yyss) - YYABORT; + YYABORT; grib_yydestruct ("Error: popping", - grib_yystos[grib_yystate], grib_yyvsp); + grib_yystos[grib_yystate], grib_yyvsp); YYPOPSTACK (1); grib_yystate = *grib_yyssp; YY_STACK_PRINT (grib_yyss, grib_yyssp); @@ -4200,6 +3996,7 @@ grib_yyparse () grib_yyresult = 0; goto grib_yyreturn; + /*-----------------------------------. | grib_yyabortlab -- YYABORT comes here. | `-----------------------------------*/ @@ -4207,6 +4004,7 @@ grib_yyparse () grib_yyresult = 1; goto grib_yyreturn; + #if !defined grib_yyoverflow || YYERROR_VERBOSE /*-------------------------------------------------. | grib_yyexhaustedlab -- memory exhaustion comes here. | @@ -4217,6 +4015,10 @@ grib_yyparse () /* Fall through. */ #endif + +/*-----------------------------------------------------. +| grib_yyreturn -- parsing is finished, return the result. | +`-----------------------------------------------------*/ grib_yyreturn: if (grib_yychar != YYEMPTY) { @@ -4226,14 +4028,14 @@ grib_yyparse () grib_yydestruct ("Cleanup: discarding lookahead", grib_yytoken, &grib_yylval); } - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (grib_yylen); YY_STACK_PRINT (grib_yyss, grib_yyssp); while (grib_yyssp != grib_yyss) { grib_yydestruct ("Cleanup: popping", - grib_yystos[*grib_yyssp], grib_yyvsp); + grib_yystos[+*grib_yyssp], grib_yyvsp); YYPOPSTACK (1); } #ifndef grib_yyoverflow @@ -4244,12 +4046,8 @@ grib_yyparse () if (grib_yymsg != grib_yymsgbuf) YYSTACK_FREE (grib_yymsg); #endif - /* Make sure YYID is used. */ - return YYID (grib_yyresult); + return grib_yyresult; } - - -/* Line 2055 of yacc.c */ #line 869 "griby.y" diff --git a/src/grib_yacc.h b/src/grib_yacc.h index d76cb65c8..5fe8ca334 100644 --- a/src/grib_yacc.h +++ b/src/grib_yacc.h @@ -1,19 +1,20 @@ -/* A Bison parser, made by GNU Bison 2.7. */ +/* A Bison parser, made by GNU Bison 3.5.4. */ /* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation, + Inc. + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -26,13 +27,16 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ +/* Undocumented macros, especially those whose name start with YY_, + are private implementation details. Do not rely on them. */ + #ifndef YY_YY_Y_TAB_H_INCLUDED # define YY_YY_Y_TAB_H_INCLUDED -/* Enabling traces. */ +/* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif @@ -40,137 +44,136 @@ extern int grib_yydebug; #endif -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum grib_yytokentype { - LOWERCASE = 258, - IF = 259, - IF_TRANSIENT = 260, - ELSE = 261, - END = 262, - CLOSE = 263, - UNSIGNED = 264, - TEMPLATE = 265, - TEMPLATE_NOFAIL = 266, - TRIGGER = 267, - ASCII = 268, - GROUP = 269, - NON_ALPHA = 270, - KSEC1EXPVER = 271, - LABEL = 272, - LIST = 273, - IS_IN_LIST = 274, - IS_IN_DICT = 275, - IS_INTEGER = 276, - TO_INTEGER = 277, - TO_STRING = 278, - SEX2DEC = 279, - WHILE = 280, - IBMFLOAT = 281, - SIGNED = 282, - UINT8 = 283, - INT8 = 284, - UINT16 = 285, - INT16 = 286, - UINT16_LITTLE_ENDIAN = 287, - INT16_LITTLE_ENDIAN = 288, - UINT32 = 289, - INT32 = 290, - UINT32_LITTLE_ENDIAN = 291, - INT32_LITTLE_ENDIAN = 292, - UINT64 = 293, - INT64 = 294, - UINT64_LITTLE_ENDIAN = 295, - INT64_LITTLE_ENDIAN = 296, - BLOB = 297, - BYTE = 298, - CODETABLE = 299, - SMART_TABLE = 300, - DICTIONARY = 301, - COMPLEX_CODETABLE = 302, - LOOKUP = 303, - ALIAS = 304, - UNALIAS = 305, - META = 306, - POS = 307, - INTCONST = 308, - TRANS = 309, - FLAGBIT = 310, - CONCEPT = 311, - GETENV = 312, - HASH_ARRAY = 313, - CONCEPT_NOFAIL = 314, - NIL = 315, - DUMMY = 316, - MODIFY = 317, - READ_ONLY = 318, - STRING_TYPE = 319, - LONG_TYPE = 320, - DOUBLE_TYPE = 321, - NO_COPY = 322, - DUMP = 323, - JSON = 324, - XML = 325, - NO_FAIL = 326, - EDITION_SPECIFIC = 327, - OVERRIDE = 328, - HIDDEN = 329, - CAN_BE_MISSING = 330, - MISSING = 331, - CONSTRAINT = 332, - COPY_OK = 333, - WHEN = 334, - SET = 335, - SET_NOFAIL = 336, - WRITE = 337, - APPEND = 338, - PRINT = 339, - EXPORT = 340, - REMOVE = 341, - RENAME = 342, - SKIP = 343, - PAD = 344, - SECTION_PADDING = 345, - MESSAGE = 346, - MESSAGE_COPY = 347, - PADTO = 348, - PADTOEVEN = 349, - PADTOMULTIPLE = 350, - G1_HALF_BYTE = 351, - G1_MESSAGE_LENGTH = 352, - G1_SECTION4_LENGTH = 353, - SECTION_LENGTH = 354, - LENGTH = 355, - FLAG = 356, - ITERATOR = 357, - NEAREST = 358, - BOX = 359, - KSEC = 360, - ASSERT = 361, - SUBSTR = 362, - CASE = 363, - SWITCH = 364, - DEFAULT = 365, - EQ = 366, - NE = 367, - GE = 368, - LE = 369, - LT = 370, - GT = 371, - BIT = 372, - BITOFF = 373, - AND = 374, - OR = 375, - NOT = 376, - IS = 377, - IDENT = 378, - STRING = 379, - INTEGER = 380, - FLOAT = 381 - }; + enum grib_yytokentype + { + LOWERCASE = 258, + IF = 259, + IF_TRANSIENT = 260, + ELSE = 261, + END = 262, + CLOSE = 263, + UNSIGNED = 264, + TEMPLATE = 265, + TEMPLATE_NOFAIL = 266, + TRIGGER = 267, + ASCII = 268, + GROUP = 269, + NON_ALPHA = 270, + KSEC1EXPVER = 271, + LABEL = 272, + LIST = 273, + IS_IN_LIST = 274, + IS_IN_DICT = 275, + IS_INTEGER = 276, + TO_INTEGER = 277, + TO_STRING = 278, + SEX2DEC = 279, + WHILE = 280, + IBMFLOAT = 281, + SIGNED = 282, + UINT8 = 283, + INT8 = 284, + UINT16 = 285, + INT16 = 286, + UINT16_LITTLE_ENDIAN = 287, + INT16_LITTLE_ENDIAN = 288, + UINT32 = 289, + INT32 = 290, + UINT32_LITTLE_ENDIAN = 291, + INT32_LITTLE_ENDIAN = 292, + UINT64 = 293, + INT64 = 294, + UINT64_LITTLE_ENDIAN = 295, + INT64_LITTLE_ENDIAN = 296, + BLOB = 297, + BYTE = 298, + CODETABLE = 299, + SMART_TABLE = 300, + DICTIONARY = 301, + COMPLEX_CODETABLE = 302, + LOOKUP = 303, + ALIAS = 304, + UNALIAS = 305, + META = 306, + POS = 307, + INTCONST = 308, + TRANS = 309, + FLAGBIT = 310, + CONCEPT = 311, + GETENV = 312, + HASH_ARRAY = 313, + CONCEPT_NOFAIL = 314, + NIL = 315, + DUMMY = 316, + MODIFY = 317, + READ_ONLY = 318, + STRING_TYPE = 319, + LONG_TYPE = 320, + DOUBLE_TYPE = 321, + NO_COPY = 322, + DUMP = 323, + JSON = 324, + XML = 325, + NO_FAIL = 326, + EDITION_SPECIFIC = 327, + OVERRIDE = 328, + HIDDEN = 329, + CAN_BE_MISSING = 330, + MISSING = 331, + CONSTRAINT = 332, + COPY_OK = 333, + WHEN = 334, + SET = 335, + SET_NOFAIL = 336, + WRITE = 337, + APPEND = 338, + PRINT = 339, + EXPORT = 340, + REMOVE = 341, + RENAME = 342, + SKIP = 343, + PAD = 344, + SECTION_PADDING = 345, + MESSAGE = 346, + MESSAGE_COPY = 347, + PADTO = 348, + PADTOEVEN = 349, + PADTOMULTIPLE = 350, + G1_HALF_BYTE = 351, + G1_MESSAGE_LENGTH = 352, + G1_SECTION4_LENGTH = 353, + SECTION_LENGTH = 354, + LENGTH = 355, + FLAG = 356, + ITERATOR = 357, + NEAREST = 358, + BOX = 359, + KSEC = 360, + ASSERT = 361, + SUBSTR = 362, + CASE = 363, + SWITCH = 364, + DEFAULT = 365, + EQ = 366, + NE = 367, + GE = 368, + LE = 369, + LT = 370, + GT = 371, + BIT = 372, + BITOFF = 373, + AND = 374, + OR = 375, + NOT = 376, + IS = 377, + IDENT = 378, + STRING = 379, + INTEGER = 380, + FLOAT = 381 + }; #endif /* Tokens. */ #define LOWERCASE 258 @@ -298,12 +301,10 @@ extern int grib_yydebug; #define INTEGER 380 #define FLOAT 381 - - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE +union YYSTYPE { -/* Line 2058 of yacc.c */ #line 39 "griby.y" char *str; @@ -322,29 +323,17 @@ typedef union YYSTYPE grib_rule *rules; grib_rule_entry *rule_entry; +#line 327 "y.tab.h" -/* Line 2058 of yacc.c */ -#line 328 "y.tab.h" -} YYSTYPE; +}; +typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 -# define grib_yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif + extern YYSTYPE grib_yylval; -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int grib_yyparse (void *YYPARSE_PARAM); -#else -int grib_yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus int grib_yyparse (void); -#else -int grib_yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ #endif /* !YY_YY_Y_TAB_H_INCLUDED */ diff --git a/src/gribl.l b/src/gribl.l index e1a985362..7f95db31e 100644 --- a/src/gribl.l +++ b/src/gribl.l @@ -28,7 +28,7 @@ flex buffer optimization break the includes. #define YY_INPUT(buf,result,max_size) \ { \ - int c = fgetc(yyin); \ + int c = fgetc(yyin); (void)max_size; \ result = (c == EOF) ? YY_NULL : (buf[0] = c, 1); \ } diff --git a/src/griby.y b/src/griby.y index 18401e911..c084d22d3 100644 --- a/src/griby.y +++ b/src/griby.y @@ -14,10 +14,10 @@ #include "grib_api_internal.h" /* #include "grib_parser.h" */ -extern int yylex(); +extern int yylex(void); extern int yyerror(const char*); extern int yylineno; -extern char* file_being_parsed(); +extern char* file_being_parsed(void); extern grib_action* grib_parser_all_actions; extern grib_concept_value* grib_parser_concept; diff --git a/src/makeyacc b/src/makeyacc index 3d406fcfe..747c95df4 100755 --- a/src/makeyacc +++ b/src/makeyacc @@ -1,4 +1,7 @@ set -xe + +# We use flex and bison + export LEX=flex export LEX_OUT=gribl.c $LEX -o gribl.c gribl.l @@ -7,6 +10,7 @@ sed 's/fgetc/getc/g' < grib_lex1.c > grib_lex.c rm -f grib_lex1.c rm -f $LEX_OUT +# This invokes bison yacc -v -d griby.y sed 's/yy/grib_yy/g' < y.tab.c > grib_yacc1.c sed 's/fgetc/getc/g' < grib_yacc1.c > grib_yacc.c diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 9bae32d2e..b3d03993f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -14,9 +14,9 @@ list( APPEND test_bins grib_double_cmp read_any julian - index + grib_indexing grib_multi_from_message - read_index + grib_read_index unit_tests bufr_keys_iter gauss_sub @@ -34,31 +34,30 @@ list( APPEND test_bins ieee grib_sh_imag grib_lam_bf - grib_lam_gp -) + grib_lam_gp ) foreach( tool ${test_bins} ) # here we use the fact that each tool has only one C file that matches its name ecbuild_add_executable( TARGET ${tool} NOINSTALL SOURCES ${tool}.c - LIBS eccodes - ) + LIBS eccodes ) endforeach() # Now add each test (shell scripts) ################################################# # These tests do not require any data downloads -list( APPEND tests_no_data_reqd +list(APPEND tests_no_data_reqd definitions grib_calendar unit_tests - md5 + grib_md5 grib_uerra grib_2nd_order_numValues grib_ecc-136 grib_ecc-967 grib_ecc-1065 + grib_ecc-1053 julian bufr_dump_samples bufr_json_samples @@ -67,11 +66,12 @@ list( APPEND tests_no_data_reqd bufr_rdbSubTypes grib_efas grib_sh_imag - diag + pseudo_diag grib_lambert_conformal -) + grib_g1fcperiod) + # These tests do require data downloads -list( APPEND tests_data_reqd +list(APPEND tests_data_reqd grib_data_quality_checks bpv_limit grib_complex @@ -151,14 +151,15 @@ list( APPEND tests_data_reqd grib_filter grib_multi grib_nearest_test - budg + pseudo_budg grib_gridType grib_octahedral + grib_mercator grib_global grib_concept grib_decimalPrecision grib_bitsPerValue - get_fail + grib_get_fail grib_missing grib_local grib_step @@ -167,7 +168,7 @@ list( APPEND tests_data_reqd grib_compare grib_copy grib_level - index + grib_indexing grib_bitmap grib_list grib_second_order @@ -182,8 +183,8 @@ list( APPEND tests_data_reqd grib_local_MeteoFrance grib_neg_fctime codes_split_file - grib_mars_types -) + grib_mars_types) + if( HAVE_FORTRAN AND ENABLE_EXTRA_TESTS ) list(APPEND tests_data_reqd bufr_dump_encode_fortran) list(APPEND tests_data_reqd bufr_dump_decode_fortran) @@ -200,14 +201,12 @@ endif() foreach( test ${tests_no_data_reqd} ) ecbuild_add_test( TARGET eccodes_t_${test} TYPE SCRIPT - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${test}.sh - ) + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${test}.sh ) endforeach() ecbuild_add_test( TARGET eccodes_t_grib_check_gaussian_grids TYPE SCRIPT CONDITION ECCODES_INSTALL_EXTRA_TOOLS - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_check_gaussian_grids.sh -) + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_check_gaussian_grids.sh ) # Note: making the test dependent on the grib files (with DEPENDS) @@ -220,15 +219,14 @@ foreach( test ${tests_data_reqd} ) COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${test}.sh RESOURCES asca_139.t1.ref TEST_DEPENDS eccodes_download_gribs eccodes_download_tigge_gribs - eccodes_download_bufrs eccodes_download_metars eccodes_download_gts - ) + eccodes_download_bufrs eccodes_download_metars eccodes_download_gts ) endforeach() if( HAVE_FORTRAN AND ENABLE_EXTRA_TESTS ) - set_tests_properties ( eccodes_t_bufr_dump_encode_fortran PROPERTIES TIMEOUT 2500) + set_tests_properties( eccodes_t_bufr_dump_encode_fortran PROPERTIES TIMEOUT 2500 ) endif() if( ENABLE_EXTRA_TESTS ) - set_tests_properties ( eccodes_t_bufr_dump_encode_C PROPERTIES TIMEOUT 2500) + set_tests_properties( eccodes_t_bufr_dump_encode_C PROPERTIES TIMEOUT 2500 ) endif() @@ -239,8 +237,7 @@ if( HAVE_PYTHON AND ENABLE_EXTRA_TESTS ) TYPE SCRIPT COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${test}.sh ENVIRONMENT PYTHON=${PYTHON_EXECUTABLE} PYTHONPATH=${PROJECT_BINARY_DIR}/${ECCODES_PYTHON_DIR} - TEST_DEPENDS eccodes_download_bufrs - ) + TEST_DEPENDS eccodes_download_bufrs ) endforeach() endif() @@ -251,8 +248,7 @@ ecbuild_add_test( TARGET eccodes_t_grib_lamb_az_eq_area CONDITION ENABLE_EXTRA_TESTS COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_lamb_az_eq_area.sh RESOURCES grib_lamb_az_eq_area.ref - TEST_DEPENDS eccodes_download_gribs -) + TEST_DEPENDS eccodes_download_gribs ) # These ones are conditional ########################################### @@ -260,91 +256,77 @@ ecbuild_add_test( TARGET eccodes_t_tools_data_from_stdin TYPE SCRIPT CONDITION NOT ECCODES_ON_WINDOWS AND ENABLE_EXTRA_TESTS COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tools_data_from_stdin.sh - TEST_DEPENDS eccodes_download_bufrs -) + TEST_DEPENDS eccodes_download_bufrs ) ecbuild_add_test( TARGET eccodes_t_bufr_ecc-197 TYPE SCRIPT CONDITION NOT ECCODES_ON_WINDOWS AND ENABLE_EXTRA_TESTS COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bufr_ecc-197.sh - TEST_DEPENDS eccodes_download_bufrs -) + TEST_DEPENDS eccodes_download_bufrs ) if( ENABLE_EXTRA_TESTS AND HAVE_ECCODES_THREADS ) ecbuild_add_executable( TARGET grib_encode_pthreads NOINSTALL SOURCES grib_encode_pthreads.c - LIBS eccodes - ) + LIBS eccodes ) ecbuild_add_test( TARGET eccodes_t_grib_encode_pthreads TYPE SCRIPT - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_encode_pthreads.sh - ) + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_encode_pthreads.sh ) - foreach( test grib_ecc-604 grib_ecc-604-encode bufr_ecc-604 ) + foreach( test grib_threads_ecc-604 grib_threads_ecc-604-encode bufr_threads_ecc-604 ) ecbuild_add_executable( TARGET ${test} NOINSTALL SOURCES ${test}.c - LIBS eccodes - ) + LIBS eccodes ) endforeach() - ecbuild_add_test( TARGET eccodes_t_grib_ecc-604 + ecbuild_add_test( TARGET eccodes_t_grib_threads_ecc-604 TYPE SCRIPT TEST_DEPENDS eccodes_download_gribs - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_ecc-604.sh - ) - ecbuild_add_test( TARGET eccodes_t_bufr_ecc-604 + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_threads_ecc-604.sh ) + ecbuild_add_test( TARGET eccodes_t_bufr_threads_ecc-604 TYPE SCRIPT TEST_DEPENDS eccodes_download_bufrs - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bufr_ecc-604.sh - ) + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bufr_threads_ecc-604.sh ) endif() ecbuild_add_test( TARGET eccodes_t_grib_to_netcdf TYPE SCRIPT CONDITION HAVE_NETCDF AND ENABLE_EXTRA_TESTS COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_to_netcdf.sh - TEST_DEPENDS eccodes_download_gribs -) + TEST_DEPENDS eccodes_download_gribs ) ecbuild_add_test( TARGET eccodes_t_grib_jpeg TYPE SCRIPT CONDITION HAVE_JPEG AND ENABLE_EXTRA_TESTS COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_jpeg.sh - TEST_DEPENDS eccodes_download_gribs -) + TEST_DEPENDS eccodes_download_gribs ) ecbuild_add_test( TARGET eccodes_t_grib_png TYPE SCRIPT CONDITION HAVE_PNG AND ENABLE_EXTRA_TESTS COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_png.sh - TEST_DEPENDS eccodes_download_gribs -) + TEST_DEPENDS eccodes_download_gribs ) ecbuild_add_test( TARGET eccodes_t_grib_ccsds TYPE SCRIPT CONDITION HAVE_AEC AND ENABLE_EXTRA_TESTS COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_ccsds.sh - TEST_DEPENDS eccodes_download_gribs -) + TEST_DEPENDS eccodes_download_gribs ) ecbuild_add_test( TARGET eccodes_t_grib_check_param_concepts TYPE SCRIPT CONDITION ENABLE_EXTRA_TESTS - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_check_param_concepts.sh -) + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_check_param_concepts.sh ) ecbuild_add_test( TARGET eccodes_t_bufr_split_by_rdbSubtype TYPE SCRIPT CONDITION ENABLE_EXTRA_TESTS AND ECCODES_INSTALL_EXTRA_TOOLS COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bufr_split_by_rdbSubtype.sh - TEST_DEPENDS eccodes_download_bufrs -) + TEST_DEPENDS eccodes_download_bufrs ) # Performance test. Must have -DENABLE_GRIB_TIMER=ON ecbuild_add_test( TARGET eccodes_t_grib_ecc-386 TYPE SCRIPT CONDITION ENABLE_EXTRA_TESTS AND ENABLE_GRIB_TIMER COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_ecc-386.sh - TEST_DEPENDS eccodes_download_gribs -) + TEST_DEPENDS eccodes_download_gribs ) diff --git a/tests/Makefile.am b/tests/Makefile.am index d52abe2d7..b74afccab 100755 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -27,14 +27,15 @@ TESTS = definitions.sh \ grib_ls.sh \ grib_filter.sh \ grib_multi.sh \ - budg.sh \ + pseudo_budg.sh \ + pseudo_diag.sh \ grib_gridType.sh \ grib_octahedral.sh \ grib_global.sh \ grib_concept.sh \ grib_decimalPrecision.sh \ grib_bitsPerValue.sh \ - get_fail.sh \ + grib_get_fail.sh \ grib_missing.sh \ grib_local.sh \ grib_step.sh \ @@ -42,7 +43,7 @@ TESTS = definitions.sh \ grib_iterator.sh \ grib_compare.sh \ grib_level.sh \ - index.sh \ + grib_indexing.sh \ grib_list.sh \ grib_second_order.sh \ grib_change_scanning.sh \ @@ -59,7 +60,7 @@ TESTS = definitions.sh \ grib_dump_debug.sh \ grib_jpeg.sh \ grib_ccsds.sh \ - md5.sh \ + grib_md5.sh \ grib_neg_fctime.sh \ bufr_ecc-286.sh \ bufr_ecc-288.sh @@ -71,7 +72,7 @@ download_data: @$(top_srcdir)/data/download.sh $(top_srcdir)/data noinst_PROGRAMS = packing_check gauss_sub read_any grib_double_cmp packing pack_unpack \ - julian read_index index gribex_perf\ + julian grib_read_index grib_indexing gribex_perf\ jpeg_perf grib_ccsds_perf so_perf png_perf bpv_limit laplacian \ unit_tests @@ -83,8 +84,8 @@ grib_double_cmp_SOURCES = grib_double_cmp.c pack_unpack_SOURCES = pack_unpack.c julian_SOURCES = julian.c unit_tests_SOURCES = unit_tests.c -index_SOURCES = index.c -read_index_SOURCES = read_index.c +grib_indexing_SOURCES = grib_indexing.c +grib_read_index_SOURCES = grib_read_index.c jpeg_perf_SOURCES = jpeg_perf.c so_perf_SOURCES = so_perf.c png_perf_SOURCES = png_perf.c diff --git a/tests/badgrib.sh b/tests/badgrib.sh index 15cba84c6..f307b5475 100755 --- a/tests/badgrib.sh +++ b/tests/badgrib.sh @@ -13,11 +13,11 @@ REDIRECT=/dev/null # Do not fail on wrong length -$EXEC ${tools_dir}/grib_ls -7 ${data_dir}/bad.grib 2> $REDIRECT > $REDIRECT +${tools_dir}/grib_ls -7 ${data_dir}/bad.grib 2> $REDIRECT > $REDIRECT # Do fail on wrong length set +e -$EXEC ${tools_dir}/grib_ls ${data_dir}/bad.grib 2> $REDIRECT > $REDIRECT +${tools_dir}/grib_ls ${data_dir}/bad.grib 2> $REDIRECT > $REDIRECT status=$? set -e [ $status -ne 0 ] diff --git a/tests/bpv_limit.sh b/tests/bpv_limit.sh index 1b7485fb5..f9746cb42 100755 --- a/tests/bpv_limit.sh +++ b/tests/bpv_limit.sh @@ -17,7 +17,7 @@ REDIRECT=/dev/null -$EXEC ./bpv_limit ${data_dir}/regular_latlon_surface.grib2 +$EXEC ${test_dir}/bpv_limit ${data_dir}/regular_latlon_surface.grib2 2>/dev/null # TODO: grib1 does not work yet. bpv=64 but decode does not fail as expected #for file in ${data_dir}/regular_latlon_surface.grib?; do diff --git a/tests/bufr_dump_encode_filter.sh b/tests/bufr_dump_encode_filter.sh index f5cf7801d..d3482d033 100755 --- a/tests/bufr_dump_encode_filter.sh +++ b/tests/bufr_dump_encode_filter.sh @@ -37,7 +37,7 @@ fRules=${label}.filter #----------------------------------------------------------- files=`cat ${data_dir}/bufr/bufr_data_files.txt` -# Exclude BUFR files for various reasosn: +# Exclude BUFR files for various reasons: # ias1_240.bufr: Too large. The filter rules file generated is too big for the parser! # tropical_cyclone.bufr: multi-message # syno_multi.bufr: multi-message diff --git a/tests/bufr_ecc-765.sh b/tests/bufr_ecc-765.sh index 32780309f..fafac9945 100755 --- a/tests/bufr_ecc-765.sh +++ b/tests/bufr_ecc-765.sh @@ -19,205 +19,40 @@ tempLog=temp.${label}.log tempSupp=temp.${label}.supp if test "x$ECCODES_TEST_WITH_VALGRIND" = "x"; then - echo "Environment variable ECCODES_TEST_WITH_VALGRIND not defined. Test disabled" - exit 0 + echo "Environment variable ECCODES_TEST_WITH_VALGRIND not defined. Test disabled" + exit 0 fi # The presence of ECCODES_TEST_WITH_VALGRIND environment variable redefines # tools_dir so we reset it to its original tools_dir=$build_dir/bin -# --------------------------------------------------------- -# Test 1: Set of BUFR files which have zero leaks. -# Over time this list should increase -# --------------------------------------------------------- -bufr_files_zero_leaks=" - 207003.bufr - PraticaTemp.bufr - aaen_55.bufr - aben_55.bufr - aeolus_wmo_26.bufr - delayed_repl_01.bufr - goes16_nm.bufr - israel_observations_2017041010.bufr - mhen_55.bufr - modw_87.bufr - sentinel1.bufr - synop_multi_subset.bufr - tropical_cyclone.bufr - uegabe.bufr -" - +files=`cat ${data_dir}/bufr/bufr_data_files.txt` VALGRIND_OPTIONS="--error-exitcode=1 --leak-check=full --log-file=$tempLog" # bufr_filter has a small leak to do with parsing and action files not related to BUFR decoding, # So instead we use bufr_ls to do the unpacking -for bf in $bufr_files_zero_leaks; do - valgrind $VALGRIND_OPTIONS ${tools_dir}/bufr_ls -s unpack=1 ${data_dir}/bufr/$bf >/dev/null +for bf in $files; do + valgrind $VALGRIND_OPTIONS ${tools_dir}/bufr_ls -s unpack=1 ${data_dir}/bufr/$bf >/dev/null done -# --------------------------------------------------------- -# Test 2: Set of BUFR files which have a small known leak. -# Over time this list should decrease -# --------------------------------------------------------- -bufr_files_known_leaks=" - ahws_139.bufr - airc_142.bufr - airc_144.bufr - airs_57.bufr - alws_139.bufr - amda_144.bufr - amsa_55.bufr - amsb_55.bufr - amse_55.bufr - amsu_55.bufr - amv2_87.bufr - amv3_87.bufr - asbh_139.bufr - asbl_139.bufr - asca_139.bufr - asch_139.bufr - ascs_139.bufr - aseh_139.bufr - asel_139.bufr - ashs_139.bufr - atap_55.bufr - ateu_155.bufr - atms_201.bufr - atov_55.bufr - avhm_87.bufr - avhn_87.bufr - avhr_58.bufr - b002_95.bufr - b002_96.bufr - b003_56.bufr - b004_145.bufr - b005_87.bufr - b005_89.bufr - b006_96.bufr - b007_31.bufr - bssh_170.bufr - bssh_176.bufr - bssh_178.bufr - bssh_180.bufr - btem_109.bufr - buoy_27.bufr - cmwi_87.bufr - cmwn_87.bufr - cnow_28.bufr - cori_156.bufr - crit_202.bufr - csrh_189.bufr - emsg_189.bufr - emsg_87.bufr - eum_iasi_twt.bufr - eumetsat_iasi_co.bufr - euwv_87.bufr - fy3a_154.bufr - fy3b_154.bufr - g2nd_208.bufr - g2to_206.bufr - go15_87.bufr - goee_87.bufr - goes_87.bufr - goga_89.bufr - gosat.bufr - grst_26.bufr - gsd1_208.bufr - gsd2_208.bufr - gsd3_208.bufr - gst4_26.bufr - hirb_55.bufr - hirs_55.bufr - ias1_240.bufr - iasi_241.bufr - ifco_208.bufr - ikco_217.bufr - imssnow.bufr - itrg_208.bufr - itwt_233.bufr - j2eo_216.bufr - j2nb_216.bufr - jaso_214.bufr - kond_209.bufr - maer_207.bufr - meta_140.bufr - metar_with_2_bias.bufr - mhsa_55.bufr - mhsb_55.bufr - mhse_55.bufr - mloz_206.bufr - modi_87.bufr - monw_87.bufr - new.bufr - nomi_206.bufr - nos1_208.bufr - nos2_208.bufr - nos3_208.bufr - nos4_208.bufr - nos5_208.bufr - nos6_208.bufr - nos7_208.bufr - nos8_208.bufr - ocea_131.bufr - ocea_132.bufr - ocea_133.bufr - ocea_21.bufr - pgps_110.bufr - pilo_91.bufr - profiler_european.bufr - rada_250.bufr - rado_250.bufr - s4kn_165.bufr - sb19_206.bufr - sbu8_206.bufr - ship_13.bufr - ship_19.bufr - ship_9.bufr - smin_49.bufr - smis_49.bufr - smiu_49.bufr - smos_203.bufr - sn4k_165.bufr - soil_7.bufr - srals3_ecmwf4.bufr - srals3_eumetsat.bufr - ssbt_127.bufr - stuk_7.bufr - syno_1.bufr - syno_3.bufr - syno_4.bufr - syno_multi.bufr - temp-land-with-substituted-values.bufr - temp_101.bufr - temp_102.bufr - temp_106.bufr - tmr7_129.bufr - tros_31.bufr - wavb_134.bufr -" - -cat > $tempSupp << EOF -{ - eccodes_string_split_suppression - Memcheck:Leak - match-leak-kinds: definite - fun:malloc - fun:string_split - fun:load_bufr_elements_table* - fun:bufr_get_from_table - fun:accessor_bufr_elements_table_get_descriptor - fun:grib_bufr_descriptor_new -} -EOF -VALGRIND_OPTIONS="--error-exitcode=1 --leak-check=full --log-file=$tempLog --suppressions=$tempSupp" - -# bufr_filter has a small leak to do with parsing and action files not related to BUFR decoding, -# So instead we use bufr_ls to do the unpacking -for bf in $bufr_files_known_leaks; do - valgrind $VALGRIND_OPTIONS ${tools_dir}/bufr_ls -s unpack=1 ${data_dir}/bufr/$bf >/dev/null -done +# Suppressions file +# ------------------ +#cat > $tempSupp << EOF +#{ +# eccodes_string_split_suppression +# Memcheck:Leak +# match-leak-kinds: definite +# fun:malloc +# fun:string_split +# fun:load_bufr_elements_table* +# fun:bufr_get_from_table +# fun:accessor_bufr_elements_table_get_descriptor +# fun:grib_bufr_descriptor_new +#} +#EOF +#VALGRIND_OPTIONS="--error-exitcode=1 --leak-check=full --log-file=$tempLog --suppressions=$tempSupp " # Clean up diff --git a/tests/bufr_extract_headers.c b/tests/bufr_extract_headers.c index dbc0d2a4a..6ba409baa 100644 --- a/tests/bufr_extract_headers.c +++ b/tests/bufr_extract_headers.c @@ -38,7 +38,7 @@ int main(int argc, char* argv[]) /* Mimic the behaviour of bufr_get -f -p keys for testing */ err = parse_keyval_string(NULL, keys, 0, GRIB_TYPE_UNDEFINED, requested_print_keys, &requested_print_keys_count); - assert(!err); + if (err) return 1; assert(requested_print_keys_count > 0); for (i = 0; i < num_messages; ++i) { int j; diff --git a/tests/bufr_threads_ecc-604.c b/tests/bufr_threads_ecc-604.c new file mode 100644 index 000000000..311fa967c --- /dev/null +++ b/tests/bufr_threads_ecc-604.c @@ -0,0 +1,193 @@ +/* + * Test for ECC-604: Each thread creates a new BUFR handle, optionaly clone it and/or write it out + */ +#include +#include +#include +#include + +#include "eccodes.h" +#include "grib_api_internal.h" + +/* These are passed in via argv */ +static size_t NUM_THREADS = 0; +static size_t FILES_PER_ITERATION = 0; +static char* INPUT_FILE = NULL; +int opt_dump = 0; /* If 1 then dump handle to /dev/null */ +int opt_clone = 0; /* If 1 then clone source handle */ +int opt_write = 0; /* If 1 write handle to file */ + +static int encode_file(char* template_file, char* output_file) +{ + FILE *in, *out = NULL; + codes_handle* source_handle = NULL; + const void* buffer = NULL; + size_t size = 0; + int err = 0; + long numSubsets = 0; + + assert(template_file); + in = fopen(template_file, "rb"); + assert(in); + if (opt_write) { + assert(output_file); + out = fopen(output_file, "wb"); + assert(out); + } + + /* loop over the messages in the source BUFR and clone them */ + while ((source_handle = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) { + codes_handle* h = source_handle; + + if (opt_clone) { + h = codes_handle_clone(source_handle); + assert(h); + } + + CODES_CHECK(codes_get_long(h, "numberOfSubsets", &numSubsets), 0); + CODES_CHECK(codes_set_long(h, "unpack", 1), 0); + + CODES_CHECK(codes_get_message(h, &buffer, &size), 0); + if (opt_write) { + if (fwrite(buffer, 1, size, out) != size) { + perror(output_file); + return 1; + } + } + if (opt_dump) { + FILE* devnull = fopen("/dev/null", "w"); + grib_dumper* dumper = NULL; + const char* dumper_name = "bufr_simple"; + unsigned long dump_flags = CODES_DUMP_FLAG_ALL_DATA; + /* codes_dump_content(source_handle,devnull, "json", 1024, NULL); */ /* JSON dump with all attributes */ + dumper = grib_dump_content_with_dumper(source_handle, dumper, devnull, dumper_name, dump_flags, NULL); + Assert(dumper); + fclose(devnull); + } + + codes_handle_delete(source_handle); + if (opt_clone) codes_handle_delete(h); + } + + if (opt_write) fclose(out); + fclose(in); + + return 0; +} + +void do_stuff(void* data); + +/* Structure for passing data to threads */ +struct v +{ + size_t number; + char* data; +}; + +void* runner(void* ptr); /* the thread */ + +int main(int argc, char** argv) +{ + size_t i; + int thread_counter = 0; + int parallel = 1, index = 0, c = 0; + const char* prog = argv[0]; + char* mode; + if (argc < 5 || argc > 7) { + fprintf(stderr, "Usage:\n\t%s [options] seq file numRuns numIter\nOr\n\t%s [options] par file numThreads numIter\n", prog, prog); + return 1; + } + + while ((c = getopt(argc, argv, "dcw")) != -1) { + switch (c) { + case 'd': + opt_dump = 1; + break; + case 'c': + opt_clone = 1; + break; + case 'w': + opt_write = 1; + break; + } + } + index = optind; + mode = argv[index]; + INPUT_FILE = argv[index + 1]; + NUM_THREADS = atol(argv[index + 2]); + FILES_PER_ITERATION = atol(argv[index + 3]); + + if (strcmp(mode, "seq") == 0) { + parallel = 0; + } + if (parallel) { + printf("Running parallel in %ld threads. %ld iterations\n", NUM_THREADS, FILES_PER_ITERATION); + printf("Options: dump=%d, clone=%d, write=%d\n", opt_dump, opt_clone, opt_write); + } + else { + printf("Running sequentially in %ld runs. %ld iterations\n", NUM_THREADS, FILES_PER_ITERATION); + } + + { + pthread_t* workers = malloc(NUM_THREADS * sizeof(pthread_t)); + for (i = 0; i < NUM_THREADS; i++) { + struct v* data = (struct v*)malloc(sizeof(struct v)); + data->number = i; + data->data = NULL; + + if (parallel) { + /* Now we will create the thread passing it data as an argument */ + pthread_create(&workers[thread_counter], NULL, runner, data); + /*pthread_join(workers[thread_counter], NULL);*/ + thread_counter++; + } + else { + do_stuff(data); + } + } + + if (parallel) { + for (i = 0; i < NUM_THREADS; i++) { + pthread_join(workers[i], NULL); + } + } + free(workers); + } + + return 0; +} + +void* runner(void* ptr) +{ + do_stuff(ptr); + free(ptr); + pthread_exit(0); +} + +void do_stuff(void* ptr) +{ + /* Cast argument to struct v pointer */ + struct v* data = ptr; + size_t i; + char output_file[50]; + time_t ltime; + struct tm result; + char stime[32]; + + for (i = 0; i < FILES_PER_ITERATION; i++) { + if (opt_write) { + sprintf(output_file, "output/output_file_%ld-%ld.bufr", data->number, i); + encode_file(INPUT_FILE, output_file); + } + else { + encode_file(INPUT_FILE, NULL); + } + } + + ltime = time(NULL); + localtime_r(<ime, &result); + strftime(stime, 32, "%H:%M:%S", &result); /* Try to get milliseconds here too*/ + /* asctime_r(&result, stime); */ + + printf("%s: Worker %ld finished.\n", stime, data->number); +} diff --git a/tests/bufr_threads_ecc-604.sh b/tests/bufr_threads_ecc-604.sh new file mode 100755 index 000000000..035db6e5c --- /dev/null +++ b/tests/bufr_threads_ecc-604.sh @@ -0,0 +1,69 @@ +#!/bin/sh +# (C) Copyright 2005- 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. +# + +. ./include.sh + +label="bufr_threads_ecc-604" +temp_dir=tempdir.${label} + +NUM_THREADS=3 +NUM_ITER=10 +OUTPUT=output +PROG="${test_dir}/bufr_threads_ecc-604" + +validate() +{ + echo "Checking every output file is identical..." + # Get checksum of first file + ck1=`cksum $OUTPUT/output_file_0-0.bufr | awk '{print $1}'` + set +x + # Get checksum of all of them and sort unique + res=`cksum $OUTPUT/output_file_* | awk '{print $1}' | sort -u` + set -x + # Should be the same as the first + [ "$res" = "$ck1" ] +} +process() +{ + input=$1 # The input BUFR file + + # Test 01: Clone + output + # ------------------------ + rm -fr $OUTPUT; mkdir -p $OUTPUT + time $PROG -c -w par $input $NUM_THREADS $NUM_ITER + validate + + # Test 02: No clone + output + # -------------------------- + rm -fr $OUTPUT; mkdir -p $OUTPUT + time $PROG -w par $input $NUM_THREADS $NUM_ITER + validate + + # Test 03: Clone + no output + # --------------------------- + rm -fr $OUTPUT + time $PROG -c par $input $NUM_THREADS $NUM_ITER + # Nothing to validate as there is no output +} +################################################### +rm -fr $temp_dir +mkdir -p $temp_dir +cd $temp_dir + +bufr_files=`cat ${data_dir}/bufr/bufr_data_files.txt` +for bf in ${bufr_files}; do + b=${data_dir}/bufr/$bf + echo "Doing $b" + process $b +done + +# Clean up +cd $test_dir +rm -fr $temp_dir diff --git a/tests/grib1to2.sh b/tests/grib1to2.sh index 1eb37ecfe..cc1123c48 100755 --- a/tests/grib1to2.sh +++ b/tests/grib1to2.sh @@ -80,6 +80,8 @@ if [ -x "${tools_dir}/grib_check_gaussian_grid" ]; then ${tools_dir}/grib_check_gaussian_grid $input $output fi +rm -f $output + #sed "s:toolsdir:${tools_dir}/:" ${tools_dir}/grib1to2.txt > ${tools_dir}/grib1to2.test #chmod +x ${tools_dir}/grib1to2.test #${tools_dir}/grib1to2.test -f ${data_dir}/test.grib1 ${data_dir}/test.grib2 diff --git a/tests/grib_ecc-1053.sh b/tests/grib_ecc-1053.sh new file mode 100755 index 000000000..b147ecc8f --- /dev/null +++ b/tests/grib_ecc-1053.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# (C) Copyright 2005- 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. +# + +. ./include.sh +set -u +# --------------------------------------------------------- +# This is the test for the JIRA issue ECC-1053 +# It tests the human readable step key +# --------------------------------------------------------- +label="grib_ecc-1053-test" +temp=temp.${label}.grib +sample_g1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl + +${tools_dir}/grib_set -s unitOfTimeRange=254,P1=250 $sample_g1 $temp +grib_check_key_equals $temp stepHumanReadable '0h 4m 10s' + +${tools_dir}/grib_set -s unitOfTimeRange=0,P1=200 $sample_g1 $temp +grib_check_key_equals $temp stepHumanReadable '3h 20m' + +rm -f $temp diff --git a/tests/grib_g1fcperiod.sh b/tests/grib_g1fcperiod.sh new file mode 100755 index 000000000..f59e73978 --- /dev/null +++ b/tests/grib_g1fcperiod.sh @@ -0,0 +1,24 @@ +#!/bin/sh +# (C) Copyright 2005- 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. +# + +. ./include.sh + +label="grib_g1fcperiod" +sample_g1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl +temp=temp.$label.grib + +${tools_dir}/grib_set -s \ + localDefinitionNumber=23,P1=12,P2=18,marsType=fcmin,marsStream=mfwm,timeRangeIndicator=3,unitOfTimeRange=2 \ +$sample_g1 $temp + +grib_check_key_equals $temp "mars.fcperiod,forecastperiod" "12-18 12-18" + +# Clean up +rm -f $temp diff --git a/tests/grib_get_fail.sh b/tests/grib_get_fail.sh new file mode 100755 index 000000000..b93f96a40 --- /dev/null +++ b/tests/grib_get_fail.sh @@ -0,0 +1,25 @@ +#!/bin/sh +# (C) Copyright 2005- 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. +# + +. ./include.sh + +REDIRECT=/dev/null + +# Check input file has been downloaded +[ -f ${data_dir}/regular_latlon_surface.grib1 ] + +# Expect failure as the key does not exist +set +e +${tools_dir}/grib_get -p gribname ${data_dir}/regular_latlon_surface.grib1 2> $REDIRECT > $REDIRECT + +if [ $? -eq 0 ] ; then + # Should not have succeeded + exit 1; +fi diff --git a/tests/grib_indexing.c b/tests/grib_indexing.c new file mode 100644 index 000000000..98b20756d --- /dev/null +++ b/tests/grib_indexing.c @@ -0,0 +1,157 @@ +/* + * (C) Copyright 2005- 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. + */ +#include "grib_api.h" + +static void usage(const char* prog) +{ + printf("usage: %s infile\n", prog); + exit(1); +} + +int main(int argc, char* argv[]) +{ + grib_index* index = NULL; + grib_handle* h = NULL; + char* infile = NULL; + long *steps, *levels, *numbers; /* arrays */ + char** shortNames = NULL; + int i, j, k, l; + size_t stepSize, levelSize, shortNameSize, numberSize; + long oStep, oLevel, oNumber; + char oShortName[200]; + size_t lenShortName = 200; + int ret = 0, count = 0; + + if (argc != 2) usage(argv[0]); + infile = argv[1]; + + printf("indexing...\n"); + + /* Create an index given set of keys*/ + index = grib_index_new(0, "shortName,level,number,step", &ret); + if (ret) { + printf("error: %s\n", grib_get_error_message(ret)); + exit(ret); + } + + /* Indexes a file */ + ret = grib_index_add_file(index, infile); + if (ret) { + printf("error: %s\n", grib_get_error_message(ret)); + exit(ret); + } + printf("end indexing...\n"); + + /* get the number of distinct values of "step" in the index */ + GRIB_CHECK(grib_index_get_size(index, "step", &stepSize), 0); + steps = (long*)malloc(sizeof(long) * stepSize); + if (!steps) exit(1); + /* get the list of distinct steps from the index */ + /* the list is in ascending order */ + GRIB_CHECK(grib_index_get_long(index, "step", steps, &stepSize), 0); + printf("stepSize=%ld\n", (long)stepSize); + for (i = 0; i < stepSize; i++) + printf("%ld ", steps[i]); + printf("\n"); + + /*same as for "step"*/ + GRIB_CHECK(grib_index_get_size(index, "level", &levelSize), 0); + levels = (long*)malloc(sizeof(long) * levelSize); + if (!levels) exit(1); + /*same as for "step"*/ + GRIB_CHECK(grib_index_get_long(index, "level", levels, &levelSize), 0); + printf("levelSize=%ld\n", (long)levelSize); + for (i = 0; i < levelSize; i++) + printf("%ld ", levels[i]); + printf("\n"); + + /*same as for "step"*/ + GRIB_CHECK(grib_index_get_size(index, "number", &numberSize), 0); + numbers = (long*)malloc(sizeof(long) * numberSize); + if (!numbers) exit(1); + /*same as for "step"*/ + GRIB_CHECK(grib_index_get_long(index, "number", numbers, &numberSize), 0); + printf("numberSize=%ld\n", (long)numberSize); + for (i = 0; i < numberSize; i++) + printf("%ld ", numbers[i]); + printf("\n"); + + /*same as for "step"*/ + GRIB_CHECK(grib_index_get_size(index, "shortName", &shortNameSize), 0); + shortNames = (char**)malloc(sizeof(char*) * shortNameSize); + if (!shortNames) exit(1); + /*same as for "step"*/ + GRIB_CHECK(grib_index_get_string(index, "shortName", shortNames, &shortNameSize), 0); + printf("shortNameSize=%ld\n", (long)shortNameSize); + for (i = 0; i < shortNameSize; i++) + printf("%s ", shortNames[i]); + printf("\n"); + + count = 0; + /* nested loops on the keys values of the index */ + /* different order of the nested loops doesn't affect performance*/ + for (i = 0; i < shortNameSize; i++) { + /* select the GRIB with shortName=shortNames[i] */ + grib_index_select_string(index, "shortName", shortNames[i]); + + for (l = 0; l < levelSize; l++) { + /* select the GRIB with level=levels[i] */ + grib_index_select_long(index, "level", levels[l]); + + for (j = 0; j < numberSize; j++) { + /* select the GRIB with number=numbers[i] */ + grib_index_select_long(index, "number", numbers[j]); + + for (k = 0; k < stepSize; k++) { + /* select the GRIB with step=steps[i] */ + grib_index_select_long(index, "step", steps[k]); + + /* create a new grib_handle from the index with the constraints + imposed by the select statements. It is a loop because + in the index there could be more than one GRIB with those + constraints */ + while ((h = grib_handle_new_from_index(index, &ret)) != NULL) { + count++; + if (ret) { + printf("error: %d\n", ret); + exit(ret); + } + lenShortName = 200; + grib_get_string(h, "shortName", oShortName, &lenShortName); + grib_get_long(h, "level", &oLevel); + grib_get_long(h, "number", &oNumber); + grib_get_long(h, "step", &oStep); + printf("shortName=%s ", oShortName); + printf("level=%ld ", oLevel); + printf("number=%ld ", oNumber); + printf("step=%ld \n", oStep); + grib_handle_delete(h); + } + if (ret && ret != GRIB_END_OF_INDEX) { + printf("error: %s\n", grib_get_error_message(ret)); + exit(ret); + } + } + } + } + } + printf(" %d messages selected\n", count); + + grib_index_write(index, "out.gribidx"); + grib_index_delete(index); + free(levels); + free(numbers); + free(steps); + for (i = 0; i < shortNameSize; i++) + free(shortNames[i]); + free(shortNames); + + return 0; +} diff --git a/tests/grib_indexing.sh b/tests/grib_indexing.sh new file mode 100755 index 000000000..1a4a05090 --- /dev/null +++ b/tests/grib_indexing.sh @@ -0,0 +1,115 @@ +#!/bin/sh +# (C) Copyright 2005- 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. +# + +. ./include.sh + +label="grib_indexing" +temp=temp.$label.index.out +infile=${data_dir}/index.grib + +# Writes to "out.gribidx" +$EXEC ${test_dir}/grib_indexing ${infile} > $temp +diff ${data_dir}/index.ok $temp + +# reads from "out.gribidx" +$EXEC ${test_dir}/grib_read_index ${infile} > $temp +diff ${data_dir}/index.ok $temp + +rm -f out.gribidx $temp + +#------------------------------- +# Test grib_index_build +#------------------------------- +tempIndex=temp.$label.$$.idx +tempOut=temp.$label.$$.out +tempRef=temp.$label.$$.ref +${tools_dir}/grib_index_build -N -o $tempIndex ${infile} >/dev/null + +# Must remove first two lines and the last (filename specifics) +${tools_dir}/grib_dump -D ${tempIndex} | sed '1,2d' | sed '$d' > $tempOut +cat $tempOut + +cat > $tempRef < $tempGribFile1 +cat ${data_dir}/sample.grib2 ${data_dir}/high_level_api.grib2 > $tempGribFile2 + +${tools_dir}/grib_index_build -N -o $tempIndex1 $tempGribFile1 +${tools_dir}/grib_index_build -N -o $tempIndex2 $tempGribFile2 +${tools_dir}/grib_compare $tempIndex1 $tempIndex2 +rm -f $tempIndex1 $tempIndex2 $tempGribFile1 $tempGribFile2 + +# Clean up +rm -f $tempIndex $tempOut $tempRef diff --git a/tests/grib_lambert_conformal.sh b/tests/grib_lambert_conformal.sh index 41f34d85a..642878c4c 100755 --- a/tests/grib_lambert_conformal.sh +++ b/tests/grib_lambert_conformal.sh @@ -36,16 +36,51 @@ cat > $tempFilter <&2 exit 1 fi -# Now get the data from the newly created GRIB file +# Invoke Geoiterator on the newly created GRIB file ${tools_dir}/grib_get_data $tempGrib > $tempOut ${tools_dir}/grib_ls -l 50,0 $tempGrib +# Oblate earth +# -------------- +cat > $tempFilter <&2 + exit 1 +fi +grib_check_key_equals $tempGrib 'earthIsOblate,earthMinorAxisInMetres,earthMajorAxisInMetres' '1 6356775 6378160' + +# Invoke Geoiterator on the newly created GRIB file +${tools_dir}/grib_get_data $tempGrib > $tempOut + + + + # Clean up rm -f $tempFilter $tempGrib $tempOut diff --git a/tests/grib_md5.sh b/tests/grib_md5.sh new file mode 100755 index 000000000..7bbe32a3a --- /dev/null +++ b/tests/grib_md5.sh @@ -0,0 +1,29 @@ +# +# 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. +# + +. ./include.sh + +test_md5() +{ + file=$ECCODES_SAMPLES_PATH/$1 + expected=$2 + + result=`${tools_dir}/grib_get -p md5GridSection:s $file` + [ "$result" = "$expected" ] +} + +####################################################################### +# GRIB edition 1 +test_md5 "sh_sfc_grib1.tmpl" "5b68b3d2c6e834fd501a123391b6b8a2" +test_md5 "sh_pl_grib1.tmpl" "5b68b3d2c6e834fd501a123391b6b8a2" +test_md5 "gg_sfc_grib1.tmpl" "97451fbe92a77bdeb4582fadc9b65e9d" + +# GRIB edition 2 +test_md5 "sh_sfc_grib2.tmpl" "b10d32ebf4f91e52df0fc5d1deb57c3d" +test_md5 "rotated_ll_pl_grib2.tmpl" "775bd4622d6becca2d2da9e308c97a7d" +test_md5 "gg_sfc_grib2.tmpl" "a63333bd3cb80563e66907bb66d82cda" diff --git a/tests/grib_mercator.sh b/tests/grib_mercator.sh new file mode 100755 index 000000000..1fb3f44bd --- /dev/null +++ b/tests/grib_mercator.sh @@ -0,0 +1,34 @@ +#!/bin/sh +# (C) Copyright 2005- 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. + +. ./include.sh + +# Define a common label for all the tmp files +label="grib_mercator_test" +tempOut="temp.${label}.out" +tempFilter="temp.${label}.filt" + +input=${data_dir}/mercator.grib2 +grib_check_key_equals $input "gridType" "mercator" +${tools_dir}/grib_get_data $input > $tempOut +numlines=`wc -l $tempOut | awk '{print $1}'` +[ "$numlines" = "2465" ] # 1 + numberOfDataPoints + + +# Check other iterator-related keys +cat > $tempFilter < +#include "grib_api_internal.h" #include #ifndef ECCODES_ON_WINDOWS @@ -44,9 +43,11 @@ int main(int argc, char* argv[]) FILE* f = NULL; long level = 0; grib_context* c = grib_context_get_default(); + int multi_support = 0; if (argc == 3 && !strcmp(argv[1], "-m")) { - grib_multi_support_on(0); + grib_multi_support_on(c); + multi_support = 1; filename = argv[2]; } else if (argc == 2) @@ -85,6 +86,9 @@ int main(int argc, char* argv[]) GRIB_CHECK(grib_get_string(h, "shortName", shortName, &len), "shortName"); GRIB_CHECK(grib_get_long(h, "level", &level), "level"); printf("%d %s %ld\n", count, shortName, level); + if (!multi_support) { + grib_context_free(c, h->buffer->data); /* See grib_handle_delete and grib_buffer_delete */ + } grib_handle_delete(h); } diff --git a/tests/grib_read_index.c b/tests/grib_read_index.c new file mode 100644 index 000000000..b60e43325 --- /dev/null +++ b/tests/grib_read_index.c @@ -0,0 +1,144 @@ +/* + * (C) Copyright 2005- 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. + */ + +#include "grib_api.h" + +static void usage(char* prog) +{ + printf("usage: %s infile\n", prog); + exit(1); +} + +int main(int argc, char* argv[]) +{ + grib_index* index = NULL; + grib_handle* h = NULL; + long *steps, *levels, *numbers; + char** shortNames = NULL; + int i, j, k, l; + size_t stepSize, levelSize, shortNameSize, numberSize; + long ostep, olevel, onumber; + char oshortName[200]; + size_t lenshortName = 200; + int ret = 0, count = 0; + + if (argc != 2) usage(argv[0]); + + printf("indexing...\n"); + + index = grib_index_read(0, "out.gribidx", &ret); + GRIB_CHECK(ret, 0); + + printf("end indexing...\n"); + + /* get the number of distinct values of "step" in the index */ + GRIB_CHECK(grib_index_get_size(index, "step", &stepSize), 0); + steps = (long*)malloc(sizeof(long) * stepSize); + if (!steps) exit(1); + /* get the list of distinct steps from the index */ + /* the list is in ascending order */ + GRIB_CHECK(grib_index_get_long(index, "step", steps, &stepSize), 0); + printf("stepSize=%ld\n", (long)stepSize); + for (i = 0; i < stepSize; i++) + printf("%ld ", steps[i]); + printf("\n"); + + /*same as for "step"*/ + GRIB_CHECK(grib_index_get_size(index, "level", &levelSize), 0); + levels = (long*)malloc(sizeof(long) * levelSize); + if (!levels) exit(1); + /*same as for "step"*/ + GRIB_CHECK(grib_index_get_long(index, "level", levels, &levelSize), 0); + printf("levelSize=%ld\n", (long)levelSize); + for (i = 0; i < levelSize; i++) + printf("%ld ", levels[i]); + printf("\n"); + + /*same as for "step"*/ + GRIB_CHECK(grib_index_get_size(index, "number", &numberSize), 0); + numbers = (long*)malloc(sizeof(long) * numberSize); + if (!numbers) exit(1); + /*same as for "step"*/ + GRIB_CHECK(grib_index_get_long(index, "number", numbers, &numberSize), 0); + printf("numberSize=%ld\n", (long)numberSize); + for (i = 0; i < numberSize; i++) + printf("%ld ", numbers[i]); + printf("\n"); + + /*same as for "step"*/ + GRIB_CHECK(grib_index_get_size(index, "shortName", &shortNameSize), 0); + shortNames = (char**)malloc(sizeof(char*) * shortNameSize); + if (!shortNames) exit(1); + /*same as for "step"*/ + GRIB_CHECK(grib_index_get_string(index, "shortName", shortNames, &shortNameSize), 0); + printf("shortNameSize=%ld\n", (long)shortNameSize); + for (i = 0; i < shortNameSize; i++) + printf("%s ", shortNames[i]); + printf("\n"); + + count = 0; + /* nested loops on the keys values of the index */ + /* different order of the nested loops doesn't affect performance*/ + for (i = 0; i < shortNameSize; i++) { + /* select the grib with shortName=shortName[i] */ + grib_index_select_string(index, "shortName", shortNames[i]); + + for (l = 0; l < levelSize; l++) { + /* select the grib with level=level[i] */ + grib_index_select_long(index, "level", levels[l]); + + for (j = 0; j < numberSize; j++) { + /* select the grib with number=number[i] */ + grib_index_select_long(index, "number", numbers[j]); + + for (k = 0; k < stepSize; k++) { + /* select the grib with step=step[i] */ + grib_index_select_long(index, "step", steps[k]); + + /* create a new grib_handle from the index with the constraints + * imposed by the select statements. It is a loop because + * in the index there could be more than one grib with those + * constrants */ + while ((h = grib_handle_new_from_index(index, &ret)) != NULL) { + count++; + if (ret) { + printf("error: %d\n", ret); + exit(ret); + } + lenshortName = 200; + grib_get_string(h, "shortName", oshortName, &lenshortName); + grib_get_long(h, "level", &olevel); + grib_get_long(h, "number", &onumber); + grib_get_long(h, "step", &ostep); + printf("shortName=%s ", oshortName); + printf("level=%ld ", olevel); + printf("number=%ld ", onumber); + printf("step=%ld \n", ostep); + grib_handle_delete(h); + } + if (ret != GRIB_END_OF_INDEX) { + printf("error: %s\n", grib_get_error_message(ret)); + exit(ret); + } + } + } + } + } + printf(" %d messages selected\n", count); + free(levels); + free(steps); + free(numbers); + for (i = 0; i < shortNameSize; i++) + free(shortNames[i]); + free(shortNames); + grib_index_delete(index); + + return 0; +} diff --git a/tests/grib_threads_ecc-604-encode.c b/tests/grib_threads_ecc-604-encode.c new file mode 100644 index 000000000..992a5c78f --- /dev/null +++ b/tests/grib_threads_ecc-604-encode.c @@ -0,0 +1,156 @@ +/* + * Test for ECC-604: GRIB decoding/encoding sequentially and parallel with POSIX threads + */ +#include +#include +#include + +#include "grib_api.h" + +/* These are passed in via argv */ +static size_t NUM_THREADS = 0; +static size_t FILES_PER_ITERATION = 0; +static char* INPUT_FILE = NULL; +int opt_dump = 0; /* If 1 then dump handle to /dev/null */ +int opt_clone = 0; /* If 1 then clone source handle */ +int opt_write = 0; /* If 1 write handle to file */ + +static int encode_values(grib_handle* h, char* output_file) +{ + double* values; + const size_t DIM = 1000; + size_t size = DIM * DIM; + size_t i = 0; + values = (double*)malloc(size * sizeof(double)); + for (i = 0; i < size; ++i) { + double v = i; + if (i % DIM == 0) v = 0; + values[i] = v; + } + GRIB_CHECK(grib_set_long(h, "bitsPerValue", 16), 0); + GRIB_CHECK(grib_set_double_array(h, "values", values, size), 0); + free(values); + return GRIB_SUCCESS; +} + +void do_encode(void* data); + +/* Structure for passing data to threads */ +struct v +{ + size_t number; + char* data; +}; + +void* runner(void* ptr); /* the thread */ + +int main(int argc, char** argv) +{ + size_t i; + int thread_counter = 0; + int parallel = 1, index = 0, c = 0; + const char* prog = argv[0]; + char* mode; + if (argc < 5 || argc > 7) { + fprintf(stderr, "Usage:\n\t%s [options] seq sample numRuns numIter\nOr\n\t%s [options] par sample numThreads numIter\n", prog, prog); + return 1; + } + + while ((c = getopt(argc, argv, "dcw")) != -1) { + switch (c) { + case 'd': + opt_dump = 1; + break; + case 'c': + opt_clone = 1; + break; + case 'w': + opt_write = 1; + break; + } + } + index = optind; + mode = argv[index]; + INPUT_FILE = argv[index + 1]; /* Has to be the name of a sample file (without tmpl extension) */ + NUM_THREADS = atol(argv[index + 2]); + FILES_PER_ITERATION = atol(argv[index + 3]); + + if (strcmp(mode, "seq") == 0) { + parallel = 0; + } + if (parallel) { + printf("Running parallel in %ld threads. %ld iterations (prod=%ld)\n", NUM_THREADS, FILES_PER_ITERATION, NUM_THREADS * FILES_PER_ITERATION); + printf("Options: dump=%d, clone=%d, write=%d\n", opt_dump, opt_clone, opt_write); + } + else { + printf("Running sequentially in %ld runs. %ld iterations\n", NUM_THREADS, FILES_PER_ITERATION); + } + + { + pthread_t* workers = malloc(NUM_THREADS * sizeof(pthread_t)); + for (i = 0; i < NUM_THREADS; i++) { + struct v* data = (struct v*)malloc(sizeof(struct v)); + data->number = i; + data->data = NULL; + + if (parallel) { + /* Now we will create the thread passing it data as an argument */ + pthread_create(&workers[thread_counter], NULL, runner, data); + thread_counter++; + } + else { + do_encode(data); + } + } + + if (parallel) { + for (i = 0; i < NUM_THREADS; i++) { + pthread_join(workers[i], NULL); + } + } + free(workers); + } + + return 0; +} + +void* runner(void* ptr) +{ + do_encode(ptr); + free(ptr); + pthread_exit(0); +} + +void do_encode(void* ptr) +{ + /* Cast argument to struct v pointer */ + struct v* data = ptr; + size_t i; + char output_file[50]; + time_t ltime; + struct tm result; + char stime[32]; + grib_handle* hs = NULL; + + hs = grib_handle_new_from_samples(0, INPUT_FILE); + + for (i = 0; i < FILES_PER_ITERATION; i++) { + grib_handle* h = grib_handle_clone(hs); + if (opt_write) { + sprintf(output_file, "output/output_file_%ld-%ld.grib", data->number, i); + encode_values(h, output_file); + } + else { + encode_values(h, NULL); + } + grib_handle_delete(h); + } + + ltime = time(NULL); + localtime_r(<ime, &result); + strftime(stime, 32, "%H:%M:%S", &result); /* Try to get milliseconds here too*/ + /* asctime_r(&result, stime); */ + + printf("%s: Worker %ld finished.\n", stime, data->number); + grib_handle_delete(hs); +} diff --git a/tests/grib_threads_ecc-604.c b/tests/grib_threads_ecc-604.c new file mode 100644 index 000000000..8bdcec124 --- /dev/null +++ b/tests/grib_threads_ecc-604.c @@ -0,0 +1,202 @@ +/* + * Test for ECC-604: GRIB decoding/encoding sequentially and parallel with POSIX threads + */ +#include +#include +#include +#include + +#include "grib_api.h" + +/* These are passed in via argv */ +static size_t NUM_THREADS = 0; +static size_t FILES_PER_ITERATION = 0; +static char* INPUT_FILE = NULL; +int opt_dump = 0; /* If 1 then dump handle to /dev/null */ +int opt_clone = 0; /* If 1 then clone source handle */ +int opt_write = 0; /* If 1 write handle to file */ + +static int encode_file(char* template_file, char* output_file) +{ + FILE *in, *out = NULL; + grib_handle* source_handle = NULL; + const void* buffer = NULL; + size_t size = 0; + int err = 0; + double* values; + + in = fopen(template_file, "rb"); + assert(in); + if (opt_write && output_file) { + out = fopen(output_file, "wb"); + assert(out); + } + + /* loop over the messages in the source GRIB and clone them */ + while ((source_handle = grib_handle_new_from_file(0, in, &err)) != NULL) { + int i; + size_t values_len = 0; + size_t str_len = 20; + grib_handle* h = source_handle; + + if (opt_clone) { + h = grib_handle_clone(source_handle); + assert(h); + } + + GRIB_CHECK(grib_get_size(h, "values", &values_len), 0); + + values = (double*)malloc(values_len * sizeof(double)); + GRIB_CHECK(grib_get_double_array(h, "values", values, &values_len), 0); + + for (i = 0; i < values_len; i++) { + values[i] *= 0.9; + } + + GRIB_CHECK(grib_set_string(h, "stepUnits", "s", &str_len), 0); + GRIB_CHECK(grib_set_long(h, "startStep", 43200), 0); + GRIB_CHECK(grib_set_long(h, "endStep", 86400), 0); + GRIB_CHECK(grib_set_long(h, "bitsPerValue", 16), 0); + + /* set data values */ + GRIB_CHECK(grib_set_double_array(h, "values", values, values_len), 0); + + GRIB_CHECK(grib_get_message(h, &buffer, &size), 0); + if (opt_write) { + if (fwrite(buffer, 1, size, out) != size) { + perror(output_file); + return 1; + } + } + if (opt_dump) { + FILE* devnull = fopen("/dev/null", "w"); + grib_dump_content(source_handle, devnull, "debug", 0, NULL); + } + + grib_handle_delete(source_handle); + if (opt_clone) grib_handle_delete(h); + free(values); + } + + if (opt_write) fclose(out); + fclose(in); + + return 0; +} + +void do_stuff(void* data); + +/* Structure for passing data to threads */ +struct v +{ + size_t number; + char* data; +}; + +void* runner(void* ptr); /* the thread */ + +int main(int argc, char** argv) +{ + size_t i; + int thread_counter = 0; + int parallel = 1, index = 0, c = 0; + const char* prog = argv[0]; + char* mode; + if (argc < 5 || argc > 8) { + fprintf(stderr, "Usage:\n\t%s [options] seq file numRuns numIter\nOr\n\t%s [options] par file numThreads numIter\n", prog, prog); + return 1; + } + + while ((c = getopt(argc, argv, "dcw")) != -1) { + switch (c) { + case 'd': + opt_dump = 1; + break; + case 'c': + opt_clone = 1; + break; + case 'w': + opt_write = 1; + break; + } + } + index = optind; + mode = argv[index]; + INPUT_FILE = argv[index + 1]; + NUM_THREADS = atol(argv[index + 2]); + FILES_PER_ITERATION = atol(argv[index + 3]); + + if (strcmp(mode, "seq") == 0) { + parallel = 0; + } + if (parallel) { + printf("Running parallel in %ld threads. %ld iterations (prod=%ld)\n", NUM_THREADS, FILES_PER_ITERATION, NUM_THREADS * FILES_PER_ITERATION); + printf("Options: dump=%d, clone=%d, write=%d\n", opt_dump, opt_clone, opt_write); + } + else { + printf("Running sequentially in %ld runs. %ld iterations\n", NUM_THREADS, FILES_PER_ITERATION); + } + + { + pthread_t* workers = malloc(NUM_THREADS * sizeof(pthread_t)); + for (i = 0; i < NUM_THREADS; i++) { + struct v* data = (struct v*)malloc(sizeof(struct v)); + data->number = i; + data->data = NULL; + + if (parallel) { + /* Now we will create the thread passing it data as an argument */ + pthread_create(&workers[thread_counter], NULL, runner, data); + /*pthread_join(workers[thread_counter], NULL);*/ + thread_counter++; + } + else { + do_stuff(data); + } + } + + if (parallel) { + for (i = 0; i < NUM_THREADS; i++) { + pthread_join(workers[i], NULL); + } + } + free(workers); + } + + return 0; +} + +void* runner(void* ptr) +{ + do_stuff(ptr); + free(ptr); + pthread_exit(0); +} + +void do_stuff(void* ptr) +{ + /* Cast argument to struct v pointer */ + struct v* data = ptr; + size_t i; + char output_file[50]; + time_t ltime; + struct tm result; + char stime[32]; + + for (i = 0; i < FILES_PER_ITERATION; i++) { + if (opt_write) { + sprintf(output_file, "output/output_file_%ld-%ld.grib", data->number, i); + encode_file(INPUT_FILE, output_file); + } + else { + encode_file(INPUT_FILE, NULL); + } + } + + ltime = time(NULL); + localtime_r(<ime, &result); + strftime(stime, 32, "%H:%M:%S", &result); /* Try to get milliseconds here too*/ + /* asctime_r(&result, stime); */ + + printf("%s: Worker %ld finished.\n", stime, data->number); +} diff --git a/tests/grib_threads_ecc-604.sh b/tests/grib_threads_ecc-604.sh new file mode 100755 index 000000000..d6e147471 --- /dev/null +++ b/tests/grib_threads_ecc-604.sh @@ -0,0 +1,88 @@ +#!/bin/sh +# (C) Copyright 2005- 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. +# + +. ./include.sh + +label="grib_threads_ecc-604" +temp_dir=tempdir.${label} + +NUM_THREADS=3 +NUM_ITER=10 +OUTPUT=output +PROG="${test_dir}/grib_threads_ecc-604" + +validate() +{ + echo "Checking every output file is identical..." + # Get checksum of first file + ck1=`cksum $OUTPUT/output_file_0-0.grib | awk '{print $1}'` + set +x + # Get checksum of all of them and sort unique + res=`cksum $OUTPUT/output_file_* | awk '{print $1}' | sort -u` + set -x + # Should be the same as the first + [ "$res" = "$ck1" ] +} +process() +{ + input=$1 # The input GRIB file + + # Test 01: Clone + output + # ------------------------ + rm -fr $OUTPUT; mkdir -p $OUTPUT + time $PROG -c -w par $input $NUM_THREADS $NUM_ITER + validate + + # Test 02: No clone + output + # -------------------------- + rm -fr $OUTPUT; mkdir -p $OUTPUT + time $PROG -w par $input $NUM_THREADS $NUM_ITER + validate + + # Test 03: Clone + dump + no output + # --------------------------------- + rm -fr $OUTPUT + time $PROG -c -d par $input $NUM_THREADS $NUM_ITER + # Nothing to validate as there is no output +} +################################################### +rm -fr $temp_dir +mkdir -p $temp_dir +cd $temp_dir + +GRIB1_INPUTS=" + $ECCODES_SAMPLES_PATH/gg_sfc_grib1.tmpl + ${data_dir}/gen_bitmap.grib + ${data_dir}/spectral_complex.grib1 + ${data_dir}/gen_ext.grib + ${data_dir}/gen.grib + ${data_dir}/gen_ext_spd_2.grib" + +GRIB2_INPUTS=" + $ECCODES_SAMPLES_PATH/gg_sfc_grib2.tmpl + ${data_dir}/reduced_gaussian_sub_area.grib2 + ${data_dir}/test_file.grib2 + ${data_dir}/sample.grib2" + +if [ $HAVE_JPEG -eq 1 ]; then + echo "Adding extra files (HAVE_JPEG=1)" + GRIB2_INPUTS="${data_dir}/jpeg.grib2 ${data_dir}/reduced_gaussian_surface_jpeg.grib2 "$GRIB2_INPUTS +fi +if [ $HAVE_AEC -eq 1 ]; then + GRIB2_INPUTS=$GRIB2_INPUTS" ${data_dir}/ccsds.grib2 " +fi + +for gf in $GRIB1_INPUTS $GRIB2_INPUTS; do + process $gf +done + +# Clean up +cd $test_dir +rm -fr $temp_dir diff --git a/tests/grib_util_set_spec.sh b/tests/grib_util_set_spec.sh index 7bab5ab08..4b0afffb2 100755 --- a/tests/grib_util_set_spec.sh +++ b/tests/grib_util_set_spec.sh @@ -104,3 +104,4 @@ ${tools_dir}/grib_get_data $outfile > /dev/null ### Clean up rm -f $outfile $tempOut +rm -f error.data diff --git a/tests/ieee.sh b/tests/ieee.sh index 2f1c1735c..da2c5b050 100755 --- a/tests/ieee.sh +++ b/tests/ieee.sh @@ -48,12 +48,15 @@ export GRIB_IEEE_PACKING ${tools_dir}/grib_filter -o $out32 w.filter $infile ${tools_dir}/grib_filter r.filter $out32 > $out32.txt diff $out32.txt ${data_dir}/ieee_test.good +grib_check_key_equals $out32 'packingType,precision' 'grid_ieee 1' GRIB_IEEE_PACKING=64 export GRIB_IEEE_PACKING ${tools_dir}/grib_filter -o $out64 w.filter $infile ${tools_dir}/grib_filter r.filter $out64 > $out64.txt diff $out64.txt ${data_dir}/ieee_test.good +grib_check_key_equals $out64 'packingType,precision' 'grid_ieee 2' + rm -f $outsimple $out32 $out64 $out32.txt $out64.txt rm -f ${data_dir}/$outsimple.txt ${data_dir}/$out32.txt ${data_dir}/$out64.txt diff --git a/tests/include.ctest.sh.in b/tests/include.ctest.sh.in index 148c92e39..7c8bd867e 100644 --- a/tests/include.ctest.sh.in +++ b/tests/include.ctest.sh.in @@ -20,8 +20,8 @@ tigge_dir=@CMAKE_BINARY_DIR@/bin # executables with valgrind. See ECC-746 EXEC="" if test "x$ECCODES_TEST_WITH_VALGRIND" != "x"; then - tools_dir="valgrind --error-exitcode=1 -q @CMAKE_BINARY_DIR@/bin" - EXEC="valgrind --error-exitcode=1 -q " + EXEC="valgrind --error-exitcode=1 -q" + tools_dir="$EXEC @CMAKE_BINARY_DIR@/bin" fi # ecCodes tests are in the PROJECT_BINARY_DIR @@ -33,6 +33,8 @@ ECCODES_SAMPLES_PATH=${samp_dir} export ECCODES_SAMPLES_PATH # Options +HAVE_PRODUCT_BUFR=@HAVE_PRODUCT_BUFR@ +HAVE_PRODUCT_GRIB=@HAVE_PRODUCT_GRIB@ HAVE_JPEG=@HAVE_JPEG@ HAVE_LIBJASPER=@HAVE_LIBJASPER@ HAVE_LIBOPENJPEG=@HAVE_LIBOPENJPEG@ diff --git a/tests/keys b/tests/keys index 354177ff1..2f70eb8c8 100644 --- a/tests/keys +++ b/tests/keys @@ -2068,299 +2068,300 @@ statistics,2062 status,2063 step,2064 stepForClustering,2065 -stepInHours,2066 -stepRange,2067 -stepRangeInHours,2068 -stepType,2069 -stepTypeForConversion,2070 -stepTypeInternal,2071 -stepUnits,2072 -stepZero,2073 -stream,2074 -streamOfAnalysis,2075 -stretchingFactor,2076 -stretchingFactorScaled,2077 -stringValues,2078 -subCentre,2079 -subDefinitions1,2080 -subDefinitions2,2081 -subLocalDefinition1,2082 -subLocalDefinition2,2083 -subLocalDefinitionLength1,2084 -subLocalDefinitionLength2,2085 -subLocalDefinitionNumber1,2086 -subLocalDefinitionNumber2,2087 -subSetJ,2088 -subSetK,2089 -subSetM,2090 -subcentreOfAnalysis,2091 -subdivisionsOfBasicAngle,2092 -suiteName,2093 -superblockExtensionAddress,2094 -swapScanningLat,2095 -swapScanningLon,2096 -swapScanningX,2097 -swapScanningY,2098 -system,2099 -systemNumber,2100 -t,2101 -table2Version,2102 -tableCode,2103 -tableNumber,2104 -tableReference,2105 -tablesLocalDir,2106 -tablesMasterDir,2107 -tablesVersion,2108 -tablesVersionLatest,2109 -targetCompressionRatio,2110 -td,2111 -tempPressureUnits,2112 -temperature,2113 -temperatureAndDewpointPresent,2114 -templatesLocalDir,2115 -templatesMasterDir,2116 -theHindcastMarsStream,2117 -theMessage,2118 -thisExperimentVersionNumber,2119 -thisMarsClass,2120 -thisMarsStream,2121 -thisMarsType,2122 -thousand,2123 -three,2124 -threshold,2125 -thresholdIndicator,2126 -tiggeCentre,2127 -tiggeLAMName,2128 -tiggeLocalVersion,2129 -tiggeModel,2130 -tiggeSection,2131 -tiggeSuiteID,2132 -tigge_name,2133 -tigge_short_name,2134 -tileClassification,2135 -tileIndex,2136 -time,2137 -timeCoordinateDefinition,2138 -timeDomainTemplate,2139 -timeDomainTemplateNumber,2140 -timeIncrement,2141 -timeIncrementBetweenSuccessiveFields,2142 -timeOfAnalysis,2143 -timeOfForecast,2144 -timeOfModelVersion,2145 -timeOfReference,2146 -timeRangeIndicator,2147 -timeRangeIndicatorFromStepRange,2148 -timeUnitFlag,2149 -timerepres,2150 -topLevel,2151 -total,2152 -totalAerosolBinsNumbers,2153 -totalInitialConditions,2154 -totalLength,2155 -totalNumber,2156 -totalNumberOfClusters,2157 -totalNumberOfDataValuesMissingInStatisticalProcess,2158 -totalNumberOfDirections,2159 -totalNumberOfForecastProbabilities,2160 -totalNumberOfFrequencies,2161 -totalNumberOfGridPoints,2162 -totalNumberOfIterations,2163 -totalNumberOfRepetitions,2164 -totalNumberOfTileAttributePairs,2165 -totalNumberOfTubes,2166 -totalNumberOfValuesInUnpackedSubset,2167 -totalNumberOfdimensions,2168 -treatmentOfMissingData,2169 -true,2170 -trueLengthOfLastGroup,2171 -truncateDegrees,2172 -truncateLaplacian,2173 -tsectionNumber3,2174 -tsectionNumber4,2175 -tsectionNumber5,2176 -tubeDomain,2177 -tubeNumber,2178 -two,2179 -twoOrdersOfSPD,2180 -type,2181 -typeOfAnalysis,2182 -typeOfAuxiliaryInformation,2183 -typeOfCalendar,2184 -typeOfCompressionUsed,2185 -typeOfDistributionFunction,2186 -typeOfEnsembleForecast,2187 -typeOfEnsembleMember,2188 -typeOfFirstFixedSurface,2189 -typeOfGeneratingProcess,2190 -typeOfGrid,2191 -typeOfHorizontalLine,2192 -typeOfIntervalForFirstAndSecondSize,2193 -typeOfIntervalForFirstAndSecondWavelength,2194 -typeOfLevel,2195 -typeOfLevelECMF,2196 -typeOfOriginalFieldValues,2197 -typeOfPacking,2198 -typeOfPostProcessing,2199 -typeOfPreProcessing,2200 -typeOfProcessedData,2201 -typeOfSSTFieldUsed,2202 -typeOfSecondFixedSurface,2203 -typeOfSizeInterval,2204 -typeOfStatisticalPostProcessingOfEnsembleMembers,2205 -typeOfStatisticalProcessing,2206 -typeOfTimeIncrement,2207 -typeOfTimeIncrementBetweenSuccessiveFieldsUsedInTheStatisticalProcessing,2208 -typeOfWavelengthInterval,2209 -typicalCentury,2210 -typicalDate,2211 -typicalDateTime,2212 -typicalDay,2213 -typicalHour,2214 -typicalMinute,2215 -typicalMonth,2216 -typicalSecond,2217 -typicalTime,2218 -typicalYear,2219 -typicalYear2,2220 -typicalYearOfCentury,2221 -uco,2222 -ucs,2223 -unexpandedDescriptors,2224 -unexpandedDescriptorsEncoded,2225 -unitOfOffsetFromReferenceTime,2226 -unitOfTime,2227 -unitOfTimeIncrement,2228 -unitOfTimeRange,2229 -units,2230 -unitsBias,2231 -unitsConversionOffset,2232 -unitsConversionScaleFactor,2233 -unitsDecimalScaleFactor,2234 -unitsECMF,2235 -unitsFactor,2236 -unitsOfFirstFixedSurface,2237 -unitsOfSecondFixedSurface,2238 -unknown,2239 -unpack,2240 -unpackedError,2241 -unpackedSubsetPrecision,2242 -unpackedValues,2243 -unsignedIntegers,2244 -unusedBitsInBitmap,2245 -updateSequenceNumber,2246 -upperLimit,2247 -upperRange,2248 -upperThreshold,2249 -upperThresholdValue,2250 -userDateEnd,2251 -userDateStart,2252 -userDateTimeEnd,2253 -userDateTimeStart,2254 -userTimeEnd,2255 -userTimeStart,2256 -uuidOfHGrid,2257 -uuidOfVGrid,2258 -uvRelativeToGrid,2259 -validityDate,2260 -validityTime,2261 -values,2262 -variationOfVisibility,2263 -variationOfVisibilityDirection,2264 -variationOfVisibilityDirectionAngle,2265 -variationOfVisibilityDirectionTrend1,2266 -variationOfVisibilityDirectionTrend2,2267 -variationOfVisibilityDirectionTrend3,2268 -variationOfVisibilityDirectionTrend4,2269 -variationOfVisibilityTrend1,2270 -variationOfVisibilityTrend2,2271 -variationOfVisibilityTrend3,2272 -variationOfVisibilityTrend4,2273 -varno,2274 -verificationDate,2275 -verificationMonth,2276 -verificationYear,2277 -verifyingMonth,2278 -version,2279 -versionNumOfFilesFreeSpaceStorage,2280 -versionNumOfRootGroupSymbolTableEntry,2281 -versionNumOfSharedHeaderMessageFormat,2282 -versionNumberOfExperimentalSuite,2283 -versionNumberOfGribLocalTables,2284 -versionNumberOfSuperblock,2285 -versionOfModelClimate,2286 -verticalCoordinate,2287 -verticalCoordinateDefinition,2288 -verticalDomainTemplate,2289 -verticalDomainTemplateNumber,2290 -verticalVisibility,2291 -verticalVisibilityCoded,2292 -visibility,2293 -visibilityInKilometresTrend1,2294 -visibilityInKilometresTrend2,2295 -visibilityInKilometresTrend3,2296 -visibilityInKilometresTrend4,2297 -visibilityTrend1,2298 -visibilityTrend2,2299 -visibilityTrend3,2300 -visibilityTrend4,2301 -waveDomain,2302 -weightAppliedToClimateMonth1,2303 -westLongitudeOfCluster,2304 -westLongitudeOfDomainOfTubing,2305 -westernLongitudeOfClusterDomain,2306 -westernLongitudeOfDomain,2307 -widthOfFirstOrderValues,2308 -widthOfLengths,2309 -widthOfSPD,2310 -widthOfWidths,2311 -windDirection,2312 -windDirectionTrend1,2313 -windDirectionTrend2,2314 -windDirectionTrend3,2315 -windDirectionTrend4,2316 -windGust,2317 -windGustTrend1,2318 -windGustTrend2,2319 -windGustTrend3,2320 -windGustTrend4,2321 -windPresent,2322 -windSpeed,2323 -windSpeedTrend1,2324 -windSpeedTrend2,2325 -windSpeedTrend3,2326 -windSpeedTrend4,2327 -windUnits,2328 -windUnitsTrend1,2329 -windUnitsTrend2,2330 -windUnitsTrend3,2331 -windUnitsTrend4,2332 -windVariableDirection,2333 -windVariableDirectionTrend1,2334 -windVariableDirectionTrend2,2335 -windVariableDirectionTrend3,2336 -windVariableDirectionTrend4,2337 -wrongPadding,2338 -xCoordinateOfOriginOfSectorImage,2339 -xCoordinateOfSubSatellitePoint,2340 -xDirectionGridLength,2341 -xDirectionGridLengthInMetres,2342 -xDirectionGridLengthInMillimetres,2343 -xFirst,2344 -xLast,2345 -yCoordinateOfOriginOfSectorImage,2346 -yCoordinateOfSubSatellitePoint,2347 -yDirectionGridLength,2348 -yDirectionGridLengthInMetres,2349 -yDirectionGridLengthInMillimetres,2350 -yFirst,2351 -yLast,2352 -year,2353 -yearOfAnalysis,2354 -yearOfCentury,2355 -yearOfEndOfOverallTimeInterval,2356 -yearOfForecast,2357 -yearOfModelVersion,2358 -yearOfReference,2359 -zero,2360 -zeros,2361 +stepHumanReadable,2066 +stepInHours,2067 +stepRange,2068 +stepRangeInHours,2069 +stepType,2070 +stepTypeForConversion,2071 +stepTypeInternal,2072 +stepUnits,2073 +stepZero,2074 +stream,2075 +streamOfAnalysis,2076 +stretchingFactor,2077 +stretchingFactorScaled,2078 +stringValues,2079 +subCentre,2080 +subDefinitions1,2081 +subDefinitions2,2082 +subLocalDefinition1,2083 +subLocalDefinition2,2084 +subLocalDefinitionLength1,2085 +subLocalDefinitionLength2,2086 +subLocalDefinitionNumber1,2087 +subLocalDefinitionNumber2,2088 +subSetJ,2089 +subSetK,2090 +subSetM,2091 +subcentreOfAnalysis,2092 +subdivisionsOfBasicAngle,2093 +suiteName,2094 +superblockExtensionAddress,2095 +swapScanningLat,2096 +swapScanningLon,2097 +swapScanningX,2098 +swapScanningY,2099 +system,2100 +systemNumber,2101 +t,2102 +table2Version,2103 +tableCode,2104 +tableNumber,2105 +tableReference,2106 +tablesLocalDir,2107 +tablesMasterDir,2108 +tablesVersion,2109 +tablesVersionLatest,2110 +targetCompressionRatio,2111 +td,2112 +tempPressureUnits,2113 +temperature,2114 +temperatureAndDewpointPresent,2115 +templatesLocalDir,2116 +templatesMasterDir,2117 +theHindcastMarsStream,2118 +theMessage,2119 +thisExperimentVersionNumber,2120 +thisMarsClass,2121 +thisMarsStream,2122 +thisMarsType,2123 +thousand,2124 +three,2125 +threshold,2126 +thresholdIndicator,2127 +tiggeCentre,2128 +tiggeLAMName,2129 +tiggeLocalVersion,2130 +tiggeModel,2131 +tiggeSection,2132 +tiggeSuiteID,2133 +tigge_name,2134 +tigge_short_name,2135 +tileClassification,2136 +tileIndex,2137 +time,2138 +timeCoordinateDefinition,2139 +timeDomainTemplate,2140 +timeDomainTemplateNumber,2141 +timeIncrement,2142 +timeIncrementBetweenSuccessiveFields,2143 +timeOfAnalysis,2144 +timeOfForecast,2145 +timeOfModelVersion,2146 +timeOfReference,2147 +timeRangeIndicator,2148 +timeRangeIndicatorFromStepRange,2149 +timeUnitFlag,2150 +timerepres,2151 +topLevel,2152 +total,2153 +totalAerosolBinsNumbers,2154 +totalInitialConditions,2155 +totalLength,2156 +totalNumber,2157 +totalNumberOfClusters,2158 +totalNumberOfDataValuesMissingInStatisticalProcess,2159 +totalNumberOfDirections,2160 +totalNumberOfForecastProbabilities,2161 +totalNumberOfFrequencies,2162 +totalNumberOfGridPoints,2163 +totalNumberOfIterations,2164 +totalNumberOfRepetitions,2165 +totalNumberOfTileAttributePairs,2166 +totalNumberOfTubes,2167 +totalNumberOfValuesInUnpackedSubset,2168 +totalNumberOfdimensions,2169 +treatmentOfMissingData,2170 +true,2171 +trueLengthOfLastGroup,2172 +truncateDegrees,2173 +truncateLaplacian,2174 +tsectionNumber3,2175 +tsectionNumber4,2176 +tsectionNumber5,2177 +tubeDomain,2178 +tubeNumber,2179 +two,2180 +twoOrdersOfSPD,2181 +type,2182 +typeOfAnalysis,2183 +typeOfAuxiliaryInformation,2184 +typeOfCalendar,2185 +typeOfCompressionUsed,2186 +typeOfDistributionFunction,2187 +typeOfEnsembleForecast,2188 +typeOfEnsembleMember,2189 +typeOfFirstFixedSurface,2190 +typeOfGeneratingProcess,2191 +typeOfGrid,2192 +typeOfHorizontalLine,2193 +typeOfIntervalForFirstAndSecondSize,2194 +typeOfIntervalForFirstAndSecondWavelength,2195 +typeOfLevel,2196 +typeOfLevelECMF,2197 +typeOfOriginalFieldValues,2198 +typeOfPacking,2199 +typeOfPostProcessing,2200 +typeOfPreProcessing,2201 +typeOfProcessedData,2202 +typeOfSSTFieldUsed,2203 +typeOfSecondFixedSurface,2204 +typeOfSizeInterval,2205 +typeOfStatisticalPostProcessingOfEnsembleMembers,2206 +typeOfStatisticalProcessing,2207 +typeOfTimeIncrement,2208 +typeOfTimeIncrementBetweenSuccessiveFieldsUsedInTheStatisticalProcessing,2209 +typeOfWavelengthInterval,2210 +typicalCentury,2211 +typicalDate,2212 +typicalDateTime,2213 +typicalDay,2214 +typicalHour,2215 +typicalMinute,2216 +typicalMonth,2217 +typicalSecond,2218 +typicalTime,2219 +typicalYear,2220 +typicalYear2,2221 +typicalYearOfCentury,2222 +uco,2223 +ucs,2224 +unexpandedDescriptors,2225 +unexpandedDescriptorsEncoded,2226 +unitOfOffsetFromReferenceTime,2227 +unitOfTime,2228 +unitOfTimeIncrement,2229 +unitOfTimeRange,2230 +units,2231 +unitsBias,2232 +unitsConversionOffset,2233 +unitsConversionScaleFactor,2234 +unitsDecimalScaleFactor,2235 +unitsECMF,2236 +unitsFactor,2237 +unitsOfFirstFixedSurface,2238 +unitsOfSecondFixedSurface,2239 +unknown,2240 +unpack,2241 +unpackedError,2242 +unpackedSubsetPrecision,2243 +unpackedValues,2244 +unsignedIntegers,2245 +unusedBitsInBitmap,2246 +updateSequenceNumber,2247 +upperLimit,2248 +upperRange,2249 +upperThreshold,2250 +upperThresholdValue,2251 +userDateEnd,2252 +userDateStart,2253 +userDateTimeEnd,2254 +userDateTimeStart,2255 +userTimeEnd,2256 +userTimeStart,2257 +uuidOfHGrid,2258 +uuidOfVGrid,2259 +uvRelativeToGrid,2260 +validityDate,2261 +validityTime,2262 +values,2263 +variationOfVisibility,2264 +variationOfVisibilityDirection,2265 +variationOfVisibilityDirectionAngle,2266 +variationOfVisibilityDirectionTrend1,2267 +variationOfVisibilityDirectionTrend2,2268 +variationOfVisibilityDirectionTrend3,2269 +variationOfVisibilityDirectionTrend4,2270 +variationOfVisibilityTrend1,2271 +variationOfVisibilityTrend2,2272 +variationOfVisibilityTrend3,2273 +variationOfVisibilityTrend4,2274 +varno,2275 +verificationDate,2276 +verificationMonth,2277 +verificationYear,2278 +verifyingMonth,2279 +version,2280 +versionNumOfFilesFreeSpaceStorage,2281 +versionNumOfRootGroupSymbolTableEntry,2282 +versionNumOfSharedHeaderMessageFormat,2283 +versionNumberOfExperimentalSuite,2284 +versionNumberOfGribLocalTables,2285 +versionNumberOfSuperblock,2286 +versionOfModelClimate,2287 +verticalCoordinate,2288 +verticalCoordinateDefinition,2289 +verticalDomainTemplate,2290 +verticalDomainTemplateNumber,2291 +verticalVisibility,2292 +verticalVisibilityCoded,2293 +visibility,2294 +visibilityInKilometresTrend1,2295 +visibilityInKilometresTrend2,2296 +visibilityInKilometresTrend3,2297 +visibilityInKilometresTrend4,2298 +visibilityTrend1,2299 +visibilityTrend2,2300 +visibilityTrend3,2301 +visibilityTrend4,2302 +waveDomain,2303 +weightAppliedToClimateMonth1,2304 +westLongitudeOfCluster,2305 +westLongitudeOfDomainOfTubing,2306 +westernLongitudeOfClusterDomain,2307 +westernLongitudeOfDomain,2308 +widthOfFirstOrderValues,2309 +widthOfLengths,2310 +widthOfSPD,2311 +widthOfWidths,2312 +windDirection,2313 +windDirectionTrend1,2314 +windDirectionTrend2,2315 +windDirectionTrend3,2316 +windDirectionTrend4,2317 +windGust,2318 +windGustTrend1,2319 +windGustTrend2,2320 +windGustTrend3,2321 +windGustTrend4,2322 +windPresent,2323 +windSpeed,2324 +windSpeedTrend1,2325 +windSpeedTrend2,2326 +windSpeedTrend3,2327 +windSpeedTrend4,2328 +windUnits,2329 +windUnitsTrend1,2330 +windUnitsTrend2,2331 +windUnitsTrend3,2332 +windUnitsTrend4,2333 +windVariableDirection,2334 +windVariableDirectionTrend1,2335 +windVariableDirectionTrend2,2336 +windVariableDirectionTrend3,2337 +windVariableDirectionTrend4,2338 +wrongPadding,2339 +xCoordinateOfOriginOfSectorImage,2340 +xCoordinateOfSubSatellitePoint,2341 +xDirectionGridLength,2342 +xDirectionGridLengthInMetres,2343 +xDirectionGridLengthInMillimetres,2344 +xFirst,2345 +xLast,2346 +yCoordinateOfOriginOfSectorImage,2347 +yCoordinateOfSubSatellitePoint,2348 +yDirectionGridLength,2349 +yDirectionGridLengthInMetres,2350 +yDirectionGridLengthInMillimetres,2351 +yFirst,2352 +yLast,2353 +year,2354 +yearOfAnalysis,2355 +yearOfCentury,2356 +yearOfEndOfOverallTimeInterval,2357 +yearOfForecast,2358 +yearOfModelVersion,2359 +yearOfReference,2360 +zero,2361 +zeros,2362 diff --git a/tests/pseudo_budg.sh b/tests/pseudo_budg.sh new file mode 100755 index 000000000..4ee4ced56 --- /dev/null +++ b/tests/pseudo_budg.sh @@ -0,0 +1,18 @@ +#!/bin/sh +# (C) Copyright 2005- 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. +# + + +. ./include.sh + +REDIRECT=/dev/null + +${tools_dir}/grib_ls ${data_dir}/budg > $REDIRECT +${tools_dir}/grib_dump ${data_dir}/budg > $REDIRECT + diff --git a/tests/pseudo_diag.sh b/tests/pseudo_diag.sh new file mode 100755 index 000000000..a203ec3de --- /dev/null +++ b/tests/pseudo_diag.sh @@ -0,0 +1,89 @@ +#!/bin/sh +# (C) Copyright 2005- 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. +# + +# Tests for Pseudo-GRIB format "DIAG" + +. ./include.sh +label="pseudo-diag-test" +tempOut=temp.${label}.out +tempTxt=temp.${label}.txt +tempRef=temp.${label}.ref + +REDIRECT=/dev/null + +sample=$ECCODES_SAMPLES_PATH/diag.tmpl + +# Basic grib commands should not fail +# ------------------------------------ +${tools_dir}/grib_ls $sample > $REDIRECT +${tools_dir}/grib_dump $sample > $REDIRECT + +echo "Check setting integer keys..." +# ---------------------------------- +echo 'set numberOfIntegers=3; set integerValues={55, 44, 66}; write;' | ${tools_dir}/grib_filter -o $tempOut - $sample +${tools_dir}/grib_dump -p numberOfFloats,numberOfIntegers,floatValues,integerValues $tempOut | sed 1d > $tempTxt +cat > $tempRef < $tempTxt +cat > $tempRef < $tempTxt +cat > $tempRef < $tempTxt +grep -q "'E', 'C', 'M', 'W', 'F', ' '" $tempTxt + +# TODO encoding of characters not fully working. We are using one-byte integers instead +#echo 'set numberOfCharacters=4; set charValues={"J","u","m","p"}; write;'| ${tools_dir}/grib_filter -o $tempOut - $sample +#res=`${tools_dir}/grib_dump $tempOut | grep charValues | tr -d '\n' | tr -d ' '` +#[ "$res" = "charValues=J;charValues=u;charValues=m;charValues=p;" ] + + +# Clean up +rm -f $tempOut $tempRef $tempTxt diff --git a/tests/unit_tests.c b/tests/unit_tests.c index 18445914f..31eb6a5b3 100644 --- a/tests/unit_tests.c +++ b/tests/unit_tests.c @@ -41,8 +41,8 @@ static void check_float_representation(const double val, const double expected, static void test_get_git_sha1() { const char* sha1 = grib_get_git_sha1(); - printf("Testing: test_get_git_sha1...\n"); - assert(sha1 != NULL); + Assert(sha1 != NULL); + printf("Testing: test_get_git_sha1... %s\n", sha1); } static void test_grib_nearest_smaller_ibmfloat() @@ -1389,39 +1389,36 @@ static void test_string_splitting() printf("Testing: test_string_splitting...\n"); list = string_split(input, "|"); - assert(list); + if (!list) { assert(!"List is NULL"); return; } for (i = 0; list[i] != NULL; ++i) {} /* count how many tokens */ assert(i == 4); - if (strcmp(list[0], "Born") != 0) assert(0); - if (strcmp(list[1], "To") != 0) assert(0); - if (strcmp(list[2], "Be") != 0) assert(0); - if (strcmp(list[3], "Wild") != 0) assert(0); - assert(list[4] == NULL); - for (i = 0; list[i] != NULL; ++i) - free(list[i]); + if (!list[0] || !STR_EQ(list[0], "Born")) Assert(0); + if (!list[1] || !STR_EQ(list[1], "To")) Assert(0); + if (!list[2] || !STR_EQ(list[2], "Be")) Assert(0); + if (!list[3] || !STR_EQ(list[3], "Wild")) Assert(0); + Assert(list[4] == NULL); + for (i = 0; list[i] != NULL; ++i) free(list[i]); free(list); strcpy(input, "12345|a gap|"); list = string_split(input, "|"); - assert(list); + if (!list) { assert(0); return; } for (i = 0; list[i] != NULL; ++i) {} /* count how many tokens */ assert(i == 2); - if (strcmp(list[0], "12345") != 0) assert(0); - if (strcmp(list[1], "a gap") != 0) assert(0); + if (!list[0] || !STR_EQ(list[0], "12345")) Assert(0); + if (!list[1] || !STR_EQ(list[1], "a gap")) Assert(0); assert(list[2] == NULL); - for (i = 0; list[i] != NULL; ++i) - free(list[i]); + for (i = 0; list[i] != NULL; ++i) free(list[i]); free(list); strcpy(input, "Steppenwolf"); list = string_split(input, ","); - assert(list); + if (!list) { assert(0); return; } for (i = 0; list[i] != NULL; ++i) {} /* count how many tokens */ assert(i == 1); - if (strcmp(list[0], "Steppenwolf") != 0) assert(0); + if (!list[0] || !STR_EQ(list[0], "Steppenwolf")) Assert(0); assert(list[1] == NULL); - for (i = 0; list[i] != NULL; ++i) - free(list[i]); + for (i = 0; list[i] != NULL; ++i) free(list[i]); free(list); /* Note: currently cannot cope with */ @@ -1469,21 +1466,21 @@ static void test_concept_condition_strings() printf("Testing: test_concept_condition_strings...\n"); err = get_concept_condition_string(h, "typeOfLevel", NULL, result); - assert(!err); - assert(strcmp(result, "typeOfFirstFixedSurface=1,typeOfSecondFixedSurface=255") == 0); + Assert(!err); + Assert(strcmp(result, "typeOfFirstFixedSurface=1,typeOfSecondFixedSurface=255") == 0); err = get_concept_condition_string(h, "paramId", NULL, result); - assert(!err); - assert(strcmp(result, "discipline=0,parameterCategory=0,parameterNumber=0") == 0); + Assert(!err); + Assert(strcmp(result, "discipline=0,parameterCategory=0,parameterNumber=0") == 0); err = get_concept_condition_string(h, "gridType", NULL, result); - assert(!err); + Assert(!err); /*printf("%s\n", result);*/ - assert(strcmp(result, "gridDefinitionTemplateNumber=0,PLPresent=0") == 0); + Assert(strcmp(result, "gridDefinitionTemplateNumber=0,PLPresent=0") == 0); err = get_concept_condition_string(h, "stepType", NULL, result); - assert(!err); - assert(strcmp(result, "selectStepTemplateInstant=1,stepTypeInternal=instant") == 0); + Assert(!err); + Assert(strcmp(result, "selectStepTemplateInstant=1,stepTypeInternal=instant") == 0); grib_handle_delete(h); } diff --git a/tigge/CMakeLists.txt b/tigge/CMakeLists.txt index dbc9a093e..10c4aaec8 100644 --- a/tigge/CMakeLists.txt +++ b/tigge/CMakeLists.txt @@ -10,26 +10,22 @@ ecbuild_add_library(TARGET tigge_tools ecbuild_add_executable(TARGET tigge_check SOURCES tigge_check.c INCLUDES ${ECCODES_EXTRA_INCLUDE_DIRS} - LIBS eccodes tigge_tools - ) + LIBS eccodes tigge_tools) -ecbuild_add_executable(TARGET tigge_name +ecbuild_add_executable(TARGET tigge_name SOURCES tigge_name.c INCLUDES ${ECCODES_EXTRA_INCLUDE_DIRS} CONDITION ECCODES_INSTALL_EXTRA_TOOLS - LIBS eccodes tigge_tools - ) + LIBS eccodes tigge_tools) ecbuild_add_executable(TARGET tigge_accumulations SOURCES tigge_accumulations.c INCLUDES ${ECCODES_EXTRA_INCLUDE_DIRS} CONDITION ECCODES_INSTALL_EXTRA_TOOLS - LIBS eccodes tigge_tools - ) + LIBS eccodes tigge_tools) ecbuild_add_executable(TARGET tigge_split SOURCES tigge_split.c INCLUDES ${ECCODES_EXTRA_INCLUDE_DIRS} CONDITION ECCODES_INSTALL_EXTRA_TOOLS - LIBS eccodes tigge_tools - ) + LIBS eccodes tigge_tools) diff --git a/tigge/tigge_check.c b/tigge/tigge_check.c index fc9c232d7..f1905bdd3 100755 --- a/tigge/tigge_check.c +++ b/tigge/tigge_check.c @@ -80,6 +80,8 @@ static void given_thickness(grib_handle*,const parameter*,double,double); static void has_bitmap(grib_handle*,const parameter*,double,double); static void has_soil_level(grib_handle*,const parameter*,double,double); static void has_soil_layer(grib_handle*,const parameter*,double,double); +static void resolution_s2s(grib_handle*,const parameter*,double,double); +static void resolution_s2s_ocean(grib_handle*,const parameter*,double,double); static void height_level(grib_handle*,const parameter*,double,double); static void pressure_level(grib_handle*,const parameter*,double,double); @@ -247,7 +249,7 @@ static void gaussian_grid(grib_handle* h) last_n = n; } - assert(values); + if (!values) { assert(0); return; } if (values) { values[0] = rint(values[0]*1e6)/1e6; } @@ -306,6 +308,7 @@ static void gaussian_grid(grib_handle* h) pl = (double*)malloc(sizeof(double)*(count)); CHECK(pl != NULL); + if (!pl) return; nPl = count; if((err_code = grib_get_double_array(h,"pl",pl,&count))) @@ -839,6 +842,18 @@ static void has_soil_layer(grib_handle* h,const parameter* p,double min,double m CHECK(le(h,"level",14)); /* max in UERRA */ } +static void resolution_s2s(grib_handle* h,const parameter* p,double min,double max) +{ + CHECK(eq(h,"iDirectionIncrement",1500000)); + CHECK(eq(h,"jDirectionIncrement",1500000)); +} + +static void resolution_s2s_ocean(grib_handle* h,const parameter* p,double min,double max) +{ + CHECK(eq(h,"iDirectionIncrement",1000000)); + CHECK(eq(h,"jDirectionIncrement",1000000)); +} + static void six_hourly(grib_handle* h,const parameter* p,double min,double max) { statistical_process(h,p,min,max); diff --git a/tigge/tigge_check.h b/tigge/tigge_check.h index 3f5517ab1..98178be7d 100644 --- a/tigge/tigge_check.h +++ b/tigge/tigge_check.h @@ -1495,7 +1495,7 @@ uerra, eswi-an: an.sp.sfc.grib2, field 1 [surface_pressure_sfc]: surface_pressur {"typeOfSecondFixedSurface", GRIB_TYPE_LONG, 8}, {NULL, }, }, - {&daily_average, &predefined_thickness}, + {&daily_average, &predefined_thickness, &resolution_s2s}, }, /* S2S/CAWCR: total_column_water_sfc.glob minimum value 0.00832421 is not in [0.01,1] @@ -1521,7 +1521,7 @@ warning: s2s.z_tigge_c_kwbc_20090829000000_ncep_prod_pf_sl_0024_003_0000_tcw.gri {"typeOfSecondFixedSurface", GRIB_TYPE_LONG, 8}, {NULL, }, }, - {&daily_average, &predefined_thickness}, + {&daily_average, &predefined_thickness, &resolution_s2s}, }, { @@ -1567,7 +1567,7 @@ s2s/ammc: warning: s2s.2t_20151224_26.grib2, field 12 [surface_air_temperature_s {"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 103}, {NULL, }, }, - {&daily_average, &given_level}, + {&daily_average, &given_level, &resolution_s2s}, }, { @@ -1614,7 +1614,7 @@ s2s/ammc: warning: s2s.2t_20151224_26.grib2, field 12 [surface_air_temperature_s {"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 103}, {NULL, }, }, - {&daily_average, &given_level}, + {&daily_average, &given_level, &resolution_s2s}, }, /* S2S/CAWCR: skin_temperature_sfc.glob maximum value 309.28 is not in [310,355] @@ -1639,7 +1639,7 @@ uerra/egrr/det/an: skin_temperature_sfc minimum value 266.875 is not in [160,250 {"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 1}, {NULL, }, }, - {&daily_average, &predefined_level}, + {&daily_average, &predefined_level, &resolution_s2s}, }, /* @@ -1842,7 +1842,7 @@ s2s_prod/ammc/enfo:warning: s2s.st20_20151004_4.grib2, field 61 [soil_temperatur {"scaledValueOfSecondFixedSurface", GRIB_TYPE_LONG, 10}, {NULL, }, }, - {&daily_average, &given_thickness, &has_bitmap}, + {&daily_average, &given_thickness, &has_bitmap, &resolution_s2s}, }, /* S2S/CAWCR: snow_depth_water_equivalent_sfc.glob maximum value 9066.25 is not in [10000,15000] @@ -1866,7 +1866,7 @@ warning: s2s.z_tigge_c_kwbc_19990817000000_ncep_prod_cf_sl_0024_000_0000_sd.grib {"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 1}, {NULL, }, }, - {&daily_average, &predefined_level}, + {&daily_average, &predefined_level, &resolution_s2s}, }, /*s2s/isac:warning: s2s.z_s2s_c_isac_201510190000_glob_prod_cf_0744_00.sl.grib2, field 25 [snow_depth_water_equivalent_sfc.glob]: snow_depth_water_equivalent_sfc.glob maximum value 118.824 @@ -1894,7 +1894,7 @@ warning: s2s.z_tigge_c_kwbc_19990817000000_ncep_prod_cf_sl_0024_000_0000_sd.grib {"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 1}, {NULL, }, }, - {&daily_average, &predefined_level}, + {&daily_average, &predefined_level, &resolution_s2s}, }, /* @@ -1926,7 +1926,7 @@ s2s/ammc/enfo:s2s.tcc_20151004_9.grib2, field 21 [total_cloud_cover_sfc.glob]: t {"typeOfSecondFixedSurface", GRIB_TYPE_LONG, 8}, {NULL, }, }, - {&daily_average, &predefined_thickness}, + {&daily_average, &predefined_thickness, &resolution_s2s}, }, /* @@ -1957,7 +1957,7 @@ s2s/ammc/enfo:s2s.tcc_20151004_9.grib2, field 21 [total_cloud_cover_sfc.glob]: t {"typeOfSecondFixedSurface", GRIB_TYPE_LONG, 8}, {NULL, }, }, - {&daily_average, &predefined_thickness}, + {&daily_average, &predefined_thickness, &resolution_s2s}, }, { @@ -2003,7 +2003,7 @@ s2s/ammc/enfo:s2s.tcc_20151004_9.grib2, field 21 [total_cloud_cover_sfc.glob]: t {"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 1}, {NULL, }, }, - {&daily_average, &predefined_level, &has_bitmap}, + {&daily_average, &predefined_level, &has_bitmap, &resolution_s2s}, }, { @@ -2027,7 +2027,7 @@ s2s/ammc/enfo:s2s.tcc_20151004_9.grib2, field 21 [total_cloud_cover_sfc.glob]: t {"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 1}, {NULL, }, }, - {&daily_average, &predefined_level}, + {&daily_average, &predefined_level, &resolution_s2s}, }, /* @@ -2055,7 +2055,7 @@ s2s/ammc/enfo:s2s.tcc_20151004_9.grib2, field 21 [total_cloud_cover_sfc.glob]: t {"typeOfFirstFixedSurface", GRIB_TYPE_LONG, 1}, {NULL, }, }, - {&daily_average, &predefined_level, &has_bitmap}, + {&daily_average, &predefined_level, &has_bitmap, &resolution_s2s}, }, { @@ -3755,7 +3755,7 @@ uerra, eswi-enfo:total_cloud_cover_sfc maximum value 96.4844 is not in [100,100] {"scaledValueOfFirstFixedSurface", GRIB_TYPE_LONG, 29315}, {NULL, }, }, - {&daily_average, &given_level, &has_bitmap}, + {&daily_average, &given_level, &has_bitmap, &resolution_s2s_ocean}, }, { "average_salinity_in_the_upper_300_m_o2d.s2", @@ -3780,7 +3780,7 @@ uerra, eswi-enfo:total_cloud_cover_sfc maximum value 96.4844 is not in [100,100] {"scaledValueOfSecondFixedSurface", GRIB_TYPE_LONG, 300}, {NULL, }, }, - {&daily_average, &given_thickness, &has_bitmap}, + {&daily_average, &given_thickness, &has_bitmap, &resolution_s2s_ocean}, }, { "mean_sea_water_temperature_in_the_upper_300_m_o2d.s2", @@ -3805,7 +3805,7 @@ uerra, eswi-enfo:total_cloud_cover_sfc maximum value 96.4844 is not in [100,100] {"scaledValueOfSecondFixedSurface", GRIB_TYPE_LONG, 300}, {NULL, }, }, - {&daily_average, &given_thickness, &has_bitmap}, + {&daily_average, &given_thickness, &has_bitmap, &resolution_s2s_ocean}, }, { "mean_sea_water_potential_temperature_in_the_upper_300_m_o2d.s2", @@ -3830,7 +3830,7 @@ uerra, eswi-enfo:total_cloud_cover_sfc maximum value 96.4844 is not in [100,100] {"scaledValueOfSecondFixedSurface", GRIB_TYPE_LONG, 300}, {NULL, }, }, - {&daily_average, &given_thickness, &has_bitmap}, + {&daily_average, &given_thickness, &has_bitmap, &resolution_s2s_ocean}, }, { "ocean_mixed_layer_thickness_defined_by_sigma_theta_0.01_kg/m3_o2d.s2", @@ -3852,7 +3852,7 @@ uerra, eswi-enfo:total_cloud_cover_sfc maximum value 96.4844 is not in [100,100] {NULL, }, }, - {&daily_average, &given_level, &has_bitmap}, + {&daily_average, &given_level, &has_bitmap, &resolution_s2s_ocean}, }, { "eastward_sea_water_velocity_o2d.s2", @@ -3874,7 +3874,7 @@ uerra, eswi-enfo:total_cloud_cover_sfc maximum value 96.4844 is not in [100,100] {NULL, }, }, - {&daily_average, &given_level, &has_bitmap}, + {&daily_average, &given_level, &has_bitmap, &resolution_s2s_ocean}, }, { "northward_sea_water_velocity_o2d.s2", @@ -3896,7 +3896,7 @@ uerra, eswi-enfo:total_cloud_cover_sfc maximum value 96.4844 is not in [100,100] {NULL, }, }, - {&daily_average, &given_level, &has_bitmap}, + {&daily_average, &given_level, &has_bitmap, &resolution_s2s_ocean}, }, { "sea-ice_thickness_o2d.s2", @@ -3918,7 +3918,7 @@ uerra, eswi-enfo:total_cloud_cover_sfc maximum value 96.4844 is not in [100,100] {NULL, }, }, - {&daily_average, &given_level, &has_bitmap}, + {&daily_average, &given_level, &has_bitmap, &resolution_s2s_ocean}, }, { "sea_surface_height_o2d.s2", @@ -3940,7 +3940,7 @@ uerra, eswi-enfo:total_cloud_cover_sfc maximum value 96.4844 is not in [100,100] {NULL, }, }, - {&daily_average, &given_level, &has_bitmap}, + {&daily_average, &given_level, &has_bitmap, &resolution_s2s_ocean}, }, { "sea_surface_practical_salinity_o2d.s2", @@ -3962,7 +3962,7 @@ uerra, eswi-enfo:total_cloud_cover_sfc maximum value 96.4844 is not in [100,100] {NULL, }, }, - {&daily_average, &given_level, &has_bitmap}, + {&daily_average, &given_level, &has_bitmap, &resolution_s2s_ocean}, }, }; diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index ecf60298b..634cbf8bf 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -12,8 +12,7 @@ list( APPEND grib_tools_sources grib_tools.c grib_options.c - grib_tools.h - ) + grib_tools.h ) if( EC_OS_NAME MATCHES "windows" ) list( APPEND grib_tools_sources wingetopt.c ) @@ -27,7 +26,7 @@ ecbuild_add_library( TARGET grib_tools LIBS eccodes ) # tools binaries -list( APPEND grib_tools_bins +list( APPEND ecc_tools_binaries codes_info codes_count codes_split_file grib_histogram grib_filter grib_ls grib_dump grib_merge grib2ppm grib_set grib_get grib_get_data grib_copy @@ -35,20 +34,18 @@ list( APPEND grib_tools_bins bufr_ls bufr_dump bufr_set bufr_get bufr_copy bufr_compare gts_get gts_compare gts_copy gts_dump gts_filter gts_ls - metar_dump metar_ls metar_compare metar_get metar_filter metar_copy - ) + metar_dump metar_ls metar_compare metar_get metar_filter metar_copy ) -list( APPEND grib_tools_bins_EXTRA +list( APPEND ecc_tools_binaries_extra big2gribex gg_sub_area_check grib_repair grib_to_json grib_check_gaussian_grid - bufr_split_by_rdbSubtype - ) + bufr_split_by_rdbSubtype ) # Install generic tools -foreach( tool ${grib_tools_bins} ) +foreach( tool ${ecc_tools_binaries} ) # here we use the fact that each tool has only one C file that matches its name ecbuild_add_executable( TARGET ${tool} SOURCES ${tool}.c @@ -57,7 +54,7 @@ endforeach() # Install extra tools # User must run cmake with -DECCODES_INSTALL_EXTRA_TOOLS=ON -foreach( tool ${grib_tools_bins_EXTRA} ) +foreach( tool ${ecc_tools_binaries_extra} ) ecbuild_add_executable( TARGET ${tool} SOURCES ${tool}.c CONDITION ECCODES_INSTALL_EXTRA_TOOLS @@ -67,34 +64,34 @@ endforeach() # grib_count/bufr_count etc. Same source code, different executable names ecbuild_add_executable( TARGET grib_count SOURCES codes_count.c - LIBS grib_tools ) + LIBS grib_tools ) ecbuild_add_executable( TARGET bufr_count SOURCES codes_count.c - LIBS grib_tools ) + LIBS grib_tools ) ecbuild_add_executable( TARGET gts_count SOURCES codes_count.c - LIBS grib_tools ) + LIBS grib_tools ) # grib to netcdf is optional ecbuild_add_executable( TARGET grib_to_netcdf SOURCES grib_to_netcdf.c INCLUDES ${NETCDF_INCLUDE_DIRS} CONDITION HAVE_NETCDF - LIBS grib_tools ${NETCDF_LIBRARIES}) + LIBS grib_tools ${NETCDF_LIBRARIES} ) ecbuild_add_executable( TARGET grib_list_keys SOURCES list_keys.c CONDITION ECCODES_INSTALL_EXTRA_TOOLS - LIBS grib_tools ) + LIBS grib_tools ) ecbuild_add_executable( TARGET codes_bufr_filter SOURCES bufr_filter.c - LIBS grib_tools ) + LIBS grib_tools ) # grib1to2 script needs to be generated before installation -if (ECCODES_INSTALL_EXTRA_TOOLS) +if( ECCODES_INSTALL_EXTRA_TOOLS ) ecbuild_info("ECCODES_INSTALL_EXTRA_TOOLS enabled") configure_file( grib1to2.in grib1to2 ) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/grib1to2 diff --git a/tools/bufr_compare.c b/tools/bufr_compare.c index 8c2cae0de..2d023cb2b 100644 --- a/tools/bufr_compare.c +++ b/tools/bufr_compare.c @@ -1296,8 +1296,10 @@ static int compare_all_dump_keys(grib_handle* handle1, grib_handle* handle2, gri prefix = (char*)xa->name; } - if (blacklisted(prefix)) + if (blacklisted(prefix)) { + if (dofree) grib_context_free(context, prefix); continue; + } /* Compare the key itself */ if (compare_values(options, handle1, handle2, prefix, GRIB_TYPE_UNDEFINED)) { diff --git a/tools/bufr_dump.c b/tools/bufr_dump.c index 482a1099b..7c32d649e 100644 --- a/tools/bufr_dump.c +++ b/tools/bufr_dump.c @@ -379,6 +379,7 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) { long length = 0; int i, err = 0; + grib_handle* hclone = NULL; grib_accessor* a = NULL; grib_accessors_list* al = NULL; if (grib_get_long(h, "totalLength", &length) != GRIB_SUCCESS) @@ -422,7 +423,8 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) new_handle = grib_handle_new_from_message(0, buffer, size); Assert(new_handle); /* Replace handle with the new one which has only one subset */ - h = new_handle; /*TODO: possible leak!*/ + h = new_handle; + hclone = h2; /* to be deleted later */ } } else { @@ -539,6 +541,7 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) } } + grib_handle_delete(hclone); return 0; } diff --git a/tools/codes_count.c b/tools/codes_count.c index dbcae607c..beb5763b9 100644 --- a/tools/codes_count.c +++ b/tools/codes_count.c @@ -58,15 +58,17 @@ static int count_messages(FILE* in, int message_type, unsigned long* count) } } if (mesg && !err) { - grib_context_free(c, mesg); (*count)++; } + grib_context_free(c, mesg); } } if (err == GRIB_END_OF_FILE) err = GRIB_SUCCESS; + if (mesg) grib_context_free(c, mesg); + return err; } diff --git a/tools/grib_options.c b/tools/grib_options.c index 299b376a0..e8c2af3c9 100644 --- a/tools/grib_options.c +++ b/tools/grib_options.c @@ -434,15 +434,22 @@ char* grib_options_get_args(char* id) sprintf(err, "%s%c\n", msg, *id); for (i = 0; i < grib_options_count; i++) { if (!strcmp(id, grib_options[i].id)) { - if (grib_options[i].args != NULL) + if (grib_options[i].args != NULL) { + free(err); return grib_options[i].args; - else + } else { break; + } } } for (i = 0; i < grib_options_help_count; i++) { if (!strcmp(id, grib_options_help_list[i].id)) { - return grib_options_help_list[i].args != NULL ? (char*)grib_options_help_list[i].args : err; + if (grib_options_help_list[i].args != NULL) { + free(err); + return (char*)grib_options_help_list[i].args; + } else { + return err; + } } } return err; diff --git a/tools/grib_to_netcdf.c b/tools/grib_to_netcdf.c index 379fc24f1..051a10bf7 100644 --- a/tools/grib_to_netcdf.c +++ b/tools/grib_to_netcdf.c @@ -1125,8 +1125,10 @@ static request* fieldset_to_request(fieldset* fs) int i; request* r = empty_request("GRIB"); - if (!fs) + if (!fs) { + free_one_request(r); return 0; + } for (i = 0; i < fs->count; i++) { request* s = field_to_request(fs->fields[i]); @@ -1696,6 +1698,8 @@ static hypercube* new_hypercube(const request* r) static void print_hypercube(const hypercube* h) { + Assert(h); + if (!h) return; print_all_requests(h->r); print_all_requests(h->cube); grib_context_log(ctx, GRIB_LOG_INFO, "%d active out of %d fields described\n", count_index(h), h->size); @@ -2413,20 +2417,18 @@ static int compute_scale(dataset_t* subset) if (g->has_bitmap) { subset->bitmap = TRUE; for (j = 0; j < len; ++j) { - if (vals[j] != (double)global_missing_value) { - if (vals[j] > max) - max = vals[j]; - if (vals[j] < min) - min = vals[j]; + if (vals && vals[j] != global_missing_value) { + if (vals[j] > max) max = vals[j]; + if (vals[j] < min) min = vals[j]; } } } else { for (j = 0; j < len; ++j) { - if (vals[j] > max) - max = vals[j]; - if (vals[j] < min) - min = vals[j]; + if (vals) { + if (vals[j] > max) max = vals[j]; + if (vals[j] < min) min = vals[j]; + } } } /* g->purge_header = TRUE; */ @@ -3268,8 +3270,10 @@ static int fill_netcdf_dimensions(hypercube* h, fieldset* fs, int ncid) int* values = (int*)grib_context_malloc(ctx, sizeof(int) * n); const char* lowaxis = (axis); - if (!values) + if (!values) { grib_context_log(ctx, GRIB_LOG_ERROR, "fill_netcdf_dimensions: cannot allocate %ld bytes", sizeof(int) * n); + exit(1); + } if (strcmp("levelist", axis) == 0) lowaxis = "level"; diff --git a/tools/grib_tools.c b/tools/grib_tools.c index da9304a79..f5f1a5bb7 100644 --- a/tools/grib_tools.c +++ b/tools/grib_tools.c @@ -559,7 +559,9 @@ static int grib_tool_index(grib_runtime_options* options) } navigate(options->index2->fields, options); - + /* TODO(masn): memleak + * grib_context_free(c, options->index2->current); + */ grib_tool_finalise_action(options); return 0; diff --git a/windows/msvc/grib_api_lib/grib_api_lib.vcxproj b/windows/msvc/grib_api_lib/grib_api_lib.vcxproj index 43e88df91..c206b2941 100755 --- a/windows/msvc/grib_api_lib/grib_api_lib.vcxproj +++ b/windows/msvc/grib_api_lib/grib_api_lib.vcxproj @@ -396,6 +396,7 @@ + @@ -496,6 +497,7 @@ + From 8161ac25dd53ec26f4a6598229ea06dad68cb76c Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 16 May 2020 18:37:42 +0100 Subject: [PATCH 80/82] Resolve conflicts: VERSION.cmake --- VERSION.cmake | 1 - 1 file changed, 1 deletion(-) delete mode 100644 VERSION.cmake diff --git a/VERSION.cmake b/VERSION.cmake deleted file mode 100644 index 4cd1fa6d7..000000000 --- a/VERSION.cmake +++ /dev/null @@ -1 +0,0 @@ -set( ${PROJECT_NAME}_VERSION_STR "2.18.0" ) From 37154b2f95e401d1d8acfa4345132093aabdbd99 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 16 May 2020 18:50:49 +0100 Subject: [PATCH 81/82] Renamed test files --- tests/budg.sh | 18 ---- tests/bufr_ecc-604.c | 192 ---------------------------------- tests/bufr_ecc-604.sh | 68 ------------ tests/diag.sh | 89 ---------------- tests/get_fail.sh | 25 ----- tests/grib_ecc-604-encode.c | 155 --------------------------- tests/grib_ecc-604.c | 201 ------------------------------------ tests/grib_ecc-604.sh | 87 ---------------- tests/index.c | 157 ---------------------------- tests/index.sh | 60 ----------- tests/md5.sh | 29 ------ tests/read_index.c | 138 ------------------------- 12 files changed, 1219 deletions(-) delete mode 100755 tests/budg.sh delete mode 100644 tests/bufr_ecc-604.c delete mode 100755 tests/bufr_ecc-604.sh delete mode 100755 tests/diag.sh delete mode 100755 tests/get_fail.sh delete mode 100644 tests/grib_ecc-604-encode.c delete mode 100644 tests/grib_ecc-604.c delete mode 100755 tests/grib_ecc-604.sh delete mode 100644 tests/index.c delete mode 100755 tests/index.sh delete mode 100755 tests/md5.sh delete mode 100644 tests/read_index.c diff --git a/tests/budg.sh b/tests/budg.sh deleted file mode 100755 index 4ee4ced56..000000000 --- a/tests/budg.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# (C) Copyright 2005- 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. -# - - -. ./include.sh - -REDIRECT=/dev/null - -${tools_dir}/grib_ls ${data_dir}/budg > $REDIRECT -${tools_dir}/grib_dump ${data_dir}/budg > $REDIRECT - diff --git a/tests/bufr_ecc-604.c b/tests/bufr_ecc-604.c deleted file mode 100644 index 39cc40ddc..000000000 --- a/tests/bufr_ecc-604.c +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Test for ECC-604: Each thread creates a new BUFR handle, optionaly clone it and/or write it out - */ -#include -#include -#include -#include - -#include "eccodes.h" -#include "grib_api_internal.h" - -/* These are passed in via argv */ -static size_t NUM_THREADS = 0; -static size_t FILES_PER_ITERATION = 0; -static char* INPUT_FILE = NULL; -int opt_dump = 0; /* If 1 then dump handle to /dev/null */ -int opt_clone = 0; /* If 1 then clone source handle */ -int opt_write = 0; /* If 1 write handle to file */ - -static int encode_file(char* template_file, char* output_file) -{ - FILE *in, *out = NULL; - codes_handle* source_handle = NULL; - const void* buffer = NULL; - size_t size = 0; - int err = 0; - long numSubsets = 0; - - assert(template_file); - in = fopen(template_file, "rb"); - assert(in); - if (opt_write) { - assert(output_file); - out = fopen(output_file, "wb"); - assert(out); - } - - /* loop over the messages in the source BUFR and clone them */ - while ((source_handle = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) { - codes_handle* h = source_handle; - - if (opt_clone) { - h = codes_handle_clone(source_handle); - assert(h); - } - - CODES_CHECK(codes_get_long(h, "numberOfSubsets", &numSubsets), 0); - CODES_CHECK(codes_set_long(h, "unpack", 1), 0); - - CODES_CHECK(codes_get_message(h, &buffer, &size), 0); - if (opt_write) { - if (fwrite(buffer, 1, size, out) != size) { - perror(output_file); - return 1; - } - } - if (opt_dump) { - FILE* devnull = fopen("/dev/null", "w"); - grib_dumper* dumper = NULL; - const char* dumper_name = "bufr_simple"; - unsigned long dump_flags = CODES_DUMP_FLAG_ALL_DATA; - /* codes_dump_content(source_handle,devnull, "json", 1024, NULL); */ /* JSON dump with all attributes */ - dumper = grib_dump_content_with_dumper(source_handle, dumper, devnull, dumper_name, dump_flags, NULL); - assert(dumper); - fclose(devnull); - } - - codes_handle_delete(source_handle); - if (opt_clone) codes_handle_delete(h); - } - - if (opt_write) fclose(out); - fclose(in); - - return 0; -} - -void do_stuff(void* data); - -/* Structure for passing data to threads */ -struct v -{ - size_t number; - char* data; -}; - -void* runner(void* ptr); /* the thread */ - -int main(int argc, char** argv) -{ - size_t i; - int thread_counter = 0; - int parallel = 1, index = 0, c = 0; - const char* prog = argv[0]; - char* mode; - if (argc < 5 || argc > 7) { - fprintf(stderr, "Usage:\n\t%s [options] seq file numRuns numIter\nOr\n\t%s [options] par file numThreads numIter\n", prog, prog); - return 1; - } - - while ((c = getopt(argc, argv, "dcw")) != -1) { - switch (c) { - case 'd': - opt_dump = 1; - break; - case 'c': - opt_clone = 1; - break; - case 'w': - opt_write = 1; - break; - } - } - index = optind; - mode = argv[index]; - INPUT_FILE = argv[index + 1]; - NUM_THREADS = atol(argv[index + 2]); - FILES_PER_ITERATION = atol(argv[index + 3]); - - if (strcmp(mode, "seq") == 0) { - parallel = 0; - } - if (parallel) { - printf("Running parallel in %ld threads. %ld iterations\n", NUM_THREADS, FILES_PER_ITERATION); - printf("Options: dump=%d, clone=%d, write=%d\n", opt_dump, opt_clone, opt_write); - } - else { - printf("Running sequentially in %ld runs. %ld iterations\n", NUM_THREADS, FILES_PER_ITERATION); - } - - { - pthread_t* workers = malloc(NUM_THREADS * sizeof(pthread_t)); - for (i = 0; i < NUM_THREADS; i++) { - struct v* data = (struct v*)malloc(sizeof(struct v)); - data->number = i; - data->data = NULL; - - if (parallel) { - /* Now we will create the thread passing it data as an argument */ - pthread_create(&workers[thread_counter], NULL, runner, data); - /*pthread_join(workers[thread_counter], NULL);*/ - thread_counter++; - } - else { - do_stuff(data); - } - } - - if (parallel) { - for (i = 0; i < NUM_THREADS; i++) { - pthread_join(workers[i], NULL); - } - } - free(workers); - } - - return 0; -} - -void* runner(void* ptr) -{ - do_stuff(ptr); - pthread_exit(0); -} - -void do_stuff(void* ptr) -{ - /* Cast argument to struct v pointer */ - struct v* data = ptr; - size_t i; - char output_file[50]; - time_t ltime; - struct tm result; - char stime[32]; - - for (i = 0; i < FILES_PER_ITERATION; i++) { - if (opt_write) { - sprintf(output_file, "output/output_file_%ld-%ld.bufr", data->number, i); - encode_file(INPUT_FILE, output_file); - } - else { - encode_file(INPUT_FILE, NULL); - } - } - - ltime = time(NULL); - localtime_r(<ime, &result); - strftime(stime, 32, "%H:%M:%S", &result); /* Try to get milliseconds here too*/ - /* asctime_r(&result, stime); */ - - printf("%s: Worker %ld finished.\n", stime, data->number); -} diff --git a/tests/bufr_ecc-604.sh b/tests/bufr_ecc-604.sh deleted file mode 100755 index 0be4ddfe7..000000000 --- a/tests/bufr_ecc-604.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh -# (C) Copyright 2005- 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. -# - -. ./include.sh - -label="bufr_ecc-604" -temp_dir=tempdir.${label} - -NUM_THREADS=3 -NUM_ITER=10 -OUTPUT=output - -validate() -{ - echo "Checking every output file is identical..." - # Get checksum of first file - ck1=`cksum $OUTPUT/output_file_0-0.bufr | awk '{print $1}'` - set +x - # Get checksum of all of them and sort unique - res=`cksum $OUTPUT/output_file_* | awk '{print $1}' | sort -u` - set -x - # Should be the same as the first - [ "$res" = "$ck1" ] -} -process() -{ - input=$1 # The input BUFR file - - # Test 01: Clone + output - # ------------------------ - rm -fr $OUTPUT; mkdir -p $OUTPUT - time ${test_dir}/bufr_ecc-604 -c -w par $input $NUM_THREADS $NUM_ITER - validate - - # Test 02: No clone + output - # -------------------------- - rm -fr $OUTPUT; mkdir -p $OUTPUT - time ${test_dir}/bufr_ecc-604 -w par $input $NUM_THREADS $NUM_ITER - validate - - # Test 03: Clone + no output - # --------------------------- - rm -fr $OUTPUT - time ${test_dir}/bufr_ecc-604 -c par $input $NUM_THREADS $NUM_ITER - # Nothing to validate as there is no output -} -################################################### -rm -fr $temp_dir -mkdir -p $temp_dir -cd $temp_dir - -bufr_files=`cat ${data_dir}/bufr/bufr_data_files.txt` -for bf in ${bufr_files}; do - b=${data_dir}/bufr/$bf - echo "Doing $b" - process $b -done - -# Clean up -cd $test_dir -rm -fr $temp_dir diff --git a/tests/diag.sh b/tests/diag.sh deleted file mode 100755 index 61bdd47d1..000000000 --- a/tests/diag.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/sh -# (C) Copyright 2005- 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. -# - -# Tests for Pseudo-GRIB format "DIAG" - -. ./include.sh -label="pseudo-diag-test" -tempOut=temp.${label}.out -tempTxt=temp.${label}.txt -tempRef=temp.${label}.ref - -REDIRECT=/dev/null - -sample=$ECCODES_SAMPLES_PATH/diag.tmpl - -# Basic grib commands should not fail -# ------------------------------------ -${tools_dir}/grib_ls $sample > $REDIRECT -${tools_dir}/grib_dump $sample > $REDIRECT - -echo "Check setting integer keys..." -# ---------------------------------- -echo 'set numberOfIntegers=3; set integerValues={55, 44, 66}; write;' | ${tools_dir}/grib_filter -o $tempOut - $sample -${tools_dir}/grib_dump -p numberOfFloats,numberOfIntegers,floatValues,integerValues $tempOut | sed 1d > $tempTxt -cat > $tempRef < $tempTxt -cat > $tempRef < $tempTxt -cat > $tempRef < $tempTxt -grep -q "'E', 'C', 'M', 'W', 'F', ' '" $tempTxt - -# TODO encoding of characters not fully working. We are using one-byte integers instead -#echo 'set numberOfCharacters=4; set charValues={"J","u","m","p"}; write;'| ${tools_dir}/grib_filter -o $tempOut - $sample -#res=`${tools_dir}/grib_dump $tempOut | grep charValues | tr -d '\n' | tr -d ' '` -#[ "$res" = "charValues=J;charValues=u;charValues=m;charValues=p;" ] - - -# Clean up -rm -f $tempOut $tempRef diff --git a/tests/get_fail.sh b/tests/get_fail.sh deleted file mode 100755 index b93f96a40..000000000 --- a/tests/get_fail.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -# (C) Copyright 2005- 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. -# - -. ./include.sh - -REDIRECT=/dev/null - -# Check input file has been downloaded -[ -f ${data_dir}/regular_latlon_surface.grib1 ] - -# Expect failure as the key does not exist -set +e -${tools_dir}/grib_get -p gribname ${data_dir}/regular_latlon_surface.grib1 2> $REDIRECT > $REDIRECT - -if [ $? -eq 0 ] ; then - # Should not have succeeded - exit 1; -fi diff --git a/tests/grib_ecc-604-encode.c b/tests/grib_ecc-604-encode.c deleted file mode 100644 index 3c1bc88c7..000000000 --- a/tests/grib_ecc-604-encode.c +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Test for ECC-604: GRIB decoding/encoding sequentially and parallel with POSIX threads - */ -#include -#include -#include - -#include "grib_api.h" - -/* These are passed in via argv */ -static size_t NUM_THREADS = 0; -static size_t FILES_PER_ITERATION = 0; -static char* INPUT_FILE = NULL; -int opt_dump = 0; /* If 1 then dump handle to /dev/null */ -int opt_clone = 0; /* If 1 then clone source handle */ -int opt_write = 0; /* If 1 write handle to file */ - -static int encode_values(grib_handle* h, char* output_file) -{ - double* values; - const size_t DIM = 1000; - size_t size = DIM * DIM; - size_t i = 0; - values = (double*)malloc(size * sizeof(double)); - for (i = 0; i < size; ++i) { - double v = i; - if (i % DIM == 0) v = 0; - values[i] = v; - } - GRIB_CHECK(grib_set_long(h, "bitsPerValue", 16), 0); - GRIB_CHECK(grib_set_double_array(h, "values", values, size), 0); - free(values); - return GRIB_SUCCESS; -} - -void do_encode(void* data); - -/* Structure for passing data to threads */ -struct v -{ - size_t number; - char* data; -}; - -void* runner(void* ptr); /* the thread */ - -int main(int argc, char** argv) -{ - size_t i; - int thread_counter = 0; - int parallel = 1, index = 0, c = 0; - const char* prog = argv[0]; - char* mode; - if (argc < 5 || argc > 7) { - fprintf(stderr, "Usage:\n\t%s [options] seq sample numRuns numIter\nOr\n\t%s [options] par sample numThreads numIter\n", prog, prog); - return 1; - } - - while ((c = getopt(argc, argv, "dcw")) != -1) { - switch (c) { - case 'd': - opt_dump = 1; - break; - case 'c': - opt_clone = 1; - break; - case 'w': - opt_write = 1; - break; - } - } - index = optind; - mode = argv[index]; - INPUT_FILE = argv[index + 1]; /* Has to be the name of a sample file (without tmpl extension) */ - NUM_THREADS = atol(argv[index + 2]); - FILES_PER_ITERATION = atol(argv[index + 3]); - - if (strcmp(mode, "seq") == 0) { - parallel = 0; - } - if (parallel) { - printf("Running parallel in %ld threads. %ld iterations (prod=%ld)\n", NUM_THREADS, FILES_PER_ITERATION, NUM_THREADS * FILES_PER_ITERATION); - printf("Options: dump=%d, clone=%d, write=%d\n", opt_dump, opt_clone, opt_write); - } - else { - printf("Running sequentially in %ld runs. %ld iterations\n", NUM_THREADS, FILES_PER_ITERATION); - } - - { - pthread_t* workers = malloc(NUM_THREADS * sizeof(pthread_t)); - for (i = 0; i < NUM_THREADS; i++) { - struct v* data = (struct v*)malloc(sizeof(struct v)); - data->number = i; - data->data = NULL; - - if (parallel) { - /* Now we will create the thread passing it data as an argument */ - pthread_create(&workers[thread_counter], NULL, runner, data); - thread_counter++; - } - else { - do_encode(data); - } - } - - if (parallel) { - for (i = 0; i < NUM_THREADS; i++) { - pthread_join(workers[i], NULL); - } - } - free(workers); - } - - return 0; -} - -void* runner(void* ptr) -{ - do_encode(ptr); - pthread_exit(0); -} - -void do_encode(void* ptr) -{ - /* Cast argument to struct v pointer */ - struct v* data = ptr; - size_t i; - char output_file[50]; - time_t ltime; - struct tm result; - char stime[32]; - grib_handle* hs = NULL; - - hs = grib_handle_new_from_samples(0, INPUT_FILE); - - for (i = 0; i < FILES_PER_ITERATION; i++) { - grib_handle* h = grib_handle_clone(hs); - if (opt_write) { - sprintf(output_file, "output/output_file_%ld-%ld.grib", data->number, i); - encode_values(h, output_file); - } - else { - encode_values(h, NULL); - } - grib_handle_delete(h); - } - - ltime = time(NULL); - localtime_r(<ime, &result); - strftime(stime, 32, "%H:%M:%S", &result); /* Try to get milliseconds here too*/ - /* asctime_r(&result, stime); */ - - printf("%s: Worker %ld finished.\n", stime, data->number); - grib_handle_delete(hs); -} diff --git a/tests/grib_ecc-604.c b/tests/grib_ecc-604.c deleted file mode 100644 index 7ff78b4b1..000000000 --- a/tests/grib_ecc-604.c +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Test for ECC-604: GRIB decoding/encoding sequentially and parallel with POSIX threads - */ -#include -#include -#include -#include - -#include "grib_api.h" - -/* These are passed in via argv */ -static size_t NUM_THREADS = 0; -static size_t FILES_PER_ITERATION = 0; -static char* INPUT_FILE = NULL; -int opt_dump = 0; /* If 1 then dump handle to /dev/null */ -int opt_clone = 0; /* If 1 then clone source handle */ -int opt_write = 0; /* If 1 write handle to file */ - -static int encode_file(char* template_file, char* output_file) -{ - FILE *in, *out = NULL; - grib_handle* source_handle = NULL; - const void* buffer = NULL; - size_t size = 0; - int err = 0; - double* values; - - in = fopen(template_file, "rb"); - assert(in); - if (opt_write && output_file) { - out = fopen(output_file, "wb"); - assert(out); - } - - /* loop over the messages in the source GRIB and clone them */ - while ((source_handle = grib_handle_new_from_file(0, in, &err)) != NULL) { - int i; - size_t values_len = 0; - size_t str_len = 20; - grib_handle* h = source_handle; - - if (opt_clone) { - h = grib_handle_clone(source_handle); - assert(h); - } - - GRIB_CHECK(grib_get_size(h, "values", &values_len), 0); - - values = (double*)malloc(values_len * sizeof(double)); - GRIB_CHECK(grib_get_double_array(h, "values", values, &values_len), 0); - - for (i = 0; i < values_len; i++) { - values[i] *= 0.9; - } - - GRIB_CHECK(grib_set_string(h, "stepUnits", "s", &str_len), 0); - GRIB_CHECK(grib_set_long(h, "startStep", 43200), 0); - GRIB_CHECK(grib_set_long(h, "endStep", 86400), 0); - GRIB_CHECK(grib_set_long(h, "bitsPerValue", 16), 0); - - /* set data values */ - GRIB_CHECK(grib_set_double_array(h, "values", values, values_len), 0); - - GRIB_CHECK(grib_get_message(h, &buffer, &size), 0); - if (opt_write) { - if (fwrite(buffer, 1, size, out) != size) { - perror(output_file); - return 1; - } - } - if (opt_dump) { - FILE* devnull = fopen("/dev/null", "w"); - grib_dump_content(source_handle, devnull, "debug", 0, NULL); - } - - grib_handle_delete(source_handle); - if (opt_clone) grib_handle_delete(h); - free(values); - } - - if (opt_write) fclose(out); - fclose(in); - - return 0; -} - -void do_stuff(void* data); - -/* Structure for passing data to threads */ -struct v -{ - size_t number; - char* data; -}; - -void* runner(void* ptr); /* the thread */ - -int main(int argc, char** argv) -{ - size_t i; - int thread_counter = 0; - int parallel = 1, index = 0, c = 0; - const char* prog = argv[0]; - char* mode; - if (argc < 5 || argc > 8) { - fprintf(stderr, "Usage:\n\t%s [options] seq file numRuns numIter\nOr\n\t%s [options] par file numThreads numIter\n", prog, prog); - return 1; - } - - while ((c = getopt(argc, argv, "dcw")) != -1) { - switch (c) { - case 'd': - opt_dump = 1; - break; - case 'c': - opt_clone = 1; - break; - case 'w': - opt_write = 1; - break; - } - } - index = optind; - mode = argv[index]; - INPUT_FILE = argv[index + 1]; - NUM_THREADS = atol(argv[index + 2]); - FILES_PER_ITERATION = atol(argv[index + 3]); - - if (strcmp(mode, "seq") == 0) { - parallel = 0; - } - if (parallel) { - printf("Running parallel in %ld threads. %ld iterations (prod=%ld)\n", NUM_THREADS, FILES_PER_ITERATION, NUM_THREADS * FILES_PER_ITERATION); - printf("Options: dump=%d, clone=%d, write=%d\n", opt_dump, opt_clone, opt_write); - } - else { - printf("Running sequentially in %ld runs. %ld iterations\n", NUM_THREADS, FILES_PER_ITERATION); - } - - { - pthread_t* workers = malloc(NUM_THREADS * sizeof(pthread_t)); - for (i = 0; i < NUM_THREADS; i++) { - struct v* data = (struct v*)malloc(sizeof(struct v)); - data->number = i; - data->data = NULL; - - if (parallel) { - /* Now we will create the thread passing it data as an argument */ - pthread_create(&workers[thread_counter], NULL, runner, data); - /*pthread_join(workers[thread_counter], NULL);*/ - thread_counter++; - } - else { - do_stuff(data); - } - } - - if (parallel) { - for (i = 0; i < NUM_THREADS; i++) { - pthread_join(workers[i], NULL); - } - } - free(workers); - } - - return 0; -} - -void* runner(void* ptr) -{ - do_stuff(ptr); - pthread_exit(0); -} - -void do_stuff(void* ptr) -{ - /* Cast argument to struct v pointer */ - struct v* data = ptr; - size_t i; - char output_file[50]; - time_t ltime; - struct tm result; - char stime[32]; - - for (i = 0; i < FILES_PER_ITERATION; i++) { - if (opt_write) { - sprintf(output_file, "output/output_file_%ld-%ld.grib", data->number, i); - encode_file(INPUT_FILE, output_file); - } - else { - encode_file(INPUT_FILE, NULL); - } - } - - ltime = time(NULL); - localtime_r(<ime, &result); - strftime(stime, 32, "%H:%M:%S", &result); /* Try to get milliseconds here too*/ - /* asctime_r(&result, stime); */ - - printf("%s: Worker %ld finished.\n", stime, data->number); -} diff --git a/tests/grib_ecc-604.sh b/tests/grib_ecc-604.sh deleted file mode 100755 index 8b226f5bb..000000000 --- a/tests/grib_ecc-604.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/bin/sh -# (C) Copyright 2005- 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. -# - -. ./include.sh - -label="grib_ecc-604" -temp_dir=tempdir.${label} - -NUM_THREADS=3 -NUM_ITER=10 -OUTPUT=output - -validate() -{ - echo "Checking every output file is identical..." - # Get checksum of first file - ck1=`cksum $OUTPUT/output_file_0-0.grib | awk '{print $1}'` - set +x - # Get checksum of all of them and sort unique - res=`cksum $OUTPUT/output_file_* | awk '{print $1}' | sort -u` - set -x - # Should be the same as the first - [ "$res" = "$ck1" ] -} -process() -{ - input=$1 # The input GRIB file - - # Test 01: Clone + output - # ------------------------ - rm -fr $OUTPUT; mkdir -p $OUTPUT - time ${test_dir}/grib_ecc-604 -c -w par $input $NUM_THREADS $NUM_ITER - validate - - # Test 02: No clone + output - # -------------------------- - rm -fr $OUTPUT; mkdir -p $OUTPUT - time ${test_dir}/grib_ecc-604 -w par $input $NUM_THREADS $NUM_ITER - validate - - # Test 03: Clone + dump + no output - # --------------------------------- - rm -fr $OUTPUT - time ${test_dir}/grib_ecc-604 -c -d par $input $NUM_THREADS $NUM_ITER - # Nothing to validate as there is no output -} -################################################### -rm -fr $temp_dir -mkdir -p $temp_dir -cd $temp_dir - -GRIB1_INPUTS=" - $ECCODES_SAMPLES_PATH/gg_sfc_grib1.tmpl - ${data_dir}/gen_bitmap.grib - ${data_dir}/spectral_complex.grib1 - ${data_dir}/gen_ext.grib - ${data_dir}/gen.grib - ${data_dir}/gen_ext_spd_2.grib" - -GRIB2_INPUTS=" - $ECCODES_SAMPLES_PATH/gg_sfc_grib2.tmpl - ${data_dir}/reduced_gaussian_sub_area.grib2 - ${data_dir}/test_file.grib2 - ${data_dir}/sample.grib2" - -if [ $HAVE_JPEG -eq 1 ]; then - echo "Adding extra files (HAVE_JPEG=1)" - GRIB2_INPUTS="${data_dir}/jpeg.grib2 ${data_dir}/reduced_gaussian_surface_jpeg.grib2 "$GRIB2_INPUTS -fi -if [ $HAVE_AEC -eq 1 ]; then - GRIB2_INPUTS=$GRIB2_INPUTS" ${data_dir}/ccsds.grib2 " -fi - -for gf in $GRIB1_INPUTS $GRIB2_INPUTS; do - process $gf -done - -# Clean up -cd $test_dir -rm -fr $temp_dir diff --git a/tests/index.c b/tests/index.c deleted file mode 100644 index 98b20756d..000000000 --- a/tests/index.c +++ /dev/null @@ -1,157 +0,0 @@ -/* - * (C) Copyright 2005- 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. - */ -#include "grib_api.h" - -static void usage(const char* prog) -{ - printf("usage: %s infile\n", prog); - exit(1); -} - -int main(int argc, char* argv[]) -{ - grib_index* index = NULL; - grib_handle* h = NULL; - char* infile = NULL; - long *steps, *levels, *numbers; /* arrays */ - char** shortNames = NULL; - int i, j, k, l; - size_t stepSize, levelSize, shortNameSize, numberSize; - long oStep, oLevel, oNumber; - char oShortName[200]; - size_t lenShortName = 200; - int ret = 0, count = 0; - - if (argc != 2) usage(argv[0]); - infile = argv[1]; - - printf("indexing...\n"); - - /* Create an index given set of keys*/ - index = grib_index_new(0, "shortName,level,number,step", &ret); - if (ret) { - printf("error: %s\n", grib_get_error_message(ret)); - exit(ret); - } - - /* Indexes a file */ - ret = grib_index_add_file(index, infile); - if (ret) { - printf("error: %s\n", grib_get_error_message(ret)); - exit(ret); - } - printf("end indexing...\n"); - - /* get the number of distinct values of "step" in the index */ - GRIB_CHECK(grib_index_get_size(index, "step", &stepSize), 0); - steps = (long*)malloc(sizeof(long) * stepSize); - if (!steps) exit(1); - /* get the list of distinct steps from the index */ - /* the list is in ascending order */ - GRIB_CHECK(grib_index_get_long(index, "step", steps, &stepSize), 0); - printf("stepSize=%ld\n", (long)stepSize); - for (i = 0; i < stepSize; i++) - printf("%ld ", steps[i]); - printf("\n"); - - /*same as for "step"*/ - GRIB_CHECK(grib_index_get_size(index, "level", &levelSize), 0); - levels = (long*)malloc(sizeof(long) * levelSize); - if (!levels) exit(1); - /*same as for "step"*/ - GRIB_CHECK(grib_index_get_long(index, "level", levels, &levelSize), 0); - printf("levelSize=%ld\n", (long)levelSize); - for (i = 0; i < levelSize; i++) - printf("%ld ", levels[i]); - printf("\n"); - - /*same as for "step"*/ - GRIB_CHECK(grib_index_get_size(index, "number", &numberSize), 0); - numbers = (long*)malloc(sizeof(long) * numberSize); - if (!numbers) exit(1); - /*same as for "step"*/ - GRIB_CHECK(grib_index_get_long(index, "number", numbers, &numberSize), 0); - printf("numberSize=%ld\n", (long)numberSize); - for (i = 0; i < numberSize; i++) - printf("%ld ", numbers[i]); - printf("\n"); - - /*same as for "step"*/ - GRIB_CHECK(grib_index_get_size(index, "shortName", &shortNameSize), 0); - shortNames = (char**)malloc(sizeof(char*) * shortNameSize); - if (!shortNames) exit(1); - /*same as for "step"*/ - GRIB_CHECK(grib_index_get_string(index, "shortName", shortNames, &shortNameSize), 0); - printf("shortNameSize=%ld\n", (long)shortNameSize); - for (i = 0; i < shortNameSize; i++) - printf("%s ", shortNames[i]); - printf("\n"); - - count = 0; - /* nested loops on the keys values of the index */ - /* different order of the nested loops doesn't affect performance*/ - for (i = 0; i < shortNameSize; i++) { - /* select the GRIB with shortName=shortNames[i] */ - grib_index_select_string(index, "shortName", shortNames[i]); - - for (l = 0; l < levelSize; l++) { - /* select the GRIB with level=levels[i] */ - grib_index_select_long(index, "level", levels[l]); - - for (j = 0; j < numberSize; j++) { - /* select the GRIB with number=numbers[i] */ - grib_index_select_long(index, "number", numbers[j]); - - for (k = 0; k < stepSize; k++) { - /* select the GRIB with step=steps[i] */ - grib_index_select_long(index, "step", steps[k]); - - /* create a new grib_handle from the index with the constraints - imposed by the select statements. It is a loop because - in the index there could be more than one GRIB with those - constraints */ - while ((h = grib_handle_new_from_index(index, &ret)) != NULL) { - count++; - if (ret) { - printf("error: %d\n", ret); - exit(ret); - } - lenShortName = 200; - grib_get_string(h, "shortName", oShortName, &lenShortName); - grib_get_long(h, "level", &oLevel); - grib_get_long(h, "number", &oNumber); - grib_get_long(h, "step", &oStep); - printf("shortName=%s ", oShortName); - printf("level=%ld ", oLevel); - printf("number=%ld ", oNumber); - printf("step=%ld \n", oStep); - grib_handle_delete(h); - } - if (ret && ret != GRIB_END_OF_INDEX) { - printf("error: %s\n", grib_get_error_message(ret)); - exit(ret); - } - } - } - } - } - printf(" %d messages selected\n", count); - - grib_index_write(index, "out.gribidx"); - grib_index_delete(index); - free(levels); - free(numbers); - free(steps); - for (i = 0; i < shortNameSize; i++) - free(shortNames[i]); - free(shortNames); - - return 0; -} diff --git a/tests/index.sh b/tests/index.sh deleted file mode 100755 index 4851d3345..000000000 --- a/tests/index.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/sh -# (C) Copyright 2005- 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. -# - - -#set -x -. ./include.sh -infile=${data_dir}/index.grib - -$EXEC ${test_dir}/index ${infile} > index.out - -diff index.out ${data_dir}/index.ok - -$EXEC ${test_dir}/read_index ${infile} > index.out - -diff index.out ${data_dir}/index.ok - -rm -f index.out out.gribidx - -#------------------------------- -# Test grib_index_build -#------------------------------- -tempIndex=temp.$$.idx -tempOut=temp.$$.out -tempRef=temp.$$.ref -${tools_dir}/grib_index_build -o $tempIndex ${infile} >/dev/null - -# Must remove first two lines and the last (filename specifics) -${tools_dir}/grib_dump -D ${tempIndex} | sed '1,2d' | sed '$d' > $tempOut -cat $tempOut - -cat > $tempRef < Date: Sun, 17 May 2020 20:10:17 +0100 Subject: [PATCH 82/82] Latest updates from develop (28) --- src/bufr_util.c | 4 +- src/grib_accessor_class_latitudes.c | 10 +- src/grib_accessor_class_longitudes.c | 10 +- src/grib_hash_keys.c | 3959 +++++++++-------- src/grib_iterator_class_gen.c | 7 +- ...rator_class_lambert_azimuthal_equal_area.c | 4 +- src/grib_iterator_class_lambert_conformal.c | 8 +- src/grib_iterator_class_mercator.c | 4 +- src/grib_iterator_class_polar_stereographic.c | 4 +- src/grib_iterator_class_space_view.c | 8 +- src/grib_nearest_class_sh.c | 12 +- tests/Makefile.am | 1 + tests/keys | 3920 ++++++++-------- 13 files changed, 3981 insertions(+), 3970 deletions(-) diff --git a/src/bufr_util.c b/src/bufr_util.c index 3b0c29eaa..7231c9648 100644 --- a/src/bufr_util.c +++ b/src/bufr_util.c @@ -674,7 +674,7 @@ int codes_bufr_extract_headers_malloc(grib_context* c, const char* filename, cod return GRIB_SUCCESS; } -static char* codes_bufr_header_get_centre_name(long edition, long centre_code) +static const char* codes_bufr_header_get_centre_name(long edition, long centre_code) { switch (centre_code) { case 1: @@ -856,7 +856,7 @@ int codes_bufr_header_get_string(codes_bufr_header* bh, const char* key, char* v *len = sprintf(val, "%ld", bh->bufrHeaderCentre); else if (strcmp(key, "centre") == 0) { - char* centre_str = codes_bufr_header_get_centre_name(bh->edition, bh->bufrHeaderCentre); + const char* centre_str = codes_bufr_header_get_centre_name(bh->edition, bh->bufrHeaderCentre); if (centre_str) *len = sprintf(val, "%s", centre_str); else diff --git a/src/grib_accessor_class_latitudes.c b/src/grib_accessor_class_latitudes.c index b9490f63c..3bbf8274e 100644 --- a/src/grib_accessor_class_latitudes.c +++ b/src/grib_accessor_class_latitudes.c @@ -224,7 +224,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) if (ret != GRIB_SUCCESS) { if (iter) grib_iterator_delete(iter); - grib_context_log(c, GRIB_LOG_ERROR, "unable to create iterator"); + grib_context_log(c, GRIB_LOG_ERROR, "Unable to create iterator"); return ret; } @@ -247,7 +247,7 @@ static int value_count(grib_accessor* a, long* len) *len = 0; if ((ret = grib_get_size(h, self->values, &size)) != GRIB_SUCCESS) { - grib_context_log(h->context, GRIB_LOG_ERROR, "unable to get size of %s", self->values); + grib_context_log(h->context, GRIB_LOG_ERROR, "Unable to get size of %s", self->values); return ret; } *len = size; @@ -284,13 +284,13 @@ static int get_distinct(grib_accessor* a, double** val, long* len) if (ret != GRIB_SUCCESS) { if (iter) grib_iterator_delete(iter); - grib_context_log(c, GRIB_LOG_ERROR, "unable to create iterator"); + grib_context_log(c, GRIB_LOG_ERROR, "Unable to create iterator"); return ret; } v = (double*)grib_context_malloc_clear(c, size * sizeof(double)); if (!v) { grib_context_log(c, GRIB_LOG_ERROR, - "unable to allocate %ld bytes", (long)size * sizeof(double)); + "Error allocating %ld bytes", (long)size * sizeof(double)); return GRIB_OUT_OF_MEMORY; } *val = v; @@ -311,7 +311,7 @@ static int get_distinct(grib_accessor* a, double** val, long* len) v1 = (double*)grib_context_malloc_clear(c, size * sizeof(double)); if (!v1) { - grib_context_log(c, GRIB_LOG_ERROR, "unable to allocate %ld bytes", (long)size * sizeof(double)); + grib_context_log(c, GRIB_LOG_ERROR, "Error allocating %ld bytes", (long)size * sizeof(double)); return GRIB_OUT_OF_MEMORY; } diff --git a/src/grib_accessor_class_longitudes.c b/src/grib_accessor_class_longitudes.c index b64c3225e..d24e315a7 100644 --- a/src/grib_accessor_class_longitudes.c +++ b/src/grib_accessor_class_longitudes.c @@ -205,7 +205,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) if (ret != GRIB_SUCCESS) { if (iter) grib_iterator_delete(iter); - grib_context_log(c, GRIB_LOG_ERROR, "unable to create iterator"); + grib_context_log(c, GRIB_LOG_ERROR, "Unable to create iterator"); return ret; } @@ -227,7 +227,7 @@ static int value_count(grib_accessor* a, long* len) size_t size; *len = 0; if ((ret = grib_get_size(h, self->values, &size)) != GRIB_SUCCESS) { - grib_context_log(h->context, GRIB_LOG_ERROR, "unable to get size of %s", self->values); + grib_context_log(h->context, GRIB_LOG_ERROR, "Unable to get size of %s", self->values); return ret; } *len = size; @@ -263,13 +263,13 @@ static int get_distinct(grib_accessor* a, double** val, long* len) if (ret != GRIB_SUCCESS) { if (iter) grib_iterator_delete(iter); - grib_context_log(c, GRIB_LOG_ERROR, "unable to create iterator"); + grib_context_log(c, GRIB_LOG_ERROR, "Unable to create iterator"); return ret; } v = (double*)grib_context_malloc_clear(c, size * sizeof(double)); if (!v) { grib_context_log(c, GRIB_LOG_ERROR, - "unable to allocate %ld bytes", (long)size * sizeof(double)); + "Error allocating %ld bytes", (long)size * sizeof(double)); return GRIB_OUT_OF_MEMORY; } *val = v; @@ -283,7 +283,7 @@ static int get_distinct(grib_accessor* a, double** val, long* len) v1 = (double*)grib_context_malloc_clear(c, size * sizeof(double)); if (!v1) { grib_context_log(c, GRIB_LOG_ERROR, - "unable to allocate %ld bytes", (long)size * sizeof(double)); + "Error allocating %ld bytes", (long)size * sizeof(double)); return GRIB_OUT_OF_MEMORY; } diff --git a/src/grib_hash_keys.c b/src/grib_hash_keys.c index 72f39e85c..bbd517f66 100644 --- a/src/grib_hash_keys.c +++ b/src/grib_hash_keys.c @@ -34,7 +34,7 @@ error "gperf generated tables don't work with this execution character set. Plea struct grib_keys_hash { char* name; int id;}; #include -#define TOTAL_KEYWORDS 2362 +#define TOTAL_KEYWORDS 2368 #define MIN_WORD_LENGTH 1 #define MAX_WORD_LENGTH 74 #define MIN_HASH_VALUE 5 @@ -49,9 +49,7 @@ struct grib_keys_hash { char* name; int id;}; #endif #endif static unsigned int -hash_keys (str, len) - register const char *str; - register unsigned int len; +hash_keys (const char *str, unsigned int len) { static const unsigned short asso_values[] = { @@ -537,7 +535,7 @@ static const unsigned char lengthtable[] = 0, 32, 0, 0, 32, 28, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 19, 0, 0, 15, 37, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 28, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 15, 22, + 14, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 15, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 35, 0, 19, 0, 0, 16, 0, @@ -629,7 +627,7 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 32, 0, 0, 22, 0, 0, 18, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 19, 0, 0, 0, - 0, 0, 14, 0, 0, 16, 0, 25, 0, 0, 30, 24, 0, 0, + 0, 0, 14, 0, 0, 16, 0, 25, 0, 19, 30, 24, 0, 0, 0, 0, 0, 0, 13, 0, 18, 0, 0, 31, 25, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 25, 0, @@ -767,7 +765,7 @@ static const unsigned char lengthtable[] = 0, 39, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, - 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 35, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -782,7 +780,7 @@ static const unsigned char lengthtable[] = 0, 0, 30, 0, 16, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 17, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -790,7 +788,7 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 17, 0, 9, 28, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, @@ -843,7 +841,7 @@ static const unsigned char lengthtable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, - 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 37, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, @@ -2486,2033 +2484,2033 @@ static const unsigned char lengthtable[] = static const struct grib_keys_hash wordlist[] = { {""}, {""}, {""}, {""}, {""}, - {"n",1303}, + {"n",1305}, {""}, - {"t",2102}, - {"nd",1312}, - {"td",2112}, - {"nt",1330}, - {"nnn",1316}, - {"na",1306}, - {"ed",710}, + {"t",2107}, + {"nd",1315}, + {"td",2117}, + {"nt",1333}, + {"nnn",1319}, + {"na",1308}, + {"ed",712}, {""}, - {"sd",1899}, + {"sd",1903}, {""}, - {"m",1184}, + {"m",1186}, {""}, {""}, {"Di",31}, - {"data",615}, - {"min",1266}, + {"data",617}, + {"min",1268}, {""}, {""}, {""}, {""}, - {"date",633}, + {"date",635}, {""}, - {"ident",944}, + {"ident",946}, {""}, {""}, - {"name",1307}, + {"name",1309}, {""}, {""}, {""}, - {"time",2138}, + {"time",2143}, {""}, {""}, {""}, - {"one",1498}, + {"one",1501}, {"Dstart",39}, {""}, - {"mars",1187}, - {"names",1311}, + {"mars",1189}, + {"names",1314}, {""}, - {"dataDate",618}, - {"metadata",1262}, + {"dataDate",620}, + {"metadata",1264}, {""}, - {"sort",2023}, + {"sort",2028}, {""}, - {"eps",758}, - {"domain",693}, + {"eps",760}, + {"domain",695}, {""}, - {"stream",2075}, + {"stream",2080}, {""}, {""}, {""}, - {"edition",711}, + {"edition",713}, {"cat",379}, - {"enorm",753}, - {"param",1607}, + {"enorm",755}, + {"param",1610}, {""}, {""}, - {"spare",2040}, + {"spare",2045}, {""}, - {"marsDir",1191}, + {"marsDir",1193}, {""}, {""}, - {"step",2064}, - {"present",1656}, + {"step",2069}, + {"present",1660}, {""}, {""}, - {"oper",1510}, - {"iteration",1015}, + {"oper",1513}, + {"iteration",1017}, {""}, - {"dimension",676}, + {"dimension",678}, {""}, - {"masterDir",1220}, + {"masterDir",1222}, {""}, - {"points",1646}, + {"points",1650}, {""}, {"assertion",312}, {""}, {""}, {""}, - {"opttime",1517}, + {"opttime",1520}, {"centre",397}, - {"marsDomain",1192}, - {"const",564}, + {"marsDomain",1194}, + {"const",566}, {""}, {""}, - {"parameter",1612}, - {"true",2171}, - {"core",590}, - {"second",1900}, + {"parameter",1616}, + {"true",2176}, + {"core",592}, + {"second",1904}, {""}, {""}, - {"units",2231}, + {"units",2236}, {""}, {""}, - {"rectime",1739}, - {"parameters",1620}, - {"minute",1268}, - {"section",1922}, + {"rectime",1743}, + {"parameters",1624}, + {"minute",1270}, + {"section",1926}, {""}, - {"status",2063}, - {"partitions",1625}, - {"timerepres",2151}, - {"radius",1714}, + {"status",2068}, + {"partitions",1629}, + {"timerepres",2156}, + {"radius",1718}, {""}, - {"isSens",1000}, - {"year",2354}, + {"isSens",1002}, + {"year",2360}, {""}, - {"dataTime",630}, - {"direction",679}, + {"dataTime",632}, + {"direction",681}, {""}, - {"dateTime",642}, - {"minimum",1267}, - {"statistics",2062}, - {"radials",1713}, + {"dateTime",644}, + {"minimum",1269}, + {"statistics",2067}, + {"radials",1717}, {""}, - {"leadtime",1076}, - {"type",2182}, - {"dataStream",628}, - {"hdate",917}, - {"instrument",971}, - {"notDecoded",1329}, + {"leadtime",1078}, + {"type",2187}, + {"dataStream",630}, + {"hdate",919}, + {"instrument",973}, + {"notDecoded",1332}, {""}, - {"system",2100}, - {"ucs",2224}, + {"system",2105}, + {"ucs",2229}, {""}, {""}, - {"stepZero",2074}, + {"stepZero",2079}, {""}, - {"three",2125}, - {"endStep",745}, + {"three",2130}, + {"endStep",747}, {""}, {""}, {""}, - {"process",1686}, - {"marsStream",1212}, - {"precision",1652}, - {"count",604}, + {"process",1690}, + {"marsStream",1214}, + {"precision",1656}, + {"count",606}, {""}, {""}, - {"method",1263}, + {"method",1265}, {""}, {""}, {""}, {""}, - {"class",419}, - {"phase",1639}, + {"class",421}, + {"phase",1643}, {""}, - {"uco",2223}, - {"startStep",2056}, - {"marsStep",1211}, + {"uco",2228}, + {"startStep",2061}, + {"marsStep",1213}, {""}, {""}, {""}, {""}, {""}, - {"dy",700}, - {"pl",1643}, + {"dy",702}, + {"pl",1647}, {"Dy",43}, {""}, {""}, - {"day",644}, + {"day",646}, {""}, - {"char",416}, + {"char",418}, {""}, - {"operStream",1511}, - {"yFirst",2352}, - {"latitude",1042}, - {"total",2153}, + {"operStream",1514}, + {"yFirst",2358}, + {"latitude",1044}, + {"total",2158}, {""}, {""}, - {"product",1688}, + {"product",1692}, {""}, {""}, {""}, - {"model",1284}, + {"model",1286}, {""}, - {"correction",595}, + {"correction",597}, {""}, - {"latitudes",1072}, - {"consensus",562}, - {"conceptDir",556}, - {"normal",1319}, + {"latitudes",1074}, + {"consensus",564}, + {"conceptDir",558}, + {"normal",1322}, {""}, {"TS",232}, - {"hundred",936}, - {"million",1265}, + {"hundred",938}, + {"million",1267}, {""}, {"TT",234}, {""}, - {"discipline",685}, + {"discipline",687}, {""}, {""}, {""}, {""}, - {"dataType",631}, + {"dataType",633}, {""}, - {"hour",928}, - {"landtype",1034}, + {"hour",930}, + {"landtype",1036}, {""}, {""}, - {"oceanStream",1461}, + {"oceanStream",1464}, {""}, - {"ieeeFloats",949}, + {"ieeeFloats",951}, {""}, - {"thousand",2124}, - {"endTimeStep",747}, + {"thousand",2129}, + {"endTimeStep",749}, {""}, {""}, {""}, {""}, {""}, - {"marsType",1215}, + {"marsType",1217}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"stepType",2070}, - {"grid",895}, + {"stepType",2075}, + {"grid",897}, {""}, - {"month",1291}, + {"month",1293}, {""}, - {"elementsTable",717}, - {"standardDeviation",2049}, + {"elementsTable",719}, + {"standardDeviation",2054}, {""}, {""}, {""}, {""}, - {"range",1719}, + {"range",1723}, {""}, {""}, - {"dummy",695}, + {"dummy",697}, {""}, - {"localDir",1121}, + {"localDir",1123}, {""}, {""}, - {"partitionTable",1624}, + {"partitionTable",1628}, {""}, - {"temperature",2114}, + {"temperature",2119}, {""}, {""}, {""}, - {"userDateStart",2253}, + {"userDateStart",2259}, {""}, {""}, - {"dummyc",698}, + {"dummyc",700}, {""}, {""}, - {"origin",1522}, - {"reportType",1759}, - {"rectimeDay",1740}, - {"codeType",544}, - {"matchSort",1227}, - {"reserved",1763}, + {"origin",1525}, + {"reportType",1763}, + {"rectimeDay",1744}, + {"codeType",546}, + {"matchSort",1229}, + {"reserved",1767}, {""}, - {"varno",2275}, + {"varno",2281}, {""}, - {"version",2280}, - {"indicatorOfParameter",959}, + {"version",2286}, + {"indicatorOfParameter",961}, {""}, - {"dataOrigin",622}, - {"recDateTime",1736}, + {"dataOrigin",624}, + {"recDateTime",1740}, {""}, {""}, {""}, {""}, {""}, {""}, {"JS",95}, {""}, - {"local",1113}, - {"marsQuantile",1208}, + {"local",1115}, + {"marsQuantile",1210}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"unitsFactor",2237}, + {"unitsFactor",2242}, {""}, {""}, {""}, {""}, - {"dataSelection",627}, - {"channel",414}, - {"isOctahedral",996}, + {"dataSelection",629}, + {"channel",416}, + {"isOctahedral",998}, {""}, - {"eleven",719}, - {"hideThis",922}, + {"eleven",721}, + {"hideThis",924}, {""}, - {"country",608}, + {"country",610}, {""}, {"J",94}, {""}, {""}, {""}, {""}, {""}, - {"refdate",1745}, + {"refdate",1749}, {""}, {""}, {""}, {""}, {""}, - {"userTimeStart",2257}, + {"userTimeStart",2263}, {""}, - {"threshold",2126}, + {"threshold",2131}, {""}, - {"signature",2006}, + {"signature",2011}, {""}, - {"eight",716}, + {"eight",718}, {""}, {""}, {""}, {"centreDescription",398}, - {"isFillup",994}, + {"isFillup",996}, {""}, {""}, - {"elevation",718}, + {"elevation",720}, {""}, {"categories",380}, {""}, - {"identifier",948}, + {"identifier",950}, {""}, {"TScalc",233}, {""}, - {"efiOrder",715}, + {"efiOrder",717}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"isSatellite",998}, + {"isSatellite",1000}, {""}, - {"typicalDate",2212}, + {"typicalDate",2217}, {""}, {""}, {""}, {""}, {""}, {""}, - {"diagnostic",672}, - {"file",837}, + {"diagnostic",674}, + {"file",839}, {""}, {""}, {""}, {""}, {""}, {""}, - {"false",830}, - {"values",2263}, + {"false",832}, + {"values",2269}, {""}, - {"countTotal",607}, + {"countTotal",609}, {""}, - {"section8",1961}, - {"statisticalProcess",2060}, + {"section8",1965}, + {"statisticalProcess",2065}, {""}, {""}, - {"reference",1746}, - {"levels",1096}, - {"localDay",1115}, + {"reference",1750}, + {"levels",1098}, + {"localDay",1117}, {""}, {""}, {""}, {""}, - {"levelist",1095}, + {"levelist",1097}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"fcperiod",834}, - {"longitude",1145}, + {"fcperiod",836}, + {"longitude",1147}, {""}, {""}, {""}, - {"laplacianOperator",1035}, + {"laplacianOperator",1037}, {""}, - {"unitsDecimalScaleFactor",2235}, - {"dataKeys",620}, + {"unitsDecimalScaleFactor",2240}, + {"dataKeys",622}, {"KS",97}, - {"statisticalProcessesList",2061}, - {"typicalDay",2214}, - {"levtype",1097}, - {"longitudes",1175}, - {"localDateTime",1114}, + {"statisticalProcessesList",2066}, + {"typicalDay",2219}, + {"levtype",1099}, + {"longitudes",1177}, + {"localDateTime",1116}, {""}, {""}, - {"gridType",904}, + {"gridType",906}, {""}, - {"g",872}, + {"g",874}, {""}, {""}, {""}, {""}, {""}, {"aerosolType",295}, {""}, {""}, - {"platform",1644}, - {"typicalTime",2219}, + {"platform",1648}, + {"typicalTime",2224}, {""}, {""}, {""}, {""}, {""}, {""}, - {"level",1092}, + {"level",1094}, {""}, {""}, {""}, {""}, - {"pv",1699}, - {"spectralType",2047}, + {"pv",1703}, + {"spectralType",2052}, {""}, {""}, {""}, - {"codeFigure",543}, + {"codeFigure",545}, {""}, {""}, {""}, {""}, - {"satelliteSeries",1843}, - {"productType",1693}, - {"userDateTimeStart",2255}, + {"satelliteSeries",1847}, + {"productType",1697}, + {"userDateTimeStart",2261}, {""}, - {"coefsFirst",548}, + {"coefsFirst",550}, {""}, {""}, {""}, {""}, {""}, {""}, {"average",316}, {""}, {""}, - {"padding",1536}, + {"padding",1539}, {""}, {""}, {""}, - {"unitOfTime",2228}, + {"unitOfTime",2233}, {"band",324}, {""}, {""}, {""}, {""}, - {"laplacianOperatorIsSet",1036}, + {"laplacianOperatorIsSet",1038}, {""}, {""}, {""}, - {"two",2180}, + {"two",2185}, {"ccsdsFlags",386}, {""}, {""}, {""}, {""}, {""}, {""}, - {"parameterDiscipline",1615}, + {"parameterDiscipline",1619}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"lev",1090}, + {"lev",1092}, {""}, {""}, - {"nlev",1315}, + {"nlev",1318}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"rdbtime",1725}, + {"rdbtime",1729}, {""}, - {"longitudesList",1176}, + {"longitudesList",1178}, {""}, {""}, {""}, {""}, - {"fgDate",835}, - {"oneThousand",1509}, + {"fgDate",837}, + {"oneThousand",1512}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"bitmap",362}, {""}, - {"localDecimalScaleFactor",1116}, + {"localDecimalScaleFactor",1118}, {""}, {""}, {""}, {""}, - {"coordinatesPresent",589}, + {"coordinatesPresent",591}, {""}, {""}, {""}, {""}, {""}, {""}, - {"overlayTemplate",1530}, + {"overlayTemplate",1533}, {""}, {""}, {""}, {""}, {""}, {""}, - {"levelType",1094}, + {"levelType",1096}, {""}, {""}, - {"windSpeed",2324}, + {"windSpeed",2330}, {""}, - {"fcmonth",833}, + {"fcmonth",835}, {""}, {""}, {""}, - {"number",1331}, + {"number",1334}, {""}, {""}, {"K",96}, {""}, {""}, {""}, {""}, - {"dataFlag",619}, + {"dataFlag",621}, {""}, - {"periodOfTime",1635}, - {"localSecond",1135}, + {"periodOfTime",1639}, + {"localSecond",1137}, {""}, {""}, {""}, - {"forecastperiod",864}, - {"forecastSteps",862}, - {"mybits",1302}, - {"flags",852}, + {"forecastperiod",866}, + {"forecastSteps",864}, + {"mybits",1304}, + {"flags",854}, {""}, {""}, - {"fgTime",836}, - {"setDecimalPrecision",1997}, + {"fgTime",838}, + {"setDecimalPrecision",2001}, {""}, - {"forecastTime",863}, + {"forecastTime",865}, {""}, {""}, - {"tubeDomain",2178}, + {"tubeDomain",2183}, {""}, {"Ni",194}, {""}, - {"validityTime",2262}, - {"longitudeOfCentrePoint",1149}, + {"validityTime",2268}, + {"longitudeOfCentrePoint",1151}, {"Nr",196}, {""}, - {"offset",1463}, + {"offset",1466}, {""}, - {"endDescriptors",724}, + {"endDescriptors",726}, {""}, {""}, {""}, {""}, {""}, {"anoffset",307}, {""}, {""}, {""}, - {"optionalData",1516}, + {"optionalData",1519}, {""}, {""}, {""}, {""}, - {"obstype",1458}, - {"windDirection",2313}, + {"obstype",1461}, + {"windDirection",2319}, {""}, {""}, {""}, {""}, - {"rdbtimeDate",1726}, + {"rdbtimeDate",1730}, {"angleDivisor",301}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"gg",884}, + {"gg",886}, {""}, {""}, {""}, {"avg",320}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"firstDimension",839}, + {"firstDimension",841}, {""}, {""}, {"categoryType",381}, {""}, {""}, {""}, {""}, {""}, - {"rdbType",1723}, + {"rdbType",1727}, {""}, {""}, {""}, {""}, {""}, {""}, {"Xo",268}, {""}, {""}, {""}, {"Xp",269}, {""}, {""}, - {"rdbtimeDay",1727}, + {"rdbtimeDay",1731}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"verticalDomainTemplate",2290}, + {"verticalDomainTemplate",2296}, {""}, - {"rdbDateTime",1721}, + {"rdbDateTime",1725}, {""}, {""}, {""}, {""}, {""}, {""}, - {"rdbtimeTime",1732}, + {"rdbtimeTime",1736}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"suiteName",2094}, + {"suiteName",2099}, {""}, - {"parameterName",1617}, - {"dimensionType",678}, + {"parameterName",1621}, + {"dimensionType",680}, {""}, - {"dateOfForecast",635}, + {"dateOfForecast",637}, {"NT",186}, {""}, {""}, - {"waveDomain",2303}, + {"waveDomain",2309}, {""}, {""}, {""}, {""}, - {"timeOfForecast",2145}, + {"timeOfForecast",2150}, {""}, {""}, {""}, - {"modelName",1287}, - {"coefsSecond",549}, - {"extraDim",784}, + {"modelName",1289}, + {"coefsSecond",551}, + {"extraDim",786}, {"aerosolpacking",297}, {""}, {""}, {""}, {""}, - {"lengthDescriptors",1081}, + {"lengthDescriptors",1083}, {""}, {""}, {""}, {""}, {""}, {""}, {"analysisOffsets",300}, - {"crcrlf",609}, - {"derivedForecast",670}, + {"crcrlf",611}, + {"derivedForecast",672}, {"Ny",202}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"dayOfForecast",647}, + {"dayOfForecast",649}, {""}, - {"controlForecastCluster",568}, + {"controlForecastCluster",570}, {""}, - {"latitudeOfCentrePoint",1047}, - {"shortName",2003}, + {"latitudeOfCentrePoint",1049}, + {"shortName",2007}, {""}, {""}, {""}, {""}, - {"xFirst",2345}, - {"ensembleSize",756}, + {"xFirst",2351}, + {"ensembleSize",758}, {""}, {""}, {""}, {""}, {""}, {""}, - {"marsStartStep",1210}, + {"marsStartStep",1212}, {""}, {""}, - {"startTimeStep",2058}, + {"startTimeStep",2063}, {""}, - {"localFlag",1123}, - {"flag",847}, + {"localFlag",1125}, + {"flag",849}, {""}, {""}, {""}, {""}, {""}, - {"maximum",1232}, + {"maximum",1234}, {""}, {""}, - {"runwayState",1838}, + {"runwayState",1842}, {""}, {""}, {""}, {""}, {"Ncy",192}, {""}, {""}, {""}, {""}, - {"yearOfForecast",2358}, + {"yearOfForecast",2364}, {""}, - {"logTransform",1144}, + {"logTransform",1146}, {""}, {""}, {""}, {""}, - {"stepTypeForConversion",2071}, + {"stepTypeForConversion",2076}, {""}, {""}, {""}, {""}, {"Nuy",200}, {""}, {""}, {""}, {""}, - {"oldSubtype",1497}, + {"oldSubtype",1500}, {""}, - {"incrementOfLengths",953}, + {"incrementOfLengths",955}, {""}, {""}, {""}, {"LaD",105}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"Latin",113}, {""}, - {"offsetSection9",1494}, + {"offsetSection9",1497}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"editionNumber",712}, - {"referenceDate",1747}, + {"editionNumber",714}, + {"referenceDate",1751}, {""}, {"Nassigned",189}, - {"gridName",902}, + {"gridName",904}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"freeFormData",867}, + {"freeFormData",869}, {"Lap",108}, - {"headersOnly",918}, + {"headersOnly",920}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"siteId",2013}, + {"siteId",2018}, {""}, {""}, {""}, {""}, {""}, - {"reservedOctet",1768}, + {"reservedOctet",1772}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"sectionNumber",1970}, + {"sectionNumber",1974}, {""}, - {"hourOfForecast",931}, + {"hourOfForecast",933}, {""}, {""}, - {"marsIdent",1198}, + {"marsIdent",1200}, {""}, {""}, - {"paramId",1608}, + {"paramId",1611}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"daLoop",614}, + {"daLoop",616}, {""}, {""}, - {"yLast",2353}, + {"yLast",2359}, {""}, {""}, {""}, {""}, - {"global",885}, + {"global",887}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"monthOfForecast",1294}, + {"monthOfForecast",1296}, {""}, {""}, {""}, {""}, {""}, {""}, - {"subSetJ",2089}, + {"subSetJ",2094}, {""}, {""}, - {"offsetDescriptors",1477}, + {"offsetDescriptors",1480}, {""}, {"cfName",404}, {""}, {""}, - {"generatingProcessTemplate",881}, - {"expver",782}, - {"iIncrement",941}, + {"generatingProcessTemplate",883}, + {"expver",784}, + {"iIncrement",943}, {""}, {""}, - {"originalSubCentreIdentifier",1525}, + {"originalSubCentreIdentifier",1528}, {""}, - {"validityDate",2261}, + {"validityDate",2267}, {""}, {""}, {""}, {""}, - {"decimalScaleFactor",652}, + {"decimalScaleFactor",654}, {""}, - {"visibility",2294}, - {"energyNorm",752}, + {"visibility",2300}, + {"energyNorm",754}, {""}, {""}, {"anoffsetFirst",308}, {""}, - {"latitudeSexagesimal",1069}, + {"latitudeSexagesimal",1071}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"Ly",151}, {""}, {""}, - {"upperLimit",2248}, + {"upperLimit",2254}, {""}, {""}, {""}, {""}, - {"clearTables",421}, + {"clearTables",423}, {""}, - {"integerScalingFactorAppliedToDirections",976}, - {"integerScalingFactorAppliedToFrequencies",977}, + {"integerScalingFactorAppliedToDirections",978}, + {"integerScalingFactorAppliedToFrequencies",979}, {""}, - {"offsetSection0",1483}, + {"offsetSection0",1486}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"clusterNumber",536}, - {"expandedTypes",775}, - {"typeOfStatisticalPostProcessingOfEnsembleMembers",2206}, - {"latitudeOfCentrePointInDegrees",1048}, + {"clusterNumber",538}, + {"expandedTypes",777}, + {"typeOfStatisticalPostProcessingOfEnsembleMembers",2211}, + {"latitudeOfCentrePointInDegrees",1050}, {"auxiliary",315}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"Lcy",120}, {""}, {""}, - {"numberOfFloats",1378}, + {"numberOfFloats",1381}, {""}, {""}, - {"channelNumber",415}, + {"channelNumber",417}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"referenceStep",1754}, + {"referenceStep",1758}, {""}, {""}, {"Luy",147}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"listOfScaledFrequencies",1112}, + {"listOfScaledFrequencies",1114}, {""}, {""}, {""}, {"atmosphericChemicalOrPhysicalConstituentType",313}, {""}, {""}, {""}, - {"integerScaleFactor",975}, + {"integerScaleFactor",977}, {""}, {""}, {""}, {""}, {"boustrophedonic",369}, - {"truncateLaplacian",2174}, + {"truncateLaplacian",2179}, {""}, {""}, {""}, {""}, - {"localDefinition",1119}, + {"localDefinition",1121}, {""}, - {"overlayTemplateNumber",1531}, + {"overlayTemplateNumber",1534}, {""}, {""}, {""}, {""}, {""}, {""}, - {"computeStatistics",555}, + {"computeStatistics",557}, {""}, {""}, {""}, {""}, {""}, - {"gridDefinition",897}, + {"gridDefinition",899}, {""}, {""}, {""}, {""}, - {"modelIdentifier",1286}, + {"modelIdentifier",1288}, {""}, {""}, {""}, {""}, - {"offsetSection8",1493}, + {"offsetSection8",1496}, {""}, {""}, {""}, {""}, {""}, - {"referenceOfLengths",1750}, + {"referenceOfLengths",1754}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfDirections",1368}, + {"numberOfDirections",1371}, {""}, {""}, {""}, - {"typeOfStatisticalProcessing",2207}, + {"typeOfStatisticalProcessing",2212}, {""}, {""}, {""}, - {"indexingTime",958}, + {"indexingTime",960}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"faFieldName",827}, + {"faFieldName",829}, {"Nf",193}, {""}, - {"defaultName",656}, - {"secondOfForecast",1907}, + {"defaultName",658}, + {"secondOfForecast",1911}, {""}, {""}, - {"minuteOfForecast",1271}, - {"numberOfDiamonds",1367}, + {"minuteOfForecast",1273}, + {"numberOfDiamonds",1370}, {""}, {""}, - {"scaledDirections",1867}, + {"scaledDirections",1871}, {""}, {""}, - {"numberOfTimeSteps",1438}, + {"numberOfTimeSteps",1441}, {""}, {""}, {""}, {""}, {""}, - {"climateDateFrom",422}, + {"climateDateFrom",424}, {""}, {""}, {""}, - {"setLocalDefinition",1998}, + {"setLocalDefinition",2002}, {""}, - {"numberingOrderOfDiamonds",1450}, + {"numberingOrderOfDiamonds",1453}, {"N",169}, {""}, {""}, - {"newSubtype",1314}, + {"newSubtype",1317}, {""}, {""}, {""}, {""}, {""}, {""}, {"ccccIdentifiers",383}, {""}, - {"levTypeName",1091}, + {"levTypeName",1093}, {""}, {""}, {"Adelta",13}, {""}, {""}, {""}, {""}, {""}, {""}, - {"subSetK",2090}, + {"subSetK",2095}, {""}, {""}, {""}, - {"modeNumber",1283}, - {"observedData",1457}, + {"modeNumber",1285}, + {"observedData",1460}, {""}, {""}, - {"rdbSubtype",1722}, + {"rdbSubtype",1726}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"marsLevel",1203}, + {"marsLevel",1205}, {""}, {""}, - {"isAuto",984}, + {"isAuto",986}, {""}, {""}, {"anoffsetFrequency",309}, {""}, {""}, {""}, {""}, - {"generatingProcessIdentifier",880}, + {"generatingProcessIdentifier",882}, {""}, {""}, {""}, {""}, - {"topLevel",2152}, + {"topLevel",2157}, {""}, {""}, {""}, - {"perturbedType",1638}, + {"perturbedType",1642}, {""}, {""}, - {"numberOfSubsets",1435}, - {"sequences",1994}, + {"numberOfSubsets",1438}, + {"sequences",1998}, {""}, - {"quantile",1711}, + {"quantile",1715}, {""}, {""}, {"TAFstr",230}, - {"gridDefinitionDescription",898}, + {"gridDefinitionDescription",900}, {""}, - {"siteLatitude",2014}, - {"representationType",1761}, + {"siteLatitude",2019}, + {"representationType",1765}, {""}, {""}, - {"marsLatitude",1202}, + {"marsLatitude",1204}, {""}, {""}, - {"dataLength",621}, + {"dataLength",623}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"instrumentIdentifier",972}, + {"instrumentIdentifier",974}, {""}, - {"lcwfvSuiteName",1075}, + {"lcwfvSuiteName",1077}, {"TAF",229}, {""}, {""}, - {"qnh",1704}, + {"qnh",1708}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"generatingProcessIdentificationNumber",879}, - {"latitudesList",1073}, + {"generatingProcessIdentificationNumber",881}, + {"latitudesList",1075}, {""}, - {"gridDefinitionSection",899}, + {"gridDefinitionSection",901}, {""}, {""}, {""}, {""}, {""}, {""}, - {"pressureLevel",1676}, + {"pressureLevel",1680}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"subcentreOfAnalysis",2092}, - {"crraSection",612}, - {"rectimeSecond",1743}, + {"subcentreOfAnalysis",2097}, + {"crraSection",614}, + {"rectimeSecond",1747}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"expoffset",781}, + {"expoffset",783}, {""}, {""}, - {"totalNumber",2157}, + {"totalNumber",2162}, {""}, {""}, {""}, - {"marsKeywords",1199}, + {"marsKeywords",1201}, {""}, {""}, {""}, {""}, {""}, - {"dataAccessors",616}, + {"dataAccessors",618}, {""}, {""}, {""}, {""}, {""}, {""}, {"DiInDegrees",33}, - {"indexTemplate",954}, + {"indexTemplate",956}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"dx",699}, + {"dx",701}, {""}, {"Dx",40}, - {"listOfDistributionFunctionParameter",1108}, + {"listOfDistributionFunctionParameter",1110}, {""}, {""}, {""}, - {"typeOfDistributionFunction",2187}, + {"typeOfDistributionFunction",2192}, {""}, {""}, {""}, - {"max",1231}, - {"zeros",2362}, + {"max",1233}, + {"zeros",2368}, {""}, - {"zero",2361}, + {"zero",2367}, {""}, - {"qfe",1701}, + {"qfe",1705}, {""}, {""}, {""}, {""}, - {"corr3Data",593}, + {"corr3Data",595}, {""}, {""}, {""}, {""}, {""}, {""}, - {"optimisationTime",1514}, - {"numberOfOperationalForecastTube",1404}, + {"optimisationTime",1517}, + {"numberOfOperationalForecastTube",1407}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"defaultStepUnits",660}, - {"satelliteIdentifier",1841}, + {"defaultStepUnits",662}, + {"satelliteIdentifier",1845}, {""}, {""}, - {"lowerLimit",1178}, + {"lowerLimit",1180}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"defaultFaFieldName",653}, - {"stretchingFactor",2077}, - {"endOfInterval",741}, + {"defaultFaFieldName",655}, + {"stretchingFactor",2082}, + {"endOfInterval",743}, {"DyInDegrees",44}, {""}, - {"numberOfFrequencies",1384}, - {"templatesLocalDir",2116}, + {"numberOfFrequencies",1387}, + {"templatesLocalDir",2121}, {""}, {""}, {""}, - {"meanSize",1254}, + {"meanSize",1256}, {""}, {""}, {"ccsdsRsi",387}, {""}, {""}, {""}, {"centreForLocal",399}, {""}, {""}, - {"systemNumber",2101}, - {"longitudeSexagesimal",1174}, + {"systemNumber",2106}, + {"longitudeSexagesimal",1176}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"localSection",1136}, + {"localSection",1138}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"secondDimension",1901}, - {"legNumber",1079}, - {"masterTableNumber",1221}, - {"methodNumber",1264}, + {"secondDimension",1905}, + {"legNumber",1081}, + {"masterTableNumber",1223}, + {"methodNumber",1266}, {""}, - {"groupSplitting",908}, - {"typicalSecond",2218}, + {"groupSplitting",910}, + {"typicalSecond",2223}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"expandedNames",770}, + {"expandedNames",772}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"corr4Data",594}, - {"datumSize",643}, + {"corr4Data",596}, + {"datumSize",645}, {""}, - {"indexingDate",957}, - {"stretchingFactorScaled",2078}, + {"indexingDate",959}, + {"stretchingFactorScaled",2083}, {""}, {""}, - {"longitudeOfCentrePointInDegrees",1150}, + {"longitudeOfCentrePointInDegrees",1152}, {""}, {""}, {""}, {""}, {""}, {""}, - {"timeDomainTemplate",2140}, + {"timeDomainTemplate",2145}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"partitionItems",1622}, - {"climateDateTo",423}, + {"partitionItems",1626}, + {"climateDateTo",425}, {""}, {""}, {""}, {""}, - {"xLast",2346}, + {"xLast",2352}, {""}, {""}, {""}, {""}, {""}, {""}, {"Nb",190}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"iteratorDisableUnrotate",1017}, + {"iteratorDisableUnrotate",1019}, {""}, - {"numberOfForcasts",1379}, - {"diffInDays",674}, - {"longitudinalDirectionGridLength",1177}, + {"numberOfForcasts",1382}, + {"diffInDays",676}, + {"longitudinalDirectionGridLength",1179}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"marsRange",1209}, + {"marsRange",1211}, {""}, - {"generatingProcessTemplateNumber",882}, + {"generatingProcessTemplateNumber",884}, {""}, {""}, - {"typeOfLevel",2196}, + {"typeOfLevel",2201}, {""}, {""}, {""}, {"bufrTemplate",374}, - {"secondOrderFlags",1909}, - {"yDirectionGridLength",2349}, - {"stepRange",2068}, - {"referenceSampleInterval",1753}, + {"secondOrderFlags",1913}, + {"yDirectionGridLength",2355}, + {"stepRange",2073}, + {"referenceSampleInterval",1757}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"heightLevelName",919}, + {"heightLevelName",921}, {""}, {""}, {""}, {""}, {""}, - {"createNewData",610}, - {"offsetFreeFormData",1479}, + {"createNewData",612}, + {"offsetFreeFormData",1482}, {""}, {""}, {""}, {""}, - {"typicalDateTime",2213}, - {"conceptsLocalDirAll",557}, + {"typicalDateTime",2218}, + {"conceptsLocalDirAll",559}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"sensitiveAreaDomain",1993}, + {"sensitiveAreaDomain",1997}, {""}, - {"localDefinitionNumber",1120}, + {"localDefinitionNumber",1122}, {""}, {""}, - {"diagnosticNumber",673}, + {"diagnosticNumber",675}, {""}, {""}, - {"distinctLatitudes",687}, + {"distinctLatitudes",689}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"periodOfTimeIntervals",1636}, + {"periodOfTimeIntervals",1640}, {""}, {""}, - {"forecastLeadTime",855}, + {"forecastLeadTime",857}, {""}, {""}, - {"orderOfSpatialDifferencing",1519}, + {"orderOfSpatialDifferencing",1522}, {""}, {"MS",156}, {""}, {""}, {""}, - {"missingDataFlag",1276}, + {"missingDataFlag",1278}, {""}, {""}, - {"matchLandType",1226}, + {"matchLandType",1228}, {""}, {""}, {""}, {""}, - {"correction1Part",597}, + {"correction1Part",599}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"upperRange",2249}, + {"upperRange",2255}, {""}, {""}, {""}, - {"molarMass",1290}, - {"productDefinition",1689}, + {"molarMass",1292}, + {"productDefinition",1693}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"frequency",868}, + {"frequency",870}, {""}, {""}, {""}, {"bottomLevel",368}, {""}, {""}, - {"tiggeSection",2132}, + {"tiggeSection",2137}, {""}, {""}, - {"isSatelliteType",999}, + {"isSatelliteType",1001}, {""}, - {"extractSubset",815}, + {"extractSubset",817}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"matchTimeRepres",1228}, + {"matchTimeRepres",1230}, {""}, {""}, {""}, {""}, - {"numberOfSection",1431}, + {"numberOfSection",1434}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"tubeNumber",2179}, + {"tubeNumber",2184}, {""}, - {"numberOfForecastsInTube",1383}, + {"numberOfForecastsInTube",1386}, {""}, - {"clusterSize",537}, + {"clusterSize",539}, {""}, {""}, {""}, - {"marsModel",1206}, + {"marsModel",1208}, {""}, - {"observablePropertyTemplate",1452}, + {"observablePropertyTemplate",1455}, {""}, - {"northernLatitudeOfDomain",1327}, + {"northernLatitudeOfDomain",1330}, {""}, {""}, {""}, {""}, {""}, {""}, - {"rdbtimeSecond",1731}, + {"rdbtimeSecond",1735}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"stepTypeInternal",2072}, + {"stepTypeInternal",2077}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"expandedDescriptors",769}, + {"expandedDescriptors",771}, {""}, - {"groupWidth",910}, + {"groupWidth",912}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"levelIndicator",1093}, - {"tableNumber",2105}, - {"simpleThinningSkip",2010}, - {"originatorLocalTemplate",1528}, + {"levelIndicator",1095}, + {"tableNumber",2110}, + {"simpleThinningSkip",2015}, + {"originatorLocalTemplate",1531}, {""}, {""}, - {"isEps",993}, + {"isEps",995}, {""}, - {"longitudeOfFirstGridPoint",1154}, - {"southernLatitudeOfDomain",2034}, + {"longitudeOfFirstGridPoint",1156}, + {"southernLatitudeOfDomain",2039}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"observablePropertyTemplateNumber",1453}, + {"observablePropertyTemplateNumber",1456}, {""}, {""}, {""}, - {"streamOfAnalysis",2076}, + {"streamOfAnalysis",2081}, {"binaryScaleFactor",360}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"verificationDate",2276}, + {"verificationDate",2282}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"NAT",172}, - {"oneMillionConstant",1500}, + {"oneMillionConstant",1503}, {""}, {""}, - {"marsLevelist",1204}, - {"memberNumber",1260}, + {"marsLevelist",1206}, + {"memberNumber",1262}, {""}, - {"widthOfFirstOrderValues",2309}, + {"widthOfFirstOrderValues",2315}, {""}, {""}, {""}, {""}, {""}, {""}, - {"endOfRange",744}, + {"endOfRange",746}, {""}, {""}, {""}, {""}, {""}, {"FirstLatitude",68}, {""}, {""}, - {"verticalDomainTemplateNumber",2291}, + {"verticalDomainTemplateNumber",2297}, {""}, {""}, - {"ensembleForecastNumbers",754}, + {"ensembleForecastNumbers",756}, {"baseAddress",325}, - {"minuteOfAnalysis",1269}, + {"minuteOfAnalysis",1271}, {""}, {""}, - {"defaultShortName",659}, + {"defaultShortName",661}, {""}, {""}, {""}, - {"oceanLevName",1460}, + {"oceanLevName",1463}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"iterationNumber",1016}, + {"iterationNumber",1018}, {""}, - {"dimensionNumber",677}, + {"dimensionNumber",679}, {""}, {""}, {""}, {""}, - {"marsEndStep",1193}, + {"marsEndStep",1195}, {""}, {""}, {""}, - {"parameterNumber",1618}, - {"groupWidths",911}, + {"parameterNumber",1622}, + {"groupWidths",913}, {""}, {""}, {""}, - {"partitionNumber",1623}, + {"partitionNumber",1627}, {""}, - {"theMessage",2119}, - {"clusterMember9",535}, + {"theMessage",2124}, + {"clusterMember9",537}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"addressOfFileFreeSpaceInfo",294}, {""}, {""}, {""}, {"attributeOfTile",314}, {""}, - {"horizontalCoordinateSupplement",924}, + {"horizontalCoordinateSupplement",926}, {""}, {""}, {""}, {""}, {""}, - {"directionNumber",680}, + {"directionNumber",682}, {""}, {""}, {""}, {""}, - {"optimizeScaleFactor",1515}, + {"optimizeScaleFactor",1518}, {""}, - {"thisMarsStream",2122}, - {"instrumentType",973}, - {"localMinute",1132}, + {"thisMarsStream",2127}, + {"instrumentType",975}, + {"localMinute",1134}, {""}, {""}, {""}, {""}, {""}, {""}, - {"thisMarsType",2123}, - {"numberOfIterations",1392}, + {"thisMarsType",2128}, + {"numberOfIterations",1395}, {""}, {""}, - {"secondDimensionPhysicalSignificance",1903}, + {"secondDimensionPhysicalSignificance",1907}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"constituentType",567}, + {"constituentType",569}, {""}, {""}, {""}, {"Nx",201}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"dayOfAnalysis",645}, - {"localMonth",1133}, + {"dayOfAnalysis",647}, + {"localMonth",1135}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"localLatitude",1126}, + {"localLatitude",1128}, {""}, {""}, {""}, {""}, - {"isAccumulation",983}, + {"isAccumulation",985}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"satelliteNumber",1842}, - {"earthMinorAxis",704}, + {"satelliteNumber",1846}, + {"earthMinorAxis",706}, {""}, {""}, {""}, - {"minutesAfterDataCutoff",1274}, + {"minutesAfterDataCutoff",1276}, {""}, {""}, {""}, {""}, {""}, {"Ncx",191}, {""}, {""}, - {"clutterFilterIndicator",540}, + {"clutterFilterIndicator",542}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"earthIsOblate",701}, + {"earthIsOblate",703}, {""}, {""}, - {"siteLongitude",2015}, + {"siteLongitude",2020}, {"Nux",199}, {""}, {"DxInDegrees",41}, - {"marsLongitude",1205}, + {"marsLongitude",1207}, {""}, {""}, {""}, {""}, - {"powerOfTenUsedToScaleClimateWeight",1649}, + {"powerOfTenUsedToScaleClimateWeight",1653}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"angleMultiplier",302}, {""}, {""}, {""}, {""}, {""}, - {"spectralMode",2046}, + {"spectralMode",2051}, {""}, - {"multiplicationFactorForLatLong",1301}, + {"multiplicationFactorForLatLong",1303}, {""}, {""}, - {"indexTemplateNumber",955}, + {"indexTemplateNumber",957}, {""}, {""}, - {"marsParam",1207}, + {"marsParam",1209}, {"SPD",222}, {""}, - {"userDateTimeEnd",2254}, - {"operatingMode",1512}, + {"userDateTimeEnd",2260}, + {"operatingMode",1515}, {""}, - {"radialAngularSpacing",1712}, + {"radialAngularSpacing",1716}, {""}, {""}, - {"globalDomain",886}, + {"globalDomain",888}, {""}, - {"epsPoint",760}, + {"epsPoint",762}, {""}, - {"userDateEnd",2252}, + {"userDateEnd",2258}, {""}, {""}, {""}, {""}, {""}, - {"firstLatitude",842}, + {"firstLatitude",844}, {"biFourierTruncationType",359}, {""}, {""}, {""}, {""}, {""}, - {"horizontalCoordinateDefinition",923}, - {"secondLatitude",1904}, - {"unitOfOffsetFromReferenceTime",2227}, + {"horizontalCoordinateDefinition",925}, + {"secondLatitude",1908}, + {"unitOfOffsetFromReferenceTime",2232}, {""}, {""}, {""}, {""}, - {"lowerRange",1179}, + {"lowerRange",1181}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"realPart",1734}, + {"realPart",1738}, {""}, {""}, {""}, {""}, {"ITN",93}, {""}, {""}, {""}, {""}, {"anoffsetLast",310}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"spectralDataRepresentationMode",2044}, - {"minuteOfReference",1273}, + {"spectralDataRepresentationMode",2049}, + {"minuteOfReference",1275}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"unitsOfFirstFixedSurface",2238}, + {"unitsOfFirstFixedSurface",2244}, {""}, - {"faLevelName",828}, + {"faLevelName",830}, {""}, {""}, - {"numberOfLocalDefinitions",1393}, + {"numberOfLocalDefinitions",1396}, {""}, - {"iDirectionIncrement",937}, + {"iDirectionIncrement",939}, {"SecondLatitude",223}, - {"userTimeEnd",2256}, + {"userTimeEnd",2262}, {""}, - {"numberOfDistinctSection9s",1375}, + {"numberOfDistinctSection9s",1378}, {""}, - {"roundedMarsLevelist",1784}, - {"scaleFactorOfFirstSize",1851}, - {"tiggeModel",2131}, - {"dateOfReference",639}, + {"roundedMarsLevelist",1788}, + {"scaleFactorOfFirstSize",1855}, + {"tiggeModel",2136}, + {"dateOfReference",641}, {""}, {""}, {""}, {""}, {""}, {""}, - {"siteElevation",2012}, + {"siteElevation",2017}, {""}, - {"timeOfReference",2147}, + {"timeOfReference",2152}, {""}, - {"timeIncrement",2142}, - {"clusterMember8",534}, - {"scanningMode",1892}, + {"timeIncrement",2147}, + {"clusterMember8",536}, + {"scanningMode",1896}, {""}, {""}, - {"unitsOfSecondFixedSurface",2239}, + {"unitsOfSecondFixedSurface",2245}, {""}, {""}, {""}, {""}, - {"monthOfAnalysis",1292}, + {"monthOfAnalysis",1294}, {""}, - {"representationMode",1760}, + {"representationMode",1764}, {""}, {""}, {""}, - {"classOfAnalysis",420}, - {"xDirectionGridLength",2342}, + {"classOfAnalysis",422}, + {"xDirectionGridLength",2348}, {""}, {""}, {""}, {""}, - {"spectralDataRepresentationType",2045}, + {"spectralDataRepresentationType",2050}, {""}, - {"unsignedIntegers",2245}, + {"unsignedIntegers",2251}, {""}, - {"treatmentOfMissingData",2170}, + {"treatmentOfMissingData",2175}, {"Lx",149}, {""}, {""}, {""}, {""}, {""}, - {"timeDomainTemplateNumber",2141}, + {"timeDomainTemplateNumber",2146}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"defaultFaLevelName",654}, + {"defaultFaLevelName",656}, {""}, - {"extractAreaWestLongitude",794}, + {"extractAreaWestLongitude",796}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"extractDateTimeYearStart",814}, - {"simpleThinningStart",2011}, + {"extractDateTimeYearStart",816}, + {"simpleThinningStart",2016}, {"angleSubdivisions",306}, - {"roundedMarsLongitude",1785}, + {"roundedMarsLongitude",1789}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"identificationNumber",945}, + {"identificationNumber",947}, {""}, - {"yearOfReference",2360}, + {"yearOfReference",2366}, {""}, {"Lcx",118}, {"NL",182}, {""}, {""}, - {"postAuxiliary",1647}, + {"postAuxiliary",1651}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"ensembleStandardDeviation",757}, - {"observationGeneratingProcessIdentifier",1455}, + {"ensembleStandardDeviation",759}, + {"observationGeneratingProcessIdentifier",1458}, {""}, {"Lux",145}, - {"endOfFileAddress",739}, + {"endOfFileAddress",741}, {""}, {""}, - {"offsetAfterLocalSection",1467}, + {"offsetAfterLocalSection",1470}, {""}, {""}, {""}, {""}, {"calendarIdPresent",376}, {""}, {"LaDInDegrees",106}, {""}, {""}, {""}, - {"scaleFactorOfStandardDeviation",1863}, - {"scaledFrequencies",1868}, - {"scalingFactorForFrequencies",1890}, + {"scaleFactorOfStandardDeviation",1867}, + {"scaledFrequencies",1872}, + {"scalingFactorForFrequencies",1894}, {""}, {""}, - {"numberOfDistinctSection8s",1374}, + {"numberOfDistinctSection8s",1377}, {""}, {""}, - {"computeLaplacianOperator",554}, + {"computeLaplacianOperator",556}, {""}, {""}, - {"normAtInitialTime",1318}, - {"extractedDateTimeNumberOfSubsets",820}, - {"northLatitudeOfCluster",1320}, + {"normAtInitialTime",1321}, + {"extractedDateTimeNumberOfSubsets",822}, + {"northLatitudeOfCluster",1323}, {""}, {""}, {""}, {""}, {""}, - {"scaleFactorOfStandardDeviationInTheCluster",1864}, + {"scaleFactorOfStandardDeviationInTheCluster",1868}, {""}, {""}, {""}, - {"scaleFactorOfFirstFixedSurface",1850}, + {"scaleFactorOfFirstFixedSurface",1854}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"dateOfAnalysis",634}, + {"dateOfAnalysis",636}, {""}, {""}, {""}, - {"tablesMasterDir",2108}, + {"tablesMasterDir",2113}, {""}, {""}, {""}, {""}, - {"timeOfAnalysis",2144}, + {"timeOfAnalysis",2149}, {""}, {"biFourierMakeTemplate",352}, {""}, {""}, - {"startOfMessage",2054}, + {"startOfMessage",2059}, {""}, {""}, {""}, - {"ifsParam",950}, - {"productDefinitionTemplateNumber",1690}, + {"ifsParam",952}, + {"productDefinitionTemplateNumber",1694}, {""}, - {"corr2Data",592}, - {"tileIndex",2137}, + {"corr2Data",594}, + {"tileIndex",2142}, {""}, - {"hourOfReference",933}, - {"numberOfAnalysis",1338}, + {"hourOfReference",935}, + {"numberOfAnalysis",1341}, {""}, {""}, - {"standardParallelInDegrees",2051}, + {"standardParallelInDegrees",2056}, {""}, {""}, - {"pvlLocation",1700}, - {"climatologicalRegime",424}, + {"pvlLocation",1704}, + {"climatologicalRegime",426}, {""}, {""}, - {"dataValues",632}, + {"dataValues",634}, {""}, {""}, - {"localDefNumberOne",1117}, + {"localDefNumberOne",1119}, {""}, {""}, - {"southLatitudeOfCluster",2030}, - {"indicatorOfUnitOfTimeRange",963}, + {"southLatitudeOfCluster",2035}, + {"indicatorOfUnitOfTimeRange",965}, {""}, {""}, - {"standardParallel",2050}, + {"standardParallel",2055}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"roundedMarsLatitude",1783}, - {"monthOfReference",1296}, + {"roundedMarsLatitude",1787}, + {"monthOfReference",1298}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"scaleFactorOfSecondSize",1861}, + {"scaleFactorOfSecondSize",1865}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"yearOfAnalysis",2355}, + {"yearOfAnalysis",2361}, {""}, {""}, {""}, - {"productDefinitionTemplateNumberInternal",1691}, + {"productDefinitionTemplateNumberInternal",1695}, {""}, - {"grib3divider",891}, - {"numberOfInts",1391}, + {"grib3divider",893}, + {"numberOfInts",1394}, {""}, - {"perturbationNumber",1637}, + {"perturbationNumber",1641}, {""}, - {"eastLongitudeOfCluster",706}, + {"eastLongitudeOfCluster",708}, {""}, - {"typeOfAnalysis",2183}, + {"typeOfAnalysis",2188}, {""}, {""}, {""}, - {"inputDelayedDescriptorReplicationFactor",965}, + {"inputDelayedDescriptorReplicationFactor",967}, {"angleOfRotation",303}, {""}, {""}, {""}, - {"orderOfSPD",1518}, + {"orderOfSPD",1521}, {""}, {""}, - {"iScansNegatively",942}, + {"iScansNegatively",944}, {""}, - {"typeOfEnsembleForecast",2188}, + {"typeOfEnsembleForecast",2193}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"temperatureAndDewpointPresent",2115}, + {"temperatureAndDewpointPresent",2120}, {""}, {""}, {""}, {""}, {""}, {""}, {"DiInMetres",34}, {""}, {""}, {"Azi",15}, {""}, - {"scanningMode8",1897}, + {"scanningMode8",1901}, {""}, {""}, - {"localLongitude",1129}, + {"localLongitude",1131}, {""}, - {"offsetAfterPadding",1468}, + {"offsetAfterPadding",1471}, {""}, {""}, {""}, - {"offsetAfterCentreLocalSection",1465}, + {"offsetAfterCentreLocalSection",1468}, {""}, {""}, {""}, {""}, {""}, - {"defaultSequence",658}, + {"defaultSequence",660}, {""}, {""}, - {"conceptsMasterDir",560}, + {"conceptsMasterDir",562}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"corr1Data",591}, + {"corr1Data",593}, {""}, - {"originatorLocalTemplateNumber",1529}, + {"originatorLocalTemplateNumber",1532}, {""}, - {"neitherPresent",1313}, + {"neitherPresent",1316}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"representativeMember",1762}, + {"representativeMember",1766}, {""}, {""}, - {"hourOfAnalysis",929}, + {"hourOfAnalysis",931}, {""}, - {"unitOfTimeIncrement",2229}, + {"unitOfTimeIncrement",2234}, {""}, - {"charValues",417}, - {"normAtFinalTime",1317}, + {"charValues",419}, + {"normAtFinalTime",1320}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"extractDateTimeHourStart",801}, + {"extractDateTimeHourStart",803}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"DyInMetres",45}, {""}, {""}, - {"gridDefinitionTemplateNumber",900}, + {"gridDefinitionTemplateNumber",902}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"typeOfTimeIncrement",2208}, + {"typeOfTimeIncrement",2213}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"accumulationInterval",289}, - {"n3",1305}, - {"selectStepTemplateInstant",1991}, + {"n3",1307}, + {"selectStepTemplateInstant",1995}, {""}, - {"forecastPeriod",858}, - {"numberOfRadials",1424}, - {"probPoint",1682}, + {"forecastPeriod",860}, + {"numberOfRadials",1427}, + {"probPoint",1686}, {""}, {""}, {""}, {""}, {""}, {"II",89}, {""}, {""}, {""}, {""}, - {"latitudeWhereDxAndDyAreSpecified",1070}, - {"defaultParameter",657}, + {"latitudeWhereDxAndDyAreSpecified",1072}, + {"defaultParameter",659}, {""}, {""}, {""}, {""}, - {"truncateDegrees",2173}, + {"truncateDegrees",2178}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"sp3",2037}, - {"latitudeWhereDxAndDyAreSpecifiedInDegrees",1071}, + {"sp3",2042}, + {"latitudeWhereDxAndDyAreSpecifiedInDegrees",1073}, {""}, {""}, {""}, {""}, {""}, {""}, {"calendarIdentification",377}, {""}, {""}, - {"internalVersion",979}, + {"internalVersion",981}, {""}, {""}, - {"epsStatisticsPoint",762}, + {"epsStatisticsPoint",764}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"marsLamModel",1201}, + {"marsLamModel",1203}, {""}, - {"isHindcast",995}, + {"isHindcast",997}, {""}, {""}, - {"codedValues",547}, + {"codedValues",549}, {""}, {""}, - {"versionNumOfFilesFreeSpaceStorage",2281}, + {"versionNumOfFilesFreeSpaceStorage",2287}, {""}, {""}, {""}, {""}, {""}, {"applicationIdentifier",311}, {""}, {""}, - {"faModelName",829}, + {"faModelName",831}, {""}, - {"originalParameterNumber",1523}, + {"originalParameterNumber",1526}, {""}, {""}, - {"longitudeOfLastGridPoint",1157}, + {"longitudeOfLastGridPoint",1159}, {""}, {""}, {""}, - {"julianDay",1025}, + {"julianDay",1027}, {""}, {""}, {""}, {""}, - {"localDefNumberTwo",1118}, - {"lengthIncrementForTheGroupLengths",1082}, + {"localDefNumberTwo",1120}, + {"lengthIncrementForTheGroupLengths",1084}, {""}, {""}, {""}, {""}, - {"referenceValue",1755}, - {"dataRepresentation",623}, - {"forecastPeriodTo",860}, + {"referenceValue",1759}, + {"dataRepresentation",625}, + {"forecastPeriodTo",862}, {""}, {""}, {""}, {""}, - {"latitudeLastInDegrees",1044}, + {"latitudeLastInDegrees",1046}, {""}, - {"internationalDataSubCategory",980}, + {"internationalDataSubCategory",982}, {""}, {""}, {""}, {""}, - {"indicatorOfUnitForTimeIncrement",961}, - {"expandedAbbreviations",764}, + {"indicatorOfUnitForTimeIncrement",963}, + {"expandedAbbreviations",766}, {""}, {""}, - {"g2grid",875}, - {"longitudeOfFirstGridPointInDegrees",1155}, + {"g2grid",877}, + {"longitudeOfFirstGridPointInDegrees",1157}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"changeDecimalPrecision",408}, - {"sectionPosition",1971}, - {"marsExperimentOffset",1194}, + {"changeDecimalPrecision",410}, + {"sectionPosition",1975}, + {"marsExperimentOffset",1196}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"forecastPeriodFrom",859}, - {"lengthOfIndexTemplate",1085}, - {"floatVal",853}, + {"forecastPeriodFrom",861}, + {"lengthOfIndexTemplate",1087}, + {"floatVal",855}, {""}, {""}, {""}, {""}, - {"startStepInHours",2057}, - {"ensembleForecastNumbersList",755}, + {"startStepInHours",2062}, + {"ensembleForecastNumbersList",757}, {""}, {""}, {""}, {""}, - {"dateOfForecastRun",636}, + {"dateOfForecastRun",638}, {""}, {""}, {""}, - {"falseNorthing",832}, + {"falseNorthing",834}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"deleteExtraLocalSection",667}, - {"marsExpver",1195}, + {"deleteExtraLocalSection",669}, + {"marsExpver",1197}, {""}, {""}, {""}, {""}, {"calendarIdentificationTemplateNumber",378}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfIntegers",1390}, + {"numberOfIntegers",1393}, {""}, {""}, {""}, {""}, - {"extractSubsetList",818}, + {"extractSubsetList",820}, {""}, {""}, {""}, - {"originatingCentre",1526}, + {"originatingCentre",1529}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"WMO",259}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"scaleFactorOfDistributionFunctionParameter",1847}, - {"parameterIndicator",1616}, - {"numberInTheAuxiliaryArray",1334}, - {"correction3Part",601}, + {"scaleFactorOfDistributionFunctionParameter",1851}, + {"parameterIndicator",1620}, + {"numberInTheAuxiliaryArray",1337}, + {"correction3Part",603}, {""}, {""}, - {"rectimeMinute",1742}, + {"rectimeMinute",1746}, {""}, - {"rectimeHour",1741}, + {"rectimeHour",1745}, {""}, {""}, {""}, - {"nameOfSecondFixedSurface",1310}, + {"nameOfSecondFixedSurface",1313}, {""}, {""}, {"boustrophedonicOrdering",370}, {""}, {""}, {""}, - {"driverInformationBlockAddress",694}, + {"driverInformationBlockAddress",696}, {""}, {""}, {""}, {""}, {""}, {""}, - {"scaleFactorOfSecondFixedSurface",1860}, + {"scaleFactorOfSecondFixedSurface",1864}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"significanceOfReferenceTime",2008}, + {"significanceOfReferenceTime",2013}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"dataRepresentationType",626}, - {"inputDataPresentIndicator",964}, - {"sizeOfOffsets",2017}, - {"longitudeFirstInDegrees",1146}, + {"dataRepresentationType",628}, + {"inputDataPresentIndicator",966}, + {"sizeOfOffsets",2022}, + {"longitudeFirstInDegrees",1148}, {""}, {""}, {""}, {""}, - {"numberInTheGridCoordinateList",1335}, + {"numberInTheGridCoordinateList",1338}, {""}, {""}, - {"numberOfModels",1401}, + {"numberOfModels",1404}, {""}, - {"reserved3",1766}, + {"reserved3",1770}, {""}, - {"dataRepresentationTemplate",624}, + {"dataRepresentationTemplate",626}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfDistributionFunctionParameters",1376}, - {"localHour",1125}, + {"numberOfDistributionFunctionParameters",1379}, + {"localHour",1127}, {""}, - {"tablesVersion",2109}, + {"tablesVersion",2114}, {""}, - {"westLongitudeOfCluster",2305}, + {"westLongitudeOfCluster",2311}, {""}, {"bitmapSectionPresent",364}, {""}, {""}, {""}, {""}, {""}, - {"secondsOfAnalysis",1920}, - {"typeOfIntervalForFirstAndSecondSize",2194}, + {"secondsOfAnalysis",1924}, + {"typeOfIntervalForFirstAndSecondSize",2199}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"biFourierSubTruncationType",358}, {""}, - {"section4",1944}, + {"section4",1948}, {""}, {""}, {""}, - {"typeOfSecondFixedSurface",2204}, + {"typeOfSecondFixedSurface",2209}, {""}, {""}, - {"groupLeafNodeK",906}, + {"groupLeafNodeK",908}, {""}, {""}, - {"stringValues",2079}, + {"stringValues",2084}, {""}, {"averagingPeriod",319}, {""}, {""}, {""}, - {"coordinate1Flag",575}, - {"clusteringMethod",539}, + {"coordinate1Flag",577}, + {"clusteringMethod",541}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"bufrDataEncoded",371}, {""}, - {"dataRepresentationTemplateNumber",625}, + {"dataRepresentationTemplateNumber",627}, {""}, - {"lengthOfMessage",1086}, + {"lengthOfMessage",1088}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"selectStepTemplateInterval",1992}, + {"selectStepTemplateInterval",1996}, {""}, {""}, {""}, {""}, - {"groupSplittingMethodUsed",909}, - {"floatValues",854}, - {"typicalMinute",2216}, + {"groupSplittingMethodUsed",911}, + {"floatValues",856}, + {"typicalMinute",2221}, {""}, - {"typicalHour",2215}, + {"typicalHour",2220}, {""}, - {"widthOfSPD",2311}, + {"widthOfSPD",2317}, {""}, {""}, - {"directionScalingFactor",682}, + {"directionScalingFactor",684}, {""}, {""}, {""}, {""}, - {"constantFieldHalfByte",566}, - {"secondsOfReference",1921}, - {"windPresent",2323}, + {"constantFieldHalfByte",568}, + {"secondsOfReference",1925}, + {"windPresent",2329}, {""}, {""}, {""}, - {"defaultFaModelName",655}, + {"defaultFaModelName",657}, {""}, {""}, - {"marsForecastMonth",1196}, + {"marsForecastMonth",1198}, {""}, {""}, {""}, {""}, - {"nameOfFirstFixedSurface",1309}, + {"nameOfFirstFixedSurface",1312}, {""}, {""}, {""}, {""}, - {"numberOfDataMatrices",1362}, + {"numberOfDataMatrices",1365}, {""}, - {"typeOfIntervalForFirstAndSecondWavelength",2195}, + {"typeOfIntervalForFirstAndSecondWavelength",2200}, {""}, - {"julianForecastDay",1026}, + {"julianForecastDay",1028}, {""}, {""}, - {"isConstant",990}, + {"isConstant",992}, {""}, {""}, {""}, {""}, - {"numberOfReservedBytes",1428}, + {"numberOfReservedBytes",1431}, {""}, {""}, {""}, {""}, {""}, {"centuryOfAnalysis",401}, {""}, {"aerosolbinnumber",296}, {""}, {""}, {""}, {""}, {""}, {""}, - {"totalNumberOfdimensions",2169}, + {"totalNumberOfdimensions",2174}, {""}, {""}, {"CDFstr",23}, {""}, - {"probabilityType",1684}, + {"probabilityType",1688}, {""}, {""}, {""}, - {"sphericalHarmonics",2048}, + {"sphericalHarmonics",2053}, {""}, {""}, - {"productIdentifier",1692}, + {"productIdentifier",1696}, {""}, {""}, {""}, {""}, {""}, - {"listMembersUsed",1103}, + {"listMembersUsed",1105}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"CDF",22}, {""}, {""}, {""}, {""}, {""}, - {"lengthOfProjectLocalTemplate",1088}, - {"thresholdIndicator",2127}, + {"lengthOfProjectLocalTemplate",1090}, + {"thresholdIndicator",2132}, {""}, {""}, - {"totalNumberOfDirections",2160}, + {"totalNumberOfDirections",2165}, {""}, - {"meaningOfVerticalCoordinate",1259}, + {"meaningOfVerticalCoordinate",1261}, {""}, {""}, {""}, - {"inputExtendedDelayedDescriptorReplicationFactor",966}, - {"changingPrecision",413}, - {"radiusInMetres",1715}, + {"inputExtendedDelayedDescriptorReplicationFactor",968}, + {"changingPrecision",415}, + {"radiusInMetres",1719}, {""}, - {"marsClass",1188}, + {"marsClass",1190}, {"M",153}, {""}, {""}, {""}, - {"clusterIdentifier",525}, + {"clusterIdentifier",527}, {""}, {""}, - {"probabilityTypeName",1685}, + {"probabilityTypeName",1689}, {""}, - {"yDirectionGridLengthInMetres",2350}, + {"yDirectionGridLengthInMetres",2356}, {""}, {""}, - {"typeOfFirstFixedSurface",2190}, - {"typeOfHorizontalLine",2193}, + {"typeOfFirstFixedSurface",2195}, + {"typeOfHorizontalLine",2198}, {""}, {""}, {""}, - {"orientationOfTheGrid",1520}, + {"orientationOfTheGrid",1523}, {""}, {""}, {""}, {"centuryOfReference",402}, {""}, {""}, - {"indicatorOfTypeOfLevel",960}, - {"totalNumberOfTubes",2167}, - {"laplacianScalingFactor",1037}, + {"indicatorOfTypeOfLevel",962}, + {"totalNumberOfTubes",2172}, + {"laplacianScalingFactor",1039}, {""}, {""}, - {"startingAzimuth",2059}, + {"startingAzimuth",2064}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"versionNumberOfGribLocalTables",2285}, + {"versionNumberOfGribLocalTables",2291}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"dewPointTemperature",671}, + {"dewPointTemperature",673}, {""}, {""}, {""}, {""}, {""}, - {"doExtractDateTime",690}, - {"monthlyVerificationDate",1297}, + {"doExtractDateTime",692}, + {"monthlyVerificationDate",1299}, {""}, {""}, {""}, {""}, {""}, - {"conceptsLocalDirECMF",558}, + {"conceptsLocalDirECMF",560}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"DxInMetres",42}, {""}, {""}, {""}, - {"totalNumberOfFrequencies",2162}, + {"totalNumberOfFrequencies",2167}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cfVarName",406}, + {"cfVarName",407}, {""}, {""}, {""}, {""}, - {"extraDimensionPresent",785}, + {"extraDimensionPresent",787}, {""}, {""}, - {"conceptsLocalMarsDirAll",559}, + {"conceptsLocalMarsDirAll",561}, {""}, {""}, - {"endOfProduct",743}, + {"endOfProduct",745}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"projectionCenterFlag",1697}, + {"projectionCenterFlag",1701}, {""}, - {"secondOrderOfDifferentWidth",1910}, + {"secondOrderOfDifferentWidth",1914}, {""}, {""}, - {"monthlyVerificationTime",1299}, - {"libraryVersion",1098}, + {"monthlyVerificationTime",1301}, + {"libraryVersion",1100}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"predefined_grid",1654}, + {"predefined_grid",1658}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfModeOfDistribution",1400}, + {"numberOfModeOfDistribution",1403}, {""}, {""}, - {"yDirectionGridLengthInMillimetres",2351}, + {"yDirectionGridLengthInMillimetres",2357}, {"NR",184}, {""}, {""}, {""}, {""}, - {"longitudeOfStretchingPole",1165}, - {"projectionCentreFlag",1698}, - {"unitsBias",2232}, + {"longitudeOfStretchingPole",1167}, + {"projectionCentreFlag",1702}, + {"unitsBias",2237}, {""}, {""}, {""}, {""}, - {"rdbtimeMinute",1729}, + {"rdbtimeMinute",1733}, {""}, - {"rdbtimeHour",1728}, - {"numericValues",1451}, + {"rdbtimeHour",1732}, + {"numericValues",1454}, {""}, {""}, {""}, {""}, {""}, - {"observationType",1456}, + {"observationType",1459}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"scanPosition",1891}, - {"startOfHeaders",2053}, - {"expandedOriginalWidths",774}, + {"scanPosition",1895}, + {"startOfHeaders",2058}, + {"expandedOriginalWidths",776}, {""}, {""}, - {"expandedOriginalCodes",771}, + {"expandedOriginalCodes",773}, {""}, {""}, - {"parameterCode",1614}, + {"parameterCode",1618}, {""}, {""}, {""}, {""}, {""}, - {"distanceFromTubeToEnsembleMean",686}, + {"distanceFromTubeToEnsembleMean",688}, {"XR",266}, {""}, {""}, - {"qnhPresent",1706}, + {"qnhPresent",1710}, {""}, {""}, {""}, - {"extractSubsetIntervalEnd",816}, + {"extractSubsetIntervalEnd",818}, {""}, {""}, {""}, {"bitMapIndicator",361}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"extraValues",788}, - {"numberOfEffectiveValues",1377}, + {"extraValues",790}, + {"numberOfEffectiveValues",1380}, {""}, {""}, {""}, - {"extractSubsetIntervalStart",817}, - {"dayOfReference",649}, + {"extractSubsetIntervalStart",819}, + {"dayOfReference",651}, {""}, {""}, {""}, {""}, {""}, {""}, - {"indicatorOfUnitForTimeRange",962}, + {"indicatorOfUnitForTimeRange",964}, {""}, {""}, - {"iDirectionIncrementInDegrees",940}, - {"jIncrement",1022}, + {"iDirectionIncrementInDegrees",942}, + {"jIncrement",1024}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfMissing",1397}, + {"numberOfMissing",1400}, {""}, {""}, {""}, {""}, {""}, - {"coordinateIndexNumber",588}, + {"coordinateIndexNumber",590}, {""}, - {"expandedOriginalScales",773}, + {"expandedOriginalScales",775}, {""}, {""}, {""}, {""}, - {"listOfModelIdentifiers",1110}, + {"listOfModelIdentifiers",1112}, {""}, - {"defaultTypeOfLevel",661}, + {"defaultTypeOfLevel",663}, {""}, {""}, {""}, - {"missingValue",1277}, + {"missingValue",1279}, {""}, {""}, - {"identificationOfProject",947}, + {"identificationOfProject",949}, {""}, - {"integerValues",978}, + {"integerValues",980}, {""}, {"azimuthalWidth",321}, - {"primaryBitmap",1678}, + {"primaryBitmap",1682}, {""}, {""}, {""}, - {"tileClassification",2136}, + {"tileClassification",2141}, {""}, {"additionalFlagPresent",293}, {""}, {""}, - {"orientationOfTheGridInDegrees",1521}, + {"orientationOfTheGridInDegrees",1524}, {""}, - {"typeOfPostProcessing",2200}, + {"typeOfPostProcessing",2205}, {""}, {""}, {"AA",6}, {""}, {""}, {""}, - {"section9Pointer",1966}, + {"section9Pointer",1970}, {""}, {""}, {""}, {""}, {""}, - {"mAngleMultiplier",1185}, + {"mAngleMultiplier",1187}, {""}, {""}, {""}, {""}, {""}, {""}, {"LyInMetres",152}, {""}, {""}, - {"numberOfRemaininChars",1426}, + {"numberOfRemaininChars",1429}, {""}, - {"grib2divider",890}, + {"grib2divider",892}, {""}, {""}, {""}, - {"is_uerra",1010}, + {"is_uerra",1012}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"_T",284}, - {"extractedAreaNumberOfSubsets",819}, + {"extractedAreaNumberOfSubsets",821}, {""}, {""}, {""}, {""}, {""}, - {"offsetSection10",1485}, + {"offsetSection10",1488}, {""}, - {"shapeOfTheEarth",2001}, + {"shapeOfTheEarth",2005}, {""}, - {"windSpeedTrend3",2327}, - {"windDirectionTrend3",2316}, + {"windSpeedTrend3",2333}, + {"windDirectionTrend3",2322}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"tsectionNumber3",2175}, + {"tsectionNumber3",2180}, {""}, {""}, - {"offsetSection3",1488}, - {"isectionNumber3",1012}, + {"offsetSection3",1491}, + {"isectionNumber3",1014}, {""}, {""}, {""}, - {"extendedFlag",783}, + {"extendedFlag",785}, {""}, - {"typeOfAuxiliaryInformation",2184}, + {"typeOfAuxiliaryInformation",2189}, {""}, {""}, {""}, - {"verticalCoordinate",2288}, + {"verticalCoordinate",2294}, {""}, {""}, {""}, {""}, {""}, {""}, - {"simpleThinningMissingRadius",2009}, - {"section0Pointer",1924}, + {"simpleThinningMissingRadius",2014}, + {"section0Pointer",1928}, {""}, {""}, {""}, {""}, - {"short_name",2005}, + {"short_name",2010}, {""}, - {"windVariableDirection",2334}, - {"frequencyNumber",869}, + {"windVariableDirection",2340}, + {"frequencyNumber",871}, {""}, {""}, {""}, - {"correction4Part",603}, - {"numberOfDistinctSection3s",1369}, + {"correction4Part",605}, + {"numberOfDistinctSection3s",1372}, {""}, {"LaR",107}, - {"qfePresent",1702}, + {"qfePresent",1706}, {""}, {""}, {"_TS",285}, {""}, - {"numberOfPartitions",1408}, - {"oneConstant",1499}, - {"tableReference",2106}, + {"numberOfPartitions",1411}, + {"oneConstant",1502}, + {"tableReference",2111}, {""}, {""}, - {"complexPacking",551}, + {"complexPacking",553}, {""}, {""}, - {"verticalCoordinateDefinition",2289}, + {"verticalCoordinateDefinition",2295}, {""}, - {"numberOfOctectsForNumberOfPoints",1402}, + {"numberOfOctectsForNumberOfPoints",1405}, {"LoR",126}, {""}, {""}, {""}, {""}, - {"section_09",1980}, + {"section_09",1984}, {""}, - {"targetCompressionRatio",2111}, + {"targetCompressionRatio",2116}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"centuryOfReferenceTimeOfData",403}, {""}, {""}, - {"cnmc_isac",542}, + {"cnmc_isac",544}, {""}, - {"section8Pointer",1963}, + {"section8Pointer",1967}, {""}, {""}, - {"numberOfMembersInCluster",1395}, + {"numberOfMembersInCluster",1398}, {""}, - {"longitudeOfIcosahedronPole",1156}, + {"longitudeOfIcosahedronPole",1158}, {""}, {""}, {""}, {""}, - {"is_aerosol",1001}, + {"is_aerosol",1003}, {""}, {""}, {""}, {""}, - {"projectLocalTemplate",1695}, + {"projectLocalTemplate",1699}, {""}, {""}, - {"interpretationOfNumberOfPoints",981}, + {"interpretationOfNumberOfPoints",983}, {""}, {""}, {""}, {""}, {""}, - {"tiggeCentre",2128}, - {"subCentre",2080}, + {"tiggeCentre",2133}, + {"subCentre",2085}, {""}, {""}, {""}, - {"grib1divider",887}, + {"grib1divider",889}, {""}, {""}, {""}, - {"lengthOfHeaders",1084}, + {"lengthOfHeaders",1086}, {""}, {""}, {""}, {""}, - {"tableCode",2104}, + {"tableCode",2109}, {"angleOfRotationInDegrees",304}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"easternLongitudeOfDomain",709}, + {"easternLongitudeOfDomain",711}, {""}, - {"legBaseDate",1077}, + {"legBaseDate",1079}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"groupInternalNodeK",905}, - {"longitudeOfLastGridPointInDegrees",1158}, - {"numberOfDistinctSection4s",1370}, + {"groupInternalNodeK",907}, + {"longitudeOfLastGridPointInDegrees",1160}, + {"numberOfDistinctSection4s",1373}, {""}, {""}, {""}, {""}, - {"doExtractSubsets",691}, + {"doExtractSubsets",693}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"modelVersionDate",1288}, + {"modelVersionDate",1290}, {""}, {""}, - {"cnmc_cmcc",541}, - {"local_use",1143}, + {"cnmc_cmcc",543}, + {"local_use",1145}, {""}, - {"verticalVisibility",2292}, + {"verticalVisibility",2298}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"is_efas",1005}, + {"is_efas",1007}, {""}, {""}, {""}, - {"latLonValues",1041}, - {"listOfEnsembleForecastNumbers",1109}, + {"latLonValues",1043}, + {"listOfEnsembleForecastNumbers",1111}, {""}, {""}, {""}, - {"is_chemical",1003}, + {"is_chemical",1005}, {""}, - {"expandedOriginalReferences",772}, + {"expandedOriginalReferences",774}, {""}, {"centralLongitude",394}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"legBaseTime",1078}, - {"windSpeedTrend4",2328}, - {"windDirectionTrend4",2317}, + {"legBaseTime",1080}, + {"windSpeedTrend4",2334}, + {"windDirectionTrend4",2323}, {""}, {""}, {""}, {""}, {""}, - {"reservedNeedNotBePresent",1767}, - {"totalNumberOfTileAttributePairs",2166}, - {"tsectionNumber4",2176}, + {"reservedNeedNotBePresent",1771}, + {"totalNumberOfTileAttributePairs",2171}, + {"tsectionNumber4",2181}, {"LcyInMetres",121}, {""}, - {"offsetSection4",1489}, - {"isectionNumber4",1013}, - {"scanningModeForOneDiamond",1898}, + {"offsetSection4",1492}, + {"isectionNumber4",1015}, + {"scanningModeForOneDiamond",1902}, {""}, - {"latitudeOfFirstGridPoint",1049}, - {"runwayDepositState3",1796}, + {"latitudeOfFirstGridPoint",1051}, + {"runwayDepositState3",1800}, {""}, - {"gts_header",915}, + {"gts_header",917}, {""}, - {"typeOfCompressionUsed",2186}, + {"typeOfCompressionUsed",2191}, {""}, - {"modelVersionTime",1289}, + {"modelVersionTime",1291}, {""}, {""}, {""}, {"LuyInMetres",148}, {""}, {""}, - {"totalNumberOfForecastProbabilities",2161}, + {"totalNumberOfForecastProbabilities",2166}, {""}, {""}, - {"section_8",1990}, + {"section_8",1994}, {""}, {""}, {"centralLongitudeInDegrees",395}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"iScansPositively",943}, + {"iScansPositively",945}, {""}, {""}, - {"halfByte",916}, + {"halfByte",918}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"xDirectionGridLengthInMetres",2343}, + {"xDirectionGridLengthInMetres",2349}, {""}, {""}, {""}, {""}, {""}, {""}, - {"decimalPrecision",651}, + {"decimalPrecision",653}, {""}, {""}, - {"numberOfOctetsExtraDescriptors",1403}, + {"numberOfOctetsExtraDescriptors",1406}, {""}, {"DjInDegrees",37}, {""}, {""}, - {"numberOfVerticalPoints",1449}, + {"numberOfVerticalPoints",1452}, {""}, - {"subSetM",2091}, - {"verifyingMonth",2279}, + {"subSetM",2096}, + {"verifyingMonth",2285}, {""}, {""}, {""}, {""}, {""}, {""}, {"bufrHeaderCentre",372}, {""}, {""}, - {"forecastMonth",856}, + {"forecastMonth",858}, {""}, {""}, {""}, {""}, {""}, - {"functionCode",871}, + {"functionCode",873}, {""}, {""}, {""}, {""}, {""}, - {"componentIndex",552}, + {"componentIndex",554}, {""}, {""}, - {"localSectionPresent",1137}, + {"localSectionPresent",1139}, {""}, {""}, - {"isotopeIdentificationNumber",1014}, + {"isotopeIdentificationNumber",1016}, {""}, {""}, {""}, - {"latitudeOfStretchingPole",1060}, + {"latitudeOfStretchingPole",1062}, {""}, {""}, {""}, {""}, - {"is_tigge",1009}, - {"section_08",1979}, - {"scaleFactorOfSecondWavelength",1862}, + {"is_tigge",1011}, + {"section_08",1983}, + {"scaleFactorOfSecondWavelength",1866}, {""}, {""}, {""}, - {"modelErrorType",1285}, - {"tigge_name",2134}, + {"modelErrorType",1287}, + {"tigge_name",2139}, {""}, {""}, {""}, - {"numberOfVerticalCoordinateValues",1447}, - {"scaleFactorAtReferencePoint",1844}, + {"numberOfVerticalCoordinateValues",1450}, + {"scaleFactorAtReferencePoint",1848}, {""}, {""}, - {"efas_model",713}, + {"efas_model",715}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfRows",1429}, + {"numberOfRows",1432}, {""}, {""}, {"bitmapPresent",363}, {""}, {""}, {""}, {""}, - {"stepInHours",2067}, + {"stepInHours",2072}, {""}, - {"numberOfVerticalGridDescriptors",1448}, + {"numberOfVerticalGridDescriptors",1451}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"minutesAfterReferenceTimeOfDataCutoff",1275}, + {"minutesAfterReferenceTimeOfDataCutoff",1277}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfValues",1446}, + {"numberOfValues",1449}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"consensusCount",563}, - {"xDirectionGridLengthInMillimetres",2344}, + {"consensusCount",565}, + {"xDirectionGridLengthInMillimetres",2350}, {""}, - {"md5Data",1233}, - {"scaleFactorOfRadiusOfSphericalEarth",1859}, + {"md5Data",1235}, + {"scaleFactorOfRadiusOfSphericalEarth",1863}, {""}, {""}, {""}, {""}, - {"scaleFactorOfFirstWavelength",1852}, + {"scaleFactorOfFirstWavelength",1856}, {""}, {""}, {""}, - {"predefined_grid_values",1655}, - {"verificationMonth",2277}, - {"kurt",1031}, + {"predefined_grid_values",1659}, + {"verificationMonth",2283}, + {"kurt",1033}, {""}, {""}, {""}, {""}, {""}, {""}, - {"doExtractArea",689}, + {"doExtractArea",691}, {""}, {""}, - {"inputOriginatingCentre",967}, - {"secondDimensionCoordinateValueDefinition",1902}, + {"inputOriginatingCentre",969}, + {"secondDimensionCoordinateValueDefinition",1906}, {""}, {""}, {""}, - {"runwayDepositState4",1797}, + {"runwayDepositState4",1801}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"parameterCategory",1613}, - {"nosigPresent",1328}, - {"keyData",1027}, + {"parameterCategory",1617}, + {"nosigPresent",1331}, + {"keyData",1029}, {""}, {""}, {""}, {""}, {"angleOfRotationOfProjection",305}, {""}, {""}, {""}, {""}, {""}, {""}, - {"plusOneinOrdersOfSPD",1645}, + {"plusOneinOrdersOfSPD",1649}, {""}, - {"secondaryBitmap",1913}, - {"matchAerosolPacking",1225}, + {"secondaryBitmap",1917}, + {"matchAerosolPacking",1227}, {""}, {""}, {""}, {"_anoffset",286}, - {"significanceOfReferenceDateAndTime",2007}, - {"section3Flags",1939}, + {"significanceOfReferenceDateAndTime",2012}, + {"section3Flags",1943}, {""}, {""}, {""}, {""}, - {"kurtosis",1032}, + {"kurtosis",1034}, {""}, {""}, {""}, - {"runwaySideCodeState3",1836}, + {"runwaySideCodeState3",1840}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfMembersInEnsemble",1396}, + {"numberOfMembersInEnsemble",1399}, {""}, - {"offsetAfterBitmap",1464}, + {"offsetAfterBitmap",1467}, {""}, - {"dataCategory",617}, - {"isEPS",992}, - {"extractDateTimeYearEnd",812}, + {"dataCategory",619}, + {"isEPS",994}, + {"extractDateTimeYearEnd",814}, {""}, - {"spatialProcessing",2042}, + {"spatialProcessing",2047}, {""}, {""}, {""}, {""}, {""}, - {"marsStream1",1213}, - {"keySat",1029}, + {"marsStream1",1215}, + {"keySat",1031}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"updateSequenceNumber",2247}, + {"updateSequenceNumber",2253}, {""}, {""}, {""}, - {"totalNumberOfIterations",2164}, + {"totalNumberOfIterations",2169}, {""}, - {"setCalendarId",1996}, - {"epsContinous",759}, - {"secondaryBitmapPresent",1914}, + {"setCalendarId",2000}, + {"epsContinous",761}, + {"secondaryBitmapPresent",1918}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"matrixOfValues",1230}, - {"typeOfSizeInterval",2205}, + {"matrixOfValues",1232}, + {"typeOfSizeInterval",2210}, {""}, - {"conceptsMasterMarsDir",561}, + {"conceptsMasterMarsDir",563}, {""}, {""}, {""}, {""}, - {"gts_ddhh00",914}, - {"correction1",596}, - {"dirty_statistics",683}, + {"gts_ddhh00",916}, + {"correction1",598}, + {"dirty_statistics",685}, {""}, {""}, - {"md5Section9",1247}, + {"md5Section9",1249}, {""}, {""}, {"LxInMetres",150}, {""}, {""}, {""}, {""}, {""}, - {"typeOfEnsembleMember",2189}, + {"typeOfEnsembleMember",2194}, {""}, {""}, {""}, - {"westernLongitudeOfDomain",2308}, - {"numberOfForecastsInEnsemble",1381}, - {"flagForAnyFurtherInformation",848}, + {"westernLongitudeOfDomain",2314}, + {"numberOfForecastsInEnsemble",1384}, + {"flagForAnyFurtherInformation",850}, {""}, {""}, {""}, - {"numberOfChars",1349}, - {"trueLengthOfLastGroup",2172}, + {"numberOfChars",1352}, + {"trueLengthOfLastGroup",2177}, {""}, - {"expandBy",763}, - {"correction3",600}, - {"heightOrPressureOfLevel",920}, + {"expandBy",765}, + {"correction3",602}, + {"heightOrPressureOfLevel",922}, {""}, {""}, {""}, {""}, {""}, - {"earthMinorAxisInMetres",705}, + {"earthMinorAxisInMetres",707}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"P",206}, {""}, - {"projectLocalTemplateNumber",1696}, + {"projectLocalTemplateNumber",1700}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"dayOfEndOfOverallTimeInterval",646}, + {"dayOfEndOfOverallTimeInterval",648}, {""}, {""}, {""}, {""}, - {"indexedStorageInternalNodeK",956}, - {"expandedCodes",765}, + {"indexedStorageInternalNodeK",958}, + {"expandedCodes",767}, {""}, {""}, {""}, {""}, - {"localNumberOfObservations",1134}, - {"coordinate3Flag",580}, + {"localNumberOfObservations",1136}, + {"coordinate3Flag",582}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"versionNumberOfExperimentalSuite",2284}, + {"versionNumberOfExperimentalSuite",2290}, {""}, {""}, {""}, {""}, {""}, - {"presentTrend3",1659}, + {"presentTrend3",1663}, {"centralClusterDefinition",393}, - {"scaleFactorOfDistanceFromEnsembleMean",1846}, + {"scaleFactorOfDistanceFromEnsembleMean",1850}, {""}, {""}, {""}, {""}, {""}, {""}, - {"correction2Part",599}, + {"correction2Part",601}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"coordinate1End",574}, - {"secondaryBitmaps",1915}, + {"coordinate1End",576}, + {"secondaryBitmaps",1919}, {""}, {""}, {"addExtraLocalSection",292}, {""}, - {"implementationDateOfModelCycle",952}, + {"implementationDateOfModelCycle",954}, {""}, {""}, - {"extraLocalSectionPresent",787}, + {"extraLocalSectionPresent",789}, {""}, {""}, - {"longitudeOfTangencyPoint",1169}, + {"longitudeOfTangencyPoint",1171}, {""}, - {"longitudeOfStretchingPoleInDegrees",1166}, - {"startOfRange",2055}, + {"longitudeOfStretchingPoleInDegrees",1168}, + {"startOfRange",2060}, {""}, {""}, - {"numberOfMissingInStatisticalProcess",1398}, + {"numberOfMissingInStatisticalProcess",1401}, {""}, {""}, {""}, {""}, - {"messageLength",1261}, - {"md5Section8",1246}, + {"messageLength",1263}, + {"md5Section8",1248}, {""}, - {"numberOfPoints",1409}, + {"numberOfPoints",1412}, {""}, - {"runwaySideCodeState4",1837}, + {"runwaySideCodeState4",1841}, {""}, - {"changeIndicatorTrend3",411}, + {"changeIndicatorTrend3",413}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"sfc_levtype",2000}, + {"sfc_levtype",2004}, {""}, {""}, - {"standardParallelInMicrodegrees",2052}, - {"doSimpleThinning",692}, - {"paleontologicalOffset",1606}, + {"standardParallelInMicrodegrees",2057}, + {"doSimpleThinning",694}, + {"paleontologicalOffset",1609}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"forecastProbabilityNumber",861}, + {"forecastProbabilityNumber",863}, {""}, - {"numberOfCharacters",1348}, + {"numberOfCharacters",1351}, {""}, {""}, - {"secondaryBitmapsCount",1916}, + {"secondaryBitmapsCount",1920}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"extraLocalSectionNumber",786}, + {"extraLocalSectionNumber",788}, {""}, {""}, {""}, {""}, - {"isCorrection",991}, + {"isCorrection",993}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"tablesVersionLatest",2110}, + {"tablesVersionLatest",2115}, {""}, {""}, - {"upperThreshold",2250}, + {"upperThreshold",2256}, {""}, {""}, - {"stepRangeInHours",2069}, + {"stepRangeInHours",2074}, {""}, - {"rangeBinSpacing",1720}, + {"rangeBinSpacing",1724}, {""}, {""}, {""}, {""}, {""}, - {"coordinate1Start",576}, + {"coordinate1Start",578}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"endDayTrend1",720}, + {"endDayTrend1",722}, {""}, {""}, - {"extractDateTimeHourEnd",799}, + {"extractDateTimeHourEnd",801}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"BufrTemplate",20}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"probContinous",1681}, + {"probContinous",1685}, {""}, - {"changeIndicatorTrend4",412}, - {"referenceOfWidths",1751}, - {"offsetBeforeData",1474}, - {"originalParameterTableNumber",1524}, + {"changeIndicatorTrend4",414}, + {"referenceOfWidths",1755}, + {"offsetBeforeData",1477}, + {"originalParameterTableNumber",1527}, {""}, - {"endDayTrend3",722}, + {"endDayTrend3",724}, {""}, {""}, - {"extractDateTimeMinuteEnd",802}, + {"extractDateTimeMinuteEnd",804}, {""}, {""}, {""}, {"LcxInMetres",119}, - {"totalInitialConditions",2155}, + {"totalInitialConditions",2160}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"md5Structure",1248}, + {"md5Structure",1250}, {""}, {""}, {""}, - {"extractDateTimeMinuteStart",804}, + {"extractDateTimeMinuteStart",806}, {""}, {""}, {"LuxInMetres",146}, - {"coordAveragingTims",573}, + {"coordAveragingTims",575}, {""}, {""}, {""}, - {"endStepInHours",746}, + {"endStepInHours",748}, {""}, {""}, - {"skewness",2021}, + {"skewness",2026}, {""}, - {"extractDateTimeMonthEnd",805}, + {"extractDateTimeMonthEnd",807}, {""}, - {"cloudsTitle1",505}, + {"cloudsTitle1",507}, {"averaging2Flag",318}, {""}, {""}, {""}, - {"presentTrend4",1660}, + {"presentTrend4",1664}, {""}, {""}, {""}, - {"yearOfCentury",2356}, + {"yearOfCentury",2362}, {""}, {""}, - {"coordAveraging0",569}, - {"param_value_min",1611}, + {"coordAveraging0",571}, + {"param_value_min",1615}, {""}, - {"extractDateTimeMonthStart",807}, + {"extractDateTimeMonthStart",809}, {""}, - {"timeRangeIndicator",2148}, + {"timeRangeIndicator",2153}, {""}, {""}, - {"timeCoordinateDefinition",2139}, + {"timeCoordinateDefinition",2144}, {""}, {""}, {""}, {""}, {""}, - {"flagForIrregularGridCoordinateList",849}, - {"cloudsTitle3",515}, + {"flagForIrregularGridCoordinateList",851}, + {"cloudsTitle3",517}, {""}, {"LIMITS",99}, {""}, - {"section3Padding",1941}, - {"referenceReflectivityForEchoTop",1752}, + {"section3Padding",1945}, + {"referenceReflectivityForEchoTop",1756}, {""}, - {"totalNumberOfRepetitions",2165}, - {"unknown",2240}, + {"totalNumberOfRepetitions",2170}, + {"unknown",2246}, {""}, - {"operationalForecastCluster",1513}, + {"operationalForecastCluster",1516}, {""}, - {"numberOfDataValues",1365}, + {"numberOfDataValues",1368}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"is_aerosol_optical",1002}, + {"is_aerosol_optical",1004}, {""}, {""}, {""}, - {"diffInHours",675}, + {"diffInHours",677}, {""}, - {"secondLatitudeInDegrees",1905}, + {"secondLatitudeInDegrees",1909}, {""}, - {"listOfContributingSpectralBands",1107}, + {"listOfContributingSpectralBands",1109}, {""}, {""}, {"Experiment_Identifier",56}, {""}, {""}, {""}, - {"endOfMessage",742}, + {"endOfMessage",744}, {""}, {""}, {""}, - {"extractDateTimeStart",811}, + {"extractDateTimeStart",813}, {""}, {""}, {""}, {""}, {""}, - {"lsdate_bug",1183}, + {"lsdate_bug",1185}, {""}, {""}, {""}, {""}, {""}, - {"packingType",1535}, - {"earthMajorAxis",702}, - {"typeOfOriginalFieldValues",2198}, - {"gridCoordinate",896}, + {"packingType",1538}, + {"earthMajorAxis",704}, + {"typeOfOriginalFieldValues",2203}, + {"gridCoordinate",898}, {""}, {""}, - {"extractDateTimeSecondEnd",808}, + {"extractDateTimeSecondEnd",810}, {""}, {""}, {""}, {""}, {""}, - {"cloudsTitle1Trend3",508}, + {"cloudsTitle1Trend3",510}, {""}, {""}, {""}, {""}, {""}, - {"originatingCentreOfAnalysis",1527}, + {"originatingCentreOfAnalysis",1530}, {""}, {""}, {""}, {""}, {""}, - {"extractDateTimeSecondStart",810}, + {"extractDateTimeSecondStart",812}, {""}, - {"longitudeOfTheSouthernPoleOfProjection",1173}, + {"longitudeOfTheSouthernPoleOfProjection",1175}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"shapeOfVerificationArea",2002}, + {"shapeOfVerificationArea",2006}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"scaledValueOfFirstSize",1875}, + {"scaledValueOfFirstSize",1879}, {""}, {""}, {""}, {""}, - {"longitudeOfThePoleOfStretching",1170}, + {"longitudeOfThePoleOfStretching",1172}, {""}, {""}, - {"md5TimeDomainSection",1249}, + {"md5TimeDomainSection",1251}, {""}, {"BOX",17}, - {"section4Padding",1946}, + {"section4Padding",1950}, {"XRInMetres",267}, {""}, {""}, {""}, - {"offsetBSection9",1472}, + {"offsetBSection9",1475}, {"averaging1Flag",317}, {""}, {""}, {""}, {""}, {""}, {""}, - {"primaryMissingValue",1679}, + {"primaryMissingValue",1683}, {""}, {""}, {""}, {""}, {"Lar2InDegrees",112}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -4522,356 +4520,356 @@ static const struct grib_keys_hash wordlist[] = {"Lor2InDegrees",144}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"clusterMember10",527}, + {"clusterMember10",529}, {""}, - {"frequencyScalingFactor",870}, + {"frequencyScalingFactor",872}, {""}, - {"endMinuteTrend3",733}, + {"endMinuteTrend3",735}, {""}, {""}, {""}, - {"timeRangeIndicatorFromStepRange",2149}, - {"cloudsTitle1Trend4",509}, + {"timeRangeIndicatorFromStepRange",2154}, + {"cloudsTitle1Trend4",511}, {""}, {""}, {""}, {""}, {""}, {""}, - {"clusterMember3",529}, - {"n2",1304}, + {"clusterMember3",531}, + {"n2",1306}, {""}, {""}, {""}, {""}, {""}, {""}, {"LoVInDegrees",128}, - {"is_chemical_distfn",1004}, + {"is_chemical_distfn",1006}, {""}, {""}, {""}, {""}, - {"jDirectionIncrement",1018}, + {"jDirectionIncrement",1020}, {""}, {""}, - {"numberIncludedInAverage",1336}, - {"md5DataSection",1234}, + {"numberIncludedInAverage",1339}, + {"md5DataSection",1236}, {""}, - {"numberOfDataPoints",1363}, + {"numberOfDataPoints",1366}, {""}, {""}, {""}, - {"numberOfLogicals",1394}, - {"typicalCentury",2211}, + {"numberOfLogicals",1397}, + {"typicalCentury",2216}, {""}, {""}, {""}, {""}, {""}, {""}, - {"sp2",2036}, + {"sp2",2041}, {""}, {""}, {""}, {""}, - {"referenceValueError",1756}, + {"referenceValueError",1760}, {""}, {""}, {""}, - {"scaledValueOfStandardDeviation",1887}, + {"scaledValueOfStandardDeviation",1891}, {""}, - {"primaryMissingValueSubstitute",1680}, - {"latitudeOfFirstGridPointInDegrees",1050}, + {"primaryMissingValueSubstitute",1684}, + {"latitudeOfFirstGridPointInDegrees",1052}, {""}, - {"masterTablesVersionNumber",1222}, + {"masterTablesVersionNumber",1224}, {""}, {""}, {""}, {""}, {""}, - {"secondaryMissingValue",1918}, + {"secondaryMissingValue",1922}, {""}, {""}, - {"spare2",2041}, + {"spare2",2046}, {""}, {""}, {""}, {""}, - {"scaledValueOfStandardDeviationInTheCluster",1888}, + {"scaledValueOfStandardDeviationInTheCluster",1892}, {""}, {""}, {""}, - {"scaledValueOfFirstFixedSurface",1874}, + {"scaledValueOfFirstFixedSurface",1878}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"crraLocalVersion",611}, + {"crraLocalVersion",613}, {""}, {""}, - {"monthOfModelVersion",1295}, + {"monthOfModelVersion",1297}, {""}, {""}, - {"gridPointPosition",903}, + {"gridPointPosition",905}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"Lar1InDegrees",110}, - {"numberOfColumns",1356}, + {"numberOfColumns",1359}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"lengthOfTimeRange",1089}, + {"lengthOfTimeRange",1091}, {""}, {""}, {""}, - {"latitudeOfCentralPointInClusterDomain",1046}, + {"latitudeOfCentralPointInClusterDomain",1048}, {""}, {""}, {""}, {"Lor1InDegrees",142}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"biFourierCoefficients",351}, {""}, {""}, {""}, - {"epsStatisticsContinous",761}, + {"epsStatisticsContinous",763}, {""}, - {"stepHumanReadable",2066}, - {"section9Length",1965}, + {"stepHumanReadable",2071}, + {"section9Length",1969}, {""}, {""}, - {"lowerThreshold",1180}, + {"lowerThreshold",1182}, {""}, {""}, {""}, {""}, {""}, - {"longitudeOfNorthWestCornerOfArea",1159}, + {"longitudeOfNorthWestCornerOfArea",1161}, {""}, {"NP",183}, {""}, - {"scaleValuesBy",1866}, + {"scaleValuesBy",1870}, {""}, - {"latitudeOfStretchingPoleInDegrees",1061}, + {"latitudeOfStretchingPoleInDegrees",1063}, {""}, - {"numberOfForecastsInCluster",1380}, - {"scaledValueOfSecondSize",1885}, + {"numberOfForecastsInCluster",1383}, + {"scaledValueOfSecondSize",1889}, {""}, {""}, {""}, {""}, - {"widthOfLengths",2310}, + {"widthOfLengths",2316}, {""}, {""}, {""}, {""}, {""}, - {"section3Pointer",1942}, + {"section3Pointer",1946}, {""}, - {"sampleSizeOfModelClimate",1839}, + {"sampleSizeOfModelClimate",1843}, {""}, {""}, - {"secondOfModelVersion",1908}, + {"secondOfModelVersion",1912}, {""}, {""}, - {"minuteOfModelVersion",1272}, + {"minuteOfModelVersion",1274}, {""}, {""}, {""}, {""}, - {"dummy2",697}, + {"dummy2",699}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfBits",1339}, + {"numberOfBits",1342}, {""}, {""}, {""}, {""}, {""}, {""}, - {"skew",2020}, + {"skew",2025}, {""}, {"Dj",35}, {"La1InDegrees",103}, {""}, {""}, {"beginDayTrend3",333}, {""}, - {"numberOfDistinctSection6s",1372}, - {"endMinuteTrend4",734}, + {"numberOfDistinctSection6s",1375}, + {"endMinuteTrend4",736}, {""}, - {"extractDateTimeEnd",798}, - {"section0Length",1923}, + {"extractDateTimeEnd",800}, + {"section0Length",1927}, {""}, {""}, {""}, - {"tiggeLAMName",2129}, - {"coordinate4Flag",583}, + {"tiggeLAMName",2134}, + {"coordinate4Flag",585}, {""}, {""}, {"Lo1InDegrees",124}, - {"clusterMember4",530}, - {"distinctLongitudes",688}, - {"resolutionAndComponentFlags",1772}, - {"listMembersMissing",1099}, + {"clusterMember4",532}, + {"distinctLongitudes",690}, + {"resolutionAndComponentFlags",1776}, + {"listMembersMissing",1101}, {"SecondOfModelVersion",224}, - {"marsType2",1217}, + {"marsType2",1219}, {""}, - {"numberOfCategories",1347}, + {"numberOfCategories",1350}, {""}, - {"mBasicAngle",1186}, + {"mBasicAngle",1188}, {""}, {""}, - {"section2Present",1937}, + {"section2Present",1941}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"shortNameECMF",2004}, + {"shortNameECMF",2008}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"lengthOfOriginatorLocalTemplate",1087}, + {"lengthOfOriginatorLocalTemplate",1089}, {""}, {""}, {""}, - {"extremeClockwiseWindDirection",821}, - {"endOfHeadersMarker",740}, + {"extremeClockwiseWindDirection",823}, + {"endOfHeadersMarker",742}, {""}, {""}, {""}, {""}, - {"section8Length",1962}, + {"section8Length",1966}, {""}, {""}, - {"extractAreaEastLongitude",789}, - {"section4Pointer",1947}, - {"numberOfDataBinsAlongRadials",1361}, - {"numberOfTimeRange",1437}, + {"extractAreaEastLongitude",791}, + {"section4Pointer",1951}, + {"numberOfDataBinsAlongRadials",1364}, + {"numberOfTimeRange",1440}, {""}, {""}, {""}, {""}, - {"northernLatitudeOfClusterDomain",1326}, + {"northernLatitudeOfClusterDomain",1329}, {""}, {""}, - {"reserved2",1765}, - {"correction4",602}, + {"reserved2",1769}, + {"correction4",604}, {""}, - {"windVariableDirectionTrend3",2337}, + {"windVariableDirectionTrend3",2343}, {""}, - {"longitudeOfFirstDiamondCenterLine",1151}, + {"longitudeOfFirstDiamondCenterLine",1153}, {""}, - {"longitudeOfFirstDiamondCentreLine",1152}, - {"twoOrdersOfSPD",2181}, + {"longitudeOfFirstDiamondCentreLine",1154}, + {"twoOrdersOfSPD",2186}, {""}, {""}, {""}, - {"section10Pointer",1927}, + {"section10Pointer",1931}, {""}, {""}, {""}, {""}, - {"latitudeOfNorthWestCornerOfArea",1054}, - {"longitudeOfFirstDiamondCentreLineInDegrees",1153}, + {"latitudeOfNorthWestCornerOfArea",1056}, + {"longitudeOfFirstDiamondCentreLineInDegrees",1155}, {""}, {""}, {""}, {""}, {""}, - {"typeOfCalendar",2185}, + {"typeOfCalendar",2190}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"DjInMetres",38}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"sp1",2035}, + {"sp1",2040}, {""}, - {"ijDirectionIncrementGiven",951}, + {"ijDirectionIncrementGiven",953}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"southernLatitudeOfClusterDomain",2033}, + {"southernLatitudeOfClusterDomain",2038}, {"centreForTable2",400}, {""}, {""}, {""}, - {"numberOfForecastsInTheCluster",1382}, + {"numberOfForecastsInTheCluster",1385}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"qnhAPresent",1705}, + {"qnhAPresent",1709}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"gribDataQualityChecks",892}, + {"gribDataQualityChecks",894}, {""}, {""}, {""}, {""}, - {"default_max_val",662}, - {"monthlyVerificationMonth",1298}, + {"default_max_val",664}, + {"monthlyVerificationMonth",1300}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"windVariableDirectionTrend4",2338}, + {"windVariableDirectionTrend4",2344}, {""}, {""}, {""}, - {"latitudeLongitudeValues",1045}, + {"latitudeLongitudeValues",1047}, {""}, {""}, {""}, {""}, - {"section1",1925}, + {"section1",1929}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"formatVersionMajorNumber",865}, + {"formatVersionMajorNumber",867}, {""}, {"bufrdcExpandedDescriptors",375}, {""}, {""}, {""}, {""}, {"beginDayTrend4",334}, - {"missingValueManagement",1278}, + {"missingValueManagement",1280}, {""}, {""}, {""}, {""}, {"PLPresent",209}, {""}, {""}, - {"g1conceptsMasterDir",874}, + {"g1conceptsMasterDir",876}, {""}, {""}, {""}, {""}, {""}, {""}, - {"swapScanningLat",2096}, + {"swapScanningLat",2101}, {""}, {""}, {""}, {""}, - {"sectionLengthLimitForEnsembles",1968}, + {"sectionLengthLimitForEnsembles",1972}, {""}, {""}, {""}, {""}, - {"unitsConversionOffset",2233}, - {"tigge_short_name",2135}, - {"thisMarsClass",2121}, + {"unitsConversionOffset",2238}, + {"tigge_short_name",2140}, + {"thisMarsClass",2126}, {""}, {""}, - {"swapScanningLon",2097}, + {"swapScanningLon",2102}, {""}, {""}, {""}, {"boot_edition",367}, {""}, - {"inputProcessIdentifier",969}, + {"inputProcessIdentifier",971}, {""}, - {"versionNumOfRootGroupSymbolTableEntry",2282}, + {"versionNumOfRootGroupSymbolTableEntry",2288}, {""}, - {"reservedSection3",1770}, + {"reservedSection3",1774}, {""}, - {"northWestLongitudeOfVerficationArea",1325}, + {"northWestLongitudeOfVerficationArea",1328}, {""}, {""}, - {"dummy1",696}, + {"dummy1",698}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"monthOfEndOfOverallTimeInterval",1293}, + {"monthOfEndOfOverallTimeInterval",1295}, {""}, {""}, {""}, {""}, {""}, {""}, {"NV",188}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"resolutionAndComponentFlags8",1779}, - {"scanningMode4",1893}, + {"resolutionAndComponentFlags8",1783}, + {"scanningMode4",1897}, {""}, - {"qualityControl",1708}, + {"qualityControl",1712}, {""}, {""}, {""}, - {"section1Flags",1930}, - {"endDayTrend4",723}, + {"section1Flags",1934}, + {"endDayTrend4",725}, {""}, {""}, {""}, {""}, - {"marsType1",1216}, - {"latitudeOfSouthernPole",1058}, + {"marsType1",1218}, + {"latitudeOfSouthernPole",1060}, {""}, {""}, {""}, - {"stepUnits",2073}, + {"stepUnits",2078}, {""}, {""}, - {"scaleFactorOfLowerLimit",1855}, + {"scaleFactorOfLowerLimit",1859}, {""}, {""}, {""}, - {"yearOfEndOfOverallTimeInterval",2357}, + {"yearOfEndOfOverallTimeInterval",2363}, {""}, {""}, {""}, {""}, - {"numberOfComponents",1357}, + {"numberOfComponents",1360}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"flagShowingPostAuxiliaryArrayInUse",851}, + {"flagShowingPostAuxiliaryArrayInUse",853}, {""}, - {"gribMasterTablesVersionNumber",893}, - {"scaledValueOfDistributionFunctionParameter",1871}, + {"gribMasterTablesVersionNumber",895}, + {"scaledValueOfDistributionFunctionParameter",1875}, {""}, {""}, - {"matchAerosolBinNumber",1224}, + {"matchAerosolBinNumber",1226}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"totalLength",2156}, + {"totalLength",2161}, {""}, {""}, {""}, {""}, - {"numberOfClusters",1352}, + {"numberOfClusters",1355}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"reserved1",1764}, - {"scaledValueOfSecondFixedSurface",1884}, - {"section10Length",1926}, + {"reserved1",1768}, + {"scaledValueOfSecondFixedSurface",1888}, + {"section10Length",1930}, {""}, {""}, - {"cloudsTitle4",520}, + {"cloudsTitle4",522}, {""}, {""}, {"backgroundProcess",323}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"changeIndicatorTrend2",410}, + {"changeIndicatorTrend2",412}, {""}, {""}, {""}, - {"radiusOfCentralCluster",1716}, + {"radiusOfCentralCluster",1720}, {""}, {""}, {""}, - {"gridDescriptionSectionPresent",901}, + {"gridDescriptionSectionPresent",903}, {""}, {""}, {""}, {"N2",171}, - {"latitudeOfTangencyPoint",1064}, + {"latitudeOfTangencyPoint",1066}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"totalNumberOfDataValuesMissingInStatisticalProcess",2159}, + {"totalNumberOfDataValuesMissingInStatisticalProcess",2164}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"hourOfEndOfOverallTimeInterval",930}, + {"hourOfEndOfOverallTimeInterval",932}, {""}, - {"realPartOf00",1735}, + {"realPartOf00",1739}, {""}, - {"secondaryMissingValueSubstitute",1919}, + {"secondaryMissingValueSubstitute",1923}, {""}, {""}, - {"table2Version",2103}, + {"table2Version",2108}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"X2",264}, {""}, {""}, {""}, {""}, {""}, - {"local_padding",1142}, + {"local_padding",1144}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section6",1953}, + {"section6",1957}, {""}, {""}, {""}, - {"totalAerosolBinsNumbers",2154}, - {"fileConsistencyFlags",838}, + {"totalAerosolBinsNumbers",2159}, + {"fileConsistencyFlags",840}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"SOH",221}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsAbbreviation3",435}, + {"cloudsAbbreviation3",437}, {""}, {""}, {""}, {""}, - {"marsGrid",1197}, + {"marsGrid",1199}, {""}, {""}, {""}, - {"codedNumberOfFirstOrderPackedValues",545}, + {"codedNumberOfFirstOrderPackedValues",547}, {""}, {""}, {""}, {""}, {""}, {""}, {"beginMinuteTrend3",341}, {""}, {""}, {""}, {""}, {""}, - {"recentWeather",1737}, + {"recentWeather",1741}, {""}, {""}, {""}, - {"is_ocean3d_param",1007}, + {"is_ocean3d_param",1009}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"changeIndicatorTrend1",409}, + {"changeIndicatorTrend1",411}, {""}, {"LoV",127}, {""}, {""}, {""}, {""}, {""}, - {"productionStatusOfProcessedData",1694}, + {"productionStatusOfProcessedData",1698}, {""}, - {"stepForClustering",2065}, + {"stepForClustering",2070}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberMissingFromAveragesOrAccumulations",1337}, + {"numberMissingFromAveragesOrAccumulations",1340}, {""}, {""}, - {"northWestLatitudeOfLPOArea",1322}, - {"section2Padding",1935}, - {"localExtensionPadding",1122}, + {"northWestLatitudeOfLPOArea",1325}, + {"section2Padding",1939}, + {"localExtensionPadding",1124}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"typeOfPreProcessing",2201}, + {"typeOfPreProcessing",2206}, {"Nj",195}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"GTSstr",80}, {""}, {""}, - {"spatialSmoothingOfProduct",2043}, + {"spatialSmoothingOfProduct",2048}, {""}, {""}, - {"compressedData",553}, + {"compressedData",555}, {""}, {""}, {"beginMinuteTrend4",342}, {""}, - {"windSpeedTrend2",2326}, - {"windDirectionTrend2",2315}, + {"windSpeedTrend2",2332}, + {"windDirectionTrend2",2321}, {""}, {""}, {""}, {""}, {""}, - {"coordinate2Flag",578}, + {"coordinate2Flag",580}, {""}, {""}, {""}, - {"cloudsTitle1Trend2",507}, - {"offsetSection2",1487}, - {"isectionNumber2",1011}, + {"cloudsTitle1Trend2",509}, + {"offsetSection2",1490}, + {"isectionNumber2",1013}, {"La2",104}, {""}, {""}, {""}, {"GTS",79}, {""}, {""}, {""}, {""}, {""}, {"Lar2",111}, {""}, - {"numberOfDistinctSection7s",1373}, + {"numberOfDistinctSection7s",1376}, {""}, {""}, {"Latin2",116}, {""}, @@ -4880,565 +4878,566 @@ static const struct grib_keys_hash wordlist[] = {"Lor2",143}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"swapScanningX",2098}, + {"swapScanningX",2103}, {""}, {""}, {""}, - {"masterTablesVersionNumberLatest",1223}, + {"masterTablesVersionNumberLatest",1225}, {""}, {""}, {""}, {""}, {""}, {"N1",170}, - {"offsetEndSection4",1478}, + {"offsetEndSection4",1481}, {""}, {""}, {"DiGiven",32}, {""}, {""}, - {"coordinate3OfLastGridPoint",582}, + {"coordinate3OfLastGridPoint",584}, {""}, {""}, {""}, {""}, {""}, - {"firstMonthUsedToBuildClimateMonth2",845}, + {"firstMonthUsedToBuildClimateMonth2",847}, {""}, {""}, {""}, {""}, {""}, - {"cloudsAbbreviation4",440}, + {"cloudsAbbreviation4",442}, {""}, {""}, {""}, - {"groupLengths",907}, - {"section1Padding",1932}, + {"groupLengths",909}, + {"section1Padding",1936}, {""}, {""}, - {"versionOfModelClimate",2287}, + {"versionOfModelClimate",2293}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"secondaryBitMap",1912}, + {"secondaryBitMap",1916}, {""}, {""}, - {"numberOfPackedValues",1405}, - {"sectionLengthLimitForProbability",1969}, + {"numberOfPackedValues",1408}, + {"sectionLengthLimitForProbability",1973}, {""}, - {"windUnits",2329}, + {"windUnits",2335}, {""}, {"X1",262}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"centralLongitudeInMicrodegrees",396}, {""}, - {"postAuxiliaryArrayPresent",1648}, - {"keyMore",1028}, + {"postAuxiliaryArrayPresent",1652}, + {"keyMore",1030}, {""}, {""}, {""}, - {"secondaryBitmapsSize",1917}, + {"secondaryBitmapsSize",1921}, {""}, {""}, {""}, {""}, - {"secondOfEndOfOverallTimeInterval",1906}, + {"secondOfEndOfOverallTimeInterval",1910}, {""}, {""}, - {"minuteOfEndOfOverallTimeInterval",1270}, - {"longitudeOfSubSatellitePoint",1167}, + {"minuteOfEndOfOverallTimeInterval",1272}, + {"longitudeOfSubSatellitePoint",1169}, {""}, {""}, {"Yo",279}, {""}, {""}, {""}, {"Yp",280}, {""}, {""}, {""}, - {"lengthOf4DvarWindow",1083}, + {"lengthOf4DvarWindow",1085}, {""}, {""}, - {"subDefinitions2",2082}, - {"longitudeOfSubSatellitePointInDegrees",1168}, - {"cloudsTitle1Trend1",506}, + {"subDefinitions2",2087}, + {"longitudeOfSubSatellitePointInDegrees",1170}, + {"cloudsTitle1Trend1",508}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"missingValuesPresent",1280}, + {"missingValuesPresent",1282}, {""}, - {"numberOfRepresentativeMember",1427}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"cloudsTitle3Trend3",518}, + {"numberOfRepresentativeMember",1430}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"nameLegacyECMF",1311}, + {""}, {""}, {""}, {""}, {""}, + {"cloudsTitle3Trend3",520}, {""}, {""}, {""}, {""}, {""}, - {"preBitmapValues",1650}, - {"runwayDesignatorState3",1812}, + {"preBitmapValues",1654}, + {"runwayDesignatorState3",1816}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"reducedGrid",1744}, + {"reducedGrid",1748}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"firstMonthUsedToBuildClimateMonth1",844}, + {"firstMonthUsedToBuildClimateMonth1",846}, {""}, {""}, - {"southEastLongitudeOfVerficationArea",2029}, + {"southEastLongitudeOfVerficationArea",2034}, {""}, - {"runwayDepositState2",1795}, + {"runwayDepositState2",1799}, {""}, {""}, - {"deleteCalendarId",666}, + {"deleteCalendarId",668}, {""}, {""}, {""}, - {"latitudeOfIcosahedronPole",1051}, + {"latitudeOfIcosahedronPole",1053}, {""}, - {"mars_labeling",1218}, - {"is_s2s",1008}, + {"mars_labeling",1220}, + {"is_s2s",1010}, {""}, {""}, {""}, - {"endMonthTrend3",737}, + {"endMonthTrend3",739}, {""}, - {"spaceUnitFlag",2038}, + {"spaceUnitFlag",2043}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"typeOfGrid",2192}, + {"typeOfGrid",2197}, {""}, {""}, {""}, {""}, {""}, {"biFourierResolutionParameterN",355}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section2Pointer",1936}, + {"section2Pointer",1940}, {""}, {""}, {""}, {"bitsPerValue",365}, {""}, - {"windSpeedTrend1",2325}, - {"windDirectionTrend1",2314}, - {"cloudsTitle3Trend4",519}, + {"windSpeedTrend1",2331}, + {"windDirectionTrend1",2320}, + {"cloudsTitle3Trend4",521}, {""}, {""}, {""}, {""}, {""}, - {"scaleFactorOfLengthOfSemiMinorAxis",1854}, - {"runwayDesignatorState4",1813}, - {"directionOfVariation",681}, + {"scaleFactorOfLengthOfSemiMinorAxis",1858}, + {"runwayDesignatorState4",1817}, + {"directionOfVariation",683}, {""}, - {"offsetSection1",1484}, + {"offsetSection1",1487}, {""}, {"La1",102}, {""}, {""}, {""}, {""}, - {"pressureUnits",1677}, + {"pressureUnits",1681}, {""}, {""}, {""}, {""}, {"Lar1",109}, {""}, {""}, {""}, {""}, {"Latin1",114}, {""}, {"Lo1",123}, - {"jDirectionIncrementInDegrees",1021}, + {"jDirectionIncrementInDegrees",1023}, {"INBITS",90}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"Lor1",141}, - {"unitOfTimeRange",2230}, + {"unitOfTimeRange",2235}, {""}, {""}, {""}, {""}, {""}, {""}, - {"parametersVersion",1621}, + {"parametersVersion",1625}, {""}, - {"oceanAtmosphereCoupling",1459}, + {"oceanAtmosphereCoupling",1462}, {""}, {""}, {"NUT",187}, {""}, {""}, - {"thisExperimentVersionNumber",2120}, + {"thisExperimentVersionNumber",2125}, {""}, {""}, {""}, - {"param_value_max",1610}, + {"param_value_max",1614}, {""}, - {"localYear",1141}, + {"localYear",1143}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"preProcessingParameter",1651}, + {"preProcessingParameter",1655}, {""}, {""}, - {"windGust",2318}, - {"default_min_val",663}, + {"windGust",2324}, + {"default_min_val",665}, {""}, {""}, {""}, {""}, {""}, {""}, {"NH",179}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"WRAPstr",261}, {""}, - {"reservedSection4",1771}, + {"reservedSection4",1775}, {""}, - {"dateSSTFieldUsed",641}, + {"dateSSTFieldUsed",643}, {""}, {""}, {""}, {""}, {""}, {""}, {"biFourierResolutionSubSetParameterN",357}, {""}, {""}, {""}, {""}, - {"windVariableDirectionTrend2",2336}, + {"windVariableDirectionTrend2",2342}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"northWestLongitudeOfLPOArea",1324}, + {"northWestLongitudeOfLPOArea",1327}, {""}, - {"coordinateFlag2",587}, + {"coordinateFlag2",589}, {""}, - {"section1Pointer",1933}, + {"section1Pointer",1937}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"typicalYear",2220}, + {"typicalYear",2225}, {""}, {""}, {""}, {""}, {""}, - {"subDefinitions1",2081}, + {"subDefinitions1",2086}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"percentileValue",1634}, + {"percentileValue",1638}, {""}, {""}, - {"rootGroupObjectHeaderAddress",1780}, - {"endMonthTrend4",738}, + {"rootGroupObjectHeaderAddress",1784}, + {"endMonthTrend4",740}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"unpackedError",2242}, + {"unpackedError",2248}, {""}, {""}, {""}, {""}, {""}, - {"extractAreaNorthLatitude",792}, + {"extractAreaNorthLatitude",794}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"constantAntennaElevationAngle",565}, + {"constantAntennaElevationAngle",567}, {""}, {""}, {""}, {""}, {""}, - {"runwaySideCodeState2",1835}, + {"runwaySideCodeState2",1839}, {""}, {""}, {""}, {""}, - {"longitudeOfReferencePoint",1160}, + {"longitudeOfReferencePoint",1162}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"METARstr",155}, - {"northWestLatitudeOfVerficationArea",1323}, + {"northWestLatitudeOfVerficationArea",1326}, {""}, {""}, - {"falseEasting",831}, + {"falseEasting",833}, {""}, {""}, {""}, {""}, - {"runwayDepositState1",1794}, + {"runwayDepositState1",1798}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"longitudeOfThePolePoint",1171}, + {"longitudeOfThePolePoint",1173}, {""}, {""}, {""}, {""}, {""}, {""}, - {"southEastLatitudeOfLPOArea",2026}, + {"southEastLatitudeOfLPOArea",2031}, {""}, {""}, {""}, {""}, {""}, - {"variationOfVisibility",2264}, + {"variationOfVisibility",2270}, {""}, {""}, {""}, {""}, - {"windVariableDirectionTrend1",2335}, + {"windVariableDirectionTrend1",2341}, {""}, {""}, - {"variationOfVisibilityDirection",2265}, + {"variationOfVisibilityDirection",2271}, {""}, {""}, {""}, {"accuracyMultipliedByFactor",290}, {""}, {""}, {""}, {""}, {""}, - {"variationOfVisibilityDirectionAngle",2266}, - {"section6Pointer",1955}, + {"variationOfVisibilityDirectionAngle",2272}, + {"section6Pointer",1959}, {""}, {""}, {""}, {""}, {""}, {""}, - {"yCoordinateOfOriginOfSectorImage",2347}, + {"yCoordinateOfOriginOfSectorImage",2353}, {""}, - {"offsetSection6",1491}, + {"offsetSection6",1494}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section3Length",1940}, + {"section3Length",1944}, {""}, {""}, - {"gts_TTAAii",913}, + {"gts_TTAAii",915}, {""}, - {"latitudeOfSouthernPoleInDegrees",1059}, + {"latitudeOfSouthernPoleInDegrees",1061}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"firstDimensionCoordinateValueDefinition",840}, - {"timeIncrementBetweenSuccessiveFields",2143}, + {"firstDimensionCoordinateValueDefinition",842}, + {"timeIncrementBetweenSuccessiveFields",2148}, {""}, {""}, - {"numberOfBytesOfFreeFormatData",1345}, + {"numberOfBytesOfFreeFormatData",1348}, {""}, {""}, - {"scaleFactorOfPrimeMeridianOffset",1858}, + {"scaleFactorOfPrimeMeridianOffset",1862}, {""}, {""}, {""}, - {"recentWeatherTry",1738}, + {"recentWeatherTry",1742}, {""}, {""}, - {"runwayFrictionCoefficientState3",1832}, - {"visibilityInKilometresTrend3",2297}, - {"numberOfBytesInLocalDefinition",1344}, + {"runwayFrictionCoefficientState3",1836}, + {"visibilityInKilometresTrend3",2303}, + {"numberOfBytesInLocalDefinition",1347}, {""}, - {"rootTablesDir",1782}, + {"rootTablesDir",1786}, {""}, {""}, {""}, - {"packingError",1534}, + {"packingError",1537}, {""}, {""}, - {"section_10",1982}, + {"section_10",1986}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section_3",1985}, + {"section_3",1989}, {""}, {""}, - {"numberOfDistinctSection5s",1371}, + {"numberOfDistinctSection5s",1374}, {""}, {""}, {""}, - {"unitsConversionScaleFactor",2234}, + {"unitsConversionScaleFactor",2239}, {""}, {""}, {""}, - {"presentTrend2",1658}, + {"presentTrend2",1662}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"scaledValueOfSecondWavelength",1886}, + {"scaledValueOfSecondWavelength",1890}, {""}, {""}, - {"md5Product",1237}, + {"md5Product",1239}, {""}, {""}, {""}, {""}, {""}, - {"dateOfSSTFieldUsed",640}, + {"dateOfSSTFieldUsed",642}, {""}, {""}, {""}, - {"formatVersionMinorNumber",866}, + {"formatVersionMinorNumber",868}, {""}, {""}, {""}, {""}, {""}, {""}, - {"visibilityTrend1",2299}, + {"visibilityTrend1",2305}, {""}, {""}, {""}, - {"jScansPositively",1024}, - {"section4Length",1945}, + {"jScansPositively",1026}, + {"section4Length",1949}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"matrixBitmapsPresent",1229}, + {"matrixBitmapsPresent",1231}, {""}, {""}, {""}, {""}, - {"rdbtimeYear",1733}, + {"rdbtimeYear",1737}, {""}, {""}, {""}, - {"visibilityTrend3",2301}, + {"visibilityTrend3",2307}, {""}, {""}, {""}, - {"coordinateFlag1",586}, + {"coordinateFlag1",588}, {""}, - {"runwayFrictionCoefficientState4",1833}, + {"runwayFrictionCoefficientState4",1837}, {""}, - {"coordinate4OfLastGridPoint",585}, + {"coordinate4OfLastGridPoint",587}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section_03",1974}, + {"section_03",1978}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"scaledValueOfRadiusOfSphericalEarth",1883}, + {"scaledValueOfRadiusOfSphericalEarth",1887}, {""}, {""}, {""}, {""}, - {"scaledValueOfFirstWavelength",1876}, + {"scaledValueOfFirstWavelength",1880}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfDaysInClimateSamplingWindow",1366}, + {"numberOfDaysInClimateSamplingWindow",1369}, {""}, {""}, - {"typeOfSSTFieldUsed",2203}, + {"typeOfSSTFieldUsed",2208}, {""}, {""}, {""}, {""}, {""}, {"MonthOfModelVersion",168}, {""}, {""}, {""}, - {"runwaySideCodeState1",1834}, + {"runwaySideCodeState1",1838}, {""}, - {"numberOfPointsInDomain",1420}, + {"numberOfPointsInDomain",1423}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"backgroundGeneratingProcessIdentifier",322}, {""}, {""}, {""}, {""}, {""}, - {"southPoleOnProjectionPlane",2032}, - {"marsKeywords1",1200}, - {"typicalMonth",2217}, + {"southPoleOnProjectionPlane",2037}, + {"marsKeywords1",1202}, + {"typicalMonth",2222}, {""}, {""}, - {"listOfParametersUsedForClustering",1111}, + {"listOfParametersUsedForClustering",1113}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"totalNumberOfValuesInUnpackedSubset",2168}, + {"totalNumberOfValuesInUnpackedSubset",2173}, {""}, {""}, - {"visibilityInKilometresTrend4",2298}, + {"visibilityInKilometresTrend4",2304}, {""}, {""}, - {"cloudsTitle4Trend3",523}, - {"cloudsBaseCoded1Trend3",468}, + {"cloudsTitle4Trend3",525}, + {"cloudsBaseCoded1Trend3",470}, {""}, {""}, {""}, {"beginMinuteTrend2",340}, {""}, {""}, {""}, {""}, - {"numberOfPointsAlongXAxis",1416}, + {"numberOfPointsAlongXAxis",1419}, {""}, {""}, - {"jPointsAreConsecutive",1023}, + {"jPointsAreConsecutive",1025}, {""}, - {"is_ocean2d_param",1006}, - {"firstOrderValues",846}, + {"is_ocean2d_param",1008}, + {"firstOrderValues",848}, {""}, - {"typeOfWavelengthInterval",2210}, - {"qnhUnits",1707}, + {"typeOfWavelengthInterval",2215}, + {"qnhUnits",1711}, {""}, {""}, {""}, - {"section_4",1986}, + {"section_4",1990}, {""}, {""}, {""}, {""}, {""}, - {"marsStream2",1214}, + {"marsStream2",1216}, {""}, {""}, {""}, {""}, {"MinuteOfModelVersion",157}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"dayOfTheYearDate",650}, + {"dayOfTheYearDate",652}, {""}, {"beginHourTrend3",337}, {""}, - {"satelliteID",1840}, + {"satelliteID",1844}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"parameterUnits",1619}, + {"parameterUnits",1623}, {""}, - {"dataSubCategory",629}, + {"dataSubCategory",631}, {""}, {""}, {""}, - {"secondOrderValuesDifferentWidths",1911}, + {"secondOrderValuesDifferentWidths",1915}, {""}, - {"subLocalDefinition2",2084}, + {"subLocalDefinition2",2089}, {""}, {""}, - {"expandedUnits",776}, + {"expandedUnits",778}, {""}, - {"numberOfCoordinatesValues",1360}, + {"numberOfCoordinatesValues",1363}, {""}, {""}, {""}, - {"correction2",598}, + {"correction2",600}, {""}, {""}, {""}, - {"crraSuiteID",613}, + {"crraSuiteID",615}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"offsetFromReferenceOfFirstTime",1481}, + {"offsetFromReferenceOfFirstTime",1484}, {""}, - {"unexpandedDescriptors",2225}, + {"unexpandedDescriptors",2230}, {""}, {""}, {""}, {""}, {""}, {""}, - {"scaleFactorOfMajorAxisOfOblateSpheroidEarth",1856}, - {"cloudsTitle4Trend4",524}, - {"cloudsBaseCoded1Trend4",469}, + {"scaleFactorOfMajorAxisOfOblateSpheroidEarth",1860}, + {"cloudsTitle4Trend4",526}, + {"cloudsBaseCoded1Trend4",471}, {""}, {"PVPresent",211}, - {"presentTrend1",1657}, + {"presentTrend1",1661}, {""}, - {"section_04",1975}, + {"section_04",1979}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"scaledValueOfDistanceFromEnsembleMean",1870}, + {"scaledValueOfDistanceFromEnsembleMean",1874}, {""}, - {"mixedCoordinateFieldFlag",1282}, + {"mixedCoordinateFieldFlag",1284}, {"beginMinuteTrend1",339}, {""}, {""}, {""}, {""}, {""}, - {"sourceOfGridDefinition",2024}, + {"sourceOfGridDefinition",2029}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfClusterLowResolution",1351}, + {"numberOfClusterLowResolution",1354}, {""}, - {"unexpandedDescriptorsEncoded",2226}, + {"unexpandedDescriptorsEncoded",2231}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section9UniqueIdentifier",1967}, + {"section9UniqueIdentifier",1971}, {""}, - {"southEastLongitudeOfLPOArea",2028}, + {"southEastLongitudeOfLPOArea",2033}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"grib2LocalSectionPresent",889}, - {"widthOfWidths",2312}, + {"grib2LocalSectionPresent",891}, + {"widthOfWidths",2318}, {""}, {""}, {""}, {""}, {""}, - {"earthMajorAxisInMetres",703}, + {"earthMajorAxisInMetres",705}, {""}, {""}, {""}, {""}, {""}, - {"qfeUnits",1703}, + {"qfeUnits",1707}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"nameECMF",1308}, + {"nameECMF",1310}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"identificationOfOriginatingGeneratingCentre",946}, + {"identificationOfOriginatingGeneratingCentre",948}, {""}, - {"endMinuteTrend2",732}, + {"endMinuteTrend2",734}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"clusterMember2",528}, - {"upperThresholdValue",2251}, - {"forecastOrSingularVectorNumber",857}, + {"clusterMember2",530}, + {"upperThresholdValue",2257}, + {"forecastOrSingularVectorNumber",859}, {""}, {""}, - {"numberOfCodedValues",1353}, + {"numberOfCodedValues",1356}, {""}, {""}, {""}, {""}, {""}, - {"rdbtimeMonth",1730}, + {"rdbtimeMonth",1734}, {""}, {""}, - {"wrongPadding",2339}, - {"unpackedSubsetPrecision",2243}, + {"wrongPadding",2345}, + {"unpackedSubsetPrecision",2249}, {""}, {""}, - {"md5Headers",1236}, + {"md5Headers",1238}, {""}, - {"grib2LocalSectionNumber",888}, + {"grib2LocalSectionNumber",890}, {""}, {"beginHourTrend4",338}, {""}, - {"numberOfParallelsBetweenAPoleAndTheEquator",1406}, + {"numberOfParallelsBetweenAPoleAndTheEquator",1409}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"southEastLatitudeOfVerficationArea",2027}, + {"southEastLatitudeOfVerficationArea",2032}, {""}, {""}, {""}, - {"referenceForGroupWidths",1749}, + {"referenceForGroupWidths",1753}, {"Latin2InDegrees",117}, {""}, {""}, {""}, {"alternativeRowScanning",298}, - {"unitsECMF",2236}, + {"unitsECMF",2241}, {""}, - {"experimentVersionNumber",777}, + {"experimentVersionNumber",779}, {""}, {""}, - {"pentagonalResolutionParameterJ",1631}, + {"pentagonalResolutionParameterJ",1635}, {"HDF5str",82}, {""}, {""}, {""}, {"basicAngleOfTheInitialProductionDomain",330}, {""}, {""}, {""}, - {"cloudsTitle3Trend2",517}, + {"cloudsTitle3Trend2",519}, {""}, {""}, {""}, {"_numberOfValues",288}, {""}, {"NC",174}, - {"runwayDesignatorState2",1811}, - {"section7",1957}, - {"endDayTrend2",721}, - {"verticalVisibilityCoded",2293}, + {"runwayDesignatorState2",1815}, + {"section7",1961}, + {"endDayTrend2",723}, + {"verticalVisibilityCoded",2299}, {""}, {""}, {""}, {""}, {""}, - {"section8UniqueIdentifier",1964}, + {"section8UniqueIdentifier",1968}, {""}, {""}, {""}, {""}, {""}, - {"typeOfTimeIncrementBetweenSuccessiveFieldsUsedInTheStatisticalProcessing",2209}, + {"typeOfTimeIncrementBetweenSuccessiveFieldsUsedInTheStatisticalProcessing",2214}, {""}, {""}, - {"numberOfStepsUsedForClustering",1434}, + {"numberOfStepsUsedForClustering",1437}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"deletePV",669}, + {"deletePV",671}, {""}, - {"coordinate2End",577}, + {"coordinate2End",579}, {""}, {""}, {""}, - {"localLatitude2",1128}, + {"localLatitude2",1130}, {""}, - {"gaussianGridName",876}, + {"gaussianGridName",878}, {""}, - {"xCoordinateOfOriginOfSectorImage",2340}, + {"xCoordinateOfOriginOfSectorImage",2346}, {""}, {""}, {"P2",208}, - {"latitudeOfSubSatellitePoint",1062}, + {"latitudeOfSubSatellitePoint",1064}, {""}, {""}, {""}, {""}, - {"longitudeOfCentralPointInClusterDomain",1148}, + {"longitudeOfCentralPointInClusterDomain",1150}, {""}, - {"md5Section6",1244}, - {"intervalBetweenTimes",982}, + {"md5Section6",1246}, + {"intervalBetweenTimes",984}, {""}, - {"subLocalDefinition1",2083}, + {"subLocalDefinition1",2088}, {""}, - {"packedValues",1533}, - {"numberOfUsedTileAttributes",1442}, + {"packedValues",1536}, + {"numberOfUsedTileAttributes",1445}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"biFourierResolutionParameterM",354}, - {"cloudsTitle2",510}, + {"cloudsTitle2",512}, {""}, {""}, {""}, - {"section7Pointer",1959}, + {"section7Pointer",1963}, {""}, - {"referenceForGroupLengths",1748}, + {"referenceForGroupLengths",1752}, {""}, {""}, - {"numberOfUnexpandedDescriptors",1439}, + {"numberOfUnexpandedDescriptors",1442}, {"NrInRadiusOfEarth",197}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"offsetValuesBy",1496}, + {"offsetValuesBy",1499}, {"baseDateEPS",326}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"easternLongitudeOfClusterDomain",708}, - {"cloudsAbbreviation3Trend3",438}, + {"easternLongitudeOfClusterDomain",710}, + {"cloudsAbbreviation3Trend3",440}, {""}, {""}, - {"ls_labeling",1182}, + {"ls_labeling",1184}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"latitudeFirstInDegrees",1043}, + {"latitudeFirstInDegrees",1045}, {""}, - {"pentagonalResolutionParameterK",1632}, + {"pentagonalResolutionParameterK",1636}, {""}, {""}, {""}, {"Latin1InDegrees",115}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"tiggeSuiteID",2133}, + {"tiggeSuiteID",2138}, {""}, {""}, {"beginDayTrend2",332}, {""}, {"NRj",185}, {""}, - {"coordinate2Start",579}, - {"cloudsTitle3Trend1",516}, + {"coordinate2Start",581}, + {"cloudsTitle3Trend1",518}, {""}, {""}, {""}, - {"localTablesVersion",1138}, + {"localTablesVersion",1140}, {""}, {""}, - {"runwayDesignatorState1",1810}, + {"runwayDesignatorState1",1814}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"baseTimeEPS",328}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfPointsAlongAMeridian",1410}, + {"numberOfPointsAlongAMeridian",1413}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"biFourierResolutionSubSetParameterM",356}, {""}, {""}, {""}, {""}, {""}, - {"isRotatedGrid",997}, - {"sizeOfPostAuxiliaryArray",2018}, - {"endHourTrend3",728}, + {"isRotatedGrid",999}, + {"sizeOfPostAuxiliaryArray",2023}, + {"endHourTrend3",730}, {""}, {""}, {""}, {""}, {""}, - {"cloudsAbbreviation4Trend3",443}, + {"cloudsAbbreviation4Trend3",445}, {""}, {""}, {""}, {""}, - {"endMinuteTrend1",731}, - {"totalNumberOfClusters",2158}, + {"endMinuteTrend1",733}, + {"totalNumberOfClusters",2163}, {""}, - {"versionNumOfSharedHeaderMessageFormat",2283}, + {"versionNumOfSharedHeaderMessageFormat",2289}, {""}, {""}, {""}, {""}, - {"tablesLocalDir",2107}, - {"numberInMixedCoordinateDefinition",1333}, + {"tablesLocalDir",2112}, + {"numberInMixedCoordinateDefinition",1336}, {""}, - {"endGridDefinition",725}, - {"clusterMember1",526}, + {"endGridDefinition",727}, + {"clusterMember1",528}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"coordAveraging3",572}, + {"coordAveraging3",574}, {""}, {""}, {"Model_Identifier",166}, - {"longitudeOfReferencePointInDegrees",1161}, + {"longitudeOfReferencePointInDegrees",1163}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"dateOfIceFieldUsed",637}, + {"dateOfIceFieldUsed",639}, {""}, {""}, {""}, {""}, - {"numberOfPointsAlongSecondAxis",1413}, + {"numberOfPointsAlongSecondAxis",1416}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"clusteringDomain",538}, + {"clusteringDomain",540}, {""}, {""}, {""}, {""}, - {"numberOfClusterHighResolution",1350}, + {"numberOfClusterHighResolution",1353}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"NEAREST",177}, {""}, {""}, - {"runwayDepositCodeState3",1792}, + {"runwayDepositCodeState3",1796}, {""}, - {"md5Section10",1239}, + {"md5Section10",1241}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfBytesPerInteger",1346}, + {"numberOfBytesPerInteger",1349}, {""}, {""}, {""}, - {"cloudsTitle2Trend3",513}, + {"cloudsTitle2Trend3",515}, {""}, {""}, {""}, - {"cloudsAbbreviation3Trend4",439}, - {"produceLargeConstantFields",1687}, + {"cloudsAbbreviation3Trend4",441}, + {"produceLargeConstantFields",1691}, {""}, - {"numberOfGroups",1387}, + {"numberOfGroups",1390}, {""}, - {"numberOfCoefficientsOrValuesUsedToSpecifyFirstDimensionCoordinateFunction",1354}, - {"numberOfCoefficientsOrValuesUsedToSpecifySecondDimensionCoordinateFunction",1355}, + {"numberOfCoefficientsOrValuesUsedToSpecifyFirstDimensionCoordinateFunction",1357}, + {"numberOfCoefficientsOrValuesUsedToSpecifySecondDimensionCoordinateFunction",1358}, {""}, {""}, {""}, {""}, {""}, - {"localLatitude1",1127}, + {"localLatitude1",1129}, {""}, - {"visibilityTrend4",2302}, + {"visibilityTrend4",2308}, {""}, {""}, {""}, {""}, {"P1",207}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -5446,604 +5445,605 @@ static const struct grib_keys_hash wordlist[] = {"NB",173}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"lowerThresholdValue",1181}, + {"lowerThresholdValue",1183}, {""}, {""}, - {"longitudeOfSouthEastCornerOfArea",1162}, + {"longitudeOfSouthEastCornerOfArea",1164}, {""}, {""}, - {"definitionFilesVersion",665}, + {"definitionFilesVersion",667}, {""}, {""}, - {"integerPointValues",974}, + {"integerPointValues",976}, {""}, {""}, - {"subdivisionsOfBasicAngle",2093}, + {"subdivisionsOfBasicAngle",2098}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section2Length",1934}, + {"section2Length",1938}, {"Ensemble_Identifier",52}, {""}, {""}, {""}, {""}, {""}, - {"unpackedValues",2244}, + {"unpackedValues",2250}, {""}, {""}, - {"listMembersUsed3",1105}, + {"listMembersUsed3",1107}, {""}, - {"heightPressureEtcOfLevels",921}, - {""}, {""}, - {"latitudinalDirectionGridLength",1074}, - {"numberOfUsedSpatialTiles",1441}, + {"heightPressureEtcOfLevels",923}, + {""}, + {"shortNameLegacyECMF",2009}, + {"latitudinalDirectionGridLength",1076}, + {"numberOfUsedSpatialTiles",1444}, {""}, {""}, {""}, {""}, {""}, {""}, - {"endHourTrend4",729}, + {"endHourTrend4",731}, {""}, - {"cloudsTitle2Trend4",514}, + {"cloudsTitle2Trend4",516}, {""}, {""}, - {"runwayFrictionCoefficientState2",1831}, - {"cloudsAbbreviation4Trend4",444}, + {"runwayFrictionCoefficientState2",1835}, + {"cloudsAbbreviation4Trend4",446}, {""}, {"beginDayTrend1",331}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfSingularVectorsEvolved",1433}, + {"numberOfSingularVectorsEvolved",1436}, {""}, {""}, - {"subLocalDefinitionNumber2",2088}, + {"subLocalDefinitionNumber2",2093}, {""}, - {"numberOfPointsAlongAParallel",1411}, + {"numberOfPointsAlongAParallel",1414}, {""}, - {"offsetBBitmap",1469}, + {"offsetBBitmap",1472}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"presentWeather3Present",1671}, + {"presentWeather3Present",1675}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"qualityValueAssociatedWithParameter",1710}, + {"qualityValueAssociatedWithParameter",1714}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"P_INST",212}, {""}, {""}, {""}, - {"longitudeOfThePolePointInDegrees",1172}, - {"clusterMember6",532}, + {"longitudeOfThePolePointInDegrees",1174}, + {"clusterMember6",534}, {"Model_Additional_Information",165}, {""}, {""}, {""}, {""}, - {"localLongitude2",1131}, + {"localLongitude2",1133}, {""}, {""}, {""}, {"PUnset",210}, - {"gribTablesVersionNo",894}, - {"qualityControlIndicator",1709}, - {"runwayDepositCodeState4",1793}, + {"gribTablesVersionNo",896}, + {"qualityControlIndicator",1713}, + {"runwayDepositCodeState4",1797}, {""}, {""}, - {"numberOfContributingSpectralBands",1358}, + {"numberOfContributingSpectralBands",1361}, {""}, {""}, {""}, - {"numberOfGroupsOfDataValues",1388}, + {"numberOfGroupsOfDataValues",1391}, {""}, {""}, {""}, - {"cloudsCode1",485}, + {"cloudsCode1",487}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"baseDateOfThisLeg",327}, {""}, - {"section1Length",1931}, + {"section1Length",1935}, {""}, {""}, {"cavokOrVisibility",382}, {""}, {""}, {""}, - {"westernLongitudeOfClusterDomain",2307}, - {"yCoordinateOfSubSatellitePoint",2348}, + {"westernLongitudeOfClusterDomain",2313}, + {"yCoordinateOfSubSatellitePoint",2354}, {""}, {""}, - {"tiggeLocalVersion",2130}, + {"tiggeLocalVersion",2135}, {""}, - {"cloudsCode3",495}, + {"cloudsCode3",497}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfDataPointsExpected",1364}, + {"numberOfDataPointsExpected",1367}, {""}, {""}, {""}, - {"runwayFrictionCoefficientState1",1830}, + {"runwayFrictionCoefficientState1",1834}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"sizeOfLength",2016}, - {"numberOfControlForecastTube",1359}, + {"sizeOfLength",2021}, + {"numberOfControlForecastTube",1362}, {""}, {""}, - {"numberOfPointsAlongXAxisInCouplingArea",1417}, + {"numberOfPointsAlongXAxisInCouplingArea",1420}, {""}, - {"remarkPresent",1758}, + {"remarkPresent",1762}, {""}, {""}, {""}, {"baseTimeOfThisLeg",329}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"listMembersMissing3",1101}, - {"templatesMasterDir",2117}, + {"listMembersMissing3",1103}, + {"templatesMasterDir",2122}, {""}, {""}, - {"section11Pointer",1929}, + {"section11Pointer",1933}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsAbbreviation2",430}, + {"cloudsAbbreviation2",432}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"variationOfVisibilityTrend3",2273}, + {"variationOfVisibilityTrend3",2279}, {""}, - {"cloudsTitle4Trend2",522}, - {"cloudsBaseCoded1Trend2",467}, + {"cloudsTitle4Trend2",524}, + {"cloudsBaseCoded1Trend2",469}, {""}, - {"efas_post_proc",714}, + {"efas_post_proc",716}, {"METAR",154}, {""}, {""}, {""}, {""}, {""}, - {"getNumberOfValues",883}, + {"getNumberOfValues",885}, {""}, - {"firstDimensionPhysicalSignificance",841}, - {"cfVarNameECMF",407}, + {"firstDimensionPhysicalSignificance",843}, + {"cfVarNameECMF",408}, {""}, - {"radiusOfTheEarth",1718}, + {"radiusOfTheEarth",1722}, {""}, {""}, {""}, - {"kindOfProduct",1030}, + {"kindOfProduct",1032}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"commonBlock",550}, + {"commonBlock",552}, {""}, {""}, - {"section6Length",1954}, + {"section6Length",1958}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBase1",445}, + {"cloudsBase1",447}, {""}, {""}, {""}, {""}, - {"section5Pointer",1951}, - {"md5Section7",1245}, + {"section5Pointer",1955}, + {"md5Section7",1247}, {""}, {""}, {""}, - {"offsetICEFieldsUsed",1482}, + {"offsetICEFieldsUsed",1485}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"variationOfVisibilityDirectionTrend3",2269}, + {"variationOfVisibilityDirectionTrend3",2275}, {""}, - {"reservedSection2",1769}, + {"reservedSection2",1773}, {""}, {""}, {""}, {""}, - {"cloudsBase3",455}, - {"subLocalDefinitionLength2",2086}, + {"cloudsBase3",457}, + {"subLocalDefinitionLength2",2091}, {""}, {""}, - {"scaleFactorOfEarthMajorAxis",1848}, + {"scaleFactorOfEarthMajorAxis",1852}, {""}, {""}, - {"scaleFactorOfEarthMinorAxis",1849}, - {"numberOfBitsForScaledGroupLengths",1341}, + {"scaleFactorOfEarthMinorAxis",1853}, + {"numberOfBitsForScaledGroupLengths",1344}, {""}, {""}, {""}, {""}, {""}, {""}, - {"offsetSection7",1492}, + {"offsetSection7",1495}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"subLocalDefinitionNumber1",2087}, - {"variationOfVisibilityTrend4",2274}, + {"subLocalDefinitionNumber1",2092}, + {"variationOfVisibilityTrend4",2280}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"verificationYear",2278}, + {"verificationYear",2284}, {""}, {""}, {""}, - {"cloudsBaseCoded1",465}, - {"patch_precip_fp",1630}, + {"cloudsBaseCoded1",467}, + {"patch_precip_fp",1634}, {""}, {""}, {""}, {""}, {""}, - {"scaledValueOfLowerLimit",1879}, + {"scaledValueOfLowerLimit",1883}, {""}, - {"scanningMode6",1895}, + {"scanningMode6",1899}, {""}, - {"inputShortDelayedDescriptorReplicationFactor",970}, + {"inputShortDelayedDescriptorReplicationFactor",972}, {""}, {""}, - {"cloudsTitle4Trend1",521}, - {"cloudsBaseCoded1Trend1",466}, + {"cloudsTitle4Trend1",523}, + {"cloudsBaseCoded1Trend1",468}, {""}, {""}, {""}, {""}, {""}, {""}, - {"localLongitude1",1130}, + {"localLongitude1",1132}, {""}, {""}, {""}, {""}, - {"cloudsBaseCoded3",475}, + {"cloudsBaseCoded3",477}, {""}, - {"offsetAfterData",1466}, + {"offsetAfterData",1469}, {""}, - {"default_step_units",664}, + {"default_step_units",666}, {""}, {"GDSPresent",69}, - {"countOfICEFieldsUsed",606}, + {"countOfICEFieldsUsed",608}, {""}, {""}, {""}, {""}, {""}, {""}, - {"variationOfVisibilityDirectionTrend4",2270}, - {"cloudsBaseCoded3Trend3",478}, + {"variationOfVisibilityDirectionTrend4",2276}, + {"cloudsBaseCoded3Trend3",480}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"resolutionAndComponentFlags3",1775}, + {"resolutionAndComponentFlags3",1779}, {""}, {""}, {""}, {""}, {""}, {""}, - {"listMembersMissing4",1102}, + {"listMembersMissing4",1104}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"localTablesVersionNumber",1139}, + {"localTablesVersionNumber",1141}, {""}, {""}, {""}, {""}, {"cfNameECMF",405}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"iDirectionIncrementGiven",938}, + {"iDirectionIncrementGiven",940}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"physicalFlag2",1641}, + {"physicalFlag2",1645}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"localFlagLatestVersion",1124}, + {"localFlagLatestVersion",1126}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsCode1Trend3",488}, - {"scaleFactorOfMinorAxisOfOblateSpheroidEarth",1857}, + {"cloudsCode1Trend3",490}, + {"scaleFactorOfMinorAxisOfOblateSpheroidEarth",1861}, {""}, {""}, {""}, {""}, {""}, - {"extractDateTimeDayStart",797}, + {"extractDateTimeDayStart",799}, {""}, - {"section11Length",1928}, + {"section11Length",1932}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsAbbreviation1",425}, - {"offsetBeforeBitmap",1473}, + {"cloudsAbbreviation1",427}, + {"offsetBeforeBitmap",1476}, {""}, - {"cloudsBaseCoded3Trend4",479}, - {"latitudeOfSubSatellitePointInDegrees",1063}, + {"cloudsBaseCoded3Trend4",481}, + {"latitudeOfSubSatellitePointInDegrees",1065}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfPointsAlongFirstAxis",1412}, + {"numberOfPointsAlongFirstAxis",1415}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"Sub-Experiment_Identifier",228}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"meanRVR3",1252}, + {"meanRVR3",1254}, {""}, {""}, {""}, - {"expandedCrex_scales",766}, + {"expandedCrex_scales",768}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"dateOfModelVersion",638}, + {"dateOfModelVersion",640}, {""}, - {"theHindcastMarsStream",2118}, + {"theHindcastMarsStream",2123}, {""}, {""}, {""}, - {"runwayDepthOfDepositCodeState3",1800}, + {"runwayDepthOfDepositCodeState3",1804}, {""}, {""}, - {"timeOfModelVersion",2146}, + {"timeOfModelVersion",2151}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsCode1Trend4",489}, + {"cloudsCode1Trend4",491}, {""}, {""}, {""}, - {"endMonthTrend2",736}, + {"endMonthTrend2",738}, {""}, {""}, - {"subLocalDefinitionLength1",2085}, + {"subLocalDefinitionLength1",2090}, {""}, - {"scaleFactorOfCentralWaveNumber",1845}, + {"scaleFactorOfCentralWaveNumber",1849}, {""}, {""}, {""}, {""}, {""}, {"_leg_number",287}, {""}, {""}, {""}, - {"numberOfHorizontalPoints",1389}, + {"numberOfHorizontalPoints",1392}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"beginMonthTrend1",343}, {""}, {""}, {""}, - {"expandedCrex_units",767}, + {"expandedCrex_units",769}, {""}, {""}, {""}, {""}, {""}, {""}, - {"resolutionAndComponentFlags4",1776}, + {"resolutionAndComponentFlags4",1780}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsAbbreviation2Trend3",433}, - {"longitudeLastInDegrees",1147}, + {"cloudsAbbreviation2Trend3",435}, + {"longitudeLastInDegrees",1149}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBase1Trend3",448}, + {"cloudsBase1Trend3",450}, {"beginMonthTrend3",345}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"offsetFromOriginToInnerBound",1480}, + {"offsetFromOriginToInnerBound",1483}, {""}, - {"yearOfModelVersion",2359}, + {"yearOfModelVersion",2365}, {""}, {""}, {""}, - {"localUsePresent",1140}, + {"localUsePresent",1142}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"spacingOfBinsAlongRadials",2039}, - {"mask",1219}, + {"spacingOfBinsAlongRadials",2044}, + {"mask",1221}, {""}, {""}, {""}, {""}, {""}, {""}, - {"marsClass2",1190}, + {"marsClass2",1192}, {""}, {""}, {""}, {""}, - {"runwayDepthOfDepositCodeState4",1801}, + {"runwayDepthOfDepositCodeState4",1805}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"ECMWF",46}, {""}, {""}, {""}, {""}, {""}, {""}, - {"latitudeOfThePolePoint",1066}, + {"latitudeOfThePolePoint",1068}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"pack",1532}, + {"pack",1535}, {""}, {""}, {""}, {""}, - {"dayOfModelVersion",648}, + {"dayOfModelVersion",650}, {""}, {"DayOfModelVersion",30}, {""}, {""}, {""}, {""}, - {"section2Used",1938}, + {"section2Used",1942}, {""}, - {"xCoordinateOfSubSatellitePoint",2341}, - {"section3UniqueIdentifier",1943}, + {"xCoordinateOfSubSatellitePoint",2347}, + {"section3UniqueIdentifier",1947}, {""}, {""}, - {"listMembersUsed4",1106}, - {"physicalFlag1",1640}, - {"deleteLocalDefinition",668}, + {"listMembersUsed4",1108}, + {"physicalFlag1",1644}, + {"deleteLocalDefinition",670}, {""}, {""}, - {"cloudsBase1Trend4",449}, + {"cloudsBase1Trend4",451}, {""}, {""}, - {"hourOfModelVersion",932}, + {"hourOfModelVersion",934}, {""}, {""}, {"Date_E3",28}, {""}, {""}, - {"meanRVR4",1253}, + {"meanRVR4",1255}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsAbbreviation1Trend3",428}, + {"cloudsAbbreviation1Trend3",430}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"timeUnitFlag",2150}, + {"timeUnitFlag",2155}, {""}, {""}, - {"unpack",2241}, + {"unpack",2247}, {""}, {""}, {""}, {""}, - {"physicalMeaningOfVerticalCoordinate",1642}, + {"physicalMeaningOfVerticalCoordinate",1646}, {""}, {""}, {""}, {""}, {""}, {"WRAP",260}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"rdb_key",1724}, + {"rdb_key",1728}, {""}, {""}, {""}, {""}, - {"section5",1949}, + {"section5",1953}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"DjGiven",36}, - {"cloudsTitle2Trend2",512}, - {"numberOfSingularVectorsComputed",1432}, + {"cloudsTitle2Trend2",514}, + {"numberOfSingularVectorsComputed",1435}, {""}, - {"section4UniqueIdentifier",1948}, - {"cloudsAbbreviation2Trend4",434}, + {"section4UniqueIdentifier",1952}, + {"cloudsAbbreviation2Trend4",436}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"tempPressureUnits",2113}, + {"tempPressureUnits",2118}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"endMonthTrend1",735}, + {"endMonthTrend1",737}, {""}, - {"reflectivityCalibrationConstant",1757}, + {"reflectivityCalibrationConstant",1761}, {""}, {""}, {""}, {""}, - {"md5Section1",1238}, + {"md5Section1",1240}, {""}, - {"latitudeOfLastGridPoint",1052}, + {"latitudeOfLastGridPoint",1054}, {""}, - {"cloudsCode4",500}, + {"cloudsCode4",502}, {""}, {""}, {""}, - {"scaleFactorOfUpperLimit",1865}, + {"scaleFactorOfUpperLimit",1869}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section7Length",1958}, + {"section7Length",1962}, {""}, {""}, - {"hoursAfterReferenceTimeOfDataCutoff",935}, + {"hoursAfterReferenceTimeOfDataCutoff",937}, {""}, {""}, {""}, {""}, {""}, - {"md5Section3",1241}, + {"md5Section3",1243}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"pentagonalResolutionParameterM",1633}, + {"pentagonalResolutionParameterM",1637}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayFrictionCodeValueState3",1824}, + {"runwayFrictionCodeValueState3",1828}, {""}, - {"generalExtended2ordr",878}, + {"generalExtended2ordr",880}, {""}, {""}, {"ITERATOR",92}, - {"visibilityInKilometresTrend2",2296}, + {"visibilityInKilometresTrend2",2302}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"scaledValueOfLengthOfSemiMinorAxis",1878}, + {"scaledValueOfLengthOfSemiMinorAxis",1882}, {""}, - {"marsClass1",1189}, + {"marsClass1",1191}, {""}, {"Date_E4",29}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section_2",1984}, + {"section_2",1988}, {""}, {""}, {""}, {""}, {""}, - {"cloudsTitle2Trend1",511}, + {"cloudsTitle2Trend1",513}, {""}, {""}, {""}, - {"cloudsAbbreviation1Trend4",429}, + {"cloudsAbbreviation1Trend4",431}, {""}, {""}, - {"typeOfPacking",2199}, + {"typeOfPacking",2204}, {""}, {""}, - {"experimentVersionNumberOfAnalysis",780}, - {"presentWeather2Present",1666}, + {"experimentVersionNumberOfAnalysis",782}, + {"presentWeather2Present",1670}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"offsetBeforePL",1475}, + {"offsetBeforePL",1478}, {"Product_Identifier",215}, {""}, - {"numberOfRadarSitesUsed",1423}, + {"numberOfRadarSitesUsed",1426}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"md5Section5",1243}, + {"md5Section5",1245}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"horizontalDomainTemplate",926}, - {"cloudsBaseCoded4Trend3",483}, + {"horizontalDomainTemplate",928}, + {"cloudsBaseCoded4Trend3",485}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBase4",460}, + {"cloudsBase4",462}, {""}, - {"runwayFrictionCodeValueState4",1825}, + {"runwayFrictionCodeValueState4",1829}, {""}, {"DELETE",25}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"ceilingAndVisibilityOK",388}, - {"offsetToEndOf4DvarWindow",1495}, + {"offsetToEndOf4DvarWindow",1498}, {""}, - {"section_02",1973}, + {"section_02",1977}, {""}, - {"scaleFactorOfLengthOfSemiMajorAxis",1853}, + {"scaleFactorOfLengthOfSemiMajorAxis",1857}, {""}, {""}, {""}, - {"latitudeOfReferencePoint",1055}, + {"latitudeOfReferencePoint",1057}, {""}, {""}, - {"inputOverriddenReferenceValues",968}, + {"inputOverriddenReferenceValues",970}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"extractAreaSouthLatitude",793}, + {"extractAreaSouthLatitude",795}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"offsetSection11",1486}, - {"uuidOfVGrid",2259}, + {"offsetSection11",1489}, + {"uuidOfVGrid",2265}, {""}, {""}, {""}, - {"typeOfProcessedData",2202}, + {"typeOfProcessedData",2207}, {""}, {""}, - {"cloudsBaseCoded4",480}, + {"cloudsBaseCoded4",482}, {"NC2",176}, {""}, {""}, {""}, {""}, - {"presentWeather1Present",1661}, + {"presentWeather1Present",1665}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"YR",275}, - {"cloudsBaseCoded4Trend4",484}, - {"numberOfPointsAlongTheXAxis",1414}, + {"cloudsBaseCoded4Trend4",486}, + {"numberOfPointsAlongTheXAxis",1417}, {""}, {""}, {""}, {""}, - {"expandedCrex_widths",768}, + {"expandedCrex_widths",770}, {""}, {""}, - {"laplacianScalingFactorUnset",1038}, + {"laplacianScalingFactorUnset",1040}, {""}, - {"rootGroupSymbolTableEntry",1781}, + {"rootGroupSymbolTableEntry",1785}, {""}, {""}, {""}, - {"variationOfVisibilityTrend2",2272}, + {"variationOfVisibilityTrend2",2278}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"paramIdECMF",1609}, + {"paramIdECMF",1612}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"codedNumberOfGroups",546}, + {"codedNumberOfGroups",548}, {""}, {""}, - {"runwayDesignatorRVR3",1808}, + {"runwayDesignatorRVR3",1812}, {"beginHourTrend2",336}, {""}, {""}, {""}, - {"typeOfGeneratingProcess",2191}, + {"typeOfGeneratingProcess",2196}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"variationOfVisibilityDirectionTrend2",2268}, + {"variationOfVisibilityDirectionTrend2",2274}, {""}, {""}, {""}, {""}, {""}, - {"visibilityInKilometresTrend1",2295}, + {"visibilityInKilometresTrend1",2301}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"firstLatitudeInDegrees",843}, + {"firstLatitudeInDegrees",845}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"scaledValueOfPrimeMeridianOffset",1882}, + {"scaledValueOfPrimeMeridianOffset",1886}, {""}, - {"section_1",1981}, - {"disableGrib1LocalSection",684}, + {"section_1",1985}, + {"disableGrib1LocalSection",686}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"CLNOMA",24}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"variationOfVisibilityTrend1",2271}, + {"variationOfVisibilityTrend1",2277}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"totalNumberOfGridPoints",2163}, + {"totalNumberOfGridPoints",2168}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBaseCoded3Trend2",477}, + {"cloudsBaseCoded3Trend2",479}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section_01",1972}, + {"section_01",1976}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"windUnitsTrend3",2332}, - {"visibilityTrend2",2300}, + {"windUnitsTrend3",2338}, + {"visibilityTrend2",2306}, {""}, {""}, {""}, - {"clusterMember7",533}, + {"clusterMember7",535}, {""}, {""}, {""}, {""}, {""}, {""}, - {"iDirectionIncrementGridLength",939}, - {"variationOfVisibilityDirectionTrend1",2267}, + {"iDirectionIncrementGridLength",941}, + {"variationOfVisibilityDirectionTrend1",2273}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"beginMonthTrend4",346}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"latitudeOfThePoleOfStretching",1065}, + {"latitudeOfThePoleOfStretching",1067}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"ZLMULT",283}, {""}, {""}, {""}, {""}, {""}, - {"cloudsCode1Trend2",487}, + {"cloudsCode1Trend2",489}, {""}, {""}, {""}, {""}, {""}, {""}, {"NC1",175}, {""}, {""}, {""}, {""}, - {"runwayDesignatorRVR4",1809}, + {"runwayDesignatorRVR4",1813}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"checkInternalVersion",418}, + {"checkInternalVersion",420}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_local40_1",1597}, + {"padding_local40_1",1600}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"uuidOfHGrid",2258}, - {"cloudsBaseCoded3Trend1",476}, + {"uuidOfHGrid",2264}, + {"cloudsBaseCoded3Trend1",478}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"unusedBitsInBitmap",2246}, + {"unusedBitsInBitmap",2252}, {"beginHourTrend1",335}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayDepthOfDepositCodeState2",1799}, + {"runwayDepthOfDepositCodeState2",1803}, {""}, - {"section5Length",1950}, + {"section5Length",1954}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section_6",1988}, + {"section_6",1992}, {""}, - {"tsectionNumber5",2177}, + {"tsectionNumber5",2182}, {""}, - {"observationDiagnostic",1454}, - {"offsetSection5",1490}, - {"latitudeOfTheSouthernPoleOfProjection",1068}, + {"observationDiagnostic",1457}, + {"offsetSection5",1493}, + {"latitudeOfTheSouthernPoleOfProjection",1070}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsCode1Trend1",486}, + {"cloudsCode1Trend1",488}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsAbbreviation3Trend2",437}, + {"cloudsAbbreviation3Trend2",439}, {""}, {""}, {""}, {""}, {""}, - {"windUnitsTrend4",2333}, - {"cloudsBase1Trend2",447}, + {"windUnitsTrend4",2339}, + {"cloudsBase1Trend2",449}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsCode3Trend3",498}, - {"latitudeOfThePolePointInDegrees",1067}, + {"cloudsCode3Trend3",500}, + {"latitudeOfThePolePointInDegrees",1069}, {""}, {""}, {""}, {""}, - {"scaledValueOfMajorAxisOfOblateSpheroidEarth",1880}, + {"scaledValueOfMajorAxisOfOblateSpheroidEarth",1884}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"northLatitudeOfDomainOfTubing",1321}, + {"northLatitudeOfDomainOfTubing",1324}, {""}, {""}, {""}, {""}, {""}, - {"section_06",1977}, - {"longitudeOfSouthernPole",1163}, + {"section_06",1981}, + {"longitudeOfSouthernPole",1165}, {""}, {""}, {""}, {""}, - {"skipExtraKeyAttributes",2022}, + {"skipExtraKeyAttributes",2027}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"uvRelativeToGrid",2260}, + {"uvRelativeToGrid",2266}, {""}, {""}, {""}, {""}, {""}, {""}, - {"scanningMode7",1896}, + {"scanningMode7",1900}, {""}, {""}, {""}, - {"monthlyVerificationYear",1300}, - {"cloudsBaseCoded2Trend3",473}, - {"runwayDepthOfDepositCodeState1",1798}, + {"monthlyVerificationYear",1302}, + {"cloudsBaseCoded2Trend3",475}, + {"runwayDepthOfDepositCodeState1",1802}, {""}, {""}, - {"md5Section4",1242}, + {"md5Section4",1244}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"endHourTrend2",727}, + {"endHourTrend2",729}, {""}, {""}, {""}, {""}, {""}, - {"cloudsAbbreviation4Trend2",442}, + {"cloudsAbbreviation4Trend2",444}, {""}, {""}, {""}, {""}, - {"southLatitudeOfDomainOfTubing",2031}, + {"southLatitudeOfDomainOfTubing",2036}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsCode3Trend4",499}, + {"cloudsCode3Trend4",501}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"coordAveraging2",571}, - {"numberOfMissingValues",1399}, + {"coordAveraging2",573}, + {"numberOfMissingValues",1402}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBase1Trend1",446}, + {"cloudsBase1Trend1",448}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"eastLongitudeOfDomainOfTubing",707}, + {"eastLongitudeOfDomainOfTubing",709}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBase3Trend3",458}, + {"cloudsBase3Trend3",460}, {""}, {""}, - {"numberOfGridInReference",1385}, + {"numberOfGridInReference",1388}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBaseCoded2Trend4",474}, - {"typeOfLevelECMF",2197}, + {"cloudsBaseCoded2Trend4",476}, + {"typeOfLevelECMF",2202}, {""}, - {"runwayDepositCodeState2",1791}, + {"runwayDepositCodeState2",1795}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"ZLBASE",282}, {""}, {""}, {""}, {""}, - {"runwayDepthOfDepositState3",1804}, + {"runwayDepthOfDepositState3",1808}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"sizeOfPostAuxiliaryArrayPlusOne",2019}, + {"sizeOfPostAuxiliaryArrayPlusOne",2024}, {""}, - {"legacyGaussSubarea",1080}, + {"legacyGaussSubarea",1082}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6052,279 +6052,283 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"weightAppliedToClimateMonth1",2304}, + {"weightAppliedToClimateMonth1",2310}, {""}, - {"superblockExtensionAddress",2095}, + {"superblockExtensionAddress",2100}, {""}, - {"cloudsBase3Trend4",459}, + {"cloudsBase3Trend4",461}, {""}, - {"cloudsAbbreviation3Trend1",436}, + {"cloudsAbbreviation3Trend1",438}, {"altitudeOfTheCameraFromTheEarthsCentreMeasuredInUnitsOfTheEarthsRadius",299}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayFrictionCodeValueState2",1823}, + {"runwayFrictionCodeValueState2",1827}, {""}, {""}, {""}, {""}, {"addEmptySection2",291}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayFrictionCoefficientCodeState3",1828}, + {"runwayFrictionCoefficientCodeState3",1832}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"setToMissingIfOutOfRange",1999}, + {"setToMissingIfOutOfRange",2003}, {""}, {""}, {""}, {""}, {""}, {""}, - {"latitudeOfReferencePointInDegrees",1056}, - {"section6UniqueIdentifier",1956}, + {"latitudeOfReferencePointInDegrees",1058}, + {"section6UniqueIdentifier",1960}, {""}, {""}, {""}, - {"endHourTrend1",726}, + {"endHourTrend1",728}, {""}, {""}, - {"numberOfPressureLevelsUsedForClustering",1422}, + {"numberOfPressureLevelsUsedForClustering",1425}, {""}, {""}, - {"cloudsAbbreviation4Trend1",441}, + {"cloudsAbbreviation4Trend1",443}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"latitudeOfLastGridPointInDegrees",1053}, + {"latitudeOfLastGridPointInDegrees",1055}, {""}, {""}, - {"cloudsBaseCoded4Trend2",482}, + {"cloudsBaseCoded4Trend2",484}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayDepthOfDepositState4",1805}, + {"runwayDepthOfDepositState4",1809}, {""}, {""}, {""}, {""}, - {"coordAveraging1",570}, + {"coordAveraging1",572}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayFrictionCoefficientCodeState4",1829}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"runwayFrictionCoefficientCodeState4",1833}, + {""}, {""}, {""}, {""}, {""}, + {"unitsLegacyECMF",2243}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, - {"runwayFrictionCodeValueState1",1822}, + {""}, {""}, {""}, {""}, {""}, + {"runwayFrictionCodeValueState1",1826}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_sec1_loc",1600}, + {"padding_sec1_loc",1603}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayDepositCodeState1",1790}, + {"runwayDepositCodeState1",1794}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberInHorizontalCoordinates",1332}, + {"numberInHorizontalCoordinates",1335}, {""}, {""}, - {"listMembersMissing2",1100}, + {"listMembersMissing2",1102}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"beginYearTrend3",349}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBaseCoded4Trend1",481}, + {"cloudsBaseCoded4Trend1",483}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"extractDateTimeDayEnd",795}, + {"extractDateTimeDayEnd",797}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"westLongitudeOfDomainOfTubing",2306}, + {"westLongitudeOfDomainOfTubing",2312}, {""}, {""}, - {"horizontalDomainTemplateNumber",927}, + {"horizontalDomainTemplateNumber",929}, {""}, - {"listMembersUsed2",1104}, + {"listMembersUsed2",1106}, {""}, {""}, {""}, {""}, {""}, - {"endMark",730}, + {"endMark",732}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"oneMinuteMeanMaximumRVR3",1503}, + {"oneMinuteMeanMaximumRVR3",1506}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, - {"cloudsCode4Trend3",503}, + {""}, + {"paramIdLegacyECMF",1613}, + {""}, + {"cloudsCode4Trend3",505}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"horizontalDimensionProcessed",925}, + {"horizontalDimensionProcessed",927}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"YRInMetres",276}, {""}, {""}, - {"resolutionAndComponentFlags2",1774}, + {"resolutionAndComponentFlags2",1778}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"beginYearTrend4",350}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsCode2",490}, + {"cloudsCode2",492}, {""}, {""}, {""}, - {"cloudsCode4Trend4",504}, + {"cloudsCode4Trend4",506}, {""}, {"Minute_E3",159}, - {"flagForNormalOrStaggeredGrid",850}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"flagForNormalOrStaggeredGrid",852}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfPointsUsed",1421}, + {"cfVarNameLegacyECMF",409}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"numberOfPointsUsed",1424}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBase4Trend3",463}, + {"cloudsBase4Trend3",465}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayExtentOfContaminationState3",1820}, + {"runwayExtentOfContaminationState3",1824}, {""}, {""}, {""}, {""}, {""}, - {"meanRVR2",1251}, + {"meanRVR2",1253}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"oneMinuteMeanMaximumRVR4",1504}, + {"oneMinuteMeanMaximumRVR4",1507}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"g1conceptsLocalDirAll",873}, + {"g1conceptsLocalDirAll",875}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"lBB",1033}, + {"lBB",1035}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBase2",450}, + {"cloudsBase2",452}, {""}, {""}, {""}, - {"cloudsBase4Trend4",464}, + {"cloudsBase4Trend4",466}, {""}, {""}, {""}, {""}, {""}, {""}, - {"scaledValueOfEarthMajorAxis",1872}, + {"scaledValueOfEarthMajorAxis",1876}, {""}, {""}, - {"scaledValueOfEarthMinorAxis",1873}, - {"cloudsAbbreviation2Trend2",432}, + {"scaledValueOfEarthMinorAxis",1877}, + {"cloudsAbbreviation2Trend2",434}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayExtentOfContaminationState4",1821}, - {"numberOfSecondOrderPackedValues",1430}, + {"runwayExtentOfContaminationState4",1825}, + {"numberOfSecondOrderPackedValues",1433}, {""}, {""}, {""}, {""}, {""}, - {"cloudsCode3Trend2",497}, + {"cloudsCode3Trend2",499}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"endYearTrend3",750}, + {"endYearTrend3",752}, {""}, {""}, {""}, {"Minute_E4",160}, {""}, - {"offsetBSection6",1471}, + {"offsetBSection6",1474}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"resolutionAndComponentFlags1",1773}, + {"resolutionAndComponentFlags1",1777}, {""}, - {"cloudsBaseCoded2",470}, + {"cloudsBaseCoded2",472}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"clusterMember5",531}, - {"cloudsBaseCoded2Trend2",472}, + {"clusterMember5",533}, + {"cloudsBaseCoded2Trend2",474}, {""}, - {"section7UniqueIdentifier",1960}, + {"section7UniqueIdentifier",1964}, {""}, - {"radiusOfClusterDomain",1717}, + {"radiusOfClusterDomain",1721}, {""}, {""}, - {"latitudeOfSouthEastCornerOfArea",1057}, + {"latitudeOfSouthEastCornerOfArea",1059}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"Date_E2",27}, {""}, - {"countOfGroupLengths",605}, + {"countOfGroupLengths",607}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsAbbreviation1Trend2",427}, - {"windGustTrend3",2321}, + {"cloudsAbbreviation1Trend2",429}, + {"windGustTrend3",2327}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsCode3Trend1",496}, + {"cloudsCode3Trend1",498}, {""}, {""}, {""}, {""}, {""}, - {"scaledValueOfMinorAxisOfOblateSpheroidEarth",1881}, + {"scaledValueOfMinorAxisOfOblateSpheroidEarth",1885}, {""}, {""}, {""}, {""}, {""}, - {"pastTendencyRVR1",1626}, + {"pastTendencyRVR1",1630}, {""}, {""}, {""}, {""}, - {"cloudsBase3Trend2",457}, + {"cloudsBase3Trend2",459}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"presentWeather3PresentTrend3",1674}, + {"presentWeather3PresentTrend3",1678}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"meanRVR1",1250}, + {"meanRVR1",1252}, {""}, {""}, {""}, - {"pastTendencyRVR3",1628}, + {"pastTendencyRVR3",1632}, {""}, {""}, - {"longitudeOfSouthernPoleInDegrees",1164}, + {"longitudeOfSouthernPoleInDegrees",1166}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBaseCoded2Trend1",471}, - {"md5GridSection",1235}, + {"cloudsBaseCoded2Trend1",473}, + {"md5GridSection",1237}, {""}, {""}, {""}, {""}, {""}, - {"jDirectionIncrementGiven",1019}, + {"jDirectionIncrementGiven",1021}, {""}, {""}, {""}, {""}, {""}, {"Total_Number_Members_Used",253}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"endYearTrend4",751}, + {"endYearTrend4",753}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"Ensemble_Combination_Number",51}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"scaledValueOfCentralWaveNumber",1869}, + {"scaledValueOfCentralWaveNumber",1873}, {""}, {""}, {""}, {""}, - {"cloudsAbbreviation2Trend1",431}, + {"cloudsAbbreviation2Trend1",433}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfUsefulPointsAlongXAxis",1443}, + {"numberOfUsefulPointsAlongXAxis",1446}, {""}, {""}, {""}, {""}, - {"section_7",1989}, + {"section_7",1993}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"probProductDefinition",1683}, + {"probProductDefinition",1687}, {"beginMonthTrend2",344}, - {"cloudsBase3Trend1",456}, + {"cloudsBase3Trend1",458}, {""}, {""}, {""}, {""}, - {"runwayFrictionCoefficientCodeState2",1827}, + {"runwayFrictionCoefficientCodeState2",1831}, {""}, {""}, - {"cloudsCode2Trend3",493}, + {"cloudsCode2Trend3",495}, {""}, {""}, {""}, - {"resolutionAndComponentFlags6",1777}, + {"resolutionAndComponentFlags6",1781}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"Total_Number_Members_Possible",252}, {""}, {""}, {""}, {""}, - {"windGustTrend4",2322}, + {"windGustTrend4",2328}, {""}, {""}, {""}, {""}, {""}, - {"scanningMode5",1894}, + {"scanningMode5",1898}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"extractAreaLongitudeRank",791}, + {"extractAreaLongitudeRank",793}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section_07",1978}, + {"section_07",1982}, {""}, {""}, {""}, - {"presentWeather3PresentTrend4",1675}, + {"presentWeather3PresentTrend4",1679}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"RENAME",216}, {""}, {""}, {""}, {""}, {""}, - {"cloudsAbbreviation1Trend1",426}, + {"cloudsAbbreviation1Trend1",428}, {""}, {""}, - {"missingValueManagementUsed",1279}, + {"missingValueManagementUsed",1281}, {""}, {""}, - {"cloudsCode2Trend4",494}, + {"cloudsCode2Trend4",496}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayFrictionCoefficientCodeState1",1826}, + {"runwayFrictionCoefficientCodeState1",1830}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"Y2",273}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBase2Trend3",453}, + {"cloudsBase2Trend3",455}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"ccsdsCompressionOptionsMask",385}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"oneMinuteMeanMinimumRVR3",1507}, + {"oneMinuteMeanMinimumRVR3",1510}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6332,45 +6336,46 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"scaledValueOfUpperLimit",1889}, + {"scaledValueOfUpperLimit",1893}, {""}, - {"runwayDesignatorRVR2",1807}, + {"runwayDesignatorRVR2",1811}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"md5Section2",1240}, + {"md5Section2",1242}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBase2Trend4",454}, + {"cloudsBase2Trend4",456}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfBitsContainingEachPackedValue",1340}, + {"numberOfBitsContainingEachPackedValue",1343}, + {""}, {""}, {""}, + {"cfNameLegacyECMF",406}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {"*********_EXTRA_DATA_***************",4}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"HourOfModelVersion",83}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsCode4Trend2",502}, + {"cloudsCode4Trend2",504}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"mixedCoordinateDefinition",1281}, + {"mixedCoordinateDefinition",1283}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"Total_Number_Members_Missing",251}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section5UniqueIdentifier",1952}, + {"section5UniqueIdentifier",1956}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfBitsUsedForTheScaledGroupLengths",1343}, + {"numberOfBitsUsedForTheScaledGroupLengths",1346}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"windUnitsTrend2",2331}, + {"windUnitsTrend2",2337}, {""}, {""}, {""}, - {"oneMinuteMeanMinimumRVR4",1508}, + {"oneMinuteMeanMinimumRVR4",1511}, {""}, {""}, - {"numberOfReforecastYearsInModelClimate",1425}, + {"numberOfReforecastYearsInModelClimate",1428}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"scaledValueOfLengthOfSemiMajorAxis",1877}, + {"scaledValueOfLengthOfSemiMajorAxis",1881}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"Y1",271}, @@ -6379,21 +6384,21 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsCode4Trend1",501}, + {"cloudsCode4Trend1",503}, {""}, {""}, {"UseEcmfConventions",254}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBase4Trend2",462}, + {"cloudsBase4Trend2",464}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"Hour_E3",85}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayExtentOfContaminationState2",1819}, + {"runwayExtentOfContaminationState2",1823}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayDesignatorRVR1",1806}, + {"runwayDesignatorRVR1",1810}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6404,20 +6409,20 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"pastTendencyRVR4",1629}, + {"pastTendencyRVR4",1633}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBase4Trend1",461}, + {"cloudsBase4Trend1",463}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayExtentOfContaminationState1",1818}, + {"runwayExtentOfContaminationState1",1822}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"sourceSinkChemicalPhysicalProcess",2025}, + {"sourceSinkChemicalPhysicalProcess",2030}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"windUnitsTrend1",2330}, + {"windUnitsTrend1",2336}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6430,25 +6435,25 @@ static const struct grib_keys_hash wordlist[] = {""}, {"FMULTM",67}, {""}, {""}, {""}, {""}, {""}, - {"octetAtWichPackedDataBegins",1462}, + {"octetAtWichPackedDataBegins",1465}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section_11",1983}, + {"section_11",1987}, {""}, {""}, {"ceilingAndVisibilityOKTrend4",392}, {""}, {""}, {""}, {""}, {""}, {""}, - {"presentWeather2PresentTrend3",1669}, + {"presentWeather2PresentTrend3",1673}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayDepthOfDepositState2",1803}, + {"runwayDepthOfDepositState2",1807}, {""}, {""}, {""}, {""}, {""}, {""}, {"Local_Number_Members_Possible",133}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"jDirectionIncrementGridLength",1020}, - {"offsetBeforePV",1476}, + {"jDirectionIncrementGridLength",1022}, + {"offsetBeforePV",1479}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6461,22 +6466,22 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsCode2Trend2",492}, - {"presentWeather1PresentTrend3",1664}, + {"cloudsCode2Trend2",494}, + {"presentWeather1PresentTrend3",1668}, {""}, {""}, {""}, {""}, {""}, {""}, {"BUFR",19}, {""}, {""}, {""}, {""}, {""}, {""}, - {"isCavok",985}, + {"isCavok",987}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"ccsdsBlockSize",384}, {""}, {""}, {""}, {""}, {""}, {""}, - {"setBitsPerValue",1995}, + {"setBitsPerValue",1999}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"presentWeather2PresentTrend4",1670}, + {"presentWeather2PresentTrend4",1674}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6489,12 +6494,12 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {"bufrHeaderSubCentre",373}, {""}, - {"cloudsCode2Trend1",491}, + {"cloudsCode2Trend1",493}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBase2Trend2",452}, + {"cloudsBase2Trend2",454}, {""}, {""}, - {"runwayDepthOfDepositState1",1802}, + {"runwayDepthOfDepositState1",1806}, {"NG",178}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6503,22 +6508,22 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"presentWeather1PresentTrend4",1665}, + {"presentWeather1PresentTrend4",1669}, {""}, - {"experimentVersionNumber2",779}, + {"experimentVersionNumber2",781}, {""}, {""}, {""}, {""}, {"Local_Number_Members_Missing",129}, - {"numberOfPointsAlongYAxis",1418}, + {"numberOfPointsAlongYAxis",1421}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"FMULTE",66}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"isCavokTrend3",988}, + {"isCavokTrend3",990}, {""}, {""}, {"biFourierPackingModeForAxes",353}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"section_5",1987}, + {"section_5",1991}, {""}, {"************_PRODUCT_***************",3}, {""}, {""}, @@ -6526,19 +6531,19 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"extractDateTimeYearRank",813}, + {"extractDateTimeYearRank",815}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"cloudsBase2Trend1",451}, + {"cloudsBase2Trend1",453}, {""}, {""}, {""}, {""}, {""}, {""}, - {"oneMinuteMeanMaximumRVR2",1502}, + {"oneMinuteMeanMaximumRVR2",1505}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"resolutionAndComponentFlags7",1778}, + {"resolutionAndComponentFlags7",1782}, {""}, {""}, - {"section_05",1976}, + {"section_05",1980}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6555,40 +6560,40 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"isCavokTrend4",989}, + {"isCavokTrend4",991}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"beginYearTrend1",347}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"versionNumberOfSuperblock",2286}, + {"versionNumberOfSuperblock",2292}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"experimentVersionNumber1",778}, + {"experimentVersionNumber1",780}, {""}, {""}, {""}, {""}, - {"padding_grid90_1",1543}, + {"padding_grid90_1",1546}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"extractAreaLatitudeRank",790}, + {"extractAreaLatitudeRank",792}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"hoursAfterDataCutoff",934}, + {"hoursAfterDataCutoff",936}, {""}, {""}, {""}, {""}, {""}, {""}, - {"extractDateTimeHourRank",800}, + {"extractDateTimeHourRank",802}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"oneMinuteMeanMaximumRVR1",1501}, + {"oneMinuteMeanMaximumRVR1",1504}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"endYearTrend2",749}, + {"endYearTrend2",751}, {""}, {""}, {""}, {""}, - {"numberOfParametersUsedForClustering",1407}, + {"numberOfParametersUsedForClustering",1410}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6603,14 +6608,14 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"windGustTrend2",2320}, + {"windGustTrend2",2326}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfGridUsed",1386}, + {"numberOfGridUsed",1389}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"presentWeather3PresentTrend2",1673}, + {"presentWeather3PresentTrend2",1677}, {""}, {""}, {""}, {""}, {"Ensemble_Identifier_E4",55}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6620,24 +6625,24 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"typicalYearOfCentury",2222}, + {"typicalYearOfCentury",2227}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"coordinate3OfFirstGridPoint",581}, + {"coordinate3OfFirstGridPoint",583}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"endYearTrend1",748}, + {"endYearTrend1",750}, {""}, {""}, - {"padding_local11_1",1594}, + {"padding_local11_1",1597}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc9_2",1593}, + {"padding_loc9_2",1596}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6647,35 +6652,35 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"windGustTrend1",2319}, + {"windGustTrend1",2325}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"extractDateTimeMinuteRank",803}, + {"extractDateTimeMinuteRank",805}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"typicalYear2",2221}, + {"typicalYear2",2226}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"extractDateTimeMonthRank",806}, + {"extractDateTimeMonthRank",808}, {""}, - {"presentWeather3PresentTrend1",1672}, + {"presentWeather3PresentTrend1",1676}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"************_ENSEMBLE_**************",1}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfPointsAlongYAxisInCouplingArea",1419}, + {"numberOfPointsAlongYAxisInCouplingArea",1422}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"pastTendencyRVR2",1627}, + {"pastTendencyRVR2",1631}, {""}, {""}, {""}, {""}, {""}, - {"oneMinuteMeanMinimumRVR2",1506}, + {"oneMinuteMeanMinimumRVR2",1509}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"Local_Number_Members_Possible_E3",135}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"extractDateTimeSecondRank",809}, + {"extractDateTimeSecondRank",811}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"LSTCUM",101}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6685,16 +6690,16 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc9_1",1592}, - {"padding_loc7_1",1591}, + {"padding_loc9_1",1595}, + {"padding_loc7_1",1594}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc6_1",1590}, + {"padding_loc6_1",1593}, {""}, {""}, {"Local_Number_Members_Possible_E4",136}, {""}, {""}, {""}, {""}, {""}, {""}, - {"precisionOfTheUnpackedSubset",1653}, + {"precisionOfTheUnpackedSubset",1657}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"offsetBSection5",1470}, + {"offsetBSection5",1473}, {""}, {""}, {""}, {""}, {"Local_Number_Members_Missing_E3",131}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6710,11 +6715,11 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"Local_Number_Members_Missing_E4",132}, - {"padding_loc5_1",1589}, + {"padding_loc5_1",1592}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"oneMinuteMeanMinimumRVR1",1505}, + {"oneMinuteMeanMinimumRVR1",1508}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6722,11 +6727,11 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayExtentOfContaminationCodeState3",1816}, + {"runwayExtentOfContaminationCodeState3",1820}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfTensOfThousandsOfYearsOfOffset",1436}, + {"numberOfTensOfThousandsOfYearsOfOffset",1439}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc50_1",1588}, + {"padding_loc50_1",1591}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6734,13 +6739,13 @@ static const struct grib_keys_hash wordlist[] = {"ceilingAndVisibilityOKTrend2",390}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"coordinate4OfFirstGridPoint",584}, + {"coordinate4OfFirstGridPoint",586}, {""}, {""}, {""}, {""}, {""}, {"DIAG",26}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayExtentOfContaminationCodeState4",1817}, + {"runwayExtentOfContaminationCodeState4",1821}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6751,7 +6756,7 @@ static const struct grib_keys_hash wordlist[] = {"Ensemble_Identifier_E2",53}, {"Threshold_Or_Distribution_Units",244}, {""}, {""}, - {"extractDateTimeDayRank",796}, + {"extractDateTimeDayRank",798}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6766,15 +6771,15 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"presentWeather2PresentTrend2",1668}, + {"presentWeather2PresentTrend2",1672}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc13_3",1548}, + {"padding_loc13_3",1551}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc190_1",1558}, + {"padding_loc190_1",1561}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_local_35",1598}, + {"padding_local_35",1601}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6787,7 +6792,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"presentWeather1PresentTrend2",1663}, + {"presentWeather1PresentTrend2",1667}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6798,7 +6803,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc13_4",1549}, + {"padding_loc13_4",1552}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"TYPE_FF",238}, @@ -6808,17 +6813,17 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"presentWeather2PresentTrend1",1667}, + {"presentWeather2PresentTrend1",1671}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"lastMonthUsedToBuildClimateMonth2",1040}, + {"lastMonthUsedToBuildClimateMonth2",1042}, {""}, {""}, {""}, - {"numberOfUnusedBitsAtEndOfSection3",1440}, + {"numberOfUnusedBitsAtEndOfSection3",1443}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfPointsAlongTheYAxis",1415}, + {"numberOfPointsAlongTheYAxis",1418}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6827,17 +6832,17 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"isCavokTrend2",987}, + {"isCavokTrend2",989}, {""}, {""}, {""}, {""}, {"YearOfModelVersion",278}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"presentWeather1PresentTrend1",1662}, + {"presentWeather1PresentTrend1",1666}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"lastMonthUsedToBuildClimateMonth1",1039}, + {"lastMonthUsedToBuildClimateMonth1",1041}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6858,16 +6863,16 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc19_2",1563}, + {"padding_loc19_2",1566}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayExtentOfContaminationCodeState2",1815}, + {"runwayExtentOfContaminationCodeState2",1819}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"isCavokTrend1",986}, + {"isCavokTrend1",988}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6875,22 +6880,22 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"Number_Combination_Ensembles_1_none",198}, - {"runwayBrakingActionState3",1788}, + {"runwayBrakingActionState3",1792}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc18_2",1557}, + {"padding_loc18_2",1560}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayExtentOfContaminationCodeState1",1814}, + {"runwayExtentOfContaminationCodeState1",1818}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_local_7_1",1599}, + {"padding_local_7_1",1602}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6901,41 +6906,41 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfVGridUsed",1445}, + {"numberOfVGridUsed",1448}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_grid3_1",1539}, + {"padding_grid3_1",1542}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"runwayBrakingActionState4",1789}, + {"runwayBrakingActionState4",1793}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_local1_1",1595}, + {"padding_local1_1",1598}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc10_1",1544}, + {"padding_loc10_1",1547}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"X1InGridLengths",263}, {""}, {""}, {""}, {""}, - {"padding_sec2_3",1603}, + {"padding_sec2_3",1606}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_grid4_1",1540}, + {"padding_grid4_1",1543}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc18_1",1556}, + {"padding_loc18_1",1559}, {""}, {""}, {""}, {"GRIB",71}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"extremeValuesRVR3",825}, + {"extremeValuesRVR3",827}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc29_3",1578}, + {"padding_loc29_3",1581}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6943,7 +6948,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"extremeValuesRVR4",826}, + {"extremeValuesRVR4",828}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6958,7 +6963,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"extremeCounterClockwiseWindDirection",822}, + {"extremeCounterClockwiseWindDirection",824}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -6999,7 +7004,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"genVertHeightCoords",877}, + {"genVertHeightCoords",879}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7014,7 +7019,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"Time_Range_Two_E3",249}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_grid1_2",1538}, + {"padding_grid1_2",1541}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7026,7 +7031,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc30_2",1582}, + {"padding_loc30_2",1585}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"Time_Range_Two_E4",250}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7036,13 +7041,13 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc13_2",1547}, + {"padding_loc13_2",1550}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_sec3_1",1604}, + {"padding_sec3_1",1607}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"Ensemble_Combinat_Number_0_none_E3",49}, @@ -7052,15 +7057,15 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc14_2",1552}, + {"padding_loc14_2",1555}, {""}, {""}, {""}, {""}, - {"extremeValuesRVR2",824}, + {"extremeValuesRVR2",826}, {""}, {""}, - {"numberOfUsefulPointsAlongYAxis",1444}, + {"numberOfUsefulPointsAlongYAxis",1447}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc3_1",1586}, + {"padding_loc3_1",1589}, {""}, {""}, - {"padding_grid1_1",1537}, + {"padding_grid1_1",1540}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7070,27 +7075,27 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_local1_31",1596}, + {"padding_local1_31",1599}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc30_1",1581}, + {"padding_loc30_1",1584}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"extremeValuesRVR1",823}, + {"extremeValuesRVR1",825}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc192_1",1562}, + {"padding_loc192_1",1565}, {""}, {""}, {""}, - {"padding_loc38_1",1585}, + {"padding_loc38_1",1588}, {""}, {""}, {"CCCC",21}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"TYPE_PF",242}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc13_1",1546}, + {"padding_loc13_1",1549}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7106,28 +7111,28 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {"Time_Range_One_E2",245}, {""}, - {"padding_loc14_1",1551}, + {"padding_loc14_1",1554}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc191_1",1559}, + {"padding_loc191_1",1562}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc191_3",1561}, + {"padding_loc191_3",1564}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"TYPE_AN",235}, {""}, {""}, {""}, - {"padding_loc4_2",1587}, + {"padding_loc4_2",1590}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"swapScanningY",2099}, + {"swapScanningY",2104}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7140,7 +7145,7 @@ static const struct grib_keys_hash wordlist[] = {"INGRIB",91}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_grid50_1",1541}, + {"padding_grid50_1",1544}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7148,14 +7153,14 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_sec4_1",1605}, + {"padding_sec4_1",1608}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"RVR2_1",218}, {""}, {""}, {""}, - {"runwayBrakingActionState2",1787}, + {"runwayBrakingActionState2",1791}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7196,9 +7201,9 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"ExtremeValuesRVR4",65}, {""}, {""}, {""}, - {"padding_sec2_2",1602}, + {"padding_sec2_2",1605}, {""}, - {"runwayBrakingActionState1",1786}, + {"runwayBrakingActionState1",1790}, {""}, {""}, {""}, {""}, {"GG",70}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7210,10 +7215,10 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"bitsPerValueAndRepack",366}, - {"padding_loc2_2",1580}, + {"padding_loc2_2",1583}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc29_2",1577}, + {"padding_loc29_2",1580}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7229,7 +7234,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc12_1",1545}, + {"padding_loc12_1",1548}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"Threshold_Or_Distribution_0_no_1_yes",243}, @@ -7240,7 +7245,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_sec2_1",1601}, + {"padding_sec2_1",1604}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7250,10 +7255,10 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc2_1",1579}, + {"padding_loc2_1",1582}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc29_1",1576}, + {"padding_loc29_1",1579}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7264,7 +7269,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc20_1",1564}, + {"padding_loc20_1",1567}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"ExtremeValuesInMaximumRVR3",60}, @@ -7274,11 +7279,11 @@ static const struct grib_keys_hash wordlist[] = {""}, {"7777",5}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc16_1",1554}, + {"padding_loc16_1",1557}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_grid5_1",1542}, + {"padding_grid5_1",1545}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc28_1",1575}, + {"padding_loc28_1",1578}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7321,7 +7326,7 @@ static const struct grib_keys_hash wordlist[] = {"YY",277}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc17_2",1555}, + {"padding_loc17_2",1558}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7340,7 +7345,7 @@ static const struct grib_keys_hash wordlist[] = {"ExtremeValuesRVR1",62}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"numberOfBitsUsedForTheGroupWidths",1342}, + {"numberOfBitsUsedForTheGroupWidths",1345}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7365,7 +7370,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"meanValueRVR3",1257}, + {"meanValueRVR3",1259}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7389,7 +7394,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"meanValueRVR4",1258}, + {"meanValueRVR4",1260}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7412,11 +7417,11 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc191_2",1560}, + {"padding_loc191_2",1563}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc23_1",1566}, + {"padding_loc23_1",1569}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7429,7 +7434,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc15_1",1553}, + {"padding_loc15_1",1556}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7454,7 +7459,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc37_2",1584}, + {"padding_loc37_2",1587}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7466,7 +7471,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc13_5",1550}, + {"padding_loc13_5",1553}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7480,11 +7485,11 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc244_1",1567}, + {"padding_loc244_1",1570}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc244_3",1569}, + {"padding_loc244_3",1572}, {"GRIBEXSection1Problem",72}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7493,7 +7498,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc37_1",1583}, + {"padding_loc37_1",1586}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7549,10 +7554,10 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"gts_CCCC",912}, + {"gts_CCCC",914}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc21_1",1565}, + {"padding_loc21_1",1568}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7571,7 +7576,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc26_1",1572}, + {"padding_loc26_1",1575}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {"BUDG",18}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7598,7 +7603,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"meanValueRVR2",1256}, + {"meanValueRVR2",1258}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7614,7 +7619,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc27_2",1574}, + {"padding_loc27_2",1577}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7634,7 +7639,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {"Original_Parameter_Iden_CodeTable2",204}, {""}, {""}, {""}, {""}, {""}, - {"meanValueRVR1",1255}, + {"meanValueRVR1",1257}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7651,7 +7656,7 @@ static const struct grib_keys_hash wordlist[] = {"P_TAVG",214}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc27_1",1573}, + {"padding_loc27_1",1576}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7748,7 +7753,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc244_2",1568}, + {"padding_loc244_2",1571}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -7765,7 +7770,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc245_1",1570}, + {"padding_loc245_1",1573}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -8007,7 +8012,7 @@ static const struct grib_keys_hash wordlist[] = {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"padding_loc245_2",1571}, + {"padding_loc245_2",1574}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -9303,9 +9308,7 @@ static const struct grib_keys_hash wordlist[] = #endif #endif const struct grib_keys_hash * -grib_keys_hash_get (str, len) - register const char *str; - register unsigned int len; +grib_keys_hash_get (const char *str, unsigned int len) { if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) { diff --git a/src/grib_iterator_class_gen.c b/src/grib_iterator_class_gen.c index 5d8693dce..4a48f1ac4 100644 --- a/src/grib_iterator_class_gen.c +++ b/src/grib_iterator_class_gen.c @@ -100,7 +100,8 @@ static double* pointer_to_data(unsigned int i, unsigned int j, /* Apply the scanning mode flags which may require data array to be transformed */ /* to standard west-to-east south-to-north mode */ int transform_iterator_data(grib_handle* h, double* data, - long iScansNegatively, long jScansPositively, long jPointsAreConsecutive, long alternativeRowScanning, + long iScansNegatively, long jScansPositively, + long jPointsAreConsecutive, long alternativeRowScanning, size_t numPoints, long nx, long ny) { double* data2; @@ -118,7 +119,7 @@ int transform_iterator_data(grib_handle* h, double* data, size_t row_size = ((size_t)nx) * sizeof(double); data2 = (double*)grib_context_malloc(h->context, row_size); if (!data2) { - grib_context_log(h->context, GRIB_LOG_ERROR, "Unable to allocate %ld bytes", row_size); + grib_context_log(h->context, GRIB_LOG_ERROR, "Error allocating %ld bytes", row_size); return GRIB_OUT_OF_MEMORY; } for (iy = 0; iy < ny / 2; iy++) { @@ -136,7 +137,7 @@ int transform_iterator_data(grib_handle* h, double* data, } data2 = (double*)grib_context_malloc(h->context, numPoints * sizeof(double)); if (!data2) { - grib_context_log(h->context, GRIB_LOG_ERROR, "Unable to allocate %ld bytes", numPoints * sizeof(double)); + grib_context_log(h->context, GRIB_LOG_ERROR, "Error allocating %ld bytes", numPoints * sizeof(double)); return GRIB_OUT_OF_MEMORY; } pData0 = data2; diff --git a/src/grib_iterator_class_lambert_azimuthal_equal_area.c b/src/grib_iterator_class_lambert_azimuthal_equal_area.c index 2a5fb80cc..73290b326 100644 --- a/src/grib_iterator_class_lambert_azimuthal_equal_area.c +++ b/src/grib_iterator_class_lambert_azimuthal_equal_area.c @@ -190,13 +190,13 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) self->lats = (double*)grib_context_malloc(h->context, iter->nv * sizeof(double)); if (!self->lats) { grib_context_log(h->context, GRIB_LOG_ERROR, - "unable to allocate %ld bytes", iter->nv * sizeof(double)); + "Error allocating %ld bytes", iter->nv * sizeof(double)); return GRIB_OUT_OF_MEMORY; } self->lons = (double*)grib_context_malloc(h->context, iter->nv * sizeof(double)); if (!self->lats) { grib_context_log(h->context, GRIB_LOG_ERROR, - "unable to allocate %ld bytes", iter->nv * sizeof(double)); + "Error allocating %ld bytes", iter->nv * sizeof(double)); return GRIB_OUT_OF_MEMORY; } lats = self->lats; diff --git a/src/grib_iterator_class_lambert_conformal.c b/src/grib_iterator_class_lambert_conformal.c index f1c9b1098..eb05b7fa6 100644 --- a/src/grib_iterator_class_lambert_conformal.c +++ b/src/grib_iterator_class_lambert_conformal.c @@ -205,12 +205,12 @@ static int init_sphere(grib_handle* h, /* Allocate latitude and longitude arrays */ self->lats = (double*)grib_context_malloc(h->context, nv * sizeof(double)); if (!self->lats) { - grib_context_log(h->context, GRIB_LOG_ERROR, "Unable to allocate %ld bytes", nv * sizeof(double)); + grib_context_log(h->context, GRIB_LOG_ERROR, "Error allocating %ld bytes", nv * sizeof(double)); return GRIB_OUT_OF_MEMORY; } self->lons = (double*)grib_context_malloc(h->context, nv * sizeof(double)); if (!self->lats) { - grib_context_log(h->context, GRIB_LOG_ERROR, "Unable to allocate %ld bytes", nv * sizeof(double)); + grib_context_log(h->context, GRIB_LOG_ERROR, "Error allocating %ld bytes", nv * sizeof(double)); return GRIB_OUT_OF_MEMORY; } @@ -316,12 +316,12 @@ static int init_oblate(grib_handle* h, /* Allocate latitude and longitude arrays */ self->lats = (double*)grib_context_malloc(h->context, nv * sizeof(double)); if (!self->lats) { - grib_context_log(h->context, GRIB_LOG_ERROR, "Unable to allocate %ld bytes", nv * sizeof(double)); + grib_context_log(h->context, GRIB_LOG_ERROR, "Error allocating %ld bytes", nv * sizeof(double)); return GRIB_OUT_OF_MEMORY; } self->lons = (double*)grib_context_malloc(h->context, nv * sizeof(double)); if (!self->lats) { - grib_context_log(h->context, GRIB_LOG_ERROR, "Unable to allocate %ld bytes", nv * sizeof(double)); + grib_context_log(h->context, GRIB_LOG_ERROR, "Error allocating %ld bytes", nv * sizeof(double)); return GRIB_OUT_OF_MEMORY; } diff --git a/src/grib_iterator_class_mercator.c b/src/grib_iterator_class_mercator.c index bc0e86749..561ae8345 100644 --- a/src/grib_iterator_class_mercator.c +++ b/src/grib_iterator_class_mercator.c @@ -186,12 +186,12 @@ static int init_mercator(grib_handle* h, /* Allocate latitude and longitude arrays */ self->lats = (double*)grib_context_malloc(h->context, nv * sizeof(double)); if (!self->lats) { - grib_context_log(h->context, GRIB_LOG_ERROR, "Unable to allocate %ld bytes", nv * sizeof(double)); + grib_context_log(h->context, GRIB_LOG_ERROR, "Error allocating %ld bytes", nv * sizeof(double)); return GRIB_OUT_OF_MEMORY; } self->lons = (double*)grib_context_malloc(h->context, nv * sizeof(double)); if (!self->lats) { - grib_context_log(h->context, GRIB_LOG_ERROR, "Unable to allocate %ld bytes", nv * sizeof(double)); + grib_context_log(h->context, GRIB_LOG_ERROR, "Error allocating %ld bytes", nv * sizeof(double)); return GRIB_OUT_OF_MEMORY; } diff --git a/src/grib_iterator_class_polar_stereographic.c b/src/grib_iterator_class_polar_stereographic.c index 93b2cd660..f0f8a606d 100644 --- a/src/grib_iterator_class_polar_stereographic.c +++ b/src/grib_iterator_class_polar_stereographic.c @@ -242,12 +242,12 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) } self->lats = (double*)grib_context_malloc(h->context, iter->nv * sizeof(double)); if (!self->lats) { - grib_context_log(h->context, GRIB_LOG_ERROR, "unable to allocate %ld bytes", iter->nv * sizeof(double)); + grib_context_log(h->context, GRIB_LOG_ERROR, "Error allocating %ld bytes", iter->nv * sizeof(double)); return GRIB_OUT_OF_MEMORY; } self->lons = (double*)grib_context_malloc(h->context, iter->nv * sizeof(double)); if (!self->lats) { - grib_context_log(h->context, GRIB_LOG_ERROR, "unable to allocate %ld bytes", iter->nv * sizeof(double)); + grib_context_log(h->context, GRIB_LOG_ERROR, "Error allocating %ld bytes", iter->nv * sizeof(double)); return GRIB_OUT_OF_MEMORY; } lats = self->lats; diff --git a/src/grib_iterator_class_space_view.c b/src/grib_iterator_class_space_view.c index 99c441a2d..d939030e7 100644 --- a/src/grib_iterator_class_space_view.c +++ b/src/grib_iterator_class_space_view.c @@ -238,12 +238,12 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) self->lats = (double*)grib_context_malloc(h->context, array_size); if (!self->lats) { - grib_context_log(h->context, GRIB_LOG_ERROR, "unable to allocate %ld bytes", array_size); + grib_context_log(h->context, GRIB_LOG_ERROR, "Error allocating %ld bytes", array_size); return GRIB_OUT_OF_MEMORY; } self->lons = (double*)grib_context_malloc(h->context, array_size); if (!self->lats) { - grib_context_log(h->context, GRIB_LOG_ERROR, "unable to allocate %ld bytes", array_size); + grib_context_log(h->context, GRIB_LOG_ERROR, "Error allocating %ld bytes", array_size); return GRIB_OUT_OF_MEMORY; } lats = self->lats; @@ -268,12 +268,12 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) /* Store array of sin and cosine values to avoid recalculation */ s_x = (double*)grib_context_malloc(h->context, nx * sizeof(double)); if (!s_x) { - grib_context_log(h->context, GRIB_LOG_ERROR, "unable to allocate %ld bytes", nx * sizeof(double)); + grib_context_log(h->context, GRIB_LOG_ERROR, "Error allocating %ld bytes", nx * sizeof(double)); return GRIB_OUT_OF_MEMORY; } c_x = (double*)grib_context_malloc(h->context, nx * sizeof(double)); if (!c_x) { - grib_context_log(h->context, GRIB_LOG_ERROR, "unable to allocate %ld bytes", nx * sizeof(double)); + grib_context_log(h->context, GRIB_LOG_ERROR, "Error allocating %ld bytes", nx * sizeof(double)); return GRIB_OUT_OF_MEMORY; } diff --git a/src/grib_nearest_class_sh.c b/src/grib_nearest_class_sh.c index 7b89efe5a..0da390288 100644 --- a/src/grib_nearest_class_sh.c +++ b/src/grib_nearest_class_sh.c @@ -117,7 +117,7 @@ static int find(grib_nearest* nearest, grib_handle* h, values = (double*)grib_context_malloc_clear(h->context, sizeof(double) * size); if (!values) { grib_context_log(h->context, GRIB_LOG_ERROR, - "nearest_sh: unable to allocate %d bytes", + "nearest_sh: Error allocating %d bytes", sizeof(double) * size); return GRIB_OUT_OF_MEMORY; } @@ -199,7 +199,7 @@ static int grib_invtrans_legendre(int L, double x, pP = (double*)malloc(sizeof(double) * (L + 1)); if (!pP) { - printf("unable to allocate %d bytes\n", (int)sizeof(double) * (L + 1)); + printf("Error allocating %d bytes\n", (int)sizeof(double) * (L + 1)); return GRIB_OUT_OF_MEMORY; } @@ -259,14 +259,14 @@ static int grib_invtrans(grib_context* context, int L, double latdeg, double lon c = (double*)grib_context_malloc_clear(context, sizeof(double) * Lp1); if (!c) { grib_context_log(context, GRIB_LOG_ERROR, - "nearest_sh: unable to allocate %d bytes", sizeof(double) * Lp1); + "nearest_sh: Error allocating %d bytes", sizeof(double) * Lp1); return GRIB_OUT_OF_MEMORY; } s = (double*)grib_context_malloc_clear(context, sizeof(double) * Lp1); if (!s) { grib_context_log(context, GRIB_LOG_ERROR, - "nearest_sh: unable to allocate %d bytes", sizeof(double) * Lp1); + "nearest_sh: Error allocating %d bytes", sizeof(double) * Lp1); return GRIB_OUT_OF_MEMORY; } @@ -275,13 +275,13 @@ static int grib_invtrans(grib_context* context, int L, double latdeg, double lon TR = (double*)grib_context_malloc_clear(context, sizeof(double) * Lp1); if (!TR) { grib_context_log(context, GRIB_LOG_ERROR, - "nearest_sh: unable to allocate %d bytes", sizeof(double) * Lp1); + "nearest_sh: Error allocating %d bytes", sizeof(double) * Lp1); return GRIB_OUT_OF_MEMORY; } TI = (double*)grib_context_malloc_clear(context, sizeof(double) * Lp1); if (!TI) { grib_context_log(context, GRIB_LOG_ERROR, - "nearest_sh: unable to allocate %d bytes", sizeof(double) * Lp1); + "nearest_sh: Error allocating %d bytes", sizeof(double) * Lp1); return GRIB_OUT_OF_MEMORY; } diff --git a/tests/Makefile.am b/tests/Makefile.am index b74afccab..31fd9a84b 100755 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -56,6 +56,7 @@ TESTS = definitions.sh \ grib_padding.sh \ grib_lamb_az_eq_area.sh \ grib_lambert_conformal.sh \ + grib_mercator.sh \ grib_to_netcdf.sh \ grib_dump_debug.sh \ grib_jpeg.sh \ diff --git a/tests/keys b/tests/keys index 2f70eb8c8..12b52c459 100644 --- a/tests/keys +++ b/tests/keys @@ -408,1960 +408,1966 @@ centuryOfReference,402 centuryOfReferenceTimeOfData,403 cfName,404 cfNameECMF,405 -cfVarName,406 -cfVarNameECMF,407 -changeDecimalPrecision,408 -changeIndicatorTrend1,409 -changeIndicatorTrend2,410 -changeIndicatorTrend3,411 -changeIndicatorTrend4,412 -changingPrecision,413 -channel,414 -channelNumber,415 -char,416 -charValues,417 -checkInternalVersion,418 -class,419 -classOfAnalysis,420 -clearTables,421 -climateDateFrom,422 -climateDateTo,423 -climatologicalRegime,424 -cloudsAbbreviation1,425 -cloudsAbbreviation1Trend1,426 -cloudsAbbreviation1Trend2,427 -cloudsAbbreviation1Trend3,428 -cloudsAbbreviation1Trend4,429 -cloudsAbbreviation2,430 -cloudsAbbreviation2Trend1,431 -cloudsAbbreviation2Trend2,432 -cloudsAbbreviation2Trend3,433 -cloudsAbbreviation2Trend4,434 -cloudsAbbreviation3,435 -cloudsAbbreviation3Trend1,436 -cloudsAbbreviation3Trend2,437 -cloudsAbbreviation3Trend3,438 -cloudsAbbreviation3Trend4,439 -cloudsAbbreviation4,440 -cloudsAbbreviation4Trend1,441 -cloudsAbbreviation4Trend2,442 -cloudsAbbreviation4Trend3,443 -cloudsAbbreviation4Trend4,444 -cloudsBase1,445 -cloudsBase1Trend1,446 -cloudsBase1Trend2,447 -cloudsBase1Trend3,448 -cloudsBase1Trend4,449 -cloudsBase2,450 -cloudsBase2Trend1,451 -cloudsBase2Trend2,452 -cloudsBase2Trend3,453 -cloudsBase2Trend4,454 -cloudsBase3,455 -cloudsBase3Trend1,456 -cloudsBase3Trend2,457 -cloudsBase3Trend3,458 -cloudsBase3Trend4,459 -cloudsBase4,460 -cloudsBase4Trend1,461 -cloudsBase4Trend2,462 -cloudsBase4Trend3,463 -cloudsBase4Trend4,464 -cloudsBaseCoded1,465 -cloudsBaseCoded1Trend1,466 -cloudsBaseCoded1Trend2,467 -cloudsBaseCoded1Trend3,468 -cloudsBaseCoded1Trend4,469 -cloudsBaseCoded2,470 -cloudsBaseCoded2Trend1,471 -cloudsBaseCoded2Trend2,472 -cloudsBaseCoded2Trend3,473 -cloudsBaseCoded2Trend4,474 -cloudsBaseCoded3,475 -cloudsBaseCoded3Trend1,476 -cloudsBaseCoded3Trend2,477 -cloudsBaseCoded3Trend3,478 -cloudsBaseCoded3Trend4,479 -cloudsBaseCoded4,480 -cloudsBaseCoded4Trend1,481 -cloudsBaseCoded4Trend2,482 -cloudsBaseCoded4Trend3,483 -cloudsBaseCoded4Trend4,484 -cloudsCode1,485 -cloudsCode1Trend1,486 -cloudsCode1Trend2,487 -cloudsCode1Trend3,488 -cloudsCode1Trend4,489 -cloudsCode2,490 -cloudsCode2Trend1,491 -cloudsCode2Trend2,492 -cloudsCode2Trend3,493 -cloudsCode2Trend4,494 -cloudsCode3,495 -cloudsCode3Trend1,496 -cloudsCode3Trend2,497 -cloudsCode3Trend3,498 -cloudsCode3Trend4,499 -cloudsCode4,500 -cloudsCode4Trend1,501 -cloudsCode4Trend2,502 -cloudsCode4Trend3,503 -cloudsCode4Trend4,504 -cloudsTitle1,505 -cloudsTitle1Trend1,506 -cloudsTitle1Trend2,507 -cloudsTitle1Trend3,508 -cloudsTitle1Trend4,509 -cloudsTitle2,510 -cloudsTitle2Trend1,511 -cloudsTitle2Trend2,512 -cloudsTitle2Trend3,513 -cloudsTitle2Trend4,514 -cloudsTitle3,515 -cloudsTitle3Trend1,516 -cloudsTitle3Trend2,517 -cloudsTitle3Trend3,518 -cloudsTitle3Trend4,519 -cloudsTitle4,520 -cloudsTitle4Trend1,521 -cloudsTitle4Trend2,522 -cloudsTitle4Trend3,523 -cloudsTitle4Trend4,524 -clusterIdentifier,525 -clusterMember1,526 -clusterMember10,527 -clusterMember2,528 -clusterMember3,529 -clusterMember4,530 -clusterMember5,531 -clusterMember6,532 -clusterMember7,533 -clusterMember8,534 -clusterMember9,535 -clusterNumber,536 -clusterSize,537 -clusteringDomain,538 -clusteringMethod,539 -clutterFilterIndicator,540 -cnmc_cmcc,541 -cnmc_isac,542 -codeFigure,543 -codeType,544 -codedNumberOfFirstOrderPackedValues,545 -codedNumberOfGroups,546 -codedValues,547 -coefsFirst,548 -coefsSecond,549 -commonBlock,550 -complexPacking,551 -componentIndex,552 -compressedData,553 -computeLaplacianOperator,554 -computeStatistics,555 -conceptDir,556 -conceptsLocalDirAll,557 -conceptsLocalDirECMF,558 -conceptsLocalMarsDirAll,559 -conceptsMasterDir,560 -conceptsMasterMarsDir,561 -consensus,562 -consensusCount,563 -const,564 -constantAntennaElevationAngle,565 -constantFieldHalfByte,566 -constituentType,567 -controlForecastCluster,568 -coordAveraging0,569 -coordAveraging1,570 -coordAveraging2,571 -coordAveraging3,572 -coordAveragingTims,573 -coordinate1End,574 -coordinate1Flag,575 -coordinate1Start,576 -coordinate2End,577 -coordinate2Flag,578 -coordinate2Start,579 -coordinate3Flag,580 -coordinate3OfFirstGridPoint,581 -coordinate3OfLastGridPoint,582 -coordinate4Flag,583 -coordinate4OfFirstGridPoint,584 -coordinate4OfLastGridPoint,585 -coordinateFlag1,586 -coordinateFlag2,587 -coordinateIndexNumber,588 -coordinatesPresent,589 -core,590 -corr1Data,591 -corr2Data,592 -corr3Data,593 -corr4Data,594 -correction,595 -correction1,596 -correction1Part,597 -correction2,598 -correction2Part,599 -correction3,600 -correction3Part,601 -correction4,602 -correction4Part,603 -count,604 -countOfGroupLengths,605 -countOfICEFieldsUsed,606 -countTotal,607 -country,608 -crcrlf,609 -createNewData,610 -crraLocalVersion,611 -crraSection,612 -crraSuiteID,613 -daLoop,614 -data,615 -dataAccessors,616 -dataCategory,617 -dataDate,618 -dataFlag,619 -dataKeys,620 -dataLength,621 -dataOrigin,622 -dataRepresentation,623 -dataRepresentationTemplate,624 -dataRepresentationTemplateNumber,625 -dataRepresentationType,626 -dataSelection,627 -dataStream,628 -dataSubCategory,629 -dataTime,630 -dataType,631 -dataValues,632 -date,633 -dateOfAnalysis,634 -dateOfForecast,635 -dateOfForecastRun,636 -dateOfIceFieldUsed,637 -dateOfModelVersion,638 -dateOfReference,639 -dateOfSSTFieldUsed,640 -dateSSTFieldUsed,641 -dateTime,642 -datumSize,643 -day,644 -dayOfAnalysis,645 -dayOfEndOfOverallTimeInterval,646 -dayOfForecast,647 -dayOfModelVersion,648 -dayOfReference,649 -dayOfTheYearDate,650 -decimalPrecision,651 -decimalScaleFactor,652 -defaultFaFieldName,653 -defaultFaLevelName,654 -defaultFaModelName,655 -defaultName,656 -defaultParameter,657 -defaultSequence,658 -defaultShortName,659 -defaultStepUnits,660 -defaultTypeOfLevel,661 -default_max_val,662 -default_min_val,663 -default_step_units,664 -definitionFilesVersion,665 -deleteCalendarId,666 -deleteExtraLocalSection,667 -deleteLocalDefinition,668 -deletePV,669 -derivedForecast,670 -dewPointTemperature,671 -diagnostic,672 -diagnosticNumber,673 -diffInDays,674 -diffInHours,675 -dimension,676 -dimensionNumber,677 -dimensionType,678 -direction,679 -directionNumber,680 -directionOfVariation,681 -directionScalingFactor,682 -dirty_statistics,683 -disableGrib1LocalSection,684 -discipline,685 -distanceFromTubeToEnsembleMean,686 -distinctLatitudes,687 -distinctLongitudes,688 -doExtractArea,689 -doExtractDateTime,690 -doExtractSubsets,691 -doSimpleThinning,692 -domain,693 -driverInformationBlockAddress,694 -dummy,695 -dummy1,696 -dummy2,697 -dummyc,698 -dx,699 -dy,700 -earthIsOblate,701 -earthMajorAxis,702 -earthMajorAxisInMetres,703 -earthMinorAxis,704 -earthMinorAxisInMetres,705 -eastLongitudeOfCluster,706 -eastLongitudeOfDomainOfTubing,707 -easternLongitudeOfClusterDomain,708 -easternLongitudeOfDomain,709 -ed,710 -edition,711 -editionNumber,712 -efas_model,713 -efas_post_proc,714 -efiOrder,715 -eight,716 -elementsTable,717 -elevation,718 -eleven,719 -endDayTrend1,720 -endDayTrend2,721 -endDayTrend3,722 -endDayTrend4,723 -endDescriptors,724 -endGridDefinition,725 -endHourTrend1,726 -endHourTrend2,727 -endHourTrend3,728 -endHourTrend4,729 -endMark,730 -endMinuteTrend1,731 -endMinuteTrend2,732 -endMinuteTrend3,733 -endMinuteTrend4,734 -endMonthTrend1,735 -endMonthTrend2,736 -endMonthTrend3,737 -endMonthTrend4,738 -endOfFileAddress,739 -endOfHeadersMarker,740 -endOfInterval,741 -endOfMessage,742 -endOfProduct,743 -endOfRange,744 -endStep,745 -endStepInHours,746 -endTimeStep,747 -endYearTrend1,748 -endYearTrend2,749 -endYearTrend3,750 -endYearTrend4,751 -energyNorm,752 -enorm,753 -ensembleForecastNumbers,754 -ensembleForecastNumbersList,755 -ensembleSize,756 -ensembleStandardDeviation,757 -eps,758 -epsContinous,759 -epsPoint,760 -epsStatisticsContinous,761 -epsStatisticsPoint,762 -expandBy,763 -expandedAbbreviations,764 -expandedCodes,765 -expandedCrex_scales,766 -expandedCrex_units,767 -expandedCrex_widths,768 -expandedDescriptors,769 -expandedNames,770 -expandedOriginalCodes,771 -expandedOriginalReferences,772 -expandedOriginalScales,773 -expandedOriginalWidths,774 -expandedTypes,775 -expandedUnits,776 -experimentVersionNumber,777 -experimentVersionNumber1,778 -experimentVersionNumber2,779 -experimentVersionNumberOfAnalysis,780 -expoffset,781 -expver,782 -extendedFlag,783 -extraDim,784 -extraDimensionPresent,785 -extraLocalSectionNumber,786 -extraLocalSectionPresent,787 -extraValues,788 -extractAreaEastLongitude,789 -extractAreaLatitudeRank,790 -extractAreaLongitudeRank,791 -extractAreaNorthLatitude,792 -extractAreaSouthLatitude,793 -extractAreaWestLongitude,794 -extractDateTimeDayEnd,795 -extractDateTimeDayRank,796 -extractDateTimeDayStart,797 -extractDateTimeEnd,798 -extractDateTimeHourEnd,799 -extractDateTimeHourRank,800 -extractDateTimeHourStart,801 -extractDateTimeMinuteEnd,802 -extractDateTimeMinuteRank,803 -extractDateTimeMinuteStart,804 -extractDateTimeMonthEnd,805 -extractDateTimeMonthRank,806 -extractDateTimeMonthStart,807 -extractDateTimeSecondEnd,808 -extractDateTimeSecondRank,809 -extractDateTimeSecondStart,810 -extractDateTimeStart,811 -extractDateTimeYearEnd,812 -extractDateTimeYearRank,813 -extractDateTimeYearStart,814 -extractSubset,815 -extractSubsetIntervalEnd,816 -extractSubsetIntervalStart,817 -extractSubsetList,818 -extractedAreaNumberOfSubsets,819 -extractedDateTimeNumberOfSubsets,820 -extremeClockwiseWindDirection,821 -extremeCounterClockwiseWindDirection,822 -extremeValuesRVR1,823 -extremeValuesRVR2,824 -extremeValuesRVR3,825 -extremeValuesRVR4,826 -faFieldName,827 -faLevelName,828 -faModelName,829 -false,830 -falseEasting,831 -falseNorthing,832 -fcmonth,833 -fcperiod,834 -fgDate,835 -fgTime,836 -file,837 -fileConsistencyFlags,838 -firstDimension,839 -firstDimensionCoordinateValueDefinition,840 -firstDimensionPhysicalSignificance,841 -firstLatitude,842 -firstLatitudeInDegrees,843 -firstMonthUsedToBuildClimateMonth1,844 -firstMonthUsedToBuildClimateMonth2,845 -firstOrderValues,846 -flag,847 -flagForAnyFurtherInformation,848 -flagForIrregularGridCoordinateList,849 -flagForNormalOrStaggeredGrid,850 -flagShowingPostAuxiliaryArrayInUse,851 -flags,852 -floatVal,853 -floatValues,854 -forecastLeadTime,855 -forecastMonth,856 -forecastOrSingularVectorNumber,857 -forecastPeriod,858 -forecastPeriodFrom,859 -forecastPeriodTo,860 -forecastProbabilityNumber,861 -forecastSteps,862 -forecastTime,863 -forecastperiod,864 -formatVersionMajorNumber,865 -formatVersionMinorNumber,866 -freeFormData,867 -frequency,868 -frequencyNumber,869 -frequencyScalingFactor,870 -functionCode,871 -g,872 -g1conceptsLocalDirAll,873 -g1conceptsMasterDir,874 -g2grid,875 -gaussianGridName,876 -genVertHeightCoords,877 -generalExtended2ordr,878 -generatingProcessIdentificationNumber,879 -generatingProcessIdentifier,880 -generatingProcessTemplate,881 -generatingProcessTemplateNumber,882 -getNumberOfValues,883 -gg,884 -global,885 -globalDomain,886 -grib1divider,887 -grib2LocalSectionNumber,888 -grib2LocalSectionPresent,889 -grib2divider,890 -grib3divider,891 -gribDataQualityChecks,892 -gribMasterTablesVersionNumber,893 -gribTablesVersionNo,894 -grid,895 -gridCoordinate,896 -gridDefinition,897 -gridDefinitionDescription,898 -gridDefinitionSection,899 -gridDefinitionTemplateNumber,900 -gridDescriptionSectionPresent,901 -gridName,902 -gridPointPosition,903 -gridType,904 -groupInternalNodeK,905 -groupLeafNodeK,906 -groupLengths,907 -groupSplitting,908 -groupSplittingMethodUsed,909 -groupWidth,910 -groupWidths,911 -gts_CCCC,912 -gts_TTAAii,913 -gts_ddhh00,914 -gts_header,915 -halfByte,916 -hdate,917 -headersOnly,918 -heightLevelName,919 -heightOrPressureOfLevel,920 -heightPressureEtcOfLevels,921 -hideThis,922 -horizontalCoordinateDefinition,923 -horizontalCoordinateSupplement,924 -horizontalDimensionProcessed,925 -horizontalDomainTemplate,926 -horizontalDomainTemplateNumber,927 -hour,928 -hourOfAnalysis,929 -hourOfEndOfOverallTimeInterval,930 -hourOfForecast,931 -hourOfModelVersion,932 -hourOfReference,933 -hoursAfterDataCutoff,934 -hoursAfterReferenceTimeOfDataCutoff,935 -hundred,936 -iDirectionIncrement,937 -iDirectionIncrementGiven,938 -iDirectionIncrementGridLength,939 -iDirectionIncrementInDegrees,940 -iIncrement,941 -iScansNegatively,942 -iScansPositively,943 -ident,944 -identificationNumber,945 -identificationOfOriginatingGeneratingCentre,946 -identificationOfProject,947 -identifier,948 -ieeeFloats,949 -ifsParam,950 -ijDirectionIncrementGiven,951 -implementationDateOfModelCycle,952 -incrementOfLengths,953 -indexTemplate,954 -indexTemplateNumber,955 -indexedStorageInternalNodeK,956 -indexingDate,957 -indexingTime,958 -indicatorOfParameter,959 -indicatorOfTypeOfLevel,960 -indicatorOfUnitForTimeIncrement,961 -indicatorOfUnitForTimeRange,962 -indicatorOfUnitOfTimeRange,963 -inputDataPresentIndicator,964 -inputDelayedDescriptorReplicationFactor,965 -inputExtendedDelayedDescriptorReplicationFactor,966 -inputOriginatingCentre,967 -inputOverriddenReferenceValues,968 -inputProcessIdentifier,969 -inputShortDelayedDescriptorReplicationFactor,970 -instrument,971 -instrumentIdentifier,972 -instrumentType,973 -integerPointValues,974 -integerScaleFactor,975 -integerScalingFactorAppliedToDirections,976 -integerScalingFactorAppliedToFrequencies,977 -integerValues,978 -internalVersion,979 -internationalDataSubCategory,980 -interpretationOfNumberOfPoints,981 -intervalBetweenTimes,982 -isAccumulation,983 -isAuto,984 -isCavok,985 -isCavokTrend1,986 -isCavokTrend2,987 -isCavokTrend3,988 -isCavokTrend4,989 -isConstant,990 -isCorrection,991 -isEPS,992 -isEps,993 -isFillup,994 -isHindcast,995 -isOctahedral,996 -isRotatedGrid,997 -isSatellite,998 -isSatelliteType,999 -isSens,1000 -is_aerosol,1001 -is_aerosol_optical,1002 -is_chemical,1003 -is_chemical_distfn,1004 -is_efas,1005 -is_ocean2d_param,1006 -is_ocean3d_param,1007 -is_s2s,1008 -is_tigge,1009 -is_uerra,1010 -isectionNumber2,1011 -isectionNumber3,1012 -isectionNumber4,1013 -isotopeIdentificationNumber,1014 -iteration,1015 -iterationNumber,1016 -iteratorDisableUnrotate,1017 -jDirectionIncrement,1018 -jDirectionIncrementGiven,1019 -jDirectionIncrementGridLength,1020 -jDirectionIncrementInDegrees,1021 -jIncrement,1022 -jPointsAreConsecutive,1023 -jScansPositively,1024 -julianDay,1025 -julianForecastDay,1026 -keyData,1027 -keyMore,1028 -keySat,1029 -kindOfProduct,1030 -kurt,1031 -kurtosis,1032 -lBB,1033 -landtype,1034 -laplacianOperator,1035 -laplacianOperatorIsSet,1036 -laplacianScalingFactor,1037 -laplacianScalingFactorUnset,1038 -lastMonthUsedToBuildClimateMonth1,1039 -lastMonthUsedToBuildClimateMonth2,1040 -latLonValues,1041 -latitude,1042 -latitudeFirstInDegrees,1043 -latitudeLastInDegrees,1044 -latitudeLongitudeValues,1045 -latitudeOfCentralPointInClusterDomain,1046 -latitudeOfCentrePoint,1047 -latitudeOfCentrePointInDegrees,1048 -latitudeOfFirstGridPoint,1049 -latitudeOfFirstGridPointInDegrees,1050 -latitudeOfIcosahedronPole,1051 -latitudeOfLastGridPoint,1052 -latitudeOfLastGridPointInDegrees,1053 -latitudeOfNorthWestCornerOfArea,1054 -latitudeOfReferencePoint,1055 -latitudeOfReferencePointInDegrees,1056 -latitudeOfSouthEastCornerOfArea,1057 -latitudeOfSouthernPole,1058 -latitudeOfSouthernPoleInDegrees,1059 -latitudeOfStretchingPole,1060 -latitudeOfStretchingPoleInDegrees,1061 -latitudeOfSubSatellitePoint,1062 -latitudeOfSubSatellitePointInDegrees,1063 -latitudeOfTangencyPoint,1064 -latitudeOfThePoleOfStretching,1065 -latitudeOfThePolePoint,1066 -latitudeOfThePolePointInDegrees,1067 -latitudeOfTheSouthernPoleOfProjection,1068 -latitudeSexagesimal,1069 -latitudeWhereDxAndDyAreSpecified,1070 -latitudeWhereDxAndDyAreSpecifiedInDegrees,1071 -latitudes,1072 -latitudesList,1073 -latitudinalDirectionGridLength,1074 -lcwfvSuiteName,1075 -leadtime,1076 -legBaseDate,1077 -legBaseTime,1078 -legNumber,1079 -legacyGaussSubarea,1080 -lengthDescriptors,1081 -lengthIncrementForTheGroupLengths,1082 -lengthOf4DvarWindow,1083 -lengthOfHeaders,1084 -lengthOfIndexTemplate,1085 -lengthOfMessage,1086 -lengthOfOriginatorLocalTemplate,1087 -lengthOfProjectLocalTemplate,1088 -lengthOfTimeRange,1089 -lev,1090 -levTypeName,1091 -level,1092 -levelIndicator,1093 -levelType,1094 -levelist,1095 -levels,1096 -levtype,1097 -libraryVersion,1098 -listMembersMissing,1099 -listMembersMissing2,1100 -listMembersMissing3,1101 -listMembersMissing4,1102 -listMembersUsed,1103 -listMembersUsed2,1104 -listMembersUsed3,1105 -listMembersUsed4,1106 -listOfContributingSpectralBands,1107 -listOfDistributionFunctionParameter,1108 -listOfEnsembleForecastNumbers,1109 -listOfModelIdentifiers,1110 -listOfParametersUsedForClustering,1111 -listOfScaledFrequencies,1112 -local,1113 -localDateTime,1114 -localDay,1115 -localDecimalScaleFactor,1116 -localDefNumberOne,1117 -localDefNumberTwo,1118 -localDefinition,1119 -localDefinitionNumber,1120 -localDir,1121 -localExtensionPadding,1122 -localFlag,1123 -localFlagLatestVersion,1124 -localHour,1125 -localLatitude,1126 -localLatitude1,1127 -localLatitude2,1128 -localLongitude,1129 -localLongitude1,1130 -localLongitude2,1131 -localMinute,1132 -localMonth,1133 -localNumberOfObservations,1134 -localSecond,1135 -localSection,1136 -localSectionPresent,1137 -localTablesVersion,1138 -localTablesVersionNumber,1139 -localUsePresent,1140 -localYear,1141 -local_padding,1142 -local_use,1143 -logTransform,1144 -longitude,1145 -longitudeFirstInDegrees,1146 -longitudeLastInDegrees,1147 -longitudeOfCentralPointInClusterDomain,1148 -longitudeOfCentrePoint,1149 -longitudeOfCentrePointInDegrees,1150 -longitudeOfFirstDiamondCenterLine,1151 -longitudeOfFirstDiamondCentreLine,1152 -longitudeOfFirstDiamondCentreLineInDegrees,1153 -longitudeOfFirstGridPoint,1154 -longitudeOfFirstGridPointInDegrees,1155 -longitudeOfIcosahedronPole,1156 -longitudeOfLastGridPoint,1157 -longitudeOfLastGridPointInDegrees,1158 -longitudeOfNorthWestCornerOfArea,1159 -longitudeOfReferencePoint,1160 -longitudeOfReferencePointInDegrees,1161 -longitudeOfSouthEastCornerOfArea,1162 -longitudeOfSouthernPole,1163 -longitudeOfSouthernPoleInDegrees,1164 -longitudeOfStretchingPole,1165 -longitudeOfStretchingPoleInDegrees,1166 -longitudeOfSubSatellitePoint,1167 -longitudeOfSubSatellitePointInDegrees,1168 -longitudeOfTangencyPoint,1169 -longitudeOfThePoleOfStretching,1170 -longitudeOfThePolePoint,1171 -longitudeOfThePolePointInDegrees,1172 -longitudeOfTheSouthernPoleOfProjection,1173 -longitudeSexagesimal,1174 -longitudes,1175 -longitudesList,1176 -longitudinalDirectionGridLength,1177 -lowerLimit,1178 -lowerRange,1179 -lowerThreshold,1180 -lowerThresholdValue,1181 -ls_labeling,1182 -lsdate_bug,1183 -m,1184 -mAngleMultiplier,1185 -mBasicAngle,1186 -mars,1187 -marsClass,1188 -marsClass1,1189 -marsClass2,1190 -marsDir,1191 -marsDomain,1192 -marsEndStep,1193 -marsExperimentOffset,1194 -marsExpver,1195 -marsForecastMonth,1196 -marsGrid,1197 -marsIdent,1198 -marsKeywords,1199 -marsKeywords1,1200 -marsLamModel,1201 -marsLatitude,1202 -marsLevel,1203 -marsLevelist,1204 -marsLongitude,1205 -marsModel,1206 -marsParam,1207 -marsQuantile,1208 -marsRange,1209 -marsStartStep,1210 -marsStep,1211 -marsStream,1212 -marsStream1,1213 -marsStream2,1214 -marsType,1215 -marsType1,1216 -marsType2,1217 -mars_labeling,1218 -mask,1219 -masterDir,1220 -masterTableNumber,1221 -masterTablesVersionNumber,1222 -masterTablesVersionNumberLatest,1223 -matchAerosolBinNumber,1224 -matchAerosolPacking,1225 -matchLandType,1226 -matchSort,1227 -matchTimeRepres,1228 -matrixBitmapsPresent,1229 -matrixOfValues,1230 -max,1231 -maximum,1232 -md5Data,1233 -md5DataSection,1234 -md5GridSection,1235 -md5Headers,1236 -md5Product,1237 -md5Section1,1238 -md5Section10,1239 -md5Section2,1240 -md5Section3,1241 -md5Section4,1242 -md5Section5,1243 -md5Section6,1244 -md5Section7,1245 -md5Section8,1246 -md5Section9,1247 -md5Structure,1248 -md5TimeDomainSection,1249 -meanRVR1,1250 -meanRVR2,1251 -meanRVR3,1252 -meanRVR4,1253 -meanSize,1254 -meanValueRVR1,1255 -meanValueRVR2,1256 -meanValueRVR3,1257 -meanValueRVR4,1258 -meaningOfVerticalCoordinate,1259 -memberNumber,1260 -messageLength,1261 -metadata,1262 -method,1263 -methodNumber,1264 -million,1265 -min,1266 -minimum,1267 -minute,1268 -minuteOfAnalysis,1269 -minuteOfEndOfOverallTimeInterval,1270 -minuteOfForecast,1271 -minuteOfModelVersion,1272 -minuteOfReference,1273 -minutesAfterDataCutoff,1274 -minutesAfterReferenceTimeOfDataCutoff,1275 -missingDataFlag,1276 -missingValue,1277 -missingValueManagement,1278 -missingValueManagementUsed,1279 -missingValuesPresent,1280 -mixedCoordinateDefinition,1281 -mixedCoordinateFieldFlag,1282 -modeNumber,1283 -model,1284 -modelErrorType,1285 -modelIdentifier,1286 -modelName,1287 -modelVersionDate,1288 -modelVersionTime,1289 -molarMass,1290 -month,1291 -monthOfAnalysis,1292 -monthOfEndOfOverallTimeInterval,1293 -monthOfForecast,1294 -monthOfModelVersion,1295 -monthOfReference,1296 -monthlyVerificationDate,1297 -monthlyVerificationMonth,1298 -monthlyVerificationTime,1299 -monthlyVerificationYear,1300 -multiplicationFactorForLatLong,1301 -mybits,1302 -n,1303 -n2,1304 -n3,1305 -na,1306 -name,1307 -nameECMF,1308 -nameOfFirstFixedSurface,1309 -nameOfSecondFixedSurface,1310 -names,1311 -nd,1312 -neitherPresent,1313 -newSubtype,1314 -nlev,1315 -nnn,1316 -normAtFinalTime,1317 -normAtInitialTime,1318 -normal,1319 -northLatitudeOfCluster,1320 -northLatitudeOfDomainOfTubing,1321 -northWestLatitudeOfLPOArea,1322 -northWestLatitudeOfVerficationArea,1323 -northWestLongitudeOfLPOArea,1324 -northWestLongitudeOfVerficationArea,1325 -northernLatitudeOfClusterDomain,1326 -northernLatitudeOfDomain,1327 -nosigPresent,1328 -notDecoded,1329 -nt,1330 -number,1331 -numberInHorizontalCoordinates,1332 -numberInMixedCoordinateDefinition,1333 -numberInTheAuxiliaryArray,1334 -numberInTheGridCoordinateList,1335 -numberIncludedInAverage,1336 -numberMissingFromAveragesOrAccumulations,1337 -numberOfAnalysis,1338 -numberOfBits,1339 -numberOfBitsContainingEachPackedValue,1340 -numberOfBitsForScaledGroupLengths,1341 -numberOfBitsUsedForTheGroupWidths,1342 -numberOfBitsUsedForTheScaledGroupLengths,1343 -numberOfBytesInLocalDefinition,1344 -numberOfBytesOfFreeFormatData,1345 -numberOfBytesPerInteger,1346 -numberOfCategories,1347 -numberOfCharacters,1348 -numberOfChars,1349 -numberOfClusterHighResolution,1350 -numberOfClusterLowResolution,1351 -numberOfClusters,1352 -numberOfCodedValues,1353 -numberOfCoefficientsOrValuesUsedToSpecifyFirstDimensionCoordinateFunction,1354 -numberOfCoefficientsOrValuesUsedToSpecifySecondDimensionCoordinateFunction,1355 -numberOfColumns,1356 -numberOfComponents,1357 -numberOfContributingSpectralBands,1358 -numberOfControlForecastTube,1359 -numberOfCoordinatesValues,1360 -numberOfDataBinsAlongRadials,1361 -numberOfDataMatrices,1362 -numberOfDataPoints,1363 -numberOfDataPointsExpected,1364 -numberOfDataValues,1365 -numberOfDaysInClimateSamplingWindow,1366 -numberOfDiamonds,1367 -numberOfDirections,1368 -numberOfDistinctSection3s,1369 -numberOfDistinctSection4s,1370 -numberOfDistinctSection5s,1371 -numberOfDistinctSection6s,1372 -numberOfDistinctSection7s,1373 -numberOfDistinctSection8s,1374 -numberOfDistinctSection9s,1375 -numberOfDistributionFunctionParameters,1376 -numberOfEffectiveValues,1377 -numberOfFloats,1378 -numberOfForcasts,1379 -numberOfForecastsInCluster,1380 -numberOfForecastsInEnsemble,1381 -numberOfForecastsInTheCluster,1382 -numberOfForecastsInTube,1383 -numberOfFrequencies,1384 -numberOfGridInReference,1385 -numberOfGridUsed,1386 -numberOfGroups,1387 -numberOfGroupsOfDataValues,1388 -numberOfHorizontalPoints,1389 -numberOfIntegers,1390 -numberOfInts,1391 -numberOfIterations,1392 -numberOfLocalDefinitions,1393 -numberOfLogicals,1394 -numberOfMembersInCluster,1395 -numberOfMembersInEnsemble,1396 -numberOfMissing,1397 -numberOfMissingInStatisticalProcess,1398 -numberOfMissingValues,1399 -numberOfModeOfDistribution,1400 -numberOfModels,1401 -numberOfOctectsForNumberOfPoints,1402 -numberOfOctetsExtraDescriptors,1403 -numberOfOperationalForecastTube,1404 -numberOfPackedValues,1405 -numberOfParallelsBetweenAPoleAndTheEquator,1406 -numberOfParametersUsedForClustering,1407 -numberOfPartitions,1408 -numberOfPoints,1409 -numberOfPointsAlongAMeridian,1410 -numberOfPointsAlongAParallel,1411 -numberOfPointsAlongFirstAxis,1412 -numberOfPointsAlongSecondAxis,1413 -numberOfPointsAlongTheXAxis,1414 -numberOfPointsAlongTheYAxis,1415 -numberOfPointsAlongXAxis,1416 -numberOfPointsAlongXAxisInCouplingArea,1417 -numberOfPointsAlongYAxis,1418 -numberOfPointsAlongYAxisInCouplingArea,1419 -numberOfPointsInDomain,1420 -numberOfPointsUsed,1421 -numberOfPressureLevelsUsedForClustering,1422 -numberOfRadarSitesUsed,1423 -numberOfRadials,1424 -numberOfReforecastYearsInModelClimate,1425 -numberOfRemaininChars,1426 -numberOfRepresentativeMember,1427 -numberOfReservedBytes,1428 -numberOfRows,1429 -numberOfSecondOrderPackedValues,1430 -numberOfSection,1431 -numberOfSingularVectorsComputed,1432 -numberOfSingularVectorsEvolved,1433 -numberOfStepsUsedForClustering,1434 -numberOfSubsets,1435 -numberOfTensOfThousandsOfYearsOfOffset,1436 -numberOfTimeRange,1437 -numberOfTimeSteps,1438 -numberOfUnexpandedDescriptors,1439 -numberOfUnusedBitsAtEndOfSection3,1440 -numberOfUsedSpatialTiles,1441 -numberOfUsedTileAttributes,1442 -numberOfUsefulPointsAlongXAxis,1443 -numberOfUsefulPointsAlongYAxis,1444 -numberOfVGridUsed,1445 -numberOfValues,1446 -numberOfVerticalCoordinateValues,1447 -numberOfVerticalGridDescriptors,1448 -numberOfVerticalPoints,1449 -numberingOrderOfDiamonds,1450 -numericValues,1451 -observablePropertyTemplate,1452 -observablePropertyTemplateNumber,1453 -observationDiagnostic,1454 -observationGeneratingProcessIdentifier,1455 -observationType,1456 -observedData,1457 -obstype,1458 -oceanAtmosphereCoupling,1459 -oceanLevName,1460 -oceanStream,1461 -octetAtWichPackedDataBegins,1462 -offset,1463 -offsetAfterBitmap,1464 -offsetAfterCentreLocalSection,1465 -offsetAfterData,1466 -offsetAfterLocalSection,1467 -offsetAfterPadding,1468 -offsetBBitmap,1469 -offsetBSection5,1470 -offsetBSection6,1471 -offsetBSection9,1472 -offsetBeforeBitmap,1473 -offsetBeforeData,1474 -offsetBeforePL,1475 -offsetBeforePV,1476 -offsetDescriptors,1477 -offsetEndSection4,1478 -offsetFreeFormData,1479 -offsetFromOriginToInnerBound,1480 -offsetFromReferenceOfFirstTime,1481 -offsetICEFieldsUsed,1482 -offsetSection0,1483 -offsetSection1,1484 -offsetSection10,1485 -offsetSection11,1486 -offsetSection2,1487 -offsetSection3,1488 -offsetSection4,1489 -offsetSection5,1490 -offsetSection6,1491 -offsetSection7,1492 -offsetSection8,1493 -offsetSection9,1494 -offsetToEndOf4DvarWindow,1495 -offsetValuesBy,1496 -oldSubtype,1497 -one,1498 -oneConstant,1499 -oneMillionConstant,1500 -oneMinuteMeanMaximumRVR1,1501 -oneMinuteMeanMaximumRVR2,1502 -oneMinuteMeanMaximumRVR3,1503 -oneMinuteMeanMaximumRVR4,1504 -oneMinuteMeanMinimumRVR1,1505 -oneMinuteMeanMinimumRVR2,1506 -oneMinuteMeanMinimumRVR3,1507 -oneMinuteMeanMinimumRVR4,1508 -oneThousand,1509 -oper,1510 -operStream,1511 -operatingMode,1512 -operationalForecastCluster,1513 -optimisationTime,1514 -optimizeScaleFactor,1515 -optionalData,1516 -opttime,1517 -orderOfSPD,1518 -orderOfSpatialDifferencing,1519 -orientationOfTheGrid,1520 -orientationOfTheGridInDegrees,1521 -origin,1522 -originalParameterNumber,1523 -originalParameterTableNumber,1524 -originalSubCentreIdentifier,1525 -originatingCentre,1526 -originatingCentreOfAnalysis,1527 -originatorLocalTemplate,1528 -originatorLocalTemplateNumber,1529 -overlayTemplate,1530 -overlayTemplateNumber,1531 -pack,1532 -packedValues,1533 -packingError,1534 -packingType,1535 -padding,1536 -padding_grid1_1,1537 -padding_grid1_2,1538 -padding_grid3_1,1539 -padding_grid4_1,1540 -padding_grid50_1,1541 -padding_grid5_1,1542 -padding_grid90_1,1543 -padding_loc10_1,1544 -padding_loc12_1,1545 -padding_loc13_1,1546 -padding_loc13_2,1547 -padding_loc13_3,1548 -padding_loc13_4,1549 -padding_loc13_5,1550 -padding_loc14_1,1551 -padding_loc14_2,1552 -padding_loc15_1,1553 -padding_loc16_1,1554 -padding_loc17_2,1555 -padding_loc18_1,1556 -padding_loc18_2,1557 -padding_loc190_1,1558 -padding_loc191_1,1559 -padding_loc191_2,1560 -padding_loc191_3,1561 -padding_loc192_1,1562 -padding_loc19_2,1563 -padding_loc20_1,1564 -padding_loc21_1,1565 -padding_loc23_1,1566 -padding_loc244_1,1567 -padding_loc244_2,1568 -padding_loc244_3,1569 -padding_loc245_1,1570 -padding_loc245_2,1571 -padding_loc26_1,1572 -padding_loc27_1,1573 -padding_loc27_2,1574 -padding_loc28_1,1575 -padding_loc29_1,1576 -padding_loc29_2,1577 -padding_loc29_3,1578 -padding_loc2_1,1579 -padding_loc2_2,1580 -padding_loc30_1,1581 -padding_loc30_2,1582 -padding_loc37_1,1583 -padding_loc37_2,1584 -padding_loc38_1,1585 -padding_loc3_1,1586 -padding_loc4_2,1587 -padding_loc50_1,1588 -padding_loc5_1,1589 -padding_loc6_1,1590 -padding_loc7_1,1591 -padding_loc9_1,1592 -padding_loc9_2,1593 -padding_local11_1,1594 -padding_local1_1,1595 -padding_local1_31,1596 -padding_local40_1,1597 -padding_local_35,1598 -padding_local_7_1,1599 -padding_sec1_loc,1600 -padding_sec2_1,1601 -padding_sec2_2,1602 -padding_sec2_3,1603 -padding_sec3_1,1604 -padding_sec4_1,1605 -paleontologicalOffset,1606 -param,1607 -paramId,1608 -paramIdECMF,1609 -param_value_max,1610 -param_value_min,1611 -parameter,1612 -parameterCategory,1613 -parameterCode,1614 -parameterDiscipline,1615 -parameterIndicator,1616 -parameterName,1617 -parameterNumber,1618 -parameterUnits,1619 -parameters,1620 -parametersVersion,1621 -partitionItems,1622 -partitionNumber,1623 -partitionTable,1624 -partitions,1625 -pastTendencyRVR1,1626 -pastTendencyRVR2,1627 -pastTendencyRVR3,1628 -pastTendencyRVR4,1629 -patch_precip_fp,1630 -pentagonalResolutionParameterJ,1631 -pentagonalResolutionParameterK,1632 -pentagonalResolutionParameterM,1633 -percentileValue,1634 -periodOfTime,1635 -periodOfTimeIntervals,1636 -perturbationNumber,1637 -perturbedType,1638 -phase,1639 -physicalFlag1,1640 -physicalFlag2,1641 -physicalMeaningOfVerticalCoordinate,1642 -pl,1643 -platform,1644 -plusOneinOrdersOfSPD,1645 -points,1646 -postAuxiliary,1647 -postAuxiliaryArrayPresent,1648 -powerOfTenUsedToScaleClimateWeight,1649 -preBitmapValues,1650 -preProcessingParameter,1651 -precision,1652 -precisionOfTheUnpackedSubset,1653 -predefined_grid,1654 -predefined_grid_values,1655 -present,1656 -presentTrend1,1657 -presentTrend2,1658 -presentTrend3,1659 -presentTrend4,1660 -presentWeather1Present,1661 -presentWeather1PresentTrend1,1662 -presentWeather1PresentTrend2,1663 -presentWeather1PresentTrend3,1664 -presentWeather1PresentTrend4,1665 -presentWeather2Present,1666 -presentWeather2PresentTrend1,1667 -presentWeather2PresentTrend2,1668 -presentWeather2PresentTrend3,1669 -presentWeather2PresentTrend4,1670 -presentWeather3Present,1671 -presentWeather3PresentTrend1,1672 -presentWeather3PresentTrend2,1673 -presentWeather3PresentTrend3,1674 -presentWeather3PresentTrend4,1675 -pressureLevel,1676 -pressureUnits,1677 -primaryBitmap,1678 -primaryMissingValue,1679 -primaryMissingValueSubstitute,1680 -probContinous,1681 -probPoint,1682 -probProductDefinition,1683 -probabilityType,1684 -probabilityTypeName,1685 -process,1686 -produceLargeConstantFields,1687 -product,1688 -productDefinition,1689 -productDefinitionTemplateNumber,1690 -productDefinitionTemplateNumberInternal,1691 -productIdentifier,1692 -productType,1693 -productionStatusOfProcessedData,1694 -projectLocalTemplate,1695 -projectLocalTemplateNumber,1696 -projectionCenterFlag,1697 -projectionCentreFlag,1698 -pv,1699 -pvlLocation,1700 -qfe,1701 -qfePresent,1702 -qfeUnits,1703 -qnh,1704 -qnhAPresent,1705 -qnhPresent,1706 -qnhUnits,1707 -qualityControl,1708 -qualityControlIndicator,1709 -qualityValueAssociatedWithParameter,1710 -quantile,1711 -radialAngularSpacing,1712 -radials,1713 -radius,1714 -radiusInMetres,1715 -radiusOfCentralCluster,1716 -radiusOfClusterDomain,1717 -radiusOfTheEarth,1718 -range,1719 -rangeBinSpacing,1720 -rdbDateTime,1721 -rdbSubtype,1722 -rdbType,1723 -rdb_key,1724 -rdbtime,1725 -rdbtimeDate,1726 -rdbtimeDay,1727 -rdbtimeHour,1728 -rdbtimeMinute,1729 -rdbtimeMonth,1730 -rdbtimeSecond,1731 -rdbtimeTime,1732 -rdbtimeYear,1733 -realPart,1734 -realPartOf00,1735 -recDateTime,1736 -recentWeather,1737 -recentWeatherTry,1738 -rectime,1739 -rectimeDay,1740 -rectimeHour,1741 -rectimeMinute,1742 -rectimeSecond,1743 -reducedGrid,1744 -refdate,1745 -reference,1746 -referenceDate,1747 -referenceForGroupLengths,1748 -referenceForGroupWidths,1749 -referenceOfLengths,1750 -referenceOfWidths,1751 -referenceReflectivityForEchoTop,1752 -referenceSampleInterval,1753 -referenceStep,1754 -referenceValue,1755 -referenceValueError,1756 -reflectivityCalibrationConstant,1757 -remarkPresent,1758 -reportType,1759 -representationMode,1760 -representationType,1761 -representativeMember,1762 -reserved,1763 -reserved1,1764 -reserved2,1765 -reserved3,1766 -reservedNeedNotBePresent,1767 -reservedOctet,1768 -reservedSection2,1769 -reservedSection3,1770 -reservedSection4,1771 -resolutionAndComponentFlags,1772 -resolutionAndComponentFlags1,1773 -resolutionAndComponentFlags2,1774 -resolutionAndComponentFlags3,1775 -resolutionAndComponentFlags4,1776 -resolutionAndComponentFlags6,1777 -resolutionAndComponentFlags7,1778 -resolutionAndComponentFlags8,1779 -rootGroupObjectHeaderAddress,1780 -rootGroupSymbolTableEntry,1781 -rootTablesDir,1782 -roundedMarsLatitude,1783 -roundedMarsLevelist,1784 -roundedMarsLongitude,1785 -runwayBrakingActionState1,1786 -runwayBrakingActionState2,1787 -runwayBrakingActionState3,1788 -runwayBrakingActionState4,1789 -runwayDepositCodeState1,1790 -runwayDepositCodeState2,1791 -runwayDepositCodeState3,1792 -runwayDepositCodeState4,1793 -runwayDepositState1,1794 -runwayDepositState2,1795 -runwayDepositState3,1796 -runwayDepositState4,1797 -runwayDepthOfDepositCodeState1,1798 -runwayDepthOfDepositCodeState2,1799 -runwayDepthOfDepositCodeState3,1800 -runwayDepthOfDepositCodeState4,1801 -runwayDepthOfDepositState1,1802 -runwayDepthOfDepositState2,1803 -runwayDepthOfDepositState3,1804 -runwayDepthOfDepositState4,1805 -runwayDesignatorRVR1,1806 -runwayDesignatorRVR2,1807 -runwayDesignatorRVR3,1808 -runwayDesignatorRVR4,1809 -runwayDesignatorState1,1810 -runwayDesignatorState2,1811 -runwayDesignatorState3,1812 -runwayDesignatorState4,1813 -runwayExtentOfContaminationCodeState1,1814 -runwayExtentOfContaminationCodeState2,1815 -runwayExtentOfContaminationCodeState3,1816 -runwayExtentOfContaminationCodeState4,1817 -runwayExtentOfContaminationState1,1818 -runwayExtentOfContaminationState2,1819 -runwayExtentOfContaminationState3,1820 -runwayExtentOfContaminationState4,1821 -runwayFrictionCodeValueState1,1822 -runwayFrictionCodeValueState2,1823 -runwayFrictionCodeValueState3,1824 -runwayFrictionCodeValueState4,1825 -runwayFrictionCoefficientCodeState1,1826 -runwayFrictionCoefficientCodeState2,1827 -runwayFrictionCoefficientCodeState3,1828 -runwayFrictionCoefficientCodeState4,1829 -runwayFrictionCoefficientState1,1830 -runwayFrictionCoefficientState2,1831 -runwayFrictionCoefficientState3,1832 -runwayFrictionCoefficientState4,1833 -runwaySideCodeState1,1834 -runwaySideCodeState2,1835 -runwaySideCodeState3,1836 -runwaySideCodeState4,1837 -runwayState,1838 -sampleSizeOfModelClimate,1839 -satelliteID,1840 -satelliteIdentifier,1841 -satelliteNumber,1842 -satelliteSeries,1843 -scaleFactorAtReferencePoint,1844 -scaleFactorOfCentralWaveNumber,1845 -scaleFactorOfDistanceFromEnsembleMean,1846 -scaleFactorOfDistributionFunctionParameter,1847 -scaleFactorOfEarthMajorAxis,1848 -scaleFactorOfEarthMinorAxis,1849 -scaleFactorOfFirstFixedSurface,1850 -scaleFactorOfFirstSize,1851 -scaleFactorOfFirstWavelength,1852 -scaleFactorOfLengthOfSemiMajorAxis,1853 -scaleFactorOfLengthOfSemiMinorAxis,1854 -scaleFactorOfLowerLimit,1855 -scaleFactorOfMajorAxisOfOblateSpheroidEarth,1856 -scaleFactorOfMinorAxisOfOblateSpheroidEarth,1857 -scaleFactorOfPrimeMeridianOffset,1858 -scaleFactorOfRadiusOfSphericalEarth,1859 -scaleFactorOfSecondFixedSurface,1860 -scaleFactorOfSecondSize,1861 -scaleFactorOfSecondWavelength,1862 -scaleFactorOfStandardDeviation,1863 -scaleFactorOfStandardDeviationInTheCluster,1864 -scaleFactorOfUpperLimit,1865 -scaleValuesBy,1866 -scaledDirections,1867 -scaledFrequencies,1868 -scaledValueOfCentralWaveNumber,1869 -scaledValueOfDistanceFromEnsembleMean,1870 -scaledValueOfDistributionFunctionParameter,1871 -scaledValueOfEarthMajorAxis,1872 -scaledValueOfEarthMinorAxis,1873 -scaledValueOfFirstFixedSurface,1874 -scaledValueOfFirstSize,1875 -scaledValueOfFirstWavelength,1876 -scaledValueOfLengthOfSemiMajorAxis,1877 -scaledValueOfLengthOfSemiMinorAxis,1878 -scaledValueOfLowerLimit,1879 -scaledValueOfMajorAxisOfOblateSpheroidEarth,1880 -scaledValueOfMinorAxisOfOblateSpheroidEarth,1881 -scaledValueOfPrimeMeridianOffset,1882 -scaledValueOfRadiusOfSphericalEarth,1883 -scaledValueOfSecondFixedSurface,1884 -scaledValueOfSecondSize,1885 -scaledValueOfSecondWavelength,1886 -scaledValueOfStandardDeviation,1887 -scaledValueOfStandardDeviationInTheCluster,1888 -scaledValueOfUpperLimit,1889 -scalingFactorForFrequencies,1890 -scanPosition,1891 -scanningMode,1892 -scanningMode4,1893 -scanningMode5,1894 -scanningMode6,1895 -scanningMode7,1896 -scanningMode8,1897 -scanningModeForOneDiamond,1898 -sd,1899 -second,1900 -secondDimension,1901 -secondDimensionCoordinateValueDefinition,1902 -secondDimensionPhysicalSignificance,1903 -secondLatitude,1904 -secondLatitudeInDegrees,1905 -secondOfEndOfOverallTimeInterval,1906 -secondOfForecast,1907 -secondOfModelVersion,1908 -secondOrderFlags,1909 -secondOrderOfDifferentWidth,1910 -secondOrderValuesDifferentWidths,1911 -secondaryBitMap,1912 -secondaryBitmap,1913 -secondaryBitmapPresent,1914 -secondaryBitmaps,1915 -secondaryBitmapsCount,1916 -secondaryBitmapsSize,1917 -secondaryMissingValue,1918 -secondaryMissingValueSubstitute,1919 -secondsOfAnalysis,1920 -secondsOfReference,1921 -section,1922 -section0Length,1923 -section0Pointer,1924 -section1,1925 -section10Length,1926 -section10Pointer,1927 -section11Length,1928 -section11Pointer,1929 -section1Flags,1930 -section1Length,1931 -section1Padding,1932 -section1Pointer,1933 -section2Length,1934 -section2Padding,1935 -section2Pointer,1936 -section2Present,1937 -section2Used,1938 -section3Flags,1939 -section3Length,1940 -section3Padding,1941 -section3Pointer,1942 -section3UniqueIdentifier,1943 -section4,1944 -section4Length,1945 -section4Padding,1946 -section4Pointer,1947 -section4UniqueIdentifier,1948 -section5,1949 -section5Length,1950 -section5Pointer,1951 -section5UniqueIdentifier,1952 -section6,1953 -section6Length,1954 -section6Pointer,1955 -section6UniqueIdentifier,1956 -section7,1957 -section7Length,1958 -section7Pointer,1959 -section7UniqueIdentifier,1960 -section8,1961 -section8Length,1962 -section8Pointer,1963 -section8UniqueIdentifier,1964 -section9Length,1965 -section9Pointer,1966 -section9UniqueIdentifier,1967 -sectionLengthLimitForEnsembles,1968 -sectionLengthLimitForProbability,1969 -sectionNumber,1970 -sectionPosition,1971 -section_01,1972 -section_02,1973 -section_03,1974 -section_04,1975 -section_05,1976 -section_06,1977 -section_07,1978 -section_08,1979 -section_09,1980 -section_1,1981 -section_10,1982 -section_11,1983 -section_2,1984 -section_3,1985 -section_4,1986 -section_5,1987 -section_6,1988 -section_7,1989 -section_8,1990 -selectStepTemplateInstant,1991 -selectStepTemplateInterval,1992 -sensitiveAreaDomain,1993 -sequences,1994 -setBitsPerValue,1995 -setCalendarId,1996 -setDecimalPrecision,1997 -setLocalDefinition,1998 -setToMissingIfOutOfRange,1999 -sfc_levtype,2000 -shapeOfTheEarth,2001 -shapeOfVerificationArea,2002 -shortName,2003 -shortNameECMF,2004 -short_name,2005 -signature,2006 -significanceOfReferenceDateAndTime,2007 -significanceOfReferenceTime,2008 -simpleThinningMissingRadius,2009 -simpleThinningSkip,2010 -simpleThinningStart,2011 -siteElevation,2012 -siteId,2013 -siteLatitude,2014 -siteLongitude,2015 -sizeOfLength,2016 -sizeOfOffsets,2017 -sizeOfPostAuxiliaryArray,2018 -sizeOfPostAuxiliaryArrayPlusOne,2019 -skew,2020 -skewness,2021 -skipExtraKeyAttributes,2022 -sort,2023 -sourceOfGridDefinition,2024 -sourceSinkChemicalPhysicalProcess,2025 -southEastLatitudeOfLPOArea,2026 -southEastLatitudeOfVerficationArea,2027 -southEastLongitudeOfLPOArea,2028 -southEastLongitudeOfVerficationArea,2029 -southLatitudeOfCluster,2030 -southLatitudeOfDomainOfTubing,2031 -southPoleOnProjectionPlane,2032 -southernLatitudeOfClusterDomain,2033 -southernLatitudeOfDomain,2034 -sp1,2035 -sp2,2036 -sp3,2037 -spaceUnitFlag,2038 -spacingOfBinsAlongRadials,2039 -spare,2040 -spare2,2041 -spatialProcessing,2042 -spatialSmoothingOfProduct,2043 -spectralDataRepresentationMode,2044 -spectralDataRepresentationType,2045 -spectralMode,2046 -spectralType,2047 -sphericalHarmonics,2048 -standardDeviation,2049 -standardParallel,2050 -standardParallelInDegrees,2051 -standardParallelInMicrodegrees,2052 -startOfHeaders,2053 -startOfMessage,2054 -startOfRange,2055 -startStep,2056 -startStepInHours,2057 -startTimeStep,2058 -startingAzimuth,2059 -statisticalProcess,2060 -statisticalProcessesList,2061 -statistics,2062 -status,2063 -step,2064 -stepForClustering,2065 -stepHumanReadable,2066 -stepInHours,2067 -stepRange,2068 -stepRangeInHours,2069 -stepType,2070 -stepTypeForConversion,2071 -stepTypeInternal,2072 -stepUnits,2073 -stepZero,2074 -stream,2075 -streamOfAnalysis,2076 -stretchingFactor,2077 -stretchingFactorScaled,2078 -stringValues,2079 -subCentre,2080 -subDefinitions1,2081 -subDefinitions2,2082 -subLocalDefinition1,2083 -subLocalDefinition2,2084 -subLocalDefinitionLength1,2085 -subLocalDefinitionLength2,2086 -subLocalDefinitionNumber1,2087 -subLocalDefinitionNumber2,2088 -subSetJ,2089 -subSetK,2090 -subSetM,2091 -subcentreOfAnalysis,2092 -subdivisionsOfBasicAngle,2093 -suiteName,2094 -superblockExtensionAddress,2095 -swapScanningLat,2096 -swapScanningLon,2097 -swapScanningX,2098 -swapScanningY,2099 -system,2100 -systemNumber,2101 -t,2102 -table2Version,2103 -tableCode,2104 -tableNumber,2105 -tableReference,2106 -tablesLocalDir,2107 -tablesMasterDir,2108 -tablesVersion,2109 -tablesVersionLatest,2110 -targetCompressionRatio,2111 -td,2112 -tempPressureUnits,2113 -temperature,2114 -temperatureAndDewpointPresent,2115 -templatesLocalDir,2116 -templatesMasterDir,2117 -theHindcastMarsStream,2118 -theMessage,2119 -thisExperimentVersionNumber,2120 -thisMarsClass,2121 -thisMarsStream,2122 -thisMarsType,2123 -thousand,2124 -three,2125 -threshold,2126 -thresholdIndicator,2127 -tiggeCentre,2128 -tiggeLAMName,2129 -tiggeLocalVersion,2130 -tiggeModel,2131 -tiggeSection,2132 -tiggeSuiteID,2133 -tigge_name,2134 -tigge_short_name,2135 -tileClassification,2136 -tileIndex,2137 -time,2138 -timeCoordinateDefinition,2139 -timeDomainTemplate,2140 -timeDomainTemplateNumber,2141 -timeIncrement,2142 -timeIncrementBetweenSuccessiveFields,2143 -timeOfAnalysis,2144 -timeOfForecast,2145 -timeOfModelVersion,2146 -timeOfReference,2147 -timeRangeIndicator,2148 -timeRangeIndicatorFromStepRange,2149 -timeUnitFlag,2150 -timerepres,2151 -topLevel,2152 -total,2153 -totalAerosolBinsNumbers,2154 -totalInitialConditions,2155 -totalLength,2156 -totalNumber,2157 -totalNumberOfClusters,2158 -totalNumberOfDataValuesMissingInStatisticalProcess,2159 -totalNumberOfDirections,2160 -totalNumberOfForecastProbabilities,2161 -totalNumberOfFrequencies,2162 -totalNumberOfGridPoints,2163 -totalNumberOfIterations,2164 -totalNumberOfRepetitions,2165 -totalNumberOfTileAttributePairs,2166 -totalNumberOfTubes,2167 -totalNumberOfValuesInUnpackedSubset,2168 -totalNumberOfdimensions,2169 -treatmentOfMissingData,2170 -true,2171 -trueLengthOfLastGroup,2172 -truncateDegrees,2173 -truncateLaplacian,2174 -tsectionNumber3,2175 -tsectionNumber4,2176 -tsectionNumber5,2177 -tubeDomain,2178 -tubeNumber,2179 -two,2180 -twoOrdersOfSPD,2181 -type,2182 -typeOfAnalysis,2183 -typeOfAuxiliaryInformation,2184 -typeOfCalendar,2185 -typeOfCompressionUsed,2186 -typeOfDistributionFunction,2187 -typeOfEnsembleForecast,2188 -typeOfEnsembleMember,2189 -typeOfFirstFixedSurface,2190 -typeOfGeneratingProcess,2191 -typeOfGrid,2192 -typeOfHorizontalLine,2193 -typeOfIntervalForFirstAndSecondSize,2194 -typeOfIntervalForFirstAndSecondWavelength,2195 -typeOfLevel,2196 -typeOfLevelECMF,2197 -typeOfOriginalFieldValues,2198 -typeOfPacking,2199 -typeOfPostProcessing,2200 -typeOfPreProcessing,2201 -typeOfProcessedData,2202 -typeOfSSTFieldUsed,2203 -typeOfSecondFixedSurface,2204 -typeOfSizeInterval,2205 -typeOfStatisticalPostProcessingOfEnsembleMembers,2206 -typeOfStatisticalProcessing,2207 -typeOfTimeIncrement,2208 -typeOfTimeIncrementBetweenSuccessiveFieldsUsedInTheStatisticalProcessing,2209 -typeOfWavelengthInterval,2210 -typicalCentury,2211 -typicalDate,2212 -typicalDateTime,2213 -typicalDay,2214 -typicalHour,2215 -typicalMinute,2216 -typicalMonth,2217 -typicalSecond,2218 -typicalTime,2219 -typicalYear,2220 -typicalYear2,2221 -typicalYearOfCentury,2222 -uco,2223 -ucs,2224 -unexpandedDescriptors,2225 -unexpandedDescriptorsEncoded,2226 -unitOfOffsetFromReferenceTime,2227 -unitOfTime,2228 -unitOfTimeIncrement,2229 -unitOfTimeRange,2230 -units,2231 -unitsBias,2232 -unitsConversionOffset,2233 -unitsConversionScaleFactor,2234 -unitsDecimalScaleFactor,2235 -unitsECMF,2236 -unitsFactor,2237 -unitsOfFirstFixedSurface,2238 -unitsOfSecondFixedSurface,2239 -unknown,2240 -unpack,2241 -unpackedError,2242 -unpackedSubsetPrecision,2243 -unpackedValues,2244 -unsignedIntegers,2245 -unusedBitsInBitmap,2246 -updateSequenceNumber,2247 -upperLimit,2248 -upperRange,2249 -upperThreshold,2250 -upperThresholdValue,2251 -userDateEnd,2252 -userDateStart,2253 -userDateTimeEnd,2254 -userDateTimeStart,2255 -userTimeEnd,2256 -userTimeStart,2257 -uuidOfHGrid,2258 -uuidOfVGrid,2259 -uvRelativeToGrid,2260 -validityDate,2261 -validityTime,2262 -values,2263 -variationOfVisibility,2264 -variationOfVisibilityDirection,2265 -variationOfVisibilityDirectionAngle,2266 -variationOfVisibilityDirectionTrend1,2267 -variationOfVisibilityDirectionTrend2,2268 -variationOfVisibilityDirectionTrend3,2269 -variationOfVisibilityDirectionTrend4,2270 -variationOfVisibilityTrend1,2271 -variationOfVisibilityTrend2,2272 -variationOfVisibilityTrend3,2273 -variationOfVisibilityTrend4,2274 -varno,2275 -verificationDate,2276 -verificationMonth,2277 -verificationYear,2278 -verifyingMonth,2279 -version,2280 -versionNumOfFilesFreeSpaceStorage,2281 -versionNumOfRootGroupSymbolTableEntry,2282 -versionNumOfSharedHeaderMessageFormat,2283 -versionNumberOfExperimentalSuite,2284 -versionNumberOfGribLocalTables,2285 -versionNumberOfSuperblock,2286 -versionOfModelClimate,2287 -verticalCoordinate,2288 -verticalCoordinateDefinition,2289 -verticalDomainTemplate,2290 -verticalDomainTemplateNumber,2291 -verticalVisibility,2292 -verticalVisibilityCoded,2293 -visibility,2294 -visibilityInKilometresTrend1,2295 -visibilityInKilometresTrend2,2296 -visibilityInKilometresTrend3,2297 -visibilityInKilometresTrend4,2298 -visibilityTrend1,2299 -visibilityTrend2,2300 -visibilityTrend3,2301 -visibilityTrend4,2302 -waveDomain,2303 -weightAppliedToClimateMonth1,2304 -westLongitudeOfCluster,2305 -westLongitudeOfDomainOfTubing,2306 -westernLongitudeOfClusterDomain,2307 -westernLongitudeOfDomain,2308 -widthOfFirstOrderValues,2309 -widthOfLengths,2310 -widthOfSPD,2311 -widthOfWidths,2312 -windDirection,2313 -windDirectionTrend1,2314 -windDirectionTrend2,2315 -windDirectionTrend3,2316 -windDirectionTrend4,2317 -windGust,2318 -windGustTrend1,2319 -windGustTrend2,2320 -windGustTrend3,2321 -windGustTrend4,2322 -windPresent,2323 -windSpeed,2324 -windSpeedTrend1,2325 -windSpeedTrend2,2326 -windSpeedTrend3,2327 -windSpeedTrend4,2328 -windUnits,2329 -windUnitsTrend1,2330 -windUnitsTrend2,2331 -windUnitsTrend3,2332 -windUnitsTrend4,2333 -windVariableDirection,2334 -windVariableDirectionTrend1,2335 -windVariableDirectionTrend2,2336 -windVariableDirectionTrend3,2337 -windVariableDirectionTrend4,2338 -wrongPadding,2339 -xCoordinateOfOriginOfSectorImage,2340 -xCoordinateOfSubSatellitePoint,2341 -xDirectionGridLength,2342 -xDirectionGridLengthInMetres,2343 -xDirectionGridLengthInMillimetres,2344 -xFirst,2345 -xLast,2346 -yCoordinateOfOriginOfSectorImage,2347 -yCoordinateOfSubSatellitePoint,2348 -yDirectionGridLength,2349 -yDirectionGridLengthInMetres,2350 -yDirectionGridLengthInMillimetres,2351 -yFirst,2352 -yLast,2353 -year,2354 -yearOfAnalysis,2355 -yearOfCentury,2356 -yearOfEndOfOverallTimeInterval,2357 -yearOfForecast,2358 -yearOfModelVersion,2359 -yearOfReference,2360 -zero,2361 -zeros,2362 +cfNameLegacyECMF,406 +cfVarName,407 +cfVarNameECMF,408 +cfVarNameLegacyECMF,409 +changeDecimalPrecision,410 +changeIndicatorTrend1,411 +changeIndicatorTrend2,412 +changeIndicatorTrend3,413 +changeIndicatorTrend4,414 +changingPrecision,415 +channel,416 +channelNumber,417 +char,418 +charValues,419 +checkInternalVersion,420 +class,421 +classOfAnalysis,422 +clearTables,423 +climateDateFrom,424 +climateDateTo,425 +climatologicalRegime,426 +cloudsAbbreviation1,427 +cloudsAbbreviation1Trend1,428 +cloudsAbbreviation1Trend2,429 +cloudsAbbreviation1Trend3,430 +cloudsAbbreviation1Trend4,431 +cloudsAbbreviation2,432 +cloudsAbbreviation2Trend1,433 +cloudsAbbreviation2Trend2,434 +cloudsAbbreviation2Trend3,435 +cloudsAbbreviation2Trend4,436 +cloudsAbbreviation3,437 +cloudsAbbreviation3Trend1,438 +cloudsAbbreviation3Trend2,439 +cloudsAbbreviation3Trend3,440 +cloudsAbbreviation3Trend4,441 +cloudsAbbreviation4,442 +cloudsAbbreviation4Trend1,443 +cloudsAbbreviation4Trend2,444 +cloudsAbbreviation4Trend3,445 +cloudsAbbreviation4Trend4,446 +cloudsBase1,447 +cloudsBase1Trend1,448 +cloudsBase1Trend2,449 +cloudsBase1Trend3,450 +cloudsBase1Trend4,451 +cloudsBase2,452 +cloudsBase2Trend1,453 +cloudsBase2Trend2,454 +cloudsBase2Trend3,455 +cloudsBase2Trend4,456 +cloudsBase3,457 +cloudsBase3Trend1,458 +cloudsBase3Trend2,459 +cloudsBase3Trend3,460 +cloudsBase3Trend4,461 +cloudsBase4,462 +cloudsBase4Trend1,463 +cloudsBase4Trend2,464 +cloudsBase4Trend3,465 +cloudsBase4Trend4,466 +cloudsBaseCoded1,467 +cloudsBaseCoded1Trend1,468 +cloudsBaseCoded1Trend2,469 +cloudsBaseCoded1Trend3,470 +cloudsBaseCoded1Trend4,471 +cloudsBaseCoded2,472 +cloudsBaseCoded2Trend1,473 +cloudsBaseCoded2Trend2,474 +cloudsBaseCoded2Trend3,475 +cloudsBaseCoded2Trend4,476 +cloudsBaseCoded3,477 +cloudsBaseCoded3Trend1,478 +cloudsBaseCoded3Trend2,479 +cloudsBaseCoded3Trend3,480 +cloudsBaseCoded3Trend4,481 +cloudsBaseCoded4,482 +cloudsBaseCoded4Trend1,483 +cloudsBaseCoded4Trend2,484 +cloudsBaseCoded4Trend3,485 +cloudsBaseCoded4Trend4,486 +cloudsCode1,487 +cloudsCode1Trend1,488 +cloudsCode1Trend2,489 +cloudsCode1Trend3,490 +cloudsCode1Trend4,491 +cloudsCode2,492 +cloudsCode2Trend1,493 +cloudsCode2Trend2,494 +cloudsCode2Trend3,495 +cloudsCode2Trend4,496 +cloudsCode3,497 +cloudsCode3Trend1,498 +cloudsCode3Trend2,499 +cloudsCode3Trend3,500 +cloudsCode3Trend4,501 +cloudsCode4,502 +cloudsCode4Trend1,503 +cloudsCode4Trend2,504 +cloudsCode4Trend3,505 +cloudsCode4Trend4,506 +cloudsTitle1,507 +cloudsTitle1Trend1,508 +cloudsTitle1Trend2,509 +cloudsTitle1Trend3,510 +cloudsTitle1Trend4,511 +cloudsTitle2,512 +cloudsTitle2Trend1,513 +cloudsTitle2Trend2,514 +cloudsTitle2Trend3,515 +cloudsTitle2Trend4,516 +cloudsTitle3,517 +cloudsTitle3Trend1,518 +cloudsTitle3Trend2,519 +cloudsTitle3Trend3,520 +cloudsTitle3Trend4,521 +cloudsTitle4,522 +cloudsTitle4Trend1,523 +cloudsTitle4Trend2,524 +cloudsTitle4Trend3,525 +cloudsTitle4Trend4,526 +clusterIdentifier,527 +clusterMember1,528 +clusterMember10,529 +clusterMember2,530 +clusterMember3,531 +clusterMember4,532 +clusterMember5,533 +clusterMember6,534 +clusterMember7,535 +clusterMember8,536 +clusterMember9,537 +clusterNumber,538 +clusterSize,539 +clusteringDomain,540 +clusteringMethod,541 +clutterFilterIndicator,542 +cnmc_cmcc,543 +cnmc_isac,544 +codeFigure,545 +codeType,546 +codedNumberOfFirstOrderPackedValues,547 +codedNumberOfGroups,548 +codedValues,549 +coefsFirst,550 +coefsSecond,551 +commonBlock,552 +complexPacking,553 +componentIndex,554 +compressedData,555 +computeLaplacianOperator,556 +computeStatistics,557 +conceptDir,558 +conceptsLocalDirAll,559 +conceptsLocalDirECMF,560 +conceptsLocalMarsDirAll,561 +conceptsMasterDir,562 +conceptsMasterMarsDir,563 +consensus,564 +consensusCount,565 +const,566 +constantAntennaElevationAngle,567 +constantFieldHalfByte,568 +constituentType,569 +controlForecastCluster,570 +coordAveraging0,571 +coordAveraging1,572 +coordAveraging2,573 +coordAveraging3,574 +coordAveragingTims,575 +coordinate1End,576 +coordinate1Flag,577 +coordinate1Start,578 +coordinate2End,579 +coordinate2Flag,580 +coordinate2Start,581 +coordinate3Flag,582 +coordinate3OfFirstGridPoint,583 +coordinate3OfLastGridPoint,584 +coordinate4Flag,585 +coordinate4OfFirstGridPoint,586 +coordinate4OfLastGridPoint,587 +coordinateFlag1,588 +coordinateFlag2,589 +coordinateIndexNumber,590 +coordinatesPresent,591 +core,592 +corr1Data,593 +corr2Data,594 +corr3Data,595 +corr4Data,596 +correction,597 +correction1,598 +correction1Part,599 +correction2,600 +correction2Part,601 +correction3,602 +correction3Part,603 +correction4,604 +correction4Part,605 +count,606 +countOfGroupLengths,607 +countOfICEFieldsUsed,608 +countTotal,609 +country,610 +crcrlf,611 +createNewData,612 +crraLocalVersion,613 +crraSection,614 +crraSuiteID,615 +daLoop,616 +data,617 +dataAccessors,618 +dataCategory,619 +dataDate,620 +dataFlag,621 +dataKeys,622 +dataLength,623 +dataOrigin,624 +dataRepresentation,625 +dataRepresentationTemplate,626 +dataRepresentationTemplateNumber,627 +dataRepresentationType,628 +dataSelection,629 +dataStream,630 +dataSubCategory,631 +dataTime,632 +dataType,633 +dataValues,634 +date,635 +dateOfAnalysis,636 +dateOfForecast,637 +dateOfForecastRun,638 +dateOfIceFieldUsed,639 +dateOfModelVersion,640 +dateOfReference,641 +dateOfSSTFieldUsed,642 +dateSSTFieldUsed,643 +dateTime,644 +datumSize,645 +day,646 +dayOfAnalysis,647 +dayOfEndOfOverallTimeInterval,648 +dayOfForecast,649 +dayOfModelVersion,650 +dayOfReference,651 +dayOfTheYearDate,652 +decimalPrecision,653 +decimalScaleFactor,654 +defaultFaFieldName,655 +defaultFaLevelName,656 +defaultFaModelName,657 +defaultName,658 +defaultParameter,659 +defaultSequence,660 +defaultShortName,661 +defaultStepUnits,662 +defaultTypeOfLevel,663 +default_max_val,664 +default_min_val,665 +default_step_units,666 +definitionFilesVersion,667 +deleteCalendarId,668 +deleteExtraLocalSection,669 +deleteLocalDefinition,670 +deletePV,671 +derivedForecast,672 +dewPointTemperature,673 +diagnostic,674 +diagnosticNumber,675 +diffInDays,676 +diffInHours,677 +dimension,678 +dimensionNumber,679 +dimensionType,680 +direction,681 +directionNumber,682 +directionOfVariation,683 +directionScalingFactor,684 +dirty_statistics,685 +disableGrib1LocalSection,686 +discipline,687 +distanceFromTubeToEnsembleMean,688 +distinctLatitudes,689 +distinctLongitudes,690 +doExtractArea,691 +doExtractDateTime,692 +doExtractSubsets,693 +doSimpleThinning,694 +domain,695 +driverInformationBlockAddress,696 +dummy,697 +dummy1,698 +dummy2,699 +dummyc,700 +dx,701 +dy,702 +earthIsOblate,703 +earthMajorAxis,704 +earthMajorAxisInMetres,705 +earthMinorAxis,706 +earthMinorAxisInMetres,707 +eastLongitudeOfCluster,708 +eastLongitudeOfDomainOfTubing,709 +easternLongitudeOfClusterDomain,710 +easternLongitudeOfDomain,711 +ed,712 +edition,713 +editionNumber,714 +efas_model,715 +efas_post_proc,716 +efiOrder,717 +eight,718 +elementsTable,719 +elevation,720 +eleven,721 +endDayTrend1,722 +endDayTrend2,723 +endDayTrend3,724 +endDayTrend4,725 +endDescriptors,726 +endGridDefinition,727 +endHourTrend1,728 +endHourTrend2,729 +endHourTrend3,730 +endHourTrend4,731 +endMark,732 +endMinuteTrend1,733 +endMinuteTrend2,734 +endMinuteTrend3,735 +endMinuteTrend4,736 +endMonthTrend1,737 +endMonthTrend2,738 +endMonthTrend3,739 +endMonthTrend4,740 +endOfFileAddress,741 +endOfHeadersMarker,742 +endOfInterval,743 +endOfMessage,744 +endOfProduct,745 +endOfRange,746 +endStep,747 +endStepInHours,748 +endTimeStep,749 +endYearTrend1,750 +endYearTrend2,751 +endYearTrend3,752 +endYearTrend4,753 +energyNorm,754 +enorm,755 +ensembleForecastNumbers,756 +ensembleForecastNumbersList,757 +ensembleSize,758 +ensembleStandardDeviation,759 +eps,760 +epsContinous,761 +epsPoint,762 +epsStatisticsContinous,763 +epsStatisticsPoint,764 +expandBy,765 +expandedAbbreviations,766 +expandedCodes,767 +expandedCrex_scales,768 +expandedCrex_units,769 +expandedCrex_widths,770 +expandedDescriptors,771 +expandedNames,772 +expandedOriginalCodes,773 +expandedOriginalReferences,774 +expandedOriginalScales,775 +expandedOriginalWidths,776 +expandedTypes,777 +expandedUnits,778 +experimentVersionNumber,779 +experimentVersionNumber1,780 +experimentVersionNumber2,781 +experimentVersionNumberOfAnalysis,782 +expoffset,783 +expver,784 +extendedFlag,785 +extraDim,786 +extraDimensionPresent,787 +extraLocalSectionNumber,788 +extraLocalSectionPresent,789 +extraValues,790 +extractAreaEastLongitude,791 +extractAreaLatitudeRank,792 +extractAreaLongitudeRank,793 +extractAreaNorthLatitude,794 +extractAreaSouthLatitude,795 +extractAreaWestLongitude,796 +extractDateTimeDayEnd,797 +extractDateTimeDayRank,798 +extractDateTimeDayStart,799 +extractDateTimeEnd,800 +extractDateTimeHourEnd,801 +extractDateTimeHourRank,802 +extractDateTimeHourStart,803 +extractDateTimeMinuteEnd,804 +extractDateTimeMinuteRank,805 +extractDateTimeMinuteStart,806 +extractDateTimeMonthEnd,807 +extractDateTimeMonthRank,808 +extractDateTimeMonthStart,809 +extractDateTimeSecondEnd,810 +extractDateTimeSecondRank,811 +extractDateTimeSecondStart,812 +extractDateTimeStart,813 +extractDateTimeYearEnd,814 +extractDateTimeYearRank,815 +extractDateTimeYearStart,816 +extractSubset,817 +extractSubsetIntervalEnd,818 +extractSubsetIntervalStart,819 +extractSubsetList,820 +extractedAreaNumberOfSubsets,821 +extractedDateTimeNumberOfSubsets,822 +extremeClockwiseWindDirection,823 +extremeCounterClockwiseWindDirection,824 +extremeValuesRVR1,825 +extremeValuesRVR2,826 +extremeValuesRVR3,827 +extremeValuesRVR4,828 +faFieldName,829 +faLevelName,830 +faModelName,831 +false,832 +falseEasting,833 +falseNorthing,834 +fcmonth,835 +fcperiod,836 +fgDate,837 +fgTime,838 +file,839 +fileConsistencyFlags,840 +firstDimension,841 +firstDimensionCoordinateValueDefinition,842 +firstDimensionPhysicalSignificance,843 +firstLatitude,844 +firstLatitudeInDegrees,845 +firstMonthUsedToBuildClimateMonth1,846 +firstMonthUsedToBuildClimateMonth2,847 +firstOrderValues,848 +flag,849 +flagForAnyFurtherInformation,850 +flagForIrregularGridCoordinateList,851 +flagForNormalOrStaggeredGrid,852 +flagShowingPostAuxiliaryArrayInUse,853 +flags,854 +floatVal,855 +floatValues,856 +forecastLeadTime,857 +forecastMonth,858 +forecastOrSingularVectorNumber,859 +forecastPeriod,860 +forecastPeriodFrom,861 +forecastPeriodTo,862 +forecastProbabilityNumber,863 +forecastSteps,864 +forecastTime,865 +forecastperiod,866 +formatVersionMajorNumber,867 +formatVersionMinorNumber,868 +freeFormData,869 +frequency,870 +frequencyNumber,871 +frequencyScalingFactor,872 +functionCode,873 +g,874 +g1conceptsLocalDirAll,875 +g1conceptsMasterDir,876 +g2grid,877 +gaussianGridName,878 +genVertHeightCoords,879 +generalExtended2ordr,880 +generatingProcessIdentificationNumber,881 +generatingProcessIdentifier,882 +generatingProcessTemplate,883 +generatingProcessTemplateNumber,884 +getNumberOfValues,885 +gg,886 +global,887 +globalDomain,888 +grib1divider,889 +grib2LocalSectionNumber,890 +grib2LocalSectionPresent,891 +grib2divider,892 +grib3divider,893 +gribDataQualityChecks,894 +gribMasterTablesVersionNumber,895 +gribTablesVersionNo,896 +grid,897 +gridCoordinate,898 +gridDefinition,899 +gridDefinitionDescription,900 +gridDefinitionSection,901 +gridDefinitionTemplateNumber,902 +gridDescriptionSectionPresent,903 +gridName,904 +gridPointPosition,905 +gridType,906 +groupInternalNodeK,907 +groupLeafNodeK,908 +groupLengths,909 +groupSplitting,910 +groupSplittingMethodUsed,911 +groupWidth,912 +groupWidths,913 +gts_CCCC,914 +gts_TTAAii,915 +gts_ddhh00,916 +gts_header,917 +halfByte,918 +hdate,919 +headersOnly,920 +heightLevelName,921 +heightOrPressureOfLevel,922 +heightPressureEtcOfLevels,923 +hideThis,924 +horizontalCoordinateDefinition,925 +horizontalCoordinateSupplement,926 +horizontalDimensionProcessed,927 +horizontalDomainTemplate,928 +horizontalDomainTemplateNumber,929 +hour,930 +hourOfAnalysis,931 +hourOfEndOfOverallTimeInterval,932 +hourOfForecast,933 +hourOfModelVersion,934 +hourOfReference,935 +hoursAfterDataCutoff,936 +hoursAfterReferenceTimeOfDataCutoff,937 +hundred,938 +iDirectionIncrement,939 +iDirectionIncrementGiven,940 +iDirectionIncrementGridLength,941 +iDirectionIncrementInDegrees,942 +iIncrement,943 +iScansNegatively,944 +iScansPositively,945 +ident,946 +identificationNumber,947 +identificationOfOriginatingGeneratingCentre,948 +identificationOfProject,949 +identifier,950 +ieeeFloats,951 +ifsParam,952 +ijDirectionIncrementGiven,953 +implementationDateOfModelCycle,954 +incrementOfLengths,955 +indexTemplate,956 +indexTemplateNumber,957 +indexedStorageInternalNodeK,958 +indexingDate,959 +indexingTime,960 +indicatorOfParameter,961 +indicatorOfTypeOfLevel,962 +indicatorOfUnitForTimeIncrement,963 +indicatorOfUnitForTimeRange,964 +indicatorOfUnitOfTimeRange,965 +inputDataPresentIndicator,966 +inputDelayedDescriptorReplicationFactor,967 +inputExtendedDelayedDescriptorReplicationFactor,968 +inputOriginatingCentre,969 +inputOverriddenReferenceValues,970 +inputProcessIdentifier,971 +inputShortDelayedDescriptorReplicationFactor,972 +instrument,973 +instrumentIdentifier,974 +instrumentType,975 +integerPointValues,976 +integerScaleFactor,977 +integerScalingFactorAppliedToDirections,978 +integerScalingFactorAppliedToFrequencies,979 +integerValues,980 +internalVersion,981 +internationalDataSubCategory,982 +interpretationOfNumberOfPoints,983 +intervalBetweenTimes,984 +isAccumulation,985 +isAuto,986 +isCavok,987 +isCavokTrend1,988 +isCavokTrend2,989 +isCavokTrend3,990 +isCavokTrend4,991 +isConstant,992 +isCorrection,993 +isEPS,994 +isEps,995 +isFillup,996 +isHindcast,997 +isOctahedral,998 +isRotatedGrid,999 +isSatellite,1000 +isSatelliteType,1001 +isSens,1002 +is_aerosol,1003 +is_aerosol_optical,1004 +is_chemical,1005 +is_chemical_distfn,1006 +is_efas,1007 +is_ocean2d_param,1008 +is_ocean3d_param,1009 +is_s2s,1010 +is_tigge,1011 +is_uerra,1012 +isectionNumber2,1013 +isectionNumber3,1014 +isectionNumber4,1015 +isotopeIdentificationNumber,1016 +iteration,1017 +iterationNumber,1018 +iteratorDisableUnrotate,1019 +jDirectionIncrement,1020 +jDirectionIncrementGiven,1021 +jDirectionIncrementGridLength,1022 +jDirectionIncrementInDegrees,1023 +jIncrement,1024 +jPointsAreConsecutive,1025 +jScansPositively,1026 +julianDay,1027 +julianForecastDay,1028 +keyData,1029 +keyMore,1030 +keySat,1031 +kindOfProduct,1032 +kurt,1033 +kurtosis,1034 +lBB,1035 +landtype,1036 +laplacianOperator,1037 +laplacianOperatorIsSet,1038 +laplacianScalingFactor,1039 +laplacianScalingFactorUnset,1040 +lastMonthUsedToBuildClimateMonth1,1041 +lastMonthUsedToBuildClimateMonth2,1042 +latLonValues,1043 +latitude,1044 +latitudeFirstInDegrees,1045 +latitudeLastInDegrees,1046 +latitudeLongitudeValues,1047 +latitudeOfCentralPointInClusterDomain,1048 +latitudeOfCentrePoint,1049 +latitudeOfCentrePointInDegrees,1050 +latitudeOfFirstGridPoint,1051 +latitudeOfFirstGridPointInDegrees,1052 +latitudeOfIcosahedronPole,1053 +latitudeOfLastGridPoint,1054 +latitudeOfLastGridPointInDegrees,1055 +latitudeOfNorthWestCornerOfArea,1056 +latitudeOfReferencePoint,1057 +latitudeOfReferencePointInDegrees,1058 +latitudeOfSouthEastCornerOfArea,1059 +latitudeOfSouthernPole,1060 +latitudeOfSouthernPoleInDegrees,1061 +latitudeOfStretchingPole,1062 +latitudeOfStretchingPoleInDegrees,1063 +latitudeOfSubSatellitePoint,1064 +latitudeOfSubSatellitePointInDegrees,1065 +latitudeOfTangencyPoint,1066 +latitudeOfThePoleOfStretching,1067 +latitudeOfThePolePoint,1068 +latitudeOfThePolePointInDegrees,1069 +latitudeOfTheSouthernPoleOfProjection,1070 +latitudeSexagesimal,1071 +latitudeWhereDxAndDyAreSpecified,1072 +latitudeWhereDxAndDyAreSpecifiedInDegrees,1073 +latitudes,1074 +latitudesList,1075 +latitudinalDirectionGridLength,1076 +lcwfvSuiteName,1077 +leadtime,1078 +legBaseDate,1079 +legBaseTime,1080 +legNumber,1081 +legacyGaussSubarea,1082 +lengthDescriptors,1083 +lengthIncrementForTheGroupLengths,1084 +lengthOf4DvarWindow,1085 +lengthOfHeaders,1086 +lengthOfIndexTemplate,1087 +lengthOfMessage,1088 +lengthOfOriginatorLocalTemplate,1089 +lengthOfProjectLocalTemplate,1090 +lengthOfTimeRange,1091 +lev,1092 +levTypeName,1093 +level,1094 +levelIndicator,1095 +levelType,1096 +levelist,1097 +levels,1098 +levtype,1099 +libraryVersion,1100 +listMembersMissing,1101 +listMembersMissing2,1102 +listMembersMissing3,1103 +listMembersMissing4,1104 +listMembersUsed,1105 +listMembersUsed2,1106 +listMembersUsed3,1107 +listMembersUsed4,1108 +listOfContributingSpectralBands,1109 +listOfDistributionFunctionParameter,1110 +listOfEnsembleForecastNumbers,1111 +listOfModelIdentifiers,1112 +listOfParametersUsedForClustering,1113 +listOfScaledFrequencies,1114 +local,1115 +localDateTime,1116 +localDay,1117 +localDecimalScaleFactor,1118 +localDefNumberOne,1119 +localDefNumberTwo,1120 +localDefinition,1121 +localDefinitionNumber,1122 +localDir,1123 +localExtensionPadding,1124 +localFlag,1125 +localFlagLatestVersion,1126 +localHour,1127 +localLatitude,1128 +localLatitude1,1129 +localLatitude2,1130 +localLongitude,1131 +localLongitude1,1132 +localLongitude2,1133 +localMinute,1134 +localMonth,1135 +localNumberOfObservations,1136 +localSecond,1137 +localSection,1138 +localSectionPresent,1139 +localTablesVersion,1140 +localTablesVersionNumber,1141 +localUsePresent,1142 +localYear,1143 +local_padding,1144 +local_use,1145 +logTransform,1146 +longitude,1147 +longitudeFirstInDegrees,1148 +longitudeLastInDegrees,1149 +longitudeOfCentralPointInClusterDomain,1150 +longitudeOfCentrePoint,1151 +longitudeOfCentrePointInDegrees,1152 +longitudeOfFirstDiamondCenterLine,1153 +longitudeOfFirstDiamondCentreLine,1154 +longitudeOfFirstDiamondCentreLineInDegrees,1155 +longitudeOfFirstGridPoint,1156 +longitudeOfFirstGridPointInDegrees,1157 +longitudeOfIcosahedronPole,1158 +longitudeOfLastGridPoint,1159 +longitudeOfLastGridPointInDegrees,1160 +longitudeOfNorthWestCornerOfArea,1161 +longitudeOfReferencePoint,1162 +longitudeOfReferencePointInDegrees,1163 +longitudeOfSouthEastCornerOfArea,1164 +longitudeOfSouthernPole,1165 +longitudeOfSouthernPoleInDegrees,1166 +longitudeOfStretchingPole,1167 +longitudeOfStretchingPoleInDegrees,1168 +longitudeOfSubSatellitePoint,1169 +longitudeOfSubSatellitePointInDegrees,1170 +longitudeOfTangencyPoint,1171 +longitudeOfThePoleOfStretching,1172 +longitudeOfThePolePoint,1173 +longitudeOfThePolePointInDegrees,1174 +longitudeOfTheSouthernPoleOfProjection,1175 +longitudeSexagesimal,1176 +longitudes,1177 +longitudesList,1178 +longitudinalDirectionGridLength,1179 +lowerLimit,1180 +lowerRange,1181 +lowerThreshold,1182 +lowerThresholdValue,1183 +ls_labeling,1184 +lsdate_bug,1185 +m,1186 +mAngleMultiplier,1187 +mBasicAngle,1188 +mars,1189 +marsClass,1190 +marsClass1,1191 +marsClass2,1192 +marsDir,1193 +marsDomain,1194 +marsEndStep,1195 +marsExperimentOffset,1196 +marsExpver,1197 +marsForecastMonth,1198 +marsGrid,1199 +marsIdent,1200 +marsKeywords,1201 +marsKeywords1,1202 +marsLamModel,1203 +marsLatitude,1204 +marsLevel,1205 +marsLevelist,1206 +marsLongitude,1207 +marsModel,1208 +marsParam,1209 +marsQuantile,1210 +marsRange,1211 +marsStartStep,1212 +marsStep,1213 +marsStream,1214 +marsStream1,1215 +marsStream2,1216 +marsType,1217 +marsType1,1218 +marsType2,1219 +mars_labeling,1220 +mask,1221 +masterDir,1222 +masterTableNumber,1223 +masterTablesVersionNumber,1224 +masterTablesVersionNumberLatest,1225 +matchAerosolBinNumber,1226 +matchAerosolPacking,1227 +matchLandType,1228 +matchSort,1229 +matchTimeRepres,1230 +matrixBitmapsPresent,1231 +matrixOfValues,1232 +max,1233 +maximum,1234 +md5Data,1235 +md5DataSection,1236 +md5GridSection,1237 +md5Headers,1238 +md5Product,1239 +md5Section1,1240 +md5Section10,1241 +md5Section2,1242 +md5Section3,1243 +md5Section4,1244 +md5Section5,1245 +md5Section6,1246 +md5Section7,1247 +md5Section8,1248 +md5Section9,1249 +md5Structure,1250 +md5TimeDomainSection,1251 +meanRVR1,1252 +meanRVR2,1253 +meanRVR3,1254 +meanRVR4,1255 +meanSize,1256 +meanValueRVR1,1257 +meanValueRVR2,1258 +meanValueRVR3,1259 +meanValueRVR4,1260 +meaningOfVerticalCoordinate,1261 +memberNumber,1262 +messageLength,1263 +metadata,1264 +method,1265 +methodNumber,1266 +million,1267 +min,1268 +minimum,1269 +minute,1270 +minuteOfAnalysis,1271 +minuteOfEndOfOverallTimeInterval,1272 +minuteOfForecast,1273 +minuteOfModelVersion,1274 +minuteOfReference,1275 +minutesAfterDataCutoff,1276 +minutesAfterReferenceTimeOfDataCutoff,1277 +missingDataFlag,1278 +missingValue,1279 +missingValueManagement,1280 +missingValueManagementUsed,1281 +missingValuesPresent,1282 +mixedCoordinateDefinition,1283 +mixedCoordinateFieldFlag,1284 +modeNumber,1285 +model,1286 +modelErrorType,1287 +modelIdentifier,1288 +modelName,1289 +modelVersionDate,1290 +modelVersionTime,1291 +molarMass,1292 +month,1293 +monthOfAnalysis,1294 +monthOfEndOfOverallTimeInterval,1295 +monthOfForecast,1296 +monthOfModelVersion,1297 +monthOfReference,1298 +monthlyVerificationDate,1299 +monthlyVerificationMonth,1300 +monthlyVerificationTime,1301 +monthlyVerificationYear,1302 +multiplicationFactorForLatLong,1303 +mybits,1304 +n,1305 +n2,1306 +n3,1307 +na,1308 +name,1309 +nameECMF,1310 +nameLegacyECMF,1311 +nameOfFirstFixedSurface,1312 +nameOfSecondFixedSurface,1313 +names,1314 +nd,1315 +neitherPresent,1316 +newSubtype,1317 +nlev,1318 +nnn,1319 +normAtFinalTime,1320 +normAtInitialTime,1321 +normal,1322 +northLatitudeOfCluster,1323 +northLatitudeOfDomainOfTubing,1324 +northWestLatitudeOfLPOArea,1325 +northWestLatitudeOfVerficationArea,1326 +northWestLongitudeOfLPOArea,1327 +northWestLongitudeOfVerficationArea,1328 +northernLatitudeOfClusterDomain,1329 +northernLatitudeOfDomain,1330 +nosigPresent,1331 +notDecoded,1332 +nt,1333 +number,1334 +numberInHorizontalCoordinates,1335 +numberInMixedCoordinateDefinition,1336 +numberInTheAuxiliaryArray,1337 +numberInTheGridCoordinateList,1338 +numberIncludedInAverage,1339 +numberMissingFromAveragesOrAccumulations,1340 +numberOfAnalysis,1341 +numberOfBits,1342 +numberOfBitsContainingEachPackedValue,1343 +numberOfBitsForScaledGroupLengths,1344 +numberOfBitsUsedForTheGroupWidths,1345 +numberOfBitsUsedForTheScaledGroupLengths,1346 +numberOfBytesInLocalDefinition,1347 +numberOfBytesOfFreeFormatData,1348 +numberOfBytesPerInteger,1349 +numberOfCategories,1350 +numberOfCharacters,1351 +numberOfChars,1352 +numberOfClusterHighResolution,1353 +numberOfClusterLowResolution,1354 +numberOfClusters,1355 +numberOfCodedValues,1356 +numberOfCoefficientsOrValuesUsedToSpecifyFirstDimensionCoordinateFunction,1357 +numberOfCoefficientsOrValuesUsedToSpecifySecondDimensionCoordinateFunction,1358 +numberOfColumns,1359 +numberOfComponents,1360 +numberOfContributingSpectralBands,1361 +numberOfControlForecastTube,1362 +numberOfCoordinatesValues,1363 +numberOfDataBinsAlongRadials,1364 +numberOfDataMatrices,1365 +numberOfDataPoints,1366 +numberOfDataPointsExpected,1367 +numberOfDataValues,1368 +numberOfDaysInClimateSamplingWindow,1369 +numberOfDiamonds,1370 +numberOfDirections,1371 +numberOfDistinctSection3s,1372 +numberOfDistinctSection4s,1373 +numberOfDistinctSection5s,1374 +numberOfDistinctSection6s,1375 +numberOfDistinctSection7s,1376 +numberOfDistinctSection8s,1377 +numberOfDistinctSection9s,1378 +numberOfDistributionFunctionParameters,1379 +numberOfEffectiveValues,1380 +numberOfFloats,1381 +numberOfForcasts,1382 +numberOfForecastsInCluster,1383 +numberOfForecastsInEnsemble,1384 +numberOfForecastsInTheCluster,1385 +numberOfForecastsInTube,1386 +numberOfFrequencies,1387 +numberOfGridInReference,1388 +numberOfGridUsed,1389 +numberOfGroups,1390 +numberOfGroupsOfDataValues,1391 +numberOfHorizontalPoints,1392 +numberOfIntegers,1393 +numberOfInts,1394 +numberOfIterations,1395 +numberOfLocalDefinitions,1396 +numberOfLogicals,1397 +numberOfMembersInCluster,1398 +numberOfMembersInEnsemble,1399 +numberOfMissing,1400 +numberOfMissingInStatisticalProcess,1401 +numberOfMissingValues,1402 +numberOfModeOfDistribution,1403 +numberOfModels,1404 +numberOfOctectsForNumberOfPoints,1405 +numberOfOctetsExtraDescriptors,1406 +numberOfOperationalForecastTube,1407 +numberOfPackedValues,1408 +numberOfParallelsBetweenAPoleAndTheEquator,1409 +numberOfParametersUsedForClustering,1410 +numberOfPartitions,1411 +numberOfPoints,1412 +numberOfPointsAlongAMeridian,1413 +numberOfPointsAlongAParallel,1414 +numberOfPointsAlongFirstAxis,1415 +numberOfPointsAlongSecondAxis,1416 +numberOfPointsAlongTheXAxis,1417 +numberOfPointsAlongTheYAxis,1418 +numberOfPointsAlongXAxis,1419 +numberOfPointsAlongXAxisInCouplingArea,1420 +numberOfPointsAlongYAxis,1421 +numberOfPointsAlongYAxisInCouplingArea,1422 +numberOfPointsInDomain,1423 +numberOfPointsUsed,1424 +numberOfPressureLevelsUsedForClustering,1425 +numberOfRadarSitesUsed,1426 +numberOfRadials,1427 +numberOfReforecastYearsInModelClimate,1428 +numberOfRemaininChars,1429 +numberOfRepresentativeMember,1430 +numberOfReservedBytes,1431 +numberOfRows,1432 +numberOfSecondOrderPackedValues,1433 +numberOfSection,1434 +numberOfSingularVectorsComputed,1435 +numberOfSingularVectorsEvolved,1436 +numberOfStepsUsedForClustering,1437 +numberOfSubsets,1438 +numberOfTensOfThousandsOfYearsOfOffset,1439 +numberOfTimeRange,1440 +numberOfTimeSteps,1441 +numberOfUnexpandedDescriptors,1442 +numberOfUnusedBitsAtEndOfSection3,1443 +numberOfUsedSpatialTiles,1444 +numberOfUsedTileAttributes,1445 +numberOfUsefulPointsAlongXAxis,1446 +numberOfUsefulPointsAlongYAxis,1447 +numberOfVGridUsed,1448 +numberOfValues,1449 +numberOfVerticalCoordinateValues,1450 +numberOfVerticalGridDescriptors,1451 +numberOfVerticalPoints,1452 +numberingOrderOfDiamonds,1453 +numericValues,1454 +observablePropertyTemplate,1455 +observablePropertyTemplateNumber,1456 +observationDiagnostic,1457 +observationGeneratingProcessIdentifier,1458 +observationType,1459 +observedData,1460 +obstype,1461 +oceanAtmosphereCoupling,1462 +oceanLevName,1463 +oceanStream,1464 +octetAtWichPackedDataBegins,1465 +offset,1466 +offsetAfterBitmap,1467 +offsetAfterCentreLocalSection,1468 +offsetAfterData,1469 +offsetAfterLocalSection,1470 +offsetAfterPadding,1471 +offsetBBitmap,1472 +offsetBSection5,1473 +offsetBSection6,1474 +offsetBSection9,1475 +offsetBeforeBitmap,1476 +offsetBeforeData,1477 +offsetBeforePL,1478 +offsetBeforePV,1479 +offsetDescriptors,1480 +offsetEndSection4,1481 +offsetFreeFormData,1482 +offsetFromOriginToInnerBound,1483 +offsetFromReferenceOfFirstTime,1484 +offsetICEFieldsUsed,1485 +offsetSection0,1486 +offsetSection1,1487 +offsetSection10,1488 +offsetSection11,1489 +offsetSection2,1490 +offsetSection3,1491 +offsetSection4,1492 +offsetSection5,1493 +offsetSection6,1494 +offsetSection7,1495 +offsetSection8,1496 +offsetSection9,1497 +offsetToEndOf4DvarWindow,1498 +offsetValuesBy,1499 +oldSubtype,1500 +one,1501 +oneConstant,1502 +oneMillionConstant,1503 +oneMinuteMeanMaximumRVR1,1504 +oneMinuteMeanMaximumRVR2,1505 +oneMinuteMeanMaximumRVR3,1506 +oneMinuteMeanMaximumRVR4,1507 +oneMinuteMeanMinimumRVR1,1508 +oneMinuteMeanMinimumRVR2,1509 +oneMinuteMeanMinimumRVR3,1510 +oneMinuteMeanMinimumRVR4,1511 +oneThousand,1512 +oper,1513 +operStream,1514 +operatingMode,1515 +operationalForecastCluster,1516 +optimisationTime,1517 +optimizeScaleFactor,1518 +optionalData,1519 +opttime,1520 +orderOfSPD,1521 +orderOfSpatialDifferencing,1522 +orientationOfTheGrid,1523 +orientationOfTheGridInDegrees,1524 +origin,1525 +originalParameterNumber,1526 +originalParameterTableNumber,1527 +originalSubCentreIdentifier,1528 +originatingCentre,1529 +originatingCentreOfAnalysis,1530 +originatorLocalTemplate,1531 +originatorLocalTemplateNumber,1532 +overlayTemplate,1533 +overlayTemplateNumber,1534 +pack,1535 +packedValues,1536 +packingError,1537 +packingType,1538 +padding,1539 +padding_grid1_1,1540 +padding_grid1_2,1541 +padding_grid3_1,1542 +padding_grid4_1,1543 +padding_grid50_1,1544 +padding_grid5_1,1545 +padding_grid90_1,1546 +padding_loc10_1,1547 +padding_loc12_1,1548 +padding_loc13_1,1549 +padding_loc13_2,1550 +padding_loc13_3,1551 +padding_loc13_4,1552 +padding_loc13_5,1553 +padding_loc14_1,1554 +padding_loc14_2,1555 +padding_loc15_1,1556 +padding_loc16_1,1557 +padding_loc17_2,1558 +padding_loc18_1,1559 +padding_loc18_2,1560 +padding_loc190_1,1561 +padding_loc191_1,1562 +padding_loc191_2,1563 +padding_loc191_3,1564 +padding_loc192_1,1565 +padding_loc19_2,1566 +padding_loc20_1,1567 +padding_loc21_1,1568 +padding_loc23_1,1569 +padding_loc244_1,1570 +padding_loc244_2,1571 +padding_loc244_3,1572 +padding_loc245_1,1573 +padding_loc245_2,1574 +padding_loc26_1,1575 +padding_loc27_1,1576 +padding_loc27_2,1577 +padding_loc28_1,1578 +padding_loc29_1,1579 +padding_loc29_2,1580 +padding_loc29_3,1581 +padding_loc2_1,1582 +padding_loc2_2,1583 +padding_loc30_1,1584 +padding_loc30_2,1585 +padding_loc37_1,1586 +padding_loc37_2,1587 +padding_loc38_1,1588 +padding_loc3_1,1589 +padding_loc4_2,1590 +padding_loc50_1,1591 +padding_loc5_1,1592 +padding_loc6_1,1593 +padding_loc7_1,1594 +padding_loc9_1,1595 +padding_loc9_2,1596 +padding_local11_1,1597 +padding_local1_1,1598 +padding_local1_31,1599 +padding_local40_1,1600 +padding_local_35,1601 +padding_local_7_1,1602 +padding_sec1_loc,1603 +padding_sec2_1,1604 +padding_sec2_2,1605 +padding_sec2_3,1606 +padding_sec3_1,1607 +padding_sec4_1,1608 +paleontologicalOffset,1609 +param,1610 +paramId,1611 +paramIdECMF,1612 +paramIdLegacyECMF,1613 +param_value_max,1614 +param_value_min,1615 +parameter,1616 +parameterCategory,1617 +parameterCode,1618 +parameterDiscipline,1619 +parameterIndicator,1620 +parameterName,1621 +parameterNumber,1622 +parameterUnits,1623 +parameters,1624 +parametersVersion,1625 +partitionItems,1626 +partitionNumber,1627 +partitionTable,1628 +partitions,1629 +pastTendencyRVR1,1630 +pastTendencyRVR2,1631 +pastTendencyRVR3,1632 +pastTendencyRVR4,1633 +patch_precip_fp,1634 +pentagonalResolutionParameterJ,1635 +pentagonalResolutionParameterK,1636 +pentagonalResolutionParameterM,1637 +percentileValue,1638 +periodOfTime,1639 +periodOfTimeIntervals,1640 +perturbationNumber,1641 +perturbedType,1642 +phase,1643 +physicalFlag1,1644 +physicalFlag2,1645 +physicalMeaningOfVerticalCoordinate,1646 +pl,1647 +platform,1648 +plusOneinOrdersOfSPD,1649 +points,1650 +postAuxiliary,1651 +postAuxiliaryArrayPresent,1652 +powerOfTenUsedToScaleClimateWeight,1653 +preBitmapValues,1654 +preProcessingParameter,1655 +precision,1656 +precisionOfTheUnpackedSubset,1657 +predefined_grid,1658 +predefined_grid_values,1659 +present,1660 +presentTrend1,1661 +presentTrend2,1662 +presentTrend3,1663 +presentTrend4,1664 +presentWeather1Present,1665 +presentWeather1PresentTrend1,1666 +presentWeather1PresentTrend2,1667 +presentWeather1PresentTrend3,1668 +presentWeather1PresentTrend4,1669 +presentWeather2Present,1670 +presentWeather2PresentTrend1,1671 +presentWeather2PresentTrend2,1672 +presentWeather2PresentTrend3,1673 +presentWeather2PresentTrend4,1674 +presentWeather3Present,1675 +presentWeather3PresentTrend1,1676 +presentWeather3PresentTrend2,1677 +presentWeather3PresentTrend3,1678 +presentWeather3PresentTrend4,1679 +pressureLevel,1680 +pressureUnits,1681 +primaryBitmap,1682 +primaryMissingValue,1683 +primaryMissingValueSubstitute,1684 +probContinous,1685 +probPoint,1686 +probProductDefinition,1687 +probabilityType,1688 +probabilityTypeName,1689 +process,1690 +produceLargeConstantFields,1691 +product,1692 +productDefinition,1693 +productDefinitionTemplateNumber,1694 +productDefinitionTemplateNumberInternal,1695 +productIdentifier,1696 +productType,1697 +productionStatusOfProcessedData,1698 +projectLocalTemplate,1699 +projectLocalTemplateNumber,1700 +projectionCenterFlag,1701 +projectionCentreFlag,1702 +pv,1703 +pvlLocation,1704 +qfe,1705 +qfePresent,1706 +qfeUnits,1707 +qnh,1708 +qnhAPresent,1709 +qnhPresent,1710 +qnhUnits,1711 +qualityControl,1712 +qualityControlIndicator,1713 +qualityValueAssociatedWithParameter,1714 +quantile,1715 +radialAngularSpacing,1716 +radials,1717 +radius,1718 +radiusInMetres,1719 +radiusOfCentralCluster,1720 +radiusOfClusterDomain,1721 +radiusOfTheEarth,1722 +range,1723 +rangeBinSpacing,1724 +rdbDateTime,1725 +rdbSubtype,1726 +rdbType,1727 +rdb_key,1728 +rdbtime,1729 +rdbtimeDate,1730 +rdbtimeDay,1731 +rdbtimeHour,1732 +rdbtimeMinute,1733 +rdbtimeMonth,1734 +rdbtimeSecond,1735 +rdbtimeTime,1736 +rdbtimeYear,1737 +realPart,1738 +realPartOf00,1739 +recDateTime,1740 +recentWeather,1741 +recentWeatherTry,1742 +rectime,1743 +rectimeDay,1744 +rectimeHour,1745 +rectimeMinute,1746 +rectimeSecond,1747 +reducedGrid,1748 +refdate,1749 +reference,1750 +referenceDate,1751 +referenceForGroupLengths,1752 +referenceForGroupWidths,1753 +referenceOfLengths,1754 +referenceOfWidths,1755 +referenceReflectivityForEchoTop,1756 +referenceSampleInterval,1757 +referenceStep,1758 +referenceValue,1759 +referenceValueError,1760 +reflectivityCalibrationConstant,1761 +remarkPresent,1762 +reportType,1763 +representationMode,1764 +representationType,1765 +representativeMember,1766 +reserved,1767 +reserved1,1768 +reserved2,1769 +reserved3,1770 +reservedNeedNotBePresent,1771 +reservedOctet,1772 +reservedSection2,1773 +reservedSection3,1774 +reservedSection4,1775 +resolutionAndComponentFlags,1776 +resolutionAndComponentFlags1,1777 +resolutionAndComponentFlags2,1778 +resolutionAndComponentFlags3,1779 +resolutionAndComponentFlags4,1780 +resolutionAndComponentFlags6,1781 +resolutionAndComponentFlags7,1782 +resolutionAndComponentFlags8,1783 +rootGroupObjectHeaderAddress,1784 +rootGroupSymbolTableEntry,1785 +rootTablesDir,1786 +roundedMarsLatitude,1787 +roundedMarsLevelist,1788 +roundedMarsLongitude,1789 +runwayBrakingActionState1,1790 +runwayBrakingActionState2,1791 +runwayBrakingActionState3,1792 +runwayBrakingActionState4,1793 +runwayDepositCodeState1,1794 +runwayDepositCodeState2,1795 +runwayDepositCodeState3,1796 +runwayDepositCodeState4,1797 +runwayDepositState1,1798 +runwayDepositState2,1799 +runwayDepositState3,1800 +runwayDepositState4,1801 +runwayDepthOfDepositCodeState1,1802 +runwayDepthOfDepositCodeState2,1803 +runwayDepthOfDepositCodeState3,1804 +runwayDepthOfDepositCodeState4,1805 +runwayDepthOfDepositState1,1806 +runwayDepthOfDepositState2,1807 +runwayDepthOfDepositState3,1808 +runwayDepthOfDepositState4,1809 +runwayDesignatorRVR1,1810 +runwayDesignatorRVR2,1811 +runwayDesignatorRVR3,1812 +runwayDesignatorRVR4,1813 +runwayDesignatorState1,1814 +runwayDesignatorState2,1815 +runwayDesignatorState3,1816 +runwayDesignatorState4,1817 +runwayExtentOfContaminationCodeState1,1818 +runwayExtentOfContaminationCodeState2,1819 +runwayExtentOfContaminationCodeState3,1820 +runwayExtentOfContaminationCodeState4,1821 +runwayExtentOfContaminationState1,1822 +runwayExtentOfContaminationState2,1823 +runwayExtentOfContaminationState3,1824 +runwayExtentOfContaminationState4,1825 +runwayFrictionCodeValueState1,1826 +runwayFrictionCodeValueState2,1827 +runwayFrictionCodeValueState3,1828 +runwayFrictionCodeValueState4,1829 +runwayFrictionCoefficientCodeState1,1830 +runwayFrictionCoefficientCodeState2,1831 +runwayFrictionCoefficientCodeState3,1832 +runwayFrictionCoefficientCodeState4,1833 +runwayFrictionCoefficientState1,1834 +runwayFrictionCoefficientState2,1835 +runwayFrictionCoefficientState3,1836 +runwayFrictionCoefficientState4,1837 +runwaySideCodeState1,1838 +runwaySideCodeState2,1839 +runwaySideCodeState3,1840 +runwaySideCodeState4,1841 +runwayState,1842 +sampleSizeOfModelClimate,1843 +satelliteID,1844 +satelliteIdentifier,1845 +satelliteNumber,1846 +satelliteSeries,1847 +scaleFactorAtReferencePoint,1848 +scaleFactorOfCentralWaveNumber,1849 +scaleFactorOfDistanceFromEnsembleMean,1850 +scaleFactorOfDistributionFunctionParameter,1851 +scaleFactorOfEarthMajorAxis,1852 +scaleFactorOfEarthMinorAxis,1853 +scaleFactorOfFirstFixedSurface,1854 +scaleFactorOfFirstSize,1855 +scaleFactorOfFirstWavelength,1856 +scaleFactorOfLengthOfSemiMajorAxis,1857 +scaleFactorOfLengthOfSemiMinorAxis,1858 +scaleFactorOfLowerLimit,1859 +scaleFactorOfMajorAxisOfOblateSpheroidEarth,1860 +scaleFactorOfMinorAxisOfOblateSpheroidEarth,1861 +scaleFactorOfPrimeMeridianOffset,1862 +scaleFactorOfRadiusOfSphericalEarth,1863 +scaleFactorOfSecondFixedSurface,1864 +scaleFactorOfSecondSize,1865 +scaleFactorOfSecondWavelength,1866 +scaleFactorOfStandardDeviation,1867 +scaleFactorOfStandardDeviationInTheCluster,1868 +scaleFactorOfUpperLimit,1869 +scaleValuesBy,1870 +scaledDirections,1871 +scaledFrequencies,1872 +scaledValueOfCentralWaveNumber,1873 +scaledValueOfDistanceFromEnsembleMean,1874 +scaledValueOfDistributionFunctionParameter,1875 +scaledValueOfEarthMajorAxis,1876 +scaledValueOfEarthMinorAxis,1877 +scaledValueOfFirstFixedSurface,1878 +scaledValueOfFirstSize,1879 +scaledValueOfFirstWavelength,1880 +scaledValueOfLengthOfSemiMajorAxis,1881 +scaledValueOfLengthOfSemiMinorAxis,1882 +scaledValueOfLowerLimit,1883 +scaledValueOfMajorAxisOfOblateSpheroidEarth,1884 +scaledValueOfMinorAxisOfOblateSpheroidEarth,1885 +scaledValueOfPrimeMeridianOffset,1886 +scaledValueOfRadiusOfSphericalEarth,1887 +scaledValueOfSecondFixedSurface,1888 +scaledValueOfSecondSize,1889 +scaledValueOfSecondWavelength,1890 +scaledValueOfStandardDeviation,1891 +scaledValueOfStandardDeviationInTheCluster,1892 +scaledValueOfUpperLimit,1893 +scalingFactorForFrequencies,1894 +scanPosition,1895 +scanningMode,1896 +scanningMode4,1897 +scanningMode5,1898 +scanningMode6,1899 +scanningMode7,1900 +scanningMode8,1901 +scanningModeForOneDiamond,1902 +sd,1903 +second,1904 +secondDimension,1905 +secondDimensionCoordinateValueDefinition,1906 +secondDimensionPhysicalSignificance,1907 +secondLatitude,1908 +secondLatitudeInDegrees,1909 +secondOfEndOfOverallTimeInterval,1910 +secondOfForecast,1911 +secondOfModelVersion,1912 +secondOrderFlags,1913 +secondOrderOfDifferentWidth,1914 +secondOrderValuesDifferentWidths,1915 +secondaryBitMap,1916 +secondaryBitmap,1917 +secondaryBitmapPresent,1918 +secondaryBitmaps,1919 +secondaryBitmapsCount,1920 +secondaryBitmapsSize,1921 +secondaryMissingValue,1922 +secondaryMissingValueSubstitute,1923 +secondsOfAnalysis,1924 +secondsOfReference,1925 +section,1926 +section0Length,1927 +section0Pointer,1928 +section1,1929 +section10Length,1930 +section10Pointer,1931 +section11Length,1932 +section11Pointer,1933 +section1Flags,1934 +section1Length,1935 +section1Padding,1936 +section1Pointer,1937 +section2Length,1938 +section2Padding,1939 +section2Pointer,1940 +section2Present,1941 +section2Used,1942 +section3Flags,1943 +section3Length,1944 +section3Padding,1945 +section3Pointer,1946 +section3UniqueIdentifier,1947 +section4,1948 +section4Length,1949 +section4Padding,1950 +section4Pointer,1951 +section4UniqueIdentifier,1952 +section5,1953 +section5Length,1954 +section5Pointer,1955 +section5UniqueIdentifier,1956 +section6,1957 +section6Length,1958 +section6Pointer,1959 +section6UniqueIdentifier,1960 +section7,1961 +section7Length,1962 +section7Pointer,1963 +section7UniqueIdentifier,1964 +section8,1965 +section8Length,1966 +section8Pointer,1967 +section8UniqueIdentifier,1968 +section9Length,1969 +section9Pointer,1970 +section9UniqueIdentifier,1971 +sectionLengthLimitForEnsembles,1972 +sectionLengthLimitForProbability,1973 +sectionNumber,1974 +sectionPosition,1975 +section_01,1976 +section_02,1977 +section_03,1978 +section_04,1979 +section_05,1980 +section_06,1981 +section_07,1982 +section_08,1983 +section_09,1984 +section_1,1985 +section_10,1986 +section_11,1987 +section_2,1988 +section_3,1989 +section_4,1990 +section_5,1991 +section_6,1992 +section_7,1993 +section_8,1994 +selectStepTemplateInstant,1995 +selectStepTemplateInterval,1996 +sensitiveAreaDomain,1997 +sequences,1998 +setBitsPerValue,1999 +setCalendarId,2000 +setDecimalPrecision,2001 +setLocalDefinition,2002 +setToMissingIfOutOfRange,2003 +sfc_levtype,2004 +shapeOfTheEarth,2005 +shapeOfVerificationArea,2006 +shortName,2007 +shortNameECMF,2008 +shortNameLegacyECMF,2009 +short_name,2010 +signature,2011 +significanceOfReferenceDateAndTime,2012 +significanceOfReferenceTime,2013 +simpleThinningMissingRadius,2014 +simpleThinningSkip,2015 +simpleThinningStart,2016 +siteElevation,2017 +siteId,2018 +siteLatitude,2019 +siteLongitude,2020 +sizeOfLength,2021 +sizeOfOffsets,2022 +sizeOfPostAuxiliaryArray,2023 +sizeOfPostAuxiliaryArrayPlusOne,2024 +skew,2025 +skewness,2026 +skipExtraKeyAttributes,2027 +sort,2028 +sourceOfGridDefinition,2029 +sourceSinkChemicalPhysicalProcess,2030 +southEastLatitudeOfLPOArea,2031 +southEastLatitudeOfVerficationArea,2032 +southEastLongitudeOfLPOArea,2033 +southEastLongitudeOfVerficationArea,2034 +southLatitudeOfCluster,2035 +southLatitudeOfDomainOfTubing,2036 +southPoleOnProjectionPlane,2037 +southernLatitudeOfClusterDomain,2038 +southernLatitudeOfDomain,2039 +sp1,2040 +sp2,2041 +sp3,2042 +spaceUnitFlag,2043 +spacingOfBinsAlongRadials,2044 +spare,2045 +spare2,2046 +spatialProcessing,2047 +spatialSmoothingOfProduct,2048 +spectralDataRepresentationMode,2049 +spectralDataRepresentationType,2050 +spectralMode,2051 +spectralType,2052 +sphericalHarmonics,2053 +standardDeviation,2054 +standardParallel,2055 +standardParallelInDegrees,2056 +standardParallelInMicrodegrees,2057 +startOfHeaders,2058 +startOfMessage,2059 +startOfRange,2060 +startStep,2061 +startStepInHours,2062 +startTimeStep,2063 +startingAzimuth,2064 +statisticalProcess,2065 +statisticalProcessesList,2066 +statistics,2067 +status,2068 +step,2069 +stepForClustering,2070 +stepHumanReadable,2071 +stepInHours,2072 +stepRange,2073 +stepRangeInHours,2074 +stepType,2075 +stepTypeForConversion,2076 +stepTypeInternal,2077 +stepUnits,2078 +stepZero,2079 +stream,2080 +streamOfAnalysis,2081 +stretchingFactor,2082 +stretchingFactorScaled,2083 +stringValues,2084 +subCentre,2085 +subDefinitions1,2086 +subDefinitions2,2087 +subLocalDefinition1,2088 +subLocalDefinition2,2089 +subLocalDefinitionLength1,2090 +subLocalDefinitionLength2,2091 +subLocalDefinitionNumber1,2092 +subLocalDefinitionNumber2,2093 +subSetJ,2094 +subSetK,2095 +subSetM,2096 +subcentreOfAnalysis,2097 +subdivisionsOfBasicAngle,2098 +suiteName,2099 +superblockExtensionAddress,2100 +swapScanningLat,2101 +swapScanningLon,2102 +swapScanningX,2103 +swapScanningY,2104 +system,2105 +systemNumber,2106 +t,2107 +table2Version,2108 +tableCode,2109 +tableNumber,2110 +tableReference,2111 +tablesLocalDir,2112 +tablesMasterDir,2113 +tablesVersion,2114 +tablesVersionLatest,2115 +targetCompressionRatio,2116 +td,2117 +tempPressureUnits,2118 +temperature,2119 +temperatureAndDewpointPresent,2120 +templatesLocalDir,2121 +templatesMasterDir,2122 +theHindcastMarsStream,2123 +theMessage,2124 +thisExperimentVersionNumber,2125 +thisMarsClass,2126 +thisMarsStream,2127 +thisMarsType,2128 +thousand,2129 +three,2130 +threshold,2131 +thresholdIndicator,2132 +tiggeCentre,2133 +tiggeLAMName,2134 +tiggeLocalVersion,2135 +tiggeModel,2136 +tiggeSection,2137 +tiggeSuiteID,2138 +tigge_name,2139 +tigge_short_name,2140 +tileClassification,2141 +tileIndex,2142 +time,2143 +timeCoordinateDefinition,2144 +timeDomainTemplate,2145 +timeDomainTemplateNumber,2146 +timeIncrement,2147 +timeIncrementBetweenSuccessiveFields,2148 +timeOfAnalysis,2149 +timeOfForecast,2150 +timeOfModelVersion,2151 +timeOfReference,2152 +timeRangeIndicator,2153 +timeRangeIndicatorFromStepRange,2154 +timeUnitFlag,2155 +timerepres,2156 +topLevel,2157 +total,2158 +totalAerosolBinsNumbers,2159 +totalInitialConditions,2160 +totalLength,2161 +totalNumber,2162 +totalNumberOfClusters,2163 +totalNumberOfDataValuesMissingInStatisticalProcess,2164 +totalNumberOfDirections,2165 +totalNumberOfForecastProbabilities,2166 +totalNumberOfFrequencies,2167 +totalNumberOfGridPoints,2168 +totalNumberOfIterations,2169 +totalNumberOfRepetitions,2170 +totalNumberOfTileAttributePairs,2171 +totalNumberOfTubes,2172 +totalNumberOfValuesInUnpackedSubset,2173 +totalNumberOfdimensions,2174 +treatmentOfMissingData,2175 +true,2176 +trueLengthOfLastGroup,2177 +truncateDegrees,2178 +truncateLaplacian,2179 +tsectionNumber3,2180 +tsectionNumber4,2181 +tsectionNumber5,2182 +tubeDomain,2183 +tubeNumber,2184 +two,2185 +twoOrdersOfSPD,2186 +type,2187 +typeOfAnalysis,2188 +typeOfAuxiliaryInformation,2189 +typeOfCalendar,2190 +typeOfCompressionUsed,2191 +typeOfDistributionFunction,2192 +typeOfEnsembleForecast,2193 +typeOfEnsembleMember,2194 +typeOfFirstFixedSurface,2195 +typeOfGeneratingProcess,2196 +typeOfGrid,2197 +typeOfHorizontalLine,2198 +typeOfIntervalForFirstAndSecondSize,2199 +typeOfIntervalForFirstAndSecondWavelength,2200 +typeOfLevel,2201 +typeOfLevelECMF,2202 +typeOfOriginalFieldValues,2203 +typeOfPacking,2204 +typeOfPostProcessing,2205 +typeOfPreProcessing,2206 +typeOfProcessedData,2207 +typeOfSSTFieldUsed,2208 +typeOfSecondFixedSurface,2209 +typeOfSizeInterval,2210 +typeOfStatisticalPostProcessingOfEnsembleMembers,2211 +typeOfStatisticalProcessing,2212 +typeOfTimeIncrement,2213 +typeOfTimeIncrementBetweenSuccessiveFieldsUsedInTheStatisticalProcessing,2214 +typeOfWavelengthInterval,2215 +typicalCentury,2216 +typicalDate,2217 +typicalDateTime,2218 +typicalDay,2219 +typicalHour,2220 +typicalMinute,2221 +typicalMonth,2222 +typicalSecond,2223 +typicalTime,2224 +typicalYear,2225 +typicalYear2,2226 +typicalYearOfCentury,2227 +uco,2228 +ucs,2229 +unexpandedDescriptors,2230 +unexpandedDescriptorsEncoded,2231 +unitOfOffsetFromReferenceTime,2232 +unitOfTime,2233 +unitOfTimeIncrement,2234 +unitOfTimeRange,2235 +units,2236 +unitsBias,2237 +unitsConversionOffset,2238 +unitsConversionScaleFactor,2239 +unitsDecimalScaleFactor,2240 +unitsECMF,2241 +unitsFactor,2242 +unitsLegacyECMF,2243 +unitsOfFirstFixedSurface,2244 +unitsOfSecondFixedSurface,2245 +unknown,2246 +unpack,2247 +unpackedError,2248 +unpackedSubsetPrecision,2249 +unpackedValues,2250 +unsignedIntegers,2251 +unusedBitsInBitmap,2252 +updateSequenceNumber,2253 +upperLimit,2254 +upperRange,2255 +upperThreshold,2256 +upperThresholdValue,2257 +userDateEnd,2258 +userDateStart,2259 +userDateTimeEnd,2260 +userDateTimeStart,2261 +userTimeEnd,2262 +userTimeStart,2263 +uuidOfHGrid,2264 +uuidOfVGrid,2265 +uvRelativeToGrid,2266 +validityDate,2267 +validityTime,2268 +values,2269 +variationOfVisibility,2270 +variationOfVisibilityDirection,2271 +variationOfVisibilityDirectionAngle,2272 +variationOfVisibilityDirectionTrend1,2273 +variationOfVisibilityDirectionTrend2,2274 +variationOfVisibilityDirectionTrend3,2275 +variationOfVisibilityDirectionTrend4,2276 +variationOfVisibilityTrend1,2277 +variationOfVisibilityTrend2,2278 +variationOfVisibilityTrend3,2279 +variationOfVisibilityTrend4,2280 +varno,2281 +verificationDate,2282 +verificationMonth,2283 +verificationYear,2284 +verifyingMonth,2285 +version,2286 +versionNumOfFilesFreeSpaceStorage,2287 +versionNumOfRootGroupSymbolTableEntry,2288 +versionNumOfSharedHeaderMessageFormat,2289 +versionNumberOfExperimentalSuite,2290 +versionNumberOfGribLocalTables,2291 +versionNumberOfSuperblock,2292 +versionOfModelClimate,2293 +verticalCoordinate,2294 +verticalCoordinateDefinition,2295 +verticalDomainTemplate,2296 +verticalDomainTemplateNumber,2297 +verticalVisibility,2298 +verticalVisibilityCoded,2299 +visibility,2300 +visibilityInKilometresTrend1,2301 +visibilityInKilometresTrend2,2302 +visibilityInKilometresTrend3,2303 +visibilityInKilometresTrend4,2304 +visibilityTrend1,2305 +visibilityTrend2,2306 +visibilityTrend3,2307 +visibilityTrend4,2308 +waveDomain,2309 +weightAppliedToClimateMonth1,2310 +westLongitudeOfCluster,2311 +westLongitudeOfDomainOfTubing,2312 +westernLongitudeOfClusterDomain,2313 +westernLongitudeOfDomain,2314 +widthOfFirstOrderValues,2315 +widthOfLengths,2316 +widthOfSPD,2317 +widthOfWidths,2318 +windDirection,2319 +windDirectionTrend1,2320 +windDirectionTrend2,2321 +windDirectionTrend3,2322 +windDirectionTrend4,2323 +windGust,2324 +windGustTrend1,2325 +windGustTrend2,2326 +windGustTrend3,2327 +windGustTrend4,2328 +windPresent,2329 +windSpeed,2330 +windSpeedTrend1,2331 +windSpeedTrend2,2332 +windSpeedTrend3,2333 +windSpeedTrend4,2334 +windUnits,2335 +windUnitsTrend1,2336 +windUnitsTrend2,2337 +windUnitsTrend3,2338 +windUnitsTrend4,2339 +windVariableDirection,2340 +windVariableDirectionTrend1,2341 +windVariableDirectionTrend2,2342 +windVariableDirectionTrend3,2343 +windVariableDirectionTrend4,2344 +wrongPadding,2345 +xCoordinateOfOriginOfSectorImage,2346 +xCoordinateOfSubSatellitePoint,2347 +xDirectionGridLength,2348 +xDirectionGridLengthInMetres,2349 +xDirectionGridLengthInMillimetres,2350 +xFirst,2351 +xLast,2352 +yCoordinateOfOriginOfSectorImage,2353 +yCoordinateOfSubSatellitePoint,2354 +yDirectionGridLength,2355 +yDirectionGridLengthInMetres,2356 +yDirectionGridLengthInMillimetres,2357 +yFirst,2358 +yLast,2359 +year,2360 +yearOfAnalysis,2361 +yearOfCentury,2362 +yearOfEndOfOverallTimeInterval,2363 +yearOfForecast,2364 +yearOfModelVersion,2365 +yearOfReference,2366 +zero,2367 +zeros,2368